From d02eff00d9134e6150cf174cd5f92ad127a7cd5e Mon Sep 17 00:00:00 2001 From: jimmystar Date: Fri, 6 Sep 2013 16:31:21 +0800 Subject: [PATCH 01/64] Update cocos2d_specifics.cpp fix bug about scheduler, if this value is -1, it will work all right in Emulator, but run error in real device, just call one time. --- .../javascript/bindings/cocos2d_specifics.cpp.REMOVED.git-id | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripting/javascript/bindings/cocos2d_specifics.cpp.REMOVED.git-id b/scripting/javascript/bindings/cocos2d_specifics.cpp.REMOVED.git-id index 9edcd1b1c0..09fa749af6 100644 --- a/scripting/javascript/bindings/cocos2d_specifics.cpp.REMOVED.git-id +++ b/scripting/javascript/bindings/cocos2d_specifics.cpp.REMOVED.git-id @@ -1 +1 @@ -cbe012e3979f31ec4001d6a0b65ba46823b497d7 \ No newline at end of file +0850425d8b210a393b8ae220cfd456f4e7907f37 \ No newline at end of file From 43c2001d71b116629bdffdaa7cdd8430d875ab0d Mon Sep 17 00:00:00 2001 From: Keita Obo Date: Tue, 8 Oct 2013 12:53:38 +0900 Subject: [PATCH 02/64] Avoid unnecessary object duplication using passing arguments by reference --- .../GUI/CCControlExtension/CCScale9Sprite.cpp | 29 +++++++------- .../GUI/CCControlExtension/CCScale9Sprite.h | 38 +++++++++---------- 2 files changed, 34 insertions(+), 33 deletions(-) diff --git a/extensions/GUI/CCControlExtension/CCScale9Sprite.cpp b/extensions/GUI/CCControlExtension/CCScale9Sprite.cpp index 659ba4966c..599bcb5f36 100644 --- a/extensions/GUI/CCControlExtension/CCScale9Sprite.cpp +++ b/extensions/GUI/CCControlExtension/CCScale9Sprite.cpp @@ -84,12 +84,12 @@ bool Scale9Sprite::init() return this->initWithBatchNode(NULL, Rect::ZERO, Rect::ZERO); } -bool Scale9Sprite::initWithBatchNode(SpriteBatchNode* batchnode, Rect rect, Rect capInsets) +bool Scale9Sprite::initWithBatchNode(SpriteBatchNode* batchnode, const Rect& rect, const Rect& capInsets) { return this->initWithBatchNode(batchnode, rect, false, capInsets); } -bool Scale9Sprite::initWithBatchNode(SpriteBatchNode* batchnode, Rect rect, bool rotated, Rect capInsets) +bool Scale9Sprite::initWithBatchNode(SpriteBatchNode* batchnode, const Rect& rect, bool rotated, const Rect& capInsets) { if(batchnode) { @@ -108,10 +108,11 @@ bool Scale9Sprite::initWithBatchNode(SpriteBatchNode* batchnode, Rect rect, bool #define TRANSLATE_Y(x, y, ytranslate) \ y+=ytranslate; \ -bool Scale9Sprite::updateWithBatchNode(SpriteBatchNode* batchnode, Rect rect, bool rotated, Rect capInsets) +bool Scale9Sprite::updateWithBatchNode(SpriteBatchNode* batchnode, const Rect& originalRect, bool rotated, const Rect& capInsets) { GLubyte opacity = getOpacity(); Color3B color = getColor(); + Rect rect(originalRect); // Release old sprites this->removeAllChildrenWithCleanup(true); @@ -453,7 +454,7 @@ void Scale9Sprite::updatePositions() _centre->setPosition(Point(leftWidth, bottomHeight)); } -bool Scale9Sprite::initWithFile(const char* file, Rect rect, Rect capInsets) +bool Scale9Sprite::initWithFile(const char* file, const Rect& rect, const Rect& capInsets) { CCASSERT(file != NULL, "Invalid file for sprite"); @@ -462,7 +463,7 @@ bool Scale9Sprite::initWithFile(const char* file, Rect rect, Rect capInsets) return pReturn; } -Scale9Sprite* Scale9Sprite::create(const char* file, Rect rect, Rect capInsets) +Scale9Sprite* Scale9Sprite::create(const char* file, const Rect& rect, const Rect& capInsets) { Scale9Sprite* pReturn = new Scale9Sprite(); if ( pReturn && pReturn->initWithFile(file, rect, capInsets) ) @@ -474,14 +475,14 @@ Scale9Sprite* Scale9Sprite::create(const char* file, Rect rect, Rect capInsets) return NULL; } -bool Scale9Sprite::initWithFile(const char* file, Rect rect) +bool Scale9Sprite::initWithFile(const char* file, const Rect& rect) { CCASSERT(file != NULL, "Invalid file for sprite"); bool pReturn = this->initWithFile(file, rect, Rect::ZERO); return pReturn; } -Scale9Sprite* Scale9Sprite::create(const char* file, Rect rect) +Scale9Sprite* Scale9Sprite::create(const char* file, const Rect& rect) { Scale9Sprite* pReturn = new Scale9Sprite(); if ( pReturn && pReturn->initWithFile(file, rect) ) @@ -494,13 +495,13 @@ Scale9Sprite* Scale9Sprite::create(const char* file, Rect rect) } -bool Scale9Sprite::initWithFile(Rect capInsets, const char* file) +bool Scale9Sprite::initWithFile(const Rect& capInsets, const char* file) { bool pReturn = this->initWithFile(file, Rect::ZERO, capInsets); return pReturn; } -Scale9Sprite* Scale9Sprite::create(Rect capInsets, const char* file) +Scale9Sprite* Scale9Sprite::create(const Rect& capInsets, const char* file) { Scale9Sprite* pReturn = new Scale9Sprite(); if ( pReturn && pReturn->initWithFile(capInsets, file) ) @@ -531,7 +532,7 @@ Scale9Sprite* Scale9Sprite::create(const char* file) return NULL; } -bool Scale9Sprite::initWithSpriteFrame(SpriteFrame* spriteFrame, Rect capInsets) +bool Scale9Sprite::initWithSpriteFrame(SpriteFrame* spriteFrame, const Rect& capInsets) { Texture2D* texture = spriteFrame->getTexture(); CCASSERT(texture != NULL, "CCTexture must be not nil"); @@ -543,7 +544,7 @@ bool Scale9Sprite::initWithSpriteFrame(SpriteFrame* spriteFrame, Rect capInsets) return pReturn; } -Scale9Sprite* Scale9Sprite::createWithSpriteFrame(SpriteFrame* spriteFrame, Rect capInsets) +Scale9Sprite* Scale9Sprite::createWithSpriteFrame(SpriteFrame* spriteFrame, const Rect& capInsets) { Scale9Sprite* pReturn = new Scale9Sprite(); if ( pReturn && pReturn->initWithSpriteFrame(spriteFrame, capInsets) ) @@ -573,7 +574,7 @@ Scale9Sprite* Scale9Sprite::createWithSpriteFrame(SpriteFrame* spriteFrame) return NULL; } -bool Scale9Sprite::initWithSpriteFrameName(const char* spriteFrameName, Rect capInsets) +bool Scale9Sprite::initWithSpriteFrameName(const char* spriteFrameName, const Rect& capInsets) { CCASSERT((SpriteFrameCache::getInstance()) != NULL, "SpriteFrameCache::getInstance() must be non-NULL"); @@ -586,7 +587,7 @@ bool Scale9Sprite::initWithSpriteFrameName(const char* spriteFrameName, Rect cap return pReturn; } -Scale9Sprite* Scale9Sprite::createWithSpriteFrameName(const char* spriteFrameName, Rect capInsets) +Scale9Sprite* Scale9Sprite::createWithSpriteFrameName(const char* spriteFrameName, const Rect& capInsets) { Scale9Sprite* pReturn = new Scale9Sprite(); if ( pReturn && pReturn->initWithSpriteFrameName(spriteFrameName, capInsets) ) @@ -621,7 +622,7 @@ Scale9Sprite* Scale9Sprite::createWithSpriteFrameName(const char* spriteFrameNam } -Scale9Sprite* Scale9Sprite::resizableSpriteWithCapInsets(Rect capInsets) +Scale9Sprite* Scale9Sprite::resizableSpriteWithCapInsets(const Rect& capInsets) { Scale9Sprite* pReturn = new Scale9Sprite(); if ( pReturn && pReturn->initWithBatchNode(_scale9Image, _spriteRect, capInsets) ) diff --git a/extensions/GUI/CCControlExtension/CCScale9Sprite.h b/extensions/GUI/CCControlExtension/CCScale9Sprite.h index d8977729a5..b4d9403c74 100644 --- a/extensions/GUI/CCControlExtension/CCScale9Sprite.h +++ b/extensions/GUI/CCControlExtension/CCScale9Sprite.h @@ -70,25 +70,25 @@ public: * Creates a 9-slice sprite with a texture file, a delimitation zone and * with the specified cap insets. * - * @see initWithFile(const char *file, Rect rect, Rect capInsets) + * @see initWithFile(const char *file, const Rect& rect, const Rect& capInsets) */ - static Scale9Sprite* create(const char* file, Rect rect, Rect capInsets); + static Scale9Sprite* create(const char* file, const Rect& rect, const Rect& capInsets); /** * Creates a 9-slice sprite with a texture file. The whole texture will be * broken down into a 3×3 grid of equal blocks. * - * @see initWithFile(Rect capInsets, const char *file) + * @see initWithFile(const Rect& capInsets, const char *file) */ - static Scale9Sprite* create(Rect capInsets, const char* file); + static Scale9Sprite* create(const Rect& capInsets, const char* file); /** * Creates a 9-slice sprite with a texture file and a delimitation zone. The * texture will be broken down into a 3×3 grid of equal blocks. * - * @see initWithFile(const char *file, Rect rect) + * @see initWithFile(const char *file, const Rect& rect) */ - static Scale9Sprite* create(const char* file, Rect rect); + static Scale9Sprite* create(const char* file, const Rect& rect); /** * Creates a 9-slice sprite with a texture file. The whole texture will be @@ -114,9 +114,9 @@ public: * to resize the sprite will all it's 9-slice goodness intract. * It respects the anchorPoint too. * - * @see initWithSpriteFrame(SpriteFrame *spriteFrame, Rect capInsets) + * @see initWithSpriteFrame(SpriteFrame *spriteFrame, const Rect& capInsets) */ - static Scale9Sprite* createWithSpriteFrame(SpriteFrame* spriteFrame, Rect capInsets); + static Scale9Sprite* createWithSpriteFrame(SpriteFrame* spriteFrame, const Rect& capInsets); /** * Creates a 9-slice sprite with an sprite frame name. @@ -135,9 +135,9 @@ public: * to resize the sprite will all it's 9-slice goodness intract. * It respects the anchorPoint too. * - * @see initWithSpriteFrameName(const char *spriteFrameName, Rect capInsets) + * @see initWithSpriteFrameName(const char *spriteFrameName, const Rect& capInsets) */ - static Scale9Sprite* createWithSpriteFrameName(const char*spriteFrameName, Rect capInsets); + static Scale9Sprite* createWithSpriteFrameName(const char*spriteFrameName, const Rect& capInsets); /** * Initializes a 9-slice sprite with a texture file, a delimitation zone and @@ -152,7 +152,7 @@ public: * texture's full rect. * @param capInsets The values to use for the cap insets. */ - virtual bool initWithFile(const char* file, Rect rect, Rect capInsets); + virtual bool initWithFile(const char* file, const Rect& rect, const Rect& capInsets); /** * Initializes a 9-slice sprite with a texture file and a delimitation zone. The @@ -166,7 +166,7 @@ public: * is the whole image. If the shape is the whole texture, set this to the * texture's full rect. */ - virtual bool initWithFile(const char* file, Rect rect); + virtual bool initWithFile(const char* file, const Rect& rect); /** * Initializes a 9-slice sprite with a texture file and with the specified cap @@ -178,7 +178,7 @@ public: * @param file The name of the texture file. * @param capInsets The values to use for the cap insets. */ - virtual bool initWithFile(Rect capInsets, const char* file); + virtual bool initWithFile(const Rect& capInsets, const char* file); /** * Initializes a 9-slice sprite with a texture file. The whole texture will be @@ -201,7 +201,7 @@ public: * @param spriteFrame The sprite frame object. * @param capInsets The values to use for the cap insets. */ - virtual bool initWithSpriteFrame(SpriteFrame* spriteFrame, Rect capInsets); + virtual bool initWithSpriteFrame(SpriteFrame* spriteFrame, const Rect& capInsets); /** * Initializes a 9-slice sprite with an sprite frame. @@ -223,7 +223,7 @@ public: * @param spriteFrameName The sprite frame name. * @param capInsets The values to use for the cap insets. */ - virtual bool initWithSpriteFrameName(const char*spriteFrameName, Rect capInsets); + virtual bool initWithSpriteFrameName(const char*spriteFrameName, const Rect& capInsets); /** * Initializes a 9-slice sprite with an sprite frame name. @@ -236,8 +236,8 @@ public: virtual bool initWithSpriteFrameName(const char*spriteFrameName); virtual bool init(); - virtual bool initWithBatchNode(SpriteBatchNode* batchnode, Rect rect, bool rotated, Rect capInsets); - virtual bool initWithBatchNode(SpriteBatchNode* batchnode, Rect rect, Rect capInsets); + virtual bool initWithBatchNode(SpriteBatchNode* batchnode, const Rect& rect, bool rotated, const Rect& capInsets); + virtual bool initWithBatchNode(SpriteBatchNode* batchnode, const Rect& rect, const Rect& capInsets); /** * Creates and returns a new sprite object with the specified cap insets. @@ -247,9 +247,9 @@ public: * * @param capInsets The values to use for the cap insets. */ - Scale9Sprite* resizableSpriteWithCapInsets(Rect capInsets); + Scale9Sprite* resizableSpriteWithCapInsets(const Rect& capInsets); - virtual bool updateWithBatchNode(SpriteBatchNode* batchnode, Rect rect, bool rotated, Rect capInsets); + virtual bool updateWithBatchNode(SpriteBatchNode* batchnode, const Rect& rect, bool rotated, const Rect& capInsets); virtual void setSpriteFrame(SpriteFrame * spriteFrame); // overrides From 0c1e2be30c45d21afa284bf472c9a323e90f2b7c Mon Sep 17 00:00:00 2001 From: James Chen Date: Fri, 11 Oct 2013 15:12:57 +0800 Subject: [PATCH 03/64] Update AUTHORS [ci skip] --- AUTHORS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/AUTHORS b/AUTHORS index c4df157fd3..df6dcdfc8d 100644 --- a/AUTHORS +++ b/AUTHORS @@ -610,6 +610,9 @@ Developers: Added support of passing array to cc.Sequence.create and cc.Spawn.create. Fixed a bug that sys.localStorage.getItem() does not support non-ascii string. Fixed a memory leak in XMLHttpRequest. + + Keita Obo (ktaobo) + Avoid unnecessary object duplication using passing arguments by reference. Retired Core Developers: WenSheng Yang From b6f439a4f91b2dd41d21919400f9937d696e5c20 Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Fri, 11 Oct 2013 07:15:06 +0000 Subject: [PATCH 04/64] [AUTO] : updating submodule reference to latest autogenerated bindings --- scripting/auto-generated | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripting/auto-generated b/scripting/auto-generated index 6f5bc7bbd0..f6abef7b53 160000 --- a/scripting/auto-generated +++ b/scripting/auto-generated @@ -1 +1 @@ -Subproject commit 6f5bc7bbd036c76e7c6be121573662099997a0a4 +Subproject commit f6abef7b531981f7bfa1dca050718d08b867324c From 5c67fd2c05ca3463f4947a2d56640620e7cfab12 Mon Sep 17 00:00:00 2001 From: James Chen Date: Fri, 11 Oct 2013 15:15:44 +0800 Subject: [PATCH 05/64] Update AUTHORS [ci skip] --- AUTHORS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AUTHORS b/AUTHORS index df6dcdfc8d..283ab7c812 100644 --- a/AUTHORS +++ b/AUTHORS @@ -612,7 +612,7 @@ Developers: Fixed a memory leak in XMLHttpRequest. Keita Obo (ktaobo) - Avoid unnecessary object duplication using passing arguments by reference. + Avoid unnecessary object duplication for Scale9Sprite. Retired Core Developers: WenSheng Yang From eb9f009c7325e2219c153b59baa792dc886020d9 Mon Sep 17 00:00:00 2001 From: James Chen Date: Fri, 11 Oct 2013 15:16:30 +0800 Subject: [PATCH 06/64] Update CHANGELOG [ci skip] --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index 33a5c74148..f61d7fc42b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -5,6 +5,7 @@ cocos2d-x-3.0alpha1 @??? 2013 [FIX] Spine: fix memory leaks [FIX] fixed a memory leak in XMLHTTPRequest.cpp [FIX] removeSpriteFramesFromFile() crashes if file doesn't exist. + [FIX] Avoid unnecessary object duplication for Scale9Sprite. [Android] [FIX] Added EGL_RENDERABLE_TYPE to OpenGL attributes [NEW] Added Cocos2dxHelper.runOnGLThread(Runnable) again From 7890efb24faf9b32becf909c8ff7612e6ca407b4 Mon Sep 17 00:00:00 2001 From: James Chen Date: Fri, 11 Oct 2013 18:23:16 +0800 Subject: [PATCH 07/64] Update CHANGELOG [ci skip] --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index f61d7fc42b..6163db0772 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -15,6 +15,7 @@ cocos2d-x-3.0alpha1 @??? 2013 [Javascript binding] [FIX] Fixed a memory leak in ScriptingCore::runScript() [FIX] sys.localStorage.getItem() does not support non-ascii string. + [FIX] cc.Scheduler.schedule(target, func) without repeat argument couldn't repeat schedule forever on device. [Lua Binding] [NEW] Added Armature lua binding and added test samples. From f1a212f3560d8df15ca1ab5af0153e3a4daa9bb2 Mon Sep 17 00:00:00 2001 From: James Chen Date: Fri, 11 Oct 2013 18:26:25 +0800 Subject: [PATCH 08/64] Update AUTHORS [ci skip] --- AUTHORS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/AUTHORS b/AUTHORS index 283ab7c812..22a8baf85e 100644 --- a/AUTHORS +++ b/AUTHORS @@ -614,6 +614,9 @@ Developers: Keita Obo (ktaobo) Avoid unnecessary object duplication for Scale9Sprite. + jimmystar + Fixed a bug that cc.Scheduler.schedule(target, func) without repeat argument couldn't repeat schedule forever on device. + Retired Core Developers: WenSheng Yang Author of windows port, CCTextField, From edcf9fecb4296b5eb221a77746226a0eee763782 Mon Sep 17 00:00:00 2001 From: James Chen Date: Fri, 11 Oct 2013 21:52:28 +0800 Subject: [PATCH 09/64] [Win32] Fixing compilation errors after renaming CocosDenshion to 'audio'. --- cocos2d-win32.vc2012.sln | 2 +- cocos2dx/physics/CCPhysicsBody.h | 2 +- cocos2dx/physics/CCPhysicsShape.h | 2 +- extensions/proj.win32/libExtensions.vcxproj | 4 ++-- .../AssetsManagerTest/proj.win32/AssetsManagerTest.vcxproj | 4 ++-- samples/Cpp/TestCpp/proj.win32/TestCpp.vcxproj | 4 ++-- .../Javascript/CocosDragonJS/proj.win32/CocosDragonJS.vcxproj | 4 ++-- .../Javascript/CrystalCraze/proj.win32/CrystalCraze.vcxproj | 4 ++-- .../Javascript/MoonWarriors/proj.win32/MoonWarriors.vcxproj | 4 ++-- .../TestJavascript/proj.win32/TestJavascript.vcxproj | 4 ++-- .../WatermelonWithMe/proj.win32/WatermelonWithMe.vcxproj | 4 ++-- samples/Lua/HelloLua/proj.win32/HelloLua.vcxproj | 4 ++-- samples/Lua/TestLua/proj.win32/TestLua.win32.vcxproj | 4 ++-- scripting/javascript/bindings/proj.win32/libJSBinding.vcxproj | 4 ++-- scripting/lua/proj.win32/liblua.vcxproj | 4 ++-- template/multi-platform-cpp/proj.win32/HelloCpp.vcxproj | 4 ++-- template/multi-platform-js/proj.win32/HelloJavascript.vcxproj | 4 ++-- template/multi-platform-lua/proj.win32/HelloLua.vcxproj | 4 ++-- 18 files changed, 33 insertions(+), 33 deletions(-) diff --git a/cocos2d-win32.vc2012.sln b/cocos2d-win32.vc2012.sln index 490246c0e6..497a1d991c 100644 --- a/cocos2d-win32.vc2012.sln +++ b/cocos2d-win32.vc2012.sln @@ -5,7 +5,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libBox2D", "external\Box2D\ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libchipmunk", "external\chipmunk\proj.win32\chipmunk.vcxproj", "{207BC7A9-CCF1-4F2F-A04D-45F72242AE25}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libCocosDenshion", "CocosDenshion\proj.win32\CocosDenshion.vcxproj", "{F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "audio", "audio\proj.win32\CocosDenshion.vcxproj", "{F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}" ProjectSection(ProjectDependencies) = postProject {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E} = {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E} EndProjectSection diff --git a/cocos2dx/physics/CCPhysicsBody.h b/cocos2dx/physics/CCPhysicsBody.h index 9bfd9ece3e..e477c31a01 100644 --- a/cocos2dx/physics/CCPhysicsBody.h +++ b/cocos2dx/physics/CCPhysicsBody.h @@ -43,7 +43,7 @@ class PhysicsJoint; class PhysicsBodyInfo; -const PhysicsMaterial PHYSICSBODY_MATERIAL_DEFAULT = {0.0f, 1.0f, 1.0f}; +const PhysicsMaterial PHYSICSBODY_MATERIAL_DEFAULT(0.0f, 1.0f, 1.0f); /** * A body affect by physics. diff --git a/cocos2dx/physics/CCPhysicsShape.h b/cocos2dx/physics/CCPhysicsShape.h index d754f6030b..4915035521 100644 --- a/cocos2dx/physics/CCPhysicsShape.h +++ b/cocos2dx/physics/CCPhysicsShape.h @@ -55,7 +55,7 @@ typedef struct PhysicsMaterial , friction(friction){} }PhysicsMaterial; -const PhysicsMaterial PHYSICSSHAPE_MATERIAL_DEFAULT = {0.0f, 1.0f, 1.0f}; +const PhysicsMaterial PHYSICSSHAPE_MATERIAL_DEFAULT(0.0f, 1.0f, 1.0f); /** * @brief A shape for body. You do not create PhysicsWorld objects directly, instead, you can view PhysicsBody to see how to create it. diff --git a/extensions/proj.win32/libExtensions.vcxproj b/extensions/proj.win32/libExtensions.vcxproj index b221f7dfd1..e1c2ea14a1 100644 --- a/extensions/proj.win32/libExtensions.vcxproj +++ b/extensions/proj.win32/libExtensions.vcxproj @@ -62,7 +62,7 @@ Disabled - $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\include;$(ProjectDir)..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\external\sqlite3\include;$(ProjectDir)..\..\external;$(ProjectDir)..\..\external\libwebsockets\win32\include;$(ProjectDir)..\..\cocos2dx;$(ProjectDir)..\..\cocos2dx\include;$(ProjectDir)..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\cocos2dx\platform\third_party\win32\pthread;$(ProjectDir)..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\cocos2dx\platform\third_party\win32\zlib;$(ProjectDir)..\..\CocosDenshion\include;..\;%(AdditionalIncludeDirectories) + $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\include;$(ProjectDir)..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\external\sqlite3\include;$(ProjectDir)..\..\external;$(ProjectDir)..\..\external\libwebsockets\win32\include;$(ProjectDir)..\..\cocos2dx;$(ProjectDir)..\..\cocos2dx\include;$(ProjectDir)..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\cocos2dx\platform\third_party\win32\pthread;$(ProjectDir)..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\cocos2dx\platform\third_party\win32\zlib;$(ProjectDir)..\..\audio\include;..\;%(AdditionalIncludeDirectories) WIN32;_WINDOWS;_DEBUG;_LIB;COCOS2D_DEBUG=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) false EnableFastChecks @@ -79,7 +79,7 @@ MaxSpeed true - $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\include;$(ProjectDir)..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\external\sqlite3\include;$(ProjectDir)..\..\external;$(ProjectDir)..\..\external\libwebsockets\win32\include;$(ProjectDir)..\..\cocos2dx;$(ProjectDir)..\..\cocos2dx\include;$(ProjectDir)..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\cocos2dx\platform\third_party\win32\pthread;$(ProjectDir)..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\cocos2dx\platform\third_party\win32\zlib;$(ProjectDir)..\..\CocosDenshion\include;..\;%(AdditionalIncludeDirectories) + $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\include;$(ProjectDir)..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\external\sqlite3\include;$(ProjectDir)..\..\external;$(ProjectDir)..\..\external\libwebsockets\win32\include;$(ProjectDir)..\..\cocos2dx;$(ProjectDir)..\..\cocos2dx\include;$(ProjectDir)..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\cocos2dx\platform\third_party\win32\pthread;$(ProjectDir)..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\cocos2dx\platform\third_party\win32\zlib;$(ProjectDir)..\..\audio\include;..\;%(AdditionalIncludeDirectories) WIN32;_WINDOWS;NDEBUG;_LIB;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) MultiThreadedDLL true diff --git a/samples/Cpp/AssetsManagerTest/proj.win32/AssetsManagerTest.vcxproj b/samples/Cpp/AssetsManagerTest/proj.win32/AssetsManagerTest.vcxproj index 0b9daaba3f..9fdc714c49 100644 --- a/samples/Cpp/AssetsManagerTest/proj.win32/AssetsManagerTest.vcxproj +++ b/samples/Cpp/AssetsManagerTest/proj.win32/AssetsManagerTest.vcxproj @@ -77,7 +77,7 @@ Disabled - $(ProjectDir)..\Classes;$(ProjectDir)..\..\..\..\scripting\javascript\spidermonkey-win32\include;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\scripting\auto-generated\js-bindings;$(ProjectDir)..\..\..\..\scripting\javascript\bindings;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\pthread;$(ProjectDir)..\..\..\..\CocosDenshion\include;%(AdditionalIncludeDirectories) + $(ProjectDir)..\Classes;$(ProjectDir)..\..\..\..\scripting\javascript\spidermonkey-win32\include;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\scripting\auto-generated\js-bindings;$(ProjectDir)..\..\..\..\scripting\javascript\bindings;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\pthread;$(ProjectDir)..\..\..\..\audio\include;%(AdditionalIncludeDirectories) WIN32;_WINDOWS;STRICT;DEBUG;_DEBUG;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_DEBUG=1;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) false EnableFastChecks @@ -131,7 +131,7 @@ xcopy "$(ProjectDir)..\Resources" "$(OutDir)\AssetsManagerTestRes\" /e /Yres_p.c - $(ProjectDir)..\Classes;$(ProjectDir)..\..\..\..\scripting\javascript\spidermonkey-win32\include;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\scripting\auto-generated\js-bindings;$(ProjectDir)..\..\..\..\scripting\javascript\bindings;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\pthread;$(ProjectDir)..\..\..\..\CocosDenshion\include;%(AdditionalIncludeDirectories) + $(ProjectDir)..\Classes;$(ProjectDir)..\..\..\..\scripting\javascript\spidermonkey-win32\include;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\scripting\auto-generated\js-bindings;$(ProjectDir)..\..\..\..\scripting\javascript\bindings;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\pthread;$(ProjectDir)..\..\..\..\audio\include;%(AdditionalIncludeDirectories) WIN32;_WINDOWS;STRICT;NDEBUG;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) diff --git a/samples/Cpp/TestCpp/proj.win32/TestCpp.vcxproj b/samples/Cpp/TestCpp/proj.win32/TestCpp.vcxproj index 35d8f4f57b..95e857631c 100644 --- a/samples/Cpp/TestCpp/proj.win32/TestCpp.vcxproj +++ b/samples/Cpp/TestCpp/proj.win32/TestCpp.vcxproj @@ -67,7 +67,7 @@ Disabled - $(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\pthread;$(ProjectDir)..\..\..\..\external;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\external\libwebsockets\win32\include;$(ProjectDir)..\..\..\..\CocosDenshion\include;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\extensions\network;..\Classes;..;%(AdditionalIncludeDirectories) + $(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\pthread;$(ProjectDir)..\..\..\..\external;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\external\libwebsockets\win32\include;$(ProjectDir)..\..\..\..\audio\include;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\extensions\network;..\Classes;..;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_WINDOWS;_USE_MATH_DEFINES;GL_GLEXT_PROTOTYPES;CC_ENABLE_CHIPMUNK_INTEGRATION=1;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebugDLL @@ -100,7 +100,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\libwebsockets\win32\lib\*.*" "$(O MaxSpeed true - $(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\pthread;$(ProjectDir)..\..\..\..\external;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\external\libwebsockets\win32\include;$(ProjectDir)..\..\..\..\CocosDenshion\include;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\extensions\network;..\Classes;..;%(AdditionalIncludeDirectories) + $(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\pthread;$(ProjectDir)..\..\..\..\external;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\external\libwebsockets\win32\include;$(ProjectDir)..\..\..\..\audio\include;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\extensions\network;..\Classes;..;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_WINDOWS;_USE_MATH_DEFINES;GL_GLEXT_PROTOTYPES;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) MultiThreadedDLL true diff --git a/samples/Javascript/CocosDragonJS/proj.win32/CocosDragonJS.vcxproj b/samples/Javascript/CocosDragonJS/proj.win32/CocosDragonJS.vcxproj index 305614f7c0..e67d8d64eb 100644 --- a/samples/Javascript/CocosDragonJS/proj.win32/CocosDragonJS.vcxproj +++ b/samples/Javascript/CocosDragonJS/proj.win32/CocosDragonJS.vcxproj @@ -77,7 +77,7 @@ Disabled - $(ProjectDir)..\Classes;$(ProjectDir)..\..\..\..\scripting\javascript\spidermonkey-win32\include;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\scripting\auto-generated\js-bindings;$(ProjectDir)..\..\..\..\scripting\javascript\bindings;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\CocosDenshion\include;%(AdditionalIncludeDirectories) + $(ProjectDir)..\Classes;$(ProjectDir)..\..\..\..\scripting\javascript\spidermonkey-win32\include;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\scripting\auto-generated\js-bindings;$(ProjectDir)..\..\..\..\scripting\javascript\bindings;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\audio\include;%(AdditionalIncludeDirectories) WIN32;_WINDOWS;STRICT;_DEBUG;DEBUG;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_DEBUG=1;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) false EnableFastChecks @@ -131,7 +131,7 @@ xcopy "$(ProjectDir)..\..\Shared\games\CocosDragonJS\Published files Android" "$ testjs_p.c - $(ProjectDir)..\Classes;$(ProjectDir)..\..\..\..\scripting\javascript\spidermonkey-win32\include;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\scripting\auto-generated\js-bindings;$(ProjectDir)..\..\..\..\scripting\javascript\bindings;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\CocosDenshion\include;%(AdditionalIncludeDirectories) + $(ProjectDir)..\Classes;$(ProjectDir)..\..\..\..\scripting\javascript\spidermonkey-win32\include;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\scripting\auto-generated\js-bindings;$(ProjectDir)..\..\..\..\scripting\javascript\bindings;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\audio\include;%(AdditionalIncludeDirectories) WIN32;_WINDOWS;STRICT;NDEBUG;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;CC_ENABLE_CHIPMUNK_INTEGRATION=1;COCOS2D_JAVASCRIPT=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) diff --git a/samples/Javascript/CrystalCraze/proj.win32/CrystalCraze.vcxproj b/samples/Javascript/CrystalCraze/proj.win32/CrystalCraze.vcxproj index 371ed2cae5..e2a144bff1 100644 --- a/samples/Javascript/CrystalCraze/proj.win32/CrystalCraze.vcxproj +++ b/samples/Javascript/CrystalCraze/proj.win32/CrystalCraze.vcxproj @@ -77,7 +77,7 @@ Disabled - $(ProjectDir)..\Classes;$(ProjectDir)..\..\..\..\scripting\javascript\spidermonkey-win32\include;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\scripting\auto-generated\js-bindings;$(ProjectDir)..\..\..\..\scripting\javascript\bindings;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\CocosDenshion\include;%(AdditionalIncludeDirectories) + $(ProjectDir)..\Classes;$(ProjectDir)..\..\..\..\scripting\javascript\spidermonkey-win32\include;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\scripting\auto-generated\js-bindings;$(ProjectDir)..\..\..\..\scripting\javascript\bindings;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\audio\include;%(AdditionalIncludeDirectories) WIN32;_WINDOWS;STRICT;_DEBUG;DEBUG;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_DEBUG=1;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) false EnableFastChecks @@ -131,7 +131,7 @@ xcopy "$(ProjectDir)..\..\Shared\games\CrystalCraze\Published-Android" "$(OutDir testjs_p.c - $(ProjectDir)..\Classes;$(ProjectDir)..\..\..\..\scripting\javascript\spidermonkey-win32\include;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\scripting\auto-generated\js-bindings;$(ProjectDir)..\..\..\..\scripting\javascript\bindings;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\CocosDenshion\include;%(AdditionalIncludeDirectories) + $(ProjectDir)..\Classes;$(ProjectDir)..\..\..\..\scripting\javascript\spidermonkey-win32\include;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\scripting\auto-generated\js-bindings;$(ProjectDir)..\..\..\..\scripting\javascript\bindings;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\audio\include;%(AdditionalIncludeDirectories) WIN32;_WINDOWS;STRICT;NDEBUG;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;CC_ENABLE_CHIPMUNK_INTEGRATION=1;COCOS2D_JAVASCRIPT=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) diff --git a/samples/Javascript/MoonWarriors/proj.win32/MoonWarriors.vcxproj b/samples/Javascript/MoonWarriors/proj.win32/MoonWarriors.vcxproj index 05e778a16d..1b8d85f756 100644 --- a/samples/Javascript/MoonWarriors/proj.win32/MoonWarriors.vcxproj +++ b/samples/Javascript/MoonWarriors/proj.win32/MoonWarriors.vcxproj @@ -77,7 +77,7 @@ Disabled - .;..\Classes;$(ProjectDir)..\..\..\..\scripting\javascript\spidermonkey-win32\include;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\scripting\auto-generated\js-bindings;$(ProjectDir)..\..\..\..\scripting\javascript\bindings;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\CocosDenshion\include;%(AdditionalIncludeDirectories) + .;..\Classes;$(ProjectDir)..\..\..\..\scripting\javascript\spidermonkey-win32\include;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\scripting\auto-generated\js-bindings;$(ProjectDir)..\..\..\..\scripting\javascript\bindings;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\audio\include;%(AdditionalIncludeDirectories) WIN32;_WINDOWS;STRICT;_DEBUG;DEBUG;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_DEBUG=1;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) false EnableFastChecks @@ -129,7 +129,7 @@ xcopy "$(ProjectDir)..\..\Shared\games\MoonWarriors" "$(OutDir)\MoonWarriorsRes\ testjs_p.c - .;..\Classes;$(ProjectDir)..\..\..\..\scripting\javascript\spidermonkey-win32\include;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\scripting\auto-generated\js-bindings;$(ProjectDir)..\..\..\..\scripting\javascript\bindings;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\CocosDenshion\include;%(AdditionalIncludeDirectories) + .;..\Classes;$(ProjectDir)..\..\..\..\scripting\javascript\spidermonkey-win32\include;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\scripting\auto-generated\js-bindings;$(ProjectDir)..\..\..\..\scripting\javascript\bindings;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\audio\include;%(AdditionalIncludeDirectories) WIN32;_WINDOWS;STRICT;NDEBUG;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) diff --git a/samples/Javascript/TestJavascript/proj.win32/TestJavascript.vcxproj b/samples/Javascript/TestJavascript/proj.win32/TestJavascript.vcxproj index 0578b3195c..6af44de033 100644 --- a/samples/Javascript/TestJavascript/proj.win32/TestJavascript.vcxproj +++ b/samples/Javascript/TestJavascript/proj.win32/TestJavascript.vcxproj @@ -77,7 +77,7 @@ Disabled - $(ProjectDir)..\Classes;$(ProjectDir)..\..\..\..\scripting\javascript\spidermonkey-win32\include;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\scripting\javascript\bindings;$(ProjectDir)..\..\..\..\scripting\auto-generated\js-bindings;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\CocosDenshion\include;%(AdditionalIncludeDirectories) + $(ProjectDir)..\Classes;$(ProjectDir)..\..\..\..\scripting\javascript\spidermonkey-win32\include;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\scripting\javascript\bindings;$(ProjectDir)..\..\..\..\scripting\auto-generated\js-bindings;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\audio\include;%(AdditionalIncludeDirectories) WIN32;_WINDOWS;STRICT;DEBUG;_DEBUG;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_DEBUG=1;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) false EnableFastChecks @@ -132,7 +132,7 @@ xcopy "$(ProjectDir)..\..\Shared\tests" "$(OutDir)\TestJavascriptRes\" /e /Ytestjs_p.c - $(ProjectDir)..\Classes;$(ProjectDir)..\..\..\..\scripting\javascript\spidermonkey-win32\include;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\scripting\javascript\bindings;$(ProjectDir)..\..\..\..\scripting\auto-generated\js-bindings;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\CocosDenshion\include;%(AdditionalIncludeDirectories) + $(ProjectDir)..\Classes;$(ProjectDir)..\..\..\..\scripting\javascript\spidermonkey-win32\include;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\scripting\javascript\bindings;$(ProjectDir)..\..\..\..\scripting\auto-generated\js-bindings;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\audio\include;%(AdditionalIncludeDirectories) WIN32;_WINDOWS;STRICT;NDEBUG;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) diff --git a/samples/Javascript/WatermelonWithMe/proj.win32/WatermelonWithMe.vcxproj b/samples/Javascript/WatermelonWithMe/proj.win32/WatermelonWithMe.vcxproj index 79b6a7e7a4..b6b8e34883 100644 --- a/samples/Javascript/WatermelonWithMe/proj.win32/WatermelonWithMe.vcxproj +++ b/samples/Javascript/WatermelonWithMe/proj.win32/WatermelonWithMe.vcxproj @@ -77,7 +77,7 @@ Disabled - $(ProjectDir)..\Classes;$(ProjectDir)..\..\..\..\scripting\javascript\spidermonkey-win32\include;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\scripting\auto-generated\js-bindings;$(ProjectDir)..\..\..\..\scripting\javascript\bindings;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\CocosDenshion\include;%(AdditionalIncludeDirectories) + $(ProjectDir)..\Classes;$(ProjectDir)..\..\..\..\scripting\javascript\spidermonkey-win32\include;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\scripting\auto-generated\js-bindings;$(ProjectDir)..\..\..\..\scripting\javascript\bindings;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\audio\include;%(AdditionalIncludeDirectories) WIN32;_WINDOWS;STRICT;_DEBUG;DEBUG;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_DEBUG=1;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) false EnableFastChecks @@ -131,7 +131,7 @@ xcopy "$(ProjectDir)..\..\Shared\games\WatermelonWithMe" "$(OutDir)\WatermelonWi testjs_p.c - $(ProjectDir)..\Classes;$(ProjectDir)..\..\..\..\scripting\javascript\spidermonkey-win32\include;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\scripting\auto-generated\js-bindings;$(ProjectDir)..\..\..\..\scripting\javascript\bindings;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\CocosDenshion\include;%(AdditionalIncludeDirectories) + $(ProjectDir)..\Classes;$(ProjectDir)..\..\..\..\scripting\javascript\spidermonkey-win32\include;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\scripting\auto-generated\js-bindings;$(ProjectDir)..\..\..\..\scripting\javascript\bindings;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\audio\include;%(AdditionalIncludeDirectories) WIN32;_WINDOWS;STRICT;NDEBUG;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) diff --git a/samples/Lua/HelloLua/proj.win32/HelloLua.vcxproj b/samples/Lua/HelloLua/proj.win32/HelloLua.vcxproj index 350cfe12eb..f01edcaf43 100644 --- a/samples/Lua/HelloLua/proj.win32/HelloLua.vcxproj +++ b/samples/Lua/HelloLua/proj.win32/HelloLua.vcxproj @@ -77,7 +77,7 @@ Disabled - $(ProjectDir)..\Classes;$(ProjectDir)..\..\..\..\scripting\auto-generated\lua-bindings;$(ProjectDir)..\..\..\..\scripting\lua\cocos2dx_support;$(ProjectDir)..\..\..\..\scripting\lua\lua;$(ProjectDir)..\..\..\..\scripting\lua\tolua;$(ProjectDir)..\..\..\..\scripting\lua\src;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\CocosDenshion\include;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;%(AdditionalIncludeDirectories) + $(ProjectDir)..\Classes;$(ProjectDir)..\..\..\..\scripting\auto-generated\lua-bindings;$(ProjectDir)..\..\..\..\scripting\lua\cocos2dx_support;$(ProjectDir)..\..\..\..\scripting\lua\lua;$(ProjectDir)..\..\..\..\scripting\lua\tolua;$(ProjectDir)..\..\..\..\scripting\lua\src;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\audio\include;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;%(AdditionalIncludeDirectories) WIN32;_WINDOWS;STRICT;_DEBUG;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) false EnableFastChecks @@ -119,7 +119,7 @@ HelloLua_p.c - $(ProjectDir)..\Classes;$(ProjectDir)..\..\..\..\scripting\auto-generated\lua-bindings;$(ProjectDir)..\..\..\..\scripting\lua\cocos2dx_support;$(ProjectDir)..\..\..\..\scripting\lua\lua;$(ProjectDir)..\..\..\..\scripting\lua\tolua;$(ProjectDir)..\..\..\..\scripting\lua\src;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\CocosDenshion\include;%(AdditionalIncludeDirectories) + $(ProjectDir)..\Classes;$(ProjectDir)..\..\..\..\scripting\auto-generated\lua-bindings;$(ProjectDir)..\..\..\..\scripting\lua\cocos2dx_support;$(ProjectDir)..\..\..\..\scripting\lua\lua;$(ProjectDir)..\..\..\..\scripting\lua\tolua;$(ProjectDir)..\..\..\..\scripting\lua\src;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\audio\include;%(AdditionalIncludeDirectories) WIN32;_WINDOWS;STRICT;NDEBUG;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) diff --git a/samples/Lua/TestLua/proj.win32/TestLua.win32.vcxproj b/samples/Lua/TestLua/proj.win32/TestLua.win32.vcxproj index e9aa4d77e8..1d7682a2d2 100644 --- a/samples/Lua/TestLua/proj.win32/TestLua.win32.vcxproj +++ b/samples/Lua/TestLua/proj.win32/TestLua.win32.vcxproj @@ -64,7 +64,7 @@ - $(ProjectDir)..\Classes;$(ProjectDir)..\..\..\..\scripting\auto-generated\lua-bindings;$(ProjectDir)..\..\..\..\scripting\lua\cocos2dx_support;$(ProjectDir)..\..\..\..\scripting\lua\lua;$(ProjectDir)..\..\..\..\scripting\lua\tolua;$(ProjectDir)..\..\..\..\scripting\lua\src;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\external;$(ProjectDir)..\..\..\..\external\libwebsockets\win32\include;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\CocosDenshion\include;%(AdditionalIncludeDirectories) + $(ProjectDir)..\Classes;$(ProjectDir)..\..\..\..\scripting\auto-generated\lua-bindings;$(ProjectDir)..\..\..\..\scripting\lua\cocos2dx_support;$(ProjectDir)..\..\..\..\scripting\lua\lua;$(ProjectDir)..\..\..\..\scripting\lua\tolua;$(ProjectDir)..\..\..\..\scripting\lua\src;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\external;$(ProjectDir)..\..\..\..\external\libwebsockets\win32\include;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\audio\include;%(AdditionalIncludeDirectories) Level3 @@ -113,7 +113,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\libwebsockets\win32\lib\*.*" "$(O - $(ProjectDir)..\Classes;$(ProjectDir)..\..\..\..\scripting\auto-generated\lua-bindings;$(ProjectDir)..\..\..\..\scripting\lua\cocos2dx_support;$(ProjectDir)..\..\..\..\scripting\lua\lua;$(ProjectDir)..\..\..\..\scripting\lua\tolua;$(ProjectDir)..\..\..\..\scripting\lua\src;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\external;$(ProjectDir)..\..\..\..\external\libwebsockets\win32\include;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\CocosDenshion\include;%(AdditionalIncludeDirectories) + $(ProjectDir)..\Classes;$(ProjectDir)..\..\..\..\scripting\auto-generated\lua-bindings;$(ProjectDir)..\..\..\..\scripting\lua\cocos2dx_support;$(ProjectDir)..\..\..\..\scripting\lua\lua;$(ProjectDir)..\..\..\..\scripting\lua\tolua;$(ProjectDir)..\..\..\..\scripting\lua\src;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\external;$(ProjectDir)..\..\..\..\external\libwebsockets\win32\include;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\audio\include;%(AdditionalIncludeDirectories) Level3 diff --git a/scripting/javascript/bindings/proj.win32/libJSBinding.vcxproj b/scripting/javascript/bindings/proj.win32/libJSBinding.vcxproj index 51b34070ac..df73497bd8 100644 --- a/scripting/javascript/bindings/proj.win32/libJSBinding.vcxproj +++ b/scripting/javascript/bindings/proj.win32/libJSBinding.vcxproj @@ -126,7 +126,7 @@ Level3 Disabled 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) - $(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\pthread;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\CocosDenshion\include;$(ProjectDir)..;$(ProjectDir)..\..\spidermonkey-win32\include;$(ProjectDir)..\..\..\auto-generated\js-bindings;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\external\libwebsockets\win32\include;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\extensions\LocalStorage;$(ProjectDir)..\..\..\..\extensions\network;%(AdditionalIncludeDirectories) + $(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\pthread;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\audio\include;$(ProjectDir)..;$(ProjectDir)..\..\spidermonkey-win32\include;$(ProjectDir)..\..\..\auto-generated\js-bindings;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\external\libwebsockets\win32\include;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\extensions\LocalStorage;$(ProjectDir)..\..\..\..\extensions\network;%(AdditionalIncludeDirectories) 4068;4101;4800;4251;4244;%(DisableSpecificWarnings) true false @@ -149,7 +149,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\sqlite3\libraries\win32\*.*" "$(O true true 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) - $(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\pthread;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\CocosDenshion\include;$(ProjectDir)..;$(ProjectDir)..\..\spidermonkey-win32\include;$(ProjectDir)..\..\..\auto-generated\js-bindings;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\external\libwebsockets\win32\include;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\extensions\LocalStorage;$(ProjectDir)..\..\..\..\extensions\network;%(AdditionalIncludeDirectories) + $(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\pthread;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\audio\include;$(ProjectDir)..;$(ProjectDir)..\..\spidermonkey-win32\include;$(ProjectDir)..\..\..\auto-generated\js-bindings;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\external\libwebsockets\win32\include;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\extensions\LocalStorage;$(ProjectDir)..\..\..\..\extensions\network;%(AdditionalIncludeDirectories) 4068;4101;4800;4251;4244;%(DisableSpecificWarnings) true diff --git a/scripting/lua/proj.win32/liblua.vcxproj b/scripting/lua/proj.win32/liblua.vcxproj index d33d451bf4..84026e44fd 100644 --- a/scripting/lua/proj.win32/liblua.vcxproj +++ b/scripting/lua/proj.win32/liblua.vcxproj @@ -62,7 +62,7 @@ Disabled - $(ProjectDir)..\..\..\cocos2dx;$(ProjectDir)..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32\pthread;$(ProjectDir)..\..\..\CocosDenshion\include;$(ProjectDir)..\..\..\extensions;$(ProjectDir)..\..\..\extensions\network;$(ProjectDir)..\..\..\external\libwebsockets\win32\include;$(ProjectDir)..\tolua;$(ProjectDir)..\luajit\include;$(ProjectDir)..\..\auto-generated\lua-bindings;$(ProjectDir)..\cocos2dx_support;$(ProjectDir)..\..\..\external\chipmunk\include\chipmunk;%(AdditionalIncludeDirectories) + $(ProjectDir)..\..\..\cocos2dx;$(ProjectDir)..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32\pthread;$(ProjectDir)..\..\..\audio\include;$(ProjectDir)..\..\..\extensions;$(ProjectDir)..\..\..\extensions\network;$(ProjectDir)..\..\..\external\libwebsockets\win32\include;$(ProjectDir)..\tolua;$(ProjectDir)..\luajit\include;$(ProjectDir)..\..\auto-generated\lua-bindings;$(ProjectDir)..\cocos2dx_support;$(ProjectDir)..\..\..\external\chipmunk\include\chipmunk;%(AdditionalIncludeDirectories) WIN32;_WINDOWS;_DEBUG;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) false EnableFastChecks @@ -94,7 +94,7 @@ xcopy /Y /Q "$(ProjectDir)..\luajit\win32\*.*" "$(OutDir)" MaxSpeed true - $(ProjectDir)..\..\..\cocos2dx;$(ProjectDir)..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32\pthread;$(ProjectDir)..\..\..\CocosDenshion\include;$(ProjectDir)..\..\..\extensions;$(ProjectDir)..\..\..\extensions\network;$(ProjectDir)..\..\..\external\libwebsockets\win32\include;$(ProjectDir)..\tolua;$(ProjectDir)..\luajit\include;$(ProjectDir)..\..\auto-generated\lua-bindings;$(ProjectDir)..\cocos2dx_support;%(AdditionalIncludeDirectories) + $(ProjectDir)..\..\..\cocos2dx;$(ProjectDir)..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32\pthread;$(ProjectDir)..\..\..\audio\include;$(ProjectDir)..\..\..\extensions;$(ProjectDir)..\..\..\extensions\network;$(ProjectDir)..\..\..\external\libwebsockets\win32\include;$(ProjectDir)..\tolua;$(ProjectDir)..\luajit\include;$(ProjectDir)..\..\auto-generated\lua-bindings;$(ProjectDir)..\cocos2dx_support;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_WINDOWS;LIBLUA_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) MultiThreadedDLL true diff --git a/template/multi-platform-cpp/proj.win32/HelloCpp.vcxproj b/template/multi-platform-cpp/proj.win32/HelloCpp.vcxproj index a78cca3137..70a728fe8e 100644 --- a/template/multi-platform-cpp/proj.win32/HelloCpp.vcxproj +++ b/template/multi-platform-cpp/proj.win32/HelloCpp.vcxproj @@ -67,7 +67,7 @@ Disabled - $(ProjectDir)..\..\..\cocos2dx;$(ProjectDir)..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\external;$(ProjectDir)..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\CocosDenshion\include;$(ProjectDir)..\..\..\extensions;..\Classes;..;%(AdditionalIncludeDirectories) + $(ProjectDir)..\..\..\cocos2dx;$(ProjectDir)..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\external;$(ProjectDir)..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\audio\include;$(ProjectDir)..\..\..\extensions;..\Classes;..;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_WINDOWS;_USE_MATH_DEFINES;GL_GLEXT_PROTOTYPES;CC_ENABLE_CHIPMUNK_INTEGRATION=1;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) false EnableFastChecks @@ -100,7 +100,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\..\external\libwebsockets\win32\lib\*.*" "$(OutD MaxSpeed true - $(ProjectDir)..\..\..\cocos2dx;$(ProjectDir)..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\external;$(ProjectDir)..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\CocosDenshion\include;$(ProjectDir)..\..\..\extensions;..\Classes;..;%(AdditionalIncludeDirectories) + $(ProjectDir)..\..\..\cocos2dx;$(ProjectDir)..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\external;$(ProjectDir)..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\audio\include;$(ProjectDir)..\..\..\extensions;..\Classes;..;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_WINDOWS;_USE_MATH_DEFINES;GL_GLEXT_PROTOTYPES;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) MultiThreadedDLL true diff --git a/template/multi-platform-js/proj.win32/HelloJavascript.vcxproj b/template/multi-platform-js/proj.win32/HelloJavascript.vcxproj index 4f72991d3e..fb2ad0984c 100644 --- a/template/multi-platform-js/proj.win32/HelloJavascript.vcxproj +++ b/template/multi-platform-js/proj.win32/HelloJavascript.vcxproj @@ -77,7 +77,7 @@ Disabled - $(ProjectDir)..\Classes;$(ProjectDir)..\..\..\scripting\javascript\spidermonkey-win32\include;$(ProjectDir)..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\extensions;$(ProjectDir)..\..\..\scripting\auto-generated\js-bindings;$(ProjectDir)..\..\..\scripting\javascript\bindings;$(ProjectDir)..\..\..\cocos2dx;$(ProjectDir)..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\CocosDenshion\include;%(AdditionalIncludeDirectories) + $(ProjectDir)..\Classes;$(ProjectDir)..\..\..\scripting\javascript\spidermonkey-win32\include;$(ProjectDir)..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\extensions;$(ProjectDir)..\..\..\scripting\auto-generated\js-bindings;$(ProjectDir)..\..\..\scripting\javascript\bindings;$(ProjectDir)..\..\..\cocos2dx;$(ProjectDir)..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\audio\include;%(AdditionalIncludeDirectories) WIN32;_WINDOWS;STRICT;DEBUG;_DEBUG;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_DEBUG=1;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) false EnableFastChecks @@ -131,7 +131,7 @@ xcopy "$(ProjectDir)..\Resources" "$(OutDir)\HelloJavascriptRes\" /e /Ygame_p.c - $(ProjectDir)..\Classes;$(ProjectDir)..\..\..\scripting\javascript\spidermonkey-win32\include;$(ProjectDir)..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\extensions;$(ProjectDir)..\..\..\scripting\auto-generated\js-bindings;$(ProjectDir)..\..\..\scripting\javascript\bindings;$(ProjectDir)..\..\..\cocos2dx;$(ProjectDir)..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\CocosDenshion\include;%(AdditionalIncludeDirectories) + $(ProjectDir)..\Classes;$(ProjectDir)..\..\..\scripting\javascript\spidermonkey-win32\include;$(ProjectDir)..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\extensions;$(ProjectDir)..\..\..\scripting\auto-generated\js-bindings;$(ProjectDir)..\..\..\scripting\javascript\bindings;$(ProjectDir)..\..\..\cocos2dx;$(ProjectDir)..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\audio\include;%(AdditionalIncludeDirectories) WIN32;_WINDOWS;STRICT;NDEBUG;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) diff --git a/template/multi-platform-lua/proj.win32/HelloLua.vcxproj b/template/multi-platform-lua/proj.win32/HelloLua.vcxproj index e1da38631a..2007e7db42 100644 --- a/template/multi-platform-lua/proj.win32/HelloLua.vcxproj +++ b/template/multi-platform-lua/proj.win32/HelloLua.vcxproj @@ -64,7 +64,7 @@ - $(ProjectDir)..\Classes;$(ProjectDir)..\..\..\scripting\auto-generated\js-bindings;$(ProjectDir)..\..\..\scripting\lua\cocos2dx_support;$(ProjectDir)..\..\..\scripting\lua\lua;$(ProjectDir)..\..\..\scripting\lua\tolua;$(ProjectDir)..\..\..\scripting\lua\src;$(ProjectDir)..\..\..\cocos2dx;$(ProjectDir)..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\external;$(ProjectDir)..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\CocosDenshion\include;%(AdditionalIncludeDirectories) + $(ProjectDir)..\Classes;$(ProjectDir)..\..\..\scripting\auto-generated\js-bindings;$(ProjectDir)..\..\..\scripting\lua\cocos2dx_support;$(ProjectDir)..\..\..\scripting\lua\lua;$(ProjectDir)..\..\..\scripting\lua\tolua;$(ProjectDir)..\..\..\scripting\lua\src;$(ProjectDir)..\..\..\cocos2dx;$(ProjectDir)..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\external;$(ProjectDir)..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\audio\include;%(AdditionalIncludeDirectories) Level3 @@ -113,7 +113,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\..\external\libwebsockets\win32\lib\*.*" "$(OutD - $(ProjectDir)..\Classes;$(ProjectDir)..\..\..\scripting\lua\cocos2dx_support;$(ProjectDir)..\..\..\scripting\lua\lua;$(ProjectDir)..\..\..\scripting\lua\tolua;$(ProjectDir)..\..\..\scripting\lua\src;$(ProjectDir)..\..\..\cocos2dx;$(ProjectDir)..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\external;$(ProjectDir)..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\CocosDenshion\include;$(ProjectDir)..\..\..\scripting\lua\cocos2dx_support;$(ProjectDir)..\..\..\scripting\lua\tolua;$(ProjectDir)..\..\..\scripting\lua\lua;%(AdditionalIncludeDirectories) + $(ProjectDir)..\Classes;$(ProjectDir)..\..\..\scripting\lua\cocos2dx_support;$(ProjectDir)..\..\..\scripting\lua\lua;$(ProjectDir)..\..\..\scripting\lua\tolua;$(ProjectDir)..\..\..\scripting\lua\src;$(ProjectDir)..\..\..\cocos2dx;$(ProjectDir)..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\external;$(ProjectDir)..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\audio\include;$(ProjectDir)..\..\..\scripting\lua\cocos2dx_support;$(ProjectDir)..\..\..\scripting\lua\tolua;$(ProjectDir)..\..\..\scripting\lua\lua;%(AdditionalIncludeDirectories) Level3 From c914017c16e53fcb3dd1020f15531818aabf9575 Mon Sep 17 00:00:00 2001 From: James Chen Date: Fri, 11 Oct 2013 21:52:55 +0800 Subject: [PATCH 10/64] Small fix in ScriptingCore.cpp. --- scripting/javascript/bindings/ScriptingCore.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/scripting/javascript/bindings/ScriptingCore.cpp b/scripting/javascript/bindings/ScriptingCore.cpp index caf3603beb..101005be60 100644 --- a/scripting/javascript/bindings/ScriptingCore.cpp +++ b/scripting/javascript/bindings/ScriptingCore.cpp @@ -1935,16 +1935,15 @@ void SimpleRunLoop::update(float dt) } } -void ScriptingCore::debugProcessInput(string str) { +void ScriptingCore::debugProcessInput(string str) +{ JSAutoCompartment ac(_cx, _debugGlobal); JSString* jsstr = JS_NewStringCopyZ(_cx, str.c_str()); - jsval argv[] = { - STRING_TO_JSVAL(jsstr) - }; + jsval argv = STRING_TO_JSVAL(jsstr); jsval outval; - JS_CallFunctionName(_cx, _debugGlobal, "processInput", 1, argv, &outval); + JS_CallFunctionName(_cx, _debugGlobal, "processInput", 1, &argv, &outval); } static bool NS_ProcessNextEvent() From 37b6b5bfd3376f1971dab00307706cbfa3563981 Mon Sep 17 00:00:00 2001 From: zhangbin Date: Sat, 12 Oct 2013 10:35:12 +0800 Subject: [PATCH 11/64] Make the plugin be compatible with both cocos2d-x-2.2 & cocos2d-x-3.0. --- plugin | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin b/plugin index 915a29d230..8f01fc10fc 160000 --- a/plugin +++ b/plugin @@ -1 +1 @@ -Subproject commit 915a29d230b785bdea4bce39e643ce7ce667f6d0 +Subproject commit 8f01fc10fcb658e9f8314d8a044f032c7740bd27 From 4313c46e93d360296d98acc1bde7ca6fa34fac24 Mon Sep 17 00:00:00 2001 From: minggo Date: Sat, 12 Oct 2013 11:22:05 +0800 Subject: [PATCH 12/64] issue #2905:adjust folder structure --- .gitignore | 1 - .gitmodules | 7 +- audio/emscripten/SimpleAudioEngine.cpp | 304 -- audio/proj.emscripten/Makefile | 20 - .../CocosDenshion.xcodeproj/project.pbxproj | 348 -- .../CocosDenshion.xcodeproj/project.pbxproj | 342 -- audio/proj.nacl/Makefile | 20 - audio/proj.qt5/cocosdenshion.pro | 15 - audio/proj.tizen/.cproject | 345 -- audio/proj.tizen/.project | 106 - audio/proj.tizen/src/placeholder.txt | 0 audio/qt5/SimpleAudioEngineQt5.cpp | 407 --- build-emscripten.sh | 28 - build-nacl.sh | 45 - build-win32.bat | 89 - Makefile => build/Makefile | 0 .../cocos2d-win32.vc2012.sln | 0 .../project.pbxproj.REMOVED.git-id | 1 + .../install-deps-linux.sh | 0 .../make-all-linux-project.sh | 0 .../project.pbxproj.REMOVED.git-id | 1 + {cocos2dx => cocos/2d}/Android.mk | 0 {cocos2dx => cocos/2d}/CCCamera.cpp | 0 {cocos2dx => cocos/2d}/CCCamera.h | 0 {cocos2dx => cocos/2d}/CCConfiguration.cpp | 0 {cocos2dx => cocos/2d}/CCConfiguration.h | 0 {cocos2dx => cocos/2d}/CCDeprecated.cpp | 0 {cocos2dx => cocos/2d}/CCDirector.cpp | 0 {cocos2dx => cocos/2d}/CCDirector.h | 0 {cocos2dx => cocos/2d}/CCScheduler.cpp | 0 {cocos2dx => cocos/2d}/CCScheduler.h | 0 {cocos2dx => cocos/2d}/actions/CCAction.cpp | 0 {cocos2dx => cocos/2d}/actions/CCAction.h | 0 .../2d}/actions/CCActionCamera.cpp | 0 .../2d}/actions/CCActionCamera.h | 0 .../2d}/actions/CCActionCatmullRom.cpp | 0 .../2d}/actions/CCActionCatmullRom.h | 0 .../2d}/actions/CCActionEase.cpp | 0 {cocos2dx => cocos/2d}/actions/CCActionEase.h | 0 .../2d}/actions/CCActionGrid.cpp | 0 {cocos2dx => cocos/2d}/actions/CCActionGrid.h | 0 .../2d}/actions/CCActionGrid3D.cpp | 0 .../2d}/actions/CCActionGrid3D.h | 0 .../2d}/actions/CCActionInstant.cpp | 0 .../2d}/actions/CCActionInstant.h | 0 .../2d}/actions/CCActionInterval.cpp | 0 .../2d}/actions/CCActionInterval.h | 0 .../2d}/actions/CCActionManager.cpp | 0 .../2d}/actions/CCActionManager.h | 0 .../2d}/actions/CCActionPageTurn3D.cpp | 0 .../2d}/actions/CCActionPageTurn3D.h | 0 .../2d}/actions/CCActionProgressTimer.cpp | 0 .../2d}/actions/CCActionProgressTimer.h | 0 .../2d}/actions/CCActionTiledGrid.cpp | 0 .../2d}/actions/CCActionTiledGrid.h | 0 .../2d}/actions/CCActionTween.cpp | 0 .../2d}/actions/CCActionTween.h | 0 .../2d/base-nodes}/CCAtlasNode.cpp | 0 .../2d/base-nodes}/CCAtlasNode.h | 0 .../2d/base-nodes}/CCGLBufferedNode.cpp | 0 .../2d/base-nodes}/CCGLBufferedNode.h | 0 .../2d/base-nodes}/CCNode.cpp | 0 .../2d/base-nodes}/CCNode.h | 0 {cocos2dx => cocos/2d}/ccFPSImages.c | 0 {cocos2dx => cocos/2d}/ccFPSImages.h | 0 {cocos2dx => cocos/2d}/ccTypes.cpp | 0 {cocos2dx => cocos/2d}/cocos2d.cpp | 0 {cocos2dx => cocos/2d}/cocos2dx-Prefix.pch | 0 .../2d/draw-nodes}/CCDrawNode.cpp | 0 .../2d/draw-nodes}/CCDrawNode.h | 0 .../2d/draw-nodes}/CCDrawingPrimitives.cpp | 0 .../2d/draw-nodes}/CCDrawingPrimitives.h | 0 {cocos2dx => cocos/2d}/effects/CCGrabber.cpp | 0 {cocos2dx => cocos/2d}/effects/CCGrabber.h | 0 {cocos2dx => cocos/2d}/effects/CCGrid.cpp | 0 {cocos2dx => cocos/2d}/effects/CCGrid.h | 0 .../2d/event-dispatcher}/CCEvent.cpp | 0 .../2d/event-dispatcher}/CCEvent.h | 0 .../event-dispatcher}/CCEventAcceleration.cpp | 0 .../event-dispatcher}/CCEventAcceleration.h | 0 .../2d/event-dispatcher}/CCEventCustom.cpp | 0 .../2d/event-dispatcher}/CCEventCustom.h | 0 .../event-dispatcher}/CCEventDispatcher.cpp | 0 .../2d/event-dispatcher}/CCEventDispatcher.h | 0 .../2d/event-dispatcher}/CCEventKeyboard.cpp | 0 .../2d/event-dispatcher}/CCEventKeyboard.h | 0 .../2d/event-dispatcher}/CCEventListener.cpp | 0 .../2d/event-dispatcher}/CCEventListener.h | 0 .../CCEventListenerAcceleration.cpp | 0 .../CCEventListenerAcceleration.h | 0 .../CCEventListenerCustom.cpp | 0 .../event-dispatcher}/CCEventListenerCustom.h | 0 .../CCEventListenerKeyboard.cpp | 0 .../CCEventListenerKeyboard.h | 0 .../CCEventListenerTouch.cpp | 0 .../event-dispatcher}/CCEventListenerTouch.h | 0 .../2d/event-dispatcher}/CCEventTouch.cpp | 0 .../2d/event-dispatcher}/CCEventTouch.h | 0 .../2d/event-dispatcher}/CCTouch.cpp | 0 .../2d/event-dispatcher}/CCTouch.h | 0 {cocos2dx => cocos/2d}/include/CCDeprecated.h | 0 {cocos2dx => cocos/2d}/include/CCEventType.h | 0 {cocos2dx => cocos/2d}/include/CCProtocols.h | 0 {cocos2dx => cocos/2d}/include/ccConfig.h | 0 {cocos2dx => cocos/2d}/include/ccMacros.h | 0 {cocos2dx => cocos/2d}/include/ccTypes.h | 0 {cocos2dx => cocos/2d}/include/cocos2d.h | 42 - .../2d/label-nodes}/CCFont.cpp | 0 .../2d/label-nodes}/CCFont.h | 0 .../2d/label-nodes}/CCFontAtlas.cpp | 0 .../2d/label-nodes}/CCFontAtlas.h | 0 .../2d/label-nodes}/CCFontAtlasCache.cpp | 0 .../2d/label-nodes}/CCFontAtlasCache.h | 0 .../2d/label-nodes}/CCFontAtlasFactory.cpp | 0 .../2d/label-nodes}/CCFontAtlasFactory.h | 0 .../2d/label-nodes}/CCFontDefinition.cpp | 0 .../2d/label-nodes}/CCFontDefinition.h | 0 .../2d/label-nodes}/CCFontFNT.cpp | 0 .../2d/label-nodes}/CCFontFNT.h | 0 .../2d/label-nodes}/CCFontFreeType.cpp | 0 .../2d/label-nodes}/CCFontFreeType.h | 0 .../2d/label-nodes}/CCLabel.cpp | 0 .../2d/label-nodes}/CCLabel.h | 0 .../2d/label-nodes}/CCLabelAtlas.cpp | 0 .../2d/label-nodes}/CCLabelAtlas.h | 0 .../2d/label-nodes}/CCLabelBMFont.cpp | 0 .../2d/label-nodes}/CCLabelBMFont.h | 0 .../2d/label-nodes}/CCLabelTTF.cpp | 0 .../2d/label-nodes}/CCLabelTTF.h | 0 .../label-nodes}/CCLabelTextFormatProtocol.h | 0 .../2d/label-nodes}/CCLabelTextFormatter.cpp | 0 .../2d/label-nodes}/CCLabelTextFormatter.h | 0 .../2d/label-nodes}/CCTextImage.cpp | 0 .../2d/label-nodes}/CCTextImage.h | 0 .../CCLayer.cpp | 0 .../CCLayer.h | 0 .../CCScene.cpp | 0 .../CCScene.h | 0 .../CCTransition.cpp | 0 .../CCTransition.h | 0 .../CCTransitionPageTurn.cpp | 0 .../CCTransitionPageTurn.h | 0 .../CCTransitionProgress.cpp | 0 .../CCTransitionProgress.h | 0 .../2d/menu-nodes}/CCMenu.cpp | 0 .../2d/menu-nodes}/CCMenu.h | 0 .../2d/menu-nodes}/CCMenuItem.cpp | 0 .../2d/menu-nodes}/CCMenuItem.h | 0 .../2d/misc-nodes}/CCClippingNode.cpp | 0 .../2d/misc-nodes}/CCClippingNode.h | 0 .../2d/misc-nodes}/CCMotionStreak.cpp | 0 .../2d/misc-nodes}/CCMotionStreak.h | 0 .../2d/misc-nodes}/CCProgressTimer.cpp | 0 .../2d/misc-nodes}/CCProgressTimer.h | 0 .../2d/misc-nodes}/CCRenderTexture.cpp | 0 .../2d/misc-nodes}/CCRenderTexture.h | 0 .../particle-nodes}/CCParticleBatchNode.cpp | 0 .../2d/particle-nodes}/CCParticleBatchNode.h | 0 .../2d/particle-nodes}/CCParticleExamples.cpp | 0 .../2d/particle-nodes}/CCParticleExamples.h | 0 .../2d/particle-nodes}/CCParticleSystem.cpp | 0 .../2d/particle-nodes}/CCParticleSystem.h | 0 .../particle-nodes}/CCParticleSystemQuad.cpp | 0 .../2d/particle-nodes}/CCParticleSystemQuad.h | 0 .../2d/particle-nodes}/firePngData.h | 0 .../2d}/platform/CCApplicationProtocol.h | 0 {cocos2dx => cocos/2d}/platform/CCCommon.h | 0 {cocos2dx => cocos/2d}/platform/CCDevice.h | 0 .../2d}/platform/CCEGLViewProtocol.cpp | 0 .../2d}/platform/CCEGLViewProtocol.h | 0 .../2d}/platform/CCFileUtils.cpp | 0 {cocos2dx => cocos/2d}/platform/CCFileUtils.h | 0 {cocos2dx => cocos/2d}/platform/CCImage.h | 0 .../2d}/platform/CCImageCommon_cpp.h | 0 .../2d}/platform/CCSAXParser.cpp | 0 {cocos2dx => cocos/2d}/platform/CCSAXParser.h | 0 {cocos2dx => cocos/2d}/platform/CCThread.cpp | 0 {cocos2dx => cocos/2d}/platform/CCThread.h | 0 .../2d}/platform/android/Android.mk | 0 .../2d}/platform/android/CCApplication.cpp | 0 .../2d}/platform/android/CCApplication.h | 0 .../2d}/platform/android/CCCommon.cpp | 0 .../2d}/platform/android/CCDevice.cpp | 0 .../2d}/platform/android/CCEGLView.cpp | 0 .../2d}/platform/android/CCEGLView.h | 0 .../platform/android/CCFileUtilsAndroid.cpp | 0 .../2d}/platform/android/CCFileUtilsAndroid.h | 0 .../2d}/platform/android/CCGL.h | 0 .../2d}/platform/android/CCImage.cpp | 0 .../2d}/platform/android/CCPlatformDefine.h | 0 .../2d}/platform/android/CCStdC.h | 0 .../2d}/platform/android/java/.classpath | 0 .../2d}/platform/android/java/.project | 0 .../java/.settings/org.eclipse.jdt.core.prefs | 0 .../platform/android/java/AndroidManifest.xml | 0 .../2d}/platform/android/java/ant.properties | 0 .../2d}/platform/android/java/build.xml | 0 .../android/java/proguard-project.txt | 0 .../platform/android/java/project.properties | 0 .../2d}/platform/android/java/res/.gitignore | 0 .../src/org/cocos2dx/lib/Cocos2dxBitmap.java | 0 .../cocos2dx/lib/Cocos2dxEditBoxDialog.java | 0 .../src/org/cocos2dx/lib/Cocos2dxHelper.java | 0 .../cocos2dx/lib/Cocos2dxLocalStorage.java | 0 .../cocos2dx/lib/Cocos2dxLuaJavaBridge.java | 0 .../src/org/cocos2dx/lib/Cocos2dxMusic.java | 0 .../src/org/cocos2dx/lib/Cocos2dxSound.java | 0 .../org/cocos2dx/lib/Cocos2dxTypefaces.java | 0 .../2d}/platform/android/jni/DPIJni.cpp | 0 .../2d}/platform/android/jni/DPIJni.h | 0 .../2d}/platform/android/jni/IMEJni.cpp | 0 .../2d}/platform/android/jni/IMEJni.h | 0 .../Java_org_cocos2dx_lib_Cocos2dxBitmap.cpp | 0 .../Java_org_cocos2dx_lib_Cocos2dxBitmap.h | 0 .../Java_org_cocos2dx_lib_Cocos2dxHelper.cpp | 0 .../Java_org_cocos2dx_lib_Cocos2dxHelper.h | 0 .../2d}/platform/android/jni/JniHelper.cpp | 0 .../2d}/platform/android/jni/JniHelper.h | 0 .../2d}/platform/android/nativeactivity.cpp | 0 .../2d}/platform/android/nativeactivity.h | 0 .../2d}/platform/apple/CCFileUtilsApple.h | 0 .../2d}/platform/apple/CCFileUtilsApple.mm | 0 .../2d}/platform/apple/CCLock.cpp | 0 .../2d}/platform/apple/CCLock.h | 0 .../2d}/platform/apple/CCThread.mm | 0 .../2d}/platform/ios/CCApplication.h | 0 .../2d}/platform/ios/CCApplication.mm | 0 .../2d}/platform/ios/CCCommon.mm | 0 .../2d}/platform/ios/CCDevice.mm | 0 .../2d}/platform/ios/CCDirectorCaller.h | 0 .../2d}/platform/ios/CCDirectorCaller.mm | 0 .../2d}/platform/ios/CCEGLView.h | 0 .../2d}/platform/ios/CCEGLView.mm | 0 .../2d}/platform/ios/CCES2Renderer.h | 0 .../2d}/platform/ios/CCES2Renderer.m | 0 .../2d}/platform/ios/CCESRenderer.h | 0 {cocos2dx => cocos/2d}/platform/ios/CCGL.h | 0 .../2d}/platform/ios/CCImage.mm | 0 .../2d/platform/ios}/CCPlatformDefine.h | 0 {cocos2dx => cocos/2d}/platform/ios/CCStdC.h | 0 .../2d}/platform/ios/EAGLView.h | 0 .../2d}/platform/ios/EAGLView.mm | 0 .../2d}/platform/ios/OpenGL_Internal.h | 0 .../ios/Simulation/AccelerometerSimulation.h | 0 .../ios/Simulation/AccelerometerSimulation.m | 0 .../2d}/platform/linux/CCApplication.cpp | 0 .../2d}/platform/linux/CCApplication.h | 0 .../2d}/platform/linux/CCCommon.cpp | 0 .../2d}/platform/linux/CCDevice.cpp | 0 .../2d}/platform/linux/CCEGLView.cpp | 0 .../2d}/platform/linux/CCEGLView.h | 0 .../2d}/platform/linux/CCFileUtilsLinux.cpp | 0 .../2d}/platform/linux/CCFileUtilsLinux.h | 0 {cocos2dx => cocos/2d}/platform/linux/CCGL.h | 0 .../2d}/platform/linux/CCImage.cpp | 0 .../2d}/platform/linux/CCPlatformDefine.h | 0 .../2d}/platform/linux/CCStdC.cpp | 0 .../2d}/platform/linux/CCStdC.h | 0 .../2d}/platform/mac/CCApplication.h | 0 .../2d}/platform/mac/CCApplication.mm | 0 .../2d}/platform/mac/CCCommon.mm | 0 .../2d}/platform/mac/CCDevice.mm | 0 .../2d}/platform/mac/CCDirectorCaller.h | 0 .../2d}/platform/mac/CCDirectorCaller.mm | 0 .../2d}/platform/mac/CCEGLView.h | 0 .../2d}/platform/mac/CCEGLView.mm | 0 .../2d}/platform/mac/CCEventDispatcher.h | 0 .../2d}/platform/mac/CCEventDispatcher.mm | 0 {cocos2dx => cocos/2d}/platform/mac/CCGL.h | 0 .../2d}/platform/mac/CCImage.mm | 0 .../2d}/platform/mac/CCPlatformDefine.h | 0 {cocos2dx => cocos/2d}/platform/mac/CCStdC.h | 0 .../2d}/platform/mac/CCWindow.h | 0 .../2d}/platform/mac/CCWindow.m | 0 .../2d}/platform/mac/EAGLView.h | 0 .../2d}/platform/mac/EAGLView.mm | 0 .../2d}/platform/win32/CCApplication.cpp | 0 .../2d}/platform/win32/CCApplication.h | 0 .../2d}/platform/win32/CCCommon.cpp | 0 .../2d}/platform/win32/CCDevice.cpp | 0 .../2d}/platform/win32/CCEGLView.cpp | 0 .../2d}/platform/win32/CCEGLView.h | 0 .../2d}/platform/win32/CCFileUtilsWin32.cpp | 0 .../2d}/platform/win32/CCFileUtilsWin32.h | 0 {cocos2dx => cocos/2d}/platform/win32/CCGL.h | 0 .../2d}/platform/win32/CCImage.cpp | 0 .../2d}/platform/win32/CCPlatformDefine.h | 0 .../2d}/platform/win32/CCStdC.cpp | 0 .../2d}/platform/win32/CCStdC.h | 0 .../2d}/platform/win32/compat/stdint.h | 0 {cocos2dx => cocos/2d}/proj.linux/.cproject | 0 {cocos2dx => cocos/2d}/proj.linux/.project | 0 {cocos2dx => cocos/2d}/proj.linux/Makefile | 0 {cocos2dx => cocos/2d}/proj.linux/cocos2dx.mk | 0 .../2d}/proj.linux/cocos2dx.prf | 0 .../2d}/proj.linux/cocos2dx.pri | 0 .../2d}/proj.win32/cocos2d.vcxproj | 0 .../2d}/proj.win32/cocos2d.vcxproj.filters | 0 .../2d}/proj.win32/cocos2d.vcxproj.user | 0 .../2d}/proj.win32/cocos2dx.props | 0 .../2d/script-support}/CCScriptSupport.cpp | 0 .../2d/script-support}/CCScriptSupport.h | 0 .../2d}/shaders/CCGLProgram.cpp | 0 {cocos2dx => cocos/2d}/shaders/CCGLProgram.h | 0 .../2d}/shaders/CCShaderCache.cpp | 0 .../2d}/shaders/CCShaderCache.h | 0 .../2d}/shaders/ccGLStateCache.cpp | 0 .../2d}/shaders/ccGLStateCache.h | 0 .../2d}/shaders/ccShaderEx_SwitchMask_frag.h | 0 ...ccShader_PositionColorLengthTexture_frag.h | 0 ...ccShader_PositionColorLengthTexture_vert.h | 0 .../2d}/shaders/ccShader_PositionColor_frag.h | 0 .../2d}/shaders/ccShader_PositionColor_vert.h | 0 .../ccShader_PositionTextureA8Color_frag.h | 0 .../ccShader_PositionTextureA8Color_vert.h | 0 ...hader_PositionTextureColorAlphaTest_frag.h | 0 .../ccShader_PositionTextureColor_frag.h | 0 .../ccShader_PositionTextureColor_vert.h | 0 .../shaders/ccShader_PositionTexture_frag.h | 0 .../ccShader_PositionTexture_uColor_frag.h | 0 .../ccShader_PositionTexture_uColor_vert.h | 0 .../shaders/ccShader_PositionTexture_vert.h | 0 .../shaders/ccShader_Position_uColor_frag.h | 0 .../shaders/ccShader_Position_uColor_vert.h | 0 {cocos2dx => cocos/2d}/shaders/ccShaders.cpp | 0 {cocos2dx => cocos/2d}/shaders/ccShaders.h | 0 .../2d/sprite-nodes}/CCAnimation.cpp | 0 .../2d/sprite-nodes}/CCAnimation.h | 0 .../2d/sprite-nodes}/CCAnimationCache.cpp | 0 .../2d/sprite-nodes}/CCAnimationCache.h | 0 .../2d/sprite-nodes}/CCSprite.cpp | 0 .../2d/sprite-nodes}/CCSprite.h | 0 .../2d/sprite-nodes}/CCSpriteBatchNode.cpp | 0 .../2d/sprite-nodes}/CCSpriteBatchNode.h | 0 .../2d/sprite-nodes}/CCSpriteFrame.cpp | 0 .../2d/sprite-nodes}/CCSpriteFrame.h | 0 .../2d/sprite-nodes}/CCSpriteFrameCache.cpp | 0 .../2d/sprite-nodes}/CCSpriteFrameCache.h | 0 .../2d}/support/CCNotificationCenter.cpp | 0 .../2d}/support/CCNotificationCenter.h | 0 .../2d}/support/CCProfiling.cpp | 0 {cocos2dx => cocos/2d}/support/CCProfiling.h | 0 {cocos2dx => cocos/2d}/support/CCVertex.cpp | 0 {cocos2dx => cocos/2d}/support/CCVertex.h | 0 .../2d}/support/TransformUtils.cpp | 0 .../2d}/support/TransformUtils.h | 0 {cocos2dx => cocos/2d}/support/base64.cpp | 0 {cocos2dx => cocos/2d}/support/base64.h | 0 {cocos2dx => cocos/2d}/support/ccUTF8.cpp | 0 {cocos2dx => cocos/2d}/support/ccUTF8.h | 0 {cocos2dx => cocos/2d}/support/ccUtils.cpp | 0 {cocos2dx => cocos/2d}/support/ccUtils.h | 0 .../2d}/support/component/CCComponent.cpp | 0 .../2d}/support/component/CCComponent.h | 0 .../component/CCComponentContainer.cpp | 0 .../support/component/CCComponentContainer.h | 0 .../2d}/support/data_support/ccCArray.cpp | 0 .../2d}/support/data_support/ccCArray.h | 0 .../2d}/support/data_support/uthash.h | 0 .../2d}/support/data_support/utlist.h | 0 .../2d}/support/image_support/TGAlib.cpp | 0 .../2d}/support/image_support/TGAlib.h | 0 .../2d}/support/tinyxml2/tinyxml2.cpp | 0 .../2d}/support/tinyxml2/tinyxml2.h | 0 .../support/user_default/CCUserDefault.cpp | 0 .../2d}/support/user_default/CCUserDefault.h | 0 .../2d}/support/user_default/CCUserDefault.mm | 0 .../user_default/CCUserDefaultAndroid.cpp | 0 .../2d}/support/zip_support/ZipUtils.cpp | 0 .../2d}/support/zip_support/ZipUtils.h | 0 .../2d}/support/zip_support/ioapi.cpp | 0 .../2d}/support/zip_support/ioapi.h | 0 .../2d}/support/zip_support/unzip.cpp | 0 .../2d}/support/zip_support/unzip.h | 0 .../2d/text-input-node}/CCIMEDelegate.h | 0 .../2d/text-input-node}/CCIMEDispatcher.cpp | 0 .../2d/text-input-node}/CCIMEDispatcher.h | 0 .../2d/text-input-node}/CCTextFieldTTF.cpp | 0 .../2d/text-input-node}/CCTextFieldTTF.h | 0 .../2d}/textures/CCTexture2D.cpp | 0 {cocos2dx => cocos/2d}/textures/CCTexture2D.h | 0 .../2d}/textures/CCTextureAtlas.cpp | 0 .../2d}/textures/CCTextureAtlas.h | 0 .../2d}/textures/CCTextureCache.cpp | 0 .../2d}/textures/CCTextureCache.h | 0 .../CCParallaxNode.cpp | 0 .../tilemap-parallax-nodes}/CCParallaxNode.h | 0 .../2d/tilemap-parallax-nodes}/CCTMXLayer.cpp | 0 .../2d/tilemap-parallax-nodes}/CCTMXLayer.h | 0 .../CCTMXObjectGroup.cpp | 0 .../CCTMXObjectGroup.h | 0 .../tilemap-parallax-nodes}/CCTMXTiledMap.cpp | 0 .../tilemap-parallax-nodes}/CCTMXTiledMap.h | 0 .../CCTMXXMLParser.cpp | 0 .../tilemap-parallax-nodes}/CCTMXXMLParser.h | 0 .../CCTileMapAtlas.cpp | 0 .../tilemap-parallax-nodes}/CCTileMapAtlas.h | 0 {audio => cocos/audio}/android/Android.mk | 0 .../audio}/android/ccdandroidUtils.cpp | 0 .../audio}/android/ccdandroidUtils.h | 0 .../audio}/android/cddSimpleAudioEngine.cpp | 0 .../jni/cddandroidAndroidJavaEngine.cpp | 0 .../android/jni/cddandroidAndroidJavaEngine.h | 0 .../audio}/android/opensl/OpenSLEngine.cpp | 0 .../audio}/android/opensl/OpenSLEngine.h | 0 .../opensl/SimpleAudioEngineOpenSL.cpp | 0 .../android/opensl/SimpleAudioEngineOpenSL.h | 0 .../android/opensl/cddandroidOpenSLEngine.cpp | 0 .../android/opensl/cddandroidOpenSLEngine.h | 0 {audio => cocos/audio}/include/Export.h | 0 .../audio}/include/SimpleAudioEngine.h | 0 {audio => cocos/audio}/ios/CDAudioManager.h | 0 {audio => cocos/audio}/ios/CDAudioManager.m | 0 {audio => cocos/audio}/ios/CDConfig.h | 0 {audio => cocos/audio}/ios/CDOpenALSupport.h | 0 {audio => cocos/audio}/ios/CDOpenALSupport.m | 0 {audio => cocos/audio}/ios/CocosDenshion.h | 0 {audio => cocos/audio}/ios/CocosDenshion.m | 0 .../audio}/ios/SimpleAudioEngine.mm | 0 .../audio}/ios/SimpleAudioEngine_objc.h | 0 .../audio}/ios/SimpleAudioEngine_objc.m | 0 {audio => cocos/audio}/linux/AudioPlayer.h | 0 .../audio}/linux/FmodAudioPlayer.cpp | 0 .../audio}/linux/FmodAudioPlayer.h | 0 .../audio}/linux/SimpleAudioEngineFMOD.cpp | 0 {audio => cocos/audio}/mac/CDAudioManager.h | 0 {audio => cocos/audio}/mac/CDAudioManager.m | 0 {audio => cocos/audio}/mac/CDConfig.h | 0 {audio => cocos/audio}/mac/CDOpenALSupport.h | 0 {audio => cocos/audio}/mac/CDOpenALSupport.m | 0 {audio => cocos/audio}/mac/CDXMacOSXSupport.h | 0 .../audio}/mac/CDXMacOSXSupport.mm | 0 {audio => cocos/audio}/mac/CocosDenshion.h | 0 {audio => cocos/audio}/mac/CocosDenshion.m | 0 .../audio}/mac/SimpleAudioEngine.mm | 9 +- .../audio}/mac/SimpleAudioEngine_objc.h | 0 .../audio}/mac/SimpleAudioEngine_objc.m | 0 .../audio}/openal/OpenALDecoder.cpp | 0 {audio => cocos/audio}/openal/OpenALDecoder.h | 0 .../audio}/openal/SimpleAudioEngineOpenAL.cpp | 0 {audio => cocos/audio}/proj.linux/.cproject | 0 {audio => cocos/audio}/proj.linux/.project | 0 .../audio}/proj.linux/CocosDenshion.prf | 0 {audio => cocos/audio}/proj.linux/Makefile | 0 .../audio}/proj.win32/CocosDenshion.vcxproj | 0 .../proj.win32/CocosDenshion.vcxproj.filters | 0 .../proj.win32/CocosDenshion.vcxproj.user | 0 .../audio/third-party}/fmod/Makefile | 0 .../fmod/api/inc/fmod.h.REMOVED.git-id | 0 .../audio/third-party}/fmod/api/inc/fmod.hpp | 0 .../third-party}/fmod/api/inc/fmod_codec.h | 0 .../third-party}/fmod/api/inc/fmod_dsp.h | 0 .../third-party}/fmod/api/inc/fmod_errors.h | 0 .../fmod/api/inc/fmod_memoryinfo.h | 0 .../third-party}/fmod/api/inc/fmod_output.h | 0 .../third-party}/fmod/api/inc/fmodlinux.h | 0 .../lib/libfmodex-4.36.01.so.REMOVED.git-id | 0 .../fmod/api/lib/libfmodex.so.REMOVED.git-id | 0 .../lib/libfmodexL-4.36.01.so.REMOVED.git-id | 0 .../fmod/api/lib/libfmodexL.so.REMOVED.git-id | 0 .../audio/third-party}/fmod/lib64/Makefile | 0 .../fmod/lib64/api/inc/fmod.h.REMOVED.git-id | 0 .../third-party}/fmod/lib64/api/inc/fmod.hpp | 0 .../fmod/lib64/api/inc/fmod_codec.h | 0 .../fmod/lib64/api/inc/fmod_dsp.h | 0 .../fmod/lib64/api/inc/fmod_errors.h | 0 .../fmod/lib64/api/inc/fmod_memoryinfo.h | 0 .../fmod/lib64/api/inc/fmod_output.h | 0 .../fmod/lib64/api/inc/fmodlinux.h | 0 .../lib/libfmodex64-4.38.00.so.REMOVED.git-id | 0 .../api/lib/libfmodex64.so.REMOVED.git-id | 0 .../libfmodexL64-4.38.00.so.REMOVED.git-id | 0 .../api/lib/libfmodexL64.so.REMOVED.git-id | 0 {audio => cocos/audio}/win32/MciPlayer.cpp | 0 {audio => cocos/audio}/win32/MciPlayer.h | 0 .../audio}/win32/SimpleAudioEngine.cpp | 0 .../cocosbuilder}/CCBAnimationManager.cpp | 0 .../cocosbuilder}/CCBAnimationManager.h | 0 .../cocosbuilder}/CCBFileLoader.cpp | 0 .../cocosbuilder}/CCBFileLoader.h | 0 .../cocosbuilder}/CCBKeyframe.cpp | 0 .../cocosbuilder}/CCBKeyframe.h | 0 .../cocosbuilder}/CCBMemberVariableAssigner.h | 0 .../cocosbuilder}/CCBReader.cpp | 0 .../editor-support/cocosbuilder}/CCBReader.h | 0 .../cocosbuilder}/CCBSelectorResolver.h | 0 .../cocosbuilder}/CCBSequence.cpp | 0 .../cocosbuilder}/CCBSequence.h | 0 .../cocosbuilder}/CCBSequenceProperty.cpp | 0 .../cocosbuilder}/CCBSequenceProperty.h | 0 .../editor-support/cocosbuilder}/CCBValue.cpp | 0 .../editor-support/cocosbuilder}/CCBValue.h | 0 .../cocosbuilder}/CCControlButtonLoader.cpp | 0 .../cocosbuilder}/CCControlButtonLoader.h | 0 .../cocosbuilder}/CCControlLoader.cpp | 0 .../cocosbuilder}/CCControlLoader.h | 0 .../cocosbuilder}/CCLabelBMFontLoader.cpp | 0 .../cocosbuilder}/CCLabelBMFontLoader.h | 0 .../cocosbuilder}/CCLabelTTFLoader.cpp | 0 .../cocosbuilder}/CCLabelTTFLoader.h | 0 .../cocosbuilder}/CCLayerColorLoader.cpp | 0 .../cocosbuilder}/CCLayerColorLoader.h | 0 .../cocosbuilder}/CCLayerGradientLoader.cpp | 0 .../cocosbuilder}/CCLayerGradientLoader.h | 0 .../cocosbuilder}/CCLayerLoader.cpp | 0 .../cocosbuilder}/CCLayerLoader.h | 0 .../cocosbuilder}/CCMenuItemImageLoader.cpp | 0 .../cocosbuilder}/CCMenuItemImageLoader.h | 0 .../cocosbuilder}/CCMenuItemLoader.cpp | 0 .../cocosbuilder}/CCMenuItemLoader.h | 0 .../cocosbuilder}/CCMenuLoader.h | 0 .../CCNode+CCBRelativePositioning.cpp | 0 .../CCNode+CCBRelativePositioning.h | 0 .../cocosbuilder}/CCNodeLoader.cpp | 0 .../cocosbuilder}/CCNodeLoader.h | 0 .../cocosbuilder}/CCNodeLoaderLibrary.cpp | 0 .../cocosbuilder}/CCNodeLoaderLibrary.h | 0 .../cocosbuilder}/CCNodeLoaderListener.h | 0 .../CCParticleSystemQuadLoader.cpp | 0 .../CCParticleSystemQuadLoader.h | 0 .../cocosbuilder}/CCScale9SpriteLoader.cpp | 0 .../cocosbuilder}/CCScale9SpriteLoader.h | 0 .../cocosbuilder}/CCScrollViewLoader.cpp | 0 .../cocosbuilder}/CCScrollViewLoader.h | 0 .../cocosbuilder}/CCSpriteLoader.cpp | 0 .../cocosbuilder}/CCSpriteLoader.h | 0 .../cocostudio/action}/CCActionFrame.cpp | 0 .../cocostudio/action}/CCActionFrame.h | 0 .../action}/CCActionFrameEasing.cpp | 0 .../cocostudio/action}/CCActionFrameEasing.h | 0 .../cocostudio/action}/CCActionManagerEx.cpp | 0 .../cocostudio/action}/CCActionManagerEx.h | 0 .../cocostudio/action}/CCActionNode.cpp | 0 .../cocostudio/action}/CCActionNode.h | 0 .../cocostudio/action}/CCActionObject.cpp | 0 .../cocostudio/action}/CCActionObject.h | 0 .../cocostudio/armature}/CCArmature.cpp | 0 .../cocostudio/armature}/CCArmature.h | 0 .../cocostudio/armature}/CCBone.cpp | 0 .../cocostudio/armature}/CCBone.h | 0 .../animation/CCArmatureAnimation.cpp | 0 .../armature}/animation/CCArmatureAnimation.h | 0 .../armature}/animation/CCProcessBase.cpp | 0 .../armature}/animation/CCProcessBase.h | 0 .../armature}/animation/CCTween.cpp | 0 .../cocostudio/armature}/animation/CCTween.h | 0 .../cocostudio/armature}/datas/CCDatas.cpp | 0 .../cocostudio/armature}/datas/CCDatas.h | 0 .../armature}/display/CCBatchNode.cpp | 0 .../armature}/display/CCBatchNode.h | 0 .../armature}/display/CCDecorativeDisplay.cpp | 0 .../armature}/display/CCDecorativeDisplay.h | 0 .../armature}/display/CCDisplayFactory.cpp | 0 .../armature}/display/CCDisplayFactory.h | 0 .../armature}/display/CCDisplayManager.cpp | 0 .../armature}/display/CCDisplayManager.h | 0 .../cocostudio/armature}/display/CCSkin.cpp | 0 .../cocostudio/armature}/display/CCSkin.h | 0 .../armature}/physics/CCColliderDetector.cpp | 0 .../armature}/physics/CCColliderDetector.h | 0 .../armature}/utils/CCArmatureDataManager.cpp | 0 .../armature}/utils/CCArmatureDataManager.h | 0 .../armature}/utils/CCArmatureDefine.cpp | 0 .../armature}/utils/CCArmatureDefine.h | 0 .../armature}/utils/CCDataReaderHelper.cpp | 0 .../armature}/utils/CCDataReaderHelper.h | 0 .../utils/CCSpriteFrameCacheHelper.cpp | 0 .../utils/CCSpriteFrameCacheHelper.h | 0 .../armature}/utils/CCTransformHelp.cpp | 0 .../armature}/utils/CCTransformHelp.h | 0 .../armature}/utils/CCTweenFunction.cpp | 0 .../armature}/utils/CCTweenFunction.h | 0 .../cocostudio/armature}/utils/CCUtilMath.cpp | 0 .../cocostudio/armature}/utils/CCUtilMath.h | 0 .../cocostudio/components}/CCComAttribute.cpp | 0 .../cocostudio/components}/CCComAttribute.h | 0 .../cocostudio/components}/CCComAudio.cpp | 0 .../cocostudio/components}/CCComAudio.h | 0 .../components}/CCComController.cpp | 0 .../cocostudio/components}/CCComController.h | 0 .../cocostudio/components}/CCComRender.cpp | 0 .../cocostudio/components}/CCComRender.h | 0 .../components}/CCInputDelegate.cpp | 0 .../cocostudio/components}/CCInputDelegate.h | 0 .../json}/CSContentJsonDictionary.cpp | 0 .../json}/CSContentJsonDictionary.h | 0 .../cocostudio/json}/DictionaryHelper.cpp | 0 .../cocostudio/json}/DictionaryHelper.h | 0 .../cocostudio/reader}/CCSGUIReader.cpp | 0 .../cocostudio/reader}/CCSGUIReader.h | 0 .../cocostudio/reader}/CCSSceneReader.cpp | 0 .../cocostudio/reader}/CCSSceneReader.h | 0 .../editor-support}/spine/Animation.cpp | 0 .../editor-support}/spine/Animation.h | 0 .../editor-support}/spine/AnimationState.cpp | 0 .../editor-support}/spine/AnimationState.h | 0 .../spine/AnimationStateData.cpp | 0 .../spine/AnimationStateData.h | 0 .../editor-support}/spine/Atlas.cpp | 0 .../editor-support}/spine/Atlas.h | 0 .../spine/AtlasAttachmentLoader.cpp | 0 .../spine/AtlasAttachmentLoader.h | 0 .../editor-support}/spine/Attachment.cpp | 0 .../editor-support}/spine/Attachment.h | 0 .../spine/AttachmentLoader.cpp | 0 .../editor-support}/spine/AttachmentLoader.h | 0 .../editor-support}/spine/Bone.cpp | 0 .../editor-support}/spine/Bone.h | 0 .../editor-support}/spine/BoneData.cpp | 0 .../editor-support}/spine/BoneData.h | 0 .../editor-support}/spine/CCSkeleton.cpp | 0 .../editor-support}/spine/CCSkeleton.h | 0 .../spine/CCSkeletonAnimation.cpp | 0 .../spine/CCSkeletonAnimation.h | 0 .../editor-support}/spine/Json.cpp | 0 .../editor-support}/spine/Json.h | 0 .../spine/RegionAttachment.cpp | 0 .../editor-support}/spine/RegionAttachment.h | 0 .../editor-support}/spine/Skeleton.cpp | 0 .../editor-support}/spine/Skeleton.h | 0 .../editor-support}/spine/SkeletonData.cpp | 0 .../editor-support}/spine/SkeletonData.h | 0 .../editor-support}/spine/SkeletonJson.cpp | 0 .../editor-support}/spine/SkeletonJson.h | 0 .../editor-support}/spine/Skin.cpp | 0 .../editor-support}/spine/Skin.h | 0 .../editor-support}/spine/Slot.cpp | 0 .../editor-support}/spine/Slot.h | 0 .../editor-support}/spine/SlotData.cpp | 0 .../editor-support}/spine/SlotData.h | 0 .../editor-support}/spine/extension.cpp | 0 .../editor-support}/spine/extension.h | 0 .../editor-support}/spine/spine-cocos2dx.cpp | 0 .../editor-support}/spine/spine-cocos2dx.h | 0 .../editor-support}/spine/spine.h | 0 .../gui/base-classes}/UIRootWidget.cpp | 0 .../gui/base-classes}/UIRootWidget.h | 0 .../gui/base-classes}/UIWidget.cpp | 0 .../gui/base-classes}/UIWidget.h | 0 .../Layouts => cocos/gui/layouts}/Layout.cpp | 0 .../Layouts => cocos/gui/layouts}/Layout.h | 0 .../gui/layouts}/LayoutParameter.cpp | 0 .../gui/layouts}/LayoutParameter.h | 0 .../gui/layouts}/UILayoutDefine.cpp | 0 .../gui/layouts}/UILayoutDefine.h | 0 .../System => cocos/gui/system}/CocosGUI.cpp | 0 .../System => cocos/gui/system}/CocosGUI.h | 0 .../System => cocos/gui/system}/UIHelper.cpp | 0 .../System => cocos/gui/system}/UIHelper.h | 0 .../gui/system}/UIInputManager.cpp | 0 .../gui/system}/UIInputManager.h | 0 .../System => cocos/gui/system}/UILayer.cpp | 0 .../GUI/System => cocos/gui/system}/UILayer.h | 0 .../gui/widgets}/ScrollWidget/UIDragPanel.cpp | 0 .../gui/widgets}/ScrollWidget/UIDragPanel.h | 0 .../gui/widgets}/ScrollWidget/UIListView.cpp | 0 .../gui/widgets}/ScrollWidget/UIListView.h | 0 .../gui/widgets}/ScrollWidget/UIPageView.cpp | 0 .../gui/widgets}/ScrollWidget/UIPageView.h | 0 .../widgets}/ScrollWidget/UIScrollInterface.h | 0 .../widgets}/ScrollWidget/UIScrollView.cpp | 0 .../gui/widgets}/ScrollWidget/UIScrollView.h | 0 .../gui/widgets}/UIButton.cpp | 0 .../gui/widgets}/UIButton.h | 0 .../gui/widgets}/UICheckBox.cpp | 0 .../gui/widgets}/UICheckBox.h | 0 .../gui/widgets}/UIImageView.cpp | 0 .../gui/widgets}/UIImageView.h | 0 .../gui/widgets}/UILabel.cpp | 0 .../UIWidgets => cocos/gui/widgets}/UILabel.h | 0 .../gui/widgets}/UILabelAtlas.cpp | 0 .../gui/widgets}/UILabelAtlas.h | 0 .../gui/widgets}/UILabelBMFont.cpp | 0 .../gui/widgets}/UILabelBMFont.h | 0 .../gui/widgets}/UILoadingBar.cpp | 0 .../gui/widgets}/UILoadingBar.h | 0 .../gui/widgets}/UISlider.cpp | 0 .../gui/widgets}/UISlider.h | 0 .../gui/widgets}/UITextField.cpp | 0 .../gui/widgets}/UITextField.h | 0 .../kazmath/include/kazmath/GL/mat4stack.h | 0 .../math}/kazmath/include/kazmath/GL/matrix.h | 0 .../math}/kazmath/include/kazmath/aabb.h | 0 .../math}/kazmath/include/kazmath/kazmath.h | 0 .../math}/kazmath/include/kazmath/mat3.h | 0 .../math}/kazmath/include/kazmath/mat4.h | 0 .../include/kazmath/neon_matrix_impl.h | 0 .../math}/kazmath/include/kazmath/plane.h | 0 .../kazmath/include/kazmath/quaternion.h | 0 .../math}/kazmath/include/kazmath/ray2.h | 0 .../math}/kazmath/include/kazmath/utility.h | 0 .../math}/kazmath/include/kazmath/vec2.h | 0 .../math}/kazmath/include/kazmath/vec3.h | 0 .../math}/kazmath/include/kazmath/vec4.h | 0 .../math}/kazmath/src/CMakeLists.txt | 0 .../math}/kazmath/src/ChangeLog | 0 .../math}/kazmath/src/GL/mat4stack.c | 0 .../math}/kazmath/src/GL/matrix.c | 0 {cocos2dx => cocos/math}/kazmath/src/aabb.c | 0 {cocos2dx => cocos/math}/kazmath/src/mat3.c | 0 {cocos2dx => cocos/math}/kazmath/src/mat4.c | 0 .../math}/kazmath/src/neon_matrix_impl.c | 0 {cocos2dx => cocos/math}/kazmath/src/plane.c | 0 .../math}/kazmath/src/quaternion.c | 0 {cocos2dx => cocos/math}/kazmath/src/ray2.c | 0 .../math}/kazmath/src/utility.c | 0 {cocos2dx => cocos/math}/kazmath/src/vec2.c | 0 {cocos2dx => cocos/math}/kazmath/src/vec3.c | 0 {cocos2dx => cocos/math}/kazmath/src/vec4.c | 0 {extensions => cocos}/network/HttpClient.cpp | 0 {extensions => cocos}/network/HttpClient.h | 0 {extensions => cocos}/network/HttpRequest.h | 0 {extensions => cocos}/network/HttpResponse.h | 0 {extensions => cocos}/network/SocketIO.cpp | 0 {extensions => cocos}/network/SocketIO.h | 0 {extensions => cocos}/network/WebSocket.cpp | 0 {extensions => cocos}/network/WebSocket.h | 0 .../physics/Box2D/CCPhysicsBodyInfo.cpp | 0 .../physics/Box2D/CCPhysicsBodyInfo.h | 0 .../physics/Box2D/CCPhysicsContactInfo.cpp | 0 .../physics/Box2D/CCPhysicsContactInfo.h | 0 .../physics/Box2D/CCPhysicsHelper.h | 0 .../physics/Box2D/CCPhysicsJointInfo.cpp | 0 .../physics/Box2D/CCPhysicsJointInfo.h | 0 .../physics/Box2D/CCPhysicsShapeInfo.cpp | 0 .../physics/Box2D/CCPhysicsShapeInfo.h | 0 .../physics/Box2D/CCPhysicsWorldInfo.cpp | 0 .../physics/Box2D/CCPhysicsWorldInfo.h | 0 {cocos2dx => cocos}/physics/CCPhysicsBody.cpp | 0 {cocos2dx => cocos}/physics/CCPhysicsBody.h | 0 .../physics/CCPhysicsContact.cpp | 0 .../physics/CCPhysicsContact.h | 0 .../physics/CCPhysicsJoint.cpp | 0 {cocos2dx => cocos}/physics/CCPhysicsJoint.h | 0 .../physics/CCPhysicsSetting.h | 0 .../physics/CCPhysicsShape.cpp | 0 {cocos2dx => cocos}/physics/CCPhysicsShape.h | 0 .../physics/CCPhysicsWorld.cpp | 0 {cocos2dx => cocos}/physics/CCPhysicsWorld.h | 0 .../physics/chipmunk/CCPhysicsBodyInfo.cpp | 0 .../physics/chipmunk/CCPhysicsBodyInfo.h | 0 .../physics/chipmunk/CCPhysicsContactInfo.cpp | 0 .../physics/chipmunk/CCPhysicsContactInfo.h | 0 .../physics/chipmunk/CCPhysicsHelper.h | 0 .../physics/chipmunk/CCPhysicsJointInfo.cpp | 0 .../physics/chipmunk/CCPhysicsJointInfo.h | 0 .../physics/chipmunk/CCPhysicsShapeInfo.cpp | 0 .../physics/chipmunk/CCPhysicsShapeInfo.h | 0 .../physics/chipmunk/CCPhysicsWorldInfo.cpp | 0 .../physics/chipmunk/CCPhysicsWorldInfo.h | 0 .../platform/CCPlatformConfig.h | 0 .../platform/CCPlatformMacros.h | 0 .../platform}/cocoa/CCAffineTransform.cpp | 0 .../platform}/cocoa/CCAffineTransform.h | 0 .../platform}/cocoa/CCArray.cpp | 0 {cocos2dx => cocos/platform}/cocoa/CCArray.h | 0 .../platform}/cocoa/CCAutoreleasePool.cpp | 0 .../platform}/cocoa/CCAutoreleasePool.h | 0 {cocos2dx => cocos/platform}/cocoa/CCBool.h | 0 {cocos2dx => cocos/platform}/cocoa/CCData.cpp | 0 {cocos2dx => cocos/platform}/cocoa/CCData.h | 0 .../platform}/cocoa/CCDataVisitor.cpp | 0 .../platform}/cocoa/CCDataVisitor.h | 0 .../platform}/cocoa/CCDictionary.cpp | 0 .../platform}/cocoa/CCDictionary.h | 0 {cocos2dx => cocos/platform}/cocoa/CCDouble.h | 0 {cocos2dx => cocos/platform}/cocoa/CCFloat.h | 0 .../platform}/cocoa/CCGeometry.cpp | 0 .../platform}/cocoa/CCGeometry.h | 0 .../platform}/cocoa/CCInteger.h | 0 {cocos2dx => cocos/platform}/cocoa/CCNS.cpp | 0 {cocos2dx => cocos/platform}/cocoa/CCNS.h | 0 .../platform}/cocoa/CCObject.cpp | 0 {cocos2dx => cocos/platform}/cocoa/CCObject.h | 0 {cocos2dx => cocos/platform}/cocoa/CCSet.cpp | 0 {cocos2dx => cocos/platform}/cocoa/CCSet.h | 0 .../platform}/cocoa/CCString.cpp | 0 {cocos2dx => cocos/platform}/cocoa/CCString.h | 0 cocos/scripting/auto-generated | 1 + .../scripting}/javascript/bindings/Android.mk | 0 .../javascript/bindings/ScriptingCore.cpp | 0 .../javascript/bindings/ScriptingCore.h | 0 .../javascript/bindings/XMLHTTPRequest.cpp | 0 .../javascript/bindings/XMLHTTPRequest.h | 0 .../cocos2d_specifics.cpp.REMOVED.git-id | 0 .../javascript/bindings/cocos2d_specifics.hpp | 0 .../bindings/cocosjs_manual_conversions.cpp | 0 .../bindings/cocosjs_manual_conversions.h | 0 .../scripting}/javascript/bindings/js/jsb.js | 0 .../javascript/bindings/js/jsb_chipmunk.js | 0 .../bindings/js/jsb_chipmunk_constants.js | 0 .../javascript/bindings/js/jsb_cocos2d.js | 0 .../bindings/js/jsb_cocos2d_constants.js | 0 .../bindings/js/jsb_cocos2d_extension.js | 0 .../bindings/js/jsb_cocosbuilder.js | 0 .../javascript/bindings/js/jsb_debugger.js | 0 .../javascript/bindings/js/jsb_deprecated.js | 0 .../javascript/bindings/js/jsb_opengl.js | 0 .../bindings/js/jsb_opengl_constants.js | 0 .../javascript/bindings/js/jsb_sys.js | 0 .../bindings/js_bindings_ccbreader.cpp | 0 .../bindings/js_bindings_ccbreader.h | 0 ...s_chipmunk_auto_classes.cpp.REMOVED.git-id | 0 .../js_bindings_chipmunk_auto_classes.h | 0 ...dings_chipmunk_auto_classes_registration.h | 0 ...ings_chipmunk_functions.cpp.REMOVED.git-id | 0 .../bindings/js_bindings_chipmunk_functions.h | 0 ...bindings_chipmunk_functions_registration.h | 0 .../bindings/js_bindings_chipmunk_manual.cpp | 0 .../bindings/js_bindings_chipmunk_manual.h | 0 .../js_bindings_chipmunk_registration.cpp | 0 .../js_bindings_chipmunk_registration.h | 0 .../javascript/bindings/js_bindings_config.h | 0 .../javascript/bindings/js_bindings_core.cpp | 0 .../javascript/bindings/js_bindings_core.h | 0 .../bindings/js_bindings_opengl.cpp | 0 .../javascript/bindings/js_bindings_opengl.h | 0 .../bindings/js_bindings_system_functions.cpp | 0 .../bindings/js_bindings_system_functions.h | 0 ...s_bindings_system_functions_registration.h | 0 .../js_bindings_system_registration.cpp | 0 .../js_bindings_system_registration.h | 0 .../bindings/js_manual_conversions.cpp | 0 .../bindings/js_manual_conversions.h | 0 .../jsb_cocos2dx_extension_manual.cpp | 0 .../bindings/jsb_cocos2dx_extension_manual.h | 0 .../javascript/bindings/jsb_helper.h | 0 .../bindings/jsb_opengl_functions.cpp | 0 .../bindings/jsb_opengl_functions.h | 0 .../javascript/bindings/jsb_opengl_manual.cpp | 0 .../javascript/bindings/jsb_opengl_manual.h | 0 .../bindings/jsb_opengl_registration.cpp | 0 .../bindings/jsb_opengl_registration.h | 0 .../javascript/bindings/jsb_websocket.cpp | 0 .../javascript/bindings/jsb_websocket.h | 0 .../obfuscate/obfuscate_exclude_chipmunk.js | 0 ...bfuscate_exclude_cocos2d.js.REMOVED.git-id | 0 .../bindings/proj.ios/jsbindings-Prefix.pch | 0 .../jsbindings.xcodeproj/project.pbxproj | 0 .../bindings/proj.mac/jsbindings-Prefix.pch | 0 .../jsbindings.xcodeproj/project.pbxproj | 0 .../bindings/proj.win32/libJSBinding.vcxproj | 0 .../proj.win32/libJSBinding.vcxproj.filters | 0 .../proj.win32/libJSBinding.vcxproj.user | 0 .../bindings/spidermonkey_specifics.h | 0 .../lua/cocos2dx_support/CCBProxy.cpp | 0 .../lua/cocos2dx_support/CCBProxy.h | 0 .../lua/cocos2dx_support/CCLuaBridge.cpp | 0 .../lua/cocos2dx_support/CCLuaBridge.h | 0 .../lua/cocos2dx_support/CCLuaEngine.cpp | 0 .../lua/cocos2dx_support/CCLuaEngine.h | 0 .../lua/cocos2dx_support/CCLuaStack.cpp | 0 .../lua/cocos2dx_support/CCLuaStack.h | 0 .../lua/cocos2dx_support/CCLuaValue.cpp | 0 .../lua/cocos2dx_support/CCLuaValue.h | 0 .../cocos2dx_support/Cocos2dxLuaLoader.cpp | 0 .../lua/cocos2dx_support/Cocos2dxLuaLoader.h | 0 .../cocos2dx_support/LuaBasicConversions.cpp | 0 .../cocos2dx_support/LuaBasicConversions.h | 0 .../LuaOpengl.cpp.REMOVED.git-id | 0 .../lua/cocos2dx_support/LuaOpengl.h | 0 .../cocos2dx_support/LuaScriptHandlerMgr.cpp | 0 .../cocos2dx_support/LuaScriptHandlerMgr.h | 0 .../lua/cocos2dx_support/Lua_web_socket.cpp | 0 .../lua/cocos2dx_support/Lua_web_socket.h | 0 ...lua_cocos2dx_deprecated.cpp.REMOVED.git-id | 0 .../lua_cocos2dx_deprecated.h | 0 .../lua_cocos2dx_extension_manual.cpp | 0 .../lua_cocos2dx_extension_manual.h | 0 .../cocos2dx_support/lua_cocos2dx_manual.cpp | 0 .../cocos2dx_support/lua_cocos2dx_manual.hpp | 0 .../platform/android/CCLuaJavaBridge.cpp | 0 .../platform/android/CCLuaJavaBridge.h | 0 ...org_cocos2dx_lib_Cocos2dxLuaJavaBridge.cpp | 0 ...a_org_cocos2dx_lib_Cocos2dxLuaJavaBridge.h | 0 .../platform/ios/CCLuaObjcBridge.h | 0 .../platform/ios/CCLuaObjcBridge.mm | 0 .../lua/cocos2dx_support/tolua_fix.c | 0 .../lua/cocos2dx_support/tolua_fix.h | 0 {scripting => cocos/scripting}/lua/lua/lapi.c | 0 {scripting => cocos/scripting}/lua/lua/lapi.h | 0 .../scripting}/lua/lua/lauxlib.c | 0 .../scripting}/lua/lua/lauxlib.h | 0 .../scripting}/lua/lua/lbaselib.c | 0 .../scripting}/lua/lua/lcode.c | 0 .../scripting}/lua/lua/lcode.h | 0 .../scripting}/lua/lua/ldblib.c | 0 .../scripting}/lua/lua/ldebug.c | 0 .../scripting}/lua/lua/ldebug.h | 0 {scripting => cocos/scripting}/lua/lua/ldo.c | 0 {scripting => cocos/scripting}/lua/lua/ldo.h | 0 .../scripting}/lua/lua/ldump.c | 0 .../scripting}/lua/lua/lfunc.c | 0 .../scripting}/lua/lua/lfunc.h | 0 {scripting => cocos/scripting}/lua/lua/lgc.c | 0 {scripting => cocos/scripting}/lua/lua/lgc.h | 0 .../scripting}/lua/lua/linit.c | 0 .../scripting}/lua/lua/liolib.c | 0 {scripting => cocos/scripting}/lua/lua/llex.c | 0 {scripting => cocos/scripting}/lua/lua/llex.h | 0 .../scripting}/lua/lua/llimits.h | 0 .../scripting}/lua/lua/lmathlib.c | 0 {scripting => cocos/scripting}/lua/lua/lmem.c | 0 {scripting => cocos/scripting}/lua/lua/lmem.h | 0 .../scripting}/lua/lua/loadlib.c | 0 .../scripting}/lua/lua/lobject.c | 0 .../scripting}/lua/lua/lobject.h | 0 .../scripting}/lua/lua/lopcodes.c | 0 .../scripting}/lua/lua/lopcodes.h | 0 .../scripting}/lua/lua/loslib.c | 0 .../scripting}/lua/lua/lparser.c | 0 .../scripting}/lua/lua/lparser.h | 0 .../scripting}/lua/lua/lstate.c | 0 .../scripting}/lua/lua/lstate.h | 0 .../scripting}/lua/lua/lstring.c | 0 .../scripting}/lua/lua/lstring.h | 0 .../scripting}/lua/lua/lstrlib.c | 0 .../scripting}/lua/lua/ltable.c | 0 .../scripting}/lua/lua/ltable.h | 0 .../scripting}/lua/lua/ltablib.c | 0 {scripting => cocos/scripting}/lua/lua/ltm.c | 0 {scripting => cocos/scripting}/lua/lua/ltm.h | 0 {scripting => cocos/scripting}/lua/lua/lua.c | 0 {scripting => cocos/scripting}/lua/lua/lua.h | 0 .../scripting}/lua/lua/luaconf.h | 0 .../scripting}/lua/lua/lualib.h | 0 .../scripting}/lua/lua/lundump.c | 0 .../scripting}/lua/lua/lundump.h | 0 {scripting => cocos/scripting}/lua/lua/lvm.c | 0 {scripting => cocos/scripting}/lua/lua/lvm.h | 0 {scripting => cocos/scripting}/lua/lua/lzio.c | 0 {scripting => cocos/scripting}/lua/lua/lzio.h | 0 .../scripting}/lua/lua/print.c | 0 .../scripting}/lua/luajit/Android.mk | 0 .../lua/luajit/LuaJIT-2.0.1/COPYRIGHT | 0 .../lua/luajit/LuaJIT-2.0.1/Makefile | 0 .../scripting}/lua/luajit/LuaJIT-2.0.1/README | 0 .../LuaJIT-2.0.1/doc/bluequad-print.css | 0 .../lua/luajit/LuaJIT-2.0.1/doc/bluequad.css | 0 .../lua/luajit/LuaJIT-2.0.1/doc/changes.html | 0 .../lua/luajit/LuaJIT-2.0.1/doc/contact.html | 0 .../luajit/LuaJIT-2.0.1/doc/ext_c_api.html | 0 .../lua/luajit/LuaJIT-2.0.1/doc/ext_ffi.html | 0 .../luajit/LuaJIT-2.0.1/doc/ext_ffi_api.html | 0 .../LuaJIT-2.0.1/doc/ext_ffi_semantics.html | 0 .../LuaJIT-2.0.1/doc/ext_ffi_tutorial.html | 0 .../lua/luajit/LuaJIT-2.0.1/doc/ext_jit.html | 0 .../luajit/LuaJIT-2.0.1/doc/extensions.html | 0 .../lua/luajit/LuaJIT-2.0.1/doc/faq.html | 0 .../lua/luajit/LuaJIT-2.0.1/doc/install.html | 0 .../lua/luajit/LuaJIT-2.0.1/doc/luajit.html | 0 .../lua/luajit/LuaJIT-2.0.1/doc/running.html | 0 .../lua/luajit/LuaJIT-2.0.1/doc/status.html | 0 .../lua/luajit/LuaJIT-2.0.1/dynasm/dasm_arm.h | 0 .../luajit/LuaJIT-2.0.1/dynasm/dasm_arm.lua | 0 .../luajit/LuaJIT-2.0.1/dynasm/dasm_mips.h | 0 .../luajit/LuaJIT-2.0.1/dynasm/dasm_mips.lua | 0 .../lua/luajit/LuaJIT-2.0.1/dynasm/dasm_ppc.h | 0 .../luajit/LuaJIT-2.0.1/dynasm/dasm_ppc.lua | 0 .../luajit/LuaJIT-2.0.1/dynasm/dasm_proto.h | 0 .../luajit/LuaJIT-2.0.1/dynasm/dasm_x64.lua | 0 .../lua/luajit/LuaJIT-2.0.1/dynasm/dasm_x86.h | 0 .../luajit/LuaJIT-2.0.1/dynasm/dasm_x86.lua | 0 .../lua/luajit/LuaJIT-2.0.1/dynasm/dynasm.lua | 0 .../lua/luajit/LuaJIT-2.0.1/etc/luajit.1 | 0 .../lua/luajit/LuaJIT-2.0.1/etc/luajit.pc | 0 .../lua/luajit/LuaJIT-2.0.1/src/Makefile | 0 .../lua/luajit/LuaJIT-2.0.1/src/Makefile.dep | 0 .../lua/luajit/LuaJIT-2.0.1/src/host/README | 0 .../luajit/LuaJIT-2.0.1/src/host/buildvm.c | 0 .../luajit/LuaJIT-2.0.1/src/host/buildvm.h | 0 .../LuaJIT-2.0.1/src/host/buildvm_asm.c | 0 .../LuaJIT-2.0.1/src/host/buildvm_fold.c | 0 .../LuaJIT-2.0.1/src/host/buildvm_lib.c | 0 .../LuaJIT-2.0.1/src/host/buildvm_peobj.c | 0 .../LuaJIT-2.0.1/src/host/genminilua.lua | 0 .../src/host/minilua.c.REMOVED.git-id | 0 .../lua/luajit/LuaJIT-2.0.1/src/jit/bc.lua | 0 .../luajit/LuaJIT-2.0.1/src/jit/bcsave.lua | 0 .../luajit/LuaJIT-2.0.1/src/jit/dis_arm.lua | 0 .../luajit/LuaJIT-2.0.1/src/jit/dis_mips.lua | 0 .../LuaJIT-2.0.1/src/jit/dis_mipsel.lua | 0 .../luajit/LuaJIT-2.0.1/src/jit/dis_ppc.lua | 0 .../luajit/LuaJIT-2.0.1/src/jit/dis_x64.lua | 0 .../luajit/LuaJIT-2.0.1/src/jit/dis_x86.lua | 0 .../lua/luajit/LuaJIT-2.0.1/src/jit/dump.lua | 0 .../lua/luajit/LuaJIT-2.0.1/src/jit/v.lua | 0 .../lua/luajit/LuaJIT-2.0.1/src/lauxlib.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lib_aux.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lib_base.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lib_bit.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lib_debug.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lib_ffi.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lib_init.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lib_io.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lib_jit.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lib_math.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lib_os.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lib_package.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lib_string.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lib_table.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj.supp | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_alloc.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_alloc.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_api.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_arch.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_asm.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_asm.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_asm_arm.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_asm_mips.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_asm_ppc.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_asm_x86.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_bc.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_bc.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_bcdump.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_bcread.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_bcwrite.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_carith.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_carith.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_ccall.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_ccall.h | 0 .../luajit/LuaJIT-2.0.1/src/lj_ccallback.c | 0 .../luajit/LuaJIT-2.0.1/src/lj_ccallback.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_cconv.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_cconv.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_cdata.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_cdata.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_char.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_char.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_clib.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_clib.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_cparse.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_cparse.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_crecord.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_crecord.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_ctype.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_ctype.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_debug.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_debug.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_def.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_dispatch.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_dispatch.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_emit_arm.h | 0 .../luajit/LuaJIT-2.0.1/src/lj_emit_mips.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_emit_ppc.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_emit_x86.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_err.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_err.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_errmsg.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_ff.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_ffrecord.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_ffrecord.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_frame.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_func.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_func.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_gc.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_gc.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_gdbjit.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_gdbjit.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_ir.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_ir.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_ircall.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_iropt.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_jit.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_lex.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_lex.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_lib.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_lib.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_load.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_mcode.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_mcode.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_meta.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_meta.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_obj.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_obj.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_opt_dce.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_opt_fold.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_opt_loop.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_opt_mem.c | 0 .../luajit/LuaJIT-2.0.1/src/lj_opt_narrow.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_opt_sink.c | 0 .../luajit/LuaJIT-2.0.1/src/lj_opt_split.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_parse.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_parse.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_record.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_record.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_snap.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_snap.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_state.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_state.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_str.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_str.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_strscan.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_strscan.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_tab.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_tab.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_target.h | 0 .../luajit/LuaJIT-2.0.1/src/lj_target_arm.h | 0 .../luajit/LuaJIT-2.0.1/src/lj_target_mips.h | 0 .../luajit/LuaJIT-2.0.1/src/lj_target_ppc.h | 0 .../luajit/LuaJIT-2.0.1/src/lj_target_x86.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_trace.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_trace.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_traceerr.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_udata.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_udata.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_vm.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_vmevent.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_vmevent.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_vmmath.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/ljamalg.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lua.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lua.hpp | 0 .../lua/luajit/LuaJIT-2.0.1/src/luaconf.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/luajit.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/luajit.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lualib.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/msvcbuild.bat | 0 .../src/vm_arm.dasc.REMOVED.git-id | 0 .../src/vm_mips.dasc.REMOVED.git-id | 0 .../src/vm_ppc.dasc.REMOVED.git-id | 0 .../src/vm_ppcspe.dasc.REMOVED.git-id | 0 .../src/vm_x86.dasc.REMOVED.git-id | 0 .../lua/luajit/LuaJIT-2.0.1/src/xedkbuild.bat | 0 .../luajit/LuaJIT-2.0.1/v2.0.1_hotfix1.patch | 0 .../armeabi-v7a/libluajit.a.REMOVED.git-id | 0 .../armeabi/libluajit.a.REMOVED.git-id | 0 .../android/x86/libluajit.a.REMOVED.git-id | 0 .../scripting}/lua/luajit/build_android.sh | 0 .../scripting}/lua/luajit/build_ios.sh | 0 .../scripting}/lua/luajit/build_mac.sh | 0 .../scripting}/lua/luajit/include/lauxlib.h | 0 .../scripting}/lua/luajit/include/lua.h | 0 .../scripting}/lua/luajit/include/luaconf.h | 0 .../scripting}/lua/luajit/include/lualib.h | 0 .../lua/luajit/ios/libluajit.a.REMOVED.git-id | 0 .../lua/luajit/mac/libluajit.a.REMOVED.git-id | 0 .../lua/luajit/win32/lua51.dll.REMOVED.git-id | 0 .../scripting}/lua/proj.android/Android.mk | 0 .../lua/proj.ios/luabindings-Prefix.pch | 0 .../luabindings.xcodeproj/project.pbxproj | 0 .../scripting}/lua/proj.linux/.cproject | 0 .../scripting}/lua/proj.linux/.project | 0 .../scripting}/lua/proj.linux/Makefile | 0 .../scripting}/lua/proj.win32/liblua.vcxproj | 0 .../lua/proj.win32/liblua.vcxproj.filters | 0 .../lua/proj.win32/liblua.vcxproj.user | 0 .../scripting}/lua/script/AudioEngine.lua | 0 .../scripting}/lua/script/CCBReaderLoad.lua | 0 .../scripting}/lua/script/Cocos2d.lua | 0 .../lua/script/Cocos2dConstants.lua | 0 .../scripting}/lua/script/Deprecated.lua | 0 .../scripting}/lua/script/DeprecatedClass.lua | 0 .../scripting}/lua/script/DeprecatedEnum.lua | 0 .../lua/script/DeprecatedOpenglEnum.lua | 0 .../scripting}/lua/script/DrawPrimitives.lua | 0 .../scripting}/lua/script/Opengl.lua | 0 .../scripting}/lua/script/OpenglConstants.lua | 0 .../scripting}/lua/script/luaj.lua | 0 .../scripting}/lua/tolua/tolua++.h | 0 .../scripting}/lua/tolua/tolua_event.c | 0 .../scripting}/lua/tolua/tolua_event.h | 0 .../scripting}/lua/tolua/tolua_is.c | 0 .../scripting}/lua/tolua/tolua_map.c | 0 .../scripting}/lua/tolua/tolua_push.c | 0 .../scripting}/lua/tolua/tolua_to.c | 0 .../storage/local-storage}/LocalStorage.cpp | 0 .../storage/local-storage}/LocalStorage.h | 0 .../local-storage}/LocalStorageAndroid.cpp | 0 .../project.pbxproj.REMOVED.git-id | 1 - cocos2dx-qt5.pro | 19 - cocos2dx/label_nodes/CCFontCache.cpp | 101 - cocos2dx/label_nodes/CCFontCache.h | 54 - .../platform/emscripten/CCApplication.cpp | 113 - cocos2dx/platform/emscripten/CCApplication.h | 78 - cocos2dx/platform/emscripten/CCCommon.cpp | 68 - cocos2dx/platform/emscripten/CCDevice.cpp | 20 - cocos2dx/platform/emscripten/CCEGLView.cpp | 389 --- cocos2dx/platform/emscripten/CCEGLView.h | 93 - .../emscripten/CCFileUtilsEmscripten.cpp | 73 - .../emscripten/CCFileUtilsEmscripten.h | 60 - cocos2dx/platform/emscripten/CCGL.h | 49 - cocos2dx/platform/emscripten/CCImage.cpp | 359 -- cocos2dx/platform/emscripten/CCStdC.h | 48 - .../emscripten/CCTextureCacheEmscripten.cpp | 194 -- .../emscripten/CCTextureCacheEmscripten.h | 55 - .../emscripten/CCTextureCacheEmscripten.js | 302 -- cocos2dx/platform/ios/CCPlatformDefine.h | 24 - cocos2dx/platform/nacl/CCApplication.cpp | 116 - cocos2dx/platform/nacl/CCApplication.h | 85 - cocos2dx/platform/nacl/CCCommon.cpp | 83 - cocos2dx/platform/nacl/CCDevice.cpp | 35 - cocos2dx/platform/nacl/CCEGLView.cpp | 340 -- cocos2dx/platform/nacl/CCEGLView.h | 100 - cocos2dx/platform/nacl/CCFileUtilsNaCl.cpp | 71 - cocos2dx/platform/nacl/CCFileUtilsNaCl.h | 57 - cocos2dx/platform/nacl/CCGL.h | 36 - cocos2dx/platform/nacl/CCImage.cpp | 528 --- cocos2dx/platform/nacl/CCInstance.cpp | 105 - cocos2dx/platform/nacl/CCInstance.h | 57 - cocos2dx/platform/nacl/CCModule.h | 55 - cocos2dx/platform/nacl/CCPlatformDefine.h | 50 - cocos2dx/platform/nacl/CCStdC.h | 54 - cocos2dx/platform/nacl/memory.h | 24 - .../platform/qt5/AccelerometerListener.cpp | 42 - cocos2dx/platform/qt5/AccelerometerListener.h | 50 - cocos2dx/platform/qt5/CCAccelerometer.cpp | 100 - cocos2dx/platform/qt5/CCAccelerometer.h | 69 - cocos2dx/platform/qt5/CCApplication.cpp | 204 -- cocos2dx/platform/qt5/CCApplication.h | 101 - cocos2dx/platform/qt5/CCCommon.cpp | 87 - cocos2dx/platform/qt5/CCDevice.cpp | 53 - cocos2dx/platform/qt5/CCEGLView.cpp | 202 -- cocos2dx/platform/qt5/CCEGLView.h | 70 - cocos2dx/platform/qt5/CCFileUtilsQt5.cpp | 113 - cocos2dx/platform/qt5/CCGL.h | 16 - cocos2dx/platform/qt5/CCPlatformDefine.h | 47 - cocos2dx/platform/qt5/CCStdC.h | 58 - cocos2dx/platform/third_party/doc/build.txt | 23 - cocos2dx/platform/third_party/doc/version.txt | 9 - .../third_party/emscripten/libjpeg/jerror.h | 304 -- .../emscripten/libpng/png.h.REMOVED.git-id | 1 - .../third_party/emscripten/libpng/pngconf.h | 1552 --------- .../third_party/emscripten/libraries/README | 7 - .../third_party/emscripten/libraries/build.sh | 69 - .../libraries/libjpeg.a.REMOVED.git-id | 1 - .../libraries/libpng.a.REMOVED.git-id | 1 - .../libraries/libtiff.a.REMOVED.git-id | 1 - .../libraries/libtiffxx.a.REMOVED.git-id | 1 - .../libraries/libwebp.a.REMOVED.git-id | 1 - .../libraries/libxml2.a.REMOVED.git-id | 1 - .../libraries/libz.a.REMOVED.git-id | 1 - .../emscripten/libtiff/include/tiffconf.h | 128 - .../emscripten/libtiff/include/tiffio.hxx | 49 - .../emscripten/libwebp/webp/decode.h | 482 --- .../emscripten/libwebp/webp/encode.h | 480 --- .../emscripten/libxml2/libxml/DOCBparser.h | 96 - .../emscripten/libxml2/libxml/HTMLparser.h | 306 -- .../emscripten/libxml2/libxml/HTMLtree.h | 147 - .../emscripten/libxml2/libxml/SAX.h | 173 - .../emscripten/libxml2/libxml/SAX2.h | 176 - .../emscripten/libxml2/libxml/c14n.h | 126 - .../emscripten/libxml2/libxml/catalog.h | 182 - .../emscripten/libxml2/libxml/chvalid.h | 230 -- .../emscripten/libxml2/libxml/debugXML.h | 217 -- .../emscripten/libxml2/libxml/dict.h | 80 - .../emscripten/libxml2/libxml/encoding.h | 240 -- .../emscripten/libxml2/libxml/entities.h | 151 - .../emscripten/libxml2/libxml/globals.h | 502 --- .../emscripten/libxml2/libxml/hash.h | 233 -- .../emscripten/libxml2/libxml/list.h | 137 - .../emscripten/libxml2/libxml/nanoftp.h | 163 - .../emscripten/libxml2/libxml/nanohttp.h | 81 - .../emscripten/libxml2/libxml/parser.h | 1241 ------- .../libxml2/libxml/parserInternals.h | 644 ---- .../emscripten/libxml2/libxml/pattern.h | 100 - .../emscripten/libxml2/libxml/relaxng.h | 213 -- .../libxml2/libxml/schemasInternals.h | 958 ------ .../emscripten/libxml2/libxml/schematron.h | 142 - .../emscripten/libxml2/libxml/threads.h | 84 - .../emscripten/libxml2/libxml/tree.h | 1303 -------- .../emscripten/libxml2/libxml/uri.h | 94 - .../emscripten/libxml2/libxml/valid.h | 458 --- .../emscripten/libxml2/libxml/xinclude.h | 129 - .../emscripten/libxml2/libxml/xlink.h | 189 -- .../emscripten/libxml2/libxml/xmlIO.h | 366 -- .../emscripten/libxml2/libxml/xmlautomata.h | 146 - .../emscripten/libxml2/libxml/xmlerror.h | 945 ------ .../emscripten/libxml2/libxml/xmlexports.h | 162 - .../emscripten/libxml2/libxml/xmlmemory.h | 224 -- .../emscripten/libxml2/libxml/xmlmodule.h | 57 - .../emscripten/libxml2/libxml/xmlreader.h | 428 --- .../emscripten/libxml2/libxml/xmlregexp.h | 222 -- .../emscripten/libxml2/libxml/xmlsave.h | 88 - .../emscripten/libxml2/libxml/xmlschemas.h | 246 -- .../libxml2/libxml/xmlschemastypes.h | 151 - .../emscripten/libxml2/libxml/xmlstring.h | 140 - .../emscripten/libxml2/libxml/xmlunicode.h | 202 -- .../emscripten/libxml2/libxml/xmlversion.h | 489 --- .../emscripten/libxml2/libxml/xmlwriter.h | 488 --- .../emscripten/libxml2/libxml/xpath.h | 557 ---- .../libxml2/libxml/xpathInternals.h | 632 ---- .../emscripten/libxml2/libxml/xpointer.h | 114 - .../third_party/emscripten/libz/zconf.h | 511 --- .../third_party/emscripten/libz/zlib.h | 1768 ---------- .../third_party/linux/libjpeg/jconfig.h | 54 - .../tizen/prebuilt/libwebp/include/decode.h | 482 --- .../tizen/prebuilt/libwebp/include/encode.h | 480 --- .../tizen/prebuilt/libwebp/include/types.h | 45 - .../libs/armv7l/libwebp.a.REMOVED.git-id | 1 - .../libwebp/libs/x86/libwebp.a.REMOVED.git-id | 1 - .../lib/libexpat.so.1.5.2 | 0 .../lib/libexpat.so.REMOVED.git-id | 1 - .../tizen-device-2.2.native/lib/libz.so.1.2.5 | 0 .../lib/libz.so.REMOVED.git-id | 1 - .../usr/include/curl/curl.h | 2232 ------------- .../usr/include/curl/curlbuild.h | 191 -- .../usr/include/curl/curlver.h | 69 - .../usr/include/curl/multi.h | 372 --- .../usr/include/fontconfig/fcfreetype.h | 59 - .../usr/include/fontconfig/fcprivate.h | 123 - .../usr/include/fontconfig/fontconfig.h | 974 ------ .../freetype2/freetype/config/ftconfig-32.h | 545 --- .../freetype2/freetype/config/ftconfig.h | 14 - .../freetype2/freetype/config/ftheader.h | 793 ----- .../freetype2/freetype/config/ftmodule.h | 20 - .../freetype2/freetype/config/ftoption.h | 805 ----- .../freetype2/freetype/config/ftstdlib.h | 174 - .../freetype/freetype.h.REMOVED.git-id | 1 - .../usr/include/freetype2/freetype/ftadvanc.h | 179 - .../usr/include/freetype2/freetype/ftbitmap.h | 227 -- .../usr/include/freetype2/freetype/ftcache.h | 1140 ------- .../include/freetype2/freetype/ftchapters.h | 104 - .../usr/include/freetype2/freetype/fterrdef.h | 245 -- .../usr/include/freetype2/freetype/fterrors.h | 207 -- .../usr/include/freetype2/freetype/ftglyph.h | 620 ---- .../usr/include/freetype2/freetype/ftimage.h | 1313 -------- .../usr/include/freetype2/freetype/ftlcdfil.h | 213 -- .../usr/include/freetype2/freetype/ftmodapi.h | 483 --- .../usr/include/freetype2/freetype/ftmoderr.h | 156 - .../usr/include/freetype2/freetype/ftoutln.h | 540 --- .../usr/include/freetype2/freetype/ftstroke.h | 741 ----- .../usr/include/freetype2/freetype/ftsynth.h | 80 - .../usr/include/freetype2/freetype/fttrigon.h | 350 -- .../usr/include/freetype2/freetype/fttypes.h | 588 ---- .../usr/include/freetype2/freetype/ttnameid.h | 1247 ------- .../usr/include/freetype2/freetype/tttables.h | 763 ----- .../usr/include/freetype2/freetype/tttags.h | 107 - .../usr/include/ft2build.h | 61 - .../usr/include/jconfig.h | 58 - .../usr/include/jerror.h | 314 -- .../usr/include/jmorecfg.h | 404 --- .../usr/include/jpeglib.h | 1215 ------- .../usr/include/png.h.REMOVED.git-id | 1 - .../usr/include/pngconf.h | 1665 ---------- .../usr/include/sqlite3.h.REMOVED.git-id | 1 - .../usr/include/sqlite3ext.h | 447 --- .../usr/include/tiff.h | 678 ---- .../usr/include/tiffconf.h | 128 - .../usr/include/tiffio.h | 557 ---- .../usr/include/tiffio.hxx | 49 - .../usr/include/tiffvers.h | 9 - .../usr/include/zconf.h | 428 --- .../usr/include/zlib.h | 1613 --------- .../usr/lib/libcares.so.2.0.0 | 0 .../usr/lib/libcrypto.so.1.0.0 | 0 .../usr/lib/libcrypto.so.REMOVED.git-id | 1 - .../usr/lib/libcurl.so.4.3.0 | 0 .../usr/lib/libcurl.so.REMOVED.git-id | 1 - .../usr/lib/libfontconfig.so.1.5.0 | 0 .../usr/lib/libfontconfig.so.REMOVED.git-id | 1 - .../usr/lib/libfreetype.so.6.8.1 | 0 .../usr/lib/libfreetype.so.REMOVED.git-id | 1 - .../usr/lib/libidn.so.11.5.44 | 0 .../usr/lib/libidn.so.REMOVED.git-id | 1 - .../usr/lib/libjpeg.so.8.0.2 | 0 .../usr/lib/libjpeg.so.REMOVED.git-id | 1 - .../usr/lib/libpng.so.3.50.0 | 0 .../usr/lib/libpng.so.REMOVED.git-id | 1 - .../usr/lib/libsqlite3.so.0.8.6 | 0 .../usr/lib/libsqlite3.so.REMOVED.git-id | 1 - .../usr/lib/libssl.so.1.0.0 | 0 .../usr/lib/libssl.so.REMOVED.git-id | 1 - .../usr/lib/libtiff.so.5.1.0 | 0 .../usr/lib/libtiff.so.REMOVED.git-id | 1 - .../lib/libexpat.so.1.5.2 | 0 .../lib/libexpat.so.REMOVED.git-id | 1 - .../lib/libz.so.1.2.5 | 0 .../lib/libz.so.REMOVED.git-id | 1 - .../usr/include/curl/curl.h | 2125 ------------ .../usr/include/curl/curlbuild.h | 191 -- .../usr/include/curl/curlrules.h | 252 -- .../usr/include/curl/curlver.h | 69 - .../usr/include/curl/easy.h | 102 - .../usr/include/curl/mprintf.h | 81 - .../usr/include/curl/stdcheaders.h | 33 - .../usr/include/curl/typecheck-gcc.h | 584 ---- .../usr/include/curl/types.h | 1 - .../usr/include/fontconfig/fcfreetype.h | 59 - .../usr/include/fontconfig/fcprivate.h | 123 - .../usr/include/fontconfig/fontconfig.h | 974 ------ .../freetype2/freetype/config/ftconfig-32.h | 545 --- .../freetype2/freetype/config/ftconfig.h | 14 - .../freetype2/freetype/config/ftheader.h | 793 ----- .../freetype2/freetype/config/ftmodule.h | 20 - .../freetype2/freetype/config/ftoption.h | 805 ----- .../freetype2/freetype/config/ftstdlib.h | 174 - .../freetype/freetype.h.REMOVED.git-id | 1 - .../usr/include/freetype2/freetype/ftadvanc.h | 179 - .../usr/include/freetype2/freetype/ftbbox.h | 102 - .../usr/include/freetype2/freetype/ftbdf.h | 209 -- .../usr/include/freetype2/freetype/ftbitmap.h | 227 -- .../usr/include/freetype2/freetype/ftbzip2.h | 102 - .../usr/include/freetype2/freetype/ftcache.h | 1140 ------- .../include/freetype2/freetype/ftchapters.h | 104 - .../usr/include/freetype2/freetype/ftcid.h | 166 - .../usr/include/freetype2/freetype/fterrdef.h | 245 -- .../usr/include/freetype2/freetype/fterrors.h | 207 -- .../usr/include/freetype2/freetype/ftgasp.h | 128 - .../usr/include/freetype2/freetype/ftglyph.h | 620 ---- .../usr/include/freetype2/freetype/ftgxval.h | 358 -- .../usr/include/freetype2/freetype/ftgzip.h | 102 - .../usr/include/freetype2/freetype/ftimage.h | 1313 -------- .../usr/include/freetype2/freetype/ftincrem.h | 353 -- .../usr/include/freetype2/freetype/ftlcdfil.h | 213 -- .../usr/include/freetype2/freetype/ftlist.h | 277 -- .../usr/include/freetype2/freetype/ftlzw.h | 99 - .../usr/include/freetype2/freetype/ftmac.h | 274 -- .../usr/include/freetype2/freetype/ftmm.h | 378 --- .../usr/include/freetype2/freetype/ftmodapi.h | 483 --- .../usr/include/freetype2/freetype/ftmoderr.h | 156 - .../usr/include/freetype2/freetype/ftotval.h | 203 -- .../usr/include/freetype2/freetype/ftoutln.h | 540 --- .../usr/include/freetype2/freetype/ftpfr.h | 172 - .../usr/include/freetype2/freetype/ftrender.h | 238 -- .../usr/include/freetype2/freetype/ftsizes.h | 159 - .../usr/include/freetype2/freetype/ftsnames.h | 200 -- .../usr/include/freetype2/freetype/ftstroke.h | 741 ----- .../usr/include/freetype2/freetype/ftsynth.h | 80 - .../usr/include/freetype2/freetype/ftsystem.h | 347 -- .../usr/include/freetype2/freetype/fttrigon.h | 350 -- .../usr/include/freetype2/freetype/fttypes.h | 588 ---- .../usr/include/freetype2/freetype/ftwinfnt.h | 274 -- .../usr/include/freetype2/freetype/ftxf86.h | 83 - .../usr/include/freetype2/freetype/t1tables.h | 662 ---- .../usr/include/freetype2/freetype/ttnameid.h | 1247 ------- .../usr/include/freetype2/freetype/tttables.h | 763 ----- .../usr/include/freetype2/freetype/tttags.h | 107 - .../usr/include/freetype2/freetype/ttunpat.h | 59 - .../usr/include/ft2build.h | 61 - .../usr/include/jconfig.h | 123 - .../usr/include/jerror.h | 304 -- .../usr/include/jmorecfg.h | 371 --- .../usr/include/jpeglib.h | 1162 ------- .../usr/include/png.h.REMOVED.git-id | 1 - .../usr/include/pngconf.h | 1665 ---------- .../usr/include/sqlite3.h.REMOVED.git-id | 1 - .../usr/include/sqlite3ext.h | 447 --- .../usr/include/tiff.h | 678 ---- .../usr/include/tiffconf.h | 128 - .../usr/include/tiffio.h | 557 ---- .../usr/include/tiffio.hxx | 49 - .../usr/include/tiffvers.h | 9 - .../usr/include/zconf.h | 428 --- .../usr/include/zlib.h | 1613 --------- .../usr/lib/libcares.so.2.0.0 | 0 .../usr/lib/libcrypto.so.1.0.0 | 0 .../usr/lib/libcrypto.so.REMOVED.git-id | 1 - .../usr/lib/libcurl.so.4.3.0 | 0 .../usr/lib/libcurl.so.REMOVED.git-id | 1 - .../usr/lib/libfontconfig.so.1.5.0 | 0 .../usr/lib/libfontconfig.so.REMOVED.git-id | 1 - .../usr/lib/libfreetype.so.6.8.1 | 0 .../usr/lib/libfreetype.so.REMOVED.git-id | 1 - .../usr/lib/libidn.so.11.5.44 | 0 .../usr/lib/libidn.so.REMOVED.git-id | 1 - .../usr/lib/libjpeg.so.8.0.2 | 0 .../usr/lib/libjpeg.so.REMOVED.git-id | 1 - .../usr/lib/libpng.so.3.50.0 | 0 .../usr/lib/libpng.so.REMOVED.git-id | 1 - .../usr/lib/libsqlite3.so.0.8.6 | 0 .../usr/lib/libsqlite3.so.REMOVED.git-id | 1 - .../usr/lib/libssl.so.1.0.0 | 0 .../usr/lib/libssl.so.REMOVED.git-id | 1 - .../usr/lib/libtiff.so.5.1.0 | 0 .../usr/lib/libtiff.so.REMOVED.git-id | 1 - .../third_party/win32/curl/curlrules.h | 261 -- .../platform/third_party/win32/curl/easy.h | 102 - .../platform/third_party/win32/curl/mprintf.h | 81 - .../platform/third_party/win32/curl/multi.h | 345 -- .../third_party/win32/curl/stdcheaders.h | 33 - .../third_party/win32/curl/typecheck-gcc.h | 604 ---- .../win32/libfreetype2/freetype/ftbbox.h | 102 - .../win32/libfreetype2/freetype/ftbdf.h | 209 -- .../win32/libfreetype2/freetype/ftbzip2.h | 102 - .../win32/libfreetype2/freetype/ftcid.h | 166 - .../win32/libfreetype2/freetype/ftgasp.h | 128 - .../win32/libfreetype2/freetype/ftgxval.h | 358 -- .../win32/libfreetype2/freetype/ftgzip.h | 102 - .../win32/libfreetype2/freetype/ftincrem.h | 353 -- .../win32/libfreetype2/freetype/ftlist.h | 277 -- .../win32/libfreetype2/freetype/ftlzw.h | 99 - .../win32/libfreetype2/freetype/ftmac.h | 274 -- .../win32/libfreetype2/freetype/ftmm.h | 378 --- .../win32/libfreetype2/freetype/ftotval.h | 203 -- .../win32/libfreetype2/freetype/ftpfr.h | 172 - .../win32/libfreetype2/freetype/ftrender.h | 238 -- .../win32/libfreetype2/freetype/ftsizes.h | 159 - .../win32/libfreetype2/freetype/ftsnames.h | 200 -- .../win32/libfreetype2/freetype/ftsystem.h | 347 -- .../win32/libfreetype2/freetype/ftwinfnt.h | 274 -- .../win32/libfreetype2/freetype/ftxf86.h | 83 - .../win32/libfreetype2/freetype/t1tables.h | 662 ---- .../win32/libfreetype2/freetype/ttunpat.h | 59 - .../third_party/win32/libjpeg/jmorecfg.h | 390 --- .../third_party/win32/libjpeg/jpeglib.h | 1173 ------- .../platform/third_party/win32/libtiff/tiff.h | 678 ---- .../third_party/win32/libtiff/tiffio.h | 557 ---- .../third_party/win32/libtiff/tiffvers.h | 9 - .../third_party/win32/libwebp/types.h | 45 - .../win32/third_party_versions.txt | 7 - cocos2dx/platform/tizen/CCAccelerometer.cpp | 116 - cocos2dx/platform/tizen/CCAccelerometer.h | 64 - cocos2dx/platform/tizen/CCApplication.cpp | 164 - cocos2dx/platform/tizen/CCApplication.h | 90 - cocos2dx/platform/tizen/CCCommon.cpp | 85 - cocos2dx/platform/tizen/CCDevice.cpp | 53 - cocos2dx/platform/tizen/CCEGLView.cpp | 250 -- cocos2dx/platform/tizen/CCEGLView.h | 85 - cocos2dx/platform/tizen/CCFileUtilsTizen.cpp | 116 - cocos2dx/platform/tizen/CCFileUtilsTizen.h | 61 - cocos2dx/platform/tizen/CCGL.h | 36 - cocos2dx/platform/tizen/CCImage.cpp | 465 --- cocos2dx/platform/tizen/CCOspApplication.cpp | 182 - cocos2dx/platform/tizen/CCOspApplication.h | 79 - cocos2dx/platform/tizen/CCOspForm.cpp | 230 -- cocos2dx/platform/tizen/CCOspForm.h | 73 - cocos2dx/platform/tizen/CCPlatformDefine.h | 48 - cocos2dx/platform/tizen/CCStdC.h | 49 - cocos2dx/proj.emscripten/Makefile | 180 - cocos2dx/proj.emscripten/cocos2dx.mk | 115 - cocos2dx/proj.nacl/Makefile | 160 - cocos2dx/proj.nacl/cocos2dx.mk | 139 - cocos2dx/proj.qt5/cocos2dx.pro | 170 - cocos2dx/proj.qt5/common.pri | 61 - cocos2dx/proj.tizen/.cproject | 392 --- cocos2dx/proj.tizen/.project | 1916 ----------- cocos2dx/proj.tizen/src/placeholder.txt | 0 cocos2dx/support/user_default/Archive.zip | Bin 5975 -> 0 bytes create-multi-platform-projects.py | 10 - {document => docs}/Groups.h | 0 {document => docs}/MainPage.h | 0 {document => docs}/doxygen.config | 0 document/.gitignore | 3 - extensions/proj.emscripten/Makefile | 140 - extensions/proj.ios/extensions-Prefix.pch | 7 - .../extensions.xcodeproj/project.pbxproj | 1123 ------- extensions/proj.mac/extensions-Prefix.pch | 7 - .../extensions.xcodeproj/project.pbxproj | 1146 ------- extensions/proj.nacl/Makefile | 130 - extensions/proj.qt5/extensions.pro | 116 - extensions/proj.tizen/.cproject | 385 --- extensions/proj.tizen/.project | 156 - extensions/proj.tizen/src/placeholder.txt | 0 external/Box2D/proj.emscripten/Makefile | 72 - external/Box2D/proj.ios/Box2D-Prefix.pch | 7 - .../proj.ios/Box2D.xcodeproj/project.pbxproj | 567 ---- external/Box2D/proj.mac/Box2D-Prefix.pch | 7 - .../proj.mac/Box2D.xcodeproj/project.pbxproj | 566 ---- external/Box2D/proj.nacl/Makefile | 78 - external/Box2D/proj.qt5/box2d.pro | 18 - external/Box2D/proj.tizen/.cproject | 326 -- external/Box2D/proj.tizen/.project | 116 - external/Box2D/proj.tizen/src/.gitkeep | 0 .../common => external}/atitc/atitc.cpp | 0 .../common => external}/atitc/atitc.h | 0 external/chipmunk/proj.emscripten/Makefile | 55 - .../chipmunk/proj.ios/chipmunk-Prefix.pch | 7 - .../chipmunk.xcodeproj/project.pbxproj | 445 --- .../chipmunk/proj.mac/chipmunk-Prefix.pch | 7 - .../chipmunk.xcodeproj/project.pbxproj | 434 --- external/chipmunk/proj.nacl/Makefile | 58 - external/chipmunk/proj.qt5/chipmunk.pro | 15 - external/chipmunk/proj.tizen/.cproject | 326 -- external/chipmunk/proj.tizen/.project | 196 -- .../chipmunk/proj.tizen/src/placeholder.txt | 0 .../curl/include/andorid}/curl.h | 0 .../curl/include/andorid}/curlbuild.h | 0 .../curl/include/andorid}/curlrules.h | 0 .../curl/include/andorid}/curlver.h | 0 .../curl/include/andorid}/easy.h | 0 .../curl/include/andorid}/mprintf.h | 0 .../curl/include/andorid}/multi.h | 0 .../curl/include/andorid}/stdcheaders.h | 0 .../curl/include/andorid}/typecheck-gcc.h | 0 .../curl/include/andorid}/types.h | 0 .../curl => external/curl/include/ios}/curl.h | 0 .../curl/include/ios}/curlbuild.h | 0 .../curl/include/ios}/curlrules.h | 0 .../curl/include/ios}/curlver.h | 0 .../curl => external/curl/include/ios}/easy.h | 0 .../curl/include/ios}/mprintf.h | 0 .../curl/include/ios}/multi.h | 0 .../curl/include/ios}/stdcheaders.h | 0 .../curl/include/ios}/typecheck-gcc.h | 0 .../curl/include/linux/32-bit}/curl.h | 0 .../curl/include/linux/32-bit}/curlbuild.h | 0 .../curl/include/linux/32-bit}/curlrules.h | 0 .../curl/include/linux/32-bit}/curlver.h | 0 .../curl/include/linux/32-bit}/easy.h | 0 .../curl/include/linux/32-bit}/mprintf.h | 0 .../curl/include/linux/32-bit}/multi.h | 0 .../curl/include/linux/32-bit}/stdcheaders.h | 0 .../include/linux/32-bit}/typecheck-gcc.h | 0 .../curl/include/linux/64-bit}/curl.h | 0 .../curl/include/linux/64-bit}/curlbuild.h | 0 .../curl/include/linux/64-bit}/curlrules.h | 0 .../curl/include/linux/64-bit}/curlver.h | 0 .../curl/include/linux/64-bit}/easy.h | 0 .../curl/include/linux/64-bit}/mprintf.h | 0 .../curl/include/linux/64-bit}/multi.h | 0 .../curl/include/linux/64-bit}/stdcheaders.h | 0 .../curl/include/win32}/curl.h | 0 .../curl/include/win32}/curlbuild.h | 0 .../curl/include/win32}/curlrules.h | 0 .../curl/include/win32}/curlver.h | 0 .../curl/include/win32}/easy.h | 0 .../curl/include/win32}/mprintf.h | 0 .../curl/include/win32}/multi.h | 0 .../curl/include/win32}/stdcheaders.h | 0 .../curl/include/win32}/typecheck-gcc.h | 0 .../curl/prebuilt/andorid}/Android.mk | 0 .../armeabi-v7a/libcurl.a.REMOVED.git-id | 0 .../andorid}/armeabi/libcurl.a.REMOVED.git-id | 0 .../andorid}/x86/libcurl.a.REMOVED.git-id | 0 .../prebuilt/ios}/libcurl.a.REMOVED.git-id | 0 .../linux/32-bit}/libcurl.a.REMOVED.git-id | 0 .../linux/64-bit}/libcurl.a.REMOVED.git-id | 0 .../win32}/libcurl.dll.REMOVED.git-id | 0 external/emscripten | 1 - .../common/etc => external/etc1}/etc1.cpp | 0 .../common/etc => external/etc1}/etc1.h | 0 .../freetype2/freetype/config/ftconfig.h | 0 .../freetype2/freetype/config/ftheader.h | 0 .../freetype2/freetype/config/ftmodule.h | 0 .../freetype2/freetype/config/ftoption.h | 0 .../freetype2/freetype/config/ftstdlib.h | 0 .../freetype/freetype.h.REMOVED.git-id | 0 .../andorid}/freetype2/freetype/ftadvanc.h | 0 .../andorid}/freetype2/freetype/ftautoh.h | 0 .../andorid}/freetype2/freetype/ftbbox.h | 0 .../andorid}/freetype2/freetype/ftbdf.h | 0 .../andorid}/freetype2/freetype/ftbitmap.h | 0 .../andorid}/freetype2/freetype/ftbzip2.h | 0 .../andorid}/freetype2/freetype/ftcache.h | 0 .../andorid}/freetype2/freetype/ftcffdrv.h | 0 .../andorid}/freetype2/freetype/ftchapters.h | 0 .../andorid}/freetype2/freetype/ftcid.h | 0 .../andorid}/freetype2/freetype/fterrdef.h | 0 .../andorid}/freetype2/freetype/fterrors.h | 0 .../andorid}/freetype2/freetype/ftgasp.h | 0 .../andorid}/freetype2/freetype/ftglyph.h | 0 .../andorid}/freetype2/freetype/ftgxval.h | 0 .../andorid}/freetype2/freetype/ftgzip.h | 0 .../andorid}/freetype2/freetype/ftimage.h | 0 .../andorid}/freetype2/freetype/ftincrem.h | 0 .../andorid}/freetype2/freetype/ftlcdfil.h | 0 .../andorid}/freetype2/freetype/ftlist.h | 0 .../andorid}/freetype2/freetype/ftlzw.h | 0 .../andorid}/freetype2/freetype/ftmac.h | 0 .../andorid}/freetype2/freetype/ftmm.h | 0 .../andorid}/freetype2/freetype/ftmodapi.h | 0 .../andorid}/freetype2/freetype/ftmoderr.h | 0 .../andorid}/freetype2/freetype/ftotval.h | 0 .../andorid}/freetype2/freetype/ftoutln.h | 0 .../andorid}/freetype2/freetype/ftpfr.h | 0 .../andorid}/freetype2/freetype/ftrender.h | 0 .../andorid}/freetype2/freetype/ftsizes.h | 0 .../andorid}/freetype2/freetype/ftsnames.h | 0 .../andorid}/freetype2/freetype/ftstroke.h | 0 .../andorid}/freetype2/freetype/ftsynth.h | 0 .../andorid}/freetype2/freetype/ftsystem.h | 0 .../andorid}/freetype2/freetype/fttrigon.h | 0 .../andorid}/freetype2/freetype/ftttdrv.h | 0 .../andorid}/freetype2/freetype/fttypes.h | 0 .../andorid}/freetype2/freetype/ftwinfnt.h | 0 .../andorid}/freetype2/freetype/ftxf86.h | 0 .../andorid}/freetype2/freetype/t1tables.h | 0 .../andorid}/freetype2/freetype/ttnameid.h | 0 .../andorid}/freetype2/freetype/tttables.h | 0 .../andorid}/freetype2/freetype/tttags.h | 0 .../andorid}/freetype2/freetype/ttunpat.h | 0 .../freetype2/include/andorid}/ft2build.h | 0 .../include/ios}/freetype/config/ftconfig.h | 0 .../include/ios}/freetype/config/ftheader.h | 0 .../include/ios}/freetype/config/ftmodule.h | 0 .../include/ios}/freetype/config/ftoption.h | 0 .../include/ios}/freetype/config/ftstdlib.h | 0 .../ios}/freetype/freetype.h.REMOVED.git-id | 0 .../include/ios}/freetype/ftadvanc.h | 0 .../freetype2/include/ios}/freetype/ftautoh.h | 0 .../freetype2/include/ios}/freetype/ftbbox.h | 0 .../freetype2/include/ios}/freetype/ftbdf.h | 0 .../include/ios}/freetype/ftbitmap.h | 0 .../freetype2/include/ios}/freetype/ftbzip2.h | 0 .../freetype2/include/ios}/freetype/ftcache.h | 0 .../include/ios}/freetype/ftcffdrv.h | 0 .../include/ios}/freetype/ftchapters.h | 0 .../freetype2/include/ios}/freetype/ftcid.h | 0 .../include/ios}/freetype/fterrdef.h | 0 .../include/ios}/freetype/fterrors.h | 0 .../freetype2/include/ios}/freetype/ftgasp.h | 0 .../freetype2/include/ios}/freetype/ftglyph.h | 0 .../freetype2/include/ios}/freetype/ftgxval.h | 0 .../freetype2/include/ios}/freetype/ftgzip.h | 0 .../freetype2/include/ios}/freetype/ftimage.h | 0 .../include/ios}/freetype/ftincrem.h | 0 .../include/ios}/freetype/ftlcdfil.h | 0 .../freetype2/include/ios}/freetype/ftlist.h | 0 .../freetype2/include/ios}/freetype/ftlzw.h | 0 .../freetype2/include/ios}/freetype/ftmac.h | 0 .../freetype2/include/ios}/freetype/ftmm.h | 0 .../include/ios}/freetype/ftmodapi.h | 0 .../include/ios}/freetype/ftmoderr.h | 0 .../freetype2/include/ios}/freetype/ftotval.h | 0 .../freetype2/include/ios}/freetype/ftoutln.h | 0 .../freetype2/include/ios}/freetype/ftpfr.h | 0 .../include/ios}/freetype/ftrender.h | 0 .../freetype2/include/ios}/freetype/ftsizes.h | 0 .../include/ios}/freetype/ftsnames.h | 0 .../include/ios}/freetype/ftstroke.h | 0 .../freetype2/include/ios}/freetype/ftsynth.h | 0 .../include/ios}/freetype/ftsystem.h | 0 .../include/ios}/freetype/fttrigon.h | 0 .../freetype2/include/ios}/freetype/ftttdrv.h | 0 .../freetype2/include/ios}/freetype/fttypes.h | 0 .../include/ios}/freetype/ftwinfnt.h | 0 .../freetype2/include/ios}/freetype/ftxf86.h | 0 .../include/ios}/freetype/internal/autohint.h | 0 .../include/ios}/freetype/internal/ftcalc.h | 0 .../include/ios}/freetype/internal/ftdebug.h | 0 .../include/ios}/freetype/internal/ftdriver.h | 0 .../include/ios}/freetype/internal/ftgloadr.h | 0 .../include/ios}/freetype/internal/ftmemory.h | 0 .../include/ios}/freetype/internal/ftobjs.h | 0 .../include/ios}/freetype/internal/ftpic.h | 0 .../include/ios}/freetype/internal/ftrfork.h | 0 .../include/ios}/freetype/internal/ftserv.h | 0 .../include/ios}/freetype/internal/ftstream.h | 0 .../include/ios}/freetype/internal/fttrace.h | 0 .../include/ios}/freetype/internal/ftvalid.h | 0 .../include/ios}/freetype/internal/internal.h | 0 .../include/ios}/freetype/internal/psaux.h | 0 .../include/ios}/freetype/internal/pshints.h | 0 .../ios}/freetype/internal/services/svbdf.h | 0 .../ios}/freetype/internal/services/svcid.h | 0 .../freetype/internal/services/svgldict.h | 0 .../ios}/freetype/internal/services/svgxval.h | 0 .../ios}/freetype/internal/services/svkern.h | 0 .../ios}/freetype/internal/services/svmm.h | 0 .../ios}/freetype/internal/services/svotval.h | 0 .../ios}/freetype/internal/services/svpfr.h | 0 .../freetype/internal/services/svpostnm.h | 0 .../ios}/freetype/internal/services/svprop.h | 0 .../freetype/internal/services/svpscmap.h | 0 .../freetype/internal/services/svpsinfo.h | 0 .../ios}/freetype/internal/services/svsfnt.h | 0 .../freetype/internal/services/svttcmap.h | 0 .../ios}/freetype/internal/services/svtteng.h | 0 .../freetype/internal/services/svttglyf.h | 0 .../freetype/internal/services/svwinfnt.h | 0 .../freetype/internal/services/svxf86nm.h | 0 .../include/ios}/freetype/internal/sfnt.h | 0 .../include/ios}/freetype/internal/t1types.h | 0 .../include/ios}/freetype/internal/tttypes.h | 0 .../include/ios}/freetype/t1tables.h | 0 .../include/ios}/freetype/ttnameid.h | 0 .../include/ios}/freetype/tttables.h | 0 .../freetype2/include/ios}/freetype/tttags.h | 0 .../freetype2/include/ios}/freetype/ttunpat.h | 0 .../freetype2/include/ios}/ft2build.h | 0 .../include/linux}/freetype/config/ftconfig.h | 0 .../include/linux}/freetype/config/ftheader.h | 0 .../include/linux}/freetype/config/ftmodule.h | 0 .../include/linux}/freetype/config/ftoption.h | 0 .../include/linux}/freetype/config/ftstdlib.h | 0 .../linux}/freetype/freetype.h.REMOVED.git-id | 0 .../include/linux}/freetype/ftadvanc.h | 0 .../include/linux}/freetype/ftbbox.h | 0 .../freetype2/include/linux}/freetype/ftbdf.h | 0 .../include/linux}/freetype/ftbitmap.h | 0 .../include/linux}/freetype/ftbzip2.h | 0 .../include/linux}/freetype/ftcache.h | 0 .../include/linux}/freetype/ftchapters.h | 0 .../freetype2/include/linux}/freetype/ftcid.h | 0 .../include/linux}/freetype/fterrdef.h | 0 .../include/linux}/freetype/fterrors.h | 0 .../include/linux}/freetype/ftgasp.h | 0 .../include/linux}/freetype/ftglyph.h | 0 .../include/linux}/freetype/ftgxval.h | 0 .../include/linux}/freetype/ftgzip.h | 0 .../include/linux}/freetype/ftimage.h | 0 .../include/linux}/freetype/ftincrem.h | 0 .../include/linux}/freetype/ftlcdfil.h | 0 .../include/linux}/freetype/ftlist.h | 0 .../freetype2/include/linux}/freetype/ftlzw.h | 0 .../freetype2/include/linux}/freetype/ftmac.h | 0 .../freetype2/include/linux}/freetype/ftmm.h | 0 .../include/linux}/freetype/ftmodapi.h | 0 .../include/linux}/freetype/ftmoderr.h | 0 .../include/linux}/freetype/ftotval.h | 0 .../include/linux}/freetype/ftoutln.h | 0 .../freetype2/include/linux}/freetype/ftpfr.h | 0 .../include/linux}/freetype/ftrender.h | 0 .../include/linux}/freetype/ftsizes.h | 0 .../include/linux}/freetype/ftsnames.h | 0 .../include/linux}/freetype/ftstroke.h | 0 .../include/linux}/freetype/ftsynth.h | 0 .../include/linux}/freetype/ftsystem.h | 0 .../include/linux}/freetype/fttrigon.h | 0 .../include/linux}/freetype/fttypes.h | 0 .../include/linux}/freetype/ftwinfnt.h | 0 .../include/linux}/freetype/ftxf86.h | 0 .../linux}/freetype/internal/autohint.h | 0 .../include/linux}/freetype/internal/ftcalc.h | 0 .../linux}/freetype/internal/ftdebug.h | 0 .../linux}/freetype/internal/ftdriver.h | 0 .../linux}/freetype/internal/ftgloadr.h | 0 .../linux}/freetype/internal/ftmemory.h | 0 .../include/linux}/freetype/internal/ftobjs.h | 0 .../include/linux}/freetype/internal/ftpic.h | 0 .../linux}/freetype/internal/ftrfork.h | 0 .../include/linux}/freetype/internal/ftserv.h | 0 .../linux}/freetype/internal/ftstream.h | 0 .../linux}/freetype/internal/fttrace.h | 0 .../linux}/freetype/internal/ftvalid.h | 0 .../linux}/freetype/internal/internal.h | 0 .../include/linux}/freetype/internal/psaux.h | 0 .../linux}/freetype/internal/pshints.h | 0 .../linux}/freetype/internal/services/svbdf.h | 0 .../linux}/freetype/internal/services/svcid.h | 0 .../freetype/internal/services/svgldict.h | 0 .../freetype/internal/services/svgxval.h | 0 .../freetype/internal/services/svkern.h | 0 .../linux}/freetype/internal/services/svmm.h | 0 .../freetype/internal/services/svotval.h | 0 .../linux}/freetype/internal/services/svpfr.h | 0 .../freetype/internal/services/svpostnm.h | 0 .../freetype/internal/services/svpscmap.h | 0 .../freetype/internal/services/svpsinfo.h | 0 .../freetype/internal/services/svsfnt.h | 0 .../freetype/internal/services/svttcmap.h | 0 .../freetype/internal/services/svtteng.h | 0 .../freetype/internal/services/svttglyf.h | 0 .../freetype/internal/services/svwinfnt.h | 0 .../freetype/internal/services/svxf86nm.h | 0 .../include/linux}/freetype/internal/sfnt.h | 0 .../linux}/freetype/internal/t1types.h | 0 .../linux}/freetype/internal/tttypes.h | 0 .../include/linux}/freetype/t1tables.h | 0 .../include/linux}/freetype/ttnameid.h | 0 .../include/linux}/freetype/tttables.h | 0 .../include/linux}/freetype/tttags.h | 0 .../include/linux}/freetype/ttunpat.h | 0 .../freetype2/include/linux}/ft2build.h | 0 .../include/mac}/freetype/config/ftconfig.h | 0 .../include/mac}/freetype/config/ftheader.h | 0 .../include/mac}/freetype/config/ftmodule.h | 0 .../include/mac}/freetype/config/ftoption.h | 0 .../include/mac}/freetype/config/ftstdlib.h | 0 .../mac}/freetype/freetype.h.REMOVED.git-id | 0 .../include/mac}/freetype/ftadvanc.h | 0 .../freetype2/include/mac}/freetype/ftautoh.h | 0 .../freetype2/include/mac}/freetype/ftbbox.h | 0 .../freetype2/include/mac}/freetype/ftbdf.h | 0 .../include/mac}/freetype/ftbitmap.h | 0 .../freetype2/include/mac}/freetype/ftbzip2.h | 0 .../freetype2/include/mac}/freetype/ftcache.h | 0 .../include/mac}/freetype/ftcffdrv.h | 0 .../include/mac}/freetype/ftchapters.h | 0 .../freetype2/include/mac}/freetype/ftcid.h | 0 .../include/mac}/freetype/fterrdef.h | 0 .../include/mac}/freetype/fterrors.h | 0 .../freetype2/include/mac}/freetype/ftgasp.h | 0 .../freetype2/include/mac}/freetype/ftglyph.h | 0 .../freetype2/include/mac}/freetype/ftgxval.h | 0 .../freetype2/include/mac}/freetype/ftgzip.h | 0 .../freetype2/include/mac}/freetype/ftimage.h | 0 .../include/mac}/freetype/ftincrem.h | 0 .../include/mac}/freetype/ftlcdfil.h | 0 .../freetype2/include/mac}/freetype/ftlist.h | 0 .../freetype2/include/mac}/freetype/ftlzw.h | 0 .../freetype2/include/mac}/freetype/ftmac.h | 0 .../freetype2/include/mac}/freetype/ftmm.h | 0 .../include/mac}/freetype/ftmodapi.h | 0 .../include/mac}/freetype/ftmoderr.h | 0 .../freetype2/include/mac}/freetype/ftotval.h | 0 .../freetype2/include/mac}/freetype/ftoutln.h | 0 .../freetype2/include/mac}/freetype/ftpfr.h | 0 .../include/mac}/freetype/ftrender.h | 0 .../freetype2/include/mac}/freetype/ftsizes.h | 0 .../include/mac}/freetype/ftsnames.h | 0 .../include/mac}/freetype/ftstroke.h | 0 .../freetype2/include/mac}/freetype/ftsynth.h | 0 .../include/mac}/freetype/ftsystem.h | 0 .../include/mac}/freetype/fttrigon.h | 0 .../freetype2/include/mac}/freetype/ftttdrv.h | 0 .../freetype2/include/mac}/freetype/fttypes.h | 0 .../include/mac}/freetype/ftwinfnt.h | 0 .../freetype2/include/mac}/freetype/ftxf86.h | 0 .../include/mac}/freetype/internal/autohint.h | 0 .../include/mac}/freetype/internal/ftcalc.h | 0 .../include/mac}/freetype/internal/ftdebug.h | 0 .../include/mac}/freetype/internal/ftdriver.h | 0 .../include/mac}/freetype/internal/ftgloadr.h | 0 .../include/mac}/freetype/internal/ftmemory.h | 0 .../include/mac}/freetype/internal/ftobjs.h | 0 .../include/mac}/freetype/internal/ftpic.h | 0 .../include/mac}/freetype/internal/ftrfork.h | 0 .../include/mac}/freetype/internal/ftserv.h | 0 .../include/mac}/freetype/internal/ftstream.h | 0 .../include/mac}/freetype/internal/fttrace.h | 0 .../include/mac}/freetype/internal/ftvalid.h | 0 .../include/mac}/freetype/internal/internal.h | 0 .../include/mac}/freetype/internal/psaux.h | 0 .../include/mac}/freetype/internal/pshints.h | 0 .../mac}/freetype/internal/services/svbdf.h | 0 .../mac}/freetype/internal/services/svcid.h | 0 .../freetype/internal/services/svgldict.h | 0 .../mac}/freetype/internal/services/svgxval.h | 0 .../mac}/freetype/internal/services/svkern.h | 0 .../mac}/freetype/internal/services/svmm.h | 0 .../mac}/freetype/internal/services/svotval.h | 0 .../mac}/freetype/internal/services/svpfr.h | 0 .../freetype/internal/services/svpostnm.h | 0 .../mac}/freetype/internal/services/svprop.h | 0 .../freetype/internal/services/svpscmap.h | 0 .../freetype/internal/services/svpsinfo.h | 0 .../mac}/freetype/internal/services/svsfnt.h | 0 .../freetype/internal/services/svttcmap.h | 0 .../mac}/freetype/internal/services/svtteng.h | 0 .../freetype/internal/services/svttglyf.h | 0 .../freetype/internal/services/svwinfnt.h | 0 .../freetype/internal/services/svxf86nm.h | 0 .../include/mac}/freetype/internal/sfnt.h | 0 .../include/mac}/freetype/internal/t1types.h | 0 .../include/mac}/freetype/internal/tttypes.h | 0 .../include/mac}/freetype/t1tables.h | 0 .../include/mac}/freetype/ttnameid.h | 0 .../include/mac}/freetype/tttables.h | 0 .../freetype2/include/mac}/freetype/tttags.h | 0 .../freetype2/include/mac}/freetype/ttunpat.h | 0 .../freetype2/include/mac}/ft2build.h | 0 .../include/win32}/freetype/config/ftconfig.h | 0 .../include/win32}/freetype/config/ftheader.h | 0 .../include/win32}/freetype/config/ftmodule.h | 0 .../include/win32}/freetype/config/ftoption.h | 0 .../include/win32}/freetype/config/ftstdlib.h | 0 .../win32}/freetype/freetype.h.REMOVED.git-id | 0 .../include/win32}/freetype/ftadvanc.h | 0 .../include/win32}/freetype/ftautoh.h | 0 .../include/win32}/freetype/ftbbox.h | 0 .../freetype2/include/win32}/freetype/ftbdf.h | 0 .../include/win32}/freetype/ftbitmap.h | 0 .../include/win32}/freetype/ftbzip2.h | 0 .../include/win32}/freetype/ftcache.h | 0 .../include/win32}/freetype/ftcffdrv.h | 0 .../include/win32}/freetype/ftchapters.h | 0 .../freetype2/include/win32}/freetype/ftcid.h | 0 .../include/win32}/freetype/fterrdef.h | 0 .../include/win32}/freetype/fterrors.h | 0 .../include/win32}/freetype/ftgasp.h | 0 .../include/win32}/freetype/ftglyph.h | 0 .../include/win32}/freetype/ftgxval.h | 0 .../include/win32}/freetype/ftgzip.h | 0 .../include/win32}/freetype/ftimage.h | 0 .../include/win32}/freetype/ftincrem.h | 0 .../include/win32}/freetype/ftlcdfil.h | 0 .../include/win32}/freetype/ftlist.h | 0 .../freetype2/include/win32}/freetype/ftlzw.h | 0 .../freetype2/include/win32}/freetype/ftmac.h | 0 .../freetype2/include/win32}/freetype/ftmm.h | 0 .../include/win32}/freetype/ftmodapi.h | 0 .../include/win32}/freetype/ftmoderr.h | 0 .../include/win32}/freetype/ftotval.h | 0 .../include/win32}/freetype/ftoutln.h | 0 .../freetype2/include/win32}/freetype/ftpfr.h | 0 .../include/win32}/freetype/ftrender.h | 0 .../include/win32}/freetype/ftsizes.h | 0 .../include/win32}/freetype/ftsnames.h | 0 .../include/win32}/freetype/ftstroke.h | 0 .../include/win32}/freetype/ftsynth.h | 0 .../include/win32}/freetype/ftsystem.h | 0 .../include/win32}/freetype/fttrigon.h | 0 .../include/win32}/freetype/ftttdrv.h | 0 .../include/win32}/freetype/fttypes.h | 0 .../include/win32}/freetype/ftwinfnt.h | 0 .../include/win32}/freetype/ftxf86.h | 0 .../win32}/freetype/internal/autohint.h | 0 .../include/win32}/freetype/internal/ftcalc.h | 0 .../win32}/freetype/internal/ftdebug.h | 0 .../win32}/freetype/internal/ftdriver.h | 0 .../win32}/freetype/internal/ftgloadr.h | 0 .../win32}/freetype/internal/ftmemory.h | 0 .../include/win32}/freetype/internal/ftobjs.h | 0 .../include/win32}/freetype/internal/ftpic.h | 0 .../win32}/freetype/internal/ftrfork.h | 0 .../include/win32}/freetype/internal/ftserv.h | 0 .../win32}/freetype/internal/ftstream.h | 0 .../win32}/freetype/internal/fttrace.h | 0 .../win32}/freetype/internal/ftvalid.h | 0 .../win32}/freetype/internal/internal.h | 0 .../include/win32}/freetype/internal/psaux.h | 0 .../win32}/freetype/internal/pshints.h | 0 .../win32}/freetype/internal/services/svbdf.h | 0 .../win32}/freetype/internal/services/svcid.h | 0 .../freetype/internal/services/svgldict.h | 0 .../freetype/internal/services/svgxval.h | 0 .../freetype/internal/services/svkern.h | 0 .../win32}/freetype/internal/services/svmm.h | 0 .../freetype/internal/services/svotval.h | 0 .../win32}/freetype/internal/services/svpfr.h | 0 .../freetype/internal/services/svpostnm.h | 0 .../freetype/internal/services/svprop.h | 0 .../freetype/internal/services/svpscmap.h | 0 .../freetype/internal/services/svpsinfo.h | 0 .../freetype/internal/services/svsfnt.h | 0 .../freetype/internal/services/svttcmap.h | 0 .../freetype/internal/services/svtteng.h | 0 .../freetype/internal/services/svttglyf.h | 0 .../freetype/internal/services/svwinfnt.h | 0 .../freetype/internal/services/svxf86nm.h | 0 .../include/win32}/freetype/internal/sfnt.h | 0 .../win32}/freetype/internal/t1types.h | 0 .../win32}/freetype/internal/tttypes.h | 0 .../include/win32}/freetype/t1tables.h | 0 .../include/win32}/freetype/ttnameid.h | 0 .../include/win32}/freetype/tttables.h | 0 .../include/win32}/freetype/tttags.h | 0 .../include/win32}/freetype/ttunpat.h | 0 .../freetype2/include/win32}/ft2build.h | 0 .../freetype2/prebuilt/andorid}/Android.mk | 0 .../armeabi-v7a/libfreetype.a.REMOVED.git-id | 0 .../armeabi/libfreetype.a.REMOVED.git-id | 0 .../andorid}/x86/libfreetype.a.REMOVED.git-id | 0 .../ios}/libfreetype.a.REMOVED.git-id | 0 .../32-bit}/libfreetype.a.REMOVED.git-id | 0 .../64-bit}/libfreetype.a.REMOVED.git-id | 0 .../mac}/libfreetype.a.REMOVED.git-id | 0 .../win32}/freetype250.lib.REMOVED.git-id | 0 .../glfw3/include/linux}/glfw3.h | 0 .../glfw3/include/linux}/glfw3native.h | 0 .../glfw3/include/mac}/glfw3.h | 0 .../glfw3/include/mac}/glfw3native.h | 0 .../glfw3/include/win32}/glfw3.h | 0 .../glfw3/include/win32}/glfw3native.h | 0 .../prebuilt/mac}/libglfw3.a.REMOVED.git-id | 0 .../prebuilt/win32}/glfw3.lib.REMOVED.git-id | 0 .../jpeg/include/andorid}/jconfig.h | 0 .../jpeg/include/andorid}/jerror.h | 0 .../jpeg/include/andorid}/jmorecfg.h | 0 .../jpeg/include/andorid}/jpeglib.h | 0 .../jpeg/include/ios}/jconfig.h | 0 .../jpeg/include/ios}/jmorecfg.h | 0 .../jpeg/include/ios}/jpeglib.h | 0 .../jpeg/include/linux}/jconfig.h | 0 .../jpeg/include/linux}/jmorecfg.h | 0 .../jpeg/include/linux}/jpeglib.h | 0 .../jpeg/include/mac}/jconfig.h | 0 .../jpeg/include/mac}/jmorecfg.h | 0 .../jpeg/include/mac}/jpeglib.h | 0 .../jpeg/include/win32}/jconfig.h | 0 .../jpeg/include/win32}/jmorecfg.h | 0 .../jpeg/include/win32}/jpeglib.h | 0 .../jpeg/prebuilt/andorid}/Android.mk | 0 .../armeabi-v7a/libjpeg.a.REMOVED.git-id | 0 .../andorid}/armeabi/libjpeg.a.REMOVED.git-id | 0 .../andorid}/x86/libjpeg.a.REMOVED.git-id | 0 .../prebuilt/ios}/libjpeg.a.REMOVED.git-id | 0 .../linux/32-bit}/libjpeg.a.REMOVED.git-id | 0 .../linux/64-bit}/libjpeg.a.REMOVED.git-id | 0 .../prebuilt/mac}/libjpeg.a.REMOVED.git-id | 0 .../win32}/libjpeg.lib.REMOVED.git-id | 0 .../lib_json => external/jsoncpp}/autolink.h | 0 .../lib_json => external/jsoncpp}/config.h | 0 .../lib_json => external/jsoncpp}/features.h | 0 .../lib_json => external/jsoncpp}/forwards.h | 0 .../jsoncpp}/json_batchallocator.h | 0 .../jsoncpp}/json_internalarray.inl | 0 .../jsoncpp}/json_internalmap.inl | 0 .../lib_json => external/jsoncpp}/json_lib.h | 0 .../jsoncpp}/json_reader.cpp | 0 .../lib_json => external/jsoncpp}/json_tool.h | 0 .../jsoncpp}/json_value.cpp | 0 .../jsoncpp}/json_valueiterator.inl | 0 .../jsoncpp}/json_writer.cpp | 0 .../lib_json => external/jsoncpp}/reader.h | 0 .../lib_json => external/jsoncpp}/sconscript | 0 .../lib_json => external/jsoncpp}/value.h | 0 .../lib_json => external/jsoncpp}/writer.h | 0 external/libwebp/dec/Makefile.am | 28 - external/libwebp/dec/alpha.c | 140 - external/libwebp/dec/buffer.c | 215 -- external/libwebp/dec/decode_vp8.h | 182 - external/libwebp/dec/frame.c | 679 ---- external/libwebp/dec/idec.c | 785 ----- external/libwebp/dec/io.c | 633 ---- external/libwebp/dec/layer.c | 35 - external/libwebp/dec/quant.c | 113 - external/libwebp/dec/tree.c | 589 ---- external/libwebp/dec/vp8.c | 787 ----- external/libwebp/dec/vp8i.h | 335 -- external/libwebp/dec/vp8l.c | 1200 ------- external/libwebp/dec/vp8li.h | 121 - external/libwebp/dec/webp.c | 777 ----- external/libwebp/dec/webpi.h | 114 - external/libwebp/dsp/Makefile.am | 26 - external/libwebp/dsp/cpu.c | 87 - external/libwebp/dsp/dec.c | 732 ---- external/libwebp/dsp/dec_neon.c | 334 -- external/libwebp/dsp/dec_sse2.c | 908 ----- external/libwebp/dsp/dsp.h | 212 -- external/libwebp/dsp/enc.c | 743 ----- external/libwebp/dsp/enc_sse2.c | 843 ----- external/libwebp/dsp/lossless.c | 1140 ------- external/libwebp/dsp/lossless.h | 82 - external/libwebp/dsp/upsampling.c | 357 -- external/libwebp/dsp/upsampling_sse2.c | 215 -- external/libwebp/dsp/yuv.c | 52 - external/libwebp/dsp/yuv.h | 128 - external/libwebp/enc/Makefile.am | 32 - external/libwebp/enc/alpha.c | 330 -- external/libwebp/enc/analysis.c | 364 -- external/libwebp/enc/backward_references.c | 873 ----- external/libwebp/enc/backward_references.h | 214 -- external/libwebp/enc/config.c | 132 - external/libwebp/enc/cost.c | 494 --- external/libwebp/enc/cost.h | 48 - external/libwebp/enc/filter.c | 409 --- external/libwebp/enc/frame.c | 939 ------ external/libwebp/enc/histogram.c | 406 --- external/libwebp/enc/histogram.h | 115 - external/libwebp/enc/iterator.c | 422 --- external/libwebp/enc/layer.c | 49 - external/libwebp/enc/picture.c | 1041 ------ external/libwebp/enc/quant.c | 930 ------ external/libwebp/enc/syntax.c | 437 --- external/libwebp/enc/tree.c | 510 --- external/libwebp/enc/vp8enci.h | 525 --- external/libwebp/enc/vp8l.c | 1155 ------- external/libwebp/enc/vp8li.h | 68 - external/libwebp/enc/webpenc.c | 389 --- external/libwebp/mux/Makefile.am | 16 - external/libwebp/mux/demux.c | 902 ----- external/libwebp/mux/muxedit.c | 712 ---- external/libwebp/mux/muxi.h | 271 -- external/libwebp/mux/muxinternal.c | 576 ---- external/libwebp/mux/muxread.c | 411 --- external/libwebp/utils/Makefile.am | 27 - external/libwebp/utils/bit_reader.c | 229 -- external/libwebp/utils/bit_reader.h | 201 -- external/libwebp/utils/bit_writer.c | 284 -- external/libwebp/utils/bit_writer.h | 123 - external/libwebp/utils/color_cache.c | 44 - external/libwebp/utils/color_cache.h | 68 - external/libwebp/utils/filters.c | 229 -- external/libwebp/utils/filters.h | 54 - external/libwebp/utils/huffman.c | 238 -- external/libwebp/utils/huffman.h | 78 - external/libwebp/utils/huffman_encode.c | 439 --- external/libwebp/utils/huffman_encode.h | 47 - external/libwebp/utils/quant_levels.c | 154 - external/libwebp/utils/quant_levels.h | 39 - external/libwebp/utils/rescaler.c | 152 - external/libwebp/utils/rescaler.h | 76 - external/libwebp/utils/thread.c | 247 -- external/libwebp/utils/thread.h | 86 - external/libwebp/utils/utils.c | 44 - external/libwebp/utils/utils.h | 44 - external/libwebp/webp/decode.h | 454 --- external/libwebp/webp/encode.h | 463 --- external/libwebp/webp/format_constants.h | 90 - external/libwebp/webp/mux.h | 604 ---- external/libwebp/webp/types.h | 45 - .../png/include/andorid}/png.h.REMOVED.git-id | 0 .../png/include/andorid}/pngconf.h | 0 .../png/include/andorid}/pnglibconf.h | 0 .../png/include/ios}/png.h.REMOVED.git-id | 0 .../png/include/ios}/pngconf.h | 0 .../png/include/ios}/pnglibconf.h | 0 .../png/include/mac}/png.h.REMOVED.git-id | 0 .../png/include/mac}/pngconf.h | 0 .../png/include/mac}/pnglibconf.h | 0 .../png/include/win32}/png.h.REMOVED.git-id | 0 .../png/include/win32}/pngconf.h | 0 .../png/include/win32}/pnglibconf.h | 0 .../png/prebuilt/andorid}/Android.mk | 0 .../armeabi-v7a/libpng.a.REMOVED.git-id | 0 .../andorid}/armeabi/libpng.a.REMOVED.git-id | 0 .../andorid}/x86/libpng.a.REMOVED.git-id | 0 .../png/prebuilt/ios}/libpng.a.REMOVED.git-id | 0 .../png/prebuilt/mac}/libpng.a.REMOVED.git-id | 0 .../prebuilt/win32}/libpng.lib.REMOVED.git-id | 0 .../common => external}/s3tc/s3tc.cpp | 0 .../common => external}/s3tc/s3tc.h | 0 .../spidermonkey/include/andorid}/js-config.h | 0 .../spidermonkey/include/andorid}/js.msg | 0 .../spidermonkey/include/andorid}/js/Anchor.h | 0 .../include/andorid}/js/CallArgs.h | 0 .../include/andorid}/js/CharacterEncoding.h | 0 .../spidermonkey/include/andorid}/js/Date.h | 0 .../spidermonkey/include/andorid}/js/GCAPI.h | 0 .../include/andorid}/js/HashTable.h | 0 .../include/andorid}/js/HeapAPI.h | 0 .../include/andorid}/js/LegacyIntTypes.h | 0 .../include/andorid}/js/MemoryMetrics.h | 0 .../include/andorid}/js/PropertyKey.h | 0 .../include/andorid}/js/RequiredDefines.h | 0 .../include/andorid}/js/RootingAPI.h | 0 .../include/andorid}/js/TemplateLib.h | 0 .../include/andorid}/js/Utility.h | 0 .../spidermonkey/include/andorid}/js/Value.h | 0 .../spidermonkey/include/andorid}/js/Vector.h | 0 .../spidermonkey/include/andorid}/jsalloc.h | 0 .../include/andorid}/jsapi.h.REMOVED.git-id | 0 .../spidermonkey/include/andorid}/jsclass.h | 0 .../spidermonkey/include/andorid}/jsclist.h | 0 .../spidermonkey/include/andorid}/jscpucfg.h | 0 .../spidermonkey/include/andorid}/jsdbgapi.h | 0 .../spidermonkey/include/andorid}/jsdhash.h | 0 .../include/andorid}/jsfriendapi.h | 0 .../spidermonkey/include/andorid}/jslock.h | 0 .../spidermonkey/include/andorid}/json.h | 0 .../spidermonkey/include/andorid}/jsperf.h | 0 .../spidermonkey/include/andorid}/jsprf.h | 0 .../include/andorid}/jsprototypes.h | 0 .../spidermonkey/include/andorid}/jsproxy.h | 0 .../spidermonkey/include/andorid}/jsprvtd.h | 0 .../spidermonkey/include/andorid}/jspubtd.h | 0 .../spidermonkey/include/andorid}/jstypes.h | 0 .../spidermonkey/include/andorid}/jsutil.h | 0 .../spidermonkey/include/andorid}/jsversion.h | 0 .../spidermonkey/include/andorid}/jswrapper.h | 0 .../include/andorid}/mozilla/Assertions.h | 0 .../include/andorid}/mozilla/Attributes.h | 0 .../include/andorid}/mozilla/BloomFilter.h | 0 .../include/andorid}/mozilla/Casting.h | 0 .../include/andorid}/mozilla/Char16.h | 0 .../include/andorid}/mozilla/CheckedInt.h | 0 .../include/andorid}/mozilla/Compiler.h | 0 .../include/andorid}/mozilla/Constants.h | 0 .../include/andorid}/mozilla/DebugOnly.h | 0 .../include/andorid}/mozilla/Decimal.h | 0 .../include/andorid}/mozilla/Endian.h | 0 .../include/andorid}/mozilla/EnumSet.h | 0 .../include/andorid}/mozilla/FloatingPoint.h | 0 .../include/andorid}/mozilla/GuardObjects.h | 0 .../include/andorid}/mozilla/HashFunctions.h | 0 .../include/andorid}/mozilla/Likely.h | 0 .../include/andorid}/mozilla/LinkedList.h | 0 .../include/andorid}/mozilla/MSStdInt.h | 0 .../include/andorid}/mozilla/MathAlgorithms.h | 0 .../include/andorid}/mozilla/MemoryChecking.h | 0 .../include/andorid}/mozilla/NullPtr.h | 0 .../include/andorid}/mozilla/PodOperations.h | 0 .../include/andorid}/mozilla/Poison.h | 0 .../include/andorid}/mozilla/Range.h | 0 .../include/andorid}/mozilla/RangedPtr.h | 0 .../include/andorid}/mozilla/RefPtr.h | 0 .../include/andorid}/mozilla/SHA1.h | 0 .../include/andorid}/mozilla/Scoped.h | 0 .../include/andorid}/mozilla/SplayTree.h | 0 .../andorid}/mozilla/StandardInteger.h | 0 .../include/andorid}/mozilla/ThreadLocal.h | 0 .../include/andorid}/mozilla/TypeTraits.h | 0 .../include/andorid}/mozilla/TypedEnum.h | 0 .../include/andorid}/mozilla/Types.h | 0 .../include/andorid}/mozilla/Util.h | 0 .../include/andorid}/mozilla/WeakPtr.h | 0 .../spidermonkey/include/ios}/js-config.h | 0 .../spidermonkey/include/ios}/js.msg | 0 .../spidermonkey/include/ios}/js/Anchor.h | 0 .../spidermonkey/include/ios}/js/CallArgs.h | 0 .../include/ios}/js/CharacterEncoding.h | 0 .../spidermonkey/include/ios}/js/Date.h | 0 .../spidermonkey/include/ios}/js/GCAPI.h | 0 .../spidermonkey/include/ios}/js/HashTable.h | 0 .../spidermonkey/include/ios}/js/HeapAPI.h | 0 .../include/ios}/js/LegacyIntTypes.h | 0 .../include/ios}/js/MemoryMetrics.h | 0 .../include/ios}/js/PropertyKey.h | 0 .../include/ios}/js/RequiredDefines.h | 0 .../spidermonkey/include/ios}/js/RootingAPI.h | 0 .../include/ios}/js/TemplateLib.h | 0 .../spidermonkey/include/ios}/js/Utility.h | 0 .../spidermonkey/include/ios}/js/Value.h | 0 .../spidermonkey/include/ios}/js/Vector.h | 0 .../spidermonkey/include/ios}/jsalloc.h | 0 .../include/ios}/jsapi.h.REMOVED.git-id | 0 .../spidermonkey/include/ios}/jsclass.h | 0 .../spidermonkey/include/ios}/jsclist.h | 0 .../spidermonkey/include/ios}/jscpucfg.h | 0 .../spidermonkey/include/ios}/jsdbgapi.h | 0 .../spidermonkey/include/ios}/jsdhash.h | 0 .../spidermonkey/include/ios}/jsfriendapi.h | 0 .../spidermonkey/include/ios}/jslock.h | 0 .../spidermonkey/include/ios}/json.h | 0 .../spidermonkey/include/ios}/jsperf.h | 0 .../spidermonkey/include/ios}/jsprf.h | 0 .../spidermonkey/include/ios}/jsprototypes.h | 0 .../spidermonkey/include/ios}/jsproxy.h | 0 .../spidermonkey/include/ios}/jsprvtd.h | 0 .../spidermonkey/include/ios}/jspubtd.h | 0 .../spidermonkey/include/ios}/jstypes.h | 0 .../spidermonkey/include/ios}/jsutil.h | 0 .../spidermonkey/include/ios}/jsversion.h | 0 .../spidermonkey/include/ios}/jswrapper.h | 0 .../include/ios}/mozilla/Assertions.h | 0 .../include/ios}/mozilla/Attributes.h | 0 .../include/ios}/mozilla/BloomFilter.h | 0 .../include/ios}/mozilla/Casting.h | 0 .../include/ios}/mozilla/Char16.h | 0 .../include/ios}/mozilla/CheckedInt.h | 0 .../include/ios}/mozilla/Compiler.h | 0 .../include/ios}/mozilla/Constants.h | 0 .../include/ios}/mozilla/DebugOnly.h | 0 .../include/ios}/mozilla/Decimal.h | 0 .../include/ios}/mozilla/Endian.h | 0 .../include/ios}/mozilla/EnumSet.h | 0 .../include/ios}/mozilla/FloatingPoint.h | 0 .../include/ios}/mozilla/GuardObjects.h | 0 .../include/ios}/mozilla/HashFunctions.h | 0 .../include/ios}/mozilla/Likely.h | 0 .../include/ios}/mozilla/LinkedList.h | 0 .../include/ios}/mozilla/MSStdInt.h | 0 .../include/ios}/mozilla/MathAlgorithms.h | 0 .../include/ios}/mozilla/MemoryChecking.h | 0 .../include/ios}/mozilla/NullPtr.h | 0 .../include/ios}/mozilla/PodOperations.h | 0 .../include/ios}/mozilla/Poison.h | 0 .../spidermonkey/include/ios}/mozilla/Range.h | 0 .../include/ios}/mozilla/RangedPtr.h | 0 .../include/ios}/mozilla/RefPtr.h | 0 .../spidermonkey/include/ios}/mozilla/SHA1.h | 0 .../include/ios}/mozilla/Scoped.h | 0 .../include/ios}/mozilla/SplayTree.h | 0 .../include/ios}/mozilla/StandardInteger.h | 0 .../include/ios}/mozilla/ThreadLocal.h | 0 .../include/ios}/mozilla/TypeTraits.h | 0 .../include/ios}/mozilla/TypedEnum.h | 0 .../spidermonkey/include/ios}/mozilla/Types.h | 0 .../spidermonkey/include/ios}/mozilla/Util.h | 0 .../include/ios}/mozilla/WeakPtr.h | 0 .../spidermonkey/include/mac}/js-config.h | 0 .../spidermonkey/include/mac}/js.msg | 0 .../spidermonkey/include/mac}/js/Anchor.h | 0 .../spidermonkey/include/mac}/js/CallArgs.h | 0 .../include/mac}/js/CharacterEncoding.h | 0 .../spidermonkey/include/mac}/js/Date.h | 0 .../spidermonkey/include/mac}/js/GCAPI.h | 0 .../spidermonkey/include/mac}/js/HashTable.h | 0 .../spidermonkey/include/mac}/js/HeapAPI.h | 0 .../include/mac}/js/LegacyIntTypes.h | 0 .../include/mac}/js/MemoryMetrics.h | 0 .../include/mac}/js/PropertyKey.h | 0 .../include/mac}/js/RequiredDefines.h | 0 .../spidermonkey/include/mac}/js/RootingAPI.h | 0 .../include/mac}/js/TemplateLib.h | 0 .../spidermonkey/include/mac}/js/Utility.h | 0 .../spidermonkey/include/mac}/js/Value.h | 0 .../spidermonkey/include/mac}/js/Vector.h | 0 .../spidermonkey/include/mac}/jsalloc.h | 0 .../include/mac}/jsapi.h.REMOVED.git-id | 0 .../spidermonkey/include/mac}/jsclass.h | 0 .../spidermonkey/include/mac}/jsclist.h | 0 .../spidermonkey/include/mac}/jscpucfg.h | 0 .../spidermonkey/include/mac}/jsdbgapi.h | 0 .../spidermonkey/include/mac}/jsdhash.h | 0 .../spidermonkey/include/mac}/jsfriendapi.h | 0 .../spidermonkey/include/mac}/jslock.h | 0 .../spidermonkey/include/mac}/json.h | 0 .../spidermonkey/include/mac}/jsperf.h | 0 .../spidermonkey/include/mac}/jsprf.h | 0 .../spidermonkey/include/mac}/jsprototypes.h | 0 .../spidermonkey/include/mac}/jsproxy.h | 0 .../spidermonkey/include/mac}/jsprvtd.h | 0 .../spidermonkey/include/mac}/jspubtd.h | 0 .../spidermonkey/include/mac}/jstypes.h | 0 .../spidermonkey/include/mac}/jsutil.h | 0 .../spidermonkey/include/mac}/jsversion.h | 0 .../spidermonkey/include/mac}/jswrapper.h | 0 .../include/mac}/mozilla/Assertions.h | 0 .../include/mac}/mozilla/Attributes.h | 0 .../include/mac}/mozilla/BloomFilter.h | 0 .../include/mac}/mozilla/Casting.h | 0 .../include/mac}/mozilla/Char16.h | 0 .../include/mac}/mozilla/CheckedInt.h | 0 .../include/mac}/mozilla/Compiler.h | 0 .../include/mac}/mozilla/Constants.h | 0 .../include/mac}/mozilla/DebugOnly.h | 0 .../include/mac}/mozilla/Decimal.h | 0 .../include/mac}/mozilla/Endian.h | 0 .../include/mac}/mozilla/EnumSet.h | 0 .../include/mac}/mozilla/FloatingPoint.h | 0 .../include/mac}/mozilla/GuardObjects.h | 0 .../include/mac}/mozilla/HashFunctions.h | 0 .../include/mac}/mozilla/Likely.h | 0 .../include/mac}/mozilla/LinkedList.h | 0 .../include/mac}/mozilla/MSStdInt.h | 0 .../include/mac}/mozilla/MathAlgorithms.h | 0 .../include/mac}/mozilla/MemoryChecking.h | 0 .../include/mac}/mozilla/NullPtr.h | 0 .../include/mac}/mozilla/PodOperations.h | 0 .../include/mac}/mozilla/Poison.h | 0 .../spidermonkey/include/mac}/mozilla/Range.h | 0 .../include/mac}/mozilla/RangedPtr.h | 0 .../include/mac}/mozilla/RefPtr.h | 0 .../spidermonkey/include/mac}/mozilla/SHA1.h | 0 .../include/mac}/mozilla/Scoped.h | 0 .../include/mac}/mozilla/SplayTree.h | 0 .../include/mac}/mozilla/StandardInteger.h | 0 .../include/mac}/mozilla/ThreadLocal.h | 0 .../include/mac}/mozilla/TypeTraits.h | 0 .../include/mac}/mozilla/TypedEnum.h | 0 .../spidermonkey/include/mac}/mozilla/Types.h | 0 .../spidermonkey/include/mac}/mozilla/Util.h | 0 .../include/mac}/mozilla/WeakPtr.h | 0 .../spidermonkey/include/win32}/js-config.h | 0 .../spidermonkey/include/win32}/js.msg | 0 .../spidermonkey/include/win32}/js/Anchor.h | 0 .../spidermonkey/include/win32}/js/CallArgs.h | 0 .../include/win32}/js/CharacterEncoding.h | 0 .../spidermonkey/include/win32}/js/Date.h | 0 .../spidermonkey/include/win32}/js/GCAPI.h | 0 .../include/win32}/js/HashTable.h | 0 .../spidermonkey/include/win32}/js/HeapAPI.h | 0 .../include/win32}/js/LegacyIntTypes.h | 0 .../include/win32}/js/MemoryMetrics.h | 0 .../include/win32}/js/PropertyKey.h | 0 .../include/win32}/js/RequiredDefines.h | 0 .../include/win32}/js/RootingAPI.h | 0 .../include/win32}/js/TemplateLib.h | 0 .../spidermonkey/include/win32}/js/Utility.h | 0 .../spidermonkey/include/win32}/js/Value.h | 0 .../spidermonkey/include/win32}/js/Vector.h | 0 .../spidermonkey/include/win32}/jsalloc.h | 0 .../include/win32}/jsapi.h.REMOVED.git-id | 0 .../spidermonkey/include/win32}/jsclass.h | 0 .../spidermonkey/include/win32}/jsclist.h | 0 .../spidermonkey/include/win32}/jscpucfg.h | 0 .../spidermonkey/include/win32}/jsdbgapi.h | 0 .../spidermonkey/include/win32}/jsdhash.h | 0 .../spidermonkey/include/win32}/jsfriendapi.h | 0 .../spidermonkey/include/win32}/jslock.h | 0 .../spidermonkey/include/win32}/json.h | 0 .../spidermonkey/include/win32}/jsperf.h | 0 .../spidermonkey/include/win32}/jsprf.h | 0 .../include/win32}/jsprototypes.h | 0 .../spidermonkey/include/win32}/jsproxy.h | 0 .../spidermonkey/include/win32}/jsprvtd.h | 0 .../spidermonkey/include/win32}/jspubtd.h | 0 .../spidermonkey/include/win32}/jstypes.h | 0 .../spidermonkey/include/win32}/jsutil.h | 0 .../spidermonkey/include/win32}/jsversion.h | 0 .../spidermonkey/include/win32}/jswrapper.h | 0 .../include/win32}/mozilla/Assertions.h | 0 .../include/win32}/mozilla/Attributes.h | 0 .../include/win32}/mozilla/BloomFilter.h | 0 .../include/win32}/mozilla/Casting.h | 0 .../include/win32}/mozilla/Char16.h | 0 .../include/win32}/mozilla/CheckedInt.h | 0 .../include/win32}/mozilla/Compiler.h | 0 .../include/win32}/mozilla/Constants.h | 0 .../include/win32}/mozilla/DebugOnly.h | 0 .../include/win32}/mozilla/Decimal.h | 0 .../include/win32}/mozilla/Endian.h | 0 .../include/win32}/mozilla/EnumSet.h | 0 .../include/win32}/mozilla/FloatingPoint.h | 0 .../include/win32}/mozilla/GuardObjects.h | 0 .../include/win32}/mozilla/HashFunctions.h | 0 .../include/win32}/mozilla/Likely.h | 0 .../include/win32}/mozilla/LinkedList.h | 0 .../include/win32}/mozilla/MSStdInt.h | 0 .../include/win32}/mozilla/MathAlgorithms.h | 0 .../include/win32}/mozilla/MemoryChecking.h | 0 .../include/win32}/mozilla/NullPtr.h | 0 .../include/win32}/mozilla/PodOperations.h | 0 .../include/win32}/mozilla/Poison.h | 0 .../include/win32}/mozilla/Range.h | 0 .../include/win32}/mozilla/RangedPtr.h | 0 .../include/win32}/mozilla/RefPtr.h | 0 .../include/win32}/mozilla/SHA1.h | 0 .../include/win32}/mozilla/Scoped.h | 0 .../include/win32}/mozilla/SplayTree.h | 0 .../include/win32}/mozilla/StandardInteger.h | 0 .../include/win32}/mozilla/ThreadLocal.h | 0 .../include/win32}/mozilla/TypeTraits.h | 0 .../include/win32}/mozilla/TypedEnum.h | 0 .../include/win32}/mozilla/Types.h | 0 .../include/win32}/mozilla/Util.h | 0 .../include/win32}/mozilla/WeakPtr.h | 0 .../spidermonkey/prebuilt/andorid}/Android.mk | 0 .../armeabi-v7a/libjs_static.a.REMOVED.git-id | 0 .../armeabi/libjs_static.a.REMOVED.git-id | 0 .../x86/libjs_static.a.REMOVED.git-id | 0 .../ios}/libjs_static.a.REMOVED.git-id | 0 .../mac}/libjs_static.a.REMOVED.git-id | 0 .../win32}/mozjs-23.0.dll.REMOVED.git-id | 0 .../win32}/mozjs-23.0.lib.REMOVED.git-id | 0 .../tiff/include/andorid}/tiff.h | 0 .../tiff/include/andorid}/tiffconf.h | 0 .../tiff/include/andorid}/tiffio.h | 0 .../tiff/include/andorid}/tiffvers.h | 0 .../tiff/include/ios}/tiff.h | 0 .../tiff/include/ios}/tiffconf.h | 0 .../tiff/include/ios}/tiffio.h | 0 .../tiff/include/ios}/tiffvers.h | 0 .../tiff/include/linux}/tiff.h | 0 .../tiff/include/linux}/tiffconf.h | 0 .../tiff/include/linux}/tiffio.h | 0 .../tiff/include/linux}/tiffvers.h | 0 .../tiff/include/mac}/tiff.h | 0 .../tiff/include/mac}/tiffconf.h | 0 .../tiff/include/mac}/tiffio.h | 0 .../tiff/include/mac}/tiffvers.h | 0 .../tiff/include/win32}/tiff.h | 0 .../tiff/include/win32}/tiffconf.h | 0 .../tiff/include/win32}/tiffio.h | 0 .../tiff/include/win32}/tiffvers.h | 0 .../tiff/prebuilt/andorid}/Android.mk | 0 .../armeabi-v7a/libtiff.a.REMOVED.git-id | 0 .../andorid}/armeabi/libtiff.a.REMOVED.git-id | 0 .../andorid}/x86/libtiff.a.REMOVED.git-id | 0 .../prebuilt/ios}/libtiff.a.REMOVED.git-id | 0 .../linux/32-bit}/libtiff.a.REMOVED.git-id | 0 .../linux/64-bit}/libtiff.a.REMOVED.git-id | 0 .../prebuilt/mac}/libtiff.a.REMOVED.git-id | 0 .../win32}/libtiff.dll.REMOVED.git-id | 0 .../win32}/libtiff.lib.REMOVED.git-id | 0 .../webp/include/andorid}/decode.h | 0 .../webp/include/andorid}/encode.h | 0 .../webp/include/andorid}/types.h | 0 .../webp/include/ios}/decode.h | 0 .../webp/include/ios}/encode.h | 0 .../webp/include/ios}/types.h | 0 .../webp/include/linux}/decode.h | 0 .../webp/include/linux}/encode.h | 0 .../webp/include/linux}/types.h | 0 .../webp/include/mac}/decode.h | 0 .../webp/include/mac}/encode.h | 0 .../webp/include/mac}/types.h | 0 .../webp/include/win32}/decode.h | 0 .../webp/include/win32}/encode.h | 0 .../webp/include/win32}/types.h | 0 .../webp/prebuilt/andorid}/Android.mk | 0 .../armeabi-v7a/libwebp.a.REMOVED.git-id | 0 .../andorid}/armeabi/libwebp.a.REMOVED.git-id | 0 .../andorid}/x86/libwebp.a.REMOVED.git-id | 0 .../prebuilt/ios}/libwebp.a.REMOVED.git-id | 0 .../linux/32-bit}/libwebp.a.REMOVED.git-id | 0 .../linux/64-bit}/libwebp.a.REMOVED.git-id | 0 .../prebuilt/mac}/libwebp.a.REMOVED.git-id | 0 .../win32}/libwebp.lib.REMOVED.git-id | 0 .../android/Android.mk | 0 .../android/include/libwebsockets.h | 0 .../ios/include/libwebsockets.h | 0 .../ios/lib/libwebsockets.a.REMOVED.git-id | 0 .../mac/include/libwebsockets.h | 0 .../mac/lib/libwebsockets.a.REMOVED.git-id | 0 .../tizen/include/libwebsockets.h | 0 .../lib/armv7l/libwebsockets.a.REMOVED.git-id | 0 .../lib/x86/libwebsockets.a.REMOVED.git-id | 0 .../win32/include/libwebsockets.h | 0 .../win32/include/win32helpers/gettimeofday.h | 0 .../win32/include/win32helpers/websock-w32.h | 0 .../include}/OGLES/GL/glew.h.REMOVED.git-id | 0 .../gles/include}/OGLES/GL/glxew.h | 0 .../gles/include}/OGLES/GL/wglew.h | 0 .../gles/prebuilt}/glew32.dll.REMOVED.git-id | 0 .../gles/prebuilt}/glew32.lib.REMOVED.git-id | 0 .../win32-specific/icon/include}/iconv.h | 0 .../icon/prebuilt}/iconv.dll.REMOVED.git-id | 0 .../win32-specific/zlib/include}/zconf.h | 0 .../win32-specific/zlib/include}/zlib.h | 0 samples/Cpp/HelloCpp/proj.emscripten/Makefile | 58 - samples/Cpp/HelloCpp/proj.emscripten/main.cpp | 19 - samples/Cpp/HelloCpp/proj.nacl/Makefile | 36 - samples/Cpp/HelloCpp/proj.nacl/index.html | 24 - samples/Cpp/HelloCpp/proj.nacl/main.cpp | 32 - samples/Cpp/HelloCpp/proj.nacl/main.h | 7 - samples/Cpp/HelloCpp/proj.qt5/HelloCpp.pro | 14 - samples/Cpp/HelloCpp/proj.qt5/main.cpp | 21 - samples/Cpp/HelloCpp/proj.tizen/.cproject | 651 ---- samples/Cpp/HelloCpp/proj.tizen/.project | 106 - samples/Cpp/HelloCpp/proj.tizen/README.mdown | 6 - samples/Cpp/HelloCpp/proj.tizen/data/.gitkeep | 0 samples/Cpp/HelloCpp/proj.tizen/inc/.gitkeep | 0 samples/Cpp/HelloCpp/proj.tizen/lib/.gitkeep | 0 samples/Cpp/HelloCpp/proj.tizen/manifest.xml | 24 - samples/Cpp/HelloCpp/proj.tizen/res/.gitkeep | 0 .../HelloCpp/proj.tizen/shared/data/.gitkeep | 0 .../proj.tizen/shared/trusted/.gitkeep | 0 .../HelloCpp/proj.tizen/src/HelloCppEntry.cpp | 77 - .../Cpp/SimpleGame/proj.emscripten/Makefile | 71 - .../Cpp/SimpleGame/proj.emscripten/main.cpp | 19 - samples/Cpp/SimpleGame/proj.nacl/Makefile | 42 - samples/Cpp/SimpleGame/proj.nacl/index.html | 23 - samples/Cpp/SimpleGame/proj.nacl/main.cpp | 36 - samples/Cpp/SimpleGame/proj.nacl/main.h | 7 - .../Cpp/SimpleGame/proj.qt5/SimpleGame.pro | 16 - samples/Cpp/SimpleGame/proj.qt5/main.cpp | 20 - samples/Cpp/SimpleGame/proj.tizen/.cproject | 673 ---- samples/Cpp/SimpleGame/proj.tizen/.project | 110 - .../Cpp/SimpleGame/proj.tizen/README.mdown | 6 - .../Cpp/SimpleGame/proj.tizen/data/.gitkeep | 0 .../Cpp/SimpleGame/proj.tizen/lib/.gitkeep | 0 .../Cpp/SimpleGame/proj.tizen/manifest.xml | 24 - .../Cpp/SimpleGame/proj.tizen/res/.gitkeep | 0 .../proj.tizen/shared/data/.gitkeep | 0 .../proj.tizen/shared/trusted/.gitkeep | 0 .../proj.tizen/src/SimpleGameEntry.cpp | 76 - samples/Cpp/TestCpp/proj.emscripten/Makefile | 166 - samples/Cpp/TestCpp/proj.emscripten/main.cpp | 18 - samples/Cpp/TestCpp/proj.nacl/Makefile | 170 - samples/Cpp/TestCpp/proj.nacl/index.html | 22 - samples/Cpp/TestCpp/proj.nacl/main.cpp | 36 - samples/Cpp/TestCpp/proj.nacl/main.h | 7 - samples/Cpp/TestCpp/proj.nacl/res/listener.js | 11 - samples/Cpp/TestCpp/proj.nacl/res/main.js | 16 - .../TestCpp/proj.nacl/res/package_index.html | 23 - samples/Cpp/TestCpp/proj.qt5/TestCpp.pro | 128 - .../TestCpp/proj.qt5/cocos2dx_TestCpp.desktop | 5 - samples/Cpp/TestCpp/proj.qt5/main.cpp | 19 - samples/Cpp/TestCpp/proj.tizen/.cproject | 701 ---- samples/Cpp/TestCpp/proj.tizen/.project | 106 - samples/Cpp/TestCpp/proj.tizen/README.mdown | 6 - samples/Cpp/TestCpp/proj.tizen/data/.gitkeep | 0 samples/Cpp/TestCpp/proj.tizen/inc/.gitkeep | 0 samples/Cpp/TestCpp/proj.tizen/lib/.gitkeep | 0 samples/Cpp/TestCpp/proj.tizen/manifest.xml | 24 - samples/Cpp/TestCpp/proj.tizen/res/.gitignore | 2 - samples/Cpp/TestCpp/proj.tizen/res/.gitkeep | 0 .../TestCpp/proj.tizen/shared/data/.gitkeep | 0 .../proj.tizen/shared/trusted/.gitkeep | 0 .../TestCpp/proj.tizen/src/TestCppEntry.cpp | 76 - samples/Lua/HelloLua/proj.emscripten/Makefile | 28 - samples/Lua/HelloLua/proj.emscripten/main.cpp | 18 - samples/Lua/HelloLua/proj.nacl/Makefile | 67 - samples/Lua/HelloLua/proj.nacl/index.html | 23 - samples/Lua/HelloLua/proj.nacl/main.cpp | 39 - samples/Lua/HelloLua/proj.nacl/main.h | 7 - samples/Lua/HelloLua/proj.tizen/.cproject | 760 ----- samples/Lua/HelloLua/proj.tizen/.project | 110 - samples/Lua/HelloLua/proj.tizen/data/.gitkeep | 0 samples/Lua/HelloLua/proj.tizen/lib/.gitkeep | 0 samples/Lua/HelloLua/proj.tizen/manifest.xml | 24 - samples/Lua/HelloLua/proj.tizen/res/.gitkeep | 0 .../HelloLua/proj.tizen/shared/data/.gitkeep | 0 .../proj.tizen/shared/trusted/.gitkeep | 0 .../HelloLua/proj.tizen/src/HelloLuaEntry.cpp | 76 - samples/Lua/TestLua/proj.emscripten/Makefile | 28 - samples/Lua/TestLua/proj.emscripten/main.cpp | 19 - samples/Lua/TestLua/proj.nacl/Makefile | 69 - samples/Lua/TestLua/proj.nacl/index.html | 23 - samples/Lua/TestLua/proj.nacl/main.cpp | 36 - samples/Lua/TestLua/proj.nacl/main.h | 7 - samples/Lua/TestLua/proj.tizen/.cproject | 692 ---- samples/Lua/TestLua/proj.tizen/.project | 106 - samples/Lua/TestLua/proj.tizen/data/.gitkeep | 0 samples/Lua/TestLua/proj.tizen/inc/.gitkeep | 0 samples/Lua/TestLua/proj.tizen/lib/.gitkeep | 0 samples/Lua/TestLua/proj.tizen/manifest.xml | 24 - samples/Lua/TestLua/proj.tizen/res/.gitkeep | 0 .../TestLua/proj.tizen/shared/data/.gitkeep | 0 .../proj.tizen/shared/trusted/.gitkeep | 0 .../TestLua/proj.tizen/src/TestLuaEntry.cpp | 76 - .../project.pbxproj.REMOVED.git-id | 1 - scripting/auto-generated | 1 - .../bindings/js/debugger/DevToolsUtils.js | 133 - .../javascript/bindings/js/debugger/README.md | 54 - .../bindings/js/debugger/actors/root.js | 329 -- .../bindings/js/debugger/actors/script.js | 2948 ----------------- .../bindings/js/debugger/core/promise.js | 294 -- .../javascript/bindings/js/debugger/main.js | 928 ------ .../bindings/js/debugger/transport.js | 288 -- scripting/lua/proj.emscripten/Makefile | 77 - scripting/lua/proj.nacl/Makefile | 57 - scripting/lua/proj.qt5/lua.pro | 33 - scripting/lua/proj.tizen/.cproject | 349 -- scripting/lua/proj.tizen/.project | 106 - scripting/lua/proj.tizen/src/placeholder.txt | 0 tools/android-buildsetup.sh | 85 - .../android_mk_generator.py | 0 .../config.py | 0 tools/emscripten-templates/basic/index.html | 146 - .../iphone-ipad-ipadhd/index.html | 181 - .../Monkeyrunner_TestCpp.py | 0 .../ReportManager.py | 0 .../ant.properties | 0 .../build.xml | 0 .../android/build-android-2.2-3.2-debug.sh | 0 .../android/build-android-2.2-3.2-release.sh | 0 .../mac/android/build-android-4.x-debug.sh | 0 .../mac/android/build-android-4.x-release.sh | 0 .../mac/android/generate-js-cxx-bindings.sh | 0 .../mac/android/test-android-2.2-3.2-debug.sh | 0 .../android/test-android-2.2-3.2-release.sh | 0 .../mac/android/test-android-4.x-debug.sh | 0 .../mac/android/test-android-4.x-release.sh | 0 .../mac/debug.keystore | Bin .../iOS_SikuliTest.sikuli/iOS_SikuliTest.html | 0 .../iOS_SikuliTest.sikuli/iOS_SikuliTest.py | 0 .../mac/ios/build-ios-all.sh | 0 .../mac/ios/build-ios-debug.sh | 0 .../mac/ios/build-ios-release.sh | 0 .../mac/ios/iphonesim | Bin .../mac/ios/test-ios-debug.sh | 0 .../mac/ios/test-ios-release.sh | 0 .../mac/mac/build-mac-all.sh | 0 .../mac/mac/build-mac-debug.sh | 0 .../mac/mac/build-mac-release.sh | 0 .../mac/mac/test-mac-debug.sh | 0 .../mac/mac/test-mac-release.sh | 0 .../mac/rootconfig-mac.sh | 0 .../windows/android/androidtestcommon.bat | 0 .../android/build-android-2.2-3.2-debug.bat | 0 .../android/build-android-2.2-3.2-release.bat | 0 .../android/build-android-4.x-debug.bat | 0 .../android/build-android-4.x-release.bat | 0 .../windows/android/rootconfig.sh | 0 .../android/test-android-2.2-3.2-debug.bat | 0 .../android/test-android-2.2-3.2-release.bat | 0 .../android/test-android-4.x-debug.bat | 0 .../android/test-android-4.x-release.bat | 0 .../ObjectRepository.bdb.REMOVED.git-id | 0 .../win32/qtp_win32/Action0/Resource.mtr | Bin .../win32/qtp_win32/Action0/Script.mts | 0 .../ObjectRepository.bdb.REMOVED.git-id | 0 .../win32/qtp_win32/Action1/Resource.mtr | Bin .../win32/qtp_win32/Action1/Script.mts | 0 .../windows/win32/qtp_win32/Default.xls | Bin .../windows/win32/qtp_win32/Error_Sub.vbs | Bin .../win32/qtp_win32/Error_appcrash.qrs | Bin .../windows/win32/qtp_win32/Parameters.mtr | Bin .../windows/win32/qtp_win32/Test.tsp | Bin .../TestCpp_Appcrash.tsr.REMOVED.git-id | 0 .../windows/win32/qtp_win32/default.cfg | 0 .../windows/win32/qtp_win32/default.usp | 0 .../windows/win32/qtp_win32/lock.lck | Bin .../windows/win32/qtp_win32/qtp_win32.usr | 0 .../windows/win32/qtp_win32/qtrunner.vbs | Bin .../windows/win32/test-win-vs2008-debug.bat | 0 .../windows/win32/test-win-vs2008_release.bat | 0 .../windows/win32/test-win-vs2010_debug.bat | 0 .../windows/win32/test-win-vs2010_release.bat | 0 .../__init__.py | 0 .../create_project.py | 0 2737 files changed, 10 insertions(+), 143282 deletions(-) delete mode 100644 audio/emscripten/SimpleAudioEngine.cpp delete mode 100644 audio/proj.emscripten/Makefile delete mode 100644 audio/proj.ios/CocosDenshion.xcodeproj/project.pbxproj delete mode 100644 audio/proj.mac/CocosDenshion.xcodeproj/project.pbxproj delete mode 100644 audio/proj.nacl/Makefile delete mode 100644 audio/proj.qt5/cocosdenshion.pro delete mode 100644 audio/proj.tizen/.cproject delete mode 100644 audio/proj.tizen/.project delete mode 100644 audio/proj.tizen/src/placeholder.txt delete mode 100644 audio/qt5/SimpleAudioEngineQt5.cpp delete mode 100755 build-emscripten.sh delete mode 100755 build-nacl.sh delete mode 100644 build-win32.bat rename Makefile => build/Makefile (100%) rename cocos2d-win32.vc2012.sln => build/cocos2d-win32.vc2012.sln (100%) create mode 100644 build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id rename install-deps-linux.sh => build/install-deps-linux.sh (100%) rename make-all-linux-project.sh => build/make-all-linux-project.sh (100%) create mode 100644 build/samples.xcodeproj/project.pbxproj.REMOVED.git-id rename {cocos2dx => cocos/2d}/Android.mk (100%) rename {cocos2dx => cocos/2d}/CCCamera.cpp (100%) rename {cocos2dx => cocos/2d}/CCCamera.h (100%) rename {cocos2dx => cocos/2d}/CCConfiguration.cpp (100%) rename {cocos2dx => cocos/2d}/CCConfiguration.h (100%) rename {cocos2dx => cocos/2d}/CCDeprecated.cpp (100%) rename {cocos2dx => cocos/2d}/CCDirector.cpp (100%) rename {cocos2dx => cocos/2d}/CCDirector.h (100%) rename {cocos2dx => cocos/2d}/CCScheduler.cpp (100%) rename {cocos2dx => cocos/2d}/CCScheduler.h (100%) rename {cocos2dx => cocos/2d}/actions/CCAction.cpp (100%) rename {cocos2dx => cocos/2d}/actions/CCAction.h (100%) rename {cocos2dx => cocos/2d}/actions/CCActionCamera.cpp (100%) rename {cocos2dx => cocos/2d}/actions/CCActionCamera.h (100%) rename {cocos2dx => cocos/2d}/actions/CCActionCatmullRom.cpp (100%) rename {cocos2dx => cocos/2d}/actions/CCActionCatmullRom.h (100%) rename {cocos2dx => cocos/2d}/actions/CCActionEase.cpp (100%) rename {cocos2dx => cocos/2d}/actions/CCActionEase.h (100%) rename {cocos2dx => cocos/2d}/actions/CCActionGrid.cpp (100%) rename {cocos2dx => cocos/2d}/actions/CCActionGrid.h (100%) rename {cocos2dx => cocos/2d}/actions/CCActionGrid3D.cpp (100%) rename {cocos2dx => cocos/2d}/actions/CCActionGrid3D.h (100%) rename {cocos2dx => cocos/2d}/actions/CCActionInstant.cpp (100%) rename {cocos2dx => cocos/2d}/actions/CCActionInstant.h (100%) rename {cocos2dx => cocos/2d}/actions/CCActionInterval.cpp (100%) rename {cocos2dx => cocos/2d}/actions/CCActionInterval.h (100%) rename {cocos2dx => cocos/2d}/actions/CCActionManager.cpp (100%) rename {cocos2dx => cocos/2d}/actions/CCActionManager.h (100%) rename {cocos2dx => cocos/2d}/actions/CCActionPageTurn3D.cpp (100%) rename {cocos2dx => cocos/2d}/actions/CCActionPageTurn3D.h (100%) rename {cocos2dx => cocos/2d}/actions/CCActionProgressTimer.cpp (100%) rename {cocos2dx => cocos/2d}/actions/CCActionProgressTimer.h (100%) rename {cocos2dx => cocos/2d}/actions/CCActionTiledGrid.cpp (100%) rename {cocos2dx => cocos/2d}/actions/CCActionTiledGrid.h (100%) rename {cocos2dx => cocos/2d}/actions/CCActionTween.cpp (100%) rename {cocos2dx => cocos/2d}/actions/CCActionTween.h (100%) rename {cocos2dx/base_nodes => cocos/2d/base-nodes}/CCAtlasNode.cpp (100%) rename {cocos2dx/base_nodes => cocos/2d/base-nodes}/CCAtlasNode.h (100%) rename {cocos2dx/base_nodes => cocos/2d/base-nodes}/CCGLBufferedNode.cpp (100%) rename {cocos2dx/base_nodes => cocos/2d/base-nodes}/CCGLBufferedNode.h (100%) rename {cocos2dx/base_nodes => cocos/2d/base-nodes}/CCNode.cpp (100%) rename {cocos2dx/base_nodes => cocos/2d/base-nodes}/CCNode.h (100%) rename {cocos2dx => cocos/2d}/ccFPSImages.c (100%) rename {cocos2dx => cocos/2d}/ccFPSImages.h (100%) rename {cocos2dx => cocos/2d}/ccTypes.cpp (100%) rename {cocos2dx => cocos/2d}/cocos2d.cpp (100%) rename {cocos2dx => cocos/2d}/cocos2dx-Prefix.pch (100%) rename {cocos2dx/draw_nodes => cocos/2d/draw-nodes}/CCDrawNode.cpp (100%) rename {cocos2dx/draw_nodes => cocos/2d/draw-nodes}/CCDrawNode.h (100%) rename {cocos2dx/draw_nodes => cocos/2d/draw-nodes}/CCDrawingPrimitives.cpp (100%) rename {cocos2dx/draw_nodes => cocos/2d/draw-nodes}/CCDrawingPrimitives.h (100%) rename {cocos2dx => cocos/2d}/effects/CCGrabber.cpp (100%) rename {cocos2dx => cocos/2d}/effects/CCGrabber.h (100%) rename {cocos2dx => cocos/2d}/effects/CCGrid.cpp (100%) rename {cocos2dx => cocos/2d}/effects/CCGrid.h (100%) rename {cocos2dx/event_dispatcher => cocos/2d/event-dispatcher}/CCEvent.cpp (100%) rename {cocos2dx/event_dispatcher => cocos/2d/event-dispatcher}/CCEvent.h (100%) rename {cocos2dx/event_dispatcher => cocos/2d/event-dispatcher}/CCEventAcceleration.cpp (100%) rename {cocos2dx/event_dispatcher => cocos/2d/event-dispatcher}/CCEventAcceleration.h (100%) rename {cocos2dx/event_dispatcher => cocos/2d/event-dispatcher}/CCEventCustom.cpp (100%) rename {cocos2dx/event_dispatcher => cocos/2d/event-dispatcher}/CCEventCustom.h (100%) rename {cocos2dx/event_dispatcher => cocos/2d/event-dispatcher}/CCEventDispatcher.cpp (100%) rename {cocos2dx/event_dispatcher => cocos/2d/event-dispatcher}/CCEventDispatcher.h (100%) rename {cocos2dx/event_dispatcher => cocos/2d/event-dispatcher}/CCEventKeyboard.cpp (100%) rename {cocos2dx/event_dispatcher => cocos/2d/event-dispatcher}/CCEventKeyboard.h (100%) rename {cocos2dx/event_dispatcher => cocos/2d/event-dispatcher}/CCEventListener.cpp (100%) rename {cocos2dx/event_dispatcher => cocos/2d/event-dispatcher}/CCEventListener.h (100%) rename {cocos2dx/event_dispatcher => cocos/2d/event-dispatcher}/CCEventListenerAcceleration.cpp (100%) rename {cocos2dx/event_dispatcher => cocos/2d/event-dispatcher}/CCEventListenerAcceleration.h (100%) rename {cocos2dx/event_dispatcher => cocos/2d/event-dispatcher}/CCEventListenerCustom.cpp (100%) rename {cocos2dx/event_dispatcher => cocos/2d/event-dispatcher}/CCEventListenerCustom.h (100%) rename {cocos2dx/event_dispatcher => cocos/2d/event-dispatcher}/CCEventListenerKeyboard.cpp (100%) rename {cocos2dx/event_dispatcher => cocos/2d/event-dispatcher}/CCEventListenerKeyboard.h (100%) rename {cocos2dx/event_dispatcher => cocos/2d/event-dispatcher}/CCEventListenerTouch.cpp (100%) rename {cocos2dx/event_dispatcher => cocos/2d/event-dispatcher}/CCEventListenerTouch.h (100%) rename {cocos2dx/event_dispatcher => cocos/2d/event-dispatcher}/CCEventTouch.cpp (100%) rename {cocos2dx/event_dispatcher => cocos/2d/event-dispatcher}/CCEventTouch.h (100%) rename {cocos2dx/event_dispatcher => cocos/2d/event-dispatcher}/CCTouch.cpp (100%) rename {cocos2dx/event_dispatcher => cocos/2d/event-dispatcher}/CCTouch.h (100%) rename {cocos2dx => cocos/2d}/include/CCDeprecated.h (100%) rename {cocos2dx => cocos/2d}/include/CCEventType.h (100%) rename {cocos2dx => cocos/2d}/include/CCProtocols.h (100%) rename {cocos2dx => cocos/2d}/include/ccConfig.h (100%) rename {cocos2dx => cocos/2d}/include/ccMacros.h (100%) rename {cocos2dx => cocos/2d}/include/ccTypes.h (100%) rename {cocos2dx => cocos/2d}/include/cocos2d.h (84%) rename {cocos2dx/label_nodes => cocos/2d/label-nodes}/CCFont.cpp (100%) rename {cocos2dx/label_nodes => cocos/2d/label-nodes}/CCFont.h (100%) rename {cocos2dx/label_nodes => cocos/2d/label-nodes}/CCFontAtlas.cpp (100%) rename {cocos2dx/label_nodes => cocos/2d/label-nodes}/CCFontAtlas.h (100%) rename {cocos2dx/label_nodes => cocos/2d/label-nodes}/CCFontAtlasCache.cpp (100%) rename {cocos2dx/label_nodes => cocos/2d/label-nodes}/CCFontAtlasCache.h (100%) rename {cocos2dx/label_nodes => cocos/2d/label-nodes}/CCFontAtlasFactory.cpp (100%) rename {cocos2dx/label_nodes => cocos/2d/label-nodes}/CCFontAtlasFactory.h (100%) rename {cocos2dx/label_nodes => cocos/2d/label-nodes}/CCFontDefinition.cpp (100%) rename {cocos2dx/label_nodes => cocos/2d/label-nodes}/CCFontDefinition.h (100%) rename {cocos2dx/label_nodes => cocos/2d/label-nodes}/CCFontFNT.cpp (100%) rename {cocos2dx/label_nodes => cocos/2d/label-nodes}/CCFontFNT.h (100%) rename {cocos2dx/label_nodes => cocos/2d/label-nodes}/CCFontFreeType.cpp (100%) rename {cocos2dx/label_nodes => cocos/2d/label-nodes}/CCFontFreeType.h (100%) rename {cocos2dx/label_nodes => cocos/2d/label-nodes}/CCLabel.cpp (100%) rename {cocos2dx/label_nodes => cocos/2d/label-nodes}/CCLabel.h (100%) rename {cocos2dx/label_nodes => cocos/2d/label-nodes}/CCLabelAtlas.cpp (100%) rename {cocos2dx/label_nodes => cocos/2d/label-nodes}/CCLabelAtlas.h (100%) rename {cocos2dx/label_nodes => cocos/2d/label-nodes}/CCLabelBMFont.cpp (100%) rename {cocos2dx/label_nodes => cocos/2d/label-nodes}/CCLabelBMFont.h (100%) rename {cocos2dx/label_nodes => cocos/2d/label-nodes}/CCLabelTTF.cpp (100%) rename {cocos2dx/label_nodes => cocos/2d/label-nodes}/CCLabelTTF.h (100%) rename {cocos2dx/label_nodes => cocos/2d/label-nodes}/CCLabelTextFormatProtocol.h (100%) rename {cocos2dx/label_nodes => cocos/2d/label-nodes}/CCLabelTextFormatter.cpp (100%) rename {cocos2dx/label_nodes => cocos/2d/label-nodes}/CCLabelTextFormatter.h (100%) rename {cocos2dx/label_nodes => cocos/2d/label-nodes}/CCTextImage.cpp (100%) rename {cocos2dx/label_nodes => cocos/2d/label-nodes}/CCTextImage.h (100%) rename {cocos2dx/layers_scenes_transitions_nodes => cocos/2d/layers-scenes-transitions-nodes}/CCLayer.cpp (100%) rename {cocos2dx/layers_scenes_transitions_nodes => cocos/2d/layers-scenes-transitions-nodes}/CCLayer.h (100%) rename {cocos2dx/layers_scenes_transitions_nodes => cocos/2d/layers-scenes-transitions-nodes}/CCScene.cpp (100%) rename {cocos2dx/layers_scenes_transitions_nodes => cocos/2d/layers-scenes-transitions-nodes}/CCScene.h (100%) rename {cocos2dx/layers_scenes_transitions_nodes => cocos/2d/layers-scenes-transitions-nodes}/CCTransition.cpp (100%) rename {cocos2dx/layers_scenes_transitions_nodes => cocos/2d/layers-scenes-transitions-nodes}/CCTransition.h (100%) rename {cocos2dx/layers_scenes_transitions_nodes => cocos/2d/layers-scenes-transitions-nodes}/CCTransitionPageTurn.cpp (100%) rename {cocos2dx/layers_scenes_transitions_nodes => cocos/2d/layers-scenes-transitions-nodes}/CCTransitionPageTurn.h (100%) rename {cocos2dx/layers_scenes_transitions_nodes => cocos/2d/layers-scenes-transitions-nodes}/CCTransitionProgress.cpp (100%) rename {cocos2dx/layers_scenes_transitions_nodes => cocos/2d/layers-scenes-transitions-nodes}/CCTransitionProgress.h (100%) rename {cocos2dx/menu_nodes => cocos/2d/menu-nodes}/CCMenu.cpp (100%) rename {cocos2dx/menu_nodes => cocos/2d/menu-nodes}/CCMenu.h (100%) rename {cocos2dx/menu_nodes => cocos/2d/menu-nodes}/CCMenuItem.cpp (100%) rename {cocos2dx/menu_nodes => cocos/2d/menu-nodes}/CCMenuItem.h (100%) rename {cocos2dx/misc_nodes => cocos/2d/misc-nodes}/CCClippingNode.cpp (100%) rename {cocos2dx/misc_nodes => cocos/2d/misc-nodes}/CCClippingNode.h (100%) rename {cocos2dx/misc_nodes => cocos/2d/misc-nodes}/CCMotionStreak.cpp (100%) rename {cocos2dx/misc_nodes => cocos/2d/misc-nodes}/CCMotionStreak.h (100%) rename {cocos2dx/misc_nodes => cocos/2d/misc-nodes}/CCProgressTimer.cpp (100%) rename {cocos2dx/misc_nodes => cocos/2d/misc-nodes}/CCProgressTimer.h (100%) rename {cocos2dx/misc_nodes => cocos/2d/misc-nodes}/CCRenderTexture.cpp (100%) rename {cocos2dx/misc_nodes => cocos/2d/misc-nodes}/CCRenderTexture.h (100%) rename {cocos2dx/particle_nodes => cocos/2d/particle-nodes}/CCParticleBatchNode.cpp (100%) rename {cocos2dx/particle_nodes => cocos/2d/particle-nodes}/CCParticleBatchNode.h (100%) rename {cocos2dx/particle_nodes => cocos/2d/particle-nodes}/CCParticleExamples.cpp (100%) rename {cocos2dx/particle_nodes => cocos/2d/particle-nodes}/CCParticleExamples.h (100%) rename {cocos2dx/particle_nodes => cocos/2d/particle-nodes}/CCParticleSystem.cpp (100%) rename {cocos2dx/particle_nodes => cocos/2d/particle-nodes}/CCParticleSystem.h (100%) rename {cocos2dx/particle_nodes => cocos/2d/particle-nodes}/CCParticleSystemQuad.cpp (100%) rename {cocos2dx/particle_nodes => cocos/2d/particle-nodes}/CCParticleSystemQuad.h (100%) rename {cocos2dx/particle_nodes => cocos/2d/particle-nodes}/firePngData.h (100%) rename {cocos2dx => cocos/2d}/platform/CCApplicationProtocol.h (100%) rename {cocos2dx => cocos/2d}/platform/CCCommon.h (100%) rename {cocos2dx => cocos/2d}/platform/CCDevice.h (100%) rename {cocos2dx => cocos/2d}/platform/CCEGLViewProtocol.cpp (100%) rename {cocos2dx => cocos/2d}/platform/CCEGLViewProtocol.h (100%) rename {cocos2dx => cocos/2d}/platform/CCFileUtils.cpp (100%) rename {cocos2dx => cocos/2d}/platform/CCFileUtils.h (100%) rename {cocos2dx => cocos/2d}/platform/CCImage.h (100%) rename {cocos2dx => cocos/2d}/platform/CCImageCommon_cpp.h (100%) rename {cocos2dx => cocos/2d}/platform/CCSAXParser.cpp (100%) rename {cocos2dx => cocos/2d}/platform/CCSAXParser.h (100%) rename {cocos2dx => cocos/2d}/platform/CCThread.cpp (100%) rename {cocos2dx => cocos/2d}/platform/CCThread.h (100%) rename {cocos2dx => cocos/2d}/platform/android/Android.mk (100%) rename {cocos2dx => cocos/2d}/platform/android/CCApplication.cpp (100%) rename {cocos2dx => cocos/2d}/platform/android/CCApplication.h (100%) rename {cocos2dx => cocos/2d}/platform/android/CCCommon.cpp (100%) rename {cocos2dx => cocos/2d}/platform/android/CCDevice.cpp (100%) rename {cocos2dx => cocos/2d}/platform/android/CCEGLView.cpp (100%) rename {cocos2dx => cocos/2d}/platform/android/CCEGLView.h (100%) rename {cocos2dx => cocos/2d}/platform/android/CCFileUtilsAndroid.cpp (100%) rename {cocos2dx => cocos/2d}/platform/android/CCFileUtilsAndroid.h (100%) rename {cocos2dx => cocos/2d}/platform/android/CCGL.h (100%) rename {cocos2dx => cocos/2d}/platform/android/CCImage.cpp (100%) rename {cocos2dx => cocos/2d}/platform/android/CCPlatformDefine.h (100%) rename {cocos2dx => cocos/2d}/platform/android/CCStdC.h (100%) rename {cocos2dx => cocos/2d}/platform/android/java/.classpath (100%) rename {cocos2dx => cocos/2d}/platform/android/java/.project (100%) rename {cocos2dx => cocos/2d}/platform/android/java/.settings/org.eclipse.jdt.core.prefs (100%) rename {cocos2dx => cocos/2d}/platform/android/java/AndroidManifest.xml (100%) rename {cocos2dx => cocos/2d}/platform/android/java/ant.properties (100%) rename {cocos2dx => cocos/2d}/platform/android/java/build.xml (100%) rename {cocos2dx => cocos/2d}/platform/android/java/proguard-project.txt (100%) rename {cocos2dx => cocos/2d}/platform/android/java/project.properties (100%) rename {cocos2dx => cocos/2d}/platform/android/java/res/.gitignore (100%) rename {cocos2dx => cocos/2d}/platform/android/java/src/org/cocos2dx/lib/Cocos2dxBitmap.java (100%) rename {cocos2dx => cocos/2d}/platform/android/java/src/org/cocos2dx/lib/Cocos2dxEditBoxDialog.java (100%) rename {cocos2dx => cocos/2d}/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHelper.java (100%) rename {cocos2dx => cocos/2d}/platform/android/java/src/org/cocos2dx/lib/Cocos2dxLocalStorage.java (100%) rename {cocos2dx => cocos/2d}/platform/android/java/src/org/cocos2dx/lib/Cocos2dxLuaJavaBridge.java (100%) rename {cocos2dx => cocos/2d}/platform/android/java/src/org/cocos2dx/lib/Cocos2dxMusic.java (100%) rename {cocos2dx => cocos/2d}/platform/android/java/src/org/cocos2dx/lib/Cocos2dxSound.java (100%) rename {cocos2dx => cocos/2d}/platform/android/java/src/org/cocos2dx/lib/Cocos2dxTypefaces.java (100%) rename {cocos2dx => cocos/2d}/platform/android/jni/DPIJni.cpp (100%) rename {cocos2dx => cocos/2d}/platform/android/jni/DPIJni.h (100%) rename {cocos2dx => cocos/2d}/platform/android/jni/IMEJni.cpp (100%) rename {cocos2dx => cocos/2d}/platform/android/jni/IMEJni.h (100%) rename {cocos2dx => cocos/2d}/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxBitmap.cpp (100%) rename {cocos2dx => cocos/2d}/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxBitmap.h (100%) rename {cocos2dx => cocos/2d}/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.cpp (100%) rename {cocos2dx => cocos/2d}/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.h (100%) rename {cocos2dx => cocos/2d}/platform/android/jni/JniHelper.cpp (100%) rename {cocos2dx => cocos/2d}/platform/android/jni/JniHelper.h (100%) rename {cocos2dx => cocos/2d}/platform/android/nativeactivity.cpp (100%) rename {cocos2dx => cocos/2d}/platform/android/nativeactivity.h (100%) rename {cocos2dx => cocos/2d}/platform/apple/CCFileUtilsApple.h (100%) rename {cocos2dx => cocos/2d}/platform/apple/CCFileUtilsApple.mm (100%) rename {cocos2dx => cocos/2d}/platform/apple/CCLock.cpp (100%) rename {cocos2dx => cocos/2d}/platform/apple/CCLock.h (100%) rename {cocos2dx => cocos/2d}/platform/apple/CCThread.mm (100%) rename {cocos2dx => cocos/2d}/platform/ios/CCApplication.h (100%) rename {cocos2dx => cocos/2d}/platform/ios/CCApplication.mm (100%) rename {cocos2dx => cocos/2d}/platform/ios/CCCommon.mm (100%) rename {cocos2dx => cocos/2d}/platform/ios/CCDevice.mm (100%) rename {cocos2dx => cocos/2d}/platform/ios/CCDirectorCaller.h (100%) rename {cocos2dx => cocos/2d}/platform/ios/CCDirectorCaller.mm (100%) rename {cocos2dx => cocos/2d}/platform/ios/CCEGLView.h (100%) rename {cocos2dx => cocos/2d}/platform/ios/CCEGLView.mm (100%) rename {cocos2dx => cocos/2d}/platform/ios/CCES2Renderer.h (100%) rename {cocos2dx => cocos/2d}/platform/ios/CCES2Renderer.m (100%) rename {cocos2dx => cocos/2d}/platform/ios/CCESRenderer.h (100%) rename {cocos2dx => cocos/2d}/platform/ios/CCGL.h (100%) rename {cocos2dx => cocos/2d}/platform/ios/CCImage.mm (100%) rename {cocos2dx/platform/emscripten => cocos/2d/platform/ios}/CCPlatformDefine.h (100%) rename {cocos2dx => cocos/2d}/platform/ios/CCStdC.h (100%) rename {cocos2dx => cocos/2d}/platform/ios/EAGLView.h (100%) rename {cocos2dx => cocos/2d}/platform/ios/EAGLView.mm (100%) rename {cocos2dx => cocos/2d}/platform/ios/OpenGL_Internal.h (100%) rename {cocos2dx => cocos/2d}/platform/ios/Simulation/AccelerometerSimulation.h (100%) rename {cocos2dx => cocos/2d}/platform/ios/Simulation/AccelerometerSimulation.m (100%) rename {cocos2dx => cocos/2d}/platform/linux/CCApplication.cpp (100%) rename {cocos2dx => cocos/2d}/platform/linux/CCApplication.h (100%) rename {cocos2dx => cocos/2d}/platform/linux/CCCommon.cpp (100%) rename {cocos2dx => cocos/2d}/platform/linux/CCDevice.cpp (100%) rename {cocos2dx => cocos/2d}/platform/linux/CCEGLView.cpp (100%) rename {cocos2dx => cocos/2d}/platform/linux/CCEGLView.h (100%) rename {cocos2dx => cocos/2d}/platform/linux/CCFileUtilsLinux.cpp (100%) rename {cocos2dx => cocos/2d}/platform/linux/CCFileUtilsLinux.h (100%) rename {cocos2dx => cocos/2d}/platform/linux/CCGL.h (100%) rename {cocos2dx => cocos/2d}/platform/linux/CCImage.cpp (100%) rename {cocos2dx => cocos/2d}/platform/linux/CCPlatformDefine.h (100%) rename {cocos2dx => cocos/2d}/platform/linux/CCStdC.cpp (100%) rename {cocos2dx => cocos/2d}/platform/linux/CCStdC.h (100%) rename {cocos2dx => cocos/2d}/platform/mac/CCApplication.h (100%) rename {cocos2dx => cocos/2d}/platform/mac/CCApplication.mm (100%) rename {cocos2dx => cocos/2d}/platform/mac/CCCommon.mm (100%) rename {cocos2dx => cocos/2d}/platform/mac/CCDevice.mm (100%) rename {cocos2dx => cocos/2d}/platform/mac/CCDirectorCaller.h (100%) rename {cocos2dx => cocos/2d}/platform/mac/CCDirectorCaller.mm (100%) rename {cocos2dx => cocos/2d}/platform/mac/CCEGLView.h (100%) rename {cocos2dx => cocos/2d}/platform/mac/CCEGLView.mm (100%) rename {cocos2dx => cocos/2d}/platform/mac/CCEventDispatcher.h (100%) rename {cocos2dx => cocos/2d}/platform/mac/CCEventDispatcher.mm (100%) rename {cocos2dx => cocos/2d}/platform/mac/CCGL.h (100%) rename {cocos2dx => cocos/2d}/platform/mac/CCImage.mm (100%) rename {cocos2dx => cocos/2d}/platform/mac/CCPlatformDefine.h (100%) rename {cocos2dx => cocos/2d}/platform/mac/CCStdC.h (100%) rename {cocos2dx => cocos/2d}/platform/mac/CCWindow.h (100%) rename {cocos2dx => cocos/2d}/platform/mac/CCWindow.m (100%) rename {cocos2dx => cocos/2d}/platform/mac/EAGLView.h (100%) rename {cocos2dx => cocos/2d}/platform/mac/EAGLView.mm (100%) rename {cocos2dx => cocos/2d}/platform/win32/CCApplication.cpp (100%) rename {cocos2dx => cocos/2d}/platform/win32/CCApplication.h (100%) rename {cocos2dx => cocos/2d}/platform/win32/CCCommon.cpp (100%) rename {cocos2dx => cocos/2d}/platform/win32/CCDevice.cpp (100%) rename {cocos2dx => cocos/2d}/platform/win32/CCEGLView.cpp (100%) rename {cocos2dx => cocos/2d}/platform/win32/CCEGLView.h (100%) rename {cocos2dx => cocos/2d}/platform/win32/CCFileUtilsWin32.cpp (100%) rename {cocos2dx => cocos/2d}/platform/win32/CCFileUtilsWin32.h (100%) rename {cocos2dx => cocos/2d}/platform/win32/CCGL.h (100%) rename {cocos2dx => cocos/2d}/platform/win32/CCImage.cpp (100%) rename {cocos2dx => cocos/2d}/platform/win32/CCPlatformDefine.h (100%) rename {cocos2dx => cocos/2d}/platform/win32/CCStdC.cpp (100%) rename {cocos2dx => cocos/2d}/platform/win32/CCStdC.h (100%) rename {cocos2dx => cocos/2d}/platform/win32/compat/stdint.h (100%) rename {cocos2dx => cocos/2d}/proj.linux/.cproject (100%) rename {cocos2dx => cocos/2d}/proj.linux/.project (100%) rename {cocos2dx => cocos/2d}/proj.linux/Makefile (100%) rename {cocos2dx => cocos/2d}/proj.linux/cocos2dx.mk (100%) rename {cocos2dx => cocos/2d}/proj.linux/cocos2dx.prf (100%) rename {cocos2dx => cocos/2d}/proj.linux/cocos2dx.pri (100%) rename {cocos2dx => cocos/2d}/proj.win32/cocos2d.vcxproj (100%) rename {cocos2dx => cocos/2d}/proj.win32/cocos2d.vcxproj.filters (100%) rename {cocos2dx => cocos/2d}/proj.win32/cocos2d.vcxproj.user (100%) rename {cocos2dx => cocos/2d}/proj.win32/cocos2dx.props (100%) rename {cocos2dx/script_support => cocos/2d/script-support}/CCScriptSupport.cpp (100%) rename {cocos2dx/script_support => cocos/2d/script-support}/CCScriptSupport.h (100%) rename {cocos2dx => cocos/2d}/shaders/CCGLProgram.cpp (100%) rename {cocos2dx => cocos/2d}/shaders/CCGLProgram.h (100%) rename {cocos2dx => cocos/2d}/shaders/CCShaderCache.cpp (100%) rename {cocos2dx => cocos/2d}/shaders/CCShaderCache.h (100%) rename {cocos2dx => cocos/2d}/shaders/ccGLStateCache.cpp (100%) rename {cocos2dx => cocos/2d}/shaders/ccGLStateCache.h (100%) rename {cocos2dx => cocos/2d}/shaders/ccShaderEx_SwitchMask_frag.h (100%) rename {cocos2dx => cocos/2d}/shaders/ccShader_PositionColorLengthTexture_frag.h (100%) rename {cocos2dx => cocos/2d}/shaders/ccShader_PositionColorLengthTexture_vert.h (100%) rename {cocos2dx => cocos/2d}/shaders/ccShader_PositionColor_frag.h (100%) rename {cocos2dx => cocos/2d}/shaders/ccShader_PositionColor_vert.h (100%) rename {cocos2dx => cocos/2d}/shaders/ccShader_PositionTextureA8Color_frag.h (100%) rename {cocos2dx => cocos/2d}/shaders/ccShader_PositionTextureA8Color_vert.h (100%) rename {cocos2dx => cocos/2d}/shaders/ccShader_PositionTextureColorAlphaTest_frag.h (100%) rename {cocos2dx => cocos/2d}/shaders/ccShader_PositionTextureColor_frag.h (100%) rename {cocos2dx => cocos/2d}/shaders/ccShader_PositionTextureColor_vert.h (100%) rename {cocos2dx => cocos/2d}/shaders/ccShader_PositionTexture_frag.h (100%) rename {cocos2dx => cocos/2d}/shaders/ccShader_PositionTexture_uColor_frag.h (100%) rename {cocos2dx => cocos/2d}/shaders/ccShader_PositionTexture_uColor_vert.h (100%) rename {cocos2dx => cocos/2d}/shaders/ccShader_PositionTexture_vert.h (100%) rename {cocos2dx => cocos/2d}/shaders/ccShader_Position_uColor_frag.h (100%) rename {cocos2dx => cocos/2d}/shaders/ccShader_Position_uColor_vert.h (100%) rename {cocos2dx => cocos/2d}/shaders/ccShaders.cpp (100%) rename {cocos2dx => cocos/2d}/shaders/ccShaders.h (100%) rename {cocos2dx/sprite_nodes => cocos/2d/sprite-nodes}/CCAnimation.cpp (100%) rename {cocos2dx/sprite_nodes => cocos/2d/sprite-nodes}/CCAnimation.h (100%) rename {cocos2dx/sprite_nodes => cocos/2d/sprite-nodes}/CCAnimationCache.cpp (100%) rename {cocos2dx/sprite_nodes => cocos/2d/sprite-nodes}/CCAnimationCache.h (100%) rename {cocos2dx/sprite_nodes => cocos/2d/sprite-nodes}/CCSprite.cpp (100%) rename {cocos2dx/sprite_nodes => cocos/2d/sprite-nodes}/CCSprite.h (100%) rename {cocos2dx/sprite_nodes => cocos/2d/sprite-nodes}/CCSpriteBatchNode.cpp (100%) rename {cocos2dx/sprite_nodes => cocos/2d/sprite-nodes}/CCSpriteBatchNode.h (100%) rename {cocos2dx/sprite_nodes => cocos/2d/sprite-nodes}/CCSpriteFrame.cpp (100%) rename {cocos2dx/sprite_nodes => cocos/2d/sprite-nodes}/CCSpriteFrame.h (100%) rename {cocos2dx/sprite_nodes => cocos/2d/sprite-nodes}/CCSpriteFrameCache.cpp (100%) rename {cocos2dx/sprite_nodes => cocos/2d/sprite-nodes}/CCSpriteFrameCache.h (100%) rename {cocos2dx => cocos/2d}/support/CCNotificationCenter.cpp (100%) rename {cocos2dx => cocos/2d}/support/CCNotificationCenter.h (100%) rename {cocos2dx => cocos/2d}/support/CCProfiling.cpp (100%) rename {cocos2dx => cocos/2d}/support/CCProfiling.h (100%) rename {cocos2dx => cocos/2d}/support/CCVertex.cpp (100%) rename {cocos2dx => cocos/2d}/support/CCVertex.h (100%) rename {cocos2dx => cocos/2d}/support/TransformUtils.cpp (100%) rename {cocos2dx => cocos/2d}/support/TransformUtils.h (100%) rename {cocos2dx => cocos/2d}/support/base64.cpp (100%) rename {cocos2dx => cocos/2d}/support/base64.h (100%) rename {cocos2dx => cocos/2d}/support/ccUTF8.cpp (100%) rename {cocos2dx => cocos/2d}/support/ccUTF8.h (100%) rename {cocos2dx => cocos/2d}/support/ccUtils.cpp (100%) rename {cocos2dx => cocos/2d}/support/ccUtils.h (100%) rename {cocos2dx => cocos/2d}/support/component/CCComponent.cpp (100%) rename {cocos2dx => cocos/2d}/support/component/CCComponent.h (100%) rename {cocos2dx => cocos/2d}/support/component/CCComponentContainer.cpp (100%) rename {cocos2dx => cocos/2d}/support/component/CCComponentContainer.h (100%) rename {cocos2dx => cocos/2d}/support/data_support/ccCArray.cpp (100%) rename {cocos2dx => cocos/2d}/support/data_support/ccCArray.h (100%) rename {cocos2dx => cocos/2d}/support/data_support/uthash.h (100%) rename {cocos2dx => cocos/2d}/support/data_support/utlist.h (100%) rename {cocos2dx => cocos/2d}/support/image_support/TGAlib.cpp (100%) rename {cocos2dx => cocos/2d}/support/image_support/TGAlib.h (100%) rename {cocos2dx => cocos/2d}/support/tinyxml2/tinyxml2.cpp (100%) rename {cocos2dx => cocos/2d}/support/tinyxml2/tinyxml2.h (100%) rename {cocos2dx => cocos/2d}/support/user_default/CCUserDefault.cpp (100%) rename {cocos2dx => cocos/2d}/support/user_default/CCUserDefault.h (100%) rename {cocos2dx => cocos/2d}/support/user_default/CCUserDefault.mm (100%) rename {cocos2dx => cocos/2d}/support/user_default/CCUserDefaultAndroid.cpp (100%) rename {cocos2dx => cocos/2d}/support/zip_support/ZipUtils.cpp (100%) rename {cocos2dx => cocos/2d}/support/zip_support/ZipUtils.h (100%) rename {cocos2dx => cocos/2d}/support/zip_support/ioapi.cpp (100%) rename {cocos2dx => cocos/2d}/support/zip_support/ioapi.h (100%) rename {cocos2dx => cocos/2d}/support/zip_support/unzip.cpp (100%) rename {cocos2dx => cocos/2d}/support/zip_support/unzip.h (100%) rename {cocos2dx/text_input_node => cocos/2d/text-input-node}/CCIMEDelegate.h (100%) rename {cocos2dx/text_input_node => cocos/2d/text-input-node}/CCIMEDispatcher.cpp (100%) rename {cocos2dx/text_input_node => cocos/2d/text-input-node}/CCIMEDispatcher.h (100%) rename {cocos2dx/text_input_node => cocos/2d/text-input-node}/CCTextFieldTTF.cpp (100%) rename {cocos2dx/text_input_node => cocos/2d/text-input-node}/CCTextFieldTTF.h (100%) rename {cocos2dx => cocos/2d}/textures/CCTexture2D.cpp (100%) rename {cocos2dx => cocos/2d}/textures/CCTexture2D.h (100%) rename {cocos2dx => cocos/2d}/textures/CCTextureAtlas.cpp (100%) rename {cocos2dx => cocos/2d}/textures/CCTextureAtlas.h (100%) rename {cocos2dx => cocos/2d}/textures/CCTextureCache.cpp (100%) rename {cocos2dx => cocos/2d}/textures/CCTextureCache.h (100%) rename {cocos2dx/tilemap_parallax_nodes => cocos/2d/tilemap-parallax-nodes}/CCParallaxNode.cpp (100%) rename {cocos2dx/tilemap_parallax_nodes => cocos/2d/tilemap-parallax-nodes}/CCParallaxNode.h (100%) rename {cocos2dx/tilemap_parallax_nodes => cocos/2d/tilemap-parallax-nodes}/CCTMXLayer.cpp (100%) rename {cocos2dx/tilemap_parallax_nodes => cocos/2d/tilemap-parallax-nodes}/CCTMXLayer.h (100%) rename {cocos2dx/tilemap_parallax_nodes => cocos/2d/tilemap-parallax-nodes}/CCTMXObjectGroup.cpp (100%) rename {cocos2dx/tilemap_parallax_nodes => cocos/2d/tilemap-parallax-nodes}/CCTMXObjectGroup.h (100%) rename {cocos2dx/tilemap_parallax_nodes => cocos/2d/tilemap-parallax-nodes}/CCTMXTiledMap.cpp (100%) rename {cocos2dx/tilemap_parallax_nodes => cocos/2d/tilemap-parallax-nodes}/CCTMXTiledMap.h (100%) rename {cocos2dx/tilemap_parallax_nodes => cocos/2d/tilemap-parallax-nodes}/CCTMXXMLParser.cpp (100%) rename {cocos2dx/tilemap_parallax_nodes => cocos/2d/tilemap-parallax-nodes}/CCTMXXMLParser.h (100%) rename {cocos2dx/tilemap_parallax_nodes => cocos/2d/tilemap-parallax-nodes}/CCTileMapAtlas.cpp (100%) rename {cocos2dx/tilemap_parallax_nodes => cocos/2d/tilemap-parallax-nodes}/CCTileMapAtlas.h (100%) rename {audio => cocos/audio}/android/Android.mk (100%) rename {audio => cocos/audio}/android/ccdandroidUtils.cpp (100%) rename {audio => cocos/audio}/android/ccdandroidUtils.h (100%) rename {audio => cocos/audio}/android/cddSimpleAudioEngine.cpp (100%) rename {audio => cocos/audio}/android/jni/cddandroidAndroidJavaEngine.cpp (100%) rename {audio => cocos/audio}/android/jni/cddandroidAndroidJavaEngine.h (100%) rename {audio => cocos/audio}/android/opensl/OpenSLEngine.cpp (100%) rename {audio => cocos/audio}/android/opensl/OpenSLEngine.h (100%) rename {audio => cocos/audio}/android/opensl/SimpleAudioEngineOpenSL.cpp (100%) rename {audio => cocos/audio}/android/opensl/SimpleAudioEngineOpenSL.h (100%) rename {audio => cocos/audio}/android/opensl/cddandroidOpenSLEngine.cpp (100%) rename {audio => cocos/audio}/android/opensl/cddandroidOpenSLEngine.h (100%) rename {audio => cocos/audio}/include/Export.h (100%) rename {audio => cocos/audio}/include/SimpleAudioEngine.h (100%) rename {audio => cocos/audio}/ios/CDAudioManager.h (100%) rename {audio => cocos/audio}/ios/CDAudioManager.m (100%) rename {audio => cocos/audio}/ios/CDConfig.h (100%) rename {audio => cocos/audio}/ios/CDOpenALSupport.h (100%) rename {audio => cocos/audio}/ios/CDOpenALSupport.m (100%) rename {audio => cocos/audio}/ios/CocosDenshion.h (100%) rename {audio => cocos/audio}/ios/CocosDenshion.m (100%) rename {audio => cocos/audio}/ios/SimpleAudioEngine.mm (100%) rename {audio => cocos/audio}/ios/SimpleAudioEngine_objc.h (100%) rename {audio => cocos/audio}/ios/SimpleAudioEngine_objc.m (100%) rename {audio => cocos/audio}/linux/AudioPlayer.h (100%) rename {audio => cocos/audio}/linux/FmodAudioPlayer.cpp (100%) rename {audio => cocos/audio}/linux/FmodAudioPlayer.h (100%) rename {audio => cocos/audio}/linux/SimpleAudioEngineFMOD.cpp (100%) rename {audio => cocos/audio}/mac/CDAudioManager.h (100%) rename {audio => cocos/audio}/mac/CDAudioManager.m (100%) rename {audio => cocos/audio}/mac/CDConfig.h (100%) rename {audio => cocos/audio}/mac/CDOpenALSupport.h (100%) rename {audio => cocos/audio}/mac/CDOpenALSupport.m (100%) rename {audio => cocos/audio}/mac/CDXMacOSXSupport.h (100%) rename {audio => cocos/audio}/mac/CDXMacOSXSupport.mm (100%) rename {audio => cocos/audio}/mac/CocosDenshion.h (100%) rename {audio => cocos/audio}/mac/CocosDenshion.m (100%) rename {audio => cocos/audio}/mac/SimpleAudioEngine.mm (99%) rename {audio => cocos/audio}/mac/SimpleAudioEngine_objc.h (100%) rename {audio => cocos/audio}/mac/SimpleAudioEngine_objc.m (100%) rename {audio => cocos/audio}/openal/OpenALDecoder.cpp (100%) rename {audio => cocos/audio}/openal/OpenALDecoder.h (100%) rename {audio => cocos/audio}/openal/SimpleAudioEngineOpenAL.cpp (100%) rename {audio => cocos/audio}/proj.linux/.cproject (100%) rename {audio => cocos/audio}/proj.linux/.project (100%) rename {audio => cocos/audio}/proj.linux/CocosDenshion.prf (100%) rename {audio => cocos/audio}/proj.linux/Makefile (100%) rename {audio => cocos/audio}/proj.win32/CocosDenshion.vcxproj (100%) rename {audio => cocos/audio}/proj.win32/CocosDenshion.vcxproj.filters (100%) rename {audio => cocos/audio}/proj.win32/CocosDenshion.vcxproj.user (100%) rename {audio/third_party => cocos/audio/third-party}/fmod/Makefile (100%) rename {audio/third_party => cocos/audio/third-party}/fmod/api/inc/fmod.h.REMOVED.git-id (100%) rename {audio/third_party => cocos/audio/third-party}/fmod/api/inc/fmod.hpp (100%) rename {audio/third_party => cocos/audio/third-party}/fmod/api/inc/fmod_codec.h (100%) rename {audio/third_party => cocos/audio/third-party}/fmod/api/inc/fmod_dsp.h (100%) rename {audio/third_party => cocos/audio/third-party}/fmod/api/inc/fmod_errors.h (100%) rename {audio/third_party => cocos/audio/third-party}/fmod/api/inc/fmod_memoryinfo.h (100%) rename {audio/third_party => cocos/audio/third-party}/fmod/api/inc/fmod_output.h (100%) rename {audio/third_party => cocos/audio/third-party}/fmod/api/inc/fmodlinux.h (100%) rename {audio/third_party => cocos/audio/third-party}/fmod/api/lib/libfmodex-4.36.01.so.REMOVED.git-id (100%) rename {audio/third_party => cocos/audio/third-party}/fmod/api/lib/libfmodex.so.REMOVED.git-id (100%) rename {audio/third_party => cocos/audio/third-party}/fmod/api/lib/libfmodexL-4.36.01.so.REMOVED.git-id (100%) rename {audio/third_party => cocos/audio/third-party}/fmod/api/lib/libfmodexL.so.REMOVED.git-id (100%) rename {audio/third_party => cocos/audio/third-party}/fmod/lib64/Makefile (100%) rename {audio/third_party => cocos/audio/third-party}/fmod/lib64/api/inc/fmod.h.REMOVED.git-id (100%) rename {audio/third_party => cocos/audio/third-party}/fmod/lib64/api/inc/fmod.hpp (100%) rename {audio/third_party => cocos/audio/third-party}/fmod/lib64/api/inc/fmod_codec.h (100%) rename {audio/third_party => cocos/audio/third-party}/fmod/lib64/api/inc/fmod_dsp.h (100%) rename {audio/third_party => cocos/audio/third-party}/fmod/lib64/api/inc/fmod_errors.h (100%) rename {audio/third_party => cocos/audio/third-party}/fmod/lib64/api/inc/fmod_memoryinfo.h (100%) rename {audio/third_party => cocos/audio/third-party}/fmod/lib64/api/inc/fmod_output.h (100%) rename {audio/third_party => cocos/audio/third-party}/fmod/lib64/api/inc/fmodlinux.h (100%) rename {audio/third_party => cocos/audio/third-party}/fmod/lib64/api/lib/libfmodex64-4.38.00.so.REMOVED.git-id (100%) rename {audio/third_party => cocos/audio/third-party}/fmod/lib64/api/lib/libfmodex64.so.REMOVED.git-id (100%) rename {audio/third_party => cocos/audio/third-party}/fmod/lib64/api/lib/libfmodexL64-4.38.00.so.REMOVED.git-id (100%) rename {audio/third_party => cocos/audio/third-party}/fmod/lib64/api/lib/libfmodexL64.so.REMOVED.git-id (100%) rename {audio => cocos/audio}/win32/MciPlayer.cpp (100%) rename {audio => cocos/audio}/win32/MciPlayer.h (100%) rename {audio => cocos/audio}/win32/SimpleAudioEngine.cpp (100%) rename {extensions/CCBReader => cocos/editor-support/cocosbuilder}/CCBAnimationManager.cpp (100%) rename {extensions/CCBReader => cocos/editor-support/cocosbuilder}/CCBAnimationManager.h (100%) rename {extensions/CCBReader => cocos/editor-support/cocosbuilder}/CCBFileLoader.cpp (100%) rename {extensions/CCBReader => cocos/editor-support/cocosbuilder}/CCBFileLoader.h (100%) rename {extensions/CCBReader => cocos/editor-support/cocosbuilder}/CCBKeyframe.cpp (100%) rename {extensions/CCBReader => cocos/editor-support/cocosbuilder}/CCBKeyframe.h (100%) rename {extensions/CCBReader => cocos/editor-support/cocosbuilder}/CCBMemberVariableAssigner.h (100%) rename {extensions/CCBReader => cocos/editor-support/cocosbuilder}/CCBReader.cpp (100%) rename {extensions/CCBReader => cocos/editor-support/cocosbuilder}/CCBReader.h (100%) rename {extensions/CCBReader => cocos/editor-support/cocosbuilder}/CCBSelectorResolver.h (100%) rename {extensions/CCBReader => cocos/editor-support/cocosbuilder}/CCBSequence.cpp (100%) rename {extensions/CCBReader => cocos/editor-support/cocosbuilder}/CCBSequence.h (100%) rename {extensions/CCBReader => cocos/editor-support/cocosbuilder}/CCBSequenceProperty.cpp (100%) rename {extensions/CCBReader => cocos/editor-support/cocosbuilder}/CCBSequenceProperty.h (100%) rename {extensions/CCBReader => cocos/editor-support/cocosbuilder}/CCBValue.cpp (100%) rename {extensions/CCBReader => cocos/editor-support/cocosbuilder}/CCBValue.h (100%) rename {extensions/CCBReader => cocos/editor-support/cocosbuilder}/CCControlButtonLoader.cpp (100%) rename {extensions/CCBReader => cocos/editor-support/cocosbuilder}/CCControlButtonLoader.h (100%) rename {extensions/CCBReader => cocos/editor-support/cocosbuilder}/CCControlLoader.cpp (100%) rename {extensions/CCBReader => cocos/editor-support/cocosbuilder}/CCControlLoader.h (100%) rename {extensions/CCBReader => cocos/editor-support/cocosbuilder}/CCLabelBMFontLoader.cpp (100%) rename {extensions/CCBReader => cocos/editor-support/cocosbuilder}/CCLabelBMFontLoader.h (100%) rename {extensions/CCBReader => cocos/editor-support/cocosbuilder}/CCLabelTTFLoader.cpp (100%) rename {extensions/CCBReader => cocos/editor-support/cocosbuilder}/CCLabelTTFLoader.h (100%) rename {extensions/CCBReader => cocos/editor-support/cocosbuilder}/CCLayerColorLoader.cpp (100%) rename {extensions/CCBReader => cocos/editor-support/cocosbuilder}/CCLayerColorLoader.h (100%) rename {extensions/CCBReader => cocos/editor-support/cocosbuilder}/CCLayerGradientLoader.cpp (100%) rename {extensions/CCBReader => cocos/editor-support/cocosbuilder}/CCLayerGradientLoader.h (100%) rename {extensions/CCBReader => cocos/editor-support/cocosbuilder}/CCLayerLoader.cpp (100%) rename {extensions/CCBReader => cocos/editor-support/cocosbuilder}/CCLayerLoader.h (100%) rename {extensions/CCBReader => cocos/editor-support/cocosbuilder}/CCMenuItemImageLoader.cpp (100%) rename {extensions/CCBReader => cocos/editor-support/cocosbuilder}/CCMenuItemImageLoader.h (100%) rename {extensions/CCBReader => cocos/editor-support/cocosbuilder}/CCMenuItemLoader.cpp (100%) rename {extensions/CCBReader => cocos/editor-support/cocosbuilder}/CCMenuItemLoader.h (100%) rename {extensions/CCBReader => cocos/editor-support/cocosbuilder}/CCMenuLoader.h (100%) rename {extensions/CCBReader => cocos/editor-support/cocosbuilder}/CCNode+CCBRelativePositioning.cpp (100%) rename {extensions/CCBReader => cocos/editor-support/cocosbuilder}/CCNode+CCBRelativePositioning.h (100%) rename {extensions/CCBReader => cocos/editor-support/cocosbuilder}/CCNodeLoader.cpp (100%) rename {extensions/CCBReader => cocos/editor-support/cocosbuilder}/CCNodeLoader.h (100%) rename {extensions/CCBReader => cocos/editor-support/cocosbuilder}/CCNodeLoaderLibrary.cpp (100%) rename {extensions/CCBReader => cocos/editor-support/cocosbuilder}/CCNodeLoaderLibrary.h (100%) rename {extensions/CCBReader => cocos/editor-support/cocosbuilder}/CCNodeLoaderListener.h (100%) rename {extensions/CCBReader => cocos/editor-support/cocosbuilder}/CCParticleSystemQuadLoader.cpp (100%) rename {extensions/CCBReader => cocos/editor-support/cocosbuilder}/CCParticleSystemQuadLoader.h (100%) rename {extensions/CCBReader => cocos/editor-support/cocosbuilder}/CCScale9SpriteLoader.cpp (100%) rename {extensions/CCBReader => cocos/editor-support/cocosbuilder}/CCScale9SpriteLoader.h (100%) rename {extensions/CCBReader => cocos/editor-support/cocosbuilder}/CCScrollViewLoader.cpp (100%) rename {extensions/CCBReader => cocos/editor-support/cocosbuilder}/CCScrollViewLoader.h (100%) rename {extensions/CCBReader => cocos/editor-support/cocosbuilder}/CCSpriteLoader.cpp (100%) rename {extensions/CCBReader => cocos/editor-support/cocosbuilder}/CCSpriteLoader.h (100%) rename {extensions/CocoStudio/Action => cocos/editor-support/cocostudio/action}/CCActionFrame.cpp (100%) rename {extensions/CocoStudio/Action => cocos/editor-support/cocostudio/action}/CCActionFrame.h (100%) rename {extensions/CocoStudio/Action => cocos/editor-support/cocostudio/action}/CCActionFrameEasing.cpp (100%) rename {extensions/CocoStudio/Action => cocos/editor-support/cocostudio/action}/CCActionFrameEasing.h (100%) rename {extensions/CocoStudio/Action => cocos/editor-support/cocostudio/action}/CCActionManagerEx.cpp (100%) rename {extensions/CocoStudio/Action => cocos/editor-support/cocostudio/action}/CCActionManagerEx.h (100%) rename {extensions/CocoStudio/Action => cocos/editor-support/cocostudio/action}/CCActionNode.cpp (100%) rename {extensions/CocoStudio/Action => cocos/editor-support/cocostudio/action}/CCActionNode.h (100%) rename {extensions/CocoStudio/Action => cocos/editor-support/cocostudio/action}/CCActionObject.cpp (100%) rename {extensions/CocoStudio/Action => cocos/editor-support/cocostudio/action}/CCActionObject.h (100%) rename {extensions/CocoStudio/Armature => cocos/editor-support/cocostudio/armature}/CCArmature.cpp (100%) rename {extensions/CocoStudio/Armature => cocos/editor-support/cocostudio/armature}/CCArmature.h (100%) rename {extensions/CocoStudio/Armature => cocos/editor-support/cocostudio/armature}/CCBone.cpp (100%) rename {extensions/CocoStudio/Armature => cocos/editor-support/cocostudio/armature}/CCBone.h (100%) rename {extensions/CocoStudio/Armature => cocos/editor-support/cocostudio/armature}/animation/CCArmatureAnimation.cpp (100%) rename {extensions/CocoStudio/Armature => cocos/editor-support/cocostudio/armature}/animation/CCArmatureAnimation.h (100%) rename {extensions/CocoStudio/Armature => cocos/editor-support/cocostudio/armature}/animation/CCProcessBase.cpp (100%) rename {extensions/CocoStudio/Armature => cocos/editor-support/cocostudio/armature}/animation/CCProcessBase.h (100%) rename {extensions/CocoStudio/Armature => cocos/editor-support/cocostudio/armature}/animation/CCTween.cpp (100%) rename {extensions/CocoStudio/Armature => cocos/editor-support/cocostudio/armature}/animation/CCTween.h (100%) rename {extensions/CocoStudio/Armature => cocos/editor-support/cocostudio/armature}/datas/CCDatas.cpp (100%) rename {extensions/CocoStudio/Armature => cocos/editor-support/cocostudio/armature}/datas/CCDatas.h (100%) rename {extensions/CocoStudio/Armature => cocos/editor-support/cocostudio/armature}/display/CCBatchNode.cpp (100%) rename {extensions/CocoStudio/Armature => cocos/editor-support/cocostudio/armature}/display/CCBatchNode.h (100%) rename {extensions/CocoStudio/Armature => cocos/editor-support/cocostudio/armature}/display/CCDecorativeDisplay.cpp (100%) rename {extensions/CocoStudio/Armature => cocos/editor-support/cocostudio/armature}/display/CCDecorativeDisplay.h (100%) rename {extensions/CocoStudio/Armature => cocos/editor-support/cocostudio/armature}/display/CCDisplayFactory.cpp (100%) rename {extensions/CocoStudio/Armature => cocos/editor-support/cocostudio/armature}/display/CCDisplayFactory.h (100%) rename {extensions/CocoStudio/Armature => cocos/editor-support/cocostudio/armature}/display/CCDisplayManager.cpp (100%) rename {extensions/CocoStudio/Armature => cocos/editor-support/cocostudio/armature}/display/CCDisplayManager.h (100%) rename {extensions/CocoStudio/Armature => cocos/editor-support/cocostudio/armature}/display/CCSkin.cpp (100%) rename {extensions/CocoStudio/Armature => cocos/editor-support/cocostudio/armature}/display/CCSkin.h (100%) rename {extensions/CocoStudio/Armature => cocos/editor-support/cocostudio/armature}/physics/CCColliderDetector.cpp (100%) rename {extensions/CocoStudio/Armature => cocos/editor-support/cocostudio/armature}/physics/CCColliderDetector.h (100%) rename {extensions/CocoStudio/Armature => cocos/editor-support/cocostudio/armature}/utils/CCArmatureDataManager.cpp (100%) rename {extensions/CocoStudio/Armature => cocos/editor-support/cocostudio/armature}/utils/CCArmatureDataManager.h (100%) rename {extensions/CocoStudio/Armature => cocos/editor-support/cocostudio/armature}/utils/CCArmatureDefine.cpp (100%) rename {extensions/CocoStudio/Armature => cocos/editor-support/cocostudio/armature}/utils/CCArmatureDefine.h (100%) rename {extensions/CocoStudio/Armature => cocos/editor-support/cocostudio/armature}/utils/CCDataReaderHelper.cpp (100%) rename {extensions/CocoStudio/Armature => cocos/editor-support/cocostudio/armature}/utils/CCDataReaderHelper.h (100%) rename {extensions/CocoStudio/Armature => cocos/editor-support/cocostudio/armature}/utils/CCSpriteFrameCacheHelper.cpp (100%) rename {extensions/CocoStudio/Armature => cocos/editor-support/cocostudio/armature}/utils/CCSpriteFrameCacheHelper.h (100%) rename {extensions/CocoStudio/Armature => cocos/editor-support/cocostudio/armature}/utils/CCTransformHelp.cpp (100%) rename {extensions/CocoStudio/Armature => cocos/editor-support/cocostudio/armature}/utils/CCTransformHelp.h (100%) rename {extensions/CocoStudio/Armature => cocos/editor-support/cocostudio/armature}/utils/CCTweenFunction.cpp (100%) rename {extensions/CocoStudio/Armature => cocos/editor-support/cocostudio/armature}/utils/CCTweenFunction.h (100%) rename {extensions/CocoStudio/Armature => cocos/editor-support/cocostudio/armature}/utils/CCUtilMath.cpp (100%) rename {extensions/CocoStudio/Armature => cocos/editor-support/cocostudio/armature}/utils/CCUtilMath.h (100%) rename {extensions/CocoStudio/Components => cocos/editor-support/cocostudio/components}/CCComAttribute.cpp (100%) rename {extensions/CocoStudio/Components => cocos/editor-support/cocostudio/components}/CCComAttribute.h (100%) rename {extensions/CocoStudio/Components => cocos/editor-support/cocostudio/components}/CCComAudio.cpp (100%) rename {extensions/CocoStudio/Components => cocos/editor-support/cocostudio/components}/CCComAudio.h (100%) rename {extensions/CocoStudio/Components => cocos/editor-support/cocostudio/components}/CCComController.cpp (100%) rename {extensions/CocoStudio/Components => cocos/editor-support/cocostudio/components}/CCComController.h (100%) rename {extensions/CocoStudio/Components => cocos/editor-support/cocostudio/components}/CCComRender.cpp (100%) rename {extensions/CocoStudio/Components => cocos/editor-support/cocostudio/components}/CCComRender.h (100%) rename {extensions/CocoStudio/Components => cocos/editor-support/cocostudio/components}/CCInputDelegate.cpp (100%) rename {extensions/CocoStudio/Components => cocos/editor-support/cocostudio/components}/CCInputDelegate.h (100%) rename {extensions/CocoStudio/Json => cocos/editor-support/cocostudio/json}/CSContentJsonDictionary.cpp (100%) rename {extensions/CocoStudio/Json => cocos/editor-support/cocostudio/json}/CSContentJsonDictionary.h (100%) rename {extensions/CocoStudio/Json => cocos/editor-support/cocostudio/json}/DictionaryHelper.cpp (100%) rename {extensions/CocoStudio/Json => cocos/editor-support/cocostudio/json}/DictionaryHelper.h (100%) rename {extensions/CocoStudio/Reader => cocos/editor-support/cocostudio/reader}/CCSGUIReader.cpp (100%) rename {extensions/CocoStudio/Reader => cocos/editor-support/cocostudio/reader}/CCSGUIReader.h (100%) rename {extensions/CocoStudio/Reader => cocos/editor-support/cocostudio/reader}/CCSSceneReader.cpp (100%) rename {extensions/CocoStudio/Reader => cocos/editor-support/cocostudio/reader}/CCSSceneReader.h (100%) rename {extensions => cocos/editor-support}/spine/Animation.cpp (100%) rename {extensions => cocos/editor-support}/spine/Animation.h (100%) rename {extensions => cocos/editor-support}/spine/AnimationState.cpp (100%) rename {extensions => cocos/editor-support}/spine/AnimationState.h (100%) rename {extensions => cocos/editor-support}/spine/AnimationStateData.cpp (100%) rename {extensions => cocos/editor-support}/spine/AnimationStateData.h (100%) rename {extensions => cocos/editor-support}/spine/Atlas.cpp (100%) rename {extensions => cocos/editor-support}/spine/Atlas.h (100%) rename {extensions => cocos/editor-support}/spine/AtlasAttachmentLoader.cpp (100%) rename {extensions => cocos/editor-support}/spine/AtlasAttachmentLoader.h (100%) rename {extensions => cocos/editor-support}/spine/Attachment.cpp (100%) rename {extensions => cocos/editor-support}/spine/Attachment.h (100%) rename {extensions => cocos/editor-support}/spine/AttachmentLoader.cpp (100%) rename {extensions => cocos/editor-support}/spine/AttachmentLoader.h (100%) rename {extensions => cocos/editor-support}/spine/Bone.cpp (100%) rename {extensions => cocos/editor-support}/spine/Bone.h (100%) rename {extensions => cocos/editor-support}/spine/BoneData.cpp (100%) rename {extensions => cocos/editor-support}/spine/BoneData.h (100%) rename {extensions => cocos/editor-support}/spine/CCSkeleton.cpp (100%) rename {extensions => cocos/editor-support}/spine/CCSkeleton.h (100%) rename {extensions => cocos/editor-support}/spine/CCSkeletonAnimation.cpp (100%) rename {extensions => cocos/editor-support}/spine/CCSkeletonAnimation.h (100%) rename {extensions => cocos/editor-support}/spine/Json.cpp (100%) rename {extensions => cocos/editor-support}/spine/Json.h (100%) rename {extensions => cocos/editor-support}/spine/RegionAttachment.cpp (100%) rename {extensions => cocos/editor-support}/spine/RegionAttachment.h (100%) rename {extensions => cocos/editor-support}/spine/Skeleton.cpp (100%) rename {extensions => cocos/editor-support}/spine/Skeleton.h (100%) rename {extensions => cocos/editor-support}/spine/SkeletonData.cpp (100%) rename {extensions => cocos/editor-support}/spine/SkeletonData.h (100%) rename {extensions => cocos/editor-support}/spine/SkeletonJson.cpp (100%) rename {extensions => cocos/editor-support}/spine/SkeletonJson.h (100%) rename {extensions => cocos/editor-support}/spine/Skin.cpp (100%) rename {extensions => cocos/editor-support}/spine/Skin.h (100%) rename {extensions => cocos/editor-support}/spine/Slot.cpp (100%) rename {extensions => cocos/editor-support}/spine/Slot.h (100%) rename {extensions => cocos/editor-support}/spine/SlotData.cpp (100%) rename {extensions => cocos/editor-support}/spine/SlotData.h (100%) rename {extensions => cocos/editor-support}/spine/extension.cpp (100%) rename {extensions => cocos/editor-support}/spine/extension.h (100%) rename {extensions => cocos/editor-support}/spine/spine-cocos2dx.cpp (100%) rename {extensions => cocos/editor-support}/spine/spine-cocos2dx.h (100%) rename {extensions => cocos/editor-support}/spine/spine.h (100%) rename {extensions/CocoStudio/GUI/BaseClasses => cocos/gui/base-classes}/UIRootWidget.cpp (100%) rename {extensions/CocoStudio/GUI/BaseClasses => cocos/gui/base-classes}/UIRootWidget.h (100%) rename {extensions/CocoStudio/GUI/BaseClasses => cocos/gui/base-classes}/UIWidget.cpp (100%) rename {extensions/CocoStudio/GUI/BaseClasses => cocos/gui/base-classes}/UIWidget.h (100%) rename {extensions/CocoStudio/GUI/Layouts => cocos/gui/layouts}/Layout.cpp (100%) rename {extensions/CocoStudio/GUI/Layouts => cocos/gui/layouts}/Layout.h (100%) rename {extensions/CocoStudio/GUI/Layouts => cocos/gui/layouts}/LayoutParameter.cpp (100%) rename {extensions/CocoStudio/GUI/Layouts => cocos/gui/layouts}/LayoutParameter.h (100%) rename {extensions/CocoStudio/GUI/Layouts => cocos/gui/layouts}/UILayoutDefine.cpp (100%) rename {extensions/CocoStudio/GUI/Layouts => cocos/gui/layouts}/UILayoutDefine.h (100%) rename {extensions/CocoStudio/GUI/System => cocos/gui/system}/CocosGUI.cpp (100%) rename {extensions/CocoStudio/GUI/System => cocos/gui/system}/CocosGUI.h (100%) rename {extensions/CocoStudio/GUI/System => cocos/gui/system}/UIHelper.cpp (100%) rename {extensions/CocoStudio/GUI/System => cocos/gui/system}/UIHelper.h (100%) rename {extensions/CocoStudio/GUI/System => cocos/gui/system}/UIInputManager.cpp (100%) rename {extensions/CocoStudio/GUI/System => cocos/gui/system}/UIInputManager.h (100%) rename {extensions/CocoStudio/GUI/System => cocos/gui/system}/UILayer.cpp (100%) rename {extensions/CocoStudio/GUI/System => cocos/gui/system}/UILayer.h (100%) rename {extensions/CocoStudio/GUI/UIWidgets => cocos/gui/widgets}/ScrollWidget/UIDragPanel.cpp (100%) rename {extensions/CocoStudio/GUI/UIWidgets => cocos/gui/widgets}/ScrollWidget/UIDragPanel.h (100%) rename {extensions/CocoStudio/GUI/UIWidgets => cocos/gui/widgets}/ScrollWidget/UIListView.cpp (100%) rename {extensions/CocoStudio/GUI/UIWidgets => cocos/gui/widgets}/ScrollWidget/UIListView.h (100%) rename {extensions/CocoStudio/GUI/UIWidgets => cocos/gui/widgets}/ScrollWidget/UIPageView.cpp (100%) rename {extensions/CocoStudio/GUI/UIWidgets => cocos/gui/widgets}/ScrollWidget/UIPageView.h (100%) rename {extensions/CocoStudio/GUI/UIWidgets => cocos/gui/widgets}/ScrollWidget/UIScrollInterface.h (100%) rename {extensions/CocoStudio/GUI/UIWidgets => cocos/gui/widgets}/ScrollWidget/UIScrollView.cpp (100%) rename {extensions/CocoStudio/GUI/UIWidgets => cocos/gui/widgets}/ScrollWidget/UIScrollView.h (100%) rename {extensions/CocoStudio/GUI/UIWidgets => cocos/gui/widgets}/UIButton.cpp (100%) rename {extensions/CocoStudio/GUI/UIWidgets => cocos/gui/widgets}/UIButton.h (100%) rename {extensions/CocoStudio/GUI/UIWidgets => cocos/gui/widgets}/UICheckBox.cpp (100%) rename {extensions/CocoStudio/GUI/UIWidgets => cocos/gui/widgets}/UICheckBox.h (100%) rename {extensions/CocoStudio/GUI/UIWidgets => cocos/gui/widgets}/UIImageView.cpp (100%) rename {extensions/CocoStudio/GUI/UIWidgets => cocos/gui/widgets}/UIImageView.h (100%) rename {extensions/CocoStudio/GUI/UIWidgets => cocos/gui/widgets}/UILabel.cpp (100%) rename {extensions/CocoStudio/GUI/UIWidgets => cocos/gui/widgets}/UILabel.h (100%) rename {extensions/CocoStudio/GUI/UIWidgets => cocos/gui/widgets}/UILabelAtlas.cpp (100%) rename {extensions/CocoStudio/GUI/UIWidgets => cocos/gui/widgets}/UILabelAtlas.h (100%) rename {extensions/CocoStudio/GUI/UIWidgets => cocos/gui/widgets}/UILabelBMFont.cpp (100%) rename {extensions/CocoStudio/GUI/UIWidgets => cocos/gui/widgets}/UILabelBMFont.h (100%) rename {extensions/CocoStudio/GUI/UIWidgets => cocos/gui/widgets}/UILoadingBar.cpp (100%) rename {extensions/CocoStudio/GUI/UIWidgets => cocos/gui/widgets}/UILoadingBar.h (100%) rename {extensions/CocoStudio/GUI/UIWidgets => cocos/gui/widgets}/UISlider.cpp (100%) rename {extensions/CocoStudio/GUI/UIWidgets => cocos/gui/widgets}/UISlider.h (100%) rename {extensions/CocoStudio/GUI/UIWidgets => cocos/gui/widgets}/UITextField.cpp (100%) rename {extensions/CocoStudio/GUI/UIWidgets => cocos/gui/widgets}/UITextField.h (100%) rename {cocos2dx => cocos/math}/kazmath/include/kazmath/GL/mat4stack.h (100%) rename {cocos2dx => cocos/math}/kazmath/include/kazmath/GL/matrix.h (100%) rename {cocos2dx => cocos/math}/kazmath/include/kazmath/aabb.h (100%) rename {cocos2dx => cocos/math}/kazmath/include/kazmath/kazmath.h (100%) rename {cocos2dx => cocos/math}/kazmath/include/kazmath/mat3.h (100%) rename {cocos2dx => cocos/math}/kazmath/include/kazmath/mat4.h (100%) rename {cocos2dx => cocos/math}/kazmath/include/kazmath/neon_matrix_impl.h (100%) rename {cocos2dx => cocos/math}/kazmath/include/kazmath/plane.h (100%) rename {cocos2dx => cocos/math}/kazmath/include/kazmath/quaternion.h (100%) rename {cocos2dx => cocos/math}/kazmath/include/kazmath/ray2.h (100%) rename {cocos2dx => cocos/math}/kazmath/include/kazmath/utility.h (100%) rename {cocos2dx => cocos/math}/kazmath/include/kazmath/vec2.h (100%) rename {cocos2dx => cocos/math}/kazmath/include/kazmath/vec3.h (100%) rename {cocos2dx => cocos/math}/kazmath/include/kazmath/vec4.h (100%) rename {cocos2dx => cocos/math}/kazmath/src/CMakeLists.txt (100%) rename {cocos2dx => cocos/math}/kazmath/src/ChangeLog (100%) rename {cocos2dx => cocos/math}/kazmath/src/GL/mat4stack.c (100%) rename {cocos2dx => cocos/math}/kazmath/src/GL/matrix.c (100%) rename {cocos2dx => cocos/math}/kazmath/src/aabb.c (100%) rename {cocos2dx => cocos/math}/kazmath/src/mat3.c (100%) rename {cocos2dx => cocos/math}/kazmath/src/mat4.c (100%) rename {cocos2dx => cocos/math}/kazmath/src/neon_matrix_impl.c (100%) rename {cocos2dx => cocos/math}/kazmath/src/plane.c (100%) rename {cocos2dx => cocos/math}/kazmath/src/quaternion.c (100%) rename {cocos2dx => cocos/math}/kazmath/src/ray2.c (100%) rename {cocos2dx => cocos/math}/kazmath/src/utility.c (100%) rename {cocos2dx => cocos/math}/kazmath/src/vec2.c (100%) rename {cocos2dx => cocos/math}/kazmath/src/vec3.c (100%) rename {cocos2dx => cocos/math}/kazmath/src/vec4.c (100%) rename {extensions => cocos}/network/HttpClient.cpp (100%) rename {extensions => cocos}/network/HttpClient.h (100%) rename {extensions => cocos}/network/HttpRequest.h (100%) rename {extensions => cocos}/network/HttpResponse.h (100%) rename {extensions => cocos}/network/SocketIO.cpp (100%) rename {extensions => cocos}/network/SocketIO.h (100%) rename {extensions => cocos}/network/WebSocket.cpp (100%) rename {extensions => cocos}/network/WebSocket.h (100%) rename {cocos2dx => cocos}/physics/Box2D/CCPhysicsBodyInfo.cpp (100%) rename {cocos2dx => cocos}/physics/Box2D/CCPhysicsBodyInfo.h (100%) rename {cocos2dx => cocos}/physics/Box2D/CCPhysicsContactInfo.cpp (100%) rename {cocos2dx => cocos}/physics/Box2D/CCPhysicsContactInfo.h (100%) rename {cocos2dx => cocos}/physics/Box2D/CCPhysicsHelper.h (100%) rename {cocos2dx => cocos}/physics/Box2D/CCPhysicsJointInfo.cpp (100%) rename {cocos2dx => cocos}/physics/Box2D/CCPhysicsJointInfo.h (100%) rename {cocos2dx => cocos}/physics/Box2D/CCPhysicsShapeInfo.cpp (100%) rename {cocos2dx => cocos}/physics/Box2D/CCPhysicsShapeInfo.h (100%) rename {cocos2dx => cocos}/physics/Box2D/CCPhysicsWorldInfo.cpp (100%) rename {cocos2dx => cocos}/physics/Box2D/CCPhysicsWorldInfo.h (100%) rename {cocos2dx => cocos}/physics/CCPhysicsBody.cpp (100%) rename {cocos2dx => cocos}/physics/CCPhysicsBody.h (100%) rename {cocos2dx => cocos}/physics/CCPhysicsContact.cpp (100%) rename {cocos2dx => cocos}/physics/CCPhysicsContact.h (100%) rename {cocos2dx => cocos}/physics/CCPhysicsJoint.cpp (100%) rename {cocos2dx => cocos}/physics/CCPhysicsJoint.h (100%) rename {cocos2dx => cocos}/physics/CCPhysicsSetting.h (100%) rename {cocos2dx => cocos}/physics/CCPhysicsShape.cpp (100%) rename {cocos2dx => cocos}/physics/CCPhysicsShape.h (100%) rename {cocos2dx => cocos}/physics/CCPhysicsWorld.cpp (100%) rename {cocos2dx => cocos}/physics/CCPhysicsWorld.h (100%) rename {cocos2dx => cocos}/physics/chipmunk/CCPhysicsBodyInfo.cpp (100%) rename {cocos2dx => cocos}/physics/chipmunk/CCPhysicsBodyInfo.h (100%) rename {cocos2dx => cocos}/physics/chipmunk/CCPhysicsContactInfo.cpp (100%) rename {cocos2dx => cocos}/physics/chipmunk/CCPhysicsContactInfo.h (100%) rename {cocos2dx => cocos}/physics/chipmunk/CCPhysicsHelper.h (100%) rename {cocos2dx => cocos}/physics/chipmunk/CCPhysicsJointInfo.cpp (100%) rename {cocos2dx => cocos}/physics/chipmunk/CCPhysicsJointInfo.h (100%) rename {cocos2dx => cocos}/physics/chipmunk/CCPhysicsShapeInfo.cpp (100%) rename {cocos2dx => cocos}/physics/chipmunk/CCPhysicsShapeInfo.h (100%) rename {cocos2dx => cocos}/physics/chipmunk/CCPhysicsWorldInfo.cpp (100%) rename {cocos2dx => cocos}/physics/chipmunk/CCPhysicsWorldInfo.h (100%) rename {cocos2dx => cocos}/platform/CCPlatformConfig.h (100%) rename {cocos2dx => cocos}/platform/CCPlatformMacros.h (100%) rename {cocos2dx => cocos/platform}/cocoa/CCAffineTransform.cpp (100%) rename {cocos2dx => cocos/platform}/cocoa/CCAffineTransform.h (100%) rename {cocos2dx => cocos/platform}/cocoa/CCArray.cpp (100%) rename {cocos2dx => cocos/platform}/cocoa/CCArray.h (100%) rename {cocos2dx => cocos/platform}/cocoa/CCAutoreleasePool.cpp (100%) rename {cocos2dx => cocos/platform}/cocoa/CCAutoreleasePool.h (100%) rename {cocos2dx => cocos/platform}/cocoa/CCBool.h (100%) rename {cocos2dx => cocos/platform}/cocoa/CCData.cpp (100%) rename {cocos2dx => cocos/platform}/cocoa/CCData.h (100%) rename {cocos2dx => cocos/platform}/cocoa/CCDataVisitor.cpp (100%) rename {cocos2dx => cocos/platform}/cocoa/CCDataVisitor.h (100%) rename {cocos2dx => cocos/platform}/cocoa/CCDictionary.cpp (100%) rename {cocos2dx => cocos/platform}/cocoa/CCDictionary.h (100%) rename {cocos2dx => cocos/platform}/cocoa/CCDouble.h (100%) rename {cocos2dx => cocos/platform}/cocoa/CCFloat.h (100%) rename {cocos2dx => cocos/platform}/cocoa/CCGeometry.cpp (100%) rename {cocos2dx => cocos/platform}/cocoa/CCGeometry.h (100%) rename {cocos2dx => cocos/platform}/cocoa/CCInteger.h (100%) rename {cocos2dx => cocos/platform}/cocoa/CCNS.cpp (100%) rename {cocos2dx => cocos/platform}/cocoa/CCNS.h (100%) rename {cocos2dx => cocos/platform}/cocoa/CCObject.cpp (100%) rename {cocos2dx => cocos/platform}/cocoa/CCObject.h (100%) rename {cocos2dx => cocos/platform}/cocoa/CCSet.cpp (100%) rename {cocos2dx => cocos/platform}/cocoa/CCSet.h (100%) rename {cocos2dx => cocos/platform}/cocoa/CCString.cpp (100%) rename {cocos2dx => cocos/platform}/cocoa/CCString.h (100%) create mode 160000 cocos/scripting/auto-generated rename {scripting => cocos/scripting}/javascript/bindings/Android.mk (100%) rename {scripting => cocos/scripting}/javascript/bindings/ScriptingCore.cpp (100%) rename {scripting => cocos/scripting}/javascript/bindings/ScriptingCore.h (100%) rename {scripting => cocos/scripting}/javascript/bindings/XMLHTTPRequest.cpp (100%) rename {scripting => cocos/scripting}/javascript/bindings/XMLHTTPRequest.h (100%) rename {scripting => cocos/scripting}/javascript/bindings/cocos2d_specifics.cpp.REMOVED.git-id (100%) rename {scripting => cocos/scripting}/javascript/bindings/cocos2d_specifics.hpp (100%) rename {scripting => cocos/scripting}/javascript/bindings/cocosjs_manual_conversions.cpp (100%) rename {scripting => cocos/scripting}/javascript/bindings/cocosjs_manual_conversions.h (100%) rename {scripting => cocos/scripting}/javascript/bindings/js/jsb.js (100%) rename {scripting => cocos/scripting}/javascript/bindings/js/jsb_chipmunk.js (100%) rename {scripting => cocos/scripting}/javascript/bindings/js/jsb_chipmunk_constants.js (100%) rename {scripting => cocos/scripting}/javascript/bindings/js/jsb_cocos2d.js (100%) rename {scripting => cocos/scripting}/javascript/bindings/js/jsb_cocos2d_constants.js (100%) rename {scripting => cocos/scripting}/javascript/bindings/js/jsb_cocos2d_extension.js (100%) rename {scripting => cocos/scripting}/javascript/bindings/js/jsb_cocosbuilder.js (100%) rename {scripting => cocos/scripting}/javascript/bindings/js/jsb_debugger.js (100%) rename {scripting => cocos/scripting}/javascript/bindings/js/jsb_deprecated.js (100%) rename {scripting => cocos/scripting}/javascript/bindings/js/jsb_opengl.js (100%) rename {scripting => cocos/scripting}/javascript/bindings/js/jsb_opengl_constants.js (100%) rename {scripting => cocos/scripting}/javascript/bindings/js/jsb_sys.js (100%) rename {scripting => cocos/scripting}/javascript/bindings/js_bindings_ccbreader.cpp (100%) rename {scripting => cocos/scripting}/javascript/bindings/js_bindings_ccbreader.h (100%) rename {scripting => cocos/scripting}/javascript/bindings/js_bindings_chipmunk_auto_classes.cpp.REMOVED.git-id (100%) rename {scripting => cocos/scripting}/javascript/bindings/js_bindings_chipmunk_auto_classes.h (100%) rename {scripting => cocos/scripting}/javascript/bindings/js_bindings_chipmunk_auto_classes_registration.h (100%) rename {scripting => cocos/scripting}/javascript/bindings/js_bindings_chipmunk_functions.cpp.REMOVED.git-id (100%) rename {scripting => cocos/scripting}/javascript/bindings/js_bindings_chipmunk_functions.h (100%) rename {scripting => cocos/scripting}/javascript/bindings/js_bindings_chipmunk_functions_registration.h (100%) rename {scripting => cocos/scripting}/javascript/bindings/js_bindings_chipmunk_manual.cpp (100%) rename {scripting => cocos/scripting}/javascript/bindings/js_bindings_chipmunk_manual.h (100%) rename {scripting => cocos/scripting}/javascript/bindings/js_bindings_chipmunk_registration.cpp (100%) rename {scripting => cocos/scripting}/javascript/bindings/js_bindings_chipmunk_registration.h (100%) rename {scripting => cocos/scripting}/javascript/bindings/js_bindings_config.h (100%) rename {scripting => cocos/scripting}/javascript/bindings/js_bindings_core.cpp (100%) rename {scripting => cocos/scripting}/javascript/bindings/js_bindings_core.h (100%) rename {scripting => cocos/scripting}/javascript/bindings/js_bindings_opengl.cpp (100%) rename {scripting => cocos/scripting}/javascript/bindings/js_bindings_opengl.h (100%) rename {scripting => cocos/scripting}/javascript/bindings/js_bindings_system_functions.cpp (100%) rename {scripting => cocos/scripting}/javascript/bindings/js_bindings_system_functions.h (100%) rename {scripting => cocos/scripting}/javascript/bindings/js_bindings_system_functions_registration.h (100%) rename {scripting => cocos/scripting}/javascript/bindings/js_bindings_system_registration.cpp (100%) rename {scripting => cocos/scripting}/javascript/bindings/js_bindings_system_registration.h (100%) rename {scripting => cocos/scripting}/javascript/bindings/js_manual_conversions.cpp (100%) rename {scripting => cocos/scripting}/javascript/bindings/js_manual_conversions.h (100%) rename {scripting => cocos/scripting}/javascript/bindings/jsb_cocos2dx_extension_manual.cpp (100%) rename {scripting => cocos/scripting}/javascript/bindings/jsb_cocos2dx_extension_manual.h (100%) rename {scripting => cocos/scripting}/javascript/bindings/jsb_helper.h (100%) rename {scripting => cocos/scripting}/javascript/bindings/jsb_opengl_functions.cpp (100%) rename {scripting => cocos/scripting}/javascript/bindings/jsb_opengl_functions.h (100%) rename {scripting => cocos/scripting}/javascript/bindings/jsb_opengl_manual.cpp (100%) rename {scripting => cocos/scripting}/javascript/bindings/jsb_opengl_manual.h (100%) rename {scripting => cocos/scripting}/javascript/bindings/jsb_opengl_registration.cpp (100%) rename {scripting => cocos/scripting}/javascript/bindings/jsb_opengl_registration.h (100%) rename {scripting => cocos/scripting}/javascript/bindings/jsb_websocket.cpp (100%) rename {scripting => cocos/scripting}/javascript/bindings/jsb_websocket.h (100%) rename {scripting => cocos/scripting}/javascript/bindings/obfuscate/obfuscate_exclude_chipmunk.js (100%) rename {scripting => cocos/scripting}/javascript/bindings/obfuscate/obfuscate_exclude_cocos2d.js.REMOVED.git-id (100%) rename {scripting => cocos/scripting}/javascript/bindings/proj.ios/jsbindings-Prefix.pch (100%) rename {scripting => cocos/scripting}/javascript/bindings/proj.ios/jsbindings.xcodeproj/project.pbxproj (100%) rename {scripting => cocos/scripting}/javascript/bindings/proj.mac/jsbindings-Prefix.pch (100%) rename {scripting => cocos/scripting}/javascript/bindings/proj.mac/jsbindings.xcodeproj/project.pbxproj (100%) rename {scripting => cocos/scripting}/javascript/bindings/proj.win32/libJSBinding.vcxproj (100%) rename {scripting => cocos/scripting}/javascript/bindings/proj.win32/libJSBinding.vcxproj.filters (100%) rename {scripting => cocos/scripting}/javascript/bindings/proj.win32/libJSBinding.vcxproj.user (100%) rename {scripting => cocos/scripting}/javascript/bindings/spidermonkey_specifics.h (100%) rename {scripting => cocos/scripting}/lua/cocos2dx_support/CCBProxy.cpp (100%) rename {scripting => cocos/scripting}/lua/cocos2dx_support/CCBProxy.h (100%) rename {scripting => cocos/scripting}/lua/cocos2dx_support/CCLuaBridge.cpp (100%) rename {scripting => cocos/scripting}/lua/cocos2dx_support/CCLuaBridge.h (100%) rename {scripting => cocos/scripting}/lua/cocos2dx_support/CCLuaEngine.cpp (100%) rename {scripting => cocos/scripting}/lua/cocos2dx_support/CCLuaEngine.h (100%) rename {scripting => cocos/scripting}/lua/cocos2dx_support/CCLuaStack.cpp (100%) rename {scripting => cocos/scripting}/lua/cocos2dx_support/CCLuaStack.h (100%) rename {scripting => cocos/scripting}/lua/cocos2dx_support/CCLuaValue.cpp (100%) rename {scripting => cocos/scripting}/lua/cocos2dx_support/CCLuaValue.h (100%) rename {scripting => cocos/scripting}/lua/cocos2dx_support/Cocos2dxLuaLoader.cpp (100%) rename {scripting => cocos/scripting}/lua/cocos2dx_support/Cocos2dxLuaLoader.h (100%) rename {scripting => cocos/scripting}/lua/cocos2dx_support/LuaBasicConversions.cpp (100%) rename {scripting => cocos/scripting}/lua/cocos2dx_support/LuaBasicConversions.h (100%) rename {scripting => cocos/scripting}/lua/cocos2dx_support/LuaOpengl.cpp.REMOVED.git-id (100%) rename {scripting => cocos/scripting}/lua/cocos2dx_support/LuaOpengl.h (100%) rename {scripting => cocos/scripting}/lua/cocos2dx_support/LuaScriptHandlerMgr.cpp (100%) rename {scripting => cocos/scripting}/lua/cocos2dx_support/LuaScriptHandlerMgr.h (100%) rename {scripting => cocos/scripting}/lua/cocos2dx_support/Lua_web_socket.cpp (100%) rename {scripting => cocos/scripting}/lua/cocos2dx_support/Lua_web_socket.h (100%) rename {scripting => cocos/scripting}/lua/cocos2dx_support/lua_cocos2dx_deprecated.cpp.REMOVED.git-id (100%) rename {scripting => cocos/scripting}/lua/cocos2dx_support/lua_cocos2dx_deprecated.h (100%) rename {scripting => cocos/scripting}/lua/cocos2dx_support/lua_cocos2dx_extension_manual.cpp (100%) rename {scripting => cocos/scripting}/lua/cocos2dx_support/lua_cocos2dx_extension_manual.h (100%) rename {scripting => cocos/scripting}/lua/cocos2dx_support/lua_cocos2dx_manual.cpp (100%) rename {scripting => cocos/scripting}/lua/cocos2dx_support/lua_cocos2dx_manual.hpp (100%) rename {scripting => cocos/scripting}/lua/cocos2dx_support/platform/android/CCLuaJavaBridge.cpp (100%) rename {scripting => cocos/scripting}/lua/cocos2dx_support/platform/android/CCLuaJavaBridge.h (100%) rename {scripting => cocos/scripting}/lua/cocos2dx_support/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge.cpp (100%) rename {scripting => cocos/scripting}/lua/cocos2dx_support/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge.h (100%) rename {scripting => cocos/scripting}/lua/cocos2dx_support/platform/ios/CCLuaObjcBridge.h (100%) rename {scripting => cocos/scripting}/lua/cocos2dx_support/platform/ios/CCLuaObjcBridge.mm (100%) rename {scripting => cocos/scripting}/lua/cocos2dx_support/tolua_fix.c (100%) rename {scripting => cocos/scripting}/lua/cocos2dx_support/tolua_fix.h (100%) rename {scripting => cocos/scripting}/lua/lua/lapi.c (100%) rename {scripting => cocos/scripting}/lua/lua/lapi.h (100%) rename {scripting => cocos/scripting}/lua/lua/lauxlib.c (100%) rename {scripting => cocos/scripting}/lua/lua/lauxlib.h (100%) rename {scripting => cocos/scripting}/lua/lua/lbaselib.c (100%) rename {scripting => cocos/scripting}/lua/lua/lcode.c (100%) rename {scripting => cocos/scripting}/lua/lua/lcode.h (100%) rename {scripting => cocos/scripting}/lua/lua/ldblib.c (100%) rename {scripting => cocos/scripting}/lua/lua/ldebug.c (100%) rename {scripting => cocos/scripting}/lua/lua/ldebug.h (100%) rename {scripting => cocos/scripting}/lua/lua/ldo.c (100%) rename {scripting => cocos/scripting}/lua/lua/ldo.h (100%) rename {scripting => cocos/scripting}/lua/lua/ldump.c (100%) rename {scripting => cocos/scripting}/lua/lua/lfunc.c (100%) rename {scripting => cocos/scripting}/lua/lua/lfunc.h (100%) rename {scripting => cocos/scripting}/lua/lua/lgc.c (100%) rename {scripting => cocos/scripting}/lua/lua/lgc.h (100%) rename {scripting => cocos/scripting}/lua/lua/linit.c (100%) rename {scripting => cocos/scripting}/lua/lua/liolib.c (100%) rename {scripting => cocos/scripting}/lua/lua/llex.c (100%) rename {scripting => cocos/scripting}/lua/lua/llex.h (100%) rename {scripting => cocos/scripting}/lua/lua/llimits.h (100%) rename {scripting => cocos/scripting}/lua/lua/lmathlib.c (100%) rename {scripting => cocos/scripting}/lua/lua/lmem.c (100%) rename {scripting => cocos/scripting}/lua/lua/lmem.h (100%) rename {scripting => cocos/scripting}/lua/lua/loadlib.c (100%) rename {scripting => cocos/scripting}/lua/lua/lobject.c (100%) rename {scripting => cocos/scripting}/lua/lua/lobject.h (100%) rename {scripting => cocos/scripting}/lua/lua/lopcodes.c (100%) rename {scripting => cocos/scripting}/lua/lua/lopcodes.h (100%) rename {scripting => cocos/scripting}/lua/lua/loslib.c (100%) rename {scripting => cocos/scripting}/lua/lua/lparser.c (100%) rename {scripting => cocos/scripting}/lua/lua/lparser.h (100%) rename {scripting => cocos/scripting}/lua/lua/lstate.c (100%) rename {scripting => cocos/scripting}/lua/lua/lstate.h (100%) rename {scripting => cocos/scripting}/lua/lua/lstring.c (100%) rename {scripting => cocos/scripting}/lua/lua/lstring.h (100%) rename {scripting => cocos/scripting}/lua/lua/lstrlib.c (100%) rename {scripting => cocos/scripting}/lua/lua/ltable.c (100%) rename {scripting => cocos/scripting}/lua/lua/ltable.h (100%) rename {scripting => cocos/scripting}/lua/lua/ltablib.c (100%) rename {scripting => cocos/scripting}/lua/lua/ltm.c (100%) rename {scripting => cocos/scripting}/lua/lua/ltm.h (100%) rename {scripting => cocos/scripting}/lua/lua/lua.c (100%) rename {scripting => cocos/scripting}/lua/lua/lua.h (100%) rename {scripting => cocos/scripting}/lua/lua/luaconf.h (100%) rename {scripting => cocos/scripting}/lua/lua/lualib.h (100%) rename {scripting => cocos/scripting}/lua/lua/lundump.c (100%) rename {scripting => cocos/scripting}/lua/lua/lundump.h (100%) rename {scripting => cocos/scripting}/lua/lua/lvm.c (100%) rename {scripting => cocos/scripting}/lua/lua/lvm.h (100%) rename {scripting => cocos/scripting}/lua/lua/lzio.c (100%) rename {scripting => cocos/scripting}/lua/lua/lzio.h (100%) rename {scripting => cocos/scripting}/lua/lua/print.c (100%) rename {scripting => cocos/scripting}/lua/luajit/Android.mk (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/COPYRIGHT (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/Makefile (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/README (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/doc/bluequad-print.css (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/doc/bluequad.css (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/doc/changes.html (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/doc/contact.html (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/doc/ext_c_api.html (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/doc/ext_ffi.html (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/doc/ext_ffi_api.html (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/doc/ext_ffi_semantics.html (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/doc/ext_ffi_tutorial.html (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/doc/ext_jit.html (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/doc/extensions.html (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/doc/faq.html (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/doc/install.html (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/doc/luajit.html (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/doc/running.html (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/doc/status.html (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_arm.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_arm.lua (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_mips.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_mips.lua (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_ppc.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_ppc.lua (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_proto.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_x64.lua (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_x86.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_x86.lua (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/dynasm/dynasm.lua (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/etc/luajit.1 (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/etc/luajit.pc (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/Makefile (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/Makefile.dep (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/host/README (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/host/buildvm.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/host/buildvm.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/host/buildvm_asm.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/host/buildvm_fold.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/host/buildvm_lib.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/host/buildvm_peobj.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/host/genminilua.lua (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/host/minilua.c.REMOVED.git-id (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/jit/bc.lua (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/jit/bcsave.lua (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/jit/dis_arm.lua (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/jit/dis_mips.lua (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/jit/dis_mipsel.lua (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/jit/dis_ppc.lua (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/jit/dis_x64.lua (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/jit/dis_x86.lua (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/jit/dump.lua (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/jit/v.lua (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lauxlib.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lib_aux.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lib_base.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lib_bit.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lib_debug.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lib_ffi.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lib_init.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lib_io.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lib_jit.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lib_math.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lib_os.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lib_package.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lib_string.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lib_table.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj.supp (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_alloc.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_alloc.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_api.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_arch.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_asm.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_asm.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_asm_arm.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_asm_mips.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_asm_ppc.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_asm_x86.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_bc.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_bc.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_bcdump.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_bcread.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_bcwrite.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_carith.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_carith.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_ccall.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_ccall.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_ccallback.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_ccallback.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_cconv.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_cconv.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_cdata.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_cdata.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_char.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_char.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_clib.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_clib.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_cparse.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_cparse.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_crecord.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_crecord.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_ctype.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_ctype.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_debug.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_debug.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_def.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_dispatch.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_dispatch.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_emit_arm.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_emit_mips.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_emit_ppc.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_emit_x86.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_err.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_err.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_errmsg.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_ff.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_ffrecord.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_ffrecord.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_frame.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_func.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_func.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_gc.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_gc.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_gdbjit.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_gdbjit.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_ir.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_ir.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_ircall.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_iropt.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_jit.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_lex.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_lex.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_lib.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_lib.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_load.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_mcode.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_mcode.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_meta.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_meta.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_obj.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_obj.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_opt_dce.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_opt_fold.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_opt_loop.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_opt_mem.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_opt_narrow.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_opt_sink.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_opt_split.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_parse.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_parse.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_record.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_record.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_snap.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_snap.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_state.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_state.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_str.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_str.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_strscan.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_strscan.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_tab.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_tab.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_target.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_target_arm.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_target_mips.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_target_ppc.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_target_x86.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_trace.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_trace.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_traceerr.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_udata.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_udata.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_vm.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_vmevent.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_vmevent.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lj_vmmath.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/ljamalg.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lua.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lua.hpp (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/luaconf.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/luajit.c (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/luajit.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/lualib.h (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/msvcbuild.bat (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/vm_arm.dasc.REMOVED.git-id (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/vm_mips.dasc.REMOVED.git-id (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/vm_ppc.dasc.REMOVED.git-id (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/vm_ppcspe.dasc.REMOVED.git-id (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/vm_x86.dasc.REMOVED.git-id (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/src/xedkbuild.bat (100%) rename {scripting => cocos/scripting}/lua/luajit/LuaJIT-2.0.1/v2.0.1_hotfix1.patch (100%) rename {scripting => cocos/scripting}/lua/luajit/android/armeabi-v7a/libluajit.a.REMOVED.git-id (100%) rename {scripting => cocos/scripting}/lua/luajit/android/armeabi/libluajit.a.REMOVED.git-id (100%) rename {scripting => cocos/scripting}/lua/luajit/android/x86/libluajit.a.REMOVED.git-id (100%) rename {scripting => cocos/scripting}/lua/luajit/build_android.sh (100%) rename {scripting => cocos/scripting}/lua/luajit/build_ios.sh (100%) rename {scripting => cocos/scripting}/lua/luajit/build_mac.sh (100%) rename {scripting => cocos/scripting}/lua/luajit/include/lauxlib.h (100%) rename {scripting => cocos/scripting}/lua/luajit/include/lua.h (100%) rename {scripting => cocos/scripting}/lua/luajit/include/luaconf.h (100%) rename {scripting => cocos/scripting}/lua/luajit/include/lualib.h (100%) rename {scripting => cocos/scripting}/lua/luajit/ios/libluajit.a.REMOVED.git-id (100%) rename {scripting => cocos/scripting}/lua/luajit/mac/libluajit.a.REMOVED.git-id (100%) rename {scripting => cocos/scripting}/lua/luajit/win32/lua51.dll.REMOVED.git-id (100%) rename {scripting => cocos/scripting}/lua/proj.android/Android.mk (100%) rename {scripting => cocos/scripting}/lua/proj.ios/luabindings-Prefix.pch (100%) rename {scripting => cocos/scripting}/lua/proj.ios/luabindings.xcodeproj/project.pbxproj (100%) rename {scripting => cocos/scripting}/lua/proj.linux/.cproject (100%) rename {scripting => cocos/scripting}/lua/proj.linux/.project (100%) rename {scripting => cocos/scripting}/lua/proj.linux/Makefile (100%) rename {scripting => cocos/scripting}/lua/proj.win32/liblua.vcxproj (100%) rename {scripting => cocos/scripting}/lua/proj.win32/liblua.vcxproj.filters (100%) rename {scripting => cocos/scripting}/lua/proj.win32/liblua.vcxproj.user (100%) rename {scripting => cocos/scripting}/lua/script/AudioEngine.lua (100%) rename {scripting => cocos/scripting}/lua/script/CCBReaderLoad.lua (100%) rename {scripting => cocos/scripting}/lua/script/Cocos2d.lua (100%) rename {scripting => cocos/scripting}/lua/script/Cocos2dConstants.lua (100%) rename {scripting => cocos/scripting}/lua/script/Deprecated.lua (100%) rename {scripting => cocos/scripting}/lua/script/DeprecatedClass.lua (100%) rename {scripting => cocos/scripting}/lua/script/DeprecatedEnum.lua (100%) rename {scripting => cocos/scripting}/lua/script/DeprecatedOpenglEnum.lua (100%) rename {scripting => cocos/scripting}/lua/script/DrawPrimitives.lua (100%) rename {scripting => cocos/scripting}/lua/script/Opengl.lua (100%) rename {scripting => cocos/scripting}/lua/script/OpenglConstants.lua (100%) rename {scripting => cocos/scripting}/lua/script/luaj.lua (100%) rename {scripting => cocos/scripting}/lua/tolua/tolua++.h (100%) rename {scripting => cocos/scripting}/lua/tolua/tolua_event.c (100%) rename {scripting => cocos/scripting}/lua/tolua/tolua_event.h (100%) rename {scripting => cocos/scripting}/lua/tolua/tolua_is.c (100%) rename {scripting => cocos/scripting}/lua/tolua/tolua_map.c (100%) rename {scripting => cocos/scripting}/lua/tolua/tolua_push.c (100%) rename {scripting => cocos/scripting}/lua/tolua/tolua_to.c (100%) rename {extensions/LocalStorage => cocos/storage/local-storage}/LocalStorage.cpp (100%) rename {extensions/LocalStorage => cocos/storage/local-storage}/LocalStorage.h (100%) rename {extensions/LocalStorage => cocos/storage/local-storage}/LocalStorageAndroid.cpp (100%) delete mode 100644 cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id delete mode 100644 cocos2dx-qt5.pro delete mode 100644 cocos2dx/label_nodes/CCFontCache.cpp delete mode 100644 cocos2dx/label_nodes/CCFontCache.h delete mode 100644 cocos2dx/platform/emscripten/CCApplication.cpp delete mode 100644 cocos2dx/platform/emscripten/CCApplication.h delete mode 100644 cocos2dx/platform/emscripten/CCCommon.cpp delete mode 100644 cocos2dx/platform/emscripten/CCDevice.cpp delete mode 100644 cocos2dx/platform/emscripten/CCEGLView.cpp delete mode 100644 cocos2dx/platform/emscripten/CCEGLView.h delete mode 100644 cocos2dx/platform/emscripten/CCFileUtilsEmscripten.cpp delete mode 100644 cocos2dx/platform/emscripten/CCFileUtilsEmscripten.h delete mode 100644 cocos2dx/platform/emscripten/CCGL.h delete mode 100644 cocos2dx/platform/emscripten/CCImage.cpp delete mode 100644 cocos2dx/platform/emscripten/CCStdC.h delete mode 100644 cocos2dx/platform/emscripten/CCTextureCacheEmscripten.cpp delete mode 100644 cocos2dx/platform/emscripten/CCTextureCacheEmscripten.h delete mode 100644 cocos2dx/platform/emscripten/CCTextureCacheEmscripten.js delete mode 100644 cocos2dx/platform/ios/CCPlatformDefine.h delete mode 100644 cocos2dx/platform/nacl/CCApplication.cpp delete mode 100644 cocos2dx/platform/nacl/CCApplication.h delete mode 100644 cocos2dx/platform/nacl/CCCommon.cpp delete mode 100644 cocos2dx/platform/nacl/CCDevice.cpp delete mode 100644 cocos2dx/platform/nacl/CCEGLView.cpp delete mode 100644 cocos2dx/platform/nacl/CCEGLView.h delete mode 100644 cocos2dx/platform/nacl/CCFileUtilsNaCl.cpp delete mode 100644 cocos2dx/platform/nacl/CCFileUtilsNaCl.h delete mode 100644 cocos2dx/platform/nacl/CCGL.h delete mode 100644 cocos2dx/platform/nacl/CCImage.cpp delete mode 100644 cocos2dx/platform/nacl/CCInstance.cpp delete mode 100644 cocos2dx/platform/nacl/CCInstance.h delete mode 100644 cocos2dx/platform/nacl/CCModule.h delete mode 100644 cocos2dx/platform/nacl/CCPlatformDefine.h delete mode 100644 cocos2dx/platform/nacl/CCStdC.h delete mode 100644 cocos2dx/platform/nacl/memory.h delete mode 100644 cocos2dx/platform/qt5/AccelerometerListener.cpp delete mode 100644 cocos2dx/platform/qt5/AccelerometerListener.h delete mode 100644 cocos2dx/platform/qt5/CCAccelerometer.cpp delete mode 100644 cocos2dx/platform/qt5/CCAccelerometer.h delete mode 100644 cocos2dx/platform/qt5/CCApplication.cpp delete mode 100644 cocos2dx/platform/qt5/CCApplication.h delete mode 100644 cocos2dx/platform/qt5/CCCommon.cpp delete mode 100644 cocos2dx/platform/qt5/CCDevice.cpp delete mode 100644 cocos2dx/platform/qt5/CCEGLView.cpp delete mode 100644 cocos2dx/platform/qt5/CCEGLView.h delete mode 100644 cocos2dx/platform/qt5/CCFileUtilsQt5.cpp delete mode 100644 cocos2dx/platform/qt5/CCGL.h delete mode 100644 cocos2dx/platform/qt5/CCPlatformDefine.h delete mode 100644 cocos2dx/platform/qt5/CCStdC.h delete mode 100644 cocos2dx/platform/third_party/doc/build.txt delete mode 100644 cocos2dx/platform/third_party/doc/version.txt delete mode 100644 cocos2dx/platform/third_party/emscripten/libjpeg/jerror.h delete mode 100644 cocos2dx/platform/third_party/emscripten/libpng/png.h.REMOVED.git-id delete mode 100644 cocos2dx/platform/third_party/emscripten/libpng/pngconf.h delete mode 100644 cocos2dx/platform/third_party/emscripten/libraries/README delete mode 100755 cocos2dx/platform/third_party/emscripten/libraries/build.sh delete mode 100644 cocos2dx/platform/third_party/emscripten/libraries/libjpeg.a.REMOVED.git-id delete mode 100644 cocos2dx/platform/third_party/emscripten/libraries/libpng.a.REMOVED.git-id delete mode 100644 cocos2dx/platform/third_party/emscripten/libraries/libtiff.a.REMOVED.git-id delete mode 100644 cocos2dx/platform/third_party/emscripten/libraries/libtiffxx.a.REMOVED.git-id delete mode 100644 cocos2dx/platform/third_party/emscripten/libraries/libwebp.a.REMOVED.git-id delete mode 100644 cocos2dx/platform/third_party/emscripten/libraries/libxml2.a.REMOVED.git-id delete mode 100644 cocos2dx/platform/third_party/emscripten/libraries/libz.a.REMOVED.git-id delete mode 100644 cocos2dx/platform/third_party/emscripten/libtiff/include/tiffconf.h delete mode 100644 cocos2dx/platform/third_party/emscripten/libtiff/include/tiffio.hxx delete mode 100644 cocos2dx/platform/third_party/emscripten/libwebp/webp/decode.h delete mode 100644 cocos2dx/platform/third_party/emscripten/libwebp/webp/encode.h delete mode 100644 cocos2dx/platform/third_party/emscripten/libxml2/libxml/DOCBparser.h delete mode 100644 cocos2dx/platform/third_party/emscripten/libxml2/libxml/HTMLparser.h delete mode 100644 cocos2dx/platform/third_party/emscripten/libxml2/libxml/HTMLtree.h delete mode 100644 cocos2dx/platform/third_party/emscripten/libxml2/libxml/SAX.h delete mode 100644 cocos2dx/platform/third_party/emscripten/libxml2/libxml/SAX2.h delete mode 100644 cocos2dx/platform/third_party/emscripten/libxml2/libxml/c14n.h delete mode 100644 cocos2dx/platform/third_party/emscripten/libxml2/libxml/catalog.h delete mode 100644 cocos2dx/platform/third_party/emscripten/libxml2/libxml/chvalid.h delete mode 100644 cocos2dx/platform/third_party/emscripten/libxml2/libxml/debugXML.h delete mode 100644 cocos2dx/platform/third_party/emscripten/libxml2/libxml/dict.h delete mode 100644 cocos2dx/platform/third_party/emscripten/libxml2/libxml/encoding.h delete mode 100644 cocos2dx/platform/third_party/emscripten/libxml2/libxml/entities.h delete mode 100644 cocos2dx/platform/third_party/emscripten/libxml2/libxml/globals.h delete mode 100644 cocos2dx/platform/third_party/emscripten/libxml2/libxml/hash.h delete mode 100644 cocos2dx/platform/third_party/emscripten/libxml2/libxml/list.h delete mode 100644 cocos2dx/platform/third_party/emscripten/libxml2/libxml/nanoftp.h delete mode 100644 cocos2dx/platform/third_party/emscripten/libxml2/libxml/nanohttp.h delete mode 100644 cocos2dx/platform/third_party/emscripten/libxml2/libxml/parser.h delete mode 100644 cocos2dx/platform/third_party/emscripten/libxml2/libxml/parserInternals.h delete mode 100644 cocos2dx/platform/third_party/emscripten/libxml2/libxml/pattern.h delete mode 100644 cocos2dx/platform/third_party/emscripten/libxml2/libxml/relaxng.h delete mode 100644 cocos2dx/platform/third_party/emscripten/libxml2/libxml/schemasInternals.h delete mode 100644 cocos2dx/platform/third_party/emscripten/libxml2/libxml/schematron.h delete mode 100644 cocos2dx/platform/third_party/emscripten/libxml2/libxml/threads.h delete mode 100644 cocos2dx/platform/third_party/emscripten/libxml2/libxml/tree.h delete mode 100644 cocos2dx/platform/third_party/emscripten/libxml2/libxml/uri.h delete mode 100644 cocos2dx/platform/third_party/emscripten/libxml2/libxml/valid.h delete mode 100644 cocos2dx/platform/third_party/emscripten/libxml2/libxml/xinclude.h delete mode 100644 cocos2dx/platform/third_party/emscripten/libxml2/libxml/xlink.h delete mode 100644 cocos2dx/platform/third_party/emscripten/libxml2/libxml/xmlIO.h delete mode 100644 cocos2dx/platform/third_party/emscripten/libxml2/libxml/xmlautomata.h delete mode 100644 cocos2dx/platform/third_party/emscripten/libxml2/libxml/xmlerror.h delete mode 100644 cocos2dx/platform/third_party/emscripten/libxml2/libxml/xmlexports.h delete mode 100644 cocos2dx/platform/third_party/emscripten/libxml2/libxml/xmlmemory.h delete mode 100644 cocos2dx/platform/third_party/emscripten/libxml2/libxml/xmlmodule.h delete mode 100644 cocos2dx/platform/third_party/emscripten/libxml2/libxml/xmlreader.h delete mode 100644 cocos2dx/platform/third_party/emscripten/libxml2/libxml/xmlregexp.h delete mode 100644 cocos2dx/platform/third_party/emscripten/libxml2/libxml/xmlsave.h delete mode 100644 cocos2dx/platform/third_party/emscripten/libxml2/libxml/xmlschemas.h delete mode 100644 cocos2dx/platform/third_party/emscripten/libxml2/libxml/xmlschemastypes.h delete mode 100644 cocos2dx/platform/third_party/emscripten/libxml2/libxml/xmlstring.h delete mode 100644 cocos2dx/platform/third_party/emscripten/libxml2/libxml/xmlunicode.h delete mode 100644 cocos2dx/platform/third_party/emscripten/libxml2/libxml/xmlversion.h delete mode 100644 cocos2dx/platform/third_party/emscripten/libxml2/libxml/xmlwriter.h delete mode 100644 cocos2dx/platform/third_party/emscripten/libxml2/libxml/xpath.h delete mode 100644 cocos2dx/platform/third_party/emscripten/libxml2/libxml/xpathInternals.h delete mode 100644 cocos2dx/platform/third_party/emscripten/libxml2/libxml/xpointer.h delete mode 100644 cocos2dx/platform/third_party/emscripten/libz/zconf.h delete mode 100644 cocos2dx/platform/third_party/emscripten/libz/zlib.h delete mode 100644 cocos2dx/platform/third_party/linux/libjpeg/jconfig.h delete mode 100644 cocos2dx/platform/third_party/tizen/prebuilt/libwebp/include/decode.h delete mode 100644 cocos2dx/platform/third_party/tizen/prebuilt/libwebp/include/encode.h delete mode 100644 cocos2dx/platform/third_party/tizen/prebuilt/libwebp/include/types.h delete mode 100644 cocos2dx/platform/third_party/tizen/prebuilt/libwebp/libs/armv7l/libwebp.a.REMOVED.git-id delete mode 100644 cocos2dx/platform/third_party/tizen/prebuilt/libwebp/libs/x86/libwebp.a.REMOVED.git-id delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/lib/libexpat.so.1.5.2 delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/lib/libexpat.so.REMOVED.git-id delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/lib/libz.so.1.2.5 delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/lib/libz.so.REMOVED.git-id delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/curl/curl.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/curl/curlbuild.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/curl/curlver.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/curl/multi.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/fontconfig/fcfreetype.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/fontconfig/fcprivate.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/fontconfig/fontconfig.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/config/ftconfig-32.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/config/ftconfig.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/config/ftheader.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/config/ftmodule.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/config/ftoption.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/config/ftstdlib.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/freetype.h.REMOVED.git-id delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftadvanc.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftbitmap.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftcache.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftchapters.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/fterrdef.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/fterrors.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftglyph.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftimage.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftlcdfil.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftmodapi.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftmoderr.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftoutln.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftstroke.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftsynth.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/fttrigon.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/fttypes.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ttnameid.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/tttables.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/tttags.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/ft2build.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/jconfig.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/jerror.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/jmorecfg.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/jpeglib.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/png.h.REMOVED.git-id delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/pngconf.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/sqlite3.h.REMOVED.git-id delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/sqlite3ext.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/tiff.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/tiffconf.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/tiffio.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/tiffio.hxx delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/tiffvers.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/zconf.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/zlib.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libcares.so.2.0.0 delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libcrypto.so.1.0.0 delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libcrypto.so.REMOVED.git-id delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libcurl.so.4.3.0 delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libcurl.so.REMOVED.git-id delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libfontconfig.so.1.5.0 delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libfontconfig.so.REMOVED.git-id delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libfreetype.so.6.8.1 delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libfreetype.so.REMOVED.git-id delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libidn.so.11.5.44 delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libidn.so.REMOVED.git-id delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libjpeg.so.8.0.2 delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libjpeg.so.REMOVED.git-id delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libpng.so.3.50.0 delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libpng.so.REMOVED.git-id delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libsqlite3.so.0.8.6 delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libsqlite3.so.REMOVED.git-id delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libssl.so.1.0.0 delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libssl.so.REMOVED.git-id delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libtiff.so.5.1.0 delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libtiff.so.REMOVED.git-id delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/lib/libexpat.so.1.5.2 delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/lib/libexpat.so.REMOVED.git-id delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/lib/libz.so.1.2.5 delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/lib/libz.so.REMOVED.git-id delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/curl/curl.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/curl/curlbuild.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/curl/curlrules.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/curl/curlver.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/curl/easy.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/curl/mprintf.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/curl/stdcheaders.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/curl/typecheck-gcc.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/curl/types.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/fontconfig/fcfreetype.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/fontconfig/fcprivate.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/fontconfig/fontconfig.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/config/ftconfig-32.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/config/ftconfig.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/config/ftheader.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/config/ftmodule.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/config/ftoption.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/config/ftstdlib.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/freetype.h.REMOVED.git-id delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftadvanc.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftbbox.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftbdf.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftbitmap.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftbzip2.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftcache.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftchapters.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftcid.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/fterrdef.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/fterrors.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftgasp.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftglyph.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftgxval.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftgzip.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftimage.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftincrem.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftlcdfil.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftlist.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftlzw.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftmac.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftmm.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftmodapi.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftmoderr.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftotval.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftoutln.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftpfr.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftrender.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftsizes.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftsnames.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftstroke.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftsynth.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftsystem.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/fttrigon.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/fttypes.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftwinfnt.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftxf86.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/t1tables.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ttnameid.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/tttables.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/tttags.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ttunpat.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/ft2build.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/jconfig.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/jerror.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/jmorecfg.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/jpeglib.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/png.h.REMOVED.git-id delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/pngconf.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/sqlite3.h.REMOVED.git-id delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/sqlite3ext.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/tiff.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/tiffconf.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/tiffio.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/tiffio.hxx delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/tiffvers.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/zconf.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/zlib.h delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libcares.so.2.0.0 delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libcrypto.so.1.0.0 delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libcrypto.so.REMOVED.git-id delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libcurl.so.4.3.0 delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libcurl.so.REMOVED.git-id delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libfontconfig.so.1.5.0 delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libfontconfig.so.REMOVED.git-id delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libfreetype.so.6.8.1 delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libfreetype.so.REMOVED.git-id delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libidn.so.11.5.44 delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libidn.so.REMOVED.git-id delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libjpeg.so.8.0.2 delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libjpeg.so.REMOVED.git-id delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libpng.so.3.50.0 delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libpng.so.REMOVED.git-id delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libsqlite3.so.0.8.6 delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libsqlite3.so.REMOVED.git-id delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libssl.so.1.0.0 delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libssl.so.REMOVED.git-id delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libtiff.so.5.1.0 delete mode 100644 cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libtiff.so.REMOVED.git-id delete mode 100644 cocos2dx/platform/third_party/win32/curl/curlrules.h delete mode 100644 cocos2dx/platform/third_party/win32/curl/easy.h delete mode 100644 cocos2dx/platform/third_party/win32/curl/mprintf.h delete mode 100644 cocos2dx/platform/third_party/win32/curl/multi.h delete mode 100644 cocos2dx/platform/third_party/win32/curl/stdcheaders.h delete mode 100644 cocos2dx/platform/third_party/win32/curl/typecheck-gcc.h delete mode 100644 cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftbbox.h delete mode 100644 cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftbdf.h delete mode 100644 cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftbzip2.h delete mode 100644 cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftcid.h delete mode 100644 cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftgasp.h delete mode 100644 cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftgxval.h delete mode 100644 cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftgzip.h delete mode 100644 cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftincrem.h delete mode 100644 cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftlist.h delete mode 100644 cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftlzw.h delete mode 100644 cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftmac.h delete mode 100644 cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftmm.h delete mode 100644 cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftotval.h delete mode 100644 cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftpfr.h delete mode 100644 cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftrender.h delete mode 100644 cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftsizes.h delete mode 100644 cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftsnames.h delete mode 100644 cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftsystem.h delete mode 100644 cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftwinfnt.h delete mode 100644 cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftxf86.h delete mode 100644 cocos2dx/platform/third_party/win32/libfreetype2/freetype/t1tables.h delete mode 100644 cocos2dx/platform/third_party/win32/libfreetype2/freetype/ttunpat.h delete mode 100644 cocos2dx/platform/third_party/win32/libjpeg/jmorecfg.h delete mode 100644 cocos2dx/platform/third_party/win32/libjpeg/jpeglib.h delete mode 100644 cocos2dx/platform/third_party/win32/libtiff/tiff.h delete mode 100644 cocos2dx/platform/third_party/win32/libtiff/tiffio.h delete mode 100644 cocos2dx/platform/third_party/win32/libtiff/tiffvers.h delete mode 100644 cocos2dx/platform/third_party/win32/libwebp/types.h delete mode 100644 cocos2dx/platform/third_party/win32/third_party_versions.txt delete mode 100644 cocos2dx/platform/tizen/CCAccelerometer.cpp delete mode 100644 cocos2dx/platform/tizen/CCAccelerometer.h delete mode 100644 cocos2dx/platform/tizen/CCApplication.cpp delete mode 100644 cocos2dx/platform/tizen/CCApplication.h delete mode 100644 cocos2dx/platform/tizen/CCCommon.cpp delete mode 100644 cocos2dx/platform/tizen/CCDevice.cpp delete mode 100644 cocos2dx/platform/tizen/CCEGLView.cpp delete mode 100644 cocos2dx/platform/tizen/CCEGLView.h delete mode 100644 cocos2dx/platform/tizen/CCFileUtilsTizen.cpp delete mode 100644 cocos2dx/platform/tizen/CCFileUtilsTizen.h delete mode 100644 cocos2dx/platform/tizen/CCGL.h delete mode 100644 cocos2dx/platform/tizen/CCImage.cpp delete mode 100644 cocos2dx/platform/tizen/CCOspApplication.cpp delete mode 100644 cocos2dx/platform/tizen/CCOspApplication.h delete mode 100644 cocos2dx/platform/tizen/CCOspForm.cpp delete mode 100644 cocos2dx/platform/tizen/CCOspForm.h delete mode 100644 cocos2dx/platform/tizen/CCPlatformDefine.h delete mode 100644 cocos2dx/platform/tizen/CCStdC.h delete mode 100644 cocos2dx/proj.emscripten/Makefile delete mode 100644 cocos2dx/proj.emscripten/cocos2dx.mk delete mode 100644 cocos2dx/proj.nacl/Makefile delete mode 100644 cocos2dx/proj.nacl/cocos2dx.mk delete mode 100644 cocos2dx/proj.qt5/cocos2dx.pro delete mode 100644 cocos2dx/proj.qt5/common.pri delete mode 100644 cocos2dx/proj.tizen/.cproject delete mode 100644 cocos2dx/proj.tizen/.project delete mode 100644 cocos2dx/proj.tizen/src/placeholder.txt delete mode 100644 cocos2dx/support/user_default/Archive.zip delete mode 100755 create-multi-platform-projects.py rename {document => docs}/Groups.h (100%) rename {document => docs}/MainPage.h (100%) rename {document => docs}/doxygen.config (100%) delete mode 100644 document/.gitignore delete mode 100644 extensions/proj.emscripten/Makefile delete mode 100644 extensions/proj.ios/extensions-Prefix.pch delete mode 100644 extensions/proj.ios/extensions.xcodeproj/project.pbxproj delete mode 100644 extensions/proj.mac/extensions-Prefix.pch delete mode 100644 extensions/proj.mac/extensions.xcodeproj/project.pbxproj delete mode 100644 extensions/proj.nacl/Makefile delete mode 100644 extensions/proj.qt5/extensions.pro delete mode 100644 extensions/proj.tizen/.cproject delete mode 100644 extensions/proj.tizen/.project delete mode 100644 extensions/proj.tizen/src/placeholder.txt delete mode 100644 external/Box2D/proj.emscripten/Makefile delete mode 100644 external/Box2D/proj.ios/Box2D-Prefix.pch delete mode 100644 external/Box2D/proj.ios/Box2D.xcodeproj/project.pbxproj delete mode 100644 external/Box2D/proj.mac/Box2D-Prefix.pch delete mode 100644 external/Box2D/proj.mac/Box2D.xcodeproj/project.pbxproj delete mode 100644 external/Box2D/proj.nacl/Makefile delete mode 100644 external/Box2D/proj.qt5/box2d.pro delete mode 100644 external/Box2D/proj.tizen/.cproject delete mode 100644 external/Box2D/proj.tizen/.project delete mode 100644 external/Box2D/proj.tizen/src/.gitkeep rename {cocos2dx/platform/third_party/common => external}/atitc/atitc.cpp (100%) rename {cocos2dx/platform/third_party/common => external}/atitc/atitc.h (100%) delete mode 100644 external/chipmunk/proj.emscripten/Makefile delete mode 100644 external/chipmunk/proj.ios/chipmunk-Prefix.pch delete mode 100644 external/chipmunk/proj.ios/chipmunk.xcodeproj/project.pbxproj delete mode 100644 external/chipmunk/proj.mac/chipmunk-Prefix.pch delete mode 100644 external/chipmunk/proj.mac/chipmunk.xcodeproj/project.pbxproj delete mode 100644 external/chipmunk/proj.nacl/Makefile delete mode 100644 external/chipmunk/proj.qt5/chipmunk.pro delete mode 100644 external/chipmunk/proj.tizen/.cproject delete mode 100644 external/chipmunk/proj.tizen/.project delete mode 100644 external/chipmunk/proj.tizen/src/placeholder.txt rename {cocos2dx/platform/third_party/android/prebuilt/libcurl/include/curl => external/curl/include/andorid}/curl.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libcurl/include/curl => external/curl/include/andorid}/curlbuild.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libcurl/include/curl => external/curl/include/andorid}/curlrules.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libcurl/include/curl => external/curl/include/andorid}/curlver.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libcurl/include/curl => external/curl/include/andorid}/easy.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libcurl/include/curl => external/curl/include/andorid}/mprintf.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libcurl/include/curl => external/curl/include/andorid}/multi.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libcurl/include/curl => external/curl/include/andorid}/stdcheaders.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libcurl/include/curl => external/curl/include/andorid}/typecheck-gcc.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libcurl/include/curl => external/curl/include/andorid}/types.h (100%) rename {cocos2dx/platform/third_party/ios/curl => external/curl/include/ios}/curl.h (100%) rename {cocos2dx/platform/third_party/ios/curl => external/curl/include/ios}/curlbuild.h (100%) rename {cocos2dx/platform/third_party/ios/curl => external/curl/include/ios}/curlrules.h (100%) rename {cocos2dx/platform/third_party/ios/curl => external/curl/include/ios}/curlver.h (100%) rename {cocos2dx/platform/third_party/ios/curl => external/curl/include/ios}/easy.h (100%) rename {cocos2dx/platform/third_party/ios/curl => external/curl/include/ios}/mprintf.h (100%) rename {cocos2dx/platform/third_party/ios/curl => external/curl/include/ios}/multi.h (100%) rename {cocos2dx/platform/third_party/ios/curl => external/curl/include/ios}/stdcheaders.h (100%) rename {cocos2dx/platform/third_party/ios/curl => external/curl/include/ios}/typecheck-gcc.h (100%) rename {cocos2dx/platform/third_party/linux/curl => external/curl/include/linux/32-bit}/curl.h (100%) rename {cocos2dx/platform/third_party/linux/curl => external/curl/include/linux/32-bit}/curlbuild.h (100%) rename {cocos2dx/platform/third_party/linux/curl => external/curl/include/linux/32-bit}/curlrules.h (100%) rename {cocos2dx/platform/third_party/linux/curl => external/curl/include/linux/32-bit}/curlver.h (100%) rename {cocos2dx/platform/third_party/linux/curl => external/curl/include/linux/32-bit}/easy.h (100%) rename {cocos2dx/platform/third_party/linux/curl => external/curl/include/linux/32-bit}/mprintf.h (100%) rename {cocos2dx/platform/third_party/linux/curl => external/curl/include/linux/32-bit}/multi.h (100%) rename {cocos2dx/platform/third_party/linux/curl => external/curl/include/linux/32-bit}/stdcheaders.h (100%) rename {cocos2dx/platform/third_party/linux/curl => external/curl/include/linux/32-bit}/typecheck-gcc.h (100%) rename {cocos2dx/platform/third_party/linux/include64/curl => external/curl/include/linux/64-bit}/curl.h (100%) rename {cocos2dx/platform/third_party/linux/include64/curl => external/curl/include/linux/64-bit}/curlbuild.h (100%) rename {cocos2dx/platform/third_party/linux/include64/curl => external/curl/include/linux/64-bit}/curlrules.h (100%) rename {cocos2dx/platform/third_party/linux/include64/curl => external/curl/include/linux/64-bit}/curlver.h (100%) rename {cocos2dx/platform/third_party/linux/include64/curl => external/curl/include/linux/64-bit}/easy.h (100%) rename {cocos2dx/platform/third_party/linux/include64/curl => external/curl/include/linux/64-bit}/mprintf.h (100%) rename {cocos2dx/platform/third_party/linux/include64/curl => external/curl/include/linux/64-bit}/multi.h (100%) rename {cocos2dx/platform/third_party/linux/include64/curl => external/curl/include/linux/64-bit}/stdcheaders.h (100%) rename {cocos2dx/platform/third_party/win32/curl => external/curl/include/win32}/curl.h (100%) rename {cocos2dx/platform/third_party/win32/curl => external/curl/include/win32}/curlbuild.h (100%) rename {cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/curl => external/curl/include/win32}/curlrules.h (100%) rename {cocos2dx/platform/third_party/win32/curl => external/curl/include/win32}/curlver.h (100%) rename {cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/curl => external/curl/include/win32}/easy.h (100%) rename {cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/curl => external/curl/include/win32}/mprintf.h (100%) rename {cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/curl => external/curl/include/win32}/multi.h (100%) rename {cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/curl => external/curl/include/win32}/stdcheaders.h (100%) rename {cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/curl => external/curl/include/win32}/typecheck-gcc.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libcurl => external/curl/prebuilt/andorid}/Android.mk (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libcurl/libs => external/curl/prebuilt/andorid}/armeabi-v7a/libcurl.a.REMOVED.git-id (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libcurl/libs => external/curl/prebuilt/andorid}/armeabi/libcurl.a.REMOVED.git-id (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libcurl/libs => external/curl/prebuilt/andorid}/x86/libcurl.a.REMOVED.git-id (100%) rename {cocos2dx/platform/third_party/ios/libraries => external/curl/prebuilt/ios}/libcurl.a.REMOVED.git-id (100%) rename {cocos2dx/platform/third_party/linux/libraries => external/curl/prebuilt/linux/32-bit}/libcurl.a.REMOVED.git-id (100%) rename {cocos2dx/platform/third_party/linux/libraries/lib64 => external/curl/prebuilt/linux/64-bit}/libcurl.a.REMOVED.git-id (100%) rename {cocos2dx/platform/third_party/win32/libraries => external/curl/prebuilt/win32}/libcurl.dll.REMOVED.git-id (100%) delete mode 160000 external/emscripten rename {cocos2dx/platform/third_party/common/etc => external/etc1}/etc1.cpp (100%) rename {cocos2dx/platform/third_party/common/etc => external/etc1}/etc1.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include => external/freetype2/include/andorid}/freetype2/freetype/config/ftconfig.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include => external/freetype2/include/andorid}/freetype2/freetype/config/ftheader.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include => external/freetype2/include/andorid}/freetype2/freetype/config/ftmodule.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include => external/freetype2/include/andorid}/freetype2/freetype/config/ftoption.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include => external/freetype2/include/andorid}/freetype2/freetype/config/ftstdlib.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include => external/freetype2/include/andorid}/freetype2/freetype/freetype.h.REMOVED.git-id (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include => external/freetype2/include/andorid}/freetype2/freetype/ftadvanc.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include => external/freetype2/include/andorid}/freetype2/freetype/ftautoh.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include => external/freetype2/include/andorid}/freetype2/freetype/ftbbox.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include => external/freetype2/include/andorid}/freetype2/freetype/ftbdf.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include => external/freetype2/include/andorid}/freetype2/freetype/ftbitmap.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include => external/freetype2/include/andorid}/freetype2/freetype/ftbzip2.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include => external/freetype2/include/andorid}/freetype2/freetype/ftcache.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include => external/freetype2/include/andorid}/freetype2/freetype/ftcffdrv.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include => external/freetype2/include/andorid}/freetype2/freetype/ftchapters.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include => external/freetype2/include/andorid}/freetype2/freetype/ftcid.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include => external/freetype2/include/andorid}/freetype2/freetype/fterrdef.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include => external/freetype2/include/andorid}/freetype2/freetype/fterrors.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include => external/freetype2/include/andorid}/freetype2/freetype/ftgasp.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include => external/freetype2/include/andorid}/freetype2/freetype/ftglyph.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include => external/freetype2/include/andorid}/freetype2/freetype/ftgxval.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include => external/freetype2/include/andorid}/freetype2/freetype/ftgzip.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include => external/freetype2/include/andorid}/freetype2/freetype/ftimage.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include => external/freetype2/include/andorid}/freetype2/freetype/ftincrem.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include => external/freetype2/include/andorid}/freetype2/freetype/ftlcdfil.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include => external/freetype2/include/andorid}/freetype2/freetype/ftlist.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include => external/freetype2/include/andorid}/freetype2/freetype/ftlzw.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include => external/freetype2/include/andorid}/freetype2/freetype/ftmac.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include => external/freetype2/include/andorid}/freetype2/freetype/ftmm.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include => external/freetype2/include/andorid}/freetype2/freetype/ftmodapi.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include => external/freetype2/include/andorid}/freetype2/freetype/ftmoderr.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include => external/freetype2/include/andorid}/freetype2/freetype/ftotval.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include => external/freetype2/include/andorid}/freetype2/freetype/ftoutln.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include => external/freetype2/include/andorid}/freetype2/freetype/ftpfr.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include => external/freetype2/include/andorid}/freetype2/freetype/ftrender.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include => external/freetype2/include/andorid}/freetype2/freetype/ftsizes.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include => external/freetype2/include/andorid}/freetype2/freetype/ftsnames.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include => external/freetype2/include/andorid}/freetype2/freetype/ftstroke.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include => external/freetype2/include/andorid}/freetype2/freetype/ftsynth.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include => external/freetype2/include/andorid}/freetype2/freetype/ftsystem.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include => external/freetype2/include/andorid}/freetype2/freetype/fttrigon.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include => external/freetype2/include/andorid}/freetype2/freetype/ftttdrv.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include => external/freetype2/include/andorid}/freetype2/freetype/fttypes.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include => external/freetype2/include/andorid}/freetype2/freetype/ftwinfnt.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include => external/freetype2/include/andorid}/freetype2/freetype/ftxf86.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include => external/freetype2/include/andorid}/freetype2/freetype/t1tables.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include => external/freetype2/include/andorid}/freetype2/freetype/ttnameid.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include => external/freetype2/include/andorid}/freetype2/freetype/tttables.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include => external/freetype2/include/andorid}/freetype2/freetype/tttags.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include => external/freetype2/include/andorid}/freetype2/freetype/ttunpat.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include => external/freetype2/include/andorid}/ft2build.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/config/ftconfig.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/config/ftheader.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/config/ftmodule.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/config/ftoption.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/config/ftstdlib.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/freetype.h.REMOVED.git-id (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/ftadvanc.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/ftautoh.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/ftbbox.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/ftbdf.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/ftbitmap.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/ftbzip2.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/ftcache.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/ftcffdrv.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/ftchapters.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/ftcid.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/fterrdef.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/fterrors.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/ftgasp.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/ftglyph.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/ftgxval.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/ftgzip.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/ftimage.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/ftincrem.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/ftlcdfil.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/ftlist.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/ftlzw.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/ftmac.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/ftmm.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/ftmodapi.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/ftmoderr.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/ftotval.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/ftoutln.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/ftpfr.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/ftrender.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/ftsizes.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/ftsnames.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/ftstroke.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/ftsynth.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/ftsystem.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/fttrigon.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/ftttdrv.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/fttypes.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/ftwinfnt.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/ftxf86.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/internal/autohint.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/internal/ftcalc.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/internal/ftdebug.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/internal/ftdriver.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/internal/ftgloadr.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/internal/ftmemory.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/internal/ftobjs.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/internal/ftpic.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/internal/ftrfork.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/internal/ftserv.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/internal/ftstream.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/internal/fttrace.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/internal/ftvalid.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/internal/internal.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/internal/psaux.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/internal/pshints.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/internal/services/svbdf.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/internal/services/svcid.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/internal/services/svgldict.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/internal/services/svgxval.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/internal/services/svkern.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/internal/services/svmm.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/internal/services/svotval.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/internal/services/svpfr.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/internal/services/svpostnm.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/internal/services/svprop.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/internal/services/svpscmap.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/internal/services/svpsinfo.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/internal/services/svsfnt.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/internal/services/svttcmap.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/internal/services/svtteng.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/internal/services/svttglyf.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/internal/services/svwinfnt.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/internal/services/svxf86nm.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/internal/sfnt.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/internal/t1types.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/internal/tttypes.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/t1tables.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/ttnameid.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/tttables.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/tttags.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/freetype/ttunpat.h (100%) rename {cocos2dx/platform/third_party/ios/libfreetype2 => external/freetype2/include/ios}/ft2build.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/config/ftconfig.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/config/ftheader.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/config/ftmodule.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/config/ftoption.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/config/ftstdlib.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/freetype.h.REMOVED.git-id (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/ftadvanc.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/ftbbox.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/ftbdf.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/ftbitmap.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/ftbzip2.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/ftcache.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/ftchapters.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/ftcid.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/fterrdef.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/fterrors.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/ftgasp.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/ftglyph.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/ftgxval.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/ftgzip.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/ftimage.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/ftincrem.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/ftlcdfil.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/ftlist.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/ftlzw.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/ftmac.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/ftmm.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/ftmodapi.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/ftmoderr.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/ftotval.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/ftoutln.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/ftpfr.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/ftrender.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/ftsizes.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/ftsnames.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/ftstroke.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/ftsynth.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/ftsystem.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/fttrigon.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/fttypes.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/ftwinfnt.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/ftxf86.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/internal/autohint.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/internal/ftcalc.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/internal/ftdebug.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/internal/ftdriver.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/internal/ftgloadr.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/internal/ftmemory.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/internal/ftobjs.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/internal/ftpic.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/internal/ftrfork.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/internal/ftserv.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/internal/ftstream.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/internal/fttrace.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/internal/ftvalid.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/internal/internal.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/internal/psaux.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/internal/pshints.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/internal/services/svbdf.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/internal/services/svcid.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/internal/services/svgldict.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/internal/services/svgxval.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/internal/services/svkern.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/internal/services/svmm.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/internal/services/svotval.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/internal/services/svpfr.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/internal/services/svpostnm.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/internal/services/svpscmap.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/internal/services/svpsinfo.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/internal/services/svsfnt.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/internal/services/svttcmap.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/internal/services/svtteng.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/internal/services/svttglyf.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/internal/services/svwinfnt.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/internal/services/svxf86nm.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/internal/sfnt.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/internal/t1types.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/internal/tttypes.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/t1tables.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/ttnameid.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/tttables.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/tttags.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/freetype/ttunpat.h (100%) rename {cocos2dx/platform/third_party/linux/libfreetype2 => external/freetype2/include/linux}/ft2build.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/config/ftconfig.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/config/ftheader.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/config/ftmodule.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/config/ftoption.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/config/ftstdlib.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/freetype.h.REMOVED.git-id (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/ftadvanc.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/ftautoh.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/ftbbox.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/ftbdf.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/ftbitmap.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/ftbzip2.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/ftcache.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/ftcffdrv.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/ftchapters.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/ftcid.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/fterrdef.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/fterrors.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/ftgasp.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/ftglyph.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/ftgxval.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/ftgzip.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/ftimage.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/ftincrem.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/ftlcdfil.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/ftlist.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/ftlzw.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/ftmac.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/ftmm.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/ftmodapi.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/ftmoderr.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/ftotval.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/ftoutln.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/ftpfr.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/ftrender.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/ftsizes.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/ftsnames.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/ftstroke.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/ftsynth.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/ftsystem.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/fttrigon.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/ftttdrv.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/fttypes.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/ftwinfnt.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/ftxf86.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/internal/autohint.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/internal/ftcalc.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/internal/ftdebug.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/internal/ftdriver.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/internal/ftgloadr.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/internal/ftmemory.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/internal/ftobjs.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/internal/ftpic.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/internal/ftrfork.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/internal/ftserv.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/internal/ftstream.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/internal/fttrace.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/internal/ftvalid.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/internal/internal.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/internal/psaux.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/internal/pshints.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/internal/services/svbdf.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/internal/services/svcid.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/internal/services/svgldict.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/internal/services/svgxval.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/internal/services/svkern.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/internal/services/svmm.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/internal/services/svotval.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/internal/services/svpfr.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/internal/services/svpostnm.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/internal/services/svprop.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/internal/services/svpscmap.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/internal/services/svpsinfo.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/internal/services/svsfnt.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/internal/services/svttcmap.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/internal/services/svtteng.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/internal/services/svttglyf.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/internal/services/svwinfnt.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/internal/services/svxf86nm.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/internal/sfnt.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/internal/t1types.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/internal/tttypes.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/t1tables.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/ttnameid.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/tttables.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/tttags.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/freetype/ttunpat.h (100%) rename {cocos2dx/platform/third_party/mac/libfreetype2 => external/freetype2/include/mac}/ft2build.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/config/ftconfig.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/config/ftheader.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/config/ftmodule.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/config/ftoption.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/config/ftstdlib.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/freetype.h.REMOVED.git-id (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/ftadvanc.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/ftautoh.h (100%) rename {cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2 => external/freetype2/include/win32}/freetype/ftbbox.h (100%) rename {cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2 => external/freetype2/include/win32}/freetype/ftbdf.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/ftbitmap.h (100%) rename {cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2 => external/freetype2/include/win32}/freetype/ftbzip2.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/ftcache.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/ftcffdrv.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/ftchapters.h (100%) rename {cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2 => external/freetype2/include/win32}/freetype/ftcid.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/fterrdef.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/fterrors.h (100%) rename {cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2 => external/freetype2/include/win32}/freetype/ftgasp.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/ftglyph.h (100%) rename {cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2 => external/freetype2/include/win32}/freetype/ftgxval.h (100%) rename {cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2 => external/freetype2/include/win32}/freetype/ftgzip.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/ftimage.h (100%) rename {cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2 => external/freetype2/include/win32}/freetype/ftincrem.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/ftlcdfil.h (100%) rename {cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2 => external/freetype2/include/win32}/freetype/ftlist.h (100%) rename {cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2 => external/freetype2/include/win32}/freetype/ftlzw.h (100%) rename {cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2 => external/freetype2/include/win32}/freetype/ftmac.h (100%) rename {cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2 => external/freetype2/include/win32}/freetype/ftmm.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/ftmodapi.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/ftmoderr.h (100%) rename {cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2 => external/freetype2/include/win32}/freetype/ftotval.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/ftoutln.h (100%) rename {cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2 => external/freetype2/include/win32}/freetype/ftpfr.h (100%) rename {cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2 => external/freetype2/include/win32}/freetype/ftrender.h (100%) rename {cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2 => external/freetype2/include/win32}/freetype/ftsizes.h (100%) rename {cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2 => external/freetype2/include/win32}/freetype/ftsnames.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/ftstroke.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/ftsynth.h (100%) rename {cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2 => external/freetype2/include/win32}/freetype/ftsystem.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/fttrigon.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/ftttdrv.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/fttypes.h (100%) rename {cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2 => external/freetype2/include/win32}/freetype/ftwinfnt.h (100%) rename {cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2 => external/freetype2/include/win32}/freetype/ftxf86.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/internal/autohint.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/internal/ftcalc.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/internal/ftdebug.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/internal/ftdriver.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/internal/ftgloadr.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/internal/ftmemory.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/internal/ftobjs.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/internal/ftpic.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/internal/ftrfork.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/internal/ftserv.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/internal/ftstream.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/internal/fttrace.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/internal/ftvalid.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/internal/internal.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/internal/psaux.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/internal/pshints.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/internal/services/svbdf.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/internal/services/svcid.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/internal/services/svgldict.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/internal/services/svgxval.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/internal/services/svkern.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/internal/services/svmm.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/internal/services/svotval.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/internal/services/svpfr.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/internal/services/svpostnm.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/internal/services/svprop.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/internal/services/svpscmap.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/internal/services/svpsinfo.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/internal/services/svsfnt.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/internal/services/svttcmap.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/internal/services/svtteng.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/internal/services/svttglyf.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/internal/services/svwinfnt.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/internal/services/svxf86nm.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/internal/sfnt.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/internal/t1types.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/internal/tttypes.h (100%) rename {cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2 => external/freetype2/include/win32}/freetype/t1tables.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/ttnameid.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/tttables.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/freetype/tttags.h (100%) rename {cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2 => external/freetype2/include/win32}/freetype/ttunpat.h (100%) rename {cocos2dx/platform/third_party/win32/libfreetype2 => external/freetype2/include/win32}/ft2build.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libfreetype2 => external/freetype2/prebuilt/andorid}/Android.mk (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libfreetype2/libs => external/freetype2/prebuilt/andorid}/armeabi-v7a/libfreetype.a.REMOVED.git-id (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libfreetype2/libs => external/freetype2/prebuilt/andorid}/armeabi/libfreetype.a.REMOVED.git-id (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libfreetype2/libs => external/freetype2/prebuilt/andorid}/x86/libfreetype.a.REMOVED.git-id (100%) rename {cocos2dx/platform/third_party/ios/libraries => external/freetype2/prebuilt/ios}/libfreetype.a.REMOVED.git-id (100%) rename {cocos2dx/platform/third_party/linux/libraries => external/freetype2/prebuilt/linux/32-bit}/libfreetype.a.REMOVED.git-id (100%) rename {cocos2dx/platform/third_party/linux/libraries/lib64 => external/freetype2/prebuilt/linux/64-bit}/libfreetype.a.REMOVED.git-id (100%) rename {cocos2dx/platform/third_party/mac/libraries => external/freetype2/prebuilt/mac}/libfreetype.a.REMOVED.git-id (100%) rename {cocos2dx/platform/third_party/win32/libraries => external/freetype2/prebuilt/win32}/freetype250.lib.REMOVED.git-id (100%) rename {cocos2dx/platform/third_party/linux/glfw => external/glfw3/include/linux}/glfw3.h (100%) rename {cocos2dx/platform/third_party/linux/glfw => external/glfw3/include/linux}/glfw3native.h (100%) rename {cocos2dx/platform/third_party/mac/glfw => external/glfw3/include/mac}/glfw3.h (100%) rename {cocos2dx/platform/third_party/mac/glfw => external/glfw3/include/mac}/glfw3native.h (100%) rename {cocos2dx/platform/third_party/win32/GLFW => external/glfw3/include/win32}/glfw3.h (100%) rename {cocos2dx/platform/third_party/win32/GLFW => external/glfw3/include/win32}/glfw3native.h (100%) rename {cocos2dx/platform/third_party/mac/libraries => external/glfw3/prebuilt/mac}/libglfw3.a.REMOVED.git-id (100%) rename {cocos2dx/platform/third_party/win32/libraries => external/glfw3/prebuilt/win32}/glfw3.lib.REMOVED.git-id (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libjpeg/include => external/jpeg/include/andorid}/jconfig.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libjpeg/include => external/jpeg/include/andorid}/jerror.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libjpeg/include => external/jpeg/include/andorid}/jmorecfg.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libjpeg/include => external/jpeg/include/andorid}/jpeglib.h (100%) rename {cocos2dx/platform/third_party/ios/libjpeg => external/jpeg/include/ios}/jconfig.h (100%) rename {cocos2dx/platform/third_party/emscripten/libjpeg => external/jpeg/include/ios}/jmorecfg.h (100%) rename {cocos2dx/platform/third_party/emscripten/libjpeg => external/jpeg/include/ios}/jpeglib.h (100%) rename {cocos2dx/platform/third_party/emscripten/libjpeg => external/jpeg/include/linux}/jconfig.h (100%) rename {cocos2dx/platform/third_party/ios/libjpeg => external/jpeg/include/linux}/jmorecfg.h (100%) rename {cocos2dx/platform/third_party/ios/libjpeg => external/jpeg/include/linux}/jpeglib.h (100%) rename {cocos2dx/platform/third_party/mac/libjpeg => external/jpeg/include/mac}/jconfig.h (100%) rename {cocos2dx/platform/third_party/linux/libjpeg => external/jpeg/include/mac}/jmorecfg.h (100%) rename {cocos2dx/platform/third_party/linux/libjpeg => external/jpeg/include/mac}/jpeglib.h (100%) rename {cocos2dx/platform/third_party/win32/libjpeg => external/jpeg/include/win32}/jconfig.h (100%) rename {cocos2dx/platform/third_party/mac/libjpeg => external/jpeg/include/win32}/jmorecfg.h (100%) rename {cocos2dx/platform/third_party/mac/libjpeg => external/jpeg/include/win32}/jpeglib.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libjpeg => external/jpeg/prebuilt/andorid}/Android.mk (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libjpeg/libs => external/jpeg/prebuilt/andorid}/armeabi-v7a/libjpeg.a.REMOVED.git-id (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libjpeg/libs => external/jpeg/prebuilt/andorid}/armeabi/libjpeg.a.REMOVED.git-id (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libjpeg/libs => external/jpeg/prebuilt/andorid}/x86/libjpeg.a.REMOVED.git-id (100%) rename {cocos2dx/platform/third_party/ios/libraries => external/jpeg/prebuilt/ios}/libjpeg.a.REMOVED.git-id (100%) rename {cocos2dx/platform/third_party/linux/libraries => external/jpeg/prebuilt/linux/32-bit}/libjpeg.a.REMOVED.git-id (100%) rename {cocos2dx/platform/third_party/linux/libraries/lib64 => external/jpeg/prebuilt/linux/64-bit}/libjpeg.a.REMOVED.git-id (100%) rename {cocos2dx/platform/third_party/mac/libraries => external/jpeg/prebuilt/mac}/libjpeg.a.REMOVED.git-id (100%) rename {cocos2dx/platform/third_party/win32/libraries => external/jpeg/prebuilt/win32}/libjpeg.lib.REMOVED.git-id (100%) rename {extensions/CocoStudio/Json/lib_json => external/jsoncpp}/autolink.h (100%) rename {extensions/CocoStudio/Json/lib_json => external/jsoncpp}/config.h (100%) rename {extensions/CocoStudio/Json/lib_json => external/jsoncpp}/features.h (100%) rename {extensions/CocoStudio/Json/lib_json => external/jsoncpp}/forwards.h (100%) rename {extensions/CocoStudio/Json/lib_json => external/jsoncpp}/json_batchallocator.h (100%) rename {extensions/CocoStudio/Json/lib_json => external/jsoncpp}/json_internalarray.inl (100%) rename {extensions/CocoStudio/Json/lib_json => external/jsoncpp}/json_internalmap.inl (100%) rename {extensions/CocoStudio/Json/lib_json => external/jsoncpp}/json_lib.h (100%) rename {extensions/CocoStudio/Json/lib_json => external/jsoncpp}/json_reader.cpp (100%) rename {extensions/CocoStudio/Json/lib_json => external/jsoncpp}/json_tool.h (100%) rename {extensions/CocoStudio/Json/lib_json => external/jsoncpp}/json_value.cpp (100%) rename {extensions/CocoStudio/Json/lib_json => external/jsoncpp}/json_valueiterator.inl (100%) rename {extensions/CocoStudio/Json/lib_json => external/jsoncpp}/json_writer.cpp (100%) rename {extensions/CocoStudio/Json/lib_json => external/jsoncpp}/reader.h (100%) rename {extensions/CocoStudio/Json/lib_json => external/jsoncpp}/sconscript (100%) rename {extensions/CocoStudio/Json/lib_json => external/jsoncpp}/value.h (100%) rename {extensions/CocoStudio/Json/lib_json => external/jsoncpp}/writer.h (100%) delete mode 100644 external/libwebp/dec/Makefile.am delete mode 100644 external/libwebp/dec/alpha.c delete mode 100644 external/libwebp/dec/buffer.c delete mode 100644 external/libwebp/dec/decode_vp8.h delete mode 100644 external/libwebp/dec/frame.c delete mode 100644 external/libwebp/dec/idec.c delete mode 100644 external/libwebp/dec/io.c delete mode 100644 external/libwebp/dec/layer.c delete mode 100644 external/libwebp/dec/quant.c delete mode 100644 external/libwebp/dec/tree.c delete mode 100644 external/libwebp/dec/vp8.c delete mode 100644 external/libwebp/dec/vp8i.h delete mode 100644 external/libwebp/dec/vp8l.c delete mode 100644 external/libwebp/dec/vp8li.h delete mode 100644 external/libwebp/dec/webp.c delete mode 100644 external/libwebp/dec/webpi.h delete mode 100644 external/libwebp/dsp/Makefile.am delete mode 100644 external/libwebp/dsp/cpu.c delete mode 100644 external/libwebp/dsp/dec.c delete mode 100644 external/libwebp/dsp/dec_neon.c delete mode 100644 external/libwebp/dsp/dec_sse2.c delete mode 100644 external/libwebp/dsp/dsp.h delete mode 100644 external/libwebp/dsp/enc.c delete mode 100644 external/libwebp/dsp/enc_sse2.c delete mode 100644 external/libwebp/dsp/lossless.c delete mode 100644 external/libwebp/dsp/lossless.h delete mode 100644 external/libwebp/dsp/upsampling.c delete mode 100644 external/libwebp/dsp/upsampling_sse2.c delete mode 100644 external/libwebp/dsp/yuv.c delete mode 100644 external/libwebp/dsp/yuv.h delete mode 100644 external/libwebp/enc/Makefile.am delete mode 100644 external/libwebp/enc/alpha.c delete mode 100644 external/libwebp/enc/analysis.c delete mode 100644 external/libwebp/enc/backward_references.c delete mode 100644 external/libwebp/enc/backward_references.h delete mode 100644 external/libwebp/enc/config.c delete mode 100644 external/libwebp/enc/cost.c delete mode 100644 external/libwebp/enc/cost.h delete mode 100644 external/libwebp/enc/filter.c delete mode 100644 external/libwebp/enc/frame.c delete mode 100644 external/libwebp/enc/histogram.c delete mode 100644 external/libwebp/enc/histogram.h delete mode 100644 external/libwebp/enc/iterator.c delete mode 100644 external/libwebp/enc/layer.c delete mode 100644 external/libwebp/enc/picture.c delete mode 100644 external/libwebp/enc/quant.c delete mode 100644 external/libwebp/enc/syntax.c delete mode 100644 external/libwebp/enc/tree.c delete mode 100644 external/libwebp/enc/vp8enci.h delete mode 100644 external/libwebp/enc/vp8l.c delete mode 100644 external/libwebp/enc/vp8li.h delete mode 100644 external/libwebp/enc/webpenc.c delete mode 100644 external/libwebp/mux/Makefile.am delete mode 100644 external/libwebp/mux/demux.c delete mode 100644 external/libwebp/mux/muxedit.c delete mode 100644 external/libwebp/mux/muxi.h delete mode 100644 external/libwebp/mux/muxinternal.c delete mode 100644 external/libwebp/mux/muxread.c delete mode 100644 external/libwebp/utils/Makefile.am delete mode 100644 external/libwebp/utils/bit_reader.c delete mode 100644 external/libwebp/utils/bit_reader.h delete mode 100644 external/libwebp/utils/bit_writer.c delete mode 100644 external/libwebp/utils/bit_writer.h delete mode 100644 external/libwebp/utils/color_cache.c delete mode 100644 external/libwebp/utils/color_cache.h delete mode 100644 external/libwebp/utils/filters.c delete mode 100644 external/libwebp/utils/filters.h delete mode 100644 external/libwebp/utils/huffman.c delete mode 100644 external/libwebp/utils/huffman.h delete mode 100644 external/libwebp/utils/huffman_encode.c delete mode 100644 external/libwebp/utils/huffman_encode.h delete mode 100644 external/libwebp/utils/quant_levels.c delete mode 100644 external/libwebp/utils/quant_levels.h delete mode 100644 external/libwebp/utils/rescaler.c delete mode 100644 external/libwebp/utils/rescaler.h delete mode 100644 external/libwebp/utils/thread.c delete mode 100644 external/libwebp/utils/thread.h delete mode 100644 external/libwebp/utils/utils.c delete mode 100644 external/libwebp/utils/utils.h delete mode 100644 external/libwebp/webp/decode.h delete mode 100644 external/libwebp/webp/encode.h delete mode 100644 external/libwebp/webp/format_constants.h delete mode 100644 external/libwebp/webp/mux.h delete mode 100644 external/libwebp/webp/types.h rename {cocos2dx/platform/third_party/android/prebuilt/libpng/include => external/png/include/andorid}/png.h.REMOVED.git-id (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libpng/include => external/png/include/andorid}/pngconf.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libpng/include => external/png/include/andorid}/pnglibconf.h (100%) rename {cocos2dx/platform/third_party/ios/libpng => external/png/include/ios}/png.h.REMOVED.git-id (100%) rename {cocos2dx/platform/third_party/ios/libpng => external/png/include/ios}/pngconf.h (100%) rename {cocos2dx/platform/third_party/ios/libpng => external/png/include/ios}/pnglibconf.h (100%) rename {cocos2dx/platform/third_party/mac/libpng => external/png/include/mac}/png.h.REMOVED.git-id (100%) rename {cocos2dx/platform/third_party/mac/libpng => external/png/include/mac}/pngconf.h (100%) rename {cocos2dx/platform/third_party/mac/libpng => external/png/include/mac}/pnglibconf.h (100%) rename {cocos2dx/platform/third_party/win32/libpng => external/png/include/win32}/png.h.REMOVED.git-id (100%) rename {cocos2dx/platform/third_party/win32/libpng => external/png/include/win32}/pngconf.h (100%) rename {cocos2dx/platform/third_party/win32/libpng => external/png/include/win32}/pnglibconf.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libpng => external/png/prebuilt/andorid}/Android.mk (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libpng/libs => external/png/prebuilt/andorid}/armeabi-v7a/libpng.a.REMOVED.git-id (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libpng/libs => external/png/prebuilt/andorid}/armeabi/libpng.a.REMOVED.git-id (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libpng/libs => external/png/prebuilt/andorid}/x86/libpng.a.REMOVED.git-id (100%) rename {cocos2dx/platform/third_party/ios/libraries => external/png/prebuilt/ios}/libpng.a.REMOVED.git-id (100%) rename {cocos2dx/platform/third_party/mac/libraries => external/png/prebuilt/mac}/libpng.a.REMOVED.git-id (100%) rename {cocos2dx/platform/third_party/win32/libraries => external/png/prebuilt/win32}/libpng.lib.REMOVED.git-id (100%) rename {cocos2dx/platform/third_party/common => external}/s3tc/s3tc.cpp (100%) rename {cocos2dx/platform/third_party/common => external}/s3tc/s3tc.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/js-config.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/js.msg (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/js/Anchor.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/js/CallArgs.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/js/CharacterEncoding.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/js/Date.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/js/GCAPI.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/js/HashTable.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/js/HeapAPI.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/js/LegacyIntTypes.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/js/MemoryMetrics.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/js/PropertyKey.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/js/RequiredDefines.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/js/RootingAPI.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/js/TemplateLib.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/js/Utility.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/js/Value.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/js/Vector.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/jsalloc.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/jsapi.h.REMOVED.git-id (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/jsclass.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/jsclist.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/jscpucfg.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/jsdbgapi.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/jsdhash.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/jsfriendapi.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/jslock.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/json.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/jsperf.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/jsprf.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/jsprototypes.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/jsproxy.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/jsprvtd.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/jspubtd.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/jstypes.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/jsutil.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/jsversion.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/jswrapper.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/mozilla/Assertions.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/mozilla/Attributes.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/mozilla/BloomFilter.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/mozilla/Casting.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/mozilla/Char16.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/mozilla/CheckedInt.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/mozilla/Compiler.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/mozilla/Constants.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/mozilla/DebugOnly.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/mozilla/Decimal.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/mozilla/Endian.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/mozilla/EnumSet.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/mozilla/FloatingPoint.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/mozilla/GuardObjects.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/mozilla/HashFunctions.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/mozilla/Likely.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/mozilla/LinkedList.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/mozilla/MSStdInt.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/mozilla/MathAlgorithms.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/mozilla/MemoryChecking.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/mozilla/NullPtr.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/mozilla/PodOperations.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/mozilla/Poison.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/mozilla/Range.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/mozilla/RangedPtr.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/mozilla/RefPtr.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/mozilla/SHA1.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/mozilla/Scoped.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/mozilla/SplayTree.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/mozilla/StandardInteger.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/mozilla/ThreadLocal.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/mozilla/TypeTraits.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/mozilla/TypedEnum.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/mozilla/Types.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/mozilla/Util.h (100%) rename {scripting/javascript/spidermonkey-android/include => external/spidermonkey/include/andorid}/mozilla/WeakPtr.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/js-config.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/js.msg (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/js/Anchor.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/js/CallArgs.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/js/CharacterEncoding.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/js/Date.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/js/GCAPI.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/js/HashTable.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/js/HeapAPI.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/js/LegacyIntTypes.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/js/MemoryMetrics.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/js/PropertyKey.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/js/RequiredDefines.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/js/RootingAPI.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/js/TemplateLib.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/js/Utility.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/js/Value.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/js/Vector.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/jsalloc.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/jsapi.h.REMOVED.git-id (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/jsclass.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/jsclist.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/jscpucfg.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/jsdbgapi.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/jsdhash.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/jsfriendapi.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/jslock.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/json.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/jsperf.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/jsprf.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/jsprototypes.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/jsproxy.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/jsprvtd.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/jspubtd.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/jstypes.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/jsutil.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/jsversion.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/jswrapper.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/mozilla/Assertions.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/mozilla/Attributes.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/mozilla/BloomFilter.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/mozilla/Casting.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/mozilla/Char16.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/mozilla/CheckedInt.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/mozilla/Compiler.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/mozilla/Constants.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/mozilla/DebugOnly.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/mozilla/Decimal.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/mozilla/Endian.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/mozilla/EnumSet.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/mozilla/FloatingPoint.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/mozilla/GuardObjects.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/mozilla/HashFunctions.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/mozilla/Likely.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/mozilla/LinkedList.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/mozilla/MSStdInt.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/mozilla/MathAlgorithms.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/mozilla/MemoryChecking.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/mozilla/NullPtr.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/mozilla/PodOperations.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/mozilla/Poison.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/mozilla/Range.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/mozilla/RangedPtr.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/mozilla/RefPtr.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/mozilla/SHA1.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/mozilla/Scoped.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/mozilla/SplayTree.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/mozilla/StandardInteger.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/mozilla/ThreadLocal.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/mozilla/TypeTraits.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/mozilla/TypedEnum.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/mozilla/Types.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/mozilla/Util.h (100%) rename {scripting/javascript/spidermonkey-ios/include => external/spidermonkey/include/ios}/mozilla/WeakPtr.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/js-config.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/js.msg (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/js/Anchor.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/js/CallArgs.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/js/CharacterEncoding.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/js/Date.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/js/GCAPI.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/js/HashTable.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/js/HeapAPI.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/js/LegacyIntTypes.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/js/MemoryMetrics.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/js/PropertyKey.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/js/RequiredDefines.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/js/RootingAPI.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/js/TemplateLib.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/js/Utility.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/js/Value.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/js/Vector.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/jsalloc.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/jsapi.h.REMOVED.git-id (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/jsclass.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/jsclist.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/jscpucfg.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/jsdbgapi.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/jsdhash.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/jsfriendapi.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/jslock.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/json.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/jsperf.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/jsprf.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/jsprototypes.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/jsproxy.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/jsprvtd.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/jspubtd.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/jstypes.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/jsutil.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/jsversion.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/jswrapper.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/mozilla/Assertions.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/mozilla/Attributes.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/mozilla/BloomFilter.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/mozilla/Casting.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/mozilla/Char16.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/mozilla/CheckedInt.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/mozilla/Compiler.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/mozilla/Constants.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/mozilla/DebugOnly.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/mozilla/Decimal.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/mozilla/Endian.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/mozilla/EnumSet.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/mozilla/FloatingPoint.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/mozilla/GuardObjects.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/mozilla/HashFunctions.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/mozilla/Likely.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/mozilla/LinkedList.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/mozilla/MSStdInt.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/mozilla/MathAlgorithms.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/mozilla/MemoryChecking.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/mozilla/NullPtr.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/mozilla/PodOperations.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/mozilla/Poison.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/mozilla/Range.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/mozilla/RangedPtr.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/mozilla/RefPtr.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/mozilla/SHA1.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/mozilla/Scoped.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/mozilla/SplayTree.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/mozilla/StandardInteger.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/mozilla/ThreadLocal.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/mozilla/TypeTraits.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/mozilla/TypedEnum.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/mozilla/Types.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/mozilla/Util.h (100%) rename {scripting/javascript/spidermonkey-mac/include => external/spidermonkey/include/mac}/mozilla/WeakPtr.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/js-config.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/js.msg (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/js/Anchor.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/js/CallArgs.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/js/CharacterEncoding.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/js/Date.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/js/GCAPI.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/js/HashTable.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/js/HeapAPI.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/js/LegacyIntTypes.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/js/MemoryMetrics.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/js/PropertyKey.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/js/RequiredDefines.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/js/RootingAPI.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/js/TemplateLib.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/js/Utility.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/js/Value.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/js/Vector.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/jsalloc.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/jsapi.h.REMOVED.git-id (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/jsclass.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/jsclist.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/jscpucfg.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/jsdbgapi.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/jsdhash.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/jsfriendapi.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/jslock.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/json.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/jsperf.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/jsprf.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/jsprototypes.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/jsproxy.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/jsprvtd.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/jspubtd.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/jstypes.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/jsutil.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/jsversion.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/jswrapper.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/mozilla/Assertions.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/mozilla/Attributes.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/mozilla/BloomFilter.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/mozilla/Casting.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/mozilla/Char16.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/mozilla/CheckedInt.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/mozilla/Compiler.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/mozilla/Constants.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/mozilla/DebugOnly.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/mozilla/Decimal.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/mozilla/Endian.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/mozilla/EnumSet.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/mozilla/FloatingPoint.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/mozilla/GuardObjects.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/mozilla/HashFunctions.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/mozilla/Likely.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/mozilla/LinkedList.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/mozilla/MSStdInt.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/mozilla/MathAlgorithms.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/mozilla/MemoryChecking.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/mozilla/NullPtr.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/mozilla/PodOperations.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/mozilla/Poison.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/mozilla/Range.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/mozilla/RangedPtr.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/mozilla/RefPtr.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/mozilla/SHA1.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/mozilla/Scoped.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/mozilla/SplayTree.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/mozilla/StandardInteger.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/mozilla/ThreadLocal.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/mozilla/TypeTraits.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/mozilla/TypedEnum.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/mozilla/Types.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/mozilla/Util.h (100%) rename {scripting/javascript/spidermonkey-win32/include => external/spidermonkey/include/win32}/mozilla/WeakPtr.h (100%) rename {scripting/javascript/spidermonkey-android => external/spidermonkey/prebuilt/andorid}/Android.mk (100%) rename {scripting/javascript/spidermonkey-android/lib => external/spidermonkey/prebuilt/andorid}/armeabi-v7a/libjs_static.a.REMOVED.git-id (100%) rename {scripting/javascript/spidermonkey-android/lib => external/spidermonkey/prebuilt/andorid}/armeabi/libjs_static.a.REMOVED.git-id (100%) rename {scripting/javascript/spidermonkey-android/lib => external/spidermonkey/prebuilt/andorid}/x86/libjs_static.a.REMOVED.git-id (100%) rename {scripting/javascript/spidermonkey-ios/lib => external/spidermonkey/prebuilt/ios}/libjs_static.a.REMOVED.git-id (100%) rename {scripting/javascript/spidermonkey-mac/lib => external/spidermonkey/prebuilt/mac}/libjs_static.a.REMOVED.git-id (100%) rename {scripting/javascript/spidermonkey-win32/lib => external/spidermonkey/prebuilt/win32}/mozjs-23.0.dll.REMOVED.git-id (100%) rename {scripting/javascript/spidermonkey-win32/lib => external/spidermonkey/prebuilt/win32}/mozjs-23.0.lib.REMOVED.git-id (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libtiff/include => external/tiff/include/andorid}/tiff.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libtiff/include => external/tiff/include/andorid}/tiffconf.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libtiff/include => external/tiff/include/andorid}/tiffio.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libtiff/include => external/tiff/include/andorid}/tiffvers.h (100%) rename {cocos2dx/platform/third_party/emscripten/libtiff/include => external/tiff/include/ios}/tiff.h (100%) rename {cocos2dx/platform/third_party/ios/libtiff => external/tiff/include/ios}/tiffconf.h (100%) rename {cocos2dx/platform/third_party/emscripten/libtiff/include => external/tiff/include/ios}/tiffio.h (100%) rename {cocos2dx/platform/third_party/emscripten/libtiff/include => external/tiff/include/ios}/tiffvers.h (100%) rename {cocos2dx/platform/third_party/ios/libtiff => external/tiff/include/linux}/tiff.h (100%) rename {cocos2dx/platform/third_party/linux/libtiff => external/tiff/include/linux}/tiffconf.h (100%) rename {cocos2dx/platform/third_party/ios/libtiff => external/tiff/include/linux}/tiffio.h (100%) rename {cocos2dx/platform/third_party/ios/libtiff => external/tiff/include/linux}/tiffvers.h (100%) rename {cocos2dx/platform/third_party/linux/libtiff => external/tiff/include/mac}/tiff.h (100%) rename {cocos2dx/platform/third_party/mac/libtiff => external/tiff/include/mac}/tiffconf.h (100%) rename {cocos2dx/platform/third_party/linux/libtiff => external/tiff/include/mac}/tiffio.h (100%) rename {cocos2dx/platform/third_party/linux/libtiff => external/tiff/include/mac}/tiffvers.h (100%) rename {cocos2dx/platform/third_party/mac/libtiff => external/tiff/include/win32}/tiff.h (100%) rename {cocos2dx/platform/third_party/win32/libtiff => external/tiff/include/win32}/tiffconf.h (100%) rename {cocos2dx/platform/third_party/mac/libtiff => external/tiff/include/win32}/tiffio.h (100%) rename {cocos2dx/platform/third_party/mac/libtiff => external/tiff/include/win32}/tiffvers.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libtiff => external/tiff/prebuilt/andorid}/Android.mk (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libtiff/libs => external/tiff/prebuilt/andorid}/armeabi-v7a/libtiff.a.REMOVED.git-id (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libtiff/libs => external/tiff/prebuilt/andorid}/armeabi/libtiff.a.REMOVED.git-id (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libtiff/libs => external/tiff/prebuilt/andorid}/x86/libtiff.a.REMOVED.git-id (100%) rename {cocos2dx/platform/third_party/ios/libraries => external/tiff/prebuilt/ios}/libtiff.a.REMOVED.git-id (100%) rename {cocos2dx/platform/third_party/linux/libraries => external/tiff/prebuilt/linux/32-bit}/libtiff.a.REMOVED.git-id (100%) rename {cocos2dx/platform/third_party/linux/libraries/lib64 => external/tiff/prebuilt/linux/64-bit}/libtiff.a.REMOVED.git-id (100%) rename {cocos2dx/platform/third_party/mac/libraries => external/tiff/prebuilt/mac}/libtiff.a.REMOVED.git-id (100%) rename {cocos2dx/platform/third_party/win32/libraries => external/tiff/prebuilt/win32}/libtiff.dll.REMOVED.git-id (100%) rename {cocos2dx/platform/third_party/win32/libraries => external/tiff/prebuilt/win32}/libtiff.lib.REMOVED.git-id (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libwebp/include => external/webp/include/andorid}/decode.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libwebp/include => external/webp/include/andorid}/encode.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libwebp/include => external/webp/include/andorid}/types.h (100%) rename {cocos2dx/platform/third_party/ios/webp => external/webp/include/ios}/decode.h (100%) rename {cocos2dx/platform/third_party/ios/webp => external/webp/include/ios}/encode.h (100%) rename {cocos2dx/platform/third_party/emscripten/libwebp/webp => external/webp/include/ios}/types.h (100%) rename {cocos2dx/platform/third_party/linux/libwebp => external/webp/include/linux}/decode.h (100%) rename {cocos2dx/platform/third_party/linux/libwebp => external/webp/include/linux}/encode.h (100%) rename {cocos2dx/platform/third_party/ios/webp => external/webp/include/linux}/types.h (100%) rename {cocos2dx/platform/third_party/mac/webp => external/webp/include/mac}/decode.h (100%) rename {cocos2dx/platform/third_party/mac/webp => external/webp/include/mac}/encode.h (100%) rename {cocos2dx/platform/third_party/linux/libwebp => external/webp/include/mac}/types.h (100%) rename {cocos2dx/platform/third_party/win32/libwebp => external/webp/include/win32}/decode.h (100%) rename {cocos2dx/platform/third_party/win32/libwebp => external/webp/include/win32}/encode.h (100%) rename {cocos2dx/platform/third_party/mac/webp => external/webp/include/win32}/types.h (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libwebp => external/webp/prebuilt/andorid}/Android.mk (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libwebp/libs => external/webp/prebuilt/andorid}/armeabi-v7a/libwebp.a.REMOVED.git-id (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libwebp/libs => external/webp/prebuilt/andorid}/armeabi/libwebp.a.REMOVED.git-id (100%) rename {cocos2dx/platform/third_party/android/prebuilt/libwebp/libs => external/webp/prebuilt/andorid}/x86/libwebp.a.REMOVED.git-id (100%) rename {cocos2dx/platform/third_party/ios/libraries => external/webp/prebuilt/ios}/libwebp.a.REMOVED.git-id (100%) rename {cocos2dx/platform/third_party/linux/libraries => external/webp/prebuilt/linux/32-bit}/libwebp.a.REMOVED.git-id (100%) rename {cocos2dx/platform/third_party/linux/libraries/lib64 => external/webp/prebuilt/linux/64-bit}/libwebp.a.REMOVED.git-id (100%) rename {cocos2dx/platform/third_party/mac/libraries => external/webp/prebuilt/mac}/libwebp.a.REMOVED.git-id (100%) rename {cocos2dx/platform/third_party/win32/libraries => external/webp/prebuilt/win32}/libwebp.lib.REMOVED.git-id (100%) rename external/{libwebsockets => websockets}/android/Android.mk (100%) rename external/{libwebsockets => websockets}/android/include/libwebsockets.h (100%) rename external/{libwebsockets => websockets}/ios/include/libwebsockets.h (100%) rename external/{libwebsockets => websockets}/ios/lib/libwebsockets.a.REMOVED.git-id (100%) rename external/{libwebsockets => websockets}/mac/include/libwebsockets.h (100%) rename external/{libwebsockets => websockets}/mac/lib/libwebsockets.a.REMOVED.git-id (100%) rename external/{libwebsockets => websockets}/tizen/include/libwebsockets.h (100%) rename external/{libwebsockets => websockets}/tizen/lib/armv7l/libwebsockets.a.REMOVED.git-id (100%) rename external/{libwebsockets => websockets}/tizen/lib/x86/libwebsockets.a.REMOVED.git-id (100%) rename external/{libwebsockets => websockets}/win32/include/libwebsockets.h (100%) rename external/{libwebsockets => websockets}/win32/include/win32helpers/gettimeofday.h (100%) rename external/{libwebsockets => websockets}/win32/include/win32helpers/websock-w32.h (100%) rename {cocos2dx/platform/third_party/win32 => external/win32-specific/gles/include}/OGLES/GL/glew.h.REMOVED.git-id (100%) rename {cocos2dx/platform/third_party/win32 => external/win32-specific/gles/include}/OGLES/GL/glxew.h (100%) rename {cocos2dx/platform/third_party/win32 => external/win32-specific/gles/include}/OGLES/GL/wglew.h (100%) rename {cocos2dx/platform/third_party/win32/libraries => external/win32-specific/gles/prebuilt}/glew32.dll.REMOVED.git-id (100%) rename {cocos2dx/platform/third_party/win32/libraries => external/win32-specific/gles/prebuilt}/glew32.lib.REMOVED.git-id (100%) rename {cocos2dx/platform/third_party/win32/iconv => external/win32-specific/icon/include}/iconv.h (100%) rename {cocos2dx/platform/third_party/win32/libraries => external/win32-specific/icon/prebuilt}/iconv.dll.REMOVED.git-id (100%) rename {cocos2dx/platform/third_party/win32/zlib => external/win32-specific/zlib/include}/zconf.h (100%) rename {cocos2dx/platform/third_party/win32/zlib => external/win32-specific/zlib/include}/zlib.h (100%) delete mode 100644 samples/Cpp/HelloCpp/proj.emscripten/Makefile delete mode 100644 samples/Cpp/HelloCpp/proj.emscripten/main.cpp delete mode 100644 samples/Cpp/HelloCpp/proj.nacl/Makefile delete mode 100644 samples/Cpp/HelloCpp/proj.nacl/index.html delete mode 100644 samples/Cpp/HelloCpp/proj.nacl/main.cpp delete mode 100644 samples/Cpp/HelloCpp/proj.nacl/main.h delete mode 100644 samples/Cpp/HelloCpp/proj.qt5/HelloCpp.pro delete mode 100644 samples/Cpp/HelloCpp/proj.qt5/main.cpp delete mode 100644 samples/Cpp/HelloCpp/proj.tizen/.cproject delete mode 100644 samples/Cpp/HelloCpp/proj.tizen/.project delete mode 100644 samples/Cpp/HelloCpp/proj.tizen/README.mdown delete mode 100644 samples/Cpp/HelloCpp/proj.tizen/data/.gitkeep delete mode 100644 samples/Cpp/HelloCpp/proj.tizen/inc/.gitkeep delete mode 100644 samples/Cpp/HelloCpp/proj.tizen/lib/.gitkeep delete mode 100644 samples/Cpp/HelloCpp/proj.tizen/manifest.xml delete mode 100644 samples/Cpp/HelloCpp/proj.tizen/res/.gitkeep delete mode 100644 samples/Cpp/HelloCpp/proj.tizen/shared/data/.gitkeep delete mode 100644 samples/Cpp/HelloCpp/proj.tizen/shared/trusted/.gitkeep delete mode 100644 samples/Cpp/HelloCpp/proj.tizen/src/HelloCppEntry.cpp delete mode 100644 samples/Cpp/SimpleGame/proj.emscripten/Makefile delete mode 100644 samples/Cpp/SimpleGame/proj.emscripten/main.cpp delete mode 100644 samples/Cpp/SimpleGame/proj.nacl/Makefile delete mode 100644 samples/Cpp/SimpleGame/proj.nacl/index.html delete mode 100644 samples/Cpp/SimpleGame/proj.nacl/main.cpp delete mode 100644 samples/Cpp/SimpleGame/proj.nacl/main.h delete mode 100644 samples/Cpp/SimpleGame/proj.qt5/SimpleGame.pro delete mode 100644 samples/Cpp/SimpleGame/proj.qt5/main.cpp delete mode 100644 samples/Cpp/SimpleGame/proj.tizen/.cproject delete mode 100644 samples/Cpp/SimpleGame/proj.tizen/.project delete mode 100644 samples/Cpp/SimpleGame/proj.tizen/README.mdown delete mode 100644 samples/Cpp/SimpleGame/proj.tizen/data/.gitkeep delete mode 100644 samples/Cpp/SimpleGame/proj.tizen/lib/.gitkeep delete mode 100644 samples/Cpp/SimpleGame/proj.tizen/manifest.xml delete mode 100644 samples/Cpp/SimpleGame/proj.tizen/res/.gitkeep delete mode 100644 samples/Cpp/SimpleGame/proj.tizen/shared/data/.gitkeep delete mode 100644 samples/Cpp/SimpleGame/proj.tizen/shared/trusted/.gitkeep delete mode 100644 samples/Cpp/SimpleGame/proj.tizen/src/SimpleGameEntry.cpp delete mode 100644 samples/Cpp/TestCpp/proj.emscripten/Makefile delete mode 100644 samples/Cpp/TestCpp/proj.emscripten/main.cpp delete mode 100644 samples/Cpp/TestCpp/proj.nacl/Makefile delete mode 100644 samples/Cpp/TestCpp/proj.nacl/index.html delete mode 100644 samples/Cpp/TestCpp/proj.nacl/main.cpp delete mode 100644 samples/Cpp/TestCpp/proj.nacl/main.h delete mode 100644 samples/Cpp/TestCpp/proj.nacl/res/listener.js delete mode 100644 samples/Cpp/TestCpp/proj.nacl/res/main.js delete mode 100644 samples/Cpp/TestCpp/proj.nacl/res/package_index.html delete mode 100644 samples/Cpp/TestCpp/proj.qt5/TestCpp.pro delete mode 100644 samples/Cpp/TestCpp/proj.qt5/cocos2dx_TestCpp.desktop delete mode 100644 samples/Cpp/TestCpp/proj.qt5/main.cpp delete mode 100644 samples/Cpp/TestCpp/proj.tizen/.cproject delete mode 100644 samples/Cpp/TestCpp/proj.tizen/.project delete mode 100644 samples/Cpp/TestCpp/proj.tizen/README.mdown delete mode 100644 samples/Cpp/TestCpp/proj.tizen/data/.gitkeep delete mode 100644 samples/Cpp/TestCpp/proj.tizen/inc/.gitkeep delete mode 100644 samples/Cpp/TestCpp/proj.tizen/lib/.gitkeep delete mode 100644 samples/Cpp/TestCpp/proj.tizen/manifest.xml delete mode 100644 samples/Cpp/TestCpp/proj.tizen/res/.gitignore delete mode 100644 samples/Cpp/TestCpp/proj.tizen/res/.gitkeep delete mode 100644 samples/Cpp/TestCpp/proj.tizen/shared/data/.gitkeep delete mode 100644 samples/Cpp/TestCpp/proj.tizen/shared/trusted/.gitkeep delete mode 100644 samples/Cpp/TestCpp/proj.tizen/src/TestCppEntry.cpp delete mode 100644 samples/Lua/HelloLua/proj.emscripten/Makefile delete mode 100644 samples/Lua/HelloLua/proj.emscripten/main.cpp delete mode 100644 samples/Lua/HelloLua/proj.nacl/Makefile delete mode 100644 samples/Lua/HelloLua/proj.nacl/index.html delete mode 100644 samples/Lua/HelloLua/proj.nacl/main.cpp delete mode 100644 samples/Lua/HelloLua/proj.nacl/main.h delete mode 100644 samples/Lua/HelloLua/proj.tizen/.cproject delete mode 100644 samples/Lua/HelloLua/proj.tizen/.project delete mode 100644 samples/Lua/HelloLua/proj.tizen/data/.gitkeep delete mode 100644 samples/Lua/HelloLua/proj.tizen/lib/.gitkeep delete mode 100644 samples/Lua/HelloLua/proj.tizen/manifest.xml delete mode 100644 samples/Lua/HelloLua/proj.tizen/res/.gitkeep delete mode 100644 samples/Lua/HelloLua/proj.tizen/shared/data/.gitkeep delete mode 100644 samples/Lua/HelloLua/proj.tizen/shared/trusted/.gitkeep delete mode 100644 samples/Lua/HelloLua/proj.tizen/src/HelloLuaEntry.cpp delete mode 100644 samples/Lua/TestLua/proj.emscripten/Makefile delete mode 100644 samples/Lua/TestLua/proj.emscripten/main.cpp delete mode 100644 samples/Lua/TestLua/proj.nacl/Makefile delete mode 100644 samples/Lua/TestLua/proj.nacl/index.html delete mode 100644 samples/Lua/TestLua/proj.nacl/main.cpp delete mode 100644 samples/Lua/TestLua/proj.nacl/main.h delete mode 100644 samples/Lua/TestLua/proj.tizen/.cproject delete mode 100644 samples/Lua/TestLua/proj.tizen/.project delete mode 100644 samples/Lua/TestLua/proj.tizen/data/.gitkeep delete mode 100644 samples/Lua/TestLua/proj.tizen/inc/.gitkeep delete mode 100644 samples/Lua/TestLua/proj.tizen/lib/.gitkeep delete mode 100644 samples/Lua/TestLua/proj.tizen/manifest.xml delete mode 100644 samples/Lua/TestLua/proj.tizen/res/.gitkeep delete mode 100644 samples/Lua/TestLua/proj.tizen/shared/data/.gitkeep delete mode 100644 samples/Lua/TestLua/proj.tizen/shared/trusted/.gitkeep delete mode 100644 samples/Lua/TestLua/proj.tizen/src/TestLuaEntry.cpp delete mode 100644 samples/samples.xcodeproj/project.pbxproj.REMOVED.git-id delete mode 160000 scripting/auto-generated delete mode 100644 scripting/javascript/bindings/js/debugger/DevToolsUtils.js delete mode 100644 scripting/javascript/bindings/js/debugger/README.md delete mode 100644 scripting/javascript/bindings/js/debugger/actors/root.js delete mode 100644 scripting/javascript/bindings/js/debugger/actors/script.js delete mode 100644 scripting/javascript/bindings/js/debugger/core/promise.js delete mode 100644 scripting/javascript/bindings/js/debugger/main.js delete mode 100644 scripting/javascript/bindings/js/debugger/transport.js delete mode 100644 scripting/lua/proj.emscripten/Makefile delete mode 100644 scripting/lua/proj.nacl/Makefile delete mode 100644 scripting/lua/proj.qt5/lua.pro delete mode 100644 scripting/lua/proj.tizen/.cproject delete mode 100644 scripting/lua/proj.tizen/.project delete mode 100644 scripting/lua/proj.tizen/src/placeholder.txt delete mode 100755 tools/android-buildsetup.sh rename tools/{android_mk_generator => android-mk-generator}/android_mk_generator.py (100%) rename tools/{android_mk_generator => android-mk-generator}/config.py (100%) delete mode 100644 tools/emscripten-templates/basic/index.html delete mode 100644 tools/emscripten-templates/iphone-ipad-ipadhd/index.html rename tools/{jenkins_scripts => jenkins-scripts}/Monkeyrunner_TestCpp.py (100%) rename tools/{jenkins_scripts => jenkins-scripts}/ReportManager.py (100%) rename tools/{jenkins_scripts => jenkins-scripts}/ant.properties (100%) rename tools/{jenkins_scripts => jenkins-scripts}/build.xml (100%) rename tools/{jenkins_scripts => jenkins-scripts}/mac/android/build-android-2.2-3.2-debug.sh (100%) rename tools/{jenkins_scripts => jenkins-scripts}/mac/android/build-android-2.2-3.2-release.sh (100%) rename tools/{jenkins_scripts => jenkins-scripts}/mac/android/build-android-4.x-debug.sh (100%) rename tools/{jenkins_scripts => jenkins-scripts}/mac/android/build-android-4.x-release.sh (100%) rename tools/{jenkins_scripts => jenkins-scripts}/mac/android/generate-js-cxx-bindings.sh (100%) rename tools/{jenkins_scripts => jenkins-scripts}/mac/android/test-android-2.2-3.2-debug.sh (100%) rename tools/{jenkins_scripts => jenkins-scripts}/mac/android/test-android-2.2-3.2-release.sh (100%) rename tools/{jenkins_scripts => jenkins-scripts}/mac/android/test-android-4.x-debug.sh (100%) rename tools/{jenkins_scripts => jenkins-scripts}/mac/android/test-android-4.x-release.sh (100%) rename tools/{jenkins_scripts => jenkins-scripts}/mac/debug.keystore (100%) rename tools/{jenkins_scripts => jenkins-scripts}/mac/iOS_SikuliTest.sikuli/iOS_SikuliTest.html (100%) rename tools/{jenkins_scripts => jenkins-scripts}/mac/iOS_SikuliTest.sikuli/iOS_SikuliTest.py (100%) rename tools/{jenkins_scripts => jenkins-scripts}/mac/ios/build-ios-all.sh (100%) rename tools/{jenkins_scripts => jenkins-scripts}/mac/ios/build-ios-debug.sh (100%) rename tools/{jenkins_scripts => jenkins-scripts}/mac/ios/build-ios-release.sh (100%) rename tools/{jenkins_scripts => jenkins-scripts}/mac/ios/iphonesim (100%) rename tools/{jenkins_scripts => jenkins-scripts}/mac/ios/test-ios-debug.sh (100%) rename tools/{jenkins_scripts => jenkins-scripts}/mac/ios/test-ios-release.sh (100%) rename tools/{jenkins_scripts => jenkins-scripts}/mac/mac/build-mac-all.sh (100%) rename tools/{jenkins_scripts => jenkins-scripts}/mac/mac/build-mac-debug.sh (100%) rename tools/{jenkins_scripts => jenkins-scripts}/mac/mac/build-mac-release.sh (100%) rename tools/{jenkins_scripts => jenkins-scripts}/mac/mac/test-mac-debug.sh (100%) rename tools/{jenkins_scripts => jenkins-scripts}/mac/mac/test-mac-release.sh (100%) rename tools/{jenkins_scripts => jenkins-scripts}/mac/rootconfig-mac.sh (100%) rename tools/{jenkins_scripts => jenkins-scripts}/windows/android/androidtestcommon.bat (100%) rename tools/{jenkins_scripts => jenkins-scripts}/windows/android/build-android-2.2-3.2-debug.bat (100%) rename tools/{jenkins_scripts => jenkins-scripts}/windows/android/build-android-2.2-3.2-release.bat (100%) rename tools/{jenkins_scripts => jenkins-scripts}/windows/android/build-android-4.x-debug.bat (100%) rename tools/{jenkins_scripts => jenkins-scripts}/windows/android/build-android-4.x-release.bat (100%) rename tools/{jenkins_scripts => jenkins-scripts}/windows/android/rootconfig.sh (100%) rename tools/{jenkins_scripts => jenkins-scripts}/windows/android/test-android-2.2-3.2-debug.bat (100%) rename tools/{jenkins_scripts => jenkins-scripts}/windows/android/test-android-2.2-3.2-release.bat (100%) rename tools/{jenkins_scripts => jenkins-scripts}/windows/android/test-android-4.x-debug.bat (100%) rename tools/{jenkins_scripts => jenkins-scripts}/windows/android/test-android-4.x-release.bat (100%) rename tools/{jenkins_scripts => jenkins-scripts}/windows/win32/qtp_win32/Action0/ObjectRepository.bdb.REMOVED.git-id (100%) rename tools/{jenkins_scripts => jenkins-scripts}/windows/win32/qtp_win32/Action0/Resource.mtr (100%) rename tools/{jenkins_scripts => jenkins-scripts}/windows/win32/qtp_win32/Action0/Script.mts (100%) rename tools/{jenkins_scripts => jenkins-scripts}/windows/win32/qtp_win32/Action1/ObjectRepository.bdb.REMOVED.git-id (100%) rename tools/{jenkins_scripts => jenkins-scripts}/windows/win32/qtp_win32/Action1/Resource.mtr (100%) rename tools/{jenkins_scripts => jenkins-scripts}/windows/win32/qtp_win32/Action1/Script.mts (100%) rename tools/{jenkins_scripts => jenkins-scripts}/windows/win32/qtp_win32/Default.xls (100%) rename tools/{jenkins_scripts => jenkins-scripts}/windows/win32/qtp_win32/Error_Sub.vbs (100%) rename tools/{jenkins_scripts => jenkins-scripts}/windows/win32/qtp_win32/Error_appcrash.qrs (100%) rename tools/{jenkins_scripts => jenkins-scripts}/windows/win32/qtp_win32/Parameters.mtr (100%) rename tools/{jenkins_scripts => jenkins-scripts}/windows/win32/qtp_win32/Test.tsp (100%) rename tools/{jenkins_scripts => jenkins-scripts}/windows/win32/qtp_win32/TestCpp_Appcrash.tsr.REMOVED.git-id (100%) rename tools/{jenkins_scripts => jenkins-scripts}/windows/win32/qtp_win32/default.cfg (100%) rename tools/{jenkins_scripts => jenkins-scripts}/windows/win32/qtp_win32/default.usp (100%) rename tools/{jenkins_scripts => jenkins-scripts}/windows/win32/qtp_win32/lock.lck (100%) rename tools/{jenkins_scripts => jenkins-scripts}/windows/win32/qtp_win32/qtp_win32.usr (100%) rename tools/{jenkins_scripts => jenkins-scripts}/windows/win32/qtp_win32/qtrunner.vbs (100%) rename tools/{jenkins_scripts => jenkins-scripts}/windows/win32/test-win-vs2008-debug.bat (100%) rename tools/{jenkins_scripts => jenkins-scripts}/windows/win32/test-win-vs2008_release.bat (100%) rename tools/{jenkins_scripts => jenkins-scripts}/windows/win32/test-win-vs2010_debug.bat (100%) rename tools/{jenkins_scripts => jenkins-scripts}/windows/win32/test-win-vs2010_release.bat (100%) rename tools/{project_creator => project-creator}/__init__.py (100%) rename tools/{project_creator => project-creator}/create_project.py (100%) diff --git a/.gitignore b/.gitignore index 321ce706a4..14845a8164 100644 --- a/.gitignore +++ b/.gitignore @@ -63,7 +63,6 @@ build_*_vc10/ *.xcuserstate *.xccheckout xcschememanagement.plist -build/ .DS_Store ._.* xcuserdata/ diff --git a/.gitmodules b/.gitmodules index f7313b3346..7b07af24eb 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,15 +1,12 @@ [submodule "tools/bindings-generator"] path = tools/bindings-generator url = git://github.com/cocos2d/bindings-generator.git -[submodule "scripting/auto-generated"] - path = scripting/auto-generated +[submodule "cocos/scripting/auto-generated"] + path = cocos/scripting/auto-generated url = git://github.com/folecr/cocos2dx-autogen-bindings.git [submodule "samples/Javascript/Shared"] path = samples/Javascript/Shared url = git://github.com/cocos2d/cocos2d-js-tests.git -[submodule "external/emscripten"] - path = external/emscripten - url = git://github.com/kripken/emscripten.git [submodule "tools/cocos2d-console"] path = tools/cocos2d-console url = git://github.com/cocos2d/cocos2d-console.git diff --git a/audio/emscripten/SimpleAudioEngine.cpp b/audio/emscripten/SimpleAudioEngine.cpp deleted file mode 100644 index 5f39df9aa3..0000000000 --- a/audio/emscripten/SimpleAudioEngine.cpp +++ /dev/null @@ -1,304 +0,0 @@ -/**************************************************************************** -Copyright (c) 2013 Zynga Inc. -Copyright (c) 2010 cocos2d-x.org - -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. -****************************************************************************/ - -// XXX: This is all just a bit of a hack. SDL uses channels as its underlying -// abstraction, whilst CocosDenshion deals in individual effects. Consequently -// we can't set start/stop, because to SDL, effects (chunks) are just opaque -// blocks of data that get scheduled on channels. To workaround this, we assign -// each sound to a channel, but since there are only 32 channels, we use the -// modulus of the sound's address (which on Emscripten is just an incrementing -// integer) to decide which channel. -// -// A more rigorous implementation would have logic to store the state of -// channels and restore it as necessary. This should probably just be -// considered a toy for now, but it will probably prove sufficient for many -// use-cases. Recall also that Emscripten undoes this abstraction on the other -// side because it is using HTML5 audio objects as its underlying primitive! - -#include -#include -#include -#include - -#include "SimpleAudioEngine.h" -#include "cocos2d.h" - -#include -#include - -USING_NS_CC; - -using namespace std; - -namespace CocosDenshion -{ - struct soundData { - Mix_Chunk *chunk; - bool isLooped; - }; - - typedef map EffectsMap; - EffectsMap s_effects; - float s_effectsVolume = 1.0; - - typedef enum { - PLAYING, - STOPPED, - PAUSED, - } playStatus; - - struct backgroundMusicData { - Mix_Music *music; - }; - typedef map BackgroundMusicsMap; - BackgroundMusicsMap s_backgroundMusics; - float s_backgroundVolume = 1.0; - - static SimpleAudioEngine *s_engine = 0; - - // Unfortunately this is just hard-coded in Emscripten's SDL - // implementation. - static const int NR_CHANNELS = 32; - static void stopBackground(bool bReleaseData) - { - SimpleAudioEngine *engine = SimpleAudioEngine::getInstance(); - engine->stopBackgroundMusic(); - } - - SimpleAudioEngine::SimpleAudioEngine() - { - } - - SimpleAudioEngine::~SimpleAudioEngine() - { - } - - SimpleAudioEngine* SimpleAudioEngine::getInstance() - { - if (!s_engine) - s_engine = new SimpleAudioEngine(); - - return s_engine; - } - - void SimpleAudioEngine::end() - { - // clear all the sounds - EffectsMap::const_iterator end = s_effects.end(); - for (EffectsMap::iterator it = s_effects.begin(); it != end; it++) - { - Mix_FreeChunk(it->second->chunk); - delete it->second; - } - s_effects.clear(); - - // and the background too - stopBackground(true); - - for (BackgroundMusicsMap::iterator it = s_backgroundMusics.begin(); it != s_backgroundMusics.end(); ++it) - { - Mix_FreeMusic(it->second->music); - delete it->second; - } - s_backgroundMusics.clear(); - } - - // - // background audio - // - void SimpleAudioEngine::preloadBackgroundMusic(const char* pszFilePath) - { - } - - void SimpleAudioEngine::playBackgroundMusic(const char* pszFilePath, bool bLoop) - { - std::string key = std::string(pszFilePath); - struct backgroundMusicData *musicData; - if(!s_backgroundMusics.count(key)) - { - musicData = new struct backgroundMusicData(); - musicData->music = Mix_LoadMUS(pszFilePath); - s_backgroundMusics[key] = musicData; - } - else - { - musicData = s_backgroundMusics[key]; - } - - Mix_PlayMusic(musicData->music, bLoop ? -1 : 0); - } - - void SimpleAudioEngine::stopBackgroundMusic(bool bReleaseData) - { - Mix_HaltMusic(); - } - - void SimpleAudioEngine::pauseBackgroundMusic() - { - Mix_PauseMusic(); - } - - void SimpleAudioEngine::resumeBackgroundMusic() - { - Mix_ResumeMusic(); - } - - void SimpleAudioEngine::rewindBackgroundMusic() - { - CCLOGWARN("Cannot rewind background in Emscripten"); - } - - bool SimpleAudioEngine::willPlayBackgroundMusic() - { - return true; - } - - bool SimpleAudioEngine::isBackgroundMusicPlaying() - { - return Mix_PlayingMusic(); - } - - float SimpleAudioEngine::getBackgroundMusicVolume() - { - return s_backgroundVolume; - } - - void SimpleAudioEngine::setBackgroundMusicVolume(float volume) - { - // Ensure volume is between 0.0 and 1.0. - volume = volume > 1.0 ? 1.0 : volume; - volume = volume < 0.0 ? 0.0 : volume; - - Mix_VolumeMusic(volume * MIX_MAX_VOLUME); - s_backgroundVolume = volume; - } - - float SimpleAudioEngine::getEffectsVolume() - { - return s_effectsVolume; - } - - void SimpleAudioEngine::setEffectsVolume(float volume) - { - volume = volume > 1.0 ? 1.0 : volume; - volume = volume < 0.0 ? 0.0 : volume; - - // Need to set volume on every channel. SDL will then read this volume - // level and apply it back to the individual sample. - for(int i = 0; i < NR_CHANNELS; i++) - { - Mix_Volume(i, volume * MIX_MAX_VOLUME); - } - - s_effectsVolume = volume; - } - - unsigned int SimpleAudioEngine::playEffect(const char* pszFilePath, bool bLoop, - float pitch, float pan, float gain) - { - std::string key = std::string(pszFilePath); - struct soundData *sound; - if(!s_effects.count(key)) - { - sound = new struct soundData(); - sound->chunk = Mix_LoadWAV(pszFilePath); - sound->isLooped = bLoop; - s_effects[key] = sound; - } - else - { - sound = s_effects[key]; - } - // This is safe here since Emscripten is just passing back an - // incrementing integer each time you use the Mix_LoadWAV method. - unsigned int result = (unsigned int) sound->chunk; - - // XXX: This is a bit of a hack, but... Choose a channel based on the - // modulo of the # of channels. This allows us to set the volume - // without passing around both chunk address and channel. - Mix_PlayChannel(result % NR_CHANNELS, sound->chunk, bLoop ? -1 : 0); - - return result; - } - - void SimpleAudioEngine::stopEffect(unsigned int nSoundId) - { - Mix_HaltChannel(nSoundId % NR_CHANNELS); - } - - void SimpleAudioEngine::preloadEffect(const char* pszFilePath) - { - } - - void SimpleAudioEngine::unloadEffect(const char* pszFilePath) - { - std::string key = std::string(pszFilePath); - if(!s_effects.count(key)) - { - return; - } - - struct soundData *sound = s_effects[key]; - - Mix_FreeChunk(sound->chunk); - delete sound; - s_effects.erase(key); - } - - void SimpleAudioEngine::pauseEffect(unsigned int nSoundId) - { - Mix_Pause(nSoundId % NR_CHANNELS); - } - - void SimpleAudioEngine::pauseAllEffects() - { - for(int i = 0; i < NR_CHANNELS; i++) - { - Mix_Pause(i); - } - } - - void SimpleAudioEngine::resumeEffect(unsigned int nSoundId) - { - Mix_Resume(nSoundId % NR_CHANNELS); - } - - void SimpleAudioEngine::resumeAllEffects() - { - for(int i = 0; i < NR_CHANNELS; i++) - { - Mix_Resume(i); - } - } - - void SimpleAudioEngine::stopAllEffects() - { - for(int i = 0; i < NR_CHANNELS; i++) - { - Mix_HaltChannel(i); - } - } - -} diff --git a/audio/proj.emscripten/Makefile b/audio/proj.emscripten/Makefile deleted file mode 100644 index a20833dee5..0000000000 --- a/audio/proj.emscripten/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -TARGET = libcocosdenshion.so - -INCLUDES += -I.. -I../include - -SOURCES = ../emscripten/SimpleAudioEngine.cpp - -COCOS_ROOT = ../.. -include $(COCOS_ROOT)/cocos2dx/proj.emscripten/cocos2dx.mk - -TARGET := $(LIB_DIR)/$(TARGET) - -all: $(TARGET) - -$(TARGET): $(OBJECTS) $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(CXX) $(CXXFLAGS) $(OBJECTS) -shared -o $(TARGET) $(SHAREDLIBS) $(STATICLIBS) - -$(OBJ_DIR)/%.o: ../%.cpp $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) $(VISIBILITY) -c $< -o $@ diff --git a/audio/proj.ios/CocosDenshion.xcodeproj/project.pbxproj b/audio/proj.ios/CocosDenshion.xcodeproj/project.pbxproj deleted file mode 100644 index f9b818ae25..0000000000 --- a/audio/proj.ios/CocosDenshion.xcodeproj/project.pbxproj +++ /dev/null @@ -1,348 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 41E01E4E16D5D5E600ED686C /* Export.h in Headers */ = {isa = PBXBuildFile; fileRef = 41E01E4116D5D5E600ED686C /* Export.h */; }; - 41E01E4F16D5D5E600ED686C /* SimpleAudioEngine.h in Headers */ = {isa = PBXBuildFile; fileRef = 41E01E4216D5D5E600ED686C /* SimpleAudioEngine.h */; }; - 41E01E5016D5D5E600ED686C /* CDAudioManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 41E01E4416D5D5E600ED686C /* CDAudioManager.h */; }; - 41E01E5116D5D5E600ED686C /* CDAudioManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 41E01E4516D5D5E600ED686C /* CDAudioManager.m */; }; - 41E01E5216D5D5E600ED686C /* CDConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = 41E01E4616D5D5E600ED686C /* CDConfig.h */; }; - 41E01E5316D5D5E600ED686C /* CDOpenALSupport.h in Headers */ = {isa = PBXBuildFile; fileRef = 41E01E4716D5D5E600ED686C /* CDOpenALSupport.h */; }; - 41E01E5416D5D5E600ED686C /* CDOpenALSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 41E01E4816D5D5E600ED686C /* CDOpenALSupport.m */; }; - 41E01E5516D5D5E600ED686C /* CocosDenshion.h in Headers */ = {isa = PBXBuildFile; fileRef = 41E01E4916D5D5E600ED686C /* CocosDenshion.h */; }; - 41E01E5616D5D5E600ED686C /* CocosDenshion.m in Sources */ = {isa = PBXBuildFile; fileRef = 41E01E4A16D5D5E600ED686C /* CocosDenshion.m */; }; - 41E01E5716D5D5E600ED686C /* SimpleAudioEngine.mm in Sources */ = {isa = PBXBuildFile; fileRef = 41E01E4B16D5D5E600ED686C /* SimpleAudioEngine.mm */; }; - 41E01E5816D5D5E600ED686C /* SimpleAudioEngine_objc.h in Headers */ = {isa = PBXBuildFile; fileRef = 41E01E4C16D5D5E600ED686C /* SimpleAudioEngine_objc.h */; }; - 41E01E5916D5D5E600ED686C /* SimpleAudioEngine_objc.m in Sources */ = {isa = PBXBuildFile; fileRef = 41E01E4D16D5D5E600ED686C /* SimpleAudioEngine_objc.m */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - 41E01E4116D5D5E600ED686C /* Export.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Export.h; sourceTree = ""; }; - 41E01E4216D5D5E600ED686C /* SimpleAudioEngine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimpleAudioEngine.h; sourceTree = ""; }; - 41E01E4416D5D5E600ED686C /* CDAudioManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDAudioManager.h; sourceTree = ""; }; - 41E01E4516D5D5E600ED686C /* CDAudioManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDAudioManager.m; sourceTree = ""; }; - 41E01E4616D5D5E600ED686C /* CDConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDConfig.h; sourceTree = ""; }; - 41E01E4716D5D5E600ED686C /* CDOpenALSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDOpenALSupport.h; sourceTree = ""; }; - 41E01E4816D5D5E600ED686C /* CDOpenALSupport.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDOpenALSupport.m; sourceTree = ""; }; - 41E01E4916D5D5E600ED686C /* CocosDenshion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CocosDenshion.h; sourceTree = ""; }; - 41E01E4A16D5D5E600ED686C /* CocosDenshion.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CocosDenshion.m; sourceTree = ""; }; - 41E01E4B16D5D5E600ED686C /* SimpleAudioEngine.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SimpleAudioEngine.mm; sourceTree = ""; }; - 41E01E4C16D5D5E600ED686C /* SimpleAudioEngine_objc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimpleAudioEngine_objc.h; sourceTree = ""; }; - 41E01E4D16D5D5E600ED686C /* SimpleAudioEngine_objc.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SimpleAudioEngine_objc.m; sourceTree = ""; }; - D87CC2E5154FC6C500AAFE11 /* libCocosDenshion.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libCocosDenshion.a; sourceTree = BUILT_PRODUCTS_DIR; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - D87CC2E2154FC6C500AAFE11 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 4193AF8416C39EB1007E21D7 /* CocosDenshion */ = { - isa = PBXGroup; - children = ( - 41E01E4016D5D5E600ED686C /* include */, - 41E01E4316D5D5E600ED686C /* ios */, - ); - name = CocosDenshion; - sourceTree = ""; - }; - 41E01E4016D5D5E600ED686C /* include */ = { - isa = PBXGroup; - children = ( - 41E01E4116D5D5E600ED686C /* Export.h */, - 41E01E4216D5D5E600ED686C /* SimpleAudioEngine.h */, - ); - name = include; - path = ../include; - sourceTree = ""; - }; - 41E01E4316D5D5E600ED686C /* ios */ = { - isa = PBXGroup; - children = ( - 41E01E4416D5D5E600ED686C /* CDAudioManager.h */, - 41E01E4516D5D5E600ED686C /* CDAudioManager.m */, - 41E01E4616D5D5E600ED686C /* CDConfig.h */, - 41E01E4716D5D5E600ED686C /* CDOpenALSupport.h */, - 41E01E4816D5D5E600ED686C /* CDOpenALSupport.m */, - 41E01E4916D5D5E600ED686C /* CocosDenshion.h */, - 41E01E4A16D5D5E600ED686C /* CocosDenshion.m */, - 41E01E4B16D5D5E600ED686C /* SimpleAudioEngine.mm */, - 41E01E4C16D5D5E600ED686C /* SimpleAudioEngine_objc.h */, - 41E01E4D16D5D5E600ED686C /* SimpleAudioEngine_objc.m */, - ); - name = ios; - path = ../ios; - sourceTree = ""; - }; - D87CC2BB154FC66100AAFE11 = { - isa = PBXGroup; - children = ( - 4193AF8416C39EB1007E21D7 /* CocosDenshion */, - D87CC2C9154FC66100AAFE11 /* Frameworks */, - D87CC2C7154FC66100AAFE11 /* Products */, - ); - sourceTree = ""; - }; - D87CC2C7154FC66100AAFE11 /* Products */ = { - isa = PBXGroup; - children = ( - D87CC2E5154FC6C500AAFE11 /* libCocosDenshion.a */, - ); - name = Products; - sourceTree = ""; - }; - D87CC2C9154FC66100AAFE11 /* Frameworks */ = { - isa = PBXGroup; - children = ( - ); - name = Frameworks; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXHeadersBuildPhase section */ - D87CC2E3154FC6C500AAFE11 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 41E01E4E16D5D5E600ED686C /* Export.h in Headers */, - 41E01E4F16D5D5E600ED686C /* SimpleAudioEngine.h in Headers */, - 41E01E5016D5D5E600ED686C /* CDAudioManager.h in Headers */, - 41E01E5216D5D5E600ED686C /* CDConfig.h in Headers */, - 41E01E5316D5D5E600ED686C /* CDOpenALSupport.h in Headers */, - 41E01E5516D5D5E600ED686C /* CocosDenshion.h in Headers */, - 41E01E5816D5D5E600ED686C /* SimpleAudioEngine_objc.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXHeadersBuildPhase section */ - -/* Begin PBXNativeTarget section */ - D87CC2E4154FC6C500AAFE11 /* CocosDenshion */ = { - isa = PBXNativeTarget; - buildConfigurationList = D87CC2ED154FC6C500AAFE11 /* Build configuration list for PBXNativeTarget "CocosDenshion" */; - buildPhases = ( - D87CC2E1154FC6C500AAFE11 /* Sources */, - D87CC2E2154FC6C500AAFE11 /* Frameworks */, - D87CC2E3154FC6C500AAFE11 /* Headers */, - 185ADB8915A3935900CD7CE0 /* ShellScript */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = CocosDenshion; - productName = SPII; - productReference = D87CC2E5154FC6C500AAFE11 /* libCocosDenshion.a */; - productType = "com.apple.product-type.library.static"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - D87CC2BD154FC66100AAFE11 /* Project object */ = { - isa = PBXProject; - attributes = { - CLASSPREFIX = SP; - LastUpgradeCheck = 0430; - ORGANIZATIONNAME = Cocoachina; - }; - buildConfigurationList = D87CC2C0154FC66100AAFE11 /* Build configuration list for PBXProject "CocosDenshion" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - "zh-Hans", - "zh-Hant", - ); - mainGroup = D87CC2BB154FC66100AAFE11; - productRefGroup = D87CC2C7154FC66100AAFE11 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - D87CC2E4154FC6C500AAFE11 /* CocosDenshion */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXShellScriptBuildPhase section */ - 185ADB8915A3935900CD7CE0 /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = ""; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - D87CC2E1154FC6C500AAFE11 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 41E01E5116D5D5E600ED686C /* CDAudioManager.m in Sources */, - 41E01E5416D5D5E600ED686C /* CDOpenALSupport.m in Sources */, - 41E01E5616D5D5E600ED686C /* CocosDenshion.m in Sources */, - 41E01E5716D5D5E600ED686C /* SimpleAudioEngine.mm in Sources */, - 41E01E5916D5D5E600ED686C /* SimpleAudioEngine_objc.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - D87CC2DC154FC66100AAFE11 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; - CLANG_CXX_LANGUAGE_STANDARD = "compiler-default"; - CLANG_CXX_LIBRARY = "compiler-default"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - GCC_C_LANGUAGE_STANDARD = c89; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ""; - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_VERSION = ""; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ""; - IPHONEOS_DEPLOYMENT_TARGET = 4.3; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALID_ARCHS = armv7; - }; - name = Debug; - }; - D87CC2DD154FC66100AAFE11 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; - CLANG_CXX_LANGUAGE_STANDARD = "compiler-default"; - CLANG_CXX_LIBRARY = "compiler-default"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = YES; - GCC_C_LANGUAGE_STANDARD = c89; - GCC_PREPROCESSOR_DEFINITIONS = ""; - GCC_VERSION = ""; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ""; - IPHONEOS_DEPLOYMENT_TARGET = 4.3; - OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - VALID_ARCHS = armv7; - }; - name = Release; - }; - D87CC2EE154FC6C500AAFE11 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = YES; - CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; - CLANG_CXX_LIBRARY = "libc++"; - DSTROOT = /tmp/CocosDenshion.dst; - FRAMEWORK_SEARCH_PATHS = "$(inherited)"; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_INCREASE_PRECOMPILED_HEADER_SHARING = NO; - GCC_INLINES_ARE_PRIVATE_EXTERN = YES; - GCC_PRECOMPILE_PREFIX_HEADER = NO; - GCC_PREFIX_HEADER = ""; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "COCOS2D_DEBUG=1", - CC_TARGET_OS_IPHONE, - ); - GENERATE_PKGINFO_FILE = NO; - HEADER_SEARCH_PATHS = "\"$(SDKROOT)/usr/include/libxml2\""; - IPHONEOS_DEPLOYMENT_TARGET = 5.0; - LIBRARY_SEARCH_PATHS = ""; - ONLY_ACTIVE_ARCH = YES; - OTHER_LDFLAGS = "-ObjC"; - PRIVATE_HEADERS_FOLDER_PATH = /usr/local/include; - PRODUCT_NAME = CocosDenshion; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - USER_HEADER_SEARCH_PATHS = "../../cocos2dx/platform/ios ../../cocos2dx/include ../../cocos2dx/kazmath/include ../../cocos2dx/"; - VALID_ARCHS = "armv7 armv7s"; - }; - name = Debug; - }; - D87CC2EF154FC6C500AAFE11 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = YES; - CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; - CLANG_CXX_LIBRARY = "libc++"; - DSTROOT = /tmp/CocosDenshion.dst; - FRAMEWORK_SEARCH_PATHS = "$(inherited)"; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_INCREASE_PRECOMPILED_HEADER_SHARING = NO; - GCC_INLINES_ARE_PRIVATE_EXTERN = YES; - GCC_PRECOMPILE_PREFIX_HEADER = NO; - GCC_PREFIX_HEADER = ""; - GCC_PREPROCESSOR_DEFINITIONS = CC_TARGET_OS_IPHONE; - GENERATE_PKGINFO_FILE = NO; - HEADER_SEARCH_PATHS = "\"$(SDKROOT)/usr/include/libxml2\""; - IPHONEOS_DEPLOYMENT_TARGET = 5.0; - LIBRARY_SEARCH_PATHS = ""; - ONLY_ACTIVE_ARCH = YES; - OTHER_LDFLAGS = "-ObjC"; - PRIVATE_HEADERS_FOLDER_PATH = /usr/local/include; - PRODUCT_NAME = CocosDenshion; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - USER_HEADER_SEARCH_PATHS = "../../cocos2dx/platform/ios ../../cocos2dx/include ../../cocos2dx/kazmath/include ../../cocos2dx/"; - VALID_ARCHS = "armv7 armv7s"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - D87CC2C0154FC66100AAFE11 /* Build configuration list for PBXProject "CocosDenshion" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - D87CC2DC154FC66100AAFE11 /* Debug */, - D87CC2DD154FC66100AAFE11 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - D87CC2ED154FC6C500AAFE11 /* Build configuration list for PBXNativeTarget "CocosDenshion" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - D87CC2EE154FC6C500AAFE11 /* Debug */, - D87CC2EF154FC6C500AAFE11 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = D87CC2BD154FC66100AAFE11 /* Project object */; -} diff --git a/audio/proj.mac/CocosDenshion.xcodeproj/project.pbxproj b/audio/proj.mac/CocosDenshion.xcodeproj/project.pbxproj deleted file mode 100644 index 810beeb4d2..0000000000 --- a/audio/proj.mac/CocosDenshion.xcodeproj/project.pbxproj +++ /dev/null @@ -1,342 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 41E01E4E16D5D5E600ED686C /* Export.h in Headers */ = {isa = PBXBuildFile; fileRef = 41E01E4116D5D5E600ED686C /* Export.h */; }; - 41E01E4F16D5D5E600ED686C /* SimpleAudioEngine.h in Headers */ = {isa = PBXBuildFile; fileRef = 41E01E4216D5D5E600ED686C /* SimpleAudioEngine.h */; }; - A0C2188717791E6D00BE78B5 /* CDAudioManager.h in Headers */ = {isa = PBXBuildFile; fileRef = A0C2187B17791E6D00BE78B5 /* CDAudioManager.h */; }; - A0C2188817791E6D00BE78B5 /* CDAudioManager.m in Sources */ = {isa = PBXBuildFile; fileRef = A0C2187C17791E6D00BE78B5 /* CDAudioManager.m */; }; - A0C2188917791E6D00BE78B5 /* CDConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = A0C2187D17791E6D00BE78B5 /* CDConfig.h */; }; - A0C2188A17791E6D00BE78B5 /* CDOpenALSupport.h in Headers */ = {isa = PBXBuildFile; fileRef = A0C2187E17791E6D00BE78B5 /* CDOpenALSupport.h */; }; - A0C2188B17791E6D00BE78B5 /* CDOpenALSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = A0C2187F17791E6D00BE78B5 /* CDOpenALSupport.m */; }; - A0C2188C17791E6D00BE78B5 /* CDXMacOSXSupport.h in Headers */ = {isa = PBXBuildFile; fileRef = A0C2188017791E6D00BE78B5 /* CDXMacOSXSupport.h */; }; - A0C2188D17791E6D00BE78B5 /* CDXMacOSXSupport.mm in Sources */ = {isa = PBXBuildFile; fileRef = A0C2188117791E6D00BE78B5 /* CDXMacOSXSupport.mm */; }; - A0C2188E17791E6D00BE78B5 /* CocosDenshion.h in Headers */ = {isa = PBXBuildFile; fileRef = A0C2188217791E6D00BE78B5 /* CocosDenshion.h */; }; - A0C2188F17791E6D00BE78B5 /* CocosDenshion.m in Sources */ = {isa = PBXBuildFile; fileRef = A0C2188317791E6D00BE78B5 /* CocosDenshion.m */; }; - A0C2189017791E6D00BE78B5 /* SimpleAudioEngine.mm in Sources */ = {isa = PBXBuildFile; fileRef = A0C2188417791E6D00BE78B5 /* SimpleAudioEngine.mm */; }; - A0C2189117791E6D00BE78B5 /* SimpleAudioEngine_objc.h in Headers */ = {isa = PBXBuildFile; fileRef = A0C2188517791E6D00BE78B5 /* SimpleAudioEngine_objc.h */; }; - A0C2189217791E6D00BE78B5 /* SimpleAudioEngine_objc.m in Sources */ = {isa = PBXBuildFile; fileRef = A0C2188617791E6D00BE78B5 /* SimpleAudioEngine_objc.m */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - 41E01E4116D5D5E600ED686C /* Export.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Export.h; sourceTree = ""; }; - 41E01E4216D5D5E600ED686C /* SimpleAudioEngine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimpleAudioEngine.h; sourceTree = ""; }; - A0C2187B17791E6D00BE78B5 /* CDAudioManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDAudioManager.h; sourceTree = ""; }; - A0C2187C17791E6D00BE78B5 /* CDAudioManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDAudioManager.m; sourceTree = ""; }; - A0C2187D17791E6D00BE78B5 /* CDConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDConfig.h; sourceTree = ""; }; - A0C2187E17791E6D00BE78B5 /* CDOpenALSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDOpenALSupport.h; sourceTree = ""; }; - A0C2187F17791E6D00BE78B5 /* CDOpenALSupport.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDOpenALSupport.m; sourceTree = ""; }; - A0C2188017791E6D00BE78B5 /* CDXMacOSXSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDXMacOSXSupport.h; sourceTree = ""; }; - A0C2188117791E6D00BE78B5 /* CDXMacOSXSupport.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CDXMacOSXSupport.mm; sourceTree = ""; }; - A0C2188217791E6D00BE78B5 /* CocosDenshion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CocosDenshion.h; sourceTree = ""; }; - A0C2188317791E6D00BE78B5 /* CocosDenshion.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CocosDenshion.m; sourceTree = ""; }; - A0C2188417791E6D00BE78B5 /* SimpleAudioEngine.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SimpleAudioEngine.mm; sourceTree = ""; }; - A0C2188517791E6D00BE78B5 /* SimpleAudioEngine_objc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimpleAudioEngine_objc.h; sourceTree = ""; }; - A0C2188617791E6D00BE78B5 /* SimpleAudioEngine_objc.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SimpleAudioEngine_objc.m; sourceTree = ""; }; - D87CC2E5154FC6C500AAFE11 /* libCocosDenshion.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libCocosDenshion.a; sourceTree = BUILT_PRODUCTS_DIR; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - D87CC2E2154FC6C500AAFE11 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 4193AF8416C39EB1007E21D7 /* CocosDenshion */ = { - isa = PBXGroup; - children = ( - A0C2187A17791E6D00BE78B5 /* mac */, - 41E01E4016D5D5E600ED686C /* include */, - ); - name = CocosDenshion; - sourceTree = ""; - }; - 41E01E4016D5D5E600ED686C /* include */ = { - isa = PBXGroup; - children = ( - 41E01E4116D5D5E600ED686C /* Export.h */, - 41E01E4216D5D5E600ED686C /* SimpleAudioEngine.h */, - ); - name = include; - path = ../include; - sourceTree = ""; - }; - A0C2187A17791E6D00BE78B5 /* mac */ = { - isa = PBXGroup; - children = ( - A0C2187B17791E6D00BE78B5 /* CDAudioManager.h */, - A0C2187C17791E6D00BE78B5 /* CDAudioManager.m */, - A0C2187D17791E6D00BE78B5 /* CDConfig.h */, - A0C2187E17791E6D00BE78B5 /* CDOpenALSupport.h */, - A0C2187F17791E6D00BE78B5 /* CDOpenALSupport.m */, - A0C2188017791E6D00BE78B5 /* CDXMacOSXSupport.h */, - A0C2188117791E6D00BE78B5 /* CDXMacOSXSupport.mm */, - A0C2188217791E6D00BE78B5 /* CocosDenshion.h */, - A0C2188317791E6D00BE78B5 /* CocosDenshion.m */, - A0C2188417791E6D00BE78B5 /* SimpleAudioEngine.mm */, - A0C2188517791E6D00BE78B5 /* SimpleAudioEngine_objc.h */, - A0C2188617791E6D00BE78B5 /* SimpleAudioEngine_objc.m */, - ); - name = mac; - path = ../mac; - sourceTree = ""; - }; - D87CC2BB154FC66100AAFE11 = { - isa = PBXGroup; - children = ( - 4193AF8416C39EB1007E21D7 /* CocosDenshion */, - D87CC2C9154FC66100AAFE11 /* Frameworks */, - D87CC2C7154FC66100AAFE11 /* Products */, - ); - sourceTree = ""; - }; - D87CC2C7154FC66100AAFE11 /* Products */ = { - isa = PBXGroup; - children = ( - D87CC2E5154FC6C500AAFE11 /* libCocosDenshion.a */, - ); - name = Products; - sourceTree = ""; - }; - D87CC2C9154FC66100AAFE11 /* Frameworks */ = { - isa = PBXGroup; - children = ( - ); - name = Frameworks; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXHeadersBuildPhase section */ - D87CC2E3154FC6C500AAFE11 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 41E01E4E16D5D5E600ED686C /* Export.h in Headers */, - 41E01E4F16D5D5E600ED686C /* SimpleAudioEngine.h in Headers */, - A0C2188717791E6D00BE78B5 /* CDAudioManager.h in Headers */, - A0C2188917791E6D00BE78B5 /* CDConfig.h in Headers */, - A0C2188A17791E6D00BE78B5 /* CDOpenALSupport.h in Headers */, - A0C2188C17791E6D00BE78B5 /* CDXMacOSXSupport.h in Headers */, - A0C2188E17791E6D00BE78B5 /* CocosDenshion.h in Headers */, - A0C2189117791E6D00BE78B5 /* SimpleAudioEngine_objc.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXHeadersBuildPhase section */ - -/* Begin PBXNativeTarget section */ - D87CC2E4154FC6C500AAFE11 /* CocosDenshion */ = { - isa = PBXNativeTarget; - buildConfigurationList = D87CC2ED154FC6C500AAFE11 /* Build configuration list for PBXNativeTarget "CocosDenshion" */; - buildPhases = ( - D87CC2E1154FC6C500AAFE11 /* Sources */, - D87CC2E2154FC6C500AAFE11 /* Frameworks */, - D87CC2E3154FC6C500AAFE11 /* Headers */, - 185ADB8915A3935900CD7CE0 /* ShellScript */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = CocosDenshion; - productName = SPII; - productReference = D87CC2E5154FC6C500AAFE11 /* libCocosDenshion.a */; - productType = "com.apple.product-type.library.static"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - D87CC2BD154FC66100AAFE11 /* Project object */ = { - isa = PBXProject; - attributes = { - CLASSPREFIX = SP; - LastUpgradeCheck = 0430; - ORGANIZATIONNAME = Cocoachina; - }; - buildConfigurationList = D87CC2C0154FC66100AAFE11 /* Build configuration list for PBXProject "CocosDenshion" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - "zh-Hans", - "zh-Hant", - ); - mainGroup = D87CC2BB154FC66100AAFE11; - productRefGroup = D87CC2C7154FC66100AAFE11 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - D87CC2E4154FC6C500AAFE11 /* CocosDenshion */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXShellScriptBuildPhase section */ - 185ADB8915A3935900CD7CE0 /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = ""; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - D87CC2E1154FC6C500AAFE11 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - A0C2188817791E6D00BE78B5 /* CDAudioManager.m in Sources */, - A0C2188B17791E6D00BE78B5 /* CDOpenALSupport.m in Sources */, - A0C2188D17791E6D00BE78B5 /* CDXMacOSXSupport.mm in Sources */, - A0C2188F17791E6D00BE78B5 /* CocosDenshion.m in Sources */, - A0C2189017791E6D00BE78B5 /* SimpleAudioEngine.mm in Sources */, - A0C2189217791E6D00BE78B5 /* SimpleAudioEngine_objc.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - D87CC2DC154FC66100AAFE11 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; - CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; - CLANG_CXX_LIBRARY = "libc++"; - COPY_PHASE_STRIP = NO; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - CC_TARGET_OS_MAC, - DEBUG, - "COCOS2D_DEBUG=1", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ""; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = macosx; - }; - name = Debug; - }; - D87CC2DD154FC66100AAFE11 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; - CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; - CLANG_CXX_LIBRARY = "libc++"; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_PREPROCESSOR_DEFINITIONS = ( - CC_TARGET_OS_MAC, - NDEBUG, - ); - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ""; - SDKROOT = macosx; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - D87CC2EE154FC6C500AAFE11 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = YES; - CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; - CLANG_CXX_LIBRARY = "libc++"; - DSTROOT = /tmp/CocosDenshion.dst; - FRAMEWORK_SEARCH_PATHS = "$(inherited)"; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_INCREASE_PRECOMPILED_HEADER_SHARING = NO; - GCC_INLINES_ARE_PRIVATE_EXTERN = YES; - GCC_PRECOMPILE_PREFIX_HEADER = NO; - GCC_PREFIX_HEADER = ""; - GENERATE_PKGINFO_FILE = NO; - HEADER_SEARCH_PATHS = "\"$(SDKROOT)/usr/include/libxml2\""; - IPHONEOS_DEPLOYMENT_TARGET = 5.0; - LIBRARY_SEARCH_PATHS = ""; - OTHER_LDFLAGS = "-ObjC"; - PRIVATE_HEADERS_FOLDER_PATH = /usr/local/include; - PRODUCT_NAME = CocosDenshion; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - USER_HEADER_SEARCH_PATHS = "../../cocos2dx/platform/mac ../../cocos2dx/include ../../cocos2dx/kazmath/include ../../cocos2dx/"; - }; - name = Debug; - }; - D87CC2EF154FC6C500AAFE11 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = YES; - CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; - CLANG_CXX_LIBRARY = "libc++"; - DSTROOT = /tmp/CocosDenshion.dst; - FRAMEWORK_SEARCH_PATHS = "$(inherited)"; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_INCREASE_PRECOMPILED_HEADER_SHARING = NO; - GCC_INLINES_ARE_PRIVATE_EXTERN = YES; - GCC_PRECOMPILE_PREFIX_HEADER = NO; - GCC_PREFIX_HEADER = ""; - GENERATE_PKGINFO_FILE = NO; - HEADER_SEARCH_PATHS = "\"$(SDKROOT)/usr/include/libxml2\""; - IPHONEOS_DEPLOYMENT_TARGET = 5.0; - LIBRARY_SEARCH_PATHS = ""; - OTHER_LDFLAGS = "-ObjC"; - PRIVATE_HEADERS_FOLDER_PATH = /usr/local/include; - PRODUCT_NAME = CocosDenshion; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - USER_HEADER_SEARCH_PATHS = "../../cocos2dx/platform/mac ../../cocos2dx/include ../../cocos2dx/kazmath/include ../../cocos2dx/"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - D87CC2C0154FC66100AAFE11 /* Build configuration list for PBXProject "CocosDenshion" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - D87CC2DC154FC66100AAFE11 /* Debug */, - D87CC2DD154FC66100AAFE11 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - D87CC2ED154FC6C500AAFE11 /* Build configuration list for PBXNativeTarget "CocosDenshion" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - D87CC2EE154FC6C500AAFE11 /* Debug */, - D87CC2EF154FC6C500AAFE11 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = D87CC2BD154FC66100AAFE11 /* Project object */; -} diff --git a/audio/proj.nacl/Makefile b/audio/proj.nacl/Makefile deleted file mode 100644 index 75cda4add0..0000000000 --- a/audio/proj.nacl/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -COCOS_ROOT = ../.. - -INCLUDES = -I../include - -SOURCES = ../openal/OpenALDecoder.cpp \ - ../openal/SimpleAudioEngine.cpp - -include $(COCOS_ROOT)/cocos2dx/proj.nacl/cocos2dx.mk - -TARGET = $(LIB_DIR)/libcocosdenshion.a - -all: $(TARGET) - -$(TARGET): $(OBJECTS) $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(LOG_AR)$(NACL_AR) $(ARFLAGS) $(TARGET) $(OBJECTS) - -$(OBJ_DIR)/%.o: ../%.cpp $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(LOG_CXX)$(NACL_CXX) -MMD $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@ diff --git a/audio/proj.qt5/cocosdenshion.pro b/audio/proj.qt5/cocosdenshion.pro deleted file mode 100644 index 0895763525..0000000000 --- a/audio/proj.qt5/cocosdenshion.pro +++ /dev/null @@ -1,15 +0,0 @@ - -include(../../cocos2dx/proj.qt5/common.pri) - -TEMPLATE = lib - -SOURCES += $$files(../qt5/*.cpp) - -INCLUDEPATH += .. -INCLUDEPATH += ../include - -TARGET = $${LIB_OUTPUT_DIR}/cocosdenshion - -INSTALLS += target -target.path = $${LIB_INSTALL_DIR} - diff --git a/audio/proj.tizen/.cproject b/audio/proj.tizen/.cproject deleted file mode 100644 index 28498d93b3..0000000000 --- a/audio/proj.tizen/.cproject +++ /dev/null @@ -1,345 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/audio/proj.tizen/.project b/audio/proj.tizen/.project deleted file mode 100644 index de7b7ccce4..0000000000 --- a/audio/proj.tizen/.project +++ /dev/null @@ -1,106 +0,0 @@ - - - cocosdenshion - - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.autoBuildTarget - all - - - org.eclipse.cdt.make.core.buildArguments - - - - org.eclipse.cdt.make.core.buildCommand - sbi-make - - - org.eclipse.cdt.make.core.buildLocation - ${workspace_loc:/cocosdenshion/Debug-Tizen-Emulator} - - - org.eclipse.cdt.make.core.cleanBuildTarget - clean - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - false - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.fullBuildTarget - all - - - org.eclipse.cdt.make.core.stopOnError - true - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - true - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - org.tizen.nativecpp.apichecker.core.builder - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.core.ccnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - org.tizen.nativecpp.apichecker.core.tizenCppNature - - - - src/OpenALDecoder.cpp - 1 - PARENT-1-PROJECT_LOC/openal/OpenALDecoder.cpp - - - src/OpenALDecoder.h - 1 - PARENT-1-PROJECT_LOC/openal/OpenALDecoder.h - - - src/SimpleAudioEngineOpenAL.cpp - 1 - PARENT-1-PROJECT_LOC/openal/SimpleAudioEngineOpenAL.cpp - - - diff --git a/audio/proj.tizen/src/placeholder.txt b/audio/proj.tizen/src/placeholder.txt deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/audio/qt5/SimpleAudioEngineQt5.cpp b/audio/qt5/SimpleAudioEngineQt5.cpp deleted file mode 100644 index 453fd0d9fd..0000000000 --- a/audio/qt5/SimpleAudioEngineQt5.cpp +++ /dev/null @@ -1,407 +0,0 @@ -/** - * - * Cocos2D-X Qt 5 Platform - * - * Copyright (C) 2013 Jolla Ltd. - * Contact: Thomas Perl - * - * 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 "SimpleAudioEngine.h" - -#include "platform/CCCommon.h" -#include "platform/CCFileUtils.h" - -#include -#include - -USING_NS_CC; - -namespace CocosDenshion { - -static QString -fullPath(const char *filename) -{ - return QString::fromStdString(FileUtils::getInstance()->fullPathForFilename(filename)); -} - -class CocosQt5AudioBackend { - public: - static void cleanup(); - static void gcEffects(); - - static QMediaPlayer *player() { - if (background_music == NULL) { - background_music = new QMediaPlayer; - } - - return background_music; - } - - static void setEffectsVolume(float volume) - { - effects_volume = volume; - - foreach (QMediaPlayer *effect, effects.values()) { - effect->setVolume(volume * 100.0); - } - } - - static QMap effects; - static QMediaPlayer *background_music; - static int next_effect_id; - static float effects_volume; -}; - -QMap -CocosQt5AudioBackend::effects; - -QMediaPlayer * -CocosQt5AudioBackend::background_music = NULL; - -int -CocosQt5AudioBackend::next_effect_id = 0; - -float -CocosQt5AudioBackend::effects_volume = 1.0; - -void -CocosQt5AudioBackend::cleanup() -{ - foreach (QMediaPlayer *effect, effects.values()) { - delete effect; - } - - if (background_music != NULL) { - delete background_music; - background_music = NULL; - } -} - -void -CocosQt5AudioBackend::gcEffects() -{ - foreach (int id, effects.keys()) { - QMediaPlayer *effect = effects[id]; - if (effect->state() == QMediaPlayer::StoppedState) { - delete effect; - effects.remove(id); - } - } -} - - -/* Singleton object */ -static SimpleAudioEngine * -simple_audio_engine = NULL; - - -/** -@brief Get the shared Engine object,it will new one when first time be called -*/ -SimpleAudioEngine * -SimpleAudioEngine::getInstance() -{ - if (simple_audio_engine == NULL) { - simple_audio_engine = new SimpleAudioEngine; - } - - return simple_audio_engine; -} - -/** -@brief Release the shared Engine object -@warning It must be called before the application exit, or a memroy leak will be casued. -*/ -void -SimpleAudioEngine::end() -{ - if (simple_audio_engine != NULL) { - delete simple_audio_engine; - simple_audio_engine = NULL; - } -} - - -SimpleAudioEngine::SimpleAudioEngine() -{ -} - -SimpleAudioEngine::~SimpleAudioEngine() -{ - // Free sound effects and stop background music - CocosQt5AudioBackend::cleanup(); -} - -/** - @brief Preload background music - @param pszFilePath The path of the background music file,or the FileName of T_SoundResInfo - */ -void -SimpleAudioEngine::preloadBackgroundMusic(const char* pszFilePath) -{ - QString filename = fullPath(pszFilePath); -} - -/** -@brief Play background music -@param pszFilePath The path of the background music file,or the FileName of T_SoundResInfo -@param bLoop Whether the background music loop or not -*/ -void -SimpleAudioEngine::playBackgroundMusic(const char* pszFilePath, bool bLoop) -{ - QString filename = fullPath(pszFilePath); - - CocosQt5AudioBackend::player()->setMedia(QUrl::fromLocalFile(filename)); - if (bLoop) { - // TODO: Set QMediaPlayer to loop infinitely - } - CocosQt5AudioBackend::player()->play(); -} - -/** -@brief Stop playing background music -@param bReleaseData If release the background music data or not.As default value is false -*/ -void -SimpleAudioEngine::stopBackgroundMusic(bool bReleaseData) -{ - CocosQt5AudioBackend::player()->stop(); - - if (bReleaseData) { - CocosQt5AudioBackend::player()->setMedia(QMediaContent()); - } -} - -/** -@brief Pause playing background music -*/ -void -SimpleAudioEngine::pauseBackgroundMusic() -{ - CocosQt5AudioBackend::player()->pause(); -} - -/** -@brief Resume playing background music -*/ -void -SimpleAudioEngine::resumeBackgroundMusic() -{ - CocosQt5AudioBackend::player()->play(); -} - -/** -@brief Rewind playing background music -*/ -void -SimpleAudioEngine::rewindBackgroundMusic() -{ - CocosQt5AudioBackend::player()->stop(); - CocosQt5AudioBackend::player()->setPosition(0); - CocosQt5AudioBackend::player()->play(); -} - -bool -SimpleAudioEngine::willPlayBackgroundMusic() -{ - return true; -} - -/** -@brief Whether the background music is playing -@return If is playing return true,or return false -*/ -bool -SimpleAudioEngine::isBackgroundMusicPlaying() -{ - return (CocosQt5AudioBackend::player()->state() == QMediaPlayer::PlayingState); -} - -/** -@brief The volume of the background music max value is 1.0,the min value is 0.0 -*/ -float -SimpleAudioEngine::getBackgroundMusicVolume() -{ - return (float)(CocosQt5AudioBackend::player()->volume()) / 100.; -} - -/** -@brief set the volume of background music -@param volume must be in 0.0~1.0 -*/ -void -SimpleAudioEngine::setBackgroundMusicVolume(float volume) -{ - CocosQt5AudioBackend::player()->setVolume(100. * volume); -} - -/** -@brief The volume of the effects max value is 1.0,the min value is 0.0 -*/ -float -SimpleAudioEngine::getEffectsVolume() -{ - return CocosQt5AudioBackend::effects_volume; -} - -/** -@brief set the volume of sound effecs -@param volume must be in 0.0~1.0 -*/ -void -SimpleAudioEngine::setEffectsVolume(float volume) -{ - CocosQt5AudioBackend::setEffectsVolume(volume); -} - -// for sound effects -/** -@brief Play sound effect -@param pszFilePath The path of the effect file,or the FileName of T_SoundResInfo -@bLoop Whether to loop the effect playing, default value is false -*/ -unsigned int -SimpleAudioEngine::playEffect(const char* pszFilePath, bool bLoop, - float pitch, float pan, float gain) -{ - // TODO: Handle pitch, pan and gain - - CocosQt5AudioBackend::gcEffects(); - - QString filename = fullPath(pszFilePath); - int id = CocosQt5AudioBackend::next_effect_id++; - - QMediaPlayer *effect = new QMediaPlayer; - effect->setMedia(QUrl::fromLocalFile(filename)); - effect->setVolume(CocosQt5AudioBackend::effects_volume * 100.0); - if (bLoop) { - // TODO: Set QMediaPlayer to loop infinitely - } - effect->play(); - - CocosQt5AudioBackend::effects[id] = effect; - return id; -} - -/** -@brief Pause playing sound effect -@param nSoundId The return value of function playEffect -*/ -void -SimpleAudioEngine::pauseEffect(unsigned int nSoundId) -{ - if (CocosQt5AudioBackend::effects.contains(nSoundId)) { - QMediaPlayer *effect = CocosQt5AudioBackend::effects[nSoundId]; - effect->pause(); - } -} - -/** -@brief Pause all playing sound effect -@param nSoundId The return value of function playEffect -*/ -void -SimpleAudioEngine::pauseAllEffects() -{ - foreach (QMediaPlayer *effect, CocosQt5AudioBackend::effects.values()) { - effect->pause(); - } -} - -/** -@brief Resume playing sound effect -@param nSoundId The return value of function playEffect -*/ -void -SimpleAudioEngine::resumeEffect(unsigned int nSoundId) -{ - if (CocosQt5AudioBackend::effects.contains(nSoundId)) { - QMediaPlayer *effect = CocosQt5AudioBackend::effects[nSoundId]; - effect->play(); - } -} - -/** -@brief Resume all playing sound effect -@param nSoundId The return value of function playEffect -*/ -void -SimpleAudioEngine::resumeAllEffects() -{ - foreach (QMediaPlayer *effect, CocosQt5AudioBackend::effects.values()) { - if (effect->state() == QMediaPlayer::PausedState) { - effect->play(); - } - } -} - -/** -@brief Stop playing sound effect -@param nSoundId The return value of function playEffect -*/ -void -SimpleAudioEngine::stopEffect(unsigned int nSoundId) -{ - if (CocosQt5AudioBackend::effects.contains(nSoundId)) { - QMediaPlayer *effect = CocosQt5AudioBackend::effects[nSoundId]; - CocosQt5AudioBackend::effects.remove(nSoundId); - delete effect; - } -} - -/** -@brief Stop all playing sound effects -*/ -void -SimpleAudioEngine::stopAllEffects() -{ - foreach (QMediaPlayer *effect, CocosQt5AudioBackend::effects.values()) { - delete effect; - } - CocosQt5AudioBackend::effects.clear(); -} - -/** -@brief preload a compressed audio file -@details the compressed audio will be decode to wave, then write into an -internal buffer in SimpleAudioEngine -*/ -void -SimpleAudioEngine::preloadEffect(const char* pszFilePath) -{ - QString filename = fullPath(pszFilePath); -} - -/** -@brief unload the preloaded effect from internal buffer -@param[in] pszFilePath The path of the effect file,or the FileName of T_SoundResInfo -*/ -void -SimpleAudioEngine::unloadEffect(const char* pszFilePath) -{ - QString filename = fullPath(pszFilePath); -} - -} /* end namespace CocosDenshion */ diff --git a/build-emscripten.sh b/build-emscripten.sh deleted file mode 100755 index 1f419d6423..0000000000 --- a/build-emscripten.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash -# Build script to build all components for emscripten. -# -# By default this script will build the 'all' target in -# both debug and release configurations. Pass "clean" to -# clean all configuration. - -SCRIPT_DIR=$(dirname ${BASH_SOURCE}) - -set -e -set -x - -cd $SCRIPT_DIR - -if [ "$PYTHON" == "" ]; then - command -v python >/dev/null 2>&1 || (echo "Please install python and set \$PYTHON" && exit 1) - PYTHON=`which python` -fi - -if [ "$LLVM" == "" ]; then - command -v clang >/dev/null 2>&1 || (echo "Please install LLVM and clang, and set \$LLVM" && exit 1) - LLVM=$(dirname `which clang`) -fi - -export LLVM_ROOT=$LLVM - -make PLATFORM=emscripten DEBUG=1 -j10 $* -make PLATFORM=emscripten DEBUG=0 -j10 $* diff --git a/build-nacl.sh b/build-nacl.sh deleted file mode 100755 index 8ffb850777..0000000000 --- a/build-nacl.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash -# Build script to build all components for Native Client. -# -# By default this script will build the 'all' target in -# both debug and release configurations. Pass "clean" to -# clean all configuration. -# -# Before running this script you need to set NACL_SDK_ROOT -# and add the NaCl compiler bin folder to your path. -# -# There are several libraries from naclports that are -# prerequisite for building cocos2dx on NaCl. These ship -# with recent versions of the NaCl SDK or you can build -# them yourself by checking out naclports and running: -# $ make png tiff freetype xml2 freealut jpeg vorbis ogg - -if [ -z "$NACL_SDK_ROOT" ]; then - echo "Please set \$NACL_SDK_ROOT" - exit 1 -fi - -SCRIPT_DIR=$(dirname ${BASH_SOURCE}) -OUTPUT_DEBUG=lib/nacl/Debug/ -OUTPUT_RELEASE=lib/nacl/Release/ - -set -e -set -x - -cd $SCRIPT_DIR - -mkdir -p $OUTPUT_DEBUG -mkdir -p $OUTPUT_RELEASE - -export MAKEFLAGS="-j10 PLATFORM=nacl" - -make NACL_ARCH=x86_64 DEBUG=1 $* -make NACL_ARCH=x86_64 DEBUG=0 $* - -make NACL_ARCH=i686 DEBUG=1 $* -make NACL_ARCH=i686 DEBUG=0 $* - -if [ "${NACL_GLIBC:-}" != "1" ]; then - make NACL_ARCH=arm DEBUG=1 $* - make NACL_ARCH=arm DEBUG=0 $* -fi diff --git a/build-win32.bat b/build-win32.bat deleted file mode 100644 index 45218918be..0000000000 --- a/build-win32.bat +++ /dev/null @@ -1,89 +0,0 @@ -@echo off - -echo./* -echo. * Check VC++ environment... -echo. */ -echo. - -if defined VS110COMNTOOLS ( - set VSTOOLS="%VS110COMNTOOLS%" - set VC_VER=110 -) - - - -set VSTOOLS=%VSTOOLS:"=% -set "VSTOOLS=%VSTOOLS:\=/%" - -set VSVARS="%VSTOOLS%vsvars32.bat" - -if not defined VSVARS ( - echo Can't find VC2012 installed! - goto ERROR -) - -echo./* -echo. * Building cocos2d-x library binary, please wait a while... -echo. */ -echo. - -call %VSVARS% -if %VC_VER%==110 ( - msbuild cocos2d-win32.vc2012.sln /t:Clean - msbuild cocos2d-win32.vc2012.sln /p:Configuration="Debug" /m - msbuild cocos2d-win32.vc2012.sln /p:Configuration="Release" /m -) else ( - echo Script error. - goto ERROR -) - -echo./* -echo. * Check the cocos2d-win32 application "TestCpp.exe" ... -echo. */ -echo. - -pushd ".\Release.win32\" - -set CC_TEST_BIN=TestCpp.exe - -set CC_TEST_RES=..\samples\Cpp\TestCpp\Resources -set CC_HELLOWORLD_RES=..\samples\Cpp\HelloCpp\Resources -set CC_TESTLUA_RES=..\samples\Lua\TestLua\Resources -set CC_SIMPLEGAME_RES=..\samples\Cpp\SimpleGame\Resources -set CC_HELLOLUA_RES=..\samples\Lua\HelloLua\Resources -set CC_JSB_SOURCES=..\scripting\javascript\bindings\js -set CC_TESTJS_RES=..\samples\Javascript\Shared\tests -set CC_DRAGONJS_RES=..\samples\Javascript\Shared\games\CocosDragonJS\Published files iOS -set CC_MOONWARRIORS_RES=..\samples\Javascript\Shared\games\MoonWarriors -set CC_WATERMELONWITHME_RES=..\samples\Javascript\Shared\games\WatermelonWithMe - - -echo./* -echo. * Run cocos2d-win32 tests.exe and view Cocos2d-x Application Wizard for Visual Studio User Guide. -echo. */ -echo. -xcopy /E /Y /Q "%CC_TEST_RES%" . -xcopy /E /Y /Q "%CC_HELLOWORLD_RES%" . -xcopy /E /Y /Q "%CC_HELLOLUA_RES%" . -xcopy /E /Y /Q "%CC_TESTLUA_RES%" . -xcopy /E /Y /Q "%CC_SIMPLEGAME_RES%" . -xcopy /E /Y /Q "%CC_JSB_SOURCES%" . -xcopy /E /Y /Q "%CC_TESTJS_RES%" . -xcopy /E /Y /Q "%CC_MOONWARRIORS_RES%" . -xcopy /E /Y /Q "%CC_WATERMELONWITHME_RES%" . -xcopy /E /Y /Q "%CC_DRAGONJS_RES%" . - -if not exist "%CC_TEST_BIN%" ( - echo Can't find the binary "TestCpp.exe", is there build error? - goto ERROR -) - -call "%CC_TEST_BIN%" -popd - -goto EOF - -:ERROR -pause - -:EOF diff --git a/Makefile b/build/Makefile similarity index 100% rename from Makefile rename to build/Makefile diff --git a/cocos2d-win32.vc2012.sln b/build/cocos2d-win32.vc2012.sln similarity index 100% rename from cocos2d-win32.vc2012.sln rename to build/cocos2d-win32.vc2012.sln diff --git a/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id b/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id new file mode 100644 index 0000000000..ea4a9890a6 --- /dev/null +++ b/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id @@ -0,0 +1 @@ +cef7f2eb0a7ce536df264b4b3fa72470af8213d0 \ No newline at end of file diff --git a/install-deps-linux.sh b/build/install-deps-linux.sh similarity index 100% rename from install-deps-linux.sh rename to build/install-deps-linux.sh diff --git a/make-all-linux-project.sh b/build/make-all-linux-project.sh similarity index 100% rename from make-all-linux-project.sh rename to build/make-all-linux-project.sh diff --git a/build/samples.xcodeproj/project.pbxproj.REMOVED.git-id b/build/samples.xcodeproj/project.pbxproj.REMOVED.git-id new file mode 100644 index 0000000000..a1c65992b0 --- /dev/null +++ b/build/samples.xcodeproj/project.pbxproj.REMOVED.git-id @@ -0,0 +1 @@ +f3d0c334145f571e5338f3e0fa051f7713668e3f \ No newline at end of file diff --git a/cocos2dx/Android.mk b/cocos/2d/Android.mk similarity index 100% rename from cocos2dx/Android.mk rename to cocos/2d/Android.mk diff --git a/cocos2dx/CCCamera.cpp b/cocos/2d/CCCamera.cpp similarity index 100% rename from cocos2dx/CCCamera.cpp rename to cocos/2d/CCCamera.cpp diff --git a/cocos2dx/CCCamera.h b/cocos/2d/CCCamera.h similarity index 100% rename from cocos2dx/CCCamera.h rename to cocos/2d/CCCamera.h diff --git a/cocos2dx/CCConfiguration.cpp b/cocos/2d/CCConfiguration.cpp similarity index 100% rename from cocos2dx/CCConfiguration.cpp rename to cocos/2d/CCConfiguration.cpp diff --git a/cocos2dx/CCConfiguration.h b/cocos/2d/CCConfiguration.h similarity index 100% rename from cocos2dx/CCConfiguration.h rename to cocos/2d/CCConfiguration.h diff --git a/cocos2dx/CCDeprecated.cpp b/cocos/2d/CCDeprecated.cpp similarity index 100% rename from cocos2dx/CCDeprecated.cpp rename to cocos/2d/CCDeprecated.cpp diff --git a/cocos2dx/CCDirector.cpp b/cocos/2d/CCDirector.cpp similarity index 100% rename from cocos2dx/CCDirector.cpp rename to cocos/2d/CCDirector.cpp diff --git a/cocos2dx/CCDirector.h b/cocos/2d/CCDirector.h similarity index 100% rename from cocos2dx/CCDirector.h rename to cocos/2d/CCDirector.h diff --git a/cocos2dx/CCScheduler.cpp b/cocos/2d/CCScheduler.cpp similarity index 100% rename from cocos2dx/CCScheduler.cpp rename to cocos/2d/CCScheduler.cpp diff --git a/cocos2dx/CCScheduler.h b/cocos/2d/CCScheduler.h similarity index 100% rename from cocos2dx/CCScheduler.h rename to cocos/2d/CCScheduler.h diff --git a/cocos2dx/actions/CCAction.cpp b/cocos/2d/actions/CCAction.cpp similarity index 100% rename from cocos2dx/actions/CCAction.cpp rename to cocos/2d/actions/CCAction.cpp diff --git a/cocos2dx/actions/CCAction.h b/cocos/2d/actions/CCAction.h similarity index 100% rename from cocos2dx/actions/CCAction.h rename to cocos/2d/actions/CCAction.h diff --git a/cocos2dx/actions/CCActionCamera.cpp b/cocos/2d/actions/CCActionCamera.cpp similarity index 100% rename from cocos2dx/actions/CCActionCamera.cpp rename to cocos/2d/actions/CCActionCamera.cpp diff --git a/cocos2dx/actions/CCActionCamera.h b/cocos/2d/actions/CCActionCamera.h similarity index 100% rename from cocos2dx/actions/CCActionCamera.h rename to cocos/2d/actions/CCActionCamera.h diff --git a/cocos2dx/actions/CCActionCatmullRom.cpp b/cocos/2d/actions/CCActionCatmullRom.cpp similarity index 100% rename from cocos2dx/actions/CCActionCatmullRom.cpp rename to cocos/2d/actions/CCActionCatmullRom.cpp diff --git a/cocos2dx/actions/CCActionCatmullRom.h b/cocos/2d/actions/CCActionCatmullRom.h similarity index 100% rename from cocos2dx/actions/CCActionCatmullRom.h rename to cocos/2d/actions/CCActionCatmullRom.h diff --git a/cocos2dx/actions/CCActionEase.cpp b/cocos/2d/actions/CCActionEase.cpp similarity index 100% rename from cocos2dx/actions/CCActionEase.cpp rename to cocos/2d/actions/CCActionEase.cpp diff --git a/cocos2dx/actions/CCActionEase.h b/cocos/2d/actions/CCActionEase.h similarity index 100% rename from cocos2dx/actions/CCActionEase.h rename to cocos/2d/actions/CCActionEase.h diff --git a/cocos2dx/actions/CCActionGrid.cpp b/cocos/2d/actions/CCActionGrid.cpp similarity index 100% rename from cocos2dx/actions/CCActionGrid.cpp rename to cocos/2d/actions/CCActionGrid.cpp diff --git a/cocos2dx/actions/CCActionGrid.h b/cocos/2d/actions/CCActionGrid.h similarity index 100% rename from cocos2dx/actions/CCActionGrid.h rename to cocos/2d/actions/CCActionGrid.h diff --git a/cocos2dx/actions/CCActionGrid3D.cpp b/cocos/2d/actions/CCActionGrid3D.cpp similarity index 100% rename from cocos2dx/actions/CCActionGrid3D.cpp rename to cocos/2d/actions/CCActionGrid3D.cpp diff --git a/cocos2dx/actions/CCActionGrid3D.h b/cocos/2d/actions/CCActionGrid3D.h similarity index 100% rename from cocos2dx/actions/CCActionGrid3D.h rename to cocos/2d/actions/CCActionGrid3D.h diff --git a/cocos2dx/actions/CCActionInstant.cpp b/cocos/2d/actions/CCActionInstant.cpp similarity index 100% rename from cocos2dx/actions/CCActionInstant.cpp rename to cocos/2d/actions/CCActionInstant.cpp diff --git a/cocos2dx/actions/CCActionInstant.h b/cocos/2d/actions/CCActionInstant.h similarity index 100% rename from cocos2dx/actions/CCActionInstant.h rename to cocos/2d/actions/CCActionInstant.h diff --git a/cocos2dx/actions/CCActionInterval.cpp b/cocos/2d/actions/CCActionInterval.cpp similarity index 100% rename from cocos2dx/actions/CCActionInterval.cpp rename to cocos/2d/actions/CCActionInterval.cpp diff --git a/cocos2dx/actions/CCActionInterval.h b/cocos/2d/actions/CCActionInterval.h similarity index 100% rename from cocos2dx/actions/CCActionInterval.h rename to cocos/2d/actions/CCActionInterval.h diff --git a/cocos2dx/actions/CCActionManager.cpp b/cocos/2d/actions/CCActionManager.cpp similarity index 100% rename from cocos2dx/actions/CCActionManager.cpp rename to cocos/2d/actions/CCActionManager.cpp diff --git a/cocos2dx/actions/CCActionManager.h b/cocos/2d/actions/CCActionManager.h similarity index 100% rename from cocos2dx/actions/CCActionManager.h rename to cocos/2d/actions/CCActionManager.h diff --git a/cocos2dx/actions/CCActionPageTurn3D.cpp b/cocos/2d/actions/CCActionPageTurn3D.cpp similarity index 100% rename from cocos2dx/actions/CCActionPageTurn3D.cpp rename to cocos/2d/actions/CCActionPageTurn3D.cpp diff --git a/cocos2dx/actions/CCActionPageTurn3D.h b/cocos/2d/actions/CCActionPageTurn3D.h similarity index 100% rename from cocos2dx/actions/CCActionPageTurn3D.h rename to cocos/2d/actions/CCActionPageTurn3D.h diff --git a/cocos2dx/actions/CCActionProgressTimer.cpp b/cocos/2d/actions/CCActionProgressTimer.cpp similarity index 100% rename from cocos2dx/actions/CCActionProgressTimer.cpp rename to cocos/2d/actions/CCActionProgressTimer.cpp diff --git a/cocos2dx/actions/CCActionProgressTimer.h b/cocos/2d/actions/CCActionProgressTimer.h similarity index 100% rename from cocos2dx/actions/CCActionProgressTimer.h rename to cocos/2d/actions/CCActionProgressTimer.h diff --git a/cocos2dx/actions/CCActionTiledGrid.cpp b/cocos/2d/actions/CCActionTiledGrid.cpp similarity index 100% rename from cocos2dx/actions/CCActionTiledGrid.cpp rename to cocos/2d/actions/CCActionTiledGrid.cpp diff --git a/cocos2dx/actions/CCActionTiledGrid.h b/cocos/2d/actions/CCActionTiledGrid.h similarity index 100% rename from cocos2dx/actions/CCActionTiledGrid.h rename to cocos/2d/actions/CCActionTiledGrid.h diff --git a/cocos2dx/actions/CCActionTween.cpp b/cocos/2d/actions/CCActionTween.cpp similarity index 100% rename from cocos2dx/actions/CCActionTween.cpp rename to cocos/2d/actions/CCActionTween.cpp diff --git a/cocos2dx/actions/CCActionTween.h b/cocos/2d/actions/CCActionTween.h similarity index 100% rename from cocos2dx/actions/CCActionTween.h rename to cocos/2d/actions/CCActionTween.h diff --git a/cocos2dx/base_nodes/CCAtlasNode.cpp b/cocos/2d/base-nodes/CCAtlasNode.cpp similarity index 100% rename from cocos2dx/base_nodes/CCAtlasNode.cpp rename to cocos/2d/base-nodes/CCAtlasNode.cpp diff --git a/cocos2dx/base_nodes/CCAtlasNode.h b/cocos/2d/base-nodes/CCAtlasNode.h similarity index 100% rename from cocos2dx/base_nodes/CCAtlasNode.h rename to cocos/2d/base-nodes/CCAtlasNode.h diff --git a/cocos2dx/base_nodes/CCGLBufferedNode.cpp b/cocos/2d/base-nodes/CCGLBufferedNode.cpp similarity index 100% rename from cocos2dx/base_nodes/CCGLBufferedNode.cpp rename to cocos/2d/base-nodes/CCGLBufferedNode.cpp diff --git a/cocos2dx/base_nodes/CCGLBufferedNode.h b/cocos/2d/base-nodes/CCGLBufferedNode.h similarity index 100% rename from cocos2dx/base_nodes/CCGLBufferedNode.h rename to cocos/2d/base-nodes/CCGLBufferedNode.h diff --git a/cocos2dx/base_nodes/CCNode.cpp b/cocos/2d/base-nodes/CCNode.cpp similarity index 100% rename from cocos2dx/base_nodes/CCNode.cpp rename to cocos/2d/base-nodes/CCNode.cpp diff --git a/cocos2dx/base_nodes/CCNode.h b/cocos/2d/base-nodes/CCNode.h similarity index 100% rename from cocos2dx/base_nodes/CCNode.h rename to cocos/2d/base-nodes/CCNode.h diff --git a/cocos2dx/ccFPSImages.c b/cocos/2d/ccFPSImages.c similarity index 100% rename from cocos2dx/ccFPSImages.c rename to cocos/2d/ccFPSImages.c diff --git a/cocos2dx/ccFPSImages.h b/cocos/2d/ccFPSImages.h similarity index 100% rename from cocos2dx/ccFPSImages.h rename to cocos/2d/ccFPSImages.h diff --git a/cocos2dx/ccTypes.cpp b/cocos/2d/ccTypes.cpp similarity index 100% rename from cocos2dx/ccTypes.cpp rename to cocos/2d/ccTypes.cpp diff --git a/cocos2dx/cocos2d.cpp b/cocos/2d/cocos2d.cpp similarity index 100% rename from cocos2dx/cocos2d.cpp rename to cocos/2d/cocos2d.cpp diff --git a/cocos2dx/cocos2dx-Prefix.pch b/cocos/2d/cocos2dx-Prefix.pch similarity index 100% rename from cocos2dx/cocos2dx-Prefix.pch rename to cocos/2d/cocos2dx-Prefix.pch diff --git a/cocos2dx/draw_nodes/CCDrawNode.cpp b/cocos/2d/draw-nodes/CCDrawNode.cpp similarity index 100% rename from cocos2dx/draw_nodes/CCDrawNode.cpp rename to cocos/2d/draw-nodes/CCDrawNode.cpp diff --git a/cocos2dx/draw_nodes/CCDrawNode.h b/cocos/2d/draw-nodes/CCDrawNode.h similarity index 100% rename from cocos2dx/draw_nodes/CCDrawNode.h rename to cocos/2d/draw-nodes/CCDrawNode.h diff --git a/cocos2dx/draw_nodes/CCDrawingPrimitives.cpp b/cocos/2d/draw-nodes/CCDrawingPrimitives.cpp similarity index 100% rename from cocos2dx/draw_nodes/CCDrawingPrimitives.cpp rename to cocos/2d/draw-nodes/CCDrawingPrimitives.cpp diff --git a/cocos2dx/draw_nodes/CCDrawingPrimitives.h b/cocos/2d/draw-nodes/CCDrawingPrimitives.h similarity index 100% rename from cocos2dx/draw_nodes/CCDrawingPrimitives.h rename to cocos/2d/draw-nodes/CCDrawingPrimitives.h diff --git a/cocos2dx/effects/CCGrabber.cpp b/cocos/2d/effects/CCGrabber.cpp similarity index 100% rename from cocos2dx/effects/CCGrabber.cpp rename to cocos/2d/effects/CCGrabber.cpp diff --git a/cocos2dx/effects/CCGrabber.h b/cocos/2d/effects/CCGrabber.h similarity index 100% rename from cocos2dx/effects/CCGrabber.h rename to cocos/2d/effects/CCGrabber.h diff --git a/cocos2dx/effects/CCGrid.cpp b/cocos/2d/effects/CCGrid.cpp similarity index 100% rename from cocos2dx/effects/CCGrid.cpp rename to cocos/2d/effects/CCGrid.cpp diff --git a/cocos2dx/effects/CCGrid.h b/cocos/2d/effects/CCGrid.h similarity index 100% rename from cocos2dx/effects/CCGrid.h rename to cocos/2d/effects/CCGrid.h diff --git a/cocos2dx/event_dispatcher/CCEvent.cpp b/cocos/2d/event-dispatcher/CCEvent.cpp similarity index 100% rename from cocos2dx/event_dispatcher/CCEvent.cpp rename to cocos/2d/event-dispatcher/CCEvent.cpp diff --git a/cocos2dx/event_dispatcher/CCEvent.h b/cocos/2d/event-dispatcher/CCEvent.h similarity index 100% rename from cocos2dx/event_dispatcher/CCEvent.h rename to cocos/2d/event-dispatcher/CCEvent.h diff --git a/cocos2dx/event_dispatcher/CCEventAcceleration.cpp b/cocos/2d/event-dispatcher/CCEventAcceleration.cpp similarity index 100% rename from cocos2dx/event_dispatcher/CCEventAcceleration.cpp rename to cocos/2d/event-dispatcher/CCEventAcceleration.cpp diff --git a/cocos2dx/event_dispatcher/CCEventAcceleration.h b/cocos/2d/event-dispatcher/CCEventAcceleration.h similarity index 100% rename from cocos2dx/event_dispatcher/CCEventAcceleration.h rename to cocos/2d/event-dispatcher/CCEventAcceleration.h diff --git a/cocos2dx/event_dispatcher/CCEventCustom.cpp b/cocos/2d/event-dispatcher/CCEventCustom.cpp similarity index 100% rename from cocos2dx/event_dispatcher/CCEventCustom.cpp rename to cocos/2d/event-dispatcher/CCEventCustom.cpp diff --git a/cocos2dx/event_dispatcher/CCEventCustom.h b/cocos/2d/event-dispatcher/CCEventCustom.h similarity index 100% rename from cocos2dx/event_dispatcher/CCEventCustom.h rename to cocos/2d/event-dispatcher/CCEventCustom.h diff --git a/cocos2dx/event_dispatcher/CCEventDispatcher.cpp b/cocos/2d/event-dispatcher/CCEventDispatcher.cpp similarity index 100% rename from cocos2dx/event_dispatcher/CCEventDispatcher.cpp rename to cocos/2d/event-dispatcher/CCEventDispatcher.cpp diff --git a/cocos2dx/event_dispatcher/CCEventDispatcher.h b/cocos/2d/event-dispatcher/CCEventDispatcher.h similarity index 100% rename from cocos2dx/event_dispatcher/CCEventDispatcher.h rename to cocos/2d/event-dispatcher/CCEventDispatcher.h diff --git a/cocos2dx/event_dispatcher/CCEventKeyboard.cpp b/cocos/2d/event-dispatcher/CCEventKeyboard.cpp similarity index 100% rename from cocos2dx/event_dispatcher/CCEventKeyboard.cpp rename to cocos/2d/event-dispatcher/CCEventKeyboard.cpp diff --git a/cocos2dx/event_dispatcher/CCEventKeyboard.h b/cocos/2d/event-dispatcher/CCEventKeyboard.h similarity index 100% rename from cocos2dx/event_dispatcher/CCEventKeyboard.h rename to cocos/2d/event-dispatcher/CCEventKeyboard.h diff --git a/cocos2dx/event_dispatcher/CCEventListener.cpp b/cocos/2d/event-dispatcher/CCEventListener.cpp similarity index 100% rename from cocos2dx/event_dispatcher/CCEventListener.cpp rename to cocos/2d/event-dispatcher/CCEventListener.cpp diff --git a/cocos2dx/event_dispatcher/CCEventListener.h b/cocos/2d/event-dispatcher/CCEventListener.h similarity index 100% rename from cocos2dx/event_dispatcher/CCEventListener.h rename to cocos/2d/event-dispatcher/CCEventListener.h diff --git a/cocos2dx/event_dispatcher/CCEventListenerAcceleration.cpp b/cocos/2d/event-dispatcher/CCEventListenerAcceleration.cpp similarity index 100% rename from cocos2dx/event_dispatcher/CCEventListenerAcceleration.cpp rename to cocos/2d/event-dispatcher/CCEventListenerAcceleration.cpp diff --git a/cocos2dx/event_dispatcher/CCEventListenerAcceleration.h b/cocos/2d/event-dispatcher/CCEventListenerAcceleration.h similarity index 100% rename from cocos2dx/event_dispatcher/CCEventListenerAcceleration.h rename to cocos/2d/event-dispatcher/CCEventListenerAcceleration.h diff --git a/cocos2dx/event_dispatcher/CCEventListenerCustom.cpp b/cocos/2d/event-dispatcher/CCEventListenerCustom.cpp similarity index 100% rename from cocos2dx/event_dispatcher/CCEventListenerCustom.cpp rename to cocos/2d/event-dispatcher/CCEventListenerCustom.cpp diff --git a/cocos2dx/event_dispatcher/CCEventListenerCustom.h b/cocos/2d/event-dispatcher/CCEventListenerCustom.h similarity index 100% rename from cocos2dx/event_dispatcher/CCEventListenerCustom.h rename to cocos/2d/event-dispatcher/CCEventListenerCustom.h diff --git a/cocos2dx/event_dispatcher/CCEventListenerKeyboard.cpp b/cocos/2d/event-dispatcher/CCEventListenerKeyboard.cpp similarity index 100% rename from cocos2dx/event_dispatcher/CCEventListenerKeyboard.cpp rename to cocos/2d/event-dispatcher/CCEventListenerKeyboard.cpp diff --git a/cocos2dx/event_dispatcher/CCEventListenerKeyboard.h b/cocos/2d/event-dispatcher/CCEventListenerKeyboard.h similarity index 100% rename from cocos2dx/event_dispatcher/CCEventListenerKeyboard.h rename to cocos/2d/event-dispatcher/CCEventListenerKeyboard.h diff --git a/cocos2dx/event_dispatcher/CCEventListenerTouch.cpp b/cocos/2d/event-dispatcher/CCEventListenerTouch.cpp similarity index 100% rename from cocos2dx/event_dispatcher/CCEventListenerTouch.cpp rename to cocos/2d/event-dispatcher/CCEventListenerTouch.cpp diff --git a/cocos2dx/event_dispatcher/CCEventListenerTouch.h b/cocos/2d/event-dispatcher/CCEventListenerTouch.h similarity index 100% rename from cocos2dx/event_dispatcher/CCEventListenerTouch.h rename to cocos/2d/event-dispatcher/CCEventListenerTouch.h diff --git a/cocos2dx/event_dispatcher/CCEventTouch.cpp b/cocos/2d/event-dispatcher/CCEventTouch.cpp similarity index 100% rename from cocos2dx/event_dispatcher/CCEventTouch.cpp rename to cocos/2d/event-dispatcher/CCEventTouch.cpp diff --git a/cocos2dx/event_dispatcher/CCEventTouch.h b/cocos/2d/event-dispatcher/CCEventTouch.h similarity index 100% rename from cocos2dx/event_dispatcher/CCEventTouch.h rename to cocos/2d/event-dispatcher/CCEventTouch.h diff --git a/cocos2dx/event_dispatcher/CCTouch.cpp b/cocos/2d/event-dispatcher/CCTouch.cpp similarity index 100% rename from cocos2dx/event_dispatcher/CCTouch.cpp rename to cocos/2d/event-dispatcher/CCTouch.cpp diff --git a/cocos2dx/event_dispatcher/CCTouch.h b/cocos/2d/event-dispatcher/CCTouch.h similarity index 100% rename from cocos2dx/event_dispatcher/CCTouch.h rename to cocos/2d/event-dispatcher/CCTouch.h diff --git a/cocos2dx/include/CCDeprecated.h b/cocos/2d/include/CCDeprecated.h similarity index 100% rename from cocos2dx/include/CCDeprecated.h rename to cocos/2d/include/CCDeprecated.h diff --git a/cocos2dx/include/CCEventType.h b/cocos/2d/include/CCEventType.h similarity index 100% rename from cocos2dx/include/CCEventType.h rename to cocos/2d/include/CCEventType.h diff --git a/cocos2dx/include/CCProtocols.h b/cocos/2d/include/CCProtocols.h similarity index 100% rename from cocos2dx/include/CCProtocols.h rename to cocos/2d/include/CCProtocols.h diff --git a/cocos2dx/include/ccConfig.h b/cocos/2d/include/ccConfig.h similarity index 100% rename from cocos2dx/include/ccConfig.h rename to cocos/2d/include/ccConfig.h diff --git a/cocos2dx/include/ccMacros.h b/cocos/2d/include/ccMacros.h similarity index 100% rename from cocos2dx/include/ccMacros.h rename to cocos/2d/include/ccMacros.h diff --git a/cocos2dx/include/ccTypes.h b/cocos/2d/include/ccTypes.h similarity index 100% rename from cocos2dx/include/ccTypes.h rename to cocos/2d/include/ccTypes.h diff --git a/cocos2dx/include/cocos2d.h b/cocos/2d/include/cocos2d.h similarity index 84% rename from cocos2dx/include/cocos2d.h rename to cocos/2d/include/cocos2d.h index 2280067cfc..bb270d265a 100644 --- a/cocos2dx/include/cocos2d.h +++ b/cocos/2d/include/cocos2d.h @@ -86,11 +86,6 @@ THE SOFTWARE. #include "ccMacros.h" #include "ccTypes.h" - -// kazmath -#include "kazmath/include/kazmath/kazmath.h" -#include "kazmath/include/kazmath/GL/matrix.h" - // label_nodes #include "label_nodes/CCLabelAtlas.h" #include "label_nodes/CCLabelTTF.h" @@ -179,43 +174,6 @@ THE SOFTWARE. #include "platform/linux/CCStdC.h" #endif // CC_TARGET_PLATFORM == CC_PLATFORM_LINUX -// MARMALADE CHANGE -// Added for Marmalade support -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MARMALADE) - #include "platform/Marmalade/CCApplication.h" - #include "platform/Marmalade/CCEGLView.h" - #include "platform/Marmalade/CCGL.h" - #include "platform/Marmalade/CCStdC.h" -#endif // CC_TARGET_PLATFORM == CC_PLATFORM_LINUX - -#if (CC_TARGET_PLATFORM == CC_PLATFORM_NACL) - #include "platform/nacl/CCApplication.h" - #include "platform/nacl/CCEGLView.h" - #include "platform/nacl/CCGL.h" - #include "platform/nacl/CCStdC.h" -#endif // CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID - -#if (CC_TARGET_PLATFORM == CC_PLATFORM_EMSCRIPTEN) - #include "platform/emscripten/CCApplication.h" - #include "platform/emscripten/CCEGLView.h" - #include "platform/emscripten/CCGL.h" - #include "platform/emscripten/CCStdC.h" -#endif // CC_TARGET_PLATFORM == CC_PLATFORM_EMSCRIPTEN - -#if (CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN) - #include "platform/tizen/CCApplication.h" - #include "platform/tizen/CCEGLView.h" - #include "platform/tizen/CCGL.h" - #include "platform/tizen/CCStdC.h" -#endif // CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN - -#if (CC_TARGET_PLATFORM == CC_PLATFORM_QT5) - #include "platform/qt5/CCApplication.h" - #include "platform/qt5/CCEGLView.h" - #include "platform/qt5/CCGL.h" - #include "platform/qt5/CCStdC.h" -#endif // CC_TARGET_PLATFORM == CC_PLATFORM_QT5 - // script_support #include "script_support/CCScriptSupport.h" diff --git a/cocos2dx/label_nodes/CCFont.cpp b/cocos/2d/label-nodes/CCFont.cpp similarity index 100% rename from cocos2dx/label_nodes/CCFont.cpp rename to cocos/2d/label-nodes/CCFont.cpp diff --git a/cocos2dx/label_nodes/CCFont.h b/cocos/2d/label-nodes/CCFont.h similarity index 100% rename from cocos2dx/label_nodes/CCFont.h rename to cocos/2d/label-nodes/CCFont.h diff --git a/cocos2dx/label_nodes/CCFontAtlas.cpp b/cocos/2d/label-nodes/CCFontAtlas.cpp similarity index 100% rename from cocos2dx/label_nodes/CCFontAtlas.cpp rename to cocos/2d/label-nodes/CCFontAtlas.cpp diff --git a/cocos2dx/label_nodes/CCFontAtlas.h b/cocos/2d/label-nodes/CCFontAtlas.h similarity index 100% rename from cocos2dx/label_nodes/CCFontAtlas.h rename to cocos/2d/label-nodes/CCFontAtlas.h diff --git a/cocos2dx/label_nodes/CCFontAtlasCache.cpp b/cocos/2d/label-nodes/CCFontAtlasCache.cpp similarity index 100% rename from cocos2dx/label_nodes/CCFontAtlasCache.cpp rename to cocos/2d/label-nodes/CCFontAtlasCache.cpp diff --git a/cocos2dx/label_nodes/CCFontAtlasCache.h b/cocos/2d/label-nodes/CCFontAtlasCache.h similarity index 100% rename from cocos2dx/label_nodes/CCFontAtlasCache.h rename to cocos/2d/label-nodes/CCFontAtlasCache.h diff --git a/cocos2dx/label_nodes/CCFontAtlasFactory.cpp b/cocos/2d/label-nodes/CCFontAtlasFactory.cpp similarity index 100% rename from cocos2dx/label_nodes/CCFontAtlasFactory.cpp rename to cocos/2d/label-nodes/CCFontAtlasFactory.cpp diff --git a/cocos2dx/label_nodes/CCFontAtlasFactory.h b/cocos/2d/label-nodes/CCFontAtlasFactory.h similarity index 100% rename from cocos2dx/label_nodes/CCFontAtlasFactory.h rename to cocos/2d/label-nodes/CCFontAtlasFactory.h diff --git a/cocos2dx/label_nodes/CCFontDefinition.cpp b/cocos/2d/label-nodes/CCFontDefinition.cpp similarity index 100% rename from cocos2dx/label_nodes/CCFontDefinition.cpp rename to cocos/2d/label-nodes/CCFontDefinition.cpp diff --git a/cocos2dx/label_nodes/CCFontDefinition.h b/cocos/2d/label-nodes/CCFontDefinition.h similarity index 100% rename from cocos2dx/label_nodes/CCFontDefinition.h rename to cocos/2d/label-nodes/CCFontDefinition.h diff --git a/cocos2dx/label_nodes/CCFontFNT.cpp b/cocos/2d/label-nodes/CCFontFNT.cpp similarity index 100% rename from cocos2dx/label_nodes/CCFontFNT.cpp rename to cocos/2d/label-nodes/CCFontFNT.cpp diff --git a/cocos2dx/label_nodes/CCFontFNT.h b/cocos/2d/label-nodes/CCFontFNT.h similarity index 100% rename from cocos2dx/label_nodes/CCFontFNT.h rename to cocos/2d/label-nodes/CCFontFNT.h diff --git a/cocos2dx/label_nodes/CCFontFreeType.cpp b/cocos/2d/label-nodes/CCFontFreeType.cpp similarity index 100% rename from cocos2dx/label_nodes/CCFontFreeType.cpp rename to cocos/2d/label-nodes/CCFontFreeType.cpp diff --git a/cocos2dx/label_nodes/CCFontFreeType.h b/cocos/2d/label-nodes/CCFontFreeType.h similarity index 100% rename from cocos2dx/label_nodes/CCFontFreeType.h rename to cocos/2d/label-nodes/CCFontFreeType.h diff --git a/cocos2dx/label_nodes/CCLabel.cpp b/cocos/2d/label-nodes/CCLabel.cpp similarity index 100% rename from cocos2dx/label_nodes/CCLabel.cpp rename to cocos/2d/label-nodes/CCLabel.cpp diff --git a/cocos2dx/label_nodes/CCLabel.h b/cocos/2d/label-nodes/CCLabel.h similarity index 100% rename from cocos2dx/label_nodes/CCLabel.h rename to cocos/2d/label-nodes/CCLabel.h diff --git a/cocos2dx/label_nodes/CCLabelAtlas.cpp b/cocos/2d/label-nodes/CCLabelAtlas.cpp similarity index 100% rename from cocos2dx/label_nodes/CCLabelAtlas.cpp rename to cocos/2d/label-nodes/CCLabelAtlas.cpp diff --git a/cocos2dx/label_nodes/CCLabelAtlas.h b/cocos/2d/label-nodes/CCLabelAtlas.h similarity index 100% rename from cocos2dx/label_nodes/CCLabelAtlas.h rename to cocos/2d/label-nodes/CCLabelAtlas.h diff --git a/cocos2dx/label_nodes/CCLabelBMFont.cpp b/cocos/2d/label-nodes/CCLabelBMFont.cpp similarity index 100% rename from cocos2dx/label_nodes/CCLabelBMFont.cpp rename to cocos/2d/label-nodes/CCLabelBMFont.cpp diff --git a/cocos2dx/label_nodes/CCLabelBMFont.h b/cocos/2d/label-nodes/CCLabelBMFont.h similarity index 100% rename from cocos2dx/label_nodes/CCLabelBMFont.h rename to cocos/2d/label-nodes/CCLabelBMFont.h diff --git a/cocos2dx/label_nodes/CCLabelTTF.cpp b/cocos/2d/label-nodes/CCLabelTTF.cpp similarity index 100% rename from cocos2dx/label_nodes/CCLabelTTF.cpp rename to cocos/2d/label-nodes/CCLabelTTF.cpp diff --git a/cocos2dx/label_nodes/CCLabelTTF.h b/cocos/2d/label-nodes/CCLabelTTF.h similarity index 100% rename from cocos2dx/label_nodes/CCLabelTTF.h rename to cocos/2d/label-nodes/CCLabelTTF.h diff --git a/cocos2dx/label_nodes/CCLabelTextFormatProtocol.h b/cocos/2d/label-nodes/CCLabelTextFormatProtocol.h similarity index 100% rename from cocos2dx/label_nodes/CCLabelTextFormatProtocol.h rename to cocos/2d/label-nodes/CCLabelTextFormatProtocol.h diff --git a/cocos2dx/label_nodes/CCLabelTextFormatter.cpp b/cocos/2d/label-nodes/CCLabelTextFormatter.cpp similarity index 100% rename from cocos2dx/label_nodes/CCLabelTextFormatter.cpp rename to cocos/2d/label-nodes/CCLabelTextFormatter.cpp diff --git a/cocos2dx/label_nodes/CCLabelTextFormatter.h b/cocos/2d/label-nodes/CCLabelTextFormatter.h similarity index 100% rename from cocos2dx/label_nodes/CCLabelTextFormatter.h rename to cocos/2d/label-nodes/CCLabelTextFormatter.h diff --git a/cocos2dx/label_nodes/CCTextImage.cpp b/cocos/2d/label-nodes/CCTextImage.cpp similarity index 100% rename from cocos2dx/label_nodes/CCTextImage.cpp rename to cocos/2d/label-nodes/CCTextImage.cpp diff --git a/cocos2dx/label_nodes/CCTextImage.h b/cocos/2d/label-nodes/CCTextImage.h similarity index 100% rename from cocos2dx/label_nodes/CCTextImage.h rename to cocos/2d/label-nodes/CCTextImage.h diff --git a/cocos2dx/layers_scenes_transitions_nodes/CCLayer.cpp b/cocos/2d/layers-scenes-transitions-nodes/CCLayer.cpp similarity index 100% rename from cocos2dx/layers_scenes_transitions_nodes/CCLayer.cpp rename to cocos/2d/layers-scenes-transitions-nodes/CCLayer.cpp diff --git a/cocos2dx/layers_scenes_transitions_nodes/CCLayer.h b/cocos/2d/layers-scenes-transitions-nodes/CCLayer.h similarity index 100% rename from cocos2dx/layers_scenes_transitions_nodes/CCLayer.h rename to cocos/2d/layers-scenes-transitions-nodes/CCLayer.h diff --git a/cocos2dx/layers_scenes_transitions_nodes/CCScene.cpp b/cocos/2d/layers-scenes-transitions-nodes/CCScene.cpp similarity index 100% rename from cocos2dx/layers_scenes_transitions_nodes/CCScene.cpp rename to cocos/2d/layers-scenes-transitions-nodes/CCScene.cpp diff --git a/cocos2dx/layers_scenes_transitions_nodes/CCScene.h b/cocos/2d/layers-scenes-transitions-nodes/CCScene.h similarity index 100% rename from cocos2dx/layers_scenes_transitions_nodes/CCScene.h rename to cocos/2d/layers-scenes-transitions-nodes/CCScene.h diff --git a/cocos2dx/layers_scenes_transitions_nodes/CCTransition.cpp b/cocos/2d/layers-scenes-transitions-nodes/CCTransition.cpp similarity index 100% rename from cocos2dx/layers_scenes_transitions_nodes/CCTransition.cpp rename to cocos/2d/layers-scenes-transitions-nodes/CCTransition.cpp diff --git a/cocos2dx/layers_scenes_transitions_nodes/CCTransition.h b/cocos/2d/layers-scenes-transitions-nodes/CCTransition.h similarity index 100% rename from cocos2dx/layers_scenes_transitions_nodes/CCTransition.h rename to cocos/2d/layers-scenes-transitions-nodes/CCTransition.h diff --git a/cocos2dx/layers_scenes_transitions_nodes/CCTransitionPageTurn.cpp b/cocos/2d/layers-scenes-transitions-nodes/CCTransitionPageTurn.cpp similarity index 100% rename from cocos2dx/layers_scenes_transitions_nodes/CCTransitionPageTurn.cpp rename to cocos/2d/layers-scenes-transitions-nodes/CCTransitionPageTurn.cpp diff --git a/cocos2dx/layers_scenes_transitions_nodes/CCTransitionPageTurn.h b/cocos/2d/layers-scenes-transitions-nodes/CCTransitionPageTurn.h similarity index 100% rename from cocos2dx/layers_scenes_transitions_nodes/CCTransitionPageTurn.h rename to cocos/2d/layers-scenes-transitions-nodes/CCTransitionPageTurn.h diff --git a/cocos2dx/layers_scenes_transitions_nodes/CCTransitionProgress.cpp b/cocos/2d/layers-scenes-transitions-nodes/CCTransitionProgress.cpp similarity index 100% rename from cocos2dx/layers_scenes_transitions_nodes/CCTransitionProgress.cpp rename to cocos/2d/layers-scenes-transitions-nodes/CCTransitionProgress.cpp diff --git a/cocos2dx/layers_scenes_transitions_nodes/CCTransitionProgress.h b/cocos/2d/layers-scenes-transitions-nodes/CCTransitionProgress.h similarity index 100% rename from cocos2dx/layers_scenes_transitions_nodes/CCTransitionProgress.h rename to cocos/2d/layers-scenes-transitions-nodes/CCTransitionProgress.h diff --git a/cocos2dx/menu_nodes/CCMenu.cpp b/cocos/2d/menu-nodes/CCMenu.cpp similarity index 100% rename from cocos2dx/menu_nodes/CCMenu.cpp rename to cocos/2d/menu-nodes/CCMenu.cpp diff --git a/cocos2dx/menu_nodes/CCMenu.h b/cocos/2d/menu-nodes/CCMenu.h similarity index 100% rename from cocos2dx/menu_nodes/CCMenu.h rename to cocos/2d/menu-nodes/CCMenu.h diff --git a/cocos2dx/menu_nodes/CCMenuItem.cpp b/cocos/2d/menu-nodes/CCMenuItem.cpp similarity index 100% rename from cocos2dx/menu_nodes/CCMenuItem.cpp rename to cocos/2d/menu-nodes/CCMenuItem.cpp diff --git a/cocos2dx/menu_nodes/CCMenuItem.h b/cocos/2d/menu-nodes/CCMenuItem.h similarity index 100% rename from cocos2dx/menu_nodes/CCMenuItem.h rename to cocos/2d/menu-nodes/CCMenuItem.h diff --git a/cocos2dx/misc_nodes/CCClippingNode.cpp b/cocos/2d/misc-nodes/CCClippingNode.cpp similarity index 100% rename from cocos2dx/misc_nodes/CCClippingNode.cpp rename to cocos/2d/misc-nodes/CCClippingNode.cpp diff --git a/cocos2dx/misc_nodes/CCClippingNode.h b/cocos/2d/misc-nodes/CCClippingNode.h similarity index 100% rename from cocos2dx/misc_nodes/CCClippingNode.h rename to cocos/2d/misc-nodes/CCClippingNode.h diff --git a/cocos2dx/misc_nodes/CCMotionStreak.cpp b/cocos/2d/misc-nodes/CCMotionStreak.cpp similarity index 100% rename from cocos2dx/misc_nodes/CCMotionStreak.cpp rename to cocos/2d/misc-nodes/CCMotionStreak.cpp diff --git a/cocos2dx/misc_nodes/CCMotionStreak.h b/cocos/2d/misc-nodes/CCMotionStreak.h similarity index 100% rename from cocos2dx/misc_nodes/CCMotionStreak.h rename to cocos/2d/misc-nodes/CCMotionStreak.h diff --git a/cocos2dx/misc_nodes/CCProgressTimer.cpp b/cocos/2d/misc-nodes/CCProgressTimer.cpp similarity index 100% rename from cocos2dx/misc_nodes/CCProgressTimer.cpp rename to cocos/2d/misc-nodes/CCProgressTimer.cpp diff --git a/cocos2dx/misc_nodes/CCProgressTimer.h b/cocos/2d/misc-nodes/CCProgressTimer.h similarity index 100% rename from cocos2dx/misc_nodes/CCProgressTimer.h rename to cocos/2d/misc-nodes/CCProgressTimer.h diff --git a/cocos2dx/misc_nodes/CCRenderTexture.cpp b/cocos/2d/misc-nodes/CCRenderTexture.cpp similarity index 100% rename from cocos2dx/misc_nodes/CCRenderTexture.cpp rename to cocos/2d/misc-nodes/CCRenderTexture.cpp diff --git a/cocos2dx/misc_nodes/CCRenderTexture.h b/cocos/2d/misc-nodes/CCRenderTexture.h similarity index 100% rename from cocos2dx/misc_nodes/CCRenderTexture.h rename to cocos/2d/misc-nodes/CCRenderTexture.h diff --git a/cocos2dx/particle_nodes/CCParticleBatchNode.cpp b/cocos/2d/particle-nodes/CCParticleBatchNode.cpp similarity index 100% rename from cocos2dx/particle_nodes/CCParticleBatchNode.cpp rename to cocos/2d/particle-nodes/CCParticleBatchNode.cpp diff --git a/cocos2dx/particle_nodes/CCParticleBatchNode.h b/cocos/2d/particle-nodes/CCParticleBatchNode.h similarity index 100% rename from cocos2dx/particle_nodes/CCParticleBatchNode.h rename to cocos/2d/particle-nodes/CCParticleBatchNode.h diff --git a/cocos2dx/particle_nodes/CCParticleExamples.cpp b/cocos/2d/particle-nodes/CCParticleExamples.cpp similarity index 100% rename from cocos2dx/particle_nodes/CCParticleExamples.cpp rename to cocos/2d/particle-nodes/CCParticleExamples.cpp diff --git a/cocos2dx/particle_nodes/CCParticleExamples.h b/cocos/2d/particle-nodes/CCParticleExamples.h similarity index 100% rename from cocos2dx/particle_nodes/CCParticleExamples.h rename to cocos/2d/particle-nodes/CCParticleExamples.h diff --git a/cocos2dx/particle_nodes/CCParticleSystem.cpp b/cocos/2d/particle-nodes/CCParticleSystem.cpp similarity index 100% rename from cocos2dx/particle_nodes/CCParticleSystem.cpp rename to cocos/2d/particle-nodes/CCParticleSystem.cpp diff --git a/cocos2dx/particle_nodes/CCParticleSystem.h b/cocos/2d/particle-nodes/CCParticleSystem.h similarity index 100% rename from cocos2dx/particle_nodes/CCParticleSystem.h rename to cocos/2d/particle-nodes/CCParticleSystem.h diff --git a/cocos2dx/particle_nodes/CCParticleSystemQuad.cpp b/cocos/2d/particle-nodes/CCParticleSystemQuad.cpp similarity index 100% rename from cocos2dx/particle_nodes/CCParticleSystemQuad.cpp rename to cocos/2d/particle-nodes/CCParticleSystemQuad.cpp diff --git a/cocos2dx/particle_nodes/CCParticleSystemQuad.h b/cocos/2d/particle-nodes/CCParticleSystemQuad.h similarity index 100% rename from cocos2dx/particle_nodes/CCParticleSystemQuad.h rename to cocos/2d/particle-nodes/CCParticleSystemQuad.h diff --git a/cocos2dx/particle_nodes/firePngData.h b/cocos/2d/particle-nodes/firePngData.h similarity index 100% rename from cocos2dx/particle_nodes/firePngData.h rename to cocos/2d/particle-nodes/firePngData.h diff --git a/cocos2dx/platform/CCApplicationProtocol.h b/cocos/2d/platform/CCApplicationProtocol.h similarity index 100% rename from cocos2dx/platform/CCApplicationProtocol.h rename to cocos/2d/platform/CCApplicationProtocol.h diff --git a/cocos2dx/platform/CCCommon.h b/cocos/2d/platform/CCCommon.h similarity index 100% rename from cocos2dx/platform/CCCommon.h rename to cocos/2d/platform/CCCommon.h diff --git a/cocos2dx/platform/CCDevice.h b/cocos/2d/platform/CCDevice.h similarity index 100% rename from cocos2dx/platform/CCDevice.h rename to cocos/2d/platform/CCDevice.h diff --git a/cocos2dx/platform/CCEGLViewProtocol.cpp b/cocos/2d/platform/CCEGLViewProtocol.cpp similarity index 100% rename from cocos2dx/platform/CCEGLViewProtocol.cpp rename to cocos/2d/platform/CCEGLViewProtocol.cpp diff --git a/cocos2dx/platform/CCEGLViewProtocol.h b/cocos/2d/platform/CCEGLViewProtocol.h similarity index 100% rename from cocos2dx/platform/CCEGLViewProtocol.h rename to cocos/2d/platform/CCEGLViewProtocol.h diff --git a/cocos2dx/platform/CCFileUtils.cpp b/cocos/2d/platform/CCFileUtils.cpp similarity index 100% rename from cocos2dx/platform/CCFileUtils.cpp rename to cocos/2d/platform/CCFileUtils.cpp diff --git a/cocos2dx/platform/CCFileUtils.h b/cocos/2d/platform/CCFileUtils.h similarity index 100% rename from cocos2dx/platform/CCFileUtils.h rename to cocos/2d/platform/CCFileUtils.h diff --git a/cocos2dx/platform/CCImage.h b/cocos/2d/platform/CCImage.h similarity index 100% rename from cocos2dx/platform/CCImage.h rename to cocos/2d/platform/CCImage.h diff --git a/cocos2dx/platform/CCImageCommon_cpp.h b/cocos/2d/platform/CCImageCommon_cpp.h similarity index 100% rename from cocos2dx/platform/CCImageCommon_cpp.h rename to cocos/2d/platform/CCImageCommon_cpp.h diff --git a/cocos2dx/platform/CCSAXParser.cpp b/cocos/2d/platform/CCSAXParser.cpp similarity index 100% rename from cocos2dx/platform/CCSAXParser.cpp rename to cocos/2d/platform/CCSAXParser.cpp diff --git a/cocos2dx/platform/CCSAXParser.h b/cocos/2d/platform/CCSAXParser.h similarity index 100% rename from cocos2dx/platform/CCSAXParser.h rename to cocos/2d/platform/CCSAXParser.h diff --git a/cocos2dx/platform/CCThread.cpp b/cocos/2d/platform/CCThread.cpp similarity index 100% rename from cocos2dx/platform/CCThread.cpp rename to cocos/2d/platform/CCThread.cpp diff --git a/cocos2dx/platform/CCThread.h b/cocos/2d/platform/CCThread.h similarity index 100% rename from cocos2dx/platform/CCThread.h rename to cocos/2d/platform/CCThread.h diff --git a/cocos2dx/platform/android/Android.mk b/cocos/2d/platform/android/Android.mk similarity index 100% rename from cocos2dx/platform/android/Android.mk rename to cocos/2d/platform/android/Android.mk diff --git a/cocos2dx/platform/android/CCApplication.cpp b/cocos/2d/platform/android/CCApplication.cpp similarity index 100% rename from cocos2dx/platform/android/CCApplication.cpp rename to cocos/2d/platform/android/CCApplication.cpp diff --git a/cocos2dx/platform/android/CCApplication.h b/cocos/2d/platform/android/CCApplication.h similarity index 100% rename from cocos2dx/platform/android/CCApplication.h rename to cocos/2d/platform/android/CCApplication.h diff --git a/cocos2dx/platform/android/CCCommon.cpp b/cocos/2d/platform/android/CCCommon.cpp similarity index 100% rename from cocos2dx/platform/android/CCCommon.cpp rename to cocos/2d/platform/android/CCCommon.cpp diff --git a/cocos2dx/platform/android/CCDevice.cpp b/cocos/2d/platform/android/CCDevice.cpp similarity index 100% rename from cocos2dx/platform/android/CCDevice.cpp rename to cocos/2d/platform/android/CCDevice.cpp diff --git a/cocos2dx/platform/android/CCEGLView.cpp b/cocos/2d/platform/android/CCEGLView.cpp similarity index 100% rename from cocos2dx/platform/android/CCEGLView.cpp rename to cocos/2d/platform/android/CCEGLView.cpp diff --git a/cocos2dx/platform/android/CCEGLView.h b/cocos/2d/platform/android/CCEGLView.h similarity index 100% rename from cocos2dx/platform/android/CCEGLView.h rename to cocos/2d/platform/android/CCEGLView.h diff --git a/cocos2dx/platform/android/CCFileUtilsAndroid.cpp b/cocos/2d/platform/android/CCFileUtilsAndroid.cpp similarity index 100% rename from cocos2dx/platform/android/CCFileUtilsAndroid.cpp rename to cocos/2d/platform/android/CCFileUtilsAndroid.cpp diff --git a/cocos2dx/platform/android/CCFileUtilsAndroid.h b/cocos/2d/platform/android/CCFileUtilsAndroid.h similarity index 100% rename from cocos2dx/platform/android/CCFileUtilsAndroid.h rename to cocos/2d/platform/android/CCFileUtilsAndroid.h diff --git a/cocos2dx/platform/android/CCGL.h b/cocos/2d/platform/android/CCGL.h similarity index 100% rename from cocos2dx/platform/android/CCGL.h rename to cocos/2d/platform/android/CCGL.h diff --git a/cocos2dx/platform/android/CCImage.cpp b/cocos/2d/platform/android/CCImage.cpp similarity index 100% rename from cocos2dx/platform/android/CCImage.cpp rename to cocos/2d/platform/android/CCImage.cpp diff --git a/cocos2dx/platform/android/CCPlatformDefine.h b/cocos/2d/platform/android/CCPlatformDefine.h similarity index 100% rename from cocos2dx/platform/android/CCPlatformDefine.h rename to cocos/2d/platform/android/CCPlatformDefine.h diff --git a/cocos2dx/platform/android/CCStdC.h b/cocos/2d/platform/android/CCStdC.h similarity index 100% rename from cocos2dx/platform/android/CCStdC.h rename to cocos/2d/platform/android/CCStdC.h diff --git a/cocos2dx/platform/android/java/.classpath b/cocos/2d/platform/android/java/.classpath similarity index 100% rename from cocos2dx/platform/android/java/.classpath rename to cocos/2d/platform/android/java/.classpath diff --git a/cocos2dx/platform/android/java/.project b/cocos/2d/platform/android/java/.project similarity index 100% rename from cocos2dx/platform/android/java/.project rename to cocos/2d/platform/android/java/.project diff --git a/cocos2dx/platform/android/java/.settings/org.eclipse.jdt.core.prefs b/cocos/2d/platform/android/java/.settings/org.eclipse.jdt.core.prefs similarity index 100% rename from cocos2dx/platform/android/java/.settings/org.eclipse.jdt.core.prefs rename to cocos/2d/platform/android/java/.settings/org.eclipse.jdt.core.prefs diff --git a/cocos2dx/platform/android/java/AndroidManifest.xml b/cocos/2d/platform/android/java/AndroidManifest.xml similarity index 100% rename from cocos2dx/platform/android/java/AndroidManifest.xml rename to cocos/2d/platform/android/java/AndroidManifest.xml diff --git a/cocos2dx/platform/android/java/ant.properties b/cocos/2d/platform/android/java/ant.properties similarity index 100% rename from cocos2dx/platform/android/java/ant.properties rename to cocos/2d/platform/android/java/ant.properties diff --git a/cocos2dx/platform/android/java/build.xml b/cocos/2d/platform/android/java/build.xml similarity index 100% rename from cocos2dx/platform/android/java/build.xml rename to cocos/2d/platform/android/java/build.xml diff --git a/cocos2dx/platform/android/java/proguard-project.txt b/cocos/2d/platform/android/java/proguard-project.txt similarity index 100% rename from cocos2dx/platform/android/java/proguard-project.txt rename to cocos/2d/platform/android/java/proguard-project.txt diff --git a/cocos2dx/platform/android/java/project.properties b/cocos/2d/platform/android/java/project.properties similarity index 100% rename from cocos2dx/platform/android/java/project.properties rename to cocos/2d/platform/android/java/project.properties diff --git a/cocos2dx/platform/android/java/res/.gitignore b/cocos/2d/platform/android/java/res/.gitignore similarity index 100% rename from cocos2dx/platform/android/java/res/.gitignore rename to cocos/2d/platform/android/java/res/.gitignore diff --git a/cocos2dx/platform/android/java/src/org/cocos2dx/lib/Cocos2dxBitmap.java b/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxBitmap.java similarity index 100% rename from cocos2dx/platform/android/java/src/org/cocos2dx/lib/Cocos2dxBitmap.java rename to cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxBitmap.java diff --git a/cocos2dx/platform/android/java/src/org/cocos2dx/lib/Cocos2dxEditBoxDialog.java b/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxEditBoxDialog.java similarity index 100% rename from cocos2dx/platform/android/java/src/org/cocos2dx/lib/Cocos2dxEditBoxDialog.java rename to cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxEditBoxDialog.java diff --git a/cocos2dx/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHelper.java b/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHelper.java similarity index 100% rename from cocos2dx/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHelper.java rename to cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHelper.java diff --git a/cocos2dx/platform/android/java/src/org/cocos2dx/lib/Cocos2dxLocalStorage.java b/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxLocalStorage.java similarity index 100% rename from cocos2dx/platform/android/java/src/org/cocos2dx/lib/Cocos2dxLocalStorage.java rename to cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxLocalStorage.java diff --git a/cocos2dx/platform/android/java/src/org/cocos2dx/lib/Cocos2dxLuaJavaBridge.java b/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxLuaJavaBridge.java similarity index 100% rename from cocos2dx/platform/android/java/src/org/cocos2dx/lib/Cocos2dxLuaJavaBridge.java rename to cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxLuaJavaBridge.java diff --git a/cocos2dx/platform/android/java/src/org/cocos2dx/lib/Cocos2dxMusic.java b/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxMusic.java similarity index 100% rename from cocos2dx/platform/android/java/src/org/cocos2dx/lib/Cocos2dxMusic.java rename to cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxMusic.java diff --git a/cocos2dx/platform/android/java/src/org/cocos2dx/lib/Cocos2dxSound.java b/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxSound.java similarity index 100% rename from cocos2dx/platform/android/java/src/org/cocos2dx/lib/Cocos2dxSound.java rename to cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxSound.java diff --git a/cocos2dx/platform/android/java/src/org/cocos2dx/lib/Cocos2dxTypefaces.java b/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxTypefaces.java similarity index 100% rename from cocos2dx/platform/android/java/src/org/cocos2dx/lib/Cocos2dxTypefaces.java rename to cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxTypefaces.java diff --git a/cocos2dx/platform/android/jni/DPIJni.cpp b/cocos/2d/platform/android/jni/DPIJni.cpp similarity index 100% rename from cocos2dx/platform/android/jni/DPIJni.cpp rename to cocos/2d/platform/android/jni/DPIJni.cpp diff --git a/cocos2dx/platform/android/jni/DPIJni.h b/cocos/2d/platform/android/jni/DPIJni.h similarity index 100% rename from cocos2dx/platform/android/jni/DPIJni.h rename to cocos/2d/platform/android/jni/DPIJni.h diff --git a/cocos2dx/platform/android/jni/IMEJni.cpp b/cocos/2d/platform/android/jni/IMEJni.cpp similarity index 100% rename from cocos2dx/platform/android/jni/IMEJni.cpp rename to cocos/2d/platform/android/jni/IMEJni.cpp diff --git a/cocos2dx/platform/android/jni/IMEJni.h b/cocos/2d/platform/android/jni/IMEJni.h similarity index 100% rename from cocos2dx/platform/android/jni/IMEJni.h rename to cocos/2d/platform/android/jni/IMEJni.h diff --git a/cocos2dx/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxBitmap.cpp b/cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxBitmap.cpp similarity index 100% rename from cocos2dx/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxBitmap.cpp rename to cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxBitmap.cpp diff --git a/cocos2dx/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxBitmap.h b/cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxBitmap.h similarity index 100% rename from cocos2dx/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxBitmap.h rename to cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxBitmap.h diff --git a/cocos2dx/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.cpp b/cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.cpp similarity index 100% rename from cocos2dx/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.cpp rename to cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.cpp diff --git a/cocos2dx/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.h b/cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.h similarity index 100% rename from cocos2dx/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.h rename to cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.h diff --git a/cocos2dx/platform/android/jni/JniHelper.cpp b/cocos/2d/platform/android/jni/JniHelper.cpp similarity index 100% rename from cocos2dx/platform/android/jni/JniHelper.cpp rename to cocos/2d/platform/android/jni/JniHelper.cpp diff --git a/cocos2dx/platform/android/jni/JniHelper.h b/cocos/2d/platform/android/jni/JniHelper.h similarity index 100% rename from cocos2dx/platform/android/jni/JniHelper.h rename to cocos/2d/platform/android/jni/JniHelper.h diff --git a/cocos2dx/platform/android/nativeactivity.cpp b/cocos/2d/platform/android/nativeactivity.cpp similarity index 100% rename from cocos2dx/platform/android/nativeactivity.cpp rename to cocos/2d/platform/android/nativeactivity.cpp diff --git a/cocos2dx/platform/android/nativeactivity.h b/cocos/2d/platform/android/nativeactivity.h similarity index 100% rename from cocos2dx/platform/android/nativeactivity.h rename to cocos/2d/platform/android/nativeactivity.h diff --git a/cocos2dx/platform/apple/CCFileUtilsApple.h b/cocos/2d/platform/apple/CCFileUtilsApple.h similarity index 100% rename from cocos2dx/platform/apple/CCFileUtilsApple.h rename to cocos/2d/platform/apple/CCFileUtilsApple.h diff --git a/cocos2dx/platform/apple/CCFileUtilsApple.mm b/cocos/2d/platform/apple/CCFileUtilsApple.mm similarity index 100% rename from cocos2dx/platform/apple/CCFileUtilsApple.mm rename to cocos/2d/platform/apple/CCFileUtilsApple.mm diff --git a/cocos2dx/platform/apple/CCLock.cpp b/cocos/2d/platform/apple/CCLock.cpp similarity index 100% rename from cocos2dx/platform/apple/CCLock.cpp rename to cocos/2d/platform/apple/CCLock.cpp diff --git a/cocos2dx/platform/apple/CCLock.h b/cocos/2d/platform/apple/CCLock.h similarity index 100% rename from cocos2dx/platform/apple/CCLock.h rename to cocos/2d/platform/apple/CCLock.h diff --git a/cocos2dx/platform/apple/CCThread.mm b/cocos/2d/platform/apple/CCThread.mm similarity index 100% rename from cocos2dx/platform/apple/CCThread.mm rename to cocos/2d/platform/apple/CCThread.mm diff --git a/cocos2dx/platform/ios/CCApplication.h b/cocos/2d/platform/ios/CCApplication.h similarity index 100% rename from cocos2dx/platform/ios/CCApplication.h rename to cocos/2d/platform/ios/CCApplication.h diff --git a/cocos2dx/platform/ios/CCApplication.mm b/cocos/2d/platform/ios/CCApplication.mm similarity index 100% rename from cocos2dx/platform/ios/CCApplication.mm rename to cocos/2d/platform/ios/CCApplication.mm diff --git a/cocos2dx/platform/ios/CCCommon.mm b/cocos/2d/platform/ios/CCCommon.mm similarity index 100% rename from cocos2dx/platform/ios/CCCommon.mm rename to cocos/2d/platform/ios/CCCommon.mm diff --git a/cocos2dx/platform/ios/CCDevice.mm b/cocos/2d/platform/ios/CCDevice.mm similarity index 100% rename from cocos2dx/platform/ios/CCDevice.mm rename to cocos/2d/platform/ios/CCDevice.mm diff --git a/cocos2dx/platform/ios/CCDirectorCaller.h b/cocos/2d/platform/ios/CCDirectorCaller.h similarity index 100% rename from cocos2dx/platform/ios/CCDirectorCaller.h rename to cocos/2d/platform/ios/CCDirectorCaller.h diff --git a/cocos2dx/platform/ios/CCDirectorCaller.mm b/cocos/2d/platform/ios/CCDirectorCaller.mm similarity index 100% rename from cocos2dx/platform/ios/CCDirectorCaller.mm rename to cocos/2d/platform/ios/CCDirectorCaller.mm diff --git a/cocos2dx/platform/ios/CCEGLView.h b/cocos/2d/platform/ios/CCEGLView.h similarity index 100% rename from cocos2dx/platform/ios/CCEGLView.h rename to cocos/2d/platform/ios/CCEGLView.h diff --git a/cocos2dx/platform/ios/CCEGLView.mm b/cocos/2d/platform/ios/CCEGLView.mm similarity index 100% rename from cocos2dx/platform/ios/CCEGLView.mm rename to cocos/2d/platform/ios/CCEGLView.mm diff --git a/cocos2dx/platform/ios/CCES2Renderer.h b/cocos/2d/platform/ios/CCES2Renderer.h similarity index 100% rename from cocos2dx/platform/ios/CCES2Renderer.h rename to cocos/2d/platform/ios/CCES2Renderer.h diff --git a/cocos2dx/platform/ios/CCES2Renderer.m b/cocos/2d/platform/ios/CCES2Renderer.m similarity index 100% rename from cocos2dx/platform/ios/CCES2Renderer.m rename to cocos/2d/platform/ios/CCES2Renderer.m diff --git a/cocos2dx/platform/ios/CCESRenderer.h b/cocos/2d/platform/ios/CCESRenderer.h similarity index 100% rename from cocos2dx/platform/ios/CCESRenderer.h rename to cocos/2d/platform/ios/CCESRenderer.h diff --git a/cocos2dx/platform/ios/CCGL.h b/cocos/2d/platform/ios/CCGL.h similarity index 100% rename from cocos2dx/platform/ios/CCGL.h rename to cocos/2d/platform/ios/CCGL.h diff --git a/cocos2dx/platform/ios/CCImage.mm b/cocos/2d/platform/ios/CCImage.mm similarity index 100% rename from cocos2dx/platform/ios/CCImage.mm rename to cocos/2d/platform/ios/CCImage.mm diff --git a/cocos2dx/platform/emscripten/CCPlatformDefine.h b/cocos/2d/platform/ios/CCPlatformDefine.h similarity index 100% rename from cocos2dx/platform/emscripten/CCPlatformDefine.h rename to cocos/2d/platform/ios/CCPlatformDefine.h diff --git a/cocos2dx/platform/ios/CCStdC.h b/cocos/2d/platform/ios/CCStdC.h similarity index 100% rename from cocos2dx/platform/ios/CCStdC.h rename to cocos/2d/platform/ios/CCStdC.h diff --git a/cocos2dx/platform/ios/EAGLView.h b/cocos/2d/platform/ios/EAGLView.h similarity index 100% rename from cocos2dx/platform/ios/EAGLView.h rename to cocos/2d/platform/ios/EAGLView.h diff --git a/cocos2dx/platform/ios/EAGLView.mm b/cocos/2d/platform/ios/EAGLView.mm similarity index 100% rename from cocos2dx/platform/ios/EAGLView.mm rename to cocos/2d/platform/ios/EAGLView.mm diff --git a/cocos2dx/platform/ios/OpenGL_Internal.h b/cocos/2d/platform/ios/OpenGL_Internal.h similarity index 100% rename from cocos2dx/platform/ios/OpenGL_Internal.h rename to cocos/2d/platform/ios/OpenGL_Internal.h diff --git a/cocos2dx/platform/ios/Simulation/AccelerometerSimulation.h b/cocos/2d/platform/ios/Simulation/AccelerometerSimulation.h similarity index 100% rename from cocos2dx/platform/ios/Simulation/AccelerometerSimulation.h rename to cocos/2d/platform/ios/Simulation/AccelerometerSimulation.h diff --git a/cocos2dx/platform/ios/Simulation/AccelerometerSimulation.m b/cocos/2d/platform/ios/Simulation/AccelerometerSimulation.m similarity index 100% rename from cocos2dx/platform/ios/Simulation/AccelerometerSimulation.m rename to cocos/2d/platform/ios/Simulation/AccelerometerSimulation.m diff --git a/cocos2dx/platform/linux/CCApplication.cpp b/cocos/2d/platform/linux/CCApplication.cpp similarity index 100% rename from cocos2dx/platform/linux/CCApplication.cpp rename to cocos/2d/platform/linux/CCApplication.cpp diff --git a/cocos2dx/platform/linux/CCApplication.h b/cocos/2d/platform/linux/CCApplication.h similarity index 100% rename from cocos2dx/platform/linux/CCApplication.h rename to cocos/2d/platform/linux/CCApplication.h diff --git a/cocos2dx/platform/linux/CCCommon.cpp b/cocos/2d/platform/linux/CCCommon.cpp similarity index 100% rename from cocos2dx/platform/linux/CCCommon.cpp rename to cocos/2d/platform/linux/CCCommon.cpp diff --git a/cocos2dx/platform/linux/CCDevice.cpp b/cocos/2d/platform/linux/CCDevice.cpp similarity index 100% rename from cocos2dx/platform/linux/CCDevice.cpp rename to cocos/2d/platform/linux/CCDevice.cpp diff --git a/cocos2dx/platform/linux/CCEGLView.cpp b/cocos/2d/platform/linux/CCEGLView.cpp similarity index 100% rename from cocos2dx/platform/linux/CCEGLView.cpp rename to cocos/2d/platform/linux/CCEGLView.cpp diff --git a/cocos2dx/platform/linux/CCEGLView.h b/cocos/2d/platform/linux/CCEGLView.h similarity index 100% rename from cocos2dx/platform/linux/CCEGLView.h rename to cocos/2d/platform/linux/CCEGLView.h diff --git a/cocos2dx/platform/linux/CCFileUtilsLinux.cpp b/cocos/2d/platform/linux/CCFileUtilsLinux.cpp similarity index 100% rename from cocos2dx/platform/linux/CCFileUtilsLinux.cpp rename to cocos/2d/platform/linux/CCFileUtilsLinux.cpp diff --git a/cocos2dx/platform/linux/CCFileUtilsLinux.h b/cocos/2d/platform/linux/CCFileUtilsLinux.h similarity index 100% rename from cocos2dx/platform/linux/CCFileUtilsLinux.h rename to cocos/2d/platform/linux/CCFileUtilsLinux.h diff --git a/cocos2dx/platform/linux/CCGL.h b/cocos/2d/platform/linux/CCGL.h similarity index 100% rename from cocos2dx/platform/linux/CCGL.h rename to cocos/2d/platform/linux/CCGL.h diff --git a/cocos2dx/platform/linux/CCImage.cpp b/cocos/2d/platform/linux/CCImage.cpp similarity index 100% rename from cocos2dx/platform/linux/CCImage.cpp rename to cocos/2d/platform/linux/CCImage.cpp diff --git a/cocos2dx/platform/linux/CCPlatformDefine.h b/cocos/2d/platform/linux/CCPlatformDefine.h similarity index 100% rename from cocos2dx/platform/linux/CCPlatformDefine.h rename to cocos/2d/platform/linux/CCPlatformDefine.h diff --git a/cocos2dx/platform/linux/CCStdC.cpp b/cocos/2d/platform/linux/CCStdC.cpp similarity index 100% rename from cocos2dx/platform/linux/CCStdC.cpp rename to cocos/2d/platform/linux/CCStdC.cpp diff --git a/cocos2dx/platform/linux/CCStdC.h b/cocos/2d/platform/linux/CCStdC.h similarity index 100% rename from cocos2dx/platform/linux/CCStdC.h rename to cocos/2d/platform/linux/CCStdC.h diff --git a/cocos2dx/platform/mac/CCApplication.h b/cocos/2d/platform/mac/CCApplication.h similarity index 100% rename from cocos2dx/platform/mac/CCApplication.h rename to cocos/2d/platform/mac/CCApplication.h diff --git a/cocos2dx/platform/mac/CCApplication.mm b/cocos/2d/platform/mac/CCApplication.mm similarity index 100% rename from cocos2dx/platform/mac/CCApplication.mm rename to cocos/2d/platform/mac/CCApplication.mm diff --git a/cocos2dx/platform/mac/CCCommon.mm b/cocos/2d/platform/mac/CCCommon.mm similarity index 100% rename from cocos2dx/platform/mac/CCCommon.mm rename to cocos/2d/platform/mac/CCCommon.mm diff --git a/cocos2dx/platform/mac/CCDevice.mm b/cocos/2d/platform/mac/CCDevice.mm similarity index 100% rename from cocos2dx/platform/mac/CCDevice.mm rename to cocos/2d/platform/mac/CCDevice.mm diff --git a/cocos2dx/platform/mac/CCDirectorCaller.h b/cocos/2d/platform/mac/CCDirectorCaller.h similarity index 100% rename from cocos2dx/platform/mac/CCDirectorCaller.h rename to cocos/2d/platform/mac/CCDirectorCaller.h diff --git a/cocos2dx/platform/mac/CCDirectorCaller.mm b/cocos/2d/platform/mac/CCDirectorCaller.mm similarity index 100% rename from cocos2dx/platform/mac/CCDirectorCaller.mm rename to cocos/2d/platform/mac/CCDirectorCaller.mm diff --git a/cocos2dx/platform/mac/CCEGLView.h b/cocos/2d/platform/mac/CCEGLView.h similarity index 100% rename from cocos2dx/platform/mac/CCEGLView.h rename to cocos/2d/platform/mac/CCEGLView.h diff --git a/cocos2dx/platform/mac/CCEGLView.mm b/cocos/2d/platform/mac/CCEGLView.mm similarity index 100% rename from cocos2dx/platform/mac/CCEGLView.mm rename to cocos/2d/platform/mac/CCEGLView.mm diff --git a/cocos2dx/platform/mac/CCEventDispatcher.h b/cocos/2d/platform/mac/CCEventDispatcher.h similarity index 100% rename from cocos2dx/platform/mac/CCEventDispatcher.h rename to cocos/2d/platform/mac/CCEventDispatcher.h diff --git a/cocos2dx/platform/mac/CCEventDispatcher.mm b/cocos/2d/platform/mac/CCEventDispatcher.mm similarity index 100% rename from cocos2dx/platform/mac/CCEventDispatcher.mm rename to cocos/2d/platform/mac/CCEventDispatcher.mm diff --git a/cocos2dx/platform/mac/CCGL.h b/cocos/2d/platform/mac/CCGL.h similarity index 100% rename from cocos2dx/platform/mac/CCGL.h rename to cocos/2d/platform/mac/CCGL.h diff --git a/cocos2dx/platform/mac/CCImage.mm b/cocos/2d/platform/mac/CCImage.mm similarity index 100% rename from cocos2dx/platform/mac/CCImage.mm rename to cocos/2d/platform/mac/CCImage.mm diff --git a/cocos2dx/platform/mac/CCPlatformDefine.h b/cocos/2d/platform/mac/CCPlatformDefine.h similarity index 100% rename from cocos2dx/platform/mac/CCPlatformDefine.h rename to cocos/2d/platform/mac/CCPlatformDefine.h diff --git a/cocos2dx/platform/mac/CCStdC.h b/cocos/2d/platform/mac/CCStdC.h similarity index 100% rename from cocos2dx/platform/mac/CCStdC.h rename to cocos/2d/platform/mac/CCStdC.h diff --git a/cocos2dx/platform/mac/CCWindow.h b/cocos/2d/platform/mac/CCWindow.h similarity index 100% rename from cocos2dx/platform/mac/CCWindow.h rename to cocos/2d/platform/mac/CCWindow.h diff --git a/cocos2dx/platform/mac/CCWindow.m b/cocos/2d/platform/mac/CCWindow.m similarity index 100% rename from cocos2dx/platform/mac/CCWindow.m rename to cocos/2d/platform/mac/CCWindow.m diff --git a/cocos2dx/platform/mac/EAGLView.h b/cocos/2d/platform/mac/EAGLView.h similarity index 100% rename from cocos2dx/platform/mac/EAGLView.h rename to cocos/2d/platform/mac/EAGLView.h diff --git a/cocos2dx/platform/mac/EAGLView.mm b/cocos/2d/platform/mac/EAGLView.mm similarity index 100% rename from cocos2dx/platform/mac/EAGLView.mm rename to cocos/2d/platform/mac/EAGLView.mm diff --git a/cocos2dx/platform/win32/CCApplication.cpp b/cocos/2d/platform/win32/CCApplication.cpp similarity index 100% rename from cocos2dx/platform/win32/CCApplication.cpp rename to cocos/2d/platform/win32/CCApplication.cpp diff --git a/cocos2dx/platform/win32/CCApplication.h b/cocos/2d/platform/win32/CCApplication.h similarity index 100% rename from cocos2dx/platform/win32/CCApplication.h rename to cocos/2d/platform/win32/CCApplication.h diff --git a/cocos2dx/platform/win32/CCCommon.cpp b/cocos/2d/platform/win32/CCCommon.cpp similarity index 100% rename from cocos2dx/platform/win32/CCCommon.cpp rename to cocos/2d/platform/win32/CCCommon.cpp diff --git a/cocos2dx/platform/win32/CCDevice.cpp b/cocos/2d/platform/win32/CCDevice.cpp similarity index 100% rename from cocos2dx/platform/win32/CCDevice.cpp rename to cocos/2d/platform/win32/CCDevice.cpp diff --git a/cocos2dx/platform/win32/CCEGLView.cpp b/cocos/2d/platform/win32/CCEGLView.cpp similarity index 100% rename from cocos2dx/platform/win32/CCEGLView.cpp rename to cocos/2d/platform/win32/CCEGLView.cpp diff --git a/cocos2dx/platform/win32/CCEGLView.h b/cocos/2d/platform/win32/CCEGLView.h similarity index 100% rename from cocos2dx/platform/win32/CCEGLView.h rename to cocos/2d/platform/win32/CCEGLView.h diff --git a/cocos2dx/platform/win32/CCFileUtilsWin32.cpp b/cocos/2d/platform/win32/CCFileUtilsWin32.cpp similarity index 100% rename from cocos2dx/platform/win32/CCFileUtilsWin32.cpp rename to cocos/2d/platform/win32/CCFileUtilsWin32.cpp diff --git a/cocos2dx/platform/win32/CCFileUtilsWin32.h b/cocos/2d/platform/win32/CCFileUtilsWin32.h similarity index 100% rename from cocos2dx/platform/win32/CCFileUtilsWin32.h rename to cocos/2d/platform/win32/CCFileUtilsWin32.h diff --git a/cocos2dx/platform/win32/CCGL.h b/cocos/2d/platform/win32/CCGL.h similarity index 100% rename from cocos2dx/platform/win32/CCGL.h rename to cocos/2d/platform/win32/CCGL.h diff --git a/cocos2dx/platform/win32/CCImage.cpp b/cocos/2d/platform/win32/CCImage.cpp similarity index 100% rename from cocos2dx/platform/win32/CCImage.cpp rename to cocos/2d/platform/win32/CCImage.cpp diff --git a/cocos2dx/platform/win32/CCPlatformDefine.h b/cocos/2d/platform/win32/CCPlatformDefine.h similarity index 100% rename from cocos2dx/platform/win32/CCPlatformDefine.h rename to cocos/2d/platform/win32/CCPlatformDefine.h diff --git a/cocos2dx/platform/win32/CCStdC.cpp b/cocos/2d/platform/win32/CCStdC.cpp similarity index 100% rename from cocos2dx/platform/win32/CCStdC.cpp rename to cocos/2d/platform/win32/CCStdC.cpp diff --git a/cocos2dx/platform/win32/CCStdC.h b/cocos/2d/platform/win32/CCStdC.h similarity index 100% rename from cocos2dx/platform/win32/CCStdC.h rename to cocos/2d/platform/win32/CCStdC.h diff --git a/cocos2dx/platform/win32/compat/stdint.h b/cocos/2d/platform/win32/compat/stdint.h similarity index 100% rename from cocos2dx/platform/win32/compat/stdint.h rename to cocos/2d/platform/win32/compat/stdint.h diff --git a/cocos2dx/proj.linux/.cproject b/cocos/2d/proj.linux/.cproject similarity index 100% rename from cocos2dx/proj.linux/.cproject rename to cocos/2d/proj.linux/.cproject diff --git a/cocos2dx/proj.linux/.project b/cocos/2d/proj.linux/.project similarity index 100% rename from cocos2dx/proj.linux/.project rename to cocos/2d/proj.linux/.project diff --git a/cocos2dx/proj.linux/Makefile b/cocos/2d/proj.linux/Makefile similarity index 100% rename from cocos2dx/proj.linux/Makefile rename to cocos/2d/proj.linux/Makefile diff --git a/cocos2dx/proj.linux/cocos2dx.mk b/cocos/2d/proj.linux/cocos2dx.mk similarity index 100% rename from cocos2dx/proj.linux/cocos2dx.mk rename to cocos/2d/proj.linux/cocos2dx.mk diff --git a/cocos2dx/proj.linux/cocos2dx.prf b/cocos/2d/proj.linux/cocos2dx.prf similarity index 100% rename from cocos2dx/proj.linux/cocos2dx.prf rename to cocos/2d/proj.linux/cocos2dx.prf diff --git a/cocos2dx/proj.linux/cocos2dx.pri b/cocos/2d/proj.linux/cocos2dx.pri similarity index 100% rename from cocos2dx/proj.linux/cocos2dx.pri rename to cocos/2d/proj.linux/cocos2dx.pri diff --git a/cocos2dx/proj.win32/cocos2d.vcxproj b/cocos/2d/proj.win32/cocos2d.vcxproj similarity index 100% rename from cocos2dx/proj.win32/cocos2d.vcxproj rename to cocos/2d/proj.win32/cocos2d.vcxproj diff --git a/cocos2dx/proj.win32/cocos2d.vcxproj.filters b/cocos/2d/proj.win32/cocos2d.vcxproj.filters similarity index 100% rename from cocos2dx/proj.win32/cocos2d.vcxproj.filters rename to cocos/2d/proj.win32/cocos2d.vcxproj.filters diff --git a/cocos2dx/proj.win32/cocos2d.vcxproj.user b/cocos/2d/proj.win32/cocos2d.vcxproj.user similarity index 100% rename from cocos2dx/proj.win32/cocos2d.vcxproj.user rename to cocos/2d/proj.win32/cocos2d.vcxproj.user diff --git a/cocos2dx/proj.win32/cocos2dx.props b/cocos/2d/proj.win32/cocos2dx.props similarity index 100% rename from cocos2dx/proj.win32/cocos2dx.props rename to cocos/2d/proj.win32/cocos2dx.props diff --git a/cocos2dx/script_support/CCScriptSupport.cpp b/cocos/2d/script-support/CCScriptSupport.cpp similarity index 100% rename from cocos2dx/script_support/CCScriptSupport.cpp rename to cocos/2d/script-support/CCScriptSupport.cpp diff --git a/cocos2dx/script_support/CCScriptSupport.h b/cocos/2d/script-support/CCScriptSupport.h similarity index 100% rename from cocos2dx/script_support/CCScriptSupport.h rename to cocos/2d/script-support/CCScriptSupport.h diff --git a/cocos2dx/shaders/CCGLProgram.cpp b/cocos/2d/shaders/CCGLProgram.cpp similarity index 100% rename from cocos2dx/shaders/CCGLProgram.cpp rename to cocos/2d/shaders/CCGLProgram.cpp diff --git a/cocos2dx/shaders/CCGLProgram.h b/cocos/2d/shaders/CCGLProgram.h similarity index 100% rename from cocos2dx/shaders/CCGLProgram.h rename to cocos/2d/shaders/CCGLProgram.h diff --git a/cocos2dx/shaders/CCShaderCache.cpp b/cocos/2d/shaders/CCShaderCache.cpp similarity index 100% rename from cocos2dx/shaders/CCShaderCache.cpp rename to cocos/2d/shaders/CCShaderCache.cpp diff --git a/cocos2dx/shaders/CCShaderCache.h b/cocos/2d/shaders/CCShaderCache.h similarity index 100% rename from cocos2dx/shaders/CCShaderCache.h rename to cocos/2d/shaders/CCShaderCache.h diff --git a/cocos2dx/shaders/ccGLStateCache.cpp b/cocos/2d/shaders/ccGLStateCache.cpp similarity index 100% rename from cocos2dx/shaders/ccGLStateCache.cpp rename to cocos/2d/shaders/ccGLStateCache.cpp diff --git a/cocos2dx/shaders/ccGLStateCache.h b/cocos/2d/shaders/ccGLStateCache.h similarity index 100% rename from cocos2dx/shaders/ccGLStateCache.h rename to cocos/2d/shaders/ccGLStateCache.h diff --git a/cocos2dx/shaders/ccShaderEx_SwitchMask_frag.h b/cocos/2d/shaders/ccShaderEx_SwitchMask_frag.h similarity index 100% rename from cocos2dx/shaders/ccShaderEx_SwitchMask_frag.h rename to cocos/2d/shaders/ccShaderEx_SwitchMask_frag.h diff --git a/cocos2dx/shaders/ccShader_PositionColorLengthTexture_frag.h b/cocos/2d/shaders/ccShader_PositionColorLengthTexture_frag.h similarity index 100% rename from cocos2dx/shaders/ccShader_PositionColorLengthTexture_frag.h rename to cocos/2d/shaders/ccShader_PositionColorLengthTexture_frag.h diff --git a/cocos2dx/shaders/ccShader_PositionColorLengthTexture_vert.h b/cocos/2d/shaders/ccShader_PositionColorLengthTexture_vert.h similarity index 100% rename from cocos2dx/shaders/ccShader_PositionColorLengthTexture_vert.h rename to cocos/2d/shaders/ccShader_PositionColorLengthTexture_vert.h diff --git a/cocos2dx/shaders/ccShader_PositionColor_frag.h b/cocos/2d/shaders/ccShader_PositionColor_frag.h similarity index 100% rename from cocos2dx/shaders/ccShader_PositionColor_frag.h rename to cocos/2d/shaders/ccShader_PositionColor_frag.h diff --git a/cocos2dx/shaders/ccShader_PositionColor_vert.h b/cocos/2d/shaders/ccShader_PositionColor_vert.h similarity index 100% rename from cocos2dx/shaders/ccShader_PositionColor_vert.h rename to cocos/2d/shaders/ccShader_PositionColor_vert.h diff --git a/cocos2dx/shaders/ccShader_PositionTextureA8Color_frag.h b/cocos/2d/shaders/ccShader_PositionTextureA8Color_frag.h similarity index 100% rename from cocos2dx/shaders/ccShader_PositionTextureA8Color_frag.h rename to cocos/2d/shaders/ccShader_PositionTextureA8Color_frag.h diff --git a/cocos2dx/shaders/ccShader_PositionTextureA8Color_vert.h b/cocos/2d/shaders/ccShader_PositionTextureA8Color_vert.h similarity index 100% rename from cocos2dx/shaders/ccShader_PositionTextureA8Color_vert.h rename to cocos/2d/shaders/ccShader_PositionTextureA8Color_vert.h diff --git a/cocos2dx/shaders/ccShader_PositionTextureColorAlphaTest_frag.h b/cocos/2d/shaders/ccShader_PositionTextureColorAlphaTest_frag.h similarity index 100% rename from cocos2dx/shaders/ccShader_PositionTextureColorAlphaTest_frag.h rename to cocos/2d/shaders/ccShader_PositionTextureColorAlphaTest_frag.h diff --git a/cocos2dx/shaders/ccShader_PositionTextureColor_frag.h b/cocos/2d/shaders/ccShader_PositionTextureColor_frag.h similarity index 100% rename from cocos2dx/shaders/ccShader_PositionTextureColor_frag.h rename to cocos/2d/shaders/ccShader_PositionTextureColor_frag.h diff --git a/cocos2dx/shaders/ccShader_PositionTextureColor_vert.h b/cocos/2d/shaders/ccShader_PositionTextureColor_vert.h similarity index 100% rename from cocos2dx/shaders/ccShader_PositionTextureColor_vert.h rename to cocos/2d/shaders/ccShader_PositionTextureColor_vert.h diff --git a/cocos2dx/shaders/ccShader_PositionTexture_frag.h b/cocos/2d/shaders/ccShader_PositionTexture_frag.h similarity index 100% rename from cocos2dx/shaders/ccShader_PositionTexture_frag.h rename to cocos/2d/shaders/ccShader_PositionTexture_frag.h diff --git a/cocos2dx/shaders/ccShader_PositionTexture_uColor_frag.h b/cocos/2d/shaders/ccShader_PositionTexture_uColor_frag.h similarity index 100% rename from cocos2dx/shaders/ccShader_PositionTexture_uColor_frag.h rename to cocos/2d/shaders/ccShader_PositionTexture_uColor_frag.h diff --git a/cocos2dx/shaders/ccShader_PositionTexture_uColor_vert.h b/cocos/2d/shaders/ccShader_PositionTexture_uColor_vert.h similarity index 100% rename from cocos2dx/shaders/ccShader_PositionTexture_uColor_vert.h rename to cocos/2d/shaders/ccShader_PositionTexture_uColor_vert.h diff --git a/cocos2dx/shaders/ccShader_PositionTexture_vert.h b/cocos/2d/shaders/ccShader_PositionTexture_vert.h similarity index 100% rename from cocos2dx/shaders/ccShader_PositionTexture_vert.h rename to cocos/2d/shaders/ccShader_PositionTexture_vert.h diff --git a/cocos2dx/shaders/ccShader_Position_uColor_frag.h b/cocos/2d/shaders/ccShader_Position_uColor_frag.h similarity index 100% rename from cocos2dx/shaders/ccShader_Position_uColor_frag.h rename to cocos/2d/shaders/ccShader_Position_uColor_frag.h diff --git a/cocos2dx/shaders/ccShader_Position_uColor_vert.h b/cocos/2d/shaders/ccShader_Position_uColor_vert.h similarity index 100% rename from cocos2dx/shaders/ccShader_Position_uColor_vert.h rename to cocos/2d/shaders/ccShader_Position_uColor_vert.h diff --git a/cocos2dx/shaders/ccShaders.cpp b/cocos/2d/shaders/ccShaders.cpp similarity index 100% rename from cocos2dx/shaders/ccShaders.cpp rename to cocos/2d/shaders/ccShaders.cpp diff --git a/cocos2dx/shaders/ccShaders.h b/cocos/2d/shaders/ccShaders.h similarity index 100% rename from cocos2dx/shaders/ccShaders.h rename to cocos/2d/shaders/ccShaders.h diff --git a/cocos2dx/sprite_nodes/CCAnimation.cpp b/cocos/2d/sprite-nodes/CCAnimation.cpp similarity index 100% rename from cocos2dx/sprite_nodes/CCAnimation.cpp rename to cocos/2d/sprite-nodes/CCAnimation.cpp diff --git a/cocos2dx/sprite_nodes/CCAnimation.h b/cocos/2d/sprite-nodes/CCAnimation.h similarity index 100% rename from cocos2dx/sprite_nodes/CCAnimation.h rename to cocos/2d/sprite-nodes/CCAnimation.h diff --git a/cocos2dx/sprite_nodes/CCAnimationCache.cpp b/cocos/2d/sprite-nodes/CCAnimationCache.cpp similarity index 100% rename from cocos2dx/sprite_nodes/CCAnimationCache.cpp rename to cocos/2d/sprite-nodes/CCAnimationCache.cpp diff --git a/cocos2dx/sprite_nodes/CCAnimationCache.h b/cocos/2d/sprite-nodes/CCAnimationCache.h similarity index 100% rename from cocos2dx/sprite_nodes/CCAnimationCache.h rename to cocos/2d/sprite-nodes/CCAnimationCache.h diff --git a/cocos2dx/sprite_nodes/CCSprite.cpp b/cocos/2d/sprite-nodes/CCSprite.cpp similarity index 100% rename from cocos2dx/sprite_nodes/CCSprite.cpp rename to cocos/2d/sprite-nodes/CCSprite.cpp diff --git a/cocos2dx/sprite_nodes/CCSprite.h b/cocos/2d/sprite-nodes/CCSprite.h similarity index 100% rename from cocos2dx/sprite_nodes/CCSprite.h rename to cocos/2d/sprite-nodes/CCSprite.h diff --git a/cocos2dx/sprite_nodes/CCSpriteBatchNode.cpp b/cocos/2d/sprite-nodes/CCSpriteBatchNode.cpp similarity index 100% rename from cocos2dx/sprite_nodes/CCSpriteBatchNode.cpp rename to cocos/2d/sprite-nodes/CCSpriteBatchNode.cpp diff --git a/cocos2dx/sprite_nodes/CCSpriteBatchNode.h b/cocos/2d/sprite-nodes/CCSpriteBatchNode.h similarity index 100% rename from cocos2dx/sprite_nodes/CCSpriteBatchNode.h rename to cocos/2d/sprite-nodes/CCSpriteBatchNode.h diff --git a/cocos2dx/sprite_nodes/CCSpriteFrame.cpp b/cocos/2d/sprite-nodes/CCSpriteFrame.cpp similarity index 100% rename from cocos2dx/sprite_nodes/CCSpriteFrame.cpp rename to cocos/2d/sprite-nodes/CCSpriteFrame.cpp diff --git a/cocos2dx/sprite_nodes/CCSpriteFrame.h b/cocos/2d/sprite-nodes/CCSpriteFrame.h similarity index 100% rename from cocos2dx/sprite_nodes/CCSpriteFrame.h rename to cocos/2d/sprite-nodes/CCSpriteFrame.h diff --git a/cocos2dx/sprite_nodes/CCSpriteFrameCache.cpp b/cocos/2d/sprite-nodes/CCSpriteFrameCache.cpp similarity index 100% rename from cocos2dx/sprite_nodes/CCSpriteFrameCache.cpp rename to cocos/2d/sprite-nodes/CCSpriteFrameCache.cpp diff --git a/cocos2dx/sprite_nodes/CCSpriteFrameCache.h b/cocos/2d/sprite-nodes/CCSpriteFrameCache.h similarity index 100% rename from cocos2dx/sprite_nodes/CCSpriteFrameCache.h rename to cocos/2d/sprite-nodes/CCSpriteFrameCache.h diff --git a/cocos2dx/support/CCNotificationCenter.cpp b/cocos/2d/support/CCNotificationCenter.cpp similarity index 100% rename from cocos2dx/support/CCNotificationCenter.cpp rename to cocos/2d/support/CCNotificationCenter.cpp diff --git a/cocos2dx/support/CCNotificationCenter.h b/cocos/2d/support/CCNotificationCenter.h similarity index 100% rename from cocos2dx/support/CCNotificationCenter.h rename to cocos/2d/support/CCNotificationCenter.h diff --git a/cocos2dx/support/CCProfiling.cpp b/cocos/2d/support/CCProfiling.cpp similarity index 100% rename from cocos2dx/support/CCProfiling.cpp rename to cocos/2d/support/CCProfiling.cpp diff --git a/cocos2dx/support/CCProfiling.h b/cocos/2d/support/CCProfiling.h similarity index 100% rename from cocos2dx/support/CCProfiling.h rename to cocos/2d/support/CCProfiling.h diff --git a/cocos2dx/support/CCVertex.cpp b/cocos/2d/support/CCVertex.cpp similarity index 100% rename from cocos2dx/support/CCVertex.cpp rename to cocos/2d/support/CCVertex.cpp diff --git a/cocos2dx/support/CCVertex.h b/cocos/2d/support/CCVertex.h similarity index 100% rename from cocos2dx/support/CCVertex.h rename to cocos/2d/support/CCVertex.h diff --git a/cocos2dx/support/TransformUtils.cpp b/cocos/2d/support/TransformUtils.cpp similarity index 100% rename from cocos2dx/support/TransformUtils.cpp rename to cocos/2d/support/TransformUtils.cpp diff --git a/cocos2dx/support/TransformUtils.h b/cocos/2d/support/TransformUtils.h similarity index 100% rename from cocos2dx/support/TransformUtils.h rename to cocos/2d/support/TransformUtils.h diff --git a/cocos2dx/support/base64.cpp b/cocos/2d/support/base64.cpp similarity index 100% rename from cocos2dx/support/base64.cpp rename to cocos/2d/support/base64.cpp diff --git a/cocos2dx/support/base64.h b/cocos/2d/support/base64.h similarity index 100% rename from cocos2dx/support/base64.h rename to cocos/2d/support/base64.h diff --git a/cocos2dx/support/ccUTF8.cpp b/cocos/2d/support/ccUTF8.cpp similarity index 100% rename from cocos2dx/support/ccUTF8.cpp rename to cocos/2d/support/ccUTF8.cpp diff --git a/cocos2dx/support/ccUTF8.h b/cocos/2d/support/ccUTF8.h similarity index 100% rename from cocos2dx/support/ccUTF8.h rename to cocos/2d/support/ccUTF8.h diff --git a/cocos2dx/support/ccUtils.cpp b/cocos/2d/support/ccUtils.cpp similarity index 100% rename from cocos2dx/support/ccUtils.cpp rename to cocos/2d/support/ccUtils.cpp diff --git a/cocos2dx/support/ccUtils.h b/cocos/2d/support/ccUtils.h similarity index 100% rename from cocos2dx/support/ccUtils.h rename to cocos/2d/support/ccUtils.h diff --git a/cocos2dx/support/component/CCComponent.cpp b/cocos/2d/support/component/CCComponent.cpp similarity index 100% rename from cocos2dx/support/component/CCComponent.cpp rename to cocos/2d/support/component/CCComponent.cpp diff --git a/cocos2dx/support/component/CCComponent.h b/cocos/2d/support/component/CCComponent.h similarity index 100% rename from cocos2dx/support/component/CCComponent.h rename to cocos/2d/support/component/CCComponent.h diff --git a/cocos2dx/support/component/CCComponentContainer.cpp b/cocos/2d/support/component/CCComponentContainer.cpp similarity index 100% rename from cocos2dx/support/component/CCComponentContainer.cpp rename to cocos/2d/support/component/CCComponentContainer.cpp diff --git a/cocos2dx/support/component/CCComponentContainer.h b/cocos/2d/support/component/CCComponentContainer.h similarity index 100% rename from cocos2dx/support/component/CCComponentContainer.h rename to cocos/2d/support/component/CCComponentContainer.h diff --git a/cocos2dx/support/data_support/ccCArray.cpp b/cocos/2d/support/data_support/ccCArray.cpp similarity index 100% rename from cocos2dx/support/data_support/ccCArray.cpp rename to cocos/2d/support/data_support/ccCArray.cpp diff --git a/cocos2dx/support/data_support/ccCArray.h b/cocos/2d/support/data_support/ccCArray.h similarity index 100% rename from cocos2dx/support/data_support/ccCArray.h rename to cocos/2d/support/data_support/ccCArray.h diff --git a/cocos2dx/support/data_support/uthash.h b/cocos/2d/support/data_support/uthash.h similarity index 100% rename from cocos2dx/support/data_support/uthash.h rename to cocos/2d/support/data_support/uthash.h diff --git a/cocos2dx/support/data_support/utlist.h b/cocos/2d/support/data_support/utlist.h similarity index 100% rename from cocos2dx/support/data_support/utlist.h rename to cocos/2d/support/data_support/utlist.h diff --git a/cocos2dx/support/image_support/TGAlib.cpp b/cocos/2d/support/image_support/TGAlib.cpp similarity index 100% rename from cocos2dx/support/image_support/TGAlib.cpp rename to cocos/2d/support/image_support/TGAlib.cpp diff --git a/cocos2dx/support/image_support/TGAlib.h b/cocos/2d/support/image_support/TGAlib.h similarity index 100% rename from cocos2dx/support/image_support/TGAlib.h rename to cocos/2d/support/image_support/TGAlib.h diff --git a/cocos2dx/support/tinyxml2/tinyxml2.cpp b/cocos/2d/support/tinyxml2/tinyxml2.cpp similarity index 100% rename from cocos2dx/support/tinyxml2/tinyxml2.cpp rename to cocos/2d/support/tinyxml2/tinyxml2.cpp diff --git a/cocos2dx/support/tinyxml2/tinyxml2.h b/cocos/2d/support/tinyxml2/tinyxml2.h similarity index 100% rename from cocos2dx/support/tinyxml2/tinyxml2.h rename to cocos/2d/support/tinyxml2/tinyxml2.h diff --git a/cocos2dx/support/user_default/CCUserDefault.cpp b/cocos/2d/support/user_default/CCUserDefault.cpp similarity index 100% rename from cocos2dx/support/user_default/CCUserDefault.cpp rename to cocos/2d/support/user_default/CCUserDefault.cpp diff --git a/cocos2dx/support/user_default/CCUserDefault.h b/cocos/2d/support/user_default/CCUserDefault.h similarity index 100% rename from cocos2dx/support/user_default/CCUserDefault.h rename to cocos/2d/support/user_default/CCUserDefault.h diff --git a/cocos2dx/support/user_default/CCUserDefault.mm b/cocos/2d/support/user_default/CCUserDefault.mm similarity index 100% rename from cocos2dx/support/user_default/CCUserDefault.mm rename to cocos/2d/support/user_default/CCUserDefault.mm diff --git a/cocos2dx/support/user_default/CCUserDefaultAndroid.cpp b/cocos/2d/support/user_default/CCUserDefaultAndroid.cpp similarity index 100% rename from cocos2dx/support/user_default/CCUserDefaultAndroid.cpp rename to cocos/2d/support/user_default/CCUserDefaultAndroid.cpp diff --git a/cocos2dx/support/zip_support/ZipUtils.cpp b/cocos/2d/support/zip_support/ZipUtils.cpp similarity index 100% rename from cocos2dx/support/zip_support/ZipUtils.cpp rename to cocos/2d/support/zip_support/ZipUtils.cpp diff --git a/cocos2dx/support/zip_support/ZipUtils.h b/cocos/2d/support/zip_support/ZipUtils.h similarity index 100% rename from cocos2dx/support/zip_support/ZipUtils.h rename to cocos/2d/support/zip_support/ZipUtils.h diff --git a/cocos2dx/support/zip_support/ioapi.cpp b/cocos/2d/support/zip_support/ioapi.cpp similarity index 100% rename from cocos2dx/support/zip_support/ioapi.cpp rename to cocos/2d/support/zip_support/ioapi.cpp diff --git a/cocos2dx/support/zip_support/ioapi.h b/cocos/2d/support/zip_support/ioapi.h similarity index 100% rename from cocos2dx/support/zip_support/ioapi.h rename to cocos/2d/support/zip_support/ioapi.h diff --git a/cocos2dx/support/zip_support/unzip.cpp b/cocos/2d/support/zip_support/unzip.cpp similarity index 100% rename from cocos2dx/support/zip_support/unzip.cpp rename to cocos/2d/support/zip_support/unzip.cpp diff --git a/cocos2dx/support/zip_support/unzip.h b/cocos/2d/support/zip_support/unzip.h similarity index 100% rename from cocos2dx/support/zip_support/unzip.h rename to cocos/2d/support/zip_support/unzip.h diff --git a/cocos2dx/text_input_node/CCIMEDelegate.h b/cocos/2d/text-input-node/CCIMEDelegate.h similarity index 100% rename from cocos2dx/text_input_node/CCIMEDelegate.h rename to cocos/2d/text-input-node/CCIMEDelegate.h diff --git a/cocos2dx/text_input_node/CCIMEDispatcher.cpp b/cocos/2d/text-input-node/CCIMEDispatcher.cpp similarity index 100% rename from cocos2dx/text_input_node/CCIMEDispatcher.cpp rename to cocos/2d/text-input-node/CCIMEDispatcher.cpp diff --git a/cocos2dx/text_input_node/CCIMEDispatcher.h b/cocos/2d/text-input-node/CCIMEDispatcher.h similarity index 100% rename from cocos2dx/text_input_node/CCIMEDispatcher.h rename to cocos/2d/text-input-node/CCIMEDispatcher.h diff --git a/cocos2dx/text_input_node/CCTextFieldTTF.cpp b/cocos/2d/text-input-node/CCTextFieldTTF.cpp similarity index 100% rename from cocos2dx/text_input_node/CCTextFieldTTF.cpp rename to cocos/2d/text-input-node/CCTextFieldTTF.cpp diff --git a/cocos2dx/text_input_node/CCTextFieldTTF.h b/cocos/2d/text-input-node/CCTextFieldTTF.h similarity index 100% rename from cocos2dx/text_input_node/CCTextFieldTTF.h rename to cocos/2d/text-input-node/CCTextFieldTTF.h diff --git a/cocos2dx/textures/CCTexture2D.cpp b/cocos/2d/textures/CCTexture2D.cpp similarity index 100% rename from cocos2dx/textures/CCTexture2D.cpp rename to cocos/2d/textures/CCTexture2D.cpp diff --git a/cocos2dx/textures/CCTexture2D.h b/cocos/2d/textures/CCTexture2D.h similarity index 100% rename from cocos2dx/textures/CCTexture2D.h rename to cocos/2d/textures/CCTexture2D.h diff --git a/cocos2dx/textures/CCTextureAtlas.cpp b/cocos/2d/textures/CCTextureAtlas.cpp similarity index 100% rename from cocos2dx/textures/CCTextureAtlas.cpp rename to cocos/2d/textures/CCTextureAtlas.cpp diff --git a/cocos2dx/textures/CCTextureAtlas.h b/cocos/2d/textures/CCTextureAtlas.h similarity index 100% rename from cocos2dx/textures/CCTextureAtlas.h rename to cocos/2d/textures/CCTextureAtlas.h diff --git a/cocos2dx/textures/CCTextureCache.cpp b/cocos/2d/textures/CCTextureCache.cpp similarity index 100% rename from cocos2dx/textures/CCTextureCache.cpp rename to cocos/2d/textures/CCTextureCache.cpp diff --git a/cocos2dx/textures/CCTextureCache.h b/cocos/2d/textures/CCTextureCache.h similarity index 100% rename from cocos2dx/textures/CCTextureCache.h rename to cocos/2d/textures/CCTextureCache.h diff --git a/cocos2dx/tilemap_parallax_nodes/CCParallaxNode.cpp b/cocos/2d/tilemap-parallax-nodes/CCParallaxNode.cpp similarity index 100% rename from cocos2dx/tilemap_parallax_nodes/CCParallaxNode.cpp rename to cocos/2d/tilemap-parallax-nodes/CCParallaxNode.cpp diff --git a/cocos2dx/tilemap_parallax_nodes/CCParallaxNode.h b/cocos/2d/tilemap-parallax-nodes/CCParallaxNode.h similarity index 100% rename from cocos2dx/tilemap_parallax_nodes/CCParallaxNode.h rename to cocos/2d/tilemap-parallax-nodes/CCParallaxNode.h diff --git a/cocos2dx/tilemap_parallax_nodes/CCTMXLayer.cpp b/cocos/2d/tilemap-parallax-nodes/CCTMXLayer.cpp similarity index 100% rename from cocos2dx/tilemap_parallax_nodes/CCTMXLayer.cpp rename to cocos/2d/tilemap-parallax-nodes/CCTMXLayer.cpp diff --git a/cocos2dx/tilemap_parallax_nodes/CCTMXLayer.h b/cocos/2d/tilemap-parallax-nodes/CCTMXLayer.h similarity index 100% rename from cocos2dx/tilemap_parallax_nodes/CCTMXLayer.h rename to cocos/2d/tilemap-parallax-nodes/CCTMXLayer.h diff --git a/cocos2dx/tilemap_parallax_nodes/CCTMXObjectGroup.cpp b/cocos/2d/tilemap-parallax-nodes/CCTMXObjectGroup.cpp similarity index 100% rename from cocos2dx/tilemap_parallax_nodes/CCTMXObjectGroup.cpp rename to cocos/2d/tilemap-parallax-nodes/CCTMXObjectGroup.cpp diff --git a/cocos2dx/tilemap_parallax_nodes/CCTMXObjectGroup.h b/cocos/2d/tilemap-parallax-nodes/CCTMXObjectGroup.h similarity index 100% rename from cocos2dx/tilemap_parallax_nodes/CCTMXObjectGroup.h rename to cocos/2d/tilemap-parallax-nodes/CCTMXObjectGroup.h diff --git a/cocos2dx/tilemap_parallax_nodes/CCTMXTiledMap.cpp b/cocos/2d/tilemap-parallax-nodes/CCTMXTiledMap.cpp similarity index 100% rename from cocos2dx/tilemap_parallax_nodes/CCTMXTiledMap.cpp rename to cocos/2d/tilemap-parallax-nodes/CCTMXTiledMap.cpp diff --git a/cocos2dx/tilemap_parallax_nodes/CCTMXTiledMap.h b/cocos/2d/tilemap-parallax-nodes/CCTMXTiledMap.h similarity index 100% rename from cocos2dx/tilemap_parallax_nodes/CCTMXTiledMap.h rename to cocos/2d/tilemap-parallax-nodes/CCTMXTiledMap.h diff --git a/cocos2dx/tilemap_parallax_nodes/CCTMXXMLParser.cpp b/cocos/2d/tilemap-parallax-nodes/CCTMXXMLParser.cpp similarity index 100% rename from cocos2dx/tilemap_parallax_nodes/CCTMXXMLParser.cpp rename to cocos/2d/tilemap-parallax-nodes/CCTMXXMLParser.cpp diff --git a/cocos2dx/tilemap_parallax_nodes/CCTMXXMLParser.h b/cocos/2d/tilemap-parallax-nodes/CCTMXXMLParser.h similarity index 100% rename from cocos2dx/tilemap_parallax_nodes/CCTMXXMLParser.h rename to cocos/2d/tilemap-parallax-nodes/CCTMXXMLParser.h diff --git a/cocos2dx/tilemap_parallax_nodes/CCTileMapAtlas.cpp b/cocos/2d/tilemap-parallax-nodes/CCTileMapAtlas.cpp similarity index 100% rename from cocos2dx/tilemap_parallax_nodes/CCTileMapAtlas.cpp rename to cocos/2d/tilemap-parallax-nodes/CCTileMapAtlas.cpp diff --git a/cocos2dx/tilemap_parallax_nodes/CCTileMapAtlas.h b/cocos/2d/tilemap-parallax-nodes/CCTileMapAtlas.h similarity index 100% rename from cocos2dx/tilemap_parallax_nodes/CCTileMapAtlas.h rename to cocos/2d/tilemap-parallax-nodes/CCTileMapAtlas.h diff --git a/audio/android/Android.mk b/cocos/audio/android/Android.mk similarity index 100% rename from audio/android/Android.mk rename to cocos/audio/android/Android.mk diff --git a/audio/android/ccdandroidUtils.cpp b/cocos/audio/android/ccdandroidUtils.cpp similarity index 100% rename from audio/android/ccdandroidUtils.cpp rename to cocos/audio/android/ccdandroidUtils.cpp diff --git a/audio/android/ccdandroidUtils.h b/cocos/audio/android/ccdandroidUtils.h similarity index 100% rename from audio/android/ccdandroidUtils.h rename to cocos/audio/android/ccdandroidUtils.h diff --git a/audio/android/cddSimpleAudioEngine.cpp b/cocos/audio/android/cddSimpleAudioEngine.cpp similarity index 100% rename from audio/android/cddSimpleAudioEngine.cpp rename to cocos/audio/android/cddSimpleAudioEngine.cpp diff --git a/audio/android/jni/cddandroidAndroidJavaEngine.cpp b/cocos/audio/android/jni/cddandroidAndroidJavaEngine.cpp similarity index 100% rename from audio/android/jni/cddandroidAndroidJavaEngine.cpp rename to cocos/audio/android/jni/cddandroidAndroidJavaEngine.cpp diff --git a/audio/android/jni/cddandroidAndroidJavaEngine.h b/cocos/audio/android/jni/cddandroidAndroidJavaEngine.h similarity index 100% rename from audio/android/jni/cddandroidAndroidJavaEngine.h rename to cocos/audio/android/jni/cddandroidAndroidJavaEngine.h diff --git a/audio/android/opensl/OpenSLEngine.cpp b/cocos/audio/android/opensl/OpenSLEngine.cpp similarity index 100% rename from audio/android/opensl/OpenSLEngine.cpp rename to cocos/audio/android/opensl/OpenSLEngine.cpp diff --git a/audio/android/opensl/OpenSLEngine.h b/cocos/audio/android/opensl/OpenSLEngine.h similarity index 100% rename from audio/android/opensl/OpenSLEngine.h rename to cocos/audio/android/opensl/OpenSLEngine.h diff --git a/audio/android/opensl/SimpleAudioEngineOpenSL.cpp b/cocos/audio/android/opensl/SimpleAudioEngineOpenSL.cpp similarity index 100% rename from audio/android/opensl/SimpleAudioEngineOpenSL.cpp rename to cocos/audio/android/opensl/SimpleAudioEngineOpenSL.cpp diff --git a/audio/android/opensl/SimpleAudioEngineOpenSL.h b/cocos/audio/android/opensl/SimpleAudioEngineOpenSL.h similarity index 100% rename from audio/android/opensl/SimpleAudioEngineOpenSL.h rename to cocos/audio/android/opensl/SimpleAudioEngineOpenSL.h diff --git a/audio/android/opensl/cddandroidOpenSLEngine.cpp b/cocos/audio/android/opensl/cddandroidOpenSLEngine.cpp similarity index 100% rename from audio/android/opensl/cddandroidOpenSLEngine.cpp rename to cocos/audio/android/opensl/cddandroidOpenSLEngine.cpp diff --git a/audio/android/opensl/cddandroidOpenSLEngine.h b/cocos/audio/android/opensl/cddandroidOpenSLEngine.h similarity index 100% rename from audio/android/opensl/cddandroidOpenSLEngine.h rename to cocos/audio/android/opensl/cddandroidOpenSLEngine.h diff --git a/audio/include/Export.h b/cocos/audio/include/Export.h similarity index 100% rename from audio/include/Export.h rename to cocos/audio/include/Export.h diff --git a/audio/include/SimpleAudioEngine.h b/cocos/audio/include/SimpleAudioEngine.h similarity index 100% rename from audio/include/SimpleAudioEngine.h rename to cocos/audio/include/SimpleAudioEngine.h diff --git a/audio/ios/CDAudioManager.h b/cocos/audio/ios/CDAudioManager.h similarity index 100% rename from audio/ios/CDAudioManager.h rename to cocos/audio/ios/CDAudioManager.h diff --git a/audio/ios/CDAudioManager.m b/cocos/audio/ios/CDAudioManager.m similarity index 100% rename from audio/ios/CDAudioManager.m rename to cocos/audio/ios/CDAudioManager.m diff --git a/audio/ios/CDConfig.h b/cocos/audio/ios/CDConfig.h similarity index 100% rename from audio/ios/CDConfig.h rename to cocos/audio/ios/CDConfig.h diff --git a/audio/ios/CDOpenALSupport.h b/cocos/audio/ios/CDOpenALSupport.h similarity index 100% rename from audio/ios/CDOpenALSupport.h rename to cocos/audio/ios/CDOpenALSupport.h diff --git a/audio/ios/CDOpenALSupport.m b/cocos/audio/ios/CDOpenALSupport.m similarity index 100% rename from audio/ios/CDOpenALSupport.m rename to cocos/audio/ios/CDOpenALSupport.m diff --git a/audio/ios/CocosDenshion.h b/cocos/audio/ios/CocosDenshion.h similarity index 100% rename from audio/ios/CocosDenshion.h rename to cocos/audio/ios/CocosDenshion.h diff --git a/audio/ios/CocosDenshion.m b/cocos/audio/ios/CocosDenshion.m similarity index 100% rename from audio/ios/CocosDenshion.m rename to cocos/audio/ios/CocosDenshion.m diff --git a/audio/ios/SimpleAudioEngine.mm b/cocos/audio/ios/SimpleAudioEngine.mm similarity index 100% rename from audio/ios/SimpleAudioEngine.mm rename to cocos/audio/ios/SimpleAudioEngine.mm diff --git a/audio/ios/SimpleAudioEngine_objc.h b/cocos/audio/ios/SimpleAudioEngine_objc.h similarity index 100% rename from audio/ios/SimpleAudioEngine_objc.h rename to cocos/audio/ios/SimpleAudioEngine_objc.h diff --git a/audio/ios/SimpleAudioEngine_objc.m b/cocos/audio/ios/SimpleAudioEngine_objc.m similarity index 100% rename from audio/ios/SimpleAudioEngine_objc.m rename to cocos/audio/ios/SimpleAudioEngine_objc.m diff --git a/audio/linux/AudioPlayer.h b/cocos/audio/linux/AudioPlayer.h similarity index 100% rename from audio/linux/AudioPlayer.h rename to cocos/audio/linux/AudioPlayer.h diff --git a/audio/linux/FmodAudioPlayer.cpp b/cocos/audio/linux/FmodAudioPlayer.cpp similarity index 100% rename from audio/linux/FmodAudioPlayer.cpp rename to cocos/audio/linux/FmodAudioPlayer.cpp diff --git a/audio/linux/FmodAudioPlayer.h b/cocos/audio/linux/FmodAudioPlayer.h similarity index 100% rename from audio/linux/FmodAudioPlayer.h rename to cocos/audio/linux/FmodAudioPlayer.h diff --git a/audio/linux/SimpleAudioEngineFMOD.cpp b/cocos/audio/linux/SimpleAudioEngineFMOD.cpp similarity index 100% rename from audio/linux/SimpleAudioEngineFMOD.cpp rename to cocos/audio/linux/SimpleAudioEngineFMOD.cpp diff --git a/audio/mac/CDAudioManager.h b/cocos/audio/mac/CDAudioManager.h similarity index 100% rename from audio/mac/CDAudioManager.h rename to cocos/audio/mac/CDAudioManager.h diff --git a/audio/mac/CDAudioManager.m b/cocos/audio/mac/CDAudioManager.m similarity index 100% rename from audio/mac/CDAudioManager.m rename to cocos/audio/mac/CDAudioManager.m diff --git a/audio/mac/CDConfig.h b/cocos/audio/mac/CDConfig.h similarity index 100% rename from audio/mac/CDConfig.h rename to cocos/audio/mac/CDConfig.h diff --git a/audio/mac/CDOpenALSupport.h b/cocos/audio/mac/CDOpenALSupport.h similarity index 100% rename from audio/mac/CDOpenALSupport.h rename to cocos/audio/mac/CDOpenALSupport.h diff --git a/audio/mac/CDOpenALSupport.m b/cocos/audio/mac/CDOpenALSupport.m similarity index 100% rename from audio/mac/CDOpenALSupport.m rename to cocos/audio/mac/CDOpenALSupport.m diff --git a/audio/mac/CDXMacOSXSupport.h b/cocos/audio/mac/CDXMacOSXSupport.h similarity index 100% rename from audio/mac/CDXMacOSXSupport.h rename to cocos/audio/mac/CDXMacOSXSupport.h diff --git a/audio/mac/CDXMacOSXSupport.mm b/cocos/audio/mac/CDXMacOSXSupport.mm similarity index 100% rename from audio/mac/CDXMacOSXSupport.mm rename to cocos/audio/mac/CDXMacOSXSupport.mm diff --git a/audio/mac/CocosDenshion.h b/cocos/audio/mac/CocosDenshion.h similarity index 100% rename from audio/mac/CocosDenshion.h rename to cocos/audio/mac/CocosDenshion.h diff --git a/audio/mac/CocosDenshion.m b/cocos/audio/mac/CocosDenshion.m similarity index 100% rename from audio/mac/CocosDenshion.m rename to cocos/audio/mac/CocosDenshion.m diff --git a/audio/mac/SimpleAudioEngine.mm b/cocos/audio/mac/SimpleAudioEngine.mm similarity index 99% rename from audio/mac/SimpleAudioEngine.mm rename to cocos/audio/mac/SimpleAudioEngine.mm index 91da4b751f..097659eeba 100644 --- a/audio/mac/SimpleAudioEngine.mm +++ b/cocos/audio/mac/SimpleAudioEngine.mm @@ -24,8 +24,10 @@ THE SOFTWARE. #include "SimpleAudioEngine.h" #include "SimpleAudioEngine_objc.h" -#include "cocos2d.h" -USING_NS_CC; +#include + +#include "CCFileUtils.h" +using namespace cocos2d; static void static_end() { @@ -289,5 +291,4 @@ void SimpleAudioEngine::stopAllEffects() { static_stopAllEffects(); } - -} // endof namespace CocosDenshion { +} diff --git a/audio/mac/SimpleAudioEngine_objc.h b/cocos/audio/mac/SimpleAudioEngine_objc.h similarity index 100% rename from audio/mac/SimpleAudioEngine_objc.h rename to cocos/audio/mac/SimpleAudioEngine_objc.h diff --git a/audio/mac/SimpleAudioEngine_objc.m b/cocos/audio/mac/SimpleAudioEngine_objc.m similarity index 100% rename from audio/mac/SimpleAudioEngine_objc.m rename to cocos/audio/mac/SimpleAudioEngine_objc.m diff --git a/audio/openal/OpenALDecoder.cpp b/cocos/audio/openal/OpenALDecoder.cpp similarity index 100% rename from audio/openal/OpenALDecoder.cpp rename to cocos/audio/openal/OpenALDecoder.cpp diff --git a/audio/openal/OpenALDecoder.h b/cocos/audio/openal/OpenALDecoder.h similarity index 100% rename from audio/openal/OpenALDecoder.h rename to cocos/audio/openal/OpenALDecoder.h diff --git a/audio/openal/SimpleAudioEngineOpenAL.cpp b/cocos/audio/openal/SimpleAudioEngineOpenAL.cpp similarity index 100% rename from audio/openal/SimpleAudioEngineOpenAL.cpp rename to cocos/audio/openal/SimpleAudioEngineOpenAL.cpp diff --git a/audio/proj.linux/.cproject b/cocos/audio/proj.linux/.cproject similarity index 100% rename from audio/proj.linux/.cproject rename to cocos/audio/proj.linux/.cproject diff --git a/audio/proj.linux/.project b/cocos/audio/proj.linux/.project similarity index 100% rename from audio/proj.linux/.project rename to cocos/audio/proj.linux/.project diff --git a/audio/proj.linux/CocosDenshion.prf b/cocos/audio/proj.linux/CocosDenshion.prf similarity index 100% rename from audio/proj.linux/CocosDenshion.prf rename to cocos/audio/proj.linux/CocosDenshion.prf diff --git a/audio/proj.linux/Makefile b/cocos/audio/proj.linux/Makefile similarity index 100% rename from audio/proj.linux/Makefile rename to cocos/audio/proj.linux/Makefile diff --git a/audio/proj.win32/CocosDenshion.vcxproj b/cocos/audio/proj.win32/CocosDenshion.vcxproj similarity index 100% rename from audio/proj.win32/CocosDenshion.vcxproj rename to cocos/audio/proj.win32/CocosDenshion.vcxproj diff --git a/audio/proj.win32/CocosDenshion.vcxproj.filters b/cocos/audio/proj.win32/CocosDenshion.vcxproj.filters similarity index 100% rename from audio/proj.win32/CocosDenshion.vcxproj.filters rename to cocos/audio/proj.win32/CocosDenshion.vcxproj.filters diff --git a/audio/proj.win32/CocosDenshion.vcxproj.user b/cocos/audio/proj.win32/CocosDenshion.vcxproj.user similarity index 100% rename from audio/proj.win32/CocosDenshion.vcxproj.user rename to cocos/audio/proj.win32/CocosDenshion.vcxproj.user diff --git a/audio/third_party/fmod/Makefile b/cocos/audio/third-party/fmod/Makefile similarity index 100% rename from audio/third_party/fmod/Makefile rename to cocos/audio/third-party/fmod/Makefile diff --git a/audio/third_party/fmod/api/inc/fmod.h.REMOVED.git-id b/cocos/audio/third-party/fmod/api/inc/fmod.h.REMOVED.git-id similarity index 100% rename from audio/third_party/fmod/api/inc/fmod.h.REMOVED.git-id rename to cocos/audio/third-party/fmod/api/inc/fmod.h.REMOVED.git-id diff --git a/audio/third_party/fmod/api/inc/fmod.hpp b/cocos/audio/third-party/fmod/api/inc/fmod.hpp similarity index 100% rename from audio/third_party/fmod/api/inc/fmod.hpp rename to cocos/audio/third-party/fmod/api/inc/fmod.hpp diff --git a/audio/third_party/fmod/api/inc/fmod_codec.h b/cocos/audio/third-party/fmod/api/inc/fmod_codec.h similarity index 100% rename from audio/third_party/fmod/api/inc/fmod_codec.h rename to cocos/audio/third-party/fmod/api/inc/fmod_codec.h diff --git a/audio/third_party/fmod/api/inc/fmod_dsp.h b/cocos/audio/third-party/fmod/api/inc/fmod_dsp.h similarity index 100% rename from audio/third_party/fmod/api/inc/fmod_dsp.h rename to cocos/audio/third-party/fmod/api/inc/fmod_dsp.h diff --git a/audio/third_party/fmod/api/inc/fmod_errors.h b/cocos/audio/third-party/fmod/api/inc/fmod_errors.h similarity index 100% rename from audio/third_party/fmod/api/inc/fmod_errors.h rename to cocos/audio/third-party/fmod/api/inc/fmod_errors.h diff --git a/audio/third_party/fmod/api/inc/fmod_memoryinfo.h b/cocos/audio/third-party/fmod/api/inc/fmod_memoryinfo.h similarity index 100% rename from audio/third_party/fmod/api/inc/fmod_memoryinfo.h rename to cocos/audio/third-party/fmod/api/inc/fmod_memoryinfo.h diff --git a/audio/third_party/fmod/api/inc/fmod_output.h b/cocos/audio/third-party/fmod/api/inc/fmod_output.h similarity index 100% rename from audio/third_party/fmod/api/inc/fmod_output.h rename to cocos/audio/third-party/fmod/api/inc/fmod_output.h diff --git a/audio/third_party/fmod/api/inc/fmodlinux.h b/cocos/audio/third-party/fmod/api/inc/fmodlinux.h similarity index 100% rename from audio/third_party/fmod/api/inc/fmodlinux.h rename to cocos/audio/third-party/fmod/api/inc/fmodlinux.h diff --git a/audio/third_party/fmod/api/lib/libfmodex-4.36.01.so.REMOVED.git-id b/cocos/audio/third-party/fmod/api/lib/libfmodex-4.36.01.so.REMOVED.git-id similarity index 100% rename from audio/third_party/fmod/api/lib/libfmodex-4.36.01.so.REMOVED.git-id rename to cocos/audio/third-party/fmod/api/lib/libfmodex-4.36.01.so.REMOVED.git-id diff --git a/audio/third_party/fmod/api/lib/libfmodex.so.REMOVED.git-id b/cocos/audio/third-party/fmod/api/lib/libfmodex.so.REMOVED.git-id similarity index 100% rename from audio/third_party/fmod/api/lib/libfmodex.so.REMOVED.git-id rename to cocos/audio/third-party/fmod/api/lib/libfmodex.so.REMOVED.git-id diff --git a/audio/third_party/fmod/api/lib/libfmodexL-4.36.01.so.REMOVED.git-id b/cocos/audio/third-party/fmod/api/lib/libfmodexL-4.36.01.so.REMOVED.git-id similarity index 100% rename from audio/third_party/fmod/api/lib/libfmodexL-4.36.01.so.REMOVED.git-id rename to cocos/audio/third-party/fmod/api/lib/libfmodexL-4.36.01.so.REMOVED.git-id diff --git a/audio/third_party/fmod/api/lib/libfmodexL.so.REMOVED.git-id b/cocos/audio/third-party/fmod/api/lib/libfmodexL.so.REMOVED.git-id similarity index 100% rename from audio/third_party/fmod/api/lib/libfmodexL.so.REMOVED.git-id rename to cocos/audio/third-party/fmod/api/lib/libfmodexL.so.REMOVED.git-id diff --git a/audio/third_party/fmod/lib64/Makefile b/cocos/audio/third-party/fmod/lib64/Makefile similarity index 100% rename from audio/third_party/fmod/lib64/Makefile rename to cocos/audio/third-party/fmod/lib64/Makefile diff --git a/audio/third_party/fmod/lib64/api/inc/fmod.h.REMOVED.git-id b/cocos/audio/third-party/fmod/lib64/api/inc/fmod.h.REMOVED.git-id similarity index 100% rename from audio/third_party/fmod/lib64/api/inc/fmod.h.REMOVED.git-id rename to cocos/audio/third-party/fmod/lib64/api/inc/fmod.h.REMOVED.git-id diff --git a/audio/third_party/fmod/lib64/api/inc/fmod.hpp b/cocos/audio/third-party/fmod/lib64/api/inc/fmod.hpp similarity index 100% rename from audio/third_party/fmod/lib64/api/inc/fmod.hpp rename to cocos/audio/third-party/fmod/lib64/api/inc/fmod.hpp diff --git a/audio/third_party/fmod/lib64/api/inc/fmod_codec.h b/cocos/audio/third-party/fmod/lib64/api/inc/fmod_codec.h similarity index 100% rename from audio/third_party/fmod/lib64/api/inc/fmod_codec.h rename to cocos/audio/third-party/fmod/lib64/api/inc/fmod_codec.h diff --git a/audio/third_party/fmod/lib64/api/inc/fmod_dsp.h b/cocos/audio/third-party/fmod/lib64/api/inc/fmod_dsp.h similarity index 100% rename from audio/third_party/fmod/lib64/api/inc/fmod_dsp.h rename to cocos/audio/third-party/fmod/lib64/api/inc/fmod_dsp.h diff --git a/audio/third_party/fmod/lib64/api/inc/fmod_errors.h b/cocos/audio/third-party/fmod/lib64/api/inc/fmod_errors.h similarity index 100% rename from audio/third_party/fmod/lib64/api/inc/fmod_errors.h rename to cocos/audio/third-party/fmod/lib64/api/inc/fmod_errors.h diff --git a/audio/third_party/fmod/lib64/api/inc/fmod_memoryinfo.h b/cocos/audio/third-party/fmod/lib64/api/inc/fmod_memoryinfo.h similarity index 100% rename from audio/third_party/fmod/lib64/api/inc/fmod_memoryinfo.h rename to cocos/audio/third-party/fmod/lib64/api/inc/fmod_memoryinfo.h diff --git a/audio/third_party/fmod/lib64/api/inc/fmod_output.h b/cocos/audio/third-party/fmod/lib64/api/inc/fmod_output.h similarity index 100% rename from audio/third_party/fmod/lib64/api/inc/fmod_output.h rename to cocos/audio/third-party/fmod/lib64/api/inc/fmod_output.h diff --git a/audio/third_party/fmod/lib64/api/inc/fmodlinux.h b/cocos/audio/third-party/fmod/lib64/api/inc/fmodlinux.h similarity index 100% rename from audio/third_party/fmod/lib64/api/inc/fmodlinux.h rename to cocos/audio/third-party/fmod/lib64/api/inc/fmodlinux.h diff --git a/audio/third_party/fmod/lib64/api/lib/libfmodex64-4.38.00.so.REMOVED.git-id b/cocos/audio/third-party/fmod/lib64/api/lib/libfmodex64-4.38.00.so.REMOVED.git-id similarity index 100% rename from audio/third_party/fmod/lib64/api/lib/libfmodex64-4.38.00.so.REMOVED.git-id rename to cocos/audio/third-party/fmod/lib64/api/lib/libfmodex64-4.38.00.so.REMOVED.git-id diff --git a/audio/third_party/fmod/lib64/api/lib/libfmodex64.so.REMOVED.git-id b/cocos/audio/third-party/fmod/lib64/api/lib/libfmodex64.so.REMOVED.git-id similarity index 100% rename from audio/third_party/fmod/lib64/api/lib/libfmodex64.so.REMOVED.git-id rename to cocos/audio/third-party/fmod/lib64/api/lib/libfmodex64.so.REMOVED.git-id diff --git a/audio/third_party/fmod/lib64/api/lib/libfmodexL64-4.38.00.so.REMOVED.git-id b/cocos/audio/third-party/fmod/lib64/api/lib/libfmodexL64-4.38.00.so.REMOVED.git-id similarity index 100% rename from audio/third_party/fmod/lib64/api/lib/libfmodexL64-4.38.00.so.REMOVED.git-id rename to cocos/audio/third-party/fmod/lib64/api/lib/libfmodexL64-4.38.00.so.REMOVED.git-id diff --git a/audio/third_party/fmod/lib64/api/lib/libfmodexL64.so.REMOVED.git-id b/cocos/audio/third-party/fmod/lib64/api/lib/libfmodexL64.so.REMOVED.git-id similarity index 100% rename from audio/third_party/fmod/lib64/api/lib/libfmodexL64.so.REMOVED.git-id rename to cocos/audio/third-party/fmod/lib64/api/lib/libfmodexL64.so.REMOVED.git-id diff --git a/audio/win32/MciPlayer.cpp b/cocos/audio/win32/MciPlayer.cpp similarity index 100% rename from audio/win32/MciPlayer.cpp rename to cocos/audio/win32/MciPlayer.cpp diff --git a/audio/win32/MciPlayer.h b/cocos/audio/win32/MciPlayer.h similarity index 100% rename from audio/win32/MciPlayer.h rename to cocos/audio/win32/MciPlayer.h diff --git a/audio/win32/SimpleAudioEngine.cpp b/cocos/audio/win32/SimpleAudioEngine.cpp similarity index 100% rename from audio/win32/SimpleAudioEngine.cpp rename to cocos/audio/win32/SimpleAudioEngine.cpp diff --git a/extensions/CCBReader/CCBAnimationManager.cpp b/cocos/editor-support/cocosbuilder/CCBAnimationManager.cpp similarity index 100% rename from extensions/CCBReader/CCBAnimationManager.cpp rename to cocos/editor-support/cocosbuilder/CCBAnimationManager.cpp diff --git a/extensions/CCBReader/CCBAnimationManager.h b/cocos/editor-support/cocosbuilder/CCBAnimationManager.h similarity index 100% rename from extensions/CCBReader/CCBAnimationManager.h rename to cocos/editor-support/cocosbuilder/CCBAnimationManager.h diff --git a/extensions/CCBReader/CCBFileLoader.cpp b/cocos/editor-support/cocosbuilder/CCBFileLoader.cpp similarity index 100% rename from extensions/CCBReader/CCBFileLoader.cpp rename to cocos/editor-support/cocosbuilder/CCBFileLoader.cpp diff --git a/extensions/CCBReader/CCBFileLoader.h b/cocos/editor-support/cocosbuilder/CCBFileLoader.h similarity index 100% rename from extensions/CCBReader/CCBFileLoader.h rename to cocos/editor-support/cocosbuilder/CCBFileLoader.h diff --git a/extensions/CCBReader/CCBKeyframe.cpp b/cocos/editor-support/cocosbuilder/CCBKeyframe.cpp similarity index 100% rename from extensions/CCBReader/CCBKeyframe.cpp rename to cocos/editor-support/cocosbuilder/CCBKeyframe.cpp diff --git a/extensions/CCBReader/CCBKeyframe.h b/cocos/editor-support/cocosbuilder/CCBKeyframe.h similarity index 100% rename from extensions/CCBReader/CCBKeyframe.h rename to cocos/editor-support/cocosbuilder/CCBKeyframe.h diff --git a/extensions/CCBReader/CCBMemberVariableAssigner.h b/cocos/editor-support/cocosbuilder/CCBMemberVariableAssigner.h similarity index 100% rename from extensions/CCBReader/CCBMemberVariableAssigner.h rename to cocos/editor-support/cocosbuilder/CCBMemberVariableAssigner.h diff --git a/extensions/CCBReader/CCBReader.cpp b/cocos/editor-support/cocosbuilder/CCBReader.cpp similarity index 100% rename from extensions/CCBReader/CCBReader.cpp rename to cocos/editor-support/cocosbuilder/CCBReader.cpp diff --git a/extensions/CCBReader/CCBReader.h b/cocos/editor-support/cocosbuilder/CCBReader.h similarity index 100% rename from extensions/CCBReader/CCBReader.h rename to cocos/editor-support/cocosbuilder/CCBReader.h diff --git a/extensions/CCBReader/CCBSelectorResolver.h b/cocos/editor-support/cocosbuilder/CCBSelectorResolver.h similarity index 100% rename from extensions/CCBReader/CCBSelectorResolver.h rename to cocos/editor-support/cocosbuilder/CCBSelectorResolver.h diff --git a/extensions/CCBReader/CCBSequence.cpp b/cocos/editor-support/cocosbuilder/CCBSequence.cpp similarity index 100% rename from extensions/CCBReader/CCBSequence.cpp rename to cocos/editor-support/cocosbuilder/CCBSequence.cpp diff --git a/extensions/CCBReader/CCBSequence.h b/cocos/editor-support/cocosbuilder/CCBSequence.h similarity index 100% rename from extensions/CCBReader/CCBSequence.h rename to cocos/editor-support/cocosbuilder/CCBSequence.h diff --git a/extensions/CCBReader/CCBSequenceProperty.cpp b/cocos/editor-support/cocosbuilder/CCBSequenceProperty.cpp similarity index 100% rename from extensions/CCBReader/CCBSequenceProperty.cpp rename to cocos/editor-support/cocosbuilder/CCBSequenceProperty.cpp diff --git a/extensions/CCBReader/CCBSequenceProperty.h b/cocos/editor-support/cocosbuilder/CCBSequenceProperty.h similarity index 100% rename from extensions/CCBReader/CCBSequenceProperty.h rename to cocos/editor-support/cocosbuilder/CCBSequenceProperty.h diff --git a/extensions/CCBReader/CCBValue.cpp b/cocos/editor-support/cocosbuilder/CCBValue.cpp similarity index 100% rename from extensions/CCBReader/CCBValue.cpp rename to cocos/editor-support/cocosbuilder/CCBValue.cpp diff --git a/extensions/CCBReader/CCBValue.h b/cocos/editor-support/cocosbuilder/CCBValue.h similarity index 100% rename from extensions/CCBReader/CCBValue.h rename to cocos/editor-support/cocosbuilder/CCBValue.h diff --git a/extensions/CCBReader/CCControlButtonLoader.cpp b/cocos/editor-support/cocosbuilder/CCControlButtonLoader.cpp similarity index 100% rename from extensions/CCBReader/CCControlButtonLoader.cpp rename to cocos/editor-support/cocosbuilder/CCControlButtonLoader.cpp diff --git a/extensions/CCBReader/CCControlButtonLoader.h b/cocos/editor-support/cocosbuilder/CCControlButtonLoader.h similarity index 100% rename from extensions/CCBReader/CCControlButtonLoader.h rename to cocos/editor-support/cocosbuilder/CCControlButtonLoader.h diff --git a/extensions/CCBReader/CCControlLoader.cpp b/cocos/editor-support/cocosbuilder/CCControlLoader.cpp similarity index 100% rename from extensions/CCBReader/CCControlLoader.cpp rename to cocos/editor-support/cocosbuilder/CCControlLoader.cpp diff --git a/extensions/CCBReader/CCControlLoader.h b/cocos/editor-support/cocosbuilder/CCControlLoader.h similarity index 100% rename from extensions/CCBReader/CCControlLoader.h rename to cocos/editor-support/cocosbuilder/CCControlLoader.h diff --git a/extensions/CCBReader/CCLabelBMFontLoader.cpp b/cocos/editor-support/cocosbuilder/CCLabelBMFontLoader.cpp similarity index 100% rename from extensions/CCBReader/CCLabelBMFontLoader.cpp rename to cocos/editor-support/cocosbuilder/CCLabelBMFontLoader.cpp diff --git a/extensions/CCBReader/CCLabelBMFontLoader.h b/cocos/editor-support/cocosbuilder/CCLabelBMFontLoader.h similarity index 100% rename from extensions/CCBReader/CCLabelBMFontLoader.h rename to cocos/editor-support/cocosbuilder/CCLabelBMFontLoader.h diff --git a/extensions/CCBReader/CCLabelTTFLoader.cpp b/cocos/editor-support/cocosbuilder/CCLabelTTFLoader.cpp similarity index 100% rename from extensions/CCBReader/CCLabelTTFLoader.cpp rename to cocos/editor-support/cocosbuilder/CCLabelTTFLoader.cpp diff --git a/extensions/CCBReader/CCLabelTTFLoader.h b/cocos/editor-support/cocosbuilder/CCLabelTTFLoader.h similarity index 100% rename from extensions/CCBReader/CCLabelTTFLoader.h rename to cocos/editor-support/cocosbuilder/CCLabelTTFLoader.h diff --git a/extensions/CCBReader/CCLayerColorLoader.cpp b/cocos/editor-support/cocosbuilder/CCLayerColorLoader.cpp similarity index 100% rename from extensions/CCBReader/CCLayerColorLoader.cpp rename to cocos/editor-support/cocosbuilder/CCLayerColorLoader.cpp diff --git a/extensions/CCBReader/CCLayerColorLoader.h b/cocos/editor-support/cocosbuilder/CCLayerColorLoader.h similarity index 100% rename from extensions/CCBReader/CCLayerColorLoader.h rename to cocos/editor-support/cocosbuilder/CCLayerColorLoader.h diff --git a/extensions/CCBReader/CCLayerGradientLoader.cpp b/cocos/editor-support/cocosbuilder/CCLayerGradientLoader.cpp similarity index 100% rename from extensions/CCBReader/CCLayerGradientLoader.cpp rename to cocos/editor-support/cocosbuilder/CCLayerGradientLoader.cpp diff --git a/extensions/CCBReader/CCLayerGradientLoader.h b/cocos/editor-support/cocosbuilder/CCLayerGradientLoader.h similarity index 100% rename from extensions/CCBReader/CCLayerGradientLoader.h rename to cocos/editor-support/cocosbuilder/CCLayerGradientLoader.h diff --git a/extensions/CCBReader/CCLayerLoader.cpp b/cocos/editor-support/cocosbuilder/CCLayerLoader.cpp similarity index 100% rename from extensions/CCBReader/CCLayerLoader.cpp rename to cocos/editor-support/cocosbuilder/CCLayerLoader.cpp diff --git a/extensions/CCBReader/CCLayerLoader.h b/cocos/editor-support/cocosbuilder/CCLayerLoader.h similarity index 100% rename from extensions/CCBReader/CCLayerLoader.h rename to cocos/editor-support/cocosbuilder/CCLayerLoader.h diff --git a/extensions/CCBReader/CCMenuItemImageLoader.cpp b/cocos/editor-support/cocosbuilder/CCMenuItemImageLoader.cpp similarity index 100% rename from extensions/CCBReader/CCMenuItemImageLoader.cpp rename to cocos/editor-support/cocosbuilder/CCMenuItemImageLoader.cpp diff --git a/extensions/CCBReader/CCMenuItemImageLoader.h b/cocos/editor-support/cocosbuilder/CCMenuItemImageLoader.h similarity index 100% rename from extensions/CCBReader/CCMenuItemImageLoader.h rename to cocos/editor-support/cocosbuilder/CCMenuItemImageLoader.h diff --git a/extensions/CCBReader/CCMenuItemLoader.cpp b/cocos/editor-support/cocosbuilder/CCMenuItemLoader.cpp similarity index 100% rename from extensions/CCBReader/CCMenuItemLoader.cpp rename to cocos/editor-support/cocosbuilder/CCMenuItemLoader.cpp diff --git a/extensions/CCBReader/CCMenuItemLoader.h b/cocos/editor-support/cocosbuilder/CCMenuItemLoader.h similarity index 100% rename from extensions/CCBReader/CCMenuItemLoader.h rename to cocos/editor-support/cocosbuilder/CCMenuItemLoader.h diff --git a/extensions/CCBReader/CCMenuLoader.h b/cocos/editor-support/cocosbuilder/CCMenuLoader.h similarity index 100% rename from extensions/CCBReader/CCMenuLoader.h rename to cocos/editor-support/cocosbuilder/CCMenuLoader.h diff --git a/extensions/CCBReader/CCNode+CCBRelativePositioning.cpp b/cocos/editor-support/cocosbuilder/CCNode+CCBRelativePositioning.cpp similarity index 100% rename from extensions/CCBReader/CCNode+CCBRelativePositioning.cpp rename to cocos/editor-support/cocosbuilder/CCNode+CCBRelativePositioning.cpp diff --git a/extensions/CCBReader/CCNode+CCBRelativePositioning.h b/cocos/editor-support/cocosbuilder/CCNode+CCBRelativePositioning.h similarity index 100% rename from extensions/CCBReader/CCNode+CCBRelativePositioning.h rename to cocos/editor-support/cocosbuilder/CCNode+CCBRelativePositioning.h diff --git a/extensions/CCBReader/CCNodeLoader.cpp b/cocos/editor-support/cocosbuilder/CCNodeLoader.cpp similarity index 100% rename from extensions/CCBReader/CCNodeLoader.cpp rename to cocos/editor-support/cocosbuilder/CCNodeLoader.cpp diff --git a/extensions/CCBReader/CCNodeLoader.h b/cocos/editor-support/cocosbuilder/CCNodeLoader.h similarity index 100% rename from extensions/CCBReader/CCNodeLoader.h rename to cocos/editor-support/cocosbuilder/CCNodeLoader.h diff --git a/extensions/CCBReader/CCNodeLoaderLibrary.cpp b/cocos/editor-support/cocosbuilder/CCNodeLoaderLibrary.cpp similarity index 100% rename from extensions/CCBReader/CCNodeLoaderLibrary.cpp rename to cocos/editor-support/cocosbuilder/CCNodeLoaderLibrary.cpp diff --git a/extensions/CCBReader/CCNodeLoaderLibrary.h b/cocos/editor-support/cocosbuilder/CCNodeLoaderLibrary.h similarity index 100% rename from extensions/CCBReader/CCNodeLoaderLibrary.h rename to cocos/editor-support/cocosbuilder/CCNodeLoaderLibrary.h diff --git a/extensions/CCBReader/CCNodeLoaderListener.h b/cocos/editor-support/cocosbuilder/CCNodeLoaderListener.h similarity index 100% rename from extensions/CCBReader/CCNodeLoaderListener.h rename to cocos/editor-support/cocosbuilder/CCNodeLoaderListener.h diff --git a/extensions/CCBReader/CCParticleSystemQuadLoader.cpp b/cocos/editor-support/cocosbuilder/CCParticleSystemQuadLoader.cpp similarity index 100% rename from extensions/CCBReader/CCParticleSystemQuadLoader.cpp rename to cocos/editor-support/cocosbuilder/CCParticleSystemQuadLoader.cpp diff --git a/extensions/CCBReader/CCParticleSystemQuadLoader.h b/cocos/editor-support/cocosbuilder/CCParticleSystemQuadLoader.h similarity index 100% rename from extensions/CCBReader/CCParticleSystemQuadLoader.h rename to cocos/editor-support/cocosbuilder/CCParticleSystemQuadLoader.h diff --git a/extensions/CCBReader/CCScale9SpriteLoader.cpp b/cocos/editor-support/cocosbuilder/CCScale9SpriteLoader.cpp similarity index 100% rename from extensions/CCBReader/CCScale9SpriteLoader.cpp rename to cocos/editor-support/cocosbuilder/CCScale9SpriteLoader.cpp diff --git a/extensions/CCBReader/CCScale9SpriteLoader.h b/cocos/editor-support/cocosbuilder/CCScale9SpriteLoader.h similarity index 100% rename from extensions/CCBReader/CCScale9SpriteLoader.h rename to cocos/editor-support/cocosbuilder/CCScale9SpriteLoader.h diff --git a/extensions/CCBReader/CCScrollViewLoader.cpp b/cocos/editor-support/cocosbuilder/CCScrollViewLoader.cpp similarity index 100% rename from extensions/CCBReader/CCScrollViewLoader.cpp rename to cocos/editor-support/cocosbuilder/CCScrollViewLoader.cpp diff --git a/extensions/CCBReader/CCScrollViewLoader.h b/cocos/editor-support/cocosbuilder/CCScrollViewLoader.h similarity index 100% rename from extensions/CCBReader/CCScrollViewLoader.h rename to cocos/editor-support/cocosbuilder/CCScrollViewLoader.h diff --git a/extensions/CCBReader/CCSpriteLoader.cpp b/cocos/editor-support/cocosbuilder/CCSpriteLoader.cpp similarity index 100% rename from extensions/CCBReader/CCSpriteLoader.cpp rename to cocos/editor-support/cocosbuilder/CCSpriteLoader.cpp diff --git a/extensions/CCBReader/CCSpriteLoader.h b/cocos/editor-support/cocosbuilder/CCSpriteLoader.h similarity index 100% rename from extensions/CCBReader/CCSpriteLoader.h rename to cocos/editor-support/cocosbuilder/CCSpriteLoader.h diff --git a/extensions/CocoStudio/Action/CCActionFrame.cpp b/cocos/editor-support/cocostudio/action/CCActionFrame.cpp similarity index 100% rename from extensions/CocoStudio/Action/CCActionFrame.cpp rename to cocos/editor-support/cocostudio/action/CCActionFrame.cpp diff --git a/extensions/CocoStudio/Action/CCActionFrame.h b/cocos/editor-support/cocostudio/action/CCActionFrame.h similarity index 100% rename from extensions/CocoStudio/Action/CCActionFrame.h rename to cocos/editor-support/cocostudio/action/CCActionFrame.h diff --git a/extensions/CocoStudio/Action/CCActionFrameEasing.cpp b/cocos/editor-support/cocostudio/action/CCActionFrameEasing.cpp similarity index 100% rename from extensions/CocoStudio/Action/CCActionFrameEasing.cpp rename to cocos/editor-support/cocostudio/action/CCActionFrameEasing.cpp diff --git a/extensions/CocoStudio/Action/CCActionFrameEasing.h b/cocos/editor-support/cocostudio/action/CCActionFrameEasing.h similarity index 100% rename from extensions/CocoStudio/Action/CCActionFrameEasing.h rename to cocos/editor-support/cocostudio/action/CCActionFrameEasing.h diff --git a/extensions/CocoStudio/Action/CCActionManagerEx.cpp b/cocos/editor-support/cocostudio/action/CCActionManagerEx.cpp similarity index 100% rename from extensions/CocoStudio/Action/CCActionManagerEx.cpp rename to cocos/editor-support/cocostudio/action/CCActionManagerEx.cpp diff --git a/extensions/CocoStudio/Action/CCActionManagerEx.h b/cocos/editor-support/cocostudio/action/CCActionManagerEx.h similarity index 100% rename from extensions/CocoStudio/Action/CCActionManagerEx.h rename to cocos/editor-support/cocostudio/action/CCActionManagerEx.h diff --git a/extensions/CocoStudio/Action/CCActionNode.cpp b/cocos/editor-support/cocostudio/action/CCActionNode.cpp similarity index 100% rename from extensions/CocoStudio/Action/CCActionNode.cpp rename to cocos/editor-support/cocostudio/action/CCActionNode.cpp diff --git a/extensions/CocoStudio/Action/CCActionNode.h b/cocos/editor-support/cocostudio/action/CCActionNode.h similarity index 100% rename from extensions/CocoStudio/Action/CCActionNode.h rename to cocos/editor-support/cocostudio/action/CCActionNode.h diff --git a/extensions/CocoStudio/Action/CCActionObject.cpp b/cocos/editor-support/cocostudio/action/CCActionObject.cpp similarity index 100% rename from extensions/CocoStudio/Action/CCActionObject.cpp rename to cocos/editor-support/cocostudio/action/CCActionObject.cpp diff --git a/extensions/CocoStudio/Action/CCActionObject.h b/cocos/editor-support/cocostudio/action/CCActionObject.h similarity index 100% rename from extensions/CocoStudio/Action/CCActionObject.h rename to cocos/editor-support/cocostudio/action/CCActionObject.h diff --git a/extensions/CocoStudio/Armature/CCArmature.cpp b/cocos/editor-support/cocostudio/armature/CCArmature.cpp similarity index 100% rename from extensions/CocoStudio/Armature/CCArmature.cpp rename to cocos/editor-support/cocostudio/armature/CCArmature.cpp diff --git a/extensions/CocoStudio/Armature/CCArmature.h b/cocos/editor-support/cocostudio/armature/CCArmature.h similarity index 100% rename from extensions/CocoStudio/Armature/CCArmature.h rename to cocos/editor-support/cocostudio/armature/CCArmature.h diff --git a/extensions/CocoStudio/Armature/CCBone.cpp b/cocos/editor-support/cocostudio/armature/CCBone.cpp similarity index 100% rename from extensions/CocoStudio/Armature/CCBone.cpp rename to cocos/editor-support/cocostudio/armature/CCBone.cpp diff --git a/extensions/CocoStudio/Armature/CCBone.h b/cocos/editor-support/cocostudio/armature/CCBone.h similarity index 100% rename from extensions/CocoStudio/Armature/CCBone.h rename to cocos/editor-support/cocostudio/armature/CCBone.h diff --git a/extensions/CocoStudio/Armature/animation/CCArmatureAnimation.cpp b/cocos/editor-support/cocostudio/armature/animation/CCArmatureAnimation.cpp similarity index 100% rename from extensions/CocoStudio/Armature/animation/CCArmatureAnimation.cpp rename to cocos/editor-support/cocostudio/armature/animation/CCArmatureAnimation.cpp diff --git a/extensions/CocoStudio/Armature/animation/CCArmatureAnimation.h b/cocos/editor-support/cocostudio/armature/animation/CCArmatureAnimation.h similarity index 100% rename from extensions/CocoStudio/Armature/animation/CCArmatureAnimation.h rename to cocos/editor-support/cocostudio/armature/animation/CCArmatureAnimation.h diff --git a/extensions/CocoStudio/Armature/animation/CCProcessBase.cpp b/cocos/editor-support/cocostudio/armature/animation/CCProcessBase.cpp similarity index 100% rename from extensions/CocoStudio/Armature/animation/CCProcessBase.cpp rename to cocos/editor-support/cocostudio/armature/animation/CCProcessBase.cpp diff --git a/extensions/CocoStudio/Armature/animation/CCProcessBase.h b/cocos/editor-support/cocostudio/armature/animation/CCProcessBase.h similarity index 100% rename from extensions/CocoStudio/Armature/animation/CCProcessBase.h rename to cocos/editor-support/cocostudio/armature/animation/CCProcessBase.h diff --git a/extensions/CocoStudio/Armature/animation/CCTween.cpp b/cocos/editor-support/cocostudio/armature/animation/CCTween.cpp similarity index 100% rename from extensions/CocoStudio/Armature/animation/CCTween.cpp rename to cocos/editor-support/cocostudio/armature/animation/CCTween.cpp diff --git a/extensions/CocoStudio/Armature/animation/CCTween.h b/cocos/editor-support/cocostudio/armature/animation/CCTween.h similarity index 100% rename from extensions/CocoStudio/Armature/animation/CCTween.h rename to cocos/editor-support/cocostudio/armature/animation/CCTween.h diff --git a/extensions/CocoStudio/Armature/datas/CCDatas.cpp b/cocos/editor-support/cocostudio/armature/datas/CCDatas.cpp similarity index 100% rename from extensions/CocoStudio/Armature/datas/CCDatas.cpp rename to cocos/editor-support/cocostudio/armature/datas/CCDatas.cpp diff --git a/extensions/CocoStudio/Armature/datas/CCDatas.h b/cocos/editor-support/cocostudio/armature/datas/CCDatas.h similarity index 100% rename from extensions/CocoStudio/Armature/datas/CCDatas.h rename to cocos/editor-support/cocostudio/armature/datas/CCDatas.h diff --git a/extensions/CocoStudio/Armature/display/CCBatchNode.cpp b/cocos/editor-support/cocostudio/armature/display/CCBatchNode.cpp similarity index 100% rename from extensions/CocoStudio/Armature/display/CCBatchNode.cpp rename to cocos/editor-support/cocostudio/armature/display/CCBatchNode.cpp diff --git a/extensions/CocoStudio/Armature/display/CCBatchNode.h b/cocos/editor-support/cocostudio/armature/display/CCBatchNode.h similarity index 100% rename from extensions/CocoStudio/Armature/display/CCBatchNode.h rename to cocos/editor-support/cocostudio/armature/display/CCBatchNode.h diff --git a/extensions/CocoStudio/Armature/display/CCDecorativeDisplay.cpp b/cocos/editor-support/cocostudio/armature/display/CCDecorativeDisplay.cpp similarity index 100% rename from extensions/CocoStudio/Armature/display/CCDecorativeDisplay.cpp rename to cocos/editor-support/cocostudio/armature/display/CCDecorativeDisplay.cpp diff --git a/extensions/CocoStudio/Armature/display/CCDecorativeDisplay.h b/cocos/editor-support/cocostudio/armature/display/CCDecorativeDisplay.h similarity index 100% rename from extensions/CocoStudio/Armature/display/CCDecorativeDisplay.h rename to cocos/editor-support/cocostudio/armature/display/CCDecorativeDisplay.h diff --git a/extensions/CocoStudio/Armature/display/CCDisplayFactory.cpp b/cocos/editor-support/cocostudio/armature/display/CCDisplayFactory.cpp similarity index 100% rename from extensions/CocoStudio/Armature/display/CCDisplayFactory.cpp rename to cocos/editor-support/cocostudio/armature/display/CCDisplayFactory.cpp diff --git a/extensions/CocoStudio/Armature/display/CCDisplayFactory.h b/cocos/editor-support/cocostudio/armature/display/CCDisplayFactory.h similarity index 100% rename from extensions/CocoStudio/Armature/display/CCDisplayFactory.h rename to cocos/editor-support/cocostudio/armature/display/CCDisplayFactory.h diff --git a/extensions/CocoStudio/Armature/display/CCDisplayManager.cpp b/cocos/editor-support/cocostudio/armature/display/CCDisplayManager.cpp similarity index 100% rename from extensions/CocoStudio/Armature/display/CCDisplayManager.cpp rename to cocos/editor-support/cocostudio/armature/display/CCDisplayManager.cpp diff --git a/extensions/CocoStudio/Armature/display/CCDisplayManager.h b/cocos/editor-support/cocostudio/armature/display/CCDisplayManager.h similarity index 100% rename from extensions/CocoStudio/Armature/display/CCDisplayManager.h rename to cocos/editor-support/cocostudio/armature/display/CCDisplayManager.h diff --git a/extensions/CocoStudio/Armature/display/CCSkin.cpp b/cocos/editor-support/cocostudio/armature/display/CCSkin.cpp similarity index 100% rename from extensions/CocoStudio/Armature/display/CCSkin.cpp rename to cocos/editor-support/cocostudio/armature/display/CCSkin.cpp diff --git a/extensions/CocoStudio/Armature/display/CCSkin.h b/cocos/editor-support/cocostudio/armature/display/CCSkin.h similarity index 100% rename from extensions/CocoStudio/Armature/display/CCSkin.h rename to cocos/editor-support/cocostudio/armature/display/CCSkin.h diff --git a/extensions/CocoStudio/Armature/physics/CCColliderDetector.cpp b/cocos/editor-support/cocostudio/armature/physics/CCColliderDetector.cpp similarity index 100% rename from extensions/CocoStudio/Armature/physics/CCColliderDetector.cpp rename to cocos/editor-support/cocostudio/armature/physics/CCColliderDetector.cpp diff --git a/extensions/CocoStudio/Armature/physics/CCColliderDetector.h b/cocos/editor-support/cocostudio/armature/physics/CCColliderDetector.h similarity index 100% rename from extensions/CocoStudio/Armature/physics/CCColliderDetector.h rename to cocos/editor-support/cocostudio/armature/physics/CCColliderDetector.h diff --git a/extensions/CocoStudio/Armature/utils/CCArmatureDataManager.cpp b/cocos/editor-support/cocostudio/armature/utils/CCArmatureDataManager.cpp similarity index 100% rename from extensions/CocoStudio/Armature/utils/CCArmatureDataManager.cpp rename to cocos/editor-support/cocostudio/armature/utils/CCArmatureDataManager.cpp diff --git a/extensions/CocoStudio/Armature/utils/CCArmatureDataManager.h b/cocos/editor-support/cocostudio/armature/utils/CCArmatureDataManager.h similarity index 100% rename from extensions/CocoStudio/Armature/utils/CCArmatureDataManager.h rename to cocos/editor-support/cocostudio/armature/utils/CCArmatureDataManager.h diff --git a/extensions/CocoStudio/Armature/utils/CCArmatureDefine.cpp b/cocos/editor-support/cocostudio/armature/utils/CCArmatureDefine.cpp similarity index 100% rename from extensions/CocoStudio/Armature/utils/CCArmatureDefine.cpp rename to cocos/editor-support/cocostudio/armature/utils/CCArmatureDefine.cpp diff --git a/extensions/CocoStudio/Armature/utils/CCArmatureDefine.h b/cocos/editor-support/cocostudio/armature/utils/CCArmatureDefine.h similarity index 100% rename from extensions/CocoStudio/Armature/utils/CCArmatureDefine.h rename to cocos/editor-support/cocostudio/armature/utils/CCArmatureDefine.h diff --git a/extensions/CocoStudio/Armature/utils/CCDataReaderHelper.cpp b/cocos/editor-support/cocostudio/armature/utils/CCDataReaderHelper.cpp similarity index 100% rename from extensions/CocoStudio/Armature/utils/CCDataReaderHelper.cpp rename to cocos/editor-support/cocostudio/armature/utils/CCDataReaderHelper.cpp diff --git a/extensions/CocoStudio/Armature/utils/CCDataReaderHelper.h b/cocos/editor-support/cocostudio/armature/utils/CCDataReaderHelper.h similarity index 100% rename from extensions/CocoStudio/Armature/utils/CCDataReaderHelper.h rename to cocos/editor-support/cocostudio/armature/utils/CCDataReaderHelper.h diff --git a/extensions/CocoStudio/Armature/utils/CCSpriteFrameCacheHelper.cpp b/cocos/editor-support/cocostudio/armature/utils/CCSpriteFrameCacheHelper.cpp similarity index 100% rename from extensions/CocoStudio/Armature/utils/CCSpriteFrameCacheHelper.cpp rename to cocos/editor-support/cocostudio/armature/utils/CCSpriteFrameCacheHelper.cpp diff --git a/extensions/CocoStudio/Armature/utils/CCSpriteFrameCacheHelper.h b/cocos/editor-support/cocostudio/armature/utils/CCSpriteFrameCacheHelper.h similarity index 100% rename from extensions/CocoStudio/Armature/utils/CCSpriteFrameCacheHelper.h rename to cocos/editor-support/cocostudio/armature/utils/CCSpriteFrameCacheHelper.h diff --git a/extensions/CocoStudio/Armature/utils/CCTransformHelp.cpp b/cocos/editor-support/cocostudio/armature/utils/CCTransformHelp.cpp similarity index 100% rename from extensions/CocoStudio/Armature/utils/CCTransformHelp.cpp rename to cocos/editor-support/cocostudio/armature/utils/CCTransformHelp.cpp diff --git a/extensions/CocoStudio/Armature/utils/CCTransformHelp.h b/cocos/editor-support/cocostudio/armature/utils/CCTransformHelp.h similarity index 100% rename from extensions/CocoStudio/Armature/utils/CCTransformHelp.h rename to cocos/editor-support/cocostudio/armature/utils/CCTransformHelp.h diff --git a/extensions/CocoStudio/Armature/utils/CCTweenFunction.cpp b/cocos/editor-support/cocostudio/armature/utils/CCTweenFunction.cpp similarity index 100% rename from extensions/CocoStudio/Armature/utils/CCTweenFunction.cpp rename to cocos/editor-support/cocostudio/armature/utils/CCTweenFunction.cpp diff --git a/extensions/CocoStudio/Armature/utils/CCTweenFunction.h b/cocos/editor-support/cocostudio/armature/utils/CCTweenFunction.h similarity index 100% rename from extensions/CocoStudio/Armature/utils/CCTweenFunction.h rename to cocos/editor-support/cocostudio/armature/utils/CCTweenFunction.h diff --git a/extensions/CocoStudio/Armature/utils/CCUtilMath.cpp b/cocos/editor-support/cocostudio/armature/utils/CCUtilMath.cpp similarity index 100% rename from extensions/CocoStudio/Armature/utils/CCUtilMath.cpp rename to cocos/editor-support/cocostudio/armature/utils/CCUtilMath.cpp diff --git a/extensions/CocoStudio/Armature/utils/CCUtilMath.h b/cocos/editor-support/cocostudio/armature/utils/CCUtilMath.h similarity index 100% rename from extensions/CocoStudio/Armature/utils/CCUtilMath.h rename to cocos/editor-support/cocostudio/armature/utils/CCUtilMath.h diff --git a/extensions/CocoStudio/Components/CCComAttribute.cpp b/cocos/editor-support/cocostudio/components/CCComAttribute.cpp similarity index 100% rename from extensions/CocoStudio/Components/CCComAttribute.cpp rename to cocos/editor-support/cocostudio/components/CCComAttribute.cpp diff --git a/extensions/CocoStudio/Components/CCComAttribute.h b/cocos/editor-support/cocostudio/components/CCComAttribute.h similarity index 100% rename from extensions/CocoStudio/Components/CCComAttribute.h rename to cocos/editor-support/cocostudio/components/CCComAttribute.h diff --git a/extensions/CocoStudio/Components/CCComAudio.cpp b/cocos/editor-support/cocostudio/components/CCComAudio.cpp similarity index 100% rename from extensions/CocoStudio/Components/CCComAudio.cpp rename to cocos/editor-support/cocostudio/components/CCComAudio.cpp diff --git a/extensions/CocoStudio/Components/CCComAudio.h b/cocos/editor-support/cocostudio/components/CCComAudio.h similarity index 100% rename from extensions/CocoStudio/Components/CCComAudio.h rename to cocos/editor-support/cocostudio/components/CCComAudio.h diff --git a/extensions/CocoStudio/Components/CCComController.cpp b/cocos/editor-support/cocostudio/components/CCComController.cpp similarity index 100% rename from extensions/CocoStudio/Components/CCComController.cpp rename to cocos/editor-support/cocostudio/components/CCComController.cpp diff --git a/extensions/CocoStudio/Components/CCComController.h b/cocos/editor-support/cocostudio/components/CCComController.h similarity index 100% rename from extensions/CocoStudio/Components/CCComController.h rename to cocos/editor-support/cocostudio/components/CCComController.h diff --git a/extensions/CocoStudio/Components/CCComRender.cpp b/cocos/editor-support/cocostudio/components/CCComRender.cpp similarity index 100% rename from extensions/CocoStudio/Components/CCComRender.cpp rename to cocos/editor-support/cocostudio/components/CCComRender.cpp diff --git a/extensions/CocoStudio/Components/CCComRender.h b/cocos/editor-support/cocostudio/components/CCComRender.h similarity index 100% rename from extensions/CocoStudio/Components/CCComRender.h rename to cocos/editor-support/cocostudio/components/CCComRender.h diff --git a/extensions/CocoStudio/Components/CCInputDelegate.cpp b/cocos/editor-support/cocostudio/components/CCInputDelegate.cpp similarity index 100% rename from extensions/CocoStudio/Components/CCInputDelegate.cpp rename to cocos/editor-support/cocostudio/components/CCInputDelegate.cpp diff --git a/extensions/CocoStudio/Components/CCInputDelegate.h b/cocos/editor-support/cocostudio/components/CCInputDelegate.h similarity index 100% rename from extensions/CocoStudio/Components/CCInputDelegate.h rename to cocos/editor-support/cocostudio/components/CCInputDelegate.h diff --git a/extensions/CocoStudio/Json/CSContentJsonDictionary.cpp b/cocos/editor-support/cocostudio/json/CSContentJsonDictionary.cpp similarity index 100% rename from extensions/CocoStudio/Json/CSContentJsonDictionary.cpp rename to cocos/editor-support/cocostudio/json/CSContentJsonDictionary.cpp diff --git a/extensions/CocoStudio/Json/CSContentJsonDictionary.h b/cocos/editor-support/cocostudio/json/CSContentJsonDictionary.h similarity index 100% rename from extensions/CocoStudio/Json/CSContentJsonDictionary.h rename to cocos/editor-support/cocostudio/json/CSContentJsonDictionary.h diff --git a/extensions/CocoStudio/Json/DictionaryHelper.cpp b/cocos/editor-support/cocostudio/json/DictionaryHelper.cpp similarity index 100% rename from extensions/CocoStudio/Json/DictionaryHelper.cpp rename to cocos/editor-support/cocostudio/json/DictionaryHelper.cpp diff --git a/extensions/CocoStudio/Json/DictionaryHelper.h b/cocos/editor-support/cocostudio/json/DictionaryHelper.h similarity index 100% rename from extensions/CocoStudio/Json/DictionaryHelper.h rename to cocos/editor-support/cocostudio/json/DictionaryHelper.h diff --git a/extensions/CocoStudio/Reader/CCSGUIReader.cpp b/cocos/editor-support/cocostudio/reader/CCSGUIReader.cpp similarity index 100% rename from extensions/CocoStudio/Reader/CCSGUIReader.cpp rename to cocos/editor-support/cocostudio/reader/CCSGUIReader.cpp diff --git a/extensions/CocoStudio/Reader/CCSGUIReader.h b/cocos/editor-support/cocostudio/reader/CCSGUIReader.h similarity index 100% rename from extensions/CocoStudio/Reader/CCSGUIReader.h rename to cocos/editor-support/cocostudio/reader/CCSGUIReader.h diff --git a/extensions/CocoStudio/Reader/CCSSceneReader.cpp b/cocos/editor-support/cocostudio/reader/CCSSceneReader.cpp similarity index 100% rename from extensions/CocoStudio/Reader/CCSSceneReader.cpp rename to cocos/editor-support/cocostudio/reader/CCSSceneReader.cpp diff --git a/extensions/CocoStudio/Reader/CCSSceneReader.h b/cocos/editor-support/cocostudio/reader/CCSSceneReader.h similarity index 100% rename from extensions/CocoStudio/Reader/CCSSceneReader.h rename to cocos/editor-support/cocostudio/reader/CCSSceneReader.h diff --git a/extensions/spine/Animation.cpp b/cocos/editor-support/spine/Animation.cpp similarity index 100% rename from extensions/spine/Animation.cpp rename to cocos/editor-support/spine/Animation.cpp diff --git a/extensions/spine/Animation.h b/cocos/editor-support/spine/Animation.h similarity index 100% rename from extensions/spine/Animation.h rename to cocos/editor-support/spine/Animation.h diff --git a/extensions/spine/AnimationState.cpp b/cocos/editor-support/spine/AnimationState.cpp similarity index 100% rename from extensions/spine/AnimationState.cpp rename to cocos/editor-support/spine/AnimationState.cpp diff --git a/extensions/spine/AnimationState.h b/cocos/editor-support/spine/AnimationState.h similarity index 100% rename from extensions/spine/AnimationState.h rename to cocos/editor-support/spine/AnimationState.h diff --git a/extensions/spine/AnimationStateData.cpp b/cocos/editor-support/spine/AnimationStateData.cpp similarity index 100% rename from extensions/spine/AnimationStateData.cpp rename to cocos/editor-support/spine/AnimationStateData.cpp diff --git a/extensions/spine/AnimationStateData.h b/cocos/editor-support/spine/AnimationStateData.h similarity index 100% rename from extensions/spine/AnimationStateData.h rename to cocos/editor-support/spine/AnimationStateData.h diff --git a/extensions/spine/Atlas.cpp b/cocos/editor-support/spine/Atlas.cpp similarity index 100% rename from extensions/spine/Atlas.cpp rename to cocos/editor-support/spine/Atlas.cpp diff --git a/extensions/spine/Atlas.h b/cocos/editor-support/spine/Atlas.h similarity index 100% rename from extensions/spine/Atlas.h rename to cocos/editor-support/spine/Atlas.h diff --git a/extensions/spine/AtlasAttachmentLoader.cpp b/cocos/editor-support/spine/AtlasAttachmentLoader.cpp similarity index 100% rename from extensions/spine/AtlasAttachmentLoader.cpp rename to cocos/editor-support/spine/AtlasAttachmentLoader.cpp diff --git a/extensions/spine/AtlasAttachmentLoader.h b/cocos/editor-support/spine/AtlasAttachmentLoader.h similarity index 100% rename from extensions/spine/AtlasAttachmentLoader.h rename to cocos/editor-support/spine/AtlasAttachmentLoader.h diff --git a/extensions/spine/Attachment.cpp b/cocos/editor-support/spine/Attachment.cpp similarity index 100% rename from extensions/spine/Attachment.cpp rename to cocos/editor-support/spine/Attachment.cpp diff --git a/extensions/spine/Attachment.h b/cocos/editor-support/spine/Attachment.h similarity index 100% rename from extensions/spine/Attachment.h rename to cocos/editor-support/spine/Attachment.h diff --git a/extensions/spine/AttachmentLoader.cpp b/cocos/editor-support/spine/AttachmentLoader.cpp similarity index 100% rename from extensions/spine/AttachmentLoader.cpp rename to cocos/editor-support/spine/AttachmentLoader.cpp diff --git a/extensions/spine/AttachmentLoader.h b/cocos/editor-support/spine/AttachmentLoader.h similarity index 100% rename from extensions/spine/AttachmentLoader.h rename to cocos/editor-support/spine/AttachmentLoader.h diff --git a/extensions/spine/Bone.cpp b/cocos/editor-support/spine/Bone.cpp similarity index 100% rename from extensions/spine/Bone.cpp rename to cocos/editor-support/spine/Bone.cpp diff --git a/extensions/spine/Bone.h b/cocos/editor-support/spine/Bone.h similarity index 100% rename from extensions/spine/Bone.h rename to cocos/editor-support/spine/Bone.h diff --git a/extensions/spine/BoneData.cpp b/cocos/editor-support/spine/BoneData.cpp similarity index 100% rename from extensions/spine/BoneData.cpp rename to cocos/editor-support/spine/BoneData.cpp diff --git a/extensions/spine/BoneData.h b/cocos/editor-support/spine/BoneData.h similarity index 100% rename from extensions/spine/BoneData.h rename to cocos/editor-support/spine/BoneData.h diff --git a/extensions/spine/CCSkeleton.cpp b/cocos/editor-support/spine/CCSkeleton.cpp similarity index 100% rename from extensions/spine/CCSkeleton.cpp rename to cocos/editor-support/spine/CCSkeleton.cpp diff --git a/extensions/spine/CCSkeleton.h b/cocos/editor-support/spine/CCSkeleton.h similarity index 100% rename from extensions/spine/CCSkeleton.h rename to cocos/editor-support/spine/CCSkeleton.h diff --git a/extensions/spine/CCSkeletonAnimation.cpp b/cocos/editor-support/spine/CCSkeletonAnimation.cpp similarity index 100% rename from extensions/spine/CCSkeletonAnimation.cpp rename to cocos/editor-support/spine/CCSkeletonAnimation.cpp diff --git a/extensions/spine/CCSkeletonAnimation.h b/cocos/editor-support/spine/CCSkeletonAnimation.h similarity index 100% rename from extensions/spine/CCSkeletonAnimation.h rename to cocos/editor-support/spine/CCSkeletonAnimation.h diff --git a/extensions/spine/Json.cpp b/cocos/editor-support/spine/Json.cpp similarity index 100% rename from extensions/spine/Json.cpp rename to cocos/editor-support/spine/Json.cpp diff --git a/extensions/spine/Json.h b/cocos/editor-support/spine/Json.h similarity index 100% rename from extensions/spine/Json.h rename to cocos/editor-support/spine/Json.h diff --git a/extensions/spine/RegionAttachment.cpp b/cocos/editor-support/spine/RegionAttachment.cpp similarity index 100% rename from extensions/spine/RegionAttachment.cpp rename to cocos/editor-support/spine/RegionAttachment.cpp diff --git a/extensions/spine/RegionAttachment.h b/cocos/editor-support/spine/RegionAttachment.h similarity index 100% rename from extensions/spine/RegionAttachment.h rename to cocos/editor-support/spine/RegionAttachment.h diff --git a/extensions/spine/Skeleton.cpp b/cocos/editor-support/spine/Skeleton.cpp similarity index 100% rename from extensions/spine/Skeleton.cpp rename to cocos/editor-support/spine/Skeleton.cpp diff --git a/extensions/spine/Skeleton.h b/cocos/editor-support/spine/Skeleton.h similarity index 100% rename from extensions/spine/Skeleton.h rename to cocos/editor-support/spine/Skeleton.h diff --git a/extensions/spine/SkeletonData.cpp b/cocos/editor-support/spine/SkeletonData.cpp similarity index 100% rename from extensions/spine/SkeletonData.cpp rename to cocos/editor-support/spine/SkeletonData.cpp diff --git a/extensions/spine/SkeletonData.h b/cocos/editor-support/spine/SkeletonData.h similarity index 100% rename from extensions/spine/SkeletonData.h rename to cocos/editor-support/spine/SkeletonData.h diff --git a/extensions/spine/SkeletonJson.cpp b/cocos/editor-support/spine/SkeletonJson.cpp similarity index 100% rename from extensions/spine/SkeletonJson.cpp rename to cocos/editor-support/spine/SkeletonJson.cpp diff --git a/extensions/spine/SkeletonJson.h b/cocos/editor-support/spine/SkeletonJson.h similarity index 100% rename from extensions/spine/SkeletonJson.h rename to cocos/editor-support/spine/SkeletonJson.h diff --git a/extensions/spine/Skin.cpp b/cocos/editor-support/spine/Skin.cpp similarity index 100% rename from extensions/spine/Skin.cpp rename to cocos/editor-support/spine/Skin.cpp diff --git a/extensions/spine/Skin.h b/cocos/editor-support/spine/Skin.h similarity index 100% rename from extensions/spine/Skin.h rename to cocos/editor-support/spine/Skin.h diff --git a/extensions/spine/Slot.cpp b/cocos/editor-support/spine/Slot.cpp similarity index 100% rename from extensions/spine/Slot.cpp rename to cocos/editor-support/spine/Slot.cpp diff --git a/extensions/spine/Slot.h b/cocos/editor-support/spine/Slot.h similarity index 100% rename from extensions/spine/Slot.h rename to cocos/editor-support/spine/Slot.h diff --git a/extensions/spine/SlotData.cpp b/cocos/editor-support/spine/SlotData.cpp similarity index 100% rename from extensions/spine/SlotData.cpp rename to cocos/editor-support/spine/SlotData.cpp diff --git a/extensions/spine/SlotData.h b/cocos/editor-support/spine/SlotData.h similarity index 100% rename from extensions/spine/SlotData.h rename to cocos/editor-support/spine/SlotData.h diff --git a/extensions/spine/extension.cpp b/cocos/editor-support/spine/extension.cpp similarity index 100% rename from extensions/spine/extension.cpp rename to cocos/editor-support/spine/extension.cpp diff --git a/extensions/spine/extension.h b/cocos/editor-support/spine/extension.h similarity index 100% rename from extensions/spine/extension.h rename to cocos/editor-support/spine/extension.h diff --git a/extensions/spine/spine-cocos2dx.cpp b/cocos/editor-support/spine/spine-cocos2dx.cpp similarity index 100% rename from extensions/spine/spine-cocos2dx.cpp rename to cocos/editor-support/spine/spine-cocos2dx.cpp diff --git a/extensions/spine/spine-cocos2dx.h b/cocos/editor-support/spine/spine-cocos2dx.h similarity index 100% rename from extensions/spine/spine-cocos2dx.h rename to cocos/editor-support/spine/spine-cocos2dx.h diff --git a/extensions/spine/spine.h b/cocos/editor-support/spine/spine.h similarity index 100% rename from extensions/spine/spine.h rename to cocos/editor-support/spine/spine.h diff --git a/extensions/CocoStudio/GUI/BaseClasses/UIRootWidget.cpp b/cocos/gui/base-classes/UIRootWidget.cpp similarity index 100% rename from extensions/CocoStudio/GUI/BaseClasses/UIRootWidget.cpp rename to cocos/gui/base-classes/UIRootWidget.cpp diff --git a/extensions/CocoStudio/GUI/BaseClasses/UIRootWidget.h b/cocos/gui/base-classes/UIRootWidget.h similarity index 100% rename from extensions/CocoStudio/GUI/BaseClasses/UIRootWidget.h rename to cocos/gui/base-classes/UIRootWidget.h diff --git a/extensions/CocoStudio/GUI/BaseClasses/UIWidget.cpp b/cocos/gui/base-classes/UIWidget.cpp similarity index 100% rename from extensions/CocoStudio/GUI/BaseClasses/UIWidget.cpp rename to cocos/gui/base-classes/UIWidget.cpp diff --git a/extensions/CocoStudio/GUI/BaseClasses/UIWidget.h b/cocos/gui/base-classes/UIWidget.h similarity index 100% rename from extensions/CocoStudio/GUI/BaseClasses/UIWidget.h rename to cocos/gui/base-classes/UIWidget.h diff --git a/extensions/CocoStudio/GUI/Layouts/Layout.cpp b/cocos/gui/layouts/Layout.cpp similarity index 100% rename from extensions/CocoStudio/GUI/Layouts/Layout.cpp rename to cocos/gui/layouts/Layout.cpp diff --git a/extensions/CocoStudio/GUI/Layouts/Layout.h b/cocos/gui/layouts/Layout.h similarity index 100% rename from extensions/CocoStudio/GUI/Layouts/Layout.h rename to cocos/gui/layouts/Layout.h diff --git a/extensions/CocoStudio/GUI/Layouts/LayoutParameter.cpp b/cocos/gui/layouts/LayoutParameter.cpp similarity index 100% rename from extensions/CocoStudio/GUI/Layouts/LayoutParameter.cpp rename to cocos/gui/layouts/LayoutParameter.cpp diff --git a/extensions/CocoStudio/GUI/Layouts/LayoutParameter.h b/cocos/gui/layouts/LayoutParameter.h similarity index 100% rename from extensions/CocoStudio/GUI/Layouts/LayoutParameter.h rename to cocos/gui/layouts/LayoutParameter.h diff --git a/extensions/CocoStudio/GUI/Layouts/UILayoutDefine.cpp b/cocos/gui/layouts/UILayoutDefine.cpp similarity index 100% rename from extensions/CocoStudio/GUI/Layouts/UILayoutDefine.cpp rename to cocos/gui/layouts/UILayoutDefine.cpp diff --git a/extensions/CocoStudio/GUI/Layouts/UILayoutDefine.h b/cocos/gui/layouts/UILayoutDefine.h similarity index 100% rename from extensions/CocoStudio/GUI/Layouts/UILayoutDefine.h rename to cocos/gui/layouts/UILayoutDefine.h diff --git a/extensions/CocoStudio/GUI/System/CocosGUI.cpp b/cocos/gui/system/CocosGUI.cpp similarity index 100% rename from extensions/CocoStudio/GUI/System/CocosGUI.cpp rename to cocos/gui/system/CocosGUI.cpp diff --git a/extensions/CocoStudio/GUI/System/CocosGUI.h b/cocos/gui/system/CocosGUI.h similarity index 100% rename from extensions/CocoStudio/GUI/System/CocosGUI.h rename to cocos/gui/system/CocosGUI.h diff --git a/extensions/CocoStudio/GUI/System/UIHelper.cpp b/cocos/gui/system/UIHelper.cpp similarity index 100% rename from extensions/CocoStudio/GUI/System/UIHelper.cpp rename to cocos/gui/system/UIHelper.cpp diff --git a/extensions/CocoStudio/GUI/System/UIHelper.h b/cocos/gui/system/UIHelper.h similarity index 100% rename from extensions/CocoStudio/GUI/System/UIHelper.h rename to cocos/gui/system/UIHelper.h diff --git a/extensions/CocoStudio/GUI/System/UIInputManager.cpp b/cocos/gui/system/UIInputManager.cpp similarity index 100% rename from extensions/CocoStudio/GUI/System/UIInputManager.cpp rename to cocos/gui/system/UIInputManager.cpp diff --git a/extensions/CocoStudio/GUI/System/UIInputManager.h b/cocos/gui/system/UIInputManager.h similarity index 100% rename from extensions/CocoStudio/GUI/System/UIInputManager.h rename to cocos/gui/system/UIInputManager.h diff --git a/extensions/CocoStudio/GUI/System/UILayer.cpp b/cocos/gui/system/UILayer.cpp similarity index 100% rename from extensions/CocoStudio/GUI/System/UILayer.cpp rename to cocos/gui/system/UILayer.cpp diff --git a/extensions/CocoStudio/GUI/System/UILayer.h b/cocos/gui/system/UILayer.h similarity index 100% rename from extensions/CocoStudio/GUI/System/UILayer.h rename to cocos/gui/system/UILayer.h diff --git a/extensions/CocoStudio/GUI/UIWidgets/ScrollWidget/UIDragPanel.cpp b/cocos/gui/widgets/ScrollWidget/UIDragPanel.cpp similarity index 100% rename from extensions/CocoStudio/GUI/UIWidgets/ScrollWidget/UIDragPanel.cpp rename to cocos/gui/widgets/ScrollWidget/UIDragPanel.cpp diff --git a/extensions/CocoStudio/GUI/UIWidgets/ScrollWidget/UIDragPanel.h b/cocos/gui/widgets/ScrollWidget/UIDragPanel.h similarity index 100% rename from extensions/CocoStudio/GUI/UIWidgets/ScrollWidget/UIDragPanel.h rename to cocos/gui/widgets/ScrollWidget/UIDragPanel.h diff --git a/extensions/CocoStudio/GUI/UIWidgets/ScrollWidget/UIListView.cpp b/cocos/gui/widgets/ScrollWidget/UIListView.cpp similarity index 100% rename from extensions/CocoStudio/GUI/UIWidgets/ScrollWidget/UIListView.cpp rename to cocos/gui/widgets/ScrollWidget/UIListView.cpp diff --git a/extensions/CocoStudio/GUI/UIWidgets/ScrollWidget/UIListView.h b/cocos/gui/widgets/ScrollWidget/UIListView.h similarity index 100% rename from extensions/CocoStudio/GUI/UIWidgets/ScrollWidget/UIListView.h rename to cocos/gui/widgets/ScrollWidget/UIListView.h diff --git a/extensions/CocoStudio/GUI/UIWidgets/ScrollWidget/UIPageView.cpp b/cocos/gui/widgets/ScrollWidget/UIPageView.cpp similarity index 100% rename from extensions/CocoStudio/GUI/UIWidgets/ScrollWidget/UIPageView.cpp rename to cocos/gui/widgets/ScrollWidget/UIPageView.cpp diff --git a/extensions/CocoStudio/GUI/UIWidgets/ScrollWidget/UIPageView.h b/cocos/gui/widgets/ScrollWidget/UIPageView.h similarity index 100% rename from extensions/CocoStudio/GUI/UIWidgets/ScrollWidget/UIPageView.h rename to cocos/gui/widgets/ScrollWidget/UIPageView.h diff --git a/extensions/CocoStudio/GUI/UIWidgets/ScrollWidget/UIScrollInterface.h b/cocos/gui/widgets/ScrollWidget/UIScrollInterface.h similarity index 100% rename from extensions/CocoStudio/GUI/UIWidgets/ScrollWidget/UIScrollInterface.h rename to cocos/gui/widgets/ScrollWidget/UIScrollInterface.h diff --git a/extensions/CocoStudio/GUI/UIWidgets/ScrollWidget/UIScrollView.cpp b/cocos/gui/widgets/ScrollWidget/UIScrollView.cpp similarity index 100% rename from extensions/CocoStudio/GUI/UIWidgets/ScrollWidget/UIScrollView.cpp rename to cocos/gui/widgets/ScrollWidget/UIScrollView.cpp diff --git a/extensions/CocoStudio/GUI/UIWidgets/ScrollWidget/UIScrollView.h b/cocos/gui/widgets/ScrollWidget/UIScrollView.h similarity index 100% rename from extensions/CocoStudio/GUI/UIWidgets/ScrollWidget/UIScrollView.h rename to cocos/gui/widgets/ScrollWidget/UIScrollView.h diff --git a/extensions/CocoStudio/GUI/UIWidgets/UIButton.cpp b/cocos/gui/widgets/UIButton.cpp similarity index 100% rename from extensions/CocoStudio/GUI/UIWidgets/UIButton.cpp rename to cocos/gui/widgets/UIButton.cpp diff --git a/extensions/CocoStudio/GUI/UIWidgets/UIButton.h b/cocos/gui/widgets/UIButton.h similarity index 100% rename from extensions/CocoStudio/GUI/UIWidgets/UIButton.h rename to cocos/gui/widgets/UIButton.h diff --git a/extensions/CocoStudio/GUI/UIWidgets/UICheckBox.cpp b/cocos/gui/widgets/UICheckBox.cpp similarity index 100% rename from extensions/CocoStudio/GUI/UIWidgets/UICheckBox.cpp rename to cocos/gui/widgets/UICheckBox.cpp diff --git a/extensions/CocoStudio/GUI/UIWidgets/UICheckBox.h b/cocos/gui/widgets/UICheckBox.h similarity index 100% rename from extensions/CocoStudio/GUI/UIWidgets/UICheckBox.h rename to cocos/gui/widgets/UICheckBox.h diff --git a/extensions/CocoStudio/GUI/UIWidgets/UIImageView.cpp b/cocos/gui/widgets/UIImageView.cpp similarity index 100% rename from extensions/CocoStudio/GUI/UIWidgets/UIImageView.cpp rename to cocos/gui/widgets/UIImageView.cpp diff --git a/extensions/CocoStudio/GUI/UIWidgets/UIImageView.h b/cocos/gui/widgets/UIImageView.h similarity index 100% rename from extensions/CocoStudio/GUI/UIWidgets/UIImageView.h rename to cocos/gui/widgets/UIImageView.h diff --git a/extensions/CocoStudio/GUI/UIWidgets/UILabel.cpp b/cocos/gui/widgets/UILabel.cpp similarity index 100% rename from extensions/CocoStudio/GUI/UIWidgets/UILabel.cpp rename to cocos/gui/widgets/UILabel.cpp diff --git a/extensions/CocoStudio/GUI/UIWidgets/UILabel.h b/cocos/gui/widgets/UILabel.h similarity index 100% rename from extensions/CocoStudio/GUI/UIWidgets/UILabel.h rename to cocos/gui/widgets/UILabel.h diff --git a/extensions/CocoStudio/GUI/UIWidgets/UILabelAtlas.cpp b/cocos/gui/widgets/UILabelAtlas.cpp similarity index 100% rename from extensions/CocoStudio/GUI/UIWidgets/UILabelAtlas.cpp rename to cocos/gui/widgets/UILabelAtlas.cpp diff --git a/extensions/CocoStudio/GUI/UIWidgets/UILabelAtlas.h b/cocos/gui/widgets/UILabelAtlas.h similarity index 100% rename from extensions/CocoStudio/GUI/UIWidgets/UILabelAtlas.h rename to cocos/gui/widgets/UILabelAtlas.h diff --git a/extensions/CocoStudio/GUI/UIWidgets/UILabelBMFont.cpp b/cocos/gui/widgets/UILabelBMFont.cpp similarity index 100% rename from extensions/CocoStudio/GUI/UIWidgets/UILabelBMFont.cpp rename to cocos/gui/widgets/UILabelBMFont.cpp diff --git a/extensions/CocoStudio/GUI/UIWidgets/UILabelBMFont.h b/cocos/gui/widgets/UILabelBMFont.h similarity index 100% rename from extensions/CocoStudio/GUI/UIWidgets/UILabelBMFont.h rename to cocos/gui/widgets/UILabelBMFont.h diff --git a/extensions/CocoStudio/GUI/UIWidgets/UILoadingBar.cpp b/cocos/gui/widgets/UILoadingBar.cpp similarity index 100% rename from extensions/CocoStudio/GUI/UIWidgets/UILoadingBar.cpp rename to cocos/gui/widgets/UILoadingBar.cpp diff --git a/extensions/CocoStudio/GUI/UIWidgets/UILoadingBar.h b/cocos/gui/widgets/UILoadingBar.h similarity index 100% rename from extensions/CocoStudio/GUI/UIWidgets/UILoadingBar.h rename to cocos/gui/widgets/UILoadingBar.h diff --git a/extensions/CocoStudio/GUI/UIWidgets/UISlider.cpp b/cocos/gui/widgets/UISlider.cpp similarity index 100% rename from extensions/CocoStudio/GUI/UIWidgets/UISlider.cpp rename to cocos/gui/widgets/UISlider.cpp diff --git a/extensions/CocoStudio/GUI/UIWidgets/UISlider.h b/cocos/gui/widgets/UISlider.h similarity index 100% rename from extensions/CocoStudio/GUI/UIWidgets/UISlider.h rename to cocos/gui/widgets/UISlider.h diff --git a/extensions/CocoStudio/GUI/UIWidgets/UITextField.cpp b/cocos/gui/widgets/UITextField.cpp similarity index 100% rename from extensions/CocoStudio/GUI/UIWidgets/UITextField.cpp rename to cocos/gui/widgets/UITextField.cpp diff --git a/extensions/CocoStudio/GUI/UIWidgets/UITextField.h b/cocos/gui/widgets/UITextField.h similarity index 100% rename from extensions/CocoStudio/GUI/UIWidgets/UITextField.h rename to cocos/gui/widgets/UITextField.h diff --git a/cocos2dx/kazmath/include/kazmath/GL/mat4stack.h b/cocos/math/kazmath/include/kazmath/GL/mat4stack.h similarity index 100% rename from cocos2dx/kazmath/include/kazmath/GL/mat4stack.h rename to cocos/math/kazmath/include/kazmath/GL/mat4stack.h diff --git a/cocos2dx/kazmath/include/kazmath/GL/matrix.h b/cocos/math/kazmath/include/kazmath/GL/matrix.h similarity index 100% rename from cocos2dx/kazmath/include/kazmath/GL/matrix.h rename to cocos/math/kazmath/include/kazmath/GL/matrix.h diff --git a/cocos2dx/kazmath/include/kazmath/aabb.h b/cocos/math/kazmath/include/kazmath/aabb.h similarity index 100% rename from cocos2dx/kazmath/include/kazmath/aabb.h rename to cocos/math/kazmath/include/kazmath/aabb.h diff --git a/cocos2dx/kazmath/include/kazmath/kazmath.h b/cocos/math/kazmath/include/kazmath/kazmath.h similarity index 100% rename from cocos2dx/kazmath/include/kazmath/kazmath.h rename to cocos/math/kazmath/include/kazmath/kazmath.h diff --git a/cocos2dx/kazmath/include/kazmath/mat3.h b/cocos/math/kazmath/include/kazmath/mat3.h similarity index 100% rename from cocos2dx/kazmath/include/kazmath/mat3.h rename to cocos/math/kazmath/include/kazmath/mat3.h diff --git a/cocos2dx/kazmath/include/kazmath/mat4.h b/cocos/math/kazmath/include/kazmath/mat4.h similarity index 100% rename from cocos2dx/kazmath/include/kazmath/mat4.h rename to cocos/math/kazmath/include/kazmath/mat4.h diff --git a/cocos2dx/kazmath/include/kazmath/neon_matrix_impl.h b/cocos/math/kazmath/include/kazmath/neon_matrix_impl.h similarity index 100% rename from cocos2dx/kazmath/include/kazmath/neon_matrix_impl.h rename to cocos/math/kazmath/include/kazmath/neon_matrix_impl.h diff --git a/cocos2dx/kazmath/include/kazmath/plane.h b/cocos/math/kazmath/include/kazmath/plane.h similarity index 100% rename from cocos2dx/kazmath/include/kazmath/plane.h rename to cocos/math/kazmath/include/kazmath/plane.h diff --git a/cocos2dx/kazmath/include/kazmath/quaternion.h b/cocos/math/kazmath/include/kazmath/quaternion.h similarity index 100% rename from cocos2dx/kazmath/include/kazmath/quaternion.h rename to cocos/math/kazmath/include/kazmath/quaternion.h diff --git a/cocos2dx/kazmath/include/kazmath/ray2.h b/cocos/math/kazmath/include/kazmath/ray2.h similarity index 100% rename from cocos2dx/kazmath/include/kazmath/ray2.h rename to cocos/math/kazmath/include/kazmath/ray2.h diff --git a/cocos2dx/kazmath/include/kazmath/utility.h b/cocos/math/kazmath/include/kazmath/utility.h similarity index 100% rename from cocos2dx/kazmath/include/kazmath/utility.h rename to cocos/math/kazmath/include/kazmath/utility.h diff --git a/cocos2dx/kazmath/include/kazmath/vec2.h b/cocos/math/kazmath/include/kazmath/vec2.h similarity index 100% rename from cocos2dx/kazmath/include/kazmath/vec2.h rename to cocos/math/kazmath/include/kazmath/vec2.h diff --git a/cocos2dx/kazmath/include/kazmath/vec3.h b/cocos/math/kazmath/include/kazmath/vec3.h similarity index 100% rename from cocos2dx/kazmath/include/kazmath/vec3.h rename to cocos/math/kazmath/include/kazmath/vec3.h diff --git a/cocos2dx/kazmath/include/kazmath/vec4.h b/cocos/math/kazmath/include/kazmath/vec4.h similarity index 100% rename from cocos2dx/kazmath/include/kazmath/vec4.h rename to cocos/math/kazmath/include/kazmath/vec4.h diff --git a/cocos2dx/kazmath/src/CMakeLists.txt b/cocos/math/kazmath/src/CMakeLists.txt similarity index 100% rename from cocos2dx/kazmath/src/CMakeLists.txt rename to cocos/math/kazmath/src/CMakeLists.txt diff --git a/cocos2dx/kazmath/src/ChangeLog b/cocos/math/kazmath/src/ChangeLog similarity index 100% rename from cocos2dx/kazmath/src/ChangeLog rename to cocos/math/kazmath/src/ChangeLog diff --git a/cocos2dx/kazmath/src/GL/mat4stack.c b/cocos/math/kazmath/src/GL/mat4stack.c similarity index 100% rename from cocos2dx/kazmath/src/GL/mat4stack.c rename to cocos/math/kazmath/src/GL/mat4stack.c diff --git a/cocos2dx/kazmath/src/GL/matrix.c b/cocos/math/kazmath/src/GL/matrix.c similarity index 100% rename from cocos2dx/kazmath/src/GL/matrix.c rename to cocos/math/kazmath/src/GL/matrix.c diff --git a/cocos2dx/kazmath/src/aabb.c b/cocos/math/kazmath/src/aabb.c similarity index 100% rename from cocos2dx/kazmath/src/aabb.c rename to cocos/math/kazmath/src/aabb.c diff --git a/cocos2dx/kazmath/src/mat3.c b/cocos/math/kazmath/src/mat3.c similarity index 100% rename from cocos2dx/kazmath/src/mat3.c rename to cocos/math/kazmath/src/mat3.c diff --git a/cocos2dx/kazmath/src/mat4.c b/cocos/math/kazmath/src/mat4.c similarity index 100% rename from cocos2dx/kazmath/src/mat4.c rename to cocos/math/kazmath/src/mat4.c diff --git a/cocos2dx/kazmath/src/neon_matrix_impl.c b/cocos/math/kazmath/src/neon_matrix_impl.c similarity index 100% rename from cocos2dx/kazmath/src/neon_matrix_impl.c rename to cocos/math/kazmath/src/neon_matrix_impl.c diff --git a/cocos2dx/kazmath/src/plane.c b/cocos/math/kazmath/src/plane.c similarity index 100% rename from cocos2dx/kazmath/src/plane.c rename to cocos/math/kazmath/src/plane.c diff --git a/cocos2dx/kazmath/src/quaternion.c b/cocos/math/kazmath/src/quaternion.c similarity index 100% rename from cocos2dx/kazmath/src/quaternion.c rename to cocos/math/kazmath/src/quaternion.c diff --git a/cocos2dx/kazmath/src/ray2.c b/cocos/math/kazmath/src/ray2.c similarity index 100% rename from cocos2dx/kazmath/src/ray2.c rename to cocos/math/kazmath/src/ray2.c diff --git a/cocos2dx/kazmath/src/utility.c b/cocos/math/kazmath/src/utility.c similarity index 100% rename from cocos2dx/kazmath/src/utility.c rename to cocos/math/kazmath/src/utility.c diff --git a/cocos2dx/kazmath/src/vec2.c b/cocos/math/kazmath/src/vec2.c similarity index 100% rename from cocos2dx/kazmath/src/vec2.c rename to cocos/math/kazmath/src/vec2.c diff --git a/cocos2dx/kazmath/src/vec3.c b/cocos/math/kazmath/src/vec3.c similarity index 100% rename from cocos2dx/kazmath/src/vec3.c rename to cocos/math/kazmath/src/vec3.c diff --git a/cocos2dx/kazmath/src/vec4.c b/cocos/math/kazmath/src/vec4.c similarity index 100% rename from cocos2dx/kazmath/src/vec4.c rename to cocos/math/kazmath/src/vec4.c diff --git a/extensions/network/HttpClient.cpp b/cocos/network/HttpClient.cpp similarity index 100% rename from extensions/network/HttpClient.cpp rename to cocos/network/HttpClient.cpp diff --git a/extensions/network/HttpClient.h b/cocos/network/HttpClient.h similarity index 100% rename from extensions/network/HttpClient.h rename to cocos/network/HttpClient.h diff --git a/extensions/network/HttpRequest.h b/cocos/network/HttpRequest.h similarity index 100% rename from extensions/network/HttpRequest.h rename to cocos/network/HttpRequest.h diff --git a/extensions/network/HttpResponse.h b/cocos/network/HttpResponse.h similarity index 100% rename from extensions/network/HttpResponse.h rename to cocos/network/HttpResponse.h diff --git a/extensions/network/SocketIO.cpp b/cocos/network/SocketIO.cpp similarity index 100% rename from extensions/network/SocketIO.cpp rename to cocos/network/SocketIO.cpp diff --git a/extensions/network/SocketIO.h b/cocos/network/SocketIO.h similarity index 100% rename from extensions/network/SocketIO.h rename to cocos/network/SocketIO.h diff --git a/extensions/network/WebSocket.cpp b/cocos/network/WebSocket.cpp similarity index 100% rename from extensions/network/WebSocket.cpp rename to cocos/network/WebSocket.cpp diff --git a/extensions/network/WebSocket.h b/cocos/network/WebSocket.h similarity index 100% rename from extensions/network/WebSocket.h rename to cocos/network/WebSocket.h diff --git a/cocos2dx/physics/Box2D/CCPhysicsBodyInfo.cpp b/cocos/physics/Box2D/CCPhysicsBodyInfo.cpp similarity index 100% rename from cocos2dx/physics/Box2D/CCPhysicsBodyInfo.cpp rename to cocos/physics/Box2D/CCPhysicsBodyInfo.cpp diff --git a/cocos2dx/physics/Box2D/CCPhysicsBodyInfo.h b/cocos/physics/Box2D/CCPhysicsBodyInfo.h similarity index 100% rename from cocos2dx/physics/Box2D/CCPhysicsBodyInfo.h rename to cocos/physics/Box2D/CCPhysicsBodyInfo.h diff --git a/cocos2dx/physics/Box2D/CCPhysicsContactInfo.cpp b/cocos/physics/Box2D/CCPhysicsContactInfo.cpp similarity index 100% rename from cocos2dx/physics/Box2D/CCPhysicsContactInfo.cpp rename to cocos/physics/Box2D/CCPhysicsContactInfo.cpp diff --git a/cocos2dx/physics/Box2D/CCPhysicsContactInfo.h b/cocos/physics/Box2D/CCPhysicsContactInfo.h similarity index 100% rename from cocos2dx/physics/Box2D/CCPhysicsContactInfo.h rename to cocos/physics/Box2D/CCPhysicsContactInfo.h diff --git a/cocos2dx/physics/Box2D/CCPhysicsHelper.h b/cocos/physics/Box2D/CCPhysicsHelper.h similarity index 100% rename from cocos2dx/physics/Box2D/CCPhysicsHelper.h rename to cocos/physics/Box2D/CCPhysicsHelper.h diff --git a/cocos2dx/physics/Box2D/CCPhysicsJointInfo.cpp b/cocos/physics/Box2D/CCPhysicsJointInfo.cpp similarity index 100% rename from cocos2dx/physics/Box2D/CCPhysicsJointInfo.cpp rename to cocos/physics/Box2D/CCPhysicsJointInfo.cpp diff --git a/cocos2dx/physics/Box2D/CCPhysicsJointInfo.h b/cocos/physics/Box2D/CCPhysicsJointInfo.h similarity index 100% rename from cocos2dx/physics/Box2D/CCPhysicsJointInfo.h rename to cocos/physics/Box2D/CCPhysicsJointInfo.h diff --git a/cocos2dx/physics/Box2D/CCPhysicsShapeInfo.cpp b/cocos/physics/Box2D/CCPhysicsShapeInfo.cpp similarity index 100% rename from cocos2dx/physics/Box2D/CCPhysicsShapeInfo.cpp rename to cocos/physics/Box2D/CCPhysicsShapeInfo.cpp diff --git a/cocos2dx/physics/Box2D/CCPhysicsShapeInfo.h b/cocos/physics/Box2D/CCPhysicsShapeInfo.h similarity index 100% rename from cocos2dx/physics/Box2D/CCPhysicsShapeInfo.h rename to cocos/physics/Box2D/CCPhysicsShapeInfo.h diff --git a/cocos2dx/physics/Box2D/CCPhysicsWorldInfo.cpp b/cocos/physics/Box2D/CCPhysicsWorldInfo.cpp similarity index 100% rename from cocos2dx/physics/Box2D/CCPhysicsWorldInfo.cpp rename to cocos/physics/Box2D/CCPhysicsWorldInfo.cpp diff --git a/cocos2dx/physics/Box2D/CCPhysicsWorldInfo.h b/cocos/physics/Box2D/CCPhysicsWorldInfo.h similarity index 100% rename from cocos2dx/physics/Box2D/CCPhysicsWorldInfo.h rename to cocos/physics/Box2D/CCPhysicsWorldInfo.h diff --git a/cocos2dx/physics/CCPhysicsBody.cpp b/cocos/physics/CCPhysicsBody.cpp similarity index 100% rename from cocos2dx/physics/CCPhysicsBody.cpp rename to cocos/physics/CCPhysicsBody.cpp diff --git a/cocos2dx/physics/CCPhysicsBody.h b/cocos/physics/CCPhysicsBody.h similarity index 100% rename from cocos2dx/physics/CCPhysicsBody.h rename to cocos/physics/CCPhysicsBody.h diff --git a/cocos2dx/physics/CCPhysicsContact.cpp b/cocos/physics/CCPhysicsContact.cpp similarity index 100% rename from cocos2dx/physics/CCPhysicsContact.cpp rename to cocos/physics/CCPhysicsContact.cpp diff --git a/cocos2dx/physics/CCPhysicsContact.h b/cocos/physics/CCPhysicsContact.h similarity index 100% rename from cocos2dx/physics/CCPhysicsContact.h rename to cocos/physics/CCPhysicsContact.h diff --git a/cocos2dx/physics/CCPhysicsJoint.cpp b/cocos/physics/CCPhysicsJoint.cpp similarity index 100% rename from cocos2dx/physics/CCPhysicsJoint.cpp rename to cocos/physics/CCPhysicsJoint.cpp diff --git a/cocos2dx/physics/CCPhysicsJoint.h b/cocos/physics/CCPhysicsJoint.h similarity index 100% rename from cocos2dx/physics/CCPhysicsJoint.h rename to cocos/physics/CCPhysicsJoint.h diff --git a/cocos2dx/physics/CCPhysicsSetting.h b/cocos/physics/CCPhysicsSetting.h similarity index 100% rename from cocos2dx/physics/CCPhysicsSetting.h rename to cocos/physics/CCPhysicsSetting.h diff --git a/cocos2dx/physics/CCPhysicsShape.cpp b/cocos/physics/CCPhysicsShape.cpp similarity index 100% rename from cocos2dx/physics/CCPhysicsShape.cpp rename to cocos/physics/CCPhysicsShape.cpp diff --git a/cocos2dx/physics/CCPhysicsShape.h b/cocos/physics/CCPhysicsShape.h similarity index 100% rename from cocos2dx/physics/CCPhysicsShape.h rename to cocos/physics/CCPhysicsShape.h diff --git a/cocos2dx/physics/CCPhysicsWorld.cpp b/cocos/physics/CCPhysicsWorld.cpp similarity index 100% rename from cocos2dx/physics/CCPhysicsWorld.cpp rename to cocos/physics/CCPhysicsWorld.cpp diff --git a/cocos2dx/physics/CCPhysicsWorld.h b/cocos/physics/CCPhysicsWorld.h similarity index 100% rename from cocos2dx/physics/CCPhysicsWorld.h rename to cocos/physics/CCPhysicsWorld.h diff --git a/cocos2dx/physics/chipmunk/CCPhysicsBodyInfo.cpp b/cocos/physics/chipmunk/CCPhysicsBodyInfo.cpp similarity index 100% rename from cocos2dx/physics/chipmunk/CCPhysicsBodyInfo.cpp rename to cocos/physics/chipmunk/CCPhysicsBodyInfo.cpp diff --git a/cocos2dx/physics/chipmunk/CCPhysicsBodyInfo.h b/cocos/physics/chipmunk/CCPhysicsBodyInfo.h similarity index 100% rename from cocos2dx/physics/chipmunk/CCPhysicsBodyInfo.h rename to cocos/physics/chipmunk/CCPhysicsBodyInfo.h diff --git a/cocos2dx/physics/chipmunk/CCPhysicsContactInfo.cpp b/cocos/physics/chipmunk/CCPhysicsContactInfo.cpp similarity index 100% rename from cocos2dx/physics/chipmunk/CCPhysicsContactInfo.cpp rename to cocos/physics/chipmunk/CCPhysicsContactInfo.cpp diff --git a/cocos2dx/physics/chipmunk/CCPhysicsContactInfo.h b/cocos/physics/chipmunk/CCPhysicsContactInfo.h similarity index 100% rename from cocos2dx/physics/chipmunk/CCPhysicsContactInfo.h rename to cocos/physics/chipmunk/CCPhysicsContactInfo.h diff --git a/cocos2dx/physics/chipmunk/CCPhysicsHelper.h b/cocos/physics/chipmunk/CCPhysicsHelper.h similarity index 100% rename from cocos2dx/physics/chipmunk/CCPhysicsHelper.h rename to cocos/physics/chipmunk/CCPhysicsHelper.h diff --git a/cocos2dx/physics/chipmunk/CCPhysicsJointInfo.cpp b/cocos/physics/chipmunk/CCPhysicsJointInfo.cpp similarity index 100% rename from cocos2dx/physics/chipmunk/CCPhysicsJointInfo.cpp rename to cocos/physics/chipmunk/CCPhysicsJointInfo.cpp diff --git a/cocos2dx/physics/chipmunk/CCPhysicsJointInfo.h b/cocos/physics/chipmunk/CCPhysicsJointInfo.h similarity index 100% rename from cocos2dx/physics/chipmunk/CCPhysicsJointInfo.h rename to cocos/physics/chipmunk/CCPhysicsJointInfo.h diff --git a/cocos2dx/physics/chipmunk/CCPhysicsShapeInfo.cpp b/cocos/physics/chipmunk/CCPhysicsShapeInfo.cpp similarity index 100% rename from cocos2dx/physics/chipmunk/CCPhysicsShapeInfo.cpp rename to cocos/physics/chipmunk/CCPhysicsShapeInfo.cpp diff --git a/cocos2dx/physics/chipmunk/CCPhysicsShapeInfo.h b/cocos/physics/chipmunk/CCPhysicsShapeInfo.h similarity index 100% rename from cocos2dx/physics/chipmunk/CCPhysicsShapeInfo.h rename to cocos/physics/chipmunk/CCPhysicsShapeInfo.h diff --git a/cocos2dx/physics/chipmunk/CCPhysicsWorldInfo.cpp b/cocos/physics/chipmunk/CCPhysicsWorldInfo.cpp similarity index 100% rename from cocos2dx/physics/chipmunk/CCPhysicsWorldInfo.cpp rename to cocos/physics/chipmunk/CCPhysicsWorldInfo.cpp diff --git a/cocos2dx/physics/chipmunk/CCPhysicsWorldInfo.h b/cocos/physics/chipmunk/CCPhysicsWorldInfo.h similarity index 100% rename from cocos2dx/physics/chipmunk/CCPhysicsWorldInfo.h rename to cocos/physics/chipmunk/CCPhysicsWorldInfo.h diff --git a/cocos2dx/platform/CCPlatformConfig.h b/cocos/platform/CCPlatformConfig.h similarity index 100% rename from cocos2dx/platform/CCPlatformConfig.h rename to cocos/platform/CCPlatformConfig.h diff --git a/cocos2dx/platform/CCPlatformMacros.h b/cocos/platform/CCPlatformMacros.h similarity index 100% rename from cocos2dx/platform/CCPlatformMacros.h rename to cocos/platform/CCPlatformMacros.h diff --git a/cocos2dx/cocoa/CCAffineTransform.cpp b/cocos/platform/cocoa/CCAffineTransform.cpp similarity index 100% rename from cocos2dx/cocoa/CCAffineTransform.cpp rename to cocos/platform/cocoa/CCAffineTransform.cpp diff --git a/cocos2dx/cocoa/CCAffineTransform.h b/cocos/platform/cocoa/CCAffineTransform.h similarity index 100% rename from cocos2dx/cocoa/CCAffineTransform.h rename to cocos/platform/cocoa/CCAffineTransform.h diff --git a/cocos2dx/cocoa/CCArray.cpp b/cocos/platform/cocoa/CCArray.cpp similarity index 100% rename from cocos2dx/cocoa/CCArray.cpp rename to cocos/platform/cocoa/CCArray.cpp diff --git a/cocos2dx/cocoa/CCArray.h b/cocos/platform/cocoa/CCArray.h similarity index 100% rename from cocos2dx/cocoa/CCArray.h rename to cocos/platform/cocoa/CCArray.h diff --git a/cocos2dx/cocoa/CCAutoreleasePool.cpp b/cocos/platform/cocoa/CCAutoreleasePool.cpp similarity index 100% rename from cocos2dx/cocoa/CCAutoreleasePool.cpp rename to cocos/platform/cocoa/CCAutoreleasePool.cpp diff --git a/cocos2dx/cocoa/CCAutoreleasePool.h b/cocos/platform/cocoa/CCAutoreleasePool.h similarity index 100% rename from cocos2dx/cocoa/CCAutoreleasePool.h rename to cocos/platform/cocoa/CCAutoreleasePool.h diff --git a/cocos2dx/cocoa/CCBool.h b/cocos/platform/cocoa/CCBool.h similarity index 100% rename from cocos2dx/cocoa/CCBool.h rename to cocos/platform/cocoa/CCBool.h diff --git a/cocos2dx/cocoa/CCData.cpp b/cocos/platform/cocoa/CCData.cpp similarity index 100% rename from cocos2dx/cocoa/CCData.cpp rename to cocos/platform/cocoa/CCData.cpp diff --git a/cocos2dx/cocoa/CCData.h b/cocos/platform/cocoa/CCData.h similarity index 100% rename from cocos2dx/cocoa/CCData.h rename to cocos/platform/cocoa/CCData.h diff --git a/cocos2dx/cocoa/CCDataVisitor.cpp b/cocos/platform/cocoa/CCDataVisitor.cpp similarity index 100% rename from cocos2dx/cocoa/CCDataVisitor.cpp rename to cocos/platform/cocoa/CCDataVisitor.cpp diff --git a/cocos2dx/cocoa/CCDataVisitor.h b/cocos/platform/cocoa/CCDataVisitor.h similarity index 100% rename from cocos2dx/cocoa/CCDataVisitor.h rename to cocos/platform/cocoa/CCDataVisitor.h diff --git a/cocos2dx/cocoa/CCDictionary.cpp b/cocos/platform/cocoa/CCDictionary.cpp similarity index 100% rename from cocos2dx/cocoa/CCDictionary.cpp rename to cocos/platform/cocoa/CCDictionary.cpp diff --git a/cocos2dx/cocoa/CCDictionary.h b/cocos/platform/cocoa/CCDictionary.h similarity index 100% rename from cocos2dx/cocoa/CCDictionary.h rename to cocos/platform/cocoa/CCDictionary.h diff --git a/cocos2dx/cocoa/CCDouble.h b/cocos/platform/cocoa/CCDouble.h similarity index 100% rename from cocos2dx/cocoa/CCDouble.h rename to cocos/platform/cocoa/CCDouble.h diff --git a/cocos2dx/cocoa/CCFloat.h b/cocos/platform/cocoa/CCFloat.h similarity index 100% rename from cocos2dx/cocoa/CCFloat.h rename to cocos/platform/cocoa/CCFloat.h diff --git a/cocos2dx/cocoa/CCGeometry.cpp b/cocos/platform/cocoa/CCGeometry.cpp similarity index 100% rename from cocos2dx/cocoa/CCGeometry.cpp rename to cocos/platform/cocoa/CCGeometry.cpp diff --git a/cocos2dx/cocoa/CCGeometry.h b/cocos/platform/cocoa/CCGeometry.h similarity index 100% rename from cocos2dx/cocoa/CCGeometry.h rename to cocos/platform/cocoa/CCGeometry.h diff --git a/cocos2dx/cocoa/CCInteger.h b/cocos/platform/cocoa/CCInteger.h similarity index 100% rename from cocos2dx/cocoa/CCInteger.h rename to cocos/platform/cocoa/CCInteger.h diff --git a/cocos2dx/cocoa/CCNS.cpp b/cocos/platform/cocoa/CCNS.cpp similarity index 100% rename from cocos2dx/cocoa/CCNS.cpp rename to cocos/platform/cocoa/CCNS.cpp diff --git a/cocos2dx/cocoa/CCNS.h b/cocos/platform/cocoa/CCNS.h similarity index 100% rename from cocos2dx/cocoa/CCNS.h rename to cocos/platform/cocoa/CCNS.h diff --git a/cocos2dx/cocoa/CCObject.cpp b/cocos/platform/cocoa/CCObject.cpp similarity index 100% rename from cocos2dx/cocoa/CCObject.cpp rename to cocos/platform/cocoa/CCObject.cpp diff --git a/cocos2dx/cocoa/CCObject.h b/cocos/platform/cocoa/CCObject.h similarity index 100% rename from cocos2dx/cocoa/CCObject.h rename to cocos/platform/cocoa/CCObject.h diff --git a/cocos2dx/cocoa/CCSet.cpp b/cocos/platform/cocoa/CCSet.cpp similarity index 100% rename from cocos2dx/cocoa/CCSet.cpp rename to cocos/platform/cocoa/CCSet.cpp diff --git a/cocos2dx/cocoa/CCSet.h b/cocos/platform/cocoa/CCSet.h similarity index 100% rename from cocos2dx/cocoa/CCSet.h rename to cocos/platform/cocoa/CCSet.h diff --git a/cocos2dx/cocoa/CCString.cpp b/cocos/platform/cocoa/CCString.cpp similarity index 100% rename from cocos2dx/cocoa/CCString.cpp rename to cocos/platform/cocoa/CCString.cpp diff --git a/cocos2dx/cocoa/CCString.h b/cocos/platform/cocoa/CCString.h similarity index 100% rename from cocos2dx/cocoa/CCString.h rename to cocos/platform/cocoa/CCString.h diff --git a/cocos/scripting/auto-generated b/cocos/scripting/auto-generated new file mode 160000 index 0000000000..ba1165bab0 --- /dev/null +++ b/cocos/scripting/auto-generated @@ -0,0 +1 @@ +Subproject commit ba1165bab00a7ba34de057b28f272f31f50a303a diff --git a/scripting/javascript/bindings/Android.mk b/cocos/scripting/javascript/bindings/Android.mk similarity index 100% rename from scripting/javascript/bindings/Android.mk rename to cocos/scripting/javascript/bindings/Android.mk diff --git a/scripting/javascript/bindings/ScriptingCore.cpp b/cocos/scripting/javascript/bindings/ScriptingCore.cpp similarity index 100% rename from scripting/javascript/bindings/ScriptingCore.cpp rename to cocos/scripting/javascript/bindings/ScriptingCore.cpp diff --git a/scripting/javascript/bindings/ScriptingCore.h b/cocos/scripting/javascript/bindings/ScriptingCore.h similarity index 100% rename from scripting/javascript/bindings/ScriptingCore.h rename to cocos/scripting/javascript/bindings/ScriptingCore.h diff --git a/scripting/javascript/bindings/XMLHTTPRequest.cpp b/cocos/scripting/javascript/bindings/XMLHTTPRequest.cpp similarity index 100% rename from scripting/javascript/bindings/XMLHTTPRequest.cpp rename to cocos/scripting/javascript/bindings/XMLHTTPRequest.cpp diff --git a/scripting/javascript/bindings/XMLHTTPRequest.h b/cocos/scripting/javascript/bindings/XMLHTTPRequest.h similarity index 100% rename from scripting/javascript/bindings/XMLHTTPRequest.h rename to cocos/scripting/javascript/bindings/XMLHTTPRequest.h diff --git a/scripting/javascript/bindings/cocos2d_specifics.cpp.REMOVED.git-id b/cocos/scripting/javascript/bindings/cocos2d_specifics.cpp.REMOVED.git-id similarity index 100% rename from scripting/javascript/bindings/cocos2d_specifics.cpp.REMOVED.git-id rename to cocos/scripting/javascript/bindings/cocos2d_specifics.cpp.REMOVED.git-id diff --git a/scripting/javascript/bindings/cocos2d_specifics.hpp b/cocos/scripting/javascript/bindings/cocos2d_specifics.hpp similarity index 100% rename from scripting/javascript/bindings/cocos2d_specifics.hpp rename to cocos/scripting/javascript/bindings/cocos2d_specifics.hpp diff --git a/scripting/javascript/bindings/cocosjs_manual_conversions.cpp b/cocos/scripting/javascript/bindings/cocosjs_manual_conversions.cpp similarity index 100% rename from scripting/javascript/bindings/cocosjs_manual_conversions.cpp rename to cocos/scripting/javascript/bindings/cocosjs_manual_conversions.cpp diff --git a/scripting/javascript/bindings/cocosjs_manual_conversions.h b/cocos/scripting/javascript/bindings/cocosjs_manual_conversions.h similarity index 100% rename from scripting/javascript/bindings/cocosjs_manual_conversions.h rename to cocos/scripting/javascript/bindings/cocosjs_manual_conversions.h diff --git a/scripting/javascript/bindings/js/jsb.js b/cocos/scripting/javascript/bindings/js/jsb.js similarity index 100% rename from scripting/javascript/bindings/js/jsb.js rename to cocos/scripting/javascript/bindings/js/jsb.js diff --git a/scripting/javascript/bindings/js/jsb_chipmunk.js b/cocos/scripting/javascript/bindings/js/jsb_chipmunk.js similarity index 100% rename from scripting/javascript/bindings/js/jsb_chipmunk.js rename to cocos/scripting/javascript/bindings/js/jsb_chipmunk.js diff --git a/scripting/javascript/bindings/js/jsb_chipmunk_constants.js b/cocos/scripting/javascript/bindings/js/jsb_chipmunk_constants.js similarity index 100% rename from scripting/javascript/bindings/js/jsb_chipmunk_constants.js rename to cocos/scripting/javascript/bindings/js/jsb_chipmunk_constants.js diff --git a/scripting/javascript/bindings/js/jsb_cocos2d.js b/cocos/scripting/javascript/bindings/js/jsb_cocos2d.js similarity index 100% rename from scripting/javascript/bindings/js/jsb_cocos2d.js rename to cocos/scripting/javascript/bindings/js/jsb_cocos2d.js diff --git a/scripting/javascript/bindings/js/jsb_cocos2d_constants.js b/cocos/scripting/javascript/bindings/js/jsb_cocos2d_constants.js similarity index 100% rename from scripting/javascript/bindings/js/jsb_cocos2d_constants.js rename to cocos/scripting/javascript/bindings/js/jsb_cocos2d_constants.js diff --git a/scripting/javascript/bindings/js/jsb_cocos2d_extension.js b/cocos/scripting/javascript/bindings/js/jsb_cocos2d_extension.js similarity index 100% rename from scripting/javascript/bindings/js/jsb_cocos2d_extension.js rename to cocos/scripting/javascript/bindings/js/jsb_cocos2d_extension.js diff --git a/scripting/javascript/bindings/js/jsb_cocosbuilder.js b/cocos/scripting/javascript/bindings/js/jsb_cocosbuilder.js similarity index 100% rename from scripting/javascript/bindings/js/jsb_cocosbuilder.js rename to cocos/scripting/javascript/bindings/js/jsb_cocosbuilder.js diff --git a/scripting/javascript/bindings/js/jsb_debugger.js b/cocos/scripting/javascript/bindings/js/jsb_debugger.js similarity index 100% rename from scripting/javascript/bindings/js/jsb_debugger.js rename to cocos/scripting/javascript/bindings/js/jsb_debugger.js diff --git a/scripting/javascript/bindings/js/jsb_deprecated.js b/cocos/scripting/javascript/bindings/js/jsb_deprecated.js similarity index 100% rename from scripting/javascript/bindings/js/jsb_deprecated.js rename to cocos/scripting/javascript/bindings/js/jsb_deprecated.js diff --git a/scripting/javascript/bindings/js/jsb_opengl.js b/cocos/scripting/javascript/bindings/js/jsb_opengl.js similarity index 100% rename from scripting/javascript/bindings/js/jsb_opengl.js rename to cocos/scripting/javascript/bindings/js/jsb_opengl.js diff --git a/scripting/javascript/bindings/js/jsb_opengl_constants.js b/cocos/scripting/javascript/bindings/js/jsb_opengl_constants.js similarity index 100% rename from scripting/javascript/bindings/js/jsb_opengl_constants.js rename to cocos/scripting/javascript/bindings/js/jsb_opengl_constants.js diff --git a/scripting/javascript/bindings/js/jsb_sys.js b/cocos/scripting/javascript/bindings/js/jsb_sys.js similarity index 100% rename from scripting/javascript/bindings/js/jsb_sys.js rename to cocos/scripting/javascript/bindings/js/jsb_sys.js diff --git a/scripting/javascript/bindings/js_bindings_ccbreader.cpp b/cocos/scripting/javascript/bindings/js_bindings_ccbreader.cpp similarity index 100% rename from scripting/javascript/bindings/js_bindings_ccbreader.cpp rename to cocos/scripting/javascript/bindings/js_bindings_ccbreader.cpp diff --git a/scripting/javascript/bindings/js_bindings_ccbreader.h b/cocos/scripting/javascript/bindings/js_bindings_ccbreader.h similarity index 100% rename from scripting/javascript/bindings/js_bindings_ccbreader.h rename to cocos/scripting/javascript/bindings/js_bindings_ccbreader.h diff --git a/scripting/javascript/bindings/js_bindings_chipmunk_auto_classes.cpp.REMOVED.git-id b/cocos/scripting/javascript/bindings/js_bindings_chipmunk_auto_classes.cpp.REMOVED.git-id similarity index 100% rename from scripting/javascript/bindings/js_bindings_chipmunk_auto_classes.cpp.REMOVED.git-id rename to cocos/scripting/javascript/bindings/js_bindings_chipmunk_auto_classes.cpp.REMOVED.git-id diff --git a/scripting/javascript/bindings/js_bindings_chipmunk_auto_classes.h b/cocos/scripting/javascript/bindings/js_bindings_chipmunk_auto_classes.h similarity index 100% rename from scripting/javascript/bindings/js_bindings_chipmunk_auto_classes.h rename to cocos/scripting/javascript/bindings/js_bindings_chipmunk_auto_classes.h diff --git a/scripting/javascript/bindings/js_bindings_chipmunk_auto_classes_registration.h b/cocos/scripting/javascript/bindings/js_bindings_chipmunk_auto_classes_registration.h similarity index 100% rename from scripting/javascript/bindings/js_bindings_chipmunk_auto_classes_registration.h rename to cocos/scripting/javascript/bindings/js_bindings_chipmunk_auto_classes_registration.h diff --git a/scripting/javascript/bindings/js_bindings_chipmunk_functions.cpp.REMOVED.git-id b/cocos/scripting/javascript/bindings/js_bindings_chipmunk_functions.cpp.REMOVED.git-id similarity index 100% rename from scripting/javascript/bindings/js_bindings_chipmunk_functions.cpp.REMOVED.git-id rename to cocos/scripting/javascript/bindings/js_bindings_chipmunk_functions.cpp.REMOVED.git-id diff --git a/scripting/javascript/bindings/js_bindings_chipmunk_functions.h b/cocos/scripting/javascript/bindings/js_bindings_chipmunk_functions.h similarity index 100% rename from scripting/javascript/bindings/js_bindings_chipmunk_functions.h rename to cocos/scripting/javascript/bindings/js_bindings_chipmunk_functions.h diff --git a/scripting/javascript/bindings/js_bindings_chipmunk_functions_registration.h b/cocos/scripting/javascript/bindings/js_bindings_chipmunk_functions_registration.h similarity index 100% rename from scripting/javascript/bindings/js_bindings_chipmunk_functions_registration.h rename to cocos/scripting/javascript/bindings/js_bindings_chipmunk_functions_registration.h diff --git a/scripting/javascript/bindings/js_bindings_chipmunk_manual.cpp b/cocos/scripting/javascript/bindings/js_bindings_chipmunk_manual.cpp similarity index 100% rename from scripting/javascript/bindings/js_bindings_chipmunk_manual.cpp rename to cocos/scripting/javascript/bindings/js_bindings_chipmunk_manual.cpp diff --git a/scripting/javascript/bindings/js_bindings_chipmunk_manual.h b/cocos/scripting/javascript/bindings/js_bindings_chipmunk_manual.h similarity index 100% rename from scripting/javascript/bindings/js_bindings_chipmunk_manual.h rename to cocos/scripting/javascript/bindings/js_bindings_chipmunk_manual.h diff --git a/scripting/javascript/bindings/js_bindings_chipmunk_registration.cpp b/cocos/scripting/javascript/bindings/js_bindings_chipmunk_registration.cpp similarity index 100% rename from scripting/javascript/bindings/js_bindings_chipmunk_registration.cpp rename to cocos/scripting/javascript/bindings/js_bindings_chipmunk_registration.cpp diff --git a/scripting/javascript/bindings/js_bindings_chipmunk_registration.h b/cocos/scripting/javascript/bindings/js_bindings_chipmunk_registration.h similarity index 100% rename from scripting/javascript/bindings/js_bindings_chipmunk_registration.h rename to cocos/scripting/javascript/bindings/js_bindings_chipmunk_registration.h diff --git a/scripting/javascript/bindings/js_bindings_config.h b/cocos/scripting/javascript/bindings/js_bindings_config.h similarity index 100% rename from scripting/javascript/bindings/js_bindings_config.h rename to cocos/scripting/javascript/bindings/js_bindings_config.h diff --git a/scripting/javascript/bindings/js_bindings_core.cpp b/cocos/scripting/javascript/bindings/js_bindings_core.cpp similarity index 100% rename from scripting/javascript/bindings/js_bindings_core.cpp rename to cocos/scripting/javascript/bindings/js_bindings_core.cpp diff --git a/scripting/javascript/bindings/js_bindings_core.h b/cocos/scripting/javascript/bindings/js_bindings_core.h similarity index 100% rename from scripting/javascript/bindings/js_bindings_core.h rename to cocos/scripting/javascript/bindings/js_bindings_core.h diff --git a/scripting/javascript/bindings/js_bindings_opengl.cpp b/cocos/scripting/javascript/bindings/js_bindings_opengl.cpp similarity index 100% rename from scripting/javascript/bindings/js_bindings_opengl.cpp rename to cocos/scripting/javascript/bindings/js_bindings_opengl.cpp diff --git a/scripting/javascript/bindings/js_bindings_opengl.h b/cocos/scripting/javascript/bindings/js_bindings_opengl.h similarity index 100% rename from scripting/javascript/bindings/js_bindings_opengl.h rename to cocos/scripting/javascript/bindings/js_bindings_opengl.h diff --git a/scripting/javascript/bindings/js_bindings_system_functions.cpp b/cocos/scripting/javascript/bindings/js_bindings_system_functions.cpp similarity index 100% rename from scripting/javascript/bindings/js_bindings_system_functions.cpp rename to cocos/scripting/javascript/bindings/js_bindings_system_functions.cpp diff --git a/scripting/javascript/bindings/js_bindings_system_functions.h b/cocos/scripting/javascript/bindings/js_bindings_system_functions.h similarity index 100% rename from scripting/javascript/bindings/js_bindings_system_functions.h rename to cocos/scripting/javascript/bindings/js_bindings_system_functions.h diff --git a/scripting/javascript/bindings/js_bindings_system_functions_registration.h b/cocos/scripting/javascript/bindings/js_bindings_system_functions_registration.h similarity index 100% rename from scripting/javascript/bindings/js_bindings_system_functions_registration.h rename to cocos/scripting/javascript/bindings/js_bindings_system_functions_registration.h diff --git a/scripting/javascript/bindings/js_bindings_system_registration.cpp b/cocos/scripting/javascript/bindings/js_bindings_system_registration.cpp similarity index 100% rename from scripting/javascript/bindings/js_bindings_system_registration.cpp rename to cocos/scripting/javascript/bindings/js_bindings_system_registration.cpp diff --git a/scripting/javascript/bindings/js_bindings_system_registration.h b/cocos/scripting/javascript/bindings/js_bindings_system_registration.h similarity index 100% rename from scripting/javascript/bindings/js_bindings_system_registration.h rename to cocos/scripting/javascript/bindings/js_bindings_system_registration.h diff --git a/scripting/javascript/bindings/js_manual_conversions.cpp b/cocos/scripting/javascript/bindings/js_manual_conversions.cpp similarity index 100% rename from scripting/javascript/bindings/js_manual_conversions.cpp rename to cocos/scripting/javascript/bindings/js_manual_conversions.cpp diff --git a/scripting/javascript/bindings/js_manual_conversions.h b/cocos/scripting/javascript/bindings/js_manual_conversions.h similarity index 100% rename from scripting/javascript/bindings/js_manual_conversions.h rename to cocos/scripting/javascript/bindings/js_manual_conversions.h diff --git a/scripting/javascript/bindings/jsb_cocos2dx_extension_manual.cpp b/cocos/scripting/javascript/bindings/jsb_cocos2dx_extension_manual.cpp similarity index 100% rename from scripting/javascript/bindings/jsb_cocos2dx_extension_manual.cpp rename to cocos/scripting/javascript/bindings/jsb_cocos2dx_extension_manual.cpp diff --git a/scripting/javascript/bindings/jsb_cocos2dx_extension_manual.h b/cocos/scripting/javascript/bindings/jsb_cocos2dx_extension_manual.h similarity index 100% rename from scripting/javascript/bindings/jsb_cocos2dx_extension_manual.h rename to cocos/scripting/javascript/bindings/jsb_cocos2dx_extension_manual.h diff --git a/scripting/javascript/bindings/jsb_helper.h b/cocos/scripting/javascript/bindings/jsb_helper.h similarity index 100% rename from scripting/javascript/bindings/jsb_helper.h rename to cocos/scripting/javascript/bindings/jsb_helper.h diff --git a/scripting/javascript/bindings/jsb_opengl_functions.cpp b/cocos/scripting/javascript/bindings/jsb_opengl_functions.cpp similarity index 100% rename from scripting/javascript/bindings/jsb_opengl_functions.cpp rename to cocos/scripting/javascript/bindings/jsb_opengl_functions.cpp diff --git a/scripting/javascript/bindings/jsb_opengl_functions.h b/cocos/scripting/javascript/bindings/jsb_opengl_functions.h similarity index 100% rename from scripting/javascript/bindings/jsb_opengl_functions.h rename to cocos/scripting/javascript/bindings/jsb_opengl_functions.h diff --git a/scripting/javascript/bindings/jsb_opengl_manual.cpp b/cocos/scripting/javascript/bindings/jsb_opengl_manual.cpp similarity index 100% rename from scripting/javascript/bindings/jsb_opengl_manual.cpp rename to cocos/scripting/javascript/bindings/jsb_opengl_manual.cpp diff --git a/scripting/javascript/bindings/jsb_opengl_manual.h b/cocos/scripting/javascript/bindings/jsb_opengl_manual.h similarity index 100% rename from scripting/javascript/bindings/jsb_opengl_manual.h rename to cocos/scripting/javascript/bindings/jsb_opengl_manual.h diff --git a/scripting/javascript/bindings/jsb_opengl_registration.cpp b/cocos/scripting/javascript/bindings/jsb_opengl_registration.cpp similarity index 100% rename from scripting/javascript/bindings/jsb_opengl_registration.cpp rename to cocos/scripting/javascript/bindings/jsb_opengl_registration.cpp diff --git a/scripting/javascript/bindings/jsb_opengl_registration.h b/cocos/scripting/javascript/bindings/jsb_opengl_registration.h similarity index 100% rename from scripting/javascript/bindings/jsb_opengl_registration.h rename to cocos/scripting/javascript/bindings/jsb_opengl_registration.h diff --git a/scripting/javascript/bindings/jsb_websocket.cpp b/cocos/scripting/javascript/bindings/jsb_websocket.cpp similarity index 100% rename from scripting/javascript/bindings/jsb_websocket.cpp rename to cocos/scripting/javascript/bindings/jsb_websocket.cpp diff --git a/scripting/javascript/bindings/jsb_websocket.h b/cocos/scripting/javascript/bindings/jsb_websocket.h similarity index 100% rename from scripting/javascript/bindings/jsb_websocket.h rename to cocos/scripting/javascript/bindings/jsb_websocket.h diff --git a/scripting/javascript/bindings/obfuscate/obfuscate_exclude_chipmunk.js b/cocos/scripting/javascript/bindings/obfuscate/obfuscate_exclude_chipmunk.js similarity index 100% rename from scripting/javascript/bindings/obfuscate/obfuscate_exclude_chipmunk.js rename to cocos/scripting/javascript/bindings/obfuscate/obfuscate_exclude_chipmunk.js diff --git a/scripting/javascript/bindings/obfuscate/obfuscate_exclude_cocos2d.js.REMOVED.git-id b/cocos/scripting/javascript/bindings/obfuscate/obfuscate_exclude_cocos2d.js.REMOVED.git-id similarity index 100% rename from scripting/javascript/bindings/obfuscate/obfuscate_exclude_cocos2d.js.REMOVED.git-id rename to cocos/scripting/javascript/bindings/obfuscate/obfuscate_exclude_cocos2d.js.REMOVED.git-id diff --git a/scripting/javascript/bindings/proj.ios/jsbindings-Prefix.pch b/cocos/scripting/javascript/bindings/proj.ios/jsbindings-Prefix.pch similarity index 100% rename from scripting/javascript/bindings/proj.ios/jsbindings-Prefix.pch rename to cocos/scripting/javascript/bindings/proj.ios/jsbindings-Prefix.pch diff --git a/scripting/javascript/bindings/proj.ios/jsbindings.xcodeproj/project.pbxproj b/cocos/scripting/javascript/bindings/proj.ios/jsbindings.xcodeproj/project.pbxproj similarity index 100% rename from scripting/javascript/bindings/proj.ios/jsbindings.xcodeproj/project.pbxproj rename to cocos/scripting/javascript/bindings/proj.ios/jsbindings.xcodeproj/project.pbxproj diff --git a/scripting/javascript/bindings/proj.mac/jsbindings-Prefix.pch b/cocos/scripting/javascript/bindings/proj.mac/jsbindings-Prefix.pch similarity index 100% rename from scripting/javascript/bindings/proj.mac/jsbindings-Prefix.pch rename to cocos/scripting/javascript/bindings/proj.mac/jsbindings-Prefix.pch diff --git a/scripting/javascript/bindings/proj.mac/jsbindings.xcodeproj/project.pbxproj b/cocos/scripting/javascript/bindings/proj.mac/jsbindings.xcodeproj/project.pbxproj similarity index 100% rename from scripting/javascript/bindings/proj.mac/jsbindings.xcodeproj/project.pbxproj rename to cocos/scripting/javascript/bindings/proj.mac/jsbindings.xcodeproj/project.pbxproj diff --git a/scripting/javascript/bindings/proj.win32/libJSBinding.vcxproj b/cocos/scripting/javascript/bindings/proj.win32/libJSBinding.vcxproj similarity index 100% rename from scripting/javascript/bindings/proj.win32/libJSBinding.vcxproj rename to cocos/scripting/javascript/bindings/proj.win32/libJSBinding.vcxproj diff --git a/scripting/javascript/bindings/proj.win32/libJSBinding.vcxproj.filters b/cocos/scripting/javascript/bindings/proj.win32/libJSBinding.vcxproj.filters similarity index 100% rename from scripting/javascript/bindings/proj.win32/libJSBinding.vcxproj.filters rename to cocos/scripting/javascript/bindings/proj.win32/libJSBinding.vcxproj.filters diff --git a/scripting/javascript/bindings/proj.win32/libJSBinding.vcxproj.user b/cocos/scripting/javascript/bindings/proj.win32/libJSBinding.vcxproj.user similarity index 100% rename from scripting/javascript/bindings/proj.win32/libJSBinding.vcxproj.user rename to cocos/scripting/javascript/bindings/proj.win32/libJSBinding.vcxproj.user diff --git a/scripting/javascript/bindings/spidermonkey_specifics.h b/cocos/scripting/javascript/bindings/spidermonkey_specifics.h similarity index 100% rename from scripting/javascript/bindings/spidermonkey_specifics.h rename to cocos/scripting/javascript/bindings/spidermonkey_specifics.h diff --git a/scripting/lua/cocos2dx_support/CCBProxy.cpp b/cocos/scripting/lua/cocos2dx_support/CCBProxy.cpp similarity index 100% rename from scripting/lua/cocos2dx_support/CCBProxy.cpp rename to cocos/scripting/lua/cocos2dx_support/CCBProxy.cpp diff --git a/scripting/lua/cocos2dx_support/CCBProxy.h b/cocos/scripting/lua/cocos2dx_support/CCBProxy.h similarity index 100% rename from scripting/lua/cocos2dx_support/CCBProxy.h rename to cocos/scripting/lua/cocos2dx_support/CCBProxy.h diff --git a/scripting/lua/cocos2dx_support/CCLuaBridge.cpp b/cocos/scripting/lua/cocos2dx_support/CCLuaBridge.cpp similarity index 100% rename from scripting/lua/cocos2dx_support/CCLuaBridge.cpp rename to cocos/scripting/lua/cocos2dx_support/CCLuaBridge.cpp diff --git a/scripting/lua/cocos2dx_support/CCLuaBridge.h b/cocos/scripting/lua/cocos2dx_support/CCLuaBridge.h similarity index 100% rename from scripting/lua/cocos2dx_support/CCLuaBridge.h rename to cocos/scripting/lua/cocos2dx_support/CCLuaBridge.h diff --git a/scripting/lua/cocos2dx_support/CCLuaEngine.cpp b/cocos/scripting/lua/cocos2dx_support/CCLuaEngine.cpp similarity index 100% rename from scripting/lua/cocos2dx_support/CCLuaEngine.cpp rename to cocos/scripting/lua/cocos2dx_support/CCLuaEngine.cpp diff --git a/scripting/lua/cocos2dx_support/CCLuaEngine.h b/cocos/scripting/lua/cocos2dx_support/CCLuaEngine.h similarity index 100% rename from scripting/lua/cocos2dx_support/CCLuaEngine.h rename to cocos/scripting/lua/cocos2dx_support/CCLuaEngine.h diff --git a/scripting/lua/cocos2dx_support/CCLuaStack.cpp b/cocos/scripting/lua/cocos2dx_support/CCLuaStack.cpp similarity index 100% rename from scripting/lua/cocos2dx_support/CCLuaStack.cpp rename to cocos/scripting/lua/cocos2dx_support/CCLuaStack.cpp diff --git a/scripting/lua/cocos2dx_support/CCLuaStack.h b/cocos/scripting/lua/cocos2dx_support/CCLuaStack.h similarity index 100% rename from scripting/lua/cocos2dx_support/CCLuaStack.h rename to cocos/scripting/lua/cocos2dx_support/CCLuaStack.h diff --git a/scripting/lua/cocos2dx_support/CCLuaValue.cpp b/cocos/scripting/lua/cocos2dx_support/CCLuaValue.cpp similarity index 100% rename from scripting/lua/cocos2dx_support/CCLuaValue.cpp rename to cocos/scripting/lua/cocos2dx_support/CCLuaValue.cpp diff --git a/scripting/lua/cocos2dx_support/CCLuaValue.h b/cocos/scripting/lua/cocos2dx_support/CCLuaValue.h similarity index 100% rename from scripting/lua/cocos2dx_support/CCLuaValue.h rename to cocos/scripting/lua/cocos2dx_support/CCLuaValue.h diff --git a/scripting/lua/cocos2dx_support/Cocos2dxLuaLoader.cpp b/cocos/scripting/lua/cocos2dx_support/Cocos2dxLuaLoader.cpp similarity index 100% rename from scripting/lua/cocos2dx_support/Cocos2dxLuaLoader.cpp rename to cocos/scripting/lua/cocos2dx_support/Cocos2dxLuaLoader.cpp diff --git a/scripting/lua/cocos2dx_support/Cocos2dxLuaLoader.h b/cocos/scripting/lua/cocos2dx_support/Cocos2dxLuaLoader.h similarity index 100% rename from scripting/lua/cocos2dx_support/Cocos2dxLuaLoader.h rename to cocos/scripting/lua/cocos2dx_support/Cocos2dxLuaLoader.h diff --git a/scripting/lua/cocos2dx_support/LuaBasicConversions.cpp b/cocos/scripting/lua/cocos2dx_support/LuaBasicConversions.cpp similarity index 100% rename from scripting/lua/cocos2dx_support/LuaBasicConversions.cpp rename to cocos/scripting/lua/cocos2dx_support/LuaBasicConversions.cpp diff --git a/scripting/lua/cocos2dx_support/LuaBasicConversions.h b/cocos/scripting/lua/cocos2dx_support/LuaBasicConversions.h similarity index 100% rename from scripting/lua/cocos2dx_support/LuaBasicConversions.h rename to cocos/scripting/lua/cocos2dx_support/LuaBasicConversions.h diff --git a/scripting/lua/cocos2dx_support/LuaOpengl.cpp.REMOVED.git-id b/cocos/scripting/lua/cocos2dx_support/LuaOpengl.cpp.REMOVED.git-id similarity index 100% rename from scripting/lua/cocos2dx_support/LuaOpengl.cpp.REMOVED.git-id rename to cocos/scripting/lua/cocos2dx_support/LuaOpengl.cpp.REMOVED.git-id diff --git a/scripting/lua/cocos2dx_support/LuaOpengl.h b/cocos/scripting/lua/cocos2dx_support/LuaOpengl.h similarity index 100% rename from scripting/lua/cocos2dx_support/LuaOpengl.h rename to cocos/scripting/lua/cocos2dx_support/LuaOpengl.h diff --git a/scripting/lua/cocos2dx_support/LuaScriptHandlerMgr.cpp b/cocos/scripting/lua/cocos2dx_support/LuaScriptHandlerMgr.cpp similarity index 100% rename from scripting/lua/cocos2dx_support/LuaScriptHandlerMgr.cpp rename to cocos/scripting/lua/cocos2dx_support/LuaScriptHandlerMgr.cpp diff --git a/scripting/lua/cocos2dx_support/LuaScriptHandlerMgr.h b/cocos/scripting/lua/cocos2dx_support/LuaScriptHandlerMgr.h similarity index 100% rename from scripting/lua/cocos2dx_support/LuaScriptHandlerMgr.h rename to cocos/scripting/lua/cocos2dx_support/LuaScriptHandlerMgr.h diff --git a/scripting/lua/cocos2dx_support/Lua_web_socket.cpp b/cocos/scripting/lua/cocos2dx_support/Lua_web_socket.cpp similarity index 100% rename from scripting/lua/cocos2dx_support/Lua_web_socket.cpp rename to cocos/scripting/lua/cocos2dx_support/Lua_web_socket.cpp diff --git a/scripting/lua/cocos2dx_support/Lua_web_socket.h b/cocos/scripting/lua/cocos2dx_support/Lua_web_socket.h similarity index 100% rename from scripting/lua/cocos2dx_support/Lua_web_socket.h rename to cocos/scripting/lua/cocos2dx_support/Lua_web_socket.h diff --git a/scripting/lua/cocos2dx_support/lua_cocos2dx_deprecated.cpp.REMOVED.git-id b/cocos/scripting/lua/cocos2dx_support/lua_cocos2dx_deprecated.cpp.REMOVED.git-id similarity index 100% rename from scripting/lua/cocos2dx_support/lua_cocos2dx_deprecated.cpp.REMOVED.git-id rename to cocos/scripting/lua/cocos2dx_support/lua_cocos2dx_deprecated.cpp.REMOVED.git-id diff --git a/scripting/lua/cocos2dx_support/lua_cocos2dx_deprecated.h b/cocos/scripting/lua/cocos2dx_support/lua_cocos2dx_deprecated.h similarity index 100% rename from scripting/lua/cocos2dx_support/lua_cocos2dx_deprecated.h rename to cocos/scripting/lua/cocos2dx_support/lua_cocos2dx_deprecated.h diff --git a/scripting/lua/cocos2dx_support/lua_cocos2dx_extension_manual.cpp b/cocos/scripting/lua/cocos2dx_support/lua_cocos2dx_extension_manual.cpp similarity index 100% rename from scripting/lua/cocos2dx_support/lua_cocos2dx_extension_manual.cpp rename to cocos/scripting/lua/cocos2dx_support/lua_cocos2dx_extension_manual.cpp diff --git a/scripting/lua/cocos2dx_support/lua_cocos2dx_extension_manual.h b/cocos/scripting/lua/cocos2dx_support/lua_cocos2dx_extension_manual.h similarity index 100% rename from scripting/lua/cocos2dx_support/lua_cocos2dx_extension_manual.h rename to cocos/scripting/lua/cocos2dx_support/lua_cocos2dx_extension_manual.h diff --git a/scripting/lua/cocos2dx_support/lua_cocos2dx_manual.cpp b/cocos/scripting/lua/cocos2dx_support/lua_cocos2dx_manual.cpp similarity index 100% rename from scripting/lua/cocos2dx_support/lua_cocos2dx_manual.cpp rename to cocos/scripting/lua/cocos2dx_support/lua_cocos2dx_manual.cpp diff --git a/scripting/lua/cocos2dx_support/lua_cocos2dx_manual.hpp b/cocos/scripting/lua/cocos2dx_support/lua_cocos2dx_manual.hpp similarity index 100% rename from scripting/lua/cocos2dx_support/lua_cocos2dx_manual.hpp rename to cocos/scripting/lua/cocos2dx_support/lua_cocos2dx_manual.hpp diff --git a/scripting/lua/cocos2dx_support/platform/android/CCLuaJavaBridge.cpp b/cocos/scripting/lua/cocos2dx_support/platform/android/CCLuaJavaBridge.cpp similarity index 100% rename from scripting/lua/cocos2dx_support/platform/android/CCLuaJavaBridge.cpp rename to cocos/scripting/lua/cocos2dx_support/platform/android/CCLuaJavaBridge.cpp diff --git a/scripting/lua/cocos2dx_support/platform/android/CCLuaJavaBridge.h b/cocos/scripting/lua/cocos2dx_support/platform/android/CCLuaJavaBridge.h similarity index 100% rename from scripting/lua/cocos2dx_support/platform/android/CCLuaJavaBridge.h rename to cocos/scripting/lua/cocos2dx_support/platform/android/CCLuaJavaBridge.h diff --git a/scripting/lua/cocos2dx_support/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge.cpp b/cocos/scripting/lua/cocos2dx_support/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge.cpp similarity index 100% rename from scripting/lua/cocos2dx_support/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge.cpp rename to cocos/scripting/lua/cocos2dx_support/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge.cpp diff --git a/scripting/lua/cocos2dx_support/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge.h b/cocos/scripting/lua/cocos2dx_support/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge.h similarity index 100% rename from scripting/lua/cocos2dx_support/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge.h rename to cocos/scripting/lua/cocos2dx_support/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge.h diff --git a/scripting/lua/cocos2dx_support/platform/ios/CCLuaObjcBridge.h b/cocos/scripting/lua/cocos2dx_support/platform/ios/CCLuaObjcBridge.h similarity index 100% rename from scripting/lua/cocos2dx_support/platform/ios/CCLuaObjcBridge.h rename to cocos/scripting/lua/cocos2dx_support/platform/ios/CCLuaObjcBridge.h diff --git a/scripting/lua/cocos2dx_support/platform/ios/CCLuaObjcBridge.mm b/cocos/scripting/lua/cocos2dx_support/platform/ios/CCLuaObjcBridge.mm similarity index 100% rename from scripting/lua/cocos2dx_support/platform/ios/CCLuaObjcBridge.mm rename to cocos/scripting/lua/cocos2dx_support/platform/ios/CCLuaObjcBridge.mm diff --git a/scripting/lua/cocos2dx_support/tolua_fix.c b/cocos/scripting/lua/cocos2dx_support/tolua_fix.c similarity index 100% rename from scripting/lua/cocos2dx_support/tolua_fix.c rename to cocos/scripting/lua/cocos2dx_support/tolua_fix.c diff --git a/scripting/lua/cocos2dx_support/tolua_fix.h b/cocos/scripting/lua/cocos2dx_support/tolua_fix.h similarity index 100% rename from scripting/lua/cocos2dx_support/tolua_fix.h rename to cocos/scripting/lua/cocos2dx_support/tolua_fix.h diff --git a/scripting/lua/lua/lapi.c b/cocos/scripting/lua/lua/lapi.c similarity index 100% rename from scripting/lua/lua/lapi.c rename to cocos/scripting/lua/lua/lapi.c diff --git a/scripting/lua/lua/lapi.h b/cocos/scripting/lua/lua/lapi.h similarity index 100% rename from scripting/lua/lua/lapi.h rename to cocos/scripting/lua/lua/lapi.h diff --git a/scripting/lua/lua/lauxlib.c b/cocos/scripting/lua/lua/lauxlib.c similarity index 100% rename from scripting/lua/lua/lauxlib.c rename to cocos/scripting/lua/lua/lauxlib.c diff --git a/scripting/lua/lua/lauxlib.h b/cocos/scripting/lua/lua/lauxlib.h similarity index 100% rename from scripting/lua/lua/lauxlib.h rename to cocos/scripting/lua/lua/lauxlib.h diff --git a/scripting/lua/lua/lbaselib.c b/cocos/scripting/lua/lua/lbaselib.c similarity index 100% rename from scripting/lua/lua/lbaselib.c rename to cocos/scripting/lua/lua/lbaselib.c diff --git a/scripting/lua/lua/lcode.c b/cocos/scripting/lua/lua/lcode.c similarity index 100% rename from scripting/lua/lua/lcode.c rename to cocos/scripting/lua/lua/lcode.c diff --git a/scripting/lua/lua/lcode.h b/cocos/scripting/lua/lua/lcode.h similarity index 100% rename from scripting/lua/lua/lcode.h rename to cocos/scripting/lua/lua/lcode.h diff --git a/scripting/lua/lua/ldblib.c b/cocos/scripting/lua/lua/ldblib.c similarity index 100% rename from scripting/lua/lua/ldblib.c rename to cocos/scripting/lua/lua/ldblib.c diff --git a/scripting/lua/lua/ldebug.c b/cocos/scripting/lua/lua/ldebug.c similarity index 100% rename from scripting/lua/lua/ldebug.c rename to cocos/scripting/lua/lua/ldebug.c diff --git a/scripting/lua/lua/ldebug.h b/cocos/scripting/lua/lua/ldebug.h similarity index 100% rename from scripting/lua/lua/ldebug.h rename to cocos/scripting/lua/lua/ldebug.h diff --git a/scripting/lua/lua/ldo.c b/cocos/scripting/lua/lua/ldo.c similarity index 100% rename from scripting/lua/lua/ldo.c rename to cocos/scripting/lua/lua/ldo.c diff --git a/scripting/lua/lua/ldo.h b/cocos/scripting/lua/lua/ldo.h similarity index 100% rename from scripting/lua/lua/ldo.h rename to cocos/scripting/lua/lua/ldo.h diff --git a/scripting/lua/lua/ldump.c b/cocos/scripting/lua/lua/ldump.c similarity index 100% rename from scripting/lua/lua/ldump.c rename to cocos/scripting/lua/lua/ldump.c diff --git a/scripting/lua/lua/lfunc.c b/cocos/scripting/lua/lua/lfunc.c similarity index 100% rename from scripting/lua/lua/lfunc.c rename to cocos/scripting/lua/lua/lfunc.c diff --git a/scripting/lua/lua/lfunc.h b/cocos/scripting/lua/lua/lfunc.h similarity index 100% rename from scripting/lua/lua/lfunc.h rename to cocos/scripting/lua/lua/lfunc.h diff --git a/scripting/lua/lua/lgc.c b/cocos/scripting/lua/lua/lgc.c similarity index 100% rename from scripting/lua/lua/lgc.c rename to cocos/scripting/lua/lua/lgc.c diff --git a/scripting/lua/lua/lgc.h b/cocos/scripting/lua/lua/lgc.h similarity index 100% rename from scripting/lua/lua/lgc.h rename to cocos/scripting/lua/lua/lgc.h diff --git a/scripting/lua/lua/linit.c b/cocos/scripting/lua/lua/linit.c similarity index 100% rename from scripting/lua/lua/linit.c rename to cocos/scripting/lua/lua/linit.c diff --git a/scripting/lua/lua/liolib.c b/cocos/scripting/lua/lua/liolib.c similarity index 100% rename from scripting/lua/lua/liolib.c rename to cocos/scripting/lua/lua/liolib.c diff --git a/scripting/lua/lua/llex.c b/cocos/scripting/lua/lua/llex.c similarity index 100% rename from scripting/lua/lua/llex.c rename to cocos/scripting/lua/lua/llex.c diff --git a/scripting/lua/lua/llex.h b/cocos/scripting/lua/lua/llex.h similarity index 100% rename from scripting/lua/lua/llex.h rename to cocos/scripting/lua/lua/llex.h diff --git a/scripting/lua/lua/llimits.h b/cocos/scripting/lua/lua/llimits.h similarity index 100% rename from scripting/lua/lua/llimits.h rename to cocos/scripting/lua/lua/llimits.h diff --git a/scripting/lua/lua/lmathlib.c b/cocos/scripting/lua/lua/lmathlib.c similarity index 100% rename from scripting/lua/lua/lmathlib.c rename to cocos/scripting/lua/lua/lmathlib.c diff --git a/scripting/lua/lua/lmem.c b/cocos/scripting/lua/lua/lmem.c similarity index 100% rename from scripting/lua/lua/lmem.c rename to cocos/scripting/lua/lua/lmem.c diff --git a/scripting/lua/lua/lmem.h b/cocos/scripting/lua/lua/lmem.h similarity index 100% rename from scripting/lua/lua/lmem.h rename to cocos/scripting/lua/lua/lmem.h diff --git a/scripting/lua/lua/loadlib.c b/cocos/scripting/lua/lua/loadlib.c similarity index 100% rename from scripting/lua/lua/loadlib.c rename to cocos/scripting/lua/lua/loadlib.c diff --git a/scripting/lua/lua/lobject.c b/cocos/scripting/lua/lua/lobject.c similarity index 100% rename from scripting/lua/lua/lobject.c rename to cocos/scripting/lua/lua/lobject.c diff --git a/scripting/lua/lua/lobject.h b/cocos/scripting/lua/lua/lobject.h similarity index 100% rename from scripting/lua/lua/lobject.h rename to cocos/scripting/lua/lua/lobject.h diff --git a/scripting/lua/lua/lopcodes.c b/cocos/scripting/lua/lua/lopcodes.c similarity index 100% rename from scripting/lua/lua/lopcodes.c rename to cocos/scripting/lua/lua/lopcodes.c diff --git a/scripting/lua/lua/lopcodes.h b/cocos/scripting/lua/lua/lopcodes.h similarity index 100% rename from scripting/lua/lua/lopcodes.h rename to cocos/scripting/lua/lua/lopcodes.h diff --git a/scripting/lua/lua/loslib.c b/cocos/scripting/lua/lua/loslib.c similarity index 100% rename from scripting/lua/lua/loslib.c rename to cocos/scripting/lua/lua/loslib.c diff --git a/scripting/lua/lua/lparser.c b/cocos/scripting/lua/lua/lparser.c similarity index 100% rename from scripting/lua/lua/lparser.c rename to cocos/scripting/lua/lua/lparser.c diff --git a/scripting/lua/lua/lparser.h b/cocos/scripting/lua/lua/lparser.h similarity index 100% rename from scripting/lua/lua/lparser.h rename to cocos/scripting/lua/lua/lparser.h diff --git a/scripting/lua/lua/lstate.c b/cocos/scripting/lua/lua/lstate.c similarity index 100% rename from scripting/lua/lua/lstate.c rename to cocos/scripting/lua/lua/lstate.c diff --git a/scripting/lua/lua/lstate.h b/cocos/scripting/lua/lua/lstate.h similarity index 100% rename from scripting/lua/lua/lstate.h rename to cocos/scripting/lua/lua/lstate.h diff --git a/scripting/lua/lua/lstring.c b/cocos/scripting/lua/lua/lstring.c similarity index 100% rename from scripting/lua/lua/lstring.c rename to cocos/scripting/lua/lua/lstring.c diff --git a/scripting/lua/lua/lstring.h b/cocos/scripting/lua/lua/lstring.h similarity index 100% rename from scripting/lua/lua/lstring.h rename to cocos/scripting/lua/lua/lstring.h diff --git a/scripting/lua/lua/lstrlib.c b/cocos/scripting/lua/lua/lstrlib.c similarity index 100% rename from scripting/lua/lua/lstrlib.c rename to cocos/scripting/lua/lua/lstrlib.c diff --git a/scripting/lua/lua/ltable.c b/cocos/scripting/lua/lua/ltable.c similarity index 100% rename from scripting/lua/lua/ltable.c rename to cocos/scripting/lua/lua/ltable.c diff --git a/scripting/lua/lua/ltable.h b/cocos/scripting/lua/lua/ltable.h similarity index 100% rename from scripting/lua/lua/ltable.h rename to cocos/scripting/lua/lua/ltable.h diff --git a/scripting/lua/lua/ltablib.c b/cocos/scripting/lua/lua/ltablib.c similarity index 100% rename from scripting/lua/lua/ltablib.c rename to cocos/scripting/lua/lua/ltablib.c diff --git a/scripting/lua/lua/ltm.c b/cocos/scripting/lua/lua/ltm.c similarity index 100% rename from scripting/lua/lua/ltm.c rename to cocos/scripting/lua/lua/ltm.c diff --git a/scripting/lua/lua/ltm.h b/cocos/scripting/lua/lua/ltm.h similarity index 100% rename from scripting/lua/lua/ltm.h rename to cocos/scripting/lua/lua/ltm.h diff --git a/scripting/lua/lua/lua.c b/cocos/scripting/lua/lua/lua.c similarity index 100% rename from scripting/lua/lua/lua.c rename to cocos/scripting/lua/lua/lua.c diff --git a/scripting/lua/lua/lua.h b/cocos/scripting/lua/lua/lua.h similarity index 100% rename from scripting/lua/lua/lua.h rename to cocos/scripting/lua/lua/lua.h diff --git a/scripting/lua/lua/luaconf.h b/cocos/scripting/lua/lua/luaconf.h similarity index 100% rename from scripting/lua/lua/luaconf.h rename to cocos/scripting/lua/lua/luaconf.h diff --git a/scripting/lua/lua/lualib.h b/cocos/scripting/lua/lua/lualib.h similarity index 100% rename from scripting/lua/lua/lualib.h rename to cocos/scripting/lua/lua/lualib.h diff --git a/scripting/lua/lua/lundump.c b/cocos/scripting/lua/lua/lundump.c similarity index 100% rename from scripting/lua/lua/lundump.c rename to cocos/scripting/lua/lua/lundump.c diff --git a/scripting/lua/lua/lundump.h b/cocos/scripting/lua/lua/lundump.h similarity index 100% rename from scripting/lua/lua/lundump.h rename to cocos/scripting/lua/lua/lundump.h diff --git a/scripting/lua/lua/lvm.c b/cocos/scripting/lua/lua/lvm.c similarity index 100% rename from scripting/lua/lua/lvm.c rename to cocos/scripting/lua/lua/lvm.c diff --git a/scripting/lua/lua/lvm.h b/cocos/scripting/lua/lua/lvm.h similarity index 100% rename from scripting/lua/lua/lvm.h rename to cocos/scripting/lua/lua/lvm.h diff --git a/scripting/lua/lua/lzio.c b/cocos/scripting/lua/lua/lzio.c similarity index 100% rename from scripting/lua/lua/lzio.c rename to cocos/scripting/lua/lua/lzio.c diff --git a/scripting/lua/lua/lzio.h b/cocos/scripting/lua/lua/lzio.h similarity index 100% rename from scripting/lua/lua/lzio.h rename to cocos/scripting/lua/lua/lzio.h diff --git a/scripting/lua/lua/print.c b/cocos/scripting/lua/lua/print.c similarity index 100% rename from scripting/lua/lua/print.c rename to cocos/scripting/lua/lua/print.c diff --git a/scripting/lua/luajit/Android.mk b/cocos/scripting/lua/luajit/Android.mk similarity index 100% rename from scripting/lua/luajit/Android.mk rename to cocos/scripting/lua/luajit/Android.mk diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/COPYRIGHT b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/COPYRIGHT similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/COPYRIGHT rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/COPYRIGHT diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/Makefile b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/Makefile similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/Makefile rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/Makefile diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/README b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/README similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/README rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/README diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/doc/bluequad-print.css b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/bluequad-print.css similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/doc/bluequad-print.css rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/bluequad-print.css diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/doc/bluequad.css b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/bluequad.css similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/doc/bluequad.css rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/bluequad.css diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/doc/changes.html b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/changes.html similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/doc/changes.html rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/changes.html diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/doc/contact.html b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/contact.html similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/doc/contact.html rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/contact.html diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/doc/ext_c_api.html b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/ext_c_api.html similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/doc/ext_c_api.html rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/ext_c_api.html diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/doc/ext_ffi.html b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/ext_ffi.html similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/doc/ext_ffi.html rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/ext_ffi.html diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/doc/ext_ffi_api.html b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/ext_ffi_api.html similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/doc/ext_ffi_api.html rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/ext_ffi_api.html diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/doc/ext_ffi_semantics.html b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/ext_ffi_semantics.html similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/doc/ext_ffi_semantics.html rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/ext_ffi_semantics.html diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/doc/ext_ffi_tutorial.html b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/ext_ffi_tutorial.html similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/doc/ext_ffi_tutorial.html rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/ext_ffi_tutorial.html diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/doc/ext_jit.html b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/ext_jit.html similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/doc/ext_jit.html rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/ext_jit.html diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/doc/extensions.html b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/extensions.html similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/doc/extensions.html rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/extensions.html diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/doc/faq.html b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/faq.html similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/doc/faq.html rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/faq.html diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/doc/install.html b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/install.html similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/doc/install.html rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/install.html diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/doc/luajit.html b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/luajit.html similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/doc/luajit.html rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/luajit.html diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/doc/running.html b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/running.html similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/doc/running.html rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/running.html diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/doc/status.html b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/status.html similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/doc/status.html rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/status.html diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_arm.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_arm.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_arm.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_arm.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_arm.lua b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_arm.lua similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_arm.lua rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_arm.lua diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_mips.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_mips.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_mips.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_mips.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_mips.lua b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_mips.lua similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_mips.lua rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_mips.lua diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_ppc.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_ppc.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_ppc.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_ppc.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_ppc.lua b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_ppc.lua similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_ppc.lua rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_ppc.lua diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_proto.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_proto.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_proto.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_proto.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_x64.lua b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_x64.lua similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_x64.lua rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_x64.lua diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_x86.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_x86.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_x86.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_x86.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_x86.lua b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_x86.lua similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_x86.lua rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_x86.lua diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dynasm.lua b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dynasm.lua similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dynasm.lua rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dynasm.lua diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/etc/luajit.1 b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/etc/luajit.1 similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/etc/luajit.1 rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/etc/luajit.1 diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/etc/luajit.pc b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/etc/luajit.pc similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/etc/luajit.pc rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/etc/luajit.pc diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/Makefile b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/Makefile similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/Makefile rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/Makefile diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/Makefile.dep b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/Makefile.dep similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/Makefile.dep rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/Makefile.dep diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/host/README b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/host/README similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/host/README rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/host/README diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/host/buildvm.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/host/buildvm.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/host/buildvm.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/host/buildvm.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/host/buildvm.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/host/buildvm.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/host/buildvm.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/host/buildvm.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/host/buildvm_asm.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/host/buildvm_asm.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/host/buildvm_asm.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/host/buildvm_asm.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/host/buildvm_fold.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/host/buildvm_fold.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/host/buildvm_fold.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/host/buildvm_fold.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/host/buildvm_lib.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/host/buildvm_lib.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/host/buildvm_lib.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/host/buildvm_lib.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/host/buildvm_peobj.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/host/buildvm_peobj.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/host/buildvm_peobj.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/host/buildvm_peobj.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/host/genminilua.lua b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/host/genminilua.lua similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/host/genminilua.lua rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/host/genminilua.lua diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/host/minilua.c.REMOVED.git-id b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/host/minilua.c.REMOVED.git-id similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/host/minilua.c.REMOVED.git-id rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/host/minilua.c.REMOVED.git-id diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/bc.lua b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/bc.lua similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/jit/bc.lua rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/bc.lua diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/bcsave.lua b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/bcsave.lua similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/jit/bcsave.lua rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/bcsave.lua diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/dis_arm.lua b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/dis_arm.lua similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/jit/dis_arm.lua rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/dis_arm.lua diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/dis_mips.lua b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/dis_mips.lua similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/jit/dis_mips.lua rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/dis_mips.lua diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/dis_mipsel.lua b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/dis_mipsel.lua similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/jit/dis_mipsel.lua rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/dis_mipsel.lua diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/dis_ppc.lua b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/dis_ppc.lua similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/jit/dis_ppc.lua rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/dis_ppc.lua diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/dis_x64.lua b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/dis_x64.lua similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/jit/dis_x64.lua rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/dis_x64.lua diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/dis_x86.lua b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/dis_x86.lua similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/jit/dis_x86.lua rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/dis_x86.lua diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/dump.lua b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/dump.lua similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/jit/dump.lua rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/dump.lua diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/v.lua b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/v.lua similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/jit/v.lua rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/v.lua diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lauxlib.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lauxlib.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lauxlib.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lauxlib.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_aux.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_aux.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lib_aux.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_aux.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_base.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_base.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lib_base.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_base.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_bit.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_bit.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lib_bit.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_bit.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_debug.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_debug.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lib_debug.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_debug.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_ffi.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_ffi.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lib_ffi.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_ffi.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_init.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_init.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lib_init.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_init.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_io.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_io.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lib_io.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_io.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_jit.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_jit.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lib_jit.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_jit.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_math.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_math.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lib_math.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_math.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_os.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_os.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lib_os.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_os.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_package.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_package.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lib_package.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_package.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_string.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_string.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lib_string.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_string.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_table.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_table.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lib_table.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_table.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj.supp b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj.supp similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj.supp rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj.supp diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_alloc.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_alloc.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_alloc.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_alloc.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_alloc.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_alloc.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_alloc.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_alloc.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_api.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_api.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_api.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_api.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_arch.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_arch.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_arch.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_arch.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_asm.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_asm.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_asm.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_asm.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_asm.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_asm.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_asm.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_asm.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_asm_arm.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_asm_arm.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_asm_arm.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_asm_arm.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_asm_mips.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_asm_mips.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_asm_mips.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_asm_mips.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_asm_ppc.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_asm_ppc.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_asm_ppc.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_asm_ppc.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_asm_x86.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_asm_x86.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_asm_x86.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_asm_x86.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_bc.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_bc.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_bc.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_bc.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_bc.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_bc.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_bc.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_bc.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_bcdump.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_bcdump.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_bcdump.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_bcdump.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_bcread.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_bcread.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_bcread.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_bcread.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_bcwrite.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_bcwrite.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_bcwrite.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_bcwrite.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_carith.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_carith.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_carith.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_carith.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_carith.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_carith.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_carith.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_carith.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ccall.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ccall.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ccall.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ccall.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ccall.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ccall.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ccall.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ccall.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ccallback.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ccallback.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ccallback.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ccallback.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ccallback.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ccallback.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ccallback.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ccallback.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_cconv.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_cconv.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_cconv.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_cconv.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_cconv.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_cconv.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_cconv.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_cconv.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_cdata.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_cdata.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_cdata.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_cdata.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_cdata.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_cdata.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_cdata.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_cdata.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_char.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_char.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_char.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_char.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_char.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_char.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_char.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_char.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_clib.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_clib.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_clib.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_clib.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_clib.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_clib.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_clib.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_clib.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_cparse.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_cparse.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_cparse.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_cparse.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_cparse.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_cparse.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_cparse.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_cparse.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_crecord.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_crecord.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_crecord.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_crecord.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_crecord.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_crecord.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_crecord.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_crecord.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ctype.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ctype.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ctype.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ctype.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ctype.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ctype.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ctype.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ctype.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_debug.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_debug.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_debug.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_debug.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_debug.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_debug.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_debug.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_debug.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_def.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_def.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_def.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_def.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_dispatch.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_dispatch.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_dispatch.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_dispatch.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_dispatch.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_dispatch.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_dispatch.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_dispatch.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_emit_arm.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_emit_arm.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_emit_arm.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_emit_arm.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_emit_mips.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_emit_mips.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_emit_mips.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_emit_mips.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_emit_ppc.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_emit_ppc.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_emit_ppc.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_emit_ppc.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_emit_x86.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_emit_x86.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_emit_x86.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_emit_x86.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_err.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_err.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_err.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_err.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_err.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_err.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_err.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_err.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_errmsg.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_errmsg.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_errmsg.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_errmsg.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ff.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ff.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ff.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ff.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ffrecord.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ffrecord.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ffrecord.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ffrecord.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ffrecord.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ffrecord.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ffrecord.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ffrecord.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_frame.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_frame.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_frame.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_frame.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_func.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_func.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_func.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_func.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_func.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_func.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_func.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_func.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_gc.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_gc.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_gc.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_gc.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_gc.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_gc.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_gc.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_gc.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_gdbjit.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_gdbjit.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_gdbjit.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_gdbjit.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_gdbjit.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_gdbjit.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_gdbjit.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_gdbjit.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ir.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ir.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ir.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ir.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ir.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ir.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ir.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ir.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ircall.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ircall.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ircall.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ircall.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_iropt.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_iropt.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_iropt.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_iropt.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_jit.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_jit.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_jit.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_jit.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_lex.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_lex.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_lex.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_lex.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_lex.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_lex.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_lex.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_lex.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_lib.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_lib.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_lib.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_lib.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_lib.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_lib.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_lib.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_lib.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_load.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_load.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_load.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_load.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_mcode.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_mcode.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_mcode.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_mcode.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_mcode.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_mcode.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_mcode.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_mcode.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_meta.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_meta.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_meta.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_meta.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_meta.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_meta.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_meta.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_meta.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_obj.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_obj.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_obj.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_obj.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_obj.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_obj.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_obj.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_obj.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_opt_dce.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_opt_dce.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_opt_dce.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_opt_dce.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_opt_fold.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_opt_fold.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_opt_fold.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_opt_fold.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_opt_loop.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_opt_loop.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_opt_loop.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_opt_loop.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_opt_mem.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_opt_mem.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_opt_mem.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_opt_mem.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_opt_narrow.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_opt_narrow.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_opt_narrow.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_opt_narrow.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_opt_sink.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_opt_sink.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_opt_sink.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_opt_sink.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_opt_split.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_opt_split.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_opt_split.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_opt_split.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_parse.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_parse.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_parse.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_parse.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_parse.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_parse.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_parse.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_parse.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_record.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_record.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_record.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_record.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_record.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_record.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_record.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_record.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_snap.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_snap.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_snap.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_snap.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_snap.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_snap.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_snap.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_snap.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_state.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_state.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_state.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_state.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_state.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_state.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_state.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_state.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_str.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_str.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_str.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_str.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_str.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_str.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_str.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_str.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_strscan.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_strscan.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_strscan.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_strscan.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_strscan.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_strscan.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_strscan.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_strscan.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_tab.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_tab.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_tab.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_tab.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_tab.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_tab.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_tab.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_tab.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_target.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_target.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_target.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_target.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_target_arm.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_target_arm.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_target_arm.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_target_arm.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_target_mips.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_target_mips.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_target_mips.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_target_mips.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_target_ppc.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_target_ppc.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_target_ppc.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_target_ppc.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_target_x86.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_target_x86.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_target_x86.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_target_x86.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_trace.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_trace.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_trace.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_trace.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_trace.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_trace.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_trace.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_trace.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_traceerr.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_traceerr.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_traceerr.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_traceerr.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_udata.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_udata.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_udata.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_udata.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_udata.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_udata.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_udata.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_udata.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_vm.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_vm.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_vm.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_vm.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_vmevent.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_vmevent.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_vmevent.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_vmevent.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_vmevent.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_vmevent.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_vmevent.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_vmevent.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_vmmath.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_vmmath.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lj_vmmath.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_vmmath.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/ljamalg.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/ljamalg.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/ljamalg.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/ljamalg.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lua.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lua.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lua.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lua.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lua.hpp b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lua.hpp similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lua.hpp rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lua.hpp diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/luaconf.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/luaconf.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/luaconf.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/luaconf.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/luajit.c b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/luajit.c similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/luajit.c rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/luajit.c diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/luajit.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/luajit.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/luajit.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/luajit.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/lualib.h b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lualib.h similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/lualib.h rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lualib.h diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/msvcbuild.bat b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/msvcbuild.bat similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/msvcbuild.bat rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/msvcbuild.bat diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/vm_arm.dasc.REMOVED.git-id b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/vm_arm.dasc.REMOVED.git-id similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/vm_arm.dasc.REMOVED.git-id rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/vm_arm.dasc.REMOVED.git-id diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/vm_mips.dasc.REMOVED.git-id b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/vm_mips.dasc.REMOVED.git-id similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/vm_mips.dasc.REMOVED.git-id rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/vm_mips.dasc.REMOVED.git-id diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/vm_ppc.dasc.REMOVED.git-id b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/vm_ppc.dasc.REMOVED.git-id similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/vm_ppc.dasc.REMOVED.git-id rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/vm_ppc.dasc.REMOVED.git-id diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/vm_ppcspe.dasc.REMOVED.git-id b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/vm_ppcspe.dasc.REMOVED.git-id similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/vm_ppcspe.dasc.REMOVED.git-id rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/vm_ppcspe.dasc.REMOVED.git-id diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/vm_x86.dasc.REMOVED.git-id b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/vm_x86.dasc.REMOVED.git-id similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/vm_x86.dasc.REMOVED.git-id rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/vm_x86.dasc.REMOVED.git-id diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/src/xedkbuild.bat b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/xedkbuild.bat similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/src/xedkbuild.bat rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/xedkbuild.bat diff --git a/scripting/lua/luajit/LuaJIT-2.0.1/v2.0.1_hotfix1.patch b/cocos/scripting/lua/luajit/LuaJIT-2.0.1/v2.0.1_hotfix1.patch similarity index 100% rename from scripting/lua/luajit/LuaJIT-2.0.1/v2.0.1_hotfix1.patch rename to cocos/scripting/lua/luajit/LuaJIT-2.0.1/v2.0.1_hotfix1.patch diff --git a/scripting/lua/luajit/android/armeabi-v7a/libluajit.a.REMOVED.git-id b/cocos/scripting/lua/luajit/android/armeabi-v7a/libluajit.a.REMOVED.git-id similarity index 100% rename from scripting/lua/luajit/android/armeabi-v7a/libluajit.a.REMOVED.git-id rename to cocos/scripting/lua/luajit/android/armeabi-v7a/libluajit.a.REMOVED.git-id diff --git a/scripting/lua/luajit/android/armeabi/libluajit.a.REMOVED.git-id b/cocos/scripting/lua/luajit/android/armeabi/libluajit.a.REMOVED.git-id similarity index 100% rename from scripting/lua/luajit/android/armeabi/libluajit.a.REMOVED.git-id rename to cocos/scripting/lua/luajit/android/armeabi/libluajit.a.REMOVED.git-id diff --git a/scripting/lua/luajit/android/x86/libluajit.a.REMOVED.git-id b/cocos/scripting/lua/luajit/android/x86/libluajit.a.REMOVED.git-id similarity index 100% rename from scripting/lua/luajit/android/x86/libluajit.a.REMOVED.git-id rename to cocos/scripting/lua/luajit/android/x86/libluajit.a.REMOVED.git-id diff --git a/scripting/lua/luajit/build_android.sh b/cocos/scripting/lua/luajit/build_android.sh similarity index 100% rename from scripting/lua/luajit/build_android.sh rename to cocos/scripting/lua/luajit/build_android.sh diff --git a/scripting/lua/luajit/build_ios.sh b/cocos/scripting/lua/luajit/build_ios.sh similarity index 100% rename from scripting/lua/luajit/build_ios.sh rename to cocos/scripting/lua/luajit/build_ios.sh diff --git a/scripting/lua/luajit/build_mac.sh b/cocos/scripting/lua/luajit/build_mac.sh similarity index 100% rename from scripting/lua/luajit/build_mac.sh rename to cocos/scripting/lua/luajit/build_mac.sh diff --git a/scripting/lua/luajit/include/lauxlib.h b/cocos/scripting/lua/luajit/include/lauxlib.h similarity index 100% rename from scripting/lua/luajit/include/lauxlib.h rename to cocos/scripting/lua/luajit/include/lauxlib.h diff --git a/scripting/lua/luajit/include/lua.h b/cocos/scripting/lua/luajit/include/lua.h similarity index 100% rename from scripting/lua/luajit/include/lua.h rename to cocos/scripting/lua/luajit/include/lua.h diff --git a/scripting/lua/luajit/include/luaconf.h b/cocos/scripting/lua/luajit/include/luaconf.h similarity index 100% rename from scripting/lua/luajit/include/luaconf.h rename to cocos/scripting/lua/luajit/include/luaconf.h diff --git a/scripting/lua/luajit/include/lualib.h b/cocos/scripting/lua/luajit/include/lualib.h similarity index 100% rename from scripting/lua/luajit/include/lualib.h rename to cocos/scripting/lua/luajit/include/lualib.h diff --git a/scripting/lua/luajit/ios/libluajit.a.REMOVED.git-id b/cocos/scripting/lua/luajit/ios/libluajit.a.REMOVED.git-id similarity index 100% rename from scripting/lua/luajit/ios/libluajit.a.REMOVED.git-id rename to cocos/scripting/lua/luajit/ios/libluajit.a.REMOVED.git-id diff --git a/scripting/lua/luajit/mac/libluajit.a.REMOVED.git-id b/cocos/scripting/lua/luajit/mac/libluajit.a.REMOVED.git-id similarity index 100% rename from scripting/lua/luajit/mac/libluajit.a.REMOVED.git-id rename to cocos/scripting/lua/luajit/mac/libluajit.a.REMOVED.git-id diff --git a/scripting/lua/luajit/win32/lua51.dll.REMOVED.git-id b/cocos/scripting/lua/luajit/win32/lua51.dll.REMOVED.git-id similarity index 100% rename from scripting/lua/luajit/win32/lua51.dll.REMOVED.git-id rename to cocos/scripting/lua/luajit/win32/lua51.dll.REMOVED.git-id diff --git a/scripting/lua/proj.android/Android.mk b/cocos/scripting/lua/proj.android/Android.mk similarity index 100% rename from scripting/lua/proj.android/Android.mk rename to cocos/scripting/lua/proj.android/Android.mk diff --git a/scripting/lua/proj.ios/luabindings-Prefix.pch b/cocos/scripting/lua/proj.ios/luabindings-Prefix.pch similarity index 100% rename from scripting/lua/proj.ios/luabindings-Prefix.pch rename to cocos/scripting/lua/proj.ios/luabindings-Prefix.pch diff --git a/scripting/lua/proj.ios/luabindings.xcodeproj/project.pbxproj b/cocos/scripting/lua/proj.ios/luabindings.xcodeproj/project.pbxproj similarity index 100% rename from scripting/lua/proj.ios/luabindings.xcodeproj/project.pbxproj rename to cocos/scripting/lua/proj.ios/luabindings.xcodeproj/project.pbxproj diff --git a/scripting/lua/proj.linux/.cproject b/cocos/scripting/lua/proj.linux/.cproject similarity index 100% rename from scripting/lua/proj.linux/.cproject rename to cocos/scripting/lua/proj.linux/.cproject diff --git a/scripting/lua/proj.linux/.project b/cocos/scripting/lua/proj.linux/.project similarity index 100% rename from scripting/lua/proj.linux/.project rename to cocos/scripting/lua/proj.linux/.project diff --git a/scripting/lua/proj.linux/Makefile b/cocos/scripting/lua/proj.linux/Makefile similarity index 100% rename from scripting/lua/proj.linux/Makefile rename to cocos/scripting/lua/proj.linux/Makefile diff --git a/scripting/lua/proj.win32/liblua.vcxproj b/cocos/scripting/lua/proj.win32/liblua.vcxproj similarity index 100% rename from scripting/lua/proj.win32/liblua.vcxproj rename to cocos/scripting/lua/proj.win32/liblua.vcxproj diff --git a/scripting/lua/proj.win32/liblua.vcxproj.filters b/cocos/scripting/lua/proj.win32/liblua.vcxproj.filters similarity index 100% rename from scripting/lua/proj.win32/liblua.vcxproj.filters rename to cocos/scripting/lua/proj.win32/liblua.vcxproj.filters diff --git a/scripting/lua/proj.win32/liblua.vcxproj.user b/cocos/scripting/lua/proj.win32/liblua.vcxproj.user similarity index 100% rename from scripting/lua/proj.win32/liblua.vcxproj.user rename to cocos/scripting/lua/proj.win32/liblua.vcxproj.user diff --git a/scripting/lua/script/AudioEngine.lua b/cocos/scripting/lua/script/AudioEngine.lua similarity index 100% rename from scripting/lua/script/AudioEngine.lua rename to cocos/scripting/lua/script/AudioEngine.lua diff --git a/scripting/lua/script/CCBReaderLoad.lua b/cocos/scripting/lua/script/CCBReaderLoad.lua similarity index 100% rename from scripting/lua/script/CCBReaderLoad.lua rename to cocos/scripting/lua/script/CCBReaderLoad.lua diff --git a/scripting/lua/script/Cocos2d.lua b/cocos/scripting/lua/script/Cocos2d.lua similarity index 100% rename from scripting/lua/script/Cocos2d.lua rename to cocos/scripting/lua/script/Cocos2d.lua diff --git a/scripting/lua/script/Cocos2dConstants.lua b/cocos/scripting/lua/script/Cocos2dConstants.lua similarity index 100% rename from scripting/lua/script/Cocos2dConstants.lua rename to cocos/scripting/lua/script/Cocos2dConstants.lua diff --git a/scripting/lua/script/Deprecated.lua b/cocos/scripting/lua/script/Deprecated.lua similarity index 100% rename from scripting/lua/script/Deprecated.lua rename to cocos/scripting/lua/script/Deprecated.lua diff --git a/scripting/lua/script/DeprecatedClass.lua b/cocos/scripting/lua/script/DeprecatedClass.lua similarity index 100% rename from scripting/lua/script/DeprecatedClass.lua rename to cocos/scripting/lua/script/DeprecatedClass.lua diff --git a/scripting/lua/script/DeprecatedEnum.lua b/cocos/scripting/lua/script/DeprecatedEnum.lua similarity index 100% rename from scripting/lua/script/DeprecatedEnum.lua rename to cocos/scripting/lua/script/DeprecatedEnum.lua diff --git a/scripting/lua/script/DeprecatedOpenglEnum.lua b/cocos/scripting/lua/script/DeprecatedOpenglEnum.lua similarity index 100% rename from scripting/lua/script/DeprecatedOpenglEnum.lua rename to cocos/scripting/lua/script/DeprecatedOpenglEnum.lua diff --git a/scripting/lua/script/DrawPrimitives.lua b/cocos/scripting/lua/script/DrawPrimitives.lua similarity index 100% rename from scripting/lua/script/DrawPrimitives.lua rename to cocos/scripting/lua/script/DrawPrimitives.lua diff --git a/scripting/lua/script/Opengl.lua b/cocos/scripting/lua/script/Opengl.lua similarity index 100% rename from scripting/lua/script/Opengl.lua rename to cocos/scripting/lua/script/Opengl.lua diff --git a/scripting/lua/script/OpenglConstants.lua b/cocos/scripting/lua/script/OpenglConstants.lua similarity index 100% rename from scripting/lua/script/OpenglConstants.lua rename to cocos/scripting/lua/script/OpenglConstants.lua diff --git a/scripting/lua/script/luaj.lua b/cocos/scripting/lua/script/luaj.lua similarity index 100% rename from scripting/lua/script/luaj.lua rename to cocos/scripting/lua/script/luaj.lua diff --git a/scripting/lua/tolua/tolua++.h b/cocos/scripting/lua/tolua/tolua++.h similarity index 100% rename from scripting/lua/tolua/tolua++.h rename to cocos/scripting/lua/tolua/tolua++.h diff --git a/scripting/lua/tolua/tolua_event.c b/cocos/scripting/lua/tolua/tolua_event.c similarity index 100% rename from scripting/lua/tolua/tolua_event.c rename to cocos/scripting/lua/tolua/tolua_event.c diff --git a/scripting/lua/tolua/tolua_event.h b/cocos/scripting/lua/tolua/tolua_event.h similarity index 100% rename from scripting/lua/tolua/tolua_event.h rename to cocos/scripting/lua/tolua/tolua_event.h diff --git a/scripting/lua/tolua/tolua_is.c b/cocos/scripting/lua/tolua/tolua_is.c similarity index 100% rename from scripting/lua/tolua/tolua_is.c rename to cocos/scripting/lua/tolua/tolua_is.c diff --git a/scripting/lua/tolua/tolua_map.c b/cocos/scripting/lua/tolua/tolua_map.c similarity index 100% rename from scripting/lua/tolua/tolua_map.c rename to cocos/scripting/lua/tolua/tolua_map.c diff --git a/scripting/lua/tolua/tolua_push.c b/cocos/scripting/lua/tolua/tolua_push.c similarity index 100% rename from scripting/lua/tolua/tolua_push.c rename to cocos/scripting/lua/tolua/tolua_push.c diff --git a/scripting/lua/tolua/tolua_to.c b/cocos/scripting/lua/tolua/tolua_to.c similarity index 100% rename from scripting/lua/tolua/tolua_to.c rename to cocos/scripting/lua/tolua/tolua_to.c diff --git a/extensions/LocalStorage/LocalStorage.cpp b/cocos/storage/local-storage/LocalStorage.cpp similarity index 100% rename from extensions/LocalStorage/LocalStorage.cpp rename to cocos/storage/local-storage/LocalStorage.cpp diff --git a/extensions/LocalStorage/LocalStorage.h b/cocos/storage/local-storage/LocalStorage.h similarity index 100% rename from extensions/LocalStorage/LocalStorage.h rename to cocos/storage/local-storage/LocalStorage.h diff --git a/extensions/LocalStorage/LocalStorageAndroid.cpp b/cocos/storage/local-storage/LocalStorageAndroid.cpp similarity index 100% rename from extensions/LocalStorage/LocalStorageAndroid.cpp rename to cocos/storage/local-storage/LocalStorageAndroid.cpp diff --git a/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id b/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id deleted file mode 100644 index ef385cb2a2..0000000000 --- a/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -b8bac548f5a84cbc6b7bd9c99617868737bb103f \ No newline at end of file diff --git a/cocos2dx-qt5.pro b/cocos2dx-qt5.pro deleted file mode 100644 index fa6af5270c..0000000000 --- a/cocos2dx-qt5.pro +++ /dev/null @@ -1,19 +0,0 @@ - -TEMPLATE = subdirs - -CONFIG += ordered - -# Cocos2D-X Core Library -SUBDIRS += external/chipmunk/proj.qt5/chipmunk.pro -SUBDIRS += external/Box2D/proj.qt5/box2d.pro -SUBDIRS += cocos2dx/proj.qt5/cocos2dx.pro - -# Cocos2D-X Additional Libraries -SUBDIRS += CocosDenshion/proj.qt5/cocosdenshion.pro -SUBDIRS += extensions/proj.qt5/extensions.pro - -# Examples -SUBDIRS += samples/Cpp/HelloCpp/proj.qt5/HelloCpp.pro -SUBDIRS += samples/Cpp/SimpleGame/proj.qt5/SimpleGame.pro -SUBDIRS += samples/Cpp/TestCpp/proj.qt5/TestCpp.pro - diff --git a/cocos2dx/label_nodes/CCFontCache.cpp b/cocos2dx/label_nodes/CCFontCache.cpp deleted file mode 100644 index 86a9ec7797..0000000000 --- a/cocos2dx/label_nodes/CCFontCache.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/**************************************************************************** - Copyright (c) 2013 Zynga 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. - ****************************************************************************/ - -#include "CCFontCache.h" - -NS_CC_BEGIN - - -const char *glpyhsASCII = "\"!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþ"; -const char *glpyhsNEHE = "!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; - -std::map CCFontCache::_fontsMap; - -FontDefinitionTTF * CCFontCache::getFontDefinition(const char *fontFileName, int size, GlyphCollection glyphs) -{ - std::string fontName = generateFontName(fontFileName, size); - FontDefinitionTTF *tempDefinition = _fontsMap[fontName]; - - if ( !tempDefinition ) - { - tempDefinition = FontDefinitionTTF::create(fontFileName, size, getGlyphCollection(glyphs)); - if (tempDefinition) - { - _fontsMap[fontName] = tempDefinition; - } - else - { - return 0; - } - } - - return tempDefinition; -} - -std::string CCFontCache::generateFontName(const char *fontFileName, int size) -{ - std::string tempName(fontFileName); - // std::to_string is not supported on android, using std::stringstream instead. - std::stringstream ss; - ss << size; - return tempName + ss.str(); -} - -bool CCFontCache::releaseFontDefinition(FontDefinitionTTF *def) -{ - if (def) - { - for( auto &item: _fontsMap) - { - if ( item.second == def ) - { - item.second->release(); - _fontsMap.erase(item.first); - return true; - } - } - } - - return false; -} - -const char * CCFontCache::getGlyphCollection(GlyphCollection glyphs) -{ - switch (glyphs) - { - case GlyphCollection::NEHE: - return glpyhsNEHE; - break; - - case GlyphCollection::ASCII: - return glpyhsASCII; - break; - - default: - return 0; - break; - } -} - -NS_CC_END \ No newline at end of file diff --git a/cocos2dx/label_nodes/CCFontCache.h b/cocos2dx/label_nodes/CCFontCache.h deleted file mode 100644 index 48f9977421..0000000000 --- a/cocos2dx/label_nodes/CCFontCache.h +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** - Copyright (c) 2013 Zynga 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 _CCFontCache_h_ -#define _CCFontCache_h_ - -#include -#include - -#include "cocos2d.h" -#include "CCFontDefinition.h" - -NS_CC_BEGIN - -class CC_DLL CCFontCache -{ - -public: - - static FontDefinitionTTF * getFontDefinition(const char *fontFileName, int size, GlyphCollection glyphs); - static bool releaseFontDefinition(FontDefinitionTTF *def); - -private: - - static std::string generateFontName(const char *fontFileName, int size); - static std::map _fontsMap; - static const char * getGlyphCollection(GlyphCollection glyphs); - -}; - -NS_CC_END - -#endif diff --git a/cocos2dx/platform/emscripten/CCApplication.cpp b/cocos2dx/platform/emscripten/CCApplication.cpp deleted file mode 100644 index cf78ff625b..0000000000 --- a/cocos2dx/platform/emscripten/CCApplication.cpp +++ /dev/null @@ -1,113 +0,0 @@ -#include "CCApplication.h" -#include "platform/CCFileUtils.h" -#include "CCDirector.h" -#include "CCEGLView.h" -#include -#include -#include - -#include - -#define LOGD(...) fprintf(stderr, __VA_ARGS__) - -NS_CC_BEGIN; - -// sharedApplication pointer -Application * Application::sm_pSharedApplication = 0; -long Application::_animationInterval = 1000; - -// convert the timespec into milliseconds -static long time2millis(struct timespec *times) -{ - return times->tv_sec*1000 + times->tv_nsec/1000000; -} - -Application::Application() -{ - CC_ASSERT(! sm_pSharedApplication); - sm_pSharedApplication = this; -} - -Application::~Application() -{ - CC_ASSERT(this == sm_pSharedApplication); - sm_pSharedApplication = NULL; -} - - -extern "C" void mainLoopIter(void) -{ - EGLView::getInstance()->handleEvents(); - Director::getInstance()->mainLoop(); -} - -int Application::run() -{ - struct timespec time_struct; - long update_time; - - // Initialize instance and cocos2d. - if (!applicationDidFinishLaunching()) - { - return 0; - } - - clock_gettime(CLOCK_REALTIME, &time_struct); - update_time = time2millis(&time_struct); - - // XXX: Set to 1FPS while debugging - emscripten_set_main_loop(&mainLoopIter, 0, 1); - - return -1; -} - -void Application::setAnimationInterval(double interval) -{ - // interval in milliseconds - _animationInterval = (long)(interval * 1000); -} - -void Application::setResourceRootPath(const std::string& rootResDir) -{ - _resourceRootPath = rootResDir; - if (_resourceRootPath[_resourceRootPath.length() - 1] != '/') - { - _resourceRootPath += '/'; - } - FileUtils* pFileUtils = FileUtils::getInstance(); - std::vector searchPaths = pFileUtils->getSearchPaths(); - searchPaths.insert(searchPaths.begin(), _resourceRootPath); - pFileUtils->setSearchPaths(searchPaths); -} - -const std::string& Application::getResourceRootPath(void) -{ - return _resourceRootPath; -} - -Application::Platform Application::getTargetPlatform() -{ - return Platform::OS_EMSCRIPTEN; -} - -////////////////////////////////////////////////////////////////////////// -// static member function -////////////////////////////////////////////////////////////////////////// -Application* Application::getInstance() -{ - CC_ASSERT(sm_pSharedApplication); - return sm_pSharedApplication; -} - -// @deprecated Use getInstance() instead -Application* Application::sharedApplication() -{ - return Application::getInstance(); -} - -LanguageType Application::getCurrentLanguage() -{ - return LanguageType::ENGLISH; -} - -NS_CC_END; diff --git a/cocos2dx/platform/emscripten/CCApplication.h b/cocos2dx/platform/emscripten/CCApplication.h deleted file mode 100644 index 0218072ca5..0000000000 --- a/cocos2dx/platform/emscripten/CCApplication.h +++ /dev/null @@ -1,78 +0,0 @@ -#ifndef __CC_APPLICATION_BLACKBERRY_H__ -#define __CC_APPLICATION_BLACKBERRY_H__ - -#include "platform/CCCommon.h" -#include "platform/CCApplicationProtocol.h" -#include -NS_CC_BEGIN; - -class Rect; - -class CC_DLL Application : public ApplicationProtocol -{ -public: - /** - * @js ctor - */ - Application(); - /** - * @js NA - * @lua NA - */ - virtual ~Application(); - - /** - @brief Callback by Director for limit FPS. - @param interval The time, which expressed in second in second, between current frame and next. - */ - void setAnimationInterval(double interval); - - /** - @brief Run the message loop. - */ - int run(); - - /** - @brief Get current applicaiton instance. - @return Current application instance pointer. - */ - static Application* getInstance(); - - /** @deprecated Use getInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static Application* sharedApplication(); - - /** - @brief Get current language config - @return Current language config - */ - virtual LanguageType getCurrentLanguage(); - - /** - @brief Get target platform - */ - virtual Platform getTargetPlatform(); - - - /** - * Sets the Resource root path. - * @deprecated Please use FileUtils::getInstance()->setSearchPaths() instead. - */ - CC_DEPRECATED_ATTRIBUTE void setResourceRootPath(const std::string& rootResDir); - - /** - * Gets the Resource root path. - * @deprecated Please use FileUtils::getInstance()->getSearchPaths() instead. - */ - CC_DEPRECATED_ATTRIBUTE const std::string& getResourceRootPath(void); - - - -protected: - static Application * sm_pSharedApplication; - std::string _resourceRootPath; - static long _animationInterval; -}; - -NS_CC_END - -#endif // __CC_APPLICATION_BLACKBERRY_H__ diff --git a/cocos2dx/platform/emscripten/CCCommon.cpp b/cocos2dx/platform/emscripten/CCCommon.cpp deleted file mode 100644 index 31976935e5..0000000000 --- a/cocos2dx/platform/emscripten/CCCommon.cpp +++ /dev/null @@ -1,68 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010 cocos2d-x.org - -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 "platform/CCCommon.h" -#include "CCStdC.h" - -NS_CC_BEGIN - -#define MAX_LEN (cocos2d::kMaxLogLen + 1) - -// XXX deprecated -void CCLog(const char * pszFormat, ...) -{ - char buf[MAX_LEN]; - - va_list args; - va_start(args, pszFormat); - vsnprintf(buf, MAX_LEN, pszFormat, args); - va_end(args); - - fprintf(stderr, "cocos2d-x debug info %s\n", buf); -} - -void log(const char * pszFormat, ...) -{ - char buf[MAX_LEN]; - - va_list args; - va_start(args, pszFormat); - vsnprintf(buf, MAX_LEN, pszFormat, args); - va_end(args); - - fprintf(stderr, "cocos2d-x debug info %s\n", buf); -} - -void MessageBox(const char * pszMsg, const char * pszTitle) -{ -// MessageBoxA(NULL, pszMsg, pszTitle, MB_OK); - log(pszMsg); -} - -void LuaLog(const char * pszFormat) -{ - puts(pszFormat); -} - -NS_CC_END - diff --git a/cocos2dx/platform/emscripten/CCDevice.cpp b/cocos2dx/platform/emscripten/CCDevice.cpp deleted file mode 100644 index 05ac2fc8e7..0000000000 --- a/cocos2dx/platform/emscripten/CCDevice.cpp +++ /dev/null @@ -1,20 +0,0 @@ -#include "platform/CCDevice.h" - -NS_CC_BEGIN - -int Device::getDPI() -{ - return 160; -} - -void Device::setAccelerometerEnabled(bool isEnabled) -{ - -} - -void Device::setAccelerometerInterval(float interval) -{ - -} - -NS_CC_END diff --git a/cocos2dx/platform/emscripten/CCEGLView.cpp b/cocos2dx/platform/emscripten/CCEGLView.cpp deleted file mode 100644 index 5159f17f21..0000000000 --- a/cocos2dx/platform/emscripten/CCEGLView.cpp +++ /dev/null @@ -1,389 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010 cocos2d-x.org - -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 "CCEGLView.h" -#include "cocoa/CCSet.h" -#include "CCDirector.h" -#include "ccMacros.h" -#include "event_dispatcher/CCTouch.h" -#include "event_dispatcher/CCEventDispatcher.h" -#include "event_dispatcher/CCEventKeyboard.h" -#include "text_input_node/CCIMEDispatcher.h" -#include "CCGL.h" -#include "CCApplication.h" - -#include -#include -#include -#include - -#include - -#include - -extern "C" { -void glutInit(int *argcp, char **argv); -void glutMouseFunc(void (*func)(int button, int state, int x, int y)); -void glutMotionFunc(void (*func)(int x, int y)); -void glutPassiveMotionFunc(void (*func)(int x, int y)); -} - -// Constants for mouse events (inferred from experiment) -static const int glutLeftButton = 0; -static const int glutMouseDown = 0; -static const int glutMouseUp = 1; - -NS_CC_BEGIN - -bool EGLView::_initializedFunctions = false; -const GLubyte *EGLView::_extensions = 0; - -enum Orientation -{ - PORTRAIT, - LANDSCAPE, - AUTO -}; - -static Orientation orientation = LANDSCAPE; - -#define MAX_TOUCHES 4 -static EGLView* s_pInstance = NULL; - -static bool buttonDepressed = false; -extern "C" void mouseCB(int button, int state, int x, int y) -{ - float fx = x; - float fy = y; - EGLView* pEGLView = EGLView::getInstance(); - int id = 0; - - if(button != glutLeftButton) return; - - if(state == glutMouseDown) - { - pEGLView->handleTouchesBegin(1, &id, &fx, &fy); - buttonDepressed = true; - } - else if(state == glutMouseUp) - { - pEGLView->handleTouchesEnd(1, &id, &fx, &fy); - buttonDepressed = false; - } -} - -extern "C" void motionCB(int x, int y) -{ - float fx = x; - float fy = y; - EGLView* pEGLView = EGLView::getInstance(); - int id = 0; - - if(buttonDepressed) - { - pEGLView->handleTouchesMove(1, &id, &fx, &fy); - } -} - -EGLView::EGLView() -{ - _eglDisplay = EGL_NO_DISPLAY; - _eglContext = EGL_NO_CONTEXT; - _eglSurface = EGL_NO_SURFACE; - - strcpy(_windowGroupID, ""); - snprintf(_windowGroupID, sizeof(_windowGroupID), "%d", 1); - - _isGLInitialized = initGL(); - - if (_isGLInitialized) - initEGLFunctions(); - - // Initialize SDL: used for font rendering, sprite loading and audio - // playing. - SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO); - - // Emscripten ignores all these values. - Mix_OpenAudio(0, 0, 0, 0); - TTF_Init(); - - char *arg1 = (char*)malloc(1); - char **dummyArgv = (char**)malloc(sizeof(char*)); - dummyArgv[0] = arg1; - glutInit(0, dummyArgv); - free(dummyArgv[0]); - free(dummyArgv); - - glutMouseFunc(&mouseCB); - glutMotionFunc(&motionCB); - glutPassiveMotionFunc(&motionCB); -} - -EGLView::~EGLView() -{ -} - -const char* EGLView::getWindowGroupId() const -{ - return _windowGroupID; -} - -void EGLView::release() -{ - if (_eglDisplay != EGL_NO_DISPLAY) - { - eglMakeCurrent(_eglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); - } - - if (_eglSurface != EGL_NO_SURFACE) - { - eglDestroySurface(_eglDisplay, _eglSurface); - _eglSurface = EGL_NO_SURFACE; - } - - if (_eglContext != EGL_NO_CONTEXT) - { - eglDestroyContext(_eglDisplay, _eglContext); - _eglContext = EGL_NO_CONTEXT; - } - - if (_eglDisplay != EGL_NO_DISPLAY) - { - eglTerminate(_eglDisplay); - _eglDisplay = EGL_NO_DISPLAY; - } - - _isGLInitialized = false; - - exit(0); -} - -void EGLView::initEGLFunctions() -{ - _extensions = glGetString(GL_EXTENSIONS); - _initializedFunctions = true; -} - -bool EGLView::isOpenGLReady() -{ - return (_isGLInitialized && _screenSize.height != 0 && _screenSize.width != 0); -} - -void EGLView::end() -{ - release(); -} - -void EGLView::swapBuffers() -{ - eglSwapBuffers(_eglDisplay, _eglSurface); -} - -EGLView* EGLView::getInstance() -{ - if (!s_pInstance) - { - s_pInstance = new EGLView(); - } - - CCAssert(s_pInstance != NULL, "CCEGLView wasn't constructed yet"); - return s_pInstance; -} - -// XXX: deprecated -EGLView* EGLView::sharedOpenGLView() -{ - return EGLView::getInstance(); -} - -void EGLView::showKeyboard() -{ -} - -void EGLView::hideKeyboard() -{ -} - -void EGLView::setIMEKeyboardState(bool bOpen) -{ -} - -bool EGLView::isGLExtension(const char *searchName) const -{ - const GLubyte *start; - GLubyte *where, *terminator; - - /* It takes a bit of care to be fool-proof about parsing the - OpenGL extensions string. Don't be fooled by sub-strings, - etc. */ - start = _extensions; - for (;;) - { - where = (GLubyte *) strstr((const char *) start, searchName); - if (!where) - break; - - terminator = where + strlen(searchName); - if (where == start || *(where - 1) == ' ') - if (*terminator == ' ' || *terminator == '\0') - return true; - - start = terminator; - } - - return false; -} - - -static EGLenum checkErrorEGL(const char* msg) -{ - assert(msg); - static const char* errmsg[] = - { - "EGL function succeeded", - "EGL is not initialized, or could not be initialized, for the specified display", - "EGL cannot access a requested resource", - "EGL failed to allocate resources for the requested operation", - "EGL fail to access an unrecognized attribute or attribute value was passed in an attribute list", - "EGLConfig argument does not name a valid EGLConfig", - "EGLContext argument does not name a valid EGLContext", - "EGL current surface of the calling thread is no longer valid", - "EGLDisplay argument does not name a valid EGLDisplay", - "EGL arguments are inconsistent", - "EGLNativePixmapType argument does not refer to a valid native pixmap", - "EGLNativeWindowType argument does not refer to a valid native window", - "EGL one or more argument values are invalid", - "EGLSurface argument does not name a valid surface configured for rendering", - "EGL power management event has occurred", - }; - EGLenum error = eglGetError(); - fprintf(stderr, "%s: %s\n", msg, errmsg[error - EGL_SUCCESS]); - return error; -} - -bool EGLView::initGL() -{ - EGLint eglConfigCount; - EGLConfig config; - - // Hard-coded to 32-bit/OpenGL ES 2.0. - const EGLint eglConfigAttrs[] = - { - EGL_RED_SIZE, 8, - EGL_GREEN_SIZE, 8, - EGL_BLUE_SIZE, 8, - EGL_ALPHA_SIZE, 8, - EGL_DEPTH_SIZE, 24, - EGL_STENCIL_SIZE, 8, - EGL_SURFACE_TYPE, EGL_WINDOW_BIT, - EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, - EGL_NONE - }; - - const EGLint eglContextAttrs[] = - { - EGL_CONTEXT_CLIENT_VERSION, 2, - EGL_NONE - }; - - const EGLint eglSurfaceAttrs[] = - { - EGL_RENDER_BUFFER, EGL_BACK_BUFFER, - EGL_NONE - }; - - // Get the EGL display and initialize. - _eglDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY); - if (_eglDisplay == EGL_NO_DISPLAY) - { - perror("eglGetDisplay"); - return false; - } - - if (eglInitialize(_eglDisplay, NULL, NULL) != EGL_TRUE) - { - perror("eglInitialize"); - return false; - } - - if (eglChooseConfig(_eglDisplay, eglConfigAttrs, &config, 1, &eglConfigCount) != EGL_TRUE || eglConfigCount == 0) - { - checkErrorEGL("eglChooseConfig"); - return false; - } - - _eglContext = eglCreateContext(_eglDisplay, config, EGL_NO_CONTEXT, eglContextAttrs); - if (_eglContext == EGL_NO_CONTEXT) - { - checkErrorEGL("eglCreateContext"); - return false; - } - - _eglSurface = eglCreateWindowSurface(_eglDisplay, config, NULL, eglSurfaceAttrs); - if (_eglSurface == EGL_NO_SURFACE) - { - checkErrorEGL("eglCreateWindowSurface"); - return false; - } - - if (eglMakeCurrent(_eglDisplay, _eglSurface, _eglSurface, _eglContext) != EGL_TRUE) - { - checkErrorEGL("eglMakeCurrent"); - return false; - } - - // FIXME: Get the actual canvas size somehow. - EGLint width; - EGLint height; - - if ((_eglDisplay == EGL_NO_DISPLAY) || (_eglSurface == EGL_NO_SURFACE) ) - return EXIT_FAILURE; - - eglQuerySurface(_eglDisplay, _eglSurface, EGL_WIDTH, &width); - eglQuerySurface(_eglDisplay, _eglSurface, EGL_HEIGHT, &height); - - _screenSize.width = width; - _screenSize.height = height; - - glViewport(0, 0, width, height); - - // Default the frame size to be the whole canvas. In general we want to be - // setting the size of the viewport by adjusting the canvas size (so - // there's no weird letterboxing). - setFrameSize(width, height); - - return true; -} - -static long time2millis(struct timespec *times) -{ - return times->tv_sec*1000 + times->tv_nsec/1000000; -} - -bool EGLView::handleEvents() -{ - return true; -} - -NS_CC_END diff --git a/cocos2dx/platform/emscripten/CCEGLView.h b/cocos2dx/platform/emscripten/CCEGLView.h deleted file mode 100644 index fc2d203a74..0000000000 --- a/cocos2dx/platform/emscripten/CCEGLView.h +++ /dev/null @@ -1,93 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010 cocos2d-x.org - -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 __CC_EGLVIEW_BLACKBERRY_H__ -#define __CC_EGLVIEW_BLACKBERRY_H__ - -#include "cocoa/CCGeometry.h" -#include "platform/CCEGLViewProtocol.h" -#include "platform/CCPlatformMacros.h" - -//#include - -NS_CC_BEGIN - -class CC_DLL EGLView : public EGLViewProtocol -{ -public: - /** - * @js ctor - */ - EGLView(); - /** - * @js NA - * @lua NA - */ - virtual ~EGLView(); - - bool isOpenGLReady(); - - const char* getWindowGroupId() const; - - // keep compatible - void end(); - void swapBuffers(); - void setIMEKeyboardState(bool bOpen); - - // static function - /** - @brief get the shared main open gl window - */ - static EGLView* getInstance(); - - /** @deprecated Use getInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static EGLView* sharedOpenGLView(); - - bool handleEvents(); - -private: - void release(); - - bool initGL(); - void initEGLFunctions(); - bool isGLExtension(const char *searchName) const; - bool initDriver(); - void showKeyboard(); - void hideKeyboard(); - - static bool _initializedFunctions; - static const GLubyte *_extensions; - - bool _isGLInitialized; - bool _isWindowActive; - - EGLDisplay _eglDisplay; - EGLContext _eglContext; - EGLSurface _eglSurface; - char _windowGroupID[16]; -}; - -NS_CC_END - -#endif // end of __CC_EGLVIEW_QNX_H__ diff --git a/cocos2dx/platform/emscripten/CCFileUtilsEmscripten.cpp b/cocos2dx/platform/emscripten/CCFileUtilsEmscripten.cpp deleted file mode 100644 index 3daf78d7d6..0000000000 --- a/cocos2dx/platform/emscripten/CCFileUtilsEmscripten.cpp +++ /dev/null @@ -1,73 +0,0 @@ -#include "CCFileUtilsEmscripten.h" -#include "platform/CCCommon.h" -#include "ccMacros.h" -#include "CCApplication.h" -#include "cocoa/CCString.h" -#include - -using namespace std; - -NS_CC_BEGIN - -FileUtils* FileUtils::getInstance() -{ - if (s_sharedFileUtils == NULL) - { - s_sharedFileUtils = new FileUtilsEmscripten(); - if(!s_sharedFileUtils->init()) - { - delete s_sharedFileUtils; - s_sharedFileUtils = NULL; - CCLOG("ERROR: Could not init CCFileUtilsEmscripten"); - } - } - return s_sharedFileUtils; -} - -FileUtilsEmscripten::FileUtilsEmscripten() -{} - -bool FileUtilsEmscripten::init() -{ - _defaultResRootPath = "/"; - return FileUtils::init(); -} - -string FileUtilsEmscripten::getWritablePath() const -{ - // Let's write it in the current working directory's data folder - char cwd[FILENAME_MAX] = {0}; - - getcwd(cwd, FILENAME_MAX - 1); - cwd[FILENAME_MAX-1] = '\0'; - - std::string path = cwd; - path += "/data/"; - - return path; -} - -bool FileUtilsEmscripten::isAbsolutePath(const std::string& strPath) const -{ - if (strPath[0] == '/' || strPath.find(_defaultResRootPath) == 0) - { - return true; - } - return false; -} - -bool FileUtilsEmscripten::isFileExist(const std::string& strFilePath) const -{ - std::string strPath = strFilePath; - if (strPath[0] != '/') - { // Not absolute path, add the default root path at the beginning. - if (strPath.find(_defaultResRootPath) != 0) - {// Didn't find "assets/" at the beginning of the path, adding it. - strPath.insert(0, _defaultResRootPath); - } - } - - return access(strPath.c_str(), F_OK) != -1 ? true : false; -} - -NS_CC_END diff --git a/cocos2dx/platform/emscripten/CCFileUtilsEmscripten.h b/cocos2dx/platform/emscripten/CCFileUtilsEmscripten.h deleted file mode 100644 index 6825f3fae1..0000000000 --- a/cocos2dx/platform/emscripten/CCFileUtilsEmscripten.h +++ /dev/null @@ -1,60 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010-2013 cocos2d-x.org - - 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 __CC_FILEUTILS_BLACKBERRY_H__ -#define __CC_FILEUTILS_BLACKBERRY_H__ - -#include "platform/CCFileUtils.h" -#include "platform/CCPlatformMacros.h" -#include "ccTypes.h" -#include -#include - -NS_CC_BEGIN - -/** - * @addtogroup platform - * @{ - */ - -//! @brief Helper class to handle file operations -class CC_DLL FileUtilsEmscripten : public FileUtils -{ - friend class FileUtils; - FileUtilsEmscripten(); - -public: - /* override funtions */ - bool init(); - virtual std::string getWritablePath() const; - virtual bool isFileExist(const std::string& strFilePath) const; - virtual bool isAbsolutePath(const std::string& strPath) const; -}; - -// end of platform group -/// @} - -NS_CC_END - -#endif // __CC_FILEUTILS_BLACKBERRY_H__ - diff --git a/cocos2dx/platform/emscripten/CCGL.h b/cocos2dx/platform/emscripten/CCGL.h deleted file mode 100644 index 6165aaac07..0000000000 --- a/cocos2dx/platform/emscripten/CCGL.h +++ /dev/null @@ -1,49 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010 cocos2d-x.org - -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 __CCGL_H__ -#define __CCGL_H__ - -#define glClearDepth glClearDepthf -#define GL_BGRA GL_BGRA_EXT - -#define GL_DEPTH24_STENCIL8 GL_DEPTH24_STENCIL8_OES -#define GL_WRITE_ONLY GL_WRITE_ONLY_OES - -#include -//#include - -// normal process -#include -#include - -//declare here while define in EGLView.cpp -extern PFNGLGENVERTEXARRAYSOESPROC glGenVertexArrays; -extern PFNGLBINDVERTEXARRAYOESPROC glBindVertexArray; -extern PFNGLDELETEVERTEXARRAYSOESPROC glDeleteVertexArrays; -extern PFNGLMAPBUFFEROESPROC glMapBuffer; -extern PFNGLUNMAPBUFFEROESPROC glUnmapBuffer; -extern PFNGLGETBUFFERPOINTERVOESPROC glGetBufferPointerv; - -#endif // __CCGL_H__ diff --git a/cocos2dx/platform/emscripten/CCImage.cpp b/cocos2dx/platform/emscripten/CCImage.cpp deleted file mode 100644 index 6746ff94d0..0000000000 --- a/cocos2dx/platform/emscripten/CCImage.cpp +++ /dev/null @@ -1,359 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010 cocos2d-x.org - - 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. - ****************************************************************************/ -#define __CC_PLATFORM_IMAGE_CPP__ -#include "platform/CCImageCommon_cpp.h" - -#include -#include -#include -#include -#include -#include "platform/CCImage.h" -#include "platform/CCFileUtils.h" -#include "platform/CCCommon.h" -#include "CCStdC.h" -#include -#include -#include -#include - -#define szFont_kenning 2 - -#define RSHIFT6(num) ((num)>>6) - -using namespace std; - -struct TextLine { - std::string sLineStr; - int iLineWidth; -}; - -NS_CC_BEGIN - -class BitmapDC -{ -public: - BitmapDC() - { - iInterval = szFont_kenning; - _data = NULL; - reset(); - } - - ~BitmapDC(void) - { - } - - void reset() { - iMaxLineWidth = 0; - iMaxLineHeight = 0; - vLines.clear(); - } - - void buildLine(std::stringstream& ss, TTF_Font *face) - { - TextLine oTempLine; - ss << '\0'; - oTempLine.sLineStr = ss.str(); - - int w, h; - TTF_SizeText(face, oTempLine.sLineStr.c_str(), &w, &h); - - oTempLine.iLineWidth = w; - - iMaxLineWidth = MAX(iMaxLineWidth, oTempLine.iLineWidth); - ss.clear(); - ss.str(""); - vLines.push_back(oTempLine); - } - - bool divideString(TTF_Font *face, const char* sText, int iMaxWidth, int iMaxHeight) { - std::stringstream ss; - int w, h; - - // if there is no maximum width specified, just slam the whole input - // string into a single line, thereby avoiding many expensive calls to - // compute font metrics. - if(iMaxWidth == 0) - { - std::string text = sText; - ss << text; - buildLine(ss, face); - return true; - } - - std::vector words; - std::string text = sText; - std::istringstream iss(text); - copy(std::istream_iterator(iss), - std::istream_iterator(), - std::back_inserter< vector >(words)); - - for(std::vector::iterator i = words.begin(); i != words.end(); ++i) - { - // Specially handle the case where a single word exceeds the - // available width. - TTF_SizeText(face, i->c_str(), &w, &h); - if(w > iMaxWidth) - { - buildLine(ss, face); - for(std::string::iterator c = i->begin(); c != i->end(); ++c) - { - ss << *c; - TTF_SizeText(face, ss.str().c_str(), &w, &h); - if(w > iMaxWidth) - { - buildLine(ss, face); - } - } - continue; - } - - std::string tmp = ss.str() + std::string(" ") + *i; - TTF_SizeText(face, tmp.c_str(), &w, &h); - if(w > iMaxWidth) - { - buildLine(ss, face); - ss << *i; - } - else - { - ss << " " << *i; - } - } - - buildLine(ss, face); - - return true; - } - - /** - * compute the start pos of every line - * - * return >0 represent the start x pos of the line - * while -1 means fail - * - */ - int computeLineStart(Image::TextAlign eAlignMask, int lineWidth, int maxLineWidth) - { - int result = 0; - if( eAlignMask == Image::TextAlign::CENTER || - eAlignMask == Image::TextAlign::TOP || - eAlignMask == Image::TextAlign::BOTTOM) - { - result = (maxLineWidth / 2) - (lineWidth / 2); - } - else if(eAlignMask == Image::TextAlign::RIGHT || - eAlignMask == Image::TextAlign::TOP_RIGHT || - eAlignMask == Image::TextAlign::BOTTOM_RIGHT) - { - result = maxLineWidth - lineWidth; - } - // In all other cases (left alignment, most likely), return 0. - - // Attempt to ensure that we don't produce any completely invalid reslts. - if(result < 0) - { - result = 0; - } - return result; - } - - int computeLineStartY(Image::TextAlign eAlignMask, int lineHeight, int maxLineHeight) - { - int result = 0; - if( eAlignMask == Image::TextAlign::CENTER || - eAlignMask == Image::TextAlign::RIGHT || - eAlignMask == Image::TextAlign::LEFT) - { - result = (maxLineHeight / 2) - (lineHeight / 2); - } - else if(eAlignMask == Image::TextAlign::BOTTOM || - eAlignMask == Image::TextAlign::BOTTOM_RIGHT || - eAlignMask == Image::TextAlign::BOTTOM_LEFT) - { - result = maxLineHeight - lineHeight; - } - // In all other cases (top alignment, most likely), return 0; - - if(result < 0) - { - result = 0; - } - return result; - } - - bool getBitmap(const char *text, int nWidth, int nHeight, Image::TextAlign eAlignMask, const char * pFontName, float fontSize) { - const char* pText = text; - int pxSize = (int)fontSize; - - TTF_Font *face = TTF_OpenFont(pFontName, pxSize); - if(!face) - { - return false; - } - - divideString(face, text, nWidth, nHeight); - - //compute the final line width - iMaxLineWidth = MAX(iMaxLineWidth, nWidth); - - iMaxLineHeight = pxSize; - iMaxLineHeight *= vLines.size(); - - //compute the final line height - iMaxLineHeight = MAX(iMaxLineHeight, nHeight); - - uint bitmapSize = iMaxLineWidth * iMaxLineHeight * 4; - _data = new unsigned char[bitmapSize]; - memset(_data, 0, bitmapSize); - - if(!strlen(text)) - { - return true; - } - - // XXX: Can this be optimized by inserting newlines into the string and - // making a single TTF_RenderText_Solid call? Could conceivably just - // pass back SDL's buffer then, though would need additional logic to - // call SDL_FreeSurface appropriately. - - // Y offset for vertical alignment remains constant throughout, as it - // is the entire block of text that must be vertically aligned. - int yOffset = computeLineStartY(eAlignMask, vLines.size() * pxSize, iMaxLineHeight); - - for (size_t l = 0; l < vLines.size(); l++) { - pText = vLines[l].sLineStr.c_str(); - if(!strlen(pText)) - { - continue; - } - - SDL_Color color = { 0xff, 0xff, 0xff, 0xff }; - SDL_Surface *tSurf = TTF_RenderText_Solid(face, pText, color); - if(!tSurf) - { - TTF_CloseFont(face); - return false; - } - - // The lock/unlock pair is required since Emscripten's SDL - // implementation copies pixel data from its off-screen canvas to - // the pixels array in the unlock operation. Without this, we would - // be reading uninitialized memory. - SDL_LockSurface(tSurf); - SDL_UnlockSurface(tSurf); - - // We treat pixels as 32-bit words, since both source and target - // are rendered as such. - int *pixels = (int*)tSurf->pixels; - int *out = (int*)_data; - - // Compute offset to produce horizontal alignment. - int xOffset = computeLineStart(eAlignMask, tSurf->w, iMaxLineWidth); - - // (i, j) should be treated as (x, y) coordinates in the source - // bitmap. This loop maps those locations to the target bitmap. - // Need to ensure that those values do not exceed the allocated - // memory. - int minWidth = MIN(tSurf->w, iMaxLineWidth); - for(int j = 0; j < tSurf->h && (j + l * pxSize) < iMaxLineHeight; ++j) - { - for(int i = 0; i < minWidth; ++i) - { - int sourceOffset = j * tSurf->w + i; - int targetOffset = (l * pxSize + j + yOffset) * iMaxLineWidth + i + xOffset; - - // HTML5 canvas is non-pre-alpha-multiplied, so alpha-multiply here. - unsigned char *p = (unsigned char*) &pixels[sourceOffset]; - out[targetOffset] = CC_RGB_PREMULTIPLY_ALPHA( p[0], p[1], p[2], p[3] ); - } - } - SDL_FreeSurface(tSurf); - } - - // clear all lines - vLines.clear(); - - TTF_CloseFont(face); - - return true; - } - -public: - unsigned char *_data; - int libError; - vector vLines; - int iInterval; - int iMaxLineWidth; - int iMaxLineHeight; -}; - -static BitmapDC& sharedBitmapDC() -{ - static BitmapDC s_BmpDC; - return s_BmpDC; -} - -bool Image::initWithString( - const char * pText, - int nWidth/* = 0*/, - int nHeight/* = 0*/, - TextAlign eAlignMask/* = kAlignCenter*/, - const char * pFontName/* = nil*/, - int nSize/* = 0*/) -{ - bool bRet = false; - do - { - CC_BREAK_IF(! pText); - BitmapDC &dc = sharedBitmapDC(); - - std::string fullFontName = pFontName; - std::string lowerCasePath = fullFontName; - std::transform(lowerCasePath.begin(), lowerCasePath.end(), lowerCasePath.begin(), ::tolower); - - CC_BREAK_IF(! dc.getBitmap(pText, nWidth, nHeight, eAlignMask, fullFontName.c_str(), nSize)); - - // assign the dc._data to _data in order to save time - _data = dc._data; - CC_BREAK_IF(! _data); - - _width = (short)dc.iMaxLineWidth; - _height = (short)dc.iMaxLineHeight; - _preMulti = true; - _renderFormat = Texture2D::PixelFormat::RGBA8888; - _dataLen = _width * _height * 4; - - bRet = true; - - dc.reset(); - - } while (0); - - return bRet; -} - -NS_CC_END - diff --git a/cocos2dx/platform/emscripten/CCStdC.h b/cocos2dx/platform/emscripten/CCStdC.h deleted file mode 100644 index abcb9bd923..0000000000 --- a/cocos2dx/platform/emscripten/CCStdC.h +++ /dev/null @@ -1,48 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010 cocos2d-x.org - -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 __CC_STD_C_H__ -#define __CC_STD_C_H__ - -#include "platform/CCPlatformMacros.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifndef MIN -#define MIN(x,y) (((x) > (y)) ? (y) : (x)) -#endif // MIN - -#ifndef MAX -#define MAX(x,y) (((x) < (y)) ? (y) : (x)) -#endif // MAX - -#endif // __CC_STD_C_H__ - diff --git a/cocos2dx/platform/emscripten/CCTextureCacheEmscripten.cpp b/cocos2dx/platform/emscripten/CCTextureCacheEmscripten.cpp deleted file mode 100644 index d317fa5940..0000000000 --- a/cocos2dx/platform/emscripten/CCTextureCacheEmscripten.cpp +++ /dev/null @@ -1,194 +0,0 @@ -/**************************************************************************** -Copyright (c) 2013 Zynga 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. -****************************************************************************/ - -#include "CCTextureCacheEmscripten.h" -#include "platform/CCImage.h" -#include "platform/CCFileUtils.h" -#include -#include - -using namespace cocos2d; -using namespace std; - -#define MULTILINE(...) #__VA_ARGS__ - -// Following methods are implemented in TextureCacheEmscripten.js: -extern "C" { -void cocos2dx_newAsyncImageLoader(int textureCache, int callback__ignored); -void cocos2dx_asyncImageLoader_LoadImage(const char *path, TextureCache::AsyncStruct *asyncData); -void cocos2dx_shutdownAsyncImageLoader(); -}; - -extern "C" { -// This C interface is exposed so that the JavaScript in -// TextureCacheEmscripten.js is able to call into these functions. -void TextureCacheEmscripten_addImageAsyncCallBack(TextureCacheEmscripten *tc, TextureCache::AsyncStruct *data, unsigned char *imgData, int width, int height); -void TextureCacheEmscripten_preMultiplyImageRegion( unsigned char *in, int win, int hin, unsigned char *out, int wout, int hout, int xout, int yout); -}; - -void TextureCacheEmscripten_addImageAsyncCallBack(TextureCacheEmscripten *tc, TextureCache::AsyncStruct *data, unsigned char *imgData, int width, int height) -{ - tc->addImageAsyncCallBack_emscripten(data, imgData, width, height); -} - -/** - * Construct a new TextureCacheEmscripten object. Note that the code in - * TextureCacheEmscripten.js will be injected into the JavaScript runtime as - * a side-affect. - */ -TextureCacheEmscripten::TextureCacheEmscripten() -{ - // Add dummy references to these functions so that the compiler will emit - // code for them prior to this point (which is before when we will call - // them. - int deps[] = { - (int)&TextureCacheEmscripten_addImageAsyncCallBack, - (int)&TextureCacheEmscripten_preMultiplyImageRegion - }; - - cocos2dx_newAsyncImageLoader((int)this, (int)&deps); -} - -/** - * Destroy this object. Note that this will shutdown the image processing queue - * (and hence stall anything waiting for those images to finish loading), and - * unload the classes and objects instantiated in JavaScript to make this class - * work. - */ -TextureCacheEmscripten::~TextureCacheEmscripten() -{ - cocos2dx_shutdownAsyncImageLoader(); -} - -/** - * "Blit" the input image to a particular location on the target image. Output - * image will be alpha pre-multiplied in the process. - * - * @in: Pointer to input image raw data bytes - * @win: Width of input image in pixels - * @hin: Height of input image in pixels - * @out: Pointer to memory where output image raw pixels should be written - * @wout: Width of output image in pixels - * @hout: Height of output image in pixels - * @xout: x-offset into target image where blitted image should be placed - * @yout: y-offset into target image where blitted image should be placed - */ -void TextureCacheEmscripten_preMultiplyImageRegion( - unsigned char *in, int win, int hin, // Input image, its width and height - unsigned char *out, int wout, int hout, // Output image, its width and height - int xout, int yout) // x and y offsets into the output image -{ - int iter = 0; - for(int j = 0; j < hin; j++) - { - for(int i = 0; i < win; i++) - { - int inOffset = 4 * (j * win + i); - int outOffset = 4 * ((j + yout) * wout + (i + xout)); - - unsigned char *pin = in + inOffset; - unsigned int *pout = (unsigned int *) (out + outOffset); - - *pout = CC_RGB_PREMULTIPLY_ALPHA( pin[0], pin[1], pin[2], pin[3] ); - } - } -} - -/** - * "Private" callback method to load a texture based on the image data - * generated in TextureCacheEmscripten.js. Exposed here as public so that it - * can be called from the C wrapper method - * @TextureCacheEmscripten_addImageAsyncCallBack, above. - */ -void TextureCacheEmscripten::addImageAsyncCallBack_emscripten(AsyncStruct *data, unsigned char *imgData, int width, int height) -{ - const char *filename = data->filename.c_str(); - - Image *pImage = new Image(); - pImage->initWithRawData((unsigned char*) imgData, 4 * width * height, width, height, 8, true); - - free(imgData); - - Texture2D *texture = new Texture2D(); - texture->initWithImage(pImage); - -#if CC_ENABLE_CACHE_TEXTURE_DATA - // cache the texture file name - VolatileTexture::addImageTexture(texture, filename, Image::kFmtRawData); -#endif - - // cache the texture - _textures.insert( std::make_pair(filename, texture) ); - texture->retain(); - texture->autorelease(); - - Object *target = data->target; - SEL_CallFuncO selector = data->selector; - - if (target && selector) - { - (target->*selector)(texture); - target->release(); - } - - pImage->release(); - delete data; -} - -void TextureCacheEmscripten::addImageAsync(const char *path, Object *target, SEL_CallFuncO selector) -{ - CCAssert(path != NULL, "TextureCache: fileimage MUST not be NULL"); - - Texture2D *texture = NULL; - - // optimization - std::string pathKey = FileUtils::getInstance()->fullPathForFilename(path); - auto it = _textures.find(pathKey); - if( it != _textures.end() ) - texture = it->second; - - std::string fullpath = pathKey; - if (texture != NULL) - { - if (target && selector) - { - (target->*selector)(texture); - } - - return; - } - - if (target) - { - target->retain(); - } - - // generate async struct - AsyncStruct *data = new AsyncStruct(fullpath, target, selector); - - // Call into JavaScript code in TextureCacheEmscripten.js to do the rest. - cocos2dx_asyncImageLoader_LoadImage(data->filename.c_str(), data); - - return; -} diff --git a/cocos2dx/platform/emscripten/CCTextureCacheEmscripten.h b/cocos2dx/platform/emscripten/CCTextureCacheEmscripten.h deleted file mode 100644 index 9f5db79821..0000000000 --- a/cocos2dx/platform/emscripten/CCTextureCacheEmscripten.h +++ /dev/null @@ -1,55 +0,0 @@ -/**************************************************************************** -Copyright (c) 2013 Zynga 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 __CCTEXTURE_CACHE_EMSCRIPTEN_H__ -#define __CCTEXTURE_CACHE_EMSCRIPTEN_H__ - -#include "textures/CCTextureCache.h" - -NS_CC_BEGIN - -class CC_DLL TextureCacheEmscripten : public TextureCache -{ -public: - /** - * @js ctor - */ - TextureCacheEmscripten(); - /** - * @js NA - * @lua NA - */ - virtual ~TextureCacheEmscripten(); - - void addImageAsync(const char *path, Object *target, SEL_CallFuncO selector); - - /* Public method since we need to call it from C code to workaround linkage from JS. - */ - void addImageAsyncCallBack_emscripten(AsyncStruct *data, unsigned char *imgData, int width, int height); - -}; - -NS_CC_END - -#endif diff --git a/cocos2dx/platform/emscripten/CCTextureCacheEmscripten.js b/cocos2dx/platform/emscripten/CCTextureCacheEmscripten.js deleted file mode 100644 index abbec0d97e..0000000000 --- a/cocos2dx/platform/emscripten/CCTextureCacheEmscripten.js +++ /dev/null @@ -1,302 +0,0 @@ -/**************************************************************************** -Copyright (c) 2013 Zynga 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. -****************************************************************************/ - - -// Non-namespaced facade over underlying objects. See above methods for -// documentation. These methods serve two purposes: -// -// 1. convert types to/from JS equivalents. -// 2. expose a "C-like" interface, such that the symbols are easy to find -// for calling code (Emscripten provides no easy way to access nested -// dictionaries). -// -// Note that the leading '_' is because Emscripten prefixes all function -// calls like this. Since this code is being injected at runtime, -// Emscripten's compiler doesn't have a chance to add it for us. - - -var LibraryCocosHelper = { - $cocos2dx__deps: [ '_CCTextureCacheEmscripten_preMultiplyImageRegion' ], - $cocos2dx: { - objects: {}, - classes: { - // AsyncOperationQueue -- simple worker queue. Note that all functions - // passed in should effectively be "static", and have all requisite - // information contained in their args object. - AsyncOperationQueue: function() - { - this.ops = []; - this.timeoutId = null; - - // Target using 2/3 of available CPU for texture loading. - this.sliceBudget = 8; - this.sliceInterval = 4; - - /** - * If there is a valid scheduled queue consumer, cancel it. Won't cancel - * currently executing operations (as this is not multi-threaded), but will - * prevent future execution from happening until it is re-scheduled. - */ - this.unschedule = function(interval) - { - if(typeof this.timeoutId == "number") - { - clearTimeout(this.timeoutId); - this.timeoutId = null; - } - }; - - /** - * Schedule the queue-processor to run @interval ms in the future. - */ - this.schedule = function(interval) - { - this.unschedule(); - - var that = this; - var o = function() { - that.run(); - }; - - this.timeoutId = setTimeout(o, interval); - }; - - /** - * Enqueue a funtcion @fn with arguments @args to run asynchronously at - * some point in the future, then return control to the caller. Operations - * are guaranteed to be run in the order in which they are enqueued, but no - * guarantee is given about when or in what context they will be executed. - */ - this.enqueue = function(fn, args) - { - var op = { - fn: fn, - args: args - }; - this.ops.push(op); - this.schedule(this.sliceInterval); - }; - - /** - * Start running the consumer "thread". Will consume operations from the - * queue until such time as either the queue is empty, or it has exceeded - * its time budget. If the latter case (budget exceeded), it will - * reschedule itself to run again later and finish draining the queue. - * - * Rescheduling logic still in flux, but the objective is to try to - * schedule it to run at some point after the next frame has been - * requested, whilst still maintaining maximum bandwidth. - */ - this.run = function() - { - if(this.ops.length === 0) - { - return; - } - - var start = +new Date(); - var end = +new Date(); - while(this.ops.length && ((end - start) < this.sliceBudget)) - { - var op = this.ops.shift(); - op.fn(op.args); - end = +new Date(); - } - - if(this.ops.length) - { - this.schedule(this.sliceInterval); - } - }; - - /** - * Unschedule any remaining operations in the queue. - */ - this.shutdown = function() - { - this.unschedule(); - this.ops = []; - }; - }, - - /** - * Construct a new AsyncImageLoader object. @cxxTextureCache should be a - * pointer to a valid CCTextureCacheEmscripten object in C++. - */ - AsyncImageLoader: function(cxxTextureCache) - { - this.cxxTextureCache = cxxTextureCache; - this.operationQueue = new cocos2dx.classes.AsyncOperationQueue(); - - // Since there will only ever be one image being processed at a time, - // we pre-initialize a canvas object and use it for all operations so - // as to save doing this for every image, incurring (probably) both - // compute work and memory fragmentation. - this.canvas = document.createElement('canvas'); - this.ctx = this.canvas.getContext('2d'); - - this.regionSize = 128; - - /** - * "Private" and "static" method to copy an input image to a given - * rectangle in the output image. Used by @loadImage. - */ - this._blitAndPremultipyRegion = function(args) - { - // Calculate width and height for this region such that we - // do not run off the edge of the image. - var rw = Math.min(args.i + this.regionSize, args.w) - args.i; - var rh = Math.min(args.j + this.regionSize, args.h) - args.j; - - this.ctx.drawImage(args.img, args.i, args.j, rw, rh, args.i, args.j, rw, rh); - - var imgData = this.ctx.getImageData(args.i, args.j, rw, rh); - var inImgData = _malloc(rw * rh * 4); - Module.HEAP8.set(imgData.data, inImgData); - - // Call into C++ code in CCTextureCacheEmscripten.cpp to do the actual - // copy and pre-multiply. - _CCTextureCacheEmscripten_preMultiplyImageRegion(inImgData, rw, rh, args.outImgData, args.w, args.h, args.i, args.j); - - _free(inImgData); - }; - - /** - * Enqueue the image at @path (interpreted as a URL) to be asynchronously - * loaded, then call the cocos2dx callback specified in @asyncData. Image - * fetch happens asynchronously using browser asset management code, and - * the work of copying pixel data to a buffer (for use by cocos2dx) is - * spread out over several frames such that disruptions to frame rate are - * minimized. - */ - this.loadImage = function(path, asyncData) - { - var img = new Image(); - var that = this; - - img.onload = function() - { - var w = img.width; - var h = img.height; - - // Setup the canvas in the queue also so that it happens in order - // with the operations that depend on the canvas having been - // configured to this resolution. We can get away with this since - // the queue guarantees that operations are executed in the order - // in which they are enqueued. - var setupCanvas = function(args) - { - that.canvas.width = args.w; - that.canvas.height = args.h; - }; - that.operationQueue.enqueue(setupCanvas, { w: w, h: h }); - - var outImgData = _malloc(w * h * 4); - - for(var i = 0; i < w; i += that.regionSize) - { - for(var j = 0; j < h; j += that.regionSize) - { - var args = { - i: i, j: j, - w: w, h: h, - img: img, - outImgData: outImgData - }; - that.operationQueue.enqueue(function(a) { that._blitAndPremultipyRegion(a); }, args); - } - } - - var fireCallback = function(args) { - _CCTextureCacheEmscripten_addImageAsyncCallBack(that.cxxTextureCache, args.asyncData, args.imgData, args.w, args.h); - }; - var opArgs = { - asyncData: asyncData, - imgData: outImgData, - w: w, h: h - }; - that.operationQueue.enqueue(fireCallback, opArgs); - }; - - img.onerror = function() - { - console.log("Error loading '" + path + "'"); - }; - - img.src = path; - }; - - /** - * Shutdown this image loader object. Used by destructor in cocos2dx. - */ - this.shutdown = function() - { - this.operationQueue.shutdown(); - }; - } - } - }, - - /* - * Construct a new AsyncImageLoader object. Held as a singleton, referred - * to in other wrapper methods here. - * @deps__ignored is ignored, but is accepted so that we can communicate to - * the compiler what functions we need to ensure are ready by the time this - * class gets instantiated. - */ - cocos2dx_newAsyncImageLoader: function(cxxTextureCache, deps__ignored) - { - cocos2dx.objects.asyncImageLoader = new cocos2dx.classes.AsyncImageLoader(cxxTextureCache); - }, - - /** - * Shutdown the current image loader object. Used by the cocos2dx - * destructor method. - */ - cocos2dx_shutdownAsyncImageLoader: function() - { - cocos2dx.objects.asyncImageLoader.shutdown(); - cocos2dx.objects.asyncImageLoader = null; - }, - - /** - * Load a new image asynchronously. - */ - cocos2dx_asyncImageLoader_LoadImage: function(path, asyncData) - { - var opArgs = { - path: Pointer_stringify(path), - data: asyncData - }; - var op = function(args) - { - cocos2dx.objects.asyncImageLoader.loadImage(args.path, args.data); - }; - cocos2dx.objects.asyncImageLoader.operationQueue.enqueue(op, opArgs); - } -}; - -autoAddDeps(LibraryCocosHelper, '$cocos2dx'); -mergeInto(LibraryManager.library, LibraryCocosHelper); - diff --git a/cocos2dx/platform/ios/CCPlatformDefine.h b/cocos2dx/platform/ios/CCPlatformDefine.h deleted file mode 100644 index 789ea77e08..0000000000 --- a/cocos2dx/platform/ios/CCPlatformDefine.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef __CCPLATFORMDEFINE_H__ -#define __CCPLATFORMDEFINE_H__ - -#include - -#define CC_DLL - -#define CC_ASSERT(cond) assert(cond) - - -#define CC_UNUSED_PARAM(unusedparam) (void)unusedparam - -/* Define NULL pointer value */ -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - - - -#endif /* __CCPLATFORMDEFINE_H__*/ diff --git a/cocos2dx/platform/nacl/CCApplication.cpp b/cocos2dx/platform/nacl/CCApplication.cpp deleted file mode 100644 index 4b335dac8d..0000000000 --- a/cocos2dx/platform/nacl/CCApplication.cpp +++ /dev/null @@ -1,116 +0,0 @@ -/**************************************************************************** -Copyright (c) 2013 The Chromium Authors - -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 "CCApplication.h" -#include "CCEGLView.h" -#include -#include -#include -#include "CCDirector.h" - -NS_CC_BEGIN - -Application* Application::sm_pSharedApplication = 0; -bool Application::s_running = false; - -/* -static long getCurrentMillSecond() -{ - long lLastTime; - struct timeval stCurrentTime; - gettimeofday(&stCurrentTime,NULL); - // millseconds - lLastTime = stCurrentTime.tv_sec * 1000 + stCurrentTime.tv_usec * 0.001; - return lLastTime; -} -*/ - -Application::Application() -{ - CC_ASSERT(!sm_pSharedApplication); - sm_pSharedApplication = this; - setAnimationInterval(1.0f/60.0f); -} - -Application::~Application() -{ - CC_ASSERT(this == sm_pSharedApplication); - sm_pSharedApplication = NULL; -} - -int Application::run() -{ - // Initialize instance and cocos2d. - if (!applicationDidFinishLaunching()) - return 0; - - s_running = true; - for (;;) - { - //long iLastTime = getCurrentMillSecond(); - Director::getInstance()->mainLoop(); - EGLView::getInstance()->ProcessEventQueue(); - - //long iCurTime = getCurrentMillSecond(); - /* - if (iCurTime-iLastTime<_animationInterval) - { - usleep((_animationInterval - iCurTime+iLastTime)*1000); - } - */ - } - - s_running = false; - return -1; -} - -void Application::setAnimationInterval(double interval) -{ - _animationInterval = interval * 1000.0f; -} - -Application::Platform Application::getTargetPlatform() -{ - return Platform::OS_NACL; -} - -Application* Application::getInstance() -{ - CC_ASSERT(sm_pSharedApplication); - return sm_pSharedApplication; -} - -// @deprecated Use getInstance() instead -Application* Application::sharedApplication() -{ - return Application::getInstance(); -} - -LanguageType Application::getCurrentLanguage() -{ - LanguageType ret = LanguageType::ENGLISH; - return ret; -} - -NS_CC_END diff --git a/cocos2dx/platform/nacl/CCApplication.h b/cocos2dx/platform/nacl/CCApplication.h deleted file mode 100644 index 7b587e2e70..0000000000 --- a/cocos2dx/platform/nacl/CCApplication.h +++ /dev/null @@ -1,85 +0,0 @@ -/**************************************************************************** -Copyright (c) 2013 The Chromium Authors - -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 __CCAPLICATION_H__ -#define __CCAPLICATION_H__ - -#include "platform/CCCommon.h" -#include "platform/CCApplicationProtocol.h" - -NS_CC_BEGIN -class Rect; - -class Application : public ApplicationProtocol -{ -public: - /** - * @js ctor - */ - Application(); - /** - * @js NA - * @lua NA - */ - virtual ~Application(); - - /** - @brief Callback by Director for limit FPS. - @param interval The time, which expressed in second in second, between current frame and next. - */ - void setAnimationInterval(double interval); - - /** - @brief Run the message loop. - */ - int run(); - - /** - @brief Get current applicaiton instance. - @return Current application instance pointer. - */ - static Application* getInstance(); - - /** @deprecated Use getInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static Application* sharedApplication(); - - /* override functions */ - virtual LanguageType getCurrentLanguage(); - - /** - @brief Get target platform - */ - virtual Platform getTargetPlatform(); - - static bool isRunning() { return s_running; } -protected: - long _animationInterval; // microseconds - - static bool s_running; // is the application running - static Application* sm_pSharedApplication; -}; - -NS_CC_END - -#endif /* __CCAPLICATION_H__ */ diff --git a/cocos2dx/platform/nacl/CCCommon.cpp b/cocos2dx/platform/nacl/CCCommon.cpp deleted file mode 100644 index 898ea70d70..0000000000 --- a/cocos2dx/platform/nacl/CCCommon.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/**************************************************************************** -Copyright (c) 2013 The Chromium Authors - -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 "platform/CCCommon.h" -#include "CCStdC.h" - -NS_CC_BEGIN - -#define MAX_LEN (cocos2d::kMaxLogLen + 1) - -// XXX deprecated -void CCLog(const char * pszFormat, ...) -{ - char szBuf[MAX_LEN]; - - va_list ap; - va_start(ap, pszFormat); - vsnprintf( szBuf, MAX_LEN, pszFormat, ap); - va_end(ap); - - // Strip any trailing newlines from log message. - size_t len = strlen(szBuf); - while (len && szBuf[len-1] == '\n') - { - szBuf[len-1] = '\0'; - len--; - } - - fprintf(stderr, "cocos2d-x debug info [%s]\n", szBuf); -} - -void log(const char * pszFormat, ...) -{ - char szBuf[MAX_LEN]; - - va_list ap; - va_start(ap, pszFormat); - vsnprintf( szBuf, MAX_LEN, pszFormat, ap); - va_end(ap); - - // Strip any trailing newlines from log message. - size_t len = strlen(szBuf); - while (len && szBuf[len-1] == '\n') - { - szBuf[len-1] = '\0'; - len--; - } - - fprintf(stderr, "cocos2d-x debug info [%s]\n", szBuf); -} - -void MessageBox(const char * pszMsg, const char * pszTitle) -{ - log("%s: %s", pszTitle, pszMsg); -} - -void LuaLog(const char * pszFormat) -{ - log("%s", pszFormat); -} - -NS_CC_END diff --git a/cocos2dx/platform/nacl/CCDevice.cpp b/cocos2dx/platform/nacl/CCDevice.cpp deleted file mode 100644 index 21ffe67e95..0000000000 --- a/cocos2dx/platform/nacl/CCDevice.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/**************************************************************************** -Copyright (c) 2013 The Chromium Authors - -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 "platform/CCDevice.h" - -NS_CC_BEGIN - -int Device::getDPI() -{ - //TODO(sbc): - return 160; -} - -NS_CC_END diff --git a/cocos2dx/platform/nacl/CCEGLView.cpp b/cocos2dx/platform/nacl/CCEGLView.cpp deleted file mode 100644 index b0daeb3681..0000000000 --- a/cocos2dx/platform/nacl/CCEGLView.cpp +++ /dev/null @@ -1,340 +0,0 @@ -/**************************************************************************** -Copyright (c) 2013 The Chromium Authors - -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 "CCEGLView.h" -#include "CCGL.h" -#include "ccMacros.h" -#include "CCDirector.h" -#include "CCInstance.h" -#include "event_dispatcher/CCTouch.h" -#include "touch_dispatcher/CCTouchDispatcher.h" -#include "text_input_node/CCIMEDispatcher.h" - -#include "ppapi/c/ppb_opengles2.h" -#include "ppapi/cpp/graphics_3d.h" -#include "ppapi/cpp/graphics_3d_client.h" -#include "ppapi/cpp/size.h" -#include "ppapi/cpp/module.h" -#include "ppapi/cpp/completion_callback.h" -#include "ppapi/gles2/gl2ext_ppapi.h" - -class OpenGLContext : public pp::Graphics3DClient -{ -public: - OpenGLContext(pp::Instance* instance, pp::Size size); - ~OpenGLContext(); - - virtual void Graphics3DContextLost() - { - assert(!"Unexpectedly lost graphics context"); - } - - bool MakeContextCurrent(); - void InvalidateContext(); - void ResizeContext(int width, int height); - void FlushContext(); - pp::Size GetSize() { return _size; } -private: - pp::Size _size; - pp::Graphics3D _graphics3d; - const struct PPB_OpenGLES2* _gles2_interface; - pp::Instance* _instance; -}; - -OpenGLContext::OpenGLContext(pp::Instance* instance, pp::Size size) : - pp::Graphics3DClient(instance), _size(size), _instance(instance) -{ - pp::Module* module = pp::Module::Get(); - assert(module); - _gles2_interface = static_cast( - module->GetBrowserInterface(PPB_OPENGLES2_INTERFACE)); - assert(_gles2_interface); -} - -OpenGLContext::~OpenGLContext() -{ - CCLOG("OpenGLContext::~OpenGLContext"); - glSetCurrentContextPPAPI(0); -} - -bool OpenGLContext::MakeContextCurrent() -{ - CCLOG("OpenGLContext::MakeContextCurrent %dx%d", - _size.width(), _size.height()); - - // Lazily create the Pepper context. - if (_graphics3d.is_null()) - { - int32_t attribs[] = { - PP_GRAPHICS3DATTRIB_ALPHA_SIZE, 8, - PP_GRAPHICS3DATTRIB_DEPTH_SIZE, 24, - PP_GRAPHICS3DATTRIB_STENCIL_SIZE, 8, - PP_GRAPHICS3DATTRIB_SAMPLES, 0, - PP_GRAPHICS3DATTRIB_SAMPLE_BUFFERS, 0, - PP_GRAPHICS3DATTRIB_WIDTH, _size.width(), - PP_GRAPHICS3DATTRIB_HEIGHT, _size.height(), - PP_GRAPHICS3DATTRIB_NONE - }; - _graphics3d = pp::Graphics3D(_instance, pp::Graphics3D(), attribs); - if (_graphics3d.is_null()) - { - glSetCurrentContextPPAPI(0); - return false; - } - bool rtn = _instance->BindGraphics(_graphics3d); - assert(rtn && "BindGraphics failed"); - if (!rtn) - return false; - } - - CCLOG("glSetCurrentContextPPAPI: %p", (void*)_graphics3d.pp_resource()); - glSetCurrentContextPPAPI(_graphics3d.pp_resource()); - return true; -} - -void OpenGLContext::InvalidateContext() -{ - CCLOG("InvalidateContext"); - glSetCurrentContextPPAPI(0); -} - -void OpenGLContext::ResizeContext(int width, int height) -{ - CCLOG("OpenGLContext::ResizeContext %dx%d", width, height); - _size.SetSize(width, height); - if (!_graphics3d.is_null()) - { - _graphics3d.ResizeBuffers(width, height); - } -} - -void OpenGLContext::FlushContext() -{ - //CCLOG("OpenGLContext::FlushContext"); - _graphics3d.SwapBuffers(pp::BlockUntilComplete()); -} - - -NS_CC_BEGIN - -EGLView::EGLView() : bIsInit(false), bIsMouseDown(false), _frameZoomFactor(1.0f), _context(NULL) -{ - CCLOG("CCEGLView::EGLView"); - pthread_mutex_init(&_mutex, NULL); - initGL(); -} - -EGLView::~EGLView() -{ -} - -void EGLView::setFrameSize(float width, float height) -{ - EGLViewProtocol::setFrameSize(width, height); - if (_context) - _context->ResizeContext(width, height); -} - -void EGLView::setViewPortInPoints(float x , float y , float w , float h) -{ - glViewport((GLint)(x * _scaleX * _frameZoomFactor+ _viewPortRect.origin.x * _frameZoomFactor), - (GLint)(y * _scaleY * _frameZoomFactor + _viewPortRect.origin.y * _frameZoomFactor), - (GLsizei)(w * _scaleX * _frameZoomFactor), - (GLsizei)(h * _scaleY * _frameZoomFactor)); -} - -void EGLView::setScissorInPoints(float x , float y , float w , float h) -{ - glScissor((GLint)(x * _scaleX * _frameZoomFactor + _viewPortRect.origin.x * _frameZoomFactor), - (GLint)(y * _scaleY * _frameZoomFactor + _viewPortRect.origin.y * _frameZoomFactor), - (GLsizei)(w * _scaleX * _frameZoomFactor), - (GLsizei)(h * _scaleY * _frameZoomFactor)); -} - - -bool EGLView::isOpenGLReady() -{ - return bIsInit; -} - -void EGLView::end() -{ - delete this; - exit(0); -} - -void EGLView::swapBuffers() -{ - if (!bIsInit) - return; - - _context->FlushContext(); -} - -void EGLView::setIMEKeyboardState(bool bOpen) -{ -} - -bool EGLView::initGL() -{ - CCLOG("initGL: instance=%p", g_instance); - assert(g_instance); - assert(!_context); - const pp::Size& size = g_instance->Size(); - setFrameSize(size.width(), size.height()); - _context = new OpenGLContext(g_instance, size); - CCLOG("initGL: _context=%p", _context); - bool rtn = _context->MakeContextCurrent(); - CCLOG("MakeContextCurrent returned: %d", rtn); - assert(rtn == true && "MakeContextCurrent failed"); - if (!rtn) - return false; - bIsInit = true; - return true; -} - -void EGLView::destroyGL() -{ - delete _context; - bIsInit = false; - CCLOG("destroyGL"); -} - -EGLView* EGLView::getInstance() -{ - static EGLView* s_pEglView = NULL; - if (s_pEglView == NULL) - { - CCLOG("creating EGLView"); - s_pEglView = new EGLView(); - } - return s_pEglView; -} - -// XXX: deprecated -EGLView* EGLView::sharedOpenGLView() -{ - return EGLView::getInstance(); -} - -void EGLView::HandleMouseEvent(const pp::MouseInputEvent* event) -{ - pp::Point pos = event->GetPosition(); - float x = pos.x(); - float y = pos.y(); - int touchID = 1; - - // Clamp event position to be within cocos2dx window size - Size frame_size = getFrameSize(); - float max_y = frame_size.height; - float max_x = frame_size.width; - - if (x < 0) - x = 0; - if (y < 0) - y = 0; - if (y > max_y) - y = max_y; - if (x > max_x) - x = max_x; - - switch (event->GetType()) - { - case PP_INPUTEVENT_TYPE_MOUSEDOWN: - handleTouchesBegin(1, &touchID, &x, &y); - bIsMouseDown = true; - break; - case PP_INPUTEVENT_TYPE_MOUSEUP: - handleTouchesEnd(1, &touchID, &x, &y); - bIsMouseDown = false; - break; - case PP_INPUTEVENT_TYPE_MOUSEMOVE: - if (bIsMouseDown) - handleTouchesMove(1, &touchID, &x, &y); - break; - default: - break; - } -} - -void EGLView::ProcessEventQueue() -{ - const pp::Size& size = g_instance->Size(); - // If the size of the global instance has changed then - // we need to update our GL frame size accordingly - if (size != _context->GetSize()) - { - setFrameSize(size.width(), size.height()); - } - - pthread_mutex_lock(&_mutex); - while (_event_queue.size()) - { - pp::InputEvent event = _event_queue.front(); - _event_queue.pop(); - PP_InputEvent_Type type = event.GetType(); - switch (type) - { - case PP_INPUTEVENT_TYPE_KEYDOWN: - CCLOG("got KEYDOWN"); - break; - case PP_INPUTEVENT_TYPE_KEYUP: - CCLOG("got KEYUP"); - break; - case PP_INPUTEVENT_TYPE_CHAR: - CCLOG("got KEYCHAR"); - break; - case PP_INPUTEVENT_TYPE_MOUSEENTER: - CCLOG("got MOUSEENTER"); - break; - case PP_INPUTEVENT_TYPE_MOUSELEAVE: - CCLOG("got MOUSELEAVE"); - break; - case PP_INPUTEVENT_TYPE_MOUSEDOWN: - case PP_INPUTEVENT_TYPE_MOUSEUP: - case PP_INPUTEVENT_TYPE_MOUSEMOVE: - { - const pp::MouseInputEvent* mevent = - reinterpret_cast(&event); - HandleMouseEvent(mevent); - break; - } - default: - CCLOG("unhandled event type: %d", type); - break; - } - } - pthread_mutex_unlock(&_mutex); -} - -void EGLView::AddEvent(const pp::InputEvent& event) -{ - pthread_mutex_lock(&_mutex); - _event_queue.push(event); - pthread_mutex_unlock(&_mutex); -} - -CocosPepperInstance* EGLView::g_instance; - -NS_CC_END diff --git a/cocos2dx/platform/nacl/CCEGLView.h b/cocos2dx/platform/nacl/CCEGLView.h deleted file mode 100644 index 80b987f387..0000000000 --- a/cocos2dx/platform/nacl/CCEGLView.h +++ /dev/null @@ -1,100 +0,0 @@ -/**************************************************************************** -Copyright (c) 2013 The Chromium Authors - -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 __CCEGLVIEW_H__ -#define __CCEGLVIEW_H__ - -#include "platform/CCCommon.h" -#include "cocoa/CCGeometry.h" -#include "platform/CCEGLViewProtocol.h" -#include "ppapi/cpp/input_event.h" -#include -#include - - -bool initExtensions(); - -class OpenGLContext; -class CocosPepperInstance; - -NS_CC_BEGIN - -class EGLView : public EGLViewProtocol -{ -public: - /** - * @js ctor - */ - EGLView(); - /** - * @js NA - * @lua NA - */ - virtual ~EGLView(); - - /** - * iPixelWidth, height: the window's size - * iWidth ,height: the point size, which may scale. - * iDepth is not the buffer depth of opengl, it indicate how may bits for a pixel - */ - virtual void setFrameSize(float width, float height); - virtual void setViewPortInPoints(float x , float y , float w , float h); - virtual void setScissorInPoints(float x , float y , float w , float h); - - /* - * Set zoom factor for frame. This method is for debugging big resolution (e.g.new ipad) app on desktop. - */ - virtual bool isOpenGLReady(); - virtual void end(); - virtual void swapBuffers(); - virtual void setIMEKeyboardState(bool bOpen); - - void addEvent(); - void ProcessEventQueue(); - void AddEvent(const pp::InputEvent& event); - - /** - @brief get the shared main open gl window - */ - static EGLView* getInstance(); - - /** @deprecated Use getInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static EGLView* sharedOpenGLView(); - - static CocosPepperInstance* g_instance; -private: - void HandleMouseEvent(const pp::MouseInputEvent* event); - bool initGL(); - void destroyGL(); - bool bIsInit; - bool bIsMouseDown; - float _frameZoomFactor; - OpenGLContext* _context; - std::queue _event_queue; - pthread_mutex_t _mutex; -}; - -NS_CC_END - -#endif /* __CCEGLVIEW_H__ */ diff --git a/cocos2dx/platform/nacl/CCFileUtilsNaCl.cpp b/cocos2dx/platform/nacl/CCFileUtilsNaCl.cpp deleted file mode 100644 index 631d94dca2..0000000000 --- a/cocos2dx/platform/nacl/CCFileUtilsNaCl.cpp +++ /dev/null @@ -1,71 +0,0 @@ -/**************************************************************************** -Copyright (c) 2013 The Chromium Authors - -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 "CCFileUtilsNaCl.h" - -#include - -using namespace std; - -NS_CC_BEGIN - -FileUtils* FileUtils::getInstance() -{ - if (s_sharedFileUtils == NULL) - { - s_sharedFileUtils = new FileUtilsNaCl(); - if(!s_sharedFileUtils->init()) - { - delete s_sharedFileUtils; - s_sharedFileUtils = NULL; - CCLOG("ERROR: Could not init CCFileUtilsNacl"); - } - } - return s_sharedFileUtils; -} - -std::string FileUtilsNaCl::getWritablePath() -{ - //return current resource path - return ""; -} - -bool FileUtilsNaCl::isFileExist(const std::string& strFilePath) -{ - if (0 == strFilePath.length()) - { - return false; - } - - std::string strPath = strFilePath; - if (!isAbsolutePath(strPath)) - { // Not absolute path, add the default root path at the beginning. - strPath.insert(0, _defaultResRootPath); - } - - struct stat sts; - return (stat(strPath.c_str(), &sts) != -1) ? true : false; -} - -NS_CC_END diff --git a/cocos2dx/platform/nacl/CCFileUtilsNaCl.h b/cocos2dx/platform/nacl/CCFileUtilsNaCl.h deleted file mode 100644 index e3add0692d..0000000000 --- a/cocos2dx/platform/nacl/CCFileUtilsNaCl.h +++ /dev/null @@ -1,57 +0,0 @@ -/**************************************************************************** -Copyright (c) 2013 The Chromium Authors - -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 __CC_FILEUTILS_NACL_H__ -#define __CC_FILEUTILS_NACL_H__ - -#include "platform/CCFileUtils.h" -#include "ccTypes.h" -#include - -NS_CC_BEGIN - -/** - * @addtogroup platform - * @{ - */ - -//! @brief Helper class to handle file operations -class CC_DLL FileUtilsNaCl : public FileUtils -{ -private: - friend class FileUtils; - FileUtilsNaCl() {} -public: - /* override funtions */ - bool init() { return true; } - virtual std::string getWritablePath(); - virtual bool isFileExist(const std::string& strFilePath); -}; - -// end of platform group -/// @} - -NS_CC_END - -#endif // __CC_FILEUTILS_NACL_H__ diff --git a/cocos2dx/platform/nacl/CCGL.h b/cocos2dx/platform/nacl/CCGL.h deleted file mode 100644 index cba50c5f10..0000000000 --- a/cocos2dx/platform/nacl/CCGL.h +++ /dev/null @@ -1,36 +0,0 @@ -/**************************************************************************** -Copyright (c) 2013 The Chromium Authors - -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 __CCGL_H__ -#define __CCGL_H__ - -#define GL_DEPTH24_STENCIL8 GL_DEPTH24_STENCIL8_OES -#define GL_WRITE_ONLY GL_WRITE_ONLY_OES -#define glClearDepth glClearDepthf -#define GL_BGRA GL_BGRA_EXT - -#include -#include - -#endif // __CCGL_H__ diff --git a/cocos2dx/platform/nacl/CCImage.cpp b/cocos2dx/platform/nacl/CCImage.cpp deleted file mode 100644 index aabffc176d..0000000000 --- a/cocos2dx/platform/nacl/CCImage.cpp +++ /dev/null @@ -1,528 +0,0 @@ -/**************************************************************************** -Copyright (c) 2013 The Chromium Authors - -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 - -#include -#include -#include -#include - -#include "platform/CCFileUtils.h" -#include "platform/CCPlatformMacros.h" -#define __CC_PLATFORM_IMAGE_CPP__ -#include "platform/CCImageCommon_cpp.h" -#include "platform/CCImage.h" -#include "platform/linux/CCApplication.h" - -#include "ft2build.h" -#include "CCStdC.h" - -#include FT_FREETYPE_H - -#define szFont_kenning 2 - -#define SHIFT6(num) (num>>6) - -using namespace std; - -struct TextLine { - int iLineWidth; - wchar_t* text; -}; - -NS_CC_BEGIN - -class BitmapDC -{ -public: - BitmapDC() : _data(NULL), _cachedFont(NULL) - { - libError = FT_Init_FreeType(&_library); - iInterval = szFont_kenning; - reset(); - } - - ~BitmapDC() - { - if (_cachedFont) - FT_Done_Face(_cachedFont); - FT_Done_FreeType(_library); - reset(); - } - - void reset() - { - iMaxLineWidth = 0; - iMaxLineHeight = 0; - //Free all text lines - size_t size = vLines.size(); - for (size_t i=0; iglyph->metrics.horiAdvance + face->glyph->metrics.horiBearingX - face->glyph->metrics.width))/*-iInterval*/;//TODO interval - iMaxLineWidth = MAX(iMaxLineWidth, oTempLine.iLineWidth); - - vLines.push_back(oTempLine); - } - - bool divideString(FT_Face face, const char* sText, int iMaxWidth, int iMaxHeight) - { - int iError = 0; - const char* pText = sText; - - FT_UInt unicode = utf8((char**)&pText); - iError = FT_Load_Char(face, unicode, FT_LOAD_DEFAULT); - if (iError) - return false; - - int iCurXCursor = -SHIFT6(face->glyph->metrics.horiBearingX); - - FT_UInt cLastCh = 0; - - pText = sText; - size_t text_len = 0; - wchar_t* text_buf = (wchar_t*) malloc(sizeof(wchar_t) * strlen(sText)); - while ((unicode=utf8((char**)&pText))) - { - if (unicode == '\n') - { - buildLine(text_buf, text_len, face, iCurXCursor, cLastCh); - text_len = 0; - - iError = FT_Load_Char(face, unicode, FT_LOAD_DEFAULT); - if (iError) { - free(text_buf); - return false; - } - iCurXCursor = -SHIFT6(face->glyph->metrics.horiBearingX); - continue; - } - - iError = FT_Load_Char(face, unicode, FT_LOAD_DEFAULT); - - if (iError) { - free(text_buf); - return false; - } - - //check its width - //divide it when exceeding - if ((iMaxWidth > 0 - && iCurXCursor + SHIFT6(face->glyph->metrics.width) - > iMaxWidth)) { - buildLine(text_buf, text_len, face , iCurXCursor, cLastCh); - text_len = 0; - - iCurXCursor = -SHIFT6(face->glyph->metrics.horiBearingX); - } - - cLastCh = unicode; - text_buf[text_len] = unicode; - ++text_len; - iCurXCursor += SHIFT6(face->glyph->metrics.horiAdvance) + iInterval; - } - - if (iError) - { - free(text_buf); - return false; - } - - buildLine(text_buf, text_len, face, iCurXCursor, cLastCh); - free(text_buf); - - return true; - } - - /** - * compute the start pos of every line - * - * return >0 represent the start x pos of the line - * while -1 means fail - * - */ - int computeLineStart(FT_Face face, Image::TextAlign eAlignMask, FT_UInt unicode, - int iLineIndex) - { - int iRet; - int iError = FT_Load_Char(face, unicode, FT_LOAD_DEFAULT); - if (iError) { - return -1; - } - - if (eAlignMask == Image::TextAlign::CENTER) { - iRet = (iMaxLineWidth - vLines[iLineIndex].iLineWidth) / 2 - - SHIFT6(face->glyph->metrics.horiBearingX ); - - } else if (eAlignMask == Image::TextAlign::RIGHT) { - iRet = (iMaxLineWidth - vLines[iLineIndex].iLineWidth) - - SHIFT6(face->glyph->metrics.horiBearingX ); - } else { - // left or other situation - iRet = -SHIFT6(face->glyph->metrics.horiBearingX ); - } - return iRet; - } - - int computeLineStartY(FT_Face face, Image::TextAlign eAlignMask, int txtHeight, int borderHeight) - { - int iRet = 0; - if (eAlignMask == Image::TextAlign::CENTER || eAlignMask == Image::TextAlign::LEFT || - eAlignMask == Image::TextAlign::RIGHT ) { - //vertical center - iRet = (borderHeight - txtHeight)/2; - - } else if (eAlignMask == Image::TextAlign::BOTTOM_RIGHT || - eAlignMask == Image::TextAlign::BOTTOM || - eAlignMask == Image::TextAlign::BOTTOM_LEFT ) { - //vertical bottom - iRet = borderHeight - txtHeight; - } - iRet += SHIFT6(face->size->metrics.ascender); - return iRet; - } - - bool renderLine(FT_Face face, const wchar_t* text_ptr, int* iCurXCursor, int iCurYCursor) - { - assert(iCurYCursor > 0); - size_t text_len = wcslen(text_ptr); - for (size_t i=0; iglyph->bitmap; - - int yoffset = iCurYCursor - SHIFT6(face->glyph->metrics.horiBearingY); - int xoffset = *iCurXCursor + SHIFT6(face->glyph->metrics.horiBearingX); - for (int i = 0; i < bitmap.rows; ++i) - { - for (int j = 0; j < bitmap.width; ++j) - { - unsigned char cTemp = bitmap.buffer[i * bitmap.width + j]; - if (cTemp == 0) continue; - - // if it has gray>0 we set show it as 1, o otherwise - int iY = yoffset + i; - int iX = xoffset + j; - - if (iY < 0) - { - //truncate if drawing below first line - assert(iY >= -1); - continue; - } - - if (iY >= iMaxLineHeight) - { - //exceed the height truncate - assert(iY <= iMaxLineHeight + 1); - continue; - } - - int iTemp = cTemp << 24 | cTemp << 16 | cTemp << 8 | cTemp; - int data_offset = iY * iMaxLineWidth + iX; - assert(data_offset >= 0); - assert(data_offset < _dataSize); - _data[data_offset] = iTemp; - } - } - - //step to next glyph - *iCurXCursor += SHIFT6(face->glyph->metrics.horiAdvance) + iInterval; - } - return true; - } - - bool renderLines(FT_Face face, Image::TextAlign eAlignMask, int iCurYCursor) - { - size_t lines = vLines.size(); - for (size_t i = 0; i < lines; i++) - { - const wchar_t* text_ptr = vLines[i].text; - - // initialize the origin cursor - int iCurXCursor = computeLineStart(face, eAlignMask, text_ptr[0], i); - if (!renderLine(face, text_ptr, &iCurXCursor, iCurYCursor)) - return false; - - iCurYCursor += SHIFT6(face->size->metrics.ascender) - - SHIFT6(face->size->metrics.descender); - } - return true; - } - - bool getBitmap(const char *text, int nWidth, int nHeight, Image::TextAlign eAlignMask, const char * pFontName, float fontSize) - { - FT_Error iError; - if (libError) - return false; - - std::string fontfile = pFontName; - std::string fontfileOrig = std::string(fontfile); - - std::string ext = fileNameExtension(fontfile); - if (ext.empty() || (ext != "ttf" && ext != "TTF")) - { - fontfile += ".ttf" ; - } - - iError = openFont(fontfile, fontfileOrig); - // try with fonts prefixed - if (iError && !startsWith(fontfile,"fonts/") ) - { - fontfile = std::string("fonts/") + fontfile; - iError = openFont(fontfile, fontfileOrig); - } - - if (iError) - { - // try lowercase version - std::transform(fontfile.begin(), fontfile.end(), fontfile.begin(), ::tolower); - iError = openFont(fontfile, fontfileOrig); - if (iError) - { - // try default font - CCLOG("font missing (%s) falling back to default font", fontfileOrig.c_str()); - iError = openFont("fonts/Marker Felt.ttf", fontfileOrig); - if (iError) - CCLOG("default font missing (fonts/Marker Felt.ttf)"); - } - } - if (iError) - return false; - - FT_Face face = _cachedFont; - - //select utf8 charmap - iError = FT_Select_Charmap(face,FT_ENCODING_UNICODE); - if (iError) - return false; - - iError = FT_Set_Pixel_Sizes(face, fontSize, fontSize); - if (iError) - return false; - - if (!divideString(face, text, nWidth, nHeight)) - return false; - - //compute the final line width - iMaxLineWidth = MAX(iMaxLineWidth, nWidth); - - iMaxLineHeight = SHIFT6(face->size->metrics.ascender) - SHIFT6(face->size->metrics.descender); - iMaxLineHeight *= vLines.size(); - - int txtHeight = iMaxLineHeight; - - //compute the final line height - iMaxLineHeight = MAX(iMaxLineHeight, nHeight); - - // create _data as render target - _dataSize = iMaxLineWidth * iMaxLineHeight; - _data = new int[_dataSize]; - memset(_data, 0, _dataSize*sizeof(*_data)); - - //iCurYCursor = SHIFT6(face->size->metrics.ascender); - int iCurYCursor = computeLineStartY(face, eAlignMask, txtHeight, iMaxLineHeight); - if (!renderLines(face, eAlignMask, iCurYCursor)) - return false; - - // success; - return true; - } - -public: - FT_Library _library; - - int *_data; - // size of _data in words - int _dataSize; - int libError; - vector vLines; - int iInterval; - int iMaxLineWidth; - int iMaxLineHeight; -private: - bool startsWith(const std::string& str, const std::string& what); - /** - * Attempt to open font file, and cache it if successful. - */ - int openFont(const std::string& fontName, const std::string& fontNameOrig); - std::string fileNameExtension(const std::string& pathName); - - FT_Face _cachedFont; - std::string _cachedFontname; - std::string _cachedFontnameOrig; -}; - -static BitmapDC& sharedBitmapDC() -{ - static BitmapDC s_BmpDC; - return s_BmpDC; -} - -bool Image::initWithString( - const char * pText, - int nWidth/* = 0*/, - int nHeight/* = 0*/, - ETextAlign eAlignMask/* = kAlignCenter*/, - const char * pFontName/* = nil*/, - int nSize/* = 0*/) -{ - bool bRet = false; - do - { - CC_BREAK_IF(! pText); - - BitmapDC &dc = sharedBitmapDC(); - - //const char* pFullFontName = FileUtils::getInstance()->fullPathFromRelativePath(pFontName); - - CC_BREAK_IF(! dc.getBitmap(pText, nWidth, nHeight, eAlignMask, pFontName, nSize)); - - // assign the dc._data to _data in order to save time - _data = (unsigned char*)dc._data; - CC_BREAK_IF(! _data); - - _width = (short)dc.iMaxLineWidth; - _height = (short)dc.iMaxLineHeight; - _preMulti = true; - _renderFormat = Texture2D::PixelFormat::RGBA8888; - _dataLen = _width * _height * 4; - - bRet = true; - - dc.reset(); - } while (0); - - if (!bRet) - CCLOG("CCImage::initWithString failed"); - - //do nothing - return bRet; -} - -std::string BitmapDC::fileNameExtension(const std::string& pathName) -{ - std::string ext ; - std::string::size_type pos = pathName.find_last_of(".") ; - if (pos != std::string::npos && pos != pathName.size()-1 ) - { - ext = pathName.substr(pos+1) ; - } - - return ext ; -} - -bool BitmapDC::startsWith(const std::string& str, const std::string& what) -{ - bool result = false ; - if (what.size() <= str.size()) - { - result = (str.substr(0, what.size()) == what); - } - return result ; -} - -int BitmapDC::openFont(const std::string& fontName, const std::string& fontNameOrig) -{ - // try to satisfy request based on currently cached font. - if (fontNameOrig == _cachedFontnameOrig) - return 0; - - if (fontName == _cachedFontname) - return 0; - - FT_Face face; - int iError = FT_New_Face(_library, fontName.c_str(), 0, &face); - if (iError) - return iError; - - // free existing cached font - if (_cachedFont) - FT_Done_Face(_cachedFont); - - // cache newly loaded font - _cachedFontnameOrig = fontNameOrig; - _cachedFontname = fontName; - _cachedFont = face; - return 0; -} - -NS_CC_END diff --git a/cocos2dx/platform/nacl/CCInstance.cpp b/cocos2dx/platform/nacl/CCInstance.cpp deleted file mode 100644 index 9314f40aed..0000000000 --- a/cocos2dx/platform/nacl/CCInstance.cpp +++ /dev/null @@ -1,105 +0,0 @@ -/**************************************************************************** -Copyright (c) 2013 The Chromium Authors - -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 "platform/CCCommon.h" -#include "CCInstance.h" -#include "CCApplication.h" -#include "CCEGLView.h" - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -USING_NS_CC; - -CocosPepperInstance::CocosPepperInstance(PP_Instance instance) : pp::Instance(instance), - _running(false) -{ - RequestInputEvents(PP_INPUTEVENT_CLASS_MOUSE); - RequestFilteringInputEvents(PP_INPUTEVENT_CLASS_KEYBOARD); -} - -void CocosPepperInstance::DidChangeView(const pp::View& view) -{ - pp::Rect position = view.GetRect(); - if (_size == position.size()) - { - // Size did not change. - return; - } - - if (_running) - { - CCLOG("DidChangeView (%dx%d) while cocos thread already running", - position.size().width(), position.size().height()); - return; - } - - _size = position.size(); - assert(!EGLView::g_instance); - EGLView::g_instance = this; - CCLOG("DidChangeView %dx%d", _size.width(), _size.height()); - pthread_create(&_cocos_thread, NULL, cocos_main, this); - _running = true; -} - - -bool CocosPepperInstance::Init(uint32_t argc, const char* argn[], const char* argv[]) -{ - log("CocosPepperInstance::Init: %x %p", pp_instance(), - pp::Module::Get()->get_browser_interface()); - nacl_io_init_ppapi(pp_instance(), - pp::Module::Get()->get_browser_interface()); - - umount("/"); - int rtn = mount("Resources", /* source. Use relative URL */ - "/", /* target */ - "httpfs", /* filesystemtype */ - 0, /* mountflags */ - ""); /* data */ - - if (rtn != 0) - { - CCLOG("mount failed: %d %s", errno, strerror(errno)); - return false; - } - - return true; -} - -bool CocosPepperInstance::HandleInputEvent(const pp::InputEvent& event) -{ - if (!Application::isRunning()) - return false; - EGLView::getInstance()->AddEvent(event); - return true; -} diff --git a/cocos2dx/platform/nacl/CCInstance.h b/cocos2dx/platform/nacl/CCInstance.h deleted file mode 100644 index 7490e0f7fc..0000000000 --- a/cocos2dx/platform/nacl/CCInstance.h +++ /dev/null @@ -1,57 +0,0 @@ -/**************************************************************************** -Copyright (c) 2013 The Chromium Authors - -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 __CC_INSTANCE_H__ -#define __CC_INSTANCE_H__ - -#include -#include -#include - -extern "C" void* cocos_main(void* arg); - -class CocosPepperInstance : public pp::Instance { -public: - explicit CocosPepperInstance(PP_Instance instance); - /** - * @js NA - * @lua NA - */ - virtual ~CocosPepperInstance() {} - - virtual bool Init(uint32_t argc, const char* argn[], const char* argv[]); - - void DidChangeView(const pp::View& view); - - bool HandleInputEvent(const pp::InputEvent& event); - - pp::Size Size() { return _size; } - -private: - pp::Size _size; - pthread_t _cocos_thread; - bool _running; -}; - -#endif /* __CC_INSTANCE_H__ */ diff --git a/cocos2dx/platform/nacl/CCModule.h b/cocos2dx/platform/nacl/CCModule.h deleted file mode 100644 index 7ae1f230c6..0000000000 --- a/cocos2dx/platform/nacl/CCModule.h +++ /dev/null @@ -1,55 +0,0 @@ -/**************************************************************************** -Copyright (c) 2013 The Chromium Authors - -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 __CC_MODULE_H__ -#define __CC_MODULE_H__ - -#include -#include "ppapi/gles2/gl2ext_ppapi.h" - -class CocosPepperModule : public pp::Module -{ -public: - /** - * @js ctor - */ - CocosPepperModule() : pp::Module() {} - - virtual bool Init() - { - return glInitializePPAPI(get_browser_interface()) == GL_TRUE; - } - /** - * @js NA - * @lua NA - */ - virtual ~CocosPepperModule() {} - - virtual pp::Instance* CreateInstance(PP_Instance instance) - { - return new CocosPepperInstance(instance); - } -}; - -#endif /* __CC_INSTANCE_H__ */ diff --git a/cocos2dx/platform/nacl/CCPlatformDefine.h b/cocos2dx/platform/nacl/CCPlatformDefine.h deleted file mode 100644 index bdc8b00865..0000000000 --- a/cocos2dx/platform/nacl/CCPlatformDefine.h +++ /dev/null @@ -1,50 +0,0 @@ -/**************************************************************************** -Copyright (c) 2013 The Chromium Authors - -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 __CCPLATFORMDEFINE_H__ -#define __CCPLATFORMDEFINE_H__ - -#include -#include - -#if defined(_USRDLL) -#define CC_DLL __attribute__ ((visibility ("default"))) -#else /* use a DLL library */ -#define CC_DLL __attribute__ ((visibility ("default"))) -#endif - -#include -#define CC_ASSERT(cond) assert(cond) -#define CC_UNUSED_PARAM(unusedparam) (void)unusedparam - -/* Define NULL pointer value */ -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#endif /* __CCPLATFORMDEFINE_H__*/ diff --git a/cocos2dx/platform/nacl/CCStdC.h b/cocos2dx/platform/nacl/CCStdC.h deleted file mode 100644 index ead5567e4b..0000000000 --- a/cocos2dx/platform/nacl/CCStdC.h +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** -Copyright (c) 2013 The Chromium Authors - -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 __CC_STD_C_H__ -#define __CC_STD_C_H__ - -#include "platform/CCPlatformMacros.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifndef MIN -#define MIN(x,y) (((x) > (y)) ? (y) : (x)) -#endif // MIN - -#ifndef MAX -#define MAX(x,y) (((x) < (y)) ? (y) : (x)) -#endif // MAX - -// some function linux do not have -#define tanf tan -#define sqrtf sqrt -#define cosf cos -#define sinf sin - -#endif // __CC_STD_C_H__ diff --git a/cocos2dx/platform/nacl/memory.h b/cocos2dx/platform/nacl/memory.h deleted file mode 100644 index 975a48631f..0000000000 --- a/cocos2dx/platform/nacl/memory.h +++ /dev/null @@ -1,24 +0,0 @@ -/**************************************************************************** -Copyright (c) 2013 The Chromium Authors - -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. -****************************************************************************/ -// placeholder diff --git a/cocos2dx/platform/qt5/AccelerometerListener.cpp b/cocos2dx/platform/qt5/AccelerometerListener.cpp deleted file mode 100644 index 6fdfb44fab..0000000000 --- a/cocos2dx/platform/qt5/AccelerometerListener.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/** - * - * Cocos2D-X Qt 5 Platform - * - * Copyright (C) 2013 Jolla Ltd. - * Contact: Thomas Perl - * - * 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 "AccelerometerListener.h" - -#include - -AccelerometerListener::AccelerometerListener(Accelerometer *accelerometer) - : QObject() - , m_accelerometer(accelerometer) -{ -} - -void -AccelerometerListener::onReadingChanged() -{ - m_accelerometer->readingChanged(); -} diff --git a/cocos2dx/platform/qt5/AccelerometerListener.h b/cocos2dx/platform/qt5/AccelerometerListener.h deleted file mode 100644 index 552be1c4c1..0000000000 --- a/cocos2dx/platform/qt5/AccelerometerListener.h +++ /dev/null @@ -1,50 +0,0 @@ -/** - * - * Cocos2D-X Qt 5 Platform - * - * Copyright (C) 2013 Jolla Ltd. - * Contact: Thomas Perl - * - * 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 COCOS2DX_ACCELEROMETER_LISTENER_QT5_H -#define COCOS2DX_ACCELEROMETER_LISTENER_QT5_H - -#include "CCAccelerometer.h" - -#include - -USING_NS_CC; - -class AccelerometerListener : public QObject { - Q_OBJECT - - public: - AccelerometerListener(Accelerometer *accelerometer); - - public slots: - void onReadingChanged(); - - private: - Accelerometer *m_accelerometer; -}; - -#endif /* COCOS2DX_ACCELEROMETER_LISTENER_QT5_H */ diff --git a/cocos2dx/platform/qt5/CCAccelerometer.cpp b/cocos2dx/platform/qt5/CCAccelerometer.cpp deleted file mode 100644 index 7d31aa2f72..0000000000 --- a/cocos2dx/platform/qt5/CCAccelerometer.cpp +++ /dev/null @@ -1,100 +0,0 @@ -/** - * - * Cocos2D-X Qt 5 Platform - * - * Copyright (C) 2013 Jolla Ltd. - * Contact: Thomas Perl - * - * 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 "CCAccelerometer.h" -#include "AccelerometerListener.h" - -#include -#include - -NS_CC_BEGIN - -static Accelerometer * -shared_accelerometer = NULL; - -Accelerometer::Accelerometer() - : m_accelerometer(new QAccelerometer) - , m_listener(new AccelerometerListener(this)) - , m_function(nullptr) -{ - QObject::connect(m_accelerometer, SIGNAL(readingChanged()), - m_listener, SLOT(onReadingChanged())); -} - -Accelerometer::~Accelerometer() -{ - delete m_listener; - delete m_accelerometer; -} - -Accelerometer * -Accelerometer::sharedAccelerometer() -{ - if (shared_accelerometer == NULL) { - shared_accelerometer = new Accelerometer; - } - - return shared_accelerometer; -} - - -void -Accelerometer::setDelegate(std::function function) -{ - m_function = function; -} - -void -Accelerometer::setAccelerometerInterval(float interval) -{ - if (interval == 0.0) { - m_accelerometer->setDataRate(0.0); - } else { - // Interval is specified in seconds - m_accelerometer->setDataRate(1.0 / interval); - } -} - -void -Accelerometer::readingChanged() -{ - if (m_function == NULL) { - return; - } - - QAccelerometerReading *reading = m_accelerometer->reading(); - - Acceleration accel; - accel.x = reading->x(); - accel.y = reading->y(); - accel.z = reading->z(); - accel.timestamp = reading->timestamp(); - - m_function(&accel); -} - -NS_CC_END diff --git a/cocos2dx/platform/qt5/CCAccelerometer.h b/cocos2dx/platform/qt5/CCAccelerometer.h deleted file mode 100644 index 46fb45a1cf..0000000000 --- a/cocos2dx/platform/qt5/CCAccelerometer.h +++ /dev/null @@ -1,69 +0,0 @@ -/** - * - * Cocos2D-X Qt 5 Platform - * - * Copyright (C) 2013 Jolla Ltd. - * Contact: Thomas Perl - * - * 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 CCACCELEROMETER_QT5_H -#define CCACCELEROMETER_QT5_H - -#include "platform/CCCommon.h" -#include "platform/CCAccelerometerDelegate.h" -#include - -class QAccelerometer; -class AccelerometerListener; - -NS_CC_BEGIN - -class Accelerometer { -public: - /** - * @js ctor - */ - Accelerometer(); - /** - * @js NA - * @lua NA - */ - ~Accelerometer(); - - static Accelerometer *sharedAccelerometer(); - - void setDelegate(std::function function); - void setAccelerometerInterval(float interval); - - /* Functions to be called from AccelerometerListener */ - void readingChanged(); - -private: - QAccelerometer *m_accelerometer; - AccelerometerListener *m_listener; - std::function m_function; -}; - -NS_CC_END - -#endif /* CCACCELEROMETER_QT5_H */ diff --git a/cocos2dx/platform/qt5/CCApplication.cpp b/cocos2dx/platform/qt5/CCApplication.cpp deleted file mode 100644 index ee3ba271ba..0000000000 --- a/cocos2dx/platform/qt5/CCApplication.cpp +++ /dev/null @@ -1,204 +0,0 @@ -/** - * - * Cocos2D-X Qt 5 Platform - * - * Copyright (C) 2013 Jolla Ltd. - * Contact: Thomas Perl - * - * 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 "CCApplication.h" -#include -#include -#include -#include "CCDirector.h" -#include "platform/CCFileUtils.h" - -#include -#include -#include -#include - -class Cocos2DQt5MainloopIntegration : public QObject { - public: - Cocos2DQt5MainloopIntegration() - : QObject() - , m_timer(0) - { - } - - void setInterval(int interval_ms) - { - if (m_timer != 0) { - killTimer(m_timer); - } - - m_timer = startTimer(interval_ms); - } - - protected: - virtual void timerEvent(QTimerEvent *event) - { - cocos2d::Director::getInstance()->mainLoop(); - } - - private: - int m_timer; -}; - - -NS_CC_BEGIN - -// Application singleton -static Application * -application = NULL; - -static int -global_fake_argc = 1; - -static char * -global_fake_argv[1]; - -// @deprecated Use getInstance() instead -Application * -Application::sharedApplication() -{ - return getInstance(); -} - -Application * -Application::getInstance() -{ - CC_ASSERT(application != NULL); - return application; -} - -Application::Application() - : m_application(NULL) - , m_animationInterval(1000 / 60) - , m_resourceRootPath("") - , m_mainloop(new Cocos2DQt5MainloopIntegration) -{ - // Inject argv[0] by resolving /proc/self/exe - QString filename = QDir("/proc/self/exe").canonicalPath(); - QByteArray utf8 = filename.toUtf8(); - global_fake_argv[0] = strdup(utf8.data()); - - m_application = new QGuiApplication(global_fake_argc, global_fake_argv); - - CC_ASSERT(application == NULL); - application = this; -} - -Application::~Application() -{ - delete m_mainloop; - delete m_application; - - CC_ASSERT(application == this); - application = NULL; -} - -int -Application::run() -{ - // Initialize instance and cocos2d. - if (!applicationDidFinishLaunching()) { - return 0; - } - - m_mainloop->setInterval(m_animationInterval); - - return m_application->exec(); -} - -void -Application::setAnimationInterval(double interval) -{ - // Interval is expressed in seconds - m_animationInterval = interval * 1000; - - m_mainloop->setInterval(m_animationInterval); -} - -void -Application::setResourceRootPath(const std::string &rootResDir) -{ - m_resourceRootPath = rootResDir; - if (m_resourceRootPath[m_resourceRootPath.length() - 1] != '/') { - m_resourceRootPath += '/'; - } - FileUtils* pFileUtils = FileUtils::getInstance(); - std::vector searchPaths = pFileUtils->getSearchPaths(); - searchPaths.insert(searchPaths.begin(), m_resourceRootPath); - pFileUtils->setSearchPaths(searchPaths); -} - -const std::string & -Application::getResourceRootPath() -{ - return m_resourceRootPath; -} - -Application::Platform -Application::getTargetPlatform() -{ - return Platform::OS_LINUX; -} - -LanguageType -Application::getCurrentLanguage() -{ - QLocale locale; - - switch (locale.language()) { - case QLocale::English: - return LanguageType::ENGLISH; - case QLocale::Chinese: - return LanguageType::CHINESE; - case QLocale::French: - return LanguageType::FRENCH; - case QLocale::Italian: - return LanguageType::ITALIAN; - case QLocale::German: - return LanguageType::GERMAN; - case QLocale::Spanish: - return LanguageType::SPANISH; - case QLocale::Russian: - return LanguageType::RUSSIAN; - case QLocale::Korean: - return LanguageType::KOREAN; - case QLocale::Japanese: - return LanguageType::JAPANESE; - case QLocale::Hungarian: - return LanguageType::HUNGARIAN; - case QLocale::Portuguese: - return LanguageType::PORTUGUESE; - case QLocale::Arabic: - return LanguageType::ARABIC; - default: - break; - } - - return LanguageType::ENGLISH; -} - -NS_CC_END diff --git a/cocos2dx/platform/qt5/CCApplication.h b/cocos2dx/platform/qt5/CCApplication.h deleted file mode 100644 index cf840980c5..0000000000 --- a/cocos2dx/platform/qt5/CCApplication.h +++ /dev/null @@ -1,101 +0,0 @@ -/** - * - * Cocos2D-X Qt 5 Platform - * - * Copyright (C) 2013 Jolla Ltd. - * Contact: Thomas Perl - * - * 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 CCAPPLICATION_QT5_H -#define CCAPPLICATION_QT5_H - -#include "platform/CCCommon.h" -#include "platform/CCApplicationProtocol.h" -#include - -class QGuiApplication; -class Cocos2DQt5MainloopIntegration; - -NS_CC_BEGIN -class Application : public ApplicationProtocol { -public: - /** - * @js ctor - */ - Application(); - /** - * @js NA - * @lua NA - */ - virtual ~Application(); - - /** - @brief Callback by Director for limit FPS. - @param interval The time, which expressed in second in second, between current frame and next. - */ - void setAnimationInterval(double interval); - - /** - @brief Run the message loop. - */ - int run(); - - /** - @brief Get current application instance. - @return Current application instance pointer. - */ - static Application* getInstance(); - - /** @deprecated Use getInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static Application* sharedApplication(); - - /* override functions */ - virtual LanguageType getCurrentLanguage(); - - /** - * Sets the Resource root path. - * @deprecated Please use CCFileUtils::sharedFileUtils()->setSearchPaths() instead. - */ - CC_DEPRECATED_ATTRIBUTE void setResourceRootPath(const std::string &rootResDir); - - /** - * Gets the Resource root path. - * @deprecated Please use CCFileUtils::sharedFileUtils()->getSearchPaths() instead. - */ - CC_DEPRECATED_ATTRIBUTE const std::string &getResourceRootPath(); - - /** - @brief Get target platform - */ - virtual Platform getTargetPlatform(); - -protected: - QGuiApplication *m_application; - long m_animationInterval; - std::string m_resourceRootPath; - Cocos2DQt5MainloopIntegration *m_mainloop; -}; - -NS_CC_END - -#endif /* CCAPPLICATION_QT5_H */ diff --git a/cocos2dx/platform/qt5/CCCommon.cpp b/cocos2dx/platform/qt5/CCCommon.cpp deleted file mode 100644 index 5fd58ecb22..0000000000 --- a/cocos2dx/platform/qt5/CCCommon.cpp +++ /dev/null @@ -1,87 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010 cocos2d-x.org - -http://www.cocos2d-x.org - -Cocos2D-X Qt 5 Platform -Copyright (C) 2013 Jolla Ltd. -Contact: Thomas Perl - -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 "platform/CCCommon.h" -#include "CCStdC.h" - -NS_CC_BEGIN - -#define MAX_LEN (cocos2d::kMaxLogLen + 1) - -/* @deprecated, use cocos2d::log() instead (see below) */ -void CCLog(const char * pszFormat, ...) -{ - char szBuf[MAX_LEN]; - - va_list ap; - va_start(ap, pszFormat); - vsnprintf(szBuf, MAX_LEN, pszFormat, ap); - va_end(ap); - - // Strip any trailing newlines from log message. - size_t len = strlen(szBuf); - while (len && szBuf[len-1] == '\n') - { - szBuf[len-1] = '\0'; - len--; - } - - fprintf(stderr, "cocos2d-x debug info [%s]\n", szBuf); -} - -void log(const char * pszFormat, ...) -{ - char szBuf[MAX_LEN]; - - va_list ap; - va_start(ap, pszFormat); - vsnprintf(szBuf, MAX_LEN, pszFormat, ap); - va_end(ap); - - // Strip any trailing newlines from log message. - size_t len = strlen(szBuf); - while (len && szBuf[len-1] == '\n') - { - szBuf[len-1] = '\0'; - len--; - } - - fprintf(stderr, "cocos2d-x debug info [%s]\n", szBuf); -} - -void MessageBox(const char * pszMsg, const char * pszTitle) -{ - log("%s: %s", pszTitle, pszMsg); -} - -void LuaLog(const char * pszFormat) -{ - puts(pszFormat); -} - -NS_CC_END diff --git a/cocos2dx/platform/qt5/CCDevice.cpp b/cocos2dx/platform/qt5/CCDevice.cpp deleted file mode 100644 index 5838863387..0000000000 --- a/cocos2dx/platform/qt5/CCDevice.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/** - * - * Cocos2D-X Qt 5 Platform - * - * Copyright (C) 2013 Jolla Ltd. - * Contact: Thomas Perl - * - * 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 "platform/CCDevice.h" - -#include -#include - -NS_CC_BEGIN - -int Device::getDPI() -{ - QGuiApplication *app = static_cast(QGuiApplication::instance()); - QScreen *screen = app->primaryScreen(); - return screen->physicalDotsPerInch(); -} - -void Device::setAccelerometerEnabled(bool isEnabled) -{ - -} - -void Device::setAccelerometerInterval(float interval) -{ - -} - -NS_CC_END diff --git a/cocos2dx/platform/qt5/CCEGLView.cpp b/cocos2dx/platform/qt5/CCEGLView.cpp deleted file mode 100644 index 5e824497eb..0000000000 --- a/cocos2dx/platform/qt5/CCEGLView.cpp +++ /dev/null @@ -1,202 +0,0 @@ -/** - * - * Cocos2D-X Qt 5 Platform - * - * Copyright (C) 2013 Jolla Ltd. - * Contact: Thomas Perl - * - * 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 "CCEGLView.h" -#include "CCGL.h" - -#include "ccMacros.h" -#include "CCDirector.h" - -#include "event_dispatcher/CCTouch.h" -#include "event_dispatcher/CCEventDispatcher.h" -#include "event_dispatcher/CCKeyboardEvent.h" -#include "text_input_node/CCIMEDispatcher.h" - -#include -#include - -#include -#include -#include - -#include - -NS_CC_BEGIN - -class Cocos2DQt5OpenGLIntegration : public QWindow { - public: - Cocos2DQt5OpenGLIntegration(EGLView *view, int width, int height); - ~Cocos2DQt5OpenGLIntegration(); - - virtual void touchEvent(QTouchEvent *event); - virtual bool event(QEvent *event); - - void swapBuffers(); - - private: - EGLView *m_egl_view; - QOpenGLContext *m_context; -}; - -Cocos2DQt5OpenGLIntegration::Cocos2DQt5OpenGLIntegration(EGLView *view, int width, int height) - : m_egl_view(view) - , m_context(NULL) -{ - setSurfaceType(QSurface::OpenGLSurface); - resize(width, height); - //showFullScreen(); - show(); - - m_context = new QOpenGLContext(this); - m_context->create(); - m_context->makeCurrent(this); -} - -Cocos2DQt5OpenGLIntegration::~Cocos2DQt5OpenGLIntegration() -{ - delete m_context; -} - -void -Cocos2DQt5OpenGLIntegration::touchEvent(QTouchEvent *event) -{ - foreach (QTouchEvent::TouchPoint point, event->touchPoints()) { - int id = point.id(); - QPointF pos = point.pos(); - float x = pos.x(); - float y = pos.y(); - Qt::TouchPointState state = point.state(); - - switch (state) { - case Qt::TouchPointPressed: - m_egl_view->handleTouchesBegin(1, &id, &x, &y); - break; - case Qt::TouchPointMoved: - m_egl_view->handleTouchesMove(1, &id, &x, &y); - break; - case Qt::TouchPointStationary: - // Do nothing - break; - case Qt::TouchPointReleased: - m_egl_view->handleTouchesEnd(1, &id, &x, &y); - break; - default: - // Do nothing - break; - } - } -} - -bool -Cocos2DQt5OpenGLIntegration::event(QEvent *event) -{ - if (event->type() == QEvent::Close) { - Director::getInstance()->end(); - } - - return QWindow::event(event); -} - -void -Cocos2DQt5OpenGLIntegration::swapBuffers() -{ - m_context->swapBuffers(this); - m_context->makeCurrent(this); -} - - -/* Global EGLView singleton for this module */ -static EGLView * -egl_view = NULL; - - -/** @deprecated Use getInstance() instead */ -EGLView * -EGLView::sharedOpenGLView() -{ - return getInstance(); -} - -EGLView * -EGLView::getInstance() -{ - if (egl_view == NULL) { - egl_view = new EGLView; - } - - return egl_view; -} - - -EGLView::EGLView() - : m_integration(NULL) -{ -} - -EGLView::~EGLView() -{ - if (m_integration) { - delete m_integration; - } -} - -void -EGLView::setFrameSize(float width, float height) -{ - if (m_integration == NULL) { - m_integration = new Cocos2DQt5OpenGLIntegration(this, - (int)width, (int)height); - } else { - m_integration->resize(width, height); - } - - EGLViewProtocol::setFrameSize(width, height); -} - -void -EGLView::swapBuffers() -{ - if (m_integration != NULL) { - m_integration->swapBuffers(); - } -} - -void -EGLView::setIMEKeyboardState(bool bOpen) -{ - QGuiApplication *app = static_cast(QGuiApplication::instance()); - app->inputMethod()->setVisible(bOpen); -} - -void -EGLView::end() -{ - QGuiApplication::exit(0); -} - -NS_CC_END diff --git a/cocos2dx/platform/qt5/CCEGLView.h b/cocos2dx/platform/qt5/CCEGLView.h deleted file mode 100644 index cf94ea91a2..0000000000 --- a/cocos2dx/platform/qt5/CCEGLView.h +++ /dev/null @@ -1,70 +0,0 @@ -/** - * - * Cocos2D-X Qt 5 Platform - * - * Copyright (C) 2013 Jolla Ltd. - * Contact: Thomas Perl - * - * 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 CCEGLVIEW_QT5_H -#define CCEGLVIEW_QT5_H - -#include "platform/CCCommon.h" -#include "cocoa/CCGeometry.h" -#include "platform/CCEGLViewProtocol.h" - -NS_CC_BEGIN - -class Cocos2DQt5OpenGLIntegration; - -class EGLView : public EGLViewProtocol { -public: - /** - * @js ctor - */ - EGLView(); - /** - * @js NA - * @lua NA - */ - virtual ~EGLView(); - - static EGLView *getInstance(); - - /** @deprecated Use getInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static EGLView *sharedOpenGLView(); - - virtual bool isOpenGLReady() { return (m_integration != NULL); } - - virtual void setFrameSize(float width, float height); - virtual void swapBuffers(); - virtual void setIMEKeyboardState(bool bOpen); - virtual void end(); - -private: - Cocos2DQt5OpenGLIntegration *m_integration; -}; - -NS_CC_END - -#endif /* CCEGLVIEW_QT5_H */ diff --git a/cocos2dx/platform/qt5/CCFileUtilsQt5.cpp b/cocos2dx/platform/qt5/CCFileUtilsQt5.cpp deleted file mode 100644 index 3159a37dc5..0000000000 --- a/cocos2dx/platform/qt5/CCFileUtilsQt5.cpp +++ /dev/null @@ -1,113 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010 cocos2d-x.org - - http://www.cocos2d-x.org - - Cocos2D-X Qt 5 Platform - Copyright (C) 2013 Jolla Ltd. - Contact: Thomas Perl - - 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 "platform/CCFileUtils.h" -#include "platform/CCPlatformMacros.h" -#include "platform/CCCommon.h" -#include "ccTypes.h" -#include "ccMacros.h" - -#include -#include - -#include -#include -#include -#include - -NS_CC_BEGIN - -class CC_DLL FileUtilsQt5 : public FileUtils -{ - public: - FileUtilsQt5(); - - /* override funtions */ - virtual bool init(); - virtual std::string getWritablePath(); - virtual bool isFileExist(const std::string& strFilePath); -}; - -FileUtils * -FileUtils::getInstance() -{ - if (s_sharedFileUtils == NULL) - { - s_sharedFileUtils = new FileUtilsQt5(); - s_sharedFileUtils->init(); - } - return s_sharedFileUtils; -} - -FileUtilsQt5::FileUtilsQt5() -{ -} - -bool -FileUtilsQt5::init() -{ - // Determine directory of the application executable - QDir app_dir = QDir("/proc/self/exe").canonicalPath(); - app_dir.cdUp(); - - // Resources should be placed alongside the binary (same directory) - QString path = app_dir.path() + "/Resources/"; - _defaultResRootPath = path.toStdString(); - - return FileUtils::init(); -} - -std::string -FileUtilsQt5::getWritablePath() const -{ - QDir dir(QStandardPaths::writableLocation(QStandardPaths::DataLocation)); - - // Create directory if it does not exist yet - if (!dir.exists()) { - dir.mkpath("."); - } - - return dir.path().toStdString(); -} - -bool FileUtilsQt5::isFileExist(const std::string& strFilePath) const -{ - QString filePath = QString::fromStdString(strFilePath); - - // Try filename without any path first - if (QFile(filePath).exists()) { - return true; - } - - // If not found, look for file in _defaultResRootPath - QString defaultResRootPath = QString::fromStdString(_defaultResRootPath); - return QFile(QDir(defaultResRootPath).filePath(filePath)).exists(); -} - -NS_CC_END diff --git a/cocos2dx/platform/qt5/CCGL.h b/cocos2dx/platform/qt5/CCGL.h deleted file mode 100644 index 6ebe1c3f3c..0000000000 --- a/cocos2dx/platform/qt5/CCGL.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef __CCGL_H__ -#define __CCGL_H__ - -#include -#include - -#define GL_DEPTH24_STENCIL8 GL_DEPTH24_STENCIL8_OES - -#define glClearDepth glClearDepthf - -// android defines GL_BGRA_EXT but not GL_BRGA -#ifndef GL_BGRA -#define GL_BGRA 0x80E1 -#endif - -#endif // __CCGL_H__ diff --git a/cocos2dx/platform/qt5/CCPlatformDefine.h b/cocos2dx/platform/qt5/CCPlatformDefine.h deleted file mode 100644 index 9bbd1df365..0000000000 --- a/cocos2dx/platform/qt5/CCPlatformDefine.h +++ /dev/null @@ -1,47 +0,0 @@ -/** - * - * Cocos2D-X Qt 5 Platform - * - * Copyright (C) 2013 Jolla Ltd. - * Contact: Thomas Perl - * - * 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 __CCPLATFORMDEFINE_H__ -#define __CCPLATFORMDEFINE_H__ - -// Adapted from platform/linux/CCPlatformDefine.h - -#include -#include - -#if defined(_USRDLL) -# define CC_DLL __attribute__ ((visibility ("default"))) -#else -# define CC_DLL __attribute__ ((visibility ("default"))) -#endif - -#include -#define CC_ASSERT(cond) assert(cond) -#define CC_UNUSED_PARAM(unusedparam) (void)unusedparam - -#endif /* __CCPLATFORMDEFINE_H__*/ diff --git a/cocos2dx/platform/qt5/CCStdC.h b/cocos2dx/platform/qt5/CCStdC.h deleted file mode 100644 index 1813e0c4f4..0000000000 --- a/cocos2dx/platform/qt5/CCStdC.h +++ /dev/null @@ -1,58 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010 cocos2d-x.org - -http://www.cocos2d-x.org - -Cocos2D-X Qt 5 Platform -Copyright (C) 2013 Jolla Ltd. -Contact: Thomas Perl - -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 __CC_STD_C_H__ -#define __CC_STD_C_H__ - -#include "platform/CCPlatformMacros.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifndef MIN -#define MIN(x,y) (((x) > (y)) ? (y) : (x)) -#endif // MIN - -#ifndef MAX -#define MAX(x,y) (((x) < (y)) ? (y) : (x)) -#endif // MAX - -// some function linux do not have -#define tanf tan -#define sqrtf sqrt -#define cosf cos -#define sinf sin - -#endif // __CC_STD_C_H__ diff --git a/cocos2dx/platform/third_party/doc/build.txt b/cocos2dx/platform/third_party/doc/build.txt deleted file mode 100644 index f49674ad79..0000000000 --- a/cocos2dx/platform/third_party/doc/build.txt +++ /dev/null @@ -1,23 +0,0 @@ -Configure -========= -use the command below to configure the libraries, you can change some param for your environment: - -armv7: -./configure --prefix=/usr/local/iphone --host=arm-apple-darwin --enable-static=yes --enable-shared=no CC=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/llvm-gcc-4.2/bin/llvm-gcc-4.2 CXX=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/llvm-gcc-4.2/bin/llvm-g++-4.2 CFLAGS="-arch armv7 -pipe -mdynamic-no-pic -std=c99 -Wno-trigraphs -fpascal-strings -O2 -Wreturn-type -Wunused-variable -fmessage-length=0 -fvisibility=hidden -miphoneos-version-min=3.2 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk" CXXFLAGS="-arch armv7 -pipe -mdynamic-no-pic -std=c99 -Wno-trigraphs -fpascal-strings -O2 -Wreturn-type -Wunused-variable -fmessage-length=0 -fvisibility=hidden -miphoneos-version-min=3.2 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk" AR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ar LDFLAGS="-arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk -miphoneos-version-min=3.2" - -armv7s -./configure --prefix=/usr/local/iphone --host=arm-apple-darwin --enable-static=yes --enable-shared=no CC=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/llvm-gcc-4.2/bin/llvm-gcc-4.2 CXX=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/llvm-gcc-4.2/bin/llvm-g++-4.2 CFLAGS="-arch armv7s -pipe -mdynamic-no-pic -std=c99 -Wno-trigraphs -fpascal-strings -O2 -Wreturn-type -Wunused-variable -fmessage-length=0 -fvisibility=hidden -miphoneos-version-min=3.2 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk" CXXFLAGS="-arch armv7s -pipe -mdynamic-no-pic -std=c99 -Wno-trigraphs -fpascal-strings -O2 -Wreturn-type -Wunused-variable -fmessage-length=0 -fvisibility=hidden -miphoneos-version-min=3.2 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk" AR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ar LDFLAGS="-arch armv7s -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk -miphoneos-version-min=3.2" - -i386 -./configure CC=/Applications/Xcode.app/Contents/Developer/usr/bin/i686-apple-darwin11-llvm-gcc-4.2 CXX=/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2/bin/i686-apple-darwin11-llvm-g++-4.2 - -x86_64 -./configure - -Combine the architecture -======================== -lipo -create -output libxxx.a libxxxx86.a libxxxarm.a libxxxi386.a - -Check the architecture -====================== -lipo -info libxxx.a \ No newline at end of file diff --git a/cocos2dx/platform/third_party/doc/version.txt b/cocos2dx/platform/third_party/doc/version.txt deleted file mode 100644 index 7349b29c6b..0000000000 --- a/cocos2dx/platform/third_party/doc/version.txt +++ /dev/null @@ -1,9 +0,0 @@ -jpeg -version 9.0 for ios mac win32 android linux - -png -version 1.6.2 for ios mac win32 android -linux use libpng12-dev which downloaded use the shell command - -tiff -version 4.0.3 for ios mac win32 android linux \ No newline at end of file diff --git a/cocos2dx/platform/third_party/emscripten/libjpeg/jerror.h b/cocos2dx/platform/third_party/emscripten/libjpeg/jerror.h deleted file mode 100644 index a4b661f716..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libjpeg/jerror.h +++ /dev/null @@ -1,304 +0,0 @@ -/* - * jerror.h - * - * Copyright (C) 1994-1997, Thomas G. Lane. - * Modified 1997-2012 by Guido Vollbeding. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file defines the error and message codes for the JPEG library. - * Edit this file to add new codes, or to translate the message strings to - * some other language. - * A set of error-reporting macros are defined too. Some applications using - * the JPEG library may wish to include this file to get the error codes - * and/or the macros. - */ - -/* - * To define the enum list of message codes, include this file without - * defining macro JMESSAGE. To create a message string table, include it - * again with a suitable JMESSAGE definition (see jerror.c for an example). - */ -#ifndef JMESSAGE -#ifndef JERROR_H -/* First time through, define the enum list */ -#define JMAKE_ENUM_LIST -#else -/* Repeated inclusions of this file are no-ops unless JMESSAGE is defined */ -#define JMESSAGE(code,string) -#endif /* JERROR_H */ -#endif /* JMESSAGE */ - -#ifdef JMAKE_ENUM_LIST - -typedef enum { - -#define JMESSAGE(code,string) code , - -#endif /* JMAKE_ENUM_LIST */ - -JMESSAGE(JMSG_NOMESSAGE, "Bogus message code %d") /* Must be first entry! */ - -/* For maintenance convenience, list is alphabetical by message code name */ -JMESSAGE(JERR_BAD_ALIGN_TYPE, "ALIGN_TYPE is wrong, please fix") -JMESSAGE(JERR_BAD_ALLOC_CHUNK, "MAX_ALLOC_CHUNK is wrong, please fix") -JMESSAGE(JERR_BAD_BUFFER_MODE, "Bogus buffer control mode") -JMESSAGE(JERR_BAD_COMPONENT_ID, "Invalid component ID %d in SOS") -JMESSAGE(JERR_BAD_CROP_SPEC, "Invalid crop request") -JMESSAGE(JERR_BAD_DCT_COEF, "DCT coefficient out of range") -JMESSAGE(JERR_BAD_DCTSIZE, "DCT scaled block size %dx%d not supported") -JMESSAGE(JERR_BAD_DROP_SAMPLING, - "Component index %d: mismatching sampling ratio %d:%d, %d:%d, %c") -JMESSAGE(JERR_BAD_HUFF_TABLE, "Bogus Huffman table definition") -JMESSAGE(JERR_BAD_IN_COLORSPACE, "Bogus input colorspace") -JMESSAGE(JERR_BAD_J_COLORSPACE, "Bogus JPEG colorspace") -JMESSAGE(JERR_BAD_LENGTH, "Bogus marker length") -JMESSAGE(JERR_BAD_LIB_VERSION, - "Wrong JPEG library version: library is %d, caller expects %d") -JMESSAGE(JERR_BAD_MCU_SIZE, "Sampling factors too large for interleaved scan") -JMESSAGE(JERR_BAD_POOL_ID, "Invalid memory pool code %d") -JMESSAGE(JERR_BAD_PRECISION, "Unsupported JPEG data precision %d") -JMESSAGE(JERR_BAD_PROGRESSION, - "Invalid progressive parameters Ss=%d Se=%d Ah=%d Al=%d") -JMESSAGE(JERR_BAD_PROG_SCRIPT, - "Invalid progressive parameters at scan script entry %d") -JMESSAGE(JERR_BAD_SAMPLING, "Bogus sampling factors") -JMESSAGE(JERR_BAD_SCAN_SCRIPT, "Invalid scan script at entry %d") -JMESSAGE(JERR_BAD_STATE, "Improper call to JPEG library in state %d") -JMESSAGE(JERR_BAD_STRUCT_SIZE, - "JPEG parameter struct mismatch: library thinks size is %u, caller expects %u") -JMESSAGE(JERR_BAD_VIRTUAL_ACCESS, "Bogus virtual array access") -JMESSAGE(JERR_BUFFER_SIZE, "Buffer passed to JPEG library is too small") -JMESSAGE(JERR_CANT_SUSPEND, "Suspension not allowed here") -JMESSAGE(JERR_CCIR601_NOTIMPL, "CCIR601 sampling not implemented yet") -JMESSAGE(JERR_COMPONENT_COUNT, "Too many color components: %d, max %d") -JMESSAGE(JERR_CONVERSION_NOTIMPL, "Unsupported color conversion request") -JMESSAGE(JERR_DAC_INDEX, "Bogus DAC index %d") -JMESSAGE(JERR_DAC_VALUE, "Bogus DAC value 0x%x") -JMESSAGE(JERR_DHT_INDEX, "Bogus DHT index %d") -JMESSAGE(JERR_DQT_INDEX, "Bogus DQT index %d") -JMESSAGE(JERR_EMPTY_IMAGE, "Empty JPEG image (DNL not supported)") -JMESSAGE(JERR_EMS_READ, "Read from EMS failed") -JMESSAGE(JERR_EMS_WRITE, "Write to EMS failed") -JMESSAGE(JERR_EOI_EXPECTED, "Didn't expect more than one scan") -JMESSAGE(JERR_FILE_READ, "Input file read error") -JMESSAGE(JERR_FILE_WRITE, "Output file write error --- out of disk space?") -JMESSAGE(JERR_FRACT_SAMPLE_NOTIMPL, "Fractional sampling not implemented yet") -JMESSAGE(JERR_HUFF_CLEN_OVERFLOW, "Huffman code size table overflow") -JMESSAGE(JERR_HUFF_MISSING_CODE, "Missing Huffman code table entry") -JMESSAGE(JERR_IMAGE_TOO_BIG, "Maximum supported image dimension is %u pixels") -JMESSAGE(JERR_INPUT_EMPTY, "Empty input file") -JMESSAGE(JERR_INPUT_EOF, "Premature end of input file") -JMESSAGE(JERR_MISMATCHED_QUANT_TABLE, - "Cannot transcode due to multiple use of quantization table %d") -JMESSAGE(JERR_MISSING_DATA, "Scan script does not transmit all data") -JMESSAGE(JERR_MODE_CHANGE, "Invalid color quantization mode change") -JMESSAGE(JERR_NOTIMPL, "Not implemented yet") -JMESSAGE(JERR_NOT_COMPILED, "Requested feature was omitted at compile time") -JMESSAGE(JERR_NO_ARITH_TABLE, "Arithmetic table 0x%02x was not defined") -JMESSAGE(JERR_NO_BACKING_STORE, "Backing store not supported") -JMESSAGE(JERR_NO_HUFF_TABLE, "Huffman table 0x%02x was not defined") -JMESSAGE(JERR_NO_IMAGE, "JPEG datastream contains no image") -JMESSAGE(JERR_NO_QUANT_TABLE, "Quantization table 0x%02x was not defined") -JMESSAGE(JERR_NO_SOI, "Not a JPEG file: starts with 0x%02x 0x%02x") -JMESSAGE(JERR_OUT_OF_MEMORY, "Insufficient memory (case %d)") -JMESSAGE(JERR_QUANT_COMPONENTS, - "Cannot quantize more than %d color components") -JMESSAGE(JERR_QUANT_FEW_COLORS, "Cannot quantize to fewer than %d colors") -JMESSAGE(JERR_QUANT_MANY_COLORS, "Cannot quantize to more than %d colors") -JMESSAGE(JERR_SOF_BEFORE, "Invalid JPEG file structure: %s before SOF") -JMESSAGE(JERR_SOF_DUPLICATE, "Invalid JPEG file structure: two SOF markers") -JMESSAGE(JERR_SOF_NO_SOS, "Invalid JPEG file structure: missing SOS marker") -JMESSAGE(JERR_SOF_UNSUPPORTED, "Unsupported JPEG process: SOF type 0x%02x") -JMESSAGE(JERR_SOI_DUPLICATE, "Invalid JPEG file structure: two SOI markers") -JMESSAGE(JERR_TFILE_CREATE, "Failed to create temporary file %s") -JMESSAGE(JERR_TFILE_READ, "Read failed on temporary file") -JMESSAGE(JERR_TFILE_SEEK, "Seek failed on temporary file") -JMESSAGE(JERR_TFILE_WRITE, - "Write failed on temporary file --- out of disk space?") -JMESSAGE(JERR_TOO_LITTLE_DATA, "Application transferred too few scanlines") -JMESSAGE(JERR_UNKNOWN_MARKER, "Unsupported marker type 0x%02x") -JMESSAGE(JERR_VIRTUAL_BUG, "Virtual array controller messed up") -JMESSAGE(JERR_WIDTH_OVERFLOW, "Image too wide for this implementation") -JMESSAGE(JERR_XMS_READ, "Read from XMS failed") -JMESSAGE(JERR_XMS_WRITE, "Write to XMS failed") -JMESSAGE(JMSG_COPYRIGHT, JCOPYRIGHT) -JMESSAGE(JMSG_VERSION, JVERSION) -JMESSAGE(JTRC_16BIT_TABLES, - "Caution: quantization tables are too coarse for baseline JPEG") -JMESSAGE(JTRC_ADOBE, - "Adobe APP14 marker: version %d, flags 0x%04x 0x%04x, transform %d") -JMESSAGE(JTRC_APP0, "Unknown APP0 marker (not JFIF), length %u") -JMESSAGE(JTRC_APP14, "Unknown APP14 marker (not Adobe), length %u") -JMESSAGE(JTRC_DAC, "Define Arithmetic Table 0x%02x: 0x%02x") -JMESSAGE(JTRC_DHT, "Define Huffman Table 0x%02x") -JMESSAGE(JTRC_DQT, "Define Quantization Table %d precision %d") -JMESSAGE(JTRC_DRI, "Define Restart Interval %u") -JMESSAGE(JTRC_EMS_CLOSE, "Freed EMS handle %u") -JMESSAGE(JTRC_EMS_OPEN, "Obtained EMS handle %u") -JMESSAGE(JTRC_EOI, "End Of Image") -JMESSAGE(JTRC_HUFFBITS, " %3d %3d %3d %3d %3d %3d %3d %3d") -JMESSAGE(JTRC_JFIF, "JFIF APP0 marker: version %d.%02d, density %dx%d %d") -JMESSAGE(JTRC_JFIF_BADTHUMBNAILSIZE, - "Warning: thumbnail image size does not match data length %u") -JMESSAGE(JTRC_JFIF_EXTENSION, - "JFIF extension marker: type 0x%02x, length %u") -JMESSAGE(JTRC_JFIF_THUMBNAIL, " with %d x %d thumbnail image") -JMESSAGE(JTRC_MISC_MARKER, "Miscellaneous marker 0x%02x, length %u") -JMESSAGE(JTRC_PARMLESS_MARKER, "Unexpected marker 0x%02x") -JMESSAGE(JTRC_QUANTVALS, " %4u %4u %4u %4u %4u %4u %4u %4u") -JMESSAGE(JTRC_QUANT_3_NCOLORS, "Quantizing to %d = %d*%d*%d colors") -JMESSAGE(JTRC_QUANT_NCOLORS, "Quantizing to %d colors") -JMESSAGE(JTRC_QUANT_SELECTED, "Selected %d colors for quantization") -JMESSAGE(JTRC_RECOVERY_ACTION, "At marker 0x%02x, recovery action %d") -JMESSAGE(JTRC_RST, "RST%d") -JMESSAGE(JTRC_SMOOTH_NOTIMPL, - "Smoothing not supported with nonstandard sampling ratios") -JMESSAGE(JTRC_SOF, "Start Of Frame 0x%02x: width=%u, height=%u, components=%d") -JMESSAGE(JTRC_SOF_COMPONENT, " Component %d: %dhx%dv q=%d") -JMESSAGE(JTRC_SOI, "Start of Image") -JMESSAGE(JTRC_SOS, "Start Of Scan: %d components") -JMESSAGE(JTRC_SOS_COMPONENT, " Component %d: dc=%d ac=%d") -JMESSAGE(JTRC_SOS_PARAMS, " Ss=%d, Se=%d, Ah=%d, Al=%d") -JMESSAGE(JTRC_TFILE_CLOSE, "Closed temporary file %s") -JMESSAGE(JTRC_TFILE_OPEN, "Opened temporary file %s") -JMESSAGE(JTRC_THUMB_JPEG, - "JFIF extension marker: JPEG-compressed thumbnail image, length %u") -JMESSAGE(JTRC_THUMB_PALETTE, - "JFIF extension marker: palette thumbnail image, length %u") -JMESSAGE(JTRC_THUMB_RGB, - "JFIF extension marker: RGB thumbnail image, length %u") -JMESSAGE(JTRC_UNKNOWN_IDS, - "Unrecognized component IDs %d %d %d, assuming YCbCr") -JMESSAGE(JTRC_XMS_CLOSE, "Freed XMS handle %u") -JMESSAGE(JTRC_XMS_OPEN, "Obtained XMS handle %u") -JMESSAGE(JWRN_ADOBE_XFORM, "Unknown Adobe color transform code %d") -JMESSAGE(JWRN_ARITH_BAD_CODE, "Corrupt JPEG data: bad arithmetic code") -JMESSAGE(JWRN_BOGUS_PROGRESSION, - "Inconsistent progression sequence for component %d coefficient %d") -JMESSAGE(JWRN_EXTRANEOUS_DATA, - "Corrupt JPEG data: %u extraneous bytes before marker 0x%02x") -JMESSAGE(JWRN_HIT_MARKER, "Corrupt JPEG data: premature end of data segment") -JMESSAGE(JWRN_HUFF_BAD_CODE, "Corrupt JPEG data: bad Huffman code") -JMESSAGE(JWRN_JFIF_MAJOR, "Warning: unknown JFIF revision number %d.%02d") -JMESSAGE(JWRN_JPEG_EOF, "Premature end of JPEG file") -JMESSAGE(JWRN_MUST_RESYNC, - "Corrupt JPEG data: found marker 0x%02x instead of RST%d") -JMESSAGE(JWRN_NOT_SEQUENTIAL, "Invalid SOS parameters for sequential JPEG") -JMESSAGE(JWRN_TOO_MUCH_DATA, "Application transferred too many scanlines") - -#ifdef JMAKE_ENUM_LIST - - JMSG_LASTMSGCODE -} J_MESSAGE_CODE; - -#undef JMAKE_ENUM_LIST -#endif /* JMAKE_ENUM_LIST */ - -/* Zap JMESSAGE macro so that future re-inclusions do nothing by default */ -#undef JMESSAGE - - -#ifndef JERROR_H -#define JERROR_H - -/* Macros to simplify using the error and trace message stuff */ -/* The first parameter is either type of cinfo pointer */ - -/* Fatal errors (print message and exit) */ -#define ERREXIT(cinfo,code) \ - ((cinfo)->err->msg_code = (code), \ - (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) -#define ERREXIT1(cinfo,code,p1) \ - ((cinfo)->err->msg_code = (code), \ - (cinfo)->err->msg_parm.i[0] = (p1), \ - (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) -#define ERREXIT2(cinfo,code,p1,p2) \ - ((cinfo)->err->msg_code = (code), \ - (cinfo)->err->msg_parm.i[0] = (p1), \ - (cinfo)->err->msg_parm.i[1] = (p2), \ - (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) -#define ERREXIT3(cinfo,code,p1,p2,p3) \ - ((cinfo)->err->msg_code = (code), \ - (cinfo)->err->msg_parm.i[0] = (p1), \ - (cinfo)->err->msg_parm.i[1] = (p2), \ - (cinfo)->err->msg_parm.i[2] = (p3), \ - (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) -#define ERREXIT4(cinfo,code,p1,p2,p3,p4) \ - ((cinfo)->err->msg_code = (code), \ - (cinfo)->err->msg_parm.i[0] = (p1), \ - (cinfo)->err->msg_parm.i[1] = (p2), \ - (cinfo)->err->msg_parm.i[2] = (p3), \ - (cinfo)->err->msg_parm.i[3] = (p4), \ - (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) -#define ERREXIT6(cinfo,code,p1,p2,p3,p4,p5,p6) \ - ((cinfo)->err->msg_code = (code), \ - (cinfo)->err->msg_parm.i[0] = (p1), \ - (cinfo)->err->msg_parm.i[1] = (p2), \ - (cinfo)->err->msg_parm.i[2] = (p3), \ - (cinfo)->err->msg_parm.i[3] = (p4), \ - (cinfo)->err->msg_parm.i[4] = (p5), \ - (cinfo)->err->msg_parm.i[5] = (p6), \ - (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) -#define ERREXITS(cinfo,code,str) \ - ((cinfo)->err->msg_code = (code), \ - strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \ - (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) - -#define MAKESTMT(stuff) do { stuff } while (0) - -/* Nonfatal errors (we can keep going, but the data is probably corrupt) */ -#define WARNMS(cinfo,code) \ - ((cinfo)->err->msg_code = (code), \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1)) -#define WARNMS1(cinfo,code,p1) \ - ((cinfo)->err->msg_code = (code), \ - (cinfo)->err->msg_parm.i[0] = (p1), \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1)) -#define WARNMS2(cinfo,code,p1,p2) \ - ((cinfo)->err->msg_code = (code), \ - (cinfo)->err->msg_parm.i[0] = (p1), \ - (cinfo)->err->msg_parm.i[1] = (p2), \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1)) - -/* Informational/debugging messages */ -#define TRACEMS(cinfo,lvl,code) \ - ((cinfo)->err->msg_code = (code), \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) -#define TRACEMS1(cinfo,lvl,code,p1) \ - ((cinfo)->err->msg_code = (code), \ - (cinfo)->err->msg_parm.i[0] = (p1), \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) -#define TRACEMS2(cinfo,lvl,code,p1,p2) \ - ((cinfo)->err->msg_code = (code), \ - (cinfo)->err->msg_parm.i[0] = (p1), \ - (cinfo)->err->msg_parm.i[1] = (p2), \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) -#define TRACEMS3(cinfo,lvl,code,p1,p2,p3) \ - MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ - _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); \ - (cinfo)->err->msg_code = (code); \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) -#define TRACEMS4(cinfo,lvl,code,p1,p2,p3,p4) \ - MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ - _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \ - (cinfo)->err->msg_code = (code); \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) -#define TRACEMS5(cinfo,lvl,code,p1,p2,p3,p4,p5) \ - MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ - _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \ - _mp[4] = (p5); \ - (cinfo)->err->msg_code = (code); \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) -#define TRACEMS8(cinfo,lvl,code,p1,p2,p3,p4,p5,p6,p7,p8) \ - MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ - _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \ - _mp[4] = (p5); _mp[5] = (p6); _mp[6] = (p7); _mp[7] = (p8); \ - (cinfo)->err->msg_code = (code); \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) -#define TRACEMSS(cinfo,lvl,code,str) \ - ((cinfo)->err->msg_code = (code), \ - strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) - -#endif /* JERROR_H */ diff --git a/cocos2dx/platform/third_party/emscripten/libpng/png.h.REMOVED.git-id b/cocos2dx/platform/third_party/emscripten/libpng/png.h.REMOVED.git-id deleted file mode 100644 index 0c3c1c5571..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libpng/png.h.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -9eada7d4389ece59576d53cff090fe5d9fc910e0 \ No newline at end of file diff --git a/cocos2dx/platform/third_party/emscripten/libpng/pngconf.h b/cocos2dx/platform/third_party/emscripten/libpng/pngconf.h deleted file mode 100644 index 6d1378f5f3..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libpng/pngconf.h +++ /dev/null @@ -1,1552 +0,0 @@ - -/* pngconf.h - machine configurable file for libpng - * - * libpng version 1.4.12 - July 10, 2012 - * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2011 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) - * - * This code is released under the libpng license. - * For conditions of distribution and use, see the disclaimer - * and license in png.h - * - */ - -/* Any machine specific code is near the front of this file, so if you - * are configuring libpng for a machine, you may want to read the section - * starting here down to where it starts to typedef png_color, png_text, - * and png_info. - */ - -#ifndef PNGCONF_H -#define PNGCONF_H - -#ifndef PNG_NO_LIMITS_H -# include -#endif - -/* Added at libpng-1.2.9 */ - -/* config.h is created by and PNG_CONFIGURE_LIBPNG is set by the "configure" - * script. - */ -#ifdef PNG_CONFIGURE_LIBPNG -# ifdef HAVE_CONFIG_H -# include "config.h" -# endif -#endif - -/* - * Added at libpng-1.2.8 - * - * PNG_USER_CONFIG has to be defined on the compiler command line. This - * includes the resource compiler for Windows DLL configurations. - */ -#ifdef PNG_USER_CONFIG -# include "pngusr.h" -# ifndef PNG_USER_PRIVATEBUILD -# define PNG_USER_PRIVATEBUILD -# endif -#endif - -/* - * If you create a private DLL you should define in "pngusr.h" the following: - * #define PNG_USER_PRIVATEBUILD - * e.g. #define PNG_USER_PRIVATEBUILD "Build by MyCompany for xyz reasons." - * #define PNG_USER_DLLFNAME_POSTFIX - * e.g. // private DLL "libpng14gx.dll" - * #define PNG_USER_DLLFNAME_POSTFIX "gx" - * - * The following macros are also at your disposal if you want to complete the - * DLL VERSIONINFO structure. - * - PNG_USER_VERSIONINFO_COMMENTS - * - PNG_USER_VERSIONINFO_COMPANYNAME - * - PNG_USER_VERSIONINFO_LEGALTRADEMARKS - */ - -#ifdef __STDC__ -# ifdef SPECIALBUILD -# pragma message("PNG_LIBPNG_SPECIALBUILD (and deprecated SPECIALBUILD)\ - are now LIBPNG reserved macros. Use PNG_USER_PRIVATEBUILD instead.") -# endif - -# ifdef PRIVATEBUILD -# pragma message("PRIVATEBUILD is deprecated.\ - Use PNG_USER_PRIVATEBUILD instead.") -# define PNG_USER_PRIVATEBUILD PRIVATEBUILD -# endif -#endif /* __STDC__ */ - -/* End of material added to libpng-1.2.8 */ - -/* Added at libpng-1.4.6 */ -#ifndef PNG_UNUSED -/* Unused formal parameter warnings are silenced using the following macro - * which is expected to have no bad effects on performance (optimizing - * compilers will probably remove it entirely). Note that if you replace - * it with something other than whitespace, you must include the terminating - * semicolon. - */ -# define PNG_UNUSED(param) (void)param; -#endif -/* End of material added to libpng-1.4.6 */ - -#ifndef PNG_VERSION_INFO_ONLY - -/* This is the size of the compression buffer, and thus the size of - * an IDAT chunk. Make this whatever size you feel is best for your - * machine. One of these will be allocated per png_struct. When this - * is full, it writes the data to the disk, and does some other - * calculations. Making this an extremely small size will slow - * the library down, but you may want to experiment to determine - * where it becomes significant, if you are concerned with memory - * usage. Note that zlib allocates at least 32Kb also. For readers, - * this describes the size of the buffer available to read the data in. - * Unless this gets smaller than the size of a row (compressed), - * it should not make much difference how big this is. - */ - -#ifndef PNG_ZBUF_SIZE -# define PNG_ZBUF_SIZE 8192 -#endif - -/* Enable if you want a write-only libpng */ - -#ifndef PNG_NO_READ_SUPPORTED -# define PNG_READ_SUPPORTED -#endif - -/* Enable if you want a read-only libpng */ - -#ifndef PNG_NO_WRITE_SUPPORTED -# define PNG_WRITE_SUPPORTED -#endif - -/* Enabled in 1.4.0. */ -#ifdef PNG_ALLOW_BENIGN_ERRORS -# define png_benign_error png_warning -# define png_chunk_benign_error png_chunk_warning -#else -# ifndef PNG_BENIGN_ERRORS_SUPPORTED -# define png_benign_error png_error -# define png_chunk_benign_error png_chunk_error -# endif -#endif - -/* Added at libpng version 1.4.0 */ -#if !defined(PNG_NO_WARNINGS) && !defined(PNG_WARNINGS_SUPPORTED) -# define PNG_WARNINGS_SUPPORTED -#endif - -/* Added at libpng version 1.4.0 */ -#if !defined(PNG_NO_ERROR_TEXT) && !defined(PNG_ERROR_TEXT_SUPPORTED) -# define PNG_ERROR_TEXT_SUPPORTED -#endif - -/* Added at libpng version 1.4.0 */ -#if !defined(PNG_NO_CHECK_cHRM) && !defined(PNG_CHECK_cHRM_SUPPORTED) -# define PNG_CHECK_cHRM_SUPPORTED -#endif - -/* Added at libpng version 1.4.0 */ -#if !defined(PNG_NO_ALIGNED_MEMORY) && !defined(PNG_ALIGNED_MEMORY_SUPPORTED) -# define PNG_ALIGNED_MEMORY_SUPPORTED -#endif - -/* Enabled by default in 1.2.0. You can disable this if you don't need to - support PNGs that are embedded in MNG datastreams */ -#ifndef PNG_NO_MNG_FEATURES -# ifndef PNG_MNG_FEATURES_SUPPORTED -# define PNG_MNG_FEATURES_SUPPORTED -# endif -#endif - -/* Added at libpng version 1.4.0 */ -#ifndef PNG_NO_FLOATING_POINT_SUPPORTED -# ifndef PNG_FLOATING_POINT_SUPPORTED -# define PNG_FLOATING_POINT_SUPPORTED -# endif -#endif - -/* Added at libpng-1.4.0beta49 for testing (this test is no longer used - in libpng and png_calloc() is always present) - */ -#define PNG_CALLOC_SUPPORTED - -/* If you are running on a machine where you cannot allocate more - * than 64K of memory at once, uncomment this. While libpng will not - * normally need that much memory in a chunk (unless you load up a very - * large file), zlib needs to know how big of a chunk it can use, and - * libpng thus makes sure to check any memory allocation to verify it - * will fit into memory. -#define PNG_MAX_MALLOC_64K - */ -#if defined(MAXSEG_64K) && !defined(PNG_MAX_MALLOC_64K) -# define PNG_MAX_MALLOC_64K -#endif - -/* Special munging to support doing things the 'cygwin' way: - * 'Normal' png-on-win32 defines/defaults: - * PNG_BUILD_DLL -- building dll - * PNG_USE_DLL -- building an application, linking to dll - * (no define) -- building static library, or building an - * application and linking to the static lib - * 'Cygwin' defines/defaults: - * PNG_BUILD_DLL -- (ignored) building the dll - * (no define) -- (ignored) building an application, linking to the dll - * PNG_STATIC -- (ignored) building the static lib, or building an - * application that links to the static lib. - * ALL_STATIC -- (ignored) building various static libs, or building an - * application that links to the static libs. - * Thus, - * a cygwin user should define either PNG_BUILD_DLL or PNG_STATIC, and - * this bit of #ifdefs will define the 'correct' config variables based on - * that. If a cygwin user *wants* to define 'PNG_USE_DLL' that's okay, but - * unnecessary. - * - * Also, the precedence order is: - * ALL_STATIC (since we can't #undef something outside our namespace) - * PNG_BUILD_DLL - * PNG_STATIC - * (nothing) == PNG_USE_DLL - * - * CYGWIN (2002-01-20): The preceding is now obsolete. With the advent - * of auto-import in binutils, we no longer need to worry about - * __declspec(dllexport) / __declspec(dllimport) and friends. Therefore, - * we don't need to worry about PNG_STATIC or ALL_STATIC when it comes - * to __declspec() stuff. However, we DO need to worry about - * PNG_BUILD_DLL and PNG_STATIC because those change some defaults - * such as CONSOLE_IO. - */ -#ifdef __CYGWIN__ -# ifdef ALL_STATIC -# ifdef PNG_BUILD_DLL -# undef PNG_BUILD_DLL -# endif -# ifdef PNG_USE_DLL -# undef PNG_USE_DLL -# endif -# ifdef PNG_DLL -# undef PNG_DLL -# endif -# ifndef PNG_STATIC -# define PNG_STATIC -# endif -# else -# ifdef PNG_BUILD_DLL -# ifdef PNG_STATIC -# undef PNG_STATIC -# endif -# ifdef PNG_USE_DLL -# undef PNG_USE_DLL -# endif -# ifndef PNG_DLL -# define PNG_DLL -# endif -# else -# ifdef PNG_STATIC -# ifdef PNG_USE_DLL -# undef PNG_USE_DLL -# endif -# ifdef PNG_DLL -# undef PNG_DLL -# endif -# else -# ifndef PNG_USE_DLL -# define PNG_USE_DLL -# endif -# ifndef PNG_DLL -# define PNG_DLL -# endif -# endif -# endif -# endif -#endif - -/* This protects us against compilers that run on a windowing system - * and thus don't have or would rather us not use the stdio types: - * stdin, stdout, and stderr. The only one currently used is stderr - * in png_error() and png_warning(). #defining PNG_NO_CONSOLE_IO will - * prevent these from being compiled and used. #defining PNG_NO_STDIO - * will also prevent these, plus will prevent the entire set of stdio - * macros and functions (FILE *, printf, etc.) from being compiled and used, - * unless (PNG_DEBUG > 0) has been #defined. - * - * #define PNG_NO_CONSOLE_IO - * #define PNG_NO_STDIO - */ - -#ifdef _WIN32_WCE -# define PNG_NO_CONSOLE_IO -# define PNG_NO_STDIO -# define PNG_NO_TIME_RFC1123 -# ifdef PNG_DEBUG -# undef PNG_DEBUG -# endif -#endif - -#if !defined(PNG_NO_STDIO) && !defined(PNG_STDIO_SUPPORTED) -# define PNG_STDIO_SUPPORTED -#endif - -#ifdef PNG_BUILD_DLL -# if !defined(PNG_CONSOLE_IO_SUPPORTED) && !defined(PNG_NO_CONSOLE_IO) -# define PNG_NO_CONSOLE_IO -# endif -#endif - -# ifdef PNG_NO_STDIO -# ifndef PNG_NO_CONSOLE_IO -# define PNG_NO_CONSOLE_IO -# endif -# ifdef PNG_DEBUG -# if (PNG_DEBUG > 0) -# include -# endif -# endif -# else -# include -# endif - -#if !(defined PNG_NO_CONSOLE_IO) && !defined(PNG_CONSOLE_IO_SUPPORTED) -# define PNG_CONSOLE_IO_SUPPORTED -#endif - -/* This macro protects us against machines that don't have function - * prototypes (ie K&R style headers). If your compiler does not handle - * function prototypes, define this macro and use the included ansi2knr. - * I've always been able to use _NO_PROTO as the indicator, but you may - * need to drag the empty declaration out in front of here, or change the - * ifdef to suit your own needs. - */ -#ifndef PNGARG - -#ifdef OF /* zlib prototype munger */ -# define PNGARG(arglist) OF(arglist) -#else - -#ifdef _NO_PROTO -# define PNGARG(arglist) () -#else -# define PNGARG(arglist) arglist -#endif /* _NO_PROTO */ - -#endif /* OF */ - -#endif /* PNGARG */ - -/* Try to determine if we are compiling on a Mac. Note that testing for - * just __MWERKS__ is not good enough, because the Codewarrior is now used - * on non-Mac platforms. - */ -#ifndef MACOS -# if (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \ - defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC) -# define MACOS -# endif -#endif - -/* Enough people need this for various reasons to include it here */ -#if !defined(MACOS) && !defined(RISCOS) -# include -#endif - -/* PNG_SETJMP_NOT_SUPPORTED and PNG_NO_SETJMP_SUPPORTED are deprecated. */ -#if !defined(PNG_NO_SETJMP) && \ - !defined(PNG_SETJMP_NOT_SUPPORTED) && !defined(PNG_NO_SETJMP_SUPPORTED) -# define PNG_SETJMP_SUPPORTED -#endif - -#ifdef PNG_SETJMP_SUPPORTED -/* This is an attempt to force a single setjmp behaviour on Linux. If - * the X config stuff didn't define _BSD_SOURCE we wouldn't need this. - * - * You can bypass this test if you know that your application uses exactly - * the same setjmp.h that was included when libpng was built. Only define - * PNG_SKIP_SETJMP_CHECK while building your application, prior to the - * application's '#include "png.h"'. Don't define PNG_SKIP_SETJMP_CHECK - * while building a separate libpng library for general use. - */ - -# ifndef PNG_SKIP_SETJMP_CHECK -# ifdef __linux__ -# ifdef _BSD_SOURCE -# define PNG_SAVE_BSD_SOURCE -# undef _BSD_SOURCE -# endif -# ifdef _SETJMP_H - /* If you encounter a compiler error here, see the explanation - * near the end of INSTALL. - */ - __pngconf.h__ in libpng already includes setjmp.h; - __dont__ include it again.; -# endif -# endif /* __linux__ */ -# endif /* PNG_SKIP_SETJMP_CHECK */ - - /* Include setjmp.h for error handling */ -# include - -# ifdef __linux__ -# ifdef PNG_SAVE_BSD_SOURCE -# ifdef _BSD_SOURCE -# undef _BSD_SOURCE -# endif -# define _BSD_SOURCE -# undef PNG_SAVE_BSD_SOURCE -# endif -# endif /* __linux__ */ -#endif /* PNG_SETJMP_SUPPORTED */ - -#ifdef BSD -# include -#else -# include -#endif - -/* Other defines for things like memory and the like can go here. */ - -/* This controls how fine the quantizing gets. As this allocates - * a largish chunk of memory (32K), those who are not as concerned - * with quantizing quality can decrease some or all of these. - */ - -/* Prior to libpng-1.4.2, these were PNG_DITHER_*_BITS - * These migration aids will be removed from libpng-1.5.0. - */ -#ifdef PNG_DITHER_RED_BITS -# define PNG_QUANTIZE_RED_BITS PNG_DITHER_RED_BITS -#endif -#ifdef PNG_DITHER_GREEN_BITS -# define PNG_QUANTIZE_GREEN_BITS PNG_DITHER_GREEN_BITS -#endif -#ifdef PNG_DITHER_BLUE_BITS -# define PNG_QUANTIZE_BLUE_BITS PNG_DITHER_BLUE_BITS -#endif - -#ifndef PNG_QUANTIZE_RED_BITS -# define PNG_QUANTIZE_RED_BITS 5 -#endif -#ifndef PNG_QUANTIZE_GREEN_BITS -# define PNG_QUANTIZE_GREEN_BITS 5 -#endif -#ifndef PNG_QUANTIZE_BLUE_BITS -# define PNG_QUANTIZE_BLUE_BITS 5 -#endif - -/* This controls how fine the gamma correction becomes when you - * are only interested in 8 bits anyway. Increasing this value - * results in more memory being used, and more pow() functions - * being called to fill in the gamma tables. Don't set this value - * less then 8, and even that may not work (I haven't tested it). - */ - -#ifndef PNG_MAX_GAMMA_8 -# define PNG_MAX_GAMMA_8 11 -#endif - -/* This controls how much a difference in gamma we can tolerate before - * we actually start doing gamma conversion. - */ -#ifndef PNG_GAMMA_THRESHOLD -# define PNG_GAMMA_THRESHOLD 0.05 -#endif - -/* The following uses const char * instead of char * for error - * and warning message functions, so some compilers won't complain. - * If you do not want to use const, define PNG_NO_CONST. - */ - -#ifndef PNG_CONST -# ifndef PNG_NO_CONST -# define PNG_CONST const -# else -# define PNG_CONST -# endif -#endif - -/* The following defines give you the ability to remove code from the - * library that you will not be using. I wish I could figure out how to - * automate this, but I can't do that without making it seriously hard - * on the users. So if you are not using an ability, change the #define - * to an #undef, or pass in PNG_NO_feature and that part of the library - * will not be compiled. - - * If your linker can't find a function, you may want to make sure the - * ability is defined here. Some of these depend upon some others being - * defined. I haven't figured out all the interactions here, so you may - * have to experiment awhile to get everything to compile. If you are - * creating or using a shared library, you probably shouldn't touch this, - * as it will affect the size of the structures, and this will cause bad - * things to happen if the library and/or application ever change. - */ - -/* Any features you will not be using can be undef'ed here */ - -/* GR-P, 0.96a: Set "*TRANSFORMS_SUPPORTED as default but allow user - * to turn it off with PNG_NO_READ|WRITE_TRANSFORMS on the compile line, - * then pick and choose which ones to define without having to edit this - * file. It is safe to use the PNG_NO_READ|WRITE_TRANSFORMS - * if you only want to have a png-compliant reader/writer but don't need - * any of the extra transformations. This saves about 80 kbytes in a - * typical installation of the library. (PNG_NO_* form added in version - * 1.0.1c, for consistency; PNG_*_TRANSFORMS_NOT_SUPPORTED deprecated in - * 1.4.0) - */ - -/* Ignore attempt to turn off both floating and fixed point support */ -#if !defined(PNG_FLOATING_POINT_SUPPORTED) || \ - !defined(PNG_NO_FIXED_POINT_SUPPORTED) -# define PNG_FIXED_POINT_SUPPORTED -#endif - -#ifdef PNG_READ_SUPPORTED - -/* PNG_READ_TRANSFORMS_NOT_SUPPORTED is deprecated. */ -#if !defined(PNG_READ_TRANSFORMS_NOT_SUPPORTED) && \ - !defined(PNG_NO_READ_TRANSFORMS) -# define PNG_READ_TRANSFORMS_SUPPORTED -#endif - -#ifdef PNG_READ_TRANSFORMS_SUPPORTED -# ifndef PNG_NO_READ_EXPAND -# define PNG_READ_EXPAND_SUPPORTED -# endif -# ifndef PNG_NO_READ_SHIFT -# define PNG_READ_SHIFT_SUPPORTED -# endif -# ifndef PNG_NO_READ_PACK -# define PNG_READ_PACK_SUPPORTED -# endif -# ifndef PNG_NO_READ_BGR -# define PNG_READ_BGR_SUPPORTED -# endif -# ifndef PNG_NO_READ_SWAP -# define PNG_READ_SWAP_SUPPORTED -# endif -# ifndef PNG_NO_READ_PACKSWAP -# define PNG_READ_PACKSWAP_SUPPORTED -# endif -# ifndef PNG_NO_READ_INVERT -# define PNG_READ_INVERT_SUPPORTED -# endif -# ifndef PNG_NO_READ_QUANTIZE - /* Prior to libpng-1.4.0 this was PNG_READ_DITHER_SUPPORTED */ -# ifndef PNG_NO_READ_DITHER /* This migration aid will be removed */ -# define PNG_READ_QUANTIZE_SUPPORTED -# endif -# endif -# ifndef PNG_NO_READ_BACKGROUND -# define PNG_READ_BACKGROUND_SUPPORTED -# endif -# ifndef PNG_NO_READ_16_TO_8 -# define PNG_READ_16_TO_8_SUPPORTED -# endif -# ifndef PNG_NO_READ_FILLER -# define PNG_READ_FILLER_SUPPORTED -# endif -# ifndef PNG_NO_READ_GAMMA -# define PNG_READ_GAMMA_SUPPORTED -# endif -# ifndef PNG_NO_READ_GRAY_TO_RGB -# define PNG_READ_GRAY_TO_RGB_SUPPORTED -# endif -# ifndef PNG_NO_READ_SWAP_ALPHA -# define PNG_READ_SWAP_ALPHA_SUPPORTED -# endif -# ifndef PNG_NO_READ_INVERT_ALPHA -# define PNG_READ_INVERT_ALPHA_SUPPORTED -# endif -# ifndef PNG_NO_READ_STRIP_ALPHA -# define PNG_READ_STRIP_ALPHA_SUPPORTED -# endif -# ifndef PNG_NO_READ_USER_TRANSFORM -# define PNG_READ_USER_TRANSFORM_SUPPORTED -# endif -# ifndef PNG_NO_READ_RGB_TO_GRAY -# define PNG_READ_RGB_TO_GRAY_SUPPORTED -# endif -#endif /* PNG_READ_TRANSFORMS_SUPPORTED */ - -/* PNG_PROGRESSIVE_READ_NOT_SUPPORTED is deprecated. */ -#if !defined(PNG_NO_PROGRESSIVE_READ) && \ - !defined(PNG_PROGRESSIVE_READ_NOT_SUPPORTED) /* if you don't do progressive */ -# define PNG_PROGRESSIVE_READ_SUPPORTED /* reading. This is not talking */ -#endif /* about interlacing capability! You'll */ - /* still have interlacing unless you change the following define: */ - -#define PNG_READ_INTERLACING_SUPPORTED /* required for PNG-compliant decoders */ - -/* PNG_NO_SEQUENTIAL_READ_SUPPORTED is deprecated. */ -#if !defined(PNG_NO_SEQUENTIAL_READ) && \ - !defined(PNG_SEQUENTIAL_READ_SUPPORTED) && \ - !defined(PNG_NO_SEQUENTIAL_READ_SUPPORTED) -# define PNG_SEQUENTIAL_READ_SUPPORTED -#endif - -#ifndef PNG_NO_READ_COMPOSITE_NODIV -# ifndef PNG_NO_READ_COMPOSITED_NODIV /* libpng-1.0.x misspelling */ -# define PNG_READ_COMPOSITE_NODIV_SUPPORTED /* well tested on Intel, SGI */ -# endif -#endif - -#if !defined(PNG_NO_GET_INT_32) || defined(PNG_READ_oFFS_SUPPORTED) || \ - defined(PNG_READ_pCAL_SUPPORTED) -# ifndef PNG_GET_INT_32_SUPPORTED -# define PNG_GET_INT_32_SUPPORTED -# endif -#endif - -#endif /* PNG_READ_SUPPORTED */ - -#ifdef PNG_WRITE_SUPPORTED - -/* PNG_WRITE_TRANSFORMS_NOT_SUPPORTED is deprecated. */ -#if !defined(PNG_WRITE_TRANSFORMS_NOT_SUPPORTED) && \ - !defined(PNG_NO_WRITE_TRANSFORMS) -# define PNG_WRITE_TRANSFORMS_SUPPORTED -#endif - -#ifdef PNG_WRITE_TRANSFORMS_SUPPORTED -# ifndef PNG_NO_WRITE_SHIFT -# define PNG_WRITE_SHIFT_SUPPORTED -# endif -# ifndef PNG_NO_WRITE_PACK -# define PNG_WRITE_PACK_SUPPORTED -# endif -# ifndef PNG_NO_WRITE_BGR -# define PNG_WRITE_BGR_SUPPORTED -# endif -# ifndef PNG_NO_WRITE_SWAP -# define PNG_WRITE_SWAP_SUPPORTED -# endif -# ifndef PNG_NO_WRITE_PACKSWAP -# define PNG_WRITE_PACKSWAP_SUPPORTED -# endif -# ifndef PNG_NO_WRITE_INVERT -# define PNG_WRITE_INVERT_SUPPORTED -# endif -# ifndef PNG_NO_WRITE_FILLER -# define PNG_WRITE_FILLER_SUPPORTED /* same as WRITE_STRIP_ALPHA */ -# endif -# ifndef PNG_NO_WRITE_SWAP_ALPHA -# define PNG_WRITE_SWAP_ALPHA_SUPPORTED -# endif -# ifndef PNG_NO_WRITE_INVERT_ALPHA -# define PNG_WRITE_INVERT_ALPHA_SUPPORTED -# endif -# ifndef PNG_NO_WRITE_USER_TRANSFORM -# define PNG_WRITE_USER_TRANSFORM_SUPPORTED -# endif -#endif /* PNG_WRITE_TRANSFORMS_SUPPORTED */ - -#if !defined(PNG_NO_WRITE_INTERLACING_SUPPORTED) && \ - !defined(PNG_WRITE_INTERLACING_SUPPORTED) - /* This is not required for PNG-compliant encoders, but can cause - * trouble if left undefined - */ -# define PNG_WRITE_INTERLACING_SUPPORTED -#endif - -#if !defined(PNG_NO_WRITE_WEIGHTED_FILTER) && \ - !defined(PNG_WRITE_WEIGHTED_FILTER) && \ - defined(PNG_FLOATING_POINT_SUPPORTED) -# define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED -#endif - -#ifndef PNG_NO_WRITE_FLUSH -# define PNG_WRITE_FLUSH_SUPPORTED -#endif - -#if !defined(PNG_NO_SAVE_INT_32) || defined(PNG_WRITE_oFFS_SUPPORTED) || \ - defined(PNG_WRITE_pCAL_SUPPORTED) -# ifndef PNG_SAVE_INT_32_SUPPORTED -# define PNG_SAVE_INT_32_SUPPORTED -# endif -#endif - -#endif /* PNG_WRITE_SUPPORTED */ - -#define PNG_NO_ERROR_NUMBERS - -#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ - defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) -# ifndef PNG_NO_USER_TRANSFORM_PTR -# define PNG_USER_TRANSFORM_PTR_SUPPORTED -# endif -#endif - -#if defined(PNG_STDIO_SUPPORTED) && !defined(PNG_TIME_RFC1123_SUPPORTED) -# define PNG_TIME_RFC1123_SUPPORTED -#endif - -/* This adds extra functions in pngget.c for accessing data from the - * info pointer (added in version 0.99) - * png_get_image_width() - * png_get_image_height() - * png_get_bit_depth() - * png_get_color_type() - * png_get_compression_type() - * png_get_filter_type() - * png_get_interlace_type() - * png_get_pixel_aspect_ratio() - * png_get_pixels_per_meter() - * png_get_x_offset_pixels() - * png_get_y_offset_pixels() - * png_get_x_offset_microns() - * png_get_y_offset_microns() - */ -#if !defined(PNG_NO_EASY_ACCESS) && !defined(PNG_EASY_ACCESS_SUPPORTED) -# define PNG_EASY_ACCESS_SUPPORTED -#endif - -/* Added at libpng-1.2.0 */ -#if !defined(PNG_NO_USER_MEM) && !defined(PNG_USER_MEM_SUPPORTED) -# define PNG_USER_MEM_SUPPORTED -#endif - -/* Added at libpng-1.2.6 */ -#ifndef PNG_NO_SET_USER_LIMITS -# ifndef PNG_SET_USER_LIMITS_SUPPORTED -# define PNG_SET_USER_LIMITS_SUPPORTED -# endif - /* Feature added at libpng-1.4.0, this flag added at 1.4.1 */ -# ifndef PNG_SET_CHUNK_CACHE_LIMIT_SUPPORTED -# define PNG_SET_CHUNK_CACHE_LIMIT_SUPPORTED -# endif - /* Feature added at libpng-1.4.1, this flag added at 1.4.1 */ -# ifndef PNG_SET_CHUNK_MALLOC_LIMIT_SUPPORTED -# define PNG_SET_CHUNK_MALLOC_LIMIT_SUPPORTED -# endif -#endif - -/* Added at libpng-1.2.43 */ -#ifndef PNG_USER_LIMITS_SUPPORTED -# ifndef PNG_NO_USER_LIMITS -# define PNG_USER_LIMITS_SUPPORTED -# endif -#endif - -/* Added at libpng-1.0.16 and 1.2.6. To accept all valid PNGs no matter - * how large, set these two limits to 0x7fffffffL - */ -#ifndef PNG_USER_WIDTH_MAX -# define PNG_USER_WIDTH_MAX 1000000L -#endif -#ifndef PNG_USER_HEIGHT_MAX -# define PNG_USER_HEIGHT_MAX 1000000L -#endif - -/* Added at libpng-1.2.43. To accept all valid PNGs no matter - * how large, set these two limits to 0. - */ -#ifndef PNG_USER_CHUNK_CACHE_MAX -# define PNG_USER_CHUNK_CACHE_MAX 0 -#endif - -/* Added at libpng-1.2.43 */ -#ifndef PNG_USER_CHUNK_MALLOC_MAX -# define PNG_USER_CHUNK_MALLOC_MAX 0 -#endif - -/* Added at libpng-1.4.0 */ -#if !defined(PNG_NO_IO_STATE) && !defined(PNG_IO_STATE_SUPPORTED) -# define PNG_IO_STATE_SUPPORTED -#endif - -#ifndef PNG_LITERAL_SHARP -# define PNG_LITERAL_SHARP 0x23 -#endif -#ifndef PNG_LITERAL_LEFT_SQUARE_BRACKET -# define PNG_LITERAL_LEFT_SQUARE_BRACKET 0x5b -#endif -#ifndef PNG_LITERAL_RIGHT_SQUARE_BRACKET -# define PNG_LITERAL_RIGHT_SQUARE_BRACKET 0x5d -#endif -#ifndef PNG_STRING_NEWLINE -#define PNG_STRING_NEWLINE "\n" -#endif - -/* These are currently experimental features, define them if you want */ - -/* Very little testing */ -/* -#ifdef PNG_READ_SUPPORTED -# ifndef PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED -# define PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED -# endif -#endif -*/ - -/* This is only for PowerPC big-endian and 680x0 systems */ -/* some testing */ -/* -#ifndef PNG_READ_BIG_ENDIAN_SUPPORTED -# define PNG_READ_BIG_ENDIAN_SUPPORTED -#endif -*/ - -#if !defined(PNG_NO_USE_READ_MACROS) && !defined(PNG_USE_READ_MACROS) -# define PNG_USE_READ_MACROS -#endif - -/* Buggy compilers (e.g., gcc 2.7.2.2) need PNG_NO_POINTER_INDEXING */ - -#if !defined(PNG_NO_POINTER_INDEXING) && \ - !defined(PNG_POINTER_INDEXING_SUPPORTED) -# define PNG_POINTER_INDEXING_SUPPORTED -#endif - - -/* Any chunks you are not interested in, you can undef here. The - * ones that allocate memory may be expecially important (hIST, - * tEXt, zTXt, tRNS, pCAL). Others will just save time and make png_info - * a bit smaller. - */ - -/* The size of the png_text structure changed in libpng-1.0.6 when - * iTXt support was added. iTXt support was turned off by default through - * libpng-1.2.x, to support old apps that malloc the png_text structure - * instead of calling png_set_text() and letting libpng malloc it. It - * was turned on by default in libpng-1.4.0. - */ - -/* PNG_READ_ANCILLARY_CHUNKS_NOT_SUPPORTED is deprecated. */ -#if defined(PNG_READ_SUPPORTED) && \ - !defined(PNG_READ_ANCILLARY_CHUNKS_NOT_SUPPORTED) && \ - !defined(PNG_NO_READ_ANCILLARY_CHUNKS) -# define PNG_READ_ANCILLARY_CHUNKS_SUPPORTED -#endif - -/* PNG_WRITE_ANCILLARY_CHUNKS_NOT_SUPPORTED is deprecated. */ -#if defined(PNG_WRITE_SUPPORTED) && \ - !defined(PNG_WRITE_ANCILLARY_CHUNKS_NOT_SUPPORTED) && \ - !defined(PNG_NO_WRITE_ANCILLARY_CHUNKS) -# define PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED -#endif - -#ifdef PNG_READ_ANCILLARY_CHUNKS_SUPPORTED - -#ifdef PNG_NO_READ_TEXT -# define PNG_NO_READ_iTXt -# define PNG_NO_READ_tEXt -# define PNG_NO_READ_zTXt -#endif - -#ifndef PNG_NO_READ_bKGD -# define PNG_READ_bKGD_SUPPORTED -# define PNG_bKGD_SUPPORTED -#endif -#ifndef PNG_NO_READ_cHRM -# define PNG_READ_cHRM_SUPPORTED -# define PNG_cHRM_SUPPORTED -#endif -#ifndef PNG_NO_READ_gAMA -# define PNG_READ_gAMA_SUPPORTED -# define PNG_gAMA_SUPPORTED -#endif -#ifndef PNG_NO_READ_hIST -# define PNG_READ_hIST_SUPPORTED -# define PNG_hIST_SUPPORTED -#endif -#ifndef PNG_NO_READ_iCCP -# define PNG_READ_iCCP_SUPPORTED -# define PNG_iCCP_SUPPORTED -#endif -#ifndef PNG_NO_READ_iTXt -# ifndef PNG_READ_iTXt_SUPPORTED -# define PNG_READ_iTXt_SUPPORTED -# endif -# ifndef PNG_iTXt_SUPPORTED -# define PNG_iTXt_SUPPORTED -# endif -#endif -#ifndef PNG_NO_READ_oFFs -# define PNG_READ_oFFs_SUPPORTED -# define PNG_oFFs_SUPPORTED -#endif -#ifndef PNG_NO_READ_pCAL -# define PNG_READ_pCAL_SUPPORTED -# define PNG_pCAL_SUPPORTED -#endif -#ifndef PNG_NO_READ_sCAL -# define PNG_READ_sCAL_SUPPORTED -# define PNG_sCAL_SUPPORTED -#endif -#ifndef PNG_NO_READ_pHYs -# define PNG_READ_pHYs_SUPPORTED -# define PNG_pHYs_SUPPORTED -#endif -#ifndef PNG_NO_READ_sBIT -# define PNG_READ_sBIT_SUPPORTED -# define PNG_sBIT_SUPPORTED -#endif -#ifndef PNG_NO_READ_sPLT -# define PNG_READ_sPLT_SUPPORTED -# define PNG_sPLT_SUPPORTED -#endif -#ifndef PNG_NO_READ_sRGB -# define PNG_READ_sRGB_SUPPORTED -# define PNG_sRGB_SUPPORTED -#endif -#ifndef PNG_NO_READ_tEXt -# define PNG_READ_tEXt_SUPPORTED -# define PNG_tEXt_SUPPORTED -#endif -#ifndef PNG_NO_READ_tIME -# define PNG_READ_tIME_SUPPORTED -# define PNG_tIME_SUPPORTED -#endif -#ifndef PNG_NO_READ_tRNS -# define PNG_READ_tRNS_SUPPORTED -# define PNG_tRNS_SUPPORTED -#endif -#ifndef PNG_NO_READ_zTXt -# define PNG_READ_zTXt_SUPPORTED -# define PNG_zTXt_SUPPORTED -#endif -#ifndef PNG_NO_READ_OPT_PLTE -# define PNG_READ_OPT_PLTE_SUPPORTED /* only affects support of the */ -#endif /* optional PLTE chunk in RGB and RGBA images */ -#if defined(PNG_READ_iTXt_SUPPORTED) || defined(PNG_READ_tEXt_SUPPORTED) || \ - defined(PNG_READ_zTXt_SUPPORTED) -# define PNG_READ_TEXT_SUPPORTED -# define PNG_TEXT_SUPPORTED -#endif - -#endif /* PNG_READ_ANCILLARY_CHUNKS_SUPPORTED */ - -#ifndef PNG_NO_READ_UNKNOWN_CHUNKS -# ifndef PNG_READ_UNKNOWN_CHUNKS_SUPPORTED -# define PNG_READ_UNKNOWN_CHUNKS_SUPPORTED -# endif -# ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED -# define PNG_UNKNOWN_CHUNKS_SUPPORTED -# endif -# ifndef PNG_READ_USER_CHUNKS_SUPPORTED -# define PNG_READ_USER_CHUNKS_SUPPORTED -# endif -#endif -#ifndef PNG_NO_READ_USER_CHUNKS -# ifndef PNG_READ_USER_CHUNKS_SUPPORTED -# define PNG_READ_USER_CHUNKS_SUPPORTED -# endif -# ifndef PNG_USER_CHUNKS_SUPPORTED -# define PNG_USER_CHUNKS_SUPPORTED -# endif -#endif -#ifndef PNG_NO_HANDLE_AS_UNKNOWN -# ifndef PNG_HANDLE_AS_UNKNOWN_SUPPORTED -# define PNG_HANDLE_AS_UNKNOWN_SUPPORTED -# endif -#endif - -#ifdef PNG_WRITE_SUPPORTED -#ifdef PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED - -#ifdef PNG_NO_WRITE_TEXT -# define PNG_NO_WRITE_iTXt -# define PNG_NO_WRITE_tEXt -# define PNG_NO_WRITE_zTXt -#endif -#ifndef PNG_NO_WRITE_bKGD -# define PNG_WRITE_bKGD_SUPPORTED -# ifndef PNG_bKGD_SUPPORTED -# define PNG_bKGD_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_cHRM -# define PNG_WRITE_cHRM_SUPPORTED -# ifndef PNG_cHRM_SUPPORTED -# define PNG_cHRM_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_gAMA -# define PNG_WRITE_gAMA_SUPPORTED -# ifndef PNG_gAMA_SUPPORTED -# define PNG_gAMA_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_hIST -# define PNG_WRITE_hIST_SUPPORTED -# ifndef PNG_hIST_SUPPORTED -# define PNG_hIST_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_iCCP -# define PNG_WRITE_iCCP_SUPPORTED -# ifndef PNG_iCCP_SUPPORTED -# define PNG_iCCP_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_iTXt -# ifndef PNG_WRITE_iTXt_SUPPORTED -# define PNG_WRITE_iTXt_SUPPORTED -# endif -# ifndef PNG_iTXt_SUPPORTED -# define PNG_iTXt_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_oFFs -# define PNG_WRITE_oFFs_SUPPORTED -# ifndef PNG_oFFs_SUPPORTED -# define PNG_oFFs_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_pCAL -# define PNG_WRITE_pCAL_SUPPORTED -# ifndef PNG_pCAL_SUPPORTED -# define PNG_pCAL_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_sCAL -# define PNG_WRITE_sCAL_SUPPORTED -# ifndef PNG_sCAL_SUPPORTED -# define PNG_sCAL_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_pHYs -# define PNG_WRITE_pHYs_SUPPORTED -# ifndef PNG_pHYs_SUPPORTED -# define PNG_pHYs_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_sBIT -# define PNG_WRITE_sBIT_SUPPORTED -# ifndef PNG_sBIT_SUPPORTED -# define PNG_sBIT_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_sPLT -# define PNG_WRITE_sPLT_SUPPORTED -# ifndef PNG_sPLT_SUPPORTED -# define PNG_sPLT_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_sRGB -# define PNG_WRITE_sRGB_SUPPORTED -# ifndef PNG_sRGB_SUPPORTED -# define PNG_sRGB_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_tEXt -# define PNG_WRITE_tEXt_SUPPORTED -# ifndef PNG_tEXt_SUPPORTED -# define PNG_tEXt_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_tIME -# define PNG_WRITE_tIME_SUPPORTED -# ifndef PNG_tIME_SUPPORTED -# define PNG_tIME_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_tRNS -# define PNG_WRITE_tRNS_SUPPORTED -# ifndef PNG_tRNS_SUPPORTED -# define PNG_tRNS_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_zTXt -# define PNG_WRITE_zTXt_SUPPORTED -# ifndef PNG_zTXt_SUPPORTED -# define PNG_zTXt_SUPPORTED -# endif -#endif -#if defined(PNG_WRITE_iTXt_SUPPORTED) || defined(PNG_WRITE_tEXt_SUPPORTED) || \ - defined(PNG_WRITE_zTXt_SUPPORTED) -# define PNG_WRITE_TEXT_SUPPORTED -# ifndef PNG_TEXT_SUPPORTED -# define PNG_TEXT_SUPPORTED -# endif -#endif - -#ifdef PNG_WRITE_tIME_SUPPORTED -# ifndef PNG_NO_CONVERT_tIME -# ifndef _WIN32_WCE -/* The "tm" structure is not supported on WindowsCE */ -# ifndef PNG_CONVERT_tIME_SUPPORTED -# define PNG_CONVERT_tIME_SUPPORTED -# endif -# endif -# endif -#endif - -#endif /* PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED */ - -#ifndef PNG_NO_WRITE_FILTER -# ifndef PNG_WRITE_FILTER_SUPPORTED -# define PNG_WRITE_FILTER_SUPPORTED -# endif -#endif - -#ifndef PNG_NO_WRITE_UNKNOWN_CHUNKS -# define PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED -# ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED -# define PNG_UNKNOWN_CHUNKS_SUPPORTED -# endif -#endif -#ifndef PNG_NO_HANDLE_AS_UNKNOWN -# ifndef PNG_HANDLE_AS_UNKNOWN_SUPPORTED -# define PNG_HANDLE_AS_UNKNOWN_SUPPORTED -# endif -#endif -#endif /* PNG_WRITE_SUPPORTED */ - -/* Turn this off to disable png_read_png() and - * png_write_png() and leave the row_pointers member - * out of the info structure. - */ -#ifndef PNG_NO_INFO_IMAGE -# define PNG_INFO_IMAGE_SUPPORTED -#endif - -/* Need the time information for converting tIME chunks */ -#ifdef PNG_CONVERT_tIME_SUPPORTED - /* "time.h" functions are not supported on WindowsCE */ -# include -#endif - -/* Some typedefs to get us started. These should be safe on most of the - * common platforms. The typedefs should be at least as large as the - * numbers suggest (a png_uint_32 must be at least 32 bits long), but they - * don't have to be exactly that size. Some compilers dislike passing - * unsigned shorts as function parameters, so you may be better off using - * unsigned int for png_uint_16. - */ - -#if defined(INT_MAX) && (INT_MAX > 0x7ffffffeL) -typedef unsigned int png_uint_32; -typedef int png_int_32; -#else -typedef unsigned long png_uint_32; -typedef long png_int_32; -#endif -typedef unsigned short png_uint_16; -typedef short png_int_16; -typedef unsigned char png_byte; - -#ifdef PNG_NO_SIZE_T - typedef unsigned int png_size_t; -#else - typedef size_t png_size_t; -#endif -#define png_sizeof(x) (sizeof (x)) - -/* The following is needed for medium model support. It cannot be in the - * pngpriv.h header. Needs modification for other compilers besides - * MSC. Model independent support declares all arrays and pointers to be - * large using the far keyword. The zlib version used must also support - * model independent data. As of version zlib 1.0.4, the necessary changes - * have been made in zlib. The USE_FAR_KEYWORD define triggers other - * changes that are needed. (Tim Wegner) - */ - -/* Separate compiler dependencies (problem here is that zlib.h always - * defines FAR. (SJT) - */ -#ifdef __BORLANDC__ -# if defined(__LARGE__) || defined(__HUGE__) || defined(__COMPACT__) -# define LDATA 1 -# else -# define LDATA 0 -# endif - /* GRR: why is Cygwin in here? Cygwin is not Borland C... */ -# if !defined(__WIN32__) && !defined(__FLAT__) && !defined(__CYGWIN__) -# define PNG_MAX_MALLOC_64K -# if (LDATA != 1) -# ifndef FAR -# define FAR __far -# endif -# define USE_FAR_KEYWORD -# endif /* LDATA != 1 */ - /* Possibly useful for moving data out of default segment. - * Uncomment it if you want. Could also define FARDATA as - * const if your compiler supports it. (SJT) -# define FARDATA FAR - */ -# endif /* __WIN32__, __FLAT__, __CYGWIN__ */ -#endif /* __BORLANDC__ */ - - -/* Suggest testing for specific compiler first before testing for - * FAR. The Watcom compiler defines both __MEDIUM__ and M_I86MM, - * making reliance oncertain keywords suspect. (SJT) - */ - -/* MSC Medium model */ -#ifdef FAR -# ifdef M_I86MM -# define USE_FAR_KEYWORD -# define FARDATA FAR -# include -# endif -#endif - -/* SJT: default case */ -#ifndef FAR -# define FAR -#endif - -/* At this point FAR is always defined */ -#ifndef FARDATA -# define FARDATA -#endif - -/* Typedef for floating-point numbers that are converted - to fixed-point with a multiple of 100,000, e.g., int_gamma */ -typedef png_int_32 png_fixed_point; - -/* Add typedefs for pointers */ -typedef void FAR * png_voidp; -typedef png_byte FAR * png_bytep; -typedef png_uint_32 FAR * png_uint_32p; -typedef png_int_32 FAR * png_int_32p; -typedef png_uint_16 FAR * png_uint_16p; -typedef png_int_16 FAR * png_int_16p; -typedef PNG_CONST char FAR * png_const_charp; -typedef char FAR * png_charp; -typedef png_fixed_point FAR * png_fixed_point_p; - -#ifndef PNG_NO_STDIO -typedef FILE * png_FILE_p; -#endif - -#ifdef PNG_FLOATING_POINT_SUPPORTED -typedef double FAR * png_doublep; -#endif - -/* Pointers to pointers; i.e. arrays */ -typedef png_byte FAR * FAR * png_bytepp; -typedef png_uint_32 FAR * FAR * png_uint_32pp; -typedef png_int_32 FAR * FAR * png_int_32pp; -typedef png_uint_16 FAR * FAR * png_uint_16pp; -typedef png_int_16 FAR * FAR * png_int_16pp; -typedef PNG_CONST char FAR * FAR * png_const_charpp; -typedef char FAR * FAR * png_charpp; -typedef png_fixed_point FAR * FAR * png_fixed_point_pp; -#ifdef PNG_FLOATING_POINT_SUPPORTED -typedef double FAR * FAR * png_doublepp; -#endif - -/* Pointers to pointers to pointers; i.e., pointer to array */ -typedef char FAR * FAR * FAR * png_charppp; - -/* Define PNG_BUILD_DLL if the module being built is a Windows - * LIBPNG DLL. - * - * Define PNG_USE_DLL if you want to *link* to the Windows LIBPNG DLL. - * It is equivalent to Microsoft predefined macro _DLL that is - * automatically defined when you compile using the share - * version of the CRT (C Run-Time library) - * - * The cygwin mods make this behavior a little different: - * Define PNG_BUILD_DLL if you are building a dll for use with cygwin - * Define PNG_STATIC if you are building a static library for use with cygwin, - * -or- if you are building an application that you want to link to the - * static library. - * PNG_USE_DLL is defined by default (no user action needed) unless one of - * the other flags is defined. - */ - -#if !defined(PNG_DLL) && (defined(PNG_BUILD_DLL) || defined(PNG_USE_DLL)) -# define PNG_DLL -#endif - -/* If you define PNGAPI, e.g., with compiler option "-DPNGAPI=__stdcall", - * you may get warnings regarding the linkage of png_zalloc and png_zfree. - * Don't ignore those warnings; you must also reset the default calling - * convention in your compiler to match your PNGAPI, and you must build - * zlib and your applications the same way you build libpng. - */ - -#ifdef __CYGWIN__ -# undef PNGAPI -# define PNGAPI __cdecl -# undef PNG_IMPEXP -# define PNG_IMPEXP -#endif - -#ifdef __WATCOMC__ -# ifndef PNGAPI -# define PNGAPI -# endif -#endif - -#if defined(__MINGW32__) && !defined(PNG_MODULEDEF) -# ifndef PNG_NO_MODULEDEF -# define PNG_NO_MODULEDEF -# endif -#endif - -#if !defined(PNG_IMPEXP) && defined(PNG_BUILD_DLL) && !defined(PNG_NO_MODULEDEF) -# define PNG_IMPEXP -#endif - -#if defined(PNG_DLL) || defined(_DLL) || defined(__DLL__ ) || \ - (( defined(_Windows) || defined(_WINDOWS) || \ - defined(WIN32) || defined(_WIN32) || defined(__WIN32__) )) - -# ifndef PNGAPI -# if defined(__GNUC__) || (defined (_MSC_VER) && (_MSC_VER >= 800)) -# define PNGAPI __cdecl -# else -# define PNGAPI _cdecl -# endif -# endif - -# if !defined(PNG_IMPEXP) && (!defined(PNG_DLL) || \ - 0 /* WINCOMPILER_WITH_NO_SUPPORT_FOR_DECLIMPEXP */) -# define PNG_IMPEXP -# endif - -# ifndef PNG_IMPEXP - -# define PNG_EXPORT_TYPE1(type,symbol) PNG_IMPEXP type PNGAPI symbol -# define PNG_EXPORT_TYPE2(type,symbol) type PNG_IMPEXP PNGAPI symbol - - /* Borland/Microsoft */ -# if defined(_MSC_VER) || defined(__BORLANDC__) -# if (_MSC_VER >= 800) || (__BORLANDC__ >= 0x500) -# define PNG_EXPORT PNG_EXPORT_TYPE1 -# else -# define PNG_EXPORT PNG_EXPORT_TYPE2 -# ifdef PNG_BUILD_DLL -# define PNG_IMPEXP __export -# else -# define PNG_IMPEXP /*__import */ /* doesn't exist AFAIK in VC++ */ -# endif /* Exists in Borland C++ for - C++ classes (== huge) */ -# endif -# endif - -# ifndef PNG_IMPEXP -# ifdef PNG_BUILD_DLL -# define PNG_IMPEXP __declspec(dllexport) -# else -# define PNG_IMPEXP __declspec(dllimport) -# endif -# endif -# endif /* PNG_IMPEXP */ -#else /* !(DLL || non-cygwin WINDOWS) */ -# if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__) -# ifndef PNGAPI -# define PNGAPI _System -# endif -# else -# if 0 /* ... other platforms, with other meanings */ -# endif -# endif -#endif - -#ifndef PNGAPI -# define PNGAPI -#endif -#ifndef PNG_IMPEXP -# define PNG_IMPEXP -#endif - -#ifdef PNG_BUILDSYMS -# ifndef PNG_EXPORT -# define PNG_EXPORT(type,symbol) PNG_FUNCTION_EXPORT symbol END -# endif -#endif - -#ifndef PNG_EXPORT -# define PNG_EXPORT(type,symbol) PNG_IMPEXP type PNGAPI symbol -#endif - -#define PNG_USE_LOCAL_ARRAYS /* Not used in libpng, defined for legacy apps */ - -/* Support for compiler specific function attributes. These are used - * so that where compiler support is available incorrect use of API - * functions in png.h will generate compiler warnings. - * - * Added at libpng-1.2.41. - */ - -#ifndef PNG_NO_PEDANTIC_WARNINGS -# ifndef PNG_PEDANTIC_WARNINGS_SUPPORTED -# define PNG_PEDANTIC_WARNINGS_SUPPORTED -# endif -#endif - -#ifdef PNG_PEDANTIC_WARNINGS_SUPPORTED -/* Support for compiler specific function attributes. These are used - * so that where compiler support is available incorrect use of API - * functions in png.h will generate compiler warnings. Added at libpng - * version 1.2.41. - */ -# ifdef __GNUC__ -# ifndef PNG_USE_RESULT -# define PNG_USE_RESULT __attribute__((__warn_unused_result__)) -# endif -# ifndef PNG_NORETURN -# define PNG_NORETURN __attribute__((__noreturn__)) -# endif -# ifndef PNG_ALLOCATED -# define PNG_ALLOCATED __attribute__((__malloc__)) -# endif -# ifndef PNG_DEPRECATED -# define PNG_DEPRECATED __attribute__((__deprecated__)) -# endif - - /* This specifically protects structure members that should only be - * accessed from within the library, therefore should be empty during - * a library build. - */ -# ifndef PNG_DEPSTRUCT -# define PNG_DEPSTRUCT __attribute__((__deprecated__)) -# endif -# ifndef PNG_PRIVATE -# if 0 /* Doesn't work so we use deprecated instead*/ -# define PNG_PRIVATE \ - __attribute__((warning("This function is not exported by libpng."))) -# else -# define PNG_PRIVATE \ - __attribute__((__deprecated__)) -# endif -# endif /* PNG_PRIVATE */ -# endif /* __GNUC__ */ -#endif /* PNG_PEDANTIC_WARNINGS */ - -#ifndef PNG_DEPRECATED -# define PNG_DEPRECATED /* Use of this function is deprecated */ -#endif -#ifndef PNG_USE_RESULT -# define PNG_USE_RESULT /* The result of this function must be checked */ -#endif -#ifndef PNG_NORETURN -# define PNG_NORETURN /* This function does not return */ -#endif -#ifndef PNG_ALLOCATED -# define PNG_ALLOCATED /* The result of the function is new memory */ -#endif -#ifndef PNG_DEPSTRUCT -# define PNG_DEPSTRUCT /* Access to this struct member is deprecated */ -#endif -#ifndef PNG_PRIVATE -# define PNG_PRIVATE /* This is a private libpng function */ -#endif - -/* Users may want to use these so they are not private. Any library - * functions that are passed far data must be model-independent. - */ - -/* memory model/platform independent fns */ -#ifndef PNG_ABORT -# if (defined(_Windows) || defined(_WINDOWS) || defined(_WINDOWS_)) -# define PNG_ABORT() ExitProcess(0) -# else -# define PNG_ABORT() abort() -# endif -#endif - -#ifdef USE_FAR_KEYWORD -/* Use this to make far-to-near assignments */ -# define CHECK 1 -# define NOCHECK 0 -# define CVT_PTR(ptr) (png_far_to_near(png_ptr,ptr,CHECK)) -# define CVT_PTR_NOCHECK(ptr) (png_far_to_near(png_ptr,ptr,NOCHECK)) -# define png_strcpy _fstrcpy -# define png_strncpy _fstrncpy /* Added to v 1.2.6 */ -# define png_strlen _fstrlen -# define png_memcmp _fmemcmp /* SJT: added */ -# define png_memcpy _fmemcpy -# define png_memset _fmemset -# define png_sprintf sprintf -#else -# if (defined(_Windows) || defined(_WINDOWS) || defined(_WINDOWS_)) -# /* Favor Windows over C runtime fns */ -# define CVT_PTR(ptr) (ptr) -# define CVT_PTR_NOCHECK(ptr) (ptr) -# define png_strcpy lstrcpyA -# define png_strncpy lstrcpynA -# define png_strlen lstrlenA -# define png_memcmp memcmp -# define png_memcpy CopyMemory -# define png_memset memset -# define png_sprintf wsprintfA -# else -# define CVT_PTR(ptr) (ptr) -# define CVT_PTR_NOCHECK(ptr) (ptr) -# define png_strcpy strcpy -# define png_strncpy strncpy /* Added to v 1.2.6 */ -# define png_strlen strlen -# define png_memcmp memcmp /* SJT: added */ -# define png_memcpy memcpy -# define png_memset memset -# define png_sprintf sprintf -# endif -#endif - -#ifndef PNG_NO_SNPRINTF -# ifdef _MSC_VER -# define png_snprintf _snprintf /* Added to v 1.2.19 */ -# define png_snprintf2 _snprintf -# define png_snprintf6 _snprintf -# else -# define png_snprintf snprintf /* Added to v 1.2.19 */ -# define png_snprintf2 snprintf -# define png_snprintf6 snprintf -# endif -#else - /* You don't have or don't want to use snprintf(). Caution: Using - * sprintf instead of snprintf exposes your application to accidental - * or malevolent buffer overflows. If you don't have snprintf() - * as a general rule you should provide one (you can get one from - * Portable OpenSSH). - */ -# define png_snprintf(s1,n,fmt,x1) png_sprintf(s1,fmt,x1) -# define png_snprintf2(s1,n,fmt,x1,x2) png_sprintf(s1,fmt,x1,x2) -# define png_snprintf6(s1,n,fmt,x1,x2,x3,x4,x5,x6) \ - png_sprintf(s1,fmt,x1,x2,x3,x4,x5,x6) -#endif - -/* png_alloc_size_t is guaranteed to be no smaller than png_size_t, - * and no smaller than png_uint_32. Casts from png_size_t or png_uint_32 - * to png_alloc_size_t are not necessary; in fact, it is recommended - * not to use them at all so that the compiler can complain when something - * turns out to be problematic. - * Casts in the other direction (from png_alloc_size_t to png_size_t or - * png_uint_32) should be explicitly applied; however, we do not expect - * to encounter practical situations that require such conversions. - */ -#if defined(__TURBOC__) && !defined(__FLAT__) - typedef unsigned long png_alloc_size_t; -#else -# if defined(_MSC_VER) && defined(MAXSEG_64K) - typedef unsigned long png_alloc_size_t; -# else - /* This is an attempt to detect an old Windows system where (int) is - * actually 16 bits, in that case png_malloc must have an argument with a - * bigger size to accomodate the requirements of the library. - */ -# if (defined(_Windows) || defined(_WINDOWS) || defined(_WINDOWS_)) && \ - (!defined(INT_MAX) || INT_MAX <= 0x7ffffffeL) - typedef DWORD png_alloc_size_t; -# else - typedef png_size_t png_alloc_size_t; -# endif -# endif -#endif -/* End of memory model/platform independent support */ - -/* Just a little check that someone hasn't tried to define something - * contradictory. - */ -#if (PNG_ZBUF_SIZE > 65536L) && defined(PNG_MAX_MALLOC_64K) -# undef PNG_ZBUF_SIZE -# define PNG_ZBUF_SIZE 65536L -#endif - - -/* Added at libpng-1.2.8 */ -#endif /* PNG_VERSION_INFO_ONLY */ - -#endif /* PNGCONF_H */ diff --git a/cocos2dx/platform/third_party/emscripten/libraries/README b/cocos2dx/platform/third_party/emscripten/libraries/README deleted file mode 100644 index 502af2435b..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libraries/README +++ /dev/null @@ -1,7 +0,0 @@ -libfreetype.a from http://download.savannah.gnu.org/releases/freetype/freetype-2.4.12.tar.gz -- configure flags: ./configure --enable-static --prefix=`pwd`/../build -libpng.a from https://github.com/hachque-Emscripten/libpng-1.2.49.git -libz.a from http://zlib.net/zlib-1.2.8.tar.gz -- configure flags: ./configure --prefix=`pwd`/../build --static -libwebp.a from https://code.google.com/p/webp/downloads/detail?name=libwebp-0.3.0.tar.gz -- configure with ./configure --disable-threading --prefix=/tmp/libwebp -libtiff.a from ftp://ftp.remotesensing.org/pub/libtiff/tiff-4.0.3.tar.gz -- configure flags: ./configure --enable-static --prefix=`pwd`/../build CFLAGS=-DNDEBUG -libjpeg.a from http://www.ijg.org/files/jpegsrc.v9.tar.gz -- configure flags: ./configure --enable-static --prefix=`pwd`/../build -libxml2.a from ftp://xmlsoft.org/libxml2/libxml2-2.9.1.tar.gz -- configure flags: ./configure --with-http=no --with-ftp=no --prefix=`pwd`/../build --with-python=no --with-threads=no --enable-static diff --git a/cocos2dx/platform/third_party/emscripten/libraries/build.sh b/cocos2dx/platform/third_party/emscripten/libraries/build.sh deleted file mode 100755 index faba556b83..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libraries/build.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh -x - -# Hacky script to re-compile all of Cocos2D-X's dependencies with Emscripten. -# TODO: paramaterize directories, download source code and run without user intervention. - -EMSCRIPTEN=~/emscripten -TMP=`mktemp -d /tmp/cc-deps.XXXXXXX` - -# Libtiff, from ftp://ftp.remotesensing.org/pub/libtiff/tiff-4.0.3.tar.gz -cd tiff-4.0.3 -$EMSCRIPTEN/emconfigure ./configure --enable-static --prefix=`pwd`/../build CFLAGS=-DNDEBUG -$EMSCRIPTEN/emmake make clean -$EMSCRIPTEN/emmake make -$EMSCRIPTEN/emmake make install -cd .. - -# Freetype. Build once natively, then again with Emscripten, so as to satisfy build time deps -# From http://download.savannah.gnu.org/releases/freetype/freetype-2.4.12.tar.gz -cd freetype-2.4.12 -./configure --enable-static -make clean -make -# Copy build-time targets to /tmp -cp -v objs/apinames $TMP/apinames -$EMSCRIPTEN/emconfigure ./configure --enable-static --prefix=`pwd`/../build -$EMSCRIPTEN/emmake make clean -# Copy them back -cp -v $TMP/apinames objs/apinames -$EMSCRIPTEN/emmake make -$EMSCRIPTEN/emmake make install - -# libpng, from http://sourceforge.net/projects/libpng/files/libpng14/1.4.12/libpng-1.4.12.tar.gz/download -cd libpng-1.4.12 -$EMSCRIPTEN/emconfigure ./configure --enable-static --prefix=`pwd`/../build -$EMSCRIPTEN/emmake make -$EMSCRIPTEN/emmake make install -cd .. - -# libjpeg, from http://www.ijg.org/files/jpegsrc.v9.tar.gz -cd jpeg-9 -$EMSCRIPTEN/emconfigure ./configure --enable-static --prefix=`pwd`/../build -$EMSCRIPTEN/emmake make -$EMSCRIPTEN/emmake make install -cd .. - -# libwebp, from https://webp.googlecode.com/files/libwebp-0.3.0.tar.gz -cd libwebp-0.3.0 -# Generated autotools files don't work on my Mac. Re-build them here. Otherwise build fails. -./autogen.sh -$EMSCRIPTEN/emconfigure ./configure --disable-threading --prefix=`pwd`/../build --enable-static --disable-shared -$EMSCRIPTEN/emmake make clean -$EMSCRIPTEN/emmake make V=1 -$EMSCRIPTEN/emmake make install -cd .. - -# libz, from http://zlib.net/zlib-1.2.8.tar.gz -cd zlib-1.2.8 -$EMSCRIPTEN/emconfigure ./configure --prefix=`pwd`/../build --static -$EMSCRIPTEN/emmake make -$EMSCRIPTEN/emmake make install -cd .. - -# libxml2, from ftp://xmlsoft.org/libxml2/libxml2-2.9.1.tar.gz -cd libxml2-2.9.1 -$EMSCRIPTEN/emconfigure ./configure --with-http=no --with-ftp=no --prefix=`pwd`/../build --with-python=no --with-threads=no --enable-static -$EMSCRIPTEN/emmake make -$EMSCRIPTEN/emmake make install -cd .. - diff --git a/cocos2dx/platform/third_party/emscripten/libraries/libjpeg.a.REMOVED.git-id b/cocos2dx/platform/third_party/emscripten/libraries/libjpeg.a.REMOVED.git-id deleted file mode 100644 index 735e79c280..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libraries/libjpeg.a.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -02dbd713423f0bf57067a40e5a954957a031a617 \ No newline at end of file diff --git a/cocos2dx/platform/third_party/emscripten/libraries/libpng.a.REMOVED.git-id b/cocos2dx/platform/third_party/emscripten/libraries/libpng.a.REMOVED.git-id deleted file mode 100644 index 28dc98b41e..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libraries/libpng.a.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -dc996fbca0e179cc8c7635b4ffd924060aa9a934 \ No newline at end of file diff --git a/cocos2dx/platform/third_party/emscripten/libraries/libtiff.a.REMOVED.git-id b/cocos2dx/platform/third_party/emscripten/libraries/libtiff.a.REMOVED.git-id deleted file mode 100644 index 87ae1e683d..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libraries/libtiff.a.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -d804fdb860e9fbdd50167fa40990d844d321c3f7 \ No newline at end of file diff --git a/cocos2dx/platform/third_party/emscripten/libraries/libtiffxx.a.REMOVED.git-id b/cocos2dx/platform/third_party/emscripten/libraries/libtiffxx.a.REMOVED.git-id deleted file mode 100644 index 02eef02fd5..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libraries/libtiffxx.a.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -fd6d69587bc3222ceea24ff11e14a42127ac031b \ No newline at end of file diff --git a/cocos2dx/platform/third_party/emscripten/libraries/libwebp.a.REMOVED.git-id b/cocos2dx/platform/third_party/emscripten/libraries/libwebp.a.REMOVED.git-id deleted file mode 100644 index 459f6721bb..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libraries/libwebp.a.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -9b419a33d2c14b37fc5c5037c99826cff1b1d217 \ No newline at end of file diff --git a/cocos2dx/platform/third_party/emscripten/libraries/libxml2.a.REMOVED.git-id b/cocos2dx/platform/third_party/emscripten/libraries/libxml2.a.REMOVED.git-id deleted file mode 100644 index 581ab63b5f..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libraries/libxml2.a.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -80a796ba46316f8e74e961468bb970664bda0543 \ No newline at end of file diff --git a/cocos2dx/platform/third_party/emscripten/libraries/libz.a.REMOVED.git-id b/cocos2dx/platform/third_party/emscripten/libraries/libz.a.REMOVED.git-id deleted file mode 100644 index 7255d070d6..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libraries/libz.a.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -a42146a3b7d81362b0804abadef75738311ab5a3 \ No newline at end of file diff --git a/cocos2dx/platform/third_party/emscripten/libtiff/include/tiffconf.h b/cocos2dx/platform/third_party/emscripten/libtiff/include/tiffconf.h deleted file mode 100644 index 56f4589dcb..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libtiff/include/tiffconf.h +++ /dev/null @@ -1,128 +0,0 @@ -/* libtiff/tiffconf.h. Generated from tiffconf.h.in by configure. */ -/* - Configuration defines for installed libtiff. - This file maintained for backward compatibility. Do not use definitions - from this file in your programs. -*/ - -#ifndef _TIFFCONF_ -#define _TIFFCONF_ - -/* Signed 16-bit type */ -#define TIFF_INT16_T signed short - -/* Signed 32-bit type */ -#define TIFF_INT32_T signed int - -/* Signed 64-bit type */ -#define TIFF_INT64_T signed long - -/* Signed 8-bit type */ -#define TIFF_INT8_T signed char - -/* Unsigned 16-bit type */ -#define TIFF_UINT16_T unsigned short - -/* Unsigned 32-bit type */ -#define TIFF_UINT32_T unsigned int - -/* Unsigned 64-bit type */ -#define TIFF_UINT64_T unsigned long - -/* Unsigned 8-bit type */ -#define TIFF_UINT8_T unsigned char - -/* Signed size type */ -#define TIFF_SSIZE_T signed long - -/* Pointer difference type */ -#define TIFF_PTRDIFF_T ptrdiff_t - -/* Define to 1 if the system has the type `int16'. */ -/* #undef HAVE_INT16 */ - -/* Define to 1 if the system has the type `int32'. */ -/* #undef HAVE_INT32 */ - -/* Define to 1 if the system has the type `int8'. */ -/* #undef HAVE_INT8 */ - -/* Compatibility stuff. */ - -/* Define as 0 or 1 according to the floating point format suported by the - machine */ -#define HAVE_IEEEFP 1 - -/* Set the native cpu bit order (FILLORDER_LSB2MSB or FILLORDER_MSB2LSB) */ -#define HOST_FILLORDER FILLORDER_LSB2MSB - -/* Native cpu byte order: 1 if big-endian (Motorola) or 0 if little-endian - (Intel) */ -#define HOST_BIGENDIAN 0 - -/* Support CCITT Group 3 & 4 algorithms */ -#define CCITT_SUPPORT 1 - -/* Support JPEG compression (requires IJG JPEG library) */ -/* #undef JPEG_SUPPORT */ - -/* Support JBIG compression (requires JBIG-KIT library) */ -/* #undef JBIG_SUPPORT */ - -/* Support LogLuv high dynamic range encoding */ -#define LOGLUV_SUPPORT 1 - -/* Support LZW algorithm */ -#define LZW_SUPPORT 1 - -/* Support NeXT 2-bit RLE algorithm */ -#define NEXT_SUPPORT 1 - -/* Support Old JPEG compresson (read contrib/ojpeg/README first! Compilation - fails with unpatched IJG JPEG library) */ -/* #undef OJPEG_SUPPORT */ - -/* Support Macintosh PackBits algorithm */ -#define PACKBITS_SUPPORT 1 - -/* Support Pixar log-format algorithm (requires Zlib) */ -#define PIXARLOG_SUPPORT 1 - -/* Support ThunderScan 4-bit RLE algorithm */ -#define THUNDER_SUPPORT 1 - -/* Support Deflate compression */ -#define ZIP_SUPPORT 1 - -/* Support strip chopping (whether or not to convert single-strip uncompressed - images to mutiple strips of ~8Kb to reduce memory usage) */ -#define STRIPCHOP_DEFAULT TIFF_STRIPCHOP - -/* Enable SubIFD tag (330) support */ -#define SUBIFD_SUPPORT 1 - -/* Treat extra sample as alpha (default enabled). The RGBA interface will - treat a fourth sample with no EXTRASAMPLE_ value as being ASSOCALPHA. Many - packages produce RGBA files but don't mark the alpha properly. */ -#define DEFAULT_EXTRASAMPLE_AS_ALPHA 1 - -/* Pick up YCbCr subsampling info from the JPEG data stream to support files - lacking the tag (default enabled). */ -#define CHECK_JPEG_YCBCR_SUBSAMPLING 1 - -/* Support MS MDI magic number files as TIFF */ -#define MDI_SUPPORT 1 - -/* - * Feature support definitions. - * XXX: These macros are obsoleted. Don't use them in your apps! - * Macros stays here for backward compatibility and should be always defined. - */ -#define COLORIMETRY_SUPPORT -#define YCBCR_SUPPORT -#define CMYK_SUPPORT -#define ICC_SUPPORT -#define PHOTOSHOP_SUPPORT -#define IPTC_SUPPORT - -#endif /* _TIFFCONF_ */ diff --git a/cocos2dx/platform/third_party/emscripten/libtiff/include/tiffio.hxx b/cocos2dx/platform/third_party/emscripten/libtiff/include/tiffio.hxx deleted file mode 100644 index ed994f1156..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libtiff/include/tiffio.hxx +++ /dev/null @@ -1,49 +0,0 @@ -/* $Id: tiffio.hxx,v 1.3 2010-06-08 18:55:15 bfriesen Exp $ */ - -/* - * Copyright (c) 1988-1997 Sam Leffler - * Copyright (c) 1991-1997 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Sam Leffler and Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#ifndef _TIFFIO_HXX_ -#define _TIFFIO_HXX_ - -/* - * TIFF I/O library definitions which provide C++ streams API. - */ - -#include -#include "tiff.h" - -extern TIFF* TIFFStreamOpen(const char*, std::ostream *); -extern TIFF* TIFFStreamOpen(const char*, std::istream *); - -#endif /* _TIFFIO_HXX_ */ - -/* vim: set ts=8 sts=8 sw=8 noet: */ -/* - * Local Variables: - * mode: c++ - * c-basic-offset: 8 - * fill-column: 78 - * End: - */ diff --git a/cocos2dx/platform/third_party/emscripten/libwebp/webp/decode.h b/cocos2dx/platform/third_party/emscripten/libwebp/webp/decode.h deleted file mode 100644 index 181eb18605..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libwebp/webp/decode.h +++ /dev/null @@ -1,482 +0,0 @@ -// Copyright 2010 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Main decoding functions for WebP images. -// -// Author: Skal (pascal.massimino@gmail.com) - -#ifndef WEBP_WEBP_DECODE_H_ -#define WEBP_WEBP_DECODE_H_ - -#include "./types.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -#define WEBP_DECODER_ABI_VERSION 0x0201 // MAJOR(8b) + MINOR(8b) - -typedef struct WebPRGBABuffer WebPRGBABuffer; -typedef struct WebPYUVABuffer WebPYUVABuffer; -typedef struct WebPDecBuffer WebPDecBuffer; -#if !(defined(__cplusplus) || defined(c_plusplus)) -typedef enum VP8StatusCode VP8StatusCode; -typedef enum WEBP_CSP_MODE WEBP_CSP_MODE; -#endif -typedef struct WebPIDecoder WebPIDecoder; -typedef struct WebPBitstreamFeatures WebPBitstreamFeatures; -typedef struct WebPDecoderOptions WebPDecoderOptions; -typedef struct WebPDecoderConfig WebPDecoderConfig; - -// Return the decoder's version number, packed in hexadecimal using 8bits for -// each of major/minor/revision. E.g: v2.5.7 is 0x020507. -WEBP_EXTERN(int) WebPGetDecoderVersion(void); - -// Retrieve basic header information: width, height. -// This function will also validate the header and return 0 in -// case of formatting error. -// Pointers 'width' and 'height' can be passed NULL if deemed irrelevant. -WEBP_EXTERN(int) WebPGetInfo(const uint8_t* data, size_t data_size, - int* width, int* height); - -// Decodes WebP images pointed to by 'data' and returns RGBA samples, along -// with the dimensions in *width and *height. The ordering of samples in -// memory is R, G, B, A, R, G, B, A... in scan order (endian-independent). -// The returned pointer should be deleted calling free(). -// Returns NULL in case of error. -WEBP_EXTERN(uint8_t*) WebPDecodeRGBA(const uint8_t* data, size_t data_size, - int* width, int* height); - -// Same as WebPDecodeRGBA, but returning A, R, G, B, A, R, G, B... ordered data. -WEBP_EXTERN(uint8_t*) WebPDecodeARGB(const uint8_t* data, size_t data_size, - int* width, int* height); - -// Same as WebPDecodeRGBA, but returning B, G, R, A, B, G, R, A... ordered data. -WEBP_EXTERN(uint8_t*) WebPDecodeBGRA(const uint8_t* data, size_t data_size, - int* width, int* height); - -// Same as WebPDecodeRGBA, but returning R, G, B, R, G, B... ordered data. -// If the bitstream contains transparency, it is ignored. -WEBP_EXTERN(uint8_t*) WebPDecodeRGB(const uint8_t* data, size_t data_size, - int* width, int* height); - -// Same as WebPDecodeRGB, but returning B, G, R, B, G, R... ordered data. -WEBP_EXTERN(uint8_t*) WebPDecodeBGR(const uint8_t* data, size_t data_size, - int* width, int* height); - - -// Decode WebP images pointed to by 'data' to Y'UV format(*). The pointer -// returned is the Y samples buffer. Upon return, *u and *v will point to -// the U and V chroma data. These U and V buffers need NOT be free()'d, -// unlike the returned Y luma one. The dimension of the U and V planes -// are both (*width + 1) / 2 and (*height + 1)/ 2. -// Upon return, the Y buffer has a stride returned as '*stride', while U and V -// have a common stride returned as '*uv_stride'. -// Return NULL in case of error. -// (*) Also named Y'CbCr. See: http://en.wikipedia.org/wiki/YCbCr -WEBP_EXTERN(uint8_t*) WebPDecodeYUV(const uint8_t* data, size_t data_size, - int* width, int* height, - uint8_t** u, uint8_t** v, - int* stride, int* uv_stride); - -// These five functions are variants of the above ones, that decode the image -// directly into a pre-allocated buffer 'output_buffer'. The maximum storage -// available in this buffer is indicated by 'output_buffer_size'. If this -// storage is not sufficient (or an error occurred), NULL is returned. -// Otherwise, output_buffer is returned, for convenience. -// The parameter 'output_stride' specifies the distance (in bytes) -// between scanlines. Hence, output_buffer_size is expected to be at least -// output_stride x picture-height. -WEBP_EXTERN(uint8_t*) WebPDecodeRGBAInto( - const uint8_t* data, size_t data_size, - uint8_t* output_buffer, size_t output_buffer_size, int output_stride); -WEBP_EXTERN(uint8_t*) WebPDecodeARGBInto( - const uint8_t* data, size_t data_size, - uint8_t* output_buffer, size_t output_buffer_size, int output_stride); -WEBP_EXTERN(uint8_t*) WebPDecodeBGRAInto( - const uint8_t* data, size_t data_size, - uint8_t* output_buffer, size_t output_buffer_size, int output_stride); - -// RGB and BGR variants. Here too the transparency information, if present, -// will be dropped and ignored. -WEBP_EXTERN(uint8_t*) WebPDecodeRGBInto( - const uint8_t* data, size_t data_size, - uint8_t* output_buffer, size_t output_buffer_size, int output_stride); -WEBP_EXTERN(uint8_t*) WebPDecodeBGRInto( - const uint8_t* data, size_t data_size, - uint8_t* output_buffer, size_t output_buffer_size, int output_stride); - -// WebPDecodeYUVInto() is a variant of WebPDecodeYUV() that operates directly -// into pre-allocated luma/chroma plane buffers. This function requires the -// strides to be passed: one for the luma plane and one for each of the -// chroma ones. The size of each plane buffer is passed as 'luma_size', -// 'u_size' and 'v_size' respectively. -// Pointer to the luma plane ('*luma') is returned or NULL if an error occurred -// during decoding (or because some buffers were found to be too small). -WEBP_EXTERN(uint8_t*) WebPDecodeYUVInto( - const uint8_t* data, size_t data_size, - uint8_t* luma, size_t luma_size, int luma_stride, - uint8_t* u, size_t u_size, int u_stride, - uint8_t* v, size_t v_size, int v_stride); - -//------------------------------------------------------------------------------ -// Output colorspaces and buffer - -// Colorspaces -// Note: the naming describes the byte-ordering of packed samples in memory. -// For instance, MODE_BGRA relates to samples ordered as B,G,R,A,B,G,R,A,... -// Non-capital names (e.g.:MODE_Argb) relates to pre-multiplied RGB channels. -// RGBA-4444 and RGB-565 colorspaces are represented by following byte-order: -// RGBA-4444: [r3 r2 r1 r0 g3 g2 g1 g0], [b3 b2 b1 b0 a3 a2 a1 a0], ... -// RGB-565: [r4 r3 r2 r1 r0 g5 g4 g3], [g2 g1 g0 b4 b3 b2 b1 b0], ... -// In the case WEBP_SWAP_16BITS_CSP is defined, the bytes are swapped for -// these two modes: -// RGBA-4444: [b3 b2 b1 b0 a3 a2 a1 a0], [r3 r2 r1 r0 g3 g2 g1 g0], ... -// RGB-565: [g2 g1 g0 b4 b3 b2 b1 b0], [r4 r3 r2 r1 r0 g5 g4 g3], ... - -enum WEBP_CSP_MODE { - MODE_RGB = 0, MODE_RGBA = 1, - MODE_BGR = 2, MODE_BGRA = 3, - MODE_ARGB = 4, MODE_RGBA_4444 = 5, - MODE_RGB_565 = 6, - // RGB-premultiplied transparent modes (alpha value is preserved) - MODE_rgbA = 7, - MODE_bgrA = 8, - MODE_Argb = 9, - MODE_rgbA_4444 = 10, - // YUV modes must come after RGB ones. - MODE_YUV = 11, MODE_YUVA = 12, // yuv 4:2:0 - MODE_LAST = 13 -}; - -// Some useful macros: -static WEBP_INLINE int WebPIsPremultipliedMode(WEBP_CSP_MODE mode) { - return (mode == MODE_rgbA || mode == MODE_bgrA || mode == MODE_Argb || - mode == MODE_rgbA_4444); -} - -static WEBP_INLINE int WebPIsAlphaMode(WEBP_CSP_MODE mode) { - return (mode == MODE_RGBA || mode == MODE_BGRA || mode == MODE_ARGB || - mode == MODE_RGBA_4444 || mode == MODE_YUVA || - WebPIsPremultipliedMode(mode)); -} - -static WEBP_INLINE int WebPIsRGBMode(WEBP_CSP_MODE mode) { - return (mode < MODE_YUV); -} - -//------------------------------------------------------------------------------ -// WebPDecBuffer: Generic structure for describing the output sample buffer. - -struct WebPRGBABuffer { // view as RGBA - uint8_t* rgba; // pointer to RGBA samples - int stride; // stride in bytes from one scanline to the next. - size_t size; // total size of the *rgba buffer. -}; - -struct WebPYUVABuffer { // view as YUVA - uint8_t* y, *u, *v, *a; // pointer to luma, chroma U/V, alpha samples - int y_stride; // luma stride - int u_stride, v_stride; // chroma strides - int a_stride; // alpha stride - size_t y_size; // luma plane size - size_t u_size, v_size; // chroma planes size - size_t a_size; // alpha-plane size -}; - -// Output buffer -struct WebPDecBuffer { - WEBP_CSP_MODE colorspace; // Colorspace. - int width, height; // Dimensions. - int is_external_memory; // If true, 'internal_memory' pointer is not used. - union { - WebPRGBABuffer RGBA; - WebPYUVABuffer YUVA; - } u; // Nameless union of buffer parameters. - uint32_t pad[4]; // padding for later use - - uint8_t* private_memory; // Internally allocated memory (only when - // is_external_memory is false). Should not be used - // externally, but accessed via the buffer union. -}; - -// Internal, version-checked, entry point -WEBP_EXTERN(int) WebPInitDecBufferInternal(WebPDecBuffer*, int); - -// Initialize the structure as empty. Must be called before any other use. -// Returns false in case of version mismatch -static WEBP_INLINE int WebPInitDecBuffer(WebPDecBuffer* buffer) { - return WebPInitDecBufferInternal(buffer, WEBP_DECODER_ABI_VERSION); -} - -// Free any memory associated with the buffer. Must always be called last. -// Note: doesn't free the 'buffer' structure itself. -WEBP_EXTERN(void) WebPFreeDecBuffer(WebPDecBuffer* buffer); - -//------------------------------------------------------------------------------ -// Enumeration of the status codes - -enum VP8StatusCode { - VP8_STATUS_OK = 0, - VP8_STATUS_OUT_OF_MEMORY, - VP8_STATUS_INVALID_PARAM, - VP8_STATUS_BITSTREAM_ERROR, - VP8_STATUS_UNSUPPORTED_FEATURE, - VP8_STATUS_SUSPENDED, - VP8_STATUS_USER_ABORT, - VP8_STATUS_NOT_ENOUGH_DATA -}; - -//------------------------------------------------------------------------------ -// Incremental decoding -// -// This API allows streamlined decoding of partial data. -// Picture can be incrementally decoded as data become available thanks to the -// WebPIDecoder object. This object can be left in a SUSPENDED state if the -// picture is only partially decoded, pending additional input. -// Code example: -// -// WebPInitDecBuffer(&buffer); -// buffer.colorspace = mode; -// ... -// WebPIDecoder* idec = WebPINewDecoder(&buffer); -// while (has_more_data) { -// // ... (get additional data) -// status = WebPIAppend(idec, new_data, new_data_size); -// if (status != VP8_STATUS_SUSPENDED || -// break; -// } -// -// // The above call decodes the current available buffer. -// // Part of the image can now be refreshed by calling to -// // WebPIDecGetRGB()/WebPIDecGetYUVA() etc. -// } -// WebPIDelete(idec); - -// Creates a new incremental decoder with the supplied buffer parameter. -// This output_buffer can be passed NULL, in which case a default output buffer -// is used (with MODE_RGB). Otherwise, an internal reference to 'output_buffer' -// is kept, which means that the lifespan of 'output_buffer' must be larger than -// that of the returned WebPIDecoder object. -// Returns NULL if the allocation failed. -WEBP_EXTERN(WebPIDecoder*) WebPINewDecoder(WebPDecBuffer* output_buffer); - -// This function allocates and initializes an incremental-decoder object, which -// will output the RGB/A samples specified by 'csp' into a preallocated -// buffer 'output_buffer'. The size of this buffer is at least -// 'output_buffer_size' and the stride (distance in bytes between two scanlines) -// is specified by 'output_stride'. -// Additionally, output_buffer can be passed NULL in which case the output -// buffer will be allocated automatically when the decoding starts. The -// colorspace 'csp' is taken into account for allocating this buffer. All other -// parameters are ignored. -// Returns NULL if the allocation failed, or if some parameters are invalid. -WEBP_EXTERN(WebPIDecoder*) WebPINewRGB( - WEBP_CSP_MODE csp, - uint8_t* output_buffer, size_t output_buffer_size, int output_stride); - -// This function allocates and initializes an incremental-decoder object, which -// will output the raw luma/chroma samples into a preallocated planes if -// supplied. The luma plane is specified by its pointer 'luma', its size -// 'luma_size' and its stride 'luma_stride'. Similarly, the chroma-u plane -// is specified by the 'u', 'u_size' and 'u_stride' parameters, and the chroma-v -// plane by 'v' and 'v_size'. And same for the alpha-plane. The 'a' pointer -// can be pass NULL in case one is not interested in the transparency plane. -// Conversely, 'luma' can be passed NULL if no preallocated planes are supplied. -// In this case, the output buffer will be automatically allocated (using -// MODE_YUVA) when decoding starts. All parameters are then ignored. -// Returns NULL if the allocation failed or if a parameter is invalid. -WEBP_EXTERN(WebPIDecoder*) WebPINewYUVA( - uint8_t* luma, size_t luma_size, int luma_stride, - uint8_t* u, size_t u_size, int u_stride, - uint8_t* v, size_t v_size, int v_stride, - uint8_t* a, size_t a_size, int a_stride); - -// Deprecated version of the above, without the alpha plane. -// Kept for backward compatibility. -WEBP_EXTERN(WebPIDecoder*) WebPINewYUV( - uint8_t* luma, size_t luma_size, int luma_stride, - uint8_t* u, size_t u_size, int u_stride, - uint8_t* v, size_t v_size, int v_stride); - -// Deletes the WebPIDecoder object and associated memory. Must always be called -// if WebPINewDecoder, WebPINewRGB or WebPINewYUV succeeded. -WEBP_EXTERN(void) WebPIDelete(WebPIDecoder* idec); - -// Copies and decodes the next available data. Returns VP8_STATUS_OK when -// the image is successfully decoded. Returns VP8_STATUS_SUSPENDED when more -// data is expected. Returns error in other cases. -WEBP_EXTERN(VP8StatusCode) WebPIAppend( - WebPIDecoder* idec, const uint8_t* data, size_t data_size); - -// A variant of the above function to be used when data buffer contains -// partial data from the beginning. In this case data buffer is not copied -// to the internal memory. -// Note that the value of the 'data' pointer can change between calls to -// WebPIUpdate, for instance when the data buffer is resized to fit larger data. -WEBP_EXTERN(VP8StatusCode) WebPIUpdate( - WebPIDecoder* idec, const uint8_t* data, size_t data_size); - -// Returns the RGB/A image decoded so far. Returns NULL if output params -// are not initialized yet. The RGB/A output type corresponds to the colorspace -// specified during call to WebPINewDecoder() or WebPINewRGB(). -// *last_y is the index of last decoded row in raster scan order. Some pointers -// (*last_y, *width etc.) can be NULL if corresponding information is not -// needed. -WEBP_EXTERN(uint8_t*) WebPIDecGetRGB( - const WebPIDecoder* idec, int* last_y, - int* width, int* height, int* stride); - -// Same as above function to get a YUVA image. Returns pointer to the luma -// plane or NULL in case of error. If there is no alpha information -// the alpha pointer '*a' will be returned NULL. -WEBP_EXTERN(uint8_t*) WebPIDecGetYUVA( - const WebPIDecoder* idec, int* last_y, - uint8_t** u, uint8_t** v, uint8_t** a, - int* width, int* height, int* stride, int* uv_stride, int* a_stride); - -// Deprecated alpha-less version of WebPIDecGetYUVA(): it will ignore the -// alpha information (if present). Kept for backward compatibility. -static WEBP_INLINE uint8_t* WebPIDecGetYUV( - const WebPIDecoder* idec, int* last_y, uint8_t** u, uint8_t** v, - int* width, int* height, int* stride, int* uv_stride) { - return WebPIDecGetYUVA(idec, last_y, u, v, NULL, width, height, - stride, uv_stride, NULL); -} - -// Generic call to retrieve information about the displayable area. -// If non NULL, the left/right/width/height pointers are filled with the visible -// rectangular area so far. -// Returns NULL in case the incremental decoder object is in an invalid state. -// Otherwise returns the pointer to the internal representation. This structure -// is read-only, tied to WebPIDecoder's lifespan and should not be modified. -WEBP_EXTERN(const WebPDecBuffer*) WebPIDecodedArea( - const WebPIDecoder* idec, int* left, int* top, int* width, int* height); - -//------------------------------------------------------------------------------ -// Advanced decoding parametrization -// -// Code sample for using the advanced decoding API -/* - // A) Init a configuration object - WebPDecoderConfig config; - CHECK(WebPInitDecoderConfig(&config)); - - // B) optional: retrieve the bitstream's features. - CHECK(WebPGetFeatures(data, data_size, &config.input) == VP8_STATUS_OK); - - // C) Adjust 'config', if needed - config.no_fancy_upsampling = 1; - config.output.colorspace = MODE_BGRA; - // etc. - - // Note that you can also make config.output point to an externally - // supplied memory buffer, provided it's big enough to store the decoded - // picture. Otherwise, config.output will just be used to allocate memory - // and store the decoded picture. - - // D) Decode! - CHECK(WebPDecode(data, data_size, &config) == VP8_STATUS_OK); - - // E) Decoded image is now in config.output (and config.output.u.RGBA) - - // F) Reclaim memory allocated in config's object. It's safe to call - // this function even if the memory is external and wasn't allocated - // by WebPDecode(). - WebPFreeDecBuffer(&config.output); -*/ - -// Features gathered from the bitstream -struct WebPBitstreamFeatures { - int width; // Width in pixels, as read from the bitstream. - int height; // Height in pixels, as read from the bitstream. - int has_alpha; // True if the bitstream contains an alpha channel. - int has_animation; // True if the bitstream is an animation. - - // Unused for now: - int bitstream_version; // should be 0 for now. TODO(later) - int no_incremental_decoding; // if true, using incremental decoding is not - // recommended. - int rotate; // TODO(later) - int uv_sampling; // should be 0 for now. TODO(later) - uint32_t pad[2]; // padding for later use -}; - -// Internal, version-checked, entry point -WEBP_EXTERN(VP8StatusCode) WebPGetFeaturesInternal( - const uint8_t*, size_t, WebPBitstreamFeatures*, int); - -// Retrieve features from the bitstream. The *features structure is filled -// with information gathered from the bitstream. -// Returns VP8_STATUS_OK when the features are successfully retrieved. Returns -// VP8_STATUS_NOT_ENOUGH_DATA when more data is needed to retrieve the -// features from headers. Returns error in other cases. -static WEBP_INLINE VP8StatusCode WebPGetFeatures( - const uint8_t* data, size_t data_size, - WebPBitstreamFeatures* features) { - return WebPGetFeaturesInternal(data, data_size, features, - WEBP_DECODER_ABI_VERSION); -} - -// Decoding options -struct WebPDecoderOptions { - int bypass_filtering; // if true, skip the in-loop filtering - int no_fancy_upsampling; // if true, use faster pointwise upsampler - int use_cropping; // if true, cropping is applied _first_ - int crop_left, crop_top; // top-left position for cropping. - // Will be snapped to even values. - int crop_width, crop_height; // dimension of the cropping area - int use_scaling; // if true, scaling is applied _afterward_ - int scaled_width, scaled_height; // final resolution - int use_threads; // if true, use multi-threaded decoding - - // Unused for now: - int force_rotation; // forced rotation (to be applied _last_) - int no_enhancement; // if true, discard enhancement layer - uint32_t pad[6]; // padding for later use -}; - -// Main object storing the configuration for advanced decoding. -struct WebPDecoderConfig { - WebPBitstreamFeatures input; // Immutable bitstream features (optional) - WebPDecBuffer output; // Output buffer (can point to external mem) - WebPDecoderOptions options; // Decoding options -}; - -// Internal, version-checked, entry point -WEBP_EXTERN(int) WebPInitDecoderConfigInternal(WebPDecoderConfig*, int); - -// Initialize the configuration as empty. This function must always be -// called first, unless WebPGetFeatures() is to be called. -// Returns false in case of mismatched version. -static WEBP_INLINE int WebPInitDecoderConfig(WebPDecoderConfig* config) { - return WebPInitDecoderConfigInternal(config, WEBP_DECODER_ABI_VERSION); -} - -// Instantiate a new incremental decoder object with the requested -// configuration. The bitstream can be passed using 'data' and 'data_size' -// parameter, in which case the features will be parsed and stored into -// config->input. Otherwise, 'data' can be NULL and no parsing will occur. -// Note that 'config' can be NULL too, in which case a default configuration -// is used. -// The return WebPIDecoder object must always be deleted calling WebPIDelete(). -// Returns NULL in case of error (and config->status will then reflect -// the error condition). -WEBP_EXTERN(WebPIDecoder*) WebPIDecode(const uint8_t* data, size_t data_size, - WebPDecoderConfig* config); - -// Non-incremental version. This version decodes the full data at once, taking -// 'config' into account. Returns decoding status (which should be VP8_STATUS_OK -// if the decoding was successful). -WEBP_EXTERN(VP8StatusCode) WebPDecode(const uint8_t* data, size_t data_size, - WebPDecoderConfig* config); - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif - -#endif /* WEBP_WEBP_DECODE_H_ */ diff --git a/cocos2dx/platform/third_party/emscripten/libwebp/webp/encode.h b/cocos2dx/platform/third_party/emscripten/libwebp/webp/encode.h deleted file mode 100644 index fea8ee428d..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libwebp/webp/encode.h +++ /dev/null @@ -1,480 +0,0 @@ -// Copyright 2011 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// WebP encoder: main interface -// -// Author: Skal (pascal.massimino@gmail.com) - -#ifndef WEBP_WEBP_ENCODE_H_ -#define WEBP_WEBP_ENCODE_H_ - -#include "./types.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -#define WEBP_ENCODER_ABI_VERSION 0x0201 // MAJOR(8b) + MINOR(8b) - -#if !(defined(__cplusplus) || defined(c_plusplus)) -typedef enum WebPImageHint WebPImageHint; -typedef enum WebPEncCSP WebPEncCSP; -typedef enum WebPPreset WebPPreset; -typedef enum WebPEncodingError WebPEncodingError; -#endif -typedef struct WebPConfig WebPConfig; -typedef struct WebPPicture WebPPicture; // main structure for I/O -typedef struct WebPAuxStats WebPAuxStats; -typedef struct WebPMemoryWriter WebPMemoryWriter; - -// Return the encoder's version number, packed in hexadecimal using 8bits for -// each of major/minor/revision. E.g: v2.5.7 is 0x020507. -WEBP_EXTERN(int) WebPGetEncoderVersion(void); - -//------------------------------------------------------------------------------ -// One-stop-shop call! No questions asked: - -// Returns the size of the compressed data (pointed to by *output), or 0 if -// an error occurred. The compressed data must be released by the caller -// using the call 'free(*output)'. -// These functions compress using the lossy format, and the quality_factor -// can go from 0 (smaller output, lower quality) to 100 (best quality, -// larger output). -WEBP_EXTERN(size_t) WebPEncodeRGB(const uint8_t* rgb, - int width, int height, int stride, - float quality_factor, uint8_t** output); -WEBP_EXTERN(size_t) WebPEncodeBGR(const uint8_t* bgr, - int width, int height, int stride, - float quality_factor, uint8_t** output); -WEBP_EXTERN(size_t) WebPEncodeRGBA(const uint8_t* rgba, - int width, int height, int stride, - float quality_factor, uint8_t** output); -WEBP_EXTERN(size_t) WebPEncodeBGRA(const uint8_t* bgra, - int width, int height, int stride, - float quality_factor, uint8_t** output); - -// These functions are the equivalent of the above, but compressing in a -// lossless manner. Files are usually larger than lossy format, but will -// not suffer any compression loss. -WEBP_EXTERN(size_t) WebPEncodeLosslessRGB(const uint8_t* rgb, - int width, int height, int stride, - uint8_t** output); -WEBP_EXTERN(size_t) WebPEncodeLosslessBGR(const uint8_t* bgr, - int width, int height, int stride, - uint8_t** output); -WEBP_EXTERN(size_t) WebPEncodeLosslessRGBA(const uint8_t* rgba, - int width, int height, int stride, - uint8_t** output); -WEBP_EXTERN(size_t) WebPEncodeLosslessBGRA(const uint8_t* bgra, - int width, int height, int stride, - uint8_t** output); - -//------------------------------------------------------------------------------ -// Coding parameters - -// Image characteristics hint for the underlying encoder. -enum WebPImageHint { - WEBP_HINT_DEFAULT = 0, // default preset. - WEBP_HINT_PICTURE, // digital picture, like portrait, inner shot - WEBP_HINT_PHOTO, // outdoor photograph, with natural lighting - WEBP_HINT_GRAPH, // Discrete tone image (graph, map-tile etc). - WEBP_HINT_LAST -}; - -// Compression parameters. -struct WebPConfig { - int lossless; // Lossless encoding (0=lossy(default), 1=lossless). - float quality; // between 0 (smallest file) and 100 (biggest) - int method; // quality/speed trade-off (0=fast, 6=slower-better) - - WebPImageHint image_hint; // Hint for image type (lossless only for now). - - // Parameters related to lossy compression only: - int target_size; // if non-zero, set the desired target size in bytes. - // Takes precedence over the 'compression' parameter. - float target_PSNR; // if non-zero, specifies the minimal distortion to - // try to achieve. Takes precedence over target_size. - int segments; // maximum number of segments to use, in [1..4] - int sns_strength; // Spatial Noise Shaping. 0=off, 100=maximum. - int filter_strength; // range: [0 = off .. 100 = strongest] - int filter_sharpness; // range: [0 = off .. 7 = least sharp] - int filter_type; // filtering type: 0 = simple, 1 = strong (only used - // if filter_strength > 0 or autofilter > 0) - int autofilter; // Auto adjust filter's strength [0 = off, 1 = on] - int alpha_compression; // Algorithm for encoding the alpha plane (0 = none, - // 1 = compressed with WebP lossless). Default is 1. - int alpha_filtering; // Predictive filtering method for alpha plane. - // 0: none, 1: fast, 2: best. Default if 1. - int alpha_quality; // Between 0 (smallest size) and 100 (lossless). - // Default is 100. - int pass; // number of entropy-analysis passes (in [1..10]). - - int show_compressed; // if true, export the compressed picture back. - // In-loop filtering is not applied. - int preprocessing; // preprocessing filter (0=none, 1=segment-smooth) - int partitions; // log2(number of token partitions) in [0..3]. Default - // is set to 0 for easier progressive decoding. - int partition_limit; // quality degradation allowed to fit the 512k limit - // on prediction modes coding (0: no degradation, - // 100: maximum possible degradation). - int emulate_jpeg_size; // If true, compression parameters will be remapped - // to better match the expected output size from - // JPEG compression. Generally, the output size will - // be similar but the degradation will be lower. - int thread_level; // If non-zero, try and use multi-threaded encoding. - int low_memory; // If set, reduce memory usage (but increase CPU use). - - uint32_t pad[5]; // padding for later use -}; - -// Enumerate some predefined settings for WebPConfig, depending on the type -// of source picture. These presets are used when calling WebPConfigPreset(). -enum WebPPreset { - WEBP_PRESET_DEFAULT = 0, // default preset. - WEBP_PRESET_PICTURE, // digital picture, like portrait, inner shot - WEBP_PRESET_PHOTO, // outdoor photograph, with natural lighting - WEBP_PRESET_DRAWING, // hand or line drawing, with high-contrast details - WEBP_PRESET_ICON, // small-sized colorful images - WEBP_PRESET_TEXT // text-like -}; - -// Internal, version-checked, entry point -WEBP_EXTERN(int) WebPConfigInitInternal(WebPConfig*, WebPPreset, float, int); - -// Should always be called, to initialize a fresh WebPConfig structure before -// modification. Returns false in case of version mismatch. WebPConfigInit() -// must have succeeded before using the 'config' object. -// Note that the default values are lossless=0 and quality=75. -static WEBP_INLINE int WebPConfigInit(WebPConfig* config) { - return WebPConfigInitInternal(config, WEBP_PRESET_DEFAULT, 75.f, - WEBP_ENCODER_ABI_VERSION); -} - -// This function will initialize the configuration according to a predefined -// set of parameters (referred to by 'preset') and a given quality factor. -// This function can be called as a replacement to WebPConfigInit(). Will -// return false in case of error. -static WEBP_INLINE int WebPConfigPreset(WebPConfig* config, - WebPPreset preset, float quality) { - return WebPConfigInitInternal(config, preset, quality, - WEBP_ENCODER_ABI_VERSION); -} - -// Returns true if 'config' is non-NULL and all configuration parameters are -// within their valid ranges. -WEBP_EXTERN(int) WebPValidateConfig(const WebPConfig* config); - -//------------------------------------------------------------------------------ -// Input / Output -// Structure for storing auxiliary statistics (mostly for lossy encoding). - -struct WebPAuxStats { - int coded_size; // final size - - float PSNR[5]; // peak-signal-to-noise ratio for Y/U/V/All/Alpha - int block_count[3]; // number of intra4/intra16/skipped macroblocks - int header_bytes[2]; // approximate number of bytes spent for header - // and mode-partition #0 - int residual_bytes[3][4]; // approximate number of bytes spent for - // DC/AC/uv coefficients for each (0..3) segments. - int segment_size[4]; // number of macroblocks in each segments - int segment_quant[4]; // quantizer values for each segments - int segment_level[4]; // filtering strength for each segments [0..63] - - int alpha_data_size; // size of the transparency data - int layer_data_size; // size of the enhancement layer data - - // lossless encoder statistics - uint32_t lossless_features; // bit0:predictor bit1:cross-color transform - // bit2:subtract-green bit3:color indexing - int histogram_bits; // number of precision bits of histogram - int transform_bits; // precision bits for transform - int cache_bits; // number of bits for color cache lookup - int palette_size; // number of color in palette, if used - int lossless_size; // final lossless size - - uint32_t pad[4]; // padding for later use -}; - -// Signature for output function. Should return true if writing was successful. -// data/data_size is the segment of data to write, and 'picture' is for -// reference (and so one can make use of picture->custom_ptr). -typedef int (*WebPWriterFunction)(const uint8_t* data, size_t data_size, - const WebPPicture* picture); - -// WebPMemoryWrite: a special WebPWriterFunction that writes to memory using -// the following WebPMemoryWriter object (to be set as a custom_ptr). -struct WebPMemoryWriter { - uint8_t* mem; // final buffer (of size 'max_size', larger than 'size'). - size_t size; // final size - size_t max_size; // total capacity - uint32_t pad[1]; // padding for later use -}; - -// The following must be called first before any use. -WEBP_EXTERN(void) WebPMemoryWriterInit(WebPMemoryWriter* writer); - -// The custom writer to be used with WebPMemoryWriter as custom_ptr. Upon -// completion, writer.mem and writer.size will hold the coded data. -// writer.mem must be freed using the call 'free(writer.mem)'. -WEBP_EXTERN(int) WebPMemoryWrite(const uint8_t* data, size_t data_size, - const WebPPicture* picture); - -// Progress hook, called from time to time to report progress. It can return -// false to request an abort of the encoding process, or true otherwise if -// everything is OK. -typedef int (*WebPProgressHook)(int percent, const WebPPicture* picture); - -// Color spaces. -enum WebPEncCSP { - // chroma sampling - WEBP_YUV420 = 0, // 4:2:0 - WEBP_YUV422 = 1, // 4:2:2 - WEBP_YUV444 = 2, // 4:4:4 - WEBP_YUV400 = 3, // grayscale - WEBP_CSP_UV_MASK = 3, // bit-mask to get the UV sampling factors - // alpha channel variants - WEBP_YUV420A = 4, - WEBP_YUV422A = 5, - WEBP_YUV444A = 6, - WEBP_YUV400A = 7, // grayscale + alpha - WEBP_CSP_ALPHA_BIT = 4 // bit that is set if alpha is present -}; - -// Encoding error conditions. -enum WebPEncodingError { - VP8_ENC_OK = 0, - VP8_ENC_ERROR_OUT_OF_MEMORY, // memory error allocating objects - VP8_ENC_ERROR_BITSTREAM_OUT_OF_MEMORY, // memory error while flushing bits - VP8_ENC_ERROR_NULL_PARAMETER, // a pointer parameter is NULL - VP8_ENC_ERROR_INVALID_CONFIGURATION, // configuration is invalid - VP8_ENC_ERROR_BAD_DIMENSION, // picture has invalid width/height - VP8_ENC_ERROR_PARTITION0_OVERFLOW, // partition is bigger than 512k - VP8_ENC_ERROR_PARTITION_OVERFLOW, // partition is bigger than 16M - VP8_ENC_ERROR_BAD_WRITE, // error while flushing bytes - VP8_ENC_ERROR_FILE_TOO_BIG, // file is bigger than 4G - VP8_ENC_ERROR_USER_ABORT, // abort request by user - VP8_ENC_ERROR_LAST // list terminator. always last. -}; - -// maximum width/height allowed (inclusive), in pixels -#define WEBP_MAX_DIMENSION 16383 - -// Main exchange structure (input samples, output bytes, statistics) -struct WebPPicture { - // INPUT - ////////////// - // Main flag for encoder selecting between ARGB or YUV input. - // It is recommended to use ARGB input (*argb, argb_stride) for lossless - // compression, and YUV input (*y, *u, *v, etc.) for lossy compression - // since these are the respective native colorspace for these formats. - int use_argb; - - // YUV input (mostly used for input to lossy compression) - WebPEncCSP colorspace; // colorspace: should be YUV420 for now (=Y'CbCr). - int width, height; // dimensions (less or equal to WEBP_MAX_DIMENSION) - uint8_t *y, *u, *v; // pointers to luma/chroma planes. - int y_stride, uv_stride; // luma/chroma strides. - uint8_t* a; // pointer to the alpha plane - int a_stride; // stride of the alpha plane - uint32_t pad1[2]; // padding for later use - - // ARGB input (mostly used for input to lossless compression) - uint32_t* argb; // Pointer to argb (32 bit) plane. - int argb_stride; // This is stride in pixels units, not bytes. - uint32_t pad2[3]; // padding for later use - - // OUTPUT - /////////////// - // Byte-emission hook, to store compressed bytes as they are ready. - WebPWriterFunction writer; // can be NULL - void* custom_ptr; // can be used by the writer. - - // map for extra information (only for lossy compression mode) - int extra_info_type; // 1: intra type, 2: segment, 3: quant - // 4: intra-16 prediction mode, - // 5: chroma prediction mode, - // 6: bit cost, 7: distortion - uint8_t* extra_info; // if not NULL, points to an array of size - // ((width + 15) / 16) * ((height + 15) / 16) that - // will be filled with a macroblock map, depending - // on extra_info_type. - - // STATS AND REPORTS - /////////////////////////// - // Pointer to side statistics (updated only if not NULL) - WebPAuxStats* stats; - - // Error code for the latest error encountered during encoding - WebPEncodingError error_code; - - // If not NULL, report progress during encoding. - WebPProgressHook progress_hook; - - void* user_data; // this field is free to be set to any value and - // used during callbacks (like progress-report e.g.). - - uint32_t pad3[3]; // padding for later use - - // Unused for now: original samples (for non-YUV420 modes) - uint8_t *u0, *v0; - int uv0_stride; - - uint32_t pad4[7]; // padding for later use - - // PRIVATE FIELDS - //////////////////// - void* memory_; // row chunk of memory for yuva planes - void* memory_argb_; // and for argb too. - void* pad5[2]; // padding for later use -}; - -// Internal, version-checked, entry point -WEBP_EXTERN(int) WebPPictureInitInternal(WebPPicture*, int); - -// Should always be called, to initialize the structure. Returns false in case -// of version mismatch. WebPPictureInit() must have succeeded before using the -// 'picture' object. -// Note that, by default, use_argb is false and colorspace is WEBP_YUV420. -static WEBP_INLINE int WebPPictureInit(WebPPicture* picture) { - return WebPPictureInitInternal(picture, WEBP_ENCODER_ABI_VERSION); -} - -//------------------------------------------------------------------------------ -// WebPPicture utils - -// Convenience allocation / deallocation based on picture->width/height: -// Allocate y/u/v buffers as per colorspace/width/height specification. -// Note! This function will free the previous buffer if needed. -// Returns false in case of memory error. -WEBP_EXTERN(int) WebPPictureAlloc(WebPPicture* picture); - -// Release the memory allocated by WebPPictureAlloc() or WebPPictureImport*(). -// Note that this function does _not_ free the memory used by the 'picture' -// object itself. -// Besides memory (which is reclaimed) all other fields of 'picture' are -// preserved. -WEBP_EXTERN(void) WebPPictureFree(WebPPicture* picture); - -// Copy the pixels of *src into *dst, using WebPPictureAlloc. Upon return, -// *dst will fully own the copied pixels (this is not a view). -// Returns false in case of memory allocation error. -WEBP_EXTERN(int) WebPPictureCopy(const WebPPicture* src, WebPPicture* dst); - -// Compute PSNR, SSIM or LSIM distortion metric between two pictures. -// Result is in dB, stores in result[] in the Y/U/V/Alpha/All order. -// Returns false in case of error (src and ref don't have same dimension, ...) -// Warning: this function is rather CPU-intensive. -WEBP_EXTERN(int) WebPPictureDistortion( - const WebPPicture* src, const WebPPicture* ref, - int metric_type, // 0 = PSNR, 1 = SSIM, 2 = LSIM - float result[5]); - -// self-crops a picture to the rectangle defined by top/left/width/height. -// Returns false in case of memory allocation error, or if the rectangle is -// outside of the source picture. -// The rectangle for the view is defined by the top-left corner pixel -// coordinates (left, top) as well as its width and height. This rectangle -// must be fully be comprised inside the 'src' source picture. If the source -// picture uses the YUV420 colorspace, the top and left coordinates will be -// snapped to even values. -WEBP_EXTERN(int) WebPPictureCrop(WebPPicture* picture, - int left, int top, int width, int height); - -// Extracts a view from 'src' picture into 'dst'. The rectangle for the view -// is defined by the top-left corner pixel coordinates (left, top) as well -// as its width and height. This rectangle must be fully be comprised inside -// the 'src' source picture. If the source picture uses the YUV420 colorspace, -// the top and left coordinates will be snapped to even values. -// Picture 'src' must out-live 'dst' picture. Self-extraction of view is allowed -// ('src' equal to 'dst') as a mean of fast-cropping (but note that doing so, -// the original dimension will be lost). -// Returns false in case of memory allocation error or invalid parameters. -WEBP_EXTERN(int) WebPPictureView(const WebPPicture* src, - int left, int top, int width, int height, - WebPPicture* dst); - -// Returns true if the 'picture' is actually a view and therefore does -// not own the memory for pixels. -WEBP_EXTERN(int) WebPPictureIsView(const WebPPicture* picture); - -// Rescale a picture to new dimension width x height. -// Now gamma correction is applied. -// Returns false in case of error (invalid parameter or insufficient memory). -WEBP_EXTERN(int) WebPPictureRescale(WebPPicture* pic, int width, int height); - -// Colorspace conversion function to import RGB samples. -// Previous buffer will be free'd, if any. -// *rgb buffer should have a size of at least height * rgb_stride. -// Returns false in case of memory error. -WEBP_EXTERN(int) WebPPictureImportRGB( - WebPPicture* picture, const uint8_t* rgb, int rgb_stride); -// Same, but for RGBA buffer. -WEBP_EXTERN(int) WebPPictureImportRGBA( - WebPPicture* picture, const uint8_t* rgba, int rgba_stride); -// Same, but for RGBA buffer. Imports the RGB direct from the 32-bit format -// input buffer ignoring the alpha channel. Avoids needing to copy the data -// to a temporary 24-bit RGB buffer to import the RGB only. -WEBP_EXTERN(int) WebPPictureImportRGBX( - WebPPicture* picture, const uint8_t* rgbx, int rgbx_stride); - -// Variants of the above, but taking BGR(A|X) input. -WEBP_EXTERN(int) WebPPictureImportBGR( - WebPPicture* picture, const uint8_t* bgr, int bgr_stride); -WEBP_EXTERN(int) WebPPictureImportBGRA( - WebPPicture* picture, const uint8_t* bgra, int bgra_stride); -WEBP_EXTERN(int) WebPPictureImportBGRX( - WebPPicture* picture, const uint8_t* bgrx, int bgrx_stride); - -// Converts picture->argb data to the YUVA format specified by 'colorspace'. -// Upon return, picture->use_argb is set to false. The presence of real -// non-opaque transparent values is detected, and 'colorspace' will be -// adjusted accordingly. Note that this method is lossy. -// Returns false in case of error. -WEBP_EXTERN(int) WebPPictureARGBToYUVA(WebPPicture* picture, - WebPEncCSP colorspace); - -// Converts picture->yuv to picture->argb and sets picture->use_argb to true. -// The input format must be YUV_420 or YUV_420A. -// Note that the use of this method is discouraged if one has access to the -// raw ARGB samples, since using YUV420 is comparatively lossy. Also, the -// conversion from YUV420 to ARGB incurs a small loss too. -// Returns false in case of error. -WEBP_EXTERN(int) WebPPictureYUVAToARGB(WebPPicture* picture); - -// Helper function: given a width x height plane of YUV(A) samples -// (with stride 'stride'), clean-up the YUV samples under fully transparent -// area, to help compressibility (no guarantee, though). -WEBP_EXTERN(void) WebPCleanupTransparentArea(WebPPicture* picture); - -// Scan the picture 'picture' for the presence of non fully opaque alpha values. -// Returns true in such case. Otherwise returns false (indicating that the -// alpha plane can be ignored altogether e.g.). -WEBP_EXTERN(int) WebPPictureHasTransparency(const WebPPicture* picture); - -//------------------------------------------------------------------------------ -// Main call - -// Main encoding call, after config and picture have been initialized. -// 'picture' must be less than 16384x16384 in dimension (cf WEBP_MAX_DIMENSION), -// and the 'config' object must be a valid one. -// Returns false in case of error, true otherwise. -// In case of error, picture->error_code is updated accordingly. -// 'picture' can hold the source samples in both YUV(A) or ARGB input, depending -// on the value of 'picture->use_argb'. It is highly recommended to use -// the former for lossy encoding, and the latter for lossless encoding -// (when config.lossless is true). Automatic conversion from one format to -// another is provided but they both incur some loss. -WEBP_EXTERN(int) WebPEncode(const WebPConfig* config, WebPPicture* picture); - -//------------------------------------------------------------------------------ - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif - -#endif /* WEBP_WEBP_ENCODE_H_ */ diff --git a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/DOCBparser.h b/cocos2dx/platform/third_party/emscripten/libxml2/libxml/DOCBparser.h deleted file mode 100644 index 9394fa71bd..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/DOCBparser.h +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Summary: old DocBook SGML parser - * Description: interface for a DocBook SGML non-verifying parser - * This code is DEPRECATED, and should not be used anymore. - * - * Copy: See Copyright for the status of this software. - * - * Author: Daniel Veillard - */ - -#ifndef __DOCB_PARSER_H__ -#define __DOCB_PARSER_H__ -#include - -#ifdef LIBXML_DOCB_ENABLED - -#include -#include - -#ifndef IN_LIBXML -#ifdef __GNUC__ -#warning "The DOCBparser module has been deprecated in libxml2-2.6.0" -#endif -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Most of the back-end structures from XML and SGML are shared. - */ -typedef xmlParserCtxt docbParserCtxt; -typedef xmlParserCtxtPtr docbParserCtxtPtr; -typedef xmlSAXHandler docbSAXHandler; -typedef xmlSAXHandlerPtr docbSAXHandlerPtr; -typedef xmlParserInput docbParserInput; -typedef xmlParserInputPtr docbParserInputPtr; -typedef xmlDocPtr docbDocPtr; - -/* - * There is only few public functions. - */ -XMLPUBFUN int XMLCALL - docbEncodeEntities(unsigned char *out, - int *outlen, - const unsigned char *in, - int *inlen, int quoteChar); - -XMLPUBFUN docbDocPtr XMLCALL - docbSAXParseDoc (xmlChar *cur, - const char *encoding, - docbSAXHandlerPtr sax, - void *userData); -XMLPUBFUN docbDocPtr XMLCALL - docbParseDoc (xmlChar *cur, - const char *encoding); -XMLPUBFUN docbDocPtr XMLCALL - docbSAXParseFile (const char *filename, - const char *encoding, - docbSAXHandlerPtr sax, - void *userData); -XMLPUBFUN docbDocPtr XMLCALL - docbParseFile (const char *filename, - const char *encoding); - -/** - * Interfaces for the Push mode. - */ -XMLPUBFUN void XMLCALL - docbFreeParserCtxt (docbParserCtxtPtr ctxt); -XMLPUBFUN docbParserCtxtPtr XMLCALL - docbCreatePushParserCtxt(docbSAXHandlerPtr sax, - void *user_data, - const char *chunk, - int size, - const char *filename, - xmlCharEncoding enc); -XMLPUBFUN int XMLCALL - docbParseChunk (docbParserCtxtPtr ctxt, - const char *chunk, - int size, - int terminate); -XMLPUBFUN docbParserCtxtPtr XMLCALL - docbCreateFileParserCtxt(const char *filename, - const char *encoding); -XMLPUBFUN int XMLCALL - docbParseDocument (docbParserCtxtPtr ctxt); - -#ifdef __cplusplus -} -#endif - -#endif /* LIBXML_DOCB_ENABLED */ - -#endif /* __DOCB_PARSER_H__ */ diff --git a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/HTMLparser.h b/cocos2dx/platform/third_party/emscripten/libxml2/libxml/HTMLparser.h deleted file mode 100644 index 551186cb0c..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/HTMLparser.h +++ /dev/null @@ -1,306 +0,0 @@ -/* - * Summary: interface for an HTML 4.0 non-verifying parser - * Description: this module implements an HTML 4.0 non-verifying parser - * with API compatible with the XML parser ones. It should - * be able to parse "real world" HTML, even if severely - * broken from a specification point of view. - * - * Copy: See Copyright for the status of this software. - * - * Author: Daniel Veillard - */ - -#ifndef __HTML_PARSER_H__ -#define __HTML_PARSER_H__ -#include -#include - -#ifdef LIBXML_HTML_ENABLED - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Most of the back-end structures from XML and HTML are shared. - */ -typedef xmlParserCtxt htmlParserCtxt; -typedef xmlParserCtxtPtr htmlParserCtxtPtr; -typedef xmlParserNodeInfo htmlParserNodeInfo; -typedef xmlSAXHandler htmlSAXHandler; -typedef xmlSAXHandlerPtr htmlSAXHandlerPtr; -typedef xmlParserInput htmlParserInput; -typedef xmlParserInputPtr htmlParserInputPtr; -typedef xmlDocPtr htmlDocPtr; -typedef xmlNodePtr htmlNodePtr; - -/* - * Internal description of an HTML element, representing HTML 4.01 - * and XHTML 1.0 (which share the same structure). - */ -typedef struct _htmlElemDesc htmlElemDesc; -typedef htmlElemDesc *htmlElemDescPtr; -struct _htmlElemDesc { - const char *name; /* The tag name */ - char startTag; /* Whether the start tag can be implied */ - char endTag; /* Whether the end tag can be implied */ - char saveEndTag; /* Whether the end tag should be saved */ - char empty; /* Is this an empty element ? */ - char depr; /* Is this a deprecated element ? */ - char dtd; /* 1: only in Loose DTD, 2: only Frameset one */ - char isinline; /* is this a block 0 or inline 1 element */ - const char *desc; /* the description */ - -/* NRK Jan.2003 - * New fields encapsulating HTML structure - * - * Bugs: - * This is a very limited representation. It fails to tell us when - * an element *requires* subelements (we only have whether they're - * allowed or not), and it doesn't tell us where CDATA and PCDATA - * are allowed. Some element relationships are not fully represented: - * these are flagged with the word MODIFIER - */ - const char** subelts; /* allowed sub-elements of this element */ - const char* defaultsubelt; /* subelement for suggested auto-repair - if necessary or NULL */ - const char** attrs_opt; /* Optional Attributes */ - const char** attrs_depr; /* Additional deprecated attributes */ - const char** attrs_req; /* Required attributes */ -}; - -/* - * Internal description of an HTML entity. - */ -typedef struct _htmlEntityDesc htmlEntityDesc; -typedef htmlEntityDesc *htmlEntityDescPtr; -struct _htmlEntityDesc { - unsigned int value; /* the UNICODE value for the character */ - const char *name; /* The entity name */ - const char *desc; /* the description */ -}; - -/* - * There is only few public functions. - */ -XMLPUBFUN const htmlElemDesc * XMLCALL - htmlTagLookup (const xmlChar *tag); -XMLPUBFUN const htmlEntityDesc * XMLCALL - htmlEntityLookup(const xmlChar *name); -XMLPUBFUN const htmlEntityDesc * XMLCALL - htmlEntityValueLookup(unsigned int value); - -XMLPUBFUN int XMLCALL - htmlIsAutoClosed(htmlDocPtr doc, - htmlNodePtr elem); -XMLPUBFUN int XMLCALL - htmlAutoCloseTag(htmlDocPtr doc, - const xmlChar *name, - htmlNodePtr elem); -XMLPUBFUN const htmlEntityDesc * XMLCALL - htmlParseEntityRef(htmlParserCtxtPtr ctxt, - const xmlChar **str); -XMLPUBFUN int XMLCALL - htmlParseCharRef(htmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL - htmlParseElement(htmlParserCtxtPtr ctxt); - -XMLPUBFUN htmlParserCtxtPtr XMLCALL - htmlNewParserCtxt(void); - -XMLPUBFUN htmlParserCtxtPtr XMLCALL - htmlCreateMemoryParserCtxt(const char *buffer, - int size); - -XMLPUBFUN int XMLCALL - htmlParseDocument(htmlParserCtxtPtr ctxt); -XMLPUBFUN htmlDocPtr XMLCALL - htmlSAXParseDoc (xmlChar *cur, - const char *encoding, - htmlSAXHandlerPtr sax, - void *userData); -XMLPUBFUN htmlDocPtr XMLCALL - htmlParseDoc (xmlChar *cur, - const char *encoding); -XMLPUBFUN htmlDocPtr XMLCALL - htmlSAXParseFile(const char *filename, - const char *encoding, - htmlSAXHandlerPtr sax, - void *userData); -XMLPUBFUN htmlDocPtr XMLCALL - htmlParseFile (const char *filename, - const char *encoding); -XMLPUBFUN int XMLCALL - UTF8ToHtml (unsigned char *out, - int *outlen, - const unsigned char *in, - int *inlen); -XMLPUBFUN int XMLCALL - htmlEncodeEntities(unsigned char *out, - int *outlen, - const unsigned char *in, - int *inlen, int quoteChar); -XMLPUBFUN int XMLCALL - htmlIsScriptAttribute(const xmlChar *name); -XMLPUBFUN int XMLCALL - htmlHandleOmittedElem(int val); - -#ifdef LIBXML_PUSH_ENABLED -/** - * Interfaces for the Push mode. - */ -XMLPUBFUN htmlParserCtxtPtr XMLCALL - htmlCreatePushParserCtxt(htmlSAXHandlerPtr sax, - void *user_data, - const char *chunk, - int size, - const char *filename, - xmlCharEncoding enc); -XMLPUBFUN int XMLCALL - htmlParseChunk (htmlParserCtxtPtr ctxt, - const char *chunk, - int size, - int terminate); -#endif /* LIBXML_PUSH_ENABLED */ - -XMLPUBFUN void XMLCALL - htmlFreeParserCtxt (htmlParserCtxtPtr ctxt); - -/* - * New set of simpler/more flexible APIs - */ -/** - * xmlParserOption: - * - * This is the set of XML parser options that can be passed down - * to the xmlReadDoc() and similar calls. - */ -typedef enum { - HTML_PARSE_RECOVER = 1<<0, /* Relaxed parsing */ - HTML_PARSE_NODEFDTD = 1<<2, /* do not default a doctype if not found */ - HTML_PARSE_NOERROR = 1<<5, /* suppress error reports */ - HTML_PARSE_NOWARNING= 1<<6, /* suppress warning reports */ - HTML_PARSE_PEDANTIC = 1<<7, /* pedantic error reporting */ - HTML_PARSE_NOBLANKS = 1<<8, /* remove blank nodes */ - HTML_PARSE_NONET = 1<<11,/* Forbid network access */ - HTML_PARSE_NOIMPLIED= 1<<13,/* Do not add implied html/body... elements */ - HTML_PARSE_COMPACT = 1<<16,/* compact small text nodes */ - HTML_PARSE_IGNORE_ENC=1<<21 /* ignore internal document encoding hint */ -} htmlParserOption; - -XMLPUBFUN void XMLCALL - htmlCtxtReset (htmlParserCtxtPtr ctxt); -XMLPUBFUN int XMLCALL - htmlCtxtUseOptions (htmlParserCtxtPtr ctxt, - int options); -XMLPUBFUN htmlDocPtr XMLCALL - htmlReadDoc (const xmlChar *cur, - const char *URL, - const char *encoding, - int options); -XMLPUBFUN htmlDocPtr XMLCALL - htmlReadFile (const char *URL, - const char *encoding, - int options); -XMLPUBFUN htmlDocPtr XMLCALL - htmlReadMemory (const char *buffer, - int size, - const char *URL, - const char *encoding, - int options); -XMLPUBFUN htmlDocPtr XMLCALL - htmlReadFd (int fd, - const char *URL, - const char *encoding, - int options); -XMLPUBFUN htmlDocPtr XMLCALL - htmlReadIO (xmlInputReadCallback ioread, - xmlInputCloseCallback ioclose, - void *ioctx, - const char *URL, - const char *encoding, - int options); -XMLPUBFUN htmlDocPtr XMLCALL - htmlCtxtReadDoc (xmlParserCtxtPtr ctxt, - const xmlChar *cur, - const char *URL, - const char *encoding, - int options); -XMLPUBFUN htmlDocPtr XMLCALL - htmlCtxtReadFile (xmlParserCtxtPtr ctxt, - const char *filename, - const char *encoding, - int options); -XMLPUBFUN htmlDocPtr XMLCALL - htmlCtxtReadMemory (xmlParserCtxtPtr ctxt, - const char *buffer, - int size, - const char *URL, - const char *encoding, - int options); -XMLPUBFUN htmlDocPtr XMLCALL - htmlCtxtReadFd (xmlParserCtxtPtr ctxt, - int fd, - const char *URL, - const char *encoding, - int options); -XMLPUBFUN htmlDocPtr XMLCALL - htmlCtxtReadIO (xmlParserCtxtPtr ctxt, - xmlInputReadCallback ioread, - xmlInputCloseCallback ioclose, - void *ioctx, - const char *URL, - const char *encoding, - int options); - -/* NRK/Jan2003: further knowledge of HTML structure - */ -typedef enum { - HTML_NA = 0 , /* something we don't check at all */ - HTML_INVALID = 0x1 , - HTML_DEPRECATED = 0x2 , - HTML_VALID = 0x4 , - HTML_REQUIRED = 0xc /* VALID bit set so ( & HTML_VALID ) is TRUE */ -} htmlStatus ; - -/* Using htmlElemDesc rather than name here, to emphasise the fact - that otherwise there's a lookup overhead -*/ -XMLPUBFUN htmlStatus XMLCALL htmlAttrAllowed(const htmlElemDesc*, const xmlChar*, int) ; -XMLPUBFUN int XMLCALL htmlElementAllowedHere(const htmlElemDesc*, const xmlChar*) ; -XMLPUBFUN htmlStatus XMLCALL htmlElementStatusHere(const htmlElemDesc*, const htmlElemDesc*) ; -XMLPUBFUN htmlStatus XMLCALL htmlNodeStatus(const htmlNodePtr, int) ; -/** - * htmlDefaultSubelement: - * @elt: HTML element - * - * Returns the default subelement for this element - */ -#define htmlDefaultSubelement(elt) elt->defaultsubelt -/** - * htmlElementAllowedHereDesc: - * @parent: HTML parent element - * @elt: HTML element - * - * Checks whether an HTML element description may be a - * direct child of the specified element. - * - * Returns 1 if allowed; 0 otherwise. - */ -#define htmlElementAllowedHereDesc(parent,elt) \ - htmlElementAllowedHere((parent), (elt)->name) -/** - * htmlRequiredAttrs: - * @elt: HTML element - * - * Returns the attributes required for the specified element. - */ -#define htmlRequiredAttrs(elt) (elt)->attrs_req - - -#ifdef __cplusplus -} -#endif - -#endif /* LIBXML_HTML_ENABLED */ -#endif /* __HTML_PARSER_H__ */ diff --git a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/HTMLtree.h b/cocos2dx/platform/third_party/emscripten/libxml2/libxml/HTMLtree.h deleted file mode 100644 index c0e110330c..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/HTMLtree.h +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Summary: specific APIs to process HTML tree, especially serialization - * Description: this module implements a few function needed to process - * tree in an HTML specific way. - * - * Copy: See Copyright for the status of this software. - * - * Author: Daniel Veillard - */ - -#ifndef __HTML_TREE_H__ -#define __HTML_TREE_H__ - -#include -#include -#include -#include - -#ifdef LIBXML_HTML_ENABLED - -#ifdef __cplusplus -extern "C" { -#endif - - -/** - * HTML_TEXT_NODE: - * - * Macro. A text node in a HTML document is really implemented - * the same way as a text node in an XML document. - */ -#define HTML_TEXT_NODE XML_TEXT_NODE -/** - * HTML_ENTITY_REF_NODE: - * - * Macro. An entity reference in a HTML document is really implemented - * the same way as an entity reference in an XML document. - */ -#define HTML_ENTITY_REF_NODE XML_ENTITY_REF_NODE -/** - * HTML_COMMENT_NODE: - * - * Macro. A comment in a HTML document is really implemented - * the same way as a comment in an XML document. - */ -#define HTML_COMMENT_NODE XML_COMMENT_NODE -/** - * HTML_PRESERVE_NODE: - * - * Macro. A preserved node in a HTML document is really implemented - * the same way as a CDATA section in an XML document. - */ -#define HTML_PRESERVE_NODE XML_CDATA_SECTION_NODE -/** - * HTML_PI_NODE: - * - * Macro. A processing instruction in a HTML document is really implemented - * the same way as a processing instruction in an XML document. - */ -#define HTML_PI_NODE XML_PI_NODE - -XMLPUBFUN htmlDocPtr XMLCALL - htmlNewDoc (const xmlChar *URI, - const xmlChar *ExternalID); -XMLPUBFUN htmlDocPtr XMLCALL - htmlNewDocNoDtD (const xmlChar *URI, - const xmlChar *ExternalID); -XMLPUBFUN const xmlChar * XMLCALL - htmlGetMetaEncoding (htmlDocPtr doc); -XMLPUBFUN int XMLCALL - htmlSetMetaEncoding (htmlDocPtr doc, - const xmlChar *encoding); -#ifdef LIBXML_OUTPUT_ENABLED -XMLPUBFUN void XMLCALL - htmlDocDumpMemory (xmlDocPtr cur, - xmlChar **mem, - int *size); -XMLPUBFUN void XMLCALL - htmlDocDumpMemoryFormat (xmlDocPtr cur, - xmlChar **mem, - int *size, - int format); -XMLPUBFUN int XMLCALL - htmlDocDump (FILE *f, - xmlDocPtr cur); -XMLPUBFUN int XMLCALL - htmlSaveFile (const char *filename, - xmlDocPtr cur); -XMLPUBFUN int XMLCALL - htmlNodeDump (xmlBufferPtr buf, - xmlDocPtr doc, - xmlNodePtr cur); -XMLPUBFUN void XMLCALL - htmlNodeDumpFile (FILE *out, - xmlDocPtr doc, - xmlNodePtr cur); -XMLPUBFUN int XMLCALL - htmlNodeDumpFileFormat (FILE *out, - xmlDocPtr doc, - xmlNodePtr cur, - const char *encoding, - int format); -XMLPUBFUN int XMLCALL - htmlSaveFileEnc (const char *filename, - xmlDocPtr cur, - const char *encoding); -XMLPUBFUN int XMLCALL - htmlSaveFileFormat (const char *filename, - xmlDocPtr cur, - const char *encoding, - int format); - -XMLPUBFUN void XMLCALL - htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, - xmlDocPtr doc, - xmlNodePtr cur, - const char *encoding, - int format); -XMLPUBFUN void XMLCALL - htmlDocContentDumpOutput(xmlOutputBufferPtr buf, - xmlDocPtr cur, - const char *encoding); -XMLPUBFUN void XMLCALL - htmlDocContentDumpFormatOutput(xmlOutputBufferPtr buf, - xmlDocPtr cur, - const char *encoding, - int format); -XMLPUBFUN void XMLCALL - htmlNodeDumpOutput (xmlOutputBufferPtr buf, - xmlDocPtr doc, - xmlNodePtr cur, - const char *encoding); - -#endif /* LIBXML_OUTPUT_ENABLED */ - -XMLPUBFUN int XMLCALL - htmlIsBooleanAttr (const xmlChar *name); - - -#ifdef __cplusplus -} -#endif - -#endif /* LIBXML_HTML_ENABLED */ - -#endif /* __HTML_TREE_H__ */ - diff --git a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/SAX.h b/cocos2dx/platform/third_party/emscripten/libxml2/libxml/SAX.h deleted file mode 100644 index 20093ceb68..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/SAX.h +++ /dev/null @@ -1,173 +0,0 @@ -/* - * Summary: Old SAX version 1 handler, deprecated - * Description: DEPRECATED set of SAX version 1 interfaces used to - * build the DOM tree. - * - * Copy: See Copyright for the status of this software. - * - * Author: Daniel Veillard - */ - - -#ifndef __XML_SAX_H__ -#define __XML_SAX_H__ - -#include -#include -#include -#include -#include - -#ifdef LIBXML_LEGACY_ENABLED - -#ifdef __cplusplus -extern "C" { -#endif -XMLPUBFUN const xmlChar * XMLCALL - getPublicId (void *ctx); -XMLPUBFUN const xmlChar * XMLCALL - getSystemId (void *ctx); -XMLPUBFUN void XMLCALL - setDocumentLocator (void *ctx, - xmlSAXLocatorPtr loc); - -XMLPUBFUN int XMLCALL - getLineNumber (void *ctx); -XMLPUBFUN int XMLCALL - getColumnNumber (void *ctx); - -XMLPUBFUN int XMLCALL - isStandalone (void *ctx); -XMLPUBFUN int XMLCALL - hasInternalSubset (void *ctx); -XMLPUBFUN int XMLCALL - hasExternalSubset (void *ctx); - -XMLPUBFUN void XMLCALL - internalSubset (void *ctx, - const xmlChar *name, - const xmlChar *ExternalID, - const xmlChar *SystemID); -XMLPUBFUN void XMLCALL - externalSubset (void *ctx, - const xmlChar *name, - const xmlChar *ExternalID, - const xmlChar *SystemID); -XMLPUBFUN xmlEntityPtr XMLCALL - getEntity (void *ctx, - const xmlChar *name); -XMLPUBFUN xmlEntityPtr XMLCALL - getParameterEntity (void *ctx, - const xmlChar *name); -XMLPUBFUN xmlParserInputPtr XMLCALL - resolveEntity (void *ctx, - const xmlChar *publicId, - const xmlChar *systemId); - -XMLPUBFUN void XMLCALL - entityDecl (void *ctx, - const xmlChar *name, - int type, - const xmlChar *publicId, - const xmlChar *systemId, - xmlChar *content); -XMLPUBFUN void XMLCALL - attributeDecl (void *ctx, - const xmlChar *elem, - const xmlChar *fullname, - int type, - int def, - const xmlChar *defaultValue, - xmlEnumerationPtr tree); -XMLPUBFUN void XMLCALL - elementDecl (void *ctx, - const xmlChar *name, - int type, - xmlElementContentPtr content); -XMLPUBFUN void XMLCALL - notationDecl (void *ctx, - const xmlChar *name, - const xmlChar *publicId, - const xmlChar *systemId); -XMLPUBFUN void XMLCALL - unparsedEntityDecl (void *ctx, - const xmlChar *name, - const xmlChar *publicId, - const xmlChar *systemId, - const xmlChar *notationName); - -XMLPUBFUN void XMLCALL - startDocument (void *ctx); -XMLPUBFUN void XMLCALL - endDocument (void *ctx); -XMLPUBFUN void XMLCALL - attribute (void *ctx, - const xmlChar *fullname, - const xmlChar *value); -XMLPUBFUN void XMLCALL - startElement (void *ctx, - const xmlChar *fullname, - const xmlChar **atts); -XMLPUBFUN void XMLCALL - endElement (void *ctx, - const xmlChar *name); -XMLPUBFUN void XMLCALL - reference (void *ctx, - const xmlChar *name); -XMLPUBFUN void XMLCALL - characters (void *ctx, - const xmlChar *ch, - int len); -XMLPUBFUN void XMLCALL - ignorableWhitespace (void *ctx, - const xmlChar *ch, - int len); -XMLPUBFUN void XMLCALL - processingInstruction (void *ctx, - const xmlChar *target, - const xmlChar *data); -XMLPUBFUN void XMLCALL - globalNamespace (void *ctx, - const xmlChar *href, - const xmlChar *prefix); -XMLPUBFUN void XMLCALL - setNamespace (void *ctx, - const xmlChar *name); -XMLPUBFUN xmlNsPtr XMLCALL - getNamespace (void *ctx); -XMLPUBFUN int XMLCALL - checkNamespace (void *ctx, - xmlChar *nameSpace); -XMLPUBFUN void XMLCALL - namespaceDecl (void *ctx, - const xmlChar *href, - const xmlChar *prefix); -XMLPUBFUN void XMLCALL - comment (void *ctx, - const xmlChar *value); -XMLPUBFUN void XMLCALL - cdataBlock (void *ctx, - const xmlChar *value, - int len); - -#ifdef LIBXML_SAX1_ENABLED -XMLPUBFUN void XMLCALL - initxmlDefaultSAXHandler (xmlSAXHandlerV1 *hdlr, - int warning); -#ifdef LIBXML_HTML_ENABLED -XMLPUBFUN void XMLCALL - inithtmlDefaultSAXHandler (xmlSAXHandlerV1 *hdlr); -#endif -#ifdef LIBXML_DOCB_ENABLED -XMLPUBFUN void XMLCALL - initdocbDefaultSAXHandler (xmlSAXHandlerV1 *hdlr); -#endif -#endif /* LIBXML_SAX1_ENABLED */ - -#ifdef __cplusplus -} -#endif - -#endif /* LIBXML_LEGACY_ENABLED */ - -#endif /* __XML_SAX_H__ */ diff --git a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/SAX2.h b/cocos2dx/platform/third_party/emscripten/libxml2/libxml/SAX2.h deleted file mode 100644 index daafd17eff..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/SAX2.h +++ /dev/null @@ -1,176 +0,0 @@ -/* - * Summary: SAX2 parser interface used to build the DOM tree - * Description: those are the default SAX2 interfaces used by - * the library when building DOM tree. - * - * Copy: See Copyright for the status of this software. - * - * Author: Daniel Veillard - */ - - -#ifndef __XML_SAX2_H__ -#define __XML_SAX2_H__ - -#include -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif -XMLPUBFUN const xmlChar * XMLCALL - xmlSAX2GetPublicId (void *ctx); -XMLPUBFUN const xmlChar * XMLCALL - xmlSAX2GetSystemId (void *ctx); -XMLPUBFUN void XMLCALL - xmlSAX2SetDocumentLocator (void *ctx, - xmlSAXLocatorPtr loc); - -XMLPUBFUN int XMLCALL - xmlSAX2GetLineNumber (void *ctx); -XMLPUBFUN int XMLCALL - xmlSAX2GetColumnNumber (void *ctx); - -XMLPUBFUN int XMLCALL - xmlSAX2IsStandalone (void *ctx); -XMLPUBFUN int XMLCALL - xmlSAX2HasInternalSubset (void *ctx); -XMLPUBFUN int XMLCALL - xmlSAX2HasExternalSubset (void *ctx); - -XMLPUBFUN void XMLCALL - xmlSAX2InternalSubset (void *ctx, - const xmlChar *name, - const xmlChar *ExternalID, - const xmlChar *SystemID); -XMLPUBFUN void XMLCALL - xmlSAX2ExternalSubset (void *ctx, - const xmlChar *name, - const xmlChar *ExternalID, - const xmlChar *SystemID); -XMLPUBFUN xmlEntityPtr XMLCALL - xmlSAX2GetEntity (void *ctx, - const xmlChar *name); -XMLPUBFUN xmlEntityPtr XMLCALL - xmlSAX2GetParameterEntity (void *ctx, - const xmlChar *name); -XMLPUBFUN xmlParserInputPtr XMLCALL - xmlSAX2ResolveEntity (void *ctx, - const xmlChar *publicId, - const xmlChar *systemId); - -XMLPUBFUN void XMLCALL - xmlSAX2EntityDecl (void *ctx, - const xmlChar *name, - int type, - const xmlChar *publicId, - const xmlChar *systemId, - xmlChar *content); -XMLPUBFUN void XMLCALL - xmlSAX2AttributeDecl (void *ctx, - const xmlChar *elem, - const xmlChar *fullname, - int type, - int def, - const xmlChar *defaultValue, - xmlEnumerationPtr tree); -XMLPUBFUN void XMLCALL - xmlSAX2ElementDecl (void *ctx, - const xmlChar *name, - int type, - xmlElementContentPtr content); -XMLPUBFUN void XMLCALL - xmlSAX2NotationDecl (void *ctx, - const xmlChar *name, - const xmlChar *publicId, - const xmlChar *systemId); -XMLPUBFUN void XMLCALL - xmlSAX2UnparsedEntityDecl (void *ctx, - const xmlChar *name, - const xmlChar *publicId, - const xmlChar *systemId, - const xmlChar *notationName); - -XMLPUBFUN void XMLCALL - xmlSAX2StartDocument (void *ctx); -XMLPUBFUN void XMLCALL - xmlSAX2EndDocument (void *ctx); -#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) -XMLPUBFUN void XMLCALL - xmlSAX2StartElement (void *ctx, - const xmlChar *fullname, - const xmlChar **atts); -XMLPUBFUN void XMLCALL - xmlSAX2EndElement (void *ctx, - const xmlChar *name); -#endif /* LIBXML_SAX1_ENABLED or LIBXML_HTML_ENABLED */ -XMLPUBFUN void XMLCALL - xmlSAX2StartElementNs (void *ctx, - const xmlChar *localname, - const xmlChar *prefix, - const xmlChar *URI, - int nb_namespaces, - const xmlChar **namespaces, - int nb_attributes, - int nb_defaulted, - const xmlChar **attributes); -XMLPUBFUN void XMLCALL - xmlSAX2EndElementNs (void *ctx, - const xmlChar *localname, - const xmlChar *prefix, - const xmlChar *URI); -XMLPUBFUN void XMLCALL - xmlSAX2Reference (void *ctx, - const xmlChar *name); -XMLPUBFUN void XMLCALL - xmlSAX2Characters (void *ctx, - const xmlChar *ch, - int len); -XMLPUBFUN void XMLCALL - xmlSAX2IgnorableWhitespace (void *ctx, - const xmlChar *ch, - int len); -XMLPUBFUN void XMLCALL - xmlSAX2ProcessingInstruction (void *ctx, - const xmlChar *target, - const xmlChar *data); -XMLPUBFUN void XMLCALL - xmlSAX2Comment (void *ctx, - const xmlChar *value); -XMLPUBFUN void XMLCALL - xmlSAX2CDataBlock (void *ctx, - const xmlChar *value, - int len); - -#ifdef LIBXML_SAX1_ENABLED -XMLPUBFUN int XMLCALL - xmlSAXDefaultVersion (int version); -#endif /* LIBXML_SAX1_ENABLED */ - -XMLPUBFUN int XMLCALL - xmlSAXVersion (xmlSAXHandler *hdlr, - int version); -XMLPUBFUN void XMLCALL - xmlSAX2InitDefaultSAXHandler (xmlSAXHandler *hdlr, - int warning); -#ifdef LIBXML_HTML_ENABLED -XMLPUBFUN void XMLCALL - xmlSAX2InitHtmlDefaultSAXHandler(xmlSAXHandler *hdlr); -XMLPUBFUN void XMLCALL - htmlDefaultSAXHandlerInit (void); -#endif -#ifdef LIBXML_DOCB_ENABLED -XMLPUBFUN void XMLCALL - xmlSAX2InitDocbDefaultSAXHandler(xmlSAXHandler *hdlr); -XMLPUBFUN void XMLCALL - docbDefaultSAXHandlerInit (void); -#endif -XMLPUBFUN void XMLCALL - xmlDefaultSAXHandlerInit (void); -#ifdef __cplusplus -} -#endif -#endif /* __XML_SAX2_H__ */ diff --git a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/c14n.h b/cocos2dx/platform/third_party/emscripten/libxml2/libxml/c14n.h deleted file mode 100644 index b8971d9204..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/c14n.h +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Summary: Provide Canonical XML and Exclusive XML Canonicalization - * Description: the c14n modules provides a - * - * "Canonical XML" implementation - * http://www.w3.org/TR/xml-c14n - * - * and an - * - * "Exclusive XML Canonicalization" implementation - * http://www.w3.org/TR/xml-exc-c14n - - * Copy: See Copyright for the status of this software. - * - * Author: Aleksey Sanin - */ -#ifndef __XML_C14N_H__ -#define __XML_C14N_H__ -#ifdef LIBXML_C14N_ENABLED -#ifdef LIBXML_OUTPUT_ENABLED - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#include -#include -#include - -/* - * XML Canonicazation - * http://www.w3.org/TR/xml-c14n - * - * Exclusive XML Canonicazation - * http://www.w3.org/TR/xml-exc-c14n - * - * Canonical form of an XML document could be created if and only if - * a) default attributes (if any) are added to all nodes - * b) all character and parsed entity references are resolved - * In order to achive this in libxml2 the document MUST be loaded with - * following global setings: - * - * xmlLoadExtDtdDefaultValue = XML_DETECT_IDS | XML_COMPLETE_ATTRS; - * xmlSubstituteEntitiesDefault(1); - * - * or corresponding parser context setting: - * xmlParserCtxtPtr ctxt; - * - * ... - * ctxt->loadsubset = XML_DETECT_IDS | XML_COMPLETE_ATTRS; - * ctxt->replaceEntities = 1; - * ... - */ - -/* - * xmlC14NMode: - * - * Predefined values for C14N modes - * - */ -typedef enum { - XML_C14N_1_0 = 0, /* Origianal C14N 1.0 spec */ - XML_C14N_EXCLUSIVE_1_0 = 1, /* Exclusive C14N 1.0 spec */ - XML_C14N_1_1 = 2 /* C14N 1.1 spec */ -} xmlC14NMode; - -XMLPUBFUN int XMLCALL - xmlC14NDocSaveTo (xmlDocPtr doc, - xmlNodeSetPtr nodes, - int mode, /* a xmlC14NMode */ - xmlChar **inclusive_ns_prefixes, - int with_comments, - xmlOutputBufferPtr buf); - -XMLPUBFUN int XMLCALL - xmlC14NDocDumpMemory (xmlDocPtr doc, - xmlNodeSetPtr nodes, - int mode, /* a xmlC14NMode */ - xmlChar **inclusive_ns_prefixes, - int with_comments, - xmlChar **doc_txt_ptr); - -XMLPUBFUN int XMLCALL - xmlC14NDocSave (xmlDocPtr doc, - xmlNodeSetPtr nodes, - int mode, /* a xmlC14NMode */ - xmlChar **inclusive_ns_prefixes, - int with_comments, - const char* filename, - int compression); - - -/** - * This is the core C14N function - */ -/** - * xmlC14NIsVisibleCallback: - * @user_data: user data - * @node: the curent node - * @parent: the parent node - * - * Signature for a C14N callback on visible nodes - * - * Returns 1 if the node should be included - */ -typedef int (*xmlC14NIsVisibleCallback) (void* user_data, - xmlNodePtr node, - xmlNodePtr parent); - -XMLPUBFUN int XMLCALL - xmlC14NExecute (xmlDocPtr doc, - xmlC14NIsVisibleCallback is_visible_callback, - void* user_data, - int mode, /* a xmlC14NMode */ - xmlChar **inclusive_ns_prefixes, - int with_comments, - xmlOutputBufferPtr buf); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* LIBXML_OUTPUT_ENABLED */ -#endif /* LIBXML_C14N_ENABLED */ -#endif /* __XML_C14N_H__ */ - diff --git a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/catalog.h b/cocos2dx/platform/third_party/emscripten/libxml2/libxml/catalog.h deleted file mode 100644 index 5a13f51b6c..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/catalog.h +++ /dev/null @@ -1,182 +0,0 @@ -/** - * Summary: interfaces to the Catalog handling system - * Description: the catalog module implements the support for - * XML Catalogs and SGML catalogs - * - * SGML Open Technical Resolution TR9401:1997. - * http://www.jclark.com/sp/catalog.htm - * - * XML Catalogs Working Draft 06 August 2001 - * http://www.oasis-open.org/committees/entity/spec-2001-08-06.html - * - * Copy: See Copyright for the status of this software. - * - * Author: Daniel Veillard - */ - -#ifndef __XML_CATALOG_H__ -#define __XML_CATALOG_H__ - -#include - -#include -#include -#include - -#ifdef LIBXML_CATALOG_ENABLED - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * XML_CATALOGS_NAMESPACE: - * - * The namespace for the XML Catalogs elements. - */ -#define XML_CATALOGS_NAMESPACE \ - (const xmlChar *) "urn:oasis:names:tc:entity:xmlns:xml:catalog" -/** - * XML_CATALOG_PI: - * - * The specific XML Catalog Processing Instuction name. - */ -#define XML_CATALOG_PI \ - (const xmlChar *) "oasis-xml-catalog" - -/* - * The API is voluntarily limited to general cataloging. - */ -typedef enum { - XML_CATA_PREFER_NONE = 0, - XML_CATA_PREFER_PUBLIC = 1, - XML_CATA_PREFER_SYSTEM -} xmlCatalogPrefer; - -typedef enum { - XML_CATA_ALLOW_NONE = 0, - XML_CATA_ALLOW_GLOBAL = 1, - XML_CATA_ALLOW_DOCUMENT = 2, - XML_CATA_ALLOW_ALL = 3 -} xmlCatalogAllow; - -typedef struct _xmlCatalog xmlCatalog; -typedef xmlCatalog *xmlCatalogPtr; - -/* - * Operations on a given catalog. - */ -XMLPUBFUN xmlCatalogPtr XMLCALL - xmlNewCatalog (int sgml); -XMLPUBFUN xmlCatalogPtr XMLCALL - xmlLoadACatalog (const char *filename); -XMLPUBFUN xmlCatalogPtr XMLCALL - xmlLoadSGMLSuperCatalog (const char *filename); -XMLPUBFUN int XMLCALL - xmlConvertSGMLCatalog (xmlCatalogPtr catal); -XMLPUBFUN int XMLCALL - xmlACatalogAdd (xmlCatalogPtr catal, - const xmlChar *type, - const xmlChar *orig, - const xmlChar *replace); -XMLPUBFUN int XMLCALL - xmlACatalogRemove (xmlCatalogPtr catal, - const xmlChar *value); -XMLPUBFUN xmlChar * XMLCALL - xmlACatalogResolve (xmlCatalogPtr catal, - const xmlChar *pubID, - const xmlChar *sysID); -XMLPUBFUN xmlChar * XMLCALL - xmlACatalogResolveSystem(xmlCatalogPtr catal, - const xmlChar *sysID); -XMLPUBFUN xmlChar * XMLCALL - xmlACatalogResolvePublic(xmlCatalogPtr catal, - const xmlChar *pubID); -XMLPUBFUN xmlChar * XMLCALL - xmlACatalogResolveURI (xmlCatalogPtr catal, - const xmlChar *URI); -#ifdef LIBXML_OUTPUT_ENABLED -XMLPUBFUN void XMLCALL - xmlACatalogDump (xmlCatalogPtr catal, - FILE *out); -#endif /* LIBXML_OUTPUT_ENABLED */ -XMLPUBFUN void XMLCALL - xmlFreeCatalog (xmlCatalogPtr catal); -XMLPUBFUN int XMLCALL - xmlCatalogIsEmpty (xmlCatalogPtr catal); - -/* - * Global operations. - */ -XMLPUBFUN void XMLCALL - xmlInitializeCatalog (void); -XMLPUBFUN int XMLCALL - xmlLoadCatalog (const char *filename); -XMLPUBFUN void XMLCALL - xmlLoadCatalogs (const char *paths); -XMLPUBFUN void XMLCALL - xmlCatalogCleanup (void); -#ifdef LIBXML_OUTPUT_ENABLED -XMLPUBFUN void XMLCALL - xmlCatalogDump (FILE *out); -#endif /* LIBXML_OUTPUT_ENABLED */ -XMLPUBFUN xmlChar * XMLCALL - xmlCatalogResolve (const xmlChar *pubID, - const xmlChar *sysID); -XMLPUBFUN xmlChar * XMLCALL - xmlCatalogResolveSystem (const xmlChar *sysID); -XMLPUBFUN xmlChar * XMLCALL - xmlCatalogResolvePublic (const xmlChar *pubID); -XMLPUBFUN xmlChar * XMLCALL - xmlCatalogResolveURI (const xmlChar *URI); -XMLPUBFUN int XMLCALL - xmlCatalogAdd (const xmlChar *type, - const xmlChar *orig, - const xmlChar *replace); -XMLPUBFUN int XMLCALL - xmlCatalogRemove (const xmlChar *value); -XMLPUBFUN xmlDocPtr XMLCALL - xmlParseCatalogFile (const char *filename); -XMLPUBFUN int XMLCALL - xmlCatalogConvert (void); - -/* - * Strictly minimal interfaces for per-document catalogs used - * by the parser. - */ -XMLPUBFUN void XMLCALL - xmlCatalogFreeLocal (void *catalogs); -XMLPUBFUN void * XMLCALL - xmlCatalogAddLocal (void *catalogs, - const xmlChar *URL); -XMLPUBFUN xmlChar * XMLCALL - xmlCatalogLocalResolve (void *catalogs, - const xmlChar *pubID, - const xmlChar *sysID); -XMLPUBFUN xmlChar * XMLCALL - xmlCatalogLocalResolveURI(void *catalogs, - const xmlChar *URI); -/* - * Preference settings. - */ -XMLPUBFUN int XMLCALL - xmlCatalogSetDebug (int level); -XMLPUBFUN xmlCatalogPrefer XMLCALL - xmlCatalogSetDefaultPrefer(xmlCatalogPrefer prefer); -XMLPUBFUN void XMLCALL - xmlCatalogSetDefaults (xmlCatalogAllow allow); -XMLPUBFUN xmlCatalogAllow XMLCALL - xmlCatalogGetDefaults (void); - - -/* DEPRECATED interfaces */ -XMLPUBFUN const xmlChar * XMLCALL - xmlCatalogGetSystem (const xmlChar *sysID); -XMLPUBFUN const xmlChar * XMLCALL - xmlCatalogGetPublic (const xmlChar *pubID); - -#ifdef __cplusplus -} -#endif -#endif /* LIBXML_CATALOG_ENABLED */ -#endif /* __XML_CATALOG_H__ */ diff --git a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/chvalid.h b/cocos2dx/platform/third_party/emscripten/libxml2/libxml/chvalid.h deleted file mode 100644 index fb43016982..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/chvalid.h +++ /dev/null @@ -1,230 +0,0 @@ -/* - * Summary: Unicode character range checking - * Description: this module exports interfaces for the character - * range validation APIs - * - * This file is automatically generated from the cvs source - * definition files using the genChRanges.py Python script - * - * Generation date: Mon Mar 27 11:09:48 2006 - * Sources: chvalid.def - * Author: William Brack - */ - -#ifndef __XML_CHVALID_H__ -#define __XML_CHVALID_H__ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Define our typedefs and structures - * - */ -typedef struct _xmlChSRange xmlChSRange; -typedef xmlChSRange *xmlChSRangePtr; -struct _xmlChSRange { - unsigned short low; - unsigned short high; -}; - -typedef struct _xmlChLRange xmlChLRange; -typedef xmlChLRange *xmlChLRangePtr; -struct _xmlChLRange { - unsigned int low; - unsigned int high; -}; - -typedef struct _xmlChRangeGroup xmlChRangeGroup; -typedef xmlChRangeGroup *xmlChRangeGroupPtr; -struct _xmlChRangeGroup { - int nbShortRange; - int nbLongRange; - const xmlChSRange *shortRange; /* points to an array of ranges */ - const xmlChLRange *longRange; -}; - -/** - * Range checking routine - */ -XMLPUBFUN int XMLCALL - xmlCharInRange(unsigned int val, const xmlChRangeGroup *group); - - -/** - * xmlIsBaseChar_ch: - * @c: char to validate - * - * Automatically generated by genChRanges.py - */ -#define xmlIsBaseChar_ch(c) (((0x41 <= (c)) && ((c) <= 0x5a)) || \ - ((0x61 <= (c)) && ((c) <= 0x7a)) || \ - ((0xc0 <= (c)) && ((c) <= 0xd6)) || \ - ((0xd8 <= (c)) && ((c) <= 0xf6)) || \ - (0xf8 <= (c))) - -/** - * xmlIsBaseCharQ: - * @c: char to validate - * - * Automatically generated by genChRanges.py - */ -#define xmlIsBaseCharQ(c) (((c) < 0x100) ? \ - xmlIsBaseChar_ch((c)) : \ - xmlCharInRange((c), &xmlIsBaseCharGroup)) - -XMLPUBVAR const xmlChRangeGroup xmlIsBaseCharGroup; - -/** - * xmlIsBlank_ch: - * @c: char to validate - * - * Automatically generated by genChRanges.py - */ -#define xmlIsBlank_ch(c) (((c) == 0x20) || \ - ((0x9 <= (c)) && ((c) <= 0xa)) || \ - ((c) == 0xd)) - -/** - * xmlIsBlankQ: - * @c: char to validate - * - * Automatically generated by genChRanges.py - */ -#define xmlIsBlankQ(c) (((c) < 0x100) ? \ - xmlIsBlank_ch((c)) : 0) - - -/** - * xmlIsChar_ch: - * @c: char to validate - * - * Automatically generated by genChRanges.py - */ -#define xmlIsChar_ch(c) (((0x9 <= (c)) && ((c) <= 0xa)) || \ - ((c) == 0xd) || \ - (0x20 <= (c))) - -/** - * xmlIsCharQ: - * @c: char to validate - * - * Automatically generated by genChRanges.py - */ -#define xmlIsCharQ(c) (((c) < 0x100) ? \ - xmlIsChar_ch((c)) :\ - (((0x100 <= (c)) && ((c) <= 0xd7ff)) || \ - ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \ - ((0x10000 <= (c)) && ((c) <= 0x10ffff)))) - -XMLPUBVAR const xmlChRangeGroup xmlIsCharGroup; - -/** - * xmlIsCombiningQ: - * @c: char to validate - * - * Automatically generated by genChRanges.py - */ -#define xmlIsCombiningQ(c) (((c) < 0x100) ? \ - 0 : \ - xmlCharInRange((c), &xmlIsCombiningGroup)) - -XMLPUBVAR const xmlChRangeGroup xmlIsCombiningGroup; - -/** - * xmlIsDigit_ch: - * @c: char to validate - * - * Automatically generated by genChRanges.py - */ -#define xmlIsDigit_ch(c) (((0x30 <= (c)) && ((c) <= 0x39))) - -/** - * xmlIsDigitQ: - * @c: char to validate - * - * Automatically generated by genChRanges.py - */ -#define xmlIsDigitQ(c) (((c) < 0x100) ? \ - xmlIsDigit_ch((c)) : \ - xmlCharInRange((c), &xmlIsDigitGroup)) - -XMLPUBVAR const xmlChRangeGroup xmlIsDigitGroup; - -/** - * xmlIsExtender_ch: - * @c: char to validate - * - * Automatically generated by genChRanges.py - */ -#define xmlIsExtender_ch(c) (((c) == 0xb7)) - -/** - * xmlIsExtenderQ: - * @c: char to validate - * - * Automatically generated by genChRanges.py - */ -#define xmlIsExtenderQ(c) (((c) < 0x100) ? \ - xmlIsExtender_ch((c)) : \ - xmlCharInRange((c), &xmlIsExtenderGroup)) - -XMLPUBVAR const xmlChRangeGroup xmlIsExtenderGroup; - -/** - * xmlIsIdeographicQ: - * @c: char to validate - * - * Automatically generated by genChRanges.py - */ -#define xmlIsIdeographicQ(c) (((c) < 0x100) ? \ - 0 :\ - (((0x4e00 <= (c)) && ((c) <= 0x9fa5)) || \ - ((c) == 0x3007) || \ - ((0x3021 <= (c)) && ((c) <= 0x3029)))) - -XMLPUBVAR const xmlChRangeGroup xmlIsIdeographicGroup; -XMLPUBVAR const unsigned char xmlIsPubidChar_tab[256]; - -/** - * xmlIsPubidChar_ch: - * @c: char to validate - * - * Automatically generated by genChRanges.py - */ -#define xmlIsPubidChar_ch(c) (xmlIsPubidChar_tab[(c)]) - -/** - * xmlIsPubidCharQ: - * @c: char to validate - * - * Automatically generated by genChRanges.py - */ -#define xmlIsPubidCharQ(c) (((c) < 0x100) ? \ - xmlIsPubidChar_ch((c)) : 0) - -XMLPUBFUN int XMLCALL - xmlIsBaseChar(unsigned int ch); -XMLPUBFUN int XMLCALL - xmlIsBlank(unsigned int ch); -XMLPUBFUN int XMLCALL - xmlIsChar(unsigned int ch); -XMLPUBFUN int XMLCALL - xmlIsCombining(unsigned int ch); -XMLPUBFUN int XMLCALL - xmlIsDigit(unsigned int ch); -XMLPUBFUN int XMLCALL - xmlIsExtender(unsigned int ch); -XMLPUBFUN int XMLCALL - xmlIsIdeographic(unsigned int ch); -XMLPUBFUN int XMLCALL - xmlIsPubidChar(unsigned int ch); - -#ifdef __cplusplus -} -#endif -#endif /* __XML_CHVALID_H__ */ diff --git a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/debugXML.h b/cocos2dx/platform/third_party/emscripten/libxml2/libxml/debugXML.h deleted file mode 100644 index 5b3be13d85..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/debugXML.h +++ /dev/null @@ -1,217 +0,0 @@ -/* - * Summary: Tree debugging APIs - * Description: Interfaces to a set of routines used for debugging the tree - * produced by the XML parser. - * - * Copy: See Copyright for the status of this software. - * - * Author: Daniel Veillard - */ - -#ifndef __DEBUG_XML__ -#define __DEBUG_XML__ -#include -#include -#include - -#ifdef LIBXML_DEBUG_ENABLED - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * The standard Dump routines. - */ -XMLPUBFUN void XMLCALL - xmlDebugDumpString (FILE *output, - const xmlChar *str); -XMLPUBFUN void XMLCALL - xmlDebugDumpAttr (FILE *output, - xmlAttrPtr attr, - int depth); -XMLPUBFUN void XMLCALL - xmlDebugDumpAttrList (FILE *output, - xmlAttrPtr attr, - int depth); -XMLPUBFUN void XMLCALL - xmlDebugDumpOneNode (FILE *output, - xmlNodePtr node, - int depth); -XMLPUBFUN void XMLCALL - xmlDebugDumpNode (FILE *output, - xmlNodePtr node, - int depth); -XMLPUBFUN void XMLCALL - xmlDebugDumpNodeList (FILE *output, - xmlNodePtr node, - int depth); -XMLPUBFUN void XMLCALL - xmlDebugDumpDocumentHead(FILE *output, - xmlDocPtr doc); -XMLPUBFUN void XMLCALL - xmlDebugDumpDocument (FILE *output, - xmlDocPtr doc); -XMLPUBFUN void XMLCALL - xmlDebugDumpDTD (FILE *output, - xmlDtdPtr dtd); -XMLPUBFUN void XMLCALL - xmlDebugDumpEntities (FILE *output, - xmlDocPtr doc); - -/**************************************************************** - * * - * Checking routines * - * * - ****************************************************************/ - -XMLPUBFUN int XMLCALL - xmlDebugCheckDocument (FILE * output, - xmlDocPtr doc); - -/**************************************************************** - * * - * XML shell helpers * - * * - ****************************************************************/ - -XMLPUBFUN void XMLCALL - xmlLsOneNode (FILE *output, xmlNodePtr node); -XMLPUBFUN int XMLCALL - xmlLsCountNode (xmlNodePtr node); - -XMLPUBFUN const char * XMLCALL - xmlBoolToText (int boolval); - -/**************************************************************** - * * - * The XML shell related structures and functions * - * * - ****************************************************************/ - -#ifdef LIBXML_XPATH_ENABLED -/** - * xmlShellReadlineFunc: - * @prompt: a string prompt - * - * This is a generic signature for the XML shell input function. - * - * Returns a string which will be freed by the Shell. - */ -typedef char * (* xmlShellReadlineFunc)(char *prompt); - -/** - * xmlShellCtxt: - * - * A debugging shell context. - * TODO: add the defined function tables. - */ -typedef struct _xmlShellCtxt xmlShellCtxt; -typedef xmlShellCtxt *xmlShellCtxtPtr; -struct _xmlShellCtxt { - char *filename; - xmlDocPtr doc; - xmlNodePtr node; - xmlXPathContextPtr pctxt; - int loaded; - FILE *output; - xmlShellReadlineFunc input; -}; - -/** - * xmlShellCmd: - * @ctxt: a shell context - * @arg: a string argument - * @node: a first node - * @node2: a second node - * - * This is a generic signature for the XML shell functions. - * - * Returns an int, negative returns indicating errors. - */ -typedef int (* xmlShellCmd) (xmlShellCtxtPtr ctxt, - char *arg, - xmlNodePtr node, - xmlNodePtr node2); - -XMLPUBFUN void XMLCALL - xmlShellPrintXPathError (int errorType, - const char *arg); -XMLPUBFUN void XMLCALL - xmlShellPrintXPathResult(xmlXPathObjectPtr list); -XMLPUBFUN int XMLCALL - xmlShellList (xmlShellCtxtPtr ctxt, - char *arg, - xmlNodePtr node, - xmlNodePtr node2); -XMLPUBFUN int XMLCALL - xmlShellBase (xmlShellCtxtPtr ctxt, - char *arg, - xmlNodePtr node, - xmlNodePtr node2); -XMLPUBFUN int XMLCALL - xmlShellDir (xmlShellCtxtPtr ctxt, - char *arg, - xmlNodePtr node, - xmlNodePtr node2); -XMLPUBFUN int XMLCALL - xmlShellLoad (xmlShellCtxtPtr ctxt, - char *filename, - xmlNodePtr node, - xmlNodePtr node2); -#ifdef LIBXML_OUTPUT_ENABLED -XMLPUBFUN void XMLCALL - xmlShellPrintNode (xmlNodePtr node); -XMLPUBFUN int XMLCALL - xmlShellCat (xmlShellCtxtPtr ctxt, - char *arg, - xmlNodePtr node, - xmlNodePtr node2); -XMLPUBFUN int XMLCALL - xmlShellWrite (xmlShellCtxtPtr ctxt, - char *filename, - xmlNodePtr node, - xmlNodePtr node2); -XMLPUBFUN int XMLCALL - xmlShellSave (xmlShellCtxtPtr ctxt, - char *filename, - xmlNodePtr node, - xmlNodePtr node2); -#endif /* LIBXML_OUTPUT_ENABLED */ -#ifdef LIBXML_VALID_ENABLED -XMLPUBFUN int XMLCALL - xmlShellValidate (xmlShellCtxtPtr ctxt, - char *dtd, - xmlNodePtr node, - xmlNodePtr node2); -#endif /* LIBXML_VALID_ENABLED */ -XMLPUBFUN int XMLCALL - xmlShellDu (xmlShellCtxtPtr ctxt, - char *arg, - xmlNodePtr tree, - xmlNodePtr node2); -XMLPUBFUN int XMLCALL - xmlShellPwd (xmlShellCtxtPtr ctxt, - char *buffer, - xmlNodePtr node, - xmlNodePtr node2); - -/* - * The Shell interface. - */ -XMLPUBFUN void XMLCALL - xmlShell (xmlDocPtr doc, - char *filename, - xmlShellReadlineFunc input, - FILE *output); - -#endif /* LIBXML_XPATH_ENABLED */ - -#ifdef __cplusplus -} -#endif - -#endif /* LIBXML_DEBUG_ENABLED */ -#endif /* __DEBUG_XML__ */ diff --git a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/dict.h b/cocos2dx/platform/third_party/emscripten/libxml2/libxml/dict.h deleted file mode 100644 index 7022ec8bee..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/dict.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Summary: string dictionnary - * Description: dictionary of reusable strings, just used to avoid allocation - * and freeing operations. - * - * Copy: See Copyright for the status of this software. - * - * Author: Daniel Veillard - */ - -#ifndef __XML_DICT_H__ -#define __XML_DICT_H__ - -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * The dictionnary. - */ -typedef struct _xmlDict xmlDict; -typedef xmlDict *xmlDictPtr; - -/* - * Initializer - */ -XMLPUBFUN int XMLCALL xmlInitializeDict(void); - -/* - * Constructor and destructor. - */ -XMLPUBFUN xmlDictPtr XMLCALL - xmlDictCreate (void); -XMLPUBFUN size_t XMLCALL - xmlDictSetLimit (xmlDictPtr dict, - size_t limit); -XMLPUBFUN size_t XMLCALL - xmlDictGetUsage (xmlDictPtr dict); -XMLPUBFUN xmlDictPtr XMLCALL - xmlDictCreateSub(xmlDictPtr sub); -XMLPUBFUN int XMLCALL - xmlDictReference(xmlDictPtr dict); -XMLPUBFUN void XMLCALL - xmlDictFree (xmlDictPtr dict); - -/* - * Lookup of entry in the dictionnary. - */ -XMLPUBFUN const xmlChar * XMLCALL - xmlDictLookup (xmlDictPtr dict, - const xmlChar *name, - int len); -XMLPUBFUN const xmlChar * XMLCALL - xmlDictExists (xmlDictPtr dict, - const xmlChar *name, - int len); -XMLPUBFUN const xmlChar * XMLCALL - xmlDictQLookup (xmlDictPtr dict, - const xmlChar *prefix, - const xmlChar *name); -XMLPUBFUN int XMLCALL - xmlDictOwns (xmlDictPtr dict, - const xmlChar *str); -XMLPUBFUN int XMLCALL - xmlDictSize (xmlDictPtr dict); - -/* - * Cleanup function - */ -XMLPUBFUN void XMLCALL - xmlDictCleanup (void); - -#ifdef __cplusplus -} -#endif -#endif /* ! __XML_DICT_H__ */ diff --git a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/encoding.h b/cocos2dx/platform/third_party/emscripten/libxml2/libxml/encoding.h deleted file mode 100644 index 7967cc66a9..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/encoding.h +++ /dev/null @@ -1,240 +0,0 @@ -/* - * Summary: interface for the encoding conversion functions - * Description: interface for the encoding conversion functions needed for - * XML basic encoding and iconv() support. - * - * Related specs are - * rfc2044 (UTF-8 and UTF-16) F. Yergeau Alis Technologies - * [ISO-10646] UTF-8 and UTF-16 in Annexes - * [ISO-8859-1] ISO Latin-1 characters codes. - * [UNICODE] The Unicode Consortium, "The Unicode Standard -- - * Worldwide Character Encoding -- Version 1.0", Addison- - * Wesley, Volume 1, 1991, Volume 2, 1992. UTF-8 is - * described in Unicode Technical Report #4. - * [US-ASCII] Coded Character Set--7-bit American Standard Code for - * Information Interchange, ANSI X3.4-1986. - * - * Copy: See Copyright for the status of this software. - * - * Author: Daniel Veillard - */ - -#ifndef __XML_CHAR_ENCODING_H__ -#define __XML_CHAR_ENCODING_H__ - -#include - -#ifdef LIBXML_ICONV_ENABLED -#include -#endif -#ifdef LIBXML_ICU_ENABLED -#include -#endif -#ifdef __cplusplus -extern "C" { -#endif - -/* - * xmlCharEncoding: - * - * Predefined values for some standard encodings. - * Libxml does not do beforehand translation on UTF8 and ISOLatinX. - * It also supports ASCII, ISO-8859-1, and UTF16 (LE and BE) by default. - * - * Anything else would have to be translated to UTF8 before being - * given to the parser itself. The BOM for UTF16 and the encoding - * declaration are looked at and a converter is looked for at that - * point. If not found the parser stops here as asked by the XML REC. A - * converter can be registered by the user using xmlRegisterCharEncodingHandler - * but the current form doesn't allow stateful transcoding (a serious - * problem agreed !). If iconv has been found it will be used - * automatically and allow stateful transcoding, the simplest is then - * to be sure to enable iconv and to provide iconv libs for the encoding - * support needed. - * - * Note that the generic "UTF-16" is not a predefined value. Instead, only - * the specific UTF-16LE and UTF-16BE are present. - */ -typedef enum { - XML_CHAR_ENCODING_ERROR= -1, /* No char encoding detected */ - XML_CHAR_ENCODING_NONE= 0, /* No char encoding detected */ - XML_CHAR_ENCODING_UTF8= 1, /* UTF-8 */ - XML_CHAR_ENCODING_UTF16LE= 2, /* UTF-16 little endian */ - XML_CHAR_ENCODING_UTF16BE= 3, /* UTF-16 big endian */ - XML_CHAR_ENCODING_UCS4LE= 4, /* UCS-4 little endian */ - XML_CHAR_ENCODING_UCS4BE= 5, /* UCS-4 big endian */ - XML_CHAR_ENCODING_EBCDIC= 6, /* EBCDIC uh! */ - XML_CHAR_ENCODING_UCS4_2143=7, /* UCS-4 unusual ordering */ - XML_CHAR_ENCODING_UCS4_3412=8, /* UCS-4 unusual ordering */ - XML_CHAR_ENCODING_UCS2= 9, /* UCS-2 */ - XML_CHAR_ENCODING_8859_1= 10,/* ISO-8859-1 ISO Latin 1 */ - XML_CHAR_ENCODING_8859_2= 11,/* ISO-8859-2 ISO Latin 2 */ - XML_CHAR_ENCODING_8859_3= 12,/* ISO-8859-3 */ - XML_CHAR_ENCODING_8859_4= 13,/* ISO-8859-4 */ - XML_CHAR_ENCODING_8859_5= 14,/* ISO-8859-5 */ - XML_CHAR_ENCODING_8859_6= 15,/* ISO-8859-6 */ - XML_CHAR_ENCODING_8859_7= 16,/* ISO-8859-7 */ - XML_CHAR_ENCODING_8859_8= 17,/* ISO-8859-8 */ - XML_CHAR_ENCODING_8859_9= 18,/* ISO-8859-9 */ - XML_CHAR_ENCODING_2022_JP= 19,/* ISO-2022-JP */ - XML_CHAR_ENCODING_SHIFT_JIS=20,/* Shift_JIS */ - XML_CHAR_ENCODING_EUC_JP= 21,/* EUC-JP */ - XML_CHAR_ENCODING_ASCII= 22 /* pure ASCII */ -} xmlCharEncoding; - -/** - * xmlCharEncodingInputFunc: - * @out: a pointer to an array of bytes to store the UTF-8 result - * @outlen: the length of @out - * @in: a pointer to an array of chars in the original encoding - * @inlen: the length of @in - * - * Take a block of chars in the original encoding and try to convert - * it to an UTF-8 block of chars out. - * - * Returns the number of bytes written, -1 if lack of space, or -2 - * if the transcoding failed. - * The value of @inlen after return is the number of octets consumed - * if the return value is positive, else unpredictiable. - * The value of @outlen after return is the number of octets consumed. - */ -typedef int (* xmlCharEncodingInputFunc)(unsigned char *out, int *outlen, - const unsigned char *in, int *inlen); - - -/** - * xmlCharEncodingOutputFunc: - * @out: a pointer to an array of bytes to store the result - * @outlen: the length of @out - * @in: a pointer to an array of UTF-8 chars - * @inlen: the length of @in - * - * Take a block of UTF-8 chars in and try to convert it to another - * encoding. - * Note: a first call designed to produce heading info is called with - * in = NULL. If stateful this should also initialize the encoder state. - * - * Returns the number of bytes written, -1 if lack of space, or -2 - * if the transcoding failed. - * The value of @inlen after return is the number of octets consumed - * if the return value is positive, else unpredictiable. - * The value of @outlen after return is the number of octets produced. - */ -typedef int (* xmlCharEncodingOutputFunc)(unsigned char *out, int *outlen, - const unsigned char *in, int *inlen); - - -/* - * Block defining the handlers for non UTF-8 encodings. - * If iconv is supported, there are two extra fields. - */ -#ifdef LIBXML_ICU_ENABLED -struct _uconv_t { - UConverter *uconv; /* for conversion between an encoding and UTF-16 */ - UConverter *utf8; /* for conversion between UTF-8 and UTF-16 */ -}; -typedef struct _uconv_t uconv_t; -#endif - -typedef struct _xmlCharEncodingHandler xmlCharEncodingHandler; -typedef xmlCharEncodingHandler *xmlCharEncodingHandlerPtr; -struct _xmlCharEncodingHandler { - char *name; - xmlCharEncodingInputFunc input; - xmlCharEncodingOutputFunc output; -#ifdef LIBXML_ICONV_ENABLED - iconv_t iconv_in; - iconv_t iconv_out; -#endif /* LIBXML_ICONV_ENABLED */ -#ifdef LIBXML_ICU_ENABLED - uconv_t *uconv_in; - uconv_t *uconv_out; -#endif /* LIBXML_ICU_ENABLED */ -}; - -#ifdef __cplusplus -} -#endif -#include -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Interfaces for encoding handlers. - */ -XMLPUBFUN void XMLCALL - xmlInitCharEncodingHandlers (void); -XMLPUBFUN void XMLCALL - xmlCleanupCharEncodingHandlers (void); -XMLPUBFUN void XMLCALL - xmlRegisterCharEncodingHandler (xmlCharEncodingHandlerPtr handler); -XMLPUBFUN xmlCharEncodingHandlerPtr XMLCALL - xmlGetCharEncodingHandler (xmlCharEncoding enc); -XMLPUBFUN xmlCharEncodingHandlerPtr XMLCALL - xmlFindCharEncodingHandler (const char *name); -XMLPUBFUN xmlCharEncodingHandlerPtr XMLCALL - xmlNewCharEncodingHandler (const char *name, - xmlCharEncodingInputFunc input, - xmlCharEncodingOutputFunc output); - -/* - * Interfaces for encoding names and aliases. - */ -XMLPUBFUN int XMLCALL - xmlAddEncodingAlias (const char *name, - const char *alias); -XMLPUBFUN int XMLCALL - xmlDelEncodingAlias (const char *alias); -XMLPUBFUN const char * XMLCALL - xmlGetEncodingAlias (const char *alias); -XMLPUBFUN void XMLCALL - xmlCleanupEncodingAliases (void); -XMLPUBFUN xmlCharEncoding XMLCALL - xmlParseCharEncoding (const char *name); -XMLPUBFUN const char * XMLCALL - xmlGetCharEncodingName (xmlCharEncoding enc); - -/* - * Interfaces directly used by the parsers. - */ -XMLPUBFUN xmlCharEncoding XMLCALL - xmlDetectCharEncoding (const unsigned char *in, - int len); - -XMLPUBFUN int XMLCALL - xmlCharEncOutFunc (xmlCharEncodingHandler *handler, - xmlBufferPtr out, - xmlBufferPtr in); - -XMLPUBFUN int XMLCALL - xmlCharEncInFunc (xmlCharEncodingHandler *handler, - xmlBufferPtr out, - xmlBufferPtr in); -XMLPUBFUN int XMLCALL - xmlCharEncFirstLine (xmlCharEncodingHandler *handler, - xmlBufferPtr out, - xmlBufferPtr in); -XMLPUBFUN int XMLCALL - xmlCharEncCloseFunc (xmlCharEncodingHandler *handler); - -/* - * Export a few useful functions - */ -#ifdef LIBXML_OUTPUT_ENABLED -XMLPUBFUN int XMLCALL - UTF8Toisolat1 (unsigned char *out, - int *outlen, - const unsigned char *in, - int *inlen); -#endif /* LIBXML_OUTPUT_ENABLED */ -XMLPUBFUN int XMLCALL - isolat1ToUTF8 (unsigned char *out, - int *outlen, - const unsigned char *in, - int *inlen); -#ifdef __cplusplus -} -#endif - -#endif /* __XML_CHAR_ENCODING_H__ */ diff --git a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/entities.h b/cocos2dx/platform/third_party/emscripten/libxml2/libxml/entities.h deleted file mode 100644 index 1e9118975d..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/entities.h +++ /dev/null @@ -1,151 +0,0 @@ -/* - * Summary: interface for the XML entities handling - * Description: this module provides some of the entity API needed - * for the parser and applications. - * - * Copy: See Copyright for the status of this software. - * - * Author: Daniel Veillard - */ - -#ifndef __XML_ENTITIES_H__ -#define __XML_ENTITIES_H__ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * The different valid entity types. - */ -typedef enum { - XML_INTERNAL_GENERAL_ENTITY = 1, - XML_EXTERNAL_GENERAL_PARSED_ENTITY = 2, - XML_EXTERNAL_GENERAL_UNPARSED_ENTITY = 3, - XML_INTERNAL_PARAMETER_ENTITY = 4, - XML_EXTERNAL_PARAMETER_ENTITY = 5, - XML_INTERNAL_PREDEFINED_ENTITY = 6 -} xmlEntityType; - -/* - * An unit of storage for an entity, contains the string, the value - * and the linkind data needed for the linking in the hash table. - */ - -struct _xmlEntity { - void *_private; /* application data */ - xmlElementType type; /* XML_ENTITY_DECL, must be second ! */ - const xmlChar *name; /* Entity name */ - struct _xmlNode *children; /* First child link */ - struct _xmlNode *last; /* Last child link */ - struct _xmlDtd *parent; /* -> DTD */ - struct _xmlNode *next; /* next sibling link */ - struct _xmlNode *prev; /* previous sibling link */ - struct _xmlDoc *doc; /* the containing document */ - - xmlChar *orig; /* content without ref substitution */ - xmlChar *content; /* content or ndata if unparsed */ - int length; /* the content length */ - xmlEntityType etype; /* The entity type */ - const xmlChar *ExternalID; /* External identifier for PUBLIC */ - const xmlChar *SystemID; /* URI for a SYSTEM or PUBLIC Entity */ - - struct _xmlEntity *nexte; /* unused */ - const xmlChar *URI; /* the full URI as computed */ - int owner; /* does the entity own the childrens */ - int checked; /* was the entity content checked */ - /* this is also used to count entites - * references done from that entity - * and if it contains '<' */ -}; - -/* - * All entities are stored in an hash table. - * There is 2 separate hash tables for global and parameter entities. - */ - -typedef struct _xmlHashTable xmlEntitiesTable; -typedef xmlEntitiesTable *xmlEntitiesTablePtr; - -/* - * External functions: - */ - -#ifdef LIBXML_LEGACY_ENABLED -XMLPUBFUN void XMLCALL - xmlInitializePredefinedEntities (void); -#endif /* LIBXML_LEGACY_ENABLED */ - -XMLPUBFUN xmlEntityPtr XMLCALL - xmlNewEntity (xmlDocPtr doc, - const xmlChar *name, - int type, - const xmlChar *ExternalID, - const xmlChar *SystemID, - const xmlChar *content); -XMLPUBFUN xmlEntityPtr XMLCALL - xmlAddDocEntity (xmlDocPtr doc, - const xmlChar *name, - int type, - const xmlChar *ExternalID, - const xmlChar *SystemID, - const xmlChar *content); -XMLPUBFUN xmlEntityPtr XMLCALL - xmlAddDtdEntity (xmlDocPtr doc, - const xmlChar *name, - int type, - const xmlChar *ExternalID, - const xmlChar *SystemID, - const xmlChar *content); -XMLPUBFUN xmlEntityPtr XMLCALL - xmlGetPredefinedEntity (const xmlChar *name); -XMLPUBFUN xmlEntityPtr XMLCALL - xmlGetDocEntity (xmlDocPtr doc, - const xmlChar *name); -XMLPUBFUN xmlEntityPtr XMLCALL - xmlGetDtdEntity (xmlDocPtr doc, - const xmlChar *name); -XMLPUBFUN xmlEntityPtr XMLCALL - xmlGetParameterEntity (xmlDocPtr doc, - const xmlChar *name); -#ifdef LIBXML_LEGACY_ENABLED -XMLPUBFUN const xmlChar * XMLCALL - xmlEncodeEntities (xmlDocPtr doc, - const xmlChar *input); -#endif /* LIBXML_LEGACY_ENABLED */ -XMLPUBFUN xmlChar * XMLCALL - xmlEncodeEntitiesReentrant(xmlDocPtr doc, - const xmlChar *input); -XMLPUBFUN xmlChar * XMLCALL - xmlEncodeSpecialChars (xmlDocPtr doc, - const xmlChar *input); -XMLPUBFUN xmlEntitiesTablePtr XMLCALL - xmlCreateEntitiesTable (void); -#ifdef LIBXML_TREE_ENABLED -XMLPUBFUN xmlEntitiesTablePtr XMLCALL - xmlCopyEntitiesTable (xmlEntitiesTablePtr table); -#endif /* LIBXML_TREE_ENABLED */ -XMLPUBFUN void XMLCALL - xmlFreeEntitiesTable (xmlEntitiesTablePtr table); -#ifdef LIBXML_OUTPUT_ENABLED -XMLPUBFUN void XMLCALL - xmlDumpEntitiesTable (xmlBufferPtr buf, - xmlEntitiesTablePtr table); -XMLPUBFUN void XMLCALL - xmlDumpEntityDecl (xmlBufferPtr buf, - xmlEntityPtr ent); -#endif /* LIBXML_OUTPUT_ENABLED */ -#ifdef LIBXML_LEGACY_ENABLED -XMLPUBFUN void XMLCALL - xmlCleanupPredefinedEntities(void); -#endif /* LIBXML_LEGACY_ENABLED */ - - -#ifdef __cplusplus -} -#endif - -# endif /* __XML_ENTITIES_H__ */ diff --git a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/globals.h b/cocos2dx/platform/third_party/emscripten/libxml2/libxml/globals.h deleted file mode 100644 index 9d688e0d3f..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/globals.h +++ /dev/null @@ -1,502 +0,0 @@ -/* - * Summary: interface for all global variables of the library - * Description: all the global variables and thread handling for - * those variables is handled by this module. - * - * The bottom of this file is automatically generated by build_glob.py - * based on the description file global.data - * - * Copy: See Copyright for the status of this software. - * - * Author: Gary Pennington , Daniel Veillard - */ - -#ifndef __XML_GLOBALS_H -#define __XML_GLOBALS_H - -#include -#include -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -XMLPUBFUN void XMLCALL xmlInitGlobals(void); -XMLPUBFUN void XMLCALL xmlCleanupGlobals(void); - -/** - * xmlParserInputBufferCreateFilenameFunc: - * @URI: the URI to read from - * @enc: the requested source encoding - * - * Signature for the function doing the lookup for a suitable input method - * corresponding to an URI. - * - * Returns the new xmlParserInputBufferPtr in case of success or NULL if no - * method was found. - */ -typedef xmlParserInputBufferPtr (*xmlParserInputBufferCreateFilenameFunc) (const char *URI, xmlCharEncoding enc); - -/** - * xmlOutputBufferCreateFilenameFunc: - * @URI: the URI to write to - * @enc: the requested target encoding - * - * Signature for the function doing the lookup for a suitable output method - * corresponding to an URI. - * - * Returns the new xmlOutputBufferPtr in case of success or NULL if no - * method was found. - */ -typedef xmlOutputBufferPtr (*xmlOutputBufferCreateFilenameFunc) (const char *URI, xmlCharEncodingHandlerPtr encoder, int compression); - -XMLPUBFUN xmlParserInputBufferCreateFilenameFunc -XMLCALL xmlParserInputBufferCreateFilenameDefault (xmlParserInputBufferCreateFilenameFunc func); -XMLPUBFUN xmlOutputBufferCreateFilenameFunc -XMLCALL xmlOutputBufferCreateFilenameDefault (xmlOutputBufferCreateFilenameFunc func); - -/* - * Externally global symbols which need to be protected for backwards - * compatibility support. - */ - -#undef docbDefaultSAXHandler -#undef htmlDefaultSAXHandler -#undef oldXMLWDcompatibility -#undef xmlBufferAllocScheme -#undef xmlDefaultBufferSize -#undef xmlDefaultSAXHandler -#undef xmlDefaultSAXLocator -#undef xmlDoValidityCheckingDefaultValue -#undef xmlFree -#undef xmlGenericError -#undef xmlStructuredError -#undef xmlGenericErrorContext -#undef xmlStructuredErrorContext -#undef xmlGetWarningsDefaultValue -#undef xmlIndentTreeOutput -#undef xmlTreeIndentString -#undef xmlKeepBlanksDefaultValue -#undef xmlLineNumbersDefaultValue -#undef xmlLoadExtDtdDefaultValue -#undef xmlMalloc -#undef xmlMallocAtomic -#undef xmlMemStrdup -#undef xmlParserDebugEntities -#undef xmlParserVersion -#undef xmlPedanticParserDefaultValue -#undef xmlRealloc -#undef xmlSaveNoEmptyTags -#undef xmlSubstituteEntitiesDefaultValue -#undef xmlRegisterNodeDefaultValue -#undef xmlDeregisterNodeDefaultValue -#undef xmlLastError -#undef xmlParserInputBufferCreateFilenameValue -#undef xmlOutputBufferCreateFilenameValue - -/** - * xmlRegisterNodeFunc: - * @node: the current node - * - * Signature for the registration callback of a created node - */ -typedef void (*xmlRegisterNodeFunc) (xmlNodePtr node); -/** - * xmlDeregisterNodeFunc: - * @node: the current node - * - * Signature for the deregistration callback of a discarded node - */ -typedef void (*xmlDeregisterNodeFunc) (xmlNodePtr node); - -typedef struct _xmlGlobalState xmlGlobalState; -typedef xmlGlobalState *xmlGlobalStatePtr; -struct _xmlGlobalState -{ - const char *xmlParserVersion; - - xmlSAXLocator xmlDefaultSAXLocator; - xmlSAXHandlerV1 xmlDefaultSAXHandler; - xmlSAXHandlerV1 docbDefaultSAXHandler; - xmlSAXHandlerV1 htmlDefaultSAXHandler; - - xmlFreeFunc xmlFree; - xmlMallocFunc xmlMalloc; - xmlStrdupFunc xmlMemStrdup; - xmlReallocFunc xmlRealloc; - - xmlGenericErrorFunc xmlGenericError; - xmlStructuredErrorFunc xmlStructuredError; - void *xmlGenericErrorContext; - - int oldXMLWDcompatibility; - - xmlBufferAllocationScheme xmlBufferAllocScheme; - int xmlDefaultBufferSize; - - int xmlSubstituteEntitiesDefaultValue; - int xmlDoValidityCheckingDefaultValue; - int xmlGetWarningsDefaultValue; - int xmlKeepBlanksDefaultValue; - int xmlLineNumbersDefaultValue; - int xmlLoadExtDtdDefaultValue; - int xmlParserDebugEntities; - int xmlPedanticParserDefaultValue; - - int xmlSaveNoEmptyTags; - int xmlIndentTreeOutput; - const char *xmlTreeIndentString; - - xmlRegisterNodeFunc xmlRegisterNodeDefaultValue; - xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValue; - - xmlMallocFunc xmlMallocAtomic; - xmlError xmlLastError; - - xmlParserInputBufferCreateFilenameFunc xmlParserInputBufferCreateFilenameValue; - xmlOutputBufferCreateFilenameFunc xmlOutputBufferCreateFilenameValue; - - void *xmlStructuredErrorContext; -}; - -#ifdef __cplusplus -} -#endif -#include -#ifdef __cplusplus -extern "C" { -#endif - -XMLPUBFUN void XMLCALL xmlInitializeGlobalState(xmlGlobalStatePtr gs); - -XMLPUBFUN void XMLCALL xmlThrDefSetGenericErrorFunc(void *ctx, xmlGenericErrorFunc handler); - -XMLPUBFUN void XMLCALL xmlThrDefSetStructuredErrorFunc(void *ctx, xmlStructuredErrorFunc handler); - -XMLPUBFUN xmlRegisterNodeFunc XMLCALL xmlRegisterNodeDefault(xmlRegisterNodeFunc func); -XMLPUBFUN xmlRegisterNodeFunc XMLCALL xmlThrDefRegisterNodeDefault(xmlRegisterNodeFunc func); -XMLPUBFUN xmlDeregisterNodeFunc XMLCALL xmlDeregisterNodeDefault(xmlDeregisterNodeFunc func); -XMLPUBFUN xmlDeregisterNodeFunc XMLCALL xmlThrDefDeregisterNodeDefault(xmlDeregisterNodeFunc func); - -XMLPUBFUN xmlOutputBufferCreateFilenameFunc XMLCALL - xmlThrDefOutputBufferCreateFilenameDefault(xmlOutputBufferCreateFilenameFunc func); -XMLPUBFUN xmlParserInputBufferCreateFilenameFunc XMLCALL - xmlThrDefParserInputBufferCreateFilenameDefault(xmlParserInputBufferCreateFilenameFunc func); - -/** DOC_DISABLE */ -/* - * In general the memory allocation entry points are not kept - * thread specific but this can be overridden by LIBXML_THREAD_ALLOC_ENABLED - * - xmlMalloc - * - xmlMallocAtomic - * - xmlRealloc - * - xmlMemStrdup - * - xmlFree - */ - -#ifdef LIBXML_THREAD_ALLOC_ENABLED -#ifdef LIBXML_THREAD_ENABLED -XMLPUBFUN xmlMallocFunc * XMLCALL __xmlMalloc(void); -#define xmlMalloc \ -(*(__xmlMalloc())) -#else -XMLPUBVAR xmlMallocFunc xmlMalloc; -#endif - -#ifdef LIBXML_THREAD_ENABLED -XMLPUBFUN xmlMallocFunc * XMLCALL __xmlMallocAtomic(void); -#define xmlMallocAtomic \ -(*(__xmlMallocAtomic())) -#else -XMLPUBVAR xmlMallocFunc xmlMallocAtomic; -#endif - -#ifdef LIBXML_THREAD_ENABLED -XMLPUBFUN xmlReallocFunc * XMLCALL __xmlRealloc(void); -#define xmlRealloc \ -(*(__xmlRealloc())) -#else -XMLPUBVAR xmlReallocFunc xmlRealloc; -#endif - -#ifdef LIBXML_THREAD_ENABLED -XMLPUBFUN xmlFreeFunc * XMLCALL __xmlFree(void); -#define xmlFree \ -(*(__xmlFree())) -#else -XMLPUBVAR xmlFreeFunc xmlFree; -#endif - -#ifdef LIBXML_THREAD_ENABLED -XMLPUBFUN xmlStrdupFunc * XMLCALL __xmlMemStrdup(void); -#define xmlMemStrdup \ -(*(__xmlMemStrdup())) -#else -XMLPUBVAR xmlStrdupFunc xmlMemStrdup; -#endif - -#else /* !LIBXML_THREAD_ALLOC_ENABLED */ -XMLPUBVAR xmlMallocFunc xmlMalloc; -XMLPUBVAR xmlMallocFunc xmlMallocAtomic; -XMLPUBVAR xmlReallocFunc xmlRealloc; -XMLPUBVAR xmlFreeFunc xmlFree; -XMLPUBVAR xmlStrdupFunc xmlMemStrdup; -#endif /* LIBXML_THREAD_ALLOC_ENABLED */ - -#ifdef LIBXML_DOCB_ENABLED -XMLPUBFUN xmlSAXHandlerV1 * XMLCALL __docbDefaultSAXHandler(void); -#ifdef LIBXML_THREAD_ENABLED -#define docbDefaultSAXHandler \ -(*(__docbDefaultSAXHandler())) -#else -XMLPUBVAR xmlSAXHandlerV1 docbDefaultSAXHandler; -#endif -#endif - -#ifdef LIBXML_HTML_ENABLED -XMLPUBFUN xmlSAXHandlerV1 * XMLCALL __htmlDefaultSAXHandler(void); -#ifdef LIBXML_THREAD_ENABLED -#define htmlDefaultSAXHandler \ -(*(__htmlDefaultSAXHandler())) -#else -XMLPUBVAR xmlSAXHandlerV1 htmlDefaultSAXHandler; -#endif -#endif - -XMLPUBFUN xmlError * XMLCALL __xmlLastError(void); -#ifdef LIBXML_THREAD_ENABLED -#define xmlLastError \ -(*(__xmlLastError())) -#else -XMLPUBVAR xmlError xmlLastError; -#endif - -/* - * Everything starting from the line below is - * Automatically generated by build_glob.py. - * Do not modify the previous line. - */ - - -XMLPUBFUN int * XMLCALL __oldXMLWDcompatibility(void); -#ifdef LIBXML_THREAD_ENABLED -#define oldXMLWDcompatibility \ -(*(__oldXMLWDcompatibility())) -#else -XMLPUBVAR int oldXMLWDcompatibility; -#endif - -XMLPUBFUN xmlBufferAllocationScheme * XMLCALL __xmlBufferAllocScheme(void); -#ifdef LIBXML_THREAD_ENABLED -#define xmlBufferAllocScheme \ -(*(__xmlBufferAllocScheme())) -#else -XMLPUBVAR xmlBufferAllocationScheme xmlBufferAllocScheme; -#endif -XMLPUBFUN xmlBufferAllocationScheme XMLCALL xmlThrDefBufferAllocScheme(xmlBufferAllocationScheme v); - -XMLPUBFUN int * XMLCALL __xmlDefaultBufferSize(void); -#ifdef LIBXML_THREAD_ENABLED -#define xmlDefaultBufferSize \ -(*(__xmlDefaultBufferSize())) -#else -XMLPUBVAR int xmlDefaultBufferSize; -#endif -XMLPUBFUN int XMLCALL xmlThrDefDefaultBufferSize(int v); - -XMLPUBFUN xmlSAXHandlerV1 * XMLCALL __xmlDefaultSAXHandler(void); -#ifdef LIBXML_THREAD_ENABLED -#define xmlDefaultSAXHandler \ -(*(__xmlDefaultSAXHandler())) -#else -XMLPUBVAR xmlSAXHandlerV1 xmlDefaultSAXHandler; -#endif - -XMLPUBFUN xmlSAXLocator * XMLCALL __xmlDefaultSAXLocator(void); -#ifdef LIBXML_THREAD_ENABLED -#define xmlDefaultSAXLocator \ -(*(__xmlDefaultSAXLocator())) -#else -XMLPUBVAR xmlSAXLocator xmlDefaultSAXLocator; -#endif - -XMLPUBFUN int * XMLCALL __xmlDoValidityCheckingDefaultValue(void); -#ifdef LIBXML_THREAD_ENABLED -#define xmlDoValidityCheckingDefaultValue \ -(*(__xmlDoValidityCheckingDefaultValue())) -#else -XMLPUBVAR int xmlDoValidityCheckingDefaultValue; -#endif -XMLPUBFUN int XMLCALL xmlThrDefDoValidityCheckingDefaultValue(int v); - -XMLPUBFUN xmlGenericErrorFunc * XMLCALL __xmlGenericError(void); -#ifdef LIBXML_THREAD_ENABLED -#define xmlGenericError \ -(*(__xmlGenericError())) -#else -XMLPUBVAR xmlGenericErrorFunc xmlGenericError; -#endif - -XMLPUBFUN xmlStructuredErrorFunc * XMLCALL __xmlStructuredError(void); -#ifdef LIBXML_THREAD_ENABLED -#define xmlStructuredError \ -(*(__xmlStructuredError())) -#else -XMLPUBVAR xmlStructuredErrorFunc xmlStructuredError; -#endif - -XMLPUBFUN void * * XMLCALL __xmlGenericErrorContext(void); -#ifdef LIBXML_THREAD_ENABLED -#define xmlGenericErrorContext \ -(*(__xmlGenericErrorContext())) -#else -XMLPUBVAR void * xmlGenericErrorContext; -#endif - -XMLPUBFUN void * * XMLCALL __xmlStructuredErrorContext(void); -#ifdef LIBXML_THREAD_ENABLED -#define xmlStructuredErrorContext \ -(*(__xmlStructuredErrorContext())) -#else -XMLPUBVAR void * xmlStructuredErrorContext; -#endif - -XMLPUBFUN int * XMLCALL __xmlGetWarningsDefaultValue(void); -#ifdef LIBXML_THREAD_ENABLED -#define xmlGetWarningsDefaultValue \ -(*(__xmlGetWarningsDefaultValue())) -#else -XMLPUBVAR int xmlGetWarningsDefaultValue; -#endif -XMLPUBFUN int XMLCALL xmlThrDefGetWarningsDefaultValue(int v); - -XMLPUBFUN int * XMLCALL __xmlIndentTreeOutput(void); -#ifdef LIBXML_THREAD_ENABLED -#define xmlIndentTreeOutput \ -(*(__xmlIndentTreeOutput())) -#else -XMLPUBVAR int xmlIndentTreeOutput; -#endif -XMLPUBFUN int XMLCALL xmlThrDefIndentTreeOutput(int v); - -XMLPUBFUN const char * * XMLCALL __xmlTreeIndentString(void); -#ifdef LIBXML_THREAD_ENABLED -#define xmlTreeIndentString \ -(*(__xmlTreeIndentString())) -#else -XMLPUBVAR const char * xmlTreeIndentString; -#endif -XMLPUBFUN const char * XMLCALL xmlThrDefTreeIndentString(const char * v); - -XMLPUBFUN int * XMLCALL __xmlKeepBlanksDefaultValue(void); -#ifdef LIBXML_THREAD_ENABLED -#define xmlKeepBlanksDefaultValue \ -(*(__xmlKeepBlanksDefaultValue())) -#else -XMLPUBVAR int xmlKeepBlanksDefaultValue; -#endif -XMLPUBFUN int XMLCALL xmlThrDefKeepBlanksDefaultValue(int v); - -XMLPUBFUN int * XMLCALL __xmlLineNumbersDefaultValue(void); -#ifdef LIBXML_THREAD_ENABLED -#define xmlLineNumbersDefaultValue \ -(*(__xmlLineNumbersDefaultValue())) -#else -XMLPUBVAR int xmlLineNumbersDefaultValue; -#endif -XMLPUBFUN int XMLCALL xmlThrDefLineNumbersDefaultValue(int v); - -XMLPUBFUN int * XMLCALL __xmlLoadExtDtdDefaultValue(void); -#ifdef LIBXML_THREAD_ENABLED -#define xmlLoadExtDtdDefaultValue \ -(*(__xmlLoadExtDtdDefaultValue())) -#else -XMLPUBVAR int xmlLoadExtDtdDefaultValue; -#endif -XMLPUBFUN int XMLCALL xmlThrDefLoadExtDtdDefaultValue(int v); - -XMLPUBFUN int * XMLCALL __xmlParserDebugEntities(void); -#ifdef LIBXML_THREAD_ENABLED -#define xmlParserDebugEntities \ -(*(__xmlParserDebugEntities())) -#else -XMLPUBVAR int xmlParserDebugEntities; -#endif -XMLPUBFUN int XMLCALL xmlThrDefParserDebugEntities(int v); - -XMLPUBFUN const char * * XMLCALL __xmlParserVersion(void); -#ifdef LIBXML_THREAD_ENABLED -#define xmlParserVersion \ -(*(__xmlParserVersion())) -#else -XMLPUBVAR const char * xmlParserVersion; -#endif - -XMLPUBFUN int * XMLCALL __xmlPedanticParserDefaultValue(void); -#ifdef LIBXML_THREAD_ENABLED -#define xmlPedanticParserDefaultValue \ -(*(__xmlPedanticParserDefaultValue())) -#else -XMLPUBVAR int xmlPedanticParserDefaultValue; -#endif -XMLPUBFUN int XMLCALL xmlThrDefPedanticParserDefaultValue(int v); - -XMLPUBFUN int * XMLCALL __xmlSaveNoEmptyTags(void); -#ifdef LIBXML_THREAD_ENABLED -#define xmlSaveNoEmptyTags \ -(*(__xmlSaveNoEmptyTags())) -#else -XMLPUBVAR int xmlSaveNoEmptyTags; -#endif -XMLPUBFUN int XMLCALL xmlThrDefSaveNoEmptyTags(int v); - -XMLPUBFUN int * XMLCALL __xmlSubstituteEntitiesDefaultValue(void); -#ifdef LIBXML_THREAD_ENABLED -#define xmlSubstituteEntitiesDefaultValue \ -(*(__xmlSubstituteEntitiesDefaultValue())) -#else -XMLPUBVAR int xmlSubstituteEntitiesDefaultValue; -#endif -XMLPUBFUN int XMLCALL xmlThrDefSubstituteEntitiesDefaultValue(int v); - -XMLPUBFUN xmlRegisterNodeFunc * XMLCALL __xmlRegisterNodeDefaultValue(void); -#ifdef LIBXML_THREAD_ENABLED -#define xmlRegisterNodeDefaultValue \ -(*(__xmlRegisterNodeDefaultValue())) -#else -XMLPUBVAR xmlRegisterNodeFunc xmlRegisterNodeDefaultValue; -#endif - -XMLPUBFUN xmlDeregisterNodeFunc * XMLCALL __xmlDeregisterNodeDefaultValue(void); -#ifdef LIBXML_THREAD_ENABLED -#define xmlDeregisterNodeDefaultValue \ -(*(__xmlDeregisterNodeDefaultValue())) -#else -XMLPUBVAR xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValue; -#endif - -XMLPUBFUN xmlParserInputBufferCreateFilenameFunc * XMLCALL __xmlParserInputBufferCreateFilenameValue(void); -#ifdef LIBXML_THREAD_ENABLED -#define xmlParserInputBufferCreateFilenameValue \ -(*(__xmlParserInputBufferCreateFilenameValue())) -#else -XMLPUBVAR xmlParserInputBufferCreateFilenameFunc xmlParserInputBufferCreateFilenameValue; -#endif - -XMLPUBFUN xmlOutputBufferCreateFilenameFunc * XMLCALL __xmlOutputBufferCreateFilenameValue(void); -#ifdef LIBXML_THREAD_ENABLED -#define xmlOutputBufferCreateFilenameValue \ -(*(__xmlOutputBufferCreateFilenameValue())) -#else -XMLPUBVAR xmlOutputBufferCreateFilenameFunc xmlOutputBufferCreateFilenameValue; -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* __XML_GLOBALS_H */ diff --git a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/hash.h b/cocos2dx/platform/third_party/emscripten/libxml2/libxml/hash.h deleted file mode 100644 index dc8ab7ec52..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/hash.h +++ /dev/null @@ -1,233 +0,0 @@ -/* - * Summary: Chained hash tables - * Description: This module implements the hash table support used in - * various places in the library. - * - * Copy: See Copyright for the status of this software. - * - * Author: Bjorn Reese - */ - -#ifndef __XML_HASH_H__ -#define __XML_HASH_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * The hash table. - */ -typedef struct _xmlHashTable xmlHashTable; -typedef xmlHashTable *xmlHashTablePtr; - -#ifdef __cplusplus -} -#endif - -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Recent version of gcc produce a warning when a function pointer is assigned - * to an object pointer, or vice versa. The following macro is a dirty hack - * to allow suppression of the warning. If your architecture has function - * pointers which are a different size than a void pointer, there may be some - * serious trouble within the library. - */ -/** - * XML_CAST_FPTR: - * @fptr: pointer to a function - * - * Macro to do a casting from an object pointer to a - * function pointer without encountering a warning from - * gcc - * - * #define XML_CAST_FPTR(fptr) (*(void **)(&fptr)) - * This macro violated ISO C aliasing rules (gcc4 on s390 broke) - * so it is disabled now - */ - -#define XML_CAST_FPTR(fptr) fptr - - -/* - * function types: - */ -/** - * xmlHashDeallocator: - * @payload: the data in the hash - * @name: the name associated - * - * Callback to free data from a hash. - */ -typedef void (*xmlHashDeallocator)(void *payload, xmlChar *name); -/** - * xmlHashCopier: - * @payload: the data in the hash - * @name: the name associated - * - * Callback to copy data from a hash. - * - * Returns a copy of the data or NULL in case of error. - */ -typedef void *(*xmlHashCopier)(void *payload, xmlChar *name); -/** - * xmlHashScanner: - * @payload: the data in the hash - * @data: extra scannner data - * @name: the name associated - * - * Callback when scanning data in a hash with the simple scanner. - */ -typedef void (*xmlHashScanner)(void *payload, void *data, xmlChar *name); -/** - * xmlHashScannerFull: - * @payload: the data in the hash - * @data: extra scannner data - * @name: the name associated - * @name2: the second name associated - * @name3: the third name associated - * - * Callback when scanning data in a hash with the full scanner. - */ -typedef void (*xmlHashScannerFull)(void *payload, void *data, - const xmlChar *name, const xmlChar *name2, - const xmlChar *name3); - -/* - * Constructor and destructor. - */ -XMLPUBFUN xmlHashTablePtr XMLCALL - xmlHashCreate (int size); -XMLPUBFUN xmlHashTablePtr XMLCALL - xmlHashCreateDict(int size, - xmlDictPtr dict); -XMLPUBFUN void XMLCALL - xmlHashFree (xmlHashTablePtr table, - xmlHashDeallocator f); - -/* - * Add a new entry to the hash table. - */ -XMLPUBFUN int XMLCALL - xmlHashAddEntry (xmlHashTablePtr table, - const xmlChar *name, - void *userdata); -XMLPUBFUN int XMLCALL - xmlHashUpdateEntry(xmlHashTablePtr table, - const xmlChar *name, - void *userdata, - xmlHashDeallocator f); -XMLPUBFUN int XMLCALL - xmlHashAddEntry2(xmlHashTablePtr table, - const xmlChar *name, - const xmlChar *name2, - void *userdata); -XMLPUBFUN int XMLCALL - xmlHashUpdateEntry2(xmlHashTablePtr table, - const xmlChar *name, - const xmlChar *name2, - void *userdata, - xmlHashDeallocator f); -XMLPUBFUN int XMLCALL - xmlHashAddEntry3(xmlHashTablePtr table, - const xmlChar *name, - const xmlChar *name2, - const xmlChar *name3, - void *userdata); -XMLPUBFUN int XMLCALL - xmlHashUpdateEntry3(xmlHashTablePtr table, - const xmlChar *name, - const xmlChar *name2, - const xmlChar *name3, - void *userdata, - xmlHashDeallocator f); - -/* - * Remove an entry from the hash table. - */ -XMLPUBFUN int XMLCALL - xmlHashRemoveEntry(xmlHashTablePtr table, const xmlChar *name, - xmlHashDeallocator f); -XMLPUBFUN int XMLCALL - xmlHashRemoveEntry2(xmlHashTablePtr table, const xmlChar *name, - const xmlChar *name2, xmlHashDeallocator f); -XMLPUBFUN int XMLCALL - xmlHashRemoveEntry3(xmlHashTablePtr table, const xmlChar *name, - const xmlChar *name2, const xmlChar *name3, - xmlHashDeallocator f); - -/* - * Retrieve the userdata. - */ -XMLPUBFUN void * XMLCALL - xmlHashLookup (xmlHashTablePtr table, - const xmlChar *name); -XMLPUBFUN void * XMLCALL - xmlHashLookup2 (xmlHashTablePtr table, - const xmlChar *name, - const xmlChar *name2); -XMLPUBFUN void * XMLCALL - xmlHashLookup3 (xmlHashTablePtr table, - const xmlChar *name, - const xmlChar *name2, - const xmlChar *name3); -XMLPUBFUN void * XMLCALL - xmlHashQLookup (xmlHashTablePtr table, - const xmlChar *name, - const xmlChar *prefix); -XMLPUBFUN void * XMLCALL - xmlHashQLookup2 (xmlHashTablePtr table, - const xmlChar *name, - const xmlChar *prefix, - const xmlChar *name2, - const xmlChar *prefix2); -XMLPUBFUN void * XMLCALL - xmlHashQLookup3 (xmlHashTablePtr table, - const xmlChar *name, - const xmlChar *prefix, - const xmlChar *name2, - const xmlChar *prefix2, - const xmlChar *name3, - const xmlChar *prefix3); - -/* - * Helpers. - */ -XMLPUBFUN xmlHashTablePtr XMLCALL - xmlHashCopy (xmlHashTablePtr table, - xmlHashCopier f); -XMLPUBFUN int XMLCALL - xmlHashSize (xmlHashTablePtr table); -XMLPUBFUN void XMLCALL - xmlHashScan (xmlHashTablePtr table, - xmlHashScanner f, - void *data); -XMLPUBFUN void XMLCALL - xmlHashScan3 (xmlHashTablePtr table, - const xmlChar *name, - const xmlChar *name2, - const xmlChar *name3, - xmlHashScanner f, - void *data); -XMLPUBFUN void XMLCALL - xmlHashScanFull (xmlHashTablePtr table, - xmlHashScannerFull f, - void *data); -XMLPUBFUN void XMLCALL - xmlHashScanFull3(xmlHashTablePtr table, - const xmlChar *name, - const xmlChar *name2, - const xmlChar *name3, - xmlHashScannerFull f, - void *data); -#ifdef __cplusplus -} -#endif -#endif /* ! __XML_HASH_H__ */ diff --git a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/list.h b/cocos2dx/platform/third_party/emscripten/libxml2/libxml/list.h deleted file mode 100644 index 0504e0cff4..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/list.h +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Summary: lists interfaces - * Description: this module implement the list support used in - * various place in the library. - * - * Copy: See Copyright for the status of this software. - * - * Author: Gary Pennington - */ - -#ifndef __XML_LINK_INCLUDE__ -#define __XML_LINK_INCLUDE__ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct _xmlLink xmlLink; -typedef xmlLink *xmlLinkPtr; - -typedef struct _xmlList xmlList; -typedef xmlList *xmlListPtr; - -/** - * xmlListDeallocator: - * @lk: the data to deallocate - * - * Callback function used to free data from a list. - */ -typedef void (*xmlListDeallocator) (xmlLinkPtr lk); -/** - * xmlListDataCompare: - * @data0: the first data - * @data1: the second data - * - * Callback function used to compare 2 data. - * - * Returns 0 is equality, -1 or 1 otherwise depending on the ordering. - */ -typedef int (*xmlListDataCompare) (const void *data0, const void *data1); -/** - * xmlListWalker: - * @data: the data found in the list - * @user: extra user provided data to the walker - * - * Callback function used when walking a list with xmlListWalk(). - * - * Returns 0 to stop walking the list, 1 otherwise. - */ -typedef int (*xmlListWalker) (const void *data, const void *user); - -/* Creation/Deletion */ -XMLPUBFUN xmlListPtr XMLCALL - xmlListCreate (xmlListDeallocator deallocator, - xmlListDataCompare compare); -XMLPUBFUN void XMLCALL - xmlListDelete (xmlListPtr l); - -/* Basic Operators */ -XMLPUBFUN void * XMLCALL - xmlListSearch (xmlListPtr l, - void *data); -XMLPUBFUN void * XMLCALL - xmlListReverseSearch (xmlListPtr l, - void *data); -XMLPUBFUN int XMLCALL - xmlListInsert (xmlListPtr l, - void *data) ; -XMLPUBFUN int XMLCALL - xmlListAppend (xmlListPtr l, - void *data) ; -XMLPUBFUN int XMLCALL - xmlListRemoveFirst (xmlListPtr l, - void *data); -XMLPUBFUN int XMLCALL - xmlListRemoveLast (xmlListPtr l, - void *data); -XMLPUBFUN int XMLCALL - xmlListRemoveAll (xmlListPtr l, - void *data); -XMLPUBFUN void XMLCALL - xmlListClear (xmlListPtr l); -XMLPUBFUN int XMLCALL - xmlListEmpty (xmlListPtr l); -XMLPUBFUN xmlLinkPtr XMLCALL - xmlListFront (xmlListPtr l); -XMLPUBFUN xmlLinkPtr XMLCALL - xmlListEnd (xmlListPtr l); -XMLPUBFUN int XMLCALL - xmlListSize (xmlListPtr l); - -XMLPUBFUN void XMLCALL - xmlListPopFront (xmlListPtr l); -XMLPUBFUN void XMLCALL - xmlListPopBack (xmlListPtr l); -XMLPUBFUN int XMLCALL - xmlListPushFront (xmlListPtr l, - void *data); -XMLPUBFUN int XMLCALL - xmlListPushBack (xmlListPtr l, - void *data); - -/* Advanced Operators */ -XMLPUBFUN void XMLCALL - xmlListReverse (xmlListPtr l); -XMLPUBFUN void XMLCALL - xmlListSort (xmlListPtr l); -XMLPUBFUN void XMLCALL - xmlListWalk (xmlListPtr l, - xmlListWalker walker, - const void *user); -XMLPUBFUN void XMLCALL - xmlListReverseWalk (xmlListPtr l, - xmlListWalker walker, - const void *user); -XMLPUBFUN void XMLCALL - xmlListMerge (xmlListPtr l1, - xmlListPtr l2); -XMLPUBFUN xmlListPtr XMLCALL - xmlListDup (const xmlListPtr old); -XMLPUBFUN int XMLCALL - xmlListCopy (xmlListPtr cur, - const xmlListPtr old); -/* Link operators */ -XMLPUBFUN void * XMLCALL - xmlLinkGetData (xmlLinkPtr lk); - -/* xmlListUnique() */ -/* xmlListSwap */ - -#ifdef __cplusplus -} -#endif - -#endif /* __XML_LINK_INCLUDE__ */ diff --git a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/nanoftp.h b/cocos2dx/platform/third_party/emscripten/libxml2/libxml/nanoftp.h deleted file mode 100644 index abb4bf7142..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/nanoftp.h +++ /dev/null @@ -1,163 +0,0 @@ -/* - * Summary: minimal FTP implementation - * Description: minimal FTP implementation allowing to fetch resources - * like external subset. - * - * Copy: See Copyright for the status of this software. - * - * Author: Daniel Veillard - */ - -#ifndef __NANO_FTP_H__ -#define __NANO_FTP_H__ - -#include - -#ifdef LIBXML_FTP_ENABLED - -/* Needed for portability to Windows 64 bits */ -#if defined(__MINGW32__) || defined(_WIN32_WCE) -#include -#else -/** - * SOCKET: - * - * macro used to provide portability of code to windows sockets - */ -#define SOCKET int -/** - * INVALID_SOCKET: - * - * macro used to provide portability of code to windows sockets - * the value to be used when the socket is not valid - */ -#undef INVALID_SOCKET -#define INVALID_SOCKET (-1) -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * ftpListCallback: - * @userData: user provided data for the callback - * @filename: the file name (including "->" when links are shown) - * @attrib: the attribute string - * @owner: the owner string - * @group: the group string - * @size: the file size - * @links: the link count - * @year: the year - * @month: the month - * @day: the day - * @hour: the hour - * @minute: the minute - * - * A callback for the xmlNanoFTPList command. - * Note that only one of year and day:minute are specified. - */ -typedef void (*ftpListCallback) (void *userData, - const char *filename, const char *attrib, - const char *owner, const char *group, - unsigned long size, int links, int year, - const char *month, int day, int hour, - int minute); -/** - * ftpDataCallback: - * @userData: the user provided context - * @data: the data received - * @len: its size in bytes - * - * A callback for the xmlNanoFTPGet command. - */ -typedef void (*ftpDataCallback) (void *userData, - const char *data, - int len); - -/* - * Init - */ -XMLPUBFUN void XMLCALL - xmlNanoFTPInit (void); -XMLPUBFUN void XMLCALL - xmlNanoFTPCleanup (void); - -/* - * Creating/freeing contexts. - */ -XMLPUBFUN void * XMLCALL - xmlNanoFTPNewCtxt (const char *URL); -XMLPUBFUN void XMLCALL - xmlNanoFTPFreeCtxt (void * ctx); -XMLPUBFUN void * XMLCALL - xmlNanoFTPConnectTo (const char *server, - int port); -/* - * Opening/closing session connections. - */ -XMLPUBFUN void * XMLCALL - xmlNanoFTPOpen (const char *URL); -XMLPUBFUN int XMLCALL - xmlNanoFTPConnect (void *ctx); -XMLPUBFUN int XMLCALL - xmlNanoFTPClose (void *ctx); -XMLPUBFUN int XMLCALL - xmlNanoFTPQuit (void *ctx); -XMLPUBFUN void XMLCALL - xmlNanoFTPScanProxy (const char *URL); -XMLPUBFUN void XMLCALL - xmlNanoFTPProxy (const char *host, - int port, - const char *user, - const char *passwd, - int type); -XMLPUBFUN int XMLCALL - xmlNanoFTPUpdateURL (void *ctx, - const char *URL); - -/* - * Rather internal commands. - */ -XMLPUBFUN int XMLCALL - xmlNanoFTPGetResponse (void *ctx); -XMLPUBFUN int XMLCALL - xmlNanoFTPCheckResponse (void *ctx); - -/* - * CD/DIR/GET handlers. - */ -XMLPUBFUN int XMLCALL - xmlNanoFTPCwd (void *ctx, - const char *directory); -XMLPUBFUN int XMLCALL - xmlNanoFTPDele (void *ctx, - const char *file); - -XMLPUBFUN SOCKET XMLCALL - xmlNanoFTPGetConnection (void *ctx); -XMLPUBFUN int XMLCALL - xmlNanoFTPCloseConnection(void *ctx); -XMLPUBFUN int XMLCALL - xmlNanoFTPList (void *ctx, - ftpListCallback callback, - void *userData, - const char *filename); -XMLPUBFUN SOCKET XMLCALL - xmlNanoFTPGetSocket (void *ctx, - const char *filename); -XMLPUBFUN int XMLCALL - xmlNanoFTPGet (void *ctx, - ftpDataCallback callback, - void *userData, - const char *filename); -XMLPUBFUN int XMLCALL - xmlNanoFTPRead (void *ctx, - void *dest, - int len); - -#ifdef __cplusplus -} -#endif -#endif /* LIBXML_FTP_ENABLED */ -#endif /* __NANO_FTP_H__ */ diff --git a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/nanohttp.h b/cocos2dx/platform/third_party/emscripten/libxml2/libxml/nanohttp.h deleted file mode 100644 index 22b8fb4338..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/nanohttp.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Summary: minimal HTTP implementation - * Description: minimal HTTP implementation allowing to fetch resources - * like external subset. - * - * Copy: See Copyright for the status of this software. - * - * Author: Daniel Veillard - */ - -#ifndef __NANO_HTTP_H__ -#define __NANO_HTTP_H__ - -#include - -#ifdef LIBXML_HTTP_ENABLED - -#ifdef __cplusplus -extern "C" { -#endif -XMLPUBFUN void XMLCALL - xmlNanoHTTPInit (void); -XMLPUBFUN void XMLCALL - xmlNanoHTTPCleanup (void); -XMLPUBFUN void XMLCALL - xmlNanoHTTPScanProxy (const char *URL); -XMLPUBFUN int XMLCALL - xmlNanoHTTPFetch (const char *URL, - const char *filename, - char **contentType); -XMLPUBFUN void * XMLCALL - xmlNanoHTTPMethod (const char *URL, - const char *method, - const char *input, - char **contentType, - const char *headers, - int ilen); -XMLPUBFUN void * XMLCALL - xmlNanoHTTPMethodRedir (const char *URL, - const char *method, - const char *input, - char **contentType, - char **redir, - const char *headers, - int ilen); -XMLPUBFUN void * XMLCALL - xmlNanoHTTPOpen (const char *URL, - char **contentType); -XMLPUBFUN void * XMLCALL - xmlNanoHTTPOpenRedir (const char *URL, - char **contentType, - char **redir); -XMLPUBFUN int XMLCALL - xmlNanoHTTPReturnCode (void *ctx); -XMLPUBFUN const char * XMLCALL - xmlNanoHTTPAuthHeader (void *ctx); -XMLPUBFUN const char * XMLCALL - xmlNanoHTTPRedir (void *ctx); -XMLPUBFUN int XMLCALL - xmlNanoHTTPContentLength( void * ctx ); -XMLPUBFUN const char * XMLCALL - xmlNanoHTTPEncoding (void *ctx); -XMLPUBFUN const char * XMLCALL - xmlNanoHTTPMimeType (void *ctx); -XMLPUBFUN int XMLCALL - xmlNanoHTTPRead (void *ctx, - void *dest, - int len); -#ifdef LIBXML_OUTPUT_ENABLED -XMLPUBFUN int XMLCALL - xmlNanoHTTPSave (void *ctxt, - const char *filename); -#endif /* LIBXML_OUTPUT_ENABLED */ -XMLPUBFUN void XMLCALL - xmlNanoHTTPClose (void *ctx); -#ifdef __cplusplus -} -#endif - -#endif /* LIBXML_HTTP_ENABLED */ -#endif /* __NANO_HTTP_H__ */ diff --git a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/parser.h b/cocos2dx/platform/third_party/emscripten/libxml2/libxml/parser.h deleted file mode 100644 index 3f5730dc61..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/parser.h +++ /dev/null @@ -1,1241 +0,0 @@ -/* - * Summary: the core parser module - * Description: Interfaces, constants and types related to the XML parser - * - * Copy: See Copyright for the status of this software. - * - * Author: Daniel Veillard - */ - -#ifndef __XML_PARSER_H__ -#define __XML_PARSER_H__ - -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * XML_DEFAULT_VERSION: - * - * The default version of XML used: 1.0 - */ -#define XML_DEFAULT_VERSION "1.0" - -/** - * xmlParserInput: - * - * An xmlParserInput is an input flow for the XML processor. - * Each entity parsed is associated an xmlParserInput (except the - * few predefined ones). This is the case both for internal entities - * - in which case the flow is already completely in memory - or - * external entities - in which case we use the buf structure for - * progressive reading and I18N conversions to the internal UTF-8 format. - */ - -/** - * xmlParserInputDeallocate: - * @str: the string to deallocate - * - * Callback for freeing some parser input allocations. - */ -typedef void (* xmlParserInputDeallocate)(xmlChar *str); - -struct _xmlParserInput { - /* Input buffer */ - xmlParserInputBufferPtr buf; /* UTF-8 encoded buffer */ - - const char *filename; /* The file analyzed, if any */ - const char *directory; /* the directory/base of the file */ - const xmlChar *base; /* Base of the array to parse */ - const xmlChar *cur; /* Current char being parsed */ - const xmlChar *end; /* end of the array to parse */ - int length; /* length if known */ - int line; /* Current line */ - int col; /* Current column */ - /* - * NOTE: consumed is only tested for equality in the parser code, - * so even if there is an overflow this should not give troubles - * for parsing very large instances. - */ - unsigned long consumed; /* How many xmlChars already consumed */ - xmlParserInputDeallocate free; /* function to deallocate the base */ - const xmlChar *encoding; /* the encoding string for entity */ - const xmlChar *version; /* the version string for entity */ - int standalone; /* Was that entity marked standalone */ - int id; /* an unique identifier for the entity */ -}; - -/** - * xmlParserNodeInfo: - * - * The parser can be asked to collect Node informations, i.e. at what - * place in the file they were detected. - * NOTE: This is off by default and not very well tested. - */ -typedef struct _xmlParserNodeInfo xmlParserNodeInfo; -typedef xmlParserNodeInfo *xmlParserNodeInfoPtr; - -struct _xmlParserNodeInfo { - const struct _xmlNode* node; - /* Position & line # that text that created the node begins & ends on */ - unsigned long begin_pos; - unsigned long begin_line; - unsigned long end_pos; - unsigned long end_line; -}; - -typedef struct _xmlParserNodeInfoSeq xmlParserNodeInfoSeq; -typedef xmlParserNodeInfoSeq *xmlParserNodeInfoSeqPtr; -struct _xmlParserNodeInfoSeq { - unsigned long maximum; - unsigned long length; - xmlParserNodeInfo* buffer; -}; - -/** - * xmlParserInputState: - * - * The parser is now working also as a state based parser. - * The recursive one use the state info for entities processing. - */ -typedef enum { - XML_PARSER_EOF = -1, /* nothing is to be parsed */ - XML_PARSER_START = 0, /* nothing has been parsed */ - XML_PARSER_MISC, /* Misc* before int subset */ - XML_PARSER_PI, /* Within a processing instruction */ - XML_PARSER_DTD, /* within some DTD content */ - XML_PARSER_PROLOG, /* Misc* after internal subset */ - XML_PARSER_COMMENT, /* within a comment */ - XML_PARSER_START_TAG, /* within a start tag */ - XML_PARSER_CONTENT, /* within the content */ - XML_PARSER_CDATA_SECTION, /* within a CDATA section */ - XML_PARSER_END_TAG, /* within a closing tag */ - XML_PARSER_ENTITY_DECL, /* within an entity declaration */ - XML_PARSER_ENTITY_VALUE, /* within an entity value in a decl */ - XML_PARSER_ATTRIBUTE_VALUE, /* within an attribute value */ - XML_PARSER_SYSTEM_LITERAL, /* within a SYSTEM value */ - XML_PARSER_EPILOG, /* the Misc* after the last end tag */ - XML_PARSER_IGNORE, /* within an IGNORED section */ - XML_PARSER_PUBLIC_LITERAL /* within a PUBLIC value */ -} xmlParserInputState; - -/** - * XML_DETECT_IDS: - * - * Bit in the loadsubset context field to tell to do ID/REFs lookups. - * Use it to initialize xmlLoadExtDtdDefaultValue. - */ -#define XML_DETECT_IDS 2 - -/** - * XML_COMPLETE_ATTRS: - * - * Bit in the loadsubset context field to tell to do complete the - * elements attributes lists with the ones defaulted from the DTDs. - * Use it to initialize xmlLoadExtDtdDefaultValue. - */ -#define XML_COMPLETE_ATTRS 4 - -/** - * XML_SKIP_IDS: - * - * Bit in the loadsubset context field to tell to not do ID/REFs registration. - * Used to initialize xmlLoadExtDtdDefaultValue in some special cases. - */ -#define XML_SKIP_IDS 8 - -/** - * xmlParserMode: - * - * A parser can operate in various modes - */ -typedef enum { - XML_PARSE_UNKNOWN = 0, - XML_PARSE_DOM = 1, - XML_PARSE_SAX = 2, - XML_PARSE_PUSH_DOM = 3, - XML_PARSE_PUSH_SAX = 4, - XML_PARSE_READER = 5 -} xmlParserMode; - -/** - * xmlParserCtxt: - * - * The parser context. - * NOTE This doesn't completely define the parser state, the (current ?) - * design of the parser uses recursive function calls since this allow - * and easy mapping from the production rules of the specification - * to the actual code. The drawback is that the actual function call - * also reflect the parser state. However most of the parsing routines - * takes as the only argument the parser context pointer, so migrating - * to a state based parser for progressive parsing shouldn't be too hard. - */ -struct _xmlParserCtxt { - struct _xmlSAXHandler *sax; /* The SAX handler */ - void *userData; /* For SAX interface only, used by DOM build */ - xmlDocPtr myDoc; /* the document being built */ - int wellFormed; /* is the document well formed */ - int replaceEntities; /* shall we replace entities ? */ - const xmlChar *version; /* the XML version string */ - const xmlChar *encoding; /* the declared encoding, if any */ - int standalone; /* standalone document */ - int html; /* an HTML(1)/Docbook(2) document - * 3 is HTML after - * 10 is HTML after - */ - - /* Input stream stack */ - xmlParserInputPtr input; /* Current input stream */ - int inputNr; /* Number of current input streams */ - int inputMax; /* Max number of input streams */ - xmlParserInputPtr *inputTab; /* stack of inputs */ - - /* Node analysis stack only used for DOM building */ - xmlNodePtr node; /* Current parsed Node */ - int nodeNr; /* Depth of the parsing stack */ - int nodeMax; /* Max depth of the parsing stack */ - xmlNodePtr *nodeTab; /* array of nodes */ - - int record_info; /* Whether node info should be kept */ - xmlParserNodeInfoSeq node_seq; /* info about each node parsed */ - - int errNo; /* error code */ - - int hasExternalSubset; /* reference and external subset */ - int hasPErefs; /* the internal subset has PE refs */ - int external; /* are we parsing an external entity */ - - int valid; /* is the document valid */ - int validate; /* shall we try to validate ? */ - xmlValidCtxt vctxt; /* The validity context */ - - xmlParserInputState instate; /* current type of input */ - int token; /* next char look-ahead */ - - char *directory; /* the data directory */ - - /* Node name stack */ - const xmlChar *name; /* Current parsed Node */ - int nameNr; /* Depth of the parsing stack */ - int nameMax; /* Max depth of the parsing stack */ - const xmlChar * *nameTab; /* array of nodes */ - - long nbChars; /* number of xmlChar processed */ - long checkIndex; /* used by progressive parsing lookup */ - int keepBlanks; /* ugly but ... */ - int disableSAX; /* SAX callbacks are disabled */ - int inSubset; /* Parsing is in int 1/ext 2 subset */ - const xmlChar * intSubName; /* name of subset */ - xmlChar * extSubURI; /* URI of external subset */ - xmlChar * extSubSystem; /* SYSTEM ID of external subset */ - - /* xml:space values */ - int * space; /* Should the parser preserve spaces */ - int spaceNr; /* Depth of the parsing stack */ - int spaceMax; /* Max depth of the parsing stack */ - int * spaceTab; /* array of space infos */ - - int depth; /* to prevent entity substitution loops */ - xmlParserInputPtr entity; /* used to check entities boundaries */ - int charset; /* encoding of the in-memory content - actually an xmlCharEncoding */ - int nodelen; /* Those two fields are there to */ - int nodemem; /* Speed up large node parsing */ - int pedantic; /* signal pedantic warnings */ - void *_private; /* For user data, libxml won't touch it */ - - int loadsubset; /* should the external subset be loaded */ - int linenumbers; /* set line number in element content */ - void *catalogs; /* document's own catalog */ - int recovery; /* run in recovery mode */ - int progressive; /* is this a progressive parsing */ - xmlDictPtr dict; /* dictionnary for the parser */ - const xmlChar * *atts; /* array for the attributes callbacks */ - int maxatts; /* the size of the array */ - int docdict; /* use strings from dict to build tree */ - - /* - * pre-interned strings - */ - const xmlChar *str_xml; - const xmlChar *str_xmlns; - const xmlChar *str_xml_ns; - - /* - * Everything below is used only by the new SAX mode - */ - int sax2; /* operating in the new SAX mode */ - int nsNr; /* the number of inherited namespaces */ - int nsMax; /* the size of the arrays */ - const xmlChar * *nsTab; /* the array of prefix/namespace name */ - int *attallocs; /* which attribute were allocated */ - void * *pushTab; /* array of data for push */ - xmlHashTablePtr attsDefault; /* defaulted attributes if any */ - xmlHashTablePtr attsSpecial; /* non-CDATA attributes if any */ - int nsWellFormed; /* is the document XML Nanespace okay */ - int options; /* Extra options */ - - /* - * Those fields are needed only for treaming parsing so far - */ - int dictNames; /* Use dictionary names for the tree */ - int freeElemsNr; /* number of freed element nodes */ - xmlNodePtr freeElems; /* List of freed element nodes */ - int freeAttrsNr; /* number of freed attributes nodes */ - xmlAttrPtr freeAttrs; /* List of freed attributes nodes */ - - /* - * the complete error informations for the last error. - */ - xmlError lastError; - xmlParserMode parseMode; /* the parser mode */ - unsigned long nbentities; /* number of entities references */ - unsigned long sizeentities; /* size of parsed entities */ - - /* for use by HTML non-recursive parser */ - xmlParserNodeInfo *nodeInfo; /* Current NodeInfo */ - int nodeInfoNr; /* Depth of the parsing stack */ - int nodeInfoMax; /* Max depth of the parsing stack */ - xmlParserNodeInfo *nodeInfoTab; /* array of nodeInfos */ - - int input_id; /* we need to label inputs */ - unsigned long sizeentcopy; /* volume of entity copy */ -}; - -/** - * xmlSAXLocator: - * - * A SAX Locator. - */ -struct _xmlSAXLocator { - const xmlChar *(*getPublicId)(void *ctx); - const xmlChar *(*getSystemId)(void *ctx); - int (*getLineNumber)(void *ctx); - int (*getColumnNumber)(void *ctx); -}; - -/** - * xmlSAXHandler: - * - * A SAX handler is bunch of callbacks called by the parser when processing - * of the input generate data or structure informations. - */ - -/** - * resolveEntitySAXFunc: - * @ctx: the user data (XML parser context) - * @publicId: The public ID of the entity - * @systemId: The system ID of the entity - * - * Callback: - * The entity loader, to control the loading of external entities, - * the application can either: - * - override this resolveEntity() callback in the SAX block - * - or better use the xmlSetExternalEntityLoader() function to - * set up it's own entity resolution routine - * - * Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour. - */ -typedef xmlParserInputPtr (*resolveEntitySAXFunc) (void *ctx, - const xmlChar *publicId, - const xmlChar *systemId); -/** - * internalSubsetSAXFunc: - * @ctx: the user data (XML parser context) - * @name: the root element name - * @ExternalID: the external ID - * @SystemID: the SYSTEM ID (e.g. filename or URL) - * - * Callback on internal subset declaration. - */ -typedef void (*internalSubsetSAXFunc) (void *ctx, - const xmlChar *name, - const xmlChar *ExternalID, - const xmlChar *SystemID); -/** - * externalSubsetSAXFunc: - * @ctx: the user data (XML parser context) - * @name: the root element name - * @ExternalID: the external ID - * @SystemID: the SYSTEM ID (e.g. filename or URL) - * - * Callback on external subset declaration. - */ -typedef void (*externalSubsetSAXFunc) (void *ctx, - const xmlChar *name, - const xmlChar *ExternalID, - const xmlChar *SystemID); -/** - * getEntitySAXFunc: - * @ctx: the user data (XML parser context) - * @name: The entity name - * - * Get an entity by name. - * - * Returns the xmlEntityPtr if found. - */ -typedef xmlEntityPtr (*getEntitySAXFunc) (void *ctx, - const xmlChar *name); -/** - * getParameterEntitySAXFunc: - * @ctx: the user data (XML parser context) - * @name: The entity name - * - * Get a parameter entity by name. - * - * Returns the xmlEntityPtr if found. - */ -typedef xmlEntityPtr (*getParameterEntitySAXFunc) (void *ctx, - const xmlChar *name); -/** - * entityDeclSAXFunc: - * @ctx: the user data (XML parser context) - * @name: the entity name - * @type: the entity type - * @publicId: The public ID of the entity - * @systemId: The system ID of the entity - * @content: the entity value (without processing). - * - * An entity definition has been parsed. - */ -typedef void (*entityDeclSAXFunc) (void *ctx, - const xmlChar *name, - int type, - const xmlChar *publicId, - const xmlChar *systemId, - xmlChar *content); -/** - * notationDeclSAXFunc: - * @ctx: the user data (XML parser context) - * @name: The name of the notation - * @publicId: The public ID of the entity - * @systemId: The system ID of the entity - * - * What to do when a notation declaration has been parsed. - */ -typedef void (*notationDeclSAXFunc)(void *ctx, - const xmlChar *name, - const xmlChar *publicId, - const xmlChar *systemId); -/** - * attributeDeclSAXFunc: - * @ctx: the user data (XML parser context) - * @elem: the name of the element - * @fullname: the attribute name - * @type: the attribute type - * @def: the type of default value - * @defaultValue: the attribute default value - * @tree: the tree of enumerated value set - * - * An attribute definition has been parsed. - */ -typedef void (*attributeDeclSAXFunc)(void *ctx, - const xmlChar *elem, - const xmlChar *fullname, - int type, - int def, - const xmlChar *defaultValue, - xmlEnumerationPtr tree); -/** - * elementDeclSAXFunc: - * @ctx: the user data (XML parser context) - * @name: the element name - * @type: the element type - * @content: the element value tree - * - * An element definition has been parsed. - */ -typedef void (*elementDeclSAXFunc)(void *ctx, - const xmlChar *name, - int type, - xmlElementContentPtr content); -/** - * unparsedEntityDeclSAXFunc: - * @ctx: the user data (XML parser context) - * @name: The name of the entity - * @publicId: The public ID of the entity - * @systemId: The system ID of the entity - * @notationName: the name of the notation - * - * What to do when an unparsed entity declaration is parsed. - */ -typedef void (*unparsedEntityDeclSAXFunc)(void *ctx, - const xmlChar *name, - const xmlChar *publicId, - const xmlChar *systemId, - const xmlChar *notationName); -/** - * setDocumentLocatorSAXFunc: - * @ctx: the user data (XML parser context) - * @loc: A SAX Locator - * - * Receive the document locator at startup, actually xmlDefaultSAXLocator. - * Everything is available on the context, so this is useless in our case. - */ -typedef void (*setDocumentLocatorSAXFunc) (void *ctx, - xmlSAXLocatorPtr loc); -/** - * startDocumentSAXFunc: - * @ctx: the user data (XML parser context) - * - * Called when the document start being processed. - */ -typedef void (*startDocumentSAXFunc) (void *ctx); -/** - * endDocumentSAXFunc: - * @ctx: the user data (XML parser context) - * - * Called when the document end has been detected. - */ -typedef void (*endDocumentSAXFunc) (void *ctx); -/** - * startElementSAXFunc: - * @ctx: the user data (XML parser context) - * @name: The element name, including namespace prefix - * @atts: An array of name/value attributes pairs, NULL terminated - * - * Called when an opening tag has been processed. - */ -typedef void (*startElementSAXFunc) (void *ctx, - const xmlChar *name, - const xmlChar **atts); -/** - * endElementSAXFunc: - * @ctx: the user data (XML parser context) - * @name: The element name - * - * Called when the end of an element has been detected. - */ -typedef void (*endElementSAXFunc) (void *ctx, - const xmlChar *name); -/** - * attributeSAXFunc: - * @ctx: the user data (XML parser context) - * @name: The attribute name, including namespace prefix - * @value: The attribute value - * - * Handle an attribute that has been read by the parser. - * The default handling is to convert the attribute into an - * DOM subtree and past it in a new xmlAttr element added to - * the element. - */ -typedef void (*attributeSAXFunc) (void *ctx, - const xmlChar *name, - const xmlChar *value); -/** - * referenceSAXFunc: - * @ctx: the user data (XML parser context) - * @name: The entity name - * - * Called when an entity reference is detected. - */ -typedef void (*referenceSAXFunc) (void *ctx, - const xmlChar *name); -/** - * charactersSAXFunc: - * @ctx: the user data (XML parser context) - * @ch: a xmlChar string - * @len: the number of xmlChar - * - * Receiving some chars from the parser. - */ -typedef void (*charactersSAXFunc) (void *ctx, - const xmlChar *ch, - int len); -/** - * ignorableWhitespaceSAXFunc: - * @ctx: the user data (XML parser context) - * @ch: a xmlChar string - * @len: the number of xmlChar - * - * Receiving some ignorable whitespaces from the parser. - * UNUSED: by default the DOM building will use characters. - */ -typedef void (*ignorableWhitespaceSAXFunc) (void *ctx, - const xmlChar *ch, - int len); -/** - * processingInstructionSAXFunc: - * @ctx: the user data (XML parser context) - * @target: the target name - * @data: the PI data's - * - * A processing instruction has been parsed. - */ -typedef void (*processingInstructionSAXFunc) (void *ctx, - const xmlChar *target, - const xmlChar *data); -/** - * commentSAXFunc: - * @ctx: the user data (XML parser context) - * @value: the comment content - * - * A comment has been parsed. - */ -typedef void (*commentSAXFunc) (void *ctx, - const xmlChar *value); -/** - * cdataBlockSAXFunc: - * @ctx: the user data (XML parser context) - * @value: The pcdata content - * @len: the block length - * - * Called when a pcdata block has been parsed. - */ -typedef void (*cdataBlockSAXFunc) ( - void *ctx, - const xmlChar *value, - int len); -/** - * warningSAXFunc: - * @ctx: an XML parser context - * @msg: the message to display/transmit - * @...: extra parameters for the message display - * - * Display and format a warning messages, callback. - */ -typedef void (XMLCDECL *warningSAXFunc) (void *ctx, - const char *msg, ...) LIBXML_ATTR_FORMAT(2,3); -/** - * errorSAXFunc: - * @ctx: an XML parser context - * @msg: the message to display/transmit - * @...: extra parameters for the message display - * - * Display and format an error messages, callback. - */ -typedef void (XMLCDECL *errorSAXFunc) (void *ctx, - const char *msg, ...) LIBXML_ATTR_FORMAT(2,3); -/** - * fatalErrorSAXFunc: - * @ctx: an XML parser context - * @msg: the message to display/transmit - * @...: extra parameters for the message display - * - * Display and format fatal error messages, callback. - * Note: so far fatalError() SAX callbacks are not used, error() - * get all the callbacks for errors. - */ -typedef void (XMLCDECL *fatalErrorSAXFunc) (void *ctx, - const char *msg, ...) LIBXML_ATTR_FORMAT(2,3); -/** - * isStandaloneSAXFunc: - * @ctx: the user data (XML parser context) - * - * Is this document tagged standalone? - * - * Returns 1 if true - */ -typedef int (*isStandaloneSAXFunc) (void *ctx); -/** - * hasInternalSubsetSAXFunc: - * @ctx: the user data (XML parser context) - * - * Does this document has an internal subset. - * - * Returns 1 if true - */ -typedef int (*hasInternalSubsetSAXFunc) (void *ctx); - -/** - * hasExternalSubsetSAXFunc: - * @ctx: the user data (XML parser context) - * - * Does this document has an external subset? - * - * Returns 1 if true - */ -typedef int (*hasExternalSubsetSAXFunc) (void *ctx); - -/************************************************************************ - * * - * The SAX version 2 API extensions * - * * - ************************************************************************/ -/** - * XML_SAX2_MAGIC: - * - * Special constant found in SAX2 blocks initialized fields - */ -#define XML_SAX2_MAGIC 0xDEEDBEAF - -/** - * startElementNsSAX2Func: - * @ctx: the user data (XML parser context) - * @localname: the local name of the element - * @prefix: the element namespace prefix if available - * @URI: the element namespace name if available - * @nb_namespaces: number of namespace definitions on that node - * @namespaces: pointer to the array of prefix/URI pairs namespace definitions - * @nb_attributes: the number of attributes on that node - * @nb_defaulted: the number of defaulted attributes. The defaulted - * ones are at the end of the array - * @attributes: pointer to the array of (localname/prefix/URI/value/end) - * attribute values. - * - * SAX2 callback when an element start has been detected by the parser. - * It provides the namespace informations for the element, as well as - * the new namespace declarations on the element. - */ - -typedef void (*startElementNsSAX2Func) (void *ctx, - const xmlChar *localname, - const xmlChar *prefix, - const xmlChar *URI, - int nb_namespaces, - const xmlChar **namespaces, - int nb_attributes, - int nb_defaulted, - const xmlChar **attributes); - -/** - * endElementNsSAX2Func: - * @ctx: the user data (XML parser context) - * @localname: the local name of the element - * @prefix: the element namespace prefix if available - * @URI: the element namespace name if available - * - * SAX2 callback when an element end has been detected by the parser. - * It provides the namespace informations for the element. - */ - -typedef void (*endElementNsSAX2Func) (void *ctx, - const xmlChar *localname, - const xmlChar *prefix, - const xmlChar *URI); - - -struct _xmlSAXHandler { - internalSubsetSAXFunc internalSubset; - isStandaloneSAXFunc isStandalone; - hasInternalSubsetSAXFunc hasInternalSubset; - hasExternalSubsetSAXFunc hasExternalSubset; - resolveEntitySAXFunc resolveEntity; - getEntitySAXFunc getEntity; - entityDeclSAXFunc entityDecl; - notationDeclSAXFunc notationDecl; - attributeDeclSAXFunc attributeDecl; - elementDeclSAXFunc elementDecl; - unparsedEntityDeclSAXFunc unparsedEntityDecl; - setDocumentLocatorSAXFunc setDocumentLocator; - startDocumentSAXFunc startDocument; - endDocumentSAXFunc endDocument; - startElementSAXFunc startElement; - endElementSAXFunc endElement; - referenceSAXFunc reference; - charactersSAXFunc characters; - ignorableWhitespaceSAXFunc ignorableWhitespace; - processingInstructionSAXFunc processingInstruction; - commentSAXFunc comment; - warningSAXFunc warning; - errorSAXFunc error; - fatalErrorSAXFunc fatalError; /* unused error() get all the errors */ - getParameterEntitySAXFunc getParameterEntity; - cdataBlockSAXFunc cdataBlock; - externalSubsetSAXFunc externalSubset; - unsigned int initialized; - /* The following fields are extensions available only on version 2 */ - void *_private; - startElementNsSAX2Func startElementNs; - endElementNsSAX2Func endElementNs; - xmlStructuredErrorFunc serror; -}; - -/* - * SAX Version 1 - */ -typedef struct _xmlSAXHandlerV1 xmlSAXHandlerV1; -typedef xmlSAXHandlerV1 *xmlSAXHandlerV1Ptr; -struct _xmlSAXHandlerV1 { - internalSubsetSAXFunc internalSubset; - isStandaloneSAXFunc isStandalone; - hasInternalSubsetSAXFunc hasInternalSubset; - hasExternalSubsetSAXFunc hasExternalSubset; - resolveEntitySAXFunc resolveEntity; - getEntitySAXFunc getEntity; - entityDeclSAXFunc entityDecl; - notationDeclSAXFunc notationDecl; - attributeDeclSAXFunc attributeDecl; - elementDeclSAXFunc elementDecl; - unparsedEntityDeclSAXFunc unparsedEntityDecl; - setDocumentLocatorSAXFunc setDocumentLocator; - startDocumentSAXFunc startDocument; - endDocumentSAXFunc endDocument; - startElementSAXFunc startElement; - endElementSAXFunc endElement; - referenceSAXFunc reference; - charactersSAXFunc characters; - ignorableWhitespaceSAXFunc ignorableWhitespace; - processingInstructionSAXFunc processingInstruction; - commentSAXFunc comment; - warningSAXFunc warning; - errorSAXFunc error; - fatalErrorSAXFunc fatalError; /* unused error() get all the errors */ - getParameterEntitySAXFunc getParameterEntity; - cdataBlockSAXFunc cdataBlock; - externalSubsetSAXFunc externalSubset; - unsigned int initialized; -}; - - -/** - * xmlExternalEntityLoader: - * @URL: The System ID of the resource requested - * @ID: The Public ID of the resource requested - * @context: the XML parser context - * - * External entity loaders types. - * - * Returns the entity input parser. - */ -typedef xmlParserInputPtr (*xmlExternalEntityLoader) (const char *URL, - const char *ID, - xmlParserCtxtPtr context); - -#ifdef __cplusplus -} -#endif - -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - - -/* - * Init/Cleanup - */ -XMLPUBFUN void XMLCALL - xmlInitParser (void); -XMLPUBFUN void XMLCALL - xmlCleanupParser (void); - -/* - * Input functions - */ -XMLPUBFUN int XMLCALL - xmlParserInputRead (xmlParserInputPtr in, - int len); -XMLPUBFUN int XMLCALL - xmlParserInputGrow (xmlParserInputPtr in, - int len); - -/* - * Basic parsing Interfaces - */ -#ifdef LIBXML_SAX1_ENABLED -XMLPUBFUN xmlDocPtr XMLCALL - xmlParseDoc (const xmlChar *cur); -XMLPUBFUN xmlDocPtr XMLCALL - xmlParseFile (const char *filename); -XMLPUBFUN xmlDocPtr XMLCALL - xmlParseMemory (const char *buffer, - int size); -#endif /* LIBXML_SAX1_ENABLED */ -XMLPUBFUN int XMLCALL - xmlSubstituteEntitiesDefault(int val); -XMLPUBFUN int XMLCALL - xmlKeepBlanksDefault (int val); -XMLPUBFUN void XMLCALL - xmlStopParser (xmlParserCtxtPtr ctxt); -XMLPUBFUN int XMLCALL - xmlPedanticParserDefault(int val); -XMLPUBFUN int XMLCALL - xmlLineNumbersDefault (int val); - -#ifdef LIBXML_SAX1_ENABLED -/* - * Recovery mode - */ -XMLPUBFUN xmlDocPtr XMLCALL - xmlRecoverDoc (const xmlChar *cur); -XMLPUBFUN xmlDocPtr XMLCALL - xmlRecoverMemory (const char *buffer, - int size); -XMLPUBFUN xmlDocPtr XMLCALL - xmlRecoverFile (const char *filename); -#endif /* LIBXML_SAX1_ENABLED */ - -/* - * Less common routines and SAX interfaces - */ -XMLPUBFUN int XMLCALL - xmlParseDocument (xmlParserCtxtPtr ctxt); -XMLPUBFUN int XMLCALL - xmlParseExtParsedEnt (xmlParserCtxtPtr ctxt); -#ifdef LIBXML_SAX1_ENABLED -XMLPUBFUN int XMLCALL - xmlSAXUserParseFile (xmlSAXHandlerPtr sax, - void *user_data, - const char *filename); -XMLPUBFUN int XMLCALL - xmlSAXUserParseMemory (xmlSAXHandlerPtr sax, - void *user_data, - const char *buffer, - int size); -XMLPUBFUN xmlDocPtr XMLCALL - xmlSAXParseDoc (xmlSAXHandlerPtr sax, - const xmlChar *cur, - int recovery); -XMLPUBFUN xmlDocPtr XMLCALL - xmlSAXParseMemory (xmlSAXHandlerPtr sax, - const char *buffer, - int size, - int recovery); -XMLPUBFUN xmlDocPtr XMLCALL - xmlSAXParseMemoryWithData (xmlSAXHandlerPtr sax, - const char *buffer, - int size, - int recovery, - void *data); -XMLPUBFUN xmlDocPtr XMLCALL - xmlSAXParseFile (xmlSAXHandlerPtr sax, - const char *filename, - int recovery); -XMLPUBFUN xmlDocPtr XMLCALL - xmlSAXParseFileWithData (xmlSAXHandlerPtr sax, - const char *filename, - int recovery, - void *data); -XMLPUBFUN xmlDocPtr XMLCALL - xmlSAXParseEntity (xmlSAXHandlerPtr sax, - const char *filename); -XMLPUBFUN xmlDocPtr XMLCALL - xmlParseEntity (const char *filename); -#endif /* LIBXML_SAX1_ENABLED */ - -#ifdef LIBXML_VALID_ENABLED -XMLPUBFUN xmlDtdPtr XMLCALL - xmlSAXParseDTD (xmlSAXHandlerPtr sax, - const xmlChar *ExternalID, - const xmlChar *SystemID); -XMLPUBFUN xmlDtdPtr XMLCALL - xmlParseDTD (const xmlChar *ExternalID, - const xmlChar *SystemID); -XMLPUBFUN xmlDtdPtr XMLCALL - xmlIOParseDTD (xmlSAXHandlerPtr sax, - xmlParserInputBufferPtr input, - xmlCharEncoding enc); -#endif /* LIBXML_VALID_ENABLE */ -#ifdef LIBXML_SAX1_ENABLED -XMLPUBFUN int XMLCALL - xmlParseBalancedChunkMemory(xmlDocPtr doc, - xmlSAXHandlerPtr sax, - void *user_data, - int depth, - const xmlChar *string, - xmlNodePtr *lst); -#endif /* LIBXML_SAX1_ENABLED */ -XMLPUBFUN xmlParserErrors XMLCALL - xmlParseInNodeContext (xmlNodePtr node, - const char *data, - int datalen, - int options, - xmlNodePtr *lst); -#ifdef LIBXML_SAX1_ENABLED -XMLPUBFUN int XMLCALL - xmlParseBalancedChunkMemoryRecover(xmlDocPtr doc, - xmlSAXHandlerPtr sax, - void *user_data, - int depth, - const xmlChar *string, - xmlNodePtr *lst, - int recover); -XMLPUBFUN int XMLCALL - xmlParseExternalEntity (xmlDocPtr doc, - xmlSAXHandlerPtr sax, - void *user_data, - int depth, - const xmlChar *URL, - const xmlChar *ID, - xmlNodePtr *lst); -#endif /* LIBXML_SAX1_ENABLED */ -XMLPUBFUN int XMLCALL - xmlParseCtxtExternalEntity(xmlParserCtxtPtr ctx, - const xmlChar *URL, - const xmlChar *ID, - xmlNodePtr *lst); - -/* - * Parser contexts handling. - */ -XMLPUBFUN xmlParserCtxtPtr XMLCALL - xmlNewParserCtxt (void); -XMLPUBFUN int XMLCALL - xmlInitParserCtxt (xmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL - xmlClearParserCtxt (xmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL - xmlFreeParserCtxt (xmlParserCtxtPtr ctxt); -#ifdef LIBXML_SAX1_ENABLED -XMLPUBFUN void XMLCALL - xmlSetupParserForBuffer (xmlParserCtxtPtr ctxt, - const xmlChar* buffer, - const char *filename); -#endif /* LIBXML_SAX1_ENABLED */ -XMLPUBFUN xmlParserCtxtPtr XMLCALL - xmlCreateDocParserCtxt (const xmlChar *cur); - -#ifdef LIBXML_LEGACY_ENABLED -/* - * Reading/setting optional parsing features. - */ -XMLPUBFUN int XMLCALL - xmlGetFeaturesList (int *len, - const char **result); -XMLPUBFUN int XMLCALL - xmlGetFeature (xmlParserCtxtPtr ctxt, - const char *name, - void *result); -XMLPUBFUN int XMLCALL - xmlSetFeature (xmlParserCtxtPtr ctxt, - const char *name, - void *value); -#endif /* LIBXML_LEGACY_ENABLED */ - -#ifdef LIBXML_PUSH_ENABLED -/* - * Interfaces for the Push mode. - */ -XMLPUBFUN xmlParserCtxtPtr XMLCALL - xmlCreatePushParserCtxt(xmlSAXHandlerPtr sax, - void *user_data, - const char *chunk, - int size, - const char *filename); -XMLPUBFUN int XMLCALL - xmlParseChunk (xmlParserCtxtPtr ctxt, - const char *chunk, - int size, - int terminate); -#endif /* LIBXML_PUSH_ENABLED */ - -/* - * Special I/O mode. - */ - -XMLPUBFUN xmlParserCtxtPtr XMLCALL - xmlCreateIOParserCtxt (xmlSAXHandlerPtr sax, - void *user_data, - xmlInputReadCallback ioread, - xmlInputCloseCallback ioclose, - void *ioctx, - xmlCharEncoding enc); - -XMLPUBFUN xmlParserInputPtr XMLCALL - xmlNewIOInputStream (xmlParserCtxtPtr ctxt, - xmlParserInputBufferPtr input, - xmlCharEncoding enc); - -/* - * Node infos. - */ -XMLPUBFUN const xmlParserNodeInfo* XMLCALL - xmlParserFindNodeInfo (const xmlParserCtxtPtr ctxt, - const xmlNodePtr node); -XMLPUBFUN void XMLCALL - xmlInitNodeInfoSeq (xmlParserNodeInfoSeqPtr seq); -XMLPUBFUN void XMLCALL - xmlClearNodeInfoSeq (xmlParserNodeInfoSeqPtr seq); -XMLPUBFUN unsigned long XMLCALL - xmlParserFindNodeInfoIndex(const xmlParserNodeInfoSeqPtr seq, - const xmlNodePtr node); -XMLPUBFUN void XMLCALL - xmlParserAddNodeInfo (xmlParserCtxtPtr ctxt, - const xmlParserNodeInfoPtr info); - -/* - * External entities handling actually implemented in xmlIO. - */ - -XMLPUBFUN void XMLCALL - xmlSetExternalEntityLoader(xmlExternalEntityLoader f); -XMLPUBFUN xmlExternalEntityLoader XMLCALL - xmlGetExternalEntityLoader(void); -XMLPUBFUN xmlParserInputPtr XMLCALL - xmlLoadExternalEntity (const char *URL, - const char *ID, - xmlParserCtxtPtr ctxt); - -/* - * Index lookup, actually implemented in the encoding module - */ -XMLPUBFUN long XMLCALL - xmlByteConsumed (xmlParserCtxtPtr ctxt); - -/* - * New set of simpler/more flexible APIs - */ -/** - * xmlParserOption: - * - * This is the set of XML parser options that can be passed down - * to the xmlReadDoc() and similar calls. - */ -typedef enum { - XML_PARSE_RECOVER = 1<<0, /* recover on errors */ - XML_PARSE_NOENT = 1<<1, /* substitute entities */ - XML_PARSE_DTDLOAD = 1<<2, /* load the external subset */ - XML_PARSE_DTDATTR = 1<<3, /* default DTD attributes */ - XML_PARSE_DTDVALID = 1<<4, /* validate with the DTD */ - XML_PARSE_NOERROR = 1<<5, /* suppress error reports */ - XML_PARSE_NOWARNING = 1<<6, /* suppress warning reports */ - XML_PARSE_PEDANTIC = 1<<7, /* pedantic error reporting */ - XML_PARSE_NOBLANKS = 1<<8, /* remove blank nodes */ - XML_PARSE_SAX1 = 1<<9, /* use the SAX1 interface internally */ - XML_PARSE_XINCLUDE = 1<<10,/* Implement XInclude substitition */ - XML_PARSE_NONET = 1<<11,/* Forbid network access */ - XML_PARSE_NODICT = 1<<12,/* Do not reuse the context dictionnary */ - XML_PARSE_NSCLEAN = 1<<13,/* remove redundant namespaces declarations */ - XML_PARSE_NOCDATA = 1<<14,/* merge CDATA as text nodes */ - XML_PARSE_NOXINCNODE= 1<<15,/* do not generate XINCLUDE START/END nodes */ - XML_PARSE_COMPACT = 1<<16,/* compact small text nodes; no modification of - the tree allowed afterwards (will possibly - crash if you try to modify the tree) */ - XML_PARSE_OLD10 = 1<<17,/* parse using XML-1.0 before update 5 */ - XML_PARSE_NOBASEFIX = 1<<18,/* do not fixup XINCLUDE xml:base uris */ - XML_PARSE_HUGE = 1<<19,/* relax any hardcoded limit from the parser */ - XML_PARSE_OLDSAX = 1<<20,/* parse using SAX2 interface before 2.7.0 */ - XML_PARSE_IGNORE_ENC= 1<<21,/* ignore internal document encoding hint */ - XML_PARSE_BIG_LINES = 1<<22 /* Store big lines numbers in text PSVI field */ -} xmlParserOption; - -XMLPUBFUN void XMLCALL - xmlCtxtReset (xmlParserCtxtPtr ctxt); -XMLPUBFUN int XMLCALL - xmlCtxtResetPush (xmlParserCtxtPtr ctxt, - const char *chunk, - int size, - const char *filename, - const char *encoding); -XMLPUBFUN int XMLCALL - xmlCtxtUseOptions (xmlParserCtxtPtr ctxt, - int options); -XMLPUBFUN xmlDocPtr XMLCALL - xmlReadDoc (const xmlChar *cur, - const char *URL, - const char *encoding, - int options); -XMLPUBFUN xmlDocPtr XMLCALL - xmlReadFile (const char *URL, - const char *encoding, - int options); -XMLPUBFUN xmlDocPtr XMLCALL - xmlReadMemory (const char *buffer, - int size, - const char *URL, - const char *encoding, - int options); -XMLPUBFUN xmlDocPtr XMLCALL - xmlReadFd (int fd, - const char *URL, - const char *encoding, - int options); -XMLPUBFUN xmlDocPtr XMLCALL - xmlReadIO (xmlInputReadCallback ioread, - xmlInputCloseCallback ioclose, - void *ioctx, - const char *URL, - const char *encoding, - int options); -XMLPUBFUN xmlDocPtr XMLCALL - xmlCtxtReadDoc (xmlParserCtxtPtr ctxt, - const xmlChar *cur, - const char *URL, - const char *encoding, - int options); -XMLPUBFUN xmlDocPtr XMLCALL - xmlCtxtReadFile (xmlParserCtxtPtr ctxt, - const char *filename, - const char *encoding, - int options); -XMLPUBFUN xmlDocPtr XMLCALL - xmlCtxtReadMemory (xmlParserCtxtPtr ctxt, - const char *buffer, - int size, - const char *URL, - const char *encoding, - int options); -XMLPUBFUN xmlDocPtr XMLCALL - xmlCtxtReadFd (xmlParserCtxtPtr ctxt, - int fd, - const char *URL, - const char *encoding, - int options); -XMLPUBFUN xmlDocPtr XMLCALL - xmlCtxtReadIO (xmlParserCtxtPtr ctxt, - xmlInputReadCallback ioread, - xmlInputCloseCallback ioclose, - void *ioctx, - const char *URL, - const char *encoding, - int options); - -/* - * Library wide options - */ -/** - * xmlFeature: - * - * Used to examine the existance of features that can be enabled - * or disabled at compile-time. - * They used to be called XML_FEATURE_xxx but this clashed with Expat - */ -typedef enum { - XML_WITH_THREAD = 1, - XML_WITH_TREE = 2, - XML_WITH_OUTPUT = 3, - XML_WITH_PUSH = 4, - XML_WITH_READER = 5, - XML_WITH_PATTERN = 6, - XML_WITH_WRITER = 7, - XML_WITH_SAX1 = 8, - XML_WITH_FTP = 9, - XML_WITH_HTTP = 10, - XML_WITH_VALID = 11, - XML_WITH_HTML = 12, - XML_WITH_LEGACY = 13, - XML_WITH_C14N = 14, - XML_WITH_CATALOG = 15, - XML_WITH_XPATH = 16, - XML_WITH_XPTR = 17, - XML_WITH_XINCLUDE = 18, - XML_WITH_ICONV = 19, - XML_WITH_ISO8859X = 20, - XML_WITH_UNICODE = 21, - XML_WITH_REGEXP = 22, - XML_WITH_AUTOMATA = 23, - XML_WITH_EXPR = 24, - XML_WITH_SCHEMAS = 25, - XML_WITH_SCHEMATRON = 26, - XML_WITH_MODULES = 27, - XML_WITH_DEBUG = 28, - XML_WITH_DEBUG_MEM = 29, - XML_WITH_DEBUG_RUN = 30, - XML_WITH_ZLIB = 31, - XML_WITH_ICU = 32, - XML_WITH_LZMA = 33, - XML_WITH_NONE = 99999 /* just to be sure of allocation size */ -} xmlFeature; - -XMLPUBFUN int XMLCALL - xmlHasFeature (xmlFeature feature); - -#ifdef __cplusplus -} -#endif -#endif /* __XML_PARSER_H__ */ diff --git a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/parserInternals.h b/cocos2dx/platform/third_party/emscripten/libxml2/libxml/parserInternals.h deleted file mode 100644 index 6065320eb1..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/parserInternals.h +++ /dev/null @@ -1,644 +0,0 @@ -/* - * Summary: internals routines and limits exported by the parser. - * Description: this module exports a number of internal parsing routines - * they are not really all intended for applications but - * can prove useful doing low level processing. - * - * Copy: See Copyright for the status of this software. - * - * Author: Daniel Veillard - */ - -#ifndef __XML_PARSER_INTERNALS_H__ -#define __XML_PARSER_INTERNALS_H__ - -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * xmlParserMaxDepth: - * - * arbitrary depth limit for the XML documents that we allow to - * process. This is not a limitation of the parser but a safety - * boundary feature, use XML_PARSE_HUGE option to override it. - */ -XMLPUBVAR unsigned int xmlParserMaxDepth; - -/** - * XML_MAX_TEXT_LENGTH: - * - * Maximum size allowed for a single text node when building a tree. - * This is not a limitation of the parser but a safety boundary feature, - * use XML_PARSE_HUGE option to override it. - * Introduced in 2.9.0 - */ -#define XML_MAX_TEXT_LENGTH 10000000 - -/** - * XML_MAX_NAME_LENGTH: - * - * Maximum size allowed for a markup identitier - * This is not a limitation of the parser but a safety boundary feature, - * use XML_PARSE_HUGE option to override it. - * Note that with the use of parsing dictionaries overriding the limit - * may result in more runtime memory usage in face of "unfriendly' content - * Introduced in 2.9.0 - */ -#define XML_MAX_NAME_LENGTH 50000 - -/** - * XML_MAX_DICTIONARY_LIMIT: - * - * Maximum size allowed by the parser for a dictionary by default - * This is not a limitation of the parser but a safety boundary feature, - * use XML_PARSE_HUGE option to override it. - * Introduced in 2.9.0 - */ -#define XML_MAX_DICTIONARY_LIMIT 10000000 - -/** - * XML_MAX_LOOKUP_LIMIT: - * - * Maximum size allowed by the parser for ahead lookup - * This is an upper boundary enforced by the parser to avoid bad - * behaviour on "unfriendly' content - * Introduced in 2.9.0 - */ -#define XML_MAX_LOOKUP_LIMIT 10000000 - -/** - * XML_MAX_NAMELEN: - * - * Identifiers can be longer, but this will be more costly - * at runtime. - */ -#define XML_MAX_NAMELEN 100 - -/** - * INPUT_CHUNK: - * - * The parser tries to always have that amount of input ready. - * One of the point is providing context when reporting errors. - */ -#define INPUT_CHUNK 250 - -/************************************************************************ - * * - * UNICODE version of the macros. * - * * - ************************************************************************/ -/** - * IS_BYTE_CHAR: - * @c: an byte value (int) - * - * Macro to check the following production in the XML spec: - * - * [2] Char ::= #x9 | #xA | #xD | [#x20...] - * any byte character in the accepted range - */ -#define IS_BYTE_CHAR(c) xmlIsChar_ch(c) - -/** - * IS_CHAR: - * @c: an UNICODE value (int) - * - * Macro to check the following production in the XML spec: - * - * [2] Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] - * | [#x10000-#x10FFFF] - * any Unicode character, excluding the surrogate blocks, FFFE, and FFFF. - */ -#define IS_CHAR(c) xmlIsCharQ(c) - -/** - * IS_CHAR_CH: - * @c: an xmlChar (usually an unsigned char) - * - * Behaves like IS_CHAR on single-byte value - */ -#define IS_CHAR_CH(c) xmlIsChar_ch(c) - -/** - * IS_BLANK: - * @c: an UNICODE value (int) - * - * Macro to check the following production in the XML spec: - * - * [3] S ::= (#x20 | #x9 | #xD | #xA)+ - */ -#define IS_BLANK(c) xmlIsBlankQ(c) - -/** - * IS_BLANK_CH: - * @c: an xmlChar value (normally unsigned char) - * - * Behaviour same as IS_BLANK - */ -#define IS_BLANK_CH(c) xmlIsBlank_ch(c) - -/** - * IS_BASECHAR: - * @c: an UNICODE value (int) - * - * Macro to check the following production in the XML spec: - * - * [85] BaseChar ::= ... long list see REC ... - */ -#define IS_BASECHAR(c) xmlIsBaseCharQ(c) - -/** - * IS_DIGIT: - * @c: an UNICODE value (int) - * - * Macro to check the following production in the XML spec: - * - * [88] Digit ::= ... long list see REC ... - */ -#define IS_DIGIT(c) xmlIsDigitQ(c) - -/** - * IS_DIGIT_CH: - * @c: an xmlChar value (usually an unsigned char) - * - * Behaves like IS_DIGIT but with a single byte argument - */ -#define IS_DIGIT_CH(c) xmlIsDigit_ch(c) - -/** - * IS_COMBINING: - * @c: an UNICODE value (int) - * - * Macro to check the following production in the XML spec: - * - * [87] CombiningChar ::= ... long list see REC ... - */ -#define IS_COMBINING(c) xmlIsCombiningQ(c) - -/** - * IS_COMBINING_CH: - * @c: an xmlChar (usually an unsigned char) - * - * Always false (all combining chars > 0xff) - */ -#define IS_COMBINING_CH(c) 0 - -/** - * IS_EXTENDER: - * @c: an UNICODE value (int) - * - * Macro to check the following production in the XML spec: - * - * - * [89] Extender ::= #x00B7 | #x02D0 | #x02D1 | #x0387 | #x0640 | - * #x0E46 | #x0EC6 | #x3005 | [#x3031-#x3035] | - * [#x309D-#x309E] | [#x30FC-#x30FE] - */ -#define IS_EXTENDER(c) xmlIsExtenderQ(c) - -/** - * IS_EXTENDER_CH: - * @c: an xmlChar value (usually an unsigned char) - * - * Behaves like IS_EXTENDER but with a single-byte argument - */ -#define IS_EXTENDER_CH(c) xmlIsExtender_ch(c) - -/** - * IS_IDEOGRAPHIC: - * @c: an UNICODE value (int) - * - * Macro to check the following production in the XML spec: - * - * - * [86] Ideographic ::= [#x4E00-#x9FA5] | #x3007 | [#x3021-#x3029] - */ -#define IS_IDEOGRAPHIC(c) xmlIsIdeographicQ(c) - -/** - * IS_LETTER: - * @c: an UNICODE value (int) - * - * Macro to check the following production in the XML spec: - * - * - * [84] Letter ::= BaseChar | Ideographic - */ -#define IS_LETTER(c) (IS_BASECHAR(c) || IS_IDEOGRAPHIC(c)) - -/** - * IS_LETTER_CH: - * @c: an xmlChar value (normally unsigned char) - * - * Macro behaves like IS_LETTER, but only check base chars - * - */ -#define IS_LETTER_CH(c) xmlIsBaseChar_ch(c) - -/** - * IS_ASCII_LETTER: - * @c: an xmlChar value - * - * Macro to check [a-zA-Z] - * - */ -#define IS_ASCII_LETTER(c) (((0x41 <= (c)) && ((c) <= 0x5a)) || \ - ((0x61 <= (c)) && ((c) <= 0x7a))) - -/** - * IS_ASCII_DIGIT: - * @c: an xmlChar value - * - * Macro to check [0-9] - * - */ -#define IS_ASCII_DIGIT(c) ((0x30 <= (c)) && ((c) <= 0x39)) - -/** - * IS_PUBIDCHAR: - * @c: an UNICODE value (int) - * - * Macro to check the following production in the XML spec: - * - * - * [13] PubidChar ::= #x20 | #xD | #xA | [a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%] - */ -#define IS_PUBIDCHAR(c) xmlIsPubidCharQ(c) - -/** - * IS_PUBIDCHAR_CH: - * @c: an xmlChar value (normally unsigned char) - * - * Same as IS_PUBIDCHAR but for single-byte value - */ -#define IS_PUBIDCHAR_CH(c) xmlIsPubidChar_ch(c) - -/** - * SKIP_EOL: - * @p: and UTF8 string pointer - * - * Skips the end of line chars. - */ -#define SKIP_EOL(p) \ - if (*(p) == 0x13) { p++ ; if (*(p) == 0x10) p++; } \ - if (*(p) == 0x10) { p++ ; if (*(p) == 0x13) p++; } - -/** - * MOVETO_ENDTAG: - * @p: and UTF8 string pointer - * - * Skips to the next '>' char. - */ -#define MOVETO_ENDTAG(p) \ - while ((*p) && (*(p) != '>')) (p)++ - -/** - * MOVETO_STARTTAG: - * @p: and UTF8 string pointer - * - * Skips to the next '<' char. - */ -#define MOVETO_STARTTAG(p) \ - while ((*p) && (*(p) != '<')) (p)++ - -/** - * Global variables used for predefined strings. - */ -XMLPUBVAR const xmlChar xmlStringText[]; -XMLPUBVAR const xmlChar xmlStringTextNoenc[]; -XMLPUBVAR const xmlChar xmlStringComment[]; - -/* - * Function to finish the work of the macros where needed. - */ -XMLPUBFUN int XMLCALL xmlIsLetter (int c); - -/** - * Parser context. - */ -XMLPUBFUN xmlParserCtxtPtr XMLCALL - xmlCreateFileParserCtxt (const char *filename); -XMLPUBFUN xmlParserCtxtPtr XMLCALL - xmlCreateURLParserCtxt (const char *filename, - int options); -XMLPUBFUN xmlParserCtxtPtr XMLCALL - xmlCreateMemoryParserCtxt(const char *buffer, - int size); -XMLPUBFUN xmlParserCtxtPtr XMLCALL - xmlCreateEntityParserCtxt(const xmlChar *URL, - const xmlChar *ID, - const xmlChar *base); -XMLPUBFUN int XMLCALL - xmlSwitchEncoding (xmlParserCtxtPtr ctxt, - xmlCharEncoding enc); -XMLPUBFUN int XMLCALL - xmlSwitchToEncoding (xmlParserCtxtPtr ctxt, - xmlCharEncodingHandlerPtr handler); -XMLPUBFUN int XMLCALL - xmlSwitchInputEncoding (xmlParserCtxtPtr ctxt, - xmlParserInputPtr input, - xmlCharEncodingHandlerPtr handler); - -#ifdef IN_LIBXML -/* internal error reporting */ -XMLPUBFUN void XMLCALL - __xmlErrEncoding (xmlParserCtxtPtr ctxt, - xmlParserErrors xmlerr, - const char *msg, - const xmlChar * str1, - const xmlChar * str2); -#endif - -/** - * Input Streams. - */ -XMLPUBFUN xmlParserInputPtr XMLCALL - xmlNewStringInputStream (xmlParserCtxtPtr ctxt, - const xmlChar *buffer); -XMLPUBFUN xmlParserInputPtr XMLCALL - xmlNewEntityInputStream (xmlParserCtxtPtr ctxt, - xmlEntityPtr entity); -XMLPUBFUN int XMLCALL - xmlPushInput (xmlParserCtxtPtr ctxt, - xmlParserInputPtr input); -XMLPUBFUN xmlChar XMLCALL - xmlPopInput (xmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL - xmlFreeInputStream (xmlParserInputPtr input); -XMLPUBFUN xmlParserInputPtr XMLCALL - xmlNewInputFromFile (xmlParserCtxtPtr ctxt, - const char *filename); -XMLPUBFUN xmlParserInputPtr XMLCALL - xmlNewInputStream (xmlParserCtxtPtr ctxt); - -/** - * Namespaces. - */ -XMLPUBFUN xmlChar * XMLCALL - xmlSplitQName (xmlParserCtxtPtr ctxt, - const xmlChar *name, - xmlChar **prefix); - -/** - * Generic production rules. - */ -XMLPUBFUN const xmlChar * XMLCALL - xmlParseName (xmlParserCtxtPtr ctxt); -XMLPUBFUN xmlChar * XMLCALL - xmlParseNmtoken (xmlParserCtxtPtr ctxt); -XMLPUBFUN xmlChar * XMLCALL - xmlParseEntityValue (xmlParserCtxtPtr ctxt, - xmlChar **orig); -XMLPUBFUN xmlChar * XMLCALL - xmlParseAttValue (xmlParserCtxtPtr ctxt); -XMLPUBFUN xmlChar * XMLCALL - xmlParseSystemLiteral (xmlParserCtxtPtr ctxt); -XMLPUBFUN xmlChar * XMLCALL - xmlParsePubidLiteral (xmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL - xmlParseCharData (xmlParserCtxtPtr ctxt, - int cdata); -XMLPUBFUN xmlChar * XMLCALL - xmlParseExternalID (xmlParserCtxtPtr ctxt, - xmlChar **publicID, - int strict); -XMLPUBFUN void XMLCALL - xmlParseComment (xmlParserCtxtPtr ctxt); -XMLPUBFUN const xmlChar * XMLCALL - xmlParsePITarget (xmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL - xmlParsePI (xmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL - xmlParseNotationDecl (xmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL - xmlParseEntityDecl (xmlParserCtxtPtr ctxt); -XMLPUBFUN int XMLCALL - xmlParseDefaultDecl (xmlParserCtxtPtr ctxt, - xmlChar **value); -XMLPUBFUN xmlEnumerationPtr XMLCALL - xmlParseNotationType (xmlParserCtxtPtr ctxt); -XMLPUBFUN xmlEnumerationPtr XMLCALL - xmlParseEnumerationType (xmlParserCtxtPtr ctxt); -XMLPUBFUN int XMLCALL - xmlParseEnumeratedType (xmlParserCtxtPtr ctxt, - xmlEnumerationPtr *tree); -XMLPUBFUN int XMLCALL - xmlParseAttributeType (xmlParserCtxtPtr ctxt, - xmlEnumerationPtr *tree); -XMLPUBFUN void XMLCALL - xmlParseAttributeListDecl(xmlParserCtxtPtr ctxt); -XMLPUBFUN xmlElementContentPtr XMLCALL - xmlParseElementMixedContentDecl - (xmlParserCtxtPtr ctxt, - int inputchk); -XMLPUBFUN xmlElementContentPtr XMLCALL - xmlParseElementChildrenContentDecl - (xmlParserCtxtPtr ctxt, - int inputchk); -XMLPUBFUN int XMLCALL - xmlParseElementContentDecl(xmlParserCtxtPtr ctxt, - const xmlChar *name, - xmlElementContentPtr *result); -XMLPUBFUN int XMLCALL - xmlParseElementDecl (xmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL - xmlParseMarkupDecl (xmlParserCtxtPtr ctxt); -XMLPUBFUN int XMLCALL - xmlParseCharRef (xmlParserCtxtPtr ctxt); -XMLPUBFUN xmlEntityPtr XMLCALL - xmlParseEntityRef (xmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL - xmlParseReference (xmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL - xmlParsePEReference (xmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL - xmlParseDocTypeDecl (xmlParserCtxtPtr ctxt); -#ifdef LIBXML_SAX1_ENABLED -XMLPUBFUN const xmlChar * XMLCALL - xmlParseAttribute (xmlParserCtxtPtr ctxt, - xmlChar **value); -XMLPUBFUN const xmlChar * XMLCALL - xmlParseStartTag (xmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL - xmlParseEndTag (xmlParserCtxtPtr ctxt); -#endif /* LIBXML_SAX1_ENABLED */ -XMLPUBFUN void XMLCALL - xmlParseCDSect (xmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL - xmlParseContent (xmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL - xmlParseElement (xmlParserCtxtPtr ctxt); -XMLPUBFUN xmlChar * XMLCALL - xmlParseVersionNum (xmlParserCtxtPtr ctxt); -XMLPUBFUN xmlChar * XMLCALL - xmlParseVersionInfo (xmlParserCtxtPtr ctxt); -XMLPUBFUN xmlChar * XMLCALL - xmlParseEncName (xmlParserCtxtPtr ctxt); -XMLPUBFUN const xmlChar * XMLCALL - xmlParseEncodingDecl (xmlParserCtxtPtr ctxt); -XMLPUBFUN int XMLCALL - xmlParseSDDecl (xmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL - xmlParseXMLDecl (xmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL - xmlParseTextDecl (xmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL - xmlParseMisc (xmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL - xmlParseExternalSubset (xmlParserCtxtPtr ctxt, - const xmlChar *ExternalID, - const xmlChar *SystemID); -/** - * XML_SUBSTITUTE_NONE: - * - * If no entities need to be substituted. - */ -#define XML_SUBSTITUTE_NONE 0 -/** - * XML_SUBSTITUTE_REF: - * - * Whether general entities need to be substituted. - */ -#define XML_SUBSTITUTE_REF 1 -/** - * XML_SUBSTITUTE_PEREF: - * - * Whether parameter entities need to be substituted. - */ -#define XML_SUBSTITUTE_PEREF 2 -/** - * XML_SUBSTITUTE_BOTH: - * - * Both general and parameter entities need to be substituted. - */ -#define XML_SUBSTITUTE_BOTH 3 - -XMLPUBFUN xmlChar * XMLCALL - xmlStringDecodeEntities (xmlParserCtxtPtr ctxt, - const xmlChar *str, - int what, - xmlChar end, - xmlChar end2, - xmlChar end3); -XMLPUBFUN xmlChar * XMLCALL - xmlStringLenDecodeEntities (xmlParserCtxtPtr ctxt, - const xmlChar *str, - int len, - int what, - xmlChar end, - xmlChar end2, - xmlChar end3); - -/* - * Generated by MACROS on top of parser.c c.f. PUSH_AND_POP. - */ -XMLPUBFUN int XMLCALL nodePush (xmlParserCtxtPtr ctxt, - xmlNodePtr value); -XMLPUBFUN xmlNodePtr XMLCALL nodePop (xmlParserCtxtPtr ctxt); -XMLPUBFUN int XMLCALL inputPush (xmlParserCtxtPtr ctxt, - xmlParserInputPtr value); -XMLPUBFUN xmlParserInputPtr XMLCALL inputPop (xmlParserCtxtPtr ctxt); -XMLPUBFUN const xmlChar * XMLCALL namePop (xmlParserCtxtPtr ctxt); -XMLPUBFUN int XMLCALL namePush (xmlParserCtxtPtr ctxt, - const xmlChar *value); - -/* - * other commodities shared between parser.c and parserInternals. - */ -XMLPUBFUN int XMLCALL xmlSkipBlankChars (xmlParserCtxtPtr ctxt); -XMLPUBFUN int XMLCALL xmlStringCurrentChar (xmlParserCtxtPtr ctxt, - const xmlChar *cur, - int *len); -XMLPUBFUN void XMLCALL xmlParserHandlePEReference(xmlParserCtxtPtr ctxt); -XMLPUBFUN int XMLCALL xmlCheckLanguageID (const xmlChar *lang); - -/* - * Really core function shared with HTML parser. - */ -XMLPUBFUN int XMLCALL xmlCurrentChar (xmlParserCtxtPtr ctxt, - int *len); -XMLPUBFUN int XMLCALL xmlCopyCharMultiByte (xmlChar *out, - int val); -XMLPUBFUN int XMLCALL xmlCopyChar (int len, - xmlChar *out, - int val); -XMLPUBFUN void XMLCALL xmlNextChar (xmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL xmlParserInputShrink (xmlParserInputPtr in); - -#ifdef LIBXML_HTML_ENABLED -/* - * Actually comes from the HTML parser but launched from the init stuff. - */ -XMLPUBFUN void XMLCALL htmlInitAutoClose (void); -XMLPUBFUN htmlParserCtxtPtr XMLCALL htmlCreateFileParserCtxt(const char *filename, - const char *encoding); -#endif - -/* - * Specific function to keep track of entities references - * and used by the XSLT debugger. - */ -#ifdef LIBXML_LEGACY_ENABLED -/** - * xmlEntityReferenceFunc: - * @ent: the entity - * @firstNode: the fist node in the chunk - * @lastNode: the last nod in the chunk - * - * Callback function used when one needs to be able to track back the - * provenance of a chunk of nodes inherited from an entity replacement. - */ -typedef void (*xmlEntityReferenceFunc) (xmlEntityPtr ent, - xmlNodePtr firstNode, - xmlNodePtr lastNode); - -XMLPUBFUN void XMLCALL xmlSetEntityReferenceFunc (xmlEntityReferenceFunc func); - -XMLPUBFUN xmlChar * XMLCALL - xmlParseQuotedString (xmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL - xmlParseNamespace (xmlParserCtxtPtr ctxt); -XMLPUBFUN xmlChar * XMLCALL - xmlNamespaceParseNSDef (xmlParserCtxtPtr ctxt); -XMLPUBFUN xmlChar * XMLCALL - xmlScanName (xmlParserCtxtPtr ctxt); -XMLPUBFUN xmlChar * XMLCALL - xmlNamespaceParseNCName (xmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL xmlParserHandleReference(xmlParserCtxtPtr ctxt); -XMLPUBFUN xmlChar * XMLCALL - xmlNamespaceParseQName (xmlParserCtxtPtr ctxt, - xmlChar **prefix); -/** - * Entities - */ -XMLPUBFUN xmlChar * XMLCALL - xmlDecodeEntities (xmlParserCtxtPtr ctxt, - int len, - int what, - xmlChar end, - xmlChar end2, - xmlChar end3); -XMLPUBFUN void XMLCALL - xmlHandleEntity (xmlParserCtxtPtr ctxt, - xmlEntityPtr entity); - -#endif /* LIBXML_LEGACY_ENABLED */ - -#ifdef IN_LIBXML -/* - * internal only - */ -XMLPUBFUN void XMLCALL - xmlErrMemory (xmlParserCtxtPtr ctxt, - const char *extra); -#endif - -#ifdef __cplusplus -} -#endif -#endif /* __XML_PARSER_INTERNALS_H__ */ diff --git a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/pattern.h b/cocos2dx/platform/third_party/emscripten/libxml2/libxml/pattern.h deleted file mode 100644 index 97d2cd2bc0..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/pattern.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Summary: pattern expression handling - * Description: allows to compile and test pattern expressions for nodes - * either in a tree or based on a parser state. - * - * Copy: See Copyright for the status of this software. - * - * Author: Daniel Veillard - */ - -#ifndef __XML_PATTERN_H__ -#define __XML_PATTERN_H__ - -#include -#include -#include - -#ifdef LIBXML_PATTERN_ENABLED - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * xmlPattern: - * - * A compiled (XPath based) pattern to select nodes - */ -typedef struct _xmlPattern xmlPattern; -typedef xmlPattern *xmlPatternPtr; - -/** - * xmlPatternFlags: - * - * This is the set of options affecting the behaviour of pattern - * matching with this module - * - */ -typedef enum { - XML_PATTERN_DEFAULT = 0, /* simple pattern match */ - XML_PATTERN_XPATH = 1<<0, /* standard XPath pattern */ - XML_PATTERN_XSSEL = 1<<1, /* XPath subset for schema selector */ - XML_PATTERN_XSFIELD = 1<<2 /* XPath subset for schema field */ -} xmlPatternFlags; - -XMLPUBFUN void XMLCALL - xmlFreePattern (xmlPatternPtr comp); - -XMLPUBFUN void XMLCALL - xmlFreePatternList (xmlPatternPtr comp); - -XMLPUBFUN xmlPatternPtr XMLCALL - xmlPatterncompile (const xmlChar *pattern, - xmlDict *dict, - int flags, - const xmlChar **namespaces); -XMLPUBFUN int XMLCALL - xmlPatternMatch (xmlPatternPtr comp, - xmlNodePtr node); - -/* streaming interfaces */ -typedef struct _xmlStreamCtxt xmlStreamCtxt; -typedef xmlStreamCtxt *xmlStreamCtxtPtr; - -XMLPUBFUN int XMLCALL - xmlPatternStreamable (xmlPatternPtr comp); -XMLPUBFUN int XMLCALL - xmlPatternMaxDepth (xmlPatternPtr comp); -XMLPUBFUN int XMLCALL - xmlPatternMinDepth (xmlPatternPtr comp); -XMLPUBFUN int XMLCALL - xmlPatternFromRoot (xmlPatternPtr comp); -XMLPUBFUN xmlStreamCtxtPtr XMLCALL - xmlPatternGetStreamCtxt (xmlPatternPtr comp); -XMLPUBFUN void XMLCALL - xmlFreeStreamCtxt (xmlStreamCtxtPtr stream); -XMLPUBFUN int XMLCALL - xmlStreamPushNode (xmlStreamCtxtPtr stream, - const xmlChar *name, - const xmlChar *ns, - int nodeType); -XMLPUBFUN int XMLCALL - xmlStreamPush (xmlStreamCtxtPtr stream, - const xmlChar *name, - const xmlChar *ns); -XMLPUBFUN int XMLCALL - xmlStreamPushAttr (xmlStreamCtxtPtr stream, - const xmlChar *name, - const xmlChar *ns); -XMLPUBFUN int XMLCALL - xmlStreamPop (xmlStreamCtxtPtr stream); -XMLPUBFUN int XMLCALL - xmlStreamWantsAnyNode (xmlStreamCtxtPtr stream); -#ifdef __cplusplus -} -#endif - -#endif /* LIBXML_PATTERN_ENABLED */ - -#endif /* __XML_PATTERN_H__ */ diff --git a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/relaxng.h b/cocos2dx/platform/third_party/emscripten/libxml2/libxml/relaxng.h deleted file mode 100644 index bdb0a7d376..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/relaxng.h +++ /dev/null @@ -1,213 +0,0 @@ -/* - * Summary: implementation of the Relax-NG validation - * Description: implementation of the Relax-NG validation - * - * Copy: See Copyright for the status of this software. - * - * Author: Daniel Veillard - */ - -#ifndef __XML_RELAX_NG__ -#define __XML_RELAX_NG__ - -#include -#include -#include - -#ifdef LIBXML_SCHEMAS_ENABLED - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct _xmlRelaxNG xmlRelaxNG; -typedef xmlRelaxNG *xmlRelaxNGPtr; - - -/** - * xmlRelaxNGValidityErrorFunc: - * @ctx: the validation context - * @msg: the message - * @...: extra arguments - * - * Signature of an error callback from a Relax-NG validation - */ -typedef void (XMLCDECL *xmlRelaxNGValidityErrorFunc) (void *ctx, const char *msg, ...) LIBXML_ATTR_FORMAT(2,3); - -/** - * xmlRelaxNGValidityWarningFunc: - * @ctx: the validation context - * @msg: the message - * @...: extra arguments - * - * Signature of a warning callback from a Relax-NG validation - */ -typedef void (XMLCDECL *xmlRelaxNGValidityWarningFunc) (void *ctx, const char *msg, ...) LIBXML_ATTR_FORMAT(2,3); - -/** - * A schemas validation context - */ -typedef struct _xmlRelaxNGParserCtxt xmlRelaxNGParserCtxt; -typedef xmlRelaxNGParserCtxt *xmlRelaxNGParserCtxtPtr; - -typedef struct _xmlRelaxNGValidCtxt xmlRelaxNGValidCtxt; -typedef xmlRelaxNGValidCtxt *xmlRelaxNGValidCtxtPtr; - -/* - * xmlRelaxNGValidErr: - * - * List of possible Relax NG validation errors - */ -typedef enum { - XML_RELAXNG_OK = 0, - XML_RELAXNG_ERR_MEMORY, - XML_RELAXNG_ERR_TYPE, - XML_RELAXNG_ERR_TYPEVAL, - XML_RELAXNG_ERR_DUPID, - XML_RELAXNG_ERR_TYPECMP, - XML_RELAXNG_ERR_NOSTATE, - XML_RELAXNG_ERR_NODEFINE, - XML_RELAXNG_ERR_LISTEXTRA, - XML_RELAXNG_ERR_LISTEMPTY, - XML_RELAXNG_ERR_INTERNODATA, - XML_RELAXNG_ERR_INTERSEQ, - XML_RELAXNG_ERR_INTEREXTRA, - XML_RELAXNG_ERR_ELEMNAME, - XML_RELAXNG_ERR_ATTRNAME, - XML_RELAXNG_ERR_ELEMNONS, - XML_RELAXNG_ERR_ATTRNONS, - XML_RELAXNG_ERR_ELEMWRONGNS, - XML_RELAXNG_ERR_ATTRWRONGNS, - XML_RELAXNG_ERR_ELEMEXTRANS, - XML_RELAXNG_ERR_ATTREXTRANS, - XML_RELAXNG_ERR_ELEMNOTEMPTY, - XML_RELAXNG_ERR_NOELEM, - XML_RELAXNG_ERR_NOTELEM, - XML_RELAXNG_ERR_ATTRVALID, - XML_RELAXNG_ERR_CONTENTVALID, - XML_RELAXNG_ERR_EXTRACONTENT, - XML_RELAXNG_ERR_INVALIDATTR, - XML_RELAXNG_ERR_DATAELEM, - XML_RELAXNG_ERR_VALELEM, - XML_RELAXNG_ERR_LISTELEM, - XML_RELAXNG_ERR_DATATYPE, - XML_RELAXNG_ERR_VALUE, - XML_RELAXNG_ERR_LIST, - XML_RELAXNG_ERR_NOGRAMMAR, - XML_RELAXNG_ERR_EXTRADATA, - XML_RELAXNG_ERR_LACKDATA, - XML_RELAXNG_ERR_INTERNAL, - XML_RELAXNG_ERR_ELEMWRONG, - XML_RELAXNG_ERR_TEXTWRONG -} xmlRelaxNGValidErr; - -/* - * xmlRelaxNGParserFlags: - * - * List of possible Relax NG Parser flags - */ -typedef enum { - XML_RELAXNGP_NONE = 0, - XML_RELAXNGP_FREE_DOC = 1, - XML_RELAXNGP_CRNG = 2 -} xmlRelaxNGParserFlag; - -XMLPUBFUN int XMLCALL - xmlRelaxNGInitTypes (void); -XMLPUBFUN void XMLCALL - xmlRelaxNGCleanupTypes (void); - -/* - * Interfaces for parsing. - */ -XMLPUBFUN xmlRelaxNGParserCtxtPtr XMLCALL - xmlRelaxNGNewParserCtxt (const char *URL); -XMLPUBFUN xmlRelaxNGParserCtxtPtr XMLCALL - xmlRelaxNGNewMemParserCtxt (const char *buffer, - int size); -XMLPUBFUN xmlRelaxNGParserCtxtPtr XMLCALL - xmlRelaxNGNewDocParserCtxt (xmlDocPtr doc); - -XMLPUBFUN int XMLCALL - xmlRelaxParserSetFlag (xmlRelaxNGParserCtxtPtr ctxt, - int flag); - -XMLPUBFUN void XMLCALL - xmlRelaxNGFreeParserCtxt (xmlRelaxNGParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL - xmlRelaxNGSetParserErrors(xmlRelaxNGParserCtxtPtr ctxt, - xmlRelaxNGValidityErrorFunc err, - xmlRelaxNGValidityWarningFunc warn, - void *ctx); -XMLPUBFUN int XMLCALL - xmlRelaxNGGetParserErrors(xmlRelaxNGParserCtxtPtr ctxt, - xmlRelaxNGValidityErrorFunc *err, - xmlRelaxNGValidityWarningFunc *warn, - void **ctx); -XMLPUBFUN void XMLCALL - xmlRelaxNGSetParserStructuredErrors( - xmlRelaxNGParserCtxtPtr ctxt, - xmlStructuredErrorFunc serror, - void *ctx); -XMLPUBFUN xmlRelaxNGPtr XMLCALL - xmlRelaxNGParse (xmlRelaxNGParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL - xmlRelaxNGFree (xmlRelaxNGPtr schema); -#ifdef LIBXML_OUTPUT_ENABLED -XMLPUBFUN void XMLCALL - xmlRelaxNGDump (FILE *output, - xmlRelaxNGPtr schema); -XMLPUBFUN void XMLCALL - xmlRelaxNGDumpTree (FILE * output, - xmlRelaxNGPtr schema); -#endif /* LIBXML_OUTPUT_ENABLED */ -/* - * Interfaces for validating - */ -XMLPUBFUN void XMLCALL - xmlRelaxNGSetValidErrors(xmlRelaxNGValidCtxtPtr ctxt, - xmlRelaxNGValidityErrorFunc err, - xmlRelaxNGValidityWarningFunc warn, - void *ctx); -XMLPUBFUN int XMLCALL - xmlRelaxNGGetValidErrors(xmlRelaxNGValidCtxtPtr ctxt, - xmlRelaxNGValidityErrorFunc *err, - xmlRelaxNGValidityWarningFunc *warn, - void **ctx); -XMLPUBFUN void XMLCALL - xmlRelaxNGSetValidStructuredErrors(xmlRelaxNGValidCtxtPtr ctxt, - xmlStructuredErrorFunc serror, void *ctx); -XMLPUBFUN xmlRelaxNGValidCtxtPtr XMLCALL - xmlRelaxNGNewValidCtxt (xmlRelaxNGPtr schema); -XMLPUBFUN void XMLCALL - xmlRelaxNGFreeValidCtxt (xmlRelaxNGValidCtxtPtr ctxt); -XMLPUBFUN int XMLCALL - xmlRelaxNGValidateDoc (xmlRelaxNGValidCtxtPtr ctxt, - xmlDocPtr doc); -/* - * Interfaces for progressive validation when possible - */ -XMLPUBFUN int XMLCALL - xmlRelaxNGValidatePushElement (xmlRelaxNGValidCtxtPtr ctxt, - xmlDocPtr doc, - xmlNodePtr elem); -XMLPUBFUN int XMLCALL - xmlRelaxNGValidatePushCData (xmlRelaxNGValidCtxtPtr ctxt, - const xmlChar *data, - int len); -XMLPUBFUN int XMLCALL - xmlRelaxNGValidatePopElement (xmlRelaxNGValidCtxtPtr ctxt, - xmlDocPtr doc, - xmlNodePtr elem); -XMLPUBFUN int XMLCALL - xmlRelaxNGValidateFullElement (xmlRelaxNGValidCtxtPtr ctxt, - xmlDocPtr doc, - xmlNodePtr elem); - -#ifdef __cplusplus -} -#endif - -#endif /* LIBXML_SCHEMAS_ENABLED */ - -#endif /* __XML_RELAX_NG__ */ diff --git a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/schemasInternals.h b/cocos2dx/platform/third_party/emscripten/libxml2/libxml/schemasInternals.h deleted file mode 100644 index 4f0ca9a1fd..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/schemasInternals.h +++ /dev/null @@ -1,958 +0,0 @@ -/* - * Summary: internal interfaces for XML Schemas - * Description: internal interfaces for the XML Schemas handling - * and schema validity checking - * The Schemas development is a Work In Progress. - * Some of those interfaces are not garanteed to be API or ABI stable ! - * - * Copy: See Copyright for the status of this software. - * - * Author: Daniel Veillard - */ - - -#ifndef __XML_SCHEMA_INTERNALS_H__ -#define __XML_SCHEMA_INTERNALS_H__ - -#include - -#ifdef LIBXML_SCHEMAS_ENABLED - -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef enum { - XML_SCHEMAS_UNKNOWN = 0, - XML_SCHEMAS_STRING, - XML_SCHEMAS_NORMSTRING, - XML_SCHEMAS_DECIMAL, - XML_SCHEMAS_TIME, - XML_SCHEMAS_GDAY, - XML_SCHEMAS_GMONTH, - XML_SCHEMAS_GMONTHDAY, - XML_SCHEMAS_GYEAR, - XML_SCHEMAS_GYEARMONTH, - XML_SCHEMAS_DATE, - XML_SCHEMAS_DATETIME, - XML_SCHEMAS_DURATION, - XML_SCHEMAS_FLOAT, - XML_SCHEMAS_DOUBLE, - XML_SCHEMAS_BOOLEAN, - XML_SCHEMAS_TOKEN, - XML_SCHEMAS_LANGUAGE, - XML_SCHEMAS_NMTOKEN, - XML_SCHEMAS_NMTOKENS, - XML_SCHEMAS_NAME, - XML_SCHEMAS_QNAME, - XML_SCHEMAS_NCNAME, - XML_SCHEMAS_ID, - XML_SCHEMAS_IDREF, - XML_SCHEMAS_IDREFS, - XML_SCHEMAS_ENTITY, - XML_SCHEMAS_ENTITIES, - XML_SCHEMAS_NOTATION, - XML_SCHEMAS_ANYURI, - XML_SCHEMAS_INTEGER, - XML_SCHEMAS_NPINTEGER, - XML_SCHEMAS_NINTEGER, - XML_SCHEMAS_NNINTEGER, - XML_SCHEMAS_PINTEGER, - XML_SCHEMAS_INT, - XML_SCHEMAS_UINT, - XML_SCHEMAS_LONG, - XML_SCHEMAS_ULONG, - XML_SCHEMAS_SHORT, - XML_SCHEMAS_USHORT, - XML_SCHEMAS_BYTE, - XML_SCHEMAS_UBYTE, - XML_SCHEMAS_HEXBINARY, - XML_SCHEMAS_BASE64BINARY, - XML_SCHEMAS_ANYTYPE, - XML_SCHEMAS_ANYSIMPLETYPE -} xmlSchemaValType; - -/* - * XML Schemas defines multiple type of types. - */ -typedef enum { - XML_SCHEMA_TYPE_BASIC = 1, /* A built-in datatype */ - XML_SCHEMA_TYPE_ANY, - XML_SCHEMA_TYPE_FACET, - XML_SCHEMA_TYPE_SIMPLE, - XML_SCHEMA_TYPE_COMPLEX, - XML_SCHEMA_TYPE_SEQUENCE = 6, - XML_SCHEMA_TYPE_CHOICE, - XML_SCHEMA_TYPE_ALL, - XML_SCHEMA_TYPE_SIMPLE_CONTENT, - XML_SCHEMA_TYPE_COMPLEX_CONTENT, - XML_SCHEMA_TYPE_UR, - XML_SCHEMA_TYPE_RESTRICTION, - XML_SCHEMA_TYPE_EXTENSION, - XML_SCHEMA_TYPE_ELEMENT, - XML_SCHEMA_TYPE_ATTRIBUTE, - XML_SCHEMA_TYPE_ATTRIBUTEGROUP, - XML_SCHEMA_TYPE_GROUP, - XML_SCHEMA_TYPE_NOTATION, - XML_SCHEMA_TYPE_LIST, - XML_SCHEMA_TYPE_UNION, - XML_SCHEMA_TYPE_ANY_ATTRIBUTE, - XML_SCHEMA_TYPE_IDC_UNIQUE, - XML_SCHEMA_TYPE_IDC_KEY, - XML_SCHEMA_TYPE_IDC_KEYREF, - XML_SCHEMA_TYPE_PARTICLE = 25, - XML_SCHEMA_TYPE_ATTRIBUTE_USE, - XML_SCHEMA_FACET_MININCLUSIVE = 1000, - XML_SCHEMA_FACET_MINEXCLUSIVE, - XML_SCHEMA_FACET_MAXINCLUSIVE, - XML_SCHEMA_FACET_MAXEXCLUSIVE, - XML_SCHEMA_FACET_TOTALDIGITS, - XML_SCHEMA_FACET_FRACTIONDIGITS, - XML_SCHEMA_FACET_PATTERN, - XML_SCHEMA_FACET_ENUMERATION, - XML_SCHEMA_FACET_WHITESPACE, - XML_SCHEMA_FACET_LENGTH, - XML_SCHEMA_FACET_MAXLENGTH, - XML_SCHEMA_FACET_MINLENGTH, - XML_SCHEMA_EXTRA_QNAMEREF = 2000, - XML_SCHEMA_EXTRA_ATTR_USE_PROHIB -} xmlSchemaTypeType; - -typedef enum { - XML_SCHEMA_CONTENT_UNKNOWN = 0, - XML_SCHEMA_CONTENT_EMPTY = 1, - XML_SCHEMA_CONTENT_ELEMENTS, - XML_SCHEMA_CONTENT_MIXED, - XML_SCHEMA_CONTENT_SIMPLE, - XML_SCHEMA_CONTENT_MIXED_OR_ELEMENTS, /* Obsolete */ - XML_SCHEMA_CONTENT_BASIC, - XML_SCHEMA_CONTENT_ANY -} xmlSchemaContentType; - -typedef struct _xmlSchemaVal xmlSchemaVal; -typedef xmlSchemaVal *xmlSchemaValPtr; - -typedef struct _xmlSchemaType xmlSchemaType; -typedef xmlSchemaType *xmlSchemaTypePtr; - -typedef struct _xmlSchemaFacet xmlSchemaFacet; -typedef xmlSchemaFacet *xmlSchemaFacetPtr; - -/** - * Annotation - */ -typedef struct _xmlSchemaAnnot xmlSchemaAnnot; -typedef xmlSchemaAnnot *xmlSchemaAnnotPtr; -struct _xmlSchemaAnnot { - struct _xmlSchemaAnnot *next; - xmlNodePtr content; /* the annotation */ -}; - -/** - * XML_SCHEMAS_ANYATTR_SKIP: - * - * Skip unknown attribute from validation - * Obsolete, not used anymore. - */ -#define XML_SCHEMAS_ANYATTR_SKIP 1 -/** - * XML_SCHEMAS_ANYATTR_LAX: - * - * Ignore validation non definition on attributes - * Obsolete, not used anymore. - */ -#define XML_SCHEMAS_ANYATTR_LAX 2 -/** - * XML_SCHEMAS_ANYATTR_STRICT: - * - * Apply strict validation rules on attributes - * Obsolete, not used anymore. - */ -#define XML_SCHEMAS_ANYATTR_STRICT 3 -/** - * XML_SCHEMAS_ANY_SKIP: - * - * Skip unknown attribute from validation - */ -#define XML_SCHEMAS_ANY_SKIP 1 -/** - * XML_SCHEMAS_ANY_LAX: - * - * Used by wildcards. - * Validate if type found, don't worry if not found - */ -#define XML_SCHEMAS_ANY_LAX 2 -/** - * XML_SCHEMAS_ANY_STRICT: - * - * Used by wildcards. - * Apply strict validation rules - */ -#define XML_SCHEMAS_ANY_STRICT 3 -/** - * XML_SCHEMAS_ATTR_USE_PROHIBITED: - * - * Used by wildcards. - * The attribute is prohibited. - */ -#define XML_SCHEMAS_ATTR_USE_PROHIBITED 0 -/** - * XML_SCHEMAS_ATTR_USE_REQUIRED: - * - * The attribute is required. - */ -#define XML_SCHEMAS_ATTR_USE_REQUIRED 1 -/** - * XML_SCHEMAS_ATTR_USE_OPTIONAL: - * - * The attribute is optional. - */ -#define XML_SCHEMAS_ATTR_USE_OPTIONAL 2 -/** - * XML_SCHEMAS_ATTR_GLOBAL: - * - * allow elements in no namespace - */ -#define XML_SCHEMAS_ATTR_GLOBAL 1 << 0 -/** - * XML_SCHEMAS_ATTR_NSDEFAULT: - * - * allow elements in no namespace - */ -#define XML_SCHEMAS_ATTR_NSDEFAULT 1 << 7 -/** - * XML_SCHEMAS_ATTR_INTERNAL_RESOLVED: - * - * this is set when the "type" and "ref" references - * have been resolved. - */ -#define XML_SCHEMAS_ATTR_INTERNAL_RESOLVED 1 << 8 -/** - * XML_SCHEMAS_ATTR_FIXED: - * - * the attribute has a fixed value - */ -#define XML_SCHEMAS_ATTR_FIXED 1 << 9 - -/** - * xmlSchemaAttribute: - * An attribute definition. - */ - -typedef struct _xmlSchemaAttribute xmlSchemaAttribute; -typedef xmlSchemaAttribute *xmlSchemaAttributePtr; -struct _xmlSchemaAttribute { - xmlSchemaTypeType type; - struct _xmlSchemaAttribute *next; /* the next attribute (not used?) */ - const xmlChar *name; /* the name of the declaration */ - const xmlChar *id; /* Deprecated; not used */ - const xmlChar *ref; /* Deprecated; not used */ - const xmlChar *refNs; /* Deprecated; not used */ - const xmlChar *typeName; /* the local name of the type definition */ - const xmlChar *typeNs; /* the ns URI of the type definition */ - xmlSchemaAnnotPtr annot; - - xmlSchemaTypePtr base; /* Deprecated; not used */ - int occurs; /* Deprecated; not used */ - const xmlChar *defValue; /* The initial value of the value constraint */ - xmlSchemaTypePtr subtypes; /* the type definition */ - xmlNodePtr node; - const xmlChar *targetNamespace; - int flags; - const xmlChar *refPrefix; /* Deprecated; not used */ - xmlSchemaValPtr defVal; /* The compiled value constraint */ - xmlSchemaAttributePtr refDecl; /* Deprecated; not used */ -}; - -/** - * xmlSchemaAttributeLink: - * Used to build a list of attribute uses on complexType definitions. - * WARNING: Deprecated; not used. - */ -typedef struct _xmlSchemaAttributeLink xmlSchemaAttributeLink; -typedef xmlSchemaAttributeLink *xmlSchemaAttributeLinkPtr; -struct _xmlSchemaAttributeLink { - struct _xmlSchemaAttributeLink *next;/* the next attribute link ... */ - struct _xmlSchemaAttribute *attr;/* the linked attribute */ -}; - -/** - * XML_SCHEMAS_WILDCARD_COMPLETE: - * - * If the wildcard is complete. - */ -#define XML_SCHEMAS_WILDCARD_COMPLETE 1 << 0 - -/** - * xmlSchemaCharValueLink: - * Used to build a list of namespaces on wildcards. - */ -typedef struct _xmlSchemaWildcardNs xmlSchemaWildcardNs; -typedef xmlSchemaWildcardNs *xmlSchemaWildcardNsPtr; -struct _xmlSchemaWildcardNs { - struct _xmlSchemaWildcardNs *next;/* the next constraint link ... */ - const xmlChar *value;/* the value */ -}; - -/** - * xmlSchemaWildcard. - * A wildcard. - */ -typedef struct _xmlSchemaWildcard xmlSchemaWildcard; -typedef xmlSchemaWildcard *xmlSchemaWildcardPtr; -struct _xmlSchemaWildcard { - xmlSchemaTypeType type; /* The kind of type */ - const xmlChar *id; /* Deprecated; not used */ - xmlSchemaAnnotPtr annot; - xmlNodePtr node; - int minOccurs; /* Deprecated; not used */ - int maxOccurs; /* Deprecated; not used */ - int processContents; - int any; /* Indicates if the ns constraint is of ##any */ - xmlSchemaWildcardNsPtr nsSet; /* The list of allowed namespaces */ - xmlSchemaWildcardNsPtr negNsSet; /* The negated namespace */ - int flags; -}; - -/** - * XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED: - * - * The attribute wildcard has been already builded. - */ -#define XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED 1 << 0 -/** - * XML_SCHEMAS_ATTRGROUP_GLOBAL: - * - * The attribute wildcard has been already builded. - */ -#define XML_SCHEMAS_ATTRGROUP_GLOBAL 1 << 1 -/** - * XML_SCHEMAS_ATTRGROUP_MARKED: - * - * Marks the attr group as marked; used for circular checks. - */ -#define XML_SCHEMAS_ATTRGROUP_MARKED 1 << 2 - -/** - * XML_SCHEMAS_ATTRGROUP_REDEFINED: - * - * The attr group was redefined. - */ -#define XML_SCHEMAS_ATTRGROUP_REDEFINED 1 << 3 -/** - * XML_SCHEMAS_ATTRGROUP_HAS_REFS: - * - * Whether this attr. group contains attr. group references. - */ -#define XML_SCHEMAS_ATTRGROUP_HAS_REFS 1 << 4 - -/** - * An attribute group definition. - * - * xmlSchemaAttribute and xmlSchemaAttributeGroup start of structures - * must be kept similar - */ -typedef struct _xmlSchemaAttributeGroup xmlSchemaAttributeGroup; -typedef xmlSchemaAttributeGroup *xmlSchemaAttributeGroupPtr; -struct _xmlSchemaAttributeGroup { - xmlSchemaTypeType type; /* The kind of type */ - struct _xmlSchemaAttribute *next;/* the next attribute if in a group ... */ - const xmlChar *name; - const xmlChar *id; - const xmlChar *ref; /* Deprecated; not used */ - const xmlChar *refNs; /* Deprecated; not used */ - xmlSchemaAnnotPtr annot; - - xmlSchemaAttributePtr attributes; /* Deprecated; not used */ - xmlNodePtr node; - int flags; - xmlSchemaWildcardPtr attributeWildcard; - const xmlChar *refPrefix; /* Deprecated; not used */ - xmlSchemaAttributeGroupPtr refItem; /* Deprecated; not used */ - const xmlChar *targetNamespace; - void *attrUses; -}; - -/** - * xmlSchemaTypeLink: - * Used to build a list of types (e.g. member types of - * simpleType with variety "union"). - */ -typedef struct _xmlSchemaTypeLink xmlSchemaTypeLink; -typedef xmlSchemaTypeLink *xmlSchemaTypeLinkPtr; -struct _xmlSchemaTypeLink { - struct _xmlSchemaTypeLink *next;/* the next type link ... */ - xmlSchemaTypePtr type;/* the linked type */ -}; - -/** - * xmlSchemaFacetLink: - * Used to build a list of facets. - */ -typedef struct _xmlSchemaFacetLink xmlSchemaFacetLink; -typedef xmlSchemaFacetLink *xmlSchemaFacetLinkPtr; -struct _xmlSchemaFacetLink { - struct _xmlSchemaFacetLink *next;/* the next facet link ... */ - xmlSchemaFacetPtr facet;/* the linked facet */ -}; - -/** - * XML_SCHEMAS_TYPE_MIXED: - * - * the element content type is mixed - */ -#define XML_SCHEMAS_TYPE_MIXED 1 << 0 -/** - * XML_SCHEMAS_TYPE_DERIVATION_METHOD_EXTENSION: - * - * the simple or complex type has a derivation method of "extension". - */ -#define XML_SCHEMAS_TYPE_DERIVATION_METHOD_EXTENSION 1 << 1 -/** - * XML_SCHEMAS_TYPE_DERIVATION_METHOD_RESTRICTION: - * - * the simple or complex type has a derivation method of "restriction". - */ -#define XML_SCHEMAS_TYPE_DERIVATION_METHOD_RESTRICTION 1 << 2 -/** - * XML_SCHEMAS_TYPE_GLOBAL: - * - * the type is global - */ -#define XML_SCHEMAS_TYPE_GLOBAL 1 << 3 -/** - * XML_SCHEMAS_TYPE_OWNED_ATTR_WILDCARD: - * - * the complexType owns an attribute wildcard, i.e. - * it can be freed by the complexType - */ -#define XML_SCHEMAS_TYPE_OWNED_ATTR_WILDCARD 1 << 4 /* Obsolete. */ -/** - * XML_SCHEMAS_TYPE_VARIETY_ABSENT: - * - * the simpleType has a variety of "absent". - * TODO: Actually not necessary :-/, since if - * none of the variety flags occur then it's - * automatically absent. - */ -#define XML_SCHEMAS_TYPE_VARIETY_ABSENT 1 << 5 -/** - * XML_SCHEMAS_TYPE_VARIETY_LIST: - * - * the simpleType has a variety of "list". - */ -#define XML_SCHEMAS_TYPE_VARIETY_LIST 1 << 6 -/** - * XML_SCHEMAS_TYPE_VARIETY_UNION: - * - * the simpleType has a variety of "union". - */ -#define XML_SCHEMAS_TYPE_VARIETY_UNION 1 << 7 -/** - * XML_SCHEMAS_TYPE_VARIETY_ATOMIC: - * - * the simpleType has a variety of "union". - */ -#define XML_SCHEMAS_TYPE_VARIETY_ATOMIC 1 << 8 -/** - * XML_SCHEMAS_TYPE_FINAL_EXTENSION: - * - * the complexType has a final of "extension". - */ -#define XML_SCHEMAS_TYPE_FINAL_EXTENSION 1 << 9 -/** - * XML_SCHEMAS_TYPE_FINAL_RESTRICTION: - * - * the simpleType/complexType has a final of "restriction". - */ -#define XML_SCHEMAS_TYPE_FINAL_RESTRICTION 1 << 10 -/** - * XML_SCHEMAS_TYPE_FINAL_LIST: - * - * the simpleType has a final of "list". - */ -#define XML_SCHEMAS_TYPE_FINAL_LIST 1 << 11 -/** - * XML_SCHEMAS_TYPE_FINAL_UNION: - * - * the simpleType has a final of "union". - */ -#define XML_SCHEMAS_TYPE_FINAL_UNION 1 << 12 -/** - * XML_SCHEMAS_TYPE_FINAL_DEFAULT: - * - * the simpleType has a final of "default". - */ -#define XML_SCHEMAS_TYPE_FINAL_DEFAULT 1 << 13 -/** - * XML_SCHEMAS_TYPE_BUILTIN_PRIMITIVE: - * - * Marks the item as a builtin primitive. - */ -#define XML_SCHEMAS_TYPE_BUILTIN_PRIMITIVE 1 << 14 -/** - * XML_SCHEMAS_TYPE_MARKED: - * - * Marks the item as marked; used for circular checks. - */ -#define XML_SCHEMAS_TYPE_MARKED 1 << 16 -/** - * XML_SCHEMAS_TYPE_BLOCK_DEFAULT: - * - * the complexType did not specify 'block' so use the default of the - * item. - */ -#define XML_SCHEMAS_TYPE_BLOCK_DEFAULT 1 << 17 -/** - * XML_SCHEMAS_TYPE_BLOCK_EXTENSION: - * - * the complexType has a 'block' of "extension". - */ -#define XML_SCHEMAS_TYPE_BLOCK_EXTENSION 1 << 18 -/** - * XML_SCHEMAS_TYPE_BLOCK_RESTRICTION: - * - * the complexType has a 'block' of "restriction". - */ -#define XML_SCHEMAS_TYPE_BLOCK_RESTRICTION 1 << 19 -/** - * XML_SCHEMAS_TYPE_ABSTRACT: - * - * the simple/complexType is abstract. - */ -#define XML_SCHEMAS_TYPE_ABSTRACT 1 << 20 -/** - * XML_SCHEMAS_TYPE_FACETSNEEDVALUE: - * - * indicates if the facets need a computed value - */ -#define XML_SCHEMAS_TYPE_FACETSNEEDVALUE 1 << 21 -/** - * XML_SCHEMAS_TYPE_INTERNAL_RESOLVED: - * - * indicates that the type was typefixed - */ -#define XML_SCHEMAS_TYPE_INTERNAL_RESOLVED 1 << 22 -/** - * XML_SCHEMAS_TYPE_INTERNAL_INVALID: - * - * indicates that the type is invalid - */ -#define XML_SCHEMAS_TYPE_INTERNAL_INVALID 1 << 23 -/** - * XML_SCHEMAS_TYPE_WHITESPACE_PRESERVE: - * - * a whitespace-facet value of "preserve" - */ -#define XML_SCHEMAS_TYPE_WHITESPACE_PRESERVE 1 << 24 -/** - * XML_SCHEMAS_TYPE_WHITESPACE_REPLACE: - * - * a whitespace-facet value of "replace" - */ -#define XML_SCHEMAS_TYPE_WHITESPACE_REPLACE 1 << 25 -/** - * XML_SCHEMAS_TYPE_WHITESPACE_COLLAPSE: - * - * a whitespace-facet value of "collapse" - */ -#define XML_SCHEMAS_TYPE_WHITESPACE_COLLAPSE 1 << 26 -/** - * XML_SCHEMAS_TYPE_HAS_FACETS: - * - * has facets - */ -#define XML_SCHEMAS_TYPE_HAS_FACETS 1 << 27 -/** - * XML_SCHEMAS_TYPE_NORMVALUENEEDED: - * - * indicates if the facets (pattern) need a normalized value - */ -#define XML_SCHEMAS_TYPE_NORMVALUENEEDED 1 << 28 - -/** - * XML_SCHEMAS_TYPE_FIXUP_1: - * - * First stage of fixup was done. - */ -#define XML_SCHEMAS_TYPE_FIXUP_1 1 << 29 - -/** - * XML_SCHEMAS_TYPE_REDEFINED: - * - * The type was redefined. - */ -#define XML_SCHEMAS_TYPE_REDEFINED 1 << 30 -/** - * XML_SCHEMAS_TYPE_REDEFINING: - * - * The type redefines an other type. - */ -/* #define XML_SCHEMAS_TYPE_REDEFINING 1 << 31 */ - -/** - * _xmlSchemaType: - * - * Schemas type definition. - */ -struct _xmlSchemaType { - xmlSchemaTypeType type; /* The kind of type */ - struct _xmlSchemaType *next; /* the next type if in a sequence ... */ - const xmlChar *name; - const xmlChar *id ; /* Deprecated; not used */ - const xmlChar *ref; /* Deprecated; not used */ - const xmlChar *refNs; /* Deprecated; not used */ - xmlSchemaAnnotPtr annot; - xmlSchemaTypePtr subtypes; - xmlSchemaAttributePtr attributes; /* Deprecated; not used */ - xmlNodePtr node; - int minOccurs; /* Deprecated; not used */ - int maxOccurs; /* Deprecated; not used */ - - int flags; - xmlSchemaContentType contentType; - const xmlChar *base; /* Base type's local name */ - const xmlChar *baseNs; /* Base type's target namespace */ - xmlSchemaTypePtr baseType; /* The base type component */ - xmlSchemaFacetPtr facets; /* Local facets */ - struct _xmlSchemaType *redef; /* Deprecated; not used */ - int recurse; /* Obsolete */ - xmlSchemaAttributeLinkPtr *attributeUses; /* Deprecated; not used */ - xmlSchemaWildcardPtr attributeWildcard; - int builtInType; /* Type of built-in types. */ - xmlSchemaTypeLinkPtr memberTypes; /* member-types if a union type. */ - xmlSchemaFacetLinkPtr facetSet; /* All facets (incl. inherited) */ - const xmlChar *refPrefix; /* Deprecated; not used */ - xmlSchemaTypePtr contentTypeDef; /* Used for the simple content of complex types. - Could we use @subtypes for this? */ - xmlRegexpPtr contModel; /* Holds the automaton of the content model */ - const xmlChar *targetNamespace; - void *attrUses; -}; - -/* - * xmlSchemaElement: - * An element definition. - * - * xmlSchemaType, xmlSchemaFacet and xmlSchemaElement start of - * structures must be kept similar - */ -/** - * XML_SCHEMAS_ELEM_NILLABLE: - * - * the element is nillable - */ -#define XML_SCHEMAS_ELEM_NILLABLE 1 << 0 -/** - * XML_SCHEMAS_ELEM_GLOBAL: - * - * the element is global - */ -#define XML_SCHEMAS_ELEM_GLOBAL 1 << 1 -/** - * XML_SCHEMAS_ELEM_DEFAULT: - * - * the element has a default value - */ -#define XML_SCHEMAS_ELEM_DEFAULT 1 << 2 -/** - * XML_SCHEMAS_ELEM_FIXED: - * - * the element has a fixed value - */ -#define XML_SCHEMAS_ELEM_FIXED 1 << 3 -/** - * XML_SCHEMAS_ELEM_ABSTRACT: - * - * the element is abstract - */ -#define XML_SCHEMAS_ELEM_ABSTRACT 1 << 4 -/** - * XML_SCHEMAS_ELEM_TOPLEVEL: - * - * the element is top level - * obsolete: use XML_SCHEMAS_ELEM_GLOBAL instead - */ -#define XML_SCHEMAS_ELEM_TOPLEVEL 1 << 5 -/** - * XML_SCHEMAS_ELEM_REF: - * - * the element is a reference to a type - */ -#define XML_SCHEMAS_ELEM_REF 1 << 6 -/** - * XML_SCHEMAS_ELEM_NSDEFAULT: - * - * allow elements in no namespace - * Obsolete, not used anymore. - */ -#define XML_SCHEMAS_ELEM_NSDEFAULT 1 << 7 -/** - * XML_SCHEMAS_ELEM_INTERNAL_RESOLVED: - * - * this is set when "type", "ref", "substitutionGroup" - * references have been resolved. - */ -#define XML_SCHEMAS_ELEM_INTERNAL_RESOLVED 1 << 8 - /** - * XML_SCHEMAS_ELEM_CIRCULAR: - * - * a helper flag for the search of circular references. - */ -#define XML_SCHEMAS_ELEM_CIRCULAR 1 << 9 -/** - * XML_SCHEMAS_ELEM_BLOCK_ABSENT: - * - * the "block" attribute is absent - */ -#define XML_SCHEMAS_ELEM_BLOCK_ABSENT 1 << 10 -/** - * XML_SCHEMAS_ELEM_BLOCK_EXTENSION: - * - * disallowed substitutions are absent - */ -#define XML_SCHEMAS_ELEM_BLOCK_EXTENSION 1 << 11 -/** - * XML_SCHEMAS_ELEM_BLOCK_RESTRICTION: - * - * disallowed substitutions: "restriction" - */ -#define XML_SCHEMAS_ELEM_BLOCK_RESTRICTION 1 << 12 -/** - * XML_SCHEMAS_ELEM_BLOCK_SUBSTITUTION: - * - * disallowed substitutions: "substituion" - */ -#define XML_SCHEMAS_ELEM_BLOCK_SUBSTITUTION 1 << 13 -/** - * XML_SCHEMAS_ELEM_FINAL_ABSENT: - * - * substitution group exclusions are absent - */ -#define XML_SCHEMAS_ELEM_FINAL_ABSENT 1 << 14 -/** - * XML_SCHEMAS_ELEM_FINAL_EXTENSION: - * - * substitution group exclusions: "extension" - */ -#define XML_SCHEMAS_ELEM_FINAL_EXTENSION 1 << 15 -/** - * XML_SCHEMAS_ELEM_FINAL_RESTRICTION: - * - * substitution group exclusions: "restriction" - */ -#define XML_SCHEMAS_ELEM_FINAL_RESTRICTION 1 << 16 -/** - * XML_SCHEMAS_ELEM_SUBST_GROUP_HEAD: - * - * the declaration is a substitution group head - */ -#define XML_SCHEMAS_ELEM_SUBST_GROUP_HEAD 1 << 17 -/** - * XML_SCHEMAS_ELEM_INTERNAL_CHECKED: - * - * this is set when the elem decl has been checked against - * all constraints - */ -#define XML_SCHEMAS_ELEM_INTERNAL_CHECKED 1 << 18 - -typedef struct _xmlSchemaElement xmlSchemaElement; -typedef xmlSchemaElement *xmlSchemaElementPtr; -struct _xmlSchemaElement { - xmlSchemaTypeType type; /* The kind of type */ - struct _xmlSchemaType *next; /* Not used? */ - const xmlChar *name; - const xmlChar *id; /* Deprecated; not used */ - const xmlChar *ref; /* Deprecated; not used */ - const xmlChar *refNs; /* Deprecated; not used */ - xmlSchemaAnnotPtr annot; - xmlSchemaTypePtr subtypes; /* the type definition */ - xmlSchemaAttributePtr attributes; - xmlNodePtr node; - int minOccurs; /* Deprecated; not used */ - int maxOccurs; /* Deprecated; not used */ - - int flags; - const xmlChar *targetNamespace; - const xmlChar *namedType; - const xmlChar *namedTypeNs; - const xmlChar *substGroup; - const xmlChar *substGroupNs; - const xmlChar *scope; - const xmlChar *value; /* The original value of the value constraint. */ - struct _xmlSchemaElement *refDecl; /* This will now be used for the - substitution group affiliation */ - xmlRegexpPtr contModel; /* Obsolete for WXS, maybe used for RelaxNG */ - xmlSchemaContentType contentType; - const xmlChar *refPrefix; /* Deprecated; not used */ - xmlSchemaValPtr defVal; /* The compiled value contraint. */ - void *idcs; /* The identity-constraint defs */ -}; - -/* - * XML_SCHEMAS_FACET_UNKNOWN: - * - * unknown facet handling - */ -#define XML_SCHEMAS_FACET_UNKNOWN 0 -/* - * XML_SCHEMAS_FACET_PRESERVE: - * - * preserve the type of the facet - */ -#define XML_SCHEMAS_FACET_PRESERVE 1 -/* - * XML_SCHEMAS_FACET_REPLACE: - * - * replace the type of the facet - */ -#define XML_SCHEMAS_FACET_REPLACE 2 -/* - * XML_SCHEMAS_FACET_COLLAPSE: - * - * collapse the types of the facet - */ -#define XML_SCHEMAS_FACET_COLLAPSE 3 -/** - * A facet definition. - */ -struct _xmlSchemaFacet { - xmlSchemaTypeType type; /* The kind of type */ - struct _xmlSchemaFacet *next;/* the next type if in a sequence ... */ - const xmlChar *value; /* The original value */ - const xmlChar *id; /* Obsolete */ - xmlSchemaAnnotPtr annot; - xmlNodePtr node; - int fixed; /* XML_SCHEMAS_FACET_PRESERVE, etc. */ - int whitespace; - xmlSchemaValPtr val; /* The compiled value */ - xmlRegexpPtr regexp; /* The regex for patterns */ -}; - -/** - * A notation definition. - */ -typedef struct _xmlSchemaNotation xmlSchemaNotation; -typedef xmlSchemaNotation *xmlSchemaNotationPtr; -struct _xmlSchemaNotation { - xmlSchemaTypeType type; /* The kind of type */ - const xmlChar *name; - xmlSchemaAnnotPtr annot; - const xmlChar *identifier; - const xmlChar *targetNamespace; -}; - -/* -* TODO: Actually all those flags used for the schema should sit -* on the schema parser context, since they are used only -* during parsing an XML schema document, and not available -* on the component level as per spec. -*/ -/** - * XML_SCHEMAS_QUALIF_ELEM: - * - * Reflects elementFormDefault == qualified in - * an XML schema document. - */ -#define XML_SCHEMAS_QUALIF_ELEM 1 << 0 -/** - * XML_SCHEMAS_QUALIF_ATTR: - * - * Reflects attributeFormDefault == qualified in - * an XML schema document. - */ -#define XML_SCHEMAS_QUALIF_ATTR 1 << 1 -/** - * XML_SCHEMAS_FINAL_DEFAULT_EXTENSION: - * - * the schema has "extension" in the set of finalDefault. - */ -#define XML_SCHEMAS_FINAL_DEFAULT_EXTENSION 1 << 2 -/** - * XML_SCHEMAS_FINAL_DEFAULT_RESTRICTION: - * - * the schema has "restriction" in the set of finalDefault. - */ -#define XML_SCHEMAS_FINAL_DEFAULT_RESTRICTION 1 << 3 -/** - * XML_SCHEMAS_FINAL_DEFAULT_LIST: - * - * the cshema has "list" in the set of finalDefault. - */ -#define XML_SCHEMAS_FINAL_DEFAULT_LIST 1 << 4 -/** - * XML_SCHEMAS_FINAL_DEFAULT_UNION: - * - * the schema has "union" in the set of finalDefault. - */ -#define XML_SCHEMAS_FINAL_DEFAULT_UNION 1 << 5 -/** - * XML_SCHEMAS_BLOCK_DEFAULT_EXTENSION: - * - * the schema has "extension" in the set of blockDefault. - */ -#define XML_SCHEMAS_BLOCK_DEFAULT_EXTENSION 1 << 6 -/** - * XML_SCHEMAS_BLOCK_DEFAULT_RESTRICTION: - * - * the schema has "restriction" in the set of blockDefault. - */ -#define XML_SCHEMAS_BLOCK_DEFAULT_RESTRICTION 1 << 7 -/** - * XML_SCHEMAS_BLOCK_DEFAULT_SUBSTITUTION: - * - * the schema has "substitution" in the set of blockDefault. - */ -#define XML_SCHEMAS_BLOCK_DEFAULT_SUBSTITUTION 1 << 8 -/** - * XML_SCHEMAS_INCLUDING_CONVERT_NS: - * - * the schema is currently including an other schema with - * no target namespace. - */ -#define XML_SCHEMAS_INCLUDING_CONVERT_NS 1 << 9 -/** - * _xmlSchema: - * - * A Schemas definition - */ -struct _xmlSchema { - const xmlChar *name; /* schema name */ - const xmlChar *targetNamespace; /* the target namespace */ - const xmlChar *version; - const xmlChar *id; /* Obsolete */ - xmlDocPtr doc; - xmlSchemaAnnotPtr annot; - int flags; - - xmlHashTablePtr typeDecl; - xmlHashTablePtr attrDecl; - xmlHashTablePtr attrgrpDecl; - xmlHashTablePtr elemDecl; - xmlHashTablePtr notaDecl; - - xmlHashTablePtr schemasImports; - - void *_private; /* unused by the library for users or bindings */ - xmlHashTablePtr groupDecl; - xmlDictPtr dict; - void *includes; /* the includes, this is opaque for now */ - int preserve; /* whether to free the document */ - int counter; /* used to give ononymous components unique names */ - xmlHashTablePtr idcDef; /* All identity-constraint defs. */ - void *volatiles; /* Obsolete */ -}; - -XMLPUBFUN void XMLCALL xmlSchemaFreeType (xmlSchemaTypePtr type); -XMLPUBFUN void XMLCALL xmlSchemaFreeWildcard(xmlSchemaWildcardPtr wildcard); - -#ifdef __cplusplus -} -#endif - -#endif /* LIBXML_SCHEMAS_ENABLED */ -#endif /* __XML_SCHEMA_INTERNALS_H__ */ diff --git a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/schematron.h b/cocos2dx/platform/third_party/emscripten/libxml2/libxml/schematron.h deleted file mode 100644 index 364eaecde6..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/schematron.h +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Summary: XML Schemastron implementation - * Description: interface to the XML Schematron validity checking. - * - * Copy: See Copyright for the status of this software. - * - * Author: Daniel Veillard - */ - - -#ifndef __XML_SCHEMATRON_H__ -#define __XML_SCHEMATRON_H__ - -#include - -#ifdef LIBXML_SCHEMATRON_ENABLED - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef enum { - XML_SCHEMATRON_OUT_QUIET = 1 << 0, /* quiet no report */ - XML_SCHEMATRON_OUT_TEXT = 1 << 1, /* build a textual report */ - XML_SCHEMATRON_OUT_XML = 1 << 2, /* output SVRL */ - XML_SCHEMATRON_OUT_ERROR = 1 << 3, /* output via xmlStructuredErrorFunc */ - XML_SCHEMATRON_OUT_FILE = 1 << 8, /* output to a file descriptor */ - XML_SCHEMATRON_OUT_BUFFER = 1 << 9, /* output to a buffer */ - XML_SCHEMATRON_OUT_IO = 1 << 10 /* output to I/O mechanism */ -} xmlSchematronValidOptions; - -/** - * The schemas related types are kept internal - */ -typedef struct _xmlSchematron xmlSchematron; -typedef xmlSchematron *xmlSchematronPtr; - -/** - * xmlSchematronValidityErrorFunc: - * @ctx: the validation context - * @msg: the message - * @...: extra arguments - * - * Signature of an error callback from a Schematron validation - */ -typedef void (*xmlSchematronValidityErrorFunc) (void *ctx, const char *msg, ...); - -/** - * xmlSchematronValidityWarningFunc: - * @ctx: the validation context - * @msg: the message - * @...: extra arguments - * - * Signature of a warning callback from a Schematron validation - */ -typedef void (*xmlSchematronValidityWarningFunc) (void *ctx, const char *msg, ...); - -/** - * A schemas validation context - */ -typedef struct _xmlSchematronParserCtxt xmlSchematronParserCtxt; -typedef xmlSchematronParserCtxt *xmlSchematronParserCtxtPtr; - -typedef struct _xmlSchematronValidCtxt xmlSchematronValidCtxt; -typedef xmlSchematronValidCtxt *xmlSchematronValidCtxtPtr; - -/* - * Interfaces for parsing. - */ -XMLPUBFUN xmlSchematronParserCtxtPtr XMLCALL - xmlSchematronNewParserCtxt (const char *URL); -XMLPUBFUN xmlSchematronParserCtxtPtr XMLCALL - xmlSchematronNewMemParserCtxt(const char *buffer, - int size); -XMLPUBFUN xmlSchematronParserCtxtPtr XMLCALL - xmlSchematronNewDocParserCtxt(xmlDocPtr doc); -XMLPUBFUN void XMLCALL - xmlSchematronFreeParserCtxt (xmlSchematronParserCtxtPtr ctxt); -/***** -XMLPUBFUN void XMLCALL - xmlSchematronSetParserErrors(xmlSchematronParserCtxtPtr ctxt, - xmlSchematronValidityErrorFunc err, - xmlSchematronValidityWarningFunc warn, - void *ctx); -XMLPUBFUN int XMLCALL - xmlSchematronGetParserErrors(xmlSchematronParserCtxtPtr ctxt, - xmlSchematronValidityErrorFunc * err, - xmlSchematronValidityWarningFunc * warn, - void **ctx); -XMLPUBFUN int XMLCALL - xmlSchematronIsValid (xmlSchematronValidCtxtPtr ctxt); - *****/ -XMLPUBFUN xmlSchematronPtr XMLCALL - xmlSchematronParse (xmlSchematronParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL - xmlSchematronFree (xmlSchematronPtr schema); -/* - * Interfaces for validating - */ -XMLPUBFUN void XMLCALL - xmlSchematronSetValidStructuredErrors( - xmlSchematronValidCtxtPtr ctxt, - xmlStructuredErrorFunc serror, - void *ctx); -/****** -XMLPUBFUN void XMLCALL - xmlSchematronSetValidErrors (xmlSchematronValidCtxtPtr ctxt, - xmlSchematronValidityErrorFunc err, - xmlSchematronValidityWarningFunc warn, - void *ctx); -XMLPUBFUN int XMLCALL - xmlSchematronGetValidErrors (xmlSchematronValidCtxtPtr ctxt, - xmlSchematronValidityErrorFunc *err, - xmlSchematronValidityWarningFunc *warn, - void **ctx); -XMLPUBFUN int XMLCALL - xmlSchematronSetValidOptions(xmlSchematronValidCtxtPtr ctxt, - int options); -XMLPUBFUN int XMLCALL - xmlSchematronValidCtxtGetOptions(xmlSchematronValidCtxtPtr ctxt); -XMLPUBFUN int XMLCALL - xmlSchematronValidateOneElement (xmlSchematronValidCtxtPtr ctxt, - xmlNodePtr elem); - *******/ - -XMLPUBFUN xmlSchematronValidCtxtPtr XMLCALL - xmlSchematronNewValidCtxt (xmlSchematronPtr schema, - int options); -XMLPUBFUN void XMLCALL - xmlSchematronFreeValidCtxt (xmlSchematronValidCtxtPtr ctxt); -XMLPUBFUN int XMLCALL - xmlSchematronValidateDoc (xmlSchematronValidCtxtPtr ctxt, - xmlDocPtr instance); - -#ifdef __cplusplus -} -#endif - -#endif /* LIBXML_SCHEMATRON_ENABLED */ -#endif /* __XML_SCHEMATRON_H__ */ diff --git a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/threads.h b/cocos2dx/platform/third_party/emscripten/libxml2/libxml/threads.h deleted file mode 100644 index d31f16acbd..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/threads.h +++ /dev/null @@ -1,84 +0,0 @@ -/** - * Summary: interfaces for thread handling - * Description: set of generic threading related routines - * should work with pthreads, Windows native or TLS threads - * - * Copy: See Copyright for the status of this software. - * - * Author: Daniel Veillard - */ - -#ifndef __XML_THREADS_H__ -#define __XML_THREADS_H__ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * xmlMutex are a simple mutual exception locks. - */ -typedef struct _xmlMutex xmlMutex; -typedef xmlMutex *xmlMutexPtr; - -/* - * xmlRMutex are reentrant mutual exception locks. - */ -typedef struct _xmlRMutex xmlRMutex; -typedef xmlRMutex *xmlRMutexPtr; - -#ifdef __cplusplus -} -#endif -#include -#ifdef __cplusplus -extern "C" { -#endif -XMLPUBFUN xmlMutexPtr XMLCALL - xmlNewMutex (void); -XMLPUBFUN void XMLCALL - xmlMutexLock (xmlMutexPtr tok); -XMLPUBFUN void XMLCALL - xmlMutexUnlock (xmlMutexPtr tok); -XMLPUBFUN void XMLCALL - xmlFreeMutex (xmlMutexPtr tok); - -XMLPUBFUN xmlRMutexPtr XMLCALL - xmlNewRMutex (void); -XMLPUBFUN void XMLCALL - xmlRMutexLock (xmlRMutexPtr tok); -XMLPUBFUN void XMLCALL - xmlRMutexUnlock (xmlRMutexPtr tok); -XMLPUBFUN void XMLCALL - xmlFreeRMutex (xmlRMutexPtr tok); - -/* - * Library wide APIs. - */ -XMLPUBFUN void XMLCALL - xmlInitThreads (void); -XMLPUBFUN void XMLCALL - xmlLockLibrary (void); -XMLPUBFUN void XMLCALL - xmlUnlockLibrary(void); -XMLPUBFUN int XMLCALL - xmlGetThreadId (void); -XMLPUBFUN int XMLCALL - xmlIsMainThread (void); -XMLPUBFUN void XMLCALL - xmlCleanupThreads(void); -XMLPUBFUN xmlGlobalStatePtr XMLCALL - xmlGetGlobalState(void); - -#if defined(HAVE_WIN32_THREADS) && !defined(HAVE_COMPILER_TLS) && defined(LIBXML_STATIC_FOR_DLL) -int XMLCALL xmlDllMain(void *hinstDLL, unsigned long fdwReason, void *lpvReserved); -#endif - -#ifdef __cplusplus -} -#endif - - -#endif /* __XML_THREADS_H__ */ diff --git a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/tree.h b/cocos2dx/platform/third_party/emscripten/libxml2/libxml/tree.h deleted file mode 100644 index 7e06686af3..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/tree.h +++ /dev/null @@ -1,1303 +0,0 @@ -/* - * Summary: interfaces for tree manipulation - * Description: this module describes the structures found in an tree resulting - * from an XML or HTML parsing, as well as the API provided for - * various processing on that tree - * - * Copy: See Copyright for the status of this software. - * - * Author: Daniel Veillard - */ - -#ifndef __XML_TREE_H__ -#define __XML_TREE_H__ - -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Some of the basic types pointer to structures: - */ -/* xmlIO.h */ -typedef struct _xmlParserInputBuffer xmlParserInputBuffer; -typedef xmlParserInputBuffer *xmlParserInputBufferPtr; - -typedef struct _xmlOutputBuffer xmlOutputBuffer; -typedef xmlOutputBuffer *xmlOutputBufferPtr; - -/* parser.h */ -typedef struct _xmlParserInput xmlParserInput; -typedef xmlParserInput *xmlParserInputPtr; - -typedef struct _xmlParserCtxt xmlParserCtxt; -typedef xmlParserCtxt *xmlParserCtxtPtr; - -typedef struct _xmlSAXLocator xmlSAXLocator; -typedef xmlSAXLocator *xmlSAXLocatorPtr; - -typedef struct _xmlSAXHandler xmlSAXHandler; -typedef xmlSAXHandler *xmlSAXHandlerPtr; - -/* entities.h */ -typedef struct _xmlEntity xmlEntity; -typedef xmlEntity *xmlEntityPtr; - -/** - * BASE_BUFFER_SIZE: - * - * default buffer size 4000. - */ -#define BASE_BUFFER_SIZE 4096 - -/** - * LIBXML_NAMESPACE_DICT: - * - * Defines experimental behaviour: - * 1) xmlNs gets an additional field @context (a xmlDoc) - * 2) when creating a tree, xmlNs->href is stored in the dict of xmlDoc. - */ -/* #define LIBXML_NAMESPACE_DICT */ - -/** - * xmlBufferAllocationScheme: - * - * A buffer allocation scheme can be defined to either match exactly the - * need or double it's allocated size each time it is found too small. - */ - -typedef enum { - XML_BUFFER_ALLOC_DOUBLEIT, /* double each time one need to grow */ - XML_BUFFER_ALLOC_EXACT, /* grow only to the minimal size */ - XML_BUFFER_ALLOC_IMMUTABLE, /* immutable buffer */ - XML_BUFFER_ALLOC_IO, /* special allocation scheme used for I/O */ - XML_BUFFER_ALLOC_HYBRID /* exact up to a threshold, and doubleit thereafter */ -} xmlBufferAllocationScheme; - -/** - * xmlBuffer: - * - * A buffer structure, this old construct is limited to 2GB and - * is being deprecated, use API with xmlBuf instead - */ -typedef struct _xmlBuffer xmlBuffer; -typedef xmlBuffer *xmlBufferPtr; -struct _xmlBuffer { - xmlChar *content; /* The buffer content UTF8 */ - unsigned int use; /* The buffer size used */ - unsigned int size; /* The buffer size */ - xmlBufferAllocationScheme alloc; /* The realloc method */ - xmlChar *contentIO; /* in IO mode we may have a different base */ -}; - -/** - * xmlBuf: - * - * A buffer structure, new one, the actual structure internals are not public - */ - -typedef struct _xmlBuf xmlBuf; - -/** - * xmlBufPtr: - * - * A pointer to a buffer structure, the actual structure internals are not - * public - */ - -typedef xmlBuf *xmlBufPtr; - -/* - * A few public routines for xmlBuf. As those are expected to be used - * mostly internally the bulk of the routines are internal in buf.h - */ -XMLPUBFUN xmlChar* XMLCALL xmlBufContent (const xmlBufPtr buf); -XMLPUBFUN xmlChar* XMLCALL xmlBufEnd (const xmlBufPtr buf); -XMLPUBFUN size_t XMLCALL xmlBufUse (const xmlBufPtr buf); -XMLPUBFUN size_t XMLCALL xmlBufShrink (xmlBufPtr buf, size_t len); - -/* - * LIBXML2_NEW_BUFFER: - * - * Macro used to express that the API use the new buffers for - * xmlParserInputBuffer and xmlOutputBuffer. The change was - * introduced in 2.9.0. - */ -#define LIBXML2_NEW_BUFFER - -/** - * XML_XML_NAMESPACE: - * - * This is the namespace for the special xml: prefix predefined in the - * XML Namespace specification. - */ -#define XML_XML_NAMESPACE \ - (const xmlChar *) "http://www.w3.org/XML/1998/namespace" - -/** - * XML_XML_ID: - * - * This is the name for the special xml:id attribute - */ -#define XML_XML_ID (const xmlChar *) "xml:id" - -/* - * The different element types carried by an XML tree. - * - * NOTE: This is synchronized with DOM Level1 values - * See http://www.w3.org/TR/REC-DOM-Level-1/ - * - * Actually this had diverged a bit, and now XML_DOCUMENT_TYPE_NODE should - * be deprecated to use an XML_DTD_NODE. - */ -typedef enum { - XML_ELEMENT_NODE= 1, - XML_ATTRIBUTE_NODE= 2, - XML_TEXT_NODE= 3, - XML_CDATA_SECTION_NODE= 4, - XML_ENTITY_REF_NODE= 5, - XML_ENTITY_NODE= 6, - XML_PI_NODE= 7, - XML_COMMENT_NODE= 8, - XML_DOCUMENT_NODE= 9, - XML_DOCUMENT_TYPE_NODE= 10, - XML_DOCUMENT_FRAG_NODE= 11, - XML_NOTATION_NODE= 12, - XML_HTML_DOCUMENT_NODE= 13, - XML_DTD_NODE= 14, - XML_ELEMENT_DECL= 15, - XML_ATTRIBUTE_DECL= 16, - XML_ENTITY_DECL= 17, - XML_NAMESPACE_DECL= 18, - XML_XINCLUDE_START= 19, - XML_XINCLUDE_END= 20 -#ifdef LIBXML_DOCB_ENABLED - ,XML_DOCB_DOCUMENT_NODE= 21 -#endif -} xmlElementType; - - -/** - * xmlNotation: - * - * A DTD Notation definition. - */ - -typedef struct _xmlNotation xmlNotation; -typedef xmlNotation *xmlNotationPtr; -struct _xmlNotation { - const xmlChar *name; /* Notation name */ - const xmlChar *PublicID; /* Public identifier, if any */ - const xmlChar *SystemID; /* System identifier, if any */ -}; - -/** - * xmlAttributeType: - * - * A DTD Attribute type definition. - */ - -typedef enum { - XML_ATTRIBUTE_CDATA = 1, - XML_ATTRIBUTE_ID, - XML_ATTRIBUTE_IDREF , - XML_ATTRIBUTE_IDREFS, - XML_ATTRIBUTE_ENTITY, - XML_ATTRIBUTE_ENTITIES, - XML_ATTRIBUTE_NMTOKEN, - XML_ATTRIBUTE_NMTOKENS, - XML_ATTRIBUTE_ENUMERATION, - XML_ATTRIBUTE_NOTATION -} xmlAttributeType; - -/** - * xmlAttributeDefault: - * - * A DTD Attribute default definition. - */ - -typedef enum { - XML_ATTRIBUTE_NONE = 1, - XML_ATTRIBUTE_REQUIRED, - XML_ATTRIBUTE_IMPLIED, - XML_ATTRIBUTE_FIXED -} xmlAttributeDefault; - -/** - * xmlEnumeration: - * - * List structure used when there is an enumeration in DTDs. - */ - -typedef struct _xmlEnumeration xmlEnumeration; -typedef xmlEnumeration *xmlEnumerationPtr; -struct _xmlEnumeration { - struct _xmlEnumeration *next; /* next one */ - const xmlChar *name; /* Enumeration name */ -}; - -/** - * xmlAttribute: - * - * An Attribute declaration in a DTD. - */ - -typedef struct _xmlAttribute xmlAttribute; -typedef xmlAttribute *xmlAttributePtr; -struct _xmlAttribute { - void *_private; /* application data */ - xmlElementType type; /* XML_ATTRIBUTE_DECL, must be second ! */ - const xmlChar *name; /* Attribute name */ - struct _xmlNode *children; /* NULL */ - struct _xmlNode *last; /* NULL */ - struct _xmlDtd *parent; /* -> DTD */ - struct _xmlNode *next; /* next sibling link */ - struct _xmlNode *prev; /* previous sibling link */ - struct _xmlDoc *doc; /* the containing document */ - - struct _xmlAttribute *nexth; /* next in hash table */ - xmlAttributeType atype; /* The attribute type */ - xmlAttributeDefault def; /* the default */ - const xmlChar *defaultValue; /* or the default value */ - xmlEnumerationPtr tree; /* or the enumeration tree if any */ - const xmlChar *prefix; /* the namespace prefix if any */ - const xmlChar *elem; /* Element holding the attribute */ -}; - -/** - * xmlElementContentType: - * - * Possible definitions of element content types. - */ -typedef enum { - XML_ELEMENT_CONTENT_PCDATA = 1, - XML_ELEMENT_CONTENT_ELEMENT, - XML_ELEMENT_CONTENT_SEQ, - XML_ELEMENT_CONTENT_OR -} xmlElementContentType; - -/** - * xmlElementContentOccur: - * - * Possible definitions of element content occurrences. - */ -typedef enum { - XML_ELEMENT_CONTENT_ONCE = 1, - XML_ELEMENT_CONTENT_OPT, - XML_ELEMENT_CONTENT_MULT, - XML_ELEMENT_CONTENT_PLUS -} xmlElementContentOccur; - -/** - * xmlElementContent: - * - * An XML Element content as stored after parsing an element definition - * in a DTD. - */ - -typedef struct _xmlElementContent xmlElementContent; -typedef xmlElementContent *xmlElementContentPtr; -struct _xmlElementContent { - xmlElementContentType type; /* PCDATA, ELEMENT, SEQ or OR */ - xmlElementContentOccur ocur; /* ONCE, OPT, MULT or PLUS */ - const xmlChar *name; /* Element name */ - struct _xmlElementContent *c1; /* first child */ - struct _xmlElementContent *c2; /* second child */ - struct _xmlElementContent *parent; /* parent */ - const xmlChar *prefix; /* Namespace prefix */ -}; - -/** - * xmlElementTypeVal: - * - * The different possibilities for an element content type. - */ - -typedef enum { - XML_ELEMENT_TYPE_UNDEFINED = 0, - XML_ELEMENT_TYPE_EMPTY = 1, - XML_ELEMENT_TYPE_ANY, - XML_ELEMENT_TYPE_MIXED, - XML_ELEMENT_TYPE_ELEMENT -} xmlElementTypeVal; - -#ifdef __cplusplus -} -#endif -#include -#ifdef __cplusplus -extern "C" { -#endif - -/** - * xmlElement: - * - * An XML Element declaration from a DTD. - */ - -typedef struct _xmlElement xmlElement; -typedef xmlElement *xmlElementPtr; -struct _xmlElement { - void *_private; /* application data */ - xmlElementType type; /* XML_ELEMENT_DECL, must be second ! */ - const xmlChar *name; /* Element name */ - struct _xmlNode *children; /* NULL */ - struct _xmlNode *last; /* NULL */ - struct _xmlDtd *parent; /* -> DTD */ - struct _xmlNode *next; /* next sibling link */ - struct _xmlNode *prev; /* previous sibling link */ - struct _xmlDoc *doc; /* the containing document */ - - xmlElementTypeVal etype; /* The type */ - xmlElementContentPtr content; /* the allowed element content */ - xmlAttributePtr attributes; /* List of the declared attributes */ - const xmlChar *prefix; /* the namespace prefix if any */ -#ifdef LIBXML_REGEXP_ENABLED - xmlRegexpPtr contModel; /* the validating regexp */ -#else - void *contModel; -#endif -}; - - -/** - * XML_LOCAL_NAMESPACE: - * - * A namespace declaration node. - */ -#define XML_LOCAL_NAMESPACE XML_NAMESPACE_DECL -typedef xmlElementType xmlNsType; - -/** - * xmlNs: - * - * An XML namespace. - * Note that prefix == NULL is valid, it defines the default namespace - * within the subtree (until overridden). - * - * xmlNsType is unified with xmlElementType. - */ - -typedef struct _xmlNs xmlNs; -typedef xmlNs *xmlNsPtr; -struct _xmlNs { - struct _xmlNs *next; /* next Ns link for this node */ - xmlNsType type; /* global or local */ - const xmlChar *href; /* URL for the namespace */ - const xmlChar *prefix; /* prefix for the namespace */ - void *_private; /* application data */ - struct _xmlDoc *context; /* normally an xmlDoc */ -}; - -/** - * xmlDtd: - * - * An XML DTD, as defined by parent link */ - struct _xmlNode *next; /* next sibling link */ - struct _xmlNode *prev; /* previous sibling link */ - struct _xmlDoc *doc; /* the containing document */ - - /* End of common part */ - void *notations; /* Hash table for notations if any */ - void *elements; /* Hash table for elements if any */ - void *attributes; /* Hash table for attributes if any */ - void *entities; /* Hash table for entities if any */ - const xmlChar *ExternalID; /* External identifier for PUBLIC DTD */ - const xmlChar *SystemID; /* URI for a SYSTEM or PUBLIC DTD */ - void *pentities; /* Hash table for param entities if any */ -}; - -/** - * xmlAttr: - * - * An attribute on an XML node. - */ -typedef struct _xmlAttr xmlAttr; -typedef xmlAttr *xmlAttrPtr; -struct _xmlAttr { - void *_private; /* application data */ - xmlElementType type; /* XML_ATTRIBUTE_NODE, must be second ! */ - const xmlChar *name; /* the name of the property */ - struct _xmlNode *children; /* the value of the property */ - struct _xmlNode *last; /* NULL */ - struct _xmlNode *parent; /* child->parent link */ - struct _xmlAttr *next; /* next sibling link */ - struct _xmlAttr *prev; /* previous sibling link */ - struct _xmlDoc *doc; /* the containing document */ - xmlNs *ns; /* pointer to the associated namespace */ - xmlAttributeType atype; /* the attribute type if validating */ - void *psvi; /* for type/PSVI informations */ -}; - -/** - * xmlID: - * - * An XML ID instance. - */ - -typedef struct _xmlID xmlID; -typedef xmlID *xmlIDPtr; -struct _xmlID { - struct _xmlID *next; /* next ID */ - const xmlChar *value; /* The ID name */ - xmlAttrPtr attr; /* The attribute holding it */ - const xmlChar *name; /* The attribute if attr is not available */ - int lineno; /* The line number if attr is not available */ - struct _xmlDoc *doc; /* The document holding the ID */ -}; - -/** - * xmlRef: - * - * An XML IDREF instance. - */ - -typedef struct _xmlRef xmlRef; -typedef xmlRef *xmlRefPtr; -struct _xmlRef { - struct _xmlRef *next; /* next Ref */ - const xmlChar *value; /* The Ref name */ - xmlAttrPtr attr; /* The attribute holding it */ - const xmlChar *name; /* The attribute if attr is not available */ - int lineno; /* The line number if attr is not available */ -}; - -/** - * xmlNode: - * - * A node in an XML tree. - */ -typedef struct _xmlNode xmlNode; -typedef xmlNode *xmlNodePtr; -struct _xmlNode { - void *_private; /* application data */ - xmlElementType type; /* type number, must be second ! */ - const xmlChar *name; /* the name of the node, or the entity */ - struct _xmlNode *children; /* parent->childs link */ - struct _xmlNode *last; /* last child link */ - struct _xmlNode *parent; /* child->parent link */ - struct _xmlNode *next; /* next sibling link */ - struct _xmlNode *prev; /* previous sibling link */ - struct _xmlDoc *doc; /* the containing document */ - - /* End of common part */ - xmlNs *ns; /* pointer to the associated namespace */ - xmlChar *content; /* the content */ - struct _xmlAttr *properties;/* properties list */ - xmlNs *nsDef; /* namespace definitions on this node */ - void *psvi; /* for type/PSVI informations */ - unsigned short line; /* line number */ - unsigned short extra; /* extra data for XPath/XSLT */ -}; - -/** - * XML_GET_CONTENT: - * - * Macro to extract the content pointer of a node. - */ -#define XML_GET_CONTENT(n) \ - ((n)->type == XML_ELEMENT_NODE ? NULL : (n)->content) - -/** - * XML_GET_LINE: - * - * Macro to extract the line number of an element node. - */ -#define XML_GET_LINE(n) \ - (xmlGetLineNo(n)) - -/** - * xmlDocProperty - * - * Set of properties of the document as found by the parser - * Some of them are linked to similary named xmlParserOption - */ -typedef enum { - XML_DOC_WELLFORMED = 1<<0, /* document is XML well formed */ - XML_DOC_NSVALID = 1<<1, /* document is Namespace valid */ - XML_DOC_OLD10 = 1<<2, /* parsed with old XML-1.0 parser */ - XML_DOC_DTDVALID = 1<<3, /* DTD validation was successful */ - XML_DOC_XINCLUDE = 1<<4, /* XInclude substitution was done */ - XML_DOC_USERBUILT = 1<<5, /* Document was built using the API - and not by parsing an instance */ - XML_DOC_INTERNAL = 1<<6, /* built for internal processing */ - XML_DOC_HTML = 1<<7 /* parsed or built HTML document */ -} xmlDocProperties; - -/** - * xmlDoc: - * - * An XML document. - */ -typedef struct _xmlDoc xmlDoc; -typedef xmlDoc *xmlDocPtr; -struct _xmlDoc { - void *_private; /* application data */ - xmlElementType type; /* XML_DOCUMENT_NODE, must be second ! */ - char *name; /* name/filename/URI of the document */ - struct _xmlNode *children; /* the document tree */ - struct _xmlNode *last; /* last child link */ - struct _xmlNode *parent; /* child->parent link */ - struct _xmlNode *next; /* next sibling link */ - struct _xmlNode *prev; /* previous sibling link */ - struct _xmlDoc *doc; /* autoreference to itself */ - - /* End of common part */ - int compression;/* level of zlib compression */ - int standalone; /* standalone document (no external refs) - 1 if standalone="yes" - 0 if standalone="no" - -1 if there is no XML declaration - -2 if there is an XML declaration, but no - standalone attribute was specified */ - struct _xmlDtd *intSubset; /* the document internal subset */ - struct _xmlDtd *extSubset; /* the document external subset */ - struct _xmlNs *oldNs; /* Global namespace, the old way */ - const xmlChar *version; /* the XML version string */ - const xmlChar *encoding; /* external initial encoding, if any */ - void *ids; /* Hash table for ID attributes if any */ - void *refs; /* Hash table for IDREFs attributes if any */ - const xmlChar *URL; /* The URI for that document */ - int charset; /* encoding of the in-memory content - actually an xmlCharEncoding */ - struct _xmlDict *dict; /* dict used to allocate names or NULL */ - void *psvi; /* for type/PSVI informations */ - int parseFlags; /* set of xmlParserOption used to parse the - document */ - int properties; /* set of xmlDocProperties for this document - set at the end of parsing */ -}; - - -typedef struct _xmlDOMWrapCtxt xmlDOMWrapCtxt; -typedef xmlDOMWrapCtxt *xmlDOMWrapCtxtPtr; - -/** - * xmlDOMWrapAcquireNsFunction: - * @ctxt: a DOM wrapper context - * @node: the context node (element or attribute) - * @nsName: the requested namespace name - * @nsPrefix: the requested namespace prefix - * - * A function called to acquire namespaces (xmlNs) from the wrapper. - * - * Returns an xmlNsPtr or NULL in case of an error. - */ -typedef xmlNsPtr (*xmlDOMWrapAcquireNsFunction) (xmlDOMWrapCtxtPtr ctxt, - xmlNodePtr node, - const xmlChar *nsName, - const xmlChar *nsPrefix); - -/** - * xmlDOMWrapCtxt: - * - * Context for DOM wrapper-operations. - */ -struct _xmlDOMWrapCtxt { - void * _private; - /* - * The type of this context, just in case we need specialized - * contexts in the future. - */ - int type; - /* - * Internal namespace map used for various operations. - */ - void * namespaceMap; - /* - * Use this one to acquire an xmlNsPtr intended for node->ns. - * (Note that this is not intended for elem->nsDef). - */ - xmlDOMWrapAcquireNsFunction getNsForNodeFunc; -}; - -/** - * xmlChildrenNode: - * - * Macro for compatibility naming layer with libxml1. Maps - * to "children." - */ -#ifndef xmlChildrenNode -#define xmlChildrenNode children -#endif - -/** - * xmlRootNode: - * - * Macro for compatibility naming layer with libxml1. Maps - * to "children". - */ -#ifndef xmlRootNode -#define xmlRootNode children -#endif - -/* - * Variables. - */ - -/* - * Some helper functions - */ -#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED) || defined (LIBXML_HTML_ENABLED) || defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) -XMLPUBFUN int XMLCALL - xmlValidateNCName (const xmlChar *value, - int space); -#endif - -#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) -XMLPUBFUN int XMLCALL - xmlValidateQName (const xmlChar *value, - int space); -XMLPUBFUN int XMLCALL - xmlValidateName (const xmlChar *value, - int space); -XMLPUBFUN int XMLCALL - xmlValidateNMToken (const xmlChar *value, - int space); -#endif - -XMLPUBFUN xmlChar * XMLCALL - xmlBuildQName (const xmlChar *ncname, - const xmlChar *prefix, - xmlChar *memory, - int len); -XMLPUBFUN xmlChar * XMLCALL - xmlSplitQName2 (const xmlChar *name, - xmlChar **prefix); -XMLPUBFUN const xmlChar * XMLCALL - xmlSplitQName3 (const xmlChar *name, - int *len); - -/* - * Handling Buffers, the old ones see @xmlBuf for the new ones. - */ - -XMLPUBFUN void XMLCALL - xmlSetBufferAllocationScheme(xmlBufferAllocationScheme scheme); -XMLPUBFUN xmlBufferAllocationScheme XMLCALL - xmlGetBufferAllocationScheme(void); - -XMLPUBFUN xmlBufferPtr XMLCALL - xmlBufferCreate (void); -XMLPUBFUN xmlBufferPtr XMLCALL - xmlBufferCreateSize (size_t size); -XMLPUBFUN xmlBufferPtr XMLCALL - xmlBufferCreateStatic (void *mem, - size_t size); -XMLPUBFUN int XMLCALL - xmlBufferResize (xmlBufferPtr buf, - unsigned int size); -XMLPUBFUN void XMLCALL - xmlBufferFree (xmlBufferPtr buf); -XMLPUBFUN int XMLCALL - xmlBufferDump (FILE *file, - xmlBufferPtr buf); -XMLPUBFUN int XMLCALL - xmlBufferAdd (xmlBufferPtr buf, - const xmlChar *str, - int len); -XMLPUBFUN int XMLCALL - xmlBufferAddHead (xmlBufferPtr buf, - const xmlChar *str, - int len); -XMLPUBFUN int XMLCALL - xmlBufferCat (xmlBufferPtr buf, - const xmlChar *str); -XMLPUBFUN int XMLCALL - xmlBufferCCat (xmlBufferPtr buf, - const char *str); -XMLPUBFUN int XMLCALL - xmlBufferShrink (xmlBufferPtr buf, - unsigned int len); -XMLPUBFUN int XMLCALL - xmlBufferGrow (xmlBufferPtr buf, - unsigned int len); -XMLPUBFUN void XMLCALL - xmlBufferEmpty (xmlBufferPtr buf); -XMLPUBFUN const xmlChar* XMLCALL - xmlBufferContent (const xmlBufferPtr buf); -XMLPUBFUN xmlChar* XMLCALL - xmlBufferDetach (xmlBufferPtr buf); -XMLPUBFUN void XMLCALL - xmlBufferSetAllocationScheme(xmlBufferPtr buf, - xmlBufferAllocationScheme scheme); -XMLPUBFUN int XMLCALL - xmlBufferLength (const xmlBufferPtr buf); - -/* - * Creating/freeing new structures. - */ -XMLPUBFUN xmlDtdPtr XMLCALL - xmlCreateIntSubset (xmlDocPtr doc, - const xmlChar *name, - const xmlChar *ExternalID, - const xmlChar *SystemID); -XMLPUBFUN xmlDtdPtr XMLCALL - xmlNewDtd (xmlDocPtr doc, - const xmlChar *name, - const xmlChar *ExternalID, - const xmlChar *SystemID); -XMLPUBFUN xmlDtdPtr XMLCALL - xmlGetIntSubset (xmlDocPtr doc); -XMLPUBFUN void XMLCALL - xmlFreeDtd (xmlDtdPtr cur); -#ifdef LIBXML_LEGACY_ENABLED -XMLPUBFUN xmlNsPtr XMLCALL - xmlNewGlobalNs (xmlDocPtr doc, - const xmlChar *href, - const xmlChar *prefix); -#endif /* LIBXML_LEGACY_ENABLED */ -XMLPUBFUN xmlNsPtr XMLCALL - xmlNewNs (xmlNodePtr node, - const xmlChar *href, - const xmlChar *prefix); -XMLPUBFUN void XMLCALL - xmlFreeNs (xmlNsPtr cur); -XMLPUBFUN void XMLCALL - xmlFreeNsList (xmlNsPtr cur); -XMLPUBFUN xmlDocPtr XMLCALL - xmlNewDoc (const xmlChar *version); -XMLPUBFUN void XMLCALL - xmlFreeDoc (xmlDocPtr cur); -XMLPUBFUN xmlAttrPtr XMLCALL - xmlNewDocProp (xmlDocPtr doc, - const xmlChar *name, - const xmlChar *value); -#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || \ - defined(LIBXML_SCHEMAS_ENABLED) -XMLPUBFUN xmlAttrPtr XMLCALL - xmlNewProp (xmlNodePtr node, - const xmlChar *name, - const xmlChar *value); -#endif -XMLPUBFUN xmlAttrPtr XMLCALL - xmlNewNsProp (xmlNodePtr node, - xmlNsPtr ns, - const xmlChar *name, - const xmlChar *value); -XMLPUBFUN xmlAttrPtr XMLCALL - xmlNewNsPropEatName (xmlNodePtr node, - xmlNsPtr ns, - xmlChar *name, - const xmlChar *value); -XMLPUBFUN void XMLCALL - xmlFreePropList (xmlAttrPtr cur); -XMLPUBFUN void XMLCALL - xmlFreeProp (xmlAttrPtr cur); -XMLPUBFUN xmlAttrPtr XMLCALL - xmlCopyProp (xmlNodePtr target, - xmlAttrPtr cur); -XMLPUBFUN xmlAttrPtr XMLCALL - xmlCopyPropList (xmlNodePtr target, - xmlAttrPtr cur); -#ifdef LIBXML_TREE_ENABLED -XMLPUBFUN xmlDtdPtr XMLCALL - xmlCopyDtd (xmlDtdPtr dtd); -#endif /* LIBXML_TREE_ENABLED */ -#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) -XMLPUBFUN xmlDocPtr XMLCALL - xmlCopyDoc (xmlDocPtr doc, - int recursive); -#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) */ -/* - * Creating new nodes. - */ -XMLPUBFUN xmlNodePtr XMLCALL - xmlNewDocNode (xmlDocPtr doc, - xmlNsPtr ns, - const xmlChar *name, - const xmlChar *content); -XMLPUBFUN xmlNodePtr XMLCALL - xmlNewDocNodeEatName (xmlDocPtr doc, - xmlNsPtr ns, - xmlChar *name, - const xmlChar *content); -XMLPUBFUN xmlNodePtr XMLCALL - xmlNewNode (xmlNsPtr ns, - const xmlChar *name); -XMLPUBFUN xmlNodePtr XMLCALL - xmlNewNodeEatName (xmlNsPtr ns, - xmlChar *name); -#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) -XMLPUBFUN xmlNodePtr XMLCALL - xmlNewChild (xmlNodePtr parent, - xmlNsPtr ns, - const xmlChar *name, - const xmlChar *content); -#endif -XMLPUBFUN xmlNodePtr XMLCALL - xmlNewDocText (xmlDocPtr doc, - const xmlChar *content); -XMLPUBFUN xmlNodePtr XMLCALL - xmlNewText (const xmlChar *content); -XMLPUBFUN xmlNodePtr XMLCALL - xmlNewDocPI (xmlDocPtr doc, - const xmlChar *name, - const xmlChar *content); -XMLPUBFUN xmlNodePtr XMLCALL - xmlNewPI (const xmlChar *name, - const xmlChar *content); -XMLPUBFUN xmlNodePtr XMLCALL - xmlNewDocTextLen (xmlDocPtr doc, - const xmlChar *content, - int len); -XMLPUBFUN xmlNodePtr XMLCALL - xmlNewTextLen (const xmlChar *content, - int len); -XMLPUBFUN xmlNodePtr XMLCALL - xmlNewDocComment (xmlDocPtr doc, - const xmlChar *content); -XMLPUBFUN xmlNodePtr XMLCALL - xmlNewComment (const xmlChar *content); -XMLPUBFUN xmlNodePtr XMLCALL - xmlNewCDataBlock (xmlDocPtr doc, - const xmlChar *content, - int len); -XMLPUBFUN xmlNodePtr XMLCALL - xmlNewCharRef (xmlDocPtr doc, - const xmlChar *name); -XMLPUBFUN xmlNodePtr XMLCALL - xmlNewReference (xmlDocPtr doc, - const xmlChar *name); -XMLPUBFUN xmlNodePtr XMLCALL - xmlCopyNode (const xmlNodePtr node, - int recursive); -XMLPUBFUN xmlNodePtr XMLCALL - xmlDocCopyNode (const xmlNodePtr node, - xmlDocPtr doc, - int recursive); -XMLPUBFUN xmlNodePtr XMLCALL - xmlDocCopyNodeList (xmlDocPtr doc, - const xmlNodePtr node); -XMLPUBFUN xmlNodePtr XMLCALL - xmlCopyNodeList (const xmlNodePtr node); -#ifdef LIBXML_TREE_ENABLED -XMLPUBFUN xmlNodePtr XMLCALL - xmlNewTextChild (xmlNodePtr parent, - xmlNsPtr ns, - const xmlChar *name, - const xmlChar *content); -XMLPUBFUN xmlNodePtr XMLCALL - xmlNewDocRawNode (xmlDocPtr doc, - xmlNsPtr ns, - const xmlChar *name, - const xmlChar *content); -XMLPUBFUN xmlNodePtr XMLCALL - xmlNewDocFragment (xmlDocPtr doc); -#endif /* LIBXML_TREE_ENABLED */ - -/* - * Navigating. - */ -XMLPUBFUN long XMLCALL - xmlGetLineNo (xmlNodePtr node); -#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED) -XMLPUBFUN xmlChar * XMLCALL - xmlGetNodePath (xmlNodePtr node); -#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED) */ -XMLPUBFUN xmlNodePtr XMLCALL - xmlDocGetRootElement (xmlDocPtr doc); -XMLPUBFUN xmlNodePtr XMLCALL - xmlGetLastChild (xmlNodePtr parent); -XMLPUBFUN int XMLCALL - xmlNodeIsText (xmlNodePtr node); -XMLPUBFUN int XMLCALL - xmlIsBlankNode (xmlNodePtr node); - -/* - * Changing the structure. - */ -#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) -XMLPUBFUN xmlNodePtr XMLCALL - xmlDocSetRootElement (xmlDocPtr doc, - xmlNodePtr root); -#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) */ -#ifdef LIBXML_TREE_ENABLED -XMLPUBFUN void XMLCALL - xmlNodeSetName (xmlNodePtr cur, - const xmlChar *name); -#endif /* LIBXML_TREE_ENABLED */ -XMLPUBFUN xmlNodePtr XMLCALL - xmlAddChild (xmlNodePtr parent, - xmlNodePtr cur); -XMLPUBFUN xmlNodePtr XMLCALL - xmlAddChildList (xmlNodePtr parent, - xmlNodePtr cur); -#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) -XMLPUBFUN xmlNodePtr XMLCALL - xmlReplaceNode (xmlNodePtr old, - xmlNodePtr cur); -#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) */ -#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || \ - defined(LIBXML_SCHEMAS_ENABLED) -XMLPUBFUN xmlNodePtr XMLCALL - xmlAddPrevSibling (xmlNodePtr cur, - xmlNodePtr elem); -#endif /* LIBXML_TREE_ENABLED || LIBXML_HTML_ENABLED || LIBXML_SCHEMAS_ENABLED */ -XMLPUBFUN xmlNodePtr XMLCALL - xmlAddSibling (xmlNodePtr cur, - xmlNodePtr elem); -XMLPUBFUN xmlNodePtr XMLCALL - xmlAddNextSibling (xmlNodePtr cur, - xmlNodePtr elem); -XMLPUBFUN void XMLCALL - xmlUnlinkNode (xmlNodePtr cur); -XMLPUBFUN xmlNodePtr XMLCALL - xmlTextMerge (xmlNodePtr first, - xmlNodePtr second); -XMLPUBFUN int XMLCALL - xmlTextConcat (xmlNodePtr node, - const xmlChar *content, - int len); -XMLPUBFUN void XMLCALL - xmlFreeNodeList (xmlNodePtr cur); -XMLPUBFUN void XMLCALL - xmlFreeNode (xmlNodePtr cur); -XMLPUBFUN void XMLCALL - xmlSetTreeDoc (xmlNodePtr tree, - xmlDocPtr doc); -XMLPUBFUN void XMLCALL - xmlSetListDoc (xmlNodePtr list, - xmlDocPtr doc); -/* - * Namespaces. - */ -XMLPUBFUN xmlNsPtr XMLCALL - xmlSearchNs (xmlDocPtr doc, - xmlNodePtr node, - const xmlChar *nameSpace); -XMLPUBFUN xmlNsPtr XMLCALL - xmlSearchNsByHref (xmlDocPtr doc, - xmlNodePtr node, - const xmlChar *href); -#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) -XMLPUBFUN xmlNsPtr * XMLCALL - xmlGetNsList (xmlDocPtr doc, - xmlNodePtr node); -#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) */ - -XMLPUBFUN void XMLCALL - xmlSetNs (xmlNodePtr node, - xmlNsPtr ns); -XMLPUBFUN xmlNsPtr XMLCALL - xmlCopyNamespace (xmlNsPtr cur); -XMLPUBFUN xmlNsPtr XMLCALL - xmlCopyNamespaceList (xmlNsPtr cur); - -/* - * Changing the content. - */ -#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED) -XMLPUBFUN xmlAttrPtr XMLCALL - xmlSetProp (xmlNodePtr node, - const xmlChar *name, - const xmlChar *value); -XMLPUBFUN xmlAttrPtr XMLCALL - xmlSetNsProp (xmlNodePtr node, - xmlNsPtr ns, - const xmlChar *name, - const xmlChar *value); -#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED) */ -XMLPUBFUN xmlChar * XMLCALL - xmlGetNoNsProp (xmlNodePtr node, - const xmlChar *name); -XMLPUBFUN xmlChar * XMLCALL - xmlGetProp (xmlNodePtr node, - const xmlChar *name); -XMLPUBFUN xmlAttrPtr XMLCALL - xmlHasProp (xmlNodePtr node, - const xmlChar *name); -XMLPUBFUN xmlAttrPtr XMLCALL - xmlHasNsProp (xmlNodePtr node, - const xmlChar *name, - const xmlChar *nameSpace); -XMLPUBFUN xmlChar * XMLCALL - xmlGetNsProp (xmlNodePtr node, - const xmlChar *name, - const xmlChar *nameSpace); -XMLPUBFUN xmlNodePtr XMLCALL - xmlStringGetNodeList (xmlDocPtr doc, - const xmlChar *value); -XMLPUBFUN xmlNodePtr XMLCALL - xmlStringLenGetNodeList (xmlDocPtr doc, - const xmlChar *value, - int len); -XMLPUBFUN xmlChar * XMLCALL - xmlNodeListGetString (xmlDocPtr doc, - xmlNodePtr list, - int inLine); -#ifdef LIBXML_TREE_ENABLED -XMLPUBFUN xmlChar * XMLCALL - xmlNodeListGetRawString (xmlDocPtr doc, - xmlNodePtr list, - int inLine); -#endif /* LIBXML_TREE_ENABLED */ -XMLPUBFUN void XMLCALL - xmlNodeSetContent (xmlNodePtr cur, - const xmlChar *content); -#ifdef LIBXML_TREE_ENABLED -XMLPUBFUN void XMLCALL - xmlNodeSetContentLen (xmlNodePtr cur, - const xmlChar *content, - int len); -#endif /* LIBXML_TREE_ENABLED */ -XMLPUBFUN void XMLCALL - xmlNodeAddContent (xmlNodePtr cur, - const xmlChar *content); -XMLPUBFUN void XMLCALL - xmlNodeAddContentLen (xmlNodePtr cur, - const xmlChar *content, - int len); -XMLPUBFUN xmlChar * XMLCALL - xmlNodeGetContent (xmlNodePtr cur); - -XMLPUBFUN int XMLCALL - xmlNodeBufGetContent (xmlBufferPtr buffer, - xmlNodePtr cur); -XMLPUBFUN int XMLCALL - xmlBufGetNodeContent (xmlBufPtr buf, - xmlNodePtr cur); - -XMLPUBFUN xmlChar * XMLCALL - xmlNodeGetLang (xmlNodePtr cur); -XMLPUBFUN int XMLCALL - xmlNodeGetSpacePreserve (xmlNodePtr cur); -#ifdef LIBXML_TREE_ENABLED -XMLPUBFUN void XMLCALL - xmlNodeSetLang (xmlNodePtr cur, - const xmlChar *lang); -XMLPUBFUN void XMLCALL - xmlNodeSetSpacePreserve (xmlNodePtr cur, - int val); -#endif /* LIBXML_TREE_ENABLED */ -XMLPUBFUN xmlChar * XMLCALL - xmlNodeGetBase (xmlDocPtr doc, - xmlNodePtr cur); -#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) -XMLPUBFUN void XMLCALL - xmlNodeSetBase (xmlNodePtr cur, - const xmlChar *uri); -#endif - -/* - * Removing content. - */ -XMLPUBFUN int XMLCALL - xmlRemoveProp (xmlAttrPtr cur); -#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) -XMLPUBFUN int XMLCALL - xmlUnsetNsProp (xmlNodePtr node, - xmlNsPtr ns, - const xmlChar *name); -XMLPUBFUN int XMLCALL - xmlUnsetProp (xmlNodePtr node, - const xmlChar *name); -#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) */ - -/* - * Internal, don't use. - */ -XMLPUBFUN void XMLCALL - xmlBufferWriteCHAR (xmlBufferPtr buf, - const xmlChar *string); -XMLPUBFUN void XMLCALL - xmlBufferWriteChar (xmlBufferPtr buf, - const char *string); -XMLPUBFUN void XMLCALL - xmlBufferWriteQuotedString(xmlBufferPtr buf, - const xmlChar *string); - -#ifdef LIBXML_OUTPUT_ENABLED -XMLPUBFUN void xmlAttrSerializeTxtContent(xmlBufferPtr buf, - xmlDocPtr doc, - xmlAttrPtr attr, - const xmlChar *string); -#endif /* LIBXML_OUTPUT_ENABLED */ - -#ifdef LIBXML_TREE_ENABLED -/* - * Namespace handling. - */ -XMLPUBFUN int XMLCALL - xmlReconciliateNs (xmlDocPtr doc, - xmlNodePtr tree); -#endif - -#ifdef LIBXML_OUTPUT_ENABLED -/* - * Saving. - */ -XMLPUBFUN void XMLCALL - xmlDocDumpFormatMemory (xmlDocPtr cur, - xmlChar **mem, - int *size, - int format); -XMLPUBFUN void XMLCALL - xmlDocDumpMemory (xmlDocPtr cur, - xmlChar **mem, - int *size); -XMLPUBFUN void XMLCALL - xmlDocDumpMemoryEnc (xmlDocPtr out_doc, - xmlChar **doc_txt_ptr, - int * doc_txt_len, - const char *txt_encoding); -XMLPUBFUN void XMLCALL - xmlDocDumpFormatMemoryEnc(xmlDocPtr out_doc, - xmlChar **doc_txt_ptr, - int * doc_txt_len, - const char *txt_encoding, - int format); -XMLPUBFUN int XMLCALL - xmlDocFormatDump (FILE *f, - xmlDocPtr cur, - int format); -XMLPUBFUN int XMLCALL - xmlDocDump (FILE *f, - xmlDocPtr cur); -XMLPUBFUN void XMLCALL - xmlElemDump (FILE *f, - xmlDocPtr doc, - xmlNodePtr cur); -XMLPUBFUN int XMLCALL - xmlSaveFile (const char *filename, - xmlDocPtr cur); -XMLPUBFUN int XMLCALL - xmlSaveFormatFile (const char *filename, - xmlDocPtr cur, - int format); -XMLPUBFUN size_t XMLCALL - xmlBufNodeDump (xmlBufPtr buf, - xmlDocPtr doc, - xmlNodePtr cur, - int level, - int format); -XMLPUBFUN int XMLCALL - xmlNodeDump (xmlBufferPtr buf, - xmlDocPtr doc, - xmlNodePtr cur, - int level, - int format); - -XMLPUBFUN int XMLCALL - xmlSaveFileTo (xmlOutputBufferPtr buf, - xmlDocPtr cur, - const char *encoding); -XMLPUBFUN int XMLCALL - xmlSaveFormatFileTo (xmlOutputBufferPtr buf, - xmlDocPtr cur, - const char *encoding, - int format); -XMLPUBFUN void XMLCALL - xmlNodeDumpOutput (xmlOutputBufferPtr buf, - xmlDocPtr doc, - xmlNodePtr cur, - int level, - int format, - const char *encoding); - -XMLPUBFUN int XMLCALL - xmlSaveFormatFileEnc (const char *filename, - xmlDocPtr cur, - const char *encoding, - int format); - -XMLPUBFUN int XMLCALL - xmlSaveFileEnc (const char *filename, - xmlDocPtr cur, - const char *encoding); - -#endif /* LIBXML_OUTPUT_ENABLED */ -/* - * XHTML - */ -XMLPUBFUN int XMLCALL - xmlIsXHTML (const xmlChar *systemID, - const xmlChar *publicID); - -/* - * Compression. - */ -XMLPUBFUN int XMLCALL - xmlGetDocCompressMode (xmlDocPtr doc); -XMLPUBFUN void XMLCALL - xmlSetDocCompressMode (xmlDocPtr doc, - int mode); -XMLPUBFUN int XMLCALL - xmlGetCompressMode (void); -XMLPUBFUN void XMLCALL - xmlSetCompressMode (int mode); - -/* -* DOM-wrapper helper functions. -*/ -XMLPUBFUN xmlDOMWrapCtxtPtr XMLCALL - xmlDOMWrapNewCtxt (void); -XMLPUBFUN void XMLCALL - xmlDOMWrapFreeCtxt (xmlDOMWrapCtxtPtr ctxt); -XMLPUBFUN int XMLCALL - xmlDOMWrapReconcileNamespaces(xmlDOMWrapCtxtPtr ctxt, - xmlNodePtr elem, - int options); -XMLPUBFUN int XMLCALL - xmlDOMWrapAdoptNode (xmlDOMWrapCtxtPtr ctxt, - xmlDocPtr sourceDoc, - xmlNodePtr node, - xmlDocPtr destDoc, - xmlNodePtr destParent, - int options); -XMLPUBFUN int XMLCALL - xmlDOMWrapRemoveNode (xmlDOMWrapCtxtPtr ctxt, - xmlDocPtr doc, - xmlNodePtr node, - int options); -XMLPUBFUN int XMLCALL - xmlDOMWrapCloneNode (xmlDOMWrapCtxtPtr ctxt, - xmlDocPtr sourceDoc, - xmlNodePtr node, - xmlNodePtr *clonedNode, - xmlDocPtr destDoc, - xmlNodePtr destParent, - int deep, - int options); - -#ifdef LIBXML_TREE_ENABLED -/* - * 5 interfaces from DOM ElementTraversal, but different in entities - * traversal. - */ -XMLPUBFUN unsigned long XMLCALL - xmlChildElementCount (xmlNodePtr parent); -XMLPUBFUN xmlNodePtr XMLCALL - xmlNextElementSibling (xmlNodePtr node); -XMLPUBFUN xmlNodePtr XMLCALL - xmlFirstElementChild (xmlNodePtr parent); -XMLPUBFUN xmlNodePtr XMLCALL - xmlLastElementChild (xmlNodePtr parent); -XMLPUBFUN xmlNodePtr XMLCALL - xmlPreviousElementSibling (xmlNodePtr node); -#endif -#ifdef __cplusplus -} -#endif -#ifndef __XML_PARSER_H__ -#include -#endif - -#endif /* __XML_TREE_H__ */ - diff --git a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/uri.h b/cocos2dx/platform/third_party/emscripten/libxml2/libxml/uri.h deleted file mode 100644 index db48262b13..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/uri.h +++ /dev/null @@ -1,94 +0,0 @@ -/** - * Summary: library of generic URI related routines - * Description: library of generic URI related routines - * Implements RFC 2396 - * - * Copy: See Copyright for the status of this software. - * - * Author: Daniel Veillard - */ - -#ifndef __XML_URI_H__ -#define __XML_URI_H__ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * xmlURI: - * - * A parsed URI reference. This is a struct containing the various fields - * as described in RFC 2396 but separated for further processing. - * - * Note: query is a deprecated field which is incorrectly unescaped. - * query_raw takes precedence over query if the former is set. - * See: http://mail.gnome.org/archives/xml/2007-April/thread.html#00127 - */ -typedef struct _xmlURI xmlURI; -typedef xmlURI *xmlURIPtr; -struct _xmlURI { - char *scheme; /* the URI scheme */ - char *opaque; /* opaque part */ - char *authority; /* the authority part */ - char *server; /* the server part */ - char *user; /* the user part */ - int port; /* the port number */ - char *path; /* the path string */ - char *query; /* the query string (deprecated - use with caution) */ - char *fragment; /* the fragment identifier */ - int cleanup; /* parsing potentially unclean URI */ - char *query_raw; /* the query string (as it appears in the URI) */ -}; - -/* - * This function is in tree.h: - * xmlChar * xmlNodeGetBase (xmlDocPtr doc, - * xmlNodePtr cur); - */ -XMLPUBFUN xmlURIPtr XMLCALL - xmlCreateURI (void); -XMLPUBFUN xmlChar * XMLCALL - xmlBuildURI (const xmlChar *URI, - const xmlChar *base); -XMLPUBFUN xmlChar * XMLCALL - xmlBuildRelativeURI (const xmlChar *URI, - const xmlChar *base); -XMLPUBFUN xmlURIPtr XMLCALL - xmlParseURI (const char *str); -XMLPUBFUN xmlURIPtr XMLCALL - xmlParseURIRaw (const char *str, - int raw); -XMLPUBFUN int XMLCALL - xmlParseURIReference (xmlURIPtr uri, - const char *str); -XMLPUBFUN xmlChar * XMLCALL - xmlSaveUri (xmlURIPtr uri); -XMLPUBFUN void XMLCALL - xmlPrintURI (FILE *stream, - xmlURIPtr uri); -XMLPUBFUN xmlChar * XMLCALL - xmlURIEscapeStr (const xmlChar *str, - const xmlChar *list); -XMLPUBFUN char * XMLCALL - xmlURIUnescapeString (const char *str, - int len, - char *target); -XMLPUBFUN int XMLCALL - xmlNormalizeURIPath (char *path); -XMLPUBFUN xmlChar * XMLCALL - xmlURIEscape (const xmlChar *str); -XMLPUBFUN void XMLCALL - xmlFreeURI (xmlURIPtr uri); -XMLPUBFUN xmlChar* XMLCALL - xmlCanonicPath (const xmlChar *path); -XMLPUBFUN xmlChar* XMLCALL - xmlPathToURI (const xmlChar *path); - -#ifdef __cplusplus -} -#endif -#endif /* __XML_URI_H__ */ diff --git a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/valid.h b/cocos2dx/platform/third_party/emscripten/libxml2/libxml/valid.h deleted file mode 100644 index 2bc7b380c1..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/valid.h +++ /dev/null @@ -1,458 +0,0 @@ -/* - * Summary: The DTD validation - * Description: API for the DTD handling and the validity checking - * - * Copy: See Copyright for the status of this software. - * - * Author: Daniel Veillard - */ - - -#ifndef __XML_VALID_H__ -#define __XML_VALID_H__ - -#include -#include -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Validation state added for non-determinist content model. - */ -typedef struct _xmlValidState xmlValidState; -typedef xmlValidState *xmlValidStatePtr; - -/** - * xmlValidityErrorFunc: - * @ctx: usually an xmlValidCtxtPtr to a validity error context, - * but comes from ctxt->userData (which normally contains such - * a pointer); ctxt->userData can be changed by the user. - * @msg: the string to format *printf like vararg - * @...: remaining arguments to the format - * - * Callback called when a validity error is found. This is a message - * oriented function similar to an *printf function. - */ -typedef void (XMLCDECL *xmlValidityErrorFunc) (void *ctx, - const char *msg, - ...) LIBXML_ATTR_FORMAT(2,3); - -/** - * xmlValidityWarningFunc: - * @ctx: usually an xmlValidCtxtPtr to a validity error context, - * but comes from ctxt->userData (which normally contains such - * a pointer); ctxt->userData can be changed by the user. - * @msg: the string to format *printf like vararg - * @...: remaining arguments to the format - * - * Callback called when a validity warning is found. This is a message - * oriented function similar to an *printf function. - */ -typedef void (XMLCDECL *xmlValidityWarningFunc) (void *ctx, - const char *msg, - ...) LIBXML_ATTR_FORMAT(2,3); - -#ifdef IN_LIBXML -/** - * XML_CTXT_FINISH_DTD_0: - * - * Special value for finishDtd field when embedded in an xmlParserCtxt - */ -#define XML_CTXT_FINISH_DTD_0 0xabcd1234 -/** - * XML_CTXT_FINISH_DTD_1: - * - * Special value for finishDtd field when embedded in an xmlParserCtxt - */ -#define XML_CTXT_FINISH_DTD_1 0xabcd1235 -#endif - -/* - * xmlValidCtxt: - * An xmlValidCtxt is used for error reporting when validating. - */ -typedef struct _xmlValidCtxt xmlValidCtxt; -typedef xmlValidCtxt *xmlValidCtxtPtr; -struct _xmlValidCtxt { - void *userData; /* user specific data block */ - xmlValidityErrorFunc error; /* the callback in case of errors */ - xmlValidityWarningFunc warning; /* the callback in case of warning */ - - /* Node analysis stack used when validating within entities */ - xmlNodePtr node; /* Current parsed Node */ - int nodeNr; /* Depth of the parsing stack */ - int nodeMax; /* Max depth of the parsing stack */ - xmlNodePtr *nodeTab; /* array of nodes */ - - unsigned int finishDtd; /* finished validating the Dtd ? */ - xmlDocPtr doc; /* the document */ - int valid; /* temporary validity check result */ - - /* state state used for non-determinist content validation */ - xmlValidState *vstate; /* current state */ - int vstateNr; /* Depth of the validation stack */ - int vstateMax; /* Max depth of the validation stack */ - xmlValidState *vstateTab; /* array of validation states */ - -#ifdef LIBXML_REGEXP_ENABLED - xmlAutomataPtr am; /* the automata */ - xmlAutomataStatePtr state; /* used to build the automata */ -#else - void *am; - void *state; -#endif -}; - -/* - * ALL notation declarations are stored in a table. - * There is one table per DTD. - */ - -typedef struct _xmlHashTable xmlNotationTable; -typedef xmlNotationTable *xmlNotationTablePtr; - -/* - * ALL element declarations are stored in a table. - * There is one table per DTD. - */ - -typedef struct _xmlHashTable xmlElementTable; -typedef xmlElementTable *xmlElementTablePtr; - -/* - * ALL attribute declarations are stored in a table. - * There is one table per DTD. - */ - -typedef struct _xmlHashTable xmlAttributeTable; -typedef xmlAttributeTable *xmlAttributeTablePtr; - -/* - * ALL IDs attributes are stored in a table. - * There is one table per document. - */ - -typedef struct _xmlHashTable xmlIDTable; -typedef xmlIDTable *xmlIDTablePtr; - -/* - * ALL Refs attributes are stored in a table. - * There is one table per document. - */ - -typedef struct _xmlHashTable xmlRefTable; -typedef xmlRefTable *xmlRefTablePtr; - -/* Notation */ -XMLPUBFUN xmlNotationPtr XMLCALL - xmlAddNotationDecl (xmlValidCtxtPtr ctxt, - xmlDtdPtr dtd, - const xmlChar *name, - const xmlChar *PublicID, - const xmlChar *SystemID); -#ifdef LIBXML_TREE_ENABLED -XMLPUBFUN xmlNotationTablePtr XMLCALL - xmlCopyNotationTable (xmlNotationTablePtr table); -#endif /* LIBXML_TREE_ENABLED */ -XMLPUBFUN void XMLCALL - xmlFreeNotationTable (xmlNotationTablePtr table); -#ifdef LIBXML_OUTPUT_ENABLED -XMLPUBFUN void XMLCALL - xmlDumpNotationDecl (xmlBufferPtr buf, - xmlNotationPtr nota); -XMLPUBFUN void XMLCALL - xmlDumpNotationTable (xmlBufferPtr buf, - xmlNotationTablePtr table); -#endif /* LIBXML_OUTPUT_ENABLED */ - -/* Element Content */ -/* the non Doc version are being deprecated */ -XMLPUBFUN xmlElementContentPtr XMLCALL - xmlNewElementContent (const xmlChar *name, - xmlElementContentType type); -XMLPUBFUN xmlElementContentPtr XMLCALL - xmlCopyElementContent (xmlElementContentPtr content); -XMLPUBFUN void XMLCALL - xmlFreeElementContent (xmlElementContentPtr cur); -/* the new versions with doc argument */ -XMLPUBFUN xmlElementContentPtr XMLCALL - xmlNewDocElementContent (xmlDocPtr doc, - const xmlChar *name, - xmlElementContentType type); -XMLPUBFUN xmlElementContentPtr XMLCALL - xmlCopyDocElementContent(xmlDocPtr doc, - xmlElementContentPtr content); -XMLPUBFUN void XMLCALL - xmlFreeDocElementContent(xmlDocPtr doc, - xmlElementContentPtr cur); -XMLPUBFUN void XMLCALL - xmlSnprintfElementContent(char *buf, - int size, - xmlElementContentPtr content, - int englob); -#ifdef LIBXML_OUTPUT_ENABLED -/* DEPRECATED */ -XMLPUBFUN void XMLCALL - xmlSprintfElementContent(char *buf, - xmlElementContentPtr content, - int englob); -#endif /* LIBXML_OUTPUT_ENABLED */ -/* DEPRECATED */ - -/* Element */ -XMLPUBFUN xmlElementPtr XMLCALL - xmlAddElementDecl (xmlValidCtxtPtr ctxt, - xmlDtdPtr dtd, - const xmlChar *name, - xmlElementTypeVal type, - xmlElementContentPtr content); -#ifdef LIBXML_TREE_ENABLED -XMLPUBFUN xmlElementTablePtr XMLCALL - xmlCopyElementTable (xmlElementTablePtr table); -#endif /* LIBXML_TREE_ENABLED */ -XMLPUBFUN void XMLCALL - xmlFreeElementTable (xmlElementTablePtr table); -#ifdef LIBXML_OUTPUT_ENABLED -XMLPUBFUN void XMLCALL - xmlDumpElementTable (xmlBufferPtr buf, - xmlElementTablePtr table); -XMLPUBFUN void XMLCALL - xmlDumpElementDecl (xmlBufferPtr buf, - xmlElementPtr elem); -#endif /* LIBXML_OUTPUT_ENABLED */ - -/* Enumeration */ -XMLPUBFUN xmlEnumerationPtr XMLCALL - xmlCreateEnumeration (const xmlChar *name); -XMLPUBFUN void XMLCALL - xmlFreeEnumeration (xmlEnumerationPtr cur); -#ifdef LIBXML_TREE_ENABLED -XMLPUBFUN xmlEnumerationPtr XMLCALL - xmlCopyEnumeration (xmlEnumerationPtr cur); -#endif /* LIBXML_TREE_ENABLED */ - -/* Attribute */ -XMLPUBFUN xmlAttributePtr XMLCALL - xmlAddAttributeDecl (xmlValidCtxtPtr ctxt, - xmlDtdPtr dtd, - const xmlChar *elem, - const xmlChar *name, - const xmlChar *ns, - xmlAttributeType type, - xmlAttributeDefault def, - const xmlChar *defaultValue, - xmlEnumerationPtr tree); -#ifdef LIBXML_TREE_ENABLED -XMLPUBFUN xmlAttributeTablePtr XMLCALL - xmlCopyAttributeTable (xmlAttributeTablePtr table); -#endif /* LIBXML_TREE_ENABLED */ -XMLPUBFUN void XMLCALL - xmlFreeAttributeTable (xmlAttributeTablePtr table); -#ifdef LIBXML_OUTPUT_ENABLED -XMLPUBFUN void XMLCALL - xmlDumpAttributeTable (xmlBufferPtr buf, - xmlAttributeTablePtr table); -XMLPUBFUN void XMLCALL - xmlDumpAttributeDecl (xmlBufferPtr buf, - xmlAttributePtr attr); -#endif /* LIBXML_OUTPUT_ENABLED */ - -/* IDs */ -XMLPUBFUN xmlIDPtr XMLCALL - xmlAddID (xmlValidCtxtPtr ctxt, - xmlDocPtr doc, - const xmlChar *value, - xmlAttrPtr attr); -XMLPUBFUN void XMLCALL - xmlFreeIDTable (xmlIDTablePtr table); -XMLPUBFUN xmlAttrPtr XMLCALL - xmlGetID (xmlDocPtr doc, - const xmlChar *ID); -XMLPUBFUN int XMLCALL - xmlIsID (xmlDocPtr doc, - xmlNodePtr elem, - xmlAttrPtr attr); -XMLPUBFUN int XMLCALL - xmlRemoveID (xmlDocPtr doc, - xmlAttrPtr attr); - -/* IDREFs */ -XMLPUBFUN xmlRefPtr XMLCALL - xmlAddRef (xmlValidCtxtPtr ctxt, - xmlDocPtr doc, - const xmlChar *value, - xmlAttrPtr attr); -XMLPUBFUN void XMLCALL - xmlFreeRefTable (xmlRefTablePtr table); -XMLPUBFUN int XMLCALL - xmlIsRef (xmlDocPtr doc, - xmlNodePtr elem, - xmlAttrPtr attr); -XMLPUBFUN int XMLCALL - xmlRemoveRef (xmlDocPtr doc, - xmlAttrPtr attr); -XMLPUBFUN xmlListPtr XMLCALL - xmlGetRefs (xmlDocPtr doc, - const xmlChar *ID); - -/** - * The public function calls related to validity checking. - */ -#ifdef LIBXML_VALID_ENABLED -/* Allocate/Release Validation Contexts */ -XMLPUBFUN xmlValidCtxtPtr XMLCALL - xmlNewValidCtxt(void); -XMLPUBFUN void XMLCALL - xmlFreeValidCtxt(xmlValidCtxtPtr); - -XMLPUBFUN int XMLCALL - xmlValidateRoot (xmlValidCtxtPtr ctxt, - xmlDocPtr doc); -XMLPUBFUN int XMLCALL - xmlValidateElementDecl (xmlValidCtxtPtr ctxt, - xmlDocPtr doc, - xmlElementPtr elem); -XMLPUBFUN xmlChar * XMLCALL - xmlValidNormalizeAttributeValue(xmlDocPtr doc, - xmlNodePtr elem, - const xmlChar *name, - const xmlChar *value); -XMLPUBFUN xmlChar * XMLCALL - xmlValidCtxtNormalizeAttributeValue(xmlValidCtxtPtr ctxt, - xmlDocPtr doc, - xmlNodePtr elem, - const xmlChar *name, - const xmlChar *value); -XMLPUBFUN int XMLCALL - xmlValidateAttributeDecl(xmlValidCtxtPtr ctxt, - xmlDocPtr doc, - xmlAttributePtr attr); -XMLPUBFUN int XMLCALL - xmlValidateAttributeValue(xmlAttributeType type, - const xmlChar *value); -XMLPUBFUN int XMLCALL - xmlValidateNotationDecl (xmlValidCtxtPtr ctxt, - xmlDocPtr doc, - xmlNotationPtr nota); -XMLPUBFUN int XMLCALL - xmlValidateDtd (xmlValidCtxtPtr ctxt, - xmlDocPtr doc, - xmlDtdPtr dtd); -XMLPUBFUN int XMLCALL - xmlValidateDtdFinal (xmlValidCtxtPtr ctxt, - xmlDocPtr doc); -XMLPUBFUN int XMLCALL - xmlValidateDocument (xmlValidCtxtPtr ctxt, - xmlDocPtr doc); -XMLPUBFUN int XMLCALL - xmlValidateElement (xmlValidCtxtPtr ctxt, - xmlDocPtr doc, - xmlNodePtr elem); -XMLPUBFUN int XMLCALL - xmlValidateOneElement (xmlValidCtxtPtr ctxt, - xmlDocPtr doc, - xmlNodePtr elem); -XMLPUBFUN int XMLCALL - xmlValidateOneAttribute (xmlValidCtxtPtr ctxt, - xmlDocPtr doc, - xmlNodePtr elem, - xmlAttrPtr attr, - const xmlChar *value); -XMLPUBFUN int XMLCALL - xmlValidateOneNamespace (xmlValidCtxtPtr ctxt, - xmlDocPtr doc, - xmlNodePtr elem, - const xmlChar *prefix, - xmlNsPtr ns, - const xmlChar *value); -XMLPUBFUN int XMLCALL - xmlValidateDocumentFinal(xmlValidCtxtPtr ctxt, - xmlDocPtr doc); -#endif /* LIBXML_VALID_ENABLED */ - -#if defined(LIBXML_VALID_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) -XMLPUBFUN int XMLCALL - xmlValidateNotationUse (xmlValidCtxtPtr ctxt, - xmlDocPtr doc, - const xmlChar *notationName); -#endif /* LIBXML_VALID_ENABLED or LIBXML_SCHEMAS_ENABLED */ - -XMLPUBFUN int XMLCALL - xmlIsMixedElement (xmlDocPtr doc, - const xmlChar *name); -XMLPUBFUN xmlAttributePtr XMLCALL - xmlGetDtdAttrDesc (xmlDtdPtr dtd, - const xmlChar *elem, - const xmlChar *name); -XMLPUBFUN xmlAttributePtr XMLCALL - xmlGetDtdQAttrDesc (xmlDtdPtr dtd, - const xmlChar *elem, - const xmlChar *name, - const xmlChar *prefix); -XMLPUBFUN xmlNotationPtr XMLCALL - xmlGetDtdNotationDesc (xmlDtdPtr dtd, - const xmlChar *name); -XMLPUBFUN xmlElementPtr XMLCALL - xmlGetDtdQElementDesc (xmlDtdPtr dtd, - const xmlChar *name, - const xmlChar *prefix); -XMLPUBFUN xmlElementPtr XMLCALL - xmlGetDtdElementDesc (xmlDtdPtr dtd, - const xmlChar *name); - -#ifdef LIBXML_VALID_ENABLED - -XMLPUBFUN int XMLCALL - xmlValidGetPotentialChildren(xmlElementContent *ctree, - const xmlChar **names, - int *len, - int max); - -XMLPUBFUN int XMLCALL - xmlValidGetValidElements(xmlNode *prev, - xmlNode *next, - const xmlChar **names, - int max); -XMLPUBFUN int XMLCALL - xmlValidateNameValue (const xmlChar *value); -XMLPUBFUN int XMLCALL - xmlValidateNamesValue (const xmlChar *value); -XMLPUBFUN int XMLCALL - xmlValidateNmtokenValue (const xmlChar *value); -XMLPUBFUN int XMLCALL - xmlValidateNmtokensValue(const xmlChar *value); - -#ifdef LIBXML_REGEXP_ENABLED -/* - * Validation based on the regexp support - */ -XMLPUBFUN int XMLCALL - xmlValidBuildContentModel(xmlValidCtxtPtr ctxt, - xmlElementPtr elem); - -XMLPUBFUN int XMLCALL - xmlValidatePushElement (xmlValidCtxtPtr ctxt, - xmlDocPtr doc, - xmlNodePtr elem, - const xmlChar *qname); -XMLPUBFUN int XMLCALL - xmlValidatePushCData (xmlValidCtxtPtr ctxt, - const xmlChar *data, - int len); -XMLPUBFUN int XMLCALL - xmlValidatePopElement (xmlValidCtxtPtr ctxt, - xmlDocPtr doc, - xmlNodePtr elem, - const xmlChar *qname); -#endif /* LIBXML_REGEXP_ENABLED */ -#endif /* LIBXML_VALID_ENABLED */ -#ifdef __cplusplus -} -#endif -#endif /* __XML_VALID_H__ */ diff --git a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/xinclude.h b/cocos2dx/platform/third_party/emscripten/libxml2/libxml/xinclude.h deleted file mode 100644 index 863ab25ad9..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/xinclude.h +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Summary: implementation of XInclude - * Description: API to handle XInclude processing, - * implements the - * World Wide Web Consortium Last Call Working Draft 10 November 2003 - * http://www.w3.org/TR/2003/WD-xinclude-20031110 - * - * Copy: See Copyright for the status of this software. - * - * Author: Daniel Veillard - */ - -#ifndef __XML_XINCLUDE_H__ -#define __XML_XINCLUDE_H__ - -#include -#include - -#ifdef LIBXML_XINCLUDE_ENABLED - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * XINCLUDE_NS: - * - * Macro defining the Xinclude namespace: http://www.w3.org/2003/XInclude - */ -#define XINCLUDE_NS (const xmlChar *) "http://www.w3.org/2003/XInclude" -/** - * XINCLUDE_OLD_NS: - * - * Macro defining the draft Xinclude namespace: http://www.w3.org/2001/XInclude - */ -#define XINCLUDE_OLD_NS (const xmlChar *) "http://www.w3.org/2001/XInclude" -/** - * XINCLUDE_NODE: - * - * Macro defining "include" - */ -#define XINCLUDE_NODE (const xmlChar *) "include" -/** - * XINCLUDE_FALLBACK: - * - * Macro defining "fallback" - */ -#define XINCLUDE_FALLBACK (const xmlChar *) "fallback" -/** - * XINCLUDE_HREF: - * - * Macro defining "href" - */ -#define XINCLUDE_HREF (const xmlChar *) "href" -/** - * XINCLUDE_PARSE: - * - * Macro defining "parse" - */ -#define XINCLUDE_PARSE (const xmlChar *) "parse" -/** - * XINCLUDE_PARSE_XML: - * - * Macro defining "xml" - */ -#define XINCLUDE_PARSE_XML (const xmlChar *) "xml" -/** - * XINCLUDE_PARSE_TEXT: - * - * Macro defining "text" - */ -#define XINCLUDE_PARSE_TEXT (const xmlChar *) "text" -/** - * XINCLUDE_PARSE_ENCODING: - * - * Macro defining "encoding" - */ -#define XINCLUDE_PARSE_ENCODING (const xmlChar *) "encoding" -/** - * XINCLUDE_PARSE_XPOINTER: - * - * Macro defining "xpointer" - */ -#define XINCLUDE_PARSE_XPOINTER (const xmlChar *) "xpointer" - -typedef struct _xmlXIncludeCtxt xmlXIncludeCtxt; -typedef xmlXIncludeCtxt *xmlXIncludeCtxtPtr; - -/* - * standalone processing - */ -XMLPUBFUN int XMLCALL - xmlXIncludeProcess (xmlDocPtr doc); -XMLPUBFUN int XMLCALL - xmlXIncludeProcessFlags (xmlDocPtr doc, - int flags); -XMLPUBFUN int XMLCALL - xmlXIncludeProcessFlagsData(xmlDocPtr doc, - int flags, - void *data); -XMLPUBFUN int XMLCALL - xmlXIncludeProcessTreeFlagsData(xmlNodePtr tree, - int flags, - void *data); -XMLPUBFUN int XMLCALL - xmlXIncludeProcessTree (xmlNodePtr tree); -XMLPUBFUN int XMLCALL - xmlXIncludeProcessTreeFlags(xmlNodePtr tree, - int flags); -/* - * contextual processing - */ -XMLPUBFUN xmlXIncludeCtxtPtr XMLCALL - xmlXIncludeNewContext (xmlDocPtr doc); -XMLPUBFUN int XMLCALL - xmlXIncludeSetFlags (xmlXIncludeCtxtPtr ctxt, - int flags); -XMLPUBFUN void XMLCALL - xmlXIncludeFreeContext (xmlXIncludeCtxtPtr ctxt); -XMLPUBFUN int XMLCALL - xmlXIncludeProcessNode (xmlXIncludeCtxtPtr ctxt, - xmlNodePtr tree); -#ifdef __cplusplus -} -#endif - -#endif /* LIBXML_XINCLUDE_ENABLED */ - -#endif /* __XML_XINCLUDE_H__ */ diff --git a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/xlink.h b/cocos2dx/platform/third_party/emscripten/libxml2/libxml/xlink.h deleted file mode 100644 index a209a9976d..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/xlink.h +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Summary: unfinished XLink detection module - * Description: unfinished XLink detection module - * - * Copy: See Copyright for the status of this software. - * - * Author: Daniel Veillard - */ - -#ifndef __XML_XLINK_H__ -#define __XML_XLINK_H__ - -#include -#include - -#ifdef LIBXML_XPTR_ENABLED - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Various defines for the various Link properties. - * - * NOTE: the link detection layer will try to resolve QName expansion - * of namespaces. If "foo" is the prefix for "http://foo.com/" - * then the link detection layer will expand role="foo:myrole" - * to "http://foo.com/:myrole". - * NOTE: the link detection layer will expand URI-Refences found on - * href attributes by using the base mechanism if found. - */ -typedef xmlChar *xlinkHRef; -typedef xmlChar *xlinkRole; -typedef xmlChar *xlinkTitle; - -typedef enum { - XLINK_TYPE_NONE = 0, - XLINK_TYPE_SIMPLE, - XLINK_TYPE_EXTENDED, - XLINK_TYPE_EXTENDED_SET -} xlinkType; - -typedef enum { - XLINK_SHOW_NONE = 0, - XLINK_SHOW_NEW, - XLINK_SHOW_EMBED, - XLINK_SHOW_REPLACE -} xlinkShow; - -typedef enum { - XLINK_ACTUATE_NONE = 0, - XLINK_ACTUATE_AUTO, - XLINK_ACTUATE_ONREQUEST -} xlinkActuate; - -/** - * xlinkNodeDetectFunc: - * @ctx: user data pointer - * @node: the node to check - * - * This is the prototype for the link detection routine. - * It calls the default link detection callbacks upon link detection. - */ -typedef void (*xlinkNodeDetectFunc) (void *ctx, xmlNodePtr node); - -/* - * The link detection module interact with the upper layers using - * a set of callback registered at parsing time. - */ - -/** - * xlinkSimpleLinkFunk: - * @ctx: user data pointer - * @node: the node carrying the link - * @href: the target of the link - * @role: the role string - * @title: the link title - * - * This is the prototype for a simple link detection callback. - */ -typedef void -(*xlinkSimpleLinkFunk) (void *ctx, - xmlNodePtr node, - const xlinkHRef href, - const xlinkRole role, - const xlinkTitle title); - -/** - * xlinkExtendedLinkFunk: - * @ctx: user data pointer - * @node: the node carrying the link - * @nbLocators: the number of locators detected on the link - * @hrefs: pointer to the array of locator hrefs - * @roles: pointer to the array of locator roles - * @nbArcs: the number of arcs detected on the link - * @from: pointer to the array of source roles found on the arcs - * @to: pointer to the array of target roles found on the arcs - * @show: array of values for the show attributes found on the arcs - * @actuate: array of values for the actuate attributes found on the arcs - * @nbTitles: the number of titles detected on the link - * @title: array of titles detected on the link - * @langs: array of xml:lang values for the titles - * - * This is the prototype for a extended link detection callback. - */ -typedef void -(*xlinkExtendedLinkFunk)(void *ctx, - xmlNodePtr node, - int nbLocators, - const xlinkHRef *hrefs, - const xlinkRole *roles, - int nbArcs, - const xlinkRole *from, - const xlinkRole *to, - xlinkShow *show, - xlinkActuate *actuate, - int nbTitles, - const xlinkTitle *titles, - const xmlChar **langs); - -/** - * xlinkExtendedLinkSetFunk: - * @ctx: user data pointer - * @node: the node carrying the link - * @nbLocators: the number of locators detected on the link - * @hrefs: pointer to the array of locator hrefs - * @roles: pointer to the array of locator roles - * @nbTitles: the number of titles detected on the link - * @title: array of titles detected on the link - * @langs: array of xml:lang values for the titles - * - * This is the prototype for a extended link set detection callback. - */ -typedef void -(*xlinkExtendedLinkSetFunk) (void *ctx, - xmlNodePtr node, - int nbLocators, - const xlinkHRef *hrefs, - const xlinkRole *roles, - int nbTitles, - const xlinkTitle *titles, - const xmlChar **langs); - -/** - * This is the structure containing a set of Links detection callbacks. - * - * There is no default xlink callbacks, if one want to get link - * recognition activated, those call backs must be provided before parsing. - */ -typedef struct _xlinkHandler xlinkHandler; -typedef xlinkHandler *xlinkHandlerPtr; -struct _xlinkHandler { - xlinkSimpleLinkFunk simple; - xlinkExtendedLinkFunk extended; - xlinkExtendedLinkSetFunk set; -}; - -/* - * The default detection routine, can be overridden, they call the default - * detection callbacks. - */ - -XMLPUBFUN xlinkNodeDetectFunc XMLCALL - xlinkGetDefaultDetect (void); -XMLPUBFUN void XMLCALL - xlinkSetDefaultDetect (xlinkNodeDetectFunc func); - -/* - * Routines to set/get the default handlers. - */ -XMLPUBFUN xlinkHandlerPtr XMLCALL - xlinkGetDefaultHandler (void); -XMLPUBFUN void XMLCALL - xlinkSetDefaultHandler (xlinkHandlerPtr handler); - -/* - * Link detection module itself. - */ -XMLPUBFUN xlinkType XMLCALL - xlinkIsLink (xmlDocPtr doc, - xmlNodePtr node); - -#ifdef __cplusplus -} -#endif - -#endif /* LIBXML_XPTR_ENABLED */ - -#endif /* __XML_XLINK_H__ */ diff --git a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/xmlIO.h b/cocos2dx/platform/third_party/emscripten/libxml2/libxml/xmlIO.h deleted file mode 100644 index 6c241a8dde..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/xmlIO.h +++ /dev/null @@ -1,366 +0,0 @@ -/* - * Summary: interface for the I/O interfaces used by the parser - * Description: interface for the I/O interfaces used by the parser - * - * Copy: See Copyright for the status of this software. - * - * Author: Daniel Veillard - */ - -#ifndef __XML_IO_H__ -#define __XML_IO_H__ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Those are the functions and datatypes for the parser input - * I/O structures. - */ - -/** - * xmlInputMatchCallback: - * @filename: the filename or URI - * - * Callback used in the I/O Input API to detect if the current handler - * can provide input fonctionnalities for this resource. - * - * Returns 1 if yes and 0 if another Input module should be used - */ -typedef int (XMLCALL *xmlInputMatchCallback) (char const *filename); -/** - * xmlInputOpenCallback: - * @filename: the filename or URI - * - * Callback used in the I/O Input API to open the resource - * - * Returns an Input context or NULL in case or error - */ -typedef void * (XMLCALL *xmlInputOpenCallback) (char const *filename); -/** - * xmlInputReadCallback: - * @context: an Input context - * @buffer: the buffer to store data read - * @len: the length of the buffer in bytes - * - * Callback used in the I/O Input API to read the resource - * - * Returns the number of bytes read or -1 in case of error - */ -typedef int (XMLCALL *xmlInputReadCallback) (void * context, char * buffer, int len); -/** - * xmlInputCloseCallback: - * @context: an Input context - * - * Callback used in the I/O Input API to close the resource - * - * Returns 0 or -1 in case of error - */ -typedef int (XMLCALL *xmlInputCloseCallback) (void * context); - -#ifdef LIBXML_OUTPUT_ENABLED -/* - * Those are the functions and datatypes for the library output - * I/O structures. - */ - -/** - * xmlOutputMatchCallback: - * @filename: the filename or URI - * - * Callback used in the I/O Output API to detect if the current handler - * can provide output fonctionnalities for this resource. - * - * Returns 1 if yes and 0 if another Output module should be used - */ -typedef int (XMLCALL *xmlOutputMatchCallback) (char const *filename); -/** - * xmlOutputOpenCallback: - * @filename: the filename or URI - * - * Callback used in the I/O Output API to open the resource - * - * Returns an Output context or NULL in case or error - */ -typedef void * (XMLCALL *xmlOutputOpenCallback) (char const *filename); -/** - * xmlOutputWriteCallback: - * @context: an Output context - * @buffer: the buffer of data to write - * @len: the length of the buffer in bytes - * - * Callback used in the I/O Output API to write to the resource - * - * Returns the number of bytes written or -1 in case of error - */ -typedef int (XMLCALL *xmlOutputWriteCallback) (void * context, const char * buffer, - int len); -/** - * xmlOutputCloseCallback: - * @context: an Output context - * - * Callback used in the I/O Output API to close the resource - * - * Returns 0 or -1 in case of error - */ -typedef int (XMLCALL *xmlOutputCloseCallback) (void * context); -#endif /* LIBXML_OUTPUT_ENABLED */ - -#ifdef __cplusplus -} -#endif - -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif -struct _xmlParserInputBuffer { - void* context; - xmlInputReadCallback readcallback; - xmlInputCloseCallback closecallback; - - xmlCharEncodingHandlerPtr encoder; /* I18N conversions to UTF-8 */ - - xmlBufPtr buffer; /* Local buffer encoded in UTF-8 */ - xmlBufPtr raw; /* if encoder != NULL buffer for raw input */ - int compressed; /* -1=unknown, 0=not compressed, 1=compressed */ - int error; - unsigned long rawconsumed;/* amount consumed from raw */ -}; - - -#ifdef LIBXML_OUTPUT_ENABLED -struct _xmlOutputBuffer { - void* context; - xmlOutputWriteCallback writecallback; - xmlOutputCloseCallback closecallback; - - xmlCharEncodingHandlerPtr encoder; /* I18N conversions to UTF-8 */ - - xmlBufPtr buffer; /* Local buffer encoded in UTF-8 or ISOLatin */ - xmlBufPtr conv; /* if encoder != NULL buffer for output */ - int written; /* total number of byte written */ - int error; -}; -#endif /* LIBXML_OUTPUT_ENABLED */ - -/* - * Interfaces for input - */ -XMLPUBFUN void XMLCALL - xmlCleanupInputCallbacks (void); - -XMLPUBFUN int XMLCALL - xmlPopInputCallbacks (void); - -XMLPUBFUN void XMLCALL - xmlRegisterDefaultInputCallbacks (void); -XMLPUBFUN xmlParserInputBufferPtr XMLCALL - xmlAllocParserInputBuffer (xmlCharEncoding enc); - -XMLPUBFUN xmlParserInputBufferPtr XMLCALL - xmlParserInputBufferCreateFilename (const char *URI, - xmlCharEncoding enc); -XMLPUBFUN xmlParserInputBufferPtr XMLCALL - xmlParserInputBufferCreateFile (FILE *file, - xmlCharEncoding enc); -XMLPUBFUN xmlParserInputBufferPtr XMLCALL - xmlParserInputBufferCreateFd (int fd, - xmlCharEncoding enc); -XMLPUBFUN xmlParserInputBufferPtr XMLCALL - xmlParserInputBufferCreateMem (const char *mem, int size, - xmlCharEncoding enc); -XMLPUBFUN xmlParserInputBufferPtr XMLCALL - xmlParserInputBufferCreateStatic (const char *mem, int size, - xmlCharEncoding enc); -XMLPUBFUN xmlParserInputBufferPtr XMLCALL - xmlParserInputBufferCreateIO (xmlInputReadCallback ioread, - xmlInputCloseCallback ioclose, - void *ioctx, - xmlCharEncoding enc); -XMLPUBFUN int XMLCALL - xmlParserInputBufferRead (xmlParserInputBufferPtr in, - int len); -XMLPUBFUN int XMLCALL - xmlParserInputBufferGrow (xmlParserInputBufferPtr in, - int len); -XMLPUBFUN int XMLCALL - xmlParserInputBufferPush (xmlParserInputBufferPtr in, - int len, - const char *buf); -XMLPUBFUN void XMLCALL - xmlFreeParserInputBuffer (xmlParserInputBufferPtr in); -XMLPUBFUN char * XMLCALL - xmlParserGetDirectory (const char *filename); - -XMLPUBFUN int XMLCALL - xmlRegisterInputCallbacks (xmlInputMatchCallback matchFunc, - xmlInputOpenCallback openFunc, - xmlInputReadCallback readFunc, - xmlInputCloseCallback closeFunc); - -xmlParserInputBufferPtr - __xmlParserInputBufferCreateFilename(const char *URI, - xmlCharEncoding enc); - -#ifdef LIBXML_OUTPUT_ENABLED -/* - * Interfaces for output - */ -XMLPUBFUN void XMLCALL - xmlCleanupOutputCallbacks (void); -XMLPUBFUN void XMLCALL - xmlRegisterDefaultOutputCallbacks(void); -XMLPUBFUN xmlOutputBufferPtr XMLCALL - xmlAllocOutputBuffer (xmlCharEncodingHandlerPtr encoder); - -XMLPUBFUN xmlOutputBufferPtr XMLCALL - xmlOutputBufferCreateFilename (const char *URI, - xmlCharEncodingHandlerPtr encoder, - int compression); - -XMLPUBFUN xmlOutputBufferPtr XMLCALL - xmlOutputBufferCreateFile (FILE *file, - xmlCharEncodingHandlerPtr encoder); - -XMLPUBFUN xmlOutputBufferPtr XMLCALL - xmlOutputBufferCreateBuffer (xmlBufferPtr buffer, - xmlCharEncodingHandlerPtr encoder); - -XMLPUBFUN xmlOutputBufferPtr XMLCALL - xmlOutputBufferCreateFd (int fd, - xmlCharEncodingHandlerPtr encoder); - -XMLPUBFUN xmlOutputBufferPtr XMLCALL - xmlOutputBufferCreateIO (xmlOutputWriteCallback iowrite, - xmlOutputCloseCallback ioclose, - void *ioctx, - xmlCharEncodingHandlerPtr encoder); - -/* Couple of APIs to get the output without digging into the buffers */ -XMLPUBFUN const xmlChar * XMLCALL - xmlOutputBufferGetContent (xmlOutputBufferPtr out); -XMLPUBFUN size_t XMLCALL - xmlOutputBufferGetSize (xmlOutputBufferPtr out); - -XMLPUBFUN int XMLCALL - xmlOutputBufferWrite (xmlOutputBufferPtr out, - int len, - const char *buf); -XMLPUBFUN int XMLCALL - xmlOutputBufferWriteString (xmlOutputBufferPtr out, - const char *str); -XMLPUBFUN int XMLCALL - xmlOutputBufferWriteEscape (xmlOutputBufferPtr out, - const xmlChar *str, - xmlCharEncodingOutputFunc escaping); - -XMLPUBFUN int XMLCALL - xmlOutputBufferFlush (xmlOutputBufferPtr out); -XMLPUBFUN int XMLCALL - xmlOutputBufferClose (xmlOutputBufferPtr out); - -XMLPUBFUN int XMLCALL - xmlRegisterOutputCallbacks (xmlOutputMatchCallback matchFunc, - xmlOutputOpenCallback openFunc, - xmlOutputWriteCallback writeFunc, - xmlOutputCloseCallback closeFunc); - -xmlOutputBufferPtr - __xmlOutputBufferCreateFilename(const char *URI, - xmlCharEncodingHandlerPtr encoder, - int compression); - -#ifdef LIBXML_HTTP_ENABLED -/* This function only exists if HTTP support built into the library */ -XMLPUBFUN void XMLCALL - xmlRegisterHTTPPostCallbacks (void ); -#endif /* LIBXML_HTTP_ENABLED */ - -#endif /* LIBXML_OUTPUT_ENABLED */ - -XMLPUBFUN xmlParserInputPtr XMLCALL - xmlCheckHTTPInput (xmlParserCtxtPtr ctxt, - xmlParserInputPtr ret); - -/* - * A predefined entity loader disabling network accesses - */ -XMLPUBFUN xmlParserInputPtr XMLCALL - xmlNoNetExternalEntityLoader (const char *URL, - const char *ID, - xmlParserCtxtPtr ctxt); - -/* - * xmlNormalizeWindowsPath is obsolete, don't use it. - * Check xmlCanonicPath in uri.h for a better alternative. - */ -XMLPUBFUN xmlChar * XMLCALL - xmlNormalizeWindowsPath (const xmlChar *path); - -XMLPUBFUN int XMLCALL - xmlCheckFilename (const char *path); -/** - * Default 'file://' protocol callbacks - */ -XMLPUBFUN int XMLCALL - xmlFileMatch (const char *filename); -XMLPUBFUN void * XMLCALL - xmlFileOpen (const char *filename); -XMLPUBFUN int XMLCALL - xmlFileRead (void * context, - char * buffer, - int len); -XMLPUBFUN int XMLCALL - xmlFileClose (void * context); - -/** - * Default 'http://' protocol callbacks - */ -#ifdef LIBXML_HTTP_ENABLED -XMLPUBFUN int XMLCALL - xmlIOHTTPMatch (const char *filename); -XMLPUBFUN void * XMLCALL - xmlIOHTTPOpen (const char *filename); -#ifdef LIBXML_OUTPUT_ENABLED -XMLPUBFUN void * XMLCALL - xmlIOHTTPOpenW (const char * post_uri, - int compression ); -#endif /* LIBXML_OUTPUT_ENABLED */ -XMLPUBFUN int XMLCALL - xmlIOHTTPRead (void * context, - char * buffer, - int len); -XMLPUBFUN int XMLCALL - xmlIOHTTPClose (void * context); -#endif /* LIBXML_HTTP_ENABLED */ - -/** - * Default 'ftp://' protocol callbacks - */ -#ifdef LIBXML_FTP_ENABLED -XMLPUBFUN int XMLCALL - xmlIOFTPMatch (const char *filename); -XMLPUBFUN void * XMLCALL - xmlIOFTPOpen (const char *filename); -XMLPUBFUN int XMLCALL - xmlIOFTPRead (void * context, - char * buffer, - int len); -XMLPUBFUN int XMLCALL - xmlIOFTPClose (void * context); -#endif /* LIBXML_FTP_ENABLED */ - -#ifdef __cplusplus -} -#endif - -#endif /* __XML_IO_H__ */ diff --git a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/xmlautomata.h b/cocos2dx/platform/third_party/emscripten/libxml2/libxml/xmlautomata.h deleted file mode 100644 index bf1b131c65..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/xmlautomata.h +++ /dev/null @@ -1,146 +0,0 @@ -/* - * Summary: API to build regexp automata - * Description: the API to build regexp automata - * - * Copy: See Copyright for the status of this software. - * - * Author: Daniel Veillard - */ - -#ifndef __XML_AUTOMATA_H__ -#define __XML_AUTOMATA_H__ - -#include -#include - -#ifdef LIBXML_REGEXP_ENABLED -#ifdef LIBXML_AUTOMATA_ENABLED -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * xmlAutomataPtr: - * - * A libxml automata description, It can be compiled into a regexp - */ -typedef struct _xmlAutomata xmlAutomata; -typedef xmlAutomata *xmlAutomataPtr; - -/** - * xmlAutomataStatePtr: - * - * A state int the automata description, - */ -typedef struct _xmlAutomataState xmlAutomataState; -typedef xmlAutomataState *xmlAutomataStatePtr; - -/* - * Building API - */ -XMLPUBFUN xmlAutomataPtr XMLCALL - xmlNewAutomata (void); -XMLPUBFUN void XMLCALL - xmlFreeAutomata (xmlAutomataPtr am); - -XMLPUBFUN xmlAutomataStatePtr XMLCALL - xmlAutomataGetInitState (xmlAutomataPtr am); -XMLPUBFUN int XMLCALL - xmlAutomataSetFinalState (xmlAutomataPtr am, - xmlAutomataStatePtr state); -XMLPUBFUN xmlAutomataStatePtr XMLCALL - xmlAutomataNewState (xmlAutomataPtr am); -XMLPUBFUN xmlAutomataStatePtr XMLCALL - xmlAutomataNewTransition (xmlAutomataPtr am, - xmlAutomataStatePtr from, - xmlAutomataStatePtr to, - const xmlChar *token, - void *data); -XMLPUBFUN xmlAutomataStatePtr XMLCALL - xmlAutomataNewTransition2 (xmlAutomataPtr am, - xmlAutomataStatePtr from, - xmlAutomataStatePtr to, - const xmlChar *token, - const xmlChar *token2, - void *data); -XMLPUBFUN xmlAutomataStatePtr XMLCALL - xmlAutomataNewNegTrans (xmlAutomataPtr am, - xmlAutomataStatePtr from, - xmlAutomataStatePtr to, - const xmlChar *token, - const xmlChar *token2, - void *data); - -XMLPUBFUN xmlAutomataStatePtr XMLCALL - xmlAutomataNewCountTrans (xmlAutomataPtr am, - xmlAutomataStatePtr from, - xmlAutomataStatePtr to, - const xmlChar *token, - int min, - int max, - void *data); -XMLPUBFUN xmlAutomataStatePtr XMLCALL - xmlAutomataNewCountTrans2 (xmlAutomataPtr am, - xmlAutomataStatePtr from, - xmlAutomataStatePtr to, - const xmlChar *token, - const xmlChar *token2, - int min, - int max, - void *data); -XMLPUBFUN xmlAutomataStatePtr XMLCALL - xmlAutomataNewOnceTrans (xmlAutomataPtr am, - xmlAutomataStatePtr from, - xmlAutomataStatePtr to, - const xmlChar *token, - int min, - int max, - void *data); -XMLPUBFUN xmlAutomataStatePtr XMLCALL - xmlAutomataNewOnceTrans2 (xmlAutomataPtr am, - xmlAutomataStatePtr from, - xmlAutomataStatePtr to, - const xmlChar *token, - const xmlChar *token2, - int min, - int max, - void *data); -XMLPUBFUN xmlAutomataStatePtr XMLCALL - xmlAutomataNewAllTrans (xmlAutomataPtr am, - xmlAutomataStatePtr from, - xmlAutomataStatePtr to, - int lax); -XMLPUBFUN xmlAutomataStatePtr XMLCALL - xmlAutomataNewEpsilon (xmlAutomataPtr am, - xmlAutomataStatePtr from, - xmlAutomataStatePtr to); -XMLPUBFUN xmlAutomataStatePtr XMLCALL - xmlAutomataNewCountedTrans (xmlAutomataPtr am, - xmlAutomataStatePtr from, - xmlAutomataStatePtr to, - int counter); -XMLPUBFUN xmlAutomataStatePtr XMLCALL - xmlAutomataNewCounterTrans (xmlAutomataPtr am, - xmlAutomataStatePtr from, - xmlAutomataStatePtr to, - int counter); -XMLPUBFUN int XMLCALL - xmlAutomataNewCounter (xmlAutomataPtr am, - int min, - int max); - -XMLPUBFUN xmlRegexpPtr XMLCALL - xmlAutomataCompile (xmlAutomataPtr am); -XMLPUBFUN int XMLCALL - xmlAutomataIsDeterminist (xmlAutomataPtr am); - -#ifdef __cplusplus -} -#endif - -#endif /* LIBXML_AUTOMATA_ENABLED */ -#endif /* LIBXML_REGEXP_ENABLED */ - -#endif /* __XML_AUTOMATA_H__ */ diff --git a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/xmlerror.h b/cocos2dx/platform/third_party/emscripten/libxml2/libxml/xmlerror.h deleted file mode 100644 index 537a396c6d..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/xmlerror.h +++ /dev/null @@ -1,945 +0,0 @@ -/* - * Summary: error handling - * Description: the API used to report errors - * - * Copy: See Copyright for the status of this software. - * - * Author: Daniel Veillard - */ - -#include - -#ifndef __XML_ERROR_H__ -#define __XML_ERROR_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * xmlErrorLevel: - * - * Indicates the level of an error - */ -typedef enum { - XML_ERR_NONE = 0, - XML_ERR_WARNING = 1, /* A simple warning */ - XML_ERR_ERROR = 2, /* A recoverable error */ - XML_ERR_FATAL = 3 /* A fatal error */ -} xmlErrorLevel; - -/** - * xmlErrorDomain: - * - * Indicates where an error may have come from - */ -typedef enum { - XML_FROM_NONE = 0, - XML_FROM_PARSER, /* The XML parser */ - XML_FROM_TREE, /* The tree module */ - XML_FROM_NAMESPACE, /* The XML Namespace module */ - XML_FROM_DTD, /* The XML DTD validation with parser context*/ - XML_FROM_HTML, /* The HTML parser */ - XML_FROM_MEMORY, /* The memory allocator */ - XML_FROM_OUTPUT, /* The serialization code */ - XML_FROM_IO, /* The Input/Output stack */ - XML_FROM_FTP, /* The FTP module */ - XML_FROM_HTTP, /* The HTTP module */ - XML_FROM_XINCLUDE, /* The XInclude processing */ - XML_FROM_XPATH, /* The XPath module */ - XML_FROM_XPOINTER, /* The XPointer module */ - XML_FROM_REGEXP, /* The regular expressions module */ - XML_FROM_DATATYPE, /* The W3C XML Schemas Datatype module */ - XML_FROM_SCHEMASP, /* The W3C XML Schemas parser module */ - XML_FROM_SCHEMASV, /* The W3C XML Schemas validation module */ - XML_FROM_RELAXNGP, /* The Relax-NG parser module */ - XML_FROM_RELAXNGV, /* The Relax-NG validator module */ - XML_FROM_CATALOG, /* The Catalog module */ - XML_FROM_C14N, /* The Canonicalization module */ - XML_FROM_XSLT, /* The XSLT engine from libxslt */ - XML_FROM_VALID, /* The XML DTD validation with valid context */ - XML_FROM_CHECK, /* The error checking module */ - XML_FROM_WRITER, /* The xmlwriter module */ - XML_FROM_MODULE, /* The dynamically loaded module module*/ - XML_FROM_I18N, /* The module handling character conversion */ - XML_FROM_SCHEMATRONV,/* The Schematron validator module */ - XML_FROM_BUFFER, /* The buffers module */ - XML_FROM_URI /* The URI module */ -} xmlErrorDomain; - -/** - * xmlError: - * - * An XML Error instance. - */ - -typedef struct _xmlError xmlError; -typedef xmlError *xmlErrorPtr; -struct _xmlError { - int domain; /* What part of the library raised this error */ - int code; /* The error code, e.g. an xmlParserError */ - char *message;/* human-readable informative error message */ - xmlErrorLevel level;/* how consequent is the error */ - char *file; /* the filename */ - int line; /* the line number if available */ - char *str1; /* extra string information */ - char *str2; /* extra string information */ - char *str3; /* extra string information */ - int int1; /* extra number information */ - int int2; /* column number of the error or 0 if N/A (todo: rename this field when we would break ABI) */ - void *ctxt; /* the parser context if available */ - void *node; /* the node in the tree */ -}; - -/** - * xmlParserError: - * - * This is an error that the XML (or HTML) parser can generate - */ -typedef enum { - XML_ERR_OK = 0, - XML_ERR_INTERNAL_ERROR, /* 1 */ - XML_ERR_NO_MEMORY, /* 2 */ - XML_ERR_DOCUMENT_START, /* 3 */ - XML_ERR_DOCUMENT_EMPTY, /* 4 */ - XML_ERR_DOCUMENT_END, /* 5 */ - XML_ERR_INVALID_HEX_CHARREF, /* 6 */ - XML_ERR_INVALID_DEC_CHARREF, /* 7 */ - XML_ERR_INVALID_CHARREF, /* 8 */ - XML_ERR_INVALID_CHAR, /* 9 */ - XML_ERR_CHARREF_AT_EOF, /* 10 */ - XML_ERR_CHARREF_IN_PROLOG, /* 11 */ - XML_ERR_CHARREF_IN_EPILOG, /* 12 */ - XML_ERR_CHARREF_IN_DTD, /* 13 */ - XML_ERR_ENTITYREF_AT_EOF, /* 14 */ - XML_ERR_ENTITYREF_IN_PROLOG, /* 15 */ - XML_ERR_ENTITYREF_IN_EPILOG, /* 16 */ - XML_ERR_ENTITYREF_IN_DTD, /* 17 */ - XML_ERR_PEREF_AT_EOF, /* 18 */ - XML_ERR_PEREF_IN_PROLOG, /* 19 */ - XML_ERR_PEREF_IN_EPILOG, /* 20 */ - XML_ERR_PEREF_IN_INT_SUBSET, /* 21 */ - XML_ERR_ENTITYREF_NO_NAME, /* 22 */ - XML_ERR_ENTITYREF_SEMICOL_MISSING, /* 23 */ - XML_ERR_PEREF_NO_NAME, /* 24 */ - XML_ERR_PEREF_SEMICOL_MISSING, /* 25 */ - XML_ERR_UNDECLARED_ENTITY, /* 26 */ - XML_WAR_UNDECLARED_ENTITY, /* 27 */ - XML_ERR_UNPARSED_ENTITY, /* 28 */ - XML_ERR_ENTITY_IS_EXTERNAL, /* 29 */ - XML_ERR_ENTITY_IS_PARAMETER, /* 30 */ - XML_ERR_UNKNOWN_ENCODING, /* 31 */ - XML_ERR_UNSUPPORTED_ENCODING, /* 32 */ - XML_ERR_STRING_NOT_STARTED, /* 33 */ - XML_ERR_STRING_NOT_CLOSED, /* 34 */ - XML_ERR_NS_DECL_ERROR, /* 35 */ - XML_ERR_ENTITY_NOT_STARTED, /* 36 */ - XML_ERR_ENTITY_NOT_FINISHED, /* 37 */ - XML_ERR_LT_IN_ATTRIBUTE, /* 38 */ - XML_ERR_ATTRIBUTE_NOT_STARTED, /* 39 */ - XML_ERR_ATTRIBUTE_NOT_FINISHED, /* 40 */ - XML_ERR_ATTRIBUTE_WITHOUT_VALUE, /* 41 */ - XML_ERR_ATTRIBUTE_REDEFINED, /* 42 */ - XML_ERR_LITERAL_NOT_STARTED, /* 43 */ - XML_ERR_LITERAL_NOT_FINISHED, /* 44 */ - XML_ERR_COMMENT_NOT_FINISHED, /* 45 */ - XML_ERR_PI_NOT_STARTED, /* 46 */ - XML_ERR_PI_NOT_FINISHED, /* 47 */ - XML_ERR_NOTATION_NOT_STARTED, /* 48 */ - XML_ERR_NOTATION_NOT_FINISHED, /* 49 */ - XML_ERR_ATTLIST_NOT_STARTED, /* 50 */ - XML_ERR_ATTLIST_NOT_FINISHED, /* 51 */ - XML_ERR_MIXED_NOT_STARTED, /* 52 */ - XML_ERR_MIXED_NOT_FINISHED, /* 53 */ - XML_ERR_ELEMCONTENT_NOT_STARTED, /* 54 */ - XML_ERR_ELEMCONTENT_NOT_FINISHED, /* 55 */ - XML_ERR_XMLDECL_NOT_STARTED, /* 56 */ - XML_ERR_XMLDECL_NOT_FINISHED, /* 57 */ - XML_ERR_CONDSEC_NOT_STARTED, /* 58 */ - XML_ERR_CONDSEC_NOT_FINISHED, /* 59 */ - XML_ERR_EXT_SUBSET_NOT_FINISHED, /* 60 */ - XML_ERR_DOCTYPE_NOT_FINISHED, /* 61 */ - XML_ERR_MISPLACED_CDATA_END, /* 62 */ - XML_ERR_CDATA_NOT_FINISHED, /* 63 */ - XML_ERR_RESERVED_XML_NAME, /* 64 */ - XML_ERR_SPACE_REQUIRED, /* 65 */ - XML_ERR_SEPARATOR_REQUIRED, /* 66 */ - XML_ERR_NMTOKEN_REQUIRED, /* 67 */ - XML_ERR_NAME_REQUIRED, /* 68 */ - XML_ERR_PCDATA_REQUIRED, /* 69 */ - XML_ERR_URI_REQUIRED, /* 70 */ - XML_ERR_PUBID_REQUIRED, /* 71 */ - XML_ERR_LT_REQUIRED, /* 72 */ - XML_ERR_GT_REQUIRED, /* 73 */ - XML_ERR_LTSLASH_REQUIRED, /* 74 */ - XML_ERR_EQUAL_REQUIRED, /* 75 */ - XML_ERR_TAG_NAME_MISMATCH, /* 76 */ - XML_ERR_TAG_NOT_FINISHED, /* 77 */ - XML_ERR_STANDALONE_VALUE, /* 78 */ - XML_ERR_ENCODING_NAME, /* 79 */ - XML_ERR_HYPHEN_IN_COMMENT, /* 80 */ - XML_ERR_INVALID_ENCODING, /* 81 */ - XML_ERR_EXT_ENTITY_STANDALONE, /* 82 */ - XML_ERR_CONDSEC_INVALID, /* 83 */ - XML_ERR_VALUE_REQUIRED, /* 84 */ - XML_ERR_NOT_WELL_BALANCED, /* 85 */ - XML_ERR_EXTRA_CONTENT, /* 86 */ - XML_ERR_ENTITY_CHAR_ERROR, /* 87 */ - XML_ERR_ENTITY_PE_INTERNAL, /* 88 */ - XML_ERR_ENTITY_LOOP, /* 89 */ - XML_ERR_ENTITY_BOUNDARY, /* 90 */ - XML_ERR_INVALID_URI, /* 91 */ - XML_ERR_URI_FRAGMENT, /* 92 */ - XML_WAR_CATALOG_PI, /* 93 */ - XML_ERR_NO_DTD, /* 94 */ - XML_ERR_CONDSEC_INVALID_KEYWORD, /* 95 */ - XML_ERR_VERSION_MISSING, /* 96 */ - XML_WAR_UNKNOWN_VERSION, /* 97 */ - XML_WAR_LANG_VALUE, /* 98 */ - XML_WAR_NS_URI, /* 99 */ - XML_WAR_NS_URI_RELATIVE, /* 100 */ - XML_ERR_MISSING_ENCODING, /* 101 */ - XML_WAR_SPACE_VALUE, /* 102 */ - XML_ERR_NOT_STANDALONE, /* 103 */ - XML_ERR_ENTITY_PROCESSING, /* 104 */ - XML_ERR_NOTATION_PROCESSING, /* 105 */ - XML_WAR_NS_COLUMN, /* 106 */ - XML_WAR_ENTITY_REDEFINED, /* 107 */ - XML_ERR_UNKNOWN_VERSION, /* 108 */ - XML_ERR_VERSION_MISMATCH, /* 109 */ - XML_ERR_NAME_TOO_LONG, /* 110 */ - XML_ERR_USER_STOP, /* 111 */ - XML_NS_ERR_XML_NAMESPACE = 200, - XML_NS_ERR_UNDEFINED_NAMESPACE, /* 201 */ - XML_NS_ERR_QNAME, /* 202 */ - XML_NS_ERR_ATTRIBUTE_REDEFINED, /* 203 */ - XML_NS_ERR_EMPTY, /* 204 */ - XML_NS_ERR_COLON, /* 205 */ - XML_DTD_ATTRIBUTE_DEFAULT = 500, - XML_DTD_ATTRIBUTE_REDEFINED, /* 501 */ - XML_DTD_ATTRIBUTE_VALUE, /* 502 */ - XML_DTD_CONTENT_ERROR, /* 503 */ - XML_DTD_CONTENT_MODEL, /* 504 */ - XML_DTD_CONTENT_NOT_DETERMINIST, /* 505 */ - XML_DTD_DIFFERENT_PREFIX, /* 506 */ - XML_DTD_ELEM_DEFAULT_NAMESPACE, /* 507 */ - XML_DTD_ELEM_NAMESPACE, /* 508 */ - XML_DTD_ELEM_REDEFINED, /* 509 */ - XML_DTD_EMPTY_NOTATION, /* 510 */ - XML_DTD_ENTITY_TYPE, /* 511 */ - XML_DTD_ID_FIXED, /* 512 */ - XML_DTD_ID_REDEFINED, /* 513 */ - XML_DTD_ID_SUBSET, /* 514 */ - XML_DTD_INVALID_CHILD, /* 515 */ - XML_DTD_INVALID_DEFAULT, /* 516 */ - XML_DTD_LOAD_ERROR, /* 517 */ - XML_DTD_MISSING_ATTRIBUTE, /* 518 */ - XML_DTD_MIXED_CORRUPT, /* 519 */ - XML_DTD_MULTIPLE_ID, /* 520 */ - XML_DTD_NO_DOC, /* 521 */ - XML_DTD_NO_DTD, /* 522 */ - XML_DTD_NO_ELEM_NAME, /* 523 */ - XML_DTD_NO_PREFIX, /* 524 */ - XML_DTD_NO_ROOT, /* 525 */ - XML_DTD_NOTATION_REDEFINED, /* 526 */ - XML_DTD_NOTATION_VALUE, /* 527 */ - XML_DTD_NOT_EMPTY, /* 528 */ - XML_DTD_NOT_PCDATA, /* 529 */ - XML_DTD_NOT_STANDALONE, /* 530 */ - XML_DTD_ROOT_NAME, /* 531 */ - XML_DTD_STANDALONE_WHITE_SPACE, /* 532 */ - XML_DTD_UNKNOWN_ATTRIBUTE, /* 533 */ - XML_DTD_UNKNOWN_ELEM, /* 534 */ - XML_DTD_UNKNOWN_ENTITY, /* 535 */ - XML_DTD_UNKNOWN_ID, /* 536 */ - XML_DTD_UNKNOWN_NOTATION, /* 537 */ - XML_DTD_STANDALONE_DEFAULTED, /* 538 */ - XML_DTD_XMLID_VALUE, /* 539 */ - XML_DTD_XMLID_TYPE, /* 540 */ - XML_DTD_DUP_TOKEN, /* 541 */ - XML_HTML_STRUCURE_ERROR = 800, - XML_HTML_UNKNOWN_TAG, /* 801 */ - XML_RNGP_ANYNAME_ATTR_ANCESTOR = 1000, - XML_RNGP_ATTR_CONFLICT, /* 1001 */ - XML_RNGP_ATTRIBUTE_CHILDREN, /* 1002 */ - XML_RNGP_ATTRIBUTE_CONTENT, /* 1003 */ - XML_RNGP_ATTRIBUTE_EMPTY, /* 1004 */ - XML_RNGP_ATTRIBUTE_NOOP, /* 1005 */ - XML_RNGP_CHOICE_CONTENT, /* 1006 */ - XML_RNGP_CHOICE_EMPTY, /* 1007 */ - XML_RNGP_CREATE_FAILURE, /* 1008 */ - XML_RNGP_DATA_CONTENT, /* 1009 */ - XML_RNGP_DEF_CHOICE_AND_INTERLEAVE, /* 1010 */ - XML_RNGP_DEFINE_CREATE_FAILED, /* 1011 */ - XML_RNGP_DEFINE_EMPTY, /* 1012 */ - XML_RNGP_DEFINE_MISSING, /* 1013 */ - XML_RNGP_DEFINE_NAME_MISSING, /* 1014 */ - XML_RNGP_ELEM_CONTENT_EMPTY, /* 1015 */ - XML_RNGP_ELEM_CONTENT_ERROR, /* 1016 */ - XML_RNGP_ELEMENT_EMPTY, /* 1017 */ - XML_RNGP_ELEMENT_CONTENT, /* 1018 */ - XML_RNGP_ELEMENT_NAME, /* 1019 */ - XML_RNGP_ELEMENT_NO_CONTENT, /* 1020 */ - XML_RNGP_ELEM_TEXT_CONFLICT, /* 1021 */ - XML_RNGP_EMPTY, /* 1022 */ - XML_RNGP_EMPTY_CONSTRUCT, /* 1023 */ - XML_RNGP_EMPTY_CONTENT, /* 1024 */ - XML_RNGP_EMPTY_NOT_EMPTY, /* 1025 */ - XML_RNGP_ERROR_TYPE_LIB, /* 1026 */ - XML_RNGP_EXCEPT_EMPTY, /* 1027 */ - XML_RNGP_EXCEPT_MISSING, /* 1028 */ - XML_RNGP_EXCEPT_MULTIPLE, /* 1029 */ - XML_RNGP_EXCEPT_NO_CONTENT, /* 1030 */ - XML_RNGP_EXTERNALREF_EMTPY, /* 1031 */ - XML_RNGP_EXTERNAL_REF_FAILURE, /* 1032 */ - XML_RNGP_EXTERNALREF_RECURSE, /* 1033 */ - XML_RNGP_FORBIDDEN_ATTRIBUTE, /* 1034 */ - XML_RNGP_FOREIGN_ELEMENT, /* 1035 */ - XML_RNGP_GRAMMAR_CONTENT, /* 1036 */ - XML_RNGP_GRAMMAR_EMPTY, /* 1037 */ - XML_RNGP_GRAMMAR_MISSING, /* 1038 */ - XML_RNGP_GRAMMAR_NO_START, /* 1039 */ - XML_RNGP_GROUP_ATTR_CONFLICT, /* 1040 */ - XML_RNGP_HREF_ERROR, /* 1041 */ - XML_RNGP_INCLUDE_EMPTY, /* 1042 */ - XML_RNGP_INCLUDE_FAILURE, /* 1043 */ - XML_RNGP_INCLUDE_RECURSE, /* 1044 */ - XML_RNGP_INTERLEAVE_ADD, /* 1045 */ - XML_RNGP_INTERLEAVE_CREATE_FAILED, /* 1046 */ - XML_RNGP_INTERLEAVE_EMPTY, /* 1047 */ - XML_RNGP_INTERLEAVE_NO_CONTENT, /* 1048 */ - XML_RNGP_INVALID_DEFINE_NAME, /* 1049 */ - XML_RNGP_INVALID_URI, /* 1050 */ - XML_RNGP_INVALID_VALUE, /* 1051 */ - XML_RNGP_MISSING_HREF, /* 1052 */ - XML_RNGP_NAME_MISSING, /* 1053 */ - XML_RNGP_NEED_COMBINE, /* 1054 */ - XML_RNGP_NOTALLOWED_NOT_EMPTY, /* 1055 */ - XML_RNGP_NSNAME_ATTR_ANCESTOR, /* 1056 */ - XML_RNGP_NSNAME_NO_NS, /* 1057 */ - XML_RNGP_PARAM_FORBIDDEN, /* 1058 */ - XML_RNGP_PARAM_NAME_MISSING, /* 1059 */ - XML_RNGP_PARENTREF_CREATE_FAILED, /* 1060 */ - XML_RNGP_PARENTREF_NAME_INVALID, /* 1061 */ - XML_RNGP_PARENTREF_NO_NAME, /* 1062 */ - XML_RNGP_PARENTREF_NO_PARENT, /* 1063 */ - XML_RNGP_PARENTREF_NOT_EMPTY, /* 1064 */ - XML_RNGP_PARSE_ERROR, /* 1065 */ - XML_RNGP_PAT_ANYNAME_EXCEPT_ANYNAME, /* 1066 */ - XML_RNGP_PAT_ATTR_ATTR, /* 1067 */ - XML_RNGP_PAT_ATTR_ELEM, /* 1068 */ - XML_RNGP_PAT_DATA_EXCEPT_ATTR, /* 1069 */ - XML_RNGP_PAT_DATA_EXCEPT_ELEM, /* 1070 */ - XML_RNGP_PAT_DATA_EXCEPT_EMPTY, /* 1071 */ - XML_RNGP_PAT_DATA_EXCEPT_GROUP, /* 1072 */ - XML_RNGP_PAT_DATA_EXCEPT_INTERLEAVE, /* 1073 */ - XML_RNGP_PAT_DATA_EXCEPT_LIST, /* 1074 */ - XML_RNGP_PAT_DATA_EXCEPT_ONEMORE, /* 1075 */ - XML_RNGP_PAT_DATA_EXCEPT_REF, /* 1076 */ - XML_RNGP_PAT_DATA_EXCEPT_TEXT, /* 1077 */ - XML_RNGP_PAT_LIST_ATTR, /* 1078 */ - XML_RNGP_PAT_LIST_ELEM, /* 1079 */ - XML_RNGP_PAT_LIST_INTERLEAVE, /* 1080 */ - XML_RNGP_PAT_LIST_LIST, /* 1081 */ - XML_RNGP_PAT_LIST_REF, /* 1082 */ - XML_RNGP_PAT_LIST_TEXT, /* 1083 */ - XML_RNGP_PAT_NSNAME_EXCEPT_ANYNAME, /* 1084 */ - XML_RNGP_PAT_NSNAME_EXCEPT_NSNAME, /* 1085 */ - XML_RNGP_PAT_ONEMORE_GROUP_ATTR, /* 1086 */ - XML_RNGP_PAT_ONEMORE_INTERLEAVE_ATTR, /* 1087 */ - XML_RNGP_PAT_START_ATTR, /* 1088 */ - XML_RNGP_PAT_START_DATA, /* 1089 */ - XML_RNGP_PAT_START_EMPTY, /* 1090 */ - XML_RNGP_PAT_START_GROUP, /* 1091 */ - XML_RNGP_PAT_START_INTERLEAVE, /* 1092 */ - XML_RNGP_PAT_START_LIST, /* 1093 */ - XML_RNGP_PAT_START_ONEMORE, /* 1094 */ - XML_RNGP_PAT_START_TEXT, /* 1095 */ - XML_RNGP_PAT_START_VALUE, /* 1096 */ - XML_RNGP_PREFIX_UNDEFINED, /* 1097 */ - XML_RNGP_REF_CREATE_FAILED, /* 1098 */ - XML_RNGP_REF_CYCLE, /* 1099 */ - XML_RNGP_REF_NAME_INVALID, /* 1100 */ - XML_RNGP_REF_NO_DEF, /* 1101 */ - XML_RNGP_REF_NO_NAME, /* 1102 */ - XML_RNGP_REF_NOT_EMPTY, /* 1103 */ - XML_RNGP_START_CHOICE_AND_INTERLEAVE, /* 1104 */ - XML_RNGP_START_CONTENT, /* 1105 */ - XML_RNGP_START_EMPTY, /* 1106 */ - XML_RNGP_START_MISSING, /* 1107 */ - XML_RNGP_TEXT_EXPECTED, /* 1108 */ - XML_RNGP_TEXT_HAS_CHILD, /* 1109 */ - XML_RNGP_TYPE_MISSING, /* 1110 */ - XML_RNGP_TYPE_NOT_FOUND, /* 1111 */ - XML_RNGP_TYPE_VALUE, /* 1112 */ - XML_RNGP_UNKNOWN_ATTRIBUTE, /* 1113 */ - XML_RNGP_UNKNOWN_COMBINE, /* 1114 */ - XML_RNGP_UNKNOWN_CONSTRUCT, /* 1115 */ - XML_RNGP_UNKNOWN_TYPE_LIB, /* 1116 */ - XML_RNGP_URI_FRAGMENT, /* 1117 */ - XML_RNGP_URI_NOT_ABSOLUTE, /* 1118 */ - XML_RNGP_VALUE_EMPTY, /* 1119 */ - XML_RNGP_VALUE_NO_CONTENT, /* 1120 */ - XML_RNGP_XMLNS_NAME, /* 1121 */ - XML_RNGP_XML_NS, /* 1122 */ - XML_XPATH_EXPRESSION_OK = 1200, - XML_XPATH_NUMBER_ERROR, /* 1201 */ - XML_XPATH_UNFINISHED_LITERAL_ERROR, /* 1202 */ - XML_XPATH_START_LITERAL_ERROR, /* 1203 */ - XML_XPATH_VARIABLE_REF_ERROR, /* 1204 */ - XML_XPATH_UNDEF_VARIABLE_ERROR, /* 1205 */ - XML_XPATH_INVALID_PREDICATE_ERROR, /* 1206 */ - XML_XPATH_EXPR_ERROR, /* 1207 */ - XML_XPATH_UNCLOSED_ERROR, /* 1208 */ - XML_XPATH_UNKNOWN_FUNC_ERROR, /* 1209 */ - XML_XPATH_INVALID_OPERAND, /* 1210 */ - XML_XPATH_INVALID_TYPE, /* 1211 */ - XML_XPATH_INVALID_ARITY, /* 1212 */ - XML_XPATH_INVALID_CTXT_SIZE, /* 1213 */ - XML_XPATH_INVALID_CTXT_POSITION, /* 1214 */ - XML_XPATH_MEMORY_ERROR, /* 1215 */ - XML_XPTR_SYNTAX_ERROR, /* 1216 */ - XML_XPTR_RESOURCE_ERROR, /* 1217 */ - XML_XPTR_SUB_RESOURCE_ERROR, /* 1218 */ - XML_XPATH_UNDEF_PREFIX_ERROR, /* 1219 */ - XML_XPATH_ENCODING_ERROR, /* 1220 */ - XML_XPATH_INVALID_CHAR_ERROR, /* 1221 */ - XML_TREE_INVALID_HEX = 1300, - XML_TREE_INVALID_DEC, /* 1301 */ - XML_TREE_UNTERMINATED_ENTITY, /* 1302 */ - XML_TREE_NOT_UTF8, /* 1303 */ - XML_SAVE_NOT_UTF8 = 1400, - XML_SAVE_CHAR_INVALID, /* 1401 */ - XML_SAVE_NO_DOCTYPE, /* 1402 */ - XML_SAVE_UNKNOWN_ENCODING, /* 1403 */ - XML_REGEXP_COMPILE_ERROR = 1450, - XML_IO_UNKNOWN = 1500, - XML_IO_EACCES, /* 1501 */ - XML_IO_EAGAIN, /* 1502 */ - XML_IO_EBADF, /* 1503 */ - XML_IO_EBADMSG, /* 1504 */ - XML_IO_EBUSY, /* 1505 */ - XML_IO_ECANCELED, /* 1506 */ - XML_IO_ECHILD, /* 1507 */ - XML_IO_EDEADLK, /* 1508 */ - XML_IO_EDOM, /* 1509 */ - XML_IO_EEXIST, /* 1510 */ - XML_IO_EFAULT, /* 1511 */ - XML_IO_EFBIG, /* 1512 */ - XML_IO_EINPROGRESS, /* 1513 */ - XML_IO_EINTR, /* 1514 */ - XML_IO_EINVAL, /* 1515 */ - XML_IO_EIO, /* 1516 */ - XML_IO_EISDIR, /* 1517 */ - XML_IO_EMFILE, /* 1518 */ - XML_IO_EMLINK, /* 1519 */ - XML_IO_EMSGSIZE, /* 1520 */ - XML_IO_ENAMETOOLONG, /* 1521 */ - XML_IO_ENFILE, /* 1522 */ - XML_IO_ENODEV, /* 1523 */ - XML_IO_ENOENT, /* 1524 */ - XML_IO_ENOEXEC, /* 1525 */ - XML_IO_ENOLCK, /* 1526 */ - XML_IO_ENOMEM, /* 1527 */ - XML_IO_ENOSPC, /* 1528 */ - XML_IO_ENOSYS, /* 1529 */ - XML_IO_ENOTDIR, /* 1530 */ - XML_IO_ENOTEMPTY, /* 1531 */ - XML_IO_ENOTSUP, /* 1532 */ - XML_IO_ENOTTY, /* 1533 */ - XML_IO_ENXIO, /* 1534 */ - XML_IO_EPERM, /* 1535 */ - XML_IO_EPIPE, /* 1536 */ - XML_IO_ERANGE, /* 1537 */ - XML_IO_EROFS, /* 1538 */ - XML_IO_ESPIPE, /* 1539 */ - XML_IO_ESRCH, /* 1540 */ - XML_IO_ETIMEDOUT, /* 1541 */ - XML_IO_EXDEV, /* 1542 */ - XML_IO_NETWORK_ATTEMPT, /* 1543 */ - XML_IO_ENCODER, /* 1544 */ - XML_IO_FLUSH, /* 1545 */ - XML_IO_WRITE, /* 1546 */ - XML_IO_NO_INPUT, /* 1547 */ - XML_IO_BUFFER_FULL, /* 1548 */ - XML_IO_LOAD_ERROR, /* 1549 */ - XML_IO_ENOTSOCK, /* 1550 */ - XML_IO_EISCONN, /* 1551 */ - XML_IO_ECONNREFUSED, /* 1552 */ - XML_IO_ENETUNREACH, /* 1553 */ - XML_IO_EADDRINUSE, /* 1554 */ - XML_IO_EALREADY, /* 1555 */ - XML_IO_EAFNOSUPPORT, /* 1556 */ - XML_XINCLUDE_RECURSION=1600, - XML_XINCLUDE_PARSE_VALUE, /* 1601 */ - XML_XINCLUDE_ENTITY_DEF_MISMATCH, /* 1602 */ - XML_XINCLUDE_NO_HREF, /* 1603 */ - XML_XINCLUDE_NO_FALLBACK, /* 1604 */ - XML_XINCLUDE_HREF_URI, /* 1605 */ - XML_XINCLUDE_TEXT_FRAGMENT, /* 1606 */ - XML_XINCLUDE_TEXT_DOCUMENT, /* 1607 */ - XML_XINCLUDE_INVALID_CHAR, /* 1608 */ - XML_XINCLUDE_BUILD_FAILED, /* 1609 */ - XML_XINCLUDE_UNKNOWN_ENCODING, /* 1610 */ - XML_XINCLUDE_MULTIPLE_ROOT, /* 1611 */ - XML_XINCLUDE_XPTR_FAILED, /* 1612 */ - XML_XINCLUDE_XPTR_RESULT, /* 1613 */ - XML_XINCLUDE_INCLUDE_IN_INCLUDE, /* 1614 */ - XML_XINCLUDE_FALLBACKS_IN_INCLUDE, /* 1615 */ - XML_XINCLUDE_FALLBACK_NOT_IN_INCLUDE, /* 1616 */ - XML_XINCLUDE_DEPRECATED_NS, /* 1617 */ - XML_XINCLUDE_FRAGMENT_ID, /* 1618 */ - XML_CATALOG_MISSING_ATTR = 1650, - XML_CATALOG_ENTRY_BROKEN, /* 1651 */ - XML_CATALOG_PREFER_VALUE, /* 1652 */ - XML_CATALOG_NOT_CATALOG, /* 1653 */ - XML_CATALOG_RECURSION, /* 1654 */ - XML_SCHEMAP_PREFIX_UNDEFINED = 1700, - XML_SCHEMAP_ATTRFORMDEFAULT_VALUE, /* 1701 */ - XML_SCHEMAP_ATTRGRP_NONAME_NOREF, /* 1702 */ - XML_SCHEMAP_ATTR_NONAME_NOREF, /* 1703 */ - XML_SCHEMAP_COMPLEXTYPE_NONAME_NOREF, /* 1704 */ - XML_SCHEMAP_ELEMFORMDEFAULT_VALUE, /* 1705 */ - XML_SCHEMAP_ELEM_NONAME_NOREF, /* 1706 */ - XML_SCHEMAP_EXTENSION_NO_BASE, /* 1707 */ - XML_SCHEMAP_FACET_NO_VALUE, /* 1708 */ - XML_SCHEMAP_FAILED_BUILD_IMPORT, /* 1709 */ - XML_SCHEMAP_GROUP_NONAME_NOREF, /* 1710 */ - XML_SCHEMAP_IMPORT_NAMESPACE_NOT_URI, /* 1711 */ - XML_SCHEMAP_IMPORT_REDEFINE_NSNAME, /* 1712 */ - XML_SCHEMAP_IMPORT_SCHEMA_NOT_URI, /* 1713 */ - XML_SCHEMAP_INVALID_BOOLEAN, /* 1714 */ - XML_SCHEMAP_INVALID_ENUM, /* 1715 */ - XML_SCHEMAP_INVALID_FACET, /* 1716 */ - XML_SCHEMAP_INVALID_FACET_VALUE, /* 1717 */ - XML_SCHEMAP_INVALID_MAXOCCURS, /* 1718 */ - XML_SCHEMAP_INVALID_MINOCCURS, /* 1719 */ - XML_SCHEMAP_INVALID_REF_AND_SUBTYPE, /* 1720 */ - XML_SCHEMAP_INVALID_WHITE_SPACE, /* 1721 */ - XML_SCHEMAP_NOATTR_NOREF, /* 1722 */ - XML_SCHEMAP_NOTATION_NO_NAME, /* 1723 */ - XML_SCHEMAP_NOTYPE_NOREF, /* 1724 */ - XML_SCHEMAP_REF_AND_SUBTYPE, /* 1725 */ - XML_SCHEMAP_RESTRICTION_NONAME_NOREF, /* 1726 */ - XML_SCHEMAP_SIMPLETYPE_NONAME, /* 1727 */ - XML_SCHEMAP_TYPE_AND_SUBTYPE, /* 1728 */ - XML_SCHEMAP_UNKNOWN_ALL_CHILD, /* 1729 */ - XML_SCHEMAP_UNKNOWN_ANYATTRIBUTE_CHILD, /* 1730 */ - XML_SCHEMAP_UNKNOWN_ATTR_CHILD, /* 1731 */ - XML_SCHEMAP_UNKNOWN_ATTRGRP_CHILD, /* 1732 */ - XML_SCHEMAP_UNKNOWN_ATTRIBUTE_GROUP, /* 1733 */ - XML_SCHEMAP_UNKNOWN_BASE_TYPE, /* 1734 */ - XML_SCHEMAP_UNKNOWN_CHOICE_CHILD, /* 1735 */ - XML_SCHEMAP_UNKNOWN_COMPLEXCONTENT_CHILD, /* 1736 */ - XML_SCHEMAP_UNKNOWN_COMPLEXTYPE_CHILD, /* 1737 */ - XML_SCHEMAP_UNKNOWN_ELEM_CHILD, /* 1738 */ - XML_SCHEMAP_UNKNOWN_EXTENSION_CHILD, /* 1739 */ - XML_SCHEMAP_UNKNOWN_FACET_CHILD, /* 1740 */ - XML_SCHEMAP_UNKNOWN_FACET_TYPE, /* 1741 */ - XML_SCHEMAP_UNKNOWN_GROUP_CHILD, /* 1742 */ - XML_SCHEMAP_UNKNOWN_IMPORT_CHILD, /* 1743 */ - XML_SCHEMAP_UNKNOWN_LIST_CHILD, /* 1744 */ - XML_SCHEMAP_UNKNOWN_NOTATION_CHILD, /* 1745 */ - XML_SCHEMAP_UNKNOWN_PROCESSCONTENT_CHILD, /* 1746 */ - XML_SCHEMAP_UNKNOWN_REF, /* 1747 */ - XML_SCHEMAP_UNKNOWN_RESTRICTION_CHILD, /* 1748 */ - XML_SCHEMAP_UNKNOWN_SCHEMAS_CHILD, /* 1749 */ - XML_SCHEMAP_UNKNOWN_SEQUENCE_CHILD, /* 1750 */ - XML_SCHEMAP_UNKNOWN_SIMPLECONTENT_CHILD, /* 1751 */ - XML_SCHEMAP_UNKNOWN_SIMPLETYPE_CHILD, /* 1752 */ - XML_SCHEMAP_UNKNOWN_TYPE, /* 1753 */ - XML_SCHEMAP_UNKNOWN_UNION_CHILD, /* 1754 */ - XML_SCHEMAP_ELEM_DEFAULT_FIXED, /* 1755 */ - XML_SCHEMAP_REGEXP_INVALID, /* 1756 */ - XML_SCHEMAP_FAILED_LOAD, /* 1757 */ - XML_SCHEMAP_NOTHING_TO_PARSE, /* 1758 */ - XML_SCHEMAP_NOROOT, /* 1759 */ - XML_SCHEMAP_REDEFINED_GROUP, /* 1760 */ - XML_SCHEMAP_REDEFINED_TYPE, /* 1761 */ - XML_SCHEMAP_REDEFINED_ELEMENT, /* 1762 */ - XML_SCHEMAP_REDEFINED_ATTRGROUP, /* 1763 */ - XML_SCHEMAP_REDEFINED_ATTR, /* 1764 */ - XML_SCHEMAP_REDEFINED_NOTATION, /* 1765 */ - XML_SCHEMAP_FAILED_PARSE, /* 1766 */ - XML_SCHEMAP_UNKNOWN_PREFIX, /* 1767 */ - XML_SCHEMAP_DEF_AND_PREFIX, /* 1768 */ - XML_SCHEMAP_UNKNOWN_INCLUDE_CHILD, /* 1769 */ - XML_SCHEMAP_INCLUDE_SCHEMA_NOT_URI, /* 1770 */ - XML_SCHEMAP_INCLUDE_SCHEMA_NO_URI, /* 1771 */ - XML_SCHEMAP_NOT_SCHEMA, /* 1772 */ - XML_SCHEMAP_UNKNOWN_MEMBER_TYPE, /* 1773 */ - XML_SCHEMAP_INVALID_ATTR_USE, /* 1774 */ - XML_SCHEMAP_RECURSIVE, /* 1775 */ - XML_SCHEMAP_SUPERNUMEROUS_LIST_ITEM_TYPE, /* 1776 */ - XML_SCHEMAP_INVALID_ATTR_COMBINATION, /* 1777 */ - XML_SCHEMAP_INVALID_ATTR_INLINE_COMBINATION, /* 1778 */ - XML_SCHEMAP_MISSING_SIMPLETYPE_CHILD, /* 1779 */ - XML_SCHEMAP_INVALID_ATTR_NAME, /* 1780 */ - XML_SCHEMAP_REF_AND_CONTENT, /* 1781 */ - XML_SCHEMAP_CT_PROPS_CORRECT_1, /* 1782 */ - XML_SCHEMAP_CT_PROPS_CORRECT_2, /* 1783 */ - XML_SCHEMAP_CT_PROPS_CORRECT_3, /* 1784 */ - XML_SCHEMAP_CT_PROPS_CORRECT_4, /* 1785 */ - XML_SCHEMAP_CT_PROPS_CORRECT_5, /* 1786 */ - XML_SCHEMAP_DERIVATION_OK_RESTRICTION_1, /* 1787 */ - XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_1, /* 1788 */ - XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_2, /* 1789 */ - XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_2, /* 1790 */ - XML_SCHEMAP_DERIVATION_OK_RESTRICTION_3, /* 1791 */ - XML_SCHEMAP_WILDCARD_INVALID_NS_MEMBER, /* 1792 */ - XML_SCHEMAP_INTERSECTION_NOT_EXPRESSIBLE, /* 1793 */ - XML_SCHEMAP_UNION_NOT_EXPRESSIBLE, /* 1794 */ - XML_SCHEMAP_SRC_IMPORT_3_1, /* 1795 */ - XML_SCHEMAP_SRC_IMPORT_3_2, /* 1796 */ - XML_SCHEMAP_DERIVATION_OK_RESTRICTION_4_1, /* 1797 */ - XML_SCHEMAP_DERIVATION_OK_RESTRICTION_4_2, /* 1798 */ - XML_SCHEMAP_DERIVATION_OK_RESTRICTION_4_3, /* 1799 */ - XML_SCHEMAP_COS_CT_EXTENDS_1_3, /* 1800 */ - XML_SCHEMAV_NOROOT = 1801, - XML_SCHEMAV_UNDECLAREDELEM, /* 1802 */ - XML_SCHEMAV_NOTTOPLEVEL, /* 1803 */ - XML_SCHEMAV_MISSING, /* 1804 */ - XML_SCHEMAV_WRONGELEM, /* 1805 */ - XML_SCHEMAV_NOTYPE, /* 1806 */ - XML_SCHEMAV_NOROLLBACK, /* 1807 */ - XML_SCHEMAV_ISABSTRACT, /* 1808 */ - XML_SCHEMAV_NOTEMPTY, /* 1809 */ - XML_SCHEMAV_ELEMCONT, /* 1810 */ - XML_SCHEMAV_HAVEDEFAULT, /* 1811 */ - XML_SCHEMAV_NOTNILLABLE, /* 1812 */ - XML_SCHEMAV_EXTRACONTENT, /* 1813 */ - XML_SCHEMAV_INVALIDATTR, /* 1814 */ - XML_SCHEMAV_INVALIDELEM, /* 1815 */ - XML_SCHEMAV_NOTDETERMINIST, /* 1816 */ - XML_SCHEMAV_CONSTRUCT, /* 1817 */ - XML_SCHEMAV_INTERNAL, /* 1818 */ - XML_SCHEMAV_NOTSIMPLE, /* 1819 */ - XML_SCHEMAV_ATTRUNKNOWN, /* 1820 */ - XML_SCHEMAV_ATTRINVALID, /* 1821 */ - XML_SCHEMAV_VALUE, /* 1822 */ - XML_SCHEMAV_FACET, /* 1823 */ - XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_1, /* 1824 */ - XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_2, /* 1825 */ - XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_3, /* 1826 */ - XML_SCHEMAV_CVC_TYPE_3_1_1, /* 1827 */ - XML_SCHEMAV_CVC_TYPE_3_1_2, /* 1828 */ - XML_SCHEMAV_CVC_FACET_VALID, /* 1829 */ - XML_SCHEMAV_CVC_LENGTH_VALID, /* 1830 */ - XML_SCHEMAV_CVC_MINLENGTH_VALID, /* 1831 */ - XML_SCHEMAV_CVC_MAXLENGTH_VALID, /* 1832 */ - XML_SCHEMAV_CVC_MININCLUSIVE_VALID, /* 1833 */ - XML_SCHEMAV_CVC_MAXINCLUSIVE_VALID, /* 1834 */ - XML_SCHEMAV_CVC_MINEXCLUSIVE_VALID, /* 1835 */ - XML_SCHEMAV_CVC_MAXEXCLUSIVE_VALID, /* 1836 */ - XML_SCHEMAV_CVC_TOTALDIGITS_VALID, /* 1837 */ - XML_SCHEMAV_CVC_FRACTIONDIGITS_VALID, /* 1838 */ - XML_SCHEMAV_CVC_PATTERN_VALID, /* 1839 */ - XML_SCHEMAV_CVC_ENUMERATION_VALID, /* 1840 */ - XML_SCHEMAV_CVC_COMPLEX_TYPE_2_1, /* 1841 */ - XML_SCHEMAV_CVC_COMPLEX_TYPE_2_2, /* 1842 */ - XML_SCHEMAV_CVC_COMPLEX_TYPE_2_3, /* 1843 */ - XML_SCHEMAV_CVC_COMPLEX_TYPE_2_4, /* 1844 */ - XML_SCHEMAV_CVC_ELT_1, /* 1845 */ - XML_SCHEMAV_CVC_ELT_2, /* 1846 */ - XML_SCHEMAV_CVC_ELT_3_1, /* 1847 */ - XML_SCHEMAV_CVC_ELT_3_2_1, /* 1848 */ - XML_SCHEMAV_CVC_ELT_3_2_2, /* 1849 */ - XML_SCHEMAV_CVC_ELT_4_1, /* 1850 */ - XML_SCHEMAV_CVC_ELT_4_2, /* 1851 */ - XML_SCHEMAV_CVC_ELT_4_3, /* 1852 */ - XML_SCHEMAV_CVC_ELT_5_1_1, /* 1853 */ - XML_SCHEMAV_CVC_ELT_5_1_2, /* 1854 */ - XML_SCHEMAV_CVC_ELT_5_2_1, /* 1855 */ - XML_SCHEMAV_CVC_ELT_5_2_2_1, /* 1856 */ - XML_SCHEMAV_CVC_ELT_5_2_2_2_1, /* 1857 */ - XML_SCHEMAV_CVC_ELT_5_2_2_2_2, /* 1858 */ - XML_SCHEMAV_CVC_ELT_6, /* 1859 */ - XML_SCHEMAV_CVC_ELT_7, /* 1860 */ - XML_SCHEMAV_CVC_ATTRIBUTE_1, /* 1861 */ - XML_SCHEMAV_CVC_ATTRIBUTE_2, /* 1862 */ - XML_SCHEMAV_CVC_ATTRIBUTE_3, /* 1863 */ - XML_SCHEMAV_CVC_ATTRIBUTE_4, /* 1864 */ - XML_SCHEMAV_CVC_COMPLEX_TYPE_3_1, /* 1865 */ - XML_SCHEMAV_CVC_COMPLEX_TYPE_3_2_1, /* 1866 */ - XML_SCHEMAV_CVC_COMPLEX_TYPE_3_2_2, /* 1867 */ - XML_SCHEMAV_CVC_COMPLEX_TYPE_4, /* 1868 */ - XML_SCHEMAV_CVC_COMPLEX_TYPE_5_1, /* 1869 */ - XML_SCHEMAV_CVC_COMPLEX_TYPE_5_2, /* 1870 */ - XML_SCHEMAV_ELEMENT_CONTENT, /* 1871 */ - XML_SCHEMAV_DOCUMENT_ELEMENT_MISSING, /* 1872 */ - XML_SCHEMAV_CVC_COMPLEX_TYPE_1, /* 1873 */ - XML_SCHEMAV_CVC_AU, /* 1874 */ - XML_SCHEMAV_CVC_TYPE_1, /* 1875 */ - XML_SCHEMAV_CVC_TYPE_2, /* 1876 */ - XML_SCHEMAV_CVC_IDC, /* 1877 */ - XML_SCHEMAV_CVC_WILDCARD, /* 1878 */ - XML_SCHEMAV_MISC, /* 1879 */ - XML_XPTR_UNKNOWN_SCHEME = 1900, - XML_XPTR_CHILDSEQ_START, /* 1901 */ - XML_XPTR_EVAL_FAILED, /* 1902 */ - XML_XPTR_EXTRA_OBJECTS, /* 1903 */ - XML_C14N_CREATE_CTXT = 1950, - XML_C14N_REQUIRES_UTF8, /* 1951 */ - XML_C14N_CREATE_STACK, /* 1952 */ - XML_C14N_INVALID_NODE, /* 1953 */ - XML_C14N_UNKNOW_NODE, /* 1954 */ - XML_C14N_RELATIVE_NAMESPACE, /* 1955 */ - XML_FTP_PASV_ANSWER = 2000, - XML_FTP_EPSV_ANSWER, /* 2001 */ - XML_FTP_ACCNT, /* 2002 */ - XML_FTP_URL_SYNTAX, /* 2003 */ - XML_HTTP_URL_SYNTAX = 2020, - XML_HTTP_USE_IP, /* 2021 */ - XML_HTTP_UNKNOWN_HOST, /* 2022 */ - XML_SCHEMAP_SRC_SIMPLE_TYPE_1 = 3000, - XML_SCHEMAP_SRC_SIMPLE_TYPE_2, /* 3001 */ - XML_SCHEMAP_SRC_SIMPLE_TYPE_3, /* 3002 */ - XML_SCHEMAP_SRC_SIMPLE_TYPE_4, /* 3003 */ - XML_SCHEMAP_SRC_RESOLVE, /* 3004 */ - XML_SCHEMAP_SRC_RESTRICTION_BASE_OR_SIMPLETYPE, /* 3005 */ - XML_SCHEMAP_SRC_LIST_ITEMTYPE_OR_SIMPLETYPE, /* 3006 */ - XML_SCHEMAP_SRC_UNION_MEMBERTYPES_OR_SIMPLETYPES, /* 3007 */ - XML_SCHEMAP_ST_PROPS_CORRECT_1, /* 3008 */ - XML_SCHEMAP_ST_PROPS_CORRECT_2, /* 3009 */ - XML_SCHEMAP_ST_PROPS_CORRECT_3, /* 3010 */ - XML_SCHEMAP_COS_ST_RESTRICTS_1_1, /* 3011 */ - XML_SCHEMAP_COS_ST_RESTRICTS_1_2, /* 3012 */ - XML_SCHEMAP_COS_ST_RESTRICTS_1_3_1, /* 3013 */ - XML_SCHEMAP_COS_ST_RESTRICTS_1_3_2, /* 3014 */ - XML_SCHEMAP_COS_ST_RESTRICTS_2_1, /* 3015 */ - XML_SCHEMAP_COS_ST_RESTRICTS_2_3_1_1, /* 3016 */ - XML_SCHEMAP_COS_ST_RESTRICTS_2_3_1_2, /* 3017 */ - XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_1, /* 3018 */ - XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_2, /* 3019 */ - XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_3, /* 3020 */ - XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_4, /* 3021 */ - XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_5, /* 3022 */ - XML_SCHEMAP_COS_ST_RESTRICTS_3_1, /* 3023 */ - XML_SCHEMAP_COS_ST_RESTRICTS_3_3_1, /* 3024 */ - XML_SCHEMAP_COS_ST_RESTRICTS_3_3_1_2, /* 3025 */ - XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_2, /* 3026 */ - XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_1, /* 3027 */ - XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_3, /* 3028 */ - XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_4, /* 3029 */ - XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_5, /* 3030 */ - XML_SCHEMAP_COS_ST_DERIVED_OK_2_1, /* 3031 */ - XML_SCHEMAP_COS_ST_DERIVED_OK_2_2, /* 3032 */ - XML_SCHEMAP_S4S_ELEM_NOT_ALLOWED, /* 3033 */ - XML_SCHEMAP_S4S_ELEM_MISSING, /* 3034 */ - XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, /* 3035 */ - XML_SCHEMAP_S4S_ATTR_MISSING, /* 3036 */ - XML_SCHEMAP_S4S_ATTR_INVALID_VALUE, /* 3037 */ - XML_SCHEMAP_SRC_ELEMENT_1, /* 3038 */ - XML_SCHEMAP_SRC_ELEMENT_2_1, /* 3039 */ - XML_SCHEMAP_SRC_ELEMENT_2_2, /* 3040 */ - XML_SCHEMAP_SRC_ELEMENT_3, /* 3041 */ - XML_SCHEMAP_P_PROPS_CORRECT_1, /* 3042 */ - XML_SCHEMAP_P_PROPS_CORRECT_2_1, /* 3043 */ - XML_SCHEMAP_P_PROPS_CORRECT_2_2, /* 3044 */ - XML_SCHEMAP_E_PROPS_CORRECT_2, /* 3045 */ - XML_SCHEMAP_E_PROPS_CORRECT_3, /* 3046 */ - XML_SCHEMAP_E_PROPS_CORRECT_4, /* 3047 */ - XML_SCHEMAP_E_PROPS_CORRECT_5, /* 3048 */ - XML_SCHEMAP_E_PROPS_CORRECT_6, /* 3049 */ - XML_SCHEMAP_SRC_INCLUDE, /* 3050 */ - XML_SCHEMAP_SRC_ATTRIBUTE_1, /* 3051 */ - XML_SCHEMAP_SRC_ATTRIBUTE_2, /* 3052 */ - XML_SCHEMAP_SRC_ATTRIBUTE_3_1, /* 3053 */ - XML_SCHEMAP_SRC_ATTRIBUTE_3_2, /* 3054 */ - XML_SCHEMAP_SRC_ATTRIBUTE_4, /* 3055 */ - XML_SCHEMAP_NO_XMLNS, /* 3056 */ - XML_SCHEMAP_NO_XSI, /* 3057 */ - XML_SCHEMAP_COS_VALID_DEFAULT_1, /* 3058 */ - XML_SCHEMAP_COS_VALID_DEFAULT_2_1, /* 3059 */ - XML_SCHEMAP_COS_VALID_DEFAULT_2_2_1, /* 3060 */ - XML_SCHEMAP_COS_VALID_DEFAULT_2_2_2, /* 3061 */ - XML_SCHEMAP_CVC_SIMPLE_TYPE, /* 3062 */ - XML_SCHEMAP_COS_CT_EXTENDS_1_1, /* 3063 */ - XML_SCHEMAP_SRC_IMPORT_1_1, /* 3064 */ - XML_SCHEMAP_SRC_IMPORT_1_2, /* 3065 */ - XML_SCHEMAP_SRC_IMPORT_2, /* 3066 */ - XML_SCHEMAP_SRC_IMPORT_2_1, /* 3067 */ - XML_SCHEMAP_SRC_IMPORT_2_2, /* 3068 */ - XML_SCHEMAP_INTERNAL, /* 3069 non-W3C */ - XML_SCHEMAP_NOT_DETERMINISTIC, /* 3070 non-W3C */ - XML_SCHEMAP_SRC_ATTRIBUTE_GROUP_1, /* 3071 */ - XML_SCHEMAP_SRC_ATTRIBUTE_GROUP_2, /* 3072 */ - XML_SCHEMAP_SRC_ATTRIBUTE_GROUP_3, /* 3073 */ - XML_SCHEMAP_MG_PROPS_CORRECT_1, /* 3074 */ - XML_SCHEMAP_MG_PROPS_CORRECT_2, /* 3075 */ - XML_SCHEMAP_SRC_CT_1, /* 3076 */ - XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_3, /* 3077 */ - XML_SCHEMAP_AU_PROPS_CORRECT_2, /* 3078 */ - XML_SCHEMAP_A_PROPS_CORRECT_2, /* 3079 */ - XML_SCHEMAP_C_PROPS_CORRECT, /* 3080 */ - XML_SCHEMAP_SRC_REDEFINE, /* 3081 */ - XML_SCHEMAP_SRC_IMPORT, /* 3082 */ - XML_SCHEMAP_WARN_SKIP_SCHEMA, /* 3083 */ - XML_SCHEMAP_WARN_UNLOCATED_SCHEMA, /* 3084 */ - XML_SCHEMAP_WARN_ATTR_REDECL_PROH, /* 3085 */ - XML_SCHEMAP_WARN_ATTR_POINTLESS_PROH, /* 3085 */ - XML_SCHEMAP_AG_PROPS_CORRECT, /* 3086 */ - XML_SCHEMAP_COS_CT_EXTENDS_1_2, /* 3087 */ - XML_SCHEMAP_AU_PROPS_CORRECT, /* 3088 */ - XML_SCHEMAP_A_PROPS_CORRECT_3, /* 3089 */ - XML_SCHEMAP_COS_ALL_LIMITED, /* 3090 */ - XML_SCHEMATRONV_ASSERT = 4000, /* 4000 */ - XML_SCHEMATRONV_REPORT, - XML_MODULE_OPEN = 4900, /* 4900 */ - XML_MODULE_CLOSE, /* 4901 */ - XML_CHECK_FOUND_ELEMENT = 5000, - XML_CHECK_FOUND_ATTRIBUTE, /* 5001 */ - XML_CHECK_FOUND_TEXT, /* 5002 */ - XML_CHECK_FOUND_CDATA, /* 5003 */ - XML_CHECK_FOUND_ENTITYREF, /* 5004 */ - XML_CHECK_FOUND_ENTITY, /* 5005 */ - XML_CHECK_FOUND_PI, /* 5006 */ - XML_CHECK_FOUND_COMMENT, /* 5007 */ - XML_CHECK_FOUND_DOCTYPE, /* 5008 */ - XML_CHECK_FOUND_FRAGMENT, /* 5009 */ - XML_CHECK_FOUND_NOTATION, /* 5010 */ - XML_CHECK_UNKNOWN_NODE, /* 5011 */ - XML_CHECK_ENTITY_TYPE, /* 5012 */ - XML_CHECK_NO_PARENT, /* 5013 */ - XML_CHECK_NO_DOC, /* 5014 */ - XML_CHECK_NO_NAME, /* 5015 */ - XML_CHECK_NO_ELEM, /* 5016 */ - XML_CHECK_WRONG_DOC, /* 5017 */ - XML_CHECK_NO_PREV, /* 5018 */ - XML_CHECK_WRONG_PREV, /* 5019 */ - XML_CHECK_NO_NEXT, /* 5020 */ - XML_CHECK_WRONG_NEXT, /* 5021 */ - XML_CHECK_NOT_DTD, /* 5022 */ - XML_CHECK_NOT_ATTR, /* 5023 */ - XML_CHECK_NOT_ATTR_DECL, /* 5024 */ - XML_CHECK_NOT_ELEM_DECL, /* 5025 */ - XML_CHECK_NOT_ENTITY_DECL, /* 5026 */ - XML_CHECK_NOT_NS_DECL, /* 5027 */ - XML_CHECK_NO_HREF, /* 5028 */ - XML_CHECK_WRONG_PARENT,/* 5029 */ - XML_CHECK_NS_SCOPE, /* 5030 */ - XML_CHECK_NS_ANCESTOR, /* 5031 */ - XML_CHECK_NOT_UTF8, /* 5032 */ - XML_CHECK_NO_DICT, /* 5033 */ - XML_CHECK_NOT_NCNAME, /* 5034 */ - XML_CHECK_OUTSIDE_DICT, /* 5035 */ - XML_CHECK_WRONG_NAME, /* 5036 */ - XML_CHECK_NAME_NOT_NULL, /* 5037 */ - XML_I18N_NO_NAME = 6000, - XML_I18N_NO_HANDLER, /* 6001 */ - XML_I18N_EXCESS_HANDLER, /* 6002 */ - XML_I18N_CONV_FAILED, /* 6003 */ - XML_I18N_NO_OUTPUT, /* 6004 */ - XML_BUF_OVERFLOW = 7000 -} xmlParserErrors; - -/** - * xmlGenericErrorFunc: - * @ctx: a parsing context - * @msg: the message - * @...: the extra arguments of the varags to format the message - * - * Signature of the function to use when there is an error and - * no parsing or validity context available . - */ -typedef void (XMLCDECL *xmlGenericErrorFunc) (void *ctx, - const char *msg, - ...) LIBXML_ATTR_FORMAT(2,3); -/** - * xmlStructuredErrorFunc: - * @userData: user provided data for the error callback - * @error: the error being raised. - * - * Signature of the function to use when there is an error and - * the module handles the new error reporting mechanism. - */ -typedef void (XMLCALL *xmlStructuredErrorFunc) (void *userData, xmlErrorPtr error); - -/* - * Use the following function to reset the two global variables - * xmlGenericError and xmlGenericErrorContext. - */ -XMLPUBFUN void XMLCALL - xmlSetGenericErrorFunc (void *ctx, - xmlGenericErrorFunc handler); -XMLPUBFUN void XMLCALL - initGenericErrorDefaultFunc (xmlGenericErrorFunc *handler); - -XMLPUBFUN void XMLCALL - xmlSetStructuredErrorFunc (void *ctx, - xmlStructuredErrorFunc handler); -/* - * Default message routines used by SAX and Valid context for error - * and warning reporting. - */ -XMLPUBFUN void XMLCDECL - xmlParserError (void *ctx, - const char *msg, - ...) LIBXML_ATTR_FORMAT(2,3); -XMLPUBFUN void XMLCDECL - xmlParserWarning (void *ctx, - const char *msg, - ...) LIBXML_ATTR_FORMAT(2,3); -XMLPUBFUN void XMLCDECL - xmlParserValidityError (void *ctx, - const char *msg, - ...) LIBXML_ATTR_FORMAT(2,3); -XMLPUBFUN void XMLCDECL - xmlParserValidityWarning (void *ctx, - const char *msg, - ...) LIBXML_ATTR_FORMAT(2,3); -XMLPUBFUN void XMLCALL - xmlParserPrintFileInfo (xmlParserInputPtr input); -XMLPUBFUN void XMLCALL - xmlParserPrintFileContext (xmlParserInputPtr input); - -/* - * Extended error information routines - */ -XMLPUBFUN xmlErrorPtr XMLCALL - xmlGetLastError (void); -XMLPUBFUN void XMLCALL - xmlResetLastError (void); -XMLPUBFUN xmlErrorPtr XMLCALL - xmlCtxtGetLastError (void *ctx); -XMLPUBFUN void XMLCALL - xmlCtxtResetLastError (void *ctx); -XMLPUBFUN void XMLCALL - xmlResetError (xmlErrorPtr err); -XMLPUBFUN int XMLCALL - xmlCopyError (xmlErrorPtr from, - xmlErrorPtr to); - -#ifdef IN_LIBXML -/* - * Internal callback reporting routine - */ -XMLPUBFUN void XMLCALL - __xmlRaiseError (xmlStructuredErrorFunc schannel, - xmlGenericErrorFunc channel, - void *data, - void *ctx, - void *node, - int domain, - int code, - xmlErrorLevel level, - const char *file, - int line, - const char *str1, - const char *str2, - const char *str3, - int int1, - int col, - const char *msg, - ...) LIBXML_ATTR_FORMAT(16,17); -XMLPUBFUN void XMLCALL - __xmlSimpleError (int domain, - int code, - xmlNodePtr node, - const char *msg, - const char *extra); -#endif -#ifdef __cplusplus -} -#endif -#endif /* __XML_ERROR_H__ */ diff --git a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/xmlexports.h b/cocos2dx/platform/third_party/emscripten/libxml2/libxml/xmlexports.h deleted file mode 100644 index 2c79f814b4..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/xmlexports.h +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Summary: macros for marking symbols as exportable/importable. - * Description: macros for marking symbols as exportable/importable. - * - * Copy: See Copyright for the status of this software. - * - * Author: Igor Zlatovic - */ - -#ifndef __XML_EXPORTS_H__ -#define __XML_EXPORTS_H__ - -/** - * XMLPUBFUN, XMLPUBVAR, XMLCALL - * - * Macros which declare an exportable function, an exportable variable and - * the calling convention used for functions. - * - * Please use an extra block for every platform/compiler combination when - * modifying this, rather than overlong #ifdef lines. This helps - * readability as well as the fact that different compilers on the same - * platform might need different definitions. - */ - -/** - * XMLPUBFUN: - * - * Macros which declare an exportable function - */ -#define XMLPUBFUN -/** - * XMLPUBVAR: - * - * Macros which declare an exportable variable - */ -#define XMLPUBVAR extern -/** - * XMLCALL: - * - * Macros which declare the called convention for exported functions - */ -#define XMLCALL -/** - * XMLCDECL: - * - * Macro which declares the calling convention for exported functions that - * use '...'. - */ -#define XMLCDECL - -/** DOC_DISABLE */ - -/* Windows platform with MS compiler */ -#if defined(_WIN32) && defined(_MSC_VER) - #undef XMLPUBFUN - #undef XMLPUBVAR - #undef XMLCALL - #undef XMLCDECL - #if defined(IN_LIBXML) && !defined(LIBXML_STATIC) - #define XMLPUBFUN __declspec(dllexport) - #define XMLPUBVAR __declspec(dllexport) - #else - #define XMLPUBFUN - #if !defined(LIBXML_STATIC) - #define XMLPUBVAR __declspec(dllimport) extern - #else - #define XMLPUBVAR extern - #endif - #endif - #if defined(LIBXML_FASTCALL) - #define XMLCALL __fastcall - #else - #define XMLCALL __cdecl - #endif - #define XMLCDECL __cdecl - #if !defined _REENTRANT - #define _REENTRANT - #endif -#endif - -/* Windows platform with Borland compiler */ -#if defined(_WIN32) && defined(__BORLANDC__) - #undef XMLPUBFUN - #undef XMLPUBVAR - #undef XMLCALL - #undef XMLCDECL - #if defined(IN_LIBXML) && !defined(LIBXML_STATIC) - #define XMLPUBFUN __declspec(dllexport) - #define XMLPUBVAR __declspec(dllexport) extern - #else - #define XMLPUBFUN - #if !defined(LIBXML_STATIC) - #define XMLPUBVAR __declspec(dllimport) extern - #else - #define XMLPUBVAR extern - #endif - #endif - #define XMLCALL __cdecl - #define XMLCDECL __cdecl - #if !defined _REENTRANT - #define _REENTRANT - #endif -#endif - -/* Windows platform with GNU compiler (Mingw) */ -#if defined(_WIN32) && defined(__MINGW32__) - #undef XMLPUBFUN - #undef XMLPUBVAR - #undef XMLCALL - #undef XMLCDECL - /* - * if defined(IN_LIBXML) this raises problems on mingw with msys - * _imp__xmlFree listed as missing. Try to workaround the problem - * by also making that declaration when compiling client code. - */ - #if defined(IN_LIBXML) && !defined(LIBXML_STATIC) - #define XMLPUBFUN __declspec(dllexport) - #define XMLPUBVAR __declspec(dllexport) extern - #else - #define XMLPUBFUN - #if !defined(LIBXML_STATIC) - #define XMLPUBVAR __declspec(dllimport) extern - #else - #define XMLPUBVAR extern - #endif - #endif - #define XMLCALL __cdecl - #define XMLCDECL __cdecl - #if !defined _REENTRANT - #define _REENTRANT - #endif -#endif - -/* Cygwin platform, GNU compiler */ -#if defined(_WIN32) && defined(__CYGWIN__) - #undef XMLPUBFUN - #undef XMLPUBVAR - #undef XMLCALL - #undef XMLCDECL - #if defined(IN_LIBXML) && !defined(LIBXML_STATIC) - #define XMLPUBFUN __declspec(dllexport) - #define XMLPUBVAR __declspec(dllexport) - #else - #define XMLPUBFUN - #if !defined(LIBXML_STATIC) - #define XMLPUBVAR __declspec(dllimport) extern - #else - #define XMLPUBVAR - #endif - #endif - #define XMLCALL __cdecl - #define XMLCDECL __cdecl -#endif - -/* Compatibility */ -#if !defined(LIBXML_DLL_IMPORT) -#define LIBXML_DLL_IMPORT XMLPUBVAR -#endif - -#endif /* __XML_EXPORTS_H__ */ - - diff --git a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/xmlmemory.h b/cocos2dx/platform/third_party/emscripten/libxml2/libxml/xmlmemory.h deleted file mode 100644 index 17e375a3c9..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/xmlmemory.h +++ /dev/null @@ -1,224 +0,0 @@ -/* - * Summary: interface for the memory allocator - * Description: provides interfaces for the memory allocator, - * including debugging capabilities. - * - * Copy: See Copyright for the status of this software. - * - * Author: Daniel Veillard - */ - - -#ifndef __DEBUG_MEMORY_ALLOC__ -#define __DEBUG_MEMORY_ALLOC__ - -#include -#include - -/** - * DEBUG_MEMORY: - * - * DEBUG_MEMORY replaces the allocator with a collect and debug - * shell to the libc allocator. - * DEBUG_MEMORY should only be activated when debugging - * libxml i.e. if libxml has been configured with --with-debug-mem too. - */ -/* #define DEBUG_MEMORY_FREED */ -/* #define DEBUG_MEMORY_LOCATION */ - -#ifdef DEBUG -#ifndef DEBUG_MEMORY -#define DEBUG_MEMORY -#endif -#endif - -/** - * DEBUG_MEMORY_LOCATION: - * - * DEBUG_MEMORY_LOCATION should be activated only when debugging - * libxml i.e. if libxml has been configured with --with-debug-mem too. - */ -#ifdef DEBUG_MEMORY_LOCATION -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * The XML memory wrapper support 4 basic overloadable functions. - */ -/** - * xmlFreeFunc: - * @mem: an already allocated block of memory - * - * Signature for a free() implementation. - */ -typedef void (XMLCALL *xmlFreeFunc)(void *mem); -/** - * xmlMallocFunc: - * @size: the size requested in bytes - * - * Signature for a malloc() implementation. - * - * Returns a pointer to the newly allocated block or NULL in case of error. - */ -typedef void *(LIBXML_ATTR_ALLOC_SIZE(1) XMLCALL *xmlMallocFunc)(size_t size); - -/** - * xmlReallocFunc: - * @mem: an already allocated block of memory - * @size: the new size requested in bytes - * - * Signature for a realloc() implementation. - * - * Returns a pointer to the newly reallocated block or NULL in case of error. - */ -typedef void *(XMLCALL *xmlReallocFunc)(void *mem, size_t size); - -/** - * xmlStrdupFunc: - * @str: a zero terminated string - * - * Signature for an strdup() implementation. - * - * Returns the copy of the string or NULL in case of error. - */ -typedef char *(XMLCALL *xmlStrdupFunc)(const char *str); - -/* - * The 4 interfaces used for all memory handling within libxml. -LIBXML_DLL_IMPORT xmlFreeFunc xmlFree; -LIBXML_DLL_IMPORT xmlMallocFunc xmlMalloc; -LIBXML_DLL_IMPORT xmlMallocFunc xmlMallocAtomic; -LIBXML_DLL_IMPORT xmlReallocFunc xmlRealloc; -LIBXML_DLL_IMPORT xmlStrdupFunc xmlMemStrdup; - */ - -/* - * The way to overload the existing functions. - * The xmlGc function have an extra entry for atomic block - * allocations useful for garbage collected memory allocators - */ -XMLPUBFUN int XMLCALL - xmlMemSetup (xmlFreeFunc freeFunc, - xmlMallocFunc mallocFunc, - xmlReallocFunc reallocFunc, - xmlStrdupFunc strdupFunc); -XMLPUBFUN int XMLCALL - xmlMemGet (xmlFreeFunc *freeFunc, - xmlMallocFunc *mallocFunc, - xmlReallocFunc *reallocFunc, - xmlStrdupFunc *strdupFunc); -XMLPUBFUN int XMLCALL - xmlGcMemSetup (xmlFreeFunc freeFunc, - xmlMallocFunc mallocFunc, - xmlMallocFunc mallocAtomicFunc, - xmlReallocFunc reallocFunc, - xmlStrdupFunc strdupFunc); -XMLPUBFUN int XMLCALL - xmlGcMemGet (xmlFreeFunc *freeFunc, - xmlMallocFunc *mallocFunc, - xmlMallocFunc *mallocAtomicFunc, - xmlReallocFunc *reallocFunc, - xmlStrdupFunc *strdupFunc); - -/* - * Initialization of the memory layer. - */ -XMLPUBFUN int XMLCALL - xmlInitMemory (void); - -/* - * Cleanup of the memory layer. - */ -XMLPUBFUN void XMLCALL - xmlCleanupMemory (void); -/* - * These are specific to the XML debug memory wrapper. - */ -XMLPUBFUN int XMLCALL - xmlMemUsed (void); -XMLPUBFUN int XMLCALL - xmlMemBlocks (void); -XMLPUBFUN void XMLCALL - xmlMemDisplay (FILE *fp); -XMLPUBFUN void XMLCALL - xmlMemDisplayLast(FILE *fp, long nbBytes); -XMLPUBFUN void XMLCALL - xmlMemShow (FILE *fp, int nr); -XMLPUBFUN void XMLCALL - xmlMemoryDump (void); -XMLPUBFUN void * XMLCALL - xmlMemMalloc (size_t size) LIBXML_ATTR_ALLOC_SIZE(1); -XMLPUBFUN void * XMLCALL - xmlMemRealloc (void *ptr,size_t size); -XMLPUBFUN void XMLCALL - xmlMemFree (void *ptr); -XMLPUBFUN char * XMLCALL - xmlMemoryStrdup (const char *str); -XMLPUBFUN void * XMLCALL - xmlMallocLoc (size_t size, const char *file, int line) LIBXML_ATTR_ALLOC_SIZE(1); -XMLPUBFUN void * XMLCALL - xmlReallocLoc (void *ptr, size_t size, const char *file, int line); -XMLPUBFUN void * XMLCALL - xmlMallocAtomicLoc (size_t size, const char *file, int line) LIBXML_ATTR_ALLOC_SIZE(1); -XMLPUBFUN char * XMLCALL - xmlMemStrdupLoc (const char *str, const char *file, int line); - - -#ifdef DEBUG_MEMORY_LOCATION -/** - * xmlMalloc: - * @size: number of bytes to allocate - * - * Wrapper for the malloc() function used in the XML library. - * - * Returns the pointer to the allocated area or NULL in case of error. - */ -#define xmlMalloc(size) xmlMallocLoc((size), __FILE__, __LINE__) -/** - * xmlMallocAtomic: - * @size: number of bytes to allocate - * - * Wrapper for the malloc() function used in the XML library for allocation - * of block not containing pointers to other areas. - * - * Returns the pointer to the allocated area or NULL in case of error. - */ -#define xmlMallocAtomic(size) xmlMallocAtomicLoc((size), __FILE__, __LINE__) -/** - * xmlRealloc: - * @ptr: pointer to the existing allocated area - * @size: number of bytes to allocate - * - * Wrapper for the realloc() function used in the XML library. - * - * Returns the pointer to the allocated area or NULL in case of error. - */ -#define xmlRealloc(ptr, size) xmlReallocLoc((ptr), (size), __FILE__, __LINE__) -/** - * xmlMemStrdup: - * @str: pointer to the existing string - * - * Wrapper for the strdup() function, xmlStrdup() is usually preferred. - * - * Returns the pointer to the allocated area or NULL in case of error. - */ -#define xmlMemStrdup(str) xmlMemStrdupLoc((str), __FILE__, __LINE__) - -#endif /* DEBUG_MEMORY_LOCATION */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#ifndef __XML_GLOBALS_H -#ifndef __XML_THREADS_H__ -#include -#include -#endif -#endif - -#endif /* __DEBUG_MEMORY_ALLOC__ */ - diff --git a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/xmlmodule.h b/cocos2dx/platform/third_party/emscripten/libxml2/libxml/xmlmodule.h deleted file mode 100644 index 9667820070..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/xmlmodule.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Summary: dynamic module loading - * Description: basic API for dynamic module loading, used by - * libexslt added in 2.6.17 - * - * Copy: See Copyright for the status of this software. - * - * Author: Joel W. Reed - */ - -#ifndef __XML_MODULE_H__ -#define __XML_MODULE_H__ - -#include - -#ifdef LIBXML_MODULES_ENABLED - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * xmlModulePtr: - * - * A handle to a dynamically loaded module - */ -typedef struct _xmlModule xmlModule; -typedef xmlModule *xmlModulePtr; - -/** - * xmlModuleOption: - * - * enumeration of options that can be passed down to xmlModuleOpen() - */ -typedef enum { - XML_MODULE_LAZY = 1, /* lazy binding */ - XML_MODULE_LOCAL= 2 /* local binding */ -} xmlModuleOption; - -XMLPUBFUN xmlModulePtr XMLCALL xmlModuleOpen (const char *filename, - int options); - -XMLPUBFUN int XMLCALL xmlModuleSymbol (xmlModulePtr module, - const char* name, - void **result); - -XMLPUBFUN int XMLCALL xmlModuleClose (xmlModulePtr module); - -XMLPUBFUN int XMLCALL xmlModuleFree (xmlModulePtr module); - -#ifdef __cplusplus -} -#endif - -#endif /* LIBXML_MODULES_ENABLED */ - -#endif /*__XML_MODULE_H__ */ diff --git a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/xmlreader.h b/cocos2dx/platform/third_party/emscripten/libxml2/libxml/xmlreader.h deleted file mode 100644 index 2c99e3a765..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/xmlreader.h +++ /dev/null @@ -1,428 +0,0 @@ -/* - * Summary: the XMLReader implementation - * Description: API of the XML streaming API based on C# interfaces. - * - * Copy: See Copyright for the status of this software. - * - * Author: Daniel Veillard - */ - -#ifndef __XML_XMLREADER_H__ -#define __XML_XMLREADER_H__ - -#include -#include -#include -#ifdef LIBXML_SCHEMAS_ENABLED -#include -#include -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * xmlParserSeverities: - * - * How severe an error callback is when the per-reader error callback API - * is used. - */ -typedef enum { - XML_PARSER_SEVERITY_VALIDITY_WARNING = 1, - XML_PARSER_SEVERITY_VALIDITY_ERROR = 2, - XML_PARSER_SEVERITY_WARNING = 3, - XML_PARSER_SEVERITY_ERROR = 4 -} xmlParserSeverities; - -#ifdef LIBXML_READER_ENABLED - -/** - * xmlTextReaderMode: - * - * Internal state values for the reader. - */ -typedef enum { - XML_TEXTREADER_MODE_INITIAL = 0, - XML_TEXTREADER_MODE_INTERACTIVE = 1, - XML_TEXTREADER_MODE_ERROR = 2, - XML_TEXTREADER_MODE_EOF =3, - XML_TEXTREADER_MODE_CLOSED = 4, - XML_TEXTREADER_MODE_READING = 5 -} xmlTextReaderMode; - -/** - * xmlParserProperties: - * - * Some common options to use with xmlTextReaderSetParserProp, but it - * is better to use xmlParserOption and the xmlReaderNewxxx and - * xmlReaderForxxx APIs now. - */ -typedef enum { - XML_PARSER_LOADDTD = 1, - XML_PARSER_DEFAULTATTRS = 2, - XML_PARSER_VALIDATE = 3, - XML_PARSER_SUBST_ENTITIES = 4 -} xmlParserProperties; - -/** - * xmlReaderTypes: - * - * Predefined constants for the different types of nodes. - */ -typedef enum { - XML_READER_TYPE_NONE = 0, - XML_READER_TYPE_ELEMENT = 1, - XML_READER_TYPE_ATTRIBUTE = 2, - XML_READER_TYPE_TEXT = 3, - XML_READER_TYPE_CDATA = 4, - XML_READER_TYPE_ENTITY_REFERENCE = 5, - XML_READER_TYPE_ENTITY = 6, - XML_READER_TYPE_PROCESSING_INSTRUCTION = 7, - XML_READER_TYPE_COMMENT = 8, - XML_READER_TYPE_DOCUMENT = 9, - XML_READER_TYPE_DOCUMENT_TYPE = 10, - XML_READER_TYPE_DOCUMENT_FRAGMENT = 11, - XML_READER_TYPE_NOTATION = 12, - XML_READER_TYPE_WHITESPACE = 13, - XML_READER_TYPE_SIGNIFICANT_WHITESPACE = 14, - XML_READER_TYPE_END_ELEMENT = 15, - XML_READER_TYPE_END_ENTITY = 16, - XML_READER_TYPE_XML_DECLARATION = 17 -} xmlReaderTypes; - -/** - * xmlTextReader: - * - * Structure for an xmlReader context. - */ -typedef struct _xmlTextReader xmlTextReader; - -/** - * xmlTextReaderPtr: - * - * Pointer to an xmlReader context. - */ -typedef xmlTextReader *xmlTextReaderPtr; - -/* - * Constructors & Destructor - */ -XMLPUBFUN xmlTextReaderPtr XMLCALL - xmlNewTextReader (xmlParserInputBufferPtr input, - const char *URI); -XMLPUBFUN xmlTextReaderPtr XMLCALL - xmlNewTextReaderFilename(const char *URI); - -XMLPUBFUN void XMLCALL - xmlFreeTextReader (xmlTextReaderPtr reader); - -XMLPUBFUN int XMLCALL - xmlTextReaderSetup(xmlTextReaderPtr reader, - xmlParserInputBufferPtr input, const char *URL, - const char *encoding, int options); - -/* - * Iterators - */ -XMLPUBFUN int XMLCALL - xmlTextReaderRead (xmlTextReaderPtr reader); - -#ifdef LIBXML_WRITER_ENABLED -XMLPUBFUN xmlChar * XMLCALL - xmlTextReaderReadInnerXml(xmlTextReaderPtr reader); - -XMLPUBFUN xmlChar * XMLCALL - xmlTextReaderReadOuterXml(xmlTextReaderPtr reader); -#endif - -XMLPUBFUN xmlChar * XMLCALL - xmlTextReaderReadString (xmlTextReaderPtr reader); -XMLPUBFUN int XMLCALL - xmlTextReaderReadAttributeValue(xmlTextReaderPtr reader); - -/* - * Attributes of the node - */ -XMLPUBFUN int XMLCALL - xmlTextReaderAttributeCount(xmlTextReaderPtr reader); -XMLPUBFUN int XMLCALL - xmlTextReaderDepth (xmlTextReaderPtr reader); -XMLPUBFUN int XMLCALL - xmlTextReaderHasAttributes(xmlTextReaderPtr reader); -XMLPUBFUN int XMLCALL - xmlTextReaderHasValue(xmlTextReaderPtr reader); -XMLPUBFUN int XMLCALL - xmlTextReaderIsDefault (xmlTextReaderPtr reader); -XMLPUBFUN int XMLCALL - xmlTextReaderIsEmptyElement(xmlTextReaderPtr reader); -XMLPUBFUN int XMLCALL - xmlTextReaderNodeType (xmlTextReaderPtr reader); -XMLPUBFUN int XMLCALL - xmlTextReaderQuoteChar (xmlTextReaderPtr reader); -XMLPUBFUN int XMLCALL - xmlTextReaderReadState (xmlTextReaderPtr reader); -XMLPUBFUN int XMLCALL - xmlTextReaderIsNamespaceDecl(xmlTextReaderPtr reader); - -XMLPUBFUN const xmlChar * XMLCALL - xmlTextReaderConstBaseUri (xmlTextReaderPtr reader); -XMLPUBFUN const xmlChar * XMLCALL - xmlTextReaderConstLocalName (xmlTextReaderPtr reader); -XMLPUBFUN const xmlChar * XMLCALL - xmlTextReaderConstName (xmlTextReaderPtr reader); -XMLPUBFUN const xmlChar * XMLCALL - xmlTextReaderConstNamespaceUri(xmlTextReaderPtr reader); -XMLPUBFUN const xmlChar * XMLCALL - xmlTextReaderConstPrefix (xmlTextReaderPtr reader); -XMLPUBFUN const xmlChar * XMLCALL - xmlTextReaderConstXmlLang (xmlTextReaderPtr reader); -XMLPUBFUN const xmlChar * XMLCALL - xmlTextReaderConstString (xmlTextReaderPtr reader, - const xmlChar *str); -XMLPUBFUN const xmlChar * XMLCALL - xmlTextReaderConstValue (xmlTextReaderPtr reader); - -/* - * use the Const version of the routine for - * better performance and simpler code - */ -XMLPUBFUN xmlChar * XMLCALL - xmlTextReaderBaseUri (xmlTextReaderPtr reader); -XMLPUBFUN xmlChar * XMLCALL - xmlTextReaderLocalName (xmlTextReaderPtr reader); -XMLPUBFUN xmlChar * XMLCALL - xmlTextReaderName (xmlTextReaderPtr reader); -XMLPUBFUN xmlChar * XMLCALL - xmlTextReaderNamespaceUri(xmlTextReaderPtr reader); -XMLPUBFUN xmlChar * XMLCALL - xmlTextReaderPrefix (xmlTextReaderPtr reader); -XMLPUBFUN xmlChar * XMLCALL - xmlTextReaderXmlLang (xmlTextReaderPtr reader); -XMLPUBFUN xmlChar * XMLCALL - xmlTextReaderValue (xmlTextReaderPtr reader); - -/* - * Methods of the XmlTextReader - */ -XMLPUBFUN int XMLCALL - xmlTextReaderClose (xmlTextReaderPtr reader); -XMLPUBFUN xmlChar * XMLCALL - xmlTextReaderGetAttributeNo (xmlTextReaderPtr reader, - int no); -XMLPUBFUN xmlChar * XMLCALL - xmlTextReaderGetAttribute (xmlTextReaderPtr reader, - const xmlChar *name); -XMLPUBFUN xmlChar * XMLCALL - xmlTextReaderGetAttributeNs (xmlTextReaderPtr reader, - const xmlChar *localName, - const xmlChar *namespaceURI); -XMLPUBFUN xmlParserInputBufferPtr XMLCALL - xmlTextReaderGetRemainder (xmlTextReaderPtr reader); -XMLPUBFUN xmlChar * XMLCALL - xmlTextReaderLookupNamespace(xmlTextReaderPtr reader, - const xmlChar *prefix); -XMLPUBFUN int XMLCALL - xmlTextReaderMoveToAttributeNo(xmlTextReaderPtr reader, - int no); -XMLPUBFUN int XMLCALL - xmlTextReaderMoveToAttribute(xmlTextReaderPtr reader, - const xmlChar *name); -XMLPUBFUN int XMLCALL - xmlTextReaderMoveToAttributeNs(xmlTextReaderPtr reader, - const xmlChar *localName, - const xmlChar *namespaceURI); -XMLPUBFUN int XMLCALL - xmlTextReaderMoveToFirstAttribute(xmlTextReaderPtr reader); -XMLPUBFUN int XMLCALL - xmlTextReaderMoveToNextAttribute(xmlTextReaderPtr reader); -XMLPUBFUN int XMLCALL - xmlTextReaderMoveToElement (xmlTextReaderPtr reader); -XMLPUBFUN int XMLCALL - xmlTextReaderNormalization (xmlTextReaderPtr reader); -XMLPUBFUN const xmlChar * XMLCALL - xmlTextReaderConstEncoding (xmlTextReaderPtr reader); - -/* - * Extensions - */ -XMLPUBFUN int XMLCALL - xmlTextReaderSetParserProp (xmlTextReaderPtr reader, - int prop, - int value); -XMLPUBFUN int XMLCALL - xmlTextReaderGetParserProp (xmlTextReaderPtr reader, - int prop); -XMLPUBFUN xmlNodePtr XMLCALL - xmlTextReaderCurrentNode (xmlTextReaderPtr reader); - -XMLPUBFUN int XMLCALL - xmlTextReaderGetParserLineNumber(xmlTextReaderPtr reader); - -XMLPUBFUN int XMLCALL - xmlTextReaderGetParserColumnNumber(xmlTextReaderPtr reader); - -XMLPUBFUN xmlNodePtr XMLCALL - xmlTextReaderPreserve (xmlTextReaderPtr reader); -#ifdef LIBXML_PATTERN_ENABLED -XMLPUBFUN int XMLCALL - xmlTextReaderPreservePattern(xmlTextReaderPtr reader, - const xmlChar *pattern, - const xmlChar **namespaces); -#endif /* LIBXML_PATTERN_ENABLED */ -XMLPUBFUN xmlDocPtr XMLCALL - xmlTextReaderCurrentDoc (xmlTextReaderPtr reader); -XMLPUBFUN xmlNodePtr XMLCALL - xmlTextReaderExpand (xmlTextReaderPtr reader); -XMLPUBFUN int XMLCALL - xmlTextReaderNext (xmlTextReaderPtr reader); -XMLPUBFUN int XMLCALL - xmlTextReaderNextSibling (xmlTextReaderPtr reader); -XMLPUBFUN int XMLCALL - xmlTextReaderIsValid (xmlTextReaderPtr reader); -#ifdef LIBXML_SCHEMAS_ENABLED -XMLPUBFUN int XMLCALL - xmlTextReaderRelaxNGValidate(xmlTextReaderPtr reader, - const char *rng); -XMLPUBFUN int XMLCALL - xmlTextReaderRelaxNGValidateCtxt(xmlTextReaderPtr reader, - xmlRelaxNGValidCtxtPtr ctxt, - int options); - -XMLPUBFUN int XMLCALL - xmlTextReaderRelaxNGSetSchema(xmlTextReaderPtr reader, - xmlRelaxNGPtr schema); -XMLPUBFUN int XMLCALL - xmlTextReaderSchemaValidate (xmlTextReaderPtr reader, - const char *xsd); -XMLPUBFUN int XMLCALL - xmlTextReaderSchemaValidateCtxt(xmlTextReaderPtr reader, - xmlSchemaValidCtxtPtr ctxt, - int options); -XMLPUBFUN int XMLCALL - xmlTextReaderSetSchema (xmlTextReaderPtr reader, - xmlSchemaPtr schema); -#endif -XMLPUBFUN const xmlChar * XMLCALL - xmlTextReaderConstXmlVersion(xmlTextReaderPtr reader); -XMLPUBFUN int XMLCALL - xmlTextReaderStandalone (xmlTextReaderPtr reader); - - -/* - * Index lookup - */ -XMLPUBFUN long XMLCALL - xmlTextReaderByteConsumed (xmlTextReaderPtr reader); - -/* - * New more complete APIs for simpler creation and reuse of readers - */ -XMLPUBFUN xmlTextReaderPtr XMLCALL - xmlReaderWalker (xmlDocPtr doc); -XMLPUBFUN xmlTextReaderPtr XMLCALL - xmlReaderForDoc (const xmlChar * cur, - const char *URL, - const char *encoding, - int options); -XMLPUBFUN xmlTextReaderPtr XMLCALL - xmlReaderForFile (const char *filename, - const char *encoding, - int options); -XMLPUBFUN xmlTextReaderPtr XMLCALL - xmlReaderForMemory (const char *buffer, - int size, - const char *URL, - const char *encoding, - int options); -XMLPUBFUN xmlTextReaderPtr XMLCALL - xmlReaderForFd (int fd, - const char *URL, - const char *encoding, - int options); -XMLPUBFUN xmlTextReaderPtr XMLCALL - xmlReaderForIO (xmlInputReadCallback ioread, - xmlInputCloseCallback ioclose, - void *ioctx, - const char *URL, - const char *encoding, - int options); - -XMLPUBFUN int XMLCALL - xmlReaderNewWalker (xmlTextReaderPtr reader, - xmlDocPtr doc); -XMLPUBFUN int XMLCALL - xmlReaderNewDoc (xmlTextReaderPtr reader, - const xmlChar * cur, - const char *URL, - const char *encoding, - int options); -XMLPUBFUN int XMLCALL - xmlReaderNewFile (xmlTextReaderPtr reader, - const char *filename, - const char *encoding, - int options); -XMLPUBFUN int XMLCALL - xmlReaderNewMemory (xmlTextReaderPtr reader, - const char *buffer, - int size, - const char *URL, - const char *encoding, - int options); -XMLPUBFUN int XMLCALL - xmlReaderNewFd (xmlTextReaderPtr reader, - int fd, - const char *URL, - const char *encoding, - int options); -XMLPUBFUN int XMLCALL - xmlReaderNewIO (xmlTextReaderPtr reader, - xmlInputReadCallback ioread, - xmlInputCloseCallback ioclose, - void *ioctx, - const char *URL, - const char *encoding, - int options); -/* - * Error handling extensions - */ -typedef void * xmlTextReaderLocatorPtr; - -/** - * xmlTextReaderErrorFunc: - * @arg: the user argument - * @msg: the message - * @severity: the severity of the error - * @locator: a locator indicating where the error occured - * - * Signature of an error callback from a reader parser - */ -typedef void (XMLCALL *xmlTextReaderErrorFunc)(void *arg, - const char *msg, - xmlParserSeverities severity, - xmlTextReaderLocatorPtr locator); -XMLPUBFUN int XMLCALL - xmlTextReaderLocatorLineNumber(xmlTextReaderLocatorPtr locator); -XMLPUBFUN xmlChar * XMLCALL - xmlTextReaderLocatorBaseURI (xmlTextReaderLocatorPtr locator); -XMLPUBFUN void XMLCALL - xmlTextReaderSetErrorHandler(xmlTextReaderPtr reader, - xmlTextReaderErrorFunc f, - void *arg); -XMLPUBFUN void XMLCALL - xmlTextReaderSetStructuredErrorHandler(xmlTextReaderPtr reader, - xmlStructuredErrorFunc f, - void *arg); -XMLPUBFUN void XMLCALL - xmlTextReaderGetErrorHandler(xmlTextReaderPtr reader, - xmlTextReaderErrorFunc *f, - void **arg); - -#endif /* LIBXML_READER_ENABLED */ - -#ifdef __cplusplus -} -#endif - -#endif /* __XML_XMLREADER_H__ */ - diff --git a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/xmlregexp.h b/cocos2dx/platform/third_party/emscripten/libxml2/libxml/xmlregexp.h deleted file mode 100644 index 7009645a92..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/xmlregexp.h +++ /dev/null @@ -1,222 +0,0 @@ -/* - * Summary: regular expressions handling - * Description: basic API for libxml regular expressions handling used - * for XML Schemas and validation. - * - * Copy: See Copyright for the status of this software. - * - * Author: Daniel Veillard - */ - -#ifndef __XML_REGEXP_H__ -#define __XML_REGEXP_H__ - -#include - -#ifdef LIBXML_REGEXP_ENABLED - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * xmlRegexpPtr: - * - * A libxml regular expression, they can actually be far more complex - * thank the POSIX regex expressions. - */ -typedef struct _xmlRegexp xmlRegexp; -typedef xmlRegexp *xmlRegexpPtr; - -/** - * xmlRegExecCtxtPtr: - * - * A libxml progressive regular expression evaluation context - */ -typedef struct _xmlRegExecCtxt xmlRegExecCtxt; -typedef xmlRegExecCtxt *xmlRegExecCtxtPtr; - -#ifdef __cplusplus -} -#endif -#include -#include -#ifdef __cplusplus -extern "C" { -#endif - -/* - * The POSIX like API - */ -XMLPUBFUN xmlRegexpPtr XMLCALL - xmlRegexpCompile (const xmlChar *regexp); -XMLPUBFUN void XMLCALL xmlRegFreeRegexp(xmlRegexpPtr regexp); -XMLPUBFUN int XMLCALL - xmlRegexpExec (xmlRegexpPtr comp, - const xmlChar *value); -XMLPUBFUN void XMLCALL - xmlRegexpPrint (FILE *output, - xmlRegexpPtr regexp); -XMLPUBFUN int XMLCALL - xmlRegexpIsDeterminist(xmlRegexpPtr comp); - -/** - * xmlRegExecCallbacks: - * @exec: the regular expression context - * @token: the current token string - * @transdata: transition data - * @inputdata: input data - * - * Callback function when doing a transition in the automata - */ -typedef void (*xmlRegExecCallbacks) (xmlRegExecCtxtPtr exec, - const xmlChar *token, - void *transdata, - void *inputdata); - -/* - * The progressive API - */ -XMLPUBFUN xmlRegExecCtxtPtr XMLCALL - xmlRegNewExecCtxt (xmlRegexpPtr comp, - xmlRegExecCallbacks callback, - void *data); -XMLPUBFUN void XMLCALL - xmlRegFreeExecCtxt (xmlRegExecCtxtPtr exec); -XMLPUBFUN int XMLCALL - xmlRegExecPushString(xmlRegExecCtxtPtr exec, - const xmlChar *value, - void *data); -XMLPUBFUN int XMLCALL - xmlRegExecPushString2(xmlRegExecCtxtPtr exec, - const xmlChar *value, - const xmlChar *value2, - void *data); - -XMLPUBFUN int XMLCALL - xmlRegExecNextValues(xmlRegExecCtxtPtr exec, - int *nbval, - int *nbneg, - xmlChar **values, - int *terminal); -XMLPUBFUN int XMLCALL - xmlRegExecErrInfo (xmlRegExecCtxtPtr exec, - const xmlChar **string, - int *nbval, - int *nbneg, - xmlChar **values, - int *terminal); -#ifdef LIBXML_EXPR_ENABLED -/* - * Formal regular expression handling - * Its goal is to do some formal work on content models - */ - -/* expressions are used within a context */ -typedef struct _xmlExpCtxt xmlExpCtxt; -typedef xmlExpCtxt *xmlExpCtxtPtr; - -XMLPUBFUN void XMLCALL - xmlExpFreeCtxt (xmlExpCtxtPtr ctxt); -XMLPUBFUN xmlExpCtxtPtr XMLCALL - xmlExpNewCtxt (int maxNodes, - xmlDictPtr dict); - -XMLPUBFUN int XMLCALL - xmlExpCtxtNbNodes(xmlExpCtxtPtr ctxt); -XMLPUBFUN int XMLCALL - xmlExpCtxtNbCons(xmlExpCtxtPtr ctxt); - -/* Expressions are trees but the tree is opaque */ -typedef struct _xmlExpNode xmlExpNode; -typedef xmlExpNode *xmlExpNodePtr; - -typedef enum { - XML_EXP_EMPTY = 0, - XML_EXP_FORBID = 1, - XML_EXP_ATOM = 2, - XML_EXP_SEQ = 3, - XML_EXP_OR = 4, - XML_EXP_COUNT = 5 -} xmlExpNodeType; - -/* - * 2 core expressions shared by all for the empty language set - * and for the set with just the empty token - */ -XMLPUBVAR xmlExpNodePtr forbiddenExp; -XMLPUBVAR xmlExpNodePtr emptyExp; - -/* - * Expressions are reference counted internally - */ -XMLPUBFUN void XMLCALL - xmlExpFree (xmlExpCtxtPtr ctxt, - xmlExpNodePtr expr); -XMLPUBFUN void XMLCALL - xmlExpRef (xmlExpNodePtr expr); - -/* - * constructors can be either manual or from a string - */ -XMLPUBFUN xmlExpNodePtr XMLCALL - xmlExpParse (xmlExpCtxtPtr ctxt, - const char *expr); -XMLPUBFUN xmlExpNodePtr XMLCALL - xmlExpNewAtom (xmlExpCtxtPtr ctxt, - const xmlChar *name, - int len); -XMLPUBFUN xmlExpNodePtr XMLCALL - xmlExpNewOr (xmlExpCtxtPtr ctxt, - xmlExpNodePtr left, - xmlExpNodePtr right); -XMLPUBFUN xmlExpNodePtr XMLCALL - xmlExpNewSeq (xmlExpCtxtPtr ctxt, - xmlExpNodePtr left, - xmlExpNodePtr right); -XMLPUBFUN xmlExpNodePtr XMLCALL - xmlExpNewRange (xmlExpCtxtPtr ctxt, - xmlExpNodePtr subset, - int min, - int max); -/* - * The really interesting APIs - */ -XMLPUBFUN int XMLCALL - xmlExpIsNillable(xmlExpNodePtr expr); -XMLPUBFUN int XMLCALL - xmlExpMaxToken (xmlExpNodePtr expr); -XMLPUBFUN int XMLCALL - xmlExpGetLanguage(xmlExpCtxtPtr ctxt, - xmlExpNodePtr expr, - const xmlChar**langList, - int len); -XMLPUBFUN int XMLCALL - xmlExpGetStart (xmlExpCtxtPtr ctxt, - xmlExpNodePtr expr, - const xmlChar**tokList, - int len); -XMLPUBFUN xmlExpNodePtr XMLCALL - xmlExpStringDerive(xmlExpCtxtPtr ctxt, - xmlExpNodePtr expr, - const xmlChar *str, - int len); -XMLPUBFUN xmlExpNodePtr XMLCALL - xmlExpExpDerive (xmlExpCtxtPtr ctxt, - xmlExpNodePtr expr, - xmlExpNodePtr sub); -XMLPUBFUN int XMLCALL - xmlExpSubsume (xmlExpCtxtPtr ctxt, - xmlExpNodePtr expr, - xmlExpNodePtr sub); -XMLPUBFUN void XMLCALL - xmlExpDump (xmlBufferPtr buf, - xmlExpNodePtr expr); -#endif /* LIBXML_EXPR_ENABLED */ -#ifdef __cplusplus -} -#endif - -#endif /* LIBXML_REGEXP_ENABLED */ - -#endif /*__XML_REGEXP_H__ */ diff --git a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/xmlsave.h b/cocos2dx/platform/third_party/emscripten/libxml2/libxml/xmlsave.h deleted file mode 100644 index fb329b22db..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/xmlsave.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Summary: the XML document serializer - * Description: API to save document or subtree of document - * - * Copy: See Copyright for the status of this software. - * - * Author: Daniel Veillard - */ - -#ifndef __XML_XMLSAVE_H__ -#define __XML_XMLSAVE_H__ - -#include -#include -#include -#include - -#ifdef LIBXML_OUTPUT_ENABLED -#ifdef __cplusplus -extern "C" { -#endif - -/** - * xmlSaveOption: - * - * This is the set of XML save options that can be passed down - * to the xmlSaveToFd() and similar calls. - */ -typedef enum { - XML_SAVE_FORMAT = 1<<0, /* format save output */ - XML_SAVE_NO_DECL = 1<<1, /* drop the xml declaration */ - XML_SAVE_NO_EMPTY = 1<<2, /* no empty tags */ - XML_SAVE_NO_XHTML = 1<<3, /* disable XHTML1 specific rules */ - XML_SAVE_XHTML = 1<<4, /* force XHTML1 specific rules */ - XML_SAVE_AS_XML = 1<<5, /* force XML serialization on HTML doc */ - XML_SAVE_AS_HTML = 1<<6, /* force HTML serialization on XML doc */ - XML_SAVE_WSNONSIG = 1<<7 /* format with non-significant whitespace */ -} xmlSaveOption; - - -typedef struct _xmlSaveCtxt xmlSaveCtxt; -typedef xmlSaveCtxt *xmlSaveCtxtPtr; - -XMLPUBFUN xmlSaveCtxtPtr XMLCALL - xmlSaveToFd (int fd, - const char *encoding, - int options); -XMLPUBFUN xmlSaveCtxtPtr XMLCALL - xmlSaveToFilename (const char *filename, - const char *encoding, - int options); - -XMLPUBFUN xmlSaveCtxtPtr XMLCALL - xmlSaveToBuffer (xmlBufferPtr buffer, - const char *encoding, - int options); - -XMLPUBFUN xmlSaveCtxtPtr XMLCALL - xmlSaveToIO (xmlOutputWriteCallback iowrite, - xmlOutputCloseCallback ioclose, - void *ioctx, - const char *encoding, - int options); - -XMLPUBFUN long XMLCALL - xmlSaveDoc (xmlSaveCtxtPtr ctxt, - xmlDocPtr doc); -XMLPUBFUN long XMLCALL - xmlSaveTree (xmlSaveCtxtPtr ctxt, - xmlNodePtr node); - -XMLPUBFUN int XMLCALL - xmlSaveFlush (xmlSaveCtxtPtr ctxt); -XMLPUBFUN int XMLCALL - xmlSaveClose (xmlSaveCtxtPtr ctxt); -XMLPUBFUN int XMLCALL - xmlSaveSetEscape (xmlSaveCtxtPtr ctxt, - xmlCharEncodingOutputFunc escape); -XMLPUBFUN int XMLCALL - xmlSaveSetAttrEscape (xmlSaveCtxtPtr ctxt, - xmlCharEncodingOutputFunc escape); -#ifdef __cplusplus -} -#endif -#endif /* LIBXML_OUTPUT_ENABLED */ -#endif /* __XML_XMLSAVE_H__ */ - - diff --git a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/xmlschemas.h b/cocos2dx/platform/third_party/emscripten/libxml2/libxml/xmlschemas.h deleted file mode 100644 index 97930c7c3f..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/xmlschemas.h +++ /dev/null @@ -1,246 +0,0 @@ -/* - * Summary: incomplete XML Schemas structure implementation - * Description: interface to the XML Schemas handling and schema validity - * checking, it is incomplete right now. - * - * Copy: See Copyright for the status of this software. - * - * Author: Daniel Veillard - */ - - -#ifndef __XML_SCHEMA_H__ -#define __XML_SCHEMA_H__ - -#include - -#ifdef LIBXML_SCHEMAS_ENABLED - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * This error codes are obsolete; not used any more. - */ -typedef enum { - XML_SCHEMAS_ERR_OK = 0, - XML_SCHEMAS_ERR_NOROOT = 1, - XML_SCHEMAS_ERR_UNDECLAREDELEM, - XML_SCHEMAS_ERR_NOTTOPLEVEL, - XML_SCHEMAS_ERR_MISSING, - XML_SCHEMAS_ERR_WRONGELEM, - XML_SCHEMAS_ERR_NOTYPE, - XML_SCHEMAS_ERR_NOROLLBACK, - XML_SCHEMAS_ERR_ISABSTRACT, - XML_SCHEMAS_ERR_NOTEMPTY, - XML_SCHEMAS_ERR_ELEMCONT, - XML_SCHEMAS_ERR_HAVEDEFAULT, - XML_SCHEMAS_ERR_NOTNILLABLE, - XML_SCHEMAS_ERR_EXTRACONTENT, - XML_SCHEMAS_ERR_INVALIDATTR, - XML_SCHEMAS_ERR_INVALIDELEM, - XML_SCHEMAS_ERR_NOTDETERMINIST, - XML_SCHEMAS_ERR_CONSTRUCT, - XML_SCHEMAS_ERR_INTERNAL, - XML_SCHEMAS_ERR_NOTSIMPLE, - XML_SCHEMAS_ERR_ATTRUNKNOWN, - XML_SCHEMAS_ERR_ATTRINVALID, - XML_SCHEMAS_ERR_VALUE, - XML_SCHEMAS_ERR_FACET, - XML_SCHEMAS_ERR_, - XML_SCHEMAS_ERR_XXX -} xmlSchemaValidError; - -/* -* ATTENTION: Change xmlSchemaSetValidOptions's check -* for invalid values, if adding to the validation -* options below. -*/ -/** - * xmlSchemaValidOption: - * - * This is the set of XML Schema validation options. - */ -typedef enum { - XML_SCHEMA_VAL_VC_I_CREATE = 1<<0 - /* Default/fixed: create an attribute node - * or an element's text node on the instance. - */ -} xmlSchemaValidOption; - -/* - XML_SCHEMA_VAL_XSI_ASSEMBLE = 1<<1, - * assemble schemata using - * xsi:schemaLocation and - * xsi:noNamespaceSchemaLocation -*/ - -/** - * The schemas related types are kept internal - */ -typedef struct _xmlSchema xmlSchema; -typedef xmlSchema *xmlSchemaPtr; - -/** - * xmlSchemaValidityErrorFunc: - * @ctx: the validation context - * @msg: the message - * @...: extra arguments - * - * Signature of an error callback from an XSD validation - */ -typedef void (XMLCDECL *xmlSchemaValidityErrorFunc) - (void *ctx, const char *msg, ...) LIBXML_ATTR_FORMAT(2,3); - -/** - * xmlSchemaValidityWarningFunc: - * @ctx: the validation context - * @msg: the message - * @...: extra arguments - * - * Signature of a warning callback from an XSD validation - */ -typedef void (XMLCDECL *xmlSchemaValidityWarningFunc) - (void *ctx, const char *msg, ...) LIBXML_ATTR_FORMAT(2,3); - -/** - * A schemas validation context - */ -typedef struct _xmlSchemaParserCtxt xmlSchemaParserCtxt; -typedef xmlSchemaParserCtxt *xmlSchemaParserCtxtPtr; - -typedef struct _xmlSchemaValidCtxt xmlSchemaValidCtxt; -typedef xmlSchemaValidCtxt *xmlSchemaValidCtxtPtr; - -/** - * xmlSchemaValidityLocatorFunc: - * @ctx: user provided context - * @file: returned file information - * @line: returned line information - * - * A schemas validation locator, a callback called by the validator. - * This is used when file or node informations are not available - * to find out what file and line number are affected - * - * Returns: 0 in case of success and -1 in case of error - */ - -typedef int (XMLCDECL *xmlSchemaValidityLocatorFunc) (void *ctx, - const char **file, unsigned long *line); - -/* - * Interfaces for parsing. - */ -XMLPUBFUN xmlSchemaParserCtxtPtr XMLCALL - xmlSchemaNewParserCtxt (const char *URL); -XMLPUBFUN xmlSchemaParserCtxtPtr XMLCALL - xmlSchemaNewMemParserCtxt (const char *buffer, - int size); -XMLPUBFUN xmlSchemaParserCtxtPtr XMLCALL - xmlSchemaNewDocParserCtxt (xmlDocPtr doc); -XMLPUBFUN void XMLCALL - xmlSchemaFreeParserCtxt (xmlSchemaParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL - xmlSchemaSetParserErrors (xmlSchemaParserCtxtPtr ctxt, - xmlSchemaValidityErrorFunc err, - xmlSchemaValidityWarningFunc warn, - void *ctx); -XMLPUBFUN void XMLCALL - xmlSchemaSetParserStructuredErrors(xmlSchemaParserCtxtPtr ctxt, - xmlStructuredErrorFunc serror, - void *ctx); -XMLPUBFUN int XMLCALL - xmlSchemaGetParserErrors(xmlSchemaParserCtxtPtr ctxt, - xmlSchemaValidityErrorFunc * err, - xmlSchemaValidityWarningFunc * warn, - void **ctx); -XMLPUBFUN int XMLCALL - xmlSchemaIsValid (xmlSchemaValidCtxtPtr ctxt); - -XMLPUBFUN xmlSchemaPtr XMLCALL - xmlSchemaParse (xmlSchemaParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL - xmlSchemaFree (xmlSchemaPtr schema); -#ifdef LIBXML_OUTPUT_ENABLED -XMLPUBFUN void XMLCALL - xmlSchemaDump (FILE *output, - xmlSchemaPtr schema); -#endif /* LIBXML_OUTPUT_ENABLED */ -/* - * Interfaces for validating - */ -XMLPUBFUN void XMLCALL - xmlSchemaSetValidErrors (xmlSchemaValidCtxtPtr ctxt, - xmlSchemaValidityErrorFunc err, - xmlSchemaValidityWarningFunc warn, - void *ctx); -XMLPUBFUN void XMLCALL - xmlSchemaSetValidStructuredErrors(xmlSchemaValidCtxtPtr ctxt, - xmlStructuredErrorFunc serror, - void *ctx); -XMLPUBFUN int XMLCALL - xmlSchemaGetValidErrors (xmlSchemaValidCtxtPtr ctxt, - xmlSchemaValidityErrorFunc *err, - xmlSchemaValidityWarningFunc *warn, - void **ctx); -XMLPUBFUN int XMLCALL - xmlSchemaSetValidOptions (xmlSchemaValidCtxtPtr ctxt, - int options); -XMLPUBFUN void XMLCALL - xmlSchemaValidateSetFilename(xmlSchemaValidCtxtPtr vctxt, - const char *filename); -XMLPUBFUN int XMLCALL - xmlSchemaValidCtxtGetOptions(xmlSchemaValidCtxtPtr ctxt); - -XMLPUBFUN xmlSchemaValidCtxtPtr XMLCALL - xmlSchemaNewValidCtxt (xmlSchemaPtr schema); -XMLPUBFUN void XMLCALL - xmlSchemaFreeValidCtxt (xmlSchemaValidCtxtPtr ctxt); -XMLPUBFUN int XMLCALL - xmlSchemaValidateDoc (xmlSchemaValidCtxtPtr ctxt, - xmlDocPtr instance); -XMLPUBFUN int XMLCALL - xmlSchemaValidateOneElement (xmlSchemaValidCtxtPtr ctxt, - xmlNodePtr elem); -XMLPUBFUN int XMLCALL - xmlSchemaValidateStream (xmlSchemaValidCtxtPtr ctxt, - xmlParserInputBufferPtr input, - xmlCharEncoding enc, - xmlSAXHandlerPtr sax, - void *user_data); -XMLPUBFUN int XMLCALL - xmlSchemaValidateFile (xmlSchemaValidCtxtPtr ctxt, - const char * filename, - int options); - -XMLPUBFUN xmlParserCtxtPtr XMLCALL - xmlSchemaValidCtxtGetParserCtxt(xmlSchemaValidCtxtPtr ctxt); - -/* - * Interface to insert Schemas SAX validation in a SAX stream - */ -typedef struct _xmlSchemaSAXPlug xmlSchemaSAXPlugStruct; -typedef xmlSchemaSAXPlugStruct *xmlSchemaSAXPlugPtr; - -XMLPUBFUN xmlSchemaSAXPlugPtr XMLCALL - xmlSchemaSAXPlug (xmlSchemaValidCtxtPtr ctxt, - xmlSAXHandlerPtr *sax, - void **user_data); -XMLPUBFUN int XMLCALL - xmlSchemaSAXUnplug (xmlSchemaSAXPlugPtr plug); - - -XMLPUBFUN void XMLCALL - xmlSchemaValidateSetLocator (xmlSchemaValidCtxtPtr vctxt, - xmlSchemaValidityLocatorFunc f, - void *ctxt); - -#ifdef __cplusplus -} -#endif - -#endif /* LIBXML_SCHEMAS_ENABLED */ -#endif /* __XML_SCHEMA_H__ */ diff --git a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/xmlschemastypes.h b/cocos2dx/platform/third_party/emscripten/libxml2/libxml/xmlschemastypes.h deleted file mode 100644 index 35d48d414b..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/xmlschemastypes.h +++ /dev/null @@ -1,151 +0,0 @@ -/* - * Summary: implementation of XML Schema Datatypes - * Description: module providing the XML Schema Datatypes implementation - * both definition and validity checking - * - * Copy: See Copyright for the status of this software. - * - * Author: Daniel Veillard - */ - - -#ifndef __XML_SCHEMA_TYPES_H__ -#define __XML_SCHEMA_TYPES_H__ - -#include - -#ifdef LIBXML_SCHEMAS_ENABLED - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef enum { - XML_SCHEMA_WHITESPACE_UNKNOWN = 0, - XML_SCHEMA_WHITESPACE_PRESERVE = 1, - XML_SCHEMA_WHITESPACE_REPLACE = 2, - XML_SCHEMA_WHITESPACE_COLLAPSE = 3 -} xmlSchemaWhitespaceValueType; - -XMLPUBFUN void XMLCALL - xmlSchemaInitTypes (void); -XMLPUBFUN void XMLCALL - xmlSchemaCleanupTypes (void); -XMLPUBFUN xmlSchemaTypePtr XMLCALL - xmlSchemaGetPredefinedType (const xmlChar *name, - const xmlChar *ns); -XMLPUBFUN int XMLCALL - xmlSchemaValidatePredefinedType (xmlSchemaTypePtr type, - const xmlChar *value, - xmlSchemaValPtr *val); -XMLPUBFUN int XMLCALL - xmlSchemaValPredefTypeNode (xmlSchemaTypePtr type, - const xmlChar *value, - xmlSchemaValPtr *val, - xmlNodePtr node); -XMLPUBFUN int XMLCALL - xmlSchemaValidateFacet (xmlSchemaTypePtr base, - xmlSchemaFacetPtr facet, - const xmlChar *value, - xmlSchemaValPtr val); -XMLPUBFUN int XMLCALL - xmlSchemaValidateFacetWhtsp (xmlSchemaFacetPtr facet, - xmlSchemaWhitespaceValueType fws, - xmlSchemaValType valType, - const xmlChar *value, - xmlSchemaValPtr val, - xmlSchemaWhitespaceValueType ws); -XMLPUBFUN void XMLCALL - xmlSchemaFreeValue (xmlSchemaValPtr val); -XMLPUBFUN xmlSchemaFacetPtr XMLCALL - xmlSchemaNewFacet (void); -XMLPUBFUN int XMLCALL - xmlSchemaCheckFacet (xmlSchemaFacetPtr facet, - xmlSchemaTypePtr typeDecl, - xmlSchemaParserCtxtPtr ctxt, - const xmlChar *name); -XMLPUBFUN void XMLCALL - xmlSchemaFreeFacet (xmlSchemaFacetPtr facet); -XMLPUBFUN int XMLCALL - xmlSchemaCompareValues (xmlSchemaValPtr x, - xmlSchemaValPtr y); -XMLPUBFUN xmlSchemaTypePtr XMLCALL - xmlSchemaGetBuiltInListSimpleTypeItemType (xmlSchemaTypePtr type); -XMLPUBFUN int XMLCALL - xmlSchemaValidateListSimpleTypeFacet (xmlSchemaFacetPtr facet, - const xmlChar *value, - unsigned long actualLen, - unsigned long *expectedLen); -XMLPUBFUN xmlSchemaTypePtr XMLCALL - xmlSchemaGetBuiltInType (xmlSchemaValType type); -XMLPUBFUN int XMLCALL - xmlSchemaIsBuiltInTypeFacet (xmlSchemaTypePtr type, - int facetType); -XMLPUBFUN xmlChar * XMLCALL - xmlSchemaCollapseString (const xmlChar *value); -XMLPUBFUN xmlChar * XMLCALL - xmlSchemaWhiteSpaceReplace (const xmlChar *value); -XMLPUBFUN unsigned long XMLCALL - xmlSchemaGetFacetValueAsULong (xmlSchemaFacetPtr facet); -XMLPUBFUN int XMLCALL - xmlSchemaValidateLengthFacet (xmlSchemaTypePtr type, - xmlSchemaFacetPtr facet, - const xmlChar *value, - xmlSchemaValPtr val, - unsigned long *length); -XMLPUBFUN int XMLCALL - xmlSchemaValidateLengthFacetWhtsp(xmlSchemaFacetPtr facet, - xmlSchemaValType valType, - const xmlChar *value, - xmlSchemaValPtr val, - unsigned long *length, - xmlSchemaWhitespaceValueType ws); -XMLPUBFUN int XMLCALL - xmlSchemaValPredefTypeNodeNoNorm(xmlSchemaTypePtr type, - const xmlChar *value, - xmlSchemaValPtr *val, - xmlNodePtr node); -XMLPUBFUN int XMLCALL - xmlSchemaGetCanonValue (xmlSchemaValPtr val, - const xmlChar **retValue); -XMLPUBFUN int XMLCALL - xmlSchemaGetCanonValueWhtsp (xmlSchemaValPtr val, - const xmlChar **retValue, - xmlSchemaWhitespaceValueType ws); -XMLPUBFUN int XMLCALL - xmlSchemaValueAppend (xmlSchemaValPtr prev, - xmlSchemaValPtr cur); -XMLPUBFUN xmlSchemaValPtr XMLCALL - xmlSchemaValueGetNext (xmlSchemaValPtr cur); -XMLPUBFUN const xmlChar * XMLCALL - xmlSchemaValueGetAsString (xmlSchemaValPtr val); -XMLPUBFUN int XMLCALL - xmlSchemaValueGetAsBoolean (xmlSchemaValPtr val); -XMLPUBFUN xmlSchemaValPtr XMLCALL - xmlSchemaNewStringValue (xmlSchemaValType type, - const xmlChar *value); -XMLPUBFUN xmlSchemaValPtr XMLCALL - xmlSchemaNewNOTATIONValue (const xmlChar *name, - const xmlChar *ns); -XMLPUBFUN xmlSchemaValPtr XMLCALL - xmlSchemaNewQNameValue (const xmlChar *namespaceName, - const xmlChar *localName); -XMLPUBFUN int XMLCALL - xmlSchemaCompareValuesWhtsp (xmlSchemaValPtr x, - xmlSchemaWhitespaceValueType xws, - xmlSchemaValPtr y, - xmlSchemaWhitespaceValueType yws); -XMLPUBFUN xmlSchemaValPtr XMLCALL - xmlSchemaCopyValue (xmlSchemaValPtr val); -XMLPUBFUN xmlSchemaValType XMLCALL - xmlSchemaGetValType (xmlSchemaValPtr val); - -#ifdef __cplusplus -} -#endif - -#endif /* LIBXML_SCHEMAS_ENABLED */ -#endif /* __XML_SCHEMA_TYPES_H__ */ diff --git a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/xmlstring.h b/cocos2dx/platform/third_party/emscripten/libxml2/libxml/xmlstring.h deleted file mode 100644 index 2036236582..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/xmlstring.h +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Summary: set of routines to process strings - * Description: type and interfaces needed for the internal string handling - * of the library, especially UTF8 processing. - * - * Copy: See Copyright for the status of this software. - * - * Author: Daniel Veillard - */ - -#ifndef __XML_STRING_H__ -#define __XML_STRING_H__ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * xmlChar: - * - * This is a basic byte in an UTF-8 encoded string. - * It's unsigned allowing to pinpoint case where char * are assigned - * to xmlChar * (possibly making serialization back impossible). - */ -typedef unsigned char xmlChar; - -/** - * BAD_CAST: - * - * Macro to cast a string to an xmlChar * when one know its safe. - */ -#define BAD_CAST (xmlChar *) - -/* - * xmlChar handling - */ -XMLPUBFUN xmlChar * XMLCALL - xmlStrdup (const xmlChar *cur); -XMLPUBFUN xmlChar * XMLCALL - xmlStrndup (const xmlChar *cur, - int len); -XMLPUBFUN xmlChar * XMLCALL - xmlCharStrndup (const char *cur, - int len); -XMLPUBFUN xmlChar * XMLCALL - xmlCharStrdup (const char *cur); -XMLPUBFUN xmlChar * XMLCALL - xmlStrsub (const xmlChar *str, - int start, - int len); -XMLPUBFUN const xmlChar * XMLCALL - xmlStrchr (const xmlChar *str, - xmlChar val); -XMLPUBFUN const xmlChar * XMLCALL - xmlStrstr (const xmlChar *str, - const xmlChar *val); -XMLPUBFUN const xmlChar * XMLCALL - xmlStrcasestr (const xmlChar *str, - const xmlChar *val); -XMLPUBFUN int XMLCALL - xmlStrcmp (const xmlChar *str1, - const xmlChar *str2); -XMLPUBFUN int XMLCALL - xmlStrncmp (const xmlChar *str1, - const xmlChar *str2, - int len); -XMLPUBFUN int XMLCALL - xmlStrcasecmp (const xmlChar *str1, - const xmlChar *str2); -XMLPUBFUN int XMLCALL - xmlStrncasecmp (const xmlChar *str1, - const xmlChar *str2, - int len); -XMLPUBFUN int XMLCALL - xmlStrEqual (const xmlChar *str1, - const xmlChar *str2); -XMLPUBFUN int XMLCALL - xmlStrQEqual (const xmlChar *pref, - const xmlChar *name, - const xmlChar *str); -XMLPUBFUN int XMLCALL - xmlStrlen (const xmlChar *str); -XMLPUBFUN xmlChar * XMLCALL - xmlStrcat (xmlChar *cur, - const xmlChar *add); -XMLPUBFUN xmlChar * XMLCALL - xmlStrncat (xmlChar *cur, - const xmlChar *add, - int len); -XMLPUBFUN xmlChar * XMLCALL - xmlStrncatNew (const xmlChar *str1, - const xmlChar *str2, - int len); -XMLPUBFUN int XMLCALL - xmlStrPrintf (xmlChar *buf, - int len, - const xmlChar *msg, - ...); -XMLPUBFUN int XMLCALL - xmlStrVPrintf (xmlChar *buf, - int len, - const xmlChar *msg, - va_list ap); - -XMLPUBFUN int XMLCALL - xmlGetUTF8Char (const unsigned char *utf, - int *len); -XMLPUBFUN int XMLCALL - xmlCheckUTF8 (const unsigned char *utf); -XMLPUBFUN int XMLCALL - xmlUTF8Strsize (const xmlChar *utf, - int len); -XMLPUBFUN xmlChar * XMLCALL - xmlUTF8Strndup (const xmlChar *utf, - int len); -XMLPUBFUN const xmlChar * XMLCALL - xmlUTF8Strpos (const xmlChar *utf, - int pos); -XMLPUBFUN int XMLCALL - xmlUTF8Strloc (const xmlChar *utf, - const xmlChar *utfchar); -XMLPUBFUN xmlChar * XMLCALL - xmlUTF8Strsub (const xmlChar *utf, - int start, - int len); -XMLPUBFUN int XMLCALL - xmlUTF8Strlen (const xmlChar *utf); -XMLPUBFUN int XMLCALL - xmlUTF8Size (const xmlChar *utf); -XMLPUBFUN int XMLCALL - xmlUTF8Charcmp (const xmlChar *utf1, - const xmlChar *utf2); - -#ifdef __cplusplus -} -#endif -#endif /* __XML_STRING_H__ */ diff --git a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/xmlunicode.h b/cocos2dx/platform/third_party/emscripten/libxml2/libxml/xmlunicode.h deleted file mode 100644 index 01ac8b61f5..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/xmlunicode.h +++ /dev/null @@ -1,202 +0,0 @@ -/* - * Summary: Unicode character APIs - * Description: API for the Unicode character APIs - * - * This file is automatically generated from the - * UCS description files of the Unicode Character Database - * http://www.unicode.org/Public/4.0-Update1/UCD-4.0.1.html - * using the genUnicode.py Python script. - * - * Generation date: Mon Mar 27 11:09:52 2006 - * Sources: Blocks-4.0.1.txt UnicodeData-4.0.1.txt - * Author: Daniel Veillard - */ - -#ifndef __XML_UNICODE_H__ -#define __XML_UNICODE_H__ - -#include - -#ifdef LIBXML_UNICODE_ENABLED - -#ifdef __cplusplus -extern "C" { -#endif - -XMLPUBFUN int XMLCALL xmlUCSIsAegeanNumbers (int code); -XMLPUBFUN int XMLCALL xmlUCSIsAlphabeticPresentationForms (int code); -XMLPUBFUN int XMLCALL xmlUCSIsArabic (int code); -XMLPUBFUN int XMLCALL xmlUCSIsArabicPresentationFormsA (int code); -XMLPUBFUN int XMLCALL xmlUCSIsArabicPresentationFormsB (int code); -XMLPUBFUN int XMLCALL xmlUCSIsArmenian (int code); -XMLPUBFUN int XMLCALL xmlUCSIsArrows (int code); -XMLPUBFUN int XMLCALL xmlUCSIsBasicLatin (int code); -XMLPUBFUN int XMLCALL xmlUCSIsBengali (int code); -XMLPUBFUN int XMLCALL xmlUCSIsBlockElements (int code); -XMLPUBFUN int XMLCALL xmlUCSIsBopomofo (int code); -XMLPUBFUN int XMLCALL xmlUCSIsBopomofoExtended (int code); -XMLPUBFUN int XMLCALL xmlUCSIsBoxDrawing (int code); -XMLPUBFUN int XMLCALL xmlUCSIsBraillePatterns (int code); -XMLPUBFUN int XMLCALL xmlUCSIsBuhid (int code); -XMLPUBFUN int XMLCALL xmlUCSIsByzantineMusicalSymbols (int code); -XMLPUBFUN int XMLCALL xmlUCSIsCJKCompatibility (int code); -XMLPUBFUN int XMLCALL xmlUCSIsCJKCompatibilityForms (int code); -XMLPUBFUN int XMLCALL xmlUCSIsCJKCompatibilityIdeographs (int code); -XMLPUBFUN int XMLCALL xmlUCSIsCJKCompatibilityIdeographsSupplement (int code); -XMLPUBFUN int XMLCALL xmlUCSIsCJKRadicalsSupplement (int code); -XMLPUBFUN int XMLCALL xmlUCSIsCJKSymbolsandPunctuation (int code); -XMLPUBFUN int XMLCALL xmlUCSIsCJKUnifiedIdeographs (int code); -XMLPUBFUN int XMLCALL xmlUCSIsCJKUnifiedIdeographsExtensionA (int code); -XMLPUBFUN int XMLCALL xmlUCSIsCJKUnifiedIdeographsExtensionB (int code); -XMLPUBFUN int XMLCALL xmlUCSIsCherokee (int code); -XMLPUBFUN int XMLCALL xmlUCSIsCombiningDiacriticalMarks (int code); -XMLPUBFUN int XMLCALL xmlUCSIsCombiningDiacriticalMarksforSymbols (int code); -XMLPUBFUN int XMLCALL xmlUCSIsCombiningHalfMarks (int code); -XMLPUBFUN int XMLCALL xmlUCSIsCombiningMarksforSymbols (int code); -XMLPUBFUN int XMLCALL xmlUCSIsControlPictures (int code); -XMLPUBFUN int XMLCALL xmlUCSIsCurrencySymbols (int code); -XMLPUBFUN int XMLCALL xmlUCSIsCypriotSyllabary (int code); -XMLPUBFUN int XMLCALL xmlUCSIsCyrillic (int code); -XMLPUBFUN int XMLCALL xmlUCSIsCyrillicSupplement (int code); -XMLPUBFUN int XMLCALL xmlUCSIsDeseret (int code); -XMLPUBFUN int XMLCALL xmlUCSIsDevanagari (int code); -XMLPUBFUN int XMLCALL xmlUCSIsDingbats (int code); -XMLPUBFUN int XMLCALL xmlUCSIsEnclosedAlphanumerics (int code); -XMLPUBFUN int XMLCALL xmlUCSIsEnclosedCJKLettersandMonths (int code); -XMLPUBFUN int XMLCALL xmlUCSIsEthiopic (int code); -XMLPUBFUN int XMLCALL xmlUCSIsGeneralPunctuation (int code); -XMLPUBFUN int XMLCALL xmlUCSIsGeometricShapes (int code); -XMLPUBFUN int XMLCALL xmlUCSIsGeorgian (int code); -XMLPUBFUN int XMLCALL xmlUCSIsGothic (int code); -XMLPUBFUN int XMLCALL xmlUCSIsGreek (int code); -XMLPUBFUN int XMLCALL xmlUCSIsGreekExtended (int code); -XMLPUBFUN int XMLCALL xmlUCSIsGreekandCoptic (int code); -XMLPUBFUN int XMLCALL xmlUCSIsGujarati (int code); -XMLPUBFUN int XMLCALL xmlUCSIsGurmukhi (int code); -XMLPUBFUN int XMLCALL xmlUCSIsHalfwidthandFullwidthForms (int code); -XMLPUBFUN int XMLCALL xmlUCSIsHangulCompatibilityJamo (int code); -XMLPUBFUN int XMLCALL xmlUCSIsHangulJamo (int code); -XMLPUBFUN int XMLCALL xmlUCSIsHangulSyllables (int code); -XMLPUBFUN int XMLCALL xmlUCSIsHanunoo (int code); -XMLPUBFUN int XMLCALL xmlUCSIsHebrew (int code); -XMLPUBFUN int XMLCALL xmlUCSIsHighPrivateUseSurrogates (int code); -XMLPUBFUN int XMLCALL xmlUCSIsHighSurrogates (int code); -XMLPUBFUN int XMLCALL xmlUCSIsHiragana (int code); -XMLPUBFUN int XMLCALL xmlUCSIsIPAExtensions (int code); -XMLPUBFUN int XMLCALL xmlUCSIsIdeographicDescriptionCharacters (int code); -XMLPUBFUN int XMLCALL xmlUCSIsKanbun (int code); -XMLPUBFUN int XMLCALL xmlUCSIsKangxiRadicals (int code); -XMLPUBFUN int XMLCALL xmlUCSIsKannada (int code); -XMLPUBFUN int XMLCALL xmlUCSIsKatakana (int code); -XMLPUBFUN int XMLCALL xmlUCSIsKatakanaPhoneticExtensions (int code); -XMLPUBFUN int XMLCALL xmlUCSIsKhmer (int code); -XMLPUBFUN int XMLCALL xmlUCSIsKhmerSymbols (int code); -XMLPUBFUN int XMLCALL xmlUCSIsLao (int code); -XMLPUBFUN int XMLCALL xmlUCSIsLatin1Supplement (int code); -XMLPUBFUN int XMLCALL xmlUCSIsLatinExtendedA (int code); -XMLPUBFUN int XMLCALL xmlUCSIsLatinExtendedB (int code); -XMLPUBFUN int XMLCALL xmlUCSIsLatinExtendedAdditional (int code); -XMLPUBFUN int XMLCALL xmlUCSIsLetterlikeSymbols (int code); -XMLPUBFUN int XMLCALL xmlUCSIsLimbu (int code); -XMLPUBFUN int XMLCALL xmlUCSIsLinearBIdeograms (int code); -XMLPUBFUN int XMLCALL xmlUCSIsLinearBSyllabary (int code); -XMLPUBFUN int XMLCALL xmlUCSIsLowSurrogates (int code); -XMLPUBFUN int XMLCALL xmlUCSIsMalayalam (int code); -XMLPUBFUN int XMLCALL xmlUCSIsMathematicalAlphanumericSymbols (int code); -XMLPUBFUN int XMLCALL xmlUCSIsMathematicalOperators (int code); -XMLPUBFUN int XMLCALL xmlUCSIsMiscellaneousMathematicalSymbolsA (int code); -XMLPUBFUN int XMLCALL xmlUCSIsMiscellaneousMathematicalSymbolsB (int code); -XMLPUBFUN int XMLCALL xmlUCSIsMiscellaneousSymbols (int code); -XMLPUBFUN int XMLCALL xmlUCSIsMiscellaneousSymbolsandArrows (int code); -XMLPUBFUN int XMLCALL xmlUCSIsMiscellaneousTechnical (int code); -XMLPUBFUN int XMLCALL xmlUCSIsMongolian (int code); -XMLPUBFUN int XMLCALL xmlUCSIsMusicalSymbols (int code); -XMLPUBFUN int XMLCALL xmlUCSIsMyanmar (int code); -XMLPUBFUN int XMLCALL xmlUCSIsNumberForms (int code); -XMLPUBFUN int XMLCALL xmlUCSIsOgham (int code); -XMLPUBFUN int XMLCALL xmlUCSIsOldItalic (int code); -XMLPUBFUN int XMLCALL xmlUCSIsOpticalCharacterRecognition (int code); -XMLPUBFUN int XMLCALL xmlUCSIsOriya (int code); -XMLPUBFUN int XMLCALL xmlUCSIsOsmanya (int code); -XMLPUBFUN int XMLCALL xmlUCSIsPhoneticExtensions (int code); -XMLPUBFUN int XMLCALL xmlUCSIsPrivateUse (int code); -XMLPUBFUN int XMLCALL xmlUCSIsPrivateUseArea (int code); -XMLPUBFUN int XMLCALL xmlUCSIsRunic (int code); -XMLPUBFUN int XMLCALL xmlUCSIsShavian (int code); -XMLPUBFUN int XMLCALL xmlUCSIsSinhala (int code); -XMLPUBFUN int XMLCALL xmlUCSIsSmallFormVariants (int code); -XMLPUBFUN int XMLCALL xmlUCSIsSpacingModifierLetters (int code); -XMLPUBFUN int XMLCALL xmlUCSIsSpecials (int code); -XMLPUBFUN int XMLCALL xmlUCSIsSuperscriptsandSubscripts (int code); -XMLPUBFUN int XMLCALL xmlUCSIsSupplementalArrowsA (int code); -XMLPUBFUN int XMLCALL xmlUCSIsSupplementalArrowsB (int code); -XMLPUBFUN int XMLCALL xmlUCSIsSupplementalMathematicalOperators (int code); -XMLPUBFUN int XMLCALL xmlUCSIsSupplementaryPrivateUseAreaA (int code); -XMLPUBFUN int XMLCALL xmlUCSIsSupplementaryPrivateUseAreaB (int code); -XMLPUBFUN int XMLCALL xmlUCSIsSyriac (int code); -XMLPUBFUN int XMLCALL xmlUCSIsTagalog (int code); -XMLPUBFUN int XMLCALL xmlUCSIsTagbanwa (int code); -XMLPUBFUN int XMLCALL xmlUCSIsTags (int code); -XMLPUBFUN int XMLCALL xmlUCSIsTaiLe (int code); -XMLPUBFUN int XMLCALL xmlUCSIsTaiXuanJingSymbols (int code); -XMLPUBFUN int XMLCALL xmlUCSIsTamil (int code); -XMLPUBFUN int XMLCALL xmlUCSIsTelugu (int code); -XMLPUBFUN int XMLCALL xmlUCSIsThaana (int code); -XMLPUBFUN int XMLCALL xmlUCSIsThai (int code); -XMLPUBFUN int XMLCALL xmlUCSIsTibetan (int code); -XMLPUBFUN int XMLCALL xmlUCSIsUgaritic (int code); -XMLPUBFUN int XMLCALL xmlUCSIsUnifiedCanadianAboriginalSyllabics (int code); -XMLPUBFUN int XMLCALL xmlUCSIsVariationSelectors (int code); -XMLPUBFUN int XMLCALL xmlUCSIsVariationSelectorsSupplement (int code); -XMLPUBFUN int XMLCALL xmlUCSIsYiRadicals (int code); -XMLPUBFUN int XMLCALL xmlUCSIsYiSyllables (int code); -XMLPUBFUN int XMLCALL xmlUCSIsYijingHexagramSymbols (int code); - -XMLPUBFUN int XMLCALL xmlUCSIsBlock (int code, const char *block); - -XMLPUBFUN int XMLCALL xmlUCSIsCatC (int code); -XMLPUBFUN int XMLCALL xmlUCSIsCatCc (int code); -XMLPUBFUN int XMLCALL xmlUCSIsCatCf (int code); -XMLPUBFUN int XMLCALL xmlUCSIsCatCo (int code); -XMLPUBFUN int XMLCALL xmlUCSIsCatCs (int code); -XMLPUBFUN int XMLCALL xmlUCSIsCatL (int code); -XMLPUBFUN int XMLCALL xmlUCSIsCatLl (int code); -XMLPUBFUN int XMLCALL xmlUCSIsCatLm (int code); -XMLPUBFUN int XMLCALL xmlUCSIsCatLo (int code); -XMLPUBFUN int XMLCALL xmlUCSIsCatLt (int code); -XMLPUBFUN int XMLCALL xmlUCSIsCatLu (int code); -XMLPUBFUN int XMLCALL xmlUCSIsCatM (int code); -XMLPUBFUN int XMLCALL xmlUCSIsCatMc (int code); -XMLPUBFUN int XMLCALL xmlUCSIsCatMe (int code); -XMLPUBFUN int XMLCALL xmlUCSIsCatMn (int code); -XMLPUBFUN int XMLCALL xmlUCSIsCatN (int code); -XMLPUBFUN int XMLCALL xmlUCSIsCatNd (int code); -XMLPUBFUN int XMLCALL xmlUCSIsCatNl (int code); -XMLPUBFUN int XMLCALL xmlUCSIsCatNo (int code); -XMLPUBFUN int XMLCALL xmlUCSIsCatP (int code); -XMLPUBFUN int XMLCALL xmlUCSIsCatPc (int code); -XMLPUBFUN int XMLCALL xmlUCSIsCatPd (int code); -XMLPUBFUN int XMLCALL xmlUCSIsCatPe (int code); -XMLPUBFUN int XMLCALL xmlUCSIsCatPf (int code); -XMLPUBFUN int XMLCALL xmlUCSIsCatPi (int code); -XMLPUBFUN int XMLCALL xmlUCSIsCatPo (int code); -XMLPUBFUN int XMLCALL xmlUCSIsCatPs (int code); -XMLPUBFUN int XMLCALL xmlUCSIsCatS (int code); -XMLPUBFUN int XMLCALL xmlUCSIsCatSc (int code); -XMLPUBFUN int XMLCALL xmlUCSIsCatSk (int code); -XMLPUBFUN int XMLCALL xmlUCSIsCatSm (int code); -XMLPUBFUN int XMLCALL xmlUCSIsCatSo (int code); -XMLPUBFUN int XMLCALL xmlUCSIsCatZ (int code); -XMLPUBFUN int XMLCALL xmlUCSIsCatZl (int code); -XMLPUBFUN int XMLCALL xmlUCSIsCatZp (int code); -XMLPUBFUN int XMLCALL xmlUCSIsCatZs (int code); - -XMLPUBFUN int XMLCALL xmlUCSIsCat (int code, const char *cat); - -#ifdef __cplusplus -} -#endif - -#endif /* LIBXML_UNICODE_ENABLED */ - -#endif /* __XML_UNICODE_H__ */ diff --git a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/xmlversion.h b/cocos2dx/platform/third_party/emscripten/libxml2/libxml/xmlversion.h deleted file mode 100644 index 1128218a06..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/xmlversion.h +++ /dev/null @@ -1,489 +0,0 @@ -/* - * Summary: compile-time version informations - * Description: compile-time version informations for the XML library - * - * Copy: See Copyright for the status of this software. - * - * Author: Daniel Veillard - */ - -#ifndef __XML_VERSION_H__ -#define __XML_VERSION_H__ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * use those to be sure nothing nasty will happen if - * your library and includes mismatch - */ -#ifndef LIBXML2_COMPILING_MSCCDEF -XMLPUBFUN void XMLCALL xmlCheckVersion(int version); -#endif /* LIBXML2_COMPILING_MSCCDEF */ - -/** - * LIBXML_DOTTED_VERSION: - * - * the version string like "1.2.3" - */ -#define LIBXML_DOTTED_VERSION "2.9.1" - -/** - * LIBXML_VERSION: - * - * the version number: 1.2.3 value is 10203 - */ -#define LIBXML_VERSION 20901 - -/** - * LIBXML_VERSION_STRING: - * - * the version number string, 1.2.3 value is "10203" - */ -#define LIBXML_VERSION_STRING "20901" - -/** - * LIBXML_VERSION_EXTRA: - * - * extra version information, used to show a CVS compilation - */ -#define LIBXML_VERSION_EXTRA "" - -/** - * LIBXML_TEST_VERSION: - * - * Macro to check that the libxml version in use is compatible with - * the version the software has been compiled against - */ -#define LIBXML_TEST_VERSION xmlCheckVersion(20901); - -#ifndef VMS -#if 0 -/** - * WITH_TRIO: - * - * defined if the trio support need to be configured in - */ -#define WITH_TRIO -#else -/** - * WITHOUT_TRIO: - * - * defined if the trio support should not be configured in - */ -#define WITHOUT_TRIO -#endif -#else /* VMS */ -/** - * WITH_TRIO: - * - * defined if the trio support need to be configured in - */ -#define WITH_TRIO 1 -#endif /* VMS */ - -/** - * LIBXML_THREAD_ENABLED: - * - * Whether the thread support is configured in - */ -#if 0 -#if defined(_REENTRANT) || defined(__MT__) || \ - (defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE - 0 >= 199506L)) -#define LIBXML_THREAD_ENABLED -#endif -#endif - -/** - * LIBXML_THREAD_ALLOC_ENABLED: - * - * Whether the allocation hooks are per-thread - */ -#if 0 -#define LIBXML_THREAD_ALLOC_ENABLED -#endif - -/** - * LIBXML_TREE_ENABLED: - * - * Whether the DOM like tree manipulation API support is configured in - */ -#if 1 -#define LIBXML_TREE_ENABLED -#endif - -/** - * LIBXML_OUTPUT_ENABLED: - * - * Whether the serialization/saving support is configured in - */ -#if 1 -#define LIBXML_OUTPUT_ENABLED -#endif - -/** - * LIBXML_PUSH_ENABLED: - * - * Whether the push parsing interfaces are configured in - */ -#if 1 -#define LIBXML_PUSH_ENABLED -#endif - -/** - * LIBXML_READER_ENABLED: - * - * Whether the xmlReader parsing interface is configured in - */ -#if 1 -#define LIBXML_READER_ENABLED -#endif - -/** - * LIBXML_PATTERN_ENABLED: - * - * Whether the xmlPattern node selection interface is configured in - */ -#if 1 -#define LIBXML_PATTERN_ENABLED -#endif - -/** - * LIBXML_WRITER_ENABLED: - * - * Whether the xmlWriter saving interface is configured in - */ -#if 1 -#define LIBXML_WRITER_ENABLED -#endif - -/** - * LIBXML_SAX1_ENABLED: - * - * Whether the older SAX1 interface is configured in - */ -#if 1 -#define LIBXML_SAX1_ENABLED -#endif - -/** - * LIBXML_FTP_ENABLED: - * - * Whether the FTP support is configured in - */ -#if 0 -#define LIBXML_FTP_ENABLED -#endif - -/** - * LIBXML_HTTP_ENABLED: - * - * Whether the HTTP support is configured in - */ -#if 0 -#define LIBXML_HTTP_ENABLED -#endif - -/** - * LIBXML_VALID_ENABLED: - * - * Whether the DTD validation support is configured in - */ -#if 1 -#define LIBXML_VALID_ENABLED -#endif - -/** - * LIBXML_HTML_ENABLED: - * - * Whether the HTML support is configured in - */ -#if 1 -#define LIBXML_HTML_ENABLED -#endif - -/** - * LIBXML_LEGACY_ENABLED: - * - * Whether the deprecated APIs are compiled in for compatibility - */ -#if 1 -#define LIBXML_LEGACY_ENABLED -#endif - -/** - * LIBXML_C14N_ENABLED: - * - * Whether the Canonicalization support is configured in - */ -#if 1 -#define LIBXML_C14N_ENABLED -#endif - -/** - * LIBXML_CATALOG_ENABLED: - * - * Whether the Catalog support is configured in - */ -#if 1 -#define LIBXML_CATALOG_ENABLED -#endif - -/** - * LIBXML_DOCB_ENABLED: - * - * Whether the SGML Docbook support is configured in - */ -#if 1 -#define LIBXML_DOCB_ENABLED -#endif - -/** - * LIBXML_XPATH_ENABLED: - * - * Whether XPath is configured in - */ -#if 1 -#define LIBXML_XPATH_ENABLED -#endif - -/** - * LIBXML_XPTR_ENABLED: - * - * Whether XPointer is configured in - */ -#if 1 -#define LIBXML_XPTR_ENABLED -#endif - -/** - * LIBXML_XINCLUDE_ENABLED: - * - * Whether XInclude is configured in - */ -#if 1 -#define LIBXML_XINCLUDE_ENABLED -#endif - -/** - * LIBXML_ICONV_ENABLED: - * - * Whether iconv support is available - */ -#if 1 -#define LIBXML_ICONV_ENABLED -#endif - -/** - * LIBXML_ICU_ENABLED: - * - * Whether icu support is available - */ -#if 0 -#define LIBXML_ICU_ENABLED -#endif - -/** - * LIBXML_ISO8859X_ENABLED: - * - * Whether ISO-8859-* support is made available in case iconv is not - */ -#if 1 -#define LIBXML_ISO8859X_ENABLED -#endif - -/** - * LIBXML_DEBUG_ENABLED: - * - * Whether Debugging module is configured in - */ -#if 1 -#define LIBXML_DEBUG_ENABLED -#endif - -/** - * DEBUG_MEMORY_LOCATION: - * - * Whether the memory debugging is configured in - */ -#if 0 -#define DEBUG_MEMORY_LOCATION -#endif - -/** - * LIBXML_DEBUG_RUNTIME: - * - * Whether the runtime debugging is configured in - */ -#if 0 -#define LIBXML_DEBUG_RUNTIME -#endif - -/** - * LIBXML_UNICODE_ENABLED: - * - * Whether the Unicode related interfaces are compiled in - */ -#if 1 -#define LIBXML_UNICODE_ENABLED -#endif - -/** - * LIBXML_REGEXP_ENABLED: - * - * Whether the regular expressions interfaces are compiled in - */ -#if 1 -#define LIBXML_REGEXP_ENABLED -#endif - -/** - * LIBXML_AUTOMATA_ENABLED: - * - * Whether the automata interfaces are compiled in - */ -#if 1 -#define LIBXML_AUTOMATA_ENABLED -#endif - -/** - * LIBXML_EXPR_ENABLED: - * - * Whether the formal expressions interfaces are compiled in - */ -#if 1 -#define LIBXML_EXPR_ENABLED -#endif - -/** - * LIBXML_SCHEMAS_ENABLED: - * - * Whether the Schemas validation interfaces are compiled in - */ -#if 1 -#define LIBXML_SCHEMAS_ENABLED -#endif - -/** - * LIBXML_SCHEMATRON_ENABLED: - * - * Whether the Schematron validation interfaces are compiled in - */ -#if 1 -#define LIBXML_SCHEMATRON_ENABLED -#endif - -/** - * LIBXML_MODULES_ENABLED: - * - * Whether the module interfaces are compiled in - */ -#if 1 -#define LIBXML_MODULES_ENABLED -/** - * LIBXML_MODULE_EXTENSION: - * - * the string suffix used by dynamic modules (usually shared libraries) - */ -#define LIBXML_MODULE_EXTENSION ".so" -#endif - -/** - * LIBXML_ZLIB_ENABLED: - * - * Whether the Zlib support is compiled in - */ -#if 1 -#define LIBXML_ZLIB_ENABLED -#endif - -/** - * LIBXML_LZMA_ENABLED: - * - * Whether the Lzma support is compiled in - */ -#if 0 -#define LIBXML_LZMA_ENABLED -#endif - -#ifdef __GNUC__ -#ifdef HAVE_ANSIDECL_H -#include -#endif - -/** - * ATTRIBUTE_UNUSED: - * - * Macro used to signal to GCC unused function parameters - */ - -#ifndef ATTRIBUTE_UNUSED -# if ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 7))) -# define ATTRIBUTE_UNUSED __attribute__((unused)) -# else -# define ATTRIBUTE_UNUSED -# endif -#endif - -/** - * LIBXML_ATTR_ALLOC_SIZE: - * - * Macro used to indicate to GCC this is an allocator function - */ - -#ifndef LIBXML_ATTR_ALLOC_SIZE -# if ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3))) -# define LIBXML_ATTR_ALLOC_SIZE(x) __attribute__((alloc_size(x))) -# else -# define LIBXML_ATTR_ALLOC_SIZE(x) -# endif -#else -# define LIBXML_ATTR_ALLOC_SIZE(x) -#endif - -/** - * LIBXML_ATTR_FORMAT: - * - * Macro used to indicate to GCC the parameter are printf like - */ - -#ifndef LIBXML_ATTR_FORMAT -# if ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3))) -# define LIBXML_ATTR_FORMAT(fmt,args) __attribute__((__format__(__printf__,fmt,args))) -# else -# define LIBXML_ATTR_FORMAT(fmt,args) -# endif -#else -# define LIBXML_ATTR_FORMAT(fmt,args) -#endif - -#else /* ! __GNUC__ */ -/** - * ATTRIBUTE_UNUSED: - * - * Macro used to signal to GCC unused function parameters - */ -#define ATTRIBUTE_UNUSED -/** - * LIBXML_ATTR_ALLOC_SIZE: - * - * Macro used to indicate to GCC this is an allocator function - */ -#define LIBXML_ATTR_ALLOC_SIZE(x) -/** - * LIBXML_ATTR_FORMAT: - * - * Macro used to indicate to GCC the parameter are printf like - */ -#define LIBXML_ATTR_FORMAT(fmt,args) -#endif /* __GNUC__ */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif - - diff --git a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/xmlwriter.h b/cocos2dx/platform/third_party/emscripten/libxml2/libxml/xmlwriter.h deleted file mode 100644 index dd5add3416..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/xmlwriter.h +++ /dev/null @@ -1,488 +0,0 @@ -/* - * Summary: text writing API for XML - * Description: text writing API for XML - * - * Copy: See Copyright for the status of this software. - * - * Author: Alfred Mickautsch - */ - -#ifndef __XML_XMLWRITER_H__ -#define __XML_XMLWRITER_H__ - -#include - -#ifdef LIBXML_WRITER_ENABLED - -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - - typedef struct _xmlTextWriter xmlTextWriter; - typedef xmlTextWriter *xmlTextWriterPtr; - -/* - * Constructors & Destructor - */ - XMLPUBFUN xmlTextWriterPtr XMLCALL - xmlNewTextWriter(xmlOutputBufferPtr out); - XMLPUBFUN xmlTextWriterPtr XMLCALL - xmlNewTextWriterFilename(const char *uri, int compression); - XMLPUBFUN xmlTextWriterPtr XMLCALL - xmlNewTextWriterMemory(xmlBufferPtr buf, int compression); - XMLPUBFUN xmlTextWriterPtr XMLCALL - xmlNewTextWriterPushParser(xmlParserCtxtPtr ctxt, int compression); - XMLPUBFUN xmlTextWriterPtr XMLCALL - xmlNewTextWriterDoc(xmlDocPtr * doc, int compression); - XMLPUBFUN xmlTextWriterPtr XMLCALL - xmlNewTextWriterTree(xmlDocPtr doc, xmlNodePtr node, - int compression); - XMLPUBFUN void XMLCALL xmlFreeTextWriter(xmlTextWriterPtr writer); - -/* - * Functions - */ - - -/* - * Document - */ - XMLPUBFUN int XMLCALL - xmlTextWriterStartDocument(xmlTextWriterPtr writer, - const char *version, - const char *encoding, - const char *standalone); - XMLPUBFUN int XMLCALL xmlTextWriterEndDocument(xmlTextWriterPtr - writer); - -/* - * Comments - */ - XMLPUBFUN int XMLCALL xmlTextWriterStartComment(xmlTextWriterPtr - writer); - XMLPUBFUN int XMLCALL xmlTextWriterEndComment(xmlTextWriterPtr writer); - XMLPUBFUN int XMLCALL - xmlTextWriterWriteFormatComment(xmlTextWriterPtr writer, - const char *format, ...) - LIBXML_ATTR_FORMAT(2,3); - XMLPUBFUN int XMLCALL - xmlTextWriterWriteVFormatComment(xmlTextWriterPtr writer, - const char *format, - va_list argptr) - LIBXML_ATTR_FORMAT(2,0); - XMLPUBFUN int XMLCALL xmlTextWriterWriteComment(xmlTextWriterPtr - writer, - const xmlChar * - content); - -/* - * Elements - */ - XMLPUBFUN int XMLCALL - xmlTextWriterStartElement(xmlTextWriterPtr writer, - const xmlChar * name); - XMLPUBFUN int XMLCALL xmlTextWriterStartElementNS(xmlTextWriterPtr - writer, - const xmlChar * - prefix, - const xmlChar * name, - const xmlChar * - namespaceURI); - XMLPUBFUN int XMLCALL xmlTextWriterEndElement(xmlTextWriterPtr writer); - XMLPUBFUN int XMLCALL xmlTextWriterFullEndElement(xmlTextWriterPtr - writer); - -/* - * Elements conveniency functions - */ - XMLPUBFUN int XMLCALL - xmlTextWriterWriteFormatElement(xmlTextWriterPtr writer, - const xmlChar * name, - const char *format, ...) - LIBXML_ATTR_FORMAT(3,4); - XMLPUBFUN int XMLCALL - xmlTextWriterWriteVFormatElement(xmlTextWriterPtr writer, - const xmlChar * name, - const char *format, - va_list argptr) - LIBXML_ATTR_FORMAT(3,0); - XMLPUBFUN int XMLCALL xmlTextWriterWriteElement(xmlTextWriterPtr - writer, - const xmlChar * name, - const xmlChar * - content); - XMLPUBFUN int XMLCALL - xmlTextWriterWriteFormatElementNS(xmlTextWriterPtr writer, - const xmlChar * prefix, - const xmlChar * name, - const xmlChar * namespaceURI, - const char *format, ...) - LIBXML_ATTR_FORMAT(5,6); - XMLPUBFUN int XMLCALL - xmlTextWriterWriteVFormatElementNS(xmlTextWriterPtr writer, - const xmlChar * prefix, - const xmlChar * name, - const xmlChar * namespaceURI, - const char *format, - va_list argptr) - LIBXML_ATTR_FORMAT(5,0); - XMLPUBFUN int XMLCALL xmlTextWriterWriteElementNS(xmlTextWriterPtr - writer, - const xmlChar * - prefix, - const xmlChar * name, - const xmlChar * - namespaceURI, - const xmlChar * - content); - -/* - * Text - */ - XMLPUBFUN int XMLCALL - xmlTextWriterWriteFormatRaw(xmlTextWriterPtr writer, - const char *format, ...) - LIBXML_ATTR_FORMAT(2,3); - XMLPUBFUN int XMLCALL - xmlTextWriterWriteVFormatRaw(xmlTextWriterPtr writer, - const char *format, va_list argptr) - LIBXML_ATTR_FORMAT(2,0); - XMLPUBFUN int XMLCALL - xmlTextWriterWriteRawLen(xmlTextWriterPtr writer, - const xmlChar * content, int len); - XMLPUBFUN int XMLCALL - xmlTextWriterWriteRaw(xmlTextWriterPtr writer, - const xmlChar * content); - XMLPUBFUN int XMLCALL xmlTextWriterWriteFormatString(xmlTextWriterPtr - writer, - const char - *format, ...) - LIBXML_ATTR_FORMAT(2,3); - XMLPUBFUN int XMLCALL xmlTextWriterWriteVFormatString(xmlTextWriterPtr - writer, - const char - *format, - va_list argptr) - LIBXML_ATTR_FORMAT(2,0); - XMLPUBFUN int XMLCALL xmlTextWriterWriteString(xmlTextWriterPtr writer, - const xmlChar * - content); - XMLPUBFUN int XMLCALL xmlTextWriterWriteBase64(xmlTextWriterPtr writer, - const char *data, - int start, int len); - XMLPUBFUN int XMLCALL xmlTextWriterWriteBinHex(xmlTextWriterPtr writer, - const char *data, - int start, int len); - -/* - * Attributes - */ - XMLPUBFUN int XMLCALL - xmlTextWriterStartAttribute(xmlTextWriterPtr writer, - const xmlChar * name); - XMLPUBFUN int XMLCALL xmlTextWriterStartAttributeNS(xmlTextWriterPtr - writer, - const xmlChar * - prefix, - const xmlChar * - name, - const xmlChar * - namespaceURI); - XMLPUBFUN int XMLCALL xmlTextWriterEndAttribute(xmlTextWriterPtr - writer); - -/* - * Attributes conveniency functions - */ - XMLPUBFUN int XMLCALL - xmlTextWriterWriteFormatAttribute(xmlTextWriterPtr writer, - const xmlChar * name, - const char *format, ...) - LIBXML_ATTR_FORMAT(3,4); - XMLPUBFUN int XMLCALL - xmlTextWriterWriteVFormatAttribute(xmlTextWriterPtr writer, - const xmlChar * name, - const char *format, - va_list argptr) - LIBXML_ATTR_FORMAT(3,0); - XMLPUBFUN int XMLCALL xmlTextWriterWriteAttribute(xmlTextWriterPtr - writer, - const xmlChar * name, - const xmlChar * - content); - XMLPUBFUN int XMLCALL - xmlTextWriterWriteFormatAttributeNS(xmlTextWriterPtr writer, - const xmlChar * prefix, - const xmlChar * name, - const xmlChar * namespaceURI, - const char *format, ...) - LIBXML_ATTR_FORMAT(5,6); - XMLPUBFUN int XMLCALL - xmlTextWriterWriteVFormatAttributeNS(xmlTextWriterPtr writer, - const xmlChar * prefix, - const xmlChar * name, - const xmlChar * namespaceURI, - const char *format, - va_list argptr) - LIBXML_ATTR_FORMAT(5,0); - XMLPUBFUN int XMLCALL xmlTextWriterWriteAttributeNS(xmlTextWriterPtr - writer, - const xmlChar * - prefix, - const xmlChar * - name, - const xmlChar * - namespaceURI, - const xmlChar * - content); - -/* - * PI's - */ - XMLPUBFUN int XMLCALL - xmlTextWriterStartPI(xmlTextWriterPtr writer, - const xmlChar * target); - XMLPUBFUN int XMLCALL xmlTextWriterEndPI(xmlTextWriterPtr writer); - -/* - * PI conveniency functions - */ - XMLPUBFUN int XMLCALL - xmlTextWriterWriteFormatPI(xmlTextWriterPtr writer, - const xmlChar * target, - const char *format, ...) - LIBXML_ATTR_FORMAT(3,4); - XMLPUBFUN int XMLCALL - xmlTextWriterWriteVFormatPI(xmlTextWriterPtr writer, - const xmlChar * target, - const char *format, va_list argptr) - LIBXML_ATTR_FORMAT(3,0); - XMLPUBFUN int XMLCALL - xmlTextWriterWritePI(xmlTextWriterPtr writer, - const xmlChar * target, - const xmlChar * content); - -/** - * xmlTextWriterWriteProcessingInstruction: - * - * This macro maps to xmlTextWriterWritePI - */ -#define xmlTextWriterWriteProcessingInstruction xmlTextWriterWritePI - -/* - * CDATA - */ - XMLPUBFUN int XMLCALL xmlTextWriterStartCDATA(xmlTextWriterPtr writer); - XMLPUBFUN int XMLCALL xmlTextWriterEndCDATA(xmlTextWriterPtr writer); - -/* - * CDATA conveniency functions - */ - XMLPUBFUN int XMLCALL - xmlTextWriterWriteFormatCDATA(xmlTextWriterPtr writer, - const char *format, ...) - LIBXML_ATTR_FORMAT(2,3); - XMLPUBFUN int XMLCALL - xmlTextWriterWriteVFormatCDATA(xmlTextWriterPtr writer, - const char *format, va_list argptr) - LIBXML_ATTR_FORMAT(2,0); - XMLPUBFUN int XMLCALL - xmlTextWriterWriteCDATA(xmlTextWriterPtr writer, - const xmlChar * content); - -/* - * DTD - */ - XMLPUBFUN int XMLCALL - xmlTextWriterStartDTD(xmlTextWriterPtr writer, - const xmlChar * name, - const xmlChar * pubid, - const xmlChar * sysid); - XMLPUBFUN int XMLCALL xmlTextWriterEndDTD(xmlTextWriterPtr writer); - -/* - * DTD conveniency functions - */ - XMLPUBFUN int XMLCALL - xmlTextWriterWriteFormatDTD(xmlTextWriterPtr writer, - const xmlChar * name, - const xmlChar * pubid, - const xmlChar * sysid, - const char *format, ...) - LIBXML_ATTR_FORMAT(5,6); - XMLPUBFUN int XMLCALL - xmlTextWriterWriteVFormatDTD(xmlTextWriterPtr writer, - const xmlChar * name, - const xmlChar * pubid, - const xmlChar * sysid, - const char *format, va_list argptr) - LIBXML_ATTR_FORMAT(5,0); - XMLPUBFUN int XMLCALL - xmlTextWriterWriteDTD(xmlTextWriterPtr writer, - const xmlChar * name, - const xmlChar * pubid, - const xmlChar * sysid, - const xmlChar * subset); - -/** - * xmlTextWriterWriteDocType: - * - * this macro maps to xmlTextWriterWriteDTD - */ -#define xmlTextWriterWriteDocType xmlTextWriterWriteDTD - -/* - * DTD element definition - */ - XMLPUBFUN int XMLCALL - xmlTextWriterStartDTDElement(xmlTextWriterPtr writer, - const xmlChar * name); - XMLPUBFUN int XMLCALL xmlTextWriterEndDTDElement(xmlTextWriterPtr - writer); - -/* - * DTD element definition conveniency functions - */ - XMLPUBFUN int XMLCALL - xmlTextWriterWriteFormatDTDElement(xmlTextWriterPtr writer, - const xmlChar * name, - const char *format, ...) - LIBXML_ATTR_FORMAT(3,4); - XMLPUBFUN int XMLCALL - xmlTextWriterWriteVFormatDTDElement(xmlTextWriterPtr writer, - const xmlChar * name, - const char *format, - va_list argptr) - LIBXML_ATTR_FORMAT(3,0); - XMLPUBFUN int XMLCALL xmlTextWriterWriteDTDElement(xmlTextWriterPtr - writer, - const xmlChar * - name, - const xmlChar * - content); - -/* - * DTD attribute list definition - */ - XMLPUBFUN int XMLCALL - xmlTextWriterStartDTDAttlist(xmlTextWriterPtr writer, - const xmlChar * name); - XMLPUBFUN int XMLCALL xmlTextWriterEndDTDAttlist(xmlTextWriterPtr - writer); - -/* - * DTD attribute list definition conveniency functions - */ - XMLPUBFUN int XMLCALL - xmlTextWriterWriteFormatDTDAttlist(xmlTextWriterPtr writer, - const xmlChar * name, - const char *format, ...) - LIBXML_ATTR_FORMAT(3,4); - XMLPUBFUN int XMLCALL - xmlTextWriterWriteVFormatDTDAttlist(xmlTextWriterPtr writer, - const xmlChar * name, - const char *format, - va_list argptr) - LIBXML_ATTR_FORMAT(3,0); - XMLPUBFUN int XMLCALL xmlTextWriterWriteDTDAttlist(xmlTextWriterPtr - writer, - const xmlChar * - name, - const xmlChar * - content); - -/* - * DTD entity definition - */ - XMLPUBFUN int XMLCALL - xmlTextWriterStartDTDEntity(xmlTextWriterPtr writer, - int pe, const xmlChar * name); - XMLPUBFUN int XMLCALL xmlTextWriterEndDTDEntity(xmlTextWriterPtr - writer); - -/* - * DTD entity definition conveniency functions - */ - XMLPUBFUN int XMLCALL - xmlTextWriterWriteFormatDTDInternalEntity(xmlTextWriterPtr writer, - int pe, - const xmlChar * name, - const char *format, ...) - LIBXML_ATTR_FORMAT(4,5); - XMLPUBFUN int XMLCALL - xmlTextWriterWriteVFormatDTDInternalEntity(xmlTextWriterPtr writer, - int pe, - const xmlChar * name, - const char *format, - va_list argptr) - LIBXML_ATTR_FORMAT(4,0); - XMLPUBFUN int XMLCALL - xmlTextWriterWriteDTDInternalEntity(xmlTextWriterPtr writer, - int pe, - const xmlChar * name, - const xmlChar * content); - XMLPUBFUN int XMLCALL - xmlTextWriterWriteDTDExternalEntity(xmlTextWriterPtr writer, - int pe, - const xmlChar * name, - const xmlChar * pubid, - const xmlChar * sysid, - const xmlChar * ndataid); - XMLPUBFUN int XMLCALL - xmlTextWriterWriteDTDExternalEntityContents(xmlTextWriterPtr - writer, - const xmlChar * pubid, - const xmlChar * sysid, - const xmlChar * - ndataid); - XMLPUBFUN int XMLCALL xmlTextWriterWriteDTDEntity(xmlTextWriterPtr - writer, int pe, - const xmlChar * name, - const xmlChar * - pubid, - const xmlChar * - sysid, - const xmlChar * - ndataid, - const xmlChar * - content); - -/* - * DTD notation definition - */ - XMLPUBFUN int XMLCALL - xmlTextWriterWriteDTDNotation(xmlTextWriterPtr writer, - const xmlChar * name, - const xmlChar * pubid, - const xmlChar * sysid); - -/* - * Indentation - */ - XMLPUBFUN int XMLCALL - xmlTextWriterSetIndent(xmlTextWriterPtr writer, int indent); - XMLPUBFUN int XMLCALL - xmlTextWriterSetIndentString(xmlTextWriterPtr writer, - const xmlChar * str); - - XMLPUBFUN int XMLCALL - xmlTextWriterSetQuoteChar(xmlTextWriterPtr writer, xmlChar quotechar); - - -/* - * misc - */ - XMLPUBFUN int XMLCALL xmlTextWriterFlush(xmlTextWriterPtr writer); - -#ifdef __cplusplus -} -#endif - -#endif /* LIBXML_WRITER_ENABLED */ - -#endif /* __XML_XMLWRITER_H__ */ diff --git a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/xpath.h b/cocos2dx/platform/third_party/emscripten/libxml2/libxml/xpath.h deleted file mode 100644 index d96776c518..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/xpath.h +++ /dev/null @@ -1,557 +0,0 @@ -/* - * Summary: XML Path Language implementation - * Description: API for the XML Path Language implementation - * - * XML Path Language implementation - * XPath is a language for addressing parts of an XML document, - * designed to be used by both XSLT and XPointer - * http://www.w3.org/TR/xpath - * - * Implements - * W3C Recommendation 16 November 1999 - * http://www.w3.org/TR/1999/REC-xpath-19991116 - * - * Copy: See Copyright for the status of this software. - * - * Author: Daniel Veillard - */ - -#ifndef __XML_XPATH_H__ -#define __XML_XPATH_H__ - -#include - -#ifdef LIBXML_XPATH_ENABLED - -#include -#include -#include -#endif /* LIBXML_XPATH_ENABLED */ - -#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) -#ifdef __cplusplus -extern "C" { -#endif -#endif /* LIBXML_XPATH_ENABLED or LIBXML_SCHEMAS_ENABLED */ - -#ifdef LIBXML_XPATH_ENABLED - -typedef struct _xmlXPathContext xmlXPathContext; -typedef xmlXPathContext *xmlXPathContextPtr; -typedef struct _xmlXPathParserContext xmlXPathParserContext; -typedef xmlXPathParserContext *xmlXPathParserContextPtr; - -/** - * The set of XPath error codes. - */ - -typedef enum { - XPATH_EXPRESSION_OK = 0, - XPATH_NUMBER_ERROR, - XPATH_UNFINISHED_LITERAL_ERROR, - XPATH_START_LITERAL_ERROR, - XPATH_VARIABLE_REF_ERROR, - XPATH_UNDEF_VARIABLE_ERROR, - XPATH_INVALID_PREDICATE_ERROR, - XPATH_EXPR_ERROR, - XPATH_UNCLOSED_ERROR, - XPATH_UNKNOWN_FUNC_ERROR, - XPATH_INVALID_OPERAND, - XPATH_INVALID_TYPE, - XPATH_INVALID_ARITY, - XPATH_INVALID_CTXT_SIZE, - XPATH_INVALID_CTXT_POSITION, - XPATH_MEMORY_ERROR, - XPTR_SYNTAX_ERROR, - XPTR_RESOURCE_ERROR, - XPTR_SUB_RESOURCE_ERROR, - XPATH_UNDEF_PREFIX_ERROR, - XPATH_ENCODING_ERROR, - XPATH_INVALID_CHAR_ERROR, - XPATH_INVALID_CTXT, - XPATH_STACK_ERROR, - XPATH_FORBID_VARIABLE_ERROR -} xmlXPathError; - -/* - * A node-set (an unordered collection of nodes without duplicates). - */ -typedef struct _xmlNodeSet xmlNodeSet; -typedef xmlNodeSet *xmlNodeSetPtr; -struct _xmlNodeSet { - int nodeNr; /* number of nodes in the set */ - int nodeMax; /* size of the array as allocated */ - xmlNodePtr *nodeTab; /* array of nodes in no particular order */ - /* @@ with_ns to check wether namespace nodes should be looked at @@ */ -}; - -/* - * An expression is evaluated to yield an object, which - * has one of the following four basic types: - * - node-set - * - boolean - * - number - * - string - * - * @@ XPointer will add more types ! - */ - -typedef enum { - XPATH_UNDEFINED = 0, - XPATH_NODESET = 1, - XPATH_BOOLEAN = 2, - XPATH_NUMBER = 3, - XPATH_STRING = 4, - XPATH_POINT = 5, - XPATH_RANGE = 6, - XPATH_LOCATIONSET = 7, - XPATH_USERS = 8, - XPATH_XSLT_TREE = 9 /* An XSLT value tree, non modifiable */ -} xmlXPathObjectType; - -typedef struct _xmlXPathObject xmlXPathObject; -typedef xmlXPathObject *xmlXPathObjectPtr; -struct _xmlXPathObject { - xmlXPathObjectType type; - xmlNodeSetPtr nodesetval; - int boolval; - double floatval; - xmlChar *stringval; - void *user; - int index; - void *user2; - int index2; -}; - -/** - * xmlXPathConvertFunc: - * @obj: an XPath object - * @type: the number of the target type - * - * A conversion function is associated to a type and used to cast - * the new type to primitive values. - * - * Returns -1 in case of error, 0 otherwise - */ -typedef int (*xmlXPathConvertFunc) (xmlXPathObjectPtr obj, int type); - -/* - * Extra type: a name and a conversion function. - */ - -typedef struct _xmlXPathType xmlXPathType; -typedef xmlXPathType *xmlXPathTypePtr; -struct _xmlXPathType { - const xmlChar *name; /* the type name */ - xmlXPathConvertFunc func; /* the conversion function */ -}; - -/* - * Extra variable: a name and a value. - */ - -typedef struct _xmlXPathVariable xmlXPathVariable; -typedef xmlXPathVariable *xmlXPathVariablePtr; -struct _xmlXPathVariable { - const xmlChar *name; /* the variable name */ - xmlXPathObjectPtr value; /* the value */ -}; - -/** - * xmlXPathEvalFunc: - * @ctxt: an XPath parser context - * @nargs: the number of arguments passed to the function - * - * An XPath evaluation function, the parameters are on the XPath context stack. - */ - -typedef void (*xmlXPathEvalFunc)(xmlXPathParserContextPtr ctxt, - int nargs); - -/* - * Extra function: a name and a evaluation function. - */ - -typedef struct _xmlXPathFunct xmlXPathFunct; -typedef xmlXPathFunct *xmlXPathFuncPtr; -struct _xmlXPathFunct { - const xmlChar *name; /* the function name */ - xmlXPathEvalFunc func; /* the evaluation function */ -}; - -/** - * xmlXPathAxisFunc: - * @ctxt: the XPath interpreter context - * @cur: the previous node being explored on that axis - * - * An axis traversal function. To traverse an axis, the engine calls - * the first time with cur == NULL and repeat until the function returns - * NULL indicating the end of the axis traversal. - * - * Returns the next node in that axis or NULL if at the end of the axis. - */ - -typedef xmlXPathObjectPtr (*xmlXPathAxisFunc) (xmlXPathParserContextPtr ctxt, - xmlXPathObjectPtr cur); - -/* - * Extra axis: a name and an axis function. - */ - -typedef struct _xmlXPathAxis xmlXPathAxis; -typedef xmlXPathAxis *xmlXPathAxisPtr; -struct _xmlXPathAxis { - const xmlChar *name; /* the axis name */ - xmlXPathAxisFunc func; /* the search function */ -}; - -/** - * xmlXPathFunction: - * @ctxt: the XPath interprestation context - * @nargs: the number of arguments - * - * An XPath function. - * The arguments (if any) are popped out from the context stack - * and the result is pushed on the stack. - */ - -typedef void (*xmlXPathFunction) (xmlXPathParserContextPtr ctxt, int nargs); - -/* - * Function and Variable Lookup. - */ - -/** - * xmlXPathVariableLookupFunc: - * @ctxt: an XPath context - * @name: name of the variable - * @ns_uri: the namespace name hosting this variable - * - * Prototype for callbacks used to plug variable lookup in the XPath - * engine. - * - * Returns the XPath object value or NULL if not found. - */ -typedef xmlXPathObjectPtr (*xmlXPathVariableLookupFunc) (void *ctxt, - const xmlChar *name, - const xmlChar *ns_uri); - -/** - * xmlXPathFuncLookupFunc: - * @ctxt: an XPath context - * @name: name of the function - * @ns_uri: the namespace name hosting this function - * - * Prototype for callbacks used to plug function lookup in the XPath - * engine. - * - * Returns the XPath function or NULL if not found. - */ -typedef xmlXPathFunction (*xmlXPathFuncLookupFunc) (void *ctxt, - const xmlChar *name, - const xmlChar *ns_uri); - -/** - * xmlXPathFlags: - * Flags for XPath engine compilation and runtime - */ -/** - * XML_XPATH_CHECKNS: - * - * check namespaces at compilation - */ -#define XML_XPATH_CHECKNS (1<<0) -/** - * XML_XPATH_NOVAR: - * - * forbid variables in expression - */ -#define XML_XPATH_NOVAR (1<<1) - -/** - * xmlXPathContext: - * - * Expression evaluation occurs with respect to a context. - * he context consists of: - * - a node (the context node) - * - a node list (the context node list) - * - a set of variable bindings - * - a function library - * - the set of namespace declarations in scope for the expression - * Following the switch to hash tables, this need to be trimmed up at - * the next binary incompatible release. - * The node may be modified when the context is passed to libxml2 - * for an XPath evaluation so you may need to initialize it again - * before the next call. - */ - -struct _xmlXPathContext { - xmlDocPtr doc; /* The current document */ - xmlNodePtr node; /* The current node */ - - int nb_variables_unused; /* unused (hash table) */ - int max_variables_unused; /* unused (hash table) */ - xmlHashTablePtr varHash; /* Hash table of defined variables */ - - int nb_types; /* number of defined types */ - int max_types; /* max number of types */ - xmlXPathTypePtr types; /* Array of defined types */ - - int nb_funcs_unused; /* unused (hash table) */ - int max_funcs_unused; /* unused (hash table) */ - xmlHashTablePtr funcHash; /* Hash table of defined funcs */ - - int nb_axis; /* number of defined axis */ - int max_axis; /* max number of axis */ - xmlXPathAxisPtr axis; /* Array of defined axis */ - - /* the namespace nodes of the context node */ - xmlNsPtr *namespaces; /* Array of namespaces */ - int nsNr; /* number of namespace in scope */ - void *user; /* function to free */ - - /* extra variables */ - int contextSize; /* the context size */ - int proximityPosition; /* the proximity position */ - - /* extra stuff for XPointer */ - int xptr; /* is this an XPointer context? */ - xmlNodePtr here; /* for here() */ - xmlNodePtr origin; /* for origin() */ - - /* the set of namespace declarations in scope for the expression */ - xmlHashTablePtr nsHash; /* The namespaces hash table */ - xmlXPathVariableLookupFunc varLookupFunc;/* variable lookup func */ - void *varLookupData; /* variable lookup data */ - - /* Possibility to link in an extra item */ - void *extra; /* needed for XSLT */ - - /* The function name and URI when calling a function */ - const xmlChar *function; - const xmlChar *functionURI; - - /* function lookup function and data */ - xmlXPathFuncLookupFunc funcLookupFunc;/* function lookup func */ - void *funcLookupData; /* function lookup data */ - - /* temporary namespace lists kept for walking the namespace axis */ - xmlNsPtr *tmpNsList; /* Array of namespaces */ - int tmpNsNr; /* number of namespaces in scope */ - - /* error reporting mechanism */ - void *userData; /* user specific data block */ - xmlStructuredErrorFunc error; /* the callback in case of errors */ - xmlError lastError; /* the last error */ - xmlNodePtr debugNode; /* the source node XSLT */ - - /* dictionary */ - xmlDictPtr dict; /* dictionary if any */ - - int flags; /* flags to control compilation */ - - /* Cache for reusal of XPath objects */ - void *cache; -}; - -/* - * The structure of a compiled expression form is not public. - */ - -typedef struct _xmlXPathCompExpr xmlXPathCompExpr; -typedef xmlXPathCompExpr *xmlXPathCompExprPtr; - -/** - * xmlXPathParserContext: - * - * An XPath parser context. It contains pure parsing informations, - * an xmlXPathContext, and the stack of objects. - */ -struct _xmlXPathParserContext { - const xmlChar *cur; /* the current char being parsed */ - const xmlChar *base; /* the full expression */ - - int error; /* error code */ - - xmlXPathContextPtr context; /* the evaluation context */ - xmlXPathObjectPtr value; /* the current value */ - int valueNr; /* number of values stacked */ - int valueMax; /* max number of values stacked */ - xmlXPathObjectPtr *valueTab; /* stack of values */ - - xmlXPathCompExprPtr comp; /* the precompiled expression */ - int xptr; /* it this an XPointer expression */ - xmlNodePtr ancestor; /* used for walking preceding axis */ - - int valueFrame; /* used to limit Pop on the stack */ -}; - -/************************************************************************ - * * - * Public API * - * * - ************************************************************************/ - -/** - * Objects and Nodesets handling - */ - -XMLPUBVAR double xmlXPathNAN; -XMLPUBVAR double xmlXPathPINF; -XMLPUBVAR double xmlXPathNINF; - -/* These macros may later turn into functions */ -/** - * xmlXPathNodeSetGetLength: - * @ns: a node-set - * - * Implement a functionality similar to the DOM NodeList.length. - * - * Returns the number of nodes in the node-set. - */ -#define xmlXPathNodeSetGetLength(ns) ((ns) ? (ns)->nodeNr : 0) -/** - * xmlXPathNodeSetItem: - * @ns: a node-set - * @index: index of a node in the set - * - * Implements a functionality similar to the DOM NodeList.item(). - * - * Returns the xmlNodePtr at the given @index in @ns or NULL if - * @index is out of range (0 to length-1) - */ -#define xmlXPathNodeSetItem(ns, index) \ - ((((ns) != NULL) && \ - ((index) >= 0) && ((index) < (ns)->nodeNr)) ? \ - (ns)->nodeTab[(index)] \ - : NULL) -/** - * xmlXPathNodeSetIsEmpty: - * @ns: a node-set - * - * Checks whether @ns is empty or not. - * - * Returns %TRUE if @ns is an empty node-set. - */ -#define xmlXPathNodeSetIsEmpty(ns) \ - (((ns) == NULL) || ((ns)->nodeNr == 0) || ((ns)->nodeTab == NULL)) - - -XMLPUBFUN void XMLCALL - xmlXPathFreeObject (xmlXPathObjectPtr obj); -XMLPUBFUN xmlNodeSetPtr XMLCALL - xmlXPathNodeSetCreate (xmlNodePtr val); -XMLPUBFUN void XMLCALL - xmlXPathFreeNodeSetList (xmlXPathObjectPtr obj); -XMLPUBFUN void XMLCALL - xmlXPathFreeNodeSet (xmlNodeSetPtr obj); -XMLPUBFUN xmlXPathObjectPtr XMLCALL - xmlXPathObjectCopy (xmlXPathObjectPtr val); -XMLPUBFUN int XMLCALL - xmlXPathCmpNodes (xmlNodePtr node1, - xmlNodePtr node2); -/** - * Conversion functions to basic types. - */ -XMLPUBFUN int XMLCALL - xmlXPathCastNumberToBoolean (double val); -XMLPUBFUN int XMLCALL - xmlXPathCastStringToBoolean (const xmlChar * val); -XMLPUBFUN int XMLCALL - xmlXPathCastNodeSetToBoolean(xmlNodeSetPtr ns); -XMLPUBFUN int XMLCALL - xmlXPathCastToBoolean (xmlXPathObjectPtr val); - -XMLPUBFUN double XMLCALL - xmlXPathCastBooleanToNumber (int val); -XMLPUBFUN double XMLCALL - xmlXPathCastStringToNumber (const xmlChar * val); -XMLPUBFUN double XMLCALL - xmlXPathCastNodeToNumber (xmlNodePtr node); -XMLPUBFUN double XMLCALL - xmlXPathCastNodeSetToNumber (xmlNodeSetPtr ns); -XMLPUBFUN double XMLCALL - xmlXPathCastToNumber (xmlXPathObjectPtr val); - -XMLPUBFUN xmlChar * XMLCALL - xmlXPathCastBooleanToString (int val); -XMLPUBFUN xmlChar * XMLCALL - xmlXPathCastNumberToString (double val); -XMLPUBFUN xmlChar * XMLCALL - xmlXPathCastNodeToString (xmlNodePtr node); -XMLPUBFUN xmlChar * XMLCALL - xmlXPathCastNodeSetToString (xmlNodeSetPtr ns); -XMLPUBFUN xmlChar * XMLCALL - xmlXPathCastToString (xmlXPathObjectPtr val); - -XMLPUBFUN xmlXPathObjectPtr XMLCALL - xmlXPathConvertBoolean (xmlXPathObjectPtr val); -XMLPUBFUN xmlXPathObjectPtr XMLCALL - xmlXPathConvertNumber (xmlXPathObjectPtr val); -XMLPUBFUN xmlXPathObjectPtr XMLCALL - xmlXPathConvertString (xmlXPathObjectPtr val); - -/** - * Context handling. - */ -XMLPUBFUN xmlXPathContextPtr XMLCALL - xmlXPathNewContext (xmlDocPtr doc); -XMLPUBFUN void XMLCALL - xmlXPathFreeContext (xmlXPathContextPtr ctxt); -XMLPUBFUN int XMLCALL - xmlXPathContextSetCache(xmlXPathContextPtr ctxt, - int active, - int value, - int options); -/** - * Evaluation functions. - */ -XMLPUBFUN long XMLCALL - xmlXPathOrderDocElems (xmlDocPtr doc); -XMLPUBFUN int XMLCALL - xmlXPathSetContextNode (xmlNodePtr node, - xmlXPathContextPtr ctx); -XMLPUBFUN xmlXPathObjectPtr XMLCALL - xmlXPathNodeEval (xmlNodePtr node, - const xmlChar *str, - xmlXPathContextPtr ctx); -XMLPUBFUN xmlXPathObjectPtr XMLCALL - xmlXPathEval (const xmlChar *str, - xmlXPathContextPtr ctx); -XMLPUBFUN xmlXPathObjectPtr XMLCALL - xmlXPathEvalExpression (const xmlChar *str, - xmlXPathContextPtr ctxt); -XMLPUBFUN int XMLCALL - xmlXPathEvalPredicate (xmlXPathContextPtr ctxt, - xmlXPathObjectPtr res); -/** - * Separate compilation/evaluation entry points. - */ -XMLPUBFUN xmlXPathCompExprPtr XMLCALL - xmlXPathCompile (const xmlChar *str); -XMLPUBFUN xmlXPathCompExprPtr XMLCALL - xmlXPathCtxtCompile (xmlXPathContextPtr ctxt, - const xmlChar *str); -XMLPUBFUN xmlXPathObjectPtr XMLCALL - xmlXPathCompiledEval (xmlXPathCompExprPtr comp, - xmlXPathContextPtr ctx); -XMLPUBFUN int XMLCALL - xmlXPathCompiledEvalToBoolean(xmlXPathCompExprPtr comp, - xmlXPathContextPtr ctxt); -XMLPUBFUN void XMLCALL - xmlXPathFreeCompExpr (xmlXPathCompExprPtr comp); -#endif /* LIBXML_XPATH_ENABLED */ -#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) -XMLPUBFUN void XMLCALL - xmlXPathInit (void); -XMLPUBFUN int XMLCALL - xmlXPathIsNaN (double val); -XMLPUBFUN int XMLCALL - xmlXPathIsInf (double val); - -#ifdef __cplusplus -} -#endif - -#endif /* LIBXML_XPATH_ENABLED or LIBXML_SCHEMAS_ENABLED*/ -#endif /* ! __XML_XPATH_H__ */ diff --git a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/xpathInternals.h b/cocos2dx/platform/third_party/emscripten/libxml2/libxml/xpathInternals.h deleted file mode 100644 index 70c9db96f1..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/xpathInternals.h +++ /dev/null @@ -1,632 +0,0 @@ -/* - * Summary: internal interfaces for XML Path Language implementation - * Description: internal interfaces for XML Path Language implementation - * used to build new modules on top of XPath like XPointer and - * XSLT - * - * Copy: See Copyright for the status of this software. - * - * Author: Daniel Veillard - */ - -#ifndef __XML_XPATH_INTERNALS_H__ -#define __XML_XPATH_INTERNALS_H__ - -#include -#include - -#ifdef LIBXML_XPATH_ENABLED - -#ifdef __cplusplus -extern "C" { -#endif - -/************************************************************************ - * * - * Helpers * - * * - ************************************************************************/ - -/* - * Many of these macros may later turn into functions. They - * shouldn't be used in #ifdef's preprocessor instructions. - */ -/** - * xmlXPathSetError: - * @ctxt: an XPath parser context - * @err: an xmlXPathError code - * - * Raises an error. - */ -#define xmlXPathSetError(ctxt, err) \ - { xmlXPatherror((ctxt), __FILE__, __LINE__, (err)); \ - if ((ctxt) != NULL) (ctxt)->error = (err); } - -/** - * xmlXPathSetArityError: - * @ctxt: an XPath parser context - * - * Raises an XPATH_INVALID_ARITY error. - */ -#define xmlXPathSetArityError(ctxt) \ - xmlXPathSetError((ctxt), XPATH_INVALID_ARITY) - -/** - * xmlXPathSetTypeError: - * @ctxt: an XPath parser context - * - * Raises an XPATH_INVALID_TYPE error. - */ -#define xmlXPathSetTypeError(ctxt) \ - xmlXPathSetError((ctxt), XPATH_INVALID_TYPE) - -/** - * xmlXPathGetError: - * @ctxt: an XPath parser context - * - * Get the error code of an XPath context. - * - * Returns the context error. - */ -#define xmlXPathGetError(ctxt) ((ctxt)->error) - -/** - * xmlXPathCheckError: - * @ctxt: an XPath parser context - * - * Check if an XPath error was raised. - * - * Returns true if an error has been raised, false otherwise. - */ -#define xmlXPathCheckError(ctxt) ((ctxt)->error != XPATH_EXPRESSION_OK) - -/** - * xmlXPathGetDocument: - * @ctxt: an XPath parser context - * - * Get the document of an XPath context. - * - * Returns the context document. - */ -#define xmlXPathGetDocument(ctxt) ((ctxt)->context->doc) - -/** - * xmlXPathGetContextNode: - * @ctxt: an XPath parser context - * - * Get the context node of an XPath context. - * - * Returns the context node. - */ -#define xmlXPathGetContextNode(ctxt) ((ctxt)->context->node) - -XMLPUBFUN int XMLCALL - xmlXPathPopBoolean (xmlXPathParserContextPtr ctxt); -XMLPUBFUN double XMLCALL - xmlXPathPopNumber (xmlXPathParserContextPtr ctxt); -XMLPUBFUN xmlChar * XMLCALL - xmlXPathPopString (xmlXPathParserContextPtr ctxt); -XMLPUBFUN xmlNodeSetPtr XMLCALL - xmlXPathPopNodeSet (xmlXPathParserContextPtr ctxt); -XMLPUBFUN void * XMLCALL - xmlXPathPopExternal (xmlXPathParserContextPtr ctxt); - -/** - * xmlXPathReturnBoolean: - * @ctxt: an XPath parser context - * @val: a boolean - * - * Pushes the boolean @val on the context stack. - */ -#define xmlXPathReturnBoolean(ctxt, val) \ - valuePush((ctxt), xmlXPathNewBoolean(val)) - -/** - * xmlXPathReturnTrue: - * @ctxt: an XPath parser context - * - * Pushes true on the context stack. - */ -#define xmlXPathReturnTrue(ctxt) xmlXPathReturnBoolean((ctxt), 1) - -/** - * xmlXPathReturnFalse: - * @ctxt: an XPath parser context - * - * Pushes false on the context stack. - */ -#define xmlXPathReturnFalse(ctxt) xmlXPathReturnBoolean((ctxt), 0) - -/** - * xmlXPathReturnNumber: - * @ctxt: an XPath parser context - * @val: a double - * - * Pushes the double @val on the context stack. - */ -#define xmlXPathReturnNumber(ctxt, val) \ - valuePush((ctxt), xmlXPathNewFloat(val)) - -/** - * xmlXPathReturnString: - * @ctxt: an XPath parser context - * @str: a string - * - * Pushes the string @str on the context stack. - */ -#define xmlXPathReturnString(ctxt, str) \ - valuePush((ctxt), xmlXPathWrapString(str)) - -/** - * xmlXPathReturnEmptyString: - * @ctxt: an XPath parser context - * - * Pushes an empty string on the stack. - */ -#define xmlXPathReturnEmptyString(ctxt) \ - valuePush((ctxt), xmlXPathNewCString("")) - -/** - * xmlXPathReturnNodeSet: - * @ctxt: an XPath parser context - * @ns: a node-set - * - * Pushes the node-set @ns on the context stack. - */ -#define xmlXPathReturnNodeSet(ctxt, ns) \ - valuePush((ctxt), xmlXPathWrapNodeSet(ns)) - -/** - * xmlXPathReturnEmptyNodeSet: - * @ctxt: an XPath parser context - * - * Pushes an empty node-set on the context stack. - */ -#define xmlXPathReturnEmptyNodeSet(ctxt) \ - valuePush((ctxt), xmlXPathNewNodeSet(NULL)) - -/** - * xmlXPathReturnExternal: - * @ctxt: an XPath parser context - * @val: user data - * - * Pushes user data on the context stack. - */ -#define xmlXPathReturnExternal(ctxt, val) \ - valuePush((ctxt), xmlXPathWrapExternal(val)) - -/** - * xmlXPathStackIsNodeSet: - * @ctxt: an XPath parser context - * - * Check if the current value on the XPath stack is a node set or - * an XSLT value tree. - * - * Returns true if the current object on the stack is a node-set. - */ -#define xmlXPathStackIsNodeSet(ctxt) \ - (((ctxt)->value != NULL) \ - && (((ctxt)->value->type == XPATH_NODESET) \ - || ((ctxt)->value->type == XPATH_XSLT_TREE))) - -/** - * xmlXPathStackIsExternal: - * @ctxt: an XPath parser context - * - * Checks if the current value on the XPath stack is an external - * object. - * - * Returns true if the current object on the stack is an external - * object. - */ -#define xmlXPathStackIsExternal(ctxt) \ - ((ctxt->value != NULL) && (ctxt->value->type == XPATH_USERS)) - -/** - * xmlXPathEmptyNodeSet: - * @ns: a node-set - * - * Empties a node-set. - */ -#define xmlXPathEmptyNodeSet(ns) \ - { while ((ns)->nodeNr > 0) (ns)->nodeTab[(ns)->nodeNr--] = NULL; } - -/** - * CHECK_ERROR: - * - * Macro to return from the function if an XPath error was detected. - */ -#define CHECK_ERROR \ - if (ctxt->error != XPATH_EXPRESSION_OK) return - -/** - * CHECK_ERROR0: - * - * Macro to return 0 from the function if an XPath error was detected. - */ -#define CHECK_ERROR0 \ - if (ctxt->error != XPATH_EXPRESSION_OK) return(0) - -/** - * XP_ERROR: - * @X: the error code - * - * Macro to raise an XPath error and return. - */ -#define XP_ERROR(X) \ - { xmlXPathErr(ctxt, X); return; } - -/** - * XP_ERROR0: - * @X: the error code - * - * Macro to raise an XPath error and return 0. - */ -#define XP_ERROR0(X) \ - { xmlXPathErr(ctxt, X); return(0); } - -/** - * CHECK_TYPE: - * @typeval: the XPath type - * - * Macro to check that the value on top of the XPath stack is of a given - * type. - */ -#define CHECK_TYPE(typeval) \ - if ((ctxt->value == NULL) || (ctxt->value->type != typeval)) \ - XP_ERROR(XPATH_INVALID_TYPE) - -/** - * CHECK_TYPE0: - * @typeval: the XPath type - * - * Macro to check that the value on top of the XPath stack is of a given - * type. Return(0) in case of failure - */ -#define CHECK_TYPE0(typeval) \ - if ((ctxt->value == NULL) || (ctxt->value->type != typeval)) \ - XP_ERROR0(XPATH_INVALID_TYPE) - -/** - * CHECK_ARITY: - * @x: the number of expected args - * - * Macro to check that the number of args passed to an XPath function matches. - */ -#define CHECK_ARITY(x) \ - if (ctxt == NULL) return; \ - if (nargs != (x)) \ - XP_ERROR(XPATH_INVALID_ARITY); \ - if (ctxt->valueNr < ctxt->valueFrame + (x)) \ - XP_ERROR(XPATH_STACK_ERROR); - -/** - * CAST_TO_STRING: - * - * Macro to try to cast the value on the top of the XPath stack to a string. - */ -#define CAST_TO_STRING \ - if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING)) \ - xmlXPathStringFunction(ctxt, 1); - -/** - * CAST_TO_NUMBER: - * - * Macro to try to cast the value on the top of the XPath stack to a number. - */ -#define CAST_TO_NUMBER \ - if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER)) \ - xmlXPathNumberFunction(ctxt, 1); - -/** - * CAST_TO_BOOLEAN: - * - * Macro to try to cast the value on the top of the XPath stack to a boolean. - */ -#define CAST_TO_BOOLEAN \ - if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_BOOLEAN)) \ - xmlXPathBooleanFunction(ctxt, 1); - -/* - * Variable Lookup forwarding. - */ - -XMLPUBFUN void XMLCALL - xmlXPathRegisterVariableLookup (xmlXPathContextPtr ctxt, - xmlXPathVariableLookupFunc f, - void *data); - -/* - * Function Lookup forwarding. - */ - -XMLPUBFUN void XMLCALL - xmlXPathRegisterFuncLookup (xmlXPathContextPtr ctxt, - xmlXPathFuncLookupFunc f, - void *funcCtxt); - -/* - * Error reporting. - */ -XMLPUBFUN void XMLCALL - xmlXPatherror (xmlXPathParserContextPtr ctxt, - const char *file, - int line, - int no); - -XMLPUBFUN void XMLCALL - xmlXPathErr (xmlXPathParserContextPtr ctxt, - int error); - -#ifdef LIBXML_DEBUG_ENABLED -XMLPUBFUN void XMLCALL - xmlXPathDebugDumpObject (FILE *output, - xmlXPathObjectPtr cur, - int depth); -XMLPUBFUN void XMLCALL - xmlXPathDebugDumpCompExpr(FILE *output, - xmlXPathCompExprPtr comp, - int depth); -#endif -/** - * NodeSet handling. - */ -XMLPUBFUN int XMLCALL - xmlXPathNodeSetContains (xmlNodeSetPtr cur, - xmlNodePtr val); -XMLPUBFUN xmlNodeSetPtr XMLCALL - xmlXPathDifference (xmlNodeSetPtr nodes1, - xmlNodeSetPtr nodes2); -XMLPUBFUN xmlNodeSetPtr XMLCALL - xmlXPathIntersection (xmlNodeSetPtr nodes1, - xmlNodeSetPtr nodes2); - -XMLPUBFUN xmlNodeSetPtr XMLCALL - xmlXPathDistinctSorted (xmlNodeSetPtr nodes); -XMLPUBFUN xmlNodeSetPtr XMLCALL - xmlXPathDistinct (xmlNodeSetPtr nodes); - -XMLPUBFUN int XMLCALL - xmlXPathHasSameNodes (xmlNodeSetPtr nodes1, - xmlNodeSetPtr nodes2); - -XMLPUBFUN xmlNodeSetPtr XMLCALL - xmlXPathNodeLeadingSorted (xmlNodeSetPtr nodes, - xmlNodePtr node); -XMLPUBFUN xmlNodeSetPtr XMLCALL - xmlXPathLeadingSorted (xmlNodeSetPtr nodes1, - xmlNodeSetPtr nodes2); -XMLPUBFUN xmlNodeSetPtr XMLCALL - xmlXPathNodeLeading (xmlNodeSetPtr nodes, - xmlNodePtr node); -XMLPUBFUN xmlNodeSetPtr XMLCALL - xmlXPathLeading (xmlNodeSetPtr nodes1, - xmlNodeSetPtr nodes2); - -XMLPUBFUN xmlNodeSetPtr XMLCALL - xmlXPathNodeTrailingSorted (xmlNodeSetPtr nodes, - xmlNodePtr node); -XMLPUBFUN xmlNodeSetPtr XMLCALL - xmlXPathTrailingSorted (xmlNodeSetPtr nodes1, - xmlNodeSetPtr nodes2); -XMLPUBFUN xmlNodeSetPtr XMLCALL - xmlXPathNodeTrailing (xmlNodeSetPtr nodes, - xmlNodePtr node); -XMLPUBFUN xmlNodeSetPtr XMLCALL - xmlXPathTrailing (xmlNodeSetPtr nodes1, - xmlNodeSetPtr nodes2); - - -/** - * Extending a context. - */ - -XMLPUBFUN int XMLCALL - xmlXPathRegisterNs (xmlXPathContextPtr ctxt, - const xmlChar *prefix, - const xmlChar *ns_uri); -XMLPUBFUN const xmlChar * XMLCALL - xmlXPathNsLookup (xmlXPathContextPtr ctxt, - const xmlChar *prefix); -XMLPUBFUN void XMLCALL - xmlXPathRegisteredNsCleanup (xmlXPathContextPtr ctxt); - -XMLPUBFUN int XMLCALL - xmlXPathRegisterFunc (xmlXPathContextPtr ctxt, - const xmlChar *name, - xmlXPathFunction f); -XMLPUBFUN int XMLCALL - xmlXPathRegisterFuncNS (xmlXPathContextPtr ctxt, - const xmlChar *name, - const xmlChar *ns_uri, - xmlXPathFunction f); -XMLPUBFUN int XMLCALL - xmlXPathRegisterVariable (xmlXPathContextPtr ctxt, - const xmlChar *name, - xmlXPathObjectPtr value); -XMLPUBFUN int XMLCALL - xmlXPathRegisterVariableNS (xmlXPathContextPtr ctxt, - const xmlChar *name, - const xmlChar *ns_uri, - xmlXPathObjectPtr value); -XMLPUBFUN xmlXPathFunction XMLCALL - xmlXPathFunctionLookup (xmlXPathContextPtr ctxt, - const xmlChar *name); -XMLPUBFUN xmlXPathFunction XMLCALL - xmlXPathFunctionLookupNS (xmlXPathContextPtr ctxt, - const xmlChar *name, - const xmlChar *ns_uri); -XMLPUBFUN void XMLCALL - xmlXPathRegisteredFuncsCleanup (xmlXPathContextPtr ctxt); -XMLPUBFUN xmlXPathObjectPtr XMLCALL - xmlXPathVariableLookup (xmlXPathContextPtr ctxt, - const xmlChar *name); -XMLPUBFUN xmlXPathObjectPtr XMLCALL - xmlXPathVariableLookupNS (xmlXPathContextPtr ctxt, - const xmlChar *name, - const xmlChar *ns_uri); -XMLPUBFUN void XMLCALL - xmlXPathRegisteredVariablesCleanup(xmlXPathContextPtr ctxt); - -/** - * Utilities to extend XPath. - */ -XMLPUBFUN xmlXPathParserContextPtr XMLCALL - xmlXPathNewParserContext (const xmlChar *str, - xmlXPathContextPtr ctxt); -XMLPUBFUN void XMLCALL - xmlXPathFreeParserContext (xmlXPathParserContextPtr ctxt); - -/* TODO: remap to xmlXPathValuePop and Push. */ -XMLPUBFUN xmlXPathObjectPtr XMLCALL - valuePop (xmlXPathParserContextPtr ctxt); -XMLPUBFUN int XMLCALL - valuePush (xmlXPathParserContextPtr ctxt, - xmlXPathObjectPtr value); - -XMLPUBFUN xmlXPathObjectPtr XMLCALL - xmlXPathNewString (const xmlChar *val); -XMLPUBFUN xmlXPathObjectPtr XMLCALL - xmlXPathNewCString (const char *val); -XMLPUBFUN xmlXPathObjectPtr XMLCALL - xmlXPathWrapString (xmlChar *val); -XMLPUBFUN xmlXPathObjectPtr XMLCALL - xmlXPathWrapCString (char * val); -XMLPUBFUN xmlXPathObjectPtr XMLCALL - xmlXPathNewFloat (double val); -XMLPUBFUN xmlXPathObjectPtr XMLCALL - xmlXPathNewBoolean (int val); -XMLPUBFUN xmlXPathObjectPtr XMLCALL - xmlXPathNewNodeSet (xmlNodePtr val); -XMLPUBFUN xmlXPathObjectPtr XMLCALL - xmlXPathNewValueTree (xmlNodePtr val); -XMLPUBFUN int XMLCALL - xmlXPathNodeSetAdd (xmlNodeSetPtr cur, - xmlNodePtr val); -XMLPUBFUN int XMLCALL - xmlXPathNodeSetAddUnique (xmlNodeSetPtr cur, - xmlNodePtr val); -XMLPUBFUN int XMLCALL - xmlXPathNodeSetAddNs (xmlNodeSetPtr cur, - xmlNodePtr node, - xmlNsPtr ns); -XMLPUBFUN void XMLCALL - xmlXPathNodeSetSort (xmlNodeSetPtr set); - -XMLPUBFUN void XMLCALL - xmlXPathRoot (xmlXPathParserContextPtr ctxt); -XMLPUBFUN void XMLCALL - xmlXPathEvalExpr (xmlXPathParserContextPtr ctxt); -XMLPUBFUN xmlChar * XMLCALL - xmlXPathParseName (xmlXPathParserContextPtr ctxt); -XMLPUBFUN xmlChar * XMLCALL - xmlXPathParseNCName (xmlXPathParserContextPtr ctxt); - -/* - * Existing functions. - */ -XMLPUBFUN double XMLCALL - xmlXPathStringEvalNumber (const xmlChar *str); -XMLPUBFUN int XMLCALL - xmlXPathEvaluatePredicateResult (xmlXPathParserContextPtr ctxt, - xmlXPathObjectPtr res); -XMLPUBFUN void XMLCALL - xmlXPathRegisterAllFunctions (xmlXPathContextPtr ctxt); -XMLPUBFUN xmlNodeSetPtr XMLCALL - xmlXPathNodeSetMerge (xmlNodeSetPtr val1, - xmlNodeSetPtr val2); -XMLPUBFUN void XMLCALL - xmlXPathNodeSetDel (xmlNodeSetPtr cur, - xmlNodePtr val); -XMLPUBFUN void XMLCALL - xmlXPathNodeSetRemove (xmlNodeSetPtr cur, - int val); -XMLPUBFUN xmlXPathObjectPtr XMLCALL - xmlXPathNewNodeSetList (xmlNodeSetPtr val); -XMLPUBFUN xmlXPathObjectPtr XMLCALL - xmlXPathWrapNodeSet (xmlNodeSetPtr val); -XMLPUBFUN xmlXPathObjectPtr XMLCALL - xmlXPathWrapExternal (void *val); - -XMLPUBFUN int XMLCALL xmlXPathEqualValues(xmlXPathParserContextPtr ctxt); -XMLPUBFUN int XMLCALL xmlXPathNotEqualValues(xmlXPathParserContextPtr ctxt); -XMLPUBFUN int XMLCALL xmlXPathCompareValues(xmlXPathParserContextPtr ctxt, int inf, int strict); -XMLPUBFUN void XMLCALL xmlXPathValueFlipSign(xmlXPathParserContextPtr ctxt); -XMLPUBFUN void XMLCALL xmlXPathAddValues(xmlXPathParserContextPtr ctxt); -XMLPUBFUN void XMLCALL xmlXPathSubValues(xmlXPathParserContextPtr ctxt); -XMLPUBFUN void XMLCALL xmlXPathMultValues(xmlXPathParserContextPtr ctxt); -XMLPUBFUN void XMLCALL xmlXPathDivValues(xmlXPathParserContextPtr ctxt); -XMLPUBFUN void XMLCALL xmlXPathModValues(xmlXPathParserContextPtr ctxt); - -XMLPUBFUN int XMLCALL xmlXPathIsNodeType(const xmlChar *name); - -/* - * Some of the axis navigation routines. - */ -XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextSelf(xmlXPathParserContextPtr ctxt, - xmlNodePtr cur); -XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextChild(xmlXPathParserContextPtr ctxt, - xmlNodePtr cur); -XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextDescendant(xmlXPathParserContextPtr ctxt, - xmlNodePtr cur); -XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextDescendantOrSelf(xmlXPathParserContextPtr ctxt, - xmlNodePtr cur); -XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextParent(xmlXPathParserContextPtr ctxt, - xmlNodePtr cur); -XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextAncestorOrSelf(xmlXPathParserContextPtr ctxt, - xmlNodePtr cur); -XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextFollowingSibling(xmlXPathParserContextPtr ctxt, - xmlNodePtr cur); -XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextFollowing(xmlXPathParserContextPtr ctxt, - xmlNodePtr cur); -XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextNamespace(xmlXPathParserContextPtr ctxt, - xmlNodePtr cur); -XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextAttribute(xmlXPathParserContextPtr ctxt, - xmlNodePtr cur); -XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextPreceding(xmlXPathParserContextPtr ctxt, - xmlNodePtr cur); -XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextAncestor(xmlXPathParserContextPtr ctxt, - xmlNodePtr cur); -XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextPrecedingSibling(xmlXPathParserContextPtr ctxt, - xmlNodePtr cur); -/* - * The official core of XPath functions. - */ -XMLPUBFUN void XMLCALL xmlXPathLastFunction(xmlXPathParserContextPtr ctxt, int nargs); -XMLPUBFUN void XMLCALL xmlXPathPositionFunction(xmlXPathParserContextPtr ctxt, int nargs); -XMLPUBFUN void XMLCALL xmlXPathCountFunction(xmlXPathParserContextPtr ctxt, int nargs); -XMLPUBFUN void XMLCALL xmlXPathIdFunction(xmlXPathParserContextPtr ctxt, int nargs); -XMLPUBFUN void XMLCALL xmlXPathLocalNameFunction(xmlXPathParserContextPtr ctxt, int nargs); -XMLPUBFUN void XMLCALL xmlXPathNamespaceURIFunction(xmlXPathParserContextPtr ctxt, int nargs); -XMLPUBFUN void XMLCALL xmlXPathStringFunction(xmlXPathParserContextPtr ctxt, int nargs); -XMLPUBFUN void XMLCALL xmlXPathStringLengthFunction(xmlXPathParserContextPtr ctxt, int nargs); -XMLPUBFUN void XMLCALL xmlXPathConcatFunction(xmlXPathParserContextPtr ctxt, int nargs); -XMLPUBFUN void XMLCALL xmlXPathContainsFunction(xmlXPathParserContextPtr ctxt, int nargs); -XMLPUBFUN void XMLCALL xmlXPathStartsWithFunction(xmlXPathParserContextPtr ctxt, int nargs); -XMLPUBFUN void XMLCALL xmlXPathSubstringFunction(xmlXPathParserContextPtr ctxt, int nargs); -XMLPUBFUN void XMLCALL xmlXPathSubstringBeforeFunction(xmlXPathParserContextPtr ctxt, int nargs); -XMLPUBFUN void XMLCALL xmlXPathSubstringAfterFunction(xmlXPathParserContextPtr ctxt, int nargs); -XMLPUBFUN void XMLCALL xmlXPathNormalizeFunction(xmlXPathParserContextPtr ctxt, int nargs); -XMLPUBFUN void XMLCALL xmlXPathTranslateFunction(xmlXPathParserContextPtr ctxt, int nargs); -XMLPUBFUN void XMLCALL xmlXPathNotFunction(xmlXPathParserContextPtr ctxt, int nargs); -XMLPUBFUN void XMLCALL xmlXPathTrueFunction(xmlXPathParserContextPtr ctxt, int nargs); -XMLPUBFUN void XMLCALL xmlXPathFalseFunction(xmlXPathParserContextPtr ctxt, int nargs); -XMLPUBFUN void XMLCALL xmlXPathLangFunction(xmlXPathParserContextPtr ctxt, int nargs); -XMLPUBFUN void XMLCALL xmlXPathNumberFunction(xmlXPathParserContextPtr ctxt, int nargs); -XMLPUBFUN void XMLCALL xmlXPathSumFunction(xmlXPathParserContextPtr ctxt, int nargs); -XMLPUBFUN void XMLCALL xmlXPathFloorFunction(xmlXPathParserContextPtr ctxt, int nargs); -XMLPUBFUN void XMLCALL xmlXPathCeilingFunction(xmlXPathParserContextPtr ctxt, int nargs); -XMLPUBFUN void XMLCALL xmlXPathRoundFunction(xmlXPathParserContextPtr ctxt, int nargs); -XMLPUBFUN void XMLCALL xmlXPathBooleanFunction(xmlXPathParserContextPtr ctxt, int nargs); - -/** - * Really internal functions - */ -XMLPUBFUN void XMLCALL xmlXPathNodeSetFreeNs(xmlNsPtr ns); - -#ifdef __cplusplus -} -#endif - -#endif /* LIBXML_XPATH_ENABLED */ -#endif /* ! __XML_XPATH_INTERNALS_H__ */ diff --git a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/xpointer.h b/cocos2dx/platform/third_party/emscripten/libxml2/libxml/xpointer.h deleted file mode 100644 index b99112b87a..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libxml2/libxml/xpointer.h +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Summary: API to handle XML Pointers - * Description: API to handle XML Pointers - * Base implementation was made accordingly to - * W3C Candidate Recommendation 7 June 2000 - * http://www.w3.org/TR/2000/CR-xptr-20000607 - * - * Added support for the element() scheme described in: - * W3C Proposed Recommendation 13 November 2002 - * http://www.w3.org/TR/2002/PR-xptr-element-20021113/ - * - * Copy: See Copyright for the status of this software. - * - * Author: Daniel Veillard - */ - -#ifndef __XML_XPTR_H__ -#define __XML_XPTR_H__ - -#include - -#ifdef LIBXML_XPTR_ENABLED - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * A Location Set - */ -typedef struct _xmlLocationSet xmlLocationSet; -typedef xmlLocationSet *xmlLocationSetPtr; -struct _xmlLocationSet { - int locNr; /* number of locations in the set */ - int locMax; /* size of the array as allocated */ - xmlXPathObjectPtr *locTab;/* array of locations */ -}; - -/* - * Handling of location sets. - */ - -XMLPUBFUN xmlLocationSetPtr XMLCALL - xmlXPtrLocationSetCreate (xmlXPathObjectPtr val); -XMLPUBFUN void XMLCALL - xmlXPtrFreeLocationSet (xmlLocationSetPtr obj); -XMLPUBFUN xmlLocationSetPtr XMLCALL - xmlXPtrLocationSetMerge (xmlLocationSetPtr val1, - xmlLocationSetPtr val2); -XMLPUBFUN xmlXPathObjectPtr XMLCALL - xmlXPtrNewRange (xmlNodePtr start, - int startindex, - xmlNodePtr end, - int endindex); -XMLPUBFUN xmlXPathObjectPtr XMLCALL - xmlXPtrNewRangePoints (xmlXPathObjectPtr start, - xmlXPathObjectPtr end); -XMLPUBFUN xmlXPathObjectPtr XMLCALL - xmlXPtrNewRangeNodePoint (xmlNodePtr start, - xmlXPathObjectPtr end); -XMLPUBFUN xmlXPathObjectPtr XMLCALL - xmlXPtrNewRangePointNode (xmlXPathObjectPtr start, - xmlNodePtr end); -XMLPUBFUN xmlXPathObjectPtr XMLCALL - xmlXPtrNewRangeNodes (xmlNodePtr start, - xmlNodePtr end); -XMLPUBFUN xmlXPathObjectPtr XMLCALL - xmlXPtrNewLocationSetNodes (xmlNodePtr start, - xmlNodePtr end); -XMLPUBFUN xmlXPathObjectPtr XMLCALL - xmlXPtrNewLocationSetNodeSet(xmlNodeSetPtr set); -XMLPUBFUN xmlXPathObjectPtr XMLCALL - xmlXPtrNewRangeNodeObject (xmlNodePtr start, - xmlXPathObjectPtr end); -XMLPUBFUN xmlXPathObjectPtr XMLCALL - xmlXPtrNewCollapsedRange (xmlNodePtr start); -XMLPUBFUN void XMLCALL - xmlXPtrLocationSetAdd (xmlLocationSetPtr cur, - xmlXPathObjectPtr val); -XMLPUBFUN xmlXPathObjectPtr XMLCALL - xmlXPtrWrapLocationSet (xmlLocationSetPtr val); -XMLPUBFUN void XMLCALL - xmlXPtrLocationSetDel (xmlLocationSetPtr cur, - xmlXPathObjectPtr val); -XMLPUBFUN void XMLCALL - xmlXPtrLocationSetRemove (xmlLocationSetPtr cur, - int val); - -/* - * Functions. - */ -XMLPUBFUN xmlXPathContextPtr XMLCALL - xmlXPtrNewContext (xmlDocPtr doc, - xmlNodePtr here, - xmlNodePtr origin); -XMLPUBFUN xmlXPathObjectPtr XMLCALL - xmlXPtrEval (const xmlChar *str, - xmlXPathContextPtr ctx); -XMLPUBFUN void XMLCALL - xmlXPtrRangeToFunction (xmlXPathParserContextPtr ctxt, - int nargs); -XMLPUBFUN xmlNodePtr XMLCALL - xmlXPtrBuildNodeList (xmlXPathObjectPtr obj); -XMLPUBFUN void XMLCALL - xmlXPtrEvalRangePredicate (xmlXPathParserContextPtr ctxt); -#ifdef __cplusplus -} -#endif - -#endif /* LIBXML_XPTR_ENABLED */ -#endif /* __XML_XPTR_H__ */ diff --git a/cocos2dx/platform/third_party/emscripten/libz/zconf.h b/cocos2dx/platform/third_party/emscripten/libz/zconf.h deleted file mode 100644 index 996fff2921..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libz/zconf.h +++ /dev/null @@ -1,511 +0,0 @@ -/* zconf.h -- configuration of the zlib compression library - * Copyright (C) 1995-2013 Jean-loup Gailly. - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* @(#) $Id$ */ - -#ifndef ZCONF_H -#define ZCONF_H - -/* - * If you *really* need a unique prefix for all types and library functions, - * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. - * Even better than compiling with -DZ_PREFIX would be to use configure to set - * this permanently in zconf.h using "./configure --zprefix". - */ -#ifdef Z_PREFIX /* may be set to #if 1 by ./configure */ -# define Z_PREFIX_SET - -/* all linked symbols */ -# define _dist_code z__dist_code -# define _length_code z__length_code -# define _tr_align z__tr_align -# define _tr_flush_bits z__tr_flush_bits -# define _tr_flush_block z__tr_flush_block -# define _tr_init z__tr_init -# define _tr_stored_block z__tr_stored_block -# define _tr_tally z__tr_tally -# define adler32 z_adler32 -# define adler32_combine z_adler32_combine -# define adler32_combine64 z_adler32_combine64 -# ifndef Z_SOLO -# define compress z_compress -# define compress2 z_compress2 -# define compressBound z_compressBound -# endif -# define crc32 z_crc32 -# define crc32_combine z_crc32_combine -# define crc32_combine64 z_crc32_combine64 -# define deflate z_deflate -# define deflateBound z_deflateBound -# define deflateCopy z_deflateCopy -# define deflateEnd z_deflateEnd -# define deflateInit2_ z_deflateInit2_ -# define deflateInit_ z_deflateInit_ -# define deflateParams z_deflateParams -# define deflatePending z_deflatePending -# define deflatePrime z_deflatePrime -# define deflateReset z_deflateReset -# define deflateResetKeep z_deflateResetKeep -# define deflateSetDictionary z_deflateSetDictionary -# define deflateSetHeader z_deflateSetHeader -# define deflateTune z_deflateTune -# define deflate_copyright z_deflate_copyright -# define get_crc_table z_get_crc_table -# ifndef Z_SOLO -# define gz_error z_gz_error -# define gz_intmax z_gz_intmax -# define gz_strwinerror z_gz_strwinerror -# define gzbuffer z_gzbuffer -# define gzclearerr z_gzclearerr -# define gzclose z_gzclose -# define gzclose_r z_gzclose_r -# define gzclose_w z_gzclose_w -# define gzdirect z_gzdirect -# define gzdopen z_gzdopen -# define gzeof z_gzeof -# define gzerror z_gzerror -# define gzflush z_gzflush -# define gzgetc z_gzgetc -# define gzgetc_ z_gzgetc_ -# define gzgets z_gzgets -# define gzoffset z_gzoffset -# define gzoffset64 z_gzoffset64 -# define gzopen z_gzopen -# define gzopen64 z_gzopen64 -# ifdef _WIN32 -# define gzopen_w z_gzopen_w -# endif -# define gzprintf z_gzprintf -# define gzvprintf z_gzvprintf -# define gzputc z_gzputc -# define gzputs z_gzputs -# define gzread z_gzread -# define gzrewind z_gzrewind -# define gzseek z_gzseek -# define gzseek64 z_gzseek64 -# define gzsetparams z_gzsetparams -# define gztell z_gztell -# define gztell64 z_gztell64 -# define gzungetc z_gzungetc -# define gzwrite z_gzwrite -# endif -# define inflate z_inflate -# define inflateBack z_inflateBack -# define inflateBackEnd z_inflateBackEnd -# define inflateBackInit_ z_inflateBackInit_ -# define inflateCopy z_inflateCopy -# define inflateEnd z_inflateEnd -# define inflateGetHeader z_inflateGetHeader -# define inflateInit2_ z_inflateInit2_ -# define inflateInit_ z_inflateInit_ -# define inflateMark z_inflateMark -# define inflatePrime z_inflatePrime -# define inflateReset z_inflateReset -# define inflateReset2 z_inflateReset2 -# define inflateSetDictionary z_inflateSetDictionary -# define inflateGetDictionary z_inflateGetDictionary -# define inflateSync z_inflateSync -# define inflateSyncPoint z_inflateSyncPoint -# define inflateUndermine z_inflateUndermine -# define inflateResetKeep z_inflateResetKeep -# define inflate_copyright z_inflate_copyright -# define inflate_fast z_inflate_fast -# define inflate_table z_inflate_table -# ifndef Z_SOLO -# define uncompress z_uncompress -# endif -# define zError z_zError -# ifndef Z_SOLO -# define zcalloc z_zcalloc -# define zcfree z_zcfree -# endif -# define zlibCompileFlags z_zlibCompileFlags -# define zlibVersion z_zlibVersion - -/* all zlib typedefs in zlib.h and zconf.h */ -# define Byte z_Byte -# define Bytef z_Bytef -# define alloc_func z_alloc_func -# define charf z_charf -# define free_func z_free_func -# ifndef Z_SOLO -# define gzFile z_gzFile -# endif -# define gz_header z_gz_header -# define gz_headerp z_gz_headerp -# define in_func z_in_func -# define intf z_intf -# define out_func z_out_func -# define uInt z_uInt -# define uIntf z_uIntf -# define uLong z_uLong -# define uLongf z_uLongf -# define voidp z_voidp -# define voidpc z_voidpc -# define voidpf z_voidpf - -/* all zlib structs in zlib.h and zconf.h */ -# define gz_header_s z_gz_header_s -# define internal_state z_internal_state - -#endif - -#if defined(__MSDOS__) && !defined(MSDOS) -# define MSDOS -#endif -#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2) -# define OS2 -#endif -#if defined(_WINDOWS) && !defined(WINDOWS) -# define WINDOWS -#endif -#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__) -# ifndef WIN32 -# define WIN32 -# endif -#endif -#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32) -# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__) -# ifndef SYS16BIT -# define SYS16BIT -# endif -# endif -#endif - -/* - * Compile with -DMAXSEG_64K if the alloc function cannot allocate more - * than 64k bytes at a time (needed on systems with 16-bit int). - */ -#ifdef SYS16BIT -# define MAXSEG_64K -#endif -#ifdef MSDOS -# define UNALIGNED_OK -#endif - -#ifdef __STDC_VERSION__ -# ifndef STDC -# define STDC -# endif -# if __STDC_VERSION__ >= 199901L -# ifndef STDC99 -# define STDC99 -# endif -# endif -#endif -#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus)) -# define STDC -#endif -#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__)) -# define STDC -#endif -#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32)) -# define STDC -#endif -#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__)) -# define STDC -#endif - -#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */ -# define STDC -#endif - -#ifndef STDC -# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ -# define const /* note: need a more gentle solution here */ -# endif -#endif - -#if defined(ZLIB_CONST) && !defined(z_const) -# define z_const const -#else -# define z_const -#endif - -/* Some Mac compilers merge all .h files incorrectly: */ -#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__) -# define NO_DUMMY_DECL -#endif - -/* Maximum value for memLevel in deflateInit2 */ -#ifndef MAX_MEM_LEVEL -# ifdef MAXSEG_64K -# define MAX_MEM_LEVEL 8 -# else -# define MAX_MEM_LEVEL 9 -# endif -#endif - -/* Maximum value for windowBits in deflateInit2 and inflateInit2. - * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files - * created by gzip. (Files created by minigzip can still be extracted by - * gzip.) - */ -#ifndef MAX_WBITS -# define MAX_WBITS 15 /* 32K LZ77 window */ -#endif - -/* The memory requirements for deflate are (in bytes): - (1 << (windowBits+2)) + (1 << (memLevel+9)) - that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) - plus a few kilobytes for small objects. For example, if you want to reduce - the default memory requirements from 256K to 128K, compile with - make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" - Of course this will generally degrade compression (there's no free lunch). - - The memory requirements for inflate are (in bytes) 1 << windowBits - that is, 32K for windowBits=15 (default value) plus a few kilobytes - for small objects. -*/ - - /* Type declarations */ - -#ifndef OF /* function prototypes */ -# ifdef STDC -# define OF(args) args -# else -# define OF(args) () -# endif -#endif - -#ifndef Z_ARG /* function prototypes for stdarg */ -# if defined(STDC) || defined(Z_HAVE_STDARG_H) -# define Z_ARG(args) args -# else -# define Z_ARG(args) () -# endif -#endif - -/* The following definitions for FAR are needed only for MSDOS mixed - * model programming (small or medium model with some far allocations). - * This was tested only with MSC; for other MSDOS compilers you may have - * to define NO_MEMCPY in zutil.h. If you don't need the mixed model, - * just define FAR to be empty. - */ -#ifdef SYS16BIT -# if defined(M_I86SM) || defined(M_I86MM) - /* MSC small or medium model */ -# define SMALL_MEDIUM -# ifdef _MSC_VER -# define FAR _far -# else -# define FAR far -# endif -# endif -# if (defined(__SMALL__) || defined(__MEDIUM__)) - /* Turbo C small or medium model */ -# define SMALL_MEDIUM -# ifdef __BORLANDC__ -# define FAR _far -# else -# define FAR far -# endif -# endif -#endif - -#if defined(WINDOWS) || defined(WIN32) - /* If building or using zlib as a DLL, define ZLIB_DLL. - * This is not mandatory, but it offers a little performance increase. - */ -# ifdef ZLIB_DLL -# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500)) -# ifdef ZLIB_INTERNAL -# define ZEXTERN extern __declspec(dllexport) -# else -# define ZEXTERN extern __declspec(dllimport) -# endif -# endif -# endif /* ZLIB_DLL */ - /* If building or using zlib with the WINAPI/WINAPIV calling convention, - * define ZLIB_WINAPI. - * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI. - */ -# ifdef ZLIB_WINAPI -# ifdef FAR -# undef FAR -# endif -# include - /* No need for _export, use ZLIB.DEF instead. */ - /* For complete Windows compatibility, use WINAPI, not __stdcall. */ -# define ZEXPORT WINAPI -# ifdef WIN32 -# define ZEXPORTVA WINAPIV -# else -# define ZEXPORTVA FAR CDECL -# endif -# endif -#endif - -#if defined (__BEOS__) -# ifdef ZLIB_DLL -# ifdef ZLIB_INTERNAL -# define ZEXPORT __declspec(dllexport) -# define ZEXPORTVA __declspec(dllexport) -# else -# define ZEXPORT __declspec(dllimport) -# define ZEXPORTVA __declspec(dllimport) -# endif -# endif -#endif - -#ifndef ZEXTERN -# define ZEXTERN extern -#endif -#ifndef ZEXPORT -# define ZEXPORT -#endif -#ifndef ZEXPORTVA -# define ZEXPORTVA -#endif - -#ifndef FAR -# define FAR -#endif - -#if !defined(__MACTYPES__) -typedef unsigned char Byte; /* 8 bits */ -#endif -typedef unsigned int uInt; /* 16 bits or more */ -typedef unsigned long uLong; /* 32 bits or more */ - -#ifdef SMALL_MEDIUM - /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ -# define Bytef Byte FAR -#else - typedef Byte FAR Bytef; -#endif -typedef char FAR charf; -typedef int FAR intf; -typedef uInt FAR uIntf; -typedef uLong FAR uLongf; - -#ifdef STDC - typedef void const *voidpc; - typedef void FAR *voidpf; - typedef void *voidp; -#else - typedef Byte const *voidpc; - typedef Byte FAR *voidpf; - typedef Byte *voidp; -#endif - -#if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC) -# include -# if (UINT_MAX == 0xffffffffUL) -# define Z_U4 unsigned -# elif (ULONG_MAX == 0xffffffffUL) -# define Z_U4 unsigned long -# elif (USHRT_MAX == 0xffffffffUL) -# define Z_U4 unsigned short -# endif -#endif - -#ifdef Z_U4 - typedef Z_U4 z_crc_t; -#else - typedef unsigned long z_crc_t; -#endif - -#if 1 /* was set to #if 1 by ./configure */ -# define Z_HAVE_UNISTD_H -#endif - -#if 1 /* was set to #if 1 by ./configure */ -# define Z_HAVE_STDARG_H -#endif - -#ifdef STDC -# ifndef Z_SOLO -# include /* for off_t */ -# endif -#endif - -#if defined(STDC) || defined(Z_HAVE_STDARG_H) -# ifndef Z_SOLO -# include /* for va_list */ -# endif -#endif - -#ifdef _WIN32 -# ifndef Z_SOLO -# include /* for wchar_t */ -# endif -#endif - -/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and - * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even - * though the former does not conform to the LFS document), but considering - * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as - * equivalently requesting no 64-bit operations - */ -#if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1 -# undef _LARGEFILE64_SOURCE -#endif - -#if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H) -# define Z_HAVE_UNISTD_H -#endif -#ifndef Z_SOLO -# if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE) -# include /* for SEEK_*, off_t, and _LFS64_LARGEFILE */ -# ifdef VMS -# include /* for off_t */ -# endif -# ifndef z_off_t -# define z_off_t off_t -# endif -# endif -#endif - -#if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0 -# define Z_LFS64 -#endif - -#if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64) -# define Z_LARGE64 -#endif - -#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64) -# define Z_WANT64 -#endif - -#if !defined(SEEK_SET) && !defined(Z_SOLO) -# define SEEK_SET 0 /* Seek from beginning of file. */ -# define SEEK_CUR 1 /* Seek from current position. */ -# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ -#endif - -#ifndef z_off_t -# define z_off_t long -#endif - -#if !defined(_WIN32) && defined(Z_LARGE64) -# define z_off64_t off64_t -#else -# if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO) -# define z_off64_t __int64 -# else -# define z_off64_t z_off_t -# endif -#endif - -/* MVS linker does not support external names larger than 8 bytes */ -#if defined(__MVS__) - #pragma map(deflateInit_,"DEIN") - #pragma map(deflateInit2_,"DEIN2") - #pragma map(deflateEnd,"DEEND") - #pragma map(deflateBound,"DEBND") - #pragma map(inflateInit_,"ININ") - #pragma map(inflateInit2_,"ININ2") - #pragma map(inflateEnd,"INEND") - #pragma map(inflateSync,"INSY") - #pragma map(inflateSetDictionary,"INSEDI") - #pragma map(compressBound,"CMBND") - #pragma map(inflate_table,"INTABL") - #pragma map(inflate_fast,"INFA") - #pragma map(inflate_copyright,"INCOPY") -#endif - -#endif /* ZCONF_H */ diff --git a/cocos2dx/platform/third_party/emscripten/libz/zlib.h b/cocos2dx/platform/third_party/emscripten/libz/zlib.h deleted file mode 100644 index 3e0c7672ac..0000000000 --- a/cocos2dx/platform/third_party/emscripten/libz/zlib.h +++ /dev/null @@ -1,1768 +0,0 @@ -/* zlib.h -- interface of the 'zlib' general purpose compression library - version 1.2.8, April 28th, 2013 - - Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - Jean-loup Gailly Mark Adler - jloup@gzip.org madler@alumni.caltech.edu - - - The data format used by the zlib library is described by RFCs (Request for - Comments) 1950 to 1952 in the files http://tools.ietf.org/html/rfc1950 - (zlib format), rfc1951 (deflate format) and rfc1952 (gzip format). -*/ - -#ifndef ZLIB_H -#define ZLIB_H - -#include "zconf.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define ZLIB_VERSION "1.2.8" -#define ZLIB_VERNUM 0x1280 -#define ZLIB_VER_MAJOR 1 -#define ZLIB_VER_MINOR 2 -#define ZLIB_VER_REVISION 8 -#define ZLIB_VER_SUBREVISION 0 - -/* - The 'zlib' compression library provides in-memory compression and - decompression functions, including integrity checks of the uncompressed data. - This version of the library supports only one compression method (deflation) - but other algorithms will be added later and will have the same stream - interface. - - Compression can be done in a single step if the buffers are large enough, - or can be done by repeated calls of the compression function. In the latter - case, the application must provide more input and/or consume the output - (providing more output space) before each call. - - The compressed data format used by default by the in-memory functions is - the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped - around a deflate stream, which is itself documented in RFC 1951. - - The library also supports reading and writing files in gzip (.gz) format - with an interface similar to that of stdio using the functions that start - with "gz". The gzip format is different from the zlib format. gzip is a - gzip wrapper, documented in RFC 1952, wrapped around a deflate stream. - - This library can optionally read and write gzip streams in memory as well. - - The zlib format was designed to be compact and fast for use in memory - and on communications channels. The gzip format was designed for single- - file compression on file systems, has a larger header than zlib to maintain - directory information, and uses a different, slower check method than zlib. - - The library does not install any signal handler. The decoder checks - the consistency of the compressed data, so the library should never crash - even in case of corrupted input. -*/ - -typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size)); -typedef void (*free_func) OF((voidpf opaque, voidpf address)); - -struct internal_state; - -typedef struct z_stream_s { - z_const Bytef *next_in; /* next input byte */ - uInt avail_in; /* number of bytes available at next_in */ - uLong total_in; /* total number of input bytes read so far */ - - Bytef *next_out; /* next output byte should be put there */ - uInt avail_out; /* remaining free space at next_out */ - uLong total_out; /* total number of bytes output so far */ - - z_const char *msg; /* last error message, NULL if no error */ - struct internal_state FAR *state; /* not visible by applications */ - - alloc_func zalloc; /* used to allocate the internal state */ - free_func zfree; /* used to free the internal state */ - voidpf opaque; /* private data object passed to zalloc and zfree */ - - int data_type; /* best guess about the data type: binary or text */ - uLong adler; /* adler32 value of the uncompressed data */ - uLong reserved; /* reserved for future use */ -} z_stream; - -typedef z_stream FAR *z_streamp; - -/* - gzip header information passed to and from zlib routines. See RFC 1952 - for more details on the meanings of these fields. -*/ -typedef struct gz_header_s { - int text; /* true if compressed data believed to be text */ - uLong time; /* modification time */ - int xflags; /* extra flags (not used when writing a gzip file) */ - int os; /* operating system */ - Bytef *extra; /* pointer to extra field or Z_NULL if none */ - uInt extra_len; /* extra field length (valid if extra != Z_NULL) */ - uInt extra_max; /* space at extra (only when reading header) */ - Bytef *name; /* pointer to zero-terminated file name or Z_NULL */ - uInt name_max; /* space at name (only when reading header) */ - Bytef *comment; /* pointer to zero-terminated comment or Z_NULL */ - uInt comm_max; /* space at comment (only when reading header) */ - int hcrc; /* true if there was or will be a header crc */ - int done; /* true when done reading gzip header (not used - when writing a gzip file) */ -} gz_header; - -typedef gz_header FAR *gz_headerp; - -/* - The application must update next_in and avail_in when avail_in has dropped - to zero. It must update next_out and avail_out when avail_out has dropped - to zero. The application must initialize zalloc, zfree and opaque before - calling the init function. All other fields are set by the compression - library and must not be updated by the application. - - The opaque value provided by the application will be passed as the first - parameter for calls of zalloc and zfree. This can be useful for custom - memory management. The compression library attaches no meaning to the - opaque value. - - zalloc must return Z_NULL if there is not enough memory for the object. - If zlib is used in a multi-threaded application, zalloc and zfree must be - thread safe. - - On 16-bit systems, the functions zalloc and zfree must be able to allocate - exactly 65536 bytes, but will not be required to allocate more than this if - the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS, pointers - returned by zalloc for objects of exactly 65536 bytes *must* have their - offset normalized to zero. The default allocation function provided by this - library ensures this (see zutil.c). To reduce memory requirements and avoid - any allocation of 64K objects, at the expense of compression ratio, compile - the library with -DMAX_WBITS=14 (see zconf.h). - - The fields total_in and total_out can be used for statistics or progress - reports. After compression, total_in holds the total size of the - uncompressed data and may be saved for use in the decompressor (particularly - if the decompressor wants to decompress everything in a single step). -*/ - - /* constants */ - -#define Z_NO_FLUSH 0 -#define Z_PARTIAL_FLUSH 1 -#define Z_SYNC_FLUSH 2 -#define Z_FULL_FLUSH 3 -#define Z_FINISH 4 -#define Z_BLOCK 5 -#define Z_TREES 6 -/* Allowed flush values; see deflate() and inflate() below for details */ - -#define Z_OK 0 -#define Z_STREAM_END 1 -#define Z_NEED_DICT 2 -#define Z_ERRNO (-1) -#define Z_STREAM_ERROR (-2) -#define Z_DATA_ERROR (-3) -#define Z_MEM_ERROR (-4) -#define Z_BUF_ERROR (-5) -#define Z_VERSION_ERROR (-6) -/* Return codes for the compression/decompression functions. Negative values - * are errors, positive values are used for special but normal events. - */ - -#define Z_NO_COMPRESSION 0 -#define Z_BEST_SPEED 1 -#define Z_BEST_COMPRESSION 9 -#define Z_DEFAULT_COMPRESSION (-1) -/* compression levels */ - -#define Z_FILTERED 1 -#define Z_HUFFMAN_ONLY 2 -#define Z_RLE 3 -#define Z_FIXED 4 -#define Z_DEFAULT_STRATEGY 0 -/* compression strategy; see deflateInit2() below for details */ - -#define Z_BINARY 0 -#define Z_TEXT 1 -#define Z_ASCII Z_TEXT /* for compatibility with 1.2.2 and earlier */ -#define Z_UNKNOWN 2 -/* Possible values of the data_type field (though see inflate()) */ - -#define Z_DEFLATED 8 -/* The deflate compression method (the only one supported in this version) */ - -#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */ - -#define zlib_version zlibVersion() -/* for compatibility with versions < 1.0.2 */ - - - /* basic functions */ - -ZEXTERN const char * ZEXPORT zlibVersion OF((void)); -/* The application can compare zlibVersion and ZLIB_VERSION for consistency. - If the first character differs, the library code actually used is not - compatible with the zlib.h header file used by the application. This check - is automatically made by deflateInit and inflateInit. - */ - -/* -ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level)); - - Initializes the internal stream state for compression. The fields - zalloc, zfree and opaque must be initialized before by the caller. If - zalloc and zfree are set to Z_NULL, deflateInit updates them to use default - allocation functions. - - The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9: - 1 gives best speed, 9 gives best compression, 0 gives no compression at all - (the input data is simply copied a block at a time). Z_DEFAULT_COMPRESSION - requests a default compromise between speed and compression (currently - equivalent to level 6). - - deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_STREAM_ERROR if level is not a valid compression level, or - Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible - with the version assumed by the caller (ZLIB_VERSION). msg is set to null - if there is no error message. deflateInit does not perform any compression: - this will be done by deflate(). -*/ - - -ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); -/* - deflate compresses as much data as possible, and stops when the input - buffer becomes empty or the output buffer becomes full. It may introduce - some output latency (reading input without producing any output) except when - forced to flush. - - The detailed semantics are as follows. deflate performs one or both of the - following actions: - - - Compress more input starting at next_in and update next_in and avail_in - accordingly. If not all input can be processed (because there is not - enough room in the output buffer), next_in and avail_in are updated and - processing will resume at this point for the next call of deflate(). - - - Provide more output starting at next_out and update next_out and avail_out - accordingly. This action is forced if the parameter flush is non zero. - Forcing flush frequently degrades the compression ratio, so this parameter - should be set only when necessary (in interactive applications). Some - output may be provided even if flush is not set. - - Before the call of deflate(), the application should ensure that at least - one of the actions is possible, by providing more input and/or consuming more - output, and updating avail_in or avail_out accordingly; avail_out should - never be zero before the call. The application can consume the compressed - output when it wants, for example when the output buffer is full (avail_out - == 0), or after each call of deflate(). If deflate returns Z_OK and with - zero avail_out, it must be called again after making room in the output - buffer because there might be more output pending. - - Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to - decide how much data to accumulate before producing output, in order to - maximize compression. - - If the parameter flush is set to Z_SYNC_FLUSH, all pending output is - flushed to the output buffer and the output is aligned on a byte boundary, so - that the decompressor can get all input data available so far. (In - particular avail_in is zero after the call if enough output space has been - provided before the call.) Flushing may degrade compression for some - compression algorithms and so it should be used only when necessary. This - completes the current deflate block and follows it with an empty stored block - that is three bits plus filler bits to the next byte, followed by four bytes - (00 00 ff ff). - - If flush is set to Z_PARTIAL_FLUSH, all pending output is flushed to the - output buffer, but the output is not aligned to a byte boundary. All of the - input data so far will be available to the decompressor, as for Z_SYNC_FLUSH. - This completes the current deflate block and follows it with an empty fixed - codes block that is 10 bits long. This assures that enough bytes are output - in order for the decompressor to finish the block before the empty fixed code - block. - - If flush is set to Z_BLOCK, a deflate block is completed and emitted, as - for Z_SYNC_FLUSH, but the output is not aligned on a byte boundary, and up to - seven bits of the current block are held to be written as the next byte after - the next deflate block is completed. In this case, the decompressor may not - be provided enough bits at this point in order to complete decompression of - the data provided so far to the compressor. It may need to wait for the next - block to be emitted. This is for advanced applications that need to control - the emission of deflate blocks. - - If flush is set to Z_FULL_FLUSH, all output is flushed as with - Z_SYNC_FLUSH, and the compression state is reset so that decompression can - restart from this point if previous compressed data has been damaged or if - random access is desired. Using Z_FULL_FLUSH too often can seriously degrade - compression. - - If deflate returns with avail_out == 0, this function must be called again - with the same value of the flush parameter and more output space (updated - avail_out), until the flush is complete (deflate returns with non-zero - avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that - avail_out is greater than six to avoid repeated flush markers due to - avail_out == 0 on return. - - If the parameter flush is set to Z_FINISH, pending input is processed, - pending output is flushed and deflate returns with Z_STREAM_END if there was - enough output space; if deflate returns with Z_OK, this function must be - called again with Z_FINISH and more output space (updated avail_out) but no - more input data, until it returns with Z_STREAM_END or an error. After - deflate has returned Z_STREAM_END, the only possible operations on the stream - are deflateReset or deflateEnd. - - Z_FINISH can be used immediately after deflateInit if all the compression - is to be done in a single step. In this case, avail_out must be at least the - value returned by deflateBound (see below). Then deflate is guaranteed to - return Z_STREAM_END. If not enough output space is provided, deflate will - not return Z_STREAM_END, and it must be called again as described above. - - deflate() sets strm->adler to the adler32 checksum of all input read - so far (that is, total_in bytes). - - deflate() may update strm->data_type if it can make a good guess about - the input data type (Z_BINARY or Z_TEXT). In doubt, the data is considered - binary. This field is only for information purposes and does not affect the - compression algorithm in any manner. - - deflate() returns Z_OK if some progress has been made (more input - processed or more output produced), Z_STREAM_END if all input has been - consumed and all output has been produced (only when flush is set to - Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example - if next_in or next_out was Z_NULL), Z_BUF_ERROR if no progress is possible - (for example avail_in or avail_out was zero). Note that Z_BUF_ERROR is not - fatal, and deflate() can be called again with more input and more output - space to continue compressing. -*/ - - -ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm)); -/* - All dynamically allocated data structures for this stream are freed. - This function discards any unprocessed input and does not flush any pending - output. - - deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the - stream state was inconsistent, Z_DATA_ERROR if the stream was freed - prematurely (some input or output was discarded). In the error case, msg - may be set but then points to a static string (which must not be - deallocated). -*/ - - -/* -ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm)); - - Initializes the internal stream state for decompression. The fields - next_in, avail_in, zalloc, zfree and opaque must be initialized before by - the caller. If next_in is not Z_NULL and avail_in is large enough (the - exact value depends on the compression method), inflateInit determines the - compression method from the zlib header and allocates all data structures - accordingly; otherwise the allocation will be deferred to the first call of - inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to - use default allocation functions. - - inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_VERSION_ERROR if the zlib library version is incompatible with the - version assumed by the caller, or Z_STREAM_ERROR if the parameters are - invalid, such as a null pointer to the structure. msg is set to null if - there is no error message. inflateInit does not perform any decompression - apart from possibly reading the zlib header if present: actual decompression - will be done by inflate(). (So next_in and avail_in may be modified, but - next_out and avail_out are unused and unchanged.) The current implementation - of inflateInit() does not process any header information -- that is deferred - until inflate() is called. -*/ - - -ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); -/* - inflate decompresses as much data as possible, and stops when the input - buffer becomes empty or the output buffer becomes full. It may introduce - some output latency (reading input without producing any output) except when - forced to flush. - - The detailed semantics are as follows. inflate performs one or both of the - following actions: - - - Decompress more input starting at next_in and update next_in and avail_in - accordingly. If not all input can be processed (because there is not - enough room in the output buffer), next_in is updated and processing will - resume at this point for the next call of inflate(). - - - Provide more output starting at next_out and update next_out and avail_out - accordingly. inflate() provides as much output as possible, until there is - no more input data or no more space in the output buffer (see below about - the flush parameter). - - Before the call of inflate(), the application should ensure that at least - one of the actions is possible, by providing more input and/or consuming more - output, and updating the next_* and avail_* values accordingly. The - application can consume the uncompressed output when it wants, for example - when the output buffer is full (avail_out == 0), or after each call of - inflate(). If inflate returns Z_OK and with zero avail_out, it must be - called again after making room in the output buffer because there might be - more output pending. - - The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH, Z_FINISH, - Z_BLOCK, or Z_TREES. Z_SYNC_FLUSH requests that inflate() flush as much - output as possible to the output buffer. Z_BLOCK requests that inflate() - stop if and when it gets to the next deflate block boundary. When decoding - the zlib or gzip format, this will cause inflate() to return immediately - after the header and before the first block. When doing a raw inflate, - inflate() will go ahead and process the first block, and will return when it - gets to the end of that block, or when it runs out of data. - - The Z_BLOCK option assists in appending to or combining deflate streams. - Also to assist in this, on return inflate() will set strm->data_type to the - number of unused bits in the last byte taken from strm->next_in, plus 64 if - inflate() is currently decoding the last block in the deflate stream, plus - 128 if inflate() returned immediately after decoding an end-of-block code or - decoding the complete header up to just before the first byte of the deflate - stream. The end-of-block will not be indicated until all of the uncompressed - data from that block has been written to strm->next_out. The number of - unused bits may in general be greater than seven, except when bit 7 of - data_type is set, in which case the number of unused bits will be less than - eight. data_type is set as noted here every time inflate() returns for all - flush options, and so can be used to determine the amount of currently - consumed input in bits. - - The Z_TREES option behaves as Z_BLOCK does, but it also returns when the - end of each deflate block header is reached, before any actual data in that - block is decoded. This allows the caller to determine the length of the - deflate block header for later use in random access within a deflate block. - 256 is added to the value of strm->data_type when inflate() returns - immediately after reaching the end of the deflate block header. - - inflate() should normally be called until it returns Z_STREAM_END or an - error. However if all decompression is to be performed in a single step (a - single call of inflate), the parameter flush should be set to Z_FINISH. In - this case all pending input is processed and all pending output is flushed; - avail_out must be large enough to hold all of the uncompressed data for the - operation to complete. (The size of the uncompressed data may have been - saved by the compressor for this purpose.) The use of Z_FINISH is not - required to perform an inflation in one step. However it may be used to - inform inflate that a faster approach can be used for the single inflate() - call. Z_FINISH also informs inflate to not maintain a sliding window if the - stream completes, which reduces inflate's memory footprint. If the stream - does not complete, either because not all of the stream is provided or not - enough output space is provided, then a sliding window will be allocated and - inflate() can be called again to continue the operation as if Z_NO_FLUSH had - been used. - - In this implementation, inflate() always flushes as much output as - possible to the output buffer, and always uses the faster approach on the - first call. So the effects of the flush parameter in this implementation are - on the return value of inflate() as noted below, when inflate() returns early - when Z_BLOCK or Z_TREES is used, and when inflate() avoids the allocation of - memory for a sliding window when Z_FINISH is used. - - If a preset dictionary is needed after this call (see inflateSetDictionary - below), inflate sets strm->adler to the Adler-32 checksum of the dictionary - chosen by the compressor and returns Z_NEED_DICT; otherwise it sets - strm->adler to the Adler-32 checksum of all output produced so far (that is, - total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described - below. At the end of the stream, inflate() checks that its computed adler32 - checksum is equal to that saved by the compressor and returns Z_STREAM_END - only if the checksum is correct. - - inflate() can decompress and check either zlib-wrapped or gzip-wrapped - deflate data. The header type is detected automatically, if requested when - initializing with inflateInit2(). Any information contained in the gzip - header is not retained, so applications that need that information should - instead use raw inflate, see inflateInit2() below, or inflateBack() and - perform their own processing of the gzip header and trailer. When processing - gzip-wrapped deflate data, strm->adler32 is set to the CRC-32 of the output - producted so far. The CRC-32 is checked against the gzip trailer. - - inflate() returns Z_OK if some progress has been made (more input processed - or more output produced), Z_STREAM_END if the end of the compressed data has - been reached and all uncompressed output has been produced, Z_NEED_DICT if a - preset dictionary is needed at this point, Z_DATA_ERROR if the input data was - corrupted (input stream not conforming to the zlib format or incorrect check - value), Z_STREAM_ERROR if the stream structure was inconsistent (for example - next_in or next_out was Z_NULL), Z_MEM_ERROR if there was not enough memory, - Z_BUF_ERROR if no progress is possible or if there was not enough room in the - output buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and - inflate() can be called again with more input and more output space to - continue decompressing. If Z_DATA_ERROR is returned, the application may - then call inflateSync() to look for a good compression block if a partial - recovery of the data is desired. -*/ - - -ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm)); -/* - All dynamically allocated data structures for this stream are freed. - This function discards any unprocessed input and does not flush any pending - output. - - inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state - was inconsistent. In the error case, msg may be set but then points to a - static string (which must not be deallocated). -*/ - - - /* Advanced functions */ - -/* - The following functions are needed only in some special applications. -*/ - -/* -ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm, - int level, - int method, - int windowBits, - int memLevel, - int strategy)); - - This is another version of deflateInit with more compression options. The - fields next_in, zalloc, zfree and opaque must be initialized before by the - caller. - - The method parameter is the compression method. It must be Z_DEFLATED in - this version of the library. - - The windowBits parameter is the base two logarithm of the window size - (the size of the history buffer). It should be in the range 8..15 for this - version of the library. Larger values of this parameter result in better - compression at the expense of memory usage. The default value is 15 if - deflateInit is used instead. - - windowBits can also be -8..-15 for raw deflate. In this case, -windowBits - determines the window size. deflate() will then generate raw deflate data - with no zlib header or trailer, and will not compute an adler32 check value. - - windowBits can also be greater than 15 for optional gzip encoding. Add - 16 to windowBits to write a simple gzip header and trailer around the - compressed data instead of a zlib wrapper. The gzip header will have no - file name, no extra data, no comment, no modification time (set to zero), no - header crc, and the operating system will be set to 255 (unknown). If a - gzip stream is being written, strm->adler is a crc32 instead of an adler32. - - The memLevel parameter specifies how much memory should be allocated - for the internal compression state. memLevel=1 uses minimum memory but is - slow and reduces compression ratio; memLevel=9 uses maximum memory for - optimal speed. The default value is 8. See zconf.h for total memory usage - as a function of windowBits and memLevel. - - The strategy parameter is used to tune the compression algorithm. Use the - value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a - filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no - string match), or Z_RLE to limit match distances to one (run-length - encoding). Filtered data consists mostly of small values with a somewhat - random distribution. In this case, the compression algorithm is tuned to - compress them better. The effect of Z_FILTERED is to force more Huffman - coding and less string matching; it is somewhat intermediate between - Z_DEFAULT_STRATEGY and Z_HUFFMAN_ONLY. Z_RLE is designed to be almost as - fast as Z_HUFFMAN_ONLY, but give better compression for PNG image data. The - strategy parameter only affects the compression ratio but not the - correctness of the compressed output even if it is not set appropriately. - Z_FIXED prevents the use of dynamic Huffman codes, allowing for a simpler - decoder for special applications. - - deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_STREAM_ERROR if any parameter is invalid (such as an invalid - method), or Z_VERSION_ERROR if the zlib library version (zlib_version) is - incompatible with the version assumed by the caller (ZLIB_VERSION). msg is - set to null if there is no error message. deflateInit2 does not perform any - compression: this will be done by deflate(). -*/ - -ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, - const Bytef *dictionary, - uInt dictLength)); -/* - Initializes the compression dictionary from the given byte sequence - without producing any compressed output. When using the zlib format, this - function must be called immediately after deflateInit, deflateInit2 or - deflateReset, and before any call of deflate. When doing raw deflate, this - function must be called either before any call of deflate, or immediately - after the completion of a deflate block, i.e. after all input has been - consumed and all output has been delivered when using any of the flush - options Z_BLOCK, Z_PARTIAL_FLUSH, Z_SYNC_FLUSH, or Z_FULL_FLUSH. The - compressor and decompressor must use exactly the same dictionary (see - inflateSetDictionary). - - The dictionary should consist of strings (byte sequences) that are likely - to be encountered later in the data to be compressed, with the most commonly - used strings preferably put towards the end of the dictionary. Using a - dictionary is most useful when the data to be compressed is short and can be - predicted with good accuracy; the data can then be compressed better than - with the default empty dictionary. - - Depending on the size of the compression data structures selected by - deflateInit or deflateInit2, a part of the dictionary may in effect be - discarded, for example if the dictionary is larger than the window size - provided in deflateInit or deflateInit2. Thus the strings most likely to be - useful should be put at the end of the dictionary, not at the front. In - addition, the current implementation of deflate will use at most the window - size minus 262 bytes of the provided dictionary. - - Upon return of this function, strm->adler is set to the adler32 value - of the dictionary; the decompressor may later use this value to determine - which dictionary has been used by the compressor. (The adler32 value - applies to the whole dictionary even if only a subset of the dictionary is - actually used by the compressor.) If a raw deflate was requested, then the - adler32 value is not computed and strm->adler is not set. - - deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a - parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is - inconsistent (for example if deflate has already been called for this stream - or if not at a block boundary for raw deflate). deflateSetDictionary does - not perform any compression: this will be done by deflate(). -*/ - -ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest, - z_streamp source)); -/* - Sets the destination stream as a complete copy of the source stream. - - This function can be useful when several compression strategies will be - tried, for example when there are several ways of pre-processing the input - data with a filter. The streams that will be discarded should then be freed - by calling deflateEnd. Note that deflateCopy duplicates the internal - compression state which can be quite large, so this strategy is slow and can - consume lots of memory. - - deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_STREAM_ERROR if the source stream state was inconsistent - (such as zalloc being Z_NULL). msg is left unchanged in both source and - destination. -*/ - -ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm)); -/* - This function is equivalent to deflateEnd followed by deflateInit, - but does not free and reallocate all the internal compression state. The - stream will keep the same compression level and any other attributes that - may have been set by deflateInit2. - - deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent (such as zalloc or state being Z_NULL). -*/ - -ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm, - int level, - int strategy)); -/* - Dynamically update the compression level and compression strategy. The - interpretation of level and strategy is as in deflateInit2. This can be - used to switch between compression and straight copy of the input data, or - to switch to a different kind of input data requiring a different strategy. - If the compression level is changed, the input available so far is - compressed with the old level (and may be flushed); the new level will take - effect only at the next call of deflate(). - - Before the call of deflateParams, the stream state must be set as for - a call of deflate(), since the currently available input may have to be - compressed and flushed. In particular, strm->avail_out must be non-zero. - - deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source - stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR if - strm->avail_out was zero. -*/ - -ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm, - int good_length, - int max_lazy, - int nice_length, - int max_chain)); -/* - Fine tune deflate's internal compression parameters. This should only be - used by someone who understands the algorithm used by zlib's deflate for - searching for the best matching string, and even then only by the most - fanatic optimizer trying to squeeze out the last compressed bit for their - specific input data. Read the deflate.c source code for the meaning of the - max_lazy, good_length, nice_length, and max_chain parameters. - - deflateTune() can be called after deflateInit() or deflateInit2(), and - returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream. - */ - -ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm, - uLong sourceLen)); -/* - deflateBound() returns an upper bound on the compressed size after - deflation of sourceLen bytes. It must be called after deflateInit() or - deflateInit2(), and after deflateSetHeader(), if used. This would be used - to allocate an output buffer for deflation in a single pass, and so would be - called before deflate(). If that first deflate() call is provided the - sourceLen input bytes, an output buffer allocated to the size returned by - deflateBound(), and the flush value Z_FINISH, then deflate() is guaranteed - to return Z_STREAM_END. Note that it is possible for the compressed size to - be larger than the value returned by deflateBound() if flush options other - than Z_FINISH or Z_NO_FLUSH are used. -*/ - -ZEXTERN int ZEXPORT deflatePending OF((z_streamp strm, - unsigned *pending, - int *bits)); -/* - deflatePending() returns the number of bytes and bits of output that have - been generated, but not yet provided in the available output. The bytes not - provided would be due to the available output space having being consumed. - The number of bits of output not provided are between 0 and 7, where they - await more bits to join them in order to fill out a full byte. If pending - or bits are Z_NULL, then those values are not set. - - deflatePending returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent. - */ - -ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm, - int bits, - int value)); -/* - deflatePrime() inserts bits in the deflate output stream. The intent - is that this function is used to start off the deflate output with the bits - leftover from a previous deflate stream when appending to it. As such, this - function can only be used for raw deflate, and must be used before the first - deflate() call after a deflateInit2() or deflateReset(). bits must be less - than or equal to 16, and that many of the least significant bits of value - will be inserted in the output. - - deflatePrime returns Z_OK if success, Z_BUF_ERROR if there was not enough - room in the internal buffer to insert the bits, or Z_STREAM_ERROR if the - source stream state was inconsistent. -*/ - -ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm, - gz_headerp head)); -/* - deflateSetHeader() provides gzip header information for when a gzip - stream is requested by deflateInit2(). deflateSetHeader() may be called - after deflateInit2() or deflateReset() and before the first call of - deflate(). The text, time, os, extra field, name, and comment information - in the provided gz_header structure are written to the gzip header (xflag is - ignored -- the extra flags are set according to the compression level). The - caller must assure that, if not Z_NULL, name and comment are terminated with - a zero byte, and that if extra is not Z_NULL, that extra_len bytes are - available there. If hcrc is true, a gzip header crc is included. Note that - the current versions of the command-line version of gzip (up through version - 1.3.x) do not support header crc's, and will report that it is a "multi-part - gzip file" and give up. - - If deflateSetHeader is not used, the default gzip header has text false, - the time set to zero, and os set to 255, with no extra, name, or comment - fields. The gzip header is returned to the default state by deflateReset(). - - deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent. -*/ - -/* -ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm, - int windowBits)); - - This is another version of inflateInit with an extra parameter. The - fields next_in, avail_in, zalloc, zfree and opaque must be initialized - before by the caller. - - The windowBits parameter is the base two logarithm of the maximum window - size (the size of the history buffer). It should be in the range 8..15 for - this version of the library. The default value is 15 if inflateInit is used - instead. windowBits must be greater than or equal to the windowBits value - provided to deflateInit2() while compressing, or it must be equal to 15 if - deflateInit2() was not used. If a compressed stream with a larger window - size is given as input, inflate() will return with the error code - Z_DATA_ERROR instead of trying to allocate a larger window. - - windowBits can also be zero to request that inflate use the window size in - the zlib header of the compressed stream. - - windowBits can also be -8..-15 for raw inflate. In this case, -windowBits - determines the window size. inflate() will then process raw deflate data, - not looking for a zlib or gzip header, not generating a check value, and not - looking for any check values for comparison at the end of the stream. This - is for use with other formats that use the deflate compressed data format - such as zip. Those formats provide their own check values. If a custom - format is developed using the raw deflate format for compressed data, it is - recommended that a check value such as an adler32 or a crc32 be applied to - the uncompressed data as is done in the zlib, gzip, and zip formats. For - most applications, the zlib format should be used as is. Note that comments - above on the use in deflateInit2() applies to the magnitude of windowBits. - - windowBits can also be greater than 15 for optional gzip decoding. Add - 32 to windowBits to enable zlib and gzip decoding with automatic header - detection, or add 16 to decode only the gzip format (the zlib format will - return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is a - crc32 instead of an adler32. - - inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_VERSION_ERROR if the zlib library version is incompatible with the - version assumed by the caller, or Z_STREAM_ERROR if the parameters are - invalid, such as a null pointer to the structure. msg is set to null if - there is no error message. inflateInit2 does not perform any decompression - apart from possibly reading the zlib header if present: actual decompression - will be done by inflate(). (So next_in and avail_in may be modified, but - next_out and avail_out are unused and unchanged.) The current implementation - of inflateInit2() does not process any header information -- that is - deferred until inflate() is called. -*/ - -ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm, - const Bytef *dictionary, - uInt dictLength)); -/* - Initializes the decompression dictionary from the given uncompressed byte - sequence. This function must be called immediately after a call of inflate, - if that call returned Z_NEED_DICT. The dictionary chosen by the compressor - can be determined from the adler32 value returned by that call of inflate. - The compressor and decompressor must use exactly the same dictionary (see - deflateSetDictionary). For raw inflate, this function can be called at any - time to set the dictionary. If the provided dictionary is smaller than the - window and there is already data in the window, then the provided dictionary - will amend what's there. The application must insure that the dictionary - that was used for compression is provided. - - inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a - parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is - inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the - expected one (incorrect adler32 value). inflateSetDictionary does not - perform any decompression: this will be done by subsequent calls of - inflate(). -*/ - -ZEXTERN int ZEXPORT inflateGetDictionary OF((z_streamp strm, - Bytef *dictionary, - uInt *dictLength)); -/* - Returns the sliding dictionary being maintained by inflate. dictLength is - set to the number of bytes in the dictionary, and that many bytes are copied - to dictionary. dictionary must have enough space, where 32768 bytes is - always enough. If inflateGetDictionary() is called with dictionary equal to - Z_NULL, then only the dictionary length is returned, and nothing is copied. - Similary, if dictLength is Z_NULL, then it is not set. - - inflateGetDictionary returns Z_OK on success, or Z_STREAM_ERROR if the - stream state is inconsistent. -*/ - -ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm)); -/* - Skips invalid compressed data until a possible full flush point (see above - for the description of deflate with Z_FULL_FLUSH) can be found, or until all - available input is skipped. No output is provided. - - inflateSync searches for a 00 00 FF FF pattern in the compressed data. - All full flush points have this pattern, but not all occurrences of this - pattern are full flush points. - - inflateSync returns Z_OK if a possible full flush point has been found, - Z_BUF_ERROR if no more input was provided, Z_DATA_ERROR if no flush point - has been found, or Z_STREAM_ERROR if the stream structure was inconsistent. - In the success case, the application may save the current current value of - total_in which indicates where valid compressed data was found. In the - error case, the application may repeatedly call inflateSync, providing more - input each time, until success or end of the input data. -*/ - -ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest, - z_streamp source)); -/* - Sets the destination stream as a complete copy of the source stream. - - This function can be useful when randomly accessing a large stream. The - first pass through the stream can periodically record the inflate state, - allowing restarting inflate at those points when randomly accessing the - stream. - - inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_STREAM_ERROR if the source stream state was inconsistent - (such as zalloc being Z_NULL). msg is left unchanged in both source and - destination. -*/ - -ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm)); -/* - This function is equivalent to inflateEnd followed by inflateInit, - but does not free and reallocate all the internal decompression state. The - stream will keep attributes that may have been set by inflateInit2. - - inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent (such as zalloc or state being Z_NULL). -*/ - -ZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm, - int windowBits)); -/* - This function is the same as inflateReset, but it also permits changing - the wrap and window size requests. The windowBits parameter is interpreted - the same as it is for inflateInit2. - - inflateReset2 returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent (such as zalloc or state being Z_NULL), or if - the windowBits parameter is invalid. -*/ - -ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm, - int bits, - int value)); -/* - This function inserts bits in the inflate input stream. The intent is - that this function is used to start inflating at a bit position in the - middle of a byte. The provided bits will be used before any bytes are used - from next_in. This function should only be used with raw inflate, and - should be used before the first inflate() call after inflateInit2() or - inflateReset(). bits must be less than or equal to 16, and that many of the - least significant bits of value will be inserted in the input. - - If bits is negative, then the input stream bit buffer is emptied. Then - inflatePrime() can be called again to put bits in the buffer. This is used - to clear out bits leftover after feeding inflate a block description prior - to feeding inflate codes. - - inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent. -*/ - -ZEXTERN long ZEXPORT inflateMark OF((z_streamp strm)); -/* - This function returns two values, one in the lower 16 bits of the return - value, and the other in the remaining upper bits, obtained by shifting the - return value down 16 bits. If the upper value is -1 and the lower value is - zero, then inflate() is currently decoding information outside of a block. - If the upper value is -1 and the lower value is non-zero, then inflate is in - the middle of a stored block, with the lower value equaling the number of - bytes from the input remaining to copy. If the upper value is not -1, then - it is the number of bits back from the current bit position in the input of - the code (literal or length/distance pair) currently being processed. In - that case the lower value is the number of bytes already emitted for that - code. - - A code is being processed if inflate is waiting for more input to complete - decoding of the code, or if it has completed decoding but is waiting for - more output space to write the literal or match data. - - inflateMark() is used to mark locations in the input data for random - access, which may be at bit positions, and to note those cases where the - output of a code may span boundaries of random access blocks. The current - location in the input stream can be determined from avail_in and data_type - as noted in the description for the Z_BLOCK flush parameter for inflate. - - inflateMark returns the value noted above or -1 << 16 if the provided - source stream state was inconsistent. -*/ - -ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm, - gz_headerp head)); -/* - inflateGetHeader() requests that gzip header information be stored in the - provided gz_header structure. inflateGetHeader() may be called after - inflateInit2() or inflateReset(), and before the first call of inflate(). - As inflate() processes the gzip stream, head->done is zero until the header - is completed, at which time head->done is set to one. If a zlib stream is - being decoded, then head->done is set to -1 to indicate that there will be - no gzip header information forthcoming. Note that Z_BLOCK or Z_TREES can be - used to force inflate() to return immediately after header processing is - complete and before any actual data is decompressed. - - The text, time, xflags, and os fields are filled in with the gzip header - contents. hcrc is set to true if there is a header CRC. (The header CRC - was valid if done is set to one.) If extra is not Z_NULL, then extra_max - contains the maximum number of bytes to write to extra. Once done is true, - extra_len contains the actual extra field length, and extra contains the - extra field, or that field truncated if extra_max is less than extra_len. - If name is not Z_NULL, then up to name_max characters are written there, - terminated with a zero unless the length is greater than name_max. If - comment is not Z_NULL, then up to comm_max characters are written there, - terminated with a zero unless the length is greater than comm_max. When any - of extra, name, or comment are not Z_NULL and the respective field is not - present in the header, then that field is set to Z_NULL to signal its - absence. This allows the use of deflateSetHeader() with the returned - structure to duplicate the header. However if those fields are set to - allocated memory, then the application will need to save those pointers - elsewhere so that they can be eventually freed. - - If inflateGetHeader is not used, then the header information is simply - discarded. The header is always checked for validity, including the header - CRC if present. inflateReset() will reset the process to discard the header - information. The application would need to call inflateGetHeader() again to - retrieve the header from the next gzip stream. - - inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent. -*/ - -/* -ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits, - unsigned char FAR *window)); - - Initialize the internal stream state for decompression using inflateBack() - calls. The fields zalloc, zfree and opaque in strm must be initialized - before the call. If zalloc and zfree are Z_NULL, then the default library- - derived memory allocation routines are used. windowBits is the base two - logarithm of the window size, in the range 8..15. window is a caller - supplied buffer of that size. Except for special applications where it is - assured that deflate was used with small window sizes, windowBits must be 15 - and a 32K byte window must be supplied to be able to decompress general - deflate streams. - - See inflateBack() for the usage of these routines. - - inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of - the parameters are invalid, Z_MEM_ERROR if the internal state could not be - allocated, or Z_VERSION_ERROR if the version of the library does not match - the version of the header file. -*/ - -typedef unsigned (*in_func) OF((void FAR *, - z_const unsigned char FAR * FAR *)); -typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned)); - -ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm, - in_func in, void FAR *in_desc, - out_func out, void FAR *out_desc)); -/* - inflateBack() does a raw inflate with a single call using a call-back - interface for input and output. This is potentially more efficient than - inflate() for file i/o applications, in that it avoids copying between the - output and the sliding window by simply making the window itself the output - buffer. inflate() can be faster on modern CPUs when used with large - buffers. inflateBack() trusts the application to not change the output - buffer passed by the output function, at least until inflateBack() returns. - - inflateBackInit() must be called first to allocate the internal state - and to initialize the state with the user-provided window buffer. - inflateBack() may then be used multiple times to inflate a complete, raw - deflate stream with each call. inflateBackEnd() is then called to free the - allocated state. - - A raw deflate stream is one with no zlib or gzip header or trailer. - This routine would normally be used in a utility that reads zip or gzip - files and writes out uncompressed files. The utility would decode the - header and process the trailer on its own, hence this routine expects only - the raw deflate stream to decompress. This is different from the normal - behavior of inflate(), which expects either a zlib or gzip header and - trailer around the deflate stream. - - inflateBack() uses two subroutines supplied by the caller that are then - called by inflateBack() for input and output. inflateBack() calls those - routines until it reads a complete deflate stream and writes out all of the - uncompressed data, or until it encounters an error. The function's - parameters and return types are defined above in the in_func and out_func - typedefs. inflateBack() will call in(in_desc, &buf) which should return the - number of bytes of provided input, and a pointer to that input in buf. If - there is no input available, in() must return zero--buf is ignored in that - case--and inflateBack() will return a buffer error. inflateBack() will call - out(out_desc, buf, len) to write the uncompressed data buf[0..len-1]. out() - should return zero on success, or non-zero on failure. If out() returns - non-zero, inflateBack() will return with an error. Neither in() nor out() - are permitted to change the contents of the window provided to - inflateBackInit(), which is also the buffer that out() uses to write from. - The length written by out() will be at most the window size. Any non-zero - amount of input may be provided by in(). - - For convenience, inflateBack() can be provided input on the first call by - setting strm->next_in and strm->avail_in. If that input is exhausted, then - in() will be called. Therefore strm->next_in must be initialized before - calling inflateBack(). If strm->next_in is Z_NULL, then in() will be called - immediately for input. If strm->next_in is not Z_NULL, then strm->avail_in - must also be initialized, and then if strm->avail_in is not zero, input will - initially be taken from strm->next_in[0 .. strm->avail_in - 1]. - - The in_desc and out_desc parameters of inflateBack() is passed as the - first parameter of in() and out() respectively when they are called. These - descriptors can be optionally used to pass any information that the caller- - supplied in() and out() functions need to do their job. - - On return, inflateBack() will set strm->next_in and strm->avail_in to - pass back any unused input that was provided by the last in() call. The - return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR - if in() or out() returned an error, Z_DATA_ERROR if there was a format error - in the deflate stream (in which case strm->msg is set to indicate the nature - of the error), or Z_STREAM_ERROR if the stream was not properly initialized. - In the case of Z_BUF_ERROR, an input or output error can be distinguished - using strm->next_in which will be Z_NULL only if in() returned an error. If - strm->next_in is not Z_NULL, then the Z_BUF_ERROR was due to out() returning - non-zero. (in() will always be called before out(), so strm->next_in is - assured to be defined if out() returns non-zero.) Note that inflateBack() - cannot return Z_OK. -*/ - -ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm)); -/* - All memory allocated by inflateBackInit() is freed. - - inflateBackEnd() returns Z_OK on success, or Z_STREAM_ERROR if the stream - state was inconsistent. -*/ - -ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void)); -/* Return flags indicating compile-time options. - - Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other: - 1.0: size of uInt - 3.2: size of uLong - 5.4: size of voidpf (pointer) - 7.6: size of z_off_t - - Compiler, assembler, and debug options: - 8: DEBUG - 9: ASMV or ASMINF -- use ASM code - 10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention - 11: 0 (reserved) - - One-time table building (smaller code, but not thread-safe if true): - 12: BUILDFIXED -- build static block decoding tables when needed - 13: DYNAMIC_CRC_TABLE -- build CRC calculation tables when needed - 14,15: 0 (reserved) - - Library content (indicates missing functionality): - 16: NO_GZCOMPRESS -- gz* functions cannot compress (to avoid linking - deflate code when not needed) - 17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect - and decode gzip streams (to avoid linking crc code) - 18-19: 0 (reserved) - - Operation variations (changes in library functionality): - 20: PKZIP_BUG_WORKAROUND -- slightly more permissive inflate - 21: FASTEST -- deflate algorithm with only one, lowest compression level - 22,23: 0 (reserved) - - The sprintf variant used by gzprintf (zero is best): - 24: 0 = vs*, 1 = s* -- 1 means limited to 20 arguments after the format - 25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure! - 26: 0 = returns value, 1 = void -- 1 means inferred string length returned - - Remainder: - 27-31: 0 (reserved) - */ - -#ifndef Z_SOLO - - /* utility functions */ - -/* - The following utility functions are implemented on top of the basic - stream-oriented functions. To simplify the interface, some default options - are assumed (compression level and memory usage, standard memory allocation - functions). The source code of these utility functions can be modified if - you need special options. -*/ - -ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong sourceLen)); -/* - Compresses the source buffer into the destination buffer. sourceLen is - the byte length of the source buffer. Upon entry, destLen is the total size - of the destination buffer, which must be at least the value returned by - compressBound(sourceLen). Upon exit, destLen is the actual size of the - compressed buffer. - - compress returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_BUF_ERROR if there was not enough room in the output - buffer. -*/ - -ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong sourceLen, - int level)); -/* - Compresses the source buffer into the destination buffer. The level - parameter has the same meaning as in deflateInit. sourceLen is the byte - length of the source buffer. Upon entry, destLen is the total size of the - destination buffer, which must be at least the value returned by - compressBound(sourceLen). Upon exit, destLen is the actual size of the - compressed buffer. - - compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_BUF_ERROR if there was not enough room in the output buffer, - Z_STREAM_ERROR if the level parameter is invalid. -*/ - -ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen)); -/* - compressBound() returns an upper bound on the compressed size after - compress() or compress2() on sourceLen bytes. It would be used before a - compress() or compress2() call to allocate the destination buffer. -*/ - -ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong sourceLen)); -/* - Decompresses the source buffer into the destination buffer. sourceLen is - the byte length of the source buffer. Upon entry, destLen is the total size - of the destination buffer, which must be large enough to hold the entire - uncompressed data. (The size of the uncompressed data must have been saved - previously by the compressor and transmitted to the decompressor by some - mechanism outside the scope of this compression library.) Upon exit, destLen - is the actual size of the uncompressed buffer. - - uncompress returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_BUF_ERROR if there was not enough room in the output - buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete. In - the case where there is not enough room, uncompress() will fill the output - buffer with the uncompressed data up to that point. -*/ - - /* gzip file access functions */ - -/* - This library supports reading and writing files in gzip (.gz) format with - an interface similar to that of stdio, using the functions that start with - "gz". The gzip format is different from the zlib format. gzip is a gzip - wrapper, documented in RFC 1952, wrapped around a deflate stream. -*/ - -typedef struct gzFile_s *gzFile; /* semi-opaque gzip file descriptor */ - -/* -ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode)); - - Opens a gzip (.gz) file for reading or writing. The mode parameter is as - in fopen ("rb" or "wb") but can also include a compression level ("wb9") or - a strategy: 'f' for filtered data as in "wb6f", 'h' for Huffman-only - compression as in "wb1h", 'R' for run-length encoding as in "wb1R", or 'F' - for fixed code compression as in "wb9F". (See the description of - deflateInit2 for more information about the strategy parameter.) 'T' will - request transparent writing or appending with no compression and not using - the gzip format. - - "a" can be used instead of "w" to request that the gzip stream that will - be written be appended to the file. "+" will result in an error, since - reading and writing to the same gzip file is not supported. The addition of - "x" when writing will create the file exclusively, which fails if the file - already exists. On systems that support it, the addition of "e" when - reading or writing will set the flag to close the file on an execve() call. - - These functions, as well as gzip, will read and decode a sequence of gzip - streams in a file. The append function of gzopen() can be used to create - such a file. (Also see gzflush() for another way to do this.) When - appending, gzopen does not test whether the file begins with a gzip stream, - nor does it look for the end of the gzip streams to begin appending. gzopen - will simply append a gzip stream to the existing file. - - gzopen can be used to read a file which is not in gzip format; in this - case gzread will directly read from the file without decompression. When - reading, this will be detected automatically by looking for the magic two- - byte gzip header. - - gzopen returns NULL if the file could not be opened, if there was - insufficient memory to allocate the gzFile state, or if an invalid mode was - specified (an 'r', 'w', or 'a' was not provided, or '+' was provided). - errno can be checked to determine if the reason gzopen failed was that the - file could not be opened. -*/ - -ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode)); -/* - gzdopen associates a gzFile with the file descriptor fd. File descriptors - are obtained from calls like open, dup, creat, pipe or fileno (if the file - has been previously opened with fopen). The mode parameter is as in gzopen. - - The next call of gzclose on the returned gzFile will also close the file - descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor - fd. If you want to keep fd open, use fd = dup(fd_keep); gz = gzdopen(fd, - mode);. The duplicated descriptor should be saved to avoid a leak, since - gzdopen does not close fd if it fails. If you are using fileno() to get the - file descriptor from a FILE *, then you will have to use dup() to avoid - double-close()ing the file descriptor. Both gzclose() and fclose() will - close the associated file descriptor, so they need to have different file - descriptors. - - gzdopen returns NULL if there was insufficient memory to allocate the - gzFile state, if an invalid mode was specified (an 'r', 'w', or 'a' was not - provided, or '+' was provided), or if fd is -1. The file descriptor is not - used until the next gz* read, write, seek, or close operation, so gzdopen - will not detect if fd is invalid (unless fd is -1). -*/ - -ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size)); -/* - Set the internal buffer size used by this library's functions. The - default buffer size is 8192 bytes. This function must be called after - gzopen() or gzdopen(), and before any other calls that read or write the - file. The buffer memory allocation is always deferred to the first read or - write. Two buffers are allocated, either both of the specified size when - writing, or one of the specified size and the other twice that size when - reading. A larger buffer size of, for example, 64K or 128K bytes will - noticeably increase the speed of decompression (reading). - - The new buffer size also affects the maximum length for gzprintf(). - - gzbuffer() returns 0 on success, or -1 on failure, such as being called - too late. -*/ - -ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy)); -/* - Dynamically update the compression level or strategy. See the description - of deflateInit2 for the meaning of these parameters. - - gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not - opened for writing. -*/ - -ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len)); -/* - Reads the given number of uncompressed bytes from the compressed file. If - the input file is not in gzip format, gzread copies the given number of - bytes into the buffer directly from the file. - - After reaching the end of a gzip stream in the input, gzread will continue - to read, looking for another gzip stream. Any number of gzip streams may be - concatenated in the input file, and will all be decompressed by gzread(). - If something other than a gzip stream is encountered after a gzip stream, - that remaining trailing garbage is ignored (and no error is returned). - - gzread can be used to read a gzip file that is being concurrently written. - Upon reaching the end of the input, gzread will return with the available - data. If the error code returned by gzerror is Z_OK or Z_BUF_ERROR, then - gzclearerr can be used to clear the end of file indicator in order to permit - gzread to be tried again. Z_OK indicates that a gzip stream was completed - on the last gzread. Z_BUF_ERROR indicates that the input file ended in the - middle of a gzip stream. Note that gzread does not return -1 in the event - of an incomplete gzip stream. This error is deferred until gzclose(), which - will return Z_BUF_ERROR if the last gzread ended in the middle of a gzip - stream. Alternatively, gzerror can be used before gzclose to detect this - case. - - gzread returns the number of uncompressed bytes actually read, less than - len for end of file, or -1 for error. -*/ - -ZEXTERN int ZEXPORT gzwrite OF((gzFile file, - voidpc buf, unsigned len)); -/* - Writes the given number of uncompressed bytes into the compressed file. - gzwrite returns the number of uncompressed bytes written or 0 in case of - error. -*/ - -ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...)); -/* - Converts, formats, and writes the arguments to the compressed file under - control of the format string, as in fprintf. gzprintf returns the number of - uncompressed bytes actually written, or 0 in case of error. The number of - uncompressed bytes written is limited to 8191, or one less than the buffer - size given to gzbuffer(). The caller should assure that this limit is not - exceeded. If it is exceeded, then gzprintf() will return an error (0) with - nothing written. In this case, there may also be a buffer overflow with - unpredictable consequences, which is possible only if zlib was compiled with - the insecure functions sprintf() or vsprintf() because the secure snprintf() - or vsnprintf() functions were not available. This can be determined using - zlibCompileFlags(). -*/ - -ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s)); -/* - Writes the given null-terminated string to the compressed file, excluding - the terminating null character. - - gzputs returns the number of characters written, or -1 in case of error. -*/ - -ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len)); -/* - Reads bytes from the compressed file until len-1 characters are read, or a - newline character is read and transferred to buf, or an end-of-file - condition is encountered. If any characters are read or if len == 1, the - string is terminated with a null character. If no characters are read due - to an end-of-file or len < 1, then the buffer is left untouched. - - gzgets returns buf which is a null-terminated string, or it returns NULL - for end-of-file or in case of error. If there was an error, the contents at - buf are indeterminate. -*/ - -ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c)); -/* - Writes c, converted to an unsigned char, into the compressed file. gzputc - returns the value that was written, or -1 in case of error. -*/ - -ZEXTERN int ZEXPORT gzgetc OF((gzFile file)); -/* - Reads one byte from the compressed file. gzgetc returns this byte or -1 - in case of end of file or error. This is implemented as a macro for speed. - As such, it does not do all of the checking the other functions do. I.e. - it does not check to see if file is NULL, nor whether the structure file - points to has been clobbered or not. -*/ - -ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file)); -/* - Push one character back onto the stream to be read as the first character - on the next read. At least one character of push-back is allowed. - gzungetc() returns the character pushed, or -1 on failure. gzungetc() will - fail if c is -1, and may fail if a character has been pushed but not read - yet. If gzungetc is used immediately after gzopen or gzdopen, at least the - output buffer size of pushed characters is allowed. (See gzbuffer above.) - The pushed character will be discarded if the stream is repositioned with - gzseek() or gzrewind(). -*/ - -ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush)); -/* - Flushes all pending output into the compressed file. The parameter flush - is as in the deflate() function. The return value is the zlib error number - (see function gzerror below). gzflush is only permitted when writing. - - If the flush parameter is Z_FINISH, the remaining data is written and the - gzip stream is completed in the output. If gzwrite() is called again, a new - gzip stream will be started in the output. gzread() is able to read such - concatented gzip streams. - - gzflush should be called only when strictly necessary because it will - degrade compression if called too often. -*/ - -/* -ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file, - z_off_t offset, int whence)); - - Sets the starting position for the next gzread or gzwrite on the given - compressed file. The offset represents a number of bytes in the - uncompressed data stream. The whence parameter is defined as in lseek(2); - the value SEEK_END is not supported. - - If the file is opened for reading, this function is emulated but can be - extremely slow. If the file is opened for writing, only forward seeks are - supported; gzseek then compresses a sequence of zeroes up to the new - starting position. - - gzseek returns the resulting offset location as measured in bytes from - the beginning of the uncompressed stream, or -1 in case of error, in - particular if the file is opened for writing and the new starting position - would be before the current position. -*/ - -ZEXTERN int ZEXPORT gzrewind OF((gzFile file)); -/* - Rewinds the given file. This function is supported only for reading. - - gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET) -*/ - -/* -ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file)); - - Returns the starting position for the next gzread or gzwrite on the given - compressed file. This position represents a number of bytes in the - uncompressed data stream, and is zero when starting, even if appending or - reading a gzip stream from the middle of a file using gzdopen(). - - gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR) -*/ - -/* -ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file)); - - Returns the current offset in the file being read or written. This offset - includes the count of bytes that precede the gzip stream, for example when - appending or when using gzdopen() for reading. When reading, the offset - does not include as yet unused buffered input. This information can be used - for a progress indicator. On error, gzoffset() returns -1. -*/ - -ZEXTERN int ZEXPORT gzeof OF((gzFile file)); -/* - Returns true (1) if the end-of-file indicator has been set while reading, - false (0) otherwise. Note that the end-of-file indicator is set only if the - read tried to go past the end of the input, but came up short. Therefore, - just like feof(), gzeof() may return false even if there is no more data to - read, in the event that the last read request was for the exact number of - bytes remaining in the input file. This will happen if the input file size - is an exact multiple of the buffer size. - - If gzeof() returns true, then the read functions will return no more data, - unless the end-of-file indicator is reset by gzclearerr() and the input file - has grown since the previous end of file was detected. -*/ - -ZEXTERN int ZEXPORT gzdirect OF((gzFile file)); -/* - Returns true (1) if file is being copied directly while reading, or false - (0) if file is a gzip stream being decompressed. - - If the input file is empty, gzdirect() will return true, since the input - does not contain a gzip stream. - - If gzdirect() is used immediately after gzopen() or gzdopen() it will - cause buffers to be allocated to allow reading the file to determine if it - is a gzip file. Therefore if gzbuffer() is used, it should be called before - gzdirect(). - - When writing, gzdirect() returns true (1) if transparent writing was - requested ("wT" for the gzopen() mode), or false (0) otherwise. (Note: - gzdirect() is not needed when writing. Transparent writing must be - explicitly requested, so the application already knows the answer. When - linking statically, using gzdirect() will include all of the zlib code for - gzip file reading and decompression, which may not be desired.) -*/ - -ZEXTERN int ZEXPORT gzclose OF((gzFile file)); -/* - Flushes all pending output if necessary, closes the compressed file and - deallocates the (de)compression state. Note that once file is closed, you - cannot call gzerror with file, since its structures have been deallocated. - gzclose must not be called more than once on the same file, just as free - must not be called more than once on the same allocation. - - gzclose will return Z_STREAM_ERROR if file is not valid, Z_ERRNO on a - file operation error, Z_MEM_ERROR if out of memory, Z_BUF_ERROR if the - last read ended in the middle of a gzip stream, or Z_OK on success. -*/ - -ZEXTERN int ZEXPORT gzclose_r OF((gzFile file)); -ZEXTERN int ZEXPORT gzclose_w OF((gzFile file)); -/* - Same as gzclose(), but gzclose_r() is only for use when reading, and - gzclose_w() is only for use when writing or appending. The advantage to - using these instead of gzclose() is that they avoid linking in zlib - compression or decompression code that is not used when only reading or only - writing respectively. If gzclose() is used, then both compression and - decompression code will be included the application when linking to a static - zlib library. -*/ - -ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum)); -/* - Returns the error message for the last error which occurred on the given - compressed file. errnum is set to zlib error number. If an error occurred - in the file system and not in the compression library, errnum is set to - Z_ERRNO and the application may consult errno to get the exact error code. - - The application must not modify the returned string. Future calls to - this function may invalidate the previously returned string. If file is - closed, then the string previously returned by gzerror will no longer be - available. - - gzerror() should be used to distinguish errors from end-of-file for those - functions above that do not distinguish those cases in their return values. -*/ - -ZEXTERN void ZEXPORT gzclearerr OF((gzFile file)); -/* - Clears the error and end-of-file flags for file. This is analogous to the - clearerr() function in stdio. This is useful for continuing to read a gzip - file that is being written concurrently. -*/ - -#endif /* !Z_SOLO */ - - /* checksum functions */ - -/* - These functions are not related to compression but are exported - anyway because they might be useful in applications using the compression - library. -*/ - -ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len)); -/* - Update a running Adler-32 checksum with the bytes buf[0..len-1] and - return the updated checksum. If buf is Z_NULL, this function returns the - required initial value for the checksum. - - An Adler-32 checksum is almost as reliable as a CRC32 but can be computed - much faster. - - Usage example: - - uLong adler = adler32(0L, Z_NULL, 0); - - while (read_buffer(buffer, length) != EOF) { - adler = adler32(adler, buffer, length); - } - if (adler != original_adler) error(); -*/ - -/* -ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2, - z_off_t len2)); - - Combine two Adler-32 checksums into one. For two sequences of bytes, seq1 - and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for - each, adler1 and adler2. adler32_combine() returns the Adler-32 checksum of - seq1 and seq2 concatenated, requiring only adler1, adler2, and len2. Note - that the z_off_t type (like off_t) is a signed integer. If len2 is - negative, the result has no meaning or utility. -*/ - -ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len)); -/* - Update a running CRC-32 with the bytes buf[0..len-1] and return the - updated CRC-32. If buf is Z_NULL, this function returns the required - initial value for the crc. Pre- and post-conditioning (one's complement) is - performed within this function so it shouldn't be done by the application. - - Usage example: - - uLong crc = crc32(0L, Z_NULL, 0); - - while (read_buffer(buffer, length) != EOF) { - crc = crc32(crc, buffer, length); - } - if (crc != original_crc) error(); -*/ - -/* -ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2)); - - Combine two CRC-32 check values into one. For two sequences of bytes, - seq1 and seq2 with lengths len1 and len2, CRC-32 check values were - calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32 - check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and - len2. -*/ - - - /* various hacks, don't look :) */ - -/* deflateInit and inflateInit are macros to allow checking the zlib version - * and the compiler's view of z_stream: - */ -ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level, - const char *version, int stream_size)); -ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm, - const char *version, int stream_size)); -ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method, - int windowBits, int memLevel, - int strategy, const char *version, - int stream_size)); -ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits, - const char *version, int stream_size)); -ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits, - unsigned char FAR *window, - const char *version, - int stream_size)); -#define deflateInit(strm, level) \ - deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream)) -#define inflateInit(strm) \ - inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream)) -#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ - deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ - (strategy), ZLIB_VERSION, (int)sizeof(z_stream)) -#define inflateInit2(strm, windowBits) \ - inflateInit2_((strm), (windowBits), ZLIB_VERSION, \ - (int)sizeof(z_stream)) -#define inflateBackInit(strm, windowBits, window) \ - inflateBackInit_((strm), (windowBits), (window), \ - ZLIB_VERSION, (int)sizeof(z_stream)) - -#ifndef Z_SOLO - -/* gzgetc() macro and its supporting function and exposed data structure. Note - * that the real internal state is much larger than the exposed structure. - * This abbreviated structure exposes just enough for the gzgetc() macro. The - * user should not mess with these exposed elements, since their names or - * behavior could change in the future, perhaps even capriciously. They can - * only be used by the gzgetc() macro. You have been warned. - */ -struct gzFile_s { - unsigned have; - unsigned char *next; - z_off64_t pos; -}; -ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */ -#ifdef Z_PREFIX_SET -# undef z_gzgetc -# define z_gzgetc(g) \ - ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : gzgetc(g)) -#else -# define gzgetc(g) \ - ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : gzgetc(g)) -#endif - -/* provide 64-bit offset functions if _LARGEFILE64_SOURCE defined, and/or - * change the regular functions to 64 bits if _FILE_OFFSET_BITS is 64 (if - * both are true, the application gets the *64 functions, and the regular - * functions are changed to 64 bits) -- in case these are set on systems - * without large file support, _LFS64_LARGEFILE must also be true - */ -#ifdef Z_LARGE64 - ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); - ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int)); - ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile)); - ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile)); - ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off64_t)); - ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t)); -#endif - -#if !defined(ZLIB_INTERNAL) && defined(Z_WANT64) -# ifdef Z_PREFIX_SET -# define z_gzopen z_gzopen64 -# define z_gzseek z_gzseek64 -# define z_gztell z_gztell64 -# define z_gzoffset z_gzoffset64 -# define z_adler32_combine z_adler32_combine64 -# define z_crc32_combine z_crc32_combine64 -# else -# define gzopen gzopen64 -# define gzseek gzseek64 -# define gztell gztell64 -# define gzoffset gzoffset64 -# define adler32_combine adler32_combine64 -# define crc32_combine crc32_combine64 -# endif -# ifndef Z_LARGE64 - ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); - ZEXTERN z_off_t ZEXPORT gzseek64 OF((gzFile, z_off_t, int)); - ZEXTERN z_off_t ZEXPORT gztell64 OF((gzFile)); - ZEXTERN z_off_t ZEXPORT gzoffset64 OF((gzFile)); - ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t)); - ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t)); -# endif -#else - ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *)); - ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile, z_off_t, int)); - ZEXTERN z_off_t ZEXPORT gztell OF((gzFile)); - ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile)); - ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t)); - ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t)); -#endif - -#else /* Z_SOLO */ - - ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t)); - ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t)); - -#endif /* !Z_SOLO */ - -/* hack for buggy compilers */ -#if !defined(ZUTIL_H) && !defined(NO_DUMMY_DECL) - struct internal_state {int dummy;}; -#endif - -/* undocumented functions */ -ZEXTERN const char * ZEXPORT zError OF((int)); -ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp)); -ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table OF((void)); -ZEXTERN int ZEXPORT inflateUndermine OF((z_streamp, int)); -ZEXTERN int ZEXPORT inflateResetKeep OF((z_streamp)); -ZEXTERN int ZEXPORT deflateResetKeep OF((z_streamp)); -#if defined(_WIN32) && !defined(Z_SOLO) -ZEXTERN gzFile ZEXPORT gzopen_w OF((const wchar_t *path, - const char *mode)); -#endif -#if defined(STDC) || defined(Z_HAVE_STDARG_H) -# ifndef Z_SOLO -ZEXTERN int ZEXPORTVA gzvprintf Z_ARG((gzFile file, - const char *format, - va_list va)); -# endif -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* ZLIB_H */ diff --git a/cocos2dx/platform/third_party/linux/libjpeg/jconfig.h b/cocos2dx/platform/third_party/linux/libjpeg/jconfig.h deleted file mode 100644 index 966b1d5149..0000000000 --- a/cocos2dx/platform/third_party/linux/libjpeg/jconfig.h +++ /dev/null @@ -1,54 +0,0 @@ -/* jconfig.h. Generated from jconfig.cfg by configure. */ -/* jconfig.cfg --- source file edited by configure script */ -/* see jconfig.txt for explanations */ - -#define HAVE_PROTOTYPES 1 -#define HAVE_UNSIGNED_CHAR 1 -#define HAVE_UNSIGNED_SHORT 1 -/* #undef void */ -/* #undef const */ -/* #undef CHAR_IS_UNSIGNED */ -#define HAVE_STDDEF_H 1 -#define HAVE_STDLIB_H 1 -#define HAVE_LOCALE_H 1 -/* #undef NEED_BSD_STRINGS */ -/* #undef NEED_SYS_TYPES_H */ -/* #undef NEED_FAR_POINTERS */ -/* #undef NEED_SHORT_EXTERNAL_NAMES */ -/* Define this if you get warnings about undefined structures. */ -/* #undef INCOMPLETE_TYPES_BROKEN */ - -/* Define "boolean" as unsigned char, not int, on Windows systems. */ -#ifdef _WIN32 -#ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */ -typedef unsigned char boolean; -#endif -#define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */ -#endif - -#ifdef JPEG_INTERNALS - -/* #undef RIGHT_SHIFT_IS_UNSIGNED */ -#define INLINE __inline__ -/* These are for configuring the JPEG memory manager. */ -/* #undef DEFAULT_MAX_MEM */ -/* #undef NO_MKTEMP */ - -#endif /* JPEG_INTERNALS */ - -#ifdef JPEG_CJPEG_DJPEG - -#define BMP_SUPPORTED /* BMP image file format */ -#define GIF_SUPPORTED /* GIF image file format */ -#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ -/* #undef RLE_SUPPORTED */ -#define TARGA_SUPPORTED /* Targa image file format */ - -/* #undef TWO_FILE_COMMANDLINE */ -/* #undef NEED_SIGNAL_CATCHER */ -/* #undef DONT_USE_B_MODE */ - -/* Define this if you want percent-done progress reports from cjpeg/djpeg. */ -/* #undef PROGRESS_REPORT */ - -#endif /* JPEG_CJPEG_DJPEG */ diff --git a/cocos2dx/platform/third_party/tizen/prebuilt/libwebp/include/decode.h b/cocos2dx/platform/third_party/tizen/prebuilt/libwebp/include/decode.h deleted file mode 100644 index 181eb18605..0000000000 --- a/cocos2dx/platform/third_party/tizen/prebuilt/libwebp/include/decode.h +++ /dev/null @@ -1,482 +0,0 @@ -// Copyright 2010 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Main decoding functions for WebP images. -// -// Author: Skal (pascal.massimino@gmail.com) - -#ifndef WEBP_WEBP_DECODE_H_ -#define WEBP_WEBP_DECODE_H_ - -#include "./types.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -#define WEBP_DECODER_ABI_VERSION 0x0201 // MAJOR(8b) + MINOR(8b) - -typedef struct WebPRGBABuffer WebPRGBABuffer; -typedef struct WebPYUVABuffer WebPYUVABuffer; -typedef struct WebPDecBuffer WebPDecBuffer; -#if !(defined(__cplusplus) || defined(c_plusplus)) -typedef enum VP8StatusCode VP8StatusCode; -typedef enum WEBP_CSP_MODE WEBP_CSP_MODE; -#endif -typedef struct WebPIDecoder WebPIDecoder; -typedef struct WebPBitstreamFeatures WebPBitstreamFeatures; -typedef struct WebPDecoderOptions WebPDecoderOptions; -typedef struct WebPDecoderConfig WebPDecoderConfig; - -// Return the decoder's version number, packed in hexadecimal using 8bits for -// each of major/minor/revision. E.g: v2.5.7 is 0x020507. -WEBP_EXTERN(int) WebPGetDecoderVersion(void); - -// Retrieve basic header information: width, height. -// This function will also validate the header and return 0 in -// case of formatting error. -// Pointers 'width' and 'height' can be passed NULL if deemed irrelevant. -WEBP_EXTERN(int) WebPGetInfo(const uint8_t* data, size_t data_size, - int* width, int* height); - -// Decodes WebP images pointed to by 'data' and returns RGBA samples, along -// with the dimensions in *width and *height. The ordering of samples in -// memory is R, G, B, A, R, G, B, A... in scan order (endian-independent). -// The returned pointer should be deleted calling free(). -// Returns NULL in case of error. -WEBP_EXTERN(uint8_t*) WebPDecodeRGBA(const uint8_t* data, size_t data_size, - int* width, int* height); - -// Same as WebPDecodeRGBA, but returning A, R, G, B, A, R, G, B... ordered data. -WEBP_EXTERN(uint8_t*) WebPDecodeARGB(const uint8_t* data, size_t data_size, - int* width, int* height); - -// Same as WebPDecodeRGBA, but returning B, G, R, A, B, G, R, A... ordered data. -WEBP_EXTERN(uint8_t*) WebPDecodeBGRA(const uint8_t* data, size_t data_size, - int* width, int* height); - -// Same as WebPDecodeRGBA, but returning R, G, B, R, G, B... ordered data. -// If the bitstream contains transparency, it is ignored. -WEBP_EXTERN(uint8_t*) WebPDecodeRGB(const uint8_t* data, size_t data_size, - int* width, int* height); - -// Same as WebPDecodeRGB, but returning B, G, R, B, G, R... ordered data. -WEBP_EXTERN(uint8_t*) WebPDecodeBGR(const uint8_t* data, size_t data_size, - int* width, int* height); - - -// Decode WebP images pointed to by 'data' to Y'UV format(*). The pointer -// returned is the Y samples buffer. Upon return, *u and *v will point to -// the U and V chroma data. These U and V buffers need NOT be free()'d, -// unlike the returned Y luma one. The dimension of the U and V planes -// are both (*width + 1) / 2 and (*height + 1)/ 2. -// Upon return, the Y buffer has a stride returned as '*stride', while U and V -// have a common stride returned as '*uv_stride'. -// Return NULL in case of error. -// (*) Also named Y'CbCr. See: http://en.wikipedia.org/wiki/YCbCr -WEBP_EXTERN(uint8_t*) WebPDecodeYUV(const uint8_t* data, size_t data_size, - int* width, int* height, - uint8_t** u, uint8_t** v, - int* stride, int* uv_stride); - -// These five functions are variants of the above ones, that decode the image -// directly into a pre-allocated buffer 'output_buffer'. The maximum storage -// available in this buffer is indicated by 'output_buffer_size'. If this -// storage is not sufficient (or an error occurred), NULL is returned. -// Otherwise, output_buffer is returned, for convenience. -// The parameter 'output_stride' specifies the distance (in bytes) -// between scanlines. Hence, output_buffer_size is expected to be at least -// output_stride x picture-height. -WEBP_EXTERN(uint8_t*) WebPDecodeRGBAInto( - const uint8_t* data, size_t data_size, - uint8_t* output_buffer, size_t output_buffer_size, int output_stride); -WEBP_EXTERN(uint8_t*) WebPDecodeARGBInto( - const uint8_t* data, size_t data_size, - uint8_t* output_buffer, size_t output_buffer_size, int output_stride); -WEBP_EXTERN(uint8_t*) WebPDecodeBGRAInto( - const uint8_t* data, size_t data_size, - uint8_t* output_buffer, size_t output_buffer_size, int output_stride); - -// RGB and BGR variants. Here too the transparency information, if present, -// will be dropped and ignored. -WEBP_EXTERN(uint8_t*) WebPDecodeRGBInto( - const uint8_t* data, size_t data_size, - uint8_t* output_buffer, size_t output_buffer_size, int output_stride); -WEBP_EXTERN(uint8_t*) WebPDecodeBGRInto( - const uint8_t* data, size_t data_size, - uint8_t* output_buffer, size_t output_buffer_size, int output_stride); - -// WebPDecodeYUVInto() is a variant of WebPDecodeYUV() that operates directly -// into pre-allocated luma/chroma plane buffers. This function requires the -// strides to be passed: one for the luma plane and one for each of the -// chroma ones. The size of each plane buffer is passed as 'luma_size', -// 'u_size' and 'v_size' respectively. -// Pointer to the luma plane ('*luma') is returned or NULL if an error occurred -// during decoding (or because some buffers were found to be too small). -WEBP_EXTERN(uint8_t*) WebPDecodeYUVInto( - const uint8_t* data, size_t data_size, - uint8_t* luma, size_t luma_size, int luma_stride, - uint8_t* u, size_t u_size, int u_stride, - uint8_t* v, size_t v_size, int v_stride); - -//------------------------------------------------------------------------------ -// Output colorspaces and buffer - -// Colorspaces -// Note: the naming describes the byte-ordering of packed samples in memory. -// For instance, MODE_BGRA relates to samples ordered as B,G,R,A,B,G,R,A,... -// Non-capital names (e.g.:MODE_Argb) relates to pre-multiplied RGB channels. -// RGBA-4444 and RGB-565 colorspaces are represented by following byte-order: -// RGBA-4444: [r3 r2 r1 r0 g3 g2 g1 g0], [b3 b2 b1 b0 a3 a2 a1 a0], ... -// RGB-565: [r4 r3 r2 r1 r0 g5 g4 g3], [g2 g1 g0 b4 b3 b2 b1 b0], ... -// In the case WEBP_SWAP_16BITS_CSP is defined, the bytes are swapped for -// these two modes: -// RGBA-4444: [b3 b2 b1 b0 a3 a2 a1 a0], [r3 r2 r1 r0 g3 g2 g1 g0], ... -// RGB-565: [g2 g1 g0 b4 b3 b2 b1 b0], [r4 r3 r2 r1 r0 g5 g4 g3], ... - -enum WEBP_CSP_MODE { - MODE_RGB = 0, MODE_RGBA = 1, - MODE_BGR = 2, MODE_BGRA = 3, - MODE_ARGB = 4, MODE_RGBA_4444 = 5, - MODE_RGB_565 = 6, - // RGB-premultiplied transparent modes (alpha value is preserved) - MODE_rgbA = 7, - MODE_bgrA = 8, - MODE_Argb = 9, - MODE_rgbA_4444 = 10, - // YUV modes must come after RGB ones. - MODE_YUV = 11, MODE_YUVA = 12, // yuv 4:2:0 - MODE_LAST = 13 -}; - -// Some useful macros: -static WEBP_INLINE int WebPIsPremultipliedMode(WEBP_CSP_MODE mode) { - return (mode == MODE_rgbA || mode == MODE_bgrA || mode == MODE_Argb || - mode == MODE_rgbA_4444); -} - -static WEBP_INLINE int WebPIsAlphaMode(WEBP_CSP_MODE mode) { - return (mode == MODE_RGBA || mode == MODE_BGRA || mode == MODE_ARGB || - mode == MODE_RGBA_4444 || mode == MODE_YUVA || - WebPIsPremultipliedMode(mode)); -} - -static WEBP_INLINE int WebPIsRGBMode(WEBP_CSP_MODE mode) { - return (mode < MODE_YUV); -} - -//------------------------------------------------------------------------------ -// WebPDecBuffer: Generic structure for describing the output sample buffer. - -struct WebPRGBABuffer { // view as RGBA - uint8_t* rgba; // pointer to RGBA samples - int stride; // stride in bytes from one scanline to the next. - size_t size; // total size of the *rgba buffer. -}; - -struct WebPYUVABuffer { // view as YUVA - uint8_t* y, *u, *v, *a; // pointer to luma, chroma U/V, alpha samples - int y_stride; // luma stride - int u_stride, v_stride; // chroma strides - int a_stride; // alpha stride - size_t y_size; // luma plane size - size_t u_size, v_size; // chroma planes size - size_t a_size; // alpha-plane size -}; - -// Output buffer -struct WebPDecBuffer { - WEBP_CSP_MODE colorspace; // Colorspace. - int width, height; // Dimensions. - int is_external_memory; // If true, 'internal_memory' pointer is not used. - union { - WebPRGBABuffer RGBA; - WebPYUVABuffer YUVA; - } u; // Nameless union of buffer parameters. - uint32_t pad[4]; // padding for later use - - uint8_t* private_memory; // Internally allocated memory (only when - // is_external_memory is false). Should not be used - // externally, but accessed via the buffer union. -}; - -// Internal, version-checked, entry point -WEBP_EXTERN(int) WebPInitDecBufferInternal(WebPDecBuffer*, int); - -// Initialize the structure as empty. Must be called before any other use. -// Returns false in case of version mismatch -static WEBP_INLINE int WebPInitDecBuffer(WebPDecBuffer* buffer) { - return WebPInitDecBufferInternal(buffer, WEBP_DECODER_ABI_VERSION); -} - -// Free any memory associated with the buffer. Must always be called last. -// Note: doesn't free the 'buffer' structure itself. -WEBP_EXTERN(void) WebPFreeDecBuffer(WebPDecBuffer* buffer); - -//------------------------------------------------------------------------------ -// Enumeration of the status codes - -enum VP8StatusCode { - VP8_STATUS_OK = 0, - VP8_STATUS_OUT_OF_MEMORY, - VP8_STATUS_INVALID_PARAM, - VP8_STATUS_BITSTREAM_ERROR, - VP8_STATUS_UNSUPPORTED_FEATURE, - VP8_STATUS_SUSPENDED, - VP8_STATUS_USER_ABORT, - VP8_STATUS_NOT_ENOUGH_DATA -}; - -//------------------------------------------------------------------------------ -// Incremental decoding -// -// This API allows streamlined decoding of partial data. -// Picture can be incrementally decoded as data become available thanks to the -// WebPIDecoder object. This object can be left in a SUSPENDED state if the -// picture is only partially decoded, pending additional input. -// Code example: -// -// WebPInitDecBuffer(&buffer); -// buffer.colorspace = mode; -// ... -// WebPIDecoder* idec = WebPINewDecoder(&buffer); -// while (has_more_data) { -// // ... (get additional data) -// status = WebPIAppend(idec, new_data, new_data_size); -// if (status != VP8_STATUS_SUSPENDED || -// break; -// } -// -// // The above call decodes the current available buffer. -// // Part of the image can now be refreshed by calling to -// // WebPIDecGetRGB()/WebPIDecGetYUVA() etc. -// } -// WebPIDelete(idec); - -// Creates a new incremental decoder with the supplied buffer parameter. -// This output_buffer can be passed NULL, in which case a default output buffer -// is used (with MODE_RGB). Otherwise, an internal reference to 'output_buffer' -// is kept, which means that the lifespan of 'output_buffer' must be larger than -// that of the returned WebPIDecoder object. -// Returns NULL if the allocation failed. -WEBP_EXTERN(WebPIDecoder*) WebPINewDecoder(WebPDecBuffer* output_buffer); - -// This function allocates and initializes an incremental-decoder object, which -// will output the RGB/A samples specified by 'csp' into a preallocated -// buffer 'output_buffer'. The size of this buffer is at least -// 'output_buffer_size' and the stride (distance in bytes between two scanlines) -// is specified by 'output_stride'. -// Additionally, output_buffer can be passed NULL in which case the output -// buffer will be allocated automatically when the decoding starts. The -// colorspace 'csp' is taken into account for allocating this buffer. All other -// parameters are ignored. -// Returns NULL if the allocation failed, or if some parameters are invalid. -WEBP_EXTERN(WebPIDecoder*) WebPINewRGB( - WEBP_CSP_MODE csp, - uint8_t* output_buffer, size_t output_buffer_size, int output_stride); - -// This function allocates and initializes an incremental-decoder object, which -// will output the raw luma/chroma samples into a preallocated planes if -// supplied. The luma plane is specified by its pointer 'luma', its size -// 'luma_size' and its stride 'luma_stride'. Similarly, the chroma-u plane -// is specified by the 'u', 'u_size' and 'u_stride' parameters, and the chroma-v -// plane by 'v' and 'v_size'. And same for the alpha-plane. The 'a' pointer -// can be pass NULL in case one is not interested in the transparency plane. -// Conversely, 'luma' can be passed NULL if no preallocated planes are supplied. -// In this case, the output buffer will be automatically allocated (using -// MODE_YUVA) when decoding starts. All parameters are then ignored. -// Returns NULL if the allocation failed or if a parameter is invalid. -WEBP_EXTERN(WebPIDecoder*) WebPINewYUVA( - uint8_t* luma, size_t luma_size, int luma_stride, - uint8_t* u, size_t u_size, int u_stride, - uint8_t* v, size_t v_size, int v_stride, - uint8_t* a, size_t a_size, int a_stride); - -// Deprecated version of the above, without the alpha plane. -// Kept for backward compatibility. -WEBP_EXTERN(WebPIDecoder*) WebPINewYUV( - uint8_t* luma, size_t luma_size, int luma_stride, - uint8_t* u, size_t u_size, int u_stride, - uint8_t* v, size_t v_size, int v_stride); - -// Deletes the WebPIDecoder object and associated memory. Must always be called -// if WebPINewDecoder, WebPINewRGB or WebPINewYUV succeeded. -WEBP_EXTERN(void) WebPIDelete(WebPIDecoder* idec); - -// Copies and decodes the next available data. Returns VP8_STATUS_OK when -// the image is successfully decoded. Returns VP8_STATUS_SUSPENDED when more -// data is expected. Returns error in other cases. -WEBP_EXTERN(VP8StatusCode) WebPIAppend( - WebPIDecoder* idec, const uint8_t* data, size_t data_size); - -// A variant of the above function to be used when data buffer contains -// partial data from the beginning. In this case data buffer is not copied -// to the internal memory. -// Note that the value of the 'data' pointer can change between calls to -// WebPIUpdate, for instance when the data buffer is resized to fit larger data. -WEBP_EXTERN(VP8StatusCode) WebPIUpdate( - WebPIDecoder* idec, const uint8_t* data, size_t data_size); - -// Returns the RGB/A image decoded so far. Returns NULL if output params -// are not initialized yet. The RGB/A output type corresponds to the colorspace -// specified during call to WebPINewDecoder() or WebPINewRGB(). -// *last_y is the index of last decoded row in raster scan order. Some pointers -// (*last_y, *width etc.) can be NULL if corresponding information is not -// needed. -WEBP_EXTERN(uint8_t*) WebPIDecGetRGB( - const WebPIDecoder* idec, int* last_y, - int* width, int* height, int* stride); - -// Same as above function to get a YUVA image. Returns pointer to the luma -// plane or NULL in case of error. If there is no alpha information -// the alpha pointer '*a' will be returned NULL. -WEBP_EXTERN(uint8_t*) WebPIDecGetYUVA( - const WebPIDecoder* idec, int* last_y, - uint8_t** u, uint8_t** v, uint8_t** a, - int* width, int* height, int* stride, int* uv_stride, int* a_stride); - -// Deprecated alpha-less version of WebPIDecGetYUVA(): it will ignore the -// alpha information (if present). Kept for backward compatibility. -static WEBP_INLINE uint8_t* WebPIDecGetYUV( - const WebPIDecoder* idec, int* last_y, uint8_t** u, uint8_t** v, - int* width, int* height, int* stride, int* uv_stride) { - return WebPIDecGetYUVA(idec, last_y, u, v, NULL, width, height, - stride, uv_stride, NULL); -} - -// Generic call to retrieve information about the displayable area. -// If non NULL, the left/right/width/height pointers are filled with the visible -// rectangular area so far. -// Returns NULL in case the incremental decoder object is in an invalid state. -// Otherwise returns the pointer to the internal representation. This structure -// is read-only, tied to WebPIDecoder's lifespan and should not be modified. -WEBP_EXTERN(const WebPDecBuffer*) WebPIDecodedArea( - const WebPIDecoder* idec, int* left, int* top, int* width, int* height); - -//------------------------------------------------------------------------------ -// Advanced decoding parametrization -// -// Code sample for using the advanced decoding API -/* - // A) Init a configuration object - WebPDecoderConfig config; - CHECK(WebPInitDecoderConfig(&config)); - - // B) optional: retrieve the bitstream's features. - CHECK(WebPGetFeatures(data, data_size, &config.input) == VP8_STATUS_OK); - - // C) Adjust 'config', if needed - config.no_fancy_upsampling = 1; - config.output.colorspace = MODE_BGRA; - // etc. - - // Note that you can also make config.output point to an externally - // supplied memory buffer, provided it's big enough to store the decoded - // picture. Otherwise, config.output will just be used to allocate memory - // and store the decoded picture. - - // D) Decode! - CHECK(WebPDecode(data, data_size, &config) == VP8_STATUS_OK); - - // E) Decoded image is now in config.output (and config.output.u.RGBA) - - // F) Reclaim memory allocated in config's object. It's safe to call - // this function even if the memory is external and wasn't allocated - // by WebPDecode(). - WebPFreeDecBuffer(&config.output); -*/ - -// Features gathered from the bitstream -struct WebPBitstreamFeatures { - int width; // Width in pixels, as read from the bitstream. - int height; // Height in pixels, as read from the bitstream. - int has_alpha; // True if the bitstream contains an alpha channel. - int has_animation; // True if the bitstream is an animation. - - // Unused for now: - int bitstream_version; // should be 0 for now. TODO(later) - int no_incremental_decoding; // if true, using incremental decoding is not - // recommended. - int rotate; // TODO(later) - int uv_sampling; // should be 0 for now. TODO(later) - uint32_t pad[2]; // padding for later use -}; - -// Internal, version-checked, entry point -WEBP_EXTERN(VP8StatusCode) WebPGetFeaturesInternal( - const uint8_t*, size_t, WebPBitstreamFeatures*, int); - -// Retrieve features from the bitstream. The *features structure is filled -// with information gathered from the bitstream. -// Returns VP8_STATUS_OK when the features are successfully retrieved. Returns -// VP8_STATUS_NOT_ENOUGH_DATA when more data is needed to retrieve the -// features from headers. Returns error in other cases. -static WEBP_INLINE VP8StatusCode WebPGetFeatures( - const uint8_t* data, size_t data_size, - WebPBitstreamFeatures* features) { - return WebPGetFeaturesInternal(data, data_size, features, - WEBP_DECODER_ABI_VERSION); -} - -// Decoding options -struct WebPDecoderOptions { - int bypass_filtering; // if true, skip the in-loop filtering - int no_fancy_upsampling; // if true, use faster pointwise upsampler - int use_cropping; // if true, cropping is applied _first_ - int crop_left, crop_top; // top-left position for cropping. - // Will be snapped to even values. - int crop_width, crop_height; // dimension of the cropping area - int use_scaling; // if true, scaling is applied _afterward_ - int scaled_width, scaled_height; // final resolution - int use_threads; // if true, use multi-threaded decoding - - // Unused for now: - int force_rotation; // forced rotation (to be applied _last_) - int no_enhancement; // if true, discard enhancement layer - uint32_t pad[6]; // padding for later use -}; - -// Main object storing the configuration for advanced decoding. -struct WebPDecoderConfig { - WebPBitstreamFeatures input; // Immutable bitstream features (optional) - WebPDecBuffer output; // Output buffer (can point to external mem) - WebPDecoderOptions options; // Decoding options -}; - -// Internal, version-checked, entry point -WEBP_EXTERN(int) WebPInitDecoderConfigInternal(WebPDecoderConfig*, int); - -// Initialize the configuration as empty. This function must always be -// called first, unless WebPGetFeatures() is to be called. -// Returns false in case of mismatched version. -static WEBP_INLINE int WebPInitDecoderConfig(WebPDecoderConfig* config) { - return WebPInitDecoderConfigInternal(config, WEBP_DECODER_ABI_VERSION); -} - -// Instantiate a new incremental decoder object with the requested -// configuration. The bitstream can be passed using 'data' and 'data_size' -// parameter, in which case the features will be parsed and stored into -// config->input. Otherwise, 'data' can be NULL and no parsing will occur. -// Note that 'config' can be NULL too, in which case a default configuration -// is used. -// The return WebPIDecoder object must always be deleted calling WebPIDelete(). -// Returns NULL in case of error (and config->status will then reflect -// the error condition). -WEBP_EXTERN(WebPIDecoder*) WebPIDecode(const uint8_t* data, size_t data_size, - WebPDecoderConfig* config); - -// Non-incremental version. This version decodes the full data at once, taking -// 'config' into account. Returns decoding status (which should be VP8_STATUS_OK -// if the decoding was successful). -WEBP_EXTERN(VP8StatusCode) WebPDecode(const uint8_t* data, size_t data_size, - WebPDecoderConfig* config); - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif - -#endif /* WEBP_WEBP_DECODE_H_ */ diff --git a/cocos2dx/platform/third_party/tizen/prebuilt/libwebp/include/encode.h b/cocos2dx/platform/third_party/tizen/prebuilt/libwebp/include/encode.h deleted file mode 100644 index fea8ee428d..0000000000 --- a/cocos2dx/platform/third_party/tizen/prebuilt/libwebp/include/encode.h +++ /dev/null @@ -1,480 +0,0 @@ -// Copyright 2011 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// WebP encoder: main interface -// -// Author: Skal (pascal.massimino@gmail.com) - -#ifndef WEBP_WEBP_ENCODE_H_ -#define WEBP_WEBP_ENCODE_H_ - -#include "./types.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -#define WEBP_ENCODER_ABI_VERSION 0x0201 // MAJOR(8b) + MINOR(8b) - -#if !(defined(__cplusplus) || defined(c_plusplus)) -typedef enum WebPImageHint WebPImageHint; -typedef enum WebPEncCSP WebPEncCSP; -typedef enum WebPPreset WebPPreset; -typedef enum WebPEncodingError WebPEncodingError; -#endif -typedef struct WebPConfig WebPConfig; -typedef struct WebPPicture WebPPicture; // main structure for I/O -typedef struct WebPAuxStats WebPAuxStats; -typedef struct WebPMemoryWriter WebPMemoryWriter; - -// Return the encoder's version number, packed in hexadecimal using 8bits for -// each of major/minor/revision. E.g: v2.5.7 is 0x020507. -WEBP_EXTERN(int) WebPGetEncoderVersion(void); - -//------------------------------------------------------------------------------ -// One-stop-shop call! No questions asked: - -// Returns the size of the compressed data (pointed to by *output), or 0 if -// an error occurred. The compressed data must be released by the caller -// using the call 'free(*output)'. -// These functions compress using the lossy format, and the quality_factor -// can go from 0 (smaller output, lower quality) to 100 (best quality, -// larger output). -WEBP_EXTERN(size_t) WebPEncodeRGB(const uint8_t* rgb, - int width, int height, int stride, - float quality_factor, uint8_t** output); -WEBP_EXTERN(size_t) WebPEncodeBGR(const uint8_t* bgr, - int width, int height, int stride, - float quality_factor, uint8_t** output); -WEBP_EXTERN(size_t) WebPEncodeRGBA(const uint8_t* rgba, - int width, int height, int stride, - float quality_factor, uint8_t** output); -WEBP_EXTERN(size_t) WebPEncodeBGRA(const uint8_t* bgra, - int width, int height, int stride, - float quality_factor, uint8_t** output); - -// These functions are the equivalent of the above, but compressing in a -// lossless manner. Files are usually larger than lossy format, but will -// not suffer any compression loss. -WEBP_EXTERN(size_t) WebPEncodeLosslessRGB(const uint8_t* rgb, - int width, int height, int stride, - uint8_t** output); -WEBP_EXTERN(size_t) WebPEncodeLosslessBGR(const uint8_t* bgr, - int width, int height, int stride, - uint8_t** output); -WEBP_EXTERN(size_t) WebPEncodeLosslessRGBA(const uint8_t* rgba, - int width, int height, int stride, - uint8_t** output); -WEBP_EXTERN(size_t) WebPEncodeLosslessBGRA(const uint8_t* bgra, - int width, int height, int stride, - uint8_t** output); - -//------------------------------------------------------------------------------ -// Coding parameters - -// Image characteristics hint for the underlying encoder. -enum WebPImageHint { - WEBP_HINT_DEFAULT = 0, // default preset. - WEBP_HINT_PICTURE, // digital picture, like portrait, inner shot - WEBP_HINT_PHOTO, // outdoor photograph, with natural lighting - WEBP_HINT_GRAPH, // Discrete tone image (graph, map-tile etc). - WEBP_HINT_LAST -}; - -// Compression parameters. -struct WebPConfig { - int lossless; // Lossless encoding (0=lossy(default), 1=lossless). - float quality; // between 0 (smallest file) and 100 (biggest) - int method; // quality/speed trade-off (0=fast, 6=slower-better) - - WebPImageHint image_hint; // Hint for image type (lossless only for now). - - // Parameters related to lossy compression only: - int target_size; // if non-zero, set the desired target size in bytes. - // Takes precedence over the 'compression' parameter. - float target_PSNR; // if non-zero, specifies the minimal distortion to - // try to achieve. Takes precedence over target_size. - int segments; // maximum number of segments to use, in [1..4] - int sns_strength; // Spatial Noise Shaping. 0=off, 100=maximum. - int filter_strength; // range: [0 = off .. 100 = strongest] - int filter_sharpness; // range: [0 = off .. 7 = least sharp] - int filter_type; // filtering type: 0 = simple, 1 = strong (only used - // if filter_strength > 0 or autofilter > 0) - int autofilter; // Auto adjust filter's strength [0 = off, 1 = on] - int alpha_compression; // Algorithm for encoding the alpha plane (0 = none, - // 1 = compressed with WebP lossless). Default is 1. - int alpha_filtering; // Predictive filtering method for alpha plane. - // 0: none, 1: fast, 2: best. Default if 1. - int alpha_quality; // Between 0 (smallest size) and 100 (lossless). - // Default is 100. - int pass; // number of entropy-analysis passes (in [1..10]). - - int show_compressed; // if true, export the compressed picture back. - // In-loop filtering is not applied. - int preprocessing; // preprocessing filter (0=none, 1=segment-smooth) - int partitions; // log2(number of token partitions) in [0..3]. Default - // is set to 0 for easier progressive decoding. - int partition_limit; // quality degradation allowed to fit the 512k limit - // on prediction modes coding (0: no degradation, - // 100: maximum possible degradation). - int emulate_jpeg_size; // If true, compression parameters will be remapped - // to better match the expected output size from - // JPEG compression. Generally, the output size will - // be similar but the degradation will be lower. - int thread_level; // If non-zero, try and use multi-threaded encoding. - int low_memory; // If set, reduce memory usage (but increase CPU use). - - uint32_t pad[5]; // padding for later use -}; - -// Enumerate some predefined settings for WebPConfig, depending on the type -// of source picture. These presets are used when calling WebPConfigPreset(). -enum WebPPreset { - WEBP_PRESET_DEFAULT = 0, // default preset. - WEBP_PRESET_PICTURE, // digital picture, like portrait, inner shot - WEBP_PRESET_PHOTO, // outdoor photograph, with natural lighting - WEBP_PRESET_DRAWING, // hand or line drawing, with high-contrast details - WEBP_PRESET_ICON, // small-sized colorful images - WEBP_PRESET_TEXT // text-like -}; - -// Internal, version-checked, entry point -WEBP_EXTERN(int) WebPConfigInitInternal(WebPConfig*, WebPPreset, float, int); - -// Should always be called, to initialize a fresh WebPConfig structure before -// modification. Returns false in case of version mismatch. WebPConfigInit() -// must have succeeded before using the 'config' object. -// Note that the default values are lossless=0 and quality=75. -static WEBP_INLINE int WebPConfigInit(WebPConfig* config) { - return WebPConfigInitInternal(config, WEBP_PRESET_DEFAULT, 75.f, - WEBP_ENCODER_ABI_VERSION); -} - -// This function will initialize the configuration according to a predefined -// set of parameters (referred to by 'preset') and a given quality factor. -// This function can be called as a replacement to WebPConfigInit(). Will -// return false in case of error. -static WEBP_INLINE int WebPConfigPreset(WebPConfig* config, - WebPPreset preset, float quality) { - return WebPConfigInitInternal(config, preset, quality, - WEBP_ENCODER_ABI_VERSION); -} - -// Returns true if 'config' is non-NULL and all configuration parameters are -// within their valid ranges. -WEBP_EXTERN(int) WebPValidateConfig(const WebPConfig* config); - -//------------------------------------------------------------------------------ -// Input / Output -// Structure for storing auxiliary statistics (mostly for lossy encoding). - -struct WebPAuxStats { - int coded_size; // final size - - float PSNR[5]; // peak-signal-to-noise ratio for Y/U/V/All/Alpha - int block_count[3]; // number of intra4/intra16/skipped macroblocks - int header_bytes[2]; // approximate number of bytes spent for header - // and mode-partition #0 - int residual_bytes[3][4]; // approximate number of bytes spent for - // DC/AC/uv coefficients for each (0..3) segments. - int segment_size[4]; // number of macroblocks in each segments - int segment_quant[4]; // quantizer values for each segments - int segment_level[4]; // filtering strength for each segments [0..63] - - int alpha_data_size; // size of the transparency data - int layer_data_size; // size of the enhancement layer data - - // lossless encoder statistics - uint32_t lossless_features; // bit0:predictor bit1:cross-color transform - // bit2:subtract-green bit3:color indexing - int histogram_bits; // number of precision bits of histogram - int transform_bits; // precision bits for transform - int cache_bits; // number of bits for color cache lookup - int palette_size; // number of color in palette, if used - int lossless_size; // final lossless size - - uint32_t pad[4]; // padding for later use -}; - -// Signature for output function. Should return true if writing was successful. -// data/data_size is the segment of data to write, and 'picture' is for -// reference (and so one can make use of picture->custom_ptr). -typedef int (*WebPWriterFunction)(const uint8_t* data, size_t data_size, - const WebPPicture* picture); - -// WebPMemoryWrite: a special WebPWriterFunction that writes to memory using -// the following WebPMemoryWriter object (to be set as a custom_ptr). -struct WebPMemoryWriter { - uint8_t* mem; // final buffer (of size 'max_size', larger than 'size'). - size_t size; // final size - size_t max_size; // total capacity - uint32_t pad[1]; // padding for later use -}; - -// The following must be called first before any use. -WEBP_EXTERN(void) WebPMemoryWriterInit(WebPMemoryWriter* writer); - -// The custom writer to be used with WebPMemoryWriter as custom_ptr. Upon -// completion, writer.mem and writer.size will hold the coded data. -// writer.mem must be freed using the call 'free(writer.mem)'. -WEBP_EXTERN(int) WebPMemoryWrite(const uint8_t* data, size_t data_size, - const WebPPicture* picture); - -// Progress hook, called from time to time to report progress. It can return -// false to request an abort of the encoding process, or true otherwise if -// everything is OK. -typedef int (*WebPProgressHook)(int percent, const WebPPicture* picture); - -// Color spaces. -enum WebPEncCSP { - // chroma sampling - WEBP_YUV420 = 0, // 4:2:0 - WEBP_YUV422 = 1, // 4:2:2 - WEBP_YUV444 = 2, // 4:4:4 - WEBP_YUV400 = 3, // grayscale - WEBP_CSP_UV_MASK = 3, // bit-mask to get the UV sampling factors - // alpha channel variants - WEBP_YUV420A = 4, - WEBP_YUV422A = 5, - WEBP_YUV444A = 6, - WEBP_YUV400A = 7, // grayscale + alpha - WEBP_CSP_ALPHA_BIT = 4 // bit that is set if alpha is present -}; - -// Encoding error conditions. -enum WebPEncodingError { - VP8_ENC_OK = 0, - VP8_ENC_ERROR_OUT_OF_MEMORY, // memory error allocating objects - VP8_ENC_ERROR_BITSTREAM_OUT_OF_MEMORY, // memory error while flushing bits - VP8_ENC_ERROR_NULL_PARAMETER, // a pointer parameter is NULL - VP8_ENC_ERROR_INVALID_CONFIGURATION, // configuration is invalid - VP8_ENC_ERROR_BAD_DIMENSION, // picture has invalid width/height - VP8_ENC_ERROR_PARTITION0_OVERFLOW, // partition is bigger than 512k - VP8_ENC_ERROR_PARTITION_OVERFLOW, // partition is bigger than 16M - VP8_ENC_ERROR_BAD_WRITE, // error while flushing bytes - VP8_ENC_ERROR_FILE_TOO_BIG, // file is bigger than 4G - VP8_ENC_ERROR_USER_ABORT, // abort request by user - VP8_ENC_ERROR_LAST // list terminator. always last. -}; - -// maximum width/height allowed (inclusive), in pixels -#define WEBP_MAX_DIMENSION 16383 - -// Main exchange structure (input samples, output bytes, statistics) -struct WebPPicture { - // INPUT - ////////////// - // Main flag for encoder selecting between ARGB or YUV input. - // It is recommended to use ARGB input (*argb, argb_stride) for lossless - // compression, and YUV input (*y, *u, *v, etc.) for lossy compression - // since these are the respective native colorspace for these formats. - int use_argb; - - // YUV input (mostly used for input to lossy compression) - WebPEncCSP colorspace; // colorspace: should be YUV420 for now (=Y'CbCr). - int width, height; // dimensions (less or equal to WEBP_MAX_DIMENSION) - uint8_t *y, *u, *v; // pointers to luma/chroma planes. - int y_stride, uv_stride; // luma/chroma strides. - uint8_t* a; // pointer to the alpha plane - int a_stride; // stride of the alpha plane - uint32_t pad1[2]; // padding for later use - - // ARGB input (mostly used for input to lossless compression) - uint32_t* argb; // Pointer to argb (32 bit) plane. - int argb_stride; // This is stride in pixels units, not bytes. - uint32_t pad2[3]; // padding for later use - - // OUTPUT - /////////////// - // Byte-emission hook, to store compressed bytes as they are ready. - WebPWriterFunction writer; // can be NULL - void* custom_ptr; // can be used by the writer. - - // map for extra information (only for lossy compression mode) - int extra_info_type; // 1: intra type, 2: segment, 3: quant - // 4: intra-16 prediction mode, - // 5: chroma prediction mode, - // 6: bit cost, 7: distortion - uint8_t* extra_info; // if not NULL, points to an array of size - // ((width + 15) / 16) * ((height + 15) / 16) that - // will be filled with a macroblock map, depending - // on extra_info_type. - - // STATS AND REPORTS - /////////////////////////// - // Pointer to side statistics (updated only if not NULL) - WebPAuxStats* stats; - - // Error code for the latest error encountered during encoding - WebPEncodingError error_code; - - // If not NULL, report progress during encoding. - WebPProgressHook progress_hook; - - void* user_data; // this field is free to be set to any value and - // used during callbacks (like progress-report e.g.). - - uint32_t pad3[3]; // padding for later use - - // Unused for now: original samples (for non-YUV420 modes) - uint8_t *u0, *v0; - int uv0_stride; - - uint32_t pad4[7]; // padding for later use - - // PRIVATE FIELDS - //////////////////// - void* memory_; // row chunk of memory for yuva planes - void* memory_argb_; // and for argb too. - void* pad5[2]; // padding for later use -}; - -// Internal, version-checked, entry point -WEBP_EXTERN(int) WebPPictureInitInternal(WebPPicture*, int); - -// Should always be called, to initialize the structure. Returns false in case -// of version mismatch. WebPPictureInit() must have succeeded before using the -// 'picture' object. -// Note that, by default, use_argb is false and colorspace is WEBP_YUV420. -static WEBP_INLINE int WebPPictureInit(WebPPicture* picture) { - return WebPPictureInitInternal(picture, WEBP_ENCODER_ABI_VERSION); -} - -//------------------------------------------------------------------------------ -// WebPPicture utils - -// Convenience allocation / deallocation based on picture->width/height: -// Allocate y/u/v buffers as per colorspace/width/height specification. -// Note! This function will free the previous buffer if needed. -// Returns false in case of memory error. -WEBP_EXTERN(int) WebPPictureAlloc(WebPPicture* picture); - -// Release the memory allocated by WebPPictureAlloc() or WebPPictureImport*(). -// Note that this function does _not_ free the memory used by the 'picture' -// object itself. -// Besides memory (which is reclaimed) all other fields of 'picture' are -// preserved. -WEBP_EXTERN(void) WebPPictureFree(WebPPicture* picture); - -// Copy the pixels of *src into *dst, using WebPPictureAlloc. Upon return, -// *dst will fully own the copied pixels (this is not a view). -// Returns false in case of memory allocation error. -WEBP_EXTERN(int) WebPPictureCopy(const WebPPicture* src, WebPPicture* dst); - -// Compute PSNR, SSIM or LSIM distortion metric between two pictures. -// Result is in dB, stores in result[] in the Y/U/V/Alpha/All order. -// Returns false in case of error (src and ref don't have same dimension, ...) -// Warning: this function is rather CPU-intensive. -WEBP_EXTERN(int) WebPPictureDistortion( - const WebPPicture* src, const WebPPicture* ref, - int metric_type, // 0 = PSNR, 1 = SSIM, 2 = LSIM - float result[5]); - -// self-crops a picture to the rectangle defined by top/left/width/height. -// Returns false in case of memory allocation error, or if the rectangle is -// outside of the source picture. -// The rectangle for the view is defined by the top-left corner pixel -// coordinates (left, top) as well as its width and height. This rectangle -// must be fully be comprised inside the 'src' source picture. If the source -// picture uses the YUV420 colorspace, the top and left coordinates will be -// snapped to even values. -WEBP_EXTERN(int) WebPPictureCrop(WebPPicture* picture, - int left, int top, int width, int height); - -// Extracts a view from 'src' picture into 'dst'. The rectangle for the view -// is defined by the top-left corner pixel coordinates (left, top) as well -// as its width and height. This rectangle must be fully be comprised inside -// the 'src' source picture. If the source picture uses the YUV420 colorspace, -// the top and left coordinates will be snapped to even values. -// Picture 'src' must out-live 'dst' picture. Self-extraction of view is allowed -// ('src' equal to 'dst') as a mean of fast-cropping (but note that doing so, -// the original dimension will be lost). -// Returns false in case of memory allocation error or invalid parameters. -WEBP_EXTERN(int) WebPPictureView(const WebPPicture* src, - int left, int top, int width, int height, - WebPPicture* dst); - -// Returns true if the 'picture' is actually a view and therefore does -// not own the memory for pixels. -WEBP_EXTERN(int) WebPPictureIsView(const WebPPicture* picture); - -// Rescale a picture to new dimension width x height. -// Now gamma correction is applied. -// Returns false in case of error (invalid parameter or insufficient memory). -WEBP_EXTERN(int) WebPPictureRescale(WebPPicture* pic, int width, int height); - -// Colorspace conversion function to import RGB samples. -// Previous buffer will be free'd, if any. -// *rgb buffer should have a size of at least height * rgb_stride. -// Returns false in case of memory error. -WEBP_EXTERN(int) WebPPictureImportRGB( - WebPPicture* picture, const uint8_t* rgb, int rgb_stride); -// Same, but for RGBA buffer. -WEBP_EXTERN(int) WebPPictureImportRGBA( - WebPPicture* picture, const uint8_t* rgba, int rgba_stride); -// Same, but for RGBA buffer. Imports the RGB direct from the 32-bit format -// input buffer ignoring the alpha channel. Avoids needing to copy the data -// to a temporary 24-bit RGB buffer to import the RGB only. -WEBP_EXTERN(int) WebPPictureImportRGBX( - WebPPicture* picture, const uint8_t* rgbx, int rgbx_stride); - -// Variants of the above, but taking BGR(A|X) input. -WEBP_EXTERN(int) WebPPictureImportBGR( - WebPPicture* picture, const uint8_t* bgr, int bgr_stride); -WEBP_EXTERN(int) WebPPictureImportBGRA( - WebPPicture* picture, const uint8_t* bgra, int bgra_stride); -WEBP_EXTERN(int) WebPPictureImportBGRX( - WebPPicture* picture, const uint8_t* bgrx, int bgrx_stride); - -// Converts picture->argb data to the YUVA format specified by 'colorspace'. -// Upon return, picture->use_argb is set to false. The presence of real -// non-opaque transparent values is detected, and 'colorspace' will be -// adjusted accordingly. Note that this method is lossy. -// Returns false in case of error. -WEBP_EXTERN(int) WebPPictureARGBToYUVA(WebPPicture* picture, - WebPEncCSP colorspace); - -// Converts picture->yuv to picture->argb and sets picture->use_argb to true. -// The input format must be YUV_420 or YUV_420A. -// Note that the use of this method is discouraged if one has access to the -// raw ARGB samples, since using YUV420 is comparatively lossy. Also, the -// conversion from YUV420 to ARGB incurs a small loss too. -// Returns false in case of error. -WEBP_EXTERN(int) WebPPictureYUVAToARGB(WebPPicture* picture); - -// Helper function: given a width x height plane of YUV(A) samples -// (with stride 'stride'), clean-up the YUV samples under fully transparent -// area, to help compressibility (no guarantee, though). -WEBP_EXTERN(void) WebPCleanupTransparentArea(WebPPicture* picture); - -// Scan the picture 'picture' for the presence of non fully opaque alpha values. -// Returns true in such case. Otherwise returns false (indicating that the -// alpha plane can be ignored altogether e.g.). -WEBP_EXTERN(int) WebPPictureHasTransparency(const WebPPicture* picture); - -//------------------------------------------------------------------------------ -// Main call - -// Main encoding call, after config and picture have been initialized. -// 'picture' must be less than 16384x16384 in dimension (cf WEBP_MAX_DIMENSION), -// and the 'config' object must be a valid one. -// Returns false in case of error, true otherwise. -// In case of error, picture->error_code is updated accordingly. -// 'picture' can hold the source samples in both YUV(A) or ARGB input, depending -// on the value of 'picture->use_argb'. It is highly recommended to use -// the former for lossy encoding, and the latter for lossless encoding -// (when config.lossless is true). Automatic conversion from one format to -// another is provided but they both incur some loss. -WEBP_EXTERN(int) WebPEncode(const WebPConfig* config, WebPPicture* picture); - -//------------------------------------------------------------------------------ - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif - -#endif /* WEBP_WEBP_ENCODE_H_ */ diff --git a/cocos2dx/platform/third_party/tizen/prebuilt/libwebp/include/types.h b/cocos2dx/platform/third_party/tizen/prebuilt/libwebp/include/types.h deleted file mode 100644 index 3e27190bef..0000000000 --- a/cocos2dx/platform/third_party/tizen/prebuilt/libwebp/include/types.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2010 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Common types -// -// Author: Skal (pascal.massimino@gmail.com) - -#ifndef WEBP_WEBP_TYPES_H_ -#define WEBP_WEBP_TYPES_H_ - -#include // for size_t - -#ifndef _MSC_VER -#include -#ifdef __STRICT_ANSI__ -#define WEBP_INLINE -#else /* __STRICT_ANSI__ */ -#define WEBP_INLINE inline -#endif -#else -typedef signed char int8_t; -typedef unsigned char uint8_t; -typedef signed short int16_t; -typedef unsigned short uint16_t; -typedef signed int int32_t; -typedef unsigned int uint32_t; -typedef unsigned long long int uint64_t; -typedef long long int int64_t; -#define WEBP_INLINE __forceinline -#endif /* _MSC_VER */ - -#ifndef WEBP_EXTERN -// This explicitly marks library functions and allows for changing the -// signature for e.g., Windows DLL builds. -#define WEBP_EXTERN(type) extern type -#endif /* WEBP_EXTERN */ - -// Macro to check ABI compatibility (same major revision number) -#define WEBP_ABI_IS_INCOMPATIBLE(a, b) (((a) >> 8) != ((b) >> 8)) - -#endif /* WEBP_WEBP_TYPES_H_ */ diff --git a/cocos2dx/platform/third_party/tizen/prebuilt/libwebp/libs/armv7l/libwebp.a.REMOVED.git-id b/cocos2dx/platform/third_party/tizen/prebuilt/libwebp/libs/armv7l/libwebp.a.REMOVED.git-id deleted file mode 100644 index 55895bad03..0000000000 --- a/cocos2dx/platform/third_party/tizen/prebuilt/libwebp/libs/armv7l/libwebp.a.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -d1b52611b9daf7ae2bddfbafc9c53f85d9a03076 \ No newline at end of file diff --git a/cocos2dx/platform/third_party/tizen/prebuilt/libwebp/libs/x86/libwebp.a.REMOVED.git-id b/cocos2dx/platform/third_party/tizen/prebuilt/libwebp/libs/x86/libwebp.a.REMOVED.git-id deleted file mode 100644 index 62fd773d57..0000000000 --- a/cocos2dx/platform/third_party/tizen/prebuilt/libwebp/libs/x86/libwebp.a.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -4e9f805d733b2a5f3a7835601d0107df81598911 \ No newline at end of file diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/lib/libexpat.so.1.5.2 b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/lib/libexpat.so.1.5.2 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/lib/libexpat.so.REMOVED.git-id b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/lib/libexpat.so.REMOVED.git-id deleted file mode 100644 index 69710abf7d..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/lib/libexpat.so.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -4b4ce233c67c2bf8071b96cc330894125d07722f \ No newline at end of file diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/lib/libz.so.1.2.5 b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/lib/libz.so.1.2.5 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/lib/libz.so.REMOVED.git-id b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/lib/libz.so.REMOVED.git-id deleted file mode 100644 index 2cfc231c13..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/lib/libz.so.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -723e134840fbf51fb73b53d142f398b4cfd6d833 \ No newline at end of file diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/curl/curl.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/curl/curl.h deleted file mode 100644 index 5b39a24bf4..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/curl/curl.h +++ /dev/null @@ -1,2232 +0,0 @@ -#ifndef __CURL_CURL_H -#define __CURL_CURL_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - ***************************************************************************/ - -/* - * If you have libcurl problems, all docs and details are found here: - * http://curl.haxx.se/libcurl/ - * - * curl-library mailing list subscription and unsubscription web interface: - * http://cool.haxx.se/mailman/listinfo/curl-library/ - */ - -#include "curlver.h" /* libcurl version defines */ -#include "curlbuild.h" /* libcurl build definitions */ -#include "curlrules.h" /* libcurl rules enforcement */ - -/* - * Define WIN32 when build target is Win32 API - */ - -#if (defined(_WIN32) || defined(__WIN32__)) && \ - !defined(WIN32) && !defined(__SYMBIAN32__) -#define WIN32 -#endif - -#include -#include - -#if defined(__FreeBSD__) && (__FreeBSD__ >= 2) -/* Needed for __FreeBSD_version symbol definition */ -#include -#endif - -/* The include stuff here below is mainly for time_t! */ -#include -#include - -#if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__CYGWIN__) -#if !(defined(_WINSOCKAPI_) || defined(_WINSOCK_H) || defined(__LWIP_OPT_H__)) -/* The check above prevents the winsock2 inclusion if winsock.h already was - included, since they can't co-exist without problems */ -#include -#include -#endif -#endif - -/* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish - libc5-based Linux systems. Only include it on systems that are known to - require it! */ -#if defined(_AIX) || defined(__NOVELL_LIBC__) || defined(__NetBSD__) || \ - defined(__minix) || defined(__SYMBIAN32__) || defined(__INTEGRITY) || \ - defined(ANDROID) || defined(__ANDROID__) || \ - (defined(__FreeBSD_version) && (__FreeBSD_version < 800000)) -#include -#endif - -#if !defined(WIN32) && !defined(_WIN32_WCE) -#include -#endif - -#if !defined(WIN32) && !defined(__WATCOMC__) && !defined(__VXWORKS__) -#include -#endif - -#ifdef __BEOS__ -#include -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -typedef void CURL; - -/* - * Decorate exportable functions for Win32 and Symbian OS DLL linking. - * This avoids using a .def file for building libcurl.dll. - */ -#if (defined(WIN32) || defined(_WIN32) || defined(__SYMBIAN32__)) && \ - !defined(CURL_STATICLIB) -#if defined(BUILDING_LIBCURL) -#define CURL_EXTERN __declspec(dllexport) -#else -#define CURL_EXTERN __declspec(dllimport) -#endif -#else - -#ifdef CURL_HIDDEN_SYMBOLS -/* - * This definition is used to make external definitions visible in the - * shared library when symbols are hidden by default. It makes no - * difference when compiling applications whether this is set or not, - * only when compiling the library. - */ -#define CURL_EXTERN CURL_EXTERN_SYMBOL -#else -#define CURL_EXTERN -#endif -#endif - -#ifndef curl_socket_typedef -/* socket typedef */ -#if defined(WIN32) && !defined(__LWIP_OPT_H__) -typedef SOCKET curl_socket_t; -#define CURL_SOCKET_BAD INVALID_SOCKET -#else -typedef int curl_socket_t; -#define CURL_SOCKET_BAD -1 -#endif -#define curl_socket_typedef -#endif /* curl_socket_typedef */ - -struct curl_httppost { - struct curl_httppost *next; /* next entry in the list */ - char *name; /* pointer to allocated name */ - long namelength; /* length of name length */ - char *contents; /* pointer to allocated data contents */ - long contentslength; /* length of contents field */ - char *buffer; /* pointer to allocated buffer contents */ - long bufferlength; /* length of buffer field */ - char *contenttype; /* Content-Type */ - struct curl_slist* contentheader; /* list of extra headers for this form */ - struct curl_httppost *more; /* if one field name has more than one - file, this link should link to following - files */ - long flags; /* as defined below */ -#define HTTPPOST_FILENAME (1<<0) /* specified content is a file name */ -#define HTTPPOST_READFILE (1<<1) /* specified content is a file name */ -#define HTTPPOST_PTRNAME (1<<2) /* name is only stored pointer - do not free in formfree */ -#define HTTPPOST_PTRCONTENTS (1<<3) /* contents is only stored pointer - do not free in formfree */ -#define HTTPPOST_BUFFER (1<<4) /* upload file from buffer */ -#define HTTPPOST_PTRBUFFER (1<<5) /* upload file from pointer contents */ -#define HTTPPOST_CALLBACK (1<<6) /* upload file contents by using the - regular read callback to get the data - and pass the given pointer as custom - pointer */ - - char *showfilename; /* The file name to show. If not set, the - actual file name will be used (if this - is a file part) */ - void *userp; /* custom pointer used for - HTTPPOST_CALLBACK posts */ -}; - -typedef int (*curl_progress_callback)(void *clientp, - double dltotal, - double dlnow, - double ultotal, - double ulnow); - -#ifndef CURL_MAX_WRITE_SIZE - /* Tests have proven that 20K is a very bad buffer size for uploads on - Windows, while 16K for some odd reason performed a lot better. - We do the ifndef check to allow this value to easier be changed at build - time for those who feel adventurous. The practical minimum is about - 400 bytes since libcurl uses a buffer of this size as a scratch area - (unrelated to network send operations). */ -#define CURL_MAX_WRITE_SIZE 16384 -#endif - -#ifndef CURL_MAX_HTTP_HEADER -/* The only reason to have a max limit for this is to avoid the risk of a bad - server feeding libcurl with a never-ending header that will cause reallocs - infinitely */ -#define CURL_MAX_HTTP_HEADER (100*1024) -#endif - -/* This is a magic return code for the write callback that, when returned, - will signal libcurl to pause receiving on the current transfer. */ -#define CURL_WRITEFUNC_PAUSE 0x10000001 - -typedef size_t (*curl_write_callback)(char *buffer, - size_t size, - size_t nitems, - void *outstream); - - - -/* enumeration of file types */ -typedef enum { - CURLFILETYPE_FILE = 0, - CURLFILETYPE_DIRECTORY, - CURLFILETYPE_SYMLINK, - CURLFILETYPE_DEVICE_BLOCK, - CURLFILETYPE_DEVICE_CHAR, - CURLFILETYPE_NAMEDPIPE, - CURLFILETYPE_SOCKET, - CURLFILETYPE_DOOR, /* is possible only on Sun Solaris now */ - - CURLFILETYPE_UNKNOWN /* should never occur */ -} curlfiletype; - -#define CURLFINFOFLAG_KNOWN_FILENAME (1<<0) -#define CURLFINFOFLAG_KNOWN_FILETYPE (1<<1) -#define CURLFINFOFLAG_KNOWN_TIME (1<<2) -#define CURLFINFOFLAG_KNOWN_PERM (1<<3) -#define CURLFINFOFLAG_KNOWN_UID (1<<4) -#define CURLFINFOFLAG_KNOWN_GID (1<<5) -#define CURLFINFOFLAG_KNOWN_SIZE (1<<6) -#define CURLFINFOFLAG_KNOWN_HLINKCOUNT (1<<7) - -/* Content of this structure depends on information which is known and is - achievable (e.g. by FTP LIST parsing). Please see the url_easy_setopt(3) man - page for callbacks returning this structure -- some fields are mandatory, - some others are optional. The FLAG field has special meaning. */ -struct curl_fileinfo { - char *filename; - curlfiletype filetype; - time_t time; - unsigned int perm; - int uid; - int gid; - curl_off_t size; - long int hardlinks; - - struct { - /* If some of these fields is not NULL, it is a pointer to b_data. */ - char *time; - char *perm; - char *user; - char *group; - char *target; /* pointer to the target filename of a symlink */ - } strings; - - unsigned int flags; - - /* used internally */ - char * b_data; - size_t b_size; - size_t b_used; -}; - -/* return codes for CURLOPT_CHUNK_BGN_FUNCTION */ -#define CURL_CHUNK_BGN_FUNC_OK 0 -#define CURL_CHUNK_BGN_FUNC_FAIL 1 /* tell the lib to end the task */ -#define CURL_CHUNK_BGN_FUNC_SKIP 2 /* skip this chunk over */ - -/* if splitting of data transfer is enabled, this callback is called before - download of an individual chunk started. Note that parameter "remains" works - only for FTP wildcard downloading (for now), otherwise is not used */ -typedef long (*curl_chunk_bgn_callback)(const void *transfer_info, - void *ptr, - int remains); - -/* return codes for CURLOPT_CHUNK_END_FUNCTION */ -#define CURL_CHUNK_END_FUNC_OK 0 -#define CURL_CHUNK_END_FUNC_FAIL 1 /* tell the lib to end the task */ - -/* If splitting of data transfer is enabled this callback is called after - download of an individual chunk finished. - Note! After this callback was set then it have to be called FOR ALL chunks. - Even if downloading of this chunk was skipped in CHUNK_BGN_FUNC. - This is the reason why we don't need "transfer_info" parameter in this - callback and we are not interested in "remains" parameter too. */ -typedef long (*curl_chunk_end_callback)(void *ptr); - -/* return codes for FNMATCHFUNCTION */ -#define CURL_FNMATCHFUNC_MATCH 0 /* string corresponds to the pattern */ -#define CURL_FNMATCHFUNC_NOMATCH 1 /* pattern doesn't match the string */ -#define CURL_FNMATCHFUNC_FAIL 2 /* an error occurred */ - -/* callback type for wildcard downloading pattern matching. If the - string matches the pattern, return CURL_FNMATCHFUNC_MATCH value, etc. */ -typedef int (*curl_fnmatch_callback)(void *ptr, - const char *pattern, - const char *string); - -/* These are the return codes for the seek callbacks */ -#define CURL_SEEKFUNC_OK 0 -#define CURL_SEEKFUNC_FAIL 1 /* fail the entire transfer */ -#define CURL_SEEKFUNC_CANTSEEK 2 /* tell libcurl seeking can't be done, so - libcurl might try other means instead */ -typedef int (*curl_seek_callback)(void *instream, - curl_off_t offset, - int origin); /* 'whence' */ - -/* This is a return code for the read callback that, when returned, will - signal libcurl to immediately abort the current transfer. */ -#define CURL_READFUNC_ABORT 0x10000000 -/* This is a return code for the read callback that, when returned, will - signal libcurl to pause sending data on the current transfer. */ -#define CURL_READFUNC_PAUSE 0x10000001 - -typedef size_t (*curl_read_callback)(char *buffer, - size_t size, - size_t nitems, - void *instream); - -typedef enum { - CURLSOCKTYPE_IPCXN, /* socket created for a specific IP connection */ - CURLSOCKTYPE_ACCEPT, /* socket created by accept() call */ - CURLSOCKTYPE_LAST /* never use */ -} curlsocktype; - -/* The return code from the sockopt_callback can signal information back - to libcurl: */ -#define CURL_SOCKOPT_OK 0 -#define CURL_SOCKOPT_ERROR 1 /* causes libcurl to abort and return - CURLE_ABORTED_BY_CALLBACK */ -#define CURL_SOCKOPT_ALREADY_CONNECTED 2 - -typedef int (*curl_sockopt_callback)(void *clientp, - curl_socket_t curlfd, - curlsocktype purpose); - -struct curl_sockaddr { - int family; - int socktype; - int protocol; - unsigned int addrlen; /* addrlen was a socklen_t type before 7.18.0 but it - turned really ugly and painful on the systems that - lack this type */ - struct sockaddr addr; -}; - -typedef curl_socket_t -(*curl_opensocket_callback)(void *clientp, - curlsocktype purpose, - struct curl_sockaddr *address); - -typedef int -(*curl_closesocket_callback)(void *clientp, curl_socket_t item); - -typedef enum { - CURLIOE_OK, /* I/O operation successful */ - CURLIOE_UNKNOWNCMD, /* command was unknown to callback */ - CURLIOE_FAILRESTART, /* failed to restart the read */ - CURLIOE_LAST /* never use */ -} curlioerr; - -typedef enum { - CURLIOCMD_NOP, /* no operation */ - CURLIOCMD_RESTARTREAD, /* restart the read stream from start */ - CURLIOCMD_LAST /* never use */ -} curliocmd; - -typedef curlioerr (*curl_ioctl_callback)(CURL *handle, - int cmd, - void *clientp); - -/* - * The following typedef's are signatures of malloc, free, realloc, strdup and - * calloc respectively. Function pointers of these types can be passed to the - * curl_global_init_mem() function to set user defined memory management - * callback routines. - */ -typedef void *(*curl_malloc_callback)(size_t size); -typedef void (*curl_free_callback)(void *ptr); -typedef void *(*curl_realloc_callback)(void *ptr, size_t size); -typedef char *(*curl_strdup_callback)(const char *str); -typedef void *(*curl_calloc_callback)(size_t nmemb, size_t size); - -/* the kind of data that is passed to information_callback*/ -typedef enum { - CURLINFO_TEXT = 0, - CURLINFO_HEADER_IN, /* 1 */ - CURLINFO_HEADER_OUT, /* 2 */ - CURLINFO_DATA_IN, /* 3 */ - CURLINFO_DATA_OUT, /* 4 */ - CURLINFO_SSL_DATA_IN, /* 5 */ - CURLINFO_SSL_DATA_OUT, /* 6 */ - CURLINFO_END -} curl_infotype; - -typedef int (*curl_debug_callback) - (CURL *handle, /* the handle/transfer this concerns */ - curl_infotype type, /* what kind of data */ - char *data, /* points to the data */ - size_t size, /* size of the data pointed to */ - void *userptr); /* whatever the user please */ - -/* All possible error codes from all sorts of curl functions. Future versions - may return other values, stay prepared. - - Always add new return codes last. Never *EVER* remove any. The return - codes must remain the same! - */ - -typedef enum { - CURLE_OK = 0, - CURLE_UNSUPPORTED_PROTOCOL, /* 1 */ - CURLE_FAILED_INIT, /* 2 */ - CURLE_URL_MALFORMAT, /* 3 */ - CURLE_NOT_BUILT_IN, /* 4 - [was obsoleted in August 2007 for - 7.17.0, reused in April 2011 for 7.21.5] */ - CURLE_COULDNT_RESOLVE_PROXY, /* 5 */ - CURLE_COULDNT_RESOLVE_HOST, /* 6 */ - CURLE_COULDNT_CONNECT, /* 7 */ - CURLE_FTP_WEIRD_SERVER_REPLY, /* 8 */ - CURLE_REMOTE_ACCESS_DENIED, /* 9 a service was denied by the server - due to lack of access - when login fails - this is not returned. */ - CURLE_FTP_ACCEPT_FAILED, /* 10 - [was obsoleted in April 2006 for - 7.15.4, reused in Dec 2011 for 7.24.0]*/ - CURLE_FTP_WEIRD_PASS_REPLY, /* 11 */ - CURLE_FTP_ACCEPT_TIMEOUT, /* 12 - timeout occurred accepting server - [was obsoleted in August 2007 for 7.17.0, - reused in Dec 2011 for 7.24.0]*/ - CURLE_FTP_WEIRD_PASV_REPLY, /* 13 */ - CURLE_FTP_WEIRD_227_FORMAT, /* 14 */ - CURLE_FTP_CANT_GET_HOST, /* 15 */ - CURLE_OBSOLETE16, /* 16 - NOT USED */ - CURLE_FTP_COULDNT_SET_TYPE, /* 17 */ - CURLE_PARTIAL_FILE, /* 18 */ - CURLE_FTP_COULDNT_RETR_FILE, /* 19 */ - CURLE_OBSOLETE20, /* 20 - NOT USED */ - CURLE_QUOTE_ERROR, /* 21 - quote command failure */ - CURLE_HTTP_RETURNED_ERROR, /* 22 */ - CURLE_WRITE_ERROR, /* 23 */ - CURLE_OBSOLETE24, /* 24 - NOT USED */ - CURLE_UPLOAD_FAILED, /* 25 - failed upload "command" */ - CURLE_READ_ERROR, /* 26 - couldn't open/read from file */ - CURLE_OUT_OF_MEMORY, /* 27 */ - /* Note: CURLE_OUT_OF_MEMORY may sometimes indicate a conversion error - instead of a memory allocation error if CURL_DOES_CONVERSIONS - is defined - */ - CURLE_OPERATION_TIMEDOUT, /* 28 - the timeout time was reached */ - CURLE_OBSOLETE29, /* 29 - NOT USED */ - CURLE_FTP_PORT_FAILED, /* 30 - FTP PORT operation failed */ - CURLE_FTP_COULDNT_USE_REST, /* 31 - the REST command failed */ - CURLE_OBSOLETE32, /* 32 - NOT USED */ - CURLE_RANGE_ERROR, /* 33 - RANGE "command" didn't work */ - CURLE_HTTP_POST_ERROR, /* 34 */ - CURLE_SSL_CONNECT_ERROR, /* 35 - wrong when connecting with SSL */ - CURLE_BAD_DOWNLOAD_RESUME, /* 36 - couldn't resume download */ - CURLE_FILE_COULDNT_READ_FILE, /* 37 */ - CURLE_LDAP_CANNOT_BIND, /* 38 */ - CURLE_LDAP_SEARCH_FAILED, /* 39 */ - CURLE_OBSOLETE40, /* 40 - NOT USED */ - CURLE_FUNCTION_NOT_FOUND, /* 41 */ - CURLE_ABORTED_BY_CALLBACK, /* 42 */ - CURLE_BAD_FUNCTION_ARGUMENT, /* 43 */ - CURLE_OBSOLETE44, /* 44 - NOT USED */ - CURLE_INTERFACE_FAILED, /* 45 - CURLOPT_INTERFACE failed */ - CURLE_OBSOLETE46, /* 46 - NOT USED */ - CURLE_TOO_MANY_REDIRECTS , /* 47 - catch endless re-direct loops */ - CURLE_UNKNOWN_OPTION, /* 48 - User specified an unknown option */ - CURLE_TELNET_OPTION_SYNTAX , /* 49 - Malformed telnet option */ - CURLE_OBSOLETE50, /* 50 - NOT USED */ - CURLE_PEER_FAILED_VERIFICATION, /* 51 - peer's certificate or fingerprint - wasn't verified fine */ - CURLE_GOT_NOTHING, /* 52 - when this is a specific error */ - CURLE_SSL_ENGINE_NOTFOUND, /* 53 - SSL crypto engine not found */ - CURLE_SSL_ENGINE_SETFAILED, /* 54 - can not set SSL crypto engine as - default */ - CURLE_SEND_ERROR, /* 55 - failed sending network data */ - CURLE_RECV_ERROR, /* 56 - failure in receiving network data */ - CURLE_OBSOLETE57, /* 57 - NOT IN USE */ - CURLE_SSL_CERTPROBLEM, /* 58 - problem with the local certificate */ - CURLE_SSL_CIPHER, /* 59 - couldn't use specified cipher */ - CURLE_SSL_CACERT, /* 60 - problem with the CA cert (path?) */ - CURLE_BAD_CONTENT_ENCODING, /* 61 - Unrecognized/bad encoding */ - CURLE_LDAP_INVALID_URL, /* 62 - Invalid LDAP URL */ - CURLE_FILESIZE_EXCEEDED, /* 63 - Maximum file size exceeded */ - CURLE_USE_SSL_FAILED, /* 64 - Requested FTP SSL level failed */ - CURLE_SEND_FAIL_REWIND, /* 65 - Sending the data requires a rewind - that failed */ - CURLE_SSL_ENGINE_INITFAILED, /* 66 - failed to initialise ENGINE */ - CURLE_LOGIN_DENIED, /* 67 - user, password or similar was not - accepted and we failed to login */ - CURLE_TFTP_NOTFOUND, /* 68 - file not found on server */ - CURLE_TFTP_PERM, /* 69 - permission problem on server */ - CURLE_REMOTE_DISK_FULL, /* 70 - out of disk space on server */ - CURLE_TFTP_ILLEGAL, /* 71 - Illegal TFTP operation */ - CURLE_TFTP_UNKNOWNID, /* 72 - Unknown transfer ID */ - CURLE_REMOTE_FILE_EXISTS, /* 73 - File already exists */ - CURLE_TFTP_NOSUCHUSER, /* 74 - No such user */ - CURLE_CONV_FAILED, /* 75 - conversion failed */ - CURLE_CONV_REQD, /* 76 - caller must register conversion - callbacks using curl_easy_setopt options - CURLOPT_CONV_FROM_NETWORK_FUNCTION, - CURLOPT_CONV_TO_NETWORK_FUNCTION, and - CURLOPT_CONV_FROM_UTF8_FUNCTION */ - CURLE_SSL_CACERT_BADFILE, /* 77 - could not load CACERT file, missing - or wrong format */ - CURLE_REMOTE_FILE_NOT_FOUND, /* 78 - remote file not found */ - CURLE_SSH, /* 79 - error from the SSH layer, somewhat - generic so the error message will be of - interest when this has happened */ - - CURLE_SSL_SHUTDOWN_FAILED, /* 80 - Failed to shut down the SSL - connection */ - CURLE_AGAIN, /* 81 - socket is not ready for send/recv, - wait till it's ready and try again (Added - in 7.18.2) */ - CURLE_SSL_CRL_BADFILE, /* 82 - could not load CRL file, missing or - wrong format (Added in 7.19.0) */ - CURLE_SSL_ISSUER_ERROR, /* 83 - Issuer check failed. (Added in - 7.19.0) */ - CURLE_FTP_PRET_FAILED, /* 84 - a PRET command failed */ - CURLE_RTSP_CSEQ_ERROR, /* 85 - mismatch of RTSP CSeq numbers */ - CURLE_RTSP_SESSION_ERROR, /* 86 - mismatch of RTSP Session Ids */ - CURLE_FTP_BAD_FILE_LIST, /* 87 - unable to parse FTP file list */ - CURLE_CHUNK_FAILED, /* 88 - chunk callback reported error */ - CURL_LAST /* never use! */ -} CURLcode; - -#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all - the obsolete stuff removed! */ - -/* Previously obsoletes error codes re-used in 7.24.0 */ -#define CURLE_OBSOLETE10 CURLE_FTP_ACCEPT_FAILED -#define CURLE_OBSOLETE12 CURLE_FTP_ACCEPT_TIMEOUT - -/* compatibility with older names */ -#define CURLOPT_ENCODING CURLOPT_ACCEPT_ENCODING - -/* The following were added in 7.21.5, April 2011 */ -#define CURLE_UNKNOWN_TELNET_OPTION CURLE_UNKNOWN_OPTION - -/* The following were added in 7.17.1 */ -/* These are scheduled to disappear by 2009 */ -#define CURLE_SSL_PEER_CERTIFICATE CURLE_PEER_FAILED_VERIFICATION - -/* The following were added in 7.17.0 */ -/* These are scheduled to disappear by 2009 */ -#define CURLE_OBSOLETE CURLE_OBSOLETE50 /* no one should be using this! */ -#define CURLE_BAD_PASSWORD_ENTERED CURLE_OBSOLETE46 -#define CURLE_BAD_CALLING_ORDER CURLE_OBSOLETE44 -#define CURLE_FTP_USER_PASSWORD_INCORRECT CURLE_OBSOLETE10 -#define CURLE_FTP_CANT_RECONNECT CURLE_OBSOLETE16 -#define CURLE_FTP_COULDNT_GET_SIZE CURLE_OBSOLETE32 -#define CURLE_FTP_COULDNT_SET_ASCII CURLE_OBSOLETE29 -#define CURLE_FTP_WEIRD_USER_REPLY CURLE_OBSOLETE12 -#define CURLE_FTP_WRITE_ERROR CURLE_OBSOLETE20 -#define CURLE_LIBRARY_NOT_FOUND CURLE_OBSOLETE40 -#define CURLE_MALFORMAT_USER CURLE_OBSOLETE24 -#define CURLE_SHARE_IN_USE CURLE_OBSOLETE57 -#define CURLE_URL_MALFORMAT_USER CURLE_NOT_BUILT_IN - -#define CURLE_FTP_ACCESS_DENIED CURLE_REMOTE_ACCESS_DENIED -#define CURLE_FTP_COULDNT_SET_BINARY CURLE_FTP_COULDNT_SET_TYPE -#define CURLE_FTP_QUOTE_ERROR CURLE_QUOTE_ERROR -#define CURLE_TFTP_DISKFULL CURLE_REMOTE_DISK_FULL -#define CURLE_TFTP_EXISTS CURLE_REMOTE_FILE_EXISTS -#define CURLE_HTTP_RANGE_ERROR CURLE_RANGE_ERROR -#define CURLE_FTP_SSL_FAILED CURLE_USE_SSL_FAILED - -/* The following were added earlier */ - -#define CURLE_OPERATION_TIMEOUTED CURLE_OPERATION_TIMEDOUT - -#define CURLE_HTTP_NOT_FOUND CURLE_HTTP_RETURNED_ERROR -#define CURLE_HTTP_PORT_FAILED CURLE_INTERFACE_FAILED -#define CURLE_FTP_COULDNT_STOR_FILE CURLE_UPLOAD_FAILED - -#define CURLE_FTP_PARTIAL_FILE CURLE_PARTIAL_FILE -#define CURLE_FTP_BAD_DOWNLOAD_RESUME CURLE_BAD_DOWNLOAD_RESUME - -/* This was the error code 50 in 7.7.3 and a few earlier versions, this - is no longer used by libcurl but is instead #defined here only to not - make programs break */ -#define CURLE_ALREADY_COMPLETE 99999 - -#endif /*!CURL_NO_OLDIES*/ - -/* This prototype applies to all conversion callbacks */ -typedef CURLcode (*curl_conv_callback)(char *buffer, size_t length); - -typedef CURLcode (*curl_ssl_ctx_callback)(CURL *curl, /* easy handle */ - void *ssl_ctx, /* actually an - OpenSSL SSL_CTX */ - void *userptr); - -typedef enum { - CURLPROXY_HTTP = 0, /* added in 7.10, new in 7.19.4 default is to use - CONNECT HTTP/1.1 */ - CURLPROXY_HTTP_1_0 = 1, /* added in 7.19.4, force to use CONNECT - HTTP/1.0 */ - CURLPROXY_SOCKS4 = 4, /* support added in 7.15.2, enum existed already - in 7.10 */ - CURLPROXY_SOCKS5 = 5, /* added in 7.10 */ - CURLPROXY_SOCKS4A = 6, /* added in 7.18.0 */ - CURLPROXY_SOCKS5_HOSTNAME = 7 /* Use the SOCKS5 protocol but pass along the - host name rather than the IP address. added - in 7.18.0 */ -} curl_proxytype; /* this enum was added in 7.10 */ - -/* - * Bitmasks for CURLOPT_HTTPAUTH and CURLOPT_PROXYAUTH options: - * - * CURLAUTH_NONE - No HTTP authentication - * CURLAUTH_BASIC - HTTP Basic authentication (default) - * CURLAUTH_DIGEST - HTTP Digest authentication - * CURLAUTH_GSSNEGOTIATE - HTTP GSS-Negotiate authentication - * CURLAUTH_NTLM - HTTP NTLM authentication - * CURLAUTH_DIGEST_IE - HTTP Digest authentication with IE flavour - * CURLAUTH_NTLM_WB - HTTP NTLM authentication delegated to winbind helper - * CURLAUTH_ONLY - Use together with a single other type to force no - * authentication or just that single type - * CURLAUTH_ANY - All fine types set - * CURLAUTH_ANYSAFE - All fine types except Basic - */ - -#define CURLAUTH_NONE ((unsigned long)0) -#define CURLAUTH_BASIC (((unsigned long)1)<<0) -#define CURLAUTH_DIGEST (((unsigned long)1)<<1) -#define CURLAUTH_GSSNEGOTIATE (((unsigned long)1)<<2) -#define CURLAUTH_NTLM (((unsigned long)1)<<3) -#define CURLAUTH_DIGEST_IE (((unsigned long)1)<<4) -#define CURLAUTH_NTLM_WB (((unsigned long)1)<<5) -#define CURLAUTH_ONLY (((unsigned long)1)<<31) -#define CURLAUTH_ANY (~CURLAUTH_DIGEST_IE) -#define CURLAUTH_ANYSAFE (~(CURLAUTH_BASIC|CURLAUTH_DIGEST_IE)) - -#define CURLSSH_AUTH_ANY ~0 /* all types supported by the server */ -#define CURLSSH_AUTH_NONE 0 /* none allowed, silly but complete */ -#define CURLSSH_AUTH_PUBLICKEY (1<<0) /* public/private key files */ -#define CURLSSH_AUTH_PASSWORD (1<<1) /* password */ -#define CURLSSH_AUTH_HOST (1<<2) /* host key files */ -#define CURLSSH_AUTH_KEYBOARD (1<<3) /* keyboard interactive */ -#define CURLSSH_AUTH_AGENT (1<<4) /* agent (ssh-agent, pageant...) */ -#define CURLSSH_AUTH_DEFAULT CURLSSH_AUTH_ANY - -#define CURLGSSAPI_DELEGATION_NONE 0 /* no delegation (default) */ -#define CURLGSSAPI_DELEGATION_POLICY_FLAG (1<<0) /* if permitted by policy */ -#define CURLGSSAPI_DELEGATION_FLAG (1<<1) /* delegate always */ - -#define CURL_ERROR_SIZE 256 - -struct curl_khkey { - const char *key; /* points to a zero-terminated string encoded with base64 - if len is zero, otherwise to the "raw" data */ - size_t len; - enum type { - CURLKHTYPE_UNKNOWN, - CURLKHTYPE_RSA1, - CURLKHTYPE_RSA, - CURLKHTYPE_DSS - } keytype; -}; - -/* this is the set of return values expected from the curl_sshkeycallback - callback */ -enum curl_khstat { - CURLKHSTAT_FINE_ADD_TO_FILE, - CURLKHSTAT_FINE, - CURLKHSTAT_REJECT, /* reject the connection, return an error */ - CURLKHSTAT_DEFER, /* do not accept it, but we can't answer right now so - this causes a CURLE_DEFER error but otherwise the - connection will be left intact etc */ - CURLKHSTAT_LAST /* not for use, only a marker for last-in-list */ -}; - -/* this is the set of status codes pass in to the callback */ -enum curl_khmatch { - CURLKHMATCH_OK, /* match */ - CURLKHMATCH_MISMATCH, /* host found, key mismatch! */ - CURLKHMATCH_MISSING, /* no matching host/key found */ - CURLKHMATCH_LAST /* not for use, only a marker for last-in-list */ -}; - -typedef int - (*curl_sshkeycallback) (CURL *easy, /* easy handle */ - const struct curl_khkey *knownkey, /* known */ - const struct curl_khkey *foundkey, /* found */ - enum curl_khmatch, /* libcurl's view on the keys */ - void *clientp); /* custom pointer passed from app */ - -/* parameter for the CURLOPT_USE_SSL option */ -typedef enum { - CURLUSESSL_NONE, /* do not attempt to use SSL */ - CURLUSESSL_TRY, /* try using SSL, proceed anyway otherwise */ - CURLUSESSL_CONTROL, /* SSL for the control connection or fail */ - CURLUSESSL_ALL, /* SSL for all communication or fail */ - CURLUSESSL_LAST /* not an option, never use */ -} curl_usessl; - -/* Definition of bits for the CURLOPT_SSL_OPTIONS argument: */ - -/* - ALLOW_BEAST tells libcurl to allow the BEAST SSL vulnerability in the - name of improving interoperability with older servers. Some SSL libraries - have introduced work-arounds for this flaw but those work-arounds sometimes - make the SSL communication fail. To regain functionality with those broken - servers, a user can this way allow the vulnerability back. */ -#define CURLSSLOPT_ALLOW_BEAST (1<<0) - -#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all - the obsolete stuff removed! */ - -/* Backwards compatibility with older names */ -/* These are scheduled to disappear by 2009 */ - -#define CURLFTPSSL_NONE CURLUSESSL_NONE -#define CURLFTPSSL_TRY CURLUSESSL_TRY -#define CURLFTPSSL_CONTROL CURLUSESSL_CONTROL -#define CURLFTPSSL_ALL CURLUSESSL_ALL -#define CURLFTPSSL_LAST CURLUSESSL_LAST -#define curl_ftpssl curl_usessl -#endif /*!CURL_NO_OLDIES*/ - -/* parameter for the CURLOPT_FTP_SSL_CCC option */ -typedef enum { - CURLFTPSSL_CCC_NONE, /* do not send CCC */ - CURLFTPSSL_CCC_PASSIVE, /* Let the server initiate the shutdown */ - CURLFTPSSL_CCC_ACTIVE, /* Initiate the shutdown */ - CURLFTPSSL_CCC_LAST /* not an option, never use */ -} curl_ftpccc; - -/* parameter for the CURLOPT_FTPSSLAUTH option */ -typedef enum { - CURLFTPAUTH_DEFAULT, /* let libcurl decide */ - CURLFTPAUTH_SSL, /* use "AUTH SSL" */ - CURLFTPAUTH_TLS, /* use "AUTH TLS" */ - CURLFTPAUTH_LAST /* not an option, never use */ -} curl_ftpauth; - -/* parameter for the CURLOPT_FTP_CREATE_MISSING_DIRS option */ -typedef enum { - CURLFTP_CREATE_DIR_NONE, /* do NOT create missing dirs! */ - CURLFTP_CREATE_DIR, /* (FTP/SFTP) if CWD fails, try MKD and then CWD - again if MKD succeeded, for SFTP this does - similar magic */ - CURLFTP_CREATE_DIR_RETRY, /* (FTP only) if CWD fails, try MKD and then CWD - again even if MKD failed! */ - CURLFTP_CREATE_DIR_LAST /* not an option, never use */ -} curl_ftpcreatedir; - -/* parameter for the CURLOPT_FTP_FILEMETHOD option */ -typedef enum { - CURLFTPMETHOD_DEFAULT, /* let libcurl pick */ - CURLFTPMETHOD_MULTICWD, /* single CWD operation for each path part */ - CURLFTPMETHOD_NOCWD, /* no CWD at all */ - CURLFTPMETHOD_SINGLECWD, /* one CWD to full dir, then work on file */ - CURLFTPMETHOD_LAST /* not an option, never use */ -} curl_ftpmethod; - -/* CURLPROTO_ defines are for the CURLOPT_*PROTOCOLS options */ -#define CURLPROTO_HTTP (1<<0) -#define CURLPROTO_HTTPS (1<<1) -#define CURLPROTO_FTP (1<<2) -#define CURLPROTO_FTPS (1<<3) -#define CURLPROTO_SCP (1<<4) -#define CURLPROTO_SFTP (1<<5) -#define CURLPROTO_TELNET (1<<6) -#define CURLPROTO_LDAP (1<<7) -#define CURLPROTO_LDAPS (1<<8) -#define CURLPROTO_DICT (1<<9) -#define CURLPROTO_FILE (1<<10) -#define CURLPROTO_TFTP (1<<11) -#define CURLPROTO_IMAP (1<<12) -#define CURLPROTO_IMAPS (1<<13) -#define CURLPROTO_POP3 (1<<14) -#define CURLPROTO_POP3S (1<<15) -#define CURLPROTO_SMTP (1<<16) -#define CURLPROTO_SMTPS (1<<17) -#define CURLPROTO_RTSP (1<<18) -#define CURLPROTO_RTMP (1<<19) -#define CURLPROTO_RTMPT (1<<20) -#define CURLPROTO_RTMPE (1<<21) -#define CURLPROTO_RTMPTE (1<<22) -#define CURLPROTO_RTMPS (1<<23) -#define CURLPROTO_RTMPTS (1<<24) -#define CURLPROTO_GOPHER (1<<25) -#define CURLPROTO_ALL (~0) /* enable everything */ - -/* long may be 32 or 64 bits, but we should never depend on anything else - but 32 */ -#define CURLOPTTYPE_LONG 0 -#define CURLOPTTYPE_OBJECTPOINT 10000 -#define CURLOPTTYPE_FUNCTIONPOINT 20000 -#define CURLOPTTYPE_OFF_T 30000 - -/* name is uppercase CURLOPT_, - type is one of the defined CURLOPTTYPE_ - number is unique identifier */ -#ifdef CINIT -#undef CINIT -#endif - -#ifdef CURL_ISOCPP -#define CINIT(na,t,nu) CURLOPT_ ## na = CURLOPTTYPE_ ## t + nu -#else -/* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */ -#define LONG CURLOPTTYPE_LONG -#define OBJECTPOINT CURLOPTTYPE_OBJECTPOINT -#define FUNCTIONPOINT CURLOPTTYPE_FUNCTIONPOINT -#define OFF_T CURLOPTTYPE_OFF_T -#define CINIT(name,type,number) CURLOPT_/**/name = type + number -#endif - -/* - * This macro-mania below setups the CURLOPT_[what] enum, to be used with - * curl_easy_setopt(). The first argument in the CINIT() macro is the [what] - * word. - */ - -typedef enum { - /* This is the FILE * or void * the regular output should be written to. */ - CINIT(FILE, OBJECTPOINT, 1), - - /* The full URL to get/put */ - CINIT(URL, OBJECTPOINT, 2), - - /* Port number to connect to, if other than default. */ - CINIT(PORT, LONG, 3), - - /* Name of proxy to use. */ - CINIT(PROXY, OBJECTPOINT, 4), - - /* "name:password" to use when fetching. */ - CINIT(USERPWD, OBJECTPOINT, 5), - - /* "name:password" to use with proxy. */ - CINIT(PROXYUSERPWD, OBJECTPOINT, 6), - - /* Range to get, specified as an ASCII string. */ - CINIT(RANGE, OBJECTPOINT, 7), - - /* not used */ - - /* Specified file stream to upload from (use as input): */ - CINIT(INFILE, OBJECTPOINT, 9), - - /* Buffer to receive error messages in, must be at least CURL_ERROR_SIZE - * bytes big. If this is not used, error messages go to stderr instead: */ - CINIT(ERRORBUFFER, OBJECTPOINT, 10), - - /* Function that will be called to store the output (instead of fwrite). The - * parameters will use fwrite() syntax, make sure to follow them. */ - CINIT(WRITEFUNCTION, FUNCTIONPOINT, 11), - - /* Function that will be called to read the input (instead of fread). The - * parameters will use fread() syntax, make sure to follow them. */ - CINIT(READFUNCTION, FUNCTIONPOINT, 12), - - /* Time-out the read operation after this amount of seconds */ - CINIT(TIMEOUT, LONG, 13), - - /* If the CURLOPT_INFILE is used, this can be used to inform libcurl about - * how large the file being sent really is. That allows better error - * checking and better verifies that the upload was successful. -1 means - * unknown size. - * - * For large file support, there is also a _LARGE version of the key - * which takes an off_t type, allowing platforms with larger off_t - * sizes to handle larger files. See below for INFILESIZE_LARGE. - */ - CINIT(INFILESIZE, LONG, 14), - - /* POST static input fields. */ - CINIT(POSTFIELDS, OBJECTPOINT, 15), - - /* Set the referrer page (needed by some CGIs) */ - CINIT(REFERER, OBJECTPOINT, 16), - - /* Set the FTP PORT string (interface name, named or numerical IP address) - Use i.e '-' to use default address. */ - CINIT(FTPPORT, OBJECTPOINT, 17), - - /* Set the User-Agent string (examined by some CGIs) */ - CINIT(USERAGENT, OBJECTPOINT, 18), - - /* If the download receives less than "low speed limit" bytes/second - * during "low speed time" seconds, the operations is aborted. - * You could i.e if you have a pretty high speed connection, abort if - * it is less than 2000 bytes/sec during 20 seconds. - */ - - /* Set the "low speed limit" */ - CINIT(LOW_SPEED_LIMIT, LONG, 19), - - /* Set the "low speed time" */ - CINIT(LOW_SPEED_TIME, LONG, 20), - - /* Set the continuation offset. - * - * Note there is also a _LARGE version of this key which uses - * off_t types, allowing for large file offsets on platforms which - * use larger-than-32-bit off_t's. Look below for RESUME_FROM_LARGE. - */ - CINIT(RESUME_FROM, LONG, 21), - - /* Set cookie in request: */ - CINIT(COOKIE, OBJECTPOINT, 22), - - /* This points to a linked list of headers, struct curl_slist kind */ - CINIT(HTTPHEADER, OBJECTPOINT, 23), - - /* This points to a linked list of post entries, struct curl_httppost */ - CINIT(HTTPPOST, OBJECTPOINT, 24), - - /* name of the file keeping your private SSL-certificate */ - CINIT(SSLCERT, OBJECTPOINT, 25), - - /* password for the SSL or SSH private key */ - CINIT(KEYPASSWD, OBJECTPOINT, 26), - - /* send TYPE parameter? */ - CINIT(CRLF, LONG, 27), - - /* send linked-list of QUOTE commands */ - CINIT(QUOTE, OBJECTPOINT, 28), - - /* send FILE * or void * to store headers to, if you use a callback it - is simply passed to the callback unmodified */ - CINIT(WRITEHEADER, OBJECTPOINT, 29), - - /* point to a file to read the initial cookies from, also enables - "cookie awareness" */ - CINIT(COOKIEFILE, OBJECTPOINT, 31), - - /* What version to specifically try to use. - See CURL_SSLVERSION defines below. */ - CINIT(SSLVERSION, LONG, 32), - - /* What kind of HTTP time condition to use, see defines */ - CINIT(TIMECONDITION, LONG, 33), - - /* Time to use with the above condition. Specified in number of seconds - since 1 Jan 1970 */ - CINIT(TIMEVALUE, LONG, 34), - - /* 35 = OBSOLETE */ - - /* Custom request, for customizing the get command like - HTTP: DELETE, TRACE and others - FTP: to use a different list command - */ - CINIT(CUSTOMREQUEST, OBJECTPOINT, 36), - - /* HTTP request, for odd commands like DELETE, TRACE and others */ - CINIT(STDERR, OBJECTPOINT, 37), - - /* 38 is not used */ - - /* send linked-list of post-transfer QUOTE commands */ - CINIT(POSTQUOTE, OBJECTPOINT, 39), - - CINIT(WRITEINFO, OBJECTPOINT, 40), /* DEPRECATED, do not use! */ - - CINIT(VERBOSE, LONG, 41), /* talk a lot */ - CINIT(HEADER, LONG, 42), /* throw the header out too */ - CINIT(NOPROGRESS, LONG, 43), /* shut off the progress meter */ - CINIT(NOBODY, LONG, 44), /* use HEAD to get http document */ - CINIT(FAILONERROR, LONG, 45), /* no output on http error codes >= 300 */ - CINIT(UPLOAD, LONG, 46), /* this is an upload */ - CINIT(POST, LONG, 47), /* HTTP POST method */ - CINIT(DIRLISTONLY, LONG, 48), /* bare names when listing directories */ - - CINIT(APPEND, LONG, 50), /* Append instead of overwrite on upload! */ - - /* Specify whether to read the user+password from the .netrc or the URL. - * This must be one of the CURL_NETRC_* enums below. */ - CINIT(NETRC, LONG, 51), - - CINIT(FOLLOWLOCATION, LONG, 52), /* use Location: Luke! */ - - CINIT(TRANSFERTEXT, LONG, 53), /* transfer data in text/ASCII format */ - CINIT(PUT, LONG, 54), /* HTTP PUT */ - - /* 55 = OBSOLETE */ - - /* Function that will be called instead of the internal progress display - * function. This function should be defined as the curl_progress_callback - * prototype defines. */ - CINIT(PROGRESSFUNCTION, FUNCTIONPOINT, 56), - - /* Data passed to the progress callback */ - CINIT(PROGRESSDATA, OBJECTPOINT, 57), - - /* We want the referrer field set automatically when following locations */ - CINIT(AUTOREFERER, LONG, 58), - - /* Port of the proxy, can be set in the proxy string as well with: - "[host]:[port]" */ - CINIT(PROXYPORT, LONG, 59), - - /* size of the POST input data, if strlen() is not good to use */ - CINIT(POSTFIELDSIZE, LONG, 60), - - /* tunnel non-http operations through a HTTP proxy */ - CINIT(HTTPPROXYTUNNEL, LONG, 61), - - /* Set the interface string to use as outgoing network interface */ - CINIT(INTERFACE, OBJECTPOINT, 62), - - /* Set the krb4/5 security level, this also enables krb4/5 awareness. This - * is a string, 'clear', 'safe', 'confidential' or 'private'. If the string - * is set but doesn't match one of these, 'private' will be used. */ - CINIT(KRBLEVEL, OBJECTPOINT, 63), - - /* Set if we should verify the peer in ssl handshake, set 1 to verify. */ - CINIT(SSL_VERIFYPEER, LONG, 64), - - /* The CApath or CAfile used to validate the peer certificate - this option is used only if SSL_VERIFYPEER is true */ - CINIT(CAINFO, OBJECTPOINT, 65), - - /* 66 = OBSOLETE */ - /* 67 = OBSOLETE */ - - /* Maximum number of http redirects to follow */ - CINIT(MAXREDIRS, LONG, 68), - - /* Pass a long set to 1 to get the date of the requested document (if - possible)! Pass a zero to shut it off. */ - CINIT(FILETIME, LONG, 69), - - /* This points to a linked list of telnet options */ - CINIT(TELNETOPTIONS, OBJECTPOINT, 70), - - /* Max amount of cached alive connections */ - CINIT(MAXCONNECTS, LONG, 71), - - CINIT(CLOSEPOLICY, LONG, 72), /* DEPRECATED, do not use! */ - - /* 73 = OBSOLETE */ - - /* Set to explicitly use a new connection for the upcoming transfer. - Do not use this unless you're absolutely sure of this, as it makes the - operation slower and is less friendly for the network. */ - CINIT(FRESH_CONNECT, LONG, 74), - - /* Set to explicitly forbid the upcoming transfer's connection to be re-used - when done. Do not use this unless you're absolutely sure of this, as it - makes the operation slower and is less friendly for the network. */ - CINIT(FORBID_REUSE, LONG, 75), - - /* Set to a file name that contains random data for libcurl to use to - seed the random engine when doing SSL connects. */ - CINIT(RANDOM_FILE, OBJECTPOINT, 76), - - /* Set to the Entropy Gathering Daemon socket pathname */ - CINIT(EGDSOCKET, OBJECTPOINT, 77), - - /* Time-out connect operations after this amount of seconds, if connects are - OK within this time, then fine... This only aborts the connect phase. */ - CINIT(CONNECTTIMEOUT, LONG, 78), - - /* Function that will be called to store headers (instead of fwrite). The - * parameters will use fwrite() syntax, make sure to follow them. */ - CINIT(HEADERFUNCTION, FUNCTIONPOINT, 79), - - /* Set this to force the HTTP request to get back to GET. Only really usable - if POST, PUT or a custom request have been used first. - */ - CINIT(HTTPGET, LONG, 80), - - /* Set if we should verify the Common name from the peer certificate in ssl - * handshake, set 1 to check existence, 2 to ensure that it matches the - * provided hostname. */ - CINIT(SSL_VERIFYHOST, LONG, 81), - - /* Specify which file name to write all known cookies in after completed - operation. Set file name to "-" (dash) to make it go to stdout. */ - CINIT(COOKIEJAR, OBJECTPOINT, 82), - - /* Specify which SSL ciphers to use */ - CINIT(SSL_CIPHER_LIST, OBJECTPOINT, 83), - - /* Specify which HTTP version to use! This must be set to one of the - CURL_HTTP_VERSION* enums set below. */ - CINIT(HTTP_VERSION, LONG, 84), - - /* Specifically switch on or off the FTP engine's use of the EPSV command. By - default, that one will always be attempted before the more traditional - PASV command. */ - CINIT(FTP_USE_EPSV, LONG, 85), - - /* type of the file keeping your SSL-certificate ("DER", "PEM", "ENG") */ - CINIT(SSLCERTTYPE, OBJECTPOINT, 86), - - /* name of the file keeping your private SSL-key */ - CINIT(SSLKEY, OBJECTPOINT, 87), - - /* type of the file keeping your private SSL-key ("DER", "PEM", "ENG") */ - CINIT(SSLKEYTYPE, OBJECTPOINT, 88), - - /* crypto engine for the SSL-sub system */ - CINIT(SSLENGINE, OBJECTPOINT, 89), - - /* set the crypto engine for the SSL-sub system as default - the param has no meaning... - */ - CINIT(SSLENGINE_DEFAULT, LONG, 90), - - /* Non-zero value means to use the global dns cache */ - CINIT(DNS_USE_GLOBAL_CACHE, LONG, 91), /* DEPRECATED, do not use! */ - - /* DNS cache timeout */ - CINIT(DNS_CACHE_TIMEOUT, LONG, 92), - - /* send linked-list of pre-transfer QUOTE commands */ - CINIT(PREQUOTE, OBJECTPOINT, 93), - - /* set the debug function */ - CINIT(DEBUGFUNCTION, FUNCTIONPOINT, 94), - - /* set the data for the debug function */ - CINIT(DEBUGDATA, OBJECTPOINT, 95), - - /* mark this as start of a cookie session */ - CINIT(COOKIESESSION, LONG, 96), - - /* The CApath directory used to validate the peer certificate - this option is used only if SSL_VERIFYPEER is true */ - CINIT(CAPATH, OBJECTPOINT, 97), - - /* Instruct libcurl to use a smaller receive buffer */ - CINIT(BUFFERSIZE, LONG, 98), - - /* Instruct libcurl to not use any signal/alarm handlers, even when using - timeouts. This option is useful for multi-threaded applications. - See libcurl-the-guide for more background information. */ - CINIT(NOSIGNAL, LONG, 99), - - /* Provide a CURLShare for mutexing non-ts data */ - CINIT(SHARE, OBJECTPOINT, 100), - - /* indicates type of proxy. accepted values are CURLPROXY_HTTP (default), - CURLPROXY_SOCKS4, CURLPROXY_SOCKS4A and CURLPROXY_SOCKS5. */ - CINIT(PROXYTYPE, LONG, 101), - - /* Set the Accept-Encoding string. Use this to tell a server you would like - the response to be compressed. Before 7.21.6, this was known as - CURLOPT_ENCODING */ - CINIT(ACCEPT_ENCODING, OBJECTPOINT, 102), - - /* Set pointer to private data */ - CINIT(PRIVATE, OBJECTPOINT, 103), - - /* Set aliases for HTTP 200 in the HTTP Response header */ - CINIT(HTTP200ALIASES, OBJECTPOINT, 104), - - /* Continue to send authentication (user+password) when following locations, - even when hostname changed. This can potentially send off the name - and password to whatever host the server decides. */ - CINIT(UNRESTRICTED_AUTH, LONG, 105), - - /* Specifically switch on or off the FTP engine's use of the EPRT command ( - it also disables the LPRT attempt). By default, those ones will always be - attempted before the good old traditional PORT command. */ - CINIT(FTP_USE_EPRT, LONG, 106), - - /* Set this to a bitmask value to enable the particular authentications - methods you like. Use this in combination with CURLOPT_USERPWD. - Note that setting multiple bits may cause extra network round-trips. */ - CINIT(HTTPAUTH, LONG, 107), - - /* Set the ssl context callback function, currently only for OpenSSL ssl_ctx - in second argument. The function must be matching the - curl_ssl_ctx_callback proto. */ - CINIT(SSL_CTX_FUNCTION, FUNCTIONPOINT, 108), - - /* Set the userdata for the ssl context callback function's third - argument */ - CINIT(SSL_CTX_DATA, OBJECTPOINT, 109), - - /* FTP Option that causes missing dirs to be created on the remote server. - In 7.19.4 we introduced the convenience enums for this option using the - CURLFTP_CREATE_DIR prefix. - */ - CINIT(FTP_CREATE_MISSING_DIRS, LONG, 110), - - /* Set this to a bitmask value to enable the particular authentications - methods you like. Use this in combination with CURLOPT_PROXYUSERPWD. - Note that setting multiple bits may cause extra network round-trips. */ - CINIT(PROXYAUTH, LONG, 111), - - /* FTP option that changes the timeout, in seconds, associated with - getting a response. This is different from transfer timeout time and - essentially places a demand on the FTP server to acknowledge commands - in a timely manner. */ - CINIT(FTP_RESPONSE_TIMEOUT, LONG, 112), -#define CURLOPT_SERVER_RESPONSE_TIMEOUT CURLOPT_FTP_RESPONSE_TIMEOUT - - /* Set this option to one of the CURL_IPRESOLVE_* defines (see below) to - tell libcurl to resolve names to those IP versions only. This only has - affect on systems with support for more than one, i.e IPv4 _and_ IPv6. */ - CINIT(IPRESOLVE, LONG, 113), - - /* Set this option to limit the size of a file that will be downloaded from - an HTTP or FTP server. - - Note there is also _LARGE version which adds large file support for - platforms which have larger off_t sizes. See MAXFILESIZE_LARGE below. */ - CINIT(MAXFILESIZE, LONG, 114), - - /* See the comment for INFILESIZE above, but in short, specifies - * the size of the file being uploaded. -1 means unknown. - */ - CINIT(INFILESIZE_LARGE, OFF_T, 115), - - /* Sets the continuation offset. There is also a LONG version of this; - * look above for RESUME_FROM. - */ - CINIT(RESUME_FROM_LARGE, OFF_T, 116), - - /* Sets the maximum size of data that will be downloaded from - * an HTTP or FTP server. See MAXFILESIZE above for the LONG version. - */ - CINIT(MAXFILESIZE_LARGE, OFF_T, 117), - - /* Set this option to the file name of your .netrc file you want libcurl - to parse (using the CURLOPT_NETRC option). If not set, libcurl will do - a poor attempt to find the user's home directory and check for a .netrc - file in there. */ - CINIT(NETRC_FILE, OBJECTPOINT, 118), - - /* Enable SSL/TLS for FTP, pick one of: - CURLUSESSL_TRY - try using SSL, proceed anyway otherwise - CURLUSESSL_CONTROL - SSL for the control connection or fail - CURLUSESSL_ALL - SSL for all communication or fail - */ - CINIT(USE_SSL, LONG, 119), - - /* The _LARGE version of the standard POSTFIELDSIZE option */ - CINIT(POSTFIELDSIZE_LARGE, OFF_T, 120), - - /* Enable/disable the TCP Nagle algorithm */ - CINIT(TCP_NODELAY, LONG, 121), - - /* 122 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */ - /* 123 OBSOLETE. Gone in 7.16.0 */ - /* 124 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */ - /* 125 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */ - /* 126 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */ - /* 127 OBSOLETE. Gone in 7.16.0 */ - /* 128 OBSOLETE. Gone in 7.16.0 */ - - /* When FTP over SSL/TLS is selected (with CURLOPT_USE_SSL), this option - can be used to change libcurl's default action which is to first try - "AUTH SSL" and then "AUTH TLS" in this order, and proceed when a OK - response has been received. - - Available parameters are: - CURLFTPAUTH_DEFAULT - let libcurl decide - CURLFTPAUTH_SSL - try "AUTH SSL" first, then TLS - CURLFTPAUTH_TLS - try "AUTH TLS" first, then SSL - */ - CINIT(FTPSSLAUTH, LONG, 129), - - CINIT(IOCTLFUNCTION, FUNCTIONPOINT, 130), - CINIT(IOCTLDATA, OBJECTPOINT, 131), - - /* 132 OBSOLETE. Gone in 7.16.0 */ - /* 133 OBSOLETE. Gone in 7.16.0 */ - - /* zero terminated string for pass on to the FTP server when asked for - "account" info */ - CINIT(FTP_ACCOUNT, OBJECTPOINT, 134), - - /* feed cookies into cookie engine */ - CINIT(COOKIELIST, OBJECTPOINT, 135), - - /* ignore Content-Length */ - CINIT(IGNORE_CONTENT_LENGTH, LONG, 136), - - /* Set to non-zero to skip the IP address received in a 227 PASV FTP server - response. Typically used for FTP-SSL purposes but is not restricted to - that. libcurl will then instead use the same IP address it used for the - control connection. */ - CINIT(FTP_SKIP_PASV_IP, LONG, 137), - - /* Select "file method" to use when doing FTP, see the curl_ftpmethod - above. */ - CINIT(FTP_FILEMETHOD, LONG, 138), - - /* Local port number to bind the socket to */ - CINIT(LOCALPORT, LONG, 139), - - /* Number of ports to try, including the first one set with LOCALPORT. - Thus, setting it to 1 will make no additional attempts but the first. - */ - CINIT(LOCALPORTRANGE, LONG, 140), - - /* no transfer, set up connection and let application use the socket by - extracting it with CURLINFO_LASTSOCKET */ - CINIT(CONNECT_ONLY, LONG, 141), - - /* Function that will be called to convert from the - network encoding (instead of using the iconv calls in libcurl) */ - CINIT(CONV_FROM_NETWORK_FUNCTION, FUNCTIONPOINT, 142), - - /* Function that will be called to convert to the - network encoding (instead of using the iconv calls in libcurl) */ - CINIT(CONV_TO_NETWORK_FUNCTION, FUNCTIONPOINT, 143), - - /* Function that will be called to convert from UTF8 - (instead of using the iconv calls in libcurl) - Note that this is used only for SSL certificate processing */ - CINIT(CONV_FROM_UTF8_FUNCTION, FUNCTIONPOINT, 144), - - /* if the connection proceeds too quickly then need to slow it down */ - /* limit-rate: maximum number of bytes per second to send or receive */ - CINIT(MAX_SEND_SPEED_LARGE, OFF_T, 145), - CINIT(MAX_RECV_SPEED_LARGE, OFF_T, 146), - - /* Pointer to command string to send if USER/PASS fails. */ - CINIT(FTP_ALTERNATIVE_TO_USER, OBJECTPOINT, 147), - - /* callback function for setting socket options */ - CINIT(SOCKOPTFUNCTION, FUNCTIONPOINT, 148), - CINIT(SOCKOPTDATA, OBJECTPOINT, 149), - - /* set to 0 to disable session ID re-use for this transfer, default is - enabled (== 1) */ - CINIT(SSL_SESSIONID_CACHE, LONG, 150), - - /* allowed SSH authentication methods */ - CINIT(SSH_AUTH_TYPES, LONG, 151), - - /* Used by scp/sftp to do public/private key authentication */ - CINIT(SSH_PUBLIC_KEYFILE, OBJECTPOINT, 152), - CINIT(SSH_PRIVATE_KEYFILE, OBJECTPOINT, 153), - - /* Send CCC (Clear Command Channel) after authentication */ - CINIT(FTP_SSL_CCC, LONG, 154), - - /* Same as TIMEOUT and CONNECTTIMEOUT, but with ms resolution */ - CINIT(TIMEOUT_MS, LONG, 155), - CINIT(CONNECTTIMEOUT_MS, LONG, 156), - - /* set to zero to disable the libcurl's decoding and thus pass the raw body - data to the application even when it is encoded/compressed */ - CINIT(HTTP_TRANSFER_DECODING, LONG, 157), - CINIT(HTTP_CONTENT_DECODING, LONG, 158), - - /* Permission used when creating new files and directories on the remote - server for protocols that support it, SFTP/SCP/FILE */ - CINIT(NEW_FILE_PERMS, LONG, 159), - CINIT(NEW_DIRECTORY_PERMS, LONG, 160), - - /* Set the behaviour of POST when redirecting. Values must be set to one - of CURL_REDIR* defines below. This used to be called CURLOPT_POST301 */ - CINIT(POSTREDIR, LONG, 161), - - /* used by scp/sftp to verify the host's public key */ - CINIT(SSH_HOST_PUBLIC_KEY_MD5, OBJECTPOINT, 162), - - /* Callback function for opening socket (instead of socket(2)). Optionally, - callback is able change the address or refuse to connect returning - CURL_SOCKET_BAD. The callback should have type - curl_opensocket_callback */ - CINIT(OPENSOCKETFUNCTION, FUNCTIONPOINT, 163), - CINIT(OPENSOCKETDATA, OBJECTPOINT, 164), - - /* POST volatile input fields. */ - CINIT(COPYPOSTFIELDS, OBJECTPOINT, 165), - - /* set transfer mode (;type=) when doing FTP via an HTTP proxy */ - CINIT(PROXY_TRANSFER_MODE, LONG, 166), - - /* Callback function for seeking in the input stream */ - CINIT(SEEKFUNCTION, FUNCTIONPOINT, 167), - CINIT(SEEKDATA, OBJECTPOINT, 168), - - /* CRL file */ - CINIT(CRLFILE, OBJECTPOINT, 169), - - /* Issuer certificate */ - CINIT(ISSUERCERT, OBJECTPOINT, 170), - - /* (IPv6) Address scope */ - CINIT(ADDRESS_SCOPE, LONG, 171), - - /* Collect certificate chain info and allow it to get retrievable with - CURLINFO_CERTINFO after the transfer is complete. (Unfortunately) only - working with OpenSSL-powered builds. */ - CINIT(CERTINFO, LONG, 172), - - /* "name" and "pwd" to use when fetching. */ - CINIT(USERNAME, OBJECTPOINT, 173), - CINIT(PASSWORD, OBJECTPOINT, 174), - - /* "name" and "pwd" to use with Proxy when fetching. */ - CINIT(PROXYUSERNAME, OBJECTPOINT, 175), - CINIT(PROXYPASSWORD, OBJECTPOINT, 176), - - /* Comma separated list of hostnames defining no-proxy zones. These should - match both hostnames directly, and hostnames within a domain. For - example, local.com will match local.com and www.local.com, but NOT - notlocal.com or www.notlocal.com. For compatibility with other - implementations of this, .local.com will be considered to be the same as - local.com. A single * is the only valid wildcard, and effectively - disables the use of proxy. */ - CINIT(NOPROXY, OBJECTPOINT, 177), - - /* block size for TFTP transfers */ - CINIT(TFTP_BLKSIZE, LONG, 178), - - /* Socks Service */ - CINIT(SOCKS5_GSSAPI_SERVICE, OBJECTPOINT, 179), - - /* Socks Service */ - CINIT(SOCKS5_GSSAPI_NEC, LONG, 180), - - /* set the bitmask for the protocols that are allowed to be used for the - transfer, which thus helps the app which takes URLs from users or other - external inputs and want to restrict what protocol(s) to deal - with. Defaults to CURLPROTO_ALL. */ - CINIT(PROTOCOLS, LONG, 181), - - /* set the bitmask for the protocols that libcurl is allowed to follow to, - as a subset of the CURLOPT_PROTOCOLS ones. That means the protocol needs - to be set in both bitmasks to be allowed to get redirected to. Defaults - to all protocols except FILE and SCP. */ - CINIT(REDIR_PROTOCOLS, LONG, 182), - - /* set the SSH knownhost file name to use */ - CINIT(SSH_KNOWNHOSTS, OBJECTPOINT, 183), - - /* set the SSH host key callback, must point to a curl_sshkeycallback - function */ - CINIT(SSH_KEYFUNCTION, FUNCTIONPOINT, 184), - - /* set the SSH host key callback custom pointer */ - CINIT(SSH_KEYDATA, OBJECTPOINT, 185), - - /* set the SMTP mail originator */ - CINIT(MAIL_FROM, OBJECTPOINT, 186), - - /* set the SMTP mail receiver(s) */ - CINIT(MAIL_RCPT, OBJECTPOINT, 187), - - /* FTP: send PRET before PASV */ - CINIT(FTP_USE_PRET, LONG, 188), - - /* RTSP request method (OPTIONS, SETUP, PLAY, etc...) */ - CINIT(RTSP_REQUEST, LONG, 189), - - /* The RTSP session identifier */ - CINIT(RTSP_SESSION_ID, OBJECTPOINT, 190), - - /* The RTSP stream URI */ - CINIT(RTSP_STREAM_URI, OBJECTPOINT, 191), - - /* The Transport: header to use in RTSP requests */ - CINIT(RTSP_TRANSPORT, OBJECTPOINT, 192), - - /* Manually initialize the client RTSP CSeq for this handle */ - CINIT(RTSP_CLIENT_CSEQ, LONG, 193), - - /* Manually initialize the server RTSP CSeq for this handle */ - CINIT(RTSP_SERVER_CSEQ, LONG, 194), - - /* The stream to pass to INTERLEAVEFUNCTION. */ - CINIT(INTERLEAVEDATA, OBJECTPOINT, 195), - - /* Let the application define a custom write method for RTP data */ - CINIT(INTERLEAVEFUNCTION, FUNCTIONPOINT, 196), - - /* Turn on wildcard matching */ - CINIT(WILDCARDMATCH, LONG, 197), - - /* Directory matching callback called before downloading of an - individual file (chunk) started */ - CINIT(CHUNK_BGN_FUNCTION, FUNCTIONPOINT, 198), - - /* Directory matching callback called after the file (chunk) - was downloaded, or skipped */ - CINIT(CHUNK_END_FUNCTION, FUNCTIONPOINT, 199), - - /* Change match (fnmatch-like) callback for wildcard matching */ - CINIT(FNMATCH_FUNCTION, FUNCTIONPOINT, 200), - - /* Let the application define custom chunk data pointer */ - CINIT(CHUNK_DATA, OBJECTPOINT, 201), - - /* FNMATCH_FUNCTION user pointer */ - CINIT(FNMATCH_DATA, OBJECTPOINT, 202), - - /* send linked-list of name:port:address sets */ - CINIT(RESOLVE, OBJECTPOINT, 203), - - /* Set a username for authenticated TLS */ - CINIT(TLSAUTH_USERNAME, OBJECTPOINT, 204), - - /* Set a password for authenticated TLS */ - CINIT(TLSAUTH_PASSWORD, OBJECTPOINT, 205), - - /* Set authentication type for authenticated TLS */ - CINIT(TLSAUTH_TYPE, OBJECTPOINT, 206), - - /* Set to 1 to enable the "TE:" header in HTTP requests to ask for - compressed transfer-encoded responses. Set to 0 to disable the use of TE: - in outgoing requests. The current default is 0, but it might change in a - future libcurl release. - - libcurl will ask for the compressed methods it knows of, and if that - isn't any, it will not ask for transfer-encoding at all even if this - option is set to 1. - - */ - CINIT(TRANSFER_ENCODING, LONG, 207), - - /* Callback function for closing socket (instead of close(2)). The callback - should have type curl_closesocket_callback */ - CINIT(CLOSESOCKETFUNCTION, FUNCTIONPOINT, 208), - CINIT(CLOSESOCKETDATA, OBJECTPOINT, 209), - - /* allow GSSAPI credential delegation */ - CINIT(GSSAPI_DELEGATION, LONG, 210), - - /* Set the name servers to use for DNS resolution */ - CINIT(DNS_SERVERS, OBJECTPOINT, 211), - - /* Time-out accept operations (currently for FTP only) after this amount - of miliseconds. */ - CINIT(ACCEPTTIMEOUT_MS, LONG, 212), - - /* Set TCP keepalive */ - CINIT(TCP_KEEPALIVE, LONG, 213), - - /* non-universal keepalive knobs (Linux, AIX, HP-UX, more) */ - CINIT(TCP_KEEPIDLE, LONG, 214), - CINIT(TCP_KEEPINTVL, LONG, 215), - - /* Enable/disable specific SSL features with a bitmask, see CURLSSLOPT_* */ - CINIT(SSL_OPTIONS, LONG, 216), - - /* set the SMTP auth originator */ - CINIT(MAIL_AUTH, OBJECTPOINT, 217), - - CURLOPT_LASTENTRY /* the last unused */ -} CURLoption; - -#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all - the obsolete stuff removed! */ - -/* Backwards compatibility with older names */ -/* These are scheduled to disappear by 2011 */ - -/* This was added in version 7.19.1 */ -#define CURLOPT_POST301 CURLOPT_POSTREDIR - -/* These are scheduled to disappear by 2009 */ - -/* The following were added in 7.17.0 */ -#define CURLOPT_SSLKEYPASSWD CURLOPT_KEYPASSWD -#define CURLOPT_FTPAPPEND CURLOPT_APPEND -#define CURLOPT_FTPLISTONLY CURLOPT_DIRLISTONLY -#define CURLOPT_FTP_SSL CURLOPT_USE_SSL - -/* The following were added earlier */ - -#define CURLOPT_SSLCERTPASSWD CURLOPT_KEYPASSWD -#define CURLOPT_KRB4LEVEL CURLOPT_KRBLEVEL - -#else -/* This is set if CURL_NO_OLDIES is defined at compile-time */ -#undef CURLOPT_DNS_USE_GLOBAL_CACHE /* soon obsolete */ -#endif - - - /* Below here follows defines for the CURLOPT_IPRESOLVE option. If a host - name resolves addresses using more than one IP protocol version, this - option might be handy to force libcurl to use a specific IP version. */ -#define CURL_IPRESOLVE_WHATEVER 0 /* default, resolves addresses to all IP - versions that your system allows */ -#define CURL_IPRESOLVE_V4 1 /* resolve to ipv4 addresses */ -#define CURL_IPRESOLVE_V6 2 /* resolve to ipv6 addresses */ - - /* three convenient "aliases" that follow the name scheme better */ -#define CURLOPT_WRITEDATA CURLOPT_FILE -#define CURLOPT_READDATA CURLOPT_INFILE -#define CURLOPT_HEADERDATA CURLOPT_WRITEHEADER -#define CURLOPT_RTSPHEADER CURLOPT_HTTPHEADER - - /* These enums are for use with the CURLOPT_HTTP_VERSION option. */ -enum { - CURL_HTTP_VERSION_NONE, /* setting this means we don't care, and that we'd - like the library to choose the best possible - for us! */ - CURL_HTTP_VERSION_1_0, /* please use HTTP 1.0 in the request */ - CURL_HTTP_VERSION_1_1, /* please use HTTP 1.1 in the request */ - - CURL_HTTP_VERSION_LAST /* *ILLEGAL* http version */ -}; - -/* - * Public API enums for RTSP requests - */ -enum { - CURL_RTSPREQ_NONE, /* first in list */ - CURL_RTSPREQ_OPTIONS, - CURL_RTSPREQ_DESCRIBE, - CURL_RTSPREQ_ANNOUNCE, - CURL_RTSPREQ_SETUP, - CURL_RTSPREQ_PLAY, - CURL_RTSPREQ_PAUSE, - CURL_RTSPREQ_TEARDOWN, - CURL_RTSPREQ_GET_PARAMETER, - CURL_RTSPREQ_SET_PARAMETER, - CURL_RTSPREQ_RECORD, - CURL_RTSPREQ_RECEIVE, - CURL_RTSPREQ_LAST /* last in list */ -}; - - /* These enums are for use with the CURLOPT_NETRC option. */ -enum CURL_NETRC_OPTION { - CURL_NETRC_IGNORED, /* The .netrc will never be read. - * This is the default. */ - CURL_NETRC_OPTIONAL, /* A user:password in the URL will be preferred - * to one in the .netrc. */ - CURL_NETRC_REQUIRED, /* A user:password in the URL will be ignored. - * Unless one is set programmatically, the .netrc - * will be queried. */ - CURL_NETRC_LAST -}; - -enum { - CURL_SSLVERSION_DEFAULT, - CURL_SSLVERSION_TLSv1, - CURL_SSLVERSION_SSLv2, - CURL_SSLVERSION_SSLv3, - - CURL_SSLVERSION_LAST /* never use, keep last */ -}; - -enum CURL_TLSAUTH { - CURL_TLSAUTH_NONE, - CURL_TLSAUTH_SRP, - CURL_TLSAUTH_LAST /* never use, keep last */ -}; - -/* symbols to use with CURLOPT_POSTREDIR. - CURL_REDIR_POST_301, CURL_REDIR_POST_302 and CURL_REDIR_POST_303 - can be bitwise ORed so that CURL_REDIR_POST_301 | CURL_REDIR_POST_302 - | CURL_REDIR_POST_303 == CURL_REDIR_POST_ALL */ - -#define CURL_REDIR_GET_ALL 0 -#define CURL_REDIR_POST_301 1 -#define CURL_REDIR_POST_302 2 -#define CURL_REDIR_POST_303 4 -#define CURL_REDIR_POST_ALL \ - (CURL_REDIR_POST_301|CURL_REDIR_POST_302|CURL_REDIR_POST_303) - -typedef enum { - CURL_TIMECOND_NONE, - - CURL_TIMECOND_IFMODSINCE, - CURL_TIMECOND_IFUNMODSINCE, - CURL_TIMECOND_LASTMOD, - - CURL_TIMECOND_LAST -} curl_TimeCond; - - -/* curl_strequal() and curl_strnequal() are subject for removal in a future - libcurl, see lib/README.curlx for details */ -CURL_EXTERN int (curl_strequal)(const char *s1, const char *s2); -CURL_EXTERN int (curl_strnequal)(const char *s1, const char *s2, size_t n); - -/* name is uppercase CURLFORM_ */ -#ifdef CFINIT -#undef CFINIT -#endif - -#ifdef CURL_ISOCPP -#define CFINIT(name) CURLFORM_ ## name -#else -/* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */ -#define CFINIT(name) CURLFORM_/**/name -#endif - -typedef enum { - CFINIT(NOTHING), /********* the first one is unused ************/ - - /* */ - CFINIT(COPYNAME), - CFINIT(PTRNAME), - CFINIT(NAMELENGTH), - CFINIT(COPYCONTENTS), - CFINIT(PTRCONTENTS), - CFINIT(CONTENTSLENGTH), - CFINIT(FILECONTENT), - CFINIT(ARRAY), - CFINIT(OBSOLETE), - CFINIT(FILE), - - CFINIT(BUFFER), - CFINIT(BUFFERPTR), - CFINIT(BUFFERLENGTH), - - CFINIT(CONTENTTYPE), - CFINIT(CONTENTHEADER), - CFINIT(FILENAME), - CFINIT(END), - CFINIT(OBSOLETE2), - - CFINIT(STREAM), - - CURLFORM_LASTENTRY /* the last unused */ -} CURLformoption; - -#undef CFINIT /* done */ - -/* structure to be used as parameter for CURLFORM_ARRAY */ -struct curl_forms { - CURLformoption option; - const char *value; -}; - -/* use this for multipart formpost building */ -/* Returns code for curl_formadd() - * - * Returns: - * CURL_FORMADD_OK on success - * CURL_FORMADD_MEMORY if the FormInfo allocation fails - * CURL_FORMADD_OPTION_TWICE if one option is given twice for one Form - * CURL_FORMADD_NULL if a null pointer was given for a char - * CURL_FORMADD_MEMORY if the allocation of a FormInfo struct failed - * CURL_FORMADD_UNKNOWN_OPTION if an unknown option was used - * CURL_FORMADD_INCOMPLETE if the some FormInfo is not complete (or error) - * CURL_FORMADD_MEMORY if a curl_httppost struct cannot be allocated - * CURL_FORMADD_MEMORY if some allocation for string copying failed. - * CURL_FORMADD_ILLEGAL_ARRAY if an illegal option is used in an array - * - ***************************************************************************/ -typedef enum { - CURL_FORMADD_OK, /* first, no error */ - - CURL_FORMADD_MEMORY, - CURL_FORMADD_OPTION_TWICE, - CURL_FORMADD_NULL, - CURL_FORMADD_UNKNOWN_OPTION, - CURL_FORMADD_INCOMPLETE, - CURL_FORMADD_ILLEGAL_ARRAY, - CURL_FORMADD_DISABLED, /* libcurl was built with this disabled */ - - CURL_FORMADD_LAST /* last */ -} CURLFORMcode; - -/* - * NAME curl_formadd() - * - * DESCRIPTION - * - * Pretty advanced function for building multi-part formposts. Each invoke - * adds one part that together construct a full post. Then use - * CURLOPT_HTTPPOST to send it off to libcurl. - */ -CURL_EXTERN CURLFORMcode curl_formadd(struct curl_httppost **httppost, - struct curl_httppost **last_post, - ...); - -/* - * callback function for curl_formget() - * The void *arg pointer will be the one passed as second argument to - * curl_formget(). - * The character buffer passed to it must not be freed. - * Should return the buffer length passed to it as the argument "len" on - * success. - */ -typedef size_t (*curl_formget_callback)(void *arg, const char *buf, - size_t len); - -/* - * NAME curl_formget() - * - * DESCRIPTION - * - * Serialize a curl_httppost struct built with curl_formadd(). - * Accepts a void pointer as second argument which will be passed to - * the curl_formget_callback function. - * Returns 0 on success. - */ -CURL_EXTERN int curl_formget(struct curl_httppost *form, void *arg, - curl_formget_callback append); -/* - * NAME curl_formfree() - * - * DESCRIPTION - * - * Free a multipart formpost previously built with curl_formadd(). - */ -CURL_EXTERN void curl_formfree(struct curl_httppost *form); - -/* - * NAME curl_getenv() - * - * DESCRIPTION - * - * Returns a malloc()'ed string that MUST be curl_free()ed after usage is - * complete. DEPRECATED - see lib/README.curlx - */ -CURL_EXTERN char *curl_getenv(const char *variable); - -/* - * NAME curl_version() - * - * DESCRIPTION - * - * Returns a static ascii string of the libcurl version. - */ -CURL_EXTERN char *curl_version(void); - -/* - * NAME curl_easy_escape() - * - * DESCRIPTION - * - * Escapes URL strings (converts all letters consider illegal in URLs to their - * %XX versions). This function returns a new allocated string or NULL if an - * error occurred. - */ -CURL_EXTERN char *curl_easy_escape(CURL *handle, - const char *string, - int length); - -/* the previous version: */ -CURL_EXTERN char *curl_escape(const char *string, - int length); - - -/* - * NAME curl_easy_unescape() - * - * DESCRIPTION - * - * Unescapes URL encoding in strings (converts all %XX codes to their 8bit - * versions). This function returns a new allocated string or NULL if an error - * occurred. - * Conversion Note: On non-ASCII platforms the ASCII %XX codes are - * converted into the host encoding. - */ -CURL_EXTERN char *curl_easy_unescape(CURL *handle, - const char *string, - int length, - int *outlength); - -/* the previous version */ -CURL_EXTERN char *curl_unescape(const char *string, - int length); - -/* - * NAME curl_free() - * - * DESCRIPTION - * - * Provided for de-allocation in the same translation unit that did the - * allocation. Added in libcurl 7.10 - */ -CURL_EXTERN void curl_free(void *p); - -/* - * NAME curl_global_init() - * - * DESCRIPTION - * - * curl_global_init() should be invoked exactly once for each application that - * uses libcurl and before any call of other libcurl functions. - * - * This function is not thread-safe! - */ -CURL_EXTERN CURLcode curl_global_init(long flags); - -/* - * NAME curl_global_init_mem() - * - * DESCRIPTION - * - * curl_global_init() or curl_global_init_mem() should be invoked exactly once - * for each application that uses libcurl. This function can be used to - * initialize libcurl and set user defined memory management callback - * functions. Users can implement memory management routines to check for - * memory leaks, check for mis-use of the curl library etc. User registered - * callback routines with be invoked by this library instead of the system - * memory management routines like malloc, free etc. - */ -CURL_EXTERN CURLcode curl_global_init_mem(long flags, - curl_malloc_callback m, - curl_free_callback f, - curl_realloc_callback r, - curl_strdup_callback s, - curl_calloc_callback c); - -/* - * NAME curl_global_cleanup() - * - * DESCRIPTION - * - * curl_global_cleanup() should be invoked exactly once for each application - * that uses libcurl - */ -CURL_EXTERN void curl_global_cleanup(void); - -/* linked-list structure for the CURLOPT_QUOTE option (and other) */ -struct curl_slist { - char *data; - struct curl_slist *next; -}; - -/* - * NAME curl_slist_append() - * - * DESCRIPTION - * - * Appends a string to a linked list. If no list exists, it will be created - * first. Returns the new list, after appending. - */ -CURL_EXTERN struct curl_slist *curl_slist_append(struct curl_slist *, - const char *); - -/* - * NAME curl_slist_free_all() - * - * DESCRIPTION - * - * free a previously built curl_slist. - */ -CURL_EXTERN void curl_slist_free_all(struct curl_slist *); - -/* - * NAME curl_getdate() - * - * DESCRIPTION - * - * Returns the time, in seconds since 1 Jan 1970 of the time string given in - * the first argument. The time argument in the second parameter is unused - * and should be set to NULL. - */ -CURL_EXTERN time_t curl_getdate(const char *p, const time_t *unused); - -/* info about the certificate chain, only for OpenSSL builds. Asked - for with CURLOPT_CERTINFO / CURLINFO_CERTINFO */ -struct curl_certinfo { - int num_of_certs; /* number of certificates with information */ - struct curl_slist **certinfo; /* for each index in this array, there's a - linked list with textual information in the - format "name: value" */ -}; - -#define CURLINFO_STRING 0x100000 -#define CURLINFO_LONG 0x200000 -#define CURLINFO_DOUBLE 0x300000 -#define CURLINFO_SLIST 0x400000 -#define CURLINFO_MASK 0x0fffff -#define CURLINFO_TYPEMASK 0xf00000 - -typedef enum { - CURLINFO_NONE, /* first, never use this */ - CURLINFO_EFFECTIVE_URL = CURLINFO_STRING + 1, - CURLINFO_RESPONSE_CODE = CURLINFO_LONG + 2, - CURLINFO_TOTAL_TIME = CURLINFO_DOUBLE + 3, - CURLINFO_NAMELOOKUP_TIME = CURLINFO_DOUBLE + 4, - CURLINFO_CONNECT_TIME = CURLINFO_DOUBLE + 5, - CURLINFO_PRETRANSFER_TIME = CURLINFO_DOUBLE + 6, - CURLINFO_SIZE_UPLOAD = CURLINFO_DOUBLE + 7, - CURLINFO_SIZE_DOWNLOAD = CURLINFO_DOUBLE + 8, - CURLINFO_SPEED_DOWNLOAD = CURLINFO_DOUBLE + 9, - CURLINFO_SPEED_UPLOAD = CURLINFO_DOUBLE + 10, - CURLINFO_HEADER_SIZE = CURLINFO_LONG + 11, - CURLINFO_REQUEST_SIZE = CURLINFO_LONG + 12, - CURLINFO_SSL_VERIFYRESULT = CURLINFO_LONG + 13, - CURLINFO_FILETIME = CURLINFO_LONG + 14, - CURLINFO_CONTENT_LENGTH_DOWNLOAD = CURLINFO_DOUBLE + 15, - CURLINFO_CONTENT_LENGTH_UPLOAD = CURLINFO_DOUBLE + 16, - CURLINFO_STARTTRANSFER_TIME = CURLINFO_DOUBLE + 17, - CURLINFO_CONTENT_TYPE = CURLINFO_STRING + 18, - CURLINFO_REDIRECT_TIME = CURLINFO_DOUBLE + 19, - CURLINFO_REDIRECT_COUNT = CURLINFO_LONG + 20, - CURLINFO_PRIVATE = CURLINFO_STRING + 21, - CURLINFO_HTTP_CONNECTCODE = CURLINFO_LONG + 22, - CURLINFO_HTTPAUTH_AVAIL = CURLINFO_LONG + 23, - CURLINFO_PROXYAUTH_AVAIL = CURLINFO_LONG + 24, - CURLINFO_OS_ERRNO = CURLINFO_LONG + 25, - CURLINFO_NUM_CONNECTS = CURLINFO_LONG + 26, - CURLINFO_SSL_ENGINES = CURLINFO_SLIST + 27, - CURLINFO_COOKIELIST = CURLINFO_SLIST + 28, - CURLINFO_LASTSOCKET = CURLINFO_LONG + 29, - CURLINFO_FTP_ENTRY_PATH = CURLINFO_STRING + 30, - CURLINFO_REDIRECT_URL = CURLINFO_STRING + 31, - CURLINFO_PRIMARY_IP = CURLINFO_STRING + 32, - CURLINFO_APPCONNECT_TIME = CURLINFO_DOUBLE + 33, - CURLINFO_CERTINFO = CURLINFO_SLIST + 34, - CURLINFO_CONDITION_UNMET = CURLINFO_LONG + 35, - CURLINFO_RTSP_SESSION_ID = CURLINFO_STRING + 36, - CURLINFO_RTSP_CLIENT_CSEQ = CURLINFO_LONG + 37, - CURLINFO_RTSP_SERVER_CSEQ = CURLINFO_LONG + 38, - CURLINFO_RTSP_CSEQ_RECV = CURLINFO_LONG + 39, - CURLINFO_PRIMARY_PORT = CURLINFO_LONG + 40, - CURLINFO_LOCAL_IP = CURLINFO_STRING + 41, - CURLINFO_LOCAL_PORT = CURLINFO_LONG + 42, - /* Fill in new entries below here! */ - - CURLINFO_LASTONE = 42 -} CURLINFO; - -/* CURLINFO_RESPONSE_CODE is the new name for the option previously known as - CURLINFO_HTTP_CODE */ -#define CURLINFO_HTTP_CODE CURLINFO_RESPONSE_CODE - -typedef enum { - CURLCLOSEPOLICY_NONE, /* first, never use this */ - - CURLCLOSEPOLICY_OLDEST, - CURLCLOSEPOLICY_LEAST_RECENTLY_USED, - CURLCLOSEPOLICY_LEAST_TRAFFIC, - CURLCLOSEPOLICY_SLOWEST, - CURLCLOSEPOLICY_CALLBACK, - - CURLCLOSEPOLICY_LAST /* last, never use this */ -} curl_closepolicy; - -#define CURL_GLOBAL_SSL (1<<0) -#define CURL_GLOBAL_WIN32 (1<<1) -#define CURL_GLOBAL_ALL (CURL_GLOBAL_SSL|CURL_GLOBAL_WIN32) -#define CURL_GLOBAL_NOTHING 0 -#define CURL_GLOBAL_DEFAULT CURL_GLOBAL_ALL - - -/***************************************************************************** - * Setup defines, protos etc for the sharing stuff. - */ - -/* Different data locks for a single share */ -typedef enum { - CURL_LOCK_DATA_NONE = 0, - /* CURL_LOCK_DATA_SHARE is used internally to say that - * the locking is just made to change the internal state of the share - * itself. - */ - CURL_LOCK_DATA_SHARE, - CURL_LOCK_DATA_COOKIE, - CURL_LOCK_DATA_DNS, - CURL_LOCK_DATA_SSL_SESSION, - CURL_LOCK_DATA_CONNECT, - CURL_LOCK_DATA_LAST -} curl_lock_data; - -/* Different lock access types */ -typedef enum { - CURL_LOCK_ACCESS_NONE = 0, /* unspecified action */ - CURL_LOCK_ACCESS_SHARED = 1, /* for read perhaps */ - CURL_LOCK_ACCESS_SINGLE = 2, /* for write perhaps */ - CURL_LOCK_ACCESS_LAST /* never use */ -} curl_lock_access; - -typedef void (*curl_lock_function)(CURL *handle, - curl_lock_data data, - curl_lock_access locktype, - void *userptr); -typedef void (*curl_unlock_function)(CURL *handle, - curl_lock_data data, - void *userptr); - -typedef void CURLSH; - -typedef enum { - CURLSHE_OK, /* all is fine */ - CURLSHE_BAD_OPTION, /* 1 */ - CURLSHE_IN_USE, /* 2 */ - CURLSHE_INVALID, /* 3 */ - CURLSHE_NOMEM, /* 4 out of memory */ - CURLSHE_NOT_BUILT_IN, /* 5 feature not present in lib */ - CURLSHE_LAST /* never use */ -} CURLSHcode; - -typedef enum { - CURLSHOPT_NONE, /* don't use */ - CURLSHOPT_SHARE, /* specify a data type to share */ - CURLSHOPT_UNSHARE, /* specify which data type to stop sharing */ - CURLSHOPT_LOCKFUNC, /* pass in a 'curl_lock_function' pointer */ - CURLSHOPT_UNLOCKFUNC, /* pass in a 'curl_unlock_function' pointer */ - CURLSHOPT_USERDATA, /* pass in a user data pointer used in the lock/unlock - callback functions */ - CURLSHOPT_LAST /* never use */ -} CURLSHoption; - -CURL_EXTERN CURLSH *curl_share_init(void); -CURL_EXTERN CURLSHcode curl_share_setopt(CURLSH *, CURLSHoption option, ...); -CURL_EXTERN CURLSHcode curl_share_cleanup(CURLSH *); - -/**************************************************************************** - * Structures for querying information about the curl library at runtime. - */ - -typedef enum { - CURLVERSION_FIRST, - CURLVERSION_SECOND, - CURLVERSION_THIRD, - CURLVERSION_FOURTH, - CURLVERSION_LAST /* never actually use this */ -} CURLversion; - -/* The 'CURLVERSION_NOW' is the symbolic name meant to be used by - basically all programs ever that want to get version information. It is - meant to be a built-in version number for what kind of struct the caller - expects. If the struct ever changes, we redefine the NOW to another enum - from above. */ -#define CURLVERSION_NOW CURLVERSION_FOURTH - -typedef struct { - CURLversion age; /* age of the returned struct */ - const char *version; /* LIBCURL_VERSION */ - unsigned int version_num; /* LIBCURL_VERSION_NUM */ - const char *host; /* OS/host/cpu/machine when configured */ - int features; /* bitmask, see defines below */ - const char *ssl_version; /* human readable string */ - long ssl_version_num; /* not used anymore, always 0 */ - const char *libz_version; /* human readable string */ - /* protocols is terminated by an entry with a NULL protoname */ - const char * const *protocols; - - /* The fields below this were added in CURLVERSION_SECOND */ - const char *ares; - int ares_num; - - /* This field was added in CURLVERSION_THIRD */ - const char *libidn; - - /* These field were added in CURLVERSION_FOURTH */ - - /* Same as '_libiconv_version' if built with HAVE_ICONV */ - int iconv_ver_num; - - const char *libssh_version; /* human readable string */ - -} curl_version_info_data; - -#define CURL_VERSION_IPV6 (1<<0) /* IPv6-enabled */ -#define CURL_VERSION_KERBEROS4 (1<<1) /* kerberos auth is supported */ -#define CURL_VERSION_SSL (1<<2) /* SSL options are present */ -#define CURL_VERSION_LIBZ (1<<3) /* libz features are present */ -#define CURL_VERSION_NTLM (1<<4) /* NTLM auth is supported */ -#define CURL_VERSION_GSSNEGOTIATE (1<<5) /* Negotiate auth support */ -#define CURL_VERSION_DEBUG (1<<6) /* built with debug capabilities */ -#define CURL_VERSION_ASYNCHDNS (1<<7) /* asynchronous dns resolves */ -#define CURL_VERSION_SPNEGO (1<<8) /* SPNEGO auth */ -#define CURL_VERSION_LARGEFILE (1<<9) /* supports files bigger than 2GB */ -#define CURL_VERSION_IDN (1<<10) /* International Domain Names support */ -#define CURL_VERSION_SSPI (1<<11) /* SSPI is supported */ -#define CURL_VERSION_CONV (1<<12) /* character conversions supported */ -#define CURL_VERSION_CURLDEBUG (1<<13) /* debug memory tracking supported */ -#define CURL_VERSION_TLSAUTH_SRP (1<<14) /* TLS-SRP auth is supported */ -#define CURL_VERSION_NTLM_WB (1<<15) /* NTLM delegating to winbind helper */ - - /* - * NAME curl_version_info() - * - * DESCRIPTION - * - * This function returns a pointer to a static copy of the version info - * struct. See above. - */ -CURL_EXTERN curl_version_info_data *curl_version_info(CURLversion); - -/* - * NAME curl_easy_strerror() - * - * DESCRIPTION - * - * The curl_easy_strerror function may be used to turn a CURLcode value - * into the equivalent human readable error string. This is useful - * for printing meaningful error messages. - */ -CURL_EXTERN const char *curl_easy_strerror(CURLcode); - -/* - * NAME curl_share_strerror() - * - * DESCRIPTION - * - * The curl_share_strerror function may be used to turn a CURLSHcode value - * into the equivalent human readable error string. This is useful - * for printing meaningful error messages. - */ -CURL_EXTERN const char *curl_share_strerror(CURLSHcode); - -/* - * NAME curl_easy_pause() - * - * DESCRIPTION - * - * The curl_easy_pause function pauses or unpauses transfers. Select the new - * state by setting the bitmask, use the convenience defines below. - * - */ -CURL_EXTERN CURLcode curl_easy_pause(CURL *handle, int bitmask); - -#define CURLPAUSE_RECV (1<<0) -#define CURLPAUSE_RECV_CONT (0) - -#define CURLPAUSE_SEND (1<<2) -#define CURLPAUSE_SEND_CONT (0) - -#define CURLPAUSE_ALL (CURLPAUSE_RECV|CURLPAUSE_SEND) -#define CURLPAUSE_CONT (CURLPAUSE_RECV_CONT|CURLPAUSE_SEND_CONT) - -#ifdef __cplusplus -} -#endif - -/* unfortunately, the easy.h and multi.h include files need options and info - stuff before they can be included! */ -#include "easy.h" /* nothing in curl is fun without the easy stuff */ -#include "multi.h" - -/* the typechecker doesn't work in C++ (yet) */ -#if defined(__GNUC__) && defined(__GNUC_MINOR__) && \ - ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) && \ - !defined(__cplusplus) && !defined(CURL_DISABLE_TYPECHECK) -#include "typecheck-gcc.h" -#else -#if defined(__STDC__) && (__STDC__ >= 1) -/* This preprocessor magic that replaces a call with the exact same call is - only done to make sure application authors pass exactly three arguments - to these functions. */ -#define curl_easy_setopt(handle,opt,param) curl_easy_setopt(handle,opt,param) -#define curl_easy_getinfo(handle,info,arg) curl_easy_getinfo(handle,info,arg) -#define curl_share_setopt(share,opt,param) curl_share_setopt(share,opt,param) -#define curl_multi_setopt(handle,opt,param) curl_multi_setopt(handle,opt,param) -#endif /* __STDC__ >= 1 */ -#endif /* gcc >= 4.3 && !__cplusplus */ - -#endif /* __CURL_CURL_H */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/curl/curlbuild.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/curl/curlbuild.h deleted file mode 100644 index 98ede6eef7..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/curl/curlbuild.h +++ /dev/null @@ -1,191 +0,0 @@ -/* include/curl/curlbuild.h. Generated from curlbuild.h.in by configure. */ -#ifndef __CURL_CURLBUILD_H -#define __CURL_CURLBUILD_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2011, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - ***************************************************************************/ - -/* ================================================================ */ -/* NOTES FOR CONFIGURE CAPABLE SYSTEMS */ -/* ================================================================ */ - -/* - * NOTE 1: - * ------- - * - * Nothing in this file is intended to be modified or adjusted by the - * curl library user nor by the curl library builder. - * - * If you think that something actually needs to be changed, adjusted - * or fixed in this file, then, report it on the libcurl development - * mailing list: http://cool.haxx.se/mailman/listinfo/curl-library/ - * - * This header file shall only export symbols which are 'curl' or 'CURL' - * prefixed, otherwise public name space would be polluted. - * - * NOTE 2: - * ------- - * - * Right now you might be staring at file include/curl/curlbuild.h.in or - * at file include/curl/curlbuild.h, this is due to the following reason: - * - * On systems capable of running the configure script, the configure process - * will overwrite the distributed include/curl/curlbuild.h file with one that - * is suitable and specific to the library being configured and built, which - * is generated from the include/curl/curlbuild.h.in template file. - * - */ - -/* ================================================================ */ -/* DEFINITION OF THESE SYMBOLS SHALL NOT TAKE PLACE ANYWHERE ELSE */ -/* ================================================================ */ - -#ifdef CURL_SIZEOF_LONG -#error "CURL_SIZEOF_LONG shall not be defined except in curlbuild.h" - Error Compilation_aborted_CURL_SIZEOF_LONG_already_defined -#endif - -#ifdef CURL_TYPEOF_CURL_SOCKLEN_T -#error "CURL_TYPEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h" - Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_already_defined -#endif - -#ifdef CURL_SIZEOF_CURL_SOCKLEN_T -#error "CURL_SIZEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h" - Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_already_defined -#endif - -#ifdef CURL_TYPEOF_CURL_OFF_T -#error "CURL_TYPEOF_CURL_OFF_T shall not be defined except in curlbuild.h" - Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_already_defined -#endif - -#ifdef CURL_FORMAT_CURL_OFF_T -#error "CURL_FORMAT_CURL_OFF_T shall not be defined except in curlbuild.h" - Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_already_defined -#endif - -#ifdef CURL_FORMAT_CURL_OFF_TU -#error "CURL_FORMAT_CURL_OFF_TU shall not be defined except in curlbuild.h" - Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_already_defined -#endif - -#ifdef CURL_FORMAT_OFF_T -#error "CURL_FORMAT_OFF_T shall not be defined except in curlbuild.h" - Error Compilation_aborted_CURL_FORMAT_OFF_T_already_defined -#endif - -#ifdef CURL_SIZEOF_CURL_OFF_T -#error "CURL_SIZEOF_CURL_OFF_T shall not be defined except in curlbuild.h" - Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_already_defined -#endif - -#ifdef CURL_SUFFIX_CURL_OFF_T -#error "CURL_SUFFIX_CURL_OFF_T shall not be defined except in curlbuild.h" - Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_already_defined -#endif - -#ifdef CURL_SUFFIX_CURL_OFF_TU -#error "CURL_SUFFIX_CURL_OFF_TU shall not be defined except in curlbuild.h" - Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_already_defined -#endif - -/* ================================================================ */ -/* EXTERNAL INTERFACE SETTINGS FOR CONFIGURE CAPABLE SYSTEMS ONLY */ -/* ================================================================ */ - -/* Configure process defines this to 1 when it finds out that system */ -/* header file ws2tcpip.h must be included by the external interface. */ -/* #undef CURL_PULL_WS2TCPIP_H */ -#ifdef CURL_PULL_WS2TCPIP_H -# ifndef WIN32_LEAN_AND_MEAN -# define WIN32_LEAN_AND_MEAN -# endif -# include -# include -# include -#endif - -/* Configure process defines this to 1 when it finds out that system */ -/* header file sys/types.h must be included by the external interface. */ -#define CURL_PULL_SYS_TYPES_H 1 -#ifdef CURL_PULL_SYS_TYPES_H -# include -#endif - -/* Configure process defines this to 1 when it finds out that system */ -/* header file stdint.h must be included by the external interface. */ -#define CURL_PULL_STDINT_H 1 -#ifdef CURL_PULL_STDINT_H -# include -#endif - -/* Configure process defines this to 1 when it finds out that system */ -/* header file inttypes.h must be included by the external interface. */ -#define CURL_PULL_INTTYPES_H 1 -#ifdef CURL_PULL_INTTYPES_H -# include -#endif - -/* Configure process defines this to 1 when it finds out that system */ -/* header file sys/socket.h must be included by the external interface. */ -#define CURL_PULL_SYS_SOCKET_H 1 -#ifdef CURL_PULL_SYS_SOCKET_H -# include -#endif - -/* The size of `long', as computed by sizeof. */ -#define CURL_SIZEOF_LONG 4 - -/* Integral data type used for curl_socklen_t. */ -#define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t - -/* The size of `curl_socklen_t', as computed by sizeof. */ -#define CURL_SIZEOF_CURL_SOCKLEN_T 4 - -/* Data type definition of curl_socklen_t. */ -typedef CURL_TYPEOF_CURL_SOCKLEN_T curl_socklen_t; - -/* Signed integral data type used for curl_off_t. */ -#define CURL_TYPEOF_CURL_OFF_T int64_t - -/* Data type definition of curl_off_t. */ -typedef CURL_TYPEOF_CURL_OFF_T curl_off_t; - -/* curl_off_t formatting string directive without "%" conversion specifier. */ -#define CURL_FORMAT_CURL_OFF_T "lld" - -/* unsigned curl_off_t formatting string without "%" conversion specifier. */ -#define CURL_FORMAT_CURL_OFF_TU "llu" - -/* curl_off_t formatting string directive with "%" conversion specifier. */ -#define CURL_FORMAT_OFF_T "%lld" - -/* The size of `curl_off_t', as computed by sizeof. */ -#define CURL_SIZEOF_CURL_OFF_T 8 - -/* curl_off_t constant suffix. */ -#define CURL_SUFFIX_CURL_OFF_T LL - -/* unsigned curl_off_t constant suffix. */ -#define CURL_SUFFIX_CURL_OFF_TU ULL - -#endif /* __CURL_CURLBUILD_H */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/curl/curlver.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/curl/curlver.h deleted file mode 100644 index f3afbe15ae..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/curl/curlver.h +++ /dev/null @@ -1,69 +0,0 @@ -#ifndef __CURL_CURLVER_H -#define __CURL_CURLVER_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - ***************************************************************************/ - -/* This header file contains nothing but libcurl version info, generated by - a script at release-time. This was made its own header file in 7.11.2 */ - -/* This is the global package copyright */ -#define LIBCURL_COPYRIGHT "1996 - 2012 Daniel Stenberg, ." - -/* This is the version number of the libcurl package from which this header - file origins: */ -#define LIBCURL_VERSION "7.28.1" - -/* The numeric version number is also available "in parts" by using these - defines: */ -#define LIBCURL_VERSION_MAJOR 7 -#define LIBCURL_VERSION_MINOR 28 -#define LIBCURL_VERSION_PATCH 1 - -/* This is the numeric version of the libcurl version number, meant for easier - parsing and comparions by programs. The LIBCURL_VERSION_NUM define will - always follow this syntax: - - 0xXXYYZZ - - Where XX, YY and ZZ are the main version, release and patch numbers in - hexadecimal (using 8 bits each). All three numbers are always represented - using two digits. 1.2 would appear as "0x010200" while version 9.11.7 - appears as "0x090b07". - - This 6-digit (24 bits) hexadecimal number does not show pre-release number, - and it is always a greater number in a more recent release. It makes - comparisons with greater than and less than work. -*/ -#define LIBCURL_VERSION_NUM 0x071c01 - -/* - * This is the date and time when the full source package was created. The - * timestamp is not stored in git, as the timestamp is properly set in the - * tarballs by the maketgz script. - * - * The format of the date should follow this template: - * - * "Mon Feb 12 11:35:33 UTC 2007" - */ -#define LIBCURL_TIMESTAMP "Tue Nov 20 07:12:05 UTC 2012" - -#endif /* __CURL_CURLVER_H */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/curl/multi.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/curl/multi.h deleted file mode 100644 index 6dcd2bac4c..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/curl/multi.h +++ /dev/null @@ -1,372 +0,0 @@ -#ifndef __CURL_MULTI_H -#define __CURL_MULTI_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - ***************************************************************************/ -/* - This is an "external" header file. Don't give away any internals here! - - GOALS - - o Enable a "pull" interface. The application that uses libcurl decides where - and when to ask libcurl to get/send data. - - o Enable multiple simultaneous transfers in the same thread without making it - complicated for the application. - - o Enable the application to select() on its own file descriptors and curl's - file descriptors simultaneous easily. - -*/ - -/* - * This header file should not really need to include "curl.h" since curl.h - * itself includes this file and we expect user applications to do #include - * without the need for especially including multi.h. - * - * For some reason we added this include here at one point, and rather than to - * break existing (wrongly written) libcurl applications, we leave it as-is - * but with this warning attached. - */ -#include "curl.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef void CURLM; - -typedef enum { - CURLM_CALL_MULTI_PERFORM = -1, /* please call curl_multi_perform() or - curl_multi_socket*() soon */ - CURLM_OK, - CURLM_BAD_HANDLE, /* the passed-in handle is not a valid CURLM handle */ - CURLM_BAD_EASY_HANDLE, /* an easy handle was not good/valid */ - CURLM_OUT_OF_MEMORY, /* if you ever get this, you're in deep sh*t */ - CURLM_INTERNAL_ERROR, /* this is a libcurl bug */ - CURLM_BAD_SOCKET, /* the passed in socket argument did not match */ - CURLM_UNKNOWN_OPTION, /* curl_multi_setopt() with unsupported option */ - CURLM_LAST -} CURLMcode; - -/* just to make code nicer when using curl_multi_socket() you can now check - for CURLM_CALL_MULTI_SOCKET too in the same style it works for - curl_multi_perform() and CURLM_CALL_MULTI_PERFORM */ -#define CURLM_CALL_MULTI_SOCKET CURLM_CALL_MULTI_PERFORM - -typedef enum { - CURLMSG_NONE, /* first, not used */ - CURLMSG_DONE, /* This easy handle has completed. 'result' contains - the CURLcode of the transfer */ - CURLMSG_LAST /* last, not used */ -} CURLMSG; - -struct CURLMsg { - CURLMSG msg; /* what this message means */ - CURL *easy_handle; /* the handle it concerns */ - union { - void *whatever; /* message-specific data */ - CURLcode result; /* return code for transfer */ - } data; -}; -typedef struct CURLMsg CURLMsg; - -/* Based on poll(2) structure and values. - * We don't use pollfd and POLL* constants explicitly - * to cover platforms without poll(). */ -#define CURL_WAIT_POLLIN 0x0001 -#define CURL_WAIT_POLLPRI 0x0002 -#define CURL_WAIT_POLLOUT 0x0004 - -struct curl_waitfd { - curl_socket_t fd; - short events; - short revents; /* not supported yet */ -}; - -/* - * Name: curl_multi_init() - * - * Desc: inititalize multi-style curl usage - * - * Returns: a new CURLM handle to use in all 'curl_multi' functions. - */ -CURL_EXTERN CURLM *curl_multi_init(void); - -/* - * Name: curl_multi_add_handle() - * - * Desc: add a standard curl handle to the multi stack - * - * Returns: CURLMcode type, general multi error code. - */ -CURL_EXTERN CURLMcode curl_multi_add_handle(CURLM *multi_handle, - CURL *curl_handle); - - /* - * Name: curl_multi_remove_handle() - * - * Desc: removes a curl handle from the multi stack again - * - * Returns: CURLMcode type, general multi error code. - */ -CURL_EXTERN CURLMcode curl_multi_remove_handle(CURLM *multi_handle, - CURL *curl_handle); - - /* - * Name: curl_multi_fdset() - * - * Desc: Ask curl for its fd_set sets. The app can use these to select() or - * poll() on. We want curl_multi_perform() called as soon as one of - * them are ready. - * - * Returns: CURLMcode type, general multi error code. - */ -CURL_EXTERN CURLMcode curl_multi_fdset(CURLM *multi_handle, - fd_set *read_fd_set, - fd_set *write_fd_set, - fd_set *exc_fd_set, - int *max_fd); - -/* - * Name: curl_multi_wait() - * - * Desc: Poll on all fds within a CURLM set as well as any - * additional fds passed to the function. - * - * Returns: CURLMcode type, general multi error code. - */ -CURL_EXTERN CURLMcode curl_multi_wait(CURLM *multi_handle, - struct curl_waitfd extra_fds[], - unsigned int extra_nfds, - int timeout_ms, - int *ret); - - /* - * Name: curl_multi_perform() - * - * Desc: When the app thinks there's data available for curl it calls this - * function to read/write whatever there is right now. This returns - * as soon as the reads and writes are done. This function does not - * require that there actually is data available for reading or that - * data can be written, it can be called just in case. It returns - * the number of handles that still transfer data in the second - * argument's integer-pointer. - * - * Returns: CURLMcode type, general multi error code. *NOTE* that this only - * returns errors etc regarding the whole multi stack. There might - * still have occurred problems on invidual transfers even when this - * returns OK. - */ -CURL_EXTERN CURLMcode curl_multi_perform(CURLM *multi_handle, - int *running_handles); - - /* - * Name: curl_multi_cleanup() - * - * Desc: Cleans up and removes a whole multi stack. It does not free or - * touch any individual easy handles in any way. We need to define - * in what state those handles will be if this function is called - * in the middle of a transfer. - * - * Returns: CURLMcode type, general multi error code. - */ -CURL_EXTERN CURLMcode curl_multi_cleanup(CURLM *multi_handle); - -/* - * Name: curl_multi_info_read() - * - * Desc: Ask the multi handle if there's any messages/informationals from - * the individual transfers. Messages include informationals such as - * error code from the transfer or just the fact that a transfer is - * completed. More details on these should be written down as well. - * - * Repeated calls to this function will return a new struct each - * time, until a special "end of msgs" struct is returned as a signal - * that there is no more to get at this point. - * - * The data the returned pointer points to will not survive calling - * curl_multi_cleanup(). - * - * The 'CURLMsg' struct is meant to be very simple and only contain - * very basic informations. If more involved information is wanted, - * we will provide the particular "transfer handle" in that struct - * and that should/could/would be used in subsequent - * curl_easy_getinfo() calls (or similar). The point being that we - * must never expose complex structs to applications, as then we'll - * undoubtably get backwards compatibility problems in the future. - * - * Returns: A pointer to a filled-in struct, or NULL if it failed or ran out - * of structs. It also writes the number of messages left in the - * queue (after this read) in the integer the second argument points - * to. - */ -CURL_EXTERN CURLMsg *curl_multi_info_read(CURLM *multi_handle, - int *msgs_in_queue); - -/* - * Name: curl_multi_strerror() - * - * Desc: The curl_multi_strerror function may be used to turn a CURLMcode - * value into the equivalent human readable error string. This is - * useful for printing meaningful error messages. - * - * Returns: A pointer to a zero-terminated error message. - */ -CURL_EXTERN const char *curl_multi_strerror(CURLMcode); - -/* - * Name: curl_multi_socket() and - * curl_multi_socket_all() - * - * Desc: An alternative version of curl_multi_perform() that allows the - * application to pass in one of the file descriptors that have been - * detected to have "action" on them and let libcurl perform. - * See man page for details. - */ -#define CURL_POLL_NONE 0 -#define CURL_POLL_IN 1 -#define CURL_POLL_OUT 2 -#define CURL_POLL_INOUT 3 -#define CURL_POLL_REMOVE 4 - -#define CURL_SOCKET_TIMEOUT CURL_SOCKET_BAD - -#define CURL_CSELECT_IN 0x01 -#define CURL_CSELECT_OUT 0x02 -#define CURL_CSELECT_ERR 0x04 - -typedef int (*curl_socket_callback)(CURL *easy, /* easy handle */ - curl_socket_t s, /* socket */ - int what, /* see above */ - void *userp, /* private callback - pointer */ - void *socketp); /* private socket - pointer */ -/* - * Name: curl_multi_timer_callback - * - * Desc: Called by libcurl whenever the library detects a change in the - * maximum number of milliseconds the app is allowed to wait before - * curl_multi_socket() or curl_multi_perform() must be called - * (to allow libcurl's timed events to take place). - * - * Returns: The callback should return zero. - */ -typedef int (*curl_multi_timer_callback)(CURLM *multi, /* multi handle */ - long timeout_ms, /* see above */ - void *userp); /* private callback - pointer */ - -CURL_EXTERN CURLMcode curl_multi_socket(CURLM *multi_handle, curl_socket_t s, - int *running_handles); - -CURL_EXTERN CURLMcode curl_multi_socket_action(CURLM *multi_handle, - curl_socket_t s, - int ev_bitmask, - int *running_handles); - -CURL_EXTERN CURLMcode curl_multi_socket_all(CURLM *multi_handle, - int *running_handles); - -#ifndef CURL_ALLOW_OLD_MULTI_SOCKET -/* This macro below was added in 7.16.3 to push users who recompile to use - the new curl_multi_socket_action() instead of the old curl_multi_socket() -*/ -#define curl_multi_socket(x,y,z) curl_multi_socket_action(x,y,0,z) -#endif - -/* - * Name: curl_multi_timeout() - * - * Desc: Returns the maximum number of milliseconds the app is allowed to - * wait before curl_multi_socket() or curl_multi_perform() must be - * called (to allow libcurl's timed events to take place). - * - * Returns: CURLM error code. - */ -CURL_EXTERN CURLMcode curl_multi_timeout(CURLM *multi_handle, - long *milliseconds); - -#undef CINIT /* re-using the same name as in curl.h */ - -#ifdef CURL_ISOCPP -#define CINIT(name,type,num) CURLMOPT_ ## name = CURLOPTTYPE_ ## type + num -#else -/* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */ -#define LONG CURLOPTTYPE_LONG -#define OBJECTPOINT CURLOPTTYPE_OBJECTPOINT -#define FUNCTIONPOINT CURLOPTTYPE_FUNCTIONPOINT -#define OFF_T CURLOPTTYPE_OFF_T -#define CINIT(name,type,number) CURLMOPT_/**/name = type + number -#endif - -typedef enum { - /* This is the socket callback function pointer */ - CINIT(SOCKETFUNCTION, FUNCTIONPOINT, 1), - - /* This is the argument passed to the socket callback */ - CINIT(SOCKETDATA, OBJECTPOINT, 2), - - /* set to 1 to enable pipelining for this multi handle */ - CINIT(PIPELINING, LONG, 3), - - /* This is the timer callback function pointer */ - CINIT(TIMERFUNCTION, FUNCTIONPOINT, 4), - - /* This is the argument passed to the timer callback */ - CINIT(TIMERDATA, OBJECTPOINT, 5), - - /* maximum number of entries in the connection cache */ - CINIT(MAXCONNECTS, LONG, 6), - - CURLMOPT_LASTENTRY /* the last unused */ -} CURLMoption; - - -/* - * Name: curl_multi_setopt() - * - * Desc: Sets options for the multi handle. - * - * Returns: CURLM error code. - */ -CURL_EXTERN CURLMcode curl_multi_setopt(CURLM *multi_handle, - CURLMoption option, ...); - - -/* - * Name: curl_multi_assign() - * - * Desc: This function sets an association in the multi handle between the - * given socket and a private pointer of the application. This is - * (only) useful for curl_multi_socket uses. - * - * Returns: CURLM error code. - */ -CURL_EXTERN CURLMcode curl_multi_assign(CURLM *multi_handle, - curl_socket_t sockfd, void *sockp); - -#ifdef __cplusplus -} /* end of extern "C" */ -#endif - -#endif diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/fontconfig/fcfreetype.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/fontconfig/fcfreetype.h deleted file mode 100644 index 753fdf9da8..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/fontconfig/fcfreetype.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * fontconfig/fontconfig/fcfreetype.h - * - * Copyright © 2001 Keith Packard - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of the author(s) not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. The authors make no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef _FCFREETYPE_H_ -#define _FCFREETYPE_H_ -#include -#include FT_FREETYPE_H - -#ifndef FcPublic -#define FcPublic -#endif - -_FCFUNCPROTOBEGIN - -FcPublic FT_UInt -FcFreeTypeCharIndex (FT_Face face, FcChar32 ucs4); - -FcPublic FcCharSet * -FcFreeTypeCharSetAndSpacing (FT_Face face, FcBlanks *blanks, int *spacing); - -FcPublic FcCharSet * -FcFreeTypeCharSet (FT_Face face, FcBlanks *blanks); - -FcPublic FcResult -FcPatternGetFTFace (const FcPattern *p, const char *object, int n, FT_Face *f); - -FcPublic FcBool -FcPatternAddFTFace (FcPattern *p, const char *object, const FT_Face f); - -FcPublic FcPattern * -FcFreeTypeQueryFace (const FT_Face face, - const FcChar8 *file, - int id, - FcBlanks *blanks); - -_FCFUNCPROTOEND - -#endif diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/fontconfig/fcprivate.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/fontconfig/fcprivate.h deleted file mode 100644 index 18b8c08ca7..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/fontconfig/fcprivate.h +++ /dev/null @@ -1,123 +0,0 @@ -/* - * fontconfig/fontconfig/fcprivate.h - * - * Copyright © 2001 Keith Packard - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of the author(s) not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. The authors make no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef _FCPRIVATE_H_ -#define _FCPRIVATE_H_ - -/* - * I tried this with functions that took va_list* arguments - * but portability concerns made me change these functions - * into macros (sigh). - */ - -#define FcPatternVapBuild(result, orig, va) \ -{ \ - FcPattern *__p__ = (orig); \ - const char *__o__; \ - FcValue __v__; \ - \ - if (!__p__) \ - { \ - __p__ = FcPatternCreate (); \ - if (!__p__) \ - goto _FcPatternVapBuild_bail0; \ - } \ - for (;;) \ - { \ - __o__ = va_arg (va, const char *); \ - if (!__o__) \ - break; \ - __v__.type = va_arg (va, FcType); \ - switch (__v__.type) { \ - case FcTypeVoid: \ - goto _FcPatternVapBuild_bail1; \ - case FcTypeInteger: \ - __v__.u.i = va_arg (va, int); \ - break; \ - case FcTypeDouble: \ - __v__.u.d = va_arg (va, double); \ - break; \ - case FcTypeString: \ - __v__.u.s = va_arg (va, const FcChar8 *); \ - break; \ - case FcTypeBool: \ - __v__.u.b = va_arg (va, FcBool); \ - break; \ - case FcTypeMatrix: \ - __v__.u.m = va_arg (va, const FcMatrix *); \ - break; \ - case FcTypeCharSet: \ - __v__.u.c = va_arg (va, const FcCharSet *); \ - break; \ - case FcTypeFTFace: \ - __v__.u.f = va_arg (va, FT_Face); \ - break; \ - case FcTypeLangSet: \ - __v__.u.l = va_arg (va, const FcLangSet *); \ - break; \ - } \ - if (!FcPatternAdd (__p__, __o__, __v__, FcTrue)) \ - goto _FcPatternVapBuild_bail1; \ - } \ - result = __p__; \ - goto _FcPatternVapBuild_return; \ - \ -_FcPatternVapBuild_bail1: \ - if (!orig) \ - FcPatternDestroy (__p__); \ -_FcPatternVapBuild_bail0: \ - result = (void*)0; \ - \ -_FcPatternVapBuild_return: \ - ; \ -} - - -#define FcObjectSetVapBuild(__ret__, __first__, __va__) \ -{ \ - FcObjectSet *__os__; \ - const char *__ob__; \ - \ - __ret__ = 0; \ - __os__ = FcObjectSetCreate (); \ - if (!__os__) \ - goto _FcObjectSetVapBuild_bail0; \ - __ob__ = __first__; \ - while (__ob__) \ - { \ - if (!FcObjectSetAdd (__os__, __ob__)) \ - goto _FcObjectSetVapBuild_bail1; \ - __ob__ = va_arg (__va__, const char *); \ - } \ - __ret__ = __os__; \ - \ -_FcObjectSetVapBuild_bail1: \ - if (!__ret__ && __os__) \ - FcObjectSetDestroy (__os__); \ -_FcObjectSetVapBuild_bail0: \ - ; \ -} - -#endif /* _FCPRIVATE_H_ */ - diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/fontconfig/fontconfig.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/fontconfig/fontconfig.h deleted file mode 100644 index 8936d83373..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/fontconfig/fontconfig.h +++ /dev/null @@ -1,974 +0,0 @@ -/* - * fontconfig/fontconfig/fontconfig.h - * - * Copyright © 2001 Keith Packard - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of the author(s) not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. The authors make no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef _FONTCONFIG_H_ -#define _FONTCONFIG_H_ - -#include -#include -#include - -#if defined(__GNUC__) && (__GNUC__ >= 4) -#define FC_ATTRIBUTE_SENTINEL(x) __attribute__((__sentinel__(0))) -#else -#define FC_ATTRIBUTE_SENTINEL(x) -#endif - -#ifndef FcPublic -#define FcPublic -#endif - -typedef unsigned char FcChar8; -typedef unsigned short FcChar16; -typedef unsigned int FcChar32; -typedef int FcBool; - -/* - * Current Fontconfig version number. This same number - * must appear in the fontconfig configure.in file. Yes, - * it'a a pain to synchronize version numbers like this. - */ - -#define FC_MAJOR 2 -#define FC_MINOR 9 -#define FC_REVISION 0 - -#define FC_VERSION ((FC_MAJOR * 10000) + (FC_MINOR * 100) + (FC_REVISION)) - -/* - * Current font cache file format version - * This is appended to the cache files so that multiple - * versions of the library will peacefully coexist - * - * Change this value whenever the disk format for the cache file - * changes in any non-compatible way. Try to avoid such changes as - * it means multiple copies of the font information. - */ - -#define FC_CACHE_VERSION "3" - -#define FcTrue 1 -#define FcFalse 0 - -#define FC_FAMILY "family" /* String */ -#define FC_STYLE "style" /* String */ -#define FC_SLANT "slant" /* Int */ -#define FC_WEIGHT "weight" /* Int */ -#define FC_SIZE "size" /* Double */ -#define FC_ASPECT "aspect" /* Double */ -#define FC_PIXEL_SIZE "pixelsize" /* Double */ -#define FC_SPACING "spacing" /* Int */ -#define FC_FOUNDRY "foundry" /* String */ -#define FC_ANTIALIAS "antialias" /* Bool (depends) */ -#define FC_HINTING "hinting" /* Bool (true) */ -#define FC_HINT_STYLE "hintstyle" /* Int */ -#define FC_VERTICAL_LAYOUT "verticallayout" /* Bool (false) */ -#define FC_AUTOHINT "autohint" /* Bool (false) */ -#define FC_GLOBAL_ADVANCE "globaladvance" /* Bool (true) */ -#define FC_WIDTH "width" /* Int */ -#define FC_FILE "file" /* String */ -#define FC_INDEX "index" /* Int */ -#define FC_FT_FACE "ftface" /* FT_Face */ -#define FC_RASTERIZER "rasterizer" /* String */ -#define FC_OUTLINE "outline" /* Bool */ -#define FC_SCALABLE "scalable" /* Bool */ -#define FC_SCALE "scale" /* double */ -#define FC_DPI "dpi" /* double */ -#define FC_RGBA "rgba" /* Int */ -#define FC_MINSPACE "minspace" /* Bool use minimum line spacing */ -#define FC_SOURCE "source" /* String (deprecated) */ -#define FC_CHARSET "charset" /* CharSet */ -#define FC_LANG "lang" /* String RFC 3066 langs */ -#define FC_FONTVERSION "fontversion" /* Int from 'head' table */ -#define FC_FULLNAME "fullname" /* String */ -#define FC_FAMILYLANG "familylang" /* String RFC 3066 langs */ -#define FC_STYLELANG "stylelang" /* String RFC 3066 langs */ -#define FC_FULLNAMELANG "fullnamelang" /* String RFC 3066 langs */ -#define FC_CAPABILITY "capability" /* String */ -#define FC_FONTFORMAT "fontformat" /* String */ -#define FC_EMBOLDEN "embolden" /* Bool - true if emboldening needed*/ -#define FC_EMBEDDED_BITMAP "embeddedbitmap" /* Bool - true to enable embedded bitmaps */ -#define FC_DECORATIVE "decorative" /* Bool - true if style is a decorative variant */ -#define FC_LCD_FILTER "lcdfilter" /* Int */ - -#define FC_CACHE_SUFFIX ".cache-"FC_CACHE_VERSION -#define FC_DIR_CACHE_FILE "fonts.cache-"FC_CACHE_VERSION -#define FC_USER_CACHE_FILE ".fonts.cache-"FC_CACHE_VERSION - -/* Adjust outline rasterizer */ -#define FC_CHAR_WIDTH "charwidth" /* Int */ -#define FC_CHAR_HEIGHT "charheight"/* Int */ -#define FC_MATRIX "matrix" /* FcMatrix */ - -#define FC_WEIGHT_THIN 0 -#define FC_WEIGHT_EXTRALIGHT 40 -#define FC_WEIGHT_ULTRALIGHT FC_WEIGHT_EXTRALIGHT -#define FC_WEIGHT_LIGHT 50 -#define FC_WEIGHT_BOOK 75 -#define FC_WEIGHT_REGULAR 80 -#define FC_WEIGHT_NORMAL FC_WEIGHT_REGULAR -#define FC_WEIGHT_MEDIUM 100 -#define FC_WEIGHT_DEMIBOLD 180 -#define FC_WEIGHT_SEMIBOLD FC_WEIGHT_DEMIBOLD -#define FC_WEIGHT_BOLD 200 -#define FC_WEIGHT_EXTRABOLD 205 -#define FC_WEIGHT_ULTRABOLD FC_WEIGHT_EXTRABOLD -#define FC_WEIGHT_BLACK 210 -#define FC_WEIGHT_HEAVY FC_WEIGHT_BLACK -#define FC_WEIGHT_EXTRABLACK 215 -#define FC_WEIGHT_ULTRABLACK FC_WEIGHT_EXTRABLACK - -#define FC_SLANT_ROMAN 0 -#define FC_SLANT_ITALIC 100 -#define FC_SLANT_OBLIQUE 110 - -#define FC_WIDTH_ULTRACONDENSED 50 -#define FC_WIDTH_EXTRACONDENSED 63 -#define FC_WIDTH_CONDENSED 75 -#define FC_WIDTH_SEMICONDENSED 87 -#define FC_WIDTH_NORMAL 100 -#define FC_WIDTH_SEMIEXPANDED 113 -#define FC_WIDTH_EXPANDED 125 -#define FC_WIDTH_EXTRAEXPANDED 150 -#define FC_WIDTH_ULTRAEXPANDED 200 - -#define FC_PROPORTIONAL 0 -#define FC_DUAL 90 -#define FC_MONO 100 -#define FC_CHARCELL 110 - -/* sub-pixel order */ -#define FC_RGBA_UNKNOWN 0 -#define FC_RGBA_RGB 1 -#define FC_RGBA_BGR 2 -#define FC_RGBA_VRGB 3 -#define FC_RGBA_VBGR 4 -#define FC_RGBA_NONE 5 - -/* hinting style */ -#define FC_HINT_NONE 0 -#define FC_HINT_SLIGHT 1 -#define FC_HINT_MEDIUM 2 -#define FC_HINT_FULL 3 - -/* LCD filter */ -#define FC_LCD_NONE 0 -#define FC_LCD_DEFAULT 1 -#define FC_LCD_LIGHT 2 -#define FC_LCD_LEGACY 3 - -typedef enum _FcType { - FcTypeVoid, - FcTypeInteger, - FcTypeDouble, - FcTypeString, - FcTypeBool, - FcTypeMatrix, - FcTypeCharSet, - FcTypeFTFace, - FcTypeLangSet -} FcType; - -typedef struct _FcMatrix { - double xx, xy, yx, yy; -} FcMatrix; - -#define FcMatrixInit(m) ((m)->xx = (m)->yy = 1, \ - (m)->xy = (m)->yx = 0) - -/* - * A data structure to represent the available glyphs in a font. - * This is represented as a sparse boolean btree. - */ - -typedef struct _FcCharSet FcCharSet; - -typedef struct _FcObjectType { - const char *object; - FcType type; -} FcObjectType; - -typedef struct _FcConstant { - const FcChar8 *name; - const char *object; - int value; -} FcConstant; - -typedef enum _FcResult { - FcResultMatch, FcResultNoMatch, FcResultTypeMismatch, FcResultNoId, - FcResultOutOfMemory -} FcResult; - -typedef struct _FcPattern FcPattern; - -typedef struct _FcLangSet FcLangSet; - -typedef struct _FcValue { - FcType type; - union { - const FcChar8 *s; - int i; - FcBool b; - double d; - const FcMatrix *m; - const FcCharSet *c; - void *f; - const FcLangSet *l; - } u; -} FcValue; - -typedef struct _FcFontSet { - int nfont; - int sfont; - FcPattern **fonts; -} FcFontSet; - -typedef struct _FcObjectSet { - int nobject; - int sobject; - const char **objects; -} FcObjectSet; - -typedef enum _FcMatchKind { - FcMatchPattern, FcMatchFont, FcMatchScan -} FcMatchKind; - -typedef enum _FcLangResult { - FcLangEqual = 0, - FcLangDifferentCountry = 1, - FcLangDifferentTerritory = 1, - FcLangDifferentLang = 2 -} FcLangResult; - -typedef enum _FcSetName { - FcSetSystem = 0, - FcSetApplication = 1 -} FcSetName; - -typedef struct _FcAtomic FcAtomic; - -#if defined(__cplusplus) || defined(c_plusplus) /* for C++ V2.0 */ -#define _FCFUNCPROTOBEGIN extern "C" { /* do not leave open across includes */ -#define _FCFUNCPROTOEND } -#else -#define _FCFUNCPROTOBEGIN -#define _FCFUNCPROTOEND -#endif - -typedef enum { FcEndianBig, FcEndianLittle } FcEndian; - -typedef struct _FcConfig FcConfig; - -typedef struct _FcGlobalCache FcFileCache; - -typedef struct _FcBlanks FcBlanks; - -typedef struct _FcStrList FcStrList; - -typedef struct _FcStrSet FcStrSet; - -typedef struct _FcCache FcCache; - -_FCFUNCPROTOBEGIN - -/* fcblanks.c */ -FcPublic FcBlanks * -FcBlanksCreate (void); - -FcPublic void -FcBlanksDestroy (FcBlanks *b); - -FcPublic FcBool -FcBlanksAdd (FcBlanks *b, FcChar32 ucs4); - -FcPublic FcBool -FcBlanksIsMember (FcBlanks *b, FcChar32 ucs4); - -/* fccache.c */ - -FcPublic const FcChar8 * -FcCacheDir(const FcCache *c); - -FcPublic FcFontSet * -FcCacheCopySet(const FcCache *c); - -FcPublic const FcChar8 * -FcCacheSubdir (const FcCache *c, int i); - -FcPublic int -FcCacheNumSubdir (const FcCache *c); - -FcPublic int -FcCacheNumFont (const FcCache *c); - -FcPublic FcBool -FcDirCacheUnlink (const FcChar8 *dir, FcConfig *config); - -FcPublic FcBool -FcDirCacheValid (const FcChar8 *cache_file); - -/* fccfg.c */ -FcPublic FcChar8 * -FcConfigHome (void); - -FcPublic FcBool -FcConfigEnableHome (FcBool enable); - -FcPublic FcChar8 * -FcConfigFilename (const FcChar8 *url); - -FcPublic FcConfig * -FcConfigCreate (void); - -FcPublic FcConfig * -FcConfigReference (FcConfig *config); - -FcPublic void -FcConfigDestroy (FcConfig *config); - -FcPublic FcBool -FcConfigSetCurrent (FcConfig *config); - -FcPublic FcConfig * -FcConfigGetCurrent (void); - -FcPublic FcBool -FcConfigUptoDate (FcConfig *config); - -FcPublic FcBool -FcConfigBuildFonts (FcConfig *config); - -FcPublic FcStrList * -FcConfigGetFontDirs (FcConfig *config); - -FcPublic FcStrList * -FcConfigGetConfigDirs (FcConfig *config); - -FcPublic FcStrList * -FcConfigGetConfigFiles (FcConfig *config); - -FcPublic FcChar8 * -FcConfigGetCache (FcConfig *config); - -FcPublic FcBlanks * -FcConfigGetBlanks (FcConfig *config); - -FcPublic FcStrList * -FcConfigGetCacheDirs (FcConfig *config); - -FcPublic int -FcConfigGetRescanInterval (FcConfig *config); - -FcPublic FcBool -FcConfigSetRescanInterval (FcConfig *config, int rescanInterval); - -FcPublic FcFontSet * -FcConfigGetFonts (FcConfig *config, - FcSetName set); - -FcPublic FcBool -FcConfigAppFontAddFile (FcConfig *config, - const FcChar8 *file); - -FcPublic FcBool -FcConfigAppFontAddDir (FcConfig *config, - const FcChar8 *dir); - -FcPublic void -FcConfigAppFontClear (FcConfig *config); - -FcPublic FcBool -FcConfigSubstituteWithPat (FcConfig *config, - FcPattern *p, - FcPattern *p_pat, - FcMatchKind kind); - -FcPublic FcBool -FcConfigSubstitute (FcConfig *config, - FcPattern *p, - FcMatchKind kind); - -/* fccharset.c */ -FcPublic FcCharSet* -FcCharSetCreate (void); - -/* deprecated alias for FcCharSetCreate */ -FcPublic FcCharSet * -FcCharSetNew (void); - -FcPublic void -FcCharSetDestroy (FcCharSet *fcs); - -FcPublic FcBool -FcCharSetAddChar (FcCharSet *fcs, FcChar32 ucs4); - -FcPublic FcBool -FcCharSetDelChar (FcCharSet *fcs, FcChar32 ucs4); - -FcPublic FcCharSet* -FcCharSetCopy (FcCharSet *src); - -FcPublic FcBool -FcCharSetEqual (const FcCharSet *a, const FcCharSet *b); - -FcPublic FcCharSet* -FcCharSetIntersect (const FcCharSet *a, const FcCharSet *b); - -FcPublic FcCharSet* -FcCharSetUnion (const FcCharSet *a, const FcCharSet *b); - -FcPublic FcCharSet* -FcCharSetSubtract (const FcCharSet *a, const FcCharSet *b); - -FcPublic FcBool -FcCharSetMerge (FcCharSet *a, const FcCharSet *b, FcBool *changed); - -FcPublic FcBool -FcCharSetHasChar (const FcCharSet *fcs, FcChar32 ucs4); - -FcPublic FcChar32 -FcCharSetCount (const FcCharSet *a); - -FcPublic FcChar32 -FcCharSetIntersectCount (const FcCharSet *a, const FcCharSet *b); - -FcPublic FcChar32 -FcCharSetSubtractCount (const FcCharSet *a, const FcCharSet *b); - -FcPublic FcBool -FcCharSetIsSubset (const FcCharSet *a, const FcCharSet *b); - -#define FC_CHARSET_MAP_SIZE (256/32) -#define FC_CHARSET_DONE ((FcChar32) -1) - -FcPublic FcChar32 -FcCharSetFirstPage (const FcCharSet *a, - FcChar32 map[FC_CHARSET_MAP_SIZE], - FcChar32 *next); - -FcPublic FcChar32 -FcCharSetNextPage (const FcCharSet *a, - FcChar32 map[FC_CHARSET_MAP_SIZE], - FcChar32 *next); - -/* - * old coverage API, rather hard to use correctly - */ - -FcPublic FcChar32 -FcCharSetCoverage (const FcCharSet *a, FcChar32 page, FcChar32 *result); - -/* fcdbg.c */ -FcPublic void -FcValuePrint (const FcValue v); - -FcPublic void -FcPatternPrint (const FcPattern *p); - -FcPublic void -FcFontSetPrint (const FcFontSet *s); - -/* fcdefault.c */ -FcPublic void -FcDefaultSubstitute (FcPattern *pattern); - -/* fcdir.c */ -FcPublic FcBool -FcFileIsDir (const FcChar8 *file); - -FcPublic FcBool -FcFileScan (FcFontSet *set, - FcStrSet *dirs, - FcFileCache *cache, - FcBlanks *blanks, - const FcChar8 *file, - FcBool force); - -FcPublic FcBool -FcDirScan (FcFontSet *set, - FcStrSet *dirs, - FcFileCache *cache, - FcBlanks *blanks, - const FcChar8 *dir, - FcBool force); - -FcPublic FcBool -FcDirSave (FcFontSet *set, FcStrSet *dirs, const FcChar8 *dir); - -FcPublic FcCache * -FcDirCacheLoad (const FcChar8 *dir, FcConfig *config, FcChar8 **cache_file); - -FcPublic FcCache * -FcDirCacheRead (const FcChar8 *dir, FcBool force, FcConfig *config); - -FcPublic FcCache * -FcDirCacheLoadFile (const FcChar8 *cache_file, struct stat *file_stat); - -FcPublic void -FcDirCacheUnload (FcCache *cache); - -/* fcfreetype.c */ -FcPublic FcPattern * -FcFreeTypeQuery (const FcChar8 *file, int id, FcBlanks *blanks, int *count); - -/* fcfs.c */ - -FcPublic FcFontSet * -FcFontSetCreate (void); - -FcPublic void -FcFontSetDestroy (FcFontSet *s); - -FcPublic FcBool -FcFontSetAdd (FcFontSet *s, FcPattern *font); - -/* fcinit.c */ -FcPublic FcConfig * -FcInitLoadConfig (void); - -FcPublic FcConfig * -FcInitLoadConfigAndFonts (void); - -FcPublic FcBool -FcInit (void); - -FcPublic void -FcFini (void); - -FcPublic int -FcGetVersion (void); - -FcPublic FcBool -FcInitReinitialize (void); - -FcPublic FcBool -FcInitBringUptoDate (void); - -/* fclang.c */ -FcPublic FcStrSet * -FcGetLangs (void); - -FcPublic const FcCharSet * -FcLangGetCharSet (const FcChar8 *lang); - -FcPublic FcLangSet* -FcLangSetCreate (void); - -FcPublic void -FcLangSetDestroy (FcLangSet *ls); - -FcPublic FcLangSet* -FcLangSetCopy (const FcLangSet *ls); - -FcPublic FcBool -FcLangSetAdd (FcLangSet *ls, const FcChar8 *lang); - -FcPublic FcBool -FcLangSetDel (FcLangSet *ls, const FcChar8 *lang); - -FcPublic FcLangResult -FcLangSetHasLang (const FcLangSet *ls, const FcChar8 *lang); - -FcPublic FcLangResult -FcLangSetCompare (const FcLangSet *lsa, const FcLangSet *lsb); - -FcPublic FcBool -FcLangSetContains (const FcLangSet *lsa, const FcLangSet *lsb); - -FcPublic FcBool -FcLangSetEqual (const FcLangSet *lsa, const FcLangSet *lsb); - -FcPublic FcChar32 -FcLangSetHash (const FcLangSet *ls); - -FcPublic FcStrSet * -FcLangSetGetLangs (const FcLangSet *ls); - -FcPublic FcLangSet * -FcLangSetUnion (const FcLangSet *a, const FcLangSet *b); - -FcPublic FcLangSet * -FcLangSetSubtract (const FcLangSet *a, const FcLangSet *b); - -/* fclist.c */ -FcPublic FcObjectSet * -FcObjectSetCreate (void); - -FcPublic FcBool -FcObjectSetAdd (FcObjectSet *os, const char *object); - -FcPublic void -FcObjectSetDestroy (FcObjectSet *os); - -FcPublic FcObjectSet * -FcObjectSetVaBuild (const char *first, va_list va); - -FcPublic FcObjectSet * -FcObjectSetBuild (const char *first, ...) FC_ATTRIBUTE_SENTINEL(0); - -FcPublic FcFontSet * -FcFontSetList (FcConfig *config, - FcFontSet **sets, - int nsets, - FcPattern *p, - FcObjectSet *os); - -FcPublic FcFontSet * -FcFontList (FcConfig *config, - FcPattern *p, - FcObjectSet *os); - -/* fcatomic.c */ - -FcPublic FcAtomic * -FcAtomicCreate (const FcChar8 *file); - -FcPublic FcBool -FcAtomicLock (FcAtomic *atomic); - -FcPublic FcChar8 * -FcAtomicNewFile (FcAtomic *atomic); - -FcPublic FcChar8 * -FcAtomicOrigFile (FcAtomic *atomic); - -FcPublic FcBool -FcAtomicReplaceOrig (FcAtomic *atomic); - -FcPublic void -FcAtomicDeleteNew (FcAtomic *atomic); - -FcPublic void -FcAtomicUnlock (FcAtomic *atomic); - -FcPublic void -FcAtomicDestroy (FcAtomic *atomic); - -/* fcmatch.c */ -FcPublic FcPattern * -FcFontSetMatch (FcConfig *config, - FcFontSet **sets, - int nsets, - FcPattern *p, - FcResult *result); - -FcPublic FcPattern * -FcFontMatch (FcConfig *config, - FcPattern *p, - FcResult *result); - -FcPublic FcPattern * -FcFontRenderPrepare (FcConfig *config, - FcPattern *pat, - FcPattern *font); - -FcPublic FcFontSet * -FcFontSetSort (FcConfig *config, - FcFontSet **sets, - int nsets, - FcPattern *p, - FcBool trim, - FcCharSet **csp, - FcResult *result); - -FcPublic FcFontSet * -FcFontSort (FcConfig *config, - FcPattern *p, - FcBool trim, - FcCharSet **csp, - FcResult *result); - -FcPublic void -FcFontSetSortDestroy (FcFontSet *fs); - -/* fcmatrix.c */ -FcPublic FcMatrix * -FcMatrixCopy (const FcMatrix *mat); - -FcPublic FcBool -FcMatrixEqual (const FcMatrix *mat1, const FcMatrix *mat2); - -FcPublic void -FcMatrixMultiply (FcMatrix *result, const FcMatrix *a, const FcMatrix *b); - -FcPublic void -FcMatrixRotate (FcMatrix *m, double c, double s); - -FcPublic void -FcMatrixScale (FcMatrix *m, double sx, double sy); - -FcPublic void -FcMatrixShear (FcMatrix *m, double sh, double sv); - -/* fcname.c */ - -FcPublic FcBool -FcNameRegisterObjectTypes (const FcObjectType *types, int ntype); - -FcPublic FcBool -FcNameUnregisterObjectTypes (const FcObjectType *types, int ntype); - -FcPublic const FcObjectType * -FcNameGetObjectType (const char *object); - -FcPublic FcBool -FcNameRegisterConstants (const FcConstant *consts, int nconsts); - -FcPublic FcBool -FcNameUnregisterConstants (const FcConstant *consts, int nconsts); - -FcPublic const FcConstant * -FcNameGetConstant (const FcChar8 *string); - -FcPublic FcBool -FcNameConstant (const FcChar8 *string, int *result); - -FcPublic FcPattern * -FcNameParse (const FcChar8 *name); - -FcPublic FcChar8 * -FcNameUnparse (FcPattern *pat); - -/* fcpat.c */ -FcPublic FcPattern * -FcPatternCreate (void); - -FcPublic FcPattern * -FcPatternDuplicate (const FcPattern *p); - -FcPublic void -FcPatternReference (FcPattern *p); - -FcPublic FcPattern * -FcPatternFilter (FcPattern *p, const FcObjectSet *os); - -FcPublic void -FcValueDestroy (FcValue v); - -FcPublic FcBool -FcValueEqual (FcValue va, FcValue vb); - -FcPublic FcValue -FcValueSave (FcValue v); - -FcPublic void -FcPatternDestroy (FcPattern *p); - -FcPublic FcBool -FcPatternEqual (const FcPattern *pa, const FcPattern *pb); - -FcPublic FcBool -FcPatternEqualSubset (const FcPattern *pa, const FcPattern *pb, const FcObjectSet *os); - -FcPublic FcChar32 -FcPatternHash (const FcPattern *p); - -FcPublic FcBool -FcPatternAdd (FcPattern *p, const char *object, FcValue value, FcBool append); - -FcPublic FcBool -FcPatternAddWeak (FcPattern *p, const char *object, FcValue value, FcBool append); - -FcPublic FcResult -FcPatternGet (const FcPattern *p, const char *object, int id, FcValue *v); - -FcPublic FcBool -FcPatternDel (FcPattern *p, const char *object); - -FcPublic FcBool -FcPatternRemove (FcPattern *p, const char *object, int id); - -FcPublic FcBool -FcPatternAddInteger (FcPattern *p, const char *object, int i); - -FcPublic FcBool -FcPatternAddDouble (FcPattern *p, const char *object, double d); - -FcPublic FcBool -FcPatternAddString (FcPattern *p, const char *object, const FcChar8 *s); - -FcPublic FcBool -FcPatternAddMatrix (FcPattern *p, const char *object, const FcMatrix *s); - -FcPublic FcBool -FcPatternAddCharSet (FcPattern *p, const char *object, const FcCharSet *c); - -FcPublic FcBool -FcPatternAddBool (FcPattern *p, const char *object, FcBool b); - -FcPublic FcBool -FcPatternAddLangSet (FcPattern *p, const char *object, const FcLangSet *ls); - -FcPublic FcResult -FcPatternGetInteger (const FcPattern *p, const char *object, int n, int *i); - -FcPublic FcResult -FcPatternGetDouble (const FcPattern *p, const char *object, int n, double *d); - -FcPublic FcResult -FcPatternGetString (const FcPattern *p, const char *object, int n, FcChar8 ** s); - -FcPublic FcResult -FcPatternGetMatrix (const FcPattern *p, const char *object, int n, FcMatrix **s); - -FcPublic FcResult -FcPatternGetCharSet (const FcPattern *p, const char *object, int n, FcCharSet **c); - -FcPublic FcResult -FcPatternGetBool (const FcPattern *p, const char *object, int n, FcBool *b); - -FcPublic FcResult -FcPatternGetLangSet (const FcPattern *p, const char *object, int n, FcLangSet **ls); - -FcPublic FcPattern * -FcPatternVaBuild (FcPattern *p, va_list va); - -FcPublic FcPattern * -FcPatternBuild (FcPattern *p, ...) FC_ATTRIBUTE_SENTINEL(0); - -FcPublic FcChar8 * -FcPatternFormat (FcPattern *pat, const FcChar8 *format); - -/* fcstr.c */ - -FcPublic FcChar8 * -FcStrCopy (const FcChar8 *s); - -FcPublic FcChar8 * -FcStrCopyFilename (const FcChar8 *s); - -FcPublic FcChar8 * -FcStrPlus (const FcChar8 *s1, const FcChar8 *s2); - -FcPublic void -FcStrFree (FcChar8 *s); - -/* These are ASCII only, suitable only for pattern element names */ -#define FcIsUpper(c) ((0101 <= (c) && (c) <= 0132)) -#define FcIsLower(c) ((0141 <= (c) && (c) <= 0172)) -#define FcToLower(c) (FcIsUpper(c) ? (c) - 0101 + 0141 : (c)) - -FcPublic FcChar8 * -FcStrDowncase (const FcChar8 *s); - -FcPublic int -FcStrCmpIgnoreCase (const FcChar8 *s1, const FcChar8 *s2); - -FcPublic int -FcStrCmp (const FcChar8 *s1, const FcChar8 *s2); - -FcPublic const FcChar8 * -FcStrStrIgnoreCase (const FcChar8 *s1, const FcChar8 *s2); - -FcPublic const FcChar8 * -FcStrStr (const FcChar8 *s1, const FcChar8 *s2); - -FcPublic int -FcUtf8ToUcs4 (const FcChar8 *src_orig, - FcChar32 *dst, - int len); - -FcPublic FcBool -FcUtf8Len (const FcChar8 *string, - int len, - int *nchar, - int *wchar); - -#define FC_UTF8_MAX_LEN 6 - -FcPublic int -FcUcs4ToUtf8 (FcChar32 ucs4, - FcChar8 dest[FC_UTF8_MAX_LEN]); - -FcPublic int -FcUtf16ToUcs4 (const FcChar8 *src_orig, - FcEndian endian, - FcChar32 *dst, - int len); /* in bytes */ - -FcPublic FcBool -FcUtf16Len (const FcChar8 *string, - FcEndian endian, - int len, /* in bytes */ - int *nchar, - int *wchar); - -FcPublic FcChar8 * -FcStrDirname (const FcChar8 *file); - -FcPublic FcChar8 * -FcStrBasename (const FcChar8 *file); - -FcPublic FcStrSet * -FcStrSetCreate (void); - -FcPublic FcBool -FcStrSetMember (FcStrSet *set, const FcChar8 *s); - -FcPublic FcBool -FcStrSetEqual (FcStrSet *sa, FcStrSet *sb); - -FcPublic FcBool -FcStrSetAdd (FcStrSet *set, const FcChar8 *s); - -FcPublic FcBool -FcStrSetAddFilename (FcStrSet *set, const FcChar8 *s); - -FcPublic FcBool -FcStrSetDel (FcStrSet *set, const FcChar8 *s); - -FcPublic void -FcStrSetDestroy (FcStrSet *set); - -FcPublic FcStrList * -FcStrListCreate (FcStrSet *set); - -FcPublic FcChar8 * -FcStrListNext (FcStrList *list); - -FcPublic void -FcStrListDone (FcStrList *list); - -/* fcxml.c */ -FcPublic FcBool -FcConfigParseAndLoad (FcConfig *config, const FcChar8 *file, FcBool complain); - -_FCFUNCPROTOEND - -#undef FC_ATTRIBUTE_SENTINEL - - -#ifndef _FCINT_H_ - -/* - * Deprecated functions are placed here to help users fix their code without - * digging through documentation - */ - -#define FcConfigGetRescanInverval FcConfigGetRescanInverval_REPLACE_BY_FcConfigGetRescanInterval -#define FcConfigSetRescanInverval FcConfigSetRescanInverval_REPLACE_BY_FcConfigSetRescanInterval - -#endif - -#endif /* _FONTCONFIG_H_ */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/config/ftconfig-32.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/config/ftconfig-32.h deleted file mode 100644 index 69aba71f86..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/config/ftconfig-32.h +++ /dev/null @@ -1,545 +0,0 @@ -/* ftconfig.h. Generated from ftconfig.in by configure. */ -/***************************************************************************/ -/* */ -/* ftconfig.in */ -/* */ -/* UNIX-specific configuration file (specification only). */ -/* */ -/* Copyright 1996-2004, 2006-2009, 2011 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - - /*************************************************************************/ - /* */ - /* This header file contains a number of macro definitions that are used */ - /* by the rest of the engine. Most of the macros here are automatically */ - /* determined at compile time, and you should not need to change it to */ - /* port FreeType, except to compile the library with a non-ANSI */ - /* compiler. */ - /* */ - /* Note however that if some specific modifications are needed, we */ - /* advise you to place a modified copy in your build directory. */ - /* */ - /* The build directory is usually `freetype/builds/', and */ - /* contains system-specific files that are always included first when */ - /* building the library. */ - /* */ - /*************************************************************************/ - - -#ifndef __FTCONFIG_H__ -#define __FTCONFIG_H__ - -#include -#include FT_CONFIG_OPTIONS_H -#include FT_CONFIG_STANDARD_LIBRARY_H - - -FT_BEGIN_HEADER - - - /*************************************************************************/ - /* */ - /* PLATFORM-SPECIFIC CONFIGURATION MACROS */ - /* */ - /* These macros can be toggled to suit a specific system. The current */ - /* ones are defaults used to compile FreeType in an ANSI C environment */ - /* (16bit compilers are also supported). Copy this file to your own */ - /* `freetype/builds/' directory, and edit it to port the engine. */ - /* */ - /*************************************************************************/ - - -#define HAVE_UNISTD_H 1 -#define HAVE_FCNTL_H 1 -#define HAVE_STDINT_H 1 - - - /* There are systems (like the Texas Instruments 'C54x) where a `char' */ - /* has 16 bits. ANSI C says that sizeof(char) is always 1. Since an */ - /* `int' has 16 bits also for this system, sizeof(int) gives 1 which */ - /* is probably unexpected. */ - /* */ - /* `CHAR_BIT' (defined in limits.h) gives the number of bits in a */ - /* `char' type. */ - -#ifndef FT_CHAR_BIT -#define FT_CHAR_BIT CHAR_BIT -#endif - - -/* #undef FT_USE_AUTOCONF_SIZEOF_TYPES */ -#ifdef FT_USE_AUTOCONF_SIZEOF_TYPES - -#define SIZEOF_INT 4 -#define SIZEOF_LONG 4 -#define FT_SIZEOF_INT SIZEOF_INT -#define FT_SIZEOF_LONG SIZEOF_LONG - -#else /* !FT_USE_AUTOCONF_SIZEOF_TYPES */ - - /* Following cpp computation of the bit length of int and long */ - /* is copied from default include/freetype/config/ftconfig.h. */ - /* If any improvement is required for this file, it should be */ - /* applied to the original header file for the builders that */ - /* does not use configure script. */ - - /* The size of an `int' type. */ -#if FT_UINT_MAX == 0xFFFFUL -#define FT_SIZEOF_INT (16 / FT_CHAR_BIT) -#elif FT_UINT_MAX == 0xFFFFFFFFUL -#define FT_SIZEOF_INT (32 / FT_CHAR_BIT) -#elif FT_UINT_MAX > 0xFFFFFFFFUL && FT_UINT_MAX == 0xFFFFFFFFFFFFFFFFUL -#define FT_SIZEOF_INT (64 / FT_CHAR_BIT) -#else -#error "Unsupported size of `int' type!" -#endif - - /* The size of a `long' type. A five-byte `long' (as used e.g. on the */ - /* DM642) is recognized but avoided. */ -#if FT_ULONG_MAX == 0xFFFFFFFFUL -#define FT_SIZEOF_LONG (32 / FT_CHAR_BIT) -#elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFUL -#define FT_SIZEOF_LONG (32 / FT_CHAR_BIT) -#elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFFFFFFFUL -#define FT_SIZEOF_LONG (64 / FT_CHAR_BIT) -#else -#error "Unsupported size of `long' type!" -#endif - -#endif /* !FT_USE_AUTOCONF_SIZEOF_TYPES */ - - - /* FT_UNUSED is a macro used to indicate that a given parameter is not */ - /* used -- this is only used to get rid of unpleasant compiler warnings */ -#ifndef FT_UNUSED -#define FT_UNUSED( arg ) ( (arg) = (arg) ) -#endif - - - /*************************************************************************/ - /* */ - /* AUTOMATIC CONFIGURATION MACROS */ - /* */ - /* These macros are computed from the ones defined above. Don't touch */ - /* their definition, unless you know precisely what you are doing. No */ - /* porter should need to mess with them. */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* Mac support */ - /* */ - /* This is the only necessary change, so it is defined here instead */ - /* providing a new configuration file. */ - /* */ -#if defined( __APPLE__ ) || ( defined( __MWERKS__ ) && defined( macintosh ) ) - /* no Carbon frameworks for 64bit 10.4.x */ - /* AvailabilityMacros.h is available since Mac OS X 10.2, */ - /* so guess the system version by maximum errno before inclusion */ -#include -#ifdef ECANCELED /* defined since 10.2 */ -#include "AvailabilityMacros.h" -#endif -#if defined( __LP64__ ) && \ - ( MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 ) -#undef FT_MACINTOSH -#endif - -#elif defined( __SC__ ) || defined( __MRC__ ) - /* Classic MacOS compilers */ -#include "ConditionalMacros.h" -#if TARGET_OS_MAC -#define FT_MACINTOSH 1 -#endif - -#endif - - - /* Fix compiler warning with sgi compiler */ -#if defined( __sgi ) && !defined( __GNUC__ ) -#if defined( _COMPILER_VERSION ) && ( _COMPILER_VERSION >= 730 ) -#pragma set woff 3505 -#endif -#endif - - - /*************************************************************************/ - /* */ - /* IntN types */ - /* */ - /* Used to guarantee the size of some specific integers. */ - /* */ - typedef signed short FT_Int16; - typedef unsigned short FT_UInt16; - -#if FT_SIZEOF_INT == 4 - - typedef signed int FT_Int32; - typedef unsigned int FT_UInt32; - -#elif FT_SIZEOF_LONG == 4 - - typedef signed long FT_Int32; - typedef unsigned long FT_UInt32; - -#else -#error "no 32bit type found -- please check your configuration files" -#endif - - - /* look up an integer type that is at least 32 bits */ -#if FT_SIZEOF_INT >= 4 - - typedef int FT_Fast; - typedef unsigned int FT_UFast; - -#elif FT_SIZEOF_LONG >= 4 - - typedef long FT_Fast; - typedef unsigned long FT_UFast; - -#endif - - - /* determine whether we have a 64-bit int type for platforms without */ - /* Autoconf */ -#if FT_SIZEOF_LONG == 8 - - /* FT_LONG64 must be defined if a 64-bit type is available */ -#define FT_LONG64 -#define FT_INT64 long - -#elif defined( _MSC_VER ) && _MSC_VER >= 900 /* Visual C++ (and Intel C++) */ - - /* this compiler provides the __int64 type */ -#define FT_LONG64 -#define FT_INT64 __int64 - -#elif defined( __BORLANDC__ ) /* Borland C++ */ - - /* XXXX: We should probably check the value of __BORLANDC__ in order */ - /* to test the compiler version. */ - - /* this compiler provides the __int64 type */ -#define FT_LONG64 -#define FT_INT64 __int64 - -#elif defined( __WATCOMC__ ) /* Watcom C++ */ - - /* Watcom doesn't provide 64-bit data types */ - -#elif defined( __MWERKS__ ) /* Metrowerks CodeWarrior */ - -#define FT_LONG64 -#define FT_INT64 long long int - -#elif defined( __GNUC__ ) - - /* GCC provides the `long long' type */ -#define FT_LONG64 -#define FT_INT64 long long int - -#endif /* FT_SIZEOF_LONG == 8 */ - - - /*************************************************************************/ - /* */ - /* A 64-bit data type will create compilation problems if you compile */ - /* in strict ANSI mode. To avoid them, we disable its use if __STDC__ */ - /* is defined. You can however ignore this rule by defining the */ - /* FT_CONFIG_OPTION_FORCE_INT64 configuration macro. */ - /* */ -#if defined( FT_LONG64 ) && !defined( FT_CONFIG_OPTION_FORCE_INT64 ) - -#ifdef __STDC__ - - /* Undefine the 64-bit macros in strict ANSI compilation mode. */ - /* Since `#undef' doesn't survive in configuration header files */ - /* we use the postprocessing facility of AC_CONFIG_HEADERS to */ - /* replace the leading `/' with `#'. */ -#undef FT_LONG64 -#undef FT_INT64 - -#endif /* __STDC__ */ - -#endif /* FT_LONG64 && !FT_CONFIG_OPTION_FORCE_INT64 */ - - -#define FT_BEGIN_STMNT do { -#define FT_END_STMNT } while ( 0 ) -#define FT_DUMMY_STMNT FT_BEGIN_STMNT FT_END_STMNT - - -#ifndef FT_CONFIG_OPTION_NO_ASSEMBLER - /* Provide assembler fragments for performance-critical functions. */ - /* These must be defined `static __inline__' with GCC. */ - -#if defined( __CC_ARM ) || defined( __ARMCC__ ) /* RVCT */ -#define FT_MULFIX_ASSEMBLER FT_MulFix_arm - - /* documentation is in freetype.h */ - - static __inline FT_Int32 - FT_MulFix_arm( FT_Int32 a, - FT_Int32 b ) - { - register FT_Int32 t, t2; - - - __asm - { - smull t2, t, b, a /* (lo=t2,hi=t) = a*b */ - mov a, t, asr #31 /* a = (hi >> 31) */ - add a, a, #0x8000 /* a += 0x8000 */ - adds t2, t2, a /* t2 += a */ - adc t, t, #0 /* t += carry */ - mov a, t2, lsr #16 /* a = t2 >> 16 */ - orr a, a, t, lsl #16 /* a |= t << 16 */ - } - return a; - } - -#endif /* __CC_ARM || __ARMCC__ */ - - -#ifdef __GNUC__ - -#if defined( __arm__ ) && !defined( __thumb__ ) && \ - !( defined( __CC_ARM ) || defined( __ARMCC__ ) ) -#define FT_MULFIX_ASSEMBLER FT_MulFix_arm - - /* documentation is in freetype.h */ - - static __inline__ FT_Int32 - FT_MulFix_arm( FT_Int32 a, - FT_Int32 b ) - { - register FT_Int32 t, t2; - - - __asm__ __volatile__ ( - "smull %1, %2, %4, %3\n\t" /* (lo=%1,hi=%2) = a*b */ - "mov %0, %2, asr #31\n\t" /* %0 = (hi >> 31) */ - "add %0, %0, #0x8000\n\t" /* %0 += 0x8000 */ - "adds %1, %1, %0\n\t" /* %1 += %0 */ - "adc %2, %2, #0\n\t" /* %2 += carry */ - "mov %0, %1, lsr #16\n\t" /* %0 = %1 >> 16 */ - "orr %0, %0, %2, lsl #16\n\t" /* %0 |= %2 << 16 */ - : "=r"(a), "=&r"(t2), "=&r"(t) - : "r"(a), "r"(b) ); - return a; - } - -#endif /* __arm__ && !__thumb__ && !( __CC_ARM || __ARMCC__ ) */ - -#if defined( __i386__ ) -#define FT_MULFIX_ASSEMBLER FT_MulFix_i386 - - /* documentation is in freetype.h */ - - static __inline__ FT_Int32 - FT_MulFix_i386( FT_Int32 a, - FT_Int32 b ) - { - register FT_Int32 result; - - - __asm__ __volatile__ ( - "imul %%edx\n" - "movl %%edx, %%ecx\n" - "sarl $31, %%ecx\n" - "addl $0x8000, %%ecx\n" - "addl %%ecx, %%eax\n" - "adcl $0, %%edx\n" - "shrl $16, %%eax\n" - "shll $16, %%edx\n" - "addl %%edx, %%eax\n" - : "=a"(result), "=d"(b) - : "a"(a), "d"(b) - : "%ecx", "cc" ); - return result; - } - -#endif /* i386 */ - -#endif /* __GNUC__ */ - - -#ifdef _MSC_VER /* Visual C++ */ - -#ifdef _M_IX86 - -#define FT_MULFIX_ASSEMBLER FT_MulFix_i386 - - /* documentation is in freetype.h */ - - static __inline FT_Int32 - FT_MulFix_i386( FT_Int32 a, - FT_Int32 b ) - { - register FT_Int32 result; - - __asm - { - mov eax, a - mov edx, b - imul edx - mov ecx, edx - sar ecx, 31 - add ecx, 8000h - add eax, ecx - adc edx, 0 - shr eax, 16 - shl edx, 16 - add eax, edx - mov result, eax - } - return result; - } - -#endif /* _M_IX86 */ - -#endif /* _MSC_VER */ - -#endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */ - - -#ifdef FT_CONFIG_OPTION_INLINE_MULFIX -#ifdef FT_MULFIX_ASSEMBLER -#define FT_MULFIX_INLINED FT_MULFIX_ASSEMBLER -#endif -#endif - - -#ifdef FT_MAKE_OPTION_SINGLE_OBJECT - -#define FT_LOCAL( x ) static x -#define FT_LOCAL_DEF( x ) static x - -#else - -#ifdef __cplusplus -#define FT_LOCAL( x ) extern "C" x -#define FT_LOCAL_DEF( x ) extern "C" x -#else -#define FT_LOCAL( x ) extern x -#define FT_LOCAL_DEF( x ) x -#endif - -#endif /* FT_MAKE_OPTION_SINGLE_OBJECT */ - - -#ifndef FT_BASE - -#ifdef __cplusplus -#define FT_BASE( x ) extern "C" x -#else -#define FT_BASE( x ) extern x -#endif - -#endif /* !FT_BASE */ - - -#ifndef FT_BASE_DEF - -#ifdef __cplusplus -#define FT_BASE_DEF( x ) x -#else -#define FT_BASE_DEF( x ) x -#endif - -#endif /* !FT_BASE_DEF */ - - -#ifndef FT_EXPORT - -#ifdef __cplusplus -#define FT_EXPORT( x ) extern "C" x -#else -#define FT_EXPORT( x ) extern x -#endif - -#endif /* !FT_EXPORT */ - - -#ifndef FT_EXPORT_DEF - -#ifdef __cplusplus -#define FT_EXPORT_DEF( x ) extern "C" x -#else -#define FT_EXPORT_DEF( x ) extern x -#endif - -#endif /* !FT_EXPORT_DEF */ - - -#ifndef FT_EXPORT_VAR - -#ifdef __cplusplus -#define FT_EXPORT_VAR( x ) extern "C" x -#else -#define FT_EXPORT_VAR( x ) extern x -#endif - -#endif /* !FT_EXPORT_VAR */ - - /* The following macros are needed to compile the library with a */ - /* C++ compiler and with 16bit compilers. */ - /* */ - - /* This is special. Within C++, you must specify `extern "C"' for */ - /* functions which are used via function pointers, and you also */ - /* must do that for structures which contain function pointers to */ - /* assure C linkage -- it's not possible to have (local) anonymous */ - /* functions which are accessed by (global) function pointers. */ - /* */ - /* */ - /* FT_CALLBACK_DEF is used to _define_ a callback function. */ - /* */ - /* FT_CALLBACK_TABLE is used to _declare_ a constant variable that */ - /* contains pointers to callback functions. */ - /* */ - /* FT_CALLBACK_TABLE_DEF is used to _define_ a constant variable */ - /* that contains pointers to callback functions. */ - /* */ - /* */ - /* Some 16bit compilers have to redefine these macros to insert */ - /* the infamous `_cdecl' or `__fastcall' declarations. */ - /* */ -#ifndef FT_CALLBACK_DEF -#ifdef __cplusplus -#define FT_CALLBACK_DEF( x ) extern "C" x -#else -#define FT_CALLBACK_DEF( x ) static x -#endif -#endif /* FT_CALLBACK_DEF */ - -#ifndef FT_CALLBACK_TABLE -#ifdef __cplusplus -#define FT_CALLBACK_TABLE extern "C" -#define FT_CALLBACK_TABLE_DEF extern "C" -#else -#define FT_CALLBACK_TABLE extern -#define FT_CALLBACK_TABLE_DEF /* nothing */ -#endif -#endif /* FT_CALLBACK_TABLE */ - - -FT_END_HEADER - - -#endif /* __FTCONFIG_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/config/ftconfig.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/config/ftconfig.h deleted file mode 100644 index 06f743e734..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/config/ftconfig.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef __FTCONFIG_H__MULTILIB -#define __FTCONFIG_H__MULTILIB - -#include - -#if __WORDSIZE == 32 -# include "ftconfig-32.h" -#elif __WORDSIZE == 64 -# include "ftconfig-64.h" -#else -# error "unexpected value for __WORDSIZE macro" -#endif - -#endif diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/config/ftheader.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/config/ftheader.h deleted file mode 100644 index 2a7b8c4e0d..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/config/ftheader.h +++ /dev/null @@ -1,793 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftheader.h */ -/* */ -/* Build macros of the FreeType 2 library. */ -/* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - -#ifndef __FT_HEADER_H__ -#define __FT_HEADER_H__ - - - /*@***********************************************************************/ - /* */ - /* */ - /* FT_BEGIN_HEADER */ - /* */ - /* */ - /* This macro is used in association with @FT_END_HEADER in header */ - /* files to ensure that the declarations within are properly */ - /* encapsulated in an `extern "C" { .. }' block when included from a */ - /* C++ compiler. */ - /* */ -#ifdef __cplusplus -#define FT_BEGIN_HEADER extern "C" { -#else -#define FT_BEGIN_HEADER /* nothing */ -#endif - - - /*@***********************************************************************/ - /* */ - /* */ - /* FT_END_HEADER */ - /* */ - /* */ - /* This macro is used in association with @FT_BEGIN_HEADER in header */ - /* files to ensure that the declarations within are properly */ - /* encapsulated in an `extern "C" { .. }' block when included from a */ - /* C++ compiler. */ - /* */ -#ifdef __cplusplus -#define FT_END_HEADER } -#else -#define FT_END_HEADER /* nothing */ -#endif - - - /*************************************************************************/ - /* */ - /* Aliases for the FreeType 2 public and configuration files. */ - /* */ - /*************************************************************************/ - - /*************************************************************************/ - /* */ - /*
*/ - /* header_file_macros */ - /* */ - /* */ - /* Header File Macros */ - /* */ - /* <Abstract> */ - /* Macro definitions used to #include specific header files. */ - /* */ - /* <Description> */ - /* The following macros are defined to the name of specific */ - /* FreeType~2 header files. They can be used directly in #include */ - /* statements as in: */ - /* */ - /* { */ - /* #include FT_FREETYPE_H */ - /* #include FT_MULTIPLE_MASTERS_H */ - /* #include FT_GLYPH_H */ - /* } */ - /* */ - /* There are several reasons why we are now using macros to name */ - /* public header files. The first one is that such macros are not */ - /* limited to the infamous 8.3~naming rule required by DOS (and */ - /* `FT_MULTIPLE_MASTERS_H' is a lot more meaningful than `ftmm.h'). */ - /* */ - /* The second reason is that it allows for more flexibility in the */ - /* way FreeType~2 is installed on a given system. */ - /* */ - /*************************************************************************/ - - - /* configuration files */ - - /************************************************************************* - * - * @macro: - * FT_CONFIG_CONFIG_H - * - * @description: - * A macro used in #include statements to name the file containing - * FreeType~2 configuration data. - * - */ -#ifndef FT_CONFIG_CONFIG_H -#define FT_CONFIG_CONFIG_H <freetype/config/ftconfig.h> -#endif - - - /************************************************************************* - * - * @macro: - * FT_CONFIG_STANDARD_LIBRARY_H - * - * @description: - * A macro used in #include statements to name the file containing - * FreeType~2 interface to the standard C library functions. - * - */ -#ifndef FT_CONFIG_STANDARD_LIBRARY_H -#define FT_CONFIG_STANDARD_LIBRARY_H <freetype/config/ftstdlib.h> -#endif - - - /************************************************************************* - * - * @macro: - * FT_CONFIG_OPTIONS_H - * - * @description: - * A macro used in #include statements to name the file containing - * FreeType~2 project-specific configuration options. - * - */ -#ifndef FT_CONFIG_OPTIONS_H -#define FT_CONFIG_OPTIONS_H <freetype/config/ftoption.h> -#endif - - - /************************************************************************* - * - * @macro: - * FT_CONFIG_MODULES_H - * - * @description: - * A macro used in #include statements to name the file containing the - * list of FreeType~2 modules that are statically linked to new library - * instances in @FT_Init_FreeType. - * - */ -#ifndef FT_CONFIG_MODULES_H -#define FT_CONFIG_MODULES_H <freetype/config/ftmodule.h> -#endif - - /* */ - - /* public headers */ - - /************************************************************************* - * - * @macro: - * FT_FREETYPE_H - * - * @description: - * A macro used in #include statements to name the file containing the - * base FreeType~2 API. - * - */ -#define FT_FREETYPE_H <freetype/freetype.h> - - - /************************************************************************* - * - * @macro: - * FT_ERRORS_H - * - * @description: - * A macro used in #include statements to name the file containing the - * list of FreeType~2 error codes (and messages). - * - * It is included by @FT_FREETYPE_H. - * - */ -#define FT_ERRORS_H <freetype/fterrors.h> - - - /************************************************************************* - * - * @macro: - * FT_MODULE_ERRORS_H - * - * @description: - * A macro used in #include statements to name the file containing the - * list of FreeType~2 module error offsets (and messages). - * - */ -#define FT_MODULE_ERRORS_H <freetype/ftmoderr.h> - - - /************************************************************************* - * - * @macro: - * FT_SYSTEM_H - * - * @description: - * A macro used in #include statements to name the file containing the - * FreeType~2 interface to low-level operations (i.e., memory management - * and stream i/o). - * - * It is included by @FT_FREETYPE_H. - * - */ -#define FT_SYSTEM_H <freetype/ftsystem.h> - - - /************************************************************************* - * - * @macro: - * FT_IMAGE_H - * - * @description: - * A macro used in #include statements to name the file containing type - * definitions related to glyph images (i.e., bitmaps, outlines, - * scan-converter parameters). - * - * It is included by @FT_FREETYPE_H. - * - */ -#define FT_IMAGE_H <freetype/ftimage.h> - - - /************************************************************************* - * - * @macro: - * FT_TYPES_H - * - * @description: - * A macro used in #include statements to name the file containing the - * basic data types defined by FreeType~2. - * - * It is included by @FT_FREETYPE_H. - * - */ -#define FT_TYPES_H <freetype/fttypes.h> - - - /************************************************************************* - * - * @macro: - * FT_LIST_H - * - * @description: - * A macro used in #include statements to name the file containing the - * list management API of FreeType~2. - * - * (Most applications will never need to include this file.) - * - */ -#define FT_LIST_H <freetype/ftlist.h> - - - /************************************************************************* - * - * @macro: - * FT_OUTLINE_H - * - * @description: - * A macro used in #include statements to name the file containing the - * scalable outline management API of FreeType~2. - * - */ -#define FT_OUTLINE_H <freetype/ftoutln.h> - - - /************************************************************************* - * - * @macro: - * FT_SIZES_H - * - * @description: - * A macro used in #include statements to name the file containing the - * API which manages multiple @FT_Size objects per face. - * - */ -#define FT_SIZES_H <freetype/ftsizes.h> - - - /************************************************************************* - * - * @macro: - * FT_MODULE_H - * - * @description: - * A macro used in #include statements to name the file containing the - * module management API of FreeType~2. - * - */ -#define FT_MODULE_H <freetype/ftmodapi.h> - - - /************************************************************************* - * - * @macro: - * FT_RENDER_H - * - * @description: - * A macro used in #include statements to name the file containing the - * renderer module management API of FreeType~2. - * - */ -#define FT_RENDER_H <freetype/ftrender.h> - - - /************************************************************************* - * - * @macro: - * FT_TYPE1_TABLES_H - * - * @description: - * A macro used in #include statements to name the file containing the - * types and API specific to the Type~1 format. - * - */ -#define FT_TYPE1_TABLES_H <freetype/t1tables.h> - - - /************************************************************************* - * - * @macro: - * FT_TRUETYPE_IDS_H - * - * @description: - * A macro used in #include statements to name the file containing the - * enumeration values which identify name strings, languages, encodings, - * etc. This file really contains a _large_ set of constant macro - * definitions, taken from the TrueType and OpenType specifications. - * - */ -#define FT_TRUETYPE_IDS_H <freetype/ttnameid.h> - - - /************************************************************************* - * - * @macro: - * FT_TRUETYPE_TABLES_H - * - * @description: - * A macro used in #include statements to name the file containing the - * types and API specific to the TrueType (as well as OpenType) format. - * - */ -#define FT_TRUETYPE_TABLES_H <freetype/tttables.h> - - - /************************************************************************* - * - * @macro: - * FT_TRUETYPE_TAGS_H - * - * @description: - * A macro used in #include statements to name the file containing the - * definitions of TrueType four-byte `tags' which identify blocks in - * SFNT-based font formats (i.e., TrueType and OpenType). - * - */ -#define FT_TRUETYPE_TAGS_H <freetype/tttags.h> - - - /************************************************************************* - * - * @macro: - * FT_BDF_H - * - * @description: - * A macro used in #include statements to name the file containing the - * definitions of an API which accesses BDF-specific strings from a - * face. - * - */ -#define FT_BDF_H <freetype/ftbdf.h> - - - /************************************************************************* - * - * @macro: - * FT_CID_H - * - * @description: - * A macro used in #include statements to name the file containing the - * definitions of an API which access CID font information from a - * face. - * - */ -#define FT_CID_H <freetype/ftcid.h> - - - /************************************************************************* - * - * @macro: - * FT_GZIP_H - * - * @description: - * A macro used in #include statements to name the file containing the - * definitions of an API which supports gzip-compressed files. - * - */ -#define FT_GZIP_H <freetype/ftgzip.h> - - - /************************************************************************* - * - * @macro: - * FT_LZW_H - * - * @description: - * A macro used in #include statements to name the file containing the - * definitions of an API which supports LZW-compressed files. - * - */ -#define FT_LZW_H <freetype/ftlzw.h> - - - /************************************************************************* - * - * @macro: - * FT_BZIP2_H - * - * @description: - * A macro used in #include statements to name the file containing the - * definitions of an API which supports bzip2-compressed files. - * - */ -#define FT_BZIP2_H <freetype/ftbzip2.h> - - - /************************************************************************* - * - * @macro: - * FT_WINFONTS_H - * - * @description: - * A macro used in #include statements to name the file containing the - * definitions of an API which supports Windows FNT files. - * - */ -#define FT_WINFONTS_H <freetype/ftwinfnt.h> - - - /************************************************************************* - * - * @macro: - * FT_GLYPH_H - * - * @description: - * A macro used in #include statements to name the file containing the - * API of the optional glyph management component. - * - */ -#define FT_GLYPH_H <freetype/ftglyph.h> - - - /************************************************************************* - * - * @macro: - * FT_BITMAP_H - * - * @description: - * A macro used in #include statements to name the file containing the - * API of the optional bitmap conversion component. - * - */ -#define FT_BITMAP_H <freetype/ftbitmap.h> - - - /************************************************************************* - * - * @macro: - * FT_BBOX_H - * - * @description: - * A macro used in #include statements to name the file containing the - * API of the optional exact bounding box computation routines. - * - */ -#define FT_BBOX_H <freetype/ftbbox.h> - - - /************************************************************************* - * - * @macro: - * FT_CACHE_H - * - * @description: - * A macro used in #include statements to name the file containing the - * API of the optional FreeType~2 cache sub-system. - * - */ -#define FT_CACHE_H <freetype/ftcache.h> - - - /************************************************************************* - * - * @macro: - * FT_CACHE_IMAGE_H - * - * @description: - * A macro used in #include statements to name the file containing the - * `glyph image' API of the FreeType~2 cache sub-system. - * - * It is used to define a cache for @FT_Glyph elements. You can also - * use the API defined in @FT_CACHE_SMALL_BITMAPS_H if you only need to - * store small glyph bitmaps, as it will use less memory. - * - * This macro is deprecated. Simply include @FT_CACHE_H to have all - * glyph image-related cache declarations. - * - */ -#define FT_CACHE_IMAGE_H FT_CACHE_H - - - /************************************************************************* - * - * @macro: - * FT_CACHE_SMALL_BITMAPS_H - * - * @description: - * A macro used in #include statements to name the file containing the - * `small bitmaps' API of the FreeType~2 cache sub-system. - * - * It is used to define a cache for small glyph bitmaps in a relatively - * memory-efficient way. You can also use the API defined in - * @FT_CACHE_IMAGE_H if you want to cache arbitrary glyph images, - * including scalable outlines. - * - * This macro is deprecated. Simply include @FT_CACHE_H to have all - * small bitmaps-related cache declarations. - * - */ -#define FT_CACHE_SMALL_BITMAPS_H FT_CACHE_H - - - /************************************************************************* - * - * @macro: - * FT_CACHE_CHARMAP_H - * - * @description: - * A macro used in #include statements to name the file containing the - * `charmap' API of the FreeType~2 cache sub-system. - * - * This macro is deprecated. Simply include @FT_CACHE_H to have all - * charmap-based cache declarations. - * - */ -#define FT_CACHE_CHARMAP_H FT_CACHE_H - - - /************************************************************************* - * - * @macro: - * FT_MAC_H - * - * @description: - * A macro used in #include statements to name the file containing the - * Macintosh-specific FreeType~2 API. The latter is used to access - * fonts embedded in resource forks. - * - * This header file must be explicitly included by client applications - * compiled on the Mac (note that the base API still works though). - * - */ -#define FT_MAC_H <freetype/ftmac.h> - - - /************************************************************************* - * - * @macro: - * FT_MULTIPLE_MASTERS_H - * - * @description: - * A macro used in #include statements to name the file containing the - * optional multiple-masters management API of FreeType~2. - * - */ -#define FT_MULTIPLE_MASTERS_H <freetype/ftmm.h> - - - /************************************************************************* - * - * @macro: - * FT_SFNT_NAMES_H - * - * @description: - * A macro used in #include statements to name the file containing the - * optional FreeType~2 API which accesses embedded `name' strings in - * SFNT-based font formats (i.e., TrueType and OpenType). - * - */ -#define FT_SFNT_NAMES_H <freetype/ftsnames.h> - - - /************************************************************************* - * - * @macro: - * FT_OPENTYPE_VALIDATE_H - * - * @description: - * A macro used in #include statements to name the file containing the - * optional FreeType~2 API which validates OpenType tables (BASE, GDEF, - * GPOS, GSUB, JSTF). - * - */ -#define FT_OPENTYPE_VALIDATE_H <freetype/ftotval.h> - - - /************************************************************************* - * - * @macro: - * FT_GX_VALIDATE_H - * - * @description: - * A macro used in #include statements to name the file containing the - * optional FreeType~2 API which validates TrueTypeGX/AAT tables (feat, - * mort, morx, bsln, just, kern, opbd, trak, prop). - * - */ -#define FT_GX_VALIDATE_H <freetype/ftgxval.h> - - - /************************************************************************* - * - * @macro: - * FT_PFR_H - * - * @description: - * A macro used in #include statements to name the file containing the - * FreeType~2 API which accesses PFR-specific data. - * - */ -#define FT_PFR_H <freetype/ftpfr.h> - - - /************************************************************************* - * - * @macro: - * FT_STROKER_H - * - * @description: - * A macro used in #include statements to name the file containing the - * FreeType~2 API which provides functions to stroke outline paths. - */ -#define FT_STROKER_H <freetype/ftstroke.h> - - - /************************************************************************* - * - * @macro: - * FT_SYNTHESIS_H - * - * @description: - * A macro used in #include statements to name the file containing the - * FreeType~2 API which performs artificial obliquing and emboldening. - */ -#define FT_SYNTHESIS_H <freetype/ftsynth.h> - - - /************************************************************************* - * - * @macro: - * FT_XFREE86_H - * - * @description: - * A macro used in #include statements to name the file containing the - * FreeType~2 API which provides functions specific to the XFree86 and - * X.Org X11 servers. - */ -#define FT_XFREE86_H <freetype/ftxf86.h> - - - /************************************************************************* - * - * @macro: - * FT_TRIGONOMETRY_H - * - * @description: - * A macro used in #include statements to name the file containing the - * FreeType~2 API which performs trigonometric computations (e.g., - * cosines and arc tangents). - */ -#define FT_TRIGONOMETRY_H <freetype/fttrigon.h> - - - /************************************************************************* - * - * @macro: - * FT_LCD_FILTER_H - * - * @description: - * A macro used in #include statements to name the file containing the - * FreeType~2 API which performs color filtering for subpixel rendering. - */ -#define FT_LCD_FILTER_H <freetype/ftlcdfil.h> - - - /************************************************************************* - * - * @macro: - * FT_UNPATENTED_HINTING_H - * - * @description: - * A macro used in #include statements to name the file containing the - * FreeType~2 API which performs color filtering for subpixel rendering. - */ -#define FT_UNPATENTED_HINTING_H <freetype/ttunpat.h> - - - /************************************************************************* - * - * @macro: - * FT_INCREMENTAL_H - * - * @description: - * A macro used in #include statements to name the file containing the - * FreeType~2 API which performs color filtering for subpixel rendering. - */ -#define FT_INCREMENTAL_H <freetype/ftincrem.h> - - - /************************************************************************* - * - * @macro: - * FT_GASP_H - * - * @description: - * A macro used in #include statements to name the file containing the - * FreeType~2 API which returns entries from the TrueType GASP table. - */ -#define FT_GASP_H <freetype/ftgasp.h> - - - /************************************************************************* - * - * @macro: - * FT_ADVANCES_H - * - * @description: - * A macro used in #include statements to name the file containing the - * FreeType~2 API which returns individual and ranged glyph advances. - */ -#define FT_ADVANCES_H <freetype/ftadvanc.h> - - - /* */ - -#define FT_ERROR_DEFINITIONS_H <freetype/fterrdef.h> - - - /* The internals of the cache sub-system are no longer exposed. We */ - /* default to FT_CACHE_H at the moment just in case, but we know of */ - /* no rogue client that uses them. */ - /* */ -#define FT_CACHE_MANAGER_H <freetype/ftcache.h> -#define FT_CACHE_INTERNAL_MRU_H <freetype/ftcache.h> -#define FT_CACHE_INTERNAL_MANAGER_H <freetype/ftcache.h> -#define FT_CACHE_INTERNAL_CACHE_H <freetype/ftcache.h> -#define FT_CACHE_INTERNAL_GLYPH_H <freetype/ftcache.h> -#define FT_CACHE_INTERNAL_IMAGE_H <freetype/ftcache.h> -#define FT_CACHE_INTERNAL_SBITS_H <freetype/ftcache.h> - - -#define FT_INCREMENTAL_H <freetype/ftincrem.h> - -#define FT_TRUETYPE_UNPATENTED_H <freetype/ttunpat.h> - - - /* - * Include internal headers definitions from <freetype/internal/...> - * only when building the library. - */ -#ifdef FT2_BUILD_LIBRARY -#define FT_INTERNAL_INTERNAL_H <freetype/internal/internal.h> -#include FT_INTERNAL_INTERNAL_H -#endif /* FT2_BUILD_LIBRARY */ - - -#endif /* __FT2_BUILD_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/config/ftmodule.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/config/ftmodule.h deleted file mode 100644 index b7299779aa..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/config/ftmodule.h +++ /dev/null @@ -1,20 +0,0 @@ -/* This is a generated file. */ -FT_USE_MODULE( FT_Driver_ClassRec, tt_driver_class ) -FT_USE_MODULE( FT_Driver_ClassRec, t1_driver_class ) -FT_USE_MODULE( FT_Driver_ClassRec, cff_driver_class ) -FT_USE_MODULE( FT_Driver_ClassRec, t1cid_driver_class ) -FT_USE_MODULE( FT_Driver_ClassRec, pfr_driver_class ) -FT_USE_MODULE( FT_Driver_ClassRec, t42_driver_class ) -FT_USE_MODULE( FT_Driver_ClassRec, winfnt_driver_class ) -FT_USE_MODULE( FT_Driver_ClassRec, pcf_driver_class ) -FT_USE_MODULE( FT_Driver_ClassRec, bdf_driver_class ) -FT_USE_MODULE( FT_Module_Class, sfnt_module_class ) -FT_USE_MODULE( FT_Module_Class, autofit_module_class ) -FT_USE_MODULE( FT_Module_Class, pshinter_module_class ) -FT_USE_MODULE( FT_Renderer_Class, ft_raster1_renderer_class ) -FT_USE_MODULE( FT_Renderer_Class, ft_smooth_renderer_class ) -FT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcd_renderer_class ) -FT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcdv_renderer_class ) -FT_USE_MODULE( FT_Module_Class, psaux_module_class ) -FT_USE_MODULE( FT_Module_Class, psnames_module_class ) -/* EOF */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/config/ftoption.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/config/ftoption.h deleted file mode 100644 index 041e24a31b..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/config/ftoption.h +++ /dev/null @@ -1,805 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftoption.h */ -/* */ -/* User-selectable configuration macros (specification only). */ -/* */ -/* Copyright 1996-2011 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __FTOPTION_H__ -#define __FTOPTION_H__ - - -#include <ft2build.h> - - -FT_BEGIN_HEADER - - /*************************************************************************/ - /* */ - /* USER-SELECTABLE CONFIGURATION MACROS */ - /* */ - /* This file contains the default configuration macro definitions for */ - /* a standard build of the FreeType library. There are three ways to */ - /* use this file to build project-specific versions of the library: */ - /* */ - /* - You can modify this file by hand, but this is not recommended in */ - /* cases where you would like to build several versions of the */ - /* library from a single source directory. */ - /* */ - /* - You can put a copy of this file in your build directory, more */ - /* precisely in `$BUILD/freetype/config/ftoption.h', where `$BUILD' */ - /* is the name of a directory that is included _before_ the FreeType */ - /* include path during compilation. */ - /* */ - /* The default FreeType Makefiles and Jamfiles use the build */ - /* directory `builds/<system>' by default, but you can easily change */ - /* that for your own projects. */ - /* */ - /* - Copy the file <ft2build.h> to `$BUILD/ft2build.h' and modify it */ - /* slightly to pre-define the macro FT_CONFIG_OPTIONS_H used to */ - /* locate this file during the build. For example, */ - /* */ - /* #define FT_CONFIG_OPTIONS_H <myftoptions.h> */ - /* #include <freetype/config/ftheader.h> */ - /* */ - /* will use `$BUILD/myftoptions.h' instead of this file for macro */ - /* definitions. */ - /* */ - /* Note also that you can similarly pre-define the macro */ - /* FT_CONFIG_MODULES_H used to locate the file listing of the modules */ - /* that are statically linked to the library at compile time. By */ - /* default, this file is <freetype/config/ftmodule.h>. */ - /* */ - /* We highly recommend using the third method whenever possible. */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /*************************************************************************/ - /**** ****/ - /**** G E N E R A L F R E E T Y P E 2 C O N F I G U R A T I O N ****/ - /**** ****/ - /*************************************************************************/ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* Uncomment the line below if you want to activate sub-pixel rendering */ - /* (a.k.a. LCD rendering, or ClearType) in this build of the library. */ - /* */ - /* Note that this feature is covered by several Microsoft patents */ - /* and should not be activated in any default build of the library. */ - /* */ - /* This macro has no impact on the FreeType API, only on its */ - /* _implementation_. For example, using FT_RENDER_MODE_LCD when calling */ - /* FT_Render_Glyph still generates a bitmap that is 3 times wider than */ - /* the original size in case this macro isn't defined; however, each */ - /* triplet of subpixels has R=G=B. */ - /* */ - /* This is done to allow FreeType clients to run unmodified, forcing */ - /* them to display normal gray-level anti-aliased glyphs. */ - /* */ -/* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */ - - - /*************************************************************************/ - /* */ - /* Many compilers provide a non-ANSI 64-bit data type that can be used */ - /* by FreeType to speed up some computations. However, this will create */ - /* some problems when compiling the library in strict ANSI mode. */ - /* */ - /* For this reason, the use of 64-bit integers is normally disabled when */ - /* the __STDC__ macro is defined. You can however disable this by */ - /* defining the macro FT_CONFIG_OPTION_FORCE_INT64 here. */ - /* */ - /* For most compilers, this will only create compilation warnings when */ - /* building the library. */ - /* */ - /* ObNote: The compiler-specific 64-bit integers are detected in the */ - /* file `ftconfig.h' either statically or through the */ - /* `configure' script on supported platforms. */ - /* */ -#undef FT_CONFIG_OPTION_FORCE_INT64 - - - /*************************************************************************/ - /* */ - /* If this macro is defined, do not try to use an assembler version of */ - /* performance-critical functions (e.g. FT_MulFix). You should only do */ - /* that to verify that the assembler function works properly, or to */ - /* execute benchmark tests of the various implementations. */ -/* #define FT_CONFIG_OPTION_NO_ASSEMBLER */ - - - /*************************************************************************/ - /* */ - /* If this macro is defined, try to use an inlined assembler version of */ - /* the `FT_MulFix' function, which is a `hotspot' when loading and */ - /* hinting glyphs, and which should be executed as fast as possible. */ - /* */ - /* Note that if your compiler or CPU is not supported, this will default */ - /* to the standard and portable implementation found in `ftcalc.c'. */ - /* */ -#define FT_CONFIG_OPTION_INLINE_MULFIX - - - /*************************************************************************/ - /* */ - /* LZW-compressed file support. */ - /* */ - /* FreeType now handles font files that have been compressed with the */ - /* `compress' program. This is mostly used to parse many of the PCF */ - /* files that come with various X11 distributions. The implementation */ - /* uses NetBSD's `zopen' to partially uncompress the file on the fly */ - /* (see src/lzw/ftgzip.c). */ - /* */ - /* Define this macro if you want to enable this `feature'. */ - /* */ -#define FT_CONFIG_OPTION_USE_LZW - - - /*************************************************************************/ - /* */ - /* Gzip-compressed file support. */ - /* */ - /* FreeType now handles font files that have been compressed with the */ - /* `gzip' program. This is mostly used to parse many of the PCF files */ - /* that come with XFree86. The implementation uses `zlib' to */ - /* partially uncompress the file on the fly (see src/gzip/ftgzip.c). */ - /* */ - /* Define this macro if you want to enable this `feature'. See also */ - /* the macro FT_CONFIG_OPTION_SYSTEM_ZLIB below. */ - /* */ -#define FT_CONFIG_OPTION_USE_ZLIB - - - /*************************************************************************/ - /* */ - /* ZLib library selection */ - /* */ - /* This macro is only used when FT_CONFIG_OPTION_USE_ZLIB is defined. */ - /* It allows FreeType's `ftgzip' component to link to the system's */ - /* installation of the ZLib library. This is useful on systems like */ - /* Unix or VMS where it generally is already available. */ - /* */ - /* If you let it undefined, the component will use its own copy */ - /* of the zlib sources instead. These have been modified to be */ - /* included directly within the component and *not* export external */ - /* function names. This allows you to link any program with FreeType */ - /* _and_ ZLib without linking conflicts. */ - /* */ - /* Do not #undef this macro here since the build system might define */ - /* it for certain configurations only. */ - /* */ -/* #define FT_CONFIG_OPTION_SYSTEM_ZLIB */ - - - /*************************************************************************/ - /* */ - /* Bzip2-compressed file support. */ - /* */ - /* FreeType now handles font files that have been compressed with the */ - /* `bzip2' program. This is mostly used to parse many of the PCF */ - /* files that come with XFree86. The implementation uses `libbz2' to */ - /* partially uncompress the file on the fly (see src/bzip2/ftbzip2.c). */ - /* Contrary to gzip, bzip2 currently is not included and need to use */ - /* the system available bzip2 implementation. */ - /* */ - /* Define this macro if you want to enable this `feature'. */ - /* */ -/* #define FT_CONFIG_OPTION_USE_BZIP2 */ - - - /*************************************************************************/ - /* */ - /* Define to disable the use of file stream functions and types, FILE, */ - /* fopen() etc. Enables the use of smaller system libraries on embedded */ - /* systems that have multiple system libraries, some with or without */ - /* file stream support, in the cases where file stream support is not */ - /* necessary such as memory loading of font files. */ - /* */ -/* #define FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT */ - - - /*************************************************************************/ - /* */ - /* DLL export compilation */ - /* */ - /* When compiling FreeType as a DLL, some systems/compilers need a */ - /* special keyword in front OR after the return type of function */ - /* declarations. */ - /* */ - /* Two macros are used within the FreeType source code to define */ - /* exported library functions: FT_EXPORT and FT_EXPORT_DEF. */ - /* */ - /* FT_EXPORT( return_type ) */ - /* */ - /* is used in a function declaration, as in */ - /* */ - /* FT_EXPORT( FT_Error ) */ - /* FT_Init_FreeType( FT_Library* alibrary ); */ - /* */ - /* */ - /* FT_EXPORT_DEF( return_type ) */ - /* */ - /* is used in a function definition, as in */ - /* */ - /* FT_EXPORT_DEF( FT_Error ) */ - /* FT_Init_FreeType( FT_Library* alibrary ) */ - /* { */ - /* ... some code ... */ - /* return FT_Err_Ok; */ - /* } */ - /* */ - /* You can provide your own implementation of FT_EXPORT and */ - /* FT_EXPORT_DEF here if you want. If you leave them undefined, they */ - /* will be later automatically defined as `extern return_type' to */ - /* allow normal compilation. */ - /* */ - /* Do not #undef these macros here since the build system might define */ - /* them for certain configurations only. */ - /* */ -/* #define FT_EXPORT(x) extern x */ -/* #define FT_EXPORT_DEF(x) x */ - - - /*************************************************************************/ - /* */ - /* Glyph Postscript Names handling */ - /* */ - /* By default, FreeType 2 is compiled with the `psnames' module. This */ - /* module is in charge of converting a glyph name string into a */ - /* Unicode value, or return a Macintosh standard glyph name for the */ - /* use with the TrueType `post' table. */ - /* */ - /* Undefine this macro if you do not want `psnames' compiled in your */ - /* build of FreeType. This has the following effects: */ - /* */ - /* - The TrueType driver will provide its own set of glyph names, */ - /* if you build it to support postscript names in the TrueType */ - /* `post' table. */ - /* */ - /* - The Type 1 driver will not be able to synthesize a Unicode */ - /* charmap out of the glyphs found in the fonts. */ - /* */ - /* You would normally undefine this configuration macro when building */ - /* a version of FreeType that doesn't contain a Type 1 or CFF driver. */ - /* */ -#define FT_CONFIG_OPTION_POSTSCRIPT_NAMES - - - /*************************************************************************/ - /* */ - /* Postscript Names to Unicode Values support */ - /* */ - /* By default, FreeType 2 is built with the `PSNames' module compiled */ - /* in. Among other things, the module is used to convert a glyph name */ - /* into a Unicode value. This is especially useful in order to */ - /* synthesize on the fly a Unicode charmap from the CFF/Type 1 driver */ - /* through a big table named the `Adobe Glyph List' (AGL). */ - /* */ - /* Undefine this macro if you do not want the Adobe Glyph List */ - /* compiled in your `PSNames' module. The Type 1 driver will not be */ - /* able to synthesize a Unicode charmap out of the glyphs found in the */ - /* fonts. */ - /* */ -#define FT_CONFIG_OPTION_ADOBE_GLYPH_LIST - - - /*************************************************************************/ - /* */ - /* Support for Mac fonts */ - /* */ - /* Define this macro if you want support for outline fonts in Mac */ - /* format (mac dfont, mac resource, macbinary containing a mac */ - /* resource) on non-Mac platforms. */ - /* */ - /* Note that the `FOND' resource isn't checked. */ - /* */ -#define FT_CONFIG_OPTION_MAC_FONTS - - - /*************************************************************************/ - /* */ - /* Guessing methods to access embedded resource forks */ - /* */ - /* Enable extra Mac fonts support on non-Mac platforms (e.g. */ - /* GNU/Linux). */ - /* */ - /* Resource forks which include fonts data are stored sometimes in */ - /* locations which users or developers don't expected. In some cases, */ - /* resource forks start with some offset from the head of a file. In */ - /* other cases, the actual resource fork is stored in file different */ - /* from what the user specifies. If this option is activated, */ - /* FreeType tries to guess whether such offsets or different file */ - /* names must be used. */ - /* */ - /* Note that normal, direct access of resource forks is controlled via */ - /* the FT_CONFIG_OPTION_MAC_FONTS option. */ - /* */ -#ifdef FT_CONFIG_OPTION_MAC_FONTS -#define FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK -#endif - - - /*************************************************************************/ - /* */ - /* Allow the use of FT_Incremental_Interface to load typefaces that */ - /* contain no glyph data, but supply it via a callback function. */ - /* This is required by clients supporting document formats which */ - /* supply font data incrementally as the document is parsed, such */ - /* as the Ghostscript interpreter for the PostScript language. */ - /* */ -#define FT_CONFIG_OPTION_INCREMENTAL - - - /*************************************************************************/ - /* */ - /* The size in bytes of the render pool used by the scan-line converter */ - /* to do all of its work. */ - /* */ - /* This must be greater than 4KByte if you use FreeType to rasterize */ - /* glyphs; otherwise, you may set it to zero to avoid unnecessary */ - /* allocation of the render pool. */ - /* */ -#define FT_RENDER_POOL_SIZE 16384L - - - /*************************************************************************/ - /* */ - /* FT_MAX_MODULES */ - /* */ - /* The maximum number of modules that can be registered in a single */ - /* FreeType library object. 32 is the default. */ - /* */ -#define FT_MAX_MODULES 32 - - - /*************************************************************************/ - /* */ - /* Debug level */ - /* */ - /* FreeType can be compiled in debug or trace mode. In debug mode, */ - /* errors are reported through the `ftdebug' component. In trace */ - /* mode, additional messages are sent to the standard output during */ - /* execution. */ - /* */ - /* Define FT_DEBUG_LEVEL_ERROR to build the library in debug mode. */ - /* Define FT_DEBUG_LEVEL_TRACE to build it in trace mode. */ - /* */ - /* Don't define any of these macros to compile in `release' mode! */ - /* */ - /* Do not #undef these macros here since the build system might define */ - /* them for certain configurations only. */ - /* */ -/* #define FT_DEBUG_LEVEL_ERROR */ -/* #define FT_DEBUG_LEVEL_TRACE */ - - - /*************************************************************************/ - /* */ - /* Autofitter debugging */ - /* */ - /* If FT_DEBUG_AUTOFIT is defined, FreeType provides some means to */ - /* control the autofitter behaviour for debugging purposes with global */ - /* boolean variables (consequently, you should *never* enable this */ - /* while compiling in `release' mode): */ - /* */ - /* _af_debug_disable_horz_hints */ - /* _af_debug_disable_vert_hints */ - /* _af_debug_disable_blue_hints */ - /* */ - /* Additionally, the following functions provide dumps of various */ - /* internal autofit structures to stdout (using `printf'): */ - /* */ - /* af_glyph_hints_dump_points */ - /* af_glyph_hints_dump_segments */ - /* af_glyph_hints_dump_edges */ - /* */ - /* As an argument, they use another global variable: */ - /* */ - /* _af_debug_hints */ - /* */ - /* Please have a look at the `ftgrid' demo program to see how those */ - /* variables and macros should be used. */ - /* */ - /* Do not #undef these macros here since the build system might define */ - /* them for certain configurations only. */ - /* */ -/* #define FT_DEBUG_AUTOFIT */ - - - /*************************************************************************/ - /* */ - /* Memory Debugging */ - /* */ - /* FreeType now comes with an integrated memory debugger that is */ - /* capable of detecting simple errors like memory leaks or double */ - /* deletes. To compile it within your build of the library, you */ - /* should define FT_DEBUG_MEMORY here. */ - /* */ - /* Note that the memory debugger is only activated at runtime when */ - /* when the _environment_ variable `FT2_DEBUG_MEMORY' is defined also! */ - /* */ - /* Do not #undef this macro here since the build system might define */ - /* it for certain configurations only. */ - /* */ -/* #define FT_DEBUG_MEMORY */ - - - /*************************************************************************/ - /* */ - /* Module errors */ - /* */ - /* If this macro is set (which is _not_ the default), the higher byte */ - /* of an error code gives the module in which the error has occurred, */ - /* while the lower byte is the real error code. */ - /* */ - /* Setting this macro makes sense for debugging purposes only, since */ - /* it would break source compatibility of certain programs that use */ - /* FreeType 2. */ - /* */ - /* More details can be found in the files ftmoderr.h and fterrors.h. */ - /* */ -#undef FT_CONFIG_OPTION_USE_MODULE_ERRORS - - - /*************************************************************************/ - /* */ - /* Position Independent Code */ - /* */ - /* If this macro is set (which is _not_ the default), FreeType2 will */ - /* avoid creating constants that require address fixups. Instead the */ - /* constants will be moved into a struct and additional intialization */ - /* code will be used. */ - /* */ - /* Setting this macro is needed for systems that prohibit address */ - /* fixups, such as BREW. */ - /* */ -/* #define FT_CONFIG_OPTION_PIC */ - - - /*************************************************************************/ - /*************************************************************************/ - /**** ****/ - /**** S F N T D R I V E R C O N F I G U R A T I O N ****/ - /**** ****/ - /*************************************************************************/ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* Define TT_CONFIG_OPTION_EMBEDDED_BITMAPS if you want to support */ - /* embedded bitmaps in all formats using the SFNT module (namely */ - /* TrueType & OpenType). */ - /* */ -#define TT_CONFIG_OPTION_EMBEDDED_BITMAPS - - - /*************************************************************************/ - /* */ - /* Define TT_CONFIG_OPTION_POSTSCRIPT_NAMES if you want to be able to */ - /* load and enumerate the glyph Postscript names in a TrueType or */ - /* OpenType file. */ - /* */ - /* Note that when you do not compile the `PSNames' module by undefining */ - /* the above FT_CONFIG_OPTION_POSTSCRIPT_NAMES, the `sfnt' module will */ - /* contain additional code used to read the PS Names table from a font. */ - /* */ - /* (By default, the module uses `PSNames' to extract glyph names.) */ - /* */ -#define TT_CONFIG_OPTION_POSTSCRIPT_NAMES - - - /*************************************************************************/ - /* */ - /* Define TT_CONFIG_OPTION_SFNT_NAMES if your applications need to */ - /* access the internal name table in a SFNT-based format like TrueType */ - /* or OpenType. The name table contains various strings used to */ - /* describe the font, like family name, copyright, version, etc. It */ - /* does not contain any glyph name though. */ - /* */ - /* Accessing SFNT names is done through the functions declared in */ - /* `freetype/ftsnames.h'. */ - /* */ -#define TT_CONFIG_OPTION_SFNT_NAMES - - - /*************************************************************************/ - /* */ - /* TrueType CMap support */ - /* */ - /* Here you can fine-tune which TrueType CMap table format shall be */ - /* supported. */ -#define TT_CONFIG_CMAP_FORMAT_0 -#define TT_CONFIG_CMAP_FORMAT_2 -#define TT_CONFIG_CMAP_FORMAT_4 -#define TT_CONFIG_CMAP_FORMAT_6 -#define TT_CONFIG_CMAP_FORMAT_8 -#define TT_CONFIG_CMAP_FORMAT_10 -#define TT_CONFIG_CMAP_FORMAT_12 -#define TT_CONFIG_CMAP_FORMAT_13 -#define TT_CONFIG_CMAP_FORMAT_14 - - - /*************************************************************************/ - /*************************************************************************/ - /**** ****/ - /**** T R U E T Y P E D R I V E R C O N F I G U R A T I O N ****/ - /**** ****/ - /*************************************************************************/ - /*************************************************************************/ - - /*************************************************************************/ - /* */ - /* Define TT_CONFIG_OPTION_BYTECODE_INTERPRETER if you want to compile */ - /* a bytecode interpreter in the TrueType driver. */ - /* */ - /* By undefining this, you will only compile the code necessary to load */ - /* TrueType glyphs without hinting. */ - /* */ - /* Do not #undef this macro here, since the build system might */ - /* define it for certain configurations only. */ - /* */ -#define TT_CONFIG_OPTION_BYTECODE_INTERPRETER - - - /*************************************************************************/ - /* */ - /* If you define TT_CONFIG_OPTION_UNPATENTED_HINTING, a special version */ - /* of the TrueType bytecode interpreter is used that doesn't implement */ - /* any of the patented opcodes and algorithms. The patents related to */ - /* TrueType hinting have expired worldwide since May 2010; this option */ - /* is now deprecated. */ - /* */ - /* Note that the TT_CONFIG_OPTION_UNPATENTED_HINTING macro is *ignored* */ - /* if you define TT_CONFIG_OPTION_BYTECODE_INTERPRETER; in other words, */ - /* either define TT_CONFIG_OPTION_BYTECODE_INTERPRETER or */ - /* TT_CONFIG_OPTION_UNPATENTED_HINTING but not both at the same time. */ - /* */ - /* This macro is only useful for a small number of font files (mostly */ - /* for Asian scripts) that require bytecode interpretation to properly */ - /* load glyphs. For all other fonts, this produces unpleasant results, */ - /* thus the unpatented interpreter is never used to load glyphs from */ - /* TrueType fonts unless one of the following two options is used. */ - /* */ - /* - The unpatented interpreter is explicitly activated by the user */ - /* through the FT_PARAM_TAG_UNPATENTED_HINTING parameter tag */ - /* when opening the FT_Face. */ - /* */ - /* - FreeType detects that the FT_Face corresponds to one of the */ - /* `trick' fonts (e.g., `Mingliu') it knows about. The font engine */ - /* contains a hard-coded list of font names and other matching */ - /* parameters (see function `tt_face_init' in file */ - /* `src/truetype/ttobjs.c'). */ - /* */ - /* Here a sample code snippet for using FT_PARAM_TAG_UNPATENTED_HINTING. */ - /* */ - /* { */ - /* FT_Parameter parameter; */ - /* FT_Open_Args open_args; */ - /* */ - /* */ - /* parameter.tag = FT_PARAM_TAG_UNPATENTED_HINTING; */ - /* */ - /* open_args.flags = FT_OPEN_PATHNAME | FT_OPEN_PARAMS; */ - /* open_args.pathname = my_font_pathname; */ - /* open_args.num_params = 1; */ - /* open_args.params = ¶meter; */ - /* */ - /* error = FT_Open_Face( library, &open_args, index, &face ); */ - /* ... */ - /* } */ - /* */ -/* #define TT_CONFIG_OPTION_UNPATENTED_HINTING */ - - - /*************************************************************************/ - /* */ - /* Define TT_CONFIG_OPTION_INTERPRETER_SWITCH to compile the TrueType */ - /* bytecode interpreter with a huge switch statement, rather than a call */ - /* table. This results in smaller and faster code for a number of */ - /* architectures. */ - /* */ - /* Note however that on some compiler/processor combinations, undefining */ - /* this macro will generate faster, though larger, code. */ - /* */ -#define TT_CONFIG_OPTION_INTERPRETER_SWITCH - - - /*************************************************************************/ - /* */ - /* Define TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED to compile the */ - /* TrueType glyph loader to use Apple's definition of how to handle */ - /* component offsets in composite glyphs. */ - /* */ - /* Apple and MS disagree on the default behavior of component offsets */ - /* in composites. Apple says that they should be scaled by the scaling */ - /* factors in the transformation matrix (roughly, it's more complex) */ - /* while MS says they should not. OpenType defines two bits in the */ - /* composite flags array which can be used to disambiguate, but old */ - /* fonts will not have them. */ - /* */ - /* http://www.microsoft.com/typography/otspec/glyf.htm */ - /* http://fonts.apple.com/TTRefMan/RM06/Chap6glyf.html */ - /* */ -#undef TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED - - - /*************************************************************************/ - /* */ - /* Define TT_CONFIG_OPTION_GX_VAR_SUPPORT if you want to include */ - /* support for Apple's distortable font technology (fvar, gvar, cvar, */ - /* and avar tables). This has many similarities to Type 1 Multiple */ - /* Masters support. */ - /* */ -#define TT_CONFIG_OPTION_GX_VAR_SUPPORT - - - /*************************************************************************/ - /* */ - /* Define TT_CONFIG_OPTION_BDF if you want to include support for */ - /* an embedded `BDF ' table within SFNT-based bitmap formats. */ - /* */ -#define TT_CONFIG_OPTION_BDF - - - /*************************************************************************/ - /*************************************************************************/ - /**** ****/ - /**** T Y P E 1 D R I V E R C O N F I G U R A T I O N ****/ - /**** ****/ - /*************************************************************************/ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* T1_MAX_DICT_DEPTH is the maximal depth of nest dictionaries and */ - /* arrays in the Type 1 stream (see t1load.c). A minimum of 4 is */ - /* required. */ - /* */ -#define T1_MAX_DICT_DEPTH 5 - - - /*************************************************************************/ - /* */ - /* T1_MAX_SUBRS_CALLS details the maximum number of nested sub-routine */ - /* calls during glyph loading. */ - /* */ -#define T1_MAX_SUBRS_CALLS 16 - - - /*************************************************************************/ - /* */ - /* T1_MAX_CHARSTRING_OPERANDS is the charstring stack's capacity. A */ - /* minimum of 16 is required. */ - /* */ - /* The Chinese font MingTiEG-Medium (CNS 11643 character set) needs 256. */ - /* */ -#define T1_MAX_CHARSTRINGS_OPERANDS 256 - - - /*************************************************************************/ - /* */ - /* Define this configuration macro if you want to prevent the */ - /* compilation of `t1afm', which is in charge of reading Type 1 AFM */ - /* files into an existing face. Note that if set, the T1 driver will be */ - /* unable to produce kerning distances. */ - /* */ -#undef T1_CONFIG_OPTION_NO_AFM - - - /*************************************************************************/ - /* */ - /* Define this configuration macro if you want to prevent the */ - /* compilation of the Multiple Masters font support in the Type 1 */ - /* driver. */ - /* */ -#undef T1_CONFIG_OPTION_NO_MM_SUPPORT - - - /*************************************************************************/ - /*************************************************************************/ - /**** ****/ - /**** A U T O F I T M O D U L E C O N F I G U R A T I O N ****/ - /**** ****/ - /*************************************************************************/ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* Compile autofit module with CJK (Chinese, Japanese, Korean) script */ - /* support. */ - /* */ -#define AF_CONFIG_OPTION_CJK - - /*************************************************************************/ - /* */ - /* Compile autofit module with Indic script support. */ - /* */ -#define AF_CONFIG_OPTION_INDIC - - /*************************************************************************/ - /* */ - /* Compile autofit module with warp hinting. The idea of the warping */ - /* code is to slightly scale and shift a glyph within a single dimension */ - /* so that as much of its segments are aligned (more or less) on the */ - /* grid. To find out the optimal scaling and shifting value, various */ - /* parameter combinations are tried and scored. */ - /* */ - /* This experimental option is only active if the render mode is */ - /* FT_RENDER_MODE_LIGHT. */ - /* */ -/* #define AF_CONFIG_OPTION_USE_WARPER */ - - /* */ - - - /* - * Define this variable if you want to keep the layout of internal - * structures that was used prior to FreeType 2.2. This also compiles in - * a few obsolete functions to avoid linking problems on typical Unix - * distributions. - * - * For embedded systems or building a new distribution from scratch, it - * is recommended to disable the macro since it reduces the library's code - * size and activates a few memory-saving optimizations as well. - */ -#define FT_CONFIG_OPTION_OLD_INTERNALS - - - /* - * To detect legacy cache-lookup call from a rogue client (<= 2.1.7), - * we restrict the number of charmaps in a font. The current API of - * FTC_CMapCache_Lookup() takes cmap_index & charcode, but old API - * takes charcode only. To determine the passed value is for cmap_index - * or charcode, the possible cmap_index is restricted not to exceed - * the minimum possible charcode by a rogue client. It is also very - * unlikely that a rogue client is interested in Unicode values 0 to 15. - * - * NOTE: The original threshold was 4 deduced from popular number of - * cmap subtables in UCS-4 TrueType fonts, but now it is not - * irregular for OpenType fonts to have more than 4 subtables, - * because variation selector subtables are available for Apple - * and Microsoft platforms. - */ - -#ifdef FT_CONFIG_OPTION_OLD_INTERNALS -#define FT_MAX_CHARMAP_CACHEABLE 15 -#endif - - - /* - * This macro is defined if either unpatented or native TrueType - * hinting is requested by the definitions above. - */ -#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER -#define TT_USE_BYTECODE_INTERPRETER -#undef TT_CONFIG_OPTION_UNPATENTED_HINTING -#elif defined TT_CONFIG_OPTION_UNPATENTED_HINTING -#define TT_USE_BYTECODE_INTERPRETER -#endif - -FT_END_HEADER - - -#endif /* __FTOPTION_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/config/ftstdlib.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/config/ftstdlib.h deleted file mode 100644 index 11d5d0e65b..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/config/ftstdlib.h +++ /dev/null @@ -1,174 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftstdlib.h */ -/* */ -/* ANSI-specific library and header configuration file (specification */ -/* only). */ -/* */ -/* Copyright 2002-2007, 2009, 2011 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - - /*************************************************************************/ - /* */ - /* This file is used to group all #includes to the ANSI C library that */ - /* FreeType normally requires. It also defines macros to rename the */ - /* standard functions within the FreeType source code. */ - /* */ - /* Load a file which defines __FTSTDLIB_H__ before this one to override */ - /* it. */ - /* */ - /*************************************************************************/ - - -#ifndef __FTSTDLIB_H__ -#define __FTSTDLIB_H__ - - -#include <stddef.h> - -#define ft_ptrdiff_t ptrdiff_t - - - /**********************************************************************/ - /* */ - /* integer limits */ - /* */ - /* UINT_MAX and ULONG_MAX are used to automatically compute the size */ - /* of `int' and `long' in bytes at compile-time. So far, this works */ - /* for all platforms the library has been tested on. */ - /* */ - /* Note that on the extremely rare platforms that do not provide */ - /* integer types that are _exactly_ 16 and 32 bits wide (e.g. some */ - /* old Crays where `int' is 36 bits), we do not make any guarantee */ - /* about the correct behaviour of FT2 with all fonts. */ - /* */ - /* In these case, `ftconfig.h' will refuse to compile anyway with a */ - /* message like `couldn't find 32-bit type' or something similar. */ - /* */ - /**********************************************************************/ - - -#include <limits.h> - -#define FT_CHAR_BIT CHAR_BIT -#define FT_USHORT_MAX USHRT_MAX -#define FT_INT_MAX INT_MAX -#define FT_INT_MIN INT_MIN -#define FT_UINT_MAX UINT_MAX -#define FT_ULONG_MAX ULONG_MAX - - - /**********************************************************************/ - /* */ - /* character and string processing */ - /* */ - /**********************************************************************/ - - -#include <string.h> - -#define ft_memchr memchr -#define ft_memcmp memcmp -#define ft_memcpy memcpy -#define ft_memmove memmove -#define ft_memset memset -#define ft_strcat strcat -#define ft_strcmp strcmp -#define ft_strcpy strcpy -#define ft_strlen strlen -#define ft_strncmp strncmp -#define ft_strncpy strncpy -#define ft_strrchr strrchr -#define ft_strstr strstr - - - /**********************************************************************/ - /* */ - /* file handling */ - /* */ - /**********************************************************************/ - - -#include <stdio.h> - -#define FT_FILE FILE -#define ft_fclose fclose -#define ft_fopen fopen -#define ft_fread fread -#define ft_fseek fseek -#define ft_ftell ftell -#define ft_sprintf sprintf - - - /**********************************************************************/ - /* */ - /* sorting */ - /* */ - /**********************************************************************/ - - -#include <stdlib.h> - -#define ft_qsort qsort - - - /**********************************************************************/ - /* */ - /* memory allocation */ - /* */ - /**********************************************************************/ - - -#define ft_scalloc calloc -#define ft_sfree free -#define ft_smalloc malloc -#define ft_srealloc realloc - - - /**********************************************************************/ - /* */ - /* miscellaneous */ - /* */ - /**********************************************************************/ - - -#define ft_atol atol -#define ft_labs labs - - - /**********************************************************************/ - /* */ - /* execution control */ - /* */ - /**********************************************************************/ - - -#include <setjmp.h> - -#define ft_jmp_buf jmp_buf /* note: this cannot be a typedef since */ - /* jmp_buf is defined as a macro */ - /* on certain platforms */ - -#define ft_longjmp longjmp -#define ft_setjmp( b ) setjmp( *(jmp_buf*) &(b) ) /* same thing here */ - - - /* the following is only used for debugging purposes, i.e., if */ - /* FT_DEBUG_LEVEL_ERROR or FT_DEBUG_LEVEL_TRACE are defined */ - -#include <stdarg.h> - - -#endif /* __FTSTDLIB_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/freetype.h.REMOVED.git-id b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/freetype.h.REMOVED.git-id deleted file mode 100644 index b83123811b..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/freetype.h.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -63c291af1270c8a1c4ba40388b000f0710ea38c6 \ No newline at end of file diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftadvanc.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftadvanc.h deleted file mode 100644 index b2451bec42..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftadvanc.h +++ /dev/null @@ -1,179 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftadvanc.h */ -/* */ -/* Quick computation of advance widths (specification only). */ -/* */ -/* Copyright 2008 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __FTADVANC_H__ -#define __FTADVANC_H__ - - -#include <ft2build.h> -#include FT_FREETYPE_H - -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - - -FT_BEGIN_HEADER - - - /************************************************************************** - * - * @section: - * quick_advance - * - * @title: - * Quick retrieval of advance values - * - * @abstract: - * Retrieve horizontal and vertical advance values without processing - * glyph outlines, if possible. - * - * @description: - * This section contains functions to quickly extract advance values - * without handling glyph outlines, if possible. - */ - - - /*************************************************************************/ - /* */ - /* <Const> */ - /* FT_ADVANCE_FLAG_FAST_ONLY */ - /* */ - /* <Description> */ - /* A bit-flag to be OR-ed with the `flags' parameter of the */ - /* @FT_Get_Advance and @FT_Get_Advances functions. */ - /* */ - /* If set, it indicates that you want these functions to fail if the */ - /* corresponding hinting mode or font driver doesn't allow for very */ - /* quick advance computation. */ - /* */ - /* Typically, glyphs which are either unscaled, unhinted, bitmapped, */ - /* or light-hinted can have their advance width computed very */ - /* quickly. */ - /* */ - /* Normal and bytecode hinted modes, which require loading, scaling, */ - /* and hinting of the glyph outline, are extremely slow by */ - /* comparison. */ - /* */ -#define FT_ADVANCE_FLAG_FAST_ONLY 0x20000000UL - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Get_Advance */ - /* */ - /* <Description> */ - /* Retrieve the advance value of a given glyph outline in an */ - /* @FT_Face. By default, the unhinted advance is returned in font */ - /* units. */ - /* */ - /* <Input> */ - /* face :: The source @FT_Face handle. */ - /* */ - /* gindex :: The glyph index. */ - /* */ - /* load_flags :: A set of bit flags similar to those used when */ - /* calling @FT_Load_Glyph, used to determine what kind */ - /* of advances you need. */ - /* <Output> */ - /* padvance :: The advance value, in either font units or 16.16 */ - /* format. */ - /* */ - /* If @FT_LOAD_VERTICAL_LAYOUT is set, this is the */ - /* vertical advance corresponding to a vertical layout. */ - /* Otherwise, it is the horizontal advance in a */ - /* horizontal layout. */ - /* */ - /* <Return> */ - /* FreeType error code. 0 means success. */ - /* */ - /* <Note> */ - /* This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and */ - /* if the corresponding font backend doesn't have a quick way to */ - /* retrieve the advances. */ - /* */ - /* A scaled advance is returned in 16.16 format but isn't transformed */ - /* by the affine transformation specified by @FT_Set_Transform. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Get_Advance( FT_Face face, - FT_UInt gindex, - FT_Int32 load_flags, - FT_Fixed *padvance ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Get_Advances */ - /* */ - /* <Description> */ - /* Retrieve the advance values of several glyph outlines in an */ - /* @FT_Face. By default, the unhinted advances are returned in font */ - /* units. */ - /* */ - /* <Input> */ - /* face :: The source @FT_Face handle. */ - /* */ - /* start :: The first glyph index. */ - /* */ - /* count :: The number of advance values you want to retrieve. */ - /* */ - /* load_flags :: A set of bit flags similar to those used when */ - /* calling @FT_Load_Glyph. */ - /* */ - /* <Output> */ - /* padvance :: The advances, in either font units or 16.16 format. */ - /* This array must contain at least `count' elements. */ - /* */ - /* If @FT_LOAD_VERTICAL_LAYOUT is set, these are the */ - /* vertical advances corresponding to a vertical layout. */ - /* Otherwise, they are the horizontal advances in a */ - /* horizontal layout. */ - /* */ - /* <Return> */ - /* FreeType error code. 0 means success. */ - /* */ - /* <Note> */ - /* This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and */ - /* if the corresponding font backend doesn't have a quick way to */ - /* retrieve the advances. */ - /* */ - /* Scaled advances are returned in 16.16 format but aren't */ - /* transformed by the affine transformation specified by */ - /* @FT_Set_Transform. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Get_Advances( FT_Face face, - FT_UInt start, - FT_UInt count, - FT_Int32 load_flags, - FT_Fixed *padvances ); - -/* */ - - -FT_END_HEADER - -#endif /* __FTADVANC_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftbitmap.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftbitmap.h deleted file mode 100644 index 92742369ba..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftbitmap.h +++ /dev/null @@ -1,227 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftbitmap.h */ -/* */ -/* FreeType utility functions for bitmaps (specification). */ -/* */ -/* Copyright 2004, 2005, 2006, 2008 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __FTBITMAP_H__ -#define __FTBITMAP_H__ - - -#include <ft2build.h> -#include FT_FREETYPE_H - -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - - -FT_BEGIN_HEADER - - - /*************************************************************************/ - /* */ - /* <Section> */ - /* bitmap_handling */ - /* */ - /* <Title> */ - /* Bitmap Handling */ - /* */ - /* <Abstract> */ - /* Handling FT_Bitmap objects. */ - /* */ - /* <Description> */ - /* This section contains functions for converting FT_Bitmap objects. */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Bitmap_New */ - /* */ - /* <Description> */ - /* Initialize a pointer to an @FT_Bitmap structure. */ - /* */ - /* <InOut> */ - /* abitmap :: A pointer to the bitmap structure. */ - /* */ - FT_EXPORT( void ) - FT_Bitmap_New( FT_Bitmap *abitmap ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Bitmap_Copy */ - /* */ - /* <Description> */ - /* Copy a bitmap into another one. */ - /* */ - /* <Input> */ - /* library :: A handle to a library object. */ - /* */ - /* source :: A handle to the source bitmap. */ - /* */ - /* <Output> */ - /* target :: A handle to the target bitmap. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Bitmap_Copy( FT_Library library, - const FT_Bitmap *source, - FT_Bitmap *target); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Bitmap_Embolden */ - /* */ - /* <Description> */ - /* Embolden a bitmap. The new bitmap will be about `xStrength' */ - /* pixels wider and `yStrength' pixels higher. The left and bottom */ - /* borders are kept unchanged. */ - /* */ - /* <Input> */ - /* library :: A handle to a library object. */ - /* */ - /* xStrength :: How strong the glyph is emboldened horizontally. */ - /* Expressed in 26.6 pixel format. */ - /* */ - /* yStrength :: How strong the glyph is emboldened vertically. */ - /* Expressed in 26.6 pixel format. */ - /* */ - /* <InOut> */ - /* bitmap :: A handle to the target bitmap. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - /* <Note> */ - /* The current implementation restricts `xStrength' to be less than */ - /* or equal to~8 if bitmap is of pixel_mode @FT_PIXEL_MODE_MONO. */ - /* */ - /* If you want to embolden the bitmap owned by a @FT_GlyphSlotRec, */ - /* you should call @FT_GlyphSlot_Own_Bitmap on the slot first. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Bitmap_Embolden( FT_Library library, - FT_Bitmap* bitmap, - FT_Pos xStrength, - FT_Pos yStrength ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Bitmap_Convert */ - /* */ - /* <Description> */ - /* Convert a bitmap object with depth 1bpp, 2bpp, 4bpp, or 8bpp to a */ - /* bitmap object with depth 8bpp, making the number of used bytes per */ - /* line (a.k.a. the `pitch') a multiple of `alignment'. */ - /* */ - /* <Input> */ - /* library :: A handle to a library object. */ - /* */ - /* source :: The source bitmap. */ - /* */ - /* alignment :: The pitch of the bitmap is a multiple of this */ - /* parameter. Common values are 1, 2, or 4. */ - /* */ - /* <Output> */ - /* target :: The target bitmap. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - /* <Note> */ - /* It is possible to call @FT_Bitmap_Convert multiple times without */ - /* calling @FT_Bitmap_Done (the memory is simply reallocated). */ - /* */ - /* Use @FT_Bitmap_Done to finally remove the bitmap object. */ - /* */ - /* The `library' argument is taken to have access to FreeType's */ - /* memory handling functions. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Bitmap_Convert( FT_Library library, - const FT_Bitmap *source, - FT_Bitmap *target, - FT_Int alignment ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_GlyphSlot_Own_Bitmap */ - /* */ - /* <Description> */ - /* Make sure that a glyph slot owns `slot->bitmap'. */ - /* */ - /* <Input> */ - /* slot :: The glyph slot. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - /* <Note> */ - /* This function is to be used in combination with */ - /* @FT_Bitmap_Embolden. */ - /* */ - FT_EXPORT( FT_Error ) - FT_GlyphSlot_Own_Bitmap( FT_GlyphSlot slot ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Bitmap_Done */ - /* */ - /* <Description> */ - /* Destroy a bitmap object created with @FT_Bitmap_New. */ - /* */ - /* <Input> */ - /* library :: A handle to a library object. */ - /* */ - /* bitmap :: The bitmap object to be freed. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - /* <Note> */ - /* The `library' argument is taken to have access to FreeType's */ - /* memory handling functions. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Bitmap_Done( FT_Library library, - FT_Bitmap *bitmap ); - - - /* */ - - -FT_END_HEADER - -#endif /* __FTBITMAP_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftcache.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftcache.h deleted file mode 100644 index 6af5306228..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftcache.h +++ /dev/null @@ -1,1140 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftcache.h */ -/* */ -/* FreeType Cache subsystem (specification). */ -/* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __FTCACHE_H__ -#define __FTCACHE_H__ - - -#include <ft2build.h> -#include FT_GLYPH_H - - -FT_BEGIN_HEADER - - - /************************************************************************* - * - * <Section> - * cache_subsystem - * - * <Title> - * Cache Sub-System - * - * <Abstract> - * How to cache face, size, and glyph data with FreeType~2. - * - * <Description> - * This section describes the FreeType~2 cache sub-system, which is used - * to limit the number of concurrently opened @FT_Face and @FT_Size - * objects, as well as caching information like character maps and glyph - * images while limiting their maximum memory usage. - * - * Note that all types and functions begin with the `FTC_' prefix. - * - * The cache is highly portable and thus doesn't know anything about the - * fonts installed on your system, or how to access them. This implies - * the following scheme: - * - * First, available or installed font faces are uniquely identified by - * @FTC_FaceID values, provided to the cache by the client. Note that - * the cache only stores and compares these values, and doesn't try to - * interpret them in any way. - * - * Second, the cache calls, only when needed, a client-provided function - * to convert an @FTC_FaceID into a new @FT_Face object. The latter is - * then completely managed by the cache, including its termination - * through @FT_Done_Face. To monitor termination of face objects, the - * finalizer callback in the `generic' field of the @FT_Face object can - * be used, which might also be used to store the @FTC_FaceID of the - * face. - * - * Clients are free to map face IDs to anything else. The most simple - * usage is to associate them to a (pathname,face_index) pair that is - * used to call @FT_New_Face. However, more complex schemes are also - * possible. - * - * Note that for the cache to work correctly, the face ID values must be - * *persistent*, which means that the contents they point to should not - * change at runtime, or that their value should not become invalid. - * - * If this is unavoidable (e.g., when a font is uninstalled at runtime), - * you should call @FTC_Manager_RemoveFaceID as soon as possible, to let - * the cache get rid of any references to the old @FTC_FaceID it may - * keep internally. Failure to do so will lead to incorrect behaviour - * or even crashes. - * - * To use the cache, start with calling @FTC_Manager_New to create a new - * @FTC_Manager object, which models a single cache instance. You can - * then look up @FT_Face and @FT_Size objects with - * @FTC_Manager_LookupFace and @FTC_Manager_LookupSize, respectively. - * - * If you want to use the charmap caching, call @FTC_CMapCache_New, then - * later use @FTC_CMapCache_Lookup to perform the equivalent of - * @FT_Get_Char_Index, only much faster. - * - * If you want to use the @FT_Glyph caching, call @FTC_ImageCache, then - * later use @FTC_ImageCache_Lookup to retrieve the corresponding - * @FT_Glyph objects from the cache. - * - * If you need lots of small bitmaps, it is much more memory efficient - * to call @FTC_SBitCache_New followed by @FTC_SBitCache_Lookup. This - * returns @FTC_SBitRec structures, which are used to store small - * bitmaps directly. (A small bitmap is one whose metrics and - * dimensions all fit into 8-bit integers). - * - * We hope to also provide a kerning cache in the near future. - * - * - * <Order> - * FTC_Manager - * FTC_FaceID - * FTC_Face_Requester - * - * FTC_Manager_New - * FTC_Manager_Reset - * FTC_Manager_Done - * FTC_Manager_LookupFace - * FTC_Manager_LookupSize - * FTC_Manager_RemoveFaceID - * - * FTC_Node - * FTC_Node_Unref - * - * FTC_ImageCache - * FTC_ImageCache_New - * FTC_ImageCache_Lookup - * - * FTC_SBit - * FTC_SBitCache - * FTC_SBitCache_New - * FTC_SBitCache_Lookup - * - * FTC_CMapCache - * FTC_CMapCache_New - * FTC_CMapCache_Lookup - * - *************************************************************************/ - - - /*************************************************************************/ - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** BASIC TYPE DEFINITIONS *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - /*************************************************************************/ - - - /************************************************************************* - * - * @type: FTC_FaceID - * - * @description: - * An opaque pointer type that is used to identity face objects. The - * contents of such objects is application-dependent. - * - * These pointers are typically used to point to a user-defined - * structure containing a font file path, and face index. - * - * @note: - * Never use NULL as a valid @FTC_FaceID. - * - * Face IDs are passed by the client to the cache manager, which calls, - * when needed, the @FTC_Face_Requester to translate them into new - * @FT_Face objects. - * - * If the content of a given face ID changes at runtime, or if the value - * becomes invalid (e.g., when uninstalling a font), you should - * immediately call @FTC_Manager_RemoveFaceID before any other cache - * function. - * - * Failure to do so will result in incorrect behaviour or even - * memory leaks and crashes. - */ - typedef FT_Pointer FTC_FaceID; - - - /************************************************************************ - * - * @functype: - * FTC_Face_Requester - * - * @description: - * A callback function provided by client applications. It is used by - * the cache manager to translate a given @FTC_FaceID into a new valid - * @FT_Face object, on demand. - * - * <Input> - * face_id :: - * The face ID to resolve. - * - * library :: - * A handle to a FreeType library object. - * - * req_data :: - * Application-provided request data (see note below). - * - * <Output> - * aface :: - * A new @FT_Face handle. - * - * <Return> - * FreeType error code. 0~means success. - * - * <Note> - * The third parameter `req_data' is the same as the one passed by the - * client when @FTC_Manager_New is called. - * - * The face requester should not perform funny things on the returned - * face object, like creating a new @FT_Size for it, or setting a - * transformation through @FT_Set_Transform! - */ - typedef FT_Error - (*FTC_Face_Requester)( FTC_FaceID face_id, - FT_Library library, - FT_Pointer request_data, - FT_Face* aface ); - - /* */ - -#ifdef FT_CONFIG_OPTION_OLD_INTERNALS - - /* these macros are incompatible with LLP64, should not be used */ - -#define FT_POINTER_TO_ULONG( p ) ( (FT_ULong)(FT_Pointer)(p) ) - -#define FTC_FACE_ID_HASH( i ) \ - ((FT_UInt32)(( FT_POINTER_TO_ULONG( i ) >> 3 ) ^ \ - ( FT_POINTER_TO_ULONG( i ) << 7 ) ) ) - -#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */ - - /*************************************************************************/ - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** CACHE MANAGER OBJECT *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FTC_Manager */ - /* */ - /* <Description> */ - /* This object corresponds to one instance of the cache-subsystem. */ - /* It is used to cache one or more @FT_Face objects, along with */ - /* corresponding @FT_Size objects. */ - /* */ - /* The manager intentionally limits the total number of opened */ - /* @FT_Face and @FT_Size objects to control memory usage. See the */ - /* `max_faces' and `max_sizes' parameters of @FTC_Manager_New. */ - /* */ - /* The manager is also used to cache `nodes' of various types while */ - /* limiting their total memory usage. */ - /* */ - /* All limitations are enforced by keeping lists of managed objects */ - /* in most-recently-used order, and flushing old nodes to make room */ - /* for new ones. */ - /* */ - typedef struct FTC_ManagerRec_* FTC_Manager; - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FTC_Node */ - /* */ - /* <Description> */ - /* An opaque handle to a cache node object. Each cache node is */ - /* reference-counted. A node with a count of~0 might be flushed */ - /* out of a full cache whenever a lookup request is performed. */ - /* */ - /* If you look up nodes, you have the ability to `acquire' them, */ - /* i.e., to increment their reference count. This will prevent the */ - /* node from being flushed out of the cache until you explicitly */ - /* `release' it (see @FTC_Node_Unref). */ - /* */ - /* See also @FTC_SBitCache_Lookup and @FTC_ImageCache_Lookup. */ - /* */ - typedef struct FTC_NodeRec_* FTC_Node; - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FTC_Manager_New */ - /* */ - /* <Description> */ - /* Create a new cache manager. */ - /* */ - /* <Input> */ - /* library :: The parent FreeType library handle to use. */ - /* */ - /* max_faces :: Maximum number of opened @FT_Face objects managed by */ - /* this cache instance. Use~0 for defaults. */ - /* */ - /* max_sizes :: Maximum number of opened @FT_Size objects managed by */ - /* this cache instance. Use~0 for defaults. */ - /* */ - /* max_bytes :: Maximum number of bytes to use for cached data nodes. */ - /* Use~0 for defaults. Note that this value does not */ - /* account for managed @FT_Face and @FT_Size objects. */ - /* */ - /* requester :: An application-provided callback used to translate */ - /* face IDs into real @FT_Face objects. */ - /* */ - /* req_data :: A generic pointer that is passed to the requester */ - /* each time it is called (see @FTC_Face_Requester). */ - /* */ - /* <Output> */ - /* amanager :: A handle to a new manager object. 0~in case of */ - /* failure. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - FT_EXPORT( FT_Error ) - FTC_Manager_New( FT_Library library, - FT_UInt max_faces, - FT_UInt max_sizes, - FT_ULong max_bytes, - FTC_Face_Requester requester, - FT_Pointer req_data, - FTC_Manager *amanager ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FTC_Manager_Reset */ - /* */ - /* <Description> */ - /* Empty a given cache manager. This simply gets rid of all the */ - /* currently cached @FT_Face and @FT_Size objects within the manager. */ - /* */ - /* <InOut> */ - /* manager :: A handle to the manager. */ - /* */ - FT_EXPORT( void ) - FTC_Manager_Reset( FTC_Manager manager ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FTC_Manager_Done */ - /* */ - /* <Description> */ - /* Destroy a given manager after emptying it. */ - /* */ - /* <Input> */ - /* manager :: A handle to the target cache manager object. */ - /* */ - FT_EXPORT( void ) - FTC_Manager_Done( FTC_Manager manager ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FTC_Manager_LookupFace */ - /* */ - /* <Description> */ - /* Retrieve the @FT_Face object that corresponds to a given face ID */ - /* through a cache manager. */ - /* */ - /* <Input> */ - /* manager :: A handle to the cache manager. */ - /* */ - /* face_id :: The ID of the face object. */ - /* */ - /* <Output> */ - /* aface :: A handle to the face object. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - /* <Note> */ - /* The returned @FT_Face object is always owned by the manager. You */ - /* should never try to discard it yourself. */ - /* */ - /* The @FT_Face object doesn't necessarily have a current size object */ - /* (i.e., face->size can be 0). If you need a specific `font size', */ - /* use @FTC_Manager_LookupSize instead. */ - /* */ - /* Never change the face's transformation matrix (i.e., never call */ - /* the @FT_Set_Transform function) on a returned face! If you need */ - /* to transform glyphs, do it yourself after glyph loading. */ - /* */ - /* When you perform a lookup, out-of-memory errors are detected */ - /* _within_ the lookup and force incremental flushes of the cache */ - /* until enough memory is released for the lookup to succeed. */ - /* */ - /* If a lookup fails with `FT_Err_Out_Of_Memory' the cache has */ - /* already been completely flushed, and still no memory was available */ - /* for the operation. */ - /* */ - FT_EXPORT( FT_Error ) - FTC_Manager_LookupFace( FTC_Manager manager, - FTC_FaceID face_id, - FT_Face *aface ); - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FTC_ScalerRec */ - /* */ - /* <Description> */ - /* A structure used to describe a given character size in either */ - /* pixels or points to the cache manager. See */ - /* @FTC_Manager_LookupSize. */ - /* */ - /* <Fields> */ - /* face_id :: The source face ID. */ - /* */ - /* width :: The character width. */ - /* */ - /* height :: The character height. */ - /* */ - /* pixel :: A Boolean. If 1, the `width' and `height' fields are */ - /* interpreted as integer pixel character sizes. */ - /* Otherwise, they are expressed as 1/64th of points. */ - /* */ - /* x_res :: Only used when `pixel' is value~0 to indicate the */ - /* horizontal resolution in dpi. */ - /* */ - /* y_res :: Only used when `pixel' is value~0 to indicate the */ - /* vertical resolution in dpi. */ - /* */ - /* <Note> */ - /* This type is mainly used to retrieve @FT_Size objects through the */ - /* cache manager. */ - /* */ - typedef struct FTC_ScalerRec_ - { - FTC_FaceID face_id; - FT_UInt width; - FT_UInt height; - FT_Int pixel; - FT_UInt x_res; - FT_UInt y_res; - - } FTC_ScalerRec; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FTC_Scaler */ - /* */ - /* <Description> */ - /* A handle to an @FTC_ScalerRec structure. */ - /* */ - typedef struct FTC_ScalerRec_* FTC_Scaler; - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FTC_Manager_LookupSize */ - /* */ - /* <Description> */ - /* Retrieve the @FT_Size object that corresponds to a given */ - /* @FTC_ScalerRec pointer through a cache manager. */ - /* */ - /* <Input> */ - /* manager :: A handle to the cache manager. */ - /* */ - /* scaler :: A scaler handle. */ - /* */ - /* <Output> */ - /* asize :: A handle to the size object. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - /* <Note> */ - /* The returned @FT_Size object is always owned by the manager. You */ - /* should never try to discard it by yourself. */ - /* */ - /* You can access the parent @FT_Face object simply as `size->face' */ - /* if you need it. Note that this object is also owned by the */ - /* manager. */ - /* */ - /* <Note> */ - /* When you perform a lookup, out-of-memory errors are detected */ - /* _within_ the lookup and force incremental flushes of the cache */ - /* until enough memory is released for the lookup to succeed. */ - /* */ - /* If a lookup fails with `FT_Err_Out_Of_Memory' the cache has */ - /* already been completely flushed, and still no memory is available */ - /* for the operation. */ - /* */ - FT_EXPORT( FT_Error ) - FTC_Manager_LookupSize( FTC_Manager manager, - FTC_Scaler scaler, - FT_Size *asize ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FTC_Node_Unref */ - /* */ - /* <Description> */ - /* Decrement a cache node's internal reference count. When the count */ - /* reaches 0, it is not destroyed but becomes eligible for subsequent */ - /* cache flushes. */ - /* */ - /* <Input> */ - /* node :: The cache node handle. */ - /* */ - /* manager :: The cache manager handle. */ - /* */ - FT_EXPORT( void ) - FTC_Node_Unref( FTC_Node node, - FTC_Manager manager ); - - - /************************************************************************* - * - * @function: - * FTC_Manager_RemoveFaceID - * - * @description: - * A special function used to indicate to the cache manager that - * a given @FTC_FaceID is no longer valid, either because its - * content changed, or because it was deallocated or uninstalled. - * - * @input: - * manager :: - * The cache manager handle. - * - * face_id :: - * The @FTC_FaceID to be removed. - * - * @note: - * This function flushes all nodes from the cache corresponding to this - * `face_id', with the exception of nodes with a non-null reference - * count. - * - * Such nodes are however modified internally so as to never appear - * in later lookups with the same `face_id' value, and to be immediately - * destroyed when released by all their users. - * - */ - FT_EXPORT( void ) - FTC_Manager_RemoveFaceID( FTC_Manager manager, - FTC_FaceID face_id ); - - - /*************************************************************************/ - /* */ - /* <Section> */ - /* cache_subsystem */ - /* */ - /*************************************************************************/ - - /************************************************************************* - * - * @type: - * FTC_CMapCache - * - * @description: - * An opaque handle used to model a charmap cache. This cache is to - * hold character codes -> glyph indices mappings. - * - */ - typedef struct FTC_CMapCacheRec_* FTC_CMapCache; - - - /************************************************************************* - * - * @function: - * FTC_CMapCache_New - * - * @description: - * Create a new charmap cache. - * - * @input: - * manager :: - * A handle to the cache manager. - * - * @output: - * acache :: - * A new cache handle. NULL in case of error. - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * Like all other caches, this one will be destroyed with the cache - * manager. - * - */ - FT_EXPORT( FT_Error ) - FTC_CMapCache_New( FTC_Manager manager, - FTC_CMapCache *acache ); - - - /************************************************************************ - * - * @function: - * FTC_CMapCache_Lookup - * - * @description: - * Translate a character code into a glyph index, using the charmap - * cache. - * - * @input: - * cache :: - * A charmap cache handle. - * - * face_id :: - * The source face ID. - * - * cmap_index :: - * The index of the charmap in the source face. Any negative value - * means to use the cache @FT_Face's default charmap. - * - * char_code :: - * The character code (in the corresponding charmap). - * - * @return: - * Glyph index. 0~means `no glyph'. - * - */ - FT_EXPORT( FT_UInt ) - FTC_CMapCache_Lookup( FTC_CMapCache cache, - FTC_FaceID face_id, - FT_Int cmap_index, - FT_UInt32 char_code ); - - - /*************************************************************************/ - /* */ - /* <Section> */ - /* cache_subsystem */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** IMAGE CACHE OBJECT *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - /*************************************************************************/ - - - /************************************************************************* - * - * @struct: - * FTC_ImageTypeRec - * - * @description: - * A structure used to model the type of images in a glyph cache. - * - * @fields: - * face_id :: - * The face ID. - * - * width :: - * The width in pixels. - * - * height :: - * The height in pixels. - * - * flags :: - * The load flags, as in @FT_Load_Glyph. - * - */ - typedef struct FTC_ImageTypeRec_ - { - FTC_FaceID face_id; - FT_Int width; - FT_Int height; - FT_Int32 flags; - - } FTC_ImageTypeRec; - - - /************************************************************************* - * - * @type: - * FTC_ImageType - * - * @description: - * A handle to an @FTC_ImageTypeRec structure. - * - */ - typedef struct FTC_ImageTypeRec_* FTC_ImageType; - - - /* */ - - -#define FTC_IMAGE_TYPE_COMPARE( d1, d2 ) \ - ( (d1)->face_id == (d2)->face_id && \ - (d1)->width == (d2)->width && \ - (d1)->flags == (d2)->flags ) - -#ifdef FT_CONFIG_OPTION_OLD_INTERNALS - - /* this macro is incompatible with LLP64, should not be used */ - -#define FTC_IMAGE_TYPE_HASH( d ) \ - (FT_UFast)( FTC_FACE_ID_HASH( (d)->face_id ) ^ \ - ( (d)->width << 8 ) ^ (d)->height ^ \ - ( (d)->flags << 4 ) ) - -#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */ - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FTC_ImageCache */ - /* */ - /* <Description> */ - /* A handle to an glyph image cache object. They are designed to */ - /* hold many distinct glyph images while not exceeding a certain */ - /* memory threshold. */ - /* */ - typedef struct FTC_ImageCacheRec_* FTC_ImageCache; - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FTC_ImageCache_New */ - /* */ - /* <Description> */ - /* Create a new glyph image cache. */ - /* */ - /* <Input> */ - /* manager :: The parent manager for the image cache. */ - /* */ - /* <Output> */ - /* acache :: A handle to the new glyph image cache object. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - FT_EXPORT( FT_Error ) - FTC_ImageCache_New( FTC_Manager manager, - FTC_ImageCache *acache ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FTC_ImageCache_Lookup */ - /* */ - /* <Description> */ - /* Retrieve a given glyph image from a glyph image cache. */ - /* */ - /* <Input> */ - /* cache :: A handle to the source glyph image cache. */ - /* */ - /* type :: A pointer to a glyph image type descriptor. */ - /* */ - /* gindex :: The glyph index to retrieve. */ - /* */ - /* <Output> */ - /* aglyph :: The corresponding @FT_Glyph object. 0~in case of */ - /* failure. */ - /* */ - /* anode :: Used to return the address of of the corresponding cache */ - /* node after incrementing its reference count (see note */ - /* below). */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - /* <Note> */ - /* The returned glyph is owned and managed by the glyph image cache. */ - /* Never try to transform or discard it manually! You can however */ - /* create a copy with @FT_Glyph_Copy and modify the new one. */ - /* */ - /* If `anode' is _not_ NULL, it receives the address of the cache */ - /* node containing the glyph image, after increasing its reference */ - /* count. This ensures that the node (as well as the @FT_Glyph) will */ - /* always be kept in the cache until you call @FTC_Node_Unref to */ - /* `release' it. */ - /* */ - /* If `anode' is NULL, the cache node is left unchanged, which means */ - /* that the @FT_Glyph could be flushed out of the cache on the next */ - /* call to one of the caching sub-system APIs. Don't assume that it */ - /* is persistent! */ - /* */ - FT_EXPORT( FT_Error ) - FTC_ImageCache_Lookup( FTC_ImageCache cache, - FTC_ImageType type, - FT_UInt gindex, - FT_Glyph *aglyph, - FTC_Node *anode ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FTC_ImageCache_LookupScaler */ - /* */ - /* <Description> */ - /* A variant of @FTC_ImageCache_Lookup that uses an @FTC_ScalerRec */ - /* to specify the face ID and its size. */ - /* */ - /* <Input> */ - /* cache :: A handle to the source glyph image cache. */ - /* */ - /* scaler :: A pointer to a scaler descriptor. */ - /* */ - /* load_flags :: The corresponding load flags. */ - /* */ - /* gindex :: The glyph index to retrieve. */ - /* */ - /* <Output> */ - /* aglyph :: The corresponding @FT_Glyph object. 0~in case of */ - /* failure. */ - /* */ - /* anode :: Used to return the address of of the corresponding */ - /* cache node after incrementing its reference count */ - /* (see note below). */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - /* <Note> */ - /* The returned glyph is owned and managed by the glyph image cache. */ - /* Never try to transform or discard it manually! You can however */ - /* create a copy with @FT_Glyph_Copy and modify the new one. */ - /* */ - /* If `anode' is _not_ NULL, it receives the address of the cache */ - /* node containing the glyph image, after increasing its reference */ - /* count. This ensures that the node (as well as the @FT_Glyph) will */ - /* always be kept in the cache until you call @FTC_Node_Unref to */ - /* `release' it. */ - /* */ - /* If `anode' is NULL, the cache node is left unchanged, which means */ - /* that the @FT_Glyph could be flushed out of the cache on the next */ - /* call to one of the caching sub-system APIs. Don't assume that it */ - /* is persistent! */ - /* */ - /* Calls to @FT_Set_Char_Size and friends have no effect on cached */ - /* glyphs; you should always use the FreeType cache API instead. */ - /* */ - FT_EXPORT( FT_Error ) - FTC_ImageCache_LookupScaler( FTC_ImageCache cache, - FTC_Scaler scaler, - FT_ULong load_flags, - FT_UInt gindex, - FT_Glyph *aglyph, - FTC_Node *anode ); - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FTC_SBit */ - /* */ - /* <Description> */ - /* A handle to a small bitmap descriptor. See the @FTC_SBitRec */ - /* structure for details. */ - /* */ - typedef struct FTC_SBitRec_* FTC_SBit; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FTC_SBitRec */ - /* */ - /* <Description> */ - /* A very compact structure used to describe a small glyph bitmap. */ - /* */ - /* <Fields> */ - /* width :: The bitmap width in pixels. */ - /* */ - /* height :: The bitmap height in pixels. */ - /* */ - /* left :: The horizontal distance from the pen position to the */ - /* left bitmap border (a.k.a. `left side bearing', or */ - /* `lsb'). */ - /* */ - /* top :: The vertical distance from the pen position (on the */ - /* baseline) to the upper bitmap border (a.k.a. `top */ - /* side bearing'). The distance is positive for upwards */ - /* y~coordinates. */ - /* */ - /* format :: The format of the glyph bitmap (monochrome or gray). */ - /* */ - /* max_grays :: Maximum gray level value (in the range 1 to~255). */ - /* */ - /* pitch :: The number of bytes per bitmap line. May be positive */ - /* or negative. */ - /* */ - /* xadvance :: The horizontal advance width in pixels. */ - /* */ - /* yadvance :: The vertical advance height in pixels. */ - /* */ - /* buffer :: A pointer to the bitmap pixels. */ - /* */ - typedef struct FTC_SBitRec_ - { - FT_Byte width; - FT_Byte height; - FT_Char left; - FT_Char top; - - FT_Byte format; - FT_Byte max_grays; - FT_Short pitch; - FT_Char xadvance; - FT_Char yadvance; - - FT_Byte* buffer; - - } FTC_SBitRec; - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FTC_SBitCache */ - /* */ - /* <Description> */ - /* A handle to a small bitmap cache. These are special cache objects */ - /* used to store small glyph bitmaps (and anti-aliased pixmaps) in a */ - /* much more efficient way than the traditional glyph image cache */ - /* implemented by @FTC_ImageCache. */ - /* */ - typedef struct FTC_SBitCacheRec_* FTC_SBitCache; - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FTC_SBitCache_New */ - /* */ - /* <Description> */ - /* Create a new cache to store small glyph bitmaps. */ - /* */ - /* <Input> */ - /* manager :: A handle to the source cache manager. */ - /* */ - /* <Output> */ - /* acache :: A handle to the new sbit cache. NULL in case of error. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - FT_EXPORT( FT_Error ) - FTC_SBitCache_New( FTC_Manager manager, - FTC_SBitCache *acache ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FTC_SBitCache_Lookup */ - /* */ - /* <Description> */ - /* Look up a given small glyph bitmap in a given sbit cache and */ - /* `lock' it to prevent its flushing from the cache until needed. */ - /* */ - /* <Input> */ - /* cache :: A handle to the source sbit cache. */ - /* */ - /* type :: A pointer to the glyph image type descriptor. */ - /* */ - /* gindex :: The glyph index. */ - /* */ - /* <Output> */ - /* sbit :: A handle to a small bitmap descriptor. */ - /* */ - /* anode :: Used to return the address of of the corresponding cache */ - /* node after incrementing its reference count (see note */ - /* below). */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - /* <Note> */ - /* The small bitmap descriptor and its bit buffer are owned by the */ - /* cache and should never be freed by the application. They might */ - /* as well disappear from memory on the next cache lookup, so don't */ - /* treat them as persistent data. */ - /* */ - /* The descriptor's `buffer' field is set to~0 to indicate a missing */ - /* glyph bitmap. */ - /* */ - /* If `anode' is _not_ NULL, it receives the address of the cache */ - /* node containing the bitmap, after increasing its reference count. */ - /* This ensures that the node (as well as the image) will always be */ - /* kept in the cache until you call @FTC_Node_Unref to `release' it. */ - /* */ - /* If `anode' is NULL, the cache node is left unchanged, which means */ - /* that the bitmap could be flushed out of the cache on the next */ - /* call to one of the caching sub-system APIs. Don't assume that it */ - /* is persistent! */ - /* */ - FT_EXPORT( FT_Error ) - FTC_SBitCache_Lookup( FTC_SBitCache cache, - FTC_ImageType type, - FT_UInt gindex, - FTC_SBit *sbit, - FTC_Node *anode ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FTC_SBitCache_LookupScaler */ - /* */ - /* <Description> */ - /* A variant of @FTC_SBitCache_Lookup that uses an @FTC_ScalerRec */ - /* to specify the face ID and its size. */ - /* */ - /* <Input> */ - /* cache :: A handle to the source sbit cache. */ - /* */ - /* scaler :: A pointer to the scaler descriptor. */ - /* */ - /* load_flags :: The corresponding load flags. */ - /* */ - /* gindex :: The glyph index. */ - /* */ - /* <Output> */ - /* sbit :: A handle to a small bitmap descriptor. */ - /* */ - /* anode :: Used to return the address of of the corresponding */ - /* cache node after incrementing its reference count */ - /* (see note below). */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - /* <Note> */ - /* The small bitmap descriptor and its bit buffer are owned by the */ - /* cache and should never be freed by the application. They might */ - /* as well disappear from memory on the next cache lookup, so don't */ - /* treat them as persistent data. */ - /* */ - /* The descriptor's `buffer' field is set to~0 to indicate a missing */ - /* glyph bitmap. */ - /* */ - /* If `anode' is _not_ NULL, it receives the address of the cache */ - /* node containing the bitmap, after increasing its reference count. */ - /* This ensures that the node (as well as the image) will always be */ - /* kept in the cache until you call @FTC_Node_Unref to `release' it. */ - /* */ - /* If `anode' is NULL, the cache node is left unchanged, which means */ - /* that the bitmap could be flushed out of the cache on the next */ - /* call to one of the caching sub-system APIs. Don't assume that it */ - /* is persistent! */ - /* */ - FT_EXPORT( FT_Error ) - FTC_SBitCache_LookupScaler( FTC_SBitCache cache, - FTC_Scaler scaler, - FT_ULong load_flags, - FT_UInt gindex, - FTC_SBit *sbit, - FTC_Node *anode ); - - - /* */ - -#ifdef FT_CONFIG_OPTION_OLD_INTERNALS - - /*@***********************************************************************/ - /* */ - /* <Struct> */ - /* FTC_FontRec */ - /* */ - /* <Description> */ - /* A simple structure used to describe a given `font' to the cache */ - /* manager. Note that a `font' is the combination of a given face */ - /* with a given character size. */ - /* */ - /* <Fields> */ - /* face_id :: The ID of the face to use. */ - /* */ - /* pix_width :: The character width in integer pixels. */ - /* */ - /* pix_height :: The character height in integer pixels. */ - /* */ - typedef struct FTC_FontRec_ - { - FTC_FaceID face_id; - FT_UShort pix_width; - FT_UShort pix_height; - - } FTC_FontRec; - - - /* */ - - -#define FTC_FONT_COMPARE( f1, f2 ) \ - ( (f1)->face_id == (f2)->face_id && \ - (f1)->pix_width == (f2)->pix_width && \ - (f1)->pix_height == (f2)->pix_height ) - - /* this macro is incompatible with LLP64, should not be used */ -#define FTC_FONT_HASH( f ) \ - (FT_UInt32)( FTC_FACE_ID_HASH((f)->face_id) ^ \ - ((f)->pix_width << 8) ^ \ - ((f)->pix_height) ) - - typedef FTC_FontRec* FTC_Font; - - - FT_EXPORT( FT_Error ) - FTC_Manager_Lookup_Face( FTC_Manager manager, - FTC_FaceID face_id, - FT_Face *aface ); - - FT_EXPORT( FT_Error ) - FTC_Manager_Lookup_Size( FTC_Manager manager, - FTC_Font font, - FT_Face *aface, - FT_Size *asize ); - -#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */ - - - /* */ - -FT_END_HEADER - -#endif /* __FTCACHE_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftchapters.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftchapters.h deleted file mode 100644 index 6cdf54e495..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftchapters.h +++ /dev/null @@ -1,104 +0,0 @@ -/***************************************************************************/ -/* */ -/* This file defines the structure of the FreeType reference. */ -/* It is used by the python script which generates the HTML files. */ -/* */ -/***************************************************************************/ - - -/***************************************************************************/ -/* */ -/* <Chapter> */ -/* general_remarks */ -/* */ -/* <Title> */ -/* General Remarks */ -/* */ -/* <Sections> */ -/* user_allocation */ -/* */ -/***************************************************************************/ - - -/***************************************************************************/ -/* */ -/* <Chapter> */ -/* core_api */ -/* */ -/* <Title> */ -/* Core API */ -/* */ -/* <Sections> */ -/* version */ -/* basic_types */ -/* base_interface */ -/* glyph_variants */ -/* glyph_management */ -/* mac_specific */ -/* sizes_management */ -/* header_file_macros */ -/* */ -/***************************************************************************/ - - -/***************************************************************************/ -/* */ -/* <Chapter> */ -/* format_specific */ -/* */ -/* <Title> */ -/* Format-Specific API */ -/* */ -/* <Sections> */ -/* multiple_masters */ -/* truetype_tables */ -/* type1_tables */ -/* sfnt_names */ -/* bdf_fonts */ -/* cid_fonts */ -/* pfr_fonts */ -/* winfnt_fonts */ -/* font_formats */ -/* gasp_table */ -/* */ -/***************************************************************************/ - - -/***************************************************************************/ -/* */ -/* <Chapter> */ -/* cache_subsystem */ -/* */ -/* <Title> */ -/* Cache Sub-System */ -/* */ -/* <Sections> */ -/* cache_subsystem */ -/* */ -/***************************************************************************/ - - -/***************************************************************************/ -/* */ -/* <Chapter> */ -/* support_api */ -/* */ -/* <Title> */ -/* Support API */ -/* */ -/* <Sections> */ -/* computations */ -/* list_processing */ -/* outline_processing */ -/* quick_advance */ -/* bitmap_handling */ -/* raster */ -/* glyph_stroker */ -/* system_interface */ -/* module_management */ -/* gzip */ -/* lzw */ -/* bzip2 */ -/* lcd_filtering */ -/* */ -/***************************************************************************/ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/fterrdef.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/fterrdef.h deleted file mode 100644 index fb4b53bca0..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/fterrdef.h +++ /dev/null @@ -1,245 +0,0 @@ -/***************************************************************************/ -/* */ -/* fterrdef.h */ -/* */ -/* FreeType error codes (specification). */ -/* */ -/* Copyright 2002, 2004, 2006, 2007, 2010-2011 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - - /*******************************************************************/ - /*******************************************************************/ - /***** *****/ - /***** LIST OF ERROR CODES/MESSAGES *****/ - /***** *****/ - /*******************************************************************/ - /*******************************************************************/ - - - /* You need to define both FT_ERRORDEF_ and FT_NOERRORDEF_ before */ - /* including this file. */ - - - /* generic errors */ - - FT_NOERRORDEF_( Ok, 0x00, \ - "no error" ) - - FT_ERRORDEF_( Cannot_Open_Resource, 0x01, \ - "cannot open resource" ) - FT_ERRORDEF_( Unknown_File_Format, 0x02, \ - "unknown file format" ) - FT_ERRORDEF_( Invalid_File_Format, 0x03, \ - "broken file" ) - FT_ERRORDEF_( Invalid_Version, 0x04, \ - "invalid FreeType version" ) - FT_ERRORDEF_( Lower_Module_Version, 0x05, \ - "module version is too low" ) - FT_ERRORDEF_( Invalid_Argument, 0x06, \ - "invalid argument" ) - FT_ERRORDEF_( Unimplemented_Feature, 0x07, \ - "unimplemented feature" ) - FT_ERRORDEF_( Invalid_Table, 0x08, \ - "broken table" ) - FT_ERRORDEF_( Invalid_Offset, 0x09, \ - "broken offset within table" ) - FT_ERRORDEF_( Array_Too_Large, 0x0A, \ - "array allocation size too large" ) - FT_ERRORDEF_( Missing_Module, 0x0B, \ - "missing module" ) - - /* glyph/character errors */ - - FT_ERRORDEF_( Invalid_Glyph_Index, 0x10, \ - "invalid glyph index" ) - FT_ERRORDEF_( Invalid_Character_Code, 0x11, \ - "invalid character code" ) - FT_ERRORDEF_( Invalid_Glyph_Format, 0x12, \ - "unsupported glyph image format" ) - FT_ERRORDEF_( Cannot_Render_Glyph, 0x13, \ - "cannot render this glyph format" ) - FT_ERRORDEF_( Invalid_Outline, 0x14, \ - "invalid outline" ) - FT_ERRORDEF_( Invalid_Composite, 0x15, \ - "invalid composite glyph" ) - FT_ERRORDEF_( Too_Many_Hints, 0x16, \ - "too many hints" ) - FT_ERRORDEF_( Invalid_Pixel_Size, 0x17, \ - "invalid pixel size" ) - - /* handle errors */ - - FT_ERRORDEF_( Invalid_Handle, 0x20, \ - "invalid object handle" ) - FT_ERRORDEF_( Invalid_Library_Handle, 0x21, \ - "invalid library handle" ) - FT_ERRORDEF_( Invalid_Driver_Handle, 0x22, \ - "invalid module handle" ) - FT_ERRORDEF_( Invalid_Face_Handle, 0x23, \ - "invalid face handle" ) - FT_ERRORDEF_( Invalid_Size_Handle, 0x24, \ - "invalid size handle" ) - FT_ERRORDEF_( Invalid_Slot_Handle, 0x25, \ - "invalid glyph slot handle" ) - FT_ERRORDEF_( Invalid_CharMap_Handle, 0x26, \ - "invalid charmap handle" ) - FT_ERRORDEF_( Invalid_Cache_Handle, 0x27, \ - "invalid cache manager handle" ) - FT_ERRORDEF_( Invalid_Stream_Handle, 0x28, \ - "invalid stream handle" ) - - /* driver errors */ - - FT_ERRORDEF_( Too_Many_Drivers, 0x30, \ - "too many modules" ) - FT_ERRORDEF_( Too_Many_Extensions, 0x31, \ - "too many extensions" ) - - /* memory errors */ - - FT_ERRORDEF_( Out_Of_Memory, 0x40, \ - "out of memory" ) - FT_ERRORDEF_( Unlisted_Object, 0x41, \ - "unlisted object" ) - - /* stream errors */ - - FT_ERRORDEF_( Cannot_Open_Stream, 0x51, \ - "cannot open stream" ) - FT_ERRORDEF_( Invalid_Stream_Seek, 0x52, \ - "invalid stream seek" ) - FT_ERRORDEF_( Invalid_Stream_Skip, 0x53, \ - "invalid stream skip" ) - FT_ERRORDEF_( Invalid_Stream_Read, 0x54, \ - "invalid stream read" ) - FT_ERRORDEF_( Invalid_Stream_Operation, 0x55, \ - "invalid stream operation" ) - FT_ERRORDEF_( Invalid_Frame_Operation, 0x56, \ - "invalid frame operation" ) - FT_ERRORDEF_( Nested_Frame_Access, 0x57, \ - "nested frame access" ) - FT_ERRORDEF_( Invalid_Frame_Read, 0x58, \ - "invalid frame read" ) - - /* raster errors */ - - FT_ERRORDEF_( Raster_Uninitialized, 0x60, \ - "raster uninitialized" ) - FT_ERRORDEF_( Raster_Corrupted, 0x61, \ - "raster corrupted" ) - FT_ERRORDEF_( Raster_Overflow, 0x62, \ - "raster overflow" ) - FT_ERRORDEF_( Raster_Negative_Height, 0x63, \ - "negative height while rastering" ) - - /* cache errors */ - - FT_ERRORDEF_( Too_Many_Caches, 0x70, \ - "too many registered caches" ) - - /* TrueType and SFNT errors */ - - FT_ERRORDEF_( Invalid_Opcode, 0x80, \ - "invalid opcode" ) - FT_ERRORDEF_( Too_Few_Arguments, 0x81, \ - "too few arguments" ) - FT_ERRORDEF_( Stack_Overflow, 0x82, \ - "stack overflow" ) - FT_ERRORDEF_( Code_Overflow, 0x83, \ - "code overflow" ) - FT_ERRORDEF_( Bad_Argument, 0x84, \ - "bad argument" ) - FT_ERRORDEF_( Divide_By_Zero, 0x85, \ - "division by zero" ) - FT_ERRORDEF_( Invalid_Reference, 0x86, \ - "invalid reference" ) - FT_ERRORDEF_( Debug_OpCode, 0x87, \ - "found debug opcode" ) - FT_ERRORDEF_( ENDF_In_Exec_Stream, 0x88, \ - "found ENDF opcode in execution stream" ) - FT_ERRORDEF_( Nested_DEFS, 0x89, \ - "nested DEFS" ) - FT_ERRORDEF_( Invalid_CodeRange, 0x8A, \ - "invalid code range" ) - FT_ERRORDEF_( Execution_Too_Long, 0x8B, \ - "execution context too long" ) - FT_ERRORDEF_( Too_Many_Function_Defs, 0x8C, \ - "too many function definitions" ) - FT_ERRORDEF_( Too_Many_Instruction_Defs, 0x8D, \ - "too many instruction definitions" ) - FT_ERRORDEF_( Table_Missing, 0x8E, \ - "SFNT font table missing" ) - FT_ERRORDEF_( Horiz_Header_Missing, 0x8F, \ - "horizontal header (hhea) table missing" ) - FT_ERRORDEF_( Locations_Missing, 0x90, \ - "locations (loca) table missing" ) - FT_ERRORDEF_( Name_Table_Missing, 0x91, \ - "name table missing" ) - FT_ERRORDEF_( CMap_Table_Missing, 0x92, \ - "character map (cmap) table missing" ) - FT_ERRORDEF_( Hmtx_Table_Missing, 0x93, \ - "horizontal metrics (hmtx) table missing" ) - FT_ERRORDEF_( Post_Table_Missing, 0x94, \ - "PostScript (post) table missing" ) - FT_ERRORDEF_( Invalid_Horiz_Metrics, 0x95, \ - "invalid horizontal metrics" ) - FT_ERRORDEF_( Invalid_CharMap_Format, 0x96, \ - "invalid character map (cmap) format" ) - FT_ERRORDEF_( Invalid_PPem, 0x97, \ - "invalid ppem value" ) - FT_ERRORDEF_( Invalid_Vert_Metrics, 0x98, \ - "invalid vertical metrics" ) - FT_ERRORDEF_( Could_Not_Find_Context, 0x99, \ - "could not find context" ) - FT_ERRORDEF_( Invalid_Post_Table_Format, 0x9A, \ - "invalid PostScript (post) table format" ) - FT_ERRORDEF_( Invalid_Post_Table, 0x9B, \ - "invalid PostScript (post) table" ) - - /* CFF, CID, and Type 1 errors */ - - FT_ERRORDEF_( Syntax_Error, 0xA0, \ - "opcode syntax error" ) - FT_ERRORDEF_( Stack_Underflow, 0xA1, \ - "argument stack underflow" ) - FT_ERRORDEF_( Ignore, 0xA2, \ - "ignore" ) - FT_ERRORDEF_( No_Unicode_Glyph_Name, 0xA3, \ - "no Unicode glyph name found" ) - - /* BDF errors */ - - FT_ERRORDEF_( Missing_Startfont_Field, 0xB0, \ - "`STARTFONT' field missing" ) - FT_ERRORDEF_( Missing_Font_Field, 0xB1, \ - "`FONT' field missing" ) - FT_ERRORDEF_( Missing_Size_Field, 0xB2, \ - "`SIZE' field missing" ) - FT_ERRORDEF_( Missing_Fontboundingbox_Field, 0xB3, \ - "`FONTBOUNDINGBOX' field missing" ) - FT_ERRORDEF_( Missing_Chars_Field, 0xB4, \ - "`CHARS' field missing" ) - FT_ERRORDEF_( Missing_Startchar_Field, 0xB5, \ - "`STARTCHAR' field missing" ) - FT_ERRORDEF_( Missing_Encoding_Field, 0xB6, \ - "`ENCODING' field missing" ) - FT_ERRORDEF_( Missing_Bbx_Field, 0xB7, \ - "`BBX' field missing" ) - FT_ERRORDEF_( Bbx_Too_Big, 0xB8, \ - "`BBX' too big" ) - FT_ERRORDEF_( Corrupted_Font_Header, 0xB9, \ - "Font header corrupted or missing fields" ) - FT_ERRORDEF_( Corrupted_Font_Glyphs, 0xBA, \ - "Font glyphs corrupted or missing fields" ) - - -/* END */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/fterrors.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/fterrors.h deleted file mode 100644 index a54699f87f..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/fterrors.h +++ /dev/null @@ -1,207 +0,0 @@ -/***************************************************************************/ -/* */ -/* fterrors.h */ -/* */ -/* FreeType error code handling (specification). */ -/* */ -/* Copyright 1996-2001, 2002, 2004, 2007 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - - /*************************************************************************/ - /* */ - /* This special header file is used to define the handling of FT2 */ - /* enumeration constants. It can also be used to generate error message */ - /* strings with a small macro trick explained below. */ - /* */ - /* I - Error Formats */ - /* ----------------- */ - /* */ - /* The configuration macro FT_CONFIG_OPTION_USE_MODULE_ERRORS can be */ - /* defined in ftoption.h in order to make the higher byte indicate */ - /* the module where the error has happened (this is not compatible */ - /* with standard builds of FreeType 2). You can then use the macro */ - /* FT_ERROR_BASE macro to extract the generic error code from an */ - /* FT_Error value. */ - /* */ - /* */ - /* II - Error Message strings */ - /* -------------------------- */ - /* */ - /* The error definitions below are made through special macros that */ - /* allow client applications to build a table of error message strings */ - /* if they need it. The strings are not included in a normal build of */ - /* FreeType 2 to save space (most client applications do not use */ - /* them). */ - /* */ - /* To do so, you have to define the following macros before including */ - /* this file: */ - /* */ - /* FT_ERROR_START_LIST :: */ - /* This macro is called before anything else to define the start of */ - /* the error list. It is followed by several FT_ERROR_DEF calls */ - /* (see below). */ - /* */ - /* FT_ERROR_DEF( e, v, s ) :: */ - /* This macro is called to define one single error. */ - /* `e' is the error code identifier (e.g. FT_Err_Invalid_Argument). */ - /* `v' is the error numerical value. */ - /* `s' is the corresponding error string. */ - /* */ - /* FT_ERROR_END_LIST :: */ - /* This macro ends the list. */ - /* */ - /* Additionally, you have to undefine __FTERRORS_H__ before #including */ - /* this file. */ - /* */ - /* Here is a simple example: */ - /* */ - /* { */ - /* #undef __FTERRORS_H__ */ - /* #define FT_ERRORDEF( e, v, s ) { e, s }, */ - /* #define FT_ERROR_START_LIST { */ - /* #define FT_ERROR_END_LIST { 0, 0 } }; */ - /* */ - /* const struct */ - /* { */ - /* int err_code; */ - /* const char* err_msg; */ - /* } ft_errors[] = */ - /* */ - /* #include FT_ERRORS_H */ - /* } */ - /* */ - /*************************************************************************/ - - -#ifndef __FTERRORS_H__ -#define __FTERRORS_H__ - - - /* include module base error codes */ -#include FT_MODULE_ERRORS_H - - - /*******************************************************************/ - /*******************************************************************/ - /***** *****/ - /***** SETUP MACROS *****/ - /***** *****/ - /*******************************************************************/ - /*******************************************************************/ - - -#undef FT_NEED_EXTERN_C - -#undef FT_ERR_XCAT -#undef FT_ERR_CAT - -#define FT_ERR_XCAT( x, y ) x ## y -#define FT_ERR_CAT( x, y ) FT_ERR_XCAT( x, y ) - - - /* FT_ERR_PREFIX is used as a prefix for error identifiers. */ - /* By default, we use `FT_Err_'. */ - /* */ -#ifndef FT_ERR_PREFIX -#define FT_ERR_PREFIX FT_Err_ -#endif - - - /* FT_ERR_BASE is used as the base for module-specific errors. */ - /* */ -#ifdef FT_CONFIG_OPTION_USE_MODULE_ERRORS - -#ifndef FT_ERR_BASE -#define FT_ERR_BASE FT_Mod_Err_Base -#endif - -#else - -#undef FT_ERR_BASE -#define FT_ERR_BASE 0 - -#endif /* FT_CONFIG_OPTION_USE_MODULE_ERRORS */ - - - /* If FT_ERRORDEF is not defined, we need to define a simple */ - /* enumeration type. */ - /* */ -#ifndef FT_ERRORDEF - -#define FT_ERRORDEF( e, v, s ) e = v, -#define FT_ERROR_START_LIST enum { -#define FT_ERROR_END_LIST FT_ERR_CAT( FT_ERR_PREFIX, Max ) }; - -#ifdef __cplusplus -#define FT_NEED_EXTERN_C - extern "C" { -#endif - -#endif /* !FT_ERRORDEF */ - - - /* this macro is used to define an error */ -#define FT_ERRORDEF_( e, v, s ) \ - FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v + FT_ERR_BASE, s ) - - /* this is only used for <module>_Err_Ok, which must be 0! */ -#define FT_NOERRORDEF_( e, v, s ) \ - FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v, s ) - - -#ifdef FT_ERROR_START_LIST - FT_ERROR_START_LIST -#endif - - - /* now include the error codes */ -#include FT_ERROR_DEFINITIONS_H - - -#ifdef FT_ERROR_END_LIST - FT_ERROR_END_LIST -#endif - - - /*******************************************************************/ - /*******************************************************************/ - /***** *****/ - /***** SIMPLE CLEANUP *****/ - /***** *****/ - /*******************************************************************/ - /*******************************************************************/ - -#ifdef FT_NEED_EXTERN_C - } -#endif - -#undef FT_ERROR_START_LIST -#undef FT_ERROR_END_LIST - -#undef FT_ERRORDEF -#undef FT_ERRORDEF_ -#undef FT_NOERRORDEF_ - -#undef FT_NEED_EXTERN_C -#undef FT_ERR_BASE - - /* FT_KEEP_ERR_PREFIX is needed for ftvalid.h */ -#ifndef FT_KEEP_ERR_PREFIX -#undef FT_ERR_PREFIX -#else -#undef FT_KEEP_ERR_PREFIX -#endif - -#endif /* __FTERRORS_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftglyph.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftglyph.h deleted file mode 100644 index 3de69f7aed..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftglyph.h +++ /dev/null @@ -1,620 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftglyph.h */ -/* */ -/* FreeType convenience functions to handle glyphs (specification). */ -/* */ -/* Copyright 1996-2003, 2006, 2008, 2009, 2011 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - - /*************************************************************************/ - /* */ - /* This file contains the definition of several convenience functions */ - /* that can be used by client applications to easily retrieve glyph */ - /* bitmaps and outlines from a given face. */ - /* */ - /* These functions should be optional if you are writing a font server */ - /* or text layout engine on top of FreeType. However, they are pretty */ - /* handy for many other simple uses of the library. */ - /* */ - /*************************************************************************/ - - -#ifndef __FTGLYPH_H__ -#define __FTGLYPH_H__ - - -#include <ft2build.h> -#include FT_FREETYPE_H - -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - - -FT_BEGIN_HEADER - - - /*************************************************************************/ - /* */ - /* <Section> */ - /* glyph_management */ - /* */ - /* <Title> */ - /* Glyph Management */ - /* */ - /* <Abstract> */ - /* Generic interface to manage individual glyph data. */ - /* */ - /* <Description> */ - /* This section contains definitions used to manage glyph data */ - /* through generic FT_Glyph objects. Each of them can contain a */ - /* bitmap, a vector outline, or even images in other formats. */ - /* */ - /*************************************************************************/ - - - /* forward declaration to a private type */ - typedef struct FT_Glyph_Class_ FT_Glyph_Class; - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FT_Glyph */ - /* */ - /* <Description> */ - /* Handle to an object used to model generic glyph images. It is a */ - /* pointer to the @FT_GlyphRec structure and can contain a glyph */ - /* bitmap or pointer. */ - /* */ - /* <Note> */ - /* Glyph objects are not owned by the library. You must thus release */ - /* them manually (through @FT_Done_Glyph) _before_ calling */ - /* @FT_Done_FreeType. */ - /* */ - typedef struct FT_GlyphRec_* FT_Glyph; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FT_GlyphRec */ - /* */ - /* <Description> */ - /* The root glyph structure contains a given glyph image plus its */ - /* advance width in 16.16 fixed float format. */ - /* */ - /* <Fields> */ - /* library :: A handle to the FreeType library object. */ - /* */ - /* clazz :: A pointer to the glyph's class. Private. */ - /* */ - /* format :: The format of the glyph's image. */ - /* */ - /* advance :: A 16.16 vector that gives the glyph's advance width. */ - /* */ - typedef struct FT_GlyphRec_ - { - FT_Library library; - const FT_Glyph_Class* clazz; - FT_Glyph_Format format; - FT_Vector advance; - - } FT_GlyphRec; - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FT_BitmapGlyph */ - /* */ - /* <Description> */ - /* A handle to an object used to model a bitmap glyph image. This is */ - /* a sub-class of @FT_Glyph, and a pointer to @FT_BitmapGlyphRec. */ - /* */ - typedef struct FT_BitmapGlyphRec_* FT_BitmapGlyph; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FT_BitmapGlyphRec */ - /* */ - /* <Description> */ - /* A structure used for bitmap glyph images. This really is a */ - /* `sub-class' of @FT_GlyphRec. */ - /* */ - /* <Fields> */ - /* root :: The root @FT_Glyph fields. */ - /* */ - /* left :: The left-side bearing, i.e., the horizontal distance */ - /* from the current pen position to the left border of the */ - /* glyph bitmap. */ - /* */ - /* top :: The top-side bearing, i.e., the vertical distance from */ - /* the current pen position to the top border of the glyph */ - /* bitmap. This distance is positive for upwards~y! */ - /* */ - /* bitmap :: A descriptor for the bitmap. */ - /* */ - /* <Note> */ - /* You can typecast an @FT_Glyph to @FT_BitmapGlyph if you have */ - /* `glyph->format == FT_GLYPH_FORMAT_BITMAP'. This lets you access */ - /* the bitmap's contents easily. */ - /* */ - /* The corresponding pixel buffer is always owned by @FT_BitmapGlyph */ - /* and is thus created and destroyed with it. */ - /* */ - typedef struct FT_BitmapGlyphRec_ - { - FT_GlyphRec root; - FT_Int left; - FT_Int top; - FT_Bitmap bitmap; - - } FT_BitmapGlyphRec; - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FT_OutlineGlyph */ - /* */ - /* <Description> */ - /* A handle to an object used to model an outline glyph image. This */ - /* is a sub-class of @FT_Glyph, and a pointer to @FT_OutlineGlyphRec. */ - /* */ - typedef struct FT_OutlineGlyphRec_* FT_OutlineGlyph; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FT_OutlineGlyphRec */ - /* */ - /* <Description> */ - /* A structure used for outline (vectorial) glyph images. This */ - /* really is a `sub-class' of @FT_GlyphRec. */ - /* */ - /* <Fields> */ - /* root :: The root @FT_Glyph fields. */ - /* */ - /* outline :: A descriptor for the outline. */ - /* */ - /* <Note> */ - /* You can typecast an @FT_Glyph to @FT_OutlineGlyph if you have */ - /* `glyph->format == FT_GLYPH_FORMAT_OUTLINE'. This lets you access */ - /* the outline's content easily. */ - /* */ - /* As the outline is extracted from a glyph slot, its coordinates are */ - /* expressed normally in 26.6 pixels, unless the flag */ - /* @FT_LOAD_NO_SCALE was used in @FT_Load_Glyph() or @FT_Load_Char(). */ - /* */ - /* The outline's tables are always owned by the object and are */ - /* destroyed with it. */ - /* */ - typedef struct FT_OutlineGlyphRec_ - { - FT_GlyphRec root; - FT_Outline outline; - - } FT_OutlineGlyphRec; - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Get_Glyph */ - /* */ - /* <Description> */ - /* A function used to extract a glyph image from a slot. Note that */ - /* the created @FT_Glyph object must be released with @FT_Done_Glyph. */ - /* */ - /* <Input> */ - /* slot :: A handle to the source glyph slot. */ - /* */ - /* <Output> */ - /* aglyph :: A handle to the glyph object. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Get_Glyph( FT_GlyphSlot slot, - FT_Glyph *aglyph ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Glyph_Copy */ - /* */ - /* <Description> */ - /* A function used to copy a glyph image. Note that the created */ - /* @FT_Glyph object must be released with @FT_Done_Glyph. */ - /* */ - /* <Input> */ - /* source :: A handle to the source glyph object. */ - /* */ - /* <Output> */ - /* target :: A handle to the target glyph object. 0~in case of */ - /* error. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Glyph_Copy( FT_Glyph source, - FT_Glyph *target ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Glyph_Transform */ - /* */ - /* <Description> */ - /* Transform a glyph image if its format is scalable. */ - /* */ - /* <InOut> */ - /* glyph :: A handle to the target glyph object. */ - /* */ - /* <Input> */ - /* matrix :: A pointer to a 2x2 matrix to apply. */ - /* */ - /* delta :: A pointer to a 2d vector to apply. Coordinates are */ - /* expressed in 1/64th of a pixel. */ - /* */ - /* <Return> */ - /* FreeType error code (if not 0, the glyph format is not scalable). */ - /* */ - /* <Note> */ - /* The 2x2 transformation matrix is also applied to the glyph's */ - /* advance vector. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Glyph_Transform( FT_Glyph glyph, - FT_Matrix* matrix, - FT_Vector* delta ); - - - /*************************************************************************/ - /* */ - /* <Enum> */ - /* FT_Glyph_BBox_Mode */ - /* */ - /* <Description> */ - /* The mode how the values of @FT_Glyph_Get_CBox are returned. */ - /* */ - /* <Values> */ - /* FT_GLYPH_BBOX_UNSCALED :: */ - /* Return unscaled font units. */ - /* */ - /* FT_GLYPH_BBOX_SUBPIXELS :: */ - /* Return unfitted 26.6 coordinates. */ - /* */ - /* FT_GLYPH_BBOX_GRIDFIT :: */ - /* Return grid-fitted 26.6 coordinates. */ - /* */ - /* FT_GLYPH_BBOX_TRUNCATE :: */ - /* Return coordinates in integer pixels. */ - /* */ - /* FT_GLYPH_BBOX_PIXELS :: */ - /* Return grid-fitted pixel coordinates. */ - /* */ - typedef enum FT_Glyph_BBox_Mode_ - { - FT_GLYPH_BBOX_UNSCALED = 0, - FT_GLYPH_BBOX_SUBPIXELS = 0, - FT_GLYPH_BBOX_GRIDFIT = 1, - FT_GLYPH_BBOX_TRUNCATE = 2, - FT_GLYPH_BBOX_PIXELS = 3 - - } FT_Glyph_BBox_Mode; - - - /*************************************************************************/ - /* */ - /* <Enum> */ - /* ft_glyph_bbox_xxx */ - /* */ - /* <Description> */ - /* These constants are deprecated. Use the corresponding */ - /* @FT_Glyph_BBox_Mode values instead. */ - /* */ - /* <Values> */ - /* ft_glyph_bbox_unscaled :: See @FT_GLYPH_BBOX_UNSCALED. */ - /* ft_glyph_bbox_subpixels :: See @FT_GLYPH_BBOX_SUBPIXELS. */ - /* ft_glyph_bbox_gridfit :: See @FT_GLYPH_BBOX_GRIDFIT. */ - /* ft_glyph_bbox_truncate :: See @FT_GLYPH_BBOX_TRUNCATE. */ - /* ft_glyph_bbox_pixels :: See @FT_GLYPH_BBOX_PIXELS. */ - /* */ -#define ft_glyph_bbox_unscaled FT_GLYPH_BBOX_UNSCALED -#define ft_glyph_bbox_subpixels FT_GLYPH_BBOX_SUBPIXELS -#define ft_glyph_bbox_gridfit FT_GLYPH_BBOX_GRIDFIT -#define ft_glyph_bbox_truncate FT_GLYPH_BBOX_TRUNCATE -#define ft_glyph_bbox_pixels FT_GLYPH_BBOX_PIXELS - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Glyph_Get_CBox */ - /* */ - /* <Description> */ - /* Return a glyph's `control box'. The control box encloses all the */ - /* outline's points, including Bézier control points. Though it */ - /* coincides with the exact bounding box for most glyphs, it can be */ - /* slightly larger in some situations (like when rotating an outline */ - /* which contains Bézier outside arcs). */ - /* */ - /* Computing the control box is very fast, while getting the bounding */ - /* box can take much more time as it needs to walk over all segments */ - /* and arcs in the outline. To get the latter, you can use the */ - /* `ftbbox' component which is dedicated to this single task. */ - /* */ - /* <Input> */ - /* glyph :: A handle to the source glyph object. */ - /* */ - /* mode :: The mode which indicates how to interpret the returned */ - /* bounding box values. */ - /* */ - /* <Output> */ - /* acbox :: The glyph coordinate bounding box. Coordinates are */ - /* expressed in 1/64th of pixels if it is grid-fitted. */ - /* */ - /* <Note> */ - /* Coordinates are relative to the glyph origin, using the y~upwards */ - /* convention. */ - /* */ - /* If the glyph has been loaded with @FT_LOAD_NO_SCALE, `bbox_mode' */ - /* must be set to @FT_GLYPH_BBOX_UNSCALED to get unscaled font */ - /* units in 26.6 pixel format. The value @FT_GLYPH_BBOX_SUBPIXELS */ - /* is another name for this constant. */ - /* */ - /* If the font is tricky and the glyph has been loaded with */ - /* @FT_LOAD_NO_SCALE, the resulting CBox is meaningless. To get */ - /* reasonable values for the CBox it is necessary to load the glyph */ - /* at a large ppem value (so that the hinting instructions can */ - /* properly shift and scale the subglyphs), then extracting the CBox */ - /* which can be eventually converted back to font units. */ - /* */ - /* Note that the maximum coordinates are exclusive, which means that */ - /* one can compute the width and height of the glyph image (be it in */ - /* integer or 26.6 pixels) as: */ - /* */ - /* { */ - /* width = bbox.xMax - bbox.xMin; */ - /* height = bbox.yMax - bbox.yMin; */ - /* } */ - /* */ - /* Note also that for 26.6 coordinates, if `bbox_mode' is set to */ - /* @FT_GLYPH_BBOX_GRIDFIT, the coordinates will also be grid-fitted, */ - /* which corresponds to: */ - /* */ - /* { */ - /* bbox.xMin = FLOOR(bbox.xMin); */ - /* bbox.yMin = FLOOR(bbox.yMin); */ - /* bbox.xMax = CEILING(bbox.xMax); */ - /* bbox.yMax = CEILING(bbox.yMax); */ - /* } */ - /* */ - /* To get the bbox in pixel coordinates, set `bbox_mode' to */ - /* @FT_GLYPH_BBOX_TRUNCATE. */ - /* */ - /* To get the bbox in grid-fitted pixel coordinates, set `bbox_mode' */ - /* to @FT_GLYPH_BBOX_PIXELS. */ - /* */ - FT_EXPORT( void ) - FT_Glyph_Get_CBox( FT_Glyph glyph, - FT_UInt bbox_mode, - FT_BBox *acbox ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Glyph_To_Bitmap */ - /* */ - /* <Description> */ - /* Convert a given glyph object to a bitmap glyph object. */ - /* */ - /* <InOut> */ - /* the_glyph :: A pointer to a handle to the target glyph. */ - /* */ - /* <Input> */ - /* render_mode :: An enumeration that describes how the data is */ - /* rendered. */ - /* */ - /* origin :: A pointer to a vector used to translate the glyph */ - /* image before rendering. Can be~0 (if no */ - /* translation). The origin is expressed in */ - /* 26.6 pixels. */ - /* */ - /* destroy :: A boolean that indicates that the original glyph */ - /* image should be destroyed by this function. It is */ - /* never destroyed in case of error. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - /* <Note> */ - /* This function does nothing if the glyph format isn't scalable. */ - /* */ - /* The glyph image is translated with the `origin' vector before */ - /* rendering. */ - /* */ - /* The first parameter is a pointer to an @FT_Glyph handle, that will */ - /* be _replaced_ by this function (with newly allocated data). */ - /* Typically, you would use (omitting error handling): */ - /* */ - /* */ - /* { */ - /* FT_Glyph glyph; */ - /* FT_BitmapGlyph glyph_bitmap; */ - /* */ - /* */ - /* // load glyph */ - /* error = FT_Load_Char( face, glyph_index, FT_LOAD_DEFAUT ); */ - /* */ - /* // extract glyph image */ - /* error = FT_Get_Glyph( face->glyph, &glyph ); */ - /* */ - /* // convert to a bitmap (default render mode + destroying old) */ - /* if ( glyph->format != FT_GLYPH_FORMAT_BITMAP ) */ - /* { */ - /* error = FT_Glyph_To_Bitmap( &glyph, FT_RENDER_MODE_NORMAL, */ - /* 0, 1 ); */ - /* if ( error ) // `glyph' unchanged */ - /* ... */ - /* } */ - /* */ - /* // access bitmap content by typecasting */ - /* glyph_bitmap = (FT_BitmapGlyph)glyph; */ - /* */ - /* // do funny stuff with it, like blitting/drawing */ - /* ... */ - /* */ - /* // discard glyph image (bitmap or not) */ - /* FT_Done_Glyph( glyph ); */ - /* } */ - /* */ - /* */ - /* Here another example, again without error handling: */ - /* */ - /* */ - /* { */ - /* FT_Glyph glyphs[MAX_GLYPHS] */ - /* */ - /* */ - /* ... */ - /* */ - /* for ( idx = 0; i < MAX_GLYPHS; i++ ) */ - /* error = FT_Load_Glyph( face, idx, FT_LOAD_DEFAULT ) || */ - /* FT_Get_Glyph ( face->glyph, &glyph[idx] ); */ - /* */ - /* ... */ - /* */ - /* for ( idx = 0; i < MAX_GLYPHS; i++ ) */ - /* { */ - /* FT_Glyph bitmap = glyphs[idx]; */ - /* */ - /* */ - /* ... */ - /* */ - /* // after this call, `bitmap' no longer points into */ - /* // the `glyphs' array (and the old value isn't destroyed) */ - /* FT_Glyph_To_Bitmap( &bitmap, FT_RENDER_MODE_MONO, 0, 0 ); */ - /* */ - /* ... */ - /* */ - /* FT_Done_Glyph( bitmap ); */ - /* } */ - /* */ - /* ... */ - /* */ - /* for ( idx = 0; i < MAX_GLYPHS; i++ ) */ - /* FT_Done_Glyph( glyphs[idx] ); */ - /* } */ - /* */ - FT_EXPORT( FT_Error ) - FT_Glyph_To_Bitmap( FT_Glyph* the_glyph, - FT_Render_Mode render_mode, - FT_Vector* origin, - FT_Bool destroy ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Done_Glyph */ - /* */ - /* <Description> */ - /* Destroy a given glyph. */ - /* */ - /* <Input> */ - /* glyph :: A handle to the target glyph object. */ - /* */ - FT_EXPORT( void ) - FT_Done_Glyph( FT_Glyph glyph ); - - /* */ - - - /* other helpful functions */ - - /*************************************************************************/ - /* */ - /* <Section> */ - /* computations */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Matrix_Multiply */ - /* */ - /* <Description> */ - /* Perform the matrix operation `b = a*b'. */ - /* */ - /* <Input> */ - /* a :: A pointer to matrix `a'. */ - /* */ - /* <InOut> */ - /* b :: A pointer to matrix `b'. */ - /* */ - /* <Note> */ - /* The result is undefined if either `a' or `b' is zero. */ - /* */ - FT_EXPORT( void ) - FT_Matrix_Multiply( const FT_Matrix* a, - FT_Matrix* b ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Matrix_Invert */ - /* */ - /* <Description> */ - /* Invert a 2x2 matrix. Return an error if it can't be inverted. */ - /* */ - /* <InOut> */ - /* matrix :: A pointer to the target matrix. Remains untouched in */ - /* case of error. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Matrix_Invert( FT_Matrix* matrix ); - - - /* */ - - -FT_END_HEADER - -#endif /* __FTGLYPH_H__ */ - - -/* END */ - - -/* Local Variables: */ -/* coding: utf-8 */ -/* End: */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftimage.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftimage.h deleted file mode 100644 index 04b5e04f7b..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftimage.h +++ /dev/null @@ -1,1313 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftimage.h */ -/* */ -/* FreeType glyph image formats and default raster interface */ -/* (specification). */ -/* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, */ -/* 2010 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - /*************************************************************************/ - /* */ - /* Note: A `raster' is simply a scan-line converter, used to render */ - /* FT_Outlines into FT_Bitmaps. */ - /* */ - /*************************************************************************/ - - -#ifndef __FTIMAGE_H__ -#define __FTIMAGE_H__ - - - /* _STANDALONE_ is from ftgrays.c */ -#ifndef _STANDALONE_ -#include <ft2build.h> -#endif - - -FT_BEGIN_HEADER - - - /*************************************************************************/ - /* */ - /* <Section> */ - /* basic_types */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FT_Pos */ - /* */ - /* <Description> */ - /* The type FT_Pos is used to store vectorial coordinates. Depending */ - /* on the context, these can represent distances in integer font */ - /* units, or 16.16, or 26.6 fixed float pixel coordinates. */ - /* */ - typedef signed long FT_Pos; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FT_Vector */ - /* */ - /* <Description> */ - /* A simple structure used to store a 2D vector; coordinates are of */ - /* the FT_Pos type. */ - /* */ - /* <Fields> */ - /* x :: The horizontal coordinate. */ - /* y :: The vertical coordinate. */ - /* */ - typedef struct FT_Vector_ - { - FT_Pos x; - FT_Pos y; - - } FT_Vector; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FT_BBox */ - /* */ - /* <Description> */ - /* A structure used to hold an outline's bounding box, i.e., the */ - /* coordinates of its extrema in the horizontal and vertical */ - /* directions. */ - /* */ - /* <Fields> */ - /* xMin :: The horizontal minimum (left-most). */ - /* */ - /* yMin :: The vertical minimum (bottom-most). */ - /* */ - /* xMax :: The horizontal maximum (right-most). */ - /* */ - /* yMax :: The vertical maximum (top-most). */ - /* */ - /* <Note> */ - /* The bounding box is specified with the coordinates of the lower */ - /* left and the upper right corner. In PostScript, those values are */ - /* often called (llx,lly) and (urx,ury), respectively. */ - /* */ - /* If `yMin' is negative, this value gives the glyph's descender. */ - /* Otherwise, the glyph doesn't descend below the baseline. */ - /* Similarly, if `ymax' is positive, this value gives the glyph's */ - /* ascender. */ - /* */ - /* `xMin' gives the horizontal distance from the glyph's origin to */ - /* the left edge of the glyph's bounding box. If `xMin' is negative, */ - /* the glyph extends to the left of the origin. */ - /* */ - typedef struct FT_BBox_ - { - FT_Pos xMin, yMin; - FT_Pos xMax, yMax; - - } FT_BBox; - - - /*************************************************************************/ - /* */ - /* <Enum> */ - /* FT_Pixel_Mode */ - /* */ - /* <Description> */ - /* An enumeration type used to describe the format of pixels in a */ - /* given bitmap. Note that additional formats may be added in the */ - /* future. */ - /* */ - /* <Values> */ - /* FT_PIXEL_MODE_NONE :: */ - /* Value~0 is reserved. */ - /* */ - /* FT_PIXEL_MODE_MONO :: */ - /* A monochrome bitmap, using 1~bit per pixel. Note that pixels */ - /* are stored in most-significant order (MSB), which means that */ - /* the left-most pixel in a byte has value 128. */ - /* */ - /* FT_PIXEL_MODE_GRAY :: */ - /* An 8-bit bitmap, generally used to represent anti-aliased glyph */ - /* images. Each pixel is stored in one byte. Note that the number */ - /* of `gray' levels is stored in the `num_grays' field of the */ - /* @FT_Bitmap structure (it generally is 256). */ - /* */ - /* FT_PIXEL_MODE_GRAY2 :: */ - /* A 2-bit per pixel bitmap, used to represent embedded */ - /* anti-aliased bitmaps in font files according to the OpenType */ - /* specification. We haven't found a single font using this */ - /* format, however. */ - /* */ - /* FT_PIXEL_MODE_GRAY4 :: */ - /* A 4-bit per pixel bitmap, representing embedded anti-aliased */ - /* bitmaps in font files according to the OpenType specification. */ - /* We haven't found a single font using this format, however. */ - /* */ - /* FT_PIXEL_MODE_LCD :: */ - /* An 8-bit bitmap, representing RGB or BGR decimated glyph images */ - /* used for display on LCD displays; the bitmap is three times */ - /* wider than the original glyph image. See also */ - /* @FT_RENDER_MODE_LCD. */ - /* */ - /* FT_PIXEL_MODE_LCD_V :: */ - /* An 8-bit bitmap, representing RGB or BGR decimated glyph images */ - /* used for display on rotated LCD displays; the bitmap is three */ - /* times taller than the original glyph image. See also */ - /* @FT_RENDER_MODE_LCD_V. */ - /* */ - typedef enum FT_Pixel_Mode_ - { - FT_PIXEL_MODE_NONE = 0, - FT_PIXEL_MODE_MONO, - FT_PIXEL_MODE_GRAY, - FT_PIXEL_MODE_GRAY2, - FT_PIXEL_MODE_GRAY4, - FT_PIXEL_MODE_LCD, - FT_PIXEL_MODE_LCD_V, - - FT_PIXEL_MODE_MAX /* do not remove */ - - } FT_Pixel_Mode; - - - /*************************************************************************/ - /* */ - /* <Enum> */ - /* ft_pixel_mode_xxx */ - /* */ - /* <Description> */ - /* A list of deprecated constants. Use the corresponding */ - /* @FT_Pixel_Mode values instead. */ - /* */ - /* <Values> */ - /* ft_pixel_mode_none :: See @FT_PIXEL_MODE_NONE. */ - /* ft_pixel_mode_mono :: See @FT_PIXEL_MODE_MONO. */ - /* ft_pixel_mode_grays :: See @FT_PIXEL_MODE_GRAY. */ - /* ft_pixel_mode_pal2 :: See @FT_PIXEL_MODE_GRAY2. */ - /* ft_pixel_mode_pal4 :: See @FT_PIXEL_MODE_GRAY4. */ - /* */ -#define ft_pixel_mode_none FT_PIXEL_MODE_NONE -#define ft_pixel_mode_mono FT_PIXEL_MODE_MONO -#define ft_pixel_mode_grays FT_PIXEL_MODE_GRAY -#define ft_pixel_mode_pal2 FT_PIXEL_MODE_GRAY2 -#define ft_pixel_mode_pal4 FT_PIXEL_MODE_GRAY4 - - /* */ - -#if 0 - - /*************************************************************************/ - /* */ - /* <Enum> */ - /* FT_Palette_Mode */ - /* */ - /* <Description> */ - /* THIS TYPE IS DEPRECATED. DO NOT USE IT! */ - /* */ - /* An enumeration type to describe the format of a bitmap palette, */ - /* used with ft_pixel_mode_pal4 and ft_pixel_mode_pal8. */ - /* */ - /* <Values> */ - /* ft_palette_mode_rgb :: The palette is an array of 3-byte RGB */ - /* records. */ - /* */ - /* ft_palette_mode_rgba :: The palette is an array of 4-byte RGBA */ - /* records. */ - /* */ - /* <Note> */ - /* As ft_pixel_mode_pal2, pal4 and pal8 are currently unused by */ - /* FreeType, these types are not handled by the library itself. */ - /* */ - typedef enum FT_Palette_Mode_ - { - ft_palette_mode_rgb = 0, - ft_palette_mode_rgba, - - ft_palette_mode_max /* do not remove */ - - } FT_Palette_Mode; - - /* */ - -#endif - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FT_Bitmap */ - /* */ - /* <Description> */ - /* A structure used to describe a bitmap or pixmap to the raster. */ - /* Note that we now manage pixmaps of various depths through the */ - /* `pixel_mode' field. */ - /* */ - /* <Fields> */ - /* rows :: The number of bitmap rows. */ - /* */ - /* width :: The number of pixels in bitmap row. */ - /* */ - /* pitch :: The pitch's absolute value is the number of bytes */ - /* taken by one bitmap row, including padding. */ - /* However, the pitch is positive when the bitmap has */ - /* a `down' flow, and negative when it has an `up' */ - /* flow. In all cases, the pitch is an offset to add */ - /* to a bitmap pointer in order to go down one row. */ - /* */ - /* Note that `padding' means the alignment of a */ - /* bitmap to a byte border, and FreeType functions */ - /* normally align to the smallest possible integer */ - /* value. */ - /* */ - /* For the B/W rasterizer, `pitch' is always an even */ - /* number. */ - /* */ - /* To change the pitch of a bitmap (say, to make it a */ - /* multiple of 4), use @FT_Bitmap_Convert. */ - /* Alternatively, you might use callback functions to */ - /* directly render to the application's surface; see */ - /* the file `example2.cpp' in the tutorial for a */ - /* demonstration. */ - /* */ - /* buffer :: A typeless pointer to the bitmap buffer. This */ - /* value should be aligned on 32-bit boundaries in */ - /* most cases. */ - /* */ - /* num_grays :: This field is only used with */ - /* @FT_PIXEL_MODE_GRAY; it gives the number of gray */ - /* levels used in the bitmap. */ - /* */ - /* pixel_mode :: The pixel mode, i.e., how pixel bits are stored. */ - /* See @FT_Pixel_Mode for possible values. */ - /* */ - /* palette_mode :: This field is intended for paletted pixel modes; */ - /* it indicates how the palette is stored. Not */ - /* used currently. */ - /* */ - /* palette :: A typeless pointer to the bitmap palette; this */ - /* field is intended for paletted pixel modes. Not */ - /* used currently. */ - /* */ - /* <Note> */ - /* For now, the only pixel modes supported by FreeType are mono and */ - /* grays. However, drivers might be added in the future to support */ - /* more `colorful' options. */ - /* */ - typedef struct FT_Bitmap_ - { - int rows; - int width; - int pitch; - unsigned char* buffer; - short num_grays; - char pixel_mode; - char palette_mode; - void* palette; - - } FT_Bitmap; - - - /*************************************************************************/ - /* */ - /* <Section> */ - /* outline_processing */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FT_Outline */ - /* */ - /* <Description> */ - /* This structure is used to describe an outline to the scan-line */ - /* converter. */ - /* */ - /* <Fields> */ - /* n_contours :: The number of contours in the outline. */ - /* */ - /* n_points :: The number of points in the outline. */ - /* */ - /* points :: A pointer to an array of `n_points' @FT_Vector */ - /* elements, giving the outline's point coordinates. */ - /* */ - /* tags :: A pointer to an array of `n_points' chars, giving */ - /* each outline point's type. */ - /* */ - /* If bit~0 is unset, the point is `off' the curve, */ - /* i.e., a Bézier control point, while it is `on' if */ - /* set. */ - /* */ - /* Bit~1 is meaningful for `off' points only. If set, */ - /* it indicates a third-order Bézier arc control point; */ - /* and a second-order control point if unset. */ - /* */ - /* If bit~2 is set, bits 5-7 contain the drop-out mode */ - /* (as defined in the OpenType specification; the value */ - /* is the same as the argument to the SCANMODE */ - /* instruction). */ - /* */ - /* Bits 3 and~4 are reserved for internal purposes. */ - /* */ - /* contours :: An array of `n_contours' shorts, giving the end */ - /* point of each contour within the outline. For */ - /* example, the first contour is defined by the points */ - /* `0' to `contours[0]', the second one is defined by */ - /* the points `contours[0]+1' to `contours[1]', etc. */ - /* */ - /* flags :: A set of bit flags used to characterize the outline */ - /* and give hints to the scan-converter and hinter on */ - /* how to convert/grid-fit it. See @FT_OUTLINE_FLAGS. */ - /* */ - /* <Note> */ - /* The B/W rasterizer only checks bit~2 in the `tags' array for the */ - /* first point of each contour. The drop-out mode as given with */ - /* @FT_OUTLINE_IGNORE_DROPOUTS, @FT_OUTLINE_SMART_DROPOUTS, and */ - /* @FT_OUTLINE_INCLUDE_STUBS in `flags' is then overridden. */ - /* */ - typedef struct FT_Outline_ - { - short n_contours; /* number of contours in glyph */ - short n_points; /* number of points in the glyph */ - - FT_Vector* points; /* the outline's points */ - char* tags; /* the points flags */ - short* contours; /* the contour end points */ - - int flags; /* outline masks */ - - } FT_Outline; - - /* Following limits must be consistent with */ - /* FT_Outline.{n_contours,n_points} */ -#define FT_OUTLINE_CONTOURS_MAX SHRT_MAX -#define FT_OUTLINE_POINTS_MAX SHRT_MAX - - - /*************************************************************************/ - /* */ - /* <Enum> */ - /* FT_OUTLINE_FLAGS */ - /* */ - /* <Description> */ - /* A list of bit-field constants use for the flags in an outline's */ - /* `flags' field. */ - /* */ - /* <Values> */ - /* FT_OUTLINE_NONE :: */ - /* Value~0 is reserved. */ - /* */ - /* FT_OUTLINE_OWNER :: */ - /* If set, this flag indicates that the outline's field arrays */ - /* (i.e., `points', `flags', and `contours') are `owned' by the */ - /* outline object, and should thus be freed when it is destroyed. */ - /* */ - /* FT_OUTLINE_EVEN_ODD_FILL :: */ - /* By default, outlines are filled using the non-zero winding rule. */ - /* If set to 1, the outline will be filled using the even-odd fill */ - /* rule (only works with the smooth rasterizer). */ - /* */ - /* FT_OUTLINE_REVERSE_FILL :: */ - /* By default, outside contours of an outline are oriented in */ - /* clock-wise direction, as defined in the TrueType specification. */ - /* This flag is set if the outline uses the opposite direction */ - /* (typically for Type~1 fonts). This flag is ignored by the scan */ - /* converter. */ - /* */ - /* FT_OUTLINE_IGNORE_DROPOUTS :: */ - /* By default, the scan converter will try to detect drop-outs in */ - /* an outline and correct the glyph bitmap to ensure consistent */ - /* shape continuity. If set, this flag hints the scan-line */ - /* converter to ignore such cases. See below for more information. */ - /* */ - /* FT_OUTLINE_SMART_DROPOUTS :: */ - /* Select smart dropout control. If unset, use simple dropout */ - /* control. Ignored if @FT_OUTLINE_IGNORE_DROPOUTS is set. See */ - /* below for more information. */ - /* */ - /* FT_OUTLINE_INCLUDE_STUBS :: */ - /* If set, turn pixels on for `stubs', otherwise exclude them. */ - /* Ignored if @FT_OUTLINE_IGNORE_DROPOUTS is set. See below for */ - /* more information. */ - /* */ - /* FT_OUTLINE_HIGH_PRECISION :: */ - /* This flag indicates that the scan-line converter should try to */ - /* convert this outline to bitmaps with the highest possible */ - /* quality. It is typically set for small character sizes. Note */ - /* that this is only a hint that might be completely ignored by a */ - /* given scan-converter. */ - /* */ - /* FT_OUTLINE_SINGLE_PASS :: */ - /* This flag is set to force a given scan-converter to only use a */ - /* single pass over the outline to render a bitmap glyph image. */ - /* Normally, it is set for very large character sizes. It is only */ - /* a hint that might be completely ignored by a given */ - /* scan-converter. */ - /* */ - /* <Note> */ - /* The flags @FT_OUTLINE_IGNORE_DROPOUTS, @FT_OUTLINE_SMART_DROPOUTS, */ - /* and @FT_OUTLINE_INCLUDE_STUBS are ignored by the smooth */ - /* rasterizer. */ - /* */ - /* There exists a second mechanism to pass the drop-out mode to the */ - /* B/W rasterizer; see the `tags' field in @FT_Outline. */ - /* */ - /* Please refer to the description of the `SCANTYPE' instruction in */ - /* the OpenType specification (in file `ttinst1.doc') how simple */ - /* drop-outs, smart drop-outs, and stubs are defined. */ - /* */ -#define FT_OUTLINE_NONE 0x0 -#define FT_OUTLINE_OWNER 0x1 -#define FT_OUTLINE_EVEN_ODD_FILL 0x2 -#define FT_OUTLINE_REVERSE_FILL 0x4 -#define FT_OUTLINE_IGNORE_DROPOUTS 0x8 -#define FT_OUTLINE_SMART_DROPOUTS 0x10 -#define FT_OUTLINE_INCLUDE_STUBS 0x20 - -#define FT_OUTLINE_HIGH_PRECISION 0x100 -#define FT_OUTLINE_SINGLE_PASS 0x200 - - - /************************************************************************* - * - * @enum: - * ft_outline_flags - * - * @description: - * These constants are deprecated. Please use the corresponding - * @FT_OUTLINE_FLAGS values. - * - * @values: - * ft_outline_none :: See @FT_OUTLINE_NONE. - * ft_outline_owner :: See @FT_OUTLINE_OWNER. - * ft_outline_even_odd_fill :: See @FT_OUTLINE_EVEN_ODD_FILL. - * ft_outline_reverse_fill :: See @FT_OUTLINE_REVERSE_FILL. - * ft_outline_ignore_dropouts :: See @FT_OUTLINE_IGNORE_DROPOUTS. - * ft_outline_high_precision :: See @FT_OUTLINE_HIGH_PRECISION. - * ft_outline_single_pass :: See @FT_OUTLINE_SINGLE_PASS. - */ -#define ft_outline_none FT_OUTLINE_NONE -#define ft_outline_owner FT_OUTLINE_OWNER -#define ft_outline_even_odd_fill FT_OUTLINE_EVEN_ODD_FILL -#define ft_outline_reverse_fill FT_OUTLINE_REVERSE_FILL -#define ft_outline_ignore_dropouts FT_OUTLINE_IGNORE_DROPOUTS -#define ft_outline_high_precision FT_OUTLINE_HIGH_PRECISION -#define ft_outline_single_pass FT_OUTLINE_SINGLE_PASS - - /* */ - -#define FT_CURVE_TAG( flag ) ( flag & 3 ) - -#define FT_CURVE_TAG_ON 1 -#define FT_CURVE_TAG_CONIC 0 -#define FT_CURVE_TAG_CUBIC 2 - -#define FT_CURVE_TAG_HAS_SCANMODE 4 - -#define FT_CURVE_TAG_TOUCH_X 8 /* reserved for the TrueType hinter */ -#define FT_CURVE_TAG_TOUCH_Y 16 /* reserved for the TrueType hinter */ - -#define FT_CURVE_TAG_TOUCH_BOTH ( FT_CURVE_TAG_TOUCH_X | \ - FT_CURVE_TAG_TOUCH_Y ) - -#define FT_Curve_Tag_On FT_CURVE_TAG_ON -#define FT_Curve_Tag_Conic FT_CURVE_TAG_CONIC -#define FT_Curve_Tag_Cubic FT_CURVE_TAG_CUBIC -#define FT_Curve_Tag_Touch_X FT_CURVE_TAG_TOUCH_X -#define FT_Curve_Tag_Touch_Y FT_CURVE_TAG_TOUCH_Y - - - /*************************************************************************/ - /* */ - /* <FuncType> */ - /* FT_Outline_MoveToFunc */ - /* */ - /* <Description> */ - /* A function pointer type used to describe the signature of a `move */ - /* to' function during outline walking/decomposition. */ - /* */ - /* A `move to' is emitted to start a new contour in an outline. */ - /* */ - /* <Input> */ - /* to :: A pointer to the target point of the `move to'. */ - /* */ - /* user :: A typeless pointer which is passed from the caller of the */ - /* decomposition function. */ - /* */ - /* <Return> */ - /* Error code. 0~means success. */ - /* */ - typedef int - (*FT_Outline_MoveToFunc)( const FT_Vector* to, - void* user ); - -#define FT_Outline_MoveTo_Func FT_Outline_MoveToFunc - - - /*************************************************************************/ - /* */ - /* <FuncType> */ - /* FT_Outline_LineToFunc */ - /* */ - /* <Description> */ - /* A function pointer type used to describe the signature of a `line */ - /* to' function during outline walking/decomposition. */ - /* */ - /* A `line to' is emitted to indicate a segment in the outline. */ - /* */ - /* <Input> */ - /* to :: A pointer to the target point of the `line to'. */ - /* */ - /* user :: A typeless pointer which is passed from the caller of the */ - /* decomposition function. */ - /* */ - /* <Return> */ - /* Error code. 0~means success. */ - /* */ - typedef int - (*FT_Outline_LineToFunc)( const FT_Vector* to, - void* user ); - -#define FT_Outline_LineTo_Func FT_Outline_LineToFunc - - - /*************************************************************************/ - /* */ - /* <FuncType> */ - /* FT_Outline_ConicToFunc */ - /* */ - /* <Description> */ - /* A function pointer type used to describe the signature of a `conic */ - /* to' function during outline walking or decomposition. */ - /* */ - /* A `conic to' is emitted to indicate a second-order Bézier arc in */ - /* the outline. */ - /* */ - /* <Input> */ - /* control :: An intermediate control point between the last position */ - /* and the new target in `to'. */ - /* */ - /* to :: A pointer to the target end point of the conic arc. */ - /* */ - /* user :: A typeless pointer which is passed from the caller of */ - /* the decomposition function. */ - /* */ - /* <Return> */ - /* Error code. 0~means success. */ - /* */ - typedef int - (*FT_Outline_ConicToFunc)( const FT_Vector* control, - const FT_Vector* to, - void* user ); - -#define FT_Outline_ConicTo_Func FT_Outline_ConicToFunc - - - /*************************************************************************/ - /* */ - /* <FuncType> */ - /* FT_Outline_CubicToFunc */ - /* */ - /* <Description> */ - /* A function pointer type used to describe the signature of a `cubic */ - /* to' function during outline walking or decomposition. */ - /* */ - /* A `cubic to' is emitted to indicate a third-order Bézier arc. */ - /* */ - /* <Input> */ - /* control1 :: A pointer to the first Bézier control point. */ - /* */ - /* control2 :: A pointer to the second Bézier control point. */ - /* */ - /* to :: A pointer to the target end point. */ - /* */ - /* user :: A typeless pointer which is passed from the caller of */ - /* the decomposition function. */ - /* */ - /* <Return> */ - /* Error code. 0~means success. */ - /* */ - typedef int - (*FT_Outline_CubicToFunc)( const FT_Vector* control1, - const FT_Vector* control2, - const FT_Vector* to, - void* user ); - -#define FT_Outline_CubicTo_Func FT_Outline_CubicToFunc - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FT_Outline_Funcs */ - /* */ - /* <Description> */ - /* A structure to hold various function pointers used during outline */ - /* decomposition in order to emit segments, conic, and cubic Béziers. */ - /* */ - /* <Fields> */ - /* move_to :: The `move to' emitter. */ - /* */ - /* line_to :: The segment emitter. */ - /* */ - /* conic_to :: The second-order Bézier arc emitter. */ - /* */ - /* cubic_to :: The third-order Bézier arc emitter. */ - /* */ - /* shift :: The shift that is applied to coordinates before they */ - /* are sent to the emitter. */ - /* */ - /* delta :: The delta that is applied to coordinates before they */ - /* are sent to the emitter, but after the shift. */ - /* */ - /* <Note> */ - /* The point coordinates sent to the emitters are the transformed */ - /* version of the original coordinates (this is important for high */ - /* accuracy during scan-conversion). The transformation is simple: */ - /* */ - /* { */ - /* x' = (x << shift) - delta */ - /* y' = (x << shift) - delta */ - /* } */ - /* */ - /* Set the values of `shift' and `delta' to~0 to get the original */ - /* point coordinates. */ - /* */ - typedef struct FT_Outline_Funcs_ - { - FT_Outline_MoveToFunc move_to; - FT_Outline_LineToFunc line_to; - FT_Outline_ConicToFunc conic_to; - FT_Outline_CubicToFunc cubic_to; - - int shift; - FT_Pos delta; - - } FT_Outline_Funcs; - - - /*************************************************************************/ - /* */ - /* <Section> */ - /* basic_types */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* <Macro> */ - /* FT_IMAGE_TAG */ - /* */ - /* <Description> */ - /* This macro converts four-letter tags to an unsigned long type. */ - /* */ - /* <Note> */ - /* Since many 16-bit compilers don't like 32-bit enumerations, you */ - /* should redefine this macro in case of problems to something like */ - /* this: */ - /* */ - /* { */ - /* #define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 ) value */ - /* } */ - /* */ - /* to get a simple enumeration without assigning special numbers. */ - /* */ -#ifndef FT_IMAGE_TAG -#define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 ) \ - value = ( ( (unsigned long)_x1 << 24 ) | \ - ( (unsigned long)_x2 << 16 ) | \ - ( (unsigned long)_x3 << 8 ) | \ - (unsigned long)_x4 ) -#endif /* FT_IMAGE_TAG */ - - - /*************************************************************************/ - /* */ - /* <Enum> */ - /* FT_Glyph_Format */ - /* */ - /* <Description> */ - /* An enumeration type used to describe the format of a given glyph */ - /* image. Note that this version of FreeType only supports two image */ - /* formats, even though future font drivers will be able to register */ - /* their own format. */ - /* */ - /* <Values> */ - /* FT_GLYPH_FORMAT_NONE :: */ - /* The value~0 is reserved. */ - /* */ - /* FT_GLYPH_FORMAT_COMPOSITE :: */ - /* The glyph image is a composite of several other images. This */ - /* format is _only_ used with @FT_LOAD_NO_RECURSE, and is used to */ - /* report compound glyphs (like accented characters). */ - /* */ - /* FT_GLYPH_FORMAT_BITMAP :: */ - /* The glyph image is a bitmap, and can be described as an */ - /* @FT_Bitmap. You generally need to access the `bitmap' field of */ - /* the @FT_GlyphSlotRec structure to read it. */ - /* */ - /* FT_GLYPH_FORMAT_OUTLINE :: */ - /* The glyph image is a vectorial outline made of line segments */ - /* and Bézier arcs; it can be described as an @FT_Outline; you */ - /* generally want to access the `outline' field of the */ - /* @FT_GlyphSlotRec structure to read it. */ - /* */ - /* FT_GLYPH_FORMAT_PLOTTER :: */ - /* The glyph image is a vectorial path with no inside and outside */ - /* contours. Some Type~1 fonts, like those in the Hershey family, */ - /* contain glyphs in this format. These are described as */ - /* @FT_Outline, but FreeType isn't currently capable of rendering */ - /* them correctly. */ - /* */ - typedef enum FT_Glyph_Format_ - { - FT_IMAGE_TAG( FT_GLYPH_FORMAT_NONE, 0, 0, 0, 0 ), - - FT_IMAGE_TAG( FT_GLYPH_FORMAT_COMPOSITE, 'c', 'o', 'm', 'p' ), - FT_IMAGE_TAG( FT_GLYPH_FORMAT_BITMAP, 'b', 'i', 't', 's' ), - FT_IMAGE_TAG( FT_GLYPH_FORMAT_OUTLINE, 'o', 'u', 't', 'l' ), - FT_IMAGE_TAG( FT_GLYPH_FORMAT_PLOTTER, 'p', 'l', 'o', 't' ) - - } FT_Glyph_Format; - - - /*************************************************************************/ - /* */ - /* <Enum> */ - /* ft_glyph_format_xxx */ - /* */ - /* <Description> */ - /* A list of deprecated constants. Use the corresponding */ - /* @FT_Glyph_Format values instead. */ - /* */ - /* <Values> */ - /* ft_glyph_format_none :: See @FT_GLYPH_FORMAT_NONE. */ - /* ft_glyph_format_composite :: See @FT_GLYPH_FORMAT_COMPOSITE. */ - /* ft_glyph_format_bitmap :: See @FT_GLYPH_FORMAT_BITMAP. */ - /* ft_glyph_format_outline :: See @FT_GLYPH_FORMAT_OUTLINE. */ - /* ft_glyph_format_plotter :: See @FT_GLYPH_FORMAT_PLOTTER. */ - /* */ -#define ft_glyph_format_none FT_GLYPH_FORMAT_NONE -#define ft_glyph_format_composite FT_GLYPH_FORMAT_COMPOSITE -#define ft_glyph_format_bitmap FT_GLYPH_FORMAT_BITMAP -#define ft_glyph_format_outline FT_GLYPH_FORMAT_OUTLINE -#define ft_glyph_format_plotter FT_GLYPH_FORMAT_PLOTTER - - - /*************************************************************************/ - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** R A S T E R D E F I N I T I O N S *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* A raster is a scan converter, in charge of rendering an outline into */ - /* a a bitmap. This section contains the public API for rasters. */ - /* */ - /* Note that in FreeType 2, all rasters are now encapsulated within */ - /* specific modules called `renderers'. See `freetype/ftrender.h' for */ - /* more details on renderers. */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* <Section> */ - /* raster */ - /* */ - /* <Title> */ - /* Scanline Converter */ - /* */ - /* <Abstract> */ - /* How vectorial outlines are converted into bitmaps and pixmaps. */ - /* */ - /* <Description> */ - /* This section contains technical definitions. */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FT_Raster */ - /* */ - /* <Description> */ - /* A handle (pointer) to a raster object. Each object can be used */ - /* independently to convert an outline into a bitmap or pixmap. */ - /* */ - typedef struct FT_RasterRec_* FT_Raster; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FT_Span */ - /* */ - /* <Description> */ - /* A structure used to model a single span of gray (or black) pixels */ - /* when rendering a monochrome or anti-aliased bitmap. */ - /* */ - /* <Fields> */ - /* x :: The span's horizontal start position. */ - /* */ - /* len :: The span's length in pixels. */ - /* */ - /* coverage :: The span color/coverage, ranging from 0 (background) */ - /* to 255 (foreground). Only used for anti-aliased */ - /* rendering. */ - /* */ - /* <Note> */ - /* This structure is used by the span drawing callback type named */ - /* @FT_SpanFunc which takes the y~coordinate of the span as a */ - /* a parameter. */ - /* */ - /* The coverage value is always between 0 and 255. If you want less */ - /* gray values, the callback function has to reduce them. */ - /* */ - typedef struct FT_Span_ - { - short x; - unsigned short len; - unsigned char coverage; - - } FT_Span; - - - /*************************************************************************/ - /* */ - /* <FuncType> */ - /* FT_SpanFunc */ - /* */ - /* <Description> */ - /* A function used as a call-back by the anti-aliased renderer in */ - /* order to let client applications draw themselves the gray pixel */ - /* spans on each scan line. */ - /* */ - /* <Input> */ - /* y :: The scanline's y~coordinate. */ - /* */ - /* count :: The number of spans to draw on this scanline. */ - /* */ - /* spans :: A table of `count' spans to draw on the scanline. */ - /* */ - /* user :: User-supplied data that is passed to the callback. */ - /* */ - /* <Note> */ - /* This callback allows client applications to directly render the */ - /* gray spans of the anti-aliased bitmap to any kind of surfaces. */ - /* */ - /* This can be used to write anti-aliased outlines directly to a */ - /* given background bitmap, and even perform translucency. */ - /* */ - /* Note that the `count' field cannot be greater than a fixed value */ - /* defined by the `FT_MAX_GRAY_SPANS' configuration macro in */ - /* `ftoption.h'. By default, this value is set to~32, which means */ - /* that if there are more than 32~spans on a given scanline, the */ - /* callback is called several times with the same `y' parameter in */ - /* order to draw all callbacks. */ - /* */ - /* Otherwise, the callback is only called once per scan-line, and */ - /* only for those scanlines that do have `gray' pixels on them. */ - /* */ - typedef void - (*FT_SpanFunc)( int y, - int count, - const FT_Span* spans, - void* user ); - -#define FT_Raster_Span_Func FT_SpanFunc - - - /*************************************************************************/ - /* */ - /* <FuncType> */ - /* FT_Raster_BitTest_Func */ - /* */ - /* <Description> */ - /* THIS TYPE IS DEPRECATED. DO NOT USE IT. */ - /* */ - /* A function used as a call-back by the monochrome scan-converter */ - /* to test whether a given target pixel is already set to the drawing */ - /* `color'. These tests are crucial to implement drop-out control */ - /* per-se the TrueType spec. */ - /* */ - /* <Input> */ - /* y :: The pixel's y~coordinate. */ - /* */ - /* x :: The pixel's x~coordinate. */ - /* */ - /* user :: User-supplied data that is passed to the callback. */ - /* */ - /* <Return> */ - /* 1~if the pixel is `set', 0~otherwise. */ - /* */ - typedef int - (*FT_Raster_BitTest_Func)( int y, - int x, - void* user ); - - - /*************************************************************************/ - /* */ - /* <FuncType> */ - /* FT_Raster_BitSet_Func */ - /* */ - /* <Description> */ - /* THIS TYPE IS DEPRECATED. DO NOT USE IT. */ - /* */ - /* A function used as a call-back by the monochrome scan-converter */ - /* to set an individual target pixel. This is crucial to implement */ - /* drop-out control according to the TrueType specification. */ - /* */ - /* <Input> */ - /* y :: The pixel's y~coordinate. */ - /* */ - /* x :: The pixel's x~coordinate. */ - /* */ - /* user :: User-supplied data that is passed to the callback. */ - /* */ - /* <Return> */ - /* 1~if the pixel is `set', 0~otherwise. */ - /* */ - typedef void - (*FT_Raster_BitSet_Func)( int y, - int x, - void* user ); - - - /*************************************************************************/ - /* */ - /* <Enum> */ - /* FT_RASTER_FLAG_XXX */ - /* */ - /* <Description> */ - /* A list of bit flag constants as used in the `flags' field of a */ - /* @FT_Raster_Params structure. */ - /* */ - /* <Values> */ - /* FT_RASTER_FLAG_DEFAULT :: This value is 0. */ - /* */ - /* FT_RASTER_FLAG_AA :: This flag is set to indicate that an */ - /* anti-aliased glyph image should be */ - /* generated. Otherwise, it will be */ - /* monochrome (1-bit). */ - /* */ - /* FT_RASTER_FLAG_DIRECT :: This flag is set to indicate direct */ - /* rendering. In this mode, client */ - /* applications must provide their own span */ - /* callback. This lets them directly */ - /* draw or compose over an existing bitmap. */ - /* If this bit is not set, the target */ - /* pixmap's buffer _must_ be zeroed before */ - /* rendering. */ - /* */ - /* Note that for now, direct rendering is */ - /* only possible with anti-aliased glyphs. */ - /* */ - /* FT_RASTER_FLAG_CLIP :: This flag is only used in direct */ - /* rendering mode. If set, the output will */ - /* be clipped to a box specified in the */ - /* `clip_box' field of the */ - /* @FT_Raster_Params structure. */ - /* */ - /* Note that by default, the glyph bitmap */ - /* is clipped to the target pixmap, except */ - /* in direct rendering mode where all spans */ - /* are generated if no clipping box is set. */ - /* */ -#define FT_RASTER_FLAG_DEFAULT 0x0 -#define FT_RASTER_FLAG_AA 0x1 -#define FT_RASTER_FLAG_DIRECT 0x2 -#define FT_RASTER_FLAG_CLIP 0x4 - - /* deprecated */ -#define ft_raster_flag_default FT_RASTER_FLAG_DEFAULT -#define ft_raster_flag_aa FT_RASTER_FLAG_AA -#define ft_raster_flag_direct FT_RASTER_FLAG_DIRECT -#define ft_raster_flag_clip FT_RASTER_FLAG_CLIP - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FT_Raster_Params */ - /* */ - /* <Description> */ - /* A structure to hold the arguments used by a raster's render */ - /* function. */ - /* */ - /* <Fields> */ - /* target :: The target bitmap. */ - /* */ - /* source :: A pointer to the source glyph image (e.g., an */ - /* @FT_Outline). */ - /* */ - /* flags :: The rendering flags. */ - /* */ - /* gray_spans :: The gray span drawing callback. */ - /* */ - /* black_spans :: The black span drawing callback. UNIMPLEMENTED! */ - /* */ - /* bit_test :: The bit test callback. UNIMPLEMENTED! */ - /* */ - /* bit_set :: The bit set callback. UNIMPLEMENTED! */ - /* */ - /* user :: User-supplied data that is passed to each drawing */ - /* callback. */ - /* */ - /* clip_box :: An optional clipping box. It is only used in */ - /* direct rendering mode. Note that coordinates here */ - /* should be expressed in _integer_ pixels (and not in */ - /* 26.6 fixed-point units). */ - /* */ - /* <Note> */ - /* An anti-aliased glyph bitmap is drawn if the @FT_RASTER_FLAG_AA */ - /* bit flag is set in the `flags' field, otherwise a monochrome */ - /* bitmap is generated. */ - /* */ - /* If the @FT_RASTER_FLAG_DIRECT bit flag is set in `flags', the */ - /* raster will call the `gray_spans' callback to draw gray pixel */ - /* spans, in the case of an aa glyph bitmap, it will call */ - /* `black_spans', and `bit_test' and `bit_set' in the case of a */ - /* monochrome bitmap. This allows direct composition over a */ - /* pre-existing bitmap through user-provided callbacks to perform the */ - /* span drawing/composition. */ - /* */ - /* Note that the `bit_test' and `bit_set' callbacks are required when */ - /* rendering a monochrome bitmap, as they are crucial to implement */ - /* correct drop-out control as defined in the TrueType specification. */ - /* */ - typedef struct FT_Raster_Params_ - { - const FT_Bitmap* target; - const void* source; - int flags; - FT_SpanFunc gray_spans; - FT_SpanFunc black_spans; /* doesn't work! */ - FT_Raster_BitTest_Func bit_test; /* doesn't work! */ - FT_Raster_BitSet_Func bit_set; /* doesn't work! */ - void* user; - FT_BBox clip_box; - - } FT_Raster_Params; - - - /*************************************************************************/ - /* */ - /* <FuncType> */ - /* FT_Raster_NewFunc */ - /* */ - /* <Description> */ - /* A function used to create a new raster object. */ - /* */ - /* <Input> */ - /* memory :: A handle to the memory allocator. */ - /* */ - /* <Output> */ - /* raster :: A handle to the new raster object. */ - /* */ - /* <Return> */ - /* Error code. 0~means success. */ - /* */ - /* <Note> */ - /* The `memory' parameter is a typeless pointer in order to avoid */ - /* un-wanted dependencies on the rest of the FreeType code. In */ - /* practice, it is an @FT_Memory object, i.e., a handle to the */ - /* standard FreeType memory allocator. However, this field can be */ - /* completely ignored by a given raster implementation. */ - /* */ - typedef int - (*FT_Raster_NewFunc)( void* memory, - FT_Raster* raster ); - -#define FT_Raster_New_Func FT_Raster_NewFunc - - - /*************************************************************************/ - /* */ - /* <FuncType> */ - /* FT_Raster_DoneFunc */ - /* */ - /* <Description> */ - /* A function used to destroy a given raster object. */ - /* */ - /* <Input> */ - /* raster :: A handle to the raster object. */ - /* */ - typedef void - (*FT_Raster_DoneFunc)( FT_Raster raster ); - -#define FT_Raster_Done_Func FT_Raster_DoneFunc - - - /*************************************************************************/ - /* */ - /* <FuncType> */ - /* FT_Raster_ResetFunc */ - /* */ - /* <Description> */ - /* FreeType provides an area of memory called the `render pool', */ - /* available to all registered rasters. This pool can be freely used */ - /* during a given scan-conversion but is shared by all rasters. Its */ - /* content is thus transient. */ - /* */ - /* This function is called each time the render pool changes, or just */ - /* after a new raster object is created. */ - /* */ - /* <Input> */ - /* raster :: A handle to the new raster object. */ - /* */ - /* pool_base :: The address in memory of the render pool. */ - /* */ - /* pool_size :: The size in bytes of the render pool. */ - /* */ - /* <Note> */ - /* Rasters can ignore the render pool and rely on dynamic memory */ - /* allocation if they want to (a handle to the memory allocator is */ - /* passed to the raster constructor). However, this is not */ - /* recommended for efficiency purposes. */ - /* */ - typedef void - (*FT_Raster_ResetFunc)( FT_Raster raster, - unsigned char* pool_base, - unsigned long pool_size ); - -#define FT_Raster_Reset_Func FT_Raster_ResetFunc - - - /*************************************************************************/ - /* */ - /* <FuncType> */ - /* FT_Raster_SetModeFunc */ - /* */ - /* <Description> */ - /* This function is a generic facility to change modes or attributes */ - /* in a given raster. This can be used for debugging purposes, or */ - /* simply to allow implementation-specific `features' in a given */ - /* raster module. */ - /* */ - /* <Input> */ - /* raster :: A handle to the new raster object. */ - /* */ - /* mode :: A 4-byte tag used to name the mode or property. */ - /* */ - /* args :: A pointer to the new mode/property to use. */ - /* */ - typedef int - (*FT_Raster_SetModeFunc)( FT_Raster raster, - unsigned long mode, - void* args ); - -#define FT_Raster_Set_Mode_Func FT_Raster_SetModeFunc - - - /*************************************************************************/ - /* */ - /* <FuncType> */ - /* FT_Raster_RenderFunc */ - /* */ - /* <Description> */ - /* Invoke a given raster to scan-convert a given glyph image into a */ - /* target bitmap. */ - /* */ - /* <Input> */ - /* raster :: A handle to the raster object. */ - /* */ - /* params :: A pointer to an @FT_Raster_Params structure used to */ - /* store the rendering parameters. */ - /* */ - /* <Return> */ - /* Error code. 0~means success. */ - /* */ - /* <Note> */ - /* The exact format of the source image depends on the raster's glyph */ - /* format defined in its @FT_Raster_Funcs structure. It can be an */ - /* @FT_Outline or anything else in order to support a large array of */ - /* glyph formats. */ - /* */ - /* Note also that the render function can fail and return a */ - /* `FT_Err_Unimplemented_Feature' error code if the raster used does */ - /* not support direct composition. */ - /* */ - /* XXX: For now, the standard raster doesn't support direct */ - /* composition but this should change for the final release (see */ - /* the files `demos/src/ftgrays.c' and `demos/src/ftgrays2.c' */ - /* for examples of distinct implementations which support direct */ - /* composition). */ - /* */ - typedef int - (*FT_Raster_RenderFunc)( FT_Raster raster, - const FT_Raster_Params* params ); - -#define FT_Raster_Render_Func FT_Raster_RenderFunc - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FT_Raster_Funcs */ - /* */ - /* <Description> */ - /* A structure used to describe a given raster class to the library. */ - /* */ - /* <Fields> */ - /* glyph_format :: The supported glyph format for this raster. */ - /* */ - /* raster_new :: The raster constructor. */ - /* */ - /* raster_reset :: Used to reset the render pool within the raster. */ - /* */ - /* raster_render :: A function to render a glyph into a given bitmap. */ - /* */ - /* raster_done :: The raster destructor. */ - /* */ - typedef struct FT_Raster_Funcs_ - { - FT_Glyph_Format glyph_format; - FT_Raster_NewFunc raster_new; - FT_Raster_ResetFunc raster_reset; - FT_Raster_SetModeFunc raster_set_mode; - FT_Raster_RenderFunc raster_render; - FT_Raster_DoneFunc raster_done; - - } FT_Raster_Funcs; - - - /* */ - - -FT_END_HEADER - -#endif /* __FTIMAGE_H__ */ - - -/* END */ - - -/* Local Variables: */ -/* coding: utf-8 */ -/* End: */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftlcdfil.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftlcdfil.h deleted file mode 100644 index 0b55ebee65..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftlcdfil.h +++ /dev/null @@ -1,213 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftlcdfil.h */ -/* */ -/* FreeType API for color filtering of subpixel bitmap glyphs */ -/* (specification). */ -/* */ -/* Copyright 2006, 2007, 2008, 2010 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __FT_LCD_FILTER_H__ -#define __FT_LCD_FILTER_H__ - -#include <ft2build.h> -#include FT_FREETYPE_H - -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - - -FT_BEGIN_HEADER - - /*************************************************************************** - * - * @section: - * lcd_filtering - * - * @title: - * LCD Filtering - * - * @abstract: - * Reduce color fringes of LCD-optimized bitmaps. - * - * @description: - * The @FT_Library_SetLcdFilter API can be used to specify a low-pass - * filter which is then applied to LCD-optimized bitmaps generated - * through @FT_Render_Glyph. This is useful to reduce color fringes - * which would occur with unfiltered rendering. - * - * Note that no filter is active by default, and that this function is - * *not* implemented in default builds of the library. You need to - * #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING in your `ftoption.h' file - * in order to activate it. - */ - - - /**************************************************************************** - * - * @enum: - * FT_LcdFilter - * - * @description: - * A list of values to identify various types of LCD filters. - * - * @values: - * FT_LCD_FILTER_NONE :: - * Do not perform filtering. When used with subpixel rendering, this - * results in sometimes severe color fringes. - * - * FT_LCD_FILTER_DEFAULT :: - * The default filter reduces color fringes considerably, at the cost - * of a slight blurriness in the output. - * - * FT_LCD_FILTER_LIGHT :: - * The light filter is a variant that produces less blurriness at the - * cost of slightly more color fringes than the default one. It might - * be better, depending on taste, your monitor, or your personal vision. - * - * FT_LCD_FILTER_LEGACY :: - * This filter corresponds to the original libXft color filter. It - * provides high contrast output but can exhibit really bad color - * fringes if glyphs are not extremely well hinted to the pixel grid. - * In other words, it only works well if the TrueType bytecode - * interpreter is enabled *and* high-quality hinted fonts are used. - * - * This filter is only provided for comparison purposes, and might be - * disabled or stay unsupported in the future. - * - * @since: - * 2.3.0 - */ - typedef enum FT_LcdFilter_ - { - FT_LCD_FILTER_NONE = 0, - FT_LCD_FILTER_DEFAULT = 1, - FT_LCD_FILTER_LIGHT = 2, - FT_LCD_FILTER_LEGACY = 16, - - FT_LCD_FILTER_MAX /* do not remove */ - - } FT_LcdFilter; - - - /************************************************************************** - * - * @func: - * FT_Library_SetLcdFilter - * - * @description: - * This function is used to apply color filtering to LCD decimated - * bitmaps, like the ones used when calling @FT_Render_Glyph with - * @FT_RENDER_MODE_LCD or @FT_RENDER_MODE_LCD_V. - * - * @input: - * library :: - * A handle to the target library instance. - * - * filter :: - * The filter type. - * - * You can use @FT_LCD_FILTER_NONE here to disable this feature, or - * @FT_LCD_FILTER_DEFAULT to use a default filter that should work - * well on most LCD screens. - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * This feature is always disabled by default. Clients must make an - * explicit call to this function with a `filter' value other than - * @FT_LCD_FILTER_NONE in order to enable it. - * - * Due to *PATENTS* covering subpixel rendering, this function doesn't - * do anything except returning `FT_Err_Unimplemented_Feature' if the - * configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING is not - * defined in your build of the library, which should correspond to all - * default builds of FreeType. - * - * The filter affects glyph bitmaps rendered through @FT_Render_Glyph, - * @FT_Outline_Get_Bitmap, @FT_Load_Glyph, and @FT_Load_Char. - * - * It does _not_ affect the output of @FT_Outline_Render and - * @FT_Outline_Get_Bitmap. - * - * If this feature is activated, the dimensions of LCD glyph bitmaps are - * either larger or taller than the dimensions of the corresponding - * outline with regards to the pixel grid. For example, for - * @FT_RENDER_MODE_LCD, the filter adds up to 3~pixels to the left, and - * up to 3~pixels to the right. - * - * The bitmap offset values are adjusted correctly, so clients shouldn't - * need to modify their layout and glyph positioning code when enabling - * the filter. - * - * @since: - * 2.3.0 - */ - FT_EXPORT( FT_Error ) - FT_Library_SetLcdFilter( FT_Library library, - FT_LcdFilter filter ); - - - /************************************************************************** - * - * @func: - * FT_Library_SetLcdFilterWeights - * - * @description: - * Use this function to override the filter weights selected by - * @FT_Library_SetLcdFilter. By default, FreeType uses the quintuple - * (0x00, 0x55, 0x56, 0x55, 0x00) for FT_LCD_FILTER_LIGHT, and (0x10, - * 0x40, 0x70, 0x40, 0x10) for FT_LCD_FILTER_DEFAULT and - * FT_LCD_FILTER_LEGACY. - * - * @input: - * library :: - * A handle to the target library instance. - * - * weights :: - * A pointer to an array; the function copies the first five bytes and - * uses them to specify the filter weights. - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * Due to *PATENTS* covering subpixel rendering, this function doesn't - * do anything except returning `FT_Err_Unimplemented_Feature' if the - * configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING is not - * defined in your build of the library, which should correspond to all - * default builds of FreeType. - * - * This function must be called after @FT_Library_SetLcdFilter to have - * any effect. - * - * @since: - * 2.4.0 - */ - FT_EXPORT( FT_Error ) - FT_Library_SetLcdFilterWeights( FT_Library library, - unsigned char *weights ); - - /* */ - - -FT_END_HEADER - -#endif /* __FT_LCD_FILTER_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftmodapi.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftmodapi.h deleted file mode 100644 index 8f2e017947..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftmodapi.h +++ /dev/null @@ -1,483 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftmodapi.h */ -/* */ -/* FreeType modules public interface (specification). */ -/* */ -/* Copyright 1996-2001, 2002, 2003, 2006, 2008, 2009, 2010 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __FTMODAPI_H__ -#define __FTMODAPI_H__ - - -#include <ft2build.h> -#include FT_FREETYPE_H - -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - - -FT_BEGIN_HEADER - - - /*************************************************************************/ - /* */ - /* <Section> */ - /* module_management */ - /* */ - /* <Title> */ - /* Module Management */ - /* */ - /* <Abstract> */ - /* How to add, upgrade, and remove modules from FreeType. */ - /* */ - /* <Description> */ - /* The definitions below are used to manage modules within FreeType. */ - /* Modules can be added, upgraded, and removed at runtime. */ - /* */ - /*************************************************************************/ - - - /* module bit flags */ -#define FT_MODULE_FONT_DRIVER 1 /* this module is a font driver */ -#define FT_MODULE_RENDERER 2 /* this module is a renderer */ -#define FT_MODULE_HINTER 4 /* this module is a glyph hinter */ -#define FT_MODULE_STYLER 8 /* this module is a styler */ - -#define FT_MODULE_DRIVER_SCALABLE 0x100 /* the driver supports */ - /* scalable fonts */ -#define FT_MODULE_DRIVER_NO_OUTLINES 0x200 /* the driver does not */ - /* support vector outlines */ -#define FT_MODULE_DRIVER_HAS_HINTER 0x400 /* the driver provides its */ - /* own hinter */ - - - /* deprecated values */ -#define ft_module_font_driver FT_MODULE_FONT_DRIVER -#define ft_module_renderer FT_MODULE_RENDERER -#define ft_module_hinter FT_MODULE_HINTER -#define ft_module_styler FT_MODULE_STYLER - -#define ft_module_driver_scalable FT_MODULE_DRIVER_SCALABLE -#define ft_module_driver_no_outlines FT_MODULE_DRIVER_NO_OUTLINES -#define ft_module_driver_has_hinter FT_MODULE_DRIVER_HAS_HINTER - - - typedef FT_Pointer FT_Module_Interface; - - - /*************************************************************************/ - /* */ - /* <FuncType> */ - /* FT_Module_Constructor */ - /* */ - /* <Description> */ - /* A function used to initialize (not create) a new module object. */ - /* */ - /* <Input> */ - /* module :: The module to initialize. */ - /* */ - typedef FT_Error - (*FT_Module_Constructor)( FT_Module module ); - - - /*************************************************************************/ - /* */ - /* <FuncType> */ - /* FT_Module_Destructor */ - /* */ - /* <Description> */ - /* A function used to finalize (not destroy) a given module object. */ - /* */ - /* <Input> */ - /* module :: The module to finalize. */ - /* */ - typedef void - (*FT_Module_Destructor)( FT_Module module ); - - - /*************************************************************************/ - /* */ - /* <FuncType> */ - /* FT_Module_Requester */ - /* */ - /* <Description> */ - /* A function used to query a given module for a specific interface. */ - /* */ - /* <Input> */ - /* module :: The module to finalize. */ - /* */ - /* name :: The name of the interface in the module. */ - /* */ - typedef FT_Module_Interface - (*FT_Module_Requester)( FT_Module module, - const char* name ); - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FT_Module_Class */ - /* */ - /* <Description> */ - /* The module class descriptor. */ - /* */ - /* <Fields> */ - /* module_flags :: Bit flags describing the module. */ - /* */ - /* module_size :: The size of one module object/instance in */ - /* bytes. */ - /* */ - /* module_name :: The name of the module. */ - /* */ - /* module_version :: The version, as a 16.16 fixed number */ - /* (major.minor). */ - /* */ - /* module_requires :: The version of FreeType this module requires, */ - /* as a 16.16 fixed number (major.minor). Starts */ - /* at version 2.0, i.e., 0x20000. */ - /* */ - /* module_init :: The initializing function. */ - /* */ - /* module_done :: The finalizing function. */ - /* */ - /* get_interface :: The interface requesting function. */ - /* */ - typedef struct FT_Module_Class_ - { - FT_ULong module_flags; - FT_Long module_size; - const FT_String* module_name; - FT_Fixed module_version; - FT_Fixed module_requires; - - const void* module_interface; - - FT_Module_Constructor module_init; - FT_Module_Destructor module_done; - FT_Module_Requester get_interface; - - } FT_Module_Class; - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Add_Module */ - /* */ - /* <Description> */ - /* Add a new module to a given library instance. */ - /* */ - /* <InOut> */ - /* library :: A handle to the library object. */ - /* */ - /* <Input> */ - /* clazz :: A pointer to class descriptor for the module. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - /* <Note> */ - /* An error will be returned if a module already exists by that name, */ - /* or if the module requires a version of FreeType that is too great. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Add_Module( FT_Library library, - const FT_Module_Class* clazz ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Get_Module */ - /* */ - /* <Description> */ - /* Find a module by its name. */ - /* */ - /* <Input> */ - /* library :: A handle to the library object. */ - /* */ - /* module_name :: The module's name (as an ASCII string). */ - /* */ - /* <Return> */ - /* A module handle. 0~if none was found. */ - /* */ - /* <Note> */ - /* FreeType's internal modules aren't documented very well, and you */ - /* should look up the source code for details. */ - /* */ - FT_EXPORT( FT_Module ) - FT_Get_Module( FT_Library library, - const char* module_name ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Remove_Module */ - /* */ - /* <Description> */ - /* Remove a given module from a library instance. */ - /* */ - /* <InOut> */ - /* library :: A handle to a library object. */ - /* */ - /* <Input> */ - /* module :: A handle to a module object. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - /* <Note> */ - /* The module object is destroyed by the function in case of success. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Remove_Module( FT_Library library, - FT_Module module ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Reference_Library */ - /* */ - /* <Description> */ - /* A counter gets initialized to~1 at the time an @FT_Library */ - /* structure is created. This function increments the counter. */ - /* @FT_Done_Library then only destroys a library if the counter is~1, */ - /* otherwise it simply decrements the counter. */ - /* */ - /* This function helps in managing life-cycles of structures which */ - /* reference @FT_Library objects. */ - /* */ - /* <Input> */ - /* library :: A handle to a target library object. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - /* <Since> */ - /* 2.4.2 */ - /* */ - FT_EXPORT( FT_Error ) - FT_Reference_Library( FT_Library library ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_New_Library */ - /* */ - /* <Description> */ - /* This function is used to create a new FreeType library instance */ - /* from a given memory object. It is thus possible to use libraries */ - /* with distinct memory allocators within the same program. */ - /* */ - /* Normally, you would call this function (followed by a call to */ - /* @FT_Add_Default_Modules or a series of calls to @FT_Add_Module) */ - /* instead of @FT_Init_FreeType to initialize the FreeType library. */ - /* */ - /* Don't use @FT_Done_FreeType but @FT_Done_Library to destroy a */ - /* library instance. */ - /* */ - /* <Input> */ - /* memory :: A handle to the original memory object. */ - /* */ - /* <Output> */ - /* alibrary :: A pointer to handle of a new library object. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - /* <Note> */ - /* See the discussion of reference counters in the description of */ - /* @FT_Reference_Library. */ - /* */ - FT_EXPORT( FT_Error ) - FT_New_Library( FT_Memory memory, - FT_Library *alibrary ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Done_Library */ - /* */ - /* <Description> */ - /* Discard a given library object. This closes all drivers and */ - /* discards all resource objects. */ - /* */ - /* <Input> */ - /* library :: A handle to the target library. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - /* <Note> */ - /* See the discussion of reference counters in the description of */ - /* @FT_Reference_Library. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Done_Library( FT_Library library ); - -/* */ - - typedef void - (*FT_DebugHook_Func)( void* arg ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Set_Debug_Hook */ - /* */ - /* <Description> */ - /* Set a debug hook function for debugging the interpreter of a font */ - /* format. */ - /* */ - /* <InOut> */ - /* library :: A handle to the library object. */ - /* */ - /* <Input> */ - /* hook_index :: The index of the debug hook. You should use the */ - /* values defined in `ftobjs.h', e.g., */ - /* `FT_DEBUG_HOOK_TRUETYPE'. */ - /* */ - /* debug_hook :: The function used to debug the interpreter. */ - /* */ - /* <Note> */ - /* Currently, four debug hook slots are available, but only two (for */ - /* the TrueType and the Type~1 interpreter) are defined. */ - /* */ - /* Since the internal headers of FreeType are no longer installed, */ - /* the symbol `FT_DEBUG_HOOK_TRUETYPE' isn't available publicly. */ - /* This is a bug and will be fixed in a forthcoming release. */ - /* */ - FT_EXPORT( void ) - FT_Set_Debug_Hook( FT_Library library, - FT_UInt hook_index, - FT_DebugHook_Func debug_hook ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Add_Default_Modules */ - /* */ - /* <Description> */ - /* Add the set of default drivers to a given library object. */ - /* This is only useful when you create a library object with */ - /* @FT_New_Library (usually to plug a custom memory manager). */ - /* */ - /* <InOut> */ - /* library :: A handle to a new library object. */ - /* */ - FT_EXPORT( void ) - FT_Add_Default_Modules( FT_Library library ); - - - - /************************************************************************** - * - * @section: - * truetype_engine - * - * @title: - * The TrueType Engine - * - * @abstract: - * TrueType bytecode support. - * - * @description: - * This section contains a function used to query the level of TrueType - * bytecode support compiled in this version of the library. - * - */ - - - /************************************************************************** - * - * @enum: - * FT_TrueTypeEngineType - * - * @description: - * A list of values describing which kind of TrueType bytecode - * engine is implemented in a given FT_Library instance. It is used - * by the @FT_Get_TrueType_Engine_Type function. - * - * @values: - * FT_TRUETYPE_ENGINE_TYPE_NONE :: - * The library doesn't implement any kind of bytecode interpreter. - * - * FT_TRUETYPE_ENGINE_TYPE_UNPATENTED :: - * The library implements a bytecode interpreter that doesn't - * support the patented operations of the TrueType virtual machine. - * - * Its main use is to load certain Asian fonts which position and - * scale glyph components with bytecode instructions. It produces - * bad output for most other fonts. - * - * FT_TRUETYPE_ENGINE_TYPE_PATENTED :: - * The library implements a bytecode interpreter that covers - * the full instruction set of the TrueType virtual machine (this - * was governed by patents until May 2010, hence the name). - * - * @since: - * 2.2 - * - */ - typedef enum FT_TrueTypeEngineType_ - { - FT_TRUETYPE_ENGINE_TYPE_NONE = 0, - FT_TRUETYPE_ENGINE_TYPE_UNPATENTED, - FT_TRUETYPE_ENGINE_TYPE_PATENTED - - } FT_TrueTypeEngineType; - - - /************************************************************************** - * - * @func: - * FT_Get_TrueType_Engine_Type - * - * @description: - * Return an @FT_TrueTypeEngineType value to indicate which level of - * the TrueType virtual machine a given library instance supports. - * - * @input: - * library :: - * A library instance. - * - * @return: - * A value indicating which level is supported. - * - * @since: - * 2.2 - * - */ - FT_EXPORT( FT_TrueTypeEngineType ) - FT_Get_TrueType_Engine_Type( FT_Library library ); - - - /* */ - - -FT_END_HEADER - -#endif /* __FTMODAPI_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftmoderr.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftmoderr.h deleted file mode 100644 index 1bf3b384ab..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftmoderr.h +++ /dev/null @@ -1,156 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftmoderr.h */ -/* */ -/* FreeType module error offsets (specification). */ -/* */ -/* Copyright 2001, 2002, 2003, 2004, 2005, 2010 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - - /*************************************************************************/ - /* */ - /* This file is used to define the FreeType module error offsets. */ - /* */ - /* The lower byte gives the error code, the higher byte gives the */ - /* module. The base module has error offset 0. For example, the error */ - /* `FT_Err_Invalid_File_Format' has value 0x003, the error */ - /* `TT_Err_Invalid_File_Format' has value 0x1103, the error */ - /* `T1_Err_Invalid_File_Format' has value 0x1203, etc. */ - /* */ - /* Undefine the macro FT_CONFIG_OPTION_USE_MODULE_ERRORS in ftoption.h */ - /* to make the higher byte always zero (disabling the module error */ - /* mechanism). */ - /* */ - /* It can also be used to create a module error message table easily */ - /* with something like */ - /* */ - /* { */ - /* #undef __FTMODERR_H__ */ - /* #define FT_MODERRDEF( e, v, s ) { FT_Mod_Err_ ## e, s }, */ - /* #define FT_MODERR_START_LIST { */ - /* #define FT_MODERR_END_LIST { 0, 0 } }; */ - /* */ - /* const struct */ - /* { */ - /* int mod_err_offset; */ - /* const char* mod_err_msg */ - /* } ft_mod_errors[] = */ - /* */ - /* #include FT_MODULE_ERRORS_H */ - /* } */ - /* */ - /* To use such a table, all errors must be ANDed with 0xFF00 to remove */ - /* the error code. */ - /* */ - /*************************************************************************/ - - -#ifndef __FTMODERR_H__ -#define __FTMODERR_H__ - - - /*******************************************************************/ - /*******************************************************************/ - /***** *****/ - /***** SETUP MACROS *****/ - /***** *****/ - /*******************************************************************/ - /*******************************************************************/ - - -#undef FT_NEED_EXTERN_C - -#ifndef FT_MODERRDEF - -#ifdef FT_CONFIG_OPTION_USE_MODULE_ERRORS -#define FT_MODERRDEF( e, v, s ) FT_Mod_Err_ ## e = v, -#else -#define FT_MODERRDEF( e, v, s ) FT_Mod_Err_ ## e = 0, -#endif - -#define FT_MODERR_START_LIST enum { -#define FT_MODERR_END_LIST FT_Mod_Err_Max }; - -#ifdef __cplusplus -#define FT_NEED_EXTERN_C - extern "C" { -#endif - -#endif /* !FT_MODERRDEF */ - - - /*******************************************************************/ - /*******************************************************************/ - /***** *****/ - /***** LIST MODULE ERROR BASES *****/ - /***** *****/ - /*******************************************************************/ - /*******************************************************************/ - - -#ifdef FT_MODERR_START_LIST - FT_MODERR_START_LIST -#endif - - - FT_MODERRDEF( Base, 0x000, "base module" ) - FT_MODERRDEF( Autofit, 0x100, "autofitter module" ) - FT_MODERRDEF( BDF, 0x200, "BDF module" ) - FT_MODERRDEF( Bzip2, 0x300, "Bzip2 module" ) - FT_MODERRDEF( Cache, 0x400, "cache module" ) - FT_MODERRDEF( CFF, 0x500, "CFF module" ) - FT_MODERRDEF( CID, 0x600, "CID module" ) - FT_MODERRDEF( Gzip, 0x700, "Gzip module" ) - FT_MODERRDEF( LZW, 0x800, "LZW module" ) - FT_MODERRDEF( OTvalid, 0x900, "OpenType validation module" ) - FT_MODERRDEF( PCF, 0xA00, "PCF module" ) - FT_MODERRDEF( PFR, 0xB00, "PFR module" ) - FT_MODERRDEF( PSaux, 0xC00, "PS auxiliary module" ) - FT_MODERRDEF( PShinter, 0xD00, "PS hinter module" ) - FT_MODERRDEF( PSnames, 0xE00, "PS names module" ) - FT_MODERRDEF( Raster, 0xF00, "raster module" ) - FT_MODERRDEF( SFNT, 0x1000, "SFNT module" ) - FT_MODERRDEF( Smooth, 0x1100, "smooth raster module" ) - FT_MODERRDEF( TrueType, 0x1200, "TrueType module" ) - FT_MODERRDEF( Type1, 0x1300, "Type 1 module" ) - FT_MODERRDEF( Type42, 0x1400, "Type 42 module" ) - FT_MODERRDEF( Winfonts, 0x1500, "Windows FON/FNT module" ) - - -#ifdef FT_MODERR_END_LIST - FT_MODERR_END_LIST -#endif - - - /*******************************************************************/ - /*******************************************************************/ - /***** *****/ - /***** CLEANUP *****/ - /***** *****/ - /*******************************************************************/ - /*******************************************************************/ - - -#ifdef FT_NEED_EXTERN_C - } -#endif - -#undef FT_MODERR_START_LIST -#undef FT_MODERR_END_LIST -#undef FT_MODERRDEF -#undef FT_NEED_EXTERN_C - - -#endif /* __FTMODERR_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftoutln.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftoutln.h deleted file mode 100644 index 1cf3c3f800..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftoutln.h +++ /dev/null @@ -1,540 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftoutln.h */ -/* */ -/* Support for the FT_Outline type used to store glyph shapes of */ -/* most scalable font formats (specification). */ -/* */ -/* Copyright 1996-2003, 2005-2011 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __FTOUTLN_H__ -#define __FTOUTLN_H__ - - -#include <ft2build.h> -#include FT_FREETYPE_H - -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - - -FT_BEGIN_HEADER - - - /*************************************************************************/ - /* */ - /* <Section> */ - /* outline_processing */ - /* */ - /* <Title> */ - /* Outline Processing */ - /* */ - /* <Abstract> */ - /* Functions to create, transform, and render vectorial glyph images. */ - /* */ - /* <Description> */ - /* This section contains routines used to create and destroy scalable */ - /* glyph images known as `outlines'. These can also be measured, */ - /* transformed, and converted into bitmaps and pixmaps. */ - /* */ - /* <Order> */ - /* FT_Outline */ - /* FT_OUTLINE_FLAGS */ - /* FT_Outline_New */ - /* FT_Outline_Done */ - /* FT_Outline_Copy */ - /* FT_Outline_Translate */ - /* FT_Outline_Transform */ - /* FT_Outline_Embolden */ - /* FT_Outline_Reverse */ - /* FT_Outline_Check */ - /* */ - /* FT_Outline_Get_CBox */ - /* FT_Outline_Get_BBox */ - /* */ - /* FT_Outline_Get_Bitmap */ - /* FT_Outline_Render */ - /* */ - /* FT_Outline_Decompose */ - /* FT_Outline_Funcs */ - /* FT_Outline_MoveTo_Func */ - /* FT_Outline_LineTo_Func */ - /* FT_Outline_ConicTo_Func */ - /* FT_Outline_CubicTo_Func */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Outline_Decompose */ - /* */ - /* <Description> */ - /* Walk over an outline's structure to decompose it into individual */ - /* segments and Bézier arcs. This function also emits `move to' */ - /* operations to indicate the start of new contours in the outline. */ - /* */ - /* <Input> */ - /* outline :: A pointer to the source target. */ - /* */ - /* func_interface :: A table of `emitters', i.e., function pointers */ - /* called during decomposition to indicate path */ - /* operations. */ - /* */ - /* <InOut> */ - /* user :: A typeless pointer which is passed to each */ - /* emitter during the decomposition. It can be */ - /* used to store the state during the */ - /* decomposition. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Outline_Decompose( FT_Outline* outline, - const FT_Outline_Funcs* func_interface, - void* user ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Outline_New */ - /* */ - /* <Description> */ - /* Create a new outline of a given size. */ - /* */ - /* <Input> */ - /* library :: A handle to the library object from where the */ - /* outline is allocated. Note however that the new */ - /* outline will *not* necessarily be *freed*, when */ - /* destroying the library, by @FT_Done_FreeType. */ - /* */ - /* numPoints :: The maximal number of points within the outline. */ - /* */ - /* numContours :: The maximal number of contours within the outline. */ - /* */ - /* <Output> */ - /* anoutline :: A handle to the new outline. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - /* <Note> */ - /* The reason why this function takes a `library' parameter is simply */ - /* to use the library's memory allocator. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Outline_New( FT_Library library, - FT_UInt numPoints, - FT_Int numContours, - FT_Outline *anoutline ); - - - FT_EXPORT( FT_Error ) - FT_Outline_New_Internal( FT_Memory memory, - FT_UInt numPoints, - FT_Int numContours, - FT_Outline *anoutline ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Outline_Done */ - /* */ - /* <Description> */ - /* Destroy an outline created with @FT_Outline_New. */ - /* */ - /* <Input> */ - /* library :: A handle of the library object used to allocate the */ - /* outline. */ - /* */ - /* outline :: A pointer to the outline object to be discarded. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - /* <Note> */ - /* If the outline's `owner' field is not set, only the outline */ - /* descriptor will be released. */ - /* */ - /* The reason why this function takes an `library' parameter is */ - /* simply to use ft_mem_free(). */ - /* */ - FT_EXPORT( FT_Error ) - FT_Outline_Done( FT_Library library, - FT_Outline* outline ); - - - FT_EXPORT( FT_Error ) - FT_Outline_Done_Internal( FT_Memory memory, - FT_Outline* outline ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Outline_Check */ - /* */ - /* <Description> */ - /* Check the contents of an outline descriptor. */ - /* */ - /* <Input> */ - /* outline :: A handle to a source outline. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Outline_Check( FT_Outline* outline ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Outline_Get_CBox */ - /* */ - /* <Description> */ - /* Return an outline's `control box'. The control box encloses all */ - /* the outline's points, including Bézier control points. Though it */ - /* coincides with the exact bounding box for most glyphs, it can be */ - /* slightly larger in some situations (like when rotating an outline */ - /* which contains Bézier outside arcs). */ - /* */ - /* Computing the control box is very fast, while getting the bounding */ - /* box can take much more time as it needs to walk over all segments */ - /* and arcs in the outline. To get the latter, you can use the */ - /* `ftbbox' component which is dedicated to this single task. */ - /* */ - /* <Input> */ - /* outline :: A pointer to the source outline descriptor. */ - /* */ - /* <Output> */ - /* acbox :: The outline's control box. */ - /* */ - /* <Note> */ - /* See @FT_Glyph_Get_CBox for a discussion of tricky fonts. */ - /* */ - FT_EXPORT( void ) - FT_Outline_Get_CBox( const FT_Outline* outline, - FT_BBox *acbox ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Outline_Translate */ - /* */ - /* <Description> */ - /* Apply a simple translation to the points of an outline. */ - /* */ - /* <InOut> */ - /* outline :: A pointer to the target outline descriptor. */ - /* */ - /* <Input> */ - /* xOffset :: The horizontal offset. */ - /* */ - /* yOffset :: The vertical offset. */ - /* */ - FT_EXPORT( void ) - FT_Outline_Translate( const FT_Outline* outline, - FT_Pos xOffset, - FT_Pos yOffset ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Outline_Copy */ - /* */ - /* <Description> */ - /* Copy an outline into another one. Both objects must have the */ - /* same sizes (number of points & number of contours) when this */ - /* function is called. */ - /* */ - /* <Input> */ - /* source :: A handle to the source outline. */ - /* */ - /* <Output> */ - /* target :: A handle to the target outline. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Outline_Copy( const FT_Outline* source, - FT_Outline *target ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Outline_Transform */ - /* */ - /* <Description> */ - /* Apply a simple 2x2 matrix to all of an outline's points. Useful */ - /* for applying rotations, slanting, flipping, etc. */ - /* */ - /* <InOut> */ - /* outline :: A pointer to the target outline descriptor. */ - /* */ - /* <Input> */ - /* matrix :: A pointer to the transformation matrix. */ - /* */ - /* <Note> */ - /* You can use @FT_Outline_Translate if you need to translate the */ - /* outline's points. */ - /* */ - FT_EXPORT( void ) - FT_Outline_Transform( const FT_Outline* outline, - const FT_Matrix* matrix ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Outline_Embolden */ - /* */ - /* <Description> */ - /* Embolden an outline. The new outline will be at most 4~times */ - /* `strength' pixels wider and higher. You may think of the left and */ - /* bottom borders as unchanged. */ - /* */ - /* Negative `strength' values to reduce the outline thickness are */ - /* possible also. */ - /* */ - /* <InOut> */ - /* outline :: A handle to the target outline. */ - /* */ - /* <Input> */ - /* strength :: How strong the glyph is emboldened. Expressed in */ - /* 26.6 pixel format. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - /* <Note> */ - /* The used algorithm to increase or decrease the thickness of the */ - /* glyph doesn't change the number of points; this means that certain */ - /* situations like acute angles or intersections are sometimes */ - /* handled incorrectly. */ - /* */ - /* If you need `better' metrics values you should call */ - /* @FT_Outline_Get_CBox or @FT_Outline_Get_BBox. */ - /* */ - /* Example call: */ - /* */ - /* { */ - /* FT_Load_Glyph( face, index, FT_LOAD_DEFAULT ); */ - /* if ( face->slot->format == FT_GLYPH_FORMAT_OUTLINE ) */ - /* FT_Outline_Embolden( &face->slot->outline, strength ); */ - /* } */ - /* */ - FT_EXPORT( FT_Error ) - FT_Outline_Embolden( FT_Outline* outline, - FT_Pos strength ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Outline_Reverse */ - /* */ - /* <Description> */ - /* Reverse the drawing direction of an outline. This is used to */ - /* ensure consistent fill conventions for mirrored glyphs. */ - /* */ - /* <InOut> */ - /* outline :: A pointer to the target outline descriptor. */ - /* */ - /* <Note> */ - /* This function toggles the bit flag @FT_OUTLINE_REVERSE_FILL in */ - /* the outline's `flags' field. */ - /* */ - /* It shouldn't be used by a normal client application, unless it */ - /* knows what it is doing. */ - /* */ - FT_EXPORT( void ) - FT_Outline_Reverse( FT_Outline* outline ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Outline_Get_Bitmap */ - /* */ - /* <Description> */ - /* Render an outline within a bitmap. The outline's image is simply */ - /* OR-ed to the target bitmap. */ - /* */ - /* <Input> */ - /* library :: A handle to a FreeType library object. */ - /* */ - /* outline :: A pointer to the source outline descriptor. */ - /* */ - /* <InOut> */ - /* abitmap :: A pointer to the target bitmap descriptor. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - /* <Note> */ - /* This function does NOT CREATE the bitmap, it only renders an */ - /* outline image within the one you pass to it! Consequently, the */ - /* various fields in `abitmap' should be set accordingly. */ - /* */ - /* It will use the raster corresponding to the default glyph format. */ - /* */ - /* The value of the `num_grays' field in `abitmap' is ignored. If */ - /* you select the gray-level rasterizer, and you want less than 256 */ - /* gray levels, you have to use @FT_Outline_Render directly. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Outline_Get_Bitmap( FT_Library library, - FT_Outline* outline, - const FT_Bitmap *abitmap ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Outline_Render */ - /* */ - /* <Description> */ - /* Render an outline within a bitmap using the current scan-convert. */ - /* This function uses an @FT_Raster_Params structure as an argument, */ - /* allowing advanced features like direct composition, translucency, */ - /* etc. */ - /* */ - /* <Input> */ - /* library :: A handle to a FreeType library object. */ - /* */ - /* outline :: A pointer to the source outline descriptor. */ - /* */ - /* <InOut> */ - /* params :: A pointer to an @FT_Raster_Params structure used to */ - /* describe the rendering operation. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - /* <Note> */ - /* You should know what you are doing and how @FT_Raster_Params works */ - /* to use this function. */ - /* */ - /* The field `params.source' will be set to `outline' before the scan */ - /* converter is called, which means that the value you give to it is */ - /* actually ignored. */ - /* */ - /* The gray-level rasterizer always uses 256 gray levels. If you */ - /* want less gray levels, you have to provide your own span callback. */ - /* See the @FT_RASTER_FLAG_DIRECT value of the `flags' field in the */ - /* @FT_Raster_Params structure for more details. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Outline_Render( FT_Library library, - FT_Outline* outline, - FT_Raster_Params* params ); - - - /************************************************************************** - * - * @enum: - * FT_Orientation - * - * @description: - * A list of values used to describe an outline's contour orientation. - * - * The TrueType and PostScript specifications use different conventions - * to determine whether outline contours should be filled or unfilled. - * - * @values: - * FT_ORIENTATION_TRUETYPE :: - * According to the TrueType specification, clockwise contours must - * be filled, and counter-clockwise ones must be unfilled. - * - * FT_ORIENTATION_POSTSCRIPT :: - * According to the PostScript specification, counter-clockwise contours - * must be filled, and clockwise ones must be unfilled. - * - * FT_ORIENTATION_FILL_RIGHT :: - * This is identical to @FT_ORIENTATION_TRUETYPE, but is used to - * remember that in TrueType, everything that is to the right of - * the drawing direction of a contour must be filled. - * - * FT_ORIENTATION_FILL_LEFT :: - * This is identical to @FT_ORIENTATION_POSTSCRIPT, but is used to - * remember that in PostScript, everything that is to the left of - * the drawing direction of a contour must be filled. - * - * FT_ORIENTATION_NONE :: - * The orientation cannot be determined. That is, different parts of - * the glyph have different orientation. - * - */ - typedef enum FT_Orientation_ - { - FT_ORIENTATION_TRUETYPE = 0, - FT_ORIENTATION_POSTSCRIPT = 1, - FT_ORIENTATION_FILL_RIGHT = FT_ORIENTATION_TRUETYPE, - FT_ORIENTATION_FILL_LEFT = FT_ORIENTATION_POSTSCRIPT, - FT_ORIENTATION_NONE - - } FT_Orientation; - - - /************************************************************************** - * - * @function: - * FT_Outline_Get_Orientation - * - * @description: - * This function analyzes a glyph outline and tries to compute its - * fill orientation (see @FT_Orientation). This is done by computing - * the direction of each global horizontal and/or vertical extrema - * within the outline. - * - * Note that this will return @FT_ORIENTATION_TRUETYPE for empty - * outlines. - * - * @input: - * outline :: - * A handle to the source outline. - * - * @return: - * The orientation. - * - */ - FT_EXPORT( FT_Orientation ) - FT_Outline_Get_Orientation( FT_Outline* outline ); - - - /* */ - - -FT_END_HEADER - -#endif /* __FTOUTLN_H__ */ - - -/* END */ - - -/* Local Variables: */ -/* coding: utf-8 */ -/* End: */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftstroke.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftstroke.h deleted file mode 100644 index 49ae2bc061..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftstroke.h +++ /dev/null @@ -1,741 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftstroke.h */ -/* */ -/* FreeType path stroker (specification). */ -/* */ -/* Copyright 2002-2006, 2008, 2009, 2011 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __FT_STROKE_H__ -#define __FT_STROKE_H__ - -#include <ft2build.h> -#include FT_OUTLINE_H -#include FT_GLYPH_H - - -FT_BEGIN_HEADER - - - /************************************************************************ - * - * @section: - * glyph_stroker - * - * @title: - * Glyph Stroker - * - * @abstract: - * Generating bordered and stroked glyphs. - * - * @description: - * This component generates stroked outlines of a given vectorial - * glyph. It also allows you to retrieve the `outside' and/or the - * `inside' borders of the stroke. - * - * This can be useful to generate `bordered' glyph, i.e., glyphs - * displayed with a coloured (and anti-aliased) border around their - * shape. - */ - - - /************************************************************** - * - * @type: - * FT_Stroker - * - * @description: - * Opaque handler to a path stroker object. - */ - typedef struct FT_StrokerRec_* FT_Stroker; - - - /************************************************************** - * - * @enum: - * FT_Stroker_LineJoin - * - * @description: - * These values determine how two joining lines are rendered - * in a stroker. - * - * @values: - * FT_STROKER_LINEJOIN_ROUND :: - * Used to render rounded line joins. Circular arcs are used - * to join two lines smoothly. - * - * FT_STROKER_LINEJOIN_BEVEL :: - * Used to render beveled line joins. The outer corner of - * the joined lines is filled by enclosing the triangular - * region of the corner with a straight line between the - * outer corners of each stroke. - * - * FT_STROKER_LINEJOIN_MITER_FIXED :: - * Used to render mitered line joins, with fixed bevels if the - * miter limit is exceeded. The outer edges of the strokes - * for the two segments are extended until they meet at an - * angle. If the segments meet at too sharp an angle (such - * that the miter would extend from the intersection of the - * segments a distance greater than the product of the miter - * limit value and the border radius), then a bevel join (see - * above) is used instead. This prevents long spikes being - * created. FT_STROKER_LINEJOIN_MITER_FIXED generates a miter - * line join as used in PostScript and PDF. - * - * FT_STROKER_LINEJOIN_MITER_VARIABLE :: - * FT_STROKER_LINEJOIN_MITER :: - * Used to render mitered line joins, with variable bevels if - * the miter limit is exceeded. The intersection of the - * strokes is clipped at a line perpendicular to the bisector - * of the angle between the strokes, at the distance from the - * intersection of the segments equal to the product of the - * miter limit value and the border radius. This prevents - * long spikes being created. - * FT_STROKER_LINEJOIN_MITER_VARIABLE generates a mitered line - * join as used in XPS. FT_STROKER_LINEJOIN_MITER is an alias - * for FT_STROKER_LINEJOIN_MITER_VARIABLE, retained for - * backwards compatibility. - */ - typedef enum FT_Stroker_LineJoin_ - { - FT_STROKER_LINEJOIN_ROUND = 0, - FT_STROKER_LINEJOIN_BEVEL = 1, - FT_STROKER_LINEJOIN_MITER_VARIABLE = 2, - FT_STROKER_LINEJOIN_MITER = FT_STROKER_LINEJOIN_MITER_VARIABLE, - FT_STROKER_LINEJOIN_MITER_FIXED = 3 - - } FT_Stroker_LineJoin; - - - /************************************************************** - * - * @enum: - * FT_Stroker_LineCap - * - * @description: - * These values determine how the end of opened sub-paths are - * rendered in a stroke. - * - * @values: - * FT_STROKER_LINECAP_BUTT :: - * The end of lines is rendered as a full stop on the last - * point itself. - * - * FT_STROKER_LINECAP_ROUND :: - * The end of lines is rendered as a half-circle around the - * last point. - * - * FT_STROKER_LINECAP_SQUARE :: - * The end of lines is rendered as a square around the - * last point. - */ - typedef enum FT_Stroker_LineCap_ - { - FT_STROKER_LINECAP_BUTT = 0, - FT_STROKER_LINECAP_ROUND, - FT_STROKER_LINECAP_SQUARE - - } FT_Stroker_LineCap; - - - /************************************************************** - * - * @enum: - * FT_StrokerBorder - * - * @description: - * These values are used to select a given stroke border - * in @FT_Stroker_GetBorderCounts and @FT_Stroker_ExportBorder. - * - * @values: - * FT_STROKER_BORDER_LEFT :: - * Select the left border, relative to the drawing direction. - * - * FT_STROKER_BORDER_RIGHT :: - * Select the right border, relative to the drawing direction. - * - * @note: - * Applications are generally interested in the `inside' and `outside' - * borders. However, there is no direct mapping between these and the - * `left' and `right' ones, since this really depends on the glyph's - * drawing orientation, which varies between font formats. - * - * You can however use @FT_Outline_GetInsideBorder and - * @FT_Outline_GetOutsideBorder to get these. - */ - typedef enum FT_StrokerBorder_ - { - FT_STROKER_BORDER_LEFT = 0, - FT_STROKER_BORDER_RIGHT - - } FT_StrokerBorder; - - - /************************************************************** - * - * @function: - * FT_Outline_GetInsideBorder - * - * @description: - * Retrieve the @FT_StrokerBorder value corresponding to the - * `inside' borders of a given outline. - * - * @input: - * outline :: - * The source outline handle. - * - * @return: - * The border index. @FT_STROKER_BORDER_RIGHT for empty or invalid - * outlines. - */ - FT_EXPORT( FT_StrokerBorder ) - FT_Outline_GetInsideBorder( FT_Outline* outline ); - - - /************************************************************** - * - * @function: - * FT_Outline_GetOutsideBorder - * - * @description: - * Retrieve the @FT_StrokerBorder value corresponding to the - * `outside' borders of a given outline. - * - * @input: - * outline :: - * The source outline handle. - * - * @return: - * The border index. @FT_STROKER_BORDER_LEFT for empty or invalid - * outlines. - */ - FT_EXPORT( FT_StrokerBorder ) - FT_Outline_GetOutsideBorder( FT_Outline* outline ); - - - /************************************************************** - * - * @function: - * FT_Stroker_New - * - * @description: - * Create a new stroker object. - * - * @input: - * library :: - * FreeType library handle. - * - * @output: - * astroker :: - * A new stroker object handle. NULL in case of error. - * - * @return: - * FreeType error code. 0~means success. - */ - FT_EXPORT( FT_Error ) - FT_Stroker_New( FT_Library library, - FT_Stroker *astroker ); - - - /************************************************************** - * - * @function: - * FT_Stroker_Set - * - * @description: - * Reset a stroker object's attributes. - * - * @input: - * stroker :: - * The target stroker handle. - * - * radius :: - * The border radius. - * - * line_cap :: - * The line cap style. - * - * line_join :: - * The line join style. - * - * miter_limit :: - * The miter limit for the FT_STROKER_LINEJOIN_MITER_FIXED and - * FT_STROKER_LINEJOIN_MITER_VARIABLE line join styles, - * expressed as 16.16 fixed point value. - * - * @note: - * The radius is expressed in the same units as the outline - * coordinates. - */ - FT_EXPORT( void ) - FT_Stroker_Set( FT_Stroker stroker, - FT_Fixed radius, - FT_Stroker_LineCap line_cap, - FT_Stroker_LineJoin line_join, - FT_Fixed miter_limit ); - - - /************************************************************** - * - * @function: - * FT_Stroker_Rewind - * - * @description: - * Reset a stroker object without changing its attributes. - * You should call this function before beginning a new - * series of calls to @FT_Stroker_BeginSubPath or - * @FT_Stroker_EndSubPath. - * - * @input: - * stroker :: - * The target stroker handle. - */ - FT_EXPORT( void ) - FT_Stroker_Rewind( FT_Stroker stroker ); - - - /************************************************************** - * - * @function: - * FT_Stroker_ParseOutline - * - * @description: - * A convenience function used to parse a whole outline with - * the stroker. The resulting outline(s) can be retrieved - * later by functions like @FT_Stroker_GetCounts and @FT_Stroker_Export. - * - * @input: - * stroker :: - * The target stroker handle. - * - * outline :: - * The source outline. - * - * opened :: - * A boolean. If~1, the outline is treated as an open path instead - * of a closed one. - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * If `opened' is~0 (the default), the outline is treated as a closed - * path, and the stroker generates two distinct `border' outlines. - * - * If `opened' is~1, the outline is processed as an open path, and the - * stroker generates a single `stroke' outline. - * - * This function calls @FT_Stroker_Rewind automatically. - */ - FT_EXPORT( FT_Error ) - FT_Stroker_ParseOutline( FT_Stroker stroker, - FT_Outline* outline, - FT_Bool opened ); - - - /************************************************************** - * - * @function: - * FT_Stroker_BeginSubPath - * - * @description: - * Start a new sub-path in the stroker. - * - * @input: - * stroker :: - * The target stroker handle. - * - * to :: - * A pointer to the start vector. - * - * open :: - * A boolean. If~1, the sub-path is treated as an open one. - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * This function is useful when you need to stroke a path that is - * not stored as an @FT_Outline object. - */ - FT_EXPORT( FT_Error ) - FT_Stroker_BeginSubPath( FT_Stroker stroker, - FT_Vector* to, - FT_Bool open ); - - - /************************************************************** - * - * @function: - * FT_Stroker_EndSubPath - * - * @description: - * Close the current sub-path in the stroker. - * - * @input: - * stroker :: - * The target stroker handle. - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * You should call this function after @FT_Stroker_BeginSubPath. - * If the subpath was not `opened', this function `draws' a - * single line segment to the start position when needed. - */ - FT_EXPORT( FT_Error ) - FT_Stroker_EndSubPath( FT_Stroker stroker ); - - - /************************************************************** - * - * @function: - * FT_Stroker_LineTo - * - * @description: - * `Draw' a single line segment in the stroker's current sub-path, - * from the last position. - * - * @input: - * stroker :: - * The target stroker handle. - * - * to :: - * A pointer to the destination point. - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * You should call this function between @FT_Stroker_BeginSubPath and - * @FT_Stroker_EndSubPath. - */ - FT_EXPORT( FT_Error ) - FT_Stroker_LineTo( FT_Stroker stroker, - FT_Vector* to ); - - - /************************************************************** - * - * @function: - * FT_Stroker_ConicTo - * - * @description: - * `Draw' a single quadratic Bézier in the stroker's current sub-path, - * from the last position. - * - * @input: - * stroker :: - * The target stroker handle. - * - * control :: - * A pointer to a Bézier control point. - * - * to :: - * A pointer to the destination point. - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * You should call this function between @FT_Stroker_BeginSubPath and - * @FT_Stroker_EndSubPath. - */ - FT_EXPORT( FT_Error ) - FT_Stroker_ConicTo( FT_Stroker stroker, - FT_Vector* control, - FT_Vector* to ); - - - /************************************************************** - * - * @function: - * FT_Stroker_CubicTo - * - * @description: - * `Draw' a single cubic Bézier in the stroker's current sub-path, - * from the last position. - * - * @input: - * stroker :: - * The target stroker handle. - * - * control1 :: - * A pointer to the first Bézier control point. - * - * control2 :: - * A pointer to second Bézier control point. - * - * to :: - * A pointer to the destination point. - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * You should call this function between @FT_Stroker_BeginSubPath and - * @FT_Stroker_EndSubPath. - */ - FT_EXPORT( FT_Error ) - FT_Stroker_CubicTo( FT_Stroker stroker, - FT_Vector* control1, - FT_Vector* control2, - FT_Vector* to ); - - - /************************************************************** - * - * @function: - * FT_Stroker_GetBorderCounts - * - * @description: - * Call this function once you have finished parsing your paths - * with the stroker. It returns the number of points and - * contours necessary to export one of the `border' or `stroke' - * outlines generated by the stroker. - * - * @input: - * stroker :: - * The target stroker handle. - * - * border :: - * The border index. - * - * @output: - * anum_points :: - * The number of points. - * - * anum_contours :: - * The number of contours. - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * When an outline, or a sub-path, is `closed', the stroker generates - * two independent `border' outlines, named `left' and `right'. - * - * When the outline, or a sub-path, is `opened', the stroker merges - * the `border' outlines with caps. The `left' border receives all - * points, while the `right' border becomes empty. - * - * Use the function @FT_Stroker_GetCounts instead if you want to - * retrieve the counts associated to both borders. - */ - FT_EXPORT( FT_Error ) - FT_Stroker_GetBorderCounts( FT_Stroker stroker, - FT_StrokerBorder border, - FT_UInt *anum_points, - FT_UInt *anum_contours ); - - - /************************************************************** - * - * @function: - * FT_Stroker_ExportBorder - * - * @description: - * Call this function after @FT_Stroker_GetBorderCounts to - * export the corresponding border to your own @FT_Outline - * structure. - * - * Note that this function appends the border points and - * contours to your outline, but does not try to resize its - * arrays. - * - * @input: - * stroker :: - * The target stroker handle. - * - * border :: - * The border index. - * - * outline :: - * The target outline handle. - * - * @note: - * Always call this function after @FT_Stroker_GetBorderCounts to - * get sure that there is enough room in your @FT_Outline object to - * receive all new data. - * - * When an outline, or a sub-path, is `closed', the stroker generates - * two independent `border' outlines, named `left' and `right' - * - * When the outline, or a sub-path, is `opened', the stroker merges - * the `border' outlines with caps. The `left' border receives all - * points, while the `right' border becomes empty. - * - * Use the function @FT_Stroker_Export instead if you want to - * retrieve all borders at once. - */ - FT_EXPORT( void ) - FT_Stroker_ExportBorder( FT_Stroker stroker, - FT_StrokerBorder border, - FT_Outline* outline ); - - - /************************************************************** - * - * @function: - * FT_Stroker_GetCounts - * - * @description: - * Call this function once you have finished parsing your paths - * with the stroker. It returns the number of points and - * contours necessary to export all points/borders from the stroked - * outline/path. - * - * @input: - * stroker :: - * The target stroker handle. - * - * @output: - * anum_points :: - * The number of points. - * - * anum_contours :: - * The number of contours. - * - * @return: - * FreeType error code. 0~means success. - */ - FT_EXPORT( FT_Error ) - FT_Stroker_GetCounts( FT_Stroker stroker, - FT_UInt *anum_points, - FT_UInt *anum_contours ); - - - /************************************************************** - * - * @function: - * FT_Stroker_Export - * - * @description: - * Call this function after @FT_Stroker_GetBorderCounts to - * export all borders to your own @FT_Outline structure. - * - * Note that this function appends the border points and - * contours to your outline, but does not try to resize its - * arrays. - * - * @input: - * stroker :: - * The target stroker handle. - * - * outline :: - * The target outline handle. - */ - FT_EXPORT( void ) - FT_Stroker_Export( FT_Stroker stroker, - FT_Outline* outline ); - - - /************************************************************** - * - * @function: - * FT_Stroker_Done - * - * @description: - * Destroy a stroker object. - * - * @input: - * stroker :: - * A stroker handle. Can be NULL. - */ - FT_EXPORT( void ) - FT_Stroker_Done( FT_Stroker stroker ); - - - /************************************************************** - * - * @function: - * FT_Glyph_Stroke - * - * @description: - * Stroke a given outline glyph object with a given stroker. - * - * @inout: - * pglyph :: - * Source glyph handle on input, new glyph handle on output. - * - * @input: - * stroker :: - * A stroker handle. - * - * destroy :: - * A Boolean. If~1, the source glyph object is destroyed - * on success. - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * The source glyph is untouched in case of error. - */ - FT_EXPORT( FT_Error ) - FT_Glyph_Stroke( FT_Glyph *pglyph, - FT_Stroker stroker, - FT_Bool destroy ); - - - /************************************************************** - * - * @function: - * FT_Glyph_StrokeBorder - * - * @description: - * Stroke a given outline glyph object with a given stroker, but - * only return either its inside or outside border. - * - * @inout: - * pglyph :: - * Source glyph handle on input, new glyph handle on output. - * - * @input: - * stroker :: - * A stroker handle. - * - * inside :: - * A Boolean. If~1, return the inside border, otherwise - * the outside border. - * - * destroy :: - * A Boolean. If~1, the source glyph object is destroyed - * on success. - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * The source glyph is untouched in case of error. - */ - FT_EXPORT( FT_Error ) - FT_Glyph_StrokeBorder( FT_Glyph *pglyph, - FT_Stroker stroker, - FT_Bool inside, - FT_Bool destroy ); - - /* */ - -FT_END_HEADER - -#endif /* __FT_STROKE_H__ */ - - -/* END */ - - -/* Local Variables: */ -/* coding: utf-8 */ -/* End: */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftsynth.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftsynth.h deleted file mode 100644 index a068b7928d..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftsynth.h +++ /dev/null @@ -1,80 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftsynth.h */ -/* */ -/* FreeType synthesizing code for emboldening and slanting */ -/* (specification). */ -/* */ -/* Copyright 2000-2001, 2003, 2006, 2008 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - - /*************************************************************************/ - /*************************************************************************/ - /*************************************************************************/ - /*************************************************************************/ - /*************************************************************************/ - /********* *********/ - /********* WARNING, THIS IS ALPHA CODE! THIS API *********/ - /********* IS DUE TO CHANGE UNTIL STRICTLY NOTIFIED BY THE *********/ - /********* FREETYPE DEVELOPMENT TEAM *********/ - /********* *********/ - /*************************************************************************/ - /*************************************************************************/ - /*************************************************************************/ - /*************************************************************************/ - /*************************************************************************/ - - - /* Main reason for not lifting the functions in this module to a */ - /* `standard' API is that the used parameters for emboldening and */ - /* slanting are not configurable. Consider the functions as a */ - /* code resource which should be copied into the application and */ - /* adapted to the particular needs. */ - - -#ifndef __FTSYNTH_H__ -#define __FTSYNTH_H__ - - -#include <ft2build.h> -#include FT_FREETYPE_H - -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - - -FT_BEGIN_HEADER - - /* Embolden a glyph by a `reasonable' value (which is highly a matter of */ - /* taste). This function is actually a convenience function, providing */ - /* a wrapper for @FT_Outline_Embolden and @FT_Bitmap_Embolden. */ - /* */ - /* For emboldened outlines the metrics are estimates only; if you need */ - /* precise values you should call @FT_Outline_Get_CBox. */ - FT_EXPORT( void ) - FT_GlyphSlot_Embolden( FT_GlyphSlot slot ); - - /* Slant an outline glyph to the right by about 12 degrees. */ - FT_EXPORT( void ) - FT_GlyphSlot_Oblique( FT_GlyphSlot slot ); - - /* */ - -FT_END_HEADER - -#endif /* __FTSYNTH_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/fttrigon.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/fttrigon.h deleted file mode 100644 index 6b77d2ee54..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/fttrigon.h +++ /dev/null @@ -1,350 +0,0 @@ -/***************************************************************************/ -/* */ -/* fttrigon.h */ -/* */ -/* FreeType trigonometric functions (specification). */ -/* */ -/* Copyright 2001, 2003, 2005, 2007 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __FTTRIGON_H__ -#define __FTTRIGON_H__ - -#include FT_FREETYPE_H - -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - - -FT_BEGIN_HEADER - - - /*************************************************************************/ - /* */ - /* <Section> */ - /* computations */ - /* */ - /*************************************************************************/ - - - /************************************************************************* - * - * @type: - * FT_Angle - * - * @description: - * This type is used to model angle values in FreeType. Note that the - * angle is a 16.16 fixed float value expressed in degrees. - * - */ - typedef FT_Fixed FT_Angle; - - - /************************************************************************* - * - * @macro: - * FT_ANGLE_PI - * - * @description: - * The angle pi expressed in @FT_Angle units. - * - */ -#define FT_ANGLE_PI ( 180L << 16 ) - - - /************************************************************************* - * - * @macro: - * FT_ANGLE_2PI - * - * @description: - * The angle 2*pi expressed in @FT_Angle units. - * - */ -#define FT_ANGLE_2PI ( FT_ANGLE_PI * 2 ) - - - /************************************************************************* - * - * @macro: - * FT_ANGLE_PI2 - * - * @description: - * The angle pi/2 expressed in @FT_Angle units. - * - */ -#define FT_ANGLE_PI2 ( FT_ANGLE_PI / 2 ) - - - /************************************************************************* - * - * @macro: - * FT_ANGLE_PI4 - * - * @description: - * The angle pi/4 expressed in @FT_Angle units. - * - */ -#define FT_ANGLE_PI4 ( FT_ANGLE_PI / 4 ) - - - /************************************************************************* - * - * @function: - * FT_Sin - * - * @description: - * Return the sinus of a given angle in fixed point format. - * - * @input: - * angle :: - * The input angle. - * - * @return: - * The sinus value. - * - * @note: - * If you need both the sinus and cosinus for a given angle, use the - * function @FT_Vector_Unit. - * - */ - FT_EXPORT( FT_Fixed ) - FT_Sin( FT_Angle angle ); - - - /************************************************************************* - * - * @function: - * FT_Cos - * - * @description: - * Return the cosinus of a given angle in fixed point format. - * - * @input: - * angle :: - * The input angle. - * - * @return: - * The cosinus value. - * - * @note: - * If you need both the sinus and cosinus for a given angle, use the - * function @FT_Vector_Unit. - * - */ - FT_EXPORT( FT_Fixed ) - FT_Cos( FT_Angle angle ); - - - /************************************************************************* - * - * @function: - * FT_Tan - * - * @description: - * Return the tangent of a given angle in fixed point format. - * - * @input: - * angle :: - * The input angle. - * - * @return: - * The tangent value. - * - */ - FT_EXPORT( FT_Fixed ) - FT_Tan( FT_Angle angle ); - - - /************************************************************************* - * - * @function: - * FT_Atan2 - * - * @description: - * Return the arc-tangent corresponding to a given vector (x,y) in - * the 2d plane. - * - * @input: - * x :: - * The horizontal vector coordinate. - * - * y :: - * The vertical vector coordinate. - * - * @return: - * The arc-tangent value (i.e. angle). - * - */ - FT_EXPORT( FT_Angle ) - FT_Atan2( FT_Fixed x, - FT_Fixed y ); - - - /************************************************************************* - * - * @function: - * FT_Angle_Diff - * - * @description: - * Return the difference between two angles. The result is always - * constrained to the ]-PI..PI] interval. - * - * @input: - * angle1 :: - * First angle. - * - * angle2 :: - * Second angle. - * - * @return: - * Constrained value of `value2-value1'. - * - */ - FT_EXPORT( FT_Angle ) - FT_Angle_Diff( FT_Angle angle1, - FT_Angle angle2 ); - - - /************************************************************************* - * - * @function: - * FT_Vector_Unit - * - * @description: - * Return the unit vector corresponding to a given angle. After the - * call, the value of `vec.x' will be `sin(angle)', and the value of - * `vec.y' will be `cos(angle)'. - * - * This function is useful to retrieve both the sinus and cosinus of a - * given angle quickly. - * - * @output: - * vec :: - * The address of target vector. - * - * @input: - * angle :: - * The address of angle. - * - */ - FT_EXPORT( void ) - FT_Vector_Unit( FT_Vector* vec, - FT_Angle angle ); - - - /************************************************************************* - * - * @function: - * FT_Vector_Rotate - * - * @description: - * Rotate a vector by a given angle. - * - * @inout: - * vec :: - * The address of target vector. - * - * @input: - * angle :: - * The address of angle. - * - */ - FT_EXPORT( void ) - FT_Vector_Rotate( FT_Vector* vec, - FT_Angle angle ); - - - /************************************************************************* - * - * @function: - * FT_Vector_Length - * - * @description: - * Return the length of a given vector. - * - * @input: - * vec :: - * The address of target vector. - * - * @return: - * The vector length, expressed in the same units that the original - * vector coordinates. - * - */ - FT_EXPORT( FT_Fixed ) - FT_Vector_Length( FT_Vector* vec ); - - - /************************************************************************* - * - * @function: - * FT_Vector_Polarize - * - * @description: - * Compute both the length and angle of a given vector. - * - * @input: - * vec :: - * The address of source vector. - * - * @output: - * length :: - * The vector length. - * - * angle :: - * The vector angle. - * - */ - FT_EXPORT( void ) - FT_Vector_Polarize( FT_Vector* vec, - FT_Fixed *length, - FT_Angle *angle ); - - - /************************************************************************* - * - * @function: - * FT_Vector_From_Polar - * - * @description: - * Compute vector coordinates from a length and angle. - * - * @output: - * vec :: - * The address of source vector. - * - * @input: - * length :: - * The vector length. - * - * angle :: - * The vector angle. - * - */ - FT_EXPORT( void ) - FT_Vector_From_Polar( FT_Vector* vec, - FT_Fixed length, - FT_Angle angle ); - - /* */ - - -FT_END_HEADER - -#endif /* __FTTRIGON_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/fttypes.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/fttypes.h deleted file mode 100644 index 3255527449..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/fttypes.h +++ /dev/null @@ -1,588 +0,0 @@ -/***************************************************************************/ -/* */ -/* fttypes.h */ -/* */ -/* FreeType simple types definitions (specification only). */ -/* */ -/* Copyright 1996-2002, 2004, 2006-2009, 2012 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __FTTYPES_H__ -#define __FTTYPES_H__ - - -#include <ft2build.h> -#include FT_CONFIG_CONFIG_H -#include FT_SYSTEM_H -#include FT_IMAGE_H - -#include <stddef.h> - - -FT_BEGIN_HEADER - - - /*************************************************************************/ - /* */ - /* <Section> */ - /* basic_types */ - /* */ - /* <Title> */ - /* Basic Data Types */ - /* */ - /* <Abstract> */ - /* The basic data types defined by the library. */ - /* */ - /* <Description> */ - /* This section contains the basic data types defined by FreeType~2, */ - /* ranging from simple scalar types to bitmap descriptors. More */ - /* font-specific structures are defined in a different section. */ - /* */ - /* <Order> */ - /* FT_Byte */ - /* FT_Bytes */ - /* FT_Char */ - /* FT_Int */ - /* FT_UInt */ - /* FT_Int16 */ - /* FT_UInt16 */ - /* FT_Int32 */ - /* FT_UInt32 */ - /* FT_Short */ - /* FT_UShort */ - /* FT_Long */ - /* FT_ULong */ - /* FT_Bool */ - /* FT_Offset */ - /* FT_PtrDist */ - /* FT_String */ - /* FT_Tag */ - /* FT_Error */ - /* FT_Fixed */ - /* FT_Pointer */ - /* FT_Pos */ - /* FT_Vector */ - /* FT_BBox */ - /* FT_Matrix */ - /* FT_FWord */ - /* FT_UFWord */ - /* FT_F2Dot14 */ - /* FT_UnitVector */ - /* FT_F26Dot6 */ - /* */ - /* */ - /* FT_Generic */ - /* FT_Generic_Finalizer */ - /* */ - /* FT_Bitmap */ - /* FT_Pixel_Mode */ - /* FT_Palette_Mode */ - /* FT_Glyph_Format */ - /* FT_IMAGE_TAG */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FT_Bool */ - /* */ - /* <Description> */ - /* A typedef of unsigned char, used for simple booleans. As usual, */ - /* values 1 and~0 represent true and false, respectively. */ - /* */ - typedef unsigned char FT_Bool; - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FT_FWord */ - /* */ - /* <Description> */ - /* A signed 16-bit integer used to store a distance in original font */ - /* units. */ - /* */ - typedef signed short FT_FWord; /* distance in FUnits */ - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FT_UFWord */ - /* */ - /* <Description> */ - /* An unsigned 16-bit integer used to store a distance in original */ - /* font units. */ - /* */ - typedef unsigned short FT_UFWord; /* unsigned distance */ - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FT_Char */ - /* */ - /* <Description> */ - /* A simple typedef for the _signed_ char type. */ - /* */ - typedef signed char FT_Char; - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FT_Byte */ - /* */ - /* <Description> */ - /* A simple typedef for the _unsigned_ char type. */ - /* */ - typedef unsigned char FT_Byte; - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FT_Bytes */ - /* */ - /* <Description> */ - /* A typedef for constant memory areas. */ - /* */ - typedef const FT_Byte* FT_Bytes; - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FT_Tag */ - /* */ - /* <Description> */ - /* A typedef for 32-bit tags (as used in the SFNT format). */ - /* */ - typedef FT_UInt32 FT_Tag; - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FT_String */ - /* */ - /* <Description> */ - /* A simple typedef for the char type, usually used for strings. */ - /* */ - typedef char FT_String; - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FT_Short */ - /* */ - /* <Description> */ - /* A typedef for signed short. */ - /* */ - typedef signed short FT_Short; - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FT_UShort */ - /* */ - /* <Description> */ - /* A typedef for unsigned short. */ - /* */ - typedef unsigned short FT_UShort; - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FT_Int */ - /* */ - /* <Description> */ - /* A typedef for the int type. */ - /* */ - typedef signed int FT_Int; - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FT_UInt */ - /* */ - /* <Description> */ - /* A typedef for the unsigned int type. */ - /* */ - typedef unsigned int FT_UInt; - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FT_Long */ - /* */ - /* <Description> */ - /* A typedef for signed long. */ - /* */ - typedef signed long FT_Long; - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FT_ULong */ - /* */ - /* <Description> */ - /* A typedef for unsigned long. */ - /* */ - typedef unsigned long FT_ULong; - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FT_F2Dot14 */ - /* */ - /* <Description> */ - /* A signed 2.14 fixed float type used for unit vectors. */ - /* */ - typedef signed short FT_F2Dot14; - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FT_F26Dot6 */ - /* */ - /* <Description> */ - /* A signed 26.6 fixed float type used for vectorial pixel */ - /* coordinates. */ - /* */ - typedef signed long FT_F26Dot6; - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FT_Fixed */ - /* */ - /* <Description> */ - /* This type is used to store 16.16 fixed float values, like scaling */ - /* values or matrix coefficients. */ - /* */ - typedef signed long FT_Fixed; - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FT_Error */ - /* */ - /* <Description> */ - /* The FreeType error code type. A value of~0 is always interpreted */ - /* as a successful operation. */ - /* */ - typedef int FT_Error; - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FT_Pointer */ - /* */ - /* <Description> */ - /* A simple typedef for a typeless pointer. */ - /* */ - typedef void* FT_Pointer; - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FT_Offset */ - /* */ - /* <Description> */ - /* This is equivalent to the ANSI~C `size_t' type, i.e., the largest */ - /* _unsigned_ integer type used to express a file size or position, */ - /* or a memory block size. */ - /* */ - typedef size_t FT_Offset; - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FT_PtrDist */ - /* */ - /* <Description> */ - /* This is equivalent to the ANSI~C `ptrdiff_t' type, i.e., the */ - /* largest _signed_ integer type used to express the distance */ - /* between two pointers. */ - /* */ - typedef ft_ptrdiff_t FT_PtrDist; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FT_UnitVector */ - /* */ - /* <Description> */ - /* A simple structure used to store a 2D vector unit vector. Uses */ - /* FT_F2Dot14 types. */ - /* */ - /* <Fields> */ - /* x :: Horizontal coordinate. */ - /* */ - /* y :: Vertical coordinate. */ - /* */ - typedef struct FT_UnitVector_ - { - FT_F2Dot14 x; - FT_F2Dot14 y; - - } FT_UnitVector; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FT_Matrix */ - /* */ - /* <Description> */ - /* A simple structure used to store a 2x2 matrix. Coefficients are */ - /* in 16.16 fixed float format. The computation performed is: */ - /* */ - /* { */ - /* x' = x*xx + y*xy */ - /* y' = x*yx + y*yy */ - /* } */ - /* */ - /* <Fields> */ - /* xx :: Matrix coefficient. */ - /* */ - /* xy :: Matrix coefficient. */ - /* */ - /* yx :: Matrix coefficient. */ - /* */ - /* yy :: Matrix coefficient. */ - /* */ - typedef struct FT_Matrix_ - { - FT_Fixed xx, xy; - FT_Fixed yx, yy; - - } FT_Matrix; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FT_Data */ - /* */ - /* <Description> */ - /* Read-only binary data represented as a pointer and a length. */ - /* */ - /* <Fields> */ - /* pointer :: The data. */ - /* */ - /* length :: The length of the data in bytes. */ - /* */ - typedef struct FT_Data_ - { - const FT_Byte* pointer; - FT_Int length; - - } FT_Data; - - - /*************************************************************************/ - /* */ - /* <FuncType> */ - /* FT_Generic_Finalizer */ - /* */ - /* <Description> */ - /* Describe a function used to destroy the `client' data of any */ - /* FreeType object. See the description of the @FT_Generic type for */ - /* details of usage. */ - /* */ - /* <Input> */ - /* The address of the FreeType object which is under finalization. */ - /* Its client data is accessed through its `generic' field. */ - /* */ - typedef void (*FT_Generic_Finalizer)(void* object); - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FT_Generic */ - /* */ - /* <Description> */ - /* Client applications often need to associate their own data to a */ - /* variety of FreeType core objects. For example, a text layout API */ - /* might want to associate a glyph cache to a given size object. */ - /* */ - /* Some FreeType object contains a `generic' field, of type */ - /* FT_Generic, which usage is left to client applications and font */ - /* servers. */ - /* */ - /* It can be used to store a pointer to client-specific data, as well */ - /* as the address of a `finalizer' function, which will be called by */ - /* FreeType when the object is destroyed (for example, the previous */ - /* client example would put the address of the glyph cache destructor */ - /* in the `finalizer' field). */ - /* */ - /* <Fields> */ - /* data :: A typeless pointer to any client-specified data. This */ - /* field is completely ignored by the FreeType library. */ - /* */ - /* finalizer :: A pointer to a `generic finalizer' function, which */ - /* will be called when the object is destroyed. If this */ - /* field is set to NULL, no code will be called. */ - /* */ - typedef struct FT_Generic_ - { - void* data; - FT_Generic_Finalizer finalizer; - - } FT_Generic; - - - /*************************************************************************/ - /* */ - /* <Macro> */ - /* FT_MAKE_TAG */ - /* */ - /* <Description> */ - /* This macro converts four-letter tags which are used to label */ - /* TrueType tables into an unsigned long to be used within FreeType. */ - /* */ - /* <Note> */ - /* The produced values *must* be 32-bit integers. Don't redefine */ - /* this macro. */ - /* */ -#define FT_MAKE_TAG( _x1, _x2, _x3, _x4 ) \ - (FT_Tag) \ - ( ( (FT_ULong)_x1 << 24 ) | \ - ( (FT_ULong)_x2 << 16 ) | \ - ( (FT_ULong)_x3 << 8 ) | \ - (FT_ULong)_x4 ) - - - /*************************************************************************/ - /*************************************************************************/ - /* */ - /* L I S T M A N A G E M E N T */ - /* */ - /*************************************************************************/ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* <Section> */ - /* list_processing */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FT_ListNode */ - /* */ - /* <Description> */ - /* Many elements and objects in FreeType are listed through an */ - /* @FT_List record (see @FT_ListRec). As its name suggests, an */ - /* FT_ListNode is a handle to a single list element. */ - /* */ - typedef struct FT_ListNodeRec_* FT_ListNode; - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FT_List */ - /* */ - /* <Description> */ - /* A handle to a list record (see @FT_ListRec). */ - /* */ - typedef struct FT_ListRec_* FT_List; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FT_ListNodeRec */ - /* */ - /* <Description> */ - /* A structure used to hold a single list element. */ - /* */ - /* <Fields> */ - /* prev :: The previous element in the list. NULL if first. */ - /* */ - /* next :: The next element in the list. NULL if last. */ - /* */ - /* data :: A typeless pointer to the listed object. */ - /* */ - typedef struct FT_ListNodeRec_ - { - FT_ListNode prev; - FT_ListNode next; - void* data; - - } FT_ListNodeRec; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FT_ListRec */ - /* */ - /* <Description> */ - /* A structure used to hold a simple doubly-linked list. These are */ - /* used in many parts of FreeType. */ - /* */ - /* <Fields> */ - /* head :: The head (first element) of doubly-linked list. */ - /* */ - /* tail :: The tail (last element) of doubly-linked list. */ - /* */ - typedef struct FT_ListRec_ - { - FT_ListNode head; - FT_ListNode tail; - - } FT_ListRec; - - - /* */ - -#define FT_IS_EMPTY( list ) ( (list).head == 0 ) - - /* return base error code (without module-specific prefix) */ -#define FT_ERROR_BASE( x ) ( (x) & 0xFF ) - - /* return module error code */ -#define FT_ERROR_MODULE( x ) ( (x) & 0xFF00U ) - -#define FT_BOOL( x ) ( (FT_Bool)( x ) ) - -FT_END_HEADER - -#endif /* __FTTYPES_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ttnameid.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ttnameid.h deleted file mode 100644 index 66aef0432e..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ttnameid.h +++ /dev/null @@ -1,1247 +0,0 @@ -/***************************************************************************/ -/* */ -/* ttnameid.h */ -/* */ -/* TrueType name ID definitions (specification only). */ -/* */ -/* Copyright 1996-2002, 2003, 2004, 2006, 2007, 2008 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __TTNAMEID_H__ -#define __TTNAMEID_H__ - - -#include <ft2build.h> - - -FT_BEGIN_HEADER - - - /*************************************************************************/ - /* */ - /* <Section> */ - /* truetype_tables */ - /* */ - - - /*************************************************************************/ - /* */ - /* Possible values for the `platform' identifier code in the name */ - /* records of the TTF `name' table. */ - /* */ - /*************************************************************************/ - - - /*********************************************************************** - * - * @enum: - * TT_PLATFORM_XXX - * - * @description: - * A list of valid values for the `platform_id' identifier code in - * @FT_CharMapRec and @FT_SfntName structures. - * - * @values: - * TT_PLATFORM_APPLE_UNICODE :: - * Used by Apple to indicate a Unicode character map and/or name entry. - * See @TT_APPLE_ID_XXX for corresponding `encoding_id' values. Note - * that name entries in this format are coded as big-endian UCS-2 - * character codes _only_. - * - * TT_PLATFORM_MACINTOSH :: - * Used by Apple to indicate a MacOS-specific charmap and/or name entry. - * See @TT_MAC_ID_XXX for corresponding `encoding_id' values. Note that - * most TrueType fonts contain an Apple roman charmap to be usable on - * MacOS systems (even if they contain a Microsoft charmap as well). - * - * TT_PLATFORM_ISO :: - * This value was used to specify ISO/IEC 10646 charmaps. It is however - * now deprecated. See @TT_ISO_ID_XXX for a list of corresponding - * `encoding_id' values. - * - * TT_PLATFORM_MICROSOFT :: - * Used by Microsoft to indicate Windows-specific charmaps. See - * @TT_MS_ID_XXX for a list of corresponding `encoding_id' values. - * Note that most fonts contain a Unicode charmap using - * (TT_PLATFORM_MICROSOFT, @TT_MS_ID_UNICODE_CS). - * - * TT_PLATFORM_CUSTOM :: - * Used to indicate application-specific charmaps. - * - * TT_PLATFORM_ADOBE :: - * This value isn't part of any font format specification, but is used - * by FreeType to report Adobe-specific charmaps in an @FT_CharMapRec - * structure. See @TT_ADOBE_ID_XXX. - */ - -#define TT_PLATFORM_APPLE_UNICODE 0 -#define TT_PLATFORM_MACINTOSH 1 -#define TT_PLATFORM_ISO 2 /* deprecated */ -#define TT_PLATFORM_MICROSOFT 3 -#define TT_PLATFORM_CUSTOM 4 -#define TT_PLATFORM_ADOBE 7 /* artificial */ - - - /*********************************************************************** - * - * @enum: - * TT_APPLE_ID_XXX - * - * @description: - * A list of valid values for the `encoding_id' for - * @TT_PLATFORM_APPLE_UNICODE charmaps and name entries. - * - * @values: - * TT_APPLE_ID_DEFAULT :: - * Unicode version 1.0. - * - * TT_APPLE_ID_UNICODE_1_1 :: - * Unicode 1.1; specifies Hangul characters starting at U+34xx. - * - * TT_APPLE_ID_ISO_10646 :: - * Deprecated (identical to preceding). - * - * TT_APPLE_ID_UNICODE_2_0 :: - * Unicode 2.0 and beyond (UTF-16 BMP only). - * - * TT_APPLE_ID_UNICODE_32 :: - * Unicode 3.1 and beyond, using UTF-32. - * - * TT_APPLE_ID_VARIANT_SELECTOR :: - * From Adobe, not Apple. Not a normal cmap. Specifies variations - * on a real cmap. - */ - -#define TT_APPLE_ID_DEFAULT 0 /* Unicode 1.0 */ -#define TT_APPLE_ID_UNICODE_1_1 1 /* specify Hangul at U+34xx */ -#define TT_APPLE_ID_ISO_10646 2 /* deprecated */ -#define TT_APPLE_ID_UNICODE_2_0 3 /* or later */ -#define TT_APPLE_ID_UNICODE_32 4 /* 2.0 or later, full repertoire */ -#define TT_APPLE_ID_VARIANT_SELECTOR 5 /* variation selector data */ - - - /*********************************************************************** - * - * @enum: - * TT_MAC_ID_XXX - * - * @description: - * A list of valid values for the `encoding_id' for - * @TT_PLATFORM_MACINTOSH charmaps and name entries. - * - * @values: - * TT_MAC_ID_ROMAN :: - * TT_MAC_ID_JAPANESE :: - * TT_MAC_ID_TRADITIONAL_CHINESE :: - * TT_MAC_ID_KOREAN :: - * TT_MAC_ID_ARABIC :: - * TT_MAC_ID_HEBREW :: - * TT_MAC_ID_GREEK :: - * TT_MAC_ID_RUSSIAN :: - * TT_MAC_ID_RSYMBOL :: - * TT_MAC_ID_DEVANAGARI :: - * TT_MAC_ID_GURMUKHI :: - * TT_MAC_ID_GUJARATI :: - * TT_MAC_ID_ORIYA :: - * TT_MAC_ID_BENGALI :: - * TT_MAC_ID_TAMIL :: - * TT_MAC_ID_TELUGU :: - * TT_MAC_ID_KANNADA :: - * TT_MAC_ID_MALAYALAM :: - * TT_MAC_ID_SINHALESE :: - * TT_MAC_ID_BURMESE :: - * TT_MAC_ID_KHMER :: - * TT_MAC_ID_THAI :: - * TT_MAC_ID_LAOTIAN :: - * TT_MAC_ID_GEORGIAN :: - * TT_MAC_ID_ARMENIAN :: - * TT_MAC_ID_MALDIVIAN :: - * TT_MAC_ID_SIMPLIFIED_CHINESE :: - * TT_MAC_ID_TIBETAN :: - * TT_MAC_ID_MONGOLIAN :: - * TT_MAC_ID_GEEZ :: - * TT_MAC_ID_SLAVIC :: - * TT_MAC_ID_VIETNAMESE :: - * TT_MAC_ID_SINDHI :: - * TT_MAC_ID_UNINTERP :: - */ - -#define TT_MAC_ID_ROMAN 0 -#define TT_MAC_ID_JAPANESE 1 -#define TT_MAC_ID_TRADITIONAL_CHINESE 2 -#define TT_MAC_ID_KOREAN 3 -#define TT_MAC_ID_ARABIC 4 -#define TT_MAC_ID_HEBREW 5 -#define TT_MAC_ID_GREEK 6 -#define TT_MAC_ID_RUSSIAN 7 -#define TT_MAC_ID_RSYMBOL 8 -#define TT_MAC_ID_DEVANAGARI 9 -#define TT_MAC_ID_GURMUKHI 10 -#define TT_MAC_ID_GUJARATI 11 -#define TT_MAC_ID_ORIYA 12 -#define TT_MAC_ID_BENGALI 13 -#define TT_MAC_ID_TAMIL 14 -#define TT_MAC_ID_TELUGU 15 -#define TT_MAC_ID_KANNADA 16 -#define TT_MAC_ID_MALAYALAM 17 -#define TT_MAC_ID_SINHALESE 18 -#define TT_MAC_ID_BURMESE 19 -#define TT_MAC_ID_KHMER 20 -#define TT_MAC_ID_THAI 21 -#define TT_MAC_ID_LAOTIAN 22 -#define TT_MAC_ID_GEORGIAN 23 -#define TT_MAC_ID_ARMENIAN 24 -#define TT_MAC_ID_MALDIVIAN 25 -#define TT_MAC_ID_SIMPLIFIED_CHINESE 25 -#define TT_MAC_ID_TIBETAN 26 -#define TT_MAC_ID_MONGOLIAN 27 -#define TT_MAC_ID_GEEZ 28 -#define TT_MAC_ID_SLAVIC 29 -#define TT_MAC_ID_VIETNAMESE 30 -#define TT_MAC_ID_SINDHI 31 -#define TT_MAC_ID_UNINTERP 32 - - - /*********************************************************************** - * - * @enum: - * TT_ISO_ID_XXX - * - * @description: - * A list of valid values for the `encoding_id' for - * @TT_PLATFORM_ISO charmaps and name entries. - * - * Their use is now deprecated. - * - * @values: - * TT_ISO_ID_7BIT_ASCII :: - * ASCII. - * TT_ISO_ID_10646 :: - * ISO/10646. - * TT_ISO_ID_8859_1 :: - * Also known as Latin-1. - */ - -#define TT_ISO_ID_7BIT_ASCII 0 -#define TT_ISO_ID_10646 1 -#define TT_ISO_ID_8859_1 2 - - - /*********************************************************************** - * - * @enum: - * TT_MS_ID_XXX - * - * @description: - * A list of valid values for the `encoding_id' for - * @TT_PLATFORM_MICROSOFT charmaps and name entries. - * - * @values: - * TT_MS_ID_SYMBOL_CS :: - * Corresponds to Microsoft symbol encoding. See - * @FT_ENCODING_MS_SYMBOL. - * - * TT_MS_ID_UNICODE_CS :: - * Corresponds to a Microsoft WGL4 charmap, matching Unicode. See - * @FT_ENCODING_UNICODE. - * - * TT_MS_ID_SJIS :: - * Corresponds to SJIS Japanese encoding. See @FT_ENCODING_SJIS. - * - * TT_MS_ID_GB2312 :: - * Corresponds to Simplified Chinese as used in Mainland China. See - * @FT_ENCODING_GB2312. - * - * TT_MS_ID_BIG_5 :: - * Corresponds to Traditional Chinese as used in Taiwan and Hong Kong. - * See @FT_ENCODING_BIG5. - * - * TT_MS_ID_WANSUNG :: - * Corresponds to Korean Wansung encoding. See @FT_ENCODING_WANSUNG. - * - * TT_MS_ID_JOHAB :: - * Corresponds to Johab encoding. See @FT_ENCODING_JOHAB. - * - * TT_MS_ID_UCS_4 :: - * Corresponds to UCS-4 or UTF-32 charmaps. This has been added to - * the OpenType specification version 1.4 (mid-2001.) - */ - -#define TT_MS_ID_SYMBOL_CS 0 -#define TT_MS_ID_UNICODE_CS 1 -#define TT_MS_ID_SJIS 2 -#define TT_MS_ID_GB2312 3 -#define TT_MS_ID_BIG_5 4 -#define TT_MS_ID_WANSUNG 5 -#define TT_MS_ID_JOHAB 6 -#define TT_MS_ID_UCS_4 10 - - - /*********************************************************************** - * - * @enum: - * TT_ADOBE_ID_XXX - * - * @description: - * A list of valid values for the `encoding_id' for - * @TT_PLATFORM_ADOBE charmaps. This is a FreeType-specific extension! - * - * @values: - * TT_ADOBE_ID_STANDARD :: - * Adobe standard encoding. - * TT_ADOBE_ID_EXPERT :: - * Adobe expert encoding. - * TT_ADOBE_ID_CUSTOM :: - * Adobe custom encoding. - * TT_ADOBE_ID_LATIN_1 :: - * Adobe Latin~1 encoding. - */ - -#define TT_ADOBE_ID_STANDARD 0 -#define TT_ADOBE_ID_EXPERT 1 -#define TT_ADOBE_ID_CUSTOM 2 -#define TT_ADOBE_ID_LATIN_1 3 - - - /*************************************************************************/ - /* */ - /* Possible values of the language identifier field in the name records */ - /* of the TTF `name' table if the `platform' identifier code is */ - /* TT_PLATFORM_MACINTOSH. */ - /* */ - /* The canonical source for the Apple assigned Language ID's is at */ - /* */ - /* http://fonts.apple.com/TTRefMan/RM06/Chap6name.html */ - /* */ -#define TT_MAC_LANGID_ENGLISH 0 -#define TT_MAC_LANGID_FRENCH 1 -#define TT_MAC_LANGID_GERMAN 2 -#define TT_MAC_LANGID_ITALIAN 3 -#define TT_MAC_LANGID_DUTCH 4 -#define TT_MAC_LANGID_SWEDISH 5 -#define TT_MAC_LANGID_SPANISH 6 -#define TT_MAC_LANGID_DANISH 7 -#define TT_MAC_LANGID_PORTUGUESE 8 -#define TT_MAC_LANGID_NORWEGIAN 9 -#define TT_MAC_LANGID_HEBREW 10 -#define TT_MAC_LANGID_JAPANESE 11 -#define TT_MAC_LANGID_ARABIC 12 -#define TT_MAC_LANGID_FINNISH 13 -#define TT_MAC_LANGID_GREEK 14 -#define TT_MAC_LANGID_ICELANDIC 15 -#define TT_MAC_LANGID_MALTESE 16 -#define TT_MAC_LANGID_TURKISH 17 -#define TT_MAC_LANGID_CROATIAN 18 -#define TT_MAC_LANGID_CHINESE_TRADITIONAL 19 -#define TT_MAC_LANGID_URDU 20 -#define TT_MAC_LANGID_HINDI 21 -#define TT_MAC_LANGID_THAI 22 -#define TT_MAC_LANGID_KOREAN 23 -#define TT_MAC_LANGID_LITHUANIAN 24 -#define TT_MAC_LANGID_POLISH 25 -#define TT_MAC_LANGID_HUNGARIAN 26 -#define TT_MAC_LANGID_ESTONIAN 27 -#define TT_MAC_LANGID_LETTISH 28 -#define TT_MAC_LANGID_SAAMISK 29 -#define TT_MAC_LANGID_FAEROESE 30 -#define TT_MAC_LANGID_FARSI 31 -#define TT_MAC_LANGID_RUSSIAN 32 -#define TT_MAC_LANGID_CHINESE_SIMPLIFIED 33 -#define TT_MAC_LANGID_FLEMISH 34 -#define TT_MAC_LANGID_IRISH 35 -#define TT_MAC_LANGID_ALBANIAN 36 -#define TT_MAC_LANGID_ROMANIAN 37 -#define TT_MAC_LANGID_CZECH 38 -#define TT_MAC_LANGID_SLOVAK 39 -#define TT_MAC_LANGID_SLOVENIAN 40 -#define TT_MAC_LANGID_YIDDISH 41 -#define TT_MAC_LANGID_SERBIAN 42 -#define TT_MAC_LANGID_MACEDONIAN 43 -#define TT_MAC_LANGID_BULGARIAN 44 -#define TT_MAC_LANGID_UKRAINIAN 45 -#define TT_MAC_LANGID_BYELORUSSIAN 46 -#define TT_MAC_LANGID_UZBEK 47 -#define TT_MAC_LANGID_KAZAKH 48 -#define TT_MAC_LANGID_AZERBAIJANI 49 -#define TT_MAC_LANGID_AZERBAIJANI_CYRILLIC_SCRIPT 49 -#define TT_MAC_LANGID_AZERBAIJANI_ARABIC_SCRIPT 50 -#define TT_MAC_LANGID_ARMENIAN 51 -#define TT_MAC_LANGID_GEORGIAN 52 -#define TT_MAC_LANGID_MOLDAVIAN 53 -#define TT_MAC_LANGID_KIRGHIZ 54 -#define TT_MAC_LANGID_TAJIKI 55 -#define TT_MAC_LANGID_TURKMEN 56 -#define TT_MAC_LANGID_MONGOLIAN 57 -#define TT_MAC_LANGID_MONGOLIAN_MONGOLIAN_SCRIPT 57 -#define TT_MAC_LANGID_MONGOLIAN_CYRILLIC_SCRIPT 58 -#define TT_MAC_LANGID_PASHTO 59 -#define TT_MAC_LANGID_KURDISH 60 -#define TT_MAC_LANGID_KASHMIRI 61 -#define TT_MAC_LANGID_SINDHI 62 -#define TT_MAC_LANGID_TIBETAN 63 -#define TT_MAC_LANGID_NEPALI 64 -#define TT_MAC_LANGID_SANSKRIT 65 -#define TT_MAC_LANGID_MARATHI 66 -#define TT_MAC_LANGID_BENGALI 67 -#define TT_MAC_LANGID_ASSAMESE 68 -#define TT_MAC_LANGID_GUJARATI 69 -#define TT_MAC_LANGID_PUNJABI 70 -#define TT_MAC_LANGID_ORIYA 71 -#define TT_MAC_LANGID_MALAYALAM 72 -#define TT_MAC_LANGID_KANNADA 73 -#define TT_MAC_LANGID_TAMIL 74 -#define TT_MAC_LANGID_TELUGU 75 -#define TT_MAC_LANGID_SINHALESE 76 -#define TT_MAC_LANGID_BURMESE 77 -#define TT_MAC_LANGID_KHMER 78 -#define TT_MAC_LANGID_LAO 79 -#define TT_MAC_LANGID_VIETNAMESE 80 -#define TT_MAC_LANGID_INDONESIAN 81 -#define TT_MAC_LANGID_TAGALOG 82 -#define TT_MAC_LANGID_MALAY_ROMAN_SCRIPT 83 -#define TT_MAC_LANGID_MALAY_ARABIC_SCRIPT 84 -#define TT_MAC_LANGID_AMHARIC 85 -#define TT_MAC_LANGID_TIGRINYA 86 -#define TT_MAC_LANGID_GALLA 87 -#define TT_MAC_LANGID_SOMALI 88 -#define TT_MAC_LANGID_SWAHILI 89 -#define TT_MAC_LANGID_RUANDA 90 -#define TT_MAC_LANGID_RUNDI 91 -#define TT_MAC_LANGID_CHEWA 92 -#define TT_MAC_LANGID_MALAGASY 93 -#define TT_MAC_LANGID_ESPERANTO 94 -#define TT_MAC_LANGID_WELSH 128 -#define TT_MAC_LANGID_BASQUE 129 -#define TT_MAC_LANGID_CATALAN 130 -#define TT_MAC_LANGID_LATIN 131 -#define TT_MAC_LANGID_QUECHUA 132 -#define TT_MAC_LANGID_GUARANI 133 -#define TT_MAC_LANGID_AYMARA 134 -#define TT_MAC_LANGID_TATAR 135 -#define TT_MAC_LANGID_UIGHUR 136 -#define TT_MAC_LANGID_DZONGKHA 137 -#define TT_MAC_LANGID_JAVANESE 138 -#define TT_MAC_LANGID_SUNDANESE 139 - - -#if 0 /* these seem to be errors that have been dropped */ - -#define TT_MAC_LANGID_SCOTTISH_GAELIC 140 -#define TT_MAC_LANGID_IRISH_GAELIC 141 - -#endif - - - /* The following codes are new as of 2000-03-10 */ -#define TT_MAC_LANGID_GALICIAN 140 -#define TT_MAC_LANGID_AFRIKAANS 141 -#define TT_MAC_LANGID_BRETON 142 -#define TT_MAC_LANGID_INUKTITUT 143 -#define TT_MAC_LANGID_SCOTTISH_GAELIC 144 -#define TT_MAC_LANGID_MANX_GAELIC 145 -#define TT_MAC_LANGID_IRISH_GAELIC 146 -#define TT_MAC_LANGID_TONGAN 147 -#define TT_MAC_LANGID_GREEK_POLYTONIC 148 -#define TT_MAC_LANGID_GREELANDIC 149 -#define TT_MAC_LANGID_AZERBAIJANI_ROMAN_SCRIPT 150 - - - /*************************************************************************/ - /* */ - /* Possible values of the language identifier field in the name records */ - /* of the TTF `name' table if the `platform' identifier code is */ - /* TT_PLATFORM_MICROSOFT. */ - /* */ - /* The canonical source for the MS assigned LCID's (seems to) be at */ - /* */ - /* http://www.microsoft.com/globaldev/reference/lcid-all.mspx */ - /* */ - /* It used to be at various places, among them */ - /* */ - /* http://www.microsoft.com/typography/OTSPEC/lcid-cp.txt */ - /* http://www.microsoft.com/globaldev/reference/loclanghome.asp */ - /* http://support.microsoft.com/support/kb/articles/Q224/8/04.ASP */ - /* http://msdn.microsoft.com/library/en-us/passport25/ */ - /* NET_Passport_VBScript_Documentation/Single_Sign_In/ */ - /* Advanced_Single_Sign_In/Localization_and_LCIDs.asp */ - /* */ - /* Hopefully, it seems now that the Globaldev site prevails... */ - /* (updated by Antoine, 2004-02-17) */ - -#define TT_MS_LANGID_ARABIC_GENERAL 0x0001 -#define TT_MS_LANGID_ARABIC_SAUDI_ARABIA 0x0401 -#define TT_MS_LANGID_ARABIC_IRAQ 0x0801 -#define TT_MS_LANGID_ARABIC_EGYPT 0x0c01 -#define TT_MS_LANGID_ARABIC_LIBYA 0x1001 -#define TT_MS_LANGID_ARABIC_ALGERIA 0x1401 -#define TT_MS_LANGID_ARABIC_MOROCCO 0x1801 -#define TT_MS_LANGID_ARABIC_TUNISIA 0x1c01 -#define TT_MS_LANGID_ARABIC_OMAN 0x2001 -#define TT_MS_LANGID_ARABIC_YEMEN 0x2401 -#define TT_MS_LANGID_ARABIC_SYRIA 0x2801 -#define TT_MS_LANGID_ARABIC_JORDAN 0x2c01 -#define TT_MS_LANGID_ARABIC_LEBANON 0x3001 -#define TT_MS_LANGID_ARABIC_KUWAIT 0x3401 -#define TT_MS_LANGID_ARABIC_UAE 0x3801 -#define TT_MS_LANGID_ARABIC_BAHRAIN 0x3c01 -#define TT_MS_LANGID_ARABIC_QATAR 0x4001 -#define TT_MS_LANGID_BULGARIAN_BULGARIA 0x0402 -#define TT_MS_LANGID_CATALAN_SPAIN 0x0403 -#define TT_MS_LANGID_CHINESE_GENERAL 0x0004 -#define TT_MS_LANGID_CHINESE_TAIWAN 0x0404 -#define TT_MS_LANGID_CHINESE_PRC 0x0804 -#define TT_MS_LANGID_CHINESE_HONG_KONG 0x0c04 -#define TT_MS_LANGID_CHINESE_SINGAPORE 0x1004 - -#if 1 /* this looks like the correct value */ -#define TT_MS_LANGID_CHINESE_MACAU 0x1404 -#else /* but beware, Microsoft may change its mind... - the most recent Word reference has the following: */ -#define TT_MS_LANGID_CHINESE_MACAU TT_MS_LANGID_CHINESE_HONG_KONG -#endif - -#if 0 /* used only with .NET `cultures'; commented out */ -#define TT_MS_LANGID_CHINESE_TRADITIONAL 0x7C04 -#endif - -#define TT_MS_LANGID_CZECH_CZECH_REPUBLIC 0x0405 -#define TT_MS_LANGID_DANISH_DENMARK 0x0406 -#define TT_MS_LANGID_GERMAN_GERMANY 0x0407 -#define TT_MS_LANGID_GERMAN_SWITZERLAND 0x0807 -#define TT_MS_LANGID_GERMAN_AUSTRIA 0x0c07 -#define TT_MS_LANGID_GERMAN_LUXEMBOURG 0x1007 -#define TT_MS_LANGID_GERMAN_LIECHTENSTEI 0x1407 -#define TT_MS_LANGID_GREEK_GREECE 0x0408 - - /* don't ask what this one means... It is commented out currently. */ -#if 0 -#define TT_MS_LANGID_GREEK_GREECE2 0x2008 -#endif - -#define TT_MS_LANGID_ENGLISH_GENERAL 0x0009 -#define TT_MS_LANGID_ENGLISH_UNITED_STATES 0x0409 -#define TT_MS_LANGID_ENGLISH_UNITED_KINGDOM 0x0809 -#define TT_MS_LANGID_ENGLISH_AUSTRALIA 0x0c09 -#define TT_MS_LANGID_ENGLISH_CANADA 0x1009 -#define TT_MS_LANGID_ENGLISH_NEW_ZEALAND 0x1409 -#define TT_MS_LANGID_ENGLISH_IRELAND 0x1809 -#define TT_MS_LANGID_ENGLISH_SOUTH_AFRICA 0x1c09 -#define TT_MS_LANGID_ENGLISH_JAMAICA 0x2009 -#define TT_MS_LANGID_ENGLISH_CARIBBEAN 0x2409 -#define TT_MS_LANGID_ENGLISH_BELIZE 0x2809 -#define TT_MS_LANGID_ENGLISH_TRINIDAD 0x2c09 -#define TT_MS_LANGID_ENGLISH_ZIMBABWE 0x3009 -#define TT_MS_LANGID_ENGLISH_PHILIPPINES 0x3409 -#define TT_MS_LANGID_ENGLISH_INDONESIA 0x3809 -#define TT_MS_LANGID_ENGLISH_HONG_KONG 0x3c09 -#define TT_MS_LANGID_ENGLISH_INDIA 0x4009 -#define TT_MS_LANGID_ENGLISH_MALAYSIA 0x4409 -#define TT_MS_LANGID_ENGLISH_SINGAPORE 0x4809 -#define TT_MS_LANGID_SPANISH_SPAIN_TRADITIONAL_SORT 0x040a -#define TT_MS_LANGID_SPANISH_MEXICO 0x080a -#define TT_MS_LANGID_SPANISH_SPAIN_INTERNATIONAL_SORT 0x0c0a -#define TT_MS_LANGID_SPANISH_GUATEMALA 0x100a -#define TT_MS_LANGID_SPANISH_COSTA_RICA 0x140a -#define TT_MS_LANGID_SPANISH_PANAMA 0x180a -#define TT_MS_LANGID_SPANISH_DOMINICAN_REPUBLIC 0x1c0a -#define TT_MS_LANGID_SPANISH_VENEZUELA 0x200a -#define TT_MS_LANGID_SPANISH_COLOMBIA 0x240a -#define TT_MS_LANGID_SPANISH_PERU 0x280a -#define TT_MS_LANGID_SPANISH_ARGENTINA 0x2c0a -#define TT_MS_LANGID_SPANISH_ECUADOR 0x300a -#define TT_MS_LANGID_SPANISH_CHILE 0x340a -#define TT_MS_LANGID_SPANISH_URUGUAY 0x380a -#define TT_MS_LANGID_SPANISH_PARAGUAY 0x3c0a -#define TT_MS_LANGID_SPANISH_BOLIVIA 0x400a -#define TT_MS_LANGID_SPANISH_EL_SALVADOR 0x440a -#define TT_MS_LANGID_SPANISH_HONDURAS 0x480a -#define TT_MS_LANGID_SPANISH_NICARAGUA 0x4c0a -#define TT_MS_LANGID_SPANISH_PUERTO_RICO 0x500a -#define TT_MS_LANGID_SPANISH_UNITED_STATES 0x540a - /* The following ID blatantly violate MS specs by using a */ - /* sublanguage > 0x1F. */ -#define TT_MS_LANGID_SPANISH_LATIN_AMERICA 0xE40aU -#define TT_MS_LANGID_FINNISH_FINLAND 0x040b -#define TT_MS_LANGID_FRENCH_FRANCE 0x040c -#define TT_MS_LANGID_FRENCH_BELGIUM 0x080c -#define TT_MS_LANGID_FRENCH_CANADA 0x0c0c -#define TT_MS_LANGID_FRENCH_SWITZERLAND 0x100c -#define TT_MS_LANGID_FRENCH_LUXEMBOURG 0x140c -#define TT_MS_LANGID_FRENCH_MONACO 0x180c -#define TT_MS_LANGID_FRENCH_WEST_INDIES 0x1c0c -#define TT_MS_LANGID_FRENCH_REUNION 0x200c -#define TT_MS_LANGID_FRENCH_CONGO 0x240c - /* which was formerly: */ -#define TT_MS_LANGID_FRENCH_ZAIRE TT_MS_LANGID_FRENCH_CONGO -#define TT_MS_LANGID_FRENCH_SENEGAL 0x280c -#define TT_MS_LANGID_FRENCH_CAMEROON 0x2c0c -#define TT_MS_LANGID_FRENCH_COTE_D_IVOIRE 0x300c -#define TT_MS_LANGID_FRENCH_MALI 0x340c -#define TT_MS_LANGID_FRENCH_MOROCCO 0x380c -#define TT_MS_LANGID_FRENCH_HAITI 0x3c0c - /* and another violation of the spec (see 0xE40aU) */ -#define TT_MS_LANGID_FRENCH_NORTH_AFRICA 0xE40cU -#define TT_MS_LANGID_HEBREW_ISRAEL 0x040d -#define TT_MS_LANGID_HUNGARIAN_HUNGARY 0x040e -#define TT_MS_LANGID_ICELANDIC_ICELAND 0x040f -#define TT_MS_LANGID_ITALIAN_ITALY 0x0410 -#define TT_MS_LANGID_ITALIAN_SWITZERLAND 0x0810 -#define TT_MS_LANGID_JAPANESE_JAPAN 0x0411 -#define TT_MS_LANGID_KOREAN_EXTENDED_WANSUNG_KOREA 0x0412 -#define TT_MS_LANGID_KOREAN_JOHAB_KOREA 0x0812 -#define TT_MS_LANGID_DUTCH_NETHERLANDS 0x0413 -#define TT_MS_LANGID_DUTCH_BELGIUM 0x0813 -#define TT_MS_LANGID_NORWEGIAN_NORWAY_BOKMAL 0x0414 -#define TT_MS_LANGID_NORWEGIAN_NORWAY_NYNORSK 0x0814 -#define TT_MS_LANGID_POLISH_POLAND 0x0415 -#define TT_MS_LANGID_PORTUGUESE_BRAZIL 0x0416 -#define TT_MS_LANGID_PORTUGUESE_PORTUGAL 0x0816 -#define TT_MS_LANGID_RHAETO_ROMANIC_SWITZERLAND 0x0417 -#define TT_MS_LANGID_ROMANIAN_ROMANIA 0x0418 -#define TT_MS_LANGID_MOLDAVIAN_MOLDAVIA 0x0818 -#define TT_MS_LANGID_RUSSIAN_RUSSIA 0x0419 -#define TT_MS_LANGID_RUSSIAN_MOLDAVIA 0x0819 -#define TT_MS_LANGID_CROATIAN_CROATIA 0x041a -#define TT_MS_LANGID_SERBIAN_SERBIA_LATIN 0x081a -#define TT_MS_LANGID_SERBIAN_SERBIA_CYRILLIC 0x0c1a - -#if 0 /* this used to be this value, but it looks like we were wrong */ -#define TT_MS_LANGID_BOSNIAN_BOSNIA_HERZEGOVINA 0x101a -#else /* current sources say */ -#define TT_MS_LANGID_CROATIAN_BOSNIA_HERZEGOVINA 0x101a -#define TT_MS_LANGID_BOSNIAN_BOSNIA_HERZEGOVINA 0x141a - /* and XPsp2 Platform SDK added (2004-07-26) */ - /* Names are shortened to be significant within 40 chars. */ -#define TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_LATIN 0x181a -#define TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_CYRILLIC 0x181a -#endif - -#define TT_MS_LANGID_SLOVAK_SLOVAKIA 0x041b -#define TT_MS_LANGID_ALBANIAN_ALBANIA 0x041c -#define TT_MS_LANGID_SWEDISH_SWEDEN 0x041d -#define TT_MS_LANGID_SWEDISH_FINLAND 0x081d -#define TT_MS_LANGID_THAI_THAILAND 0x041e -#define TT_MS_LANGID_TURKISH_TURKEY 0x041f -#define TT_MS_LANGID_URDU_PAKISTAN 0x0420 -#define TT_MS_LANGID_URDU_INDIA 0x0820 -#define TT_MS_LANGID_INDONESIAN_INDONESIA 0x0421 -#define TT_MS_LANGID_UKRAINIAN_UKRAINE 0x0422 -#define TT_MS_LANGID_BELARUSIAN_BELARUS 0x0423 -#define TT_MS_LANGID_SLOVENE_SLOVENIA 0x0424 -#define TT_MS_LANGID_ESTONIAN_ESTONIA 0x0425 -#define TT_MS_LANGID_LATVIAN_LATVIA 0x0426 -#define TT_MS_LANGID_LITHUANIAN_LITHUANIA 0x0427 -#define TT_MS_LANGID_CLASSIC_LITHUANIAN_LITHUANIA 0x0827 -#define TT_MS_LANGID_TAJIK_TAJIKISTAN 0x0428 -#define TT_MS_LANGID_FARSI_IRAN 0x0429 -#define TT_MS_LANGID_VIETNAMESE_VIET_NAM 0x042a -#define TT_MS_LANGID_ARMENIAN_ARMENIA 0x042b -#define TT_MS_LANGID_AZERI_AZERBAIJAN_LATIN 0x042c -#define TT_MS_LANGID_AZERI_AZERBAIJAN_CYRILLIC 0x082c -#define TT_MS_LANGID_BASQUE_SPAIN 0x042d -#define TT_MS_LANGID_SORBIAN_GERMANY 0x042e -#define TT_MS_LANGID_MACEDONIAN_MACEDONIA 0x042f -#define TT_MS_LANGID_SUTU_SOUTH_AFRICA 0x0430 -#define TT_MS_LANGID_TSONGA_SOUTH_AFRICA 0x0431 -#define TT_MS_LANGID_TSWANA_SOUTH_AFRICA 0x0432 -#define TT_MS_LANGID_VENDA_SOUTH_AFRICA 0x0433 -#define TT_MS_LANGID_XHOSA_SOUTH_AFRICA 0x0434 -#define TT_MS_LANGID_ZULU_SOUTH_AFRICA 0x0435 -#define TT_MS_LANGID_AFRIKAANS_SOUTH_AFRICA 0x0436 -#define TT_MS_LANGID_GEORGIAN_GEORGIA 0x0437 -#define TT_MS_LANGID_FAEROESE_FAEROE_ISLANDS 0x0438 -#define TT_MS_LANGID_HINDI_INDIA 0x0439 -#define TT_MS_LANGID_MALTESE_MALTA 0x043a - /* Added by XPsp2 Platform SDK (2004-07-26) */ -#define TT_MS_LANGID_SAMI_NORTHERN_NORWAY 0x043b -#define TT_MS_LANGID_SAMI_NORTHERN_SWEDEN 0x083b -#define TT_MS_LANGID_SAMI_NORTHERN_FINLAND 0x0C3b -#define TT_MS_LANGID_SAMI_LULE_NORWAY 0x103b -#define TT_MS_LANGID_SAMI_LULE_SWEDEN 0x143b -#define TT_MS_LANGID_SAMI_SOUTHERN_NORWAY 0x183b -#define TT_MS_LANGID_SAMI_SOUTHERN_SWEDEN 0x1C3b -#define TT_MS_LANGID_SAMI_SKOLT_FINLAND 0x203b -#define TT_MS_LANGID_SAMI_INARI_FINLAND 0x243b - /* ... and we also keep our old identifier... */ -#define TT_MS_LANGID_SAAMI_LAPONIA 0x043b - -#if 0 /* this seems to be a previous inversion */ -#define TT_MS_LANGID_IRISH_GAELIC_IRELAND 0x043c -#define TT_MS_LANGID_SCOTTISH_GAELIC_UNITED_KINGDOM 0x083c -#else -#define TT_MS_LANGID_SCOTTISH_GAELIC_UNITED_KINGDOM 0x083c -#define TT_MS_LANGID_IRISH_GAELIC_IRELAND 0x043c -#endif - -#define TT_MS_LANGID_YIDDISH_GERMANY 0x043d -#define TT_MS_LANGID_MALAY_MALAYSIA 0x043e -#define TT_MS_LANGID_MALAY_BRUNEI_DARUSSALAM 0x083e -#define TT_MS_LANGID_KAZAK_KAZAKSTAN 0x043f -#define TT_MS_LANGID_KIRGHIZ_KIRGHIZSTAN /* Cyrillic*/ 0x0440 - /* alias declared in Windows 2000 */ -#define TT_MS_LANGID_KIRGHIZ_KIRGHIZ_REPUBLIC \ - TT_MS_LANGID_KIRGHIZ_KIRGHIZSTAN - -#define TT_MS_LANGID_SWAHILI_KENYA 0x0441 -#define TT_MS_LANGID_TURKMEN_TURKMENISTAN 0x0442 -#define TT_MS_LANGID_UZBEK_UZBEKISTAN_LATIN 0x0443 -#define TT_MS_LANGID_UZBEK_UZBEKISTAN_CYRILLIC 0x0843 -#define TT_MS_LANGID_TATAR_TATARSTAN 0x0444 -#define TT_MS_LANGID_BENGALI_INDIA 0x0445 -#define TT_MS_LANGID_BENGALI_BANGLADESH 0x0845 -#define TT_MS_LANGID_PUNJABI_INDIA 0x0446 -#define TT_MS_LANGID_PUNJABI_ARABIC_PAKISTAN 0x0846 -#define TT_MS_LANGID_GUJARATI_INDIA 0x0447 -#define TT_MS_LANGID_ORIYA_INDIA 0x0448 -#define TT_MS_LANGID_TAMIL_INDIA 0x0449 -#define TT_MS_LANGID_TELUGU_INDIA 0x044a -#define TT_MS_LANGID_KANNADA_INDIA 0x044b -#define TT_MS_LANGID_MALAYALAM_INDIA 0x044c -#define TT_MS_LANGID_ASSAMESE_INDIA 0x044d -#define TT_MS_LANGID_MARATHI_INDIA 0x044e -#define TT_MS_LANGID_SANSKRIT_INDIA 0x044f -#define TT_MS_LANGID_MONGOLIAN_MONGOLIA /* Cyrillic */ 0x0450 -#define TT_MS_LANGID_MONGOLIAN_MONGOLIA_MONGOLIAN 0x0850 -#define TT_MS_LANGID_TIBETAN_CHINA 0x0451 - /* Don't use the next constant! It has */ - /* (1) the wrong spelling (Dzonghka) */ - /* (2) Microsoft doesn't officially define it -- */ - /* at least it is not in the List of Local */ - /* ID Values. */ - /* (3) Dzongkha is not the same language as */ - /* Tibetan, so merging it is wrong anyway. */ - /* */ - /* TT_MS_LANGID_TIBETAN_BHUTAN is correct, BTW. */ -#define TT_MS_LANGID_DZONGHKA_BHUTAN 0x0851 - -#if 0 - /* the following used to be defined */ -#define TT_MS_LANGID_TIBETAN_BHUTAN 0x0451 - /* ... but it was changed; */ -#else - /* So we will continue to #define it, but with the correct value */ -#define TT_MS_LANGID_TIBETAN_BHUTAN TT_MS_LANGID_DZONGHKA_BHUTAN -#endif - -#define TT_MS_LANGID_WELSH_WALES 0x0452 -#define TT_MS_LANGID_KHMER_CAMBODIA 0x0453 -#define TT_MS_LANGID_LAO_LAOS 0x0454 -#define TT_MS_LANGID_BURMESE_MYANMAR 0x0455 -#define TT_MS_LANGID_GALICIAN_SPAIN 0x0456 -#define TT_MS_LANGID_KONKANI_INDIA 0x0457 -#define TT_MS_LANGID_MANIPURI_INDIA /* Bengali */ 0x0458 -#define TT_MS_LANGID_SINDHI_INDIA /* Arabic */ 0x0459 -#define TT_MS_LANGID_SINDHI_PAKISTAN 0x0859 - /* Missing a LCID for Sindhi in Devanagari script */ -#define TT_MS_LANGID_SYRIAC_SYRIA 0x045a -#define TT_MS_LANGID_SINHALESE_SRI_LANKA 0x045b -#define TT_MS_LANGID_CHEROKEE_UNITED_STATES 0x045c -#define TT_MS_LANGID_INUKTITUT_CANADA 0x045d -#define TT_MS_LANGID_AMHARIC_ETHIOPIA 0x045e -#define TT_MS_LANGID_TAMAZIGHT_MOROCCO /* Arabic */ 0x045f -#define TT_MS_LANGID_TAMAZIGHT_MOROCCO_LATIN 0x085f - /* Missing a LCID for Tifinagh script */ -#define TT_MS_LANGID_KASHMIRI_PAKISTAN /* Arabic */ 0x0460 - /* Spelled this way by XPsp2 Platform SDK (2004-07-26) */ - /* script is yet unclear... might be Arabic, Nagari or Sharada */ -#define TT_MS_LANGID_KASHMIRI_SASIA 0x0860 - /* ... and aliased (by MS) for compatibility reasons. */ -#define TT_MS_LANGID_KASHMIRI_INDIA TT_MS_LANGID_KASHMIRI_SASIA -#define TT_MS_LANGID_NEPALI_NEPAL 0x0461 -#define TT_MS_LANGID_NEPALI_INDIA 0x0861 -#define TT_MS_LANGID_FRISIAN_NETHERLANDS 0x0462 -#define TT_MS_LANGID_PASHTO_AFGHANISTAN 0x0463 -#define TT_MS_LANGID_FILIPINO_PHILIPPINES 0x0464 -#define TT_MS_LANGID_DHIVEHI_MALDIVES 0x0465 - /* alias declared in Windows 2000 */ -#define TT_MS_LANGID_DIVEHI_MALDIVES TT_MS_LANGID_DHIVEHI_MALDIVES -#define TT_MS_LANGID_EDO_NIGERIA 0x0466 -#define TT_MS_LANGID_FULFULDE_NIGERIA 0x0467 -#define TT_MS_LANGID_HAUSA_NIGERIA 0x0468 -#define TT_MS_LANGID_IBIBIO_NIGERIA 0x0469 -#define TT_MS_LANGID_YORUBA_NIGERIA 0x046a -#define TT_MS_LANGID_QUECHUA_BOLIVIA 0x046b -#define TT_MS_LANGID_QUECHUA_ECUADOR 0x086b -#define TT_MS_LANGID_QUECHUA_PERU 0x0c6b -#define TT_MS_LANGID_SEPEDI_SOUTH_AFRICA 0x046c - /* Also spelled by XPsp2 Platform SDK (2004-07-26) */ -#define TT_MS_LANGID_SOTHO_SOUTHERN_SOUTH_AFRICA \ - TT_MS_LANGID_SEPEDI_SOUTH_AFRICA - /* language codes 0x046d, 0x046e and 0x046f are (still) unknown. */ -#define TT_MS_LANGID_IGBO_NIGERIA 0x0470 -#define TT_MS_LANGID_KANURI_NIGERIA 0x0471 -#define TT_MS_LANGID_OROMO_ETHIOPIA 0x0472 -#define TT_MS_LANGID_TIGRIGNA_ETHIOPIA 0x0473 -#define TT_MS_LANGID_TIGRIGNA_ERYTHREA 0x0873 - /* also spelled in the `Passport SDK' list as: */ -#define TT_MS_LANGID_TIGRIGNA_ERYTREA TT_MS_LANGID_TIGRIGNA_ERYTHREA -#define TT_MS_LANGID_GUARANI_PARAGUAY 0x0474 -#define TT_MS_LANGID_HAWAIIAN_UNITED_STATES 0x0475 -#define TT_MS_LANGID_LATIN 0x0476 -#define TT_MS_LANGID_SOMALI_SOMALIA 0x0477 - /* Note: Yi does not have a (proper) ISO 639-2 code, since it is mostly */ - /* not written (but OTOH the peculiar writing system is worth */ - /* studying). */ -#define TT_MS_LANGID_YI_CHINA 0x0478 -#define TT_MS_LANGID_PAPIAMENTU_NETHERLANDS_ANTILLES 0x0479 - /* language codes from 0x047a to 0x047f are (still) unknown. */ -#define TT_MS_LANGID_UIGHUR_CHINA 0x0480 -#define TT_MS_LANGID_MAORI_NEW_ZEALAND 0x0481 - -#if 0 /* not deemed useful for fonts */ -#define TT_MS_LANGID_HUMAN_INTERFACE_DEVICE 0x04ff -#endif - - - /*************************************************************************/ - /* */ - /* Possible values of the `name' identifier field in the name records of */ - /* the TTF `name' table. These values are platform independent. */ - /* */ -#define TT_NAME_ID_COPYRIGHT 0 -#define TT_NAME_ID_FONT_FAMILY 1 -#define TT_NAME_ID_FONT_SUBFAMILY 2 -#define TT_NAME_ID_UNIQUE_ID 3 -#define TT_NAME_ID_FULL_NAME 4 -#define TT_NAME_ID_VERSION_STRING 5 -#define TT_NAME_ID_PS_NAME 6 -#define TT_NAME_ID_TRADEMARK 7 - - /* the following values are from the OpenType spec */ -#define TT_NAME_ID_MANUFACTURER 8 -#define TT_NAME_ID_DESIGNER 9 -#define TT_NAME_ID_DESCRIPTION 10 -#define TT_NAME_ID_VENDOR_URL 11 -#define TT_NAME_ID_DESIGNER_URL 12 -#define TT_NAME_ID_LICENSE 13 -#define TT_NAME_ID_LICENSE_URL 14 - /* number 15 is reserved */ -#define TT_NAME_ID_PREFERRED_FAMILY 16 -#define TT_NAME_ID_PREFERRED_SUBFAMILY 17 -#define TT_NAME_ID_MAC_FULL_NAME 18 - - /* The following code is new as of 2000-01-21 */ -#define TT_NAME_ID_SAMPLE_TEXT 19 - - /* This is new in OpenType 1.3 */ -#define TT_NAME_ID_CID_FINDFONT_NAME 20 - - /* This is new in OpenType 1.5 */ -#define TT_NAME_ID_WWS_FAMILY 21 -#define TT_NAME_ID_WWS_SUBFAMILY 22 - - - /*************************************************************************/ - /* */ - /* Bit mask values for the Unicode Ranges from the TTF `OS2 ' table. */ - /* */ - /* Updated 08-Nov-2008. */ - /* */ - - /* Bit 0 Basic Latin */ -#define TT_UCR_BASIC_LATIN (1L << 0) /* U+0020-U+007E */ - /* Bit 1 C1 Controls and Latin-1 Supplement */ -#define TT_UCR_LATIN1_SUPPLEMENT (1L << 1) /* U+0080-U+00FF */ - /* Bit 2 Latin Extended-A */ -#define TT_UCR_LATIN_EXTENDED_A (1L << 2) /* U+0100-U+017F */ - /* Bit 3 Latin Extended-B */ -#define TT_UCR_LATIN_EXTENDED_B (1L << 3) /* U+0180-U+024F */ - /* Bit 4 IPA Extensions */ - /* Phonetic Extensions */ - /* Phonetic Extensions Supplement */ -#define TT_UCR_IPA_EXTENSIONS (1L << 4) /* U+0250-U+02AF */ - /* U+1D00-U+1D7F */ - /* U+1D80-U+1DBF */ - /* Bit 5 Spacing Modifier Letters */ - /* Modifier Tone Letters */ -#define TT_UCR_SPACING_MODIFIER (1L << 5) /* U+02B0-U+02FF */ - /* U+A700-U+A71F */ - /* Bit 6 Combining Diacritical Marks */ - /* Combining Diacritical Marks Supplement */ -#define TT_UCR_COMBINING_DIACRITICS (1L << 6) /* U+0300-U+036F */ - /* U+1DC0-U+1DFF */ - /* Bit 7 Greek and Coptic */ -#define TT_UCR_GREEK (1L << 7) /* U+0370-U+03FF */ - /* Bit 8 Coptic */ -#define TT_UCR_COPTIC (1L << 8) /* U+2C80-U+2CFF */ - /* Bit 9 Cyrillic */ - /* Cyrillic Supplement */ - /* Cyrillic Extended-A */ - /* Cyrillic Extended-B */ -#define TT_UCR_CYRILLIC (1L << 9) /* U+0400-U+04FF */ - /* U+0500-U+052F */ - /* U+2DE0-U+2DFF */ - /* U+A640-U+A69F */ - /* Bit 10 Armenian */ -#define TT_UCR_ARMENIAN (1L << 10) /* U+0530-U+058F */ - /* Bit 11 Hebrew */ -#define TT_UCR_HEBREW (1L << 11) /* U+0590-U+05FF */ - /* Bit 12 Vai */ -#define TT_UCR_VAI (1L << 12) /* U+A500-U+A63F */ - /* Bit 13 Arabic */ - /* Arabic Supplement */ -#define TT_UCR_ARABIC (1L << 13) /* U+0600-U+06FF */ - /* U+0750-U+077F */ - /* Bit 14 NKo */ -#define TT_UCR_NKO (1L << 14) /* U+07C0-U+07FF */ - /* Bit 15 Devanagari */ -#define TT_UCR_DEVANAGARI (1L << 15) /* U+0900-U+097F */ - /* Bit 16 Bengali */ -#define TT_UCR_BENGALI (1L << 16) /* U+0980-U+09FF */ - /* Bit 17 Gurmukhi */ -#define TT_UCR_GURMUKHI (1L << 17) /* U+0A00-U+0A7F */ - /* Bit 18 Gujarati */ -#define TT_UCR_GUJARATI (1L << 18) /* U+0A80-U+0AFF */ - /* Bit 19 Oriya */ -#define TT_UCR_ORIYA (1L << 19) /* U+0B00-U+0B7F */ - /* Bit 20 Tamil */ -#define TT_UCR_TAMIL (1L << 20) /* U+0B80-U+0BFF */ - /* Bit 21 Telugu */ -#define TT_UCR_TELUGU (1L << 21) /* U+0C00-U+0C7F */ - /* Bit 22 Kannada */ -#define TT_UCR_KANNADA (1L << 22) /* U+0C80-U+0CFF */ - /* Bit 23 Malayalam */ -#define TT_UCR_MALAYALAM (1L << 23) /* U+0D00-U+0D7F */ - /* Bit 24 Thai */ -#define TT_UCR_THAI (1L << 24) /* U+0E00-U+0E7F */ - /* Bit 25 Lao */ -#define TT_UCR_LAO (1L << 25) /* U+0E80-U+0EFF */ - /* Bit 26 Georgian */ - /* Georgian Supplement */ -#define TT_UCR_GEORGIAN (1L << 26) /* U+10A0-U+10FF */ - /* U+2D00-U+2D2F */ - /* Bit 27 Balinese */ -#define TT_UCR_BALINESE (1L << 27) /* U+1B00-U+1B7F */ - /* Bit 28 Hangul Jamo */ -#define TT_UCR_HANGUL_JAMO (1L << 28) /* U+1100-U+11FF */ - /* Bit 29 Latin Extended Additional */ - /* Latin Extended-C */ - /* Latin Extended-D */ -#define TT_UCR_LATIN_EXTENDED_ADDITIONAL (1L << 29) /* U+1E00-U+1EFF */ - /* U+2C60-U+2C7F */ - /* U+A720-U+A7FF */ - /* Bit 30 Greek Extended */ -#define TT_UCR_GREEK_EXTENDED (1L << 30) /* U+1F00-U+1FFF */ - /* Bit 31 General Punctuation */ - /* Supplemental Punctuation */ -#define TT_UCR_GENERAL_PUNCTUATION (1L << 31) /* U+2000-U+206F */ - /* U+2E00-U+2E7F */ - /* Bit 32 Superscripts And Subscripts */ -#define TT_UCR_SUPERSCRIPTS_SUBSCRIPTS (1L << 0) /* U+2070-U+209F */ - /* Bit 33 Currency Symbols */ -#define TT_UCR_CURRENCY_SYMBOLS (1L << 1) /* U+20A0-U+20CF */ - /* Bit 34 Combining Diacritical Marks For Symbols */ -#define TT_UCR_COMBINING_DIACRITICS_SYMB (1L << 2) /* U+20D0-U+20FF */ - /* Bit 35 Letterlike Symbols */ -#define TT_UCR_LETTERLIKE_SYMBOLS (1L << 3) /* U+2100-U+214F */ - /* Bit 36 Number Forms */ -#define TT_UCR_NUMBER_FORMS (1L << 4) /* U+2150-U+218F */ - /* Bit 37 Arrows */ - /* Supplemental Arrows-A */ - /* Supplemental Arrows-B */ - /* Miscellaneous Symbols and Arrows */ -#define TT_UCR_ARROWS (1L << 5) /* U+2190-U+21FF */ - /* U+27F0-U+27FF */ - /* U+2900-U+297F */ - /* U+2B00-U+2BFF */ - /* Bit 38 Mathematical Operators */ - /* Supplemental Mathematical Operators */ - /* Miscellaneous Mathematical Symbols-A */ - /* Miscellaneous Mathematical Symbols-B */ -#define TT_UCR_MATHEMATICAL_OPERATORS (1L << 6) /* U+2200-U+22FF */ - /* U+2A00-U+2AFF */ - /* U+27C0-U+27EF */ - /* U+2980-U+29FF */ - /* Bit 39 Miscellaneous Technical */ -#define TT_UCR_MISCELLANEOUS_TECHNICAL (1L << 7) /* U+2300-U+23FF */ - /* Bit 40 Control Pictures */ -#define TT_UCR_CONTROL_PICTURES (1L << 8) /* U+2400-U+243F */ - /* Bit 41 Optical Character Recognition */ -#define TT_UCR_OCR (1L << 9) /* U+2440-U+245F */ - /* Bit 42 Enclosed Alphanumerics */ -#define TT_UCR_ENCLOSED_ALPHANUMERICS (1L << 10) /* U+2460-U+24FF */ - /* Bit 43 Box Drawing */ -#define TT_UCR_BOX_DRAWING (1L << 11) /* U+2500-U+257F */ - /* Bit 44 Block Elements */ -#define TT_UCR_BLOCK_ELEMENTS (1L << 12) /* U+2580-U+259F */ - /* Bit 45 Geometric Shapes */ -#define TT_UCR_GEOMETRIC_SHAPES (1L << 13) /* U+25A0-U+25FF */ - /* Bit 46 Miscellaneous Symbols */ -#define TT_UCR_MISCELLANEOUS_SYMBOLS (1L << 14) /* U+2600-U+26FF */ - /* Bit 47 Dingbats */ -#define TT_UCR_DINGBATS (1L << 15) /* U+2700-U+27BF */ - /* Bit 48 CJK Symbols and Punctuation */ -#define TT_UCR_CJK_SYMBOLS (1L << 16) /* U+3000-U+303F */ - /* Bit 49 Hiragana */ -#define TT_UCR_HIRAGANA (1L << 17) /* U+3040-U+309F */ - /* Bit 50 Katakana */ - /* Katakana Phonetic Extensions */ -#define TT_UCR_KATAKANA (1L << 18) /* U+30A0-U+30FF */ - /* U+31F0-U+31FF */ - /* Bit 51 Bopomofo */ - /* Bopomofo Extended */ -#define TT_UCR_BOPOMOFO (1L << 19) /* U+3100-U+312F */ - /* U+31A0-U+31BF */ - /* Bit 52 Hangul Compatibility Jamo */ -#define TT_UCR_HANGUL_COMPATIBILITY_JAMO (1L << 20) /* U+3130-U+318F */ - /* Bit 53 Phags-Pa */ -#define TT_UCR_CJK_MISC (1L << 21) /* U+A840-U+A87F */ -#define TT_UCR_KANBUN TT_UCR_CJK_MISC /* deprecated */ -#define TT_UCR_PHAGSPA - /* Bit 54 Enclosed CJK Letters and Months */ -#define TT_UCR_ENCLOSED_CJK_LETTERS_MONTHS (1L << 22) /* U+3200-U+32FF */ - /* Bit 55 CJK Compatibility */ -#define TT_UCR_CJK_COMPATIBILITY (1L << 23) /* U+3300-U+33FF */ - /* Bit 56 Hangul Syllables */ -#define TT_UCR_HANGUL (1L << 24) /* U+AC00-U+D7A3 */ - /* Bit 57 High Surrogates */ - /* High Private Use Surrogates */ - /* Low Surrogates */ - /* */ - /* According to OpenType specs v.1.3+, */ - /* setting bit 57 implies that there is */ - /* at least one codepoint beyond the */ - /* Basic Multilingual Plane that is */ - /* supported by this font. So it really */ - /* means >= U+10000 */ -#define TT_UCR_SURROGATES (1L << 25) /* U+D800-U+DB7F */ - /* U+DB80-U+DBFF */ - /* U+DC00-U+DFFF */ -#define TT_UCR_NON_PLANE_0 TT_UCR_SURROGATES - /* Bit 58 Phoenician */ -#define TT_UCR_PHOENICIAN (1L << 26) /*U+10900-U+1091F*/ - /* Bit 59 CJK Unified Ideographs */ - /* CJK Radicals Supplement */ - /* Kangxi Radicals */ - /* Ideographic Description Characters */ - /* CJK Unified Ideographs Extension A */ - /* CJK Unified Ideographs Extension B */ - /* Kanbun */ -#define TT_UCR_CJK_UNIFIED_IDEOGRAPHS (1L << 27) /* U+4E00-U+9FFF */ - /* U+2E80-U+2EFF */ - /* U+2F00-U+2FDF */ - /* U+2FF0-U+2FFF */ - /* U+3400-U+4DB5 */ - /*U+20000-U+2A6DF*/ - /* U+3190-U+319F */ - /* Bit 60 Private Use */ -#define TT_UCR_PRIVATE_USE (1L << 28) /* U+E000-U+F8FF */ - /* Bit 61 CJK Strokes */ - /* CJK Compatibility Ideographs */ - /* CJK Compatibility Ideographs Supplement */ -#define TT_UCR_CJK_COMPATIBILITY_IDEOGRAPHS (1L << 29) /* U+31C0-U+31EF */ - /* U+F900-U+FAFF */ - /*U+2F800-U+2FA1F*/ - /* Bit 62 Alphabetic Presentation Forms */ -#define TT_UCR_ALPHABETIC_PRESENTATION_FORMS (1L << 30) /* U+FB00-U+FB4F */ - /* Bit 63 Arabic Presentation Forms-A */ -#define TT_UCR_ARABIC_PRESENTATIONS_A (1L << 31) /* U+FB50-U+FDFF */ - /* Bit 64 Combining Half Marks */ -#define TT_UCR_COMBINING_HALF_MARKS (1L << 0) /* U+FE20-U+FE2F */ - /* Bit 65 Vertical forms */ - /* CJK Compatibility Forms */ -#define TT_UCR_CJK_COMPATIBILITY_FORMS (1L << 1) /* U+FE10-U+FE1F */ - /* U+FE30-U+FE4F */ - /* Bit 66 Small Form Variants */ -#define TT_UCR_SMALL_FORM_VARIANTS (1L << 2) /* U+FE50-U+FE6F */ - /* Bit 67 Arabic Presentation Forms-B */ -#define TT_UCR_ARABIC_PRESENTATIONS_B (1L << 3) /* U+FE70-U+FEFE */ - /* Bit 68 Halfwidth and Fullwidth Forms */ -#define TT_UCR_HALFWIDTH_FULLWIDTH_FORMS (1L << 4) /* U+FF00-U+FFEF */ - /* Bit 69 Specials */ -#define TT_UCR_SPECIALS (1L << 5) /* U+FFF0-U+FFFD */ - /* Bit 70 Tibetan */ -#define TT_UCR_TIBETAN (1L << 6) /* U+0F00-U+0FFF */ - /* Bit 71 Syriac */ -#define TT_UCR_SYRIAC (1L << 7) /* U+0700-U+074F */ - /* Bit 72 Thaana */ -#define TT_UCR_THAANA (1L << 8) /* U+0780-U+07BF */ - /* Bit 73 Sinhala */ -#define TT_UCR_SINHALA (1L << 9) /* U+0D80-U+0DFF */ - /* Bit 74 Myanmar */ -#define TT_UCR_MYANMAR (1L << 10) /* U+1000-U+109F */ - /* Bit 75 Ethiopic */ - /* Ethiopic Supplement */ - /* Ethiopic Extended */ -#define TT_UCR_ETHIOPIC (1L << 11) /* U+1200-U+137F */ - /* U+1380-U+139F */ - /* U+2D80-U+2DDF */ - /* Bit 76 Cherokee */ -#define TT_UCR_CHEROKEE (1L << 12) /* U+13A0-U+13FF */ - /* Bit 77 Unified Canadian Aboriginal Syllabics */ -#define TT_UCR_CANADIAN_ABORIGINAL_SYLLABICS (1L << 13) /* U+1400-U+167F */ - /* Bit 78 Ogham */ -#define TT_UCR_OGHAM (1L << 14) /* U+1680-U+169F */ - /* Bit 79 Runic */ -#define TT_UCR_RUNIC (1L << 15) /* U+16A0-U+16FF */ - /* Bit 80 Khmer */ - /* Khmer Symbols */ -#define TT_UCR_KHMER (1L << 16) /* U+1780-U+17FF */ - /* U+19E0-U+19FF */ - /* Bit 81 Mongolian */ -#define TT_UCR_MONGOLIAN (1L << 17) /* U+1800-U+18AF */ - /* Bit 82 Braille Patterns */ -#define TT_UCR_BRAILLE (1L << 18) /* U+2800-U+28FF */ - /* Bit 83 Yi Syllables */ - /* Yi Radicals */ -#define TT_UCR_YI (1L << 19) /* U+A000-U+A48F */ - /* U+A490-U+A4CF */ - /* Bit 84 Tagalog */ - /* Hanunoo */ - /* Buhid */ - /* Tagbanwa */ -#define TT_UCR_PHILIPPINE (1L << 20) /* U+1700-U+171F */ - /* U+1720-U+173F */ - /* U+1740-U+175F */ - /* U+1760-U+177F */ - /* Bit 85 Old Italic */ -#define TT_UCR_OLD_ITALIC (1L << 21) /*U+10300-U+1032F*/ - /* Bit 86 Gothic */ -#define TT_UCR_GOTHIC (1L << 22) /*U+10330-U+1034F*/ - /* Bit 87 Deseret */ -#define TT_UCR_DESERET (1L << 23) /*U+10400-U+1044F*/ - /* Bit 88 Byzantine Musical Symbols */ - /* Musical Symbols */ - /* Ancient Greek Musical Notation */ -#define TT_UCR_MUSICAL_SYMBOLS (1L << 24) /*U+1D000-U+1D0FF*/ - /*U+1D100-U+1D1FF*/ - /*U+1D200-U+1D24F*/ - /* Bit 89 Mathematical Alphanumeric Symbols */ -#define TT_UCR_MATH_ALPHANUMERIC_SYMBOLS (1L << 25) /*U+1D400-U+1D7FF*/ - /* Bit 90 Private Use (plane 15) */ - /* Private Use (plane 16) */ -#define TT_UCR_PRIVATE_USE_SUPPLEMENTARY (1L << 26) /*U+F0000-U+FFFFD*/ - /*U+100000-U+10FFFD*/ - /* Bit 91 Variation Selectors */ - /* Variation Selectors Supplement */ -#define TT_UCR_VARIATION_SELECTORS (1L << 27) /* U+FE00-U+FE0F */ - /*U+E0100-U+E01EF*/ - /* Bit 92 Tags */ -#define TT_UCR_TAGS (1L << 28) /*U+E0000-U+E007F*/ - /* Bit 93 Limbu */ -#define TT_UCR_LIMBU (1L << 29) /* U+1900-U+194F */ - /* Bit 94 Tai Le */ -#define TT_UCR_TAI_LE (1L << 30) /* U+1950-U+197F */ - /* Bit 95 New Tai Lue */ -#define TT_UCR_NEW_TAI_LUE (1L << 31) /* U+1980-U+19DF */ - /* Bit 96 Buginese */ -#define TT_UCR_BUGINESE (1L << 0) /* U+1A00-U+1A1F */ - /* Bit 97 Glagolitic */ -#define TT_UCR_GLAGOLITIC (1L << 1) /* U+2C00-U+2C5F */ - /* Bit 98 Tifinagh */ -#define TT_UCR_TIFINAGH (1L << 2) /* U+2D30-U+2D7F */ - /* Bit 99 Yijing Hexagram Symbols */ -#define TT_UCR_YIJING (1L << 3) /* U+4DC0-U+4DFF */ - /* Bit 100 Syloti Nagri */ -#define TT_UCR_SYLOTI_NAGRI (1L << 4) /* U+A800-U+A82F */ - /* Bit 101 Linear B Syllabary */ - /* Linear B Ideograms */ - /* Aegean Numbers */ -#define TT_UCR_LINEAR_B (1L << 5) /*U+10000-U+1007F*/ - /*U+10080-U+100FF*/ - /*U+10100-U+1013F*/ - /* Bit 102 Ancient Greek Numbers */ -#define TT_UCR_ANCIENT_GREEK_NUMBERS (1L << 6) /*U+10140-U+1018F*/ - /* Bit 103 Ugaritic */ -#define TT_UCR_UGARITIC (1L << 7) /*U+10380-U+1039F*/ - /* Bit 104 Old Persian */ -#define TT_UCR_OLD_PERSIAN (1L << 8) /*U+103A0-U+103DF*/ - /* Bit 105 Shavian */ -#define TT_UCR_SHAVIAN (1L << 9) /*U+10450-U+1047F*/ - /* Bit 106 Osmanya */ -#define TT_UCR_OSMANYA (1L << 10) /*U+10480-U+104AF*/ - /* Bit 107 Cypriot Syllabary */ -#define TT_UCR_CYPRIOT_SYLLABARY (1L << 11) /*U+10800-U+1083F*/ - /* Bit 108 Kharoshthi */ -#define TT_UCR_KHAROSHTHI (1L << 12) /*U+10A00-U+10A5F*/ - /* Bit 109 Tai Xuan Jing Symbols */ -#define TT_UCR_TAI_XUAN_JING (1L << 13) /*U+1D300-U+1D35F*/ - /* Bit 110 Cuneiform */ - /* Cuneiform Numbers and Punctuation */ -#define TT_UCR_CUNEIFORM (1L << 14) /*U+12000-U+123FF*/ - /*U+12400-U+1247F*/ - /* Bit 111 Counting Rod Numerals */ -#define TT_UCR_COUNTING_ROD_NUMERALS (1L << 15) /*U+1D360-U+1D37F*/ - /* Bit 112 Sundanese */ -#define TT_UCR_SUNDANESE (1L << 16) /* U+1B80-U+1BBF */ - /* Bit 113 Lepcha */ -#define TT_UCR_LEPCHA (1L << 17) /* U+1C00-U+1C4F */ - /* Bit 114 Ol Chiki */ -#define TT_UCR_OL_CHIKI (1L << 18) /* U+1C50-U+1C7F */ - /* Bit 115 Saurashtra */ -#define TT_UCR_SAURASHTRA (1L << 19) /* U+A880-U+A8DF */ - /* Bit 116 Kayah Li */ -#define TT_UCR_KAYAH_LI (1L << 20) /* U+A900-U+A92F */ - /* Bit 117 Rejang */ -#define TT_UCR_REJANG (1L << 21) /* U+A930-U+A95F */ - /* Bit 118 Cham */ -#define TT_UCR_CHAM (1L << 22) /* U+AA00-U+AA5F */ - /* Bit 119 Ancient Symbols */ -#define TT_UCR_ANCIENT_SYMBOLS (1L << 23) /*U+10190-U+101CF*/ - /* Bit 120 Phaistos Disc */ -#define TT_UCR_PHAISTOS_DISC (1L << 24) /*U+101D0-U+101FF*/ - /* Bit 121 Carian */ - /* Lycian */ - /* Lydian */ -#define TT_UCR_OLD_ANATOLIAN (1L << 25) /*U+102A0-U+102DF*/ - /*U+10280-U+1029F*/ - /*U+10920-U+1093F*/ - /* Bit 122 Domino Tiles */ - /* Mahjong Tiles */ -#define TT_UCR_GAME_TILES (1L << 26) /*U+1F030-U+1F09F*/ - /*U+1F000-U+1F02F*/ - /* Bit 123-127 Reserved for process-internal usage */ - - - /*************************************************************************/ - /* */ - /* Some compilers have a very limited length of identifiers. */ - /* */ -#if defined( __TURBOC__ ) && __TURBOC__ < 0x0410 || defined( __PACIFIC__ ) -#define HAVE_LIMIT_ON_IDENTS -#endif - - -#ifndef HAVE_LIMIT_ON_IDENTS - - - /*************************************************************************/ - /* */ - /* Here some alias #defines in order to be clearer. */ - /* */ - /* These are not always #defined to stay within the 31~character limit */ - /* which some compilers have. */ - /* */ - /* Credits go to Dave Hoo <dhoo@flash.net> for pointing out that modern */ - /* Borland compilers (read: from BC++ 3.1 on) can increase this limit. */ - /* If you get a warning with such a compiler, use the -i40 switch. */ - /* */ -#define TT_UCR_ARABIC_PRESENTATION_FORMS_A \ - TT_UCR_ARABIC_PRESENTATIONS_A -#define TT_UCR_ARABIC_PRESENTATION_FORMS_B \ - TT_UCR_ARABIC_PRESENTATIONS_B - -#define TT_UCR_COMBINING_DIACRITICAL_MARKS \ - TT_UCR_COMBINING_DIACRITICS -#define TT_UCR_COMBINING_DIACRITICAL_MARKS_SYMB \ - TT_UCR_COMBINING_DIACRITICS_SYMB - - -#endif /* !HAVE_LIMIT_ON_IDENTS */ - - -FT_END_HEADER - -#endif /* __TTNAMEID_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/tttables.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/tttables.h deleted file mode 100644 index 02236c2005..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/tttables.h +++ /dev/null @@ -1,763 +0,0 @@ -/***************************************************************************/ -/* */ -/* tttables.h */ -/* */ -/* Basic SFNT/TrueType tables definitions and interface */ -/* (specification only). */ -/* */ -/* Copyright 1996-2005, 2008-2011 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __TTTABLES_H__ -#define __TTTABLES_H__ - - -#include <ft2build.h> -#include FT_FREETYPE_H - -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - - -FT_BEGIN_HEADER - - /*************************************************************************/ - /* */ - /* <Section> */ - /* truetype_tables */ - /* */ - /* <Title> */ - /* TrueType Tables */ - /* */ - /* <Abstract> */ - /* TrueType specific table types and functions. */ - /* */ - /* <Description> */ - /* This section contains the definition of TrueType-specific tables */ - /* as well as some routines used to access and process them. */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* TT_Header */ - /* */ - /* <Description> */ - /* A structure used to model a TrueType font header table. All */ - /* fields follow the TrueType specification. */ - /* */ - typedef struct TT_Header_ - { - FT_Fixed Table_Version; - FT_Fixed Font_Revision; - - FT_Long CheckSum_Adjust; - FT_Long Magic_Number; - - FT_UShort Flags; - FT_UShort Units_Per_EM; - - FT_Long Created [2]; - FT_Long Modified[2]; - - FT_Short xMin; - FT_Short yMin; - FT_Short xMax; - FT_Short yMax; - - FT_UShort Mac_Style; - FT_UShort Lowest_Rec_PPEM; - - FT_Short Font_Direction; - FT_Short Index_To_Loc_Format; - FT_Short Glyph_Data_Format; - - } TT_Header; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* TT_HoriHeader */ - /* */ - /* <Description> */ - /* A structure used to model a TrueType horizontal header, the `hhea' */ - /* table, as well as the corresponding horizontal metrics table, */ - /* i.e., the `hmtx' table. */ - /* */ - /* <Fields> */ - /* Version :: The table version. */ - /* */ - /* Ascender :: The font's ascender, i.e., the distance */ - /* from the baseline to the top-most of all */ - /* glyph points found in the font. */ - /* */ - /* This value is invalid in many fonts, as */ - /* it is usually set by the font designer, */ - /* and often reflects only a portion of the */ - /* glyphs found in the font (maybe ASCII). */ - /* */ - /* You should use the `sTypoAscender' field */ - /* of the OS/2 table instead if you want */ - /* the correct one. */ - /* */ - /* Descender :: The font's descender, i.e., the distance */ - /* from the baseline to the bottom-most of */ - /* all glyph points found in the font. It */ - /* is negative. */ - /* */ - /* This value is invalid in many fonts, as */ - /* it is usually set by the font designer, */ - /* and often reflects only a portion of the */ - /* glyphs found in the font (maybe ASCII). */ - /* */ - /* You should use the `sTypoDescender' */ - /* field of the OS/2 table instead if you */ - /* want the correct one. */ - /* */ - /* Line_Gap :: The font's line gap, i.e., the distance */ - /* to add to the ascender and descender to */ - /* get the BTB, i.e., the */ - /* baseline-to-baseline distance for the */ - /* font. */ - /* */ - /* advance_Width_Max :: This field is the maximum of all advance */ - /* widths found in the font. It can be */ - /* used to compute the maximum width of an */ - /* arbitrary string of text. */ - /* */ - /* min_Left_Side_Bearing :: The minimum left side bearing of all */ - /* glyphs within the font. */ - /* */ - /* min_Right_Side_Bearing :: The minimum right side bearing of all */ - /* glyphs within the font. */ - /* */ - /* xMax_Extent :: The maximum horizontal extent (i.e., the */ - /* `width' of a glyph's bounding box) for */ - /* all glyphs in the font. */ - /* */ - /* caret_Slope_Rise :: The rise coefficient of the cursor's */ - /* slope of the cursor (slope=rise/run). */ - /* */ - /* caret_Slope_Run :: The run coefficient of the cursor's */ - /* slope. */ - /* */ - /* Reserved :: 8~reserved bytes. */ - /* */ - /* metric_Data_Format :: Always~0. */ - /* */ - /* number_Of_HMetrics :: Number of HMetrics entries in the `hmtx' */ - /* table -- this value can be smaller than */ - /* the total number of glyphs in the font. */ - /* */ - /* long_metrics :: A pointer into the `hmtx' table. */ - /* */ - /* short_metrics :: A pointer into the `hmtx' table. */ - /* */ - /* <Note> */ - /* IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should */ - /* be identical except for the names of their fields which */ - /* are different. */ - /* */ - /* This ensures that a single function in the `ttload' */ - /* module is able to read both the horizontal and vertical */ - /* headers. */ - /* */ - typedef struct TT_HoriHeader_ - { - FT_Fixed Version; - FT_Short Ascender; - FT_Short Descender; - FT_Short Line_Gap; - - FT_UShort advance_Width_Max; /* advance width maximum */ - - FT_Short min_Left_Side_Bearing; /* minimum left-sb */ - FT_Short min_Right_Side_Bearing; /* minimum right-sb */ - FT_Short xMax_Extent; /* xmax extents */ - FT_Short caret_Slope_Rise; - FT_Short caret_Slope_Run; - FT_Short caret_Offset; - - FT_Short Reserved[4]; - - FT_Short metric_Data_Format; - FT_UShort number_Of_HMetrics; - - /* The following fields are not defined by the TrueType specification */ - /* but they are used to connect the metrics header to the relevant */ - /* `HMTX' table. */ - - void* long_metrics; - void* short_metrics; - - } TT_HoriHeader; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* TT_VertHeader */ - /* */ - /* <Description> */ - /* A structure used to model a TrueType vertical header, the `vhea' */ - /* table, as well as the corresponding vertical metrics table, i.e., */ - /* the `vmtx' table. */ - /* */ - /* <Fields> */ - /* Version :: The table version. */ - /* */ - /* Ascender :: The font's ascender, i.e., the distance */ - /* from the baseline to the top-most of */ - /* all glyph points found in the font. */ - /* */ - /* This value is invalid in many fonts, as */ - /* it is usually set by the font designer, */ - /* and often reflects only a portion of */ - /* the glyphs found in the font (maybe */ - /* ASCII). */ - /* */ - /* You should use the `sTypoAscender' */ - /* field of the OS/2 table instead if you */ - /* want the correct one. */ - /* */ - /* Descender :: The font's descender, i.e., the */ - /* distance from the baseline to the */ - /* bottom-most of all glyph points found */ - /* in the font. It is negative. */ - /* */ - /* This value is invalid in many fonts, as */ - /* it is usually set by the font designer, */ - /* and often reflects only a portion of */ - /* the glyphs found in the font (maybe */ - /* ASCII). */ - /* */ - /* You should use the `sTypoDescender' */ - /* field of the OS/2 table instead if you */ - /* want the correct one. */ - /* */ - /* Line_Gap :: The font's line gap, i.e., the distance */ - /* to add to the ascender and descender to */ - /* get the BTB, i.e., the */ - /* baseline-to-baseline distance for the */ - /* font. */ - /* */ - /* advance_Height_Max :: This field is the maximum of all */ - /* advance heights found in the font. It */ - /* can be used to compute the maximum */ - /* height of an arbitrary string of text. */ - /* */ - /* min_Top_Side_Bearing :: The minimum top side bearing of all */ - /* glyphs within the font. */ - /* */ - /* min_Bottom_Side_Bearing :: The minimum bottom side bearing of all */ - /* glyphs within the font. */ - /* */ - /* yMax_Extent :: The maximum vertical extent (i.e., the */ - /* `height' of a glyph's bounding box) for */ - /* all glyphs in the font. */ - /* */ - /* caret_Slope_Rise :: The rise coefficient of the cursor's */ - /* slope of the cursor (slope=rise/run). */ - /* */ - /* caret_Slope_Run :: The run coefficient of the cursor's */ - /* slope. */ - /* */ - /* caret_Offset :: The cursor's offset for slanted fonts. */ - /* This value is `reserved' in vmtx */ - /* version 1.0. */ - /* */ - /* Reserved :: 8~reserved bytes. */ - /* */ - /* metric_Data_Format :: Always~0. */ - /* */ - /* number_Of_HMetrics :: Number of VMetrics entries in the */ - /* `vmtx' table -- this value can be */ - /* smaller than the total number of glyphs */ - /* in the font. */ - /* */ - /* long_metrics :: A pointer into the `vmtx' table. */ - /* */ - /* short_metrics :: A pointer into the `vmtx' table. */ - /* */ - /* <Note> */ - /* IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should */ - /* be identical except for the names of their fields which */ - /* are different. */ - /* */ - /* This ensures that a single function in the `ttload' */ - /* module is able to read both the horizontal and vertical */ - /* headers. */ - /* */ - typedef struct TT_VertHeader_ - { - FT_Fixed Version; - FT_Short Ascender; - FT_Short Descender; - FT_Short Line_Gap; - - FT_UShort advance_Height_Max; /* advance height maximum */ - - FT_Short min_Top_Side_Bearing; /* minimum left-sb or top-sb */ - FT_Short min_Bottom_Side_Bearing; /* minimum right-sb or bottom-sb */ - FT_Short yMax_Extent; /* xmax or ymax extents */ - FT_Short caret_Slope_Rise; - FT_Short caret_Slope_Run; - FT_Short caret_Offset; - - FT_Short Reserved[4]; - - FT_Short metric_Data_Format; - FT_UShort number_Of_VMetrics; - - /* The following fields are not defined by the TrueType specification */ - /* but they're used to connect the metrics header to the relevant */ - /* `HMTX' or `VMTX' table. */ - - void* long_metrics; - void* short_metrics; - - } TT_VertHeader; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* TT_OS2 */ - /* */ - /* <Description> */ - /* A structure used to model a TrueType OS/2 table. This is the long */ - /* table version. All fields comply to the TrueType specification. */ - /* */ - /* Note that we now support old Mac fonts which do not include an */ - /* OS/2 table. In this case, the `version' field is always set to */ - /* 0xFFFF. */ - /* */ - typedef struct TT_OS2_ - { - FT_UShort version; /* 0x0001 - more or 0xFFFF */ - FT_Short xAvgCharWidth; - FT_UShort usWeightClass; - FT_UShort usWidthClass; - FT_Short fsType; - FT_Short ySubscriptXSize; - FT_Short ySubscriptYSize; - FT_Short ySubscriptXOffset; - FT_Short ySubscriptYOffset; - FT_Short ySuperscriptXSize; - FT_Short ySuperscriptYSize; - FT_Short ySuperscriptXOffset; - FT_Short ySuperscriptYOffset; - FT_Short yStrikeoutSize; - FT_Short yStrikeoutPosition; - FT_Short sFamilyClass; - - FT_Byte panose[10]; - - FT_ULong ulUnicodeRange1; /* Bits 0-31 */ - FT_ULong ulUnicodeRange2; /* Bits 32-63 */ - FT_ULong ulUnicodeRange3; /* Bits 64-95 */ - FT_ULong ulUnicodeRange4; /* Bits 96-127 */ - - FT_Char achVendID[4]; - - FT_UShort fsSelection; - FT_UShort usFirstCharIndex; - FT_UShort usLastCharIndex; - FT_Short sTypoAscender; - FT_Short sTypoDescender; - FT_Short sTypoLineGap; - FT_UShort usWinAscent; - FT_UShort usWinDescent; - - /* only version 1 tables: */ - - FT_ULong ulCodePageRange1; /* Bits 0-31 */ - FT_ULong ulCodePageRange2; /* Bits 32-63 */ - - /* only version 2 tables: */ - - FT_Short sxHeight; - FT_Short sCapHeight; - FT_UShort usDefaultChar; - FT_UShort usBreakChar; - FT_UShort usMaxContext; - - } TT_OS2; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* TT_Postscript */ - /* */ - /* <Description> */ - /* A structure used to model a TrueType PostScript table. All fields */ - /* comply to the TrueType specification. This structure does not */ - /* reference the PostScript glyph names, which can be nevertheless */ - /* accessed with the `ttpost' module. */ - /* */ - typedef struct TT_Postscript_ - { - FT_Fixed FormatType; - FT_Fixed italicAngle; - FT_Short underlinePosition; - FT_Short underlineThickness; - FT_ULong isFixedPitch; - FT_ULong minMemType42; - FT_ULong maxMemType42; - FT_ULong minMemType1; - FT_ULong maxMemType1; - - /* Glyph names follow in the file, but we don't */ - /* load them by default. See the ttpost.c file. */ - - } TT_Postscript; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* TT_PCLT */ - /* */ - /* <Description> */ - /* A structure used to model a TrueType PCLT table. All fields */ - /* comply to the TrueType specification. */ - /* */ - typedef struct TT_PCLT_ - { - FT_Fixed Version; - FT_ULong FontNumber; - FT_UShort Pitch; - FT_UShort xHeight; - FT_UShort Style; - FT_UShort TypeFamily; - FT_UShort CapHeight; - FT_UShort SymbolSet; - FT_Char TypeFace[16]; - FT_Char CharacterComplement[8]; - FT_Char FileName[6]; - FT_Char StrokeWeight; - FT_Char WidthType; - FT_Byte SerifStyle; - FT_Byte Reserved; - - } TT_PCLT; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* TT_MaxProfile */ - /* */ - /* <Description> */ - /* The maximum profile is a table containing many max values which */ - /* can be used to pre-allocate arrays. This ensures that no memory */ - /* allocation occurs during a glyph load. */ - /* */ - /* <Fields> */ - /* version :: The version number. */ - /* */ - /* numGlyphs :: The number of glyphs in this TrueType */ - /* font. */ - /* */ - /* maxPoints :: The maximum number of points in a */ - /* non-composite TrueType glyph. See also */ - /* the structure element */ - /* `maxCompositePoints'. */ - /* */ - /* maxContours :: The maximum number of contours in a */ - /* non-composite TrueType glyph. See also */ - /* the structure element */ - /* `maxCompositeContours'. */ - /* */ - /* maxCompositePoints :: The maximum number of points in a */ - /* composite TrueType glyph. See also the */ - /* structure element `maxPoints'. */ - /* */ - /* maxCompositeContours :: The maximum number of contours in a */ - /* composite TrueType glyph. See also the */ - /* structure element `maxContours'. */ - /* */ - /* maxZones :: The maximum number of zones used for */ - /* glyph hinting. */ - /* */ - /* maxTwilightPoints :: The maximum number of points in the */ - /* twilight zone used for glyph hinting. */ - /* */ - /* maxStorage :: The maximum number of elements in the */ - /* storage area used for glyph hinting. */ - /* */ - /* maxFunctionDefs :: The maximum number of function */ - /* definitions in the TrueType bytecode for */ - /* this font. */ - /* */ - /* maxInstructionDefs :: The maximum number of instruction */ - /* definitions in the TrueType bytecode for */ - /* this font. */ - /* */ - /* maxStackElements :: The maximum number of stack elements used */ - /* during bytecode interpretation. */ - /* */ - /* maxSizeOfInstructions :: The maximum number of TrueType opcodes */ - /* used for glyph hinting. */ - /* */ - /* maxComponentElements :: The maximum number of simple (i.e., non- */ - /* composite) glyphs in a composite glyph. */ - /* */ - /* maxComponentDepth :: The maximum nesting depth of composite */ - /* glyphs. */ - /* */ - /* <Note> */ - /* This structure is only used during font loading. */ - /* */ - typedef struct TT_MaxProfile_ - { - FT_Fixed version; - FT_UShort numGlyphs; - FT_UShort maxPoints; - FT_UShort maxContours; - FT_UShort maxCompositePoints; - FT_UShort maxCompositeContours; - FT_UShort maxZones; - FT_UShort maxTwilightPoints; - FT_UShort maxStorage; - FT_UShort maxFunctionDefs; - FT_UShort maxInstructionDefs; - FT_UShort maxStackElements; - FT_UShort maxSizeOfInstructions; - FT_UShort maxComponentElements; - FT_UShort maxComponentDepth; - - } TT_MaxProfile; - - - /*************************************************************************/ - /* */ - /* <Enum> */ - /* FT_Sfnt_Tag */ - /* */ - /* <Description> */ - /* An enumeration used to specify the index of an SFNT table. */ - /* Used in the @FT_Get_Sfnt_Table API function. */ - /* */ - typedef enum FT_Sfnt_Tag_ - { - ft_sfnt_head = 0, /* TT_Header */ - ft_sfnt_maxp = 1, /* TT_MaxProfile */ - ft_sfnt_os2 = 2, /* TT_OS2 */ - ft_sfnt_hhea = 3, /* TT_HoriHeader */ - ft_sfnt_vhea = 4, /* TT_VertHeader */ - ft_sfnt_post = 5, /* TT_Postscript */ - ft_sfnt_pclt = 6, /* TT_PCLT */ - - sfnt_max /* internal end mark */ - - } FT_Sfnt_Tag; - - /* */ - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Get_Sfnt_Table */ - /* */ - /* <Description> */ - /* Return a pointer to a given SFNT table within a face. */ - /* */ - /* <Input> */ - /* face :: A handle to the source. */ - /* */ - /* tag :: The index of the SFNT table. */ - /* */ - /* <Return> */ - /* A type-less pointer to the table. This will be~0 in case of */ - /* error, or if the corresponding table was not found *OR* loaded */ - /* from the file. */ - /* */ - /* Use a typecast according to `tag' to access the structure */ - /* elements. */ - /* */ - /* <Note> */ - /* The table is owned by the face object and disappears with it. */ - /* */ - /* This function is only useful to access SFNT tables that are loaded */ - /* by the sfnt, truetype, and opentype drivers. See @FT_Sfnt_Tag for */ - /* a list. */ - /* */ - FT_EXPORT( void* ) - FT_Get_Sfnt_Table( FT_Face face, - FT_Sfnt_Tag tag ); - - - /************************************************************************** - * - * @function: - * FT_Load_Sfnt_Table - * - * @description: - * Load any font table into client memory. - * - * @input: - * face :: - * A handle to the source face. - * - * tag :: - * The four-byte tag of the table to load. Use the value~0 if you want - * to access the whole font file. Otherwise, you can use one of the - * definitions found in the @FT_TRUETYPE_TAGS_H file, or forge a new - * one with @FT_MAKE_TAG. - * - * offset :: - * The starting offset in the table (or file if tag == 0). - * - * @output: - * buffer :: - * The target buffer address. The client must ensure that the memory - * array is big enough to hold the data. - * - * @inout: - * length :: - * If the `length' parameter is NULL, then try to load the whole table. - * Return an error code if it fails. - * - * Else, if `*length' is~0, exit immediately while returning the - * table's (or file) full size in it. - * - * Else the number of bytes to read from the table or file, from the - * starting offset. - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * If you need to determine the table's length you should first call this - * function with `*length' set to~0, as in the following example: - * - * { - * FT_ULong length = 0; - * - * - * error = FT_Load_Sfnt_Table( face, tag, 0, NULL, &length ); - * if ( error ) { ... table does not exist ... } - * - * buffer = malloc( length ); - * if ( buffer == NULL ) { ... not enough memory ... } - * - * error = FT_Load_Sfnt_Table( face, tag, 0, buffer, &length ); - * if ( error ) { ... could not load table ... } - * } - */ - FT_EXPORT( FT_Error ) - FT_Load_Sfnt_Table( FT_Face face, - FT_ULong tag, - FT_Long offset, - FT_Byte* buffer, - FT_ULong* length ); - - - /************************************************************************** - * - * @function: - * FT_Sfnt_Table_Info - * - * @description: - * Return information on an SFNT table. - * - * @input: - * face :: - * A handle to the source face. - * - * table_index :: - * The index of an SFNT table. The function returns - * FT_Err_Table_Missing for an invalid value. - * - * @inout: - * tag :: - * The name tag of the SFNT table. If the value is NULL, `table_index' - * is ignored, and `length' returns the number of SFNT tables in the - * font. - * - * @output: - * length :: - * The length of the SFNT table (or the number of SFNT tables, depending - * on `tag'). - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * SFNT tables with length zero are treated as missing. - * - */ - FT_EXPORT( FT_Error ) - FT_Sfnt_Table_Info( FT_Face face, - FT_UInt table_index, - FT_ULong *tag, - FT_ULong *length ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Get_CMap_Language_ID */ - /* */ - /* <Description> */ - /* Return TrueType/sfnt specific cmap language ID. Definitions of */ - /* language ID values are in `freetype/ttnameid.h'. */ - /* */ - /* <Input> */ - /* charmap :: */ - /* The target charmap. */ - /* */ - /* <Return> */ - /* The language ID of `charmap'. If `charmap' doesn't belong to a */ - /* TrueType/sfnt face, just return~0 as the default value. */ - /* */ - FT_EXPORT( FT_ULong ) - FT_Get_CMap_Language_ID( FT_CharMap charmap ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Get_CMap_Format */ - /* */ - /* <Description> */ - /* Return TrueType/sfnt specific cmap format. */ - /* */ - /* <Input> */ - /* charmap :: */ - /* The target charmap. */ - /* */ - /* <Return> */ - /* The format of `charmap'. If `charmap' doesn't belong to a */ - /* TrueType/sfnt face, return -1. */ - /* */ - FT_EXPORT( FT_Long ) - FT_Get_CMap_Format( FT_CharMap charmap ); - - /* */ - - -FT_END_HEADER - -#endif /* __TTTABLES_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/tttags.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/tttags.h deleted file mode 100644 index 307ce4b637..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/tttags.h +++ /dev/null @@ -1,107 +0,0 @@ -/***************************************************************************/ -/* */ -/* tttags.h */ -/* */ -/* Tags for TrueType and OpenType tables (specification only). */ -/* */ -/* Copyright 1996-2001, 2004, 2005, 2007, 2008 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __TTAGS_H__ -#define __TTAGS_H__ - - -#include <ft2build.h> -#include FT_FREETYPE_H - -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - - -FT_BEGIN_HEADER - - -#define TTAG_avar FT_MAKE_TAG( 'a', 'v', 'a', 'r' ) -#define TTAG_BASE FT_MAKE_TAG( 'B', 'A', 'S', 'E' ) -#define TTAG_bdat FT_MAKE_TAG( 'b', 'd', 'a', 't' ) -#define TTAG_BDF FT_MAKE_TAG( 'B', 'D', 'F', ' ' ) -#define TTAG_bhed FT_MAKE_TAG( 'b', 'h', 'e', 'd' ) -#define TTAG_bloc FT_MAKE_TAG( 'b', 'l', 'o', 'c' ) -#define TTAG_bsln FT_MAKE_TAG( 'b', 's', 'l', 'n' ) -#define TTAG_CFF FT_MAKE_TAG( 'C', 'F', 'F', ' ' ) -#define TTAG_CID FT_MAKE_TAG( 'C', 'I', 'D', ' ' ) -#define TTAG_cmap FT_MAKE_TAG( 'c', 'm', 'a', 'p' ) -#define TTAG_cvar FT_MAKE_TAG( 'c', 'v', 'a', 'r' ) -#define TTAG_cvt FT_MAKE_TAG( 'c', 'v', 't', ' ' ) -#define TTAG_DSIG FT_MAKE_TAG( 'D', 'S', 'I', 'G' ) -#define TTAG_EBDT FT_MAKE_TAG( 'E', 'B', 'D', 'T' ) -#define TTAG_EBLC FT_MAKE_TAG( 'E', 'B', 'L', 'C' ) -#define TTAG_EBSC FT_MAKE_TAG( 'E', 'B', 'S', 'C' ) -#define TTAG_feat FT_MAKE_TAG( 'f', 'e', 'a', 't' ) -#define TTAG_FOND FT_MAKE_TAG( 'F', 'O', 'N', 'D' ) -#define TTAG_fpgm FT_MAKE_TAG( 'f', 'p', 'g', 'm' ) -#define TTAG_fvar FT_MAKE_TAG( 'f', 'v', 'a', 'r' ) -#define TTAG_gasp FT_MAKE_TAG( 'g', 'a', 's', 'p' ) -#define TTAG_GDEF FT_MAKE_TAG( 'G', 'D', 'E', 'F' ) -#define TTAG_glyf FT_MAKE_TAG( 'g', 'l', 'y', 'f' ) -#define TTAG_GPOS FT_MAKE_TAG( 'G', 'P', 'O', 'S' ) -#define TTAG_GSUB FT_MAKE_TAG( 'G', 'S', 'U', 'B' ) -#define TTAG_gvar FT_MAKE_TAG( 'g', 'v', 'a', 'r' ) -#define TTAG_hdmx FT_MAKE_TAG( 'h', 'd', 'm', 'x' ) -#define TTAG_head FT_MAKE_TAG( 'h', 'e', 'a', 'd' ) -#define TTAG_hhea FT_MAKE_TAG( 'h', 'h', 'e', 'a' ) -#define TTAG_hmtx FT_MAKE_TAG( 'h', 'm', 't', 'x' ) -#define TTAG_JSTF FT_MAKE_TAG( 'J', 'S', 'T', 'F' ) -#define TTAG_just FT_MAKE_TAG( 'j', 'u', 's', 't' ) -#define TTAG_kern FT_MAKE_TAG( 'k', 'e', 'r', 'n' ) -#define TTAG_lcar FT_MAKE_TAG( 'l', 'c', 'a', 'r' ) -#define TTAG_loca FT_MAKE_TAG( 'l', 'o', 'c', 'a' ) -#define TTAG_LTSH FT_MAKE_TAG( 'L', 'T', 'S', 'H' ) -#define TTAG_LWFN FT_MAKE_TAG( 'L', 'W', 'F', 'N' ) -#define TTAG_MATH FT_MAKE_TAG( 'M', 'A', 'T', 'H' ) -#define TTAG_maxp FT_MAKE_TAG( 'm', 'a', 'x', 'p' ) -#define TTAG_META FT_MAKE_TAG( 'M', 'E', 'T', 'A' ) -#define TTAG_MMFX FT_MAKE_TAG( 'M', 'M', 'F', 'X' ) -#define TTAG_MMSD FT_MAKE_TAG( 'M', 'M', 'S', 'D' ) -#define TTAG_mort FT_MAKE_TAG( 'm', 'o', 'r', 't' ) -#define TTAG_morx FT_MAKE_TAG( 'm', 'o', 'r', 'x' ) -#define TTAG_name FT_MAKE_TAG( 'n', 'a', 'm', 'e' ) -#define TTAG_opbd FT_MAKE_TAG( 'o', 'p', 'b', 'd' ) -#define TTAG_OS2 FT_MAKE_TAG( 'O', 'S', '/', '2' ) -#define TTAG_OTTO FT_MAKE_TAG( 'O', 'T', 'T', 'O' ) -#define TTAG_PCLT FT_MAKE_TAG( 'P', 'C', 'L', 'T' ) -#define TTAG_POST FT_MAKE_TAG( 'P', 'O', 'S', 'T' ) -#define TTAG_post FT_MAKE_TAG( 'p', 'o', 's', 't' ) -#define TTAG_prep FT_MAKE_TAG( 'p', 'r', 'e', 'p' ) -#define TTAG_prop FT_MAKE_TAG( 'p', 'r', 'o', 'p' ) -#define TTAG_sfnt FT_MAKE_TAG( 's', 'f', 'n', 't' ) -#define TTAG_SING FT_MAKE_TAG( 'S', 'I', 'N', 'G' ) -#define TTAG_trak FT_MAKE_TAG( 't', 'r', 'a', 'k' ) -#define TTAG_true FT_MAKE_TAG( 't', 'r', 'u', 'e' ) -#define TTAG_ttc FT_MAKE_TAG( 't', 't', 'c', ' ' ) -#define TTAG_ttcf FT_MAKE_TAG( 't', 't', 'c', 'f' ) -#define TTAG_TYP1 FT_MAKE_TAG( 'T', 'Y', 'P', '1' ) -#define TTAG_typ1 FT_MAKE_TAG( 't', 'y', 'p', '1' ) -#define TTAG_VDMX FT_MAKE_TAG( 'V', 'D', 'M', 'X' ) -#define TTAG_vhea FT_MAKE_TAG( 'v', 'h', 'e', 'a' ) -#define TTAG_vmtx FT_MAKE_TAG( 'v', 'm', 't', 'x' ) - - -FT_END_HEADER - -#endif /* __TTAGS_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/ft2build.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/ft2build.h deleted file mode 100644 index 6a3b8d90e9..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/ft2build.h +++ /dev/null @@ -1,61 +0,0 @@ -/***************************************************************************/ -/* */ -/* ft2build.h */ -/* */ -/* Build macros of the FreeType 2 library. */ -/* */ -/* Copyright 1996-2001, 2003, 2006 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - - /*************************************************************************/ - /* */ - /* This is a Unix-specific version of <ft2build.h> that should be used */ - /* exclusively *after* installation of the library. */ - /* */ - /* It assumes that `/usr/local/include/freetype2' (or whatever is */ - /* returned by the `freetype-config --cflags' or `pkg-config --cflags' */ - /* command) is in your compilation include path. */ - /* */ - /* We don't need to do anything special in this release. However, for */ - /* a future FreeType 2 release, the following installation changes will */ - /* be performed: */ - /* */ - /* - The contents of `freetype-2.x/include/freetype' will be installed */ - /* to `/usr/local/include/freetype2' instead of */ - /* `/usr/local/include/freetype2/freetype'. */ - /* */ - /* - This file will #include <freetype2/config/ftheader.h>, instead */ - /* of <freetype/config/ftheader.h>. */ - /* */ - /* - The contents of `ftheader.h' will be processed with `sed' to */ - /* replace all `<freetype/xxx>' with `<freetype2/xxx>'. */ - /* */ - /* - Adding `/usr/local/include/freetype2' to your compilation include */ - /* path will not be necessary anymore. */ - /* */ - /* These changes will be transparent to client applications which use */ - /* freetype-config (or pkg-config). No modifications will be necessary */ - /* to compile with the new scheme. */ - /* */ - /*************************************************************************/ - - -#ifndef __FT2_BUILD_UNIX_H__ -#define __FT2_BUILD_UNIX_H__ - - /* `<prefix>/include/freetype2' must be in your current inclusion path */ -#include <freetype/config/ftheader.h> - -#endif /* __FT2_BUILD_UNIX_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/jconfig.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/jconfig.h deleted file mode 100644 index 00901888e0..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/jconfig.h +++ /dev/null @@ -1,58 +0,0 @@ -/* jconfig.h. Generated from jconfig.h.in by configure. */ -/* Version ID for the JPEG library. - * Might be useful for tests like "#if JPEG_LIB_VERSION >= 60". - */ -#define JPEG_LIB_VERSION 80 - -/* libjpeg-turbo version */ -#define LIBJPEG_TURBO_VERSION 1.2.0 - -/* Support arithmetic encoding */ -#define C_ARITH_CODING_SUPPORTED 1 - -/* Support arithmetic decoding */ -#define D_ARITH_CODING_SUPPORTED 1 - -/* Compiler supports function prototypes. */ -#define HAVE_PROTOTYPES 1 - -/* Define to 1 if you have the <stddef.h> header file. */ -#define HAVE_STDDEF_H 1 - -/* Define to 1 if you have the <stdlib.h> header file. */ -#define HAVE_STDLIB_H 1 - -/* Compiler supports 'unsigned char'. */ -#define HAVE_UNSIGNED_CHAR 1 - -/* Compiler supports 'unsigned short'. */ -#define HAVE_UNSIGNED_SHORT 1 - -/* Compiler does not support pointers to unspecified structures. */ -/* #undef INCOMPLETE_TYPES_BROKEN */ - -/* Compiler has <strings.h> rather than standard <string.h>. */ -/* #undef NEED_BSD_STRINGS */ - -/* Linker requires that global names be unique in first 15 characters. */ -/* #undef NEED_SHORT_EXTERNAL_NAMES */ - -/* Need to include <sys/types.h> in order to obtain size_t. */ -#define NEED_SYS_TYPES_H 1 - -/* Broken compiler shifts signed values as an unsigned shift. */ -/* #undef RIGHT_SHIFT_IS_UNSIGNED */ - -/* Use accelerated SIMD routines. */ -#define WITH_SIMD 1 - -/* Define to 1 if type `char' is unsigned and you are not using gcc. */ -#ifndef __CHAR_UNSIGNED__ -/* # undef __CHAR_UNSIGNED__ */ -#endif - -/* Define to empty if `const' does not conform to ANSI C. */ -/* #undef const */ - -/* Define to `unsigned int' if <sys/types.h> does not define. */ -/* #undef size_t */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/jerror.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/jerror.h deleted file mode 100644 index 275086e675..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/jerror.h +++ /dev/null @@ -1,314 +0,0 @@ -/* - * jerror.h - * - * Copyright (C) 1994-1997, Thomas G. Lane. - * Modified 1997-2009 by Guido Vollbeding. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file defines the error and message codes for the JPEG library. - * Edit this file to add new codes, or to translate the message strings to - * some other language. - * A set of error-reporting macros are defined too. Some applications using - * the JPEG library may wish to include this file to get the error codes - * and/or the macros. - */ - -/* - * To define the enum list of message codes, include this file without - * defining macro JMESSAGE. To create a message string table, include it - * again with a suitable JMESSAGE definition (see jerror.c for an example). - */ -#ifndef JMESSAGE -#ifndef JERROR_H -/* First time through, define the enum list */ -#define JMAKE_ENUM_LIST -#else -/* Repeated inclusions of this file are no-ops unless JMESSAGE is defined */ -#define JMESSAGE(code,string) -#endif /* JERROR_H */ -#endif /* JMESSAGE */ - -#ifdef JMAKE_ENUM_LIST - -typedef enum { - -#define JMESSAGE(code,string) code , - -#endif /* JMAKE_ENUM_LIST */ - -JMESSAGE(JMSG_NOMESSAGE, "Bogus message code %d") /* Must be first entry! */ - -/* For maintenance convenience, list is alphabetical by message code name */ -#if JPEG_LIB_VERSION < 70 -JMESSAGE(JERR_ARITH_NOTIMPL, - "Sorry, arithmetic coding is not implemented") -#endif -JMESSAGE(JERR_BAD_ALIGN_TYPE, "ALIGN_TYPE is wrong, please fix") -JMESSAGE(JERR_BAD_ALLOC_CHUNK, "MAX_ALLOC_CHUNK is wrong, please fix") -JMESSAGE(JERR_BAD_BUFFER_MODE, "Bogus buffer control mode") -JMESSAGE(JERR_BAD_COMPONENT_ID, "Invalid component ID %d in SOS") -#if JPEG_LIB_VERSION >= 70 -JMESSAGE(JERR_BAD_CROP_SPEC, "Invalid crop request") -#endif -JMESSAGE(JERR_BAD_DCT_COEF, "DCT coefficient out of range") -JMESSAGE(JERR_BAD_DCTSIZE, "IDCT output block size %d not supported") -#if JPEG_LIB_VERSION >= 70 -JMESSAGE(JERR_BAD_DROP_SAMPLING, - "Component index %d: mismatching sampling ratio %d:%d, %d:%d, %c") -#endif -JMESSAGE(JERR_BAD_HUFF_TABLE, "Bogus Huffman table definition") -JMESSAGE(JERR_BAD_IN_COLORSPACE, "Bogus input colorspace") -JMESSAGE(JERR_BAD_J_COLORSPACE, "Bogus JPEG colorspace") -JMESSAGE(JERR_BAD_LENGTH, "Bogus marker length") -JMESSAGE(JERR_BAD_LIB_VERSION, - "Wrong JPEG library version: library is %d, caller expects %d") -JMESSAGE(JERR_BAD_MCU_SIZE, "Sampling factors too large for interleaved scan") -JMESSAGE(JERR_BAD_POOL_ID, "Invalid memory pool code %d") -JMESSAGE(JERR_BAD_PRECISION, "Unsupported JPEG data precision %d") -JMESSAGE(JERR_BAD_PROGRESSION, - "Invalid progressive parameters Ss=%d Se=%d Ah=%d Al=%d") -JMESSAGE(JERR_BAD_PROG_SCRIPT, - "Invalid progressive parameters at scan script entry %d") -JMESSAGE(JERR_BAD_SAMPLING, "Bogus sampling factors") -JMESSAGE(JERR_BAD_SCAN_SCRIPT, "Invalid scan script at entry %d") -JMESSAGE(JERR_BAD_STATE, "Improper call to JPEG library in state %d") -JMESSAGE(JERR_BAD_STRUCT_SIZE, - "JPEG parameter struct mismatch: library thinks size is %u, caller expects %u") -JMESSAGE(JERR_BAD_VIRTUAL_ACCESS, "Bogus virtual array access") -JMESSAGE(JERR_BUFFER_SIZE, "Buffer passed to JPEG library is too small") -JMESSAGE(JERR_CANT_SUSPEND, "Suspension not allowed here") -JMESSAGE(JERR_CCIR601_NOTIMPL, "CCIR601 sampling not implemented yet") -JMESSAGE(JERR_COMPONENT_COUNT, "Too many color components: %d, max %d") -JMESSAGE(JERR_CONVERSION_NOTIMPL, "Unsupported color conversion request") -JMESSAGE(JERR_DAC_INDEX, "Bogus DAC index %d") -JMESSAGE(JERR_DAC_VALUE, "Bogus DAC value 0x%x") -JMESSAGE(JERR_DHT_INDEX, "Bogus DHT index %d") -JMESSAGE(JERR_DQT_INDEX, "Bogus DQT index %d") -JMESSAGE(JERR_EMPTY_IMAGE, "Empty JPEG image (DNL not supported)") -JMESSAGE(JERR_EMS_READ, "Read from EMS failed") -JMESSAGE(JERR_EMS_WRITE, "Write to EMS failed") -JMESSAGE(JERR_EOI_EXPECTED, "Didn't expect more than one scan") -JMESSAGE(JERR_FILE_READ, "Input file read error") -JMESSAGE(JERR_FILE_WRITE, "Output file write error --- out of disk space?") -JMESSAGE(JERR_FRACT_SAMPLE_NOTIMPL, "Fractional sampling not implemented yet") -JMESSAGE(JERR_HUFF_CLEN_OVERFLOW, "Huffman code size table overflow") -JMESSAGE(JERR_HUFF_MISSING_CODE, "Missing Huffman code table entry") -JMESSAGE(JERR_IMAGE_TOO_BIG, "Maximum supported image dimension is %u pixels") -JMESSAGE(JERR_INPUT_EMPTY, "Empty input file") -JMESSAGE(JERR_INPUT_EOF, "Premature end of input file") -JMESSAGE(JERR_MISMATCHED_QUANT_TABLE, - "Cannot transcode due to multiple use of quantization table %d") -JMESSAGE(JERR_MISSING_DATA, "Scan script does not transmit all data") -JMESSAGE(JERR_MODE_CHANGE, "Invalid color quantization mode change") -JMESSAGE(JERR_NOTIMPL, "Not implemented yet") -JMESSAGE(JERR_NOT_COMPILED, "Requested feature was omitted at compile time") -#if JPEG_LIB_VERSION >= 70 -JMESSAGE(JERR_NO_ARITH_TABLE, "Arithmetic table 0x%02x was not defined") -#endif -JMESSAGE(JERR_NO_BACKING_STORE, "Backing store not supported") -JMESSAGE(JERR_NO_HUFF_TABLE, "Huffman table 0x%02x was not defined") -JMESSAGE(JERR_NO_IMAGE, "JPEG datastream contains no image") -JMESSAGE(JERR_NO_QUANT_TABLE, "Quantization table 0x%02x was not defined") -JMESSAGE(JERR_NO_SOI, "Not a JPEG file: starts with 0x%02x 0x%02x") -JMESSAGE(JERR_OUT_OF_MEMORY, "Insufficient memory (case %d)") -JMESSAGE(JERR_QUANT_COMPONENTS, - "Cannot quantize more than %d color components") -JMESSAGE(JERR_QUANT_FEW_COLORS, "Cannot quantize to fewer than %d colors") -JMESSAGE(JERR_QUANT_MANY_COLORS, "Cannot quantize to more than %d colors") -JMESSAGE(JERR_SOF_DUPLICATE, "Invalid JPEG file structure: two SOF markers") -JMESSAGE(JERR_SOF_NO_SOS, "Invalid JPEG file structure: missing SOS marker") -JMESSAGE(JERR_SOF_UNSUPPORTED, "Unsupported JPEG process: SOF type 0x%02x") -JMESSAGE(JERR_SOI_DUPLICATE, "Invalid JPEG file structure: two SOI markers") -JMESSAGE(JERR_SOS_NO_SOF, "Invalid JPEG file structure: SOS before SOF") -JMESSAGE(JERR_TFILE_CREATE, "Failed to create temporary file %s") -JMESSAGE(JERR_TFILE_READ, "Read failed on temporary file") -JMESSAGE(JERR_TFILE_SEEK, "Seek failed on temporary file") -JMESSAGE(JERR_TFILE_WRITE, - "Write failed on temporary file --- out of disk space?") -JMESSAGE(JERR_TOO_LITTLE_DATA, "Application transferred too few scanlines") -JMESSAGE(JERR_UNKNOWN_MARKER, "Unsupported marker type 0x%02x") -JMESSAGE(JERR_VIRTUAL_BUG, "Virtual array controller messed up") -JMESSAGE(JERR_WIDTH_OVERFLOW, "Image too wide for this implementation") -JMESSAGE(JERR_XMS_READ, "Read from XMS failed") -JMESSAGE(JERR_XMS_WRITE, "Write to XMS failed") -JMESSAGE(JMSG_COPYRIGHT, JCOPYRIGHT) -JMESSAGE(JMSG_VERSION, JVERSION) -JMESSAGE(JTRC_16BIT_TABLES, - "Caution: quantization tables are too coarse for baseline JPEG") -JMESSAGE(JTRC_ADOBE, - "Adobe APP14 marker: version %d, flags 0x%04x 0x%04x, transform %d") -JMESSAGE(JTRC_APP0, "Unknown APP0 marker (not JFIF), length %u") -JMESSAGE(JTRC_APP14, "Unknown APP14 marker (not Adobe), length %u") -JMESSAGE(JTRC_DAC, "Define Arithmetic Table 0x%02x: 0x%02x") -JMESSAGE(JTRC_DHT, "Define Huffman Table 0x%02x") -JMESSAGE(JTRC_DQT, "Define Quantization Table %d precision %d") -JMESSAGE(JTRC_DRI, "Define Restart Interval %u") -JMESSAGE(JTRC_EMS_CLOSE, "Freed EMS handle %u") -JMESSAGE(JTRC_EMS_OPEN, "Obtained EMS handle %u") -JMESSAGE(JTRC_EOI, "End Of Image") -JMESSAGE(JTRC_HUFFBITS, " %3d %3d %3d %3d %3d %3d %3d %3d") -JMESSAGE(JTRC_JFIF, "JFIF APP0 marker: version %d.%02d, density %dx%d %d") -JMESSAGE(JTRC_JFIF_BADTHUMBNAILSIZE, - "Warning: thumbnail image size does not match data length %u") -JMESSAGE(JTRC_JFIF_EXTENSION, - "JFIF extension marker: type 0x%02x, length %u") -JMESSAGE(JTRC_JFIF_THUMBNAIL, " with %d x %d thumbnail image") -JMESSAGE(JTRC_MISC_MARKER, "Miscellaneous marker 0x%02x, length %u") -JMESSAGE(JTRC_PARMLESS_MARKER, "Unexpected marker 0x%02x") -JMESSAGE(JTRC_QUANTVALS, " %4u %4u %4u %4u %4u %4u %4u %4u") -JMESSAGE(JTRC_QUANT_3_NCOLORS, "Quantizing to %d = %d*%d*%d colors") -JMESSAGE(JTRC_QUANT_NCOLORS, "Quantizing to %d colors") -JMESSAGE(JTRC_QUANT_SELECTED, "Selected %d colors for quantization") -JMESSAGE(JTRC_RECOVERY_ACTION, "At marker 0x%02x, recovery action %d") -JMESSAGE(JTRC_RST, "RST%d") -JMESSAGE(JTRC_SMOOTH_NOTIMPL, - "Smoothing not supported with nonstandard sampling ratios") -JMESSAGE(JTRC_SOF, "Start Of Frame 0x%02x: width=%u, height=%u, components=%d") -JMESSAGE(JTRC_SOF_COMPONENT, " Component %d: %dhx%dv q=%d") -JMESSAGE(JTRC_SOI, "Start of Image") -JMESSAGE(JTRC_SOS, "Start Of Scan: %d components") -JMESSAGE(JTRC_SOS_COMPONENT, " Component %d: dc=%d ac=%d") -JMESSAGE(JTRC_SOS_PARAMS, " Ss=%d, Se=%d, Ah=%d, Al=%d") -JMESSAGE(JTRC_TFILE_CLOSE, "Closed temporary file %s") -JMESSAGE(JTRC_TFILE_OPEN, "Opened temporary file %s") -JMESSAGE(JTRC_THUMB_JPEG, - "JFIF extension marker: JPEG-compressed thumbnail image, length %u") -JMESSAGE(JTRC_THUMB_PALETTE, - "JFIF extension marker: palette thumbnail image, length %u") -JMESSAGE(JTRC_THUMB_RGB, - "JFIF extension marker: RGB thumbnail image, length %u") -JMESSAGE(JTRC_UNKNOWN_IDS, - "Unrecognized component IDs %d %d %d, assuming YCbCr") -JMESSAGE(JTRC_XMS_CLOSE, "Freed XMS handle %u") -JMESSAGE(JTRC_XMS_OPEN, "Obtained XMS handle %u") -JMESSAGE(JWRN_ADOBE_XFORM, "Unknown Adobe color transform code %d") -#if JPEG_LIB_VERSION >= 70 -JMESSAGE(JWRN_ARITH_BAD_CODE, "Corrupt JPEG data: bad arithmetic code") -#endif -JMESSAGE(JWRN_BOGUS_PROGRESSION, - "Inconsistent progression sequence for component %d coefficient %d") -JMESSAGE(JWRN_EXTRANEOUS_DATA, - "Corrupt JPEG data: %u extraneous bytes before marker 0x%02x") -JMESSAGE(JWRN_HIT_MARKER, "Corrupt JPEG data: premature end of data segment") -JMESSAGE(JWRN_HUFF_BAD_CODE, "Corrupt JPEG data: bad Huffman code") -JMESSAGE(JWRN_JFIF_MAJOR, "Warning: unknown JFIF revision number %d.%02d") -JMESSAGE(JWRN_JPEG_EOF, "Premature end of JPEG file") -JMESSAGE(JWRN_MUST_RESYNC, - "Corrupt JPEG data: found marker 0x%02x instead of RST%d") -JMESSAGE(JWRN_NOT_SEQUENTIAL, "Invalid SOS parameters for sequential JPEG") -JMESSAGE(JWRN_TOO_MUCH_DATA, "Application transferred too many scanlines") -#if JPEG_LIB_VERSION < 70 -JMESSAGE(JERR_BAD_CROP_SPEC, "Invalid crop request") -#if defined(C_ARITH_CODING_SUPPORTED) || defined(D_ARITH_CODING_SUPPORTED) -JMESSAGE(JERR_NO_ARITH_TABLE, "Arithmetic table 0x%02x was not defined") -JMESSAGE(JWRN_ARITH_BAD_CODE, "Corrupt JPEG data: bad arithmetic code") -#endif -#endif - -#ifdef JMAKE_ENUM_LIST - - JMSG_LASTMSGCODE -} J_MESSAGE_CODE; - -#undef JMAKE_ENUM_LIST -#endif /* JMAKE_ENUM_LIST */ - -/* Zap JMESSAGE macro so that future re-inclusions do nothing by default */ -#undef JMESSAGE - - -#ifndef JERROR_H -#define JERROR_H - -/* Macros to simplify using the error and trace message stuff */ -/* The first parameter is either type of cinfo pointer */ - -/* Fatal errors (print message and exit) */ -#define ERREXIT(cinfo,code) \ - ((cinfo)->err->msg_code = (code), \ - (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) -#define ERREXIT1(cinfo,code,p1) \ - ((cinfo)->err->msg_code = (code), \ - (cinfo)->err->msg_parm.i[0] = (p1), \ - (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) -#define ERREXIT2(cinfo,code,p1,p2) \ - ((cinfo)->err->msg_code = (code), \ - (cinfo)->err->msg_parm.i[0] = (p1), \ - (cinfo)->err->msg_parm.i[1] = (p2), \ - (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) -#define ERREXIT3(cinfo,code,p1,p2,p3) \ - ((cinfo)->err->msg_code = (code), \ - (cinfo)->err->msg_parm.i[0] = (p1), \ - (cinfo)->err->msg_parm.i[1] = (p2), \ - (cinfo)->err->msg_parm.i[2] = (p3), \ - (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) -#define ERREXIT4(cinfo,code,p1,p2,p3,p4) \ - ((cinfo)->err->msg_code = (code), \ - (cinfo)->err->msg_parm.i[0] = (p1), \ - (cinfo)->err->msg_parm.i[1] = (p2), \ - (cinfo)->err->msg_parm.i[2] = (p3), \ - (cinfo)->err->msg_parm.i[3] = (p4), \ - (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) -#define ERREXITS(cinfo,code,str) \ - ((cinfo)->err->msg_code = (code), \ - strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \ - (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) - -#define MAKESTMT(stuff) do { stuff } while (0) - -/* Nonfatal errors (we can keep going, but the data is probably corrupt) */ -#define WARNMS(cinfo,code) \ - ((cinfo)->err->msg_code = (code), \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1)) -#define WARNMS1(cinfo,code,p1) \ - ((cinfo)->err->msg_code = (code), \ - (cinfo)->err->msg_parm.i[0] = (p1), \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1)) -#define WARNMS2(cinfo,code,p1,p2) \ - ((cinfo)->err->msg_code = (code), \ - (cinfo)->err->msg_parm.i[0] = (p1), \ - (cinfo)->err->msg_parm.i[1] = (p2), \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1)) - -/* Informational/debugging messages */ -#define TRACEMS(cinfo,lvl,code) \ - ((cinfo)->err->msg_code = (code), \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) -#define TRACEMS1(cinfo,lvl,code,p1) \ - ((cinfo)->err->msg_code = (code), \ - (cinfo)->err->msg_parm.i[0] = (p1), \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) -#define TRACEMS2(cinfo,lvl,code,p1,p2) \ - ((cinfo)->err->msg_code = (code), \ - (cinfo)->err->msg_parm.i[0] = (p1), \ - (cinfo)->err->msg_parm.i[1] = (p2), \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) -#define TRACEMS3(cinfo,lvl,code,p1,p2,p3) \ - MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ - _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); \ - (cinfo)->err->msg_code = (code); \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) -#define TRACEMS4(cinfo,lvl,code,p1,p2,p3,p4) \ - MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ - _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \ - (cinfo)->err->msg_code = (code); \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) -#define TRACEMS5(cinfo,lvl,code,p1,p2,p3,p4,p5) \ - MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ - _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \ - _mp[4] = (p5); \ - (cinfo)->err->msg_code = (code); \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) -#define TRACEMS8(cinfo,lvl,code,p1,p2,p3,p4,p5,p6,p7,p8) \ - MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ - _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \ - _mp[4] = (p5); _mp[5] = (p6); _mp[6] = (p7); _mp[7] = (p8); \ - (cinfo)->err->msg_code = (code); \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) -#define TRACEMSS(cinfo,lvl,code,str) \ - ((cinfo)->err->msg_code = (code), \ - strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) - -#endif /* JERROR_H */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/jmorecfg.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/jmorecfg.h deleted file mode 100644 index f22c4f3964..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/jmorecfg.h +++ /dev/null @@ -1,404 +0,0 @@ -/* - * jmorecfg.h - * - * Copyright (C) 1991-1997, Thomas G. Lane. - * Copyright (C) 2009, 2011, D. R. Commander. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains additional configuration options that customize the - * JPEG software for special applications or support machine-dependent - * optimizations. Most users will not need to touch this file. - */ - - -/* - * Define BITS_IN_JSAMPLE as either - * 8 for 8-bit sample values (the usual setting) - * 12 for 12-bit sample values - * Only 8 and 12 are legal data precisions for lossy JPEG according to the - * JPEG standard, and the IJG code does not support anything else! - * We do not support run-time selection of data precision, sorry. - */ - -#define BITS_IN_JSAMPLE 8 /* use 8 or 12 */ - - -/* - * Maximum number of components (color channels) allowed in JPEG image. - * To meet the letter of the JPEG spec, set this to 255. However, darn - * few applications need more than 4 channels (maybe 5 for CMYK + alpha - * mask). We recommend 10 as a reasonable compromise; use 4 if you are - * really short on memory. (Each allowed component costs a hundred or so - * bytes of storage, whether actually used in an image or not.) - */ - -#define MAX_COMPONENTS 10 /* maximum number of image components */ - - -/* - * Basic data types. - * You may need to change these if you have a machine with unusual data - * type sizes; for example, "char" not 8 bits, "short" not 16 bits, - * or "long" not 32 bits. We don't care whether "int" is 16 or 32 bits, - * but it had better be at least 16. - */ - -/* Representation of a single sample (pixel element value). - * We frequently allocate large arrays of these, so it's important to keep - * them small. But if you have memory to burn and access to char or short - * arrays is very slow on your hardware, you might want to change these. - */ - -#if BITS_IN_JSAMPLE == 8 -/* JSAMPLE should be the smallest type that will hold the values 0..255. - * You can use a signed char by having GETJSAMPLE mask it with 0xFF. - */ - -#ifdef HAVE_UNSIGNED_CHAR - -typedef unsigned char JSAMPLE; -#define GETJSAMPLE(value) ((int) (value)) - -#else /* not HAVE_UNSIGNED_CHAR */ - -typedef char JSAMPLE; -#ifdef __CHAR_UNSIGNED__ -#define GETJSAMPLE(value) ((int) (value)) -#else -#define GETJSAMPLE(value) ((int) (value) & 0xFF) -#endif /* __CHAR_UNSIGNED__ */ - -#endif /* HAVE_UNSIGNED_CHAR */ - -#define MAXJSAMPLE 255 -#define CENTERJSAMPLE 128 - -#endif /* BITS_IN_JSAMPLE == 8 */ - - -#if BITS_IN_JSAMPLE == 12 -/* JSAMPLE should be the smallest type that will hold the values 0..4095. - * On nearly all machines "short" will do nicely. - */ - -typedef short JSAMPLE; -#define GETJSAMPLE(value) ((int) (value)) - -#define MAXJSAMPLE 4095 -#define CENTERJSAMPLE 2048 - -#endif /* BITS_IN_JSAMPLE == 12 */ - - -/* Representation of a DCT frequency coefficient. - * This should be a signed value of at least 16 bits; "short" is usually OK. - * Again, we allocate large arrays of these, but you can change to int - * if you have memory to burn and "short" is really slow. - */ - -typedef short JCOEF; - - -/* Compressed datastreams are represented as arrays of JOCTET. - * These must be EXACTLY 8 bits wide, at least once they are written to - * external storage. Note that when using the stdio data source/destination - * managers, this is also the data type passed to fread/fwrite. - */ - -#ifdef HAVE_UNSIGNED_CHAR - -typedef unsigned char JOCTET; -#define GETJOCTET(value) (value) - -#else /* not HAVE_UNSIGNED_CHAR */ - -typedef char JOCTET; -#ifdef __CHAR_UNSIGNED__ -#define GETJOCTET(value) (value) -#else -#define GETJOCTET(value) ((value) & 0xFF) -#endif /* __CHAR_UNSIGNED__ */ - -#endif /* HAVE_UNSIGNED_CHAR */ - - -/* These typedefs are used for various table entries and so forth. - * They must be at least as wide as specified; but making them too big - * won't cost a huge amount of memory, so we don't provide special - * extraction code like we did for JSAMPLE. (In other words, these - * typedefs live at a different point on the speed/space tradeoff curve.) - */ - -/* UINT8 must hold at least the values 0..255. */ - -#ifdef HAVE_UNSIGNED_CHAR -typedef unsigned char UINT8; -#else /* not HAVE_UNSIGNED_CHAR */ -#ifdef __CHAR_UNSIGNED__ -typedef char UINT8; -#else /* not __CHAR_UNSIGNED__ */ -typedef short UINT8; -#endif /* __CHAR_UNSIGNED__ */ -#endif /* HAVE_UNSIGNED_CHAR */ - -/* UINT16 must hold at least the values 0..65535. */ - -#ifdef HAVE_UNSIGNED_SHORT -typedef unsigned short UINT16; -#else /* not HAVE_UNSIGNED_SHORT */ -typedef unsigned int UINT16; -#endif /* HAVE_UNSIGNED_SHORT */ - -/* INT16 must hold at least the values -32768..32767. */ - -#ifndef XMD_H /* X11/xmd.h correctly defines INT16 */ -typedef short INT16; -#endif - -/* INT32 must hold at least signed 32-bit values. */ - -#ifndef XMD_H /* X11/xmd.h correctly defines INT32 */ -typedef long INT32; -#endif - -/* Datatype used for image dimensions. The JPEG standard only supports - * images up to 64K*64K due to 16-bit fields in SOF markers. Therefore - * "unsigned int" is sufficient on all machines. However, if you need to - * handle larger images and you don't mind deviating from the spec, you - * can change this datatype. - */ - -typedef unsigned int JDIMENSION; - -#define JPEG_MAX_DIMENSION 65500L /* a tad under 64K to prevent overflows */ - - -/* These macros are used in all function definitions and extern declarations. - * You could modify them if you need to change function linkage conventions; - * in particular, you'll need to do that to make the library a Windows DLL. - * Another application is to make all functions global for use with debuggers - * or code profilers that require it. - */ - -/* a function called through method pointers: */ -#define METHODDEF(type) static type -/* a function used only in its module: */ -#define LOCAL(type) static type -/* a function referenced thru EXTERNs: */ -#define GLOBAL(type) type -/* a reference to a GLOBAL function: */ -#define EXTERN(type) extern type - - -/* This macro is used to declare a "method", that is, a function pointer. - * We want to supply prototype parameters if the compiler can cope. - * Note that the arglist parameter must be parenthesized! - * Again, you can customize this if you need special linkage keywords. - */ - -#ifdef HAVE_PROTOTYPES -#define JMETHOD(type,methodname,arglist) type (*methodname) arglist -#else -#define JMETHOD(type,methodname,arglist) type (*methodname) () -#endif - - -/* Here is the pseudo-keyword for declaring pointers that must be "far" - * on 80x86 machines. Most of the specialized coding for 80x86 is handled - * by just saying "FAR *" where such a pointer is needed. In a few places - * explicit coding is needed; see uses of the NEED_FAR_POINTERS symbol. - */ - -#ifdef NEED_FAR_POINTERS -#define FAR far -#else -#define FAR -#endif - - -/* - * On a few systems, type boolean and/or its values FALSE, TRUE may appear - * in standard header files. Or you may have conflicts with application- - * specific header files that you want to include together with these files. - * Defining HAVE_BOOLEAN before including jpeglib.h should make it work. - */ - -#ifndef HAVE_BOOLEAN -typedef int boolean; -#endif -#ifndef FALSE /* in case these macros already exist */ -#define FALSE 0 /* values of boolean */ -#endif -#ifndef TRUE -#define TRUE 1 -#endif - - -/* - * The remaining options affect code selection within the JPEG library, - * but they don't need to be visible to most applications using the library. - * To minimize application namespace pollution, the symbols won't be - * defined unless JPEG_INTERNALS or JPEG_INTERNAL_OPTIONS has been defined. - */ - -#ifdef JPEG_INTERNALS -#define JPEG_INTERNAL_OPTIONS -#endif - -#ifdef JPEG_INTERNAL_OPTIONS - - -/* - * These defines indicate whether to include various optional functions. - * Undefining some of these symbols will produce a smaller but less capable - * library. Note that you can leave certain source files out of the - * compilation/linking process if you've #undef'd the corresponding symbols. - * (You may HAVE to do that if your compiler doesn't like null source files.) - */ - -/* Capability options common to encoder and decoder: */ - -#define DCT_ISLOW_SUPPORTED /* slow but accurate integer algorithm */ -#define DCT_IFAST_SUPPORTED /* faster, less accurate integer method */ -#define DCT_FLOAT_SUPPORTED /* floating-point: accurate, fast on fast HW */ - -/* Encoder capability options: */ - -#define C_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */ -#define C_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/ -#define ENTROPY_OPT_SUPPORTED /* Optimization of entropy coding parms? */ -/* Note: if you selected 12-bit data precision, it is dangerous to turn off - * ENTROPY_OPT_SUPPORTED. The standard Huffman tables are only good for 8-bit - * precision, so jchuff.c normally uses entropy optimization to compute - * usable tables for higher precision. If you don't want to do optimization, - * you'll have to supply different default Huffman tables. - * The exact same statements apply for progressive JPEG: the default tables - * don't work for progressive mode. (This may get fixed, however.) - */ -#define INPUT_SMOOTHING_SUPPORTED /* Input image smoothing option? */ - -/* Decoder capability options: */ - -#define D_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */ -#define D_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/ -#define SAVE_MARKERS_SUPPORTED /* jpeg_save_markers() needed? */ -#define BLOCK_SMOOTHING_SUPPORTED /* Block smoothing? (Progressive only) */ -#define IDCT_SCALING_SUPPORTED /* Output rescaling via IDCT? */ -#undef UPSAMPLE_SCALING_SUPPORTED /* Output rescaling at upsample stage? */ -#define UPSAMPLE_MERGING_SUPPORTED /* Fast path for sloppy upsampling? */ -#define QUANT_1PASS_SUPPORTED /* 1-pass color quantization? */ -#define QUANT_2PASS_SUPPORTED /* 2-pass color quantization? */ - -/* more capability options later, no doubt */ - - -/* - * Ordering of RGB data in scanlines passed to or from the application. - * If your application wants to deal with data in the order B,G,R, just - * change these macros. You can also deal with formats such as R,G,B,X - * (one extra byte per pixel) by changing RGB_PIXELSIZE. Note that changing - * the offsets will also change the order in which colormap data is organized. - * RESTRICTIONS: - * 1. The sample applications cjpeg,djpeg do NOT support modified RGB formats. - * 2. These macros only affect RGB<=>YCbCr color conversion, so they are not - * useful if you are using JPEG color spaces other than YCbCr or grayscale. - * 3. The color quantizer modules will not behave desirably if RGB_PIXELSIZE - * is not 3 (they don't understand about dummy color components!). So you - * can't use color quantization if you change that value. - */ - -#define RGB_RED 0 /* Offset of Red in an RGB scanline element */ -#define RGB_GREEN 1 /* Offset of Green */ -#define RGB_BLUE 2 /* Offset of Blue */ -#define RGB_PIXELSIZE 3 /* JSAMPLEs per RGB scanline element */ - -#define JPEG_NUMCS 16 - -#define EXT_RGB_RED 0 -#define EXT_RGB_GREEN 1 -#define EXT_RGB_BLUE 2 -#define EXT_RGB_PIXELSIZE 3 - -#define EXT_RGBX_RED 0 -#define EXT_RGBX_GREEN 1 -#define EXT_RGBX_BLUE 2 -#define EXT_RGBX_PIXELSIZE 4 - -#define EXT_BGR_RED 2 -#define EXT_BGR_GREEN 1 -#define EXT_BGR_BLUE 0 -#define EXT_BGR_PIXELSIZE 3 - -#define EXT_BGRX_RED 2 -#define EXT_BGRX_GREEN 1 -#define EXT_BGRX_BLUE 0 -#define EXT_BGRX_PIXELSIZE 4 - -#define EXT_XBGR_RED 3 -#define EXT_XBGR_GREEN 2 -#define EXT_XBGR_BLUE 1 -#define EXT_XBGR_PIXELSIZE 4 - -#define EXT_XRGB_RED 1 -#define EXT_XRGB_GREEN 2 -#define EXT_XRGB_BLUE 3 -#define EXT_XRGB_PIXELSIZE 4 - -static const int rgb_red[JPEG_NUMCS] = { - -1, -1, RGB_RED, -1, -1, -1, EXT_RGB_RED, EXT_RGBX_RED, - EXT_BGR_RED, EXT_BGRX_RED, EXT_XBGR_RED, EXT_XRGB_RED, - EXT_RGBX_RED, EXT_BGRX_RED, EXT_XBGR_RED, EXT_XRGB_RED -}; - -static const int rgb_green[JPEG_NUMCS] = { - -1, -1, RGB_GREEN, -1, -1, -1, EXT_RGB_GREEN, EXT_RGBX_GREEN, - EXT_BGR_GREEN, EXT_BGRX_GREEN, EXT_XBGR_GREEN, EXT_XRGB_GREEN, - EXT_RGBX_GREEN, EXT_BGRX_GREEN, EXT_XBGR_GREEN, EXT_XRGB_GREEN -}; - -static const int rgb_blue[JPEG_NUMCS] = { - -1, -1, RGB_BLUE, -1, -1, -1, EXT_RGB_BLUE, EXT_RGBX_BLUE, - EXT_BGR_BLUE, EXT_BGRX_BLUE, EXT_XBGR_BLUE, EXT_XRGB_BLUE, - EXT_RGBX_BLUE, EXT_BGRX_BLUE, EXT_XBGR_BLUE, EXT_XRGB_BLUE -}; - -static const int rgb_pixelsize[JPEG_NUMCS] = { - -1, -1, RGB_PIXELSIZE, -1, -1, -1, EXT_RGB_PIXELSIZE, EXT_RGBX_PIXELSIZE, - EXT_BGR_PIXELSIZE, EXT_BGRX_PIXELSIZE, EXT_XBGR_PIXELSIZE, EXT_XRGB_PIXELSIZE, - EXT_RGBX_PIXELSIZE, EXT_BGRX_PIXELSIZE, EXT_XBGR_PIXELSIZE, EXT_XRGB_PIXELSIZE -}; - -/* Definitions for speed-related optimizations. */ - -/* On some machines (notably 68000 series) "int" is 32 bits, but multiplying - * two 16-bit shorts is faster than multiplying two ints. Define MULTIPLIER - * as short on such a machine. MULTIPLIER must be at least 16 bits wide. - */ - -#ifndef MULTIPLIER -#ifndef WITH_SIMD -#define MULTIPLIER int /* type for fastest integer multiply */ -#else -#define MULTIPLIER short /* prefer 16-bit with SIMD for parellelism */ -#endif -#endif - - -/* FAST_FLOAT should be either float or double, whichever is done faster - * by your compiler. (Note that this type is only used in the floating point - * DCT routines, so it only matters if you've defined DCT_FLOAT_SUPPORTED.) - * Typically, float is faster in ANSI C compilers, while double is faster in - * pre-ANSI compilers (because they insist on converting to double anyway). - * The code below therefore chooses float if we have ANSI-style prototypes. - */ - -#ifndef FAST_FLOAT -#ifdef HAVE_PROTOTYPES -#define FAST_FLOAT float -#else -#define FAST_FLOAT double -#endif -#endif - -#endif /* JPEG_INTERNAL_OPTIONS */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/jpeglib.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/jpeglib.h deleted file mode 100644 index 0f53709bf4..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/jpeglib.h +++ /dev/null @@ -1,1215 +0,0 @@ -/* - * jpeglib.h - * - * Copyright (C) 1991-1998, Thomas G. Lane. - * Modified 2002-2009 by Guido Vollbeding. - * Copyright (C) 2009-2011, D. R. Commander. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file defines the application interface for the JPEG library. - * Most applications using the library need only include this file, - * and perhaps jerror.h if they want to know the exact error codes. - */ - -#ifndef JPEGLIB_H -#define JPEGLIB_H - -/* - * First we include the configuration files that record how this - * installation of the JPEG library is set up. jconfig.h can be - * generated automatically for many systems. jmorecfg.h contains - * manual configuration options that most people need not worry about. - */ - -#ifndef JCONFIG_INCLUDED /* in case jinclude.h already did */ -#include "jconfig.h" /* widely used configuration options */ -#endif -#include "jmorecfg.h" /* seldom changed options */ - - -#ifdef __cplusplus -#ifndef DONT_USE_EXTERN_C -extern "C" { -#endif -#endif - - -/* Various constants determining the sizes of things. - * All of these are specified by the JPEG standard, so don't change them - * if you want to be compatible. - */ - -#define DCTSIZE 8 /* The basic DCT block is 8x8 samples */ -#define DCTSIZE2 64 /* DCTSIZE squared; # of elements in a block */ -#define NUM_QUANT_TBLS 4 /* Quantization tables are numbered 0..3 */ -#define NUM_HUFF_TBLS 4 /* Huffman tables are numbered 0..3 */ -#define NUM_ARITH_TBLS 16 /* Arith-coding tables are numbered 0..15 */ -#define MAX_COMPS_IN_SCAN 4 /* JPEG limit on # of components in one scan */ -#define MAX_SAMP_FACTOR 4 /* JPEG limit on sampling factors */ -/* Unfortunately, some bozo at Adobe saw no reason to be bound by the standard; - * the PostScript DCT filter can emit files with many more than 10 blocks/MCU. - * If you happen to run across such a file, you can up D_MAX_BLOCKS_IN_MCU - * to handle it. We even let you do this from the jconfig.h file. However, - * we strongly discourage changing C_MAX_BLOCKS_IN_MCU; just because Adobe - * sometimes emits noncompliant files doesn't mean you should too. - */ -#define C_MAX_BLOCKS_IN_MCU 10 /* compressor's limit on blocks per MCU */ -#ifndef D_MAX_BLOCKS_IN_MCU -#define D_MAX_BLOCKS_IN_MCU 10 /* decompressor's limit on blocks per MCU */ -#endif - - -/* Data structures for images (arrays of samples and of DCT coefficients). - * On 80x86 machines, the image arrays are too big for near pointers, - * but the pointer arrays can fit in near memory. - */ - -typedef JSAMPLE FAR *JSAMPROW; /* ptr to one image row of pixel samples. */ -typedef JSAMPROW *JSAMPARRAY; /* ptr to some rows (a 2-D sample array) */ -typedef JSAMPARRAY *JSAMPIMAGE; /* a 3-D sample array: top index is color */ - -typedef JCOEF JBLOCK[DCTSIZE2]; /* one block of coefficients */ -typedef JBLOCK FAR *JBLOCKROW; /* pointer to one row of coefficient blocks */ -typedef JBLOCKROW *JBLOCKARRAY; /* a 2-D array of coefficient blocks */ -typedef JBLOCKARRAY *JBLOCKIMAGE; /* a 3-D array of coefficient blocks */ - -typedef JCOEF FAR *JCOEFPTR; /* useful in a couple of places */ - - -/* Types for JPEG compression parameters and working tables. */ - - -/* DCT coefficient quantization tables. */ - -typedef struct { - /* This array gives the coefficient quantizers in natural array order - * (not the zigzag order in which they are stored in a JPEG DQT marker). - * CAUTION: IJG versions prior to v6a kept this array in zigzag order. - */ - UINT16 quantval[DCTSIZE2]; /* quantization step for each coefficient */ - /* This field is used only during compression. It's initialized FALSE when - * the table is created, and set TRUE when it's been output to the file. - * You could suppress output of a table by setting this to TRUE. - * (See jpeg_suppress_tables for an example.) - */ - boolean sent_table; /* TRUE when table has been output */ -} JQUANT_TBL; - - -/* Huffman coding tables. */ - -typedef struct { - /* These two fields directly represent the contents of a JPEG DHT marker */ - UINT8 bits[17]; /* bits[k] = # of symbols with codes of */ - /* length k bits; bits[0] is unused */ - UINT8 huffval[256]; /* The symbols, in order of incr code length */ - /* This field is used only during compression. It's initialized FALSE when - * the table is created, and set TRUE when it's been output to the file. - * You could suppress output of a table by setting this to TRUE. - * (See jpeg_suppress_tables for an example.) - */ - boolean sent_table; /* TRUE when table has been output */ -} JHUFF_TBL; - - -/* Basic info about one component (color channel). */ - -typedef struct { - /* These values are fixed over the whole image. */ - /* For compression, they must be supplied by parameter setup; */ - /* for decompression, they are read from the SOF marker. */ - int component_id; /* identifier for this component (0..255) */ - int component_index; /* its index in SOF or cinfo->comp_info[] */ - int h_samp_factor; /* horizontal sampling factor (1..4) */ - int v_samp_factor; /* vertical sampling factor (1..4) */ - int quant_tbl_no; /* quantization table selector (0..3) */ - /* These values may vary between scans. */ - /* For compression, they must be supplied by parameter setup; */ - /* for decompression, they are read from the SOS marker. */ - /* The decompressor output side may not use these variables. */ - int dc_tbl_no; /* DC entropy table selector (0..3) */ - int ac_tbl_no; /* AC entropy table selector (0..3) */ - - /* Remaining fields should be treated as private by applications. */ - - /* These values are computed during compression or decompression startup: */ - /* Component's size in DCT blocks. - * Any dummy blocks added to complete an MCU are not counted; therefore - * these values do not depend on whether a scan is interleaved or not. - */ - JDIMENSION width_in_blocks; - JDIMENSION height_in_blocks; - /* Size of a DCT block in samples. Always DCTSIZE for compression. - * For decompression this is the size of the output from one DCT block, - * reflecting any scaling we choose to apply during the IDCT step. - * Values of 1,2,4,8 are likely to be supported. Note that different - * components may receive different IDCT scalings. - */ -#if JPEG_LIB_VERSION >= 70 - int DCT_h_scaled_size; - int DCT_v_scaled_size; -#else - int DCT_scaled_size; -#endif - /* The downsampled dimensions are the component's actual, unpadded number - * of samples at the main buffer (preprocessing/compression interface), thus - * downsampled_width = ceil(image_width * Hi/Hmax) - * and similarly for height. For decompression, IDCT scaling is included, so - * downsampled_width = ceil(image_width * Hi/Hmax * DCT_[h_]scaled_size/DCTSIZE) - */ - JDIMENSION downsampled_width; /* actual width in samples */ - JDIMENSION downsampled_height; /* actual height in samples */ - /* This flag is used only for decompression. In cases where some of the - * components will be ignored (eg grayscale output from YCbCr image), - * we can skip most computations for the unused components. - */ - boolean component_needed; /* do we need the value of this component? */ - - /* These values are computed before starting a scan of the component. */ - /* The decompressor output side may not use these variables. */ - int MCU_width; /* number of blocks per MCU, horizontally */ - int MCU_height; /* number of blocks per MCU, vertically */ - int MCU_blocks; /* MCU_width * MCU_height */ - int MCU_sample_width; /* MCU width in samples, MCU_width*DCT_[h_]scaled_size */ - int last_col_width; /* # of non-dummy blocks across in last MCU */ - int last_row_height; /* # of non-dummy blocks down in last MCU */ - - /* Saved quantization table for component; NULL if none yet saved. - * See jdinput.c comments about the need for this information. - * This field is currently used only for decompression. - */ - JQUANT_TBL * quant_table; - - /* Private per-component storage for DCT or IDCT subsystem. */ - void * dct_table; -} jpeg_component_info; - - -/* The script for encoding a multiple-scan file is an array of these: */ - -typedef struct { - int comps_in_scan; /* number of components encoded in this scan */ - int component_index[MAX_COMPS_IN_SCAN]; /* their SOF/comp_info[] indexes */ - int Ss, Se; /* progressive JPEG spectral selection parms */ - int Ah, Al; /* progressive JPEG successive approx. parms */ -} jpeg_scan_info; - -/* The decompressor can save APPn and COM markers in a list of these: */ - -typedef struct jpeg_marker_struct FAR * jpeg_saved_marker_ptr; - -struct jpeg_marker_struct { - jpeg_saved_marker_ptr next; /* next in list, or NULL */ - UINT8 marker; /* marker code: JPEG_COM, or JPEG_APP0+n */ - unsigned int original_length; /* # bytes of data in the file */ - unsigned int data_length; /* # bytes of data saved at data[] */ - JOCTET FAR * data; /* the data contained in the marker */ - /* the marker length word is not counted in data_length or original_length */ -}; - -/* Known color spaces. */ - -#define JCS_EXTENSIONS 1 -#define JCS_ALPHA_EXTENSIONS 1 - -typedef enum { - JCS_UNKNOWN, /* error/unspecified */ - JCS_GRAYSCALE, /* monochrome */ - JCS_RGB, /* red/green/blue as specified by the RGB_RED, RGB_GREEN, - RGB_BLUE, and RGB_PIXELSIZE macros */ - JCS_YCbCr, /* Y/Cb/Cr (also known as YUV) */ - JCS_CMYK, /* C/M/Y/K */ - JCS_YCCK, /* Y/Cb/Cr/K */ - JCS_EXT_RGB, /* red/green/blue */ - JCS_EXT_RGBX, /* red/green/blue/x */ - JCS_EXT_BGR, /* blue/green/red */ - JCS_EXT_BGRX, /* blue/green/red/x */ - JCS_EXT_XBGR, /* x/blue/green/red */ - JCS_EXT_XRGB, /* x/red/green/blue */ - /* When out_color_space it set to JCS_EXT_RGBX, JCS_EXT_BGRX, - JCS_EXT_XBGR, or JCS_EXT_XRGB during decompression, the X byte is - undefined, and in order to ensure the best performance, - libjpeg-turbo can set that byte to whatever value it wishes. Use - the following colorspace constants to ensure that the X byte is set - to 0xFF, so that it can be interpreted as an opaque alpha - channel. */ - JCS_EXT_RGBA, /* red/green/blue/alpha */ - JCS_EXT_BGRA, /* blue/green/red/alpha */ - JCS_EXT_ABGR, /* alpha/blue/green/red */ - JCS_EXT_ARGB /* alpha/red/green/blue */ -} J_COLOR_SPACE; - -/* DCT/IDCT algorithm options. */ - -typedef enum { - JDCT_ISLOW, /* slow but accurate integer algorithm */ - JDCT_IFAST, /* faster, less accurate integer method */ - JDCT_FLOAT /* floating-point: accurate, fast on fast HW */ -} J_DCT_METHOD; - -#ifndef JDCT_DEFAULT /* may be overridden in jconfig.h */ -#define JDCT_DEFAULT JDCT_ISLOW -#endif -#ifndef JDCT_FASTEST /* may be overridden in jconfig.h */ -#define JDCT_FASTEST JDCT_IFAST -#endif - -/* Dithering options for decompression. */ - -typedef enum { - JDITHER_NONE, /* no dithering */ - JDITHER_ORDERED, /* simple ordered dither */ - JDITHER_FS /* Floyd-Steinberg error diffusion dither */ -} J_DITHER_MODE; - - -/* Common fields between JPEG compression and decompression master structs. */ - -#define jpeg_common_fields \ - struct jpeg_error_mgr * err; /* Error handler module */\ - struct jpeg_memory_mgr * mem; /* Memory manager module */\ - struct jpeg_progress_mgr * progress; /* Progress monitor, or NULL if none */\ - void * client_data; /* Available for use by application */\ - boolean is_decompressor; /* So common code can tell which is which */\ - int global_state /* For checking call sequence validity */ - -/* Routines that are to be used by both halves of the library are declared - * to receive a pointer to this structure. There are no actual instances of - * jpeg_common_struct, only of jpeg_compress_struct and jpeg_decompress_struct. - */ -struct jpeg_common_struct { - jpeg_common_fields; /* Fields common to both master struct types */ - /* Additional fields follow in an actual jpeg_compress_struct or - * jpeg_decompress_struct. All three structs must agree on these - * initial fields! (This would be a lot cleaner in C++.) - */ -}; - -typedef struct jpeg_common_struct * j_common_ptr; -typedef struct jpeg_compress_struct * j_compress_ptr; -typedef struct jpeg_decompress_struct * j_decompress_ptr; - - -/* Master record for a compression instance */ - -struct jpeg_compress_struct { - jpeg_common_fields; /* Fields shared with jpeg_decompress_struct */ - - /* Destination for compressed data */ - struct jpeg_destination_mgr * dest; - - /* Description of source image --- these fields must be filled in by - * outer application before starting compression. in_color_space must - * be correct before you can even call jpeg_set_defaults(). - */ - - JDIMENSION image_width; /* input image width */ - JDIMENSION image_height; /* input image height */ - int input_components; /* # of color components in input image */ - J_COLOR_SPACE in_color_space; /* colorspace of input image */ - - double input_gamma; /* image gamma of input image */ - - /* Compression parameters --- these fields must be set before calling - * jpeg_start_compress(). We recommend calling jpeg_set_defaults() to - * initialize everything to reasonable defaults, then changing anything - * the application specifically wants to change. That way you won't get - * burnt when new parameters are added. Also note that there are several - * helper routines to simplify changing parameters. - */ - -#if JPEG_LIB_VERSION >= 70 - unsigned int scale_num, scale_denom; /* fraction by which to scale image */ - - JDIMENSION jpeg_width; /* scaled JPEG image width */ - JDIMENSION jpeg_height; /* scaled JPEG image height */ - /* Dimensions of actual JPEG image that will be written to file, - * derived from input dimensions by scaling factors above. - * These fields are computed by jpeg_start_compress(). - * You can also use jpeg_calc_jpeg_dimensions() to determine these values - * in advance of calling jpeg_start_compress(). - */ -#endif - - int data_precision; /* bits of precision in image data */ - - int num_components; /* # of color components in JPEG image */ - J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */ - - jpeg_component_info * comp_info; - /* comp_info[i] describes component that appears i'th in SOF */ - - JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS]; -#if JPEG_LIB_VERSION >= 70 - int q_scale_factor[NUM_QUANT_TBLS]; -#endif - /* ptrs to coefficient quantization tables, or NULL if not defined, - * and corresponding scale factors (percentage, initialized 100). - */ - - JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS]; - JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS]; - /* ptrs to Huffman coding tables, or NULL if not defined */ - - UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */ - UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */ - UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */ - - int num_scans; /* # of entries in scan_info array */ - const jpeg_scan_info * scan_info; /* script for multi-scan file, or NULL */ - /* The default value of scan_info is NULL, which causes a single-scan - * sequential JPEG file to be emitted. To create a multi-scan file, - * set num_scans and scan_info to point to an array of scan definitions. - */ - - boolean raw_data_in; /* TRUE=caller supplies downsampled data */ - boolean arith_code; /* TRUE=arithmetic coding, FALSE=Huffman */ - boolean optimize_coding; /* TRUE=optimize entropy encoding parms */ - boolean CCIR601_sampling; /* TRUE=first samples are cosited */ -#if JPEG_LIB_VERSION >= 70 - boolean do_fancy_downsampling; /* TRUE=apply fancy downsampling */ -#endif - int smoothing_factor; /* 1..100, or 0 for no input smoothing */ - J_DCT_METHOD dct_method; /* DCT algorithm selector */ - - /* The restart interval can be specified in absolute MCUs by setting - * restart_interval, or in MCU rows by setting restart_in_rows - * (in which case the correct restart_interval will be figured - * for each scan). - */ - unsigned int restart_interval; /* MCUs per restart, or 0 for no restart */ - int restart_in_rows; /* if > 0, MCU rows per restart interval */ - - /* Parameters controlling emission of special markers. */ - - boolean write_JFIF_header; /* should a JFIF marker be written? */ - UINT8 JFIF_major_version; /* What to write for the JFIF version number */ - UINT8 JFIF_minor_version; - /* These three values are not used by the JPEG code, merely copied */ - /* into the JFIF APP0 marker. density_unit can be 0 for unknown, */ - /* 1 for dots/inch, or 2 for dots/cm. Note that the pixel aspect */ - /* ratio is defined by X_density/Y_density even when density_unit=0. */ - UINT8 density_unit; /* JFIF code for pixel size units */ - UINT16 X_density; /* Horizontal pixel density */ - UINT16 Y_density; /* Vertical pixel density */ - boolean write_Adobe_marker; /* should an Adobe marker be written? */ - - /* State variable: index of next scanline to be written to - * jpeg_write_scanlines(). Application may use this to control its - * processing loop, e.g., "while (next_scanline < image_height)". - */ - - JDIMENSION next_scanline; /* 0 .. image_height-1 */ - - /* Remaining fields are known throughout compressor, but generally - * should not be touched by a surrounding application. - */ - - /* - * These fields are computed during compression startup - */ - boolean progressive_mode; /* TRUE if scan script uses progressive mode */ - int max_h_samp_factor; /* largest h_samp_factor */ - int max_v_samp_factor; /* largest v_samp_factor */ - -#if JPEG_LIB_VERSION >= 70 - int min_DCT_h_scaled_size; /* smallest DCT_h_scaled_size of any component */ - int min_DCT_v_scaled_size; /* smallest DCT_v_scaled_size of any component */ -#endif - - JDIMENSION total_iMCU_rows; /* # of iMCU rows to be input to coef ctlr */ - /* The coefficient controller receives data in units of MCU rows as defined - * for fully interleaved scans (whether the JPEG file is interleaved or not). - * There are v_samp_factor * DCTSIZE sample rows of each component in an - * "iMCU" (interleaved MCU) row. - */ - - /* - * These fields are valid during any one scan. - * They describe the components and MCUs actually appearing in the scan. - */ - int comps_in_scan; /* # of JPEG components in this scan */ - jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN]; - /* *cur_comp_info[i] describes component that appears i'th in SOS */ - - JDIMENSION MCUs_per_row; /* # of MCUs across the image */ - JDIMENSION MCU_rows_in_scan; /* # of MCU rows in the image */ - - int blocks_in_MCU; /* # of DCT blocks per MCU */ - int MCU_membership[C_MAX_BLOCKS_IN_MCU]; - /* MCU_membership[i] is index in cur_comp_info of component owning */ - /* i'th block in an MCU */ - - int Ss, Se, Ah, Al; /* progressive JPEG parameters for scan */ - -#if JPEG_LIB_VERSION >= 80 - int block_size; /* the basic DCT block size: 1..16 */ - const int * natural_order; /* natural-order position array */ - int lim_Se; /* min( Se, DCTSIZE2-1 ) */ -#endif - - /* - * Links to compression subobjects (methods and private variables of modules) - */ - struct jpeg_comp_master * master; - struct jpeg_c_main_controller * main; - struct jpeg_c_prep_controller * prep; - struct jpeg_c_coef_controller * coef; - struct jpeg_marker_writer * marker; - struct jpeg_color_converter * cconvert; - struct jpeg_downsampler * downsample; - struct jpeg_forward_dct * fdct; - struct jpeg_entropy_encoder * entropy; - jpeg_scan_info * script_space; /* workspace for jpeg_simple_progression */ - int script_space_size; -}; - - -/* Master record for a decompression instance */ - -struct jpeg_decompress_struct { - jpeg_common_fields; /* Fields shared with jpeg_compress_struct */ - - /* Source of compressed data */ - struct jpeg_source_mgr * src; - - /* Basic description of image --- filled in by jpeg_read_header(). */ - /* Application may inspect these values to decide how to process image. */ - - JDIMENSION image_width; /* nominal image width (from SOF marker) */ - JDIMENSION image_height; /* nominal image height */ - int num_components; /* # of color components in JPEG image */ - J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */ - - /* Decompression processing parameters --- these fields must be set before - * calling jpeg_start_decompress(). Note that jpeg_read_header() initializes - * them to default values. - */ - - J_COLOR_SPACE out_color_space; /* colorspace for output */ - - unsigned int scale_num, scale_denom; /* fraction by which to scale image */ - - unsigned int region_x, region_y, region_w, region_h; /* if region_w && region_h > 0, then use this region to decode. scale above is done prior to region select */ - - double output_gamma; /* image gamma wanted in output */ - - boolean buffered_image; /* TRUE=multiple output passes */ - boolean raw_data_out; /* TRUE=downsampled data wanted */ - - J_DCT_METHOD dct_method; /* IDCT algorithm selector */ - boolean do_fancy_upsampling; /* TRUE=apply fancy upsampling */ - boolean do_block_smoothing; /* TRUE=apply interblock smoothing */ - - boolean quantize_colors; /* TRUE=colormapped output wanted */ - /* the following are ignored if not quantize_colors: */ - J_DITHER_MODE dither_mode; /* type of color dithering to use */ - boolean two_pass_quantize; /* TRUE=use two-pass color quantization */ - int desired_number_of_colors; /* max # colors to use in created colormap */ - /* these are significant only in buffered-image mode: */ - boolean enable_1pass_quant; /* enable future use of 1-pass quantizer */ - boolean enable_external_quant;/* enable future use of external colormap */ - boolean enable_2pass_quant; /* enable future use of 2-pass quantizer */ - - /* Description of actual output image that will be returned to application. - * These fields are computed by jpeg_start_decompress(). - * You can also use jpeg_calc_output_dimensions() to determine these values - * in advance of calling jpeg_start_decompress(). - */ - - JDIMENSION output_width; /* scaled image width */ - JDIMENSION output_height; /* scaled image height */ - int out_color_components; /* # of color components in out_color_space */ - int output_components; /* # of color components returned */ - /* output_components is 1 (a colormap index) when quantizing colors; - * otherwise it equals out_color_components. - */ - int rec_outbuf_height; /* min recommended height of scanline buffer */ - /* If the buffer passed to jpeg_read_scanlines() is less than this many rows - * high, space and time will be wasted due to unnecessary data copying. - * Usually rec_outbuf_height will be 1 or 2, at most 4. - */ - - /* When quantizing colors, the output colormap is described by these fields. - * The application can supply a colormap by setting colormap non-NULL before - * calling jpeg_start_decompress; otherwise a colormap is created during - * jpeg_start_decompress or jpeg_start_output. - * The map has out_color_components rows and actual_number_of_colors columns. - */ - int actual_number_of_colors; /* number of entries in use */ - JSAMPARRAY colormap; /* The color map as a 2-D pixel array */ - - /* State variables: these variables indicate the progress of decompression. - * The application may examine these but must not modify them. - */ - - /* Row index of next scanline to be read from jpeg_read_scanlines(). - * Application may use this to control its processing loop, e.g., - * "while (output_scanline < output_height)". - */ - JDIMENSION output_scanline; /* 0 .. output_height-1 */ - - /* Current input scan number and number of iMCU rows completed in scan. - * These indicate the progress of the decompressor input side. - */ - int input_scan_number; /* Number of SOS markers seen so far */ - JDIMENSION input_iMCU_row; /* Number of iMCU rows completed */ - - /* The "output scan number" is the notional scan being displayed by the - * output side. The decompressor will not allow output scan/row number - * to get ahead of input scan/row, but it can fall arbitrarily far behind. - */ - int output_scan_number; /* Nominal scan number being displayed */ - JDIMENSION output_iMCU_row; /* Number of iMCU rows read */ - - /* Current progression status. coef_bits[c][i] indicates the precision - * with which component c's DCT coefficient i (in zigzag order) is known. - * It is -1 when no data has yet been received, otherwise it is the point - * transform (shift) value for the most recent scan of the coefficient - * (thus, 0 at completion of the progression). - * This pointer is NULL when reading a non-progressive file. - */ - int (*coef_bits)[DCTSIZE2]; /* -1 or current Al value for each coef */ - - /* Internal JPEG parameters --- the application usually need not look at - * these fields. Note that the decompressor output side may not use - * any parameters that can change between scans. - */ - - /* Quantization and Huffman tables are carried forward across input - * datastreams when processing abbreviated JPEG datastreams. - */ - - JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS]; - /* ptrs to coefficient quantization tables, or NULL if not defined */ - - JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS]; - JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS]; - /* ptrs to Huffman coding tables, or NULL if not defined */ - - /* These parameters are never carried across datastreams, since they - * are given in SOF/SOS markers or defined to be reset by SOI. - */ - - int data_precision; /* bits of precision in image data */ - - jpeg_component_info * comp_info; - /* comp_info[i] describes component that appears i'th in SOF */ - -#if JPEG_LIB_VERSION >= 80 - boolean is_baseline; /* TRUE if Baseline SOF0 encountered */ -#endif - boolean progressive_mode; /* TRUE if SOFn specifies progressive mode */ - boolean arith_code; /* TRUE=arithmetic coding, FALSE=Huffman */ - - UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */ - UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */ - UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */ - - unsigned int restart_interval; /* MCUs per restart interval, or 0 for no restart */ - - /* These fields record data obtained from optional markers recognized by - * the JPEG library. - */ - boolean saw_JFIF_marker; /* TRUE iff a JFIF APP0 marker was found */ - /* Data copied from JFIF marker; only valid if saw_JFIF_marker is TRUE: */ - UINT8 JFIF_major_version; /* JFIF version number */ - UINT8 JFIF_minor_version; - UINT8 density_unit; /* JFIF code for pixel size units */ - UINT16 X_density; /* Horizontal pixel density */ - UINT16 Y_density; /* Vertical pixel density */ - boolean saw_Adobe_marker; /* TRUE iff an Adobe APP14 marker was found */ - UINT8 Adobe_transform; /* Color transform code from Adobe marker */ - - boolean CCIR601_sampling; /* TRUE=first samples are cosited */ - - /* Aside from the specific data retained from APPn markers known to the - * library, the uninterpreted contents of any or all APPn and COM markers - * can be saved in a list for examination by the application. - */ - jpeg_saved_marker_ptr marker_list; /* Head of list of saved markers */ - - /* Remaining fields are known throughout decompressor, but generally - * should not be touched by a surrounding application. - */ - - /* - * These fields are computed during decompression startup - */ - int max_h_samp_factor; /* largest h_samp_factor */ - int max_v_samp_factor; /* largest v_samp_factor */ - -#if JPEG_LIB_VERSION >= 70 - int min_DCT_h_scaled_size; /* smallest DCT_h_scaled_size of any component */ - int min_DCT_v_scaled_size; /* smallest DCT_v_scaled_size of any component */ -#else - int min_DCT_scaled_size; /* smallest DCT_scaled_size of any component */ -#endif - - JDIMENSION total_iMCU_rows; /* # of iMCU rows in image */ - /* The coefficient controller's input and output progress is measured in - * units of "iMCU" (interleaved MCU) rows. These are the same as MCU rows - * in fully interleaved JPEG scans, but are used whether the scan is - * interleaved or not. We define an iMCU row as v_samp_factor DCT block - * rows of each component. Therefore, the IDCT output contains - * v_samp_factor*DCT_[v_]scaled_size sample rows of a component per iMCU row. - */ - - JSAMPLE * sample_range_limit; /* table for fast range-limiting */ - - /* - * These fields are valid during any one scan. - * They describe the components and MCUs actually appearing in the scan. - * Note that the decompressor output side must not use these fields. - */ - int comps_in_scan; /* # of JPEG components in this scan */ - jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN]; - /* *cur_comp_info[i] describes component that appears i'th in SOS */ - - JDIMENSION MCUs_per_row; /* # of MCUs across the image */ - JDIMENSION MCU_rows_in_scan; /* # of MCU rows in the image */ - - int blocks_in_MCU; /* # of DCT blocks per MCU */ - int MCU_membership[D_MAX_BLOCKS_IN_MCU]; - /* MCU_membership[i] is index in cur_comp_info of component owning */ - /* i'th block in an MCU */ - - int Ss, Se, Ah, Al; /* progressive JPEG parameters for scan */ - -#if JPEG_LIB_VERSION >= 80 - /* These fields are derived from Se of first SOS marker. - */ - int block_size; /* the basic DCT block size: 1..16 */ - const int * natural_order; /* natural-order position array for entropy decode */ - int lim_Se; /* min( Se, DCTSIZE2-1 ) for entropy decode */ -#endif - - /* This field is shared between entropy decoder and marker parser. - * It is either zero or the code of a JPEG marker that has been - * read from the data source, but has not yet been processed. - */ - int unread_marker; - - /* - * Links to decompression subobjects (methods, private variables of modules) - */ - struct jpeg_decomp_master * master; - struct jpeg_d_main_controller * main; - struct jpeg_d_coef_controller * coef; - struct jpeg_d_post_controller * post; - struct jpeg_input_controller * inputctl; - struct jpeg_marker_reader * marker; - struct jpeg_entropy_decoder * entropy; - struct jpeg_inverse_dct * idct; - struct jpeg_upsampler * upsample; - struct jpeg_color_deconverter * cconvert; - struct jpeg_color_quantizer * cquantize; -}; - - -/* "Object" declarations for JPEG modules that may be supplied or called - * directly by the surrounding application. - * As with all objects in the JPEG library, these structs only define the - * publicly visible methods and state variables of a module. Additional - * private fields may exist after the public ones. - */ - - -/* Error handler object */ - -struct jpeg_error_mgr { - /* Error exit handler: does not return to caller */ - JMETHOD(void, error_exit, (j_common_ptr cinfo)); - /* Conditionally emit a trace or warning message */ - JMETHOD(void, emit_message, (j_common_ptr cinfo, int msg_level)); - /* Routine that actually outputs a trace or error message */ - JMETHOD(void, output_message, (j_common_ptr cinfo)); - /* Format a message string for the most recent JPEG error or message */ - JMETHOD(void, format_message, (j_common_ptr cinfo, char * buffer)); -#define JMSG_LENGTH_MAX 200 /* recommended size of format_message buffer */ - /* Reset error state variables at start of a new image */ - JMETHOD(void, reset_error_mgr, (j_common_ptr cinfo)); - - /* The message ID code and any parameters are saved here. - * A message can have one string parameter or up to 8 int parameters. - */ - int msg_code; -#define JMSG_STR_PARM_MAX 80 - union { - int i[8]; - char s[JMSG_STR_PARM_MAX]; - } msg_parm; - - /* Standard state variables for error facility */ - - int trace_level; /* max msg_level that will be displayed */ - - /* For recoverable corrupt-data errors, we emit a warning message, - * but keep going unless emit_message chooses to abort. emit_message - * should count warnings in num_warnings. The surrounding application - * can check for bad data by seeing if num_warnings is nonzero at the - * end of processing. - */ - long num_warnings; /* number of corrupt-data warnings */ - - /* These fields point to the table(s) of error message strings. - * An application can change the table pointer to switch to a different - * message list (typically, to change the language in which errors are - * reported). Some applications may wish to add additional error codes - * that will be handled by the JPEG library error mechanism; the second - * table pointer is used for this purpose. - * - * First table includes all errors generated by JPEG library itself. - * Error code 0 is reserved for a "no such error string" message. - */ - const char * const * jpeg_message_table; /* Library errors */ - int last_jpeg_message; /* Table contains strings 0..last_jpeg_message */ - /* Second table can be added by application (see cjpeg/djpeg for example). - * It contains strings numbered first_addon_message..last_addon_message. - */ - const char * const * addon_message_table; /* Non-library errors */ - int first_addon_message; /* code for first string in addon table */ - int last_addon_message; /* code for last string in addon table */ -}; - - -/* Progress monitor object */ - -struct jpeg_progress_mgr { - JMETHOD(void, progress_monitor, (j_common_ptr cinfo)); - - long pass_counter; /* work units completed in this pass */ - long pass_limit; /* total number of work units in this pass */ - int completed_passes; /* passes completed so far */ - int total_passes; /* total number of passes expected */ -}; - - -/* Data destination object for compression */ - -struct jpeg_destination_mgr { - JOCTET * next_output_byte; /* => next byte to write in buffer */ - size_t free_in_buffer; /* # of byte spaces remaining in buffer */ - - JMETHOD(void, init_destination, (j_compress_ptr cinfo)); - JMETHOD(boolean, empty_output_buffer, (j_compress_ptr cinfo)); - JMETHOD(void, term_destination, (j_compress_ptr cinfo)); -}; - - -/* Data source object for decompression */ - -struct jpeg_source_mgr { - const JOCTET * next_input_byte; /* => next byte to read from buffer */ - size_t bytes_in_buffer; /* # of bytes remaining in buffer */ - - JMETHOD(void, init_source, (j_decompress_ptr cinfo)); - JMETHOD(boolean, fill_input_buffer, (j_decompress_ptr cinfo)); - JMETHOD(void, skip_input_data, (j_decompress_ptr cinfo, long num_bytes)); - JMETHOD(boolean, resync_to_restart, (j_decompress_ptr cinfo, int desired)); - JMETHOD(void, term_source, (j_decompress_ptr cinfo)); -}; - - -/* Memory manager object. - * Allocates "small" objects (a few K total), "large" objects (tens of K), - * and "really big" objects (virtual arrays with backing store if needed). - * The memory manager does not allow individual objects to be freed; rather, - * each created object is assigned to a pool, and whole pools can be freed - * at once. This is faster and more convenient than remembering exactly what - * to free, especially where malloc()/free() are not too speedy. - * NB: alloc routines never return NULL. They exit to error_exit if not - * successful. - */ - -#define JPOOL_PERMANENT 0 /* lasts until master record is destroyed */ -#define JPOOL_IMAGE 1 /* lasts until done with image/datastream */ -#define JPOOL_NUMPOOLS 2 - -typedef struct jvirt_sarray_control * jvirt_sarray_ptr; -typedef struct jvirt_barray_control * jvirt_barray_ptr; - - -struct jpeg_memory_mgr { - /* Method pointers */ - JMETHOD(void *, alloc_small, (j_common_ptr cinfo, int pool_id, - size_t sizeofobject)); - JMETHOD(void FAR *, alloc_large, (j_common_ptr cinfo, int pool_id, - size_t sizeofobject)); - JMETHOD(JSAMPARRAY, alloc_sarray, (j_common_ptr cinfo, int pool_id, - JDIMENSION samplesperrow, - JDIMENSION numrows)); - JMETHOD(JBLOCKARRAY, alloc_barray, (j_common_ptr cinfo, int pool_id, - JDIMENSION blocksperrow, - JDIMENSION numrows)); - JMETHOD(jvirt_sarray_ptr, request_virt_sarray, (j_common_ptr cinfo, - int pool_id, - boolean pre_zero, - JDIMENSION samplesperrow, - JDIMENSION numrows, - JDIMENSION maxaccess)); - JMETHOD(jvirt_barray_ptr, request_virt_barray, (j_common_ptr cinfo, - int pool_id, - boolean pre_zero, - JDIMENSION blocksperrow, - JDIMENSION numrows, - JDIMENSION maxaccess)); - JMETHOD(void, realize_virt_arrays, (j_common_ptr cinfo)); - JMETHOD(JSAMPARRAY, access_virt_sarray, (j_common_ptr cinfo, - jvirt_sarray_ptr ptr, - JDIMENSION start_row, - JDIMENSION num_rows, - boolean writable)); - JMETHOD(JBLOCKARRAY, access_virt_barray, (j_common_ptr cinfo, - jvirt_barray_ptr ptr, - JDIMENSION start_row, - JDIMENSION num_rows, - boolean writable)); - JMETHOD(void, free_pool, (j_common_ptr cinfo, int pool_id)); - JMETHOD(void, self_destruct, (j_common_ptr cinfo)); - - /* Limit on memory allocation for this JPEG object. (Note that this is - * merely advisory, not a guaranteed maximum; it only affects the space - * used for virtual-array buffers.) May be changed by outer application - * after creating the JPEG object. - */ - long max_memory_to_use; - - /* Maximum allocation request accepted by alloc_large. */ - long max_alloc_chunk; -}; - - -/* Routine signature for application-supplied marker processing methods. - * Need not pass marker code since it is stored in cinfo->unread_marker. - */ -typedef JMETHOD(boolean, jpeg_marker_parser_method, (j_decompress_ptr cinfo)); - - -/* Declarations for routines called by application. - * The JPP macro hides prototype parameters from compilers that can't cope. - * Note JPP requires double parentheses. - */ - -#ifdef HAVE_PROTOTYPES -#define JPP(arglist) arglist -#else -#define JPP(arglist) () -#endif - - -/* Short forms of external names for systems with brain-damaged linkers. - * We shorten external names to be unique in the first six letters, which - * is good enough for all known systems. - * (If your compiler itself needs names to be unique in less than 15 - * characters, you are out of luck. Get a better compiler.) - */ - -#ifdef NEED_SHORT_EXTERNAL_NAMES -#define jpeg_std_error jStdError -#define jpeg_CreateCompress jCreaCompress -#define jpeg_CreateDecompress jCreaDecompress -#define jpeg_destroy_compress jDestCompress -#define jpeg_destroy_decompress jDestDecompress -#define jpeg_stdio_dest jStdDest -#define jpeg_stdio_src jStdSrc -#if JPEG_LIB_VERSION >= 80 -#define jpeg_mem_dest jMemDest -#define jpeg_mem_src jMemSrc -#endif -#define jpeg_set_defaults jSetDefaults -#define jpeg_set_colorspace jSetColorspace -#define jpeg_default_colorspace jDefColorspace -#define jpeg_set_quality jSetQuality -#define jpeg_set_linear_quality jSetLQuality -#if JPEG_LIB_VERSION >= 70 -#define jpeg_default_qtables jDefQTables -#endif -#define jpeg_add_quant_table jAddQuantTable -#define jpeg_quality_scaling jQualityScaling -#define jpeg_simple_progression jSimProgress -#define jpeg_suppress_tables jSuppressTables -#define jpeg_alloc_quant_table jAlcQTable -#define jpeg_alloc_huff_table jAlcHTable -#define jpeg_start_compress jStrtCompress -#define jpeg_write_scanlines jWrtScanlines -#define jpeg_finish_compress jFinCompress -#if JPEG_LIB_VERSION >= 70 -#define jpeg_calc_jpeg_dimensions jCjpegDimensions -#endif -#define jpeg_write_raw_data jWrtRawData -#define jpeg_write_marker jWrtMarker -#define jpeg_write_m_header jWrtMHeader -#define jpeg_write_m_byte jWrtMByte -#define jpeg_write_tables jWrtTables -#define jpeg_read_header jReadHeader -#define jpeg_start_decompress jStrtDecompress -#define jpeg_read_scanlines jReadScanlines -#define jpeg_finish_decompress jFinDecompress -#define jpeg_read_raw_data jReadRawData -#define jpeg_has_multiple_scans jHasMultScn -#define jpeg_start_output jStrtOutput -#define jpeg_finish_output jFinOutput -#define jpeg_input_complete jInComplete -#define jpeg_new_colormap jNewCMap -#define jpeg_consume_input jConsumeInput -#if JPEG_LIB_VERSION >= 80 -#define jpeg_core_output_dimensions jCoreDimensions -#endif -#define jpeg_calc_output_dimensions jCalcDimensions -#define jpeg_save_markers jSaveMarkers -#define jpeg_set_marker_processor jSetMarker -#define jpeg_read_coefficients jReadCoefs -#define jpeg_write_coefficients jWrtCoefs -#define jpeg_copy_critical_parameters jCopyCrit -#define jpeg_abort_compress jAbrtCompress -#define jpeg_abort_decompress jAbrtDecompress -#define jpeg_abort jAbort -#define jpeg_destroy jDestroy -#define jpeg_resync_to_restart jResyncRestart -#endif /* NEED_SHORT_EXTERNAL_NAMES */ - - -/* Default error-management setup */ -EXTERN(struct jpeg_error_mgr *) jpeg_std_error - JPP((struct jpeg_error_mgr * err)); - -/* Initialization of JPEG compression objects. - * jpeg_create_compress() and jpeg_create_decompress() are the exported - * names that applications should call. These expand to calls on - * jpeg_CreateCompress and jpeg_CreateDecompress with additional information - * passed for version mismatch checking. - * NB: you must set up the error-manager BEFORE calling jpeg_create_xxx. - */ -#define jpeg_create_compress(cinfo) \ - jpeg_CreateCompress((cinfo), JPEG_LIB_VERSION, \ - (size_t) sizeof(struct jpeg_compress_struct)) -#define jpeg_create_decompress(cinfo) \ - jpeg_CreateDecompress((cinfo), JPEG_LIB_VERSION, \ - (size_t) sizeof(struct jpeg_decompress_struct)) -EXTERN(void) jpeg_CreateCompress JPP((j_compress_ptr cinfo, - int version, size_t structsize)); -EXTERN(void) jpeg_CreateDecompress JPP((j_decompress_ptr cinfo, - int version, size_t structsize)); -/* Destruction of JPEG compression objects */ -EXTERN(void) jpeg_destroy_compress JPP((j_compress_ptr cinfo)); -EXTERN(void) jpeg_destroy_decompress JPP((j_decompress_ptr cinfo)); - -/* Standard data source and destination managers: stdio streams. */ -/* Caller is responsible for opening the file before and closing after. */ -EXTERN(void) jpeg_stdio_dest JPP((j_compress_ptr cinfo, FILE * outfile)); -EXTERN(void) jpeg_stdio_src JPP((j_decompress_ptr cinfo, FILE * infile)); - -#if JPEG_LIB_VERSION >= 80 -/* Data source and destination managers: memory buffers. */ -EXTERN(void) jpeg_mem_dest JPP((j_compress_ptr cinfo, - unsigned char ** outbuffer, - unsigned long * outsize)); -EXTERN(void) jpeg_mem_src JPP((j_decompress_ptr cinfo, - unsigned char * inbuffer, - unsigned long insize)); -#endif - -/* Default parameter setup for compression */ -EXTERN(void) jpeg_set_defaults JPP((j_compress_ptr cinfo)); -/* Compression parameter setup aids */ -EXTERN(void) jpeg_set_colorspace JPP((j_compress_ptr cinfo, - J_COLOR_SPACE colorspace)); -EXTERN(void) jpeg_default_colorspace JPP((j_compress_ptr cinfo)); -EXTERN(void) jpeg_set_quality JPP((j_compress_ptr cinfo, int quality, - boolean force_baseline)); -EXTERN(void) jpeg_set_linear_quality JPP((j_compress_ptr cinfo, - int scale_factor, - boolean force_baseline)); -#if JPEG_LIB_VERSION >= 70 -EXTERN(void) jpeg_default_qtables JPP((j_compress_ptr cinfo, - boolean force_baseline)); -#endif -EXTERN(void) jpeg_add_quant_table JPP((j_compress_ptr cinfo, int which_tbl, - const unsigned int *basic_table, - int scale_factor, - boolean force_baseline)); -EXTERN(int) jpeg_quality_scaling JPP((int quality)); -EXTERN(void) jpeg_simple_progression JPP((j_compress_ptr cinfo)); -EXTERN(void) jpeg_suppress_tables JPP((j_compress_ptr cinfo, - boolean suppress)); -EXTERN(JQUANT_TBL *) jpeg_alloc_quant_table JPP((j_common_ptr cinfo)); -EXTERN(JHUFF_TBL *) jpeg_alloc_huff_table JPP((j_common_ptr cinfo)); - -/* Main entry points for compression */ -EXTERN(void) jpeg_start_compress JPP((j_compress_ptr cinfo, - boolean write_all_tables)); -EXTERN(JDIMENSION) jpeg_write_scanlines JPP((j_compress_ptr cinfo, - JSAMPARRAY scanlines, - JDIMENSION num_lines)); -EXTERN(void) jpeg_finish_compress JPP((j_compress_ptr cinfo)); - -#if JPEG_LIB_VERSION >= 70 -/* Precalculate JPEG dimensions for current compression parameters. */ -EXTERN(void) jpeg_calc_jpeg_dimensions JPP((j_compress_ptr cinfo)); -#endif - -/* Replaces jpeg_write_scanlines when writing raw downsampled data. */ -EXTERN(JDIMENSION) jpeg_write_raw_data JPP((j_compress_ptr cinfo, - JSAMPIMAGE data, - JDIMENSION num_lines)); - -/* Write a special marker. See libjpeg.txt concerning safe usage. */ -EXTERN(void) jpeg_write_marker - JPP((j_compress_ptr cinfo, int marker, - const JOCTET * dataptr, unsigned int datalen)); -/* Same, but piecemeal. */ -EXTERN(void) jpeg_write_m_header - JPP((j_compress_ptr cinfo, int marker, unsigned int datalen)); -EXTERN(void) jpeg_write_m_byte - JPP((j_compress_ptr cinfo, int val)); - -/* Alternate compression function: just write an abbreviated table file */ -EXTERN(void) jpeg_write_tables JPP((j_compress_ptr cinfo)); - -/* Decompression startup: read start of JPEG datastream to see what's there */ -EXTERN(int) jpeg_read_header JPP((j_decompress_ptr cinfo, - boolean require_image)); -/* Return value is one of: */ -#define JPEG_SUSPENDED 0 /* Suspended due to lack of input data */ -#define JPEG_HEADER_OK 1 /* Found valid image datastream */ -#define JPEG_HEADER_TABLES_ONLY 2 /* Found valid table-specs-only datastream */ -/* If you pass require_image = TRUE (normal case), you need not check for - * a TABLES_ONLY return code; an abbreviated file will cause an error exit. - * JPEG_SUSPENDED is only possible if you use a data source module that can - * give a suspension return (the stdio source module doesn't). - */ - -/* Main entry points for decompression */ -EXTERN(boolean) jpeg_start_decompress JPP((j_decompress_ptr cinfo)); -EXTERN(JDIMENSION) jpeg_read_scanlines JPP((j_decompress_ptr cinfo, - JSAMPARRAY scanlines, - JDIMENSION max_lines)); -EXTERN(boolean) jpeg_finish_decompress JPP((j_decompress_ptr cinfo)); - -/* Replaces jpeg_read_scanlines when reading raw downsampled data. */ -EXTERN(JDIMENSION) jpeg_read_raw_data JPP((j_decompress_ptr cinfo, - JSAMPIMAGE data, - JDIMENSION max_lines)); - -/* Additional entry points for buffered-image mode. */ -EXTERN(boolean) jpeg_has_multiple_scans JPP((j_decompress_ptr cinfo)); -EXTERN(boolean) jpeg_start_output JPP((j_decompress_ptr cinfo, - int scan_number)); -EXTERN(boolean) jpeg_finish_output JPP((j_decompress_ptr cinfo)); -EXTERN(boolean) jpeg_input_complete JPP((j_decompress_ptr cinfo)); -EXTERN(void) jpeg_new_colormap JPP((j_decompress_ptr cinfo)); -EXTERN(int) jpeg_consume_input JPP((j_decompress_ptr cinfo)); -/* Return value is one of: */ -/* #define JPEG_SUSPENDED 0 Suspended due to lack of input data */ -#define JPEG_REACHED_SOS 1 /* Reached start of new scan */ -#define JPEG_REACHED_EOI 2 /* Reached end of image */ -#define JPEG_ROW_COMPLETED 3 /* Completed one iMCU row */ -#define JPEG_SCAN_COMPLETED 4 /* Completed last iMCU row of a scan */ - -/* Precalculate output dimensions for current decompression parameters. */ -#if JPEG_LIB_VERSION >= 80 -EXTERN(void) jpeg_core_output_dimensions JPP((j_decompress_ptr cinfo)); -#endif -EXTERN(void) jpeg_calc_output_dimensions JPP((j_decompress_ptr cinfo)); - -/* Control saving of COM and APPn markers into marker_list. */ -EXTERN(void) jpeg_save_markers - JPP((j_decompress_ptr cinfo, int marker_code, - unsigned int length_limit)); - -/* Install a special processing method for COM or APPn markers. */ -EXTERN(void) jpeg_set_marker_processor - JPP((j_decompress_ptr cinfo, int marker_code, - jpeg_marker_parser_method routine)); - -/* Read or write raw DCT coefficients --- useful for lossless transcoding. */ -EXTERN(jvirt_barray_ptr *) jpeg_read_coefficients JPP((j_decompress_ptr cinfo)); -EXTERN(void) jpeg_write_coefficients JPP((j_compress_ptr cinfo, - jvirt_barray_ptr * coef_arrays)); -EXTERN(void) jpeg_copy_critical_parameters JPP((j_decompress_ptr srcinfo, - j_compress_ptr dstinfo)); - -/* If you choose to abort compression or decompression before completing - * jpeg_finish_(de)compress, then you need to clean up to release memory, - * temporary files, etc. You can just call jpeg_destroy_(de)compress - * if you're done with the JPEG object, but if you want to clean it up and - * reuse it, call this: - */ -EXTERN(void) jpeg_abort_compress JPP((j_compress_ptr cinfo)); -EXTERN(void) jpeg_abort_decompress JPP((j_decompress_ptr cinfo)); - -/* Generic versions of jpeg_abort and jpeg_destroy that work on either - * flavor of JPEG object. These may be more convenient in some places. - */ -EXTERN(void) jpeg_abort JPP((j_common_ptr cinfo)); -EXTERN(void) jpeg_destroy JPP((j_common_ptr cinfo)); - -/* Default restart-marker-resync procedure for use by data source modules */ -EXTERN(boolean) jpeg_resync_to_restart JPP((j_decompress_ptr cinfo, - int desired)); - - -/* These marker codes are exported since applications and data source modules - * are likely to want to use them. - */ - -#define JPEG_RST0 0xD0 /* RST0 marker code */ -#define JPEG_EOI 0xD9 /* EOI marker code */ -#define JPEG_APP0 0xE0 /* APP0 marker code */ -#define JPEG_COM 0xFE /* COM marker code */ - - -/* If we have a brain-damaged compiler that emits warnings (or worse, errors) - * for structure definitions that are never filled in, keep it quiet by - * supplying dummy definitions for the various substructures. - */ - -#ifdef INCOMPLETE_TYPES_BROKEN -#ifndef JPEG_INTERNALS /* will be defined in jpegint.h */ -struct jvirt_sarray_control { long dummy; }; -struct jvirt_barray_control { long dummy; }; -struct jpeg_comp_master { long dummy; }; -struct jpeg_c_main_controller { long dummy; }; -struct jpeg_c_prep_controller { long dummy; }; -struct jpeg_c_coef_controller { long dummy; }; -struct jpeg_marker_writer { long dummy; }; -struct jpeg_color_converter { long dummy; }; -struct jpeg_downsampler { long dummy; }; -struct jpeg_forward_dct { long dummy; }; -struct jpeg_entropy_encoder { long dummy; }; -struct jpeg_decomp_master { long dummy; }; -struct jpeg_d_main_controller { long dummy; }; -struct jpeg_d_coef_controller { long dummy; }; -struct jpeg_d_post_controller { long dummy; }; -struct jpeg_input_controller { long dummy; }; -struct jpeg_marker_reader { long dummy; }; -struct jpeg_entropy_decoder { long dummy; }; -struct jpeg_inverse_dct { long dummy; }; -struct jpeg_upsampler { long dummy; }; -struct jpeg_color_deconverter { long dummy; }; -struct jpeg_color_quantizer { long dummy; }; -#endif /* JPEG_INTERNALS */ -#endif /* INCOMPLETE_TYPES_BROKEN */ - - -/* - * The JPEG library modules define JPEG_INTERNALS before including this file. - * The internal structure declarations are read only when that is true. - * Applications using the library should not include jpegint.h, but may wish - * to include jerror.h. - */ - -#ifdef JPEG_INTERNALS -#include "jpegint.h" /* fetch private declarations */ -#include "jerror.h" /* fetch error codes too */ -#endif - -#ifdef __cplusplus -#ifndef DONT_USE_EXTERN_C -} -#endif -#endif - -#endif /* JPEGLIB_H */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/png.h.REMOVED.git-id b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/png.h.REMOVED.git-id deleted file mode 100644 index 9219c9b116..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/png.h.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -35609691794f066d3d94c01d357b4fa18d88829d \ No newline at end of file diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/pngconf.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/pngconf.h deleted file mode 100644 index 042a5e98f2..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/pngconf.h +++ /dev/null @@ -1,1665 +0,0 @@ - -/* pngconf.h - machine configurable file for libpng - * - * libpng version 1.2.50 - July 10, 2012 - * Copyright (c) 1998-2012 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) - * - * This code is released under the libpng license. - * For conditions of distribution and use, see the disclaimer - * and license in png.h - */ - -/* Any machine specific code is near the front of this file, so if you - * are configuring libpng for a machine, you may want to read the section - * starting here down to where it starts to typedef png_color, png_text, - * and png_info. - */ - -#ifndef PNGCONF_H -#define PNGCONF_H - -#define PNG_1_2_X - -/* - * PNG_USER_CONFIG has to be defined on the compiler command line. This - * includes the resource compiler for Windows DLL configurations. - */ -#ifdef PNG_USER_CONFIG -# ifndef PNG_USER_PRIVATEBUILD -# define PNG_USER_PRIVATEBUILD -# endif -#include "pngusr.h" -#endif - -/* PNG_CONFIGURE_LIBPNG is set by the "configure" script. */ -#ifdef PNG_CONFIGURE_LIBPNG -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif -#endif - -/* - * Added at libpng-1.2.8 - * - * If you create a private DLL you need to define in "pngusr.h" the followings: - * #define PNG_USER_PRIVATEBUILD <Describes by whom and why this version of - * the DLL was built> - * e.g. #define PNG_USER_PRIVATEBUILD "Build by MyCompany for xyz reasons." - * #define PNG_USER_DLLFNAME_POSTFIX <two-letter postfix that serve to - * distinguish your DLL from those of the official release. These - * correspond to the trailing letters that come after the version - * number and must match your private DLL name> - * e.g. // private DLL "libpng13gx.dll" - * #define PNG_USER_DLLFNAME_POSTFIX "gx" - * - * The following macros are also at your disposal if you want to complete the - * DLL VERSIONINFO structure. - * - PNG_USER_VERSIONINFO_COMMENTS - * - PNG_USER_VERSIONINFO_COMPANYNAME - * - PNG_USER_VERSIONINFO_LEGALTRADEMARKS - */ - -#ifdef __STDC__ -#ifdef SPECIALBUILD -# pragma message("PNG_LIBPNG_SPECIALBUILD (and deprecated SPECIALBUILD)\ - are now LIBPNG reserved macros. Use PNG_USER_PRIVATEBUILD instead.") -#endif - -#ifdef PRIVATEBUILD -# pragma message("PRIVATEBUILD is deprecated.\ - Use PNG_USER_PRIVATEBUILD instead.") -# define PNG_USER_PRIVATEBUILD PRIVATEBUILD -#endif -#endif /* __STDC__ */ - -#ifndef PNG_VERSION_INFO_ONLY - -/* End of material added to libpng-1.2.8 */ - -/* Added at libpng-1.2.19, removed at libpng-1.2.20 because it caused trouble - Restored at libpng-1.2.21 */ -#if !defined(PNG_NO_WARN_UNINITIALIZED_ROW) && \ - !defined(PNG_WARN_UNINITIALIZED_ROW) -# define PNG_WARN_UNINITIALIZED_ROW 1 -#endif -/* End of material added at libpng-1.2.19/1.2.21 */ - -/* This is the size of the compression buffer, and thus the size of - * an IDAT chunk. Make this whatever size you feel is best for your - * machine. One of these will be allocated per png_struct. When this - * is full, it writes the data to the disk, and does some other - * calculations. Making this an extremely small size will slow - * the library down, but you may want to experiment to determine - * where it becomes significant, if you are concerned with memory - * usage. Note that zlib allocates at least 32Kb also. For readers, - * this describes the size of the buffer available to read the data in. - * Unless this gets smaller than the size of a row (compressed), - * it should not make much difference how big this is. - */ - -#ifndef PNG_ZBUF_SIZE -# define PNG_ZBUF_SIZE 8192 -#endif - -/* Enable if you want a write-only libpng */ - -#ifndef PNG_NO_READ_SUPPORTED -# define PNG_READ_SUPPORTED -#endif - -/* Enable if you want a read-only libpng */ - -#ifndef PNG_NO_WRITE_SUPPORTED -# define PNG_WRITE_SUPPORTED -#endif - -/* Enabled in 1.2.41. */ -#ifdef PNG_ALLOW_BENIGN_ERRORS -# define png_benign_error png_warning -# define png_chunk_benign_error png_chunk_warning -#else -# ifndef PNG_BENIGN_ERRORS_SUPPORTED -# define png_benign_error png_error -# define png_chunk_benign_error png_chunk_error -# endif -#endif - -/* Added in libpng-1.2.41 */ -#if !defined(PNG_NO_WARNINGS) && !defined(PNG_WARNINGS_SUPPORTED) -# define PNG_WARNINGS_SUPPORTED -#endif - -#if !defined(PNG_NO_ERROR_TEXT) && !defined(PNG_ERROR_TEXT_SUPPORTED) -# define PNG_ERROR_TEXT_SUPPORTED -#endif - -#if !defined(PNG_NO_CHECK_cHRM) && !defined(PNG_CHECK_cHRM_SUPPORTED) -# define PNG_CHECK_cHRM_SUPPORTED -#endif - -/* Enabled by default in 1.2.0. You can disable this if you don't need to - * support PNGs that are embedded in MNG datastreams - */ -#if !defined(PNG_1_0_X) && !defined(PNG_NO_MNG_FEATURES) -# ifndef PNG_MNG_FEATURES_SUPPORTED -# define PNG_MNG_FEATURES_SUPPORTED -# endif -#endif - -#ifndef PNG_NO_FLOATING_POINT_SUPPORTED -# ifndef PNG_FLOATING_POINT_SUPPORTED -# define PNG_FLOATING_POINT_SUPPORTED -# endif -#endif - -/* If you are running on a machine where you cannot allocate more - * than 64K of memory at once, uncomment this. While libpng will not - * normally need that much memory in a chunk (unless you load up a very - * large file), zlib needs to know how big of a chunk it can use, and - * libpng thus makes sure to check any memory allocation to verify it - * will fit into memory. -#define PNG_MAX_MALLOC_64K - */ -#if defined(MAXSEG_64K) && !defined(PNG_MAX_MALLOC_64K) -# define PNG_MAX_MALLOC_64K -#endif - -/* Special munging to support doing things the 'cygwin' way: - * 'Normal' png-on-win32 defines/defaults: - * PNG_BUILD_DLL -- building dll - * PNG_USE_DLL -- building an application, linking to dll - * (no define) -- building static library, or building an - * application and linking to the static lib - * 'Cygwin' defines/defaults: - * PNG_BUILD_DLL -- (ignored) building the dll - * (no define) -- (ignored) building an application, linking to the dll - * PNG_STATIC -- (ignored) building the static lib, or building an - * application that links to the static lib. - * ALL_STATIC -- (ignored) building various static libs, or building an - * application that links to the static libs. - * Thus, - * a cygwin user should define either PNG_BUILD_DLL or PNG_STATIC, and - * this bit of #ifdefs will define the 'correct' config variables based on - * that. If a cygwin user *wants* to define 'PNG_USE_DLL' that's okay, but - * unnecessary. - * - * Also, the precedence order is: - * ALL_STATIC (since we can't #undef something outside our namespace) - * PNG_BUILD_DLL - * PNG_STATIC - * (nothing) == PNG_USE_DLL - * - * CYGWIN (2002-01-20): The preceding is now obsolete. With the advent - * of auto-import in binutils, we no longer need to worry about - * __declspec(dllexport) / __declspec(dllimport) and friends. Therefore, - * we don't need to worry about PNG_STATIC or ALL_STATIC when it comes - * to __declspec() stuff. However, we DO need to worry about - * PNG_BUILD_DLL and PNG_STATIC because those change some defaults - * such as CONSOLE_IO and whether GLOBAL_ARRAYS are allowed. - */ -#ifdef __CYGWIN__ -# ifdef ALL_STATIC -# ifdef PNG_BUILD_DLL -# undef PNG_BUILD_DLL -# endif -# ifdef PNG_USE_DLL -# undef PNG_USE_DLL -# endif -# ifdef PNG_DLL -# undef PNG_DLL -# endif -# ifndef PNG_STATIC -# define PNG_STATIC -# endif -# else -# ifdef PNG_BUILD_DLL -# ifdef PNG_STATIC -# undef PNG_STATIC -# endif -# ifdef PNG_USE_DLL -# undef PNG_USE_DLL -# endif -# ifndef PNG_DLL -# define PNG_DLL -# endif -# else -# ifdef PNG_STATIC -# ifdef PNG_USE_DLL -# undef PNG_USE_DLL -# endif -# ifdef PNG_DLL -# undef PNG_DLL -# endif -# else -# ifndef PNG_USE_DLL -# define PNG_USE_DLL -# endif -# ifndef PNG_DLL -# define PNG_DLL -# endif -# endif -# endif -# endif -#endif - -/* This protects us against compilers that run on a windowing system - * and thus don't have or would rather us not use the stdio types: - * stdin, stdout, and stderr. The only one currently used is stderr - * in png_error() and png_warning(). #defining PNG_NO_CONSOLE_IO will - * prevent these from being compiled and used. #defining PNG_NO_STDIO - * will also prevent these, plus will prevent the entire set of stdio - * macros and functions (FILE *, printf, etc.) from being compiled and used, - * unless (PNG_DEBUG > 0) has been #defined. - * - * #define PNG_NO_CONSOLE_IO - * #define PNG_NO_STDIO - */ - -#if !defined(PNG_NO_STDIO) && !defined(PNG_STDIO_SUPPORTED) -# define PNG_STDIO_SUPPORTED -#endif - -#ifdef _WIN32_WCE -# include <windows.h> - /* Console I/O functions are not supported on WindowsCE */ -# define PNG_NO_CONSOLE_IO - /* abort() may not be supported on some/all Windows CE platforms */ -# define PNG_ABORT() exit(-1) -# ifdef PNG_DEBUG -# undef PNG_DEBUG -# endif -#endif - -#ifdef PNG_BUILD_DLL -# ifndef PNG_CONSOLE_IO_SUPPORTED -# ifndef PNG_NO_CONSOLE_IO -# define PNG_NO_CONSOLE_IO -# endif -# endif -#endif - -# ifdef PNG_NO_STDIO -# ifndef PNG_NO_CONSOLE_IO -# define PNG_NO_CONSOLE_IO -# endif -# ifdef PNG_DEBUG -# if (PNG_DEBUG > 0) -# include <stdio.h> -# endif -# endif -# else -# ifndef _WIN32_WCE -/* "stdio.h" functions are not supported on WindowsCE */ -# include <stdio.h> -# endif -# endif - -#if !(defined PNG_NO_CONSOLE_IO) && !defined(PNG_CONSOLE_IO_SUPPORTED) -# define PNG_CONSOLE_IO_SUPPORTED -#endif - -/* This macro protects us against machines that don't have function - * prototypes (ie K&R style headers). If your compiler does not handle - * function prototypes, define this macro and use the included ansi2knr. - * I've always been able to use _NO_PROTO as the indicator, but you may - * need to drag the empty declaration out in front of here, or change the - * ifdef to suit your own needs. - */ -#ifndef PNGARG - -#ifdef OF /* zlib prototype munger */ -# define PNGARG(arglist) OF(arglist) -#else - -#ifdef _NO_PROTO -# define PNGARG(arglist) () -# ifndef PNG_TYPECAST_NULL -# define PNG_TYPECAST_NULL -# endif -#else -# define PNGARG(arglist) arglist -#endif /* _NO_PROTO */ - - -#endif /* OF */ - -#endif /* PNGARG */ - -/* Try to determine if we are compiling on a Mac. Note that testing for - * just __MWERKS__ is not good enough, because the Codewarrior is now used - * on non-Mac platforms. - */ -#ifndef MACOS -# if (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \ - defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC) -# define MACOS -# endif -#endif - -/* enough people need this for various reasons to include it here */ -#if !defined(MACOS) && !defined(RISCOS) && !defined(_WIN32_WCE) -# include <sys/types.h> -#endif - -#if !defined(PNG_SETJMP_NOT_SUPPORTED) && !defined(PNG_NO_SETJMP_SUPPORTED) -# define PNG_SETJMP_SUPPORTED -#endif - -#ifdef PNG_SETJMP_SUPPORTED -/* This is an attempt to force a single setjmp behaviour on Linux. If - * the X config stuff didn't define _BSD_SOURCE we wouldn't need this. - * - * You can bypass this test if you know that your application uses exactly - * the same setjmp.h that was included when libpng was built. Only define - * PNG_SKIP_SETJMP_CHECK while building your application, prior to the - * application's '#include "png.h"'. Don't define PNG_SKIP_SETJMP_CHECK - * while building a separate libpng library for general use. - */ - -# ifndef PNG_SKIP_SETJMP_CHECK -# ifdef __linux__ -# ifdef _BSD_SOURCE -# define PNG_SAVE_BSD_SOURCE -# undef _BSD_SOURCE -# endif -# ifdef _SETJMP_H - /* If you encounter a compiler error here, see the explanation - * near the end of INSTALL. - */ - __pngconf.h__ in libpng already includes setjmp.h; - __dont__ include it again.; -# endif -# endif /* __linux__ */ -# endif /* PNG_SKIP_SETJMP_CHECK */ - - /* include setjmp.h for error handling */ -# include <setjmp.h> - -# ifdef __linux__ -# ifdef PNG_SAVE_BSD_SOURCE -# ifndef _BSD_SOURCE -# define _BSD_SOURCE -# endif -# undef PNG_SAVE_BSD_SOURCE -# endif -# endif /* __linux__ */ -#endif /* PNG_SETJMP_SUPPORTED */ - -#ifdef BSD -# include <strings.h> -#else -# include <string.h> -#endif - -/* Other defines for things like memory and the like can go here. */ -#ifdef PNG_INTERNAL - -#include <stdlib.h> - -/* The functions exported by PNG_EXTERN are PNG_INTERNAL functions, which - * aren't usually used outside the library (as far as I know), so it is - * debatable if they should be exported at all. In the future, when it is - * possible to have run-time registry of chunk-handling functions, some of - * these will be made available again. -#define PNG_EXTERN extern - */ -#define PNG_EXTERN - -/* Other defines specific to compilers can go here. Try to keep - * them inside an appropriate ifdef/endif pair for portability. - */ - -#ifdef PNG_FLOATING_POINT_SUPPORTED -# ifdef MACOS - /* We need to check that <math.h> hasn't already been included earlier - * as it seems it doesn't agree with <fp.h>, yet we should really use - * <fp.h> if possible. - */ -# if !defined(__MATH_H__) && !defined(__MATH_H) && !defined(__cmath__) -# include <fp.h> -# endif -# else -# include <math.h> -# endif -# if defined(_AMIGA) && defined(__SASC) && defined(_M68881) - /* Amiga SAS/C: We must include builtin FPU functions when compiling using - * MATH=68881 - */ -# include <m68881.h> -# endif -#endif - -/* Codewarrior on NT has linking problems without this. */ -#if (defined(__MWERKS__) && defined(WIN32)) || defined(__STDC__) -# define PNG_ALWAYS_EXTERN -#endif - -/* This provides the non-ANSI (far) memory allocation routines. */ -#if defined(__TURBOC__) && defined(__MSDOS__) -# include <mem.h> -# include <alloc.h> -#endif - -/* I have no idea why is this necessary... */ -#if defined(_MSC_VER) && (defined(WIN32) || defined(_Windows) || \ - defined(_WINDOWS) || defined(_WIN32) || defined(__WIN32__)) -# include <malloc.h> -#endif - -/* This controls how fine the dithering gets. As this allocates - * a largish chunk of memory (32K), those who are not as concerned - * with dithering quality can decrease some or all of these. - */ -#ifndef PNG_DITHER_RED_BITS -# define PNG_DITHER_RED_BITS 5 -#endif -#ifndef PNG_DITHER_GREEN_BITS -# define PNG_DITHER_GREEN_BITS 5 -#endif -#ifndef PNG_DITHER_BLUE_BITS -# define PNG_DITHER_BLUE_BITS 5 -#endif - -/* This controls how fine the gamma correction becomes when you - * are only interested in 8 bits anyway. Increasing this value - * results in more memory being used, and more pow() functions - * being called to fill in the gamma tables. Don't set this value - * less then 8, and even that may not work (I haven't tested it). - */ - -#ifndef PNG_MAX_GAMMA_8 -# define PNG_MAX_GAMMA_8 11 -#endif - -/* This controls how much a difference in gamma we can tolerate before - * we actually start doing gamma conversion. - */ -#ifndef PNG_GAMMA_THRESHOLD -# define PNG_GAMMA_THRESHOLD 0.05 -#endif - -#endif /* PNG_INTERNAL */ - -/* The following uses const char * instead of char * for error - * and warning message functions, so some compilers won't complain. - * If you do not want to use const, define PNG_NO_CONST here. - */ - -#ifndef PNG_NO_CONST -# define PNG_CONST const -#else -# define PNG_CONST -#endif - -/* The following defines give you the ability to remove code from the - * library that you will not be using. I wish I could figure out how to - * automate this, but I can't do that without making it seriously hard - * on the users. So if you are not using an ability, change the #define - * to and #undef, and that part of the library will not be compiled. If - * your linker can't find a function, you may want to make sure the - * ability is defined here. Some of these depend upon some others being - * defined. I haven't figured out all the interactions here, so you may - * have to experiment awhile to get everything to compile. If you are - * creating or using a shared library, you probably shouldn't touch this, - * as it will affect the size of the structures, and this will cause bad - * things to happen if the library and/or application ever change. - */ - -/* Any features you will not be using can be undef'ed here */ - -/* GR-P, 0.96a: Set "*TRANSFORMS_SUPPORTED as default but allow user - * to turn it off with "*TRANSFORMS_NOT_SUPPORTED" or *PNG_NO_*_TRANSFORMS - * on the compile line, then pick and choose which ones to define without - * having to edit this file. It is safe to use the *TRANSFORMS_NOT_SUPPORTED - * if you only want to have a png-compliant reader/writer but don't need - * any of the extra transformations. This saves about 80 kbytes in a - * typical installation of the library. (PNG_NO_* form added in version - * 1.0.1c, for consistency) - */ - -/* The size of the png_text structure changed in libpng-1.0.6 when - * iTXt support was added. iTXt support was turned off by default through - * libpng-1.2.x, to support old apps that malloc the png_text structure - * instead of calling png_set_text() and letting libpng malloc it. It - * will be turned on by default in libpng-1.4.0. - */ - -#if defined(PNG_1_0_X) || defined (PNG_1_2_X) -# ifndef PNG_NO_iTXt_SUPPORTED -# define PNG_NO_iTXt_SUPPORTED -# endif -# ifndef PNG_NO_READ_iTXt -# define PNG_NO_READ_iTXt -# endif -# ifndef PNG_NO_WRITE_iTXt -# define PNG_NO_WRITE_iTXt -# endif -#endif - -#if !defined(PNG_NO_iTXt_SUPPORTED) -# if !defined(PNG_READ_iTXt_SUPPORTED) && !defined(PNG_NO_READ_iTXt) -# define PNG_READ_iTXt -# endif -# if !defined(PNG_WRITE_iTXt_SUPPORTED) && !defined(PNG_NO_WRITE_iTXt) -# define PNG_WRITE_iTXt -# endif -#endif - -/* The following support, added after version 1.0.0, can be turned off here en - * masse by defining PNG_LEGACY_SUPPORTED in case you need binary compatibility - * with old applications that require the length of png_struct and png_info - * to remain unchanged. - */ - -#ifdef PNG_LEGACY_SUPPORTED -# define PNG_NO_FREE_ME -# define PNG_NO_READ_UNKNOWN_CHUNKS -# define PNG_NO_WRITE_UNKNOWN_CHUNKS -# define PNG_NO_HANDLE_AS_UNKNOWN -# define PNG_NO_READ_USER_CHUNKS -# define PNG_NO_READ_iCCP -# define PNG_NO_WRITE_iCCP -# define PNG_NO_READ_iTXt -# define PNG_NO_WRITE_iTXt -# define PNG_NO_READ_sCAL -# define PNG_NO_WRITE_sCAL -# define PNG_NO_READ_sPLT -# define PNG_NO_WRITE_sPLT -# define PNG_NO_INFO_IMAGE -# define PNG_NO_READ_RGB_TO_GRAY -# define PNG_NO_READ_USER_TRANSFORM -# define PNG_NO_WRITE_USER_TRANSFORM -# define PNG_NO_USER_MEM -# define PNG_NO_READ_EMPTY_PLTE -# define PNG_NO_MNG_FEATURES -# define PNG_NO_FIXED_POINT_SUPPORTED -#endif - -/* Ignore attempt to turn off both floating and fixed point support */ -#if !defined(PNG_FLOATING_POINT_SUPPORTED) || \ - !defined(PNG_NO_FIXED_POINT_SUPPORTED) -# define PNG_FIXED_POINT_SUPPORTED -#endif - -#ifndef PNG_NO_FREE_ME -# define PNG_FREE_ME_SUPPORTED -#endif - -#ifdef PNG_READ_SUPPORTED - -#if !defined(PNG_READ_TRANSFORMS_NOT_SUPPORTED) && \ - !defined(PNG_NO_READ_TRANSFORMS) -# define PNG_READ_TRANSFORMS_SUPPORTED -#endif - -#ifdef PNG_READ_TRANSFORMS_SUPPORTED -# ifndef PNG_NO_READ_EXPAND -# define PNG_READ_EXPAND_SUPPORTED -# endif -# ifndef PNG_NO_READ_SHIFT -# define PNG_READ_SHIFT_SUPPORTED -# endif -# ifndef PNG_NO_READ_PACK -# define PNG_READ_PACK_SUPPORTED -# endif -# ifndef PNG_NO_READ_BGR -# define PNG_READ_BGR_SUPPORTED -# endif -# ifndef PNG_NO_READ_SWAP -# define PNG_READ_SWAP_SUPPORTED -# endif -# ifndef PNG_NO_READ_PACKSWAP -# define PNG_READ_PACKSWAP_SUPPORTED -# endif -# ifndef PNG_NO_READ_INVERT -# define PNG_READ_INVERT_SUPPORTED -# endif -# ifndef PNG_NO_READ_DITHER -# define PNG_READ_DITHER_SUPPORTED -# endif -# ifndef PNG_NO_READ_BACKGROUND -# define PNG_READ_BACKGROUND_SUPPORTED -# endif -# ifndef PNG_NO_READ_16_TO_8 -# define PNG_READ_16_TO_8_SUPPORTED -# endif -# ifndef PNG_NO_READ_FILLER -# define PNG_READ_FILLER_SUPPORTED -# endif -# ifndef PNG_NO_READ_GAMMA -# define PNG_READ_GAMMA_SUPPORTED -# endif -# ifndef PNG_NO_READ_GRAY_TO_RGB -# define PNG_READ_GRAY_TO_RGB_SUPPORTED -# endif -# ifndef PNG_NO_READ_SWAP_ALPHA -# define PNG_READ_SWAP_ALPHA_SUPPORTED -# endif -# ifndef PNG_NO_READ_INVERT_ALPHA -# define PNG_READ_INVERT_ALPHA_SUPPORTED -# endif -# ifndef PNG_NO_READ_STRIP_ALPHA -# define PNG_READ_STRIP_ALPHA_SUPPORTED -# endif -# ifndef PNG_NO_READ_USER_TRANSFORM -# define PNG_READ_USER_TRANSFORM_SUPPORTED -# endif -# ifndef PNG_NO_READ_RGB_TO_GRAY -# define PNG_READ_RGB_TO_GRAY_SUPPORTED -# endif -#endif /* PNG_READ_TRANSFORMS_SUPPORTED */ - -/* PNG_PROGRESSIVE_READ_NOT_SUPPORTED is deprecated. */ -#if !defined(PNG_NO_PROGRESSIVE_READ) && \ - !defined(PNG_PROGRESSIVE_READ_NOT_SUPPORTED) /* if you don't do progressive */ -# define PNG_PROGRESSIVE_READ_SUPPORTED /* reading. This is not talking */ -#endif /* about interlacing capability! You'll */ - /* still have interlacing unless you change the following define: */ -#define PNG_READ_INTERLACING_SUPPORTED /* required for PNG-compliant decoders */ - -/* PNG_NO_SEQUENTIAL_READ_SUPPORTED is deprecated. */ -#if !defined(PNG_NO_SEQUENTIAL_READ) && \ - !defined(PNG_SEQUENTIAL_READ_SUPPORTED) && \ - !defined(PNG_NO_SEQUENTIAL_READ_SUPPORTED) -# define PNG_SEQUENTIAL_READ_SUPPORTED -#endif - -#define PNG_READ_INTERLACING_SUPPORTED /* required in PNG-compliant decoders */ - -#ifndef PNG_NO_READ_COMPOSITE_NODIV -# ifndef PNG_NO_READ_COMPOSITED_NODIV /* libpng-1.0.x misspelling */ -# define PNG_READ_COMPOSITE_NODIV_SUPPORTED /* well tested on Intel, SGI */ -# endif -#endif - -#if defined(PNG_1_0_X) || defined (PNG_1_2_X) -/* Deprecated, will be removed from version 2.0.0. - Use PNG_MNG_FEATURES_SUPPORTED instead. */ -#ifndef PNG_NO_READ_EMPTY_PLTE -# define PNG_READ_EMPTY_PLTE_SUPPORTED -#endif -#endif - -#endif /* PNG_READ_SUPPORTED */ - -#ifdef PNG_WRITE_SUPPORTED - -# if !defined(PNG_WRITE_TRANSFORMS_NOT_SUPPORTED) && \ - !defined(PNG_NO_WRITE_TRANSFORMS) -# define PNG_WRITE_TRANSFORMS_SUPPORTED -#endif - -#ifdef PNG_WRITE_TRANSFORMS_SUPPORTED -# ifndef PNG_NO_WRITE_SHIFT -# define PNG_WRITE_SHIFT_SUPPORTED -# endif -# ifndef PNG_NO_WRITE_PACK -# define PNG_WRITE_PACK_SUPPORTED -# endif -# ifndef PNG_NO_WRITE_BGR -# define PNG_WRITE_BGR_SUPPORTED -# endif -# ifndef PNG_NO_WRITE_SWAP -# define PNG_WRITE_SWAP_SUPPORTED -# endif -# ifndef PNG_NO_WRITE_PACKSWAP -# define PNG_WRITE_PACKSWAP_SUPPORTED -# endif -# ifndef PNG_NO_WRITE_INVERT -# define PNG_WRITE_INVERT_SUPPORTED -# endif -# ifndef PNG_NO_WRITE_FILLER -# define PNG_WRITE_FILLER_SUPPORTED /* same as WRITE_STRIP_ALPHA */ -# endif -# ifndef PNG_NO_WRITE_SWAP_ALPHA -# define PNG_WRITE_SWAP_ALPHA_SUPPORTED -# endif -#ifndef PNG_1_0_X -# ifndef PNG_NO_WRITE_INVERT_ALPHA -# define PNG_WRITE_INVERT_ALPHA_SUPPORTED -# endif -#endif -# ifndef PNG_NO_WRITE_USER_TRANSFORM -# define PNG_WRITE_USER_TRANSFORM_SUPPORTED -# endif -#endif /* PNG_WRITE_TRANSFORMS_SUPPORTED */ - -#if !defined(PNG_NO_WRITE_INTERLACING_SUPPORTED) && \ - !defined(PNG_WRITE_INTERLACING_SUPPORTED) -#define PNG_WRITE_INTERLACING_SUPPORTED /* not required for PNG-compliant - encoders, but can cause trouble - if left undefined */ -#endif - -#if !defined(PNG_NO_WRITE_WEIGHTED_FILTER) && \ - !defined(PNG_WRITE_WEIGHTED_FILTER) && \ - defined(PNG_FLOATING_POINT_SUPPORTED) -# define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED -#endif - -#ifndef PNG_NO_WRITE_FLUSH -# define PNG_WRITE_FLUSH_SUPPORTED -#endif - -#if defined(PNG_1_0_X) || defined (PNG_1_2_X) -/* Deprecated, see PNG_MNG_FEATURES_SUPPORTED, above */ -#ifndef PNG_NO_WRITE_EMPTY_PLTE -# define PNG_WRITE_EMPTY_PLTE_SUPPORTED -#endif -#endif - -#endif /* PNG_WRITE_SUPPORTED */ - -#ifndef PNG_1_0_X -# ifndef PNG_NO_ERROR_NUMBERS -# define PNG_ERROR_NUMBERS_SUPPORTED -# endif -#endif /* PNG_1_0_X */ - -#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ - defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) -# ifndef PNG_NO_USER_TRANSFORM_PTR -# define PNG_USER_TRANSFORM_PTR_SUPPORTED -# endif -#endif - -#ifndef PNG_NO_STDIO -# define PNG_TIME_RFC1123_SUPPORTED -#endif - -/* This adds extra functions in pngget.c for accessing data from the - * info pointer (added in version 0.99) - * png_get_image_width() - * png_get_image_height() - * png_get_bit_depth() - * png_get_color_type() - * png_get_compression_type() - * png_get_filter_type() - * png_get_interlace_type() - * png_get_pixel_aspect_ratio() - * png_get_pixels_per_meter() - * png_get_x_offset_pixels() - * png_get_y_offset_pixels() - * png_get_x_offset_microns() - * png_get_y_offset_microns() - */ -#if !defined(PNG_NO_EASY_ACCESS) && !defined(PNG_EASY_ACCESS_SUPPORTED) -# define PNG_EASY_ACCESS_SUPPORTED -#endif - -/* PNG_ASSEMBLER_CODE was enabled by default in version 1.2.0 - * and removed from version 1.2.20. The following will be removed - * from libpng-1.4.0 -*/ - -#if defined(PNG_READ_SUPPORTED) && !defined(PNG_NO_OPTIMIZED_CODE) -# ifndef PNG_OPTIMIZED_CODE_SUPPORTED -# define PNG_OPTIMIZED_CODE_SUPPORTED -# endif -#endif - -#if defined(PNG_READ_SUPPORTED) && !defined(PNG_NO_ASSEMBLER_CODE) -# ifndef PNG_ASSEMBLER_CODE_SUPPORTED -# define PNG_ASSEMBLER_CODE_SUPPORTED -# endif - -# if defined(__GNUC__) && defined(__x86_64__) && (__GNUC__ < 4) - /* work around 64-bit gcc compiler bugs in gcc-3.x */ -# if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE) -# define PNG_NO_MMX_CODE -# endif -# endif - -# ifdef __APPLE__ -# if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE) -# define PNG_NO_MMX_CODE -# endif -# endif - -# if (defined(__MWERKS__) && ((__MWERKS__ < 0x0900) || macintosh)) -# if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE) -# define PNG_NO_MMX_CODE -# endif -# endif - -# if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE) -# define PNG_MMX_CODE_SUPPORTED -# endif - -#endif -/* end of obsolete code to be removed from libpng-1.4.0 */ - -/* Added at libpng-1.2.0 */ -#ifndef PNG_1_0_X -#if !defined(PNG_NO_USER_MEM) && !defined(PNG_USER_MEM_SUPPORTED) -# define PNG_USER_MEM_SUPPORTED -#endif -#endif /* PNG_1_0_X */ - -/* Added at libpng-1.2.6 */ -#ifndef PNG_1_0_X -# ifndef PNG_SET_USER_LIMITS_SUPPORTED -# ifndef PNG_NO_SET_USER_LIMITS -# define PNG_SET_USER_LIMITS_SUPPORTED -# endif -# endif -#endif /* PNG_1_0_X */ - -/* Added at libpng-1.0.53 and 1.2.43 */ -#ifndef PNG_USER_LIMITS_SUPPORTED -# ifndef PNG_NO_USER_LIMITS -# define PNG_USER_LIMITS_SUPPORTED -# endif -#endif - -/* Added at libpng-1.0.16 and 1.2.6. To accept all valid PNGS no matter - * how large, set these limits to 0x7fffffffL - */ -#ifndef PNG_USER_WIDTH_MAX -# define PNG_USER_WIDTH_MAX 1000000L -#endif -#ifndef PNG_USER_HEIGHT_MAX -# define PNG_USER_HEIGHT_MAX 1000000L -#endif - -/* Added at libpng-1.2.43. To accept all valid PNGs no matter - * how large, set these two limits to 0. - */ -#ifndef PNG_USER_CHUNK_CACHE_MAX -# define PNG_USER_CHUNK_CACHE_MAX 0 -#endif - -/* Added at libpng-1.2.43 */ -#ifndef PNG_USER_CHUNK_MALLOC_MAX -# define PNG_USER_CHUNK_MALLOC_MAX 0 -#endif - -#ifndef PNG_LITERAL_SHARP -# define PNG_LITERAL_SHARP 0x23 -#endif -#ifndef PNG_LITERAL_LEFT_SQUARE_BRACKET -# define PNG_LITERAL_LEFT_SQUARE_BRACKET 0x5b -#endif -#ifndef PNG_LITERAL_RIGHT_SQUARE_BRACKET -# define PNG_LITERAL_RIGHT_SQUARE_BRACKET 0x5d -#endif - -/* Added at libpng-1.2.34 */ -#ifndef PNG_STRING_NEWLINE -#define PNG_STRING_NEWLINE "\n" -#endif - -/* These are currently experimental features, define them if you want */ - -/* very little testing */ -/* -#ifdef PNG_READ_SUPPORTED -# ifndef PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED -# define PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED -# endif -#endif -*/ - -/* This is only for PowerPC big-endian and 680x0 systems */ -/* some testing */ -/* -#ifndef PNG_READ_BIG_ENDIAN_SUPPORTED -# define PNG_READ_BIG_ENDIAN_SUPPORTED -#endif -*/ - -/* Buggy compilers (e.g., gcc 2.7.2.2) need this */ -/* -#define PNG_NO_POINTER_INDEXING -*/ - -#if !defined(PNG_NO_POINTER_INDEXING) && \ - !defined(PNG_POINTER_INDEXING_SUPPORTED) -# define PNG_POINTER_INDEXING_SUPPORTED -#endif - -/* These functions are turned off by default, as they will be phased out. */ -/* -#define PNG_USELESS_TESTS_SUPPORTED -#define PNG_CORRECT_PALETTE_SUPPORTED -*/ - -/* Any chunks you are not interested in, you can undef here. The - * ones that allocate memory may be expecially important (hIST, - * tEXt, zTXt, tRNS, pCAL). Others will just save time and make png_info - * a bit smaller. - */ - -#if defined(PNG_READ_SUPPORTED) && \ - !defined(PNG_READ_ANCILLARY_CHUNKS_NOT_SUPPORTED) && \ - !defined(PNG_NO_READ_ANCILLARY_CHUNKS) -# define PNG_READ_ANCILLARY_CHUNKS_SUPPORTED -#endif - -#if defined(PNG_WRITE_SUPPORTED) && \ - !defined(PNG_WRITE_ANCILLARY_CHUNKS_NOT_SUPPORTED) && \ - !defined(PNG_NO_WRITE_ANCILLARY_CHUNKS) -# define PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED -#endif - -#ifdef PNG_READ_ANCILLARY_CHUNKS_SUPPORTED - -#ifdef PNG_NO_READ_TEXT -# define PNG_NO_READ_iTXt -# define PNG_NO_READ_tEXt -# define PNG_NO_READ_zTXt -#endif -#ifndef PNG_NO_READ_bKGD -# define PNG_READ_bKGD_SUPPORTED -# define PNG_bKGD_SUPPORTED -#endif -#ifndef PNG_NO_READ_cHRM -# define PNG_READ_cHRM_SUPPORTED -# define PNG_cHRM_SUPPORTED -#endif -#ifndef PNG_NO_READ_gAMA -# define PNG_READ_gAMA_SUPPORTED -# define PNG_gAMA_SUPPORTED -#endif -#ifndef PNG_NO_READ_hIST -# define PNG_READ_hIST_SUPPORTED -# define PNG_hIST_SUPPORTED -#endif -#ifndef PNG_NO_READ_iCCP -# define PNG_READ_iCCP_SUPPORTED -# define PNG_iCCP_SUPPORTED -#endif -#ifndef PNG_NO_READ_iTXt -# ifndef PNG_READ_iTXt_SUPPORTED -# define PNG_READ_iTXt_SUPPORTED -# endif -# ifndef PNG_iTXt_SUPPORTED -# define PNG_iTXt_SUPPORTED -# endif -#endif -#ifndef PNG_NO_READ_oFFs -# define PNG_READ_oFFs_SUPPORTED -# define PNG_oFFs_SUPPORTED -#endif -#ifndef PNG_NO_READ_pCAL -# define PNG_READ_pCAL_SUPPORTED -# define PNG_pCAL_SUPPORTED -#endif -#ifndef PNG_NO_READ_sCAL -# define PNG_READ_sCAL_SUPPORTED -# define PNG_sCAL_SUPPORTED -#endif -#ifndef PNG_NO_READ_pHYs -# define PNG_READ_pHYs_SUPPORTED -# define PNG_pHYs_SUPPORTED -#endif -#ifndef PNG_NO_READ_sBIT -# define PNG_READ_sBIT_SUPPORTED -# define PNG_sBIT_SUPPORTED -#endif -#ifndef PNG_NO_READ_sPLT -# define PNG_READ_sPLT_SUPPORTED -# define PNG_sPLT_SUPPORTED -#endif -#ifndef PNG_NO_READ_sRGB -# define PNG_READ_sRGB_SUPPORTED -# define PNG_sRGB_SUPPORTED -#endif -#ifndef PNG_NO_READ_tEXt -# define PNG_READ_tEXt_SUPPORTED -# define PNG_tEXt_SUPPORTED -#endif -#ifndef PNG_NO_READ_tIME -# define PNG_READ_tIME_SUPPORTED -# define PNG_tIME_SUPPORTED -#endif -#ifndef PNG_NO_READ_tRNS -# define PNG_READ_tRNS_SUPPORTED -# define PNG_tRNS_SUPPORTED -#endif -#ifndef PNG_NO_READ_zTXt -# define PNG_READ_zTXt_SUPPORTED -# define PNG_zTXt_SUPPORTED -#endif -#ifndef PNG_NO_READ_OPT_PLTE -# define PNG_READ_OPT_PLTE_SUPPORTED /* only affects support of the */ -#endif /* optional PLTE chunk in RGB and RGBA images */ -#if defined(PNG_READ_iTXt_SUPPORTED) || defined(PNG_READ_tEXt_SUPPORTED) || \ - defined(PNG_READ_zTXt_SUPPORTED) -# define PNG_READ_TEXT_SUPPORTED -# define PNG_TEXT_SUPPORTED -#endif - -#endif /* PNG_READ_ANCILLARY_CHUNKS_SUPPORTED */ - -#ifndef PNG_NO_READ_UNKNOWN_CHUNKS -# define PNG_READ_UNKNOWN_CHUNKS_SUPPORTED -# ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED -# define PNG_UNKNOWN_CHUNKS_SUPPORTED -# endif -#endif -#if !defined(PNG_NO_READ_USER_CHUNKS) && \ - defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED) -# define PNG_READ_USER_CHUNKS_SUPPORTED -# define PNG_USER_CHUNKS_SUPPORTED -# ifdef PNG_NO_READ_UNKNOWN_CHUNKS -# undef PNG_NO_READ_UNKNOWN_CHUNKS -# endif -# ifdef PNG_NO_HANDLE_AS_UNKNOWN -# undef PNG_NO_HANDLE_AS_UNKNOWN -# endif -#endif - -#ifndef PNG_NO_HANDLE_AS_UNKNOWN -# ifndef PNG_HANDLE_AS_UNKNOWN_SUPPORTED -# define PNG_HANDLE_AS_UNKNOWN_SUPPORTED -# endif -#endif - -#ifdef PNG_WRITE_SUPPORTED -#ifdef PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED - -#ifdef PNG_NO_WRITE_TEXT -# define PNG_NO_WRITE_iTXt -# define PNG_NO_WRITE_tEXt -# define PNG_NO_WRITE_zTXt -#endif -#ifndef PNG_NO_WRITE_bKGD -# define PNG_WRITE_bKGD_SUPPORTED -# ifndef PNG_bKGD_SUPPORTED -# define PNG_bKGD_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_cHRM -# define PNG_WRITE_cHRM_SUPPORTED -# ifndef PNG_cHRM_SUPPORTED -# define PNG_cHRM_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_gAMA -# define PNG_WRITE_gAMA_SUPPORTED -# ifndef PNG_gAMA_SUPPORTED -# define PNG_gAMA_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_hIST -# define PNG_WRITE_hIST_SUPPORTED -# ifndef PNG_hIST_SUPPORTED -# define PNG_hIST_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_iCCP -# define PNG_WRITE_iCCP_SUPPORTED -# ifndef PNG_iCCP_SUPPORTED -# define PNG_iCCP_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_iTXt -# ifndef PNG_WRITE_iTXt_SUPPORTED -# define PNG_WRITE_iTXt_SUPPORTED -# endif -# ifndef PNG_iTXt_SUPPORTED -# define PNG_iTXt_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_oFFs -# define PNG_WRITE_oFFs_SUPPORTED -# ifndef PNG_oFFs_SUPPORTED -# define PNG_oFFs_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_pCAL -# define PNG_WRITE_pCAL_SUPPORTED -# ifndef PNG_pCAL_SUPPORTED -# define PNG_pCAL_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_sCAL -# define PNG_WRITE_sCAL_SUPPORTED -# ifndef PNG_sCAL_SUPPORTED -# define PNG_sCAL_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_pHYs -# define PNG_WRITE_pHYs_SUPPORTED -# ifndef PNG_pHYs_SUPPORTED -# define PNG_pHYs_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_sBIT -# define PNG_WRITE_sBIT_SUPPORTED -# ifndef PNG_sBIT_SUPPORTED -# define PNG_sBIT_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_sPLT -# define PNG_WRITE_sPLT_SUPPORTED -# ifndef PNG_sPLT_SUPPORTED -# define PNG_sPLT_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_sRGB -# define PNG_WRITE_sRGB_SUPPORTED -# ifndef PNG_sRGB_SUPPORTED -# define PNG_sRGB_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_tEXt -# define PNG_WRITE_tEXt_SUPPORTED -# ifndef PNG_tEXt_SUPPORTED -# define PNG_tEXt_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_tIME -# define PNG_WRITE_tIME_SUPPORTED -# ifndef PNG_tIME_SUPPORTED -# define PNG_tIME_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_tRNS -# define PNG_WRITE_tRNS_SUPPORTED -# ifndef PNG_tRNS_SUPPORTED -# define PNG_tRNS_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_zTXt -# define PNG_WRITE_zTXt_SUPPORTED -# ifndef PNG_zTXt_SUPPORTED -# define PNG_zTXt_SUPPORTED -# endif -#endif -#if defined(PNG_WRITE_iTXt_SUPPORTED) || defined(PNG_WRITE_tEXt_SUPPORTED) || \ - defined(PNG_WRITE_zTXt_SUPPORTED) -# define PNG_WRITE_TEXT_SUPPORTED -# ifndef PNG_TEXT_SUPPORTED -# define PNG_TEXT_SUPPORTED -# endif -#endif - -#ifdef PNG_WRITE_tIME_SUPPORTED -# ifndef PNG_NO_CONVERT_tIME -# ifndef _WIN32_WCE -/* The "tm" structure is not supported on WindowsCE */ -# ifndef PNG_CONVERT_tIME_SUPPORTED -# define PNG_CONVERT_tIME_SUPPORTED -# endif -# endif -# endif -#endif - -#endif /* PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED */ - -#if !defined(PNG_NO_WRITE_FILTER) && !defined(PNG_WRITE_FILTER_SUPPORTED) -# define PNG_WRITE_FILTER_SUPPORTED -#endif - -#ifndef PNG_NO_WRITE_UNKNOWN_CHUNKS -# define PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED -# ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED -# define PNG_UNKNOWN_CHUNKS_SUPPORTED -# endif -#endif - -#ifndef PNG_NO_HANDLE_AS_UNKNOWN -# ifndef PNG_HANDLE_AS_UNKNOWN_SUPPORTED -# define PNG_HANDLE_AS_UNKNOWN_SUPPORTED -# endif -#endif -#endif /* PNG_WRITE_SUPPORTED */ - -/* Turn this off to disable png_read_png() and - * png_write_png() and leave the row_pointers member - * out of the info structure. - */ -#ifndef PNG_NO_INFO_IMAGE -# define PNG_INFO_IMAGE_SUPPORTED -#endif - -/* Need the time information for converting tIME chunks */ -#ifdef PNG_CONVERT_tIME_SUPPORTED - /* "time.h" functions are not supported on WindowsCE */ -# include <time.h> -#endif - -/* Some typedefs to get us started. These should be safe on most of the - * common platforms. The typedefs should be at least as large as the - * numbers suggest (a png_uint_32 must be at least 32 bits long), but they - * don't have to be exactly that size. Some compilers dislike passing - * unsigned shorts as function parameters, so you may be better off using - * unsigned int for png_uint_16. Likewise, for 64-bit systems, you may - * want to have unsigned int for png_uint_32 instead of unsigned long. - */ - -typedef unsigned long png_uint_32; -typedef long png_int_32; -typedef unsigned short png_uint_16; -typedef short png_int_16; -typedef unsigned char png_byte; - -/* This is usually size_t. It is typedef'ed just in case you need it to - change (I'm not sure if you will or not, so I thought I'd be safe) */ -#ifdef PNG_SIZE_T - typedef PNG_SIZE_T png_size_t; -# define png_sizeof(x) png_convert_size(sizeof(x)) -#else - typedef size_t png_size_t; -# define png_sizeof(x) sizeof(x) -#endif - -/* The following is needed for medium model support. It cannot be in the - * PNG_INTERNAL section. Needs modification for other compilers besides - * MSC. Model independent support declares all arrays and pointers to be - * large using the far keyword. The zlib version used must also support - * model independent data. As of version zlib 1.0.4, the necessary changes - * have been made in zlib. The USE_FAR_KEYWORD define triggers other - * changes that are needed. (Tim Wegner) - */ - -/* Separate compiler dependencies (problem here is that zlib.h always - defines FAR. (SJT) */ -#ifdef __BORLANDC__ -# if defined(__LARGE__) || defined(__HUGE__) || defined(__COMPACT__) -# define LDATA 1 -# else -# define LDATA 0 -# endif - /* GRR: why is Cygwin in here? Cygwin is not Borland C... */ -# if !defined(__WIN32__) && !defined(__FLAT__) && !defined(__CYGWIN__) -# define PNG_MAX_MALLOC_64K -# if (LDATA != 1) -# ifndef FAR -# define FAR __far -# endif -# define USE_FAR_KEYWORD -# endif /* LDATA != 1 */ - /* Possibly useful for moving data out of default segment. - * Uncomment it if you want. Could also define FARDATA as - * const if your compiler supports it. (SJT) -# define FARDATA FAR - */ -# endif /* __WIN32__, __FLAT__, __CYGWIN__ */ -#endif /* __BORLANDC__ */ - - -/* Suggest testing for specific compiler first before testing for - * FAR. The Watcom compiler defines both __MEDIUM__ and M_I86MM, - * making reliance oncertain keywords suspect. (SJT) - */ - -/* MSC Medium model */ -#ifdef FAR -# ifdef M_I86MM -# define USE_FAR_KEYWORD -# define FARDATA FAR -# include <dos.h> -# endif -#endif - -/* SJT: default case */ -#ifndef FAR -# define FAR -#endif - -/* At this point FAR is always defined */ -#ifndef FARDATA -# define FARDATA -#endif - -/* Typedef for floating-point numbers that are converted - to fixed-point with a multiple of 100,000, e.g., int_gamma */ -typedef png_int_32 png_fixed_point; - -/* Add typedefs for pointers */ -typedef void FAR * png_voidp; -typedef png_byte FAR * png_bytep; -typedef png_uint_32 FAR * png_uint_32p; -typedef png_int_32 FAR * png_int_32p; -typedef png_uint_16 FAR * png_uint_16p; -typedef png_int_16 FAR * png_int_16p; -typedef PNG_CONST char FAR * png_const_charp; -typedef char FAR * png_charp; -typedef png_fixed_point FAR * png_fixed_point_p; - -#ifndef PNG_NO_STDIO -#ifdef _WIN32_WCE -typedef HANDLE png_FILE_p; -#else -typedef FILE * png_FILE_p; -#endif -#endif - -#ifdef PNG_FLOATING_POINT_SUPPORTED -typedef double FAR * png_doublep; -#endif - -/* Pointers to pointers; i.e. arrays */ -typedef png_byte FAR * FAR * png_bytepp; -typedef png_uint_32 FAR * FAR * png_uint_32pp; -typedef png_int_32 FAR * FAR * png_int_32pp; -typedef png_uint_16 FAR * FAR * png_uint_16pp; -typedef png_int_16 FAR * FAR * png_int_16pp; -typedef PNG_CONST char FAR * FAR * png_const_charpp; -typedef char FAR * FAR * png_charpp; -typedef png_fixed_point FAR * FAR * png_fixed_point_pp; -#ifdef PNG_FLOATING_POINT_SUPPORTED -typedef double FAR * FAR * png_doublepp; -#endif - -/* Pointers to pointers to pointers; i.e., pointer to array */ -typedef char FAR * FAR * FAR * png_charppp; - -#if defined(PNG_1_0_X) || defined(PNG_1_2_X) -/* SPC - Is this stuff deprecated? */ -/* It'll be removed as of libpng-1.4.0 - GR-P */ -/* libpng typedefs for types in zlib. If zlib changes - * or another compression library is used, then change these. - * Eliminates need to change all the source files. - */ -typedef charf * png_zcharp; -typedef charf * FAR * png_zcharpp; -typedef z_stream FAR * png_zstreamp; -#endif /* (PNG_1_0_X) || defined(PNG_1_2_X) */ - -/* - * Define PNG_BUILD_DLL if the module being built is a Windows - * LIBPNG DLL. - * - * Define PNG_USE_DLL if you want to *link* to the Windows LIBPNG DLL. - * It is equivalent to Microsoft predefined macro _DLL that is - * automatically defined when you compile using the share - * version of the CRT (C Run-Time library) - * - * The cygwin mods make this behavior a little different: - * Define PNG_BUILD_DLL if you are building a dll for use with cygwin - * Define PNG_STATIC if you are building a static library for use with cygwin, - * -or- if you are building an application that you want to link to the - * static library. - * PNG_USE_DLL is defined by default (no user action needed) unless one of - * the other flags is defined. - */ - -#if !defined(PNG_DLL) && (defined(PNG_BUILD_DLL) || defined(PNG_USE_DLL)) -# define PNG_DLL -#endif -/* If CYGWIN, then disallow GLOBAL ARRAYS unless building a static lib. - * When building a static lib, default to no GLOBAL ARRAYS, but allow - * command-line override - */ -#ifdef __CYGWIN__ -# ifndef PNG_STATIC -# ifdef PNG_USE_GLOBAL_ARRAYS -# undef PNG_USE_GLOBAL_ARRAYS -# endif -# ifndef PNG_USE_LOCAL_ARRAYS -# define PNG_USE_LOCAL_ARRAYS -# endif -# else -# if defined(PNG_USE_LOCAL_ARRAYS) || defined(PNG_NO_GLOBAL_ARRAYS) -# ifdef PNG_USE_GLOBAL_ARRAYS -# undef PNG_USE_GLOBAL_ARRAYS -# endif -# endif -# endif -# if !defined(PNG_USE_LOCAL_ARRAYS) && !defined(PNG_USE_GLOBAL_ARRAYS) -# define PNG_USE_LOCAL_ARRAYS -# endif -#endif - -/* Do not use global arrays (helps with building DLL's) - * They are no longer used in libpng itself, since version 1.0.5c, - * but might be required for some pre-1.0.5c applications. - */ -#if !defined(PNG_USE_LOCAL_ARRAYS) && !defined(PNG_USE_GLOBAL_ARRAYS) -# if defined(PNG_NO_GLOBAL_ARRAYS) || \ - (defined(__GNUC__) && defined(PNG_DLL)) || defined(_MSC_VER) -# define PNG_USE_LOCAL_ARRAYS -# else -# define PNG_USE_GLOBAL_ARRAYS -# endif -#endif - -#ifdef __CYGWIN__ -# undef PNGAPI -# define PNGAPI __cdecl -# undef PNG_IMPEXP -# define PNG_IMPEXP -#endif - -/* If you define PNGAPI, e.g., with compiler option "-DPNGAPI=__stdcall", - * you may get warnings regarding the linkage of png_zalloc and png_zfree. - * Don't ignore those warnings; you must also reset the default calling - * convention in your compiler to match your PNGAPI, and you must build - * zlib and your applications the same way you build libpng. - */ - -#if defined(__MINGW32__) && !defined(PNG_MODULEDEF) -# ifndef PNG_NO_MODULEDEF -# define PNG_NO_MODULEDEF -# endif -#endif - -#if !defined(PNG_IMPEXP) && defined(PNG_BUILD_DLL) && !defined(PNG_NO_MODULEDEF) -# define PNG_IMPEXP -#endif - -#if defined(PNG_DLL) || defined(_DLL) || defined(__DLL__ ) || \ - (( defined(_Windows) || defined(_WINDOWS) || \ - defined(WIN32) || defined(_WIN32) || defined(__WIN32__) )) - -# ifndef PNGAPI -# if defined(__GNUC__) || (defined (_MSC_VER) && (_MSC_VER >= 800)) -# define PNGAPI __cdecl -# else -# define PNGAPI _cdecl -# endif -# endif - -# if !defined(PNG_IMPEXP) && (!defined(PNG_DLL) || \ - 0 /* WINCOMPILER_WITH_NO_SUPPORT_FOR_DECLIMPEXP */) -# define PNG_IMPEXP -# endif - -# ifndef PNG_IMPEXP - -# define PNG_EXPORT_TYPE1(type,symbol) PNG_IMPEXP type PNGAPI symbol -# define PNG_EXPORT_TYPE2(type,symbol) type PNG_IMPEXP PNGAPI symbol - - /* Borland/Microsoft */ -# if defined(_MSC_VER) || defined(__BORLANDC__) -# if (_MSC_VER >= 800) || (__BORLANDC__ >= 0x500) -# define PNG_EXPORT PNG_EXPORT_TYPE1 -# else -# define PNG_EXPORT PNG_EXPORT_TYPE2 -# ifdef PNG_BUILD_DLL -# define PNG_IMPEXP __export -# else -# define PNG_IMPEXP /*__import */ /* doesn't exist AFAIK in - VC++ */ -# endif /* Exists in Borland C++ for - C++ classes (== huge) */ -# endif -# endif - -# ifndef PNG_IMPEXP -# ifdef PNG_BUILD_DLL -# define PNG_IMPEXP __declspec(dllexport) -# else -# define PNG_IMPEXP __declspec(dllimport) -# endif -# endif -# endif /* PNG_IMPEXP */ -#else /* !(DLL || non-cygwin WINDOWS) */ -# if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__) -# ifndef PNGAPI -# define PNGAPI _System -# endif -# else -# if 0 /* ... other platforms, with other meanings */ -# endif -# endif -#endif - -#ifndef PNGAPI -# define PNGAPI -#endif -#ifndef PNG_IMPEXP -# define PNG_IMPEXP -#endif - -#ifdef PNG_BUILDSYMS -# ifndef PNG_EXPORT -# define PNG_EXPORT(type,symbol) PNG_FUNCTION_EXPORT symbol END -# endif -# ifdef PNG_USE_GLOBAL_ARRAYS -# ifndef PNG_EXPORT_VAR -# define PNG_EXPORT_VAR(type) PNG_DATA_EXPORT -# endif -# endif -#endif - -#ifndef PNG_EXPORT -# define PNG_EXPORT(type,symbol) PNG_IMPEXP type PNGAPI symbol -#endif - -#ifdef PNG_USE_GLOBAL_ARRAYS -# ifndef PNG_EXPORT_VAR -# define PNG_EXPORT_VAR(type) extern PNG_IMPEXP type -# endif -#endif - -#ifdef PNG_PEDANTIC_WARNINGS -# ifndef PNG_PEDANTIC_WARNINGS_SUPPORTED -# define PNG_PEDANTIC_WARNINGS_SUPPORTED -# endif -#endif - -#ifdef PNG_PEDANTIC_WARNINGS_SUPPORTED -/* Support for compiler specific function attributes. These are used - * so that where compiler support is available incorrect use of API - * functions in png.h will generate compiler warnings. Added at libpng - * version 1.2.41. - */ -# ifdef __GNUC__ -# ifndef PNG_USE_RESULT -# define PNG_USE_RESULT __attribute__((__warn_unused_result__)) -# endif -# ifndef PNG_NORETURN -# define PNG_NORETURN __attribute__((__noreturn__)) -# endif -# ifndef PNG_ALLOCATED -# define PNG_ALLOCATED __attribute__((__malloc__)) -# endif - - /* This specifically protects structure members that should only be - * accessed from within the library, therefore should be empty during - * a library build. - */ -# ifndef PNG_DEPRECATED -# define PNG_DEPRECATED __attribute__((__deprecated__)) -# endif -# ifndef PNG_DEPSTRUCT -# define PNG_DEPSTRUCT __attribute__((__deprecated__)) -# endif -# ifndef PNG_PRIVATE -# if 0 /* Doesn't work so we use deprecated instead*/ -# define PNG_PRIVATE \ - __attribute__((warning("This function is not exported by libpng."))) -# else -# define PNG_PRIVATE \ - __attribute__((__deprecated__)) -# endif -# endif /* PNG_PRIVATE */ -# endif /* __GNUC__ */ -#endif /* PNG_PEDANTIC_WARNINGS */ - -#ifndef PNG_DEPRECATED -# define PNG_DEPRECATED /* Use of this function is deprecated */ -#endif -#ifndef PNG_USE_RESULT -# define PNG_USE_RESULT /* The result of this function must be checked */ -#endif -#ifndef PNG_NORETURN -# define PNG_NORETURN /* This function does not return */ -#endif -#ifndef PNG_ALLOCATED -# define PNG_ALLOCATED /* The result of the function is new memory */ -#endif -#ifndef PNG_DEPSTRUCT -# define PNG_DEPSTRUCT /* Access to this struct member is deprecated */ -#endif -#ifndef PNG_PRIVATE -# define PNG_PRIVATE /* This is a private libpng function */ -#endif - -/* User may want to use these so they are not in PNG_INTERNAL. Any library - * functions that are passed far data must be model independent. - */ - -#ifndef PNG_ABORT -# define PNG_ABORT() abort() -#endif - -#ifdef PNG_SETJMP_SUPPORTED -# define png_jmpbuf(png_ptr) ((png_ptr)->jmpbuf) -#else -# define png_jmpbuf(png_ptr) \ - (LIBPNG_WAS_COMPILED_WITH__PNG_SETJMP_NOT_SUPPORTED) -#endif - -#ifdef USE_FAR_KEYWORD /* memory model independent fns */ -/* Use this to make far-to-near assignments */ -# define CHECK 1 -# define NOCHECK 0 -# define CVT_PTR(ptr) (png_far_to_near(png_ptr,ptr,CHECK)) -# define CVT_PTR_NOCHECK(ptr) (png_far_to_near(png_ptr,ptr,NOCHECK)) -# define png_snprintf _fsnprintf /* Added to v 1.2.19 */ -# define png_strlen _fstrlen -# define png_memcmp _fmemcmp /* SJT: added */ -# define png_memcpy _fmemcpy -# define png_memset _fmemset -#else /* Use the usual functions */ -# define CVT_PTR(ptr) (ptr) -# define CVT_PTR_NOCHECK(ptr) (ptr) -# ifndef PNG_NO_SNPRINTF -# ifdef _MSC_VER -# define png_snprintf _snprintf /* Added to v 1.2.19 */ -# define png_snprintf2 _snprintf -# define png_snprintf6 _snprintf -# else -# define png_snprintf snprintf /* Added to v 1.2.19 */ -# define png_snprintf2 snprintf -# define png_snprintf6 snprintf -# endif -# else - /* You don't have or don't want to use snprintf(). Caution: Using - * sprintf instead of snprintf exposes your application to accidental - * or malevolent buffer overflows. If you don't have snprintf() - * as a general rule you should provide one (you can get one from - * Portable OpenSSH). - */ -# define png_snprintf(s1,n,fmt,x1) sprintf(s1,fmt,x1) -# define png_snprintf2(s1,n,fmt,x1,x2) sprintf(s1,fmt,x1,x2) -# define png_snprintf6(s1,n,fmt,x1,x2,x3,x4,x5,x6) \ - sprintf(s1,fmt,x1,x2,x3,x4,x5,x6) -# endif -# define png_strlen strlen -# define png_memcmp memcmp /* SJT: added */ -# define png_memcpy memcpy -# define png_memset memset -#endif -/* End of memory model independent support */ - -/* Just a little check that someone hasn't tried to define something - * contradictory. - */ -#if (PNG_ZBUF_SIZE > 65536L) && defined(PNG_MAX_MALLOC_64K) -# undef PNG_ZBUF_SIZE -# define PNG_ZBUF_SIZE 65536L -#endif - -/* Added at libpng-1.2.8 */ -#endif /* PNG_VERSION_INFO_ONLY */ - -#endif /* PNGCONF_H */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/sqlite3.h.REMOVED.git-id b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/sqlite3.h.REMOVED.git-id deleted file mode 100644 index dea61d08a1..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/sqlite3.h.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -efaf3c8988ab69ebac22bd6699c6311ac7747c5a \ No newline at end of file diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/sqlite3ext.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/sqlite3ext.h deleted file mode 100644 index 5abcde2c8f..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/sqlite3ext.h +++ /dev/null @@ -1,447 +0,0 @@ -/* -** 2006 June 7 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This header file defines the SQLite interface for use by -** shared libraries that want to be imported as extensions into -** an SQLite instance. Shared libraries that intend to be loaded -** as extensions by SQLite should #include this file instead of -** sqlite3.h. -*/ -#ifndef _SQLITE3EXT_H_ -#define _SQLITE3EXT_H_ -#include "sqlite3.h" - -typedef struct sqlite3_api_routines sqlite3_api_routines; - -/* -** The following structure holds pointers to all of the SQLite API -** routines. -** -** WARNING: In order to maintain backwards compatibility, add new -** interfaces to the end of this structure only. If you insert new -** interfaces in the middle of this structure, then older different -** versions of SQLite will not be able to load each others' shared -** libraries! -*/ -struct sqlite3_api_routines { - void * (*aggregate_context)(sqlite3_context*,int nBytes); - int (*aggregate_count)(sqlite3_context*); - int (*bind_blob)(sqlite3_stmt*,int,const void*,int n,void(*)(void*)); - int (*bind_double)(sqlite3_stmt*,int,double); - int (*bind_int)(sqlite3_stmt*,int,int); - int (*bind_int64)(sqlite3_stmt*,int,sqlite_int64); - int (*bind_null)(sqlite3_stmt*,int); - int (*bind_parameter_count)(sqlite3_stmt*); - int (*bind_parameter_index)(sqlite3_stmt*,const char*zName); - const char * (*bind_parameter_name)(sqlite3_stmt*,int); - int (*bind_text)(sqlite3_stmt*,int,const char*,int n,void(*)(void*)); - int (*bind_text16)(sqlite3_stmt*,int,const void*,int,void(*)(void*)); - int (*bind_value)(sqlite3_stmt*,int,const sqlite3_value*); - int (*busy_handler)(sqlite3*,int(*)(void*,int),void*); - int (*busy_timeout)(sqlite3*,int ms); - int (*changes)(sqlite3*); - int (*close)(sqlite3*); - int (*collation_needed)(sqlite3*,void*,void(*)(void*,sqlite3*, - int eTextRep,const char*)); - int (*collation_needed16)(sqlite3*,void*,void(*)(void*,sqlite3*, - int eTextRep,const void*)); - const void * (*column_blob)(sqlite3_stmt*,int iCol); - int (*column_bytes)(sqlite3_stmt*,int iCol); - int (*column_bytes16)(sqlite3_stmt*,int iCol); - int (*column_count)(sqlite3_stmt*pStmt); - const char * (*column_database_name)(sqlite3_stmt*,int); - const void * (*column_database_name16)(sqlite3_stmt*,int); - const char * (*column_decltype)(sqlite3_stmt*,int i); - const void * (*column_decltype16)(sqlite3_stmt*,int); - double (*column_double)(sqlite3_stmt*,int iCol); - int (*column_int)(sqlite3_stmt*,int iCol); - sqlite_int64 (*column_int64)(sqlite3_stmt*,int iCol); - const char * (*column_name)(sqlite3_stmt*,int); - const void * (*column_name16)(sqlite3_stmt*,int); - const char * (*column_origin_name)(sqlite3_stmt*,int); - const void * (*column_origin_name16)(sqlite3_stmt*,int); - const char * (*column_table_name)(sqlite3_stmt*,int); - const void * (*column_table_name16)(sqlite3_stmt*,int); - const unsigned char * (*column_text)(sqlite3_stmt*,int iCol); - const void * (*column_text16)(sqlite3_stmt*,int iCol); - int (*column_type)(sqlite3_stmt*,int iCol); - sqlite3_value* (*column_value)(sqlite3_stmt*,int iCol); - void * (*commit_hook)(sqlite3*,int(*)(void*),void*); - int (*complete)(const char*sql); - int (*complete16)(const void*sql); - int (*create_collation)(sqlite3*,const char*,int,void*, - int(*)(void*,int,const void*,int,const void*)); - int (*create_collation16)(sqlite3*,const void*,int,void*, - int(*)(void*,int,const void*,int,const void*)); - int (*create_function)(sqlite3*,const char*,int,int,void*, - void (*xFunc)(sqlite3_context*,int,sqlite3_value**), - void (*xStep)(sqlite3_context*,int,sqlite3_value**), - void (*xFinal)(sqlite3_context*)); - int (*create_function16)(sqlite3*,const void*,int,int,void*, - void (*xFunc)(sqlite3_context*,int,sqlite3_value**), - void (*xStep)(sqlite3_context*,int,sqlite3_value**), - void (*xFinal)(sqlite3_context*)); - int (*create_module)(sqlite3*,const char*,const sqlite3_module*,void*); - int (*data_count)(sqlite3_stmt*pStmt); - sqlite3 * (*db_handle)(sqlite3_stmt*); - int (*declare_vtab)(sqlite3*,const char*); - int (*enable_shared_cache)(int); - int (*errcode)(sqlite3*db); - const char * (*errmsg)(sqlite3*); - const void * (*errmsg16)(sqlite3*); - int (*exec)(sqlite3*,const char*,sqlite3_callback,void*,char**); - int (*expired)(sqlite3_stmt*); - int (*finalize)(sqlite3_stmt*pStmt); - void (*free)(void*); - void (*free_table)(char**result); - int (*get_autocommit)(sqlite3*); - void * (*get_auxdata)(sqlite3_context*,int); - int (*get_table)(sqlite3*,const char*,char***,int*,int*,char**); - int (*global_recover)(void); - void (*interruptx)(sqlite3*); - sqlite_int64 (*last_insert_rowid)(sqlite3*); - const char * (*libversion)(void); - int (*libversion_number)(void); - void *(*malloc)(int); - char * (*mprintf)(const char*,...); - int (*open)(const char*,sqlite3**); - int (*open16)(const void*,sqlite3**); - int (*prepare)(sqlite3*,const char*,int,sqlite3_stmt**,const char**); - int (*prepare16)(sqlite3*,const void*,int,sqlite3_stmt**,const void**); - void * (*profile)(sqlite3*,void(*)(void*,const char*,sqlite_uint64),void*); - void (*progress_handler)(sqlite3*,int,int(*)(void*),void*); - void *(*realloc)(void*,int); - int (*reset)(sqlite3_stmt*pStmt); - void (*result_blob)(sqlite3_context*,const void*,int,void(*)(void*)); - void (*result_double)(sqlite3_context*,double); - void (*result_error)(sqlite3_context*,const char*,int); - void (*result_error16)(sqlite3_context*,const void*,int); - void (*result_int)(sqlite3_context*,int); - void (*result_int64)(sqlite3_context*,sqlite_int64); - void (*result_null)(sqlite3_context*); - void (*result_text)(sqlite3_context*,const char*,int,void(*)(void*)); - void (*result_text16)(sqlite3_context*,const void*,int,void(*)(void*)); - void (*result_text16be)(sqlite3_context*,const void*,int,void(*)(void*)); - void (*result_text16le)(sqlite3_context*,const void*,int,void(*)(void*)); - void (*result_value)(sqlite3_context*,sqlite3_value*); - void * (*rollback_hook)(sqlite3*,void(*)(void*),void*); - int (*set_authorizer)(sqlite3*,int(*)(void*,int,const char*,const char*, - const char*,const char*),void*); - void (*set_auxdata)(sqlite3_context*,int,void*,void (*)(void*)); - char * (*snprintf)(int,char*,const char*,...); - int (*step)(sqlite3_stmt*); - int (*table_column_metadata)(sqlite3*,const char*,const char*,const char*, - char const**,char const**,int*,int*,int*); - void (*thread_cleanup)(void); - int (*total_changes)(sqlite3*); - void * (*trace)(sqlite3*,void(*xTrace)(void*,const char*),void*); - int (*transfer_bindings)(sqlite3_stmt*,sqlite3_stmt*); - void * (*update_hook)(sqlite3*,void(*)(void*,int ,char const*,char const*, - sqlite_int64),void*); - void * (*user_data)(sqlite3_context*); - const void * (*value_blob)(sqlite3_value*); - int (*value_bytes)(sqlite3_value*); - int (*value_bytes16)(sqlite3_value*); - double (*value_double)(sqlite3_value*); - int (*value_int)(sqlite3_value*); - sqlite_int64 (*value_int64)(sqlite3_value*); - int (*value_numeric_type)(sqlite3_value*); - const unsigned char * (*value_text)(sqlite3_value*); - const void * (*value_text16)(sqlite3_value*); - const void * (*value_text16be)(sqlite3_value*); - const void * (*value_text16le)(sqlite3_value*); - int (*value_type)(sqlite3_value*); - char *(*vmprintf)(const char*,va_list); - /* Added ??? */ - int (*overload_function)(sqlite3*, const char *zFuncName, int nArg); - /* Added by 3.3.13 */ - int (*prepare_v2)(sqlite3*,const char*,int,sqlite3_stmt**,const char**); - int (*prepare16_v2)(sqlite3*,const void*,int,sqlite3_stmt**,const void**); - int (*clear_bindings)(sqlite3_stmt*); - /* Added by 3.4.1 */ - int (*create_module_v2)(sqlite3*,const char*,const sqlite3_module*,void*, - void (*xDestroy)(void *)); - /* Added by 3.5.0 */ - int (*bind_zeroblob)(sqlite3_stmt*,int,int); - int (*blob_bytes)(sqlite3_blob*); - int (*blob_close)(sqlite3_blob*); - int (*blob_open)(sqlite3*,const char*,const char*,const char*,sqlite3_int64, - int,sqlite3_blob**); - int (*blob_read)(sqlite3_blob*,void*,int,int); - int (*blob_write)(sqlite3_blob*,const void*,int,int); - int (*create_collation_v2)(sqlite3*,const char*,int,void*, - int(*)(void*,int,const void*,int,const void*), - void(*)(void*)); - int (*file_control)(sqlite3*,const char*,int,void*); - sqlite3_int64 (*memory_highwater)(int); - sqlite3_int64 (*memory_used)(void); - sqlite3_mutex *(*mutex_alloc)(int); - void (*mutex_enter)(sqlite3_mutex*); - void (*mutex_free)(sqlite3_mutex*); - void (*mutex_leave)(sqlite3_mutex*); - int (*mutex_try)(sqlite3_mutex*); - int (*open_v2)(const char*,sqlite3**,int,const char*); - int (*release_memory)(int); - void (*result_error_nomem)(sqlite3_context*); - void (*result_error_toobig)(sqlite3_context*); - int (*sleep)(int); - void (*soft_heap_limit)(int); - sqlite3_vfs *(*vfs_find)(const char*); - int (*vfs_register)(sqlite3_vfs*,int); - int (*vfs_unregister)(sqlite3_vfs*); - int (*xthreadsafe)(void); - void (*result_zeroblob)(sqlite3_context*,int); - void (*result_error_code)(sqlite3_context*,int); - int (*test_control)(int, ...); - void (*randomness)(int,void*); - sqlite3 *(*context_db_handle)(sqlite3_context*); - int (*extended_result_codes)(sqlite3*,int); - int (*limit)(sqlite3*,int,int); - sqlite3_stmt *(*next_stmt)(sqlite3*,sqlite3_stmt*); - const char *(*sql)(sqlite3_stmt*); - int (*status)(int,int*,int*,int); - int (*backup_finish)(sqlite3_backup*); - sqlite3_backup *(*backup_init)(sqlite3*,const char*,sqlite3*,const char*); - int (*backup_pagecount)(sqlite3_backup*); - int (*backup_remaining)(sqlite3_backup*); - int (*backup_step)(sqlite3_backup*,int); - const char *(*compileoption_get)(int); - int (*compileoption_used)(const char*); - int (*create_function_v2)(sqlite3*,const char*,int,int,void*, - void (*xFunc)(sqlite3_context*,int,sqlite3_value**), - void (*xStep)(sqlite3_context*,int,sqlite3_value**), - void (*xFinal)(sqlite3_context*), - void(*xDestroy)(void*)); - int (*db_config)(sqlite3*,int,...); - sqlite3_mutex *(*db_mutex)(sqlite3*); - int (*db_status)(sqlite3*,int,int*,int*,int); - int (*extended_errcode)(sqlite3*); - void (*log)(int,const char*,...); - sqlite3_int64 (*soft_heap_limit64)(sqlite3_int64); - const char *(*sourceid)(void); - int (*stmt_status)(sqlite3_stmt*,int,int); - int (*strnicmp)(const char*,const char*,int); - int (*unlock_notify)(sqlite3*,void(*)(void**,int),void*); - int (*wal_autocheckpoint)(sqlite3*,int); - int (*wal_checkpoint)(sqlite3*,const char*); - void *(*wal_hook)(sqlite3*,int(*)(void*,sqlite3*,const char*,int),void*); - int (*blob_reopen)(sqlite3_blob*,sqlite3_int64); - int (*vtab_config)(sqlite3*,int op,...); - int (*vtab_on_conflict)(sqlite3*); -}; - -/* -** The following macros redefine the API routines so that they are -** redirected throught the global sqlite3_api structure. -** -** This header file is also used by the loadext.c source file -** (part of the main SQLite library - not an extension) so that -** it can get access to the sqlite3_api_routines structure -** definition. But the main library does not want to redefine -** the API. So the redefinition macros are only valid if the -** SQLITE_CORE macros is undefined. -*/ -#ifndef SQLITE_CORE -#define sqlite3_aggregate_context sqlite3_api->aggregate_context -#ifndef SQLITE_OMIT_DEPRECATED -#define sqlite3_aggregate_count sqlite3_api->aggregate_count -#endif -#define sqlite3_bind_blob sqlite3_api->bind_blob -#define sqlite3_bind_double sqlite3_api->bind_double -#define sqlite3_bind_int sqlite3_api->bind_int -#define sqlite3_bind_int64 sqlite3_api->bind_int64 -#define sqlite3_bind_null sqlite3_api->bind_null -#define sqlite3_bind_parameter_count sqlite3_api->bind_parameter_count -#define sqlite3_bind_parameter_index sqlite3_api->bind_parameter_index -#define sqlite3_bind_parameter_name sqlite3_api->bind_parameter_name -#define sqlite3_bind_text sqlite3_api->bind_text -#define sqlite3_bind_text16 sqlite3_api->bind_text16 -#define sqlite3_bind_value sqlite3_api->bind_value -#define sqlite3_busy_handler sqlite3_api->busy_handler -#define sqlite3_busy_timeout sqlite3_api->busy_timeout -#define sqlite3_changes sqlite3_api->changes -#define sqlite3_close sqlite3_api->close -#define sqlite3_collation_needed sqlite3_api->collation_needed -#define sqlite3_collation_needed16 sqlite3_api->collation_needed16 -#define sqlite3_column_blob sqlite3_api->column_blob -#define sqlite3_column_bytes sqlite3_api->column_bytes -#define sqlite3_column_bytes16 sqlite3_api->column_bytes16 -#define sqlite3_column_count sqlite3_api->column_count -#define sqlite3_column_database_name sqlite3_api->column_database_name -#define sqlite3_column_database_name16 sqlite3_api->column_database_name16 -#define sqlite3_column_decltype sqlite3_api->column_decltype -#define sqlite3_column_decltype16 sqlite3_api->column_decltype16 -#define sqlite3_column_double sqlite3_api->column_double -#define sqlite3_column_int sqlite3_api->column_int -#define sqlite3_column_int64 sqlite3_api->column_int64 -#define sqlite3_column_name sqlite3_api->column_name -#define sqlite3_column_name16 sqlite3_api->column_name16 -#define sqlite3_column_origin_name sqlite3_api->column_origin_name -#define sqlite3_column_origin_name16 sqlite3_api->column_origin_name16 -#define sqlite3_column_table_name sqlite3_api->column_table_name -#define sqlite3_column_table_name16 sqlite3_api->column_table_name16 -#define sqlite3_column_text sqlite3_api->column_text -#define sqlite3_column_text16 sqlite3_api->column_text16 -#define sqlite3_column_type sqlite3_api->column_type -#define sqlite3_column_value sqlite3_api->column_value -#define sqlite3_commit_hook sqlite3_api->commit_hook -#define sqlite3_complete sqlite3_api->complete -#define sqlite3_complete16 sqlite3_api->complete16 -#define sqlite3_create_collation sqlite3_api->create_collation -#define sqlite3_create_collation16 sqlite3_api->create_collation16 -#define sqlite3_create_function sqlite3_api->create_function -#define sqlite3_create_function16 sqlite3_api->create_function16 -#define sqlite3_create_module sqlite3_api->create_module -#define sqlite3_create_module_v2 sqlite3_api->create_module_v2 -#define sqlite3_data_count sqlite3_api->data_count -#define sqlite3_db_handle sqlite3_api->db_handle -#define sqlite3_declare_vtab sqlite3_api->declare_vtab -#define sqlite3_enable_shared_cache sqlite3_api->enable_shared_cache -#define sqlite3_errcode sqlite3_api->errcode -#define sqlite3_errmsg sqlite3_api->errmsg -#define sqlite3_errmsg16 sqlite3_api->errmsg16 -#define sqlite3_exec sqlite3_api->exec -#ifndef SQLITE_OMIT_DEPRECATED -#define sqlite3_expired sqlite3_api->expired -#endif -#define sqlite3_finalize sqlite3_api->finalize -#define sqlite3_free sqlite3_api->free -#define sqlite3_free_table sqlite3_api->free_table -#define sqlite3_get_autocommit sqlite3_api->get_autocommit -#define sqlite3_get_auxdata sqlite3_api->get_auxdata -#define sqlite3_get_table sqlite3_api->get_table -#ifndef SQLITE_OMIT_DEPRECATED -#define sqlite3_global_recover sqlite3_api->global_recover -#endif -#define sqlite3_interrupt sqlite3_api->interruptx -#define sqlite3_last_insert_rowid sqlite3_api->last_insert_rowid -#define sqlite3_libversion sqlite3_api->libversion -#define sqlite3_libversion_number sqlite3_api->libversion_number -#define sqlite3_malloc sqlite3_api->malloc -#define sqlite3_mprintf sqlite3_api->mprintf -#define sqlite3_open sqlite3_api->open -#define sqlite3_open16 sqlite3_api->open16 -#define sqlite3_prepare sqlite3_api->prepare -#define sqlite3_prepare16 sqlite3_api->prepare16 -#define sqlite3_prepare_v2 sqlite3_api->prepare_v2 -#define sqlite3_prepare16_v2 sqlite3_api->prepare16_v2 -#define sqlite3_profile sqlite3_api->profile -#define sqlite3_progress_handler sqlite3_api->progress_handler -#define sqlite3_realloc sqlite3_api->realloc -#define sqlite3_reset sqlite3_api->reset -#define sqlite3_result_blob sqlite3_api->result_blob -#define sqlite3_result_double sqlite3_api->result_double -#define sqlite3_result_error sqlite3_api->result_error -#define sqlite3_result_error16 sqlite3_api->result_error16 -#define sqlite3_result_int sqlite3_api->result_int -#define sqlite3_result_int64 sqlite3_api->result_int64 -#define sqlite3_result_null sqlite3_api->result_null -#define sqlite3_result_text sqlite3_api->result_text -#define sqlite3_result_text16 sqlite3_api->result_text16 -#define sqlite3_result_text16be sqlite3_api->result_text16be -#define sqlite3_result_text16le sqlite3_api->result_text16le -#define sqlite3_result_value sqlite3_api->result_value -#define sqlite3_rollback_hook sqlite3_api->rollback_hook -#define sqlite3_set_authorizer sqlite3_api->set_authorizer -#define sqlite3_set_auxdata sqlite3_api->set_auxdata -#define sqlite3_snprintf sqlite3_api->snprintf -#define sqlite3_step sqlite3_api->step -#define sqlite3_table_column_metadata sqlite3_api->table_column_metadata -#define sqlite3_thread_cleanup sqlite3_api->thread_cleanup -#define sqlite3_total_changes sqlite3_api->total_changes -#define sqlite3_trace sqlite3_api->trace -#ifndef SQLITE_OMIT_DEPRECATED -#define sqlite3_transfer_bindings sqlite3_api->transfer_bindings -#endif -#define sqlite3_update_hook sqlite3_api->update_hook -#define sqlite3_user_data sqlite3_api->user_data -#define sqlite3_value_blob sqlite3_api->value_blob -#define sqlite3_value_bytes sqlite3_api->value_bytes -#define sqlite3_value_bytes16 sqlite3_api->value_bytes16 -#define sqlite3_value_double sqlite3_api->value_double -#define sqlite3_value_int sqlite3_api->value_int -#define sqlite3_value_int64 sqlite3_api->value_int64 -#define sqlite3_value_numeric_type sqlite3_api->value_numeric_type -#define sqlite3_value_text sqlite3_api->value_text -#define sqlite3_value_text16 sqlite3_api->value_text16 -#define sqlite3_value_text16be sqlite3_api->value_text16be -#define sqlite3_value_text16le sqlite3_api->value_text16le -#define sqlite3_value_type sqlite3_api->value_type -#define sqlite3_vmprintf sqlite3_api->vmprintf -#define sqlite3_overload_function sqlite3_api->overload_function -#define sqlite3_prepare_v2 sqlite3_api->prepare_v2 -#define sqlite3_prepare16_v2 sqlite3_api->prepare16_v2 -#define sqlite3_clear_bindings sqlite3_api->clear_bindings -#define sqlite3_bind_zeroblob sqlite3_api->bind_zeroblob -#define sqlite3_blob_bytes sqlite3_api->blob_bytes -#define sqlite3_blob_close sqlite3_api->blob_close -#define sqlite3_blob_open sqlite3_api->blob_open -#define sqlite3_blob_read sqlite3_api->blob_read -#define sqlite3_blob_write sqlite3_api->blob_write -#define sqlite3_create_collation_v2 sqlite3_api->create_collation_v2 -#define sqlite3_file_control sqlite3_api->file_control -#define sqlite3_memory_highwater sqlite3_api->memory_highwater -#define sqlite3_memory_used sqlite3_api->memory_used -#define sqlite3_mutex_alloc sqlite3_api->mutex_alloc -#define sqlite3_mutex_enter sqlite3_api->mutex_enter -#define sqlite3_mutex_free sqlite3_api->mutex_free -#define sqlite3_mutex_leave sqlite3_api->mutex_leave -#define sqlite3_mutex_try sqlite3_api->mutex_try -#define sqlite3_open_v2 sqlite3_api->open_v2 -#define sqlite3_release_memory sqlite3_api->release_memory -#define sqlite3_result_error_nomem sqlite3_api->result_error_nomem -#define sqlite3_result_error_toobig sqlite3_api->result_error_toobig -#define sqlite3_sleep sqlite3_api->sleep -#define sqlite3_soft_heap_limit sqlite3_api->soft_heap_limit -#define sqlite3_vfs_find sqlite3_api->vfs_find -#define sqlite3_vfs_register sqlite3_api->vfs_register -#define sqlite3_vfs_unregister sqlite3_api->vfs_unregister -#define sqlite3_threadsafe sqlite3_api->xthreadsafe -#define sqlite3_result_zeroblob sqlite3_api->result_zeroblob -#define sqlite3_result_error_code sqlite3_api->result_error_code -#define sqlite3_test_control sqlite3_api->test_control -#define sqlite3_randomness sqlite3_api->randomness -#define sqlite3_context_db_handle sqlite3_api->context_db_handle -#define sqlite3_extended_result_codes sqlite3_api->extended_result_codes -#define sqlite3_limit sqlite3_api->limit -#define sqlite3_next_stmt sqlite3_api->next_stmt -#define sqlite3_sql sqlite3_api->sql -#define sqlite3_status sqlite3_api->status -#define sqlite3_backup_finish sqlite3_api->backup_finish -#define sqlite3_backup_init sqlite3_api->backup_init -#define sqlite3_backup_pagecount sqlite3_api->backup_pagecount -#define sqlite3_backup_remaining sqlite3_api->backup_remaining -#define sqlite3_backup_step sqlite3_api->backup_step -#define sqlite3_compileoption_get sqlite3_api->compileoption_get -#define sqlite3_compileoption_used sqlite3_api->compileoption_used -#define sqlite3_create_function_v2 sqlite3_api->create_function_v2 -#define sqlite3_db_config sqlite3_api->db_config -#define sqlite3_db_mutex sqlite3_api->db_mutex -#define sqlite3_db_status sqlite3_api->db_status -#define sqlite3_extended_errcode sqlite3_api->extended_errcode -#define sqlite3_log sqlite3_api->log -#define sqlite3_soft_heap_limit64 sqlite3_api->soft_heap_limit64 -#define sqlite3_sourceid sqlite3_api->sourceid -#define sqlite3_stmt_status sqlite3_api->stmt_status -#define sqlite3_strnicmp sqlite3_api->strnicmp -#define sqlite3_unlock_notify sqlite3_api->unlock_notify -#define sqlite3_wal_autocheckpoint sqlite3_api->wal_autocheckpoint -#define sqlite3_wal_checkpoint sqlite3_api->wal_checkpoint -#define sqlite3_wal_hook sqlite3_api->wal_hook -#define sqlite3_blob_reopen sqlite3_api->blob_reopen -#define sqlite3_vtab_config sqlite3_api->vtab_config -#define sqlite3_vtab_on_conflict sqlite3_api->vtab_on_conflict -#endif /* SQLITE_CORE */ - -#define SQLITE_EXTENSION_INIT1 const sqlite3_api_routines *sqlite3_api = 0; -#define SQLITE_EXTENSION_INIT2(v) sqlite3_api = v; - -#endif /* _SQLITE3EXT_H_ */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/tiff.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/tiff.h deleted file mode 100644 index 19b4e7976d..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/tiff.h +++ /dev/null @@ -1,678 +0,0 @@ -/* $Id: tiff.h,v 1.68 2012-08-19 16:56:35 bfriesen Exp $ */ - -/* - * Copyright (c) 1988-1997 Sam Leffler - * Copyright (c) 1991-1997 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Sam Leffler and Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#ifndef _TIFF_ -#define _TIFF_ - -#include "tiffconf.h" - -/* - * Tag Image File Format (TIFF) - * - * Based on Rev 6.0 from: - * Developer's Desk - * Aldus Corporation - * 411 First Ave. South - * Suite 200 - * Seattle, WA 98104 - * 206-622-5500 - * - * (http://partners.adobe.com/asn/developer/PDFS/TN/TIFF6.pdf) - * - * For BigTIFF design notes see the following links - * http://www.remotesensing.org/libtiff/bigtiffdesign.html - * http://www.awaresystems.be/imaging/tiff/bigtiff.html - */ - -#define TIFF_VERSION_CLASSIC 42 -#define TIFF_VERSION_BIG 43 - -#define TIFF_BIGENDIAN 0x4d4d -#define TIFF_LITTLEENDIAN 0x4949 -#define MDI_LITTLEENDIAN 0x5045 -#define MDI_BIGENDIAN 0x4550 - -/* - * Intrinsic data types required by the file format: - * - * 8-bit quantities int8/uint8 - * 16-bit quantities int16/uint16 - * 32-bit quantities int32/uint32 - * 64-bit quantities int64/uint64 - * strings unsigned char* - */ - -typedef TIFF_INT8_T int8; -typedef TIFF_UINT8_T uint8; - -typedef TIFF_INT16_T int16; -typedef TIFF_UINT16_T uint16; - -typedef TIFF_INT32_T int32; -typedef TIFF_UINT32_T uint32; - -typedef TIFF_INT64_T int64; -typedef TIFF_UINT64_T uint64; - -/* - * Some types as promoted in a variable argument list - * We use uint16_vap rather then directly using int, because this way - * we document the type we actually want to pass through, conceptually, - * rather then confusing the issue by merely stating the type it gets - * promoted to - */ - -typedef int uint16_vap; - -/* - * TIFF header. - */ -typedef struct { - uint16 tiff_magic; /* magic number (defines byte order) */ - uint16 tiff_version; /* TIFF version number */ -} TIFFHeaderCommon; -typedef struct { - uint16 tiff_magic; /* magic number (defines byte order) */ - uint16 tiff_version; /* TIFF version number */ - uint32 tiff_diroff; /* byte offset to first directory */ -} TIFFHeaderClassic; -typedef struct { - uint16 tiff_magic; /* magic number (defines byte order) */ - uint16 tiff_version; /* TIFF version number */ - uint16 tiff_offsetsize; /* size of offsets, should be 8 */ - uint16 tiff_unused; /* unused word, should be 0 */ - uint64 tiff_diroff; /* byte offset to first directory */ -} TIFFHeaderBig; - - -/* - * NB: In the comments below, - * - items marked with a + are obsoleted by revision 5.0, - * - items marked with a ! are introduced in revision 6.0. - * - items marked with a % are introduced post revision 6.0. - * - items marked with a $ are obsoleted by revision 6.0. - * - items marked with a & are introduced by Adobe DNG specification. - */ - -/* - * Tag data type information. - * - * Note: RATIONALs are the ratio of two 32-bit integer values. - */ -typedef enum { - TIFF_NOTYPE = 0, /* placeholder */ - TIFF_BYTE = 1, /* 8-bit unsigned integer */ - TIFF_ASCII = 2, /* 8-bit bytes w/ last byte null */ - TIFF_SHORT = 3, /* 16-bit unsigned integer */ - TIFF_LONG = 4, /* 32-bit unsigned integer */ - TIFF_RATIONAL = 5, /* 64-bit unsigned fraction */ - TIFF_SBYTE = 6, /* !8-bit signed integer */ - TIFF_UNDEFINED = 7, /* !8-bit untyped data */ - TIFF_SSHORT = 8, /* !16-bit signed integer */ - TIFF_SLONG = 9, /* !32-bit signed integer */ - TIFF_SRATIONAL = 10, /* !64-bit signed fraction */ - TIFF_FLOAT = 11, /* !32-bit IEEE floating point */ - TIFF_DOUBLE = 12, /* !64-bit IEEE floating point */ - TIFF_IFD = 13, /* %32-bit unsigned integer (offset) */ - TIFF_LONG8 = 16, /* BigTIFF 64-bit unsigned integer */ - TIFF_SLONG8 = 17, /* BigTIFF 64-bit signed integer */ - TIFF_IFD8 = 18 /* BigTIFF 64-bit unsigned integer (offset) */ -} TIFFDataType; - -/* - * TIFF Tag Definitions. - */ -#define TIFFTAG_SUBFILETYPE 254 /* subfile data descriptor */ -#define FILETYPE_REDUCEDIMAGE 0x1 /* reduced resolution version */ -#define FILETYPE_PAGE 0x2 /* one page of many */ -#define FILETYPE_MASK 0x4 /* transparency mask */ -#define TIFFTAG_OSUBFILETYPE 255 /* +kind of data in subfile */ -#define OFILETYPE_IMAGE 1 /* full resolution image data */ -#define OFILETYPE_REDUCEDIMAGE 2 /* reduced size image data */ -#define OFILETYPE_PAGE 3 /* one page of many */ -#define TIFFTAG_IMAGEWIDTH 256 /* image width in pixels */ -#define TIFFTAG_IMAGELENGTH 257 /* image height in pixels */ -#define TIFFTAG_BITSPERSAMPLE 258 /* bits per channel (sample) */ -#define TIFFTAG_COMPRESSION 259 /* data compression technique */ -#define COMPRESSION_NONE 1 /* dump mode */ -#define COMPRESSION_CCITTRLE 2 /* CCITT modified Huffman RLE */ -#define COMPRESSION_CCITTFAX3 3 /* CCITT Group 3 fax encoding */ -#define COMPRESSION_CCITT_T4 3 /* CCITT T.4 (TIFF 6 name) */ -#define COMPRESSION_CCITTFAX4 4 /* CCITT Group 4 fax encoding */ -#define COMPRESSION_CCITT_T6 4 /* CCITT T.6 (TIFF 6 name) */ -#define COMPRESSION_LZW 5 /* Lempel-Ziv & Welch */ -#define COMPRESSION_OJPEG 6 /* !6.0 JPEG */ -#define COMPRESSION_JPEG 7 /* %JPEG DCT compression */ -#define COMPRESSION_T85 9 /* !TIFF/FX T.85 JBIG compression */ -#define COMPRESSION_T43 10 /* !TIFF/FX T.43 colour by layered JBIG compression */ -#define COMPRESSION_NEXT 32766 /* NeXT 2-bit RLE */ -#define COMPRESSION_CCITTRLEW 32771 /* #1 w/ word alignment */ -#define COMPRESSION_PACKBITS 32773 /* Macintosh RLE */ -#define COMPRESSION_THUNDERSCAN 32809 /* ThunderScan RLE */ -/* codes 32895-32898 are reserved for ANSI IT8 TIFF/IT <dkelly@apago.com) */ -#define COMPRESSION_IT8CTPAD 32895 /* IT8 CT w/padding */ -#define COMPRESSION_IT8LW 32896 /* IT8 Linework RLE */ -#define COMPRESSION_IT8MP 32897 /* IT8 Monochrome picture */ -#define COMPRESSION_IT8BL 32898 /* IT8 Binary line art */ -/* compression codes 32908-32911 are reserved for Pixar */ -#define COMPRESSION_PIXARFILM 32908 /* Pixar companded 10bit LZW */ -#define COMPRESSION_PIXARLOG 32909 /* Pixar companded 11bit ZIP */ -#define COMPRESSION_DEFLATE 32946 /* Deflate compression */ -#define COMPRESSION_ADOBE_DEFLATE 8 /* Deflate compression, - as recognized by Adobe */ -/* compression code 32947 is reserved for Oceana Matrix <dev@oceana.com> */ -#define COMPRESSION_DCS 32947 /* Kodak DCS encoding */ -#define COMPRESSION_JBIG 34661 /* ISO JBIG */ -#define COMPRESSION_SGILOG 34676 /* SGI Log Luminance RLE */ -#define COMPRESSION_SGILOG24 34677 /* SGI Log 24-bit packed */ -#define COMPRESSION_JP2000 34712 /* Leadtools JPEG2000 */ -#define COMPRESSION_LZMA 34925 /* LZMA2 */ -#define TIFFTAG_PHOTOMETRIC 262 /* photometric interpretation */ -#define PHOTOMETRIC_MINISWHITE 0 /* min value is white */ -#define PHOTOMETRIC_MINISBLACK 1 /* min value is black */ -#define PHOTOMETRIC_RGB 2 /* RGB color model */ -#define PHOTOMETRIC_PALETTE 3 /* color map indexed */ -#define PHOTOMETRIC_MASK 4 /* $holdout mask */ -#define PHOTOMETRIC_SEPARATED 5 /* !color separations */ -#define PHOTOMETRIC_YCBCR 6 /* !CCIR 601 */ -#define PHOTOMETRIC_CIELAB 8 /* !1976 CIE L*a*b* */ -#define PHOTOMETRIC_ICCLAB 9 /* ICC L*a*b* [Adobe TIFF Technote 4] */ -#define PHOTOMETRIC_ITULAB 10 /* ITU L*a*b* */ -#define PHOTOMETRIC_LOGL 32844 /* CIE Log2(L) */ -#define PHOTOMETRIC_LOGLUV 32845 /* CIE Log2(L) (u',v') */ -#define TIFFTAG_THRESHHOLDING 263 /* +thresholding used on data */ -#define THRESHHOLD_BILEVEL 1 /* b&w art scan */ -#define THRESHHOLD_HALFTONE 2 /* or dithered scan */ -#define THRESHHOLD_ERRORDIFFUSE 3 /* usually floyd-steinberg */ -#define TIFFTAG_CELLWIDTH 264 /* +dithering matrix width */ -#define TIFFTAG_CELLLENGTH 265 /* +dithering matrix height */ -#define TIFFTAG_FILLORDER 266 /* data order within a byte */ -#define FILLORDER_MSB2LSB 1 /* most significant -> least */ -#define FILLORDER_LSB2MSB 2 /* least significant -> most */ -#define TIFFTAG_DOCUMENTNAME 269 /* name of doc. image is from */ -#define TIFFTAG_IMAGEDESCRIPTION 270 /* info about image */ -#define TIFFTAG_MAKE 271 /* scanner manufacturer name */ -#define TIFFTAG_MODEL 272 /* scanner model name/number */ -#define TIFFTAG_STRIPOFFSETS 273 /* offsets to data strips */ -#define TIFFTAG_ORIENTATION 274 /* +image orientation */ -#define ORIENTATION_TOPLEFT 1 /* row 0 top, col 0 lhs */ -#define ORIENTATION_TOPRIGHT 2 /* row 0 top, col 0 rhs */ -#define ORIENTATION_BOTRIGHT 3 /* row 0 bottom, col 0 rhs */ -#define ORIENTATION_BOTLEFT 4 /* row 0 bottom, col 0 lhs */ -#define ORIENTATION_LEFTTOP 5 /* row 0 lhs, col 0 top */ -#define ORIENTATION_RIGHTTOP 6 /* row 0 rhs, col 0 top */ -#define ORIENTATION_RIGHTBOT 7 /* row 0 rhs, col 0 bottom */ -#define ORIENTATION_LEFTBOT 8 /* row 0 lhs, col 0 bottom */ -#define TIFFTAG_SAMPLESPERPIXEL 277 /* samples per pixel */ -#define TIFFTAG_ROWSPERSTRIP 278 /* rows per strip of data */ -#define TIFFTAG_STRIPBYTECOUNTS 279 /* bytes counts for strips */ -#define TIFFTAG_MINSAMPLEVALUE 280 /* +minimum sample value */ -#define TIFFTAG_MAXSAMPLEVALUE 281 /* +maximum sample value */ -#define TIFFTAG_XRESOLUTION 282 /* pixels/resolution in x */ -#define TIFFTAG_YRESOLUTION 283 /* pixels/resolution in y */ -#define TIFFTAG_PLANARCONFIG 284 /* storage organization */ -#define PLANARCONFIG_CONTIG 1 /* single image plane */ -#define PLANARCONFIG_SEPARATE 2 /* separate planes of data */ -#define TIFFTAG_PAGENAME 285 /* page name image is from */ -#define TIFFTAG_XPOSITION 286 /* x page offset of image lhs */ -#define TIFFTAG_YPOSITION 287 /* y page offset of image lhs */ -#define TIFFTAG_FREEOFFSETS 288 /* +byte offset to free block */ -#define TIFFTAG_FREEBYTECOUNTS 289 /* +sizes of free blocks */ -#define TIFFTAG_GRAYRESPONSEUNIT 290 /* $gray scale curve accuracy */ -#define GRAYRESPONSEUNIT_10S 1 /* tenths of a unit */ -#define GRAYRESPONSEUNIT_100S 2 /* hundredths of a unit */ -#define GRAYRESPONSEUNIT_1000S 3 /* thousandths of a unit */ -#define GRAYRESPONSEUNIT_10000S 4 /* ten-thousandths of a unit */ -#define GRAYRESPONSEUNIT_100000S 5 /* hundred-thousandths */ -#define TIFFTAG_GRAYRESPONSECURVE 291 /* $gray scale response curve */ -#define TIFFTAG_GROUP3OPTIONS 292 /* 32 flag bits */ -#define TIFFTAG_T4OPTIONS 292 /* TIFF 6.0 proper name alias */ -#define GROUP3OPT_2DENCODING 0x1 /* 2-dimensional coding */ -#define GROUP3OPT_UNCOMPRESSED 0x2 /* data not compressed */ -#define GROUP3OPT_FILLBITS 0x4 /* fill to byte boundary */ -#define TIFFTAG_GROUP4OPTIONS 293 /* 32 flag bits */ -#define TIFFTAG_T6OPTIONS 293 /* TIFF 6.0 proper name */ -#define GROUP4OPT_UNCOMPRESSED 0x2 /* data not compressed */ -#define TIFFTAG_RESOLUTIONUNIT 296 /* units of resolutions */ -#define RESUNIT_NONE 1 /* no meaningful units */ -#define RESUNIT_INCH 2 /* english */ -#define RESUNIT_CENTIMETER 3 /* metric */ -#define TIFFTAG_PAGENUMBER 297 /* page numbers of multi-page */ -#define TIFFTAG_COLORRESPONSEUNIT 300 /* $color curve accuracy */ -#define COLORRESPONSEUNIT_10S 1 /* tenths of a unit */ -#define COLORRESPONSEUNIT_100S 2 /* hundredths of a unit */ -#define COLORRESPONSEUNIT_1000S 3 /* thousandths of a unit */ -#define COLORRESPONSEUNIT_10000S 4 /* ten-thousandths of a unit */ -#define COLORRESPONSEUNIT_100000S 5 /* hundred-thousandths */ -#define TIFFTAG_TRANSFERFUNCTION 301 /* !colorimetry info */ -#define TIFFTAG_SOFTWARE 305 /* name & release */ -#define TIFFTAG_DATETIME 306 /* creation date and time */ -#define TIFFTAG_ARTIST 315 /* creator of image */ -#define TIFFTAG_HOSTCOMPUTER 316 /* machine where created */ -#define TIFFTAG_PREDICTOR 317 /* prediction scheme w/ LZW */ -#define PREDICTOR_NONE 1 /* no prediction scheme used */ -#define PREDICTOR_HORIZONTAL 2 /* horizontal differencing */ -#define PREDICTOR_FLOATINGPOINT 3 /* floating point predictor */ -#define TIFFTAG_WHITEPOINT 318 /* image white point */ -#define TIFFTAG_PRIMARYCHROMATICITIES 319 /* !primary chromaticities */ -#define TIFFTAG_COLORMAP 320 /* RGB map for pallette image */ -#define TIFFTAG_HALFTONEHINTS 321 /* !highlight+shadow info */ -#define TIFFTAG_TILEWIDTH 322 /* !tile width in pixels */ -#define TIFFTAG_TILELENGTH 323 /* !tile height in pixels */ -#define TIFFTAG_TILEOFFSETS 324 /* !offsets to data tiles */ -#define TIFFTAG_TILEBYTECOUNTS 325 /* !byte counts for tiles */ -#define TIFFTAG_BADFAXLINES 326 /* lines w/ wrong pixel count */ -#define TIFFTAG_CLEANFAXDATA 327 /* regenerated line info */ -#define CLEANFAXDATA_CLEAN 0 /* no errors detected */ -#define CLEANFAXDATA_REGENERATED 1 /* receiver regenerated lines */ -#define CLEANFAXDATA_UNCLEAN 2 /* uncorrected errors exist */ -#define TIFFTAG_CONSECUTIVEBADFAXLINES 328 /* max consecutive bad lines */ -#define TIFFTAG_SUBIFD 330 /* subimage descriptors */ -#define TIFFTAG_INKSET 332 /* !inks in separated image */ -#define INKSET_CMYK 1 /* !cyan-magenta-yellow-black color */ -#define INKSET_MULTIINK 2 /* !multi-ink or hi-fi color */ -#define TIFFTAG_INKNAMES 333 /* !ascii names of inks */ -#define TIFFTAG_NUMBEROFINKS 334 /* !number of inks */ -#define TIFFTAG_DOTRANGE 336 /* !0% and 100% dot codes */ -#define TIFFTAG_TARGETPRINTER 337 /* !separation target */ -#define TIFFTAG_EXTRASAMPLES 338 /* !info about extra samples */ -#define EXTRASAMPLE_UNSPECIFIED 0 /* !unspecified data */ -#define EXTRASAMPLE_ASSOCALPHA 1 /* !associated alpha data */ -#define EXTRASAMPLE_UNASSALPHA 2 /* !unassociated alpha data */ -#define TIFFTAG_SAMPLEFORMAT 339 /* !data sample format */ -#define SAMPLEFORMAT_UINT 1 /* !unsigned integer data */ -#define SAMPLEFORMAT_INT 2 /* !signed integer data */ -#define SAMPLEFORMAT_IEEEFP 3 /* !IEEE floating point data */ -#define SAMPLEFORMAT_VOID 4 /* !untyped data */ -#define SAMPLEFORMAT_COMPLEXINT 5 /* !complex signed int */ -#define SAMPLEFORMAT_COMPLEXIEEEFP 6 /* !complex ieee floating */ -#define TIFFTAG_SMINSAMPLEVALUE 340 /* !variable MinSampleValue */ -#define TIFFTAG_SMAXSAMPLEVALUE 341 /* !variable MaxSampleValue */ -#define TIFFTAG_CLIPPATH 343 /* %ClipPath - [Adobe TIFF technote 2] */ -#define TIFFTAG_XCLIPPATHUNITS 344 /* %XClipPathUnits - [Adobe TIFF technote 2] */ -#define TIFFTAG_YCLIPPATHUNITS 345 /* %YClipPathUnits - [Adobe TIFF technote 2] */ -#define TIFFTAG_INDEXED 346 /* %Indexed - [Adobe TIFF Technote 3] */ -#define TIFFTAG_JPEGTABLES 347 /* %JPEG table stream */ -#define TIFFTAG_OPIPROXY 351 /* %OPI Proxy [Adobe TIFF technote] */ -/* Tags 400-435 are from the TIFF/FX spec */ -#define TIFFTAG_GLOBALPARAMETERSIFD 400 /* ! */ -#define TIFFTAG_PROFILETYPE 401 /* ! */ -#define PROFILETYPE_UNSPECIFIED 0 /* ! */ -#define PROFILETYPE_G3_FAX 1 /* ! */ -#define TIFFTAG_FAXPROFILE 402 /* ! */ -#define FAXPROFILE_S 1 /* !TIFF/FX FAX profile S */ -#define FAXPROFILE_F 2 /* !TIFF/FX FAX profile F */ -#define FAXPROFILE_J 3 /* !TIFF/FX FAX profile J */ -#define FAXPROFILE_C 4 /* !TIFF/FX FAX profile C */ -#define FAXPROFILE_L 5 /* !TIFF/FX FAX profile L */ -#define FAXPROFILE_M 6 /* !TIFF/FX FAX profile LM */ -#define TIFFTAG_CODINGMETHODS 403 /* !TIFF/FX coding methods */ -#define CODINGMETHODS_T4_1D (1 << 1) /* !T.4 1D */ -#define CODINGMETHODS_T4_2D (1 << 2) /* !T.4 2D */ -#define CODINGMETHODS_T6 (1 << 3) /* !T.6 */ -#define CODINGMETHODS_T85 (1 << 4) /* !T.85 JBIG */ -#define CODINGMETHODS_T42 (1 << 5) /* !T.42 JPEG */ -#define CODINGMETHODS_T43 (1 << 6) /* !T.43 colour by layered JBIG */ -#define TIFFTAG_VERSIONYEAR 404 /* !TIFF/FX version year */ -#define TIFFTAG_MODENUMBER 405 /* !TIFF/FX mode number */ -#define TIFFTAG_DECODE 433 /* !TIFF/FX decode */ -#define TIFFTAG_IMAGEBASECOLOR 434 /* !TIFF/FX image base colour */ -#define TIFFTAG_T82OPTIONS 435 /* !TIFF/FX T.82 options */ -/* - * Tags 512-521 are obsoleted by Technical Note #2 which specifies a - * revised JPEG-in-TIFF scheme. - */ -#define TIFFTAG_JPEGPROC 512 /* !JPEG processing algorithm */ -#define JPEGPROC_BASELINE 1 /* !baseline sequential */ -#define JPEGPROC_LOSSLESS 14 /* !Huffman coded lossless */ -#define TIFFTAG_JPEGIFOFFSET 513 /* !pointer to SOI marker */ -#define TIFFTAG_JPEGIFBYTECOUNT 514 /* !JFIF stream length */ -#define TIFFTAG_JPEGRESTARTINTERVAL 515 /* !restart interval length */ -#define TIFFTAG_JPEGLOSSLESSPREDICTORS 517 /* !lossless proc predictor */ -#define TIFFTAG_JPEGPOINTTRANSFORM 518 /* !lossless point transform */ -#define TIFFTAG_JPEGQTABLES 519 /* !Q matrice offsets */ -#define TIFFTAG_JPEGDCTABLES 520 /* !DCT table offsets */ -#define TIFFTAG_JPEGACTABLES 521 /* !AC coefficient offsets */ -#define TIFFTAG_YCBCRCOEFFICIENTS 529 /* !RGB -> YCbCr transform */ -#define TIFFTAG_YCBCRSUBSAMPLING 530 /* !YCbCr subsampling factors */ -#define TIFFTAG_YCBCRPOSITIONING 531 /* !subsample positioning */ -#define YCBCRPOSITION_CENTERED 1 /* !as in PostScript Level 2 */ -#define YCBCRPOSITION_COSITED 2 /* !as in CCIR 601-1 */ -#define TIFFTAG_REFERENCEBLACKWHITE 532 /* !colorimetry info */ -#define TIFFTAG_STRIPROWCOUNTS 559 /* !TIFF/FX strip row counts */ -#define TIFFTAG_XMLPACKET 700 /* %XML packet - [Adobe XMP Specification, - January 2004 */ -#define TIFFTAG_OPIIMAGEID 32781 /* %OPI ImageID - [Adobe TIFF technote] */ -/* tags 32952-32956 are private tags registered to Island Graphics */ -#define TIFFTAG_REFPTS 32953 /* image reference points */ -#define TIFFTAG_REGIONTACKPOINT 32954 /* region-xform tack point */ -#define TIFFTAG_REGIONWARPCORNERS 32955 /* warp quadrilateral */ -#define TIFFTAG_REGIONAFFINE 32956 /* affine transformation mat */ -/* tags 32995-32999 are private tags registered to SGI */ -#define TIFFTAG_MATTEING 32995 /* $use ExtraSamples */ -#define TIFFTAG_DATATYPE 32996 /* $use SampleFormat */ -#define TIFFTAG_IMAGEDEPTH 32997 /* z depth of image */ -#define TIFFTAG_TILEDEPTH 32998 /* z depth/data tile */ -/* tags 33300-33309 are private tags registered to Pixar */ -/* - * TIFFTAG_PIXAR_IMAGEFULLWIDTH and TIFFTAG_PIXAR_IMAGEFULLLENGTH - * are set when an image has been cropped out of a larger image. - * They reflect the size of the original uncropped image. - * The TIFFTAG_XPOSITION and TIFFTAG_YPOSITION can be used - * to determine the position of the smaller image in the larger one. - */ -#define TIFFTAG_PIXAR_IMAGEFULLWIDTH 33300 /* full image size in x */ -#define TIFFTAG_PIXAR_IMAGEFULLLENGTH 33301 /* full image size in y */ - /* Tags 33302-33306 are used to identify special image modes and data - * used by Pixar's texture formats. - */ -#define TIFFTAG_PIXAR_TEXTUREFORMAT 33302 /* texture map format */ -#define TIFFTAG_PIXAR_WRAPMODES 33303 /* s & t wrap modes */ -#define TIFFTAG_PIXAR_FOVCOT 33304 /* cotan(fov) for env. maps */ -#define TIFFTAG_PIXAR_MATRIX_WORLDTOSCREEN 33305 -#define TIFFTAG_PIXAR_MATRIX_WORLDTOCAMERA 33306 -/* tag 33405 is a private tag registered to Eastman Kodak */ -#define TIFFTAG_WRITERSERIALNUMBER 33405 /* device serial number */ -/* tag 33432 is listed in the 6.0 spec w/ unknown ownership */ -#define TIFFTAG_COPYRIGHT 33432 /* copyright string */ -/* IPTC TAG from RichTIFF specifications */ -#define TIFFTAG_RICHTIFFIPTC 33723 -/* 34016-34029 are reserved for ANSI IT8 TIFF/IT <dkelly@apago.com) */ -#define TIFFTAG_IT8SITE 34016 /* site name */ -#define TIFFTAG_IT8COLORSEQUENCE 34017 /* color seq. [RGB,CMYK,etc] */ -#define TIFFTAG_IT8HEADER 34018 /* DDES Header */ -#define TIFFTAG_IT8RASTERPADDING 34019 /* raster scanline padding */ -#define TIFFTAG_IT8BITSPERRUNLENGTH 34020 /* # of bits in short run */ -#define TIFFTAG_IT8BITSPEREXTENDEDRUNLENGTH 34021/* # of bits in long run */ -#define TIFFTAG_IT8COLORTABLE 34022 /* LW colortable */ -#define TIFFTAG_IT8IMAGECOLORINDICATOR 34023 /* BP/BL image color switch */ -#define TIFFTAG_IT8BKGCOLORINDICATOR 34024 /* BP/BL bg color switch */ -#define TIFFTAG_IT8IMAGECOLORVALUE 34025 /* BP/BL image color value */ -#define TIFFTAG_IT8BKGCOLORVALUE 34026 /* BP/BL bg color value */ -#define TIFFTAG_IT8PIXELINTENSITYRANGE 34027 /* MP pixel intensity value */ -#define TIFFTAG_IT8TRANSPARENCYINDICATOR 34028 /* HC transparency switch */ -#define TIFFTAG_IT8COLORCHARACTERIZATION 34029 /* color character. table */ -#define TIFFTAG_IT8HCUSAGE 34030 /* HC usage indicator */ -#define TIFFTAG_IT8TRAPINDICATOR 34031 /* Trapping indicator - (untrapped=0, trapped=1) */ -#define TIFFTAG_IT8CMYKEQUIVALENT 34032 /* CMYK color equivalents */ -/* tags 34232-34236 are private tags registered to Texas Instruments */ -#define TIFFTAG_FRAMECOUNT 34232 /* Sequence Frame Count */ -/* tag 34377 is private tag registered to Adobe for PhotoShop */ -#define TIFFTAG_PHOTOSHOP 34377 -/* tags 34665, 34853 and 40965 are documented in EXIF specification */ -#define TIFFTAG_EXIFIFD 34665 /* Pointer to EXIF private directory */ -/* tag 34750 is a private tag registered to Adobe? */ -#define TIFFTAG_ICCPROFILE 34675 /* ICC profile data */ -#define TIFFTAG_IMAGELAYER 34732 /* !TIFF/FX image layer information */ -/* tag 34750 is a private tag registered to Pixel Magic */ -#define TIFFTAG_JBIGOPTIONS 34750 /* JBIG options */ -#define TIFFTAG_GPSIFD 34853 /* Pointer to GPS private directory */ -/* tags 34908-34914 are private tags registered to SGI */ -#define TIFFTAG_FAXRECVPARAMS 34908 /* encoded Class 2 ses. parms */ -#define TIFFTAG_FAXSUBADDRESS 34909 /* received SubAddr string */ -#define TIFFTAG_FAXRECVTIME 34910 /* receive time (secs) */ -#define TIFFTAG_FAXDCS 34911 /* encoded fax ses. params, Table 2/T.30 */ -/* tags 37439-37443 are registered to SGI <gregl@sgi.com> */ -#define TIFFTAG_STONITS 37439 /* Sample value to Nits */ -/* tag 34929 is a private tag registered to FedEx */ -#define TIFFTAG_FEDEX_EDR 34929 /* unknown use */ -#define TIFFTAG_INTEROPERABILITYIFD 40965 /* Pointer to Interoperability private directory */ -/* Adobe Digital Negative (DNG) format tags */ -#define TIFFTAG_DNGVERSION 50706 /* &DNG version number */ -#define TIFFTAG_DNGBACKWARDVERSION 50707 /* &DNG compatibility version */ -#define TIFFTAG_UNIQUECAMERAMODEL 50708 /* &name for the camera model */ -#define TIFFTAG_LOCALIZEDCAMERAMODEL 50709 /* &localized camera model - name */ -#define TIFFTAG_CFAPLANECOLOR 50710 /* &CFAPattern->LinearRaw space - mapping */ -#define TIFFTAG_CFALAYOUT 50711 /* &spatial layout of the CFA */ -#define TIFFTAG_LINEARIZATIONTABLE 50712 /* &lookup table description */ -#define TIFFTAG_BLACKLEVELREPEATDIM 50713 /* &repeat pattern size for - the BlackLevel tag */ -#define TIFFTAG_BLACKLEVEL 50714 /* &zero light encoding level */ -#define TIFFTAG_BLACKLEVELDELTAH 50715 /* &zero light encoding level - differences (columns) */ -#define TIFFTAG_BLACKLEVELDELTAV 50716 /* &zero light encoding level - differences (rows) */ -#define TIFFTAG_WHITELEVEL 50717 /* &fully saturated encoding - level */ -#define TIFFTAG_DEFAULTSCALE 50718 /* &default scale factors */ -#define TIFFTAG_DEFAULTCROPORIGIN 50719 /* &origin of the final image - area */ -#define TIFFTAG_DEFAULTCROPSIZE 50720 /* &size of the final image - area */ -#define TIFFTAG_COLORMATRIX1 50721 /* &XYZ->reference color space - transformation matrix 1 */ -#define TIFFTAG_COLORMATRIX2 50722 /* &XYZ->reference color space - transformation matrix 2 */ -#define TIFFTAG_CAMERACALIBRATION1 50723 /* &calibration matrix 1 */ -#define TIFFTAG_CAMERACALIBRATION2 50724 /* &calibration matrix 2 */ -#define TIFFTAG_REDUCTIONMATRIX1 50725 /* &dimensionality reduction - matrix 1 */ -#define TIFFTAG_REDUCTIONMATRIX2 50726 /* &dimensionality reduction - matrix 2 */ -#define TIFFTAG_ANALOGBALANCE 50727 /* &gain applied the stored raw - values*/ -#define TIFFTAG_ASSHOTNEUTRAL 50728 /* &selected white balance in - linear reference space */ -#define TIFFTAG_ASSHOTWHITEXY 50729 /* &selected white balance in - x-y chromaticity - coordinates */ -#define TIFFTAG_BASELINEEXPOSURE 50730 /* &how much to move the zero - point */ -#define TIFFTAG_BASELINENOISE 50731 /* &relative noise level */ -#define TIFFTAG_BASELINESHARPNESS 50732 /* &relative amount of - sharpening */ -#define TIFFTAG_BAYERGREENSPLIT 50733 /* &how closely the values of - the green pixels in the - blue/green rows track the - values of the green pixels - in the red/green rows */ -#define TIFFTAG_LINEARRESPONSELIMIT 50734 /* &non-linear encoding range */ -#define TIFFTAG_CAMERASERIALNUMBER 50735 /* &camera's serial number */ -#define TIFFTAG_LENSINFO 50736 /* info about the lens */ -#define TIFFTAG_CHROMABLURRADIUS 50737 /* &chroma blur radius */ -#define TIFFTAG_ANTIALIASSTRENGTH 50738 /* &relative strength of the - camera's anti-alias filter */ -#define TIFFTAG_SHADOWSCALE 50739 /* &used by Adobe Camera Raw */ -#define TIFFTAG_DNGPRIVATEDATA 50740 /* &manufacturer's private data */ -#define TIFFTAG_MAKERNOTESAFETY 50741 /* &whether the EXIF MakerNote - tag is safe to preserve - along with the rest of the - EXIF data */ -#define TIFFTAG_CALIBRATIONILLUMINANT1 50778 /* &illuminant 1 */ -#define TIFFTAG_CALIBRATIONILLUMINANT2 50779 /* &illuminant 2 */ -#define TIFFTAG_BESTQUALITYSCALE 50780 /* &best quality multiplier */ -#define TIFFTAG_RAWDATAUNIQUEID 50781 /* &unique identifier for - the raw image data */ -#define TIFFTAG_ORIGINALRAWFILENAME 50827 /* &file name of the original - raw file */ -#define TIFFTAG_ORIGINALRAWFILEDATA 50828 /* &contents of the original - raw file */ -#define TIFFTAG_ACTIVEAREA 50829 /* &active (non-masked) pixels - of the sensor */ -#define TIFFTAG_MASKEDAREAS 50830 /* &list of coordinates - of fully masked pixels */ -#define TIFFTAG_ASSHOTICCPROFILE 50831 /* &these two tags used to */ -#define TIFFTAG_ASSHOTPREPROFILEMATRIX 50832 /* map cameras's color space - into ICC profile space */ -#define TIFFTAG_CURRENTICCPROFILE 50833 /* & */ -#define TIFFTAG_CURRENTPREPROFILEMATRIX 50834 /* & */ -/* tag 65535 is an undefined tag used by Eastman Kodak */ -#define TIFFTAG_DCSHUESHIFTVALUES 65535 /* hue shift correction data */ - -/* - * The following are ``pseudo tags'' that can be used to control - * codec-specific functionality. These tags are not written to file. - * Note that these values start at 0xffff+1 so that they'll never - * collide with Aldus-assigned tags. - * - * If you want your private pseudo tags ``registered'' (i.e. added to - * this file), please post a bug report via the tracking system at - * http://www.remotesensing.org/libtiff/bugs.html with the appropriate - * C definitions to add. - */ -#define TIFFTAG_FAXMODE 65536 /* Group 3/4 format control */ -#define FAXMODE_CLASSIC 0x0000 /* default, include RTC */ -#define FAXMODE_NORTC 0x0001 /* no RTC at end of data */ -#define FAXMODE_NOEOL 0x0002 /* no EOL code at end of row */ -#define FAXMODE_BYTEALIGN 0x0004 /* byte align row */ -#define FAXMODE_WORDALIGN 0x0008 /* word align row */ -#define FAXMODE_CLASSF FAXMODE_NORTC /* TIFF Class F */ -#define TIFFTAG_JPEGQUALITY 65537 /* Compression quality level */ -/* Note: quality level is on the IJG 0-100 scale. Default value is 75 */ -#define TIFFTAG_JPEGCOLORMODE 65538 /* Auto RGB<=>YCbCr convert? */ -#define JPEGCOLORMODE_RAW 0x0000 /* no conversion (default) */ -#define JPEGCOLORMODE_RGB 0x0001 /* do auto conversion */ -#define TIFFTAG_JPEGTABLESMODE 65539 /* What to put in JPEGTables */ -#define JPEGTABLESMODE_QUANT 0x0001 /* include quantization tbls */ -#define JPEGTABLESMODE_HUFF 0x0002 /* include Huffman tbls */ -/* Note: default is JPEGTABLESMODE_QUANT | JPEGTABLESMODE_HUFF */ -#define TIFFTAG_FAXFILLFUNC 65540 /* G3/G4 fill function */ -#define TIFFTAG_PIXARLOGDATAFMT 65549 /* PixarLogCodec I/O data sz */ -#define PIXARLOGDATAFMT_8BIT 0 /* regular u_char samples */ -#define PIXARLOGDATAFMT_8BITABGR 1 /* ABGR-order u_chars */ -#define PIXARLOGDATAFMT_11BITLOG 2 /* 11-bit log-encoded (raw) */ -#define PIXARLOGDATAFMT_12BITPICIO 3 /* as per PICIO (1.0==2048) */ -#define PIXARLOGDATAFMT_16BIT 4 /* signed short samples */ -#define PIXARLOGDATAFMT_FLOAT 5 /* IEEE float samples */ -/* 65550-65556 are allocated to Oceana Matrix <dev@oceana.com> */ -#define TIFFTAG_DCSIMAGERTYPE 65550 /* imager model & filter */ -#define DCSIMAGERMODEL_M3 0 /* M3 chip (1280 x 1024) */ -#define DCSIMAGERMODEL_M5 1 /* M5 chip (1536 x 1024) */ -#define DCSIMAGERMODEL_M6 2 /* M6 chip (3072 x 2048) */ -#define DCSIMAGERFILTER_IR 0 /* infrared filter */ -#define DCSIMAGERFILTER_MONO 1 /* monochrome filter */ -#define DCSIMAGERFILTER_CFA 2 /* color filter array */ -#define DCSIMAGERFILTER_OTHER 3 /* other filter */ -#define TIFFTAG_DCSINTERPMODE 65551 /* interpolation mode */ -#define DCSINTERPMODE_NORMAL 0x0 /* whole image, default */ -#define DCSINTERPMODE_PREVIEW 0x1 /* preview of image (384x256) */ -#define TIFFTAG_DCSBALANCEARRAY 65552 /* color balance values */ -#define TIFFTAG_DCSCORRECTMATRIX 65553 /* color correction values */ -#define TIFFTAG_DCSGAMMA 65554 /* gamma value */ -#define TIFFTAG_DCSTOESHOULDERPTS 65555 /* toe & shoulder points */ -#define TIFFTAG_DCSCALIBRATIONFD 65556 /* calibration file desc */ -/* Note: quality level is on the ZLIB 1-9 scale. Default value is -1 */ -#define TIFFTAG_ZIPQUALITY 65557 /* compression quality level */ -#define TIFFTAG_PIXARLOGQUALITY 65558 /* PixarLog uses same scale */ -/* 65559 is allocated to Oceana Matrix <dev@oceana.com> */ -#define TIFFTAG_DCSCLIPRECTANGLE 65559 /* area of image to acquire */ -#define TIFFTAG_SGILOGDATAFMT 65560 /* SGILog user data format */ -#define SGILOGDATAFMT_FLOAT 0 /* IEEE float samples */ -#define SGILOGDATAFMT_16BIT 1 /* 16-bit samples */ -#define SGILOGDATAFMT_RAW 2 /* uninterpreted data */ -#define SGILOGDATAFMT_8BIT 3 /* 8-bit RGB monitor values */ -#define TIFFTAG_SGILOGENCODE 65561 /* SGILog data encoding control*/ -#define SGILOGENCODE_NODITHER 0 /* do not dither encoded values*/ -#define SGILOGENCODE_RANDITHER 1 /* randomly dither encd values */ -#define TIFFTAG_LZMAPRESET 65562 /* LZMA2 preset (compression level) */ -#define TIFFTAG_PERSAMPLE 65563 /* interface for per sample tags */ -#define PERSAMPLE_MERGED 0 /* present as a single value */ -#define PERSAMPLE_MULTI 1 /* present as multiple values */ - -/* - * EXIF tags - */ -#define EXIFTAG_EXPOSURETIME 33434 /* Exposure time */ -#define EXIFTAG_FNUMBER 33437 /* F number */ -#define EXIFTAG_EXPOSUREPROGRAM 34850 /* Exposure program */ -#define EXIFTAG_SPECTRALSENSITIVITY 34852 /* Spectral sensitivity */ -#define EXIFTAG_ISOSPEEDRATINGS 34855 /* ISO speed rating */ -#define EXIFTAG_OECF 34856 /* Optoelectric conversion - factor */ -#define EXIFTAG_EXIFVERSION 36864 /* Exif version */ -#define EXIFTAG_DATETIMEORIGINAL 36867 /* Date and time of original - data generation */ -#define EXIFTAG_DATETIMEDIGITIZED 36868 /* Date and time of digital - data generation */ -#define EXIFTAG_COMPONENTSCONFIGURATION 37121 /* Meaning of each component */ -#define EXIFTAG_COMPRESSEDBITSPERPIXEL 37122 /* Image compression mode */ -#define EXIFTAG_SHUTTERSPEEDVALUE 37377 /* Shutter speed */ -#define EXIFTAG_APERTUREVALUE 37378 /* Aperture */ -#define EXIFTAG_BRIGHTNESSVALUE 37379 /* Brightness */ -#define EXIFTAG_EXPOSUREBIASVALUE 37380 /* Exposure bias */ -#define EXIFTAG_MAXAPERTUREVALUE 37381 /* Maximum lens aperture */ -#define EXIFTAG_SUBJECTDISTANCE 37382 /* Subject distance */ -#define EXIFTAG_METERINGMODE 37383 /* Metering mode */ -#define EXIFTAG_LIGHTSOURCE 37384 /* Light source */ -#define EXIFTAG_FLASH 37385 /* Flash */ -#define EXIFTAG_FOCALLENGTH 37386 /* Lens focal length */ -#define EXIFTAG_SUBJECTAREA 37396 /* Subject area */ -#define EXIFTAG_MAKERNOTE 37500 /* Manufacturer notes */ -#define EXIFTAG_USERCOMMENT 37510 /* User comments */ -#define EXIFTAG_SUBSECTIME 37520 /* DateTime subseconds */ -#define EXIFTAG_SUBSECTIMEORIGINAL 37521 /* DateTimeOriginal subseconds */ -#define EXIFTAG_SUBSECTIMEDIGITIZED 37522 /* DateTimeDigitized subseconds */ -#define EXIFTAG_FLASHPIXVERSION 40960 /* Supported Flashpix version */ -#define EXIFTAG_COLORSPACE 40961 /* Color space information */ -#define EXIFTAG_PIXELXDIMENSION 40962 /* Valid image width */ -#define EXIFTAG_PIXELYDIMENSION 40963 /* Valid image height */ -#define EXIFTAG_RELATEDSOUNDFILE 40964 /* Related audio file */ -#define EXIFTAG_FLASHENERGY 41483 /* Flash energy */ -#define EXIFTAG_SPATIALFREQUENCYRESPONSE 41484 /* Spatial frequency response */ -#define EXIFTAG_FOCALPLANEXRESOLUTION 41486 /* Focal plane X resolution */ -#define EXIFTAG_FOCALPLANEYRESOLUTION 41487 /* Focal plane Y resolution */ -#define EXIFTAG_FOCALPLANERESOLUTIONUNIT 41488 /* Focal plane resolution unit */ -#define EXIFTAG_SUBJECTLOCATION 41492 /* Subject location */ -#define EXIFTAG_EXPOSUREINDEX 41493 /* Exposure index */ -#define EXIFTAG_SENSINGMETHOD 41495 /* Sensing method */ -#define EXIFTAG_FILESOURCE 41728 /* File source */ -#define EXIFTAG_SCENETYPE 41729 /* Scene type */ -#define EXIFTAG_CFAPATTERN 41730 /* CFA pattern */ -#define EXIFTAG_CUSTOMRENDERED 41985 /* Custom image processing */ -#define EXIFTAG_EXPOSUREMODE 41986 /* Exposure mode */ -#define EXIFTAG_WHITEBALANCE 41987 /* White balance */ -#define EXIFTAG_DIGITALZOOMRATIO 41988 /* Digital zoom ratio */ -#define EXIFTAG_FOCALLENGTHIN35MMFILM 41989 /* Focal length in 35 mm film */ -#define EXIFTAG_SCENECAPTURETYPE 41990 /* Scene capture type */ -#define EXIFTAG_GAINCONTROL 41991 /* Gain control */ -#define EXIFTAG_CONTRAST 41992 /* Contrast */ -#define EXIFTAG_SATURATION 41993 /* Saturation */ -#define EXIFTAG_SHARPNESS 41994 /* Sharpness */ -#define EXIFTAG_DEVICESETTINGDESCRIPTION 41995 /* Device settings description */ -#define EXIFTAG_SUBJECTDISTANCERANGE 41996 /* Subject distance range */ -#define EXIFTAG_GAINCONTROL 41991 /* Gain control */ -#define EXIFTAG_GAINCONTROL 41991 /* Gain control */ -#define EXIFTAG_IMAGEUNIQUEID 42016 /* Unique image ID */ - -#endif /* _TIFF_ */ - -/* vim: set ts=8 sts=8 sw=8 noet: */ -/* - * Local Variables: - * mode: c - * c-basic-offset: 8 - * fill-column: 78 - * End: - */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/tiffconf.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/tiffconf.h deleted file mode 100644 index 4322c323af..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/tiffconf.h +++ /dev/null @@ -1,128 +0,0 @@ -/* libtiff/tiffconf.h. Generated from tiffconf.h.in by configure. */ -/* - Configuration defines for installed libtiff. - This file maintained for backward compatibility. Do not use definitions - from this file in your programs. -*/ - -#ifndef _TIFFCONF_ -#define _TIFFCONF_ - -/* Signed 16-bit type */ -#define TIFF_INT16_T signed short - -/* Signed 32-bit type */ -#define TIFF_INT32_T signed int - -/* Signed 64-bit type */ -#define TIFF_INT64_T signed long long - -/* Signed 8-bit type */ -#define TIFF_INT8_T signed char - -/* Unsigned 16-bit type */ -#define TIFF_UINT16_T unsigned short - -/* Unsigned 32-bit type */ -#define TIFF_UINT32_T unsigned int - -/* Unsigned 64-bit type */ -#define TIFF_UINT64_T unsigned long long - -/* Unsigned 8-bit type */ -#define TIFF_UINT8_T unsigned char - -/* Signed size type */ -#define TIFF_SSIZE_T signed long - -/* Pointer difference type */ -#define TIFF_PTRDIFF_T ptrdiff_t - -/* Define to 1 if the system has the type `int16'. */ -/* #undef HAVE_INT16 */ - -/* Define to 1 if the system has the type `int32'. */ -/* #undef HAVE_INT32 */ - -/* Define to 1 if the system has the type `int8'. */ -/* #undef HAVE_INT8 */ - -/* Compatibility stuff. */ - -/* Define as 0 or 1 according to the floating point format suported by the - machine */ -#define HAVE_IEEEFP 1 - -/* Set the native cpu bit order (FILLORDER_LSB2MSB or FILLORDER_MSB2LSB) */ -#define HOST_FILLORDER FILLORDER_MSB2LSB - -/* Native cpu byte order: 1 if big-endian (Motorola) or 0 if little-endian - (Intel) */ -#define HOST_BIGENDIAN 0 - -/* Support CCITT Group 3 & 4 algorithms */ -#define CCITT_SUPPORT 1 - -/* Support JPEG compression (requires IJG JPEG library) */ -/* #undef JPEG_SUPPORT */ - -/* Support JBIG compression (requires JBIG-KIT library) */ -/* #undef JBIG_SUPPORT */ - -/* Support LogLuv high dynamic range encoding */ -#define LOGLUV_SUPPORT 1 - -/* Support LZW algorithm */ -#define LZW_SUPPORT 1 - -/* Support NeXT 2-bit RLE algorithm */ -#define NEXT_SUPPORT 1 - -/* Support Old JPEG compresson (read contrib/ojpeg/README first! Compilation - fails with unpatched IJG JPEG library) */ -/* #undef OJPEG_SUPPORT */ - -/* Support Macintosh PackBits algorithm */ -#define PACKBITS_SUPPORT 1 - -/* Support Pixar log-format algorithm (requires Zlib) */ -#define PIXARLOG_SUPPORT 1 - -/* Support ThunderScan 4-bit RLE algorithm */ -#define THUNDER_SUPPORT 1 - -/* Support Deflate compression */ -#define ZIP_SUPPORT 1 - -/* Support strip chopping (whether or not to convert single-strip uncompressed - images to mutiple strips of ~8Kb to reduce memory usage) */ -#define STRIPCHOP_DEFAULT TIFF_STRIPCHOP - -/* Enable SubIFD tag (330) support */ -#define SUBIFD_SUPPORT 1 - -/* Treat extra sample as alpha (default enabled). The RGBA interface will - treat a fourth sample with no EXTRASAMPLE_ value as being ASSOCALPHA. Many - packages produce RGBA files but don't mark the alpha properly. */ -#define DEFAULT_EXTRASAMPLE_AS_ALPHA 1 - -/* Pick up YCbCr subsampling info from the JPEG data stream to support files - lacking the tag (default enabled). */ -#define CHECK_JPEG_YCBCR_SUBSAMPLING 1 - -/* Support MS MDI magic number files as TIFF */ -#define MDI_SUPPORT 1 - -/* - * Feature support definitions. - * XXX: These macros are obsoleted. Don't use them in your apps! - * Macros stays here for backward compatibility and should be always defined. - */ -#define COLORIMETRY_SUPPORT -#define YCBCR_SUPPORT -#define CMYK_SUPPORT -#define ICC_SUPPORT -#define PHOTOSHOP_SUPPORT -#define IPTC_SUPPORT - -#endif /* _TIFFCONF_ */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/tiffio.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/tiffio.h deleted file mode 100644 index 038b67013f..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/tiffio.h +++ /dev/null @@ -1,557 +0,0 @@ -/* $Id: tiffio.h,v 1.91 2012-07-29 15:45:29 tgl Exp $ */ - -/* - * Copyright (c) 1988-1997 Sam Leffler - * Copyright (c) 1991-1997 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Sam Leffler and Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#ifndef _TIFFIO_ -#define _TIFFIO_ - -/* - * TIFF I/O Library Definitions. - */ -#include "tiff.h" -#include "tiffvers.h" - -/* - * TIFF is defined as an incomplete type to hide the - * library's internal data structures from clients. - */ -typedef struct tiff TIFF; - -/* - * The following typedefs define the intrinsic size of - * data types used in the *exported* interfaces. These - * definitions depend on the proper definition of types - * in tiff.h. Note also that the varargs interface used - * to pass tag types and values uses the types defined in - * tiff.h directly. - * - * NB: ttag_t is unsigned int and not unsigned short because - * ANSI C requires that the type before the ellipsis be a - * promoted type (i.e. one of int, unsigned int, pointer, - * or double) and because we defined pseudo-tags that are - * outside the range of legal Aldus-assigned tags. - * NB: tsize_t is int32 and not uint32 because some functions - * return -1. - * NB: toff_t is not off_t for many reasons; TIFFs max out at - * 32-bit file offsets, and BigTIFF maxes out at 64-bit - * offsets being the most important, and to ensure use of - * a consistently unsigned type across architectures. - * Prior to libtiff 4.0, this was an unsigned 32 bit type. - */ -/* - * this is the machine addressing size type, only it's signed, so make it - * int32 on 32bit machines, int64 on 64bit machines - */ -typedef TIFF_SSIZE_T tmsize_t; -typedef uint64 toff_t; /* file offset */ -/* the following are deprecated and should be replaced by their defining - counterparts */ -typedef uint32 ttag_t; /* directory tag */ -typedef uint16 tdir_t; /* directory index */ -typedef uint16 tsample_t; /* sample number */ -typedef uint32 tstrile_t; /* strip or tile number */ -typedef tstrile_t tstrip_t; /* strip number */ -typedef tstrile_t ttile_t; /* tile number */ -typedef tmsize_t tsize_t; /* i/o size in bytes */ -typedef void* tdata_t; /* image data ref */ - -#if !defined(__WIN32__) && (defined(_WIN32) || defined(WIN32)) -#define __WIN32__ -#endif - -/* - * On windows you should define USE_WIN32_FILEIO if you are using tif_win32.c - * or AVOID_WIN32_FILEIO if you are using something else (like tif_unix.c). - * - * By default tif_unix.c is assumed. - */ - -#if defined(_WINDOWS) || defined(__WIN32__) || defined(_Windows) -# if !defined(__CYGWIN) && !defined(AVOID_WIN32_FILEIO) && !defined(USE_WIN32_FILEIO) -# define AVOID_WIN32_FILEIO -# endif -#endif - -#if defined(USE_WIN32_FILEIO) -# define VC_EXTRALEAN -# include <windows.h> -# ifdef __WIN32__ -DECLARE_HANDLE(thandle_t); /* Win32 file handle */ -# else -typedef HFILE thandle_t; /* client data handle */ -# endif /* __WIN32__ */ -#else -typedef void* thandle_t; /* client data handle */ -#endif /* USE_WIN32_FILEIO */ - -/* - * Flags to pass to TIFFPrintDirectory to control - * printing of data structures that are potentially - * very large. Bit-or these flags to enable printing - * multiple items. - */ -#define TIFFPRINT_NONE 0x0 /* no extra info */ -#define TIFFPRINT_STRIPS 0x1 /* strips/tiles info */ -#define TIFFPRINT_CURVES 0x2 /* color/gray response curves */ -#define TIFFPRINT_COLORMAP 0x4 /* colormap */ -#define TIFFPRINT_JPEGQTABLES 0x100 /* JPEG Q matrices */ -#define TIFFPRINT_JPEGACTABLES 0x200 /* JPEG AC tables */ -#define TIFFPRINT_JPEGDCTABLES 0x200 /* JPEG DC tables */ - -/* - * Colour conversion stuff - */ - -/* reference white */ -#define D65_X0 (95.0470F) -#define D65_Y0 (100.0F) -#define D65_Z0 (108.8827F) - -#define D50_X0 (96.4250F) -#define D50_Y0 (100.0F) -#define D50_Z0 (82.4680F) - -/* Structure for holding information about a display device. */ - -typedef unsigned char TIFFRGBValue; /* 8-bit samples */ - -typedef struct { - float d_mat[3][3]; /* XYZ -> luminance matrix */ - float d_YCR; /* Light o/p for reference white */ - float d_YCG; - float d_YCB; - uint32 d_Vrwr; /* Pixel values for ref. white */ - uint32 d_Vrwg; - uint32 d_Vrwb; - float d_Y0R; /* Residual light for black pixel */ - float d_Y0G; - float d_Y0B; - float d_gammaR; /* Gamma values for the three guns */ - float d_gammaG; - float d_gammaB; -} TIFFDisplay; - -typedef struct { /* YCbCr->RGB support */ - TIFFRGBValue* clamptab; /* range clamping table */ - int* Cr_r_tab; - int* Cb_b_tab; - int32* Cr_g_tab; - int32* Cb_g_tab; - int32* Y_tab; -} TIFFYCbCrToRGB; - -typedef struct { /* CIE Lab 1976->RGB support */ - int range; /* Size of conversion table */ -#define CIELABTORGB_TABLE_RANGE 1500 - float rstep, gstep, bstep; - float X0, Y0, Z0; /* Reference white point */ - TIFFDisplay display; - float Yr2r[CIELABTORGB_TABLE_RANGE + 1]; /* Conversion of Yr to r */ - float Yg2g[CIELABTORGB_TABLE_RANGE + 1]; /* Conversion of Yg to g */ - float Yb2b[CIELABTORGB_TABLE_RANGE + 1]; /* Conversion of Yb to b */ -} TIFFCIELabToRGB; - -/* - * RGBA-style image support. - */ -typedef struct _TIFFRGBAImage TIFFRGBAImage; -/* - * The image reading and conversion routines invoke - * ``put routines'' to copy/image/whatever tiles of - * raw image data. A default set of routines are - * provided to convert/copy raw image data to 8-bit - * packed ABGR format rasters. Applications can supply - * alternate routines that unpack the data into a - * different format or, for example, unpack the data - * and draw the unpacked raster on the display. - */ -typedef void (*tileContigRoutine) - (TIFFRGBAImage*, uint32*, uint32, uint32, uint32, uint32, int32, int32, - unsigned char*); -typedef void (*tileSeparateRoutine) - (TIFFRGBAImage*, uint32*, uint32, uint32, uint32, uint32, int32, int32, - unsigned char*, unsigned char*, unsigned char*, unsigned char*); -/* - * RGBA-reader state. - */ -struct _TIFFRGBAImage { - TIFF* tif; /* image handle */ - int stoponerr; /* stop on read error */ - int isContig; /* data is packed/separate */ - int alpha; /* type of alpha data present */ - uint32 width; /* image width */ - uint32 height; /* image height */ - uint16 bitspersample; /* image bits/sample */ - uint16 samplesperpixel; /* image samples/pixel */ - uint16 orientation; /* image orientation */ - uint16 req_orientation; /* requested orientation */ - uint16 photometric; /* image photometric interp */ - uint16* redcmap; /* colormap pallete */ - uint16* greencmap; - uint16* bluecmap; - /* get image data routine */ - int (*get)(TIFFRGBAImage*, uint32*, uint32, uint32); - /* put decoded strip/tile */ - union { - void (*any)(TIFFRGBAImage*); - tileContigRoutine contig; - tileSeparateRoutine separate; - } put; - TIFFRGBValue* Map; /* sample mapping array */ - uint32** BWmap; /* black&white map */ - uint32** PALmap; /* palette image map */ - TIFFYCbCrToRGB* ycbcr; /* YCbCr conversion state */ - TIFFCIELabToRGB* cielab; /* CIE L*a*b conversion state */ - - uint8* UaToAa; /* Unassociated alpha to associated alpha convertion LUT */ - uint8* Bitdepth16To8; /* LUT for conversion from 16bit to 8bit values */ - - int row_offset; - int col_offset; -}; - -/* - * Macros for extracting components from the - * packed ABGR form returned by TIFFReadRGBAImage. - */ -#define TIFFGetR(abgr) ((abgr) & 0xff) -#define TIFFGetG(abgr) (((abgr) >> 8) & 0xff) -#define TIFFGetB(abgr) (((abgr) >> 16) & 0xff) -#define TIFFGetA(abgr) (((abgr) >> 24) & 0xff) - -/* - * A CODEC is a software package that implements decoding, - * encoding, or decoding+encoding of a compression algorithm. - * The library provides a collection of builtin codecs. - * More codecs may be registered through calls to the library - * and/or the builtin implementations may be overridden. - */ -typedef int (*TIFFInitMethod)(TIFF*, int); -typedef struct { - char* name; - uint16 scheme; - TIFFInitMethod init; -} TIFFCodec; - -#include <stdio.h> -#include <stdarg.h> - -/* share internal LogLuv conversion routines? */ -#ifndef LOGLUV_PUBLIC -#define LOGLUV_PUBLIC 1 -#endif - -#if !defined(__GNUC__) && !defined(__attribute__) -# define __attribute__(x) /*nothing*/ -#endif - -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif -typedef void (*TIFFErrorHandler)(const char*, const char*, va_list); -typedef void (*TIFFErrorHandlerExt)(thandle_t, const char*, const char*, va_list); -typedef tmsize_t (*TIFFReadWriteProc)(thandle_t, void*, tmsize_t); -typedef toff_t (*TIFFSeekProc)(thandle_t, toff_t, int); -typedef int (*TIFFCloseProc)(thandle_t); -typedef toff_t (*TIFFSizeProc)(thandle_t); -typedef int (*TIFFMapFileProc)(thandle_t, void** base, toff_t* size); -typedef void (*TIFFUnmapFileProc)(thandle_t, void* base, toff_t size); -typedef void (*TIFFExtendProc)(TIFF*); - -extern const char* TIFFGetVersion(void); - -extern const TIFFCodec* TIFFFindCODEC(uint16); -extern TIFFCodec* TIFFRegisterCODEC(uint16, const char*, TIFFInitMethod); -extern void TIFFUnRegisterCODEC(TIFFCodec*); -extern int TIFFIsCODECConfigured(uint16); -extern TIFFCodec* TIFFGetConfiguredCODECs(void); - -/* - * Auxiliary functions. - */ - -extern void* _TIFFmalloc(tmsize_t s); -extern void* _TIFFrealloc(void* p, tmsize_t s); -extern void _TIFFmemset(void* p, int v, tmsize_t c); -extern void _TIFFmemcpy(void* d, const void* s, tmsize_t c); -extern int _TIFFmemcmp(const void* p1, const void* p2, tmsize_t c); -extern void _TIFFfree(void* p); - -/* -** Stuff, related to tag handling and creating custom tags. -*/ -extern int TIFFGetTagListCount( TIFF * ); -extern uint32 TIFFGetTagListEntry( TIFF *, int tag_index ); - -#define TIFF_ANY TIFF_NOTYPE /* for field descriptor searching */ -#define TIFF_VARIABLE -1 /* marker for variable length tags */ -#define TIFF_SPP -2 /* marker for SamplesPerPixel tags */ -#define TIFF_VARIABLE2 -3 /* marker for uint32 var-length tags */ - -#define FIELD_CUSTOM 65 - -typedef struct _TIFFField TIFFField; -typedef struct _TIFFFieldArray TIFFFieldArray; - -extern const TIFFField* TIFFFindField(TIFF *, uint32, TIFFDataType); -extern const TIFFField* TIFFFieldWithTag(TIFF*, uint32); -extern const TIFFField* TIFFFieldWithName(TIFF*, const char *); - -extern uint32 TIFFFieldTag(const TIFFField*); -extern const char* TIFFFieldName(const TIFFField*); -extern TIFFDataType TIFFFieldDataType(const TIFFField*); -extern int TIFFFieldPassCount(const TIFFField*); -extern int TIFFFieldReadCount(const TIFFField*); -extern int TIFFFieldWriteCount(const TIFFField*); - -typedef int (*TIFFVSetMethod)(TIFF*, uint32, va_list); -typedef int (*TIFFVGetMethod)(TIFF*, uint32, va_list); -typedef void (*TIFFPrintMethod)(TIFF*, FILE*, long); - -typedef struct { - TIFFVSetMethod vsetfield; /* tag set routine */ - TIFFVGetMethod vgetfield; /* tag get routine */ - TIFFPrintMethod printdir; /* directory print routine */ -} TIFFTagMethods; - -extern TIFFTagMethods *TIFFAccessTagMethods(TIFF *); -extern void *TIFFGetClientInfo(TIFF *, const char *); -extern void TIFFSetClientInfo(TIFF *, void *, const char *); - -extern void TIFFCleanup(TIFF* tif); -extern void TIFFClose(TIFF* tif); -extern int TIFFFlush(TIFF* tif); -extern int TIFFFlushData(TIFF* tif); -extern int TIFFGetField(TIFF* tif, uint32 tag, ...); -extern int TIFFVGetField(TIFF* tif, uint32 tag, va_list ap); -extern int TIFFGetFieldDefaulted(TIFF* tif, uint32 tag, ...); -extern int TIFFVGetFieldDefaulted(TIFF* tif, uint32 tag, va_list ap); -extern int TIFFReadDirectory(TIFF* tif); -extern int TIFFReadCustomDirectory(TIFF* tif, toff_t diroff, const TIFFFieldArray* infoarray); -extern int TIFFReadEXIFDirectory(TIFF* tif, toff_t diroff); -extern uint64 TIFFScanlineSize64(TIFF* tif); -extern tmsize_t TIFFScanlineSize(TIFF* tif); -extern uint64 TIFFRasterScanlineSize64(TIFF* tif); -extern tmsize_t TIFFRasterScanlineSize(TIFF* tif); -extern uint64 TIFFStripSize64(TIFF* tif); -extern tmsize_t TIFFStripSize(TIFF* tif); -extern uint64 TIFFRawStripSize64(TIFF* tif, uint32 strip); -extern tmsize_t TIFFRawStripSize(TIFF* tif, uint32 strip); -extern uint64 TIFFVStripSize64(TIFF* tif, uint32 nrows); -extern tmsize_t TIFFVStripSize(TIFF* tif, uint32 nrows); -extern uint64 TIFFTileRowSize64(TIFF* tif); -extern tmsize_t TIFFTileRowSize(TIFF* tif); -extern uint64 TIFFTileSize64(TIFF* tif); -extern tmsize_t TIFFTileSize(TIFF* tif); -extern uint64 TIFFVTileSize64(TIFF* tif, uint32 nrows); -extern tmsize_t TIFFVTileSize(TIFF* tif, uint32 nrows); -extern uint32 TIFFDefaultStripSize(TIFF* tif, uint32 request); -extern void TIFFDefaultTileSize(TIFF*, uint32*, uint32*); -extern int TIFFFileno(TIFF*); -extern int TIFFSetFileno(TIFF*, int); -extern thandle_t TIFFClientdata(TIFF*); -extern thandle_t TIFFSetClientdata(TIFF*, thandle_t); -extern int TIFFGetMode(TIFF*); -extern int TIFFSetMode(TIFF*, int); -extern int TIFFIsTiled(TIFF*); -extern int TIFFIsByteSwapped(TIFF*); -extern int TIFFIsUpSampled(TIFF*); -extern int TIFFIsMSB2LSB(TIFF*); -extern int TIFFIsBigEndian(TIFF*); -extern TIFFReadWriteProc TIFFGetReadProc(TIFF*); -extern TIFFReadWriteProc TIFFGetWriteProc(TIFF*); -extern TIFFSeekProc TIFFGetSeekProc(TIFF*); -extern TIFFCloseProc TIFFGetCloseProc(TIFF*); -extern TIFFSizeProc TIFFGetSizeProc(TIFF*); -extern TIFFMapFileProc TIFFGetMapFileProc(TIFF*); -extern TIFFUnmapFileProc TIFFGetUnmapFileProc(TIFF*); -extern uint32 TIFFCurrentRow(TIFF*); -extern uint16 TIFFCurrentDirectory(TIFF*); -extern uint16 TIFFNumberOfDirectories(TIFF*); -extern uint64 TIFFCurrentDirOffset(TIFF*); -extern uint32 TIFFCurrentStrip(TIFF*); -extern uint32 TIFFCurrentTile(TIFF* tif); -extern int TIFFReadBufferSetup(TIFF* tif, void* bp, tmsize_t size); -extern int TIFFWriteBufferSetup(TIFF* tif, void* bp, tmsize_t size); -extern int TIFFSetupStrips(TIFF *); -extern int TIFFWriteCheck(TIFF*, int, const char *); -extern void TIFFFreeDirectory(TIFF*); -extern int TIFFCreateDirectory(TIFF*); -extern int TIFFCreateCustomDirectory(TIFF*,const TIFFFieldArray*); -extern int TIFFCreateEXIFDirectory(TIFF*); -extern int TIFFLastDirectory(TIFF*); -extern int TIFFSetDirectory(TIFF*, uint16); -extern int TIFFSetSubDirectory(TIFF*, uint64); -extern int TIFFUnlinkDirectory(TIFF*, uint16); -extern int TIFFSetField(TIFF*, uint32, ...); -extern int TIFFVSetField(TIFF*, uint32, va_list); -extern int TIFFUnsetField(TIFF*, uint32); -extern int TIFFWriteDirectory(TIFF *); -extern int TIFFWriteCustomDirectory(TIFF *, uint64 *); -extern int TIFFCheckpointDirectory(TIFF *); -extern int TIFFRewriteDirectory(TIFF *); - -#if defined(c_plusplus) || defined(__cplusplus) -extern void TIFFPrintDirectory(TIFF*, FILE*, long = 0); -extern int TIFFReadScanline(TIFF* tif, void* buf, uint32 row, uint16 sample = 0); -extern int TIFFWriteScanline(TIFF* tif, void* buf, uint32 row, uint16 sample = 0); -extern int TIFFReadRGBAImage(TIFF*, uint32, uint32, uint32*, int = 0); -extern int TIFFReadRGBAImageOriented(TIFF*, uint32, uint32, uint32*, - int = ORIENTATION_BOTLEFT, int = 0); -#else -extern void TIFFPrintDirectory(TIFF*, FILE*, long); -extern int TIFFReadScanline(TIFF* tif, void* buf, uint32 row, uint16 sample); -extern int TIFFWriteScanline(TIFF* tif, void* buf, uint32 row, uint16 sample); -extern int TIFFReadRGBAImage(TIFF*, uint32, uint32, uint32*, int); -extern int TIFFReadRGBAImageOriented(TIFF*, uint32, uint32, uint32*, int, int); -#endif - -extern int TIFFReadRGBAStrip(TIFF*, uint32, uint32 * ); -extern int TIFFReadRGBATile(TIFF*, uint32, uint32, uint32 * ); -extern int TIFFRGBAImageOK(TIFF*, char [1024]); -extern int TIFFRGBAImageBegin(TIFFRGBAImage*, TIFF*, int, char [1024]); -extern int TIFFRGBAImageGet(TIFFRGBAImage*, uint32*, uint32, uint32); -extern void TIFFRGBAImageEnd(TIFFRGBAImage*); -extern TIFF* TIFFOpen(const char*, const char*); -# ifdef __WIN32__ -extern TIFF* TIFFOpenW(const wchar_t*, const char*); -# endif /* __WIN32__ */ -extern TIFF* TIFFFdOpen(int, const char*, const char*); -extern TIFF* TIFFClientOpen(const char*, const char*, - thandle_t, - TIFFReadWriteProc, TIFFReadWriteProc, - TIFFSeekProc, TIFFCloseProc, - TIFFSizeProc, - TIFFMapFileProc, TIFFUnmapFileProc); -extern const char* TIFFFileName(TIFF*); -extern const char* TIFFSetFileName(TIFF*, const char *); -extern void TIFFError(const char*, const char*, ...) __attribute__((__format__ (__printf__,2,3))); -extern void TIFFErrorExt(thandle_t, const char*, const char*, ...) __attribute__((__format__ (__printf__,3,4))); -extern void TIFFWarning(const char*, const char*, ...) __attribute__((__format__ (__printf__,2,3))); -extern void TIFFWarningExt(thandle_t, const char*, const char*, ...) __attribute__((__format__ (__printf__,3,4))); -extern TIFFErrorHandler TIFFSetErrorHandler(TIFFErrorHandler); -extern TIFFErrorHandlerExt TIFFSetErrorHandlerExt(TIFFErrorHandlerExt); -extern TIFFErrorHandler TIFFSetWarningHandler(TIFFErrorHandler); -extern TIFFErrorHandlerExt TIFFSetWarningHandlerExt(TIFFErrorHandlerExt); -extern TIFFExtendProc TIFFSetTagExtender(TIFFExtendProc); -extern uint32 TIFFComputeTile(TIFF* tif, uint32 x, uint32 y, uint32 z, uint16 s); -extern int TIFFCheckTile(TIFF* tif, uint32 x, uint32 y, uint32 z, uint16 s); -extern uint32 TIFFNumberOfTiles(TIFF*); -extern tmsize_t TIFFReadTile(TIFF* tif, void* buf, uint32 x, uint32 y, uint32 z, uint16 s); -extern tmsize_t TIFFWriteTile(TIFF* tif, void* buf, uint32 x, uint32 y, uint32 z, uint16 s); -extern uint32 TIFFComputeStrip(TIFF*, uint32, uint16); -extern uint32 TIFFNumberOfStrips(TIFF*); -extern tmsize_t TIFFReadEncodedStrip(TIFF* tif, uint32 strip, void* buf, tmsize_t size); -extern tmsize_t TIFFReadRawStrip(TIFF* tif, uint32 strip, void* buf, tmsize_t size); -extern tmsize_t TIFFReadEncodedTile(TIFF* tif, uint32 tile, void* buf, tmsize_t size); -extern tmsize_t TIFFReadRawTile(TIFF* tif, uint32 tile, void* buf, tmsize_t size); -extern tmsize_t TIFFWriteEncodedStrip(TIFF* tif, uint32 strip, void* data, tmsize_t cc); -extern tmsize_t TIFFWriteRawStrip(TIFF* tif, uint32 strip, void* data, tmsize_t cc); -extern tmsize_t TIFFWriteEncodedTile(TIFF* tif, uint32 tile, void* data, tmsize_t cc); -extern tmsize_t TIFFWriteRawTile(TIFF* tif, uint32 tile, void* data, tmsize_t cc); -extern int TIFFDataWidth(TIFFDataType); /* table of tag datatype widths */ -extern void TIFFSetWriteOffset(TIFF* tif, toff_t off); -extern void TIFFSwabShort(uint16*); -extern void TIFFSwabLong(uint32*); -extern void TIFFSwabLong8(uint64*); -extern void TIFFSwabFloat(float*); -extern void TIFFSwabDouble(double*); -extern void TIFFSwabArrayOfShort(uint16* wp, tmsize_t n); -extern void TIFFSwabArrayOfTriples(uint8* tp, tmsize_t n); -extern void TIFFSwabArrayOfLong(uint32* lp, tmsize_t n); -extern void TIFFSwabArrayOfLong8(uint64* lp, tmsize_t n); -extern void TIFFSwabArrayOfFloat(float* fp, tmsize_t n); -extern void TIFFSwabArrayOfDouble(double* dp, tmsize_t n); -extern void TIFFReverseBits(uint8* cp, tmsize_t n); -extern const unsigned char* TIFFGetBitRevTable(int); - -#ifdef LOGLUV_PUBLIC -#define U_NEU 0.210526316 -#define V_NEU 0.473684211 -#define UVSCALE 410. -extern double LogL16toY(int); -extern double LogL10toY(int); -extern void XYZtoRGB24(float*, uint8*); -extern int uv_decode(double*, double*, int); -extern void LogLuv24toXYZ(uint32, float*); -extern void LogLuv32toXYZ(uint32, float*); -#if defined(c_plusplus) || defined(__cplusplus) -extern int LogL16fromY(double, int = SGILOGENCODE_NODITHER); -extern int LogL10fromY(double, int = SGILOGENCODE_NODITHER); -extern int uv_encode(double, double, int = SGILOGENCODE_NODITHER); -extern uint32 LogLuv24fromXYZ(float*, int = SGILOGENCODE_NODITHER); -extern uint32 LogLuv32fromXYZ(float*, int = SGILOGENCODE_NODITHER); -#else -extern int LogL16fromY(double, int); -extern int LogL10fromY(double, int); -extern int uv_encode(double, double, int); -extern uint32 LogLuv24fromXYZ(float*, int); -extern uint32 LogLuv32fromXYZ(float*, int); -#endif -#endif /* LOGLUV_PUBLIC */ - -extern int TIFFCIELabToRGBInit(TIFFCIELabToRGB*, const TIFFDisplay *, float*); -extern void TIFFCIELabToXYZ(TIFFCIELabToRGB *, uint32, int32, int32, - float *, float *, float *); -extern void TIFFXYZToRGB(TIFFCIELabToRGB *, float, float, float, - uint32 *, uint32 *, uint32 *); - -extern int TIFFYCbCrToRGBInit(TIFFYCbCrToRGB*, float*, float*); -extern void TIFFYCbCrtoRGB(TIFFYCbCrToRGB *, uint32, int32, int32, - uint32 *, uint32 *, uint32 *); - -/**************************************************************************** - * O B S O L E T E D I N T E R F A C E S - * - * Don't use this stuff in your applications, it may be removed in the future - * libtiff versions. - ****************************************************************************/ -typedef struct { - ttag_t field_tag; /* field's tag */ - short field_readcount; /* read count/TIFF_VARIABLE/TIFF_SPP */ - short field_writecount; /* write count/TIFF_VARIABLE */ - TIFFDataType field_type; /* type of associated data */ - unsigned short field_bit; /* bit in fieldsset bit vector */ - unsigned char field_oktochange; /* if true, can change while writing */ - unsigned char field_passcount; /* if true, pass dir count on set */ - char *field_name; /* ASCII name */ -} TIFFFieldInfo; - -extern int TIFFMergeFieldInfo(TIFF*, const TIFFFieldInfo[], uint32); - -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif - -#endif /* _TIFFIO_ */ - -/* vim: set ts=8 sts=8 sw=8 noet: */ -/* - * Local Variables: - * mode: c - * c-basic-offset: 8 - * fill-column: 78 - * End: - */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/tiffio.hxx b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/tiffio.hxx deleted file mode 100644 index ed994f1156..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/tiffio.hxx +++ /dev/null @@ -1,49 +0,0 @@ -/* $Id: tiffio.hxx,v 1.3 2010-06-08 18:55:15 bfriesen Exp $ */ - -/* - * Copyright (c) 1988-1997 Sam Leffler - * Copyright (c) 1991-1997 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Sam Leffler and Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#ifndef _TIFFIO_HXX_ -#define _TIFFIO_HXX_ - -/* - * TIFF I/O library definitions which provide C++ streams API. - */ - -#include <iostream> -#include "tiff.h" - -extern TIFF* TIFFStreamOpen(const char*, std::ostream *); -extern TIFF* TIFFStreamOpen(const char*, std::istream *); - -#endif /* _TIFFIO_HXX_ */ - -/* vim: set ts=8 sts=8 sw=8 noet: */ -/* - * Local Variables: - * mode: c++ - * c-basic-offset: 8 - * fill-column: 78 - * End: - */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/tiffvers.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/tiffvers.h deleted file mode 100644 index 40edc813d5..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/tiffvers.h +++ /dev/null @@ -1,9 +0,0 @@ -#define TIFFLIB_VERSION_STR "LIBTIFF, Version 4.0.3\nCopyright (c) 1988-1996 Sam Leffler\nCopyright (c) 1991-1996 Silicon Graphics, Inc." -/* - * This define can be used in code that requires - * compilation-related definitions specific to a - * version or versions of the library. Runtime - * version checking should be done based on the - * string returned by TIFFGetVersion. - */ -#define TIFFLIB_VERSION 20120922 diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/zconf.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/zconf.h deleted file mode 100644 index b234387442..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/zconf.h +++ /dev/null @@ -1,428 +0,0 @@ -/* zconf.h -- configuration of the zlib compression library - * Copyright (C) 1995-2010 Jean-loup Gailly. - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* @(#) $Id$ */ - -#ifndef ZCONF_H -#define ZCONF_H - -/* - * If you *really* need a unique prefix for all types and library functions, - * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. - * Even better than compiling with -DZ_PREFIX would be to use configure to set - * this permanently in zconf.h using "./configure --zprefix". - */ -#ifdef Z_PREFIX /* may be set to #if 1 by ./configure */ - -/* all linked symbols */ -# define _dist_code z__dist_code -# define _length_code z__length_code -# define _tr_align z__tr_align -# define _tr_flush_block z__tr_flush_block -# define _tr_init z__tr_init -# define _tr_stored_block z__tr_stored_block -# define _tr_tally z__tr_tally -# define adler32 z_adler32 -# define adler32_combine z_adler32_combine -# define adler32_combine64 z_adler32_combine64 -# define compress z_compress -# define compress2 z_compress2 -# define compressBound z_compressBound -# define crc32 z_crc32 -# define crc32_combine z_crc32_combine -# define crc32_combine64 z_crc32_combine64 -# define deflate z_deflate -# define deflateBound z_deflateBound -# define deflateCopy z_deflateCopy -# define deflateEnd z_deflateEnd -# define deflateInit2_ z_deflateInit2_ -# define deflateInit_ z_deflateInit_ -# define deflateParams z_deflateParams -# define deflatePrime z_deflatePrime -# define deflateReset z_deflateReset -# define deflateSetDictionary z_deflateSetDictionary -# define deflateSetHeader z_deflateSetHeader -# define deflateTune z_deflateTune -# define deflate_copyright z_deflate_copyright -# define get_crc_table z_get_crc_table -# define gz_error z_gz_error -# define gz_intmax z_gz_intmax -# define gz_strwinerror z_gz_strwinerror -# define gzbuffer z_gzbuffer -# define gzclearerr z_gzclearerr -# define gzclose z_gzclose -# define gzclose_r z_gzclose_r -# define gzclose_w z_gzclose_w -# define gzdirect z_gzdirect -# define gzdopen z_gzdopen -# define gzeof z_gzeof -# define gzerror z_gzerror -# define gzflush z_gzflush -# define gzgetc z_gzgetc -# define gzgets z_gzgets -# define gzoffset z_gzoffset -# define gzoffset64 z_gzoffset64 -# define gzopen z_gzopen -# define gzopen64 z_gzopen64 -# define gzprintf z_gzprintf -# define gzputc z_gzputc -# define gzputs z_gzputs -# define gzread z_gzread -# define gzrewind z_gzrewind -# define gzseek z_gzseek -# define gzseek64 z_gzseek64 -# define gzsetparams z_gzsetparams -# define gztell z_gztell -# define gztell64 z_gztell64 -# define gzungetc z_gzungetc -# define gzwrite z_gzwrite -# define inflate z_inflate -# define inflateBack z_inflateBack -# define inflateBackEnd z_inflateBackEnd -# define inflateBackInit_ z_inflateBackInit_ -# define inflateCopy z_inflateCopy -# define inflateEnd z_inflateEnd -# define inflateGetHeader z_inflateGetHeader -# define inflateInit2_ z_inflateInit2_ -# define inflateInit_ z_inflateInit_ -# define inflateMark z_inflateMark -# define inflatePrime z_inflatePrime -# define inflateReset z_inflateReset -# define inflateReset2 z_inflateReset2 -# define inflateSetDictionary z_inflateSetDictionary -# define inflateSync z_inflateSync -# define inflateSyncPoint z_inflateSyncPoint -# define inflateUndermine z_inflateUndermine -# define inflate_copyright z_inflate_copyright -# define inflate_fast z_inflate_fast -# define inflate_table z_inflate_table -# define uncompress z_uncompress -# define zError z_zError -# define zcalloc z_zcalloc -# define zcfree z_zcfree -# define zlibCompileFlags z_zlibCompileFlags -# define zlibVersion z_zlibVersion - -/* all zlib typedefs in zlib.h and zconf.h */ -# define Byte z_Byte -# define Bytef z_Bytef -# define alloc_func z_alloc_func -# define charf z_charf -# define free_func z_free_func -# define gzFile z_gzFile -# define gz_header z_gz_header -# define gz_headerp z_gz_headerp -# define in_func z_in_func -# define intf z_intf -# define out_func z_out_func -# define uInt z_uInt -# define uIntf z_uIntf -# define uLong z_uLong -# define uLongf z_uLongf -# define voidp z_voidp -# define voidpc z_voidpc -# define voidpf z_voidpf - -/* all zlib structs in zlib.h and zconf.h */ -# define gz_header_s z_gz_header_s -# define internal_state z_internal_state - -#endif - -#if defined(__MSDOS__) && !defined(MSDOS) -# define MSDOS -#endif -#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2) -# define OS2 -#endif -#if defined(_WINDOWS) && !defined(WINDOWS) -# define WINDOWS -#endif -#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__) -# ifndef WIN32 -# define WIN32 -# endif -#endif -#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32) -# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__) -# ifndef SYS16BIT -# define SYS16BIT -# endif -# endif -#endif - -/* - * Compile with -DMAXSEG_64K if the alloc function cannot allocate more - * than 64k bytes at a time (needed on systems with 16-bit int). - */ -#ifdef SYS16BIT -# define MAXSEG_64K -#endif -#ifdef MSDOS -# define UNALIGNED_OK -#endif - -#ifdef __STDC_VERSION__ -# ifndef STDC -# define STDC -# endif -# if __STDC_VERSION__ >= 199901L -# ifndef STDC99 -# define STDC99 -# endif -# endif -#endif -#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus)) -# define STDC -#endif -#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__)) -# define STDC -#endif -#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32)) -# define STDC -#endif -#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__)) -# define STDC -#endif - -#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */ -# define STDC -#endif - -#ifndef STDC -# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ -# define const /* note: need a more gentle solution here */ -# endif -#endif - -/* Some Mac compilers merge all .h files incorrectly: */ -#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__) -# define NO_DUMMY_DECL -#endif - -/* Maximum value for memLevel in deflateInit2 */ -#ifndef MAX_MEM_LEVEL -# ifdef MAXSEG_64K -# define MAX_MEM_LEVEL 8 -# else -# define MAX_MEM_LEVEL 9 -# endif -#endif - -/* Maximum value for windowBits in deflateInit2 and inflateInit2. - * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files - * created by gzip. (Files created by minigzip can still be extracted by - * gzip.) - */ -#ifndef MAX_WBITS -# define MAX_WBITS 15 /* 32K LZ77 window */ -#endif - -/* The memory requirements for deflate are (in bytes): - (1 << (windowBits+2)) + (1 << (memLevel+9)) - that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) - plus a few kilobytes for small objects. For example, if you want to reduce - the default memory requirements from 256K to 128K, compile with - make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" - Of course this will generally degrade compression (there's no free lunch). - - The memory requirements for inflate are (in bytes) 1 << windowBits - that is, 32K for windowBits=15 (default value) plus a few kilobytes - for small objects. -*/ - - /* Type declarations */ - -#ifndef OF /* function prototypes */ -# ifdef STDC -# define OF(args) args -# else -# define OF(args) () -# endif -#endif - -/* The following definitions for FAR are needed only for MSDOS mixed - * model programming (small or medium model with some far allocations). - * This was tested only with MSC; for other MSDOS compilers you may have - * to define NO_MEMCPY in zutil.h. If you don't need the mixed model, - * just define FAR to be empty. - */ -#ifdef SYS16BIT -# if defined(M_I86SM) || defined(M_I86MM) - /* MSC small or medium model */ -# define SMALL_MEDIUM -# ifdef _MSC_VER -# define FAR _far -# else -# define FAR far -# endif -# endif -# if (defined(__SMALL__) || defined(__MEDIUM__)) - /* Turbo C small or medium model */ -# define SMALL_MEDIUM -# ifdef __BORLANDC__ -# define FAR _far -# else -# define FAR far -# endif -# endif -#endif - -#if defined(WINDOWS) || defined(WIN32) - /* If building or using zlib as a DLL, define ZLIB_DLL. - * This is not mandatory, but it offers a little performance increase. - */ -# ifdef ZLIB_DLL -# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500)) -# ifdef ZLIB_INTERNAL -# define ZEXTERN extern __declspec(dllexport) -# else -# define ZEXTERN extern __declspec(dllimport) -# endif -# endif -# endif /* ZLIB_DLL */ - /* If building or using zlib with the WINAPI/WINAPIV calling convention, - * define ZLIB_WINAPI. - * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI. - */ -# ifdef ZLIB_WINAPI -# ifdef FAR -# undef FAR -# endif -# include <windows.h> - /* No need for _export, use ZLIB.DEF instead. */ - /* For complete Windows compatibility, use WINAPI, not __stdcall. */ -# define ZEXPORT WINAPI -# ifdef WIN32 -# define ZEXPORTVA WINAPIV -# else -# define ZEXPORTVA FAR CDECL -# endif -# endif -#endif - -#if defined (__BEOS__) -# ifdef ZLIB_DLL -# ifdef ZLIB_INTERNAL -# define ZEXPORT __declspec(dllexport) -# define ZEXPORTVA __declspec(dllexport) -# else -# define ZEXPORT __declspec(dllimport) -# define ZEXPORTVA __declspec(dllimport) -# endif -# endif -#endif - -#ifndef ZEXTERN -# define ZEXTERN extern -#endif -#ifndef ZEXPORT -# define ZEXPORT -#endif -#ifndef ZEXPORTVA -# define ZEXPORTVA -#endif - -#ifndef FAR -# define FAR -#endif - -#if !defined(__MACTYPES__) -typedef unsigned char Byte; /* 8 bits */ -#endif -typedef unsigned int uInt; /* 16 bits or more */ -typedef unsigned long uLong; /* 32 bits or more */ - -#ifdef SMALL_MEDIUM - /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ -# define Bytef Byte FAR -#else - typedef Byte FAR Bytef; -#endif -typedef char FAR charf; -typedef int FAR intf; -typedef uInt FAR uIntf; -typedef uLong FAR uLongf; - -#ifdef STDC - typedef void const *voidpc; - typedef void FAR *voidpf; - typedef void *voidp; -#else - typedef Byte const *voidpc; - typedef Byte FAR *voidpf; - typedef Byte *voidp; -#endif - -#if 1 /* was set to #if 1 by ./configure */ -# define Z_HAVE_UNISTD_H -#endif - -#ifdef STDC -# include <sys/types.h> /* for off_t */ -#endif - -/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and - * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even - * though the former does not conform to the LFS document), but considering - * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as - * equivalently requesting no 64-bit operations - */ -#if -_LARGEFILE64_SOURCE - -1 == 1 -# undef _LARGEFILE64_SOURCE -#endif - -#if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE) -# include <unistd.h> /* for SEEK_* and off_t */ -# ifdef VMS -# include <unixio.h> /* for off_t */ -# endif -# ifndef z_off_t -# define z_off_t off_t -# endif -#endif - -#ifndef SEEK_SET -# define SEEK_SET 0 /* Seek from beginning of file. */ -# define SEEK_CUR 1 /* Seek from current position. */ -# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ -#endif - -#ifndef z_off_t -# define z_off_t long -#endif - -#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0 -# define z_off64_t off64_t -#else -# define z_off64_t z_off_t -#endif - -#if defined(__OS400__) -# define NO_vsnprintf -#endif - -#if defined(__MVS__) -# define NO_vsnprintf -#endif - -/* MVS linker does not support external names larger than 8 bytes */ -#if defined(__MVS__) - #pragma map(deflateInit_,"DEIN") - #pragma map(deflateInit2_,"DEIN2") - #pragma map(deflateEnd,"DEEND") - #pragma map(deflateBound,"DEBND") - #pragma map(inflateInit_,"ININ") - #pragma map(inflateInit2_,"ININ2") - #pragma map(inflateEnd,"INEND") - #pragma map(inflateSync,"INSY") - #pragma map(inflateSetDictionary,"INSEDI") - #pragma map(compressBound,"CMBND") - #pragma map(inflate_table,"INTABL") - #pragma map(inflate_fast,"INFA") - #pragma map(inflate_copyright,"INCOPY") -#endif - -#endif /* ZCONF_H */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/zlib.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/zlib.h deleted file mode 100644 index d3a3da8e14..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/zlib.h +++ /dev/null @@ -1,1613 +0,0 @@ -/* zlib.h -- interface of the 'zlib' general purpose compression library - version 1.2.5, April 19th, 2010 - - Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - Jean-loup Gailly Mark Adler - jloup@gzip.org madler@alumni.caltech.edu - - - The data format used by the zlib library is described by RFCs (Request for - Comments) 1950 to 1952 in the files http://www.ietf.org/rfc/rfc1950.txt - (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format). -*/ - -#ifndef ZLIB_H -#define ZLIB_H - -#include "zconf.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define ZLIB_VERSION "1.2.5" -#define ZLIB_VERNUM 0x1250 -#define ZLIB_VER_MAJOR 1 -#define ZLIB_VER_MINOR 2 -#define ZLIB_VER_REVISION 5 -#define ZLIB_VER_SUBREVISION 0 - -/* - The 'zlib' compression library provides in-memory compression and - decompression functions, including integrity checks of the uncompressed data. - This version of the library supports only one compression method (deflation) - but other algorithms will be added later and will have the same stream - interface. - - Compression can be done in a single step if the buffers are large enough, - or can be done by repeated calls of the compression function. In the latter - case, the application must provide more input and/or consume the output - (providing more output space) before each call. - - The compressed data format used by default by the in-memory functions is - the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped - around a deflate stream, which is itself documented in RFC 1951. - - The library also supports reading and writing files in gzip (.gz) format - with an interface similar to that of stdio using the functions that start - with "gz". The gzip format is different from the zlib format. gzip is a - gzip wrapper, documented in RFC 1952, wrapped around a deflate stream. - - This library can optionally read and write gzip streams in memory as well. - - The zlib format was designed to be compact and fast for use in memory - and on communications channels. The gzip format was designed for single- - file compression on file systems, has a larger header than zlib to maintain - directory information, and uses a different, slower check method than zlib. - - The library does not install any signal handler. The decoder checks - the consistency of the compressed data, so the library should never crash - even in case of corrupted input. -*/ - -typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size)); -typedef void (*free_func) OF((voidpf opaque, voidpf address)); - -struct internal_state; - -typedef struct z_stream_s { - Bytef *next_in; /* next input byte */ - uInt avail_in; /* number of bytes available at next_in */ - uLong total_in; /* total nb of input bytes read so far */ - - Bytef *next_out; /* next output byte should be put there */ - uInt avail_out; /* remaining free space at next_out */ - uLong total_out; /* total nb of bytes output so far */ - - char *msg; /* last error message, NULL if no error */ - struct internal_state FAR *state; /* not visible by applications */ - - alloc_func zalloc; /* used to allocate the internal state */ - free_func zfree; /* used to free the internal state */ - voidpf opaque; /* private data object passed to zalloc and zfree */ - - int data_type; /* best guess about the data type: binary or text */ - uLong adler; /* adler32 value of the uncompressed data */ - uLong reserved; /* reserved for future use */ -} z_stream; - -typedef z_stream FAR *z_streamp; - -/* - gzip header information passed to and from zlib routines. See RFC 1952 - for more details on the meanings of these fields. -*/ -typedef struct gz_header_s { - int text; /* true if compressed data believed to be text */ - uLong time; /* modification time */ - int xflags; /* extra flags (not used when writing a gzip file) */ - int os; /* operating system */ - Bytef *extra; /* pointer to extra field or Z_NULL if none */ - uInt extra_len; /* extra field length (valid if extra != Z_NULL) */ - uInt extra_max; /* space at extra (only when reading header) */ - Bytef *name; /* pointer to zero-terminated file name or Z_NULL */ - uInt name_max; /* space at name (only when reading header) */ - Bytef *comment; /* pointer to zero-terminated comment or Z_NULL */ - uInt comm_max; /* space at comment (only when reading header) */ - int hcrc; /* true if there was or will be a header crc */ - int done; /* true when done reading gzip header (not used - when writing a gzip file) */ -} gz_header; - -typedef gz_header FAR *gz_headerp; - -/* - The application must update next_in and avail_in when avail_in has dropped - to zero. It must update next_out and avail_out when avail_out has dropped - to zero. The application must initialize zalloc, zfree and opaque before - calling the init function. All other fields are set by the compression - library and must not be updated by the application. - - The opaque value provided by the application will be passed as the first - parameter for calls of zalloc and zfree. This can be useful for custom - memory management. The compression library attaches no meaning to the - opaque value. - - zalloc must return Z_NULL if there is not enough memory for the object. - If zlib is used in a multi-threaded application, zalloc and zfree must be - thread safe. - - On 16-bit systems, the functions zalloc and zfree must be able to allocate - exactly 65536 bytes, but will not be required to allocate more than this if - the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS, pointers - returned by zalloc for objects of exactly 65536 bytes *must* have their - offset normalized to zero. The default allocation function provided by this - library ensures this (see zutil.c). To reduce memory requirements and avoid - any allocation of 64K objects, at the expense of compression ratio, compile - the library with -DMAX_WBITS=14 (see zconf.h). - - The fields total_in and total_out can be used for statistics or progress - reports. After compression, total_in holds the total size of the - uncompressed data and may be saved for use in the decompressor (particularly - if the decompressor wants to decompress everything in a single step). -*/ - - /* constants */ - -#define Z_NO_FLUSH 0 -#define Z_PARTIAL_FLUSH 1 -#define Z_SYNC_FLUSH 2 -#define Z_FULL_FLUSH 3 -#define Z_FINISH 4 -#define Z_BLOCK 5 -#define Z_TREES 6 -/* Allowed flush values; see deflate() and inflate() below for details */ - -#define Z_OK 0 -#define Z_STREAM_END 1 -#define Z_NEED_DICT 2 -#define Z_ERRNO (-1) -#define Z_STREAM_ERROR (-2) -#define Z_DATA_ERROR (-3) -#define Z_MEM_ERROR (-4) -#define Z_BUF_ERROR (-5) -#define Z_VERSION_ERROR (-6) -/* Return codes for the compression/decompression functions. Negative values - * are errors, positive values are used for special but normal events. - */ - -#define Z_NO_COMPRESSION 0 -#define Z_BEST_SPEED 1 -#define Z_BEST_COMPRESSION 9 -#define Z_DEFAULT_COMPRESSION (-1) -/* compression levels */ - -#define Z_FILTERED 1 -#define Z_HUFFMAN_ONLY 2 -#define Z_RLE 3 -#define Z_FIXED 4 -#define Z_DEFAULT_STRATEGY 0 -/* compression strategy; see deflateInit2() below for details */ - -#define Z_BINARY 0 -#define Z_TEXT 1 -#define Z_ASCII Z_TEXT /* for compatibility with 1.2.2 and earlier */ -#define Z_UNKNOWN 2 -/* Possible values of the data_type field (though see inflate()) */ - -#define Z_DEFLATED 8 -/* The deflate compression method (the only one supported in this version) */ - -#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */ - -#define zlib_version zlibVersion() -/* for compatibility with versions < 1.0.2 */ - - - /* basic functions */ - -ZEXTERN const char * ZEXPORT zlibVersion OF((void)); -/* The application can compare zlibVersion and ZLIB_VERSION for consistency. - If the first character differs, the library code actually used is not - compatible with the zlib.h header file used by the application. This check - is automatically made by deflateInit and inflateInit. - */ - -/* -ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level)); - - Initializes the internal stream state for compression. The fields - zalloc, zfree and opaque must be initialized before by the caller. If - zalloc and zfree are set to Z_NULL, deflateInit updates them to use default - allocation functions. - - The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9: - 1 gives best speed, 9 gives best compression, 0 gives no compression at all - (the input data is simply copied a block at a time). Z_DEFAULT_COMPRESSION - requests a default compromise between speed and compression (currently - equivalent to level 6). - - deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_STREAM_ERROR if level is not a valid compression level, or - Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible - with the version assumed by the caller (ZLIB_VERSION). msg is set to null - if there is no error message. deflateInit does not perform any compression: - this will be done by deflate(). -*/ - - -ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); -/* - deflate compresses as much data as possible, and stops when the input - buffer becomes empty or the output buffer becomes full. It may introduce - some output latency (reading input without producing any output) except when - forced to flush. - - The detailed semantics are as follows. deflate performs one or both of the - following actions: - - - Compress more input starting at next_in and update next_in and avail_in - accordingly. If not all input can be processed (because there is not - enough room in the output buffer), next_in and avail_in are updated and - processing will resume at this point for the next call of deflate(). - - - Provide more output starting at next_out and update next_out and avail_out - accordingly. This action is forced if the parameter flush is non zero. - Forcing flush frequently degrades the compression ratio, so this parameter - should be set only when necessary (in interactive applications). Some - output may be provided even if flush is not set. - - Before the call of deflate(), the application should ensure that at least - one of the actions is possible, by providing more input and/or consuming more - output, and updating avail_in or avail_out accordingly; avail_out should - never be zero before the call. The application can consume the compressed - output when it wants, for example when the output buffer is full (avail_out - == 0), or after each call of deflate(). If deflate returns Z_OK and with - zero avail_out, it must be called again after making room in the output - buffer because there might be more output pending. - - Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to - decide how much data to accumulate before producing output, in order to - maximize compression. - - If the parameter flush is set to Z_SYNC_FLUSH, all pending output is - flushed to the output buffer and the output is aligned on a byte boundary, so - that the decompressor can get all input data available so far. (In - particular avail_in is zero after the call if enough output space has been - provided before the call.) Flushing may degrade compression for some - compression algorithms and so it should be used only when necessary. This - completes the current deflate block and follows it with an empty stored block - that is three bits plus filler bits to the next byte, followed by four bytes - (00 00 ff ff). - - If flush is set to Z_PARTIAL_FLUSH, all pending output is flushed to the - output buffer, but the output is not aligned to a byte boundary. All of the - input data so far will be available to the decompressor, as for Z_SYNC_FLUSH. - This completes the current deflate block and follows it with an empty fixed - codes block that is 10 bits long. This assures that enough bytes are output - in order for the decompressor to finish the block before the empty fixed code - block. - - If flush is set to Z_BLOCK, a deflate block is completed and emitted, as - for Z_SYNC_FLUSH, but the output is not aligned on a byte boundary, and up to - seven bits of the current block are held to be written as the next byte after - the next deflate block is completed. In this case, the decompressor may not - be provided enough bits at this point in order to complete decompression of - the data provided so far to the compressor. It may need to wait for the next - block to be emitted. This is for advanced applications that need to control - the emission of deflate blocks. - - If flush is set to Z_FULL_FLUSH, all output is flushed as with - Z_SYNC_FLUSH, and the compression state is reset so that decompression can - restart from this point if previous compressed data has been damaged or if - random access is desired. Using Z_FULL_FLUSH too often can seriously degrade - compression. - - If deflate returns with avail_out == 0, this function must be called again - with the same value of the flush parameter and more output space (updated - avail_out), until the flush is complete (deflate returns with non-zero - avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that - avail_out is greater than six to avoid repeated flush markers due to - avail_out == 0 on return. - - If the parameter flush is set to Z_FINISH, pending input is processed, - pending output is flushed and deflate returns with Z_STREAM_END if there was - enough output space; if deflate returns with Z_OK, this function must be - called again with Z_FINISH and more output space (updated avail_out) but no - more input data, until it returns with Z_STREAM_END or an error. After - deflate has returned Z_STREAM_END, the only possible operations on the stream - are deflateReset or deflateEnd. - - Z_FINISH can be used immediately after deflateInit if all the compression - is to be done in a single step. In this case, avail_out must be at least the - value returned by deflateBound (see below). If deflate does not return - Z_STREAM_END, then it must be called again as described above. - - deflate() sets strm->adler to the adler32 checksum of all input read - so far (that is, total_in bytes). - - deflate() may update strm->data_type if it can make a good guess about - the input data type (Z_BINARY or Z_TEXT). In doubt, the data is considered - binary. This field is only for information purposes and does not affect the - compression algorithm in any manner. - - deflate() returns Z_OK if some progress has been made (more input - processed or more output produced), Z_STREAM_END if all input has been - consumed and all output has been produced (only when flush is set to - Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example - if next_in or next_out was Z_NULL), Z_BUF_ERROR if no progress is possible - (for example avail_in or avail_out was zero). Note that Z_BUF_ERROR is not - fatal, and deflate() can be called again with more input and more output - space to continue compressing. -*/ - - -ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm)); -/* - All dynamically allocated data structures for this stream are freed. - This function discards any unprocessed input and does not flush any pending - output. - - deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the - stream state was inconsistent, Z_DATA_ERROR if the stream was freed - prematurely (some input or output was discarded). In the error case, msg - may be set but then points to a static string (which must not be - deallocated). -*/ - - -/* -ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm)); - - Initializes the internal stream state for decompression. The fields - next_in, avail_in, zalloc, zfree and opaque must be initialized before by - the caller. If next_in is not Z_NULL and avail_in is large enough (the - exact value depends on the compression method), inflateInit determines the - compression method from the zlib header and allocates all data structures - accordingly; otherwise the allocation will be deferred to the first call of - inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to - use default allocation functions. - - inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_VERSION_ERROR if the zlib library version is incompatible with the - version assumed by the caller, or Z_STREAM_ERROR if the parameters are - invalid, such as a null pointer to the structure. msg is set to null if - there is no error message. inflateInit does not perform any decompression - apart from possibly reading the zlib header if present: actual decompression - will be done by inflate(). (So next_in and avail_in may be modified, but - next_out and avail_out are unused and unchanged.) The current implementation - of inflateInit() does not process any header information -- that is deferred - until inflate() is called. -*/ - - -ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); -/* - inflate decompresses as much data as possible, and stops when the input - buffer becomes empty or the output buffer becomes full. It may introduce - some output latency (reading input without producing any output) except when - forced to flush. - - The detailed semantics are as follows. inflate performs one or both of the - following actions: - - - Decompress more input starting at next_in and update next_in and avail_in - accordingly. If not all input can be processed (because there is not - enough room in the output buffer), next_in is updated and processing will - resume at this point for the next call of inflate(). - - - Provide more output starting at next_out and update next_out and avail_out - accordingly. inflate() provides as much output as possible, until there is - no more input data or no more space in the output buffer (see below about - the flush parameter). - - Before the call of inflate(), the application should ensure that at least - one of the actions is possible, by providing more input and/or consuming more - output, and updating the next_* and avail_* values accordingly. The - application can consume the uncompressed output when it wants, for example - when the output buffer is full (avail_out == 0), or after each call of - inflate(). If inflate returns Z_OK and with zero avail_out, it must be - called again after making room in the output buffer because there might be - more output pending. - - The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH, Z_FINISH, - Z_BLOCK, or Z_TREES. Z_SYNC_FLUSH requests that inflate() flush as much - output as possible to the output buffer. Z_BLOCK requests that inflate() - stop if and when it gets to the next deflate block boundary. When decoding - the zlib or gzip format, this will cause inflate() to return immediately - after the header and before the first block. When doing a raw inflate, - inflate() will go ahead and process the first block, and will return when it - gets to the end of that block, or when it runs out of data. - - The Z_BLOCK option assists in appending to or combining deflate streams. - Also to assist in this, on return inflate() will set strm->data_type to the - number of unused bits in the last byte taken from strm->next_in, plus 64 if - inflate() is currently decoding the last block in the deflate stream, plus - 128 if inflate() returned immediately after decoding an end-of-block code or - decoding the complete header up to just before the first byte of the deflate - stream. The end-of-block will not be indicated until all of the uncompressed - data from that block has been written to strm->next_out. The number of - unused bits may in general be greater than seven, except when bit 7 of - data_type is set, in which case the number of unused bits will be less than - eight. data_type is set as noted here every time inflate() returns for all - flush options, and so can be used to determine the amount of currently - consumed input in bits. - - The Z_TREES option behaves as Z_BLOCK does, but it also returns when the - end of each deflate block header is reached, before any actual data in that - block is decoded. This allows the caller to determine the length of the - deflate block header for later use in random access within a deflate block. - 256 is added to the value of strm->data_type when inflate() returns - immediately after reaching the end of the deflate block header. - - inflate() should normally be called until it returns Z_STREAM_END or an - error. However if all decompression is to be performed in a single step (a - single call of inflate), the parameter flush should be set to Z_FINISH. In - this case all pending input is processed and all pending output is flushed; - avail_out must be large enough to hold all the uncompressed data. (The size - of the uncompressed data may have been saved by the compressor for this - purpose.) The next operation on this stream must be inflateEnd to deallocate - the decompression state. The use of Z_FINISH is never required, but can be - used to inform inflate that a faster approach may be used for the single - inflate() call. - - In this implementation, inflate() always flushes as much output as - possible to the output buffer, and always uses the faster approach on the - first call. So the only effect of the flush parameter in this implementation - is on the return value of inflate(), as noted below, or when it returns early - because Z_BLOCK or Z_TREES is used. - - If a preset dictionary is needed after this call (see inflateSetDictionary - below), inflate sets strm->adler to the adler32 checksum of the dictionary - chosen by the compressor and returns Z_NEED_DICT; otherwise it sets - strm->adler to the adler32 checksum of all output produced so far (that is, - total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described - below. At the end of the stream, inflate() checks that its computed adler32 - checksum is equal to that saved by the compressor and returns Z_STREAM_END - only if the checksum is correct. - - inflate() can decompress and check either zlib-wrapped or gzip-wrapped - deflate data. The header type is detected automatically, if requested when - initializing with inflateInit2(). Any information contained in the gzip - header is not retained, so applications that need that information should - instead use raw inflate, see inflateInit2() below, or inflateBack() and - perform their own processing of the gzip header and trailer. - - inflate() returns Z_OK if some progress has been made (more input processed - or more output produced), Z_STREAM_END if the end of the compressed data has - been reached and all uncompressed output has been produced, Z_NEED_DICT if a - preset dictionary is needed at this point, Z_DATA_ERROR if the input data was - corrupted (input stream not conforming to the zlib format or incorrect check - value), Z_STREAM_ERROR if the stream structure was inconsistent (for example - next_in or next_out was Z_NULL), Z_MEM_ERROR if there was not enough memory, - Z_BUF_ERROR if no progress is possible or if there was not enough room in the - output buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and - inflate() can be called again with more input and more output space to - continue decompressing. If Z_DATA_ERROR is returned, the application may - then call inflateSync() to look for a good compression block if a partial - recovery of the data is desired. -*/ - - -ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm)); -/* - All dynamically allocated data structures for this stream are freed. - This function discards any unprocessed input and does not flush any pending - output. - - inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state - was inconsistent. In the error case, msg may be set but then points to a - static string (which must not be deallocated). -*/ - - - /* Advanced functions */ - -/* - The following functions are needed only in some special applications. -*/ - -/* -ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm, - int level, - int method, - int windowBits, - int memLevel, - int strategy)); - - This is another version of deflateInit with more compression options. The - fields next_in, zalloc, zfree and opaque must be initialized before by the - caller. - - The method parameter is the compression method. It must be Z_DEFLATED in - this version of the library. - - The windowBits parameter is the base two logarithm of the window size - (the size of the history buffer). It should be in the range 8..15 for this - version of the library. Larger values of this parameter result in better - compression at the expense of memory usage. The default value is 15 if - deflateInit is used instead. - - windowBits can also be -8..-15 for raw deflate. In this case, -windowBits - determines the window size. deflate() will then generate raw deflate data - with no zlib header or trailer, and will not compute an adler32 check value. - - windowBits can also be greater than 15 for optional gzip encoding. Add - 16 to windowBits to write a simple gzip header and trailer around the - compressed data instead of a zlib wrapper. The gzip header will have no - file name, no extra data, no comment, no modification time (set to zero), no - header crc, and the operating system will be set to 255 (unknown). If a - gzip stream is being written, strm->adler is a crc32 instead of an adler32. - - The memLevel parameter specifies how much memory should be allocated - for the internal compression state. memLevel=1 uses minimum memory but is - slow and reduces compression ratio; memLevel=9 uses maximum memory for - optimal speed. The default value is 8. See zconf.h for total memory usage - as a function of windowBits and memLevel. - - The strategy parameter is used to tune the compression algorithm. Use the - value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a - filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no - string match), or Z_RLE to limit match distances to one (run-length - encoding). Filtered data consists mostly of small values with a somewhat - random distribution. In this case, the compression algorithm is tuned to - compress them better. The effect of Z_FILTERED is to force more Huffman - coding and less string matching; it is somewhat intermediate between - Z_DEFAULT_STRATEGY and Z_HUFFMAN_ONLY. Z_RLE is designed to be almost as - fast as Z_HUFFMAN_ONLY, but give better compression for PNG image data. The - strategy parameter only affects the compression ratio but not the - correctness of the compressed output even if it is not set appropriately. - Z_FIXED prevents the use of dynamic Huffman codes, allowing for a simpler - decoder for special applications. - - deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_STREAM_ERROR if any parameter is invalid (such as an invalid - method), or Z_VERSION_ERROR if the zlib library version (zlib_version) is - incompatible with the version assumed by the caller (ZLIB_VERSION). msg is - set to null if there is no error message. deflateInit2 does not perform any - compression: this will be done by deflate(). -*/ - -ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, - const Bytef *dictionary, - uInt dictLength)); -/* - Initializes the compression dictionary from the given byte sequence - without producing any compressed output. This function must be called - immediately after deflateInit, deflateInit2 or deflateReset, before any call - of deflate. The compressor and decompressor must use exactly the same - dictionary (see inflateSetDictionary). - - The dictionary should consist of strings (byte sequences) that are likely - to be encountered later in the data to be compressed, with the most commonly - used strings preferably put towards the end of the dictionary. Using a - dictionary is most useful when the data to be compressed is short and can be - predicted with good accuracy; the data can then be compressed better than - with the default empty dictionary. - - Depending on the size of the compression data structures selected by - deflateInit or deflateInit2, a part of the dictionary may in effect be - discarded, for example if the dictionary is larger than the window size - provided in deflateInit or deflateInit2. Thus the strings most likely to be - useful should be put at the end of the dictionary, not at the front. In - addition, the current implementation of deflate will use at most the window - size minus 262 bytes of the provided dictionary. - - Upon return of this function, strm->adler is set to the adler32 value - of the dictionary; the decompressor may later use this value to determine - which dictionary has been used by the compressor. (The adler32 value - applies to the whole dictionary even if only a subset of the dictionary is - actually used by the compressor.) If a raw deflate was requested, then the - adler32 value is not computed and strm->adler is not set. - - deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a - parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is - inconsistent (for example if deflate has already been called for this stream - or if the compression method is bsort). deflateSetDictionary does not - perform any compression: this will be done by deflate(). -*/ - -ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest, - z_streamp source)); -/* - Sets the destination stream as a complete copy of the source stream. - - This function can be useful when several compression strategies will be - tried, for example when there are several ways of pre-processing the input - data with a filter. The streams that will be discarded should then be freed - by calling deflateEnd. Note that deflateCopy duplicates the internal - compression state which can be quite large, so this strategy is slow and can - consume lots of memory. - - deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_STREAM_ERROR if the source stream state was inconsistent - (such as zalloc being Z_NULL). msg is left unchanged in both source and - destination. -*/ - -ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm)); -/* - This function is equivalent to deflateEnd followed by deflateInit, - but does not free and reallocate all the internal compression state. The - stream will keep the same compression level and any other attributes that - may have been set by deflateInit2. - - deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent (such as zalloc or state being Z_NULL). -*/ - -ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm, - int level, - int strategy)); -/* - Dynamically update the compression level and compression strategy. The - interpretation of level and strategy is as in deflateInit2. This can be - used to switch between compression and straight copy of the input data, or - to switch to a different kind of input data requiring a different strategy. - If the compression level is changed, the input available so far is - compressed with the old level (and may be flushed); the new level will take - effect only at the next call of deflate(). - - Before the call of deflateParams, the stream state must be set as for - a call of deflate(), since the currently available input may have to be - compressed and flushed. In particular, strm->avail_out must be non-zero. - - deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source - stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR if - strm->avail_out was zero. -*/ - -ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm, - int good_length, - int max_lazy, - int nice_length, - int max_chain)); -/* - Fine tune deflate's internal compression parameters. This should only be - used by someone who understands the algorithm used by zlib's deflate for - searching for the best matching string, and even then only by the most - fanatic optimizer trying to squeeze out the last compressed bit for their - specific input data. Read the deflate.c source code for the meaning of the - max_lazy, good_length, nice_length, and max_chain parameters. - - deflateTune() can be called after deflateInit() or deflateInit2(), and - returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream. - */ - -ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm, - uLong sourceLen)); -/* - deflateBound() returns an upper bound on the compressed size after - deflation of sourceLen bytes. It must be called after deflateInit() or - deflateInit2(), and after deflateSetHeader(), if used. This would be used - to allocate an output buffer for deflation in a single pass, and so would be - called before deflate(). -*/ - -ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm, - int bits, - int value)); -/* - deflatePrime() inserts bits in the deflate output stream. The intent - is that this function is used to start off the deflate output with the bits - leftover from a previous deflate stream when appending to it. As such, this - function can only be used for raw deflate, and must be used before the first - deflate() call after a deflateInit2() or deflateReset(). bits must be less - than or equal to 16, and that many of the least significant bits of value - will be inserted in the output. - - deflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent. -*/ - -ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm, - gz_headerp head)); -/* - deflateSetHeader() provides gzip header information for when a gzip - stream is requested by deflateInit2(). deflateSetHeader() may be called - after deflateInit2() or deflateReset() and before the first call of - deflate(). The text, time, os, extra field, name, and comment information - in the provided gz_header structure are written to the gzip header (xflag is - ignored -- the extra flags are set according to the compression level). The - caller must assure that, if not Z_NULL, name and comment are terminated with - a zero byte, and that if extra is not Z_NULL, that extra_len bytes are - available there. If hcrc is true, a gzip header crc is included. Note that - the current versions of the command-line version of gzip (up through version - 1.3.x) do not support header crc's, and will report that it is a "multi-part - gzip file" and give up. - - If deflateSetHeader is not used, the default gzip header has text false, - the time set to zero, and os set to 255, with no extra, name, or comment - fields. The gzip header is returned to the default state by deflateReset(). - - deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent. -*/ - -/* -ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm, - int windowBits)); - - This is another version of inflateInit with an extra parameter. The - fields next_in, avail_in, zalloc, zfree and opaque must be initialized - before by the caller. - - The windowBits parameter is the base two logarithm of the maximum window - size (the size of the history buffer). It should be in the range 8..15 for - this version of the library. The default value is 15 if inflateInit is used - instead. windowBits must be greater than or equal to the windowBits value - provided to deflateInit2() while compressing, or it must be equal to 15 if - deflateInit2() was not used. If a compressed stream with a larger window - size is given as input, inflate() will return with the error code - Z_DATA_ERROR instead of trying to allocate a larger window. - - windowBits can also be zero to request that inflate use the window size in - the zlib header of the compressed stream. - - windowBits can also be -8..-15 for raw inflate. In this case, -windowBits - determines the window size. inflate() will then process raw deflate data, - not looking for a zlib or gzip header, not generating a check value, and not - looking for any check values for comparison at the end of the stream. This - is for use with other formats that use the deflate compressed data format - such as zip. Those formats provide their own check values. If a custom - format is developed using the raw deflate format for compressed data, it is - recommended that a check value such as an adler32 or a crc32 be applied to - the uncompressed data as is done in the zlib, gzip, and zip formats. For - most applications, the zlib format should be used as is. Note that comments - above on the use in deflateInit2() applies to the magnitude of windowBits. - - windowBits can also be greater than 15 for optional gzip decoding. Add - 32 to windowBits to enable zlib and gzip decoding with automatic header - detection, or add 16 to decode only the gzip format (the zlib format will - return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is a - crc32 instead of an adler32. - - inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_VERSION_ERROR if the zlib library version is incompatible with the - version assumed by the caller, or Z_STREAM_ERROR if the parameters are - invalid, such as a null pointer to the structure. msg is set to null if - there is no error message. inflateInit2 does not perform any decompression - apart from possibly reading the zlib header if present: actual decompression - will be done by inflate(). (So next_in and avail_in may be modified, but - next_out and avail_out are unused and unchanged.) The current implementation - of inflateInit2() does not process any header information -- that is - deferred until inflate() is called. -*/ - -ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm, - const Bytef *dictionary, - uInt dictLength)); -/* - Initializes the decompression dictionary from the given uncompressed byte - sequence. This function must be called immediately after a call of inflate, - if that call returned Z_NEED_DICT. The dictionary chosen by the compressor - can be determined from the adler32 value returned by that call of inflate. - The compressor and decompressor must use exactly the same dictionary (see - deflateSetDictionary). For raw inflate, this function can be called - immediately after inflateInit2() or inflateReset() and before any call of - inflate() to set the dictionary. The application must insure that the - dictionary that was used for compression is provided. - - inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a - parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is - inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the - expected one (incorrect adler32 value). inflateSetDictionary does not - perform any decompression: this will be done by subsequent calls of - inflate(). -*/ - -ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm)); -/* - Skips invalid compressed data until a full flush point (see above the - description of deflate with Z_FULL_FLUSH) can be found, or until all - available input is skipped. No output is provided. - - inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR - if no more input was provided, Z_DATA_ERROR if no flush point has been - found, or Z_STREAM_ERROR if the stream structure was inconsistent. In the - success case, the application may save the current current value of total_in - which indicates where valid compressed data was found. In the error case, - the application may repeatedly call inflateSync, providing more input each - time, until success or end of the input data. -*/ - -ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest, - z_streamp source)); -/* - Sets the destination stream as a complete copy of the source stream. - - This function can be useful when randomly accessing a large stream. The - first pass through the stream can periodically record the inflate state, - allowing restarting inflate at those points when randomly accessing the - stream. - - inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_STREAM_ERROR if the source stream state was inconsistent - (such as zalloc being Z_NULL). msg is left unchanged in both source and - destination. -*/ - -ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm)); -/* - This function is equivalent to inflateEnd followed by inflateInit, - but does not free and reallocate all the internal decompression state. The - stream will keep attributes that may have been set by inflateInit2. - - inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent (such as zalloc or state being Z_NULL). -*/ - -ZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm, - int windowBits)); -/* - This function is the same as inflateReset, but it also permits changing - the wrap and window size requests. The windowBits parameter is interpreted - the same as it is for inflateInit2. - - inflateReset2 returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent (such as zalloc or state being Z_NULL), or if - the windowBits parameter is invalid. -*/ - -ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm, - int bits, - int value)); -/* - This function inserts bits in the inflate input stream. The intent is - that this function is used to start inflating at a bit position in the - middle of a byte. The provided bits will be used before any bytes are used - from next_in. This function should only be used with raw inflate, and - should be used before the first inflate() call after inflateInit2() or - inflateReset(). bits must be less than or equal to 16, and that many of the - least significant bits of value will be inserted in the input. - - If bits is negative, then the input stream bit buffer is emptied. Then - inflatePrime() can be called again to put bits in the buffer. This is used - to clear out bits leftover after feeding inflate a block description prior - to feeding inflate codes. - - inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent. -*/ - -ZEXTERN long ZEXPORT inflateMark OF((z_streamp strm)); -/* - This function returns two values, one in the lower 16 bits of the return - value, and the other in the remaining upper bits, obtained by shifting the - return value down 16 bits. If the upper value is -1 and the lower value is - zero, then inflate() is currently decoding information outside of a block. - If the upper value is -1 and the lower value is non-zero, then inflate is in - the middle of a stored block, with the lower value equaling the number of - bytes from the input remaining to copy. If the upper value is not -1, then - it is the number of bits back from the current bit position in the input of - the code (literal or length/distance pair) currently being processed. In - that case the lower value is the number of bytes already emitted for that - code. - - A code is being processed if inflate is waiting for more input to complete - decoding of the code, or if it has completed decoding but is waiting for - more output space to write the literal or match data. - - inflateMark() is used to mark locations in the input data for random - access, which may be at bit positions, and to note those cases where the - output of a code may span boundaries of random access blocks. The current - location in the input stream can be determined from avail_in and data_type - as noted in the description for the Z_BLOCK flush parameter for inflate. - - inflateMark returns the value noted above or -1 << 16 if the provided - source stream state was inconsistent. -*/ - -ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm, - gz_headerp head)); -/* - inflateGetHeader() requests that gzip header information be stored in the - provided gz_header structure. inflateGetHeader() may be called after - inflateInit2() or inflateReset(), and before the first call of inflate(). - As inflate() processes the gzip stream, head->done is zero until the header - is completed, at which time head->done is set to one. If a zlib stream is - being decoded, then head->done is set to -1 to indicate that there will be - no gzip header information forthcoming. Note that Z_BLOCK or Z_TREES can be - used to force inflate() to return immediately after header processing is - complete and before any actual data is decompressed. - - The text, time, xflags, and os fields are filled in with the gzip header - contents. hcrc is set to true if there is a header CRC. (The header CRC - was valid if done is set to one.) If extra is not Z_NULL, then extra_max - contains the maximum number of bytes to write to extra. Once done is true, - extra_len contains the actual extra field length, and extra contains the - extra field, or that field truncated if extra_max is less than extra_len. - If name is not Z_NULL, then up to name_max characters are written there, - terminated with a zero unless the length is greater than name_max. If - comment is not Z_NULL, then up to comm_max characters are written there, - terminated with a zero unless the length is greater than comm_max. When any - of extra, name, or comment are not Z_NULL and the respective field is not - present in the header, then that field is set to Z_NULL to signal its - absence. This allows the use of deflateSetHeader() with the returned - structure to duplicate the header. However if those fields are set to - allocated memory, then the application will need to save those pointers - elsewhere so that they can be eventually freed. - - If inflateGetHeader is not used, then the header information is simply - discarded. The header is always checked for validity, including the header - CRC if present. inflateReset() will reset the process to discard the header - information. The application would need to call inflateGetHeader() again to - retrieve the header from the next gzip stream. - - inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent. -*/ - -/* -ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits, - unsigned char FAR *window)); - - Initialize the internal stream state for decompression using inflateBack() - calls. The fields zalloc, zfree and opaque in strm must be initialized - before the call. If zalloc and zfree are Z_NULL, then the default library- - derived memory allocation routines are used. windowBits is the base two - logarithm of the window size, in the range 8..15. window is a caller - supplied buffer of that size. Except for special applications where it is - assured that deflate was used with small window sizes, windowBits must be 15 - and a 32K byte window must be supplied to be able to decompress general - deflate streams. - - See inflateBack() for the usage of these routines. - - inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of - the paramaters are invalid, Z_MEM_ERROR if the internal state could not be - allocated, or Z_VERSION_ERROR if the version of the library does not match - the version of the header file. -*/ - -typedef unsigned (*in_func) OF((void FAR *, unsigned char FAR * FAR *)); -typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned)); - -ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm, - in_func in, void FAR *in_desc, - out_func out, void FAR *out_desc)); -/* - inflateBack() does a raw inflate with a single call using a call-back - interface for input and output. This is more efficient than inflate() for - file i/o applications in that it avoids copying between the output and the - sliding window by simply making the window itself the output buffer. This - function trusts the application to not change the output buffer passed by - the output function, at least until inflateBack() returns. - - inflateBackInit() must be called first to allocate the internal state - and to initialize the state with the user-provided window buffer. - inflateBack() may then be used multiple times to inflate a complete, raw - deflate stream with each call. inflateBackEnd() is then called to free the - allocated state. - - A raw deflate stream is one with no zlib or gzip header or trailer. - This routine would normally be used in a utility that reads zip or gzip - files and writes out uncompressed files. The utility would decode the - header and process the trailer on its own, hence this routine expects only - the raw deflate stream to decompress. This is different from the normal - behavior of inflate(), which expects either a zlib or gzip header and - trailer around the deflate stream. - - inflateBack() uses two subroutines supplied by the caller that are then - called by inflateBack() for input and output. inflateBack() calls those - routines until it reads a complete deflate stream and writes out all of the - uncompressed data, or until it encounters an error. The function's - parameters and return types are defined above in the in_func and out_func - typedefs. inflateBack() will call in(in_desc, &buf) which should return the - number of bytes of provided input, and a pointer to that input in buf. If - there is no input available, in() must return zero--buf is ignored in that - case--and inflateBack() will return a buffer error. inflateBack() will call - out(out_desc, buf, len) to write the uncompressed data buf[0..len-1]. out() - should return zero on success, or non-zero on failure. If out() returns - non-zero, inflateBack() will return with an error. Neither in() nor out() - are permitted to change the contents of the window provided to - inflateBackInit(), which is also the buffer that out() uses to write from. - The length written by out() will be at most the window size. Any non-zero - amount of input may be provided by in(). - - For convenience, inflateBack() can be provided input on the first call by - setting strm->next_in and strm->avail_in. If that input is exhausted, then - in() will be called. Therefore strm->next_in must be initialized before - calling inflateBack(). If strm->next_in is Z_NULL, then in() will be called - immediately for input. If strm->next_in is not Z_NULL, then strm->avail_in - must also be initialized, and then if strm->avail_in is not zero, input will - initially be taken from strm->next_in[0 .. strm->avail_in - 1]. - - The in_desc and out_desc parameters of inflateBack() is passed as the - first parameter of in() and out() respectively when they are called. These - descriptors can be optionally used to pass any information that the caller- - supplied in() and out() functions need to do their job. - - On return, inflateBack() will set strm->next_in and strm->avail_in to - pass back any unused input that was provided by the last in() call. The - return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR - if in() or out() returned an error, Z_DATA_ERROR if there was a format error - in the deflate stream (in which case strm->msg is set to indicate the nature - of the error), or Z_STREAM_ERROR if the stream was not properly initialized. - In the case of Z_BUF_ERROR, an input or output error can be distinguished - using strm->next_in which will be Z_NULL only if in() returned an error. If - strm->next_in is not Z_NULL, then the Z_BUF_ERROR was due to out() returning - non-zero. (in() will always be called before out(), so strm->next_in is - assured to be defined if out() returns non-zero.) Note that inflateBack() - cannot return Z_OK. -*/ - -ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm)); -/* - All memory allocated by inflateBackInit() is freed. - - inflateBackEnd() returns Z_OK on success, or Z_STREAM_ERROR if the stream - state was inconsistent. -*/ - -ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void)); -/* Return flags indicating compile-time options. - - Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other: - 1.0: size of uInt - 3.2: size of uLong - 5.4: size of voidpf (pointer) - 7.6: size of z_off_t - - Compiler, assembler, and debug options: - 8: DEBUG - 9: ASMV or ASMINF -- use ASM code - 10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention - 11: 0 (reserved) - - One-time table building (smaller code, but not thread-safe if true): - 12: BUILDFIXED -- build static block decoding tables when needed - 13: DYNAMIC_CRC_TABLE -- build CRC calculation tables when needed - 14,15: 0 (reserved) - - Library content (indicates missing functionality): - 16: NO_GZCOMPRESS -- gz* functions cannot compress (to avoid linking - deflate code when not needed) - 17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect - and decode gzip streams (to avoid linking crc code) - 18-19: 0 (reserved) - - Operation variations (changes in library functionality): - 20: PKZIP_BUG_WORKAROUND -- slightly more permissive inflate - 21: FASTEST -- deflate algorithm with only one, lowest compression level - 22,23: 0 (reserved) - - The sprintf variant used by gzprintf (zero is best): - 24: 0 = vs*, 1 = s* -- 1 means limited to 20 arguments after the format - 25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure! - 26: 0 = returns value, 1 = void -- 1 means inferred string length returned - - Remainder: - 27-31: 0 (reserved) - */ - - - /* utility functions */ - -/* - The following utility functions are implemented on top of the basic - stream-oriented functions. To simplify the interface, some default options - are assumed (compression level and memory usage, standard memory allocation - functions). The source code of these utility functions can be modified if - you need special options. -*/ - -ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong sourceLen)); -/* - Compresses the source buffer into the destination buffer. sourceLen is - the byte length of the source buffer. Upon entry, destLen is the total size - of the destination buffer, which must be at least the value returned by - compressBound(sourceLen). Upon exit, destLen is the actual size of the - compressed buffer. - - compress returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_BUF_ERROR if there was not enough room in the output - buffer. -*/ - -ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong sourceLen, - int level)); -/* - Compresses the source buffer into the destination buffer. The level - parameter has the same meaning as in deflateInit. sourceLen is the byte - length of the source buffer. Upon entry, destLen is the total size of the - destination buffer, which must be at least the value returned by - compressBound(sourceLen). Upon exit, destLen is the actual size of the - compressed buffer. - - compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_BUF_ERROR if there was not enough room in the output buffer, - Z_STREAM_ERROR if the level parameter is invalid. -*/ - -ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen)); -/* - compressBound() returns an upper bound on the compressed size after - compress() or compress2() on sourceLen bytes. It would be used before a - compress() or compress2() call to allocate the destination buffer. -*/ - -ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong sourceLen)); -/* - Decompresses the source buffer into the destination buffer. sourceLen is - the byte length of the source buffer. Upon entry, destLen is the total size - of the destination buffer, which must be large enough to hold the entire - uncompressed data. (The size of the uncompressed data must have been saved - previously by the compressor and transmitted to the decompressor by some - mechanism outside the scope of this compression library.) Upon exit, destLen - is the actual size of the uncompressed buffer. - - uncompress returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_BUF_ERROR if there was not enough room in the output - buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete. -*/ - - - /* gzip file access functions */ - -/* - This library supports reading and writing files in gzip (.gz) format with - an interface similar to that of stdio, using the functions that start with - "gz". The gzip format is different from the zlib format. gzip is a gzip - wrapper, documented in RFC 1952, wrapped around a deflate stream. -*/ - -typedef voidp gzFile; /* opaque gzip file descriptor */ - -/* -ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode)); - - Opens a gzip (.gz) file for reading or writing. The mode parameter is as - in fopen ("rb" or "wb") but can also include a compression level ("wb9") or - a strategy: 'f' for filtered data as in "wb6f", 'h' for Huffman-only - compression as in "wb1h", 'R' for run-length encoding as in "wb1R", or 'F' - for fixed code compression as in "wb9F". (See the description of - deflateInit2 for more information about the strategy parameter.) Also "a" - can be used instead of "w" to request that the gzip stream that will be - written be appended to the file. "+" will result in an error, since reading - and writing to the same gzip file is not supported. - - gzopen can be used to read a file which is not in gzip format; in this - case gzread will directly read from the file without decompression. - - gzopen returns NULL if the file could not be opened, if there was - insufficient memory to allocate the gzFile state, or if an invalid mode was - specified (an 'r', 'w', or 'a' was not provided, or '+' was provided). - errno can be checked to determine if the reason gzopen failed was that the - file could not be opened. -*/ - -ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode)); -/* - gzdopen associates a gzFile with the file descriptor fd. File descriptors - are obtained from calls like open, dup, creat, pipe or fileno (if the file - has been previously opened with fopen). The mode parameter is as in gzopen. - - The next call of gzclose on the returned gzFile will also close the file - descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor - fd. If you want to keep fd open, use fd = dup(fd_keep); gz = gzdopen(fd, - mode);. The duplicated descriptor should be saved to avoid a leak, since - gzdopen does not close fd if it fails. - - gzdopen returns NULL if there was insufficient memory to allocate the - gzFile state, if an invalid mode was specified (an 'r', 'w', or 'a' was not - provided, or '+' was provided), or if fd is -1. The file descriptor is not - used until the next gz* read, write, seek, or close operation, so gzdopen - will not detect if fd is invalid (unless fd is -1). -*/ - -ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size)); -/* - Set the internal buffer size used by this library's functions. The - default buffer size is 8192 bytes. This function must be called after - gzopen() or gzdopen(), and before any other calls that read or write the - file. The buffer memory allocation is always deferred to the first read or - write. Two buffers are allocated, either both of the specified size when - writing, or one of the specified size and the other twice that size when - reading. A larger buffer size of, for example, 64K or 128K bytes will - noticeably increase the speed of decompression (reading). - - The new buffer size also affects the maximum length for gzprintf(). - - gzbuffer() returns 0 on success, or -1 on failure, such as being called - too late. -*/ - -ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy)); -/* - Dynamically update the compression level or strategy. See the description - of deflateInit2 for the meaning of these parameters. - - gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not - opened for writing. -*/ - -ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len)); -/* - Reads the given number of uncompressed bytes from the compressed file. If - the input file was not in gzip format, gzread copies the given number of - bytes into the buffer. - - After reaching the end of a gzip stream in the input, gzread will continue - to read, looking for another gzip stream, or failing that, reading the rest - of the input file directly without decompression. The entire input file - will be read if gzread is called until it returns less than the requested - len. - - gzread returns the number of uncompressed bytes actually read, less than - len for end of file, or -1 for error. -*/ - -ZEXTERN int ZEXPORT gzwrite OF((gzFile file, - voidpc buf, unsigned len)); -/* - Writes the given number of uncompressed bytes into the compressed file. - gzwrite returns the number of uncompressed bytes written or 0 in case of - error. -*/ - -ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...)); -/* - Converts, formats, and writes the arguments to the compressed file under - control of the format string, as in fprintf. gzprintf returns the number of - uncompressed bytes actually written, or 0 in case of error. The number of - uncompressed bytes written is limited to 8191, or one less than the buffer - size given to gzbuffer(). The caller should assure that this limit is not - exceeded. If it is exceeded, then gzprintf() will return an error (0) with - nothing written. In this case, there may also be a buffer overflow with - unpredictable consequences, which is possible only if zlib was compiled with - the insecure functions sprintf() or vsprintf() because the secure snprintf() - or vsnprintf() functions were not available. This can be determined using - zlibCompileFlags(). -*/ - -ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s)); -/* - Writes the given null-terminated string to the compressed file, excluding - the terminating null character. - - gzputs returns the number of characters written, or -1 in case of error. -*/ - -ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len)); -/* - Reads bytes from the compressed file until len-1 characters are read, or a - newline character is read and transferred to buf, or an end-of-file - condition is encountered. If any characters are read or if len == 1, the - string is terminated with a null character. If no characters are read due - to an end-of-file or len < 1, then the buffer is left untouched. - - gzgets returns buf which is a null-terminated string, or it returns NULL - for end-of-file or in case of error. If there was an error, the contents at - buf are indeterminate. -*/ - -ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c)); -/* - Writes c, converted to an unsigned char, into the compressed file. gzputc - returns the value that was written, or -1 in case of error. -*/ - -ZEXTERN int ZEXPORT gzgetc OF((gzFile file)); -/* - Reads one byte from the compressed file. gzgetc returns this byte or -1 - in case of end of file or error. -*/ - -ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file)); -/* - Push one character back onto the stream to be read as the first character - on the next read. At least one character of push-back is allowed. - gzungetc() returns the character pushed, or -1 on failure. gzungetc() will - fail if c is -1, and may fail if a character has been pushed but not read - yet. If gzungetc is used immediately after gzopen or gzdopen, at least the - output buffer size of pushed characters is allowed. (See gzbuffer above.) - The pushed character will be discarded if the stream is repositioned with - gzseek() or gzrewind(). -*/ - -ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush)); -/* - Flushes all pending output into the compressed file. The parameter flush - is as in the deflate() function. The return value is the zlib error number - (see function gzerror below). gzflush is only permitted when writing. - - If the flush parameter is Z_FINISH, the remaining data is written and the - gzip stream is completed in the output. If gzwrite() is called again, a new - gzip stream will be started in the output. gzread() is able to read such - concatented gzip streams. - - gzflush should be called only when strictly necessary because it will - degrade compression if called too often. -*/ - -/* -ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file, - z_off_t offset, int whence)); - - Sets the starting position for the next gzread or gzwrite on the given - compressed file. The offset represents a number of bytes in the - uncompressed data stream. The whence parameter is defined as in lseek(2); - the value SEEK_END is not supported. - - If the file is opened for reading, this function is emulated but can be - extremely slow. If the file is opened for writing, only forward seeks are - supported; gzseek then compresses a sequence of zeroes up to the new - starting position. - - gzseek returns the resulting offset location as measured in bytes from - the beginning of the uncompressed stream, or -1 in case of error, in - particular if the file is opened for writing and the new starting position - would be before the current position. -*/ - -ZEXTERN int ZEXPORT gzrewind OF((gzFile file)); -/* - Rewinds the given file. This function is supported only for reading. - - gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET) -*/ - -/* -ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file)); - - Returns the starting position for the next gzread or gzwrite on the given - compressed file. This position represents a number of bytes in the - uncompressed data stream, and is zero when starting, even if appending or - reading a gzip stream from the middle of a file using gzdopen(). - - gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR) -*/ - -/* -ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file)); - - Returns the current offset in the file being read or written. This offset - includes the count of bytes that precede the gzip stream, for example when - appending or when using gzdopen() for reading. When reading, the offset - does not include as yet unused buffered input. This information can be used - for a progress indicator. On error, gzoffset() returns -1. -*/ - -ZEXTERN int ZEXPORT gzeof OF((gzFile file)); -/* - Returns true (1) if the end-of-file indicator has been set while reading, - false (0) otherwise. Note that the end-of-file indicator is set only if the - read tried to go past the end of the input, but came up short. Therefore, - just like feof(), gzeof() may return false even if there is no more data to - read, in the event that the last read request was for the exact number of - bytes remaining in the input file. This will happen if the input file size - is an exact multiple of the buffer size. - - If gzeof() returns true, then the read functions will return no more data, - unless the end-of-file indicator is reset by gzclearerr() and the input file - has grown since the previous end of file was detected. -*/ - -ZEXTERN int ZEXPORT gzdirect OF((gzFile file)); -/* - Returns true (1) if file is being copied directly while reading, or false - (0) if file is a gzip stream being decompressed. This state can change from - false to true while reading the input file if the end of a gzip stream is - reached, but is followed by data that is not another gzip stream. - - If the input file is empty, gzdirect() will return true, since the input - does not contain a gzip stream. - - If gzdirect() is used immediately after gzopen() or gzdopen() it will - cause buffers to be allocated to allow reading the file to determine if it - is a gzip file. Therefore if gzbuffer() is used, it should be called before - gzdirect(). -*/ - -ZEXTERN int ZEXPORT gzclose OF((gzFile file)); -/* - Flushes all pending output if necessary, closes the compressed file and - deallocates the (de)compression state. Note that once file is closed, you - cannot call gzerror with file, since its structures have been deallocated. - gzclose must not be called more than once on the same file, just as free - must not be called more than once on the same allocation. - - gzclose will return Z_STREAM_ERROR if file is not valid, Z_ERRNO on a - file operation error, or Z_OK on success. -*/ - -ZEXTERN int ZEXPORT gzclose_r OF((gzFile file)); -ZEXTERN int ZEXPORT gzclose_w OF((gzFile file)); -/* - Same as gzclose(), but gzclose_r() is only for use when reading, and - gzclose_w() is only for use when writing or appending. The advantage to - using these instead of gzclose() is that they avoid linking in zlib - compression or decompression code that is not used when only reading or only - writing respectively. If gzclose() is used, then both compression and - decompression code will be included the application when linking to a static - zlib library. -*/ - -ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum)); -/* - Returns the error message for the last error which occurred on the given - compressed file. errnum is set to zlib error number. If an error occurred - in the file system and not in the compression library, errnum is set to - Z_ERRNO and the application may consult errno to get the exact error code. - - The application must not modify the returned string. Future calls to - this function may invalidate the previously returned string. If file is - closed, then the string previously returned by gzerror will no longer be - available. - - gzerror() should be used to distinguish errors from end-of-file for those - functions above that do not distinguish those cases in their return values. -*/ - -ZEXTERN void ZEXPORT gzclearerr OF((gzFile file)); -/* - Clears the error and end-of-file flags for file. This is analogous to the - clearerr() function in stdio. This is useful for continuing to read a gzip - file that is being written concurrently. -*/ - - - /* checksum functions */ - -/* - These functions are not related to compression but are exported - anyway because they might be useful in applications using the compression - library. -*/ - -ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len)); -/* - Update a running Adler-32 checksum with the bytes buf[0..len-1] and - return the updated checksum. If buf is Z_NULL, this function returns the - required initial value for the checksum. - - An Adler-32 checksum is almost as reliable as a CRC32 but can be computed - much faster. - - Usage example: - - uLong adler = adler32(0L, Z_NULL, 0); - - while (read_buffer(buffer, length) != EOF) { - adler = adler32(adler, buffer, length); - } - if (adler != original_adler) error(); -*/ - -/* -ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2, - z_off_t len2)); - - Combine two Adler-32 checksums into one. For two sequences of bytes, seq1 - and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for - each, adler1 and adler2. adler32_combine() returns the Adler-32 checksum of - seq1 and seq2 concatenated, requiring only adler1, adler2, and len2. -*/ - -ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len)); -/* - Update a running CRC-32 with the bytes buf[0..len-1] and return the - updated CRC-32. If buf is Z_NULL, this function returns the required - initial value for the for the crc. Pre- and post-conditioning (one's - complement) is performed within this function so it shouldn't be done by the - application. - - Usage example: - - uLong crc = crc32(0L, Z_NULL, 0); - - while (read_buffer(buffer, length) != EOF) { - crc = crc32(crc, buffer, length); - } - if (crc != original_crc) error(); -*/ - -/* -ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2)); - - Combine two CRC-32 check values into one. For two sequences of bytes, - seq1 and seq2 with lengths len1 and len2, CRC-32 check values were - calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32 - check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and - len2. -*/ - - - /* various hacks, don't look :) */ - -/* deflateInit and inflateInit are macros to allow checking the zlib version - * and the compiler's view of z_stream: - */ -ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level, - const char *version, int stream_size)); -ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm, - const char *version, int stream_size)); -ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method, - int windowBits, int memLevel, - int strategy, const char *version, - int stream_size)); -ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits, - const char *version, int stream_size)); -ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits, - unsigned char FAR *window, - const char *version, - int stream_size)); -#define deflateInit(strm, level) \ - deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream)) -#define inflateInit(strm) \ - inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream)) -#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ - deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ - (strategy), ZLIB_VERSION, sizeof(z_stream)) -#define inflateInit2(strm, windowBits) \ - inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream)) -#define inflateBackInit(strm, windowBits, window) \ - inflateBackInit_((strm), (windowBits), (window), \ - ZLIB_VERSION, sizeof(z_stream)) - -/* provide 64-bit offset functions if _LARGEFILE64_SOURCE defined, and/or - * change the regular functions to 64 bits if _FILE_OFFSET_BITS is 64 (if - * both are true, the application gets the *64 functions, and the regular - * functions are changed to 64 bits) -- in case these are set on systems - * without large file support, _LFS64_LARGEFILE must also be true - */ -#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0 - ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); - ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int)); - ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile)); - ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile)); - ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off64_t)); - ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t)); -#endif - -#if !defined(ZLIB_INTERNAL) && _FILE_OFFSET_BITS-0 == 64 && _LFS64_LARGEFILE-0 -# define gzopen gzopen64 -# define gzseek gzseek64 -# define gztell gztell64 -# define gzoffset gzoffset64 -# define adler32_combine adler32_combine64 -# define crc32_combine crc32_combine64 -# ifndef _LARGEFILE64_SOURCE - ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); - ZEXTERN z_off_t ZEXPORT gzseek64 OF((gzFile, z_off_t, int)); - ZEXTERN z_off_t ZEXPORT gztell64 OF((gzFile)); - ZEXTERN z_off_t ZEXPORT gzoffset64 OF((gzFile)); - ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t)); - ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t)); -# endif -#else - ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *)); - ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile, z_off_t, int)); - ZEXTERN z_off_t ZEXPORT gztell OF((gzFile)); - ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile)); - ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t)); - ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t)); -#endif - -/* hack for buggy compilers */ -#if !defined(ZUTIL_H) && !defined(NO_DUMMY_DECL) - struct internal_state {int dummy;}; -#endif - -/* undocumented functions */ -ZEXTERN const char * ZEXPORT zError OF((int)); -ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp)); -ZEXTERN const uLongf * ZEXPORT get_crc_table OF((void)); -ZEXTERN int ZEXPORT inflateUndermine OF((z_streamp, int)); - -#ifdef __cplusplus -} -#endif - -#endif /* ZLIB_H */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libcares.so.2.0.0 b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libcares.so.2.0.0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libcrypto.so.1.0.0 b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libcrypto.so.1.0.0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libcrypto.so.REMOVED.git-id b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libcrypto.so.REMOVED.git-id deleted file mode 100644 index 2ea9ac3246..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libcrypto.so.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -4ff61e758dc8c01a4a82df141540813f3ab351dc \ No newline at end of file diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libcurl.so.4.3.0 b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libcurl.so.4.3.0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libcurl.so.REMOVED.git-id b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libcurl.so.REMOVED.git-id deleted file mode 100644 index 41afd12fac..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libcurl.so.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -06829f6cfebf4523192dfaf5cf042032f1b96632 \ No newline at end of file diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libfontconfig.so.1.5.0 b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libfontconfig.so.1.5.0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libfontconfig.so.REMOVED.git-id b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libfontconfig.so.REMOVED.git-id deleted file mode 100644 index 6896deda15..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libfontconfig.so.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -b6a6a198eea646c5e090a964e180aa78058b7d48 \ No newline at end of file diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libfreetype.so.6.8.1 b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libfreetype.so.6.8.1 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libfreetype.so.REMOVED.git-id b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libfreetype.so.REMOVED.git-id deleted file mode 100644 index 9b70f2b2c0..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libfreetype.so.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -b9efbf4824b8de5ff8bd0db831c77bf679737f9f \ No newline at end of file diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libidn.so.11.5.44 b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libidn.so.11.5.44 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libidn.so.REMOVED.git-id b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libidn.so.REMOVED.git-id deleted file mode 100644 index 271175ba5d..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libidn.so.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -7a5c3a876a13dc979b1b43449915599789fdc845 \ No newline at end of file diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libjpeg.so.8.0.2 b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libjpeg.so.8.0.2 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libjpeg.so.REMOVED.git-id b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libjpeg.so.REMOVED.git-id deleted file mode 100644 index 2f3fbe6a5b..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libjpeg.so.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -25bb05f20c84c6a144bddda26b72a3a6ce09dc37 \ No newline at end of file diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libpng.so.3.50.0 b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libpng.so.3.50.0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libpng.so.REMOVED.git-id b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libpng.so.REMOVED.git-id deleted file mode 100644 index f7f7b6ada8..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libpng.so.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -5357b728e507259c4ad8585ad8f8c2dddb2699d9 \ No newline at end of file diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libsqlite3.so.0.8.6 b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libsqlite3.so.0.8.6 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libsqlite3.so.REMOVED.git-id b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libsqlite3.so.REMOVED.git-id deleted file mode 100644 index b2dd14dadd..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libsqlite3.so.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -25da8c95d0bf7080432189e107f8971eede5a1ee \ No newline at end of file diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libssl.so.1.0.0 b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libssl.so.1.0.0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libssl.so.REMOVED.git-id b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libssl.so.REMOVED.git-id deleted file mode 100644 index 72956cc2f4..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libssl.so.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -d7fb557b3a3485e594153c8fb3fbb4423320fdb1 \ No newline at end of file diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libtiff.so.5.1.0 b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libtiff.so.5.1.0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libtiff.so.REMOVED.git-id b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libtiff.so.REMOVED.git-id deleted file mode 100644 index c8873644b8..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/lib/libtiff.so.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -42e9b411a0a08b1a2054e51bf7c0b17050f3b584 \ No newline at end of file diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/lib/libexpat.so.1.5.2 b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/lib/libexpat.so.1.5.2 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/lib/libexpat.so.REMOVED.git-id b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/lib/libexpat.so.REMOVED.git-id deleted file mode 100644 index e1d05ab65e..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/lib/libexpat.so.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -9f64ec1a3e01ae061a9cfa635d5de3b8071b0772 \ No newline at end of file diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/lib/libz.so.1.2.5 b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/lib/libz.so.1.2.5 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/lib/libz.so.REMOVED.git-id b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/lib/libz.so.REMOVED.git-id deleted file mode 100644 index 6a46f2583a..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/lib/libz.so.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -e1b78cf2266d7488ddbfb793fb0d14b1ce331fd8 \ No newline at end of file diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/curl/curl.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/curl/curl.h deleted file mode 100644 index fbd0d9b01c..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/curl/curl.h +++ /dev/null @@ -1,2125 +0,0 @@ -#ifndef __CURL_CURL_H -#define __CURL_CURL_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - ***************************************************************************/ - -/* - * If you have libcurl problems, all docs and details are found here: - * http://curl.haxx.se/libcurl/ - * - * curl-library mailing list subscription and unsubscription web interface: - * http://cool.haxx.se/mailman/listinfo/curl-library/ - */ - -#include "curlver.h" /* libcurl version defines */ -#include "curlbuild.h" /* libcurl build definitions */ -#include "curlrules.h" /* libcurl rules enforcement */ - -/* - * Define WIN32 when build target is Win32 API - */ - -#if (defined(_WIN32) || defined(__WIN32__)) && \ - !defined(WIN32) && !defined(__SYMBIAN32__) -#define WIN32 -#endif - -#include <stdio.h> -#include <limits.h> - -#if defined(__FreeBSD__) && (__FreeBSD__ >= 2) -/* Needed for __FreeBSD_version symbol definition */ -#include <osreldate.h> -#endif - -/* The include stuff here below is mainly for time_t! */ -#include <sys/types.h> -#include <time.h> - -#if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__GNUC__) && \ - !defined(__CYGWIN__) || defined(__MINGW32__) -#if !(defined(_WINSOCKAPI_) || defined(_WINSOCK_H)) -/* The check above prevents the winsock2 inclusion if winsock.h already was - included, since they can't co-exist without problems */ -#include <winsock2.h> -#include <ws2tcpip.h> -#endif -#else - -/* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish - libc5-based Linux systems. Only include it on system that are known to - require it! */ -#if defined(_AIX) || defined(__NOVELL_LIBC__) || defined(__NetBSD__) || \ - defined(__minix) || defined(__SYMBIAN32__) || defined(__INTEGRITY) || \ - defined(ANDROID) || \ - (defined(__FreeBSD_version) && (__FreeBSD_version < 800000)) -#include <sys/select.h> -#endif - -#ifndef _WIN32_WCE -#include <sys/socket.h> -#endif -#if !defined(WIN32) && !defined(__WATCOMC__) && !defined(__VXWORKS__) -#include <sys/time.h> -#endif -#include <sys/types.h> -#endif - -#ifdef __BEOS__ -#include <support/SupportDefs.h> -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -typedef void CURL; - -/* - * Decorate exportable functions for Win32 and Symbian OS DLL linking. - * This avoids using a .def file for building libcurl.dll. - */ -#if (defined(WIN32) || defined(_WIN32) || defined(__SYMBIAN32__)) && \ - !defined(CURL_STATICLIB) -#if defined(BUILDING_LIBCURL) -#define CURL_EXTERN __declspec(dllexport) -#else -#define CURL_EXTERN __declspec(dllimport) -#endif -#else - -#ifdef CURL_HIDDEN_SYMBOLS -/* - * This definition is used to make external definitions visible in the - * shared library when symbols are hidden by default. It makes no - * difference when compiling applications whether this is set or not, - * only when compiling the library. - */ -#define CURL_EXTERN CURL_EXTERN_SYMBOL -#else -#define CURL_EXTERN -#endif -#endif - -#ifndef curl_socket_typedef -/* socket typedef */ -#ifdef WIN32 -typedef SOCKET curl_socket_t; -#define CURL_SOCKET_BAD INVALID_SOCKET -#else -typedef int curl_socket_t; -#define CURL_SOCKET_BAD -1 -#endif -#define curl_socket_typedef -#endif /* curl_socket_typedef */ - -struct curl_httppost { - struct curl_httppost *next; /* next entry in the list */ - char *name; /* pointer to allocated name */ - long namelength; /* length of name length */ - char *contents; /* pointer to allocated data contents */ - long contentslength; /* length of contents field */ - char *buffer; /* pointer to allocated buffer contents */ - long bufferlength; /* length of buffer field */ - char *contenttype; /* Content-Type */ - struct curl_slist* contentheader; /* list of extra headers for this form */ - struct curl_httppost *more; /* if one field name has more than one - file, this link should link to following - files */ - long flags; /* as defined below */ -#define HTTPPOST_FILENAME (1<<0) /* specified content is a file name */ -#define HTTPPOST_READFILE (1<<1) /* specified content is a file name */ -#define HTTPPOST_PTRNAME (1<<2) /* name is only stored pointer - do not free in formfree */ -#define HTTPPOST_PTRCONTENTS (1<<3) /* contents is only stored pointer - do not free in formfree */ -#define HTTPPOST_BUFFER (1<<4) /* upload file from buffer */ -#define HTTPPOST_PTRBUFFER (1<<5) /* upload file from pointer contents */ -#define HTTPPOST_CALLBACK (1<<6) /* upload file contents by using the - regular read callback to get the data - and pass the given pointer as custom - pointer */ - - char *showfilename; /* The file name to show. If not set, the - actual file name will be used (if this - is a file part) */ - void *userp; /* custom pointer used for - HTTPPOST_CALLBACK posts */ -}; - -typedef int (*curl_progress_callback)(void *clientp, - double dltotal, - double dlnow, - double ultotal, - double ulnow); - -#ifndef CURL_MAX_WRITE_SIZE - /* Tests have proven that 20K is a very bad buffer size for uploads on - Windows, while 16K for some odd reason performed a lot better. - We do the ifndef check to allow this value to easier be changed at build - time for those who feel adventurous. The practical minimum is about - 400 bytes since libcurl uses a buffer of this size as a scratch area - (unrelated to network send operations). */ -#define CURL_MAX_WRITE_SIZE 16384 -#endif - -#ifndef CURL_MAX_HTTP_HEADER -/* The only reason to have a max limit for this is to avoid the risk of a bad - server feeding libcurl with a never-ending header that will cause reallocs - infinitely */ -#define CURL_MAX_HTTP_HEADER (100*1024) -#endif - - -/* This is a magic return code for the write callback that, when returned, - will signal libcurl to pause receiving on the current transfer. */ -#define CURL_WRITEFUNC_PAUSE 0x10000001 -typedef size_t (*curl_write_callback)(char *buffer, - size_t size, - size_t nitems, - void *outstream); - - - -/* enumeration of file types */ -typedef enum { - CURLFILETYPE_FILE = 0, - CURLFILETYPE_DIRECTORY, - CURLFILETYPE_SYMLINK, - CURLFILETYPE_DEVICE_BLOCK, - CURLFILETYPE_DEVICE_CHAR, - CURLFILETYPE_NAMEDPIPE, - CURLFILETYPE_SOCKET, - CURLFILETYPE_DOOR, /* is possible only on Sun Solaris now */ - - CURLFILETYPE_UNKNOWN /* should never occur */ -} curlfiletype; - -#define CURLFINFOFLAG_KNOWN_FILENAME (1<<0) -#define CURLFINFOFLAG_KNOWN_FILETYPE (1<<1) -#define CURLFINFOFLAG_KNOWN_TIME (1<<2) -#define CURLFINFOFLAG_KNOWN_PERM (1<<3) -#define CURLFINFOFLAG_KNOWN_UID (1<<4) -#define CURLFINFOFLAG_KNOWN_GID (1<<5) -#define CURLFINFOFLAG_KNOWN_SIZE (1<<6) -#define CURLFINFOFLAG_KNOWN_HLINKCOUNT (1<<7) - -/* Content of this structure depends on information which is known and is - achievable (e.g. by FTP LIST parsing). Please see the url_easy_setopt(3) man - page for callbacks returning this structure -- some fields are mandatory, - some others are optional. The FLAG field has special meaning. */ -struct curl_fileinfo { - char *filename; - curlfiletype filetype; - time_t time; - unsigned int perm; - int uid; - int gid; - curl_off_t size; - long int hardlinks; - - struct { - /* If some of these fields is not NULL, it is a pointer to b_data. */ - char *time; - char *perm; - char *user; - char *group; - char *target; /* pointer to the target filename of a symlink */ - } strings; - - unsigned int flags; - - /* used internally */ - char * b_data; - size_t b_size; - size_t b_used; -}; - -/* return codes for CURLOPT_CHUNK_BGN_FUNCTION */ -#define CURL_CHUNK_BGN_FUNC_OK 0 -#define CURL_CHUNK_BGN_FUNC_FAIL 1 /* tell the lib to end the task */ -#define CURL_CHUNK_BGN_FUNC_SKIP 2 /* skip this chunk over */ - -/* if splitting of data transfer is enabled, this callback is called before - download of an individual chunk started. Note that parameter "remains" works - only for FTP wildcard downloading (for now), otherwise is not used */ -typedef long (*curl_chunk_bgn_callback)(const void *transfer_info, - void *ptr, - int remains); - -/* return codes for CURLOPT_CHUNK_END_FUNCTION */ -#define CURL_CHUNK_END_FUNC_OK 0 -#define CURL_CHUNK_END_FUNC_FAIL 1 /* tell the lib to end the task */ - -/* If splitting of data transfer is enabled this callback is called after - download of an individual chunk finished. - Note! After this callback was set then it have to be called FOR ALL chunks. - Even if downloading of this chunk was skipped in CHUNK_BGN_FUNC. - This is the reason why we don't need "transfer_info" parameter in this - callback and we are not interested in "remains" parameter too. */ -typedef long (*curl_chunk_end_callback)(void *ptr); - -/* return codes for FNMATCHFUNCTION */ -#define CURL_FNMATCHFUNC_MATCH 0 /* string corresponds to the pattern */ -#define CURL_FNMATCHFUNC_NOMATCH 1 /* pattern doesn't match the string */ -#define CURL_FNMATCHFUNC_FAIL 2 /* an error occurred */ - -/* callback type for wildcard downloading pattern matching. If the - string matches the pattern, return CURL_FNMATCHFUNC_MATCH value, etc. */ -typedef int (*curl_fnmatch_callback)(void *ptr, - const char *pattern, - const char *string); - -/* These are the return codes for the seek callbacks */ -#define CURL_SEEKFUNC_OK 0 -#define CURL_SEEKFUNC_FAIL 1 /* fail the entire transfer */ -#define CURL_SEEKFUNC_CANTSEEK 2 /* tell libcurl seeking can't be done, so - libcurl might try other means instead */ -typedef int (*curl_seek_callback)(void *instream, - curl_off_t offset, - int origin); /* 'whence' */ - -/* This is a return code for the read callback that, when returned, will - signal libcurl to immediately abort the current transfer. */ -#define CURL_READFUNC_ABORT 0x10000000 -/* This is a return code for the read callback that, when returned, will - signal libcurl to pause sending data on the current transfer. */ -#define CURL_READFUNC_PAUSE 0x10000001 - -typedef size_t (*curl_read_callback)(char *buffer, - size_t size, - size_t nitems, - void *instream); - -typedef enum { - CURLSOCKTYPE_IPCXN, /* socket created for a specific IP connection */ - CURLSOCKTYPE_LAST /* never use */ -} curlsocktype; - -typedef int (*curl_sockopt_callback)(void *clientp, - curl_socket_t curlfd, - curlsocktype purpose); - -struct curl_sockaddr { - int family; - int socktype; - int protocol; - unsigned int addrlen; /* addrlen was a socklen_t type before 7.18.0 but it - turned really ugly and painful on the systems that - lack this type */ - struct sockaddr addr; -}; - -typedef curl_socket_t -(*curl_opensocket_callback)(void *clientp, - curlsocktype purpose, - struct curl_sockaddr *address); - -typedef enum { - CURLIOE_OK, /* I/O operation successful */ - CURLIOE_UNKNOWNCMD, /* command was unknown to callback */ - CURLIOE_FAILRESTART, /* failed to restart the read */ - CURLIOE_LAST /* never use */ -} curlioerr; - -typedef enum { - CURLIOCMD_NOP, /* no operation */ - CURLIOCMD_RESTARTREAD, /* restart the read stream from start */ - CURLIOCMD_LAST /* never use */ -} curliocmd; - -typedef curlioerr (*curl_ioctl_callback)(CURL *handle, - int cmd, - void *clientp); - -/* - * The following typedef's are signatures of malloc, free, realloc, strdup and - * calloc respectively. Function pointers of these types can be passed to the - * curl_global_init_mem() function to set user defined memory management - * callback routines. - */ -typedef void *(*curl_malloc_callback)(size_t size); -typedef void (*curl_free_callback)(void *ptr); -typedef void *(*curl_realloc_callback)(void *ptr, size_t size); -typedef char *(*curl_strdup_callback)(const char *str); -typedef void *(*curl_calloc_callback)(size_t nmemb, size_t size); - -/* the kind of data that is passed to information_callback*/ -typedef enum { - CURLINFO_TEXT = 0, - CURLINFO_HEADER_IN, /* 1 */ - CURLINFO_HEADER_OUT, /* 2 */ - CURLINFO_DATA_IN, /* 3 */ - CURLINFO_DATA_OUT, /* 4 */ - CURLINFO_SSL_DATA_IN, /* 5 */ - CURLINFO_SSL_DATA_OUT, /* 6 */ - CURLINFO_END -} curl_infotype; - -typedef int (*curl_debug_callback) - (CURL *handle, /* the handle/transfer this concerns */ - curl_infotype type, /* what kind of data */ - char *data, /* points to the data */ - size_t size, /* size of the data pointed to */ - void *userptr); /* whatever the user please */ - -/* All possible error codes from all sorts of curl functions. Future versions - may return other values, stay prepared. - - Always add new return codes last. Never *EVER* remove any. The return - codes must remain the same! - */ - -typedef enum { - CURLE_OK = 0, - CURLE_UNSUPPORTED_PROTOCOL, /* 1 */ - CURLE_FAILED_INIT, /* 2 */ - CURLE_URL_MALFORMAT, /* 3 */ - CURLE_OBSOLETE4, /* 4 - NOT USED */ - CURLE_COULDNT_RESOLVE_PROXY, /* 5 */ - CURLE_COULDNT_RESOLVE_HOST, /* 6 */ - CURLE_COULDNT_CONNECT, /* 7 */ - CURLE_FTP_WEIRD_SERVER_REPLY, /* 8 */ - CURLE_REMOTE_ACCESS_DENIED, /* 9 a service was denied by the server - due to lack of access - when login fails - this is not returned. */ - CURLE_OBSOLETE10, /* 10 - NOT USED */ - CURLE_FTP_WEIRD_PASS_REPLY, /* 11 */ - CURLE_OBSOLETE12, /* 12 - NOT USED */ - CURLE_FTP_WEIRD_PASV_REPLY, /* 13 */ - CURLE_FTP_WEIRD_227_FORMAT, /* 14 */ - CURLE_FTP_CANT_GET_HOST, /* 15 */ - CURLE_OBSOLETE16, /* 16 - NOT USED */ - CURLE_FTP_COULDNT_SET_TYPE, /* 17 */ - CURLE_PARTIAL_FILE, /* 18 */ - CURLE_FTP_COULDNT_RETR_FILE, /* 19 */ - CURLE_OBSOLETE20, /* 20 - NOT USED */ - CURLE_QUOTE_ERROR, /* 21 - quote command failure */ - CURLE_HTTP_RETURNED_ERROR, /* 22 */ - CURLE_WRITE_ERROR, /* 23 */ - CURLE_OBSOLETE24, /* 24 - NOT USED */ - CURLE_UPLOAD_FAILED, /* 25 - failed upload "command" */ - CURLE_READ_ERROR, /* 26 - couldn't open/read from file */ - CURLE_OUT_OF_MEMORY, /* 27 */ - /* Note: CURLE_OUT_OF_MEMORY may sometimes indicate a conversion error - instead of a memory allocation error if CURL_DOES_CONVERSIONS - is defined - */ - CURLE_OPERATION_TIMEDOUT, /* 28 - the timeout time was reached */ - CURLE_OBSOLETE29, /* 29 - NOT USED */ - CURLE_FTP_PORT_FAILED, /* 30 - FTP PORT operation failed */ - CURLE_FTP_COULDNT_USE_REST, /* 31 - the REST command failed */ - CURLE_OBSOLETE32, /* 32 - NOT USED */ - CURLE_RANGE_ERROR, /* 33 - RANGE "command" didn't work */ - CURLE_HTTP_POST_ERROR, /* 34 */ - CURLE_SSL_CONNECT_ERROR, /* 35 - wrong when connecting with SSL */ - CURLE_BAD_DOWNLOAD_RESUME, /* 36 - couldn't resume download */ - CURLE_FILE_COULDNT_READ_FILE, /* 37 */ - CURLE_LDAP_CANNOT_BIND, /* 38 */ - CURLE_LDAP_SEARCH_FAILED, /* 39 */ - CURLE_OBSOLETE40, /* 40 - NOT USED */ - CURLE_FUNCTION_NOT_FOUND, /* 41 */ - CURLE_ABORTED_BY_CALLBACK, /* 42 */ - CURLE_BAD_FUNCTION_ARGUMENT, /* 43 */ - CURLE_OBSOLETE44, /* 44 - NOT USED */ - CURLE_INTERFACE_FAILED, /* 45 - CURLOPT_INTERFACE failed */ - CURLE_OBSOLETE46, /* 46 - NOT USED */ - CURLE_TOO_MANY_REDIRECTS , /* 47 - catch endless re-direct loops */ - CURLE_UNKNOWN_TELNET_OPTION, /* 48 - User specified an unknown option */ - CURLE_TELNET_OPTION_SYNTAX , /* 49 - Malformed telnet option */ - CURLE_OBSOLETE50, /* 50 - NOT USED */ - CURLE_PEER_FAILED_VERIFICATION, /* 51 - peer's certificate or fingerprint - wasn't verified fine */ - CURLE_GOT_NOTHING, /* 52 - when this is a specific error */ - CURLE_SSL_ENGINE_NOTFOUND, /* 53 - SSL crypto engine not found */ - CURLE_SSL_ENGINE_SETFAILED, /* 54 - can not set SSL crypto engine as - default */ - CURLE_SEND_ERROR, /* 55 - failed sending network data */ - CURLE_RECV_ERROR, /* 56 - failure in receiving network data */ - CURLE_OBSOLETE57, /* 57 - NOT IN USE */ - CURLE_SSL_CERTPROBLEM, /* 58 - problem with the local certificate */ - CURLE_SSL_CIPHER, /* 59 - couldn't use specified cipher */ - CURLE_SSL_CACERT, /* 60 - problem with the CA cert (path?) */ - CURLE_BAD_CONTENT_ENCODING, /* 61 - Unrecognized transfer encoding */ - CURLE_LDAP_INVALID_URL, /* 62 - Invalid LDAP URL */ - CURLE_FILESIZE_EXCEEDED, /* 63 - Maximum file size exceeded */ - CURLE_USE_SSL_FAILED, /* 64 - Requested FTP SSL level failed */ - CURLE_SEND_FAIL_REWIND, /* 65 - Sending the data requires a rewind - that failed */ - CURLE_SSL_ENGINE_INITFAILED, /* 66 - failed to initialise ENGINE */ - CURLE_LOGIN_DENIED, /* 67 - user, password or similar was not - accepted and we failed to login */ - CURLE_TFTP_NOTFOUND, /* 68 - file not found on server */ - CURLE_TFTP_PERM, /* 69 - permission problem on server */ - CURLE_REMOTE_DISK_FULL, /* 70 - out of disk space on server */ - CURLE_TFTP_ILLEGAL, /* 71 - Illegal TFTP operation */ - CURLE_TFTP_UNKNOWNID, /* 72 - Unknown transfer ID */ - CURLE_REMOTE_FILE_EXISTS, /* 73 - File already exists */ - CURLE_TFTP_NOSUCHUSER, /* 74 - No such user */ - CURLE_CONV_FAILED, /* 75 - conversion failed */ - CURLE_CONV_REQD, /* 76 - caller must register conversion - callbacks using curl_easy_setopt options - CURLOPT_CONV_FROM_NETWORK_FUNCTION, - CURLOPT_CONV_TO_NETWORK_FUNCTION, and - CURLOPT_CONV_FROM_UTF8_FUNCTION */ - CURLE_SSL_CACERT_BADFILE, /* 77 - could not load CACERT file, missing - or wrong format */ - CURLE_REMOTE_FILE_NOT_FOUND, /* 78 - remote file not found */ - CURLE_SSH, /* 79 - error from the SSH layer, somewhat - generic so the error message will be of - interest when this has happened */ - - CURLE_SSL_SHUTDOWN_FAILED, /* 80 - Failed to shut down the SSL - connection */ - CURLE_AGAIN, /* 81 - socket is not ready for send/recv, - wait till it's ready and try again (Added - in 7.18.2) */ - CURLE_SSL_CRL_BADFILE, /* 82 - could not load CRL file, missing or - wrong format (Added in 7.19.0) */ - CURLE_SSL_ISSUER_ERROR, /* 83 - Issuer check failed. (Added in - 7.19.0) */ - CURLE_FTP_PRET_FAILED, /* 84 - a PRET command failed */ - CURLE_RTSP_CSEQ_ERROR, /* 85 - mismatch of RTSP CSeq numbers */ - CURLE_RTSP_SESSION_ERROR, /* 86 - mismatch of RTSP Session Identifiers */ - CURLE_FTP_BAD_FILE_LIST, /* 87 - unable to parse FTP file list */ - CURLE_CHUNK_FAILED, /* 88 - chunk callback reported error */ - - CURL_LAST /* never use! */ -} CURLcode; - -#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all - the obsolete stuff removed! */ - -/* Backwards compatibility with older names */ - -/* The following were added in 7.17.1 */ -/* These are scheduled to disappear by 2009 */ -#define CURLE_SSL_PEER_CERTIFICATE CURLE_PEER_FAILED_VERIFICATION - -/* The following were added in 7.17.0 */ -/* These are scheduled to disappear by 2009 */ -#define CURLE_OBSOLETE CURLE_OBSOLETE50 /* noone should be using this! */ -#define CURLE_BAD_PASSWORD_ENTERED CURLE_OBSOLETE46 -#define CURLE_BAD_CALLING_ORDER CURLE_OBSOLETE44 -#define CURLE_FTP_USER_PASSWORD_INCORRECT CURLE_OBSOLETE10 -#define CURLE_FTP_CANT_RECONNECT CURLE_OBSOLETE16 -#define CURLE_FTP_COULDNT_GET_SIZE CURLE_OBSOLETE32 -#define CURLE_FTP_COULDNT_SET_ASCII CURLE_OBSOLETE29 -#define CURLE_FTP_WEIRD_USER_REPLY CURLE_OBSOLETE12 -#define CURLE_FTP_WRITE_ERROR CURLE_OBSOLETE20 -#define CURLE_LIBRARY_NOT_FOUND CURLE_OBSOLETE40 -#define CURLE_MALFORMAT_USER CURLE_OBSOLETE24 -#define CURLE_SHARE_IN_USE CURLE_OBSOLETE57 -#define CURLE_URL_MALFORMAT_USER CURLE_OBSOLETE4 - -#define CURLE_FTP_ACCESS_DENIED CURLE_REMOTE_ACCESS_DENIED -#define CURLE_FTP_COULDNT_SET_BINARY CURLE_FTP_COULDNT_SET_TYPE -#define CURLE_FTP_QUOTE_ERROR CURLE_QUOTE_ERROR -#define CURLE_TFTP_DISKFULL CURLE_REMOTE_DISK_FULL -#define CURLE_TFTP_EXISTS CURLE_REMOTE_FILE_EXISTS -#define CURLE_HTTP_RANGE_ERROR CURLE_RANGE_ERROR -#define CURLE_FTP_SSL_FAILED CURLE_USE_SSL_FAILED - -/* The following were added earlier */ - -#define CURLE_OPERATION_TIMEOUTED CURLE_OPERATION_TIMEDOUT - -#define CURLE_HTTP_NOT_FOUND CURLE_HTTP_RETURNED_ERROR -#define CURLE_HTTP_PORT_FAILED CURLE_INTERFACE_FAILED -#define CURLE_FTP_COULDNT_STOR_FILE CURLE_UPLOAD_FAILED - -#define CURLE_FTP_PARTIAL_FILE CURLE_PARTIAL_FILE -#define CURLE_FTP_BAD_DOWNLOAD_RESUME CURLE_BAD_DOWNLOAD_RESUME - -/* This was the error code 50 in 7.7.3 and a few earlier versions, this - is no longer used by libcurl but is instead #defined here only to not - make programs break */ -#define CURLE_ALREADY_COMPLETE 99999 - -#endif /*!CURL_NO_OLDIES*/ - -/* This prototype applies to all conversion callbacks */ -typedef CURLcode (*curl_conv_callback)(char *buffer, size_t length); - -typedef CURLcode (*curl_ssl_ctx_callback)(CURL *curl, /* easy handle */ - void *ssl_ctx, /* actually an - OpenSSL SSL_CTX */ - void *userptr); - -typedef enum { - CURLPROXY_HTTP = 0, /* added in 7.10, new in 7.19.4 default is to use - CONNECT HTTP/1.1 */ - CURLPROXY_HTTP_1_0 = 1, /* added in 7.19.4, force to use CONNECT - HTTP/1.0 */ - CURLPROXY_SOCKS4 = 4, /* support added in 7.15.2, enum existed already - in 7.10 */ - CURLPROXY_SOCKS5 = 5, /* added in 7.10 */ - CURLPROXY_SOCKS4A = 6, /* added in 7.18.0 */ - CURLPROXY_SOCKS5_HOSTNAME = 7 /* Use the SOCKS5 protocol but pass along the - host name rather than the IP address. added - in 7.18.0 */ -} curl_proxytype; /* this enum was added in 7.10 */ - -#define CURLAUTH_NONE 0 /* nothing */ -#define CURLAUTH_BASIC (1<<0) /* Basic (default) */ -#define CURLAUTH_DIGEST (1<<1) /* Digest */ -#define CURLAUTH_GSSNEGOTIATE (1<<2) /* GSS-Negotiate */ -#define CURLAUTH_NTLM (1<<3) /* NTLM */ -#define CURLAUTH_DIGEST_IE (1<<4) /* Digest with IE flavour */ -#define CURLAUTH_ONLY (1<<31) /* used together with a single other - type to force no auth or just that - single type */ -#define CURLAUTH_ANY (~CURLAUTH_DIGEST_IE) /* all fine types set */ -#define CURLAUTH_ANYSAFE (~(CURLAUTH_BASIC|CURLAUTH_DIGEST_IE)) - -#define CURLSSH_AUTH_ANY ~0 /* all types supported by the server */ -#define CURLSSH_AUTH_NONE 0 /* none allowed, silly but complete */ -#define CURLSSH_AUTH_PUBLICKEY (1<<0) /* public/private key files */ -#define CURLSSH_AUTH_PASSWORD (1<<1) /* password */ -#define CURLSSH_AUTH_HOST (1<<2) /* host key files */ -#define CURLSSH_AUTH_KEYBOARD (1<<3) /* keyboard interactive */ -#define CURLSSH_AUTH_DEFAULT CURLSSH_AUTH_ANY - -#define CURL_ERROR_SIZE 256 - -struct curl_khkey { - const char *key; /* points to a zero-terminated string encoded with base64 - if len is zero, otherwise to the "raw" data */ - size_t len; - enum type { - CURLKHTYPE_UNKNOWN, - CURLKHTYPE_RSA1, - CURLKHTYPE_RSA, - CURLKHTYPE_DSS - } keytype; -}; - -/* this is the set of return values expected from the curl_sshkeycallback - callback */ -enum curl_khstat { - CURLKHSTAT_FINE_ADD_TO_FILE, - CURLKHSTAT_FINE, - CURLKHSTAT_REJECT, /* reject the connection, return an error */ - CURLKHSTAT_DEFER, /* do not accept it, but we can't answer right now so - this causes a CURLE_DEFER error but otherwise the - connection will be left intact etc */ - CURLKHSTAT_LAST /* not for use, only a marker for last-in-list */ -}; - -/* this is the set of status codes pass in to the callback */ -enum curl_khmatch { - CURLKHMATCH_OK, /* match */ - CURLKHMATCH_MISMATCH, /* host found, key mismatch! */ - CURLKHMATCH_MISSING, /* no matching host/key found */ - CURLKHMATCH_LAST /* not for use, only a marker for last-in-list */ -}; - -typedef int - (*curl_sshkeycallback) (CURL *easy, /* easy handle */ - const struct curl_khkey *knownkey, /* known */ - const struct curl_khkey *foundkey, /* found */ - enum curl_khmatch, /* libcurl's view on the keys */ - void *clientp); /* custom pointer passed from app */ - -/* parameter for the CURLOPT_USE_SSL option */ -typedef enum { - CURLUSESSL_NONE, /* do not attempt to use SSL */ - CURLUSESSL_TRY, /* try using SSL, proceed anyway otherwise */ - CURLUSESSL_CONTROL, /* SSL for the control connection or fail */ - CURLUSESSL_ALL, /* SSL for all communication or fail */ - CURLUSESSL_LAST /* not an option, never use */ -} curl_usessl; - -#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all - the obsolete stuff removed! */ - -/* Backwards compatibility with older names */ -/* These are scheduled to disappear by 2009 */ - -#define CURLFTPSSL_NONE CURLUSESSL_NONE -#define CURLFTPSSL_TRY CURLUSESSL_TRY -#define CURLFTPSSL_CONTROL CURLUSESSL_CONTROL -#define CURLFTPSSL_ALL CURLUSESSL_ALL -#define CURLFTPSSL_LAST CURLUSESSL_LAST -#define curl_ftpssl curl_usessl -#endif /*!CURL_NO_OLDIES*/ - -/* parameter for the CURLOPT_FTP_SSL_CCC option */ -typedef enum { - CURLFTPSSL_CCC_NONE, /* do not send CCC */ - CURLFTPSSL_CCC_PASSIVE, /* Let the server initiate the shutdown */ - CURLFTPSSL_CCC_ACTIVE, /* Initiate the shutdown */ - CURLFTPSSL_CCC_LAST /* not an option, never use */ -} curl_ftpccc; - -/* parameter for the CURLOPT_FTPSSLAUTH option */ -typedef enum { - CURLFTPAUTH_DEFAULT, /* let libcurl decide */ - CURLFTPAUTH_SSL, /* use "AUTH SSL" */ - CURLFTPAUTH_TLS, /* use "AUTH TLS" */ - CURLFTPAUTH_LAST /* not an option, never use */ -} curl_ftpauth; - -/* parameter for the CURLOPT_FTP_CREATE_MISSING_DIRS option */ -typedef enum { - CURLFTP_CREATE_DIR_NONE, /* do NOT create missing dirs! */ - CURLFTP_CREATE_DIR, /* (FTP/SFTP) if CWD fails, try MKD and then CWD - again if MKD succeeded, for SFTP this does - similar magic */ - CURLFTP_CREATE_DIR_RETRY, /* (FTP only) if CWD fails, try MKD and then CWD - again even if MKD failed! */ - CURLFTP_CREATE_DIR_LAST /* not an option, never use */ -} curl_ftpcreatedir; - -/* parameter for the CURLOPT_FTP_FILEMETHOD option */ -typedef enum { - CURLFTPMETHOD_DEFAULT, /* let libcurl pick */ - CURLFTPMETHOD_MULTICWD, /* single CWD operation for each path part */ - CURLFTPMETHOD_NOCWD, /* no CWD at all */ - CURLFTPMETHOD_SINGLECWD, /* one CWD to full dir, then work on file */ - CURLFTPMETHOD_LAST /* not an option, never use */ -} curl_ftpmethod; - -/* CURLPROTO_ defines are for the CURLOPT_*PROTOCOLS options */ -#define CURLPROTO_HTTP (1<<0) -#define CURLPROTO_HTTPS (1<<1) -#define CURLPROTO_FTP (1<<2) -#define CURLPROTO_FTPS (1<<3) -#define CURLPROTO_SCP (1<<4) -#define CURLPROTO_SFTP (1<<5) -#define CURLPROTO_TELNET (1<<6) -#define CURLPROTO_LDAP (1<<7) -#define CURLPROTO_LDAPS (1<<8) -#define CURLPROTO_DICT (1<<9) -#define CURLPROTO_FILE (1<<10) -#define CURLPROTO_TFTP (1<<11) -#define CURLPROTO_IMAP (1<<12) -#define CURLPROTO_IMAPS (1<<13) -#define CURLPROTO_POP3 (1<<14) -#define CURLPROTO_POP3S (1<<15) -#define CURLPROTO_SMTP (1<<16) -#define CURLPROTO_SMTPS (1<<17) -#define CURLPROTO_RTSP (1<<18) -#define CURLPROTO_RTMP (1<<19) -#define CURLPROTO_RTMPT (1<<20) -#define CURLPROTO_RTMPE (1<<21) -#define CURLPROTO_RTMPTE (1<<22) -#define CURLPROTO_RTMPS (1<<23) -#define CURLPROTO_RTMPTS (1<<24) -#define CURLPROTO_GOPHER (1<<25) -#define CURLPROTO_ALL (~0) /* enable everything */ - -/* long may be 32 or 64 bits, but we should never depend on anything else - but 32 */ -#define CURLOPTTYPE_LONG 0 -#define CURLOPTTYPE_OBJECTPOINT 10000 -#define CURLOPTTYPE_FUNCTIONPOINT 20000 -#define CURLOPTTYPE_OFF_T 30000 - -/* name is uppercase CURLOPT_<name>, - type is one of the defined CURLOPTTYPE_<type> - number is unique identifier */ -#ifdef CINIT -#undef CINIT -#endif - -#ifdef CURL_ISOCPP -#define CINIT(name,type,number) CURLOPT_ ## name = CURLOPTTYPE_ ## type + number -#else -/* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */ -#define LONG CURLOPTTYPE_LONG -#define OBJECTPOINT CURLOPTTYPE_OBJECTPOINT -#define FUNCTIONPOINT CURLOPTTYPE_FUNCTIONPOINT -#define OFF_T CURLOPTTYPE_OFF_T -#define CINIT(name,type,number) CURLOPT_/**/name = type + number -#endif - -/* - * This macro-mania below setups the CURLOPT_[what] enum, to be used with - * curl_easy_setopt(). The first argument in the CINIT() macro is the [what] - * word. - */ - -typedef enum { - /* This is the FILE * or void * the regular output should be written to. */ - CINIT(FILE, OBJECTPOINT, 1), - - /* The full URL to get/put */ - CINIT(URL, OBJECTPOINT, 2), - - /* Port number to connect to, if other than default. */ - CINIT(PORT, LONG, 3), - - /* Name of proxy to use. */ - CINIT(PROXY, OBJECTPOINT, 4), - - /* "name:password" to use when fetching. */ - CINIT(USERPWD, OBJECTPOINT, 5), - - /* "name:password" to use with proxy. */ - CINIT(PROXYUSERPWD, OBJECTPOINT, 6), - - /* Range to get, specified as an ASCII string. */ - CINIT(RANGE, OBJECTPOINT, 7), - - /* not used */ - - /* Specified file stream to upload from (use as input): */ - CINIT(INFILE, OBJECTPOINT, 9), - - /* Buffer to receive error messages in, must be at least CURL_ERROR_SIZE - * bytes big. If this is not used, error messages go to stderr instead: */ - CINIT(ERRORBUFFER, OBJECTPOINT, 10), - - /* Function that will be called to store the output (instead of fwrite). The - * parameters will use fwrite() syntax, make sure to follow them. */ - CINIT(WRITEFUNCTION, FUNCTIONPOINT, 11), - - /* Function that will be called to read the input (instead of fread). The - * parameters will use fread() syntax, make sure to follow them. */ - CINIT(READFUNCTION, FUNCTIONPOINT, 12), - - /* Time-out the read operation after this amount of seconds */ - CINIT(TIMEOUT, LONG, 13), - - /* If the CURLOPT_INFILE is used, this can be used to inform libcurl about - * how large the file being sent really is. That allows better error - * checking and better verifies that the upload was successful. -1 means - * unknown size. - * - * For large file support, there is also a _LARGE version of the key - * which takes an off_t type, allowing platforms with larger off_t - * sizes to handle larger files. See below for INFILESIZE_LARGE. - */ - CINIT(INFILESIZE, LONG, 14), - - /* POST static input fields. */ - CINIT(POSTFIELDS, OBJECTPOINT, 15), - - /* Set the referrer page (needed by some CGIs) */ - CINIT(REFERER, OBJECTPOINT, 16), - - /* Set the FTP PORT string (interface name, named or numerical IP address) - Use i.e '-' to use default address. */ - CINIT(FTPPORT, OBJECTPOINT, 17), - - /* Set the User-Agent string (examined by some CGIs) */ - CINIT(USERAGENT, OBJECTPOINT, 18), - - /* If the download receives less than "low speed limit" bytes/second - * during "low speed time" seconds, the operations is aborted. - * You could i.e if you have a pretty high speed connection, abort if - * it is less than 2000 bytes/sec during 20 seconds. - */ - - /* Set the "low speed limit" */ - CINIT(LOW_SPEED_LIMIT, LONG, 19), - - /* Set the "low speed time" */ - CINIT(LOW_SPEED_TIME, LONG, 20), - - /* Set the continuation offset. - * - * Note there is also a _LARGE version of this key which uses - * off_t types, allowing for large file offsets on platforms which - * use larger-than-32-bit off_t's. Look below for RESUME_FROM_LARGE. - */ - CINIT(RESUME_FROM, LONG, 21), - - /* Set cookie in request: */ - CINIT(COOKIE, OBJECTPOINT, 22), - - /* This points to a linked list of headers, struct curl_slist kind */ - CINIT(HTTPHEADER, OBJECTPOINT, 23), - - /* This points to a linked list of post entries, struct curl_httppost */ - CINIT(HTTPPOST, OBJECTPOINT, 24), - - /* name of the file keeping your private SSL-certificate */ - CINIT(SSLCERT, OBJECTPOINT, 25), - - /* password for the SSL or SSH private key */ - CINIT(KEYPASSWD, OBJECTPOINT, 26), - - /* send TYPE parameter? */ - CINIT(CRLF, LONG, 27), - - /* send linked-list of QUOTE commands */ - CINIT(QUOTE, OBJECTPOINT, 28), - - /* send FILE * or void * to store headers to, if you use a callback it - is simply passed to the callback unmodified */ - CINIT(WRITEHEADER, OBJECTPOINT, 29), - - /* point to a file to read the initial cookies from, also enables - "cookie awareness" */ - CINIT(COOKIEFILE, OBJECTPOINT, 31), - - /* What version to specifically try to use. - See CURL_SSLVERSION defines below. */ - CINIT(SSLVERSION, LONG, 32), - - /* What kind of HTTP time condition to use, see defines */ - CINIT(TIMECONDITION, LONG, 33), - - /* Time to use with the above condition. Specified in number of seconds - since 1 Jan 1970 */ - CINIT(TIMEVALUE, LONG, 34), - - /* 35 = OBSOLETE */ - - /* Custom request, for customizing the get command like - HTTP: DELETE, TRACE and others - FTP: to use a different list command - */ - CINIT(CUSTOMREQUEST, OBJECTPOINT, 36), - - /* HTTP request, for odd commands like DELETE, TRACE and others */ - CINIT(STDERR, OBJECTPOINT, 37), - - /* 38 is not used */ - - /* send linked-list of post-transfer QUOTE commands */ - CINIT(POSTQUOTE, OBJECTPOINT, 39), - - /* Pass a pointer to string of the output using full variable-replacement - as described elsewhere. */ - CINIT(WRITEINFO, OBJECTPOINT, 40), - - CINIT(VERBOSE, LONG, 41), /* talk a lot */ - CINIT(HEADER, LONG, 42), /* throw the header out too */ - CINIT(NOPROGRESS, LONG, 43), /* shut off the progress meter */ - CINIT(NOBODY, LONG, 44), /* use HEAD to get http document */ - CINIT(FAILONERROR, LONG, 45), /* no output on http error codes >= 300 */ - CINIT(UPLOAD, LONG, 46), /* this is an upload */ - CINIT(POST, LONG, 47), /* HTTP POST method */ - CINIT(DIRLISTONLY, LONG, 48), /* return bare names when listing directories */ - - CINIT(APPEND, LONG, 50), /* Append instead of overwrite on upload! */ - - /* Specify whether to read the user+password from the .netrc or the URL. - * This must be one of the CURL_NETRC_* enums below. */ - CINIT(NETRC, LONG, 51), - - CINIT(FOLLOWLOCATION, LONG, 52), /* use Location: Luke! */ - - CINIT(TRANSFERTEXT, LONG, 53), /* transfer data in text/ASCII format */ - CINIT(PUT, LONG, 54), /* HTTP PUT */ - - /* 55 = OBSOLETE */ - - /* Function that will be called instead of the internal progress display - * function. This function should be defined as the curl_progress_callback - * prototype defines. */ - CINIT(PROGRESSFUNCTION, FUNCTIONPOINT, 56), - - /* Data passed to the progress callback */ - CINIT(PROGRESSDATA, OBJECTPOINT, 57), - - /* We want the referrer field set automatically when following locations */ - CINIT(AUTOREFERER, LONG, 58), - - /* Port of the proxy, can be set in the proxy string as well with: - "[host]:[port]" */ - CINIT(PROXYPORT, LONG, 59), - - /* size of the POST input data, if strlen() is not good to use */ - CINIT(POSTFIELDSIZE, LONG, 60), - - /* tunnel non-http operations through a HTTP proxy */ - CINIT(HTTPPROXYTUNNEL, LONG, 61), - - /* Set the interface string to use as outgoing network interface */ - CINIT(INTERFACE, OBJECTPOINT, 62), - - /* Set the krb4/5 security level, this also enables krb4/5 awareness. This - * is a string, 'clear', 'safe', 'confidential' or 'private'. If the string - * is set but doesn't match one of these, 'private' will be used. */ - CINIT(KRBLEVEL, OBJECTPOINT, 63), - - /* Set if we should verify the peer in ssl handshake, set 1 to verify. */ - CINIT(SSL_VERIFYPEER, LONG, 64), - - /* The CApath or CAfile used to validate the peer certificate - this option is used only if SSL_VERIFYPEER is true */ - CINIT(CAINFO, OBJECTPOINT, 65), - - /* 66 = OBSOLETE */ - /* 67 = OBSOLETE */ - - /* Maximum number of http redirects to follow */ - CINIT(MAXREDIRS, LONG, 68), - - /* Pass a long set to 1 to get the date of the requested document (if - possible)! Pass a zero to shut it off. */ - CINIT(FILETIME, LONG, 69), - - /* This points to a linked list of telnet options */ - CINIT(TELNETOPTIONS, OBJECTPOINT, 70), - - /* Max amount of cached alive connections */ - CINIT(MAXCONNECTS, LONG, 71), - - /* What policy to use when closing connections when the cache is filled - up */ - CINIT(CLOSEPOLICY, LONG, 72), - - /* 73 = OBSOLETE */ - - /* Set to explicitly use a new connection for the upcoming transfer. - Do not use this unless you're absolutely sure of this, as it makes the - operation slower and is less friendly for the network. */ - CINIT(FRESH_CONNECT, LONG, 74), - - /* Set to explicitly forbid the upcoming transfer's connection to be re-used - when done. Do not use this unless you're absolutely sure of this, as it - makes the operation slower and is less friendly for the network. */ - CINIT(FORBID_REUSE, LONG, 75), - - /* Set to a file name that contains random data for libcurl to use to - seed the random engine when doing SSL connects. */ - CINIT(RANDOM_FILE, OBJECTPOINT, 76), - - /* Set to the Entropy Gathering Daemon socket pathname */ - CINIT(EGDSOCKET, OBJECTPOINT, 77), - - /* Time-out connect operations after this amount of seconds, if connects - are OK within this time, then fine... This only aborts the connect - phase. [Only works on unix-style/SIGALRM operating systems] */ - CINIT(CONNECTTIMEOUT, LONG, 78), - - /* Function that will be called to store headers (instead of fwrite). The - * parameters will use fwrite() syntax, make sure to follow them. */ - CINIT(HEADERFUNCTION, FUNCTIONPOINT, 79), - - /* Set this to force the HTTP request to get back to GET. Only really usable - if POST, PUT or a custom request have been used first. - */ - CINIT(HTTPGET, LONG, 80), - - /* Set if we should verify the Common name from the peer certificate in ssl - * handshake, set 1 to check existence, 2 to ensure that it matches the - * provided hostname. */ - CINIT(SSL_VERIFYHOST, LONG, 81), - - /* Specify which file name to write all known cookies in after completed - operation. Set file name to "-" (dash) to make it go to stdout. */ - CINIT(COOKIEJAR, OBJECTPOINT, 82), - - /* Specify which SSL ciphers to use */ - CINIT(SSL_CIPHER_LIST, OBJECTPOINT, 83), - - /* Specify which HTTP version to use! This must be set to one of the - CURL_HTTP_VERSION* enums set below. */ - CINIT(HTTP_VERSION, LONG, 84), - - /* Specifically switch on or off the FTP engine's use of the EPSV command. By - default, that one will always be attempted before the more traditional - PASV command. */ - CINIT(FTP_USE_EPSV, LONG, 85), - - /* type of the file keeping your SSL-certificate ("DER", "PEM", "ENG") */ - CINIT(SSLCERTTYPE, OBJECTPOINT, 86), - - /* name of the file keeping your private SSL-key */ - CINIT(SSLKEY, OBJECTPOINT, 87), - - /* type of the file keeping your private SSL-key ("DER", "PEM", "ENG") */ - CINIT(SSLKEYTYPE, OBJECTPOINT, 88), - - /* crypto engine for the SSL-sub system */ - CINIT(SSLENGINE, OBJECTPOINT, 89), - - /* set the crypto engine for the SSL-sub system as default - the param has no meaning... - */ - CINIT(SSLENGINE_DEFAULT, LONG, 90), - - /* Non-zero value means to use the global dns cache */ - CINIT(DNS_USE_GLOBAL_CACHE, LONG, 91), /* To become OBSOLETE soon */ - - /* DNS cache timeout */ - CINIT(DNS_CACHE_TIMEOUT, LONG, 92), - - /* send linked-list of pre-transfer QUOTE commands */ - CINIT(PREQUOTE, OBJECTPOINT, 93), - - /* set the debug function */ - CINIT(DEBUGFUNCTION, FUNCTIONPOINT, 94), - - /* set the data for the debug function */ - CINIT(DEBUGDATA, OBJECTPOINT, 95), - - /* mark this as start of a cookie session */ - CINIT(COOKIESESSION, LONG, 96), - - /* The CApath directory used to validate the peer certificate - this option is used only if SSL_VERIFYPEER is true */ - CINIT(CAPATH, OBJECTPOINT, 97), - - /* Instruct libcurl to use a smaller receive buffer */ - CINIT(BUFFERSIZE, LONG, 98), - - /* Instruct libcurl to not use any signal/alarm handlers, even when using - timeouts. This option is useful for multi-threaded applications. - See libcurl-the-guide for more background information. */ - CINIT(NOSIGNAL, LONG, 99), - - /* Provide a CURLShare for mutexing non-ts data */ - CINIT(SHARE, OBJECTPOINT, 100), - - /* indicates type of proxy. accepted values are CURLPROXY_HTTP (default), - CURLPROXY_SOCKS4, CURLPROXY_SOCKS4A and CURLPROXY_SOCKS5. */ - CINIT(PROXYTYPE, LONG, 101), - - /* Set the Accept-Encoding string. Use this to tell a server you would like - the response to be compressed. */ - CINIT(ENCODING, OBJECTPOINT, 102), - - /* Set pointer to private data */ - CINIT(PRIVATE, OBJECTPOINT, 103), - - /* Set aliases for HTTP 200 in the HTTP Response header */ - CINIT(HTTP200ALIASES, OBJECTPOINT, 104), - - /* Continue to send authentication (user+password) when following locations, - even when hostname changed. This can potentially send off the name - and password to whatever host the server decides. */ - CINIT(UNRESTRICTED_AUTH, LONG, 105), - - /* Specifically switch on or off the FTP engine's use of the EPRT command ( it - also disables the LPRT attempt). By default, those ones will always be - attempted before the good old traditional PORT command. */ - CINIT(FTP_USE_EPRT, LONG, 106), - - /* Set this to a bitmask value to enable the particular authentications - methods you like. Use this in combination with CURLOPT_USERPWD. - Note that setting multiple bits may cause extra network round-trips. */ - CINIT(HTTPAUTH, LONG, 107), - - /* Set the ssl context callback function, currently only for OpenSSL ssl_ctx - in second argument. The function must be matching the - curl_ssl_ctx_callback proto. */ - CINIT(SSL_CTX_FUNCTION, FUNCTIONPOINT, 108), - - /* Set the userdata for the ssl context callback function's third - argument */ - CINIT(SSL_CTX_DATA, OBJECTPOINT, 109), - - /* FTP Option that causes missing dirs to be created on the remote server. - In 7.19.4 we introduced the convenience enums for this option using the - CURLFTP_CREATE_DIR prefix. - */ - CINIT(FTP_CREATE_MISSING_DIRS, LONG, 110), - - /* Set this to a bitmask value to enable the particular authentications - methods you like. Use this in combination with CURLOPT_PROXYUSERPWD. - Note that setting multiple bits may cause extra network round-trips. */ - CINIT(PROXYAUTH, LONG, 111), - - /* FTP option that changes the timeout, in seconds, associated with - getting a response. This is different from transfer timeout time and - essentially places a demand on the FTP server to acknowledge commands - in a timely manner. */ - CINIT(FTP_RESPONSE_TIMEOUT, LONG, 112), -#define CURLOPT_SERVER_RESPONSE_TIMEOUT CURLOPT_FTP_RESPONSE_TIMEOUT - - /* Set this option to one of the CURL_IPRESOLVE_* defines (see below) to - tell libcurl to resolve names to those IP versions only. This only has - affect on systems with support for more than one, i.e IPv4 _and_ IPv6. */ - CINIT(IPRESOLVE, LONG, 113), - - /* Set this option to limit the size of a file that will be downloaded from - an HTTP or FTP server. - - Note there is also _LARGE version which adds large file support for - platforms which have larger off_t sizes. See MAXFILESIZE_LARGE below. */ - CINIT(MAXFILESIZE, LONG, 114), - - /* See the comment for INFILESIZE above, but in short, specifies - * the size of the file being uploaded. -1 means unknown. - */ - CINIT(INFILESIZE_LARGE, OFF_T, 115), - - /* Sets the continuation offset. There is also a LONG version of this; - * look above for RESUME_FROM. - */ - CINIT(RESUME_FROM_LARGE, OFF_T, 116), - - /* Sets the maximum size of data that will be downloaded from - * an HTTP or FTP server. See MAXFILESIZE above for the LONG version. - */ - CINIT(MAXFILESIZE_LARGE, OFF_T, 117), - - /* Set this option to the file name of your .netrc file you want libcurl - to parse (using the CURLOPT_NETRC option). If not set, libcurl will do - a poor attempt to find the user's home directory and check for a .netrc - file in there. */ - CINIT(NETRC_FILE, OBJECTPOINT, 118), - - /* Enable SSL/TLS for FTP, pick one of: - CURLFTPSSL_TRY - try using SSL, proceed anyway otherwise - CURLFTPSSL_CONTROL - SSL for the control connection or fail - CURLFTPSSL_ALL - SSL for all communication or fail - */ - CINIT(USE_SSL, LONG, 119), - - /* The _LARGE version of the standard POSTFIELDSIZE option */ - CINIT(POSTFIELDSIZE_LARGE, OFF_T, 120), - - /* Enable/disable the TCP Nagle algorithm */ - CINIT(TCP_NODELAY, LONG, 121), - - /* 122 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */ - /* 123 OBSOLETE. Gone in 7.16.0 */ - /* 124 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */ - /* 125 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */ - /* 126 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */ - /* 127 OBSOLETE. Gone in 7.16.0 */ - /* 128 OBSOLETE. Gone in 7.16.0 */ - - /* When FTP over SSL/TLS is selected (with CURLOPT_USE_SSL), this option - can be used to change libcurl's default action which is to first try - "AUTH SSL" and then "AUTH TLS" in this order, and proceed when a OK - response has been received. - - Available parameters are: - CURLFTPAUTH_DEFAULT - let libcurl decide - CURLFTPAUTH_SSL - try "AUTH SSL" first, then TLS - CURLFTPAUTH_TLS - try "AUTH TLS" first, then SSL - */ - CINIT(FTPSSLAUTH, LONG, 129), - - CINIT(IOCTLFUNCTION, FUNCTIONPOINT, 130), - CINIT(IOCTLDATA, OBJECTPOINT, 131), - - /* 132 OBSOLETE. Gone in 7.16.0 */ - /* 133 OBSOLETE. Gone in 7.16.0 */ - - /* zero terminated string for pass on to the FTP server when asked for - "account" info */ - CINIT(FTP_ACCOUNT, OBJECTPOINT, 134), - - /* feed cookies into cookie engine */ - CINIT(COOKIELIST, OBJECTPOINT, 135), - - /* ignore Content-Length */ - CINIT(IGNORE_CONTENT_LENGTH, LONG, 136), - - /* Set to non-zero to skip the IP address received in a 227 PASV FTP server - response. Typically used for FTP-SSL purposes but is not restricted to - that. libcurl will then instead use the same IP address it used for the - control connection. */ - CINIT(FTP_SKIP_PASV_IP, LONG, 137), - - /* Select "file method" to use when doing FTP, see the curl_ftpmethod - above. */ - CINIT(FTP_FILEMETHOD, LONG, 138), - - /* Local port number to bind the socket to */ - CINIT(LOCALPORT, LONG, 139), - - /* Number of ports to try, including the first one set with LOCALPORT. - Thus, setting it to 1 will make no additional attempts but the first. - */ - CINIT(LOCALPORTRANGE, LONG, 140), - - /* no transfer, set up connection and let application use the socket by - extracting it with CURLINFO_LASTSOCKET */ - CINIT(CONNECT_ONLY, LONG, 141), - - /* Function that will be called to convert from the - network encoding (instead of using the iconv calls in libcurl) */ - CINIT(CONV_FROM_NETWORK_FUNCTION, FUNCTIONPOINT, 142), - - /* Function that will be called to convert to the - network encoding (instead of using the iconv calls in libcurl) */ - CINIT(CONV_TO_NETWORK_FUNCTION, FUNCTIONPOINT, 143), - - /* Function that will be called to convert from UTF8 - (instead of using the iconv calls in libcurl) - Note that this is used only for SSL certificate processing */ - CINIT(CONV_FROM_UTF8_FUNCTION, FUNCTIONPOINT, 144), - - /* if the connection proceeds too quickly then need to slow it down */ - /* limit-rate: maximum number of bytes per second to send or receive */ - CINIT(MAX_SEND_SPEED_LARGE, OFF_T, 145), - CINIT(MAX_RECV_SPEED_LARGE, OFF_T, 146), - - /* Pointer to command string to send if USER/PASS fails. */ - CINIT(FTP_ALTERNATIVE_TO_USER, OBJECTPOINT, 147), - - /* callback function for setting socket options */ - CINIT(SOCKOPTFUNCTION, FUNCTIONPOINT, 148), - CINIT(SOCKOPTDATA, OBJECTPOINT, 149), - - /* set to 0 to disable session ID re-use for this transfer, default is - enabled (== 1) */ - CINIT(SSL_SESSIONID_CACHE, LONG, 150), - - /* allowed SSH authentication methods */ - CINIT(SSH_AUTH_TYPES, LONG, 151), - - /* Used by scp/sftp to do public/private key authentication */ - CINIT(SSH_PUBLIC_KEYFILE, OBJECTPOINT, 152), - CINIT(SSH_PRIVATE_KEYFILE, OBJECTPOINT, 153), - - /* Send CCC (Clear Command Channel) after authentication */ - CINIT(FTP_SSL_CCC, LONG, 154), - - /* Same as TIMEOUT and CONNECTTIMEOUT, but with ms resolution */ - CINIT(TIMEOUT_MS, LONG, 155), - CINIT(CONNECTTIMEOUT_MS, LONG, 156), - - /* set to zero to disable the libcurl's decoding and thus pass the raw body - data to the application even when it is encoded/compressed */ - CINIT(HTTP_TRANSFER_DECODING, LONG, 157), - CINIT(HTTP_CONTENT_DECODING, LONG, 158), - - /* Permission used when creating new files and directories on the remote - server for protocols that support it, SFTP/SCP/FILE */ - CINIT(NEW_FILE_PERMS, LONG, 159), - CINIT(NEW_DIRECTORY_PERMS, LONG, 160), - - /* Set the behaviour of POST when redirecting. Values must be set to one - of CURL_REDIR* defines below. This used to be called CURLOPT_POST301 */ - CINIT(POSTREDIR, LONG, 161), - - /* used by scp/sftp to verify the host's public key */ - CINIT(SSH_HOST_PUBLIC_KEY_MD5, OBJECTPOINT, 162), - - /* Callback function for opening socket (instead of socket(2)). Optionally, - callback is able change the address or refuse to connect returning - CURL_SOCKET_BAD. The callback should have type - curl_opensocket_callback */ - CINIT(OPENSOCKETFUNCTION, FUNCTIONPOINT, 163), - CINIT(OPENSOCKETDATA, OBJECTPOINT, 164), - - /* POST volatile input fields. */ - CINIT(COPYPOSTFIELDS, OBJECTPOINT, 165), - - /* set transfer mode (;type=<a|i>) when doing FTP via an HTTP proxy */ - CINIT(PROXY_TRANSFER_MODE, LONG, 166), - - /* Callback function for seeking in the input stream */ - CINIT(SEEKFUNCTION, FUNCTIONPOINT, 167), - CINIT(SEEKDATA, OBJECTPOINT, 168), - - /* CRL file */ - CINIT(CRLFILE, OBJECTPOINT, 169), - - /* Issuer certificate */ - CINIT(ISSUERCERT, OBJECTPOINT, 170), - - /* (IPv6) Address scope */ - CINIT(ADDRESS_SCOPE, LONG, 171), - - /* Collect certificate chain info and allow it to get retrievable with - CURLINFO_CERTINFO after the transfer is complete. (Unfortunately) only - working with OpenSSL-powered builds. */ - CINIT(CERTINFO, LONG, 172), - - /* "name" and "pwd" to use when fetching. */ - CINIT(USERNAME, OBJECTPOINT, 173), - CINIT(PASSWORD, OBJECTPOINT, 174), - - /* "name" and "pwd" to use with Proxy when fetching. */ - CINIT(PROXYUSERNAME, OBJECTPOINT, 175), - CINIT(PROXYPASSWORD, OBJECTPOINT, 176), - - /* Comma separated list of hostnames defining no-proxy zones. These should - match both hostnames directly, and hostnames within a domain. For - example, local.com will match local.com and www.local.com, but NOT - notlocal.com or www.notlocal.com. For compatibility with other - implementations of this, .local.com will be considered to be the same as - local.com. A single * is the only valid wildcard, and effectively - disables the use of proxy. */ - CINIT(NOPROXY, OBJECTPOINT, 177), - - /* block size for TFTP transfers */ - CINIT(TFTP_BLKSIZE, LONG, 178), - - /* Socks Service */ - CINIT(SOCKS5_GSSAPI_SERVICE, OBJECTPOINT, 179), - - /* Socks Service */ - CINIT(SOCKS5_GSSAPI_NEC, LONG, 180), - - /* set the bitmask for the protocols that are allowed to be used for the - transfer, which thus helps the app which takes URLs from users or other - external inputs and want to restrict what protocol(s) to deal - with. Defaults to CURLPROTO_ALL. */ - CINIT(PROTOCOLS, LONG, 181), - - /* set the bitmask for the protocols that libcurl is allowed to follow to, - as a subset of the CURLOPT_PROTOCOLS ones. That means the protocol needs - to be set in both bitmasks to be allowed to get redirected to. Defaults - to all protocols except FILE and SCP. */ - CINIT(REDIR_PROTOCOLS, LONG, 182), - - /* set the SSH knownhost file name to use */ - CINIT(SSH_KNOWNHOSTS, OBJECTPOINT, 183), - - /* set the SSH host key callback, must point to a curl_sshkeycallback - function */ - CINIT(SSH_KEYFUNCTION, FUNCTIONPOINT, 184), - - /* set the SSH host key callback custom pointer */ - CINIT(SSH_KEYDATA, OBJECTPOINT, 185), - - /* set the SMTP mail originator */ - CINIT(MAIL_FROM, OBJECTPOINT, 186), - - /* set the SMTP mail receiver(s) */ - CINIT(MAIL_RCPT, OBJECTPOINT, 187), - - /* FTP: send PRET before PASV */ - CINIT(FTP_USE_PRET, LONG, 188), - - /* RTSP request method (OPTIONS, SETUP, PLAY, etc...) */ - CINIT(RTSP_REQUEST, LONG, 189), - - /* The RTSP session identifier */ - CINIT(RTSP_SESSION_ID, OBJECTPOINT, 190), - - /* The RTSP stream URI */ - CINIT(RTSP_STREAM_URI, OBJECTPOINT, 191), - - /* The Transport: header to use in RTSP requests */ - CINIT(RTSP_TRANSPORT, OBJECTPOINT, 192), - - /* Manually initialize the client RTSP CSeq for this handle */ - CINIT(RTSP_CLIENT_CSEQ, LONG, 193), - - /* Manually initialize the server RTSP CSeq for this handle */ - CINIT(RTSP_SERVER_CSEQ, LONG, 194), - - /* The stream to pass to INTERLEAVEFUNCTION. */ - CINIT(INTERLEAVEDATA, OBJECTPOINT, 195), - - /* Let the application define a custom write method for RTP data */ - CINIT(INTERLEAVEFUNCTION, FUNCTIONPOINT, 196), - - /* Turn on wildcard matching */ - CINIT(WILDCARDMATCH, LONG, 197), - - /* Directory matching callback called before downloading of an - individual file (chunk) started */ - CINIT(CHUNK_BGN_FUNCTION, FUNCTIONPOINT, 198), - - /* Directory matching callback called after the file (chunk) - was downloaded, or skipped */ - CINIT(CHUNK_END_FUNCTION, FUNCTIONPOINT, 199), - - /* Change match (fnmatch-like) callback for wildcard matching */ - CINIT(FNMATCH_FUNCTION, FUNCTIONPOINT, 200), - - /* Let the application define custom chunk data pointer */ - CINIT(CHUNK_DATA, OBJECTPOINT, 201), - - /* FNMATCH_FUNCTION user pointer */ - CINIT(FNMATCH_DATA, OBJECTPOINT, 202), - - /* send linked-list of name:port:address sets */ - CINIT(RESOLVE, OBJECTPOINT, 203), - - CURLOPT_LASTENTRY /* the last unused */ -} CURLoption; - -#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all - the obsolete stuff removed! */ - -/* Backwards compatibility with older names */ -/* These are scheduled to disappear by 2011 */ - -/* This was added in version 7.19.1 */ -#define CURLOPT_POST301 CURLOPT_POSTREDIR - -/* These are scheduled to disappear by 2009 */ - -/* The following were added in 7.17.0 */ -#define CURLOPT_SSLKEYPASSWD CURLOPT_KEYPASSWD -#define CURLOPT_FTPAPPEND CURLOPT_APPEND -#define CURLOPT_FTPLISTONLY CURLOPT_DIRLISTONLY -#define CURLOPT_FTP_SSL CURLOPT_USE_SSL - -/* The following were added earlier */ - -#define CURLOPT_SSLCERTPASSWD CURLOPT_KEYPASSWD -#define CURLOPT_KRB4LEVEL CURLOPT_KRBLEVEL - -#else -/* This is set if CURL_NO_OLDIES is defined at compile-time */ -#undef CURLOPT_DNS_USE_GLOBAL_CACHE /* soon obsolete */ -#endif - - - /* Below here follows defines for the CURLOPT_IPRESOLVE option. If a host - name resolves addresses using more than one IP protocol version, this - option might be handy to force libcurl to use a specific IP version. */ -#define CURL_IPRESOLVE_WHATEVER 0 /* default, resolves addresses to all IP - versions that your system allows */ -#define CURL_IPRESOLVE_V4 1 /* resolve to ipv4 addresses */ -#define CURL_IPRESOLVE_V6 2 /* resolve to ipv6 addresses */ - - /* three convenient "aliases" that follow the name scheme better */ -#define CURLOPT_WRITEDATA CURLOPT_FILE -#define CURLOPT_READDATA CURLOPT_INFILE -#define CURLOPT_HEADERDATA CURLOPT_WRITEHEADER -#define CURLOPT_RTSPHEADER CURLOPT_HTTPHEADER - - /* These enums are for use with the CURLOPT_HTTP_VERSION option. */ -enum { - CURL_HTTP_VERSION_NONE, /* setting this means we don't care, and that we'd - like the library to choose the best possible - for us! */ - CURL_HTTP_VERSION_1_0, /* please use HTTP 1.0 in the request */ - CURL_HTTP_VERSION_1_1, /* please use HTTP 1.1 in the request */ - - CURL_HTTP_VERSION_LAST /* *ILLEGAL* http version */ -}; - -/* - * Public API enums for RTSP requests - */ -enum { - CURL_RTSPREQ_NONE, /* first in list */ - CURL_RTSPREQ_OPTIONS, - CURL_RTSPREQ_DESCRIBE, - CURL_RTSPREQ_ANNOUNCE, - CURL_RTSPREQ_SETUP, - CURL_RTSPREQ_PLAY, - CURL_RTSPREQ_PAUSE, - CURL_RTSPREQ_TEARDOWN, - CURL_RTSPREQ_GET_PARAMETER, - CURL_RTSPREQ_SET_PARAMETER, - CURL_RTSPREQ_RECORD, - CURL_RTSPREQ_RECEIVE, - CURL_RTSPREQ_LAST /* last in list */ -}; - - /* These enums are for use with the CURLOPT_NETRC option. */ -enum CURL_NETRC_OPTION { - CURL_NETRC_IGNORED, /* The .netrc will never be read. - * This is the default. */ - CURL_NETRC_OPTIONAL, /* A user:password in the URL will be preferred - * to one in the .netrc. */ - CURL_NETRC_REQUIRED, /* A user:password in the URL will be ignored. - * Unless one is set programmatically, the .netrc - * will be queried. */ - CURL_NETRC_LAST -}; - -enum { - CURL_SSLVERSION_DEFAULT, - CURL_SSLVERSION_TLSv1, - CURL_SSLVERSION_SSLv2, - CURL_SSLVERSION_SSLv3, - - CURL_SSLVERSION_LAST /* never use, keep last */ -}; - -/* symbols to use with CURLOPT_POSTREDIR. - CURL_REDIR_POST_301 and CURL_REDIR_POST_302 can be bitwise ORed so that - CURL_REDIR_POST_301 | CURL_REDIR_POST_302 == CURL_REDIR_POST_ALL */ - -#define CURL_REDIR_GET_ALL 0 -#define CURL_REDIR_POST_301 1 -#define CURL_REDIR_POST_302 2 -#define CURL_REDIR_POST_ALL (CURL_REDIR_POST_301|CURL_REDIR_POST_302) - -typedef enum { - CURL_TIMECOND_NONE, - - CURL_TIMECOND_IFMODSINCE, - CURL_TIMECOND_IFUNMODSINCE, - CURL_TIMECOND_LASTMOD, - - CURL_TIMECOND_LAST -} curl_TimeCond; - - -/* curl_strequal() and curl_strnequal() are subject for removal in a future - libcurl, see lib/README.curlx for details */ -CURL_EXTERN int (curl_strequal)(const char *s1, const char *s2); -CURL_EXTERN int (curl_strnequal)(const char *s1, const char *s2, size_t n); - -/* name is uppercase CURLFORM_<name> */ -#ifdef CFINIT -#undef CFINIT -#endif - -#ifdef CURL_ISOCPP -#define CFINIT(name) CURLFORM_ ## name -#else -/* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */ -#define CFINIT(name) CURLFORM_/**/name -#endif - -typedef enum { - CFINIT(NOTHING), /********* the first one is unused ************/ - - /* */ - CFINIT(COPYNAME), - CFINIT(PTRNAME), - CFINIT(NAMELENGTH), - CFINIT(COPYCONTENTS), - CFINIT(PTRCONTENTS), - CFINIT(CONTENTSLENGTH), - CFINIT(FILECONTENT), - CFINIT(ARRAY), - CFINIT(OBSOLETE), - CFINIT(FILE), - - CFINIT(BUFFER), - CFINIT(BUFFERPTR), - CFINIT(BUFFERLENGTH), - - CFINIT(CONTENTTYPE), - CFINIT(CONTENTHEADER), - CFINIT(FILENAME), - CFINIT(END), - CFINIT(OBSOLETE2), - - CFINIT(STREAM), - - CURLFORM_LASTENTRY /* the last unused */ -} CURLformoption; - -#undef CFINIT /* done */ - -/* structure to be used as parameter for CURLFORM_ARRAY */ -struct curl_forms { - CURLformoption option; - const char *value; -}; - -/* use this for multipart formpost building */ -/* Returns code for curl_formadd() - * - * Returns: - * CURL_FORMADD_OK on success - * CURL_FORMADD_MEMORY if the FormInfo allocation fails - * CURL_FORMADD_OPTION_TWICE if one option is given twice for one Form - * CURL_FORMADD_NULL if a null pointer was given for a char - * CURL_FORMADD_MEMORY if the allocation of a FormInfo struct failed - * CURL_FORMADD_UNKNOWN_OPTION if an unknown option was used - * CURL_FORMADD_INCOMPLETE if the some FormInfo is not complete (or error) - * CURL_FORMADD_MEMORY if a curl_httppost struct cannot be allocated - * CURL_FORMADD_MEMORY if some allocation for string copying failed. - * CURL_FORMADD_ILLEGAL_ARRAY if an illegal option is used in an array - * - ***************************************************************************/ -typedef enum { - CURL_FORMADD_OK, /* first, no error */ - - CURL_FORMADD_MEMORY, - CURL_FORMADD_OPTION_TWICE, - CURL_FORMADD_NULL, - CURL_FORMADD_UNKNOWN_OPTION, - CURL_FORMADD_INCOMPLETE, - CURL_FORMADD_ILLEGAL_ARRAY, - CURL_FORMADD_DISABLED, /* libcurl was built with this disabled */ - - CURL_FORMADD_LAST /* last */ -} CURLFORMcode; - -/* - * NAME curl_formadd() - * - * DESCRIPTION - * - * Pretty advanced function for building multi-part formposts. Each invoke - * adds one part that together construct a full post. Then use - * CURLOPT_HTTPPOST to send it off to libcurl. - */ -CURL_EXTERN CURLFORMcode curl_formadd(struct curl_httppost **httppost, - struct curl_httppost **last_post, - ...); - -/* - * callback function for curl_formget() - * The void *arg pointer will be the one passed as second argument to - * curl_formget(). - * The character buffer passed to it must not be freed. - * Should return the buffer length passed to it as the argument "len" on - * success. - */ -typedef size_t (*curl_formget_callback)(void *arg, const char *buf, size_t len); - -/* - * NAME curl_formget() - * - * DESCRIPTION - * - * Serialize a curl_httppost struct built with curl_formadd(). - * Accepts a void pointer as second argument which will be passed to - * the curl_formget_callback function. - * Returns 0 on success. - */ -CURL_EXTERN int curl_formget(struct curl_httppost *form, void *arg, - curl_formget_callback append); -/* - * NAME curl_formfree() - * - * DESCRIPTION - * - * Free a multipart formpost previously built with curl_formadd(). - */ -CURL_EXTERN void curl_formfree(struct curl_httppost *form); - -/* - * NAME curl_getenv() - * - * DESCRIPTION - * - * Returns a malloc()'ed string that MUST be curl_free()ed after usage is - * complete. DEPRECATED - see lib/README.curlx - */ -CURL_EXTERN char *curl_getenv(const char *variable); - -/* - * NAME curl_version() - * - * DESCRIPTION - * - * Returns a static ascii string of the libcurl version. - */ -CURL_EXTERN char *curl_version(void); - -/* - * NAME curl_easy_escape() - * - * DESCRIPTION - * - * Escapes URL strings (converts all letters consider illegal in URLs to their - * %XX versions). This function returns a new allocated string or NULL if an - * error occurred. - */ -CURL_EXTERN char *curl_easy_escape(CURL *handle, - const char *string, - int length); - -/* the previous version: */ -CURL_EXTERN char *curl_escape(const char *string, - int length); - - -/* - * NAME curl_easy_unescape() - * - * DESCRIPTION - * - * Unescapes URL encoding in strings (converts all %XX codes to their 8bit - * versions). This function returns a new allocated string or NULL if an error - * occurred. - * Conversion Note: On non-ASCII platforms the ASCII %XX codes are - * converted into the host encoding. - */ -CURL_EXTERN char *curl_easy_unescape(CURL *handle, - const char *string, - int length, - int *outlength); - -/* the previous version */ -CURL_EXTERN char *curl_unescape(const char *string, - int length); - -/* - * NAME curl_free() - * - * DESCRIPTION - * - * Provided for de-allocation in the same translation unit that did the - * allocation. Added in libcurl 7.10 - */ -CURL_EXTERN void curl_free(void *p); - -/* - * NAME curl_global_init() - * - * DESCRIPTION - * - * curl_global_init() should be invoked exactly once for each application that - * uses libcurl and before any call of other libcurl functions. - * - * This function is not thread-safe! - */ -CURL_EXTERN CURLcode curl_global_init(long flags); - -/* - * NAME curl_global_init_mem() - * - * DESCRIPTION - * - * curl_global_init() or curl_global_init_mem() should be invoked exactly once - * for each application that uses libcurl. This function can be used to - * initialize libcurl and set user defined memory management callback - * functions. Users can implement memory management routines to check for - * memory leaks, check for mis-use of the curl library etc. User registered - * callback routines with be invoked by this library instead of the system - * memory management routines like malloc, free etc. - */ -CURL_EXTERN CURLcode curl_global_init_mem(long flags, - curl_malloc_callback m, - curl_free_callback f, - curl_realloc_callback r, - curl_strdup_callback s, - curl_calloc_callback c); - -/* - * NAME curl_global_cleanup() - * - * DESCRIPTION - * - * curl_global_cleanup() should be invoked exactly once for each application - * that uses libcurl - */ -CURL_EXTERN void curl_global_cleanup(void); - -/* linked-list structure for the CURLOPT_QUOTE option (and other) */ -struct curl_slist { - char *data; - struct curl_slist *next; -}; - -/* - * NAME curl_slist_append() - * - * DESCRIPTION - * - * Appends a string to a linked list. If no list exists, it will be created - * first. Returns the new list, after appending. - */ -CURL_EXTERN struct curl_slist *curl_slist_append(struct curl_slist *, - const char *); - -/* - * NAME curl_slist_free_all() - * - * DESCRIPTION - * - * free a previously built curl_slist. - */ -CURL_EXTERN void curl_slist_free_all(struct curl_slist *); - -/* - * NAME curl_getdate() - * - * DESCRIPTION - * - * Returns the time, in seconds since 1 Jan 1970 of the time string given in - * the first argument. The time argument in the second parameter is unused - * and should be set to NULL. - */ -CURL_EXTERN time_t curl_getdate(const char *p, const time_t *unused); - -/* info about the certificate chain, only for OpenSSL builds. Asked - for with CURLOPT_CERTINFO / CURLINFO_CERTINFO */ -struct curl_certinfo { - int num_of_certs; /* number of certificates with information */ - struct curl_slist **certinfo; /* for each index in this array, there's a - linked list with textual information in the - format "name: value" */ -}; - -#define CURLINFO_STRING 0x100000 -#define CURLINFO_LONG 0x200000 -#define CURLINFO_DOUBLE 0x300000 -#define CURLINFO_SLIST 0x400000 -#define CURLINFO_MASK 0x0fffff -#define CURLINFO_TYPEMASK 0xf00000 - -typedef enum { - CURLINFO_NONE, /* first, never use this */ - CURLINFO_EFFECTIVE_URL = CURLINFO_STRING + 1, - CURLINFO_RESPONSE_CODE = CURLINFO_LONG + 2, - CURLINFO_TOTAL_TIME = CURLINFO_DOUBLE + 3, - CURLINFO_NAMELOOKUP_TIME = CURLINFO_DOUBLE + 4, - CURLINFO_CONNECT_TIME = CURLINFO_DOUBLE + 5, - CURLINFO_PRETRANSFER_TIME = CURLINFO_DOUBLE + 6, - CURLINFO_SIZE_UPLOAD = CURLINFO_DOUBLE + 7, - CURLINFO_SIZE_DOWNLOAD = CURLINFO_DOUBLE + 8, - CURLINFO_SPEED_DOWNLOAD = CURLINFO_DOUBLE + 9, - CURLINFO_SPEED_UPLOAD = CURLINFO_DOUBLE + 10, - CURLINFO_HEADER_SIZE = CURLINFO_LONG + 11, - CURLINFO_REQUEST_SIZE = CURLINFO_LONG + 12, - CURLINFO_SSL_VERIFYRESULT = CURLINFO_LONG + 13, - CURLINFO_FILETIME = CURLINFO_LONG + 14, - CURLINFO_CONTENT_LENGTH_DOWNLOAD = CURLINFO_DOUBLE + 15, - CURLINFO_CONTENT_LENGTH_UPLOAD = CURLINFO_DOUBLE + 16, - CURLINFO_STARTTRANSFER_TIME = CURLINFO_DOUBLE + 17, - CURLINFO_CONTENT_TYPE = CURLINFO_STRING + 18, - CURLINFO_REDIRECT_TIME = CURLINFO_DOUBLE + 19, - CURLINFO_REDIRECT_COUNT = CURLINFO_LONG + 20, - CURLINFO_PRIVATE = CURLINFO_STRING + 21, - CURLINFO_HTTP_CONNECTCODE = CURLINFO_LONG + 22, - CURLINFO_HTTPAUTH_AVAIL = CURLINFO_LONG + 23, - CURLINFO_PROXYAUTH_AVAIL = CURLINFO_LONG + 24, - CURLINFO_OS_ERRNO = CURLINFO_LONG + 25, - CURLINFO_NUM_CONNECTS = CURLINFO_LONG + 26, - CURLINFO_SSL_ENGINES = CURLINFO_SLIST + 27, - CURLINFO_COOKIELIST = CURLINFO_SLIST + 28, - CURLINFO_LASTSOCKET = CURLINFO_LONG + 29, - CURLINFO_FTP_ENTRY_PATH = CURLINFO_STRING + 30, - CURLINFO_REDIRECT_URL = CURLINFO_STRING + 31, - CURLINFO_PRIMARY_IP = CURLINFO_STRING + 32, - CURLINFO_APPCONNECT_TIME = CURLINFO_DOUBLE + 33, - CURLINFO_CERTINFO = CURLINFO_SLIST + 34, - CURLINFO_CONDITION_UNMET = CURLINFO_LONG + 35, - CURLINFO_RTSP_SESSION_ID = CURLINFO_STRING + 36, - CURLINFO_RTSP_CLIENT_CSEQ = CURLINFO_LONG + 37, - CURLINFO_RTSP_SERVER_CSEQ = CURLINFO_LONG + 38, - CURLINFO_RTSP_CSEQ_RECV = CURLINFO_LONG + 39, - CURLINFO_PRIMARY_PORT = CURLINFO_LONG + 40, - CURLINFO_LOCAL_IP = CURLINFO_STRING + 41, - CURLINFO_LOCAL_PORT = CURLINFO_LONG + 42, - /* Fill in new entries below here! */ - - CURLINFO_LASTONE = 42 -} CURLINFO; - -/* CURLINFO_RESPONSE_CODE is the new name for the option previously known as - CURLINFO_HTTP_CODE */ -#define CURLINFO_HTTP_CODE CURLINFO_RESPONSE_CODE - -typedef enum { - CURLCLOSEPOLICY_NONE, /* first, never use this */ - - CURLCLOSEPOLICY_OLDEST, - CURLCLOSEPOLICY_LEAST_RECENTLY_USED, - CURLCLOSEPOLICY_LEAST_TRAFFIC, - CURLCLOSEPOLICY_SLOWEST, - CURLCLOSEPOLICY_CALLBACK, - - CURLCLOSEPOLICY_LAST /* last, never use this */ -} curl_closepolicy; - -#define CURL_GLOBAL_SSL (1<<0) -#define CURL_GLOBAL_WIN32 (1<<1) -#define CURL_GLOBAL_ALL (CURL_GLOBAL_SSL|CURL_GLOBAL_WIN32) -#define CURL_GLOBAL_NOTHING 0 -#define CURL_GLOBAL_DEFAULT CURL_GLOBAL_ALL - - -/***************************************************************************** - * Setup defines, protos etc for the sharing stuff. - */ - -/* Different data locks for a single share */ -typedef enum { - CURL_LOCK_DATA_NONE = 0, - /* CURL_LOCK_DATA_SHARE is used internally to say that - * the locking is just made to change the internal state of the share - * itself. - */ - CURL_LOCK_DATA_SHARE, - CURL_LOCK_DATA_COOKIE, - CURL_LOCK_DATA_DNS, - CURL_LOCK_DATA_SSL_SESSION, - CURL_LOCK_DATA_CONNECT, - CURL_LOCK_DATA_LAST -} curl_lock_data; - -/* Different lock access types */ -typedef enum { - CURL_LOCK_ACCESS_NONE = 0, /* unspecified action */ - CURL_LOCK_ACCESS_SHARED = 1, /* for read perhaps */ - CURL_LOCK_ACCESS_SINGLE = 2, /* for write perhaps */ - CURL_LOCK_ACCESS_LAST /* never use */ -} curl_lock_access; - -typedef void (*curl_lock_function)(CURL *handle, - curl_lock_data data, - curl_lock_access locktype, - void *userptr); -typedef void (*curl_unlock_function)(CURL *handle, - curl_lock_data data, - void *userptr); - -typedef void CURLSH; - -typedef enum { - CURLSHE_OK, /* all is fine */ - CURLSHE_BAD_OPTION, /* 1 */ - CURLSHE_IN_USE, /* 2 */ - CURLSHE_INVALID, /* 3 */ - CURLSHE_NOMEM, /* out of memory */ - CURLSHE_LAST /* never use */ -} CURLSHcode; - -typedef enum { - CURLSHOPT_NONE, /* don't use */ - CURLSHOPT_SHARE, /* specify a data type to share */ - CURLSHOPT_UNSHARE, /* specify which data type to stop sharing */ - CURLSHOPT_LOCKFUNC, /* pass in a 'curl_lock_function' pointer */ - CURLSHOPT_UNLOCKFUNC, /* pass in a 'curl_unlock_function' pointer */ - CURLSHOPT_USERDATA, /* pass in a user data pointer used in the lock/unlock - callback functions */ - CURLSHOPT_LAST /* never use */ -} CURLSHoption; - -CURL_EXTERN CURLSH *curl_share_init(void); -CURL_EXTERN CURLSHcode curl_share_setopt(CURLSH *, CURLSHoption option, ...); -CURL_EXTERN CURLSHcode curl_share_cleanup(CURLSH *); - -/**************************************************************************** - * Structures for querying information about the curl library at runtime. - */ - -typedef enum { - CURLVERSION_FIRST, - CURLVERSION_SECOND, - CURLVERSION_THIRD, - CURLVERSION_FOURTH, - CURLVERSION_LAST /* never actually use this */ -} CURLversion; - -/* The 'CURLVERSION_NOW' is the symbolic name meant to be used by - basically all programs ever that want to get version information. It is - meant to be a built-in version number for what kind of struct the caller - expects. If the struct ever changes, we redefine the NOW to another enum - from above. */ -#define CURLVERSION_NOW CURLVERSION_FOURTH - -typedef struct { - CURLversion age; /* age of the returned struct */ - const char *version; /* LIBCURL_VERSION */ - unsigned int version_num; /* LIBCURL_VERSION_NUM */ - const char *host; /* OS/host/cpu/machine when configured */ - int features; /* bitmask, see defines below */ - const char *ssl_version; /* human readable string */ - long ssl_version_num; /* not used anymore, always 0 */ - const char *libz_version; /* human readable string */ - /* protocols is terminated by an entry with a NULL protoname */ - const char * const *protocols; - - /* The fields below this were added in CURLVERSION_SECOND */ - const char *ares; - int ares_num; - - /* This field was added in CURLVERSION_THIRD */ - const char *libidn; - - /* These field were added in CURLVERSION_FOURTH */ - - /* Same as '_libiconv_version' if built with HAVE_ICONV */ - int iconv_ver_num; - - const char *libssh_version; /* human readable string */ - -} curl_version_info_data; - -#define CURL_VERSION_IPV6 (1<<0) /* IPv6-enabled */ -#define CURL_VERSION_KERBEROS4 (1<<1) /* kerberos auth is supported */ -#define CURL_VERSION_SSL (1<<2) /* SSL options are present */ -#define CURL_VERSION_LIBZ (1<<3) /* libz features are present */ -#define CURL_VERSION_NTLM (1<<4) /* NTLM auth is supported */ -#define CURL_VERSION_GSSNEGOTIATE (1<<5) /* Negotiate auth support */ -#define CURL_VERSION_DEBUG (1<<6) /* built with debug capabilities */ -#define CURL_VERSION_ASYNCHDNS (1<<7) /* asynchronous dns resolves */ -#define CURL_VERSION_SPNEGO (1<<8) /* SPNEGO auth */ -#define CURL_VERSION_LARGEFILE (1<<9) /* supports files bigger than 2GB */ -#define CURL_VERSION_IDN (1<<10) /* International Domain Names support */ -#define CURL_VERSION_SSPI (1<<11) /* SSPI is supported */ -#define CURL_VERSION_CONV (1<<12) /* character conversions supported */ -#define CURL_VERSION_CURLDEBUG (1<<13) /* debug memory tracking supported */ - -/* - * NAME curl_version_info() - * - * DESCRIPTION - * - * This function returns a pointer to a static copy of the version info - * struct. See above. - */ -CURL_EXTERN curl_version_info_data *curl_version_info(CURLversion); - -/* - * NAME curl_easy_strerror() - * - * DESCRIPTION - * - * The curl_easy_strerror function may be used to turn a CURLcode value - * into the equivalent human readable error string. This is useful - * for printing meaningful error messages. - */ -CURL_EXTERN const char *curl_easy_strerror(CURLcode); - -/* - * NAME curl_share_strerror() - * - * DESCRIPTION - * - * The curl_share_strerror function may be used to turn a CURLSHcode value - * into the equivalent human readable error string. This is useful - * for printing meaningful error messages. - */ -CURL_EXTERN const char *curl_share_strerror(CURLSHcode); - -/* - * NAME curl_easy_pause() - * - * DESCRIPTION - * - * The curl_easy_pause function pauses or unpauses transfers. Select the new - * state by setting the bitmask, use the convenience defines below. - * - */ -CURL_EXTERN CURLcode curl_easy_pause(CURL *handle, int bitmask); - -#define CURLPAUSE_RECV (1<<0) -#define CURLPAUSE_RECV_CONT (0) - -#define CURLPAUSE_SEND (1<<2) -#define CURLPAUSE_SEND_CONT (0) - -#define CURLPAUSE_ALL (CURLPAUSE_RECV|CURLPAUSE_SEND) -#define CURLPAUSE_CONT (CURLPAUSE_RECV_CONT|CURLPAUSE_SEND_CONT) - -#ifdef __cplusplus -} -#endif - -/* unfortunately, the easy.h and multi.h include files need options and info - stuff before they can be included! */ -#include "easy.h" /* nothing in curl is fun without the easy stuff */ -#include "multi.h" - -/* the typechecker doesn't work in C++ (yet) */ -#if defined(__GNUC__) && defined(__GNUC_MINOR__) && \ - ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) && \ - !defined(__cplusplus) && !defined(CURL_DISABLE_TYPECHECK) -#include "typecheck-gcc.h" -#else -#if defined(__STDC__) && (__STDC__ >= 1) -/* This preprocessor magic that replaces a call with the exact same call is - only done to make sure application authors pass exactly three arguments - to these functions. */ -#define curl_easy_setopt(handle,opt,param) curl_easy_setopt(handle,opt,param) -#define curl_easy_getinfo(handle,info,arg) curl_easy_getinfo(handle,info,arg) -#define curl_share_setopt(share,opt,param) curl_share_setopt(share,opt,param) -#define curl_multi_setopt(handle,opt,param) curl_multi_setopt(handle,opt,param) -#endif /* __STDC__ >= 1 */ -#endif /* gcc >= 4.3 && !__cplusplus */ - -#endif /* __CURL_CURL_H */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/curl/curlbuild.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/curl/curlbuild.h deleted file mode 100644 index 81f4a28547..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/curl/curlbuild.h +++ /dev/null @@ -1,191 +0,0 @@ -/* include/curl/curlbuild.h. Generated from curlbuild.h.in by configure. */ -#ifndef __CURL_CURLBUILD_H -#define __CURL_CURLBUILD_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - ***************************************************************************/ - -/* ================================================================ */ -/* NOTES FOR CONFIGURE CAPABLE SYSTEMS */ -/* ================================================================ */ - -/* - * NOTE 1: - * ------- - * - * Nothing in this file is intended to be modified or adjusted by the - * curl library user nor by the curl library builder. - * - * If you think that something actually needs to be changed, adjusted - * or fixed in this file, then, report it on the libcurl development - * mailing list: http://cool.haxx.se/mailman/listinfo/curl-library/ - * - * This header file shall only export symbols which are 'curl' or 'CURL' - * prefixed, otherwise public name space would be polluted. - * - * NOTE 2: - * ------- - * - * Right now you might be staring at file include/curl/curlbuild.h.in or - * at file include/curl/curlbuild.h, this is due to the following reason: - * - * On systems capable of running the configure script, the configure process - * will overwrite the distributed include/curl/curlbuild.h file with one that - * is suitable and specific to the library being configured and built, which - * is generated from the include/curl/curlbuild.h.in template file. - * - */ - -/* ================================================================ */ -/* DEFINITION OF THESE SYMBOLS SHALL NOT TAKE PLACE ANYWHERE ELSE */ -/* ================================================================ */ - -#ifdef CURL_SIZEOF_LONG -# error "CURL_SIZEOF_LONG shall not be defined except in curlbuild.h" - Error Compilation_aborted_CURL_SIZEOF_LONG_already_defined -#endif - -#ifdef CURL_TYPEOF_CURL_SOCKLEN_T -# error "CURL_TYPEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h" - Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_already_defined -#endif - -#ifdef CURL_SIZEOF_CURL_SOCKLEN_T -# error "CURL_SIZEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h" - Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_already_defined -#endif - -#ifdef CURL_TYPEOF_CURL_OFF_T -# error "CURL_TYPEOF_CURL_OFF_T shall not be defined except in curlbuild.h" - Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_already_defined -#endif - -#ifdef CURL_FORMAT_CURL_OFF_T -# error "CURL_FORMAT_CURL_OFF_T shall not be defined except in curlbuild.h" - Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_already_defined -#endif - -#ifdef CURL_FORMAT_CURL_OFF_TU -# error "CURL_FORMAT_CURL_OFF_TU shall not be defined except in curlbuild.h" - Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_already_defined -#endif - -#ifdef CURL_FORMAT_OFF_T -# error "CURL_FORMAT_OFF_T shall not be defined except in curlbuild.h" - Error Compilation_aborted_CURL_FORMAT_OFF_T_already_defined -#endif - -#ifdef CURL_SIZEOF_CURL_OFF_T -# error "CURL_SIZEOF_CURL_OFF_T shall not be defined except in curlbuild.h" - Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_already_defined -#endif - -#ifdef CURL_SUFFIX_CURL_OFF_T -# error "CURL_SUFFIX_CURL_OFF_T shall not be defined except in curlbuild.h" - Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_already_defined -#endif - -#ifdef CURL_SUFFIX_CURL_OFF_TU -# error "CURL_SUFFIX_CURL_OFF_TU shall not be defined except in curlbuild.h" - Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_already_defined -#endif - -/* ================================================================ */ -/* EXTERNAL INTERFACE SETTINGS FOR CONFIGURE CAPABLE SYSTEMS ONLY */ -/* ================================================================ */ - -/* Configure process defines this to 1 when it finds out that system */ -/* header file ws2tcpip.h must be included by the external interface. */ -/* #undef CURL_PULL_WS2TCPIP_H */ -#ifdef CURL_PULL_WS2TCPIP_H -# ifndef WIN32_LEAN_AND_MEAN -# define WIN32_LEAN_AND_MEAN -# endif -# include <windows.h> -# include <winsock2.h> -# include <ws2tcpip.h> -#endif - -/* Configure process defines this to 1 when it finds out that system */ -/* header file sys/types.h must be included by the external interface. */ -#define CURL_PULL_SYS_TYPES_H 1 -#ifdef CURL_PULL_SYS_TYPES_H -# include <sys/types.h> -#endif - -/* Configure process defines this to 1 when it finds out that system */ -/* header file stdint.h must be included by the external interface. */ -#define CURL_PULL_STDINT_H 1 -#ifdef CURL_PULL_STDINT_H -# include <stdint.h> -#endif - -/* Configure process defines this to 1 when it finds out that system */ -/* header file inttypes.h must be included by the external interface. */ -#define CURL_PULL_INTTYPES_H 1 -#ifdef CURL_PULL_INTTYPES_H -# include <inttypes.h> -#endif - -/* Configure process defines this to 1 when it finds out that system */ -/* header file sys/socket.h must be included by the external interface. */ -#define CURL_PULL_SYS_SOCKET_H 1 -#ifdef CURL_PULL_SYS_SOCKET_H -# include <sys/socket.h> -#endif - -/* The size of `long', as computed by sizeof. */ -#define CURL_SIZEOF_LONG 4 - -/* Integral data type used for curl_socklen_t. */ -#define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t - -/* The size of `curl_socklen_t', as computed by sizeof. */ -#define CURL_SIZEOF_CURL_SOCKLEN_T 4 - -/* Data type definition of curl_socklen_t. */ -typedef CURL_TYPEOF_CURL_SOCKLEN_T curl_socklen_t; - -/* Signed integral data type used for curl_off_t. */ -#define CURL_TYPEOF_CURL_OFF_T int64_t - -/* Data type definition of curl_off_t. */ -typedef CURL_TYPEOF_CURL_OFF_T curl_off_t; - -/* curl_off_t formatting string directive without "%" conversion specifier. */ -#define CURL_FORMAT_CURL_OFF_T "lld" - -/* unsigned curl_off_t formatting string without "%" conversion specifier. */ -#define CURL_FORMAT_CURL_OFF_TU "llu" - -/* curl_off_t formatting string directive with "%" conversion specifier. */ -#define CURL_FORMAT_OFF_T "%lld" - -/* The size of `curl_off_t', as computed by sizeof. */ -#define CURL_SIZEOF_CURL_OFF_T 8 - -/* curl_off_t constant suffix. */ -#define CURL_SUFFIX_CURL_OFF_T LL - -/* unsigned curl_off_t constant suffix. */ -#define CURL_SUFFIX_CURL_OFF_TU ULL - -#endif /* __CURL_CURLBUILD_H */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/curl/curlrules.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/curl/curlrules.h deleted file mode 100644 index 8aad1df678..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/curl/curlrules.h +++ /dev/null @@ -1,252 +0,0 @@ -#ifndef __CURL_CURLRULES_H -#define __CURL_CURLRULES_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - ***************************************************************************/ - -/* ================================================================ */ -/* COMPILE TIME SANITY CHECKS */ -/* ================================================================ */ - -/* - * NOTE 1: - * ------- - * - * All checks done in this file are intentionally placed in a public - * header file which is pulled by curl/curl.h when an application is - * being built using an already built libcurl library. Additionally - * this file is also included and used when building the library. - * - * If compilation fails on this file it is certainly sure that the - * problem is elsewhere. It could be a problem in the curlbuild.h - * header file, or simply that you are using different compilation - * settings than those used to build the library. - * - * Nothing in this file is intended to be modified or adjusted by the - * curl library user nor by the curl library builder. - * - * Do not deactivate any check, these are done to make sure that the - * library is properly built and used. - * - * You can find further help on the libcurl development mailing list: - * http://cool.haxx.se/mailman/listinfo/curl-library/ - * - * NOTE 2 - * ------ - * - * Some of the following compile time checks are based on the fact - * that the dimension of a constant array can not be a negative one. - * In this way if the compile time verification fails, the compilation - * will fail issuing an error. The error description wording is compiler - * dependent but it will be quite similar to one of the following: - * - * "negative subscript or subscript is too large" - * "array must have at least one element" - * "-1 is an illegal array size" - * "size of array is negative" - * - * If you are building an application which tries to use an already - * built libcurl library and you are getting this kind of errors on - * this file, it is a clear indication that there is a mismatch between - * how the library was built and how you are trying to use it for your - * application. Your already compiled or binary library provider is the - * only one who can give you the details you need to properly use it. - */ - -/* - * Verify that some macros are actually defined. - */ - -#ifndef CURL_SIZEOF_LONG -# error "CURL_SIZEOF_LONG definition is missing!" - Error Compilation_aborted_CURL_SIZEOF_LONG_is_missing -#endif - -#ifndef CURL_TYPEOF_CURL_SOCKLEN_T -# error "CURL_TYPEOF_CURL_SOCKLEN_T definition is missing!" - Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_is_missing -#endif - -#ifndef CURL_SIZEOF_CURL_SOCKLEN_T -# error "CURL_SIZEOF_CURL_SOCKLEN_T definition is missing!" - Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_is_missing -#endif - -#ifndef CURL_TYPEOF_CURL_OFF_T -# error "CURL_TYPEOF_CURL_OFF_T definition is missing!" - Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_is_missing -#endif - -#ifndef CURL_FORMAT_CURL_OFF_T -# error "CURL_FORMAT_CURL_OFF_T definition is missing!" - Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_is_missing -#endif - -#ifndef CURL_FORMAT_CURL_OFF_TU -# error "CURL_FORMAT_CURL_OFF_TU definition is missing!" - Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_is_missing -#endif - -#ifndef CURL_FORMAT_OFF_T -# error "CURL_FORMAT_OFF_T definition is missing!" - Error Compilation_aborted_CURL_FORMAT_OFF_T_is_missing -#endif - -#ifndef CURL_SIZEOF_CURL_OFF_T -# error "CURL_SIZEOF_CURL_OFF_T definition is missing!" - Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_is_missing -#endif - -#ifndef CURL_SUFFIX_CURL_OFF_T -# error "CURL_SUFFIX_CURL_OFF_T definition is missing!" - Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_is_missing -#endif - -#ifndef CURL_SUFFIX_CURL_OFF_TU -# error "CURL_SUFFIX_CURL_OFF_TU definition is missing!" - Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_is_missing -#endif - -/* - * Macros private to this header file. - */ - -#define CurlchkszEQ(t, s) sizeof(t) == s ? 1 : -1 - -#define CurlchkszGE(t1, t2) sizeof(t1) >= sizeof(t2) ? 1 : -1 - -/* - * Verify that the size previously defined and expected for long - * is the same as the one reported by sizeof() at compile time. - */ - -typedef char - __curl_rule_01__ - [CurlchkszEQ(long, CURL_SIZEOF_LONG)]; - -/* - * Verify that the size previously defined and expected for - * curl_off_t is actually the the same as the one reported - * by sizeof() at compile time. - */ - -typedef char - __curl_rule_02__ - [CurlchkszEQ(curl_off_t, CURL_SIZEOF_CURL_OFF_T)]; - -/* - * Verify at compile time that the size of curl_off_t as reported - * by sizeof() is greater or equal than the one reported for long - * for the current compilation. - */ - -typedef char - __curl_rule_03__ - [CurlchkszGE(curl_off_t, long)]; - -/* - * Verify that the size previously defined and expected for - * curl_socklen_t is actually the the same as the one reported - * by sizeof() at compile time. - */ - -typedef char - __curl_rule_04__ - [CurlchkszEQ(curl_socklen_t, CURL_SIZEOF_CURL_SOCKLEN_T)]; - -/* - * Verify at compile time that the size of curl_socklen_t as reported - * by sizeof() is greater or equal than the one reported for int for - * the current compilation. - */ - -typedef char - __curl_rule_05__ - [CurlchkszGE(curl_socklen_t, int)]; - -/* ================================================================ */ -/* EXTERNALLY AND INTERNALLY VISIBLE DEFINITIONS */ -/* ================================================================ */ - -/* - * CURL_ISOCPP and CURL_OFF_T_C definitions are done here in order to allow - * these to be visible and exported by the external libcurl interface API, - * while also making them visible to the library internals, simply including - * setup.h, without actually needing to include curl.h internally. - * If some day this section would grow big enough, all this should be moved - * to its own header file. - */ - -/* - * Figure out if we can use the ## preprocessor operator, which is supported - * by ISO/ANSI C and C++. Some compilers support it without setting __STDC__ - * or __cplusplus so we need to carefully check for them too. - */ - -#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) || \ - defined(__HP_aCC) || defined(__BORLANDC__) || defined(__LCC__) || \ - defined(__POCC__) || defined(__SALFORDC__) || defined(__HIGHC__) || \ - defined(__ILEC400__) - /* This compiler is believed to have an ISO compatible preprocessor */ -#define CURL_ISOCPP -#else - /* This compiler is believed NOT to have an ISO compatible preprocessor */ -#undef CURL_ISOCPP -#endif - -/* - * Macros for minimum-width signed and unsigned curl_off_t integer constants. - */ - -#ifdef CURL_ISOCPP -# define __CURL_OFF_T_C_HELPER2(Val,Suffix) Val ## Suffix -#else -# define __CURL_OFF_T_C_HELPER2(Val,Suffix) Val/**/Suffix -#endif -#define __CURL_OFF_T_C_HELPER1(Val,Suffix) __CURL_OFF_T_C_HELPER2(Val,Suffix) -#define CURL_OFF_T_C(Val) __CURL_OFF_T_C_HELPER1(Val,CURL_SUFFIX_CURL_OFF_T) -#define CURL_OFF_TU_C(Val) __CURL_OFF_T_C_HELPER1(Val,CURL_SUFFIX_CURL_OFF_TU) - -/* - * Get rid of macros private to this header file. - */ - -#undef CurlchkszEQ -#undef CurlchkszGE - -/* - * Get rid of macros not intended to exist beyond this point. - */ - -#undef CURL_PULL_WS2TCPIP_H -#undef CURL_PULL_SYS_TYPES_H -#undef CURL_PULL_SYS_SOCKET_H -#undef CURL_PULL_STDINT_H -#undef CURL_PULL_INTTYPES_H - -#undef CURL_TYPEOF_CURL_SOCKLEN_T -#undef CURL_TYPEOF_CURL_OFF_T - -#ifdef CURL_NO_OLDIES -#undef CURL_FORMAT_OFF_T /* not required since 7.19.0 - obsoleted in 7.20.0 */ -#endif - -#endif /* __CURL_CURLRULES_H */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/curl/curlver.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/curl/curlver.h deleted file mode 100644 index 7c3ccc905c..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/curl/curlver.h +++ /dev/null @@ -1,69 +0,0 @@ -#ifndef __CURL_CURLVER_H -#define __CURL_CURLVER_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - ***************************************************************************/ - -/* This header file contains nothing but libcurl version info, generated by - a script at release-time. This was made its own header file in 7.11.2 */ - -/* This is the global package copyright */ -#define LIBCURL_COPYRIGHT "1996 - 2010 Daniel Stenberg, <daniel@haxx.se>." - -/* This is the version number of the libcurl package from which this header - file origins: */ -#define LIBCURL_VERSION "7.21.3" - -/* The numeric version number is also available "in parts" by using these - defines: */ -#define LIBCURL_VERSION_MAJOR 7 -#define LIBCURL_VERSION_MINOR 21 -#define LIBCURL_VERSION_PATCH 3 - -/* This is the numeric version of the libcurl version number, meant for easier - parsing and comparions by programs. The LIBCURL_VERSION_NUM define will - always follow this syntax: - - 0xXXYYZZ - - Where XX, YY and ZZ are the main version, release and patch numbers in - hexadecimal (using 8 bits each). All three numbers are always represented - using two digits. 1.2 would appear as "0x010200" while version 9.11.7 - appears as "0x090b07". - - This 6-digit (24 bits) hexadecimal number does not show pre-release number, - and it is always a greater number in a more recent release. It makes - comparisons with greater than and less than work. -*/ -#define LIBCURL_VERSION_NUM 0x071503 - -/* - * This is the date and time when the full source package was created. The - * timestamp is not stored in git, as the timestamp is properly set in the - * tarballs by the maketgz script. - * - * The format of the date should follow this template: - * - * "Mon Feb 12 11:35:33 UTC 2007" - */ -#define LIBCURL_TIMESTAMP "Wed Dec 15 14:07:08 UTC 2010" - -#endif /* __CURL_CURLVER_H */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/curl/easy.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/curl/easy.h deleted file mode 100644 index 1ddb4fe5a2..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/curl/easy.h +++ /dev/null @@ -1,102 +0,0 @@ -#ifndef __CURL_EASY_H -#define __CURL_EASY_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - ***************************************************************************/ -#ifdef __cplusplus -extern "C" { -#endif - -CURL_EXTERN CURL *curl_easy_init(void); -CURL_EXTERN CURLcode curl_easy_setopt(CURL *curl, CURLoption option, ...); -CURL_EXTERN CURLcode curl_easy_perform(CURL *curl); -CURL_EXTERN void curl_easy_cleanup(CURL *curl); - -/* - * NAME curl_easy_getinfo() - * - * DESCRIPTION - * - * Request internal information from the curl session with this function. The - * third argument MUST be a pointer to a long, a pointer to a char * or a - * pointer to a double (as the documentation describes elsewhere). The data - * pointed to will be filled in accordingly and can be relied upon only if the - * function returns CURLE_OK. This function is intended to get used *AFTER* a - * performed transfer, all results from this function are undefined until the - * transfer is completed. - */ -CURL_EXTERN CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...); - - -/* - * NAME curl_easy_duphandle() - * - * DESCRIPTION - * - * Creates a new curl session handle with the same options set for the handle - * passed in. Duplicating a handle could only be a matter of cloning data and - * options, internal state info and things like persistant connections cannot - * be transfered. It is useful in multithreaded applications when you can run - * curl_easy_duphandle() for each new thread to avoid a series of identical - * curl_easy_setopt() invokes in every thread. - */ -CURL_EXTERN CURL* curl_easy_duphandle(CURL *curl); - -/* - * NAME curl_easy_reset() - * - * DESCRIPTION - * - * Re-initializes a CURL handle to the default values. This puts back the - * handle to the same state as it was in when it was just created. - * - * It does keep: live connections, the Session ID cache, the DNS cache and the - * cookies. - */ -CURL_EXTERN void curl_easy_reset(CURL *curl); - -/* - * NAME curl_easy_recv() - * - * DESCRIPTION - * - * Receives data from the connected socket. Use after successful - * curl_easy_perform() with CURLOPT_CONNECT_ONLY option. - */ -CURL_EXTERN CURLcode curl_easy_recv(CURL *curl, void *buffer, size_t buflen, - size_t *n); - -/* - * NAME curl_easy_send() - * - * DESCRIPTION - * - * Sends data over the connected socket. Use after successful - * curl_easy_perform() with CURLOPT_CONNECT_ONLY option. - */ -CURL_EXTERN CURLcode curl_easy_send(CURL *curl, const void *buffer, - size_t buflen, size_t *n); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/curl/mprintf.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/curl/mprintf.h deleted file mode 100644 index de7dd2f3c3..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/curl/mprintf.h +++ /dev/null @@ -1,81 +0,0 @@ -#ifndef __CURL_MPRINTF_H -#define __CURL_MPRINTF_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, <daniel@haxx.se>, et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - ***************************************************************************/ - -#include <stdarg.h> -#include <stdio.h> /* needed for FILE */ - -#include "curl.h" - -#ifdef __cplusplus -extern "C" { -#endif - -CURL_EXTERN int curl_mprintf(const char *format, ...); -CURL_EXTERN int curl_mfprintf(FILE *fd, const char *format, ...); -CURL_EXTERN int curl_msprintf(char *buffer, const char *format, ...); -CURL_EXTERN int curl_msnprintf(char *buffer, size_t maxlength, - const char *format, ...); -CURL_EXTERN int curl_mvprintf(const char *format, va_list args); -CURL_EXTERN int curl_mvfprintf(FILE *fd, const char *format, va_list args); -CURL_EXTERN int curl_mvsprintf(char *buffer, const char *format, va_list args); -CURL_EXTERN int curl_mvsnprintf(char *buffer, size_t maxlength, - const char *format, va_list args); -CURL_EXTERN char *curl_maprintf(const char *format, ...); -CURL_EXTERN char *curl_mvaprintf(const char *format, va_list args); - -#ifdef _MPRINTF_REPLACE -# undef printf -# undef fprintf -# undef sprintf -# undef vsprintf -# undef snprintf -# undef vprintf -# undef vfprintf -# undef vsnprintf -# undef aprintf -# undef vaprintf -# define printf curl_mprintf -# define fprintf curl_mfprintf -#ifdef CURLDEBUG -/* When built with CURLDEBUG we define away the sprintf() functions since we - don't want internal code to be using them */ -# define sprintf sprintf_was_used -# define vsprintf vsprintf_was_used -#else -# define sprintf curl_msprintf -# define vsprintf curl_mvsprintf -#endif -# define snprintf curl_msnprintf -# define vprintf curl_mvprintf -# define vfprintf curl_mvfprintf -# define vsnprintf curl_mvsnprintf -# define aprintf curl_maprintf -# define vaprintf curl_mvaprintf -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* __CURL_MPRINTF_H */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/curl/stdcheaders.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/curl/stdcheaders.h deleted file mode 100644 index ad82ef6335..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/curl/stdcheaders.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef __STDC_HEADERS_H -#define __STDC_HEADERS_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - ***************************************************************************/ - -#include <sys/types.h> - -size_t fread (void *, size_t, size_t, FILE *); -size_t fwrite (const void *, size_t, size_t, FILE *); - -int strcasecmp(const char *, const char *); -int strncasecmp(const char *, const char *, size_t); - -#endif /* __STDC_HEADERS_H */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/curl/typecheck-gcc.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/curl/typecheck-gcc.h deleted file mode 100644 index e6f74a9584..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/curl/typecheck-gcc.h +++ /dev/null @@ -1,584 +0,0 @@ -#ifndef __CURL_TYPECHECK_GCC_H -#define __CURL_TYPECHECK_GCC_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - ***************************************************************************/ - -/* wraps curl_easy_setopt() with typechecking */ - -/* To add a new kind of warning, add an - * if(_curl_is_sometype_option(_curl_opt)) - * if(!_curl_is_sometype(value)) - * _curl_easy_setopt_err_sometype(); - * block and define _curl_is_sometype_option, _curl_is_sometype and - * _curl_easy_setopt_err_sometype below - * - * NOTE: We use two nested 'if' statements here instead of the && operator, in - * order to work around gcc bug #32061. It affects only gcc 4.3.x/4.4.x - * when compiling with -Wlogical-op. - * - * To add an option that uses the same type as an existing option, you'll just - * need to extend the appropriate _curl_*_option macro - */ -#define curl_easy_setopt(handle, option, value) \ -__extension__ ({ \ - __typeof__ (option) _curl_opt = option; \ - if (__builtin_constant_p(_curl_opt)) { \ - if (_curl_is_long_option(_curl_opt)) \ - if (!_curl_is_long(value)) \ - _curl_easy_setopt_err_long(); \ - if (_curl_is_off_t_option(_curl_opt)) \ - if (!_curl_is_off_t(value)) \ - _curl_easy_setopt_err_curl_off_t(); \ - if (_curl_is_string_option(_curl_opt)) \ - if (!_curl_is_string(value)) \ - _curl_easy_setopt_err_string(); \ - if (_curl_is_write_cb_option(_curl_opt)) \ - if (!_curl_is_write_cb(value)) \ - _curl_easy_setopt_err_write_callback(); \ - if ((_curl_opt) == CURLOPT_READFUNCTION) \ - if (!_curl_is_read_cb(value)) \ - _curl_easy_setopt_err_read_cb(); \ - if ((_curl_opt) == CURLOPT_IOCTLFUNCTION) \ - if (!_curl_is_ioctl_cb(value)) \ - _curl_easy_setopt_err_ioctl_cb(); \ - if ((_curl_opt) == CURLOPT_SOCKOPTFUNCTION) \ - if (!_curl_is_sockopt_cb(value)) \ - _curl_easy_setopt_err_sockopt_cb(); \ - if ((_curl_opt) == CURLOPT_OPENSOCKETFUNCTION) \ - if (!_curl_is_opensocket_cb(value)) \ - _curl_easy_setopt_err_opensocket_cb(); \ - if ((_curl_opt) == CURLOPT_PROGRESSFUNCTION) \ - if (!_curl_is_progress_cb(value)) \ - _curl_easy_setopt_err_progress_cb(); \ - if ((_curl_opt) == CURLOPT_DEBUGFUNCTION) \ - if (!_curl_is_debug_cb(value)) \ - _curl_easy_setopt_err_debug_cb(); \ - if ((_curl_opt) == CURLOPT_SSL_CTX_FUNCTION) \ - if (!_curl_is_ssl_ctx_cb(value)) \ - _curl_easy_setopt_err_ssl_ctx_cb(); \ - if (_curl_is_conv_cb_option(_curl_opt)) \ - if (!_curl_is_conv_cb(value)) \ - _curl_easy_setopt_err_conv_cb(); \ - if ((_curl_opt) == CURLOPT_SEEKFUNCTION) \ - if (!_curl_is_seek_cb(value)) \ - _curl_easy_setopt_err_seek_cb(); \ - if (_curl_is_cb_data_option(_curl_opt)) \ - if (!_curl_is_cb_data(value)) \ - _curl_easy_setopt_err_cb_data(); \ - if ((_curl_opt) == CURLOPT_ERRORBUFFER) \ - if (!_curl_is_error_buffer(value)) \ - _curl_easy_setopt_err_error_buffer(); \ - if ((_curl_opt) == CURLOPT_STDERR) \ - if (!_curl_is_FILE(value)) \ - _curl_easy_setopt_err_FILE(); \ - if (_curl_is_postfields_option(_curl_opt)) \ - if (!_curl_is_postfields(value)) \ - _curl_easy_setopt_err_postfields(); \ - if ((_curl_opt) == CURLOPT_HTTPPOST) \ - if (!_curl_is_arr((value), struct curl_httppost)) \ - _curl_easy_setopt_err_curl_httpost(); \ - if (_curl_is_slist_option(_curl_opt)) \ - if (!_curl_is_arr((value), struct curl_slist)) \ - _curl_easy_setopt_err_curl_slist(); \ - if ((_curl_opt) == CURLOPT_SHARE) \ - if (!_curl_is_ptr((value), CURLSH)) \ - _curl_easy_setopt_err_CURLSH(); \ - } \ - curl_easy_setopt(handle, _curl_opt, value); \ -}) - -/* wraps curl_easy_getinfo() with typechecking */ -/* FIXME: don't allow const pointers */ -#define curl_easy_getinfo(handle, info, arg) \ -__extension__ ({ \ - __typeof__ (info) _curl_info = info; \ - if (__builtin_constant_p(_curl_info)) { \ - if (_curl_is_string_info(_curl_info)) \ - if (!_curl_is_arr((arg), char *)) \ - _curl_easy_getinfo_err_string(); \ - if (_curl_is_long_info(_curl_info)) \ - if (!_curl_is_arr((arg), long)) \ - _curl_easy_getinfo_err_long(); \ - if (_curl_is_double_info(_curl_info)) \ - if (!_curl_is_arr((arg), double)) \ - _curl_easy_getinfo_err_double(); \ - if (_curl_is_slist_info(_curl_info)) \ - if (!_curl_is_arr((arg), struct curl_slist *)) \ - _curl_easy_getinfo_err_curl_slist(); \ - } \ - curl_easy_getinfo(handle, _curl_info, arg); \ -}) - -/* TODO: typechecking for curl_share_setopt() and curl_multi_setopt(), - * for now just make sure that the functions are called with three - * arguments - */ -#define curl_share_setopt(share,opt,param) curl_share_setopt(share,opt,param) -#define curl_multi_setopt(handle,opt,param) curl_multi_setopt(handle,opt,param) - - -/* the actual warnings, triggered by calling the _curl_easy_setopt_err* - * functions */ - -/* To define a new warning, use _CURL_WARNING(identifier, "message") */ -#define _CURL_WARNING(id, message) \ - static void __attribute__((warning(message))) __attribute__((unused)) \ - __attribute__((noinline)) id(void) { __asm__(""); } - -_CURL_WARNING(_curl_easy_setopt_err_long, - "curl_easy_setopt expects a long argument for this option") -_CURL_WARNING(_curl_easy_setopt_err_curl_off_t, - "curl_easy_setopt expects a curl_off_t argument for this option") -_CURL_WARNING(_curl_easy_setopt_err_string, - "curl_easy_setopt expects a string (char* or char[]) argument for this option" - ) -_CURL_WARNING(_curl_easy_setopt_err_write_callback, - "curl_easy_setopt expects a curl_write_callback argument for this option") -_CURL_WARNING(_curl_easy_setopt_err_read_cb, - "curl_easy_setopt expects a curl_read_callback argument for this option") -_CURL_WARNING(_curl_easy_setopt_err_ioctl_cb, - "curl_easy_setopt expects a curl_ioctl_callback argument for this option") -_CURL_WARNING(_curl_easy_setopt_err_sockopt_cb, - "curl_easy_setopt expects a curl_sockopt_callback argument for this option") -_CURL_WARNING(_curl_easy_setopt_err_opensocket_cb, - "curl_easy_setopt expects a curl_opensocket_callback argument for this option" - ) -_CURL_WARNING(_curl_easy_setopt_err_progress_cb, - "curl_easy_setopt expects a curl_progress_callback argument for this option") -_CURL_WARNING(_curl_easy_setopt_err_debug_cb, - "curl_easy_setopt expects a curl_debug_callback argument for this option") -_CURL_WARNING(_curl_easy_setopt_err_ssl_ctx_cb, - "curl_easy_setopt expects a curl_ssl_ctx_callback argument for this option") -_CURL_WARNING(_curl_easy_setopt_err_conv_cb, - "curl_easy_setopt expects a curl_conv_callback argument for this option") -_CURL_WARNING(_curl_easy_setopt_err_seek_cb, - "curl_easy_setopt expects a curl_seek_callback argument for this option") -_CURL_WARNING(_curl_easy_setopt_err_cb_data, - "curl_easy_setopt expects a private data pointer as argument for this option") -_CURL_WARNING(_curl_easy_setopt_err_error_buffer, - "curl_easy_setopt expects a char buffer of CURL_ERROR_SIZE as argument for this option") -_CURL_WARNING(_curl_easy_setopt_err_FILE, - "curl_easy_setopt expects a FILE* argument for this option") -_CURL_WARNING(_curl_easy_setopt_err_postfields, - "curl_easy_setopt expects a void* or char* argument for this option") -_CURL_WARNING(_curl_easy_setopt_err_curl_httpost, - "curl_easy_setopt expects a struct curl_httppost* argument for this option") -_CURL_WARNING(_curl_easy_setopt_err_curl_slist, - "curl_easy_setopt expects a struct curl_slist* argument for this option") -_CURL_WARNING(_curl_easy_setopt_err_CURLSH, - "curl_easy_setopt expects a CURLSH* argument for this option") - -_CURL_WARNING(_curl_easy_getinfo_err_string, - "curl_easy_getinfo expects a pointer to char * for this info") -_CURL_WARNING(_curl_easy_getinfo_err_long, - "curl_easy_getinfo expects a pointer to long for this info") -_CURL_WARNING(_curl_easy_getinfo_err_double, - "curl_easy_getinfo expects a pointer to double for this info") -_CURL_WARNING(_curl_easy_getinfo_err_curl_slist, - "curl_easy_getinfo expects a pointer to struct curl_slist * for this info") - -/* groups of curl_easy_setops options that take the same type of argument */ - -/* To add a new option to one of the groups, just add - * (option) == CURLOPT_SOMETHING - * to the or-expression. If the option takes a long or curl_off_t, you don't - * have to do anything - */ - -/* evaluates to true if option takes a long argument */ -#define _curl_is_long_option(option) \ - (0 < (option) && (option) < CURLOPTTYPE_OBJECTPOINT) - -#define _curl_is_off_t_option(option) \ - ((option) > CURLOPTTYPE_OFF_T) - -/* evaluates to true if option takes a char* argument */ -#define _curl_is_string_option(option) \ - ((option) == CURLOPT_URL || \ - (option) == CURLOPT_PROXY || \ - (option) == CURLOPT_INTERFACE || \ - (option) == CURLOPT_NETRC_FILE || \ - (option) == CURLOPT_USERPWD || \ - (option) == CURLOPT_USERNAME || \ - (option) == CURLOPT_PASSWORD || \ - (option) == CURLOPT_PROXYUSERPWD || \ - (option) == CURLOPT_PROXYUSERNAME || \ - (option) == CURLOPT_PROXYPASSWORD || \ - (option) == CURLOPT_NOPROXY || \ - (option) == CURLOPT_ENCODING || \ - (option) == CURLOPT_REFERER || \ - (option) == CURLOPT_USERAGENT || \ - (option) == CURLOPT_COOKIE || \ - (option) == CURLOPT_COOKIEFILE || \ - (option) == CURLOPT_COOKIEJAR || \ - (option) == CURLOPT_COOKIELIST || \ - (option) == CURLOPT_FTPPORT || \ - (option) == CURLOPT_FTP_ALTERNATIVE_TO_USER || \ - (option) == CURLOPT_FTP_ACCOUNT || \ - (option) == CURLOPT_RANGE || \ - (option) == CURLOPT_CUSTOMREQUEST || \ - (option) == CURLOPT_SSLCERT || \ - (option) == CURLOPT_SSLCERTTYPE || \ - (option) == CURLOPT_SSLKEY || \ - (option) == CURLOPT_SSLKEYTYPE || \ - (option) == CURLOPT_KEYPASSWD || \ - (option) == CURLOPT_SSLENGINE || \ - (option) == CURLOPT_CAINFO || \ - (option) == CURLOPT_CAPATH || \ - (option) == CURLOPT_RANDOM_FILE || \ - (option) == CURLOPT_EGDSOCKET || \ - (option) == CURLOPT_SSL_CIPHER_LIST || \ - (option) == CURLOPT_KRBLEVEL || \ - (option) == CURLOPT_SSH_HOST_PUBLIC_KEY_MD5 || \ - (option) == CURLOPT_SSH_PUBLIC_KEYFILE || \ - (option) == CURLOPT_SSH_PRIVATE_KEYFILE || \ - (option) == CURLOPT_CRLFILE || \ - (option) == CURLOPT_ISSUERCERT || \ - (option) == CURLOPT_SOCKS5_GSSAPI_SERVICE || \ - (option) == CURLOPT_SSH_KNOWNHOSTS || \ - (option) == CURLOPT_MAIL_FROM || \ - (option) == CURLOPT_RTSP_SESSION_ID || \ - (option) == CURLOPT_RTSP_STREAM_URI || \ - (option) == CURLOPT_RTSP_TRANSPORT || \ - 0) - -/* evaluates to true if option takes a curl_write_callback argument */ -#define _curl_is_write_cb_option(option) \ - ((option) == CURLOPT_HEADERFUNCTION || \ - (option) == CURLOPT_WRITEFUNCTION) - -/* evaluates to true if option takes a curl_conv_callback argument */ -#define _curl_is_conv_cb_option(option) \ - ((option) == CURLOPT_CONV_TO_NETWORK_FUNCTION || \ - (option) == CURLOPT_CONV_FROM_NETWORK_FUNCTION || \ - (option) == CURLOPT_CONV_FROM_UTF8_FUNCTION) - -/* evaluates to true if option takes a data argument to pass to a callback */ -#define _curl_is_cb_data_option(option) \ - ((option) == CURLOPT_WRITEDATA || \ - (option) == CURLOPT_READDATA || \ - (option) == CURLOPT_IOCTLDATA || \ - (option) == CURLOPT_SOCKOPTDATA || \ - (option) == CURLOPT_OPENSOCKETDATA || \ - (option) == CURLOPT_PROGRESSDATA || \ - (option) == CURLOPT_WRITEHEADER || \ - (option) == CURLOPT_DEBUGDATA || \ - (option) == CURLOPT_SSL_CTX_DATA || \ - (option) == CURLOPT_SEEKDATA || \ - (option) == CURLOPT_PRIVATE || \ - (option) == CURLOPT_SSH_KEYDATA || \ - (option) == CURLOPT_INTERLEAVEDATA || \ - (option) == CURLOPT_CHUNK_DATA || \ - (option) == CURLOPT_FNMATCH_DATA || \ - 0) - -/* evaluates to true if option takes a POST data argument (void* or char*) */ -#define _curl_is_postfields_option(option) \ - ((option) == CURLOPT_POSTFIELDS || \ - (option) == CURLOPT_COPYPOSTFIELDS || \ - 0) - -/* evaluates to true if option takes a struct curl_slist * argument */ -#define _curl_is_slist_option(option) \ - ((option) == CURLOPT_HTTPHEADER || \ - (option) == CURLOPT_HTTP200ALIASES || \ - (option) == CURLOPT_QUOTE || \ - (option) == CURLOPT_POSTQUOTE || \ - (option) == CURLOPT_PREQUOTE || \ - (option) == CURLOPT_TELNETOPTIONS || \ - (option) == CURLOPT_MAIL_RCPT || \ - 0) - -/* groups of curl_easy_getinfo infos that take the same type of argument */ - -/* evaluates to true if info expects a pointer to char * argument */ -#define _curl_is_string_info(info) \ - (CURLINFO_STRING < (info) && (info) < CURLINFO_LONG) - -/* evaluates to true if info expects a pointer to long argument */ -#define _curl_is_long_info(info) \ - (CURLINFO_LONG < (info) && (info) < CURLINFO_DOUBLE) - -/* evaluates to true if info expects a pointer to double argument */ -#define _curl_is_double_info(info) \ - (CURLINFO_DOUBLE < (info) && (info) < CURLINFO_SLIST) - -/* true if info expects a pointer to struct curl_slist * argument */ -#define _curl_is_slist_info(info) \ - (CURLINFO_SLIST < (info)) - - -/* typecheck helpers -- check whether given expression has requested type*/ - -/* For pointers, you can use the _curl_is_ptr/_curl_is_arr macros, - * otherwise define a new macro. Search for __builtin_types_compatible_p - * in the GCC manual. - * NOTE: these macros MUST NOT EVALUATE their arguments! The argument is - * the actual expression passed to the curl_easy_setopt macro. This - * means that you can only apply the sizeof and __typeof__ operators, no - * == or whatsoever. - */ - -/* XXX: should evaluate to true iff expr is a pointer */ -#define _curl_is_any_ptr(expr) \ - (sizeof(expr) == sizeof(void*)) - -/* evaluates to true if expr is NULL */ -/* XXX: must not evaluate expr, so this check is not accurate */ -#define _curl_is_NULL(expr) \ - (__builtin_types_compatible_p(__typeof__(expr), __typeof__(NULL))) - -/* evaluates to true if expr is type*, const type* or NULL */ -#define _curl_is_ptr(expr, type) \ - (_curl_is_NULL(expr) || \ - __builtin_types_compatible_p(__typeof__(expr), type *) || \ - __builtin_types_compatible_p(__typeof__(expr), const type *)) - -/* evaluates to true if expr is one of type[], type*, NULL or const type* */ -#define _curl_is_arr(expr, type) \ - (_curl_is_ptr((expr), type) || \ - __builtin_types_compatible_p(__typeof__(expr), type [])) - -/* evaluates to true if expr is a string */ -#define _curl_is_string(expr) \ - (_curl_is_arr((expr), char) || \ - _curl_is_arr((expr), signed char) || \ - _curl_is_arr((expr), unsigned char)) - -/* evaluates to true if expr is a long (no matter the signedness) - * XXX: for now, int is also accepted (and therefore short and char, which - * are promoted to int when passed to a variadic function) */ -#define _curl_is_long(expr) \ - (__builtin_types_compatible_p(__typeof__(expr), long) || \ - __builtin_types_compatible_p(__typeof__(expr), signed long) || \ - __builtin_types_compatible_p(__typeof__(expr), unsigned long) || \ - __builtin_types_compatible_p(__typeof__(expr), int) || \ - __builtin_types_compatible_p(__typeof__(expr), signed int) || \ - __builtin_types_compatible_p(__typeof__(expr), unsigned int) || \ - __builtin_types_compatible_p(__typeof__(expr), short) || \ - __builtin_types_compatible_p(__typeof__(expr), signed short) || \ - __builtin_types_compatible_p(__typeof__(expr), unsigned short) || \ - __builtin_types_compatible_p(__typeof__(expr), char) || \ - __builtin_types_compatible_p(__typeof__(expr), signed char) || \ - __builtin_types_compatible_p(__typeof__(expr), unsigned char)) - -/* evaluates to true if expr is of type curl_off_t */ -#define _curl_is_off_t(expr) \ - (__builtin_types_compatible_p(__typeof__(expr), curl_off_t)) - -/* evaluates to true if expr is abuffer suitable for CURLOPT_ERRORBUFFER */ -/* XXX: also check size of an char[] array? */ -#define _curl_is_error_buffer(expr) \ - (__builtin_types_compatible_p(__typeof__(expr), char *) || \ - __builtin_types_compatible_p(__typeof__(expr), char[])) - -/* evaluates to true if expr is of type (const) void* or (const) FILE* */ -#if 0 -#define _curl_is_cb_data(expr) \ - (_curl_is_ptr((expr), void) || \ - _curl_is_ptr((expr), FILE)) -#else /* be less strict */ -#define _curl_is_cb_data(expr) \ - _curl_is_any_ptr(expr) -#endif - -/* evaluates to true if expr is of type FILE* */ -#define _curl_is_FILE(expr) \ - (__builtin_types_compatible_p(__typeof__(expr), FILE *)) - -/* evaluates to true if expr can be passed as POST data (void* or char*) */ -#define _curl_is_postfields(expr) \ - (_curl_is_ptr((expr), void) || \ - _curl_is_arr((expr), char)) - -/* FIXME: the whole callback checking is messy... - * The idea is to tolerate char vs. void and const vs. not const - * pointers in arguments at least - */ -/* helper: __builtin_types_compatible_p distinguishes between functions and - * function pointers, hide it */ -#define _curl_callback_compatible(func, type) \ - (__builtin_types_compatible_p(__typeof__(func), type) || \ - __builtin_types_compatible_p(__typeof__(func), type*)) - -/* evaluates to true if expr is of type curl_read_callback or "similar" */ -#define _curl_is_read_cb(expr) \ - (_curl_is_NULL(expr) || \ - __builtin_types_compatible_p(__typeof__(expr), __typeof__(fread)) || \ - __builtin_types_compatible_p(__typeof__(expr), curl_read_callback) || \ - _curl_callback_compatible((expr), _curl_read_callback1) || \ - _curl_callback_compatible((expr), _curl_read_callback2) || \ - _curl_callback_compatible((expr), _curl_read_callback3) || \ - _curl_callback_compatible((expr), _curl_read_callback4) || \ - _curl_callback_compatible((expr), _curl_read_callback5) || \ - _curl_callback_compatible((expr), _curl_read_callback6)) -typedef size_t (_curl_read_callback1)(char *, size_t, size_t, void*); -typedef size_t (_curl_read_callback2)(char *, size_t, size_t, const void*); -typedef size_t (_curl_read_callback3)(char *, size_t, size_t, FILE*); -typedef size_t (_curl_read_callback4)(void *, size_t, size_t, void*); -typedef size_t (_curl_read_callback5)(void *, size_t, size_t, const void*); -typedef size_t (_curl_read_callback6)(void *, size_t, size_t, FILE*); - -/* evaluates to true if expr is of type curl_write_callback or "similar" */ -#define _curl_is_write_cb(expr) \ - (_curl_is_read_cb(expr) || \ - __builtin_types_compatible_p(__typeof__(expr), __typeof__(fwrite)) || \ - __builtin_types_compatible_p(__typeof__(expr), curl_write_callback) || \ - _curl_callback_compatible((expr), _curl_write_callback1) || \ - _curl_callback_compatible((expr), _curl_write_callback2) || \ - _curl_callback_compatible((expr), _curl_write_callback3) || \ - _curl_callback_compatible((expr), _curl_write_callback4) || \ - _curl_callback_compatible((expr), _curl_write_callback5) || \ - _curl_callback_compatible((expr), _curl_write_callback6)) -typedef size_t (_curl_write_callback1)(const char *, size_t, size_t, void*); -typedef size_t (_curl_write_callback2)(const char *, size_t, size_t, - const void*); -typedef size_t (_curl_write_callback3)(const char *, size_t, size_t, FILE*); -typedef size_t (_curl_write_callback4)(const void *, size_t, size_t, void*); -typedef size_t (_curl_write_callback5)(const void *, size_t, size_t, - const void*); -typedef size_t (_curl_write_callback6)(const void *, size_t, size_t, FILE*); - -/* evaluates to true if expr is of type curl_ioctl_callback or "similar" */ -#define _curl_is_ioctl_cb(expr) \ - (_curl_is_NULL(expr) || \ - __builtin_types_compatible_p(__typeof__(expr), curl_ioctl_callback) || \ - _curl_callback_compatible((expr), _curl_ioctl_callback1) || \ - _curl_callback_compatible((expr), _curl_ioctl_callback2) || \ - _curl_callback_compatible((expr), _curl_ioctl_callback3) || \ - _curl_callback_compatible((expr), _curl_ioctl_callback4)) -typedef curlioerr (_curl_ioctl_callback1)(CURL *, int, void*); -typedef curlioerr (_curl_ioctl_callback2)(CURL *, int, const void*); -typedef curlioerr (_curl_ioctl_callback3)(CURL *, curliocmd, void*); -typedef curlioerr (_curl_ioctl_callback4)(CURL *, curliocmd, const void*); - -/* evaluates to true if expr is of type curl_sockopt_callback or "similar" */ -#define _curl_is_sockopt_cb(expr) \ - (_curl_is_NULL(expr) || \ - __builtin_types_compatible_p(__typeof__(expr), curl_sockopt_callback) || \ - _curl_callback_compatible((expr), _curl_sockopt_callback1) || \ - _curl_callback_compatible((expr), _curl_sockopt_callback2)) -typedef int (_curl_sockopt_callback1)(void *, curl_socket_t, curlsocktype); -typedef int (_curl_sockopt_callback2)(const void *, curl_socket_t, - curlsocktype); - -/* evaluates to true if expr is of type curl_opensocket_callback or "similar" */ -#define _curl_is_opensocket_cb(expr) \ - (_curl_is_NULL(expr) || \ - __builtin_types_compatible_p(__typeof__(expr), curl_opensocket_callback) ||\ - _curl_callback_compatible((expr), _curl_opensocket_callback1) || \ - _curl_callback_compatible((expr), _curl_opensocket_callback2) || \ - _curl_callback_compatible((expr), _curl_opensocket_callback3) || \ - _curl_callback_compatible((expr), _curl_opensocket_callback4)) -typedef curl_socket_t (_curl_opensocket_callback1) - (void *, curlsocktype, struct curl_sockaddr *); -typedef curl_socket_t (_curl_opensocket_callback2) - (void *, curlsocktype, const struct curl_sockaddr *); -typedef curl_socket_t (_curl_opensocket_callback3) - (const void *, curlsocktype, struct curl_sockaddr *); -typedef curl_socket_t (_curl_opensocket_callback4) - (const void *, curlsocktype, const struct curl_sockaddr *); - -/* evaluates to true if expr is of type curl_progress_callback or "similar" */ -#define _curl_is_progress_cb(expr) \ - (_curl_is_NULL(expr) || \ - __builtin_types_compatible_p(__typeof__(expr), curl_progress_callback) || \ - _curl_callback_compatible((expr), _curl_progress_callback1) || \ - _curl_callback_compatible((expr), _curl_progress_callback2)) -typedef int (_curl_progress_callback1)(void *, - double, double, double, double); -typedef int (_curl_progress_callback2)(const void *, - double, double, double, double); - -/* evaluates to true if expr is of type curl_debug_callback or "similar" */ -#define _curl_is_debug_cb(expr) \ - (_curl_is_NULL(expr) || \ - __builtin_types_compatible_p(__typeof__(expr), curl_debug_callback) || \ - _curl_callback_compatible((expr), _curl_debug_callback1) || \ - _curl_callback_compatible((expr), _curl_debug_callback2) || \ - _curl_callback_compatible((expr), _curl_debug_callback3) || \ - _curl_callback_compatible((expr), _curl_debug_callback4)) -typedef int (_curl_debug_callback1) (CURL *, - curl_infotype, char *, size_t, void *); -typedef int (_curl_debug_callback2) (CURL *, - curl_infotype, char *, size_t, const void *); -typedef int (_curl_debug_callback3) (CURL *, - curl_infotype, const char *, size_t, void *); -typedef int (_curl_debug_callback4) (CURL *, - curl_infotype, const char *, size_t, const void *); - -/* evaluates to true if expr is of type curl_ssl_ctx_callback or "similar" */ -/* this is getting even messier... */ -#define _curl_is_ssl_ctx_cb(expr) \ - (_curl_is_NULL(expr) || \ - __builtin_types_compatible_p(__typeof__(expr), curl_ssl_ctx_callback) || \ - _curl_callback_compatible((expr), _curl_ssl_ctx_callback1) || \ - _curl_callback_compatible((expr), _curl_ssl_ctx_callback2) || \ - _curl_callback_compatible((expr), _curl_ssl_ctx_callback3) || \ - _curl_callback_compatible((expr), _curl_ssl_ctx_callback4) || \ - _curl_callback_compatible((expr), _curl_ssl_ctx_callback5) || \ - _curl_callback_compatible((expr), _curl_ssl_ctx_callback6) || \ - _curl_callback_compatible((expr), _curl_ssl_ctx_callback7) || \ - _curl_callback_compatible((expr), _curl_ssl_ctx_callback8)) -typedef CURLcode (_curl_ssl_ctx_callback1)(CURL *, void *, void *); -typedef CURLcode (_curl_ssl_ctx_callback2)(CURL *, void *, const void *); -typedef CURLcode (_curl_ssl_ctx_callback3)(CURL *, const void *, void *); -typedef CURLcode (_curl_ssl_ctx_callback4)(CURL *, const void *, const void *); -#ifdef HEADER_SSL_H -/* hack: if we included OpenSSL's ssl.h, we know about SSL_CTX - * this will of course break if we're included before OpenSSL headers... - */ -typedef CURLcode (_curl_ssl_ctx_callback5)(CURL *, SSL_CTX, void *); -typedef CURLcode (_curl_ssl_ctx_callback6)(CURL *, SSL_CTX, const void *); -typedef CURLcode (_curl_ssl_ctx_callback7)(CURL *, const SSL_CTX, void *); -typedef CURLcode (_curl_ssl_ctx_callback8)(CURL *, const SSL_CTX, const void *); -#else -typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback5; -typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback6; -typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback7; -typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback8; -#endif - -/* evaluates to true if expr is of type curl_conv_callback or "similar" */ -#define _curl_is_conv_cb(expr) \ - (_curl_is_NULL(expr) || \ - __builtin_types_compatible_p(__typeof__(expr), curl_conv_callback) || \ - _curl_callback_compatible((expr), _curl_conv_callback1) || \ - _curl_callback_compatible((expr), _curl_conv_callback2) || \ - _curl_callback_compatible((expr), _curl_conv_callback3) || \ - _curl_callback_compatible((expr), _curl_conv_callback4)) -typedef CURLcode (*_curl_conv_callback1)(char *, size_t length); -typedef CURLcode (*_curl_conv_callback2)(const char *, size_t length); -typedef CURLcode (*_curl_conv_callback3)(void *, size_t length); -typedef CURLcode (*_curl_conv_callback4)(const void *, size_t length); - -/* evaluates to true if expr is of type curl_seek_callback or "similar" */ -#define _curl_is_seek_cb(expr) \ - (_curl_is_NULL(expr) || \ - __builtin_types_compatible_p(__typeof__(expr), curl_seek_callback) || \ - _curl_callback_compatible((expr), _curl_seek_callback1) || \ - _curl_callback_compatible((expr), _curl_seek_callback2)) -typedef CURLcode (*_curl_seek_callback1)(void *, curl_off_t, int); -typedef CURLcode (*_curl_seek_callback2)(const void *, curl_off_t, int); - - -#endif /* __CURL_TYPECHECK_GCC_H */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/curl/types.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/curl/types.h deleted file mode 100644 index d37d6ae9e1..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/curl/types.h +++ /dev/null @@ -1 +0,0 @@ -/* not used */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/fontconfig/fcfreetype.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/fontconfig/fcfreetype.h deleted file mode 100644 index 753fdf9da8..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/fontconfig/fcfreetype.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * fontconfig/fontconfig/fcfreetype.h - * - * Copyright © 2001 Keith Packard - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of the author(s) not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. The authors make no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef _FCFREETYPE_H_ -#define _FCFREETYPE_H_ -#include <ft2build.h> -#include FT_FREETYPE_H - -#ifndef FcPublic -#define FcPublic -#endif - -_FCFUNCPROTOBEGIN - -FcPublic FT_UInt -FcFreeTypeCharIndex (FT_Face face, FcChar32 ucs4); - -FcPublic FcCharSet * -FcFreeTypeCharSetAndSpacing (FT_Face face, FcBlanks *blanks, int *spacing); - -FcPublic FcCharSet * -FcFreeTypeCharSet (FT_Face face, FcBlanks *blanks); - -FcPublic FcResult -FcPatternGetFTFace (const FcPattern *p, const char *object, int n, FT_Face *f); - -FcPublic FcBool -FcPatternAddFTFace (FcPattern *p, const char *object, const FT_Face f); - -FcPublic FcPattern * -FcFreeTypeQueryFace (const FT_Face face, - const FcChar8 *file, - int id, - FcBlanks *blanks); - -_FCFUNCPROTOEND - -#endif diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/fontconfig/fcprivate.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/fontconfig/fcprivate.h deleted file mode 100644 index 18b8c08ca7..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/fontconfig/fcprivate.h +++ /dev/null @@ -1,123 +0,0 @@ -/* - * fontconfig/fontconfig/fcprivate.h - * - * Copyright © 2001 Keith Packard - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of the author(s) not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. The authors make no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef _FCPRIVATE_H_ -#define _FCPRIVATE_H_ - -/* - * I tried this with functions that took va_list* arguments - * but portability concerns made me change these functions - * into macros (sigh). - */ - -#define FcPatternVapBuild(result, orig, va) \ -{ \ - FcPattern *__p__ = (orig); \ - const char *__o__; \ - FcValue __v__; \ - \ - if (!__p__) \ - { \ - __p__ = FcPatternCreate (); \ - if (!__p__) \ - goto _FcPatternVapBuild_bail0; \ - } \ - for (;;) \ - { \ - __o__ = va_arg (va, const char *); \ - if (!__o__) \ - break; \ - __v__.type = va_arg (va, FcType); \ - switch (__v__.type) { \ - case FcTypeVoid: \ - goto _FcPatternVapBuild_bail1; \ - case FcTypeInteger: \ - __v__.u.i = va_arg (va, int); \ - break; \ - case FcTypeDouble: \ - __v__.u.d = va_arg (va, double); \ - break; \ - case FcTypeString: \ - __v__.u.s = va_arg (va, const FcChar8 *); \ - break; \ - case FcTypeBool: \ - __v__.u.b = va_arg (va, FcBool); \ - break; \ - case FcTypeMatrix: \ - __v__.u.m = va_arg (va, const FcMatrix *); \ - break; \ - case FcTypeCharSet: \ - __v__.u.c = va_arg (va, const FcCharSet *); \ - break; \ - case FcTypeFTFace: \ - __v__.u.f = va_arg (va, FT_Face); \ - break; \ - case FcTypeLangSet: \ - __v__.u.l = va_arg (va, const FcLangSet *); \ - break; \ - } \ - if (!FcPatternAdd (__p__, __o__, __v__, FcTrue)) \ - goto _FcPatternVapBuild_bail1; \ - } \ - result = __p__; \ - goto _FcPatternVapBuild_return; \ - \ -_FcPatternVapBuild_bail1: \ - if (!orig) \ - FcPatternDestroy (__p__); \ -_FcPatternVapBuild_bail0: \ - result = (void*)0; \ - \ -_FcPatternVapBuild_return: \ - ; \ -} - - -#define FcObjectSetVapBuild(__ret__, __first__, __va__) \ -{ \ - FcObjectSet *__os__; \ - const char *__ob__; \ - \ - __ret__ = 0; \ - __os__ = FcObjectSetCreate (); \ - if (!__os__) \ - goto _FcObjectSetVapBuild_bail0; \ - __ob__ = __first__; \ - while (__ob__) \ - { \ - if (!FcObjectSetAdd (__os__, __ob__)) \ - goto _FcObjectSetVapBuild_bail1; \ - __ob__ = va_arg (__va__, const char *); \ - } \ - __ret__ = __os__; \ - \ -_FcObjectSetVapBuild_bail1: \ - if (!__ret__ && __os__) \ - FcObjectSetDestroy (__os__); \ -_FcObjectSetVapBuild_bail0: \ - ; \ -} - -#endif /* _FCPRIVATE_H_ */ - diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/fontconfig/fontconfig.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/fontconfig/fontconfig.h deleted file mode 100644 index 8936d83373..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/fontconfig/fontconfig.h +++ /dev/null @@ -1,974 +0,0 @@ -/* - * fontconfig/fontconfig/fontconfig.h - * - * Copyright © 2001 Keith Packard - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of the author(s) not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. The authors make no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef _FONTCONFIG_H_ -#define _FONTCONFIG_H_ - -#include <sys/types.h> -#include <sys/stat.h> -#include <stdarg.h> - -#if defined(__GNUC__) && (__GNUC__ >= 4) -#define FC_ATTRIBUTE_SENTINEL(x) __attribute__((__sentinel__(0))) -#else -#define FC_ATTRIBUTE_SENTINEL(x) -#endif - -#ifndef FcPublic -#define FcPublic -#endif - -typedef unsigned char FcChar8; -typedef unsigned short FcChar16; -typedef unsigned int FcChar32; -typedef int FcBool; - -/* - * Current Fontconfig version number. This same number - * must appear in the fontconfig configure.in file. Yes, - * it'a a pain to synchronize version numbers like this. - */ - -#define FC_MAJOR 2 -#define FC_MINOR 9 -#define FC_REVISION 0 - -#define FC_VERSION ((FC_MAJOR * 10000) + (FC_MINOR * 100) + (FC_REVISION)) - -/* - * Current font cache file format version - * This is appended to the cache files so that multiple - * versions of the library will peacefully coexist - * - * Change this value whenever the disk format for the cache file - * changes in any non-compatible way. Try to avoid such changes as - * it means multiple copies of the font information. - */ - -#define FC_CACHE_VERSION "3" - -#define FcTrue 1 -#define FcFalse 0 - -#define FC_FAMILY "family" /* String */ -#define FC_STYLE "style" /* String */ -#define FC_SLANT "slant" /* Int */ -#define FC_WEIGHT "weight" /* Int */ -#define FC_SIZE "size" /* Double */ -#define FC_ASPECT "aspect" /* Double */ -#define FC_PIXEL_SIZE "pixelsize" /* Double */ -#define FC_SPACING "spacing" /* Int */ -#define FC_FOUNDRY "foundry" /* String */ -#define FC_ANTIALIAS "antialias" /* Bool (depends) */ -#define FC_HINTING "hinting" /* Bool (true) */ -#define FC_HINT_STYLE "hintstyle" /* Int */ -#define FC_VERTICAL_LAYOUT "verticallayout" /* Bool (false) */ -#define FC_AUTOHINT "autohint" /* Bool (false) */ -#define FC_GLOBAL_ADVANCE "globaladvance" /* Bool (true) */ -#define FC_WIDTH "width" /* Int */ -#define FC_FILE "file" /* String */ -#define FC_INDEX "index" /* Int */ -#define FC_FT_FACE "ftface" /* FT_Face */ -#define FC_RASTERIZER "rasterizer" /* String */ -#define FC_OUTLINE "outline" /* Bool */ -#define FC_SCALABLE "scalable" /* Bool */ -#define FC_SCALE "scale" /* double */ -#define FC_DPI "dpi" /* double */ -#define FC_RGBA "rgba" /* Int */ -#define FC_MINSPACE "minspace" /* Bool use minimum line spacing */ -#define FC_SOURCE "source" /* String (deprecated) */ -#define FC_CHARSET "charset" /* CharSet */ -#define FC_LANG "lang" /* String RFC 3066 langs */ -#define FC_FONTVERSION "fontversion" /* Int from 'head' table */ -#define FC_FULLNAME "fullname" /* String */ -#define FC_FAMILYLANG "familylang" /* String RFC 3066 langs */ -#define FC_STYLELANG "stylelang" /* String RFC 3066 langs */ -#define FC_FULLNAMELANG "fullnamelang" /* String RFC 3066 langs */ -#define FC_CAPABILITY "capability" /* String */ -#define FC_FONTFORMAT "fontformat" /* String */ -#define FC_EMBOLDEN "embolden" /* Bool - true if emboldening needed*/ -#define FC_EMBEDDED_BITMAP "embeddedbitmap" /* Bool - true to enable embedded bitmaps */ -#define FC_DECORATIVE "decorative" /* Bool - true if style is a decorative variant */ -#define FC_LCD_FILTER "lcdfilter" /* Int */ - -#define FC_CACHE_SUFFIX ".cache-"FC_CACHE_VERSION -#define FC_DIR_CACHE_FILE "fonts.cache-"FC_CACHE_VERSION -#define FC_USER_CACHE_FILE ".fonts.cache-"FC_CACHE_VERSION - -/* Adjust outline rasterizer */ -#define FC_CHAR_WIDTH "charwidth" /* Int */ -#define FC_CHAR_HEIGHT "charheight"/* Int */ -#define FC_MATRIX "matrix" /* FcMatrix */ - -#define FC_WEIGHT_THIN 0 -#define FC_WEIGHT_EXTRALIGHT 40 -#define FC_WEIGHT_ULTRALIGHT FC_WEIGHT_EXTRALIGHT -#define FC_WEIGHT_LIGHT 50 -#define FC_WEIGHT_BOOK 75 -#define FC_WEIGHT_REGULAR 80 -#define FC_WEIGHT_NORMAL FC_WEIGHT_REGULAR -#define FC_WEIGHT_MEDIUM 100 -#define FC_WEIGHT_DEMIBOLD 180 -#define FC_WEIGHT_SEMIBOLD FC_WEIGHT_DEMIBOLD -#define FC_WEIGHT_BOLD 200 -#define FC_WEIGHT_EXTRABOLD 205 -#define FC_WEIGHT_ULTRABOLD FC_WEIGHT_EXTRABOLD -#define FC_WEIGHT_BLACK 210 -#define FC_WEIGHT_HEAVY FC_WEIGHT_BLACK -#define FC_WEIGHT_EXTRABLACK 215 -#define FC_WEIGHT_ULTRABLACK FC_WEIGHT_EXTRABLACK - -#define FC_SLANT_ROMAN 0 -#define FC_SLANT_ITALIC 100 -#define FC_SLANT_OBLIQUE 110 - -#define FC_WIDTH_ULTRACONDENSED 50 -#define FC_WIDTH_EXTRACONDENSED 63 -#define FC_WIDTH_CONDENSED 75 -#define FC_WIDTH_SEMICONDENSED 87 -#define FC_WIDTH_NORMAL 100 -#define FC_WIDTH_SEMIEXPANDED 113 -#define FC_WIDTH_EXPANDED 125 -#define FC_WIDTH_EXTRAEXPANDED 150 -#define FC_WIDTH_ULTRAEXPANDED 200 - -#define FC_PROPORTIONAL 0 -#define FC_DUAL 90 -#define FC_MONO 100 -#define FC_CHARCELL 110 - -/* sub-pixel order */ -#define FC_RGBA_UNKNOWN 0 -#define FC_RGBA_RGB 1 -#define FC_RGBA_BGR 2 -#define FC_RGBA_VRGB 3 -#define FC_RGBA_VBGR 4 -#define FC_RGBA_NONE 5 - -/* hinting style */ -#define FC_HINT_NONE 0 -#define FC_HINT_SLIGHT 1 -#define FC_HINT_MEDIUM 2 -#define FC_HINT_FULL 3 - -/* LCD filter */ -#define FC_LCD_NONE 0 -#define FC_LCD_DEFAULT 1 -#define FC_LCD_LIGHT 2 -#define FC_LCD_LEGACY 3 - -typedef enum _FcType { - FcTypeVoid, - FcTypeInteger, - FcTypeDouble, - FcTypeString, - FcTypeBool, - FcTypeMatrix, - FcTypeCharSet, - FcTypeFTFace, - FcTypeLangSet -} FcType; - -typedef struct _FcMatrix { - double xx, xy, yx, yy; -} FcMatrix; - -#define FcMatrixInit(m) ((m)->xx = (m)->yy = 1, \ - (m)->xy = (m)->yx = 0) - -/* - * A data structure to represent the available glyphs in a font. - * This is represented as a sparse boolean btree. - */ - -typedef struct _FcCharSet FcCharSet; - -typedef struct _FcObjectType { - const char *object; - FcType type; -} FcObjectType; - -typedef struct _FcConstant { - const FcChar8 *name; - const char *object; - int value; -} FcConstant; - -typedef enum _FcResult { - FcResultMatch, FcResultNoMatch, FcResultTypeMismatch, FcResultNoId, - FcResultOutOfMemory -} FcResult; - -typedef struct _FcPattern FcPattern; - -typedef struct _FcLangSet FcLangSet; - -typedef struct _FcValue { - FcType type; - union { - const FcChar8 *s; - int i; - FcBool b; - double d; - const FcMatrix *m; - const FcCharSet *c; - void *f; - const FcLangSet *l; - } u; -} FcValue; - -typedef struct _FcFontSet { - int nfont; - int sfont; - FcPattern **fonts; -} FcFontSet; - -typedef struct _FcObjectSet { - int nobject; - int sobject; - const char **objects; -} FcObjectSet; - -typedef enum _FcMatchKind { - FcMatchPattern, FcMatchFont, FcMatchScan -} FcMatchKind; - -typedef enum _FcLangResult { - FcLangEqual = 0, - FcLangDifferentCountry = 1, - FcLangDifferentTerritory = 1, - FcLangDifferentLang = 2 -} FcLangResult; - -typedef enum _FcSetName { - FcSetSystem = 0, - FcSetApplication = 1 -} FcSetName; - -typedef struct _FcAtomic FcAtomic; - -#if defined(__cplusplus) || defined(c_plusplus) /* for C++ V2.0 */ -#define _FCFUNCPROTOBEGIN extern "C" { /* do not leave open across includes */ -#define _FCFUNCPROTOEND } -#else -#define _FCFUNCPROTOBEGIN -#define _FCFUNCPROTOEND -#endif - -typedef enum { FcEndianBig, FcEndianLittle } FcEndian; - -typedef struct _FcConfig FcConfig; - -typedef struct _FcGlobalCache FcFileCache; - -typedef struct _FcBlanks FcBlanks; - -typedef struct _FcStrList FcStrList; - -typedef struct _FcStrSet FcStrSet; - -typedef struct _FcCache FcCache; - -_FCFUNCPROTOBEGIN - -/* fcblanks.c */ -FcPublic FcBlanks * -FcBlanksCreate (void); - -FcPublic void -FcBlanksDestroy (FcBlanks *b); - -FcPublic FcBool -FcBlanksAdd (FcBlanks *b, FcChar32 ucs4); - -FcPublic FcBool -FcBlanksIsMember (FcBlanks *b, FcChar32 ucs4); - -/* fccache.c */ - -FcPublic const FcChar8 * -FcCacheDir(const FcCache *c); - -FcPublic FcFontSet * -FcCacheCopySet(const FcCache *c); - -FcPublic const FcChar8 * -FcCacheSubdir (const FcCache *c, int i); - -FcPublic int -FcCacheNumSubdir (const FcCache *c); - -FcPublic int -FcCacheNumFont (const FcCache *c); - -FcPublic FcBool -FcDirCacheUnlink (const FcChar8 *dir, FcConfig *config); - -FcPublic FcBool -FcDirCacheValid (const FcChar8 *cache_file); - -/* fccfg.c */ -FcPublic FcChar8 * -FcConfigHome (void); - -FcPublic FcBool -FcConfigEnableHome (FcBool enable); - -FcPublic FcChar8 * -FcConfigFilename (const FcChar8 *url); - -FcPublic FcConfig * -FcConfigCreate (void); - -FcPublic FcConfig * -FcConfigReference (FcConfig *config); - -FcPublic void -FcConfigDestroy (FcConfig *config); - -FcPublic FcBool -FcConfigSetCurrent (FcConfig *config); - -FcPublic FcConfig * -FcConfigGetCurrent (void); - -FcPublic FcBool -FcConfigUptoDate (FcConfig *config); - -FcPublic FcBool -FcConfigBuildFonts (FcConfig *config); - -FcPublic FcStrList * -FcConfigGetFontDirs (FcConfig *config); - -FcPublic FcStrList * -FcConfigGetConfigDirs (FcConfig *config); - -FcPublic FcStrList * -FcConfigGetConfigFiles (FcConfig *config); - -FcPublic FcChar8 * -FcConfigGetCache (FcConfig *config); - -FcPublic FcBlanks * -FcConfigGetBlanks (FcConfig *config); - -FcPublic FcStrList * -FcConfigGetCacheDirs (FcConfig *config); - -FcPublic int -FcConfigGetRescanInterval (FcConfig *config); - -FcPublic FcBool -FcConfigSetRescanInterval (FcConfig *config, int rescanInterval); - -FcPublic FcFontSet * -FcConfigGetFonts (FcConfig *config, - FcSetName set); - -FcPublic FcBool -FcConfigAppFontAddFile (FcConfig *config, - const FcChar8 *file); - -FcPublic FcBool -FcConfigAppFontAddDir (FcConfig *config, - const FcChar8 *dir); - -FcPublic void -FcConfigAppFontClear (FcConfig *config); - -FcPublic FcBool -FcConfigSubstituteWithPat (FcConfig *config, - FcPattern *p, - FcPattern *p_pat, - FcMatchKind kind); - -FcPublic FcBool -FcConfigSubstitute (FcConfig *config, - FcPattern *p, - FcMatchKind kind); - -/* fccharset.c */ -FcPublic FcCharSet* -FcCharSetCreate (void); - -/* deprecated alias for FcCharSetCreate */ -FcPublic FcCharSet * -FcCharSetNew (void); - -FcPublic void -FcCharSetDestroy (FcCharSet *fcs); - -FcPublic FcBool -FcCharSetAddChar (FcCharSet *fcs, FcChar32 ucs4); - -FcPublic FcBool -FcCharSetDelChar (FcCharSet *fcs, FcChar32 ucs4); - -FcPublic FcCharSet* -FcCharSetCopy (FcCharSet *src); - -FcPublic FcBool -FcCharSetEqual (const FcCharSet *a, const FcCharSet *b); - -FcPublic FcCharSet* -FcCharSetIntersect (const FcCharSet *a, const FcCharSet *b); - -FcPublic FcCharSet* -FcCharSetUnion (const FcCharSet *a, const FcCharSet *b); - -FcPublic FcCharSet* -FcCharSetSubtract (const FcCharSet *a, const FcCharSet *b); - -FcPublic FcBool -FcCharSetMerge (FcCharSet *a, const FcCharSet *b, FcBool *changed); - -FcPublic FcBool -FcCharSetHasChar (const FcCharSet *fcs, FcChar32 ucs4); - -FcPublic FcChar32 -FcCharSetCount (const FcCharSet *a); - -FcPublic FcChar32 -FcCharSetIntersectCount (const FcCharSet *a, const FcCharSet *b); - -FcPublic FcChar32 -FcCharSetSubtractCount (const FcCharSet *a, const FcCharSet *b); - -FcPublic FcBool -FcCharSetIsSubset (const FcCharSet *a, const FcCharSet *b); - -#define FC_CHARSET_MAP_SIZE (256/32) -#define FC_CHARSET_DONE ((FcChar32) -1) - -FcPublic FcChar32 -FcCharSetFirstPage (const FcCharSet *a, - FcChar32 map[FC_CHARSET_MAP_SIZE], - FcChar32 *next); - -FcPublic FcChar32 -FcCharSetNextPage (const FcCharSet *a, - FcChar32 map[FC_CHARSET_MAP_SIZE], - FcChar32 *next); - -/* - * old coverage API, rather hard to use correctly - */ - -FcPublic FcChar32 -FcCharSetCoverage (const FcCharSet *a, FcChar32 page, FcChar32 *result); - -/* fcdbg.c */ -FcPublic void -FcValuePrint (const FcValue v); - -FcPublic void -FcPatternPrint (const FcPattern *p); - -FcPublic void -FcFontSetPrint (const FcFontSet *s); - -/* fcdefault.c */ -FcPublic void -FcDefaultSubstitute (FcPattern *pattern); - -/* fcdir.c */ -FcPublic FcBool -FcFileIsDir (const FcChar8 *file); - -FcPublic FcBool -FcFileScan (FcFontSet *set, - FcStrSet *dirs, - FcFileCache *cache, - FcBlanks *blanks, - const FcChar8 *file, - FcBool force); - -FcPublic FcBool -FcDirScan (FcFontSet *set, - FcStrSet *dirs, - FcFileCache *cache, - FcBlanks *blanks, - const FcChar8 *dir, - FcBool force); - -FcPublic FcBool -FcDirSave (FcFontSet *set, FcStrSet *dirs, const FcChar8 *dir); - -FcPublic FcCache * -FcDirCacheLoad (const FcChar8 *dir, FcConfig *config, FcChar8 **cache_file); - -FcPublic FcCache * -FcDirCacheRead (const FcChar8 *dir, FcBool force, FcConfig *config); - -FcPublic FcCache * -FcDirCacheLoadFile (const FcChar8 *cache_file, struct stat *file_stat); - -FcPublic void -FcDirCacheUnload (FcCache *cache); - -/* fcfreetype.c */ -FcPublic FcPattern * -FcFreeTypeQuery (const FcChar8 *file, int id, FcBlanks *blanks, int *count); - -/* fcfs.c */ - -FcPublic FcFontSet * -FcFontSetCreate (void); - -FcPublic void -FcFontSetDestroy (FcFontSet *s); - -FcPublic FcBool -FcFontSetAdd (FcFontSet *s, FcPattern *font); - -/* fcinit.c */ -FcPublic FcConfig * -FcInitLoadConfig (void); - -FcPublic FcConfig * -FcInitLoadConfigAndFonts (void); - -FcPublic FcBool -FcInit (void); - -FcPublic void -FcFini (void); - -FcPublic int -FcGetVersion (void); - -FcPublic FcBool -FcInitReinitialize (void); - -FcPublic FcBool -FcInitBringUptoDate (void); - -/* fclang.c */ -FcPublic FcStrSet * -FcGetLangs (void); - -FcPublic const FcCharSet * -FcLangGetCharSet (const FcChar8 *lang); - -FcPublic FcLangSet* -FcLangSetCreate (void); - -FcPublic void -FcLangSetDestroy (FcLangSet *ls); - -FcPublic FcLangSet* -FcLangSetCopy (const FcLangSet *ls); - -FcPublic FcBool -FcLangSetAdd (FcLangSet *ls, const FcChar8 *lang); - -FcPublic FcBool -FcLangSetDel (FcLangSet *ls, const FcChar8 *lang); - -FcPublic FcLangResult -FcLangSetHasLang (const FcLangSet *ls, const FcChar8 *lang); - -FcPublic FcLangResult -FcLangSetCompare (const FcLangSet *lsa, const FcLangSet *lsb); - -FcPublic FcBool -FcLangSetContains (const FcLangSet *lsa, const FcLangSet *lsb); - -FcPublic FcBool -FcLangSetEqual (const FcLangSet *lsa, const FcLangSet *lsb); - -FcPublic FcChar32 -FcLangSetHash (const FcLangSet *ls); - -FcPublic FcStrSet * -FcLangSetGetLangs (const FcLangSet *ls); - -FcPublic FcLangSet * -FcLangSetUnion (const FcLangSet *a, const FcLangSet *b); - -FcPublic FcLangSet * -FcLangSetSubtract (const FcLangSet *a, const FcLangSet *b); - -/* fclist.c */ -FcPublic FcObjectSet * -FcObjectSetCreate (void); - -FcPublic FcBool -FcObjectSetAdd (FcObjectSet *os, const char *object); - -FcPublic void -FcObjectSetDestroy (FcObjectSet *os); - -FcPublic FcObjectSet * -FcObjectSetVaBuild (const char *first, va_list va); - -FcPublic FcObjectSet * -FcObjectSetBuild (const char *first, ...) FC_ATTRIBUTE_SENTINEL(0); - -FcPublic FcFontSet * -FcFontSetList (FcConfig *config, - FcFontSet **sets, - int nsets, - FcPattern *p, - FcObjectSet *os); - -FcPublic FcFontSet * -FcFontList (FcConfig *config, - FcPattern *p, - FcObjectSet *os); - -/* fcatomic.c */ - -FcPublic FcAtomic * -FcAtomicCreate (const FcChar8 *file); - -FcPublic FcBool -FcAtomicLock (FcAtomic *atomic); - -FcPublic FcChar8 * -FcAtomicNewFile (FcAtomic *atomic); - -FcPublic FcChar8 * -FcAtomicOrigFile (FcAtomic *atomic); - -FcPublic FcBool -FcAtomicReplaceOrig (FcAtomic *atomic); - -FcPublic void -FcAtomicDeleteNew (FcAtomic *atomic); - -FcPublic void -FcAtomicUnlock (FcAtomic *atomic); - -FcPublic void -FcAtomicDestroy (FcAtomic *atomic); - -/* fcmatch.c */ -FcPublic FcPattern * -FcFontSetMatch (FcConfig *config, - FcFontSet **sets, - int nsets, - FcPattern *p, - FcResult *result); - -FcPublic FcPattern * -FcFontMatch (FcConfig *config, - FcPattern *p, - FcResult *result); - -FcPublic FcPattern * -FcFontRenderPrepare (FcConfig *config, - FcPattern *pat, - FcPattern *font); - -FcPublic FcFontSet * -FcFontSetSort (FcConfig *config, - FcFontSet **sets, - int nsets, - FcPattern *p, - FcBool trim, - FcCharSet **csp, - FcResult *result); - -FcPublic FcFontSet * -FcFontSort (FcConfig *config, - FcPattern *p, - FcBool trim, - FcCharSet **csp, - FcResult *result); - -FcPublic void -FcFontSetSortDestroy (FcFontSet *fs); - -/* fcmatrix.c */ -FcPublic FcMatrix * -FcMatrixCopy (const FcMatrix *mat); - -FcPublic FcBool -FcMatrixEqual (const FcMatrix *mat1, const FcMatrix *mat2); - -FcPublic void -FcMatrixMultiply (FcMatrix *result, const FcMatrix *a, const FcMatrix *b); - -FcPublic void -FcMatrixRotate (FcMatrix *m, double c, double s); - -FcPublic void -FcMatrixScale (FcMatrix *m, double sx, double sy); - -FcPublic void -FcMatrixShear (FcMatrix *m, double sh, double sv); - -/* fcname.c */ - -FcPublic FcBool -FcNameRegisterObjectTypes (const FcObjectType *types, int ntype); - -FcPublic FcBool -FcNameUnregisterObjectTypes (const FcObjectType *types, int ntype); - -FcPublic const FcObjectType * -FcNameGetObjectType (const char *object); - -FcPublic FcBool -FcNameRegisterConstants (const FcConstant *consts, int nconsts); - -FcPublic FcBool -FcNameUnregisterConstants (const FcConstant *consts, int nconsts); - -FcPublic const FcConstant * -FcNameGetConstant (const FcChar8 *string); - -FcPublic FcBool -FcNameConstant (const FcChar8 *string, int *result); - -FcPublic FcPattern * -FcNameParse (const FcChar8 *name); - -FcPublic FcChar8 * -FcNameUnparse (FcPattern *pat); - -/* fcpat.c */ -FcPublic FcPattern * -FcPatternCreate (void); - -FcPublic FcPattern * -FcPatternDuplicate (const FcPattern *p); - -FcPublic void -FcPatternReference (FcPattern *p); - -FcPublic FcPattern * -FcPatternFilter (FcPattern *p, const FcObjectSet *os); - -FcPublic void -FcValueDestroy (FcValue v); - -FcPublic FcBool -FcValueEqual (FcValue va, FcValue vb); - -FcPublic FcValue -FcValueSave (FcValue v); - -FcPublic void -FcPatternDestroy (FcPattern *p); - -FcPublic FcBool -FcPatternEqual (const FcPattern *pa, const FcPattern *pb); - -FcPublic FcBool -FcPatternEqualSubset (const FcPattern *pa, const FcPattern *pb, const FcObjectSet *os); - -FcPublic FcChar32 -FcPatternHash (const FcPattern *p); - -FcPublic FcBool -FcPatternAdd (FcPattern *p, const char *object, FcValue value, FcBool append); - -FcPublic FcBool -FcPatternAddWeak (FcPattern *p, const char *object, FcValue value, FcBool append); - -FcPublic FcResult -FcPatternGet (const FcPattern *p, const char *object, int id, FcValue *v); - -FcPublic FcBool -FcPatternDel (FcPattern *p, const char *object); - -FcPublic FcBool -FcPatternRemove (FcPattern *p, const char *object, int id); - -FcPublic FcBool -FcPatternAddInteger (FcPattern *p, const char *object, int i); - -FcPublic FcBool -FcPatternAddDouble (FcPattern *p, const char *object, double d); - -FcPublic FcBool -FcPatternAddString (FcPattern *p, const char *object, const FcChar8 *s); - -FcPublic FcBool -FcPatternAddMatrix (FcPattern *p, const char *object, const FcMatrix *s); - -FcPublic FcBool -FcPatternAddCharSet (FcPattern *p, const char *object, const FcCharSet *c); - -FcPublic FcBool -FcPatternAddBool (FcPattern *p, const char *object, FcBool b); - -FcPublic FcBool -FcPatternAddLangSet (FcPattern *p, const char *object, const FcLangSet *ls); - -FcPublic FcResult -FcPatternGetInteger (const FcPattern *p, const char *object, int n, int *i); - -FcPublic FcResult -FcPatternGetDouble (const FcPattern *p, const char *object, int n, double *d); - -FcPublic FcResult -FcPatternGetString (const FcPattern *p, const char *object, int n, FcChar8 ** s); - -FcPublic FcResult -FcPatternGetMatrix (const FcPattern *p, const char *object, int n, FcMatrix **s); - -FcPublic FcResult -FcPatternGetCharSet (const FcPattern *p, const char *object, int n, FcCharSet **c); - -FcPublic FcResult -FcPatternGetBool (const FcPattern *p, const char *object, int n, FcBool *b); - -FcPublic FcResult -FcPatternGetLangSet (const FcPattern *p, const char *object, int n, FcLangSet **ls); - -FcPublic FcPattern * -FcPatternVaBuild (FcPattern *p, va_list va); - -FcPublic FcPattern * -FcPatternBuild (FcPattern *p, ...) FC_ATTRIBUTE_SENTINEL(0); - -FcPublic FcChar8 * -FcPatternFormat (FcPattern *pat, const FcChar8 *format); - -/* fcstr.c */ - -FcPublic FcChar8 * -FcStrCopy (const FcChar8 *s); - -FcPublic FcChar8 * -FcStrCopyFilename (const FcChar8 *s); - -FcPublic FcChar8 * -FcStrPlus (const FcChar8 *s1, const FcChar8 *s2); - -FcPublic void -FcStrFree (FcChar8 *s); - -/* These are ASCII only, suitable only for pattern element names */ -#define FcIsUpper(c) ((0101 <= (c) && (c) <= 0132)) -#define FcIsLower(c) ((0141 <= (c) && (c) <= 0172)) -#define FcToLower(c) (FcIsUpper(c) ? (c) - 0101 + 0141 : (c)) - -FcPublic FcChar8 * -FcStrDowncase (const FcChar8 *s); - -FcPublic int -FcStrCmpIgnoreCase (const FcChar8 *s1, const FcChar8 *s2); - -FcPublic int -FcStrCmp (const FcChar8 *s1, const FcChar8 *s2); - -FcPublic const FcChar8 * -FcStrStrIgnoreCase (const FcChar8 *s1, const FcChar8 *s2); - -FcPublic const FcChar8 * -FcStrStr (const FcChar8 *s1, const FcChar8 *s2); - -FcPublic int -FcUtf8ToUcs4 (const FcChar8 *src_orig, - FcChar32 *dst, - int len); - -FcPublic FcBool -FcUtf8Len (const FcChar8 *string, - int len, - int *nchar, - int *wchar); - -#define FC_UTF8_MAX_LEN 6 - -FcPublic int -FcUcs4ToUtf8 (FcChar32 ucs4, - FcChar8 dest[FC_UTF8_MAX_LEN]); - -FcPublic int -FcUtf16ToUcs4 (const FcChar8 *src_orig, - FcEndian endian, - FcChar32 *dst, - int len); /* in bytes */ - -FcPublic FcBool -FcUtf16Len (const FcChar8 *string, - FcEndian endian, - int len, /* in bytes */ - int *nchar, - int *wchar); - -FcPublic FcChar8 * -FcStrDirname (const FcChar8 *file); - -FcPublic FcChar8 * -FcStrBasename (const FcChar8 *file); - -FcPublic FcStrSet * -FcStrSetCreate (void); - -FcPublic FcBool -FcStrSetMember (FcStrSet *set, const FcChar8 *s); - -FcPublic FcBool -FcStrSetEqual (FcStrSet *sa, FcStrSet *sb); - -FcPublic FcBool -FcStrSetAdd (FcStrSet *set, const FcChar8 *s); - -FcPublic FcBool -FcStrSetAddFilename (FcStrSet *set, const FcChar8 *s); - -FcPublic FcBool -FcStrSetDel (FcStrSet *set, const FcChar8 *s); - -FcPublic void -FcStrSetDestroy (FcStrSet *set); - -FcPublic FcStrList * -FcStrListCreate (FcStrSet *set); - -FcPublic FcChar8 * -FcStrListNext (FcStrList *list); - -FcPublic void -FcStrListDone (FcStrList *list); - -/* fcxml.c */ -FcPublic FcBool -FcConfigParseAndLoad (FcConfig *config, const FcChar8 *file, FcBool complain); - -_FCFUNCPROTOEND - -#undef FC_ATTRIBUTE_SENTINEL - - -#ifndef _FCINT_H_ - -/* - * Deprecated functions are placed here to help users fix their code without - * digging through documentation - */ - -#define FcConfigGetRescanInverval FcConfigGetRescanInverval_REPLACE_BY_FcConfigGetRescanInterval -#define FcConfigSetRescanInverval FcConfigSetRescanInverval_REPLACE_BY_FcConfigSetRescanInterval - -#endif - -#endif /* _FONTCONFIG_H_ */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/config/ftconfig-32.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/config/ftconfig-32.h deleted file mode 100644 index 69aba71f86..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/config/ftconfig-32.h +++ /dev/null @@ -1,545 +0,0 @@ -/* ftconfig.h. Generated from ftconfig.in by configure. */ -/***************************************************************************/ -/* */ -/* ftconfig.in */ -/* */ -/* UNIX-specific configuration file (specification only). */ -/* */ -/* Copyright 1996-2004, 2006-2009, 2011 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - - /*************************************************************************/ - /* */ - /* This header file contains a number of macro definitions that are used */ - /* by the rest of the engine. Most of the macros here are automatically */ - /* determined at compile time, and you should not need to change it to */ - /* port FreeType, except to compile the library with a non-ANSI */ - /* compiler. */ - /* */ - /* Note however that if some specific modifications are needed, we */ - /* advise you to place a modified copy in your build directory. */ - /* */ - /* The build directory is usually `freetype/builds/<system>', and */ - /* contains system-specific files that are always included first when */ - /* building the library. */ - /* */ - /*************************************************************************/ - - -#ifndef __FTCONFIG_H__ -#define __FTCONFIG_H__ - -#include <ft2build.h> -#include FT_CONFIG_OPTIONS_H -#include FT_CONFIG_STANDARD_LIBRARY_H - - -FT_BEGIN_HEADER - - - /*************************************************************************/ - /* */ - /* PLATFORM-SPECIFIC CONFIGURATION MACROS */ - /* */ - /* These macros can be toggled to suit a specific system. The current */ - /* ones are defaults used to compile FreeType in an ANSI C environment */ - /* (16bit compilers are also supported). Copy this file to your own */ - /* `freetype/builds/<system>' directory, and edit it to port the engine. */ - /* */ - /*************************************************************************/ - - -#define HAVE_UNISTD_H 1 -#define HAVE_FCNTL_H 1 -#define HAVE_STDINT_H 1 - - - /* There are systems (like the Texas Instruments 'C54x) where a `char' */ - /* has 16 bits. ANSI C says that sizeof(char) is always 1. Since an */ - /* `int' has 16 bits also for this system, sizeof(int) gives 1 which */ - /* is probably unexpected. */ - /* */ - /* `CHAR_BIT' (defined in limits.h) gives the number of bits in a */ - /* `char' type. */ - -#ifndef FT_CHAR_BIT -#define FT_CHAR_BIT CHAR_BIT -#endif - - -/* #undef FT_USE_AUTOCONF_SIZEOF_TYPES */ -#ifdef FT_USE_AUTOCONF_SIZEOF_TYPES - -#define SIZEOF_INT 4 -#define SIZEOF_LONG 4 -#define FT_SIZEOF_INT SIZEOF_INT -#define FT_SIZEOF_LONG SIZEOF_LONG - -#else /* !FT_USE_AUTOCONF_SIZEOF_TYPES */ - - /* Following cpp computation of the bit length of int and long */ - /* is copied from default include/freetype/config/ftconfig.h. */ - /* If any improvement is required for this file, it should be */ - /* applied to the original header file for the builders that */ - /* does not use configure script. */ - - /* The size of an `int' type. */ -#if FT_UINT_MAX == 0xFFFFUL -#define FT_SIZEOF_INT (16 / FT_CHAR_BIT) -#elif FT_UINT_MAX == 0xFFFFFFFFUL -#define FT_SIZEOF_INT (32 / FT_CHAR_BIT) -#elif FT_UINT_MAX > 0xFFFFFFFFUL && FT_UINT_MAX == 0xFFFFFFFFFFFFFFFFUL -#define FT_SIZEOF_INT (64 / FT_CHAR_BIT) -#else -#error "Unsupported size of `int' type!" -#endif - - /* The size of a `long' type. A five-byte `long' (as used e.g. on the */ - /* DM642) is recognized but avoided. */ -#if FT_ULONG_MAX == 0xFFFFFFFFUL -#define FT_SIZEOF_LONG (32 / FT_CHAR_BIT) -#elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFUL -#define FT_SIZEOF_LONG (32 / FT_CHAR_BIT) -#elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFFFFFFFUL -#define FT_SIZEOF_LONG (64 / FT_CHAR_BIT) -#else -#error "Unsupported size of `long' type!" -#endif - -#endif /* !FT_USE_AUTOCONF_SIZEOF_TYPES */ - - - /* FT_UNUSED is a macro used to indicate that a given parameter is not */ - /* used -- this is only used to get rid of unpleasant compiler warnings */ -#ifndef FT_UNUSED -#define FT_UNUSED( arg ) ( (arg) = (arg) ) -#endif - - - /*************************************************************************/ - /* */ - /* AUTOMATIC CONFIGURATION MACROS */ - /* */ - /* These macros are computed from the ones defined above. Don't touch */ - /* their definition, unless you know precisely what you are doing. No */ - /* porter should need to mess with them. */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* Mac support */ - /* */ - /* This is the only necessary change, so it is defined here instead */ - /* providing a new configuration file. */ - /* */ -#if defined( __APPLE__ ) || ( defined( __MWERKS__ ) && defined( macintosh ) ) - /* no Carbon frameworks for 64bit 10.4.x */ - /* AvailabilityMacros.h is available since Mac OS X 10.2, */ - /* so guess the system version by maximum errno before inclusion */ -#include <errno.h> -#ifdef ECANCELED /* defined since 10.2 */ -#include "AvailabilityMacros.h" -#endif -#if defined( __LP64__ ) && \ - ( MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 ) -#undef FT_MACINTOSH -#endif - -#elif defined( __SC__ ) || defined( __MRC__ ) - /* Classic MacOS compilers */ -#include "ConditionalMacros.h" -#if TARGET_OS_MAC -#define FT_MACINTOSH 1 -#endif - -#endif - - - /* Fix compiler warning with sgi compiler */ -#if defined( __sgi ) && !defined( __GNUC__ ) -#if defined( _COMPILER_VERSION ) && ( _COMPILER_VERSION >= 730 ) -#pragma set woff 3505 -#endif -#endif - - - /*************************************************************************/ - /* */ - /* IntN types */ - /* */ - /* Used to guarantee the size of some specific integers. */ - /* */ - typedef signed short FT_Int16; - typedef unsigned short FT_UInt16; - -#if FT_SIZEOF_INT == 4 - - typedef signed int FT_Int32; - typedef unsigned int FT_UInt32; - -#elif FT_SIZEOF_LONG == 4 - - typedef signed long FT_Int32; - typedef unsigned long FT_UInt32; - -#else -#error "no 32bit type found -- please check your configuration files" -#endif - - - /* look up an integer type that is at least 32 bits */ -#if FT_SIZEOF_INT >= 4 - - typedef int FT_Fast; - typedef unsigned int FT_UFast; - -#elif FT_SIZEOF_LONG >= 4 - - typedef long FT_Fast; - typedef unsigned long FT_UFast; - -#endif - - - /* determine whether we have a 64-bit int type for platforms without */ - /* Autoconf */ -#if FT_SIZEOF_LONG == 8 - - /* FT_LONG64 must be defined if a 64-bit type is available */ -#define FT_LONG64 -#define FT_INT64 long - -#elif defined( _MSC_VER ) && _MSC_VER >= 900 /* Visual C++ (and Intel C++) */ - - /* this compiler provides the __int64 type */ -#define FT_LONG64 -#define FT_INT64 __int64 - -#elif defined( __BORLANDC__ ) /* Borland C++ */ - - /* XXXX: We should probably check the value of __BORLANDC__ in order */ - /* to test the compiler version. */ - - /* this compiler provides the __int64 type */ -#define FT_LONG64 -#define FT_INT64 __int64 - -#elif defined( __WATCOMC__ ) /* Watcom C++ */ - - /* Watcom doesn't provide 64-bit data types */ - -#elif defined( __MWERKS__ ) /* Metrowerks CodeWarrior */ - -#define FT_LONG64 -#define FT_INT64 long long int - -#elif defined( __GNUC__ ) - - /* GCC provides the `long long' type */ -#define FT_LONG64 -#define FT_INT64 long long int - -#endif /* FT_SIZEOF_LONG == 8 */ - - - /*************************************************************************/ - /* */ - /* A 64-bit data type will create compilation problems if you compile */ - /* in strict ANSI mode. To avoid them, we disable its use if __STDC__ */ - /* is defined. You can however ignore this rule by defining the */ - /* FT_CONFIG_OPTION_FORCE_INT64 configuration macro. */ - /* */ -#if defined( FT_LONG64 ) && !defined( FT_CONFIG_OPTION_FORCE_INT64 ) - -#ifdef __STDC__ - - /* Undefine the 64-bit macros in strict ANSI compilation mode. */ - /* Since `#undef' doesn't survive in configuration header files */ - /* we use the postprocessing facility of AC_CONFIG_HEADERS to */ - /* replace the leading `/' with `#'. */ -#undef FT_LONG64 -#undef FT_INT64 - -#endif /* __STDC__ */ - -#endif /* FT_LONG64 && !FT_CONFIG_OPTION_FORCE_INT64 */ - - -#define FT_BEGIN_STMNT do { -#define FT_END_STMNT } while ( 0 ) -#define FT_DUMMY_STMNT FT_BEGIN_STMNT FT_END_STMNT - - -#ifndef FT_CONFIG_OPTION_NO_ASSEMBLER - /* Provide assembler fragments for performance-critical functions. */ - /* These must be defined `static __inline__' with GCC. */ - -#if defined( __CC_ARM ) || defined( __ARMCC__ ) /* RVCT */ -#define FT_MULFIX_ASSEMBLER FT_MulFix_arm - - /* documentation is in freetype.h */ - - static __inline FT_Int32 - FT_MulFix_arm( FT_Int32 a, - FT_Int32 b ) - { - register FT_Int32 t, t2; - - - __asm - { - smull t2, t, b, a /* (lo=t2,hi=t) = a*b */ - mov a, t, asr #31 /* a = (hi >> 31) */ - add a, a, #0x8000 /* a += 0x8000 */ - adds t2, t2, a /* t2 += a */ - adc t, t, #0 /* t += carry */ - mov a, t2, lsr #16 /* a = t2 >> 16 */ - orr a, a, t, lsl #16 /* a |= t << 16 */ - } - return a; - } - -#endif /* __CC_ARM || __ARMCC__ */ - - -#ifdef __GNUC__ - -#if defined( __arm__ ) && !defined( __thumb__ ) && \ - !( defined( __CC_ARM ) || defined( __ARMCC__ ) ) -#define FT_MULFIX_ASSEMBLER FT_MulFix_arm - - /* documentation is in freetype.h */ - - static __inline__ FT_Int32 - FT_MulFix_arm( FT_Int32 a, - FT_Int32 b ) - { - register FT_Int32 t, t2; - - - __asm__ __volatile__ ( - "smull %1, %2, %4, %3\n\t" /* (lo=%1,hi=%2) = a*b */ - "mov %0, %2, asr #31\n\t" /* %0 = (hi >> 31) */ - "add %0, %0, #0x8000\n\t" /* %0 += 0x8000 */ - "adds %1, %1, %0\n\t" /* %1 += %0 */ - "adc %2, %2, #0\n\t" /* %2 += carry */ - "mov %0, %1, lsr #16\n\t" /* %0 = %1 >> 16 */ - "orr %0, %0, %2, lsl #16\n\t" /* %0 |= %2 << 16 */ - : "=r"(a), "=&r"(t2), "=&r"(t) - : "r"(a), "r"(b) ); - return a; - } - -#endif /* __arm__ && !__thumb__ && !( __CC_ARM || __ARMCC__ ) */ - -#if defined( __i386__ ) -#define FT_MULFIX_ASSEMBLER FT_MulFix_i386 - - /* documentation is in freetype.h */ - - static __inline__ FT_Int32 - FT_MulFix_i386( FT_Int32 a, - FT_Int32 b ) - { - register FT_Int32 result; - - - __asm__ __volatile__ ( - "imul %%edx\n" - "movl %%edx, %%ecx\n" - "sarl $31, %%ecx\n" - "addl $0x8000, %%ecx\n" - "addl %%ecx, %%eax\n" - "adcl $0, %%edx\n" - "shrl $16, %%eax\n" - "shll $16, %%edx\n" - "addl %%edx, %%eax\n" - : "=a"(result), "=d"(b) - : "a"(a), "d"(b) - : "%ecx", "cc" ); - return result; - } - -#endif /* i386 */ - -#endif /* __GNUC__ */ - - -#ifdef _MSC_VER /* Visual C++ */ - -#ifdef _M_IX86 - -#define FT_MULFIX_ASSEMBLER FT_MulFix_i386 - - /* documentation is in freetype.h */ - - static __inline FT_Int32 - FT_MulFix_i386( FT_Int32 a, - FT_Int32 b ) - { - register FT_Int32 result; - - __asm - { - mov eax, a - mov edx, b - imul edx - mov ecx, edx - sar ecx, 31 - add ecx, 8000h - add eax, ecx - adc edx, 0 - shr eax, 16 - shl edx, 16 - add eax, edx - mov result, eax - } - return result; - } - -#endif /* _M_IX86 */ - -#endif /* _MSC_VER */ - -#endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */ - - -#ifdef FT_CONFIG_OPTION_INLINE_MULFIX -#ifdef FT_MULFIX_ASSEMBLER -#define FT_MULFIX_INLINED FT_MULFIX_ASSEMBLER -#endif -#endif - - -#ifdef FT_MAKE_OPTION_SINGLE_OBJECT - -#define FT_LOCAL( x ) static x -#define FT_LOCAL_DEF( x ) static x - -#else - -#ifdef __cplusplus -#define FT_LOCAL( x ) extern "C" x -#define FT_LOCAL_DEF( x ) extern "C" x -#else -#define FT_LOCAL( x ) extern x -#define FT_LOCAL_DEF( x ) x -#endif - -#endif /* FT_MAKE_OPTION_SINGLE_OBJECT */ - - -#ifndef FT_BASE - -#ifdef __cplusplus -#define FT_BASE( x ) extern "C" x -#else -#define FT_BASE( x ) extern x -#endif - -#endif /* !FT_BASE */ - - -#ifndef FT_BASE_DEF - -#ifdef __cplusplus -#define FT_BASE_DEF( x ) x -#else -#define FT_BASE_DEF( x ) x -#endif - -#endif /* !FT_BASE_DEF */ - - -#ifndef FT_EXPORT - -#ifdef __cplusplus -#define FT_EXPORT( x ) extern "C" x -#else -#define FT_EXPORT( x ) extern x -#endif - -#endif /* !FT_EXPORT */ - - -#ifndef FT_EXPORT_DEF - -#ifdef __cplusplus -#define FT_EXPORT_DEF( x ) extern "C" x -#else -#define FT_EXPORT_DEF( x ) extern x -#endif - -#endif /* !FT_EXPORT_DEF */ - - -#ifndef FT_EXPORT_VAR - -#ifdef __cplusplus -#define FT_EXPORT_VAR( x ) extern "C" x -#else -#define FT_EXPORT_VAR( x ) extern x -#endif - -#endif /* !FT_EXPORT_VAR */ - - /* The following macros are needed to compile the library with a */ - /* C++ compiler and with 16bit compilers. */ - /* */ - - /* This is special. Within C++, you must specify `extern "C"' for */ - /* functions which are used via function pointers, and you also */ - /* must do that for structures which contain function pointers to */ - /* assure C linkage -- it's not possible to have (local) anonymous */ - /* functions which are accessed by (global) function pointers. */ - /* */ - /* */ - /* FT_CALLBACK_DEF is used to _define_ a callback function. */ - /* */ - /* FT_CALLBACK_TABLE is used to _declare_ a constant variable that */ - /* contains pointers to callback functions. */ - /* */ - /* FT_CALLBACK_TABLE_DEF is used to _define_ a constant variable */ - /* that contains pointers to callback functions. */ - /* */ - /* */ - /* Some 16bit compilers have to redefine these macros to insert */ - /* the infamous `_cdecl' or `__fastcall' declarations. */ - /* */ -#ifndef FT_CALLBACK_DEF -#ifdef __cplusplus -#define FT_CALLBACK_DEF( x ) extern "C" x -#else -#define FT_CALLBACK_DEF( x ) static x -#endif -#endif /* FT_CALLBACK_DEF */ - -#ifndef FT_CALLBACK_TABLE -#ifdef __cplusplus -#define FT_CALLBACK_TABLE extern "C" -#define FT_CALLBACK_TABLE_DEF extern "C" -#else -#define FT_CALLBACK_TABLE extern -#define FT_CALLBACK_TABLE_DEF /* nothing */ -#endif -#endif /* FT_CALLBACK_TABLE */ - - -FT_END_HEADER - - -#endif /* __FTCONFIG_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/config/ftconfig.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/config/ftconfig.h deleted file mode 100644 index 06f743e734..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/config/ftconfig.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef __FTCONFIG_H__MULTILIB -#define __FTCONFIG_H__MULTILIB - -#include <bits/wordsize.h> - -#if __WORDSIZE == 32 -# include "ftconfig-32.h" -#elif __WORDSIZE == 64 -# include "ftconfig-64.h" -#else -# error "unexpected value for __WORDSIZE macro" -#endif - -#endif diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/config/ftheader.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/config/ftheader.h deleted file mode 100644 index 2a7b8c4e0d..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/config/ftheader.h +++ /dev/null @@ -1,793 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftheader.h */ -/* */ -/* Build macros of the FreeType 2 library. */ -/* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - -#ifndef __FT_HEADER_H__ -#define __FT_HEADER_H__ - - - /*@***********************************************************************/ - /* */ - /* <Macro> */ - /* FT_BEGIN_HEADER */ - /* */ - /* <Description> */ - /* This macro is used in association with @FT_END_HEADER in header */ - /* files to ensure that the declarations within are properly */ - /* encapsulated in an `extern "C" { .. }' block when included from a */ - /* C++ compiler. */ - /* */ -#ifdef __cplusplus -#define FT_BEGIN_HEADER extern "C" { -#else -#define FT_BEGIN_HEADER /* nothing */ -#endif - - - /*@***********************************************************************/ - /* */ - /* <Macro> */ - /* FT_END_HEADER */ - /* */ - /* <Description> */ - /* This macro is used in association with @FT_BEGIN_HEADER in header */ - /* files to ensure that the declarations within are properly */ - /* encapsulated in an `extern "C" { .. }' block when included from a */ - /* C++ compiler. */ - /* */ -#ifdef __cplusplus -#define FT_END_HEADER } -#else -#define FT_END_HEADER /* nothing */ -#endif - - - /*************************************************************************/ - /* */ - /* Aliases for the FreeType 2 public and configuration files. */ - /* */ - /*************************************************************************/ - - /*************************************************************************/ - /* */ - /* <Section> */ - /* header_file_macros */ - /* */ - /* <Title> */ - /* Header File Macros */ - /* */ - /* <Abstract> */ - /* Macro definitions used to #include specific header files. */ - /* */ - /* <Description> */ - /* The following macros are defined to the name of specific */ - /* FreeType~2 header files. They can be used directly in #include */ - /* statements as in: */ - /* */ - /* { */ - /* #include FT_FREETYPE_H */ - /* #include FT_MULTIPLE_MASTERS_H */ - /* #include FT_GLYPH_H */ - /* } */ - /* */ - /* There are several reasons why we are now using macros to name */ - /* public header files. The first one is that such macros are not */ - /* limited to the infamous 8.3~naming rule required by DOS (and */ - /* `FT_MULTIPLE_MASTERS_H' is a lot more meaningful than `ftmm.h'). */ - /* */ - /* The second reason is that it allows for more flexibility in the */ - /* way FreeType~2 is installed on a given system. */ - /* */ - /*************************************************************************/ - - - /* configuration files */ - - /************************************************************************* - * - * @macro: - * FT_CONFIG_CONFIG_H - * - * @description: - * A macro used in #include statements to name the file containing - * FreeType~2 configuration data. - * - */ -#ifndef FT_CONFIG_CONFIG_H -#define FT_CONFIG_CONFIG_H <freetype/config/ftconfig.h> -#endif - - - /************************************************************************* - * - * @macro: - * FT_CONFIG_STANDARD_LIBRARY_H - * - * @description: - * A macro used in #include statements to name the file containing - * FreeType~2 interface to the standard C library functions. - * - */ -#ifndef FT_CONFIG_STANDARD_LIBRARY_H -#define FT_CONFIG_STANDARD_LIBRARY_H <freetype/config/ftstdlib.h> -#endif - - - /************************************************************************* - * - * @macro: - * FT_CONFIG_OPTIONS_H - * - * @description: - * A macro used in #include statements to name the file containing - * FreeType~2 project-specific configuration options. - * - */ -#ifndef FT_CONFIG_OPTIONS_H -#define FT_CONFIG_OPTIONS_H <freetype/config/ftoption.h> -#endif - - - /************************************************************************* - * - * @macro: - * FT_CONFIG_MODULES_H - * - * @description: - * A macro used in #include statements to name the file containing the - * list of FreeType~2 modules that are statically linked to new library - * instances in @FT_Init_FreeType. - * - */ -#ifndef FT_CONFIG_MODULES_H -#define FT_CONFIG_MODULES_H <freetype/config/ftmodule.h> -#endif - - /* */ - - /* public headers */ - - /************************************************************************* - * - * @macro: - * FT_FREETYPE_H - * - * @description: - * A macro used in #include statements to name the file containing the - * base FreeType~2 API. - * - */ -#define FT_FREETYPE_H <freetype/freetype.h> - - - /************************************************************************* - * - * @macro: - * FT_ERRORS_H - * - * @description: - * A macro used in #include statements to name the file containing the - * list of FreeType~2 error codes (and messages). - * - * It is included by @FT_FREETYPE_H. - * - */ -#define FT_ERRORS_H <freetype/fterrors.h> - - - /************************************************************************* - * - * @macro: - * FT_MODULE_ERRORS_H - * - * @description: - * A macro used in #include statements to name the file containing the - * list of FreeType~2 module error offsets (and messages). - * - */ -#define FT_MODULE_ERRORS_H <freetype/ftmoderr.h> - - - /************************************************************************* - * - * @macro: - * FT_SYSTEM_H - * - * @description: - * A macro used in #include statements to name the file containing the - * FreeType~2 interface to low-level operations (i.e., memory management - * and stream i/o). - * - * It is included by @FT_FREETYPE_H. - * - */ -#define FT_SYSTEM_H <freetype/ftsystem.h> - - - /************************************************************************* - * - * @macro: - * FT_IMAGE_H - * - * @description: - * A macro used in #include statements to name the file containing type - * definitions related to glyph images (i.e., bitmaps, outlines, - * scan-converter parameters). - * - * It is included by @FT_FREETYPE_H. - * - */ -#define FT_IMAGE_H <freetype/ftimage.h> - - - /************************************************************************* - * - * @macro: - * FT_TYPES_H - * - * @description: - * A macro used in #include statements to name the file containing the - * basic data types defined by FreeType~2. - * - * It is included by @FT_FREETYPE_H. - * - */ -#define FT_TYPES_H <freetype/fttypes.h> - - - /************************************************************************* - * - * @macro: - * FT_LIST_H - * - * @description: - * A macro used in #include statements to name the file containing the - * list management API of FreeType~2. - * - * (Most applications will never need to include this file.) - * - */ -#define FT_LIST_H <freetype/ftlist.h> - - - /************************************************************************* - * - * @macro: - * FT_OUTLINE_H - * - * @description: - * A macro used in #include statements to name the file containing the - * scalable outline management API of FreeType~2. - * - */ -#define FT_OUTLINE_H <freetype/ftoutln.h> - - - /************************************************************************* - * - * @macro: - * FT_SIZES_H - * - * @description: - * A macro used in #include statements to name the file containing the - * API which manages multiple @FT_Size objects per face. - * - */ -#define FT_SIZES_H <freetype/ftsizes.h> - - - /************************************************************************* - * - * @macro: - * FT_MODULE_H - * - * @description: - * A macro used in #include statements to name the file containing the - * module management API of FreeType~2. - * - */ -#define FT_MODULE_H <freetype/ftmodapi.h> - - - /************************************************************************* - * - * @macro: - * FT_RENDER_H - * - * @description: - * A macro used in #include statements to name the file containing the - * renderer module management API of FreeType~2. - * - */ -#define FT_RENDER_H <freetype/ftrender.h> - - - /************************************************************************* - * - * @macro: - * FT_TYPE1_TABLES_H - * - * @description: - * A macro used in #include statements to name the file containing the - * types and API specific to the Type~1 format. - * - */ -#define FT_TYPE1_TABLES_H <freetype/t1tables.h> - - - /************************************************************************* - * - * @macro: - * FT_TRUETYPE_IDS_H - * - * @description: - * A macro used in #include statements to name the file containing the - * enumeration values which identify name strings, languages, encodings, - * etc. This file really contains a _large_ set of constant macro - * definitions, taken from the TrueType and OpenType specifications. - * - */ -#define FT_TRUETYPE_IDS_H <freetype/ttnameid.h> - - - /************************************************************************* - * - * @macro: - * FT_TRUETYPE_TABLES_H - * - * @description: - * A macro used in #include statements to name the file containing the - * types and API specific to the TrueType (as well as OpenType) format. - * - */ -#define FT_TRUETYPE_TABLES_H <freetype/tttables.h> - - - /************************************************************************* - * - * @macro: - * FT_TRUETYPE_TAGS_H - * - * @description: - * A macro used in #include statements to name the file containing the - * definitions of TrueType four-byte `tags' which identify blocks in - * SFNT-based font formats (i.e., TrueType and OpenType). - * - */ -#define FT_TRUETYPE_TAGS_H <freetype/tttags.h> - - - /************************************************************************* - * - * @macro: - * FT_BDF_H - * - * @description: - * A macro used in #include statements to name the file containing the - * definitions of an API which accesses BDF-specific strings from a - * face. - * - */ -#define FT_BDF_H <freetype/ftbdf.h> - - - /************************************************************************* - * - * @macro: - * FT_CID_H - * - * @description: - * A macro used in #include statements to name the file containing the - * definitions of an API which access CID font information from a - * face. - * - */ -#define FT_CID_H <freetype/ftcid.h> - - - /************************************************************************* - * - * @macro: - * FT_GZIP_H - * - * @description: - * A macro used in #include statements to name the file containing the - * definitions of an API which supports gzip-compressed files. - * - */ -#define FT_GZIP_H <freetype/ftgzip.h> - - - /************************************************************************* - * - * @macro: - * FT_LZW_H - * - * @description: - * A macro used in #include statements to name the file containing the - * definitions of an API which supports LZW-compressed files. - * - */ -#define FT_LZW_H <freetype/ftlzw.h> - - - /************************************************************************* - * - * @macro: - * FT_BZIP2_H - * - * @description: - * A macro used in #include statements to name the file containing the - * definitions of an API which supports bzip2-compressed files. - * - */ -#define FT_BZIP2_H <freetype/ftbzip2.h> - - - /************************************************************************* - * - * @macro: - * FT_WINFONTS_H - * - * @description: - * A macro used in #include statements to name the file containing the - * definitions of an API which supports Windows FNT files. - * - */ -#define FT_WINFONTS_H <freetype/ftwinfnt.h> - - - /************************************************************************* - * - * @macro: - * FT_GLYPH_H - * - * @description: - * A macro used in #include statements to name the file containing the - * API of the optional glyph management component. - * - */ -#define FT_GLYPH_H <freetype/ftglyph.h> - - - /************************************************************************* - * - * @macro: - * FT_BITMAP_H - * - * @description: - * A macro used in #include statements to name the file containing the - * API of the optional bitmap conversion component. - * - */ -#define FT_BITMAP_H <freetype/ftbitmap.h> - - - /************************************************************************* - * - * @macro: - * FT_BBOX_H - * - * @description: - * A macro used in #include statements to name the file containing the - * API of the optional exact bounding box computation routines. - * - */ -#define FT_BBOX_H <freetype/ftbbox.h> - - - /************************************************************************* - * - * @macro: - * FT_CACHE_H - * - * @description: - * A macro used in #include statements to name the file containing the - * API of the optional FreeType~2 cache sub-system. - * - */ -#define FT_CACHE_H <freetype/ftcache.h> - - - /************************************************************************* - * - * @macro: - * FT_CACHE_IMAGE_H - * - * @description: - * A macro used in #include statements to name the file containing the - * `glyph image' API of the FreeType~2 cache sub-system. - * - * It is used to define a cache for @FT_Glyph elements. You can also - * use the API defined in @FT_CACHE_SMALL_BITMAPS_H if you only need to - * store small glyph bitmaps, as it will use less memory. - * - * This macro is deprecated. Simply include @FT_CACHE_H to have all - * glyph image-related cache declarations. - * - */ -#define FT_CACHE_IMAGE_H FT_CACHE_H - - - /************************************************************************* - * - * @macro: - * FT_CACHE_SMALL_BITMAPS_H - * - * @description: - * A macro used in #include statements to name the file containing the - * `small bitmaps' API of the FreeType~2 cache sub-system. - * - * It is used to define a cache for small glyph bitmaps in a relatively - * memory-efficient way. You can also use the API defined in - * @FT_CACHE_IMAGE_H if you want to cache arbitrary glyph images, - * including scalable outlines. - * - * This macro is deprecated. Simply include @FT_CACHE_H to have all - * small bitmaps-related cache declarations. - * - */ -#define FT_CACHE_SMALL_BITMAPS_H FT_CACHE_H - - - /************************************************************************* - * - * @macro: - * FT_CACHE_CHARMAP_H - * - * @description: - * A macro used in #include statements to name the file containing the - * `charmap' API of the FreeType~2 cache sub-system. - * - * This macro is deprecated. Simply include @FT_CACHE_H to have all - * charmap-based cache declarations. - * - */ -#define FT_CACHE_CHARMAP_H FT_CACHE_H - - - /************************************************************************* - * - * @macro: - * FT_MAC_H - * - * @description: - * A macro used in #include statements to name the file containing the - * Macintosh-specific FreeType~2 API. The latter is used to access - * fonts embedded in resource forks. - * - * This header file must be explicitly included by client applications - * compiled on the Mac (note that the base API still works though). - * - */ -#define FT_MAC_H <freetype/ftmac.h> - - - /************************************************************************* - * - * @macro: - * FT_MULTIPLE_MASTERS_H - * - * @description: - * A macro used in #include statements to name the file containing the - * optional multiple-masters management API of FreeType~2. - * - */ -#define FT_MULTIPLE_MASTERS_H <freetype/ftmm.h> - - - /************************************************************************* - * - * @macro: - * FT_SFNT_NAMES_H - * - * @description: - * A macro used in #include statements to name the file containing the - * optional FreeType~2 API which accesses embedded `name' strings in - * SFNT-based font formats (i.e., TrueType and OpenType). - * - */ -#define FT_SFNT_NAMES_H <freetype/ftsnames.h> - - - /************************************************************************* - * - * @macro: - * FT_OPENTYPE_VALIDATE_H - * - * @description: - * A macro used in #include statements to name the file containing the - * optional FreeType~2 API which validates OpenType tables (BASE, GDEF, - * GPOS, GSUB, JSTF). - * - */ -#define FT_OPENTYPE_VALIDATE_H <freetype/ftotval.h> - - - /************************************************************************* - * - * @macro: - * FT_GX_VALIDATE_H - * - * @description: - * A macro used in #include statements to name the file containing the - * optional FreeType~2 API which validates TrueTypeGX/AAT tables (feat, - * mort, morx, bsln, just, kern, opbd, trak, prop). - * - */ -#define FT_GX_VALIDATE_H <freetype/ftgxval.h> - - - /************************************************************************* - * - * @macro: - * FT_PFR_H - * - * @description: - * A macro used in #include statements to name the file containing the - * FreeType~2 API which accesses PFR-specific data. - * - */ -#define FT_PFR_H <freetype/ftpfr.h> - - - /************************************************************************* - * - * @macro: - * FT_STROKER_H - * - * @description: - * A macro used in #include statements to name the file containing the - * FreeType~2 API which provides functions to stroke outline paths. - */ -#define FT_STROKER_H <freetype/ftstroke.h> - - - /************************************************************************* - * - * @macro: - * FT_SYNTHESIS_H - * - * @description: - * A macro used in #include statements to name the file containing the - * FreeType~2 API which performs artificial obliquing and emboldening. - */ -#define FT_SYNTHESIS_H <freetype/ftsynth.h> - - - /************************************************************************* - * - * @macro: - * FT_XFREE86_H - * - * @description: - * A macro used in #include statements to name the file containing the - * FreeType~2 API which provides functions specific to the XFree86 and - * X.Org X11 servers. - */ -#define FT_XFREE86_H <freetype/ftxf86.h> - - - /************************************************************************* - * - * @macro: - * FT_TRIGONOMETRY_H - * - * @description: - * A macro used in #include statements to name the file containing the - * FreeType~2 API which performs trigonometric computations (e.g., - * cosines and arc tangents). - */ -#define FT_TRIGONOMETRY_H <freetype/fttrigon.h> - - - /************************************************************************* - * - * @macro: - * FT_LCD_FILTER_H - * - * @description: - * A macro used in #include statements to name the file containing the - * FreeType~2 API which performs color filtering for subpixel rendering. - */ -#define FT_LCD_FILTER_H <freetype/ftlcdfil.h> - - - /************************************************************************* - * - * @macro: - * FT_UNPATENTED_HINTING_H - * - * @description: - * A macro used in #include statements to name the file containing the - * FreeType~2 API which performs color filtering for subpixel rendering. - */ -#define FT_UNPATENTED_HINTING_H <freetype/ttunpat.h> - - - /************************************************************************* - * - * @macro: - * FT_INCREMENTAL_H - * - * @description: - * A macro used in #include statements to name the file containing the - * FreeType~2 API which performs color filtering for subpixel rendering. - */ -#define FT_INCREMENTAL_H <freetype/ftincrem.h> - - - /************************************************************************* - * - * @macro: - * FT_GASP_H - * - * @description: - * A macro used in #include statements to name the file containing the - * FreeType~2 API which returns entries from the TrueType GASP table. - */ -#define FT_GASP_H <freetype/ftgasp.h> - - - /************************************************************************* - * - * @macro: - * FT_ADVANCES_H - * - * @description: - * A macro used in #include statements to name the file containing the - * FreeType~2 API which returns individual and ranged glyph advances. - */ -#define FT_ADVANCES_H <freetype/ftadvanc.h> - - - /* */ - -#define FT_ERROR_DEFINITIONS_H <freetype/fterrdef.h> - - - /* The internals of the cache sub-system are no longer exposed. We */ - /* default to FT_CACHE_H at the moment just in case, but we know of */ - /* no rogue client that uses them. */ - /* */ -#define FT_CACHE_MANAGER_H <freetype/ftcache.h> -#define FT_CACHE_INTERNAL_MRU_H <freetype/ftcache.h> -#define FT_CACHE_INTERNAL_MANAGER_H <freetype/ftcache.h> -#define FT_CACHE_INTERNAL_CACHE_H <freetype/ftcache.h> -#define FT_CACHE_INTERNAL_GLYPH_H <freetype/ftcache.h> -#define FT_CACHE_INTERNAL_IMAGE_H <freetype/ftcache.h> -#define FT_CACHE_INTERNAL_SBITS_H <freetype/ftcache.h> - - -#define FT_INCREMENTAL_H <freetype/ftincrem.h> - -#define FT_TRUETYPE_UNPATENTED_H <freetype/ttunpat.h> - - - /* - * Include internal headers definitions from <freetype/internal/...> - * only when building the library. - */ -#ifdef FT2_BUILD_LIBRARY -#define FT_INTERNAL_INTERNAL_H <freetype/internal/internal.h> -#include FT_INTERNAL_INTERNAL_H -#endif /* FT2_BUILD_LIBRARY */ - - -#endif /* __FT2_BUILD_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/config/ftmodule.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/config/ftmodule.h deleted file mode 100644 index b7299779aa..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/config/ftmodule.h +++ /dev/null @@ -1,20 +0,0 @@ -/* This is a generated file. */ -FT_USE_MODULE( FT_Driver_ClassRec, tt_driver_class ) -FT_USE_MODULE( FT_Driver_ClassRec, t1_driver_class ) -FT_USE_MODULE( FT_Driver_ClassRec, cff_driver_class ) -FT_USE_MODULE( FT_Driver_ClassRec, t1cid_driver_class ) -FT_USE_MODULE( FT_Driver_ClassRec, pfr_driver_class ) -FT_USE_MODULE( FT_Driver_ClassRec, t42_driver_class ) -FT_USE_MODULE( FT_Driver_ClassRec, winfnt_driver_class ) -FT_USE_MODULE( FT_Driver_ClassRec, pcf_driver_class ) -FT_USE_MODULE( FT_Driver_ClassRec, bdf_driver_class ) -FT_USE_MODULE( FT_Module_Class, sfnt_module_class ) -FT_USE_MODULE( FT_Module_Class, autofit_module_class ) -FT_USE_MODULE( FT_Module_Class, pshinter_module_class ) -FT_USE_MODULE( FT_Renderer_Class, ft_raster1_renderer_class ) -FT_USE_MODULE( FT_Renderer_Class, ft_smooth_renderer_class ) -FT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcd_renderer_class ) -FT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcdv_renderer_class ) -FT_USE_MODULE( FT_Module_Class, psaux_module_class ) -FT_USE_MODULE( FT_Module_Class, psnames_module_class ) -/* EOF */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/config/ftoption.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/config/ftoption.h deleted file mode 100644 index 041e24a31b..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/config/ftoption.h +++ /dev/null @@ -1,805 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftoption.h */ -/* */ -/* User-selectable configuration macros (specification only). */ -/* */ -/* Copyright 1996-2011 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __FTOPTION_H__ -#define __FTOPTION_H__ - - -#include <ft2build.h> - - -FT_BEGIN_HEADER - - /*************************************************************************/ - /* */ - /* USER-SELECTABLE CONFIGURATION MACROS */ - /* */ - /* This file contains the default configuration macro definitions for */ - /* a standard build of the FreeType library. There are three ways to */ - /* use this file to build project-specific versions of the library: */ - /* */ - /* - You can modify this file by hand, but this is not recommended in */ - /* cases where you would like to build several versions of the */ - /* library from a single source directory. */ - /* */ - /* - You can put a copy of this file in your build directory, more */ - /* precisely in `$BUILD/freetype/config/ftoption.h', where `$BUILD' */ - /* is the name of a directory that is included _before_ the FreeType */ - /* include path during compilation. */ - /* */ - /* The default FreeType Makefiles and Jamfiles use the build */ - /* directory `builds/<system>' by default, but you can easily change */ - /* that for your own projects. */ - /* */ - /* - Copy the file <ft2build.h> to `$BUILD/ft2build.h' and modify it */ - /* slightly to pre-define the macro FT_CONFIG_OPTIONS_H used to */ - /* locate this file during the build. For example, */ - /* */ - /* #define FT_CONFIG_OPTIONS_H <myftoptions.h> */ - /* #include <freetype/config/ftheader.h> */ - /* */ - /* will use `$BUILD/myftoptions.h' instead of this file for macro */ - /* definitions. */ - /* */ - /* Note also that you can similarly pre-define the macro */ - /* FT_CONFIG_MODULES_H used to locate the file listing of the modules */ - /* that are statically linked to the library at compile time. By */ - /* default, this file is <freetype/config/ftmodule.h>. */ - /* */ - /* We highly recommend using the third method whenever possible. */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /*************************************************************************/ - /**** ****/ - /**** G E N E R A L F R E E T Y P E 2 C O N F I G U R A T I O N ****/ - /**** ****/ - /*************************************************************************/ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* Uncomment the line below if you want to activate sub-pixel rendering */ - /* (a.k.a. LCD rendering, or ClearType) in this build of the library. */ - /* */ - /* Note that this feature is covered by several Microsoft patents */ - /* and should not be activated in any default build of the library. */ - /* */ - /* This macro has no impact on the FreeType API, only on its */ - /* _implementation_. For example, using FT_RENDER_MODE_LCD when calling */ - /* FT_Render_Glyph still generates a bitmap that is 3 times wider than */ - /* the original size in case this macro isn't defined; however, each */ - /* triplet of subpixels has R=G=B. */ - /* */ - /* This is done to allow FreeType clients to run unmodified, forcing */ - /* them to display normal gray-level anti-aliased glyphs. */ - /* */ -/* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */ - - - /*************************************************************************/ - /* */ - /* Many compilers provide a non-ANSI 64-bit data type that can be used */ - /* by FreeType to speed up some computations. However, this will create */ - /* some problems when compiling the library in strict ANSI mode. */ - /* */ - /* For this reason, the use of 64-bit integers is normally disabled when */ - /* the __STDC__ macro is defined. You can however disable this by */ - /* defining the macro FT_CONFIG_OPTION_FORCE_INT64 here. */ - /* */ - /* For most compilers, this will only create compilation warnings when */ - /* building the library. */ - /* */ - /* ObNote: The compiler-specific 64-bit integers are detected in the */ - /* file `ftconfig.h' either statically or through the */ - /* `configure' script on supported platforms. */ - /* */ -#undef FT_CONFIG_OPTION_FORCE_INT64 - - - /*************************************************************************/ - /* */ - /* If this macro is defined, do not try to use an assembler version of */ - /* performance-critical functions (e.g. FT_MulFix). You should only do */ - /* that to verify that the assembler function works properly, or to */ - /* execute benchmark tests of the various implementations. */ -/* #define FT_CONFIG_OPTION_NO_ASSEMBLER */ - - - /*************************************************************************/ - /* */ - /* If this macro is defined, try to use an inlined assembler version of */ - /* the `FT_MulFix' function, which is a `hotspot' when loading and */ - /* hinting glyphs, and which should be executed as fast as possible. */ - /* */ - /* Note that if your compiler or CPU is not supported, this will default */ - /* to the standard and portable implementation found in `ftcalc.c'. */ - /* */ -#define FT_CONFIG_OPTION_INLINE_MULFIX - - - /*************************************************************************/ - /* */ - /* LZW-compressed file support. */ - /* */ - /* FreeType now handles font files that have been compressed with the */ - /* `compress' program. This is mostly used to parse many of the PCF */ - /* files that come with various X11 distributions. The implementation */ - /* uses NetBSD's `zopen' to partially uncompress the file on the fly */ - /* (see src/lzw/ftgzip.c). */ - /* */ - /* Define this macro if you want to enable this `feature'. */ - /* */ -#define FT_CONFIG_OPTION_USE_LZW - - - /*************************************************************************/ - /* */ - /* Gzip-compressed file support. */ - /* */ - /* FreeType now handles font files that have been compressed with the */ - /* `gzip' program. This is mostly used to parse many of the PCF files */ - /* that come with XFree86. The implementation uses `zlib' to */ - /* partially uncompress the file on the fly (see src/gzip/ftgzip.c). */ - /* */ - /* Define this macro if you want to enable this `feature'. See also */ - /* the macro FT_CONFIG_OPTION_SYSTEM_ZLIB below. */ - /* */ -#define FT_CONFIG_OPTION_USE_ZLIB - - - /*************************************************************************/ - /* */ - /* ZLib library selection */ - /* */ - /* This macro is only used when FT_CONFIG_OPTION_USE_ZLIB is defined. */ - /* It allows FreeType's `ftgzip' component to link to the system's */ - /* installation of the ZLib library. This is useful on systems like */ - /* Unix or VMS where it generally is already available. */ - /* */ - /* If you let it undefined, the component will use its own copy */ - /* of the zlib sources instead. These have been modified to be */ - /* included directly within the component and *not* export external */ - /* function names. This allows you to link any program with FreeType */ - /* _and_ ZLib without linking conflicts. */ - /* */ - /* Do not #undef this macro here since the build system might define */ - /* it for certain configurations only. */ - /* */ -/* #define FT_CONFIG_OPTION_SYSTEM_ZLIB */ - - - /*************************************************************************/ - /* */ - /* Bzip2-compressed file support. */ - /* */ - /* FreeType now handles font files that have been compressed with the */ - /* `bzip2' program. This is mostly used to parse many of the PCF */ - /* files that come with XFree86. The implementation uses `libbz2' to */ - /* partially uncompress the file on the fly (see src/bzip2/ftbzip2.c). */ - /* Contrary to gzip, bzip2 currently is not included and need to use */ - /* the system available bzip2 implementation. */ - /* */ - /* Define this macro if you want to enable this `feature'. */ - /* */ -/* #define FT_CONFIG_OPTION_USE_BZIP2 */ - - - /*************************************************************************/ - /* */ - /* Define to disable the use of file stream functions and types, FILE, */ - /* fopen() etc. Enables the use of smaller system libraries on embedded */ - /* systems that have multiple system libraries, some with or without */ - /* file stream support, in the cases where file stream support is not */ - /* necessary such as memory loading of font files. */ - /* */ -/* #define FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT */ - - - /*************************************************************************/ - /* */ - /* DLL export compilation */ - /* */ - /* When compiling FreeType as a DLL, some systems/compilers need a */ - /* special keyword in front OR after the return type of function */ - /* declarations. */ - /* */ - /* Two macros are used within the FreeType source code to define */ - /* exported library functions: FT_EXPORT and FT_EXPORT_DEF. */ - /* */ - /* FT_EXPORT( return_type ) */ - /* */ - /* is used in a function declaration, as in */ - /* */ - /* FT_EXPORT( FT_Error ) */ - /* FT_Init_FreeType( FT_Library* alibrary ); */ - /* */ - /* */ - /* FT_EXPORT_DEF( return_type ) */ - /* */ - /* is used in a function definition, as in */ - /* */ - /* FT_EXPORT_DEF( FT_Error ) */ - /* FT_Init_FreeType( FT_Library* alibrary ) */ - /* { */ - /* ... some code ... */ - /* return FT_Err_Ok; */ - /* } */ - /* */ - /* You can provide your own implementation of FT_EXPORT and */ - /* FT_EXPORT_DEF here if you want. If you leave them undefined, they */ - /* will be later automatically defined as `extern return_type' to */ - /* allow normal compilation. */ - /* */ - /* Do not #undef these macros here since the build system might define */ - /* them for certain configurations only. */ - /* */ -/* #define FT_EXPORT(x) extern x */ -/* #define FT_EXPORT_DEF(x) x */ - - - /*************************************************************************/ - /* */ - /* Glyph Postscript Names handling */ - /* */ - /* By default, FreeType 2 is compiled with the `psnames' module. This */ - /* module is in charge of converting a glyph name string into a */ - /* Unicode value, or return a Macintosh standard glyph name for the */ - /* use with the TrueType `post' table. */ - /* */ - /* Undefine this macro if you do not want `psnames' compiled in your */ - /* build of FreeType. This has the following effects: */ - /* */ - /* - The TrueType driver will provide its own set of glyph names, */ - /* if you build it to support postscript names in the TrueType */ - /* `post' table. */ - /* */ - /* - The Type 1 driver will not be able to synthesize a Unicode */ - /* charmap out of the glyphs found in the fonts. */ - /* */ - /* You would normally undefine this configuration macro when building */ - /* a version of FreeType that doesn't contain a Type 1 or CFF driver. */ - /* */ -#define FT_CONFIG_OPTION_POSTSCRIPT_NAMES - - - /*************************************************************************/ - /* */ - /* Postscript Names to Unicode Values support */ - /* */ - /* By default, FreeType 2 is built with the `PSNames' module compiled */ - /* in. Among other things, the module is used to convert a glyph name */ - /* into a Unicode value. This is especially useful in order to */ - /* synthesize on the fly a Unicode charmap from the CFF/Type 1 driver */ - /* through a big table named the `Adobe Glyph List' (AGL). */ - /* */ - /* Undefine this macro if you do not want the Adobe Glyph List */ - /* compiled in your `PSNames' module. The Type 1 driver will not be */ - /* able to synthesize a Unicode charmap out of the glyphs found in the */ - /* fonts. */ - /* */ -#define FT_CONFIG_OPTION_ADOBE_GLYPH_LIST - - - /*************************************************************************/ - /* */ - /* Support for Mac fonts */ - /* */ - /* Define this macro if you want support for outline fonts in Mac */ - /* format (mac dfont, mac resource, macbinary containing a mac */ - /* resource) on non-Mac platforms. */ - /* */ - /* Note that the `FOND' resource isn't checked. */ - /* */ -#define FT_CONFIG_OPTION_MAC_FONTS - - - /*************************************************************************/ - /* */ - /* Guessing methods to access embedded resource forks */ - /* */ - /* Enable extra Mac fonts support on non-Mac platforms (e.g. */ - /* GNU/Linux). */ - /* */ - /* Resource forks which include fonts data are stored sometimes in */ - /* locations which users or developers don't expected. In some cases, */ - /* resource forks start with some offset from the head of a file. In */ - /* other cases, the actual resource fork is stored in file different */ - /* from what the user specifies. If this option is activated, */ - /* FreeType tries to guess whether such offsets or different file */ - /* names must be used. */ - /* */ - /* Note that normal, direct access of resource forks is controlled via */ - /* the FT_CONFIG_OPTION_MAC_FONTS option. */ - /* */ -#ifdef FT_CONFIG_OPTION_MAC_FONTS -#define FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK -#endif - - - /*************************************************************************/ - /* */ - /* Allow the use of FT_Incremental_Interface to load typefaces that */ - /* contain no glyph data, but supply it via a callback function. */ - /* This is required by clients supporting document formats which */ - /* supply font data incrementally as the document is parsed, such */ - /* as the Ghostscript interpreter for the PostScript language. */ - /* */ -#define FT_CONFIG_OPTION_INCREMENTAL - - - /*************************************************************************/ - /* */ - /* The size in bytes of the render pool used by the scan-line converter */ - /* to do all of its work. */ - /* */ - /* This must be greater than 4KByte if you use FreeType to rasterize */ - /* glyphs; otherwise, you may set it to zero to avoid unnecessary */ - /* allocation of the render pool. */ - /* */ -#define FT_RENDER_POOL_SIZE 16384L - - - /*************************************************************************/ - /* */ - /* FT_MAX_MODULES */ - /* */ - /* The maximum number of modules that can be registered in a single */ - /* FreeType library object. 32 is the default. */ - /* */ -#define FT_MAX_MODULES 32 - - - /*************************************************************************/ - /* */ - /* Debug level */ - /* */ - /* FreeType can be compiled in debug or trace mode. In debug mode, */ - /* errors are reported through the `ftdebug' component. In trace */ - /* mode, additional messages are sent to the standard output during */ - /* execution. */ - /* */ - /* Define FT_DEBUG_LEVEL_ERROR to build the library in debug mode. */ - /* Define FT_DEBUG_LEVEL_TRACE to build it in trace mode. */ - /* */ - /* Don't define any of these macros to compile in `release' mode! */ - /* */ - /* Do not #undef these macros here since the build system might define */ - /* them for certain configurations only. */ - /* */ -/* #define FT_DEBUG_LEVEL_ERROR */ -/* #define FT_DEBUG_LEVEL_TRACE */ - - - /*************************************************************************/ - /* */ - /* Autofitter debugging */ - /* */ - /* If FT_DEBUG_AUTOFIT is defined, FreeType provides some means to */ - /* control the autofitter behaviour for debugging purposes with global */ - /* boolean variables (consequently, you should *never* enable this */ - /* while compiling in `release' mode): */ - /* */ - /* _af_debug_disable_horz_hints */ - /* _af_debug_disable_vert_hints */ - /* _af_debug_disable_blue_hints */ - /* */ - /* Additionally, the following functions provide dumps of various */ - /* internal autofit structures to stdout (using `printf'): */ - /* */ - /* af_glyph_hints_dump_points */ - /* af_glyph_hints_dump_segments */ - /* af_glyph_hints_dump_edges */ - /* */ - /* As an argument, they use another global variable: */ - /* */ - /* _af_debug_hints */ - /* */ - /* Please have a look at the `ftgrid' demo program to see how those */ - /* variables and macros should be used. */ - /* */ - /* Do not #undef these macros here since the build system might define */ - /* them for certain configurations only. */ - /* */ -/* #define FT_DEBUG_AUTOFIT */ - - - /*************************************************************************/ - /* */ - /* Memory Debugging */ - /* */ - /* FreeType now comes with an integrated memory debugger that is */ - /* capable of detecting simple errors like memory leaks or double */ - /* deletes. To compile it within your build of the library, you */ - /* should define FT_DEBUG_MEMORY here. */ - /* */ - /* Note that the memory debugger is only activated at runtime when */ - /* when the _environment_ variable `FT2_DEBUG_MEMORY' is defined also! */ - /* */ - /* Do not #undef this macro here since the build system might define */ - /* it for certain configurations only. */ - /* */ -/* #define FT_DEBUG_MEMORY */ - - - /*************************************************************************/ - /* */ - /* Module errors */ - /* */ - /* If this macro is set (which is _not_ the default), the higher byte */ - /* of an error code gives the module in which the error has occurred, */ - /* while the lower byte is the real error code. */ - /* */ - /* Setting this macro makes sense for debugging purposes only, since */ - /* it would break source compatibility of certain programs that use */ - /* FreeType 2. */ - /* */ - /* More details can be found in the files ftmoderr.h and fterrors.h. */ - /* */ -#undef FT_CONFIG_OPTION_USE_MODULE_ERRORS - - - /*************************************************************************/ - /* */ - /* Position Independent Code */ - /* */ - /* If this macro is set (which is _not_ the default), FreeType2 will */ - /* avoid creating constants that require address fixups. Instead the */ - /* constants will be moved into a struct and additional intialization */ - /* code will be used. */ - /* */ - /* Setting this macro is needed for systems that prohibit address */ - /* fixups, such as BREW. */ - /* */ -/* #define FT_CONFIG_OPTION_PIC */ - - - /*************************************************************************/ - /*************************************************************************/ - /**** ****/ - /**** S F N T D R I V E R C O N F I G U R A T I O N ****/ - /**** ****/ - /*************************************************************************/ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* Define TT_CONFIG_OPTION_EMBEDDED_BITMAPS if you want to support */ - /* embedded bitmaps in all formats using the SFNT module (namely */ - /* TrueType & OpenType). */ - /* */ -#define TT_CONFIG_OPTION_EMBEDDED_BITMAPS - - - /*************************************************************************/ - /* */ - /* Define TT_CONFIG_OPTION_POSTSCRIPT_NAMES if you want to be able to */ - /* load and enumerate the glyph Postscript names in a TrueType or */ - /* OpenType file. */ - /* */ - /* Note that when you do not compile the `PSNames' module by undefining */ - /* the above FT_CONFIG_OPTION_POSTSCRIPT_NAMES, the `sfnt' module will */ - /* contain additional code used to read the PS Names table from a font. */ - /* */ - /* (By default, the module uses `PSNames' to extract glyph names.) */ - /* */ -#define TT_CONFIG_OPTION_POSTSCRIPT_NAMES - - - /*************************************************************************/ - /* */ - /* Define TT_CONFIG_OPTION_SFNT_NAMES if your applications need to */ - /* access the internal name table in a SFNT-based format like TrueType */ - /* or OpenType. The name table contains various strings used to */ - /* describe the font, like family name, copyright, version, etc. It */ - /* does not contain any glyph name though. */ - /* */ - /* Accessing SFNT names is done through the functions declared in */ - /* `freetype/ftsnames.h'. */ - /* */ -#define TT_CONFIG_OPTION_SFNT_NAMES - - - /*************************************************************************/ - /* */ - /* TrueType CMap support */ - /* */ - /* Here you can fine-tune which TrueType CMap table format shall be */ - /* supported. */ -#define TT_CONFIG_CMAP_FORMAT_0 -#define TT_CONFIG_CMAP_FORMAT_2 -#define TT_CONFIG_CMAP_FORMAT_4 -#define TT_CONFIG_CMAP_FORMAT_6 -#define TT_CONFIG_CMAP_FORMAT_8 -#define TT_CONFIG_CMAP_FORMAT_10 -#define TT_CONFIG_CMAP_FORMAT_12 -#define TT_CONFIG_CMAP_FORMAT_13 -#define TT_CONFIG_CMAP_FORMAT_14 - - - /*************************************************************************/ - /*************************************************************************/ - /**** ****/ - /**** T R U E T Y P E D R I V E R C O N F I G U R A T I O N ****/ - /**** ****/ - /*************************************************************************/ - /*************************************************************************/ - - /*************************************************************************/ - /* */ - /* Define TT_CONFIG_OPTION_BYTECODE_INTERPRETER if you want to compile */ - /* a bytecode interpreter in the TrueType driver. */ - /* */ - /* By undefining this, you will only compile the code necessary to load */ - /* TrueType glyphs without hinting. */ - /* */ - /* Do not #undef this macro here, since the build system might */ - /* define it for certain configurations only. */ - /* */ -#define TT_CONFIG_OPTION_BYTECODE_INTERPRETER - - - /*************************************************************************/ - /* */ - /* If you define TT_CONFIG_OPTION_UNPATENTED_HINTING, a special version */ - /* of the TrueType bytecode interpreter is used that doesn't implement */ - /* any of the patented opcodes and algorithms. The patents related to */ - /* TrueType hinting have expired worldwide since May 2010; this option */ - /* is now deprecated. */ - /* */ - /* Note that the TT_CONFIG_OPTION_UNPATENTED_HINTING macro is *ignored* */ - /* if you define TT_CONFIG_OPTION_BYTECODE_INTERPRETER; in other words, */ - /* either define TT_CONFIG_OPTION_BYTECODE_INTERPRETER or */ - /* TT_CONFIG_OPTION_UNPATENTED_HINTING but not both at the same time. */ - /* */ - /* This macro is only useful for a small number of font files (mostly */ - /* for Asian scripts) that require bytecode interpretation to properly */ - /* load glyphs. For all other fonts, this produces unpleasant results, */ - /* thus the unpatented interpreter is never used to load glyphs from */ - /* TrueType fonts unless one of the following two options is used. */ - /* */ - /* - The unpatented interpreter is explicitly activated by the user */ - /* through the FT_PARAM_TAG_UNPATENTED_HINTING parameter tag */ - /* when opening the FT_Face. */ - /* */ - /* - FreeType detects that the FT_Face corresponds to one of the */ - /* `trick' fonts (e.g., `Mingliu') it knows about. The font engine */ - /* contains a hard-coded list of font names and other matching */ - /* parameters (see function `tt_face_init' in file */ - /* `src/truetype/ttobjs.c'). */ - /* */ - /* Here a sample code snippet for using FT_PARAM_TAG_UNPATENTED_HINTING. */ - /* */ - /* { */ - /* FT_Parameter parameter; */ - /* FT_Open_Args open_args; */ - /* */ - /* */ - /* parameter.tag = FT_PARAM_TAG_UNPATENTED_HINTING; */ - /* */ - /* open_args.flags = FT_OPEN_PATHNAME | FT_OPEN_PARAMS; */ - /* open_args.pathname = my_font_pathname; */ - /* open_args.num_params = 1; */ - /* open_args.params = ¶meter; */ - /* */ - /* error = FT_Open_Face( library, &open_args, index, &face ); */ - /* ... */ - /* } */ - /* */ -/* #define TT_CONFIG_OPTION_UNPATENTED_HINTING */ - - - /*************************************************************************/ - /* */ - /* Define TT_CONFIG_OPTION_INTERPRETER_SWITCH to compile the TrueType */ - /* bytecode interpreter with a huge switch statement, rather than a call */ - /* table. This results in smaller and faster code for a number of */ - /* architectures. */ - /* */ - /* Note however that on some compiler/processor combinations, undefining */ - /* this macro will generate faster, though larger, code. */ - /* */ -#define TT_CONFIG_OPTION_INTERPRETER_SWITCH - - - /*************************************************************************/ - /* */ - /* Define TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED to compile the */ - /* TrueType glyph loader to use Apple's definition of how to handle */ - /* component offsets in composite glyphs. */ - /* */ - /* Apple and MS disagree on the default behavior of component offsets */ - /* in composites. Apple says that they should be scaled by the scaling */ - /* factors in the transformation matrix (roughly, it's more complex) */ - /* while MS says they should not. OpenType defines two bits in the */ - /* composite flags array which can be used to disambiguate, but old */ - /* fonts will not have them. */ - /* */ - /* http://www.microsoft.com/typography/otspec/glyf.htm */ - /* http://fonts.apple.com/TTRefMan/RM06/Chap6glyf.html */ - /* */ -#undef TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED - - - /*************************************************************************/ - /* */ - /* Define TT_CONFIG_OPTION_GX_VAR_SUPPORT if you want to include */ - /* support for Apple's distortable font technology (fvar, gvar, cvar, */ - /* and avar tables). This has many similarities to Type 1 Multiple */ - /* Masters support. */ - /* */ -#define TT_CONFIG_OPTION_GX_VAR_SUPPORT - - - /*************************************************************************/ - /* */ - /* Define TT_CONFIG_OPTION_BDF if you want to include support for */ - /* an embedded `BDF ' table within SFNT-based bitmap formats. */ - /* */ -#define TT_CONFIG_OPTION_BDF - - - /*************************************************************************/ - /*************************************************************************/ - /**** ****/ - /**** T Y P E 1 D R I V E R C O N F I G U R A T I O N ****/ - /**** ****/ - /*************************************************************************/ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* T1_MAX_DICT_DEPTH is the maximal depth of nest dictionaries and */ - /* arrays in the Type 1 stream (see t1load.c). A minimum of 4 is */ - /* required. */ - /* */ -#define T1_MAX_DICT_DEPTH 5 - - - /*************************************************************************/ - /* */ - /* T1_MAX_SUBRS_CALLS details the maximum number of nested sub-routine */ - /* calls during glyph loading. */ - /* */ -#define T1_MAX_SUBRS_CALLS 16 - - - /*************************************************************************/ - /* */ - /* T1_MAX_CHARSTRING_OPERANDS is the charstring stack's capacity. A */ - /* minimum of 16 is required. */ - /* */ - /* The Chinese font MingTiEG-Medium (CNS 11643 character set) needs 256. */ - /* */ -#define T1_MAX_CHARSTRINGS_OPERANDS 256 - - - /*************************************************************************/ - /* */ - /* Define this configuration macro if you want to prevent the */ - /* compilation of `t1afm', which is in charge of reading Type 1 AFM */ - /* files into an existing face. Note that if set, the T1 driver will be */ - /* unable to produce kerning distances. */ - /* */ -#undef T1_CONFIG_OPTION_NO_AFM - - - /*************************************************************************/ - /* */ - /* Define this configuration macro if you want to prevent the */ - /* compilation of the Multiple Masters font support in the Type 1 */ - /* driver. */ - /* */ -#undef T1_CONFIG_OPTION_NO_MM_SUPPORT - - - /*************************************************************************/ - /*************************************************************************/ - /**** ****/ - /**** A U T O F I T M O D U L E C O N F I G U R A T I O N ****/ - /**** ****/ - /*************************************************************************/ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* Compile autofit module with CJK (Chinese, Japanese, Korean) script */ - /* support. */ - /* */ -#define AF_CONFIG_OPTION_CJK - - /*************************************************************************/ - /* */ - /* Compile autofit module with Indic script support. */ - /* */ -#define AF_CONFIG_OPTION_INDIC - - /*************************************************************************/ - /* */ - /* Compile autofit module with warp hinting. The idea of the warping */ - /* code is to slightly scale and shift a glyph within a single dimension */ - /* so that as much of its segments are aligned (more or less) on the */ - /* grid. To find out the optimal scaling and shifting value, various */ - /* parameter combinations are tried and scored. */ - /* */ - /* This experimental option is only active if the render mode is */ - /* FT_RENDER_MODE_LIGHT. */ - /* */ -/* #define AF_CONFIG_OPTION_USE_WARPER */ - - /* */ - - - /* - * Define this variable if you want to keep the layout of internal - * structures that was used prior to FreeType 2.2. This also compiles in - * a few obsolete functions to avoid linking problems on typical Unix - * distributions. - * - * For embedded systems or building a new distribution from scratch, it - * is recommended to disable the macro since it reduces the library's code - * size and activates a few memory-saving optimizations as well. - */ -#define FT_CONFIG_OPTION_OLD_INTERNALS - - - /* - * To detect legacy cache-lookup call from a rogue client (<= 2.1.7), - * we restrict the number of charmaps in a font. The current API of - * FTC_CMapCache_Lookup() takes cmap_index & charcode, but old API - * takes charcode only. To determine the passed value is for cmap_index - * or charcode, the possible cmap_index is restricted not to exceed - * the minimum possible charcode by a rogue client. It is also very - * unlikely that a rogue client is interested in Unicode values 0 to 15. - * - * NOTE: The original threshold was 4 deduced from popular number of - * cmap subtables in UCS-4 TrueType fonts, but now it is not - * irregular for OpenType fonts to have more than 4 subtables, - * because variation selector subtables are available for Apple - * and Microsoft platforms. - */ - -#ifdef FT_CONFIG_OPTION_OLD_INTERNALS -#define FT_MAX_CHARMAP_CACHEABLE 15 -#endif - - - /* - * This macro is defined if either unpatented or native TrueType - * hinting is requested by the definitions above. - */ -#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER -#define TT_USE_BYTECODE_INTERPRETER -#undef TT_CONFIG_OPTION_UNPATENTED_HINTING -#elif defined TT_CONFIG_OPTION_UNPATENTED_HINTING -#define TT_USE_BYTECODE_INTERPRETER -#endif - -FT_END_HEADER - - -#endif /* __FTOPTION_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/config/ftstdlib.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/config/ftstdlib.h deleted file mode 100644 index 11d5d0e65b..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/config/ftstdlib.h +++ /dev/null @@ -1,174 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftstdlib.h */ -/* */ -/* ANSI-specific library and header configuration file (specification */ -/* only). */ -/* */ -/* Copyright 2002-2007, 2009, 2011 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - - /*************************************************************************/ - /* */ - /* This file is used to group all #includes to the ANSI C library that */ - /* FreeType normally requires. It also defines macros to rename the */ - /* standard functions within the FreeType source code. */ - /* */ - /* Load a file which defines __FTSTDLIB_H__ before this one to override */ - /* it. */ - /* */ - /*************************************************************************/ - - -#ifndef __FTSTDLIB_H__ -#define __FTSTDLIB_H__ - - -#include <stddef.h> - -#define ft_ptrdiff_t ptrdiff_t - - - /**********************************************************************/ - /* */ - /* integer limits */ - /* */ - /* UINT_MAX and ULONG_MAX are used to automatically compute the size */ - /* of `int' and `long' in bytes at compile-time. So far, this works */ - /* for all platforms the library has been tested on. */ - /* */ - /* Note that on the extremely rare platforms that do not provide */ - /* integer types that are _exactly_ 16 and 32 bits wide (e.g. some */ - /* old Crays where `int' is 36 bits), we do not make any guarantee */ - /* about the correct behaviour of FT2 with all fonts. */ - /* */ - /* In these case, `ftconfig.h' will refuse to compile anyway with a */ - /* message like `couldn't find 32-bit type' or something similar. */ - /* */ - /**********************************************************************/ - - -#include <limits.h> - -#define FT_CHAR_BIT CHAR_BIT -#define FT_USHORT_MAX USHRT_MAX -#define FT_INT_MAX INT_MAX -#define FT_INT_MIN INT_MIN -#define FT_UINT_MAX UINT_MAX -#define FT_ULONG_MAX ULONG_MAX - - - /**********************************************************************/ - /* */ - /* character and string processing */ - /* */ - /**********************************************************************/ - - -#include <string.h> - -#define ft_memchr memchr -#define ft_memcmp memcmp -#define ft_memcpy memcpy -#define ft_memmove memmove -#define ft_memset memset -#define ft_strcat strcat -#define ft_strcmp strcmp -#define ft_strcpy strcpy -#define ft_strlen strlen -#define ft_strncmp strncmp -#define ft_strncpy strncpy -#define ft_strrchr strrchr -#define ft_strstr strstr - - - /**********************************************************************/ - /* */ - /* file handling */ - /* */ - /**********************************************************************/ - - -#include <stdio.h> - -#define FT_FILE FILE -#define ft_fclose fclose -#define ft_fopen fopen -#define ft_fread fread -#define ft_fseek fseek -#define ft_ftell ftell -#define ft_sprintf sprintf - - - /**********************************************************************/ - /* */ - /* sorting */ - /* */ - /**********************************************************************/ - - -#include <stdlib.h> - -#define ft_qsort qsort - - - /**********************************************************************/ - /* */ - /* memory allocation */ - /* */ - /**********************************************************************/ - - -#define ft_scalloc calloc -#define ft_sfree free -#define ft_smalloc malloc -#define ft_srealloc realloc - - - /**********************************************************************/ - /* */ - /* miscellaneous */ - /* */ - /**********************************************************************/ - - -#define ft_atol atol -#define ft_labs labs - - - /**********************************************************************/ - /* */ - /* execution control */ - /* */ - /**********************************************************************/ - - -#include <setjmp.h> - -#define ft_jmp_buf jmp_buf /* note: this cannot be a typedef since */ - /* jmp_buf is defined as a macro */ - /* on certain platforms */ - -#define ft_longjmp longjmp -#define ft_setjmp( b ) setjmp( *(jmp_buf*) &(b) ) /* same thing here */ - - - /* the following is only used for debugging purposes, i.e., if */ - /* FT_DEBUG_LEVEL_ERROR or FT_DEBUG_LEVEL_TRACE are defined */ - -#include <stdarg.h> - - -#endif /* __FTSTDLIB_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/freetype.h.REMOVED.git-id b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/freetype.h.REMOVED.git-id deleted file mode 100644 index b83123811b..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/freetype.h.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -63c291af1270c8a1c4ba40388b000f0710ea38c6 \ No newline at end of file diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftadvanc.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftadvanc.h deleted file mode 100644 index b2451bec42..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftadvanc.h +++ /dev/null @@ -1,179 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftadvanc.h */ -/* */ -/* Quick computation of advance widths (specification only). */ -/* */ -/* Copyright 2008 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __FTADVANC_H__ -#define __FTADVANC_H__ - - -#include <ft2build.h> -#include FT_FREETYPE_H - -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - - -FT_BEGIN_HEADER - - - /************************************************************************** - * - * @section: - * quick_advance - * - * @title: - * Quick retrieval of advance values - * - * @abstract: - * Retrieve horizontal and vertical advance values without processing - * glyph outlines, if possible. - * - * @description: - * This section contains functions to quickly extract advance values - * without handling glyph outlines, if possible. - */ - - - /*************************************************************************/ - /* */ - /* <Const> */ - /* FT_ADVANCE_FLAG_FAST_ONLY */ - /* */ - /* <Description> */ - /* A bit-flag to be OR-ed with the `flags' parameter of the */ - /* @FT_Get_Advance and @FT_Get_Advances functions. */ - /* */ - /* If set, it indicates that you want these functions to fail if the */ - /* corresponding hinting mode or font driver doesn't allow for very */ - /* quick advance computation. */ - /* */ - /* Typically, glyphs which are either unscaled, unhinted, bitmapped, */ - /* or light-hinted can have their advance width computed very */ - /* quickly. */ - /* */ - /* Normal and bytecode hinted modes, which require loading, scaling, */ - /* and hinting of the glyph outline, are extremely slow by */ - /* comparison. */ - /* */ -#define FT_ADVANCE_FLAG_FAST_ONLY 0x20000000UL - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Get_Advance */ - /* */ - /* <Description> */ - /* Retrieve the advance value of a given glyph outline in an */ - /* @FT_Face. By default, the unhinted advance is returned in font */ - /* units. */ - /* */ - /* <Input> */ - /* face :: The source @FT_Face handle. */ - /* */ - /* gindex :: The glyph index. */ - /* */ - /* load_flags :: A set of bit flags similar to those used when */ - /* calling @FT_Load_Glyph, used to determine what kind */ - /* of advances you need. */ - /* <Output> */ - /* padvance :: The advance value, in either font units or 16.16 */ - /* format. */ - /* */ - /* If @FT_LOAD_VERTICAL_LAYOUT is set, this is the */ - /* vertical advance corresponding to a vertical layout. */ - /* Otherwise, it is the horizontal advance in a */ - /* horizontal layout. */ - /* */ - /* <Return> */ - /* FreeType error code. 0 means success. */ - /* */ - /* <Note> */ - /* This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and */ - /* if the corresponding font backend doesn't have a quick way to */ - /* retrieve the advances. */ - /* */ - /* A scaled advance is returned in 16.16 format but isn't transformed */ - /* by the affine transformation specified by @FT_Set_Transform. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Get_Advance( FT_Face face, - FT_UInt gindex, - FT_Int32 load_flags, - FT_Fixed *padvance ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Get_Advances */ - /* */ - /* <Description> */ - /* Retrieve the advance values of several glyph outlines in an */ - /* @FT_Face. By default, the unhinted advances are returned in font */ - /* units. */ - /* */ - /* <Input> */ - /* face :: The source @FT_Face handle. */ - /* */ - /* start :: The first glyph index. */ - /* */ - /* count :: The number of advance values you want to retrieve. */ - /* */ - /* load_flags :: A set of bit flags similar to those used when */ - /* calling @FT_Load_Glyph. */ - /* */ - /* <Output> */ - /* padvance :: The advances, in either font units or 16.16 format. */ - /* This array must contain at least `count' elements. */ - /* */ - /* If @FT_LOAD_VERTICAL_LAYOUT is set, these are the */ - /* vertical advances corresponding to a vertical layout. */ - /* Otherwise, they are the horizontal advances in a */ - /* horizontal layout. */ - /* */ - /* <Return> */ - /* FreeType error code. 0 means success. */ - /* */ - /* <Note> */ - /* This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and */ - /* if the corresponding font backend doesn't have a quick way to */ - /* retrieve the advances. */ - /* */ - /* Scaled advances are returned in 16.16 format but aren't */ - /* transformed by the affine transformation specified by */ - /* @FT_Set_Transform. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Get_Advances( FT_Face face, - FT_UInt start, - FT_UInt count, - FT_Int32 load_flags, - FT_Fixed *padvances ); - -/* */ - - -FT_END_HEADER - -#endif /* __FTADVANC_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftbbox.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftbbox.h deleted file mode 100644 index 976691956f..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftbbox.h +++ /dev/null @@ -1,102 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftbbox.h */ -/* */ -/* FreeType exact bbox computation (specification). */ -/* */ -/* Copyright 1996-2001, 2003, 2007, 2011 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - - /*************************************************************************/ - /* */ - /* This component has a _single_ role: to compute exact outline bounding */ - /* boxes. */ - /* */ - /* It is separated from the rest of the engine for various technical */ - /* reasons. It may well be integrated in `ftoutln' later. */ - /* */ - /*************************************************************************/ - - -#ifndef __FTBBOX_H__ -#define __FTBBOX_H__ - - -#include <ft2build.h> -#include FT_FREETYPE_H - -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - - -FT_BEGIN_HEADER - - - /*************************************************************************/ - /* */ - /* <Section> */ - /* outline_processing */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Outline_Get_BBox */ - /* */ - /* <Description> */ - /* Compute the exact bounding box of an outline. This is slower */ - /* than computing the control box. However, it uses an advanced */ - /* algorithm which returns _very_ quickly when the two boxes */ - /* coincide. Otherwise, the outline Bézier arcs are traversed to */ - /* extract their extrema. */ - /* */ - /* <Input> */ - /* outline :: A pointer to the source outline. */ - /* */ - /* <Output> */ - /* abbox :: The outline's exact bounding box. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - /* <Note> */ - /* If the font is tricky and the glyph has been loaded with */ - /* @FT_LOAD_NO_SCALE, the resulting BBox is meaningless. To get */ - /* reasonable values for the BBox it is necessary to load the glyph */ - /* at a large ppem value (so that the hinting instructions can */ - /* properly shift and scale the subglyphs), then extracting the BBox */ - /* which can be eventually converted back to font units. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Outline_Get_BBox( FT_Outline* outline, - FT_BBox *abbox ); - - - /* */ - - -FT_END_HEADER - -#endif /* __FTBBOX_H__ */ - - -/* END */ - - -/* Local Variables: */ -/* coding: utf-8 */ -/* End: */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftbdf.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftbdf.h deleted file mode 100644 index 4f8baf8401..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftbdf.h +++ /dev/null @@ -1,209 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftbdf.h */ -/* */ -/* FreeType API for accessing BDF-specific strings (specification). */ -/* */ -/* Copyright 2002, 2003, 2004, 2006, 2009 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __FTBDF_H__ -#define __FTBDF_H__ - -#include <ft2build.h> -#include FT_FREETYPE_H - -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - - -FT_BEGIN_HEADER - - - /*************************************************************************/ - /* */ - /* <Section> */ - /* bdf_fonts */ - /* */ - /* <Title> */ - /* BDF and PCF Files */ - /* */ - /* <Abstract> */ - /* BDF and PCF specific API. */ - /* */ - /* <Description> */ - /* This section contains the declaration of functions specific to BDF */ - /* and PCF fonts. */ - /* */ - /*************************************************************************/ - - - /********************************************************************** - * - * @enum: - * FT_PropertyType - * - * @description: - * A list of BDF property types. - * - * @values: - * BDF_PROPERTY_TYPE_NONE :: - * Value~0 is used to indicate a missing property. - * - * BDF_PROPERTY_TYPE_ATOM :: - * Property is a string atom. - * - * BDF_PROPERTY_TYPE_INTEGER :: - * Property is a 32-bit signed integer. - * - * BDF_PROPERTY_TYPE_CARDINAL :: - * Property is a 32-bit unsigned integer. - */ - typedef enum BDF_PropertyType_ - { - BDF_PROPERTY_TYPE_NONE = 0, - BDF_PROPERTY_TYPE_ATOM = 1, - BDF_PROPERTY_TYPE_INTEGER = 2, - BDF_PROPERTY_TYPE_CARDINAL = 3 - - } BDF_PropertyType; - - - /********************************************************************** - * - * @type: - * BDF_Property - * - * @description: - * A handle to a @BDF_PropertyRec structure to model a given - * BDF/PCF property. - */ - typedef struct BDF_PropertyRec_* BDF_Property; - - - /********************************************************************** - * - * @struct: - * BDF_PropertyRec - * - * @description: - * This structure models a given BDF/PCF property. - * - * @fields: - * type :: - * The property type. - * - * u.atom :: - * The atom string, if type is @BDF_PROPERTY_TYPE_ATOM. - * - * u.integer :: - * A signed integer, if type is @BDF_PROPERTY_TYPE_INTEGER. - * - * u.cardinal :: - * An unsigned integer, if type is @BDF_PROPERTY_TYPE_CARDINAL. - */ - typedef struct BDF_PropertyRec_ - { - BDF_PropertyType type; - union { - const char* atom; - FT_Int32 integer; - FT_UInt32 cardinal; - - } u; - - } BDF_PropertyRec; - - - /********************************************************************** - * - * @function: - * FT_Get_BDF_Charset_ID - * - * @description: - * Retrieve a BDF font character set identity, according to - * the BDF specification. - * - * @input: - * face :: - * A handle to the input face. - * - * @output: - * acharset_encoding :: - * Charset encoding, as a C~string, owned by the face. - * - * acharset_registry :: - * Charset registry, as a C~string, owned by the face. - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * This function only works with BDF faces, returning an error otherwise. - */ - FT_EXPORT( FT_Error ) - FT_Get_BDF_Charset_ID( FT_Face face, - const char* *acharset_encoding, - const char* *acharset_registry ); - - - /********************************************************************** - * - * @function: - * FT_Get_BDF_Property - * - * @description: - * Retrieve a BDF property from a BDF or PCF font file. - * - * @input: - * face :: A handle to the input face. - * - * name :: The property name. - * - * @output: - * aproperty :: The property. - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * This function works with BDF _and_ PCF fonts. It returns an error - * otherwise. It also returns an error if the property is not in the - * font. - * - * A `property' is a either key-value pair within the STARTPROPERTIES - * ... ENDPROPERTIES block of a BDF font or a key-value pair from the - * `info->props' array within a `FontRec' structure of a PCF font. - * - * Integer properties are always stored as `signed' within PCF fonts; - * consequently, @BDF_PROPERTY_TYPE_CARDINAL is a possible return value - * for BDF fonts only. - * - * In case of error, `aproperty->type' is always set to - * @BDF_PROPERTY_TYPE_NONE. - */ - FT_EXPORT( FT_Error ) - FT_Get_BDF_Property( FT_Face face, - const char* prop_name, - BDF_PropertyRec *aproperty ); - - /* */ - -FT_END_HEADER - -#endif /* __FTBDF_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftbitmap.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftbitmap.h deleted file mode 100644 index 92742369ba..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftbitmap.h +++ /dev/null @@ -1,227 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftbitmap.h */ -/* */ -/* FreeType utility functions for bitmaps (specification). */ -/* */ -/* Copyright 2004, 2005, 2006, 2008 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __FTBITMAP_H__ -#define __FTBITMAP_H__ - - -#include <ft2build.h> -#include FT_FREETYPE_H - -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - - -FT_BEGIN_HEADER - - - /*************************************************************************/ - /* */ - /* <Section> */ - /* bitmap_handling */ - /* */ - /* <Title> */ - /* Bitmap Handling */ - /* */ - /* <Abstract> */ - /* Handling FT_Bitmap objects. */ - /* */ - /* <Description> */ - /* This section contains functions for converting FT_Bitmap objects. */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Bitmap_New */ - /* */ - /* <Description> */ - /* Initialize a pointer to an @FT_Bitmap structure. */ - /* */ - /* <InOut> */ - /* abitmap :: A pointer to the bitmap structure. */ - /* */ - FT_EXPORT( void ) - FT_Bitmap_New( FT_Bitmap *abitmap ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Bitmap_Copy */ - /* */ - /* <Description> */ - /* Copy a bitmap into another one. */ - /* */ - /* <Input> */ - /* library :: A handle to a library object. */ - /* */ - /* source :: A handle to the source bitmap. */ - /* */ - /* <Output> */ - /* target :: A handle to the target bitmap. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Bitmap_Copy( FT_Library library, - const FT_Bitmap *source, - FT_Bitmap *target); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Bitmap_Embolden */ - /* */ - /* <Description> */ - /* Embolden a bitmap. The new bitmap will be about `xStrength' */ - /* pixels wider and `yStrength' pixels higher. The left and bottom */ - /* borders are kept unchanged. */ - /* */ - /* <Input> */ - /* library :: A handle to a library object. */ - /* */ - /* xStrength :: How strong the glyph is emboldened horizontally. */ - /* Expressed in 26.6 pixel format. */ - /* */ - /* yStrength :: How strong the glyph is emboldened vertically. */ - /* Expressed in 26.6 pixel format. */ - /* */ - /* <InOut> */ - /* bitmap :: A handle to the target bitmap. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - /* <Note> */ - /* The current implementation restricts `xStrength' to be less than */ - /* or equal to~8 if bitmap is of pixel_mode @FT_PIXEL_MODE_MONO. */ - /* */ - /* If you want to embolden the bitmap owned by a @FT_GlyphSlotRec, */ - /* you should call @FT_GlyphSlot_Own_Bitmap on the slot first. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Bitmap_Embolden( FT_Library library, - FT_Bitmap* bitmap, - FT_Pos xStrength, - FT_Pos yStrength ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Bitmap_Convert */ - /* */ - /* <Description> */ - /* Convert a bitmap object with depth 1bpp, 2bpp, 4bpp, or 8bpp to a */ - /* bitmap object with depth 8bpp, making the number of used bytes per */ - /* line (a.k.a. the `pitch') a multiple of `alignment'. */ - /* */ - /* <Input> */ - /* library :: A handle to a library object. */ - /* */ - /* source :: The source bitmap. */ - /* */ - /* alignment :: The pitch of the bitmap is a multiple of this */ - /* parameter. Common values are 1, 2, or 4. */ - /* */ - /* <Output> */ - /* target :: The target bitmap. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - /* <Note> */ - /* It is possible to call @FT_Bitmap_Convert multiple times without */ - /* calling @FT_Bitmap_Done (the memory is simply reallocated). */ - /* */ - /* Use @FT_Bitmap_Done to finally remove the bitmap object. */ - /* */ - /* The `library' argument is taken to have access to FreeType's */ - /* memory handling functions. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Bitmap_Convert( FT_Library library, - const FT_Bitmap *source, - FT_Bitmap *target, - FT_Int alignment ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_GlyphSlot_Own_Bitmap */ - /* */ - /* <Description> */ - /* Make sure that a glyph slot owns `slot->bitmap'. */ - /* */ - /* <Input> */ - /* slot :: The glyph slot. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - /* <Note> */ - /* This function is to be used in combination with */ - /* @FT_Bitmap_Embolden. */ - /* */ - FT_EXPORT( FT_Error ) - FT_GlyphSlot_Own_Bitmap( FT_GlyphSlot slot ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Bitmap_Done */ - /* */ - /* <Description> */ - /* Destroy a bitmap object created with @FT_Bitmap_New. */ - /* */ - /* <Input> */ - /* library :: A handle to a library object. */ - /* */ - /* bitmap :: The bitmap object to be freed. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - /* <Note> */ - /* The `library' argument is taken to have access to FreeType's */ - /* memory handling functions. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Bitmap_Done( FT_Library library, - FT_Bitmap *bitmap ); - - - /* */ - - -FT_END_HEADER - -#endif /* __FTBITMAP_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftbzip2.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftbzip2.h deleted file mode 100644 index 1bf81b15e8..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftbzip2.h +++ /dev/null @@ -1,102 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftbzip2.h */ -/* */ -/* Bzip2-compressed stream support. */ -/* */ -/* Copyright 2010 by */ -/* Joel Klinghed. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __FTBZIP2_H__ -#define __FTBZIP2_H__ - -#include <ft2build.h> -#include FT_FREETYPE_H - -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - - -FT_BEGIN_HEADER - - /*************************************************************************/ - /* */ - /* <Section> */ - /* bzip2 */ - /* */ - /* <Title> */ - /* BZIP2 Streams */ - /* */ - /* <Abstract> */ - /* Using bzip2-compressed font files. */ - /* */ - /* <Description> */ - /* This section contains the declaration of Bzip2-specific functions. */ - /* */ - /*************************************************************************/ - - - /************************************************************************ - * - * @function: - * FT_Stream_OpenBzip2 - * - * @description: - * Open a new stream to parse bzip2-compressed font files. This is - * mainly used to support the compressed `*.pcf.bz2' fonts that come - * with XFree86. - * - * @input: - * stream :: - * The target embedding stream. - * - * source :: - * The source stream. - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * The source stream must be opened _before_ calling this function. - * - * Calling the internal function `FT_Stream_Close' on the new stream will - * *not* call `FT_Stream_Close' on the source stream. None of the stream - * objects will be released to the heap. - * - * The stream implementation is very basic and resets the decompression - * process each time seeking backwards is needed within the stream. - * - * In certain builds of the library, bzip2 compression recognition is - * automatically handled when calling @FT_New_Face or @FT_Open_Face. - * This means that if no font driver is capable of handling the raw - * compressed file, the library will try to open a bzip2 compressed stream - * from it and re-open the face with it. - * - * This function may return `FT_Err_Unimplemented_Feature' if your build - * of FreeType was not compiled with bzip2 support. - */ - FT_EXPORT( FT_Error ) - FT_Stream_OpenBzip2( FT_Stream stream, - FT_Stream source ); - - /* */ - - -FT_END_HEADER - -#endif /* __FTBZIP2_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftcache.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftcache.h deleted file mode 100644 index 6af5306228..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftcache.h +++ /dev/null @@ -1,1140 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftcache.h */ -/* */ -/* FreeType Cache subsystem (specification). */ -/* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __FTCACHE_H__ -#define __FTCACHE_H__ - - -#include <ft2build.h> -#include FT_GLYPH_H - - -FT_BEGIN_HEADER - - - /************************************************************************* - * - * <Section> - * cache_subsystem - * - * <Title> - * Cache Sub-System - * - * <Abstract> - * How to cache face, size, and glyph data with FreeType~2. - * - * <Description> - * This section describes the FreeType~2 cache sub-system, which is used - * to limit the number of concurrently opened @FT_Face and @FT_Size - * objects, as well as caching information like character maps and glyph - * images while limiting their maximum memory usage. - * - * Note that all types and functions begin with the `FTC_' prefix. - * - * The cache is highly portable and thus doesn't know anything about the - * fonts installed on your system, or how to access them. This implies - * the following scheme: - * - * First, available or installed font faces are uniquely identified by - * @FTC_FaceID values, provided to the cache by the client. Note that - * the cache only stores and compares these values, and doesn't try to - * interpret them in any way. - * - * Second, the cache calls, only when needed, a client-provided function - * to convert an @FTC_FaceID into a new @FT_Face object. The latter is - * then completely managed by the cache, including its termination - * through @FT_Done_Face. To monitor termination of face objects, the - * finalizer callback in the `generic' field of the @FT_Face object can - * be used, which might also be used to store the @FTC_FaceID of the - * face. - * - * Clients are free to map face IDs to anything else. The most simple - * usage is to associate them to a (pathname,face_index) pair that is - * used to call @FT_New_Face. However, more complex schemes are also - * possible. - * - * Note that for the cache to work correctly, the face ID values must be - * *persistent*, which means that the contents they point to should not - * change at runtime, or that their value should not become invalid. - * - * If this is unavoidable (e.g., when a font is uninstalled at runtime), - * you should call @FTC_Manager_RemoveFaceID as soon as possible, to let - * the cache get rid of any references to the old @FTC_FaceID it may - * keep internally. Failure to do so will lead to incorrect behaviour - * or even crashes. - * - * To use the cache, start with calling @FTC_Manager_New to create a new - * @FTC_Manager object, which models a single cache instance. You can - * then look up @FT_Face and @FT_Size objects with - * @FTC_Manager_LookupFace and @FTC_Manager_LookupSize, respectively. - * - * If you want to use the charmap caching, call @FTC_CMapCache_New, then - * later use @FTC_CMapCache_Lookup to perform the equivalent of - * @FT_Get_Char_Index, only much faster. - * - * If you want to use the @FT_Glyph caching, call @FTC_ImageCache, then - * later use @FTC_ImageCache_Lookup to retrieve the corresponding - * @FT_Glyph objects from the cache. - * - * If you need lots of small bitmaps, it is much more memory efficient - * to call @FTC_SBitCache_New followed by @FTC_SBitCache_Lookup. This - * returns @FTC_SBitRec structures, which are used to store small - * bitmaps directly. (A small bitmap is one whose metrics and - * dimensions all fit into 8-bit integers). - * - * We hope to also provide a kerning cache in the near future. - * - * - * <Order> - * FTC_Manager - * FTC_FaceID - * FTC_Face_Requester - * - * FTC_Manager_New - * FTC_Manager_Reset - * FTC_Manager_Done - * FTC_Manager_LookupFace - * FTC_Manager_LookupSize - * FTC_Manager_RemoveFaceID - * - * FTC_Node - * FTC_Node_Unref - * - * FTC_ImageCache - * FTC_ImageCache_New - * FTC_ImageCache_Lookup - * - * FTC_SBit - * FTC_SBitCache - * FTC_SBitCache_New - * FTC_SBitCache_Lookup - * - * FTC_CMapCache - * FTC_CMapCache_New - * FTC_CMapCache_Lookup - * - *************************************************************************/ - - - /*************************************************************************/ - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** BASIC TYPE DEFINITIONS *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - /*************************************************************************/ - - - /************************************************************************* - * - * @type: FTC_FaceID - * - * @description: - * An opaque pointer type that is used to identity face objects. The - * contents of such objects is application-dependent. - * - * These pointers are typically used to point to a user-defined - * structure containing a font file path, and face index. - * - * @note: - * Never use NULL as a valid @FTC_FaceID. - * - * Face IDs are passed by the client to the cache manager, which calls, - * when needed, the @FTC_Face_Requester to translate them into new - * @FT_Face objects. - * - * If the content of a given face ID changes at runtime, or if the value - * becomes invalid (e.g., when uninstalling a font), you should - * immediately call @FTC_Manager_RemoveFaceID before any other cache - * function. - * - * Failure to do so will result in incorrect behaviour or even - * memory leaks and crashes. - */ - typedef FT_Pointer FTC_FaceID; - - - /************************************************************************ - * - * @functype: - * FTC_Face_Requester - * - * @description: - * A callback function provided by client applications. It is used by - * the cache manager to translate a given @FTC_FaceID into a new valid - * @FT_Face object, on demand. - * - * <Input> - * face_id :: - * The face ID to resolve. - * - * library :: - * A handle to a FreeType library object. - * - * req_data :: - * Application-provided request data (see note below). - * - * <Output> - * aface :: - * A new @FT_Face handle. - * - * <Return> - * FreeType error code. 0~means success. - * - * <Note> - * The third parameter `req_data' is the same as the one passed by the - * client when @FTC_Manager_New is called. - * - * The face requester should not perform funny things on the returned - * face object, like creating a new @FT_Size for it, or setting a - * transformation through @FT_Set_Transform! - */ - typedef FT_Error - (*FTC_Face_Requester)( FTC_FaceID face_id, - FT_Library library, - FT_Pointer request_data, - FT_Face* aface ); - - /* */ - -#ifdef FT_CONFIG_OPTION_OLD_INTERNALS - - /* these macros are incompatible with LLP64, should not be used */ - -#define FT_POINTER_TO_ULONG( p ) ( (FT_ULong)(FT_Pointer)(p) ) - -#define FTC_FACE_ID_HASH( i ) \ - ((FT_UInt32)(( FT_POINTER_TO_ULONG( i ) >> 3 ) ^ \ - ( FT_POINTER_TO_ULONG( i ) << 7 ) ) ) - -#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */ - - /*************************************************************************/ - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** CACHE MANAGER OBJECT *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FTC_Manager */ - /* */ - /* <Description> */ - /* This object corresponds to one instance of the cache-subsystem. */ - /* It is used to cache one or more @FT_Face objects, along with */ - /* corresponding @FT_Size objects. */ - /* */ - /* The manager intentionally limits the total number of opened */ - /* @FT_Face and @FT_Size objects to control memory usage. See the */ - /* `max_faces' and `max_sizes' parameters of @FTC_Manager_New. */ - /* */ - /* The manager is also used to cache `nodes' of various types while */ - /* limiting their total memory usage. */ - /* */ - /* All limitations are enforced by keeping lists of managed objects */ - /* in most-recently-used order, and flushing old nodes to make room */ - /* for new ones. */ - /* */ - typedef struct FTC_ManagerRec_* FTC_Manager; - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FTC_Node */ - /* */ - /* <Description> */ - /* An opaque handle to a cache node object. Each cache node is */ - /* reference-counted. A node with a count of~0 might be flushed */ - /* out of a full cache whenever a lookup request is performed. */ - /* */ - /* If you look up nodes, you have the ability to `acquire' them, */ - /* i.e., to increment their reference count. This will prevent the */ - /* node from being flushed out of the cache until you explicitly */ - /* `release' it (see @FTC_Node_Unref). */ - /* */ - /* See also @FTC_SBitCache_Lookup and @FTC_ImageCache_Lookup. */ - /* */ - typedef struct FTC_NodeRec_* FTC_Node; - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FTC_Manager_New */ - /* */ - /* <Description> */ - /* Create a new cache manager. */ - /* */ - /* <Input> */ - /* library :: The parent FreeType library handle to use. */ - /* */ - /* max_faces :: Maximum number of opened @FT_Face objects managed by */ - /* this cache instance. Use~0 for defaults. */ - /* */ - /* max_sizes :: Maximum number of opened @FT_Size objects managed by */ - /* this cache instance. Use~0 for defaults. */ - /* */ - /* max_bytes :: Maximum number of bytes to use for cached data nodes. */ - /* Use~0 for defaults. Note that this value does not */ - /* account for managed @FT_Face and @FT_Size objects. */ - /* */ - /* requester :: An application-provided callback used to translate */ - /* face IDs into real @FT_Face objects. */ - /* */ - /* req_data :: A generic pointer that is passed to the requester */ - /* each time it is called (see @FTC_Face_Requester). */ - /* */ - /* <Output> */ - /* amanager :: A handle to a new manager object. 0~in case of */ - /* failure. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - FT_EXPORT( FT_Error ) - FTC_Manager_New( FT_Library library, - FT_UInt max_faces, - FT_UInt max_sizes, - FT_ULong max_bytes, - FTC_Face_Requester requester, - FT_Pointer req_data, - FTC_Manager *amanager ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FTC_Manager_Reset */ - /* */ - /* <Description> */ - /* Empty a given cache manager. This simply gets rid of all the */ - /* currently cached @FT_Face and @FT_Size objects within the manager. */ - /* */ - /* <InOut> */ - /* manager :: A handle to the manager. */ - /* */ - FT_EXPORT( void ) - FTC_Manager_Reset( FTC_Manager manager ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FTC_Manager_Done */ - /* */ - /* <Description> */ - /* Destroy a given manager after emptying it. */ - /* */ - /* <Input> */ - /* manager :: A handle to the target cache manager object. */ - /* */ - FT_EXPORT( void ) - FTC_Manager_Done( FTC_Manager manager ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FTC_Manager_LookupFace */ - /* */ - /* <Description> */ - /* Retrieve the @FT_Face object that corresponds to a given face ID */ - /* through a cache manager. */ - /* */ - /* <Input> */ - /* manager :: A handle to the cache manager. */ - /* */ - /* face_id :: The ID of the face object. */ - /* */ - /* <Output> */ - /* aface :: A handle to the face object. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - /* <Note> */ - /* The returned @FT_Face object is always owned by the manager. You */ - /* should never try to discard it yourself. */ - /* */ - /* The @FT_Face object doesn't necessarily have a current size object */ - /* (i.e., face->size can be 0). If you need a specific `font size', */ - /* use @FTC_Manager_LookupSize instead. */ - /* */ - /* Never change the face's transformation matrix (i.e., never call */ - /* the @FT_Set_Transform function) on a returned face! If you need */ - /* to transform glyphs, do it yourself after glyph loading. */ - /* */ - /* When you perform a lookup, out-of-memory errors are detected */ - /* _within_ the lookup and force incremental flushes of the cache */ - /* until enough memory is released for the lookup to succeed. */ - /* */ - /* If a lookup fails with `FT_Err_Out_Of_Memory' the cache has */ - /* already been completely flushed, and still no memory was available */ - /* for the operation. */ - /* */ - FT_EXPORT( FT_Error ) - FTC_Manager_LookupFace( FTC_Manager manager, - FTC_FaceID face_id, - FT_Face *aface ); - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FTC_ScalerRec */ - /* */ - /* <Description> */ - /* A structure used to describe a given character size in either */ - /* pixels or points to the cache manager. See */ - /* @FTC_Manager_LookupSize. */ - /* */ - /* <Fields> */ - /* face_id :: The source face ID. */ - /* */ - /* width :: The character width. */ - /* */ - /* height :: The character height. */ - /* */ - /* pixel :: A Boolean. If 1, the `width' and `height' fields are */ - /* interpreted as integer pixel character sizes. */ - /* Otherwise, they are expressed as 1/64th of points. */ - /* */ - /* x_res :: Only used when `pixel' is value~0 to indicate the */ - /* horizontal resolution in dpi. */ - /* */ - /* y_res :: Only used when `pixel' is value~0 to indicate the */ - /* vertical resolution in dpi. */ - /* */ - /* <Note> */ - /* This type is mainly used to retrieve @FT_Size objects through the */ - /* cache manager. */ - /* */ - typedef struct FTC_ScalerRec_ - { - FTC_FaceID face_id; - FT_UInt width; - FT_UInt height; - FT_Int pixel; - FT_UInt x_res; - FT_UInt y_res; - - } FTC_ScalerRec; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FTC_Scaler */ - /* */ - /* <Description> */ - /* A handle to an @FTC_ScalerRec structure. */ - /* */ - typedef struct FTC_ScalerRec_* FTC_Scaler; - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FTC_Manager_LookupSize */ - /* */ - /* <Description> */ - /* Retrieve the @FT_Size object that corresponds to a given */ - /* @FTC_ScalerRec pointer through a cache manager. */ - /* */ - /* <Input> */ - /* manager :: A handle to the cache manager. */ - /* */ - /* scaler :: A scaler handle. */ - /* */ - /* <Output> */ - /* asize :: A handle to the size object. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - /* <Note> */ - /* The returned @FT_Size object is always owned by the manager. You */ - /* should never try to discard it by yourself. */ - /* */ - /* You can access the parent @FT_Face object simply as `size->face' */ - /* if you need it. Note that this object is also owned by the */ - /* manager. */ - /* */ - /* <Note> */ - /* When you perform a lookup, out-of-memory errors are detected */ - /* _within_ the lookup and force incremental flushes of the cache */ - /* until enough memory is released for the lookup to succeed. */ - /* */ - /* If a lookup fails with `FT_Err_Out_Of_Memory' the cache has */ - /* already been completely flushed, and still no memory is available */ - /* for the operation. */ - /* */ - FT_EXPORT( FT_Error ) - FTC_Manager_LookupSize( FTC_Manager manager, - FTC_Scaler scaler, - FT_Size *asize ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FTC_Node_Unref */ - /* */ - /* <Description> */ - /* Decrement a cache node's internal reference count. When the count */ - /* reaches 0, it is not destroyed but becomes eligible for subsequent */ - /* cache flushes. */ - /* */ - /* <Input> */ - /* node :: The cache node handle. */ - /* */ - /* manager :: The cache manager handle. */ - /* */ - FT_EXPORT( void ) - FTC_Node_Unref( FTC_Node node, - FTC_Manager manager ); - - - /************************************************************************* - * - * @function: - * FTC_Manager_RemoveFaceID - * - * @description: - * A special function used to indicate to the cache manager that - * a given @FTC_FaceID is no longer valid, either because its - * content changed, or because it was deallocated or uninstalled. - * - * @input: - * manager :: - * The cache manager handle. - * - * face_id :: - * The @FTC_FaceID to be removed. - * - * @note: - * This function flushes all nodes from the cache corresponding to this - * `face_id', with the exception of nodes with a non-null reference - * count. - * - * Such nodes are however modified internally so as to never appear - * in later lookups with the same `face_id' value, and to be immediately - * destroyed when released by all their users. - * - */ - FT_EXPORT( void ) - FTC_Manager_RemoveFaceID( FTC_Manager manager, - FTC_FaceID face_id ); - - - /*************************************************************************/ - /* */ - /* <Section> */ - /* cache_subsystem */ - /* */ - /*************************************************************************/ - - /************************************************************************* - * - * @type: - * FTC_CMapCache - * - * @description: - * An opaque handle used to model a charmap cache. This cache is to - * hold character codes -> glyph indices mappings. - * - */ - typedef struct FTC_CMapCacheRec_* FTC_CMapCache; - - - /************************************************************************* - * - * @function: - * FTC_CMapCache_New - * - * @description: - * Create a new charmap cache. - * - * @input: - * manager :: - * A handle to the cache manager. - * - * @output: - * acache :: - * A new cache handle. NULL in case of error. - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * Like all other caches, this one will be destroyed with the cache - * manager. - * - */ - FT_EXPORT( FT_Error ) - FTC_CMapCache_New( FTC_Manager manager, - FTC_CMapCache *acache ); - - - /************************************************************************ - * - * @function: - * FTC_CMapCache_Lookup - * - * @description: - * Translate a character code into a glyph index, using the charmap - * cache. - * - * @input: - * cache :: - * A charmap cache handle. - * - * face_id :: - * The source face ID. - * - * cmap_index :: - * The index of the charmap in the source face. Any negative value - * means to use the cache @FT_Face's default charmap. - * - * char_code :: - * The character code (in the corresponding charmap). - * - * @return: - * Glyph index. 0~means `no glyph'. - * - */ - FT_EXPORT( FT_UInt ) - FTC_CMapCache_Lookup( FTC_CMapCache cache, - FTC_FaceID face_id, - FT_Int cmap_index, - FT_UInt32 char_code ); - - - /*************************************************************************/ - /* */ - /* <Section> */ - /* cache_subsystem */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** IMAGE CACHE OBJECT *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - /*************************************************************************/ - - - /************************************************************************* - * - * @struct: - * FTC_ImageTypeRec - * - * @description: - * A structure used to model the type of images in a glyph cache. - * - * @fields: - * face_id :: - * The face ID. - * - * width :: - * The width in pixels. - * - * height :: - * The height in pixels. - * - * flags :: - * The load flags, as in @FT_Load_Glyph. - * - */ - typedef struct FTC_ImageTypeRec_ - { - FTC_FaceID face_id; - FT_Int width; - FT_Int height; - FT_Int32 flags; - - } FTC_ImageTypeRec; - - - /************************************************************************* - * - * @type: - * FTC_ImageType - * - * @description: - * A handle to an @FTC_ImageTypeRec structure. - * - */ - typedef struct FTC_ImageTypeRec_* FTC_ImageType; - - - /* */ - - -#define FTC_IMAGE_TYPE_COMPARE( d1, d2 ) \ - ( (d1)->face_id == (d2)->face_id && \ - (d1)->width == (d2)->width && \ - (d1)->flags == (d2)->flags ) - -#ifdef FT_CONFIG_OPTION_OLD_INTERNALS - - /* this macro is incompatible with LLP64, should not be used */ - -#define FTC_IMAGE_TYPE_HASH( d ) \ - (FT_UFast)( FTC_FACE_ID_HASH( (d)->face_id ) ^ \ - ( (d)->width << 8 ) ^ (d)->height ^ \ - ( (d)->flags << 4 ) ) - -#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */ - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FTC_ImageCache */ - /* */ - /* <Description> */ - /* A handle to an glyph image cache object. They are designed to */ - /* hold many distinct glyph images while not exceeding a certain */ - /* memory threshold. */ - /* */ - typedef struct FTC_ImageCacheRec_* FTC_ImageCache; - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FTC_ImageCache_New */ - /* */ - /* <Description> */ - /* Create a new glyph image cache. */ - /* */ - /* <Input> */ - /* manager :: The parent manager for the image cache. */ - /* */ - /* <Output> */ - /* acache :: A handle to the new glyph image cache object. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - FT_EXPORT( FT_Error ) - FTC_ImageCache_New( FTC_Manager manager, - FTC_ImageCache *acache ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FTC_ImageCache_Lookup */ - /* */ - /* <Description> */ - /* Retrieve a given glyph image from a glyph image cache. */ - /* */ - /* <Input> */ - /* cache :: A handle to the source glyph image cache. */ - /* */ - /* type :: A pointer to a glyph image type descriptor. */ - /* */ - /* gindex :: The glyph index to retrieve. */ - /* */ - /* <Output> */ - /* aglyph :: The corresponding @FT_Glyph object. 0~in case of */ - /* failure. */ - /* */ - /* anode :: Used to return the address of of the corresponding cache */ - /* node after incrementing its reference count (see note */ - /* below). */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - /* <Note> */ - /* The returned glyph is owned and managed by the glyph image cache. */ - /* Never try to transform or discard it manually! You can however */ - /* create a copy with @FT_Glyph_Copy and modify the new one. */ - /* */ - /* If `anode' is _not_ NULL, it receives the address of the cache */ - /* node containing the glyph image, after increasing its reference */ - /* count. This ensures that the node (as well as the @FT_Glyph) will */ - /* always be kept in the cache until you call @FTC_Node_Unref to */ - /* `release' it. */ - /* */ - /* If `anode' is NULL, the cache node is left unchanged, which means */ - /* that the @FT_Glyph could be flushed out of the cache on the next */ - /* call to one of the caching sub-system APIs. Don't assume that it */ - /* is persistent! */ - /* */ - FT_EXPORT( FT_Error ) - FTC_ImageCache_Lookup( FTC_ImageCache cache, - FTC_ImageType type, - FT_UInt gindex, - FT_Glyph *aglyph, - FTC_Node *anode ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FTC_ImageCache_LookupScaler */ - /* */ - /* <Description> */ - /* A variant of @FTC_ImageCache_Lookup that uses an @FTC_ScalerRec */ - /* to specify the face ID and its size. */ - /* */ - /* <Input> */ - /* cache :: A handle to the source glyph image cache. */ - /* */ - /* scaler :: A pointer to a scaler descriptor. */ - /* */ - /* load_flags :: The corresponding load flags. */ - /* */ - /* gindex :: The glyph index to retrieve. */ - /* */ - /* <Output> */ - /* aglyph :: The corresponding @FT_Glyph object. 0~in case of */ - /* failure. */ - /* */ - /* anode :: Used to return the address of of the corresponding */ - /* cache node after incrementing its reference count */ - /* (see note below). */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - /* <Note> */ - /* The returned glyph is owned and managed by the glyph image cache. */ - /* Never try to transform or discard it manually! You can however */ - /* create a copy with @FT_Glyph_Copy and modify the new one. */ - /* */ - /* If `anode' is _not_ NULL, it receives the address of the cache */ - /* node containing the glyph image, after increasing its reference */ - /* count. This ensures that the node (as well as the @FT_Glyph) will */ - /* always be kept in the cache until you call @FTC_Node_Unref to */ - /* `release' it. */ - /* */ - /* If `anode' is NULL, the cache node is left unchanged, which means */ - /* that the @FT_Glyph could be flushed out of the cache on the next */ - /* call to one of the caching sub-system APIs. Don't assume that it */ - /* is persistent! */ - /* */ - /* Calls to @FT_Set_Char_Size and friends have no effect on cached */ - /* glyphs; you should always use the FreeType cache API instead. */ - /* */ - FT_EXPORT( FT_Error ) - FTC_ImageCache_LookupScaler( FTC_ImageCache cache, - FTC_Scaler scaler, - FT_ULong load_flags, - FT_UInt gindex, - FT_Glyph *aglyph, - FTC_Node *anode ); - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FTC_SBit */ - /* */ - /* <Description> */ - /* A handle to a small bitmap descriptor. See the @FTC_SBitRec */ - /* structure for details. */ - /* */ - typedef struct FTC_SBitRec_* FTC_SBit; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FTC_SBitRec */ - /* */ - /* <Description> */ - /* A very compact structure used to describe a small glyph bitmap. */ - /* */ - /* <Fields> */ - /* width :: The bitmap width in pixels. */ - /* */ - /* height :: The bitmap height in pixels. */ - /* */ - /* left :: The horizontal distance from the pen position to the */ - /* left bitmap border (a.k.a. `left side bearing', or */ - /* `lsb'). */ - /* */ - /* top :: The vertical distance from the pen position (on the */ - /* baseline) to the upper bitmap border (a.k.a. `top */ - /* side bearing'). The distance is positive for upwards */ - /* y~coordinates. */ - /* */ - /* format :: The format of the glyph bitmap (monochrome or gray). */ - /* */ - /* max_grays :: Maximum gray level value (in the range 1 to~255). */ - /* */ - /* pitch :: The number of bytes per bitmap line. May be positive */ - /* or negative. */ - /* */ - /* xadvance :: The horizontal advance width in pixels. */ - /* */ - /* yadvance :: The vertical advance height in pixels. */ - /* */ - /* buffer :: A pointer to the bitmap pixels. */ - /* */ - typedef struct FTC_SBitRec_ - { - FT_Byte width; - FT_Byte height; - FT_Char left; - FT_Char top; - - FT_Byte format; - FT_Byte max_grays; - FT_Short pitch; - FT_Char xadvance; - FT_Char yadvance; - - FT_Byte* buffer; - - } FTC_SBitRec; - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FTC_SBitCache */ - /* */ - /* <Description> */ - /* A handle to a small bitmap cache. These are special cache objects */ - /* used to store small glyph bitmaps (and anti-aliased pixmaps) in a */ - /* much more efficient way than the traditional glyph image cache */ - /* implemented by @FTC_ImageCache. */ - /* */ - typedef struct FTC_SBitCacheRec_* FTC_SBitCache; - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FTC_SBitCache_New */ - /* */ - /* <Description> */ - /* Create a new cache to store small glyph bitmaps. */ - /* */ - /* <Input> */ - /* manager :: A handle to the source cache manager. */ - /* */ - /* <Output> */ - /* acache :: A handle to the new sbit cache. NULL in case of error. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - FT_EXPORT( FT_Error ) - FTC_SBitCache_New( FTC_Manager manager, - FTC_SBitCache *acache ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FTC_SBitCache_Lookup */ - /* */ - /* <Description> */ - /* Look up a given small glyph bitmap in a given sbit cache and */ - /* `lock' it to prevent its flushing from the cache until needed. */ - /* */ - /* <Input> */ - /* cache :: A handle to the source sbit cache. */ - /* */ - /* type :: A pointer to the glyph image type descriptor. */ - /* */ - /* gindex :: The glyph index. */ - /* */ - /* <Output> */ - /* sbit :: A handle to a small bitmap descriptor. */ - /* */ - /* anode :: Used to return the address of of the corresponding cache */ - /* node after incrementing its reference count (see note */ - /* below). */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - /* <Note> */ - /* The small bitmap descriptor and its bit buffer are owned by the */ - /* cache and should never be freed by the application. They might */ - /* as well disappear from memory on the next cache lookup, so don't */ - /* treat them as persistent data. */ - /* */ - /* The descriptor's `buffer' field is set to~0 to indicate a missing */ - /* glyph bitmap. */ - /* */ - /* If `anode' is _not_ NULL, it receives the address of the cache */ - /* node containing the bitmap, after increasing its reference count. */ - /* This ensures that the node (as well as the image) will always be */ - /* kept in the cache until you call @FTC_Node_Unref to `release' it. */ - /* */ - /* If `anode' is NULL, the cache node is left unchanged, which means */ - /* that the bitmap could be flushed out of the cache on the next */ - /* call to one of the caching sub-system APIs. Don't assume that it */ - /* is persistent! */ - /* */ - FT_EXPORT( FT_Error ) - FTC_SBitCache_Lookup( FTC_SBitCache cache, - FTC_ImageType type, - FT_UInt gindex, - FTC_SBit *sbit, - FTC_Node *anode ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FTC_SBitCache_LookupScaler */ - /* */ - /* <Description> */ - /* A variant of @FTC_SBitCache_Lookup that uses an @FTC_ScalerRec */ - /* to specify the face ID and its size. */ - /* */ - /* <Input> */ - /* cache :: A handle to the source sbit cache. */ - /* */ - /* scaler :: A pointer to the scaler descriptor. */ - /* */ - /* load_flags :: The corresponding load flags. */ - /* */ - /* gindex :: The glyph index. */ - /* */ - /* <Output> */ - /* sbit :: A handle to a small bitmap descriptor. */ - /* */ - /* anode :: Used to return the address of of the corresponding */ - /* cache node after incrementing its reference count */ - /* (see note below). */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - /* <Note> */ - /* The small bitmap descriptor and its bit buffer are owned by the */ - /* cache and should never be freed by the application. They might */ - /* as well disappear from memory on the next cache lookup, so don't */ - /* treat them as persistent data. */ - /* */ - /* The descriptor's `buffer' field is set to~0 to indicate a missing */ - /* glyph bitmap. */ - /* */ - /* If `anode' is _not_ NULL, it receives the address of the cache */ - /* node containing the bitmap, after increasing its reference count. */ - /* This ensures that the node (as well as the image) will always be */ - /* kept in the cache until you call @FTC_Node_Unref to `release' it. */ - /* */ - /* If `anode' is NULL, the cache node is left unchanged, which means */ - /* that the bitmap could be flushed out of the cache on the next */ - /* call to one of the caching sub-system APIs. Don't assume that it */ - /* is persistent! */ - /* */ - FT_EXPORT( FT_Error ) - FTC_SBitCache_LookupScaler( FTC_SBitCache cache, - FTC_Scaler scaler, - FT_ULong load_flags, - FT_UInt gindex, - FTC_SBit *sbit, - FTC_Node *anode ); - - - /* */ - -#ifdef FT_CONFIG_OPTION_OLD_INTERNALS - - /*@***********************************************************************/ - /* */ - /* <Struct> */ - /* FTC_FontRec */ - /* */ - /* <Description> */ - /* A simple structure used to describe a given `font' to the cache */ - /* manager. Note that a `font' is the combination of a given face */ - /* with a given character size. */ - /* */ - /* <Fields> */ - /* face_id :: The ID of the face to use. */ - /* */ - /* pix_width :: The character width in integer pixels. */ - /* */ - /* pix_height :: The character height in integer pixels. */ - /* */ - typedef struct FTC_FontRec_ - { - FTC_FaceID face_id; - FT_UShort pix_width; - FT_UShort pix_height; - - } FTC_FontRec; - - - /* */ - - -#define FTC_FONT_COMPARE( f1, f2 ) \ - ( (f1)->face_id == (f2)->face_id && \ - (f1)->pix_width == (f2)->pix_width && \ - (f1)->pix_height == (f2)->pix_height ) - - /* this macro is incompatible with LLP64, should not be used */ -#define FTC_FONT_HASH( f ) \ - (FT_UInt32)( FTC_FACE_ID_HASH((f)->face_id) ^ \ - ((f)->pix_width << 8) ^ \ - ((f)->pix_height) ) - - typedef FTC_FontRec* FTC_Font; - - - FT_EXPORT( FT_Error ) - FTC_Manager_Lookup_Face( FTC_Manager manager, - FTC_FaceID face_id, - FT_Face *aface ); - - FT_EXPORT( FT_Error ) - FTC_Manager_Lookup_Size( FTC_Manager manager, - FTC_Font font, - FT_Face *aface, - FT_Size *asize ); - -#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */ - - - /* */ - -FT_END_HEADER - -#endif /* __FTCACHE_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftchapters.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftchapters.h deleted file mode 100644 index 6cdf54e495..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftchapters.h +++ /dev/null @@ -1,104 +0,0 @@ -/***************************************************************************/ -/* */ -/* This file defines the structure of the FreeType reference. */ -/* It is used by the python script which generates the HTML files. */ -/* */ -/***************************************************************************/ - - -/***************************************************************************/ -/* */ -/* <Chapter> */ -/* general_remarks */ -/* */ -/* <Title> */ -/* General Remarks */ -/* */ -/* <Sections> */ -/* user_allocation */ -/* */ -/***************************************************************************/ - - -/***************************************************************************/ -/* */ -/* <Chapter> */ -/* core_api */ -/* */ -/* <Title> */ -/* Core API */ -/* */ -/* <Sections> */ -/* version */ -/* basic_types */ -/* base_interface */ -/* glyph_variants */ -/* glyph_management */ -/* mac_specific */ -/* sizes_management */ -/* header_file_macros */ -/* */ -/***************************************************************************/ - - -/***************************************************************************/ -/* */ -/* <Chapter> */ -/* format_specific */ -/* */ -/* <Title> */ -/* Format-Specific API */ -/* */ -/* <Sections> */ -/* multiple_masters */ -/* truetype_tables */ -/* type1_tables */ -/* sfnt_names */ -/* bdf_fonts */ -/* cid_fonts */ -/* pfr_fonts */ -/* winfnt_fonts */ -/* font_formats */ -/* gasp_table */ -/* */ -/***************************************************************************/ - - -/***************************************************************************/ -/* */ -/* <Chapter> */ -/* cache_subsystem */ -/* */ -/* <Title> */ -/* Cache Sub-System */ -/* */ -/* <Sections> */ -/* cache_subsystem */ -/* */ -/***************************************************************************/ - - -/***************************************************************************/ -/* */ -/* <Chapter> */ -/* support_api */ -/* */ -/* <Title> */ -/* Support API */ -/* */ -/* <Sections> */ -/* computations */ -/* list_processing */ -/* outline_processing */ -/* quick_advance */ -/* bitmap_handling */ -/* raster */ -/* glyph_stroker */ -/* system_interface */ -/* module_management */ -/* gzip */ -/* lzw */ -/* bzip2 */ -/* lcd_filtering */ -/* */ -/***************************************************************************/ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftcid.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftcid.h deleted file mode 100644 index 203a30caf8..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftcid.h +++ /dev/null @@ -1,166 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftcid.h */ -/* */ -/* FreeType API for accessing CID font information (specification). */ -/* */ -/* Copyright 2007, 2009 by Dereg Clegg, Michael Toftdal. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __FTCID_H__ -#define __FTCID_H__ - -#include <ft2build.h> -#include FT_FREETYPE_H - -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - - -FT_BEGIN_HEADER - - - /*************************************************************************/ - /* */ - /* <Section> */ - /* cid_fonts */ - /* */ - /* <Title> */ - /* CID Fonts */ - /* */ - /* <Abstract> */ - /* CID-keyed font specific API. */ - /* */ - /* <Description> */ - /* This section contains the declaration of CID-keyed font specific */ - /* functions. */ - /* */ - /*************************************************************************/ - - - /********************************************************************** - * - * @function: - * FT_Get_CID_Registry_Ordering_Supplement - * - * @description: - * Retrieve the Registry/Ordering/Supplement triple (also known as the - * "R/O/S") from a CID-keyed font. - * - * @input: - * face :: - * A handle to the input face. - * - * @output: - * registry :: - * The registry, as a C~string, owned by the face. - * - * ordering :: - * The ordering, as a C~string, owned by the face. - * - * supplement :: - * The supplement. - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * This function only works with CID faces, returning an error - * otherwise. - * - * @since: - * 2.3.6 - */ - FT_EXPORT( FT_Error ) - FT_Get_CID_Registry_Ordering_Supplement( FT_Face face, - const char* *registry, - const char* *ordering, - FT_Int *supplement); - - - /********************************************************************** - * - * @function: - * FT_Get_CID_Is_Internally_CID_Keyed - * - * @description: - * Retrieve the type of the input face, CID keyed or not. In - * constrast to the @FT_IS_CID_KEYED macro this function returns - * successfully also for CID-keyed fonts in an SNFT wrapper. - * - * @input: - * face :: - * A handle to the input face. - * - * @output: - * is_cid :: - * The type of the face as an @FT_Bool. - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * This function only works with CID faces and OpenType fonts, - * returning an error otherwise. - * - * @since: - * 2.3.9 - */ - FT_EXPORT( FT_Error ) - FT_Get_CID_Is_Internally_CID_Keyed( FT_Face face, - FT_Bool *is_cid ); - - - /********************************************************************** - * - * @function: - * FT_Get_CID_From_Glyph_Index - * - * @description: - * Retrieve the CID of the input glyph index. - * - * @input: - * face :: - * A handle to the input face. - * - * glyph_index :: - * The input glyph index. - * - * @output: - * cid :: - * The CID as an @FT_UInt. - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * This function only works with CID faces and OpenType fonts, - * returning an error otherwise. - * - * @since: - * 2.3.9 - */ - FT_EXPORT( FT_Error ) - FT_Get_CID_From_Glyph_Index( FT_Face face, - FT_UInt glyph_index, - FT_UInt *cid ); - - /* */ - -FT_END_HEADER - -#endif /* __FTCID_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/fterrdef.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/fterrdef.h deleted file mode 100644 index fb4b53bca0..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/fterrdef.h +++ /dev/null @@ -1,245 +0,0 @@ -/***************************************************************************/ -/* */ -/* fterrdef.h */ -/* */ -/* FreeType error codes (specification). */ -/* */ -/* Copyright 2002, 2004, 2006, 2007, 2010-2011 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - - /*******************************************************************/ - /*******************************************************************/ - /***** *****/ - /***** LIST OF ERROR CODES/MESSAGES *****/ - /***** *****/ - /*******************************************************************/ - /*******************************************************************/ - - - /* You need to define both FT_ERRORDEF_ and FT_NOERRORDEF_ before */ - /* including this file. */ - - - /* generic errors */ - - FT_NOERRORDEF_( Ok, 0x00, \ - "no error" ) - - FT_ERRORDEF_( Cannot_Open_Resource, 0x01, \ - "cannot open resource" ) - FT_ERRORDEF_( Unknown_File_Format, 0x02, \ - "unknown file format" ) - FT_ERRORDEF_( Invalid_File_Format, 0x03, \ - "broken file" ) - FT_ERRORDEF_( Invalid_Version, 0x04, \ - "invalid FreeType version" ) - FT_ERRORDEF_( Lower_Module_Version, 0x05, \ - "module version is too low" ) - FT_ERRORDEF_( Invalid_Argument, 0x06, \ - "invalid argument" ) - FT_ERRORDEF_( Unimplemented_Feature, 0x07, \ - "unimplemented feature" ) - FT_ERRORDEF_( Invalid_Table, 0x08, \ - "broken table" ) - FT_ERRORDEF_( Invalid_Offset, 0x09, \ - "broken offset within table" ) - FT_ERRORDEF_( Array_Too_Large, 0x0A, \ - "array allocation size too large" ) - FT_ERRORDEF_( Missing_Module, 0x0B, \ - "missing module" ) - - /* glyph/character errors */ - - FT_ERRORDEF_( Invalid_Glyph_Index, 0x10, \ - "invalid glyph index" ) - FT_ERRORDEF_( Invalid_Character_Code, 0x11, \ - "invalid character code" ) - FT_ERRORDEF_( Invalid_Glyph_Format, 0x12, \ - "unsupported glyph image format" ) - FT_ERRORDEF_( Cannot_Render_Glyph, 0x13, \ - "cannot render this glyph format" ) - FT_ERRORDEF_( Invalid_Outline, 0x14, \ - "invalid outline" ) - FT_ERRORDEF_( Invalid_Composite, 0x15, \ - "invalid composite glyph" ) - FT_ERRORDEF_( Too_Many_Hints, 0x16, \ - "too many hints" ) - FT_ERRORDEF_( Invalid_Pixel_Size, 0x17, \ - "invalid pixel size" ) - - /* handle errors */ - - FT_ERRORDEF_( Invalid_Handle, 0x20, \ - "invalid object handle" ) - FT_ERRORDEF_( Invalid_Library_Handle, 0x21, \ - "invalid library handle" ) - FT_ERRORDEF_( Invalid_Driver_Handle, 0x22, \ - "invalid module handle" ) - FT_ERRORDEF_( Invalid_Face_Handle, 0x23, \ - "invalid face handle" ) - FT_ERRORDEF_( Invalid_Size_Handle, 0x24, \ - "invalid size handle" ) - FT_ERRORDEF_( Invalid_Slot_Handle, 0x25, \ - "invalid glyph slot handle" ) - FT_ERRORDEF_( Invalid_CharMap_Handle, 0x26, \ - "invalid charmap handle" ) - FT_ERRORDEF_( Invalid_Cache_Handle, 0x27, \ - "invalid cache manager handle" ) - FT_ERRORDEF_( Invalid_Stream_Handle, 0x28, \ - "invalid stream handle" ) - - /* driver errors */ - - FT_ERRORDEF_( Too_Many_Drivers, 0x30, \ - "too many modules" ) - FT_ERRORDEF_( Too_Many_Extensions, 0x31, \ - "too many extensions" ) - - /* memory errors */ - - FT_ERRORDEF_( Out_Of_Memory, 0x40, \ - "out of memory" ) - FT_ERRORDEF_( Unlisted_Object, 0x41, \ - "unlisted object" ) - - /* stream errors */ - - FT_ERRORDEF_( Cannot_Open_Stream, 0x51, \ - "cannot open stream" ) - FT_ERRORDEF_( Invalid_Stream_Seek, 0x52, \ - "invalid stream seek" ) - FT_ERRORDEF_( Invalid_Stream_Skip, 0x53, \ - "invalid stream skip" ) - FT_ERRORDEF_( Invalid_Stream_Read, 0x54, \ - "invalid stream read" ) - FT_ERRORDEF_( Invalid_Stream_Operation, 0x55, \ - "invalid stream operation" ) - FT_ERRORDEF_( Invalid_Frame_Operation, 0x56, \ - "invalid frame operation" ) - FT_ERRORDEF_( Nested_Frame_Access, 0x57, \ - "nested frame access" ) - FT_ERRORDEF_( Invalid_Frame_Read, 0x58, \ - "invalid frame read" ) - - /* raster errors */ - - FT_ERRORDEF_( Raster_Uninitialized, 0x60, \ - "raster uninitialized" ) - FT_ERRORDEF_( Raster_Corrupted, 0x61, \ - "raster corrupted" ) - FT_ERRORDEF_( Raster_Overflow, 0x62, \ - "raster overflow" ) - FT_ERRORDEF_( Raster_Negative_Height, 0x63, \ - "negative height while rastering" ) - - /* cache errors */ - - FT_ERRORDEF_( Too_Many_Caches, 0x70, \ - "too many registered caches" ) - - /* TrueType and SFNT errors */ - - FT_ERRORDEF_( Invalid_Opcode, 0x80, \ - "invalid opcode" ) - FT_ERRORDEF_( Too_Few_Arguments, 0x81, \ - "too few arguments" ) - FT_ERRORDEF_( Stack_Overflow, 0x82, \ - "stack overflow" ) - FT_ERRORDEF_( Code_Overflow, 0x83, \ - "code overflow" ) - FT_ERRORDEF_( Bad_Argument, 0x84, \ - "bad argument" ) - FT_ERRORDEF_( Divide_By_Zero, 0x85, \ - "division by zero" ) - FT_ERRORDEF_( Invalid_Reference, 0x86, \ - "invalid reference" ) - FT_ERRORDEF_( Debug_OpCode, 0x87, \ - "found debug opcode" ) - FT_ERRORDEF_( ENDF_In_Exec_Stream, 0x88, \ - "found ENDF opcode in execution stream" ) - FT_ERRORDEF_( Nested_DEFS, 0x89, \ - "nested DEFS" ) - FT_ERRORDEF_( Invalid_CodeRange, 0x8A, \ - "invalid code range" ) - FT_ERRORDEF_( Execution_Too_Long, 0x8B, \ - "execution context too long" ) - FT_ERRORDEF_( Too_Many_Function_Defs, 0x8C, \ - "too many function definitions" ) - FT_ERRORDEF_( Too_Many_Instruction_Defs, 0x8D, \ - "too many instruction definitions" ) - FT_ERRORDEF_( Table_Missing, 0x8E, \ - "SFNT font table missing" ) - FT_ERRORDEF_( Horiz_Header_Missing, 0x8F, \ - "horizontal header (hhea) table missing" ) - FT_ERRORDEF_( Locations_Missing, 0x90, \ - "locations (loca) table missing" ) - FT_ERRORDEF_( Name_Table_Missing, 0x91, \ - "name table missing" ) - FT_ERRORDEF_( CMap_Table_Missing, 0x92, \ - "character map (cmap) table missing" ) - FT_ERRORDEF_( Hmtx_Table_Missing, 0x93, \ - "horizontal metrics (hmtx) table missing" ) - FT_ERRORDEF_( Post_Table_Missing, 0x94, \ - "PostScript (post) table missing" ) - FT_ERRORDEF_( Invalid_Horiz_Metrics, 0x95, \ - "invalid horizontal metrics" ) - FT_ERRORDEF_( Invalid_CharMap_Format, 0x96, \ - "invalid character map (cmap) format" ) - FT_ERRORDEF_( Invalid_PPem, 0x97, \ - "invalid ppem value" ) - FT_ERRORDEF_( Invalid_Vert_Metrics, 0x98, \ - "invalid vertical metrics" ) - FT_ERRORDEF_( Could_Not_Find_Context, 0x99, \ - "could not find context" ) - FT_ERRORDEF_( Invalid_Post_Table_Format, 0x9A, \ - "invalid PostScript (post) table format" ) - FT_ERRORDEF_( Invalid_Post_Table, 0x9B, \ - "invalid PostScript (post) table" ) - - /* CFF, CID, and Type 1 errors */ - - FT_ERRORDEF_( Syntax_Error, 0xA0, \ - "opcode syntax error" ) - FT_ERRORDEF_( Stack_Underflow, 0xA1, \ - "argument stack underflow" ) - FT_ERRORDEF_( Ignore, 0xA2, \ - "ignore" ) - FT_ERRORDEF_( No_Unicode_Glyph_Name, 0xA3, \ - "no Unicode glyph name found" ) - - /* BDF errors */ - - FT_ERRORDEF_( Missing_Startfont_Field, 0xB0, \ - "`STARTFONT' field missing" ) - FT_ERRORDEF_( Missing_Font_Field, 0xB1, \ - "`FONT' field missing" ) - FT_ERRORDEF_( Missing_Size_Field, 0xB2, \ - "`SIZE' field missing" ) - FT_ERRORDEF_( Missing_Fontboundingbox_Field, 0xB3, \ - "`FONTBOUNDINGBOX' field missing" ) - FT_ERRORDEF_( Missing_Chars_Field, 0xB4, \ - "`CHARS' field missing" ) - FT_ERRORDEF_( Missing_Startchar_Field, 0xB5, \ - "`STARTCHAR' field missing" ) - FT_ERRORDEF_( Missing_Encoding_Field, 0xB6, \ - "`ENCODING' field missing" ) - FT_ERRORDEF_( Missing_Bbx_Field, 0xB7, \ - "`BBX' field missing" ) - FT_ERRORDEF_( Bbx_Too_Big, 0xB8, \ - "`BBX' too big" ) - FT_ERRORDEF_( Corrupted_Font_Header, 0xB9, \ - "Font header corrupted or missing fields" ) - FT_ERRORDEF_( Corrupted_Font_Glyphs, 0xBA, \ - "Font glyphs corrupted or missing fields" ) - - -/* END */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/fterrors.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/fterrors.h deleted file mode 100644 index a54699f87f..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/fterrors.h +++ /dev/null @@ -1,207 +0,0 @@ -/***************************************************************************/ -/* */ -/* fterrors.h */ -/* */ -/* FreeType error code handling (specification). */ -/* */ -/* Copyright 1996-2001, 2002, 2004, 2007 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - - /*************************************************************************/ - /* */ - /* This special header file is used to define the handling of FT2 */ - /* enumeration constants. It can also be used to generate error message */ - /* strings with a small macro trick explained below. */ - /* */ - /* I - Error Formats */ - /* ----------------- */ - /* */ - /* The configuration macro FT_CONFIG_OPTION_USE_MODULE_ERRORS can be */ - /* defined in ftoption.h in order to make the higher byte indicate */ - /* the module where the error has happened (this is not compatible */ - /* with standard builds of FreeType 2). You can then use the macro */ - /* FT_ERROR_BASE macro to extract the generic error code from an */ - /* FT_Error value. */ - /* */ - /* */ - /* II - Error Message strings */ - /* -------------------------- */ - /* */ - /* The error definitions below are made through special macros that */ - /* allow client applications to build a table of error message strings */ - /* if they need it. The strings are not included in a normal build of */ - /* FreeType 2 to save space (most client applications do not use */ - /* them). */ - /* */ - /* To do so, you have to define the following macros before including */ - /* this file: */ - /* */ - /* FT_ERROR_START_LIST :: */ - /* This macro is called before anything else to define the start of */ - /* the error list. It is followed by several FT_ERROR_DEF calls */ - /* (see below). */ - /* */ - /* FT_ERROR_DEF( e, v, s ) :: */ - /* This macro is called to define one single error. */ - /* `e' is the error code identifier (e.g. FT_Err_Invalid_Argument). */ - /* `v' is the error numerical value. */ - /* `s' is the corresponding error string. */ - /* */ - /* FT_ERROR_END_LIST :: */ - /* This macro ends the list. */ - /* */ - /* Additionally, you have to undefine __FTERRORS_H__ before #including */ - /* this file. */ - /* */ - /* Here is a simple example: */ - /* */ - /* { */ - /* #undef __FTERRORS_H__ */ - /* #define FT_ERRORDEF( e, v, s ) { e, s }, */ - /* #define FT_ERROR_START_LIST { */ - /* #define FT_ERROR_END_LIST { 0, 0 } }; */ - /* */ - /* const struct */ - /* { */ - /* int err_code; */ - /* const char* err_msg; */ - /* } ft_errors[] = */ - /* */ - /* #include FT_ERRORS_H */ - /* } */ - /* */ - /*************************************************************************/ - - -#ifndef __FTERRORS_H__ -#define __FTERRORS_H__ - - - /* include module base error codes */ -#include FT_MODULE_ERRORS_H - - - /*******************************************************************/ - /*******************************************************************/ - /***** *****/ - /***** SETUP MACROS *****/ - /***** *****/ - /*******************************************************************/ - /*******************************************************************/ - - -#undef FT_NEED_EXTERN_C - -#undef FT_ERR_XCAT -#undef FT_ERR_CAT - -#define FT_ERR_XCAT( x, y ) x ## y -#define FT_ERR_CAT( x, y ) FT_ERR_XCAT( x, y ) - - - /* FT_ERR_PREFIX is used as a prefix for error identifiers. */ - /* By default, we use `FT_Err_'. */ - /* */ -#ifndef FT_ERR_PREFIX -#define FT_ERR_PREFIX FT_Err_ -#endif - - - /* FT_ERR_BASE is used as the base for module-specific errors. */ - /* */ -#ifdef FT_CONFIG_OPTION_USE_MODULE_ERRORS - -#ifndef FT_ERR_BASE -#define FT_ERR_BASE FT_Mod_Err_Base -#endif - -#else - -#undef FT_ERR_BASE -#define FT_ERR_BASE 0 - -#endif /* FT_CONFIG_OPTION_USE_MODULE_ERRORS */ - - - /* If FT_ERRORDEF is not defined, we need to define a simple */ - /* enumeration type. */ - /* */ -#ifndef FT_ERRORDEF - -#define FT_ERRORDEF( e, v, s ) e = v, -#define FT_ERROR_START_LIST enum { -#define FT_ERROR_END_LIST FT_ERR_CAT( FT_ERR_PREFIX, Max ) }; - -#ifdef __cplusplus -#define FT_NEED_EXTERN_C - extern "C" { -#endif - -#endif /* !FT_ERRORDEF */ - - - /* this macro is used to define an error */ -#define FT_ERRORDEF_( e, v, s ) \ - FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v + FT_ERR_BASE, s ) - - /* this is only used for <module>_Err_Ok, which must be 0! */ -#define FT_NOERRORDEF_( e, v, s ) \ - FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v, s ) - - -#ifdef FT_ERROR_START_LIST - FT_ERROR_START_LIST -#endif - - - /* now include the error codes */ -#include FT_ERROR_DEFINITIONS_H - - -#ifdef FT_ERROR_END_LIST - FT_ERROR_END_LIST -#endif - - - /*******************************************************************/ - /*******************************************************************/ - /***** *****/ - /***** SIMPLE CLEANUP *****/ - /***** *****/ - /*******************************************************************/ - /*******************************************************************/ - -#ifdef FT_NEED_EXTERN_C - } -#endif - -#undef FT_ERROR_START_LIST -#undef FT_ERROR_END_LIST - -#undef FT_ERRORDEF -#undef FT_ERRORDEF_ -#undef FT_NOERRORDEF_ - -#undef FT_NEED_EXTERN_C -#undef FT_ERR_BASE - - /* FT_KEEP_ERR_PREFIX is needed for ftvalid.h */ -#ifndef FT_KEEP_ERR_PREFIX -#undef FT_ERR_PREFIX -#else -#undef FT_KEEP_ERR_PREFIX -#endif - -#endif /* __FTERRORS_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftgasp.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftgasp.h deleted file mode 100644 index 453d4fa42c..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftgasp.h +++ /dev/null @@ -1,128 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftgasp.h */ -/* */ -/* Access of TrueType's `gasp' table (specification). */ -/* */ -/* Copyright 2007, 2008, 2011 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef _FT_GASP_H_ -#define _FT_GASP_H_ - -#include <ft2build.h> -#include FT_FREETYPE_H - -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - - - /*************************************************************************** - * - * @section: - * gasp_table - * - * @title: - * Gasp Table - * - * @abstract: - * Retrieving TrueType `gasp' table entries. - * - * @description: - * The function @FT_Get_Gasp can be used to query a TrueType or OpenType - * font for specific entries in its `gasp' table, if any. This is - * mainly useful when implementing native TrueType hinting with the - * bytecode interpreter to duplicate the Windows text rendering results. - */ - - /************************************************************************* - * - * @enum: - * FT_GASP_XXX - * - * @description: - * A list of values and/or bit-flags returned by the @FT_Get_Gasp - * function. - * - * @values: - * FT_GASP_NO_TABLE :: - * This special value means that there is no GASP table in this face. - * It is up to the client to decide what to do. - * - * FT_GASP_DO_GRIDFIT :: - * Grid-fitting and hinting should be performed at the specified ppem. - * This *really* means TrueType bytecode interpretation. If this bit - * is not set, no hinting gets applied. - * - * FT_GASP_DO_GRAY :: - * Anti-aliased rendering should be performed at the specified ppem. - * If not set, do monochrome rendering. - * - * FT_GASP_SYMMETRIC_SMOOTHING :: - * If set, smoothing along multiple axes must be used with ClearType. - * - * FT_GASP_SYMMETRIC_GRIDFIT :: - * Grid-fitting must be used with ClearType's symmetric smoothing. - * - * @note: - * The bit-flags `FT_GASP_DO_GRIDFIT' and `FT_GASP_DO_GRAY' are to be - * used for standard font rasterization only. Independently of that, - * `FT_GASP_SYMMETRIC_SMOOTHING' and `FT_GASP_SYMMETRIC_GRIDFIT' are to - * be used if ClearType is enabled (and `FT_GASP_DO_GRIDFIT' and - * `FT_GASP_DO_GRAY' are consequently ignored). - * - * `ClearType' is Microsoft's implementation of LCD rendering, partly - * protected by patents. - * - * @since: - * 2.3.0 - */ -#define FT_GASP_NO_TABLE -1 -#define FT_GASP_DO_GRIDFIT 0x01 -#define FT_GASP_DO_GRAY 0x02 -#define FT_GASP_SYMMETRIC_SMOOTHING 0x08 -#define FT_GASP_SYMMETRIC_GRIDFIT 0x10 - - - /************************************************************************* - * - * @func: - * FT_Get_Gasp - * - * @description: - * Read the `gasp' table from a TrueType or OpenType font file and - * return the entry corresponding to a given character pixel size. - * - * @input: - * face :: The source face handle. - * ppem :: The vertical character pixel size. - * - * @return: - * Bit flags (see @FT_GASP_XXX), or @FT_GASP_NO_TABLE if there is no - * `gasp' table in the face. - * - * @since: - * 2.3.0 - */ - FT_EXPORT( FT_Int ) - FT_Get_Gasp( FT_Face face, - FT_UInt ppem ); - -/* */ - -#endif /* _FT_GASP_H_ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftglyph.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftglyph.h deleted file mode 100644 index 3de69f7aed..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftglyph.h +++ /dev/null @@ -1,620 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftglyph.h */ -/* */ -/* FreeType convenience functions to handle glyphs (specification). */ -/* */ -/* Copyright 1996-2003, 2006, 2008, 2009, 2011 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - - /*************************************************************************/ - /* */ - /* This file contains the definition of several convenience functions */ - /* that can be used by client applications to easily retrieve glyph */ - /* bitmaps and outlines from a given face. */ - /* */ - /* These functions should be optional if you are writing a font server */ - /* or text layout engine on top of FreeType. However, they are pretty */ - /* handy for many other simple uses of the library. */ - /* */ - /*************************************************************************/ - - -#ifndef __FTGLYPH_H__ -#define __FTGLYPH_H__ - - -#include <ft2build.h> -#include FT_FREETYPE_H - -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - - -FT_BEGIN_HEADER - - - /*************************************************************************/ - /* */ - /* <Section> */ - /* glyph_management */ - /* */ - /* <Title> */ - /* Glyph Management */ - /* */ - /* <Abstract> */ - /* Generic interface to manage individual glyph data. */ - /* */ - /* <Description> */ - /* This section contains definitions used to manage glyph data */ - /* through generic FT_Glyph objects. Each of them can contain a */ - /* bitmap, a vector outline, or even images in other formats. */ - /* */ - /*************************************************************************/ - - - /* forward declaration to a private type */ - typedef struct FT_Glyph_Class_ FT_Glyph_Class; - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FT_Glyph */ - /* */ - /* <Description> */ - /* Handle to an object used to model generic glyph images. It is a */ - /* pointer to the @FT_GlyphRec structure and can contain a glyph */ - /* bitmap or pointer. */ - /* */ - /* <Note> */ - /* Glyph objects are not owned by the library. You must thus release */ - /* them manually (through @FT_Done_Glyph) _before_ calling */ - /* @FT_Done_FreeType. */ - /* */ - typedef struct FT_GlyphRec_* FT_Glyph; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FT_GlyphRec */ - /* */ - /* <Description> */ - /* The root glyph structure contains a given glyph image plus its */ - /* advance width in 16.16 fixed float format. */ - /* */ - /* <Fields> */ - /* library :: A handle to the FreeType library object. */ - /* */ - /* clazz :: A pointer to the glyph's class. Private. */ - /* */ - /* format :: The format of the glyph's image. */ - /* */ - /* advance :: A 16.16 vector that gives the glyph's advance width. */ - /* */ - typedef struct FT_GlyphRec_ - { - FT_Library library; - const FT_Glyph_Class* clazz; - FT_Glyph_Format format; - FT_Vector advance; - - } FT_GlyphRec; - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FT_BitmapGlyph */ - /* */ - /* <Description> */ - /* A handle to an object used to model a bitmap glyph image. This is */ - /* a sub-class of @FT_Glyph, and a pointer to @FT_BitmapGlyphRec. */ - /* */ - typedef struct FT_BitmapGlyphRec_* FT_BitmapGlyph; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FT_BitmapGlyphRec */ - /* */ - /* <Description> */ - /* A structure used for bitmap glyph images. This really is a */ - /* `sub-class' of @FT_GlyphRec. */ - /* */ - /* <Fields> */ - /* root :: The root @FT_Glyph fields. */ - /* */ - /* left :: The left-side bearing, i.e., the horizontal distance */ - /* from the current pen position to the left border of the */ - /* glyph bitmap. */ - /* */ - /* top :: The top-side bearing, i.e., the vertical distance from */ - /* the current pen position to the top border of the glyph */ - /* bitmap. This distance is positive for upwards~y! */ - /* */ - /* bitmap :: A descriptor for the bitmap. */ - /* */ - /* <Note> */ - /* You can typecast an @FT_Glyph to @FT_BitmapGlyph if you have */ - /* `glyph->format == FT_GLYPH_FORMAT_BITMAP'. This lets you access */ - /* the bitmap's contents easily. */ - /* */ - /* The corresponding pixel buffer is always owned by @FT_BitmapGlyph */ - /* and is thus created and destroyed with it. */ - /* */ - typedef struct FT_BitmapGlyphRec_ - { - FT_GlyphRec root; - FT_Int left; - FT_Int top; - FT_Bitmap bitmap; - - } FT_BitmapGlyphRec; - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FT_OutlineGlyph */ - /* */ - /* <Description> */ - /* A handle to an object used to model an outline glyph image. This */ - /* is a sub-class of @FT_Glyph, and a pointer to @FT_OutlineGlyphRec. */ - /* */ - typedef struct FT_OutlineGlyphRec_* FT_OutlineGlyph; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FT_OutlineGlyphRec */ - /* */ - /* <Description> */ - /* A structure used for outline (vectorial) glyph images. This */ - /* really is a `sub-class' of @FT_GlyphRec. */ - /* */ - /* <Fields> */ - /* root :: The root @FT_Glyph fields. */ - /* */ - /* outline :: A descriptor for the outline. */ - /* */ - /* <Note> */ - /* You can typecast an @FT_Glyph to @FT_OutlineGlyph if you have */ - /* `glyph->format == FT_GLYPH_FORMAT_OUTLINE'. This lets you access */ - /* the outline's content easily. */ - /* */ - /* As the outline is extracted from a glyph slot, its coordinates are */ - /* expressed normally in 26.6 pixels, unless the flag */ - /* @FT_LOAD_NO_SCALE was used in @FT_Load_Glyph() or @FT_Load_Char(). */ - /* */ - /* The outline's tables are always owned by the object and are */ - /* destroyed with it. */ - /* */ - typedef struct FT_OutlineGlyphRec_ - { - FT_GlyphRec root; - FT_Outline outline; - - } FT_OutlineGlyphRec; - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Get_Glyph */ - /* */ - /* <Description> */ - /* A function used to extract a glyph image from a slot. Note that */ - /* the created @FT_Glyph object must be released with @FT_Done_Glyph. */ - /* */ - /* <Input> */ - /* slot :: A handle to the source glyph slot. */ - /* */ - /* <Output> */ - /* aglyph :: A handle to the glyph object. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Get_Glyph( FT_GlyphSlot slot, - FT_Glyph *aglyph ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Glyph_Copy */ - /* */ - /* <Description> */ - /* A function used to copy a glyph image. Note that the created */ - /* @FT_Glyph object must be released with @FT_Done_Glyph. */ - /* */ - /* <Input> */ - /* source :: A handle to the source glyph object. */ - /* */ - /* <Output> */ - /* target :: A handle to the target glyph object. 0~in case of */ - /* error. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Glyph_Copy( FT_Glyph source, - FT_Glyph *target ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Glyph_Transform */ - /* */ - /* <Description> */ - /* Transform a glyph image if its format is scalable. */ - /* */ - /* <InOut> */ - /* glyph :: A handle to the target glyph object. */ - /* */ - /* <Input> */ - /* matrix :: A pointer to a 2x2 matrix to apply. */ - /* */ - /* delta :: A pointer to a 2d vector to apply. Coordinates are */ - /* expressed in 1/64th of a pixel. */ - /* */ - /* <Return> */ - /* FreeType error code (if not 0, the glyph format is not scalable). */ - /* */ - /* <Note> */ - /* The 2x2 transformation matrix is also applied to the glyph's */ - /* advance vector. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Glyph_Transform( FT_Glyph glyph, - FT_Matrix* matrix, - FT_Vector* delta ); - - - /*************************************************************************/ - /* */ - /* <Enum> */ - /* FT_Glyph_BBox_Mode */ - /* */ - /* <Description> */ - /* The mode how the values of @FT_Glyph_Get_CBox are returned. */ - /* */ - /* <Values> */ - /* FT_GLYPH_BBOX_UNSCALED :: */ - /* Return unscaled font units. */ - /* */ - /* FT_GLYPH_BBOX_SUBPIXELS :: */ - /* Return unfitted 26.6 coordinates. */ - /* */ - /* FT_GLYPH_BBOX_GRIDFIT :: */ - /* Return grid-fitted 26.6 coordinates. */ - /* */ - /* FT_GLYPH_BBOX_TRUNCATE :: */ - /* Return coordinates in integer pixels. */ - /* */ - /* FT_GLYPH_BBOX_PIXELS :: */ - /* Return grid-fitted pixel coordinates. */ - /* */ - typedef enum FT_Glyph_BBox_Mode_ - { - FT_GLYPH_BBOX_UNSCALED = 0, - FT_GLYPH_BBOX_SUBPIXELS = 0, - FT_GLYPH_BBOX_GRIDFIT = 1, - FT_GLYPH_BBOX_TRUNCATE = 2, - FT_GLYPH_BBOX_PIXELS = 3 - - } FT_Glyph_BBox_Mode; - - - /*************************************************************************/ - /* */ - /* <Enum> */ - /* ft_glyph_bbox_xxx */ - /* */ - /* <Description> */ - /* These constants are deprecated. Use the corresponding */ - /* @FT_Glyph_BBox_Mode values instead. */ - /* */ - /* <Values> */ - /* ft_glyph_bbox_unscaled :: See @FT_GLYPH_BBOX_UNSCALED. */ - /* ft_glyph_bbox_subpixels :: See @FT_GLYPH_BBOX_SUBPIXELS. */ - /* ft_glyph_bbox_gridfit :: See @FT_GLYPH_BBOX_GRIDFIT. */ - /* ft_glyph_bbox_truncate :: See @FT_GLYPH_BBOX_TRUNCATE. */ - /* ft_glyph_bbox_pixels :: See @FT_GLYPH_BBOX_PIXELS. */ - /* */ -#define ft_glyph_bbox_unscaled FT_GLYPH_BBOX_UNSCALED -#define ft_glyph_bbox_subpixels FT_GLYPH_BBOX_SUBPIXELS -#define ft_glyph_bbox_gridfit FT_GLYPH_BBOX_GRIDFIT -#define ft_glyph_bbox_truncate FT_GLYPH_BBOX_TRUNCATE -#define ft_glyph_bbox_pixels FT_GLYPH_BBOX_PIXELS - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Glyph_Get_CBox */ - /* */ - /* <Description> */ - /* Return a glyph's `control box'. The control box encloses all the */ - /* outline's points, including Bézier control points. Though it */ - /* coincides with the exact bounding box for most glyphs, it can be */ - /* slightly larger in some situations (like when rotating an outline */ - /* which contains Bézier outside arcs). */ - /* */ - /* Computing the control box is very fast, while getting the bounding */ - /* box can take much more time as it needs to walk over all segments */ - /* and arcs in the outline. To get the latter, you can use the */ - /* `ftbbox' component which is dedicated to this single task. */ - /* */ - /* <Input> */ - /* glyph :: A handle to the source glyph object. */ - /* */ - /* mode :: The mode which indicates how to interpret the returned */ - /* bounding box values. */ - /* */ - /* <Output> */ - /* acbox :: The glyph coordinate bounding box. Coordinates are */ - /* expressed in 1/64th of pixels if it is grid-fitted. */ - /* */ - /* <Note> */ - /* Coordinates are relative to the glyph origin, using the y~upwards */ - /* convention. */ - /* */ - /* If the glyph has been loaded with @FT_LOAD_NO_SCALE, `bbox_mode' */ - /* must be set to @FT_GLYPH_BBOX_UNSCALED to get unscaled font */ - /* units in 26.6 pixel format. The value @FT_GLYPH_BBOX_SUBPIXELS */ - /* is another name for this constant. */ - /* */ - /* If the font is tricky and the glyph has been loaded with */ - /* @FT_LOAD_NO_SCALE, the resulting CBox is meaningless. To get */ - /* reasonable values for the CBox it is necessary to load the glyph */ - /* at a large ppem value (so that the hinting instructions can */ - /* properly shift and scale the subglyphs), then extracting the CBox */ - /* which can be eventually converted back to font units. */ - /* */ - /* Note that the maximum coordinates are exclusive, which means that */ - /* one can compute the width and height of the glyph image (be it in */ - /* integer or 26.6 pixels) as: */ - /* */ - /* { */ - /* width = bbox.xMax - bbox.xMin; */ - /* height = bbox.yMax - bbox.yMin; */ - /* } */ - /* */ - /* Note also that for 26.6 coordinates, if `bbox_mode' is set to */ - /* @FT_GLYPH_BBOX_GRIDFIT, the coordinates will also be grid-fitted, */ - /* which corresponds to: */ - /* */ - /* { */ - /* bbox.xMin = FLOOR(bbox.xMin); */ - /* bbox.yMin = FLOOR(bbox.yMin); */ - /* bbox.xMax = CEILING(bbox.xMax); */ - /* bbox.yMax = CEILING(bbox.yMax); */ - /* } */ - /* */ - /* To get the bbox in pixel coordinates, set `bbox_mode' to */ - /* @FT_GLYPH_BBOX_TRUNCATE. */ - /* */ - /* To get the bbox in grid-fitted pixel coordinates, set `bbox_mode' */ - /* to @FT_GLYPH_BBOX_PIXELS. */ - /* */ - FT_EXPORT( void ) - FT_Glyph_Get_CBox( FT_Glyph glyph, - FT_UInt bbox_mode, - FT_BBox *acbox ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Glyph_To_Bitmap */ - /* */ - /* <Description> */ - /* Convert a given glyph object to a bitmap glyph object. */ - /* */ - /* <InOut> */ - /* the_glyph :: A pointer to a handle to the target glyph. */ - /* */ - /* <Input> */ - /* render_mode :: An enumeration that describes how the data is */ - /* rendered. */ - /* */ - /* origin :: A pointer to a vector used to translate the glyph */ - /* image before rendering. Can be~0 (if no */ - /* translation). The origin is expressed in */ - /* 26.6 pixels. */ - /* */ - /* destroy :: A boolean that indicates that the original glyph */ - /* image should be destroyed by this function. It is */ - /* never destroyed in case of error. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - /* <Note> */ - /* This function does nothing if the glyph format isn't scalable. */ - /* */ - /* The glyph image is translated with the `origin' vector before */ - /* rendering. */ - /* */ - /* The first parameter is a pointer to an @FT_Glyph handle, that will */ - /* be _replaced_ by this function (with newly allocated data). */ - /* Typically, you would use (omitting error handling): */ - /* */ - /* */ - /* { */ - /* FT_Glyph glyph; */ - /* FT_BitmapGlyph glyph_bitmap; */ - /* */ - /* */ - /* // load glyph */ - /* error = FT_Load_Char( face, glyph_index, FT_LOAD_DEFAUT ); */ - /* */ - /* // extract glyph image */ - /* error = FT_Get_Glyph( face->glyph, &glyph ); */ - /* */ - /* // convert to a bitmap (default render mode + destroying old) */ - /* if ( glyph->format != FT_GLYPH_FORMAT_BITMAP ) */ - /* { */ - /* error = FT_Glyph_To_Bitmap( &glyph, FT_RENDER_MODE_NORMAL, */ - /* 0, 1 ); */ - /* if ( error ) // `glyph' unchanged */ - /* ... */ - /* } */ - /* */ - /* // access bitmap content by typecasting */ - /* glyph_bitmap = (FT_BitmapGlyph)glyph; */ - /* */ - /* // do funny stuff with it, like blitting/drawing */ - /* ... */ - /* */ - /* // discard glyph image (bitmap or not) */ - /* FT_Done_Glyph( glyph ); */ - /* } */ - /* */ - /* */ - /* Here another example, again without error handling: */ - /* */ - /* */ - /* { */ - /* FT_Glyph glyphs[MAX_GLYPHS] */ - /* */ - /* */ - /* ... */ - /* */ - /* for ( idx = 0; i < MAX_GLYPHS; i++ ) */ - /* error = FT_Load_Glyph( face, idx, FT_LOAD_DEFAULT ) || */ - /* FT_Get_Glyph ( face->glyph, &glyph[idx] ); */ - /* */ - /* ... */ - /* */ - /* for ( idx = 0; i < MAX_GLYPHS; i++ ) */ - /* { */ - /* FT_Glyph bitmap = glyphs[idx]; */ - /* */ - /* */ - /* ... */ - /* */ - /* // after this call, `bitmap' no longer points into */ - /* // the `glyphs' array (and the old value isn't destroyed) */ - /* FT_Glyph_To_Bitmap( &bitmap, FT_RENDER_MODE_MONO, 0, 0 ); */ - /* */ - /* ... */ - /* */ - /* FT_Done_Glyph( bitmap ); */ - /* } */ - /* */ - /* ... */ - /* */ - /* for ( idx = 0; i < MAX_GLYPHS; i++ ) */ - /* FT_Done_Glyph( glyphs[idx] ); */ - /* } */ - /* */ - FT_EXPORT( FT_Error ) - FT_Glyph_To_Bitmap( FT_Glyph* the_glyph, - FT_Render_Mode render_mode, - FT_Vector* origin, - FT_Bool destroy ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Done_Glyph */ - /* */ - /* <Description> */ - /* Destroy a given glyph. */ - /* */ - /* <Input> */ - /* glyph :: A handle to the target glyph object. */ - /* */ - FT_EXPORT( void ) - FT_Done_Glyph( FT_Glyph glyph ); - - /* */ - - - /* other helpful functions */ - - /*************************************************************************/ - /* */ - /* <Section> */ - /* computations */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Matrix_Multiply */ - /* */ - /* <Description> */ - /* Perform the matrix operation `b = a*b'. */ - /* */ - /* <Input> */ - /* a :: A pointer to matrix `a'. */ - /* */ - /* <InOut> */ - /* b :: A pointer to matrix `b'. */ - /* */ - /* <Note> */ - /* The result is undefined if either `a' or `b' is zero. */ - /* */ - FT_EXPORT( void ) - FT_Matrix_Multiply( const FT_Matrix* a, - FT_Matrix* b ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Matrix_Invert */ - /* */ - /* <Description> */ - /* Invert a 2x2 matrix. Return an error if it can't be inverted. */ - /* */ - /* <InOut> */ - /* matrix :: A pointer to the target matrix. Remains untouched in */ - /* case of error. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Matrix_Invert( FT_Matrix* matrix ); - - - /* */ - - -FT_END_HEADER - -#endif /* __FTGLYPH_H__ */ - - -/* END */ - - -/* Local Variables: */ -/* coding: utf-8 */ -/* End: */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftgxval.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftgxval.h deleted file mode 100644 index 497015c101..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftgxval.h +++ /dev/null @@ -1,358 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftgxval.h */ -/* */ -/* FreeType API for validating TrueTypeGX/AAT tables (specification). */ -/* */ -/* Copyright 2004, 2005, 2006 by */ -/* Masatake YAMATO, Redhat K.K, */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - -/***************************************************************************/ -/* */ -/* gxvalid is derived from both gxlayout module and otvalid module. */ -/* Development of gxlayout is supported by the Information-technology */ -/* Promotion Agency(IPA), Japan. */ -/* */ -/***************************************************************************/ - - -#ifndef __FTGXVAL_H__ -#define __FTGXVAL_H__ - -#include <ft2build.h> -#include FT_FREETYPE_H - -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - - -FT_BEGIN_HEADER - - - /*************************************************************************/ - /* */ - /* <Section> */ - /* gx_validation */ - /* */ - /* <Title> */ - /* TrueTypeGX/AAT Validation */ - /* */ - /* <Abstract> */ - /* An API to validate TrueTypeGX/AAT tables. */ - /* */ - /* <Description> */ - /* This section contains the declaration of functions to validate */ - /* some TrueTypeGX tables (feat, mort, morx, bsln, just, kern, opbd, */ - /* trak, prop, lcar). */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* */ - /* Warning: Use FT_VALIDATE_XXX to validate a table. */ - /* Following definitions are for gxvalid developers. */ - /* */ - /* */ - /*************************************************************************/ - -#define FT_VALIDATE_feat_INDEX 0 -#define FT_VALIDATE_mort_INDEX 1 -#define FT_VALIDATE_morx_INDEX 2 -#define FT_VALIDATE_bsln_INDEX 3 -#define FT_VALIDATE_just_INDEX 4 -#define FT_VALIDATE_kern_INDEX 5 -#define FT_VALIDATE_opbd_INDEX 6 -#define FT_VALIDATE_trak_INDEX 7 -#define FT_VALIDATE_prop_INDEX 8 -#define FT_VALIDATE_lcar_INDEX 9 -#define FT_VALIDATE_GX_LAST_INDEX FT_VALIDATE_lcar_INDEX - - - /************************************************************************* - * - * @macro: - * FT_VALIDATE_GX_LENGTH - * - * @description: - * The number of tables checked in this module. Use it as a parameter - * for the `table-length' argument of function @FT_TrueTypeGX_Validate. - */ -#define FT_VALIDATE_GX_LENGTH (FT_VALIDATE_GX_LAST_INDEX + 1) - - /* */ - - /* Up to 0x1000 is used by otvalid. - Ox2xxx is reserved for feature OT extension. */ -#define FT_VALIDATE_GX_START 0x4000 -#define FT_VALIDATE_GX_BITFIELD( tag ) \ - ( FT_VALIDATE_GX_START << FT_VALIDATE_##tag##_INDEX ) - - - /********************************************************************** - * - * @enum: - * FT_VALIDATE_GXXXX - * - * @description: - * A list of bit-field constants used with @FT_TrueTypeGX_Validate to - * indicate which TrueTypeGX/AAT Type tables should be validated. - * - * @values: - * FT_VALIDATE_feat :: - * Validate `feat' table. - * - * FT_VALIDATE_mort :: - * Validate `mort' table. - * - * FT_VALIDATE_morx :: - * Validate `morx' table. - * - * FT_VALIDATE_bsln :: - * Validate `bsln' table. - * - * FT_VALIDATE_just :: - * Validate `just' table. - * - * FT_VALIDATE_kern :: - * Validate `kern' table. - * - * FT_VALIDATE_opbd :: - * Validate `opbd' table. - * - * FT_VALIDATE_trak :: - * Validate `trak' table. - * - * FT_VALIDATE_prop :: - * Validate `prop' table. - * - * FT_VALIDATE_lcar :: - * Validate `lcar' table. - * - * FT_VALIDATE_GX :: - * Validate all TrueTypeGX tables (feat, mort, morx, bsln, just, kern, - * opbd, trak, prop and lcar). - * - */ - -#define FT_VALIDATE_feat FT_VALIDATE_GX_BITFIELD( feat ) -#define FT_VALIDATE_mort FT_VALIDATE_GX_BITFIELD( mort ) -#define FT_VALIDATE_morx FT_VALIDATE_GX_BITFIELD( morx ) -#define FT_VALIDATE_bsln FT_VALIDATE_GX_BITFIELD( bsln ) -#define FT_VALIDATE_just FT_VALIDATE_GX_BITFIELD( just ) -#define FT_VALIDATE_kern FT_VALIDATE_GX_BITFIELD( kern ) -#define FT_VALIDATE_opbd FT_VALIDATE_GX_BITFIELD( opbd ) -#define FT_VALIDATE_trak FT_VALIDATE_GX_BITFIELD( trak ) -#define FT_VALIDATE_prop FT_VALIDATE_GX_BITFIELD( prop ) -#define FT_VALIDATE_lcar FT_VALIDATE_GX_BITFIELD( lcar ) - -#define FT_VALIDATE_GX ( FT_VALIDATE_feat | \ - FT_VALIDATE_mort | \ - FT_VALIDATE_morx | \ - FT_VALIDATE_bsln | \ - FT_VALIDATE_just | \ - FT_VALIDATE_kern | \ - FT_VALIDATE_opbd | \ - FT_VALIDATE_trak | \ - FT_VALIDATE_prop | \ - FT_VALIDATE_lcar ) - - - /* */ - - /********************************************************************** - * - * @function: - * FT_TrueTypeGX_Validate - * - * @description: - * Validate various TrueTypeGX tables to assure that all offsets and - * indices are valid. The idea is that a higher-level library which - * actually does the text layout can access those tables without - * error checking (which can be quite time consuming). - * - * @input: - * face :: - * A handle to the input face. - * - * validation_flags :: - * A bit field which specifies the tables to be validated. See - * @FT_VALIDATE_GXXXX for possible values. - * - * table_length :: - * The size of the `tables' array. Normally, @FT_VALIDATE_GX_LENGTH - * should be passed. - * - * @output: - * tables :: - * The array where all validated sfnt tables are stored. - * The array itself must be allocated by a client. - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * This function only works with TrueTypeGX fonts, returning an error - * otherwise. - * - * After use, the application should deallocate the buffers pointed to by - * each `tables' element, by calling @FT_TrueTypeGX_Free. A NULL value - * indicates that the table either doesn't exist in the font, the - * application hasn't asked for validation, or the validator doesn't have - * the ability to validate the sfnt table. - */ - FT_EXPORT( FT_Error ) - FT_TrueTypeGX_Validate( FT_Face face, - FT_UInt validation_flags, - FT_Bytes tables[FT_VALIDATE_GX_LENGTH], - FT_UInt table_length ); - - - /* */ - - /********************************************************************** - * - * @function: - * FT_TrueTypeGX_Free - * - * @description: - * Free the buffer allocated by TrueTypeGX validator. - * - * @input: - * face :: - * A handle to the input face. - * - * table :: - * The pointer to the buffer allocated by - * @FT_TrueTypeGX_Validate. - * - * @note: - * This function must be used to free the buffer allocated by - * @FT_TrueTypeGX_Validate only. - */ - FT_EXPORT( void ) - FT_TrueTypeGX_Free( FT_Face face, - FT_Bytes table ); - - - /* */ - - /********************************************************************** - * - * @enum: - * FT_VALIDATE_CKERNXXX - * - * @description: - * A list of bit-field constants used with @FT_ClassicKern_Validate - * to indicate the classic kern dialect or dialects. If the selected - * type doesn't fit, @FT_ClassicKern_Validate regards the table as - * invalid. - * - * @values: - * FT_VALIDATE_MS :: - * Handle the `kern' table as a classic Microsoft kern table. - * - * FT_VALIDATE_APPLE :: - * Handle the `kern' table as a classic Apple kern table. - * - * FT_VALIDATE_CKERN :: - * Handle the `kern' as either classic Apple or Microsoft kern table. - */ -#define FT_VALIDATE_MS ( FT_VALIDATE_GX_START << 0 ) -#define FT_VALIDATE_APPLE ( FT_VALIDATE_GX_START << 1 ) - -#define FT_VALIDATE_CKERN ( FT_VALIDATE_MS | FT_VALIDATE_APPLE ) - - - /* */ - - /********************************************************************** - * - * @function: - * FT_ClassicKern_Validate - * - * @description: - * Validate classic (16-bit format) kern table to assure that the offsets - * and indices are valid. The idea is that a higher-level library which - * actually does the text layout can access those tables without error - * checking (which can be quite time consuming). - * - * The `kern' table validator in @FT_TrueTypeGX_Validate deals with both - * the new 32-bit format and the classic 16-bit format, while - * FT_ClassicKern_Validate only supports the classic 16-bit format. - * - * @input: - * face :: - * A handle to the input face. - * - * validation_flags :: - * A bit field which specifies the dialect to be validated. See - * @FT_VALIDATE_CKERNXXX for possible values. - * - * @output: - * ckern_table :: - * A pointer to the kern table. - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * After use, the application should deallocate the buffers pointed to by - * `ckern_table', by calling @FT_ClassicKern_Free. A NULL value - * indicates that the table doesn't exist in the font. - */ - FT_EXPORT( FT_Error ) - FT_ClassicKern_Validate( FT_Face face, - FT_UInt validation_flags, - FT_Bytes *ckern_table ); - - - /* */ - - /********************************************************************** - * - * @function: - * FT_ClassicKern_Free - * - * @description: - * Free the buffer allocated by classic Kern validator. - * - * @input: - * face :: - * A handle to the input face. - * - * table :: - * The pointer to the buffer that is allocated by - * @FT_ClassicKern_Validate. - * - * @note: - * This function must be used to free the buffer allocated by - * @FT_ClassicKern_Validate only. - */ - FT_EXPORT( void ) - FT_ClassicKern_Free( FT_Face face, - FT_Bytes table ); - - - /* */ - - -FT_END_HEADER - -#endif /* __FTGXVAL_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftgzip.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftgzip.h deleted file mode 100644 index acbc4f0327..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftgzip.h +++ /dev/null @@ -1,102 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftgzip.h */ -/* */ -/* Gzip-compressed stream support. */ -/* */ -/* Copyright 2002, 2003, 2004, 2006 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __FTGZIP_H__ -#define __FTGZIP_H__ - -#include <ft2build.h> -#include FT_FREETYPE_H - -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - - -FT_BEGIN_HEADER - - /*************************************************************************/ - /* */ - /* <Section> */ - /* gzip */ - /* */ - /* <Title> */ - /* GZIP Streams */ - /* */ - /* <Abstract> */ - /* Using gzip-compressed font files. */ - /* */ - /* <Description> */ - /* This section contains the declaration of Gzip-specific functions. */ - /* */ - /*************************************************************************/ - - - /************************************************************************ - * - * @function: - * FT_Stream_OpenGzip - * - * @description: - * Open a new stream to parse gzip-compressed font files. This is - * mainly used to support the compressed `*.pcf.gz' fonts that come - * with XFree86. - * - * @input: - * stream :: - * The target embedding stream. - * - * source :: - * The source stream. - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * The source stream must be opened _before_ calling this function. - * - * Calling the internal function `FT_Stream_Close' on the new stream will - * *not* call `FT_Stream_Close' on the source stream. None of the stream - * objects will be released to the heap. - * - * The stream implementation is very basic and resets the decompression - * process each time seeking backwards is needed within the stream. - * - * In certain builds of the library, gzip compression recognition is - * automatically handled when calling @FT_New_Face or @FT_Open_Face. - * This means that if no font driver is capable of handling the raw - * compressed file, the library will try to open a gzipped stream from - * it and re-open the face with it. - * - * This function may return `FT_Err_Unimplemented_Feature' if your build - * of FreeType was not compiled with zlib support. - */ - FT_EXPORT( FT_Error ) - FT_Stream_OpenGzip( FT_Stream stream, - FT_Stream source ); - - /* */ - - -FT_END_HEADER - -#endif /* __FTGZIP_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftimage.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftimage.h deleted file mode 100644 index 04b5e04f7b..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftimage.h +++ /dev/null @@ -1,1313 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftimage.h */ -/* */ -/* FreeType glyph image formats and default raster interface */ -/* (specification). */ -/* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, */ -/* 2010 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - /*************************************************************************/ - /* */ - /* Note: A `raster' is simply a scan-line converter, used to render */ - /* FT_Outlines into FT_Bitmaps. */ - /* */ - /*************************************************************************/ - - -#ifndef __FTIMAGE_H__ -#define __FTIMAGE_H__ - - - /* _STANDALONE_ is from ftgrays.c */ -#ifndef _STANDALONE_ -#include <ft2build.h> -#endif - - -FT_BEGIN_HEADER - - - /*************************************************************************/ - /* */ - /* <Section> */ - /* basic_types */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FT_Pos */ - /* */ - /* <Description> */ - /* The type FT_Pos is used to store vectorial coordinates. Depending */ - /* on the context, these can represent distances in integer font */ - /* units, or 16.16, or 26.6 fixed float pixel coordinates. */ - /* */ - typedef signed long FT_Pos; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FT_Vector */ - /* */ - /* <Description> */ - /* A simple structure used to store a 2D vector; coordinates are of */ - /* the FT_Pos type. */ - /* */ - /* <Fields> */ - /* x :: The horizontal coordinate. */ - /* y :: The vertical coordinate. */ - /* */ - typedef struct FT_Vector_ - { - FT_Pos x; - FT_Pos y; - - } FT_Vector; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FT_BBox */ - /* */ - /* <Description> */ - /* A structure used to hold an outline's bounding box, i.e., the */ - /* coordinates of its extrema in the horizontal and vertical */ - /* directions. */ - /* */ - /* <Fields> */ - /* xMin :: The horizontal minimum (left-most). */ - /* */ - /* yMin :: The vertical minimum (bottom-most). */ - /* */ - /* xMax :: The horizontal maximum (right-most). */ - /* */ - /* yMax :: The vertical maximum (top-most). */ - /* */ - /* <Note> */ - /* The bounding box is specified with the coordinates of the lower */ - /* left and the upper right corner. In PostScript, those values are */ - /* often called (llx,lly) and (urx,ury), respectively. */ - /* */ - /* If `yMin' is negative, this value gives the glyph's descender. */ - /* Otherwise, the glyph doesn't descend below the baseline. */ - /* Similarly, if `ymax' is positive, this value gives the glyph's */ - /* ascender. */ - /* */ - /* `xMin' gives the horizontal distance from the glyph's origin to */ - /* the left edge of the glyph's bounding box. If `xMin' is negative, */ - /* the glyph extends to the left of the origin. */ - /* */ - typedef struct FT_BBox_ - { - FT_Pos xMin, yMin; - FT_Pos xMax, yMax; - - } FT_BBox; - - - /*************************************************************************/ - /* */ - /* <Enum> */ - /* FT_Pixel_Mode */ - /* */ - /* <Description> */ - /* An enumeration type used to describe the format of pixels in a */ - /* given bitmap. Note that additional formats may be added in the */ - /* future. */ - /* */ - /* <Values> */ - /* FT_PIXEL_MODE_NONE :: */ - /* Value~0 is reserved. */ - /* */ - /* FT_PIXEL_MODE_MONO :: */ - /* A monochrome bitmap, using 1~bit per pixel. Note that pixels */ - /* are stored in most-significant order (MSB), which means that */ - /* the left-most pixel in a byte has value 128. */ - /* */ - /* FT_PIXEL_MODE_GRAY :: */ - /* An 8-bit bitmap, generally used to represent anti-aliased glyph */ - /* images. Each pixel is stored in one byte. Note that the number */ - /* of `gray' levels is stored in the `num_grays' field of the */ - /* @FT_Bitmap structure (it generally is 256). */ - /* */ - /* FT_PIXEL_MODE_GRAY2 :: */ - /* A 2-bit per pixel bitmap, used to represent embedded */ - /* anti-aliased bitmaps in font files according to the OpenType */ - /* specification. We haven't found a single font using this */ - /* format, however. */ - /* */ - /* FT_PIXEL_MODE_GRAY4 :: */ - /* A 4-bit per pixel bitmap, representing embedded anti-aliased */ - /* bitmaps in font files according to the OpenType specification. */ - /* We haven't found a single font using this format, however. */ - /* */ - /* FT_PIXEL_MODE_LCD :: */ - /* An 8-bit bitmap, representing RGB or BGR decimated glyph images */ - /* used for display on LCD displays; the bitmap is three times */ - /* wider than the original glyph image. See also */ - /* @FT_RENDER_MODE_LCD. */ - /* */ - /* FT_PIXEL_MODE_LCD_V :: */ - /* An 8-bit bitmap, representing RGB or BGR decimated glyph images */ - /* used for display on rotated LCD displays; the bitmap is three */ - /* times taller than the original glyph image. See also */ - /* @FT_RENDER_MODE_LCD_V. */ - /* */ - typedef enum FT_Pixel_Mode_ - { - FT_PIXEL_MODE_NONE = 0, - FT_PIXEL_MODE_MONO, - FT_PIXEL_MODE_GRAY, - FT_PIXEL_MODE_GRAY2, - FT_PIXEL_MODE_GRAY4, - FT_PIXEL_MODE_LCD, - FT_PIXEL_MODE_LCD_V, - - FT_PIXEL_MODE_MAX /* do not remove */ - - } FT_Pixel_Mode; - - - /*************************************************************************/ - /* */ - /* <Enum> */ - /* ft_pixel_mode_xxx */ - /* */ - /* <Description> */ - /* A list of deprecated constants. Use the corresponding */ - /* @FT_Pixel_Mode values instead. */ - /* */ - /* <Values> */ - /* ft_pixel_mode_none :: See @FT_PIXEL_MODE_NONE. */ - /* ft_pixel_mode_mono :: See @FT_PIXEL_MODE_MONO. */ - /* ft_pixel_mode_grays :: See @FT_PIXEL_MODE_GRAY. */ - /* ft_pixel_mode_pal2 :: See @FT_PIXEL_MODE_GRAY2. */ - /* ft_pixel_mode_pal4 :: See @FT_PIXEL_MODE_GRAY4. */ - /* */ -#define ft_pixel_mode_none FT_PIXEL_MODE_NONE -#define ft_pixel_mode_mono FT_PIXEL_MODE_MONO -#define ft_pixel_mode_grays FT_PIXEL_MODE_GRAY -#define ft_pixel_mode_pal2 FT_PIXEL_MODE_GRAY2 -#define ft_pixel_mode_pal4 FT_PIXEL_MODE_GRAY4 - - /* */ - -#if 0 - - /*************************************************************************/ - /* */ - /* <Enum> */ - /* FT_Palette_Mode */ - /* */ - /* <Description> */ - /* THIS TYPE IS DEPRECATED. DO NOT USE IT! */ - /* */ - /* An enumeration type to describe the format of a bitmap palette, */ - /* used with ft_pixel_mode_pal4 and ft_pixel_mode_pal8. */ - /* */ - /* <Values> */ - /* ft_palette_mode_rgb :: The palette is an array of 3-byte RGB */ - /* records. */ - /* */ - /* ft_palette_mode_rgba :: The palette is an array of 4-byte RGBA */ - /* records. */ - /* */ - /* <Note> */ - /* As ft_pixel_mode_pal2, pal4 and pal8 are currently unused by */ - /* FreeType, these types are not handled by the library itself. */ - /* */ - typedef enum FT_Palette_Mode_ - { - ft_palette_mode_rgb = 0, - ft_palette_mode_rgba, - - ft_palette_mode_max /* do not remove */ - - } FT_Palette_Mode; - - /* */ - -#endif - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FT_Bitmap */ - /* */ - /* <Description> */ - /* A structure used to describe a bitmap or pixmap to the raster. */ - /* Note that we now manage pixmaps of various depths through the */ - /* `pixel_mode' field. */ - /* */ - /* <Fields> */ - /* rows :: The number of bitmap rows. */ - /* */ - /* width :: The number of pixels in bitmap row. */ - /* */ - /* pitch :: The pitch's absolute value is the number of bytes */ - /* taken by one bitmap row, including padding. */ - /* However, the pitch is positive when the bitmap has */ - /* a `down' flow, and negative when it has an `up' */ - /* flow. In all cases, the pitch is an offset to add */ - /* to a bitmap pointer in order to go down one row. */ - /* */ - /* Note that `padding' means the alignment of a */ - /* bitmap to a byte border, and FreeType functions */ - /* normally align to the smallest possible integer */ - /* value. */ - /* */ - /* For the B/W rasterizer, `pitch' is always an even */ - /* number. */ - /* */ - /* To change the pitch of a bitmap (say, to make it a */ - /* multiple of 4), use @FT_Bitmap_Convert. */ - /* Alternatively, you might use callback functions to */ - /* directly render to the application's surface; see */ - /* the file `example2.cpp' in the tutorial for a */ - /* demonstration. */ - /* */ - /* buffer :: A typeless pointer to the bitmap buffer. This */ - /* value should be aligned on 32-bit boundaries in */ - /* most cases. */ - /* */ - /* num_grays :: This field is only used with */ - /* @FT_PIXEL_MODE_GRAY; it gives the number of gray */ - /* levels used in the bitmap. */ - /* */ - /* pixel_mode :: The pixel mode, i.e., how pixel bits are stored. */ - /* See @FT_Pixel_Mode for possible values. */ - /* */ - /* palette_mode :: This field is intended for paletted pixel modes; */ - /* it indicates how the palette is stored. Not */ - /* used currently. */ - /* */ - /* palette :: A typeless pointer to the bitmap palette; this */ - /* field is intended for paletted pixel modes. Not */ - /* used currently. */ - /* */ - /* <Note> */ - /* For now, the only pixel modes supported by FreeType are mono and */ - /* grays. However, drivers might be added in the future to support */ - /* more `colorful' options. */ - /* */ - typedef struct FT_Bitmap_ - { - int rows; - int width; - int pitch; - unsigned char* buffer; - short num_grays; - char pixel_mode; - char palette_mode; - void* palette; - - } FT_Bitmap; - - - /*************************************************************************/ - /* */ - /* <Section> */ - /* outline_processing */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FT_Outline */ - /* */ - /* <Description> */ - /* This structure is used to describe an outline to the scan-line */ - /* converter. */ - /* */ - /* <Fields> */ - /* n_contours :: The number of contours in the outline. */ - /* */ - /* n_points :: The number of points in the outline. */ - /* */ - /* points :: A pointer to an array of `n_points' @FT_Vector */ - /* elements, giving the outline's point coordinates. */ - /* */ - /* tags :: A pointer to an array of `n_points' chars, giving */ - /* each outline point's type. */ - /* */ - /* If bit~0 is unset, the point is `off' the curve, */ - /* i.e., a Bézier control point, while it is `on' if */ - /* set. */ - /* */ - /* Bit~1 is meaningful for `off' points only. If set, */ - /* it indicates a third-order Bézier arc control point; */ - /* and a second-order control point if unset. */ - /* */ - /* If bit~2 is set, bits 5-7 contain the drop-out mode */ - /* (as defined in the OpenType specification; the value */ - /* is the same as the argument to the SCANMODE */ - /* instruction). */ - /* */ - /* Bits 3 and~4 are reserved for internal purposes. */ - /* */ - /* contours :: An array of `n_contours' shorts, giving the end */ - /* point of each contour within the outline. For */ - /* example, the first contour is defined by the points */ - /* `0' to `contours[0]', the second one is defined by */ - /* the points `contours[0]+1' to `contours[1]', etc. */ - /* */ - /* flags :: A set of bit flags used to characterize the outline */ - /* and give hints to the scan-converter and hinter on */ - /* how to convert/grid-fit it. See @FT_OUTLINE_FLAGS. */ - /* */ - /* <Note> */ - /* The B/W rasterizer only checks bit~2 in the `tags' array for the */ - /* first point of each contour. The drop-out mode as given with */ - /* @FT_OUTLINE_IGNORE_DROPOUTS, @FT_OUTLINE_SMART_DROPOUTS, and */ - /* @FT_OUTLINE_INCLUDE_STUBS in `flags' is then overridden. */ - /* */ - typedef struct FT_Outline_ - { - short n_contours; /* number of contours in glyph */ - short n_points; /* number of points in the glyph */ - - FT_Vector* points; /* the outline's points */ - char* tags; /* the points flags */ - short* contours; /* the contour end points */ - - int flags; /* outline masks */ - - } FT_Outline; - - /* Following limits must be consistent with */ - /* FT_Outline.{n_contours,n_points} */ -#define FT_OUTLINE_CONTOURS_MAX SHRT_MAX -#define FT_OUTLINE_POINTS_MAX SHRT_MAX - - - /*************************************************************************/ - /* */ - /* <Enum> */ - /* FT_OUTLINE_FLAGS */ - /* */ - /* <Description> */ - /* A list of bit-field constants use for the flags in an outline's */ - /* `flags' field. */ - /* */ - /* <Values> */ - /* FT_OUTLINE_NONE :: */ - /* Value~0 is reserved. */ - /* */ - /* FT_OUTLINE_OWNER :: */ - /* If set, this flag indicates that the outline's field arrays */ - /* (i.e., `points', `flags', and `contours') are `owned' by the */ - /* outline object, and should thus be freed when it is destroyed. */ - /* */ - /* FT_OUTLINE_EVEN_ODD_FILL :: */ - /* By default, outlines are filled using the non-zero winding rule. */ - /* If set to 1, the outline will be filled using the even-odd fill */ - /* rule (only works with the smooth rasterizer). */ - /* */ - /* FT_OUTLINE_REVERSE_FILL :: */ - /* By default, outside contours of an outline are oriented in */ - /* clock-wise direction, as defined in the TrueType specification. */ - /* This flag is set if the outline uses the opposite direction */ - /* (typically for Type~1 fonts). This flag is ignored by the scan */ - /* converter. */ - /* */ - /* FT_OUTLINE_IGNORE_DROPOUTS :: */ - /* By default, the scan converter will try to detect drop-outs in */ - /* an outline and correct the glyph bitmap to ensure consistent */ - /* shape continuity. If set, this flag hints the scan-line */ - /* converter to ignore such cases. See below for more information. */ - /* */ - /* FT_OUTLINE_SMART_DROPOUTS :: */ - /* Select smart dropout control. If unset, use simple dropout */ - /* control. Ignored if @FT_OUTLINE_IGNORE_DROPOUTS is set. See */ - /* below for more information. */ - /* */ - /* FT_OUTLINE_INCLUDE_STUBS :: */ - /* If set, turn pixels on for `stubs', otherwise exclude them. */ - /* Ignored if @FT_OUTLINE_IGNORE_DROPOUTS is set. See below for */ - /* more information. */ - /* */ - /* FT_OUTLINE_HIGH_PRECISION :: */ - /* This flag indicates that the scan-line converter should try to */ - /* convert this outline to bitmaps with the highest possible */ - /* quality. It is typically set for small character sizes. Note */ - /* that this is only a hint that might be completely ignored by a */ - /* given scan-converter. */ - /* */ - /* FT_OUTLINE_SINGLE_PASS :: */ - /* This flag is set to force a given scan-converter to only use a */ - /* single pass over the outline to render a bitmap glyph image. */ - /* Normally, it is set for very large character sizes. It is only */ - /* a hint that might be completely ignored by a given */ - /* scan-converter. */ - /* */ - /* <Note> */ - /* The flags @FT_OUTLINE_IGNORE_DROPOUTS, @FT_OUTLINE_SMART_DROPOUTS, */ - /* and @FT_OUTLINE_INCLUDE_STUBS are ignored by the smooth */ - /* rasterizer. */ - /* */ - /* There exists a second mechanism to pass the drop-out mode to the */ - /* B/W rasterizer; see the `tags' field in @FT_Outline. */ - /* */ - /* Please refer to the description of the `SCANTYPE' instruction in */ - /* the OpenType specification (in file `ttinst1.doc') how simple */ - /* drop-outs, smart drop-outs, and stubs are defined. */ - /* */ -#define FT_OUTLINE_NONE 0x0 -#define FT_OUTLINE_OWNER 0x1 -#define FT_OUTLINE_EVEN_ODD_FILL 0x2 -#define FT_OUTLINE_REVERSE_FILL 0x4 -#define FT_OUTLINE_IGNORE_DROPOUTS 0x8 -#define FT_OUTLINE_SMART_DROPOUTS 0x10 -#define FT_OUTLINE_INCLUDE_STUBS 0x20 - -#define FT_OUTLINE_HIGH_PRECISION 0x100 -#define FT_OUTLINE_SINGLE_PASS 0x200 - - - /************************************************************************* - * - * @enum: - * ft_outline_flags - * - * @description: - * These constants are deprecated. Please use the corresponding - * @FT_OUTLINE_FLAGS values. - * - * @values: - * ft_outline_none :: See @FT_OUTLINE_NONE. - * ft_outline_owner :: See @FT_OUTLINE_OWNER. - * ft_outline_even_odd_fill :: See @FT_OUTLINE_EVEN_ODD_FILL. - * ft_outline_reverse_fill :: See @FT_OUTLINE_REVERSE_FILL. - * ft_outline_ignore_dropouts :: See @FT_OUTLINE_IGNORE_DROPOUTS. - * ft_outline_high_precision :: See @FT_OUTLINE_HIGH_PRECISION. - * ft_outline_single_pass :: See @FT_OUTLINE_SINGLE_PASS. - */ -#define ft_outline_none FT_OUTLINE_NONE -#define ft_outline_owner FT_OUTLINE_OWNER -#define ft_outline_even_odd_fill FT_OUTLINE_EVEN_ODD_FILL -#define ft_outline_reverse_fill FT_OUTLINE_REVERSE_FILL -#define ft_outline_ignore_dropouts FT_OUTLINE_IGNORE_DROPOUTS -#define ft_outline_high_precision FT_OUTLINE_HIGH_PRECISION -#define ft_outline_single_pass FT_OUTLINE_SINGLE_PASS - - /* */ - -#define FT_CURVE_TAG( flag ) ( flag & 3 ) - -#define FT_CURVE_TAG_ON 1 -#define FT_CURVE_TAG_CONIC 0 -#define FT_CURVE_TAG_CUBIC 2 - -#define FT_CURVE_TAG_HAS_SCANMODE 4 - -#define FT_CURVE_TAG_TOUCH_X 8 /* reserved for the TrueType hinter */ -#define FT_CURVE_TAG_TOUCH_Y 16 /* reserved for the TrueType hinter */ - -#define FT_CURVE_TAG_TOUCH_BOTH ( FT_CURVE_TAG_TOUCH_X | \ - FT_CURVE_TAG_TOUCH_Y ) - -#define FT_Curve_Tag_On FT_CURVE_TAG_ON -#define FT_Curve_Tag_Conic FT_CURVE_TAG_CONIC -#define FT_Curve_Tag_Cubic FT_CURVE_TAG_CUBIC -#define FT_Curve_Tag_Touch_X FT_CURVE_TAG_TOUCH_X -#define FT_Curve_Tag_Touch_Y FT_CURVE_TAG_TOUCH_Y - - - /*************************************************************************/ - /* */ - /* <FuncType> */ - /* FT_Outline_MoveToFunc */ - /* */ - /* <Description> */ - /* A function pointer type used to describe the signature of a `move */ - /* to' function during outline walking/decomposition. */ - /* */ - /* A `move to' is emitted to start a new contour in an outline. */ - /* */ - /* <Input> */ - /* to :: A pointer to the target point of the `move to'. */ - /* */ - /* user :: A typeless pointer which is passed from the caller of the */ - /* decomposition function. */ - /* */ - /* <Return> */ - /* Error code. 0~means success. */ - /* */ - typedef int - (*FT_Outline_MoveToFunc)( const FT_Vector* to, - void* user ); - -#define FT_Outline_MoveTo_Func FT_Outline_MoveToFunc - - - /*************************************************************************/ - /* */ - /* <FuncType> */ - /* FT_Outline_LineToFunc */ - /* */ - /* <Description> */ - /* A function pointer type used to describe the signature of a `line */ - /* to' function during outline walking/decomposition. */ - /* */ - /* A `line to' is emitted to indicate a segment in the outline. */ - /* */ - /* <Input> */ - /* to :: A pointer to the target point of the `line to'. */ - /* */ - /* user :: A typeless pointer which is passed from the caller of the */ - /* decomposition function. */ - /* */ - /* <Return> */ - /* Error code. 0~means success. */ - /* */ - typedef int - (*FT_Outline_LineToFunc)( const FT_Vector* to, - void* user ); - -#define FT_Outline_LineTo_Func FT_Outline_LineToFunc - - - /*************************************************************************/ - /* */ - /* <FuncType> */ - /* FT_Outline_ConicToFunc */ - /* */ - /* <Description> */ - /* A function pointer type used to describe the signature of a `conic */ - /* to' function during outline walking or decomposition. */ - /* */ - /* A `conic to' is emitted to indicate a second-order Bézier arc in */ - /* the outline. */ - /* */ - /* <Input> */ - /* control :: An intermediate control point between the last position */ - /* and the new target in `to'. */ - /* */ - /* to :: A pointer to the target end point of the conic arc. */ - /* */ - /* user :: A typeless pointer which is passed from the caller of */ - /* the decomposition function. */ - /* */ - /* <Return> */ - /* Error code. 0~means success. */ - /* */ - typedef int - (*FT_Outline_ConicToFunc)( const FT_Vector* control, - const FT_Vector* to, - void* user ); - -#define FT_Outline_ConicTo_Func FT_Outline_ConicToFunc - - - /*************************************************************************/ - /* */ - /* <FuncType> */ - /* FT_Outline_CubicToFunc */ - /* */ - /* <Description> */ - /* A function pointer type used to describe the signature of a `cubic */ - /* to' function during outline walking or decomposition. */ - /* */ - /* A `cubic to' is emitted to indicate a third-order Bézier arc. */ - /* */ - /* <Input> */ - /* control1 :: A pointer to the first Bézier control point. */ - /* */ - /* control2 :: A pointer to the second Bézier control point. */ - /* */ - /* to :: A pointer to the target end point. */ - /* */ - /* user :: A typeless pointer which is passed from the caller of */ - /* the decomposition function. */ - /* */ - /* <Return> */ - /* Error code. 0~means success. */ - /* */ - typedef int - (*FT_Outline_CubicToFunc)( const FT_Vector* control1, - const FT_Vector* control2, - const FT_Vector* to, - void* user ); - -#define FT_Outline_CubicTo_Func FT_Outline_CubicToFunc - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FT_Outline_Funcs */ - /* */ - /* <Description> */ - /* A structure to hold various function pointers used during outline */ - /* decomposition in order to emit segments, conic, and cubic Béziers. */ - /* */ - /* <Fields> */ - /* move_to :: The `move to' emitter. */ - /* */ - /* line_to :: The segment emitter. */ - /* */ - /* conic_to :: The second-order Bézier arc emitter. */ - /* */ - /* cubic_to :: The third-order Bézier arc emitter. */ - /* */ - /* shift :: The shift that is applied to coordinates before they */ - /* are sent to the emitter. */ - /* */ - /* delta :: The delta that is applied to coordinates before they */ - /* are sent to the emitter, but after the shift. */ - /* */ - /* <Note> */ - /* The point coordinates sent to the emitters are the transformed */ - /* version of the original coordinates (this is important for high */ - /* accuracy during scan-conversion). The transformation is simple: */ - /* */ - /* { */ - /* x' = (x << shift) - delta */ - /* y' = (x << shift) - delta */ - /* } */ - /* */ - /* Set the values of `shift' and `delta' to~0 to get the original */ - /* point coordinates. */ - /* */ - typedef struct FT_Outline_Funcs_ - { - FT_Outline_MoveToFunc move_to; - FT_Outline_LineToFunc line_to; - FT_Outline_ConicToFunc conic_to; - FT_Outline_CubicToFunc cubic_to; - - int shift; - FT_Pos delta; - - } FT_Outline_Funcs; - - - /*************************************************************************/ - /* */ - /* <Section> */ - /* basic_types */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* <Macro> */ - /* FT_IMAGE_TAG */ - /* */ - /* <Description> */ - /* This macro converts four-letter tags to an unsigned long type. */ - /* */ - /* <Note> */ - /* Since many 16-bit compilers don't like 32-bit enumerations, you */ - /* should redefine this macro in case of problems to something like */ - /* this: */ - /* */ - /* { */ - /* #define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 ) value */ - /* } */ - /* */ - /* to get a simple enumeration without assigning special numbers. */ - /* */ -#ifndef FT_IMAGE_TAG -#define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 ) \ - value = ( ( (unsigned long)_x1 << 24 ) | \ - ( (unsigned long)_x2 << 16 ) | \ - ( (unsigned long)_x3 << 8 ) | \ - (unsigned long)_x4 ) -#endif /* FT_IMAGE_TAG */ - - - /*************************************************************************/ - /* */ - /* <Enum> */ - /* FT_Glyph_Format */ - /* */ - /* <Description> */ - /* An enumeration type used to describe the format of a given glyph */ - /* image. Note that this version of FreeType only supports two image */ - /* formats, even though future font drivers will be able to register */ - /* their own format. */ - /* */ - /* <Values> */ - /* FT_GLYPH_FORMAT_NONE :: */ - /* The value~0 is reserved. */ - /* */ - /* FT_GLYPH_FORMAT_COMPOSITE :: */ - /* The glyph image is a composite of several other images. This */ - /* format is _only_ used with @FT_LOAD_NO_RECURSE, and is used to */ - /* report compound glyphs (like accented characters). */ - /* */ - /* FT_GLYPH_FORMAT_BITMAP :: */ - /* The glyph image is a bitmap, and can be described as an */ - /* @FT_Bitmap. You generally need to access the `bitmap' field of */ - /* the @FT_GlyphSlotRec structure to read it. */ - /* */ - /* FT_GLYPH_FORMAT_OUTLINE :: */ - /* The glyph image is a vectorial outline made of line segments */ - /* and Bézier arcs; it can be described as an @FT_Outline; you */ - /* generally want to access the `outline' field of the */ - /* @FT_GlyphSlotRec structure to read it. */ - /* */ - /* FT_GLYPH_FORMAT_PLOTTER :: */ - /* The glyph image is a vectorial path with no inside and outside */ - /* contours. Some Type~1 fonts, like those in the Hershey family, */ - /* contain glyphs in this format. These are described as */ - /* @FT_Outline, but FreeType isn't currently capable of rendering */ - /* them correctly. */ - /* */ - typedef enum FT_Glyph_Format_ - { - FT_IMAGE_TAG( FT_GLYPH_FORMAT_NONE, 0, 0, 0, 0 ), - - FT_IMAGE_TAG( FT_GLYPH_FORMAT_COMPOSITE, 'c', 'o', 'm', 'p' ), - FT_IMAGE_TAG( FT_GLYPH_FORMAT_BITMAP, 'b', 'i', 't', 's' ), - FT_IMAGE_TAG( FT_GLYPH_FORMAT_OUTLINE, 'o', 'u', 't', 'l' ), - FT_IMAGE_TAG( FT_GLYPH_FORMAT_PLOTTER, 'p', 'l', 'o', 't' ) - - } FT_Glyph_Format; - - - /*************************************************************************/ - /* */ - /* <Enum> */ - /* ft_glyph_format_xxx */ - /* */ - /* <Description> */ - /* A list of deprecated constants. Use the corresponding */ - /* @FT_Glyph_Format values instead. */ - /* */ - /* <Values> */ - /* ft_glyph_format_none :: See @FT_GLYPH_FORMAT_NONE. */ - /* ft_glyph_format_composite :: See @FT_GLYPH_FORMAT_COMPOSITE. */ - /* ft_glyph_format_bitmap :: See @FT_GLYPH_FORMAT_BITMAP. */ - /* ft_glyph_format_outline :: See @FT_GLYPH_FORMAT_OUTLINE. */ - /* ft_glyph_format_plotter :: See @FT_GLYPH_FORMAT_PLOTTER. */ - /* */ -#define ft_glyph_format_none FT_GLYPH_FORMAT_NONE -#define ft_glyph_format_composite FT_GLYPH_FORMAT_COMPOSITE -#define ft_glyph_format_bitmap FT_GLYPH_FORMAT_BITMAP -#define ft_glyph_format_outline FT_GLYPH_FORMAT_OUTLINE -#define ft_glyph_format_plotter FT_GLYPH_FORMAT_PLOTTER - - - /*************************************************************************/ - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** R A S T E R D E F I N I T I O N S *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* A raster is a scan converter, in charge of rendering an outline into */ - /* a a bitmap. This section contains the public API for rasters. */ - /* */ - /* Note that in FreeType 2, all rasters are now encapsulated within */ - /* specific modules called `renderers'. See `freetype/ftrender.h' for */ - /* more details on renderers. */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* <Section> */ - /* raster */ - /* */ - /* <Title> */ - /* Scanline Converter */ - /* */ - /* <Abstract> */ - /* How vectorial outlines are converted into bitmaps and pixmaps. */ - /* */ - /* <Description> */ - /* This section contains technical definitions. */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FT_Raster */ - /* */ - /* <Description> */ - /* A handle (pointer) to a raster object. Each object can be used */ - /* independently to convert an outline into a bitmap or pixmap. */ - /* */ - typedef struct FT_RasterRec_* FT_Raster; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FT_Span */ - /* */ - /* <Description> */ - /* A structure used to model a single span of gray (or black) pixels */ - /* when rendering a monochrome or anti-aliased bitmap. */ - /* */ - /* <Fields> */ - /* x :: The span's horizontal start position. */ - /* */ - /* len :: The span's length in pixels. */ - /* */ - /* coverage :: The span color/coverage, ranging from 0 (background) */ - /* to 255 (foreground). Only used for anti-aliased */ - /* rendering. */ - /* */ - /* <Note> */ - /* This structure is used by the span drawing callback type named */ - /* @FT_SpanFunc which takes the y~coordinate of the span as a */ - /* a parameter. */ - /* */ - /* The coverage value is always between 0 and 255. If you want less */ - /* gray values, the callback function has to reduce them. */ - /* */ - typedef struct FT_Span_ - { - short x; - unsigned short len; - unsigned char coverage; - - } FT_Span; - - - /*************************************************************************/ - /* */ - /* <FuncType> */ - /* FT_SpanFunc */ - /* */ - /* <Description> */ - /* A function used as a call-back by the anti-aliased renderer in */ - /* order to let client applications draw themselves the gray pixel */ - /* spans on each scan line. */ - /* */ - /* <Input> */ - /* y :: The scanline's y~coordinate. */ - /* */ - /* count :: The number of spans to draw on this scanline. */ - /* */ - /* spans :: A table of `count' spans to draw on the scanline. */ - /* */ - /* user :: User-supplied data that is passed to the callback. */ - /* */ - /* <Note> */ - /* This callback allows client applications to directly render the */ - /* gray spans of the anti-aliased bitmap to any kind of surfaces. */ - /* */ - /* This can be used to write anti-aliased outlines directly to a */ - /* given background bitmap, and even perform translucency. */ - /* */ - /* Note that the `count' field cannot be greater than a fixed value */ - /* defined by the `FT_MAX_GRAY_SPANS' configuration macro in */ - /* `ftoption.h'. By default, this value is set to~32, which means */ - /* that if there are more than 32~spans on a given scanline, the */ - /* callback is called several times with the same `y' parameter in */ - /* order to draw all callbacks. */ - /* */ - /* Otherwise, the callback is only called once per scan-line, and */ - /* only for those scanlines that do have `gray' pixels on them. */ - /* */ - typedef void - (*FT_SpanFunc)( int y, - int count, - const FT_Span* spans, - void* user ); - -#define FT_Raster_Span_Func FT_SpanFunc - - - /*************************************************************************/ - /* */ - /* <FuncType> */ - /* FT_Raster_BitTest_Func */ - /* */ - /* <Description> */ - /* THIS TYPE IS DEPRECATED. DO NOT USE IT. */ - /* */ - /* A function used as a call-back by the monochrome scan-converter */ - /* to test whether a given target pixel is already set to the drawing */ - /* `color'. These tests are crucial to implement drop-out control */ - /* per-se the TrueType spec. */ - /* */ - /* <Input> */ - /* y :: The pixel's y~coordinate. */ - /* */ - /* x :: The pixel's x~coordinate. */ - /* */ - /* user :: User-supplied data that is passed to the callback. */ - /* */ - /* <Return> */ - /* 1~if the pixel is `set', 0~otherwise. */ - /* */ - typedef int - (*FT_Raster_BitTest_Func)( int y, - int x, - void* user ); - - - /*************************************************************************/ - /* */ - /* <FuncType> */ - /* FT_Raster_BitSet_Func */ - /* */ - /* <Description> */ - /* THIS TYPE IS DEPRECATED. DO NOT USE IT. */ - /* */ - /* A function used as a call-back by the monochrome scan-converter */ - /* to set an individual target pixel. This is crucial to implement */ - /* drop-out control according to the TrueType specification. */ - /* */ - /* <Input> */ - /* y :: The pixel's y~coordinate. */ - /* */ - /* x :: The pixel's x~coordinate. */ - /* */ - /* user :: User-supplied data that is passed to the callback. */ - /* */ - /* <Return> */ - /* 1~if the pixel is `set', 0~otherwise. */ - /* */ - typedef void - (*FT_Raster_BitSet_Func)( int y, - int x, - void* user ); - - - /*************************************************************************/ - /* */ - /* <Enum> */ - /* FT_RASTER_FLAG_XXX */ - /* */ - /* <Description> */ - /* A list of bit flag constants as used in the `flags' field of a */ - /* @FT_Raster_Params structure. */ - /* */ - /* <Values> */ - /* FT_RASTER_FLAG_DEFAULT :: This value is 0. */ - /* */ - /* FT_RASTER_FLAG_AA :: This flag is set to indicate that an */ - /* anti-aliased glyph image should be */ - /* generated. Otherwise, it will be */ - /* monochrome (1-bit). */ - /* */ - /* FT_RASTER_FLAG_DIRECT :: This flag is set to indicate direct */ - /* rendering. In this mode, client */ - /* applications must provide their own span */ - /* callback. This lets them directly */ - /* draw or compose over an existing bitmap. */ - /* If this bit is not set, the target */ - /* pixmap's buffer _must_ be zeroed before */ - /* rendering. */ - /* */ - /* Note that for now, direct rendering is */ - /* only possible with anti-aliased glyphs. */ - /* */ - /* FT_RASTER_FLAG_CLIP :: This flag is only used in direct */ - /* rendering mode. If set, the output will */ - /* be clipped to a box specified in the */ - /* `clip_box' field of the */ - /* @FT_Raster_Params structure. */ - /* */ - /* Note that by default, the glyph bitmap */ - /* is clipped to the target pixmap, except */ - /* in direct rendering mode where all spans */ - /* are generated if no clipping box is set. */ - /* */ -#define FT_RASTER_FLAG_DEFAULT 0x0 -#define FT_RASTER_FLAG_AA 0x1 -#define FT_RASTER_FLAG_DIRECT 0x2 -#define FT_RASTER_FLAG_CLIP 0x4 - - /* deprecated */ -#define ft_raster_flag_default FT_RASTER_FLAG_DEFAULT -#define ft_raster_flag_aa FT_RASTER_FLAG_AA -#define ft_raster_flag_direct FT_RASTER_FLAG_DIRECT -#define ft_raster_flag_clip FT_RASTER_FLAG_CLIP - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FT_Raster_Params */ - /* */ - /* <Description> */ - /* A structure to hold the arguments used by a raster's render */ - /* function. */ - /* */ - /* <Fields> */ - /* target :: The target bitmap. */ - /* */ - /* source :: A pointer to the source glyph image (e.g., an */ - /* @FT_Outline). */ - /* */ - /* flags :: The rendering flags. */ - /* */ - /* gray_spans :: The gray span drawing callback. */ - /* */ - /* black_spans :: The black span drawing callback. UNIMPLEMENTED! */ - /* */ - /* bit_test :: The bit test callback. UNIMPLEMENTED! */ - /* */ - /* bit_set :: The bit set callback. UNIMPLEMENTED! */ - /* */ - /* user :: User-supplied data that is passed to each drawing */ - /* callback. */ - /* */ - /* clip_box :: An optional clipping box. It is only used in */ - /* direct rendering mode. Note that coordinates here */ - /* should be expressed in _integer_ pixels (and not in */ - /* 26.6 fixed-point units). */ - /* */ - /* <Note> */ - /* An anti-aliased glyph bitmap is drawn if the @FT_RASTER_FLAG_AA */ - /* bit flag is set in the `flags' field, otherwise a monochrome */ - /* bitmap is generated. */ - /* */ - /* If the @FT_RASTER_FLAG_DIRECT bit flag is set in `flags', the */ - /* raster will call the `gray_spans' callback to draw gray pixel */ - /* spans, in the case of an aa glyph bitmap, it will call */ - /* `black_spans', and `bit_test' and `bit_set' in the case of a */ - /* monochrome bitmap. This allows direct composition over a */ - /* pre-existing bitmap through user-provided callbacks to perform the */ - /* span drawing/composition. */ - /* */ - /* Note that the `bit_test' and `bit_set' callbacks are required when */ - /* rendering a monochrome bitmap, as they are crucial to implement */ - /* correct drop-out control as defined in the TrueType specification. */ - /* */ - typedef struct FT_Raster_Params_ - { - const FT_Bitmap* target; - const void* source; - int flags; - FT_SpanFunc gray_spans; - FT_SpanFunc black_spans; /* doesn't work! */ - FT_Raster_BitTest_Func bit_test; /* doesn't work! */ - FT_Raster_BitSet_Func bit_set; /* doesn't work! */ - void* user; - FT_BBox clip_box; - - } FT_Raster_Params; - - - /*************************************************************************/ - /* */ - /* <FuncType> */ - /* FT_Raster_NewFunc */ - /* */ - /* <Description> */ - /* A function used to create a new raster object. */ - /* */ - /* <Input> */ - /* memory :: A handle to the memory allocator. */ - /* */ - /* <Output> */ - /* raster :: A handle to the new raster object. */ - /* */ - /* <Return> */ - /* Error code. 0~means success. */ - /* */ - /* <Note> */ - /* The `memory' parameter is a typeless pointer in order to avoid */ - /* un-wanted dependencies on the rest of the FreeType code. In */ - /* practice, it is an @FT_Memory object, i.e., a handle to the */ - /* standard FreeType memory allocator. However, this field can be */ - /* completely ignored by a given raster implementation. */ - /* */ - typedef int - (*FT_Raster_NewFunc)( void* memory, - FT_Raster* raster ); - -#define FT_Raster_New_Func FT_Raster_NewFunc - - - /*************************************************************************/ - /* */ - /* <FuncType> */ - /* FT_Raster_DoneFunc */ - /* */ - /* <Description> */ - /* A function used to destroy a given raster object. */ - /* */ - /* <Input> */ - /* raster :: A handle to the raster object. */ - /* */ - typedef void - (*FT_Raster_DoneFunc)( FT_Raster raster ); - -#define FT_Raster_Done_Func FT_Raster_DoneFunc - - - /*************************************************************************/ - /* */ - /* <FuncType> */ - /* FT_Raster_ResetFunc */ - /* */ - /* <Description> */ - /* FreeType provides an area of memory called the `render pool', */ - /* available to all registered rasters. This pool can be freely used */ - /* during a given scan-conversion but is shared by all rasters. Its */ - /* content is thus transient. */ - /* */ - /* This function is called each time the render pool changes, or just */ - /* after a new raster object is created. */ - /* */ - /* <Input> */ - /* raster :: A handle to the new raster object. */ - /* */ - /* pool_base :: The address in memory of the render pool. */ - /* */ - /* pool_size :: The size in bytes of the render pool. */ - /* */ - /* <Note> */ - /* Rasters can ignore the render pool and rely on dynamic memory */ - /* allocation if they want to (a handle to the memory allocator is */ - /* passed to the raster constructor). However, this is not */ - /* recommended for efficiency purposes. */ - /* */ - typedef void - (*FT_Raster_ResetFunc)( FT_Raster raster, - unsigned char* pool_base, - unsigned long pool_size ); - -#define FT_Raster_Reset_Func FT_Raster_ResetFunc - - - /*************************************************************************/ - /* */ - /* <FuncType> */ - /* FT_Raster_SetModeFunc */ - /* */ - /* <Description> */ - /* This function is a generic facility to change modes or attributes */ - /* in a given raster. This can be used for debugging purposes, or */ - /* simply to allow implementation-specific `features' in a given */ - /* raster module. */ - /* */ - /* <Input> */ - /* raster :: A handle to the new raster object. */ - /* */ - /* mode :: A 4-byte tag used to name the mode or property. */ - /* */ - /* args :: A pointer to the new mode/property to use. */ - /* */ - typedef int - (*FT_Raster_SetModeFunc)( FT_Raster raster, - unsigned long mode, - void* args ); - -#define FT_Raster_Set_Mode_Func FT_Raster_SetModeFunc - - - /*************************************************************************/ - /* */ - /* <FuncType> */ - /* FT_Raster_RenderFunc */ - /* */ - /* <Description> */ - /* Invoke a given raster to scan-convert a given glyph image into a */ - /* target bitmap. */ - /* */ - /* <Input> */ - /* raster :: A handle to the raster object. */ - /* */ - /* params :: A pointer to an @FT_Raster_Params structure used to */ - /* store the rendering parameters. */ - /* */ - /* <Return> */ - /* Error code. 0~means success. */ - /* */ - /* <Note> */ - /* The exact format of the source image depends on the raster's glyph */ - /* format defined in its @FT_Raster_Funcs structure. It can be an */ - /* @FT_Outline or anything else in order to support a large array of */ - /* glyph formats. */ - /* */ - /* Note also that the render function can fail and return a */ - /* `FT_Err_Unimplemented_Feature' error code if the raster used does */ - /* not support direct composition. */ - /* */ - /* XXX: For now, the standard raster doesn't support direct */ - /* composition but this should change for the final release (see */ - /* the files `demos/src/ftgrays.c' and `demos/src/ftgrays2.c' */ - /* for examples of distinct implementations which support direct */ - /* composition). */ - /* */ - typedef int - (*FT_Raster_RenderFunc)( FT_Raster raster, - const FT_Raster_Params* params ); - -#define FT_Raster_Render_Func FT_Raster_RenderFunc - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FT_Raster_Funcs */ - /* */ - /* <Description> */ - /* A structure used to describe a given raster class to the library. */ - /* */ - /* <Fields> */ - /* glyph_format :: The supported glyph format for this raster. */ - /* */ - /* raster_new :: The raster constructor. */ - /* */ - /* raster_reset :: Used to reset the render pool within the raster. */ - /* */ - /* raster_render :: A function to render a glyph into a given bitmap. */ - /* */ - /* raster_done :: The raster destructor. */ - /* */ - typedef struct FT_Raster_Funcs_ - { - FT_Glyph_Format glyph_format; - FT_Raster_NewFunc raster_new; - FT_Raster_ResetFunc raster_reset; - FT_Raster_SetModeFunc raster_set_mode; - FT_Raster_RenderFunc raster_render; - FT_Raster_DoneFunc raster_done; - - } FT_Raster_Funcs; - - - /* */ - - -FT_END_HEADER - -#endif /* __FTIMAGE_H__ */ - - -/* END */ - - -/* Local Variables: */ -/* coding: utf-8 */ -/* End: */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftincrem.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftincrem.h deleted file mode 100644 index aaf689ff16..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftincrem.h +++ /dev/null @@ -1,353 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftincrem.h */ -/* */ -/* FreeType incremental loading (specification). */ -/* */ -/* Copyright 2002, 2003, 2006, 2007, 2008, 2010 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __FTINCREM_H__ -#define __FTINCREM_H__ - -#include <ft2build.h> -#include FT_FREETYPE_H - -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - - -FT_BEGIN_HEADER - - /*************************************************************************** - * - * @section: - * incremental - * - * @title: - * Incremental Loading - * - * @abstract: - * Custom Glyph Loading. - * - * @description: - * This section contains various functions used to perform so-called - * `incremental' glyph loading. This is a mode where all glyphs loaded - * from a given @FT_Face are provided by the client application, - * - * Apart from that, all other tables are loaded normally from the font - * file. This mode is useful when FreeType is used within another - * engine, e.g., a PostScript Imaging Processor. - * - * To enable this mode, you must use @FT_Open_Face, passing an - * @FT_Parameter with the @FT_PARAM_TAG_INCREMENTAL tag and an - * @FT_Incremental_Interface value. See the comments for - * @FT_Incremental_InterfaceRec for an example. - * - */ - - - /*************************************************************************** - * - * @type: - * FT_Incremental - * - * @description: - * An opaque type describing a user-provided object used to implement - * `incremental' glyph loading within FreeType. This is used to support - * embedded fonts in certain environments (e.g., PostScript interpreters), - * where the glyph data isn't in the font file, or must be overridden by - * different values. - * - * @note: - * It is up to client applications to create and implement @FT_Incremental - * objects, as long as they provide implementations for the methods - * @FT_Incremental_GetGlyphDataFunc, @FT_Incremental_FreeGlyphDataFunc - * and @FT_Incremental_GetGlyphMetricsFunc. - * - * See the description of @FT_Incremental_InterfaceRec to understand how - * to use incremental objects with FreeType. - * - */ - typedef struct FT_IncrementalRec_* FT_Incremental; - - - /*************************************************************************** - * - * @struct: - * FT_Incremental_MetricsRec - * - * @description: - * A small structure used to contain the basic glyph metrics returned - * by the @FT_Incremental_GetGlyphMetricsFunc method. - * - * @fields: - * bearing_x :: - * Left bearing, in font units. - * - * bearing_y :: - * Top bearing, in font units. - * - * advance :: - * Horizontal component of glyph advance, in font units. - * - * advance_v :: - * Vertical component of glyph advance, in font units. - * - * @note: - * These correspond to horizontal or vertical metrics depending on the - * value of the `vertical' argument to the function - * @FT_Incremental_GetGlyphMetricsFunc. - * - */ - typedef struct FT_Incremental_MetricsRec_ - { - FT_Long bearing_x; - FT_Long bearing_y; - FT_Long advance; - FT_Long advance_v; /* since 2.3.12 */ - - } FT_Incremental_MetricsRec; - - - /*************************************************************************** - * - * @struct: - * FT_Incremental_Metrics - * - * @description: - * A handle to an @FT_Incremental_MetricsRec structure. - * - */ - typedef struct FT_Incremental_MetricsRec_* FT_Incremental_Metrics; - - - /*************************************************************************** - * - * @type: - * FT_Incremental_GetGlyphDataFunc - * - * @description: - * A function called by FreeType to access a given glyph's data bytes - * during @FT_Load_Glyph or @FT_Load_Char if incremental loading is - * enabled. - * - * Note that the format of the glyph's data bytes depends on the font - * file format. For TrueType, it must correspond to the raw bytes within - * the `glyf' table. For PostScript formats, it must correspond to the - * *unencrypted* charstring bytes, without any `lenIV' header. It is - * undefined for any other format. - * - * @input: - * incremental :: - * Handle to an opaque @FT_Incremental handle provided by the client - * application. - * - * glyph_index :: - * Index of relevant glyph. - * - * @output: - * adata :: - * A structure describing the returned glyph data bytes (which will be - * accessed as a read-only byte block). - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * If this function returns successfully the method - * @FT_Incremental_FreeGlyphDataFunc will be called later to release - * the data bytes. - * - * Nested calls to @FT_Incremental_GetGlyphDataFunc can happen for - * compound glyphs. - * - */ - typedef FT_Error - (*FT_Incremental_GetGlyphDataFunc)( FT_Incremental incremental, - FT_UInt glyph_index, - FT_Data* adata ); - - - /*************************************************************************** - * - * @type: - * FT_Incremental_FreeGlyphDataFunc - * - * @description: - * A function used to release the glyph data bytes returned by a - * successful call to @FT_Incremental_GetGlyphDataFunc. - * - * @input: - * incremental :: - * A handle to an opaque @FT_Incremental handle provided by the client - * application. - * - * data :: - * A structure describing the glyph data bytes (which will be accessed - * as a read-only byte block). - * - */ - typedef void - (*FT_Incremental_FreeGlyphDataFunc)( FT_Incremental incremental, - FT_Data* data ); - - - /*************************************************************************** - * - * @type: - * FT_Incremental_GetGlyphMetricsFunc - * - * @description: - * A function used to retrieve the basic metrics of a given glyph index - * before accessing its data. This is necessary because, in certain - * formats like TrueType, the metrics are stored in a different place from - * the glyph images proper. - * - * @input: - * incremental :: - * A handle to an opaque @FT_Incremental handle provided by the client - * application. - * - * glyph_index :: - * Index of relevant glyph. - * - * vertical :: - * If true, return vertical metrics. - * - * ametrics :: - * This parameter is used for both input and output. - * The original glyph metrics, if any, in font units. If metrics are - * not available all the values must be set to zero. - * - * @output: - * ametrics :: - * The replacement glyph metrics in font units. - * - */ - typedef FT_Error - (*FT_Incremental_GetGlyphMetricsFunc) - ( FT_Incremental incremental, - FT_UInt glyph_index, - FT_Bool vertical, - FT_Incremental_MetricsRec *ametrics ); - - - /************************************************************************** - * - * @struct: - * FT_Incremental_FuncsRec - * - * @description: - * A table of functions for accessing fonts that load data - * incrementally. Used in @FT_Incremental_InterfaceRec. - * - * @fields: - * get_glyph_data :: - * The function to get glyph data. Must not be null. - * - * free_glyph_data :: - * The function to release glyph data. Must not be null. - * - * get_glyph_metrics :: - * The function to get glyph metrics. May be null if the font does - * not provide overriding glyph metrics. - * - */ - typedef struct FT_Incremental_FuncsRec_ - { - FT_Incremental_GetGlyphDataFunc get_glyph_data; - FT_Incremental_FreeGlyphDataFunc free_glyph_data; - FT_Incremental_GetGlyphMetricsFunc get_glyph_metrics; - - } FT_Incremental_FuncsRec; - - - /*************************************************************************** - * - * @struct: - * FT_Incremental_InterfaceRec - * - * @description: - * A structure to be used with @FT_Open_Face to indicate that the user - * wants to support incremental glyph loading. You should use it with - * @FT_PARAM_TAG_INCREMENTAL as in the following example: - * - * { - * FT_Incremental_InterfaceRec inc_int; - * FT_Parameter parameter; - * FT_Open_Args open_args; - * - * - * // set up incremental descriptor - * inc_int.funcs = my_funcs; - * inc_int.object = my_object; - * - * // set up optional parameter - * parameter.tag = FT_PARAM_TAG_INCREMENTAL; - * parameter.data = &inc_int; - * - * // set up FT_Open_Args structure - * open_args.flags = FT_OPEN_PATHNAME | FT_OPEN_PARAMS; - * open_args.pathname = my_font_pathname; - * open_args.num_params = 1; - * open_args.params = ¶meter; // we use one optional argument - * - * // open the font - * error = FT_Open_Face( library, &open_args, index, &face ); - * ... - * } - * - */ - typedef struct FT_Incremental_InterfaceRec_ - { - const FT_Incremental_FuncsRec* funcs; - FT_Incremental object; - - } FT_Incremental_InterfaceRec; - - - /*************************************************************************** - * - * @type: - * FT_Incremental_Interface - * - * @description: - * A pointer to an @FT_Incremental_InterfaceRec structure. - * - */ - typedef FT_Incremental_InterfaceRec* FT_Incremental_Interface; - - - /*************************************************************************** - * - * @constant: - * FT_PARAM_TAG_INCREMENTAL - * - * @description: - * A constant used as the tag of @FT_Parameter structures to indicate - * an incremental loading object to be used by FreeType. - * - */ -#define FT_PARAM_TAG_INCREMENTAL FT_MAKE_TAG( 'i', 'n', 'c', 'r' ) - - /* */ - -FT_END_HEADER - -#endif /* __FTINCREM_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftlcdfil.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftlcdfil.h deleted file mode 100644 index 0b55ebee65..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftlcdfil.h +++ /dev/null @@ -1,213 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftlcdfil.h */ -/* */ -/* FreeType API for color filtering of subpixel bitmap glyphs */ -/* (specification). */ -/* */ -/* Copyright 2006, 2007, 2008, 2010 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __FT_LCD_FILTER_H__ -#define __FT_LCD_FILTER_H__ - -#include <ft2build.h> -#include FT_FREETYPE_H - -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - - -FT_BEGIN_HEADER - - /*************************************************************************** - * - * @section: - * lcd_filtering - * - * @title: - * LCD Filtering - * - * @abstract: - * Reduce color fringes of LCD-optimized bitmaps. - * - * @description: - * The @FT_Library_SetLcdFilter API can be used to specify a low-pass - * filter which is then applied to LCD-optimized bitmaps generated - * through @FT_Render_Glyph. This is useful to reduce color fringes - * which would occur with unfiltered rendering. - * - * Note that no filter is active by default, and that this function is - * *not* implemented in default builds of the library. You need to - * #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING in your `ftoption.h' file - * in order to activate it. - */ - - - /**************************************************************************** - * - * @enum: - * FT_LcdFilter - * - * @description: - * A list of values to identify various types of LCD filters. - * - * @values: - * FT_LCD_FILTER_NONE :: - * Do not perform filtering. When used with subpixel rendering, this - * results in sometimes severe color fringes. - * - * FT_LCD_FILTER_DEFAULT :: - * The default filter reduces color fringes considerably, at the cost - * of a slight blurriness in the output. - * - * FT_LCD_FILTER_LIGHT :: - * The light filter is a variant that produces less blurriness at the - * cost of slightly more color fringes than the default one. It might - * be better, depending on taste, your monitor, or your personal vision. - * - * FT_LCD_FILTER_LEGACY :: - * This filter corresponds to the original libXft color filter. It - * provides high contrast output but can exhibit really bad color - * fringes if glyphs are not extremely well hinted to the pixel grid. - * In other words, it only works well if the TrueType bytecode - * interpreter is enabled *and* high-quality hinted fonts are used. - * - * This filter is only provided for comparison purposes, and might be - * disabled or stay unsupported in the future. - * - * @since: - * 2.3.0 - */ - typedef enum FT_LcdFilter_ - { - FT_LCD_FILTER_NONE = 0, - FT_LCD_FILTER_DEFAULT = 1, - FT_LCD_FILTER_LIGHT = 2, - FT_LCD_FILTER_LEGACY = 16, - - FT_LCD_FILTER_MAX /* do not remove */ - - } FT_LcdFilter; - - - /************************************************************************** - * - * @func: - * FT_Library_SetLcdFilter - * - * @description: - * This function is used to apply color filtering to LCD decimated - * bitmaps, like the ones used when calling @FT_Render_Glyph with - * @FT_RENDER_MODE_LCD or @FT_RENDER_MODE_LCD_V. - * - * @input: - * library :: - * A handle to the target library instance. - * - * filter :: - * The filter type. - * - * You can use @FT_LCD_FILTER_NONE here to disable this feature, or - * @FT_LCD_FILTER_DEFAULT to use a default filter that should work - * well on most LCD screens. - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * This feature is always disabled by default. Clients must make an - * explicit call to this function with a `filter' value other than - * @FT_LCD_FILTER_NONE in order to enable it. - * - * Due to *PATENTS* covering subpixel rendering, this function doesn't - * do anything except returning `FT_Err_Unimplemented_Feature' if the - * configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING is not - * defined in your build of the library, which should correspond to all - * default builds of FreeType. - * - * The filter affects glyph bitmaps rendered through @FT_Render_Glyph, - * @FT_Outline_Get_Bitmap, @FT_Load_Glyph, and @FT_Load_Char. - * - * It does _not_ affect the output of @FT_Outline_Render and - * @FT_Outline_Get_Bitmap. - * - * If this feature is activated, the dimensions of LCD glyph bitmaps are - * either larger or taller than the dimensions of the corresponding - * outline with regards to the pixel grid. For example, for - * @FT_RENDER_MODE_LCD, the filter adds up to 3~pixels to the left, and - * up to 3~pixels to the right. - * - * The bitmap offset values are adjusted correctly, so clients shouldn't - * need to modify their layout and glyph positioning code when enabling - * the filter. - * - * @since: - * 2.3.0 - */ - FT_EXPORT( FT_Error ) - FT_Library_SetLcdFilter( FT_Library library, - FT_LcdFilter filter ); - - - /************************************************************************** - * - * @func: - * FT_Library_SetLcdFilterWeights - * - * @description: - * Use this function to override the filter weights selected by - * @FT_Library_SetLcdFilter. By default, FreeType uses the quintuple - * (0x00, 0x55, 0x56, 0x55, 0x00) for FT_LCD_FILTER_LIGHT, and (0x10, - * 0x40, 0x70, 0x40, 0x10) for FT_LCD_FILTER_DEFAULT and - * FT_LCD_FILTER_LEGACY. - * - * @input: - * library :: - * A handle to the target library instance. - * - * weights :: - * A pointer to an array; the function copies the first five bytes and - * uses them to specify the filter weights. - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * Due to *PATENTS* covering subpixel rendering, this function doesn't - * do anything except returning `FT_Err_Unimplemented_Feature' if the - * configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING is not - * defined in your build of the library, which should correspond to all - * default builds of FreeType. - * - * This function must be called after @FT_Library_SetLcdFilter to have - * any effect. - * - * @since: - * 2.4.0 - */ - FT_EXPORT( FT_Error ) - FT_Library_SetLcdFilterWeights( FT_Library library, - unsigned char *weights ); - - /* */ - - -FT_END_HEADER - -#endif /* __FT_LCD_FILTER_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftlist.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftlist.h deleted file mode 100644 index bb6f7f119d..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftlist.h +++ /dev/null @@ -1,277 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftlist.h */ -/* */ -/* Generic list support for FreeType (specification). */ -/* */ -/* Copyright 1996-2001, 2003, 2007, 2010 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - - /*************************************************************************/ - /* */ - /* This file implements functions relative to list processing. Its */ - /* data structures are defined in `freetype.h'. */ - /* */ - /*************************************************************************/ - - -#ifndef __FTLIST_H__ -#define __FTLIST_H__ - - -#include <ft2build.h> -#include FT_FREETYPE_H - -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - - -FT_BEGIN_HEADER - - - /*************************************************************************/ - /* */ - /* <Section> */ - /* list_processing */ - /* */ - /* <Title> */ - /* List Processing */ - /* */ - /* <Abstract> */ - /* Simple management of lists. */ - /* */ - /* <Description> */ - /* This section contains various definitions related to list */ - /* processing using doubly-linked nodes. */ - /* */ - /* <Order> */ - /* FT_List */ - /* FT_ListNode */ - /* FT_ListRec */ - /* FT_ListNodeRec */ - /* */ - /* FT_List_Add */ - /* FT_List_Insert */ - /* FT_List_Find */ - /* FT_List_Remove */ - /* FT_List_Up */ - /* FT_List_Iterate */ - /* FT_List_Iterator */ - /* FT_List_Finalize */ - /* FT_List_Destructor */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_List_Find */ - /* */ - /* <Description> */ - /* Find the list node for a given listed object. */ - /* */ - /* <Input> */ - /* list :: A pointer to the parent list. */ - /* data :: The address of the listed object. */ - /* */ - /* <Return> */ - /* List node. NULL if it wasn't found. */ - /* */ - FT_EXPORT( FT_ListNode ) - FT_List_Find( FT_List list, - void* data ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_List_Add */ - /* */ - /* <Description> */ - /* Append an element to the end of a list. */ - /* */ - /* <InOut> */ - /* list :: A pointer to the parent list. */ - /* node :: The node to append. */ - /* */ - FT_EXPORT( void ) - FT_List_Add( FT_List list, - FT_ListNode node ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_List_Insert */ - /* */ - /* <Description> */ - /* Insert an element at the head of a list. */ - /* */ - /* <InOut> */ - /* list :: A pointer to parent list. */ - /* node :: The node to insert. */ - /* */ - FT_EXPORT( void ) - FT_List_Insert( FT_List list, - FT_ListNode node ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_List_Remove */ - /* */ - /* <Description> */ - /* Remove a node from a list. This function doesn't check whether */ - /* the node is in the list! */ - /* */ - /* <Input> */ - /* node :: The node to remove. */ - /* */ - /* <InOut> */ - /* list :: A pointer to the parent list. */ - /* */ - FT_EXPORT( void ) - FT_List_Remove( FT_List list, - FT_ListNode node ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_List_Up */ - /* */ - /* <Description> */ - /* Move a node to the head/top of a list. Used to maintain LRU */ - /* lists. */ - /* */ - /* <InOut> */ - /* list :: A pointer to the parent list. */ - /* node :: The node to move. */ - /* */ - FT_EXPORT( void ) - FT_List_Up( FT_List list, - FT_ListNode node ); - - - /*************************************************************************/ - /* */ - /* <FuncType> */ - /* FT_List_Iterator */ - /* */ - /* <Description> */ - /* An FT_List iterator function which is called during a list parse */ - /* by @FT_List_Iterate. */ - /* */ - /* <Input> */ - /* node :: The current iteration list node. */ - /* */ - /* user :: A typeless pointer passed to @FT_List_Iterate. */ - /* Can be used to point to the iteration's state. */ - /* */ - typedef FT_Error - (*FT_List_Iterator)( FT_ListNode node, - void* user ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_List_Iterate */ - /* */ - /* <Description> */ - /* Parse a list and calls a given iterator function on each element. */ - /* Note that parsing is stopped as soon as one of the iterator calls */ - /* returns a non-zero value. */ - /* */ - /* <Input> */ - /* list :: A handle to the list. */ - /* iterator :: An iterator function, called on each node of the list. */ - /* user :: A user-supplied field which is passed as the second */ - /* argument to the iterator. */ - /* */ - /* <Return> */ - /* The result (a FreeType error code) of the last iterator call. */ - /* */ - FT_EXPORT( FT_Error ) - FT_List_Iterate( FT_List list, - FT_List_Iterator iterator, - void* user ); - - - /*************************************************************************/ - /* */ - /* <FuncType> */ - /* FT_List_Destructor */ - /* */ - /* <Description> */ - /* An @FT_List iterator function which is called during a list */ - /* finalization by @FT_List_Finalize to destroy all elements in a */ - /* given list. */ - /* */ - /* <Input> */ - /* system :: The current system object. */ - /* */ - /* data :: The current object to destroy. */ - /* */ - /* user :: A typeless pointer passed to @FT_List_Iterate. It can */ - /* be used to point to the iteration's state. */ - /* */ - typedef void - (*FT_List_Destructor)( FT_Memory memory, - void* data, - void* user ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_List_Finalize */ - /* */ - /* <Description> */ - /* Destroy all elements in the list as well as the list itself. */ - /* */ - /* <Input> */ - /* list :: A handle to the list. */ - /* */ - /* destroy :: A list destructor that will be applied to each element */ - /* of the list. */ - /* */ - /* memory :: The current memory object which handles deallocation. */ - /* */ - /* user :: A user-supplied field which is passed as the last */ - /* argument to the destructor. */ - /* */ - /* <Note> */ - /* This function expects that all nodes added by @FT_List_Add or */ - /* @FT_List_Insert have been dynamically allocated. */ - /* */ - FT_EXPORT( void ) - FT_List_Finalize( FT_List list, - FT_List_Destructor destroy, - FT_Memory memory, - void* user ); - - - /* */ - - -FT_END_HEADER - -#endif /* __FTLIST_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftlzw.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftlzw.h deleted file mode 100644 index 00d40169a7..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftlzw.h +++ /dev/null @@ -1,99 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftlzw.h */ -/* */ -/* LZW-compressed stream support. */ -/* */ -/* Copyright 2004, 2006 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __FTLZW_H__ -#define __FTLZW_H__ - -#include <ft2build.h> -#include FT_FREETYPE_H - -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - - -FT_BEGIN_HEADER - - /*************************************************************************/ - /* */ - /* <Section> */ - /* lzw */ - /* */ - /* <Title> */ - /* LZW Streams */ - /* */ - /* <Abstract> */ - /* Using LZW-compressed font files. */ - /* */ - /* <Description> */ - /* This section contains the declaration of LZW-specific functions. */ - /* */ - /*************************************************************************/ - - /************************************************************************ - * - * @function: - * FT_Stream_OpenLZW - * - * @description: - * Open a new stream to parse LZW-compressed font files. This is - * mainly used to support the compressed `*.pcf.Z' fonts that come - * with XFree86. - * - * @input: - * stream :: The target embedding stream. - * - * source :: The source stream. - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * The source stream must be opened _before_ calling this function. - * - * Calling the internal function `FT_Stream_Close' on the new stream will - * *not* call `FT_Stream_Close' on the source stream. None of the stream - * objects will be released to the heap. - * - * The stream implementation is very basic and resets the decompression - * process each time seeking backwards is needed within the stream - * - * In certain builds of the library, LZW compression recognition is - * automatically handled when calling @FT_New_Face or @FT_Open_Face. - * This means that if no font driver is capable of handling the raw - * compressed file, the library will try to open a LZW stream from it - * and re-open the face with it. - * - * This function may return `FT_Err_Unimplemented_Feature' if your build - * of FreeType was not compiled with LZW support. - */ - FT_EXPORT( FT_Error ) - FT_Stream_OpenLZW( FT_Stream stream, - FT_Stream source ); - - /* */ - - -FT_END_HEADER - -#endif /* __FTLZW_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftmac.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftmac.h deleted file mode 100644 index ab5bab5170..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftmac.h +++ /dev/null @@ -1,274 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftmac.h */ -/* */ -/* Additional Mac-specific API. */ -/* */ -/* Copyright 1996-2001, 2004, 2006, 2007 by */ -/* Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -/***************************************************************************/ -/* */ -/* NOTE: Include this file after <freetype/freetype.h> and after any */ -/* Mac-specific headers (because this header uses Mac types such as */ -/* Handle, FSSpec, FSRef, etc.) */ -/* */ -/***************************************************************************/ - - -#ifndef __FTMAC_H__ -#define __FTMAC_H__ - - -#include <ft2build.h> - - -FT_BEGIN_HEADER - - -/* gcc-3.4.1 and later can warn about functions tagged as deprecated */ -#ifndef FT_DEPRECATED_ATTRIBUTE -#if defined(__GNUC__) && \ - ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1))) -#define FT_DEPRECATED_ATTRIBUTE __attribute__((deprecated)) -#else -#define FT_DEPRECATED_ATTRIBUTE -#endif -#endif - - - /*************************************************************************/ - /* */ - /* <Section> */ - /* mac_specific */ - /* */ - /* <Title> */ - /* Mac Specific Interface */ - /* */ - /* <Abstract> */ - /* Only available on the Macintosh. */ - /* */ - /* <Description> */ - /* The following definitions are only available if FreeType is */ - /* compiled on a Macintosh. */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_New_Face_From_FOND */ - /* */ - /* <Description> */ - /* Create a new face object from a FOND resource. */ - /* */ - /* <InOut> */ - /* library :: A handle to the library resource. */ - /* */ - /* <Input> */ - /* fond :: A FOND resource. */ - /* */ - /* face_index :: Only supported for the -1 `sanity check' special */ - /* case. */ - /* */ - /* <Output> */ - /* aface :: A handle to a new face object. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - /* <Notes> */ - /* This function can be used to create @FT_Face objects from fonts */ - /* that are installed in the system as follows. */ - /* */ - /* { */ - /* fond = GetResource( 'FOND', fontName ); */ - /* error = FT_New_Face_From_FOND( library, fond, 0, &face ); */ - /* } */ - /* */ - FT_EXPORT( FT_Error ) - FT_New_Face_From_FOND( FT_Library library, - Handle fond, - FT_Long face_index, - FT_Face *aface ) - FT_DEPRECATED_ATTRIBUTE; - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_GetFile_From_Mac_Name */ - /* */ - /* <Description> */ - /* Return an FSSpec for the disk file containing the named font. */ - /* */ - /* <Input> */ - /* fontName :: Mac OS name of the font (e.g., Times New Roman */ - /* Bold). */ - /* */ - /* <Output> */ - /* pathSpec :: FSSpec to the file. For passing to */ - /* @FT_New_Face_From_FSSpec. */ - /* */ - /* face_index :: Index of the face. For passing to */ - /* @FT_New_Face_From_FSSpec. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - FT_EXPORT( FT_Error ) - FT_GetFile_From_Mac_Name( const char* fontName, - FSSpec* pathSpec, - FT_Long* face_index ) - FT_DEPRECATED_ATTRIBUTE; - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_GetFile_From_Mac_ATS_Name */ - /* */ - /* <Description> */ - /* Return an FSSpec for the disk file containing the named font. */ - /* */ - /* <Input> */ - /* fontName :: Mac OS name of the font in ATS framework. */ - /* */ - /* <Output> */ - /* pathSpec :: FSSpec to the file. For passing to */ - /* @FT_New_Face_From_FSSpec. */ - /* */ - /* face_index :: Index of the face. For passing to */ - /* @FT_New_Face_From_FSSpec. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - FT_EXPORT( FT_Error ) - FT_GetFile_From_Mac_ATS_Name( const char* fontName, - FSSpec* pathSpec, - FT_Long* face_index ) - FT_DEPRECATED_ATTRIBUTE; - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_GetFilePath_From_Mac_ATS_Name */ - /* */ - /* <Description> */ - /* Return a pathname of the disk file and face index for given font */ - /* name which is handled by ATS framework. */ - /* */ - /* <Input> */ - /* fontName :: Mac OS name of the font in ATS framework. */ - /* */ - /* <Output> */ - /* path :: Buffer to store pathname of the file. For passing */ - /* to @FT_New_Face. The client must allocate this */ - /* buffer before calling this function. */ - /* */ - /* maxPathSize :: Lengths of the buffer `path' that client allocated. */ - /* */ - /* face_index :: Index of the face. For passing to @FT_New_Face. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - FT_EXPORT( FT_Error ) - FT_GetFilePath_From_Mac_ATS_Name( const char* fontName, - UInt8* path, - UInt32 maxPathSize, - FT_Long* face_index ) - FT_DEPRECATED_ATTRIBUTE; - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_New_Face_From_FSSpec */ - /* */ - /* <Description> */ - /* Create a new face object from a given resource and typeface index */ - /* using an FSSpec to the font file. */ - /* */ - /* <InOut> */ - /* library :: A handle to the library resource. */ - /* */ - /* <Input> */ - /* spec :: FSSpec to the font file. */ - /* */ - /* face_index :: The index of the face within the resource. The */ - /* first face has index~0. */ - /* <Output> */ - /* aface :: A handle to a new face object. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - /* <Note> */ - /* @FT_New_Face_From_FSSpec is identical to @FT_New_Face except */ - /* it accepts an FSSpec instead of a path. */ - /* */ - FT_EXPORT( FT_Error ) - FT_New_Face_From_FSSpec( FT_Library library, - const FSSpec *spec, - FT_Long face_index, - FT_Face *aface ) - FT_DEPRECATED_ATTRIBUTE; - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_New_Face_From_FSRef */ - /* */ - /* <Description> */ - /* Create a new face object from a given resource and typeface index */ - /* using an FSRef to the font file. */ - /* */ - /* <InOut> */ - /* library :: A handle to the library resource. */ - /* */ - /* <Input> */ - /* spec :: FSRef to the font file. */ - /* */ - /* face_index :: The index of the face within the resource. The */ - /* first face has index~0. */ - /* <Output> */ - /* aface :: A handle to a new face object. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - /* <Note> */ - /* @FT_New_Face_From_FSRef is identical to @FT_New_Face except */ - /* it accepts an FSRef instead of a path. */ - /* */ - FT_EXPORT( FT_Error ) - FT_New_Face_From_FSRef( FT_Library library, - const FSRef *ref, - FT_Long face_index, - FT_Face *aface ) - FT_DEPRECATED_ATTRIBUTE; - - /* */ - - -FT_END_HEADER - - -#endif /* __FTMAC_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftmm.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftmm.h deleted file mode 100644 index 3aefb9e4f2..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftmm.h +++ /dev/null @@ -1,378 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftmm.h */ -/* */ -/* FreeType Multiple Master font interface (specification). */ -/* */ -/* Copyright 1996-2001, 2003, 2004, 2006, 2009 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __FTMM_H__ -#define __FTMM_H__ - - -#include <ft2build.h> -#include FT_TYPE1_TABLES_H - - -FT_BEGIN_HEADER - - - /*************************************************************************/ - /* */ - /* <Section> */ - /* multiple_masters */ - /* */ - /* <Title> */ - /* Multiple Masters */ - /* */ - /* <Abstract> */ - /* How to manage Multiple Masters fonts. */ - /* */ - /* <Description> */ - /* The following types and functions are used to manage Multiple */ - /* Master fonts, i.e., the selection of specific design instances by */ - /* setting design axis coordinates. */ - /* */ - /* George Williams has extended this interface to make it work with */ - /* both Type~1 Multiple Masters fonts and GX distortable (var) */ - /* fonts. Some of these routines only work with MM fonts, others */ - /* will work with both types. They are similar enough that a */ - /* consistent interface makes sense. */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FT_MM_Axis */ - /* */ - /* <Description> */ - /* A simple structure used to model a given axis in design space for */ - /* Multiple Masters fonts. */ - /* */ - /* This structure can't be used for GX var fonts. */ - /* */ - /* <Fields> */ - /* name :: The axis's name. */ - /* */ - /* minimum :: The axis's minimum design coordinate. */ - /* */ - /* maximum :: The axis's maximum design coordinate. */ - /* */ - typedef struct FT_MM_Axis_ - { - FT_String* name; - FT_Long minimum; - FT_Long maximum; - - } FT_MM_Axis; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FT_Multi_Master */ - /* */ - /* <Description> */ - /* A structure used to model the axes and space of a Multiple Masters */ - /* font. */ - /* */ - /* This structure can't be used for GX var fonts. */ - /* */ - /* <Fields> */ - /* num_axis :: Number of axes. Cannot exceed~4. */ - /* */ - /* num_designs :: Number of designs; should be normally 2^num_axis */ - /* even though the Type~1 specification strangely */ - /* allows for intermediate designs to be present. This */ - /* number cannot exceed~16. */ - /* */ - /* axis :: A table of axis descriptors. */ - /* */ - typedef struct FT_Multi_Master_ - { - FT_UInt num_axis; - FT_UInt num_designs; - FT_MM_Axis axis[T1_MAX_MM_AXIS]; - - } FT_Multi_Master; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FT_Var_Axis */ - /* */ - /* <Description> */ - /* A simple structure used to model a given axis in design space for */ - /* Multiple Masters and GX var fonts. */ - /* */ - /* <Fields> */ - /* name :: The axis's name. */ - /* Not always meaningful for GX. */ - /* */ - /* minimum :: The axis's minimum design coordinate. */ - /* */ - /* def :: The axis's default design coordinate. */ - /* FreeType computes meaningful default values for MM; it */ - /* is then an integer value, not in 16.16 format. */ - /* */ - /* maximum :: The axis's maximum design coordinate. */ - /* */ - /* tag :: The axis's tag (the GX equivalent to `name'). */ - /* FreeType provides default values for MM if possible. */ - /* */ - /* strid :: The entry in `name' table (another GX version of */ - /* `name'). */ - /* Not meaningful for MM. */ - /* */ - typedef struct FT_Var_Axis_ - { - FT_String* name; - - FT_Fixed minimum; - FT_Fixed def; - FT_Fixed maximum; - - FT_ULong tag; - FT_UInt strid; - - } FT_Var_Axis; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FT_Var_Named_Style */ - /* */ - /* <Description> */ - /* A simple structure used to model a named style in a GX var font. */ - /* */ - /* This structure can't be used for MM fonts. */ - /* */ - /* <Fields> */ - /* coords :: The design coordinates for this style. */ - /* This is an array with one entry for each axis. */ - /* */ - /* strid :: The entry in `name' table identifying this style. */ - /* */ - typedef struct FT_Var_Named_Style_ - { - FT_Fixed* coords; - FT_UInt strid; - - } FT_Var_Named_Style; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FT_MM_Var */ - /* */ - /* <Description> */ - /* A structure used to model the axes and space of a Multiple Masters */ - /* or GX var distortable font. */ - /* */ - /* Some fields are specific to one format and not to the other. */ - /* */ - /* <Fields> */ - /* num_axis :: The number of axes. The maximum value is~4 for */ - /* MM; no limit in GX. */ - /* */ - /* num_designs :: The number of designs; should be normally */ - /* 2^num_axis for MM fonts. Not meaningful for GX */ - /* (where every glyph could have a different */ - /* number of designs). */ - /* */ - /* num_namedstyles :: The number of named styles; only meaningful for */ - /* GX which allows certain design coordinates to */ - /* have a string ID (in the `name' table) */ - /* associated with them. The font can tell the */ - /* user that, for example, Weight=1.5 is `Bold'. */ - /* */ - /* axis :: A table of axis descriptors. */ - /* GX fonts contain slightly more data than MM. */ - /* */ - /* namedstyles :: A table of named styles. */ - /* Only meaningful with GX. */ - /* */ - typedef struct FT_MM_Var_ - { - FT_UInt num_axis; - FT_UInt num_designs; - FT_UInt num_namedstyles; - FT_Var_Axis* axis; - FT_Var_Named_Style* namedstyle; - - } FT_MM_Var; - - - /* */ - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Get_Multi_Master */ - /* */ - /* <Description> */ - /* Retrieve the Multiple Master descriptor of a given font. */ - /* */ - /* This function can't be used with GX fonts. */ - /* */ - /* <Input> */ - /* face :: A handle to the source face. */ - /* */ - /* <Output> */ - /* amaster :: The Multiple Masters descriptor. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Get_Multi_Master( FT_Face face, - FT_Multi_Master *amaster ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Get_MM_Var */ - /* */ - /* <Description> */ - /* Retrieve the Multiple Master/GX var descriptor of a given font. */ - /* */ - /* <Input> */ - /* face :: A handle to the source face. */ - /* */ - /* <Output> */ - /* amaster :: The Multiple Masters/GX var descriptor. */ - /* Allocates a data structure, which the user must free */ - /* (a single call to FT_FREE will do it). */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Get_MM_Var( FT_Face face, - FT_MM_Var* *amaster ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Set_MM_Design_Coordinates */ - /* */ - /* <Description> */ - /* For Multiple Masters fonts, choose an interpolated font design */ - /* through design coordinates. */ - /* */ - /* This function can't be used with GX fonts. */ - /* */ - /* <InOut> */ - /* face :: A handle to the source face. */ - /* */ - /* <Input> */ - /* num_coords :: The number of design coordinates (must be equal to */ - /* the number of axes in the font). */ - /* */ - /* coords :: An array of design coordinates. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Set_MM_Design_Coordinates( FT_Face face, - FT_UInt num_coords, - FT_Long* coords ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Set_Var_Design_Coordinates */ - /* */ - /* <Description> */ - /* For Multiple Master or GX Var fonts, choose an interpolated font */ - /* design through design coordinates. */ - /* */ - /* <InOut> */ - /* face :: A handle to the source face. */ - /* */ - /* <Input> */ - /* num_coords :: The number of design coordinates (must be equal to */ - /* the number of axes in the font). */ - /* */ - /* coords :: An array of design coordinates. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Set_Var_Design_Coordinates( FT_Face face, - FT_UInt num_coords, - FT_Fixed* coords ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Set_MM_Blend_Coordinates */ - /* */ - /* <Description> */ - /* For Multiple Masters and GX var fonts, choose an interpolated font */ - /* design through normalized blend coordinates. */ - /* */ - /* <InOut> */ - /* face :: A handle to the source face. */ - /* */ - /* <Input> */ - /* num_coords :: The number of design coordinates (must be equal to */ - /* the number of axes in the font). */ - /* */ - /* coords :: The design coordinates array (each element must be */ - /* between 0 and 1.0). */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Set_MM_Blend_Coordinates( FT_Face face, - FT_UInt num_coords, - FT_Fixed* coords ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Set_Var_Blend_Coordinates */ - /* */ - /* <Description> */ - /* This is another name of @FT_Set_MM_Blend_Coordinates. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Set_Var_Blend_Coordinates( FT_Face face, - FT_UInt num_coords, - FT_Fixed* coords ); - - - /* */ - - -FT_END_HEADER - -#endif /* __FTMM_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftmodapi.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftmodapi.h deleted file mode 100644 index 8f2e017947..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftmodapi.h +++ /dev/null @@ -1,483 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftmodapi.h */ -/* */ -/* FreeType modules public interface (specification). */ -/* */ -/* Copyright 1996-2001, 2002, 2003, 2006, 2008, 2009, 2010 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __FTMODAPI_H__ -#define __FTMODAPI_H__ - - -#include <ft2build.h> -#include FT_FREETYPE_H - -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - - -FT_BEGIN_HEADER - - - /*************************************************************************/ - /* */ - /* <Section> */ - /* module_management */ - /* */ - /* <Title> */ - /* Module Management */ - /* */ - /* <Abstract> */ - /* How to add, upgrade, and remove modules from FreeType. */ - /* */ - /* <Description> */ - /* The definitions below are used to manage modules within FreeType. */ - /* Modules can be added, upgraded, and removed at runtime. */ - /* */ - /*************************************************************************/ - - - /* module bit flags */ -#define FT_MODULE_FONT_DRIVER 1 /* this module is a font driver */ -#define FT_MODULE_RENDERER 2 /* this module is a renderer */ -#define FT_MODULE_HINTER 4 /* this module is a glyph hinter */ -#define FT_MODULE_STYLER 8 /* this module is a styler */ - -#define FT_MODULE_DRIVER_SCALABLE 0x100 /* the driver supports */ - /* scalable fonts */ -#define FT_MODULE_DRIVER_NO_OUTLINES 0x200 /* the driver does not */ - /* support vector outlines */ -#define FT_MODULE_DRIVER_HAS_HINTER 0x400 /* the driver provides its */ - /* own hinter */ - - - /* deprecated values */ -#define ft_module_font_driver FT_MODULE_FONT_DRIVER -#define ft_module_renderer FT_MODULE_RENDERER -#define ft_module_hinter FT_MODULE_HINTER -#define ft_module_styler FT_MODULE_STYLER - -#define ft_module_driver_scalable FT_MODULE_DRIVER_SCALABLE -#define ft_module_driver_no_outlines FT_MODULE_DRIVER_NO_OUTLINES -#define ft_module_driver_has_hinter FT_MODULE_DRIVER_HAS_HINTER - - - typedef FT_Pointer FT_Module_Interface; - - - /*************************************************************************/ - /* */ - /* <FuncType> */ - /* FT_Module_Constructor */ - /* */ - /* <Description> */ - /* A function used to initialize (not create) a new module object. */ - /* */ - /* <Input> */ - /* module :: The module to initialize. */ - /* */ - typedef FT_Error - (*FT_Module_Constructor)( FT_Module module ); - - - /*************************************************************************/ - /* */ - /* <FuncType> */ - /* FT_Module_Destructor */ - /* */ - /* <Description> */ - /* A function used to finalize (not destroy) a given module object. */ - /* */ - /* <Input> */ - /* module :: The module to finalize. */ - /* */ - typedef void - (*FT_Module_Destructor)( FT_Module module ); - - - /*************************************************************************/ - /* */ - /* <FuncType> */ - /* FT_Module_Requester */ - /* */ - /* <Description> */ - /* A function used to query a given module for a specific interface. */ - /* */ - /* <Input> */ - /* module :: The module to finalize. */ - /* */ - /* name :: The name of the interface in the module. */ - /* */ - typedef FT_Module_Interface - (*FT_Module_Requester)( FT_Module module, - const char* name ); - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FT_Module_Class */ - /* */ - /* <Description> */ - /* The module class descriptor. */ - /* */ - /* <Fields> */ - /* module_flags :: Bit flags describing the module. */ - /* */ - /* module_size :: The size of one module object/instance in */ - /* bytes. */ - /* */ - /* module_name :: The name of the module. */ - /* */ - /* module_version :: The version, as a 16.16 fixed number */ - /* (major.minor). */ - /* */ - /* module_requires :: The version of FreeType this module requires, */ - /* as a 16.16 fixed number (major.minor). Starts */ - /* at version 2.0, i.e., 0x20000. */ - /* */ - /* module_init :: The initializing function. */ - /* */ - /* module_done :: The finalizing function. */ - /* */ - /* get_interface :: The interface requesting function. */ - /* */ - typedef struct FT_Module_Class_ - { - FT_ULong module_flags; - FT_Long module_size; - const FT_String* module_name; - FT_Fixed module_version; - FT_Fixed module_requires; - - const void* module_interface; - - FT_Module_Constructor module_init; - FT_Module_Destructor module_done; - FT_Module_Requester get_interface; - - } FT_Module_Class; - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Add_Module */ - /* */ - /* <Description> */ - /* Add a new module to a given library instance. */ - /* */ - /* <InOut> */ - /* library :: A handle to the library object. */ - /* */ - /* <Input> */ - /* clazz :: A pointer to class descriptor for the module. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - /* <Note> */ - /* An error will be returned if a module already exists by that name, */ - /* or if the module requires a version of FreeType that is too great. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Add_Module( FT_Library library, - const FT_Module_Class* clazz ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Get_Module */ - /* */ - /* <Description> */ - /* Find a module by its name. */ - /* */ - /* <Input> */ - /* library :: A handle to the library object. */ - /* */ - /* module_name :: The module's name (as an ASCII string). */ - /* */ - /* <Return> */ - /* A module handle. 0~if none was found. */ - /* */ - /* <Note> */ - /* FreeType's internal modules aren't documented very well, and you */ - /* should look up the source code for details. */ - /* */ - FT_EXPORT( FT_Module ) - FT_Get_Module( FT_Library library, - const char* module_name ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Remove_Module */ - /* */ - /* <Description> */ - /* Remove a given module from a library instance. */ - /* */ - /* <InOut> */ - /* library :: A handle to a library object. */ - /* */ - /* <Input> */ - /* module :: A handle to a module object. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - /* <Note> */ - /* The module object is destroyed by the function in case of success. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Remove_Module( FT_Library library, - FT_Module module ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Reference_Library */ - /* */ - /* <Description> */ - /* A counter gets initialized to~1 at the time an @FT_Library */ - /* structure is created. This function increments the counter. */ - /* @FT_Done_Library then only destroys a library if the counter is~1, */ - /* otherwise it simply decrements the counter. */ - /* */ - /* This function helps in managing life-cycles of structures which */ - /* reference @FT_Library objects. */ - /* */ - /* <Input> */ - /* library :: A handle to a target library object. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - /* <Since> */ - /* 2.4.2 */ - /* */ - FT_EXPORT( FT_Error ) - FT_Reference_Library( FT_Library library ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_New_Library */ - /* */ - /* <Description> */ - /* This function is used to create a new FreeType library instance */ - /* from a given memory object. It is thus possible to use libraries */ - /* with distinct memory allocators within the same program. */ - /* */ - /* Normally, you would call this function (followed by a call to */ - /* @FT_Add_Default_Modules or a series of calls to @FT_Add_Module) */ - /* instead of @FT_Init_FreeType to initialize the FreeType library. */ - /* */ - /* Don't use @FT_Done_FreeType but @FT_Done_Library to destroy a */ - /* library instance. */ - /* */ - /* <Input> */ - /* memory :: A handle to the original memory object. */ - /* */ - /* <Output> */ - /* alibrary :: A pointer to handle of a new library object. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - /* <Note> */ - /* See the discussion of reference counters in the description of */ - /* @FT_Reference_Library. */ - /* */ - FT_EXPORT( FT_Error ) - FT_New_Library( FT_Memory memory, - FT_Library *alibrary ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Done_Library */ - /* */ - /* <Description> */ - /* Discard a given library object. This closes all drivers and */ - /* discards all resource objects. */ - /* */ - /* <Input> */ - /* library :: A handle to the target library. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - /* <Note> */ - /* See the discussion of reference counters in the description of */ - /* @FT_Reference_Library. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Done_Library( FT_Library library ); - -/* */ - - typedef void - (*FT_DebugHook_Func)( void* arg ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Set_Debug_Hook */ - /* */ - /* <Description> */ - /* Set a debug hook function for debugging the interpreter of a font */ - /* format. */ - /* */ - /* <InOut> */ - /* library :: A handle to the library object. */ - /* */ - /* <Input> */ - /* hook_index :: The index of the debug hook. You should use the */ - /* values defined in `ftobjs.h', e.g., */ - /* `FT_DEBUG_HOOK_TRUETYPE'. */ - /* */ - /* debug_hook :: The function used to debug the interpreter. */ - /* */ - /* <Note> */ - /* Currently, four debug hook slots are available, but only two (for */ - /* the TrueType and the Type~1 interpreter) are defined. */ - /* */ - /* Since the internal headers of FreeType are no longer installed, */ - /* the symbol `FT_DEBUG_HOOK_TRUETYPE' isn't available publicly. */ - /* This is a bug and will be fixed in a forthcoming release. */ - /* */ - FT_EXPORT( void ) - FT_Set_Debug_Hook( FT_Library library, - FT_UInt hook_index, - FT_DebugHook_Func debug_hook ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Add_Default_Modules */ - /* */ - /* <Description> */ - /* Add the set of default drivers to a given library object. */ - /* This is only useful when you create a library object with */ - /* @FT_New_Library (usually to plug a custom memory manager). */ - /* */ - /* <InOut> */ - /* library :: A handle to a new library object. */ - /* */ - FT_EXPORT( void ) - FT_Add_Default_Modules( FT_Library library ); - - - - /************************************************************************** - * - * @section: - * truetype_engine - * - * @title: - * The TrueType Engine - * - * @abstract: - * TrueType bytecode support. - * - * @description: - * This section contains a function used to query the level of TrueType - * bytecode support compiled in this version of the library. - * - */ - - - /************************************************************************** - * - * @enum: - * FT_TrueTypeEngineType - * - * @description: - * A list of values describing which kind of TrueType bytecode - * engine is implemented in a given FT_Library instance. It is used - * by the @FT_Get_TrueType_Engine_Type function. - * - * @values: - * FT_TRUETYPE_ENGINE_TYPE_NONE :: - * The library doesn't implement any kind of bytecode interpreter. - * - * FT_TRUETYPE_ENGINE_TYPE_UNPATENTED :: - * The library implements a bytecode interpreter that doesn't - * support the patented operations of the TrueType virtual machine. - * - * Its main use is to load certain Asian fonts which position and - * scale glyph components with bytecode instructions. It produces - * bad output for most other fonts. - * - * FT_TRUETYPE_ENGINE_TYPE_PATENTED :: - * The library implements a bytecode interpreter that covers - * the full instruction set of the TrueType virtual machine (this - * was governed by patents until May 2010, hence the name). - * - * @since: - * 2.2 - * - */ - typedef enum FT_TrueTypeEngineType_ - { - FT_TRUETYPE_ENGINE_TYPE_NONE = 0, - FT_TRUETYPE_ENGINE_TYPE_UNPATENTED, - FT_TRUETYPE_ENGINE_TYPE_PATENTED - - } FT_TrueTypeEngineType; - - - /************************************************************************** - * - * @func: - * FT_Get_TrueType_Engine_Type - * - * @description: - * Return an @FT_TrueTypeEngineType value to indicate which level of - * the TrueType virtual machine a given library instance supports. - * - * @input: - * library :: - * A library instance. - * - * @return: - * A value indicating which level is supported. - * - * @since: - * 2.2 - * - */ - FT_EXPORT( FT_TrueTypeEngineType ) - FT_Get_TrueType_Engine_Type( FT_Library library ); - - - /* */ - - -FT_END_HEADER - -#endif /* __FTMODAPI_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftmoderr.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftmoderr.h deleted file mode 100644 index 1bf3b384ab..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftmoderr.h +++ /dev/null @@ -1,156 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftmoderr.h */ -/* */ -/* FreeType module error offsets (specification). */ -/* */ -/* Copyright 2001, 2002, 2003, 2004, 2005, 2010 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - - /*************************************************************************/ - /* */ - /* This file is used to define the FreeType module error offsets. */ - /* */ - /* The lower byte gives the error code, the higher byte gives the */ - /* module. The base module has error offset 0. For example, the error */ - /* `FT_Err_Invalid_File_Format' has value 0x003, the error */ - /* `TT_Err_Invalid_File_Format' has value 0x1103, the error */ - /* `T1_Err_Invalid_File_Format' has value 0x1203, etc. */ - /* */ - /* Undefine the macro FT_CONFIG_OPTION_USE_MODULE_ERRORS in ftoption.h */ - /* to make the higher byte always zero (disabling the module error */ - /* mechanism). */ - /* */ - /* It can also be used to create a module error message table easily */ - /* with something like */ - /* */ - /* { */ - /* #undef __FTMODERR_H__ */ - /* #define FT_MODERRDEF( e, v, s ) { FT_Mod_Err_ ## e, s }, */ - /* #define FT_MODERR_START_LIST { */ - /* #define FT_MODERR_END_LIST { 0, 0 } }; */ - /* */ - /* const struct */ - /* { */ - /* int mod_err_offset; */ - /* const char* mod_err_msg */ - /* } ft_mod_errors[] = */ - /* */ - /* #include FT_MODULE_ERRORS_H */ - /* } */ - /* */ - /* To use such a table, all errors must be ANDed with 0xFF00 to remove */ - /* the error code. */ - /* */ - /*************************************************************************/ - - -#ifndef __FTMODERR_H__ -#define __FTMODERR_H__ - - - /*******************************************************************/ - /*******************************************************************/ - /***** *****/ - /***** SETUP MACROS *****/ - /***** *****/ - /*******************************************************************/ - /*******************************************************************/ - - -#undef FT_NEED_EXTERN_C - -#ifndef FT_MODERRDEF - -#ifdef FT_CONFIG_OPTION_USE_MODULE_ERRORS -#define FT_MODERRDEF( e, v, s ) FT_Mod_Err_ ## e = v, -#else -#define FT_MODERRDEF( e, v, s ) FT_Mod_Err_ ## e = 0, -#endif - -#define FT_MODERR_START_LIST enum { -#define FT_MODERR_END_LIST FT_Mod_Err_Max }; - -#ifdef __cplusplus -#define FT_NEED_EXTERN_C - extern "C" { -#endif - -#endif /* !FT_MODERRDEF */ - - - /*******************************************************************/ - /*******************************************************************/ - /***** *****/ - /***** LIST MODULE ERROR BASES *****/ - /***** *****/ - /*******************************************************************/ - /*******************************************************************/ - - -#ifdef FT_MODERR_START_LIST - FT_MODERR_START_LIST -#endif - - - FT_MODERRDEF( Base, 0x000, "base module" ) - FT_MODERRDEF( Autofit, 0x100, "autofitter module" ) - FT_MODERRDEF( BDF, 0x200, "BDF module" ) - FT_MODERRDEF( Bzip2, 0x300, "Bzip2 module" ) - FT_MODERRDEF( Cache, 0x400, "cache module" ) - FT_MODERRDEF( CFF, 0x500, "CFF module" ) - FT_MODERRDEF( CID, 0x600, "CID module" ) - FT_MODERRDEF( Gzip, 0x700, "Gzip module" ) - FT_MODERRDEF( LZW, 0x800, "LZW module" ) - FT_MODERRDEF( OTvalid, 0x900, "OpenType validation module" ) - FT_MODERRDEF( PCF, 0xA00, "PCF module" ) - FT_MODERRDEF( PFR, 0xB00, "PFR module" ) - FT_MODERRDEF( PSaux, 0xC00, "PS auxiliary module" ) - FT_MODERRDEF( PShinter, 0xD00, "PS hinter module" ) - FT_MODERRDEF( PSnames, 0xE00, "PS names module" ) - FT_MODERRDEF( Raster, 0xF00, "raster module" ) - FT_MODERRDEF( SFNT, 0x1000, "SFNT module" ) - FT_MODERRDEF( Smooth, 0x1100, "smooth raster module" ) - FT_MODERRDEF( TrueType, 0x1200, "TrueType module" ) - FT_MODERRDEF( Type1, 0x1300, "Type 1 module" ) - FT_MODERRDEF( Type42, 0x1400, "Type 42 module" ) - FT_MODERRDEF( Winfonts, 0x1500, "Windows FON/FNT module" ) - - -#ifdef FT_MODERR_END_LIST - FT_MODERR_END_LIST -#endif - - - /*******************************************************************/ - /*******************************************************************/ - /***** *****/ - /***** CLEANUP *****/ - /***** *****/ - /*******************************************************************/ - /*******************************************************************/ - - -#ifdef FT_NEED_EXTERN_C - } -#endif - -#undef FT_MODERR_START_LIST -#undef FT_MODERR_END_LIST -#undef FT_MODERRDEF -#undef FT_NEED_EXTERN_C - - -#endif /* __FTMODERR_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftotval.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftotval.h deleted file mode 100644 index 027f2e8865..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftotval.h +++ /dev/null @@ -1,203 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftotval.h */ -/* */ -/* FreeType API for validating OpenType tables (specification). */ -/* */ -/* Copyright 2004, 2005, 2006, 2007 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -/***************************************************************************/ -/* */ -/* */ -/* Warning: This module might be moved to a different library in the */ -/* future to avoid a tight dependency between FreeType and the */ -/* OpenType specification. */ -/* */ -/* */ -/***************************************************************************/ - - -#ifndef __FTOTVAL_H__ -#define __FTOTVAL_H__ - -#include <ft2build.h> -#include FT_FREETYPE_H - -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - - -FT_BEGIN_HEADER - - - /*************************************************************************/ - /* */ - /* <Section> */ - /* ot_validation */ - /* */ - /* <Title> */ - /* OpenType Validation */ - /* */ - /* <Abstract> */ - /* An API to validate OpenType tables. */ - /* */ - /* <Description> */ - /* This section contains the declaration of functions to validate */ - /* some OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH). */ - /* */ - /*************************************************************************/ - - - /********************************************************************** - * - * @enum: - * FT_VALIDATE_OTXXX - * - * @description: - * A list of bit-field constants used with @FT_OpenType_Validate to - * indicate which OpenType tables should be validated. - * - * @values: - * FT_VALIDATE_BASE :: - * Validate BASE table. - * - * FT_VALIDATE_GDEF :: - * Validate GDEF table. - * - * FT_VALIDATE_GPOS :: - * Validate GPOS table. - * - * FT_VALIDATE_GSUB :: - * Validate GSUB table. - * - * FT_VALIDATE_JSTF :: - * Validate JSTF table. - * - * FT_VALIDATE_MATH :: - * Validate MATH table. - * - * FT_VALIDATE_OT :: - * Validate all OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH). - * - */ -#define FT_VALIDATE_BASE 0x0100 -#define FT_VALIDATE_GDEF 0x0200 -#define FT_VALIDATE_GPOS 0x0400 -#define FT_VALIDATE_GSUB 0x0800 -#define FT_VALIDATE_JSTF 0x1000 -#define FT_VALIDATE_MATH 0x2000 - -#define FT_VALIDATE_OT FT_VALIDATE_BASE | \ - FT_VALIDATE_GDEF | \ - FT_VALIDATE_GPOS | \ - FT_VALIDATE_GSUB | \ - FT_VALIDATE_JSTF | \ - FT_VALIDATE_MATH - - /* */ - - /********************************************************************** - * - * @function: - * FT_OpenType_Validate - * - * @description: - * Validate various OpenType tables to assure that all offsets and - * indices are valid. The idea is that a higher-level library which - * actually does the text layout can access those tables without - * error checking (which can be quite time consuming). - * - * @input: - * face :: - * A handle to the input face. - * - * validation_flags :: - * A bit field which specifies the tables to be validated. See - * @FT_VALIDATE_OTXXX for possible values. - * - * @output: - * BASE_table :: - * A pointer to the BASE table. - * - * GDEF_table :: - * A pointer to the GDEF table. - * - * GPOS_table :: - * A pointer to the GPOS table. - * - * GSUB_table :: - * A pointer to the GSUB table. - * - * JSTF_table :: - * A pointer to the JSTF table. - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * This function only works with OpenType fonts, returning an error - * otherwise. - * - * After use, the application should deallocate the five tables with - * @FT_OpenType_Free. A NULL value indicates that the table either - * doesn't exist in the font, or the application hasn't asked for - * validation. - */ - FT_EXPORT( FT_Error ) - FT_OpenType_Validate( FT_Face face, - FT_UInt validation_flags, - FT_Bytes *BASE_table, - FT_Bytes *GDEF_table, - FT_Bytes *GPOS_table, - FT_Bytes *GSUB_table, - FT_Bytes *JSTF_table ); - - /* */ - - /********************************************************************** - * - * @function: - * FT_OpenType_Free - * - * @description: - * Free the buffer allocated by OpenType validator. - * - * @input: - * face :: - * A handle to the input face. - * - * table :: - * The pointer to the buffer that is allocated by - * @FT_OpenType_Validate. - * - * @note: - * This function must be used to free the buffer allocated by - * @FT_OpenType_Validate only. - */ - FT_EXPORT( void ) - FT_OpenType_Free( FT_Face face, - FT_Bytes table ); - - - /* */ - - -FT_END_HEADER - -#endif /* __FTOTVAL_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftoutln.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftoutln.h deleted file mode 100644 index 1cf3c3f800..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftoutln.h +++ /dev/null @@ -1,540 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftoutln.h */ -/* */ -/* Support for the FT_Outline type used to store glyph shapes of */ -/* most scalable font formats (specification). */ -/* */ -/* Copyright 1996-2003, 2005-2011 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __FTOUTLN_H__ -#define __FTOUTLN_H__ - - -#include <ft2build.h> -#include FT_FREETYPE_H - -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - - -FT_BEGIN_HEADER - - - /*************************************************************************/ - /* */ - /* <Section> */ - /* outline_processing */ - /* */ - /* <Title> */ - /* Outline Processing */ - /* */ - /* <Abstract> */ - /* Functions to create, transform, and render vectorial glyph images. */ - /* */ - /* <Description> */ - /* This section contains routines used to create and destroy scalable */ - /* glyph images known as `outlines'. These can also be measured, */ - /* transformed, and converted into bitmaps and pixmaps. */ - /* */ - /* <Order> */ - /* FT_Outline */ - /* FT_OUTLINE_FLAGS */ - /* FT_Outline_New */ - /* FT_Outline_Done */ - /* FT_Outline_Copy */ - /* FT_Outline_Translate */ - /* FT_Outline_Transform */ - /* FT_Outline_Embolden */ - /* FT_Outline_Reverse */ - /* FT_Outline_Check */ - /* */ - /* FT_Outline_Get_CBox */ - /* FT_Outline_Get_BBox */ - /* */ - /* FT_Outline_Get_Bitmap */ - /* FT_Outline_Render */ - /* */ - /* FT_Outline_Decompose */ - /* FT_Outline_Funcs */ - /* FT_Outline_MoveTo_Func */ - /* FT_Outline_LineTo_Func */ - /* FT_Outline_ConicTo_Func */ - /* FT_Outline_CubicTo_Func */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Outline_Decompose */ - /* */ - /* <Description> */ - /* Walk over an outline's structure to decompose it into individual */ - /* segments and Bézier arcs. This function also emits `move to' */ - /* operations to indicate the start of new contours in the outline. */ - /* */ - /* <Input> */ - /* outline :: A pointer to the source target. */ - /* */ - /* func_interface :: A table of `emitters', i.e., function pointers */ - /* called during decomposition to indicate path */ - /* operations. */ - /* */ - /* <InOut> */ - /* user :: A typeless pointer which is passed to each */ - /* emitter during the decomposition. It can be */ - /* used to store the state during the */ - /* decomposition. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Outline_Decompose( FT_Outline* outline, - const FT_Outline_Funcs* func_interface, - void* user ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Outline_New */ - /* */ - /* <Description> */ - /* Create a new outline of a given size. */ - /* */ - /* <Input> */ - /* library :: A handle to the library object from where the */ - /* outline is allocated. Note however that the new */ - /* outline will *not* necessarily be *freed*, when */ - /* destroying the library, by @FT_Done_FreeType. */ - /* */ - /* numPoints :: The maximal number of points within the outline. */ - /* */ - /* numContours :: The maximal number of contours within the outline. */ - /* */ - /* <Output> */ - /* anoutline :: A handle to the new outline. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - /* <Note> */ - /* The reason why this function takes a `library' parameter is simply */ - /* to use the library's memory allocator. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Outline_New( FT_Library library, - FT_UInt numPoints, - FT_Int numContours, - FT_Outline *anoutline ); - - - FT_EXPORT( FT_Error ) - FT_Outline_New_Internal( FT_Memory memory, - FT_UInt numPoints, - FT_Int numContours, - FT_Outline *anoutline ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Outline_Done */ - /* */ - /* <Description> */ - /* Destroy an outline created with @FT_Outline_New. */ - /* */ - /* <Input> */ - /* library :: A handle of the library object used to allocate the */ - /* outline. */ - /* */ - /* outline :: A pointer to the outline object to be discarded. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - /* <Note> */ - /* If the outline's `owner' field is not set, only the outline */ - /* descriptor will be released. */ - /* */ - /* The reason why this function takes an `library' parameter is */ - /* simply to use ft_mem_free(). */ - /* */ - FT_EXPORT( FT_Error ) - FT_Outline_Done( FT_Library library, - FT_Outline* outline ); - - - FT_EXPORT( FT_Error ) - FT_Outline_Done_Internal( FT_Memory memory, - FT_Outline* outline ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Outline_Check */ - /* */ - /* <Description> */ - /* Check the contents of an outline descriptor. */ - /* */ - /* <Input> */ - /* outline :: A handle to a source outline. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Outline_Check( FT_Outline* outline ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Outline_Get_CBox */ - /* */ - /* <Description> */ - /* Return an outline's `control box'. The control box encloses all */ - /* the outline's points, including Bézier control points. Though it */ - /* coincides with the exact bounding box for most glyphs, it can be */ - /* slightly larger in some situations (like when rotating an outline */ - /* which contains Bézier outside arcs). */ - /* */ - /* Computing the control box is very fast, while getting the bounding */ - /* box can take much more time as it needs to walk over all segments */ - /* and arcs in the outline. To get the latter, you can use the */ - /* `ftbbox' component which is dedicated to this single task. */ - /* */ - /* <Input> */ - /* outline :: A pointer to the source outline descriptor. */ - /* */ - /* <Output> */ - /* acbox :: The outline's control box. */ - /* */ - /* <Note> */ - /* See @FT_Glyph_Get_CBox for a discussion of tricky fonts. */ - /* */ - FT_EXPORT( void ) - FT_Outline_Get_CBox( const FT_Outline* outline, - FT_BBox *acbox ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Outline_Translate */ - /* */ - /* <Description> */ - /* Apply a simple translation to the points of an outline. */ - /* */ - /* <InOut> */ - /* outline :: A pointer to the target outline descriptor. */ - /* */ - /* <Input> */ - /* xOffset :: The horizontal offset. */ - /* */ - /* yOffset :: The vertical offset. */ - /* */ - FT_EXPORT( void ) - FT_Outline_Translate( const FT_Outline* outline, - FT_Pos xOffset, - FT_Pos yOffset ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Outline_Copy */ - /* */ - /* <Description> */ - /* Copy an outline into another one. Both objects must have the */ - /* same sizes (number of points & number of contours) when this */ - /* function is called. */ - /* */ - /* <Input> */ - /* source :: A handle to the source outline. */ - /* */ - /* <Output> */ - /* target :: A handle to the target outline. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Outline_Copy( const FT_Outline* source, - FT_Outline *target ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Outline_Transform */ - /* */ - /* <Description> */ - /* Apply a simple 2x2 matrix to all of an outline's points. Useful */ - /* for applying rotations, slanting, flipping, etc. */ - /* */ - /* <InOut> */ - /* outline :: A pointer to the target outline descriptor. */ - /* */ - /* <Input> */ - /* matrix :: A pointer to the transformation matrix. */ - /* */ - /* <Note> */ - /* You can use @FT_Outline_Translate if you need to translate the */ - /* outline's points. */ - /* */ - FT_EXPORT( void ) - FT_Outline_Transform( const FT_Outline* outline, - const FT_Matrix* matrix ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Outline_Embolden */ - /* */ - /* <Description> */ - /* Embolden an outline. The new outline will be at most 4~times */ - /* `strength' pixels wider and higher. You may think of the left and */ - /* bottom borders as unchanged. */ - /* */ - /* Negative `strength' values to reduce the outline thickness are */ - /* possible also. */ - /* */ - /* <InOut> */ - /* outline :: A handle to the target outline. */ - /* */ - /* <Input> */ - /* strength :: How strong the glyph is emboldened. Expressed in */ - /* 26.6 pixel format. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - /* <Note> */ - /* The used algorithm to increase or decrease the thickness of the */ - /* glyph doesn't change the number of points; this means that certain */ - /* situations like acute angles or intersections are sometimes */ - /* handled incorrectly. */ - /* */ - /* If you need `better' metrics values you should call */ - /* @FT_Outline_Get_CBox or @FT_Outline_Get_BBox. */ - /* */ - /* Example call: */ - /* */ - /* { */ - /* FT_Load_Glyph( face, index, FT_LOAD_DEFAULT ); */ - /* if ( face->slot->format == FT_GLYPH_FORMAT_OUTLINE ) */ - /* FT_Outline_Embolden( &face->slot->outline, strength ); */ - /* } */ - /* */ - FT_EXPORT( FT_Error ) - FT_Outline_Embolden( FT_Outline* outline, - FT_Pos strength ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Outline_Reverse */ - /* */ - /* <Description> */ - /* Reverse the drawing direction of an outline. This is used to */ - /* ensure consistent fill conventions for mirrored glyphs. */ - /* */ - /* <InOut> */ - /* outline :: A pointer to the target outline descriptor. */ - /* */ - /* <Note> */ - /* This function toggles the bit flag @FT_OUTLINE_REVERSE_FILL in */ - /* the outline's `flags' field. */ - /* */ - /* It shouldn't be used by a normal client application, unless it */ - /* knows what it is doing. */ - /* */ - FT_EXPORT( void ) - FT_Outline_Reverse( FT_Outline* outline ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Outline_Get_Bitmap */ - /* */ - /* <Description> */ - /* Render an outline within a bitmap. The outline's image is simply */ - /* OR-ed to the target bitmap. */ - /* */ - /* <Input> */ - /* library :: A handle to a FreeType library object. */ - /* */ - /* outline :: A pointer to the source outline descriptor. */ - /* */ - /* <InOut> */ - /* abitmap :: A pointer to the target bitmap descriptor. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - /* <Note> */ - /* This function does NOT CREATE the bitmap, it only renders an */ - /* outline image within the one you pass to it! Consequently, the */ - /* various fields in `abitmap' should be set accordingly. */ - /* */ - /* It will use the raster corresponding to the default glyph format. */ - /* */ - /* The value of the `num_grays' field in `abitmap' is ignored. If */ - /* you select the gray-level rasterizer, and you want less than 256 */ - /* gray levels, you have to use @FT_Outline_Render directly. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Outline_Get_Bitmap( FT_Library library, - FT_Outline* outline, - const FT_Bitmap *abitmap ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Outline_Render */ - /* */ - /* <Description> */ - /* Render an outline within a bitmap using the current scan-convert. */ - /* This function uses an @FT_Raster_Params structure as an argument, */ - /* allowing advanced features like direct composition, translucency, */ - /* etc. */ - /* */ - /* <Input> */ - /* library :: A handle to a FreeType library object. */ - /* */ - /* outline :: A pointer to the source outline descriptor. */ - /* */ - /* <InOut> */ - /* params :: A pointer to an @FT_Raster_Params structure used to */ - /* describe the rendering operation. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - /* <Note> */ - /* You should know what you are doing and how @FT_Raster_Params works */ - /* to use this function. */ - /* */ - /* The field `params.source' will be set to `outline' before the scan */ - /* converter is called, which means that the value you give to it is */ - /* actually ignored. */ - /* */ - /* The gray-level rasterizer always uses 256 gray levels. If you */ - /* want less gray levels, you have to provide your own span callback. */ - /* See the @FT_RASTER_FLAG_DIRECT value of the `flags' field in the */ - /* @FT_Raster_Params structure for more details. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Outline_Render( FT_Library library, - FT_Outline* outline, - FT_Raster_Params* params ); - - - /************************************************************************** - * - * @enum: - * FT_Orientation - * - * @description: - * A list of values used to describe an outline's contour orientation. - * - * The TrueType and PostScript specifications use different conventions - * to determine whether outline contours should be filled or unfilled. - * - * @values: - * FT_ORIENTATION_TRUETYPE :: - * According to the TrueType specification, clockwise contours must - * be filled, and counter-clockwise ones must be unfilled. - * - * FT_ORIENTATION_POSTSCRIPT :: - * According to the PostScript specification, counter-clockwise contours - * must be filled, and clockwise ones must be unfilled. - * - * FT_ORIENTATION_FILL_RIGHT :: - * This is identical to @FT_ORIENTATION_TRUETYPE, but is used to - * remember that in TrueType, everything that is to the right of - * the drawing direction of a contour must be filled. - * - * FT_ORIENTATION_FILL_LEFT :: - * This is identical to @FT_ORIENTATION_POSTSCRIPT, but is used to - * remember that in PostScript, everything that is to the left of - * the drawing direction of a contour must be filled. - * - * FT_ORIENTATION_NONE :: - * The orientation cannot be determined. That is, different parts of - * the glyph have different orientation. - * - */ - typedef enum FT_Orientation_ - { - FT_ORIENTATION_TRUETYPE = 0, - FT_ORIENTATION_POSTSCRIPT = 1, - FT_ORIENTATION_FILL_RIGHT = FT_ORIENTATION_TRUETYPE, - FT_ORIENTATION_FILL_LEFT = FT_ORIENTATION_POSTSCRIPT, - FT_ORIENTATION_NONE - - } FT_Orientation; - - - /************************************************************************** - * - * @function: - * FT_Outline_Get_Orientation - * - * @description: - * This function analyzes a glyph outline and tries to compute its - * fill orientation (see @FT_Orientation). This is done by computing - * the direction of each global horizontal and/or vertical extrema - * within the outline. - * - * Note that this will return @FT_ORIENTATION_TRUETYPE for empty - * outlines. - * - * @input: - * outline :: - * A handle to the source outline. - * - * @return: - * The orientation. - * - */ - FT_EXPORT( FT_Orientation ) - FT_Outline_Get_Orientation( FT_Outline* outline ); - - - /* */ - - -FT_END_HEADER - -#endif /* __FTOUTLN_H__ */ - - -/* END */ - - -/* Local Variables: */ -/* coding: utf-8 */ -/* End: */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftpfr.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftpfr.h deleted file mode 100644 index 0b7b7d427c..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftpfr.h +++ /dev/null @@ -1,172 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftpfr.h */ -/* */ -/* FreeType API for accessing PFR-specific data (specification only). */ -/* */ -/* Copyright 2002, 2003, 2004, 2006, 2008, 2009 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __FTPFR_H__ -#define __FTPFR_H__ - -#include <ft2build.h> -#include FT_FREETYPE_H - -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - - -FT_BEGIN_HEADER - - - /*************************************************************************/ - /* */ - /* <Section> */ - /* pfr_fonts */ - /* */ - /* <Title> */ - /* PFR Fonts */ - /* */ - /* <Abstract> */ - /* PFR/TrueDoc specific API. */ - /* */ - /* <Description> */ - /* This section contains the declaration of PFR-specific functions. */ - /* */ - /*************************************************************************/ - - - /********************************************************************** - * - * @function: - * FT_Get_PFR_Metrics - * - * @description: - * Return the outline and metrics resolutions of a given PFR face. - * - * @input: - * face :: Handle to the input face. It can be a non-PFR face. - * - * @output: - * aoutline_resolution :: - * Outline resolution. This is equivalent to `face->units_per_EM' - * for non-PFR fonts. Optional (parameter can be NULL). - * - * ametrics_resolution :: - * Metrics resolution. This is equivalent to `outline_resolution' - * for non-PFR fonts. Optional (parameter can be NULL). - * - * ametrics_x_scale :: - * A 16.16 fixed-point number used to scale distance expressed - * in metrics units to device sub-pixels. This is equivalent to - * `face->size->x_scale', but for metrics only. Optional (parameter - * can be NULL). - * - * ametrics_y_scale :: - * Same as `ametrics_x_scale' but for the vertical direction. - * optional (parameter can be NULL). - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * If the input face is not a PFR, this function will return an error. - * However, in all cases, it will return valid values. - */ - FT_EXPORT( FT_Error ) - FT_Get_PFR_Metrics( FT_Face face, - FT_UInt *aoutline_resolution, - FT_UInt *ametrics_resolution, - FT_Fixed *ametrics_x_scale, - FT_Fixed *ametrics_y_scale ); - - - /********************************************************************** - * - * @function: - * FT_Get_PFR_Kerning - * - * @description: - * Return the kerning pair corresponding to two glyphs in a PFR face. - * The distance is expressed in metrics units, unlike the result of - * @FT_Get_Kerning. - * - * @input: - * face :: A handle to the input face. - * - * left :: Index of the left glyph. - * - * right :: Index of the right glyph. - * - * @output: - * avector :: A kerning vector. - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * This function always return distances in original PFR metrics - * units. This is unlike @FT_Get_Kerning with the @FT_KERNING_UNSCALED - * mode, which always returns distances converted to outline units. - * - * You can use the value of the `x_scale' and `y_scale' parameters - * returned by @FT_Get_PFR_Metrics to scale these to device sub-pixels. - */ - FT_EXPORT( FT_Error ) - FT_Get_PFR_Kerning( FT_Face face, - FT_UInt left, - FT_UInt right, - FT_Vector *avector ); - - - /********************************************************************** - * - * @function: - * FT_Get_PFR_Advance - * - * @description: - * Return a given glyph advance, expressed in original metrics units, - * from a PFR font. - * - * @input: - * face :: A handle to the input face. - * - * gindex :: The glyph index. - * - * @output: - * aadvance :: The glyph advance in metrics units. - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * You can use the `x_scale' or `y_scale' results of @FT_Get_PFR_Metrics - * to convert the advance to device sub-pixels (i.e., 1/64th of pixels). - */ - FT_EXPORT( FT_Error ) - FT_Get_PFR_Advance( FT_Face face, - FT_UInt gindex, - FT_Pos *aadvance ); - - /* */ - - -FT_END_HEADER - -#endif /* __FTPFR_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftrender.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftrender.h deleted file mode 100644 index dd0229b815..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftrender.h +++ /dev/null @@ -1,238 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftrender.h */ -/* */ -/* FreeType renderer modules public interface (specification). */ -/* */ -/* Copyright 1996-2001, 2005, 2006, 2010 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __FTRENDER_H__ -#define __FTRENDER_H__ - - -#include <ft2build.h> -#include FT_MODULE_H -#include FT_GLYPH_H - - -FT_BEGIN_HEADER - - - /*************************************************************************/ - /* */ - /* <Section> */ - /* module_management */ - /* */ - /*************************************************************************/ - - - /* create a new glyph object */ - typedef FT_Error - (*FT_Glyph_InitFunc)( FT_Glyph glyph, - FT_GlyphSlot slot ); - - /* destroys a given glyph object */ - typedef void - (*FT_Glyph_DoneFunc)( FT_Glyph glyph ); - - typedef void - (*FT_Glyph_TransformFunc)( FT_Glyph glyph, - const FT_Matrix* matrix, - const FT_Vector* delta ); - - typedef void - (*FT_Glyph_GetBBoxFunc)( FT_Glyph glyph, - FT_BBox* abbox ); - - typedef FT_Error - (*FT_Glyph_CopyFunc)( FT_Glyph source, - FT_Glyph target ); - - typedef FT_Error - (*FT_Glyph_PrepareFunc)( FT_Glyph glyph, - FT_GlyphSlot slot ); - -/* deprecated */ -#define FT_Glyph_Init_Func FT_Glyph_InitFunc -#define FT_Glyph_Done_Func FT_Glyph_DoneFunc -#define FT_Glyph_Transform_Func FT_Glyph_TransformFunc -#define FT_Glyph_BBox_Func FT_Glyph_GetBBoxFunc -#define FT_Glyph_Copy_Func FT_Glyph_CopyFunc -#define FT_Glyph_Prepare_Func FT_Glyph_PrepareFunc - - - struct FT_Glyph_Class_ - { - FT_Long glyph_size; - FT_Glyph_Format glyph_format; - FT_Glyph_InitFunc glyph_init; - FT_Glyph_DoneFunc glyph_done; - FT_Glyph_CopyFunc glyph_copy; - FT_Glyph_TransformFunc glyph_transform; - FT_Glyph_GetBBoxFunc glyph_bbox; - FT_Glyph_PrepareFunc glyph_prepare; - }; - - - typedef FT_Error - (*FT_Renderer_RenderFunc)( FT_Renderer renderer, - FT_GlyphSlot slot, - FT_UInt mode, - const FT_Vector* origin ); - - typedef FT_Error - (*FT_Renderer_TransformFunc)( FT_Renderer renderer, - FT_GlyphSlot slot, - const FT_Matrix* matrix, - const FT_Vector* delta ); - - - typedef void - (*FT_Renderer_GetCBoxFunc)( FT_Renderer renderer, - FT_GlyphSlot slot, - FT_BBox* cbox ); - - - typedef FT_Error - (*FT_Renderer_SetModeFunc)( FT_Renderer renderer, - FT_ULong mode_tag, - FT_Pointer mode_ptr ); - -/* deprecated identifiers */ -#define FTRenderer_render FT_Renderer_RenderFunc -#define FTRenderer_transform FT_Renderer_TransformFunc -#define FTRenderer_getCBox FT_Renderer_GetCBoxFunc -#define FTRenderer_setMode FT_Renderer_SetModeFunc - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FT_Renderer_Class */ - /* */ - /* <Description> */ - /* The renderer module class descriptor. */ - /* */ - /* <Fields> */ - /* root :: The root @FT_Module_Class fields. */ - /* */ - /* glyph_format :: The glyph image format this renderer handles. */ - /* */ - /* render_glyph :: A method used to render the image that is in a */ - /* given glyph slot into a bitmap. */ - /* */ - /* transform_glyph :: A method used to transform the image that is in */ - /* a given glyph slot. */ - /* */ - /* get_glyph_cbox :: A method used to access the glyph's cbox. */ - /* */ - /* set_mode :: A method used to pass additional parameters. */ - /* */ - /* raster_class :: For @FT_GLYPH_FORMAT_OUTLINE renderers only. */ - /* This is a pointer to its raster's class. */ - /* */ - typedef struct FT_Renderer_Class_ - { - FT_Module_Class root; - - FT_Glyph_Format glyph_format; - - FT_Renderer_RenderFunc render_glyph; - FT_Renderer_TransformFunc transform_glyph; - FT_Renderer_GetCBoxFunc get_glyph_cbox; - FT_Renderer_SetModeFunc set_mode; - - FT_Raster_Funcs* raster_class; - - } FT_Renderer_Class; - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Get_Renderer */ - /* */ - /* <Description> */ - /* Retrieve the current renderer for a given glyph format. */ - /* */ - /* <Input> */ - /* library :: A handle to the library object. */ - /* */ - /* format :: The glyph format. */ - /* */ - /* <Return> */ - /* A renderer handle. 0~if none found. */ - /* */ - /* <Note> */ - /* An error will be returned if a module already exists by that name, */ - /* or if the module requires a version of FreeType that is too great. */ - /* */ - /* To add a new renderer, simply use @FT_Add_Module. To retrieve a */ - /* renderer by its name, use @FT_Get_Module. */ - /* */ - FT_EXPORT( FT_Renderer ) - FT_Get_Renderer( FT_Library library, - FT_Glyph_Format format ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Set_Renderer */ - /* */ - /* <Description> */ - /* Set the current renderer to use, and set additional mode. */ - /* */ - /* <InOut> */ - /* library :: A handle to the library object. */ - /* */ - /* <Input> */ - /* renderer :: A handle to the renderer object. */ - /* */ - /* num_params :: The number of additional parameters. */ - /* */ - /* parameters :: Additional parameters. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - /* <Note> */ - /* In case of success, the renderer will be used to convert glyph */ - /* images in the renderer's known format into bitmaps. */ - /* */ - /* This doesn't change the current renderer for other formats. */ - /* */ - /* Currently, only the B/W renderer, if compiled with */ - /* FT_RASTER_OPTION_ANTI_ALIASING (providing a 5-levels */ - /* anti-aliasing mode; this option must be set directly in */ - /* `ftraster.c' and is undefined by default) accepts a single tag */ - /* `pal5' to set its gray palette as a character string with */ - /* 5~elements. Consequently, the third and fourth argument are zero */ - /* normally. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Set_Renderer( FT_Library library, - FT_Renderer renderer, - FT_UInt num_params, - FT_Parameter* parameters ); - - - /* */ - - -FT_END_HEADER - -#endif /* __FTRENDER_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftsizes.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftsizes.h deleted file mode 100644 index 3e548cc39f..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftsizes.h +++ /dev/null @@ -1,159 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftsizes.h */ -/* */ -/* FreeType size objects management (specification). */ -/* */ -/* Copyright 1996-2001, 2003, 2004, 2006, 2009 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - - /*************************************************************************/ - /* */ - /* Typical application would normally not need to use these functions. */ - /* However, they have been placed in a public API for the rare cases */ - /* where they are needed. */ - /* */ - /*************************************************************************/ - - -#ifndef __FTSIZES_H__ -#define __FTSIZES_H__ - - -#include <ft2build.h> -#include FT_FREETYPE_H - -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - - -FT_BEGIN_HEADER - - - /*************************************************************************/ - /* */ - /* <Section> */ - /* sizes_management */ - /* */ - /* <Title> */ - /* Size Management */ - /* */ - /* <Abstract> */ - /* Managing multiple sizes per face. */ - /* */ - /* <Description> */ - /* When creating a new face object (e.g., with @FT_New_Face), an */ - /* @FT_Size object is automatically created and used to store all */ - /* pixel-size dependent information, available in the `face->size' */ - /* field. */ - /* */ - /* It is however possible to create more sizes for a given face, */ - /* mostly in order to manage several character pixel sizes of the */ - /* same font family and style. See @FT_New_Size and @FT_Done_Size. */ - /* */ - /* Note that @FT_Set_Pixel_Sizes and @FT_Set_Char_Size only */ - /* modify the contents of the current `active' size; you thus need */ - /* to use @FT_Activate_Size to change it. */ - /* */ - /* 99% of applications won't need the functions provided here, */ - /* especially if they use the caching sub-system, so be cautious */ - /* when using these. */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_New_Size */ - /* */ - /* <Description> */ - /* Create a new size object from a given face object. */ - /* */ - /* <Input> */ - /* face :: A handle to a parent face object. */ - /* */ - /* <Output> */ - /* asize :: A handle to a new size object. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - /* <Note> */ - /* You need to call @FT_Activate_Size in order to select the new size */ - /* for upcoming calls to @FT_Set_Pixel_Sizes, @FT_Set_Char_Size, */ - /* @FT_Load_Glyph, @FT_Load_Char, etc. */ - /* */ - FT_EXPORT( FT_Error ) - FT_New_Size( FT_Face face, - FT_Size* size ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Done_Size */ - /* */ - /* <Description> */ - /* Discard a given size object. Note that @FT_Done_Face */ - /* automatically discards all size objects allocated with */ - /* @FT_New_Size. */ - /* */ - /* <Input> */ - /* size :: A handle to a target size object. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Done_Size( FT_Size size ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Activate_Size */ - /* */ - /* <Description> */ - /* Even though it is possible to create several size objects for a */ - /* given face (see @FT_New_Size for details), functions like */ - /* @FT_Load_Glyph or @FT_Load_Char only use the one which has been */ - /* activated last to determine the `current character pixel size'. */ - /* */ - /* This function can be used to `activate' a previously created size */ - /* object. */ - /* */ - /* <Input> */ - /* size :: A handle to a target size object. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - /* <Note> */ - /* If `face' is the size's parent face object, this function changes */ - /* the value of `face->size' to the input size handle. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Activate_Size( FT_Size size ); - - /* */ - - -FT_END_HEADER - -#endif /* __FTSIZES_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftsnames.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftsnames.h deleted file mode 100644 index 485e4e162e..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftsnames.h +++ /dev/null @@ -1,200 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftsnames.h */ -/* */ -/* Simple interface to access SFNT name tables (which are used */ -/* to hold font names, copyright info, notices, etc.) (specification). */ -/* */ -/* This is _not_ used to retrieve glyph names! */ -/* */ -/* Copyright 1996-2001, 2002, 2003, 2006, 2009, 2010 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __FT_SFNT_NAMES_H__ -#define __FT_SFNT_NAMES_H__ - - -#include <ft2build.h> -#include FT_FREETYPE_H - -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - - -FT_BEGIN_HEADER - - - /*************************************************************************/ - /* */ - /* <Section> */ - /* sfnt_names */ - /* */ - /* <Title> */ - /* SFNT Names */ - /* */ - /* <Abstract> */ - /* Access the names embedded in TrueType and OpenType files. */ - /* */ - /* <Description> */ - /* The TrueType and OpenType specifications allow the inclusion of */ - /* a special `names table' in font files. This table contains */ - /* textual (and internationalized) information regarding the font, */ - /* like family name, copyright, version, etc. */ - /* */ - /* The definitions below are used to access them if available. */ - /* */ - /* Note that this has nothing to do with glyph names! */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FT_SfntName */ - /* */ - /* <Description> */ - /* A structure used to model an SFNT `name' table entry. */ - /* */ - /* <Fields> */ - /* platform_id :: The platform ID for `string'. */ - /* */ - /* encoding_id :: The encoding ID for `string'. */ - /* */ - /* language_id :: The language ID for `string'. */ - /* */ - /* name_id :: An identifier for `string'. */ - /* */ - /* string :: The `name' string. Note that its format differs */ - /* depending on the (platform,encoding) pair. It can */ - /* be a Pascal String, a UTF-16 one, etc. */ - /* */ - /* Generally speaking, the string is not */ - /* zero-terminated. Please refer to the TrueType */ - /* specification for details. */ - /* */ - /* string_len :: The length of `string' in bytes. */ - /* */ - /* <Note> */ - /* Possible values for `platform_id', `encoding_id', `language_id', */ - /* and `name_id' are given in the file `ttnameid.h'. For details */ - /* please refer to the TrueType or OpenType specification. */ - /* */ - /* See also @TT_PLATFORM_XXX, @TT_APPLE_ID_XXX, @TT_MAC_ID_XXX, */ - /* @TT_ISO_ID_XXX, and @TT_MS_ID_XXX. */ - /* */ - typedef struct FT_SfntName_ - { - FT_UShort platform_id; - FT_UShort encoding_id; - FT_UShort language_id; - FT_UShort name_id; - - FT_Byte* string; /* this string is *not* null-terminated! */ - FT_UInt string_len; /* in bytes */ - - } FT_SfntName; - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Get_Sfnt_Name_Count */ - /* */ - /* <Description> */ - /* Retrieve the number of name strings in the SFNT `name' table. */ - /* */ - /* <Input> */ - /* face :: A handle to the source face. */ - /* */ - /* <Return> */ - /* The number of strings in the `name' table. */ - /* */ - FT_EXPORT( FT_UInt ) - FT_Get_Sfnt_Name_Count( FT_Face face ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Get_Sfnt_Name */ - /* */ - /* <Description> */ - /* Retrieve a string of the SFNT `name' table for a given index. */ - /* */ - /* <Input> */ - /* face :: A handle to the source face. */ - /* */ - /* idx :: The index of the `name' string. */ - /* */ - /* <Output> */ - /* aname :: The indexed @FT_SfntName structure. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - /* <Note> */ - /* The `string' array returned in the `aname' structure is not */ - /* null-terminated. The application should deallocate it if it is no */ - /* longer in use. */ - /* */ - /* Use @FT_Get_Sfnt_Name_Count to get the total number of available */ - /* `name' table entries, then do a loop until you get the right */ - /* platform, encoding, and name ID. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Get_Sfnt_Name( FT_Face face, - FT_UInt idx, - FT_SfntName *aname ); - - - /*************************************************************************** - * - * @constant: - * FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY - * - * @description: - * A constant used as the tag of @FT_Parameter structures to make - * FT_Open_Face() ignore preferred family subfamily names in `name' - * table since OpenType version 1.4. For backwards compatibility with - * legacy systems which has 4-face-per-family restriction. - * - */ -#define FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY FT_MAKE_TAG( 'i', 'g', 'p', 'f' ) - - - /*************************************************************************** - * - * @constant: - * FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY - * - * @description: - * A constant used as the tag of @FT_Parameter structures to make - * FT_Open_Face() ignore preferred subfamily names in `name' table since - * OpenType version 1.4. For backwards compatibility with legacy - * systems which has 4-face-per-family restriction. - * - */ -#define FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY FT_MAKE_TAG( 'i', 'g', 'p', 's' ) - - /* */ - - -FT_END_HEADER - -#endif /* __FT_SFNT_NAMES_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftstroke.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftstroke.h deleted file mode 100644 index 49ae2bc061..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftstroke.h +++ /dev/null @@ -1,741 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftstroke.h */ -/* */ -/* FreeType path stroker (specification). */ -/* */ -/* Copyright 2002-2006, 2008, 2009, 2011 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __FT_STROKE_H__ -#define __FT_STROKE_H__ - -#include <ft2build.h> -#include FT_OUTLINE_H -#include FT_GLYPH_H - - -FT_BEGIN_HEADER - - - /************************************************************************ - * - * @section: - * glyph_stroker - * - * @title: - * Glyph Stroker - * - * @abstract: - * Generating bordered and stroked glyphs. - * - * @description: - * This component generates stroked outlines of a given vectorial - * glyph. It also allows you to retrieve the `outside' and/or the - * `inside' borders of the stroke. - * - * This can be useful to generate `bordered' glyph, i.e., glyphs - * displayed with a coloured (and anti-aliased) border around their - * shape. - */ - - - /************************************************************** - * - * @type: - * FT_Stroker - * - * @description: - * Opaque handler to a path stroker object. - */ - typedef struct FT_StrokerRec_* FT_Stroker; - - - /************************************************************** - * - * @enum: - * FT_Stroker_LineJoin - * - * @description: - * These values determine how two joining lines are rendered - * in a stroker. - * - * @values: - * FT_STROKER_LINEJOIN_ROUND :: - * Used to render rounded line joins. Circular arcs are used - * to join two lines smoothly. - * - * FT_STROKER_LINEJOIN_BEVEL :: - * Used to render beveled line joins. The outer corner of - * the joined lines is filled by enclosing the triangular - * region of the corner with a straight line between the - * outer corners of each stroke. - * - * FT_STROKER_LINEJOIN_MITER_FIXED :: - * Used to render mitered line joins, with fixed bevels if the - * miter limit is exceeded. The outer edges of the strokes - * for the two segments are extended until they meet at an - * angle. If the segments meet at too sharp an angle (such - * that the miter would extend from the intersection of the - * segments a distance greater than the product of the miter - * limit value and the border radius), then a bevel join (see - * above) is used instead. This prevents long spikes being - * created. FT_STROKER_LINEJOIN_MITER_FIXED generates a miter - * line join as used in PostScript and PDF. - * - * FT_STROKER_LINEJOIN_MITER_VARIABLE :: - * FT_STROKER_LINEJOIN_MITER :: - * Used to render mitered line joins, with variable bevels if - * the miter limit is exceeded. The intersection of the - * strokes is clipped at a line perpendicular to the bisector - * of the angle between the strokes, at the distance from the - * intersection of the segments equal to the product of the - * miter limit value and the border radius. This prevents - * long spikes being created. - * FT_STROKER_LINEJOIN_MITER_VARIABLE generates a mitered line - * join as used in XPS. FT_STROKER_LINEJOIN_MITER is an alias - * for FT_STROKER_LINEJOIN_MITER_VARIABLE, retained for - * backwards compatibility. - */ - typedef enum FT_Stroker_LineJoin_ - { - FT_STROKER_LINEJOIN_ROUND = 0, - FT_STROKER_LINEJOIN_BEVEL = 1, - FT_STROKER_LINEJOIN_MITER_VARIABLE = 2, - FT_STROKER_LINEJOIN_MITER = FT_STROKER_LINEJOIN_MITER_VARIABLE, - FT_STROKER_LINEJOIN_MITER_FIXED = 3 - - } FT_Stroker_LineJoin; - - - /************************************************************** - * - * @enum: - * FT_Stroker_LineCap - * - * @description: - * These values determine how the end of opened sub-paths are - * rendered in a stroke. - * - * @values: - * FT_STROKER_LINECAP_BUTT :: - * The end of lines is rendered as a full stop on the last - * point itself. - * - * FT_STROKER_LINECAP_ROUND :: - * The end of lines is rendered as a half-circle around the - * last point. - * - * FT_STROKER_LINECAP_SQUARE :: - * The end of lines is rendered as a square around the - * last point. - */ - typedef enum FT_Stroker_LineCap_ - { - FT_STROKER_LINECAP_BUTT = 0, - FT_STROKER_LINECAP_ROUND, - FT_STROKER_LINECAP_SQUARE - - } FT_Stroker_LineCap; - - - /************************************************************** - * - * @enum: - * FT_StrokerBorder - * - * @description: - * These values are used to select a given stroke border - * in @FT_Stroker_GetBorderCounts and @FT_Stroker_ExportBorder. - * - * @values: - * FT_STROKER_BORDER_LEFT :: - * Select the left border, relative to the drawing direction. - * - * FT_STROKER_BORDER_RIGHT :: - * Select the right border, relative to the drawing direction. - * - * @note: - * Applications are generally interested in the `inside' and `outside' - * borders. However, there is no direct mapping between these and the - * `left' and `right' ones, since this really depends on the glyph's - * drawing orientation, which varies between font formats. - * - * You can however use @FT_Outline_GetInsideBorder and - * @FT_Outline_GetOutsideBorder to get these. - */ - typedef enum FT_StrokerBorder_ - { - FT_STROKER_BORDER_LEFT = 0, - FT_STROKER_BORDER_RIGHT - - } FT_StrokerBorder; - - - /************************************************************** - * - * @function: - * FT_Outline_GetInsideBorder - * - * @description: - * Retrieve the @FT_StrokerBorder value corresponding to the - * `inside' borders of a given outline. - * - * @input: - * outline :: - * The source outline handle. - * - * @return: - * The border index. @FT_STROKER_BORDER_RIGHT for empty or invalid - * outlines. - */ - FT_EXPORT( FT_StrokerBorder ) - FT_Outline_GetInsideBorder( FT_Outline* outline ); - - - /************************************************************** - * - * @function: - * FT_Outline_GetOutsideBorder - * - * @description: - * Retrieve the @FT_StrokerBorder value corresponding to the - * `outside' borders of a given outline. - * - * @input: - * outline :: - * The source outline handle. - * - * @return: - * The border index. @FT_STROKER_BORDER_LEFT for empty or invalid - * outlines. - */ - FT_EXPORT( FT_StrokerBorder ) - FT_Outline_GetOutsideBorder( FT_Outline* outline ); - - - /************************************************************** - * - * @function: - * FT_Stroker_New - * - * @description: - * Create a new stroker object. - * - * @input: - * library :: - * FreeType library handle. - * - * @output: - * astroker :: - * A new stroker object handle. NULL in case of error. - * - * @return: - * FreeType error code. 0~means success. - */ - FT_EXPORT( FT_Error ) - FT_Stroker_New( FT_Library library, - FT_Stroker *astroker ); - - - /************************************************************** - * - * @function: - * FT_Stroker_Set - * - * @description: - * Reset a stroker object's attributes. - * - * @input: - * stroker :: - * The target stroker handle. - * - * radius :: - * The border radius. - * - * line_cap :: - * The line cap style. - * - * line_join :: - * The line join style. - * - * miter_limit :: - * The miter limit for the FT_STROKER_LINEJOIN_MITER_FIXED and - * FT_STROKER_LINEJOIN_MITER_VARIABLE line join styles, - * expressed as 16.16 fixed point value. - * - * @note: - * The radius is expressed in the same units as the outline - * coordinates. - */ - FT_EXPORT( void ) - FT_Stroker_Set( FT_Stroker stroker, - FT_Fixed radius, - FT_Stroker_LineCap line_cap, - FT_Stroker_LineJoin line_join, - FT_Fixed miter_limit ); - - - /************************************************************** - * - * @function: - * FT_Stroker_Rewind - * - * @description: - * Reset a stroker object without changing its attributes. - * You should call this function before beginning a new - * series of calls to @FT_Stroker_BeginSubPath or - * @FT_Stroker_EndSubPath. - * - * @input: - * stroker :: - * The target stroker handle. - */ - FT_EXPORT( void ) - FT_Stroker_Rewind( FT_Stroker stroker ); - - - /************************************************************** - * - * @function: - * FT_Stroker_ParseOutline - * - * @description: - * A convenience function used to parse a whole outline with - * the stroker. The resulting outline(s) can be retrieved - * later by functions like @FT_Stroker_GetCounts and @FT_Stroker_Export. - * - * @input: - * stroker :: - * The target stroker handle. - * - * outline :: - * The source outline. - * - * opened :: - * A boolean. If~1, the outline is treated as an open path instead - * of a closed one. - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * If `opened' is~0 (the default), the outline is treated as a closed - * path, and the stroker generates two distinct `border' outlines. - * - * If `opened' is~1, the outline is processed as an open path, and the - * stroker generates a single `stroke' outline. - * - * This function calls @FT_Stroker_Rewind automatically. - */ - FT_EXPORT( FT_Error ) - FT_Stroker_ParseOutline( FT_Stroker stroker, - FT_Outline* outline, - FT_Bool opened ); - - - /************************************************************** - * - * @function: - * FT_Stroker_BeginSubPath - * - * @description: - * Start a new sub-path in the stroker. - * - * @input: - * stroker :: - * The target stroker handle. - * - * to :: - * A pointer to the start vector. - * - * open :: - * A boolean. If~1, the sub-path is treated as an open one. - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * This function is useful when you need to stroke a path that is - * not stored as an @FT_Outline object. - */ - FT_EXPORT( FT_Error ) - FT_Stroker_BeginSubPath( FT_Stroker stroker, - FT_Vector* to, - FT_Bool open ); - - - /************************************************************** - * - * @function: - * FT_Stroker_EndSubPath - * - * @description: - * Close the current sub-path in the stroker. - * - * @input: - * stroker :: - * The target stroker handle. - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * You should call this function after @FT_Stroker_BeginSubPath. - * If the subpath was not `opened', this function `draws' a - * single line segment to the start position when needed. - */ - FT_EXPORT( FT_Error ) - FT_Stroker_EndSubPath( FT_Stroker stroker ); - - - /************************************************************** - * - * @function: - * FT_Stroker_LineTo - * - * @description: - * `Draw' a single line segment in the stroker's current sub-path, - * from the last position. - * - * @input: - * stroker :: - * The target stroker handle. - * - * to :: - * A pointer to the destination point. - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * You should call this function between @FT_Stroker_BeginSubPath and - * @FT_Stroker_EndSubPath. - */ - FT_EXPORT( FT_Error ) - FT_Stroker_LineTo( FT_Stroker stroker, - FT_Vector* to ); - - - /************************************************************** - * - * @function: - * FT_Stroker_ConicTo - * - * @description: - * `Draw' a single quadratic Bézier in the stroker's current sub-path, - * from the last position. - * - * @input: - * stroker :: - * The target stroker handle. - * - * control :: - * A pointer to a Bézier control point. - * - * to :: - * A pointer to the destination point. - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * You should call this function between @FT_Stroker_BeginSubPath and - * @FT_Stroker_EndSubPath. - */ - FT_EXPORT( FT_Error ) - FT_Stroker_ConicTo( FT_Stroker stroker, - FT_Vector* control, - FT_Vector* to ); - - - /************************************************************** - * - * @function: - * FT_Stroker_CubicTo - * - * @description: - * `Draw' a single cubic Bézier in the stroker's current sub-path, - * from the last position. - * - * @input: - * stroker :: - * The target stroker handle. - * - * control1 :: - * A pointer to the first Bézier control point. - * - * control2 :: - * A pointer to second Bézier control point. - * - * to :: - * A pointer to the destination point. - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * You should call this function between @FT_Stroker_BeginSubPath and - * @FT_Stroker_EndSubPath. - */ - FT_EXPORT( FT_Error ) - FT_Stroker_CubicTo( FT_Stroker stroker, - FT_Vector* control1, - FT_Vector* control2, - FT_Vector* to ); - - - /************************************************************** - * - * @function: - * FT_Stroker_GetBorderCounts - * - * @description: - * Call this function once you have finished parsing your paths - * with the stroker. It returns the number of points and - * contours necessary to export one of the `border' or `stroke' - * outlines generated by the stroker. - * - * @input: - * stroker :: - * The target stroker handle. - * - * border :: - * The border index. - * - * @output: - * anum_points :: - * The number of points. - * - * anum_contours :: - * The number of contours. - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * When an outline, or a sub-path, is `closed', the stroker generates - * two independent `border' outlines, named `left' and `right'. - * - * When the outline, or a sub-path, is `opened', the stroker merges - * the `border' outlines with caps. The `left' border receives all - * points, while the `right' border becomes empty. - * - * Use the function @FT_Stroker_GetCounts instead if you want to - * retrieve the counts associated to both borders. - */ - FT_EXPORT( FT_Error ) - FT_Stroker_GetBorderCounts( FT_Stroker stroker, - FT_StrokerBorder border, - FT_UInt *anum_points, - FT_UInt *anum_contours ); - - - /************************************************************** - * - * @function: - * FT_Stroker_ExportBorder - * - * @description: - * Call this function after @FT_Stroker_GetBorderCounts to - * export the corresponding border to your own @FT_Outline - * structure. - * - * Note that this function appends the border points and - * contours to your outline, but does not try to resize its - * arrays. - * - * @input: - * stroker :: - * The target stroker handle. - * - * border :: - * The border index. - * - * outline :: - * The target outline handle. - * - * @note: - * Always call this function after @FT_Stroker_GetBorderCounts to - * get sure that there is enough room in your @FT_Outline object to - * receive all new data. - * - * When an outline, or a sub-path, is `closed', the stroker generates - * two independent `border' outlines, named `left' and `right' - * - * When the outline, or a sub-path, is `opened', the stroker merges - * the `border' outlines with caps. The `left' border receives all - * points, while the `right' border becomes empty. - * - * Use the function @FT_Stroker_Export instead if you want to - * retrieve all borders at once. - */ - FT_EXPORT( void ) - FT_Stroker_ExportBorder( FT_Stroker stroker, - FT_StrokerBorder border, - FT_Outline* outline ); - - - /************************************************************** - * - * @function: - * FT_Stroker_GetCounts - * - * @description: - * Call this function once you have finished parsing your paths - * with the stroker. It returns the number of points and - * contours necessary to export all points/borders from the stroked - * outline/path. - * - * @input: - * stroker :: - * The target stroker handle. - * - * @output: - * anum_points :: - * The number of points. - * - * anum_contours :: - * The number of contours. - * - * @return: - * FreeType error code. 0~means success. - */ - FT_EXPORT( FT_Error ) - FT_Stroker_GetCounts( FT_Stroker stroker, - FT_UInt *anum_points, - FT_UInt *anum_contours ); - - - /************************************************************** - * - * @function: - * FT_Stroker_Export - * - * @description: - * Call this function after @FT_Stroker_GetBorderCounts to - * export all borders to your own @FT_Outline structure. - * - * Note that this function appends the border points and - * contours to your outline, but does not try to resize its - * arrays. - * - * @input: - * stroker :: - * The target stroker handle. - * - * outline :: - * The target outline handle. - */ - FT_EXPORT( void ) - FT_Stroker_Export( FT_Stroker stroker, - FT_Outline* outline ); - - - /************************************************************** - * - * @function: - * FT_Stroker_Done - * - * @description: - * Destroy a stroker object. - * - * @input: - * stroker :: - * A stroker handle. Can be NULL. - */ - FT_EXPORT( void ) - FT_Stroker_Done( FT_Stroker stroker ); - - - /************************************************************** - * - * @function: - * FT_Glyph_Stroke - * - * @description: - * Stroke a given outline glyph object with a given stroker. - * - * @inout: - * pglyph :: - * Source glyph handle on input, new glyph handle on output. - * - * @input: - * stroker :: - * A stroker handle. - * - * destroy :: - * A Boolean. If~1, the source glyph object is destroyed - * on success. - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * The source glyph is untouched in case of error. - */ - FT_EXPORT( FT_Error ) - FT_Glyph_Stroke( FT_Glyph *pglyph, - FT_Stroker stroker, - FT_Bool destroy ); - - - /************************************************************** - * - * @function: - * FT_Glyph_StrokeBorder - * - * @description: - * Stroke a given outline glyph object with a given stroker, but - * only return either its inside or outside border. - * - * @inout: - * pglyph :: - * Source glyph handle on input, new glyph handle on output. - * - * @input: - * stroker :: - * A stroker handle. - * - * inside :: - * A Boolean. If~1, return the inside border, otherwise - * the outside border. - * - * destroy :: - * A Boolean. If~1, the source glyph object is destroyed - * on success. - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * The source glyph is untouched in case of error. - */ - FT_EXPORT( FT_Error ) - FT_Glyph_StrokeBorder( FT_Glyph *pglyph, - FT_Stroker stroker, - FT_Bool inside, - FT_Bool destroy ); - - /* */ - -FT_END_HEADER - -#endif /* __FT_STROKE_H__ */ - - -/* END */ - - -/* Local Variables: */ -/* coding: utf-8 */ -/* End: */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftsynth.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftsynth.h deleted file mode 100644 index a068b7928d..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftsynth.h +++ /dev/null @@ -1,80 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftsynth.h */ -/* */ -/* FreeType synthesizing code for emboldening and slanting */ -/* (specification). */ -/* */ -/* Copyright 2000-2001, 2003, 2006, 2008 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - - /*************************************************************************/ - /*************************************************************************/ - /*************************************************************************/ - /*************************************************************************/ - /*************************************************************************/ - /********* *********/ - /********* WARNING, THIS IS ALPHA CODE! THIS API *********/ - /********* IS DUE TO CHANGE UNTIL STRICTLY NOTIFIED BY THE *********/ - /********* FREETYPE DEVELOPMENT TEAM *********/ - /********* *********/ - /*************************************************************************/ - /*************************************************************************/ - /*************************************************************************/ - /*************************************************************************/ - /*************************************************************************/ - - - /* Main reason for not lifting the functions in this module to a */ - /* `standard' API is that the used parameters for emboldening and */ - /* slanting are not configurable. Consider the functions as a */ - /* code resource which should be copied into the application and */ - /* adapted to the particular needs. */ - - -#ifndef __FTSYNTH_H__ -#define __FTSYNTH_H__ - - -#include <ft2build.h> -#include FT_FREETYPE_H - -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - - -FT_BEGIN_HEADER - - /* Embolden a glyph by a `reasonable' value (which is highly a matter of */ - /* taste). This function is actually a convenience function, providing */ - /* a wrapper for @FT_Outline_Embolden and @FT_Bitmap_Embolden. */ - /* */ - /* For emboldened outlines the metrics are estimates only; if you need */ - /* precise values you should call @FT_Outline_Get_CBox. */ - FT_EXPORT( void ) - FT_GlyphSlot_Embolden( FT_GlyphSlot slot ); - - /* Slant an outline glyph to the right by about 12 degrees. */ - FT_EXPORT( void ) - FT_GlyphSlot_Oblique( FT_GlyphSlot slot ); - - /* */ - -FT_END_HEADER - -#endif /* __FTSYNTH_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftsystem.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftsystem.h deleted file mode 100644 index e07460c55d..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftsystem.h +++ /dev/null @@ -1,347 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftsystem.h */ -/* */ -/* FreeType low-level system interface definition (specification). */ -/* */ -/* Copyright 1996-2001, 2002, 2005, 2010 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __FTSYSTEM_H__ -#define __FTSYSTEM_H__ - - -#include <ft2build.h> - - -FT_BEGIN_HEADER - - - /*************************************************************************/ - /* */ - /* <Section> */ - /* system_interface */ - /* */ - /* <Title> */ - /* System Interface */ - /* */ - /* <Abstract> */ - /* How FreeType manages memory and i/o. */ - /* */ - /* <Description> */ - /* This section contains various definitions related to memory */ - /* management and i/o access. You need to understand this */ - /* information if you want to use a custom memory manager or you own */ - /* i/o streams. */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* M E M O R Y M A N A G E M E N T */ - /* */ - /*************************************************************************/ - - - /************************************************************************* - * - * @type: - * FT_Memory - * - * @description: - * A handle to a given memory manager object, defined with an - * @FT_MemoryRec structure. - * - */ - typedef struct FT_MemoryRec_* FT_Memory; - - - /************************************************************************* - * - * @functype: - * FT_Alloc_Func - * - * @description: - * A function used to allocate `size' bytes from `memory'. - * - * @input: - * memory :: - * A handle to the source memory manager. - * - * size :: - * The size in bytes to allocate. - * - * @return: - * Address of new memory block. 0~in case of failure. - * - */ - typedef void* - (*FT_Alloc_Func)( FT_Memory memory, - long size ); - - - /************************************************************************* - * - * @functype: - * FT_Free_Func - * - * @description: - * A function used to release a given block of memory. - * - * @input: - * memory :: - * A handle to the source memory manager. - * - * block :: - * The address of the target memory block. - * - */ - typedef void - (*FT_Free_Func)( FT_Memory memory, - void* block ); - - - /************************************************************************* - * - * @functype: - * FT_Realloc_Func - * - * @description: - * A function used to re-allocate a given block of memory. - * - * @input: - * memory :: - * A handle to the source memory manager. - * - * cur_size :: - * The block's current size in bytes. - * - * new_size :: - * The block's requested new size. - * - * block :: - * The block's current address. - * - * @return: - * New block address. 0~in case of memory shortage. - * - * @note: - * In case of error, the old block must still be available. - * - */ - typedef void* - (*FT_Realloc_Func)( FT_Memory memory, - long cur_size, - long new_size, - void* block ); - - - /************************************************************************* - * - * @struct: - * FT_MemoryRec - * - * @description: - * A structure used to describe a given memory manager to FreeType~2. - * - * @fields: - * user :: - * A generic typeless pointer for user data. - * - * alloc :: - * A pointer type to an allocation function. - * - * free :: - * A pointer type to an memory freeing function. - * - * realloc :: - * A pointer type to a reallocation function. - * - */ - struct FT_MemoryRec_ - { - void* user; - FT_Alloc_Func alloc; - FT_Free_Func free; - FT_Realloc_Func realloc; - }; - - - /*************************************************************************/ - /* */ - /* I / O M A N A G E M E N T */ - /* */ - /*************************************************************************/ - - - /************************************************************************* - * - * @type: - * FT_Stream - * - * @description: - * A handle to an input stream. - * - */ - typedef struct FT_StreamRec_* FT_Stream; - - - /************************************************************************* - * - * @struct: - * FT_StreamDesc - * - * @description: - * A union type used to store either a long or a pointer. This is used - * to store a file descriptor or a `FILE*' in an input stream. - * - */ - typedef union FT_StreamDesc_ - { - long value; - void* pointer; - - } FT_StreamDesc; - - - /************************************************************************* - * - * @functype: - * FT_Stream_IoFunc - * - * @description: - * A function used to seek and read data from a given input stream. - * - * @input: - * stream :: - * A handle to the source stream. - * - * offset :: - * The offset of read in stream (always from start). - * - * buffer :: - * The address of the read buffer. - * - * count :: - * The number of bytes to read from the stream. - * - * @return: - * The number of bytes effectively read by the stream. - * - * @note: - * This function might be called to perform a seek or skip operation - * with a `count' of~0. A non-zero return value then indicates an - * error. - * - */ - typedef unsigned long - (*FT_Stream_IoFunc)( FT_Stream stream, - unsigned long offset, - unsigned char* buffer, - unsigned long count ); - - - /************************************************************************* - * - * @functype: - * FT_Stream_CloseFunc - * - * @description: - * A function used to close a given input stream. - * - * @input: - * stream :: - * A handle to the target stream. - * - */ - typedef void - (*FT_Stream_CloseFunc)( FT_Stream stream ); - - - /************************************************************************* - * - * @struct: - * FT_StreamRec - * - * @description: - * A structure used to describe an input stream. - * - * @input: - * base :: - * For memory-based streams, this is the address of the first stream - * byte in memory. This field should always be set to NULL for - * disk-based streams. - * - * size :: - * The stream size in bytes. - * - * pos :: - * The current position within the stream. - * - * descriptor :: - * This field is a union that can hold an integer or a pointer. It is - * used by stream implementations to store file descriptors or `FILE*' - * pointers. - * - * pathname :: - * This field is completely ignored by FreeType. However, it is often - * useful during debugging to use it to store the stream's filename - * (where available). - * - * read :: - * The stream's input function. - * - * close :: - * The stream's close function. - * - * memory :: - * The memory manager to use to preload frames. This is set - * internally by FreeType and shouldn't be touched by stream - * implementations. - * - * cursor :: - * This field is set and used internally by FreeType when parsing - * frames. - * - * limit :: - * This field is set and used internally by FreeType when parsing - * frames. - * - */ - typedef struct FT_StreamRec_ - { - unsigned char* base; - unsigned long size; - unsigned long pos; - - FT_StreamDesc descriptor; - FT_StreamDesc pathname; - FT_Stream_IoFunc read; - FT_Stream_CloseFunc close; - - FT_Memory memory; - unsigned char* cursor; - unsigned char* limit; - - } FT_StreamRec; - - - /* */ - - -FT_END_HEADER - -#endif /* __FTSYSTEM_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/fttrigon.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/fttrigon.h deleted file mode 100644 index 6b77d2ee54..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/fttrigon.h +++ /dev/null @@ -1,350 +0,0 @@ -/***************************************************************************/ -/* */ -/* fttrigon.h */ -/* */ -/* FreeType trigonometric functions (specification). */ -/* */ -/* Copyright 2001, 2003, 2005, 2007 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __FTTRIGON_H__ -#define __FTTRIGON_H__ - -#include FT_FREETYPE_H - -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - - -FT_BEGIN_HEADER - - - /*************************************************************************/ - /* */ - /* <Section> */ - /* computations */ - /* */ - /*************************************************************************/ - - - /************************************************************************* - * - * @type: - * FT_Angle - * - * @description: - * This type is used to model angle values in FreeType. Note that the - * angle is a 16.16 fixed float value expressed in degrees. - * - */ - typedef FT_Fixed FT_Angle; - - - /************************************************************************* - * - * @macro: - * FT_ANGLE_PI - * - * @description: - * The angle pi expressed in @FT_Angle units. - * - */ -#define FT_ANGLE_PI ( 180L << 16 ) - - - /************************************************************************* - * - * @macro: - * FT_ANGLE_2PI - * - * @description: - * The angle 2*pi expressed in @FT_Angle units. - * - */ -#define FT_ANGLE_2PI ( FT_ANGLE_PI * 2 ) - - - /************************************************************************* - * - * @macro: - * FT_ANGLE_PI2 - * - * @description: - * The angle pi/2 expressed in @FT_Angle units. - * - */ -#define FT_ANGLE_PI2 ( FT_ANGLE_PI / 2 ) - - - /************************************************************************* - * - * @macro: - * FT_ANGLE_PI4 - * - * @description: - * The angle pi/4 expressed in @FT_Angle units. - * - */ -#define FT_ANGLE_PI4 ( FT_ANGLE_PI / 4 ) - - - /************************************************************************* - * - * @function: - * FT_Sin - * - * @description: - * Return the sinus of a given angle in fixed point format. - * - * @input: - * angle :: - * The input angle. - * - * @return: - * The sinus value. - * - * @note: - * If you need both the sinus and cosinus for a given angle, use the - * function @FT_Vector_Unit. - * - */ - FT_EXPORT( FT_Fixed ) - FT_Sin( FT_Angle angle ); - - - /************************************************************************* - * - * @function: - * FT_Cos - * - * @description: - * Return the cosinus of a given angle in fixed point format. - * - * @input: - * angle :: - * The input angle. - * - * @return: - * The cosinus value. - * - * @note: - * If you need both the sinus and cosinus for a given angle, use the - * function @FT_Vector_Unit. - * - */ - FT_EXPORT( FT_Fixed ) - FT_Cos( FT_Angle angle ); - - - /************************************************************************* - * - * @function: - * FT_Tan - * - * @description: - * Return the tangent of a given angle in fixed point format. - * - * @input: - * angle :: - * The input angle. - * - * @return: - * The tangent value. - * - */ - FT_EXPORT( FT_Fixed ) - FT_Tan( FT_Angle angle ); - - - /************************************************************************* - * - * @function: - * FT_Atan2 - * - * @description: - * Return the arc-tangent corresponding to a given vector (x,y) in - * the 2d plane. - * - * @input: - * x :: - * The horizontal vector coordinate. - * - * y :: - * The vertical vector coordinate. - * - * @return: - * The arc-tangent value (i.e. angle). - * - */ - FT_EXPORT( FT_Angle ) - FT_Atan2( FT_Fixed x, - FT_Fixed y ); - - - /************************************************************************* - * - * @function: - * FT_Angle_Diff - * - * @description: - * Return the difference between two angles. The result is always - * constrained to the ]-PI..PI] interval. - * - * @input: - * angle1 :: - * First angle. - * - * angle2 :: - * Second angle. - * - * @return: - * Constrained value of `value2-value1'. - * - */ - FT_EXPORT( FT_Angle ) - FT_Angle_Diff( FT_Angle angle1, - FT_Angle angle2 ); - - - /************************************************************************* - * - * @function: - * FT_Vector_Unit - * - * @description: - * Return the unit vector corresponding to a given angle. After the - * call, the value of `vec.x' will be `sin(angle)', and the value of - * `vec.y' will be `cos(angle)'. - * - * This function is useful to retrieve both the sinus and cosinus of a - * given angle quickly. - * - * @output: - * vec :: - * The address of target vector. - * - * @input: - * angle :: - * The address of angle. - * - */ - FT_EXPORT( void ) - FT_Vector_Unit( FT_Vector* vec, - FT_Angle angle ); - - - /************************************************************************* - * - * @function: - * FT_Vector_Rotate - * - * @description: - * Rotate a vector by a given angle. - * - * @inout: - * vec :: - * The address of target vector. - * - * @input: - * angle :: - * The address of angle. - * - */ - FT_EXPORT( void ) - FT_Vector_Rotate( FT_Vector* vec, - FT_Angle angle ); - - - /************************************************************************* - * - * @function: - * FT_Vector_Length - * - * @description: - * Return the length of a given vector. - * - * @input: - * vec :: - * The address of target vector. - * - * @return: - * The vector length, expressed in the same units that the original - * vector coordinates. - * - */ - FT_EXPORT( FT_Fixed ) - FT_Vector_Length( FT_Vector* vec ); - - - /************************************************************************* - * - * @function: - * FT_Vector_Polarize - * - * @description: - * Compute both the length and angle of a given vector. - * - * @input: - * vec :: - * The address of source vector. - * - * @output: - * length :: - * The vector length. - * - * angle :: - * The vector angle. - * - */ - FT_EXPORT( void ) - FT_Vector_Polarize( FT_Vector* vec, - FT_Fixed *length, - FT_Angle *angle ); - - - /************************************************************************* - * - * @function: - * FT_Vector_From_Polar - * - * @description: - * Compute vector coordinates from a length and angle. - * - * @output: - * vec :: - * The address of source vector. - * - * @input: - * length :: - * The vector length. - * - * angle :: - * The vector angle. - * - */ - FT_EXPORT( void ) - FT_Vector_From_Polar( FT_Vector* vec, - FT_Fixed length, - FT_Angle angle ); - - /* */ - - -FT_END_HEADER - -#endif /* __FTTRIGON_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/fttypes.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/fttypes.h deleted file mode 100644 index 3255527449..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/fttypes.h +++ /dev/null @@ -1,588 +0,0 @@ -/***************************************************************************/ -/* */ -/* fttypes.h */ -/* */ -/* FreeType simple types definitions (specification only). */ -/* */ -/* Copyright 1996-2002, 2004, 2006-2009, 2012 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __FTTYPES_H__ -#define __FTTYPES_H__ - - -#include <ft2build.h> -#include FT_CONFIG_CONFIG_H -#include FT_SYSTEM_H -#include FT_IMAGE_H - -#include <stddef.h> - - -FT_BEGIN_HEADER - - - /*************************************************************************/ - /* */ - /* <Section> */ - /* basic_types */ - /* */ - /* <Title> */ - /* Basic Data Types */ - /* */ - /* <Abstract> */ - /* The basic data types defined by the library. */ - /* */ - /* <Description> */ - /* This section contains the basic data types defined by FreeType~2, */ - /* ranging from simple scalar types to bitmap descriptors. More */ - /* font-specific structures are defined in a different section. */ - /* */ - /* <Order> */ - /* FT_Byte */ - /* FT_Bytes */ - /* FT_Char */ - /* FT_Int */ - /* FT_UInt */ - /* FT_Int16 */ - /* FT_UInt16 */ - /* FT_Int32 */ - /* FT_UInt32 */ - /* FT_Short */ - /* FT_UShort */ - /* FT_Long */ - /* FT_ULong */ - /* FT_Bool */ - /* FT_Offset */ - /* FT_PtrDist */ - /* FT_String */ - /* FT_Tag */ - /* FT_Error */ - /* FT_Fixed */ - /* FT_Pointer */ - /* FT_Pos */ - /* FT_Vector */ - /* FT_BBox */ - /* FT_Matrix */ - /* FT_FWord */ - /* FT_UFWord */ - /* FT_F2Dot14 */ - /* FT_UnitVector */ - /* FT_F26Dot6 */ - /* */ - /* */ - /* FT_Generic */ - /* FT_Generic_Finalizer */ - /* */ - /* FT_Bitmap */ - /* FT_Pixel_Mode */ - /* FT_Palette_Mode */ - /* FT_Glyph_Format */ - /* FT_IMAGE_TAG */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FT_Bool */ - /* */ - /* <Description> */ - /* A typedef of unsigned char, used for simple booleans. As usual, */ - /* values 1 and~0 represent true and false, respectively. */ - /* */ - typedef unsigned char FT_Bool; - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FT_FWord */ - /* */ - /* <Description> */ - /* A signed 16-bit integer used to store a distance in original font */ - /* units. */ - /* */ - typedef signed short FT_FWord; /* distance in FUnits */ - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FT_UFWord */ - /* */ - /* <Description> */ - /* An unsigned 16-bit integer used to store a distance in original */ - /* font units. */ - /* */ - typedef unsigned short FT_UFWord; /* unsigned distance */ - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FT_Char */ - /* */ - /* <Description> */ - /* A simple typedef for the _signed_ char type. */ - /* */ - typedef signed char FT_Char; - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FT_Byte */ - /* */ - /* <Description> */ - /* A simple typedef for the _unsigned_ char type. */ - /* */ - typedef unsigned char FT_Byte; - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FT_Bytes */ - /* */ - /* <Description> */ - /* A typedef for constant memory areas. */ - /* */ - typedef const FT_Byte* FT_Bytes; - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FT_Tag */ - /* */ - /* <Description> */ - /* A typedef for 32-bit tags (as used in the SFNT format). */ - /* */ - typedef FT_UInt32 FT_Tag; - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FT_String */ - /* */ - /* <Description> */ - /* A simple typedef for the char type, usually used for strings. */ - /* */ - typedef char FT_String; - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FT_Short */ - /* */ - /* <Description> */ - /* A typedef for signed short. */ - /* */ - typedef signed short FT_Short; - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FT_UShort */ - /* */ - /* <Description> */ - /* A typedef for unsigned short. */ - /* */ - typedef unsigned short FT_UShort; - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FT_Int */ - /* */ - /* <Description> */ - /* A typedef for the int type. */ - /* */ - typedef signed int FT_Int; - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FT_UInt */ - /* */ - /* <Description> */ - /* A typedef for the unsigned int type. */ - /* */ - typedef unsigned int FT_UInt; - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FT_Long */ - /* */ - /* <Description> */ - /* A typedef for signed long. */ - /* */ - typedef signed long FT_Long; - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FT_ULong */ - /* */ - /* <Description> */ - /* A typedef for unsigned long. */ - /* */ - typedef unsigned long FT_ULong; - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FT_F2Dot14 */ - /* */ - /* <Description> */ - /* A signed 2.14 fixed float type used for unit vectors. */ - /* */ - typedef signed short FT_F2Dot14; - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FT_F26Dot6 */ - /* */ - /* <Description> */ - /* A signed 26.6 fixed float type used for vectorial pixel */ - /* coordinates. */ - /* */ - typedef signed long FT_F26Dot6; - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FT_Fixed */ - /* */ - /* <Description> */ - /* This type is used to store 16.16 fixed float values, like scaling */ - /* values or matrix coefficients. */ - /* */ - typedef signed long FT_Fixed; - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FT_Error */ - /* */ - /* <Description> */ - /* The FreeType error code type. A value of~0 is always interpreted */ - /* as a successful operation. */ - /* */ - typedef int FT_Error; - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FT_Pointer */ - /* */ - /* <Description> */ - /* A simple typedef for a typeless pointer. */ - /* */ - typedef void* FT_Pointer; - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FT_Offset */ - /* */ - /* <Description> */ - /* This is equivalent to the ANSI~C `size_t' type, i.e., the largest */ - /* _unsigned_ integer type used to express a file size or position, */ - /* or a memory block size. */ - /* */ - typedef size_t FT_Offset; - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FT_PtrDist */ - /* */ - /* <Description> */ - /* This is equivalent to the ANSI~C `ptrdiff_t' type, i.e., the */ - /* largest _signed_ integer type used to express the distance */ - /* between two pointers. */ - /* */ - typedef ft_ptrdiff_t FT_PtrDist; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FT_UnitVector */ - /* */ - /* <Description> */ - /* A simple structure used to store a 2D vector unit vector. Uses */ - /* FT_F2Dot14 types. */ - /* */ - /* <Fields> */ - /* x :: Horizontal coordinate. */ - /* */ - /* y :: Vertical coordinate. */ - /* */ - typedef struct FT_UnitVector_ - { - FT_F2Dot14 x; - FT_F2Dot14 y; - - } FT_UnitVector; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FT_Matrix */ - /* */ - /* <Description> */ - /* A simple structure used to store a 2x2 matrix. Coefficients are */ - /* in 16.16 fixed float format. The computation performed is: */ - /* */ - /* { */ - /* x' = x*xx + y*xy */ - /* y' = x*yx + y*yy */ - /* } */ - /* */ - /* <Fields> */ - /* xx :: Matrix coefficient. */ - /* */ - /* xy :: Matrix coefficient. */ - /* */ - /* yx :: Matrix coefficient. */ - /* */ - /* yy :: Matrix coefficient. */ - /* */ - typedef struct FT_Matrix_ - { - FT_Fixed xx, xy; - FT_Fixed yx, yy; - - } FT_Matrix; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FT_Data */ - /* */ - /* <Description> */ - /* Read-only binary data represented as a pointer and a length. */ - /* */ - /* <Fields> */ - /* pointer :: The data. */ - /* */ - /* length :: The length of the data in bytes. */ - /* */ - typedef struct FT_Data_ - { - const FT_Byte* pointer; - FT_Int length; - - } FT_Data; - - - /*************************************************************************/ - /* */ - /* <FuncType> */ - /* FT_Generic_Finalizer */ - /* */ - /* <Description> */ - /* Describe a function used to destroy the `client' data of any */ - /* FreeType object. See the description of the @FT_Generic type for */ - /* details of usage. */ - /* */ - /* <Input> */ - /* The address of the FreeType object which is under finalization. */ - /* Its client data is accessed through its `generic' field. */ - /* */ - typedef void (*FT_Generic_Finalizer)(void* object); - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FT_Generic */ - /* */ - /* <Description> */ - /* Client applications often need to associate their own data to a */ - /* variety of FreeType core objects. For example, a text layout API */ - /* might want to associate a glyph cache to a given size object. */ - /* */ - /* Some FreeType object contains a `generic' field, of type */ - /* FT_Generic, which usage is left to client applications and font */ - /* servers. */ - /* */ - /* It can be used to store a pointer to client-specific data, as well */ - /* as the address of a `finalizer' function, which will be called by */ - /* FreeType when the object is destroyed (for example, the previous */ - /* client example would put the address of the glyph cache destructor */ - /* in the `finalizer' field). */ - /* */ - /* <Fields> */ - /* data :: A typeless pointer to any client-specified data. This */ - /* field is completely ignored by the FreeType library. */ - /* */ - /* finalizer :: A pointer to a `generic finalizer' function, which */ - /* will be called when the object is destroyed. If this */ - /* field is set to NULL, no code will be called. */ - /* */ - typedef struct FT_Generic_ - { - void* data; - FT_Generic_Finalizer finalizer; - - } FT_Generic; - - - /*************************************************************************/ - /* */ - /* <Macro> */ - /* FT_MAKE_TAG */ - /* */ - /* <Description> */ - /* This macro converts four-letter tags which are used to label */ - /* TrueType tables into an unsigned long to be used within FreeType. */ - /* */ - /* <Note> */ - /* The produced values *must* be 32-bit integers. Don't redefine */ - /* this macro. */ - /* */ -#define FT_MAKE_TAG( _x1, _x2, _x3, _x4 ) \ - (FT_Tag) \ - ( ( (FT_ULong)_x1 << 24 ) | \ - ( (FT_ULong)_x2 << 16 ) | \ - ( (FT_ULong)_x3 << 8 ) | \ - (FT_ULong)_x4 ) - - - /*************************************************************************/ - /*************************************************************************/ - /* */ - /* L I S T M A N A G E M E N T */ - /* */ - /*************************************************************************/ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* <Section> */ - /* list_processing */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FT_ListNode */ - /* */ - /* <Description> */ - /* Many elements and objects in FreeType are listed through an */ - /* @FT_List record (see @FT_ListRec). As its name suggests, an */ - /* FT_ListNode is a handle to a single list element. */ - /* */ - typedef struct FT_ListNodeRec_* FT_ListNode; - - - /*************************************************************************/ - /* */ - /* <Type> */ - /* FT_List */ - /* */ - /* <Description> */ - /* A handle to a list record (see @FT_ListRec). */ - /* */ - typedef struct FT_ListRec_* FT_List; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FT_ListNodeRec */ - /* */ - /* <Description> */ - /* A structure used to hold a single list element. */ - /* */ - /* <Fields> */ - /* prev :: The previous element in the list. NULL if first. */ - /* */ - /* next :: The next element in the list. NULL if last. */ - /* */ - /* data :: A typeless pointer to the listed object. */ - /* */ - typedef struct FT_ListNodeRec_ - { - FT_ListNode prev; - FT_ListNode next; - void* data; - - } FT_ListNodeRec; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FT_ListRec */ - /* */ - /* <Description> */ - /* A structure used to hold a simple doubly-linked list. These are */ - /* used in many parts of FreeType. */ - /* */ - /* <Fields> */ - /* head :: The head (first element) of doubly-linked list. */ - /* */ - /* tail :: The tail (last element) of doubly-linked list. */ - /* */ - typedef struct FT_ListRec_ - { - FT_ListNode head; - FT_ListNode tail; - - } FT_ListRec; - - - /* */ - -#define FT_IS_EMPTY( list ) ( (list).head == 0 ) - - /* return base error code (without module-specific prefix) */ -#define FT_ERROR_BASE( x ) ( (x) & 0xFF ) - - /* return module error code */ -#define FT_ERROR_MODULE( x ) ( (x) & 0xFF00U ) - -#define FT_BOOL( x ) ( (FT_Bool)( x ) ) - -FT_END_HEADER - -#endif /* __FTTYPES_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftwinfnt.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftwinfnt.h deleted file mode 100644 index ea33353536..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftwinfnt.h +++ /dev/null @@ -1,274 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftwinfnt.h */ -/* */ -/* FreeType API for accessing Windows fnt-specific data. */ -/* */ -/* Copyright 2003, 2004, 2008 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __FTWINFNT_H__ -#define __FTWINFNT_H__ - -#include <ft2build.h> -#include FT_FREETYPE_H - -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - - -FT_BEGIN_HEADER - - - /*************************************************************************/ - /* */ - /* <Section> */ - /* winfnt_fonts */ - /* */ - /* <Title> */ - /* Window FNT Files */ - /* */ - /* <Abstract> */ - /* Windows FNT specific API. */ - /* */ - /* <Description> */ - /* This section contains the declaration of Windows FNT specific */ - /* functions. */ - /* */ - /*************************************************************************/ - - - /************************************************************************* - * - * @enum: - * FT_WinFNT_ID_XXX - * - * @description: - * A list of valid values for the `charset' byte in - * @FT_WinFNT_HeaderRec. Exact mapping tables for the various cpXXXX - * encodings (except for cp1361) can be found at ftp://ftp.unicode.org - * in the MAPPINGS/VENDORS/MICSFT/WINDOWS subdirectory. cp1361 is - * roughly a superset of MAPPINGS/OBSOLETE/EASTASIA/KSC/JOHAB.TXT. - * - * @values: - * FT_WinFNT_ID_DEFAULT :: - * This is used for font enumeration and font creation as a - * `don't care' value. Valid font files don't contain this value. - * When querying for information about the character set of the font - * that is currently selected into a specified device context, this - * return value (of the related Windows API) simply denotes failure. - * - * FT_WinFNT_ID_SYMBOL :: - * There is no known mapping table available. - * - * FT_WinFNT_ID_MAC :: - * Mac Roman encoding. - * - * FT_WinFNT_ID_OEM :: - * From Michael Pöttgen <michael@poettgen.de>: - * - * The `Windows Font Mapping' article says that FT_WinFNT_ID_OEM - * is used for the charset of vector fonts, like `modern.fon', - * `roman.fon', and `script.fon' on Windows. - * - * The `CreateFont' documentation says: The FT_WinFNT_ID_OEM value - * specifies a character set that is operating-system dependent. - * - * The `IFIMETRICS' documentation from the `Windows Driver - * Development Kit' says: This font supports an OEM-specific - * character set. The OEM character set is system dependent. - * - * In general OEM, as opposed to ANSI (i.e., cp1252), denotes the - * second default codepage that most international versions of - * Windows have. It is one of the OEM codepages from - * - * http://www.microsoft.com/globaldev/reference/cphome.mspx, - * - * and is used for the `DOS boxes', to support legacy applications. - * A German Windows version for example usually uses ANSI codepage - * 1252 and OEM codepage 850. - * - * FT_WinFNT_ID_CP874 :: - * A superset of Thai TIS 620 and ISO 8859-11. - * - * FT_WinFNT_ID_CP932 :: - * A superset of Japanese Shift-JIS (with minor deviations). - * - * FT_WinFNT_ID_CP936 :: - * A superset of simplified Chinese GB 2312-1980 (with different - * ordering and minor deviations). - * - * FT_WinFNT_ID_CP949 :: - * A superset of Korean Hangul KS~C 5601-1987 (with different - * ordering and minor deviations). - * - * FT_WinFNT_ID_CP950 :: - * A superset of traditional Chinese Big~5 ETen (with different - * ordering and minor deviations). - * - * FT_WinFNT_ID_CP1250 :: - * A superset of East European ISO 8859-2 (with slightly different - * ordering). - * - * FT_WinFNT_ID_CP1251 :: - * A superset of Russian ISO 8859-5 (with different ordering). - * - * FT_WinFNT_ID_CP1252 :: - * ANSI encoding. A superset of ISO 8859-1. - * - * FT_WinFNT_ID_CP1253 :: - * A superset of Greek ISO 8859-7 (with minor modifications). - * - * FT_WinFNT_ID_CP1254 :: - * A superset of Turkish ISO 8859-9. - * - * FT_WinFNT_ID_CP1255 :: - * A superset of Hebrew ISO 8859-8 (with some modifications). - * - * FT_WinFNT_ID_CP1256 :: - * A superset of Arabic ISO 8859-6 (with different ordering). - * - * FT_WinFNT_ID_CP1257 :: - * A superset of Baltic ISO 8859-13 (with some deviations). - * - * FT_WinFNT_ID_CP1258 :: - * For Vietnamese. This encoding doesn't cover all necessary - * characters. - * - * FT_WinFNT_ID_CP1361 :: - * Korean (Johab). - */ - -#define FT_WinFNT_ID_CP1252 0 -#define FT_WinFNT_ID_DEFAULT 1 -#define FT_WinFNT_ID_SYMBOL 2 -#define FT_WinFNT_ID_MAC 77 -#define FT_WinFNT_ID_CP932 128 -#define FT_WinFNT_ID_CP949 129 -#define FT_WinFNT_ID_CP1361 130 -#define FT_WinFNT_ID_CP936 134 -#define FT_WinFNT_ID_CP950 136 -#define FT_WinFNT_ID_CP1253 161 -#define FT_WinFNT_ID_CP1254 162 -#define FT_WinFNT_ID_CP1258 163 -#define FT_WinFNT_ID_CP1255 177 -#define FT_WinFNT_ID_CP1256 178 -#define FT_WinFNT_ID_CP1257 186 -#define FT_WinFNT_ID_CP1251 204 -#define FT_WinFNT_ID_CP874 222 -#define FT_WinFNT_ID_CP1250 238 -#define FT_WinFNT_ID_OEM 255 - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FT_WinFNT_HeaderRec */ - /* */ - /* <Description> */ - /* Windows FNT Header info. */ - /* */ - typedef struct FT_WinFNT_HeaderRec_ - { - FT_UShort version; - FT_ULong file_size; - FT_Byte copyright[60]; - FT_UShort file_type; - FT_UShort nominal_point_size; - FT_UShort vertical_resolution; - FT_UShort horizontal_resolution; - FT_UShort ascent; - FT_UShort internal_leading; - FT_UShort external_leading; - FT_Byte italic; - FT_Byte underline; - FT_Byte strike_out; - FT_UShort weight; - FT_Byte charset; - FT_UShort pixel_width; - FT_UShort pixel_height; - FT_Byte pitch_and_family; - FT_UShort avg_width; - FT_UShort max_width; - FT_Byte first_char; - FT_Byte last_char; - FT_Byte default_char; - FT_Byte break_char; - FT_UShort bytes_per_row; - FT_ULong device_offset; - FT_ULong face_name_offset; - FT_ULong bits_pointer; - FT_ULong bits_offset; - FT_Byte reserved; - FT_ULong flags; - FT_UShort A_space; - FT_UShort B_space; - FT_UShort C_space; - FT_UShort color_table_offset; - FT_ULong reserved1[4]; - - } FT_WinFNT_HeaderRec; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FT_WinFNT_Header */ - /* */ - /* <Description> */ - /* A handle to an @FT_WinFNT_HeaderRec structure. */ - /* */ - typedef struct FT_WinFNT_HeaderRec_* FT_WinFNT_Header; - - - /********************************************************************** - * - * @function: - * FT_Get_WinFNT_Header - * - * @description: - * Retrieve a Windows FNT font info header. - * - * @input: - * face :: A handle to the input face. - * - * @output: - * aheader :: The WinFNT header. - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * This function only works with Windows FNT faces, returning an error - * otherwise. - */ - FT_EXPORT( FT_Error ) - FT_Get_WinFNT_Header( FT_Face face, - FT_WinFNT_HeaderRec *aheader ); - - - /* */ - -FT_END_HEADER - -#endif /* __FTWINFNT_H__ */ - - -/* END */ - - -/* Local Variables: */ -/* coding: utf-8 */ -/* End: */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftxf86.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftxf86.h deleted file mode 100644 index 8c68afdcc5..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ftxf86.h +++ /dev/null @@ -1,83 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftxf86.h */ -/* */ -/* Support functions for X11. */ -/* */ -/* Copyright 2002, 2003, 2004, 2006, 2007 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __FTXF86_H__ -#define __FTXF86_H__ - -#include <ft2build.h> -#include FT_FREETYPE_H - -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - - -FT_BEGIN_HEADER - - - /*************************************************************************/ - /* */ - /* <Section> */ - /* font_formats */ - /* */ - /* <Title> */ - /* Font Formats */ - /* */ - /* <Abstract> */ - /* Getting the font format. */ - /* */ - /* <Description> */ - /* The single function in this section can be used to get the font */ - /* format. Note that this information is not needed normally; */ - /* however, there are special cases (like in PDF devices) where it is */ - /* important to differentiate, in spite of FreeType's uniform API. */ - /* */ - /* This function is in the X11/xf86 namespace for historical reasons */ - /* and in no way depends on that windowing system. */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Get_X11_Font_Format */ - /* */ - /* <Description> */ - /* Return a string describing the format of a given face, using values */ - /* which can be used as an X11 FONT_PROPERTY. Possible values are */ - /* `TrueType', `Type~1', `BDF', `PCF', `Type~42', `CID~Type~1', `CFF', */ - /* `PFR', and `Windows~FNT'. */ - /* */ - /* <Input> */ - /* face :: */ - /* Input face handle. */ - /* */ - /* <Return> */ - /* Font format string. NULL in case of error. */ - /* */ - FT_EXPORT( const char* ) - FT_Get_X11_Font_Format( FT_Face face ); - - /* */ - -FT_END_HEADER - -#endif /* __FTXF86_H__ */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/t1tables.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/t1tables.h deleted file mode 100644 index a14255e5f5..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/t1tables.h +++ /dev/null @@ -1,662 +0,0 @@ -/***************************************************************************/ -/* */ -/* t1tables.h */ -/* */ -/* Basic Type 1/Type 2 tables definitions and interface (specification */ -/* only). */ -/* */ -/* Copyright 1996-2004, 2006, 2008, 2009, 2011 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __T1TABLES_H__ -#define __T1TABLES_H__ - - -#include <ft2build.h> -#include FT_FREETYPE_H - -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - - -FT_BEGIN_HEADER - - - /*************************************************************************/ - /* */ - /* <Section> */ - /* type1_tables */ - /* */ - /* <Title> */ - /* Type 1 Tables */ - /* */ - /* <Abstract> */ - /* Type~1 (PostScript) specific font tables. */ - /* */ - /* <Description> */ - /* This section contains the definition of Type 1-specific tables, */ - /* including structures related to other PostScript font formats. */ - /* */ - /*************************************************************************/ - - - /* Note that we separate font data in PS_FontInfoRec and PS_PrivateRec */ - /* structures in order to support Multiple Master fonts. */ - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* PS_FontInfoRec */ - /* */ - /* <Description> */ - /* A structure used to model a Type~1 or Type~2 FontInfo dictionary. */ - /* Note that for Multiple Master fonts, each instance has its own */ - /* FontInfo dictionary. */ - /* */ - typedef struct PS_FontInfoRec_ - { - FT_String* version; - FT_String* notice; - FT_String* full_name; - FT_String* family_name; - FT_String* weight; - FT_Long italic_angle; - FT_Bool is_fixed_pitch; - FT_Short underline_position; - FT_UShort underline_thickness; - - } PS_FontInfoRec; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* PS_FontInfo */ - /* */ - /* <Description> */ - /* A handle to a @PS_FontInfoRec structure. */ - /* */ - typedef struct PS_FontInfoRec_* PS_FontInfo; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* T1_FontInfo */ - /* */ - /* <Description> */ - /* This type is equivalent to @PS_FontInfoRec. It is deprecated but */ - /* kept to maintain source compatibility between various versions of */ - /* FreeType. */ - /* */ - typedef PS_FontInfoRec T1_FontInfo; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* PS_PrivateRec */ - /* */ - /* <Description> */ - /* A structure used to model a Type~1 or Type~2 private dictionary. */ - /* Note that for Multiple Master fonts, each instance has its own */ - /* Private dictionary. */ - /* */ - typedef struct PS_PrivateRec_ - { - FT_Int unique_id; - FT_Int lenIV; - - FT_Byte num_blue_values; - FT_Byte num_other_blues; - FT_Byte num_family_blues; - FT_Byte num_family_other_blues; - - FT_Short blue_values[14]; - FT_Short other_blues[10]; - - FT_Short family_blues [14]; - FT_Short family_other_blues[10]; - - FT_Fixed blue_scale; - FT_Int blue_shift; - FT_Int blue_fuzz; - - FT_UShort standard_width[1]; - FT_UShort standard_height[1]; - - FT_Byte num_snap_widths; - FT_Byte num_snap_heights; - FT_Bool force_bold; - FT_Bool round_stem_up; - - FT_Short snap_widths [13]; /* including std width */ - FT_Short snap_heights[13]; /* including std height */ - - FT_Fixed expansion_factor; - - FT_Long language_group; - FT_Long password; - - FT_Short min_feature[2]; - - } PS_PrivateRec; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* PS_Private */ - /* */ - /* <Description> */ - /* A handle to a @PS_PrivateRec structure. */ - /* */ - typedef struct PS_PrivateRec_* PS_Private; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* T1_Private */ - /* */ - /* <Description> */ - /* This type is equivalent to @PS_PrivateRec. It is deprecated but */ - /* kept to maintain source compatibility between various versions of */ - /* FreeType. */ - /* */ - typedef PS_PrivateRec T1_Private; - - - /*************************************************************************/ - /* */ - /* <Enum> */ - /* T1_Blend_Flags */ - /* */ - /* <Description> */ - /* A set of flags used to indicate which fields are present in a */ - /* given blend dictionary (font info or private). Used to support */ - /* Multiple Masters fonts. */ - /* */ - typedef enum T1_Blend_Flags_ - { - /*# required fields in a FontInfo blend dictionary */ - T1_BLEND_UNDERLINE_POSITION = 0, - T1_BLEND_UNDERLINE_THICKNESS, - T1_BLEND_ITALIC_ANGLE, - - /*# required fields in a Private blend dictionary */ - T1_BLEND_BLUE_VALUES, - T1_BLEND_OTHER_BLUES, - T1_BLEND_STANDARD_WIDTH, - T1_BLEND_STANDARD_HEIGHT, - T1_BLEND_STEM_SNAP_WIDTHS, - T1_BLEND_STEM_SNAP_HEIGHTS, - T1_BLEND_BLUE_SCALE, - T1_BLEND_BLUE_SHIFT, - T1_BLEND_FAMILY_BLUES, - T1_BLEND_FAMILY_OTHER_BLUES, - T1_BLEND_FORCE_BOLD, - - /*# never remove */ - T1_BLEND_MAX - - } T1_Blend_Flags; - - /* */ - - - /*# backwards compatible definitions */ -#define t1_blend_underline_position T1_BLEND_UNDERLINE_POSITION -#define t1_blend_underline_thickness T1_BLEND_UNDERLINE_THICKNESS -#define t1_blend_italic_angle T1_BLEND_ITALIC_ANGLE -#define t1_blend_blue_values T1_BLEND_BLUE_VALUES -#define t1_blend_other_blues T1_BLEND_OTHER_BLUES -#define t1_blend_standard_widths T1_BLEND_STANDARD_WIDTH -#define t1_blend_standard_height T1_BLEND_STANDARD_HEIGHT -#define t1_blend_stem_snap_widths T1_BLEND_STEM_SNAP_WIDTHS -#define t1_blend_stem_snap_heights T1_BLEND_STEM_SNAP_HEIGHTS -#define t1_blend_blue_scale T1_BLEND_BLUE_SCALE -#define t1_blend_blue_shift T1_BLEND_BLUE_SHIFT -#define t1_blend_family_blues T1_BLEND_FAMILY_BLUES -#define t1_blend_family_other_blues T1_BLEND_FAMILY_OTHER_BLUES -#define t1_blend_force_bold T1_BLEND_FORCE_BOLD -#define t1_blend_max T1_BLEND_MAX - - - /* maximum number of Multiple Masters designs, as defined in the spec */ -#define T1_MAX_MM_DESIGNS 16 - - /* maximum number of Multiple Masters axes, as defined in the spec */ -#define T1_MAX_MM_AXIS 4 - - /* maximum number of elements in a design map */ -#define T1_MAX_MM_MAP_POINTS 20 - - - /* this structure is used to store the BlendDesignMap entry for an axis */ - typedef struct PS_DesignMap_ - { - FT_Byte num_points; - FT_Long* design_points; - FT_Fixed* blend_points; - - } PS_DesignMapRec, *PS_DesignMap; - - /* backwards-compatible definition */ - typedef PS_DesignMapRec T1_DesignMap; - - - typedef struct PS_BlendRec_ - { - FT_UInt num_designs; - FT_UInt num_axis; - - FT_String* axis_names[T1_MAX_MM_AXIS]; - FT_Fixed* design_pos[T1_MAX_MM_DESIGNS]; - PS_DesignMapRec design_map[T1_MAX_MM_AXIS]; - - FT_Fixed* weight_vector; - FT_Fixed* default_weight_vector; - - PS_FontInfo font_infos[T1_MAX_MM_DESIGNS + 1]; - PS_Private privates [T1_MAX_MM_DESIGNS + 1]; - - FT_ULong blend_bitflags; - - FT_BBox* bboxes [T1_MAX_MM_DESIGNS + 1]; - - /* since 2.3.0 */ - - /* undocumented, optional: the default design instance; */ - /* corresponds to default_weight_vector -- */ - /* num_default_design_vector == 0 means it is not present */ - /* in the font and associated metrics files */ - FT_UInt default_design_vector[T1_MAX_MM_DESIGNS]; - FT_UInt num_default_design_vector; - - } PS_BlendRec, *PS_Blend; - - - /* backwards-compatible definition */ - typedef PS_BlendRec T1_Blend; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* CID_FaceDictRec */ - /* */ - /* <Description> */ - /* A structure used to represent data in a CID top-level dictionary. */ - /* */ - typedef struct CID_FaceDictRec_ - { - PS_PrivateRec private_dict; - - FT_UInt len_buildchar; - FT_Fixed forcebold_threshold; - FT_Pos stroke_width; - FT_Fixed expansion_factor; - - FT_Byte paint_type; - FT_Byte font_type; - FT_Matrix font_matrix; - FT_Vector font_offset; - - FT_UInt num_subrs; - FT_ULong subrmap_offset; - FT_Int sd_bytes; - - } CID_FaceDictRec; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* CID_FaceDict */ - /* */ - /* <Description> */ - /* A handle to a @CID_FaceDictRec structure. */ - /* */ - typedef struct CID_FaceDictRec_* CID_FaceDict; - - /* */ - - - /* backwards-compatible definition */ - typedef CID_FaceDictRec CID_FontDict; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* CID_FaceInfoRec */ - /* */ - /* <Description> */ - /* A structure used to represent CID Face information. */ - /* */ - typedef struct CID_FaceInfoRec_ - { - FT_String* cid_font_name; - FT_Fixed cid_version; - FT_Int cid_font_type; - - FT_String* registry; - FT_String* ordering; - FT_Int supplement; - - PS_FontInfoRec font_info; - FT_BBox font_bbox; - FT_ULong uid_base; - - FT_Int num_xuid; - FT_ULong xuid[16]; - - FT_ULong cidmap_offset; - FT_Int fd_bytes; - FT_Int gd_bytes; - FT_ULong cid_count; - - FT_Int num_dicts; - CID_FaceDict font_dicts; - - FT_ULong data_offset; - - } CID_FaceInfoRec; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* CID_FaceInfo */ - /* */ - /* <Description> */ - /* A handle to a @CID_FaceInfoRec structure. */ - /* */ - typedef struct CID_FaceInfoRec_* CID_FaceInfo; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* CID_Info */ - /* */ - /* <Description> */ - /* This type is equivalent to @CID_FaceInfoRec. It is deprecated but */ - /* kept to maintain source compatibility between various versions of */ - /* FreeType. */ - /* */ - typedef CID_FaceInfoRec CID_Info; - - - /************************************************************************ - * - * @function: - * FT_Has_PS_Glyph_Names - * - * @description: - * Return true if a given face provides reliable PostScript glyph - * names. This is similar to using the @FT_HAS_GLYPH_NAMES macro, - * except that certain fonts (mostly TrueType) contain incorrect - * glyph name tables. - * - * When this function returns true, the caller is sure that the glyph - * names returned by @FT_Get_Glyph_Name are reliable. - * - * @input: - * face :: - * face handle - * - * @return: - * Boolean. True if glyph names are reliable. - * - */ - FT_EXPORT( FT_Int ) - FT_Has_PS_Glyph_Names( FT_Face face ); - - - /************************************************************************ - * - * @function: - * FT_Get_PS_Font_Info - * - * @description: - * Retrieve the @PS_FontInfoRec structure corresponding to a given - * PostScript font. - * - * @input: - * face :: - * PostScript face handle. - * - * @output: - * afont_info :: - * Output font info structure pointer. - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * The string pointers within the font info structure are owned by - * the face and don't need to be freed by the caller. - * - * If the font's format is not PostScript-based, this function will - * return the `FT_Err_Invalid_Argument' error code. - * - */ - FT_EXPORT( FT_Error ) - FT_Get_PS_Font_Info( FT_Face face, - PS_FontInfo afont_info ); - - - /************************************************************************ - * - * @function: - * FT_Get_PS_Font_Private - * - * @description: - * Retrieve the @PS_PrivateRec structure corresponding to a given - * PostScript font. - * - * @input: - * face :: - * PostScript face handle. - * - * @output: - * afont_private :: - * Output private dictionary structure pointer. - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * The string pointers within the @PS_PrivateRec structure are owned by - * the face and don't need to be freed by the caller. - * - * If the font's format is not PostScript-based, this function returns - * the `FT_Err_Invalid_Argument' error code. - * - */ - FT_EXPORT( FT_Error ) - FT_Get_PS_Font_Private( FT_Face face, - PS_Private afont_private ); - - - /*************************************************************************/ - /* */ - /* <Enum> */ - /* T1_EncodingType */ - /* */ - /* <Description> */ - /* An enumeration describing the `Encoding' entry in a Type 1 */ - /* dictionary. */ - /* */ - typedef enum T1_EncodingType_ - { - T1_ENCODING_TYPE_NONE = 0, - T1_ENCODING_TYPE_ARRAY, - T1_ENCODING_TYPE_STANDARD, - T1_ENCODING_TYPE_ISOLATIN1, - T1_ENCODING_TYPE_EXPERT - - } T1_EncodingType; - - - /*************************************************************************/ - /* */ - /* <Enum> */ - /* PS_Dict_Keys */ - /* */ - /* <Description> */ - /* An enumeration used in calls to @FT_Get_PS_Font_Value to identify */ - /* the Type~1 dictionary entry to retrieve. */ - /* */ - typedef enum PS_Dict_Keys_ - { - /* conventionally in the font dictionary */ - PS_DICT_FONT_TYPE, /* FT_Byte */ - PS_DICT_FONT_MATRIX, /* FT_Fixed */ - PS_DICT_FONT_BBOX, /* FT_Fixed */ - PS_DICT_PAINT_TYPE, /* FT_Byte */ - PS_DICT_FONT_NAME, /* FT_String* */ - PS_DICT_UNIQUE_ID, /* FT_Int */ - PS_DICT_NUM_CHAR_STRINGS, /* FT_Int */ - PS_DICT_CHAR_STRING_KEY, /* FT_String* */ - PS_DICT_CHAR_STRING, /* FT_String* */ - PS_DICT_ENCODING_TYPE, /* T1_EncodingType */ - PS_DICT_ENCODING_ENTRY, /* FT_String* */ - - /* conventionally in the font Private dictionary */ - PS_DICT_NUM_SUBRS, /* FT_Int */ - PS_DICT_SUBR, /* FT_String* */ - PS_DICT_STD_HW, /* FT_UShort */ - PS_DICT_STD_VW, /* FT_UShort */ - PS_DICT_NUM_BLUE_VALUES, /* FT_Byte */ - PS_DICT_BLUE_VALUE, /* FT_Short */ - PS_DICT_BLUE_FUZZ, /* FT_Int */ - PS_DICT_NUM_OTHER_BLUES, /* FT_Byte */ - PS_DICT_OTHER_BLUE, /* FT_Short */ - PS_DICT_NUM_FAMILY_BLUES, /* FT_Byte */ - PS_DICT_FAMILY_BLUE, /* FT_Short */ - PS_DICT_NUM_FAMILY_OTHER_BLUES, /* FT_Byte */ - PS_DICT_FAMILY_OTHER_BLUE, /* FT_Short */ - PS_DICT_BLUE_SCALE, /* FT_Fixed */ - PS_DICT_BLUE_SHIFT, /* FT_Int */ - PS_DICT_NUM_STEM_SNAP_H, /* FT_Byte */ - PS_DICT_STEM_SNAP_H, /* FT_Short */ - PS_DICT_NUM_STEM_SNAP_V, /* FT_Byte */ - PS_DICT_STEM_SNAP_V, /* FT_Short */ - PS_DICT_FORCE_BOLD, /* FT_Bool */ - PS_DICT_RND_STEM_UP, /* FT_Bool */ - PS_DICT_MIN_FEATURE, /* FT_Short */ - PS_DICT_LEN_IV, /* FT_Int */ - PS_DICT_PASSWORD, /* FT_Long */ - PS_DICT_LANGUAGE_GROUP, /* FT_Long */ - - /* conventionally in the font FontInfo dictionary */ - PS_DICT_VERSION, /* FT_String* */ - PS_DICT_NOTICE, /* FT_String* */ - PS_DICT_FULL_NAME, /* FT_String* */ - PS_DICT_FAMILY_NAME, /* FT_String* */ - PS_DICT_WEIGHT, /* FT_String* */ - PS_DICT_IS_FIXED_PITCH, /* FT_Bool */ - PS_DICT_UNDERLINE_POSITION, /* FT_Short */ - PS_DICT_UNDERLINE_THICKNESS, /* FT_UShort */ - PS_DICT_FS_TYPE, /* FT_UShort */ - PS_DICT_ITALIC_ANGLE, /* FT_Long */ - - PS_DICT_MAX = PS_DICT_ITALIC_ANGLE - - } PS_Dict_Keys; - - - /************************************************************************ - * - * @function: - * FT_Get_PS_Font_Value - * - * @description: - * Retrieve the value for the supplied key from a PostScript font. - * - * @input: - * face :: - * PostScript face handle. - * - * key :: - * An enumeration value representing the dictionary key to retrieve. - * - * idx :: - * For array values, this specifies the index to be returned. - * - * value :: - * A pointer to memory into which to write the value. - * - * valen_len :: - * The size, in bytes, of the memory supplied for the value. - * - * @output: - * value :: - * The value matching the above key, if it exists. - * - * @return: - * The amount of memory (in bytes) required to hold the requested - * value (if it exists, -1 otherwise). - * - * @note: - * The values returned are not pointers into the internal structures of - * the face, but are `fresh' copies, so that the memory containing them - * belongs to the calling application. This also enforces the - * `read-only' nature of these values, i.e., this function cannot be - * used to manipulate the face. - * - * `value' is a void pointer because the values returned can be of - * various types. - * - * If either `value' is NULL or `value_len' is too small, just the - * required memory size for the requested entry is returned. - * - * The `idx' parameter is used, not only to retrieve elements of, for - * example, the FontMatrix or FontBBox, but also to retrieve name keys - * from the CharStrings dictionary, and the charstrings themselves. It - * is ignored for atomic values. - * - * PS_DICT_BLUE_SCALE returns a value that is scaled up by 1000. To - * get the value as in the font stream, you need to divide by - * 65536000.0 (to remove the FT_Fixed scale, and the x1000 scale). - * - * IMPORTANT: Only key/value pairs read by the FreeType interpreter can - * be retrieved. So, for example, PostScript procedures such as NP, - * ND, and RD are not available. Arbitrary keys are, obviously, not be - * available either. - * - * If the font's format is not PostScript-based, this function returns - * the `FT_Err_Invalid_Argument' error code. - * - */ - FT_EXPORT( FT_Long ) - FT_Get_PS_Font_Value( FT_Face face, - PS_Dict_Keys key, - FT_UInt idx, - void *value, - FT_Long value_len ); - - /* */ - -FT_END_HEADER - -#endif /* __T1TABLES_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ttnameid.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ttnameid.h deleted file mode 100644 index 66aef0432e..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ttnameid.h +++ /dev/null @@ -1,1247 +0,0 @@ -/***************************************************************************/ -/* */ -/* ttnameid.h */ -/* */ -/* TrueType name ID definitions (specification only). */ -/* */ -/* Copyright 1996-2002, 2003, 2004, 2006, 2007, 2008 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __TTNAMEID_H__ -#define __TTNAMEID_H__ - - -#include <ft2build.h> - - -FT_BEGIN_HEADER - - - /*************************************************************************/ - /* */ - /* <Section> */ - /* truetype_tables */ - /* */ - - - /*************************************************************************/ - /* */ - /* Possible values for the `platform' identifier code in the name */ - /* records of the TTF `name' table. */ - /* */ - /*************************************************************************/ - - - /*********************************************************************** - * - * @enum: - * TT_PLATFORM_XXX - * - * @description: - * A list of valid values for the `platform_id' identifier code in - * @FT_CharMapRec and @FT_SfntName structures. - * - * @values: - * TT_PLATFORM_APPLE_UNICODE :: - * Used by Apple to indicate a Unicode character map and/or name entry. - * See @TT_APPLE_ID_XXX for corresponding `encoding_id' values. Note - * that name entries in this format are coded as big-endian UCS-2 - * character codes _only_. - * - * TT_PLATFORM_MACINTOSH :: - * Used by Apple to indicate a MacOS-specific charmap and/or name entry. - * See @TT_MAC_ID_XXX for corresponding `encoding_id' values. Note that - * most TrueType fonts contain an Apple roman charmap to be usable on - * MacOS systems (even if they contain a Microsoft charmap as well). - * - * TT_PLATFORM_ISO :: - * This value was used to specify ISO/IEC 10646 charmaps. It is however - * now deprecated. See @TT_ISO_ID_XXX for a list of corresponding - * `encoding_id' values. - * - * TT_PLATFORM_MICROSOFT :: - * Used by Microsoft to indicate Windows-specific charmaps. See - * @TT_MS_ID_XXX for a list of corresponding `encoding_id' values. - * Note that most fonts contain a Unicode charmap using - * (TT_PLATFORM_MICROSOFT, @TT_MS_ID_UNICODE_CS). - * - * TT_PLATFORM_CUSTOM :: - * Used to indicate application-specific charmaps. - * - * TT_PLATFORM_ADOBE :: - * This value isn't part of any font format specification, but is used - * by FreeType to report Adobe-specific charmaps in an @FT_CharMapRec - * structure. See @TT_ADOBE_ID_XXX. - */ - -#define TT_PLATFORM_APPLE_UNICODE 0 -#define TT_PLATFORM_MACINTOSH 1 -#define TT_PLATFORM_ISO 2 /* deprecated */ -#define TT_PLATFORM_MICROSOFT 3 -#define TT_PLATFORM_CUSTOM 4 -#define TT_PLATFORM_ADOBE 7 /* artificial */ - - - /*********************************************************************** - * - * @enum: - * TT_APPLE_ID_XXX - * - * @description: - * A list of valid values for the `encoding_id' for - * @TT_PLATFORM_APPLE_UNICODE charmaps and name entries. - * - * @values: - * TT_APPLE_ID_DEFAULT :: - * Unicode version 1.0. - * - * TT_APPLE_ID_UNICODE_1_1 :: - * Unicode 1.1; specifies Hangul characters starting at U+34xx. - * - * TT_APPLE_ID_ISO_10646 :: - * Deprecated (identical to preceding). - * - * TT_APPLE_ID_UNICODE_2_0 :: - * Unicode 2.0 and beyond (UTF-16 BMP only). - * - * TT_APPLE_ID_UNICODE_32 :: - * Unicode 3.1 and beyond, using UTF-32. - * - * TT_APPLE_ID_VARIANT_SELECTOR :: - * From Adobe, not Apple. Not a normal cmap. Specifies variations - * on a real cmap. - */ - -#define TT_APPLE_ID_DEFAULT 0 /* Unicode 1.0 */ -#define TT_APPLE_ID_UNICODE_1_1 1 /* specify Hangul at U+34xx */ -#define TT_APPLE_ID_ISO_10646 2 /* deprecated */ -#define TT_APPLE_ID_UNICODE_2_0 3 /* or later */ -#define TT_APPLE_ID_UNICODE_32 4 /* 2.0 or later, full repertoire */ -#define TT_APPLE_ID_VARIANT_SELECTOR 5 /* variation selector data */ - - - /*********************************************************************** - * - * @enum: - * TT_MAC_ID_XXX - * - * @description: - * A list of valid values for the `encoding_id' for - * @TT_PLATFORM_MACINTOSH charmaps and name entries. - * - * @values: - * TT_MAC_ID_ROMAN :: - * TT_MAC_ID_JAPANESE :: - * TT_MAC_ID_TRADITIONAL_CHINESE :: - * TT_MAC_ID_KOREAN :: - * TT_MAC_ID_ARABIC :: - * TT_MAC_ID_HEBREW :: - * TT_MAC_ID_GREEK :: - * TT_MAC_ID_RUSSIAN :: - * TT_MAC_ID_RSYMBOL :: - * TT_MAC_ID_DEVANAGARI :: - * TT_MAC_ID_GURMUKHI :: - * TT_MAC_ID_GUJARATI :: - * TT_MAC_ID_ORIYA :: - * TT_MAC_ID_BENGALI :: - * TT_MAC_ID_TAMIL :: - * TT_MAC_ID_TELUGU :: - * TT_MAC_ID_KANNADA :: - * TT_MAC_ID_MALAYALAM :: - * TT_MAC_ID_SINHALESE :: - * TT_MAC_ID_BURMESE :: - * TT_MAC_ID_KHMER :: - * TT_MAC_ID_THAI :: - * TT_MAC_ID_LAOTIAN :: - * TT_MAC_ID_GEORGIAN :: - * TT_MAC_ID_ARMENIAN :: - * TT_MAC_ID_MALDIVIAN :: - * TT_MAC_ID_SIMPLIFIED_CHINESE :: - * TT_MAC_ID_TIBETAN :: - * TT_MAC_ID_MONGOLIAN :: - * TT_MAC_ID_GEEZ :: - * TT_MAC_ID_SLAVIC :: - * TT_MAC_ID_VIETNAMESE :: - * TT_MAC_ID_SINDHI :: - * TT_MAC_ID_UNINTERP :: - */ - -#define TT_MAC_ID_ROMAN 0 -#define TT_MAC_ID_JAPANESE 1 -#define TT_MAC_ID_TRADITIONAL_CHINESE 2 -#define TT_MAC_ID_KOREAN 3 -#define TT_MAC_ID_ARABIC 4 -#define TT_MAC_ID_HEBREW 5 -#define TT_MAC_ID_GREEK 6 -#define TT_MAC_ID_RUSSIAN 7 -#define TT_MAC_ID_RSYMBOL 8 -#define TT_MAC_ID_DEVANAGARI 9 -#define TT_MAC_ID_GURMUKHI 10 -#define TT_MAC_ID_GUJARATI 11 -#define TT_MAC_ID_ORIYA 12 -#define TT_MAC_ID_BENGALI 13 -#define TT_MAC_ID_TAMIL 14 -#define TT_MAC_ID_TELUGU 15 -#define TT_MAC_ID_KANNADA 16 -#define TT_MAC_ID_MALAYALAM 17 -#define TT_MAC_ID_SINHALESE 18 -#define TT_MAC_ID_BURMESE 19 -#define TT_MAC_ID_KHMER 20 -#define TT_MAC_ID_THAI 21 -#define TT_MAC_ID_LAOTIAN 22 -#define TT_MAC_ID_GEORGIAN 23 -#define TT_MAC_ID_ARMENIAN 24 -#define TT_MAC_ID_MALDIVIAN 25 -#define TT_MAC_ID_SIMPLIFIED_CHINESE 25 -#define TT_MAC_ID_TIBETAN 26 -#define TT_MAC_ID_MONGOLIAN 27 -#define TT_MAC_ID_GEEZ 28 -#define TT_MAC_ID_SLAVIC 29 -#define TT_MAC_ID_VIETNAMESE 30 -#define TT_MAC_ID_SINDHI 31 -#define TT_MAC_ID_UNINTERP 32 - - - /*********************************************************************** - * - * @enum: - * TT_ISO_ID_XXX - * - * @description: - * A list of valid values for the `encoding_id' for - * @TT_PLATFORM_ISO charmaps and name entries. - * - * Their use is now deprecated. - * - * @values: - * TT_ISO_ID_7BIT_ASCII :: - * ASCII. - * TT_ISO_ID_10646 :: - * ISO/10646. - * TT_ISO_ID_8859_1 :: - * Also known as Latin-1. - */ - -#define TT_ISO_ID_7BIT_ASCII 0 -#define TT_ISO_ID_10646 1 -#define TT_ISO_ID_8859_1 2 - - - /*********************************************************************** - * - * @enum: - * TT_MS_ID_XXX - * - * @description: - * A list of valid values for the `encoding_id' for - * @TT_PLATFORM_MICROSOFT charmaps and name entries. - * - * @values: - * TT_MS_ID_SYMBOL_CS :: - * Corresponds to Microsoft symbol encoding. See - * @FT_ENCODING_MS_SYMBOL. - * - * TT_MS_ID_UNICODE_CS :: - * Corresponds to a Microsoft WGL4 charmap, matching Unicode. See - * @FT_ENCODING_UNICODE. - * - * TT_MS_ID_SJIS :: - * Corresponds to SJIS Japanese encoding. See @FT_ENCODING_SJIS. - * - * TT_MS_ID_GB2312 :: - * Corresponds to Simplified Chinese as used in Mainland China. See - * @FT_ENCODING_GB2312. - * - * TT_MS_ID_BIG_5 :: - * Corresponds to Traditional Chinese as used in Taiwan and Hong Kong. - * See @FT_ENCODING_BIG5. - * - * TT_MS_ID_WANSUNG :: - * Corresponds to Korean Wansung encoding. See @FT_ENCODING_WANSUNG. - * - * TT_MS_ID_JOHAB :: - * Corresponds to Johab encoding. See @FT_ENCODING_JOHAB. - * - * TT_MS_ID_UCS_4 :: - * Corresponds to UCS-4 or UTF-32 charmaps. This has been added to - * the OpenType specification version 1.4 (mid-2001.) - */ - -#define TT_MS_ID_SYMBOL_CS 0 -#define TT_MS_ID_UNICODE_CS 1 -#define TT_MS_ID_SJIS 2 -#define TT_MS_ID_GB2312 3 -#define TT_MS_ID_BIG_5 4 -#define TT_MS_ID_WANSUNG 5 -#define TT_MS_ID_JOHAB 6 -#define TT_MS_ID_UCS_4 10 - - - /*********************************************************************** - * - * @enum: - * TT_ADOBE_ID_XXX - * - * @description: - * A list of valid values for the `encoding_id' for - * @TT_PLATFORM_ADOBE charmaps. This is a FreeType-specific extension! - * - * @values: - * TT_ADOBE_ID_STANDARD :: - * Adobe standard encoding. - * TT_ADOBE_ID_EXPERT :: - * Adobe expert encoding. - * TT_ADOBE_ID_CUSTOM :: - * Adobe custom encoding. - * TT_ADOBE_ID_LATIN_1 :: - * Adobe Latin~1 encoding. - */ - -#define TT_ADOBE_ID_STANDARD 0 -#define TT_ADOBE_ID_EXPERT 1 -#define TT_ADOBE_ID_CUSTOM 2 -#define TT_ADOBE_ID_LATIN_1 3 - - - /*************************************************************************/ - /* */ - /* Possible values of the language identifier field in the name records */ - /* of the TTF `name' table if the `platform' identifier code is */ - /* TT_PLATFORM_MACINTOSH. */ - /* */ - /* The canonical source for the Apple assigned Language ID's is at */ - /* */ - /* http://fonts.apple.com/TTRefMan/RM06/Chap6name.html */ - /* */ -#define TT_MAC_LANGID_ENGLISH 0 -#define TT_MAC_LANGID_FRENCH 1 -#define TT_MAC_LANGID_GERMAN 2 -#define TT_MAC_LANGID_ITALIAN 3 -#define TT_MAC_LANGID_DUTCH 4 -#define TT_MAC_LANGID_SWEDISH 5 -#define TT_MAC_LANGID_SPANISH 6 -#define TT_MAC_LANGID_DANISH 7 -#define TT_MAC_LANGID_PORTUGUESE 8 -#define TT_MAC_LANGID_NORWEGIAN 9 -#define TT_MAC_LANGID_HEBREW 10 -#define TT_MAC_LANGID_JAPANESE 11 -#define TT_MAC_LANGID_ARABIC 12 -#define TT_MAC_LANGID_FINNISH 13 -#define TT_MAC_LANGID_GREEK 14 -#define TT_MAC_LANGID_ICELANDIC 15 -#define TT_MAC_LANGID_MALTESE 16 -#define TT_MAC_LANGID_TURKISH 17 -#define TT_MAC_LANGID_CROATIAN 18 -#define TT_MAC_LANGID_CHINESE_TRADITIONAL 19 -#define TT_MAC_LANGID_URDU 20 -#define TT_MAC_LANGID_HINDI 21 -#define TT_MAC_LANGID_THAI 22 -#define TT_MAC_LANGID_KOREAN 23 -#define TT_MAC_LANGID_LITHUANIAN 24 -#define TT_MAC_LANGID_POLISH 25 -#define TT_MAC_LANGID_HUNGARIAN 26 -#define TT_MAC_LANGID_ESTONIAN 27 -#define TT_MAC_LANGID_LETTISH 28 -#define TT_MAC_LANGID_SAAMISK 29 -#define TT_MAC_LANGID_FAEROESE 30 -#define TT_MAC_LANGID_FARSI 31 -#define TT_MAC_LANGID_RUSSIAN 32 -#define TT_MAC_LANGID_CHINESE_SIMPLIFIED 33 -#define TT_MAC_LANGID_FLEMISH 34 -#define TT_MAC_LANGID_IRISH 35 -#define TT_MAC_LANGID_ALBANIAN 36 -#define TT_MAC_LANGID_ROMANIAN 37 -#define TT_MAC_LANGID_CZECH 38 -#define TT_MAC_LANGID_SLOVAK 39 -#define TT_MAC_LANGID_SLOVENIAN 40 -#define TT_MAC_LANGID_YIDDISH 41 -#define TT_MAC_LANGID_SERBIAN 42 -#define TT_MAC_LANGID_MACEDONIAN 43 -#define TT_MAC_LANGID_BULGARIAN 44 -#define TT_MAC_LANGID_UKRAINIAN 45 -#define TT_MAC_LANGID_BYELORUSSIAN 46 -#define TT_MAC_LANGID_UZBEK 47 -#define TT_MAC_LANGID_KAZAKH 48 -#define TT_MAC_LANGID_AZERBAIJANI 49 -#define TT_MAC_LANGID_AZERBAIJANI_CYRILLIC_SCRIPT 49 -#define TT_MAC_LANGID_AZERBAIJANI_ARABIC_SCRIPT 50 -#define TT_MAC_LANGID_ARMENIAN 51 -#define TT_MAC_LANGID_GEORGIAN 52 -#define TT_MAC_LANGID_MOLDAVIAN 53 -#define TT_MAC_LANGID_KIRGHIZ 54 -#define TT_MAC_LANGID_TAJIKI 55 -#define TT_MAC_LANGID_TURKMEN 56 -#define TT_MAC_LANGID_MONGOLIAN 57 -#define TT_MAC_LANGID_MONGOLIAN_MONGOLIAN_SCRIPT 57 -#define TT_MAC_LANGID_MONGOLIAN_CYRILLIC_SCRIPT 58 -#define TT_MAC_LANGID_PASHTO 59 -#define TT_MAC_LANGID_KURDISH 60 -#define TT_MAC_LANGID_KASHMIRI 61 -#define TT_MAC_LANGID_SINDHI 62 -#define TT_MAC_LANGID_TIBETAN 63 -#define TT_MAC_LANGID_NEPALI 64 -#define TT_MAC_LANGID_SANSKRIT 65 -#define TT_MAC_LANGID_MARATHI 66 -#define TT_MAC_LANGID_BENGALI 67 -#define TT_MAC_LANGID_ASSAMESE 68 -#define TT_MAC_LANGID_GUJARATI 69 -#define TT_MAC_LANGID_PUNJABI 70 -#define TT_MAC_LANGID_ORIYA 71 -#define TT_MAC_LANGID_MALAYALAM 72 -#define TT_MAC_LANGID_KANNADA 73 -#define TT_MAC_LANGID_TAMIL 74 -#define TT_MAC_LANGID_TELUGU 75 -#define TT_MAC_LANGID_SINHALESE 76 -#define TT_MAC_LANGID_BURMESE 77 -#define TT_MAC_LANGID_KHMER 78 -#define TT_MAC_LANGID_LAO 79 -#define TT_MAC_LANGID_VIETNAMESE 80 -#define TT_MAC_LANGID_INDONESIAN 81 -#define TT_MAC_LANGID_TAGALOG 82 -#define TT_MAC_LANGID_MALAY_ROMAN_SCRIPT 83 -#define TT_MAC_LANGID_MALAY_ARABIC_SCRIPT 84 -#define TT_MAC_LANGID_AMHARIC 85 -#define TT_MAC_LANGID_TIGRINYA 86 -#define TT_MAC_LANGID_GALLA 87 -#define TT_MAC_LANGID_SOMALI 88 -#define TT_MAC_LANGID_SWAHILI 89 -#define TT_MAC_LANGID_RUANDA 90 -#define TT_MAC_LANGID_RUNDI 91 -#define TT_MAC_LANGID_CHEWA 92 -#define TT_MAC_LANGID_MALAGASY 93 -#define TT_MAC_LANGID_ESPERANTO 94 -#define TT_MAC_LANGID_WELSH 128 -#define TT_MAC_LANGID_BASQUE 129 -#define TT_MAC_LANGID_CATALAN 130 -#define TT_MAC_LANGID_LATIN 131 -#define TT_MAC_LANGID_QUECHUA 132 -#define TT_MAC_LANGID_GUARANI 133 -#define TT_MAC_LANGID_AYMARA 134 -#define TT_MAC_LANGID_TATAR 135 -#define TT_MAC_LANGID_UIGHUR 136 -#define TT_MAC_LANGID_DZONGKHA 137 -#define TT_MAC_LANGID_JAVANESE 138 -#define TT_MAC_LANGID_SUNDANESE 139 - - -#if 0 /* these seem to be errors that have been dropped */ - -#define TT_MAC_LANGID_SCOTTISH_GAELIC 140 -#define TT_MAC_LANGID_IRISH_GAELIC 141 - -#endif - - - /* The following codes are new as of 2000-03-10 */ -#define TT_MAC_LANGID_GALICIAN 140 -#define TT_MAC_LANGID_AFRIKAANS 141 -#define TT_MAC_LANGID_BRETON 142 -#define TT_MAC_LANGID_INUKTITUT 143 -#define TT_MAC_LANGID_SCOTTISH_GAELIC 144 -#define TT_MAC_LANGID_MANX_GAELIC 145 -#define TT_MAC_LANGID_IRISH_GAELIC 146 -#define TT_MAC_LANGID_TONGAN 147 -#define TT_MAC_LANGID_GREEK_POLYTONIC 148 -#define TT_MAC_LANGID_GREELANDIC 149 -#define TT_MAC_LANGID_AZERBAIJANI_ROMAN_SCRIPT 150 - - - /*************************************************************************/ - /* */ - /* Possible values of the language identifier field in the name records */ - /* of the TTF `name' table if the `platform' identifier code is */ - /* TT_PLATFORM_MICROSOFT. */ - /* */ - /* The canonical source for the MS assigned LCID's (seems to) be at */ - /* */ - /* http://www.microsoft.com/globaldev/reference/lcid-all.mspx */ - /* */ - /* It used to be at various places, among them */ - /* */ - /* http://www.microsoft.com/typography/OTSPEC/lcid-cp.txt */ - /* http://www.microsoft.com/globaldev/reference/loclanghome.asp */ - /* http://support.microsoft.com/support/kb/articles/Q224/8/04.ASP */ - /* http://msdn.microsoft.com/library/en-us/passport25/ */ - /* NET_Passport_VBScript_Documentation/Single_Sign_In/ */ - /* Advanced_Single_Sign_In/Localization_and_LCIDs.asp */ - /* */ - /* Hopefully, it seems now that the Globaldev site prevails... */ - /* (updated by Antoine, 2004-02-17) */ - -#define TT_MS_LANGID_ARABIC_GENERAL 0x0001 -#define TT_MS_LANGID_ARABIC_SAUDI_ARABIA 0x0401 -#define TT_MS_LANGID_ARABIC_IRAQ 0x0801 -#define TT_MS_LANGID_ARABIC_EGYPT 0x0c01 -#define TT_MS_LANGID_ARABIC_LIBYA 0x1001 -#define TT_MS_LANGID_ARABIC_ALGERIA 0x1401 -#define TT_MS_LANGID_ARABIC_MOROCCO 0x1801 -#define TT_MS_LANGID_ARABIC_TUNISIA 0x1c01 -#define TT_MS_LANGID_ARABIC_OMAN 0x2001 -#define TT_MS_LANGID_ARABIC_YEMEN 0x2401 -#define TT_MS_LANGID_ARABIC_SYRIA 0x2801 -#define TT_MS_LANGID_ARABIC_JORDAN 0x2c01 -#define TT_MS_LANGID_ARABIC_LEBANON 0x3001 -#define TT_MS_LANGID_ARABIC_KUWAIT 0x3401 -#define TT_MS_LANGID_ARABIC_UAE 0x3801 -#define TT_MS_LANGID_ARABIC_BAHRAIN 0x3c01 -#define TT_MS_LANGID_ARABIC_QATAR 0x4001 -#define TT_MS_LANGID_BULGARIAN_BULGARIA 0x0402 -#define TT_MS_LANGID_CATALAN_SPAIN 0x0403 -#define TT_MS_LANGID_CHINESE_GENERAL 0x0004 -#define TT_MS_LANGID_CHINESE_TAIWAN 0x0404 -#define TT_MS_LANGID_CHINESE_PRC 0x0804 -#define TT_MS_LANGID_CHINESE_HONG_KONG 0x0c04 -#define TT_MS_LANGID_CHINESE_SINGAPORE 0x1004 - -#if 1 /* this looks like the correct value */ -#define TT_MS_LANGID_CHINESE_MACAU 0x1404 -#else /* but beware, Microsoft may change its mind... - the most recent Word reference has the following: */ -#define TT_MS_LANGID_CHINESE_MACAU TT_MS_LANGID_CHINESE_HONG_KONG -#endif - -#if 0 /* used only with .NET `cultures'; commented out */ -#define TT_MS_LANGID_CHINESE_TRADITIONAL 0x7C04 -#endif - -#define TT_MS_LANGID_CZECH_CZECH_REPUBLIC 0x0405 -#define TT_MS_LANGID_DANISH_DENMARK 0x0406 -#define TT_MS_LANGID_GERMAN_GERMANY 0x0407 -#define TT_MS_LANGID_GERMAN_SWITZERLAND 0x0807 -#define TT_MS_LANGID_GERMAN_AUSTRIA 0x0c07 -#define TT_MS_LANGID_GERMAN_LUXEMBOURG 0x1007 -#define TT_MS_LANGID_GERMAN_LIECHTENSTEI 0x1407 -#define TT_MS_LANGID_GREEK_GREECE 0x0408 - - /* don't ask what this one means... It is commented out currently. */ -#if 0 -#define TT_MS_LANGID_GREEK_GREECE2 0x2008 -#endif - -#define TT_MS_LANGID_ENGLISH_GENERAL 0x0009 -#define TT_MS_LANGID_ENGLISH_UNITED_STATES 0x0409 -#define TT_MS_LANGID_ENGLISH_UNITED_KINGDOM 0x0809 -#define TT_MS_LANGID_ENGLISH_AUSTRALIA 0x0c09 -#define TT_MS_LANGID_ENGLISH_CANADA 0x1009 -#define TT_MS_LANGID_ENGLISH_NEW_ZEALAND 0x1409 -#define TT_MS_LANGID_ENGLISH_IRELAND 0x1809 -#define TT_MS_LANGID_ENGLISH_SOUTH_AFRICA 0x1c09 -#define TT_MS_LANGID_ENGLISH_JAMAICA 0x2009 -#define TT_MS_LANGID_ENGLISH_CARIBBEAN 0x2409 -#define TT_MS_LANGID_ENGLISH_BELIZE 0x2809 -#define TT_MS_LANGID_ENGLISH_TRINIDAD 0x2c09 -#define TT_MS_LANGID_ENGLISH_ZIMBABWE 0x3009 -#define TT_MS_LANGID_ENGLISH_PHILIPPINES 0x3409 -#define TT_MS_LANGID_ENGLISH_INDONESIA 0x3809 -#define TT_MS_LANGID_ENGLISH_HONG_KONG 0x3c09 -#define TT_MS_LANGID_ENGLISH_INDIA 0x4009 -#define TT_MS_LANGID_ENGLISH_MALAYSIA 0x4409 -#define TT_MS_LANGID_ENGLISH_SINGAPORE 0x4809 -#define TT_MS_LANGID_SPANISH_SPAIN_TRADITIONAL_SORT 0x040a -#define TT_MS_LANGID_SPANISH_MEXICO 0x080a -#define TT_MS_LANGID_SPANISH_SPAIN_INTERNATIONAL_SORT 0x0c0a -#define TT_MS_LANGID_SPANISH_GUATEMALA 0x100a -#define TT_MS_LANGID_SPANISH_COSTA_RICA 0x140a -#define TT_MS_LANGID_SPANISH_PANAMA 0x180a -#define TT_MS_LANGID_SPANISH_DOMINICAN_REPUBLIC 0x1c0a -#define TT_MS_LANGID_SPANISH_VENEZUELA 0x200a -#define TT_MS_LANGID_SPANISH_COLOMBIA 0x240a -#define TT_MS_LANGID_SPANISH_PERU 0x280a -#define TT_MS_LANGID_SPANISH_ARGENTINA 0x2c0a -#define TT_MS_LANGID_SPANISH_ECUADOR 0x300a -#define TT_MS_LANGID_SPANISH_CHILE 0x340a -#define TT_MS_LANGID_SPANISH_URUGUAY 0x380a -#define TT_MS_LANGID_SPANISH_PARAGUAY 0x3c0a -#define TT_MS_LANGID_SPANISH_BOLIVIA 0x400a -#define TT_MS_LANGID_SPANISH_EL_SALVADOR 0x440a -#define TT_MS_LANGID_SPANISH_HONDURAS 0x480a -#define TT_MS_LANGID_SPANISH_NICARAGUA 0x4c0a -#define TT_MS_LANGID_SPANISH_PUERTO_RICO 0x500a -#define TT_MS_LANGID_SPANISH_UNITED_STATES 0x540a - /* The following ID blatantly violate MS specs by using a */ - /* sublanguage > 0x1F. */ -#define TT_MS_LANGID_SPANISH_LATIN_AMERICA 0xE40aU -#define TT_MS_LANGID_FINNISH_FINLAND 0x040b -#define TT_MS_LANGID_FRENCH_FRANCE 0x040c -#define TT_MS_LANGID_FRENCH_BELGIUM 0x080c -#define TT_MS_LANGID_FRENCH_CANADA 0x0c0c -#define TT_MS_LANGID_FRENCH_SWITZERLAND 0x100c -#define TT_MS_LANGID_FRENCH_LUXEMBOURG 0x140c -#define TT_MS_LANGID_FRENCH_MONACO 0x180c -#define TT_MS_LANGID_FRENCH_WEST_INDIES 0x1c0c -#define TT_MS_LANGID_FRENCH_REUNION 0x200c -#define TT_MS_LANGID_FRENCH_CONGO 0x240c - /* which was formerly: */ -#define TT_MS_LANGID_FRENCH_ZAIRE TT_MS_LANGID_FRENCH_CONGO -#define TT_MS_LANGID_FRENCH_SENEGAL 0x280c -#define TT_MS_LANGID_FRENCH_CAMEROON 0x2c0c -#define TT_MS_LANGID_FRENCH_COTE_D_IVOIRE 0x300c -#define TT_MS_LANGID_FRENCH_MALI 0x340c -#define TT_MS_LANGID_FRENCH_MOROCCO 0x380c -#define TT_MS_LANGID_FRENCH_HAITI 0x3c0c - /* and another violation of the spec (see 0xE40aU) */ -#define TT_MS_LANGID_FRENCH_NORTH_AFRICA 0xE40cU -#define TT_MS_LANGID_HEBREW_ISRAEL 0x040d -#define TT_MS_LANGID_HUNGARIAN_HUNGARY 0x040e -#define TT_MS_LANGID_ICELANDIC_ICELAND 0x040f -#define TT_MS_LANGID_ITALIAN_ITALY 0x0410 -#define TT_MS_LANGID_ITALIAN_SWITZERLAND 0x0810 -#define TT_MS_LANGID_JAPANESE_JAPAN 0x0411 -#define TT_MS_LANGID_KOREAN_EXTENDED_WANSUNG_KOREA 0x0412 -#define TT_MS_LANGID_KOREAN_JOHAB_KOREA 0x0812 -#define TT_MS_LANGID_DUTCH_NETHERLANDS 0x0413 -#define TT_MS_LANGID_DUTCH_BELGIUM 0x0813 -#define TT_MS_LANGID_NORWEGIAN_NORWAY_BOKMAL 0x0414 -#define TT_MS_LANGID_NORWEGIAN_NORWAY_NYNORSK 0x0814 -#define TT_MS_LANGID_POLISH_POLAND 0x0415 -#define TT_MS_LANGID_PORTUGUESE_BRAZIL 0x0416 -#define TT_MS_LANGID_PORTUGUESE_PORTUGAL 0x0816 -#define TT_MS_LANGID_RHAETO_ROMANIC_SWITZERLAND 0x0417 -#define TT_MS_LANGID_ROMANIAN_ROMANIA 0x0418 -#define TT_MS_LANGID_MOLDAVIAN_MOLDAVIA 0x0818 -#define TT_MS_LANGID_RUSSIAN_RUSSIA 0x0419 -#define TT_MS_LANGID_RUSSIAN_MOLDAVIA 0x0819 -#define TT_MS_LANGID_CROATIAN_CROATIA 0x041a -#define TT_MS_LANGID_SERBIAN_SERBIA_LATIN 0x081a -#define TT_MS_LANGID_SERBIAN_SERBIA_CYRILLIC 0x0c1a - -#if 0 /* this used to be this value, but it looks like we were wrong */ -#define TT_MS_LANGID_BOSNIAN_BOSNIA_HERZEGOVINA 0x101a -#else /* current sources say */ -#define TT_MS_LANGID_CROATIAN_BOSNIA_HERZEGOVINA 0x101a -#define TT_MS_LANGID_BOSNIAN_BOSNIA_HERZEGOVINA 0x141a - /* and XPsp2 Platform SDK added (2004-07-26) */ - /* Names are shortened to be significant within 40 chars. */ -#define TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_LATIN 0x181a -#define TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_CYRILLIC 0x181a -#endif - -#define TT_MS_LANGID_SLOVAK_SLOVAKIA 0x041b -#define TT_MS_LANGID_ALBANIAN_ALBANIA 0x041c -#define TT_MS_LANGID_SWEDISH_SWEDEN 0x041d -#define TT_MS_LANGID_SWEDISH_FINLAND 0x081d -#define TT_MS_LANGID_THAI_THAILAND 0x041e -#define TT_MS_LANGID_TURKISH_TURKEY 0x041f -#define TT_MS_LANGID_URDU_PAKISTAN 0x0420 -#define TT_MS_LANGID_URDU_INDIA 0x0820 -#define TT_MS_LANGID_INDONESIAN_INDONESIA 0x0421 -#define TT_MS_LANGID_UKRAINIAN_UKRAINE 0x0422 -#define TT_MS_LANGID_BELARUSIAN_BELARUS 0x0423 -#define TT_MS_LANGID_SLOVENE_SLOVENIA 0x0424 -#define TT_MS_LANGID_ESTONIAN_ESTONIA 0x0425 -#define TT_MS_LANGID_LATVIAN_LATVIA 0x0426 -#define TT_MS_LANGID_LITHUANIAN_LITHUANIA 0x0427 -#define TT_MS_LANGID_CLASSIC_LITHUANIAN_LITHUANIA 0x0827 -#define TT_MS_LANGID_TAJIK_TAJIKISTAN 0x0428 -#define TT_MS_LANGID_FARSI_IRAN 0x0429 -#define TT_MS_LANGID_VIETNAMESE_VIET_NAM 0x042a -#define TT_MS_LANGID_ARMENIAN_ARMENIA 0x042b -#define TT_MS_LANGID_AZERI_AZERBAIJAN_LATIN 0x042c -#define TT_MS_LANGID_AZERI_AZERBAIJAN_CYRILLIC 0x082c -#define TT_MS_LANGID_BASQUE_SPAIN 0x042d -#define TT_MS_LANGID_SORBIAN_GERMANY 0x042e -#define TT_MS_LANGID_MACEDONIAN_MACEDONIA 0x042f -#define TT_MS_LANGID_SUTU_SOUTH_AFRICA 0x0430 -#define TT_MS_LANGID_TSONGA_SOUTH_AFRICA 0x0431 -#define TT_MS_LANGID_TSWANA_SOUTH_AFRICA 0x0432 -#define TT_MS_LANGID_VENDA_SOUTH_AFRICA 0x0433 -#define TT_MS_LANGID_XHOSA_SOUTH_AFRICA 0x0434 -#define TT_MS_LANGID_ZULU_SOUTH_AFRICA 0x0435 -#define TT_MS_LANGID_AFRIKAANS_SOUTH_AFRICA 0x0436 -#define TT_MS_LANGID_GEORGIAN_GEORGIA 0x0437 -#define TT_MS_LANGID_FAEROESE_FAEROE_ISLANDS 0x0438 -#define TT_MS_LANGID_HINDI_INDIA 0x0439 -#define TT_MS_LANGID_MALTESE_MALTA 0x043a - /* Added by XPsp2 Platform SDK (2004-07-26) */ -#define TT_MS_LANGID_SAMI_NORTHERN_NORWAY 0x043b -#define TT_MS_LANGID_SAMI_NORTHERN_SWEDEN 0x083b -#define TT_MS_LANGID_SAMI_NORTHERN_FINLAND 0x0C3b -#define TT_MS_LANGID_SAMI_LULE_NORWAY 0x103b -#define TT_MS_LANGID_SAMI_LULE_SWEDEN 0x143b -#define TT_MS_LANGID_SAMI_SOUTHERN_NORWAY 0x183b -#define TT_MS_LANGID_SAMI_SOUTHERN_SWEDEN 0x1C3b -#define TT_MS_LANGID_SAMI_SKOLT_FINLAND 0x203b -#define TT_MS_LANGID_SAMI_INARI_FINLAND 0x243b - /* ... and we also keep our old identifier... */ -#define TT_MS_LANGID_SAAMI_LAPONIA 0x043b - -#if 0 /* this seems to be a previous inversion */ -#define TT_MS_LANGID_IRISH_GAELIC_IRELAND 0x043c -#define TT_MS_LANGID_SCOTTISH_GAELIC_UNITED_KINGDOM 0x083c -#else -#define TT_MS_LANGID_SCOTTISH_GAELIC_UNITED_KINGDOM 0x083c -#define TT_MS_LANGID_IRISH_GAELIC_IRELAND 0x043c -#endif - -#define TT_MS_LANGID_YIDDISH_GERMANY 0x043d -#define TT_MS_LANGID_MALAY_MALAYSIA 0x043e -#define TT_MS_LANGID_MALAY_BRUNEI_DARUSSALAM 0x083e -#define TT_MS_LANGID_KAZAK_KAZAKSTAN 0x043f -#define TT_MS_LANGID_KIRGHIZ_KIRGHIZSTAN /* Cyrillic*/ 0x0440 - /* alias declared in Windows 2000 */ -#define TT_MS_LANGID_KIRGHIZ_KIRGHIZ_REPUBLIC \ - TT_MS_LANGID_KIRGHIZ_KIRGHIZSTAN - -#define TT_MS_LANGID_SWAHILI_KENYA 0x0441 -#define TT_MS_LANGID_TURKMEN_TURKMENISTAN 0x0442 -#define TT_MS_LANGID_UZBEK_UZBEKISTAN_LATIN 0x0443 -#define TT_MS_LANGID_UZBEK_UZBEKISTAN_CYRILLIC 0x0843 -#define TT_MS_LANGID_TATAR_TATARSTAN 0x0444 -#define TT_MS_LANGID_BENGALI_INDIA 0x0445 -#define TT_MS_LANGID_BENGALI_BANGLADESH 0x0845 -#define TT_MS_LANGID_PUNJABI_INDIA 0x0446 -#define TT_MS_LANGID_PUNJABI_ARABIC_PAKISTAN 0x0846 -#define TT_MS_LANGID_GUJARATI_INDIA 0x0447 -#define TT_MS_LANGID_ORIYA_INDIA 0x0448 -#define TT_MS_LANGID_TAMIL_INDIA 0x0449 -#define TT_MS_LANGID_TELUGU_INDIA 0x044a -#define TT_MS_LANGID_KANNADA_INDIA 0x044b -#define TT_MS_LANGID_MALAYALAM_INDIA 0x044c -#define TT_MS_LANGID_ASSAMESE_INDIA 0x044d -#define TT_MS_LANGID_MARATHI_INDIA 0x044e -#define TT_MS_LANGID_SANSKRIT_INDIA 0x044f -#define TT_MS_LANGID_MONGOLIAN_MONGOLIA /* Cyrillic */ 0x0450 -#define TT_MS_LANGID_MONGOLIAN_MONGOLIA_MONGOLIAN 0x0850 -#define TT_MS_LANGID_TIBETAN_CHINA 0x0451 - /* Don't use the next constant! It has */ - /* (1) the wrong spelling (Dzonghka) */ - /* (2) Microsoft doesn't officially define it -- */ - /* at least it is not in the List of Local */ - /* ID Values. */ - /* (3) Dzongkha is not the same language as */ - /* Tibetan, so merging it is wrong anyway. */ - /* */ - /* TT_MS_LANGID_TIBETAN_BHUTAN is correct, BTW. */ -#define TT_MS_LANGID_DZONGHKA_BHUTAN 0x0851 - -#if 0 - /* the following used to be defined */ -#define TT_MS_LANGID_TIBETAN_BHUTAN 0x0451 - /* ... but it was changed; */ -#else - /* So we will continue to #define it, but with the correct value */ -#define TT_MS_LANGID_TIBETAN_BHUTAN TT_MS_LANGID_DZONGHKA_BHUTAN -#endif - -#define TT_MS_LANGID_WELSH_WALES 0x0452 -#define TT_MS_LANGID_KHMER_CAMBODIA 0x0453 -#define TT_MS_LANGID_LAO_LAOS 0x0454 -#define TT_MS_LANGID_BURMESE_MYANMAR 0x0455 -#define TT_MS_LANGID_GALICIAN_SPAIN 0x0456 -#define TT_MS_LANGID_KONKANI_INDIA 0x0457 -#define TT_MS_LANGID_MANIPURI_INDIA /* Bengali */ 0x0458 -#define TT_MS_LANGID_SINDHI_INDIA /* Arabic */ 0x0459 -#define TT_MS_LANGID_SINDHI_PAKISTAN 0x0859 - /* Missing a LCID for Sindhi in Devanagari script */ -#define TT_MS_LANGID_SYRIAC_SYRIA 0x045a -#define TT_MS_LANGID_SINHALESE_SRI_LANKA 0x045b -#define TT_MS_LANGID_CHEROKEE_UNITED_STATES 0x045c -#define TT_MS_LANGID_INUKTITUT_CANADA 0x045d -#define TT_MS_LANGID_AMHARIC_ETHIOPIA 0x045e -#define TT_MS_LANGID_TAMAZIGHT_MOROCCO /* Arabic */ 0x045f -#define TT_MS_LANGID_TAMAZIGHT_MOROCCO_LATIN 0x085f - /* Missing a LCID for Tifinagh script */ -#define TT_MS_LANGID_KASHMIRI_PAKISTAN /* Arabic */ 0x0460 - /* Spelled this way by XPsp2 Platform SDK (2004-07-26) */ - /* script is yet unclear... might be Arabic, Nagari or Sharada */ -#define TT_MS_LANGID_KASHMIRI_SASIA 0x0860 - /* ... and aliased (by MS) for compatibility reasons. */ -#define TT_MS_LANGID_KASHMIRI_INDIA TT_MS_LANGID_KASHMIRI_SASIA -#define TT_MS_LANGID_NEPALI_NEPAL 0x0461 -#define TT_MS_LANGID_NEPALI_INDIA 0x0861 -#define TT_MS_LANGID_FRISIAN_NETHERLANDS 0x0462 -#define TT_MS_LANGID_PASHTO_AFGHANISTAN 0x0463 -#define TT_MS_LANGID_FILIPINO_PHILIPPINES 0x0464 -#define TT_MS_LANGID_DHIVEHI_MALDIVES 0x0465 - /* alias declared in Windows 2000 */ -#define TT_MS_LANGID_DIVEHI_MALDIVES TT_MS_LANGID_DHIVEHI_MALDIVES -#define TT_MS_LANGID_EDO_NIGERIA 0x0466 -#define TT_MS_LANGID_FULFULDE_NIGERIA 0x0467 -#define TT_MS_LANGID_HAUSA_NIGERIA 0x0468 -#define TT_MS_LANGID_IBIBIO_NIGERIA 0x0469 -#define TT_MS_LANGID_YORUBA_NIGERIA 0x046a -#define TT_MS_LANGID_QUECHUA_BOLIVIA 0x046b -#define TT_MS_LANGID_QUECHUA_ECUADOR 0x086b -#define TT_MS_LANGID_QUECHUA_PERU 0x0c6b -#define TT_MS_LANGID_SEPEDI_SOUTH_AFRICA 0x046c - /* Also spelled by XPsp2 Platform SDK (2004-07-26) */ -#define TT_MS_LANGID_SOTHO_SOUTHERN_SOUTH_AFRICA \ - TT_MS_LANGID_SEPEDI_SOUTH_AFRICA - /* language codes 0x046d, 0x046e and 0x046f are (still) unknown. */ -#define TT_MS_LANGID_IGBO_NIGERIA 0x0470 -#define TT_MS_LANGID_KANURI_NIGERIA 0x0471 -#define TT_MS_LANGID_OROMO_ETHIOPIA 0x0472 -#define TT_MS_LANGID_TIGRIGNA_ETHIOPIA 0x0473 -#define TT_MS_LANGID_TIGRIGNA_ERYTHREA 0x0873 - /* also spelled in the `Passport SDK' list as: */ -#define TT_MS_LANGID_TIGRIGNA_ERYTREA TT_MS_LANGID_TIGRIGNA_ERYTHREA -#define TT_MS_LANGID_GUARANI_PARAGUAY 0x0474 -#define TT_MS_LANGID_HAWAIIAN_UNITED_STATES 0x0475 -#define TT_MS_LANGID_LATIN 0x0476 -#define TT_MS_LANGID_SOMALI_SOMALIA 0x0477 - /* Note: Yi does not have a (proper) ISO 639-2 code, since it is mostly */ - /* not written (but OTOH the peculiar writing system is worth */ - /* studying). */ -#define TT_MS_LANGID_YI_CHINA 0x0478 -#define TT_MS_LANGID_PAPIAMENTU_NETHERLANDS_ANTILLES 0x0479 - /* language codes from 0x047a to 0x047f are (still) unknown. */ -#define TT_MS_LANGID_UIGHUR_CHINA 0x0480 -#define TT_MS_LANGID_MAORI_NEW_ZEALAND 0x0481 - -#if 0 /* not deemed useful for fonts */ -#define TT_MS_LANGID_HUMAN_INTERFACE_DEVICE 0x04ff -#endif - - - /*************************************************************************/ - /* */ - /* Possible values of the `name' identifier field in the name records of */ - /* the TTF `name' table. These values are platform independent. */ - /* */ -#define TT_NAME_ID_COPYRIGHT 0 -#define TT_NAME_ID_FONT_FAMILY 1 -#define TT_NAME_ID_FONT_SUBFAMILY 2 -#define TT_NAME_ID_UNIQUE_ID 3 -#define TT_NAME_ID_FULL_NAME 4 -#define TT_NAME_ID_VERSION_STRING 5 -#define TT_NAME_ID_PS_NAME 6 -#define TT_NAME_ID_TRADEMARK 7 - - /* the following values are from the OpenType spec */ -#define TT_NAME_ID_MANUFACTURER 8 -#define TT_NAME_ID_DESIGNER 9 -#define TT_NAME_ID_DESCRIPTION 10 -#define TT_NAME_ID_VENDOR_URL 11 -#define TT_NAME_ID_DESIGNER_URL 12 -#define TT_NAME_ID_LICENSE 13 -#define TT_NAME_ID_LICENSE_URL 14 - /* number 15 is reserved */ -#define TT_NAME_ID_PREFERRED_FAMILY 16 -#define TT_NAME_ID_PREFERRED_SUBFAMILY 17 -#define TT_NAME_ID_MAC_FULL_NAME 18 - - /* The following code is new as of 2000-01-21 */ -#define TT_NAME_ID_SAMPLE_TEXT 19 - - /* This is new in OpenType 1.3 */ -#define TT_NAME_ID_CID_FINDFONT_NAME 20 - - /* This is new in OpenType 1.5 */ -#define TT_NAME_ID_WWS_FAMILY 21 -#define TT_NAME_ID_WWS_SUBFAMILY 22 - - - /*************************************************************************/ - /* */ - /* Bit mask values for the Unicode Ranges from the TTF `OS2 ' table. */ - /* */ - /* Updated 08-Nov-2008. */ - /* */ - - /* Bit 0 Basic Latin */ -#define TT_UCR_BASIC_LATIN (1L << 0) /* U+0020-U+007E */ - /* Bit 1 C1 Controls and Latin-1 Supplement */ -#define TT_UCR_LATIN1_SUPPLEMENT (1L << 1) /* U+0080-U+00FF */ - /* Bit 2 Latin Extended-A */ -#define TT_UCR_LATIN_EXTENDED_A (1L << 2) /* U+0100-U+017F */ - /* Bit 3 Latin Extended-B */ -#define TT_UCR_LATIN_EXTENDED_B (1L << 3) /* U+0180-U+024F */ - /* Bit 4 IPA Extensions */ - /* Phonetic Extensions */ - /* Phonetic Extensions Supplement */ -#define TT_UCR_IPA_EXTENSIONS (1L << 4) /* U+0250-U+02AF */ - /* U+1D00-U+1D7F */ - /* U+1D80-U+1DBF */ - /* Bit 5 Spacing Modifier Letters */ - /* Modifier Tone Letters */ -#define TT_UCR_SPACING_MODIFIER (1L << 5) /* U+02B0-U+02FF */ - /* U+A700-U+A71F */ - /* Bit 6 Combining Diacritical Marks */ - /* Combining Diacritical Marks Supplement */ -#define TT_UCR_COMBINING_DIACRITICS (1L << 6) /* U+0300-U+036F */ - /* U+1DC0-U+1DFF */ - /* Bit 7 Greek and Coptic */ -#define TT_UCR_GREEK (1L << 7) /* U+0370-U+03FF */ - /* Bit 8 Coptic */ -#define TT_UCR_COPTIC (1L << 8) /* U+2C80-U+2CFF */ - /* Bit 9 Cyrillic */ - /* Cyrillic Supplement */ - /* Cyrillic Extended-A */ - /* Cyrillic Extended-B */ -#define TT_UCR_CYRILLIC (1L << 9) /* U+0400-U+04FF */ - /* U+0500-U+052F */ - /* U+2DE0-U+2DFF */ - /* U+A640-U+A69F */ - /* Bit 10 Armenian */ -#define TT_UCR_ARMENIAN (1L << 10) /* U+0530-U+058F */ - /* Bit 11 Hebrew */ -#define TT_UCR_HEBREW (1L << 11) /* U+0590-U+05FF */ - /* Bit 12 Vai */ -#define TT_UCR_VAI (1L << 12) /* U+A500-U+A63F */ - /* Bit 13 Arabic */ - /* Arabic Supplement */ -#define TT_UCR_ARABIC (1L << 13) /* U+0600-U+06FF */ - /* U+0750-U+077F */ - /* Bit 14 NKo */ -#define TT_UCR_NKO (1L << 14) /* U+07C0-U+07FF */ - /* Bit 15 Devanagari */ -#define TT_UCR_DEVANAGARI (1L << 15) /* U+0900-U+097F */ - /* Bit 16 Bengali */ -#define TT_UCR_BENGALI (1L << 16) /* U+0980-U+09FF */ - /* Bit 17 Gurmukhi */ -#define TT_UCR_GURMUKHI (1L << 17) /* U+0A00-U+0A7F */ - /* Bit 18 Gujarati */ -#define TT_UCR_GUJARATI (1L << 18) /* U+0A80-U+0AFF */ - /* Bit 19 Oriya */ -#define TT_UCR_ORIYA (1L << 19) /* U+0B00-U+0B7F */ - /* Bit 20 Tamil */ -#define TT_UCR_TAMIL (1L << 20) /* U+0B80-U+0BFF */ - /* Bit 21 Telugu */ -#define TT_UCR_TELUGU (1L << 21) /* U+0C00-U+0C7F */ - /* Bit 22 Kannada */ -#define TT_UCR_KANNADA (1L << 22) /* U+0C80-U+0CFF */ - /* Bit 23 Malayalam */ -#define TT_UCR_MALAYALAM (1L << 23) /* U+0D00-U+0D7F */ - /* Bit 24 Thai */ -#define TT_UCR_THAI (1L << 24) /* U+0E00-U+0E7F */ - /* Bit 25 Lao */ -#define TT_UCR_LAO (1L << 25) /* U+0E80-U+0EFF */ - /* Bit 26 Georgian */ - /* Georgian Supplement */ -#define TT_UCR_GEORGIAN (1L << 26) /* U+10A0-U+10FF */ - /* U+2D00-U+2D2F */ - /* Bit 27 Balinese */ -#define TT_UCR_BALINESE (1L << 27) /* U+1B00-U+1B7F */ - /* Bit 28 Hangul Jamo */ -#define TT_UCR_HANGUL_JAMO (1L << 28) /* U+1100-U+11FF */ - /* Bit 29 Latin Extended Additional */ - /* Latin Extended-C */ - /* Latin Extended-D */ -#define TT_UCR_LATIN_EXTENDED_ADDITIONAL (1L << 29) /* U+1E00-U+1EFF */ - /* U+2C60-U+2C7F */ - /* U+A720-U+A7FF */ - /* Bit 30 Greek Extended */ -#define TT_UCR_GREEK_EXTENDED (1L << 30) /* U+1F00-U+1FFF */ - /* Bit 31 General Punctuation */ - /* Supplemental Punctuation */ -#define TT_UCR_GENERAL_PUNCTUATION (1L << 31) /* U+2000-U+206F */ - /* U+2E00-U+2E7F */ - /* Bit 32 Superscripts And Subscripts */ -#define TT_UCR_SUPERSCRIPTS_SUBSCRIPTS (1L << 0) /* U+2070-U+209F */ - /* Bit 33 Currency Symbols */ -#define TT_UCR_CURRENCY_SYMBOLS (1L << 1) /* U+20A0-U+20CF */ - /* Bit 34 Combining Diacritical Marks For Symbols */ -#define TT_UCR_COMBINING_DIACRITICS_SYMB (1L << 2) /* U+20D0-U+20FF */ - /* Bit 35 Letterlike Symbols */ -#define TT_UCR_LETTERLIKE_SYMBOLS (1L << 3) /* U+2100-U+214F */ - /* Bit 36 Number Forms */ -#define TT_UCR_NUMBER_FORMS (1L << 4) /* U+2150-U+218F */ - /* Bit 37 Arrows */ - /* Supplemental Arrows-A */ - /* Supplemental Arrows-B */ - /* Miscellaneous Symbols and Arrows */ -#define TT_UCR_ARROWS (1L << 5) /* U+2190-U+21FF */ - /* U+27F0-U+27FF */ - /* U+2900-U+297F */ - /* U+2B00-U+2BFF */ - /* Bit 38 Mathematical Operators */ - /* Supplemental Mathematical Operators */ - /* Miscellaneous Mathematical Symbols-A */ - /* Miscellaneous Mathematical Symbols-B */ -#define TT_UCR_MATHEMATICAL_OPERATORS (1L << 6) /* U+2200-U+22FF */ - /* U+2A00-U+2AFF */ - /* U+27C0-U+27EF */ - /* U+2980-U+29FF */ - /* Bit 39 Miscellaneous Technical */ -#define TT_UCR_MISCELLANEOUS_TECHNICAL (1L << 7) /* U+2300-U+23FF */ - /* Bit 40 Control Pictures */ -#define TT_UCR_CONTROL_PICTURES (1L << 8) /* U+2400-U+243F */ - /* Bit 41 Optical Character Recognition */ -#define TT_UCR_OCR (1L << 9) /* U+2440-U+245F */ - /* Bit 42 Enclosed Alphanumerics */ -#define TT_UCR_ENCLOSED_ALPHANUMERICS (1L << 10) /* U+2460-U+24FF */ - /* Bit 43 Box Drawing */ -#define TT_UCR_BOX_DRAWING (1L << 11) /* U+2500-U+257F */ - /* Bit 44 Block Elements */ -#define TT_UCR_BLOCK_ELEMENTS (1L << 12) /* U+2580-U+259F */ - /* Bit 45 Geometric Shapes */ -#define TT_UCR_GEOMETRIC_SHAPES (1L << 13) /* U+25A0-U+25FF */ - /* Bit 46 Miscellaneous Symbols */ -#define TT_UCR_MISCELLANEOUS_SYMBOLS (1L << 14) /* U+2600-U+26FF */ - /* Bit 47 Dingbats */ -#define TT_UCR_DINGBATS (1L << 15) /* U+2700-U+27BF */ - /* Bit 48 CJK Symbols and Punctuation */ -#define TT_UCR_CJK_SYMBOLS (1L << 16) /* U+3000-U+303F */ - /* Bit 49 Hiragana */ -#define TT_UCR_HIRAGANA (1L << 17) /* U+3040-U+309F */ - /* Bit 50 Katakana */ - /* Katakana Phonetic Extensions */ -#define TT_UCR_KATAKANA (1L << 18) /* U+30A0-U+30FF */ - /* U+31F0-U+31FF */ - /* Bit 51 Bopomofo */ - /* Bopomofo Extended */ -#define TT_UCR_BOPOMOFO (1L << 19) /* U+3100-U+312F */ - /* U+31A0-U+31BF */ - /* Bit 52 Hangul Compatibility Jamo */ -#define TT_UCR_HANGUL_COMPATIBILITY_JAMO (1L << 20) /* U+3130-U+318F */ - /* Bit 53 Phags-Pa */ -#define TT_UCR_CJK_MISC (1L << 21) /* U+A840-U+A87F */ -#define TT_UCR_KANBUN TT_UCR_CJK_MISC /* deprecated */ -#define TT_UCR_PHAGSPA - /* Bit 54 Enclosed CJK Letters and Months */ -#define TT_UCR_ENCLOSED_CJK_LETTERS_MONTHS (1L << 22) /* U+3200-U+32FF */ - /* Bit 55 CJK Compatibility */ -#define TT_UCR_CJK_COMPATIBILITY (1L << 23) /* U+3300-U+33FF */ - /* Bit 56 Hangul Syllables */ -#define TT_UCR_HANGUL (1L << 24) /* U+AC00-U+D7A3 */ - /* Bit 57 High Surrogates */ - /* High Private Use Surrogates */ - /* Low Surrogates */ - /* */ - /* According to OpenType specs v.1.3+, */ - /* setting bit 57 implies that there is */ - /* at least one codepoint beyond the */ - /* Basic Multilingual Plane that is */ - /* supported by this font. So it really */ - /* means >= U+10000 */ -#define TT_UCR_SURROGATES (1L << 25) /* U+D800-U+DB7F */ - /* U+DB80-U+DBFF */ - /* U+DC00-U+DFFF */ -#define TT_UCR_NON_PLANE_0 TT_UCR_SURROGATES - /* Bit 58 Phoenician */ -#define TT_UCR_PHOENICIAN (1L << 26) /*U+10900-U+1091F*/ - /* Bit 59 CJK Unified Ideographs */ - /* CJK Radicals Supplement */ - /* Kangxi Radicals */ - /* Ideographic Description Characters */ - /* CJK Unified Ideographs Extension A */ - /* CJK Unified Ideographs Extension B */ - /* Kanbun */ -#define TT_UCR_CJK_UNIFIED_IDEOGRAPHS (1L << 27) /* U+4E00-U+9FFF */ - /* U+2E80-U+2EFF */ - /* U+2F00-U+2FDF */ - /* U+2FF0-U+2FFF */ - /* U+3400-U+4DB5 */ - /*U+20000-U+2A6DF*/ - /* U+3190-U+319F */ - /* Bit 60 Private Use */ -#define TT_UCR_PRIVATE_USE (1L << 28) /* U+E000-U+F8FF */ - /* Bit 61 CJK Strokes */ - /* CJK Compatibility Ideographs */ - /* CJK Compatibility Ideographs Supplement */ -#define TT_UCR_CJK_COMPATIBILITY_IDEOGRAPHS (1L << 29) /* U+31C0-U+31EF */ - /* U+F900-U+FAFF */ - /*U+2F800-U+2FA1F*/ - /* Bit 62 Alphabetic Presentation Forms */ -#define TT_UCR_ALPHABETIC_PRESENTATION_FORMS (1L << 30) /* U+FB00-U+FB4F */ - /* Bit 63 Arabic Presentation Forms-A */ -#define TT_UCR_ARABIC_PRESENTATIONS_A (1L << 31) /* U+FB50-U+FDFF */ - /* Bit 64 Combining Half Marks */ -#define TT_UCR_COMBINING_HALF_MARKS (1L << 0) /* U+FE20-U+FE2F */ - /* Bit 65 Vertical forms */ - /* CJK Compatibility Forms */ -#define TT_UCR_CJK_COMPATIBILITY_FORMS (1L << 1) /* U+FE10-U+FE1F */ - /* U+FE30-U+FE4F */ - /* Bit 66 Small Form Variants */ -#define TT_UCR_SMALL_FORM_VARIANTS (1L << 2) /* U+FE50-U+FE6F */ - /* Bit 67 Arabic Presentation Forms-B */ -#define TT_UCR_ARABIC_PRESENTATIONS_B (1L << 3) /* U+FE70-U+FEFE */ - /* Bit 68 Halfwidth and Fullwidth Forms */ -#define TT_UCR_HALFWIDTH_FULLWIDTH_FORMS (1L << 4) /* U+FF00-U+FFEF */ - /* Bit 69 Specials */ -#define TT_UCR_SPECIALS (1L << 5) /* U+FFF0-U+FFFD */ - /* Bit 70 Tibetan */ -#define TT_UCR_TIBETAN (1L << 6) /* U+0F00-U+0FFF */ - /* Bit 71 Syriac */ -#define TT_UCR_SYRIAC (1L << 7) /* U+0700-U+074F */ - /* Bit 72 Thaana */ -#define TT_UCR_THAANA (1L << 8) /* U+0780-U+07BF */ - /* Bit 73 Sinhala */ -#define TT_UCR_SINHALA (1L << 9) /* U+0D80-U+0DFF */ - /* Bit 74 Myanmar */ -#define TT_UCR_MYANMAR (1L << 10) /* U+1000-U+109F */ - /* Bit 75 Ethiopic */ - /* Ethiopic Supplement */ - /* Ethiopic Extended */ -#define TT_UCR_ETHIOPIC (1L << 11) /* U+1200-U+137F */ - /* U+1380-U+139F */ - /* U+2D80-U+2DDF */ - /* Bit 76 Cherokee */ -#define TT_UCR_CHEROKEE (1L << 12) /* U+13A0-U+13FF */ - /* Bit 77 Unified Canadian Aboriginal Syllabics */ -#define TT_UCR_CANADIAN_ABORIGINAL_SYLLABICS (1L << 13) /* U+1400-U+167F */ - /* Bit 78 Ogham */ -#define TT_UCR_OGHAM (1L << 14) /* U+1680-U+169F */ - /* Bit 79 Runic */ -#define TT_UCR_RUNIC (1L << 15) /* U+16A0-U+16FF */ - /* Bit 80 Khmer */ - /* Khmer Symbols */ -#define TT_UCR_KHMER (1L << 16) /* U+1780-U+17FF */ - /* U+19E0-U+19FF */ - /* Bit 81 Mongolian */ -#define TT_UCR_MONGOLIAN (1L << 17) /* U+1800-U+18AF */ - /* Bit 82 Braille Patterns */ -#define TT_UCR_BRAILLE (1L << 18) /* U+2800-U+28FF */ - /* Bit 83 Yi Syllables */ - /* Yi Radicals */ -#define TT_UCR_YI (1L << 19) /* U+A000-U+A48F */ - /* U+A490-U+A4CF */ - /* Bit 84 Tagalog */ - /* Hanunoo */ - /* Buhid */ - /* Tagbanwa */ -#define TT_UCR_PHILIPPINE (1L << 20) /* U+1700-U+171F */ - /* U+1720-U+173F */ - /* U+1740-U+175F */ - /* U+1760-U+177F */ - /* Bit 85 Old Italic */ -#define TT_UCR_OLD_ITALIC (1L << 21) /*U+10300-U+1032F*/ - /* Bit 86 Gothic */ -#define TT_UCR_GOTHIC (1L << 22) /*U+10330-U+1034F*/ - /* Bit 87 Deseret */ -#define TT_UCR_DESERET (1L << 23) /*U+10400-U+1044F*/ - /* Bit 88 Byzantine Musical Symbols */ - /* Musical Symbols */ - /* Ancient Greek Musical Notation */ -#define TT_UCR_MUSICAL_SYMBOLS (1L << 24) /*U+1D000-U+1D0FF*/ - /*U+1D100-U+1D1FF*/ - /*U+1D200-U+1D24F*/ - /* Bit 89 Mathematical Alphanumeric Symbols */ -#define TT_UCR_MATH_ALPHANUMERIC_SYMBOLS (1L << 25) /*U+1D400-U+1D7FF*/ - /* Bit 90 Private Use (plane 15) */ - /* Private Use (plane 16) */ -#define TT_UCR_PRIVATE_USE_SUPPLEMENTARY (1L << 26) /*U+F0000-U+FFFFD*/ - /*U+100000-U+10FFFD*/ - /* Bit 91 Variation Selectors */ - /* Variation Selectors Supplement */ -#define TT_UCR_VARIATION_SELECTORS (1L << 27) /* U+FE00-U+FE0F */ - /*U+E0100-U+E01EF*/ - /* Bit 92 Tags */ -#define TT_UCR_TAGS (1L << 28) /*U+E0000-U+E007F*/ - /* Bit 93 Limbu */ -#define TT_UCR_LIMBU (1L << 29) /* U+1900-U+194F */ - /* Bit 94 Tai Le */ -#define TT_UCR_TAI_LE (1L << 30) /* U+1950-U+197F */ - /* Bit 95 New Tai Lue */ -#define TT_UCR_NEW_TAI_LUE (1L << 31) /* U+1980-U+19DF */ - /* Bit 96 Buginese */ -#define TT_UCR_BUGINESE (1L << 0) /* U+1A00-U+1A1F */ - /* Bit 97 Glagolitic */ -#define TT_UCR_GLAGOLITIC (1L << 1) /* U+2C00-U+2C5F */ - /* Bit 98 Tifinagh */ -#define TT_UCR_TIFINAGH (1L << 2) /* U+2D30-U+2D7F */ - /* Bit 99 Yijing Hexagram Symbols */ -#define TT_UCR_YIJING (1L << 3) /* U+4DC0-U+4DFF */ - /* Bit 100 Syloti Nagri */ -#define TT_UCR_SYLOTI_NAGRI (1L << 4) /* U+A800-U+A82F */ - /* Bit 101 Linear B Syllabary */ - /* Linear B Ideograms */ - /* Aegean Numbers */ -#define TT_UCR_LINEAR_B (1L << 5) /*U+10000-U+1007F*/ - /*U+10080-U+100FF*/ - /*U+10100-U+1013F*/ - /* Bit 102 Ancient Greek Numbers */ -#define TT_UCR_ANCIENT_GREEK_NUMBERS (1L << 6) /*U+10140-U+1018F*/ - /* Bit 103 Ugaritic */ -#define TT_UCR_UGARITIC (1L << 7) /*U+10380-U+1039F*/ - /* Bit 104 Old Persian */ -#define TT_UCR_OLD_PERSIAN (1L << 8) /*U+103A0-U+103DF*/ - /* Bit 105 Shavian */ -#define TT_UCR_SHAVIAN (1L << 9) /*U+10450-U+1047F*/ - /* Bit 106 Osmanya */ -#define TT_UCR_OSMANYA (1L << 10) /*U+10480-U+104AF*/ - /* Bit 107 Cypriot Syllabary */ -#define TT_UCR_CYPRIOT_SYLLABARY (1L << 11) /*U+10800-U+1083F*/ - /* Bit 108 Kharoshthi */ -#define TT_UCR_KHAROSHTHI (1L << 12) /*U+10A00-U+10A5F*/ - /* Bit 109 Tai Xuan Jing Symbols */ -#define TT_UCR_TAI_XUAN_JING (1L << 13) /*U+1D300-U+1D35F*/ - /* Bit 110 Cuneiform */ - /* Cuneiform Numbers and Punctuation */ -#define TT_UCR_CUNEIFORM (1L << 14) /*U+12000-U+123FF*/ - /*U+12400-U+1247F*/ - /* Bit 111 Counting Rod Numerals */ -#define TT_UCR_COUNTING_ROD_NUMERALS (1L << 15) /*U+1D360-U+1D37F*/ - /* Bit 112 Sundanese */ -#define TT_UCR_SUNDANESE (1L << 16) /* U+1B80-U+1BBF */ - /* Bit 113 Lepcha */ -#define TT_UCR_LEPCHA (1L << 17) /* U+1C00-U+1C4F */ - /* Bit 114 Ol Chiki */ -#define TT_UCR_OL_CHIKI (1L << 18) /* U+1C50-U+1C7F */ - /* Bit 115 Saurashtra */ -#define TT_UCR_SAURASHTRA (1L << 19) /* U+A880-U+A8DF */ - /* Bit 116 Kayah Li */ -#define TT_UCR_KAYAH_LI (1L << 20) /* U+A900-U+A92F */ - /* Bit 117 Rejang */ -#define TT_UCR_REJANG (1L << 21) /* U+A930-U+A95F */ - /* Bit 118 Cham */ -#define TT_UCR_CHAM (1L << 22) /* U+AA00-U+AA5F */ - /* Bit 119 Ancient Symbols */ -#define TT_UCR_ANCIENT_SYMBOLS (1L << 23) /*U+10190-U+101CF*/ - /* Bit 120 Phaistos Disc */ -#define TT_UCR_PHAISTOS_DISC (1L << 24) /*U+101D0-U+101FF*/ - /* Bit 121 Carian */ - /* Lycian */ - /* Lydian */ -#define TT_UCR_OLD_ANATOLIAN (1L << 25) /*U+102A0-U+102DF*/ - /*U+10280-U+1029F*/ - /*U+10920-U+1093F*/ - /* Bit 122 Domino Tiles */ - /* Mahjong Tiles */ -#define TT_UCR_GAME_TILES (1L << 26) /*U+1F030-U+1F09F*/ - /*U+1F000-U+1F02F*/ - /* Bit 123-127 Reserved for process-internal usage */ - - - /*************************************************************************/ - /* */ - /* Some compilers have a very limited length of identifiers. */ - /* */ -#if defined( __TURBOC__ ) && __TURBOC__ < 0x0410 || defined( __PACIFIC__ ) -#define HAVE_LIMIT_ON_IDENTS -#endif - - -#ifndef HAVE_LIMIT_ON_IDENTS - - - /*************************************************************************/ - /* */ - /* Here some alias #defines in order to be clearer. */ - /* */ - /* These are not always #defined to stay within the 31~character limit */ - /* which some compilers have. */ - /* */ - /* Credits go to Dave Hoo <dhoo@flash.net> for pointing out that modern */ - /* Borland compilers (read: from BC++ 3.1 on) can increase this limit. */ - /* If you get a warning with such a compiler, use the -i40 switch. */ - /* */ -#define TT_UCR_ARABIC_PRESENTATION_FORMS_A \ - TT_UCR_ARABIC_PRESENTATIONS_A -#define TT_UCR_ARABIC_PRESENTATION_FORMS_B \ - TT_UCR_ARABIC_PRESENTATIONS_B - -#define TT_UCR_COMBINING_DIACRITICAL_MARKS \ - TT_UCR_COMBINING_DIACRITICS -#define TT_UCR_COMBINING_DIACRITICAL_MARKS_SYMB \ - TT_UCR_COMBINING_DIACRITICS_SYMB - - -#endif /* !HAVE_LIMIT_ON_IDENTS */ - - -FT_END_HEADER - -#endif /* __TTNAMEID_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/tttables.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/tttables.h deleted file mode 100644 index 02236c2005..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/tttables.h +++ /dev/null @@ -1,763 +0,0 @@ -/***************************************************************************/ -/* */ -/* tttables.h */ -/* */ -/* Basic SFNT/TrueType tables definitions and interface */ -/* (specification only). */ -/* */ -/* Copyright 1996-2005, 2008-2011 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __TTTABLES_H__ -#define __TTTABLES_H__ - - -#include <ft2build.h> -#include FT_FREETYPE_H - -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - - -FT_BEGIN_HEADER - - /*************************************************************************/ - /* */ - /* <Section> */ - /* truetype_tables */ - /* */ - /* <Title> */ - /* TrueType Tables */ - /* */ - /* <Abstract> */ - /* TrueType specific table types and functions. */ - /* */ - /* <Description> */ - /* This section contains the definition of TrueType-specific tables */ - /* as well as some routines used to access and process them. */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* TT_Header */ - /* */ - /* <Description> */ - /* A structure used to model a TrueType font header table. All */ - /* fields follow the TrueType specification. */ - /* */ - typedef struct TT_Header_ - { - FT_Fixed Table_Version; - FT_Fixed Font_Revision; - - FT_Long CheckSum_Adjust; - FT_Long Magic_Number; - - FT_UShort Flags; - FT_UShort Units_Per_EM; - - FT_Long Created [2]; - FT_Long Modified[2]; - - FT_Short xMin; - FT_Short yMin; - FT_Short xMax; - FT_Short yMax; - - FT_UShort Mac_Style; - FT_UShort Lowest_Rec_PPEM; - - FT_Short Font_Direction; - FT_Short Index_To_Loc_Format; - FT_Short Glyph_Data_Format; - - } TT_Header; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* TT_HoriHeader */ - /* */ - /* <Description> */ - /* A structure used to model a TrueType horizontal header, the `hhea' */ - /* table, as well as the corresponding horizontal metrics table, */ - /* i.e., the `hmtx' table. */ - /* */ - /* <Fields> */ - /* Version :: The table version. */ - /* */ - /* Ascender :: The font's ascender, i.e., the distance */ - /* from the baseline to the top-most of all */ - /* glyph points found in the font. */ - /* */ - /* This value is invalid in many fonts, as */ - /* it is usually set by the font designer, */ - /* and often reflects only a portion of the */ - /* glyphs found in the font (maybe ASCII). */ - /* */ - /* You should use the `sTypoAscender' field */ - /* of the OS/2 table instead if you want */ - /* the correct one. */ - /* */ - /* Descender :: The font's descender, i.e., the distance */ - /* from the baseline to the bottom-most of */ - /* all glyph points found in the font. It */ - /* is negative. */ - /* */ - /* This value is invalid in many fonts, as */ - /* it is usually set by the font designer, */ - /* and often reflects only a portion of the */ - /* glyphs found in the font (maybe ASCII). */ - /* */ - /* You should use the `sTypoDescender' */ - /* field of the OS/2 table instead if you */ - /* want the correct one. */ - /* */ - /* Line_Gap :: The font's line gap, i.e., the distance */ - /* to add to the ascender and descender to */ - /* get the BTB, i.e., the */ - /* baseline-to-baseline distance for the */ - /* font. */ - /* */ - /* advance_Width_Max :: This field is the maximum of all advance */ - /* widths found in the font. It can be */ - /* used to compute the maximum width of an */ - /* arbitrary string of text. */ - /* */ - /* min_Left_Side_Bearing :: The minimum left side bearing of all */ - /* glyphs within the font. */ - /* */ - /* min_Right_Side_Bearing :: The minimum right side bearing of all */ - /* glyphs within the font. */ - /* */ - /* xMax_Extent :: The maximum horizontal extent (i.e., the */ - /* `width' of a glyph's bounding box) for */ - /* all glyphs in the font. */ - /* */ - /* caret_Slope_Rise :: The rise coefficient of the cursor's */ - /* slope of the cursor (slope=rise/run). */ - /* */ - /* caret_Slope_Run :: The run coefficient of the cursor's */ - /* slope. */ - /* */ - /* Reserved :: 8~reserved bytes. */ - /* */ - /* metric_Data_Format :: Always~0. */ - /* */ - /* number_Of_HMetrics :: Number of HMetrics entries in the `hmtx' */ - /* table -- this value can be smaller than */ - /* the total number of glyphs in the font. */ - /* */ - /* long_metrics :: A pointer into the `hmtx' table. */ - /* */ - /* short_metrics :: A pointer into the `hmtx' table. */ - /* */ - /* <Note> */ - /* IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should */ - /* be identical except for the names of their fields which */ - /* are different. */ - /* */ - /* This ensures that a single function in the `ttload' */ - /* module is able to read both the horizontal and vertical */ - /* headers. */ - /* */ - typedef struct TT_HoriHeader_ - { - FT_Fixed Version; - FT_Short Ascender; - FT_Short Descender; - FT_Short Line_Gap; - - FT_UShort advance_Width_Max; /* advance width maximum */ - - FT_Short min_Left_Side_Bearing; /* minimum left-sb */ - FT_Short min_Right_Side_Bearing; /* minimum right-sb */ - FT_Short xMax_Extent; /* xmax extents */ - FT_Short caret_Slope_Rise; - FT_Short caret_Slope_Run; - FT_Short caret_Offset; - - FT_Short Reserved[4]; - - FT_Short metric_Data_Format; - FT_UShort number_Of_HMetrics; - - /* The following fields are not defined by the TrueType specification */ - /* but they are used to connect the metrics header to the relevant */ - /* `HMTX' table. */ - - void* long_metrics; - void* short_metrics; - - } TT_HoriHeader; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* TT_VertHeader */ - /* */ - /* <Description> */ - /* A structure used to model a TrueType vertical header, the `vhea' */ - /* table, as well as the corresponding vertical metrics table, i.e., */ - /* the `vmtx' table. */ - /* */ - /* <Fields> */ - /* Version :: The table version. */ - /* */ - /* Ascender :: The font's ascender, i.e., the distance */ - /* from the baseline to the top-most of */ - /* all glyph points found in the font. */ - /* */ - /* This value is invalid in many fonts, as */ - /* it is usually set by the font designer, */ - /* and often reflects only a portion of */ - /* the glyphs found in the font (maybe */ - /* ASCII). */ - /* */ - /* You should use the `sTypoAscender' */ - /* field of the OS/2 table instead if you */ - /* want the correct one. */ - /* */ - /* Descender :: The font's descender, i.e., the */ - /* distance from the baseline to the */ - /* bottom-most of all glyph points found */ - /* in the font. It is negative. */ - /* */ - /* This value is invalid in many fonts, as */ - /* it is usually set by the font designer, */ - /* and often reflects only a portion of */ - /* the glyphs found in the font (maybe */ - /* ASCII). */ - /* */ - /* You should use the `sTypoDescender' */ - /* field of the OS/2 table instead if you */ - /* want the correct one. */ - /* */ - /* Line_Gap :: The font's line gap, i.e., the distance */ - /* to add to the ascender and descender to */ - /* get the BTB, i.e., the */ - /* baseline-to-baseline distance for the */ - /* font. */ - /* */ - /* advance_Height_Max :: This field is the maximum of all */ - /* advance heights found in the font. It */ - /* can be used to compute the maximum */ - /* height of an arbitrary string of text. */ - /* */ - /* min_Top_Side_Bearing :: The minimum top side bearing of all */ - /* glyphs within the font. */ - /* */ - /* min_Bottom_Side_Bearing :: The minimum bottom side bearing of all */ - /* glyphs within the font. */ - /* */ - /* yMax_Extent :: The maximum vertical extent (i.e., the */ - /* `height' of a glyph's bounding box) for */ - /* all glyphs in the font. */ - /* */ - /* caret_Slope_Rise :: The rise coefficient of the cursor's */ - /* slope of the cursor (slope=rise/run). */ - /* */ - /* caret_Slope_Run :: The run coefficient of the cursor's */ - /* slope. */ - /* */ - /* caret_Offset :: The cursor's offset for slanted fonts. */ - /* This value is `reserved' in vmtx */ - /* version 1.0. */ - /* */ - /* Reserved :: 8~reserved bytes. */ - /* */ - /* metric_Data_Format :: Always~0. */ - /* */ - /* number_Of_HMetrics :: Number of VMetrics entries in the */ - /* `vmtx' table -- this value can be */ - /* smaller than the total number of glyphs */ - /* in the font. */ - /* */ - /* long_metrics :: A pointer into the `vmtx' table. */ - /* */ - /* short_metrics :: A pointer into the `vmtx' table. */ - /* */ - /* <Note> */ - /* IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should */ - /* be identical except for the names of their fields which */ - /* are different. */ - /* */ - /* This ensures that a single function in the `ttload' */ - /* module is able to read both the horizontal and vertical */ - /* headers. */ - /* */ - typedef struct TT_VertHeader_ - { - FT_Fixed Version; - FT_Short Ascender; - FT_Short Descender; - FT_Short Line_Gap; - - FT_UShort advance_Height_Max; /* advance height maximum */ - - FT_Short min_Top_Side_Bearing; /* minimum left-sb or top-sb */ - FT_Short min_Bottom_Side_Bearing; /* minimum right-sb or bottom-sb */ - FT_Short yMax_Extent; /* xmax or ymax extents */ - FT_Short caret_Slope_Rise; - FT_Short caret_Slope_Run; - FT_Short caret_Offset; - - FT_Short Reserved[4]; - - FT_Short metric_Data_Format; - FT_UShort number_Of_VMetrics; - - /* The following fields are not defined by the TrueType specification */ - /* but they're used to connect the metrics header to the relevant */ - /* `HMTX' or `VMTX' table. */ - - void* long_metrics; - void* short_metrics; - - } TT_VertHeader; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* TT_OS2 */ - /* */ - /* <Description> */ - /* A structure used to model a TrueType OS/2 table. This is the long */ - /* table version. All fields comply to the TrueType specification. */ - /* */ - /* Note that we now support old Mac fonts which do not include an */ - /* OS/2 table. In this case, the `version' field is always set to */ - /* 0xFFFF. */ - /* */ - typedef struct TT_OS2_ - { - FT_UShort version; /* 0x0001 - more or 0xFFFF */ - FT_Short xAvgCharWidth; - FT_UShort usWeightClass; - FT_UShort usWidthClass; - FT_Short fsType; - FT_Short ySubscriptXSize; - FT_Short ySubscriptYSize; - FT_Short ySubscriptXOffset; - FT_Short ySubscriptYOffset; - FT_Short ySuperscriptXSize; - FT_Short ySuperscriptYSize; - FT_Short ySuperscriptXOffset; - FT_Short ySuperscriptYOffset; - FT_Short yStrikeoutSize; - FT_Short yStrikeoutPosition; - FT_Short sFamilyClass; - - FT_Byte panose[10]; - - FT_ULong ulUnicodeRange1; /* Bits 0-31 */ - FT_ULong ulUnicodeRange2; /* Bits 32-63 */ - FT_ULong ulUnicodeRange3; /* Bits 64-95 */ - FT_ULong ulUnicodeRange4; /* Bits 96-127 */ - - FT_Char achVendID[4]; - - FT_UShort fsSelection; - FT_UShort usFirstCharIndex; - FT_UShort usLastCharIndex; - FT_Short sTypoAscender; - FT_Short sTypoDescender; - FT_Short sTypoLineGap; - FT_UShort usWinAscent; - FT_UShort usWinDescent; - - /* only version 1 tables: */ - - FT_ULong ulCodePageRange1; /* Bits 0-31 */ - FT_ULong ulCodePageRange2; /* Bits 32-63 */ - - /* only version 2 tables: */ - - FT_Short sxHeight; - FT_Short sCapHeight; - FT_UShort usDefaultChar; - FT_UShort usBreakChar; - FT_UShort usMaxContext; - - } TT_OS2; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* TT_Postscript */ - /* */ - /* <Description> */ - /* A structure used to model a TrueType PostScript table. All fields */ - /* comply to the TrueType specification. This structure does not */ - /* reference the PostScript glyph names, which can be nevertheless */ - /* accessed with the `ttpost' module. */ - /* */ - typedef struct TT_Postscript_ - { - FT_Fixed FormatType; - FT_Fixed italicAngle; - FT_Short underlinePosition; - FT_Short underlineThickness; - FT_ULong isFixedPitch; - FT_ULong minMemType42; - FT_ULong maxMemType42; - FT_ULong minMemType1; - FT_ULong maxMemType1; - - /* Glyph names follow in the file, but we don't */ - /* load them by default. See the ttpost.c file. */ - - } TT_Postscript; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* TT_PCLT */ - /* */ - /* <Description> */ - /* A structure used to model a TrueType PCLT table. All fields */ - /* comply to the TrueType specification. */ - /* */ - typedef struct TT_PCLT_ - { - FT_Fixed Version; - FT_ULong FontNumber; - FT_UShort Pitch; - FT_UShort xHeight; - FT_UShort Style; - FT_UShort TypeFamily; - FT_UShort CapHeight; - FT_UShort SymbolSet; - FT_Char TypeFace[16]; - FT_Char CharacterComplement[8]; - FT_Char FileName[6]; - FT_Char StrokeWeight; - FT_Char WidthType; - FT_Byte SerifStyle; - FT_Byte Reserved; - - } TT_PCLT; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* TT_MaxProfile */ - /* */ - /* <Description> */ - /* The maximum profile is a table containing many max values which */ - /* can be used to pre-allocate arrays. This ensures that no memory */ - /* allocation occurs during a glyph load. */ - /* */ - /* <Fields> */ - /* version :: The version number. */ - /* */ - /* numGlyphs :: The number of glyphs in this TrueType */ - /* font. */ - /* */ - /* maxPoints :: The maximum number of points in a */ - /* non-composite TrueType glyph. See also */ - /* the structure element */ - /* `maxCompositePoints'. */ - /* */ - /* maxContours :: The maximum number of contours in a */ - /* non-composite TrueType glyph. See also */ - /* the structure element */ - /* `maxCompositeContours'. */ - /* */ - /* maxCompositePoints :: The maximum number of points in a */ - /* composite TrueType glyph. See also the */ - /* structure element `maxPoints'. */ - /* */ - /* maxCompositeContours :: The maximum number of contours in a */ - /* composite TrueType glyph. See also the */ - /* structure element `maxContours'. */ - /* */ - /* maxZones :: The maximum number of zones used for */ - /* glyph hinting. */ - /* */ - /* maxTwilightPoints :: The maximum number of points in the */ - /* twilight zone used for glyph hinting. */ - /* */ - /* maxStorage :: The maximum number of elements in the */ - /* storage area used for glyph hinting. */ - /* */ - /* maxFunctionDefs :: The maximum number of function */ - /* definitions in the TrueType bytecode for */ - /* this font. */ - /* */ - /* maxInstructionDefs :: The maximum number of instruction */ - /* definitions in the TrueType bytecode for */ - /* this font. */ - /* */ - /* maxStackElements :: The maximum number of stack elements used */ - /* during bytecode interpretation. */ - /* */ - /* maxSizeOfInstructions :: The maximum number of TrueType opcodes */ - /* used for glyph hinting. */ - /* */ - /* maxComponentElements :: The maximum number of simple (i.e., non- */ - /* composite) glyphs in a composite glyph. */ - /* */ - /* maxComponentDepth :: The maximum nesting depth of composite */ - /* glyphs. */ - /* */ - /* <Note> */ - /* This structure is only used during font loading. */ - /* */ - typedef struct TT_MaxProfile_ - { - FT_Fixed version; - FT_UShort numGlyphs; - FT_UShort maxPoints; - FT_UShort maxContours; - FT_UShort maxCompositePoints; - FT_UShort maxCompositeContours; - FT_UShort maxZones; - FT_UShort maxTwilightPoints; - FT_UShort maxStorage; - FT_UShort maxFunctionDefs; - FT_UShort maxInstructionDefs; - FT_UShort maxStackElements; - FT_UShort maxSizeOfInstructions; - FT_UShort maxComponentElements; - FT_UShort maxComponentDepth; - - } TT_MaxProfile; - - - /*************************************************************************/ - /* */ - /* <Enum> */ - /* FT_Sfnt_Tag */ - /* */ - /* <Description> */ - /* An enumeration used to specify the index of an SFNT table. */ - /* Used in the @FT_Get_Sfnt_Table API function. */ - /* */ - typedef enum FT_Sfnt_Tag_ - { - ft_sfnt_head = 0, /* TT_Header */ - ft_sfnt_maxp = 1, /* TT_MaxProfile */ - ft_sfnt_os2 = 2, /* TT_OS2 */ - ft_sfnt_hhea = 3, /* TT_HoriHeader */ - ft_sfnt_vhea = 4, /* TT_VertHeader */ - ft_sfnt_post = 5, /* TT_Postscript */ - ft_sfnt_pclt = 6, /* TT_PCLT */ - - sfnt_max /* internal end mark */ - - } FT_Sfnt_Tag; - - /* */ - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Get_Sfnt_Table */ - /* */ - /* <Description> */ - /* Return a pointer to a given SFNT table within a face. */ - /* */ - /* <Input> */ - /* face :: A handle to the source. */ - /* */ - /* tag :: The index of the SFNT table. */ - /* */ - /* <Return> */ - /* A type-less pointer to the table. This will be~0 in case of */ - /* error, or if the corresponding table was not found *OR* loaded */ - /* from the file. */ - /* */ - /* Use a typecast according to `tag' to access the structure */ - /* elements. */ - /* */ - /* <Note> */ - /* The table is owned by the face object and disappears with it. */ - /* */ - /* This function is only useful to access SFNT tables that are loaded */ - /* by the sfnt, truetype, and opentype drivers. See @FT_Sfnt_Tag for */ - /* a list. */ - /* */ - FT_EXPORT( void* ) - FT_Get_Sfnt_Table( FT_Face face, - FT_Sfnt_Tag tag ); - - - /************************************************************************** - * - * @function: - * FT_Load_Sfnt_Table - * - * @description: - * Load any font table into client memory. - * - * @input: - * face :: - * A handle to the source face. - * - * tag :: - * The four-byte tag of the table to load. Use the value~0 if you want - * to access the whole font file. Otherwise, you can use one of the - * definitions found in the @FT_TRUETYPE_TAGS_H file, or forge a new - * one with @FT_MAKE_TAG. - * - * offset :: - * The starting offset in the table (or file if tag == 0). - * - * @output: - * buffer :: - * The target buffer address. The client must ensure that the memory - * array is big enough to hold the data. - * - * @inout: - * length :: - * If the `length' parameter is NULL, then try to load the whole table. - * Return an error code if it fails. - * - * Else, if `*length' is~0, exit immediately while returning the - * table's (or file) full size in it. - * - * Else the number of bytes to read from the table or file, from the - * starting offset. - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * If you need to determine the table's length you should first call this - * function with `*length' set to~0, as in the following example: - * - * { - * FT_ULong length = 0; - * - * - * error = FT_Load_Sfnt_Table( face, tag, 0, NULL, &length ); - * if ( error ) { ... table does not exist ... } - * - * buffer = malloc( length ); - * if ( buffer == NULL ) { ... not enough memory ... } - * - * error = FT_Load_Sfnt_Table( face, tag, 0, buffer, &length ); - * if ( error ) { ... could not load table ... } - * } - */ - FT_EXPORT( FT_Error ) - FT_Load_Sfnt_Table( FT_Face face, - FT_ULong tag, - FT_Long offset, - FT_Byte* buffer, - FT_ULong* length ); - - - /************************************************************************** - * - * @function: - * FT_Sfnt_Table_Info - * - * @description: - * Return information on an SFNT table. - * - * @input: - * face :: - * A handle to the source face. - * - * table_index :: - * The index of an SFNT table. The function returns - * FT_Err_Table_Missing for an invalid value. - * - * @inout: - * tag :: - * The name tag of the SFNT table. If the value is NULL, `table_index' - * is ignored, and `length' returns the number of SFNT tables in the - * font. - * - * @output: - * length :: - * The length of the SFNT table (or the number of SFNT tables, depending - * on `tag'). - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * SFNT tables with length zero are treated as missing. - * - */ - FT_EXPORT( FT_Error ) - FT_Sfnt_Table_Info( FT_Face face, - FT_UInt table_index, - FT_ULong *tag, - FT_ULong *length ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Get_CMap_Language_ID */ - /* */ - /* <Description> */ - /* Return TrueType/sfnt specific cmap language ID. Definitions of */ - /* language ID values are in `freetype/ttnameid.h'. */ - /* */ - /* <Input> */ - /* charmap :: */ - /* The target charmap. */ - /* */ - /* <Return> */ - /* The language ID of `charmap'. If `charmap' doesn't belong to a */ - /* TrueType/sfnt face, just return~0 as the default value. */ - /* */ - FT_EXPORT( FT_ULong ) - FT_Get_CMap_Language_ID( FT_CharMap charmap ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Get_CMap_Format */ - /* */ - /* <Description> */ - /* Return TrueType/sfnt specific cmap format. */ - /* */ - /* <Input> */ - /* charmap :: */ - /* The target charmap. */ - /* */ - /* <Return> */ - /* The format of `charmap'. If `charmap' doesn't belong to a */ - /* TrueType/sfnt face, return -1. */ - /* */ - FT_EXPORT( FT_Long ) - FT_Get_CMap_Format( FT_CharMap charmap ); - - /* */ - - -FT_END_HEADER - -#endif /* __TTTABLES_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/tttags.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/tttags.h deleted file mode 100644 index 307ce4b637..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/tttags.h +++ /dev/null @@ -1,107 +0,0 @@ -/***************************************************************************/ -/* */ -/* tttags.h */ -/* */ -/* Tags for TrueType and OpenType tables (specification only). */ -/* */ -/* Copyright 1996-2001, 2004, 2005, 2007, 2008 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __TTAGS_H__ -#define __TTAGS_H__ - - -#include <ft2build.h> -#include FT_FREETYPE_H - -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - - -FT_BEGIN_HEADER - - -#define TTAG_avar FT_MAKE_TAG( 'a', 'v', 'a', 'r' ) -#define TTAG_BASE FT_MAKE_TAG( 'B', 'A', 'S', 'E' ) -#define TTAG_bdat FT_MAKE_TAG( 'b', 'd', 'a', 't' ) -#define TTAG_BDF FT_MAKE_TAG( 'B', 'D', 'F', ' ' ) -#define TTAG_bhed FT_MAKE_TAG( 'b', 'h', 'e', 'd' ) -#define TTAG_bloc FT_MAKE_TAG( 'b', 'l', 'o', 'c' ) -#define TTAG_bsln FT_MAKE_TAG( 'b', 's', 'l', 'n' ) -#define TTAG_CFF FT_MAKE_TAG( 'C', 'F', 'F', ' ' ) -#define TTAG_CID FT_MAKE_TAG( 'C', 'I', 'D', ' ' ) -#define TTAG_cmap FT_MAKE_TAG( 'c', 'm', 'a', 'p' ) -#define TTAG_cvar FT_MAKE_TAG( 'c', 'v', 'a', 'r' ) -#define TTAG_cvt FT_MAKE_TAG( 'c', 'v', 't', ' ' ) -#define TTAG_DSIG FT_MAKE_TAG( 'D', 'S', 'I', 'G' ) -#define TTAG_EBDT FT_MAKE_TAG( 'E', 'B', 'D', 'T' ) -#define TTAG_EBLC FT_MAKE_TAG( 'E', 'B', 'L', 'C' ) -#define TTAG_EBSC FT_MAKE_TAG( 'E', 'B', 'S', 'C' ) -#define TTAG_feat FT_MAKE_TAG( 'f', 'e', 'a', 't' ) -#define TTAG_FOND FT_MAKE_TAG( 'F', 'O', 'N', 'D' ) -#define TTAG_fpgm FT_MAKE_TAG( 'f', 'p', 'g', 'm' ) -#define TTAG_fvar FT_MAKE_TAG( 'f', 'v', 'a', 'r' ) -#define TTAG_gasp FT_MAKE_TAG( 'g', 'a', 's', 'p' ) -#define TTAG_GDEF FT_MAKE_TAG( 'G', 'D', 'E', 'F' ) -#define TTAG_glyf FT_MAKE_TAG( 'g', 'l', 'y', 'f' ) -#define TTAG_GPOS FT_MAKE_TAG( 'G', 'P', 'O', 'S' ) -#define TTAG_GSUB FT_MAKE_TAG( 'G', 'S', 'U', 'B' ) -#define TTAG_gvar FT_MAKE_TAG( 'g', 'v', 'a', 'r' ) -#define TTAG_hdmx FT_MAKE_TAG( 'h', 'd', 'm', 'x' ) -#define TTAG_head FT_MAKE_TAG( 'h', 'e', 'a', 'd' ) -#define TTAG_hhea FT_MAKE_TAG( 'h', 'h', 'e', 'a' ) -#define TTAG_hmtx FT_MAKE_TAG( 'h', 'm', 't', 'x' ) -#define TTAG_JSTF FT_MAKE_TAG( 'J', 'S', 'T', 'F' ) -#define TTAG_just FT_MAKE_TAG( 'j', 'u', 's', 't' ) -#define TTAG_kern FT_MAKE_TAG( 'k', 'e', 'r', 'n' ) -#define TTAG_lcar FT_MAKE_TAG( 'l', 'c', 'a', 'r' ) -#define TTAG_loca FT_MAKE_TAG( 'l', 'o', 'c', 'a' ) -#define TTAG_LTSH FT_MAKE_TAG( 'L', 'T', 'S', 'H' ) -#define TTAG_LWFN FT_MAKE_TAG( 'L', 'W', 'F', 'N' ) -#define TTAG_MATH FT_MAKE_TAG( 'M', 'A', 'T', 'H' ) -#define TTAG_maxp FT_MAKE_TAG( 'm', 'a', 'x', 'p' ) -#define TTAG_META FT_MAKE_TAG( 'M', 'E', 'T', 'A' ) -#define TTAG_MMFX FT_MAKE_TAG( 'M', 'M', 'F', 'X' ) -#define TTAG_MMSD FT_MAKE_TAG( 'M', 'M', 'S', 'D' ) -#define TTAG_mort FT_MAKE_TAG( 'm', 'o', 'r', 't' ) -#define TTAG_morx FT_MAKE_TAG( 'm', 'o', 'r', 'x' ) -#define TTAG_name FT_MAKE_TAG( 'n', 'a', 'm', 'e' ) -#define TTAG_opbd FT_MAKE_TAG( 'o', 'p', 'b', 'd' ) -#define TTAG_OS2 FT_MAKE_TAG( 'O', 'S', '/', '2' ) -#define TTAG_OTTO FT_MAKE_TAG( 'O', 'T', 'T', 'O' ) -#define TTAG_PCLT FT_MAKE_TAG( 'P', 'C', 'L', 'T' ) -#define TTAG_POST FT_MAKE_TAG( 'P', 'O', 'S', 'T' ) -#define TTAG_post FT_MAKE_TAG( 'p', 'o', 's', 't' ) -#define TTAG_prep FT_MAKE_TAG( 'p', 'r', 'e', 'p' ) -#define TTAG_prop FT_MAKE_TAG( 'p', 'r', 'o', 'p' ) -#define TTAG_sfnt FT_MAKE_TAG( 's', 'f', 'n', 't' ) -#define TTAG_SING FT_MAKE_TAG( 'S', 'I', 'N', 'G' ) -#define TTAG_trak FT_MAKE_TAG( 't', 'r', 'a', 'k' ) -#define TTAG_true FT_MAKE_TAG( 't', 'r', 'u', 'e' ) -#define TTAG_ttc FT_MAKE_TAG( 't', 't', 'c', ' ' ) -#define TTAG_ttcf FT_MAKE_TAG( 't', 't', 'c', 'f' ) -#define TTAG_TYP1 FT_MAKE_TAG( 'T', 'Y', 'P', '1' ) -#define TTAG_typ1 FT_MAKE_TAG( 't', 'y', 'p', '1' ) -#define TTAG_VDMX FT_MAKE_TAG( 'V', 'D', 'M', 'X' ) -#define TTAG_vhea FT_MAKE_TAG( 'v', 'h', 'e', 'a' ) -#define TTAG_vmtx FT_MAKE_TAG( 'v', 'm', 't', 'x' ) - - -FT_END_HEADER - -#endif /* __TTAGS_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ttunpat.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ttunpat.h deleted file mode 100644 index a0162759b7..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2/freetype/ttunpat.h +++ /dev/null @@ -1,59 +0,0 @@ -/***************************************************************************/ -/* */ -/* ttunpat.h */ -/* */ -/* Definitions for the unpatented TrueType hinting system */ -/* */ -/* Copyright 2003, 2006 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* Written by Graham Asher <graham.asher@btinternet.com> */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __TTUNPAT_H__ -#define __TTUNPAT_H__ - - -#include <ft2build.h> -#include FT_FREETYPE_H - -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - - -FT_BEGIN_HEADER - - - /*************************************************************************** - * - * @constant: - * FT_PARAM_TAG_UNPATENTED_HINTING - * - * @description: - * A constant used as the tag of an @FT_Parameter structure to indicate - * that unpatented methods only should be used by the TrueType bytecode - * interpreter for a typeface opened by @FT_Open_Face. - * - */ -#define FT_PARAM_TAG_UNPATENTED_HINTING FT_MAKE_TAG( 'u', 'n', 'p', 'a' ) - - /* */ - -FT_END_HEADER - - -#endif /* __TTUNPAT_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/ft2build.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/ft2build.h deleted file mode 100644 index 6a3b8d90e9..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/ft2build.h +++ /dev/null @@ -1,61 +0,0 @@ -/***************************************************************************/ -/* */ -/* ft2build.h */ -/* */ -/* Build macros of the FreeType 2 library. */ -/* */ -/* Copyright 1996-2001, 2003, 2006 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - - /*************************************************************************/ - /* */ - /* This is a Unix-specific version of <ft2build.h> that should be used */ - /* exclusively *after* installation of the library. */ - /* */ - /* It assumes that `/usr/local/include/freetype2' (or whatever is */ - /* returned by the `freetype-config --cflags' or `pkg-config --cflags' */ - /* command) is in your compilation include path. */ - /* */ - /* We don't need to do anything special in this release. However, for */ - /* a future FreeType 2 release, the following installation changes will */ - /* be performed: */ - /* */ - /* - The contents of `freetype-2.x/include/freetype' will be installed */ - /* to `/usr/local/include/freetype2' instead of */ - /* `/usr/local/include/freetype2/freetype'. */ - /* */ - /* - This file will #include <freetype2/config/ftheader.h>, instead */ - /* of <freetype/config/ftheader.h>. */ - /* */ - /* - The contents of `ftheader.h' will be processed with `sed' to */ - /* replace all `<freetype/xxx>' with `<freetype2/xxx>'. */ - /* */ - /* - Adding `/usr/local/include/freetype2' to your compilation include */ - /* path will not be necessary anymore. */ - /* */ - /* These changes will be transparent to client applications which use */ - /* freetype-config (or pkg-config). No modifications will be necessary */ - /* to compile with the new scheme. */ - /* */ - /*************************************************************************/ - - -#ifndef __FT2_BUILD_UNIX_H__ -#define __FT2_BUILD_UNIX_H__ - - /* `<prefix>/include/freetype2' must be in your current inclusion path */ -#include <freetype/config/ftheader.h> - -#endif /* __FT2_BUILD_UNIX_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/jconfig.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/jconfig.h deleted file mode 100644 index 5ba6452fe5..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/jconfig.h +++ /dev/null @@ -1,123 +0,0 @@ -/* jconfig.h. Generated from jconfig.cfg by configure. */ -/* jconfig.cfg. Generated from configure.ac by autoheader. */ - -/* Characters are unsigned */ -/* #undef CHAR_IS_UNSIGNED */ - -/* Maximum data space library will allocate. */ -/* #undef DEFAULT_MAX_MEM */ - -/* Don't open files in binary mode. */ -/* #undef DONT_USE_B_MODE */ - -/* Define to 1 if you have the <dlfcn.h> header file. */ -#define HAVE_DLFCN_H 1 - -/* Define to 1 if you have the <inttypes.h> header file. */ -#define HAVE_INTTYPES_H 1 - -/* Define to 1 if you have the <locale.h> header file. */ -#define HAVE_LOCALE_H 1 - -/* Define to 1 if you have the <memory.h> header file. */ -#define HAVE_MEMORY_H 1 - -/* Compiler supports function prototypes. */ -#define HAVE_PROTOTYPES 1 - -/* Define to 1 if you have the <stddef.h> header file. */ -#define HAVE_STDDEF_H 1 - -/* Define to 1 if you have the <stdint.h> header file. */ -#define HAVE_STDINT_H 1 - -/* Define to 1 if you have the <stdlib.h> header file. */ -#define HAVE_STDLIB_H 1 - -/* Define to 1 if you have the <strings.h> header file. */ -#define HAVE_STRINGS_H 1 - -/* Define to 1 if you have the <string.h> header file. */ -#define HAVE_STRING_H 1 - -/* Define to 1 if you have the <sys/stat.h> header file. */ -#define HAVE_SYS_STAT_H 1 - -/* Define to 1 if you have the <sys/types.h> header file. */ -#define HAVE_SYS_TYPES_H 1 - -/* Define to 1 if you have the <unistd.h> header file. */ -#define HAVE_UNISTD_H 1 - -/* Compiler supports 'unsigned char'. */ -#define HAVE_UNSIGNED_CHAR 1 - -/* Compiler supports 'unsigned short'. */ -#define HAVE_UNSIGNED_SHORT 1 - -/* Compiler does not support pointers to unspecified structures. */ -/* #undef INCOMPLETE_TYPES_BROKEN */ - -/* How to obtain function inlining. */ -#define INLINE __inline__ - -/* Define to the sub-directory in which libtool stores uninstalled libraries. - */ -#define LT_OBJDIR ".libs/" - -/* Compiler has <strings.h> rather than standard <string.h>. */ -/* #undef NEED_BSD_STRINGS */ - -/* Linker requires that global names be unique in first 15 characters. */ -/* #undef NEED_SHORT_EXTERNAL_NAMES */ - -/* Need signal handler to clean up temporary files. */ -/* #undef NEED_SIGNAL_CATCHER */ - -/* Need to include <sys/types.h> in order to obtain size_t. */ -/* #undef NEED_SYS_TYPES_H */ - -/* The mktemp() function is not available. */ -/* #undef NO_MKTEMP */ - -/* Name of package */ -#define PACKAGE "libjpeg" - -/* Define to the address where bug reports for this package should be sent. */ -#define PACKAGE_BUGREPORT "" - -/* Define to the full name of this package. */ -#define PACKAGE_NAME "libjpeg" - -/* Define to the full name and version of this package. */ -#define PACKAGE_STRING "libjpeg 8.3.0" - -/* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "libjpeg" - -/* Define to the home page for this package. */ -#define PACKAGE_URL "" - -/* Define to the version of this package. */ -#define PACKAGE_VERSION "8.3.0" - -/* Define to 1 if the C compiler supports function prototypes. */ -#define PROTOTYPES 1 - -/* Broken compiler shifts signed values as an unsigned shift. */ -/* #undef RIGHT_SHIFT_IS_UNSIGNED */ - -/* Define to 1 if you have the ANSI C header files. */ -#define STDC_HEADERS 1 - -/* Version number of package */ -#define VERSION "8.3.0" - -/* Define like PROTOTYPES; this can be used by system headers. */ -#define __PROTOTYPES 1 - -/* Define to empty if `const' does not conform to ANSI C. */ -/* #undef const */ - -/* Define 'void' as 'char' for archaic compilers that don't understand it. */ -/* #undef void */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/jerror.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/jerror.h deleted file mode 100644 index 1cfb2b19d8..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/jerror.h +++ /dev/null @@ -1,304 +0,0 @@ -/* - * jerror.h - * - * Copyright (C) 1994-1997, Thomas G. Lane. - * Modified 1997-2009 by Guido Vollbeding. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file defines the error and message codes for the JPEG library. - * Edit this file to add new codes, or to translate the message strings to - * some other language. - * A set of error-reporting macros are defined too. Some applications using - * the JPEG library may wish to include this file to get the error codes - * and/or the macros. - */ - -/* - * To define the enum list of message codes, include this file without - * defining macro JMESSAGE. To create a message string table, include it - * again with a suitable JMESSAGE definition (see jerror.c for an example). - */ -#ifndef JMESSAGE -#ifndef JERROR_H -/* First time through, define the enum list */ -#define JMAKE_ENUM_LIST -#else -/* Repeated inclusions of this file are no-ops unless JMESSAGE is defined */ -#define JMESSAGE(code,string) -#endif /* JERROR_H */ -#endif /* JMESSAGE */ - -#ifdef JMAKE_ENUM_LIST - -typedef enum { - -#define JMESSAGE(code,string) code , - -#endif /* JMAKE_ENUM_LIST */ - -JMESSAGE(JMSG_NOMESSAGE, "Bogus message code %d") /* Must be first entry! */ - -/* For maintenance convenience, list is alphabetical by message code name */ -JMESSAGE(JERR_BAD_ALIGN_TYPE, "ALIGN_TYPE is wrong, please fix") -JMESSAGE(JERR_BAD_ALLOC_CHUNK, "MAX_ALLOC_CHUNK is wrong, please fix") -JMESSAGE(JERR_BAD_BUFFER_MODE, "Bogus buffer control mode") -JMESSAGE(JERR_BAD_COMPONENT_ID, "Invalid component ID %d in SOS") -JMESSAGE(JERR_BAD_CROP_SPEC, "Invalid crop request") -JMESSAGE(JERR_BAD_DCT_COEF, "DCT coefficient out of range") -JMESSAGE(JERR_BAD_DCTSIZE, "DCT scaled block size %dx%d not supported") -JMESSAGE(JERR_BAD_DROP_SAMPLING, - "Component index %d: mismatching sampling ratio %d:%d, %d:%d, %c") -JMESSAGE(JERR_BAD_HUFF_TABLE, "Bogus Huffman table definition") -JMESSAGE(JERR_BAD_IN_COLORSPACE, "Bogus input colorspace") -JMESSAGE(JERR_BAD_J_COLORSPACE, "Bogus JPEG colorspace") -JMESSAGE(JERR_BAD_LENGTH, "Bogus marker length") -JMESSAGE(JERR_BAD_LIB_VERSION, - "Wrong JPEG library version: library is %d, caller expects %d") -JMESSAGE(JERR_BAD_MCU_SIZE, "Sampling factors too large for interleaved scan") -JMESSAGE(JERR_BAD_POOL_ID, "Invalid memory pool code %d") -JMESSAGE(JERR_BAD_PRECISION, "Unsupported JPEG data precision %d") -JMESSAGE(JERR_BAD_PROGRESSION, - "Invalid progressive parameters Ss=%d Se=%d Ah=%d Al=%d") -JMESSAGE(JERR_BAD_PROG_SCRIPT, - "Invalid progressive parameters at scan script entry %d") -JMESSAGE(JERR_BAD_SAMPLING, "Bogus sampling factors") -JMESSAGE(JERR_BAD_SCAN_SCRIPT, "Invalid scan script at entry %d") -JMESSAGE(JERR_BAD_STATE, "Improper call to JPEG library in state %d") -JMESSAGE(JERR_BAD_STRUCT_SIZE, - "JPEG parameter struct mismatch: library thinks size is %u, caller expects %u") -JMESSAGE(JERR_BAD_VIRTUAL_ACCESS, "Bogus virtual array access") -JMESSAGE(JERR_BUFFER_SIZE, "Buffer passed to JPEG library is too small") -JMESSAGE(JERR_CANT_SUSPEND, "Suspension not allowed here") -JMESSAGE(JERR_CCIR601_NOTIMPL, "CCIR601 sampling not implemented yet") -JMESSAGE(JERR_COMPONENT_COUNT, "Too many color components: %d, max %d") -JMESSAGE(JERR_CONVERSION_NOTIMPL, "Unsupported color conversion request") -JMESSAGE(JERR_DAC_INDEX, "Bogus DAC index %d") -JMESSAGE(JERR_DAC_VALUE, "Bogus DAC value 0x%x") -JMESSAGE(JERR_DHT_INDEX, "Bogus DHT index %d") -JMESSAGE(JERR_DQT_INDEX, "Bogus DQT index %d") -JMESSAGE(JERR_EMPTY_IMAGE, "Empty JPEG image (DNL not supported)") -JMESSAGE(JERR_EMS_READ, "Read from EMS failed") -JMESSAGE(JERR_EMS_WRITE, "Write to EMS failed") -JMESSAGE(JERR_EOI_EXPECTED, "Didn't expect more than one scan") -JMESSAGE(JERR_FILE_READ, "Input file read error") -JMESSAGE(JERR_FILE_WRITE, "Output file write error --- out of disk space?") -JMESSAGE(JERR_FRACT_SAMPLE_NOTIMPL, "Fractional sampling not implemented yet") -JMESSAGE(JERR_HUFF_CLEN_OVERFLOW, "Huffman code size table overflow") -JMESSAGE(JERR_HUFF_MISSING_CODE, "Missing Huffman code table entry") -JMESSAGE(JERR_IMAGE_TOO_BIG, "Maximum supported image dimension is %u pixels") -JMESSAGE(JERR_INPUT_EMPTY, "Empty input file") -JMESSAGE(JERR_INPUT_EOF, "Premature end of input file") -JMESSAGE(JERR_MISMATCHED_QUANT_TABLE, - "Cannot transcode due to multiple use of quantization table %d") -JMESSAGE(JERR_MISSING_DATA, "Scan script does not transmit all data") -JMESSAGE(JERR_MODE_CHANGE, "Invalid color quantization mode change") -JMESSAGE(JERR_NOTIMPL, "Not implemented yet") -JMESSAGE(JERR_NOT_COMPILED, "Requested feature was omitted at compile time") -JMESSAGE(JERR_NO_ARITH_TABLE, "Arithmetic table 0x%02x was not defined") -JMESSAGE(JERR_NO_BACKING_STORE, "Backing store not supported") -JMESSAGE(JERR_NO_HUFF_TABLE, "Huffman table 0x%02x was not defined") -JMESSAGE(JERR_NO_IMAGE, "JPEG datastream contains no image") -JMESSAGE(JERR_NO_QUANT_TABLE, "Quantization table 0x%02x was not defined") -JMESSAGE(JERR_NO_SOI, "Not a JPEG file: starts with 0x%02x 0x%02x") -JMESSAGE(JERR_OUT_OF_MEMORY, "Insufficient memory (case %d)") -JMESSAGE(JERR_QUANT_COMPONENTS, - "Cannot quantize more than %d color components") -JMESSAGE(JERR_QUANT_FEW_COLORS, "Cannot quantize to fewer than %d colors") -JMESSAGE(JERR_QUANT_MANY_COLORS, "Cannot quantize to more than %d colors") -JMESSAGE(JERR_SOF_DUPLICATE, "Invalid JPEG file structure: two SOF markers") -JMESSAGE(JERR_SOF_NO_SOS, "Invalid JPEG file structure: missing SOS marker") -JMESSAGE(JERR_SOF_UNSUPPORTED, "Unsupported JPEG process: SOF type 0x%02x") -JMESSAGE(JERR_SOI_DUPLICATE, "Invalid JPEG file structure: two SOI markers") -JMESSAGE(JERR_SOS_NO_SOF, "Invalid JPEG file structure: SOS before SOF") -JMESSAGE(JERR_TFILE_CREATE, "Failed to create temporary file %s") -JMESSAGE(JERR_TFILE_READ, "Read failed on temporary file") -JMESSAGE(JERR_TFILE_SEEK, "Seek failed on temporary file") -JMESSAGE(JERR_TFILE_WRITE, - "Write failed on temporary file --- out of disk space?") -JMESSAGE(JERR_TOO_LITTLE_DATA, "Application transferred too few scanlines") -JMESSAGE(JERR_UNKNOWN_MARKER, "Unsupported marker type 0x%02x") -JMESSAGE(JERR_VIRTUAL_BUG, "Virtual array controller messed up") -JMESSAGE(JERR_WIDTH_OVERFLOW, "Image too wide for this implementation") -JMESSAGE(JERR_XMS_READ, "Read from XMS failed") -JMESSAGE(JERR_XMS_WRITE, "Write to XMS failed") -JMESSAGE(JMSG_COPYRIGHT, JCOPYRIGHT) -JMESSAGE(JMSG_VERSION, JVERSION) -JMESSAGE(JTRC_16BIT_TABLES, - "Caution: quantization tables are too coarse for baseline JPEG") -JMESSAGE(JTRC_ADOBE, - "Adobe APP14 marker: version %d, flags 0x%04x 0x%04x, transform %d") -JMESSAGE(JTRC_APP0, "Unknown APP0 marker (not JFIF), length %u") -JMESSAGE(JTRC_APP14, "Unknown APP14 marker (not Adobe), length %u") -JMESSAGE(JTRC_DAC, "Define Arithmetic Table 0x%02x: 0x%02x") -JMESSAGE(JTRC_DHT, "Define Huffman Table 0x%02x") -JMESSAGE(JTRC_DQT, "Define Quantization Table %d precision %d") -JMESSAGE(JTRC_DRI, "Define Restart Interval %u") -JMESSAGE(JTRC_EMS_CLOSE, "Freed EMS handle %u") -JMESSAGE(JTRC_EMS_OPEN, "Obtained EMS handle %u") -JMESSAGE(JTRC_EOI, "End Of Image") -JMESSAGE(JTRC_HUFFBITS, " %3d %3d %3d %3d %3d %3d %3d %3d") -JMESSAGE(JTRC_JFIF, "JFIF APP0 marker: version %d.%02d, density %dx%d %d") -JMESSAGE(JTRC_JFIF_BADTHUMBNAILSIZE, - "Warning: thumbnail image size does not match data length %u") -JMESSAGE(JTRC_JFIF_EXTENSION, - "JFIF extension marker: type 0x%02x, length %u") -JMESSAGE(JTRC_JFIF_THUMBNAIL, " with %d x %d thumbnail image") -JMESSAGE(JTRC_MISC_MARKER, "Miscellaneous marker 0x%02x, length %u") -JMESSAGE(JTRC_PARMLESS_MARKER, "Unexpected marker 0x%02x") -JMESSAGE(JTRC_QUANTVALS, " %4u %4u %4u %4u %4u %4u %4u %4u") -JMESSAGE(JTRC_QUANT_3_NCOLORS, "Quantizing to %d = %d*%d*%d colors") -JMESSAGE(JTRC_QUANT_NCOLORS, "Quantizing to %d colors") -JMESSAGE(JTRC_QUANT_SELECTED, "Selected %d colors for quantization") -JMESSAGE(JTRC_RECOVERY_ACTION, "At marker 0x%02x, recovery action %d") -JMESSAGE(JTRC_RST, "RST%d") -JMESSAGE(JTRC_SMOOTH_NOTIMPL, - "Smoothing not supported with nonstandard sampling ratios") -JMESSAGE(JTRC_SOF, "Start Of Frame 0x%02x: width=%u, height=%u, components=%d") -JMESSAGE(JTRC_SOF_COMPONENT, " Component %d: %dhx%dv q=%d") -JMESSAGE(JTRC_SOI, "Start of Image") -JMESSAGE(JTRC_SOS, "Start Of Scan: %d components") -JMESSAGE(JTRC_SOS_COMPONENT, " Component %d: dc=%d ac=%d") -JMESSAGE(JTRC_SOS_PARAMS, " Ss=%d, Se=%d, Ah=%d, Al=%d") -JMESSAGE(JTRC_TFILE_CLOSE, "Closed temporary file %s") -JMESSAGE(JTRC_TFILE_OPEN, "Opened temporary file %s") -JMESSAGE(JTRC_THUMB_JPEG, - "JFIF extension marker: JPEG-compressed thumbnail image, length %u") -JMESSAGE(JTRC_THUMB_PALETTE, - "JFIF extension marker: palette thumbnail image, length %u") -JMESSAGE(JTRC_THUMB_RGB, - "JFIF extension marker: RGB thumbnail image, length %u") -JMESSAGE(JTRC_UNKNOWN_IDS, - "Unrecognized component IDs %d %d %d, assuming YCbCr") -JMESSAGE(JTRC_XMS_CLOSE, "Freed XMS handle %u") -JMESSAGE(JTRC_XMS_OPEN, "Obtained XMS handle %u") -JMESSAGE(JWRN_ADOBE_XFORM, "Unknown Adobe color transform code %d") -JMESSAGE(JWRN_ARITH_BAD_CODE, "Corrupt JPEG data: bad arithmetic code") -JMESSAGE(JWRN_BOGUS_PROGRESSION, - "Inconsistent progression sequence for component %d coefficient %d") -JMESSAGE(JWRN_EXTRANEOUS_DATA, - "Corrupt JPEG data: %u extraneous bytes before marker 0x%02x") -JMESSAGE(JWRN_HIT_MARKER, "Corrupt JPEG data: premature end of data segment") -JMESSAGE(JWRN_HUFF_BAD_CODE, "Corrupt JPEG data: bad Huffman code") -JMESSAGE(JWRN_JFIF_MAJOR, "Warning: unknown JFIF revision number %d.%02d") -JMESSAGE(JWRN_JPEG_EOF, "Premature end of JPEG file") -JMESSAGE(JWRN_MUST_RESYNC, - "Corrupt JPEG data: found marker 0x%02x instead of RST%d") -JMESSAGE(JWRN_NOT_SEQUENTIAL, "Invalid SOS parameters for sequential JPEG") -JMESSAGE(JWRN_TOO_MUCH_DATA, "Application transferred too many scanlines") - -#ifdef JMAKE_ENUM_LIST - - JMSG_LASTMSGCODE -} J_MESSAGE_CODE; - -#undef JMAKE_ENUM_LIST -#endif /* JMAKE_ENUM_LIST */ - -/* Zap JMESSAGE macro so that future re-inclusions do nothing by default */ -#undef JMESSAGE - - -#ifndef JERROR_H -#define JERROR_H - -/* Macros to simplify using the error and trace message stuff */ -/* The first parameter is either type of cinfo pointer */ - -/* Fatal errors (print message and exit) */ -#define ERREXIT(cinfo,code) \ - ((cinfo)->err->msg_code = (code), \ - (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) -#define ERREXIT1(cinfo,code,p1) \ - ((cinfo)->err->msg_code = (code), \ - (cinfo)->err->msg_parm.i[0] = (p1), \ - (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) -#define ERREXIT2(cinfo,code,p1,p2) \ - ((cinfo)->err->msg_code = (code), \ - (cinfo)->err->msg_parm.i[0] = (p1), \ - (cinfo)->err->msg_parm.i[1] = (p2), \ - (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) -#define ERREXIT3(cinfo,code,p1,p2,p3) \ - ((cinfo)->err->msg_code = (code), \ - (cinfo)->err->msg_parm.i[0] = (p1), \ - (cinfo)->err->msg_parm.i[1] = (p2), \ - (cinfo)->err->msg_parm.i[2] = (p3), \ - (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) -#define ERREXIT4(cinfo,code,p1,p2,p3,p4) \ - ((cinfo)->err->msg_code = (code), \ - (cinfo)->err->msg_parm.i[0] = (p1), \ - (cinfo)->err->msg_parm.i[1] = (p2), \ - (cinfo)->err->msg_parm.i[2] = (p3), \ - (cinfo)->err->msg_parm.i[3] = (p4), \ - (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) -#define ERREXIT6(cinfo,code,p1,p2,p3,p4,p5,p6) \ - ((cinfo)->err->msg_code = (code), \ - (cinfo)->err->msg_parm.i[0] = (p1), \ - (cinfo)->err->msg_parm.i[1] = (p2), \ - (cinfo)->err->msg_parm.i[2] = (p3), \ - (cinfo)->err->msg_parm.i[3] = (p4), \ - (cinfo)->err->msg_parm.i[4] = (p5), \ - (cinfo)->err->msg_parm.i[5] = (p6), \ - (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) -#define ERREXITS(cinfo,code,str) \ - ((cinfo)->err->msg_code = (code), \ - strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \ - (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) - -#define MAKESTMT(stuff) do { stuff } while (0) - -/* Nonfatal errors (we can keep going, but the data is probably corrupt) */ -#define WARNMS(cinfo,code) \ - ((cinfo)->err->msg_code = (code), \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1)) -#define WARNMS1(cinfo,code,p1) \ - ((cinfo)->err->msg_code = (code), \ - (cinfo)->err->msg_parm.i[0] = (p1), \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1)) -#define WARNMS2(cinfo,code,p1,p2) \ - ((cinfo)->err->msg_code = (code), \ - (cinfo)->err->msg_parm.i[0] = (p1), \ - (cinfo)->err->msg_parm.i[1] = (p2), \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1)) - -/* Informational/debugging messages */ -#define TRACEMS(cinfo,lvl,code) \ - ((cinfo)->err->msg_code = (code), \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) -#define TRACEMS1(cinfo,lvl,code,p1) \ - ((cinfo)->err->msg_code = (code), \ - (cinfo)->err->msg_parm.i[0] = (p1), \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) -#define TRACEMS2(cinfo,lvl,code,p1,p2) \ - ((cinfo)->err->msg_code = (code), \ - (cinfo)->err->msg_parm.i[0] = (p1), \ - (cinfo)->err->msg_parm.i[1] = (p2), \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) -#define TRACEMS3(cinfo,lvl,code,p1,p2,p3) \ - MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ - _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); \ - (cinfo)->err->msg_code = (code); \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) -#define TRACEMS4(cinfo,lvl,code,p1,p2,p3,p4) \ - MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ - _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \ - (cinfo)->err->msg_code = (code); \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) -#define TRACEMS5(cinfo,lvl,code,p1,p2,p3,p4,p5) \ - MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ - _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \ - _mp[4] = (p5); \ - (cinfo)->err->msg_code = (code); \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) -#define TRACEMS8(cinfo,lvl,code,p1,p2,p3,p4,p5,p6,p7,p8) \ - MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ - _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \ - _mp[4] = (p5); _mp[5] = (p6); _mp[6] = (p7); _mp[7] = (p8); \ - (cinfo)->err->msg_code = (code); \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) -#define TRACEMSS(cinfo,lvl,code,str) \ - ((cinfo)->err->msg_code = (code), \ - strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) - -#endif /* JERROR_H */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/jmorecfg.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/jmorecfg.h deleted file mode 100644 index 928d052c83..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/jmorecfg.h +++ /dev/null @@ -1,371 +0,0 @@ -/* - * jmorecfg.h - * - * Copyright (C) 1991-1997, Thomas G. Lane. - * Modified 1997-2009 by Guido Vollbeding. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains additional configuration options that customize the - * JPEG software for special applications or support machine-dependent - * optimizations. Most users will not need to touch this file. - */ - - -/* - * Define BITS_IN_JSAMPLE as either - * 8 for 8-bit sample values (the usual setting) - * 12 for 12-bit sample values - * Only 8 and 12 are legal data precisions for lossy JPEG according to the - * JPEG standard, and the IJG code does not support anything else! - * We do not support run-time selection of data precision, sorry. - */ - -#define BITS_IN_JSAMPLE 8 /* use 8 or 12 */ - - -/* - * Maximum number of components (color channels) allowed in JPEG image. - * To meet the letter of the JPEG spec, set this to 255. However, darn - * few applications need more than 4 channels (maybe 5 for CMYK + alpha - * mask). We recommend 10 as a reasonable compromise; use 4 if you are - * really short on memory. (Each allowed component costs a hundred or so - * bytes of storage, whether actually used in an image or not.) - */ - -#define MAX_COMPONENTS 10 /* maximum number of image components */ - - -/* - * Basic data types. - * You may need to change these if you have a machine with unusual data - * type sizes; for example, "char" not 8 bits, "short" not 16 bits, - * or "long" not 32 bits. We don't care whether "int" is 16 or 32 bits, - * but it had better be at least 16. - */ - -/* Representation of a single sample (pixel element value). - * We frequently allocate large arrays of these, so it's important to keep - * them small. But if you have memory to burn and access to char or short - * arrays is very slow on your hardware, you might want to change these. - */ - -#if BITS_IN_JSAMPLE == 8 -/* JSAMPLE should be the smallest type that will hold the values 0..255. - * You can use a signed char by having GETJSAMPLE mask it with 0xFF. - */ - -#ifdef HAVE_UNSIGNED_CHAR - -typedef unsigned char JSAMPLE; -#define GETJSAMPLE(value) ((int) (value)) - -#else /* not HAVE_UNSIGNED_CHAR */ - -typedef char JSAMPLE; -#ifdef CHAR_IS_UNSIGNED -#define GETJSAMPLE(value) ((int) (value)) -#else -#define GETJSAMPLE(value) ((int) (value) & 0xFF) -#endif /* CHAR_IS_UNSIGNED */ - -#endif /* HAVE_UNSIGNED_CHAR */ - -#define MAXJSAMPLE 255 -#define CENTERJSAMPLE 128 - -#endif /* BITS_IN_JSAMPLE == 8 */ - - -#if BITS_IN_JSAMPLE == 12 -/* JSAMPLE should be the smallest type that will hold the values 0..4095. - * On nearly all machines "short" will do nicely. - */ - -typedef short JSAMPLE; -#define GETJSAMPLE(value) ((int) (value)) - -#define MAXJSAMPLE 4095 -#define CENTERJSAMPLE 2048 - -#endif /* BITS_IN_JSAMPLE == 12 */ - - -/* Representation of a DCT frequency coefficient. - * This should be a signed value of at least 16 bits; "short" is usually OK. - * Again, we allocate large arrays of these, but you can change to int - * if you have memory to burn and "short" is really slow. - */ - -typedef short JCOEF; - - -/* Compressed datastreams are represented as arrays of JOCTET. - * These must be EXACTLY 8 bits wide, at least once they are written to - * external storage. Note that when using the stdio data source/destination - * managers, this is also the data type passed to fread/fwrite. - */ - -#ifdef HAVE_UNSIGNED_CHAR - -typedef unsigned char JOCTET; -#define GETJOCTET(value) (value) - -#else /* not HAVE_UNSIGNED_CHAR */ - -typedef char JOCTET; -#ifdef CHAR_IS_UNSIGNED -#define GETJOCTET(value) (value) -#else -#define GETJOCTET(value) ((value) & 0xFF) -#endif /* CHAR_IS_UNSIGNED */ - -#endif /* HAVE_UNSIGNED_CHAR */ - - -/* These typedefs are used for various table entries and so forth. - * They must be at least as wide as specified; but making them too big - * won't cost a huge amount of memory, so we don't provide special - * extraction code like we did for JSAMPLE. (In other words, these - * typedefs live at a different point on the speed/space tradeoff curve.) - */ - -/* UINT8 must hold at least the values 0..255. */ - -#ifdef HAVE_UNSIGNED_CHAR -typedef unsigned char UINT8; -#else /* not HAVE_UNSIGNED_CHAR */ -#ifdef CHAR_IS_UNSIGNED -typedef char UINT8; -#else /* not CHAR_IS_UNSIGNED */ -typedef short UINT8; -#endif /* CHAR_IS_UNSIGNED */ -#endif /* HAVE_UNSIGNED_CHAR */ - -/* UINT16 must hold at least the values 0..65535. */ - -#ifdef HAVE_UNSIGNED_SHORT -typedef unsigned short UINT16; -#else /* not HAVE_UNSIGNED_SHORT */ -typedef unsigned int UINT16; -#endif /* HAVE_UNSIGNED_SHORT */ - -/* INT16 must hold at least the values -32768..32767. */ - -#ifndef XMD_H /* X11/xmd.h correctly defines INT16 */ -typedef short INT16; -#endif - -/* INT32 must hold at least signed 32-bit values. */ - -#ifndef XMD_H /* X11/xmd.h correctly defines INT32 */ -#ifndef _BASETSD_H_ /* Microsoft defines it in basetsd.h */ -#ifndef _BASETSD_H /* MinGW is slightly different */ -#ifndef QGLOBAL_H /* Qt defines it in qglobal.h */ -typedef long INT32; -#endif -#endif -#endif -#endif - -/* Datatype used for image dimensions. The JPEG standard only supports - * images up to 64K*64K due to 16-bit fields in SOF markers. Therefore - * "unsigned int" is sufficient on all machines. However, if you need to - * handle larger images and you don't mind deviating from the spec, you - * can change this datatype. - */ - -typedef unsigned int JDIMENSION; - -#define JPEG_MAX_DIMENSION 65500L /* a tad under 64K to prevent overflows */ - - -/* These macros are used in all function definitions and extern declarations. - * You could modify them if you need to change function linkage conventions; - * in particular, you'll need to do that to make the library a Windows DLL. - * Another application is to make all functions global for use with debuggers - * or code profilers that require it. - */ - -/* a function called through method pointers: */ -#define METHODDEF(type) static type -/* a function used only in its module: */ -#define LOCAL(type) static type -/* a function referenced thru EXTERNs: */ -#define GLOBAL(type) type -/* a reference to a GLOBAL function: */ -#define EXTERN(type) extern type - - -/* This macro is used to declare a "method", that is, a function pointer. - * We want to supply prototype parameters if the compiler can cope. - * Note that the arglist parameter must be parenthesized! - * Again, you can customize this if you need special linkage keywords. - */ - -#ifdef HAVE_PROTOTYPES -#define JMETHOD(type,methodname,arglist) type (*methodname) arglist -#else -#define JMETHOD(type,methodname,arglist) type (*methodname) () -#endif - - -/* Here is the pseudo-keyword for declaring pointers that must be "far" - * on 80x86 machines. Most of the specialized coding for 80x86 is handled - * by just saying "FAR *" where such a pointer is needed. In a few places - * explicit coding is needed; see uses of the NEED_FAR_POINTERS symbol. - */ - -#ifndef FAR -#ifdef NEED_FAR_POINTERS -#define FAR far -#else -#define FAR -#endif -#endif - - -/* - * On a few systems, type boolean and/or its values FALSE, TRUE may appear - * in standard header files. Or you may have conflicts with application- - * specific header files that you want to include together with these files. - * Defining HAVE_BOOLEAN before including jpeglib.h should make it work. - */ - -#ifndef HAVE_BOOLEAN -typedef int boolean; -#endif -#ifndef FALSE /* in case these macros already exist */ -#define FALSE 0 /* values of boolean */ -#endif -#ifndef TRUE -#define TRUE 1 -#endif - - -/* - * The remaining options affect code selection within the JPEG library, - * but they don't need to be visible to most applications using the library. - * To minimize application namespace pollution, the symbols won't be - * defined unless JPEG_INTERNALS or JPEG_INTERNAL_OPTIONS has been defined. - */ - -#ifdef JPEG_INTERNALS -#define JPEG_INTERNAL_OPTIONS -#endif - -#ifdef JPEG_INTERNAL_OPTIONS - - -/* - * These defines indicate whether to include various optional functions. - * Undefining some of these symbols will produce a smaller but less capable - * library. Note that you can leave certain source files out of the - * compilation/linking process if you've #undef'd the corresponding symbols. - * (You may HAVE to do that if your compiler doesn't like null source files.) - */ - -/* Capability options common to encoder and decoder: */ - -#define DCT_ISLOW_SUPPORTED /* slow but accurate integer algorithm */ -#define DCT_IFAST_SUPPORTED /* faster, less accurate integer method */ -#define DCT_FLOAT_SUPPORTED /* floating-point: accurate, fast on fast HW */ - -/* Encoder capability options: */ - -#define C_ARITH_CODING_SUPPORTED /* Arithmetic coding back end? */ -#define C_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */ -#define C_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/ -#define DCT_SCALING_SUPPORTED /* Input rescaling via DCT? (Requires DCT_ISLOW)*/ -#define ENTROPY_OPT_SUPPORTED /* Optimization of entropy coding parms? */ -/* Note: if you selected 12-bit data precision, it is dangerous to turn off - * ENTROPY_OPT_SUPPORTED. The standard Huffman tables are only good for 8-bit - * precision, so jchuff.c normally uses entropy optimization to compute - * usable tables for higher precision. If you don't want to do optimization, - * you'll have to supply different default Huffman tables. - * The exact same statements apply for progressive JPEG: the default tables - * don't work for progressive mode. (This may get fixed, however.) - */ -#define INPUT_SMOOTHING_SUPPORTED /* Input image smoothing option? */ - -/* Decoder capability options: */ - -#define D_ARITH_CODING_SUPPORTED /* Arithmetic coding back end? */ -#define D_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */ -#define D_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/ -#define IDCT_SCALING_SUPPORTED /* Output rescaling via IDCT? */ -#define SAVE_MARKERS_SUPPORTED /* jpeg_save_markers() needed? */ -#define BLOCK_SMOOTHING_SUPPORTED /* Block smoothing? (Progressive only) */ -#undef UPSAMPLE_SCALING_SUPPORTED /* Output rescaling at upsample stage? */ -#define UPSAMPLE_MERGING_SUPPORTED /* Fast path for sloppy upsampling? */ -#define QUANT_1PASS_SUPPORTED /* 1-pass color quantization? */ -#define QUANT_2PASS_SUPPORTED /* 2-pass color quantization? */ - -/* more capability options later, no doubt */ - - -/* - * Ordering of RGB data in scanlines passed to or from the application. - * If your application wants to deal with data in the order B,G,R, just - * change these macros. You can also deal with formats such as R,G,B,X - * (one extra byte per pixel) by changing RGB_PIXELSIZE. Note that changing - * the offsets will also change the order in which colormap data is organized. - * RESTRICTIONS: - * 1. The sample applications cjpeg,djpeg do NOT support modified RGB formats. - * 2. These macros only affect RGB<=>YCbCr color conversion, so they are not - * useful if you are using JPEG color spaces other than YCbCr or grayscale. - * 3. The color quantizer modules will not behave desirably if RGB_PIXELSIZE - * is not 3 (they don't understand about dummy color components!). So you - * can't use color quantization if you change that value. - */ - -#define RGB_RED 0 /* Offset of Red in an RGB scanline element */ -#define RGB_GREEN 1 /* Offset of Green */ -#define RGB_BLUE 2 /* Offset of Blue */ -#define RGB_PIXELSIZE 3 /* JSAMPLEs per RGB scanline element */ - - -/* Definitions for speed-related optimizations. */ - - -/* If your compiler supports inline functions, define INLINE - * as the inline keyword; otherwise define it as empty. - */ - -#ifndef INLINE -#ifdef __GNUC__ /* for instance, GNU C knows about inline */ -#define INLINE __inline__ -#endif -#ifndef INLINE -#define INLINE /* default is to define it as empty */ -#endif -#endif - - -/* On some machines (notably 68000 series) "int" is 32 bits, but multiplying - * two 16-bit shorts is faster than multiplying two ints. Define MULTIPLIER - * as short on such a machine. MULTIPLIER must be at least 16 bits wide. - */ - -#ifndef MULTIPLIER -#define MULTIPLIER int /* type for fastest integer multiply */ -#endif - - -/* FAST_FLOAT should be either float or double, whichever is done faster - * by your compiler. (Note that this type is only used in the floating point - * DCT routines, so it only matters if you've defined DCT_FLOAT_SUPPORTED.) - * Typically, float is faster in ANSI C compilers, while double is faster in - * pre-ANSI compilers (because they insist on converting to double anyway). - * The code below therefore chooses float if we have ANSI-style prototypes. - */ - -#ifndef FAST_FLOAT -#ifdef HAVE_PROTOTYPES -#define FAST_FLOAT float -#else -#define FAST_FLOAT double -#endif -#endif - -#endif /* JPEG_INTERNAL_OPTIONS */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/jpeglib.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/jpeglib.h deleted file mode 100644 index 639d540d07..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/jpeglib.h +++ /dev/null @@ -1,1162 +0,0 @@ -/* - * jpeglib.h - * - * Copyright (C) 1991-1998, Thomas G. Lane. - * Modified 2002-2010 by Guido Vollbeding. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file defines the application interface for the JPEG library. - * Most applications using the library need only include this file, - * and perhaps jerror.h if they want to know the exact error codes. - */ - -#ifndef JPEGLIB_H -#define JPEGLIB_H - -/* - * First we include the configuration files that record how this - * installation of the JPEG library is set up. jconfig.h can be - * generated automatically for many systems. jmorecfg.h contains - * manual configuration options that most people need not worry about. - */ - -#ifndef JCONFIG_INCLUDED /* in case jinclude.h already did */ -#include "jconfig.h" /* widely used configuration options */ -#endif -#include "jmorecfg.h" /* seldom changed options */ - - -#ifdef __cplusplus -#ifndef DONT_USE_EXTERN_C -extern "C" { -#endif -#endif - -/* Version IDs for the JPEG library. - * Might be useful for tests like "#if JPEG_LIB_VERSION >= 80". - */ - -#define JPEG_LIB_VERSION 80 /* Compatibility version 8.0 */ -#define JPEG_LIB_VERSION_MAJOR 8 -#define JPEG_LIB_VERSION_MINOR 3 - - -/* Various constants determining the sizes of things. - * All of these are specified by the JPEG standard, so don't change them - * if you want to be compatible. - */ - -#define DCTSIZE 8 /* The basic DCT block is 8x8 samples */ -#define DCTSIZE2 64 /* DCTSIZE squared; # of elements in a block */ -#define NUM_QUANT_TBLS 4 /* Quantization tables are numbered 0..3 */ -#define NUM_HUFF_TBLS 4 /* Huffman tables are numbered 0..3 */ -#define NUM_ARITH_TBLS 16 /* Arith-coding tables are numbered 0..15 */ -#define MAX_COMPS_IN_SCAN 4 /* JPEG limit on # of components in one scan */ -#define MAX_SAMP_FACTOR 4 /* JPEG limit on sampling factors */ -/* Unfortunately, some bozo at Adobe saw no reason to be bound by the standard; - * the PostScript DCT filter can emit files with many more than 10 blocks/MCU. - * If you happen to run across such a file, you can up D_MAX_BLOCKS_IN_MCU - * to handle it. We even let you do this from the jconfig.h file. However, - * we strongly discourage changing C_MAX_BLOCKS_IN_MCU; just because Adobe - * sometimes emits noncompliant files doesn't mean you should too. - */ -#define C_MAX_BLOCKS_IN_MCU 10 /* compressor's limit on blocks per MCU */ -#ifndef D_MAX_BLOCKS_IN_MCU -#define D_MAX_BLOCKS_IN_MCU 10 /* decompressor's limit on blocks per MCU */ -#endif - - -/* Data structures for images (arrays of samples and of DCT coefficients). - * On 80x86 machines, the image arrays are too big for near pointers, - * but the pointer arrays can fit in near memory. - */ - -typedef JSAMPLE FAR *JSAMPROW; /* ptr to one image row of pixel samples. */ -typedef JSAMPROW *JSAMPARRAY; /* ptr to some rows (a 2-D sample array) */ -typedef JSAMPARRAY *JSAMPIMAGE; /* a 3-D sample array: top index is color */ - -typedef JCOEF JBLOCK[DCTSIZE2]; /* one block of coefficients */ -typedef JBLOCK FAR *JBLOCKROW; /* pointer to one row of coefficient blocks */ -typedef JBLOCKROW *JBLOCKARRAY; /* a 2-D array of coefficient blocks */ -typedef JBLOCKARRAY *JBLOCKIMAGE; /* a 3-D array of coefficient blocks */ - -typedef JCOEF FAR *JCOEFPTR; /* useful in a couple of places */ - - -/* Types for JPEG compression parameters and working tables. */ - - -/* DCT coefficient quantization tables. */ - -typedef struct { - /* This array gives the coefficient quantizers in natural array order - * (not the zigzag order in which they are stored in a JPEG DQT marker). - * CAUTION: IJG versions prior to v6a kept this array in zigzag order. - */ - UINT16 quantval[DCTSIZE2]; /* quantization step for each coefficient */ - /* This field is used only during compression. It's initialized FALSE when - * the table is created, and set TRUE when it's been output to the file. - * You could suppress output of a table by setting this to TRUE. - * (See jpeg_suppress_tables for an example.) - */ - boolean sent_table; /* TRUE when table has been output */ -} JQUANT_TBL; - - -/* Huffman coding tables. */ - -typedef struct { - /* These two fields directly represent the contents of a JPEG DHT marker */ - UINT8 bits[17]; /* bits[k] = # of symbols with codes of */ - /* length k bits; bits[0] is unused */ - UINT8 huffval[256]; /* The symbols, in order of incr code length */ - /* This field is used only during compression. It's initialized FALSE when - * the table is created, and set TRUE when it's been output to the file. - * You could suppress output of a table by setting this to TRUE. - * (See jpeg_suppress_tables for an example.) - */ - boolean sent_table; /* TRUE when table has been output */ -} JHUFF_TBL; - - -/* Basic info about one component (color channel). */ - -typedef struct { - /* These values are fixed over the whole image. */ - /* For compression, they must be supplied by parameter setup; */ - /* for decompression, they are read from the SOF marker. */ - int component_id; /* identifier for this component (0..255) */ - int component_index; /* its index in SOF or cinfo->comp_info[] */ - int h_samp_factor; /* horizontal sampling factor (1..4) */ - int v_samp_factor; /* vertical sampling factor (1..4) */ - int quant_tbl_no; /* quantization table selector (0..3) */ - /* These values may vary between scans. */ - /* For compression, they must be supplied by parameter setup; */ - /* for decompression, they are read from the SOS marker. */ - /* The decompressor output side may not use these variables. */ - int dc_tbl_no; /* DC entropy table selector (0..3) */ - int ac_tbl_no; /* AC entropy table selector (0..3) */ - - /* Remaining fields should be treated as private by applications. */ - - /* These values are computed during compression or decompression startup: */ - /* Component's size in DCT blocks. - * Any dummy blocks added to complete an MCU are not counted; therefore - * these values do not depend on whether a scan is interleaved or not. - */ - JDIMENSION width_in_blocks; - JDIMENSION height_in_blocks; - /* Size of a DCT block in samples, - * reflecting any scaling we choose to apply during the DCT step. - * Values from 1 to 16 are supported. - * Note that different components may receive different DCT scalings. - */ - int DCT_h_scaled_size; - int DCT_v_scaled_size; - /* The downsampled dimensions are the component's actual, unpadded number - * of samples at the main buffer (preprocessing/compression interface); - * DCT scaling is included, so - * downsampled_width = ceil(image_width * Hi/Hmax * DCT_h_scaled_size/DCTSIZE) - * and similarly for height. - */ - JDIMENSION downsampled_width; /* actual width in samples */ - JDIMENSION downsampled_height; /* actual height in samples */ - /* This flag is used only for decompression. In cases where some of the - * components will be ignored (eg grayscale output from YCbCr image), - * we can skip most computations for the unused components. - */ - boolean component_needed; /* do we need the value of this component? */ - - /* These values are computed before starting a scan of the component. */ - /* The decompressor output side may not use these variables. */ - int MCU_width; /* number of blocks per MCU, horizontally */ - int MCU_height; /* number of blocks per MCU, vertically */ - int MCU_blocks; /* MCU_width * MCU_height */ - int MCU_sample_width; /* MCU width in samples: MCU_width * DCT_h_scaled_size */ - int last_col_width; /* # of non-dummy blocks across in last MCU */ - int last_row_height; /* # of non-dummy blocks down in last MCU */ - - /* Saved quantization table for component; NULL if none yet saved. - * See jdinput.c comments about the need for this information. - * This field is currently used only for decompression. - */ - JQUANT_TBL * quant_table; - - /* Private per-component storage for DCT or IDCT subsystem. */ - void * dct_table; -} jpeg_component_info; - - -/* The script for encoding a multiple-scan file is an array of these: */ - -typedef struct { - int comps_in_scan; /* number of components encoded in this scan */ - int component_index[MAX_COMPS_IN_SCAN]; /* their SOF/comp_info[] indexes */ - int Ss, Se; /* progressive JPEG spectral selection parms */ - int Ah, Al; /* progressive JPEG successive approx. parms */ -} jpeg_scan_info; - -/* The decompressor can save APPn and COM markers in a list of these: */ - -typedef struct jpeg_marker_struct FAR * jpeg_saved_marker_ptr; - -struct jpeg_marker_struct { - jpeg_saved_marker_ptr next; /* next in list, or NULL */ - UINT8 marker; /* marker code: JPEG_COM, or JPEG_APP0+n */ - unsigned int original_length; /* # bytes of data in the file */ - unsigned int data_length; /* # bytes of data saved at data[] */ - JOCTET FAR * data; /* the data contained in the marker */ - /* the marker length word is not counted in data_length or original_length */ -}; - -/* Known color spaces. */ - -typedef enum { - JCS_UNKNOWN, /* error/unspecified */ - JCS_GRAYSCALE, /* monochrome */ - JCS_RGB, /* red/green/blue */ - JCS_YCbCr, /* Y/Cb/Cr (also known as YUV) */ - JCS_CMYK, /* C/M/Y/K */ - JCS_YCCK /* Y/Cb/Cr/K */ -} J_COLOR_SPACE; - -/* DCT/IDCT algorithm options. */ - -typedef enum { - JDCT_ISLOW, /* slow but accurate integer algorithm */ - JDCT_IFAST, /* faster, less accurate integer method */ - JDCT_FLOAT /* floating-point: accurate, fast on fast HW */ -} J_DCT_METHOD; - -#ifndef JDCT_DEFAULT /* may be overridden in jconfig.h */ -#define JDCT_DEFAULT JDCT_ISLOW -#endif -#ifndef JDCT_FASTEST /* may be overridden in jconfig.h */ -#define JDCT_FASTEST JDCT_IFAST -#endif - -/* Dithering options for decompression. */ - -typedef enum { - JDITHER_NONE, /* no dithering */ - JDITHER_ORDERED, /* simple ordered dither */ - JDITHER_FS /* Floyd-Steinberg error diffusion dither */ -} J_DITHER_MODE; - - -/* Common fields between JPEG compression and decompression master structs. */ - -#define jpeg_common_fields \ - struct jpeg_error_mgr * err; /* Error handler module */\ - struct jpeg_memory_mgr * mem; /* Memory manager module */\ - struct jpeg_progress_mgr * progress; /* Progress monitor, or NULL if none */\ - void * client_data; /* Available for use by application */\ - boolean is_decompressor; /* So common code can tell which is which */\ - int global_state /* For checking call sequence validity */ - -/* Routines that are to be used by both halves of the library are declared - * to receive a pointer to this structure. There are no actual instances of - * jpeg_common_struct, only of jpeg_compress_struct and jpeg_decompress_struct. - */ -struct jpeg_common_struct { - jpeg_common_fields; /* Fields common to both master struct types */ - /* Additional fields follow in an actual jpeg_compress_struct or - * jpeg_decompress_struct. All three structs must agree on these - * initial fields! (This would be a lot cleaner in C++.) - */ -}; - -typedef struct jpeg_common_struct * j_common_ptr; -typedef struct jpeg_compress_struct * j_compress_ptr; -typedef struct jpeg_decompress_struct * j_decompress_ptr; - - -/* Master record for a compression instance */ - -struct jpeg_compress_struct { - jpeg_common_fields; /* Fields shared with jpeg_decompress_struct */ - - /* Destination for compressed data */ - struct jpeg_destination_mgr * dest; - - /* Description of source image --- these fields must be filled in by - * outer application before starting compression. in_color_space must - * be correct before you can even call jpeg_set_defaults(). - */ - - JDIMENSION image_width; /* input image width */ - JDIMENSION image_height; /* input image height */ - int input_components; /* # of color components in input image */ - J_COLOR_SPACE in_color_space; /* colorspace of input image */ - - double input_gamma; /* image gamma of input image */ - - /* Compression parameters --- these fields must be set before calling - * jpeg_start_compress(). We recommend calling jpeg_set_defaults() to - * initialize everything to reasonable defaults, then changing anything - * the application specifically wants to change. That way you won't get - * burnt when new parameters are added. Also note that there are several - * helper routines to simplify changing parameters. - */ - - unsigned int scale_num, scale_denom; /* fraction by which to scale image */ - - JDIMENSION jpeg_width; /* scaled JPEG image width */ - JDIMENSION jpeg_height; /* scaled JPEG image height */ - /* Dimensions of actual JPEG image that will be written to file, - * derived from input dimensions by scaling factors above. - * These fields are computed by jpeg_start_compress(). - * You can also use jpeg_calc_jpeg_dimensions() to determine these values - * in advance of calling jpeg_start_compress(). - */ - - int data_precision; /* bits of precision in image data */ - - int num_components; /* # of color components in JPEG image */ - J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */ - - jpeg_component_info * comp_info; - /* comp_info[i] describes component that appears i'th in SOF */ - - JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS]; - int q_scale_factor[NUM_QUANT_TBLS]; - /* ptrs to coefficient quantization tables, or NULL if not defined, - * and corresponding scale factors (percentage, initialized 100). - */ - - JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS]; - JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS]; - /* ptrs to Huffman coding tables, or NULL if not defined */ - - UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */ - UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */ - UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */ - - int num_scans; /* # of entries in scan_info array */ - const jpeg_scan_info * scan_info; /* script for multi-scan file, or NULL */ - /* The default value of scan_info is NULL, which causes a single-scan - * sequential JPEG file to be emitted. To create a multi-scan file, - * set num_scans and scan_info to point to an array of scan definitions. - */ - - boolean raw_data_in; /* TRUE=caller supplies downsampled data */ - boolean arith_code; /* TRUE=arithmetic coding, FALSE=Huffman */ - boolean optimize_coding; /* TRUE=optimize entropy encoding parms */ - boolean CCIR601_sampling; /* TRUE=first samples are cosited */ - boolean do_fancy_downsampling; /* TRUE=apply fancy downsampling */ - int smoothing_factor; /* 1..100, or 0 for no input smoothing */ - J_DCT_METHOD dct_method; /* DCT algorithm selector */ - - /* The restart interval can be specified in absolute MCUs by setting - * restart_interval, or in MCU rows by setting restart_in_rows - * (in which case the correct restart_interval will be figured - * for each scan). - */ - unsigned int restart_interval; /* MCUs per restart, or 0 for no restart */ - int restart_in_rows; /* if > 0, MCU rows per restart interval */ - - /* Parameters controlling emission of special markers. */ - - boolean write_JFIF_header; /* should a JFIF marker be written? */ - UINT8 JFIF_major_version; /* What to write for the JFIF version number */ - UINT8 JFIF_minor_version; - /* These three values are not used by the JPEG code, merely copied */ - /* into the JFIF APP0 marker. density_unit can be 0 for unknown, */ - /* 1 for dots/inch, or 2 for dots/cm. Note that the pixel aspect */ - /* ratio is defined by X_density/Y_density even when density_unit=0. */ - UINT8 density_unit; /* JFIF code for pixel size units */ - UINT16 X_density; /* Horizontal pixel density */ - UINT16 Y_density; /* Vertical pixel density */ - boolean write_Adobe_marker; /* should an Adobe marker be written? */ - - /* State variable: index of next scanline to be written to - * jpeg_write_scanlines(). Application may use this to control its - * processing loop, e.g., "while (next_scanline < image_height)". - */ - - JDIMENSION next_scanline; /* 0 .. image_height-1 */ - - /* Remaining fields are known throughout compressor, but generally - * should not be touched by a surrounding application. - */ - - /* - * These fields are computed during compression startup - */ - boolean progressive_mode; /* TRUE if scan script uses progressive mode */ - int max_h_samp_factor; /* largest h_samp_factor */ - int max_v_samp_factor; /* largest v_samp_factor */ - - int min_DCT_h_scaled_size; /* smallest DCT_h_scaled_size of any component */ - int min_DCT_v_scaled_size; /* smallest DCT_v_scaled_size of any component */ - - JDIMENSION total_iMCU_rows; /* # of iMCU rows to be input to coef ctlr */ - /* The coefficient controller receives data in units of MCU rows as defined - * for fully interleaved scans (whether the JPEG file is interleaved or not). - * There are v_samp_factor * DCTSIZE sample rows of each component in an - * "iMCU" (interleaved MCU) row. - */ - - /* - * These fields are valid during any one scan. - * They describe the components and MCUs actually appearing in the scan. - */ - int comps_in_scan; /* # of JPEG components in this scan */ - jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN]; - /* *cur_comp_info[i] describes component that appears i'th in SOS */ - - JDIMENSION MCUs_per_row; /* # of MCUs across the image */ - JDIMENSION MCU_rows_in_scan; /* # of MCU rows in the image */ - - int blocks_in_MCU; /* # of DCT blocks per MCU */ - int MCU_membership[C_MAX_BLOCKS_IN_MCU]; - /* MCU_membership[i] is index in cur_comp_info of component owning */ - /* i'th block in an MCU */ - - int Ss, Se, Ah, Al; /* progressive JPEG parameters for scan */ - - int block_size; /* the basic DCT block size: 1..16 */ - const int * natural_order; /* natural-order position array */ - int lim_Se; /* min( Se, DCTSIZE2-1 ) */ - - /* - * Links to compression subobjects (methods and private variables of modules) - */ - struct jpeg_comp_master * master; - struct jpeg_c_main_controller * main; - struct jpeg_c_prep_controller * prep; - struct jpeg_c_coef_controller * coef; - struct jpeg_marker_writer * marker; - struct jpeg_color_converter * cconvert; - struct jpeg_downsampler * downsample; - struct jpeg_forward_dct * fdct; - struct jpeg_entropy_encoder * entropy; - jpeg_scan_info * script_space; /* workspace for jpeg_simple_progression */ - int script_space_size; -}; - - -/* Master record for a decompression instance */ - -struct jpeg_decompress_struct { - jpeg_common_fields; /* Fields shared with jpeg_compress_struct */ - - /* Source of compressed data */ - struct jpeg_source_mgr * src; - - /* Basic description of image --- filled in by jpeg_read_header(). */ - /* Application may inspect these values to decide how to process image. */ - - JDIMENSION image_width; /* nominal image width (from SOF marker) */ - JDIMENSION image_height; /* nominal image height */ - int num_components; /* # of color components in JPEG image */ - J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */ - - /* Decompression processing parameters --- these fields must be set before - * calling jpeg_start_decompress(). Note that jpeg_read_header() initializes - * them to default values. - */ - - J_COLOR_SPACE out_color_space; /* colorspace for output */ - - unsigned int scale_num, scale_denom; /* fraction by which to scale image */ - - unsigned int region_x, region_y, region_w, region_h; /* if region_w && region_h > 0, then use this region to decode. scale above is done prior to region select */ - - double output_gamma; /* image gamma wanted in output */ - - boolean buffered_image; /* TRUE=multiple output passes */ - boolean raw_data_out; /* TRUE=downsampled data wanted */ - - J_DCT_METHOD dct_method; /* IDCT algorithm selector */ - boolean do_fancy_upsampling; /* TRUE=apply fancy upsampling */ - boolean do_block_smoothing; /* TRUE=apply interblock smoothing */ - - boolean quantize_colors; /* TRUE=colormapped output wanted */ - /* the following are ignored if not quantize_colors: */ - J_DITHER_MODE dither_mode; /* type of color dithering to use */ - boolean two_pass_quantize; /* TRUE=use two-pass color quantization */ - int desired_number_of_colors; /* max # colors to use in created colormap */ - /* these are significant only in buffered-image mode: */ - boolean enable_1pass_quant; /* enable future use of 1-pass quantizer */ - boolean enable_external_quant;/* enable future use of external colormap */ - boolean enable_2pass_quant; /* enable future use of 2-pass quantizer */ - - /* Description of actual output image that will be returned to application. - * These fields are computed by jpeg_start_decompress(). - * You can also use jpeg_calc_output_dimensions() to determine these values - * in advance of calling jpeg_start_decompress(). - */ - - JDIMENSION output_width; /* scaled image width */ - JDIMENSION output_height; /* scaled image height */ - int out_color_components; /* # of color components in out_color_space */ - int output_components; /* # of color components returned */ - /* output_components is 1 (a colormap index) when quantizing colors; - * otherwise it equals out_color_components. - */ - int rec_outbuf_height; /* min recommended height of scanline buffer */ - /* If the buffer passed to jpeg_read_scanlines() is less than this many rows - * high, space and time will be wasted due to unnecessary data copying. - * Usually rec_outbuf_height will be 1 or 2, at most 4. - */ - - /* When quantizing colors, the output colormap is described by these fields. - * The application can supply a colormap by setting colormap non-NULL before - * calling jpeg_start_decompress; otherwise a colormap is created during - * jpeg_start_decompress or jpeg_start_output. - * The map has out_color_components rows and actual_number_of_colors columns. - */ - int actual_number_of_colors; /* number of entries in use */ - JSAMPARRAY colormap; /* The color map as a 2-D pixel array */ - - /* State variables: these variables indicate the progress of decompression. - * The application may examine these but must not modify them. - */ - - /* Row index of next scanline to be read from jpeg_read_scanlines(). - * Application may use this to control its processing loop, e.g., - * "while (output_scanline < output_height)". - */ - JDIMENSION output_scanline; /* 0 .. output_height-1 */ - - /* Current input scan number and number of iMCU rows completed in scan. - * These indicate the progress of the decompressor input side. - */ - int input_scan_number; /* Number of SOS markers seen so far */ - JDIMENSION input_iMCU_row; /* Number of iMCU rows completed */ - - /* The "output scan number" is the notional scan being displayed by the - * output side. The decompressor will not allow output scan/row number - * to get ahead of input scan/row, but it can fall arbitrarily far behind. - */ - int output_scan_number; /* Nominal scan number being displayed */ - JDIMENSION output_iMCU_row; /* Number of iMCU rows read */ - - /* Current progression status. coef_bits[c][i] indicates the precision - * with which component c's DCT coefficient i (in zigzag order) is known. - * It is -1 when no data has yet been received, otherwise it is the point - * transform (shift) value for the most recent scan of the coefficient - * (thus, 0 at completion of the progression). - * This pointer is NULL when reading a non-progressive file. - */ - int (*coef_bits)[DCTSIZE2]; /* -1 or current Al value for each coef */ - - /* Internal JPEG parameters --- the application usually need not look at - * these fields. Note that the decompressor output side may not use - * any parameters that can change between scans. - */ - - /* Quantization and Huffman tables are carried forward across input - * datastreams when processing abbreviated JPEG datastreams. - */ - - JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS]; - /* ptrs to coefficient quantization tables, or NULL if not defined */ - - JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS]; - JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS]; - /* ptrs to Huffman coding tables, or NULL if not defined */ - - /* These parameters are never carried across datastreams, since they - * are given in SOF/SOS markers or defined to be reset by SOI. - */ - - int data_precision; /* bits of precision in image data */ - - jpeg_component_info * comp_info; - /* comp_info[i] describes component that appears i'th in SOF */ - - boolean is_baseline; /* TRUE if Baseline SOF0 encountered */ - boolean progressive_mode; /* TRUE if SOFn specifies progressive mode */ - boolean arith_code; /* TRUE=arithmetic coding, FALSE=Huffman */ - - UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */ - UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */ - UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */ - - unsigned int restart_interval; /* MCUs per restart interval, or 0 for no restart */ - - /* These fields record data obtained from optional markers recognized by - * the JPEG library. - */ - boolean saw_JFIF_marker; /* TRUE iff a JFIF APP0 marker was found */ - /* Data copied from JFIF marker; only valid if saw_JFIF_marker is TRUE: */ - UINT8 JFIF_major_version; /* JFIF version number */ - UINT8 JFIF_minor_version; - UINT8 density_unit; /* JFIF code for pixel size units */ - UINT16 X_density; /* Horizontal pixel density */ - UINT16 Y_density; /* Vertical pixel density */ - boolean saw_Adobe_marker; /* TRUE iff an Adobe APP14 marker was found */ - UINT8 Adobe_transform; /* Color transform code from Adobe marker */ - - boolean CCIR601_sampling; /* TRUE=first samples are cosited */ - - /* Aside from the specific data retained from APPn markers known to the - * library, the uninterpreted contents of any or all APPn and COM markers - * can be saved in a list for examination by the application. - */ - jpeg_saved_marker_ptr marker_list; /* Head of list of saved markers */ - - /* Remaining fields are known throughout decompressor, but generally - * should not be touched by a surrounding application. - */ - - /* - * These fields are computed during decompression startup - */ - int max_h_samp_factor; /* largest h_samp_factor */ - int max_v_samp_factor; /* largest v_samp_factor */ - - int min_DCT_h_scaled_size; /* smallest DCT_h_scaled_size of any component */ - int min_DCT_v_scaled_size; /* smallest DCT_v_scaled_size of any component */ - - JDIMENSION total_iMCU_rows; /* # of iMCU rows in image */ - /* The coefficient controller's input and output progress is measured in - * units of "iMCU" (interleaved MCU) rows. These are the same as MCU rows - * in fully interleaved JPEG scans, but are used whether the scan is - * interleaved or not. We define an iMCU row as v_samp_factor DCT block - * rows of each component. Therefore, the IDCT output contains - * v_samp_factor*DCT_v_scaled_size sample rows of a component per iMCU row. - */ - - JSAMPLE * sample_range_limit; /* table for fast range-limiting */ - - /* - * These fields are valid during any one scan. - * They describe the components and MCUs actually appearing in the scan. - * Note that the decompressor output side must not use these fields. - */ - int comps_in_scan; /* # of JPEG components in this scan */ - jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN]; - /* *cur_comp_info[i] describes component that appears i'th in SOS */ - - JDIMENSION MCUs_per_row; /* # of MCUs across the image */ - JDIMENSION MCU_rows_in_scan; /* # of MCU rows in the image */ - - int blocks_in_MCU; /* # of DCT blocks per MCU */ - int MCU_membership[D_MAX_BLOCKS_IN_MCU]; - /* MCU_membership[i] is index in cur_comp_info of component owning */ - /* i'th block in an MCU */ - - int Ss, Se, Ah, Al; /* progressive JPEG parameters for scan */ - - /* These fields are derived from Se of first SOS marker. - */ - int block_size; /* the basic DCT block size: 1..16 */ - const int * natural_order; /* natural-order position array for entropy decode */ - int lim_Se; /* min( Se, DCTSIZE2-1 ) for entropy decode */ - - /* This field is shared between entropy decoder and marker parser. - * It is either zero or the code of a JPEG marker that has been - * read from the data source, but has not yet been processed. - */ - int unread_marker; - - /* - * Links to decompression subobjects (methods, private variables of modules) - */ - struct jpeg_decomp_master * master; - struct jpeg_d_main_controller * main; - struct jpeg_d_coef_controller * coef; - struct jpeg_d_post_controller * post; - struct jpeg_input_controller * inputctl; - struct jpeg_marker_reader * marker; - struct jpeg_entropy_decoder * entropy; - struct jpeg_inverse_dct * idct; - struct jpeg_upsampler * upsample; - struct jpeg_color_deconverter * cconvert; - struct jpeg_color_quantizer * cquantize; -}; - - -/* "Object" declarations for JPEG modules that may be supplied or called - * directly by the surrounding application. - * As with all objects in the JPEG library, these structs only define the - * publicly visible methods and state variables of a module. Additional - * private fields may exist after the public ones. - */ - - -/* Error handler object */ - -struct jpeg_error_mgr { - /* Error exit handler: does not return to caller */ - JMETHOD(void, error_exit, (j_common_ptr cinfo)); - /* Conditionally emit a trace or warning message */ - JMETHOD(void, emit_message, (j_common_ptr cinfo, int msg_level)); - /* Routine that actually outputs a trace or error message */ - JMETHOD(void, output_message, (j_common_ptr cinfo)); - /* Format a message string for the most recent JPEG error or message */ - JMETHOD(void, format_message, (j_common_ptr cinfo, char * buffer)); -#define JMSG_LENGTH_MAX 200 /* recommended size of format_message buffer */ - /* Reset error state variables at start of a new image */ - JMETHOD(void, reset_error_mgr, (j_common_ptr cinfo)); - - /* The message ID code and any parameters are saved here. - * A message can have one string parameter or up to 8 int parameters. - */ - int msg_code; -#define JMSG_STR_PARM_MAX 80 - union { - int i[8]; - char s[JMSG_STR_PARM_MAX]; - } msg_parm; - - /* Standard state variables for error facility */ - - int trace_level; /* max msg_level that will be displayed */ - - /* For recoverable corrupt-data errors, we emit a warning message, - * but keep going unless emit_message chooses to abort. emit_message - * should count warnings in num_warnings. The surrounding application - * can check for bad data by seeing if num_warnings is nonzero at the - * end of processing. - */ - long num_warnings; /* number of corrupt-data warnings */ - - /* These fields point to the table(s) of error message strings. - * An application can change the table pointer to switch to a different - * message list (typically, to change the language in which errors are - * reported). Some applications may wish to add additional error codes - * that will be handled by the JPEG library error mechanism; the second - * table pointer is used for this purpose. - * - * First table includes all errors generated by JPEG library itself. - * Error code 0 is reserved for a "no such error string" message. - */ - const char * const * jpeg_message_table; /* Library errors */ - int last_jpeg_message; /* Table contains strings 0..last_jpeg_message */ - /* Second table can be added by application (see cjpeg/djpeg for example). - * It contains strings numbered first_addon_message..last_addon_message. - */ - const char * const * addon_message_table; /* Non-library errors */ - int first_addon_message; /* code for first string in addon table */ - int last_addon_message; /* code for last string in addon table */ -}; - - -/* Progress monitor object */ - -struct jpeg_progress_mgr { - JMETHOD(void, progress_monitor, (j_common_ptr cinfo)); - - long pass_counter; /* work units completed in this pass */ - long pass_limit; /* total number of work units in this pass */ - int completed_passes; /* passes completed so far */ - int total_passes; /* total number of passes expected */ -}; - - -/* Data destination object for compression */ - -struct jpeg_destination_mgr { - JOCTET * next_output_byte; /* => next byte to write in buffer */ - size_t free_in_buffer; /* # of byte spaces remaining in buffer */ - - JMETHOD(void, init_destination, (j_compress_ptr cinfo)); - JMETHOD(boolean, empty_output_buffer, (j_compress_ptr cinfo)); - JMETHOD(void, term_destination, (j_compress_ptr cinfo)); -}; - - -/* Data source object for decompression */ - -struct jpeg_source_mgr { - const JOCTET * next_input_byte; /* => next byte to read from buffer */ - size_t bytes_in_buffer; /* # of bytes remaining in buffer */ - - JMETHOD(void, init_source, (j_decompress_ptr cinfo)); - JMETHOD(boolean, fill_input_buffer, (j_decompress_ptr cinfo)); - JMETHOD(void, skip_input_data, (j_decompress_ptr cinfo, long num_bytes)); - JMETHOD(boolean, resync_to_restart, (j_decompress_ptr cinfo, int desired)); - JMETHOD(void, term_source, (j_decompress_ptr cinfo)); -}; - - -/* Memory manager object. - * Allocates "small" objects (a few K total), "large" objects (tens of K), - * and "really big" objects (virtual arrays with backing store if needed). - * The memory manager does not allow individual objects to be freed; rather, - * each created object is assigned to a pool, and whole pools can be freed - * at once. This is faster and more convenient than remembering exactly what - * to free, especially where malloc()/free() are not too speedy. - * NB: alloc routines never return NULL. They exit to error_exit if not - * successful. - */ - -#define JPOOL_PERMANENT 0 /* lasts until master record is destroyed */ -#define JPOOL_IMAGE 1 /* lasts until done with image/datastream */ -#define JPOOL_NUMPOOLS 2 - -typedef struct jvirt_sarray_control * jvirt_sarray_ptr; -typedef struct jvirt_barray_control * jvirt_barray_ptr; - - -struct jpeg_memory_mgr { - /* Method pointers */ - JMETHOD(void *, alloc_small, (j_common_ptr cinfo, int pool_id, - size_t sizeofobject)); - JMETHOD(void FAR *, alloc_large, (j_common_ptr cinfo, int pool_id, - size_t sizeofobject)); - JMETHOD(JSAMPARRAY, alloc_sarray, (j_common_ptr cinfo, int pool_id, - JDIMENSION samplesperrow, - JDIMENSION numrows)); - JMETHOD(JBLOCKARRAY, alloc_barray, (j_common_ptr cinfo, int pool_id, - JDIMENSION blocksperrow, - JDIMENSION numrows)); - JMETHOD(jvirt_sarray_ptr, request_virt_sarray, (j_common_ptr cinfo, - int pool_id, - boolean pre_zero, - JDIMENSION samplesperrow, - JDIMENSION numrows, - JDIMENSION maxaccess)); - JMETHOD(jvirt_barray_ptr, request_virt_barray, (j_common_ptr cinfo, - int pool_id, - boolean pre_zero, - JDIMENSION blocksperrow, - JDIMENSION numrows, - JDIMENSION maxaccess)); - JMETHOD(void, realize_virt_arrays, (j_common_ptr cinfo)); - JMETHOD(JSAMPARRAY, access_virt_sarray, (j_common_ptr cinfo, - jvirt_sarray_ptr ptr, - JDIMENSION start_row, - JDIMENSION num_rows, - boolean writable)); - JMETHOD(JBLOCKARRAY, access_virt_barray, (j_common_ptr cinfo, - jvirt_barray_ptr ptr, - JDIMENSION start_row, - JDIMENSION num_rows, - boolean writable)); - JMETHOD(void, free_pool, (j_common_ptr cinfo, int pool_id)); - JMETHOD(void, self_destruct, (j_common_ptr cinfo)); - - /* Limit on memory allocation for this JPEG object. (Note that this is - * merely advisory, not a guaranteed maximum; it only affects the space - * used for virtual-array buffers.) May be changed by outer application - * after creating the JPEG object. - */ - long max_memory_to_use; - - /* Maximum allocation request accepted by alloc_large. */ - long max_alloc_chunk; -}; - - -/* Routine signature for application-supplied marker processing methods. - * Need not pass marker code since it is stored in cinfo->unread_marker. - */ -typedef JMETHOD(boolean, jpeg_marker_parser_method, (j_decompress_ptr cinfo)); - - -/* Declarations for routines called by application. - * The JPP macro hides prototype parameters from compilers that can't cope. - * Note JPP requires double parentheses. - */ - -#ifdef HAVE_PROTOTYPES -#define JPP(arglist) arglist -#else -#define JPP(arglist) () -#endif - - -/* Short forms of external names for systems with brain-damaged linkers. - * We shorten external names to be unique in the first six letters, which - * is good enough for all known systems. - * (If your compiler itself needs names to be unique in less than 15 - * characters, you are out of luck. Get a better compiler.) - */ - -#ifdef NEED_SHORT_EXTERNAL_NAMES -#define jpeg_std_error jStdError -#define jpeg_CreateCompress jCreaCompress -#define jpeg_CreateDecompress jCreaDecompress -#define jpeg_destroy_compress jDestCompress -#define jpeg_destroy_decompress jDestDecompress -#define jpeg_stdio_dest jStdDest -#define jpeg_stdio_src jStdSrc -#define jpeg_mem_dest jMemDest -#define jpeg_mem_src jMemSrc -#define jpeg_set_defaults jSetDefaults -#define jpeg_set_colorspace jSetColorspace -#define jpeg_default_colorspace jDefColorspace -#define jpeg_set_quality jSetQuality -#define jpeg_set_linear_quality jSetLQuality -#define jpeg_default_qtables jDefQTables -#define jpeg_add_quant_table jAddQuantTable -#define jpeg_quality_scaling jQualityScaling -#define jpeg_simple_progression jSimProgress -#define jpeg_suppress_tables jSuppressTables -#define jpeg_alloc_quant_table jAlcQTable -#define jpeg_alloc_huff_table jAlcHTable -#define jpeg_start_compress jStrtCompress -#define jpeg_write_scanlines jWrtScanlines -#define jpeg_finish_compress jFinCompress -#define jpeg_calc_jpeg_dimensions jCjpegDimensions -#define jpeg_write_raw_data jWrtRawData -#define jpeg_write_marker jWrtMarker -#define jpeg_write_m_header jWrtMHeader -#define jpeg_write_m_byte jWrtMByte -#define jpeg_write_tables jWrtTables -#define jpeg_read_header jReadHeader -#define jpeg_start_decompress jStrtDecompress -#define jpeg_read_scanlines jReadScanlines -#define jpeg_finish_decompress jFinDecompress -#define jpeg_read_raw_data jReadRawData -#define jpeg_has_multiple_scans jHasMultScn -#define jpeg_start_output jStrtOutput -#define jpeg_finish_output jFinOutput -#define jpeg_input_complete jInComplete -#define jpeg_new_colormap jNewCMap -#define jpeg_consume_input jConsumeInput -#define jpeg_core_output_dimensions jCoreDimensions -#define jpeg_calc_output_dimensions jCalcDimensions -#define jpeg_save_markers jSaveMarkers -#define jpeg_set_marker_processor jSetMarker -#define jpeg_read_coefficients jReadCoefs -#define jpeg_write_coefficients jWrtCoefs -#define jpeg_copy_critical_parameters jCopyCrit -#define jpeg_abort_compress jAbrtCompress -#define jpeg_abort_decompress jAbrtDecompress -#define jpeg_abort jAbort -#define jpeg_destroy jDestroy -#define jpeg_resync_to_restart jResyncRestart -#endif /* NEED_SHORT_EXTERNAL_NAMES */ - - -/* Default error-management setup */ -EXTERN(struct jpeg_error_mgr *) jpeg_std_error - JPP((struct jpeg_error_mgr * err)); - -/* Initialization of JPEG compression objects. - * jpeg_create_compress() and jpeg_create_decompress() are the exported - * names that applications should call. These expand to calls on - * jpeg_CreateCompress and jpeg_CreateDecompress with additional information - * passed for version mismatch checking. - * NB: you must set up the error-manager BEFORE calling jpeg_create_xxx. - */ -#define jpeg_create_compress(cinfo) \ - jpeg_CreateCompress((cinfo), JPEG_LIB_VERSION, \ - (size_t) sizeof(struct jpeg_compress_struct)) -#define jpeg_create_decompress(cinfo) \ - jpeg_CreateDecompress((cinfo), JPEG_LIB_VERSION, \ - (size_t) sizeof(struct jpeg_decompress_struct)) -EXTERN(void) jpeg_CreateCompress JPP((j_compress_ptr cinfo, - int version, size_t structsize)); -EXTERN(void) jpeg_CreateDecompress JPP((j_decompress_ptr cinfo, - int version, size_t structsize)); -/* Destruction of JPEG compression objects */ -EXTERN(void) jpeg_destroy_compress JPP((j_compress_ptr cinfo)); -EXTERN(void) jpeg_destroy_decompress JPP((j_decompress_ptr cinfo)); - -/* Standard data source and destination managers: stdio streams. */ -/* Caller is responsible for opening the file before and closing after. */ -EXTERN(void) jpeg_stdio_dest JPP((j_compress_ptr cinfo, FILE * outfile)); -EXTERN(void) jpeg_stdio_src JPP((j_decompress_ptr cinfo, FILE * infile)); - -/* Data source and destination managers: memory buffers. */ -EXTERN(void) jpeg_mem_dest JPP((j_compress_ptr cinfo, - unsigned char ** outbuffer, - unsigned long * outsize)); -EXTERN(void) jpeg_mem_src JPP((j_decompress_ptr cinfo, - unsigned char * inbuffer, - unsigned long insize)); - -/* Default parameter setup for compression */ -EXTERN(void) jpeg_set_defaults JPP((j_compress_ptr cinfo)); -/* Compression parameter setup aids */ -EXTERN(void) jpeg_set_colorspace JPP((j_compress_ptr cinfo, - J_COLOR_SPACE colorspace)); -EXTERN(void) jpeg_default_colorspace JPP((j_compress_ptr cinfo)); -EXTERN(void) jpeg_set_quality JPP((j_compress_ptr cinfo, int quality, - boolean force_baseline)); -EXTERN(void) jpeg_set_linear_quality JPP((j_compress_ptr cinfo, - int scale_factor, - boolean force_baseline)); -EXTERN(void) jpeg_default_qtables JPP((j_compress_ptr cinfo, - boolean force_baseline)); -EXTERN(void) jpeg_add_quant_table JPP((j_compress_ptr cinfo, int which_tbl, - const unsigned int *basic_table, - int scale_factor, - boolean force_baseline)); -EXTERN(int) jpeg_quality_scaling JPP((int quality)); -EXTERN(void) jpeg_simple_progression JPP((j_compress_ptr cinfo)); -EXTERN(void) jpeg_suppress_tables JPP((j_compress_ptr cinfo, - boolean suppress)); -EXTERN(JQUANT_TBL *) jpeg_alloc_quant_table JPP((j_common_ptr cinfo)); -EXTERN(JHUFF_TBL *) jpeg_alloc_huff_table JPP((j_common_ptr cinfo)); - -/* Main entry points for compression */ -EXTERN(void) jpeg_start_compress JPP((j_compress_ptr cinfo, - boolean write_all_tables)); -EXTERN(JDIMENSION) jpeg_write_scanlines JPP((j_compress_ptr cinfo, - JSAMPARRAY scanlines, - JDIMENSION num_lines)); -EXTERN(void) jpeg_finish_compress JPP((j_compress_ptr cinfo)); - -/* Precalculate JPEG dimensions for current compression parameters. */ -EXTERN(void) jpeg_calc_jpeg_dimensions JPP((j_compress_ptr cinfo)); - -/* Replaces jpeg_write_scanlines when writing raw downsampled data. */ -EXTERN(JDIMENSION) jpeg_write_raw_data JPP((j_compress_ptr cinfo, - JSAMPIMAGE data, - JDIMENSION num_lines)); - -/* Write a special marker. See libjpeg.txt concerning safe usage. */ -EXTERN(void) jpeg_write_marker - JPP((j_compress_ptr cinfo, int marker, - const JOCTET * dataptr, unsigned int datalen)); -/* Same, but piecemeal. */ -EXTERN(void) jpeg_write_m_header - JPP((j_compress_ptr cinfo, int marker, unsigned int datalen)); -EXTERN(void) jpeg_write_m_byte - JPP((j_compress_ptr cinfo, int val)); - -/* Alternate compression function: just write an abbreviated table file */ -EXTERN(void) jpeg_write_tables JPP((j_compress_ptr cinfo)); - -/* Decompression startup: read start of JPEG datastream to see what's there */ -EXTERN(int) jpeg_read_header JPP((j_decompress_ptr cinfo, - boolean require_image)); -/* Return value is one of: */ -#define JPEG_SUSPENDED 0 /* Suspended due to lack of input data */ -#define JPEG_HEADER_OK 1 /* Found valid image datastream */ -#define JPEG_HEADER_TABLES_ONLY 2 /* Found valid table-specs-only datastream */ -/* If you pass require_image = TRUE (normal case), you need not check for - * a TABLES_ONLY return code; an abbreviated file will cause an error exit. - * JPEG_SUSPENDED is only possible if you use a data source module that can - * give a suspension return (the stdio source module doesn't). - */ - -/* Main entry points for decompression */ -EXTERN(boolean) jpeg_start_decompress JPP((j_decompress_ptr cinfo)); -EXTERN(JDIMENSION) jpeg_read_scanlines JPP((j_decompress_ptr cinfo, - JSAMPARRAY scanlines, - JDIMENSION max_lines)); -EXTERN(boolean) jpeg_finish_decompress JPP((j_decompress_ptr cinfo)); - -/* Replaces jpeg_read_scanlines when reading raw downsampled data. */ -EXTERN(JDIMENSION) jpeg_read_raw_data JPP((j_decompress_ptr cinfo, - JSAMPIMAGE data, - JDIMENSION max_lines)); - -/* Additional entry points for buffered-image mode. */ -EXTERN(boolean) jpeg_has_multiple_scans JPP((j_decompress_ptr cinfo)); -EXTERN(boolean) jpeg_start_output JPP((j_decompress_ptr cinfo, - int scan_number)); -EXTERN(boolean) jpeg_finish_output JPP((j_decompress_ptr cinfo)); -EXTERN(boolean) jpeg_input_complete JPP((j_decompress_ptr cinfo)); -EXTERN(void) jpeg_new_colormap JPP((j_decompress_ptr cinfo)); -EXTERN(int) jpeg_consume_input JPP((j_decompress_ptr cinfo)); -/* Return value is one of: */ -/* #define JPEG_SUSPENDED 0 Suspended due to lack of input data */ -#define JPEG_REACHED_SOS 1 /* Reached start of new scan */ -#define JPEG_REACHED_EOI 2 /* Reached end of image */ -#define JPEG_ROW_COMPLETED 3 /* Completed one iMCU row */ -#define JPEG_SCAN_COMPLETED 4 /* Completed last iMCU row of a scan */ - -/* Precalculate output dimensions for current decompression parameters. */ -EXTERN(void) jpeg_core_output_dimensions JPP((j_decompress_ptr cinfo)); -EXTERN(void) jpeg_calc_output_dimensions JPP((j_decompress_ptr cinfo)); - -/* Control saving of COM and APPn markers into marker_list. */ -EXTERN(void) jpeg_save_markers - JPP((j_decompress_ptr cinfo, int marker_code, - unsigned int length_limit)); - -/* Install a special processing method for COM or APPn markers. */ -EXTERN(void) jpeg_set_marker_processor - JPP((j_decompress_ptr cinfo, int marker_code, - jpeg_marker_parser_method routine)); - -/* Read or write raw DCT coefficients --- useful for lossless transcoding. */ -EXTERN(jvirt_barray_ptr *) jpeg_read_coefficients JPP((j_decompress_ptr cinfo)); -EXTERN(void) jpeg_write_coefficients JPP((j_compress_ptr cinfo, - jvirt_barray_ptr * coef_arrays)); -EXTERN(void) jpeg_copy_critical_parameters JPP((j_decompress_ptr srcinfo, - j_compress_ptr dstinfo)); - -/* If you choose to abort compression or decompression before completing - * jpeg_finish_(de)compress, then you need to clean up to release memory, - * temporary files, etc. You can just call jpeg_destroy_(de)compress - * if you're done with the JPEG object, but if you want to clean it up and - * reuse it, call this: - */ -EXTERN(void) jpeg_abort_compress JPP((j_compress_ptr cinfo)); -EXTERN(void) jpeg_abort_decompress JPP((j_decompress_ptr cinfo)); - -/* Generic versions of jpeg_abort and jpeg_destroy that work on either - * flavor of JPEG object. These may be more convenient in some places. - */ -EXTERN(void) jpeg_abort JPP((j_common_ptr cinfo)); -EXTERN(void) jpeg_destroy JPP((j_common_ptr cinfo)); - -/* Default restart-marker-resync procedure for use by data source modules */ -EXTERN(boolean) jpeg_resync_to_restart JPP((j_decompress_ptr cinfo, - int desired)); - - -/* These marker codes are exported since applications and data source modules - * are likely to want to use them. - */ - -#define JPEG_RST0 0xD0 /* RST0 marker code */ -#define JPEG_EOI 0xD9 /* EOI marker code */ -#define JPEG_APP0 0xE0 /* APP0 marker code */ -#define JPEG_COM 0xFE /* COM marker code */ - - -/* If we have a brain-damaged compiler that emits warnings (or worse, errors) - * for structure definitions that are never filled in, keep it quiet by - * supplying dummy definitions for the various substructures. - */ - -#ifdef INCOMPLETE_TYPES_BROKEN -#ifndef JPEG_INTERNALS /* will be defined in jpegint.h */ -struct jvirt_sarray_control { long dummy; }; -struct jvirt_barray_control { long dummy; }; -struct jpeg_comp_master { long dummy; }; -struct jpeg_c_main_controller { long dummy; }; -struct jpeg_c_prep_controller { long dummy; }; -struct jpeg_c_coef_controller { long dummy; }; -struct jpeg_marker_writer { long dummy; }; -struct jpeg_color_converter { long dummy; }; -struct jpeg_downsampler { long dummy; }; -struct jpeg_forward_dct { long dummy; }; -struct jpeg_entropy_encoder { long dummy; }; -struct jpeg_decomp_master { long dummy; }; -struct jpeg_d_main_controller { long dummy; }; -struct jpeg_d_coef_controller { long dummy; }; -struct jpeg_d_post_controller { long dummy; }; -struct jpeg_input_controller { long dummy; }; -struct jpeg_marker_reader { long dummy; }; -struct jpeg_entropy_decoder { long dummy; }; -struct jpeg_inverse_dct { long dummy; }; -struct jpeg_upsampler { long dummy; }; -struct jpeg_color_deconverter { long dummy; }; -struct jpeg_color_quantizer { long dummy; }; -#endif /* JPEG_INTERNALS */ -#endif /* INCOMPLETE_TYPES_BROKEN */ - - -/* - * The JPEG library modules define JPEG_INTERNALS before including this file. - * The internal structure declarations are read only when that is true. - * Applications using the library should not include jpegint.h, but may wish - * to include jerror.h. - */ - -#ifdef JPEG_INTERNALS -#include "jpegint.h" /* fetch private declarations */ -#include "jerror.h" /* fetch error codes too */ -#endif - -#ifdef __cplusplus -#ifndef DONT_USE_EXTERN_C -} -#endif -#endif - -#endif /* JPEGLIB_H */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/png.h.REMOVED.git-id b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/png.h.REMOVED.git-id deleted file mode 100644 index 76c30b9de5..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/png.h.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -42e7013147cfafe0a19f8173fb6c582e988674e4 \ No newline at end of file diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/pngconf.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/pngconf.h deleted file mode 100644 index 57293c3c77..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/pngconf.h +++ /dev/null @@ -1,1665 +0,0 @@ - -/* pngconf.h - machine configurable file for libpng - * - * libpng version 1.2.46 - July 9, 2011 - * Copyright (c) 1998-2011 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) - * - * This code is released under the libpng license. - * For conditions of distribution and use, see the disclaimer - * and license in png.h - */ - -/* Any machine specific code is near the front of this file, so if you - * are configuring libpng for a machine, you may want to read the section - * starting here down to where it starts to typedef png_color, png_text, - * and png_info. - */ - -#ifndef PNGCONF_H -#define PNGCONF_H - -#define PNG_1_2_X - -/* - * PNG_USER_CONFIG has to be defined on the compiler command line. This - * includes the resource compiler for Windows DLL configurations. - */ -#ifdef PNG_USER_CONFIG -# ifndef PNG_USER_PRIVATEBUILD -# define PNG_USER_PRIVATEBUILD -# endif -#include "pngusr.h" -#endif - -/* PNG_CONFIGURE_LIBPNG is set by the "configure" script. */ -#ifdef PNG_CONFIGURE_LIBPNG -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif -#endif - -/* - * Added at libpng-1.2.8 - * - * If you create a private DLL you need to define in "pngusr.h" the followings: - * #define PNG_USER_PRIVATEBUILD <Describes by whom and why this version of - * the DLL was built> - * e.g. #define PNG_USER_PRIVATEBUILD "Build by MyCompany for xyz reasons." - * #define PNG_USER_DLLFNAME_POSTFIX <two-letter postfix that serve to - * distinguish your DLL from those of the official release. These - * correspond to the trailing letters that come after the version - * number and must match your private DLL name> - * e.g. // private DLL "libpng13gx.dll" - * #define PNG_USER_DLLFNAME_POSTFIX "gx" - * - * The following macros are also at your disposal if you want to complete the - * DLL VERSIONINFO structure. - * - PNG_USER_VERSIONINFO_COMMENTS - * - PNG_USER_VERSIONINFO_COMPANYNAME - * - PNG_USER_VERSIONINFO_LEGALTRADEMARKS - */ - -#ifdef __STDC__ -#ifdef SPECIALBUILD -# pragma message("PNG_LIBPNG_SPECIALBUILD (and deprecated SPECIALBUILD)\ - are now LIBPNG reserved macros. Use PNG_USER_PRIVATEBUILD instead.") -#endif - -#ifdef PRIVATEBUILD -# pragma message("PRIVATEBUILD is deprecated.\ - Use PNG_USER_PRIVATEBUILD instead.") -# define PNG_USER_PRIVATEBUILD PRIVATEBUILD -#endif -#endif /* __STDC__ */ - -#ifndef PNG_VERSION_INFO_ONLY - -/* End of material added to libpng-1.2.8 */ - -/* Added at libpng-1.2.19, removed at libpng-1.2.20 because it caused trouble - Restored at libpng-1.2.21 */ -#if !defined(PNG_NO_WARN_UNINITIALIZED_ROW) && \ - !defined(PNG_WARN_UNINITIALIZED_ROW) -# define PNG_WARN_UNINITIALIZED_ROW 1 -#endif -/* End of material added at libpng-1.2.19/1.2.21 */ - -/* This is the size of the compression buffer, and thus the size of - * an IDAT chunk. Make this whatever size you feel is best for your - * machine. One of these will be allocated per png_struct. When this - * is full, it writes the data to the disk, and does some other - * calculations. Making this an extremely small size will slow - * the library down, but you may want to experiment to determine - * where it becomes significant, if you are concerned with memory - * usage. Note that zlib allocates at least 32Kb also. For readers, - * this describes the size of the buffer available to read the data in. - * Unless this gets smaller than the size of a row (compressed), - * it should not make much difference how big this is. - */ - -#ifndef PNG_ZBUF_SIZE -# define PNG_ZBUF_SIZE 8192 -#endif - -/* Enable if you want a write-only libpng */ - -#ifndef PNG_NO_READ_SUPPORTED -# define PNG_READ_SUPPORTED -#endif - -/* Enable if you want a read-only libpng */ - -#ifndef PNG_NO_WRITE_SUPPORTED -# define PNG_WRITE_SUPPORTED -#endif - -/* Enabled in 1.2.41. */ -#ifdef PNG_ALLOW_BENIGN_ERRORS -# define png_benign_error png_warning -# define png_chunk_benign_error png_chunk_warning -#else -# ifndef PNG_BENIGN_ERRORS_SUPPORTED -# define png_benign_error png_error -# define png_chunk_benign_error png_chunk_error -# endif -#endif - -/* Added in libpng-1.2.41 */ -#if !defined(PNG_NO_WARNINGS) && !defined(PNG_WARNINGS_SUPPORTED) -# define PNG_WARNINGS_SUPPORTED -#endif - -#if !defined(PNG_NO_ERROR_TEXT) && !defined(PNG_ERROR_TEXT_SUPPORTED) -# define PNG_ERROR_TEXT_SUPPORTED -#endif - -#if !defined(PNG_NO_CHECK_cHRM) && !defined(PNG_CHECK_cHRM_SUPPORTED) -# define PNG_CHECK_cHRM_SUPPORTED -#endif - -/* Enabled by default in 1.2.0. You can disable this if you don't need to - * support PNGs that are embedded in MNG datastreams - */ -#if !defined(PNG_1_0_X) && !defined(PNG_NO_MNG_FEATURES) -# ifndef PNG_MNG_FEATURES_SUPPORTED -# define PNG_MNG_FEATURES_SUPPORTED -# endif -#endif - -#ifndef PNG_NO_FLOATING_POINT_SUPPORTED -# ifndef PNG_FLOATING_POINT_SUPPORTED -# define PNG_FLOATING_POINT_SUPPORTED -# endif -#endif - -/* If you are running on a machine where you cannot allocate more - * than 64K of memory at once, uncomment this. While libpng will not - * normally need that much memory in a chunk (unless you load up a very - * large file), zlib needs to know how big of a chunk it can use, and - * libpng thus makes sure to check any memory allocation to verify it - * will fit into memory. -#define PNG_MAX_MALLOC_64K - */ -#if defined(MAXSEG_64K) && !defined(PNG_MAX_MALLOC_64K) -# define PNG_MAX_MALLOC_64K -#endif - -/* Special munging to support doing things the 'cygwin' way: - * 'Normal' png-on-win32 defines/defaults: - * PNG_BUILD_DLL -- building dll - * PNG_USE_DLL -- building an application, linking to dll - * (no define) -- building static library, or building an - * application and linking to the static lib - * 'Cygwin' defines/defaults: - * PNG_BUILD_DLL -- (ignored) building the dll - * (no define) -- (ignored) building an application, linking to the dll - * PNG_STATIC -- (ignored) building the static lib, or building an - * application that links to the static lib. - * ALL_STATIC -- (ignored) building various static libs, or building an - * application that links to the static libs. - * Thus, - * a cygwin user should define either PNG_BUILD_DLL or PNG_STATIC, and - * this bit of #ifdefs will define the 'correct' config variables based on - * that. If a cygwin user *wants* to define 'PNG_USE_DLL' that's okay, but - * unnecessary. - * - * Also, the precedence order is: - * ALL_STATIC (since we can't #undef something outside our namespace) - * PNG_BUILD_DLL - * PNG_STATIC - * (nothing) == PNG_USE_DLL - * - * CYGWIN (2002-01-20): The preceding is now obsolete. With the advent - * of auto-import in binutils, we no longer need to worry about - * __declspec(dllexport) / __declspec(dllimport) and friends. Therefore, - * we don't need to worry about PNG_STATIC or ALL_STATIC when it comes - * to __declspec() stuff. However, we DO need to worry about - * PNG_BUILD_DLL and PNG_STATIC because those change some defaults - * such as CONSOLE_IO and whether GLOBAL_ARRAYS are allowed. - */ -#ifdef __CYGWIN__ -# ifdef ALL_STATIC -# ifdef PNG_BUILD_DLL -# undef PNG_BUILD_DLL -# endif -# ifdef PNG_USE_DLL -# undef PNG_USE_DLL -# endif -# ifdef PNG_DLL -# undef PNG_DLL -# endif -# ifndef PNG_STATIC -# define PNG_STATIC -# endif -# else -# ifdef PNG_BUILD_DLL -# ifdef PNG_STATIC -# undef PNG_STATIC -# endif -# ifdef PNG_USE_DLL -# undef PNG_USE_DLL -# endif -# ifndef PNG_DLL -# define PNG_DLL -# endif -# else -# ifdef PNG_STATIC -# ifdef PNG_USE_DLL -# undef PNG_USE_DLL -# endif -# ifdef PNG_DLL -# undef PNG_DLL -# endif -# else -# ifndef PNG_USE_DLL -# define PNG_USE_DLL -# endif -# ifndef PNG_DLL -# define PNG_DLL -# endif -# endif -# endif -# endif -#endif - -/* This protects us against compilers that run on a windowing system - * and thus don't have or would rather us not use the stdio types: - * stdin, stdout, and stderr. The only one currently used is stderr - * in png_error() and png_warning(). #defining PNG_NO_CONSOLE_IO will - * prevent these from being compiled and used. #defining PNG_NO_STDIO - * will also prevent these, plus will prevent the entire set of stdio - * macros and functions (FILE *, printf, etc.) from being compiled and used, - * unless (PNG_DEBUG > 0) has been #defined. - * - * #define PNG_NO_CONSOLE_IO - * #define PNG_NO_STDIO - */ - -#if !defined(PNG_NO_STDIO) && !defined(PNG_STDIO_SUPPORTED) -# define PNG_STDIO_SUPPORTED -#endif - -#ifdef _WIN32_WCE -# include <windows.h> - /* Console I/O functions are not supported on WindowsCE */ -# define PNG_NO_CONSOLE_IO - /* abort() may not be supported on some/all Windows CE platforms */ -# define PNG_ABORT() exit(-1) -# ifdef PNG_DEBUG -# undef PNG_DEBUG -# endif -#endif - -#ifdef PNG_BUILD_DLL -# ifndef PNG_CONSOLE_IO_SUPPORTED -# ifndef PNG_NO_CONSOLE_IO -# define PNG_NO_CONSOLE_IO -# endif -# endif -#endif - -# ifdef PNG_NO_STDIO -# ifndef PNG_NO_CONSOLE_IO -# define PNG_NO_CONSOLE_IO -# endif -# ifdef PNG_DEBUG -# if (PNG_DEBUG > 0) -# include <stdio.h> -# endif -# endif -# else -# ifndef _WIN32_WCE -/* "stdio.h" functions are not supported on WindowsCE */ -# include <stdio.h> -# endif -# endif - -#if !(defined PNG_NO_CONSOLE_IO) && !defined(PNG_CONSOLE_IO_SUPPORTED) -# define PNG_CONSOLE_IO_SUPPORTED -#endif - -/* This macro protects us against machines that don't have function - * prototypes (ie K&R style headers). If your compiler does not handle - * function prototypes, define this macro and use the included ansi2knr. - * I've always been able to use _NO_PROTO as the indicator, but you may - * need to drag the empty declaration out in front of here, or change the - * ifdef to suit your own needs. - */ -#ifndef PNGARG - -#ifdef OF /* zlib prototype munger */ -# define PNGARG(arglist) OF(arglist) -#else - -#ifdef _NO_PROTO -# define PNGARG(arglist) () -# ifndef PNG_TYPECAST_NULL -# define PNG_TYPECAST_NULL -# endif -#else -# define PNGARG(arglist) arglist -#endif /* _NO_PROTO */ - - -#endif /* OF */ - -#endif /* PNGARG */ - -/* Try to determine if we are compiling on a Mac. Note that testing for - * just __MWERKS__ is not good enough, because the Codewarrior is now used - * on non-Mac platforms. - */ -#ifndef MACOS -# if (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \ - defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC) -# define MACOS -# endif -#endif - -/* enough people need this for various reasons to include it here */ -#if !defined(MACOS) && !defined(RISCOS) && !defined(_WIN32_WCE) -# include <sys/types.h> -#endif - -#if !defined(PNG_SETJMP_NOT_SUPPORTED) && !defined(PNG_NO_SETJMP_SUPPORTED) -# define PNG_SETJMP_SUPPORTED -#endif - -#ifdef PNG_SETJMP_SUPPORTED -/* This is an attempt to force a single setjmp behaviour on Linux. If - * the X config stuff didn't define _BSD_SOURCE we wouldn't need this. - * - * You can bypass this test if you know that your application uses exactly - * the same setjmp.h that was included when libpng was built. Only define - * PNG_SKIP_SETJMP_CHECK while building your application, prior to the - * application's '#include "png.h"'. Don't define PNG_SKIP_SETJMP_CHECK - * while building a separate libpng library for general use. - */ - -# ifndef PNG_SKIP_SETJMP_CHECK -# ifdef __linux__ -# ifdef _BSD_SOURCE -# define PNG_SAVE_BSD_SOURCE -# undef _BSD_SOURCE -# endif -# ifdef _SETJMP_H - /* If you encounter a compiler error here, see the explanation - * near the end of INSTALL. - */ - __pngconf.h__ in libpng already includes setjmp.h; - __dont__ include it again.; -# endif -# endif /* __linux__ */ -# endif /* PNG_SKIP_SETJMP_CHECK */ - - /* include setjmp.h for error handling */ -# include <setjmp.h> - -# ifdef __linux__ -# ifdef PNG_SAVE_BSD_SOURCE -# ifndef _BSD_SOURCE -# define _BSD_SOURCE -# endif -# undef PNG_SAVE_BSD_SOURCE -# endif -# endif /* __linux__ */ -#endif /* PNG_SETJMP_SUPPORTED */ - -#ifdef BSD -# include <strings.h> -#else -# include <string.h> -#endif - -/* Other defines for things like memory and the like can go here. */ -#ifdef PNG_INTERNAL - -#include <stdlib.h> - -/* The functions exported by PNG_EXTERN are PNG_INTERNAL functions, which - * aren't usually used outside the library (as far as I know), so it is - * debatable if they should be exported at all. In the future, when it is - * possible to have run-time registry of chunk-handling functions, some of - * these will be made available again. -#define PNG_EXTERN extern - */ -#define PNG_EXTERN - -/* Other defines specific to compilers can go here. Try to keep - * them inside an appropriate ifdef/endif pair for portability. - */ - -#ifdef PNG_FLOATING_POINT_SUPPORTED -# ifdef MACOS - /* We need to check that <math.h> hasn't already been included earlier - * as it seems it doesn't agree with <fp.h>, yet we should really use - * <fp.h> if possible. - */ -# if !defined(__MATH_H__) && !defined(__MATH_H) && !defined(__cmath__) -# include <fp.h> -# endif -# else -# include <math.h> -# endif -# if defined(_AMIGA) && defined(__SASC) && defined(_M68881) - /* Amiga SAS/C: We must include builtin FPU functions when compiling using - * MATH=68881 - */ -# include <m68881.h> -# endif -#endif - -/* Codewarrior on NT has linking problems without this. */ -#if (defined(__MWERKS__) && defined(WIN32)) || defined(__STDC__) -# define PNG_ALWAYS_EXTERN -#endif - -/* This provides the non-ANSI (far) memory allocation routines. */ -#if defined(__TURBOC__) && defined(__MSDOS__) -# include <mem.h> -# include <alloc.h> -#endif - -/* I have no idea why is this necessary... */ -#if defined(_MSC_VER) && (defined(WIN32) || defined(_Windows) || \ - defined(_WINDOWS) || defined(_WIN32) || defined(__WIN32__)) -# include <malloc.h> -#endif - -/* This controls how fine the dithering gets. As this allocates - * a largish chunk of memory (32K), those who are not as concerned - * with dithering quality can decrease some or all of these. - */ -#ifndef PNG_DITHER_RED_BITS -# define PNG_DITHER_RED_BITS 5 -#endif -#ifndef PNG_DITHER_GREEN_BITS -# define PNG_DITHER_GREEN_BITS 5 -#endif -#ifndef PNG_DITHER_BLUE_BITS -# define PNG_DITHER_BLUE_BITS 5 -#endif - -/* This controls how fine the gamma correction becomes when you - * are only interested in 8 bits anyway. Increasing this value - * results in more memory being used, and more pow() functions - * being called to fill in the gamma tables. Don't set this value - * less then 8, and even that may not work (I haven't tested it). - */ - -#ifndef PNG_MAX_GAMMA_8 -# define PNG_MAX_GAMMA_8 11 -#endif - -/* This controls how much a difference in gamma we can tolerate before - * we actually start doing gamma conversion. - */ -#ifndef PNG_GAMMA_THRESHOLD -# define PNG_GAMMA_THRESHOLD 0.05 -#endif - -#endif /* PNG_INTERNAL */ - -/* The following uses const char * instead of char * for error - * and warning message functions, so some compilers won't complain. - * If you do not want to use const, define PNG_NO_CONST here. - */ - -#ifndef PNG_NO_CONST -# define PNG_CONST const -#else -# define PNG_CONST -#endif - -/* The following defines give you the ability to remove code from the - * library that you will not be using. I wish I could figure out how to - * automate this, but I can't do that without making it seriously hard - * on the users. So if you are not using an ability, change the #define - * to and #undef, and that part of the library will not be compiled. If - * your linker can't find a function, you may want to make sure the - * ability is defined here. Some of these depend upon some others being - * defined. I haven't figured out all the interactions here, so you may - * have to experiment awhile to get everything to compile. If you are - * creating or using a shared library, you probably shouldn't touch this, - * as it will affect the size of the structures, and this will cause bad - * things to happen if the library and/or application ever change. - */ - -/* Any features you will not be using can be undef'ed here */ - -/* GR-P, 0.96a: Set "*TRANSFORMS_SUPPORTED as default but allow user - * to turn it off with "*TRANSFORMS_NOT_SUPPORTED" or *PNG_NO_*_TRANSFORMS - * on the compile line, then pick and choose which ones to define without - * having to edit this file. It is safe to use the *TRANSFORMS_NOT_SUPPORTED - * if you only want to have a png-compliant reader/writer but don't need - * any of the extra transformations. This saves about 80 kbytes in a - * typical installation of the library. (PNG_NO_* form added in version - * 1.0.1c, for consistency) - */ - -/* The size of the png_text structure changed in libpng-1.0.6 when - * iTXt support was added. iTXt support was turned off by default through - * libpng-1.2.x, to support old apps that malloc the png_text structure - * instead of calling png_set_text() and letting libpng malloc it. It - * will be turned on by default in libpng-1.4.0. - */ - -#if defined(PNG_1_0_X) || defined (PNG_1_2_X) -# ifndef PNG_NO_iTXt_SUPPORTED -# define PNG_NO_iTXt_SUPPORTED -# endif -# ifndef PNG_NO_READ_iTXt -# define PNG_NO_READ_iTXt -# endif -# ifndef PNG_NO_WRITE_iTXt -# define PNG_NO_WRITE_iTXt -# endif -#endif - -#if !defined(PNG_NO_iTXt_SUPPORTED) -# if !defined(PNG_READ_iTXt_SUPPORTED) && !defined(PNG_NO_READ_iTXt) -# define PNG_READ_iTXt -# endif -# if !defined(PNG_WRITE_iTXt_SUPPORTED) && !defined(PNG_NO_WRITE_iTXt) -# define PNG_WRITE_iTXt -# endif -#endif - -/* The following support, added after version 1.0.0, can be turned off here en - * masse by defining PNG_LEGACY_SUPPORTED in case you need binary compatibility - * with old applications that require the length of png_struct and png_info - * to remain unchanged. - */ - -#ifdef PNG_LEGACY_SUPPORTED -# define PNG_NO_FREE_ME -# define PNG_NO_READ_UNKNOWN_CHUNKS -# define PNG_NO_WRITE_UNKNOWN_CHUNKS -# define PNG_NO_HANDLE_AS_UNKNOWN -# define PNG_NO_READ_USER_CHUNKS -# define PNG_NO_READ_iCCP -# define PNG_NO_WRITE_iCCP -# define PNG_NO_READ_iTXt -# define PNG_NO_WRITE_iTXt -# define PNG_NO_READ_sCAL -# define PNG_NO_WRITE_sCAL -# define PNG_NO_READ_sPLT -# define PNG_NO_WRITE_sPLT -# define PNG_NO_INFO_IMAGE -# define PNG_NO_READ_RGB_TO_GRAY -# define PNG_NO_READ_USER_TRANSFORM -# define PNG_NO_WRITE_USER_TRANSFORM -# define PNG_NO_USER_MEM -# define PNG_NO_READ_EMPTY_PLTE -# define PNG_NO_MNG_FEATURES -# define PNG_NO_FIXED_POINT_SUPPORTED -#endif - -/* Ignore attempt to turn off both floating and fixed point support */ -#if !defined(PNG_FLOATING_POINT_SUPPORTED) || \ - !defined(PNG_NO_FIXED_POINT_SUPPORTED) -# define PNG_FIXED_POINT_SUPPORTED -#endif - -#ifndef PNG_NO_FREE_ME -# define PNG_FREE_ME_SUPPORTED -#endif - -#ifdef PNG_READ_SUPPORTED - -#if !defined(PNG_READ_TRANSFORMS_NOT_SUPPORTED) && \ - !defined(PNG_NO_READ_TRANSFORMS) -# define PNG_READ_TRANSFORMS_SUPPORTED -#endif - -#ifdef PNG_READ_TRANSFORMS_SUPPORTED -# ifndef PNG_NO_READ_EXPAND -# define PNG_READ_EXPAND_SUPPORTED -# endif -# ifndef PNG_NO_READ_SHIFT -# define PNG_READ_SHIFT_SUPPORTED -# endif -# ifndef PNG_NO_READ_PACK -# define PNG_READ_PACK_SUPPORTED -# endif -# ifndef PNG_NO_READ_BGR -# define PNG_READ_BGR_SUPPORTED -# endif -# ifndef PNG_NO_READ_SWAP -# define PNG_READ_SWAP_SUPPORTED -# endif -# ifndef PNG_NO_READ_PACKSWAP -# define PNG_READ_PACKSWAP_SUPPORTED -# endif -# ifndef PNG_NO_READ_INVERT -# define PNG_READ_INVERT_SUPPORTED -# endif -# ifndef PNG_NO_READ_DITHER -# define PNG_READ_DITHER_SUPPORTED -# endif -# ifndef PNG_NO_READ_BACKGROUND -# define PNG_READ_BACKGROUND_SUPPORTED -# endif -# ifndef PNG_NO_READ_16_TO_8 -# define PNG_READ_16_TO_8_SUPPORTED -# endif -# ifndef PNG_NO_READ_FILLER -# define PNG_READ_FILLER_SUPPORTED -# endif -# ifndef PNG_NO_READ_GAMMA -# define PNG_READ_GAMMA_SUPPORTED -# endif -# ifndef PNG_NO_READ_GRAY_TO_RGB -# define PNG_READ_GRAY_TO_RGB_SUPPORTED -# endif -# ifndef PNG_NO_READ_SWAP_ALPHA -# define PNG_READ_SWAP_ALPHA_SUPPORTED -# endif -# ifndef PNG_NO_READ_INVERT_ALPHA -# define PNG_READ_INVERT_ALPHA_SUPPORTED -# endif -# ifndef PNG_NO_READ_STRIP_ALPHA -# define PNG_READ_STRIP_ALPHA_SUPPORTED -# endif -# ifndef PNG_NO_READ_USER_TRANSFORM -# define PNG_READ_USER_TRANSFORM_SUPPORTED -# endif -# ifndef PNG_NO_READ_RGB_TO_GRAY -# define PNG_READ_RGB_TO_GRAY_SUPPORTED -# endif -#endif /* PNG_READ_TRANSFORMS_SUPPORTED */ - -/* PNG_PROGRESSIVE_READ_NOT_SUPPORTED is deprecated. */ -#if !defined(PNG_NO_PROGRESSIVE_READ) && \ - !defined(PNG_PROGRESSIVE_READ_NOT_SUPPORTED) /* if you don't do progressive */ -# define PNG_PROGRESSIVE_READ_SUPPORTED /* reading. This is not talking */ -#endif /* about interlacing capability! You'll */ - /* still have interlacing unless you change the following define: */ -#define PNG_READ_INTERLACING_SUPPORTED /* required for PNG-compliant decoders */ - -/* PNG_NO_SEQUENTIAL_READ_SUPPORTED is deprecated. */ -#if !defined(PNG_NO_SEQUENTIAL_READ) && \ - !defined(PNG_SEQUENTIAL_READ_SUPPORTED) && \ - !defined(PNG_NO_SEQUENTIAL_READ_SUPPORTED) -# define PNG_SEQUENTIAL_READ_SUPPORTED -#endif - -#define PNG_READ_INTERLACING_SUPPORTED /* required in PNG-compliant decoders */ - -#ifndef PNG_NO_READ_COMPOSITE_NODIV -# ifndef PNG_NO_READ_COMPOSITED_NODIV /* libpng-1.0.x misspelling */ -# define PNG_READ_COMPOSITE_NODIV_SUPPORTED /* well tested on Intel, SGI */ -# endif -#endif - -#if defined(PNG_1_0_X) || defined (PNG_1_2_X) -/* Deprecated, will be removed from version 2.0.0. - Use PNG_MNG_FEATURES_SUPPORTED instead. */ -#ifndef PNG_NO_READ_EMPTY_PLTE -# define PNG_READ_EMPTY_PLTE_SUPPORTED -#endif -#endif - -#endif /* PNG_READ_SUPPORTED */ - -#ifdef PNG_WRITE_SUPPORTED - -# if !defined(PNG_WRITE_TRANSFORMS_NOT_SUPPORTED) && \ - !defined(PNG_NO_WRITE_TRANSFORMS) -# define PNG_WRITE_TRANSFORMS_SUPPORTED -#endif - -#ifdef PNG_WRITE_TRANSFORMS_SUPPORTED -# ifndef PNG_NO_WRITE_SHIFT -# define PNG_WRITE_SHIFT_SUPPORTED -# endif -# ifndef PNG_NO_WRITE_PACK -# define PNG_WRITE_PACK_SUPPORTED -# endif -# ifndef PNG_NO_WRITE_BGR -# define PNG_WRITE_BGR_SUPPORTED -# endif -# ifndef PNG_NO_WRITE_SWAP -# define PNG_WRITE_SWAP_SUPPORTED -# endif -# ifndef PNG_NO_WRITE_PACKSWAP -# define PNG_WRITE_PACKSWAP_SUPPORTED -# endif -# ifndef PNG_NO_WRITE_INVERT -# define PNG_WRITE_INVERT_SUPPORTED -# endif -# ifndef PNG_NO_WRITE_FILLER -# define PNG_WRITE_FILLER_SUPPORTED /* same as WRITE_STRIP_ALPHA */ -# endif -# ifndef PNG_NO_WRITE_SWAP_ALPHA -# define PNG_WRITE_SWAP_ALPHA_SUPPORTED -# endif -#ifndef PNG_1_0_X -# ifndef PNG_NO_WRITE_INVERT_ALPHA -# define PNG_WRITE_INVERT_ALPHA_SUPPORTED -# endif -#endif -# ifndef PNG_NO_WRITE_USER_TRANSFORM -# define PNG_WRITE_USER_TRANSFORM_SUPPORTED -# endif -#endif /* PNG_WRITE_TRANSFORMS_SUPPORTED */ - -#if !defined(PNG_NO_WRITE_INTERLACING_SUPPORTED) && \ - !defined(PNG_WRITE_INTERLACING_SUPPORTED) -#define PNG_WRITE_INTERLACING_SUPPORTED /* not required for PNG-compliant - encoders, but can cause trouble - if left undefined */ -#endif - -#if !defined(PNG_NO_WRITE_WEIGHTED_FILTER) && \ - !defined(PNG_WRITE_WEIGHTED_FILTER) && \ - defined(PNG_FLOATING_POINT_SUPPORTED) -# define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED -#endif - -#ifndef PNG_NO_WRITE_FLUSH -# define PNG_WRITE_FLUSH_SUPPORTED -#endif - -#if defined(PNG_1_0_X) || defined (PNG_1_2_X) -/* Deprecated, see PNG_MNG_FEATURES_SUPPORTED, above */ -#ifndef PNG_NO_WRITE_EMPTY_PLTE -# define PNG_WRITE_EMPTY_PLTE_SUPPORTED -#endif -#endif - -#endif /* PNG_WRITE_SUPPORTED */ - -#ifndef PNG_1_0_X -# ifndef PNG_NO_ERROR_NUMBERS -# define PNG_ERROR_NUMBERS_SUPPORTED -# endif -#endif /* PNG_1_0_X */ - -#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ - defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) -# ifndef PNG_NO_USER_TRANSFORM_PTR -# define PNG_USER_TRANSFORM_PTR_SUPPORTED -# endif -#endif - -#ifndef PNG_NO_STDIO -# define PNG_TIME_RFC1123_SUPPORTED -#endif - -/* This adds extra functions in pngget.c for accessing data from the - * info pointer (added in version 0.99) - * png_get_image_width() - * png_get_image_height() - * png_get_bit_depth() - * png_get_color_type() - * png_get_compression_type() - * png_get_filter_type() - * png_get_interlace_type() - * png_get_pixel_aspect_ratio() - * png_get_pixels_per_meter() - * png_get_x_offset_pixels() - * png_get_y_offset_pixels() - * png_get_x_offset_microns() - * png_get_y_offset_microns() - */ -#if !defined(PNG_NO_EASY_ACCESS) && !defined(PNG_EASY_ACCESS_SUPPORTED) -# define PNG_EASY_ACCESS_SUPPORTED -#endif - -/* PNG_ASSEMBLER_CODE was enabled by default in version 1.2.0 - * and removed from version 1.2.20. The following will be removed - * from libpng-1.4.0 -*/ - -#if defined(PNG_READ_SUPPORTED) && !defined(PNG_NO_OPTIMIZED_CODE) -# ifndef PNG_OPTIMIZED_CODE_SUPPORTED -# define PNG_OPTIMIZED_CODE_SUPPORTED -# endif -#endif - -#if defined(PNG_READ_SUPPORTED) && !defined(PNG_NO_ASSEMBLER_CODE) -# ifndef PNG_ASSEMBLER_CODE_SUPPORTED -# define PNG_ASSEMBLER_CODE_SUPPORTED -# endif - -# if defined(__GNUC__) && defined(__x86_64__) && (__GNUC__ < 4) - /* work around 64-bit gcc compiler bugs in gcc-3.x */ -# if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE) -# define PNG_NO_MMX_CODE -# endif -# endif - -# ifdef __APPLE__ -# if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE) -# define PNG_NO_MMX_CODE -# endif -# endif - -# if (defined(__MWERKS__) && ((__MWERKS__ < 0x0900) || macintosh)) -# if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE) -# define PNG_NO_MMX_CODE -# endif -# endif - -# if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE) -# define PNG_MMX_CODE_SUPPORTED -# endif - -#endif -/* end of obsolete code to be removed from libpng-1.4.0 */ - -/* Added at libpng-1.2.0 */ -#ifndef PNG_1_0_X -#if !defined(PNG_NO_USER_MEM) && !defined(PNG_USER_MEM_SUPPORTED) -# define PNG_USER_MEM_SUPPORTED -#endif -#endif /* PNG_1_0_X */ - -/* Added at libpng-1.2.6 */ -#ifndef PNG_1_0_X -# ifndef PNG_SET_USER_LIMITS_SUPPORTED -# ifndef PNG_NO_SET_USER_LIMITS -# define PNG_SET_USER_LIMITS_SUPPORTED -# endif -# endif -#endif /* PNG_1_0_X */ - -/* Added at libpng-1.0.53 and 1.2.43 */ -#ifndef PNG_USER_LIMITS_SUPPORTED -# ifndef PNG_NO_USER_LIMITS -# define PNG_USER_LIMITS_SUPPORTED -# endif -#endif - -/* Added at libpng-1.0.16 and 1.2.6. To accept all valid PNGS no matter - * how large, set these limits to 0x7fffffffL - */ -#ifndef PNG_USER_WIDTH_MAX -# define PNG_USER_WIDTH_MAX 1000000L -#endif -#ifndef PNG_USER_HEIGHT_MAX -# define PNG_USER_HEIGHT_MAX 1000000L -#endif - -/* Added at libpng-1.2.43. To accept all valid PNGs no matter - * how large, set these two limits to 0. - */ -#ifndef PNG_USER_CHUNK_CACHE_MAX -# define PNG_USER_CHUNK_CACHE_MAX 0 -#endif - -/* Added at libpng-1.2.43 */ -#ifndef PNG_USER_CHUNK_MALLOC_MAX -# define PNG_USER_CHUNK_MALLOC_MAX 0 -#endif - -#ifndef PNG_LITERAL_SHARP -# define PNG_LITERAL_SHARP 0x23 -#endif -#ifndef PNG_LITERAL_LEFT_SQUARE_BRACKET -# define PNG_LITERAL_LEFT_SQUARE_BRACKET 0x5b -#endif -#ifndef PNG_LITERAL_RIGHT_SQUARE_BRACKET -# define PNG_LITERAL_RIGHT_SQUARE_BRACKET 0x5d -#endif - -/* Added at libpng-1.2.34 */ -#ifndef PNG_STRING_NEWLINE -#define PNG_STRING_NEWLINE "\n" -#endif - -/* These are currently experimental features, define them if you want */ - -/* very little testing */ -/* -#ifdef PNG_READ_SUPPORTED -# ifndef PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED -# define PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED -# endif -#endif -*/ - -/* This is only for PowerPC big-endian and 680x0 systems */ -/* some testing */ -/* -#ifndef PNG_READ_BIG_ENDIAN_SUPPORTED -# define PNG_READ_BIG_ENDIAN_SUPPORTED -#endif -*/ - -/* Buggy compilers (e.g., gcc 2.7.2.2) need this */ -/* -#define PNG_NO_POINTER_INDEXING -*/ - -#if !defined(PNG_NO_POINTER_INDEXING) && \ - !defined(PNG_POINTER_INDEXING_SUPPORTED) -# define PNG_POINTER_INDEXING_SUPPORTED -#endif - -/* These functions are turned off by default, as they will be phased out. */ -/* -#define PNG_USELESS_TESTS_SUPPORTED -#define PNG_CORRECT_PALETTE_SUPPORTED -*/ - -/* Any chunks you are not interested in, you can undef here. The - * ones that allocate memory may be expecially important (hIST, - * tEXt, zTXt, tRNS, pCAL). Others will just save time and make png_info - * a bit smaller. - */ - -#if defined(PNG_READ_SUPPORTED) && \ - !defined(PNG_READ_ANCILLARY_CHUNKS_NOT_SUPPORTED) && \ - !defined(PNG_NO_READ_ANCILLARY_CHUNKS) -# define PNG_READ_ANCILLARY_CHUNKS_SUPPORTED -#endif - -#if defined(PNG_WRITE_SUPPORTED) && \ - !defined(PNG_WRITE_ANCILLARY_CHUNKS_NOT_SUPPORTED) && \ - !defined(PNG_NO_WRITE_ANCILLARY_CHUNKS) -# define PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED -#endif - -#ifdef PNG_READ_ANCILLARY_CHUNKS_SUPPORTED - -#ifdef PNG_NO_READ_TEXT -# define PNG_NO_READ_iTXt -# define PNG_NO_READ_tEXt -# define PNG_NO_READ_zTXt -#endif -#ifndef PNG_NO_READ_bKGD -# define PNG_READ_bKGD_SUPPORTED -# define PNG_bKGD_SUPPORTED -#endif -#ifndef PNG_NO_READ_cHRM -# define PNG_READ_cHRM_SUPPORTED -# define PNG_cHRM_SUPPORTED -#endif -#ifndef PNG_NO_READ_gAMA -# define PNG_READ_gAMA_SUPPORTED -# define PNG_gAMA_SUPPORTED -#endif -#ifndef PNG_NO_READ_hIST -# define PNG_READ_hIST_SUPPORTED -# define PNG_hIST_SUPPORTED -#endif -#ifndef PNG_NO_READ_iCCP -# define PNG_READ_iCCP_SUPPORTED -# define PNG_iCCP_SUPPORTED -#endif -#ifndef PNG_NO_READ_iTXt -# ifndef PNG_READ_iTXt_SUPPORTED -# define PNG_READ_iTXt_SUPPORTED -# endif -# ifndef PNG_iTXt_SUPPORTED -# define PNG_iTXt_SUPPORTED -# endif -#endif -#ifndef PNG_NO_READ_oFFs -# define PNG_READ_oFFs_SUPPORTED -# define PNG_oFFs_SUPPORTED -#endif -#ifndef PNG_NO_READ_pCAL -# define PNG_READ_pCAL_SUPPORTED -# define PNG_pCAL_SUPPORTED -#endif -#ifndef PNG_NO_READ_sCAL -# define PNG_READ_sCAL_SUPPORTED -# define PNG_sCAL_SUPPORTED -#endif -#ifndef PNG_NO_READ_pHYs -# define PNG_READ_pHYs_SUPPORTED -# define PNG_pHYs_SUPPORTED -#endif -#ifndef PNG_NO_READ_sBIT -# define PNG_READ_sBIT_SUPPORTED -# define PNG_sBIT_SUPPORTED -#endif -#ifndef PNG_NO_READ_sPLT -# define PNG_READ_sPLT_SUPPORTED -# define PNG_sPLT_SUPPORTED -#endif -#ifndef PNG_NO_READ_sRGB -# define PNG_READ_sRGB_SUPPORTED -# define PNG_sRGB_SUPPORTED -#endif -#ifndef PNG_NO_READ_tEXt -# define PNG_READ_tEXt_SUPPORTED -# define PNG_tEXt_SUPPORTED -#endif -#ifndef PNG_NO_READ_tIME -# define PNG_READ_tIME_SUPPORTED -# define PNG_tIME_SUPPORTED -#endif -#ifndef PNG_NO_READ_tRNS -# define PNG_READ_tRNS_SUPPORTED -# define PNG_tRNS_SUPPORTED -#endif -#ifndef PNG_NO_READ_zTXt -# define PNG_READ_zTXt_SUPPORTED -# define PNG_zTXt_SUPPORTED -#endif -#ifndef PNG_NO_READ_OPT_PLTE -# define PNG_READ_OPT_PLTE_SUPPORTED /* only affects support of the */ -#endif /* optional PLTE chunk in RGB and RGBA images */ -#if defined(PNG_READ_iTXt_SUPPORTED) || defined(PNG_READ_tEXt_SUPPORTED) || \ - defined(PNG_READ_zTXt_SUPPORTED) -# define PNG_READ_TEXT_SUPPORTED -# define PNG_TEXT_SUPPORTED -#endif - -#endif /* PNG_READ_ANCILLARY_CHUNKS_SUPPORTED */ - -#ifndef PNG_NO_READ_UNKNOWN_CHUNKS -# define PNG_READ_UNKNOWN_CHUNKS_SUPPORTED -# ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED -# define PNG_UNKNOWN_CHUNKS_SUPPORTED -# endif -#endif -#if !defined(PNG_NO_READ_USER_CHUNKS) && \ - defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED) -# define PNG_READ_USER_CHUNKS_SUPPORTED -# define PNG_USER_CHUNKS_SUPPORTED -# ifdef PNG_NO_READ_UNKNOWN_CHUNKS -# undef PNG_NO_READ_UNKNOWN_CHUNKS -# endif -# ifdef PNG_NO_HANDLE_AS_UNKNOWN -# undef PNG_NO_HANDLE_AS_UNKNOWN -# endif -#endif - -#ifndef PNG_NO_HANDLE_AS_UNKNOWN -# ifndef PNG_HANDLE_AS_UNKNOWN_SUPPORTED -# define PNG_HANDLE_AS_UNKNOWN_SUPPORTED -# endif -#endif - -#ifdef PNG_WRITE_SUPPORTED -#ifdef PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED - -#ifdef PNG_NO_WRITE_TEXT -# define PNG_NO_WRITE_iTXt -# define PNG_NO_WRITE_tEXt -# define PNG_NO_WRITE_zTXt -#endif -#ifndef PNG_NO_WRITE_bKGD -# define PNG_WRITE_bKGD_SUPPORTED -# ifndef PNG_bKGD_SUPPORTED -# define PNG_bKGD_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_cHRM -# define PNG_WRITE_cHRM_SUPPORTED -# ifndef PNG_cHRM_SUPPORTED -# define PNG_cHRM_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_gAMA -# define PNG_WRITE_gAMA_SUPPORTED -# ifndef PNG_gAMA_SUPPORTED -# define PNG_gAMA_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_hIST -# define PNG_WRITE_hIST_SUPPORTED -# ifndef PNG_hIST_SUPPORTED -# define PNG_hIST_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_iCCP -# define PNG_WRITE_iCCP_SUPPORTED -# ifndef PNG_iCCP_SUPPORTED -# define PNG_iCCP_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_iTXt -# ifndef PNG_WRITE_iTXt_SUPPORTED -# define PNG_WRITE_iTXt_SUPPORTED -# endif -# ifndef PNG_iTXt_SUPPORTED -# define PNG_iTXt_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_oFFs -# define PNG_WRITE_oFFs_SUPPORTED -# ifndef PNG_oFFs_SUPPORTED -# define PNG_oFFs_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_pCAL -# define PNG_WRITE_pCAL_SUPPORTED -# ifndef PNG_pCAL_SUPPORTED -# define PNG_pCAL_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_sCAL -# define PNG_WRITE_sCAL_SUPPORTED -# ifndef PNG_sCAL_SUPPORTED -# define PNG_sCAL_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_pHYs -# define PNG_WRITE_pHYs_SUPPORTED -# ifndef PNG_pHYs_SUPPORTED -# define PNG_pHYs_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_sBIT -# define PNG_WRITE_sBIT_SUPPORTED -# ifndef PNG_sBIT_SUPPORTED -# define PNG_sBIT_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_sPLT -# define PNG_WRITE_sPLT_SUPPORTED -# ifndef PNG_sPLT_SUPPORTED -# define PNG_sPLT_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_sRGB -# define PNG_WRITE_sRGB_SUPPORTED -# ifndef PNG_sRGB_SUPPORTED -# define PNG_sRGB_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_tEXt -# define PNG_WRITE_tEXt_SUPPORTED -# ifndef PNG_tEXt_SUPPORTED -# define PNG_tEXt_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_tIME -# define PNG_WRITE_tIME_SUPPORTED -# ifndef PNG_tIME_SUPPORTED -# define PNG_tIME_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_tRNS -# define PNG_WRITE_tRNS_SUPPORTED -# ifndef PNG_tRNS_SUPPORTED -# define PNG_tRNS_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_zTXt -# define PNG_WRITE_zTXt_SUPPORTED -# ifndef PNG_zTXt_SUPPORTED -# define PNG_zTXt_SUPPORTED -# endif -#endif -#if defined(PNG_WRITE_iTXt_SUPPORTED) || defined(PNG_WRITE_tEXt_SUPPORTED) || \ - defined(PNG_WRITE_zTXt_SUPPORTED) -# define PNG_WRITE_TEXT_SUPPORTED -# ifndef PNG_TEXT_SUPPORTED -# define PNG_TEXT_SUPPORTED -# endif -#endif - -#ifdef PNG_WRITE_tIME_SUPPORTED -# ifndef PNG_NO_CONVERT_tIME -# ifndef _WIN32_WCE -/* The "tm" structure is not supported on WindowsCE */ -# ifndef PNG_CONVERT_tIME_SUPPORTED -# define PNG_CONVERT_tIME_SUPPORTED -# endif -# endif -# endif -#endif - -#endif /* PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED */ - -#if !defined(PNG_NO_WRITE_FILTER) && !defined(PNG_WRITE_FILTER_SUPPORTED) -# define PNG_WRITE_FILTER_SUPPORTED -#endif - -#ifndef PNG_NO_WRITE_UNKNOWN_CHUNKS -# define PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED -# ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED -# define PNG_UNKNOWN_CHUNKS_SUPPORTED -# endif -#endif - -#ifndef PNG_NO_HANDLE_AS_UNKNOWN -# ifndef PNG_HANDLE_AS_UNKNOWN_SUPPORTED -# define PNG_HANDLE_AS_UNKNOWN_SUPPORTED -# endif -#endif -#endif /* PNG_WRITE_SUPPORTED */ - -/* Turn this off to disable png_read_png() and - * png_write_png() and leave the row_pointers member - * out of the info structure. - */ -#ifndef PNG_NO_INFO_IMAGE -# define PNG_INFO_IMAGE_SUPPORTED -#endif - -/* Need the time information for converting tIME chunks */ -#ifdef PNG_CONVERT_tIME_SUPPORTED - /* "time.h" functions are not supported on WindowsCE */ -# include <time.h> -#endif - -/* Some typedefs to get us started. These should be safe on most of the - * common platforms. The typedefs should be at least as large as the - * numbers suggest (a png_uint_32 must be at least 32 bits long), but they - * don't have to be exactly that size. Some compilers dislike passing - * unsigned shorts as function parameters, so you may be better off using - * unsigned int for png_uint_16. Likewise, for 64-bit systems, you may - * want to have unsigned int for png_uint_32 instead of unsigned long. - */ - -typedef unsigned long png_uint_32; -typedef long png_int_32; -typedef unsigned short png_uint_16; -typedef short png_int_16; -typedef unsigned char png_byte; - -/* This is usually size_t. It is typedef'ed just in case you need it to - change (I'm not sure if you will or not, so I thought I'd be safe) */ -#ifdef PNG_SIZE_T - typedef PNG_SIZE_T png_size_t; -# define png_sizeof(x) png_convert_size(sizeof(x)) -#else - typedef size_t png_size_t; -# define png_sizeof(x) sizeof(x) -#endif - -/* The following is needed for medium model support. It cannot be in the - * PNG_INTERNAL section. Needs modification for other compilers besides - * MSC. Model independent support declares all arrays and pointers to be - * large using the far keyword. The zlib version used must also support - * model independent data. As of version zlib 1.0.4, the necessary changes - * have been made in zlib. The USE_FAR_KEYWORD define triggers other - * changes that are needed. (Tim Wegner) - */ - -/* Separate compiler dependencies (problem here is that zlib.h always - defines FAR. (SJT) */ -#ifdef __BORLANDC__ -# if defined(__LARGE__) || defined(__HUGE__) || defined(__COMPACT__) -# define LDATA 1 -# else -# define LDATA 0 -# endif - /* GRR: why is Cygwin in here? Cygwin is not Borland C... */ -# if !defined(__WIN32__) && !defined(__FLAT__) && !defined(__CYGWIN__) -# define PNG_MAX_MALLOC_64K -# if (LDATA != 1) -# ifndef FAR -# define FAR __far -# endif -# define USE_FAR_KEYWORD -# endif /* LDATA != 1 */ - /* Possibly useful for moving data out of default segment. - * Uncomment it if you want. Could also define FARDATA as - * const if your compiler supports it. (SJT) -# define FARDATA FAR - */ -# endif /* __WIN32__, __FLAT__, __CYGWIN__ */ -#endif /* __BORLANDC__ */ - - -/* Suggest testing for specific compiler first before testing for - * FAR. The Watcom compiler defines both __MEDIUM__ and M_I86MM, - * making reliance oncertain keywords suspect. (SJT) - */ - -/* MSC Medium model */ -#ifdef FAR -# ifdef M_I86MM -# define USE_FAR_KEYWORD -# define FARDATA FAR -# include <dos.h> -# endif -#endif - -/* SJT: default case */ -#ifndef FAR -# define FAR -#endif - -/* At this point FAR is always defined */ -#ifndef FARDATA -# define FARDATA -#endif - -/* Typedef for floating-point numbers that are converted - to fixed-point with a multiple of 100,000, e.g., int_gamma */ -typedef png_int_32 png_fixed_point; - -/* Add typedefs for pointers */ -typedef void FAR * png_voidp; -typedef png_byte FAR * png_bytep; -typedef png_uint_32 FAR * png_uint_32p; -typedef png_int_32 FAR * png_int_32p; -typedef png_uint_16 FAR * png_uint_16p; -typedef png_int_16 FAR * png_int_16p; -typedef PNG_CONST char FAR * png_const_charp; -typedef char FAR * png_charp; -typedef png_fixed_point FAR * png_fixed_point_p; - -#ifndef PNG_NO_STDIO -#ifdef _WIN32_WCE -typedef HANDLE png_FILE_p; -#else -typedef FILE * png_FILE_p; -#endif -#endif - -#ifdef PNG_FLOATING_POINT_SUPPORTED -typedef double FAR * png_doublep; -#endif - -/* Pointers to pointers; i.e. arrays */ -typedef png_byte FAR * FAR * png_bytepp; -typedef png_uint_32 FAR * FAR * png_uint_32pp; -typedef png_int_32 FAR * FAR * png_int_32pp; -typedef png_uint_16 FAR * FAR * png_uint_16pp; -typedef png_int_16 FAR * FAR * png_int_16pp; -typedef PNG_CONST char FAR * FAR * png_const_charpp; -typedef char FAR * FAR * png_charpp; -typedef png_fixed_point FAR * FAR * png_fixed_point_pp; -#ifdef PNG_FLOATING_POINT_SUPPORTED -typedef double FAR * FAR * png_doublepp; -#endif - -/* Pointers to pointers to pointers; i.e., pointer to array */ -typedef char FAR * FAR * FAR * png_charppp; - -#if defined(PNG_1_0_X) || defined(PNG_1_2_X) -/* SPC - Is this stuff deprecated? */ -/* It'll be removed as of libpng-1.4.0 - GR-P */ -/* libpng typedefs for types in zlib. If zlib changes - * or another compression library is used, then change these. - * Eliminates need to change all the source files. - */ -typedef charf * png_zcharp; -typedef charf * FAR * png_zcharpp; -typedef z_stream FAR * png_zstreamp; -#endif /* (PNG_1_0_X) || defined(PNG_1_2_X) */ - -/* - * Define PNG_BUILD_DLL if the module being built is a Windows - * LIBPNG DLL. - * - * Define PNG_USE_DLL if you want to *link* to the Windows LIBPNG DLL. - * It is equivalent to Microsoft predefined macro _DLL that is - * automatically defined when you compile using the share - * version of the CRT (C Run-Time library) - * - * The cygwin mods make this behavior a little different: - * Define PNG_BUILD_DLL if you are building a dll for use with cygwin - * Define PNG_STATIC if you are building a static library for use with cygwin, - * -or- if you are building an application that you want to link to the - * static library. - * PNG_USE_DLL is defined by default (no user action needed) unless one of - * the other flags is defined. - */ - -#if !defined(PNG_DLL) && (defined(PNG_BUILD_DLL) || defined(PNG_USE_DLL)) -# define PNG_DLL -#endif -/* If CYGWIN, then disallow GLOBAL ARRAYS unless building a static lib. - * When building a static lib, default to no GLOBAL ARRAYS, but allow - * command-line override - */ -#ifdef __CYGWIN__ -# ifndef PNG_STATIC -# ifdef PNG_USE_GLOBAL_ARRAYS -# undef PNG_USE_GLOBAL_ARRAYS -# endif -# ifndef PNG_USE_LOCAL_ARRAYS -# define PNG_USE_LOCAL_ARRAYS -# endif -# else -# if defined(PNG_USE_LOCAL_ARRAYS) || defined(PNG_NO_GLOBAL_ARRAYS) -# ifdef PNG_USE_GLOBAL_ARRAYS -# undef PNG_USE_GLOBAL_ARRAYS -# endif -# endif -# endif -# if !defined(PNG_USE_LOCAL_ARRAYS) && !defined(PNG_USE_GLOBAL_ARRAYS) -# define PNG_USE_LOCAL_ARRAYS -# endif -#endif - -/* Do not use global arrays (helps with building DLL's) - * They are no longer used in libpng itself, since version 1.0.5c, - * but might be required for some pre-1.0.5c applications. - */ -#if !defined(PNG_USE_LOCAL_ARRAYS) && !defined(PNG_USE_GLOBAL_ARRAYS) -# if defined(PNG_NO_GLOBAL_ARRAYS) || \ - (defined(__GNUC__) && defined(PNG_DLL)) || defined(_MSC_VER) -# define PNG_USE_LOCAL_ARRAYS -# else -# define PNG_USE_GLOBAL_ARRAYS -# endif -#endif - -#ifdef __CYGWIN__ -# undef PNGAPI -# define PNGAPI __cdecl -# undef PNG_IMPEXP -# define PNG_IMPEXP -#endif - -/* If you define PNGAPI, e.g., with compiler option "-DPNGAPI=__stdcall", - * you may get warnings regarding the linkage of png_zalloc and png_zfree. - * Don't ignore those warnings; you must also reset the default calling - * convention in your compiler to match your PNGAPI, and you must build - * zlib and your applications the same way you build libpng. - */ - -#if defined(__MINGW32__) && !defined(PNG_MODULEDEF) -# ifndef PNG_NO_MODULEDEF -# define PNG_NO_MODULEDEF -# endif -#endif - -#if !defined(PNG_IMPEXP) && defined(PNG_BUILD_DLL) && !defined(PNG_NO_MODULEDEF) -# define PNG_IMPEXP -#endif - -#if defined(PNG_DLL) || defined(_DLL) || defined(__DLL__ ) || \ - (( defined(_Windows) || defined(_WINDOWS) || \ - defined(WIN32) || defined(_WIN32) || defined(__WIN32__) )) - -# ifndef PNGAPI -# if defined(__GNUC__) || (defined (_MSC_VER) && (_MSC_VER >= 800)) -# define PNGAPI __cdecl -# else -# define PNGAPI _cdecl -# endif -# endif - -# if !defined(PNG_IMPEXP) && (!defined(PNG_DLL) || \ - 0 /* WINCOMPILER_WITH_NO_SUPPORT_FOR_DECLIMPEXP */) -# define PNG_IMPEXP -# endif - -# ifndef PNG_IMPEXP - -# define PNG_EXPORT_TYPE1(type,symbol) PNG_IMPEXP type PNGAPI symbol -# define PNG_EXPORT_TYPE2(type,symbol) type PNG_IMPEXP PNGAPI symbol - - /* Borland/Microsoft */ -# if defined(_MSC_VER) || defined(__BORLANDC__) -# if (_MSC_VER >= 800) || (__BORLANDC__ >= 0x500) -# define PNG_EXPORT PNG_EXPORT_TYPE1 -# else -# define PNG_EXPORT PNG_EXPORT_TYPE2 -# ifdef PNG_BUILD_DLL -# define PNG_IMPEXP __export -# else -# define PNG_IMPEXP /*__import */ /* doesn't exist AFAIK in - VC++ */ -# endif /* Exists in Borland C++ for - C++ classes (== huge) */ -# endif -# endif - -# ifndef PNG_IMPEXP -# ifdef PNG_BUILD_DLL -# define PNG_IMPEXP __declspec(dllexport) -# else -# define PNG_IMPEXP __declspec(dllimport) -# endif -# endif -# endif /* PNG_IMPEXP */ -#else /* !(DLL || non-cygwin WINDOWS) */ -# if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__) -# ifndef PNGAPI -# define PNGAPI _System -# endif -# else -# if 0 /* ... other platforms, with other meanings */ -# endif -# endif -#endif - -#ifndef PNGAPI -# define PNGAPI -#endif -#ifndef PNG_IMPEXP -# define PNG_IMPEXP -#endif - -#ifdef PNG_BUILDSYMS -# ifndef PNG_EXPORT -# define PNG_EXPORT(type,symbol) PNG_FUNCTION_EXPORT symbol END -# endif -# ifdef PNG_USE_GLOBAL_ARRAYS -# ifndef PNG_EXPORT_VAR -# define PNG_EXPORT_VAR(type) PNG_DATA_EXPORT -# endif -# endif -#endif - -#ifndef PNG_EXPORT -# define PNG_EXPORT(type,symbol) PNG_IMPEXP type PNGAPI symbol -#endif - -#ifdef PNG_USE_GLOBAL_ARRAYS -# ifndef PNG_EXPORT_VAR -# define PNG_EXPORT_VAR(type) extern PNG_IMPEXP type -# endif -#endif - -#ifdef PNG_PEDANTIC_WARNINGS -# ifndef PNG_PEDANTIC_WARNINGS_SUPPORTED -# define PNG_PEDANTIC_WARNINGS_SUPPORTED -# endif -#endif - -#ifdef PNG_PEDANTIC_WARNINGS_SUPPORTED -/* Support for compiler specific function attributes. These are used - * so that where compiler support is available incorrect use of API - * functions in png.h will generate compiler warnings. Added at libpng - * version 1.2.41. - */ -# ifdef __GNUC__ -# ifndef PNG_USE_RESULT -# define PNG_USE_RESULT __attribute__((__warn_unused_result__)) -# endif -# ifndef PNG_NORETURN -# define PNG_NORETURN __attribute__((__noreturn__)) -# endif -# ifndef PNG_ALLOCATED -# define PNG_ALLOCATED __attribute__((__malloc__)) -# endif - - /* This specifically protects structure members that should only be - * accessed from within the library, therefore should be empty during - * a library build. - */ -# ifndef PNG_DEPRECATED -# define PNG_DEPRECATED __attribute__((__deprecated__)) -# endif -# ifndef PNG_DEPSTRUCT -# define PNG_DEPSTRUCT __attribute__((__deprecated__)) -# endif -# ifndef PNG_PRIVATE -# if 0 /* Doesn't work so we use deprecated instead*/ -# define PNG_PRIVATE \ - __attribute__((warning("This function is not exported by libpng."))) -# else -# define PNG_PRIVATE \ - __attribute__((__deprecated__)) -# endif -# endif /* PNG_PRIVATE */ -# endif /* __GNUC__ */ -#endif /* PNG_PEDANTIC_WARNINGS */ - -#ifndef PNG_DEPRECATED -# define PNG_DEPRECATED /* Use of this function is deprecated */ -#endif -#ifndef PNG_USE_RESULT -# define PNG_USE_RESULT /* The result of this function must be checked */ -#endif -#ifndef PNG_NORETURN -# define PNG_NORETURN /* This function does not return */ -#endif -#ifndef PNG_ALLOCATED -# define PNG_ALLOCATED /* The result of the function is new memory */ -#endif -#ifndef PNG_DEPSTRUCT -# define PNG_DEPSTRUCT /* Access to this struct member is deprecated */ -#endif -#ifndef PNG_PRIVATE -# define PNG_PRIVATE /* This is a private libpng function */ -#endif - -/* User may want to use these so they are not in PNG_INTERNAL. Any library - * functions that are passed far data must be model independent. - */ - -#ifndef PNG_ABORT -# define PNG_ABORT() abort() -#endif - -#ifdef PNG_SETJMP_SUPPORTED -# define png_jmpbuf(png_ptr) ((png_ptr)->jmpbuf) -#else -# define png_jmpbuf(png_ptr) \ - (LIBPNG_WAS_COMPILED_WITH__PNG_SETJMP_NOT_SUPPORTED) -#endif - -#ifdef USE_FAR_KEYWORD /* memory model independent fns */ -/* Use this to make far-to-near assignments */ -# define CHECK 1 -# define NOCHECK 0 -# define CVT_PTR(ptr) (png_far_to_near(png_ptr,ptr,CHECK)) -# define CVT_PTR_NOCHECK(ptr) (png_far_to_near(png_ptr,ptr,NOCHECK)) -# define png_snprintf _fsnprintf /* Added to v 1.2.19 */ -# define png_strlen _fstrlen -# define png_memcmp _fmemcmp /* SJT: added */ -# define png_memcpy _fmemcpy -# define png_memset _fmemset -#else /* Use the usual functions */ -# define CVT_PTR(ptr) (ptr) -# define CVT_PTR_NOCHECK(ptr) (ptr) -# ifndef PNG_NO_SNPRINTF -# ifdef _MSC_VER -# define png_snprintf _snprintf /* Added to v 1.2.19 */ -# define png_snprintf2 _snprintf -# define png_snprintf6 _snprintf -# else -# define png_snprintf snprintf /* Added to v 1.2.19 */ -# define png_snprintf2 snprintf -# define png_snprintf6 snprintf -# endif -# else - /* You don't have or don't want to use snprintf(). Caution: Using - * sprintf instead of snprintf exposes your application to accidental - * or malevolent buffer overflows. If you don't have snprintf() - * as a general rule you should provide one (you can get one from - * Portable OpenSSH). - */ -# define png_snprintf(s1,n,fmt,x1) sprintf(s1,fmt,x1) -# define png_snprintf2(s1,n,fmt,x1,x2) sprintf(s1,fmt,x1,x2) -# define png_snprintf6(s1,n,fmt,x1,x2,x3,x4,x5,x6) \ - sprintf(s1,fmt,x1,x2,x3,x4,x5,x6) -# endif -# define png_strlen strlen -# define png_memcmp memcmp /* SJT: added */ -# define png_memcpy memcpy -# define png_memset memset -#endif -/* End of memory model independent support */ - -/* Just a little check that someone hasn't tried to define something - * contradictory. - */ -#if (PNG_ZBUF_SIZE > 65536L) && defined(PNG_MAX_MALLOC_64K) -# undef PNG_ZBUF_SIZE -# define PNG_ZBUF_SIZE 65536L -#endif - -/* Added at libpng-1.2.8 */ -#endif /* PNG_VERSION_INFO_ONLY */ - -#endif /* PNGCONF_H */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/sqlite3.h.REMOVED.git-id b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/sqlite3.h.REMOVED.git-id deleted file mode 100644 index dea61d08a1..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/sqlite3.h.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -efaf3c8988ab69ebac22bd6699c6311ac7747c5a \ No newline at end of file diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/sqlite3ext.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/sqlite3ext.h deleted file mode 100644 index 5abcde2c8f..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/sqlite3ext.h +++ /dev/null @@ -1,447 +0,0 @@ -/* -** 2006 June 7 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This header file defines the SQLite interface for use by -** shared libraries that want to be imported as extensions into -** an SQLite instance. Shared libraries that intend to be loaded -** as extensions by SQLite should #include this file instead of -** sqlite3.h. -*/ -#ifndef _SQLITE3EXT_H_ -#define _SQLITE3EXT_H_ -#include "sqlite3.h" - -typedef struct sqlite3_api_routines sqlite3_api_routines; - -/* -** The following structure holds pointers to all of the SQLite API -** routines. -** -** WARNING: In order to maintain backwards compatibility, add new -** interfaces to the end of this structure only. If you insert new -** interfaces in the middle of this structure, then older different -** versions of SQLite will not be able to load each others' shared -** libraries! -*/ -struct sqlite3_api_routines { - void * (*aggregate_context)(sqlite3_context*,int nBytes); - int (*aggregate_count)(sqlite3_context*); - int (*bind_blob)(sqlite3_stmt*,int,const void*,int n,void(*)(void*)); - int (*bind_double)(sqlite3_stmt*,int,double); - int (*bind_int)(sqlite3_stmt*,int,int); - int (*bind_int64)(sqlite3_stmt*,int,sqlite_int64); - int (*bind_null)(sqlite3_stmt*,int); - int (*bind_parameter_count)(sqlite3_stmt*); - int (*bind_parameter_index)(sqlite3_stmt*,const char*zName); - const char * (*bind_parameter_name)(sqlite3_stmt*,int); - int (*bind_text)(sqlite3_stmt*,int,const char*,int n,void(*)(void*)); - int (*bind_text16)(sqlite3_stmt*,int,const void*,int,void(*)(void*)); - int (*bind_value)(sqlite3_stmt*,int,const sqlite3_value*); - int (*busy_handler)(sqlite3*,int(*)(void*,int),void*); - int (*busy_timeout)(sqlite3*,int ms); - int (*changes)(sqlite3*); - int (*close)(sqlite3*); - int (*collation_needed)(sqlite3*,void*,void(*)(void*,sqlite3*, - int eTextRep,const char*)); - int (*collation_needed16)(sqlite3*,void*,void(*)(void*,sqlite3*, - int eTextRep,const void*)); - const void * (*column_blob)(sqlite3_stmt*,int iCol); - int (*column_bytes)(sqlite3_stmt*,int iCol); - int (*column_bytes16)(sqlite3_stmt*,int iCol); - int (*column_count)(sqlite3_stmt*pStmt); - const char * (*column_database_name)(sqlite3_stmt*,int); - const void * (*column_database_name16)(sqlite3_stmt*,int); - const char * (*column_decltype)(sqlite3_stmt*,int i); - const void * (*column_decltype16)(sqlite3_stmt*,int); - double (*column_double)(sqlite3_stmt*,int iCol); - int (*column_int)(sqlite3_stmt*,int iCol); - sqlite_int64 (*column_int64)(sqlite3_stmt*,int iCol); - const char * (*column_name)(sqlite3_stmt*,int); - const void * (*column_name16)(sqlite3_stmt*,int); - const char * (*column_origin_name)(sqlite3_stmt*,int); - const void * (*column_origin_name16)(sqlite3_stmt*,int); - const char * (*column_table_name)(sqlite3_stmt*,int); - const void * (*column_table_name16)(sqlite3_stmt*,int); - const unsigned char * (*column_text)(sqlite3_stmt*,int iCol); - const void * (*column_text16)(sqlite3_stmt*,int iCol); - int (*column_type)(sqlite3_stmt*,int iCol); - sqlite3_value* (*column_value)(sqlite3_stmt*,int iCol); - void * (*commit_hook)(sqlite3*,int(*)(void*),void*); - int (*complete)(const char*sql); - int (*complete16)(const void*sql); - int (*create_collation)(sqlite3*,const char*,int,void*, - int(*)(void*,int,const void*,int,const void*)); - int (*create_collation16)(sqlite3*,const void*,int,void*, - int(*)(void*,int,const void*,int,const void*)); - int (*create_function)(sqlite3*,const char*,int,int,void*, - void (*xFunc)(sqlite3_context*,int,sqlite3_value**), - void (*xStep)(sqlite3_context*,int,sqlite3_value**), - void (*xFinal)(sqlite3_context*)); - int (*create_function16)(sqlite3*,const void*,int,int,void*, - void (*xFunc)(sqlite3_context*,int,sqlite3_value**), - void (*xStep)(sqlite3_context*,int,sqlite3_value**), - void (*xFinal)(sqlite3_context*)); - int (*create_module)(sqlite3*,const char*,const sqlite3_module*,void*); - int (*data_count)(sqlite3_stmt*pStmt); - sqlite3 * (*db_handle)(sqlite3_stmt*); - int (*declare_vtab)(sqlite3*,const char*); - int (*enable_shared_cache)(int); - int (*errcode)(sqlite3*db); - const char * (*errmsg)(sqlite3*); - const void * (*errmsg16)(sqlite3*); - int (*exec)(sqlite3*,const char*,sqlite3_callback,void*,char**); - int (*expired)(sqlite3_stmt*); - int (*finalize)(sqlite3_stmt*pStmt); - void (*free)(void*); - void (*free_table)(char**result); - int (*get_autocommit)(sqlite3*); - void * (*get_auxdata)(sqlite3_context*,int); - int (*get_table)(sqlite3*,const char*,char***,int*,int*,char**); - int (*global_recover)(void); - void (*interruptx)(sqlite3*); - sqlite_int64 (*last_insert_rowid)(sqlite3*); - const char * (*libversion)(void); - int (*libversion_number)(void); - void *(*malloc)(int); - char * (*mprintf)(const char*,...); - int (*open)(const char*,sqlite3**); - int (*open16)(const void*,sqlite3**); - int (*prepare)(sqlite3*,const char*,int,sqlite3_stmt**,const char**); - int (*prepare16)(sqlite3*,const void*,int,sqlite3_stmt**,const void**); - void * (*profile)(sqlite3*,void(*)(void*,const char*,sqlite_uint64),void*); - void (*progress_handler)(sqlite3*,int,int(*)(void*),void*); - void *(*realloc)(void*,int); - int (*reset)(sqlite3_stmt*pStmt); - void (*result_blob)(sqlite3_context*,const void*,int,void(*)(void*)); - void (*result_double)(sqlite3_context*,double); - void (*result_error)(sqlite3_context*,const char*,int); - void (*result_error16)(sqlite3_context*,const void*,int); - void (*result_int)(sqlite3_context*,int); - void (*result_int64)(sqlite3_context*,sqlite_int64); - void (*result_null)(sqlite3_context*); - void (*result_text)(sqlite3_context*,const char*,int,void(*)(void*)); - void (*result_text16)(sqlite3_context*,const void*,int,void(*)(void*)); - void (*result_text16be)(sqlite3_context*,const void*,int,void(*)(void*)); - void (*result_text16le)(sqlite3_context*,const void*,int,void(*)(void*)); - void (*result_value)(sqlite3_context*,sqlite3_value*); - void * (*rollback_hook)(sqlite3*,void(*)(void*),void*); - int (*set_authorizer)(sqlite3*,int(*)(void*,int,const char*,const char*, - const char*,const char*),void*); - void (*set_auxdata)(sqlite3_context*,int,void*,void (*)(void*)); - char * (*snprintf)(int,char*,const char*,...); - int (*step)(sqlite3_stmt*); - int (*table_column_metadata)(sqlite3*,const char*,const char*,const char*, - char const**,char const**,int*,int*,int*); - void (*thread_cleanup)(void); - int (*total_changes)(sqlite3*); - void * (*trace)(sqlite3*,void(*xTrace)(void*,const char*),void*); - int (*transfer_bindings)(sqlite3_stmt*,sqlite3_stmt*); - void * (*update_hook)(sqlite3*,void(*)(void*,int ,char const*,char const*, - sqlite_int64),void*); - void * (*user_data)(sqlite3_context*); - const void * (*value_blob)(sqlite3_value*); - int (*value_bytes)(sqlite3_value*); - int (*value_bytes16)(sqlite3_value*); - double (*value_double)(sqlite3_value*); - int (*value_int)(sqlite3_value*); - sqlite_int64 (*value_int64)(sqlite3_value*); - int (*value_numeric_type)(sqlite3_value*); - const unsigned char * (*value_text)(sqlite3_value*); - const void * (*value_text16)(sqlite3_value*); - const void * (*value_text16be)(sqlite3_value*); - const void * (*value_text16le)(sqlite3_value*); - int (*value_type)(sqlite3_value*); - char *(*vmprintf)(const char*,va_list); - /* Added ??? */ - int (*overload_function)(sqlite3*, const char *zFuncName, int nArg); - /* Added by 3.3.13 */ - int (*prepare_v2)(sqlite3*,const char*,int,sqlite3_stmt**,const char**); - int (*prepare16_v2)(sqlite3*,const void*,int,sqlite3_stmt**,const void**); - int (*clear_bindings)(sqlite3_stmt*); - /* Added by 3.4.1 */ - int (*create_module_v2)(sqlite3*,const char*,const sqlite3_module*,void*, - void (*xDestroy)(void *)); - /* Added by 3.5.0 */ - int (*bind_zeroblob)(sqlite3_stmt*,int,int); - int (*blob_bytes)(sqlite3_blob*); - int (*blob_close)(sqlite3_blob*); - int (*blob_open)(sqlite3*,const char*,const char*,const char*,sqlite3_int64, - int,sqlite3_blob**); - int (*blob_read)(sqlite3_blob*,void*,int,int); - int (*blob_write)(sqlite3_blob*,const void*,int,int); - int (*create_collation_v2)(sqlite3*,const char*,int,void*, - int(*)(void*,int,const void*,int,const void*), - void(*)(void*)); - int (*file_control)(sqlite3*,const char*,int,void*); - sqlite3_int64 (*memory_highwater)(int); - sqlite3_int64 (*memory_used)(void); - sqlite3_mutex *(*mutex_alloc)(int); - void (*mutex_enter)(sqlite3_mutex*); - void (*mutex_free)(sqlite3_mutex*); - void (*mutex_leave)(sqlite3_mutex*); - int (*mutex_try)(sqlite3_mutex*); - int (*open_v2)(const char*,sqlite3**,int,const char*); - int (*release_memory)(int); - void (*result_error_nomem)(sqlite3_context*); - void (*result_error_toobig)(sqlite3_context*); - int (*sleep)(int); - void (*soft_heap_limit)(int); - sqlite3_vfs *(*vfs_find)(const char*); - int (*vfs_register)(sqlite3_vfs*,int); - int (*vfs_unregister)(sqlite3_vfs*); - int (*xthreadsafe)(void); - void (*result_zeroblob)(sqlite3_context*,int); - void (*result_error_code)(sqlite3_context*,int); - int (*test_control)(int, ...); - void (*randomness)(int,void*); - sqlite3 *(*context_db_handle)(sqlite3_context*); - int (*extended_result_codes)(sqlite3*,int); - int (*limit)(sqlite3*,int,int); - sqlite3_stmt *(*next_stmt)(sqlite3*,sqlite3_stmt*); - const char *(*sql)(sqlite3_stmt*); - int (*status)(int,int*,int*,int); - int (*backup_finish)(sqlite3_backup*); - sqlite3_backup *(*backup_init)(sqlite3*,const char*,sqlite3*,const char*); - int (*backup_pagecount)(sqlite3_backup*); - int (*backup_remaining)(sqlite3_backup*); - int (*backup_step)(sqlite3_backup*,int); - const char *(*compileoption_get)(int); - int (*compileoption_used)(const char*); - int (*create_function_v2)(sqlite3*,const char*,int,int,void*, - void (*xFunc)(sqlite3_context*,int,sqlite3_value**), - void (*xStep)(sqlite3_context*,int,sqlite3_value**), - void (*xFinal)(sqlite3_context*), - void(*xDestroy)(void*)); - int (*db_config)(sqlite3*,int,...); - sqlite3_mutex *(*db_mutex)(sqlite3*); - int (*db_status)(sqlite3*,int,int*,int*,int); - int (*extended_errcode)(sqlite3*); - void (*log)(int,const char*,...); - sqlite3_int64 (*soft_heap_limit64)(sqlite3_int64); - const char *(*sourceid)(void); - int (*stmt_status)(sqlite3_stmt*,int,int); - int (*strnicmp)(const char*,const char*,int); - int (*unlock_notify)(sqlite3*,void(*)(void**,int),void*); - int (*wal_autocheckpoint)(sqlite3*,int); - int (*wal_checkpoint)(sqlite3*,const char*); - void *(*wal_hook)(sqlite3*,int(*)(void*,sqlite3*,const char*,int),void*); - int (*blob_reopen)(sqlite3_blob*,sqlite3_int64); - int (*vtab_config)(sqlite3*,int op,...); - int (*vtab_on_conflict)(sqlite3*); -}; - -/* -** The following macros redefine the API routines so that they are -** redirected throught the global sqlite3_api structure. -** -** This header file is also used by the loadext.c source file -** (part of the main SQLite library - not an extension) so that -** it can get access to the sqlite3_api_routines structure -** definition. But the main library does not want to redefine -** the API. So the redefinition macros are only valid if the -** SQLITE_CORE macros is undefined. -*/ -#ifndef SQLITE_CORE -#define sqlite3_aggregate_context sqlite3_api->aggregate_context -#ifndef SQLITE_OMIT_DEPRECATED -#define sqlite3_aggregate_count sqlite3_api->aggregate_count -#endif -#define sqlite3_bind_blob sqlite3_api->bind_blob -#define sqlite3_bind_double sqlite3_api->bind_double -#define sqlite3_bind_int sqlite3_api->bind_int -#define sqlite3_bind_int64 sqlite3_api->bind_int64 -#define sqlite3_bind_null sqlite3_api->bind_null -#define sqlite3_bind_parameter_count sqlite3_api->bind_parameter_count -#define sqlite3_bind_parameter_index sqlite3_api->bind_parameter_index -#define sqlite3_bind_parameter_name sqlite3_api->bind_parameter_name -#define sqlite3_bind_text sqlite3_api->bind_text -#define sqlite3_bind_text16 sqlite3_api->bind_text16 -#define sqlite3_bind_value sqlite3_api->bind_value -#define sqlite3_busy_handler sqlite3_api->busy_handler -#define sqlite3_busy_timeout sqlite3_api->busy_timeout -#define sqlite3_changes sqlite3_api->changes -#define sqlite3_close sqlite3_api->close -#define sqlite3_collation_needed sqlite3_api->collation_needed -#define sqlite3_collation_needed16 sqlite3_api->collation_needed16 -#define sqlite3_column_blob sqlite3_api->column_blob -#define sqlite3_column_bytes sqlite3_api->column_bytes -#define sqlite3_column_bytes16 sqlite3_api->column_bytes16 -#define sqlite3_column_count sqlite3_api->column_count -#define sqlite3_column_database_name sqlite3_api->column_database_name -#define sqlite3_column_database_name16 sqlite3_api->column_database_name16 -#define sqlite3_column_decltype sqlite3_api->column_decltype -#define sqlite3_column_decltype16 sqlite3_api->column_decltype16 -#define sqlite3_column_double sqlite3_api->column_double -#define sqlite3_column_int sqlite3_api->column_int -#define sqlite3_column_int64 sqlite3_api->column_int64 -#define sqlite3_column_name sqlite3_api->column_name -#define sqlite3_column_name16 sqlite3_api->column_name16 -#define sqlite3_column_origin_name sqlite3_api->column_origin_name -#define sqlite3_column_origin_name16 sqlite3_api->column_origin_name16 -#define sqlite3_column_table_name sqlite3_api->column_table_name -#define sqlite3_column_table_name16 sqlite3_api->column_table_name16 -#define sqlite3_column_text sqlite3_api->column_text -#define sqlite3_column_text16 sqlite3_api->column_text16 -#define sqlite3_column_type sqlite3_api->column_type -#define sqlite3_column_value sqlite3_api->column_value -#define sqlite3_commit_hook sqlite3_api->commit_hook -#define sqlite3_complete sqlite3_api->complete -#define sqlite3_complete16 sqlite3_api->complete16 -#define sqlite3_create_collation sqlite3_api->create_collation -#define sqlite3_create_collation16 sqlite3_api->create_collation16 -#define sqlite3_create_function sqlite3_api->create_function -#define sqlite3_create_function16 sqlite3_api->create_function16 -#define sqlite3_create_module sqlite3_api->create_module -#define sqlite3_create_module_v2 sqlite3_api->create_module_v2 -#define sqlite3_data_count sqlite3_api->data_count -#define sqlite3_db_handle sqlite3_api->db_handle -#define sqlite3_declare_vtab sqlite3_api->declare_vtab -#define sqlite3_enable_shared_cache sqlite3_api->enable_shared_cache -#define sqlite3_errcode sqlite3_api->errcode -#define sqlite3_errmsg sqlite3_api->errmsg -#define sqlite3_errmsg16 sqlite3_api->errmsg16 -#define sqlite3_exec sqlite3_api->exec -#ifndef SQLITE_OMIT_DEPRECATED -#define sqlite3_expired sqlite3_api->expired -#endif -#define sqlite3_finalize sqlite3_api->finalize -#define sqlite3_free sqlite3_api->free -#define sqlite3_free_table sqlite3_api->free_table -#define sqlite3_get_autocommit sqlite3_api->get_autocommit -#define sqlite3_get_auxdata sqlite3_api->get_auxdata -#define sqlite3_get_table sqlite3_api->get_table -#ifndef SQLITE_OMIT_DEPRECATED -#define sqlite3_global_recover sqlite3_api->global_recover -#endif -#define sqlite3_interrupt sqlite3_api->interruptx -#define sqlite3_last_insert_rowid sqlite3_api->last_insert_rowid -#define sqlite3_libversion sqlite3_api->libversion -#define sqlite3_libversion_number sqlite3_api->libversion_number -#define sqlite3_malloc sqlite3_api->malloc -#define sqlite3_mprintf sqlite3_api->mprintf -#define sqlite3_open sqlite3_api->open -#define sqlite3_open16 sqlite3_api->open16 -#define sqlite3_prepare sqlite3_api->prepare -#define sqlite3_prepare16 sqlite3_api->prepare16 -#define sqlite3_prepare_v2 sqlite3_api->prepare_v2 -#define sqlite3_prepare16_v2 sqlite3_api->prepare16_v2 -#define sqlite3_profile sqlite3_api->profile -#define sqlite3_progress_handler sqlite3_api->progress_handler -#define sqlite3_realloc sqlite3_api->realloc -#define sqlite3_reset sqlite3_api->reset -#define sqlite3_result_blob sqlite3_api->result_blob -#define sqlite3_result_double sqlite3_api->result_double -#define sqlite3_result_error sqlite3_api->result_error -#define sqlite3_result_error16 sqlite3_api->result_error16 -#define sqlite3_result_int sqlite3_api->result_int -#define sqlite3_result_int64 sqlite3_api->result_int64 -#define sqlite3_result_null sqlite3_api->result_null -#define sqlite3_result_text sqlite3_api->result_text -#define sqlite3_result_text16 sqlite3_api->result_text16 -#define sqlite3_result_text16be sqlite3_api->result_text16be -#define sqlite3_result_text16le sqlite3_api->result_text16le -#define sqlite3_result_value sqlite3_api->result_value -#define sqlite3_rollback_hook sqlite3_api->rollback_hook -#define sqlite3_set_authorizer sqlite3_api->set_authorizer -#define sqlite3_set_auxdata sqlite3_api->set_auxdata -#define sqlite3_snprintf sqlite3_api->snprintf -#define sqlite3_step sqlite3_api->step -#define sqlite3_table_column_metadata sqlite3_api->table_column_metadata -#define sqlite3_thread_cleanup sqlite3_api->thread_cleanup -#define sqlite3_total_changes sqlite3_api->total_changes -#define sqlite3_trace sqlite3_api->trace -#ifndef SQLITE_OMIT_DEPRECATED -#define sqlite3_transfer_bindings sqlite3_api->transfer_bindings -#endif -#define sqlite3_update_hook sqlite3_api->update_hook -#define sqlite3_user_data sqlite3_api->user_data -#define sqlite3_value_blob sqlite3_api->value_blob -#define sqlite3_value_bytes sqlite3_api->value_bytes -#define sqlite3_value_bytes16 sqlite3_api->value_bytes16 -#define sqlite3_value_double sqlite3_api->value_double -#define sqlite3_value_int sqlite3_api->value_int -#define sqlite3_value_int64 sqlite3_api->value_int64 -#define sqlite3_value_numeric_type sqlite3_api->value_numeric_type -#define sqlite3_value_text sqlite3_api->value_text -#define sqlite3_value_text16 sqlite3_api->value_text16 -#define sqlite3_value_text16be sqlite3_api->value_text16be -#define sqlite3_value_text16le sqlite3_api->value_text16le -#define sqlite3_value_type sqlite3_api->value_type -#define sqlite3_vmprintf sqlite3_api->vmprintf -#define sqlite3_overload_function sqlite3_api->overload_function -#define sqlite3_prepare_v2 sqlite3_api->prepare_v2 -#define sqlite3_prepare16_v2 sqlite3_api->prepare16_v2 -#define sqlite3_clear_bindings sqlite3_api->clear_bindings -#define sqlite3_bind_zeroblob sqlite3_api->bind_zeroblob -#define sqlite3_blob_bytes sqlite3_api->blob_bytes -#define sqlite3_blob_close sqlite3_api->blob_close -#define sqlite3_blob_open sqlite3_api->blob_open -#define sqlite3_blob_read sqlite3_api->blob_read -#define sqlite3_blob_write sqlite3_api->blob_write -#define sqlite3_create_collation_v2 sqlite3_api->create_collation_v2 -#define sqlite3_file_control sqlite3_api->file_control -#define sqlite3_memory_highwater sqlite3_api->memory_highwater -#define sqlite3_memory_used sqlite3_api->memory_used -#define sqlite3_mutex_alloc sqlite3_api->mutex_alloc -#define sqlite3_mutex_enter sqlite3_api->mutex_enter -#define sqlite3_mutex_free sqlite3_api->mutex_free -#define sqlite3_mutex_leave sqlite3_api->mutex_leave -#define sqlite3_mutex_try sqlite3_api->mutex_try -#define sqlite3_open_v2 sqlite3_api->open_v2 -#define sqlite3_release_memory sqlite3_api->release_memory -#define sqlite3_result_error_nomem sqlite3_api->result_error_nomem -#define sqlite3_result_error_toobig sqlite3_api->result_error_toobig -#define sqlite3_sleep sqlite3_api->sleep -#define sqlite3_soft_heap_limit sqlite3_api->soft_heap_limit -#define sqlite3_vfs_find sqlite3_api->vfs_find -#define sqlite3_vfs_register sqlite3_api->vfs_register -#define sqlite3_vfs_unregister sqlite3_api->vfs_unregister -#define sqlite3_threadsafe sqlite3_api->xthreadsafe -#define sqlite3_result_zeroblob sqlite3_api->result_zeroblob -#define sqlite3_result_error_code sqlite3_api->result_error_code -#define sqlite3_test_control sqlite3_api->test_control -#define sqlite3_randomness sqlite3_api->randomness -#define sqlite3_context_db_handle sqlite3_api->context_db_handle -#define sqlite3_extended_result_codes sqlite3_api->extended_result_codes -#define sqlite3_limit sqlite3_api->limit -#define sqlite3_next_stmt sqlite3_api->next_stmt -#define sqlite3_sql sqlite3_api->sql -#define sqlite3_status sqlite3_api->status -#define sqlite3_backup_finish sqlite3_api->backup_finish -#define sqlite3_backup_init sqlite3_api->backup_init -#define sqlite3_backup_pagecount sqlite3_api->backup_pagecount -#define sqlite3_backup_remaining sqlite3_api->backup_remaining -#define sqlite3_backup_step sqlite3_api->backup_step -#define sqlite3_compileoption_get sqlite3_api->compileoption_get -#define sqlite3_compileoption_used sqlite3_api->compileoption_used -#define sqlite3_create_function_v2 sqlite3_api->create_function_v2 -#define sqlite3_db_config sqlite3_api->db_config -#define sqlite3_db_mutex sqlite3_api->db_mutex -#define sqlite3_db_status sqlite3_api->db_status -#define sqlite3_extended_errcode sqlite3_api->extended_errcode -#define sqlite3_log sqlite3_api->log -#define sqlite3_soft_heap_limit64 sqlite3_api->soft_heap_limit64 -#define sqlite3_sourceid sqlite3_api->sourceid -#define sqlite3_stmt_status sqlite3_api->stmt_status -#define sqlite3_strnicmp sqlite3_api->strnicmp -#define sqlite3_unlock_notify sqlite3_api->unlock_notify -#define sqlite3_wal_autocheckpoint sqlite3_api->wal_autocheckpoint -#define sqlite3_wal_checkpoint sqlite3_api->wal_checkpoint -#define sqlite3_wal_hook sqlite3_api->wal_hook -#define sqlite3_blob_reopen sqlite3_api->blob_reopen -#define sqlite3_vtab_config sqlite3_api->vtab_config -#define sqlite3_vtab_on_conflict sqlite3_api->vtab_on_conflict -#endif /* SQLITE_CORE */ - -#define SQLITE_EXTENSION_INIT1 const sqlite3_api_routines *sqlite3_api = 0; -#define SQLITE_EXTENSION_INIT2(v) sqlite3_api = v; - -#endif /* _SQLITE3EXT_H_ */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/tiff.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/tiff.h deleted file mode 100644 index 19b4e7976d..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/tiff.h +++ /dev/null @@ -1,678 +0,0 @@ -/* $Id: tiff.h,v 1.68 2012-08-19 16:56:35 bfriesen Exp $ */ - -/* - * Copyright (c) 1988-1997 Sam Leffler - * Copyright (c) 1991-1997 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Sam Leffler and Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#ifndef _TIFF_ -#define _TIFF_ - -#include "tiffconf.h" - -/* - * Tag Image File Format (TIFF) - * - * Based on Rev 6.0 from: - * Developer's Desk - * Aldus Corporation - * 411 First Ave. South - * Suite 200 - * Seattle, WA 98104 - * 206-622-5500 - * - * (http://partners.adobe.com/asn/developer/PDFS/TN/TIFF6.pdf) - * - * For BigTIFF design notes see the following links - * http://www.remotesensing.org/libtiff/bigtiffdesign.html - * http://www.awaresystems.be/imaging/tiff/bigtiff.html - */ - -#define TIFF_VERSION_CLASSIC 42 -#define TIFF_VERSION_BIG 43 - -#define TIFF_BIGENDIAN 0x4d4d -#define TIFF_LITTLEENDIAN 0x4949 -#define MDI_LITTLEENDIAN 0x5045 -#define MDI_BIGENDIAN 0x4550 - -/* - * Intrinsic data types required by the file format: - * - * 8-bit quantities int8/uint8 - * 16-bit quantities int16/uint16 - * 32-bit quantities int32/uint32 - * 64-bit quantities int64/uint64 - * strings unsigned char* - */ - -typedef TIFF_INT8_T int8; -typedef TIFF_UINT8_T uint8; - -typedef TIFF_INT16_T int16; -typedef TIFF_UINT16_T uint16; - -typedef TIFF_INT32_T int32; -typedef TIFF_UINT32_T uint32; - -typedef TIFF_INT64_T int64; -typedef TIFF_UINT64_T uint64; - -/* - * Some types as promoted in a variable argument list - * We use uint16_vap rather then directly using int, because this way - * we document the type we actually want to pass through, conceptually, - * rather then confusing the issue by merely stating the type it gets - * promoted to - */ - -typedef int uint16_vap; - -/* - * TIFF header. - */ -typedef struct { - uint16 tiff_magic; /* magic number (defines byte order) */ - uint16 tiff_version; /* TIFF version number */ -} TIFFHeaderCommon; -typedef struct { - uint16 tiff_magic; /* magic number (defines byte order) */ - uint16 tiff_version; /* TIFF version number */ - uint32 tiff_diroff; /* byte offset to first directory */ -} TIFFHeaderClassic; -typedef struct { - uint16 tiff_magic; /* magic number (defines byte order) */ - uint16 tiff_version; /* TIFF version number */ - uint16 tiff_offsetsize; /* size of offsets, should be 8 */ - uint16 tiff_unused; /* unused word, should be 0 */ - uint64 tiff_diroff; /* byte offset to first directory */ -} TIFFHeaderBig; - - -/* - * NB: In the comments below, - * - items marked with a + are obsoleted by revision 5.0, - * - items marked with a ! are introduced in revision 6.0. - * - items marked with a % are introduced post revision 6.0. - * - items marked with a $ are obsoleted by revision 6.0. - * - items marked with a & are introduced by Adobe DNG specification. - */ - -/* - * Tag data type information. - * - * Note: RATIONALs are the ratio of two 32-bit integer values. - */ -typedef enum { - TIFF_NOTYPE = 0, /* placeholder */ - TIFF_BYTE = 1, /* 8-bit unsigned integer */ - TIFF_ASCII = 2, /* 8-bit bytes w/ last byte null */ - TIFF_SHORT = 3, /* 16-bit unsigned integer */ - TIFF_LONG = 4, /* 32-bit unsigned integer */ - TIFF_RATIONAL = 5, /* 64-bit unsigned fraction */ - TIFF_SBYTE = 6, /* !8-bit signed integer */ - TIFF_UNDEFINED = 7, /* !8-bit untyped data */ - TIFF_SSHORT = 8, /* !16-bit signed integer */ - TIFF_SLONG = 9, /* !32-bit signed integer */ - TIFF_SRATIONAL = 10, /* !64-bit signed fraction */ - TIFF_FLOAT = 11, /* !32-bit IEEE floating point */ - TIFF_DOUBLE = 12, /* !64-bit IEEE floating point */ - TIFF_IFD = 13, /* %32-bit unsigned integer (offset) */ - TIFF_LONG8 = 16, /* BigTIFF 64-bit unsigned integer */ - TIFF_SLONG8 = 17, /* BigTIFF 64-bit signed integer */ - TIFF_IFD8 = 18 /* BigTIFF 64-bit unsigned integer (offset) */ -} TIFFDataType; - -/* - * TIFF Tag Definitions. - */ -#define TIFFTAG_SUBFILETYPE 254 /* subfile data descriptor */ -#define FILETYPE_REDUCEDIMAGE 0x1 /* reduced resolution version */ -#define FILETYPE_PAGE 0x2 /* one page of many */ -#define FILETYPE_MASK 0x4 /* transparency mask */ -#define TIFFTAG_OSUBFILETYPE 255 /* +kind of data in subfile */ -#define OFILETYPE_IMAGE 1 /* full resolution image data */ -#define OFILETYPE_REDUCEDIMAGE 2 /* reduced size image data */ -#define OFILETYPE_PAGE 3 /* one page of many */ -#define TIFFTAG_IMAGEWIDTH 256 /* image width in pixels */ -#define TIFFTAG_IMAGELENGTH 257 /* image height in pixels */ -#define TIFFTAG_BITSPERSAMPLE 258 /* bits per channel (sample) */ -#define TIFFTAG_COMPRESSION 259 /* data compression technique */ -#define COMPRESSION_NONE 1 /* dump mode */ -#define COMPRESSION_CCITTRLE 2 /* CCITT modified Huffman RLE */ -#define COMPRESSION_CCITTFAX3 3 /* CCITT Group 3 fax encoding */ -#define COMPRESSION_CCITT_T4 3 /* CCITT T.4 (TIFF 6 name) */ -#define COMPRESSION_CCITTFAX4 4 /* CCITT Group 4 fax encoding */ -#define COMPRESSION_CCITT_T6 4 /* CCITT T.6 (TIFF 6 name) */ -#define COMPRESSION_LZW 5 /* Lempel-Ziv & Welch */ -#define COMPRESSION_OJPEG 6 /* !6.0 JPEG */ -#define COMPRESSION_JPEG 7 /* %JPEG DCT compression */ -#define COMPRESSION_T85 9 /* !TIFF/FX T.85 JBIG compression */ -#define COMPRESSION_T43 10 /* !TIFF/FX T.43 colour by layered JBIG compression */ -#define COMPRESSION_NEXT 32766 /* NeXT 2-bit RLE */ -#define COMPRESSION_CCITTRLEW 32771 /* #1 w/ word alignment */ -#define COMPRESSION_PACKBITS 32773 /* Macintosh RLE */ -#define COMPRESSION_THUNDERSCAN 32809 /* ThunderScan RLE */ -/* codes 32895-32898 are reserved for ANSI IT8 TIFF/IT <dkelly@apago.com) */ -#define COMPRESSION_IT8CTPAD 32895 /* IT8 CT w/padding */ -#define COMPRESSION_IT8LW 32896 /* IT8 Linework RLE */ -#define COMPRESSION_IT8MP 32897 /* IT8 Monochrome picture */ -#define COMPRESSION_IT8BL 32898 /* IT8 Binary line art */ -/* compression codes 32908-32911 are reserved for Pixar */ -#define COMPRESSION_PIXARFILM 32908 /* Pixar companded 10bit LZW */ -#define COMPRESSION_PIXARLOG 32909 /* Pixar companded 11bit ZIP */ -#define COMPRESSION_DEFLATE 32946 /* Deflate compression */ -#define COMPRESSION_ADOBE_DEFLATE 8 /* Deflate compression, - as recognized by Adobe */ -/* compression code 32947 is reserved for Oceana Matrix <dev@oceana.com> */ -#define COMPRESSION_DCS 32947 /* Kodak DCS encoding */ -#define COMPRESSION_JBIG 34661 /* ISO JBIG */ -#define COMPRESSION_SGILOG 34676 /* SGI Log Luminance RLE */ -#define COMPRESSION_SGILOG24 34677 /* SGI Log 24-bit packed */ -#define COMPRESSION_JP2000 34712 /* Leadtools JPEG2000 */ -#define COMPRESSION_LZMA 34925 /* LZMA2 */ -#define TIFFTAG_PHOTOMETRIC 262 /* photometric interpretation */ -#define PHOTOMETRIC_MINISWHITE 0 /* min value is white */ -#define PHOTOMETRIC_MINISBLACK 1 /* min value is black */ -#define PHOTOMETRIC_RGB 2 /* RGB color model */ -#define PHOTOMETRIC_PALETTE 3 /* color map indexed */ -#define PHOTOMETRIC_MASK 4 /* $holdout mask */ -#define PHOTOMETRIC_SEPARATED 5 /* !color separations */ -#define PHOTOMETRIC_YCBCR 6 /* !CCIR 601 */ -#define PHOTOMETRIC_CIELAB 8 /* !1976 CIE L*a*b* */ -#define PHOTOMETRIC_ICCLAB 9 /* ICC L*a*b* [Adobe TIFF Technote 4] */ -#define PHOTOMETRIC_ITULAB 10 /* ITU L*a*b* */ -#define PHOTOMETRIC_LOGL 32844 /* CIE Log2(L) */ -#define PHOTOMETRIC_LOGLUV 32845 /* CIE Log2(L) (u',v') */ -#define TIFFTAG_THRESHHOLDING 263 /* +thresholding used on data */ -#define THRESHHOLD_BILEVEL 1 /* b&w art scan */ -#define THRESHHOLD_HALFTONE 2 /* or dithered scan */ -#define THRESHHOLD_ERRORDIFFUSE 3 /* usually floyd-steinberg */ -#define TIFFTAG_CELLWIDTH 264 /* +dithering matrix width */ -#define TIFFTAG_CELLLENGTH 265 /* +dithering matrix height */ -#define TIFFTAG_FILLORDER 266 /* data order within a byte */ -#define FILLORDER_MSB2LSB 1 /* most significant -> least */ -#define FILLORDER_LSB2MSB 2 /* least significant -> most */ -#define TIFFTAG_DOCUMENTNAME 269 /* name of doc. image is from */ -#define TIFFTAG_IMAGEDESCRIPTION 270 /* info about image */ -#define TIFFTAG_MAKE 271 /* scanner manufacturer name */ -#define TIFFTAG_MODEL 272 /* scanner model name/number */ -#define TIFFTAG_STRIPOFFSETS 273 /* offsets to data strips */ -#define TIFFTAG_ORIENTATION 274 /* +image orientation */ -#define ORIENTATION_TOPLEFT 1 /* row 0 top, col 0 lhs */ -#define ORIENTATION_TOPRIGHT 2 /* row 0 top, col 0 rhs */ -#define ORIENTATION_BOTRIGHT 3 /* row 0 bottom, col 0 rhs */ -#define ORIENTATION_BOTLEFT 4 /* row 0 bottom, col 0 lhs */ -#define ORIENTATION_LEFTTOP 5 /* row 0 lhs, col 0 top */ -#define ORIENTATION_RIGHTTOP 6 /* row 0 rhs, col 0 top */ -#define ORIENTATION_RIGHTBOT 7 /* row 0 rhs, col 0 bottom */ -#define ORIENTATION_LEFTBOT 8 /* row 0 lhs, col 0 bottom */ -#define TIFFTAG_SAMPLESPERPIXEL 277 /* samples per pixel */ -#define TIFFTAG_ROWSPERSTRIP 278 /* rows per strip of data */ -#define TIFFTAG_STRIPBYTECOUNTS 279 /* bytes counts for strips */ -#define TIFFTAG_MINSAMPLEVALUE 280 /* +minimum sample value */ -#define TIFFTAG_MAXSAMPLEVALUE 281 /* +maximum sample value */ -#define TIFFTAG_XRESOLUTION 282 /* pixels/resolution in x */ -#define TIFFTAG_YRESOLUTION 283 /* pixels/resolution in y */ -#define TIFFTAG_PLANARCONFIG 284 /* storage organization */ -#define PLANARCONFIG_CONTIG 1 /* single image plane */ -#define PLANARCONFIG_SEPARATE 2 /* separate planes of data */ -#define TIFFTAG_PAGENAME 285 /* page name image is from */ -#define TIFFTAG_XPOSITION 286 /* x page offset of image lhs */ -#define TIFFTAG_YPOSITION 287 /* y page offset of image lhs */ -#define TIFFTAG_FREEOFFSETS 288 /* +byte offset to free block */ -#define TIFFTAG_FREEBYTECOUNTS 289 /* +sizes of free blocks */ -#define TIFFTAG_GRAYRESPONSEUNIT 290 /* $gray scale curve accuracy */ -#define GRAYRESPONSEUNIT_10S 1 /* tenths of a unit */ -#define GRAYRESPONSEUNIT_100S 2 /* hundredths of a unit */ -#define GRAYRESPONSEUNIT_1000S 3 /* thousandths of a unit */ -#define GRAYRESPONSEUNIT_10000S 4 /* ten-thousandths of a unit */ -#define GRAYRESPONSEUNIT_100000S 5 /* hundred-thousandths */ -#define TIFFTAG_GRAYRESPONSECURVE 291 /* $gray scale response curve */ -#define TIFFTAG_GROUP3OPTIONS 292 /* 32 flag bits */ -#define TIFFTAG_T4OPTIONS 292 /* TIFF 6.0 proper name alias */ -#define GROUP3OPT_2DENCODING 0x1 /* 2-dimensional coding */ -#define GROUP3OPT_UNCOMPRESSED 0x2 /* data not compressed */ -#define GROUP3OPT_FILLBITS 0x4 /* fill to byte boundary */ -#define TIFFTAG_GROUP4OPTIONS 293 /* 32 flag bits */ -#define TIFFTAG_T6OPTIONS 293 /* TIFF 6.0 proper name */ -#define GROUP4OPT_UNCOMPRESSED 0x2 /* data not compressed */ -#define TIFFTAG_RESOLUTIONUNIT 296 /* units of resolutions */ -#define RESUNIT_NONE 1 /* no meaningful units */ -#define RESUNIT_INCH 2 /* english */ -#define RESUNIT_CENTIMETER 3 /* metric */ -#define TIFFTAG_PAGENUMBER 297 /* page numbers of multi-page */ -#define TIFFTAG_COLORRESPONSEUNIT 300 /* $color curve accuracy */ -#define COLORRESPONSEUNIT_10S 1 /* tenths of a unit */ -#define COLORRESPONSEUNIT_100S 2 /* hundredths of a unit */ -#define COLORRESPONSEUNIT_1000S 3 /* thousandths of a unit */ -#define COLORRESPONSEUNIT_10000S 4 /* ten-thousandths of a unit */ -#define COLORRESPONSEUNIT_100000S 5 /* hundred-thousandths */ -#define TIFFTAG_TRANSFERFUNCTION 301 /* !colorimetry info */ -#define TIFFTAG_SOFTWARE 305 /* name & release */ -#define TIFFTAG_DATETIME 306 /* creation date and time */ -#define TIFFTAG_ARTIST 315 /* creator of image */ -#define TIFFTAG_HOSTCOMPUTER 316 /* machine where created */ -#define TIFFTAG_PREDICTOR 317 /* prediction scheme w/ LZW */ -#define PREDICTOR_NONE 1 /* no prediction scheme used */ -#define PREDICTOR_HORIZONTAL 2 /* horizontal differencing */ -#define PREDICTOR_FLOATINGPOINT 3 /* floating point predictor */ -#define TIFFTAG_WHITEPOINT 318 /* image white point */ -#define TIFFTAG_PRIMARYCHROMATICITIES 319 /* !primary chromaticities */ -#define TIFFTAG_COLORMAP 320 /* RGB map for pallette image */ -#define TIFFTAG_HALFTONEHINTS 321 /* !highlight+shadow info */ -#define TIFFTAG_TILEWIDTH 322 /* !tile width in pixels */ -#define TIFFTAG_TILELENGTH 323 /* !tile height in pixels */ -#define TIFFTAG_TILEOFFSETS 324 /* !offsets to data tiles */ -#define TIFFTAG_TILEBYTECOUNTS 325 /* !byte counts for tiles */ -#define TIFFTAG_BADFAXLINES 326 /* lines w/ wrong pixel count */ -#define TIFFTAG_CLEANFAXDATA 327 /* regenerated line info */ -#define CLEANFAXDATA_CLEAN 0 /* no errors detected */ -#define CLEANFAXDATA_REGENERATED 1 /* receiver regenerated lines */ -#define CLEANFAXDATA_UNCLEAN 2 /* uncorrected errors exist */ -#define TIFFTAG_CONSECUTIVEBADFAXLINES 328 /* max consecutive bad lines */ -#define TIFFTAG_SUBIFD 330 /* subimage descriptors */ -#define TIFFTAG_INKSET 332 /* !inks in separated image */ -#define INKSET_CMYK 1 /* !cyan-magenta-yellow-black color */ -#define INKSET_MULTIINK 2 /* !multi-ink or hi-fi color */ -#define TIFFTAG_INKNAMES 333 /* !ascii names of inks */ -#define TIFFTAG_NUMBEROFINKS 334 /* !number of inks */ -#define TIFFTAG_DOTRANGE 336 /* !0% and 100% dot codes */ -#define TIFFTAG_TARGETPRINTER 337 /* !separation target */ -#define TIFFTAG_EXTRASAMPLES 338 /* !info about extra samples */ -#define EXTRASAMPLE_UNSPECIFIED 0 /* !unspecified data */ -#define EXTRASAMPLE_ASSOCALPHA 1 /* !associated alpha data */ -#define EXTRASAMPLE_UNASSALPHA 2 /* !unassociated alpha data */ -#define TIFFTAG_SAMPLEFORMAT 339 /* !data sample format */ -#define SAMPLEFORMAT_UINT 1 /* !unsigned integer data */ -#define SAMPLEFORMAT_INT 2 /* !signed integer data */ -#define SAMPLEFORMAT_IEEEFP 3 /* !IEEE floating point data */ -#define SAMPLEFORMAT_VOID 4 /* !untyped data */ -#define SAMPLEFORMAT_COMPLEXINT 5 /* !complex signed int */ -#define SAMPLEFORMAT_COMPLEXIEEEFP 6 /* !complex ieee floating */ -#define TIFFTAG_SMINSAMPLEVALUE 340 /* !variable MinSampleValue */ -#define TIFFTAG_SMAXSAMPLEVALUE 341 /* !variable MaxSampleValue */ -#define TIFFTAG_CLIPPATH 343 /* %ClipPath - [Adobe TIFF technote 2] */ -#define TIFFTAG_XCLIPPATHUNITS 344 /* %XClipPathUnits - [Adobe TIFF technote 2] */ -#define TIFFTAG_YCLIPPATHUNITS 345 /* %YClipPathUnits - [Adobe TIFF technote 2] */ -#define TIFFTAG_INDEXED 346 /* %Indexed - [Adobe TIFF Technote 3] */ -#define TIFFTAG_JPEGTABLES 347 /* %JPEG table stream */ -#define TIFFTAG_OPIPROXY 351 /* %OPI Proxy [Adobe TIFF technote] */ -/* Tags 400-435 are from the TIFF/FX spec */ -#define TIFFTAG_GLOBALPARAMETERSIFD 400 /* ! */ -#define TIFFTAG_PROFILETYPE 401 /* ! */ -#define PROFILETYPE_UNSPECIFIED 0 /* ! */ -#define PROFILETYPE_G3_FAX 1 /* ! */ -#define TIFFTAG_FAXPROFILE 402 /* ! */ -#define FAXPROFILE_S 1 /* !TIFF/FX FAX profile S */ -#define FAXPROFILE_F 2 /* !TIFF/FX FAX profile F */ -#define FAXPROFILE_J 3 /* !TIFF/FX FAX profile J */ -#define FAXPROFILE_C 4 /* !TIFF/FX FAX profile C */ -#define FAXPROFILE_L 5 /* !TIFF/FX FAX profile L */ -#define FAXPROFILE_M 6 /* !TIFF/FX FAX profile LM */ -#define TIFFTAG_CODINGMETHODS 403 /* !TIFF/FX coding methods */ -#define CODINGMETHODS_T4_1D (1 << 1) /* !T.4 1D */ -#define CODINGMETHODS_T4_2D (1 << 2) /* !T.4 2D */ -#define CODINGMETHODS_T6 (1 << 3) /* !T.6 */ -#define CODINGMETHODS_T85 (1 << 4) /* !T.85 JBIG */ -#define CODINGMETHODS_T42 (1 << 5) /* !T.42 JPEG */ -#define CODINGMETHODS_T43 (1 << 6) /* !T.43 colour by layered JBIG */ -#define TIFFTAG_VERSIONYEAR 404 /* !TIFF/FX version year */ -#define TIFFTAG_MODENUMBER 405 /* !TIFF/FX mode number */ -#define TIFFTAG_DECODE 433 /* !TIFF/FX decode */ -#define TIFFTAG_IMAGEBASECOLOR 434 /* !TIFF/FX image base colour */ -#define TIFFTAG_T82OPTIONS 435 /* !TIFF/FX T.82 options */ -/* - * Tags 512-521 are obsoleted by Technical Note #2 which specifies a - * revised JPEG-in-TIFF scheme. - */ -#define TIFFTAG_JPEGPROC 512 /* !JPEG processing algorithm */ -#define JPEGPROC_BASELINE 1 /* !baseline sequential */ -#define JPEGPROC_LOSSLESS 14 /* !Huffman coded lossless */ -#define TIFFTAG_JPEGIFOFFSET 513 /* !pointer to SOI marker */ -#define TIFFTAG_JPEGIFBYTECOUNT 514 /* !JFIF stream length */ -#define TIFFTAG_JPEGRESTARTINTERVAL 515 /* !restart interval length */ -#define TIFFTAG_JPEGLOSSLESSPREDICTORS 517 /* !lossless proc predictor */ -#define TIFFTAG_JPEGPOINTTRANSFORM 518 /* !lossless point transform */ -#define TIFFTAG_JPEGQTABLES 519 /* !Q matrice offsets */ -#define TIFFTAG_JPEGDCTABLES 520 /* !DCT table offsets */ -#define TIFFTAG_JPEGACTABLES 521 /* !AC coefficient offsets */ -#define TIFFTAG_YCBCRCOEFFICIENTS 529 /* !RGB -> YCbCr transform */ -#define TIFFTAG_YCBCRSUBSAMPLING 530 /* !YCbCr subsampling factors */ -#define TIFFTAG_YCBCRPOSITIONING 531 /* !subsample positioning */ -#define YCBCRPOSITION_CENTERED 1 /* !as in PostScript Level 2 */ -#define YCBCRPOSITION_COSITED 2 /* !as in CCIR 601-1 */ -#define TIFFTAG_REFERENCEBLACKWHITE 532 /* !colorimetry info */ -#define TIFFTAG_STRIPROWCOUNTS 559 /* !TIFF/FX strip row counts */ -#define TIFFTAG_XMLPACKET 700 /* %XML packet - [Adobe XMP Specification, - January 2004 */ -#define TIFFTAG_OPIIMAGEID 32781 /* %OPI ImageID - [Adobe TIFF technote] */ -/* tags 32952-32956 are private tags registered to Island Graphics */ -#define TIFFTAG_REFPTS 32953 /* image reference points */ -#define TIFFTAG_REGIONTACKPOINT 32954 /* region-xform tack point */ -#define TIFFTAG_REGIONWARPCORNERS 32955 /* warp quadrilateral */ -#define TIFFTAG_REGIONAFFINE 32956 /* affine transformation mat */ -/* tags 32995-32999 are private tags registered to SGI */ -#define TIFFTAG_MATTEING 32995 /* $use ExtraSamples */ -#define TIFFTAG_DATATYPE 32996 /* $use SampleFormat */ -#define TIFFTAG_IMAGEDEPTH 32997 /* z depth of image */ -#define TIFFTAG_TILEDEPTH 32998 /* z depth/data tile */ -/* tags 33300-33309 are private tags registered to Pixar */ -/* - * TIFFTAG_PIXAR_IMAGEFULLWIDTH and TIFFTAG_PIXAR_IMAGEFULLLENGTH - * are set when an image has been cropped out of a larger image. - * They reflect the size of the original uncropped image. - * The TIFFTAG_XPOSITION and TIFFTAG_YPOSITION can be used - * to determine the position of the smaller image in the larger one. - */ -#define TIFFTAG_PIXAR_IMAGEFULLWIDTH 33300 /* full image size in x */ -#define TIFFTAG_PIXAR_IMAGEFULLLENGTH 33301 /* full image size in y */ - /* Tags 33302-33306 are used to identify special image modes and data - * used by Pixar's texture formats. - */ -#define TIFFTAG_PIXAR_TEXTUREFORMAT 33302 /* texture map format */ -#define TIFFTAG_PIXAR_WRAPMODES 33303 /* s & t wrap modes */ -#define TIFFTAG_PIXAR_FOVCOT 33304 /* cotan(fov) for env. maps */ -#define TIFFTAG_PIXAR_MATRIX_WORLDTOSCREEN 33305 -#define TIFFTAG_PIXAR_MATRIX_WORLDTOCAMERA 33306 -/* tag 33405 is a private tag registered to Eastman Kodak */ -#define TIFFTAG_WRITERSERIALNUMBER 33405 /* device serial number */ -/* tag 33432 is listed in the 6.0 spec w/ unknown ownership */ -#define TIFFTAG_COPYRIGHT 33432 /* copyright string */ -/* IPTC TAG from RichTIFF specifications */ -#define TIFFTAG_RICHTIFFIPTC 33723 -/* 34016-34029 are reserved for ANSI IT8 TIFF/IT <dkelly@apago.com) */ -#define TIFFTAG_IT8SITE 34016 /* site name */ -#define TIFFTAG_IT8COLORSEQUENCE 34017 /* color seq. [RGB,CMYK,etc] */ -#define TIFFTAG_IT8HEADER 34018 /* DDES Header */ -#define TIFFTAG_IT8RASTERPADDING 34019 /* raster scanline padding */ -#define TIFFTAG_IT8BITSPERRUNLENGTH 34020 /* # of bits in short run */ -#define TIFFTAG_IT8BITSPEREXTENDEDRUNLENGTH 34021/* # of bits in long run */ -#define TIFFTAG_IT8COLORTABLE 34022 /* LW colortable */ -#define TIFFTAG_IT8IMAGECOLORINDICATOR 34023 /* BP/BL image color switch */ -#define TIFFTAG_IT8BKGCOLORINDICATOR 34024 /* BP/BL bg color switch */ -#define TIFFTAG_IT8IMAGECOLORVALUE 34025 /* BP/BL image color value */ -#define TIFFTAG_IT8BKGCOLORVALUE 34026 /* BP/BL bg color value */ -#define TIFFTAG_IT8PIXELINTENSITYRANGE 34027 /* MP pixel intensity value */ -#define TIFFTAG_IT8TRANSPARENCYINDICATOR 34028 /* HC transparency switch */ -#define TIFFTAG_IT8COLORCHARACTERIZATION 34029 /* color character. table */ -#define TIFFTAG_IT8HCUSAGE 34030 /* HC usage indicator */ -#define TIFFTAG_IT8TRAPINDICATOR 34031 /* Trapping indicator - (untrapped=0, trapped=1) */ -#define TIFFTAG_IT8CMYKEQUIVALENT 34032 /* CMYK color equivalents */ -/* tags 34232-34236 are private tags registered to Texas Instruments */ -#define TIFFTAG_FRAMECOUNT 34232 /* Sequence Frame Count */ -/* tag 34377 is private tag registered to Adobe for PhotoShop */ -#define TIFFTAG_PHOTOSHOP 34377 -/* tags 34665, 34853 and 40965 are documented in EXIF specification */ -#define TIFFTAG_EXIFIFD 34665 /* Pointer to EXIF private directory */ -/* tag 34750 is a private tag registered to Adobe? */ -#define TIFFTAG_ICCPROFILE 34675 /* ICC profile data */ -#define TIFFTAG_IMAGELAYER 34732 /* !TIFF/FX image layer information */ -/* tag 34750 is a private tag registered to Pixel Magic */ -#define TIFFTAG_JBIGOPTIONS 34750 /* JBIG options */ -#define TIFFTAG_GPSIFD 34853 /* Pointer to GPS private directory */ -/* tags 34908-34914 are private tags registered to SGI */ -#define TIFFTAG_FAXRECVPARAMS 34908 /* encoded Class 2 ses. parms */ -#define TIFFTAG_FAXSUBADDRESS 34909 /* received SubAddr string */ -#define TIFFTAG_FAXRECVTIME 34910 /* receive time (secs) */ -#define TIFFTAG_FAXDCS 34911 /* encoded fax ses. params, Table 2/T.30 */ -/* tags 37439-37443 are registered to SGI <gregl@sgi.com> */ -#define TIFFTAG_STONITS 37439 /* Sample value to Nits */ -/* tag 34929 is a private tag registered to FedEx */ -#define TIFFTAG_FEDEX_EDR 34929 /* unknown use */ -#define TIFFTAG_INTEROPERABILITYIFD 40965 /* Pointer to Interoperability private directory */ -/* Adobe Digital Negative (DNG) format tags */ -#define TIFFTAG_DNGVERSION 50706 /* &DNG version number */ -#define TIFFTAG_DNGBACKWARDVERSION 50707 /* &DNG compatibility version */ -#define TIFFTAG_UNIQUECAMERAMODEL 50708 /* &name for the camera model */ -#define TIFFTAG_LOCALIZEDCAMERAMODEL 50709 /* &localized camera model - name */ -#define TIFFTAG_CFAPLANECOLOR 50710 /* &CFAPattern->LinearRaw space - mapping */ -#define TIFFTAG_CFALAYOUT 50711 /* &spatial layout of the CFA */ -#define TIFFTAG_LINEARIZATIONTABLE 50712 /* &lookup table description */ -#define TIFFTAG_BLACKLEVELREPEATDIM 50713 /* &repeat pattern size for - the BlackLevel tag */ -#define TIFFTAG_BLACKLEVEL 50714 /* &zero light encoding level */ -#define TIFFTAG_BLACKLEVELDELTAH 50715 /* &zero light encoding level - differences (columns) */ -#define TIFFTAG_BLACKLEVELDELTAV 50716 /* &zero light encoding level - differences (rows) */ -#define TIFFTAG_WHITELEVEL 50717 /* &fully saturated encoding - level */ -#define TIFFTAG_DEFAULTSCALE 50718 /* &default scale factors */ -#define TIFFTAG_DEFAULTCROPORIGIN 50719 /* &origin of the final image - area */ -#define TIFFTAG_DEFAULTCROPSIZE 50720 /* &size of the final image - area */ -#define TIFFTAG_COLORMATRIX1 50721 /* &XYZ->reference color space - transformation matrix 1 */ -#define TIFFTAG_COLORMATRIX2 50722 /* &XYZ->reference color space - transformation matrix 2 */ -#define TIFFTAG_CAMERACALIBRATION1 50723 /* &calibration matrix 1 */ -#define TIFFTAG_CAMERACALIBRATION2 50724 /* &calibration matrix 2 */ -#define TIFFTAG_REDUCTIONMATRIX1 50725 /* &dimensionality reduction - matrix 1 */ -#define TIFFTAG_REDUCTIONMATRIX2 50726 /* &dimensionality reduction - matrix 2 */ -#define TIFFTAG_ANALOGBALANCE 50727 /* &gain applied the stored raw - values*/ -#define TIFFTAG_ASSHOTNEUTRAL 50728 /* &selected white balance in - linear reference space */ -#define TIFFTAG_ASSHOTWHITEXY 50729 /* &selected white balance in - x-y chromaticity - coordinates */ -#define TIFFTAG_BASELINEEXPOSURE 50730 /* &how much to move the zero - point */ -#define TIFFTAG_BASELINENOISE 50731 /* &relative noise level */ -#define TIFFTAG_BASELINESHARPNESS 50732 /* &relative amount of - sharpening */ -#define TIFFTAG_BAYERGREENSPLIT 50733 /* &how closely the values of - the green pixels in the - blue/green rows track the - values of the green pixels - in the red/green rows */ -#define TIFFTAG_LINEARRESPONSELIMIT 50734 /* &non-linear encoding range */ -#define TIFFTAG_CAMERASERIALNUMBER 50735 /* &camera's serial number */ -#define TIFFTAG_LENSINFO 50736 /* info about the lens */ -#define TIFFTAG_CHROMABLURRADIUS 50737 /* &chroma blur radius */ -#define TIFFTAG_ANTIALIASSTRENGTH 50738 /* &relative strength of the - camera's anti-alias filter */ -#define TIFFTAG_SHADOWSCALE 50739 /* &used by Adobe Camera Raw */ -#define TIFFTAG_DNGPRIVATEDATA 50740 /* &manufacturer's private data */ -#define TIFFTAG_MAKERNOTESAFETY 50741 /* &whether the EXIF MakerNote - tag is safe to preserve - along with the rest of the - EXIF data */ -#define TIFFTAG_CALIBRATIONILLUMINANT1 50778 /* &illuminant 1 */ -#define TIFFTAG_CALIBRATIONILLUMINANT2 50779 /* &illuminant 2 */ -#define TIFFTAG_BESTQUALITYSCALE 50780 /* &best quality multiplier */ -#define TIFFTAG_RAWDATAUNIQUEID 50781 /* &unique identifier for - the raw image data */ -#define TIFFTAG_ORIGINALRAWFILENAME 50827 /* &file name of the original - raw file */ -#define TIFFTAG_ORIGINALRAWFILEDATA 50828 /* &contents of the original - raw file */ -#define TIFFTAG_ACTIVEAREA 50829 /* &active (non-masked) pixels - of the sensor */ -#define TIFFTAG_MASKEDAREAS 50830 /* &list of coordinates - of fully masked pixels */ -#define TIFFTAG_ASSHOTICCPROFILE 50831 /* &these two tags used to */ -#define TIFFTAG_ASSHOTPREPROFILEMATRIX 50832 /* map cameras's color space - into ICC profile space */ -#define TIFFTAG_CURRENTICCPROFILE 50833 /* & */ -#define TIFFTAG_CURRENTPREPROFILEMATRIX 50834 /* & */ -/* tag 65535 is an undefined tag used by Eastman Kodak */ -#define TIFFTAG_DCSHUESHIFTVALUES 65535 /* hue shift correction data */ - -/* - * The following are ``pseudo tags'' that can be used to control - * codec-specific functionality. These tags are not written to file. - * Note that these values start at 0xffff+1 so that they'll never - * collide with Aldus-assigned tags. - * - * If you want your private pseudo tags ``registered'' (i.e. added to - * this file), please post a bug report via the tracking system at - * http://www.remotesensing.org/libtiff/bugs.html with the appropriate - * C definitions to add. - */ -#define TIFFTAG_FAXMODE 65536 /* Group 3/4 format control */ -#define FAXMODE_CLASSIC 0x0000 /* default, include RTC */ -#define FAXMODE_NORTC 0x0001 /* no RTC at end of data */ -#define FAXMODE_NOEOL 0x0002 /* no EOL code at end of row */ -#define FAXMODE_BYTEALIGN 0x0004 /* byte align row */ -#define FAXMODE_WORDALIGN 0x0008 /* word align row */ -#define FAXMODE_CLASSF FAXMODE_NORTC /* TIFF Class F */ -#define TIFFTAG_JPEGQUALITY 65537 /* Compression quality level */ -/* Note: quality level is on the IJG 0-100 scale. Default value is 75 */ -#define TIFFTAG_JPEGCOLORMODE 65538 /* Auto RGB<=>YCbCr convert? */ -#define JPEGCOLORMODE_RAW 0x0000 /* no conversion (default) */ -#define JPEGCOLORMODE_RGB 0x0001 /* do auto conversion */ -#define TIFFTAG_JPEGTABLESMODE 65539 /* What to put in JPEGTables */ -#define JPEGTABLESMODE_QUANT 0x0001 /* include quantization tbls */ -#define JPEGTABLESMODE_HUFF 0x0002 /* include Huffman tbls */ -/* Note: default is JPEGTABLESMODE_QUANT | JPEGTABLESMODE_HUFF */ -#define TIFFTAG_FAXFILLFUNC 65540 /* G3/G4 fill function */ -#define TIFFTAG_PIXARLOGDATAFMT 65549 /* PixarLogCodec I/O data sz */ -#define PIXARLOGDATAFMT_8BIT 0 /* regular u_char samples */ -#define PIXARLOGDATAFMT_8BITABGR 1 /* ABGR-order u_chars */ -#define PIXARLOGDATAFMT_11BITLOG 2 /* 11-bit log-encoded (raw) */ -#define PIXARLOGDATAFMT_12BITPICIO 3 /* as per PICIO (1.0==2048) */ -#define PIXARLOGDATAFMT_16BIT 4 /* signed short samples */ -#define PIXARLOGDATAFMT_FLOAT 5 /* IEEE float samples */ -/* 65550-65556 are allocated to Oceana Matrix <dev@oceana.com> */ -#define TIFFTAG_DCSIMAGERTYPE 65550 /* imager model & filter */ -#define DCSIMAGERMODEL_M3 0 /* M3 chip (1280 x 1024) */ -#define DCSIMAGERMODEL_M5 1 /* M5 chip (1536 x 1024) */ -#define DCSIMAGERMODEL_M6 2 /* M6 chip (3072 x 2048) */ -#define DCSIMAGERFILTER_IR 0 /* infrared filter */ -#define DCSIMAGERFILTER_MONO 1 /* monochrome filter */ -#define DCSIMAGERFILTER_CFA 2 /* color filter array */ -#define DCSIMAGERFILTER_OTHER 3 /* other filter */ -#define TIFFTAG_DCSINTERPMODE 65551 /* interpolation mode */ -#define DCSINTERPMODE_NORMAL 0x0 /* whole image, default */ -#define DCSINTERPMODE_PREVIEW 0x1 /* preview of image (384x256) */ -#define TIFFTAG_DCSBALANCEARRAY 65552 /* color balance values */ -#define TIFFTAG_DCSCORRECTMATRIX 65553 /* color correction values */ -#define TIFFTAG_DCSGAMMA 65554 /* gamma value */ -#define TIFFTAG_DCSTOESHOULDERPTS 65555 /* toe & shoulder points */ -#define TIFFTAG_DCSCALIBRATIONFD 65556 /* calibration file desc */ -/* Note: quality level is on the ZLIB 1-9 scale. Default value is -1 */ -#define TIFFTAG_ZIPQUALITY 65557 /* compression quality level */ -#define TIFFTAG_PIXARLOGQUALITY 65558 /* PixarLog uses same scale */ -/* 65559 is allocated to Oceana Matrix <dev@oceana.com> */ -#define TIFFTAG_DCSCLIPRECTANGLE 65559 /* area of image to acquire */ -#define TIFFTAG_SGILOGDATAFMT 65560 /* SGILog user data format */ -#define SGILOGDATAFMT_FLOAT 0 /* IEEE float samples */ -#define SGILOGDATAFMT_16BIT 1 /* 16-bit samples */ -#define SGILOGDATAFMT_RAW 2 /* uninterpreted data */ -#define SGILOGDATAFMT_8BIT 3 /* 8-bit RGB monitor values */ -#define TIFFTAG_SGILOGENCODE 65561 /* SGILog data encoding control*/ -#define SGILOGENCODE_NODITHER 0 /* do not dither encoded values*/ -#define SGILOGENCODE_RANDITHER 1 /* randomly dither encd values */ -#define TIFFTAG_LZMAPRESET 65562 /* LZMA2 preset (compression level) */ -#define TIFFTAG_PERSAMPLE 65563 /* interface for per sample tags */ -#define PERSAMPLE_MERGED 0 /* present as a single value */ -#define PERSAMPLE_MULTI 1 /* present as multiple values */ - -/* - * EXIF tags - */ -#define EXIFTAG_EXPOSURETIME 33434 /* Exposure time */ -#define EXIFTAG_FNUMBER 33437 /* F number */ -#define EXIFTAG_EXPOSUREPROGRAM 34850 /* Exposure program */ -#define EXIFTAG_SPECTRALSENSITIVITY 34852 /* Spectral sensitivity */ -#define EXIFTAG_ISOSPEEDRATINGS 34855 /* ISO speed rating */ -#define EXIFTAG_OECF 34856 /* Optoelectric conversion - factor */ -#define EXIFTAG_EXIFVERSION 36864 /* Exif version */ -#define EXIFTAG_DATETIMEORIGINAL 36867 /* Date and time of original - data generation */ -#define EXIFTAG_DATETIMEDIGITIZED 36868 /* Date and time of digital - data generation */ -#define EXIFTAG_COMPONENTSCONFIGURATION 37121 /* Meaning of each component */ -#define EXIFTAG_COMPRESSEDBITSPERPIXEL 37122 /* Image compression mode */ -#define EXIFTAG_SHUTTERSPEEDVALUE 37377 /* Shutter speed */ -#define EXIFTAG_APERTUREVALUE 37378 /* Aperture */ -#define EXIFTAG_BRIGHTNESSVALUE 37379 /* Brightness */ -#define EXIFTAG_EXPOSUREBIASVALUE 37380 /* Exposure bias */ -#define EXIFTAG_MAXAPERTUREVALUE 37381 /* Maximum lens aperture */ -#define EXIFTAG_SUBJECTDISTANCE 37382 /* Subject distance */ -#define EXIFTAG_METERINGMODE 37383 /* Metering mode */ -#define EXIFTAG_LIGHTSOURCE 37384 /* Light source */ -#define EXIFTAG_FLASH 37385 /* Flash */ -#define EXIFTAG_FOCALLENGTH 37386 /* Lens focal length */ -#define EXIFTAG_SUBJECTAREA 37396 /* Subject area */ -#define EXIFTAG_MAKERNOTE 37500 /* Manufacturer notes */ -#define EXIFTAG_USERCOMMENT 37510 /* User comments */ -#define EXIFTAG_SUBSECTIME 37520 /* DateTime subseconds */ -#define EXIFTAG_SUBSECTIMEORIGINAL 37521 /* DateTimeOriginal subseconds */ -#define EXIFTAG_SUBSECTIMEDIGITIZED 37522 /* DateTimeDigitized subseconds */ -#define EXIFTAG_FLASHPIXVERSION 40960 /* Supported Flashpix version */ -#define EXIFTAG_COLORSPACE 40961 /* Color space information */ -#define EXIFTAG_PIXELXDIMENSION 40962 /* Valid image width */ -#define EXIFTAG_PIXELYDIMENSION 40963 /* Valid image height */ -#define EXIFTAG_RELATEDSOUNDFILE 40964 /* Related audio file */ -#define EXIFTAG_FLASHENERGY 41483 /* Flash energy */ -#define EXIFTAG_SPATIALFREQUENCYRESPONSE 41484 /* Spatial frequency response */ -#define EXIFTAG_FOCALPLANEXRESOLUTION 41486 /* Focal plane X resolution */ -#define EXIFTAG_FOCALPLANEYRESOLUTION 41487 /* Focal plane Y resolution */ -#define EXIFTAG_FOCALPLANERESOLUTIONUNIT 41488 /* Focal plane resolution unit */ -#define EXIFTAG_SUBJECTLOCATION 41492 /* Subject location */ -#define EXIFTAG_EXPOSUREINDEX 41493 /* Exposure index */ -#define EXIFTAG_SENSINGMETHOD 41495 /* Sensing method */ -#define EXIFTAG_FILESOURCE 41728 /* File source */ -#define EXIFTAG_SCENETYPE 41729 /* Scene type */ -#define EXIFTAG_CFAPATTERN 41730 /* CFA pattern */ -#define EXIFTAG_CUSTOMRENDERED 41985 /* Custom image processing */ -#define EXIFTAG_EXPOSUREMODE 41986 /* Exposure mode */ -#define EXIFTAG_WHITEBALANCE 41987 /* White balance */ -#define EXIFTAG_DIGITALZOOMRATIO 41988 /* Digital zoom ratio */ -#define EXIFTAG_FOCALLENGTHIN35MMFILM 41989 /* Focal length in 35 mm film */ -#define EXIFTAG_SCENECAPTURETYPE 41990 /* Scene capture type */ -#define EXIFTAG_GAINCONTROL 41991 /* Gain control */ -#define EXIFTAG_CONTRAST 41992 /* Contrast */ -#define EXIFTAG_SATURATION 41993 /* Saturation */ -#define EXIFTAG_SHARPNESS 41994 /* Sharpness */ -#define EXIFTAG_DEVICESETTINGDESCRIPTION 41995 /* Device settings description */ -#define EXIFTAG_SUBJECTDISTANCERANGE 41996 /* Subject distance range */ -#define EXIFTAG_GAINCONTROL 41991 /* Gain control */ -#define EXIFTAG_GAINCONTROL 41991 /* Gain control */ -#define EXIFTAG_IMAGEUNIQUEID 42016 /* Unique image ID */ - -#endif /* _TIFF_ */ - -/* vim: set ts=8 sts=8 sw=8 noet: */ -/* - * Local Variables: - * mode: c - * c-basic-offset: 8 - * fill-column: 78 - * End: - */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/tiffconf.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/tiffconf.h deleted file mode 100644 index 09237b1a3e..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/tiffconf.h +++ /dev/null @@ -1,128 +0,0 @@ -/* libtiff/tiffconf.h. Generated from tiffconf.h.in by configure. */ -/* - Configuration defines for installed libtiff. - This file maintained for backward compatibility. Do not use definitions - from this file in your programs. -*/ - -#ifndef _TIFFCONF_ -#define _TIFFCONF_ - -/* Signed 16-bit type */ -#define TIFF_INT16_T signed short - -/* Signed 32-bit type */ -#define TIFF_INT32_T signed int - -/* Signed 64-bit type */ -#define TIFF_INT64_T signed long long - -/* Signed 8-bit type */ -#define TIFF_INT8_T signed char - -/* Unsigned 16-bit type */ -#define TIFF_UINT16_T unsigned short - -/* Unsigned 32-bit type */ -#define TIFF_UINT32_T unsigned int - -/* Unsigned 64-bit type */ -#define TIFF_UINT64_T unsigned long long - -/* Unsigned 8-bit type */ -#define TIFF_UINT8_T unsigned char - -/* Signed size type */ -#define TIFF_SSIZE_T signed long - -/* Pointer difference type */ -#define TIFF_PTRDIFF_T ptrdiff_t - -/* Define to 1 if the system has the type `int16'. */ -/* #undef HAVE_INT16 */ - -/* Define to 1 if the system has the type `int32'. */ -/* #undef HAVE_INT32 */ - -/* Define to 1 if the system has the type `int8'. */ -/* #undef HAVE_INT8 */ - -/* Compatibility stuff. */ - -/* Define as 0 or 1 according to the floating point format suported by the - machine */ -#define HAVE_IEEEFP 1 - -/* Set the native cpu bit order (FILLORDER_LSB2MSB or FILLORDER_MSB2LSB) */ -#define HOST_FILLORDER FILLORDER_LSB2MSB - -/* Native cpu byte order: 1 if big-endian (Motorola) or 0 if little-endian - (Intel) */ -#define HOST_BIGENDIAN 0 - -/* Support CCITT Group 3 & 4 algorithms */ -#define CCITT_SUPPORT 1 - -/* Support JPEG compression (requires IJG JPEG library) */ -/* #undef JPEG_SUPPORT */ - -/* Support JBIG compression (requires JBIG-KIT library) */ -/* #undef JBIG_SUPPORT */ - -/* Support LogLuv high dynamic range encoding */ -#define LOGLUV_SUPPORT 1 - -/* Support LZW algorithm */ -#define LZW_SUPPORT 1 - -/* Support NeXT 2-bit RLE algorithm */ -#define NEXT_SUPPORT 1 - -/* Support Old JPEG compresson (read contrib/ojpeg/README first! Compilation - fails with unpatched IJG JPEG library) */ -/* #undef OJPEG_SUPPORT */ - -/* Support Macintosh PackBits algorithm */ -#define PACKBITS_SUPPORT 1 - -/* Support Pixar log-format algorithm (requires Zlib) */ -/* #undef PIXARLOG_SUPPORT */ - -/* Support ThunderScan 4-bit RLE algorithm */ -#define THUNDER_SUPPORT 1 - -/* Support Deflate compression */ -/* #undef ZIP_SUPPORT */ - -/* Support strip chopping (whether or not to convert single-strip uncompressed - images to mutiple strips of ~8Kb to reduce memory usage) */ -#define STRIPCHOP_DEFAULT TIFF_STRIPCHOP - -/* Enable SubIFD tag (330) support */ -#define SUBIFD_SUPPORT 1 - -/* Treat extra sample as alpha (default enabled). The RGBA interface will - treat a fourth sample with no EXTRASAMPLE_ value as being ASSOCALPHA. Many - packages produce RGBA files but don't mark the alpha properly. */ -#define DEFAULT_EXTRASAMPLE_AS_ALPHA 1 - -/* Pick up YCbCr subsampling info from the JPEG data stream to support files - lacking the tag (default enabled). */ -#define CHECK_JPEG_YCBCR_SUBSAMPLING 1 - -/* Support MS MDI magic number files as TIFF */ -#define MDI_SUPPORT 1 - -/* - * Feature support definitions. - * XXX: These macros are obsoleted. Don't use them in your apps! - * Macros stays here for backward compatibility and should be always defined. - */ -#define COLORIMETRY_SUPPORT -#define YCBCR_SUPPORT -#define CMYK_SUPPORT -#define ICC_SUPPORT -#define PHOTOSHOP_SUPPORT -#define IPTC_SUPPORT - -#endif /* _TIFFCONF_ */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/tiffio.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/tiffio.h deleted file mode 100644 index 038b67013f..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/tiffio.h +++ /dev/null @@ -1,557 +0,0 @@ -/* $Id: tiffio.h,v 1.91 2012-07-29 15:45:29 tgl Exp $ */ - -/* - * Copyright (c) 1988-1997 Sam Leffler - * Copyright (c) 1991-1997 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Sam Leffler and Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#ifndef _TIFFIO_ -#define _TIFFIO_ - -/* - * TIFF I/O Library Definitions. - */ -#include "tiff.h" -#include "tiffvers.h" - -/* - * TIFF is defined as an incomplete type to hide the - * library's internal data structures from clients. - */ -typedef struct tiff TIFF; - -/* - * The following typedefs define the intrinsic size of - * data types used in the *exported* interfaces. These - * definitions depend on the proper definition of types - * in tiff.h. Note also that the varargs interface used - * to pass tag types and values uses the types defined in - * tiff.h directly. - * - * NB: ttag_t is unsigned int and not unsigned short because - * ANSI C requires that the type before the ellipsis be a - * promoted type (i.e. one of int, unsigned int, pointer, - * or double) and because we defined pseudo-tags that are - * outside the range of legal Aldus-assigned tags. - * NB: tsize_t is int32 and not uint32 because some functions - * return -1. - * NB: toff_t is not off_t for many reasons; TIFFs max out at - * 32-bit file offsets, and BigTIFF maxes out at 64-bit - * offsets being the most important, and to ensure use of - * a consistently unsigned type across architectures. - * Prior to libtiff 4.0, this was an unsigned 32 bit type. - */ -/* - * this is the machine addressing size type, only it's signed, so make it - * int32 on 32bit machines, int64 on 64bit machines - */ -typedef TIFF_SSIZE_T tmsize_t; -typedef uint64 toff_t; /* file offset */ -/* the following are deprecated and should be replaced by their defining - counterparts */ -typedef uint32 ttag_t; /* directory tag */ -typedef uint16 tdir_t; /* directory index */ -typedef uint16 tsample_t; /* sample number */ -typedef uint32 tstrile_t; /* strip or tile number */ -typedef tstrile_t tstrip_t; /* strip number */ -typedef tstrile_t ttile_t; /* tile number */ -typedef tmsize_t tsize_t; /* i/o size in bytes */ -typedef void* tdata_t; /* image data ref */ - -#if !defined(__WIN32__) && (defined(_WIN32) || defined(WIN32)) -#define __WIN32__ -#endif - -/* - * On windows you should define USE_WIN32_FILEIO if you are using tif_win32.c - * or AVOID_WIN32_FILEIO if you are using something else (like tif_unix.c). - * - * By default tif_unix.c is assumed. - */ - -#if defined(_WINDOWS) || defined(__WIN32__) || defined(_Windows) -# if !defined(__CYGWIN) && !defined(AVOID_WIN32_FILEIO) && !defined(USE_WIN32_FILEIO) -# define AVOID_WIN32_FILEIO -# endif -#endif - -#if defined(USE_WIN32_FILEIO) -# define VC_EXTRALEAN -# include <windows.h> -# ifdef __WIN32__ -DECLARE_HANDLE(thandle_t); /* Win32 file handle */ -# else -typedef HFILE thandle_t; /* client data handle */ -# endif /* __WIN32__ */ -#else -typedef void* thandle_t; /* client data handle */ -#endif /* USE_WIN32_FILEIO */ - -/* - * Flags to pass to TIFFPrintDirectory to control - * printing of data structures that are potentially - * very large. Bit-or these flags to enable printing - * multiple items. - */ -#define TIFFPRINT_NONE 0x0 /* no extra info */ -#define TIFFPRINT_STRIPS 0x1 /* strips/tiles info */ -#define TIFFPRINT_CURVES 0x2 /* color/gray response curves */ -#define TIFFPRINT_COLORMAP 0x4 /* colormap */ -#define TIFFPRINT_JPEGQTABLES 0x100 /* JPEG Q matrices */ -#define TIFFPRINT_JPEGACTABLES 0x200 /* JPEG AC tables */ -#define TIFFPRINT_JPEGDCTABLES 0x200 /* JPEG DC tables */ - -/* - * Colour conversion stuff - */ - -/* reference white */ -#define D65_X0 (95.0470F) -#define D65_Y0 (100.0F) -#define D65_Z0 (108.8827F) - -#define D50_X0 (96.4250F) -#define D50_Y0 (100.0F) -#define D50_Z0 (82.4680F) - -/* Structure for holding information about a display device. */ - -typedef unsigned char TIFFRGBValue; /* 8-bit samples */ - -typedef struct { - float d_mat[3][3]; /* XYZ -> luminance matrix */ - float d_YCR; /* Light o/p for reference white */ - float d_YCG; - float d_YCB; - uint32 d_Vrwr; /* Pixel values for ref. white */ - uint32 d_Vrwg; - uint32 d_Vrwb; - float d_Y0R; /* Residual light for black pixel */ - float d_Y0G; - float d_Y0B; - float d_gammaR; /* Gamma values for the three guns */ - float d_gammaG; - float d_gammaB; -} TIFFDisplay; - -typedef struct { /* YCbCr->RGB support */ - TIFFRGBValue* clamptab; /* range clamping table */ - int* Cr_r_tab; - int* Cb_b_tab; - int32* Cr_g_tab; - int32* Cb_g_tab; - int32* Y_tab; -} TIFFYCbCrToRGB; - -typedef struct { /* CIE Lab 1976->RGB support */ - int range; /* Size of conversion table */ -#define CIELABTORGB_TABLE_RANGE 1500 - float rstep, gstep, bstep; - float X0, Y0, Z0; /* Reference white point */ - TIFFDisplay display; - float Yr2r[CIELABTORGB_TABLE_RANGE + 1]; /* Conversion of Yr to r */ - float Yg2g[CIELABTORGB_TABLE_RANGE + 1]; /* Conversion of Yg to g */ - float Yb2b[CIELABTORGB_TABLE_RANGE + 1]; /* Conversion of Yb to b */ -} TIFFCIELabToRGB; - -/* - * RGBA-style image support. - */ -typedef struct _TIFFRGBAImage TIFFRGBAImage; -/* - * The image reading and conversion routines invoke - * ``put routines'' to copy/image/whatever tiles of - * raw image data. A default set of routines are - * provided to convert/copy raw image data to 8-bit - * packed ABGR format rasters. Applications can supply - * alternate routines that unpack the data into a - * different format or, for example, unpack the data - * and draw the unpacked raster on the display. - */ -typedef void (*tileContigRoutine) - (TIFFRGBAImage*, uint32*, uint32, uint32, uint32, uint32, int32, int32, - unsigned char*); -typedef void (*tileSeparateRoutine) - (TIFFRGBAImage*, uint32*, uint32, uint32, uint32, uint32, int32, int32, - unsigned char*, unsigned char*, unsigned char*, unsigned char*); -/* - * RGBA-reader state. - */ -struct _TIFFRGBAImage { - TIFF* tif; /* image handle */ - int stoponerr; /* stop on read error */ - int isContig; /* data is packed/separate */ - int alpha; /* type of alpha data present */ - uint32 width; /* image width */ - uint32 height; /* image height */ - uint16 bitspersample; /* image bits/sample */ - uint16 samplesperpixel; /* image samples/pixel */ - uint16 orientation; /* image orientation */ - uint16 req_orientation; /* requested orientation */ - uint16 photometric; /* image photometric interp */ - uint16* redcmap; /* colormap pallete */ - uint16* greencmap; - uint16* bluecmap; - /* get image data routine */ - int (*get)(TIFFRGBAImage*, uint32*, uint32, uint32); - /* put decoded strip/tile */ - union { - void (*any)(TIFFRGBAImage*); - tileContigRoutine contig; - tileSeparateRoutine separate; - } put; - TIFFRGBValue* Map; /* sample mapping array */ - uint32** BWmap; /* black&white map */ - uint32** PALmap; /* palette image map */ - TIFFYCbCrToRGB* ycbcr; /* YCbCr conversion state */ - TIFFCIELabToRGB* cielab; /* CIE L*a*b conversion state */ - - uint8* UaToAa; /* Unassociated alpha to associated alpha convertion LUT */ - uint8* Bitdepth16To8; /* LUT for conversion from 16bit to 8bit values */ - - int row_offset; - int col_offset; -}; - -/* - * Macros for extracting components from the - * packed ABGR form returned by TIFFReadRGBAImage. - */ -#define TIFFGetR(abgr) ((abgr) & 0xff) -#define TIFFGetG(abgr) (((abgr) >> 8) & 0xff) -#define TIFFGetB(abgr) (((abgr) >> 16) & 0xff) -#define TIFFGetA(abgr) (((abgr) >> 24) & 0xff) - -/* - * A CODEC is a software package that implements decoding, - * encoding, or decoding+encoding of a compression algorithm. - * The library provides a collection of builtin codecs. - * More codecs may be registered through calls to the library - * and/or the builtin implementations may be overridden. - */ -typedef int (*TIFFInitMethod)(TIFF*, int); -typedef struct { - char* name; - uint16 scheme; - TIFFInitMethod init; -} TIFFCodec; - -#include <stdio.h> -#include <stdarg.h> - -/* share internal LogLuv conversion routines? */ -#ifndef LOGLUV_PUBLIC -#define LOGLUV_PUBLIC 1 -#endif - -#if !defined(__GNUC__) && !defined(__attribute__) -# define __attribute__(x) /*nothing*/ -#endif - -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif -typedef void (*TIFFErrorHandler)(const char*, const char*, va_list); -typedef void (*TIFFErrorHandlerExt)(thandle_t, const char*, const char*, va_list); -typedef tmsize_t (*TIFFReadWriteProc)(thandle_t, void*, tmsize_t); -typedef toff_t (*TIFFSeekProc)(thandle_t, toff_t, int); -typedef int (*TIFFCloseProc)(thandle_t); -typedef toff_t (*TIFFSizeProc)(thandle_t); -typedef int (*TIFFMapFileProc)(thandle_t, void** base, toff_t* size); -typedef void (*TIFFUnmapFileProc)(thandle_t, void* base, toff_t size); -typedef void (*TIFFExtendProc)(TIFF*); - -extern const char* TIFFGetVersion(void); - -extern const TIFFCodec* TIFFFindCODEC(uint16); -extern TIFFCodec* TIFFRegisterCODEC(uint16, const char*, TIFFInitMethod); -extern void TIFFUnRegisterCODEC(TIFFCodec*); -extern int TIFFIsCODECConfigured(uint16); -extern TIFFCodec* TIFFGetConfiguredCODECs(void); - -/* - * Auxiliary functions. - */ - -extern void* _TIFFmalloc(tmsize_t s); -extern void* _TIFFrealloc(void* p, tmsize_t s); -extern void _TIFFmemset(void* p, int v, tmsize_t c); -extern void _TIFFmemcpy(void* d, const void* s, tmsize_t c); -extern int _TIFFmemcmp(const void* p1, const void* p2, tmsize_t c); -extern void _TIFFfree(void* p); - -/* -** Stuff, related to tag handling and creating custom tags. -*/ -extern int TIFFGetTagListCount( TIFF * ); -extern uint32 TIFFGetTagListEntry( TIFF *, int tag_index ); - -#define TIFF_ANY TIFF_NOTYPE /* for field descriptor searching */ -#define TIFF_VARIABLE -1 /* marker for variable length tags */ -#define TIFF_SPP -2 /* marker for SamplesPerPixel tags */ -#define TIFF_VARIABLE2 -3 /* marker for uint32 var-length tags */ - -#define FIELD_CUSTOM 65 - -typedef struct _TIFFField TIFFField; -typedef struct _TIFFFieldArray TIFFFieldArray; - -extern const TIFFField* TIFFFindField(TIFF *, uint32, TIFFDataType); -extern const TIFFField* TIFFFieldWithTag(TIFF*, uint32); -extern const TIFFField* TIFFFieldWithName(TIFF*, const char *); - -extern uint32 TIFFFieldTag(const TIFFField*); -extern const char* TIFFFieldName(const TIFFField*); -extern TIFFDataType TIFFFieldDataType(const TIFFField*); -extern int TIFFFieldPassCount(const TIFFField*); -extern int TIFFFieldReadCount(const TIFFField*); -extern int TIFFFieldWriteCount(const TIFFField*); - -typedef int (*TIFFVSetMethod)(TIFF*, uint32, va_list); -typedef int (*TIFFVGetMethod)(TIFF*, uint32, va_list); -typedef void (*TIFFPrintMethod)(TIFF*, FILE*, long); - -typedef struct { - TIFFVSetMethod vsetfield; /* tag set routine */ - TIFFVGetMethod vgetfield; /* tag get routine */ - TIFFPrintMethod printdir; /* directory print routine */ -} TIFFTagMethods; - -extern TIFFTagMethods *TIFFAccessTagMethods(TIFF *); -extern void *TIFFGetClientInfo(TIFF *, const char *); -extern void TIFFSetClientInfo(TIFF *, void *, const char *); - -extern void TIFFCleanup(TIFF* tif); -extern void TIFFClose(TIFF* tif); -extern int TIFFFlush(TIFF* tif); -extern int TIFFFlushData(TIFF* tif); -extern int TIFFGetField(TIFF* tif, uint32 tag, ...); -extern int TIFFVGetField(TIFF* tif, uint32 tag, va_list ap); -extern int TIFFGetFieldDefaulted(TIFF* tif, uint32 tag, ...); -extern int TIFFVGetFieldDefaulted(TIFF* tif, uint32 tag, va_list ap); -extern int TIFFReadDirectory(TIFF* tif); -extern int TIFFReadCustomDirectory(TIFF* tif, toff_t diroff, const TIFFFieldArray* infoarray); -extern int TIFFReadEXIFDirectory(TIFF* tif, toff_t diroff); -extern uint64 TIFFScanlineSize64(TIFF* tif); -extern tmsize_t TIFFScanlineSize(TIFF* tif); -extern uint64 TIFFRasterScanlineSize64(TIFF* tif); -extern tmsize_t TIFFRasterScanlineSize(TIFF* tif); -extern uint64 TIFFStripSize64(TIFF* tif); -extern tmsize_t TIFFStripSize(TIFF* tif); -extern uint64 TIFFRawStripSize64(TIFF* tif, uint32 strip); -extern tmsize_t TIFFRawStripSize(TIFF* tif, uint32 strip); -extern uint64 TIFFVStripSize64(TIFF* tif, uint32 nrows); -extern tmsize_t TIFFVStripSize(TIFF* tif, uint32 nrows); -extern uint64 TIFFTileRowSize64(TIFF* tif); -extern tmsize_t TIFFTileRowSize(TIFF* tif); -extern uint64 TIFFTileSize64(TIFF* tif); -extern tmsize_t TIFFTileSize(TIFF* tif); -extern uint64 TIFFVTileSize64(TIFF* tif, uint32 nrows); -extern tmsize_t TIFFVTileSize(TIFF* tif, uint32 nrows); -extern uint32 TIFFDefaultStripSize(TIFF* tif, uint32 request); -extern void TIFFDefaultTileSize(TIFF*, uint32*, uint32*); -extern int TIFFFileno(TIFF*); -extern int TIFFSetFileno(TIFF*, int); -extern thandle_t TIFFClientdata(TIFF*); -extern thandle_t TIFFSetClientdata(TIFF*, thandle_t); -extern int TIFFGetMode(TIFF*); -extern int TIFFSetMode(TIFF*, int); -extern int TIFFIsTiled(TIFF*); -extern int TIFFIsByteSwapped(TIFF*); -extern int TIFFIsUpSampled(TIFF*); -extern int TIFFIsMSB2LSB(TIFF*); -extern int TIFFIsBigEndian(TIFF*); -extern TIFFReadWriteProc TIFFGetReadProc(TIFF*); -extern TIFFReadWriteProc TIFFGetWriteProc(TIFF*); -extern TIFFSeekProc TIFFGetSeekProc(TIFF*); -extern TIFFCloseProc TIFFGetCloseProc(TIFF*); -extern TIFFSizeProc TIFFGetSizeProc(TIFF*); -extern TIFFMapFileProc TIFFGetMapFileProc(TIFF*); -extern TIFFUnmapFileProc TIFFGetUnmapFileProc(TIFF*); -extern uint32 TIFFCurrentRow(TIFF*); -extern uint16 TIFFCurrentDirectory(TIFF*); -extern uint16 TIFFNumberOfDirectories(TIFF*); -extern uint64 TIFFCurrentDirOffset(TIFF*); -extern uint32 TIFFCurrentStrip(TIFF*); -extern uint32 TIFFCurrentTile(TIFF* tif); -extern int TIFFReadBufferSetup(TIFF* tif, void* bp, tmsize_t size); -extern int TIFFWriteBufferSetup(TIFF* tif, void* bp, tmsize_t size); -extern int TIFFSetupStrips(TIFF *); -extern int TIFFWriteCheck(TIFF*, int, const char *); -extern void TIFFFreeDirectory(TIFF*); -extern int TIFFCreateDirectory(TIFF*); -extern int TIFFCreateCustomDirectory(TIFF*,const TIFFFieldArray*); -extern int TIFFCreateEXIFDirectory(TIFF*); -extern int TIFFLastDirectory(TIFF*); -extern int TIFFSetDirectory(TIFF*, uint16); -extern int TIFFSetSubDirectory(TIFF*, uint64); -extern int TIFFUnlinkDirectory(TIFF*, uint16); -extern int TIFFSetField(TIFF*, uint32, ...); -extern int TIFFVSetField(TIFF*, uint32, va_list); -extern int TIFFUnsetField(TIFF*, uint32); -extern int TIFFWriteDirectory(TIFF *); -extern int TIFFWriteCustomDirectory(TIFF *, uint64 *); -extern int TIFFCheckpointDirectory(TIFF *); -extern int TIFFRewriteDirectory(TIFF *); - -#if defined(c_plusplus) || defined(__cplusplus) -extern void TIFFPrintDirectory(TIFF*, FILE*, long = 0); -extern int TIFFReadScanline(TIFF* tif, void* buf, uint32 row, uint16 sample = 0); -extern int TIFFWriteScanline(TIFF* tif, void* buf, uint32 row, uint16 sample = 0); -extern int TIFFReadRGBAImage(TIFF*, uint32, uint32, uint32*, int = 0); -extern int TIFFReadRGBAImageOriented(TIFF*, uint32, uint32, uint32*, - int = ORIENTATION_BOTLEFT, int = 0); -#else -extern void TIFFPrintDirectory(TIFF*, FILE*, long); -extern int TIFFReadScanline(TIFF* tif, void* buf, uint32 row, uint16 sample); -extern int TIFFWriteScanline(TIFF* tif, void* buf, uint32 row, uint16 sample); -extern int TIFFReadRGBAImage(TIFF*, uint32, uint32, uint32*, int); -extern int TIFFReadRGBAImageOriented(TIFF*, uint32, uint32, uint32*, int, int); -#endif - -extern int TIFFReadRGBAStrip(TIFF*, uint32, uint32 * ); -extern int TIFFReadRGBATile(TIFF*, uint32, uint32, uint32 * ); -extern int TIFFRGBAImageOK(TIFF*, char [1024]); -extern int TIFFRGBAImageBegin(TIFFRGBAImage*, TIFF*, int, char [1024]); -extern int TIFFRGBAImageGet(TIFFRGBAImage*, uint32*, uint32, uint32); -extern void TIFFRGBAImageEnd(TIFFRGBAImage*); -extern TIFF* TIFFOpen(const char*, const char*); -# ifdef __WIN32__ -extern TIFF* TIFFOpenW(const wchar_t*, const char*); -# endif /* __WIN32__ */ -extern TIFF* TIFFFdOpen(int, const char*, const char*); -extern TIFF* TIFFClientOpen(const char*, const char*, - thandle_t, - TIFFReadWriteProc, TIFFReadWriteProc, - TIFFSeekProc, TIFFCloseProc, - TIFFSizeProc, - TIFFMapFileProc, TIFFUnmapFileProc); -extern const char* TIFFFileName(TIFF*); -extern const char* TIFFSetFileName(TIFF*, const char *); -extern void TIFFError(const char*, const char*, ...) __attribute__((__format__ (__printf__,2,3))); -extern void TIFFErrorExt(thandle_t, const char*, const char*, ...) __attribute__((__format__ (__printf__,3,4))); -extern void TIFFWarning(const char*, const char*, ...) __attribute__((__format__ (__printf__,2,3))); -extern void TIFFWarningExt(thandle_t, const char*, const char*, ...) __attribute__((__format__ (__printf__,3,4))); -extern TIFFErrorHandler TIFFSetErrorHandler(TIFFErrorHandler); -extern TIFFErrorHandlerExt TIFFSetErrorHandlerExt(TIFFErrorHandlerExt); -extern TIFFErrorHandler TIFFSetWarningHandler(TIFFErrorHandler); -extern TIFFErrorHandlerExt TIFFSetWarningHandlerExt(TIFFErrorHandlerExt); -extern TIFFExtendProc TIFFSetTagExtender(TIFFExtendProc); -extern uint32 TIFFComputeTile(TIFF* tif, uint32 x, uint32 y, uint32 z, uint16 s); -extern int TIFFCheckTile(TIFF* tif, uint32 x, uint32 y, uint32 z, uint16 s); -extern uint32 TIFFNumberOfTiles(TIFF*); -extern tmsize_t TIFFReadTile(TIFF* tif, void* buf, uint32 x, uint32 y, uint32 z, uint16 s); -extern tmsize_t TIFFWriteTile(TIFF* tif, void* buf, uint32 x, uint32 y, uint32 z, uint16 s); -extern uint32 TIFFComputeStrip(TIFF*, uint32, uint16); -extern uint32 TIFFNumberOfStrips(TIFF*); -extern tmsize_t TIFFReadEncodedStrip(TIFF* tif, uint32 strip, void* buf, tmsize_t size); -extern tmsize_t TIFFReadRawStrip(TIFF* tif, uint32 strip, void* buf, tmsize_t size); -extern tmsize_t TIFFReadEncodedTile(TIFF* tif, uint32 tile, void* buf, tmsize_t size); -extern tmsize_t TIFFReadRawTile(TIFF* tif, uint32 tile, void* buf, tmsize_t size); -extern tmsize_t TIFFWriteEncodedStrip(TIFF* tif, uint32 strip, void* data, tmsize_t cc); -extern tmsize_t TIFFWriteRawStrip(TIFF* tif, uint32 strip, void* data, tmsize_t cc); -extern tmsize_t TIFFWriteEncodedTile(TIFF* tif, uint32 tile, void* data, tmsize_t cc); -extern tmsize_t TIFFWriteRawTile(TIFF* tif, uint32 tile, void* data, tmsize_t cc); -extern int TIFFDataWidth(TIFFDataType); /* table of tag datatype widths */ -extern void TIFFSetWriteOffset(TIFF* tif, toff_t off); -extern void TIFFSwabShort(uint16*); -extern void TIFFSwabLong(uint32*); -extern void TIFFSwabLong8(uint64*); -extern void TIFFSwabFloat(float*); -extern void TIFFSwabDouble(double*); -extern void TIFFSwabArrayOfShort(uint16* wp, tmsize_t n); -extern void TIFFSwabArrayOfTriples(uint8* tp, tmsize_t n); -extern void TIFFSwabArrayOfLong(uint32* lp, tmsize_t n); -extern void TIFFSwabArrayOfLong8(uint64* lp, tmsize_t n); -extern void TIFFSwabArrayOfFloat(float* fp, tmsize_t n); -extern void TIFFSwabArrayOfDouble(double* dp, tmsize_t n); -extern void TIFFReverseBits(uint8* cp, tmsize_t n); -extern const unsigned char* TIFFGetBitRevTable(int); - -#ifdef LOGLUV_PUBLIC -#define U_NEU 0.210526316 -#define V_NEU 0.473684211 -#define UVSCALE 410. -extern double LogL16toY(int); -extern double LogL10toY(int); -extern void XYZtoRGB24(float*, uint8*); -extern int uv_decode(double*, double*, int); -extern void LogLuv24toXYZ(uint32, float*); -extern void LogLuv32toXYZ(uint32, float*); -#if defined(c_plusplus) || defined(__cplusplus) -extern int LogL16fromY(double, int = SGILOGENCODE_NODITHER); -extern int LogL10fromY(double, int = SGILOGENCODE_NODITHER); -extern int uv_encode(double, double, int = SGILOGENCODE_NODITHER); -extern uint32 LogLuv24fromXYZ(float*, int = SGILOGENCODE_NODITHER); -extern uint32 LogLuv32fromXYZ(float*, int = SGILOGENCODE_NODITHER); -#else -extern int LogL16fromY(double, int); -extern int LogL10fromY(double, int); -extern int uv_encode(double, double, int); -extern uint32 LogLuv24fromXYZ(float*, int); -extern uint32 LogLuv32fromXYZ(float*, int); -#endif -#endif /* LOGLUV_PUBLIC */ - -extern int TIFFCIELabToRGBInit(TIFFCIELabToRGB*, const TIFFDisplay *, float*); -extern void TIFFCIELabToXYZ(TIFFCIELabToRGB *, uint32, int32, int32, - float *, float *, float *); -extern void TIFFXYZToRGB(TIFFCIELabToRGB *, float, float, float, - uint32 *, uint32 *, uint32 *); - -extern int TIFFYCbCrToRGBInit(TIFFYCbCrToRGB*, float*, float*); -extern void TIFFYCbCrtoRGB(TIFFYCbCrToRGB *, uint32, int32, int32, - uint32 *, uint32 *, uint32 *); - -/**************************************************************************** - * O B S O L E T E D I N T E R F A C E S - * - * Don't use this stuff in your applications, it may be removed in the future - * libtiff versions. - ****************************************************************************/ -typedef struct { - ttag_t field_tag; /* field's tag */ - short field_readcount; /* read count/TIFF_VARIABLE/TIFF_SPP */ - short field_writecount; /* write count/TIFF_VARIABLE */ - TIFFDataType field_type; /* type of associated data */ - unsigned short field_bit; /* bit in fieldsset bit vector */ - unsigned char field_oktochange; /* if true, can change while writing */ - unsigned char field_passcount; /* if true, pass dir count on set */ - char *field_name; /* ASCII name */ -} TIFFFieldInfo; - -extern int TIFFMergeFieldInfo(TIFF*, const TIFFFieldInfo[], uint32); - -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif - -#endif /* _TIFFIO_ */ - -/* vim: set ts=8 sts=8 sw=8 noet: */ -/* - * Local Variables: - * mode: c - * c-basic-offset: 8 - * fill-column: 78 - * End: - */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/tiffio.hxx b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/tiffio.hxx deleted file mode 100644 index ed994f1156..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/tiffio.hxx +++ /dev/null @@ -1,49 +0,0 @@ -/* $Id: tiffio.hxx,v 1.3 2010-06-08 18:55:15 bfriesen Exp $ */ - -/* - * Copyright (c) 1988-1997 Sam Leffler - * Copyright (c) 1991-1997 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Sam Leffler and Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#ifndef _TIFFIO_HXX_ -#define _TIFFIO_HXX_ - -/* - * TIFF I/O library definitions which provide C++ streams API. - */ - -#include <iostream> -#include "tiff.h" - -extern TIFF* TIFFStreamOpen(const char*, std::ostream *); -extern TIFF* TIFFStreamOpen(const char*, std::istream *); - -#endif /* _TIFFIO_HXX_ */ - -/* vim: set ts=8 sts=8 sw=8 noet: */ -/* - * Local Variables: - * mode: c++ - * c-basic-offset: 8 - * fill-column: 78 - * End: - */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/tiffvers.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/tiffvers.h deleted file mode 100644 index 40edc813d5..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/tiffvers.h +++ /dev/null @@ -1,9 +0,0 @@ -#define TIFFLIB_VERSION_STR "LIBTIFF, Version 4.0.3\nCopyright (c) 1988-1996 Sam Leffler\nCopyright (c) 1991-1996 Silicon Graphics, Inc." -/* - * This define can be used in code that requires - * compilation-related definitions specific to a - * version or versions of the library. Runtime - * version checking should be done based on the - * string returned by TIFFGetVersion. - */ -#define TIFFLIB_VERSION 20120922 diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/zconf.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/zconf.h deleted file mode 100644 index b234387442..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/zconf.h +++ /dev/null @@ -1,428 +0,0 @@ -/* zconf.h -- configuration of the zlib compression library - * Copyright (C) 1995-2010 Jean-loup Gailly. - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* @(#) $Id$ */ - -#ifndef ZCONF_H -#define ZCONF_H - -/* - * If you *really* need a unique prefix for all types and library functions, - * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. - * Even better than compiling with -DZ_PREFIX would be to use configure to set - * this permanently in zconf.h using "./configure --zprefix". - */ -#ifdef Z_PREFIX /* may be set to #if 1 by ./configure */ - -/* all linked symbols */ -# define _dist_code z__dist_code -# define _length_code z__length_code -# define _tr_align z__tr_align -# define _tr_flush_block z__tr_flush_block -# define _tr_init z__tr_init -# define _tr_stored_block z__tr_stored_block -# define _tr_tally z__tr_tally -# define adler32 z_adler32 -# define adler32_combine z_adler32_combine -# define adler32_combine64 z_adler32_combine64 -# define compress z_compress -# define compress2 z_compress2 -# define compressBound z_compressBound -# define crc32 z_crc32 -# define crc32_combine z_crc32_combine -# define crc32_combine64 z_crc32_combine64 -# define deflate z_deflate -# define deflateBound z_deflateBound -# define deflateCopy z_deflateCopy -# define deflateEnd z_deflateEnd -# define deflateInit2_ z_deflateInit2_ -# define deflateInit_ z_deflateInit_ -# define deflateParams z_deflateParams -# define deflatePrime z_deflatePrime -# define deflateReset z_deflateReset -# define deflateSetDictionary z_deflateSetDictionary -# define deflateSetHeader z_deflateSetHeader -# define deflateTune z_deflateTune -# define deflate_copyright z_deflate_copyright -# define get_crc_table z_get_crc_table -# define gz_error z_gz_error -# define gz_intmax z_gz_intmax -# define gz_strwinerror z_gz_strwinerror -# define gzbuffer z_gzbuffer -# define gzclearerr z_gzclearerr -# define gzclose z_gzclose -# define gzclose_r z_gzclose_r -# define gzclose_w z_gzclose_w -# define gzdirect z_gzdirect -# define gzdopen z_gzdopen -# define gzeof z_gzeof -# define gzerror z_gzerror -# define gzflush z_gzflush -# define gzgetc z_gzgetc -# define gzgets z_gzgets -# define gzoffset z_gzoffset -# define gzoffset64 z_gzoffset64 -# define gzopen z_gzopen -# define gzopen64 z_gzopen64 -# define gzprintf z_gzprintf -# define gzputc z_gzputc -# define gzputs z_gzputs -# define gzread z_gzread -# define gzrewind z_gzrewind -# define gzseek z_gzseek -# define gzseek64 z_gzseek64 -# define gzsetparams z_gzsetparams -# define gztell z_gztell -# define gztell64 z_gztell64 -# define gzungetc z_gzungetc -# define gzwrite z_gzwrite -# define inflate z_inflate -# define inflateBack z_inflateBack -# define inflateBackEnd z_inflateBackEnd -# define inflateBackInit_ z_inflateBackInit_ -# define inflateCopy z_inflateCopy -# define inflateEnd z_inflateEnd -# define inflateGetHeader z_inflateGetHeader -# define inflateInit2_ z_inflateInit2_ -# define inflateInit_ z_inflateInit_ -# define inflateMark z_inflateMark -# define inflatePrime z_inflatePrime -# define inflateReset z_inflateReset -# define inflateReset2 z_inflateReset2 -# define inflateSetDictionary z_inflateSetDictionary -# define inflateSync z_inflateSync -# define inflateSyncPoint z_inflateSyncPoint -# define inflateUndermine z_inflateUndermine -# define inflate_copyright z_inflate_copyright -# define inflate_fast z_inflate_fast -# define inflate_table z_inflate_table -# define uncompress z_uncompress -# define zError z_zError -# define zcalloc z_zcalloc -# define zcfree z_zcfree -# define zlibCompileFlags z_zlibCompileFlags -# define zlibVersion z_zlibVersion - -/* all zlib typedefs in zlib.h and zconf.h */ -# define Byte z_Byte -# define Bytef z_Bytef -# define alloc_func z_alloc_func -# define charf z_charf -# define free_func z_free_func -# define gzFile z_gzFile -# define gz_header z_gz_header -# define gz_headerp z_gz_headerp -# define in_func z_in_func -# define intf z_intf -# define out_func z_out_func -# define uInt z_uInt -# define uIntf z_uIntf -# define uLong z_uLong -# define uLongf z_uLongf -# define voidp z_voidp -# define voidpc z_voidpc -# define voidpf z_voidpf - -/* all zlib structs in zlib.h and zconf.h */ -# define gz_header_s z_gz_header_s -# define internal_state z_internal_state - -#endif - -#if defined(__MSDOS__) && !defined(MSDOS) -# define MSDOS -#endif -#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2) -# define OS2 -#endif -#if defined(_WINDOWS) && !defined(WINDOWS) -# define WINDOWS -#endif -#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__) -# ifndef WIN32 -# define WIN32 -# endif -#endif -#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32) -# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__) -# ifndef SYS16BIT -# define SYS16BIT -# endif -# endif -#endif - -/* - * Compile with -DMAXSEG_64K if the alloc function cannot allocate more - * than 64k bytes at a time (needed on systems with 16-bit int). - */ -#ifdef SYS16BIT -# define MAXSEG_64K -#endif -#ifdef MSDOS -# define UNALIGNED_OK -#endif - -#ifdef __STDC_VERSION__ -# ifndef STDC -# define STDC -# endif -# if __STDC_VERSION__ >= 199901L -# ifndef STDC99 -# define STDC99 -# endif -# endif -#endif -#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus)) -# define STDC -#endif -#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__)) -# define STDC -#endif -#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32)) -# define STDC -#endif -#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__)) -# define STDC -#endif - -#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */ -# define STDC -#endif - -#ifndef STDC -# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ -# define const /* note: need a more gentle solution here */ -# endif -#endif - -/* Some Mac compilers merge all .h files incorrectly: */ -#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__) -# define NO_DUMMY_DECL -#endif - -/* Maximum value for memLevel in deflateInit2 */ -#ifndef MAX_MEM_LEVEL -# ifdef MAXSEG_64K -# define MAX_MEM_LEVEL 8 -# else -# define MAX_MEM_LEVEL 9 -# endif -#endif - -/* Maximum value for windowBits in deflateInit2 and inflateInit2. - * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files - * created by gzip. (Files created by minigzip can still be extracted by - * gzip.) - */ -#ifndef MAX_WBITS -# define MAX_WBITS 15 /* 32K LZ77 window */ -#endif - -/* The memory requirements for deflate are (in bytes): - (1 << (windowBits+2)) + (1 << (memLevel+9)) - that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) - plus a few kilobytes for small objects. For example, if you want to reduce - the default memory requirements from 256K to 128K, compile with - make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" - Of course this will generally degrade compression (there's no free lunch). - - The memory requirements for inflate are (in bytes) 1 << windowBits - that is, 32K for windowBits=15 (default value) plus a few kilobytes - for small objects. -*/ - - /* Type declarations */ - -#ifndef OF /* function prototypes */ -# ifdef STDC -# define OF(args) args -# else -# define OF(args) () -# endif -#endif - -/* The following definitions for FAR are needed only for MSDOS mixed - * model programming (small or medium model with some far allocations). - * This was tested only with MSC; for other MSDOS compilers you may have - * to define NO_MEMCPY in zutil.h. If you don't need the mixed model, - * just define FAR to be empty. - */ -#ifdef SYS16BIT -# if defined(M_I86SM) || defined(M_I86MM) - /* MSC small or medium model */ -# define SMALL_MEDIUM -# ifdef _MSC_VER -# define FAR _far -# else -# define FAR far -# endif -# endif -# if (defined(__SMALL__) || defined(__MEDIUM__)) - /* Turbo C small or medium model */ -# define SMALL_MEDIUM -# ifdef __BORLANDC__ -# define FAR _far -# else -# define FAR far -# endif -# endif -#endif - -#if defined(WINDOWS) || defined(WIN32) - /* If building or using zlib as a DLL, define ZLIB_DLL. - * This is not mandatory, but it offers a little performance increase. - */ -# ifdef ZLIB_DLL -# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500)) -# ifdef ZLIB_INTERNAL -# define ZEXTERN extern __declspec(dllexport) -# else -# define ZEXTERN extern __declspec(dllimport) -# endif -# endif -# endif /* ZLIB_DLL */ - /* If building or using zlib with the WINAPI/WINAPIV calling convention, - * define ZLIB_WINAPI. - * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI. - */ -# ifdef ZLIB_WINAPI -# ifdef FAR -# undef FAR -# endif -# include <windows.h> - /* No need for _export, use ZLIB.DEF instead. */ - /* For complete Windows compatibility, use WINAPI, not __stdcall. */ -# define ZEXPORT WINAPI -# ifdef WIN32 -# define ZEXPORTVA WINAPIV -# else -# define ZEXPORTVA FAR CDECL -# endif -# endif -#endif - -#if defined (__BEOS__) -# ifdef ZLIB_DLL -# ifdef ZLIB_INTERNAL -# define ZEXPORT __declspec(dllexport) -# define ZEXPORTVA __declspec(dllexport) -# else -# define ZEXPORT __declspec(dllimport) -# define ZEXPORTVA __declspec(dllimport) -# endif -# endif -#endif - -#ifndef ZEXTERN -# define ZEXTERN extern -#endif -#ifndef ZEXPORT -# define ZEXPORT -#endif -#ifndef ZEXPORTVA -# define ZEXPORTVA -#endif - -#ifndef FAR -# define FAR -#endif - -#if !defined(__MACTYPES__) -typedef unsigned char Byte; /* 8 bits */ -#endif -typedef unsigned int uInt; /* 16 bits or more */ -typedef unsigned long uLong; /* 32 bits or more */ - -#ifdef SMALL_MEDIUM - /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ -# define Bytef Byte FAR -#else - typedef Byte FAR Bytef; -#endif -typedef char FAR charf; -typedef int FAR intf; -typedef uInt FAR uIntf; -typedef uLong FAR uLongf; - -#ifdef STDC - typedef void const *voidpc; - typedef void FAR *voidpf; - typedef void *voidp; -#else - typedef Byte const *voidpc; - typedef Byte FAR *voidpf; - typedef Byte *voidp; -#endif - -#if 1 /* was set to #if 1 by ./configure */ -# define Z_HAVE_UNISTD_H -#endif - -#ifdef STDC -# include <sys/types.h> /* for off_t */ -#endif - -/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and - * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even - * though the former does not conform to the LFS document), but considering - * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as - * equivalently requesting no 64-bit operations - */ -#if -_LARGEFILE64_SOURCE - -1 == 1 -# undef _LARGEFILE64_SOURCE -#endif - -#if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE) -# include <unistd.h> /* for SEEK_* and off_t */ -# ifdef VMS -# include <unixio.h> /* for off_t */ -# endif -# ifndef z_off_t -# define z_off_t off_t -# endif -#endif - -#ifndef SEEK_SET -# define SEEK_SET 0 /* Seek from beginning of file. */ -# define SEEK_CUR 1 /* Seek from current position. */ -# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ -#endif - -#ifndef z_off_t -# define z_off_t long -#endif - -#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0 -# define z_off64_t off64_t -#else -# define z_off64_t z_off_t -#endif - -#if defined(__OS400__) -# define NO_vsnprintf -#endif - -#if defined(__MVS__) -# define NO_vsnprintf -#endif - -/* MVS linker does not support external names larger than 8 bytes */ -#if defined(__MVS__) - #pragma map(deflateInit_,"DEIN") - #pragma map(deflateInit2_,"DEIN2") - #pragma map(deflateEnd,"DEEND") - #pragma map(deflateBound,"DEBND") - #pragma map(inflateInit_,"ININ") - #pragma map(inflateInit2_,"ININ2") - #pragma map(inflateEnd,"INEND") - #pragma map(inflateSync,"INSY") - #pragma map(inflateSetDictionary,"INSEDI") - #pragma map(compressBound,"CMBND") - #pragma map(inflate_table,"INTABL") - #pragma map(inflate_fast,"INFA") - #pragma map(inflate_copyright,"INCOPY") -#endif - -#endif /* ZCONF_H */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/zlib.h b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/zlib.h deleted file mode 100644 index d3a3da8e14..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/zlib.h +++ /dev/null @@ -1,1613 +0,0 @@ -/* zlib.h -- interface of the 'zlib' general purpose compression library - version 1.2.5, April 19th, 2010 - - Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - Jean-loup Gailly Mark Adler - jloup@gzip.org madler@alumni.caltech.edu - - - The data format used by the zlib library is described by RFCs (Request for - Comments) 1950 to 1952 in the files http://www.ietf.org/rfc/rfc1950.txt - (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format). -*/ - -#ifndef ZLIB_H -#define ZLIB_H - -#include "zconf.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define ZLIB_VERSION "1.2.5" -#define ZLIB_VERNUM 0x1250 -#define ZLIB_VER_MAJOR 1 -#define ZLIB_VER_MINOR 2 -#define ZLIB_VER_REVISION 5 -#define ZLIB_VER_SUBREVISION 0 - -/* - The 'zlib' compression library provides in-memory compression and - decompression functions, including integrity checks of the uncompressed data. - This version of the library supports only one compression method (deflation) - but other algorithms will be added later and will have the same stream - interface. - - Compression can be done in a single step if the buffers are large enough, - or can be done by repeated calls of the compression function. In the latter - case, the application must provide more input and/or consume the output - (providing more output space) before each call. - - The compressed data format used by default by the in-memory functions is - the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped - around a deflate stream, which is itself documented in RFC 1951. - - The library also supports reading and writing files in gzip (.gz) format - with an interface similar to that of stdio using the functions that start - with "gz". The gzip format is different from the zlib format. gzip is a - gzip wrapper, documented in RFC 1952, wrapped around a deflate stream. - - This library can optionally read and write gzip streams in memory as well. - - The zlib format was designed to be compact and fast for use in memory - and on communications channels. The gzip format was designed for single- - file compression on file systems, has a larger header than zlib to maintain - directory information, and uses a different, slower check method than zlib. - - The library does not install any signal handler. The decoder checks - the consistency of the compressed data, so the library should never crash - even in case of corrupted input. -*/ - -typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size)); -typedef void (*free_func) OF((voidpf opaque, voidpf address)); - -struct internal_state; - -typedef struct z_stream_s { - Bytef *next_in; /* next input byte */ - uInt avail_in; /* number of bytes available at next_in */ - uLong total_in; /* total nb of input bytes read so far */ - - Bytef *next_out; /* next output byte should be put there */ - uInt avail_out; /* remaining free space at next_out */ - uLong total_out; /* total nb of bytes output so far */ - - char *msg; /* last error message, NULL if no error */ - struct internal_state FAR *state; /* not visible by applications */ - - alloc_func zalloc; /* used to allocate the internal state */ - free_func zfree; /* used to free the internal state */ - voidpf opaque; /* private data object passed to zalloc and zfree */ - - int data_type; /* best guess about the data type: binary or text */ - uLong adler; /* adler32 value of the uncompressed data */ - uLong reserved; /* reserved for future use */ -} z_stream; - -typedef z_stream FAR *z_streamp; - -/* - gzip header information passed to and from zlib routines. See RFC 1952 - for more details on the meanings of these fields. -*/ -typedef struct gz_header_s { - int text; /* true if compressed data believed to be text */ - uLong time; /* modification time */ - int xflags; /* extra flags (not used when writing a gzip file) */ - int os; /* operating system */ - Bytef *extra; /* pointer to extra field or Z_NULL if none */ - uInt extra_len; /* extra field length (valid if extra != Z_NULL) */ - uInt extra_max; /* space at extra (only when reading header) */ - Bytef *name; /* pointer to zero-terminated file name or Z_NULL */ - uInt name_max; /* space at name (only when reading header) */ - Bytef *comment; /* pointer to zero-terminated comment or Z_NULL */ - uInt comm_max; /* space at comment (only when reading header) */ - int hcrc; /* true if there was or will be a header crc */ - int done; /* true when done reading gzip header (not used - when writing a gzip file) */ -} gz_header; - -typedef gz_header FAR *gz_headerp; - -/* - The application must update next_in and avail_in when avail_in has dropped - to zero. It must update next_out and avail_out when avail_out has dropped - to zero. The application must initialize zalloc, zfree and opaque before - calling the init function. All other fields are set by the compression - library and must not be updated by the application. - - The opaque value provided by the application will be passed as the first - parameter for calls of zalloc and zfree. This can be useful for custom - memory management. The compression library attaches no meaning to the - opaque value. - - zalloc must return Z_NULL if there is not enough memory for the object. - If zlib is used in a multi-threaded application, zalloc and zfree must be - thread safe. - - On 16-bit systems, the functions zalloc and zfree must be able to allocate - exactly 65536 bytes, but will not be required to allocate more than this if - the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS, pointers - returned by zalloc for objects of exactly 65536 bytes *must* have their - offset normalized to zero. The default allocation function provided by this - library ensures this (see zutil.c). To reduce memory requirements and avoid - any allocation of 64K objects, at the expense of compression ratio, compile - the library with -DMAX_WBITS=14 (see zconf.h). - - The fields total_in and total_out can be used for statistics or progress - reports. After compression, total_in holds the total size of the - uncompressed data and may be saved for use in the decompressor (particularly - if the decompressor wants to decompress everything in a single step). -*/ - - /* constants */ - -#define Z_NO_FLUSH 0 -#define Z_PARTIAL_FLUSH 1 -#define Z_SYNC_FLUSH 2 -#define Z_FULL_FLUSH 3 -#define Z_FINISH 4 -#define Z_BLOCK 5 -#define Z_TREES 6 -/* Allowed flush values; see deflate() and inflate() below for details */ - -#define Z_OK 0 -#define Z_STREAM_END 1 -#define Z_NEED_DICT 2 -#define Z_ERRNO (-1) -#define Z_STREAM_ERROR (-2) -#define Z_DATA_ERROR (-3) -#define Z_MEM_ERROR (-4) -#define Z_BUF_ERROR (-5) -#define Z_VERSION_ERROR (-6) -/* Return codes for the compression/decompression functions. Negative values - * are errors, positive values are used for special but normal events. - */ - -#define Z_NO_COMPRESSION 0 -#define Z_BEST_SPEED 1 -#define Z_BEST_COMPRESSION 9 -#define Z_DEFAULT_COMPRESSION (-1) -/* compression levels */ - -#define Z_FILTERED 1 -#define Z_HUFFMAN_ONLY 2 -#define Z_RLE 3 -#define Z_FIXED 4 -#define Z_DEFAULT_STRATEGY 0 -/* compression strategy; see deflateInit2() below for details */ - -#define Z_BINARY 0 -#define Z_TEXT 1 -#define Z_ASCII Z_TEXT /* for compatibility with 1.2.2 and earlier */ -#define Z_UNKNOWN 2 -/* Possible values of the data_type field (though see inflate()) */ - -#define Z_DEFLATED 8 -/* The deflate compression method (the only one supported in this version) */ - -#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */ - -#define zlib_version zlibVersion() -/* for compatibility with versions < 1.0.2 */ - - - /* basic functions */ - -ZEXTERN const char * ZEXPORT zlibVersion OF((void)); -/* The application can compare zlibVersion and ZLIB_VERSION for consistency. - If the first character differs, the library code actually used is not - compatible with the zlib.h header file used by the application. This check - is automatically made by deflateInit and inflateInit. - */ - -/* -ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level)); - - Initializes the internal stream state for compression. The fields - zalloc, zfree and opaque must be initialized before by the caller. If - zalloc and zfree are set to Z_NULL, deflateInit updates them to use default - allocation functions. - - The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9: - 1 gives best speed, 9 gives best compression, 0 gives no compression at all - (the input data is simply copied a block at a time). Z_DEFAULT_COMPRESSION - requests a default compromise between speed and compression (currently - equivalent to level 6). - - deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_STREAM_ERROR if level is not a valid compression level, or - Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible - with the version assumed by the caller (ZLIB_VERSION). msg is set to null - if there is no error message. deflateInit does not perform any compression: - this will be done by deflate(). -*/ - - -ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); -/* - deflate compresses as much data as possible, and stops when the input - buffer becomes empty or the output buffer becomes full. It may introduce - some output latency (reading input without producing any output) except when - forced to flush. - - The detailed semantics are as follows. deflate performs one or both of the - following actions: - - - Compress more input starting at next_in and update next_in and avail_in - accordingly. If not all input can be processed (because there is not - enough room in the output buffer), next_in and avail_in are updated and - processing will resume at this point for the next call of deflate(). - - - Provide more output starting at next_out and update next_out and avail_out - accordingly. This action is forced if the parameter flush is non zero. - Forcing flush frequently degrades the compression ratio, so this parameter - should be set only when necessary (in interactive applications). Some - output may be provided even if flush is not set. - - Before the call of deflate(), the application should ensure that at least - one of the actions is possible, by providing more input and/or consuming more - output, and updating avail_in or avail_out accordingly; avail_out should - never be zero before the call. The application can consume the compressed - output when it wants, for example when the output buffer is full (avail_out - == 0), or after each call of deflate(). If deflate returns Z_OK and with - zero avail_out, it must be called again after making room in the output - buffer because there might be more output pending. - - Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to - decide how much data to accumulate before producing output, in order to - maximize compression. - - If the parameter flush is set to Z_SYNC_FLUSH, all pending output is - flushed to the output buffer and the output is aligned on a byte boundary, so - that the decompressor can get all input data available so far. (In - particular avail_in is zero after the call if enough output space has been - provided before the call.) Flushing may degrade compression for some - compression algorithms and so it should be used only when necessary. This - completes the current deflate block and follows it with an empty stored block - that is three bits plus filler bits to the next byte, followed by four bytes - (00 00 ff ff). - - If flush is set to Z_PARTIAL_FLUSH, all pending output is flushed to the - output buffer, but the output is not aligned to a byte boundary. All of the - input data so far will be available to the decompressor, as for Z_SYNC_FLUSH. - This completes the current deflate block and follows it with an empty fixed - codes block that is 10 bits long. This assures that enough bytes are output - in order for the decompressor to finish the block before the empty fixed code - block. - - If flush is set to Z_BLOCK, a deflate block is completed and emitted, as - for Z_SYNC_FLUSH, but the output is not aligned on a byte boundary, and up to - seven bits of the current block are held to be written as the next byte after - the next deflate block is completed. In this case, the decompressor may not - be provided enough bits at this point in order to complete decompression of - the data provided so far to the compressor. It may need to wait for the next - block to be emitted. This is for advanced applications that need to control - the emission of deflate blocks. - - If flush is set to Z_FULL_FLUSH, all output is flushed as with - Z_SYNC_FLUSH, and the compression state is reset so that decompression can - restart from this point if previous compressed data has been damaged or if - random access is desired. Using Z_FULL_FLUSH too often can seriously degrade - compression. - - If deflate returns with avail_out == 0, this function must be called again - with the same value of the flush parameter and more output space (updated - avail_out), until the flush is complete (deflate returns with non-zero - avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that - avail_out is greater than six to avoid repeated flush markers due to - avail_out == 0 on return. - - If the parameter flush is set to Z_FINISH, pending input is processed, - pending output is flushed and deflate returns with Z_STREAM_END if there was - enough output space; if deflate returns with Z_OK, this function must be - called again with Z_FINISH and more output space (updated avail_out) but no - more input data, until it returns with Z_STREAM_END or an error. After - deflate has returned Z_STREAM_END, the only possible operations on the stream - are deflateReset or deflateEnd. - - Z_FINISH can be used immediately after deflateInit if all the compression - is to be done in a single step. In this case, avail_out must be at least the - value returned by deflateBound (see below). If deflate does not return - Z_STREAM_END, then it must be called again as described above. - - deflate() sets strm->adler to the adler32 checksum of all input read - so far (that is, total_in bytes). - - deflate() may update strm->data_type if it can make a good guess about - the input data type (Z_BINARY or Z_TEXT). In doubt, the data is considered - binary. This field is only for information purposes and does not affect the - compression algorithm in any manner. - - deflate() returns Z_OK if some progress has been made (more input - processed or more output produced), Z_STREAM_END if all input has been - consumed and all output has been produced (only when flush is set to - Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example - if next_in or next_out was Z_NULL), Z_BUF_ERROR if no progress is possible - (for example avail_in or avail_out was zero). Note that Z_BUF_ERROR is not - fatal, and deflate() can be called again with more input and more output - space to continue compressing. -*/ - - -ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm)); -/* - All dynamically allocated data structures for this stream are freed. - This function discards any unprocessed input and does not flush any pending - output. - - deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the - stream state was inconsistent, Z_DATA_ERROR if the stream was freed - prematurely (some input or output was discarded). In the error case, msg - may be set but then points to a static string (which must not be - deallocated). -*/ - - -/* -ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm)); - - Initializes the internal stream state for decompression. The fields - next_in, avail_in, zalloc, zfree and opaque must be initialized before by - the caller. If next_in is not Z_NULL and avail_in is large enough (the - exact value depends on the compression method), inflateInit determines the - compression method from the zlib header and allocates all data structures - accordingly; otherwise the allocation will be deferred to the first call of - inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to - use default allocation functions. - - inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_VERSION_ERROR if the zlib library version is incompatible with the - version assumed by the caller, or Z_STREAM_ERROR if the parameters are - invalid, such as a null pointer to the structure. msg is set to null if - there is no error message. inflateInit does not perform any decompression - apart from possibly reading the zlib header if present: actual decompression - will be done by inflate(). (So next_in and avail_in may be modified, but - next_out and avail_out are unused and unchanged.) The current implementation - of inflateInit() does not process any header information -- that is deferred - until inflate() is called. -*/ - - -ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); -/* - inflate decompresses as much data as possible, and stops when the input - buffer becomes empty or the output buffer becomes full. It may introduce - some output latency (reading input without producing any output) except when - forced to flush. - - The detailed semantics are as follows. inflate performs one or both of the - following actions: - - - Decompress more input starting at next_in and update next_in and avail_in - accordingly. If not all input can be processed (because there is not - enough room in the output buffer), next_in is updated and processing will - resume at this point for the next call of inflate(). - - - Provide more output starting at next_out and update next_out and avail_out - accordingly. inflate() provides as much output as possible, until there is - no more input data or no more space in the output buffer (see below about - the flush parameter). - - Before the call of inflate(), the application should ensure that at least - one of the actions is possible, by providing more input and/or consuming more - output, and updating the next_* and avail_* values accordingly. The - application can consume the uncompressed output when it wants, for example - when the output buffer is full (avail_out == 0), or after each call of - inflate(). If inflate returns Z_OK and with zero avail_out, it must be - called again after making room in the output buffer because there might be - more output pending. - - The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH, Z_FINISH, - Z_BLOCK, or Z_TREES. Z_SYNC_FLUSH requests that inflate() flush as much - output as possible to the output buffer. Z_BLOCK requests that inflate() - stop if and when it gets to the next deflate block boundary. When decoding - the zlib or gzip format, this will cause inflate() to return immediately - after the header and before the first block. When doing a raw inflate, - inflate() will go ahead and process the first block, and will return when it - gets to the end of that block, or when it runs out of data. - - The Z_BLOCK option assists in appending to or combining deflate streams. - Also to assist in this, on return inflate() will set strm->data_type to the - number of unused bits in the last byte taken from strm->next_in, plus 64 if - inflate() is currently decoding the last block in the deflate stream, plus - 128 if inflate() returned immediately after decoding an end-of-block code or - decoding the complete header up to just before the first byte of the deflate - stream. The end-of-block will not be indicated until all of the uncompressed - data from that block has been written to strm->next_out. The number of - unused bits may in general be greater than seven, except when bit 7 of - data_type is set, in which case the number of unused bits will be less than - eight. data_type is set as noted here every time inflate() returns for all - flush options, and so can be used to determine the amount of currently - consumed input in bits. - - The Z_TREES option behaves as Z_BLOCK does, but it also returns when the - end of each deflate block header is reached, before any actual data in that - block is decoded. This allows the caller to determine the length of the - deflate block header for later use in random access within a deflate block. - 256 is added to the value of strm->data_type when inflate() returns - immediately after reaching the end of the deflate block header. - - inflate() should normally be called until it returns Z_STREAM_END or an - error. However if all decompression is to be performed in a single step (a - single call of inflate), the parameter flush should be set to Z_FINISH. In - this case all pending input is processed and all pending output is flushed; - avail_out must be large enough to hold all the uncompressed data. (The size - of the uncompressed data may have been saved by the compressor for this - purpose.) The next operation on this stream must be inflateEnd to deallocate - the decompression state. The use of Z_FINISH is never required, but can be - used to inform inflate that a faster approach may be used for the single - inflate() call. - - In this implementation, inflate() always flushes as much output as - possible to the output buffer, and always uses the faster approach on the - first call. So the only effect of the flush parameter in this implementation - is on the return value of inflate(), as noted below, or when it returns early - because Z_BLOCK or Z_TREES is used. - - If a preset dictionary is needed after this call (see inflateSetDictionary - below), inflate sets strm->adler to the adler32 checksum of the dictionary - chosen by the compressor and returns Z_NEED_DICT; otherwise it sets - strm->adler to the adler32 checksum of all output produced so far (that is, - total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described - below. At the end of the stream, inflate() checks that its computed adler32 - checksum is equal to that saved by the compressor and returns Z_STREAM_END - only if the checksum is correct. - - inflate() can decompress and check either zlib-wrapped or gzip-wrapped - deflate data. The header type is detected automatically, if requested when - initializing with inflateInit2(). Any information contained in the gzip - header is not retained, so applications that need that information should - instead use raw inflate, see inflateInit2() below, or inflateBack() and - perform their own processing of the gzip header and trailer. - - inflate() returns Z_OK if some progress has been made (more input processed - or more output produced), Z_STREAM_END if the end of the compressed data has - been reached and all uncompressed output has been produced, Z_NEED_DICT if a - preset dictionary is needed at this point, Z_DATA_ERROR if the input data was - corrupted (input stream not conforming to the zlib format or incorrect check - value), Z_STREAM_ERROR if the stream structure was inconsistent (for example - next_in or next_out was Z_NULL), Z_MEM_ERROR if there was not enough memory, - Z_BUF_ERROR if no progress is possible or if there was not enough room in the - output buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and - inflate() can be called again with more input and more output space to - continue decompressing. If Z_DATA_ERROR is returned, the application may - then call inflateSync() to look for a good compression block if a partial - recovery of the data is desired. -*/ - - -ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm)); -/* - All dynamically allocated data structures for this stream are freed. - This function discards any unprocessed input and does not flush any pending - output. - - inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state - was inconsistent. In the error case, msg may be set but then points to a - static string (which must not be deallocated). -*/ - - - /* Advanced functions */ - -/* - The following functions are needed only in some special applications. -*/ - -/* -ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm, - int level, - int method, - int windowBits, - int memLevel, - int strategy)); - - This is another version of deflateInit with more compression options. The - fields next_in, zalloc, zfree and opaque must be initialized before by the - caller. - - The method parameter is the compression method. It must be Z_DEFLATED in - this version of the library. - - The windowBits parameter is the base two logarithm of the window size - (the size of the history buffer). It should be in the range 8..15 for this - version of the library. Larger values of this parameter result in better - compression at the expense of memory usage. The default value is 15 if - deflateInit is used instead. - - windowBits can also be -8..-15 for raw deflate. In this case, -windowBits - determines the window size. deflate() will then generate raw deflate data - with no zlib header or trailer, and will not compute an adler32 check value. - - windowBits can also be greater than 15 for optional gzip encoding. Add - 16 to windowBits to write a simple gzip header and trailer around the - compressed data instead of a zlib wrapper. The gzip header will have no - file name, no extra data, no comment, no modification time (set to zero), no - header crc, and the operating system will be set to 255 (unknown). If a - gzip stream is being written, strm->adler is a crc32 instead of an adler32. - - The memLevel parameter specifies how much memory should be allocated - for the internal compression state. memLevel=1 uses minimum memory but is - slow and reduces compression ratio; memLevel=9 uses maximum memory for - optimal speed. The default value is 8. See zconf.h for total memory usage - as a function of windowBits and memLevel. - - The strategy parameter is used to tune the compression algorithm. Use the - value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a - filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no - string match), or Z_RLE to limit match distances to one (run-length - encoding). Filtered data consists mostly of small values with a somewhat - random distribution. In this case, the compression algorithm is tuned to - compress them better. The effect of Z_FILTERED is to force more Huffman - coding and less string matching; it is somewhat intermediate between - Z_DEFAULT_STRATEGY and Z_HUFFMAN_ONLY. Z_RLE is designed to be almost as - fast as Z_HUFFMAN_ONLY, but give better compression for PNG image data. The - strategy parameter only affects the compression ratio but not the - correctness of the compressed output even if it is not set appropriately. - Z_FIXED prevents the use of dynamic Huffman codes, allowing for a simpler - decoder for special applications. - - deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_STREAM_ERROR if any parameter is invalid (such as an invalid - method), or Z_VERSION_ERROR if the zlib library version (zlib_version) is - incompatible with the version assumed by the caller (ZLIB_VERSION). msg is - set to null if there is no error message. deflateInit2 does not perform any - compression: this will be done by deflate(). -*/ - -ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, - const Bytef *dictionary, - uInt dictLength)); -/* - Initializes the compression dictionary from the given byte sequence - without producing any compressed output. This function must be called - immediately after deflateInit, deflateInit2 or deflateReset, before any call - of deflate. The compressor and decompressor must use exactly the same - dictionary (see inflateSetDictionary). - - The dictionary should consist of strings (byte sequences) that are likely - to be encountered later in the data to be compressed, with the most commonly - used strings preferably put towards the end of the dictionary. Using a - dictionary is most useful when the data to be compressed is short and can be - predicted with good accuracy; the data can then be compressed better than - with the default empty dictionary. - - Depending on the size of the compression data structures selected by - deflateInit or deflateInit2, a part of the dictionary may in effect be - discarded, for example if the dictionary is larger than the window size - provided in deflateInit or deflateInit2. Thus the strings most likely to be - useful should be put at the end of the dictionary, not at the front. In - addition, the current implementation of deflate will use at most the window - size minus 262 bytes of the provided dictionary. - - Upon return of this function, strm->adler is set to the adler32 value - of the dictionary; the decompressor may later use this value to determine - which dictionary has been used by the compressor. (The adler32 value - applies to the whole dictionary even if only a subset of the dictionary is - actually used by the compressor.) If a raw deflate was requested, then the - adler32 value is not computed and strm->adler is not set. - - deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a - parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is - inconsistent (for example if deflate has already been called for this stream - or if the compression method is bsort). deflateSetDictionary does not - perform any compression: this will be done by deflate(). -*/ - -ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest, - z_streamp source)); -/* - Sets the destination stream as a complete copy of the source stream. - - This function can be useful when several compression strategies will be - tried, for example when there are several ways of pre-processing the input - data with a filter. The streams that will be discarded should then be freed - by calling deflateEnd. Note that deflateCopy duplicates the internal - compression state which can be quite large, so this strategy is slow and can - consume lots of memory. - - deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_STREAM_ERROR if the source stream state was inconsistent - (such as zalloc being Z_NULL). msg is left unchanged in both source and - destination. -*/ - -ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm)); -/* - This function is equivalent to deflateEnd followed by deflateInit, - but does not free and reallocate all the internal compression state. The - stream will keep the same compression level and any other attributes that - may have been set by deflateInit2. - - deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent (such as zalloc or state being Z_NULL). -*/ - -ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm, - int level, - int strategy)); -/* - Dynamically update the compression level and compression strategy. The - interpretation of level and strategy is as in deflateInit2. This can be - used to switch between compression and straight copy of the input data, or - to switch to a different kind of input data requiring a different strategy. - If the compression level is changed, the input available so far is - compressed with the old level (and may be flushed); the new level will take - effect only at the next call of deflate(). - - Before the call of deflateParams, the stream state must be set as for - a call of deflate(), since the currently available input may have to be - compressed and flushed. In particular, strm->avail_out must be non-zero. - - deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source - stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR if - strm->avail_out was zero. -*/ - -ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm, - int good_length, - int max_lazy, - int nice_length, - int max_chain)); -/* - Fine tune deflate's internal compression parameters. This should only be - used by someone who understands the algorithm used by zlib's deflate for - searching for the best matching string, and even then only by the most - fanatic optimizer trying to squeeze out the last compressed bit for their - specific input data. Read the deflate.c source code for the meaning of the - max_lazy, good_length, nice_length, and max_chain parameters. - - deflateTune() can be called after deflateInit() or deflateInit2(), and - returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream. - */ - -ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm, - uLong sourceLen)); -/* - deflateBound() returns an upper bound on the compressed size after - deflation of sourceLen bytes. It must be called after deflateInit() or - deflateInit2(), and after deflateSetHeader(), if used. This would be used - to allocate an output buffer for deflation in a single pass, and so would be - called before deflate(). -*/ - -ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm, - int bits, - int value)); -/* - deflatePrime() inserts bits in the deflate output stream. The intent - is that this function is used to start off the deflate output with the bits - leftover from a previous deflate stream when appending to it. As such, this - function can only be used for raw deflate, and must be used before the first - deflate() call after a deflateInit2() or deflateReset(). bits must be less - than or equal to 16, and that many of the least significant bits of value - will be inserted in the output. - - deflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent. -*/ - -ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm, - gz_headerp head)); -/* - deflateSetHeader() provides gzip header information for when a gzip - stream is requested by deflateInit2(). deflateSetHeader() may be called - after deflateInit2() or deflateReset() and before the first call of - deflate(). The text, time, os, extra field, name, and comment information - in the provided gz_header structure are written to the gzip header (xflag is - ignored -- the extra flags are set according to the compression level). The - caller must assure that, if not Z_NULL, name and comment are terminated with - a zero byte, and that if extra is not Z_NULL, that extra_len bytes are - available there. If hcrc is true, a gzip header crc is included. Note that - the current versions of the command-line version of gzip (up through version - 1.3.x) do not support header crc's, and will report that it is a "multi-part - gzip file" and give up. - - If deflateSetHeader is not used, the default gzip header has text false, - the time set to zero, and os set to 255, with no extra, name, or comment - fields. The gzip header is returned to the default state by deflateReset(). - - deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent. -*/ - -/* -ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm, - int windowBits)); - - This is another version of inflateInit with an extra parameter. The - fields next_in, avail_in, zalloc, zfree and opaque must be initialized - before by the caller. - - The windowBits parameter is the base two logarithm of the maximum window - size (the size of the history buffer). It should be in the range 8..15 for - this version of the library. The default value is 15 if inflateInit is used - instead. windowBits must be greater than or equal to the windowBits value - provided to deflateInit2() while compressing, or it must be equal to 15 if - deflateInit2() was not used. If a compressed stream with a larger window - size is given as input, inflate() will return with the error code - Z_DATA_ERROR instead of trying to allocate a larger window. - - windowBits can also be zero to request that inflate use the window size in - the zlib header of the compressed stream. - - windowBits can also be -8..-15 for raw inflate. In this case, -windowBits - determines the window size. inflate() will then process raw deflate data, - not looking for a zlib or gzip header, not generating a check value, and not - looking for any check values for comparison at the end of the stream. This - is for use with other formats that use the deflate compressed data format - such as zip. Those formats provide their own check values. If a custom - format is developed using the raw deflate format for compressed data, it is - recommended that a check value such as an adler32 or a crc32 be applied to - the uncompressed data as is done in the zlib, gzip, and zip formats. For - most applications, the zlib format should be used as is. Note that comments - above on the use in deflateInit2() applies to the magnitude of windowBits. - - windowBits can also be greater than 15 for optional gzip decoding. Add - 32 to windowBits to enable zlib and gzip decoding with automatic header - detection, or add 16 to decode only the gzip format (the zlib format will - return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is a - crc32 instead of an adler32. - - inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_VERSION_ERROR if the zlib library version is incompatible with the - version assumed by the caller, or Z_STREAM_ERROR if the parameters are - invalid, such as a null pointer to the structure. msg is set to null if - there is no error message. inflateInit2 does not perform any decompression - apart from possibly reading the zlib header if present: actual decompression - will be done by inflate(). (So next_in and avail_in may be modified, but - next_out and avail_out are unused and unchanged.) The current implementation - of inflateInit2() does not process any header information -- that is - deferred until inflate() is called. -*/ - -ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm, - const Bytef *dictionary, - uInt dictLength)); -/* - Initializes the decompression dictionary from the given uncompressed byte - sequence. This function must be called immediately after a call of inflate, - if that call returned Z_NEED_DICT. The dictionary chosen by the compressor - can be determined from the adler32 value returned by that call of inflate. - The compressor and decompressor must use exactly the same dictionary (see - deflateSetDictionary). For raw inflate, this function can be called - immediately after inflateInit2() or inflateReset() and before any call of - inflate() to set the dictionary. The application must insure that the - dictionary that was used for compression is provided. - - inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a - parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is - inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the - expected one (incorrect adler32 value). inflateSetDictionary does not - perform any decompression: this will be done by subsequent calls of - inflate(). -*/ - -ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm)); -/* - Skips invalid compressed data until a full flush point (see above the - description of deflate with Z_FULL_FLUSH) can be found, or until all - available input is skipped. No output is provided. - - inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR - if no more input was provided, Z_DATA_ERROR if no flush point has been - found, or Z_STREAM_ERROR if the stream structure was inconsistent. In the - success case, the application may save the current current value of total_in - which indicates where valid compressed data was found. In the error case, - the application may repeatedly call inflateSync, providing more input each - time, until success or end of the input data. -*/ - -ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest, - z_streamp source)); -/* - Sets the destination stream as a complete copy of the source stream. - - This function can be useful when randomly accessing a large stream. The - first pass through the stream can periodically record the inflate state, - allowing restarting inflate at those points when randomly accessing the - stream. - - inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_STREAM_ERROR if the source stream state was inconsistent - (such as zalloc being Z_NULL). msg is left unchanged in both source and - destination. -*/ - -ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm)); -/* - This function is equivalent to inflateEnd followed by inflateInit, - but does not free and reallocate all the internal decompression state. The - stream will keep attributes that may have been set by inflateInit2. - - inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent (such as zalloc or state being Z_NULL). -*/ - -ZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm, - int windowBits)); -/* - This function is the same as inflateReset, but it also permits changing - the wrap and window size requests. The windowBits parameter is interpreted - the same as it is for inflateInit2. - - inflateReset2 returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent (such as zalloc or state being Z_NULL), or if - the windowBits parameter is invalid. -*/ - -ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm, - int bits, - int value)); -/* - This function inserts bits in the inflate input stream. The intent is - that this function is used to start inflating at a bit position in the - middle of a byte. The provided bits will be used before any bytes are used - from next_in. This function should only be used with raw inflate, and - should be used before the first inflate() call after inflateInit2() or - inflateReset(). bits must be less than or equal to 16, and that many of the - least significant bits of value will be inserted in the input. - - If bits is negative, then the input stream bit buffer is emptied. Then - inflatePrime() can be called again to put bits in the buffer. This is used - to clear out bits leftover after feeding inflate a block description prior - to feeding inflate codes. - - inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent. -*/ - -ZEXTERN long ZEXPORT inflateMark OF((z_streamp strm)); -/* - This function returns two values, one in the lower 16 bits of the return - value, and the other in the remaining upper bits, obtained by shifting the - return value down 16 bits. If the upper value is -1 and the lower value is - zero, then inflate() is currently decoding information outside of a block. - If the upper value is -1 and the lower value is non-zero, then inflate is in - the middle of a stored block, with the lower value equaling the number of - bytes from the input remaining to copy. If the upper value is not -1, then - it is the number of bits back from the current bit position in the input of - the code (literal or length/distance pair) currently being processed. In - that case the lower value is the number of bytes already emitted for that - code. - - A code is being processed if inflate is waiting for more input to complete - decoding of the code, or if it has completed decoding but is waiting for - more output space to write the literal or match data. - - inflateMark() is used to mark locations in the input data for random - access, which may be at bit positions, and to note those cases where the - output of a code may span boundaries of random access blocks. The current - location in the input stream can be determined from avail_in and data_type - as noted in the description for the Z_BLOCK flush parameter for inflate. - - inflateMark returns the value noted above or -1 << 16 if the provided - source stream state was inconsistent. -*/ - -ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm, - gz_headerp head)); -/* - inflateGetHeader() requests that gzip header information be stored in the - provided gz_header structure. inflateGetHeader() may be called after - inflateInit2() or inflateReset(), and before the first call of inflate(). - As inflate() processes the gzip stream, head->done is zero until the header - is completed, at which time head->done is set to one. If a zlib stream is - being decoded, then head->done is set to -1 to indicate that there will be - no gzip header information forthcoming. Note that Z_BLOCK or Z_TREES can be - used to force inflate() to return immediately after header processing is - complete and before any actual data is decompressed. - - The text, time, xflags, and os fields are filled in with the gzip header - contents. hcrc is set to true if there is a header CRC. (The header CRC - was valid if done is set to one.) If extra is not Z_NULL, then extra_max - contains the maximum number of bytes to write to extra. Once done is true, - extra_len contains the actual extra field length, and extra contains the - extra field, or that field truncated if extra_max is less than extra_len. - If name is not Z_NULL, then up to name_max characters are written there, - terminated with a zero unless the length is greater than name_max. If - comment is not Z_NULL, then up to comm_max characters are written there, - terminated with a zero unless the length is greater than comm_max. When any - of extra, name, or comment are not Z_NULL and the respective field is not - present in the header, then that field is set to Z_NULL to signal its - absence. This allows the use of deflateSetHeader() with the returned - structure to duplicate the header. However if those fields are set to - allocated memory, then the application will need to save those pointers - elsewhere so that they can be eventually freed. - - If inflateGetHeader is not used, then the header information is simply - discarded. The header is always checked for validity, including the header - CRC if present. inflateReset() will reset the process to discard the header - information. The application would need to call inflateGetHeader() again to - retrieve the header from the next gzip stream. - - inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent. -*/ - -/* -ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits, - unsigned char FAR *window)); - - Initialize the internal stream state for decompression using inflateBack() - calls. The fields zalloc, zfree and opaque in strm must be initialized - before the call. If zalloc and zfree are Z_NULL, then the default library- - derived memory allocation routines are used. windowBits is the base two - logarithm of the window size, in the range 8..15. window is a caller - supplied buffer of that size. Except for special applications where it is - assured that deflate was used with small window sizes, windowBits must be 15 - and a 32K byte window must be supplied to be able to decompress general - deflate streams. - - See inflateBack() for the usage of these routines. - - inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of - the paramaters are invalid, Z_MEM_ERROR if the internal state could not be - allocated, or Z_VERSION_ERROR if the version of the library does not match - the version of the header file. -*/ - -typedef unsigned (*in_func) OF((void FAR *, unsigned char FAR * FAR *)); -typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned)); - -ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm, - in_func in, void FAR *in_desc, - out_func out, void FAR *out_desc)); -/* - inflateBack() does a raw inflate with a single call using a call-back - interface for input and output. This is more efficient than inflate() for - file i/o applications in that it avoids copying between the output and the - sliding window by simply making the window itself the output buffer. This - function trusts the application to not change the output buffer passed by - the output function, at least until inflateBack() returns. - - inflateBackInit() must be called first to allocate the internal state - and to initialize the state with the user-provided window buffer. - inflateBack() may then be used multiple times to inflate a complete, raw - deflate stream with each call. inflateBackEnd() is then called to free the - allocated state. - - A raw deflate stream is one with no zlib or gzip header or trailer. - This routine would normally be used in a utility that reads zip or gzip - files and writes out uncompressed files. The utility would decode the - header and process the trailer on its own, hence this routine expects only - the raw deflate stream to decompress. This is different from the normal - behavior of inflate(), which expects either a zlib or gzip header and - trailer around the deflate stream. - - inflateBack() uses two subroutines supplied by the caller that are then - called by inflateBack() for input and output. inflateBack() calls those - routines until it reads a complete deflate stream and writes out all of the - uncompressed data, or until it encounters an error. The function's - parameters and return types are defined above in the in_func and out_func - typedefs. inflateBack() will call in(in_desc, &buf) which should return the - number of bytes of provided input, and a pointer to that input in buf. If - there is no input available, in() must return zero--buf is ignored in that - case--and inflateBack() will return a buffer error. inflateBack() will call - out(out_desc, buf, len) to write the uncompressed data buf[0..len-1]. out() - should return zero on success, or non-zero on failure. If out() returns - non-zero, inflateBack() will return with an error. Neither in() nor out() - are permitted to change the contents of the window provided to - inflateBackInit(), which is also the buffer that out() uses to write from. - The length written by out() will be at most the window size. Any non-zero - amount of input may be provided by in(). - - For convenience, inflateBack() can be provided input on the first call by - setting strm->next_in and strm->avail_in. If that input is exhausted, then - in() will be called. Therefore strm->next_in must be initialized before - calling inflateBack(). If strm->next_in is Z_NULL, then in() will be called - immediately for input. If strm->next_in is not Z_NULL, then strm->avail_in - must also be initialized, and then if strm->avail_in is not zero, input will - initially be taken from strm->next_in[0 .. strm->avail_in - 1]. - - The in_desc and out_desc parameters of inflateBack() is passed as the - first parameter of in() and out() respectively when they are called. These - descriptors can be optionally used to pass any information that the caller- - supplied in() and out() functions need to do their job. - - On return, inflateBack() will set strm->next_in and strm->avail_in to - pass back any unused input that was provided by the last in() call. The - return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR - if in() or out() returned an error, Z_DATA_ERROR if there was a format error - in the deflate stream (in which case strm->msg is set to indicate the nature - of the error), or Z_STREAM_ERROR if the stream was not properly initialized. - In the case of Z_BUF_ERROR, an input or output error can be distinguished - using strm->next_in which will be Z_NULL only if in() returned an error. If - strm->next_in is not Z_NULL, then the Z_BUF_ERROR was due to out() returning - non-zero. (in() will always be called before out(), so strm->next_in is - assured to be defined if out() returns non-zero.) Note that inflateBack() - cannot return Z_OK. -*/ - -ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm)); -/* - All memory allocated by inflateBackInit() is freed. - - inflateBackEnd() returns Z_OK on success, or Z_STREAM_ERROR if the stream - state was inconsistent. -*/ - -ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void)); -/* Return flags indicating compile-time options. - - Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other: - 1.0: size of uInt - 3.2: size of uLong - 5.4: size of voidpf (pointer) - 7.6: size of z_off_t - - Compiler, assembler, and debug options: - 8: DEBUG - 9: ASMV or ASMINF -- use ASM code - 10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention - 11: 0 (reserved) - - One-time table building (smaller code, but not thread-safe if true): - 12: BUILDFIXED -- build static block decoding tables when needed - 13: DYNAMIC_CRC_TABLE -- build CRC calculation tables when needed - 14,15: 0 (reserved) - - Library content (indicates missing functionality): - 16: NO_GZCOMPRESS -- gz* functions cannot compress (to avoid linking - deflate code when not needed) - 17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect - and decode gzip streams (to avoid linking crc code) - 18-19: 0 (reserved) - - Operation variations (changes in library functionality): - 20: PKZIP_BUG_WORKAROUND -- slightly more permissive inflate - 21: FASTEST -- deflate algorithm with only one, lowest compression level - 22,23: 0 (reserved) - - The sprintf variant used by gzprintf (zero is best): - 24: 0 = vs*, 1 = s* -- 1 means limited to 20 arguments after the format - 25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure! - 26: 0 = returns value, 1 = void -- 1 means inferred string length returned - - Remainder: - 27-31: 0 (reserved) - */ - - - /* utility functions */ - -/* - The following utility functions are implemented on top of the basic - stream-oriented functions. To simplify the interface, some default options - are assumed (compression level and memory usage, standard memory allocation - functions). The source code of these utility functions can be modified if - you need special options. -*/ - -ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong sourceLen)); -/* - Compresses the source buffer into the destination buffer. sourceLen is - the byte length of the source buffer. Upon entry, destLen is the total size - of the destination buffer, which must be at least the value returned by - compressBound(sourceLen). Upon exit, destLen is the actual size of the - compressed buffer. - - compress returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_BUF_ERROR if there was not enough room in the output - buffer. -*/ - -ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong sourceLen, - int level)); -/* - Compresses the source buffer into the destination buffer. The level - parameter has the same meaning as in deflateInit. sourceLen is the byte - length of the source buffer. Upon entry, destLen is the total size of the - destination buffer, which must be at least the value returned by - compressBound(sourceLen). Upon exit, destLen is the actual size of the - compressed buffer. - - compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_BUF_ERROR if there was not enough room in the output buffer, - Z_STREAM_ERROR if the level parameter is invalid. -*/ - -ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen)); -/* - compressBound() returns an upper bound on the compressed size after - compress() or compress2() on sourceLen bytes. It would be used before a - compress() or compress2() call to allocate the destination buffer. -*/ - -ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong sourceLen)); -/* - Decompresses the source buffer into the destination buffer. sourceLen is - the byte length of the source buffer. Upon entry, destLen is the total size - of the destination buffer, which must be large enough to hold the entire - uncompressed data. (The size of the uncompressed data must have been saved - previously by the compressor and transmitted to the decompressor by some - mechanism outside the scope of this compression library.) Upon exit, destLen - is the actual size of the uncompressed buffer. - - uncompress returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_BUF_ERROR if there was not enough room in the output - buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete. -*/ - - - /* gzip file access functions */ - -/* - This library supports reading and writing files in gzip (.gz) format with - an interface similar to that of stdio, using the functions that start with - "gz". The gzip format is different from the zlib format. gzip is a gzip - wrapper, documented in RFC 1952, wrapped around a deflate stream. -*/ - -typedef voidp gzFile; /* opaque gzip file descriptor */ - -/* -ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode)); - - Opens a gzip (.gz) file for reading or writing. The mode parameter is as - in fopen ("rb" or "wb") but can also include a compression level ("wb9") or - a strategy: 'f' for filtered data as in "wb6f", 'h' for Huffman-only - compression as in "wb1h", 'R' for run-length encoding as in "wb1R", or 'F' - for fixed code compression as in "wb9F". (See the description of - deflateInit2 for more information about the strategy parameter.) Also "a" - can be used instead of "w" to request that the gzip stream that will be - written be appended to the file. "+" will result in an error, since reading - and writing to the same gzip file is not supported. - - gzopen can be used to read a file which is not in gzip format; in this - case gzread will directly read from the file without decompression. - - gzopen returns NULL if the file could not be opened, if there was - insufficient memory to allocate the gzFile state, or if an invalid mode was - specified (an 'r', 'w', or 'a' was not provided, or '+' was provided). - errno can be checked to determine if the reason gzopen failed was that the - file could not be opened. -*/ - -ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode)); -/* - gzdopen associates a gzFile with the file descriptor fd. File descriptors - are obtained from calls like open, dup, creat, pipe or fileno (if the file - has been previously opened with fopen). The mode parameter is as in gzopen. - - The next call of gzclose on the returned gzFile will also close the file - descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor - fd. If you want to keep fd open, use fd = dup(fd_keep); gz = gzdopen(fd, - mode);. The duplicated descriptor should be saved to avoid a leak, since - gzdopen does not close fd if it fails. - - gzdopen returns NULL if there was insufficient memory to allocate the - gzFile state, if an invalid mode was specified (an 'r', 'w', or 'a' was not - provided, or '+' was provided), or if fd is -1. The file descriptor is not - used until the next gz* read, write, seek, or close operation, so gzdopen - will not detect if fd is invalid (unless fd is -1). -*/ - -ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size)); -/* - Set the internal buffer size used by this library's functions. The - default buffer size is 8192 bytes. This function must be called after - gzopen() or gzdopen(), and before any other calls that read or write the - file. The buffer memory allocation is always deferred to the first read or - write. Two buffers are allocated, either both of the specified size when - writing, or one of the specified size and the other twice that size when - reading. A larger buffer size of, for example, 64K or 128K bytes will - noticeably increase the speed of decompression (reading). - - The new buffer size also affects the maximum length for gzprintf(). - - gzbuffer() returns 0 on success, or -1 on failure, such as being called - too late. -*/ - -ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy)); -/* - Dynamically update the compression level or strategy. See the description - of deflateInit2 for the meaning of these parameters. - - gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not - opened for writing. -*/ - -ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len)); -/* - Reads the given number of uncompressed bytes from the compressed file. If - the input file was not in gzip format, gzread copies the given number of - bytes into the buffer. - - After reaching the end of a gzip stream in the input, gzread will continue - to read, looking for another gzip stream, or failing that, reading the rest - of the input file directly without decompression. The entire input file - will be read if gzread is called until it returns less than the requested - len. - - gzread returns the number of uncompressed bytes actually read, less than - len for end of file, or -1 for error. -*/ - -ZEXTERN int ZEXPORT gzwrite OF((gzFile file, - voidpc buf, unsigned len)); -/* - Writes the given number of uncompressed bytes into the compressed file. - gzwrite returns the number of uncompressed bytes written or 0 in case of - error. -*/ - -ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...)); -/* - Converts, formats, and writes the arguments to the compressed file under - control of the format string, as in fprintf. gzprintf returns the number of - uncompressed bytes actually written, or 0 in case of error. The number of - uncompressed bytes written is limited to 8191, or one less than the buffer - size given to gzbuffer(). The caller should assure that this limit is not - exceeded. If it is exceeded, then gzprintf() will return an error (0) with - nothing written. In this case, there may also be a buffer overflow with - unpredictable consequences, which is possible only if zlib was compiled with - the insecure functions sprintf() or vsprintf() because the secure snprintf() - or vsnprintf() functions were not available. This can be determined using - zlibCompileFlags(). -*/ - -ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s)); -/* - Writes the given null-terminated string to the compressed file, excluding - the terminating null character. - - gzputs returns the number of characters written, or -1 in case of error. -*/ - -ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len)); -/* - Reads bytes from the compressed file until len-1 characters are read, or a - newline character is read and transferred to buf, or an end-of-file - condition is encountered. If any characters are read or if len == 1, the - string is terminated with a null character. If no characters are read due - to an end-of-file or len < 1, then the buffer is left untouched. - - gzgets returns buf which is a null-terminated string, or it returns NULL - for end-of-file or in case of error. If there was an error, the contents at - buf are indeterminate. -*/ - -ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c)); -/* - Writes c, converted to an unsigned char, into the compressed file. gzputc - returns the value that was written, or -1 in case of error. -*/ - -ZEXTERN int ZEXPORT gzgetc OF((gzFile file)); -/* - Reads one byte from the compressed file. gzgetc returns this byte or -1 - in case of end of file or error. -*/ - -ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file)); -/* - Push one character back onto the stream to be read as the first character - on the next read. At least one character of push-back is allowed. - gzungetc() returns the character pushed, or -1 on failure. gzungetc() will - fail if c is -1, and may fail if a character has been pushed but not read - yet. If gzungetc is used immediately after gzopen or gzdopen, at least the - output buffer size of pushed characters is allowed. (See gzbuffer above.) - The pushed character will be discarded if the stream is repositioned with - gzseek() or gzrewind(). -*/ - -ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush)); -/* - Flushes all pending output into the compressed file. The parameter flush - is as in the deflate() function. The return value is the zlib error number - (see function gzerror below). gzflush is only permitted when writing. - - If the flush parameter is Z_FINISH, the remaining data is written and the - gzip stream is completed in the output. If gzwrite() is called again, a new - gzip stream will be started in the output. gzread() is able to read such - concatented gzip streams. - - gzflush should be called only when strictly necessary because it will - degrade compression if called too often. -*/ - -/* -ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file, - z_off_t offset, int whence)); - - Sets the starting position for the next gzread or gzwrite on the given - compressed file. The offset represents a number of bytes in the - uncompressed data stream. The whence parameter is defined as in lseek(2); - the value SEEK_END is not supported. - - If the file is opened for reading, this function is emulated but can be - extremely slow. If the file is opened for writing, only forward seeks are - supported; gzseek then compresses a sequence of zeroes up to the new - starting position. - - gzseek returns the resulting offset location as measured in bytes from - the beginning of the uncompressed stream, or -1 in case of error, in - particular if the file is opened for writing and the new starting position - would be before the current position. -*/ - -ZEXTERN int ZEXPORT gzrewind OF((gzFile file)); -/* - Rewinds the given file. This function is supported only for reading. - - gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET) -*/ - -/* -ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file)); - - Returns the starting position for the next gzread or gzwrite on the given - compressed file. This position represents a number of bytes in the - uncompressed data stream, and is zero when starting, even if appending or - reading a gzip stream from the middle of a file using gzdopen(). - - gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR) -*/ - -/* -ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file)); - - Returns the current offset in the file being read or written. This offset - includes the count of bytes that precede the gzip stream, for example when - appending or when using gzdopen() for reading. When reading, the offset - does not include as yet unused buffered input. This information can be used - for a progress indicator. On error, gzoffset() returns -1. -*/ - -ZEXTERN int ZEXPORT gzeof OF((gzFile file)); -/* - Returns true (1) if the end-of-file indicator has been set while reading, - false (0) otherwise. Note that the end-of-file indicator is set only if the - read tried to go past the end of the input, but came up short. Therefore, - just like feof(), gzeof() may return false even if there is no more data to - read, in the event that the last read request was for the exact number of - bytes remaining in the input file. This will happen if the input file size - is an exact multiple of the buffer size. - - If gzeof() returns true, then the read functions will return no more data, - unless the end-of-file indicator is reset by gzclearerr() and the input file - has grown since the previous end of file was detected. -*/ - -ZEXTERN int ZEXPORT gzdirect OF((gzFile file)); -/* - Returns true (1) if file is being copied directly while reading, or false - (0) if file is a gzip stream being decompressed. This state can change from - false to true while reading the input file if the end of a gzip stream is - reached, but is followed by data that is not another gzip stream. - - If the input file is empty, gzdirect() will return true, since the input - does not contain a gzip stream. - - If gzdirect() is used immediately after gzopen() or gzdopen() it will - cause buffers to be allocated to allow reading the file to determine if it - is a gzip file. Therefore if gzbuffer() is used, it should be called before - gzdirect(). -*/ - -ZEXTERN int ZEXPORT gzclose OF((gzFile file)); -/* - Flushes all pending output if necessary, closes the compressed file and - deallocates the (de)compression state. Note that once file is closed, you - cannot call gzerror with file, since its structures have been deallocated. - gzclose must not be called more than once on the same file, just as free - must not be called more than once on the same allocation. - - gzclose will return Z_STREAM_ERROR if file is not valid, Z_ERRNO on a - file operation error, or Z_OK on success. -*/ - -ZEXTERN int ZEXPORT gzclose_r OF((gzFile file)); -ZEXTERN int ZEXPORT gzclose_w OF((gzFile file)); -/* - Same as gzclose(), but gzclose_r() is only for use when reading, and - gzclose_w() is only for use when writing or appending. The advantage to - using these instead of gzclose() is that they avoid linking in zlib - compression or decompression code that is not used when only reading or only - writing respectively. If gzclose() is used, then both compression and - decompression code will be included the application when linking to a static - zlib library. -*/ - -ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum)); -/* - Returns the error message for the last error which occurred on the given - compressed file. errnum is set to zlib error number. If an error occurred - in the file system and not in the compression library, errnum is set to - Z_ERRNO and the application may consult errno to get the exact error code. - - The application must not modify the returned string. Future calls to - this function may invalidate the previously returned string. If file is - closed, then the string previously returned by gzerror will no longer be - available. - - gzerror() should be used to distinguish errors from end-of-file for those - functions above that do not distinguish those cases in their return values. -*/ - -ZEXTERN void ZEXPORT gzclearerr OF((gzFile file)); -/* - Clears the error and end-of-file flags for file. This is analogous to the - clearerr() function in stdio. This is useful for continuing to read a gzip - file that is being written concurrently. -*/ - - - /* checksum functions */ - -/* - These functions are not related to compression but are exported - anyway because they might be useful in applications using the compression - library. -*/ - -ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len)); -/* - Update a running Adler-32 checksum with the bytes buf[0..len-1] and - return the updated checksum. If buf is Z_NULL, this function returns the - required initial value for the checksum. - - An Adler-32 checksum is almost as reliable as a CRC32 but can be computed - much faster. - - Usage example: - - uLong adler = adler32(0L, Z_NULL, 0); - - while (read_buffer(buffer, length) != EOF) { - adler = adler32(adler, buffer, length); - } - if (adler != original_adler) error(); -*/ - -/* -ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2, - z_off_t len2)); - - Combine two Adler-32 checksums into one. For two sequences of bytes, seq1 - and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for - each, adler1 and adler2. adler32_combine() returns the Adler-32 checksum of - seq1 and seq2 concatenated, requiring only adler1, adler2, and len2. -*/ - -ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len)); -/* - Update a running CRC-32 with the bytes buf[0..len-1] and return the - updated CRC-32. If buf is Z_NULL, this function returns the required - initial value for the for the crc. Pre- and post-conditioning (one's - complement) is performed within this function so it shouldn't be done by the - application. - - Usage example: - - uLong crc = crc32(0L, Z_NULL, 0); - - while (read_buffer(buffer, length) != EOF) { - crc = crc32(crc, buffer, length); - } - if (crc != original_crc) error(); -*/ - -/* -ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2)); - - Combine two CRC-32 check values into one. For two sequences of bytes, - seq1 and seq2 with lengths len1 and len2, CRC-32 check values were - calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32 - check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and - len2. -*/ - - - /* various hacks, don't look :) */ - -/* deflateInit and inflateInit are macros to allow checking the zlib version - * and the compiler's view of z_stream: - */ -ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level, - const char *version, int stream_size)); -ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm, - const char *version, int stream_size)); -ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method, - int windowBits, int memLevel, - int strategy, const char *version, - int stream_size)); -ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits, - const char *version, int stream_size)); -ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits, - unsigned char FAR *window, - const char *version, - int stream_size)); -#define deflateInit(strm, level) \ - deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream)) -#define inflateInit(strm) \ - inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream)) -#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ - deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ - (strategy), ZLIB_VERSION, sizeof(z_stream)) -#define inflateInit2(strm, windowBits) \ - inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream)) -#define inflateBackInit(strm, windowBits, window) \ - inflateBackInit_((strm), (windowBits), (window), \ - ZLIB_VERSION, sizeof(z_stream)) - -/* provide 64-bit offset functions if _LARGEFILE64_SOURCE defined, and/or - * change the regular functions to 64 bits if _FILE_OFFSET_BITS is 64 (if - * both are true, the application gets the *64 functions, and the regular - * functions are changed to 64 bits) -- in case these are set on systems - * without large file support, _LFS64_LARGEFILE must also be true - */ -#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0 - ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); - ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int)); - ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile)); - ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile)); - ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off64_t)); - ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t)); -#endif - -#if !defined(ZLIB_INTERNAL) && _FILE_OFFSET_BITS-0 == 64 && _LFS64_LARGEFILE-0 -# define gzopen gzopen64 -# define gzseek gzseek64 -# define gztell gztell64 -# define gzoffset gzoffset64 -# define adler32_combine adler32_combine64 -# define crc32_combine crc32_combine64 -# ifndef _LARGEFILE64_SOURCE - ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); - ZEXTERN z_off_t ZEXPORT gzseek64 OF((gzFile, z_off_t, int)); - ZEXTERN z_off_t ZEXPORT gztell64 OF((gzFile)); - ZEXTERN z_off_t ZEXPORT gzoffset64 OF((gzFile)); - ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t)); - ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t)); -# endif -#else - ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *)); - ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile, z_off_t, int)); - ZEXTERN z_off_t ZEXPORT gztell OF((gzFile)); - ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile)); - ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t)); - ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t)); -#endif - -/* hack for buggy compilers */ -#if !defined(ZUTIL_H) && !defined(NO_DUMMY_DECL) - struct internal_state {int dummy;}; -#endif - -/* undocumented functions */ -ZEXTERN const char * ZEXPORT zError OF((int)); -ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp)); -ZEXTERN const uLongf * ZEXPORT get_crc_table OF((void)); -ZEXTERN int ZEXPORT inflateUndermine OF((z_streamp, int)); - -#ifdef __cplusplus -} -#endif - -#endif /* ZLIB_H */ diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libcares.so.2.0.0 b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libcares.so.2.0.0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libcrypto.so.1.0.0 b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libcrypto.so.1.0.0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libcrypto.so.REMOVED.git-id b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libcrypto.so.REMOVED.git-id deleted file mode 100644 index a6c5766e80..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libcrypto.so.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -81ca983a9939b3f3b2e404e66cb635bff6efce67 \ No newline at end of file diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libcurl.so.4.3.0 b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libcurl.so.4.3.0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libcurl.so.REMOVED.git-id b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libcurl.so.REMOVED.git-id deleted file mode 100644 index ce588fdbc8..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libcurl.so.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -c54dc5d867f4cb4963a852fc04ceed6789b96767 \ No newline at end of file diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libfontconfig.so.1.5.0 b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libfontconfig.so.1.5.0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libfontconfig.so.REMOVED.git-id b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libfontconfig.so.REMOVED.git-id deleted file mode 100644 index 6971c3b5bb..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libfontconfig.so.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -20463c499af04c056a7590604921123c612cbfc8 \ No newline at end of file diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libfreetype.so.6.8.1 b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libfreetype.so.6.8.1 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libfreetype.so.REMOVED.git-id b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libfreetype.so.REMOVED.git-id deleted file mode 100644 index effa3a330a..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libfreetype.so.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -84c7e3ac1bfdc497501cb87d11aaac9c72f31683 \ No newline at end of file diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libidn.so.11.5.44 b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libidn.so.11.5.44 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libidn.so.REMOVED.git-id b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libidn.so.REMOVED.git-id deleted file mode 100644 index e53b7be942..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libidn.so.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -afd4e7984713310f6eea5d2bc01caac899b0af74 \ No newline at end of file diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libjpeg.so.8.0.2 b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libjpeg.so.8.0.2 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libjpeg.so.REMOVED.git-id b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libjpeg.so.REMOVED.git-id deleted file mode 100644 index 1a2caae084..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libjpeg.so.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -9e77dffdcc449cfbdb8e5605fdd426d1a27b7315 \ No newline at end of file diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libpng.so.3.50.0 b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libpng.so.3.50.0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libpng.so.REMOVED.git-id b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libpng.so.REMOVED.git-id deleted file mode 100644 index 86d3809dba..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libpng.so.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -cf825522bd96911a2d4bc9a81e54a732a6ef864c \ No newline at end of file diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libsqlite3.so.0.8.6 b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libsqlite3.so.0.8.6 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libsqlite3.so.REMOVED.git-id b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libsqlite3.so.REMOVED.git-id deleted file mode 100644 index 153432b93a..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libsqlite3.so.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -6cdad8d32fc7db3059ed73079709e37daae5ab32 \ No newline at end of file diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libssl.so.1.0.0 b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libssl.so.1.0.0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libssl.so.REMOVED.git-id b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libssl.so.REMOVED.git-id deleted file mode 100644 index 68ab069bee..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libssl.so.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -508b8ffae1b36bd226db45d16ec1802ffdfb4922 \ No newline at end of file diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libtiff.so.5.1.0 b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libtiff.so.5.1.0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libtiff.so.REMOVED.git-id b/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libtiff.so.REMOVED.git-id deleted file mode 100644 index 134243b974..0000000000 --- a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/lib/libtiff.so.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -5014234cf92547e7e4782326d5b320e46e2f0eb1 \ No newline at end of file diff --git a/cocos2dx/platform/third_party/win32/curl/curlrules.h b/cocos2dx/platform/third_party/win32/curl/curlrules.h deleted file mode 100644 index cbc12fdd29..0000000000 --- a/cocos2dx/platform/third_party/win32/curl/curlrules.h +++ /dev/null @@ -1,261 +0,0 @@ -#ifndef __CURL_CURLRULES_H -#define __CURL_CURLRULES_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - ***************************************************************************/ - -/* ================================================================ */ -/* COMPILE TIME SANITY CHECKS */ -/* ================================================================ */ - -/* - * NOTE 1: - * ------- - * - * All checks done in this file are intentionally placed in a public - * header file which is pulled by curl/curl.h when an application is - * being built using an already built libcurl library. Additionally - * this file is also included and used when building the library. - * - * If compilation fails on this file it is certainly sure that the - * problem is elsewhere. It could be a problem in the curlbuild.h - * header file, or simply that you are using different compilation - * settings than those used to build the library. - * - * Nothing in this file is intended to be modified or adjusted by the - * curl library user nor by the curl library builder. - * - * Do not deactivate any check, these are done to make sure that the - * library is properly built and used. - * - * You can find further help on the libcurl development mailing list: - * http://cool.haxx.se/mailman/listinfo/curl-library/ - * - * NOTE 2 - * ------ - * - * Some of the following compile time checks are based on the fact - * that the dimension of a constant array can not be a negative one. - * In this way if the compile time verification fails, the compilation - * will fail issuing an error. The error description wording is compiler - * dependent but it will be quite similar to one of the following: - * - * "negative subscript or subscript is too large" - * "array must have at least one element" - * "-1 is an illegal array size" - * "size of array is negative" - * - * If you are building an application which tries to use an already - * built libcurl library and you are getting this kind of errors on - * this file, it is a clear indication that there is a mismatch between - * how the library was built and how you are trying to use it for your - * application. Your already compiled or binary library provider is the - * only one who can give you the details you need to properly use it. - */ - -/* - * Verify that some macros are actually defined. - */ - -#ifndef CURL_SIZEOF_LONG -# error "CURL_SIZEOF_LONG definition is missing!" - Error Compilation_aborted_CURL_SIZEOF_LONG_is_missing -#endif - -#ifndef CURL_TYPEOF_CURL_SOCKLEN_T -# error "CURL_TYPEOF_CURL_SOCKLEN_T definition is missing!" - Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_is_missing -#endif - -#ifndef CURL_SIZEOF_CURL_SOCKLEN_T -# error "CURL_SIZEOF_CURL_SOCKLEN_T definition is missing!" - Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_is_missing -#endif - -#ifndef CURL_TYPEOF_CURL_OFF_T -# error "CURL_TYPEOF_CURL_OFF_T definition is missing!" - Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_is_missing -#endif - -#ifndef CURL_FORMAT_CURL_OFF_T -# error "CURL_FORMAT_CURL_OFF_T definition is missing!" - Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_is_missing -#endif - -#ifndef CURL_FORMAT_CURL_OFF_TU -# error "CURL_FORMAT_CURL_OFF_TU definition is missing!" - Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_is_missing -#endif - -#ifndef CURL_FORMAT_OFF_T -# error "CURL_FORMAT_OFF_T definition is missing!" - Error Compilation_aborted_CURL_FORMAT_OFF_T_is_missing -#endif - -#ifndef CURL_SIZEOF_CURL_OFF_T -# error "CURL_SIZEOF_CURL_OFF_T definition is missing!" - Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_is_missing -#endif - -#ifndef CURL_SUFFIX_CURL_OFF_T -# error "CURL_SUFFIX_CURL_OFF_T definition is missing!" - Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_is_missing -#endif - -#ifndef CURL_SUFFIX_CURL_OFF_TU -# error "CURL_SUFFIX_CURL_OFF_TU definition is missing!" - Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_is_missing -#endif - -/* - * Macros private to this header file. - */ - -#define CurlchkszEQ(t, s) sizeof(t) == s ? 1 : -1 - -#define CurlchkszGE(t1, t2) sizeof(t1) >= sizeof(t2) ? 1 : -1 - -/* - * Verify that the size previously defined and expected for long - * is the same as the one reported by sizeof() at compile time. - */ - -typedef char - __curl_rule_01__ - [CurlchkszEQ(long, CURL_SIZEOF_LONG)]; - -/* - * Verify that the size previously defined and expected for - * curl_off_t is actually the the same as the one reported - * by sizeof() at compile time. - */ - -typedef char - __curl_rule_02__ - [CurlchkszEQ(curl_off_t, CURL_SIZEOF_CURL_OFF_T)]; - -/* - * Verify at compile time that the size of curl_off_t as reported - * by sizeof() is greater or equal than the one reported for long - * for the current compilation. - */ - -typedef char - __curl_rule_03__ - [CurlchkszGE(curl_off_t, long)]; - -/* - * Verify that the size previously defined and expected for - * curl_socklen_t is actually the the same as the one reported - * by sizeof() at compile time. - */ - -typedef char - __curl_rule_04__ - [CurlchkszEQ(curl_socklen_t, CURL_SIZEOF_CURL_SOCKLEN_T)]; - -/* - * Verify at compile time that the size of curl_socklen_t as reported - * by sizeof() is greater or equal than the one reported for int for - * the current compilation. - */ - -typedef char - __curl_rule_05__ - [CurlchkszGE(curl_socklen_t, int)]; - -/* ================================================================ */ -/* EXTERNALLY AND INTERNALLY VISIBLE DEFINITIONS */ -/* ================================================================ */ - -/* - * CURL_ISOCPP and CURL_OFF_T_C definitions are done here in order to allow - * these to be visible and exported by the external libcurl interface API, - * while also making them visible to the library internals, simply including - * setup.h, without actually needing to include curl.h internally. - * If some day this section would grow big enough, all this should be moved - * to its own header file. - */ - -/* - * Figure out if we can use the ## preprocessor operator, which is supported - * by ISO/ANSI C and C++. Some compilers support it without setting __STDC__ - * or __cplusplus so we need to carefully check for them too. - */ - -#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) || \ - defined(__HP_aCC) || defined(__BORLANDC__) || defined(__LCC__) || \ - defined(__POCC__) || defined(__SALFORDC__) || defined(__HIGHC__) || \ - defined(__ILEC400__) - /* This compiler is believed to have an ISO compatible preprocessor */ -#define CURL_ISOCPP -#else - /* This compiler is believed NOT to have an ISO compatible preprocessor */ -#undef CURL_ISOCPP -#endif - -/* - * Macros for minimum-width signed and unsigned curl_off_t integer constants. - */ - -#if defined(__BORLANDC__) && (__BORLANDC__ == 0x0551) -# define __CURL_OFF_T_C_HLPR2(x) x -# define __CURL_OFF_T_C_HLPR1(x) __CURL_OFF_T_C_HLPR2(x) -# define CURL_OFF_T_C(Val) __CURL_OFF_T_C_HLPR1(Val) ## \ - __CURL_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_T) -# define CURL_OFF_TU_C(Val) __CURL_OFF_T_C_HLPR1(Val) ## \ - __CURL_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_TU) -#else -# ifdef CURL_ISOCPP -# define __CURL_OFF_T_C_HLPR2(Val,Suffix) Val ## Suffix -# else -# define __CURL_OFF_T_C_HLPR2(Val,Suffix) Val/**/Suffix -# endif -# define __CURL_OFF_T_C_HLPR1(Val,Suffix) __CURL_OFF_T_C_HLPR2(Val,Suffix) -# define CURL_OFF_T_C(Val) __CURL_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_T) -# define CURL_OFF_TU_C(Val) __CURL_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_TU) -#endif - -/* - * Get rid of macros private to this header file. - */ - -#undef CurlchkszEQ -#undef CurlchkszGE - -/* - * Get rid of macros not intended to exist beyond this point. - */ - -#undef CURL_PULL_WS2TCPIP_H -#undef CURL_PULL_SYS_TYPES_H -#undef CURL_PULL_SYS_SOCKET_H -#undef CURL_PULL_STDINT_H -#undef CURL_PULL_INTTYPES_H - -#undef CURL_TYPEOF_CURL_SOCKLEN_T -#undef CURL_TYPEOF_CURL_OFF_T - -#ifdef CURL_NO_OLDIES -#undef CURL_FORMAT_OFF_T /* not required since 7.19.0 - obsoleted in 7.20.0 */ -#endif - -#endif /* __CURL_CURLRULES_H */ diff --git a/cocos2dx/platform/third_party/win32/curl/easy.h b/cocos2dx/platform/third_party/win32/curl/easy.h deleted file mode 100644 index c1e3e76096..0000000000 --- a/cocos2dx/platform/third_party/win32/curl/easy.h +++ /dev/null @@ -1,102 +0,0 @@ -#ifndef __CURL_EASY_H -#define __CURL_EASY_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - ***************************************************************************/ -#ifdef __cplusplus -extern "C" { -#endif - -CURL_EXTERN CURL *curl_easy_init(void); -CURL_EXTERN CURLcode curl_easy_setopt(CURL *curl, CURLoption option, ...); -CURL_EXTERN CURLcode curl_easy_perform(CURL *curl); -CURL_EXTERN void curl_easy_cleanup(CURL *curl); - -/* - * NAME curl_easy_getinfo() - * - * DESCRIPTION - * - * Request internal information from the curl session with this function. The - * third argument MUST be a pointer to a long, a pointer to a char * or a - * pointer to a double (as the documentation describes elsewhere). The data - * pointed to will be filled in accordingly and can be relied upon only if the - * function returns CURLE_OK. This function is intended to get used *AFTER* a - * performed transfer, all results from this function are undefined until the - * transfer is completed. - */ -CURL_EXTERN CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...); - - -/* - * NAME curl_easy_duphandle() - * - * DESCRIPTION - * - * Creates a new curl session handle with the same options set for the handle - * passed in. Duplicating a handle could only be a matter of cloning data and - * options, internal state info and things like persistent connections cannot - * be transferred. It is useful in multithreaded applications when you can run - * curl_easy_duphandle() for each new thread to avoid a series of identical - * curl_easy_setopt() invokes in every thread. - */ -CURL_EXTERN CURL* curl_easy_duphandle(CURL *curl); - -/* - * NAME curl_easy_reset() - * - * DESCRIPTION - * - * Re-initializes a CURL handle to the default values. This puts back the - * handle to the same state as it was in when it was just created. - * - * It does keep: live connections, the Session ID cache, the DNS cache and the - * cookies. - */ -CURL_EXTERN void curl_easy_reset(CURL *curl); - -/* - * NAME curl_easy_recv() - * - * DESCRIPTION - * - * Receives data from the connected socket. Use after successful - * curl_easy_perform() with CURLOPT_CONNECT_ONLY option. - */ -CURL_EXTERN CURLcode curl_easy_recv(CURL *curl, void *buffer, size_t buflen, - size_t *n); - -/* - * NAME curl_easy_send() - * - * DESCRIPTION - * - * Sends data over the connected socket. Use after successful - * curl_easy_perform() with CURLOPT_CONNECT_ONLY option. - */ -CURL_EXTERN CURLcode curl_easy_send(CURL *curl, const void *buffer, - size_t buflen, size_t *n); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/cocos2dx/platform/third_party/win32/curl/mprintf.h b/cocos2dx/platform/third_party/win32/curl/mprintf.h deleted file mode 100644 index de7dd2f3c3..0000000000 --- a/cocos2dx/platform/third_party/win32/curl/mprintf.h +++ /dev/null @@ -1,81 +0,0 @@ -#ifndef __CURL_MPRINTF_H -#define __CURL_MPRINTF_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, <daniel@haxx.se>, et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - ***************************************************************************/ - -#include <stdarg.h> -#include <stdio.h> /* needed for FILE */ - -#include "curl.h" - -#ifdef __cplusplus -extern "C" { -#endif - -CURL_EXTERN int curl_mprintf(const char *format, ...); -CURL_EXTERN int curl_mfprintf(FILE *fd, const char *format, ...); -CURL_EXTERN int curl_msprintf(char *buffer, const char *format, ...); -CURL_EXTERN int curl_msnprintf(char *buffer, size_t maxlength, - const char *format, ...); -CURL_EXTERN int curl_mvprintf(const char *format, va_list args); -CURL_EXTERN int curl_mvfprintf(FILE *fd, const char *format, va_list args); -CURL_EXTERN int curl_mvsprintf(char *buffer, const char *format, va_list args); -CURL_EXTERN int curl_mvsnprintf(char *buffer, size_t maxlength, - const char *format, va_list args); -CURL_EXTERN char *curl_maprintf(const char *format, ...); -CURL_EXTERN char *curl_mvaprintf(const char *format, va_list args); - -#ifdef _MPRINTF_REPLACE -# undef printf -# undef fprintf -# undef sprintf -# undef vsprintf -# undef snprintf -# undef vprintf -# undef vfprintf -# undef vsnprintf -# undef aprintf -# undef vaprintf -# define printf curl_mprintf -# define fprintf curl_mfprintf -#ifdef CURLDEBUG -/* When built with CURLDEBUG we define away the sprintf() functions since we - don't want internal code to be using them */ -# define sprintf sprintf_was_used -# define vsprintf vsprintf_was_used -#else -# define sprintf curl_msprintf -# define vsprintf curl_mvsprintf -#endif -# define snprintf curl_msnprintf -# define vprintf curl_mvprintf -# define vfprintf curl_mvfprintf -# define vsnprintf curl_mvsnprintf -# define aprintf curl_maprintf -# define vaprintf curl_mvaprintf -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* __CURL_MPRINTF_H */ diff --git a/cocos2dx/platform/third_party/win32/curl/multi.h b/cocos2dx/platform/third_party/win32/curl/multi.h deleted file mode 100644 index f96566669c..0000000000 --- a/cocos2dx/platform/third_party/win32/curl/multi.h +++ /dev/null @@ -1,345 +0,0 @@ -#ifndef __CURL_MULTI_H -#define __CURL_MULTI_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - ***************************************************************************/ -/* - This is an "external" header file. Don't give away any internals here! - - GOALS - - o Enable a "pull" interface. The application that uses libcurl decides where - and when to ask libcurl to get/send data. - - o Enable multiple simultaneous transfers in the same thread without making it - complicated for the application. - - o Enable the application to select() on its own file descriptors and curl's - file descriptors simultaneous easily. - -*/ - -/* - * This header file should not really need to include "curl.h" since curl.h - * itself includes this file and we expect user applications to do #include - * <curl/curl.h> without the need for especially including multi.h. - * - * For some reason we added this include here at one point, and rather than to - * break existing (wrongly written) libcurl applications, we leave it as-is - * but with this warning attached. - */ -#include "curl.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef void CURLM; - -typedef enum { - CURLM_CALL_MULTI_PERFORM = -1, /* please call curl_multi_perform() or - curl_multi_socket*() soon */ - CURLM_OK, - CURLM_BAD_HANDLE, /* the passed-in handle is not a valid CURLM handle */ - CURLM_BAD_EASY_HANDLE, /* an easy handle was not good/valid */ - CURLM_OUT_OF_MEMORY, /* if you ever get this, you're in deep sh*t */ - CURLM_INTERNAL_ERROR, /* this is a libcurl bug */ - CURLM_BAD_SOCKET, /* the passed in socket argument did not match */ - CURLM_UNKNOWN_OPTION, /* curl_multi_setopt() with unsupported option */ - CURLM_LAST -} CURLMcode; - -/* just to make code nicer when using curl_multi_socket() you can now check - for CURLM_CALL_MULTI_SOCKET too in the same style it works for - curl_multi_perform() and CURLM_CALL_MULTI_PERFORM */ -#define CURLM_CALL_MULTI_SOCKET CURLM_CALL_MULTI_PERFORM - -typedef enum { - CURLMSG_NONE, /* first, not used */ - CURLMSG_DONE, /* This easy handle has completed. 'result' contains - the CURLcode of the transfer */ - CURLMSG_LAST /* last, not used */ -} CURLMSG; - -struct CURLMsg { - CURLMSG msg; /* what this message means */ - CURL *easy_handle; /* the handle it concerns */ - union { - void *whatever; /* message-specific data */ - CURLcode result; /* return code for transfer */ - } data; -}; -typedef struct CURLMsg CURLMsg; - -/* - * Name: curl_multi_init() - * - * Desc: inititalize multi-style curl usage - * - * Returns: a new CURLM handle to use in all 'curl_multi' functions. - */ -CURL_EXTERN CURLM *curl_multi_init(void); - -/* - * Name: curl_multi_add_handle() - * - * Desc: add a standard curl handle to the multi stack - * - * Returns: CURLMcode type, general multi error code. - */ -CURL_EXTERN CURLMcode curl_multi_add_handle(CURLM *multi_handle, - CURL *curl_handle); - - /* - * Name: curl_multi_remove_handle() - * - * Desc: removes a curl handle from the multi stack again - * - * Returns: CURLMcode type, general multi error code. - */ -CURL_EXTERN CURLMcode curl_multi_remove_handle(CURLM *multi_handle, - CURL *curl_handle); - - /* - * Name: curl_multi_fdset() - * - * Desc: Ask curl for its fd_set sets. The app can use these to select() or - * poll() on. We want curl_multi_perform() called as soon as one of - * them are ready. - * - * Returns: CURLMcode type, general multi error code. - */ -CURL_EXTERN CURLMcode curl_multi_fdset(CURLM *multi_handle, - fd_set *read_fd_set, - fd_set *write_fd_set, - fd_set *exc_fd_set, - int *max_fd); - - /* - * Name: curl_multi_perform() - * - * Desc: When the app thinks there's data available for curl it calls this - * function to read/write whatever there is right now. This returns - * as soon as the reads and writes are done. This function does not - * require that there actually is data available for reading or that - * data can be written, it can be called just in case. It returns - * the number of handles that still transfer data in the second - * argument's integer-pointer. - * - * Returns: CURLMcode type, general multi error code. *NOTE* that this only - * returns errors etc regarding the whole multi stack. There might - * still have occurred problems on invidual transfers even when this - * returns OK. - */ -CURL_EXTERN CURLMcode curl_multi_perform(CURLM *multi_handle, - int *running_handles); - - /* - * Name: curl_multi_cleanup() - * - * Desc: Cleans up and removes a whole multi stack. It does not free or - * touch any individual easy handles in any way. We need to define - * in what state those handles will be if this function is called - * in the middle of a transfer. - * - * Returns: CURLMcode type, general multi error code. - */ -CURL_EXTERN CURLMcode curl_multi_cleanup(CURLM *multi_handle); - -/* - * Name: curl_multi_info_read() - * - * Desc: Ask the multi handle if there's any messages/informationals from - * the individual transfers. Messages include informationals such as - * error code from the transfer or just the fact that a transfer is - * completed. More details on these should be written down as well. - * - * Repeated calls to this function will return a new struct each - * time, until a special "end of msgs" struct is returned as a signal - * that there is no more to get at this point. - * - * The data the returned pointer points to will not survive calling - * curl_multi_cleanup(). - * - * The 'CURLMsg' struct is meant to be very simple and only contain - * very basic informations. If more involved information is wanted, - * we will provide the particular "transfer handle" in that struct - * and that should/could/would be used in subsequent - * curl_easy_getinfo() calls (or similar). The point being that we - * must never expose complex structs to applications, as then we'll - * undoubtably get backwards compatibility problems in the future. - * - * Returns: A pointer to a filled-in struct, or NULL if it failed or ran out - * of structs. It also writes the number of messages left in the - * queue (after this read) in the integer the second argument points - * to. - */ -CURL_EXTERN CURLMsg *curl_multi_info_read(CURLM *multi_handle, - int *msgs_in_queue); - -/* - * Name: curl_multi_strerror() - * - * Desc: The curl_multi_strerror function may be used to turn a CURLMcode - * value into the equivalent human readable error string. This is - * useful for printing meaningful error messages. - * - * Returns: A pointer to a zero-terminated error message. - */ -CURL_EXTERN const char *curl_multi_strerror(CURLMcode); - -/* - * Name: curl_multi_socket() and - * curl_multi_socket_all() - * - * Desc: An alternative version of curl_multi_perform() that allows the - * application to pass in one of the file descriptors that have been - * detected to have "action" on them and let libcurl perform. - * See man page for details. - */ -#define CURL_POLL_NONE 0 -#define CURL_POLL_IN 1 -#define CURL_POLL_OUT 2 -#define CURL_POLL_INOUT 3 -#define CURL_POLL_REMOVE 4 - -#define CURL_SOCKET_TIMEOUT CURL_SOCKET_BAD - -#define CURL_CSELECT_IN 0x01 -#define CURL_CSELECT_OUT 0x02 -#define CURL_CSELECT_ERR 0x04 - -typedef int (*curl_socket_callback)(CURL *easy, /* easy handle */ - curl_socket_t s, /* socket */ - int what, /* see above */ - void *userp, /* private callback - pointer */ - void *socketp); /* private socket - pointer */ -/* - * Name: curl_multi_timer_callback - * - * Desc: Called by libcurl whenever the library detects a change in the - * maximum number of milliseconds the app is allowed to wait before - * curl_multi_socket() or curl_multi_perform() must be called - * (to allow libcurl's timed events to take place). - * - * Returns: The callback should return zero. - */ -typedef int (*curl_multi_timer_callback)(CURLM *multi, /* multi handle */ - long timeout_ms, /* see above */ - void *userp); /* private callback - pointer */ - -CURL_EXTERN CURLMcode curl_multi_socket(CURLM *multi_handle, curl_socket_t s, - int *running_handles); - -CURL_EXTERN CURLMcode curl_multi_socket_action(CURLM *multi_handle, - curl_socket_t s, - int ev_bitmask, - int *running_handles); - -CURL_EXTERN CURLMcode curl_multi_socket_all(CURLM *multi_handle, - int *running_handles); - -#ifndef CURL_ALLOW_OLD_MULTI_SOCKET -/* This macro below was added in 7.16.3 to push users who recompile to use - the new curl_multi_socket_action() instead of the old curl_multi_socket() -*/ -#define curl_multi_socket(x,y,z) curl_multi_socket_action(x,y,0,z) -#endif - -/* - * Name: curl_multi_timeout() - * - * Desc: Returns the maximum number of milliseconds the app is allowed to - * wait before curl_multi_socket() or curl_multi_perform() must be - * called (to allow libcurl's timed events to take place). - * - * Returns: CURLM error code. - */ -CURL_EXTERN CURLMcode curl_multi_timeout(CURLM *multi_handle, - long *milliseconds); - -#undef CINIT /* re-using the same name as in curl.h */ - -#ifdef CURL_ISOCPP -#define CINIT(name,type,num) CURLMOPT_ ## name = CURLOPTTYPE_ ## type + num -#else -/* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */ -#define LONG CURLOPTTYPE_LONG -#define OBJECTPOINT CURLOPTTYPE_OBJECTPOINT -#define FUNCTIONPOINT CURLOPTTYPE_FUNCTIONPOINT -#define OFF_T CURLOPTTYPE_OFF_T -#define CINIT(name,type,number) CURLMOPT_/**/name = type + number -#endif - -typedef enum { - /* This is the socket callback function pointer */ - CINIT(SOCKETFUNCTION, FUNCTIONPOINT, 1), - - /* This is the argument passed to the socket callback */ - CINIT(SOCKETDATA, OBJECTPOINT, 2), - - /* set to 1 to enable pipelining for this multi handle */ - CINIT(PIPELINING, LONG, 3), - - /* This is the timer callback function pointer */ - CINIT(TIMERFUNCTION, FUNCTIONPOINT, 4), - - /* This is the argument passed to the timer callback */ - CINIT(TIMERDATA, OBJECTPOINT, 5), - - /* maximum number of entries in the connection cache */ - CINIT(MAXCONNECTS, LONG, 6), - - CURLMOPT_LASTENTRY /* the last unused */ -} CURLMoption; - - -/* - * Name: curl_multi_setopt() - * - * Desc: Sets options for the multi handle. - * - * Returns: CURLM error code. - */ -CURL_EXTERN CURLMcode curl_multi_setopt(CURLM *multi_handle, - CURLMoption option, ...); - - -/* - * Name: curl_multi_assign() - * - * Desc: This function sets an association in the multi handle between the - * given socket and a private pointer of the application. This is - * (only) useful for curl_multi_socket uses. - * - * Returns: CURLM error code. - */ -CURL_EXTERN CURLMcode curl_multi_assign(CURLM *multi_handle, - curl_socket_t sockfd, void *sockp); - -#ifdef __cplusplus -} /* end of extern "C" */ -#endif - -#endif diff --git a/cocos2dx/platform/third_party/win32/curl/stdcheaders.h b/cocos2dx/platform/third_party/win32/curl/stdcheaders.h deleted file mode 100644 index ad82ef6335..0000000000 --- a/cocos2dx/platform/third_party/win32/curl/stdcheaders.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef __STDC_HEADERS_H -#define __STDC_HEADERS_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - ***************************************************************************/ - -#include <sys/types.h> - -size_t fread (void *, size_t, size_t, FILE *); -size_t fwrite (const void *, size_t, size_t, FILE *); - -int strcasecmp(const char *, const char *); -int strncasecmp(const char *, const char *, size_t); - -#endif /* __STDC_HEADERS_H */ diff --git a/cocos2dx/platform/third_party/win32/curl/typecheck-gcc.h b/cocos2dx/platform/third_party/win32/curl/typecheck-gcc.h deleted file mode 100644 index f8917e8112..0000000000 --- a/cocos2dx/platform/third_party/win32/curl/typecheck-gcc.h +++ /dev/null @@ -1,604 +0,0 @@ -#ifndef __CURL_TYPECHECK_GCC_H -#define __CURL_TYPECHECK_GCC_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - ***************************************************************************/ - -/* wraps curl_easy_setopt() with typechecking */ - -/* To add a new kind of warning, add an - * if(_curl_is_sometype_option(_curl_opt)) - * if(!_curl_is_sometype(value)) - * _curl_easy_setopt_err_sometype(); - * block and define _curl_is_sometype_option, _curl_is_sometype and - * _curl_easy_setopt_err_sometype below - * - * NOTE: We use two nested 'if' statements here instead of the && operator, in - * order to work around gcc bug #32061. It affects only gcc 4.3.x/4.4.x - * when compiling with -Wlogical-op. - * - * To add an option that uses the same type as an existing option, you'll just - * need to extend the appropriate _curl_*_option macro - */ -#define curl_easy_setopt(handle, option, value) \ -__extension__ ({ \ - __typeof__ (option) _curl_opt = option; \ - if(__builtin_constant_p(_curl_opt)) { \ - if(_curl_is_long_option(_curl_opt)) \ - if(!_curl_is_long(value)) \ - _curl_easy_setopt_err_long(); \ - if(_curl_is_off_t_option(_curl_opt)) \ - if(!_curl_is_off_t(value)) \ - _curl_easy_setopt_err_curl_off_t(); \ - if(_curl_is_string_option(_curl_opt)) \ - if(!_curl_is_string(value)) \ - _curl_easy_setopt_err_string(); \ - if(_curl_is_write_cb_option(_curl_opt)) \ - if(!_curl_is_write_cb(value)) \ - _curl_easy_setopt_err_write_callback(); \ - if((_curl_opt) == CURLOPT_READFUNCTION) \ - if(!_curl_is_read_cb(value)) \ - _curl_easy_setopt_err_read_cb(); \ - if((_curl_opt) == CURLOPT_IOCTLFUNCTION) \ - if(!_curl_is_ioctl_cb(value)) \ - _curl_easy_setopt_err_ioctl_cb(); \ - if((_curl_opt) == CURLOPT_SOCKOPTFUNCTION) \ - if(!_curl_is_sockopt_cb(value)) \ - _curl_easy_setopt_err_sockopt_cb(); \ - if((_curl_opt) == CURLOPT_OPENSOCKETFUNCTION) \ - if(!_curl_is_opensocket_cb(value)) \ - _curl_easy_setopt_err_opensocket_cb(); \ - if((_curl_opt) == CURLOPT_PROGRESSFUNCTION) \ - if(!_curl_is_progress_cb(value)) \ - _curl_easy_setopt_err_progress_cb(); \ - if((_curl_opt) == CURLOPT_DEBUGFUNCTION) \ - if(!_curl_is_debug_cb(value)) \ - _curl_easy_setopt_err_debug_cb(); \ - if((_curl_opt) == CURLOPT_SSL_CTX_FUNCTION) \ - if(!_curl_is_ssl_ctx_cb(value)) \ - _curl_easy_setopt_err_ssl_ctx_cb(); \ - if(_curl_is_conv_cb_option(_curl_opt)) \ - if(!_curl_is_conv_cb(value)) \ - _curl_easy_setopt_err_conv_cb(); \ - if((_curl_opt) == CURLOPT_SEEKFUNCTION) \ - if(!_curl_is_seek_cb(value)) \ - _curl_easy_setopt_err_seek_cb(); \ - if(_curl_is_cb_data_option(_curl_opt)) \ - if(!_curl_is_cb_data(value)) \ - _curl_easy_setopt_err_cb_data(); \ - if((_curl_opt) == CURLOPT_ERRORBUFFER) \ - if(!_curl_is_error_buffer(value)) \ - _curl_easy_setopt_err_error_buffer(); \ - if((_curl_opt) == CURLOPT_STDERR) \ - if(!_curl_is_FILE(value)) \ - _curl_easy_setopt_err_FILE(); \ - if(_curl_is_postfields_option(_curl_opt)) \ - if(!_curl_is_postfields(value)) \ - _curl_easy_setopt_err_postfields(); \ - if((_curl_opt) == CURLOPT_HTTPPOST) \ - if(!_curl_is_arr((value), struct curl_httppost)) \ - _curl_easy_setopt_err_curl_httpost(); \ - if(_curl_is_slist_option(_curl_opt)) \ - if(!_curl_is_arr((value), struct curl_slist)) \ - _curl_easy_setopt_err_curl_slist(); \ - if((_curl_opt) == CURLOPT_SHARE) \ - if(!_curl_is_ptr((value), CURLSH)) \ - _curl_easy_setopt_err_CURLSH(); \ - } \ - curl_easy_setopt(handle, _curl_opt, value); \ -}) - -/* wraps curl_easy_getinfo() with typechecking */ -/* FIXME: don't allow const pointers */ -#define curl_easy_getinfo(handle, info, arg) \ -__extension__ ({ \ - __typeof__ (info) _curl_info = info; \ - if(__builtin_constant_p(_curl_info)) { \ - if(_curl_is_string_info(_curl_info)) \ - if(!_curl_is_arr((arg), char *)) \ - _curl_easy_getinfo_err_string(); \ - if(_curl_is_long_info(_curl_info)) \ - if(!_curl_is_arr((arg), long)) \ - _curl_easy_getinfo_err_long(); \ - if(_curl_is_double_info(_curl_info)) \ - if(!_curl_is_arr((arg), double)) \ - _curl_easy_getinfo_err_double(); \ - if(_curl_is_slist_info(_curl_info)) \ - if(!_curl_is_arr((arg), struct curl_slist *)) \ - _curl_easy_getinfo_err_curl_slist(); \ - } \ - curl_easy_getinfo(handle, _curl_info, arg); \ -}) - -/* TODO: typechecking for curl_share_setopt() and curl_multi_setopt(), - * for now just make sure that the functions are called with three - * arguments - */ -#define curl_share_setopt(share,opt,param) curl_share_setopt(share,opt,param) -#define curl_multi_setopt(handle,opt,param) curl_multi_setopt(handle,opt,param) - - -/* the actual warnings, triggered by calling the _curl_easy_setopt_err* - * functions */ - -/* To define a new warning, use _CURL_WARNING(identifier, "message") */ -#define _CURL_WARNING(id, message) \ - static void __attribute__((__warning__(message))) \ - __attribute__((__unused__)) __attribute__((__noinline__)) \ - id(void) { __asm__(""); } - -_CURL_WARNING(_curl_easy_setopt_err_long, - "curl_easy_setopt expects a long argument for this option") -_CURL_WARNING(_curl_easy_setopt_err_curl_off_t, - "curl_easy_setopt expects a curl_off_t argument for this option") -_CURL_WARNING(_curl_easy_setopt_err_string, - "curl_easy_setopt expects a " - "string (char* or char[]) argument for this option" - ) -_CURL_WARNING(_curl_easy_setopt_err_write_callback, - "curl_easy_setopt expects a curl_write_callback argument for this option") -_CURL_WARNING(_curl_easy_setopt_err_read_cb, - "curl_easy_setopt expects a curl_read_callback argument for this option") -_CURL_WARNING(_curl_easy_setopt_err_ioctl_cb, - "curl_easy_setopt expects a curl_ioctl_callback argument for this option") -_CURL_WARNING(_curl_easy_setopt_err_sockopt_cb, - "curl_easy_setopt expects a curl_sockopt_callback argument for this option") -_CURL_WARNING(_curl_easy_setopt_err_opensocket_cb, - "curl_easy_setopt expects a " - "curl_opensocket_callback argument for this option" - ) -_CURL_WARNING(_curl_easy_setopt_err_progress_cb, - "curl_easy_setopt expects a curl_progress_callback argument for this option") -_CURL_WARNING(_curl_easy_setopt_err_debug_cb, - "curl_easy_setopt expects a curl_debug_callback argument for this option") -_CURL_WARNING(_curl_easy_setopt_err_ssl_ctx_cb, - "curl_easy_setopt expects a curl_ssl_ctx_callback argument for this option") -_CURL_WARNING(_curl_easy_setopt_err_conv_cb, - "curl_easy_setopt expects a curl_conv_callback argument for this option") -_CURL_WARNING(_curl_easy_setopt_err_seek_cb, - "curl_easy_setopt expects a curl_seek_callback argument for this option") -_CURL_WARNING(_curl_easy_setopt_err_cb_data, - "curl_easy_setopt expects a " - "private data pointer as argument for this option") -_CURL_WARNING(_curl_easy_setopt_err_error_buffer, - "curl_easy_setopt expects a " - "char buffer of CURL_ERROR_SIZE as argument for this option") -_CURL_WARNING(_curl_easy_setopt_err_FILE, - "curl_easy_setopt expects a FILE* argument for this option") -_CURL_WARNING(_curl_easy_setopt_err_postfields, - "curl_easy_setopt expects a void* or char* argument for this option") -_CURL_WARNING(_curl_easy_setopt_err_curl_httpost, - "curl_easy_setopt expects a struct curl_httppost* argument for this option") -_CURL_WARNING(_curl_easy_setopt_err_curl_slist, - "curl_easy_setopt expects a struct curl_slist* argument for this option") -_CURL_WARNING(_curl_easy_setopt_err_CURLSH, - "curl_easy_setopt expects a CURLSH* argument for this option") - -_CURL_WARNING(_curl_easy_getinfo_err_string, - "curl_easy_getinfo expects a pointer to char * for this info") -_CURL_WARNING(_curl_easy_getinfo_err_long, - "curl_easy_getinfo expects a pointer to long for this info") -_CURL_WARNING(_curl_easy_getinfo_err_double, - "curl_easy_getinfo expects a pointer to double for this info") -_CURL_WARNING(_curl_easy_getinfo_err_curl_slist, - "curl_easy_getinfo expects a pointer to struct curl_slist * for this info") - -/* groups of curl_easy_setops options that take the same type of argument */ - -/* To add a new option to one of the groups, just add - * (option) == CURLOPT_SOMETHING - * to the or-expression. If the option takes a long or curl_off_t, you don't - * have to do anything - */ - -/* evaluates to true if option takes a long argument */ -#define _curl_is_long_option(option) \ - (0 < (option) && (option) < CURLOPTTYPE_OBJECTPOINT) - -#define _curl_is_off_t_option(option) \ - ((option) > CURLOPTTYPE_OFF_T) - -/* evaluates to true if option takes a char* argument */ -#define _curl_is_string_option(option) \ - ((option) == CURLOPT_URL || \ - (option) == CURLOPT_PROXY || \ - (option) == CURLOPT_INTERFACE || \ - (option) == CURLOPT_NETRC_FILE || \ - (option) == CURLOPT_USERPWD || \ - (option) == CURLOPT_USERNAME || \ - (option) == CURLOPT_PASSWORD || \ - (option) == CURLOPT_PROXYUSERPWD || \ - (option) == CURLOPT_PROXYUSERNAME || \ - (option) == CURLOPT_PROXYPASSWORD || \ - (option) == CURLOPT_NOPROXY || \ - (option) == CURLOPT_ACCEPT_ENCODING || \ - (option) == CURLOPT_REFERER || \ - (option) == CURLOPT_USERAGENT || \ - (option) == CURLOPT_COOKIE || \ - (option) == CURLOPT_COOKIEFILE || \ - (option) == CURLOPT_COOKIEJAR || \ - (option) == CURLOPT_COOKIELIST || \ - (option) == CURLOPT_FTPPORT || \ - (option) == CURLOPT_FTP_ALTERNATIVE_TO_USER || \ - (option) == CURLOPT_FTP_ACCOUNT || \ - (option) == CURLOPT_RANGE || \ - (option) == CURLOPT_CUSTOMREQUEST || \ - (option) == CURLOPT_SSLCERT || \ - (option) == CURLOPT_SSLCERTTYPE || \ - (option) == CURLOPT_SSLKEY || \ - (option) == CURLOPT_SSLKEYTYPE || \ - (option) == CURLOPT_KEYPASSWD || \ - (option) == CURLOPT_SSLENGINE || \ - (option) == CURLOPT_CAINFO || \ - (option) == CURLOPT_CAPATH || \ - (option) == CURLOPT_RANDOM_FILE || \ - (option) == CURLOPT_EGDSOCKET || \ - (option) == CURLOPT_SSL_CIPHER_LIST || \ - (option) == CURLOPT_KRBLEVEL || \ - (option) == CURLOPT_SSH_HOST_PUBLIC_KEY_MD5 || \ - (option) == CURLOPT_SSH_PUBLIC_KEYFILE || \ - (option) == CURLOPT_SSH_PRIVATE_KEYFILE || \ - (option) == CURLOPT_CRLFILE || \ - (option) == CURLOPT_ISSUERCERT || \ - (option) == CURLOPT_SOCKS5_GSSAPI_SERVICE || \ - (option) == CURLOPT_SSH_KNOWNHOSTS || \ - (option) == CURLOPT_MAIL_FROM || \ - (option) == CURLOPT_RTSP_SESSION_ID || \ - (option) == CURLOPT_RTSP_STREAM_URI || \ - (option) == CURLOPT_RTSP_TRANSPORT || \ - 0) - -/* evaluates to true if option takes a curl_write_callback argument */ -#define _curl_is_write_cb_option(option) \ - ((option) == CURLOPT_HEADERFUNCTION || \ - (option) == CURLOPT_WRITEFUNCTION) - -/* evaluates to true if option takes a curl_conv_callback argument */ -#define _curl_is_conv_cb_option(option) \ - ((option) == CURLOPT_CONV_TO_NETWORK_FUNCTION || \ - (option) == CURLOPT_CONV_FROM_NETWORK_FUNCTION || \ - (option) == CURLOPT_CONV_FROM_UTF8_FUNCTION) - -/* evaluates to true if option takes a data argument to pass to a callback */ -#define _curl_is_cb_data_option(option) \ - ((option) == CURLOPT_WRITEDATA || \ - (option) == CURLOPT_READDATA || \ - (option) == CURLOPT_IOCTLDATA || \ - (option) == CURLOPT_SOCKOPTDATA || \ - (option) == CURLOPT_OPENSOCKETDATA || \ - (option) == CURLOPT_PROGRESSDATA || \ - (option) == CURLOPT_WRITEHEADER || \ - (option) == CURLOPT_DEBUGDATA || \ - (option) == CURLOPT_SSL_CTX_DATA || \ - (option) == CURLOPT_SEEKDATA || \ - (option) == CURLOPT_PRIVATE || \ - (option) == CURLOPT_SSH_KEYDATA || \ - (option) == CURLOPT_INTERLEAVEDATA || \ - (option) == CURLOPT_CHUNK_DATA || \ - (option) == CURLOPT_FNMATCH_DATA || \ - 0) - -/* evaluates to true if option takes a POST data argument (void* or char*) */ -#define _curl_is_postfields_option(option) \ - ((option) == CURLOPT_POSTFIELDS || \ - (option) == CURLOPT_COPYPOSTFIELDS || \ - 0) - -/* evaluates to true if option takes a struct curl_slist * argument */ -#define _curl_is_slist_option(option) \ - ((option) == CURLOPT_HTTPHEADER || \ - (option) == CURLOPT_HTTP200ALIASES || \ - (option) == CURLOPT_QUOTE || \ - (option) == CURLOPT_POSTQUOTE || \ - (option) == CURLOPT_PREQUOTE || \ - (option) == CURLOPT_TELNETOPTIONS || \ - (option) == CURLOPT_MAIL_RCPT || \ - 0) - -/* groups of curl_easy_getinfo infos that take the same type of argument */ - -/* evaluates to true if info expects a pointer to char * argument */ -#define _curl_is_string_info(info) \ - (CURLINFO_STRING < (info) && (info) < CURLINFO_LONG) - -/* evaluates to true if info expects a pointer to long argument */ -#define _curl_is_long_info(info) \ - (CURLINFO_LONG < (info) && (info) < CURLINFO_DOUBLE) - -/* evaluates to true if info expects a pointer to double argument */ -#define _curl_is_double_info(info) \ - (CURLINFO_DOUBLE < (info) && (info) < CURLINFO_SLIST) - -/* true if info expects a pointer to struct curl_slist * argument */ -#define _curl_is_slist_info(info) \ - (CURLINFO_SLIST < (info)) - - -/* typecheck helpers -- check whether given expression has requested type*/ - -/* For pointers, you can use the _curl_is_ptr/_curl_is_arr macros, - * otherwise define a new macro. Search for __builtin_types_compatible_p - * in the GCC manual. - * NOTE: these macros MUST NOT EVALUATE their arguments! The argument is - * the actual expression passed to the curl_easy_setopt macro. This - * means that you can only apply the sizeof and __typeof__ operators, no - * == or whatsoever. - */ - -/* XXX: should evaluate to true iff expr is a pointer */ -#define _curl_is_any_ptr(expr) \ - (sizeof(expr) == sizeof(void*)) - -/* evaluates to true if expr is NULL */ -/* XXX: must not evaluate expr, so this check is not accurate */ -#define _curl_is_NULL(expr) \ - (__builtin_types_compatible_p(__typeof__(expr), __typeof__(NULL))) - -/* evaluates to true if expr is type*, const type* or NULL */ -#define _curl_is_ptr(expr, type) \ - (_curl_is_NULL(expr) || \ - __builtin_types_compatible_p(__typeof__(expr), type *) || \ - __builtin_types_compatible_p(__typeof__(expr), const type *)) - -/* evaluates to true if expr is one of type[], type*, NULL or const type* */ -#define _curl_is_arr(expr, type) \ - (_curl_is_ptr((expr), type) || \ - __builtin_types_compatible_p(__typeof__(expr), type [])) - -/* evaluates to true if expr is a string */ -#define _curl_is_string(expr) \ - (_curl_is_arr((expr), char) || \ - _curl_is_arr((expr), signed char) || \ - _curl_is_arr((expr), unsigned char)) - -/* evaluates to true if expr is a long (no matter the signedness) - * XXX: for now, int is also accepted (and therefore short and char, which - * are promoted to int when passed to a variadic function) */ -#define _curl_is_long(expr) \ - (__builtin_types_compatible_p(__typeof__(expr), long) || \ - __builtin_types_compatible_p(__typeof__(expr), signed long) || \ - __builtin_types_compatible_p(__typeof__(expr), unsigned long) || \ - __builtin_types_compatible_p(__typeof__(expr), int) || \ - __builtin_types_compatible_p(__typeof__(expr), signed int) || \ - __builtin_types_compatible_p(__typeof__(expr), unsigned int) || \ - __builtin_types_compatible_p(__typeof__(expr), short) || \ - __builtin_types_compatible_p(__typeof__(expr), signed short) || \ - __builtin_types_compatible_p(__typeof__(expr), unsigned short) || \ - __builtin_types_compatible_p(__typeof__(expr), char) || \ - __builtin_types_compatible_p(__typeof__(expr), signed char) || \ - __builtin_types_compatible_p(__typeof__(expr), unsigned char)) - -/* evaluates to true if expr is of type curl_off_t */ -#define _curl_is_off_t(expr) \ - (__builtin_types_compatible_p(__typeof__(expr), curl_off_t)) - -/* evaluates to true if expr is abuffer suitable for CURLOPT_ERRORBUFFER */ -/* XXX: also check size of an char[] array? */ -#define _curl_is_error_buffer(expr) \ - (_curl_is_NULL(expr) || \ - __builtin_types_compatible_p(__typeof__(expr), char *) || \ - __builtin_types_compatible_p(__typeof__(expr), char[])) - -/* evaluates to true if expr is of type (const) void* or (const) FILE* */ -#if 0 -#define _curl_is_cb_data(expr) \ - (_curl_is_ptr((expr), void) || \ - _curl_is_ptr((expr), FILE)) -#else /* be less strict */ -#define _curl_is_cb_data(expr) \ - _curl_is_any_ptr(expr) -#endif - -/* evaluates to true if expr is of type FILE* */ -#define _curl_is_FILE(expr) \ - (__builtin_types_compatible_p(__typeof__(expr), FILE *)) - -/* evaluates to true if expr can be passed as POST data (void* or char*) */ -#define _curl_is_postfields(expr) \ - (_curl_is_ptr((expr), void) || \ - _curl_is_arr((expr), char)) - -/* FIXME: the whole callback checking is messy... - * The idea is to tolerate char vs. void and const vs. not const - * pointers in arguments at least - */ -/* helper: __builtin_types_compatible_p distinguishes between functions and - * function pointers, hide it */ -#define _curl_callback_compatible(func, type) \ - (__builtin_types_compatible_p(__typeof__(func), type) || \ - __builtin_types_compatible_p(__typeof__(func), type*)) - -/* evaluates to true if expr is of type curl_read_callback or "similar" */ -#define _curl_is_read_cb(expr) \ - (_curl_is_NULL(expr) || \ - __builtin_types_compatible_p(__typeof__(expr), __typeof__(fread)) || \ - __builtin_types_compatible_p(__typeof__(expr), curl_read_callback) || \ - _curl_callback_compatible((expr), _curl_read_callback1) || \ - _curl_callback_compatible((expr), _curl_read_callback2) || \ - _curl_callback_compatible((expr), _curl_read_callback3) || \ - _curl_callback_compatible((expr), _curl_read_callback4) || \ - _curl_callback_compatible((expr), _curl_read_callback5) || \ - _curl_callback_compatible((expr), _curl_read_callback6)) -typedef size_t (_curl_read_callback1)(char *, size_t, size_t, void*); -typedef size_t (_curl_read_callback2)(char *, size_t, size_t, const void*); -typedef size_t (_curl_read_callback3)(char *, size_t, size_t, FILE*); -typedef size_t (_curl_read_callback4)(void *, size_t, size_t, void*); -typedef size_t (_curl_read_callback5)(void *, size_t, size_t, const void*); -typedef size_t (_curl_read_callback6)(void *, size_t, size_t, FILE*); - -/* evaluates to true if expr is of type curl_write_callback or "similar" */ -#define _curl_is_write_cb(expr) \ - (_curl_is_read_cb(expr) || \ - __builtin_types_compatible_p(__typeof__(expr), __typeof__(fwrite)) || \ - __builtin_types_compatible_p(__typeof__(expr), curl_write_callback) || \ - _curl_callback_compatible((expr), _curl_write_callback1) || \ - _curl_callback_compatible((expr), _curl_write_callback2) || \ - _curl_callback_compatible((expr), _curl_write_callback3) || \ - _curl_callback_compatible((expr), _curl_write_callback4) || \ - _curl_callback_compatible((expr), _curl_write_callback5) || \ - _curl_callback_compatible((expr), _curl_write_callback6)) -typedef size_t (_curl_write_callback1)(const char *, size_t, size_t, void*); -typedef size_t (_curl_write_callback2)(const char *, size_t, size_t, - const void*); -typedef size_t (_curl_write_callback3)(const char *, size_t, size_t, FILE*); -typedef size_t (_curl_write_callback4)(const void *, size_t, size_t, void*); -typedef size_t (_curl_write_callback5)(const void *, size_t, size_t, - const void*); -typedef size_t (_curl_write_callback6)(const void *, size_t, size_t, FILE*); - -/* evaluates to true if expr is of type curl_ioctl_callback or "similar" */ -#define _curl_is_ioctl_cb(expr) \ - (_curl_is_NULL(expr) || \ - __builtin_types_compatible_p(__typeof__(expr), curl_ioctl_callback) || \ - _curl_callback_compatible((expr), _curl_ioctl_callback1) || \ - _curl_callback_compatible((expr), _curl_ioctl_callback2) || \ - _curl_callback_compatible((expr), _curl_ioctl_callback3) || \ - _curl_callback_compatible((expr), _curl_ioctl_callback4)) -typedef curlioerr (_curl_ioctl_callback1)(CURL *, int, void*); -typedef curlioerr (_curl_ioctl_callback2)(CURL *, int, const void*); -typedef curlioerr (_curl_ioctl_callback3)(CURL *, curliocmd, void*); -typedef curlioerr (_curl_ioctl_callback4)(CURL *, curliocmd, const void*); - -/* evaluates to true if expr is of type curl_sockopt_callback or "similar" */ -#define _curl_is_sockopt_cb(expr) \ - (_curl_is_NULL(expr) || \ - __builtin_types_compatible_p(__typeof__(expr), curl_sockopt_callback) || \ - _curl_callback_compatible((expr), _curl_sockopt_callback1) || \ - _curl_callback_compatible((expr), _curl_sockopt_callback2)) -typedef int (_curl_sockopt_callback1)(void *, curl_socket_t, curlsocktype); -typedef int (_curl_sockopt_callback2)(const void *, curl_socket_t, - curlsocktype); - -/* evaluates to true if expr is of type curl_opensocket_callback or - "similar" */ -#define _curl_is_opensocket_cb(expr) \ - (_curl_is_NULL(expr) || \ - __builtin_types_compatible_p(__typeof__(expr), curl_opensocket_callback) ||\ - _curl_callback_compatible((expr), _curl_opensocket_callback1) || \ - _curl_callback_compatible((expr), _curl_opensocket_callback2) || \ - _curl_callback_compatible((expr), _curl_opensocket_callback3) || \ - _curl_callback_compatible((expr), _curl_opensocket_callback4)) -typedef curl_socket_t (_curl_opensocket_callback1) - (void *, curlsocktype, struct curl_sockaddr *); -typedef curl_socket_t (_curl_opensocket_callback2) - (void *, curlsocktype, const struct curl_sockaddr *); -typedef curl_socket_t (_curl_opensocket_callback3) - (const void *, curlsocktype, struct curl_sockaddr *); -typedef curl_socket_t (_curl_opensocket_callback4) - (const void *, curlsocktype, const struct curl_sockaddr *); - -/* evaluates to true if expr is of type curl_progress_callback or "similar" */ -#define _curl_is_progress_cb(expr) \ - (_curl_is_NULL(expr) || \ - __builtin_types_compatible_p(__typeof__(expr), curl_progress_callback) || \ - _curl_callback_compatible((expr), _curl_progress_callback1) || \ - _curl_callback_compatible((expr), _curl_progress_callback2)) -typedef int (_curl_progress_callback1)(void *, - double, double, double, double); -typedef int (_curl_progress_callback2)(const void *, - double, double, double, double); - -/* evaluates to true if expr is of type curl_debug_callback or "similar" */ -#define _curl_is_debug_cb(expr) \ - (_curl_is_NULL(expr) || \ - __builtin_types_compatible_p(__typeof__(expr), curl_debug_callback) || \ - _curl_callback_compatible((expr), _curl_debug_callback1) || \ - _curl_callback_compatible((expr), _curl_debug_callback2) || \ - _curl_callback_compatible((expr), _curl_debug_callback3) || \ - _curl_callback_compatible((expr), _curl_debug_callback4) || \ - _curl_callback_compatible((expr), _curl_debug_callback5) || \ - _curl_callback_compatible((expr), _curl_debug_callback6) || \ - _curl_callback_compatible((expr), _curl_debug_callback7) || \ - _curl_callback_compatible((expr), _curl_debug_callback8)) -typedef int (_curl_debug_callback1) (CURL *, - curl_infotype, char *, size_t, void *); -typedef int (_curl_debug_callback2) (CURL *, - curl_infotype, char *, size_t, const void *); -typedef int (_curl_debug_callback3) (CURL *, - curl_infotype, const char *, size_t, void *); -typedef int (_curl_debug_callback4) (CURL *, - curl_infotype, const char *, size_t, const void *); -typedef int (_curl_debug_callback5) (CURL *, - curl_infotype, unsigned char *, size_t, void *); -typedef int (_curl_debug_callback6) (CURL *, - curl_infotype, unsigned char *, size_t, const void *); -typedef int (_curl_debug_callback7) (CURL *, - curl_infotype, const unsigned char *, size_t, void *); -typedef int (_curl_debug_callback8) (CURL *, - curl_infotype, const unsigned char *, size_t, const void *); - -/* evaluates to true if expr is of type curl_ssl_ctx_callback or "similar" */ -/* this is getting even messier... */ -#define _curl_is_ssl_ctx_cb(expr) \ - (_curl_is_NULL(expr) || \ - __builtin_types_compatible_p(__typeof__(expr), curl_ssl_ctx_callback) || \ - _curl_callback_compatible((expr), _curl_ssl_ctx_callback1) || \ - _curl_callback_compatible((expr), _curl_ssl_ctx_callback2) || \ - _curl_callback_compatible((expr), _curl_ssl_ctx_callback3) || \ - _curl_callback_compatible((expr), _curl_ssl_ctx_callback4) || \ - _curl_callback_compatible((expr), _curl_ssl_ctx_callback5) || \ - _curl_callback_compatible((expr), _curl_ssl_ctx_callback6) || \ - _curl_callback_compatible((expr), _curl_ssl_ctx_callback7) || \ - _curl_callback_compatible((expr), _curl_ssl_ctx_callback8)) -typedef CURLcode (_curl_ssl_ctx_callback1)(CURL *, void *, void *); -typedef CURLcode (_curl_ssl_ctx_callback2)(CURL *, void *, const void *); -typedef CURLcode (_curl_ssl_ctx_callback3)(CURL *, const void *, void *); -typedef CURLcode (_curl_ssl_ctx_callback4)(CURL *, const void *, const void *); -#ifdef HEADER_SSL_H -/* hack: if we included OpenSSL's ssl.h, we know about SSL_CTX - * this will of course break if we're included before OpenSSL headers... - */ -typedef CURLcode (_curl_ssl_ctx_callback5)(CURL *, SSL_CTX, void *); -typedef CURLcode (_curl_ssl_ctx_callback6)(CURL *, SSL_CTX, const void *); -typedef CURLcode (_curl_ssl_ctx_callback7)(CURL *, const SSL_CTX, void *); -typedef CURLcode (_curl_ssl_ctx_callback8)(CURL *, const SSL_CTX, - const void *); -#else -typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback5; -typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback6; -typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback7; -typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback8; -#endif - -/* evaluates to true if expr is of type curl_conv_callback or "similar" */ -#define _curl_is_conv_cb(expr) \ - (_curl_is_NULL(expr) || \ - __builtin_types_compatible_p(__typeof__(expr), curl_conv_callback) || \ - _curl_callback_compatible((expr), _curl_conv_callback1) || \ - _curl_callback_compatible((expr), _curl_conv_callback2) || \ - _curl_callback_compatible((expr), _curl_conv_callback3) || \ - _curl_callback_compatible((expr), _curl_conv_callback4)) -typedef CURLcode (*_curl_conv_callback1)(char *, size_t length); -typedef CURLcode (*_curl_conv_callback2)(const char *, size_t length); -typedef CURLcode (*_curl_conv_callback3)(void *, size_t length); -typedef CURLcode (*_curl_conv_callback4)(const void *, size_t length); - -/* evaluates to true if expr is of type curl_seek_callback or "similar" */ -#define _curl_is_seek_cb(expr) \ - (_curl_is_NULL(expr) || \ - __builtin_types_compatible_p(__typeof__(expr), curl_seek_callback) || \ - _curl_callback_compatible((expr), _curl_seek_callback1) || \ - _curl_callback_compatible((expr), _curl_seek_callback2)) -typedef CURLcode (*_curl_seek_callback1)(void *, curl_off_t, int); -typedef CURLcode (*_curl_seek_callback2)(const void *, curl_off_t, int); - - -#endif /* __CURL_TYPECHECK_GCC_H */ diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftbbox.h b/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftbbox.h deleted file mode 100644 index 976691956f..0000000000 --- a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftbbox.h +++ /dev/null @@ -1,102 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftbbox.h */ -/* */ -/* FreeType exact bbox computation (specification). */ -/* */ -/* Copyright 1996-2001, 2003, 2007, 2011 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - - /*************************************************************************/ - /* */ - /* This component has a _single_ role: to compute exact outline bounding */ - /* boxes. */ - /* */ - /* It is separated from the rest of the engine for various technical */ - /* reasons. It may well be integrated in `ftoutln' later. */ - /* */ - /*************************************************************************/ - - -#ifndef __FTBBOX_H__ -#define __FTBBOX_H__ - - -#include <ft2build.h> -#include FT_FREETYPE_H - -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - - -FT_BEGIN_HEADER - - - /*************************************************************************/ - /* */ - /* <Section> */ - /* outline_processing */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Outline_Get_BBox */ - /* */ - /* <Description> */ - /* Compute the exact bounding box of an outline. This is slower */ - /* than computing the control box. However, it uses an advanced */ - /* algorithm which returns _very_ quickly when the two boxes */ - /* coincide. Otherwise, the outline Bézier arcs are traversed to */ - /* extract their extrema. */ - /* */ - /* <Input> */ - /* outline :: A pointer to the source outline. */ - /* */ - /* <Output> */ - /* abbox :: The outline's exact bounding box. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - /* <Note> */ - /* If the font is tricky and the glyph has been loaded with */ - /* @FT_LOAD_NO_SCALE, the resulting BBox is meaningless. To get */ - /* reasonable values for the BBox it is necessary to load the glyph */ - /* at a large ppem value (so that the hinting instructions can */ - /* properly shift and scale the subglyphs), then extracting the BBox */ - /* which can be eventually converted back to font units. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Outline_Get_BBox( FT_Outline* outline, - FT_BBox *abbox ); - - - /* */ - - -FT_END_HEADER - -#endif /* __FTBBOX_H__ */ - - -/* END */ - - -/* Local Variables: */ -/* coding: utf-8 */ -/* End: */ diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftbdf.h b/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftbdf.h deleted file mode 100644 index 4f8baf8401..0000000000 --- a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftbdf.h +++ /dev/null @@ -1,209 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftbdf.h */ -/* */ -/* FreeType API for accessing BDF-specific strings (specification). */ -/* */ -/* Copyright 2002, 2003, 2004, 2006, 2009 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __FTBDF_H__ -#define __FTBDF_H__ - -#include <ft2build.h> -#include FT_FREETYPE_H - -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - - -FT_BEGIN_HEADER - - - /*************************************************************************/ - /* */ - /* <Section> */ - /* bdf_fonts */ - /* */ - /* <Title> */ - /* BDF and PCF Files */ - /* */ - /* <Abstract> */ - /* BDF and PCF specific API. */ - /* */ - /* <Description> */ - /* This section contains the declaration of functions specific to BDF */ - /* and PCF fonts. */ - /* */ - /*************************************************************************/ - - - /********************************************************************** - * - * @enum: - * FT_PropertyType - * - * @description: - * A list of BDF property types. - * - * @values: - * BDF_PROPERTY_TYPE_NONE :: - * Value~0 is used to indicate a missing property. - * - * BDF_PROPERTY_TYPE_ATOM :: - * Property is a string atom. - * - * BDF_PROPERTY_TYPE_INTEGER :: - * Property is a 32-bit signed integer. - * - * BDF_PROPERTY_TYPE_CARDINAL :: - * Property is a 32-bit unsigned integer. - */ - typedef enum BDF_PropertyType_ - { - BDF_PROPERTY_TYPE_NONE = 0, - BDF_PROPERTY_TYPE_ATOM = 1, - BDF_PROPERTY_TYPE_INTEGER = 2, - BDF_PROPERTY_TYPE_CARDINAL = 3 - - } BDF_PropertyType; - - - /********************************************************************** - * - * @type: - * BDF_Property - * - * @description: - * A handle to a @BDF_PropertyRec structure to model a given - * BDF/PCF property. - */ - typedef struct BDF_PropertyRec_* BDF_Property; - - - /********************************************************************** - * - * @struct: - * BDF_PropertyRec - * - * @description: - * This structure models a given BDF/PCF property. - * - * @fields: - * type :: - * The property type. - * - * u.atom :: - * The atom string, if type is @BDF_PROPERTY_TYPE_ATOM. - * - * u.integer :: - * A signed integer, if type is @BDF_PROPERTY_TYPE_INTEGER. - * - * u.cardinal :: - * An unsigned integer, if type is @BDF_PROPERTY_TYPE_CARDINAL. - */ - typedef struct BDF_PropertyRec_ - { - BDF_PropertyType type; - union { - const char* atom; - FT_Int32 integer; - FT_UInt32 cardinal; - - } u; - - } BDF_PropertyRec; - - - /********************************************************************** - * - * @function: - * FT_Get_BDF_Charset_ID - * - * @description: - * Retrieve a BDF font character set identity, according to - * the BDF specification. - * - * @input: - * face :: - * A handle to the input face. - * - * @output: - * acharset_encoding :: - * Charset encoding, as a C~string, owned by the face. - * - * acharset_registry :: - * Charset registry, as a C~string, owned by the face. - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * This function only works with BDF faces, returning an error otherwise. - */ - FT_EXPORT( FT_Error ) - FT_Get_BDF_Charset_ID( FT_Face face, - const char* *acharset_encoding, - const char* *acharset_registry ); - - - /********************************************************************** - * - * @function: - * FT_Get_BDF_Property - * - * @description: - * Retrieve a BDF property from a BDF or PCF font file. - * - * @input: - * face :: A handle to the input face. - * - * name :: The property name. - * - * @output: - * aproperty :: The property. - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * This function works with BDF _and_ PCF fonts. It returns an error - * otherwise. It also returns an error if the property is not in the - * font. - * - * A `property' is a either key-value pair within the STARTPROPERTIES - * ... ENDPROPERTIES block of a BDF font or a key-value pair from the - * `info->props' array within a `FontRec' structure of a PCF font. - * - * Integer properties are always stored as `signed' within PCF fonts; - * consequently, @BDF_PROPERTY_TYPE_CARDINAL is a possible return value - * for BDF fonts only. - * - * In case of error, `aproperty->type' is always set to - * @BDF_PROPERTY_TYPE_NONE. - */ - FT_EXPORT( FT_Error ) - FT_Get_BDF_Property( FT_Face face, - const char* prop_name, - BDF_PropertyRec *aproperty ); - - /* */ - -FT_END_HEADER - -#endif /* __FTBDF_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftbzip2.h b/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftbzip2.h deleted file mode 100644 index 1bf81b15e8..0000000000 --- a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftbzip2.h +++ /dev/null @@ -1,102 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftbzip2.h */ -/* */ -/* Bzip2-compressed stream support. */ -/* */ -/* Copyright 2010 by */ -/* Joel Klinghed. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __FTBZIP2_H__ -#define __FTBZIP2_H__ - -#include <ft2build.h> -#include FT_FREETYPE_H - -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - - -FT_BEGIN_HEADER - - /*************************************************************************/ - /* */ - /* <Section> */ - /* bzip2 */ - /* */ - /* <Title> */ - /* BZIP2 Streams */ - /* */ - /* <Abstract> */ - /* Using bzip2-compressed font files. */ - /* */ - /* <Description> */ - /* This section contains the declaration of Bzip2-specific functions. */ - /* */ - /*************************************************************************/ - - - /************************************************************************ - * - * @function: - * FT_Stream_OpenBzip2 - * - * @description: - * Open a new stream to parse bzip2-compressed font files. This is - * mainly used to support the compressed `*.pcf.bz2' fonts that come - * with XFree86. - * - * @input: - * stream :: - * The target embedding stream. - * - * source :: - * The source stream. - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * The source stream must be opened _before_ calling this function. - * - * Calling the internal function `FT_Stream_Close' on the new stream will - * *not* call `FT_Stream_Close' on the source stream. None of the stream - * objects will be released to the heap. - * - * The stream implementation is very basic and resets the decompression - * process each time seeking backwards is needed within the stream. - * - * In certain builds of the library, bzip2 compression recognition is - * automatically handled when calling @FT_New_Face or @FT_Open_Face. - * This means that if no font driver is capable of handling the raw - * compressed file, the library will try to open a bzip2 compressed stream - * from it and re-open the face with it. - * - * This function may return `FT_Err_Unimplemented_Feature' if your build - * of FreeType was not compiled with bzip2 support. - */ - FT_EXPORT( FT_Error ) - FT_Stream_OpenBzip2( FT_Stream stream, - FT_Stream source ); - - /* */ - - -FT_END_HEADER - -#endif /* __FTBZIP2_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftcid.h b/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftcid.h deleted file mode 100644 index 203a30caf8..0000000000 --- a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftcid.h +++ /dev/null @@ -1,166 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftcid.h */ -/* */ -/* FreeType API for accessing CID font information (specification). */ -/* */ -/* Copyright 2007, 2009 by Dereg Clegg, Michael Toftdal. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __FTCID_H__ -#define __FTCID_H__ - -#include <ft2build.h> -#include FT_FREETYPE_H - -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - - -FT_BEGIN_HEADER - - - /*************************************************************************/ - /* */ - /* <Section> */ - /* cid_fonts */ - /* */ - /* <Title> */ - /* CID Fonts */ - /* */ - /* <Abstract> */ - /* CID-keyed font specific API. */ - /* */ - /* <Description> */ - /* This section contains the declaration of CID-keyed font specific */ - /* functions. */ - /* */ - /*************************************************************************/ - - - /********************************************************************** - * - * @function: - * FT_Get_CID_Registry_Ordering_Supplement - * - * @description: - * Retrieve the Registry/Ordering/Supplement triple (also known as the - * "R/O/S") from a CID-keyed font. - * - * @input: - * face :: - * A handle to the input face. - * - * @output: - * registry :: - * The registry, as a C~string, owned by the face. - * - * ordering :: - * The ordering, as a C~string, owned by the face. - * - * supplement :: - * The supplement. - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * This function only works with CID faces, returning an error - * otherwise. - * - * @since: - * 2.3.6 - */ - FT_EXPORT( FT_Error ) - FT_Get_CID_Registry_Ordering_Supplement( FT_Face face, - const char* *registry, - const char* *ordering, - FT_Int *supplement); - - - /********************************************************************** - * - * @function: - * FT_Get_CID_Is_Internally_CID_Keyed - * - * @description: - * Retrieve the type of the input face, CID keyed or not. In - * constrast to the @FT_IS_CID_KEYED macro this function returns - * successfully also for CID-keyed fonts in an SNFT wrapper. - * - * @input: - * face :: - * A handle to the input face. - * - * @output: - * is_cid :: - * The type of the face as an @FT_Bool. - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * This function only works with CID faces and OpenType fonts, - * returning an error otherwise. - * - * @since: - * 2.3.9 - */ - FT_EXPORT( FT_Error ) - FT_Get_CID_Is_Internally_CID_Keyed( FT_Face face, - FT_Bool *is_cid ); - - - /********************************************************************** - * - * @function: - * FT_Get_CID_From_Glyph_Index - * - * @description: - * Retrieve the CID of the input glyph index. - * - * @input: - * face :: - * A handle to the input face. - * - * glyph_index :: - * The input glyph index. - * - * @output: - * cid :: - * The CID as an @FT_UInt. - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * This function only works with CID faces and OpenType fonts, - * returning an error otherwise. - * - * @since: - * 2.3.9 - */ - FT_EXPORT( FT_Error ) - FT_Get_CID_From_Glyph_Index( FT_Face face, - FT_UInt glyph_index, - FT_UInt *cid ); - - /* */ - -FT_END_HEADER - -#endif /* __FTCID_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftgasp.h b/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftgasp.h deleted file mode 100644 index 453d4fa42c..0000000000 --- a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftgasp.h +++ /dev/null @@ -1,128 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftgasp.h */ -/* */ -/* Access of TrueType's `gasp' table (specification). */ -/* */ -/* Copyright 2007, 2008, 2011 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef _FT_GASP_H_ -#define _FT_GASP_H_ - -#include <ft2build.h> -#include FT_FREETYPE_H - -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - - - /*************************************************************************** - * - * @section: - * gasp_table - * - * @title: - * Gasp Table - * - * @abstract: - * Retrieving TrueType `gasp' table entries. - * - * @description: - * The function @FT_Get_Gasp can be used to query a TrueType or OpenType - * font for specific entries in its `gasp' table, if any. This is - * mainly useful when implementing native TrueType hinting with the - * bytecode interpreter to duplicate the Windows text rendering results. - */ - - /************************************************************************* - * - * @enum: - * FT_GASP_XXX - * - * @description: - * A list of values and/or bit-flags returned by the @FT_Get_Gasp - * function. - * - * @values: - * FT_GASP_NO_TABLE :: - * This special value means that there is no GASP table in this face. - * It is up to the client to decide what to do. - * - * FT_GASP_DO_GRIDFIT :: - * Grid-fitting and hinting should be performed at the specified ppem. - * This *really* means TrueType bytecode interpretation. If this bit - * is not set, no hinting gets applied. - * - * FT_GASP_DO_GRAY :: - * Anti-aliased rendering should be performed at the specified ppem. - * If not set, do monochrome rendering. - * - * FT_GASP_SYMMETRIC_SMOOTHING :: - * If set, smoothing along multiple axes must be used with ClearType. - * - * FT_GASP_SYMMETRIC_GRIDFIT :: - * Grid-fitting must be used with ClearType's symmetric smoothing. - * - * @note: - * The bit-flags `FT_GASP_DO_GRIDFIT' and `FT_GASP_DO_GRAY' are to be - * used for standard font rasterization only. Independently of that, - * `FT_GASP_SYMMETRIC_SMOOTHING' and `FT_GASP_SYMMETRIC_GRIDFIT' are to - * be used if ClearType is enabled (and `FT_GASP_DO_GRIDFIT' and - * `FT_GASP_DO_GRAY' are consequently ignored). - * - * `ClearType' is Microsoft's implementation of LCD rendering, partly - * protected by patents. - * - * @since: - * 2.3.0 - */ -#define FT_GASP_NO_TABLE -1 -#define FT_GASP_DO_GRIDFIT 0x01 -#define FT_GASP_DO_GRAY 0x02 -#define FT_GASP_SYMMETRIC_SMOOTHING 0x08 -#define FT_GASP_SYMMETRIC_GRIDFIT 0x10 - - - /************************************************************************* - * - * @func: - * FT_Get_Gasp - * - * @description: - * Read the `gasp' table from a TrueType or OpenType font file and - * return the entry corresponding to a given character pixel size. - * - * @input: - * face :: The source face handle. - * ppem :: The vertical character pixel size. - * - * @return: - * Bit flags (see @FT_GASP_XXX), or @FT_GASP_NO_TABLE if there is no - * `gasp' table in the face. - * - * @since: - * 2.3.0 - */ - FT_EXPORT( FT_Int ) - FT_Get_Gasp( FT_Face face, - FT_UInt ppem ); - -/* */ - -#endif /* _FT_GASP_H_ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftgxval.h b/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftgxval.h deleted file mode 100644 index 497015c101..0000000000 --- a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftgxval.h +++ /dev/null @@ -1,358 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftgxval.h */ -/* */ -/* FreeType API for validating TrueTypeGX/AAT tables (specification). */ -/* */ -/* Copyright 2004, 2005, 2006 by */ -/* Masatake YAMATO, Redhat K.K, */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - -/***************************************************************************/ -/* */ -/* gxvalid is derived from both gxlayout module and otvalid module. */ -/* Development of gxlayout is supported by the Information-technology */ -/* Promotion Agency(IPA), Japan. */ -/* */ -/***************************************************************************/ - - -#ifndef __FTGXVAL_H__ -#define __FTGXVAL_H__ - -#include <ft2build.h> -#include FT_FREETYPE_H - -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - - -FT_BEGIN_HEADER - - - /*************************************************************************/ - /* */ - /* <Section> */ - /* gx_validation */ - /* */ - /* <Title> */ - /* TrueTypeGX/AAT Validation */ - /* */ - /* <Abstract> */ - /* An API to validate TrueTypeGX/AAT tables. */ - /* */ - /* <Description> */ - /* This section contains the declaration of functions to validate */ - /* some TrueTypeGX tables (feat, mort, morx, bsln, just, kern, opbd, */ - /* trak, prop, lcar). */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* */ - /* Warning: Use FT_VALIDATE_XXX to validate a table. */ - /* Following definitions are for gxvalid developers. */ - /* */ - /* */ - /*************************************************************************/ - -#define FT_VALIDATE_feat_INDEX 0 -#define FT_VALIDATE_mort_INDEX 1 -#define FT_VALIDATE_morx_INDEX 2 -#define FT_VALIDATE_bsln_INDEX 3 -#define FT_VALIDATE_just_INDEX 4 -#define FT_VALIDATE_kern_INDEX 5 -#define FT_VALIDATE_opbd_INDEX 6 -#define FT_VALIDATE_trak_INDEX 7 -#define FT_VALIDATE_prop_INDEX 8 -#define FT_VALIDATE_lcar_INDEX 9 -#define FT_VALIDATE_GX_LAST_INDEX FT_VALIDATE_lcar_INDEX - - - /************************************************************************* - * - * @macro: - * FT_VALIDATE_GX_LENGTH - * - * @description: - * The number of tables checked in this module. Use it as a parameter - * for the `table-length' argument of function @FT_TrueTypeGX_Validate. - */ -#define FT_VALIDATE_GX_LENGTH (FT_VALIDATE_GX_LAST_INDEX + 1) - - /* */ - - /* Up to 0x1000 is used by otvalid. - Ox2xxx is reserved for feature OT extension. */ -#define FT_VALIDATE_GX_START 0x4000 -#define FT_VALIDATE_GX_BITFIELD( tag ) \ - ( FT_VALIDATE_GX_START << FT_VALIDATE_##tag##_INDEX ) - - - /********************************************************************** - * - * @enum: - * FT_VALIDATE_GXXXX - * - * @description: - * A list of bit-field constants used with @FT_TrueTypeGX_Validate to - * indicate which TrueTypeGX/AAT Type tables should be validated. - * - * @values: - * FT_VALIDATE_feat :: - * Validate `feat' table. - * - * FT_VALIDATE_mort :: - * Validate `mort' table. - * - * FT_VALIDATE_morx :: - * Validate `morx' table. - * - * FT_VALIDATE_bsln :: - * Validate `bsln' table. - * - * FT_VALIDATE_just :: - * Validate `just' table. - * - * FT_VALIDATE_kern :: - * Validate `kern' table. - * - * FT_VALIDATE_opbd :: - * Validate `opbd' table. - * - * FT_VALIDATE_trak :: - * Validate `trak' table. - * - * FT_VALIDATE_prop :: - * Validate `prop' table. - * - * FT_VALIDATE_lcar :: - * Validate `lcar' table. - * - * FT_VALIDATE_GX :: - * Validate all TrueTypeGX tables (feat, mort, morx, bsln, just, kern, - * opbd, trak, prop and lcar). - * - */ - -#define FT_VALIDATE_feat FT_VALIDATE_GX_BITFIELD( feat ) -#define FT_VALIDATE_mort FT_VALIDATE_GX_BITFIELD( mort ) -#define FT_VALIDATE_morx FT_VALIDATE_GX_BITFIELD( morx ) -#define FT_VALIDATE_bsln FT_VALIDATE_GX_BITFIELD( bsln ) -#define FT_VALIDATE_just FT_VALIDATE_GX_BITFIELD( just ) -#define FT_VALIDATE_kern FT_VALIDATE_GX_BITFIELD( kern ) -#define FT_VALIDATE_opbd FT_VALIDATE_GX_BITFIELD( opbd ) -#define FT_VALIDATE_trak FT_VALIDATE_GX_BITFIELD( trak ) -#define FT_VALIDATE_prop FT_VALIDATE_GX_BITFIELD( prop ) -#define FT_VALIDATE_lcar FT_VALIDATE_GX_BITFIELD( lcar ) - -#define FT_VALIDATE_GX ( FT_VALIDATE_feat | \ - FT_VALIDATE_mort | \ - FT_VALIDATE_morx | \ - FT_VALIDATE_bsln | \ - FT_VALIDATE_just | \ - FT_VALIDATE_kern | \ - FT_VALIDATE_opbd | \ - FT_VALIDATE_trak | \ - FT_VALIDATE_prop | \ - FT_VALIDATE_lcar ) - - - /* */ - - /********************************************************************** - * - * @function: - * FT_TrueTypeGX_Validate - * - * @description: - * Validate various TrueTypeGX tables to assure that all offsets and - * indices are valid. The idea is that a higher-level library which - * actually does the text layout can access those tables without - * error checking (which can be quite time consuming). - * - * @input: - * face :: - * A handle to the input face. - * - * validation_flags :: - * A bit field which specifies the tables to be validated. See - * @FT_VALIDATE_GXXXX for possible values. - * - * table_length :: - * The size of the `tables' array. Normally, @FT_VALIDATE_GX_LENGTH - * should be passed. - * - * @output: - * tables :: - * The array where all validated sfnt tables are stored. - * The array itself must be allocated by a client. - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * This function only works with TrueTypeGX fonts, returning an error - * otherwise. - * - * After use, the application should deallocate the buffers pointed to by - * each `tables' element, by calling @FT_TrueTypeGX_Free. A NULL value - * indicates that the table either doesn't exist in the font, the - * application hasn't asked for validation, or the validator doesn't have - * the ability to validate the sfnt table. - */ - FT_EXPORT( FT_Error ) - FT_TrueTypeGX_Validate( FT_Face face, - FT_UInt validation_flags, - FT_Bytes tables[FT_VALIDATE_GX_LENGTH], - FT_UInt table_length ); - - - /* */ - - /********************************************************************** - * - * @function: - * FT_TrueTypeGX_Free - * - * @description: - * Free the buffer allocated by TrueTypeGX validator. - * - * @input: - * face :: - * A handle to the input face. - * - * table :: - * The pointer to the buffer allocated by - * @FT_TrueTypeGX_Validate. - * - * @note: - * This function must be used to free the buffer allocated by - * @FT_TrueTypeGX_Validate only. - */ - FT_EXPORT( void ) - FT_TrueTypeGX_Free( FT_Face face, - FT_Bytes table ); - - - /* */ - - /********************************************************************** - * - * @enum: - * FT_VALIDATE_CKERNXXX - * - * @description: - * A list of bit-field constants used with @FT_ClassicKern_Validate - * to indicate the classic kern dialect or dialects. If the selected - * type doesn't fit, @FT_ClassicKern_Validate regards the table as - * invalid. - * - * @values: - * FT_VALIDATE_MS :: - * Handle the `kern' table as a classic Microsoft kern table. - * - * FT_VALIDATE_APPLE :: - * Handle the `kern' table as a classic Apple kern table. - * - * FT_VALIDATE_CKERN :: - * Handle the `kern' as either classic Apple or Microsoft kern table. - */ -#define FT_VALIDATE_MS ( FT_VALIDATE_GX_START << 0 ) -#define FT_VALIDATE_APPLE ( FT_VALIDATE_GX_START << 1 ) - -#define FT_VALIDATE_CKERN ( FT_VALIDATE_MS | FT_VALIDATE_APPLE ) - - - /* */ - - /********************************************************************** - * - * @function: - * FT_ClassicKern_Validate - * - * @description: - * Validate classic (16-bit format) kern table to assure that the offsets - * and indices are valid. The idea is that a higher-level library which - * actually does the text layout can access those tables without error - * checking (which can be quite time consuming). - * - * The `kern' table validator in @FT_TrueTypeGX_Validate deals with both - * the new 32-bit format and the classic 16-bit format, while - * FT_ClassicKern_Validate only supports the classic 16-bit format. - * - * @input: - * face :: - * A handle to the input face. - * - * validation_flags :: - * A bit field which specifies the dialect to be validated. See - * @FT_VALIDATE_CKERNXXX for possible values. - * - * @output: - * ckern_table :: - * A pointer to the kern table. - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * After use, the application should deallocate the buffers pointed to by - * `ckern_table', by calling @FT_ClassicKern_Free. A NULL value - * indicates that the table doesn't exist in the font. - */ - FT_EXPORT( FT_Error ) - FT_ClassicKern_Validate( FT_Face face, - FT_UInt validation_flags, - FT_Bytes *ckern_table ); - - - /* */ - - /********************************************************************** - * - * @function: - * FT_ClassicKern_Free - * - * @description: - * Free the buffer allocated by classic Kern validator. - * - * @input: - * face :: - * A handle to the input face. - * - * table :: - * The pointer to the buffer that is allocated by - * @FT_ClassicKern_Validate. - * - * @note: - * This function must be used to free the buffer allocated by - * @FT_ClassicKern_Validate only. - */ - FT_EXPORT( void ) - FT_ClassicKern_Free( FT_Face face, - FT_Bytes table ); - - - /* */ - - -FT_END_HEADER - -#endif /* __FTGXVAL_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftgzip.h b/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftgzip.h deleted file mode 100644 index acbc4f0327..0000000000 --- a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftgzip.h +++ /dev/null @@ -1,102 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftgzip.h */ -/* */ -/* Gzip-compressed stream support. */ -/* */ -/* Copyright 2002, 2003, 2004, 2006 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __FTGZIP_H__ -#define __FTGZIP_H__ - -#include <ft2build.h> -#include FT_FREETYPE_H - -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - - -FT_BEGIN_HEADER - - /*************************************************************************/ - /* */ - /* <Section> */ - /* gzip */ - /* */ - /* <Title> */ - /* GZIP Streams */ - /* */ - /* <Abstract> */ - /* Using gzip-compressed font files. */ - /* */ - /* <Description> */ - /* This section contains the declaration of Gzip-specific functions. */ - /* */ - /*************************************************************************/ - - - /************************************************************************ - * - * @function: - * FT_Stream_OpenGzip - * - * @description: - * Open a new stream to parse gzip-compressed font files. This is - * mainly used to support the compressed `*.pcf.gz' fonts that come - * with XFree86. - * - * @input: - * stream :: - * The target embedding stream. - * - * source :: - * The source stream. - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * The source stream must be opened _before_ calling this function. - * - * Calling the internal function `FT_Stream_Close' on the new stream will - * *not* call `FT_Stream_Close' on the source stream. None of the stream - * objects will be released to the heap. - * - * The stream implementation is very basic and resets the decompression - * process each time seeking backwards is needed within the stream. - * - * In certain builds of the library, gzip compression recognition is - * automatically handled when calling @FT_New_Face or @FT_Open_Face. - * This means that if no font driver is capable of handling the raw - * compressed file, the library will try to open a gzipped stream from - * it and re-open the face with it. - * - * This function may return `FT_Err_Unimplemented_Feature' if your build - * of FreeType was not compiled with zlib support. - */ - FT_EXPORT( FT_Error ) - FT_Stream_OpenGzip( FT_Stream stream, - FT_Stream source ); - - /* */ - - -FT_END_HEADER - -#endif /* __FTGZIP_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftincrem.h b/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftincrem.h deleted file mode 100644 index aaf689ff16..0000000000 --- a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftincrem.h +++ /dev/null @@ -1,353 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftincrem.h */ -/* */ -/* FreeType incremental loading (specification). */ -/* */ -/* Copyright 2002, 2003, 2006, 2007, 2008, 2010 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __FTINCREM_H__ -#define __FTINCREM_H__ - -#include <ft2build.h> -#include FT_FREETYPE_H - -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - - -FT_BEGIN_HEADER - - /*************************************************************************** - * - * @section: - * incremental - * - * @title: - * Incremental Loading - * - * @abstract: - * Custom Glyph Loading. - * - * @description: - * This section contains various functions used to perform so-called - * `incremental' glyph loading. This is a mode where all glyphs loaded - * from a given @FT_Face are provided by the client application, - * - * Apart from that, all other tables are loaded normally from the font - * file. This mode is useful when FreeType is used within another - * engine, e.g., a PostScript Imaging Processor. - * - * To enable this mode, you must use @FT_Open_Face, passing an - * @FT_Parameter with the @FT_PARAM_TAG_INCREMENTAL tag and an - * @FT_Incremental_Interface value. See the comments for - * @FT_Incremental_InterfaceRec for an example. - * - */ - - - /*************************************************************************** - * - * @type: - * FT_Incremental - * - * @description: - * An opaque type describing a user-provided object used to implement - * `incremental' glyph loading within FreeType. This is used to support - * embedded fonts in certain environments (e.g., PostScript interpreters), - * where the glyph data isn't in the font file, or must be overridden by - * different values. - * - * @note: - * It is up to client applications to create and implement @FT_Incremental - * objects, as long as they provide implementations for the methods - * @FT_Incremental_GetGlyphDataFunc, @FT_Incremental_FreeGlyphDataFunc - * and @FT_Incremental_GetGlyphMetricsFunc. - * - * See the description of @FT_Incremental_InterfaceRec to understand how - * to use incremental objects with FreeType. - * - */ - typedef struct FT_IncrementalRec_* FT_Incremental; - - - /*************************************************************************** - * - * @struct: - * FT_Incremental_MetricsRec - * - * @description: - * A small structure used to contain the basic glyph metrics returned - * by the @FT_Incremental_GetGlyphMetricsFunc method. - * - * @fields: - * bearing_x :: - * Left bearing, in font units. - * - * bearing_y :: - * Top bearing, in font units. - * - * advance :: - * Horizontal component of glyph advance, in font units. - * - * advance_v :: - * Vertical component of glyph advance, in font units. - * - * @note: - * These correspond to horizontal or vertical metrics depending on the - * value of the `vertical' argument to the function - * @FT_Incremental_GetGlyphMetricsFunc. - * - */ - typedef struct FT_Incremental_MetricsRec_ - { - FT_Long bearing_x; - FT_Long bearing_y; - FT_Long advance; - FT_Long advance_v; /* since 2.3.12 */ - - } FT_Incremental_MetricsRec; - - - /*************************************************************************** - * - * @struct: - * FT_Incremental_Metrics - * - * @description: - * A handle to an @FT_Incremental_MetricsRec structure. - * - */ - typedef struct FT_Incremental_MetricsRec_* FT_Incremental_Metrics; - - - /*************************************************************************** - * - * @type: - * FT_Incremental_GetGlyphDataFunc - * - * @description: - * A function called by FreeType to access a given glyph's data bytes - * during @FT_Load_Glyph or @FT_Load_Char if incremental loading is - * enabled. - * - * Note that the format of the glyph's data bytes depends on the font - * file format. For TrueType, it must correspond to the raw bytes within - * the `glyf' table. For PostScript formats, it must correspond to the - * *unencrypted* charstring bytes, without any `lenIV' header. It is - * undefined for any other format. - * - * @input: - * incremental :: - * Handle to an opaque @FT_Incremental handle provided by the client - * application. - * - * glyph_index :: - * Index of relevant glyph. - * - * @output: - * adata :: - * A structure describing the returned glyph data bytes (which will be - * accessed as a read-only byte block). - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * If this function returns successfully the method - * @FT_Incremental_FreeGlyphDataFunc will be called later to release - * the data bytes. - * - * Nested calls to @FT_Incremental_GetGlyphDataFunc can happen for - * compound glyphs. - * - */ - typedef FT_Error - (*FT_Incremental_GetGlyphDataFunc)( FT_Incremental incremental, - FT_UInt glyph_index, - FT_Data* adata ); - - - /*************************************************************************** - * - * @type: - * FT_Incremental_FreeGlyphDataFunc - * - * @description: - * A function used to release the glyph data bytes returned by a - * successful call to @FT_Incremental_GetGlyphDataFunc. - * - * @input: - * incremental :: - * A handle to an opaque @FT_Incremental handle provided by the client - * application. - * - * data :: - * A structure describing the glyph data bytes (which will be accessed - * as a read-only byte block). - * - */ - typedef void - (*FT_Incremental_FreeGlyphDataFunc)( FT_Incremental incremental, - FT_Data* data ); - - - /*************************************************************************** - * - * @type: - * FT_Incremental_GetGlyphMetricsFunc - * - * @description: - * A function used to retrieve the basic metrics of a given glyph index - * before accessing its data. This is necessary because, in certain - * formats like TrueType, the metrics are stored in a different place from - * the glyph images proper. - * - * @input: - * incremental :: - * A handle to an opaque @FT_Incremental handle provided by the client - * application. - * - * glyph_index :: - * Index of relevant glyph. - * - * vertical :: - * If true, return vertical metrics. - * - * ametrics :: - * This parameter is used for both input and output. - * The original glyph metrics, if any, in font units. If metrics are - * not available all the values must be set to zero. - * - * @output: - * ametrics :: - * The replacement glyph metrics in font units. - * - */ - typedef FT_Error - (*FT_Incremental_GetGlyphMetricsFunc) - ( FT_Incremental incremental, - FT_UInt glyph_index, - FT_Bool vertical, - FT_Incremental_MetricsRec *ametrics ); - - - /************************************************************************** - * - * @struct: - * FT_Incremental_FuncsRec - * - * @description: - * A table of functions for accessing fonts that load data - * incrementally. Used in @FT_Incremental_InterfaceRec. - * - * @fields: - * get_glyph_data :: - * The function to get glyph data. Must not be null. - * - * free_glyph_data :: - * The function to release glyph data. Must not be null. - * - * get_glyph_metrics :: - * The function to get glyph metrics. May be null if the font does - * not provide overriding glyph metrics. - * - */ - typedef struct FT_Incremental_FuncsRec_ - { - FT_Incremental_GetGlyphDataFunc get_glyph_data; - FT_Incremental_FreeGlyphDataFunc free_glyph_data; - FT_Incremental_GetGlyphMetricsFunc get_glyph_metrics; - - } FT_Incremental_FuncsRec; - - - /*************************************************************************** - * - * @struct: - * FT_Incremental_InterfaceRec - * - * @description: - * A structure to be used with @FT_Open_Face to indicate that the user - * wants to support incremental glyph loading. You should use it with - * @FT_PARAM_TAG_INCREMENTAL as in the following example: - * - * { - * FT_Incremental_InterfaceRec inc_int; - * FT_Parameter parameter; - * FT_Open_Args open_args; - * - * - * // set up incremental descriptor - * inc_int.funcs = my_funcs; - * inc_int.object = my_object; - * - * // set up optional parameter - * parameter.tag = FT_PARAM_TAG_INCREMENTAL; - * parameter.data = &inc_int; - * - * // set up FT_Open_Args structure - * open_args.flags = FT_OPEN_PATHNAME | FT_OPEN_PARAMS; - * open_args.pathname = my_font_pathname; - * open_args.num_params = 1; - * open_args.params = ¶meter; // we use one optional argument - * - * // open the font - * error = FT_Open_Face( library, &open_args, index, &face ); - * ... - * } - * - */ - typedef struct FT_Incremental_InterfaceRec_ - { - const FT_Incremental_FuncsRec* funcs; - FT_Incremental object; - - } FT_Incremental_InterfaceRec; - - - /*************************************************************************** - * - * @type: - * FT_Incremental_Interface - * - * @description: - * A pointer to an @FT_Incremental_InterfaceRec structure. - * - */ - typedef FT_Incremental_InterfaceRec* FT_Incremental_Interface; - - - /*************************************************************************** - * - * @constant: - * FT_PARAM_TAG_INCREMENTAL - * - * @description: - * A constant used as the tag of @FT_Parameter structures to indicate - * an incremental loading object to be used by FreeType. - * - */ -#define FT_PARAM_TAG_INCREMENTAL FT_MAKE_TAG( 'i', 'n', 'c', 'r' ) - - /* */ - -FT_END_HEADER - -#endif /* __FTINCREM_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftlist.h b/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftlist.h deleted file mode 100644 index bb6f7f119d..0000000000 --- a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftlist.h +++ /dev/null @@ -1,277 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftlist.h */ -/* */ -/* Generic list support for FreeType (specification). */ -/* */ -/* Copyright 1996-2001, 2003, 2007, 2010 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - - /*************************************************************************/ - /* */ - /* This file implements functions relative to list processing. Its */ - /* data structures are defined in `freetype.h'. */ - /* */ - /*************************************************************************/ - - -#ifndef __FTLIST_H__ -#define __FTLIST_H__ - - -#include <ft2build.h> -#include FT_FREETYPE_H - -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - - -FT_BEGIN_HEADER - - - /*************************************************************************/ - /* */ - /* <Section> */ - /* list_processing */ - /* */ - /* <Title> */ - /* List Processing */ - /* */ - /* <Abstract> */ - /* Simple management of lists. */ - /* */ - /* <Description> */ - /* This section contains various definitions related to list */ - /* processing using doubly-linked nodes. */ - /* */ - /* <Order> */ - /* FT_List */ - /* FT_ListNode */ - /* FT_ListRec */ - /* FT_ListNodeRec */ - /* */ - /* FT_List_Add */ - /* FT_List_Insert */ - /* FT_List_Find */ - /* FT_List_Remove */ - /* FT_List_Up */ - /* FT_List_Iterate */ - /* FT_List_Iterator */ - /* FT_List_Finalize */ - /* FT_List_Destructor */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_List_Find */ - /* */ - /* <Description> */ - /* Find the list node for a given listed object. */ - /* */ - /* <Input> */ - /* list :: A pointer to the parent list. */ - /* data :: The address of the listed object. */ - /* */ - /* <Return> */ - /* List node. NULL if it wasn't found. */ - /* */ - FT_EXPORT( FT_ListNode ) - FT_List_Find( FT_List list, - void* data ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_List_Add */ - /* */ - /* <Description> */ - /* Append an element to the end of a list. */ - /* */ - /* <InOut> */ - /* list :: A pointer to the parent list. */ - /* node :: The node to append. */ - /* */ - FT_EXPORT( void ) - FT_List_Add( FT_List list, - FT_ListNode node ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_List_Insert */ - /* */ - /* <Description> */ - /* Insert an element at the head of a list. */ - /* */ - /* <InOut> */ - /* list :: A pointer to parent list. */ - /* node :: The node to insert. */ - /* */ - FT_EXPORT( void ) - FT_List_Insert( FT_List list, - FT_ListNode node ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_List_Remove */ - /* */ - /* <Description> */ - /* Remove a node from a list. This function doesn't check whether */ - /* the node is in the list! */ - /* */ - /* <Input> */ - /* node :: The node to remove. */ - /* */ - /* <InOut> */ - /* list :: A pointer to the parent list. */ - /* */ - FT_EXPORT( void ) - FT_List_Remove( FT_List list, - FT_ListNode node ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_List_Up */ - /* */ - /* <Description> */ - /* Move a node to the head/top of a list. Used to maintain LRU */ - /* lists. */ - /* */ - /* <InOut> */ - /* list :: A pointer to the parent list. */ - /* node :: The node to move. */ - /* */ - FT_EXPORT( void ) - FT_List_Up( FT_List list, - FT_ListNode node ); - - - /*************************************************************************/ - /* */ - /* <FuncType> */ - /* FT_List_Iterator */ - /* */ - /* <Description> */ - /* An FT_List iterator function which is called during a list parse */ - /* by @FT_List_Iterate. */ - /* */ - /* <Input> */ - /* node :: The current iteration list node. */ - /* */ - /* user :: A typeless pointer passed to @FT_List_Iterate. */ - /* Can be used to point to the iteration's state. */ - /* */ - typedef FT_Error - (*FT_List_Iterator)( FT_ListNode node, - void* user ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_List_Iterate */ - /* */ - /* <Description> */ - /* Parse a list and calls a given iterator function on each element. */ - /* Note that parsing is stopped as soon as one of the iterator calls */ - /* returns a non-zero value. */ - /* */ - /* <Input> */ - /* list :: A handle to the list. */ - /* iterator :: An iterator function, called on each node of the list. */ - /* user :: A user-supplied field which is passed as the second */ - /* argument to the iterator. */ - /* */ - /* <Return> */ - /* The result (a FreeType error code) of the last iterator call. */ - /* */ - FT_EXPORT( FT_Error ) - FT_List_Iterate( FT_List list, - FT_List_Iterator iterator, - void* user ); - - - /*************************************************************************/ - /* */ - /* <FuncType> */ - /* FT_List_Destructor */ - /* */ - /* <Description> */ - /* An @FT_List iterator function which is called during a list */ - /* finalization by @FT_List_Finalize to destroy all elements in a */ - /* given list. */ - /* */ - /* <Input> */ - /* system :: The current system object. */ - /* */ - /* data :: The current object to destroy. */ - /* */ - /* user :: A typeless pointer passed to @FT_List_Iterate. It can */ - /* be used to point to the iteration's state. */ - /* */ - typedef void - (*FT_List_Destructor)( FT_Memory memory, - void* data, - void* user ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_List_Finalize */ - /* */ - /* <Description> */ - /* Destroy all elements in the list as well as the list itself. */ - /* */ - /* <Input> */ - /* list :: A handle to the list. */ - /* */ - /* destroy :: A list destructor that will be applied to each element */ - /* of the list. */ - /* */ - /* memory :: The current memory object which handles deallocation. */ - /* */ - /* user :: A user-supplied field which is passed as the last */ - /* argument to the destructor. */ - /* */ - /* <Note> */ - /* This function expects that all nodes added by @FT_List_Add or */ - /* @FT_List_Insert have been dynamically allocated. */ - /* */ - FT_EXPORT( void ) - FT_List_Finalize( FT_List list, - FT_List_Destructor destroy, - FT_Memory memory, - void* user ); - - - /* */ - - -FT_END_HEADER - -#endif /* __FTLIST_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftlzw.h b/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftlzw.h deleted file mode 100644 index 00d40169a7..0000000000 --- a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftlzw.h +++ /dev/null @@ -1,99 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftlzw.h */ -/* */ -/* LZW-compressed stream support. */ -/* */ -/* Copyright 2004, 2006 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __FTLZW_H__ -#define __FTLZW_H__ - -#include <ft2build.h> -#include FT_FREETYPE_H - -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - - -FT_BEGIN_HEADER - - /*************************************************************************/ - /* */ - /* <Section> */ - /* lzw */ - /* */ - /* <Title> */ - /* LZW Streams */ - /* */ - /* <Abstract> */ - /* Using LZW-compressed font files. */ - /* */ - /* <Description> */ - /* This section contains the declaration of LZW-specific functions. */ - /* */ - /*************************************************************************/ - - /************************************************************************ - * - * @function: - * FT_Stream_OpenLZW - * - * @description: - * Open a new stream to parse LZW-compressed font files. This is - * mainly used to support the compressed `*.pcf.Z' fonts that come - * with XFree86. - * - * @input: - * stream :: The target embedding stream. - * - * source :: The source stream. - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * The source stream must be opened _before_ calling this function. - * - * Calling the internal function `FT_Stream_Close' on the new stream will - * *not* call `FT_Stream_Close' on the source stream. None of the stream - * objects will be released to the heap. - * - * The stream implementation is very basic and resets the decompression - * process each time seeking backwards is needed within the stream - * - * In certain builds of the library, LZW compression recognition is - * automatically handled when calling @FT_New_Face or @FT_Open_Face. - * This means that if no font driver is capable of handling the raw - * compressed file, the library will try to open a LZW stream from it - * and re-open the face with it. - * - * This function may return `FT_Err_Unimplemented_Feature' if your build - * of FreeType was not compiled with LZW support. - */ - FT_EXPORT( FT_Error ) - FT_Stream_OpenLZW( FT_Stream stream, - FT_Stream source ); - - /* */ - - -FT_END_HEADER - -#endif /* __FTLZW_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftmac.h b/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftmac.h deleted file mode 100644 index ab5bab5170..0000000000 --- a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftmac.h +++ /dev/null @@ -1,274 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftmac.h */ -/* */ -/* Additional Mac-specific API. */ -/* */ -/* Copyright 1996-2001, 2004, 2006, 2007 by */ -/* Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -/***************************************************************************/ -/* */ -/* NOTE: Include this file after <freetype/freetype.h> and after any */ -/* Mac-specific headers (because this header uses Mac types such as */ -/* Handle, FSSpec, FSRef, etc.) */ -/* */ -/***************************************************************************/ - - -#ifndef __FTMAC_H__ -#define __FTMAC_H__ - - -#include <ft2build.h> - - -FT_BEGIN_HEADER - - -/* gcc-3.4.1 and later can warn about functions tagged as deprecated */ -#ifndef FT_DEPRECATED_ATTRIBUTE -#if defined(__GNUC__) && \ - ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1))) -#define FT_DEPRECATED_ATTRIBUTE __attribute__((deprecated)) -#else -#define FT_DEPRECATED_ATTRIBUTE -#endif -#endif - - - /*************************************************************************/ - /* */ - /* <Section> */ - /* mac_specific */ - /* */ - /* <Title> */ - /* Mac Specific Interface */ - /* */ - /* <Abstract> */ - /* Only available on the Macintosh. */ - /* */ - /* <Description> */ - /* The following definitions are only available if FreeType is */ - /* compiled on a Macintosh. */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_New_Face_From_FOND */ - /* */ - /* <Description> */ - /* Create a new face object from a FOND resource. */ - /* */ - /* <InOut> */ - /* library :: A handle to the library resource. */ - /* */ - /* <Input> */ - /* fond :: A FOND resource. */ - /* */ - /* face_index :: Only supported for the -1 `sanity check' special */ - /* case. */ - /* */ - /* <Output> */ - /* aface :: A handle to a new face object. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - /* <Notes> */ - /* This function can be used to create @FT_Face objects from fonts */ - /* that are installed in the system as follows. */ - /* */ - /* { */ - /* fond = GetResource( 'FOND', fontName ); */ - /* error = FT_New_Face_From_FOND( library, fond, 0, &face ); */ - /* } */ - /* */ - FT_EXPORT( FT_Error ) - FT_New_Face_From_FOND( FT_Library library, - Handle fond, - FT_Long face_index, - FT_Face *aface ) - FT_DEPRECATED_ATTRIBUTE; - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_GetFile_From_Mac_Name */ - /* */ - /* <Description> */ - /* Return an FSSpec for the disk file containing the named font. */ - /* */ - /* <Input> */ - /* fontName :: Mac OS name of the font (e.g., Times New Roman */ - /* Bold). */ - /* */ - /* <Output> */ - /* pathSpec :: FSSpec to the file. For passing to */ - /* @FT_New_Face_From_FSSpec. */ - /* */ - /* face_index :: Index of the face. For passing to */ - /* @FT_New_Face_From_FSSpec. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - FT_EXPORT( FT_Error ) - FT_GetFile_From_Mac_Name( const char* fontName, - FSSpec* pathSpec, - FT_Long* face_index ) - FT_DEPRECATED_ATTRIBUTE; - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_GetFile_From_Mac_ATS_Name */ - /* */ - /* <Description> */ - /* Return an FSSpec for the disk file containing the named font. */ - /* */ - /* <Input> */ - /* fontName :: Mac OS name of the font in ATS framework. */ - /* */ - /* <Output> */ - /* pathSpec :: FSSpec to the file. For passing to */ - /* @FT_New_Face_From_FSSpec. */ - /* */ - /* face_index :: Index of the face. For passing to */ - /* @FT_New_Face_From_FSSpec. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - FT_EXPORT( FT_Error ) - FT_GetFile_From_Mac_ATS_Name( const char* fontName, - FSSpec* pathSpec, - FT_Long* face_index ) - FT_DEPRECATED_ATTRIBUTE; - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_GetFilePath_From_Mac_ATS_Name */ - /* */ - /* <Description> */ - /* Return a pathname of the disk file and face index for given font */ - /* name which is handled by ATS framework. */ - /* */ - /* <Input> */ - /* fontName :: Mac OS name of the font in ATS framework. */ - /* */ - /* <Output> */ - /* path :: Buffer to store pathname of the file. For passing */ - /* to @FT_New_Face. The client must allocate this */ - /* buffer before calling this function. */ - /* */ - /* maxPathSize :: Lengths of the buffer `path' that client allocated. */ - /* */ - /* face_index :: Index of the face. For passing to @FT_New_Face. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - FT_EXPORT( FT_Error ) - FT_GetFilePath_From_Mac_ATS_Name( const char* fontName, - UInt8* path, - UInt32 maxPathSize, - FT_Long* face_index ) - FT_DEPRECATED_ATTRIBUTE; - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_New_Face_From_FSSpec */ - /* */ - /* <Description> */ - /* Create a new face object from a given resource and typeface index */ - /* using an FSSpec to the font file. */ - /* */ - /* <InOut> */ - /* library :: A handle to the library resource. */ - /* */ - /* <Input> */ - /* spec :: FSSpec to the font file. */ - /* */ - /* face_index :: The index of the face within the resource. The */ - /* first face has index~0. */ - /* <Output> */ - /* aface :: A handle to a new face object. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - /* <Note> */ - /* @FT_New_Face_From_FSSpec is identical to @FT_New_Face except */ - /* it accepts an FSSpec instead of a path. */ - /* */ - FT_EXPORT( FT_Error ) - FT_New_Face_From_FSSpec( FT_Library library, - const FSSpec *spec, - FT_Long face_index, - FT_Face *aface ) - FT_DEPRECATED_ATTRIBUTE; - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_New_Face_From_FSRef */ - /* */ - /* <Description> */ - /* Create a new face object from a given resource and typeface index */ - /* using an FSRef to the font file. */ - /* */ - /* <InOut> */ - /* library :: A handle to the library resource. */ - /* */ - /* <Input> */ - /* spec :: FSRef to the font file. */ - /* */ - /* face_index :: The index of the face within the resource. The */ - /* first face has index~0. */ - /* <Output> */ - /* aface :: A handle to a new face object. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - /* <Note> */ - /* @FT_New_Face_From_FSRef is identical to @FT_New_Face except */ - /* it accepts an FSRef instead of a path. */ - /* */ - FT_EXPORT( FT_Error ) - FT_New_Face_From_FSRef( FT_Library library, - const FSRef *ref, - FT_Long face_index, - FT_Face *aface ) - FT_DEPRECATED_ATTRIBUTE; - - /* */ - - -FT_END_HEADER - - -#endif /* __FTMAC_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftmm.h b/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftmm.h deleted file mode 100644 index 3aefb9e4f2..0000000000 --- a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftmm.h +++ /dev/null @@ -1,378 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftmm.h */ -/* */ -/* FreeType Multiple Master font interface (specification). */ -/* */ -/* Copyright 1996-2001, 2003, 2004, 2006, 2009 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __FTMM_H__ -#define __FTMM_H__ - - -#include <ft2build.h> -#include FT_TYPE1_TABLES_H - - -FT_BEGIN_HEADER - - - /*************************************************************************/ - /* */ - /* <Section> */ - /* multiple_masters */ - /* */ - /* <Title> */ - /* Multiple Masters */ - /* */ - /* <Abstract> */ - /* How to manage Multiple Masters fonts. */ - /* */ - /* <Description> */ - /* The following types and functions are used to manage Multiple */ - /* Master fonts, i.e., the selection of specific design instances by */ - /* setting design axis coordinates. */ - /* */ - /* George Williams has extended this interface to make it work with */ - /* both Type~1 Multiple Masters fonts and GX distortable (var) */ - /* fonts. Some of these routines only work with MM fonts, others */ - /* will work with both types. They are similar enough that a */ - /* consistent interface makes sense. */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FT_MM_Axis */ - /* */ - /* <Description> */ - /* A simple structure used to model a given axis in design space for */ - /* Multiple Masters fonts. */ - /* */ - /* This structure can't be used for GX var fonts. */ - /* */ - /* <Fields> */ - /* name :: The axis's name. */ - /* */ - /* minimum :: The axis's minimum design coordinate. */ - /* */ - /* maximum :: The axis's maximum design coordinate. */ - /* */ - typedef struct FT_MM_Axis_ - { - FT_String* name; - FT_Long minimum; - FT_Long maximum; - - } FT_MM_Axis; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FT_Multi_Master */ - /* */ - /* <Description> */ - /* A structure used to model the axes and space of a Multiple Masters */ - /* font. */ - /* */ - /* This structure can't be used for GX var fonts. */ - /* */ - /* <Fields> */ - /* num_axis :: Number of axes. Cannot exceed~4. */ - /* */ - /* num_designs :: Number of designs; should be normally 2^num_axis */ - /* even though the Type~1 specification strangely */ - /* allows for intermediate designs to be present. This */ - /* number cannot exceed~16. */ - /* */ - /* axis :: A table of axis descriptors. */ - /* */ - typedef struct FT_Multi_Master_ - { - FT_UInt num_axis; - FT_UInt num_designs; - FT_MM_Axis axis[T1_MAX_MM_AXIS]; - - } FT_Multi_Master; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FT_Var_Axis */ - /* */ - /* <Description> */ - /* A simple structure used to model a given axis in design space for */ - /* Multiple Masters and GX var fonts. */ - /* */ - /* <Fields> */ - /* name :: The axis's name. */ - /* Not always meaningful for GX. */ - /* */ - /* minimum :: The axis's minimum design coordinate. */ - /* */ - /* def :: The axis's default design coordinate. */ - /* FreeType computes meaningful default values for MM; it */ - /* is then an integer value, not in 16.16 format. */ - /* */ - /* maximum :: The axis's maximum design coordinate. */ - /* */ - /* tag :: The axis's tag (the GX equivalent to `name'). */ - /* FreeType provides default values for MM if possible. */ - /* */ - /* strid :: The entry in `name' table (another GX version of */ - /* `name'). */ - /* Not meaningful for MM. */ - /* */ - typedef struct FT_Var_Axis_ - { - FT_String* name; - - FT_Fixed minimum; - FT_Fixed def; - FT_Fixed maximum; - - FT_ULong tag; - FT_UInt strid; - - } FT_Var_Axis; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FT_Var_Named_Style */ - /* */ - /* <Description> */ - /* A simple structure used to model a named style in a GX var font. */ - /* */ - /* This structure can't be used for MM fonts. */ - /* */ - /* <Fields> */ - /* coords :: The design coordinates for this style. */ - /* This is an array with one entry for each axis. */ - /* */ - /* strid :: The entry in `name' table identifying this style. */ - /* */ - typedef struct FT_Var_Named_Style_ - { - FT_Fixed* coords; - FT_UInt strid; - - } FT_Var_Named_Style; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FT_MM_Var */ - /* */ - /* <Description> */ - /* A structure used to model the axes and space of a Multiple Masters */ - /* or GX var distortable font. */ - /* */ - /* Some fields are specific to one format and not to the other. */ - /* */ - /* <Fields> */ - /* num_axis :: The number of axes. The maximum value is~4 for */ - /* MM; no limit in GX. */ - /* */ - /* num_designs :: The number of designs; should be normally */ - /* 2^num_axis for MM fonts. Not meaningful for GX */ - /* (where every glyph could have a different */ - /* number of designs). */ - /* */ - /* num_namedstyles :: The number of named styles; only meaningful for */ - /* GX which allows certain design coordinates to */ - /* have a string ID (in the `name' table) */ - /* associated with them. The font can tell the */ - /* user that, for example, Weight=1.5 is `Bold'. */ - /* */ - /* axis :: A table of axis descriptors. */ - /* GX fonts contain slightly more data than MM. */ - /* */ - /* namedstyles :: A table of named styles. */ - /* Only meaningful with GX. */ - /* */ - typedef struct FT_MM_Var_ - { - FT_UInt num_axis; - FT_UInt num_designs; - FT_UInt num_namedstyles; - FT_Var_Axis* axis; - FT_Var_Named_Style* namedstyle; - - } FT_MM_Var; - - - /* */ - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Get_Multi_Master */ - /* */ - /* <Description> */ - /* Retrieve the Multiple Master descriptor of a given font. */ - /* */ - /* This function can't be used with GX fonts. */ - /* */ - /* <Input> */ - /* face :: A handle to the source face. */ - /* */ - /* <Output> */ - /* amaster :: The Multiple Masters descriptor. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Get_Multi_Master( FT_Face face, - FT_Multi_Master *amaster ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Get_MM_Var */ - /* */ - /* <Description> */ - /* Retrieve the Multiple Master/GX var descriptor of a given font. */ - /* */ - /* <Input> */ - /* face :: A handle to the source face. */ - /* */ - /* <Output> */ - /* amaster :: The Multiple Masters/GX var descriptor. */ - /* Allocates a data structure, which the user must free */ - /* (a single call to FT_FREE will do it). */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Get_MM_Var( FT_Face face, - FT_MM_Var* *amaster ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Set_MM_Design_Coordinates */ - /* */ - /* <Description> */ - /* For Multiple Masters fonts, choose an interpolated font design */ - /* through design coordinates. */ - /* */ - /* This function can't be used with GX fonts. */ - /* */ - /* <InOut> */ - /* face :: A handle to the source face. */ - /* */ - /* <Input> */ - /* num_coords :: The number of design coordinates (must be equal to */ - /* the number of axes in the font). */ - /* */ - /* coords :: An array of design coordinates. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Set_MM_Design_Coordinates( FT_Face face, - FT_UInt num_coords, - FT_Long* coords ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Set_Var_Design_Coordinates */ - /* */ - /* <Description> */ - /* For Multiple Master or GX Var fonts, choose an interpolated font */ - /* design through design coordinates. */ - /* */ - /* <InOut> */ - /* face :: A handle to the source face. */ - /* */ - /* <Input> */ - /* num_coords :: The number of design coordinates (must be equal to */ - /* the number of axes in the font). */ - /* */ - /* coords :: An array of design coordinates. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Set_Var_Design_Coordinates( FT_Face face, - FT_UInt num_coords, - FT_Fixed* coords ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Set_MM_Blend_Coordinates */ - /* */ - /* <Description> */ - /* For Multiple Masters and GX var fonts, choose an interpolated font */ - /* design through normalized blend coordinates. */ - /* */ - /* <InOut> */ - /* face :: A handle to the source face. */ - /* */ - /* <Input> */ - /* num_coords :: The number of design coordinates (must be equal to */ - /* the number of axes in the font). */ - /* */ - /* coords :: The design coordinates array (each element must be */ - /* between 0 and 1.0). */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Set_MM_Blend_Coordinates( FT_Face face, - FT_UInt num_coords, - FT_Fixed* coords ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Set_Var_Blend_Coordinates */ - /* */ - /* <Description> */ - /* This is another name of @FT_Set_MM_Blend_Coordinates. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Set_Var_Blend_Coordinates( FT_Face face, - FT_UInt num_coords, - FT_Fixed* coords ); - - - /* */ - - -FT_END_HEADER - -#endif /* __FTMM_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftotval.h b/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftotval.h deleted file mode 100644 index 027f2e8865..0000000000 --- a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftotval.h +++ /dev/null @@ -1,203 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftotval.h */ -/* */ -/* FreeType API for validating OpenType tables (specification). */ -/* */ -/* Copyright 2004, 2005, 2006, 2007 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -/***************************************************************************/ -/* */ -/* */ -/* Warning: This module might be moved to a different library in the */ -/* future to avoid a tight dependency between FreeType and the */ -/* OpenType specification. */ -/* */ -/* */ -/***************************************************************************/ - - -#ifndef __FTOTVAL_H__ -#define __FTOTVAL_H__ - -#include <ft2build.h> -#include FT_FREETYPE_H - -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - - -FT_BEGIN_HEADER - - - /*************************************************************************/ - /* */ - /* <Section> */ - /* ot_validation */ - /* */ - /* <Title> */ - /* OpenType Validation */ - /* */ - /* <Abstract> */ - /* An API to validate OpenType tables. */ - /* */ - /* <Description> */ - /* This section contains the declaration of functions to validate */ - /* some OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH). */ - /* */ - /*************************************************************************/ - - - /********************************************************************** - * - * @enum: - * FT_VALIDATE_OTXXX - * - * @description: - * A list of bit-field constants used with @FT_OpenType_Validate to - * indicate which OpenType tables should be validated. - * - * @values: - * FT_VALIDATE_BASE :: - * Validate BASE table. - * - * FT_VALIDATE_GDEF :: - * Validate GDEF table. - * - * FT_VALIDATE_GPOS :: - * Validate GPOS table. - * - * FT_VALIDATE_GSUB :: - * Validate GSUB table. - * - * FT_VALIDATE_JSTF :: - * Validate JSTF table. - * - * FT_VALIDATE_MATH :: - * Validate MATH table. - * - * FT_VALIDATE_OT :: - * Validate all OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH). - * - */ -#define FT_VALIDATE_BASE 0x0100 -#define FT_VALIDATE_GDEF 0x0200 -#define FT_VALIDATE_GPOS 0x0400 -#define FT_VALIDATE_GSUB 0x0800 -#define FT_VALIDATE_JSTF 0x1000 -#define FT_VALIDATE_MATH 0x2000 - -#define FT_VALIDATE_OT FT_VALIDATE_BASE | \ - FT_VALIDATE_GDEF | \ - FT_VALIDATE_GPOS | \ - FT_VALIDATE_GSUB | \ - FT_VALIDATE_JSTF | \ - FT_VALIDATE_MATH - - /* */ - - /********************************************************************** - * - * @function: - * FT_OpenType_Validate - * - * @description: - * Validate various OpenType tables to assure that all offsets and - * indices are valid. The idea is that a higher-level library which - * actually does the text layout can access those tables without - * error checking (which can be quite time consuming). - * - * @input: - * face :: - * A handle to the input face. - * - * validation_flags :: - * A bit field which specifies the tables to be validated. See - * @FT_VALIDATE_OTXXX for possible values. - * - * @output: - * BASE_table :: - * A pointer to the BASE table. - * - * GDEF_table :: - * A pointer to the GDEF table. - * - * GPOS_table :: - * A pointer to the GPOS table. - * - * GSUB_table :: - * A pointer to the GSUB table. - * - * JSTF_table :: - * A pointer to the JSTF table. - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * This function only works with OpenType fonts, returning an error - * otherwise. - * - * After use, the application should deallocate the five tables with - * @FT_OpenType_Free. A NULL value indicates that the table either - * doesn't exist in the font, or the application hasn't asked for - * validation. - */ - FT_EXPORT( FT_Error ) - FT_OpenType_Validate( FT_Face face, - FT_UInt validation_flags, - FT_Bytes *BASE_table, - FT_Bytes *GDEF_table, - FT_Bytes *GPOS_table, - FT_Bytes *GSUB_table, - FT_Bytes *JSTF_table ); - - /* */ - - /********************************************************************** - * - * @function: - * FT_OpenType_Free - * - * @description: - * Free the buffer allocated by OpenType validator. - * - * @input: - * face :: - * A handle to the input face. - * - * table :: - * The pointer to the buffer that is allocated by - * @FT_OpenType_Validate. - * - * @note: - * This function must be used to free the buffer allocated by - * @FT_OpenType_Validate only. - */ - FT_EXPORT( void ) - FT_OpenType_Free( FT_Face face, - FT_Bytes table ); - - - /* */ - - -FT_END_HEADER - -#endif /* __FTOTVAL_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftpfr.h b/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftpfr.h deleted file mode 100644 index 0b7b7d427c..0000000000 --- a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftpfr.h +++ /dev/null @@ -1,172 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftpfr.h */ -/* */ -/* FreeType API for accessing PFR-specific data (specification only). */ -/* */ -/* Copyright 2002, 2003, 2004, 2006, 2008, 2009 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __FTPFR_H__ -#define __FTPFR_H__ - -#include <ft2build.h> -#include FT_FREETYPE_H - -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - - -FT_BEGIN_HEADER - - - /*************************************************************************/ - /* */ - /* <Section> */ - /* pfr_fonts */ - /* */ - /* <Title> */ - /* PFR Fonts */ - /* */ - /* <Abstract> */ - /* PFR/TrueDoc specific API. */ - /* */ - /* <Description> */ - /* This section contains the declaration of PFR-specific functions. */ - /* */ - /*************************************************************************/ - - - /********************************************************************** - * - * @function: - * FT_Get_PFR_Metrics - * - * @description: - * Return the outline and metrics resolutions of a given PFR face. - * - * @input: - * face :: Handle to the input face. It can be a non-PFR face. - * - * @output: - * aoutline_resolution :: - * Outline resolution. This is equivalent to `face->units_per_EM' - * for non-PFR fonts. Optional (parameter can be NULL). - * - * ametrics_resolution :: - * Metrics resolution. This is equivalent to `outline_resolution' - * for non-PFR fonts. Optional (parameter can be NULL). - * - * ametrics_x_scale :: - * A 16.16 fixed-point number used to scale distance expressed - * in metrics units to device sub-pixels. This is equivalent to - * `face->size->x_scale', but for metrics only. Optional (parameter - * can be NULL). - * - * ametrics_y_scale :: - * Same as `ametrics_x_scale' but for the vertical direction. - * optional (parameter can be NULL). - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * If the input face is not a PFR, this function will return an error. - * However, in all cases, it will return valid values. - */ - FT_EXPORT( FT_Error ) - FT_Get_PFR_Metrics( FT_Face face, - FT_UInt *aoutline_resolution, - FT_UInt *ametrics_resolution, - FT_Fixed *ametrics_x_scale, - FT_Fixed *ametrics_y_scale ); - - - /********************************************************************** - * - * @function: - * FT_Get_PFR_Kerning - * - * @description: - * Return the kerning pair corresponding to two glyphs in a PFR face. - * The distance is expressed in metrics units, unlike the result of - * @FT_Get_Kerning. - * - * @input: - * face :: A handle to the input face. - * - * left :: Index of the left glyph. - * - * right :: Index of the right glyph. - * - * @output: - * avector :: A kerning vector. - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * This function always return distances in original PFR metrics - * units. This is unlike @FT_Get_Kerning with the @FT_KERNING_UNSCALED - * mode, which always returns distances converted to outline units. - * - * You can use the value of the `x_scale' and `y_scale' parameters - * returned by @FT_Get_PFR_Metrics to scale these to device sub-pixels. - */ - FT_EXPORT( FT_Error ) - FT_Get_PFR_Kerning( FT_Face face, - FT_UInt left, - FT_UInt right, - FT_Vector *avector ); - - - /********************************************************************** - * - * @function: - * FT_Get_PFR_Advance - * - * @description: - * Return a given glyph advance, expressed in original metrics units, - * from a PFR font. - * - * @input: - * face :: A handle to the input face. - * - * gindex :: The glyph index. - * - * @output: - * aadvance :: The glyph advance in metrics units. - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * You can use the `x_scale' or `y_scale' results of @FT_Get_PFR_Metrics - * to convert the advance to device sub-pixels (i.e., 1/64th of pixels). - */ - FT_EXPORT( FT_Error ) - FT_Get_PFR_Advance( FT_Face face, - FT_UInt gindex, - FT_Pos *aadvance ); - - /* */ - - -FT_END_HEADER - -#endif /* __FTPFR_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftrender.h b/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftrender.h deleted file mode 100644 index dd0229b815..0000000000 --- a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftrender.h +++ /dev/null @@ -1,238 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftrender.h */ -/* */ -/* FreeType renderer modules public interface (specification). */ -/* */ -/* Copyright 1996-2001, 2005, 2006, 2010 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __FTRENDER_H__ -#define __FTRENDER_H__ - - -#include <ft2build.h> -#include FT_MODULE_H -#include FT_GLYPH_H - - -FT_BEGIN_HEADER - - - /*************************************************************************/ - /* */ - /* <Section> */ - /* module_management */ - /* */ - /*************************************************************************/ - - - /* create a new glyph object */ - typedef FT_Error - (*FT_Glyph_InitFunc)( FT_Glyph glyph, - FT_GlyphSlot slot ); - - /* destroys a given glyph object */ - typedef void - (*FT_Glyph_DoneFunc)( FT_Glyph glyph ); - - typedef void - (*FT_Glyph_TransformFunc)( FT_Glyph glyph, - const FT_Matrix* matrix, - const FT_Vector* delta ); - - typedef void - (*FT_Glyph_GetBBoxFunc)( FT_Glyph glyph, - FT_BBox* abbox ); - - typedef FT_Error - (*FT_Glyph_CopyFunc)( FT_Glyph source, - FT_Glyph target ); - - typedef FT_Error - (*FT_Glyph_PrepareFunc)( FT_Glyph glyph, - FT_GlyphSlot slot ); - -/* deprecated */ -#define FT_Glyph_Init_Func FT_Glyph_InitFunc -#define FT_Glyph_Done_Func FT_Glyph_DoneFunc -#define FT_Glyph_Transform_Func FT_Glyph_TransformFunc -#define FT_Glyph_BBox_Func FT_Glyph_GetBBoxFunc -#define FT_Glyph_Copy_Func FT_Glyph_CopyFunc -#define FT_Glyph_Prepare_Func FT_Glyph_PrepareFunc - - - struct FT_Glyph_Class_ - { - FT_Long glyph_size; - FT_Glyph_Format glyph_format; - FT_Glyph_InitFunc glyph_init; - FT_Glyph_DoneFunc glyph_done; - FT_Glyph_CopyFunc glyph_copy; - FT_Glyph_TransformFunc glyph_transform; - FT_Glyph_GetBBoxFunc glyph_bbox; - FT_Glyph_PrepareFunc glyph_prepare; - }; - - - typedef FT_Error - (*FT_Renderer_RenderFunc)( FT_Renderer renderer, - FT_GlyphSlot slot, - FT_UInt mode, - const FT_Vector* origin ); - - typedef FT_Error - (*FT_Renderer_TransformFunc)( FT_Renderer renderer, - FT_GlyphSlot slot, - const FT_Matrix* matrix, - const FT_Vector* delta ); - - - typedef void - (*FT_Renderer_GetCBoxFunc)( FT_Renderer renderer, - FT_GlyphSlot slot, - FT_BBox* cbox ); - - - typedef FT_Error - (*FT_Renderer_SetModeFunc)( FT_Renderer renderer, - FT_ULong mode_tag, - FT_Pointer mode_ptr ); - -/* deprecated identifiers */ -#define FTRenderer_render FT_Renderer_RenderFunc -#define FTRenderer_transform FT_Renderer_TransformFunc -#define FTRenderer_getCBox FT_Renderer_GetCBoxFunc -#define FTRenderer_setMode FT_Renderer_SetModeFunc - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FT_Renderer_Class */ - /* */ - /* <Description> */ - /* The renderer module class descriptor. */ - /* */ - /* <Fields> */ - /* root :: The root @FT_Module_Class fields. */ - /* */ - /* glyph_format :: The glyph image format this renderer handles. */ - /* */ - /* render_glyph :: A method used to render the image that is in a */ - /* given glyph slot into a bitmap. */ - /* */ - /* transform_glyph :: A method used to transform the image that is in */ - /* a given glyph slot. */ - /* */ - /* get_glyph_cbox :: A method used to access the glyph's cbox. */ - /* */ - /* set_mode :: A method used to pass additional parameters. */ - /* */ - /* raster_class :: For @FT_GLYPH_FORMAT_OUTLINE renderers only. */ - /* This is a pointer to its raster's class. */ - /* */ - typedef struct FT_Renderer_Class_ - { - FT_Module_Class root; - - FT_Glyph_Format glyph_format; - - FT_Renderer_RenderFunc render_glyph; - FT_Renderer_TransformFunc transform_glyph; - FT_Renderer_GetCBoxFunc get_glyph_cbox; - FT_Renderer_SetModeFunc set_mode; - - FT_Raster_Funcs* raster_class; - - } FT_Renderer_Class; - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Get_Renderer */ - /* */ - /* <Description> */ - /* Retrieve the current renderer for a given glyph format. */ - /* */ - /* <Input> */ - /* library :: A handle to the library object. */ - /* */ - /* format :: The glyph format. */ - /* */ - /* <Return> */ - /* A renderer handle. 0~if none found. */ - /* */ - /* <Note> */ - /* An error will be returned if a module already exists by that name, */ - /* or if the module requires a version of FreeType that is too great. */ - /* */ - /* To add a new renderer, simply use @FT_Add_Module. To retrieve a */ - /* renderer by its name, use @FT_Get_Module. */ - /* */ - FT_EXPORT( FT_Renderer ) - FT_Get_Renderer( FT_Library library, - FT_Glyph_Format format ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Set_Renderer */ - /* */ - /* <Description> */ - /* Set the current renderer to use, and set additional mode. */ - /* */ - /* <InOut> */ - /* library :: A handle to the library object. */ - /* */ - /* <Input> */ - /* renderer :: A handle to the renderer object. */ - /* */ - /* num_params :: The number of additional parameters. */ - /* */ - /* parameters :: Additional parameters. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - /* <Note> */ - /* In case of success, the renderer will be used to convert glyph */ - /* images in the renderer's known format into bitmaps. */ - /* */ - /* This doesn't change the current renderer for other formats. */ - /* */ - /* Currently, only the B/W renderer, if compiled with */ - /* FT_RASTER_OPTION_ANTI_ALIASING (providing a 5-levels */ - /* anti-aliasing mode; this option must be set directly in */ - /* `ftraster.c' and is undefined by default) accepts a single tag */ - /* `pal5' to set its gray palette as a character string with */ - /* 5~elements. Consequently, the third and fourth argument are zero */ - /* normally. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Set_Renderer( FT_Library library, - FT_Renderer renderer, - FT_UInt num_params, - FT_Parameter* parameters ); - - - /* */ - - -FT_END_HEADER - -#endif /* __FTRENDER_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftsizes.h b/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftsizes.h deleted file mode 100644 index 3e548cc39f..0000000000 --- a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftsizes.h +++ /dev/null @@ -1,159 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftsizes.h */ -/* */ -/* FreeType size objects management (specification). */ -/* */ -/* Copyright 1996-2001, 2003, 2004, 2006, 2009 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - - /*************************************************************************/ - /* */ - /* Typical application would normally not need to use these functions. */ - /* However, they have been placed in a public API for the rare cases */ - /* where they are needed. */ - /* */ - /*************************************************************************/ - - -#ifndef __FTSIZES_H__ -#define __FTSIZES_H__ - - -#include <ft2build.h> -#include FT_FREETYPE_H - -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - - -FT_BEGIN_HEADER - - - /*************************************************************************/ - /* */ - /* <Section> */ - /* sizes_management */ - /* */ - /* <Title> */ - /* Size Management */ - /* */ - /* <Abstract> */ - /* Managing multiple sizes per face. */ - /* */ - /* <Description> */ - /* When creating a new face object (e.g., with @FT_New_Face), an */ - /* @FT_Size object is automatically created and used to store all */ - /* pixel-size dependent information, available in the `face->size' */ - /* field. */ - /* */ - /* It is however possible to create more sizes for a given face, */ - /* mostly in order to manage several character pixel sizes of the */ - /* same font family and style. See @FT_New_Size and @FT_Done_Size. */ - /* */ - /* Note that @FT_Set_Pixel_Sizes and @FT_Set_Char_Size only */ - /* modify the contents of the current `active' size; you thus need */ - /* to use @FT_Activate_Size to change it. */ - /* */ - /* 99% of applications won't need the functions provided here, */ - /* especially if they use the caching sub-system, so be cautious */ - /* when using these. */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_New_Size */ - /* */ - /* <Description> */ - /* Create a new size object from a given face object. */ - /* */ - /* <Input> */ - /* face :: A handle to a parent face object. */ - /* */ - /* <Output> */ - /* asize :: A handle to a new size object. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - /* <Note> */ - /* You need to call @FT_Activate_Size in order to select the new size */ - /* for upcoming calls to @FT_Set_Pixel_Sizes, @FT_Set_Char_Size, */ - /* @FT_Load_Glyph, @FT_Load_Char, etc. */ - /* */ - FT_EXPORT( FT_Error ) - FT_New_Size( FT_Face face, - FT_Size* size ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Done_Size */ - /* */ - /* <Description> */ - /* Discard a given size object. Note that @FT_Done_Face */ - /* automatically discards all size objects allocated with */ - /* @FT_New_Size. */ - /* */ - /* <Input> */ - /* size :: A handle to a target size object. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Done_Size( FT_Size size ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Activate_Size */ - /* */ - /* <Description> */ - /* Even though it is possible to create several size objects for a */ - /* given face (see @FT_New_Size for details), functions like */ - /* @FT_Load_Glyph or @FT_Load_Char only use the one which has been */ - /* activated last to determine the `current character pixel size'. */ - /* */ - /* This function can be used to `activate' a previously created size */ - /* object. */ - /* */ - /* <Input> */ - /* size :: A handle to a target size object. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - /* <Note> */ - /* If `face' is the size's parent face object, this function changes */ - /* the value of `face->size' to the input size handle. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Activate_Size( FT_Size size ); - - /* */ - - -FT_END_HEADER - -#endif /* __FTSIZES_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftsnames.h b/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftsnames.h deleted file mode 100644 index 485e4e162e..0000000000 --- a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftsnames.h +++ /dev/null @@ -1,200 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftsnames.h */ -/* */ -/* Simple interface to access SFNT name tables (which are used */ -/* to hold font names, copyright info, notices, etc.) (specification). */ -/* */ -/* This is _not_ used to retrieve glyph names! */ -/* */ -/* Copyright 1996-2001, 2002, 2003, 2006, 2009, 2010 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __FT_SFNT_NAMES_H__ -#define __FT_SFNT_NAMES_H__ - - -#include <ft2build.h> -#include FT_FREETYPE_H - -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - - -FT_BEGIN_HEADER - - - /*************************************************************************/ - /* */ - /* <Section> */ - /* sfnt_names */ - /* */ - /* <Title> */ - /* SFNT Names */ - /* */ - /* <Abstract> */ - /* Access the names embedded in TrueType and OpenType files. */ - /* */ - /* <Description> */ - /* The TrueType and OpenType specifications allow the inclusion of */ - /* a special `names table' in font files. This table contains */ - /* textual (and internationalized) information regarding the font, */ - /* like family name, copyright, version, etc. */ - /* */ - /* The definitions below are used to access them if available. */ - /* */ - /* Note that this has nothing to do with glyph names! */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FT_SfntName */ - /* */ - /* <Description> */ - /* A structure used to model an SFNT `name' table entry. */ - /* */ - /* <Fields> */ - /* platform_id :: The platform ID for `string'. */ - /* */ - /* encoding_id :: The encoding ID for `string'. */ - /* */ - /* language_id :: The language ID for `string'. */ - /* */ - /* name_id :: An identifier for `string'. */ - /* */ - /* string :: The `name' string. Note that its format differs */ - /* depending on the (platform,encoding) pair. It can */ - /* be a Pascal String, a UTF-16 one, etc. */ - /* */ - /* Generally speaking, the string is not */ - /* zero-terminated. Please refer to the TrueType */ - /* specification for details. */ - /* */ - /* string_len :: The length of `string' in bytes. */ - /* */ - /* <Note> */ - /* Possible values for `platform_id', `encoding_id', `language_id', */ - /* and `name_id' are given in the file `ttnameid.h'. For details */ - /* please refer to the TrueType or OpenType specification. */ - /* */ - /* See also @TT_PLATFORM_XXX, @TT_APPLE_ID_XXX, @TT_MAC_ID_XXX, */ - /* @TT_ISO_ID_XXX, and @TT_MS_ID_XXX. */ - /* */ - typedef struct FT_SfntName_ - { - FT_UShort platform_id; - FT_UShort encoding_id; - FT_UShort language_id; - FT_UShort name_id; - - FT_Byte* string; /* this string is *not* null-terminated! */ - FT_UInt string_len; /* in bytes */ - - } FT_SfntName; - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Get_Sfnt_Name_Count */ - /* */ - /* <Description> */ - /* Retrieve the number of name strings in the SFNT `name' table. */ - /* */ - /* <Input> */ - /* face :: A handle to the source face. */ - /* */ - /* <Return> */ - /* The number of strings in the `name' table. */ - /* */ - FT_EXPORT( FT_UInt ) - FT_Get_Sfnt_Name_Count( FT_Face face ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Get_Sfnt_Name */ - /* */ - /* <Description> */ - /* Retrieve a string of the SFNT `name' table for a given index. */ - /* */ - /* <Input> */ - /* face :: A handle to the source face. */ - /* */ - /* idx :: The index of the `name' string. */ - /* */ - /* <Output> */ - /* aname :: The indexed @FT_SfntName structure. */ - /* */ - /* <Return> */ - /* FreeType error code. 0~means success. */ - /* */ - /* <Note> */ - /* The `string' array returned in the `aname' structure is not */ - /* null-terminated. The application should deallocate it if it is no */ - /* longer in use. */ - /* */ - /* Use @FT_Get_Sfnt_Name_Count to get the total number of available */ - /* `name' table entries, then do a loop until you get the right */ - /* platform, encoding, and name ID. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Get_Sfnt_Name( FT_Face face, - FT_UInt idx, - FT_SfntName *aname ); - - - /*************************************************************************** - * - * @constant: - * FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY - * - * @description: - * A constant used as the tag of @FT_Parameter structures to make - * FT_Open_Face() ignore preferred family subfamily names in `name' - * table since OpenType version 1.4. For backwards compatibility with - * legacy systems which has 4-face-per-family restriction. - * - */ -#define FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY FT_MAKE_TAG( 'i', 'g', 'p', 'f' ) - - - /*************************************************************************** - * - * @constant: - * FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY - * - * @description: - * A constant used as the tag of @FT_Parameter structures to make - * FT_Open_Face() ignore preferred subfamily names in `name' table since - * OpenType version 1.4. For backwards compatibility with legacy - * systems which has 4-face-per-family restriction. - * - */ -#define FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY FT_MAKE_TAG( 'i', 'g', 'p', 's' ) - - /* */ - - -FT_END_HEADER - -#endif /* __FT_SFNT_NAMES_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftsystem.h b/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftsystem.h deleted file mode 100644 index e07460c55d..0000000000 --- a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftsystem.h +++ /dev/null @@ -1,347 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftsystem.h */ -/* */ -/* FreeType low-level system interface definition (specification). */ -/* */ -/* Copyright 1996-2001, 2002, 2005, 2010 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __FTSYSTEM_H__ -#define __FTSYSTEM_H__ - - -#include <ft2build.h> - - -FT_BEGIN_HEADER - - - /*************************************************************************/ - /* */ - /* <Section> */ - /* system_interface */ - /* */ - /* <Title> */ - /* System Interface */ - /* */ - /* <Abstract> */ - /* How FreeType manages memory and i/o. */ - /* */ - /* <Description> */ - /* This section contains various definitions related to memory */ - /* management and i/o access. You need to understand this */ - /* information if you want to use a custom memory manager or you own */ - /* i/o streams. */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* M E M O R Y M A N A G E M E N T */ - /* */ - /*************************************************************************/ - - - /************************************************************************* - * - * @type: - * FT_Memory - * - * @description: - * A handle to a given memory manager object, defined with an - * @FT_MemoryRec structure. - * - */ - typedef struct FT_MemoryRec_* FT_Memory; - - - /************************************************************************* - * - * @functype: - * FT_Alloc_Func - * - * @description: - * A function used to allocate `size' bytes from `memory'. - * - * @input: - * memory :: - * A handle to the source memory manager. - * - * size :: - * The size in bytes to allocate. - * - * @return: - * Address of new memory block. 0~in case of failure. - * - */ - typedef void* - (*FT_Alloc_Func)( FT_Memory memory, - long size ); - - - /************************************************************************* - * - * @functype: - * FT_Free_Func - * - * @description: - * A function used to release a given block of memory. - * - * @input: - * memory :: - * A handle to the source memory manager. - * - * block :: - * The address of the target memory block. - * - */ - typedef void - (*FT_Free_Func)( FT_Memory memory, - void* block ); - - - /************************************************************************* - * - * @functype: - * FT_Realloc_Func - * - * @description: - * A function used to re-allocate a given block of memory. - * - * @input: - * memory :: - * A handle to the source memory manager. - * - * cur_size :: - * The block's current size in bytes. - * - * new_size :: - * The block's requested new size. - * - * block :: - * The block's current address. - * - * @return: - * New block address. 0~in case of memory shortage. - * - * @note: - * In case of error, the old block must still be available. - * - */ - typedef void* - (*FT_Realloc_Func)( FT_Memory memory, - long cur_size, - long new_size, - void* block ); - - - /************************************************************************* - * - * @struct: - * FT_MemoryRec - * - * @description: - * A structure used to describe a given memory manager to FreeType~2. - * - * @fields: - * user :: - * A generic typeless pointer for user data. - * - * alloc :: - * A pointer type to an allocation function. - * - * free :: - * A pointer type to an memory freeing function. - * - * realloc :: - * A pointer type to a reallocation function. - * - */ - struct FT_MemoryRec_ - { - void* user; - FT_Alloc_Func alloc; - FT_Free_Func free; - FT_Realloc_Func realloc; - }; - - - /*************************************************************************/ - /* */ - /* I / O M A N A G E M E N T */ - /* */ - /*************************************************************************/ - - - /************************************************************************* - * - * @type: - * FT_Stream - * - * @description: - * A handle to an input stream. - * - */ - typedef struct FT_StreamRec_* FT_Stream; - - - /************************************************************************* - * - * @struct: - * FT_StreamDesc - * - * @description: - * A union type used to store either a long or a pointer. This is used - * to store a file descriptor or a `FILE*' in an input stream. - * - */ - typedef union FT_StreamDesc_ - { - long value; - void* pointer; - - } FT_StreamDesc; - - - /************************************************************************* - * - * @functype: - * FT_Stream_IoFunc - * - * @description: - * A function used to seek and read data from a given input stream. - * - * @input: - * stream :: - * A handle to the source stream. - * - * offset :: - * The offset of read in stream (always from start). - * - * buffer :: - * The address of the read buffer. - * - * count :: - * The number of bytes to read from the stream. - * - * @return: - * The number of bytes effectively read by the stream. - * - * @note: - * This function might be called to perform a seek or skip operation - * with a `count' of~0. A non-zero return value then indicates an - * error. - * - */ - typedef unsigned long - (*FT_Stream_IoFunc)( FT_Stream stream, - unsigned long offset, - unsigned char* buffer, - unsigned long count ); - - - /************************************************************************* - * - * @functype: - * FT_Stream_CloseFunc - * - * @description: - * A function used to close a given input stream. - * - * @input: - * stream :: - * A handle to the target stream. - * - */ - typedef void - (*FT_Stream_CloseFunc)( FT_Stream stream ); - - - /************************************************************************* - * - * @struct: - * FT_StreamRec - * - * @description: - * A structure used to describe an input stream. - * - * @input: - * base :: - * For memory-based streams, this is the address of the first stream - * byte in memory. This field should always be set to NULL for - * disk-based streams. - * - * size :: - * The stream size in bytes. - * - * pos :: - * The current position within the stream. - * - * descriptor :: - * This field is a union that can hold an integer or a pointer. It is - * used by stream implementations to store file descriptors or `FILE*' - * pointers. - * - * pathname :: - * This field is completely ignored by FreeType. However, it is often - * useful during debugging to use it to store the stream's filename - * (where available). - * - * read :: - * The stream's input function. - * - * close :: - * The stream's close function. - * - * memory :: - * The memory manager to use to preload frames. This is set - * internally by FreeType and shouldn't be touched by stream - * implementations. - * - * cursor :: - * This field is set and used internally by FreeType when parsing - * frames. - * - * limit :: - * This field is set and used internally by FreeType when parsing - * frames. - * - */ - typedef struct FT_StreamRec_ - { - unsigned char* base; - unsigned long size; - unsigned long pos; - - FT_StreamDesc descriptor; - FT_StreamDesc pathname; - FT_Stream_IoFunc read; - FT_Stream_CloseFunc close; - - FT_Memory memory; - unsigned char* cursor; - unsigned char* limit; - - } FT_StreamRec; - - - /* */ - - -FT_END_HEADER - -#endif /* __FTSYSTEM_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftwinfnt.h b/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftwinfnt.h deleted file mode 100644 index ea33353536..0000000000 --- a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftwinfnt.h +++ /dev/null @@ -1,274 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftwinfnt.h */ -/* */ -/* FreeType API for accessing Windows fnt-specific data. */ -/* */ -/* Copyright 2003, 2004, 2008 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __FTWINFNT_H__ -#define __FTWINFNT_H__ - -#include <ft2build.h> -#include FT_FREETYPE_H - -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - - -FT_BEGIN_HEADER - - - /*************************************************************************/ - /* */ - /* <Section> */ - /* winfnt_fonts */ - /* */ - /* <Title> */ - /* Window FNT Files */ - /* */ - /* <Abstract> */ - /* Windows FNT specific API. */ - /* */ - /* <Description> */ - /* This section contains the declaration of Windows FNT specific */ - /* functions. */ - /* */ - /*************************************************************************/ - - - /************************************************************************* - * - * @enum: - * FT_WinFNT_ID_XXX - * - * @description: - * A list of valid values for the `charset' byte in - * @FT_WinFNT_HeaderRec. Exact mapping tables for the various cpXXXX - * encodings (except for cp1361) can be found at ftp://ftp.unicode.org - * in the MAPPINGS/VENDORS/MICSFT/WINDOWS subdirectory. cp1361 is - * roughly a superset of MAPPINGS/OBSOLETE/EASTASIA/KSC/JOHAB.TXT. - * - * @values: - * FT_WinFNT_ID_DEFAULT :: - * This is used for font enumeration and font creation as a - * `don't care' value. Valid font files don't contain this value. - * When querying for information about the character set of the font - * that is currently selected into a specified device context, this - * return value (of the related Windows API) simply denotes failure. - * - * FT_WinFNT_ID_SYMBOL :: - * There is no known mapping table available. - * - * FT_WinFNT_ID_MAC :: - * Mac Roman encoding. - * - * FT_WinFNT_ID_OEM :: - * From Michael Pöttgen <michael@poettgen.de>: - * - * The `Windows Font Mapping' article says that FT_WinFNT_ID_OEM - * is used for the charset of vector fonts, like `modern.fon', - * `roman.fon', and `script.fon' on Windows. - * - * The `CreateFont' documentation says: The FT_WinFNT_ID_OEM value - * specifies a character set that is operating-system dependent. - * - * The `IFIMETRICS' documentation from the `Windows Driver - * Development Kit' says: This font supports an OEM-specific - * character set. The OEM character set is system dependent. - * - * In general OEM, as opposed to ANSI (i.e., cp1252), denotes the - * second default codepage that most international versions of - * Windows have. It is one of the OEM codepages from - * - * http://www.microsoft.com/globaldev/reference/cphome.mspx, - * - * and is used for the `DOS boxes', to support legacy applications. - * A German Windows version for example usually uses ANSI codepage - * 1252 and OEM codepage 850. - * - * FT_WinFNT_ID_CP874 :: - * A superset of Thai TIS 620 and ISO 8859-11. - * - * FT_WinFNT_ID_CP932 :: - * A superset of Japanese Shift-JIS (with minor deviations). - * - * FT_WinFNT_ID_CP936 :: - * A superset of simplified Chinese GB 2312-1980 (with different - * ordering and minor deviations). - * - * FT_WinFNT_ID_CP949 :: - * A superset of Korean Hangul KS~C 5601-1987 (with different - * ordering and minor deviations). - * - * FT_WinFNT_ID_CP950 :: - * A superset of traditional Chinese Big~5 ETen (with different - * ordering and minor deviations). - * - * FT_WinFNT_ID_CP1250 :: - * A superset of East European ISO 8859-2 (with slightly different - * ordering). - * - * FT_WinFNT_ID_CP1251 :: - * A superset of Russian ISO 8859-5 (with different ordering). - * - * FT_WinFNT_ID_CP1252 :: - * ANSI encoding. A superset of ISO 8859-1. - * - * FT_WinFNT_ID_CP1253 :: - * A superset of Greek ISO 8859-7 (with minor modifications). - * - * FT_WinFNT_ID_CP1254 :: - * A superset of Turkish ISO 8859-9. - * - * FT_WinFNT_ID_CP1255 :: - * A superset of Hebrew ISO 8859-8 (with some modifications). - * - * FT_WinFNT_ID_CP1256 :: - * A superset of Arabic ISO 8859-6 (with different ordering). - * - * FT_WinFNT_ID_CP1257 :: - * A superset of Baltic ISO 8859-13 (with some deviations). - * - * FT_WinFNT_ID_CP1258 :: - * For Vietnamese. This encoding doesn't cover all necessary - * characters. - * - * FT_WinFNT_ID_CP1361 :: - * Korean (Johab). - */ - -#define FT_WinFNT_ID_CP1252 0 -#define FT_WinFNT_ID_DEFAULT 1 -#define FT_WinFNT_ID_SYMBOL 2 -#define FT_WinFNT_ID_MAC 77 -#define FT_WinFNT_ID_CP932 128 -#define FT_WinFNT_ID_CP949 129 -#define FT_WinFNT_ID_CP1361 130 -#define FT_WinFNT_ID_CP936 134 -#define FT_WinFNT_ID_CP950 136 -#define FT_WinFNT_ID_CP1253 161 -#define FT_WinFNT_ID_CP1254 162 -#define FT_WinFNT_ID_CP1258 163 -#define FT_WinFNT_ID_CP1255 177 -#define FT_WinFNT_ID_CP1256 178 -#define FT_WinFNT_ID_CP1257 186 -#define FT_WinFNT_ID_CP1251 204 -#define FT_WinFNT_ID_CP874 222 -#define FT_WinFNT_ID_CP1250 238 -#define FT_WinFNT_ID_OEM 255 - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FT_WinFNT_HeaderRec */ - /* */ - /* <Description> */ - /* Windows FNT Header info. */ - /* */ - typedef struct FT_WinFNT_HeaderRec_ - { - FT_UShort version; - FT_ULong file_size; - FT_Byte copyright[60]; - FT_UShort file_type; - FT_UShort nominal_point_size; - FT_UShort vertical_resolution; - FT_UShort horizontal_resolution; - FT_UShort ascent; - FT_UShort internal_leading; - FT_UShort external_leading; - FT_Byte italic; - FT_Byte underline; - FT_Byte strike_out; - FT_UShort weight; - FT_Byte charset; - FT_UShort pixel_width; - FT_UShort pixel_height; - FT_Byte pitch_and_family; - FT_UShort avg_width; - FT_UShort max_width; - FT_Byte first_char; - FT_Byte last_char; - FT_Byte default_char; - FT_Byte break_char; - FT_UShort bytes_per_row; - FT_ULong device_offset; - FT_ULong face_name_offset; - FT_ULong bits_pointer; - FT_ULong bits_offset; - FT_Byte reserved; - FT_ULong flags; - FT_UShort A_space; - FT_UShort B_space; - FT_UShort C_space; - FT_UShort color_table_offset; - FT_ULong reserved1[4]; - - } FT_WinFNT_HeaderRec; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FT_WinFNT_Header */ - /* */ - /* <Description> */ - /* A handle to an @FT_WinFNT_HeaderRec structure. */ - /* */ - typedef struct FT_WinFNT_HeaderRec_* FT_WinFNT_Header; - - - /********************************************************************** - * - * @function: - * FT_Get_WinFNT_Header - * - * @description: - * Retrieve a Windows FNT font info header. - * - * @input: - * face :: A handle to the input face. - * - * @output: - * aheader :: The WinFNT header. - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * This function only works with Windows FNT faces, returning an error - * otherwise. - */ - FT_EXPORT( FT_Error ) - FT_Get_WinFNT_Header( FT_Face face, - FT_WinFNT_HeaderRec *aheader ); - - - /* */ - -FT_END_HEADER - -#endif /* __FTWINFNT_H__ */ - - -/* END */ - - -/* Local Variables: */ -/* coding: utf-8 */ -/* End: */ diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftxf86.h b/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftxf86.h deleted file mode 100644 index 8c68afdcc5..0000000000 --- a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftxf86.h +++ /dev/null @@ -1,83 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftxf86.h */ -/* */ -/* Support functions for X11. */ -/* */ -/* Copyright 2002, 2003, 2004, 2006, 2007 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __FTXF86_H__ -#define __FTXF86_H__ - -#include <ft2build.h> -#include FT_FREETYPE_H - -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - - -FT_BEGIN_HEADER - - - /*************************************************************************/ - /* */ - /* <Section> */ - /* font_formats */ - /* */ - /* <Title> */ - /* Font Formats */ - /* */ - /* <Abstract> */ - /* Getting the font format. */ - /* */ - /* <Description> */ - /* The single function in this section can be used to get the font */ - /* format. Note that this information is not needed normally; */ - /* however, there are special cases (like in PDF devices) where it is */ - /* important to differentiate, in spite of FreeType's uniform API. */ - /* */ - /* This function is in the X11/xf86 namespace for historical reasons */ - /* and in no way depends on that windowing system. */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Get_X11_Font_Format */ - /* */ - /* <Description> */ - /* Return a string describing the format of a given face, using values */ - /* which can be used as an X11 FONT_PROPERTY. Possible values are */ - /* `TrueType', `Type~1', `BDF', `PCF', `Type~42', `CID~Type~1', `CFF', */ - /* `PFR', and `Windows~FNT'. */ - /* */ - /* <Input> */ - /* face :: */ - /* Input face handle. */ - /* */ - /* <Return> */ - /* Font format string. NULL in case of error. */ - /* */ - FT_EXPORT( const char* ) - FT_Get_X11_Font_Format( FT_Face face ); - - /* */ - -FT_END_HEADER - -#endif /* __FTXF86_H__ */ diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/t1tables.h b/cocos2dx/platform/third_party/win32/libfreetype2/freetype/t1tables.h deleted file mode 100644 index a14255e5f5..0000000000 --- a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/t1tables.h +++ /dev/null @@ -1,662 +0,0 @@ -/***************************************************************************/ -/* */ -/* t1tables.h */ -/* */ -/* Basic Type 1/Type 2 tables definitions and interface (specification */ -/* only). */ -/* */ -/* Copyright 1996-2004, 2006, 2008, 2009, 2011 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __T1TABLES_H__ -#define __T1TABLES_H__ - - -#include <ft2build.h> -#include FT_FREETYPE_H - -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - - -FT_BEGIN_HEADER - - - /*************************************************************************/ - /* */ - /* <Section> */ - /* type1_tables */ - /* */ - /* <Title> */ - /* Type 1 Tables */ - /* */ - /* <Abstract> */ - /* Type~1 (PostScript) specific font tables. */ - /* */ - /* <Description> */ - /* This section contains the definition of Type 1-specific tables, */ - /* including structures related to other PostScript font formats. */ - /* */ - /*************************************************************************/ - - - /* Note that we separate font data in PS_FontInfoRec and PS_PrivateRec */ - /* structures in order to support Multiple Master fonts. */ - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* PS_FontInfoRec */ - /* */ - /* <Description> */ - /* A structure used to model a Type~1 or Type~2 FontInfo dictionary. */ - /* Note that for Multiple Master fonts, each instance has its own */ - /* FontInfo dictionary. */ - /* */ - typedef struct PS_FontInfoRec_ - { - FT_String* version; - FT_String* notice; - FT_String* full_name; - FT_String* family_name; - FT_String* weight; - FT_Long italic_angle; - FT_Bool is_fixed_pitch; - FT_Short underline_position; - FT_UShort underline_thickness; - - } PS_FontInfoRec; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* PS_FontInfo */ - /* */ - /* <Description> */ - /* A handle to a @PS_FontInfoRec structure. */ - /* */ - typedef struct PS_FontInfoRec_* PS_FontInfo; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* T1_FontInfo */ - /* */ - /* <Description> */ - /* This type is equivalent to @PS_FontInfoRec. It is deprecated but */ - /* kept to maintain source compatibility between various versions of */ - /* FreeType. */ - /* */ - typedef PS_FontInfoRec T1_FontInfo; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* PS_PrivateRec */ - /* */ - /* <Description> */ - /* A structure used to model a Type~1 or Type~2 private dictionary. */ - /* Note that for Multiple Master fonts, each instance has its own */ - /* Private dictionary. */ - /* */ - typedef struct PS_PrivateRec_ - { - FT_Int unique_id; - FT_Int lenIV; - - FT_Byte num_blue_values; - FT_Byte num_other_blues; - FT_Byte num_family_blues; - FT_Byte num_family_other_blues; - - FT_Short blue_values[14]; - FT_Short other_blues[10]; - - FT_Short family_blues [14]; - FT_Short family_other_blues[10]; - - FT_Fixed blue_scale; - FT_Int blue_shift; - FT_Int blue_fuzz; - - FT_UShort standard_width[1]; - FT_UShort standard_height[1]; - - FT_Byte num_snap_widths; - FT_Byte num_snap_heights; - FT_Bool force_bold; - FT_Bool round_stem_up; - - FT_Short snap_widths [13]; /* including std width */ - FT_Short snap_heights[13]; /* including std height */ - - FT_Fixed expansion_factor; - - FT_Long language_group; - FT_Long password; - - FT_Short min_feature[2]; - - } PS_PrivateRec; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* PS_Private */ - /* */ - /* <Description> */ - /* A handle to a @PS_PrivateRec structure. */ - /* */ - typedef struct PS_PrivateRec_* PS_Private; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* T1_Private */ - /* */ - /* <Description> */ - /* This type is equivalent to @PS_PrivateRec. It is deprecated but */ - /* kept to maintain source compatibility between various versions of */ - /* FreeType. */ - /* */ - typedef PS_PrivateRec T1_Private; - - - /*************************************************************************/ - /* */ - /* <Enum> */ - /* T1_Blend_Flags */ - /* */ - /* <Description> */ - /* A set of flags used to indicate which fields are present in a */ - /* given blend dictionary (font info or private). Used to support */ - /* Multiple Masters fonts. */ - /* */ - typedef enum T1_Blend_Flags_ - { - /*# required fields in a FontInfo blend dictionary */ - T1_BLEND_UNDERLINE_POSITION = 0, - T1_BLEND_UNDERLINE_THICKNESS, - T1_BLEND_ITALIC_ANGLE, - - /*# required fields in a Private blend dictionary */ - T1_BLEND_BLUE_VALUES, - T1_BLEND_OTHER_BLUES, - T1_BLEND_STANDARD_WIDTH, - T1_BLEND_STANDARD_HEIGHT, - T1_BLEND_STEM_SNAP_WIDTHS, - T1_BLEND_STEM_SNAP_HEIGHTS, - T1_BLEND_BLUE_SCALE, - T1_BLEND_BLUE_SHIFT, - T1_BLEND_FAMILY_BLUES, - T1_BLEND_FAMILY_OTHER_BLUES, - T1_BLEND_FORCE_BOLD, - - /*# never remove */ - T1_BLEND_MAX - - } T1_Blend_Flags; - - /* */ - - - /*# backwards compatible definitions */ -#define t1_blend_underline_position T1_BLEND_UNDERLINE_POSITION -#define t1_blend_underline_thickness T1_BLEND_UNDERLINE_THICKNESS -#define t1_blend_italic_angle T1_BLEND_ITALIC_ANGLE -#define t1_blend_blue_values T1_BLEND_BLUE_VALUES -#define t1_blend_other_blues T1_BLEND_OTHER_BLUES -#define t1_blend_standard_widths T1_BLEND_STANDARD_WIDTH -#define t1_blend_standard_height T1_BLEND_STANDARD_HEIGHT -#define t1_blend_stem_snap_widths T1_BLEND_STEM_SNAP_WIDTHS -#define t1_blend_stem_snap_heights T1_BLEND_STEM_SNAP_HEIGHTS -#define t1_blend_blue_scale T1_BLEND_BLUE_SCALE -#define t1_blend_blue_shift T1_BLEND_BLUE_SHIFT -#define t1_blend_family_blues T1_BLEND_FAMILY_BLUES -#define t1_blend_family_other_blues T1_BLEND_FAMILY_OTHER_BLUES -#define t1_blend_force_bold T1_BLEND_FORCE_BOLD -#define t1_blend_max T1_BLEND_MAX - - - /* maximum number of Multiple Masters designs, as defined in the spec */ -#define T1_MAX_MM_DESIGNS 16 - - /* maximum number of Multiple Masters axes, as defined in the spec */ -#define T1_MAX_MM_AXIS 4 - - /* maximum number of elements in a design map */ -#define T1_MAX_MM_MAP_POINTS 20 - - - /* this structure is used to store the BlendDesignMap entry for an axis */ - typedef struct PS_DesignMap_ - { - FT_Byte num_points; - FT_Long* design_points; - FT_Fixed* blend_points; - - } PS_DesignMapRec, *PS_DesignMap; - - /* backwards-compatible definition */ - typedef PS_DesignMapRec T1_DesignMap; - - - typedef struct PS_BlendRec_ - { - FT_UInt num_designs; - FT_UInt num_axis; - - FT_String* axis_names[T1_MAX_MM_AXIS]; - FT_Fixed* design_pos[T1_MAX_MM_DESIGNS]; - PS_DesignMapRec design_map[T1_MAX_MM_AXIS]; - - FT_Fixed* weight_vector; - FT_Fixed* default_weight_vector; - - PS_FontInfo font_infos[T1_MAX_MM_DESIGNS + 1]; - PS_Private privates [T1_MAX_MM_DESIGNS + 1]; - - FT_ULong blend_bitflags; - - FT_BBox* bboxes [T1_MAX_MM_DESIGNS + 1]; - - /* since 2.3.0 */ - - /* undocumented, optional: the default design instance; */ - /* corresponds to default_weight_vector -- */ - /* num_default_design_vector == 0 means it is not present */ - /* in the font and associated metrics files */ - FT_UInt default_design_vector[T1_MAX_MM_DESIGNS]; - FT_UInt num_default_design_vector; - - } PS_BlendRec, *PS_Blend; - - - /* backwards-compatible definition */ - typedef PS_BlendRec T1_Blend; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* CID_FaceDictRec */ - /* */ - /* <Description> */ - /* A structure used to represent data in a CID top-level dictionary. */ - /* */ - typedef struct CID_FaceDictRec_ - { - PS_PrivateRec private_dict; - - FT_UInt len_buildchar; - FT_Fixed forcebold_threshold; - FT_Pos stroke_width; - FT_Fixed expansion_factor; - - FT_Byte paint_type; - FT_Byte font_type; - FT_Matrix font_matrix; - FT_Vector font_offset; - - FT_UInt num_subrs; - FT_ULong subrmap_offset; - FT_Int sd_bytes; - - } CID_FaceDictRec; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* CID_FaceDict */ - /* */ - /* <Description> */ - /* A handle to a @CID_FaceDictRec structure. */ - /* */ - typedef struct CID_FaceDictRec_* CID_FaceDict; - - /* */ - - - /* backwards-compatible definition */ - typedef CID_FaceDictRec CID_FontDict; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* CID_FaceInfoRec */ - /* */ - /* <Description> */ - /* A structure used to represent CID Face information. */ - /* */ - typedef struct CID_FaceInfoRec_ - { - FT_String* cid_font_name; - FT_Fixed cid_version; - FT_Int cid_font_type; - - FT_String* registry; - FT_String* ordering; - FT_Int supplement; - - PS_FontInfoRec font_info; - FT_BBox font_bbox; - FT_ULong uid_base; - - FT_Int num_xuid; - FT_ULong xuid[16]; - - FT_ULong cidmap_offset; - FT_Int fd_bytes; - FT_Int gd_bytes; - FT_ULong cid_count; - - FT_Int num_dicts; - CID_FaceDict font_dicts; - - FT_ULong data_offset; - - } CID_FaceInfoRec; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* CID_FaceInfo */ - /* */ - /* <Description> */ - /* A handle to a @CID_FaceInfoRec structure. */ - /* */ - typedef struct CID_FaceInfoRec_* CID_FaceInfo; - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* CID_Info */ - /* */ - /* <Description> */ - /* This type is equivalent to @CID_FaceInfoRec. It is deprecated but */ - /* kept to maintain source compatibility between various versions of */ - /* FreeType. */ - /* */ - typedef CID_FaceInfoRec CID_Info; - - - /************************************************************************ - * - * @function: - * FT_Has_PS_Glyph_Names - * - * @description: - * Return true if a given face provides reliable PostScript glyph - * names. This is similar to using the @FT_HAS_GLYPH_NAMES macro, - * except that certain fonts (mostly TrueType) contain incorrect - * glyph name tables. - * - * When this function returns true, the caller is sure that the glyph - * names returned by @FT_Get_Glyph_Name are reliable. - * - * @input: - * face :: - * face handle - * - * @return: - * Boolean. True if glyph names are reliable. - * - */ - FT_EXPORT( FT_Int ) - FT_Has_PS_Glyph_Names( FT_Face face ); - - - /************************************************************************ - * - * @function: - * FT_Get_PS_Font_Info - * - * @description: - * Retrieve the @PS_FontInfoRec structure corresponding to a given - * PostScript font. - * - * @input: - * face :: - * PostScript face handle. - * - * @output: - * afont_info :: - * Output font info structure pointer. - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * The string pointers within the font info structure are owned by - * the face and don't need to be freed by the caller. - * - * If the font's format is not PostScript-based, this function will - * return the `FT_Err_Invalid_Argument' error code. - * - */ - FT_EXPORT( FT_Error ) - FT_Get_PS_Font_Info( FT_Face face, - PS_FontInfo afont_info ); - - - /************************************************************************ - * - * @function: - * FT_Get_PS_Font_Private - * - * @description: - * Retrieve the @PS_PrivateRec structure corresponding to a given - * PostScript font. - * - * @input: - * face :: - * PostScript face handle. - * - * @output: - * afont_private :: - * Output private dictionary structure pointer. - * - * @return: - * FreeType error code. 0~means success. - * - * @note: - * The string pointers within the @PS_PrivateRec structure are owned by - * the face and don't need to be freed by the caller. - * - * If the font's format is not PostScript-based, this function returns - * the `FT_Err_Invalid_Argument' error code. - * - */ - FT_EXPORT( FT_Error ) - FT_Get_PS_Font_Private( FT_Face face, - PS_Private afont_private ); - - - /*************************************************************************/ - /* */ - /* <Enum> */ - /* T1_EncodingType */ - /* */ - /* <Description> */ - /* An enumeration describing the `Encoding' entry in a Type 1 */ - /* dictionary. */ - /* */ - typedef enum T1_EncodingType_ - { - T1_ENCODING_TYPE_NONE = 0, - T1_ENCODING_TYPE_ARRAY, - T1_ENCODING_TYPE_STANDARD, - T1_ENCODING_TYPE_ISOLATIN1, - T1_ENCODING_TYPE_EXPERT - - } T1_EncodingType; - - - /*************************************************************************/ - /* */ - /* <Enum> */ - /* PS_Dict_Keys */ - /* */ - /* <Description> */ - /* An enumeration used in calls to @FT_Get_PS_Font_Value to identify */ - /* the Type~1 dictionary entry to retrieve. */ - /* */ - typedef enum PS_Dict_Keys_ - { - /* conventionally in the font dictionary */ - PS_DICT_FONT_TYPE, /* FT_Byte */ - PS_DICT_FONT_MATRIX, /* FT_Fixed */ - PS_DICT_FONT_BBOX, /* FT_Fixed */ - PS_DICT_PAINT_TYPE, /* FT_Byte */ - PS_DICT_FONT_NAME, /* FT_String* */ - PS_DICT_UNIQUE_ID, /* FT_Int */ - PS_DICT_NUM_CHAR_STRINGS, /* FT_Int */ - PS_DICT_CHAR_STRING_KEY, /* FT_String* */ - PS_DICT_CHAR_STRING, /* FT_String* */ - PS_DICT_ENCODING_TYPE, /* T1_EncodingType */ - PS_DICT_ENCODING_ENTRY, /* FT_String* */ - - /* conventionally in the font Private dictionary */ - PS_DICT_NUM_SUBRS, /* FT_Int */ - PS_DICT_SUBR, /* FT_String* */ - PS_DICT_STD_HW, /* FT_UShort */ - PS_DICT_STD_VW, /* FT_UShort */ - PS_DICT_NUM_BLUE_VALUES, /* FT_Byte */ - PS_DICT_BLUE_VALUE, /* FT_Short */ - PS_DICT_BLUE_FUZZ, /* FT_Int */ - PS_DICT_NUM_OTHER_BLUES, /* FT_Byte */ - PS_DICT_OTHER_BLUE, /* FT_Short */ - PS_DICT_NUM_FAMILY_BLUES, /* FT_Byte */ - PS_DICT_FAMILY_BLUE, /* FT_Short */ - PS_DICT_NUM_FAMILY_OTHER_BLUES, /* FT_Byte */ - PS_DICT_FAMILY_OTHER_BLUE, /* FT_Short */ - PS_DICT_BLUE_SCALE, /* FT_Fixed */ - PS_DICT_BLUE_SHIFT, /* FT_Int */ - PS_DICT_NUM_STEM_SNAP_H, /* FT_Byte */ - PS_DICT_STEM_SNAP_H, /* FT_Short */ - PS_DICT_NUM_STEM_SNAP_V, /* FT_Byte */ - PS_DICT_STEM_SNAP_V, /* FT_Short */ - PS_DICT_FORCE_BOLD, /* FT_Bool */ - PS_DICT_RND_STEM_UP, /* FT_Bool */ - PS_DICT_MIN_FEATURE, /* FT_Short */ - PS_DICT_LEN_IV, /* FT_Int */ - PS_DICT_PASSWORD, /* FT_Long */ - PS_DICT_LANGUAGE_GROUP, /* FT_Long */ - - /* conventionally in the font FontInfo dictionary */ - PS_DICT_VERSION, /* FT_String* */ - PS_DICT_NOTICE, /* FT_String* */ - PS_DICT_FULL_NAME, /* FT_String* */ - PS_DICT_FAMILY_NAME, /* FT_String* */ - PS_DICT_WEIGHT, /* FT_String* */ - PS_DICT_IS_FIXED_PITCH, /* FT_Bool */ - PS_DICT_UNDERLINE_POSITION, /* FT_Short */ - PS_DICT_UNDERLINE_THICKNESS, /* FT_UShort */ - PS_DICT_FS_TYPE, /* FT_UShort */ - PS_DICT_ITALIC_ANGLE, /* FT_Long */ - - PS_DICT_MAX = PS_DICT_ITALIC_ANGLE - - } PS_Dict_Keys; - - - /************************************************************************ - * - * @function: - * FT_Get_PS_Font_Value - * - * @description: - * Retrieve the value for the supplied key from a PostScript font. - * - * @input: - * face :: - * PostScript face handle. - * - * key :: - * An enumeration value representing the dictionary key to retrieve. - * - * idx :: - * For array values, this specifies the index to be returned. - * - * value :: - * A pointer to memory into which to write the value. - * - * valen_len :: - * The size, in bytes, of the memory supplied for the value. - * - * @output: - * value :: - * The value matching the above key, if it exists. - * - * @return: - * The amount of memory (in bytes) required to hold the requested - * value (if it exists, -1 otherwise). - * - * @note: - * The values returned are not pointers into the internal structures of - * the face, but are `fresh' copies, so that the memory containing them - * belongs to the calling application. This also enforces the - * `read-only' nature of these values, i.e., this function cannot be - * used to manipulate the face. - * - * `value' is a void pointer because the values returned can be of - * various types. - * - * If either `value' is NULL or `value_len' is too small, just the - * required memory size for the requested entry is returned. - * - * The `idx' parameter is used, not only to retrieve elements of, for - * example, the FontMatrix or FontBBox, but also to retrieve name keys - * from the CharStrings dictionary, and the charstrings themselves. It - * is ignored for atomic values. - * - * PS_DICT_BLUE_SCALE returns a value that is scaled up by 1000. To - * get the value as in the font stream, you need to divide by - * 65536000.0 (to remove the FT_Fixed scale, and the x1000 scale). - * - * IMPORTANT: Only key/value pairs read by the FreeType interpreter can - * be retrieved. So, for example, PostScript procedures such as NP, - * ND, and RD are not available. Arbitrary keys are, obviously, not be - * available either. - * - * If the font's format is not PostScript-based, this function returns - * the `FT_Err_Invalid_Argument' error code. - * - */ - FT_EXPORT( FT_Long ) - FT_Get_PS_Font_Value( FT_Face face, - PS_Dict_Keys key, - FT_UInt idx, - void *value, - FT_Long value_len ); - - /* */ - -FT_END_HEADER - -#endif /* __T1TABLES_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ttunpat.h b/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ttunpat.h deleted file mode 100644 index a0162759b7..0000000000 --- a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ttunpat.h +++ /dev/null @@ -1,59 +0,0 @@ -/***************************************************************************/ -/* */ -/* ttunpat.h */ -/* */ -/* Definitions for the unpatented TrueType hinting system */ -/* */ -/* Copyright 2003, 2006 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* Written by Graham Asher <graham.asher@btinternet.com> */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __TTUNPAT_H__ -#define __TTUNPAT_H__ - - -#include <ft2build.h> -#include FT_FREETYPE_H - -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - - -FT_BEGIN_HEADER - - - /*************************************************************************** - * - * @constant: - * FT_PARAM_TAG_UNPATENTED_HINTING - * - * @description: - * A constant used as the tag of an @FT_Parameter structure to indicate - * that unpatented methods only should be used by the TrueType bytecode - * interpreter for a typeface opened by @FT_Open_Face. - * - */ -#define FT_PARAM_TAG_UNPATENTED_HINTING FT_MAKE_TAG( 'u', 'n', 'p', 'a' ) - - /* */ - -FT_END_HEADER - - -#endif /* __TTUNPAT_H__ */ - - -/* END */ diff --git a/cocos2dx/platform/third_party/win32/libjpeg/jmorecfg.h b/cocos2dx/platform/third_party/win32/libjpeg/jmorecfg.h deleted file mode 100644 index 2407edbef8..0000000000 --- a/cocos2dx/platform/third_party/win32/libjpeg/jmorecfg.h +++ /dev/null @@ -1,390 +0,0 @@ -/* - * jmorecfg.h - * - * Copyright (C) 1991-1997, Thomas G. Lane. - * Modified 1997-2012 by Guido Vollbeding. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains additional configuration options that customize the - * JPEG software for special applications or support machine-dependent - * optimizations. Most users will not need to touch this file. - */ - - -/* - * Define BITS_IN_JSAMPLE as either - * 8 for 8-bit sample values (the usual setting) - * 12 for 12-bit sample values - * Only 8 and 12 are legal data precisions for lossy JPEG according to the - * JPEG standard, and the IJG code does not support anything else! - * We do not support run-time selection of data precision, sorry. - */ - -#define BITS_IN_JSAMPLE 8 /* use 8 or 12 */ - - -/* - * Maximum number of components (color channels) allowed in JPEG image. - * To meet the letter of the JPEG spec, set this to 255. However, darn - * few applications need more than 4 channels (maybe 5 for CMYK + alpha - * mask). We recommend 10 as a reasonable compromise; use 4 if you are - * really short on memory. (Each allowed component costs a hundred or so - * bytes of storage, whether actually used in an image or not.) - */ - -#define MAX_COMPONENTS 10 /* maximum number of image components */ - - -/* - * Basic data types. - * You may need to change these if you have a machine with unusual data - * type sizes; for example, "char" not 8 bits, "short" not 16 bits, - * or "long" not 32 bits. We don't care whether "int" is 16 or 32 bits, - * but it had better be at least 16. - */ - -/* Representation of a single sample (pixel element value). - * We frequently allocate large arrays of these, so it's important to keep - * them small. But if you have memory to burn and access to char or short - * arrays is very slow on your hardware, you might want to change these. - */ - -#if BITS_IN_JSAMPLE == 8 -/* JSAMPLE should be the smallest type that will hold the values 0..255. - * You can use a signed char by having GETJSAMPLE mask it with 0xFF. - */ - -#ifdef HAVE_UNSIGNED_CHAR - -typedef unsigned char JSAMPLE; -#define GETJSAMPLE(value) ((int) (value)) - -#else /* not HAVE_UNSIGNED_CHAR */ - -typedef char JSAMPLE; -#ifdef CHAR_IS_UNSIGNED -#define GETJSAMPLE(value) ((int) (value)) -#else -#define GETJSAMPLE(value) ((int) (value) & 0xFF) -#endif /* CHAR_IS_UNSIGNED */ - -#endif /* HAVE_UNSIGNED_CHAR */ - -#define MAXJSAMPLE 255 -#define CENTERJSAMPLE 128 - -#endif /* BITS_IN_JSAMPLE == 8 */ - - -#if BITS_IN_JSAMPLE == 12 -/* JSAMPLE should be the smallest type that will hold the values 0..4095. - * On nearly all machines "short" will do nicely. - */ - -typedef short JSAMPLE; -#define GETJSAMPLE(value) ((int) (value)) - -#define MAXJSAMPLE 4095 -#define CENTERJSAMPLE 2048 - -#endif /* BITS_IN_JSAMPLE == 12 */ - - -/* Representation of a DCT frequency coefficient. - * This should be a signed value of at least 16 bits; "short" is usually OK. - * Again, we allocate large arrays of these, but you can change to int - * if you have memory to burn and "short" is really slow. - */ - -typedef short JCOEF; - - -/* Compressed datastreams are represented as arrays of JOCTET. - * These must be EXACTLY 8 bits wide, at least once they are written to - * external storage. Note that when using the stdio data source/destination - * managers, this is also the data type passed to fread/fwrite. - */ - -#ifdef HAVE_UNSIGNED_CHAR - -typedef unsigned char JOCTET; -#define GETJOCTET(value) (value) - -#else /* not HAVE_UNSIGNED_CHAR */ - -typedef char JOCTET; -#ifdef CHAR_IS_UNSIGNED -#define GETJOCTET(value) (value) -#else -#define GETJOCTET(value) ((value) & 0xFF) -#endif /* CHAR_IS_UNSIGNED */ - -#endif /* HAVE_UNSIGNED_CHAR */ - - -/* These typedefs are used for various table entries and so forth. - * They must be at least as wide as specified; but making them too big - * won't cost a huge amount of memory, so we don't provide special - * extraction code like we did for JSAMPLE. (In other words, these - * typedefs live at a different point on the speed/space tradeoff curve.) - */ - -/* UINT8 must hold at least the values 0..255. */ - -#ifdef HAVE_UNSIGNED_CHAR -typedef unsigned char UINT8; -#else /* not HAVE_UNSIGNED_CHAR */ -#ifdef CHAR_IS_UNSIGNED -typedef char UINT8; -#else /* not CHAR_IS_UNSIGNED */ -typedef short UINT8; -#endif /* CHAR_IS_UNSIGNED */ -#endif /* HAVE_UNSIGNED_CHAR */ - -/* UINT16 must hold at least the values 0..65535. */ - -#ifdef HAVE_UNSIGNED_SHORT -typedef unsigned short UINT16; -#else /* not HAVE_UNSIGNED_SHORT */ -typedef unsigned int UINT16; -#endif /* HAVE_UNSIGNED_SHORT */ - -/* INT16 must hold at least the values -32768..32767. */ - -#ifndef XMD_H /* X11/xmd.h correctly defines INT16 */ -typedef short INT16; -#endif - -/* INT32 must hold at least signed 32-bit values. */ - -#ifndef XMD_H /* X11/xmd.h correctly defines INT32 */ -#ifndef _BASETSD_H_ /* Microsoft defines it in basetsd.h */ -#ifndef _BASETSD_H /* MinGW is slightly different */ -#ifndef QGLOBAL_H /* Qt defines it in qglobal.h */ -typedef long INT32; -#endif -#endif -#endif -#endif - -/* Datatype used for image dimensions. The JPEG standard only supports - * images up to 64K*64K due to 16-bit fields in SOF markers. Therefore - * "unsigned int" is sufficient on all machines. However, if you need to - * handle larger images and you don't mind deviating from the spec, you - * can change this datatype. - */ - -typedef unsigned int JDIMENSION; - -#define JPEG_MAX_DIMENSION 65500L /* a tad under 64K to prevent overflows */ - - -/* These macros are used in all function definitions and extern declarations. - * You could modify them if you need to change function linkage conventions; - * in particular, you'll need to do that to make the library a Windows DLL. - * Another application is to make all functions global for use with debuggers - * or code profilers that require it. - */ - -/* a function called through method pointers: */ -#define METHODDEF(type) static type -/* a function used only in its module: */ -#define LOCAL(type) static type -/* a function referenced thru EXTERNs: */ -#define GLOBAL(type) type -/* a reference to a GLOBAL function: */ -#define EXTERN(type) extern type - - -/* This macro is used to declare a "method", that is, a function pointer. - * We want to supply prototype parameters if the compiler can cope. - * Note that the arglist parameter must be parenthesized! - * Again, you can customize this if you need special linkage keywords. - */ - -#ifdef HAVE_PROTOTYPES -#define JMETHOD(type,methodname,arglist) type (*methodname) arglist -#else -#define JMETHOD(type,methodname,arglist) type (*methodname) () -#endif - - -/* The noreturn type identifier is used to declare functions - * which cannot return. - * Compilers can thus create more optimized code and perform - * better checks for warnings and errors. - * Static analyzer tools can make improved inferences about - * execution paths and are prevented from giving false alerts. - * - * Unfortunately, the proposed specifications of corresponding - * extensions in the Dec 2011 ISO C standard revision (C11), - * GCC, MSVC, etc. are not viable. - * Thus we introduce a user defined type to declare noreturn - * functions at least for clarity. A proper compiler would - * have a suitable noreturn type to match in place of void. - */ - -#ifndef HAVE_NORETURN_T -typedef void noreturn_t; -#endif - - -/* Here is the pseudo-keyword for declaring pointers that must be "far" - * on 80x86 machines. Most of the specialized coding for 80x86 is handled - * by just saying "FAR *" where such a pointer is needed. In a few places - * explicit coding is needed; see uses of the NEED_FAR_POINTERS symbol. - */ - -#ifndef FAR -#ifdef NEED_FAR_POINTERS -#define FAR far -#else -#define FAR -#endif -#endif - - -/* - * On a few systems, type boolean and/or its values FALSE, TRUE may appear - * in standard header files. Or you may have conflicts with application- - * specific header files that you want to include together with these files. - * Defining HAVE_BOOLEAN before including jpeglib.h should make it work. - */ - -#ifdef HAVE_BOOLEAN -#ifndef FALSE /* in case these macros already exist */ -#define FALSE 0 /* values of boolean */ -#endif -#ifndef TRUE -#define TRUE 1 -#endif -#else -typedef enum { FALSE = 0, TRUE = 1 } boolean; -#endif - - -/* - * The remaining options affect code selection within the JPEG library, - * but they don't need to be visible to most applications using the library. - * To minimize application namespace pollution, the symbols won't be - * defined unless JPEG_INTERNALS or JPEG_INTERNAL_OPTIONS has been defined. - */ - -#ifdef JPEG_INTERNALS -#define JPEG_INTERNAL_OPTIONS -#endif - -#ifdef JPEG_INTERNAL_OPTIONS - - -/* - * These defines indicate whether to include various optional functions. - * Undefining some of these symbols will produce a smaller but less capable - * library. Note that you can leave certain source files out of the - * compilation/linking process if you've #undef'd the corresponding symbols. - * (You may HAVE to do that if your compiler doesn't like null source files.) - */ - -/* Capability options common to encoder and decoder: */ - -#define DCT_ISLOW_SUPPORTED /* slow but accurate integer algorithm */ -#define DCT_IFAST_SUPPORTED /* faster, less accurate integer method */ -#define DCT_FLOAT_SUPPORTED /* floating-point: accurate, fast on fast HW */ - -/* Encoder capability options: */ - -#define C_ARITH_CODING_SUPPORTED /* Arithmetic coding back end? */ -#define C_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */ -#define C_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/ -#define DCT_SCALING_SUPPORTED /* Input rescaling via DCT? (Requires DCT_ISLOW)*/ -#define ENTROPY_OPT_SUPPORTED /* Optimization of entropy coding parms? */ -/* Note: if you selected 12-bit data precision, it is dangerous to turn off - * ENTROPY_OPT_SUPPORTED. The standard Huffman tables are only good for 8-bit - * precision, so jchuff.c normally uses entropy optimization to compute - * usable tables for higher precision. If you don't want to do optimization, - * you'll have to supply different default Huffman tables. - * The exact same statements apply for progressive JPEG: the default tables - * don't work for progressive mode. (This may get fixed, however.) - */ -#define INPUT_SMOOTHING_SUPPORTED /* Input image smoothing option? */ - -/* Decoder capability options: */ - -#define D_ARITH_CODING_SUPPORTED /* Arithmetic coding back end? */ -#define D_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */ -#define D_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/ -#define IDCT_SCALING_SUPPORTED /* Output rescaling via IDCT? */ -#define SAVE_MARKERS_SUPPORTED /* jpeg_save_markers() needed? */ -#define BLOCK_SMOOTHING_SUPPORTED /* Block smoothing? (Progressive only) */ -#undef UPSAMPLE_SCALING_SUPPORTED /* Output rescaling at upsample stage? */ -#define UPSAMPLE_MERGING_SUPPORTED /* Fast path for sloppy upsampling? */ -#define QUANT_1PASS_SUPPORTED /* 1-pass color quantization? */ -#define QUANT_2PASS_SUPPORTED /* 2-pass color quantization? */ - -/* more capability options later, no doubt */ - - -/* - * Ordering of RGB data in scanlines passed to or from the application. - * If your application wants to deal with data in the order B,G,R, just - * change these macros. You can also deal with formats such as R,G,B,X - * (one extra byte per pixel) by changing RGB_PIXELSIZE. Note that changing - * the offsets will also change the order in which colormap data is organized. - * RESTRICTIONS: - * 1. The sample applications cjpeg,djpeg do NOT support modified RGB formats. - * 2. The color quantizer modules will not behave desirably if RGB_PIXELSIZE - * is not 3 (they don't understand about dummy color components!). So you - * can't use color quantization if you change that value. - */ - -#define RGB_RED 0 /* Offset of Red in an RGB scanline element */ -#define RGB_GREEN 1 /* Offset of Green */ -#define RGB_BLUE 2 /* Offset of Blue */ -#define RGB_PIXELSIZE 3 /* JSAMPLEs per RGB scanline element */ - - -/* Definitions for speed-related optimizations. */ - - -/* If your compiler supports inline functions, define INLINE - * as the inline keyword; otherwise define it as empty. - */ - -#ifndef INLINE -#ifdef __GNUC__ /* for instance, GNU C knows about inline */ -#define INLINE __inline__ -#endif -#ifndef INLINE -#define INLINE /* default is to define it as empty */ -#endif -#endif - - -/* On some machines (notably 68000 series) "int" is 32 bits, but multiplying - * two 16-bit shorts is faster than multiplying two ints. Define MULTIPLIER - * as short on such a machine. MULTIPLIER must be at least 16 bits wide. - */ - -#ifndef MULTIPLIER -#define MULTIPLIER int /* type for fastest integer multiply */ -#endif - - -/* FAST_FLOAT should be either float or double, whichever is done faster - * by your compiler. (Note that this type is only used in the floating point - * DCT routines, so it only matters if you've defined DCT_FLOAT_SUPPORTED.) - * Typically, float is faster in ANSI C compilers, while double is faster in - * pre-ANSI compilers (because they insist on converting to double anyway). - * The code below therefore chooses float if we have ANSI-style prototypes. - */ - -#ifndef FAST_FLOAT -#ifdef HAVE_PROTOTYPES -#define FAST_FLOAT float -#else -#define FAST_FLOAT double -#endif -#endif - -#endif /* JPEG_INTERNAL_OPTIONS */ diff --git a/cocos2dx/platform/third_party/win32/libjpeg/jpeglib.h b/cocos2dx/platform/third_party/win32/libjpeg/jpeglib.h deleted file mode 100644 index 0a6dac44c3..0000000000 --- a/cocos2dx/platform/third_party/win32/libjpeg/jpeglib.h +++ /dev/null @@ -1,1173 +0,0 @@ -/* - * jpeglib.h - * - * Copyright (C) 1991-1998, Thomas G. Lane. - * Modified 2002-2012 by Guido Vollbeding. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file defines the application interface for the JPEG library. - * Most applications using the library need only include this file, - * and perhaps jerror.h if they want to know the exact error codes. - */ - -#ifndef JPEGLIB_H -#define JPEGLIB_H - -/* - * First we include the configuration files that record how this - * installation of the JPEG library is set up. jconfig.h can be - * generated automatically for many systems. jmorecfg.h contains - * manual configuration options that most people need not worry about. - */ - -#ifndef JCONFIG_INCLUDED /* in case jinclude.h already did */ -#include "jconfig.h" /* widely used configuration options */ -#endif -#include "jmorecfg.h" /* seldom changed options */ - - -#ifdef __cplusplus -#ifndef DONT_USE_EXTERN_C -extern "C" { -#endif -#endif - -/* Version IDs for the JPEG library. - * Might be useful for tests like "#if JPEG_LIB_VERSION >= 90". - */ - -#define JPEG_LIB_VERSION 90 /* Compatibility version 9.0 */ -#define JPEG_LIB_VERSION_MAJOR 9 -#define JPEG_LIB_VERSION_MINOR 0 - - -/* Various constants determining the sizes of things. - * All of these are specified by the JPEG standard, so don't change them - * if you want to be compatible. - */ - -#define DCTSIZE 8 /* The basic DCT block is 8x8 coefficients */ -#define DCTSIZE2 64 /* DCTSIZE squared; # of elements in a block */ -#define NUM_QUANT_TBLS 4 /* Quantization tables are numbered 0..3 */ -#define NUM_HUFF_TBLS 4 /* Huffman tables are numbered 0..3 */ -#define NUM_ARITH_TBLS 16 /* Arith-coding tables are numbered 0..15 */ -#define MAX_COMPS_IN_SCAN 4 /* JPEG limit on # of components in one scan */ -#define MAX_SAMP_FACTOR 4 /* JPEG limit on sampling factors */ -/* Unfortunately, some bozo at Adobe saw no reason to be bound by the standard; - * the PostScript DCT filter can emit files with many more than 10 blocks/MCU. - * If you happen to run across such a file, you can up D_MAX_BLOCKS_IN_MCU - * to handle it. We even let you do this from the jconfig.h file. However, - * we strongly discourage changing C_MAX_BLOCKS_IN_MCU; just because Adobe - * sometimes emits noncompliant files doesn't mean you should too. - */ -#define C_MAX_BLOCKS_IN_MCU 10 /* compressor's limit on blocks per MCU */ -#ifndef D_MAX_BLOCKS_IN_MCU -#define D_MAX_BLOCKS_IN_MCU 10 /* decompressor's limit on blocks per MCU */ -#endif - - -/* Data structures for images (arrays of samples and of DCT coefficients). - * On 80x86 machines, the image arrays are too big for near pointers, - * but the pointer arrays can fit in near memory. - */ - -typedef JSAMPLE FAR *JSAMPROW; /* ptr to one image row of pixel samples. */ -typedef JSAMPROW *JSAMPARRAY; /* ptr to some rows (a 2-D sample array) */ -typedef JSAMPARRAY *JSAMPIMAGE; /* a 3-D sample array: top index is color */ - -typedef JCOEF JBLOCK[DCTSIZE2]; /* one block of coefficients */ -typedef JBLOCK FAR *JBLOCKROW; /* pointer to one row of coefficient blocks */ -typedef JBLOCKROW *JBLOCKARRAY; /* a 2-D array of coefficient blocks */ -typedef JBLOCKARRAY *JBLOCKIMAGE; /* a 3-D array of coefficient blocks */ - -typedef JCOEF FAR *JCOEFPTR; /* useful in a couple of places */ - - -/* Types for JPEG compression parameters and working tables. */ - - -/* DCT coefficient quantization tables. */ - -typedef struct { - /* This array gives the coefficient quantizers in natural array order - * (not the zigzag order in which they are stored in a JPEG DQT marker). - * CAUTION: IJG versions prior to v6a kept this array in zigzag order. - */ - UINT16 quantval[DCTSIZE2]; /* quantization step for each coefficient */ - /* This field is used only during compression. It's initialized FALSE when - * the table is created, and set TRUE when it's been output to the file. - * You could suppress output of a table by setting this to TRUE. - * (See jpeg_suppress_tables for an example.) - */ - boolean sent_table; /* TRUE when table has been output */ -} JQUANT_TBL; - - -/* Huffman coding tables. */ - -typedef struct { - /* These two fields directly represent the contents of a JPEG DHT marker */ - UINT8 bits[17]; /* bits[k] = # of symbols with codes of */ - /* length k bits; bits[0] is unused */ - UINT8 huffval[256]; /* The symbols, in order of incr code length */ - /* This field is used only during compression. It's initialized FALSE when - * the table is created, and set TRUE when it's been output to the file. - * You could suppress output of a table by setting this to TRUE. - * (See jpeg_suppress_tables for an example.) - */ - boolean sent_table; /* TRUE when table has been output */ -} JHUFF_TBL; - - -/* Basic info about one component (color channel). */ - -typedef struct { - /* These values are fixed over the whole image. */ - /* For compression, they must be supplied by parameter setup; */ - /* for decompression, they are read from the SOF marker. */ - int component_id; /* identifier for this component (0..255) */ - int component_index; /* its index in SOF or cinfo->comp_info[] */ - int h_samp_factor; /* horizontal sampling factor (1..4) */ - int v_samp_factor; /* vertical sampling factor (1..4) */ - int quant_tbl_no; /* quantization table selector (0..3) */ - /* These values may vary between scans. */ - /* For compression, they must be supplied by parameter setup; */ - /* for decompression, they are read from the SOS marker. */ - /* The decompressor output side may not use these variables. */ - int dc_tbl_no; /* DC entropy table selector (0..3) */ - int ac_tbl_no; /* AC entropy table selector (0..3) */ - - /* Remaining fields should be treated as private by applications. */ - - /* These values are computed during compression or decompression startup: */ - /* Component's size in DCT blocks. - * Any dummy blocks added to complete an MCU are not counted; therefore - * these values do not depend on whether a scan is interleaved or not. - */ - JDIMENSION width_in_blocks; - JDIMENSION height_in_blocks; - /* Size of a DCT block in samples, - * reflecting any scaling we choose to apply during the DCT step. - * Values from 1 to 16 are supported. - * Note that different components may receive different DCT scalings. - */ - int DCT_h_scaled_size; - int DCT_v_scaled_size; - /* The downsampled dimensions are the component's actual, unpadded number - * of samples at the main buffer (preprocessing/compression interface); - * DCT scaling is included, so - * downsampled_width = ceil(image_width * Hi/Hmax * DCT_h_scaled_size/DCTSIZE) - * and similarly for height. - */ - JDIMENSION downsampled_width; /* actual width in samples */ - JDIMENSION downsampled_height; /* actual height in samples */ - /* This flag is used only for decompression. In cases where some of the - * components will be ignored (eg grayscale output from YCbCr image), - * we can skip most computations for the unused components. - */ - boolean component_needed; /* do we need the value of this component? */ - - /* These values are computed before starting a scan of the component. */ - /* The decompressor output side may not use these variables. */ - int MCU_width; /* number of blocks per MCU, horizontally */ - int MCU_height; /* number of blocks per MCU, vertically */ - int MCU_blocks; /* MCU_width * MCU_height */ - int MCU_sample_width; /* MCU width in samples: MCU_width * DCT_h_scaled_size */ - int last_col_width; /* # of non-dummy blocks across in last MCU */ - int last_row_height; /* # of non-dummy blocks down in last MCU */ - - /* Saved quantization table for component; NULL if none yet saved. - * See jdinput.c comments about the need for this information. - * This field is currently used only for decompression. - */ - JQUANT_TBL * quant_table; - - /* Private per-component storage for DCT or IDCT subsystem. */ - void * dct_table; -} jpeg_component_info; - - -/* The script for encoding a multiple-scan file is an array of these: */ - -typedef struct { - int comps_in_scan; /* number of components encoded in this scan */ - int component_index[MAX_COMPS_IN_SCAN]; /* their SOF/comp_info[] indexes */ - int Ss, Se; /* progressive JPEG spectral selection parms */ - int Ah, Al; /* progressive JPEG successive approx. parms */ -} jpeg_scan_info; - -/* The decompressor can save APPn and COM markers in a list of these: */ - -typedef struct jpeg_marker_struct FAR * jpeg_saved_marker_ptr; - -struct jpeg_marker_struct { - jpeg_saved_marker_ptr next; /* next in list, or NULL */ - UINT8 marker; /* marker code: JPEG_COM, or JPEG_APP0+n */ - unsigned int original_length; /* # bytes of data in the file */ - unsigned int data_length; /* # bytes of data saved at data[] */ - JOCTET FAR * data; /* the data contained in the marker */ - /* the marker length word is not counted in data_length or original_length */ -}; - -/* Known color spaces. */ - -typedef enum { - JCS_UNKNOWN, /* error/unspecified */ - JCS_GRAYSCALE, /* monochrome */ - JCS_RGB, /* red/green/blue */ - JCS_YCbCr, /* Y/Cb/Cr (also known as YUV) */ - JCS_CMYK, /* C/M/Y/K */ - JCS_YCCK /* Y/Cb/Cr/K */ -} J_COLOR_SPACE; - -/* Supported color transforms. */ - -typedef enum { - JCT_NONE = 0, - JCT_SUBTRACT_GREEN = 1 -} J_COLOR_TRANSFORM; - -/* DCT/IDCT algorithm options. */ - -typedef enum { - JDCT_ISLOW, /* slow but accurate integer algorithm */ - JDCT_IFAST, /* faster, less accurate integer method */ - JDCT_FLOAT /* floating-point: accurate, fast on fast HW */ -} J_DCT_METHOD; - -#ifndef JDCT_DEFAULT /* may be overridden in jconfig.h */ -#define JDCT_DEFAULT JDCT_ISLOW -#endif -#ifndef JDCT_FASTEST /* may be overridden in jconfig.h */ -#define JDCT_FASTEST JDCT_IFAST -#endif - -/* Dithering options for decompression. */ - -typedef enum { - JDITHER_NONE, /* no dithering */ - JDITHER_ORDERED, /* simple ordered dither */ - JDITHER_FS /* Floyd-Steinberg error diffusion dither */ -} J_DITHER_MODE; - - -/* Common fields between JPEG compression and decompression master structs. */ - -#define jpeg_common_fields \ - struct jpeg_error_mgr * err; /* Error handler module */\ - struct jpeg_memory_mgr * mem; /* Memory manager module */\ - struct jpeg_progress_mgr * progress; /* Progress monitor, or NULL if none */\ - void * client_data; /* Available for use by application */\ - boolean is_decompressor; /* So common code can tell which is which */\ - int global_state /* For checking call sequence validity */ - -/* Routines that are to be used by both halves of the library are declared - * to receive a pointer to this structure. There are no actual instances of - * jpeg_common_struct, only of jpeg_compress_struct and jpeg_decompress_struct. - */ -struct jpeg_common_struct { - jpeg_common_fields; /* Fields common to both master struct types */ - /* Additional fields follow in an actual jpeg_compress_struct or - * jpeg_decompress_struct. All three structs must agree on these - * initial fields! (This would be a lot cleaner in C++.) - */ -}; - -typedef struct jpeg_common_struct * j_common_ptr; -typedef struct jpeg_compress_struct * j_compress_ptr; -typedef struct jpeg_decompress_struct * j_decompress_ptr; - - -/* Master record for a compression instance */ - -struct jpeg_compress_struct { - jpeg_common_fields; /* Fields shared with jpeg_decompress_struct */ - - /* Destination for compressed data */ - struct jpeg_destination_mgr * dest; - - /* Description of source image --- these fields must be filled in by - * outer application before starting compression. in_color_space must - * be correct before you can even call jpeg_set_defaults(). - */ - - JDIMENSION image_width; /* input image width */ - JDIMENSION image_height; /* input image height */ - int input_components; /* # of color components in input image */ - J_COLOR_SPACE in_color_space; /* colorspace of input image */ - - double input_gamma; /* image gamma of input image */ - - /* Compression parameters --- these fields must be set before calling - * jpeg_start_compress(). We recommend calling jpeg_set_defaults() to - * initialize everything to reasonable defaults, then changing anything - * the application specifically wants to change. That way you won't get - * burnt when new parameters are added. Also note that there are several - * helper routines to simplify changing parameters. - */ - - unsigned int scale_num, scale_denom; /* fraction by which to scale image */ - - JDIMENSION jpeg_width; /* scaled JPEG image width */ - JDIMENSION jpeg_height; /* scaled JPEG image height */ - /* Dimensions of actual JPEG image that will be written to file, - * derived from input dimensions by scaling factors above. - * These fields are computed by jpeg_start_compress(). - * You can also use jpeg_calc_jpeg_dimensions() to determine these values - * in advance of calling jpeg_start_compress(). - */ - - int data_precision; /* bits of precision in image data */ - - int num_components; /* # of color components in JPEG image */ - J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */ - - jpeg_component_info * comp_info; - /* comp_info[i] describes component that appears i'th in SOF */ - - JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS]; - int q_scale_factor[NUM_QUANT_TBLS]; - /* ptrs to coefficient quantization tables, or NULL if not defined, - * and corresponding scale factors (percentage, initialized 100). - */ - - JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS]; - JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS]; - /* ptrs to Huffman coding tables, or NULL if not defined */ - - UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */ - UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */ - UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */ - - int num_scans; /* # of entries in scan_info array */ - const jpeg_scan_info * scan_info; /* script for multi-scan file, or NULL */ - /* The default value of scan_info is NULL, which causes a single-scan - * sequential JPEG file to be emitted. To create a multi-scan file, - * set num_scans and scan_info to point to an array of scan definitions. - */ - - boolean raw_data_in; /* TRUE=caller supplies downsampled data */ - boolean arith_code; /* TRUE=arithmetic coding, FALSE=Huffman */ - boolean optimize_coding; /* TRUE=optimize entropy encoding parms */ - boolean CCIR601_sampling; /* TRUE=first samples are cosited */ - boolean do_fancy_downsampling; /* TRUE=apply fancy downsampling */ - int smoothing_factor; /* 1..100, or 0 for no input smoothing */ - J_DCT_METHOD dct_method; /* DCT algorithm selector */ - - /* The restart interval can be specified in absolute MCUs by setting - * restart_interval, or in MCU rows by setting restart_in_rows - * (in which case the correct restart_interval will be figured - * for each scan). - */ - unsigned int restart_interval; /* MCUs per restart, or 0 for no restart */ - int restart_in_rows; /* if > 0, MCU rows per restart interval */ - - /* Parameters controlling emission of special markers. */ - - boolean write_JFIF_header; /* should a JFIF marker be written? */ - UINT8 JFIF_major_version; /* What to write for the JFIF version number */ - UINT8 JFIF_minor_version; - /* These three values are not used by the JPEG code, merely copied */ - /* into the JFIF APP0 marker. density_unit can be 0 for unknown, */ - /* 1 for dots/inch, or 2 for dots/cm. Note that the pixel aspect */ - /* ratio is defined by X_density/Y_density even when density_unit=0. */ - UINT8 density_unit; /* JFIF code for pixel size units */ - UINT16 X_density; /* Horizontal pixel density */ - UINT16 Y_density; /* Vertical pixel density */ - boolean write_Adobe_marker; /* should an Adobe marker be written? */ - - J_COLOR_TRANSFORM color_transform; - /* Color transform identifier, writes LSE marker if nonzero */ - - /* State variable: index of next scanline to be written to - * jpeg_write_scanlines(). Application may use this to control its - * processing loop, e.g., "while (next_scanline < image_height)". - */ - - JDIMENSION next_scanline; /* 0 .. image_height-1 */ - - /* Remaining fields are known throughout compressor, but generally - * should not be touched by a surrounding application. - */ - - /* - * These fields are computed during compression startup - */ - boolean progressive_mode; /* TRUE if scan script uses progressive mode */ - int max_h_samp_factor; /* largest h_samp_factor */ - int max_v_samp_factor; /* largest v_samp_factor */ - - int min_DCT_h_scaled_size; /* smallest DCT_h_scaled_size of any component */ - int min_DCT_v_scaled_size; /* smallest DCT_v_scaled_size of any component */ - - JDIMENSION total_iMCU_rows; /* # of iMCU rows to be input to coef ctlr */ - /* The coefficient controller receives data in units of MCU rows as defined - * for fully interleaved scans (whether the JPEG file is interleaved or not). - * There are v_samp_factor * DCTSIZE sample rows of each component in an - * "iMCU" (interleaved MCU) row. - */ - - /* - * These fields are valid during any one scan. - * They describe the components and MCUs actually appearing in the scan. - */ - int comps_in_scan; /* # of JPEG components in this scan */ - jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN]; - /* *cur_comp_info[i] describes component that appears i'th in SOS */ - - JDIMENSION MCUs_per_row; /* # of MCUs across the image */ - JDIMENSION MCU_rows_in_scan; /* # of MCU rows in the image */ - - int blocks_in_MCU; /* # of DCT blocks per MCU */ - int MCU_membership[C_MAX_BLOCKS_IN_MCU]; - /* MCU_membership[i] is index in cur_comp_info of component owning */ - /* i'th block in an MCU */ - - int Ss, Se, Ah, Al; /* progressive JPEG parameters for scan */ - - int block_size; /* the basic DCT block size: 1..16 */ - const int * natural_order; /* natural-order position array */ - int lim_Se; /* min( Se, DCTSIZE2-1 ) */ - - /* - * Links to compression subobjects (methods and private variables of modules) - */ - struct jpeg_comp_master * master; - struct jpeg_c_main_controller * main; - struct jpeg_c_prep_controller * prep; - struct jpeg_c_coef_controller * coef; - struct jpeg_marker_writer * marker; - struct jpeg_color_converter * cconvert; - struct jpeg_downsampler * downsample; - struct jpeg_forward_dct * fdct; - struct jpeg_entropy_encoder * entropy; - jpeg_scan_info * script_space; /* workspace for jpeg_simple_progression */ - int script_space_size; -}; - - -/* Master record for a decompression instance */ - -struct jpeg_decompress_struct { - jpeg_common_fields; /* Fields shared with jpeg_compress_struct */ - - /* Source of compressed data */ - struct jpeg_source_mgr * src; - - /* Basic description of image --- filled in by jpeg_read_header(). */ - /* Application may inspect these values to decide how to process image. */ - - JDIMENSION image_width; /* nominal image width (from SOF marker) */ - JDIMENSION image_height; /* nominal image height */ - int num_components; /* # of color components in JPEG image */ - J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */ - - /* Decompression processing parameters --- these fields must be set before - * calling jpeg_start_decompress(). Note that jpeg_read_header() initializes - * them to default values. - */ - - J_COLOR_SPACE out_color_space; /* colorspace for output */ - - unsigned int scale_num, scale_denom; /* fraction by which to scale image */ - - double output_gamma; /* image gamma wanted in output */ - - boolean buffered_image; /* TRUE=multiple output passes */ - boolean raw_data_out; /* TRUE=downsampled data wanted */ - - J_DCT_METHOD dct_method; /* IDCT algorithm selector */ - boolean do_fancy_upsampling; /* TRUE=apply fancy upsampling */ - boolean do_block_smoothing; /* TRUE=apply interblock smoothing */ - - boolean quantize_colors; /* TRUE=colormapped output wanted */ - /* the following are ignored if not quantize_colors: */ - J_DITHER_MODE dither_mode; /* type of color dithering to use */ - boolean two_pass_quantize; /* TRUE=use two-pass color quantization */ - int desired_number_of_colors; /* max # colors to use in created colormap */ - /* these are significant only in buffered-image mode: */ - boolean enable_1pass_quant; /* enable future use of 1-pass quantizer */ - boolean enable_external_quant;/* enable future use of external colormap */ - boolean enable_2pass_quant; /* enable future use of 2-pass quantizer */ - - /* Description of actual output image that will be returned to application. - * These fields are computed by jpeg_start_decompress(). - * You can also use jpeg_calc_output_dimensions() to determine these values - * in advance of calling jpeg_start_decompress(). - */ - - JDIMENSION output_width; /* scaled image width */ - JDIMENSION output_height; /* scaled image height */ - int out_color_components; /* # of color components in out_color_space */ - int output_components; /* # of color components returned */ - /* output_components is 1 (a colormap index) when quantizing colors; - * otherwise it equals out_color_components. - */ - int rec_outbuf_height; /* min recommended height of scanline buffer */ - /* If the buffer passed to jpeg_read_scanlines() is less than this many rows - * high, space and time will be wasted due to unnecessary data copying. - * Usually rec_outbuf_height will be 1 or 2, at most 4. - */ - - /* When quantizing colors, the output colormap is described by these fields. - * The application can supply a colormap by setting colormap non-NULL before - * calling jpeg_start_decompress; otherwise a colormap is created during - * jpeg_start_decompress or jpeg_start_output. - * The map has out_color_components rows and actual_number_of_colors columns. - */ - int actual_number_of_colors; /* number of entries in use */ - JSAMPARRAY colormap; /* The color map as a 2-D pixel array */ - - /* State variables: these variables indicate the progress of decompression. - * The application may examine these but must not modify them. - */ - - /* Row index of next scanline to be read from jpeg_read_scanlines(). - * Application may use this to control its processing loop, e.g., - * "while (output_scanline < output_height)". - */ - JDIMENSION output_scanline; /* 0 .. output_height-1 */ - - /* Current input scan number and number of iMCU rows completed in scan. - * These indicate the progress of the decompressor input side. - */ - int input_scan_number; /* Number of SOS markers seen so far */ - JDIMENSION input_iMCU_row; /* Number of iMCU rows completed */ - - /* The "output scan number" is the notional scan being displayed by the - * output side. The decompressor will not allow output scan/row number - * to get ahead of input scan/row, but it can fall arbitrarily far behind. - */ - int output_scan_number; /* Nominal scan number being displayed */ - JDIMENSION output_iMCU_row; /* Number of iMCU rows read */ - - /* Current progression status. coef_bits[c][i] indicates the precision - * with which component c's DCT coefficient i (in zigzag order) is known. - * It is -1 when no data has yet been received, otherwise it is the point - * transform (shift) value for the most recent scan of the coefficient - * (thus, 0 at completion of the progression). - * This pointer is NULL when reading a non-progressive file. - */ - int (*coef_bits)[DCTSIZE2]; /* -1 or current Al value for each coef */ - - /* Internal JPEG parameters --- the application usually need not look at - * these fields. Note that the decompressor output side may not use - * any parameters that can change between scans. - */ - - /* Quantization and Huffman tables are carried forward across input - * datastreams when processing abbreviated JPEG datastreams. - */ - - JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS]; - /* ptrs to coefficient quantization tables, or NULL if not defined */ - - JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS]; - JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS]; - /* ptrs to Huffman coding tables, or NULL if not defined */ - - /* These parameters are never carried across datastreams, since they - * are given in SOF/SOS markers or defined to be reset by SOI. - */ - - int data_precision; /* bits of precision in image data */ - - jpeg_component_info * comp_info; - /* comp_info[i] describes component that appears i'th in SOF */ - - boolean is_baseline; /* TRUE if Baseline SOF0 encountered */ - boolean progressive_mode; /* TRUE if SOFn specifies progressive mode */ - boolean arith_code; /* TRUE=arithmetic coding, FALSE=Huffman */ - - UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */ - UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */ - UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */ - - unsigned int restart_interval; /* MCUs per restart interval, or 0 for no restart */ - - /* These fields record data obtained from optional markers recognized by - * the JPEG library. - */ - boolean saw_JFIF_marker; /* TRUE iff a JFIF APP0 marker was found */ - /* Data copied from JFIF marker; only valid if saw_JFIF_marker is TRUE: */ - UINT8 JFIF_major_version; /* JFIF version number */ - UINT8 JFIF_minor_version; - UINT8 density_unit; /* JFIF code for pixel size units */ - UINT16 X_density; /* Horizontal pixel density */ - UINT16 Y_density; /* Vertical pixel density */ - boolean saw_Adobe_marker; /* TRUE iff an Adobe APP14 marker was found */ - UINT8 Adobe_transform; /* Color transform code from Adobe marker */ - - J_COLOR_TRANSFORM color_transform; - /* Color transform identifier derived from LSE marker, otherwise zero */ - - boolean CCIR601_sampling; /* TRUE=first samples are cosited */ - - /* Aside from the specific data retained from APPn markers known to the - * library, the uninterpreted contents of any or all APPn and COM markers - * can be saved in a list for examination by the application. - */ - jpeg_saved_marker_ptr marker_list; /* Head of list of saved markers */ - - /* Remaining fields are known throughout decompressor, but generally - * should not be touched by a surrounding application. - */ - - /* - * These fields are computed during decompression startup - */ - int max_h_samp_factor; /* largest h_samp_factor */ - int max_v_samp_factor; /* largest v_samp_factor */ - - int min_DCT_h_scaled_size; /* smallest DCT_h_scaled_size of any component */ - int min_DCT_v_scaled_size; /* smallest DCT_v_scaled_size of any component */ - - JDIMENSION total_iMCU_rows; /* # of iMCU rows in image */ - /* The coefficient controller's input and output progress is measured in - * units of "iMCU" (interleaved MCU) rows. These are the same as MCU rows - * in fully interleaved JPEG scans, but are used whether the scan is - * interleaved or not. We define an iMCU row as v_samp_factor DCT block - * rows of each component. Therefore, the IDCT output contains - * v_samp_factor*DCT_v_scaled_size sample rows of a component per iMCU row. - */ - - JSAMPLE * sample_range_limit; /* table for fast range-limiting */ - - /* - * These fields are valid during any one scan. - * They describe the components and MCUs actually appearing in the scan. - * Note that the decompressor output side must not use these fields. - */ - int comps_in_scan; /* # of JPEG components in this scan */ - jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN]; - /* *cur_comp_info[i] describes component that appears i'th in SOS */ - - JDIMENSION MCUs_per_row; /* # of MCUs across the image */ - JDIMENSION MCU_rows_in_scan; /* # of MCU rows in the image */ - - int blocks_in_MCU; /* # of DCT blocks per MCU */ - int MCU_membership[D_MAX_BLOCKS_IN_MCU]; - /* MCU_membership[i] is index in cur_comp_info of component owning */ - /* i'th block in an MCU */ - - int Ss, Se, Ah, Al; /* progressive JPEG parameters for scan */ - - /* These fields are derived from Se of first SOS marker. - */ - int block_size; /* the basic DCT block size: 1..16 */ - const int * natural_order; /* natural-order position array for entropy decode */ - int lim_Se; /* min( Se, DCTSIZE2-1 ) for entropy decode */ - - /* This field is shared between entropy decoder and marker parser. - * It is either zero or the code of a JPEG marker that has been - * read from the data source, but has not yet been processed. - */ - int unread_marker; - - /* - * Links to decompression subobjects (methods, private variables of modules) - */ - struct jpeg_decomp_master * master; - struct jpeg_d_main_controller * main; - struct jpeg_d_coef_controller * coef; - struct jpeg_d_post_controller * post; - struct jpeg_input_controller * inputctl; - struct jpeg_marker_reader * marker; - struct jpeg_entropy_decoder * entropy; - struct jpeg_inverse_dct * idct; - struct jpeg_upsampler * upsample; - struct jpeg_color_deconverter * cconvert; - struct jpeg_color_quantizer * cquantize; -}; - - -/* "Object" declarations for JPEG modules that may be supplied or called - * directly by the surrounding application. - * As with all objects in the JPEG library, these structs only define the - * publicly visible methods and state variables of a module. Additional - * private fields may exist after the public ones. - */ - - -/* Error handler object */ - -struct jpeg_error_mgr { - /* Error exit handler: does not return to caller */ - JMETHOD(noreturn_t, error_exit, (j_common_ptr cinfo)); - /* Conditionally emit a trace or warning message */ - JMETHOD(void, emit_message, (j_common_ptr cinfo, int msg_level)); - /* Routine that actually outputs a trace or error message */ - JMETHOD(void, output_message, (j_common_ptr cinfo)); - /* Format a message string for the most recent JPEG error or message */ - JMETHOD(void, format_message, (j_common_ptr cinfo, char * buffer)); -#define JMSG_LENGTH_MAX 200 /* recommended size of format_message buffer */ - /* Reset error state variables at start of a new image */ - JMETHOD(void, reset_error_mgr, (j_common_ptr cinfo)); - - /* The message ID code and any parameters are saved here. - * A message can have one string parameter or up to 8 int parameters. - */ - int msg_code; -#define JMSG_STR_PARM_MAX 80 - union { - int i[8]; - char s[JMSG_STR_PARM_MAX]; - } msg_parm; - - /* Standard state variables for error facility */ - - int trace_level; /* max msg_level that will be displayed */ - - /* For recoverable corrupt-data errors, we emit a warning message, - * but keep going unless emit_message chooses to abort. emit_message - * should count warnings in num_warnings. The surrounding application - * can check for bad data by seeing if num_warnings is nonzero at the - * end of processing. - */ - long num_warnings; /* number of corrupt-data warnings */ - - /* These fields point to the table(s) of error message strings. - * An application can change the table pointer to switch to a different - * message list (typically, to change the language in which errors are - * reported). Some applications may wish to add additional error codes - * that will be handled by the JPEG library error mechanism; the second - * table pointer is used for this purpose. - * - * First table includes all errors generated by JPEG library itself. - * Error code 0 is reserved for a "no such error string" message. - */ - const char * const * jpeg_message_table; /* Library errors */ - int last_jpeg_message; /* Table contains strings 0..last_jpeg_message */ - /* Second table can be added by application (see cjpeg/djpeg for example). - * It contains strings numbered first_addon_message..last_addon_message. - */ - const char * const * addon_message_table; /* Non-library errors */ - int first_addon_message; /* code for first string in addon table */ - int last_addon_message; /* code for last string in addon table */ -}; - - -/* Progress monitor object */ - -struct jpeg_progress_mgr { - JMETHOD(void, progress_monitor, (j_common_ptr cinfo)); - - long pass_counter; /* work units completed in this pass */ - long pass_limit; /* total number of work units in this pass */ - int completed_passes; /* passes completed so far */ - int total_passes; /* total number of passes expected */ -}; - - -/* Data destination object for compression */ - -struct jpeg_destination_mgr { - JOCTET * next_output_byte; /* => next byte to write in buffer */ - size_t free_in_buffer; /* # of byte spaces remaining in buffer */ - - JMETHOD(void, init_destination, (j_compress_ptr cinfo)); - JMETHOD(boolean, empty_output_buffer, (j_compress_ptr cinfo)); - JMETHOD(void, term_destination, (j_compress_ptr cinfo)); -}; - - -/* Data source object for decompression */ - -struct jpeg_source_mgr { - const JOCTET * next_input_byte; /* => next byte to read from buffer */ - size_t bytes_in_buffer; /* # of bytes remaining in buffer */ - - JMETHOD(void, init_source, (j_decompress_ptr cinfo)); - JMETHOD(boolean, fill_input_buffer, (j_decompress_ptr cinfo)); - JMETHOD(void, skip_input_data, (j_decompress_ptr cinfo, long num_bytes)); - JMETHOD(boolean, resync_to_restart, (j_decompress_ptr cinfo, int desired)); - JMETHOD(void, term_source, (j_decompress_ptr cinfo)); -}; - - -/* Memory manager object. - * Allocates "small" objects (a few K total), "large" objects (tens of K), - * and "really big" objects (virtual arrays with backing store if needed). - * The memory manager does not allow individual objects to be freed; rather, - * each created object is assigned to a pool, and whole pools can be freed - * at once. This is faster and more convenient than remembering exactly what - * to free, especially where malloc()/free() are not too speedy. - * NB: alloc routines never return NULL. They exit to error_exit if not - * successful. - */ - -#define JPOOL_PERMANENT 0 /* lasts until master record is destroyed */ -#define JPOOL_IMAGE 1 /* lasts until done with image/datastream */ -#define JPOOL_NUMPOOLS 2 - -typedef struct jvirt_sarray_control * jvirt_sarray_ptr; -typedef struct jvirt_barray_control * jvirt_barray_ptr; - - -struct jpeg_memory_mgr { - /* Method pointers */ - JMETHOD(void *, alloc_small, (j_common_ptr cinfo, int pool_id, - size_t sizeofobject)); - JMETHOD(void FAR *, alloc_large, (j_common_ptr cinfo, int pool_id, - size_t sizeofobject)); - JMETHOD(JSAMPARRAY, alloc_sarray, (j_common_ptr cinfo, int pool_id, - JDIMENSION samplesperrow, - JDIMENSION numrows)); - JMETHOD(JBLOCKARRAY, alloc_barray, (j_common_ptr cinfo, int pool_id, - JDIMENSION blocksperrow, - JDIMENSION numrows)); - JMETHOD(jvirt_sarray_ptr, request_virt_sarray, (j_common_ptr cinfo, - int pool_id, - boolean pre_zero, - JDIMENSION samplesperrow, - JDIMENSION numrows, - JDIMENSION maxaccess)); - JMETHOD(jvirt_barray_ptr, request_virt_barray, (j_common_ptr cinfo, - int pool_id, - boolean pre_zero, - JDIMENSION blocksperrow, - JDIMENSION numrows, - JDIMENSION maxaccess)); - JMETHOD(void, realize_virt_arrays, (j_common_ptr cinfo)); - JMETHOD(JSAMPARRAY, access_virt_sarray, (j_common_ptr cinfo, - jvirt_sarray_ptr ptr, - JDIMENSION start_row, - JDIMENSION num_rows, - boolean writable)); - JMETHOD(JBLOCKARRAY, access_virt_barray, (j_common_ptr cinfo, - jvirt_barray_ptr ptr, - JDIMENSION start_row, - JDIMENSION num_rows, - boolean writable)); - JMETHOD(void, free_pool, (j_common_ptr cinfo, int pool_id)); - JMETHOD(void, self_destruct, (j_common_ptr cinfo)); - - /* Limit on memory allocation for this JPEG object. (Note that this is - * merely advisory, not a guaranteed maximum; it only affects the space - * used for virtual-array buffers.) May be changed by outer application - * after creating the JPEG object. - */ - long max_memory_to_use; - - /* Maximum allocation request accepted by alloc_large. */ - long max_alloc_chunk; -}; - - -/* Routine signature for application-supplied marker processing methods. - * Need not pass marker code since it is stored in cinfo->unread_marker. - */ -typedef JMETHOD(boolean, jpeg_marker_parser_method, (j_decompress_ptr cinfo)); - - -/* Declarations for routines called by application. - * The JPP macro hides prototype parameters from compilers that can't cope. - * Note JPP requires double parentheses. - */ - -#ifdef HAVE_PROTOTYPES -#define JPP(arglist) arglist -#else -#define JPP(arglist) () -#endif - - -/* Short forms of external names for systems with brain-damaged linkers. - * We shorten external names to be unique in the first six letters, which - * is good enough for all known systems. - * (If your compiler itself needs names to be unique in less than 15 - * characters, you are out of luck. Get a better compiler.) - */ - -#ifdef NEED_SHORT_EXTERNAL_NAMES -#define jpeg_std_error jStdError -#define jpeg_CreateCompress jCreaCompress -#define jpeg_CreateDecompress jCreaDecompress -#define jpeg_destroy_compress jDestCompress -#define jpeg_destroy_decompress jDestDecompress -#define jpeg_stdio_dest jStdDest -#define jpeg_stdio_src jStdSrc -#define jpeg_mem_dest jMemDest -#define jpeg_mem_src jMemSrc -#define jpeg_set_defaults jSetDefaults -#define jpeg_set_colorspace jSetColorspace -#define jpeg_default_colorspace jDefColorspace -#define jpeg_set_quality jSetQuality -#define jpeg_set_linear_quality jSetLQuality -#define jpeg_default_qtables jDefQTables -#define jpeg_add_quant_table jAddQuantTable -#define jpeg_quality_scaling jQualityScaling -#define jpeg_simple_progression jSimProgress -#define jpeg_suppress_tables jSuppressTables -#define jpeg_alloc_quant_table jAlcQTable -#define jpeg_alloc_huff_table jAlcHTable -#define jpeg_start_compress jStrtCompress -#define jpeg_write_scanlines jWrtScanlines -#define jpeg_finish_compress jFinCompress -#define jpeg_calc_jpeg_dimensions jCjpegDimensions -#define jpeg_write_raw_data jWrtRawData -#define jpeg_write_marker jWrtMarker -#define jpeg_write_m_header jWrtMHeader -#define jpeg_write_m_byte jWrtMByte -#define jpeg_write_tables jWrtTables -#define jpeg_read_header jReadHeader -#define jpeg_start_decompress jStrtDecompress -#define jpeg_read_scanlines jReadScanlines -#define jpeg_finish_decompress jFinDecompress -#define jpeg_read_raw_data jReadRawData -#define jpeg_has_multiple_scans jHasMultScn -#define jpeg_start_output jStrtOutput -#define jpeg_finish_output jFinOutput -#define jpeg_input_complete jInComplete -#define jpeg_new_colormap jNewCMap -#define jpeg_consume_input jConsumeInput -#define jpeg_core_output_dimensions jCoreDimensions -#define jpeg_calc_output_dimensions jCalcDimensions -#define jpeg_save_markers jSaveMarkers -#define jpeg_set_marker_processor jSetMarker -#define jpeg_read_coefficients jReadCoefs -#define jpeg_write_coefficients jWrtCoefs -#define jpeg_copy_critical_parameters jCopyCrit -#define jpeg_abort_compress jAbrtCompress -#define jpeg_abort_decompress jAbrtDecompress -#define jpeg_abort jAbort -#define jpeg_destroy jDestroy -#define jpeg_resync_to_restart jResyncRestart -#endif /* NEED_SHORT_EXTERNAL_NAMES */ - - -/* Default error-management setup */ -EXTERN(struct jpeg_error_mgr *) jpeg_std_error - JPP((struct jpeg_error_mgr * err)); - -/* Initialization of JPEG compression objects. - * jpeg_create_compress() and jpeg_create_decompress() are the exported - * names that applications should call. These expand to calls on - * jpeg_CreateCompress and jpeg_CreateDecompress with additional information - * passed for version mismatch checking. - * NB: you must set up the error-manager BEFORE calling jpeg_create_xxx. - */ -#define jpeg_create_compress(cinfo) \ - jpeg_CreateCompress((cinfo), JPEG_LIB_VERSION, \ - (size_t) sizeof(struct jpeg_compress_struct)) -#define jpeg_create_decompress(cinfo) \ - jpeg_CreateDecompress((cinfo), JPEG_LIB_VERSION, \ - (size_t) sizeof(struct jpeg_decompress_struct)) -EXTERN(void) jpeg_CreateCompress JPP((j_compress_ptr cinfo, - int version, size_t structsize)); -EXTERN(void) jpeg_CreateDecompress JPP((j_decompress_ptr cinfo, - int version, size_t structsize)); -/* Destruction of JPEG compression objects */ -EXTERN(void) jpeg_destroy_compress JPP((j_compress_ptr cinfo)); -EXTERN(void) jpeg_destroy_decompress JPP((j_decompress_ptr cinfo)); - -/* Standard data source and destination managers: stdio streams. */ -/* Caller is responsible for opening the file before and closing after. */ -EXTERN(void) jpeg_stdio_dest JPP((j_compress_ptr cinfo, FILE * outfile)); -EXTERN(void) jpeg_stdio_src JPP((j_decompress_ptr cinfo, FILE * infile)); - -/* Data source and destination managers: memory buffers. */ -EXTERN(void) jpeg_mem_dest JPP((j_compress_ptr cinfo, - unsigned char ** outbuffer, - unsigned long * outsize)); -EXTERN(void) jpeg_mem_src JPP((j_decompress_ptr cinfo, - unsigned char * inbuffer, - unsigned long insize)); - -/* Default parameter setup for compression */ -EXTERN(void) jpeg_set_defaults JPP((j_compress_ptr cinfo)); -/* Compression parameter setup aids */ -EXTERN(void) jpeg_set_colorspace JPP((j_compress_ptr cinfo, - J_COLOR_SPACE colorspace)); -EXTERN(void) jpeg_default_colorspace JPP((j_compress_ptr cinfo)); -EXTERN(void) jpeg_set_quality JPP((j_compress_ptr cinfo, int quality, - boolean force_baseline)); -EXTERN(void) jpeg_set_linear_quality JPP((j_compress_ptr cinfo, - int scale_factor, - boolean force_baseline)); -EXTERN(void) jpeg_default_qtables JPP((j_compress_ptr cinfo, - boolean force_baseline)); -EXTERN(void) jpeg_add_quant_table JPP((j_compress_ptr cinfo, int which_tbl, - const unsigned int *basic_table, - int scale_factor, - boolean force_baseline)); -EXTERN(int) jpeg_quality_scaling JPP((int quality)); -EXTERN(void) jpeg_simple_progression JPP((j_compress_ptr cinfo)); -EXTERN(void) jpeg_suppress_tables JPP((j_compress_ptr cinfo, - boolean suppress)); -EXTERN(JQUANT_TBL *) jpeg_alloc_quant_table JPP((j_common_ptr cinfo)); -EXTERN(JHUFF_TBL *) jpeg_alloc_huff_table JPP((j_common_ptr cinfo)); - -/* Main entry points for compression */ -EXTERN(void) jpeg_start_compress JPP((j_compress_ptr cinfo, - boolean write_all_tables)); -EXTERN(JDIMENSION) jpeg_write_scanlines JPP((j_compress_ptr cinfo, - JSAMPARRAY scanlines, - JDIMENSION num_lines)); -EXTERN(void) jpeg_finish_compress JPP((j_compress_ptr cinfo)); - -/* Precalculate JPEG dimensions for current compression parameters. */ -EXTERN(void) jpeg_calc_jpeg_dimensions JPP((j_compress_ptr cinfo)); - -/* Replaces jpeg_write_scanlines when writing raw downsampled data. */ -EXTERN(JDIMENSION) jpeg_write_raw_data JPP((j_compress_ptr cinfo, - JSAMPIMAGE data, - JDIMENSION num_lines)); - -/* Write a special marker. See libjpeg.txt concerning safe usage. */ -EXTERN(void) jpeg_write_marker - JPP((j_compress_ptr cinfo, int marker, - const JOCTET * dataptr, unsigned int datalen)); -/* Same, but piecemeal. */ -EXTERN(void) jpeg_write_m_header - JPP((j_compress_ptr cinfo, int marker, unsigned int datalen)); -EXTERN(void) jpeg_write_m_byte - JPP((j_compress_ptr cinfo, int val)); - -/* Alternate compression function: just write an abbreviated table file */ -EXTERN(void) jpeg_write_tables JPP((j_compress_ptr cinfo)); - -/* Decompression startup: read start of JPEG datastream to see what's there */ -EXTERN(int) jpeg_read_header JPP((j_decompress_ptr cinfo, - boolean require_image)); -/* Return value is one of: */ -#define JPEG_SUSPENDED 0 /* Suspended due to lack of input data */ -#define JPEG_HEADER_OK 1 /* Found valid image datastream */ -#define JPEG_HEADER_TABLES_ONLY 2 /* Found valid table-specs-only datastream */ -/* If you pass require_image = TRUE (normal case), you need not check for - * a TABLES_ONLY return code; an abbreviated file will cause an error exit. - * JPEG_SUSPENDED is only possible if you use a data source module that can - * give a suspension return (the stdio source module doesn't). - */ - -/* Main entry points for decompression */ -EXTERN(boolean) jpeg_start_decompress JPP((j_decompress_ptr cinfo)); -EXTERN(JDIMENSION) jpeg_read_scanlines JPP((j_decompress_ptr cinfo, - JSAMPARRAY scanlines, - JDIMENSION max_lines)); -EXTERN(boolean) jpeg_finish_decompress JPP((j_decompress_ptr cinfo)); - -/* Replaces jpeg_read_scanlines when reading raw downsampled data. */ -EXTERN(JDIMENSION) jpeg_read_raw_data JPP((j_decompress_ptr cinfo, - JSAMPIMAGE data, - JDIMENSION max_lines)); - -/* Additional entry points for buffered-image mode. */ -EXTERN(boolean) jpeg_has_multiple_scans JPP((j_decompress_ptr cinfo)); -EXTERN(boolean) jpeg_start_output JPP((j_decompress_ptr cinfo, - int scan_number)); -EXTERN(boolean) jpeg_finish_output JPP((j_decompress_ptr cinfo)); -EXTERN(boolean) jpeg_input_complete JPP((j_decompress_ptr cinfo)); -EXTERN(void) jpeg_new_colormap JPP((j_decompress_ptr cinfo)); -EXTERN(int) jpeg_consume_input JPP((j_decompress_ptr cinfo)); -/* Return value is one of: */ -/* #define JPEG_SUSPENDED 0 Suspended due to lack of input data */ -#define JPEG_REACHED_SOS 1 /* Reached start of new scan */ -#define JPEG_REACHED_EOI 2 /* Reached end of image */ -#define JPEG_ROW_COMPLETED 3 /* Completed one iMCU row */ -#define JPEG_SCAN_COMPLETED 4 /* Completed last iMCU row of a scan */ - -/* Precalculate output dimensions for current decompression parameters. */ -EXTERN(void) jpeg_core_output_dimensions JPP((j_decompress_ptr cinfo)); -EXTERN(void) jpeg_calc_output_dimensions JPP((j_decompress_ptr cinfo)); - -/* Control saving of COM and APPn markers into marker_list. */ -EXTERN(void) jpeg_save_markers - JPP((j_decompress_ptr cinfo, int marker_code, - unsigned int length_limit)); - -/* Install a special processing method for COM or APPn markers. */ -EXTERN(void) jpeg_set_marker_processor - JPP((j_decompress_ptr cinfo, int marker_code, - jpeg_marker_parser_method routine)); - -/* Read or write raw DCT coefficients --- useful for lossless transcoding. */ -EXTERN(jvirt_barray_ptr *) jpeg_read_coefficients JPP((j_decompress_ptr cinfo)); -EXTERN(void) jpeg_write_coefficients JPP((j_compress_ptr cinfo, - jvirt_barray_ptr * coef_arrays)); -EXTERN(void) jpeg_copy_critical_parameters JPP((j_decompress_ptr srcinfo, - j_compress_ptr dstinfo)); - -/* If you choose to abort compression or decompression before completing - * jpeg_finish_(de)compress, then you need to clean up to release memory, - * temporary files, etc. You can just call jpeg_destroy_(de)compress - * if you're done with the JPEG object, but if you want to clean it up and - * reuse it, call this: - */ -EXTERN(void) jpeg_abort_compress JPP((j_compress_ptr cinfo)); -EXTERN(void) jpeg_abort_decompress JPP((j_decompress_ptr cinfo)); - -/* Generic versions of jpeg_abort and jpeg_destroy that work on either - * flavor of JPEG object. These may be more convenient in some places. - */ -EXTERN(void) jpeg_abort JPP((j_common_ptr cinfo)); -EXTERN(void) jpeg_destroy JPP((j_common_ptr cinfo)); - -/* Default restart-marker-resync procedure for use by data source modules */ -EXTERN(boolean) jpeg_resync_to_restart JPP((j_decompress_ptr cinfo, - int desired)); - - -/* These marker codes are exported since applications and data source modules - * are likely to want to use them. - */ - -#define JPEG_RST0 0xD0 /* RST0 marker code */ -#define JPEG_EOI 0xD9 /* EOI marker code */ -#define JPEG_APP0 0xE0 /* APP0 marker code */ -#define JPEG_COM 0xFE /* COM marker code */ - - -/* If we have a brain-damaged compiler that emits warnings (or worse, errors) - * for structure definitions that are never filled in, keep it quiet by - * supplying dummy definitions for the various substructures. - */ - -#ifdef INCOMPLETE_TYPES_BROKEN -#ifndef JPEG_INTERNALS /* will be defined in jpegint.h */ -struct jvirt_sarray_control { long dummy; }; -struct jvirt_barray_control { long dummy; }; -struct jpeg_comp_master { long dummy; }; -struct jpeg_c_main_controller { long dummy; }; -struct jpeg_c_prep_controller { long dummy; }; -struct jpeg_c_coef_controller { long dummy; }; -struct jpeg_marker_writer { long dummy; }; -struct jpeg_color_converter { long dummy; }; -struct jpeg_downsampler { long dummy; }; -struct jpeg_forward_dct { long dummy; }; -struct jpeg_entropy_encoder { long dummy; }; -struct jpeg_decomp_master { long dummy; }; -struct jpeg_d_main_controller { long dummy; }; -struct jpeg_d_coef_controller { long dummy; }; -struct jpeg_d_post_controller { long dummy; }; -struct jpeg_input_controller { long dummy; }; -struct jpeg_marker_reader { long dummy; }; -struct jpeg_entropy_decoder { long dummy; }; -struct jpeg_inverse_dct { long dummy; }; -struct jpeg_upsampler { long dummy; }; -struct jpeg_color_deconverter { long dummy; }; -struct jpeg_color_quantizer { long dummy; }; -#endif /* JPEG_INTERNALS */ -#endif /* INCOMPLETE_TYPES_BROKEN */ - - -/* - * The JPEG library modules define JPEG_INTERNALS before including this file. - * The internal structure declarations are read only when that is true. - * Applications using the library should not include jpegint.h, but may wish - * to include jerror.h. - */ - -#ifdef JPEG_INTERNALS -#include "jpegint.h" /* fetch private declarations */ -#include "jerror.h" /* fetch error codes too */ -#endif - -#ifdef __cplusplus -#ifndef DONT_USE_EXTERN_C -} -#endif -#endif - -#endif /* JPEGLIB_H */ diff --git a/cocos2dx/platform/third_party/win32/libtiff/tiff.h b/cocos2dx/platform/third_party/win32/libtiff/tiff.h deleted file mode 100644 index 19b4e7976d..0000000000 --- a/cocos2dx/platform/third_party/win32/libtiff/tiff.h +++ /dev/null @@ -1,678 +0,0 @@ -/* $Id: tiff.h,v 1.68 2012-08-19 16:56:35 bfriesen Exp $ */ - -/* - * Copyright (c) 1988-1997 Sam Leffler - * Copyright (c) 1991-1997 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Sam Leffler and Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#ifndef _TIFF_ -#define _TIFF_ - -#include "tiffconf.h" - -/* - * Tag Image File Format (TIFF) - * - * Based on Rev 6.0 from: - * Developer's Desk - * Aldus Corporation - * 411 First Ave. South - * Suite 200 - * Seattle, WA 98104 - * 206-622-5500 - * - * (http://partners.adobe.com/asn/developer/PDFS/TN/TIFF6.pdf) - * - * For BigTIFF design notes see the following links - * http://www.remotesensing.org/libtiff/bigtiffdesign.html - * http://www.awaresystems.be/imaging/tiff/bigtiff.html - */ - -#define TIFF_VERSION_CLASSIC 42 -#define TIFF_VERSION_BIG 43 - -#define TIFF_BIGENDIAN 0x4d4d -#define TIFF_LITTLEENDIAN 0x4949 -#define MDI_LITTLEENDIAN 0x5045 -#define MDI_BIGENDIAN 0x4550 - -/* - * Intrinsic data types required by the file format: - * - * 8-bit quantities int8/uint8 - * 16-bit quantities int16/uint16 - * 32-bit quantities int32/uint32 - * 64-bit quantities int64/uint64 - * strings unsigned char* - */ - -typedef TIFF_INT8_T int8; -typedef TIFF_UINT8_T uint8; - -typedef TIFF_INT16_T int16; -typedef TIFF_UINT16_T uint16; - -typedef TIFF_INT32_T int32; -typedef TIFF_UINT32_T uint32; - -typedef TIFF_INT64_T int64; -typedef TIFF_UINT64_T uint64; - -/* - * Some types as promoted in a variable argument list - * We use uint16_vap rather then directly using int, because this way - * we document the type we actually want to pass through, conceptually, - * rather then confusing the issue by merely stating the type it gets - * promoted to - */ - -typedef int uint16_vap; - -/* - * TIFF header. - */ -typedef struct { - uint16 tiff_magic; /* magic number (defines byte order) */ - uint16 tiff_version; /* TIFF version number */ -} TIFFHeaderCommon; -typedef struct { - uint16 tiff_magic; /* magic number (defines byte order) */ - uint16 tiff_version; /* TIFF version number */ - uint32 tiff_diroff; /* byte offset to first directory */ -} TIFFHeaderClassic; -typedef struct { - uint16 tiff_magic; /* magic number (defines byte order) */ - uint16 tiff_version; /* TIFF version number */ - uint16 tiff_offsetsize; /* size of offsets, should be 8 */ - uint16 tiff_unused; /* unused word, should be 0 */ - uint64 tiff_diroff; /* byte offset to first directory */ -} TIFFHeaderBig; - - -/* - * NB: In the comments below, - * - items marked with a + are obsoleted by revision 5.0, - * - items marked with a ! are introduced in revision 6.0. - * - items marked with a % are introduced post revision 6.0. - * - items marked with a $ are obsoleted by revision 6.0. - * - items marked with a & are introduced by Adobe DNG specification. - */ - -/* - * Tag data type information. - * - * Note: RATIONALs are the ratio of two 32-bit integer values. - */ -typedef enum { - TIFF_NOTYPE = 0, /* placeholder */ - TIFF_BYTE = 1, /* 8-bit unsigned integer */ - TIFF_ASCII = 2, /* 8-bit bytes w/ last byte null */ - TIFF_SHORT = 3, /* 16-bit unsigned integer */ - TIFF_LONG = 4, /* 32-bit unsigned integer */ - TIFF_RATIONAL = 5, /* 64-bit unsigned fraction */ - TIFF_SBYTE = 6, /* !8-bit signed integer */ - TIFF_UNDEFINED = 7, /* !8-bit untyped data */ - TIFF_SSHORT = 8, /* !16-bit signed integer */ - TIFF_SLONG = 9, /* !32-bit signed integer */ - TIFF_SRATIONAL = 10, /* !64-bit signed fraction */ - TIFF_FLOAT = 11, /* !32-bit IEEE floating point */ - TIFF_DOUBLE = 12, /* !64-bit IEEE floating point */ - TIFF_IFD = 13, /* %32-bit unsigned integer (offset) */ - TIFF_LONG8 = 16, /* BigTIFF 64-bit unsigned integer */ - TIFF_SLONG8 = 17, /* BigTIFF 64-bit signed integer */ - TIFF_IFD8 = 18 /* BigTIFF 64-bit unsigned integer (offset) */ -} TIFFDataType; - -/* - * TIFF Tag Definitions. - */ -#define TIFFTAG_SUBFILETYPE 254 /* subfile data descriptor */ -#define FILETYPE_REDUCEDIMAGE 0x1 /* reduced resolution version */ -#define FILETYPE_PAGE 0x2 /* one page of many */ -#define FILETYPE_MASK 0x4 /* transparency mask */ -#define TIFFTAG_OSUBFILETYPE 255 /* +kind of data in subfile */ -#define OFILETYPE_IMAGE 1 /* full resolution image data */ -#define OFILETYPE_REDUCEDIMAGE 2 /* reduced size image data */ -#define OFILETYPE_PAGE 3 /* one page of many */ -#define TIFFTAG_IMAGEWIDTH 256 /* image width in pixels */ -#define TIFFTAG_IMAGELENGTH 257 /* image height in pixels */ -#define TIFFTAG_BITSPERSAMPLE 258 /* bits per channel (sample) */ -#define TIFFTAG_COMPRESSION 259 /* data compression technique */ -#define COMPRESSION_NONE 1 /* dump mode */ -#define COMPRESSION_CCITTRLE 2 /* CCITT modified Huffman RLE */ -#define COMPRESSION_CCITTFAX3 3 /* CCITT Group 3 fax encoding */ -#define COMPRESSION_CCITT_T4 3 /* CCITT T.4 (TIFF 6 name) */ -#define COMPRESSION_CCITTFAX4 4 /* CCITT Group 4 fax encoding */ -#define COMPRESSION_CCITT_T6 4 /* CCITT T.6 (TIFF 6 name) */ -#define COMPRESSION_LZW 5 /* Lempel-Ziv & Welch */ -#define COMPRESSION_OJPEG 6 /* !6.0 JPEG */ -#define COMPRESSION_JPEG 7 /* %JPEG DCT compression */ -#define COMPRESSION_T85 9 /* !TIFF/FX T.85 JBIG compression */ -#define COMPRESSION_T43 10 /* !TIFF/FX T.43 colour by layered JBIG compression */ -#define COMPRESSION_NEXT 32766 /* NeXT 2-bit RLE */ -#define COMPRESSION_CCITTRLEW 32771 /* #1 w/ word alignment */ -#define COMPRESSION_PACKBITS 32773 /* Macintosh RLE */ -#define COMPRESSION_THUNDERSCAN 32809 /* ThunderScan RLE */ -/* codes 32895-32898 are reserved for ANSI IT8 TIFF/IT <dkelly@apago.com) */ -#define COMPRESSION_IT8CTPAD 32895 /* IT8 CT w/padding */ -#define COMPRESSION_IT8LW 32896 /* IT8 Linework RLE */ -#define COMPRESSION_IT8MP 32897 /* IT8 Monochrome picture */ -#define COMPRESSION_IT8BL 32898 /* IT8 Binary line art */ -/* compression codes 32908-32911 are reserved for Pixar */ -#define COMPRESSION_PIXARFILM 32908 /* Pixar companded 10bit LZW */ -#define COMPRESSION_PIXARLOG 32909 /* Pixar companded 11bit ZIP */ -#define COMPRESSION_DEFLATE 32946 /* Deflate compression */ -#define COMPRESSION_ADOBE_DEFLATE 8 /* Deflate compression, - as recognized by Adobe */ -/* compression code 32947 is reserved for Oceana Matrix <dev@oceana.com> */ -#define COMPRESSION_DCS 32947 /* Kodak DCS encoding */ -#define COMPRESSION_JBIG 34661 /* ISO JBIG */ -#define COMPRESSION_SGILOG 34676 /* SGI Log Luminance RLE */ -#define COMPRESSION_SGILOG24 34677 /* SGI Log 24-bit packed */ -#define COMPRESSION_JP2000 34712 /* Leadtools JPEG2000 */ -#define COMPRESSION_LZMA 34925 /* LZMA2 */ -#define TIFFTAG_PHOTOMETRIC 262 /* photometric interpretation */ -#define PHOTOMETRIC_MINISWHITE 0 /* min value is white */ -#define PHOTOMETRIC_MINISBLACK 1 /* min value is black */ -#define PHOTOMETRIC_RGB 2 /* RGB color model */ -#define PHOTOMETRIC_PALETTE 3 /* color map indexed */ -#define PHOTOMETRIC_MASK 4 /* $holdout mask */ -#define PHOTOMETRIC_SEPARATED 5 /* !color separations */ -#define PHOTOMETRIC_YCBCR 6 /* !CCIR 601 */ -#define PHOTOMETRIC_CIELAB 8 /* !1976 CIE L*a*b* */ -#define PHOTOMETRIC_ICCLAB 9 /* ICC L*a*b* [Adobe TIFF Technote 4] */ -#define PHOTOMETRIC_ITULAB 10 /* ITU L*a*b* */ -#define PHOTOMETRIC_LOGL 32844 /* CIE Log2(L) */ -#define PHOTOMETRIC_LOGLUV 32845 /* CIE Log2(L) (u',v') */ -#define TIFFTAG_THRESHHOLDING 263 /* +thresholding used on data */ -#define THRESHHOLD_BILEVEL 1 /* b&w art scan */ -#define THRESHHOLD_HALFTONE 2 /* or dithered scan */ -#define THRESHHOLD_ERRORDIFFUSE 3 /* usually floyd-steinberg */ -#define TIFFTAG_CELLWIDTH 264 /* +dithering matrix width */ -#define TIFFTAG_CELLLENGTH 265 /* +dithering matrix height */ -#define TIFFTAG_FILLORDER 266 /* data order within a byte */ -#define FILLORDER_MSB2LSB 1 /* most significant -> least */ -#define FILLORDER_LSB2MSB 2 /* least significant -> most */ -#define TIFFTAG_DOCUMENTNAME 269 /* name of doc. image is from */ -#define TIFFTAG_IMAGEDESCRIPTION 270 /* info about image */ -#define TIFFTAG_MAKE 271 /* scanner manufacturer name */ -#define TIFFTAG_MODEL 272 /* scanner model name/number */ -#define TIFFTAG_STRIPOFFSETS 273 /* offsets to data strips */ -#define TIFFTAG_ORIENTATION 274 /* +image orientation */ -#define ORIENTATION_TOPLEFT 1 /* row 0 top, col 0 lhs */ -#define ORIENTATION_TOPRIGHT 2 /* row 0 top, col 0 rhs */ -#define ORIENTATION_BOTRIGHT 3 /* row 0 bottom, col 0 rhs */ -#define ORIENTATION_BOTLEFT 4 /* row 0 bottom, col 0 lhs */ -#define ORIENTATION_LEFTTOP 5 /* row 0 lhs, col 0 top */ -#define ORIENTATION_RIGHTTOP 6 /* row 0 rhs, col 0 top */ -#define ORIENTATION_RIGHTBOT 7 /* row 0 rhs, col 0 bottom */ -#define ORIENTATION_LEFTBOT 8 /* row 0 lhs, col 0 bottom */ -#define TIFFTAG_SAMPLESPERPIXEL 277 /* samples per pixel */ -#define TIFFTAG_ROWSPERSTRIP 278 /* rows per strip of data */ -#define TIFFTAG_STRIPBYTECOUNTS 279 /* bytes counts for strips */ -#define TIFFTAG_MINSAMPLEVALUE 280 /* +minimum sample value */ -#define TIFFTAG_MAXSAMPLEVALUE 281 /* +maximum sample value */ -#define TIFFTAG_XRESOLUTION 282 /* pixels/resolution in x */ -#define TIFFTAG_YRESOLUTION 283 /* pixels/resolution in y */ -#define TIFFTAG_PLANARCONFIG 284 /* storage organization */ -#define PLANARCONFIG_CONTIG 1 /* single image plane */ -#define PLANARCONFIG_SEPARATE 2 /* separate planes of data */ -#define TIFFTAG_PAGENAME 285 /* page name image is from */ -#define TIFFTAG_XPOSITION 286 /* x page offset of image lhs */ -#define TIFFTAG_YPOSITION 287 /* y page offset of image lhs */ -#define TIFFTAG_FREEOFFSETS 288 /* +byte offset to free block */ -#define TIFFTAG_FREEBYTECOUNTS 289 /* +sizes of free blocks */ -#define TIFFTAG_GRAYRESPONSEUNIT 290 /* $gray scale curve accuracy */ -#define GRAYRESPONSEUNIT_10S 1 /* tenths of a unit */ -#define GRAYRESPONSEUNIT_100S 2 /* hundredths of a unit */ -#define GRAYRESPONSEUNIT_1000S 3 /* thousandths of a unit */ -#define GRAYRESPONSEUNIT_10000S 4 /* ten-thousandths of a unit */ -#define GRAYRESPONSEUNIT_100000S 5 /* hundred-thousandths */ -#define TIFFTAG_GRAYRESPONSECURVE 291 /* $gray scale response curve */ -#define TIFFTAG_GROUP3OPTIONS 292 /* 32 flag bits */ -#define TIFFTAG_T4OPTIONS 292 /* TIFF 6.0 proper name alias */ -#define GROUP3OPT_2DENCODING 0x1 /* 2-dimensional coding */ -#define GROUP3OPT_UNCOMPRESSED 0x2 /* data not compressed */ -#define GROUP3OPT_FILLBITS 0x4 /* fill to byte boundary */ -#define TIFFTAG_GROUP4OPTIONS 293 /* 32 flag bits */ -#define TIFFTAG_T6OPTIONS 293 /* TIFF 6.0 proper name */ -#define GROUP4OPT_UNCOMPRESSED 0x2 /* data not compressed */ -#define TIFFTAG_RESOLUTIONUNIT 296 /* units of resolutions */ -#define RESUNIT_NONE 1 /* no meaningful units */ -#define RESUNIT_INCH 2 /* english */ -#define RESUNIT_CENTIMETER 3 /* metric */ -#define TIFFTAG_PAGENUMBER 297 /* page numbers of multi-page */ -#define TIFFTAG_COLORRESPONSEUNIT 300 /* $color curve accuracy */ -#define COLORRESPONSEUNIT_10S 1 /* tenths of a unit */ -#define COLORRESPONSEUNIT_100S 2 /* hundredths of a unit */ -#define COLORRESPONSEUNIT_1000S 3 /* thousandths of a unit */ -#define COLORRESPONSEUNIT_10000S 4 /* ten-thousandths of a unit */ -#define COLORRESPONSEUNIT_100000S 5 /* hundred-thousandths */ -#define TIFFTAG_TRANSFERFUNCTION 301 /* !colorimetry info */ -#define TIFFTAG_SOFTWARE 305 /* name & release */ -#define TIFFTAG_DATETIME 306 /* creation date and time */ -#define TIFFTAG_ARTIST 315 /* creator of image */ -#define TIFFTAG_HOSTCOMPUTER 316 /* machine where created */ -#define TIFFTAG_PREDICTOR 317 /* prediction scheme w/ LZW */ -#define PREDICTOR_NONE 1 /* no prediction scheme used */ -#define PREDICTOR_HORIZONTAL 2 /* horizontal differencing */ -#define PREDICTOR_FLOATINGPOINT 3 /* floating point predictor */ -#define TIFFTAG_WHITEPOINT 318 /* image white point */ -#define TIFFTAG_PRIMARYCHROMATICITIES 319 /* !primary chromaticities */ -#define TIFFTAG_COLORMAP 320 /* RGB map for pallette image */ -#define TIFFTAG_HALFTONEHINTS 321 /* !highlight+shadow info */ -#define TIFFTAG_TILEWIDTH 322 /* !tile width in pixels */ -#define TIFFTAG_TILELENGTH 323 /* !tile height in pixels */ -#define TIFFTAG_TILEOFFSETS 324 /* !offsets to data tiles */ -#define TIFFTAG_TILEBYTECOUNTS 325 /* !byte counts for tiles */ -#define TIFFTAG_BADFAXLINES 326 /* lines w/ wrong pixel count */ -#define TIFFTAG_CLEANFAXDATA 327 /* regenerated line info */ -#define CLEANFAXDATA_CLEAN 0 /* no errors detected */ -#define CLEANFAXDATA_REGENERATED 1 /* receiver regenerated lines */ -#define CLEANFAXDATA_UNCLEAN 2 /* uncorrected errors exist */ -#define TIFFTAG_CONSECUTIVEBADFAXLINES 328 /* max consecutive bad lines */ -#define TIFFTAG_SUBIFD 330 /* subimage descriptors */ -#define TIFFTAG_INKSET 332 /* !inks in separated image */ -#define INKSET_CMYK 1 /* !cyan-magenta-yellow-black color */ -#define INKSET_MULTIINK 2 /* !multi-ink or hi-fi color */ -#define TIFFTAG_INKNAMES 333 /* !ascii names of inks */ -#define TIFFTAG_NUMBEROFINKS 334 /* !number of inks */ -#define TIFFTAG_DOTRANGE 336 /* !0% and 100% dot codes */ -#define TIFFTAG_TARGETPRINTER 337 /* !separation target */ -#define TIFFTAG_EXTRASAMPLES 338 /* !info about extra samples */ -#define EXTRASAMPLE_UNSPECIFIED 0 /* !unspecified data */ -#define EXTRASAMPLE_ASSOCALPHA 1 /* !associated alpha data */ -#define EXTRASAMPLE_UNASSALPHA 2 /* !unassociated alpha data */ -#define TIFFTAG_SAMPLEFORMAT 339 /* !data sample format */ -#define SAMPLEFORMAT_UINT 1 /* !unsigned integer data */ -#define SAMPLEFORMAT_INT 2 /* !signed integer data */ -#define SAMPLEFORMAT_IEEEFP 3 /* !IEEE floating point data */ -#define SAMPLEFORMAT_VOID 4 /* !untyped data */ -#define SAMPLEFORMAT_COMPLEXINT 5 /* !complex signed int */ -#define SAMPLEFORMAT_COMPLEXIEEEFP 6 /* !complex ieee floating */ -#define TIFFTAG_SMINSAMPLEVALUE 340 /* !variable MinSampleValue */ -#define TIFFTAG_SMAXSAMPLEVALUE 341 /* !variable MaxSampleValue */ -#define TIFFTAG_CLIPPATH 343 /* %ClipPath - [Adobe TIFF technote 2] */ -#define TIFFTAG_XCLIPPATHUNITS 344 /* %XClipPathUnits - [Adobe TIFF technote 2] */ -#define TIFFTAG_YCLIPPATHUNITS 345 /* %YClipPathUnits - [Adobe TIFF technote 2] */ -#define TIFFTAG_INDEXED 346 /* %Indexed - [Adobe TIFF Technote 3] */ -#define TIFFTAG_JPEGTABLES 347 /* %JPEG table stream */ -#define TIFFTAG_OPIPROXY 351 /* %OPI Proxy [Adobe TIFF technote] */ -/* Tags 400-435 are from the TIFF/FX spec */ -#define TIFFTAG_GLOBALPARAMETERSIFD 400 /* ! */ -#define TIFFTAG_PROFILETYPE 401 /* ! */ -#define PROFILETYPE_UNSPECIFIED 0 /* ! */ -#define PROFILETYPE_G3_FAX 1 /* ! */ -#define TIFFTAG_FAXPROFILE 402 /* ! */ -#define FAXPROFILE_S 1 /* !TIFF/FX FAX profile S */ -#define FAXPROFILE_F 2 /* !TIFF/FX FAX profile F */ -#define FAXPROFILE_J 3 /* !TIFF/FX FAX profile J */ -#define FAXPROFILE_C 4 /* !TIFF/FX FAX profile C */ -#define FAXPROFILE_L 5 /* !TIFF/FX FAX profile L */ -#define FAXPROFILE_M 6 /* !TIFF/FX FAX profile LM */ -#define TIFFTAG_CODINGMETHODS 403 /* !TIFF/FX coding methods */ -#define CODINGMETHODS_T4_1D (1 << 1) /* !T.4 1D */ -#define CODINGMETHODS_T4_2D (1 << 2) /* !T.4 2D */ -#define CODINGMETHODS_T6 (1 << 3) /* !T.6 */ -#define CODINGMETHODS_T85 (1 << 4) /* !T.85 JBIG */ -#define CODINGMETHODS_T42 (1 << 5) /* !T.42 JPEG */ -#define CODINGMETHODS_T43 (1 << 6) /* !T.43 colour by layered JBIG */ -#define TIFFTAG_VERSIONYEAR 404 /* !TIFF/FX version year */ -#define TIFFTAG_MODENUMBER 405 /* !TIFF/FX mode number */ -#define TIFFTAG_DECODE 433 /* !TIFF/FX decode */ -#define TIFFTAG_IMAGEBASECOLOR 434 /* !TIFF/FX image base colour */ -#define TIFFTAG_T82OPTIONS 435 /* !TIFF/FX T.82 options */ -/* - * Tags 512-521 are obsoleted by Technical Note #2 which specifies a - * revised JPEG-in-TIFF scheme. - */ -#define TIFFTAG_JPEGPROC 512 /* !JPEG processing algorithm */ -#define JPEGPROC_BASELINE 1 /* !baseline sequential */ -#define JPEGPROC_LOSSLESS 14 /* !Huffman coded lossless */ -#define TIFFTAG_JPEGIFOFFSET 513 /* !pointer to SOI marker */ -#define TIFFTAG_JPEGIFBYTECOUNT 514 /* !JFIF stream length */ -#define TIFFTAG_JPEGRESTARTINTERVAL 515 /* !restart interval length */ -#define TIFFTAG_JPEGLOSSLESSPREDICTORS 517 /* !lossless proc predictor */ -#define TIFFTAG_JPEGPOINTTRANSFORM 518 /* !lossless point transform */ -#define TIFFTAG_JPEGQTABLES 519 /* !Q matrice offsets */ -#define TIFFTAG_JPEGDCTABLES 520 /* !DCT table offsets */ -#define TIFFTAG_JPEGACTABLES 521 /* !AC coefficient offsets */ -#define TIFFTAG_YCBCRCOEFFICIENTS 529 /* !RGB -> YCbCr transform */ -#define TIFFTAG_YCBCRSUBSAMPLING 530 /* !YCbCr subsampling factors */ -#define TIFFTAG_YCBCRPOSITIONING 531 /* !subsample positioning */ -#define YCBCRPOSITION_CENTERED 1 /* !as in PostScript Level 2 */ -#define YCBCRPOSITION_COSITED 2 /* !as in CCIR 601-1 */ -#define TIFFTAG_REFERENCEBLACKWHITE 532 /* !colorimetry info */ -#define TIFFTAG_STRIPROWCOUNTS 559 /* !TIFF/FX strip row counts */ -#define TIFFTAG_XMLPACKET 700 /* %XML packet - [Adobe XMP Specification, - January 2004 */ -#define TIFFTAG_OPIIMAGEID 32781 /* %OPI ImageID - [Adobe TIFF technote] */ -/* tags 32952-32956 are private tags registered to Island Graphics */ -#define TIFFTAG_REFPTS 32953 /* image reference points */ -#define TIFFTAG_REGIONTACKPOINT 32954 /* region-xform tack point */ -#define TIFFTAG_REGIONWARPCORNERS 32955 /* warp quadrilateral */ -#define TIFFTAG_REGIONAFFINE 32956 /* affine transformation mat */ -/* tags 32995-32999 are private tags registered to SGI */ -#define TIFFTAG_MATTEING 32995 /* $use ExtraSamples */ -#define TIFFTAG_DATATYPE 32996 /* $use SampleFormat */ -#define TIFFTAG_IMAGEDEPTH 32997 /* z depth of image */ -#define TIFFTAG_TILEDEPTH 32998 /* z depth/data tile */ -/* tags 33300-33309 are private tags registered to Pixar */ -/* - * TIFFTAG_PIXAR_IMAGEFULLWIDTH and TIFFTAG_PIXAR_IMAGEFULLLENGTH - * are set when an image has been cropped out of a larger image. - * They reflect the size of the original uncropped image. - * The TIFFTAG_XPOSITION and TIFFTAG_YPOSITION can be used - * to determine the position of the smaller image in the larger one. - */ -#define TIFFTAG_PIXAR_IMAGEFULLWIDTH 33300 /* full image size in x */ -#define TIFFTAG_PIXAR_IMAGEFULLLENGTH 33301 /* full image size in y */ - /* Tags 33302-33306 are used to identify special image modes and data - * used by Pixar's texture formats. - */ -#define TIFFTAG_PIXAR_TEXTUREFORMAT 33302 /* texture map format */ -#define TIFFTAG_PIXAR_WRAPMODES 33303 /* s & t wrap modes */ -#define TIFFTAG_PIXAR_FOVCOT 33304 /* cotan(fov) for env. maps */ -#define TIFFTAG_PIXAR_MATRIX_WORLDTOSCREEN 33305 -#define TIFFTAG_PIXAR_MATRIX_WORLDTOCAMERA 33306 -/* tag 33405 is a private tag registered to Eastman Kodak */ -#define TIFFTAG_WRITERSERIALNUMBER 33405 /* device serial number */ -/* tag 33432 is listed in the 6.0 spec w/ unknown ownership */ -#define TIFFTAG_COPYRIGHT 33432 /* copyright string */ -/* IPTC TAG from RichTIFF specifications */ -#define TIFFTAG_RICHTIFFIPTC 33723 -/* 34016-34029 are reserved for ANSI IT8 TIFF/IT <dkelly@apago.com) */ -#define TIFFTAG_IT8SITE 34016 /* site name */ -#define TIFFTAG_IT8COLORSEQUENCE 34017 /* color seq. [RGB,CMYK,etc] */ -#define TIFFTAG_IT8HEADER 34018 /* DDES Header */ -#define TIFFTAG_IT8RASTERPADDING 34019 /* raster scanline padding */ -#define TIFFTAG_IT8BITSPERRUNLENGTH 34020 /* # of bits in short run */ -#define TIFFTAG_IT8BITSPEREXTENDEDRUNLENGTH 34021/* # of bits in long run */ -#define TIFFTAG_IT8COLORTABLE 34022 /* LW colortable */ -#define TIFFTAG_IT8IMAGECOLORINDICATOR 34023 /* BP/BL image color switch */ -#define TIFFTAG_IT8BKGCOLORINDICATOR 34024 /* BP/BL bg color switch */ -#define TIFFTAG_IT8IMAGECOLORVALUE 34025 /* BP/BL image color value */ -#define TIFFTAG_IT8BKGCOLORVALUE 34026 /* BP/BL bg color value */ -#define TIFFTAG_IT8PIXELINTENSITYRANGE 34027 /* MP pixel intensity value */ -#define TIFFTAG_IT8TRANSPARENCYINDICATOR 34028 /* HC transparency switch */ -#define TIFFTAG_IT8COLORCHARACTERIZATION 34029 /* color character. table */ -#define TIFFTAG_IT8HCUSAGE 34030 /* HC usage indicator */ -#define TIFFTAG_IT8TRAPINDICATOR 34031 /* Trapping indicator - (untrapped=0, trapped=1) */ -#define TIFFTAG_IT8CMYKEQUIVALENT 34032 /* CMYK color equivalents */ -/* tags 34232-34236 are private tags registered to Texas Instruments */ -#define TIFFTAG_FRAMECOUNT 34232 /* Sequence Frame Count */ -/* tag 34377 is private tag registered to Adobe for PhotoShop */ -#define TIFFTAG_PHOTOSHOP 34377 -/* tags 34665, 34853 and 40965 are documented in EXIF specification */ -#define TIFFTAG_EXIFIFD 34665 /* Pointer to EXIF private directory */ -/* tag 34750 is a private tag registered to Adobe? */ -#define TIFFTAG_ICCPROFILE 34675 /* ICC profile data */ -#define TIFFTAG_IMAGELAYER 34732 /* !TIFF/FX image layer information */ -/* tag 34750 is a private tag registered to Pixel Magic */ -#define TIFFTAG_JBIGOPTIONS 34750 /* JBIG options */ -#define TIFFTAG_GPSIFD 34853 /* Pointer to GPS private directory */ -/* tags 34908-34914 are private tags registered to SGI */ -#define TIFFTAG_FAXRECVPARAMS 34908 /* encoded Class 2 ses. parms */ -#define TIFFTAG_FAXSUBADDRESS 34909 /* received SubAddr string */ -#define TIFFTAG_FAXRECVTIME 34910 /* receive time (secs) */ -#define TIFFTAG_FAXDCS 34911 /* encoded fax ses. params, Table 2/T.30 */ -/* tags 37439-37443 are registered to SGI <gregl@sgi.com> */ -#define TIFFTAG_STONITS 37439 /* Sample value to Nits */ -/* tag 34929 is a private tag registered to FedEx */ -#define TIFFTAG_FEDEX_EDR 34929 /* unknown use */ -#define TIFFTAG_INTEROPERABILITYIFD 40965 /* Pointer to Interoperability private directory */ -/* Adobe Digital Negative (DNG) format tags */ -#define TIFFTAG_DNGVERSION 50706 /* &DNG version number */ -#define TIFFTAG_DNGBACKWARDVERSION 50707 /* &DNG compatibility version */ -#define TIFFTAG_UNIQUECAMERAMODEL 50708 /* &name for the camera model */ -#define TIFFTAG_LOCALIZEDCAMERAMODEL 50709 /* &localized camera model - name */ -#define TIFFTAG_CFAPLANECOLOR 50710 /* &CFAPattern->LinearRaw space - mapping */ -#define TIFFTAG_CFALAYOUT 50711 /* &spatial layout of the CFA */ -#define TIFFTAG_LINEARIZATIONTABLE 50712 /* &lookup table description */ -#define TIFFTAG_BLACKLEVELREPEATDIM 50713 /* &repeat pattern size for - the BlackLevel tag */ -#define TIFFTAG_BLACKLEVEL 50714 /* &zero light encoding level */ -#define TIFFTAG_BLACKLEVELDELTAH 50715 /* &zero light encoding level - differences (columns) */ -#define TIFFTAG_BLACKLEVELDELTAV 50716 /* &zero light encoding level - differences (rows) */ -#define TIFFTAG_WHITELEVEL 50717 /* &fully saturated encoding - level */ -#define TIFFTAG_DEFAULTSCALE 50718 /* &default scale factors */ -#define TIFFTAG_DEFAULTCROPORIGIN 50719 /* &origin of the final image - area */ -#define TIFFTAG_DEFAULTCROPSIZE 50720 /* &size of the final image - area */ -#define TIFFTAG_COLORMATRIX1 50721 /* &XYZ->reference color space - transformation matrix 1 */ -#define TIFFTAG_COLORMATRIX2 50722 /* &XYZ->reference color space - transformation matrix 2 */ -#define TIFFTAG_CAMERACALIBRATION1 50723 /* &calibration matrix 1 */ -#define TIFFTAG_CAMERACALIBRATION2 50724 /* &calibration matrix 2 */ -#define TIFFTAG_REDUCTIONMATRIX1 50725 /* &dimensionality reduction - matrix 1 */ -#define TIFFTAG_REDUCTIONMATRIX2 50726 /* &dimensionality reduction - matrix 2 */ -#define TIFFTAG_ANALOGBALANCE 50727 /* &gain applied the stored raw - values*/ -#define TIFFTAG_ASSHOTNEUTRAL 50728 /* &selected white balance in - linear reference space */ -#define TIFFTAG_ASSHOTWHITEXY 50729 /* &selected white balance in - x-y chromaticity - coordinates */ -#define TIFFTAG_BASELINEEXPOSURE 50730 /* &how much to move the zero - point */ -#define TIFFTAG_BASELINENOISE 50731 /* &relative noise level */ -#define TIFFTAG_BASELINESHARPNESS 50732 /* &relative amount of - sharpening */ -#define TIFFTAG_BAYERGREENSPLIT 50733 /* &how closely the values of - the green pixels in the - blue/green rows track the - values of the green pixels - in the red/green rows */ -#define TIFFTAG_LINEARRESPONSELIMIT 50734 /* &non-linear encoding range */ -#define TIFFTAG_CAMERASERIALNUMBER 50735 /* &camera's serial number */ -#define TIFFTAG_LENSINFO 50736 /* info about the lens */ -#define TIFFTAG_CHROMABLURRADIUS 50737 /* &chroma blur radius */ -#define TIFFTAG_ANTIALIASSTRENGTH 50738 /* &relative strength of the - camera's anti-alias filter */ -#define TIFFTAG_SHADOWSCALE 50739 /* &used by Adobe Camera Raw */ -#define TIFFTAG_DNGPRIVATEDATA 50740 /* &manufacturer's private data */ -#define TIFFTAG_MAKERNOTESAFETY 50741 /* &whether the EXIF MakerNote - tag is safe to preserve - along with the rest of the - EXIF data */ -#define TIFFTAG_CALIBRATIONILLUMINANT1 50778 /* &illuminant 1 */ -#define TIFFTAG_CALIBRATIONILLUMINANT2 50779 /* &illuminant 2 */ -#define TIFFTAG_BESTQUALITYSCALE 50780 /* &best quality multiplier */ -#define TIFFTAG_RAWDATAUNIQUEID 50781 /* &unique identifier for - the raw image data */ -#define TIFFTAG_ORIGINALRAWFILENAME 50827 /* &file name of the original - raw file */ -#define TIFFTAG_ORIGINALRAWFILEDATA 50828 /* &contents of the original - raw file */ -#define TIFFTAG_ACTIVEAREA 50829 /* &active (non-masked) pixels - of the sensor */ -#define TIFFTAG_MASKEDAREAS 50830 /* &list of coordinates - of fully masked pixels */ -#define TIFFTAG_ASSHOTICCPROFILE 50831 /* &these two tags used to */ -#define TIFFTAG_ASSHOTPREPROFILEMATRIX 50832 /* map cameras's color space - into ICC profile space */ -#define TIFFTAG_CURRENTICCPROFILE 50833 /* & */ -#define TIFFTAG_CURRENTPREPROFILEMATRIX 50834 /* & */ -/* tag 65535 is an undefined tag used by Eastman Kodak */ -#define TIFFTAG_DCSHUESHIFTVALUES 65535 /* hue shift correction data */ - -/* - * The following are ``pseudo tags'' that can be used to control - * codec-specific functionality. These tags are not written to file. - * Note that these values start at 0xffff+1 so that they'll never - * collide with Aldus-assigned tags. - * - * If you want your private pseudo tags ``registered'' (i.e. added to - * this file), please post a bug report via the tracking system at - * http://www.remotesensing.org/libtiff/bugs.html with the appropriate - * C definitions to add. - */ -#define TIFFTAG_FAXMODE 65536 /* Group 3/4 format control */ -#define FAXMODE_CLASSIC 0x0000 /* default, include RTC */ -#define FAXMODE_NORTC 0x0001 /* no RTC at end of data */ -#define FAXMODE_NOEOL 0x0002 /* no EOL code at end of row */ -#define FAXMODE_BYTEALIGN 0x0004 /* byte align row */ -#define FAXMODE_WORDALIGN 0x0008 /* word align row */ -#define FAXMODE_CLASSF FAXMODE_NORTC /* TIFF Class F */ -#define TIFFTAG_JPEGQUALITY 65537 /* Compression quality level */ -/* Note: quality level is on the IJG 0-100 scale. Default value is 75 */ -#define TIFFTAG_JPEGCOLORMODE 65538 /* Auto RGB<=>YCbCr convert? */ -#define JPEGCOLORMODE_RAW 0x0000 /* no conversion (default) */ -#define JPEGCOLORMODE_RGB 0x0001 /* do auto conversion */ -#define TIFFTAG_JPEGTABLESMODE 65539 /* What to put in JPEGTables */ -#define JPEGTABLESMODE_QUANT 0x0001 /* include quantization tbls */ -#define JPEGTABLESMODE_HUFF 0x0002 /* include Huffman tbls */ -/* Note: default is JPEGTABLESMODE_QUANT | JPEGTABLESMODE_HUFF */ -#define TIFFTAG_FAXFILLFUNC 65540 /* G3/G4 fill function */ -#define TIFFTAG_PIXARLOGDATAFMT 65549 /* PixarLogCodec I/O data sz */ -#define PIXARLOGDATAFMT_8BIT 0 /* regular u_char samples */ -#define PIXARLOGDATAFMT_8BITABGR 1 /* ABGR-order u_chars */ -#define PIXARLOGDATAFMT_11BITLOG 2 /* 11-bit log-encoded (raw) */ -#define PIXARLOGDATAFMT_12BITPICIO 3 /* as per PICIO (1.0==2048) */ -#define PIXARLOGDATAFMT_16BIT 4 /* signed short samples */ -#define PIXARLOGDATAFMT_FLOAT 5 /* IEEE float samples */ -/* 65550-65556 are allocated to Oceana Matrix <dev@oceana.com> */ -#define TIFFTAG_DCSIMAGERTYPE 65550 /* imager model & filter */ -#define DCSIMAGERMODEL_M3 0 /* M3 chip (1280 x 1024) */ -#define DCSIMAGERMODEL_M5 1 /* M5 chip (1536 x 1024) */ -#define DCSIMAGERMODEL_M6 2 /* M6 chip (3072 x 2048) */ -#define DCSIMAGERFILTER_IR 0 /* infrared filter */ -#define DCSIMAGERFILTER_MONO 1 /* monochrome filter */ -#define DCSIMAGERFILTER_CFA 2 /* color filter array */ -#define DCSIMAGERFILTER_OTHER 3 /* other filter */ -#define TIFFTAG_DCSINTERPMODE 65551 /* interpolation mode */ -#define DCSINTERPMODE_NORMAL 0x0 /* whole image, default */ -#define DCSINTERPMODE_PREVIEW 0x1 /* preview of image (384x256) */ -#define TIFFTAG_DCSBALANCEARRAY 65552 /* color balance values */ -#define TIFFTAG_DCSCORRECTMATRIX 65553 /* color correction values */ -#define TIFFTAG_DCSGAMMA 65554 /* gamma value */ -#define TIFFTAG_DCSTOESHOULDERPTS 65555 /* toe & shoulder points */ -#define TIFFTAG_DCSCALIBRATIONFD 65556 /* calibration file desc */ -/* Note: quality level is on the ZLIB 1-9 scale. Default value is -1 */ -#define TIFFTAG_ZIPQUALITY 65557 /* compression quality level */ -#define TIFFTAG_PIXARLOGQUALITY 65558 /* PixarLog uses same scale */ -/* 65559 is allocated to Oceana Matrix <dev@oceana.com> */ -#define TIFFTAG_DCSCLIPRECTANGLE 65559 /* area of image to acquire */ -#define TIFFTAG_SGILOGDATAFMT 65560 /* SGILog user data format */ -#define SGILOGDATAFMT_FLOAT 0 /* IEEE float samples */ -#define SGILOGDATAFMT_16BIT 1 /* 16-bit samples */ -#define SGILOGDATAFMT_RAW 2 /* uninterpreted data */ -#define SGILOGDATAFMT_8BIT 3 /* 8-bit RGB monitor values */ -#define TIFFTAG_SGILOGENCODE 65561 /* SGILog data encoding control*/ -#define SGILOGENCODE_NODITHER 0 /* do not dither encoded values*/ -#define SGILOGENCODE_RANDITHER 1 /* randomly dither encd values */ -#define TIFFTAG_LZMAPRESET 65562 /* LZMA2 preset (compression level) */ -#define TIFFTAG_PERSAMPLE 65563 /* interface for per sample tags */ -#define PERSAMPLE_MERGED 0 /* present as a single value */ -#define PERSAMPLE_MULTI 1 /* present as multiple values */ - -/* - * EXIF tags - */ -#define EXIFTAG_EXPOSURETIME 33434 /* Exposure time */ -#define EXIFTAG_FNUMBER 33437 /* F number */ -#define EXIFTAG_EXPOSUREPROGRAM 34850 /* Exposure program */ -#define EXIFTAG_SPECTRALSENSITIVITY 34852 /* Spectral sensitivity */ -#define EXIFTAG_ISOSPEEDRATINGS 34855 /* ISO speed rating */ -#define EXIFTAG_OECF 34856 /* Optoelectric conversion - factor */ -#define EXIFTAG_EXIFVERSION 36864 /* Exif version */ -#define EXIFTAG_DATETIMEORIGINAL 36867 /* Date and time of original - data generation */ -#define EXIFTAG_DATETIMEDIGITIZED 36868 /* Date and time of digital - data generation */ -#define EXIFTAG_COMPONENTSCONFIGURATION 37121 /* Meaning of each component */ -#define EXIFTAG_COMPRESSEDBITSPERPIXEL 37122 /* Image compression mode */ -#define EXIFTAG_SHUTTERSPEEDVALUE 37377 /* Shutter speed */ -#define EXIFTAG_APERTUREVALUE 37378 /* Aperture */ -#define EXIFTAG_BRIGHTNESSVALUE 37379 /* Brightness */ -#define EXIFTAG_EXPOSUREBIASVALUE 37380 /* Exposure bias */ -#define EXIFTAG_MAXAPERTUREVALUE 37381 /* Maximum lens aperture */ -#define EXIFTAG_SUBJECTDISTANCE 37382 /* Subject distance */ -#define EXIFTAG_METERINGMODE 37383 /* Metering mode */ -#define EXIFTAG_LIGHTSOURCE 37384 /* Light source */ -#define EXIFTAG_FLASH 37385 /* Flash */ -#define EXIFTAG_FOCALLENGTH 37386 /* Lens focal length */ -#define EXIFTAG_SUBJECTAREA 37396 /* Subject area */ -#define EXIFTAG_MAKERNOTE 37500 /* Manufacturer notes */ -#define EXIFTAG_USERCOMMENT 37510 /* User comments */ -#define EXIFTAG_SUBSECTIME 37520 /* DateTime subseconds */ -#define EXIFTAG_SUBSECTIMEORIGINAL 37521 /* DateTimeOriginal subseconds */ -#define EXIFTAG_SUBSECTIMEDIGITIZED 37522 /* DateTimeDigitized subseconds */ -#define EXIFTAG_FLASHPIXVERSION 40960 /* Supported Flashpix version */ -#define EXIFTAG_COLORSPACE 40961 /* Color space information */ -#define EXIFTAG_PIXELXDIMENSION 40962 /* Valid image width */ -#define EXIFTAG_PIXELYDIMENSION 40963 /* Valid image height */ -#define EXIFTAG_RELATEDSOUNDFILE 40964 /* Related audio file */ -#define EXIFTAG_FLASHENERGY 41483 /* Flash energy */ -#define EXIFTAG_SPATIALFREQUENCYRESPONSE 41484 /* Spatial frequency response */ -#define EXIFTAG_FOCALPLANEXRESOLUTION 41486 /* Focal plane X resolution */ -#define EXIFTAG_FOCALPLANEYRESOLUTION 41487 /* Focal plane Y resolution */ -#define EXIFTAG_FOCALPLANERESOLUTIONUNIT 41488 /* Focal plane resolution unit */ -#define EXIFTAG_SUBJECTLOCATION 41492 /* Subject location */ -#define EXIFTAG_EXPOSUREINDEX 41493 /* Exposure index */ -#define EXIFTAG_SENSINGMETHOD 41495 /* Sensing method */ -#define EXIFTAG_FILESOURCE 41728 /* File source */ -#define EXIFTAG_SCENETYPE 41729 /* Scene type */ -#define EXIFTAG_CFAPATTERN 41730 /* CFA pattern */ -#define EXIFTAG_CUSTOMRENDERED 41985 /* Custom image processing */ -#define EXIFTAG_EXPOSUREMODE 41986 /* Exposure mode */ -#define EXIFTAG_WHITEBALANCE 41987 /* White balance */ -#define EXIFTAG_DIGITALZOOMRATIO 41988 /* Digital zoom ratio */ -#define EXIFTAG_FOCALLENGTHIN35MMFILM 41989 /* Focal length in 35 mm film */ -#define EXIFTAG_SCENECAPTURETYPE 41990 /* Scene capture type */ -#define EXIFTAG_GAINCONTROL 41991 /* Gain control */ -#define EXIFTAG_CONTRAST 41992 /* Contrast */ -#define EXIFTAG_SATURATION 41993 /* Saturation */ -#define EXIFTAG_SHARPNESS 41994 /* Sharpness */ -#define EXIFTAG_DEVICESETTINGDESCRIPTION 41995 /* Device settings description */ -#define EXIFTAG_SUBJECTDISTANCERANGE 41996 /* Subject distance range */ -#define EXIFTAG_GAINCONTROL 41991 /* Gain control */ -#define EXIFTAG_GAINCONTROL 41991 /* Gain control */ -#define EXIFTAG_IMAGEUNIQUEID 42016 /* Unique image ID */ - -#endif /* _TIFF_ */ - -/* vim: set ts=8 sts=8 sw=8 noet: */ -/* - * Local Variables: - * mode: c - * c-basic-offset: 8 - * fill-column: 78 - * End: - */ diff --git a/cocos2dx/platform/third_party/win32/libtiff/tiffio.h b/cocos2dx/platform/third_party/win32/libtiff/tiffio.h deleted file mode 100644 index 038b67013f..0000000000 --- a/cocos2dx/platform/third_party/win32/libtiff/tiffio.h +++ /dev/null @@ -1,557 +0,0 @@ -/* $Id: tiffio.h,v 1.91 2012-07-29 15:45:29 tgl Exp $ */ - -/* - * Copyright (c) 1988-1997 Sam Leffler - * Copyright (c) 1991-1997 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Sam Leffler and Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#ifndef _TIFFIO_ -#define _TIFFIO_ - -/* - * TIFF I/O Library Definitions. - */ -#include "tiff.h" -#include "tiffvers.h" - -/* - * TIFF is defined as an incomplete type to hide the - * library's internal data structures from clients. - */ -typedef struct tiff TIFF; - -/* - * The following typedefs define the intrinsic size of - * data types used in the *exported* interfaces. These - * definitions depend on the proper definition of types - * in tiff.h. Note also that the varargs interface used - * to pass tag types and values uses the types defined in - * tiff.h directly. - * - * NB: ttag_t is unsigned int and not unsigned short because - * ANSI C requires that the type before the ellipsis be a - * promoted type (i.e. one of int, unsigned int, pointer, - * or double) and because we defined pseudo-tags that are - * outside the range of legal Aldus-assigned tags. - * NB: tsize_t is int32 and not uint32 because some functions - * return -1. - * NB: toff_t is not off_t for many reasons; TIFFs max out at - * 32-bit file offsets, and BigTIFF maxes out at 64-bit - * offsets being the most important, and to ensure use of - * a consistently unsigned type across architectures. - * Prior to libtiff 4.0, this was an unsigned 32 bit type. - */ -/* - * this is the machine addressing size type, only it's signed, so make it - * int32 on 32bit machines, int64 on 64bit machines - */ -typedef TIFF_SSIZE_T tmsize_t; -typedef uint64 toff_t; /* file offset */ -/* the following are deprecated and should be replaced by their defining - counterparts */ -typedef uint32 ttag_t; /* directory tag */ -typedef uint16 tdir_t; /* directory index */ -typedef uint16 tsample_t; /* sample number */ -typedef uint32 tstrile_t; /* strip or tile number */ -typedef tstrile_t tstrip_t; /* strip number */ -typedef tstrile_t ttile_t; /* tile number */ -typedef tmsize_t tsize_t; /* i/o size in bytes */ -typedef void* tdata_t; /* image data ref */ - -#if !defined(__WIN32__) && (defined(_WIN32) || defined(WIN32)) -#define __WIN32__ -#endif - -/* - * On windows you should define USE_WIN32_FILEIO if you are using tif_win32.c - * or AVOID_WIN32_FILEIO if you are using something else (like tif_unix.c). - * - * By default tif_unix.c is assumed. - */ - -#if defined(_WINDOWS) || defined(__WIN32__) || defined(_Windows) -# if !defined(__CYGWIN) && !defined(AVOID_WIN32_FILEIO) && !defined(USE_WIN32_FILEIO) -# define AVOID_WIN32_FILEIO -# endif -#endif - -#if defined(USE_WIN32_FILEIO) -# define VC_EXTRALEAN -# include <windows.h> -# ifdef __WIN32__ -DECLARE_HANDLE(thandle_t); /* Win32 file handle */ -# else -typedef HFILE thandle_t; /* client data handle */ -# endif /* __WIN32__ */ -#else -typedef void* thandle_t; /* client data handle */ -#endif /* USE_WIN32_FILEIO */ - -/* - * Flags to pass to TIFFPrintDirectory to control - * printing of data structures that are potentially - * very large. Bit-or these flags to enable printing - * multiple items. - */ -#define TIFFPRINT_NONE 0x0 /* no extra info */ -#define TIFFPRINT_STRIPS 0x1 /* strips/tiles info */ -#define TIFFPRINT_CURVES 0x2 /* color/gray response curves */ -#define TIFFPRINT_COLORMAP 0x4 /* colormap */ -#define TIFFPRINT_JPEGQTABLES 0x100 /* JPEG Q matrices */ -#define TIFFPRINT_JPEGACTABLES 0x200 /* JPEG AC tables */ -#define TIFFPRINT_JPEGDCTABLES 0x200 /* JPEG DC tables */ - -/* - * Colour conversion stuff - */ - -/* reference white */ -#define D65_X0 (95.0470F) -#define D65_Y0 (100.0F) -#define D65_Z0 (108.8827F) - -#define D50_X0 (96.4250F) -#define D50_Y0 (100.0F) -#define D50_Z0 (82.4680F) - -/* Structure for holding information about a display device. */ - -typedef unsigned char TIFFRGBValue; /* 8-bit samples */ - -typedef struct { - float d_mat[3][3]; /* XYZ -> luminance matrix */ - float d_YCR; /* Light o/p for reference white */ - float d_YCG; - float d_YCB; - uint32 d_Vrwr; /* Pixel values for ref. white */ - uint32 d_Vrwg; - uint32 d_Vrwb; - float d_Y0R; /* Residual light for black pixel */ - float d_Y0G; - float d_Y0B; - float d_gammaR; /* Gamma values for the three guns */ - float d_gammaG; - float d_gammaB; -} TIFFDisplay; - -typedef struct { /* YCbCr->RGB support */ - TIFFRGBValue* clamptab; /* range clamping table */ - int* Cr_r_tab; - int* Cb_b_tab; - int32* Cr_g_tab; - int32* Cb_g_tab; - int32* Y_tab; -} TIFFYCbCrToRGB; - -typedef struct { /* CIE Lab 1976->RGB support */ - int range; /* Size of conversion table */ -#define CIELABTORGB_TABLE_RANGE 1500 - float rstep, gstep, bstep; - float X0, Y0, Z0; /* Reference white point */ - TIFFDisplay display; - float Yr2r[CIELABTORGB_TABLE_RANGE + 1]; /* Conversion of Yr to r */ - float Yg2g[CIELABTORGB_TABLE_RANGE + 1]; /* Conversion of Yg to g */ - float Yb2b[CIELABTORGB_TABLE_RANGE + 1]; /* Conversion of Yb to b */ -} TIFFCIELabToRGB; - -/* - * RGBA-style image support. - */ -typedef struct _TIFFRGBAImage TIFFRGBAImage; -/* - * The image reading and conversion routines invoke - * ``put routines'' to copy/image/whatever tiles of - * raw image data. A default set of routines are - * provided to convert/copy raw image data to 8-bit - * packed ABGR format rasters. Applications can supply - * alternate routines that unpack the data into a - * different format or, for example, unpack the data - * and draw the unpacked raster on the display. - */ -typedef void (*tileContigRoutine) - (TIFFRGBAImage*, uint32*, uint32, uint32, uint32, uint32, int32, int32, - unsigned char*); -typedef void (*tileSeparateRoutine) - (TIFFRGBAImage*, uint32*, uint32, uint32, uint32, uint32, int32, int32, - unsigned char*, unsigned char*, unsigned char*, unsigned char*); -/* - * RGBA-reader state. - */ -struct _TIFFRGBAImage { - TIFF* tif; /* image handle */ - int stoponerr; /* stop on read error */ - int isContig; /* data is packed/separate */ - int alpha; /* type of alpha data present */ - uint32 width; /* image width */ - uint32 height; /* image height */ - uint16 bitspersample; /* image bits/sample */ - uint16 samplesperpixel; /* image samples/pixel */ - uint16 orientation; /* image orientation */ - uint16 req_orientation; /* requested orientation */ - uint16 photometric; /* image photometric interp */ - uint16* redcmap; /* colormap pallete */ - uint16* greencmap; - uint16* bluecmap; - /* get image data routine */ - int (*get)(TIFFRGBAImage*, uint32*, uint32, uint32); - /* put decoded strip/tile */ - union { - void (*any)(TIFFRGBAImage*); - tileContigRoutine contig; - tileSeparateRoutine separate; - } put; - TIFFRGBValue* Map; /* sample mapping array */ - uint32** BWmap; /* black&white map */ - uint32** PALmap; /* palette image map */ - TIFFYCbCrToRGB* ycbcr; /* YCbCr conversion state */ - TIFFCIELabToRGB* cielab; /* CIE L*a*b conversion state */ - - uint8* UaToAa; /* Unassociated alpha to associated alpha convertion LUT */ - uint8* Bitdepth16To8; /* LUT for conversion from 16bit to 8bit values */ - - int row_offset; - int col_offset; -}; - -/* - * Macros for extracting components from the - * packed ABGR form returned by TIFFReadRGBAImage. - */ -#define TIFFGetR(abgr) ((abgr) & 0xff) -#define TIFFGetG(abgr) (((abgr) >> 8) & 0xff) -#define TIFFGetB(abgr) (((abgr) >> 16) & 0xff) -#define TIFFGetA(abgr) (((abgr) >> 24) & 0xff) - -/* - * A CODEC is a software package that implements decoding, - * encoding, or decoding+encoding of a compression algorithm. - * The library provides a collection of builtin codecs. - * More codecs may be registered through calls to the library - * and/or the builtin implementations may be overridden. - */ -typedef int (*TIFFInitMethod)(TIFF*, int); -typedef struct { - char* name; - uint16 scheme; - TIFFInitMethod init; -} TIFFCodec; - -#include <stdio.h> -#include <stdarg.h> - -/* share internal LogLuv conversion routines? */ -#ifndef LOGLUV_PUBLIC -#define LOGLUV_PUBLIC 1 -#endif - -#if !defined(__GNUC__) && !defined(__attribute__) -# define __attribute__(x) /*nothing*/ -#endif - -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif -typedef void (*TIFFErrorHandler)(const char*, const char*, va_list); -typedef void (*TIFFErrorHandlerExt)(thandle_t, const char*, const char*, va_list); -typedef tmsize_t (*TIFFReadWriteProc)(thandle_t, void*, tmsize_t); -typedef toff_t (*TIFFSeekProc)(thandle_t, toff_t, int); -typedef int (*TIFFCloseProc)(thandle_t); -typedef toff_t (*TIFFSizeProc)(thandle_t); -typedef int (*TIFFMapFileProc)(thandle_t, void** base, toff_t* size); -typedef void (*TIFFUnmapFileProc)(thandle_t, void* base, toff_t size); -typedef void (*TIFFExtendProc)(TIFF*); - -extern const char* TIFFGetVersion(void); - -extern const TIFFCodec* TIFFFindCODEC(uint16); -extern TIFFCodec* TIFFRegisterCODEC(uint16, const char*, TIFFInitMethod); -extern void TIFFUnRegisterCODEC(TIFFCodec*); -extern int TIFFIsCODECConfigured(uint16); -extern TIFFCodec* TIFFGetConfiguredCODECs(void); - -/* - * Auxiliary functions. - */ - -extern void* _TIFFmalloc(tmsize_t s); -extern void* _TIFFrealloc(void* p, tmsize_t s); -extern void _TIFFmemset(void* p, int v, tmsize_t c); -extern void _TIFFmemcpy(void* d, const void* s, tmsize_t c); -extern int _TIFFmemcmp(const void* p1, const void* p2, tmsize_t c); -extern void _TIFFfree(void* p); - -/* -** Stuff, related to tag handling and creating custom tags. -*/ -extern int TIFFGetTagListCount( TIFF * ); -extern uint32 TIFFGetTagListEntry( TIFF *, int tag_index ); - -#define TIFF_ANY TIFF_NOTYPE /* for field descriptor searching */ -#define TIFF_VARIABLE -1 /* marker for variable length tags */ -#define TIFF_SPP -2 /* marker for SamplesPerPixel tags */ -#define TIFF_VARIABLE2 -3 /* marker for uint32 var-length tags */ - -#define FIELD_CUSTOM 65 - -typedef struct _TIFFField TIFFField; -typedef struct _TIFFFieldArray TIFFFieldArray; - -extern const TIFFField* TIFFFindField(TIFF *, uint32, TIFFDataType); -extern const TIFFField* TIFFFieldWithTag(TIFF*, uint32); -extern const TIFFField* TIFFFieldWithName(TIFF*, const char *); - -extern uint32 TIFFFieldTag(const TIFFField*); -extern const char* TIFFFieldName(const TIFFField*); -extern TIFFDataType TIFFFieldDataType(const TIFFField*); -extern int TIFFFieldPassCount(const TIFFField*); -extern int TIFFFieldReadCount(const TIFFField*); -extern int TIFFFieldWriteCount(const TIFFField*); - -typedef int (*TIFFVSetMethod)(TIFF*, uint32, va_list); -typedef int (*TIFFVGetMethod)(TIFF*, uint32, va_list); -typedef void (*TIFFPrintMethod)(TIFF*, FILE*, long); - -typedef struct { - TIFFVSetMethod vsetfield; /* tag set routine */ - TIFFVGetMethod vgetfield; /* tag get routine */ - TIFFPrintMethod printdir; /* directory print routine */ -} TIFFTagMethods; - -extern TIFFTagMethods *TIFFAccessTagMethods(TIFF *); -extern void *TIFFGetClientInfo(TIFF *, const char *); -extern void TIFFSetClientInfo(TIFF *, void *, const char *); - -extern void TIFFCleanup(TIFF* tif); -extern void TIFFClose(TIFF* tif); -extern int TIFFFlush(TIFF* tif); -extern int TIFFFlushData(TIFF* tif); -extern int TIFFGetField(TIFF* tif, uint32 tag, ...); -extern int TIFFVGetField(TIFF* tif, uint32 tag, va_list ap); -extern int TIFFGetFieldDefaulted(TIFF* tif, uint32 tag, ...); -extern int TIFFVGetFieldDefaulted(TIFF* tif, uint32 tag, va_list ap); -extern int TIFFReadDirectory(TIFF* tif); -extern int TIFFReadCustomDirectory(TIFF* tif, toff_t diroff, const TIFFFieldArray* infoarray); -extern int TIFFReadEXIFDirectory(TIFF* tif, toff_t diroff); -extern uint64 TIFFScanlineSize64(TIFF* tif); -extern tmsize_t TIFFScanlineSize(TIFF* tif); -extern uint64 TIFFRasterScanlineSize64(TIFF* tif); -extern tmsize_t TIFFRasterScanlineSize(TIFF* tif); -extern uint64 TIFFStripSize64(TIFF* tif); -extern tmsize_t TIFFStripSize(TIFF* tif); -extern uint64 TIFFRawStripSize64(TIFF* tif, uint32 strip); -extern tmsize_t TIFFRawStripSize(TIFF* tif, uint32 strip); -extern uint64 TIFFVStripSize64(TIFF* tif, uint32 nrows); -extern tmsize_t TIFFVStripSize(TIFF* tif, uint32 nrows); -extern uint64 TIFFTileRowSize64(TIFF* tif); -extern tmsize_t TIFFTileRowSize(TIFF* tif); -extern uint64 TIFFTileSize64(TIFF* tif); -extern tmsize_t TIFFTileSize(TIFF* tif); -extern uint64 TIFFVTileSize64(TIFF* tif, uint32 nrows); -extern tmsize_t TIFFVTileSize(TIFF* tif, uint32 nrows); -extern uint32 TIFFDefaultStripSize(TIFF* tif, uint32 request); -extern void TIFFDefaultTileSize(TIFF*, uint32*, uint32*); -extern int TIFFFileno(TIFF*); -extern int TIFFSetFileno(TIFF*, int); -extern thandle_t TIFFClientdata(TIFF*); -extern thandle_t TIFFSetClientdata(TIFF*, thandle_t); -extern int TIFFGetMode(TIFF*); -extern int TIFFSetMode(TIFF*, int); -extern int TIFFIsTiled(TIFF*); -extern int TIFFIsByteSwapped(TIFF*); -extern int TIFFIsUpSampled(TIFF*); -extern int TIFFIsMSB2LSB(TIFF*); -extern int TIFFIsBigEndian(TIFF*); -extern TIFFReadWriteProc TIFFGetReadProc(TIFF*); -extern TIFFReadWriteProc TIFFGetWriteProc(TIFF*); -extern TIFFSeekProc TIFFGetSeekProc(TIFF*); -extern TIFFCloseProc TIFFGetCloseProc(TIFF*); -extern TIFFSizeProc TIFFGetSizeProc(TIFF*); -extern TIFFMapFileProc TIFFGetMapFileProc(TIFF*); -extern TIFFUnmapFileProc TIFFGetUnmapFileProc(TIFF*); -extern uint32 TIFFCurrentRow(TIFF*); -extern uint16 TIFFCurrentDirectory(TIFF*); -extern uint16 TIFFNumberOfDirectories(TIFF*); -extern uint64 TIFFCurrentDirOffset(TIFF*); -extern uint32 TIFFCurrentStrip(TIFF*); -extern uint32 TIFFCurrentTile(TIFF* tif); -extern int TIFFReadBufferSetup(TIFF* tif, void* bp, tmsize_t size); -extern int TIFFWriteBufferSetup(TIFF* tif, void* bp, tmsize_t size); -extern int TIFFSetupStrips(TIFF *); -extern int TIFFWriteCheck(TIFF*, int, const char *); -extern void TIFFFreeDirectory(TIFF*); -extern int TIFFCreateDirectory(TIFF*); -extern int TIFFCreateCustomDirectory(TIFF*,const TIFFFieldArray*); -extern int TIFFCreateEXIFDirectory(TIFF*); -extern int TIFFLastDirectory(TIFF*); -extern int TIFFSetDirectory(TIFF*, uint16); -extern int TIFFSetSubDirectory(TIFF*, uint64); -extern int TIFFUnlinkDirectory(TIFF*, uint16); -extern int TIFFSetField(TIFF*, uint32, ...); -extern int TIFFVSetField(TIFF*, uint32, va_list); -extern int TIFFUnsetField(TIFF*, uint32); -extern int TIFFWriteDirectory(TIFF *); -extern int TIFFWriteCustomDirectory(TIFF *, uint64 *); -extern int TIFFCheckpointDirectory(TIFF *); -extern int TIFFRewriteDirectory(TIFF *); - -#if defined(c_plusplus) || defined(__cplusplus) -extern void TIFFPrintDirectory(TIFF*, FILE*, long = 0); -extern int TIFFReadScanline(TIFF* tif, void* buf, uint32 row, uint16 sample = 0); -extern int TIFFWriteScanline(TIFF* tif, void* buf, uint32 row, uint16 sample = 0); -extern int TIFFReadRGBAImage(TIFF*, uint32, uint32, uint32*, int = 0); -extern int TIFFReadRGBAImageOriented(TIFF*, uint32, uint32, uint32*, - int = ORIENTATION_BOTLEFT, int = 0); -#else -extern void TIFFPrintDirectory(TIFF*, FILE*, long); -extern int TIFFReadScanline(TIFF* tif, void* buf, uint32 row, uint16 sample); -extern int TIFFWriteScanline(TIFF* tif, void* buf, uint32 row, uint16 sample); -extern int TIFFReadRGBAImage(TIFF*, uint32, uint32, uint32*, int); -extern int TIFFReadRGBAImageOriented(TIFF*, uint32, uint32, uint32*, int, int); -#endif - -extern int TIFFReadRGBAStrip(TIFF*, uint32, uint32 * ); -extern int TIFFReadRGBATile(TIFF*, uint32, uint32, uint32 * ); -extern int TIFFRGBAImageOK(TIFF*, char [1024]); -extern int TIFFRGBAImageBegin(TIFFRGBAImage*, TIFF*, int, char [1024]); -extern int TIFFRGBAImageGet(TIFFRGBAImage*, uint32*, uint32, uint32); -extern void TIFFRGBAImageEnd(TIFFRGBAImage*); -extern TIFF* TIFFOpen(const char*, const char*); -# ifdef __WIN32__ -extern TIFF* TIFFOpenW(const wchar_t*, const char*); -# endif /* __WIN32__ */ -extern TIFF* TIFFFdOpen(int, const char*, const char*); -extern TIFF* TIFFClientOpen(const char*, const char*, - thandle_t, - TIFFReadWriteProc, TIFFReadWriteProc, - TIFFSeekProc, TIFFCloseProc, - TIFFSizeProc, - TIFFMapFileProc, TIFFUnmapFileProc); -extern const char* TIFFFileName(TIFF*); -extern const char* TIFFSetFileName(TIFF*, const char *); -extern void TIFFError(const char*, const char*, ...) __attribute__((__format__ (__printf__,2,3))); -extern void TIFFErrorExt(thandle_t, const char*, const char*, ...) __attribute__((__format__ (__printf__,3,4))); -extern void TIFFWarning(const char*, const char*, ...) __attribute__((__format__ (__printf__,2,3))); -extern void TIFFWarningExt(thandle_t, const char*, const char*, ...) __attribute__((__format__ (__printf__,3,4))); -extern TIFFErrorHandler TIFFSetErrorHandler(TIFFErrorHandler); -extern TIFFErrorHandlerExt TIFFSetErrorHandlerExt(TIFFErrorHandlerExt); -extern TIFFErrorHandler TIFFSetWarningHandler(TIFFErrorHandler); -extern TIFFErrorHandlerExt TIFFSetWarningHandlerExt(TIFFErrorHandlerExt); -extern TIFFExtendProc TIFFSetTagExtender(TIFFExtendProc); -extern uint32 TIFFComputeTile(TIFF* tif, uint32 x, uint32 y, uint32 z, uint16 s); -extern int TIFFCheckTile(TIFF* tif, uint32 x, uint32 y, uint32 z, uint16 s); -extern uint32 TIFFNumberOfTiles(TIFF*); -extern tmsize_t TIFFReadTile(TIFF* tif, void* buf, uint32 x, uint32 y, uint32 z, uint16 s); -extern tmsize_t TIFFWriteTile(TIFF* tif, void* buf, uint32 x, uint32 y, uint32 z, uint16 s); -extern uint32 TIFFComputeStrip(TIFF*, uint32, uint16); -extern uint32 TIFFNumberOfStrips(TIFF*); -extern tmsize_t TIFFReadEncodedStrip(TIFF* tif, uint32 strip, void* buf, tmsize_t size); -extern tmsize_t TIFFReadRawStrip(TIFF* tif, uint32 strip, void* buf, tmsize_t size); -extern tmsize_t TIFFReadEncodedTile(TIFF* tif, uint32 tile, void* buf, tmsize_t size); -extern tmsize_t TIFFReadRawTile(TIFF* tif, uint32 tile, void* buf, tmsize_t size); -extern tmsize_t TIFFWriteEncodedStrip(TIFF* tif, uint32 strip, void* data, tmsize_t cc); -extern tmsize_t TIFFWriteRawStrip(TIFF* tif, uint32 strip, void* data, tmsize_t cc); -extern tmsize_t TIFFWriteEncodedTile(TIFF* tif, uint32 tile, void* data, tmsize_t cc); -extern tmsize_t TIFFWriteRawTile(TIFF* tif, uint32 tile, void* data, tmsize_t cc); -extern int TIFFDataWidth(TIFFDataType); /* table of tag datatype widths */ -extern void TIFFSetWriteOffset(TIFF* tif, toff_t off); -extern void TIFFSwabShort(uint16*); -extern void TIFFSwabLong(uint32*); -extern void TIFFSwabLong8(uint64*); -extern void TIFFSwabFloat(float*); -extern void TIFFSwabDouble(double*); -extern void TIFFSwabArrayOfShort(uint16* wp, tmsize_t n); -extern void TIFFSwabArrayOfTriples(uint8* tp, tmsize_t n); -extern void TIFFSwabArrayOfLong(uint32* lp, tmsize_t n); -extern void TIFFSwabArrayOfLong8(uint64* lp, tmsize_t n); -extern void TIFFSwabArrayOfFloat(float* fp, tmsize_t n); -extern void TIFFSwabArrayOfDouble(double* dp, tmsize_t n); -extern void TIFFReverseBits(uint8* cp, tmsize_t n); -extern const unsigned char* TIFFGetBitRevTable(int); - -#ifdef LOGLUV_PUBLIC -#define U_NEU 0.210526316 -#define V_NEU 0.473684211 -#define UVSCALE 410. -extern double LogL16toY(int); -extern double LogL10toY(int); -extern void XYZtoRGB24(float*, uint8*); -extern int uv_decode(double*, double*, int); -extern void LogLuv24toXYZ(uint32, float*); -extern void LogLuv32toXYZ(uint32, float*); -#if defined(c_plusplus) || defined(__cplusplus) -extern int LogL16fromY(double, int = SGILOGENCODE_NODITHER); -extern int LogL10fromY(double, int = SGILOGENCODE_NODITHER); -extern int uv_encode(double, double, int = SGILOGENCODE_NODITHER); -extern uint32 LogLuv24fromXYZ(float*, int = SGILOGENCODE_NODITHER); -extern uint32 LogLuv32fromXYZ(float*, int = SGILOGENCODE_NODITHER); -#else -extern int LogL16fromY(double, int); -extern int LogL10fromY(double, int); -extern int uv_encode(double, double, int); -extern uint32 LogLuv24fromXYZ(float*, int); -extern uint32 LogLuv32fromXYZ(float*, int); -#endif -#endif /* LOGLUV_PUBLIC */ - -extern int TIFFCIELabToRGBInit(TIFFCIELabToRGB*, const TIFFDisplay *, float*); -extern void TIFFCIELabToXYZ(TIFFCIELabToRGB *, uint32, int32, int32, - float *, float *, float *); -extern void TIFFXYZToRGB(TIFFCIELabToRGB *, float, float, float, - uint32 *, uint32 *, uint32 *); - -extern int TIFFYCbCrToRGBInit(TIFFYCbCrToRGB*, float*, float*); -extern void TIFFYCbCrtoRGB(TIFFYCbCrToRGB *, uint32, int32, int32, - uint32 *, uint32 *, uint32 *); - -/**************************************************************************** - * O B S O L E T E D I N T E R F A C E S - * - * Don't use this stuff in your applications, it may be removed in the future - * libtiff versions. - ****************************************************************************/ -typedef struct { - ttag_t field_tag; /* field's tag */ - short field_readcount; /* read count/TIFF_VARIABLE/TIFF_SPP */ - short field_writecount; /* write count/TIFF_VARIABLE */ - TIFFDataType field_type; /* type of associated data */ - unsigned short field_bit; /* bit in fieldsset bit vector */ - unsigned char field_oktochange; /* if true, can change while writing */ - unsigned char field_passcount; /* if true, pass dir count on set */ - char *field_name; /* ASCII name */ -} TIFFFieldInfo; - -extern int TIFFMergeFieldInfo(TIFF*, const TIFFFieldInfo[], uint32); - -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif - -#endif /* _TIFFIO_ */ - -/* vim: set ts=8 sts=8 sw=8 noet: */ -/* - * Local Variables: - * mode: c - * c-basic-offset: 8 - * fill-column: 78 - * End: - */ diff --git a/cocos2dx/platform/third_party/win32/libtiff/tiffvers.h b/cocos2dx/platform/third_party/win32/libtiff/tiffvers.h deleted file mode 100644 index 40edc813d5..0000000000 --- a/cocos2dx/platform/third_party/win32/libtiff/tiffvers.h +++ /dev/null @@ -1,9 +0,0 @@ -#define TIFFLIB_VERSION_STR "LIBTIFF, Version 4.0.3\nCopyright (c) 1988-1996 Sam Leffler\nCopyright (c) 1991-1996 Silicon Graphics, Inc." -/* - * This define can be used in code that requires - * compilation-related definitions specific to a - * version or versions of the library. Runtime - * version checking should be done based on the - * string returned by TIFFGetVersion. - */ -#define TIFFLIB_VERSION 20120922 diff --git a/cocos2dx/platform/third_party/win32/libwebp/types.h b/cocos2dx/platform/third_party/win32/libwebp/types.h deleted file mode 100644 index 3e27190bef..0000000000 --- a/cocos2dx/platform/third_party/win32/libwebp/types.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2010 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Common types -// -// Author: Skal (pascal.massimino@gmail.com) - -#ifndef WEBP_WEBP_TYPES_H_ -#define WEBP_WEBP_TYPES_H_ - -#include <stddef.h> // for size_t - -#ifndef _MSC_VER -#include <inttypes.h> -#ifdef __STRICT_ANSI__ -#define WEBP_INLINE -#else /* __STRICT_ANSI__ */ -#define WEBP_INLINE inline -#endif -#else -typedef signed char int8_t; -typedef unsigned char uint8_t; -typedef signed short int16_t; -typedef unsigned short uint16_t; -typedef signed int int32_t; -typedef unsigned int uint32_t; -typedef unsigned long long int uint64_t; -typedef long long int int64_t; -#define WEBP_INLINE __forceinline -#endif /* _MSC_VER */ - -#ifndef WEBP_EXTERN -// This explicitly marks library functions and allows for changing the -// signature for e.g., Windows DLL builds. -#define WEBP_EXTERN(type) extern type -#endif /* WEBP_EXTERN */ - -// Macro to check ABI compatibility (same major revision number) -#define WEBP_ABI_IS_INCOMPATIBLE(a, b) (((a) >> 8) != ((b) >> 8)) - -#endif /* WEBP_WEBP_TYPES_H_ */ diff --git a/cocos2dx/platform/third_party/win32/third_party_versions.txt b/cocos2dx/platform/third_party/win32/third_party_versions.txt deleted file mode 100644 index 725b9483fb..0000000000 --- a/cocos2dx/platform/third_party/win32/third_party_versions.txt +++ /dev/null @@ -1,7 +0,0 @@ -iconv 1.9.2 -libjpeg 8b -libpng 1.4.5beta04 -libxml2 2.7.7 -OGLES 2.08.28.0634 -zlib 1.2.5 -pthread 2.8.0 diff --git a/cocos2dx/platform/tizen/CCAccelerometer.cpp b/cocos2dx/platform/tizen/CCAccelerometer.cpp deleted file mode 100644 index a09466fa0e..0000000000 --- a/cocos2dx/platform/tizen/CCAccelerometer.cpp +++ /dev/null @@ -1,116 +0,0 @@ -/**************************************************************************** -Copyright (c) 2013 cocos2d-x.org -Copyright (c) 2013 Lee, Jae-Hong - -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 "CCStdC.h" -#include "CCAccelerometer.h" - -using namespace Tizen::Uix::Sensor; - -NS_CC_BEGIN - -Accelerometer::Accelerometer() - : _function(nullptr) - , __sensorMgr(nullptr) -{ -} - -Accelerometer::~Accelerometer() -{ - -} - -void Accelerometer::setDelegate(std::function<void(Acceleration*)> function) -{ - _function = function; - - if (_function) - { - startSensor(); - } - else - { - stopSensor(); - } -} - -void Accelerometer::setAccelerometerInterval(float interval) -{ - if (__sensorMgr) - { - __sensorMgr->SetInterval(SENSOR_TYPE_ACCELERATION, interval * 1000); - } -} - -void Accelerometer::startSensor() -{ - long interval = 0L; - - if (__sensorMgr) - { - __sensorMgr->RemoveSensorListener(*this); - delete __sensorMgr; - __sensorMgr = null; - } - - __sensorMgr = new SensorManager(); - __sensorMgr->Construct(); - __sensorMgr->GetMinInterval(SENSOR_TYPE_ACCELERATION, interval); - - if (interval < 50) - { - interval = 50; - } - __sensorMgr->AddSensorListener(*this, SENSOR_TYPE_ACCELERATION, interval, true); - -} - -void Accelerometer::stopSensor() -{ - if (__sensorMgr) - { - __sensorMgr->RemoveSensorListener(*this); - delete __sensorMgr; - __sensorMgr = null; - } -} - -void Accelerometer::OnDataReceived(SensorType sensorType, SensorData& sensorData , result r) -{ - if (_function) - { - AccelerationSensorData& data = static_cast<AccelerationSensorData&>(sensorData); - AppLog("AccelerationSensorData x = %5.4f , y = %5.4f, z = %5.4f ", data.x,data.y,data.z); - - _accelerationValue.x = data.y; - _accelerationValue.y = -data.x; - _accelerationValue.z = -data.z; - _accelerationValue.timestamp = data.timestamp; - - _function(&_accelerationValue); - } -} - -NS_CC_END - diff --git a/cocos2dx/platform/tizen/CCAccelerometer.h b/cocos2dx/platform/tizen/CCAccelerometer.h deleted file mode 100644 index d4e5083801..0000000000 --- a/cocos2dx/platform/tizen/CCAccelerometer.h +++ /dev/null @@ -1,64 +0,0 @@ -/**************************************************************************** -Copyright (c) 2013 cocos2d-x.org -Copyright (c) 2013 Lee, Jae-Hong - -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_TIZEN_CCACCELEROMETER_H__ -#define __PLATFORM_TIZEN_CCACCELEROMETER_H__ - -#include "platform/CCCommon.h" -#include "platform/CCAccelerometerDelegate.h" -#include <FUix.h> -#include <functional> - -NS_CC_BEGIN - -class CC_DLL Accelerometer : public Tizen::Uix::Sensor::ISensorEventListener -{ -public: - /** - * @js ctor - */ - Accelerometer(); - /** - * @js NA - * @lua NA - */ - ~Accelerometer(); - - void setDelegate(std::function<void(Acceleration*)> function); - void setAccelerometerInterval(float interval); - void startSensor(); - void stopSensor(); - - virtual void OnDataReceived(Tizen::Uix::Sensor::SensorType sensorType, Tizen::Uix::Sensor::SensorData& sensorData , result r); - -private: - std::function<void(Acceleration*)> _function; - Acceleration _accelerationValue; - Tizen::Uix::Sensor::SensorManager* __sensorMgr; -}; - -NS_CC_END - -#endif diff --git a/cocos2dx/platform/tizen/CCApplication.cpp b/cocos2dx/platform/tizen/CCApplication.cpp deleted file mode 100644 index d8d535d374..0000000000 --- a/cocos2dx/platform/tizen/CCApplication.cpp +++ /dev/null @@ -1,164 +0,0 @@ -/**************************************************************************** -Copyright (c) 2013 cocos2d-x.org -Copyright (c) 2013 Lee, Jae-Hong - -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 "CCApplication.h" -#include "CCDirector.h" -#include "CCEGLView.h" -#include <FSystem.h> - -NS_CC_BEGIN -using namespace Tizen::Base; -using namespace Tizen::System; - -// sharedApplication pointer -Application * Application::sm_pSharedApplication = 0; -long Application::_animationInterval = 1000; - -Application::Application() -{ - CCAssert(! sm_pSharedApplication, ""); - sm_pSharedApplication = this; -} - -Application::~Application() -{ - CCAssert(this == sm_pSharedApplication, ""); - sm_pSharedApplication = NULL; -} - -int Application::run() -{ - // Initialize instance and cocos2d. - if (!applicationDidFinishLaunching()) - { - return false; - } - - return -1; -} - -void Application::setAnimationInterval(double interval) -{ - _animationInterval = interval * 1000.0f; -} - -long Application::getAnimationInterval() -{ - return _animationInterval; -} - -////////////////////////////////////////////////////////////////////////// -// static member function -////////////////////////////////////////////////////////////////////////// -Application* Application::getInstance() -{ - CCAssert(sm_pSharedApplication, ""); - return sm_pSharedApplication; -} - -// @deprecated Use getInstance() instead -Application* Application::sharedApplication() -{ - return Application::getInstance(); -} - -LanguageType Application::getCurrentLanguage() -{ - result r = E_SUCCESS; - int index = 0; - Tizen::Base::String localelanguageCode, languageCode; - LanguageType ret = LanguageType::ENGLISH; - - r = SettingInfo::GetValue(L"http://tizen.org/setting/locale.language", localelanguageCode); - TryLog(!IsFailed(r), "[%s] Cannot get the current language setting", GetErrorMessage(r)); - localelanguageCode.IndexOf("_", 0, index); - localelanguageCode.SubString(0, index, languageCode); - - if (0 == languageCode.CompareTo(L"zho")) - { - ret = LanguageType::CHINESE; - } - else if (0 == languageCode.CompareTo(L"eng")) - { - ret = LanguageType::ENGLISH; - } - else if (0 == languageCode.CompareTo(L"fre")) - { - ret = LanguageType::FRENCH; - } - else if (0 == languageCode.CompareTo(L"ita")) - { - ret = LanguageType::ITALIAN; - } - else if (0 == languageCode.CompareTo(L"deu")) - { - ret = LanguageType::GERMAN; - } - else if (0 == languageCode.CompareTo(L"spa")) - { - ret = LanguageType::SPANISH; - } - else if (0 == languageCode.CompareTo(L"rus")) - { - ret = LanguageType::RUSSIAN; - } - else if (0 == languageCode.CompareTo(L"kor")) - { - ret = LanguageType::KOREAN; - } - else if (0 == languageCode.CompareTo(L"jpn")) - { - ret = LanguageType::JAPANESE; - } - else if (0 == languageCode.CompareTo(L"hun")) - { - ret = LanguageType::HUNGARIAN; - } - else if (0 == languageCode.CompareTo(L"por")) - { - ret = LanguageType::PORTUGUESE; - } - else if (0 == languageCode.CompareTo(L"ara")) - { - ret = LanguageType::ARABIC; - } - else if (0 == languageCode.CompareTo(L"nor")) - { - ret = LanguageType::NORWEGIAN; - } - else if (0 == languageCode.CompareTo(L"pol")) - { - ret = LanguageType::POLISH; - } - return ret; -} - -Application::Platform Application::getTargetPlatform() -{ - return Platform::OS_TIZEN; -} - -NS_CC_END - diff --git a/cocos2dx/platform/tizen/CCApplication.h b/cocos2dx/platform/tizen/CCApplication.h deleted file mode 100644 index 5c4c3ff4f7..0000000000 --- a/cocos2dx/platform/tizen/CCApplication.h +++ /dev/null @@ -1,90 +0,0 @@ -/**************************************************************************** -Copyright (c) 2013 cocos2d-x.org -Copyright (c) 2013 Lee, Jae-Hong - -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 __CC_APPLICATION_TIZEN_H__ -#define __CC_APPLICATION_TIZEN_H__ - -#include "platform/CCCommon.h" -#include "platform/CCApplicationProtocol.h" -#include "CCOspApplication.h" - -NS_CC_BEGIN - -class Rect; - -class CC_DLL Application - : public ApplicationProtocol -{ -public: - /** - * @js ctor - */ - Application(); - /** - * @js NA - * @lua NA - */ - virtual ~Application(); - - /** - @brief Callback by Director to limit FPS. - @param interval The time, expressed in seconds, between current frame and next. - */ - void setAnimationInterval(double interval); - long getAnimationInterval(); - - /** - @brief Run the message loop. - */ - int run(); - - /** - @brief Get current application instance. - @return Current application instance pointer. - */ - static Application* getInstance(); - - /** @deprecated Use getInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static Application* sharedApplication(); - - /** - @brief Get current language config - @return Current language config - */ - virtual LanguageType getCurrentLanguage(); - - /** - @brief Get target platform - */ - virtual Platform getTargetPlatform(); - -protected: - static Application * sm_pSharedApplication; - static long _animationInterval; // milliseconds -}; - -NS_CC_END - -#endif // __CC_APPLICATION_TIZEN_H__ diff --git a/cocos2dx/platform/tizen/CCCommon.cpp b/cocos2dx/platform/tizen/CCCommon.cpp deleted file mode 100644 index 26f764de6e..0000000000 --- a/cocos2dx/platform/tizen/CCCommon.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/**************************************************************************** -Copyright (c) 2013 cocos2d-x.org -Copyright (c) 2013 Lee, Jae-Hong - -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 "platform/CCCommon.h" -#include "CCStdC.h" -#include <FBaseLog.h> - -NS_CC_BEGIN - -#define MAX_LEN (cocos2d::kMaxLogLen + 1) - -// XXX deprecated -void CCLog(const char * pszFormat, ...) -{ - char szBuf[MAX_LEN]; - - va_list ap; - va_start(ap, pszFormat); - vsnprintf(szBuf, MAX_LEN, pszFormat, ap); - va_end(ap); - - // Strip any trailing newlines from log message. - size_t len = strlen(szBuf); - while (len && szBuf[len-1] == '\n') - { - szBuf[len-1] = '\0'; - len--; - } - - AppLog("cocos2d-x debug info [%s]\n", szBuf); -} - -void log(const char * pszFormat, ...) -{ - char szBuf[MAX_LEN]; - - va_list ap; - va_start(ap, pszFormat); - vsnprintf(szBuf, MAX_LEN, pszFormat, ap); - va_end(ap); - - // Strip any trailing newlines from log message. - size_t len = strlen(szBuf); - while (len && szBuf[len-1] == '\n') - { - szBuf[len-1] = '\0'; - len--; - } - - AppLog("cocos2d-x debug info [%s]\n", szBuf); -} - -void MessageBox(const char * pszMsg, const char * pszTitle) -{ - log("%s: %s", pszTitle, pszMsg); -} - -void LuaLog(const char * pszFormat) -{ - puts(pszFormat); -} - -NS_CC_END diff --git a/cocos2dx/platform/tizen/CCDevice.cpp b/cocos2dx/platform/tizen/CCDevice.cpp deleted file mode 100644 index 530fd5c5b5..0000000000 --- a/cocos2dx/platform/tizen/CCDevice.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** -Copyright (c) 2013 cocos2d-x.org -Copyright (c) 2013 Lee, Jae-Hong - -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 "platform/CCDevice.h" -#include <FSystem.h> - -NS_CC_BEGIN -using namespace Tizen::System; - -int Device::getDPI() -{ - result r = E_SUCCESS; - int dpi = -1; - - r = SettingInfo::GetValue(L"http://tizen.org/feature/screen.dpi", dpi); - TryLog(!IsFailed(r), "[%s] Cannot get the current dpi", GetErrorMessage(r)); - - return dpi; -} - -void Device::setAccelerometerEnabled(bool isEnabled) -{ - -} - -void Device::setAccelerometerInterval(float interval) -{ - -} - -NS_CC_END diff --git a/cocos2dx/platform/tizen/CCEGLView.cpp b/cocos2dx/platform/tizen/CCEGLView.cpp deleted file mode 100644 index b6406ee9c5..0000000000 --- a/cocos2dx/platform/tizen/CCEGLView.cpp +++ /dev/null @@ -1,250 +0,0 @@ -/**************************************************************************** -Copyright (c) 2013 cocos2d-x.org -Copyright (c) 2013 Lee, Jae-Hong - -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 "CCEGLView.h" -#include "CCApplication.h" -#include "CCGL.h" -#include "CCDirector.h" -#include "CCOspApplication.h" -#include "CCOspForm.h" - -NS_CC_BEGIN -using namespace Tizen::App; -using namespace Tizen::Base::Runtime; - -EGLView::EGLView() - : __eglDisplay(EGL_DEFAULT_DISPLAY) - , __eglSurface(EGL_NO_SURFACE) - , __eglConfig(null) - , __eglContext(EGL_NO_DISPLAY) - , __pTimer(null) -{ - -} - -EGLView::~EGLView() -{ - -} - -bool EGLView::isOpenGLReady() -{ - return (_screenSize.width != 0 && _screenSize.height != 0); -} - -Tizen::Base::Runtime::Timer* -EGLView::getTimer() -{ - return __pTimer; -} - -void -EGLView::cleanup() -{ - if (__pTimer != null) - { - __pTimer->Cancel(); - delete __pTimer; - __pTimer = null; - } - - destroyGL(); -} - -void EGLView::end() -{ - cleanup(); - - UiApp* pApp = UiApp::GetInstance(); - AppAssert(pApp); - pApp->Terminate(); -} - -void EGLView::swapBuffers() -{ - eglSwapBuffers(__eglDisplay, __eglSurface); -} - -void EGLView::setIMEKeyboardState(bool bOpen) -{ - if (bOpen) - { - ((OspForm *)OspApplication::GetInstance()->getOspForm())->ShowKeypad(); - } - else - { - ((OspForm *)OspApplication::GetInstance()->getOspForm())->CloseKeypad(); - } -} - -EGLView* EGLView::getInstance() -{ - static EGLView* s_pEglView = NULL; - if (s_pEglView == NULL) - { - s_pEglView = new EGLView(); - if(!s_pEglView->create()) - { - delete s_pEglView; - s_pEglView = NULL; - } - } - - return s_pEglView; -} - -// XXX: deprecated -EGLView* EGLView::sharedOpenGLView() -{ - return EGLView::getInstance(); -} - -void -EGLView::OnTimerExpired(Tizen::Base::Runtime::Timer& timer) -{ - if (__pTimer == null) - { - return; - } - __pTimer->Start(Application::getInstance()->getAnimationInterval()); - - Director::getInstance()->mainLoop(); -} - -bool -EGLView::create() -{ - result r = E_SUCCESS; - - TryCatch(initEGL(), , "[EGLView] EGLView::create() failed."); - - __pTimer = new (std::nothrow) Tizen::Base::Runtime::Timer; - TryCatch(__pTimer != null, , "[EGLView] Failed to allocate memory."); - - r = __pTimer->Construct(*this); - TryCatch(!IsFailed(r), , "[EGLView] __pTimer->Construct(*this) failed."); - - return true; - -CATCH: - return false; -} - -bool -EGLView::initEGL() -{ - EGLint numConfigs = 1; - - EGLint eglConfigList[] = - { - EGL_RED_SIZE, 5, - EGL_GREEN_SIZE, 6, - EGL_BLUE_SIZE, 5, - EGL_ALPHA_SIZE, 0, - EGL_DEPTH_SIZE, 8, - EGL_SURFACE_TYPE, EGL_WINDOW_BIT, - EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, - EGL_NONE - }; - - EGLint eglContextList[] = - { - EGL_CONTEXT_CLIENT_VERSION, 2, - EGL_NONE - }; - - eglBindAPI(EGL_OPENGL_ES_API); - - if (__eglDisplay) - { - destroyGL(); - } - - __eglDisplay = eglGetDisplay((EGLNativeDisplayType)EGL_DEFAULT_DISPLAY); - TryCatch(__eglDisplay != EGL_NO_DISPLAY, , "[EGLView] eglGetDisplay() failed."); - - TryCatch(!(eglInitialize(__eglDisplay, null, null) == EGL_FALSE || eglGetError() != EGL_SUCCESS), , "[EGLView] eglInitialize() failed."); - - TryCatch(!(eglChooseConfig(__eglDisplay, eglConfigList, &__eglConfig, 1, &numConfigs) == EGL_FALSE || - eglGetError() != EGL_SUCCESS), , "[EGLView] eglChooseConfig() failed."); - - TryCatch(numConfigs, , "[EGLView] eglChooseConfig() failed. because of matching config doesn't exist"); - - __eglSurface = eglCreateWindowSurface(__eglDisplay, __eglConfig, (EGLNativeWindowType)OspApplication::GetInstance()->getOspForm(), null); - TryCatch(!(__eglSurface == EGL_NO_SURFACE || eglGetError() != EGL_SUCCESS), , "[EGLView] eglCreateWindowSurface() failed."); - - __eglContext = eglCreateContext(__eglDisplay, __eglConfig, EGL_NO_CONTEXT, eglContextList); - TryCatch(!(__eglContext == EGL_NO_CONTEXT || eglGetError() != EGL_SUCCESS), , "[EGLView] eglCreateContext() failed."); - - TryCatch(!(eglMakeCurrent(__eglDisplay, __eglSurface, __eglSurface, __eglContext) == EGL_FALSE || - eglGetError() != EGL_SUCCESS), , "[EGLView] eglMakeCurrent() failed."); - - return true; - -CATCH: - { - AppLog("[EGLView] EGLView can run on systems which supports OpenGL ES(R) 2.0."); - AppLog("[EGLView] When EGLView does not correctly execute, there are a few reasons."); - AppLog("[EGLView] 1. The current device(real-target or emulator) does not support OpenGL ES(R) 2.0.\n" - " Check the Release Notes."); - AppLog("[EGLView] 2. The system running on emulator cannot support OpenGL(R) 2.1 or later.\n" - " Try with other system."); - AppLog("[EGLView] 3. The system running on emulator does not maintain the latest graphics driver.\n" - " Update the graphics driver."); - } - - destroyGL(); - - return false; -} - -void -EGLView::destroyGL(void) -{ - if (__eglDisplay) - { - eglMakeCurrent(__eglDisplay, null, null, null); - - if (__eglContext) - { - eglDestroyContext(__eglDisplay, __eglContext); - __eglContext = EGL_NO_CONTEXT; - } - - if (__eglSurface) - { - eglDestroySurface(__eglDisplay, __eglSurface); - __eglSurface = EGL_NO_SURFACE; - } - - eglTerminate(__eglDisplay); - __eglDisplay = EGL_NO_DISPLAY; - } - - return; -} - -NS_CC_END - diff --git a/cocos2dx/platform/tizen/CCEGLView.h b/cocos2dx/platform/tizen/CCEGLView.h deleted file mode 100644 index ad6040f455..0000000000 --- a/cocos2dx/platform/tizen/CCEGLView.h +++ /dev/null @@ -1,85 +0,0 @@ -/**************************************************************************** -Copyright (c) 2013 cocos2d-x.org -Copyright (c) 2013 Lee, Jae-Hong - -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 __CC_EGLVIEW_TIZEN_H__ -#define __CC_EGLVIEW_TIZEN_H__ - -#include "cocoa/CCGeometry.h" -#include "platform/CCEGLViewProtocol.h" -#include <FBase.h> - -NS_CC_BEGIN - -class CC_DLL EGLView - : public EGLViewProtocol - , public Tizen::Base::Runtime::ITimerEventListener -{ -public: - /** - * @js ctor - */ - EGLView(); - /** - * @js NA - * @lua NA - */ - virtual ~EGLView(); - - bool isOpenGLReady(); - Tizen::Base::Runtime::Timer* getTimer(); - void cleanup(); - - // keep compatible - void end(); - void swapBuffers(); - void setIMEKeyboardState(bool bOpen); - - // static function - /** - @brief get the shared main open gl window - */ - static EGLView* getInstance(); - - /** @deprecated Use getInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static EGLView* sharedOpenGLView(); - // Tizen timer callback - virtual void OnTimerExpired(Tizen::Base::Runtime::Timer& timer); - -private: - bool create(); - bool initEGL(); - void destroyGL(); - - Tizen::Graphics::Opengl::EGLDisplay __eglDisplay; - Tizen::Graphics::Opengl::EGLSurface __eglSurface; - Tizen::Graphics::Opengl::EGLConfig __eglConfig; - Tizen::Graphics::Opengl::EGLContext __eglContext; - - Tizen::Base::Runtime::Timer* __pTimer; -}; - -NS_CC_END - -#endif // end of __CC_EGLVIEW_TIZEN_H__ diff --git a/cocos2dx/platform/tizen/CCFileUtilsTizen.cpp b/cocos2dx/platform/tizen/CCFileUtilsTizen.cpp deleted file mode 100644 index 2653d427f8..0000000000 --- a/cocos2dx/platform/tizen/CCFileUtilsTizen.cpp +++ /dev/null @@ -1,116 +0,0 @@ -/**************************************************************************** -Copyright (c) 2013 cocos2d-x.org -Copyright (c) 2013 Lee, Jae-Hong - -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 "CCFileUtilsTizen.h" -#include "platform/CCCommon.h" -#include "ccMacros.h" -#include "CCApplication.h" -#include "cocoa/CCString.h" -#include <FApp.h> -#include <FBase.h> -#include <FIo.h> -#include <FText.h> - -NS_CC_BEGIN -using namespace std; -using namespace Tizen::App; -using namespace Tizen::Base; -using namespace Tizen::Io; -using namespace Tizen::Text; - -FileUtils* FileUtils::getInstance() -{ - if (s_sharedFileUtils == NULL) - { - s_sharedFileUtils = new FileUtilsTizen(); - if(!s_sharedFileUtils->init()) - { - delete s_sharedFileUtils; - s_sharedFileUtils = NULL; - CCLOG("ERROR: Could not init CCFileUtilsTizen"); - } - } - return s_sharedFileUtils; -} - -FileUtilsTizen::FileUtilsTizen() -{ -} - -bool FileUtilsTizen::init() -{ - UiApp* pApp = UiApp::GetInstance(); - if (!pApp) - { - return false; - } - - Tizen::Base::String resPath = pApp->GetAppResourcePath(); - if (resPath.IsEmpty()) - { - return false; - } - - AsciiEncoding ascii; - ByteBuffer* buffer = ascii.GetBytesN(resPath); - _defaultResRootPath = (const char *)buffer->GetPointer(); - delete buffer; - return FileUtils::init(); -} - -string FileUtilsTizen::getWritablePath() const -{ - UiApp* pApp = UiApp::GetInstance(); - if (!pApp) - { - return null; - } - - string path(""); - AsciiEncoding ascii; - Tizen::Base::String dataPath = pApp->GetAppDataPath(); - if (!dataPath.IsEmpty()) - { - ByteBuffer* buffer = ascii.GetBytesN(dataPath); - path.append((const char*)buffer->GetPointer()); - delete buffer; - } - - return path; -} - -bool FileUtilsTizen::isFileExist(const std::string& strFilePath) const -{ - std::string strPath = strFilePath; - if (!isAbsolutePath(strPath)) - { // Not absolute path, add the default root path at the beginning. - strPath.insert(0, _defaultResRootPath); - } - - return File::IsFileExist(strPath.c_str()); -} - -NS_CC_END - diff --git a/cocos2dx/platform/tizen/CCFileUtilsTizen.h b/cocos2dx/platform/tizen/CCFileUtilsTizen.h deleted file mode 100644 index 644f933446..0000000000 --- a/cocos2dx/platform/tizen/CCFileUtilsTizen.h +++ /dev/null @@ -1,61 +0,0 @@ -/**************************************************************************** -Copyright (c) 2013 cocos2d-x.org -Copyright (c) 2013 Lee, Jae-Hong - -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 __CC_FILEUTILS_TIZEN_H__ -#define __CC_FILEUTILS_TIZEN_H__ - -#include "platform/CCFileUtils.h" -#include "platform/CCPlatformMacros.h" -#include "ccTypes.h" -#include <string> -#include <vector> - -NS_CC_BEGIN - -/** - * @addtogroup platform - * @{ - */ - -//! @brief Helper class to handle file operations -class CC_DLL FileUtilsTizen : public FileUtils -{ - friend class FileUtils; - FileUtilsTizen(); -public: - /* override funtions */ - bool init(); - virtual std::string getWritablePath() const; - virtual bool isFileExist(const std::string& strFilePath) const; -}; - -// end of platform group -/// @} - -NS_CC_END - -#endif // __CC_FILEUTILS_LINUX_H__ - - diff --git a/cocos2dx/platform/tizen/CCGL.h b/cocos2dx/platform/tizen/CCGL.h deleted file mode 100644 index 5bbffbf198..0000000000 --- a/cocos2dx/platform/tizen/CCGL.h +++ /dev/null @@ -1,36 +0,0 @@ -/**************************************************************************** -Copyright (c) 2013 cocos2d-x.org -Copyright (c) 2013 Lee, Jae-Hong - -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 __CCGL_H__ -#define __CCGL_H__ - -#include <FGraphicsOpengl2.h> -using namespace Tizen::Graphics::Opengl; - -#define GL_DEPTH24_STENCIL8 GL_DEPTH24_STENCIL8_OES - -#define glClearDepth glClearDepthf - -#endif // __CCGL_H__ diff --git a/cocos2dx/platform/tizen/CCImage.cpp b/cocos2dx/platform/tizen/CCImage.cpp deleted file mode 100644 index b2faac43cc..0000000000 --- a/cocos2dx/platform/tizen/CCImage.cpp +++ /dev/null @@ -1,465 +0,0 @@ -#include <string.h> - -#include <algorithm> -#include <vector> -#include <string> -#include <sstream> -#include <fontconfig/fontconfig.h> - -#include "platform/CCFileUtils.h" -#include "platform/CCPlatformMacros.h" -#define __CC_PLATFORM_IMAGE_CPP__ -#include "platform/CCImageCommon_cpp.h" -#include "platform/CCImage.h" -#include "platform/tizen/CCApplication.h" - -#include "ft2build.h" -#include "CCStdC.h" - -#include FT_FREETYPE_H - -using namespace std; - -// as FcFontMatch is quite an expensive call, cache the results of getFontFile -static std::map<std::string, std::string> fontCache; - -struct LineBreakGlyph { - FT_UInt glyphIndex; - int paintPosition; - int glyphWidth; - - int bearingX; - int kerning; - int horizAdvance; -}; - -struct LineBreakLine { - LineBreakLine() : lineWidth(0) {} - - std::vector<LineBreakGlyph> glyphs; - int lineWidth; - - void reset() { - glyphs.clear(); - lineWidth = 0; - } - - void calculateWidth() { - lineWidth = 0; - if ( glyphs.empty() == false ) { - lineWidth = glyphs.at(glyphs.size() - 1).paintPosition + glyphs.at(glyphs.size() - 1).glyphWidth; - } - } -}; - -NS_CC_BEGIN -class BitmapDC -{ -public: - BitmapDC() { - libError = FT_Init_FreeType( &library ); - FcInit(); - _data = NULL; - reset(); - } - - ~BitmapDC() { - FT_Done_FreeType(library); - FcFini(); - //data will be deleted by Image -// if (_data) { -// delete _data; -// } - reset(); - } - - void reset() { - iMaxLineWidth = 0; - iMaxLineHeight = 0; - textLines.clear(); - } - - int utf8(char **p) - { - if ((**p & 0x80) == 0x00) - { - int a = *((*p)++); - - return a; - } - if ((**p & 0xE0) == 0xC0) - { - int a = *((*p)++) & 0x1F; - int b = *((*p)++) & 0x3F; - - return (a << 6) | b; - } - if ((**p & 0xF0) == 0xE0) - { - int a = *((*p)++) & 0x0F; - int b = *((*p)++) & 0x3F; - int c = *((*p)++) & 0x3F; - - return (a << 12) | (b << 6) | c; - } - if ((**p & 0xF8) == 0xF0) - { - int a = *((*p)++) & 0x07; - int b = *((*p)++) & 0x3F; - int c = *((*p)++) & 0x3F; - int d = *((*p)++) & 0x3F; - - return (a << 18) | (b << 12) | (c << 8) | d; - } - return 0; - } - - bool isBreakPoint(FT_UInt currentCharacter, FT_UInt previousCharacter) { - if ( previousCharacter == '-' || previousCharacter == '/' || previousCharacter == '\\' ) { - // we can insert a line break after one of these characters - return true; - } - return false; - } - - bool divideString(FT_Face face, const char* sText, int iMaxWidth, int iMaxHeight) { - const char* pText = sText; - textLines.clear(); - iMaxLineWidth = 0; - - FT_UInt unicode; - FT_UInt prevCharacter = 0; - FT_UInt glyphIndex = 0; - FT_UInt prevGlyphIndex = 0; - FT_Vector delta; - LineBreakLine currentLine; - - int currentPaintPosition = 0; - int lastBreakIndex = -1; - bool hasKerning = FT_HAS_KERNING( face ); - while ((unicode=utf8((char**)&pText))) { - if (unicode == '\n') { - currentLine.calculateWidth(); - iMaxLineWidth = max(iMaxLineWidth, currentLine.lineWidth); - textLines.push_back(currentLine); - currentLine.reset(); - prevGlyphIndex = 0; - prevCharacter = 0; - lastBreakIndex = -1; - currentPaintPosition = 0; - continue; - } - - if ( isBreakPoint(unicode, prevCharacter) ) { - lastBreakIndex = currentLine.glyphs.size() - 1; - } - - glyphIndex = FT_Get_Char_Index(face, unicode); - if (FT_Load_Glyph(face, glyphIndex, FT_LOAD_DEFAULT)) { - return false; - } - - if (unicode == ' ') { - currentPaintPosition += face->glyph->metrics.horiAdvance >> 6; - prevGlyphIndex = glyphIndex; - prevCharacter = unicode; - lastBreakIndex = currentLine.glyphs.size(); - continue; - } - - LineBreakGlyph glyph; - glyph.glyphIndex = glyphIndex; - glyph.glyphWidth = face->glyph->metrics.width >> 6; - glyph.bearingX = face->glyph->metrics.horiBearingX >> 6; - glyph.horizAdvance = face->glyph->metrics.horiAdvance >> 6; - glyph.kerning = 0; - - if (prevGlyphIndex != 0 && hasKerning) { - FT_Get_Kerning(face, prevGlyphIndex, glyphIndex, FT_KERNING_DEFAULT, &delta); - glyph.kerning = delta.x >> 6; - } - - if (iMaxWidth > 0 && currentPaintPosition + glyph.bearingX + glyph.kerning + glyph.glyphWidth > iMaxWidth) { - - int glyphCount = currentLine.glyphs.size(); - if ( lastBreakIndex >= 0 && lastBreakIndex < glyphCount && currentPaintPosition + glyph.bearingX + glyph.kerning + glyph.glyphWidth - currentLine.glyphs.at(lastBreakIndex).paintPosition < iMaxWidth ) { - // we insert a line break at our last break opportunity - std::vector<LineBreakGlyph> tempGlyphs; - std::vector<LineBreakGlyph>::iterator it = currentLine.glyphs.begin(); - std::advance(it, lastBreakIndex); - tempGlyphs.insert(tempGlyphs.begin(), it, currentLine.glyphs.end()); - currentLine.glyphs.erase(it, currentLine.glyphs.end()); - currentLine.calculateWidth(); - iMaxLineWidth = max(iMaxLineWidth, currentLine.lineWidth); - textLines.push_back(currentLine); - currentLine.reset(); - currentPaintPosition = 0; - for ( it = tempGlyphs.begin(); it != tempGlyphs.end(); it++ ) { - if ( currentLine.glyphs.empty() ) { - currentPaintPosition = -(*it).bearingX; - (*it).kerning = 0; - } - (*it).paintPosition = currentPaintPosition + (*it).bearingX + (*it).kerning; - currentLine.glyphs.push_back((*it)); - currentPaintPosition += (*it).kerning + (*it).horizAdvance; - } - } else { - // the current word is too big to fit into one line, insert line break right here - currentPaintPosition = 0; - glyph.kerning = 0; - currentLine.calculateWidth(); - iMaxLineWidth = max(iMaxLineWidth, currentLine.lineWidth); - textLines.push_back(currentLine); - currentLine.reset(); - } - - prevGlyphIndex = 0; - prevCharacter = 0; - lastBreakIndex = -1; - } else { - prevGlyphIndex = glyphIndex; - prevCharacter = unicode; - } - - if ( currentLine.glyphs.empty() ) { - currentPaintPosition = -glyph.bearingX; - } - glyph.paintPosition = currentPaintPosition + glyph.bearingX + glyph.kerning; - currentLine.glyphs.push_back(glyph); - currentPaintPosition += glyph.kerning + glyph.horizAdvance; - } - - if ( currentLine.glyphs.empty() == false ) { - currentLine.calculateWidth(); - iMaxLineWidth = max(iMaxLineWidth, currentLine.lineWidth); - textLines.push_back(currentLine); - } - return true; - } - - /** - * compute the start pos of every line - */ - int computeLineStart(FT_Face face, Image::TextAlign eAlignMask, int line) { - int lineWidth = textLines.at(line).lineWidth; - if (eAlignMask == Image::TextAlign::CENTER || eAlignMask == Image::TextAlign::TOP || eAlignMask == Image::TextAlign::BOTTOM) { - return (iMaxLineWidth - lineWidth) / 2; - } else if (eAlignMask == Image::TextAlign::RIGHT || eAlignMask == Image::TextAlign::TOP_RIGHT || eAlignMask == Image::TextAlign::BOTTOM_RIGHT) { - return (iMaxLineWidth - lineWidth); - } - - // left or other situation - return 0; - } - - int computeLineStartY( FT_Face face, Image::TextAlign eAlignMask, int txtHeight, int borderHeight ){ - int baseLinePos = ceilf(FT_MulFix( face->bbox.yMax, face->size->metrics.y_scale )/64.0f); - if (eAlignMask == Image::TextAlign::CENTER || eAlignMask == Image::TextAlign::LEFT || eAlignMask == Image::TextAlign::RIGHT) { - //vertical center - return (borderHeight - txtHeight) / 2 + baseLinePos; - } else if (eAlignMask == Image::TextAlign::BOTTOM_RIGHT || eAlignMask == Image::TextAlign::BOTTOM || eAlignMask == Image::TextAlign::BOTTOM_LEFT) { - //vertical bottom - return borderHeight - txtHeight + baseLinePos; - } - - // top alignment - return baseLinePos; - } - - std::string getFontFile(const char* family_name) { - std::string fontPath = family_name; - - std::map<std::string, std::string>::iterator it = fontCache.find(family_name); - if ( it != fontCache.end() ) { - return it->second; - } - - // check if the parameter is a font file shipped with the application - std::string lowerCasePath = fontPath; - std::transform(lowerCasePath.begin(), lowerCasePath.end(), lowerCasePath.begin(), ::tolower); - if ( lowerCasePath.find(".ttf") != std::string::npos ) { - fontPath = cocos2d::FileUtils::getInstance()->fullPathForFilename(fontPath.c_str()); - - FILE *f = fopen(fontPath.c_str(), "r"); - if ( f ) { - fclose(f); - fontCache.insert(std::pair<std::string, std::string>(family_name, fontPath)); - return fontPath; - } - } - - // use fontconfig to match the parameter against the fonts installed on the system - FcPattern *pattern = FcPatternBuild (0, FC_FAMILY, FcTypeString, family_name, (char *) 0); - FcConfigSubstitute(0, pattern, FcMatchPattern); - FcDefaultSubstitute(pattern); - - FcResult result; - FcPattern *font = FcFontMatch(0, pattern, &result); - if ( font ) { - FcChar8 *s = NULL; - if ( FcPatternGetString(font, FC_FILE, 0, &s) == FcResultMatch ) { - fontPath = (const char*)s; - - FcPatternDestroy(font); - FcPatternDestroy(pattern); - - fontCache.insert(std::pair<std::string, std::string>(family_name, fontPath)); - return fontPath; - } - FcPatternDestroy(font); - } - FcPatternDestroy(pattern); - - return family_name; - } - - bool getBitmap(const char *text, int nWidth, int nHeight, Image::TextAlign eAlignMask, const char * pFontName, float fontSize) { - if (libError) { - return false; - } - - FT_Face face; - std::string fontfile = getFontFile(pFontName); - if ( FT_New_Face(library, fontfile.c_str(), 0, &face) ) { - //no valid font found use default - if ( FT_New_Face(library, "/usr/share/fonts/TizenSansRegular.ttf", 0, &face) ) { - return false; - } - } - - //select utf8 charmap - if ( FT_Select_Charmap(face, FT_ENCODING_UNICODE) ) { - FT_Done_Face(face); - return false; - } - - if ( FT_Set_Pixel_Sizes(face, fontSize, fontSize) ) { - FT_Done_Face(face); - return false; - } - - if ( divideString(face, text, nWidth, nHeight) == false ) { - FT_Done_Face(face); - return false; - } - - //compute the final line width - iMaxLineWidth = MAX(iMaxLineWidth, nWidth); - - //compute the final line height - iMaxLineHeight = ceilf(FT_MulFix( face->bbox.yMax - face->bbox.yMin, face->size->metrics.y_scale )/64.0f); - int lineHeight = face->size->metrics.height>>6; - if ( textLines.size() > 0 ) { - iMaxLineHeight += (lineHeight * (textLines.size() -1)); - } - int txtHeight = iMaxLineHeight; - iMaxLineHeight = MAX(iMaxLineHeight, nHeight); - - _data = new unsigned char[iMaxLineWidth * iMaxLineHeight * 4]; - memset(_data,0, iMaxLineWidth * iMaxLineHeight*4); - - int iCurYCursor = computeLineStartY(face, eAlignMask, txtHeight, iMaxLineHeight); - - int lineCount = textLines.size(); - for (int line = 0; line < lineCount; line++) { - int iCurXCursor = computeLineStart(face, eAlignMask, line); - - int glyphCount = textLines.at(line).glyphs.size(); - for (int i = 0; i < glyphCount; i++) { - LineBreakGlyph glyph = textLines.at(line).glyphs.at(i); - - if (FT_Load_Glyph(face, glyph.glyphIndex, FT_LOAD_RENDER)) { - continue; - } - - FT_Bitmap& bitmap = face->glyph->bitmap; - int yoffset = iCurYCursor - (face->glyph->metrics.horiBearingY >> 6); - int xoffset = iCurXCursor + glyph.paintPosition; - - for (int y = 0; y < bitmap.rows; ++y) { - int iY = yoffset + y; - if (iY>=iMaxLineHeight) { - //exceed the height truncate - break; - } - iY *= iMaxLineWidth; - - int bitmap_y = y * bitmap.width; - - for (int x = 0; x < bitmap.width; ++x) { - unsigned char cTemp = bitmap.buffer[bitmap_y + x]; - if (cTemp == 0) { - continue; - } - - int iX = xoffset + x; - - int iTemp = cTemp << 24 | cTemp << 16 | cTemp << 8 | cTemp; - *(int*) &_data[(iY + iX) * 4 + 0] = iTemp; - } - } - } - // step to next line - iCurYCursor += lineHeight; - } - - // free face - FT_Done_Face(face); - return true; - } - -public: - FT_Library library; - - unsigned char *_data; - int libError; - std::vector<LineBreakLine> textLines; - int iMaxLineWidth; - int iMaxLineHeight; -}; - -static BitmapDC& sharedBitmapDC() -{ - static BitmapDC s_BmpDC; - return s_BmpDC; -} - -bool Image::initWithString( - const char * pText, - int nWidth/* = 0*/, - int nHeight/* = 0*/, - TextAlign eAlignMask/* = kAlignCenter*/, - const char * pFontName/* = nil*/, - int nSize/* = 0*/) -{ - bool bRet = false; - do - { - CC_BREAK_IF(! pText); - - BitmapDC &dc = sharedBitmapDC(); - - //const char* pFullFontName = FileUtils::getInstance()->fullPathFromRelativePath(pFontName); - - CC_BREAK_IF(! dc.getBitmap(pText, nWidth, nHeight, eAlignMask, pFontName, nSize)); - - // assign the dc._data to _data in order to save time - _data = dc._data; - CC_BREAK_IF(! _data); - - _width = (short)dc.iMaxLineWidth; - _height = (short)dc.iMaxLineHeight; - _preMulti = true; - _renderFormat = Texture2D::PixelFormat::RGBA8888; - _dataLen = _width * _height * 4; - - bRet = true; - - dc.reset(); - }while (0); - - //do nothing - return bRet; -} - -NS_CC_END diff --git a/cocos2dx/platform/tizen/CCOspApplication.cpp b/cocos2dx/platform/tizen/CCOspApplication.cpp deleted file mode 100644 index 641977a1ec..0000000000 --- a/cocos2dx/platform/tizen/CCOspApplication.cpp +++ /dev/null @@ -1,182 +0,0 @@ -/**************************************************************************** -Copyright (c) 2013 cocos2d-x.org -Copyright (c) 2013 Lee, Jae-Hong - -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 "CCOspApplication.h" -#include "CCOspForm.h" -#include "cocos2d.h" - -USING_NS_CC; -using namespace Tizen::App; -using namespace Tizen::System; -using namespace Tizen::Ui; -using namespace Tizen::Ui::Controls; -using namespace Tizen::Base::Runtime; - -OspApplication * OspApplication::sm_pSharedOspApplication = 0; -OspApplicationInitialized OspApplication::sm_pApplicationInitialized = 0; -Orientation OspApplication::sm_eScreenOrientation = ORIENTATION_NONE; - -OspApplication::OspApplication() - : __pForm(null) -{ - CCAssert(! sm_pSharedOspApplication, ""); - sm_pSharedOspApplication = this; -} - -OspApplication::~OspApplication() -{ - CCAssert(this == sm_pSharedOspApplication, ""); - sm_pSharedOspApplication = NULL; -} - -Tizen::App::Application* -OspApplication::CreateInstance(void) -{ - // Create the instance through the constructor. - return new (std::nothrow) OspApplication(); -} - -void -OspApplication::SetApplicationInitializedCallback(OspApplicationInitialized p) -{ - sm_pApplicationInitialized = p; -} - -void -OspApplication::SetScreenOrientation(Orientation orientation) -{ - sm_eScreenOrientation = orientation; -} - -OspApplication* -OspApplication::GetInstance(void) -{ - CCAssert(sm_pSharedOspApplication, ""); - return sm_pSharedOspApplication; -} - -Tizen::Ui::Controls::Form* -OspApplication::getOspForm() -{ - return __pForm; -} - -bool -OspApplication::OnAppInitializing(AppRegistry& appRegistry) -{ - CCLOG("OnAppInitializing"); - - result r = E_SUCCESS; - - __pFrame = new (std::nothrow) Frame(); - TryReturn(__pFrame != null, E_FAILURE, "[OspApplication] Generating a frame failed."); - - r = __pFrame->Construct(); - TryReturn(!IsFailed(r), E_FAILURE, "[OspApplication] pAppFrame->Construct() failed."); - - this->AddFrame(*__pFrame); - - __pForm = new (std::nothrow) OspForm; - TryCatch(__pForm != null, , "[OspApplication] Allocation of OspForm failed."); - - r = __pForm->Construct(FORM_STYLE_NORMAL); - TryCatch(!IsFailed(r), , "[OspApplication] __pForm->Construct(FORM_STYLE_NORMAL) failed."); - - r = GetAppFrame()->GetFrame()->AddControl(*__pForm); - TryCatch(!IsFailed(r), , "[OspApplication] GetAppFrame()->GetFrame()->AddControl(*__pForm) failed."); - - return true; - -CATCH: - delete __pForm; - __pForm = null; - - return false; -} - -bool -OspApplication::OnAppInitialized(void) -{ - sm_pApplicationInitialized(); - __pFrame->SetOrientation(sm_eScreenOrientation); - return true; -} - -bool -OspApplication::OnAppTerminating(AppRegistry& appRegistry, bool forcedTermination) -{ - EGLView::getInstance()->cleanup(); - - return true; -} - -void -OspApplication::OnForeground(void) -{ - Tizen::Base::Runtime::Timer* timer = EGLView::getInstance()->getTimer(); - - if (timer != null) - { - timer->Start(cocos2d::Application::getInstance()->getAnimationInterval()); - } - - if (Director::getInstance()->getOpenGLView()) - { - cocos2d::Application::getInstance()->applicationWillEnterForeground(); - } -} - -void -OspApplication::OnBackground(void) -{ - Tizen::Base::Runtime::Timer* timer = EGLView::getInstance()->getTimer(); - - if (timer != null) - { - timer->Cancel(); - } - - cocos2d::Application::getInstance()->applicationDidEnterBackground(); -} - -void -OspApplication::OnLowMemory(void) -{ -} - -void -OspApplication::OnBatteryLevelChanged(BatteryLevel batteryLevel) -{ -} - -void -OspApplication::OnScreenOn(void) -{ -} - -void -OspApplication::OnScreenOff(void) -{ -} diff --git a/cocos2dx/platform/tizen/CCOspApplication.h b/cocos2dx/platform/tizen/CCOspApplication.h deleted file mode 100644 index c3069c711c..0000000000 --- a/cocos2dx/platform/tizen/CCOspApplication.h +++ /dev/null @@ -1,79 +0,0 @@ -/**************************************************************************** -Copyright (c) 2013 cocos2d-x.org -Copyright (c) 2013 Lee, Jae-Hong - -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 _CCOSPAPPLICATION_H_ -#define _CCOSPAPPLICATION_H_ - -#include <FApp.h> -#include <FUi.h> - -typedef void (*OspApplicationInitialized)(void); - -class OspApplication - : public Tizen::App::Application -{ -public: - /** - * [OspApplication] application must have a factory method that creates an instance of itself. - */ - static Tizen::App::Application* CreateInstance(void); - static OspApplication* GetInstance(void); - static void SetApplicationInitializedCallback(OspApplicationInitialized p); - static void SetScreenOrientation(Tizen::Ui::Orientation orientation); - -public: - /** - * @js ctor - */ - OspApplication(); - /** - * @js NA - * @lua NA - */ - ~OspApplication(); - - Tizen::Ui::Controls::Form* getOspForm(); - - virtual bool OnAppInitializing(Tizen::App::AppRegistry& appRegistry); - virtual bool OnAppInitialized(void); - virtual bool OnAppTerminating(Tizen::App::AppRegistry& appRegistry, bool forcedTermination = false); - virtual void OnForeground(void); - virtual void OnBackground(void); - virtual void OnLowMemory(void); - virtual void OnBatteryLevelChanged(Tizen::System::BatteryLevel batteryLevel); - virtual void OnScreenOn(void); - virtual void OnScreenOff(void); - -protected: - static OspApplication* sm_pSharedOspApplication; - static OspApplicationInitialized sm_pApplicationInitialized; - static Tizen::Ui::Orientation sm_eScreenOrientation; - -private: - Tizen::Ui::Controls::Frame* __pFrame; - Tizen::Ui::Controls::Form* __pForm; -}; - -#endif // _CCOSPAPPLICATION_H_ diff --git a/cocos2dx/platform/tizen/CCOspForm.cpp b/cocos2dx/platform/tizen/CCOspForm.cpp deleted file mode 100644 index e90a533e6a..0000000000 --- a/cocos2dx/platform/tizen/CCOspForm.cpp +++ /dev/null @@ -1,230 +0,0 @@ -/**************************************************************************** -Copyright (c) 2013 cocos2d-x.org -Copyright (c) 2013 Lee, Jae-Hong - -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 "CCOspForm.h" -#include "CCDirector.h" -#include "CCEGLView.h" -#include "text_input_node/CCIMEDispatcher.h" -#include <FBase.h> -#include <FText.h> - -USING_NS_CC; -using namespace Tizen::Base; -using namespace Tizen::Text; -using namespace Tizen::Ui; -using namespace Tizen::Ui::Controls; -using namespace Tizen::Graphics; - -OspForm::OspForm() - : __pKeypad(null) - , _editTextCallback(null) - , _ctx(null) -{ -} - -OspForm::~OspForm() -{ -} - -result -OspForm::OnInitializing(void) -{ - AddTouchEventListener(*this); - SetMultipointTouchEnabled(true); - - return E_SUCCESS; -} - -result -OspForm::OnTerminating(void) -{ - result r = E_SUCCESS; - - if (__pKeypad) - __pKeypad->Destroy(); - - Director::getInstance()->getAccelerometer()->stopSensor(); - - return r; -} - -void -OspForm:: OnTouchDoublePressed(const Control& source, const Tizen::Graphics::Point& currentPosition, const TouchEventInfo& touchInfo) -{ -} - -void -OspForm:: OnTouchFocusIn(const Control& source, const Tizen::Graphics::Point& currentPosition, const TouchEventInfo& touchInfo) -{ -} - -void -OspForm::OnTouchFocusOut(const Control& source, const Tizen::Graphics::Point& currentPosition, const TouchEventInfo& touchInfo) -{ -} - -void -OspForm::OnTouchLongPressed(const Control& source, const Tizen::Graphics::Point& currentPosition, const TouchEventInfo& touchInfo) -{ -} - -void -OspForm::OnTouchMoved(const Control& source, const Tizen::Graphics::Point& currentPosition, const TouchEventInfo& touchInfo) -{ - int id = touchInfo.GetPointId(); - float x = currentPosition.x; - float y = currentPosition.y; - Director::getInstance()->getOpenGLView()->handleTouchesMove(1, &id, &x, &y); -} - -void -OspForm::OnTouchPressed(const Control& source, const Tizen::Graphics::Point& currentPosition, const TouchEventInfo& touchInfo) -{ - int id = touchInfo.GetPointId(); - float x = currentPosition.x; - float y = currentPosition.y; - Director::getInstance()->getOpenGLView()->handleTouchesBegin(1, &id, &x, &y); -} - -void -OspForm::OnTouchReleased(const Control& source, const Tizen::Graphics::Point& currentPosition, const TouchEventInfo& touchInfo) -{ - int id = touchInfo.GetPointId(); - float x = currentPosition.x; - float y = currentPosition.y; - Director::getInstance()->getOpenGLView()->handleTouchesEnd(1, &id, &x, &y); -} - -void OspForm::OnTextValueChanged(const Tizen::Ui::Control& source) -{ - Tizen::Base::String text = __pKeypad->GetText(); - Utf8Encoding utf8; - ByteBuffer* buffer = utf8.GetBytesN(text); - const char* pText = ""; - if (buffer) - pText = (const char *)buffer->GetPointer(); - - if (_editTextCallback) - { - _editTextCallback(pText, _ctx); - } - else - { - const char* pContentText = IMEDispatcher::sharedDispatcher()->getContentText(); - - for (unsigned int i = strlen(pContentText); i > 0; i--) - { - IMEDispatcher::sharedDispatcher()->dispatchDeleteBackward(); - } - - std::string text(""); - if (pText != null) - { - text = pText; - if (text.compare("") == 0) - { - text = "\n"; - } - - if (text.at(text.length() - 1) != '\n') - { - text += '\n'; - } - } - - IMEDispatcher::sharedDispatcher()->dispatchInsertText(text.c_str(), text.length()); - } - - if (buffer) - delete buffer; -} - -void OspForm::OnTextValueChangeCanceled(const Tizen::Ui::Control& source) -{ - if (_editTextCallback) - { - _editTextCallback("", _ctx); - } - else - { - const char* pContentText = IMEDispatcher::sharedDispatcher()->getContentText(); - - for (unsigned int i = strlen(pContentText); i > 0; i--) - { - IMEDispatcher::sharedDispatcher()->dispatchDeleteBackward(); - } - } -} - -void -OspForm::ShowKeypad(const char* pMessage, KeypadStyle keypadStyle, KeypadInputModeCategory keypadCategory, bool bSingleLineEnabled, bool bTextPrediction, int nMaxLength, EditTextCallback pfEditTextCallback, void* pCtx) -{ - _editTextCallback = pfEditTextCallback; - _ctx = pCtx; - - if (__pKeypad) - { - __pKeypad->RemoveTextEventListener(*this); - __pKeypad->Destroy(); - __pKeypad = null; - } - - if (nMaxLength > 100) - nMaxLength = 100; - else if (nMaxLength == -1) - nMaxLength = 100; - - __pKeypad = new Keypad(); - __pKeypad->Construct(keypadStyle, keypadCategory, nMaxLength); - __pKeypad->AddTextEventListener(*this); - - __pKeypad->SetTextPredictionEnabled(bTextPrediction); - __pKeypad->SetSingleLineEnabled(bSingleLineEnabled); - __pKeypad->SetText(Tizen::Base::String(pMessage)); - __pKeypad->SetShowState(true); - __pKeypad->Show(); -} - -void -OspForm::ShowKeypad() -{ - ShowKeypad( - IMEDispatcher::sharedDispatcher()->getContentText(), - KEYPAD_STYLE_NORMAL, - KEYPAD_MODE_ALPHA, - true, - true, - 100, - null, - null); -} - -void -OspForm::CloseKeypad() -{ - __pKeypad->SetShowState(false); - Invalidate(true); -} - diff --git a/cocos2dx/platform/tizen/CCOspForm.h b/cocos2dx/platform/tizen/CCOspForm.h deleted file mode 100644 index 344678e2ec..0000000000 --- a/cocos2dx/platform/tizen/CCOspForm.h +++ /dev/null @@ -1,73 +0,0 @@ -/**************************************************************************** -Copyright (c) 2013 cocos2d-x.org -Copyright (c) 2013 Lee, Jae-Hong - -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 _CCOSPFORM_H_ -#define _CCOSPFORM_H_ - -#include <FBase.h> -#include <FUi.h> - -typedef void (*EditTextCallback)(const char* pText, void* ctx); - -class OspForm - : public Tizen::Ui::Controls::Form - , public Tizen::Ui::ITouchEventListener - , public Tizen::Ui::ITextEventListener -{ -public: - /** - * @js ctor - */ - OspForm(); - /** - * @js NA - * @lua NA - */ - ~OspForm(); - - virtual result OnInitializing(void); - virtual result OnTerminating(void); - virtual void OnTouchDoublePressed(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo); - virtual void OnTouchFocusIn(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo); - virtual void OnTouchFocusOut(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo); - virtual void OnTouchLongPressed (const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo); - virtual void OnTouchMoved(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo); - virtual void OnTouchPressed(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo); - virtual void OnTouchReleased(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo); - - // ITextEventListener - virtual void OnTextValueChanged(const Tizen::Ui::Control& source); - virtual void OnTextValueChangeCanceled(const Tizen::Ui::Control& source); - - void ShowKeypad(const char* pMessage, Tizen::Ui::Controls::KeypadStyle keypadStyle, Tizen::Ui::Controls::KeypadInputModeCategory keypadCategory, bool bSingleLineEnabled, bool bTextPrediction, int nMaxLength, EditTextCallback pfEditTextCallback, void* pCtx); - void ShowKeypad(); - void CloseKeypad(); - - Tizen::Ui::Controls::Keypad*__pKeypad; - EditTextCallback _editTextCallback; - void* _ctx; -}; - -#endif // _CCOSPFORM_H_ diff --git a/cocos2dx/platform/tizen/CCPlatformDefine.h b/cocos2dx/platform/tizen/CCPlatformDefine.h deleted file mode 100644 index 716c2a7823..0000000000 --- a/cocos2dx/platform/tizen/CCPlatformDefine.h +++ /dev/null @@ -1,48 +0,0 @@ -/**************************************************************************** -Copyright (c) 2013 cocos2d-x.org -Copyright (c) 2013 Lee, Jae-Hong - -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 __CCPLATFORMDEFINE_H__ -#define __CCPLATFORMDEFINE_H__ - -#include <string.h> -#include <assert.h> -#include <CCStdC.h> - -#define CC_DLL - -#define CC_ASSERT(cond) assert(cond) - -#define CC_UNUSED_PARAM(unusedparam) (void)unusedparam - -/* Define NULL pointer value */ -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#endif /* __CCPLATFORMDEFINE_H__*/ diff --git a/cocos2dx/platform/tizen/CCStdC.h b/cocos2dx/platform/tizen/CCStdC.h deleted file mode 100644 index 4f86f41b9b..0000000000 --- a/cocos2dx/platform/tizen/CCStdC.h +++ /dev/null @@ -1,49 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010 cocos2d-x.org - -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 __CC_STD_C_H__ -#define __CC_STD_C_H__ - -#include "platform/CCPlatformMacros.h" - -#include <math.h> -#include <stdio.h> -#include <sys/time.h> -#include <stdarg.h> -#include <float.h> -#include <stdint.h> - -#ifndef MIN -#define MIN(x,y) (((x) > (y)) ? (y) : (x)) -#endif // MIN - -#ifndef MAX -#define MAX(x,y) (((x) < (y)) ? (y) : (x)) -#endif // MAX - -#define nullptr __null - -#define override - -#endif // __CC_STD_C_H__ diff --git a/cocos2dx/proj.emscripten/Makefile b/cocos2dx/proj.emscripten/Makefile deleted file mode 100644 index 0847e2ac2f..0000000000 --- a/cocos2dx/proj.emscripten/Makefile +++ /dev/null @@ -1,180 +0,0 @@ -TARGET = libcocos2d.so - -INCLUDES += \ - -I../platform/third_party/linux/libfreetype2 \ - -I../platform/third_party/common/etc \ - -I../../extensions \ - -I../../extensions/CCBReader \ - -I../../extensions/GUI/CCControlExtension \ - -I../../extensions/GUI/CCControlExtension \ - -I../../external/chipmunk/include/chipmunk \ - -I../../extensions/network \ - -I../../extensions/Components \ - -DEFINES += -D__CC_PLATFORM_FILEUTILS_CPP__ -DEFINES += -DCC_ENABLE_CHIPMUNK_INTEGRATION - -SOURCES = ../actions/CCAction.cpp \ -../actions/CCActionCamera.cpp \ -../actions/CCActionEase.cpp \ -../actions/CCActionGrid.cpp \ -../actions/CCActionGrid3D.cpp \ -../actions/CCActionInstant.cpp \ -../actions/CCActionInterval.cpp \ -../actions/CCActionManager.cpp \ -../actions/CCActionPageTurn3D.cpp \ -../actions/CCActionProgressTimer.cpp \ -../actions/CCActionTiledGrid.cpp \ -../actions/CCActionCatmullRom.cpp \ -../actions/CCActionTween.cpp \ -../base_nodes/CCAtlasNode.cpp \ -../base_nodes/CCNode.cpp \ -../base_nodes/CCGLBufferedNode.cpp \ -../cocoa/CCAffineTransform.cpp \ -../cocoa/CCAutoreleasePool.cpp \ -../cocoa/CCGeometry.cpp \ -../cocoa/CCNS.cpp \ -../cocoa/CCObject.cpp \ -../cocoa/CCSet.cpp \ -../cocoa/CCArray.cpp \ -../cocoa/CCData.cpp \ -../cocoa/CCDictionary.cpp \ -../cocoa/CCString.cpp \ -../cocoa/CCDataVisitor.cpp \ -../draw_nodes/CCDrawingPrimitives.cpp \ -../draw_nodes/CCDrawNode.cpp \ -../effects/CCGrabber.cpp \ -../effects/CCGrid.cpp \ -../event_dispatcher/CCEventAcceleration.cpp \ -../event_dispatcher/CCEventListenerAcceleration.cpp \ -../event_dispatcher/CCEvent.cpp \ -../event_dispatcher/CCEventDispatcher.cpp \ -../event_dispatcher/CCEventListener.cpp \ -../event_dispatcher/CCEventKeyboard.cpp \ -../event_dispatcher/CCEventListenerKeyboard.cpp \ -../event_dispatcher/CCTouch.cpp \ -../event_dispatcher/CCEventTouch.cpp \ -../event_dispatcher/CCEventListenerTouch.cpp \ -../event_dispatcher/CCEventCustom.cpp \ -../event_dispatcher/CCEventListenerCustom.cpp \ -../label_nodes/CCFont.cpp \ -../label_nodes/CCFontAtlas.cpp \ -../label_nodes/CCFontAtlasCache.cpp \ -../label_nodes/CCFontAtlasFactory.cpp \ -../label_nodes/CCFontDefinition.cpp \ -../label_nodes/CCFontFNT.cpp \ -../label_nodes/CCFontFreeType.cpp \ -../label_nodes/CCLabel.cpp \ -../label_nodes/CCLabelAtlas.cpp \ -../label_nodes/CCLabelBMFont.cpp \ -../label_nodes/CCLabelTTF.cpp \ -../label_nodes/CCLabelTextFormatter.cpp \ -../label_nodes/CCTextImage.cpp \ -../layers_scenes_transitions_nodes/CCLayer.cpp \ -../layers_scenes_transitions_nodes/CCScene.cpp \ -../layers_scenes_transitions_nodes/CCTransition.cpp \ -../layers_scenes_transitions_nodes/CCTransitionPageTurn.cpp \ -../layers_scenes_transitions_nodes/CCTransitionProgress.cpp \ -../menu_nodes/CCMenu.cpp \ -../menu_nodes/CCMenuItem.cpp \ -../misc_nodes/CCMotionStreak.cpp \ -../misc_nodes/CCProgressTimer.cpp \ -../misc_nodes/CCClippingNode.cpp \ -../misc_nodes/CCRenderTexture.cpp \ -../particle_nodes/CCParticleExamples.cpp \ -../particle_nodes/CCParticleSystem.cpp \ -../particle_nodes/CCParticleSystemQuad.cpp \ -../particle_nodes/CCParticleBatchNode.cpp \ -../platform/CCSAXParser.cpp \ -../platform/CCThread.cpp \ -../platform/CCEGLViewProtocol.cpp \ -../platform/CCFileUtils.cpp \ -../platform/emscripten/CCCommon.cpp \ -../platform/emscripten/CCApplication.cpp \ -../platform/emscripten/CCEGLView.cpp \ -../platform/emscripten/CCImage.cpp \ -../platform/emscripten/CCDevice.cpp \ -../platform/emscripten/CCFileUtilsEmscripten.cpp \ -../platform/emscripten/CCTextureCacheEmscripten.cpp \ -../platform/third_party/common/etc/etc1.cpp \ -../script_support/CCScriptSupport.cpp \ -../sprite_nodes/CCAnimation.cpp \ -../sprite_nodes/CCAnimationCache.cpp \ -../sprite_nodes/CCSprite.cpp \ -../sprite_nodes/CCSpriteBatchNode.cpp \ -../sprite_nodes/CCSpriteFrame.cpp \ -../sprite_nodes/CCSpriteFrameCache.cpp \ -../support/ccUTF8.cpp \ -../support/CCProfiling.cpp \ -../support/user_default/CCUserDefault.cpp \ -../support/TransformUtils.cpp \ -../support/base64.cpp \ -../support/ccUtils.cpp \ -../support/CCVertex.cpp \ -../support/CCNotificationCenter.cpp \ -../support/image_support/TGAlib.cpp \ -../support/tinyxml2/tinyxml2.cpp \ -../support/zip_support/ZipUtils.cpp \ -../support/zip_support/ioapi.cpp \ -../support/zip_support/unzip.cpp \ -../support/data_support/ccCArray.cpp \ -../support/component/CCComponent.cpp \ -../support/component/CCComponentContainer.cpp \ -../text_input_node/CCIMEDispatcher.cpp \ -../text_input_node/CCTextFieldTTF.cpp \ -../textures/CCTexture2D.cpp \ -../textures/CCTextureAtlas.cpp \ -../textures/CCTextureCache.cpp \ -../tilemap_parallax_nodes/CCParallaxNode.cpp \ -../tilemap_parallax_nodes/CCTMXLayer.cpp \ -../tilemap_parallax_nodes/CCTMXObjectGroup.cpp \ -../tilemap_parallax_nodes/CCTMXTiledMap.cpp \ -../tilemap_parallax_nodes/CCTMXXMLParser.cpp \ -../tilemap_parallax_nodes/CCTileMapAtlas.cpp \ -../shaders/CCGLProgram.cpp \ -../shaders/ccGLStateCache.cpp \ -../shaders/CCShaderCache.cpp \ -../shaders/ccShaders.cpp \ -../kazmath/src/aabb.c \ -../kazmath/src/plane.c \ -../kazmath/src/vec2.c \ -../kazmath/src/mat3.c \ -../kazmath/src/quaternion.c \ -../kazmath/src/vec3.c \ -../kazmath/src/mat4.c \ -../kazmath/src/ray2.c \ -../kazmath/src/vec4.c \ -../kazmath/src/neon_matrix_impl.c \ -../kazmath/src/utility.c \ -../kazmath/src/GL/mat4stack.c \ -../kazmath/src/GL/matrix.c \ -../CCCamera.cpp \ -../CCConfiguration.cpp \ -../CCDirector.cpp \ -../CCScheduler.cpp \ -../ccFPSImages.c \ -../cocos2d.cpp - -COCOS_ROOT = ../.. - -include cocos2dx.mk - -CXXFLAGS += -Wno-sequence-point -CCFLAGS += -Wno-sequence-point - -TARGET := $(LIB_DIR)/$(TARGET) - -all: $(TARGET) - -$(TARGET): $(OBJECTS) $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(CXX) $(CXXFLAGS) $(OBJECTS) -shared -o $@ $(SHAREDLIBS) $(STATICLIBS) $(LIBS) - -$(OBJ_DIR)/%.o: ../%.cpp $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@ - -$(OBJ_DIR)/%.o: ../%.c $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(CC) $(CCFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@ - diff --git a/cocos2dx/proj.emscripten/cocos2dx.mk b/cocos2dx/proj.emscripten/cocos2dx.mk deleted file mode 100644 index 538dc437d6..0000000000 --- a/cocos2dx/proj.emscripten/cocos2dx.mk +++ /dev/null @@ -1,115 +0,0 @@ -all: - -DEFINES += -DEMSCRIPTEN -DCC_KEYBOARD_SUPPORT - -THIS_MAKEFILE := $(CURDIR)/$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) -ifndef COCOS_ROOT -COCOS_ROOT ?= $(realpath $(dir $(THIS_MAKEFILE))/../..) -else -RPATH_REL = ../.. -endif -COCOS_SRC = $(COCOS_ROOT)/cocos2dx -OBJ_DIR ?= obj - -EMSCRIPTEN_ROOT ?= $(realpath $(COCOS_ROOT)/external/emscripten) -PACKAGER := $(EMSCRIPTEN_ROOT)/tools/file_packager.py - -AR := $(EMSCRIPTEN_ROOT)/emar -CC := $(EMSCRIPTEN_ROOT)/emcc -CXX := $(EMSCRIPTEN_ROOT)/em++ -ARFLAGS = cr - -# XXX: Not entirely sure why main, malloc and free need to be explicitly listed -# here, but after adding a --js-library library, these symbols seem to get -# stripped unless enumerated here. -EXPORTED_FLAGS := -s EXPORTED_FUNCTIONS="['_CCTextureCacheEmscripten_addImageAsyncCallBack','_CCTextureCacheEmscripten_preMultiplyImageRegion','_malloc','_free','_main']" -JSLIBS := --js-library $(COCOS_SRC)/platform/emscripten/CCTextureCacheEmscripten.js - -CCFLAGS += -MMD -Wall -fPIC -Qunused-arguments -Wno-overloaded-virtual -Qunused-variable -s TOTAL_MEMORY=268435456 -s VERBOSE=1 -U__native_client__ -Wno-deprecated-declarations $(EXPORTED_FLAGS) $(JSLIBS) -CXXFLAGS += -MMD -Wall -fPIC -Qunused-arguments -Wno-overloaded-virtual -Qunused-variable -s TOTAL_MEMORY=268435456 -s VERBOSE=1 -U__native_client__ -Wno-deprecated-declarations $(EXPORTED_FLAGS) $(JSLIBS) -std=c++11 - -LIB_DIR = $(COCOS_ROOT)/lib/emscripten -BIN_DIR = bin - -INCLUDES += \ - -I$(COCOS_SRC) \ - -I$(COCOS_SRC)/cocoa \ - -I$(COCOS_SRC)/include \ - -I$(COCOS_SRC)/kazmath/include \ - -I$(COCOS_SRC)/platform/emscripten \ - -I$(COCOS_SRC)/platform/third_party/emscripten/libpng \ - -I$(COCOS_SRC)/platform/third_party/emscripten/libz \ - -I$(COCOS_SRC)/platform/third_party/emscripten/libtiff/include \ - -I$(COCOS_SRC)/platform/third_party/emscripten/libjpeg \ - -I$(COCOS_SRC)/platform/third_party/emscripten/libwebp - -LBITS := $(shell getconf LONG_BIT) -INCLUDES += -I$(COCOS_SRC)/platform/third_party/linux - -ifeq ($(DEBUG), 1) -CCFLAGS += -O0 -s ASSERTIONS=1 --jcache -s GL_UNSAFE_OPTS=0 -s INVOKE_RUN=0 -s WARN_ON_UNDEFINED_SYMBOLS=1 -s SAFE_HEAP=1 -CXXFLAGS += -O0 -s ASSERTIONS=1 --jcache -s GL_UNSAFE_OPTS=0 -s INVOKE_RUN=0 -s WARN_ON_UNDEFINED_SYMBOLS=1 -s SAFE_HEAP=1 -DEFINES += -D_DEBUG -DCOCOS2D_DEBUG=1 -DCP_USE_DOUBLES=0 -OBJ_DIR := $(OBJ_DIR)/debug -LIB_DIR := $(LIB_DIR)/debug -BIN_DIR := $(BIN_DIR)/debug -else -# Async image loading code incompatible with asm.js for now. Disable until -# we've had time to investigate. --closure 0 so that symbols don't get mangled, -# rendering them inaccessible from JS code. -CCFLAGS += -O2 --jcache -s GL_UNSAFE_OPTS=0 -s ASM_JS=1 -CXXFLAGS += -O2 --jcache -s GL_UNSAFE_OPTS=0 -s ASM_JS=1 -DEFINES += -DNDEBUG -DCP_USE_DOUBLES=0 -OBJ_DIR := $(OBJ_DIR)/release -LIB_DIR := $(LIB_DIR)/release -BIN_DIR := $(BIN_DIR)/release -endif - -ifndef V -LOG_CC = @echo " CC $@"; -LOG_CXX = @echo " CXX $@"; -LOG_AR = @echo " AR $@"; -LOG_LINK = @echo " LINK $@"; -endif - -OBJECTS := $(SOURCES:.cpp=.o) -OBJECTS := $(OBJECTS:.c=.o) -OBJECTS := $(subst ../,,$(OBJECTS)) -OBJECTS := $(subst $(COCOS_ROOT)/,,$(OBJECTS)) -OBJECTS := $(addprefix $(OBJ_DIR)/, $(OBJECTS)) -DEPS = $(OBJECTS:.o=.d) -CORE_MAKEFILE_LIST := $(MAKEFILE_LIST) --include $(DEPS) - -STATICLIBS_DIR = $(COCOS_SRC)/platform/third_party/emscripten/libraries -STATICLIBS = \ - $(STATICLIBS_DIR)/libpng.a \ - $(STATICLIBS_DIR)/libz.a \ - $(STATICLIBS_DIR)/libtiff.a \ - $(STATICLIBS_DIR)/libjpeg.a \ - $(STATICLIBS_DIR)/libwebp.a - -SHAREDLIBS += -L$(LIB_DIR) -Wl,-rpath,$(RPATH_REL)/$(LIB_DIR) -LIBS = -lrt -lz - -HTMLTPL_DIR = $(COCOS_ROOT)/tools/emscripten-templates/basic -HTMLTPL_FILE = index.html - -clean: - rm -rf $(OBJ_DIR) - rm -rf $(TARGET).js $(TARGET).data $(TARGET).data.js $(BIN_DIR) core - -.PHONY: all clean - -# If the parent Makefile defines $(EXECUTABLE) then define this as the target -# and create a 'make run' rule to run the app. -ifdef EXECUTABLE -TARGET := $(BIN_DIR)/$(EXECUTABLE) - -all: $(TARGET).js $(TARGET).data $(BIN_DIR)/$(HTMLTPL_FILE) - -run: $(TARGET) - cd $(dir $^) && ./$(notdir $^) - -.PHONY: run -endif diff --git a/cocos2dx/proj.nacl/Makefile b/cocos2dx/proj.nacl/Makefile deleted file mode 100644 index 1673111b15..0000000000 --- a/cocos2dx/proj.nacl/Makefile +++ /dev/null @@ -1,160 +0,0 @@ -COCOS_ROOT = ../.. -COCOS_SRC_ROOT = $(COCOS_ROOT)/cocos2dx - -INCLUDES = \ - -I$(NACL_SDK_ROOT)/include - -SOURCES = ../actions/CCAction.cpp \ -../actions/CCActionCamera.cpp \ -../actions/CCActionEase.cpp \ -../actions/CCActionGrid.cpp \ -../actions/CCActionGrid3D.cpp \ -../actions/CCActionInstant.cpp \ -../actions/CCActionInterval.cpp \ -../actions/CCActionManager.cpp \ -../actions/CCActionPageTurn3D.cpp \ -../actions/CCActionProgressTimer.cpp \ -../actions/CCActionTiledGrid.cpp \ -../actions/CCActionCatmullRom.cpp \ -../actions/CCActionTween.cpp \ -../base_nodes/CCAtlasNode.cpp \ -../base_nodes/CCNode.cpp \ -../cocoa/CCAffineTransform.cpp \ -../cocoa/CCAutoreleasePool.cpp \ -../cocoa/CCGeometry.cpp \ -../cocoa/CCNS.cpp \ -../cocoa/CCObject.cpp \ -../cocoa/CCSet.cpp \ -../cocoa/CCArray.cpp \ -../cocoa/CCDictionary.cpp \ -../cocoa/CCString.cpp \ -../cocoa/CCDataVisitor.cpp \ -../cocoa/CCData.cpp \ -../draw_nodes/CCDrawingPrimitives.cpp \ -../draw_nodes/CCDrawNode.cpp \ -../effects/CCGrabber.cpp \ -../effects/CCGrid.cpp \ -../event_dispatcher/CCEventAcceleration.cpp \ -../event_dispatcher/CCEventListenerAcceleration.cpp \ -../event_dispatcher/CCEvent.cpp \ -../event_dispatcher/CCEventDispatcher.cpp \ -../event_dispatcher/CCEventListener.cpp \ -../event_dispatcher/CCEventKeyboard.cpp \ -../event_dispatcher/CCEventListenerKeyboard.cpp \ -../event_dispatcher/CCTouch.cpp \ -../event_dispatcher/CCEventTouch.cpp \ -../event_dispatcher/CCEventListenerTouch.cpp \ -../event_dispatcher/CCEventCustom.cpp \ -../event_dispatcher/CCEventListenerCustom.cpp \ -../label_nodes/CCLabelAtlas.cpp \ -../label_nodes/CCLabelBMFont.cpp \ -../label_nodes/CCLabelTTF.cpp \ -../layers_scenes_transitions_nodes/CCLayer.cpp \ -../layers_scenes_transitions_nodes/CCScene.cpp \ -../layers_scenes_transitions_nodes/CCTransition.cpp \ -../layers_scenes_transitions_nodes/CCTransitionPageTurn.cpp \ -../layers_scenes_transitions_nodes/CCTransitionProgress.cpp \ -../menu_nodes/CCMenu.cpp \ -../menu_nodes/CCMenuItem.cpp \ -../misc_nodes/CCMotionStreak.cpp \ -../misc_nodes/CCProgressTimer.cpp \ -../misc_nodes/CCClippingNode.cpp \ -../misc_nodes/CCRenderTexture.cpp \ -../particle_nodes/CCParticleExamples.cpp \ -../particle_nodes/CCParticleSystem.cpp \ -../particle_nodes/CCParticleSystemQuad.cpp \ -../particle_nodes/CCParticleBatchNode.cpp \ -../platform/CCSAXParser.cpp \ -../platform/CCThread.cpp \ -../platform/CCImageCommonWebp.cpp \ -../platform/CCEGLViewProtocol.cpp \ -../platform/CCFileUtils.cpp \ -../platform/nacl/CCCommon.cpp \ -../platform/nacl/CCDevice.cpp \ -../platform/nacl/CCFileUtilsNaCl.cpp \ -../platform/nacl/CCApplication.cpp \ -../platform/nacl/CCEGLView.cpp \ -../platform/nacl/CCImage.cpp \ -../platform/nacl/CCInstance.cpp \ -../script_support/CCScriptSupport.cpp \ -../sprite_nodes/CCAnimation.cpp \ -../sprite_nodes/CCAnimationCache.cpp \ -../sprite_nodes/CCSprite.cpp \ -../sprite_nodes/CCSpriteBatchNode.cpp \ -../sprite_nodes/CCSpriteFrame.cpp \ -../sprite_nodes/CCSpriteFrameCache.cpp \ -../support/tinyxml2/tinyxml2.cpp \ -../support/CCProfiling.cpp \ -../support/user_default/CCUserDefault.cpp \ -../support/TransformUtils.cpp \ -../support/base64.cpp \ -../support/ccUtils.cpp \ -../support/ccUTF8.cpp \ -../support/CCVertex.cpp \ -../support/CCNotificationCenter.cpp \ -../support/image_support/TGAlib.cpp \ -../support/zip_support/ZipUtils.cpp \ -../support/zip_support/ioapi.cpp \ -../support/zip_support/unzip.cpp \ -../support/data_support/ccCArray.cpp \ -../support/component/CCComponent.cpp \ -../support/component/CCComponentContainer.cpp \ -../text_input_node/CCIMEDispatcher.cpp \ -../text_input_node/CCTextFieldTTF.cpp \ -../textures/CCTexture2D.cpp \ -../textures/CCTextureAtlas.cpp \ -../textures/CCTextureCache.cpp \ -../textures/CCTextureETC.cpp \ -../textures/CCTexturePVR.cpp \ -../textures/etc/etc1.cpp\ -../tilemap_parallax_nodes/CCParallaxNode.cpp \ -../tilemap_parallax_nodes/CCTMXLayer.cpp \ -../tilemap_parallax_nodes/CCTMXObjectGroup.cpp \ -../tilemap_parallax_nodes/CCTMXTiledMap.cpp \ -../tilemap_parallax_nodes/CCTMXXMLParser.cpp \ -../tilemap_parallax_nodes/CCTileMapAtlas.cpp \ -../shaders/CCGLProgram.cpp \ -../shaders/ccGLStateCache.cpp \ -../shaders/CCShaderCache.cpp \ -../shaders/ccShaders.cpp \ -../kazmath/src/aabb.c \ -../kazmath/src/plane.c \ -../kazmath/src/vec2.c \ -../kazmath/src/mat3.c \ -../kazmath/src/quaternion.cpp \ -../kazmath/src/vec3.cpp \ -../kazmath/src/mat4.cpp \ -../kazmath/src/ray2.cpp \ -../kazmath/src/vec4.cpp \ -../kazmath/src/neon_matrix_impl.cpp \ -../kazmath/src/utility.cpp \ -../kazmath/src/GL/mat4stack.cpp \ -../kazmath/src/GL/matrix.cpp \ -../CCCamera.cpp \ -../CCConfiguration.cpp \ -../CCDirector.cpp \ -../CCScheduler.cpp \ -../ccFPSImages.c \ -../ccTypes.cpp \ -../cocos2d.cpp \ -../CCDeprecated.cpp - -include cocos2dx.mk - -CXXFLAGS += -Wno-sequence-point - -TARGET = $(LIB_DIR)/libcocos2d.a - -all: $(TARGET) - -$(TARGET): $(OBJECTS) $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(LOG_AR)$(NACL_AR) $(ARFLAGS) $@ $(OBJECTS) - -$(OBJ_DIR)/%.o: ../%.cpp $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(LOG_CXX)$(NACL_CXX) -MMD $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@ - -$(OBJ_DIR)/%.o: ../%.c $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(LOG_CC)$(NACL_CC) -MMD $(CCFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@ diff --git a/cocos2dx/proj.nacl/cocos2dx.mk b/cocos2dx/proj.nacl/cocos2dx.mk deleted file mode 100644 index 5cbb457c43..0000000000 --- a/cocos2dx/proj.nacl/cocos2dx.mk +++ /dev/null @@ -1,139 +0,0 @@ -# This makefile is included by each of the cocos2d-x libraries and examples -# when building for Native Client. It defines a set of variables that all -# cocos2dx projects have in common. - -ifeq ($(NACL_SDK_ROOT),) - $(error $$NACL_SDK_ROOT not set) -endif - -NACL_SDK_VERSION_MIN=27.186236 -VERSION_CHECK:=$(shell $(NACL_SDK_ROOT)/tools/getos.py --check-version=$(NACL_SDK_VERSION_MIN) 2>&1) -ifneq ($(VERSION_CHECK),) - $(error $(VERSION_CHECK)) -endif - -all: - -ifeq ($(NACL_GLIBC),1) -NACL_LIBC = glibc -else -NACL_LIBC = newlib -endif - -NACL_ARCH ?= x86_64 -NACL_AR ?= $(NACL_ARCH)-nacl-ar -NACL_CC ?= $(NACL_ARCH)-nacl-gcc -NACL_CXX ?= $(NACL_ARCH)-nacl-g++ -CCFLAGS += -Wall -Werror -Wno-deprecated-declarations -# GCC 4.6 is primary platform for cocos2d v.3, because it's default compiler for Android, -# Blackberry, some Linux distributions.It supports all important features of c++11, but have -# no flag "-std=c++11" (which was turned on in version 4.7). -CXXFLAGS += -Wall -Werror -Wno-deprecated-declarations -std=gnu++0x -ARFLAGS = cr - -THIS_MAKEFILE := $(CURDIR)/$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) - -# The top level of the cocos2dx-x source tree. The parent Makefile will -# often define this, but in case is doesn't we can find it relative to -# THIS_MAKEFILE -ifndef COCOS_ROOT -COCOS_ROOT := $(realpath $(dir $(THIS_MAKEFILE))/../..) -endif -COCOS_SRC := $(COCOS_ROOT)/cocos2dx - -ifeq ($(NACL_ARCH), i686) -ARCH_DIR := $(NACL_LIBC)_x86_32 -else -ARCH_DIR := $(NACL_LIBC)_$(NACL_ARCH) -endif - -NACLPORTS_ROOT ?= $(NACL_SDK_ROOT)/ports -NACLPORTS_INCLUDE ?= $(NACLPORTS_ROOT)/include -OUT_DIR ?= obj -OBJ_DIR ?= $(OUT_DIR)/$(NACL_ARCH) -LIB_DIR ?= $(COCOS_ROOT)/lib/nacl/$(ARCH_DIR) - -NMF_FLAGS = --objdump=i686-nacl-objdump -NMF_FLAGS += -L$(NACL_SDK_ROOT)/toolchain/linux_x86_$(NACL_LIBC)/x86_64-nacl/lib32/ -NMF_FLAGS += -L$(NACL_SDK_ROOT)/toolchain/linux_x86_$(NACL_LIBC)/x86_64-nacl/lib64/ -NMF_FLAGS += -L$(NACL_SDK_ROOT)/lib/$(NACL_LIBC)_x86_32/Release -NMF_FLAGS += -L$(NACL_SDK_ROOT)/lib/$(NACL_LIBC)_x86_64/Release -NMF_FLAGS += -L$(NACLPORTS_ROOT)/lib/$(NACL_LIBC)_x86_32/Release -NMF_FLAGS += -L$(NACLPORTS_ROOT)/lib/$(NACL_LIBC)_x86_64/Release - -ifdef USE_BOX2D -DEFINES += -DCC_ENABLE_BOX2D_INTEGRATION=1 -else -DEFINES += -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 -endif - -INCLUDES += -I$(COCOS_SRC) \ - -I$(COCOS_SRC)/cocoa \ - -I$(COCOS_SRC)/include \ - -I$(COCOS_SRC)/kazmath/include \ - -I$(COCOS_SRC)/platform \ - -I$(COCOS_SRC)/platform/nacl \ - -I$(NACL_SDK_ROOT)/include \ - -isystem $(NACLPORTS_INCLUDE) \ - -isystem $(NACLPORTS_INCLUDE)/libxml2 - -ifeq ($(DEBUG), 1) -BIN_DIR = bin/debug -CCFLAGS += -g3 -O0 -CXXFLAGS += -g3 -O0 -LIB_DIR := $(LIB_DIR)/Debug -OBJ_DIR := $(OBJ_DIR)/Debug -MULTILIB_SUFFIX := $(ARCH_DIR)/Debug -DEFINES += -D_DEBUG -DCOCOS2D_DEBUG=1 -else -BIN_DIR = bin/release -CCFLAGS += -O3 -CXXFLAGS += -O3 -LIB_DIR := $(LIB_DIR)/Release -OBJ_DIR := $(OBJ_DIR)/Release -MULTILIB_SUFFIX := $(ARCH_DIR)/Release -DEFINES += -DNDEBUG -endif - -ifndef V -LOG_CC = @echo " CC $@"; -LOG_CXX = @echo " CXX $@"; -LOG_AR = @echo " AR $@"; -LOG_LINK = @echo " LINK $@"; -endif - -# The default library search path consists of the cocos2dx library path, the -# main nacl sdk library path and the naclports library path. -LDFLAGS += -L$(LIB_DIR) -LDFLAGS += -L$(NACL_SDK_ROOT)/lib/$(MULTILIB_SUFFIX) -LDFLAGS += -L$(NACLPORTS_ROOT)/lib/$(MULTILIB_SUFFIX) - -# Some cococs sources use #pragma mark -CCFLAGS += -Wno-unknown-pragmas -CXXFLAGS += -Wno-unknown-pragmas - -ifeq ($(NACL_ARCH),arm) -# Don't warn about mangling of 'va_list' on arm builds -CCFLAGS += -Wno-psabi -CXXFLAGS += -Wno-psabi -endif - -SOUNDLIBS := -lalut -lopenal -lvorbisfile -lvorbis -logg -STATICLIBS += $(SOUNDLIBS) -lfreetype -lxml2 -lwebp -lpng -ljpeg -ltiff -llua -lchipmunk -STATICLIBS += -lnacl_io -lppapi_gles2 -lppapi -lppapi_cpp -SHAREDLIBS += -lpthread -lcocosdenshion -lcocos2d -lz - -OBJECTS := $(SOURCES:.cpp=.o) -OBJECTS := $(OBJECTS:.c=.o) -OBJECTS := $(subst ../,,$(OBJECTS)) -OBJECTS := $(subst $(COCOS_ROOT)/,,$(OBJECTS)) -OBJECTS := $(addprefix $(OBJ_DIR)/, $(OBJECTS)) -DEPS = $(OBJECTS:.o=.d) -CORE_MAKEFILE_LIST := $(MAKEFILE_LIST) --include $(DEPS) - -clean: - rm -rf $(OBJ_DIR) - rm -f $(TARGET) core - -.PHONY: all clean diff --git a/cocos2dx/proj.qt5/cocos2dx.pro b/cocos2dx/proj.qt5/cocos2dx.pro deleted file mode 100644 index b849d745ba..0000000000 --- a/cocos2dx/proj.qt5/cocos2dx.pro +++ /dev/null @@ -1,170 +0,0 @@ - -include(common.pri) - -TEMPLATE = lib - -# Uncomment the following line to build Cocos2D-X as static library -#CONFIG += static - -LIBS += $${COCOS2DX_SYSTEM_LIBS} - -#SOURCES += $$files(../Collision/*.cpp) - -SOURCES += ../actions/CCAction.cpp \ -../actions/CCActionCamera.cpp \ -../actions/CCActionEase.cpp \ -../actions/CCActionGrid.cpp \ -../actions/CCActionGrid3D.cpp \ -../actions/CCActionInstant.cpp \ -../actions/CCActionInterval.cpp \ -../actions/CCActionManager.cpp \ -../actions/CCActionPageTurn3D.cpp \ -../actions/CCActionProgressTimer.cpp \ -../actions/CCActionTiledGrid.cpp \ -../actions/CCActionCatmullRom.cpp \ -../actions/CCActionTween.cpp \ -../base_nodes/CCAtlasNode.cpp \ -../base_nodes/CCNode.cpp \ -../cocoa/CCAffineTransform.cpp \ -../cocoa/CCAutoreleasePool.cpp \ -../cocoa/CCGeometry.cpp \ -../cocoa/CCNS.cpp \ -../cocoa/CCObject.cpp \ -../cocoa/CCSet.cpp \ -../cocoa/CCArray.cpp \ -../cocoa/CCDictionary.cpp \ -../cocoa/CCString.cpp \ -../cocoa/CCDataVisitor.cpp \ -../cocoa/CCData.cpp \ -../draw_nodes/CCDrawingPrimitives.cpp \ -../draw_nodes/CCDrawNode.cpp \ -../effects/CCGrabber.cpp \ -../effects/CCGrid.cpp \ -../event_dispatcher/CCAccelerationEvent.cpp \ -../event_dispatcher/CCAccelerationEventListener.cpp \ -../event_dispatcher/CCEvent.cpp \ -../event_dispatcher/CCEventDispatcher.cpp \ -../event_dispatcher/CCEventListener.cpp \ -../event_dispatcher/CCKeyboardEvent.cpp \ -../event_dispatcher/CCKeyboardEventListener.cpp \ -../event_dispatcher/CCTouch.cpp \ -../event_dispatcher/CCTouchEvent.cpp \ -../event_dispatcher/CCTouchEventListener.cpp \ -../event_dispatcher/CCCustomEvent.cpp \ -../event_dispatcher/CCCustomEventListener.cpp \ -../label_nodes/CCLabelAtlas.cpp \ -../label_nodes/CCLabelBMFont.cpp \ -../label_nodes/CCLabelTTF.cpp \ -../layers_scenes_transitions_nodes/CCLayer.cpp \ -../layers_scenes_transitions_nodes/CCScene.cpp \ -../layers_scenes_transitions_nodes/CCTransition.cpp \ -../layers_scenes_transitions_nodes/CCTransitionPageTurn.cpp \ -../layers_scenes_transitions_nodes/CCTransitionProgress.cpp \ -../menu_nodes/CCMenu.cpp \ -../menu_nodes/CCMenuItem.cpp \ -../misc_nodes/CCMotionStreak.cpp \ -../misc_nodes/CCProgressTimer.cpp \ -../misc_nodes/CCClippingNode.cpp \ -../misc_nodes/CCRenderTexture.cpp \ -../particle_nodes/CCParticleExamples.cpp \ -../particle_nodes/CCParticleSystem.cpp \ -../particle_nodes/CCParticleSystemQuad.cpp \ -../particle_nodes/CCParticleBatchNode.cpp \ -../platform/CCSAXParser.cpp \ -../platform/CCThread.cpp \ -../platform/CCEGLViewProtocol.cpp \ -../platform/CCFileUtils.cpp \ -../platform/qt5/CCCommon.cpp \ -../platform/qt5/CCFileUtilsQt5.cpp \ -../platform/qt5/CCEGLView.cpp \ -../platform/qt5/CCDevice.cpp \ -../platform/qt5/CCApplication.cpp \ -../platform/qt5/CCAccelerometer.cpp \ -../platform/qt5/AccelerometerListener.cpp \ -../platform/linux/CCImage.cpp \ -../script_support/CCScriptSupport.cpp \ -../sprite_nodes/CCAnimation.cpp \ -../sprite_nodes/CCAnimationCache.cpp \ -../sprite_nodes/CCSprite.cpp \ -../sprite_nodes/CCSpriteBatchNode.cpp \ -../sprite_nodes/CCSpriteFrame.cpp \ -../sprite_nodes/CCSpriteFrameCache.cpp \ -../support/ccUTF8.cpp \ -../support/CCProfiling.cpp \ -../support/user_default/CCUserDefault.cpp \ -../support/TransformUtils.cpp \ -../support/base64.cpp \ -../support/ccUtils.cpp \ -../support/CCVertex.cpp \ -../support/CCNotificationCenter.cpp \ -../support/image_support/TGAlib.cpp \ -../support/tinyxml2/tinyxml2.cpp \ -../support/zip_support/ZipUtils.cpp \ -../support/zip_support/ioapi.cpp \ -../support/zip_support/unzip.cpp \ -../support/data_support/ccCArray.cpp \ -../support/component/CCComponent.cpp \ -../support/component/CCComponentContainer.cpp \ -../text_input_node/CCIMEDispatcher.cpp \ -../text_input_node/CCTextFieldTTF.cpp \ -../textures/CCTexture2D.cpp \ -../textures/CCTextureAtlas.cpp \ -../textures/CCTextureCache.cpp \ -../platform/third_party/common/etc/etc1.cpp \ -../tilemap_parallax_nodes/CCParallaxNode.cpp \ -../tilemap_parallax_nodes/CCTMXLayer.cpp \ -../tilemap_parallax_nodes/CCTMXObjectGroup.cpp \ -../tilemap_parallax_nodes/CCTMXTiledMap.cpp \ -../tilemap_parallax_nodes/CCTMXXMLParser.cpp \ -../tilemap_parallax_nodes/CCTileMapAtlas.cpp \ -../shaders/CCGLProgram.cpp \ -../shaders/ccGLStateCache.cpp \ -../shaders/CCShaderCache.cpp \ -../shaders/ccShaders.cpp \ -../kazmath/src/aabb.c \ -../kazmath/src/plane.c \ -../kazmath/src/vec2.c \ -../kazmath/src/mat3.c \ -../kazmath/src/quaternion.c \ -../kazmath/src/vec3.c \ -../kazmath/src/mat4.c \ -../kazmath/src/ray2.c \ -../kazmath/src/vec4.c \ -../kazmath/src/neon_matrix_impl.c \ -../kazmath/src/utility.c \ -../kazmath/src/GL/mat4stack.c \ -../kazmath/src/GL/matrix.c \ -../CCCamera.cpp \ -../CCConfiguration.cpp \ -../CCDirector.cpp \ -../CCScheduler.cpp \ -../ccFPSImages.c \ -../ccTypes.cpp \ -../cocos2d.cpp - -# Headers with QObject subclasses (will be processed by moc) -HEADERS += ../platform/qt5/AccelerometerListener.h - -# WebP -INCLUDEPATH += ../../external/libwebp/webp -SOURCES += $$files(../../external/libwebp/dec/*.c) -SOURCES += $$files(../../external/libwebp/dsp/*.c) -SOURCES += $$files(../../external/libwebp/utils/*.c) - -# FreeType (FIXME: use pkg-config) -INCLUDEPATH += /usr/include/freetype2 - -INCLUDEPATH += ../../extensions -INCLUDEPATH += ../../extensions/CCBReader -INCLUDEPATH += ../../extensions/GUI/CCControlExtension -INCLUDEPATH += ../../extensions/GUI/CCControlExtension -INCLUDEPATH += ../../external/chipmunk/include/chipmunk -INCLUDEPATH += ../../extensions/network -INCLUDEPATH += ../../extensions/Components -INCLUDEPATH += ../platform/third_party/common/etc - -TARGET = $${LIB_OUTPUT_DIR}/cocos2d - -INSTALLS += target -target.path = $${LIB_INSTALL_DIR} - diff --git a/cocos2dx/proj.qt5/common.pri b/cocos2dx/proj.qt5/common.pri deleted file mode 100644 index c9555f4d2a..0000000000 --- a/cocos2dx/proj.qt5/common.pri +++ /dev/null @@ -1,61 +0,0 @@ - -DEFINES += CC_TARGET_QT5 - -CONFIG += silent - -# Disable some warnings to make compiler output easier to read during development -DISABLED_WARNINGS = -Wno-ignored-qualifiers -Wno-unused-parameter -Wno-psabi -QMAKE_CXXFLAGS += $${DISABLED_WARNINGS} -Wno-reorder -QMAKE_CFLAGS += $${DISABLED_WARNINGS} - -# C++11 support (Pick the first one if you have an old GCC version) -#QMAKE_CXXFLAGS += -Doverride= -std=c++0x -CONFIG += c++11 - -OS_TYPE = linux - -CONFIG(debug, debug|release) { - BUILD_TYPE = debug -} else { - BUILD_TYPE = release -} - -OBJECTS_DIR = obj/$${BUILD_TYPE} -MOC_DIR = obj/$${BUILD_TYPE} -LIB_OUTPUT_DIR = $${PWD}/../../lib/$${OS_TYPE}/$${BUILD_TYPE} - -# Installation location of binaries -LIB_INSTALL_DIR = /usr/lib -BIN_INSTALL_DIR = /usr/bin -DESKTOP_INSTALL_DIR = /usr/share/applications - -INCLUDEPATH += $${PWD}/.. -INCLUDEPATH += $${PWD}/../include -INCLUDEPATH += $${PWD}/../platform -INCLUDEPATH += $${PWD}/../platform/qt5 -INCLUDEPATH += $${PWD}/../kazmath/include - -COCOS2DX_SYSTEM_LIBS += -lz -COCOS2DX_SYSTEM_LIBS += -ljpeg -ltiff -lpng -COCOS2DX_SYSTEM_LIBS += -lfontconfig -lfreetype - -# Sensors module needed for CCAccelerometer -QT += sensors - -LINK_AGAINST_COCOS2DX = -L$${LIB_OUTPUT_DIR} -lcocos2d $${COCOS2DX_SYSTEM_LIBS} - -# CocosDenshion (audio library) -QT += multimedia -INCLUDEPATH += $${PWD}/../../CocosDenshion/include -LINK_AGAINST_COCOSDENSHION = -lcocosdenshion - -# Extensions library -INCLUDEPATH += $${PWD}/../../extensions -LINK_AGAINST_COCOSEXTENSION = -lextension -lbox2d -lchipmunk -lcurl - -# Physics engines (pick one) -DEFINES += CC_ENABLE_CHIPMUNK_INTEGRATION -#DEFINES += CC_ENABLE_BOX2D_INTEGRATION -INCLUDEPATH += $${PWD}/../../external/chipmunk/include/chipmunk -INCLUDEPATH += $${PWD}/../../external - diff --git a/cocos2dx/proj.tizen/.cproject b/cocos2dx/proj.tizen/.cproject deleted file mode 100644 index 15f6ac3fe2..0000000000 --- a/cocos2dx/proj.tizen/.cproject +++ /dev/null @@ -1,392 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage"> - <storageModule moduleId="org.eclipse.cdt.core.settings"> - <cconfiguration id="org.tizen.nativecpp.config.sbi.gcc45.lib.debug.emulator.1855378280"> - <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="org.tizen.nativecpp.config.sbi.gcc45.lib.debug.emulator.1855378280" moduleId="org.eclipse.cdt.core.settings" name="Debug-Tizen-Emulator"> - <macros> - <stringMacro name="COCOS_ROOT" type="VALUE_PATH_ANY" value="../../.."/> - <stringMacro name="COCOS_SRC" type="VALUE_PATH_ANY" value="${COCOS_ROOT}/cocos2dx"/> - </macros> - <externalSettings/> - <extensions> - <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/> - <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - </extensions> - </storageModule> - <storageModule moduleId="cdtBuildSystem" version="4.0.0"> - <configuration artifactExtension="a" artifactName="cocos2d" buildArtefactType="org.tizen.nativecpp.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.tizen.nativecpp.buildArtefactType.staticLib" cleanCommand="rm -f" description="" errorParsers="org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;" id="org.tizen.nativecpp.config.sbi.gcc45.lib.debug.emulator.1855378280" name="Debug-Tizen-Emulator" parent="org.tizen.nativecpp.config.sbi.gcc45.lib.debug.emulator"> - <folderInfo id="org.tizen.nativecpp.config.sbi.gcc45.lib.debug.emulator.1855378280." name="/" resourcePath=""> - <toolChain id="org.tizen.nativecpp.toolchain.sbi.gcc45.lib.debug.emulator.2014007899" name="Tizen Native Toolchain" superClass="org.tizen.nativecpp.toolchain.sbi.gcc45.lib.debug.emulator"> - <targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="org.tizen.nativeide.target.sbi.gnu.platform.base.1067387441" osList="linux,win32" superClass="org.tizen.nativeide.target.sbi.gnu.platform.base"/> - <builder autoBuildTarget="all" buildPath="${workspace_loc:/cocos2dx/Debug-Tizen-Emulator}" enableAutoBuild="true" id="org.tizen.nativecpp.target.sbi.gnu.builder.1261707379" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Tizen Application Builder" superClass="org.tizen.nativecpp.target.sbi.gnu.builder"> - <outputEntries> - <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="Debug-Tizen-Emulator"/> - <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="Debug-Tizen-Device"/> - <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="Release"/> - </outputEntries> - </builder> - <tool command="i386-linux-gnueabi-ar.exe" id="org.tizen.nativecpp.tool.sbi.gnu.archiver.689316005" name="Archiver" superClass="org.tizen.nativecpp.tool.sbi.gnu.archiver"/> - <tool command="i386-linux-gnueabi-g++.exe" id="org.tizen.nativecpp.tool.sbi.gnu.cpp.compiler.1533358351" name="C++ Compiler" superClass="org.tizen.nativecpp.tool.sbi.gnu.cpp.compiler"> - <option id="gnu.cpp.compiler.option.optimization.level.1726560828" name="Optimization Level" superClass="gnu.cpp.compiler.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/> - <option id="sbi.gnu.cpp.compiler.option.debugging.level.1554282679" name="Debug level" superClass="sbi.gnu.cpp.compiler.option.debugging.level" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/> - <option id="sbi.gnu.cpp.compiler.option.debug.applog.1800109419" name="Enable application logging (-D_APP_LOG)" superClass="sbi.gnu.cpp.compiler.option.debug.applog" value="true" valueType="boolean"/> - <option id="sbi.gnu.cpp.compiler.option.796499718" name="Tizen-Target" superClass="sbi.gnu.cpp.compiler.option" valueType="userObjs"> - <listOptionValue builtIn="false" value="tizen-emulator-2.2.native_gcc45.i386.cpp.staticLib"/> - </option> - <option id="gnu.cpp.compiler.option.include.paths.1887202981" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath"> - <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/inc}""/> - <listOptionValue builtIn="false" value=""${COCOS_SRC}""/> - <listOptionValue builtIn="false" value=""${COCOS_SRC}/include""/> - <listOptionValue builtIn="false" value=""${COCOS_SRC}/kazmath/include""/> - <listOptionValue builtIn="false" value=""${COCOS_SRC}/platform/tizen""/> - <listOptionValue builtIn="false" value=""${COCOS_SRC}/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include""/> - <listOptionValue builtIn="false" value=""${COCOS_SRC}/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/freetype2""/> - <listOptionValue builtIn="false" value=""${COCOS_SRC}/platform/third_party/tizen/prebuilt/libwebp/include""/> - <listOptionValue builtIn="false" value=""${COCOS_SRC}/platform/third_party/common/etc""/> - <listOptionValue builtIn="false" value=""${COCOS_SRC}/platform/third_party/common/s3tc""/> - </option> - <option id="sbi.gnu.cpp.compiler.option.frameworks.cpp.140749819" name="Tizen-Frameworks" superClass="sbi.gnu.cpp.compiler.option.frameworks.cpp" valueType="userObjs"> - <listOptionValue builtIn="false" value="osp-static"/> - </option> - <option id="sbi.gnu.cpp.compiler.option.frameworks_inc.cpp.1250550482" name="Tizen-Frameworks-Include-Path" superClass="sbi.gnu.cpp.compiler.option.frameworks_inc.cpp" valueType="includePath"> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/libxml2""/> - <listOptionValue builtIn="false" value=""C:\tizen-sdk\library""/> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include""/> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/osp""/> - </option> - <option id="sbi.gnu.cpp.compiler.option.frameworks_cflags.cpp.1942713160" name="Tizen-Frameworks-Other-Cflags" superClass="sbi.gnu.cpp.compiler.option.frameworks_cflags.cpp" valueType="stringList"> - <listOptionValue builtIn="false" value=" -fPIC"/> - <listOptionValue builtIn="false" value="--sysroot="${SBI_SYSROOT}""/> - </option> - <option id="gnu.cpp.compiler.option.preprocessor.def.67860287" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" valueType="definedSymbols"> - <listOptionValue builtIn="false" value="_DEBUG"/> - <listOptionValue builtIn="false" value="TIZEN"/> - </option> - <option id="gnu.cpp.compiler.option.other.other.1776792220" name="Other flags" superClass="gnu.cpp.compiler.option.other.other" value="-c -fmessage-length=0 -std=c++0x" valueType="string"/> - <inputType id="sbi.gnu.cpp.compiler.tizen.inputType.2085750802" superClass="sbi.gnu.cpp.compiler.tizen.inputType"/> - </tool> - <tool command="i386-linux-gnueabi-gcc.exe" id="org.tizen.nativecpp.tool.sbi.gnu.c.compiler.263460224" name="C Compiler" superClass="org.tizen.nativecpp.tool.sbi.gnu.c.compiler"> - <option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.option.optimization.level.819197061" name="Optimization Level" superClass="gnu.c.compiler.option.optimization.level" valueType="enumerated"/> - <option id="sbi.gnu.c.compiler.option.debugging.level.709891206" name="Debug level" superClass="sbi.gnu.c.compiler.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/> - <option id="sbi.gnu.c.compiler.option.debug.applog.1166511754" name="Enable application logging (-D_APP_LOG)" superClass="sbi.gnu.c.compiler.option.debug.applog" value="true" valueType="boolean"/> - <option id="sbi.gnu.c.compiler.option.1738169580" name="Tizen-Target" superClass="sbi.gnu.c.compiler.option" valueType="userObjs"> - <listOptionValue builtIn="false" value="tizen-emulator-2.2.native_gcc45.i386.cpp.staticLib"/> - </option> - <option id="gnu.c.compiler.option.include.paths.821405214" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath"> - <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/inc}""/> - <listOptionValue builtIn="false" value=""${COCOS_SRC}""/> - <listOptionValue builtIn="false" value=""${COCOS_SRC}/include""/> - <listOptionValue builtIn="false" value=""${COCOS_SRC}/kazmath/include""/> - <listOptionValue builtIn="false" value=""${COCOS_SRC}/platform/tizen""/> - </option> - <option id="sbi.gnu.c.compiler.option.frameworks.cpp.229730784" name="Tizen-Frameworks" superClass="sbi.gnu.c.compiler.option.frameworks.cpp" valueType="userObjs"> - <listOptionValue builtIn="false" value="osp-static"/> - </option> - <option id="sbi.gnu.c.compiler.option.frameworks_inc.cpp.1139638882" name="Tizen-Frameworks-Include-Path" superClass="sbi.gnu.c.compiler.option.frameworks_inc.cpp" valueType="includePath"> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/libxml2""/> - <listOptionValue builtIn="false" value=""C:\tizen-sdk\library""/> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include""/> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/osp""/> - </option> - <option id="sbi.gnu.c.compiler.option.frameworks_cflags.cpp.1131449804" name="Tizen-Frameworks-Other-Cflags" superClass="sbi.gnu.c.compiler.option.frameworks_cflags.cpp" valueType="stringList"> - <listOptionValue builtIn="false" value=" -fPIC"/> - <listOptionValue builtIn="false" value="--sysroot="${SBI_SYSROOT}""/> - </option> - <option id="gnu.c.compiler.option.preprocessor.def.symbols.31661523" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" valueType="definedSymbols"> - <listOptionValue builtIn="false" value="_DEBUG"/> - <listOptionValue builtIn="false" value="TIZEN"/> - </option> - <inputType id="sbi.gnu.c.compiler.tizen.inputType.94264147" superClass="sbi.gnu.c.compiler.tizen.inputType"/> - </tool> - <tool id="org.tizen.nativeide.tool.sbi.gnu.c.linker.base.792552065" name="C Linker" superClass="org.tizen.nativeide.tool.sbi.gnu.c.linker.base"/> - <tool command="i386-linux-gnueabi-g++.exe" id="org.tizen.nativecpp.tool.sbi.gnu.cpp.linker.1518096171" name="C++ Linker" superClass="org.tizen.nativecpp.tool.sbi.gnu.cpp.linker"> - <option id="gnu.cpp.link.option.paths.43791296" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths" valueType="libPaths"> - <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/lib}""/> - </option> - <option id="sbi.gnu.cpp.linker.option.frameworks_lflags.cpp.181465864" name="Tizen-Frameworks-Other-Lflags" superClass="sbi.gnu.cpp.linker.option.frameworks_lflags.cpp" valueType="stringList"> - <listOptionValue builtIn="false" value="--sysroot="${SBI_SYSROOT}""/> - <listOptionValue builtIn="false" value="-Xlinker -rpath="/opt/usr/apps/null/lib""/> - </option> - </tool> - <tool command="i386-linux-gnueabi-as.exe" id="org.tizen.nativeapp.tool.sbi.gnu.assembler.base.165476943" name="Assembler" superClass="org.tizen.nativeapp.tool.sbi.gnu.assembler.base"> - <option id="gnu.both.asm.option.include.paths.2122175404" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths" valueType="includePath"> - <listOptionValue builtIn="false" value="C:/Users/pyrasis/Desktop/cocos2d-x/cocos2dx"/> - <listOptionValue builtIn="false" value="C:/Users/pyrasis/Desktop/cocos2d-x/cocos2dx/include"/> - <listOptionValue builtIn="false" value="C:/Users/pyrasis/Desktop/cocos2d-x/cocos2dx/kazmath/include"/> - <listOptionValue builtIn="false" value="C:/Users/pyrasis/Desktop/cocos2d-x/cocos2dx/platform/tizen"/> - <listOptionValue builtIn="false" value="C:/Users/pyrasis/Desktop/cocos2d-x/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.0.cpp/usr/include"/> - <listOptionValue builtIn="false" value="C:/Users/pyrasis/Desktop/cocos2d-x/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.0.cpp/usr/include/freetype2"/> - <listOptionValue builtIn="false" value="C:/Users/pyrasis/Desktop/cocos2d-x/cocos2dx/platform/third_party/tizen/prebuilt/libwebp/include"/> - <listOptionValue builtIn="false" value="C:/tizen-sdk/platforms/tizen2.0/rootstraps/tizen-emulator-2.0.cpp/usr/include"/> - <listOptionValue builtIn="false" value="C:/tizen-sdk/platforms/tizen2.0/rootstraps/tizen-emulator-2.0.cpp/usr/include/libxml2"/> - <listOptionValue builtIn="false" value="C:/tizen-sdk/library"/> - <listOptionValue builtIn="false" value="C:/tizen-sdk/platforms/tizen2.0/rootstraps/tizen-emulator-2.0.cpp/usr/include/osp"/> - <listOptionValue builtIn="false" value="C:/Users/pyrasis/Desktop/cocos2d-x/cocos2dx/proj.tizen/proj.tizen/proj.tizen/inc"/> - </option> - <inputType id="cdt.managedbuild.tool.gnu.assembler.input.517365643" superClass="cdt.managedbuild.tool.gnu.assembler.input"/> - </tool> - <tool id="org.tizen.nativecpp.tool.sbi.po.compiler.254627421" name="PO Resource Compiler" superClass="org.tizen.nativecpp.tool.sbi.po.compiler"/> - <tool id="org.tizen.nativecpp.tool.sbi.edc.compiler.8480881" name="EDC Resource Compiler" superClass="org.tizen.nativecpp.tool.sbi.edc.compiler"/> - </toolChain> - </folderInfo> - </configuration> - </storageModule> - <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> - </cconfiguration> - <cconfiguration id="org.tizen.nativecpp.config.sbi.gcc45.lib.debug.device.1240851129"> - <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="org.tizen.nativecpp.config.sbi.gcc45.lib.debug.device.1240851129" moduleId="org.eclipse.cdt.core.settings" name="Debug-Tizen-Device"> - <macros> - <stringMacro name="COCOS_ROOT" type="VALUE_PATH_ANY" value="../../.."/> - <stringMacro name="COCOS_SRC" type="VALUE_PATH_ANY" value="${COCOS_ROOT}/cocos2dx"/> - </macros> - <externalSettings/> - <extensions> - <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/> - <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - </extensions> - </storageModule> - <storageModule moduleId="cdtBuildSystem" version="4.0.0"> - <configuration artifactExtension="a" artifactName="cocos2d" buildArtefactType="org.tizen.nativecpp.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.tizen.nativecpp.buildArtefactType.staticLib" cleanCommand="rm -f" description="" errorParsers="org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;" id="org.tizen.nativecpp.config.sbi.gcc45.lib.debug.device.1240851129" name="Debug-Tizen-Device" parent="org.tizen.nativecpp.config.sbi.gcc45.lib.debug.device"> - <folderInfo id="org.tizen.nativecpp.config.sbi.gcc45.lib.debug.device.1240851129." name="/" resourcePath=""> - <toolChain id="org.tizen.nativecpp.toolchain.sbi.gcc45.lib.debug.device.1011815399" name="Tizen Native Toolchain" superClass="org.tizen.nativecpp.toolchain.sbi.gcc45.lib.debug.device"> - <targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="org.tizen.nativeide.target.sbi.gnu.platform.base.205106495" osList="linux,win32" superClass="org.tizen.nativeide.target.sbi.gnu.platform.base"/> - <builder buildPath="${workspace_loc:/cocos2dx/Debug-Tizen-Device}" id="org.tizen.nativecpp.target.sbi.gnu.builder.391616426" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Tizen Application Builder" superClass="org.tizen.nativecpp.target.sbi.gnu.builder"/> - <tool command="arm-linux-gnueabi-ar.exe" id="org.tizen.nativecpp.tool.sbi.gnu.archiver.1946190238" name="Archiver" superClass="org.tizen.nativecpp.tool.sbi.gnu.archiver"/> - <tool command="arm-linux-gnueabi-g++.exe" id="org.tizen.nativecpp.tool.sbi.gnu.cpp.compiler.806237946" name="C++ Compiler" superClass="org.tizen.nativecpp.tool.sbi.gnu.cpp.compiler"> - <option id="gnu.cpp.compiler.option.optimization.level.1141078136" name="Optimization Level" superClass="gnu.cpp.compiler.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/> - <option id="sbi.gnu.cpp.compiler.option.debugging.level.412266760" name="Debug level" superClass="sbi.gnu.cpp.compiler.option.debugging.level" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/> - <option id="sbi.gnu.cpp.compiler.option.debug.applog.48357772" name="Enable application logging (-D_APP_LOG)" superClass="sbi.gnu.cpp.compiler.option.debug.applog" value="true" valueType="boolean"/> - <option id="sbi.gnu.cpp.compiler.option.738324429" name="Tizen-Target" superClass="sbi.gnu.cpp.compiler.option" valueType="userObjs"> - <listOptionValue builtIn="false" value="tizen-device-2.2.native_gcc45.armel.cpp.staticLib"/> - </option> - <option id="gnu.cpp.compiler.option.include.paths.1372067183" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath"> - <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/inc}""/> - <listOptionValue builtIn="false" value=""${COCOS_SRC}""/> - <listOptionValue builtIn="false" value=""${COCOS_SRC}/include""/> - <listOptionValue builtIn="false" value=""${COCOS_SRC}/kazmath/include""/> - <listOptionValue builtIn="false" value=""${COCOS_SRC}/platform/tizen""/> - <listOptionValue builtIn="false" value=""${COCOS_SRC}/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include""/> - <listOptionValue builtIn="false" value=""${COCOS_SRC}/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2""/> - <listOptionValue builtIn="false" value=""${COCOS_SRC}/platform/third_party/tizen/prebuilt/libwebp/include""/> - <listOptionValue builtIn="false" value=""${COCOS_SRC}/platform/third_party/common/etc""/> - <listOptionValue builtIn="false" value=""${COCOS_SRC}/platform/third_party/common/s3tc""/> - </option> - <option id="sbi.gnu.cpp.compiler.option.frameworks.cpp.1270990666" name="Tizen-Frameworks" superClass="sbi.gnu.cpp.compiler.option.frameworks.cpp" valueType="userObjs"> - <listOptionValue builtIn="false" value="osp-static"/> - </option> - <option id="sbi.gnu.cpp.compiler.option.frameworks_inc.cpp.579636391" name="Tizen-Frameworks-Include-Path" superClass="sbi.gnu.cpp.compiler.option.frameworks_inc.cpp" valueType="includePath"> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/libxml2""/> - <listOptionValue builtIn="false" value=""C:\tizen-sdk\library""/> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include""/> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/osp""/> - </option> - <option id="sbi.gnu.cpp.compiler.option.frameworks_cflags.cpp.1644102691" name="Tizen-Frameworks-Other-Cflags" superClass="sbi.gnu.cpp.compiler.option.frameworks_cflags.cpp" valueType="stringList"> - <listOptionValue builtIn="false" value=" -fPIC"/> - <listOptionValue builtIn="false" value="--sysroot="${SBI_SYSROOT}""/> - </option> - <option id="gnu.cpp.compiler.option.preprocessor.def.1398462050" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" valueType="definedSymbols"> - <listOptionValue builtIn="false" value="_DEBUG"/> - <listOptionValue builtIn="false" value="TIZEN"/> - </option> - <option id="gnu.cpp.compiler.option.other.other.940909414" name="Other flags" superClass="gnu.cpp.compiler.option.other.other" value="-c -fmessage-length=0 -std=c++0x" valueType="string"/> - <inputType id="sbi.gnu.cpp.compiler.tizen.inputType.1890676098" superClass="sbi.gnu.cpp.compiler.tizen.inputType"/> - </tool> - <tool command="arm-linux-gnueabi-gcc.exe" id="org.tizen.nativecpp.tool.sbi.gnu.c.compiler.800077346" name="C Compiler" superClass="org.tizen.nativecpp.tool.sbi.gnu.c.compiler"> - <option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.option.optimization.level.73052907" name="Optimization Level" superClass="gnu.c.compiler.option.optimization.level" valueType="enumerated"/> - <option id="sbi.gnu.c.compiler.option.debugging.level.641100997" name="Debug level" superClass="sbi.gnu.c.compiler.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/> - <option id="sbi.gnu.c.compiler.option.debug.applog.2000116514" name="Enable application logging (-D_APP_LOG)" superClass="sbi.gnu.c.compiler.option.debug.applog" value="true" valueType="boolean"/> - <option id="sbi.gnu.c.compiler.option.1751855743" name="Tizen-Target" superClass="sbi.gnu.c.compiler.option" valueType="userObjs"> - <listOptionValue builtIn="false" value="tizen-device-2.2.native_gcc45.armel.cpp.staticLib"/> - </option> - <option id="gnu.c.compiler.option.include.paths.1641648644" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath"> - <listOptionValue builtIn="false" value=""${COCOS_SRC}""/> - <listOptionValue builtIn="false" value=""${COCOS_SRC}/include""/> - <listOptionValue builtIn="false" value=""${COCOS_SRC}/kazmath/include""/> - <listOptionValue builtIn="false" value=""${COCOS_SRC}/platform/tizen""/> - </option> - <option id="sbi.gnu.c.compiler.option.frameworks.cpp.356824867" name="Tizen-Frameworks" superClass="sbi.gnu.c.compiler.option.frameworks.cpp" valueType="userObjs"> - <listOptionValue builtIn="false" value="osp-static"/> - </option> - <option id="sbi.gnu.c.compiler.option.frameworks_inc.cpp.843251170" name="Tizen-Frameworks-Include-Path" superClass="sbi.gnu.c.compiler.option.frameworks_inc.cpp" valueType="includePath"> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/libxml2""/> - <listOptionValue builtIn="false" value=""C:\tizen-sdk\library""/> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include""/> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/osp""/> - </option> - <option id="sbi.gnu.c.compiler.option.frameworks_cflags.cpp.2073478823" name="Tizen-Frameworks-Other-Cflags" superClass="sbi.gnu.c.compiler.option.frameworks_cflags.cpp" valueType="stringList"> - <listOptionValue builtIn="false" value=" -fPIC"/> - <listOptionValue builtIn="false" value="--sysroot="${SBI_SYSROOT}""/> - </option> - <option id="gnu.c.compiler.option.preprocessor.def.symbols.1732125980" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" valueType="definedSymbols"> - <listOptionValue builtIn="false" value="_DEBUG"/> - <listOptionValue builtIn="false" value="TIZEN"/> - </option> - <inputType id="sbi.gnu.c.compiler.tizen.inputType.565155338" superClass="sbi.gnu.c.compiler.tizen.inputType"/> - </tool> - <tool id="org.tizen.nativeide.tool.sbi.gnu.c.linker.base.1321059471" name="C Linker" superClass="org.tizen.nativeide.tool.sbi.gnu.c.linker.base"/> - <tool command="arm-linux-gnueabi-g++.exe" id="org.tizen.nativecpp.tool.sbi.gnu.cpp.linker.517614783" name="C++ Linker" superClass="org.tizen.nativecpp.tool.sbi.gnu.cpp.linker"> - <option id="gnu.cpp.link.option.paths.316493253" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths" valueType="libPaths"> - <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/lib}""/> - </option> - <option id="sbi.gnu.cpp.linker.option.frameworks_lflags.cpp.557112687" name="Tizen-Frameworks-Other-Lflags" superClass="sbi.gnu.cpp.linker.option.frameworks_lflags.cpp" valueType="stringList"> - <listOptionValue builtIn="false" value="--sysroot="${SBI_SYSROOT}""/> - <listOptionValue builtIn="false" value="-Xlinker -rpath="/opt/usr/apps/null/lib""/> - </option> - </tool> - <tool command="arm-linux-gnueabi-as.exe" id="org.tizen.nativeapp.tool.sbi.gnu.assembler.base.1047247012" name="Assembler" superClass="org.tizen.nativeapp.tool.sbi.gnu.assembler.base"> - <inputType id="cdt.managedbuild.tool.gnu.assembler.input.1262361730" superClass="cdt.managedbuild.tool.gnu.assembler.input"/> - </tool> - <tool id="org.tizen.nativecpp.tool.sbi.po.compiler.1138371781" name="PO Resource Compiler" superClass="org.tizen.nativecpp.tool.sbi.po.compiler"/> - <tool id="org.tizen.nativecpp.tool.sbi.edc.compiler.2045899075" name="EDC Resource Compiler" superClass="org.tizen.nativecpp.tool.sbi.edc.compiler"/> - </toolChain> - </folderInfo> - <sourceEntries> - <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/> - </sourceEntries> - </configuration> - </storageModule> - <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> - </cconfiguration> - <cconfiguration id="org.tizen.nativecpp.config.sbi.gcc45.lib.release.2023052084"> - <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="org.tizen.nativecpp.config.sbi.gcc45.lib.release.2023052084" moduleId="org.eclipse.cdt.core.settings" name="Release"> - <macros> - <stringMacro name="COCOS_ROOT" type="VALUE_PATH_ANY" value="../../.."/> - <stringMacro name="COCOS_SRC" type="VALUE_PATH_ANY" value="${COCOS_ROOT}/cocos2dx"/> - </macros> - <externalSettings/> - <extensions> - <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/> - <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - </extensions> - </storageModule> - <storageModule moduleId="cdtBuildSystem" version="4.0.0"> - <configuration artifactExtension="a" artifactName="cocos2d" buildArtefactType="org.tizen.nativecpp.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release,org.eclipse.cdt.build.core.buildArtefactType=org.tizen.nativecpp.buildArtefactType.staticLib" cleanCommand="rm -f" description="" errorParsers="org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;" id="org.tizen.nativecpp.config.sbi.gcc45.lib.release.2023052084" name="Release" parent="org.tizen.nativecpp.config.sbi.gcc45.lib.release"> - <folderInfo id="org.tizen.nativecpp.config.sbi.gcc45.lib.release.2023052084." name="/" resourcePath=""> - <toolChain id="org.tizen.nativecpp.toolchain.sbi.gcc45.lib.release.1978438453" name="Tizen Native Toolchain" superClass="org.tizen.nativecpp.toolchain.sbi.gcc45.lib.release"> - <targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="org.tizen.nativeide.target.sbi.gnu.platform.base.216744962" osList="linux,win32" superClass="org.tizen.nativeide.target.sbi.gnu.platform.base"/> - <builder buildPath="${workspace_loc:/cocos2dx/Release}" id="org.tizen.nativecpp.target.sbi.gnu.builder.2102360604" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Tizen Application Builder" superClass="org.tizen.nativecpp.target.sbi.gnu.builder"/> - <tool command="i386-linux-gnueabi-ar.exe" id="org.tizen.nativecpp.tool.sbi.gnu.archiver.1826014056" name="Archiver" superClass="org.tizen.nativecpp.tool.sbi.gnu.archiver"/> - <tool command="clang++.exe" id="org.tizen.nativecpp.tool.sbi.gnu.cpp.compiler.2111905100" name="C++ Compiler" superClass="org.tizen.nativecpp.tool.sbi.gnu.cpp.compiler"> - <option id="gnu.cpp.compiler.option.optimization.level.1297088223" name="Optimization Level" superClass="gnu.cpp.compiler.option.optimization.level" value="gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/> - <option id="sbi.gnu.cpp.compiler.option.debugging.level.459894355" name="Debug level" superClass="sbi.gnu.cpp.compiler.option.debugging.level"/> - <option id="sbi.gnu.cpp.compiler.option.debug.applog.849008186" name="Enable application logging (-D_APP_LOG)" superClass="sbi.gnu.cpp.compiler.option.debug.applog"/> - <option id="sbi.gnu.cpp.compiler.option.74299026" name="Tizen-Target" superClass="sbi.gnu.cpp.compiler.option" valueType="userObjs"> - <listOptionValue builtIn="false" value="tizen-emulator-2.2.native_llvm31.i386.cpp.staticLib"/> - </option> - <option id="gnu.cpp.compiler.option.include.paths.1217915212" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath"> - <listOptionValue builtIn="false" value=""${COCOS_SRC}""/> - <listOptionValue builtIn="false" value=""${COCOS_SRC}/include""/> - <listOptionValue builtIn="false" value=""${COCOS_SRC}/kazmath/include""/> - <listOptionValue builtIn="false" value=""${COCOS_SRC}/platform/tizen""/> - </option> - <option id="sbi.gnu.cpp.compiler.option.frameworks.cpp.448934412" name="Tizen-Frameworks" superClass="sbi.gnu.cpp.compiler.option.frameworks.cpp" valueType="userObjs"> - <listOptionValue builtIn="false" value="osp-static"/> - </option> - <option id="sbi.gnu.cpp.compiler.option.frameworks_inc.cpp.1627502718" name="Tizen-Frameworks-Include-Path" superClass="sbi.gnu.cpp.compiler.option.frameworks_inc.cpp" valueType="includePath"> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/libxml2""/> - <listOptionValue builtIn="false" value=""C:\tizen-sdk\library""/> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include""/> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/osp""/> - </option> - <option id="sbi.gnu.cpp.compiler.option.frameworks_cflags.cpp.138455270" name="Tizen-Frameworks-Other-Cflags" superClass="sbi.gnu.cpp.compiler.option.frameworks_cflags.cpp" valueType="stringList"> - <listOptionValue builtIn="false" value="-target i386-tizen-linux-gnueabi -gcc-toolchain C:/tizen-sdk/tools/smart-build-interface/../i386-linux-gnueabi-gcc-4.5/ -ccc-gcc-name i386-linux-gnueabi-g++ -march=i386 -Wno-gnu"/> - <listOptionValue builtIn="false" value=" -fPIC"/> - <listOptionValue builtIn="false" value="--sysroot="${SBI_SYSROOT}""/> - </option> - <option id="gnu.cpp.compiler.option.preprocessor.def.1035388977" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" valueType="definedSymbols"> - <listOptionValue builtIn="false" value="_DEBUG"/> - <listOptionValue builtIn="false" value="TIZEN"/> - </option> - <inputType id="sbi.gnu.cpp.compiler.tizen.inputType.1145329261" superClass="sbi.gnu.cpp.compiler.tizen.inputType"/> - </tool> - <tool command="clang.exe" id="org.tizen.nativecpp.tool.sbi.gnu.c.compiler.19577634" name="C Compiler" superClass="org.tizen.nativecpp.tool.sbi.gnu.c.compiler"> - <option defaultValue="gnu.c.optimization.level.most" id="gnu.c.compiler.option.optimization.level.1635131080" name="Optimization Level" superClass="gnu.c.compiler.option.optimization.level" valueType="enumerated"/> - <option id="sbi.gnu.c.compiler.option.debugging.level.220381318" name="Debug level" superClass="sbi.gnu.c.compiler.option.debugging.level"/> - <option id="sbi.gnu.c.compiler.option.debug.applog.753089515" name="Enable application logging (-D_APP_LOG)" superClass="sbi.gnu.c.compiler.option.debug.applog"/> - <option id="sbi.gnu.c.compiler.option.215142124" name="Tizen-Target" superClass="sbi.gnu.c.compiler.option" valueType="userObjs"> - <listOptionValue builtIn="false" value="tizen-emulator-2.2.native_llvm31.i386.cpp.staticLib"/> - </option> - <option id="gnu.c.compiler.option.include.paths.632347119" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath"> - <listOptionValue builtIn="false" value=""${COCOS_SRC}""/> - <listOptionValue builtIn="false" value=""${COCOS_SRC}/include""/> - <listOptionValue builtIn="false" value=""${COCOS_SRC}/kazmath/include""/> - <listOptionValue builtIn="false" value=""${COCOS_SRC}/platform/tizen""/> - </option> - <option id="sbi.gnu.c.compiler.option.frameworks.cpp.1474026339" name="Tizen-Frameworks" superClass="sbi.gnu.c.compiler.option.frameworks.cpp" valueType="userObjs"> - <listOptionValue builtIn="false" value="osp-static"/> - </option> - <option id="sbi.gnu.c.compiler.option.frameworks_inc.cpp.468493190" name="Tizen-Frameworks-Include-Path" superClass="sbi.gnu.c.compiler.option.frameworks_inc.cpp" valueType="includePath"> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/libxml2""/> - <listOptionValue builtIn="false" value=""C:\tizen-sdk\library""/> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include""/> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/osp""/> - </option> - <option id="sbi.gnu.c.compiler.option.frameworks_cflags.cpp.1218800554" name="Tizen-Frameworks-Other-Cflags" superClass="sbi.gnu.c.compiler.option.frameworks_cflags.cpp" valueType="stringList"> - <listOptionValue builtIn="false" value="-target i386-tizen-linux-gnueabi -gcc-toolchain C:/tizen-sdk/tools/smart-build-interface/../i386-linux-gnueabi-gcc-4.5/ -ccc-gcc-name i386-linux-gnueabi-g++ -march=i386 -Wno-gnu"/> - <listOptionValue builtIn="false" value=" -fPIC"/> - <listOptionValue builtIn="false" value="--sysroot="${SBI_SYSROOT}""/> - </option> - <option id="gnu.c.compiler.option.preprocessor.def.symbols.625678193" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" valueType="definedSymbols"> - <listOptionValue builtIn="false" value="_DEBUG"/> - <listOptionValue builtIn="false" value="TIZEN"/> - </option> - <inputType id="sbi.gnu.c.compiler.tizen.inputType.1344515254" superClass="sbi.gnu.c.compiler.tizen.inputType"/> - </tool> - <tool id="org.tizen.nativeide.tool.sbi.gnu.c.linker.base.59626261" name="C Linker" superClass="org.tizen.nativeide.tool.sbi.gnu.c.linker.base"/> - <tool command="clang++.exe" id="org.tizen.nativecpp.tool.sbi.gnu.cpp.linker.563167499" name="C++ Linker" superClass="org.tizen.nativecpp.tool.sbi.gnu.cpp.linker"> - <option id="gnu.cpp.link.option.paths.618042967" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths" valueType="libPaths"> - <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/lib}""/> - </option> - <option id="sbi.gnu.cpp.linker.option.frameworks_lflags.cpp.620416347" name="Tizen-Frameworks-Other-Lflags" superClass="sbi.gnu.cpp.linker.option.frameworks_lflags.cpp" valueType="stringList"> - <listOptionValue builtIn="false" value="-target i386-tizen-linux-gnueabi -gcc-toolchain C:/tizen-sdk/tools/smart-build-interface/../i386-linux-gnueabi-gcc-4.5/ -ccc-gcc-name i386-linux-gnueabi-g++ -march=i386 -Xlinker --as-needed"/> - <listOptionValue builtIn="false" value="--sysroot="${SBI_SYSROOT}""/> - </option> - </tool> - <tool command="i386-linux-gnueabi-as.exe" id="org.tizen.nativeapp.tool.sbi.gnu.assembler.base.1990045494" name="Assembler" superClass="org.tizen.nativeapp.tool.sbi.gnu.assembler.base"> - <inputType id="cdt.managedbuild.tool.gnu.assembler.input.879926948" superClass="cdt.managedbuild.tool.gnu.assembler.input"/> - </tool> - <tool id="org.tizen.nativecpp.tool.sbi.po.compiler.1674758948" name="PO Resource Compiler" superClass="org.tizen.nativecpp.tool.sbi.po.compiler"/> - <tool id="org.tizen.nativecpp.tool.sbi.edc.compiler.1792629643" name="EDC Resource Compiler" superClass="org.tizen.nativecpp.tool.sbi.edc.compiler"/> - </toolChain> - </folderInfo> - <sourceEntries> - <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/> - </sourceEntries> - </configuration> - </storageModule> - <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> - </cconfiguration> - </storageModule> - <storageModule moduleId="cdtBuildSystem" version="4.0.0"> - <project id="cocos2dx.org.tizen.nativecpp.target.sbi.gcc45.lib.1874463476" name="Tizen Static Library" projectType="org.tizen.nativecpp.target.sbi.gcc45.lib"/> - </storageModule> - <storageModule moduleId="scannerConfiguration"> - <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/> - <scannerConfigBuildInfo instanceId="org.tizen.nativecpp.config.sbi.gcc45.lib.debug.emulator.1855378280"> - <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.tizen.nativecommon.TizenGCCManagedMakePerProjectProfileCPP"/> - </scannerConfigBuildInfo> - <scannerConfigBuildInfo instanceId="org.tizen.nativecpp.config.sbi.gcc45.lib.release.2023052084"> - <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.tizen.nativecommon.TizenGCCManagedMakePerProjectProfileCPP"/> - </scannerConfigBuildInfo> - <scannerConfigBuildInfo instanceId="org.tizen.nativecpp.config.sbi.gcc45.lib.debug.device.1240851129"> - <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.tizen.nativecommon.TizenGCCManagedMakePerProjectProfileCPP"/> - </scannerConfigBuildInfo> - </storageModule> - <storageModule moduleId="com.samsung.tizen.nativeapp.projectInfo" version="1.0.0"/> - <storageModule moduleId="refreshScope" versionNumber="1"> - <resource resourceType="PROJECT" workspacePath="/proj.tizen"/> - </storageModule> - <storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/> -</cproject> diff --git a/cocos2dx/proj.tizen/.project b/cocos2dx/proj.tizen/.project deleted file mode 100644 index 453a406efd..0000000000 --- a/cocos2dx/proj.tizen/.project +++ /dev/null @@ -1,1916 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>cocos2dx</name> - <comment></comment> - <projects> - </projects> - <buildSpec> - <buildCommand> - <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name> - <triggers>clean,full,incremental,</triggers> - <arguments> - <dictionary> - <key>?name?</key> - <value></value> - </dictionary> - <dictionary> - <key>org.eclipse.cdt.make.core.append_environment</key> - <value>true</value> - </dictionary> - <dictionary> - <key>org.eclipse.cdt.make.core.autoBuildTarget</key> - <value>all</value> - </dictionary> - <dictionary> - <key>org.eclipse.cdt.make.core.buildArguments</key> - <value></value> - </dictionary> - <dictionary> - <key>org.eclipse.cdt.make.core.buildCommand</key> - <value>sbi-make</value> - </dictionary> - <dictionary> - <key>org.eclipse.cdt.make.core.buildLocation</key> - <value>${workspace_loc:/cocos2dx/Debug-Tizen-Device}</value> - </dictionary> - <dictionary> - <key>org.eclipse.cdt.make.core.cleanBuildTarget</key> - <value>clean</value> - </dictionary> - <dictionary> - <key>org.eclipse.cdt.make.core.contents</key> - <value>org.eclipse.cdt.make.core.activeConfigSettings</value> - </dictionary> - <dictionary> - <key>org.eclipse.cdt.make.core.enableAutoBuild</key> - <value>false</value> - </dictionary> - <dictionary> - <key>org.eclipse.cdt.make.core.enableCleanBuild</key> - <value>true</value> - </dictionary> - <dictionary> - <key>org.eclipse.cdt.make.core.enableFullBuild</key> - <value>true</value> - </dictionary> - <dictionary> - <key>org.eclipse.cdt.make.core.fullBuildTarget</key> - <value>all</value> - </dictionary> - <dictionary> - <key>org.eclipse.cdt.make.core.stopOnError</key> - <value>true</value> - </dictionary> - <dictionary> - <key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key> - <value>true</value> - </dictionary> - </arguments> - </buildCommand> - <buildCommand> - <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name> - <triggers>full,incremental,</triggers> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>org.tizen.nativecpp.apichecker.core.builder</name> - <arguments> - </arguments> - </buildCommand> - </buildSpec> - <natures> - <nature>org.eclipse.cdt.core.cnature</nature> - <nature>org.eclipse.cdt.core.ccnature</nature> - <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature> - <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature> - <nature>org.tizen.nativecpp.apichecker.core.tizenCppNature</nature> - </natures> - <linkedResources> - <link> - <name>src/CCCamera.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/CCCamera.cpp</locationURI> - </link> - <link> - <name>src/CCCamera.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/CCCamera.h</locationURI> - </link> - <link> - <name>src/CCConfiguration.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/CCConfiguration.cpp</locationURI> - </link> - <link> - <name>src/CCConfiguration.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/CCConfiguration.h</locationURI> - </link> - <link> - <name>src/CCDeprecated.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/CCDeprecated.cpp</locationURI> - </link> - <link> - <name>src/CCDirector.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/CCDirector.cpp</locationURI> - </link> - <link> - <name>src/CCDirector.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/CCDirector.h</locationURI> - </link> - <link> - <name>src/CCScheduler.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/CCScheduler.cpp</locationURI> - </link> - <link> - <name>src/CCScheduler.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/CCScheduler.h</locationURI> - </link> - <link> - <name>src/actions</name> - <type>2</type> - <locationURI>virtual:/virtual</locationURI> - </link> - <link> - <name>src/base_nodes</name> - <type>2</type> - <locationURI>virtual:/virtual</locationURI> - </link> - <link> - <name>src/ccFPSImages.c</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/ccFPSImages.c</locationURI> - </link> - <link> - <name>src/ccFPSImages.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/ccFPSImages.h</locationURI> - </link> - <link> - <name>src/ccTypes.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/ccTypes.cpp</locationURI> - </link> - <link> - <name>src/cocoa</name> - <type>2</type> - <locationURI>virtual:/virtual</locationURI> - </link> - <link> - <name>src/cocos2d.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/cocos2d.cpp</locationURI> - </link> - <link> - <name>src/draw_nodes</name> - <type>2</type> - <locationURI>virtual:/virtual</locationURI> - </link> - <link> - <name>src/effects</name> - <type>2</type> - <locationURI>virtual:/virtual</locationURI> - </link> - <link> - <name>src/include</name> - <type>2</type> - <locationURI>virtual:/virtual</locationURI> - </link> - <link> - <name>src/kazmath</name> - <type>2</type> - <locationURI>virtual:/virtual</locationURI> - </link> - <link> - <name>src/keyboard_dispatcher</name> - <type>2</type> - <locationURI>virtual:/virtual</locationURI> - </link> - <link> - <name>src/keypad_dispatcher</name> - <type>2</type> - <locationURI>virtual:/virtual</locationURI> - </link> - <link> - <name>src/label_nodes</name> - <type>2</type> - <locationURI>virtual:/virtual</locationURI> - </link> - <link> - <name>src/layers_scenes_transitions_nodes</name> - <type>2</type> - <locationURI>virtual:/virtual</locationURI> - </link> - <link> - <name>src/menu_nodes</name> - <type>2</type> - <locationURI>virtual:/virtual</locationURI> - </link> - <link> - <name>src/misc_nodes</name> - <type>2</type> - <locationURI>virtual:/virtual</locationURI> - </link> - <link> - <name>src/particle_nodes</name> - <type>2</type> - <locationURI>virtual:/virtual</locationURI> - </link> - <link> - <name>src/platform</name> - <type>2</type> - <locationURI>virtual:/virtual</locationURI> - </link> - <link> - <name>src/script_support</name> - <type>2</type> - <locationURI>virtual:/virtual</locationURI> - </link> - <link> - <name>src/shaders</name> - <type>2</type> - <locationURI>virtual:/virtual</locationURI> - </link> - <link> - <name>src/sprite_nodes</name> - <type>2</type> - <locationURI>virtual:/virtual</locationURI> - </link> - <link> - <name>src/support</name> - <type>2</type> - <locationURI>virtual:/virtual</locationURI> - </link> - <link> - <name>src/text_input_node</name> - <type>2</type> - <locationURI>virtual:/virtual</locationURI> - </link> - <link> - <name>src/textures</name> - <type>2</type> - <locationURI>virtual:/virtual</locationURI> - </link> - <link> - <name>src/tilemap_parallax_nodes</name> - <type>2</type> - <locationURI>virtual:/virtual</locationURI> - </link> - <link> - <name>src/touch_dispatcher</name> - <type>2</type> - <locationURI>virtual:/virtual</locationURI> - </link> - <link> - <name>src/actions/CCAction.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/actions/CCAction.cpp</locationURI> - </link> - <link> - <name>src/actions/CCAction.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/actions/CCAction.h</locationURI> - </link> - <link> - <name>src/actions/CCActionCamera.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/actions/CCActionCamera.cpp</locationURI> - </link> - <link> - <name>src/actions/CCActionCamera.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/actions/CCActionCamera.h</locationURI> - </link> - <link> - <name>src/actions/CCActionCatmullRom.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/actions/CCActionCatmullRom.cpp</locationURI> - </link> - <link> - <name>src/actions/CCActionCatmullRom.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/actions/CCActionCatmullRom.h</locationURI> - </link> - <link> - <name>src/actions/CCActionEase.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/actions/CCActionEase.cpp</locationURI> - </link> - <link> - <name>src/actions/CCActionEase.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/actions/CCActionEase.h</locationURI> - </link> - <link> - <name>src/actions/CCActionGrid.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/actions/CCActionGrid.cpp</locationURI> - </link> - <link> - <name>src/actions/CCActionGrid.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/actions/CCActionGrid.h</locationURI> - </link> - <link> - <name>src/actions/CCActionGrid3D.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/actions/CCActionGrid3D.cpp</locationURI> - </link> - <link> - <name>src/actions/CCActionGrid3D.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/actions/CCActionGrid3D.h</locationURI> - </link> - <link> - <name>src/actions/CCActionInstant.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/actions/CCActionInstant.cpp</locationURI> - </link> - <link> - <name>src/actions/CCActionInstant.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/actions/CCActionInstant.h</locationURI> - </link> - <link> - <name>src/actions/CCActionInterval.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/actions/CCActionInterval.cpp</locationURI> - </link> - <link> - <name>src/actions/CCActionInterval.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/actions/CCActionInterval.h</locationURI> - </link> - <link> - <name>src/actions/CCActionManager.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/actions/CCActionManager.cpp</locationURI> - </link> - <link> - <name>src/actions/CCActionManager.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/actions/CCActionManager.h</locationURI> - </link> - <link> - <name>src/actions/CCActionPageTurn3D.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/actions/CCActionPageTurn3D.cpp</locationURI> - </link> - <link> - <name>src/actions/CCActionPageTurn3D.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/actions/CCActionPageTurn3D.h</locationURI> - </link> - <link> - <name>src/actions/CCActionProgressTimer.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/actions/CCActionProgressTimer.cpp</locationURI> - </link> - <link> - <name>src/actions/CCActionProgressTimer.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/actions/CCActionProgressTimer.h</locationURI> - </link> - <link> - <name>src/actions/CCActionTiledGrid.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/actions/CCActionTiledGrid.cpp</locationURI> - </link> - <link> - <name>src/actions/CCActionTiledGrid.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/actions/CCActionTiledGrid.h</locationURI> - </link> - <link> - <name>src/actions/CCActionTween.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/actions/CCActionTween.cpp</locationURI> - </link> - <link> - <name>src/actions/CCActionTween.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/actions/CCActionTween.h</locationURI> - </link> - <link> - <name>src/base_nodes/CCAtlasNode.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/base_nodes/CCAtlasNode.cpp</locationURI> - </link> - <link> - <name>src/base_nodes/CCAtlasNode.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/base_nodes/CCAtlasNode.h</locationURI> - </link> - <link> - <name>src/base_nodes/CCGLBufferedNode.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/base_nodes/CCGLBufferedNode.cpp</locationURI> - </link> - <link> - <name>src/base_nodes/CCGLBufferedNode.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/base_nodes/CCGLBufferedNode.h</locationURI> - </link> - <link> - <name>src/base_nodes/CCNode.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/base_nodes/CCNode.cpp</locationURI> - </link> - <link> - <name>src/base_nodes/CCNode.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/base_nodes/CCNode.h</locationURI> - </link> - <link> - <name>src/cocoa/CCAffineTransform.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/cocoa/CCAffineTransform.cpp</locationURI> - </link> - <link> - <name>src/cocoa/CCAffineTransform.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/cocoa/CCAffineTransform.h</locationURI> - </link> - <link> - <name>src/cocoa/CCArray.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/cocoa/CCArray.cpp</locationURI> - </link> - <link> - <name>src/cocoa/CCArray.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/cocoa/CCArray.h</locationURI> - </link> - <link> - <name>src/cocoa/CCAutoreleasePool.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/cocoa/CCAutoreleasePool.cpp</locationURI> - </link> - <link> - <name>src/cocoa/CCAutoreleasePool.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/cocoa/CCAutoreleasePool.h</locationURI> - </link> - <link> - <name>src/cocoa/CCBool.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/cocoa/CCBool.h</locationURI> - </link> - <link> - <name>src/cocoa/CCData.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/cocoa/CCData.cpp</locationURI> - </link> - <link> - <name>src/cocoa/CCData.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/cocoa/CCData.h</locationURI> - </link> - <link> - <name>src/cocoa/CCDataVisitor.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/cocoa/CCDataVisitor.cpp</locationURI> - </link> - <link> - <name>src/cocoa/CCDataVisitor.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/cocoa/CCDataVisitor.h</locationURI> - </link> - <link> - <name>src/cocoa/CCDictionary.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/cocoa/CCDictionary.cpp</locationURI> - </link> - <link> - <name>src/cocoa/CCDictionary.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/cocoa/CCDictionary.h</locationURI> - </link> - <link> - <name>src/cocoa/CCDouble.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/cocoa/CCDouble.h</locationURI> - </link> - <link> - <name>src/cocoa/CCFloat.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/cocoa/CCFloat.h</locationURI> - </link> - <link> - <name>src/cocoa/CCGeometry.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/cocoa/CCGeometry.cpp</locationURI> - </link> - <link> - <name>src/cocoa/CCGeometry.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/cocoa/CCGeometry.h</locationURI> - </link> - <link> - <name>src/cocoa/CCInteger.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/cocoa/CCInteger.h</locationURI> - </link> - <link> - <name>src/cocoa/CCNS.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/cocoa/CCNS.cpp</locationURI> - </link> - <link> - <name>src/cocoa/CCNS.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/cocoa/CCNS.h</locationURI> - </link> - <link> - <name>src/cocoa/CCObject.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/cocoa/CCObject.cpp</locationURI> - </link> - <link> - <name>src/cocoa/CCObject.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/cocoa/CCObject.h</locationURI> - </link> - <link> - <name>src/cocoa/CCSet.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/cocoa/CCSet.cpp</locationURI> - </link> - <link> - <name>src/cocoa/CCSet.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/cocoa/CCSet.h</locationURI> - </link> - <link> - <name>src/cocoa/CCString.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/cocoa/CCString.cpp</locationURI> - </link> - <link> - <name>src/cocoa/CCString.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/cocoa/CCString.h</locationURI> - </link> - <link> - <name>src/draw_nodes/CCDrawNode.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/draw_nodes/CCDrawNode.cpp</locationURI> - </link> - <link> - <name>src/draw_nodes/CCDrawNode.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/draw_nodes/CCDrawNode.h</locationURI> - </link> - <link> - <name>src/draw_nodes/CCDrawingPrimitives.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/draw_nodes/CCDrawingPrimitives.cpp</locationURI> - </link> - <link> - <name>src/draw_nodes/CCDrawingPrimitives.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/draw_nodes/CCDrawingPrimitives.h</locationURI> - </link> - <link> - <name>src/effects/CCGrabber.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/effects/CCGrabber.cpp</locationURI> - </link> - <link> - <name>src/effects/CCGrabber.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/effects/CCGrabber.h</locationURI> - </link> - <link> - <name>src/effects/CCGrid.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/effects/CCGrid.cpp</locationURI> - </link> - <link> - <name>src/effects/CCGrid.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/effects/CCGrid.h</locationURI> - </link> - <link> - <name>src/include/CCDeprecated.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/include/CCDeprecated.h</locationURI> - </link> - <link> - <name>src/include/CCEventType.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/include/CCEventType.h</locationURI> - </link> - <link> - <name>src/include/CCProtocols.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/include/CCProtocols.h</locationURI> - </link> - <link> - <name>src/include/ccConfig.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/include/ccConfig.h</locationURI> - </link> - <link> - <name>src/include/ccMacros.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/include/ccMacros.h</locationURI> - </link> - <link> - <name>src/include/ccTypeInfo.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/include/ccTypeInfo.h</locationURI> - </link> - <link> - <name>src/include/ccTypes.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/include/ccTypes.h</locationURI> - </link> - <link> - <name>src/include/cocos2d.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/include/cocos2d.h</locationURI> - </link> - <link> - <name>src/kazmath/include</name> - <type>2</type> - <locationURI>virtual:/virtual</locationURI> - </link> - <link> - <name>src/kazmath/src</name> - <type>2</type> - <locationURI>virtual:/virtual</locationURI> - </link> - <link> - <name>src/keyboard_dispatcher/CCKeyboardDispatcher.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/keyboard_dispatcher/CCKeyboardDispatcher.cpp</locationURI> - </link> - <link> - <name>src/keyboard_dispatcher/CCKeyboardDispatcher.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/keyboard_dispatcher/CCKeyboardDispatcher.h</locationURI> - </link> - <link> - <name>src/keypad_dispatcher/CCKeypadDelegate.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/keypad_dispatcher/CCKeypadDelegate.cpp</locationURI> - </link> - <link> - <name>src/keypad_dispatcher/CCKeypadDelegate.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/keypad_dispatcher/CCKeypadDelegate.h</locationURI> - </link> - <link> - <name>src/keypad_dispatcher/CCKeypadDispatcher.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/keypad_dispatcher/CCKeypadDispatcher.cpp</locationURI> - </link> - <link> - <name>src/keypad_dispatcher/CCKeypadDispatcher.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/keypad_dispatcher/CCKeypadDispatcher.h</locationURI> - </link> - <link> - <name>src/label_nodes/CCFont.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/label_nodes/CCFont.cpp</locationURI> - </link> - <link> - <name>src/label_nodes/CCFont.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/label_nodes/CCFont.h</locationURI> - </link> - <link> - <name>src/label_nodes/CCFontAtlas.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/label_nodes/CCFontAtlas.cpp</locationURI> - </link> - <link> - <name>src/label_nodes/CCFontAtlas.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/label_nodes/CCFontAtlas.h</locationURI> - </link> - <link> - <name>src/label_nodes/CCFontAtlasCache.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/label_nodes/CCFontAtlasCache.cpp</locationURI> - </link> - <link> - <name>src/label_nodes/CCFontAtlasCache.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/label_nodes/CCFontAtlasCache.h</locationURI> - </link> - <link> - <name>src/label_nodes/CCFontAtlasFactory.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/label_nodes/CCFontAtlasFactory.cpp</locationURI> - </link> - <link> - <name>src/label_nodes/CCFontAtlasFactory.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/label_nodes/CCFontAtlasFactory.h</locationURI> - </link> - <link> - <name>src/label_nodes/CCFontCache.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/label_nodes/CCFontCache.h</locationURI> - </link> - <link> - <name>src/label_nodes/CCFontDefinition.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/label_nodes/CCFontDefinition.cpp</locationURI> - </link> - <link> - <name>src/label_nodes/CCFontDefinition.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/label_nodes/CCFontDefinition.h</locationURI> - </link> - <link> - <name>src/label_nodes/CCFontFNT.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/label_nodes/CCFontFNT.cpp</locationURI> - </link> - <link> - <name>src/label_nodes/CCFontFNT.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/label_nodes/CCFontFNT.h</locationURI> - </link> - <link> - <name>src/label_nodes/CCFontFreeType.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/label_nodes/CCFontFreeType.cpp</locationURI> - </link> - <link> - <name>src/label_nodes/CCFontFreeType.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/label_nodes/CCFontFreeType.h</locationURI> - </link> - <link> - <name>src/label_nodes/CCLabel.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/label_nodes/CCLabel.cpp</locationURI> - </link> - <link> - <name>src/label_nodes/CCLabel.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/label_nodes/CCLabel.h</locationURI> - </link> - <link> - <name>src/label_nodes/CCLabelAtlas.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/label_nodes/CCLabelAtlas.cpp</locationURI> - </link> - <link> - <name>src/label_nodes/CCLabelAtlas.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/label_nodes/CCLabelAtlas.h</locationURI> - </link> - <link> - <name>src/label_nodes/CCLabelBMFont.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/label_nodes/CCLabelBMFont.cpp</locationURI> - </link> - <link> - <name>src/label_nodes/CCLabelBMFont.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/label_nodes/CCLabelBMFont.h</locationURI> - </link> - <link> - <name>src/label_nodes/CCLabelTTF.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/label_nodes/CCLabelTTF.cpp</locationURI> - </link> - <link> - <name>src/label_nodes/CCLabelTTF.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/label_nodes/CCLabelTTF.h</locationURI> - </link> - <link> - <name>src/label_nodes/CCLabelTextFormatProtocol.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/label_nodes/CCLabelTextFormatProtocol.h</locationURI> - </link> - <link> - <name>src/label_nodes/CCLabelTextFormatter.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/label_nodes/CCLabelTextFormatter.cpp</locationURI> - </link> - <link> - <name>src/label_nodes/CCLabelTextFormatter.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/label_nodes/CCLabelTextFormatter.h</locationURI> - </link> - <link> - <name>src/label_nodes/CCTextImage.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/label_nodes/CCTextImage.cpp</locationURI> - </link> - <link> - <name>src/label_nodes/CCTextImage.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/label_nodes/CCTextImage.h</locationURI> - </link> - <link> - <name>src/layers_scenes_transitions_nodes/CCLayer.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/layers_scenes_transitions_nodes/CCLayer.cpp</locationURI> - </link> - <link> - <name>src/layers_scenes_transitions_nodes/CCLayer.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/layers_scenes_transitions_nodes/CCLayer.h</locationURI> - </link> - <link> - <name>src/layers_scenes_transitions_nodes/CCScene.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/layers_scenes_transitions_nodes/CCScene.cpp</locationURI> - </link> - <link> - <name>src/layers_scenes_transitions_nodes/CCScene.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/layers_scenes_transitions_nodes/CCScene.h</locationURI> - </link> - <link> - <name>src/layers_scenes_transitions_nodes/CCTransition.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/layers_scenes_transitions_nodes/CCTransition.cpp</locationURI> - </link> - <link> - <name>src/layers_scenes_transitions_nodes/CCTransition.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/layers_scenes_transitions_nodes/CCTransition.h</locationURI> - </link> - <link> - <name>src/layers_scenes_transitions_nodes/CCTransitionPageTurn.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/layers_scenes_transitions_nodes/CCTransitionPageTurn.cpp</locationURI> - </link> - <link> - <name>src/layers_scenes_transitions_nodes/CCTransitionPageTurn.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/layers_scenes_transitions_nodes/CCTransitionPageTurn.h</locationURI> - </link> - <link> - <name>src/layers_scenes_transitions_nodes/CCTransitionProgress.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/layers_scenes_transitions_nodes/CCTransitionProgress.cpp</locationURI> - </link> - <link> - <name>src/layers_scenes_transitions_nodes/CCTransitionProgress.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/layers_scenes_transitions_nodes/CCTransitionProgress.h</locationURI> - </link> - <link> - <name>src/menu_nodes/CCMenu.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/menu_nodes/CCMenu.cpp</locationURI> - </link> - <link> - <name>src/menu_nodes/CCMenu.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/menu_nodes/CCMenu.h</locationURI> - </link> - <link> - <name>src/menu_nodes/CCMenuItem.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/menu_nodes/CCMenuItem.cpp</locationURI> - </link> - <link> - <name>src/menu_nodes/CCMenuItem.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/menu_nodes/CCMenuItem.h</locationURI> - </link> - <link> - <name>src/misc_nodes/CCClippingNode.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/misc_nodes/CCClippingNode.cpp</locationURI> - </link> - <link> - <name>src/misc_nodes/CCClippingNode.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/misc_nodes/CCClippingNode.h</locationURI> - </link> - <link> - <name>src/misc_nodes/CCMotionStreak.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/misc_nodes/CCMotionStreak.cpp</locationURI> - </link> - <link> - <name>src/misc_nodes/CCMotionStreak.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/misc_nodes/CCMotionStreak.h</locationURI> - </link> - <link> - <name>src/misc_nodes/CCProgressTimer.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/misc_nodes/CCProgressTimer.cpp</locationURI> - </link> - <link> - <name>src/misc_nodes/CCProgressTimer.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/misc_nodes/CCProgressTimer.h</locationURI> - </link> - <link> - <name>src/misc_nodes/CCRenderTexture.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/misc_nodes/CCRenderTexture.cpp</locationURI> - </link> - <link> - <name>src/misc_nodes/CCRenderTexture.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/misc_nodes/CCRenderTexture.h</locationURI> - </link> - <link> - <name>src/particle_nodes/CCParticleBatchNode.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/particle_nodes/CCParticleBatchNode.cpp</locationURI> - </link> - <link> - <name>src/particle_nodes/CCParticleBatchNode.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/particle_nodes/CCParticleBatchNode.h</locationURI> - </link> - <link> - <name>src/particle_nodes/CCParticleExamples.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/particle_nodes/CCParticleExamples.cpp</locationURI> - </link> - <link> - <name>src/particle_nodes/CCParticleExamples.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/particle_nodes/CCParticleExamples.h</locationURI> - </link> - <link> - <name>src/particle_nodes/CCParticleSystem.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/particle_nodes/CCParticleSystem.cpp</locationURI> - </link> - <link> - <name>src/particle_nodes/CCParticleSystem.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/particle_nodes/CCParticleSystem.h</locationURI> - </link> - <link> - <name>src/particle_nodes/CCParticleSystemQuad.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/particle_nodes/CCParticleSystemQuad.cpp</locationURI> - </link> - <link> - <name>src/particle_nodes/CCParticleSystemQuad.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/particle_nodes/CCParticleSystemQuad.h</locationURI> - </link> - <link> - <name>src/particle_nodes/firePngData.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/particle_nodes/firePngData.h</locationURI> - </link> - <link> - <name>src/platform/CCAccelerometerDelegate.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/platform/CCAccelerometerDelegate.h</locationURI> - </link> - <link> - <name>src/platform/CCApplicationProtocol.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/platform/CCApplicationProtocol.h</locationURI> - </link> - <link> - <name>src/platform/CCCommon.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/platform/CCCommon.h</locationURI> - </link> - <link> - <name>src/platform/CCDevice.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/platform/CCDevice.h</locationURI> - </link> - <link> - <name>src/platform/CCEGLViewProtocol.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/platform/CCEGLViewProtocol.cpp</locationURI> - </link> - <link> - <name>src/platform/CCEGLViewProtocol.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/platform/CCEGLViewProtocol.h</locationURI> - </link> - <link> - <name>src/platform/CCFileUtils.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/platform/CCFileUtils.cpp</locationURI> - </link> - <link> - <name>src/platform/CCFileUtils.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/platform/CCFileUtils.h</locationURI> - </link> - <link> - <name>src/platform/CCImage.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/platform/CCImage.h</locationURI> - </link> - <link> - <name>src/platform/CCImageCommon_cpp.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/platform/CCImageCommon_cpp.h</locationURI> - </link> - <link> - <name>src/platform/CCPlatformConfig.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/platform/CCPlatformConfig.h</locationURI> - </link> - <link> - <name>src/platform/CCPlatformMacros.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/platform/CCPlatformMacros.h</locationURI> - </link> - <link> - <name>src/platform/CCSAXParser.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/platform/CCSAXParser.cpp</locationURI> - </link> - <link> - <name>src/platform/CCSAXParser.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/platform/CCSAXParser.h</locationURI> - </link> - <link> - <name>src/platform/CCThread.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/platform/CCThread.cpp</locationURI> - </link> - <link> - <name>src/platform/CCThread.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/platform/CCThread.h</locationURI> - </link> - <link> - <name>src/platform/atitc</name> - <type>2</type> - <locationURI>virtual:/virtual</locationURI> - </link> - <link> - <name>src/platform/etc</name> - <type>2</type> - <locationURI>virtual:/virtual</locationURI> - </link> - <link> - <name>src/platform/s3tc</name> - <type>2</type> - <locationURI>virtual:/virtual</locationURI> - </link> - <link> - <name>src/platform/tizen</name> - <type>2</type> - <locationURI>virtual:/virtual</locationURI> - </link> - <link> - <name>src/script_support/CCScriptSupport.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/script_support/CCScriptSupport.cpp</locationURI> - </link> - <link> - <name>src/script_support/CCScriptSupport.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/script_support/CCScriptSupport.h</locationURI> - </link> - <link> - <name>src/shaders/CCGLProgram.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/shaders/CCGLProgram.cpp</locationURI> - </link> - <link> - <name>src/shaders/CCGLProgram.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/shaders/CCGLProgram.h</locationURI> - </link> - <link> - <name>src/shaders/CCShaderCache.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/shaders/CCShaderCache.cpp</locationURI> - </link> - <link> - <name>src/shaders/CCShaderCache.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/shaders/CCShaderCache.h</locationURI> - </link> - <link> - <name>src/shaders/ccGLStateCache.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/shaders/ccGLStateCache.cpp</locationURI> - </link> - <link> - <name>src/shaders/ccGLStateCache.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/shaders/ccGLStateCache.h</locationURI> - </link> - <link> - <name>src/shaders/ccShaderEx_SwitchMask_frag.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/shaders/ccShaderEx_SwitchMask_frag.h</locationURI> - </link> - <link> - <name>src/shaders/ccShader_PositionColorLengthTexture_frag.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/shaders/ccShader_PositionColorLengthTexture_frag.h</locationURI> - </link> - <link> - <name>src/shaders/ccShader_PositionColorLengthTexture_vert.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/shaders/ccShader_PositionColorLengthTexture_vert.h</locationURI> - </link> - <link> - <name>src/shaders/ccShader_PositionColor_frag.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/shaders/ccShader_PositionColor_frag.h</locationURI> - </link> - <link> - <name>src/shaders/ccShader_PositionColor_vert.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/shaders/ccShader_PositionColor_vert.h</locationURI> - </link> - <link> - <name>src/shaders/ccShader_PositionTextureA8Color_frag.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/shaders/ccShader_PositionTextureA8Color_frag.h</locationURI> - </link> - <link> - <name>src/shaders/ccShader_PositionTextureA8Color_vert.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/shaders/ccShader_PositionTextureA8Color_vert.h</locationURI> - </link> - <link> - <name>src/shaders/ccShader_PositionTextureColorAlphaTest_frag.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/shaders/ccShader_PositionTextureColorAlphaTest_frag.h</locationURI> - </link> - <link> - <name>src/shaders/ccShader_PositionTextureColor_frag.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/shaders/ccShader_PositionTextureColor_frag.h</locationURI> - </link> - <link> - <name>src/shaders/ccShader_PositionTextureColor_vert.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/shaders/ccShader_PositionTextureColor_vert.h</locationURI> - </link> - <link> - <name>src/shaders/ccShader_PositionTexture_frag.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/shaders/ccShader_PositionTexture_frag.h</locationURI> - </link> - <link> - <name>src/shaders/ccShader_PositionTexture_uColor_frag.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/shaders/ccShader_PositionTexture_uColor_frag.h</locationURI> - </link> - <link> - <name>src/shaders/ccShader_PositionTexture_uColor_vert.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/shaders/ccShader_PositionTexture_uColor_vert.h</locationURI> - </link> - <link> - <name>src/shaders/ccShader_PositionTexture_vert.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/shaders/ccShader_PositionTexture_vert.h</locationURI> - </link> - <link> - <name>src/shaders/ccShader_Position_uColor_frag.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/shaders/ccShader_Position_uColor_frag.h</locationURI> - </link> - <link> - <name>src/shaders/ccShader_Position_uColor_vert.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/shaders/ccShader_Position_uColor_vert.h</locationURI> - </link> - <link> - <name>src/shaders/ccShaders.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/shaders/ccShaders.cpp</locationURI> - </link> - <link> - <name>src/shaders/ccShaders.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/shaders/ccShaders.h</locationURI> - </link> - <link> - <name>src/sprite_nodes/CCAnimation.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/sprite_nodes/CCAnimation.cpp</locationURI> - </link> - <link> - <name>src/sprite_nodes/CCAnimation.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/sprite_nodes/CCAnimation.h</locationURI> - </link> - <link> - <name>src/sprite_nodes/CCAnimationCache.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/sprite_nodes/CCAnimationCache.cpp</locationURI> - </link> - <link> - <name>src/sprite_nodes/CCAnimationCache.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/sprite_nodes/CCAnimationCache.h</locationURI> - </link> - <link> - <name>src/sprite_nodes/CCSprite.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/sprite_nodes/CCSprite.cpp</locationURI> - </link> - <link> - <name>src/sprite_nodes/CCSprite.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/sprite_nodes/CCSprite.h</locationURI> - </link> - <link> - <name>src/sprite_nodes/CCSpriteBatchNode.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/sprite_nodes/CCSpriteBatchNode.cpp</locationURI> - </link> - <link> - <name>src/sprite_nodes/CCSpriteBatchNode.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/sprite_nodes/CCSpriteBatchNode.h</locationURI> - </link> - <link> - <name>src/sprite_nodes/CCSpriteFrame.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/sprite_nodes/CCSpriteFrame.cpp</locationURI> - </link> - <link> - <name>src/sprite_nodes/CCSpriteFrame.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/sprite_nodes/CCSpriteFrame.h</locationURI> - </link> - <link> - <name>src/sprite_nodes/CCSpriteFrameCache.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/sprite_nodes/CCSpriteFrameCache.cpp</locationURI> - </link> - <link> - <name>src/sprite_nodes/CCSpriteFrameCache.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/sprite_nodes/CCSpriteFrameCache.h</locationURI> - </link> - <link> - <name>src/support/CCNotificationCenter.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/support/CCNotificationCenter.cpp</locationURI> - </link> - <link> - <name>src/support/CCNotificationCenter.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/support/CCNotificationCenter.h</locationURI> - </link> - <link> - <name>src/support/CCProfiling.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/support/CCProfiling.cpp</locationURI> - </link> - <link> - <name>src/support/CCProfiling.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/support/CCProfiling.h</locationURI> - </link> - <link> - <name>src/support/CCVertex.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/support/CCVertex.cpp</locationURI> - </link> - <link> - <name>src/support/CCVertex.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/support/CCVertex.h</locationURI> - </link> - <link> - <name>src/support/TransformUtils.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/support/TransformUtils.cpp</locationURI> - </link> - <link> - <name>src/support/TransformUtils.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/support/TransformUtils.h</locationURI> - </link> - <link> - <name>src/support/base64.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/support/base64.cpp</locationURI> - </link> - <link> - <name>src/support/base64.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/support/base64.h</locationURI> - </link> - <link> - <name>src/support/ccUTF8.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/support/ccUTF8.cpp</locationURI> - </link> - <link> - <name>src/support/ccUTF8.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/support/ccUTF8.h</locationURI> - </link> - <link> - <name>src/support/ccUtils.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/support/ccUtils.cpp</locationURI> - </link> - <link> - <name>src/support/ccUtils.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/support/ccUtils.h</locationURI> - </link> - <link> - <name>src/support/component</name> - <type>2</type> - <locationURI>virtual:/virtual</locationURI> - </link> - <link> - <name>src/support/data_support</name> - <type>2</type> - <locationURI>virtual:/virtual</locationURI> - </link> - <link> - <name>src/support/image_support</name> - <type>2</type> - <locationURI>virtual:/virtual</locationURI> - </link> - <link> - <name>src/support/tinyxml2</name> - <type>2</type> - <locationURI>virtual:/virtual</locationURI> - </link> - <link> - <name>src/support/user_default</name> - <type>2</type> - <locationURI>virtual:/virtual</locationURI> - </link> - <link> - <name>src/support/zip_support</name> - <type>2</type> - <locationURI>virtual:/virtual</locationURI> - </link> - <link> - <name>src/text_input_node/CCIMEDelegate.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/text_input_node/CCIMEDelegate.h</locationURI> - </link> - <link> - <name>src/text_input_node/CCIMEDispatcher.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/text_input_node/CCIMEDispatcher.cpp</locationURI> - </link> - <link> - <name>src/text_input_node/CCIMEDispatcher.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/text_input_node/CCIMEDispatcher.h</locationURI> - </link> - <link> - <name>src/text_input_node/CCTextFieldTTF.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/text_input_node/CCTextFieldTTF.cpp</locationURI> - </link> - <link> - <name>src/text_input_node/CCTextFieldTTF.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/text_input_node/CCTextFieldTTF.h</locationURI> - </link> - <link> - <name>src/textures/CCTexture2D.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/textures/CCTexture2D.cpp</locationURI> - </link> - <link> - <name>src/textures/CCTexture2D.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/textures/CCTexture2D.h</locationURI> - </link> - <link> - <name>src/textures/CCTextureAtlas.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/textures/CCTextureAtlas.cpp</locationURI> - </link> - <link> - <name>src/textures/CCTextureAtlas.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/textures/CCTextureAtlas.h</locationURI> - </link> - <link> - <name>src/textures/CCTextureCache.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/textures/CCTextureCache.cpp</locationURI> - </link> - <link> - <name>src/textures/CCTextureCache.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/textures/CCTextureCache.h</locationURI> - </link> - <link> - <name>src/tilemap_parallax_nodes/CCParallaxNode.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/tilemap_parallax_nodes/CCParallaxNode.cpp</locationURI> - </link> - <link> - <name>src/tilemap_parallax_nodes/CCParallaxNode.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/tilemap_parallax_nodes/CCParallaxNode.h</locationURI> - </link> - <link> - <name>src/tilemap_parallax_nodes/CCTMXLayer.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/tilemap_parallax_nodes/CCTMXLayer.cpp</locationURI> - </link> - <link> - <name>src/tilemap_parallax_nodes/CCTMXLayer.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/tilemap_parallax_nodes/CCTMXLayer.h</locationURI> - </link> - <link> - <name>src/tilemap_parallax_nodes/CCTMXObjectGroup.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/tilemap_parallax_nodes/CCTMXObjectGroup.cpp</locationURI> - </link> - <link> - <name>src/tilemap_parallax_nodes/CCTMXObjectGroup.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/tilemap_parallax_nodes/CCTMXObjectGroup.h</locationURI> - </link> - <link> - <name>src/tilemap_parallax_nodes/CCTMXTiledMap.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/tilemap_parallax_nodes/CCTMXTiledMap.cpp</locationURI> - </link> - <link> - <name>src/tilemap_parallax_nodes/CCTMXTiledMap.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/tilemap_parallax_nodes/CCTMXTiledMap.h</locationURI> - </link> - <link> - <name>src/tilemap_parallax_nodes/CCTMXXMLParser.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/tilemap_parallax_nodes/CCTMXXMLParser.cpp</locationURI> - </link> - <link> - <name>src/tilemap_parallax_nodes/CCTMXXMLParser.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/tilemap_parallax_nodes/CCTMXXMLParser.h</locationURI> - </link> - <link> - <name>src/tilemap_parallax_nodes/CCTileMapAtlas.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/tilemap_parallax_nodes/CCTileMapAtlas.cpp</locationURI> - </link> - <link> - <name>src/tilemap_parallax_nodes/CCTileMapAtlas.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/tilemap_parallax_nodes/CCTileMapAtlas.h</locationURI> - </link> - <link> - <name>src/touch_dispatcher/CCTouch.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/touch_dispatcher/CCTouch.cpp</locationURI> - </link> - <link> - <name>src/touch_dispatcher/CCTouch.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/touch_dispatcher/CCTouch.h</locationURI> - </link> - <link> - <name>src/touch_dispatcher/CCTouchDelegateProtocol.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/touch_dispatcher/CCTouchDelegateProtocol.h</locationURI> - </link> - <link> - <name>src/touch_dispatcher/CCTouchDispatcher.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/touch_dispatcher/CCTouchDispatcher.cpp</locationURI> - </link> - <link> - <name>src/touch_dispatcher/CCTouchDispatcher.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/touch_dispatcher/CCTouchDispatcher.h</locationURI> - </link> - <link> - <name>src/touch_dispatcher/CCTouchHandler.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/touch_dispatcher/CCTouchHandler.cpp</locationURI> - </link> - <link> - <name>src/touch_dispatcher/CCTouchHandler.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/touch_dispatcher/CCTouchHandler.h</locationURI> - </link> - <link> - <name>src/kazmath/include/kazmath</name> - <type>2</type> - <locationURI>virtual:/virtual</locationURI> - </link> - <link> - <name>src/kazmath/src/CMakeLists.txt</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/kazmath/src/CMakeLists.txt</locationURI> - </link> - <link> - <name>src/kazmath/src/ChangeLog</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/kazmath/src/ChangeLog</locationURI> - </link> - <link> - <name>src/kazmath/src/GL</name> - <type>2</type> - <locationURI>virtual:/virtual</locationURI> - </link> - <link> - <name>src/kazmath/src/aabb.c</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/kazmath/src/aabb.c</locationURI> - </link> - <link> - <name>src/kazmath/src/mat3.c</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/kazmath/src/mat3.c</locationURI> - </link> - <link> - <name>src/kazmath/src/mat4.c</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/kazmath/src/mat4.c</locationURI> - </link> - <link> - <name>src/kazmath/src/neon_matrix_impl.c</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/kazmath/src/neon_matrix_impl.c</locationURI> - </link> - <link> - <name>src/kazmath/src/plane.c</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/kazmath/src/plane.c</locationURI> - </link> - <link> - <name>src/kazmath/src/quaternion.c</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/kazmath/src/quaternion.c</locationURI> - </link> - <link> - <name>src/kazmath/src/ray2.c</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/kazmath/src/ray2.c</locationURI> - </link> - <link> - <name>src/kazmath/src/utility.c</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/kazmath/src/utility.c</locationURI> - </link> - <link> - <name>src/kazmath/src/vec2.c</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/kazmath/src/vec2.c</locationURI> - </link> - <link> - <name>src/kazmath/src/vec3.c</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/kazmath/src/vec3.c</locationURI> - </link> - <link> - <name>src/kazmath/src/vec4.c</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/kazmath/src/vec4.c</locationURI> - </link> - <link> - <name>src/platform/atitc/atitc.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/platform/third_party/common/atitc/atitc.cpp</locationURI> - </link> - <link> - <name>src/platform/atitc/atitc.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/platform/third_party/common/atitc/atitc.h</locationURI> - </link> - <link> - <name>src/platform/etc/etc1.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/platform/third_party/common/etc/etc1.cpp</locationURI> - </link> - <link> - <name>src/platform/etc/etc1.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/platform/third_party/common/etc/etc1.h</locationURI> - </link> - <link> - <name>src/platform/s3tc/s3tc.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/platform/third_party/common/s3tc/s3tc.cpp</locationURI> - </link> - <link> - <name>src/platform/s3tc/s3tc.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/platform/third_party/common/s3tc/s3tc.h</locationURI> - </link> - <link> - <name>src/platform/tizen/.CCCommon.cpp.swp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/platform/tizen/.CCCommon.cpp.swp</locationURI> - </link> - <link> - <name>src/platform/tizen/CCAccelerometer.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/platform/tizen/CCAccelerometer.cpp</locationURI> - </link> - <link> - <name>src/platform/tizen/CCAccelerometer.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/platform/tizen/CCAccelerometer.h</locationURI> - </link> - <link> - <name>src/platform/tizen/CCApplication.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/platform/tizen/CCApplication.cpp</locationURI> - </link> - <link> - <name>src/platform/tizen/CCApplication.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/platform/tizen/CCApplication.h</locationURI> - </link> - <link> - <name>src/platform/tizen/CCCommon.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/platform/tizen/CCCommon.cpp</locationURI> - </link> - <link> - <name>src/platform/tizen/CCDevice.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/platform/tizen/CCDevice.cpp</locationURI> - </link> - <link> - <name>src/platform/tizen/CCEGLView.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/platform/tizen/CCEGLView.cpp</locationURI> - </link> - <link> - <name>src/platform/tizen/CCEGLView.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/platform/tizen/CCEGLView.h</locationURI> - </link> - <link> - <name>src/platform/tizen/CCFileUtilsTizen.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/platform/tizen/CCFileUtilsTizen.cpp</locationURI> - </link> - <link> - <name>src/platform/tizen/CCFileUtilsTizen.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/platform/tizen/CCFileUtilsTizen.h</locationURI> - </link> - <link> - <name>src/platform/tizen/CCGL.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/platform/tizen/CCGL.h</locationURI> - </link> - <link> - <name>src/platform/tizen/CCImage.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/platform/tizen/CCImage.cpp</locationURI> - </link> - <link> - <name>src/platform/tizen/CCOspApplication.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/platform/tizen/CCOspApplication.cpp</locationURI> - </link> - <link> - <name>src/platform/tizen/CCOspApplication.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/platform/tizen/CCOspApplication.h</locationURI> - </link> - <link> - <name>src/platform/tizen/CCOspForm.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/platform/tizen/CCOspForm.cpp</locationURI> - </link> - <link> - <name>src/platform/tizen/CCOspForm.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/platform/tizen/CCOspForm.h</locationURI> - </link> - <link> - <name>src/platform/tizen/CCPlatformDefine.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/platform/tizen/CCPlatformDefine.h</locationURI> - </link> - <link> - <name>src/platform/tizen/CCStdC.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/platform/tizen/CCStdC.h</locationURI> - </link> - <link> - <name>src/support/component/CCComponent.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/support/component/CCComponent.cpp</locationURI> - </link> - <link> - <name>src/support/component/CCComponent.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/support/component/CCComponent.h</locationURI> - </link> - <link> - <name>src/support/component/CCComponentContainer.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/support/component/CCComponentContainer.cpp</locationURI> - </link> - <link> - <name>src/support/component/CCComponentContainer.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/support/component/CCComponentContainer.h</locationURI> - </link> - <link> - <name>src/support/data_support/ccCArray.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/support/data_support/ccCArray.cpp</locationURI> - </link> - <link> - <name>src/support/data_support/ccCArray.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/support/data_support/ccCArray.h</locationURI> - </link> - <link> - <name>src/support/data_support/uthash.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/support/data_support/uthash.h</locationURI> - </link> - <link> - <name>src/support/data_support/utlist.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/support/data_support/utlist.h</locationURI> - </link> - <link> - <name>src/support/image_support/TGAlib.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/support/image_support/TGAlib.cpp</locationURI> - </link> - <link> - <name>src/support/image_support/TGAlib.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/support/image_support/TGAlib.h</locationURI> - </link> - <link> - <name>src/support/tinyxml2/tinyxml2.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/support/tinyxml2/tinyxml2.cpp</locationURI> - </link> - <link> - <name>src/support/tinyxml2/tinyxml2.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/support/tinyxml2/tinyxml2.h</locationURI> - </link> - <link> - <name>src/support/user_default/Archive.zip</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/support/user_default/Archive.zip</locationURI> - </link> - <link> - <name>src/support/user_default/CCUserDefault.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/support/user_default/CCUserDefault.cpp</locationURI> - </link> - <link> - <name>src/support/user_default/CCUserDefault.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/support/user_default/CCUserDefault.h</locationURI> - </link> - <link> - <name>src/support/user_default/CCUserDefault.mm</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/support/user_default/CCUserDefault.mm</locationURI> - </link> - <link> - <name>src/support/user_default/CCUserDefaultAndroid.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/support/user_default/CCUserDefaultAndroid.cpp</locationURI> - </link> - <link> - <name>src/support/zip_support/ZipUtils.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/support/zip_support/ZipUtils.cpp</locationURI> - </link> - <link> - <name>src/support/zip_support/ZipUtils.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/support/zip_support/ZipUtils.h</locationURI> - </link> - <link> - <name>src/support/zip_support/ioapi.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/support/zip_support/ioapi.cpp</locationURI> - </link> - <link> - <name>src/support/zip_support/ioapi.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/support/zip_support/ioapi.h</locationURI> - </link> - <link> - <name>src/support/zip_support/unzip.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/support/zip_support/unzip.cpp</locationURI> - </link> - <link> - <name>src/support/zip_support/unzip.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/support/zip_support/unzip.h</locationURI> - </link> - <link> - <name>src/kazmath/include/kazmath/GL</name> - <type>2</type> - <locationURI>virtual:/virtual</locationURI> - </link> - <link> - <name>src/kazmath/include/kazmath/aabb.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/kazmath/include/kazmath/aabb.h</locationURI> - </link> - <link> - <name>src/kazmath/include/kazmath/kazmath.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/kazmath/include/kazmath/kazmath.h</locationURI> - </link> - <link> - <name>src/kazmath/include/kazmath/mat3.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/kazmath/include/kazmath/mat3.h</locationURI> - </link> - <link> - <name>src/kazmath/include/kazmath/mat4.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/kazmath/include/kazmath/mat4.h</locationURI> - </link> - <link> - <name>src/kazmath/include/kazmath/neon_matrix_impl.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/kazmath/include/kazmath/neon_matrix_impl.h</locationURI> - </link> - <link> - <name>src/kazmath/include/kazmath/plane.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/kazmath/include/kazmath/plane.h</locationURI> - </link> - <link> - <name>src/kazmath/include/kazmath/quaternion.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/kazmath/include/kazmath/quaternion.h</locationURI> - </link> - <link> - <name>src/kazmath/include/kazmath/ray2.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/kazmath/include/kazmath/ray2.h</locationURI> - </link> - <link> - <name>src/kazmath/include/kazmath/utility.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/kazmath/include/kazmath/utility.h</locationURI> - </link> - <link> - <name>src/kazmath/include/kazmath/vec2.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/kazmath/include/kazmath/vec2.h</locationURI> - </link> - <link> - <name>src/kazmath/include/kazmath/vec3.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/kazmath/include/kazmath/vec3.h</locationURI> - </link> - <link> - <name>src/kazmath/include/kazmath/vec4.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/kazmath/include/kazmath/vec4.h</locationURI> - </link> - <link> - <name>src/kazmath/src/GL/mat4stack.c</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/kazmath/src/GL/mat4stack.c</locationURI> - </link> - <link> - <name>src/kazmath/src/GL/matrix.c</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/kazmath/src/GL/matrix.c</locationURI> - </link> - <link> - <name>src/kazmath/include/kazmath/GL/mat4stack.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/kazmath/include/kazmath/GL/mat4stack.h</locationURI> - </link> - <link> - <name>src/kazmath/include/kazmath/GL/matrix.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/kazmath/include/kazmath/GL/matrix.h</locationURI> - </link> - </linkedResources> -</projectDescription> diff --git a/cocos2dx/proj.tizen/src/placeholder.txt b/cocos2dx/proj.tizen/src/placeholder.txt deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/cocos2dx/support/user_default/Archive.zip b/cocos2dx/support/user_default/Archive.zip deleted file mode 100644 index d49a8a7521a042b9a0f72a09b3ff8b15ab86f1df..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5975 zcmciGWl&tpx(49EUBci_2<~JEkl-2|g1fs8ZXpahOo9c1yUT`P!7Vrh2r_7Jceg>3 zo7_|9?CgEdJ@?;TU0v0yYV}*+xBAaht*(TEN({jKIe3zwQh?tcLI5E^T3Xw~+Fi!l z#@x%vliS%@TMrjtlxv~Ulw+ZBi9`%IG;sEqe@XQHU65>Kg(4(5#pvh@X?uYx`lE8> zkoPhfTI{k|AY|h(8HKJG*O}{Y4FNV!o)A6*8zm>h90lub{BJjRlXv5bUY|k5u|4xI zRStNP*g#t<zNhzeKf?S#vG2)_YQGk1w5m%$tkWuA99~^sUhXa}r1Wx#E8Mf9ibI&* z&K;nWRs)NMogrjT(c>}B3xPa(I1`u|C+O3hs&0}XB^vRIZZsiQ&)4~c_RTV43LAwp zs>5;fXe<hOO~>@oZutnC-Y&R;Le4e@Cq%B<O1)tN=AWPhP6e{AL`o#gQ5)Uu^3N9# z);@`T5azRI7#EpsERcOhbHiZ@%h{yPl3}P%M~$Y}HmrgfE$1)4Gpt`4Mi$qv@4Sq< zc1l<?lM3}9onWskpy`dP0+2|Pij|FyEbjG3y&O)HP+?NWiZ<fO*PbJ#6F7SYhDuSG zZpdL$B_rsbso96^w6S95Io7z)hF7Y|G10hZL??`LHd`#vK0-E6%xjjyaqsruHxmB9 znMof^kx-IrC9W0R$Dd#^L9f6E2xJNNBKC-HDavvu;RaR7y}o-TATY*7o}S;}ueL8~ z{OP1=DMV?pom|C90$Wqy;F@<Y)S)#}uzB1Oa^>RWkc7sliS$~Cc83ywPtJ#Tcel?` zs6V`KAOa!=ciwP_ZIl^Qn&Dh~1|L2`6D!-km1tOQAl})pmo&O#1Zt6&7ghMMpiG6G z_E5)i;*snym`V%YGQ-9r(#*5-^r%q|xx|9Ka`DlhC?R=;pr;f(_LN`0F8Y4k74ddF zr+9UxDWbV_8%1S6s-+o4o31{m7=LPp(o{g|nH}vo7TW5WR6gJPlC?L+hIABG3O-h| z%wqLp>XV~0CVNTK$Ww5xt^(JX2s=h|n37xu4mSw&IpT!71x;bc&%$0<e#d?fkeVC& zt_C<>9;=@@4?9cm$RiB#Z+M}gw_ur7i#0K6Et-uWD>Q8M{lsL9p}Hq~TDEw2RV}6b zO8g~^W3RaQ5KiDK_A!JELB|w=99ex|OBJ5g(HQHnGrSJPk>)3$Ts(s7jLf8o(hz7- zwTXl!^B~FB_Lqv)q@B!|_Q&B*xoArEai8DEeQsGbo1ej$hpR_Y!rz|cNR~*p;DL$F zbzX3ogn>b(@4kZq3`{d|4@!k8=R&Z)!vzh+m@6w?(b~uBPU~J!#!PV<5?d#z+cRJd z&gb67HQT~0^fa~ZjRK;P^6Ko<g^^^q%(PnkxLBKj#p6?jxe5HT#kFb7`(1$6ux(qI z+iNs7#Os3sr6)j8w11ml(QqDXNlw--0$KE;)CKXQcj$^pgyrQd#Wj<KI+}#kT@Q5) z>z?NrM_Sc6Dk*2LJfpk5IBdBp9X)B~$!7X0)*s*;ZIjuA7AodPE}klzYT+WUMgrQS zqWIYDmC-|MU$C;FU%f<#6X&XVpPm4Xl-=yI!7PrT^bD;MDRDj}@C;j3^CEu_G@WPe z9>{Z<J&R`~{5gWeDt_FwYb=_7&7gv)3<z@wlvtPYHpa6>5j8D;RPd5%z}^hV{Qa?v zIL4#!s&KL5)%USW6(Q%*+tuW{q-`^tiAky$g1sqC2#I{e0ZDUKR)Fdr$QwWk4`)!| zF)wCy0;z3l;x3>+dwS^`LA9z`NhesaD5fe)W}W@ml#fH=qz!#l`Ga*!RTR+BXDrqn zFHd%T`Ld~7Fvv50oyfg)z05=P69s-yUWd!+8^~U*t|g1AUVf(mt8yy6<0JIP_#_tm zhKjv%eNIIj8$&i1k=mQ=TaSZ#!Nj`uupu)(55F))>-y5fD8H++<9>yC<6DT~7+b=i zrGBNuR=#zcdW^~<uU9WBL$3T;m82Dtl0N>ny}kah&g}cw+5^PIBj-D2mConUlhY0} zc25&J#r?3FK7<8SWYAc}NCqgWUL8ysD*CR9A9b>nOay*%v8v<JK!z^IFf!Q@WrhS` z<NvXkq*6|jnY?dS^|f@<a+`)*5h?tr1I>QfBkKLDgt&nz+o6j0B$wp_K80eSDIxXX zs>(Y2#HBdtYg-dQw}@GNeGBn@TLrPIhfY>~28Ucs&>xL)^etMLvZ&N`xA#S@;LlMd zt0V!MSnnC16{+7iyCxIASl66K?mY`35Sk^*Gu#x6kf-Ev<?{sh<=~^oGU<-9B<cH$ zyZE|w)tauXA#sIg+JyS9gV`5W_##!Ss2`h{^JeHli<gua9^3&hWJ$Bnl58Vy-xO}6 zn;UgM8+vs&UssF=GITs(Wj>udjz+y`7^;L~WBG7yc^|pyxt=sS9)4p&S;KeH9wBp9 z6AH``9ZDG@<^sNDU8ONNhuj->&NPOkC36$`HGaGM5q_WR5FbtEQ}TyAhvtOZxY-iy z@Cx(p4{WB^fhd&lAbNB)2~w|7q8EvvB{N;OnfB1|%rnKEm34G0l7+;?mkHQB`71O> zCRGYaEs965g`+z6r);Bitn3(wLHZt3?H4TFydn!&fzgi}YNWmxB=2jVyyOeUIczhh zNT0%WTvgb*BcL1VL}@DqXEvq`4a!4rsGh7s@VTpd_>?jVxF0-)tMA@GKjRDUtoJ*Q znM852chke~>EZOfO=Wb~^AC^vQpUw-!>@n_1e*0`r{e<o$~?$>e&?T&cf!qYfit)@ zsyAO07(2jDO}?!MAJ1k!B3GFL>SJ!J&*(12xF6c+-OJ8u)z;;U-^4d3-V>O|;$fIx zo)>jg@$dka1X%%hw09rA-|d=u!eg}oja&U60D|+wgtaiv!_(CKa*3!`E%X8?PvRJI z)6sSX>O`lj0XF->RXJ&*qh!TKF<m(k=2R>Pn!=v<^C`MOUdAwN`Q%WdCMd^u2=t2| z6q+RBNcJi47D$F+pBKn@lB0`lszJ)Wa9z%M(17XJoR!lO^A%ALe3ZN;@<z~e1!p<P znFzMsc~Eg9;qO|wDX`YrGPse_@LIQ@Y5j=G%|w3mie8NLRZ@&E6O)KF8$N=kD<Sd7 ztxYWCTDFP~eJv%Ke3^l`<jRr}JnVP$LMEjAVOEcNW-=(!4zrhzDh9)8cbPW5MR{x9 zn(m%9cyiIlja|%k5hsl9cJpie9X<55<@MzBXiU`)^QfbMgTSxP;nGK(VmD28*GF#; zsCJV`GJGAI9}!pR&$2G?vYWtHuJMGHQwOOS{oX*!yTu~|_KUj23zU#=-KDaN+WZKa z-W8oH>}9`BWu6F?Y{fW!z#kl|Y`@fk1O%n-`83CRAGalcnN`cwFCw@%X)p2C*$6yY z`_NekpISJ>aXwEGo@I_duEin#kVWiCl-f6nB+-l}Y(t^ycT$(Py&PUotvLsmJRTs` z;ud)}=h}tfkC6(KdQ#Y`T1+7-8zPCf9`A$mp#w=>2?LWqq8tZ-1px4J0|4qj8HxSh zcx?R}Be8xm($rK%Qd&(@kLQ;kyMOxe*Zk$jU)%n@KB<1+#%=n4LDbTW#M0Kx!t6vv zS?7d62dW;797m4ALP&)KW+Du|DW`xU$1pHRsx!arr>5VM*X)84lBtb;ol@dt9Z;CU zQK(=Ak0_0*4Gt?|C?+Kp>>B7%QKpkqq!}8d{AvyZ(~UB^)A(nD<v-`2Rg3<uS@OS| zS<=PI-PPWT+tSVLSMRew-8}tIJ5w6ErVrdU-NQ<C%iN}`YhS;cQtau&GNj^E_V=r) zqF9@==tIu<QtBRbhiEr%q$Ilb)+vLP^$iDJ-vL4s=zQ52+XJApBg_nY%}OTO4_@Bb zKiZfb+qX^~k1yK4=2OYeJsCU-<ZWze*`M*=0?pS5*@!&hWTv7VpF(MhTHwt!iM@GL z7<OmX2F|CNXT)N0xsmV&!H^&yiIT%PTN$`{7erYBsZPPl!w(yy(X4=go@mQ<8}2bi zTGQhOkn#d50>PQXr;&iilo{T$<B0~0ZH9D7g#^rzHdziv90Q5Qg`#FD?JqEKW<D=T zQ`8&=JEv|0?{qz{MwYqevkP{=8b}Hl?(fhl`Sk50GO4S7kL64MPikg-eZ2yBk8m!? zPoO;@OyZnQ371?)hRk5eaUZ)enKahE4=s4hIs)d^YsdM7daoesVBXY~8v<jN#*h^; z0_32`vI@T)J~*qGE-^;^0!c@qR5BdFpe6y=LiOydJSkg%3Azx*k$gZ$Y3I~(W7A}j zx&kA|*t$q~ixA!KIb1=0d{8Bw?m^_tJ?A5}axpxPt`=jaaYnk%q(zts=}v!=26Rm; zZv(5DWuA)1`$PyIJ$hJQm?p!qn1k`9tKrd1<9dMFXsNcCngAk`?gQ`?3VcE@&JbKC zHfdA(>QtB5$`zd!-lB-}(qd)Yewj4j7iP*-$9l_mmBnc)TQgS+20NWWxK=9N8MB?T z*}FxP7?o9W7uRmmq`LE-us?_oDGM4j#Q1BrvYpn?h8T3GJ^$!l3&($NPo^nqjiwk~ zl*YFoU;S*7+Y4fiL}DmerS<%5Rk5FGqxf@2yrmv<8DEWZf5bOhJNp;Hdl;6v*H9ZO z9MC{dy^Sc^2o`w~J+g06)+<TP1eiPk_4p&1ziQk&FK6t!PEniQ*RMC_N%J9Rk+|Fw z6w#HIl+mTfN1+8ByNUJQkn|god3?G2rhDPF+^;SMpXCBuHW^&H+tuLXcDr_0g-4v* znj=W^!vpDps5-UZm>R#;zXLZ!(LPb=Nfo?du?p>2H1xspa$_rBd*C-K-+Z}bG!7tA zIHAFP*(3ZUt%U^bG>D4zjW67mL00pd<?B3Swah|i{m}`y&2vb3Esv8K%CjLJ@Y3#W zpm2?i2N%wo#qqjRa|XGlXyGIq713;w9AJ!@GI}drBC}0Zk5CtH;h2DkR17dUgCIbX z%$>b~)x=g`<aC{m_F}*Hm6qirQ{ue{55meVz|BF42X@uB1X~!BZRV}{&(g9gTJIKM zgM-?Q`&uTD{iH`Du&2$<-eAJ!hZn6-%-G(|?|McK!OnA#{H-@I<p!$is((lv21o}A zLU&Kt4Ettfrk^|=K?vW-s$GgO2!bGn2?3s6`92qt;Y2hnd1_g4G@KV@P|G>Qz#tar zbLE-rXMlZC+mifC@-WcH;>lHD9Qk{UoHcRfgk-OPD)P8->RZtZ;ZNU4a!Of!WkHZi zt;d&ogkh+9t~<B2JLuWFC{13WqFkp^g&h$&{f?c{SI<8yhf<C47Wj<tI{2gjCHIk? zU|O8V-6@M<D>uQG$~^R#uo2k4m`mu}w&O|6lEln;uFY|Tu;(Py9}zMy`WojE<l0gY zJe9Vnxij%TEP1JOMXTlEl4wmo98nCc$cbtvdX=O_g&PBeqhQ@ih%RzbMIzXnk>6TF zmPQ(IbXNo@RVtJ|)q3}0B2{{dg343opEKq8R+wFTR9~e0P<(K^^*)m0(^gXc;$Y4{ zxQAVBgsS#vfr5fFkN>9JKi;Sscc0=@*mGeuseGusyd&CU>D((Bb}bohenH^+#bKB% zn18;i(=q<Ou*V^Ryir&vc|9;DOM-=7H$}%@0+<$1Xe#-3ht#I$7`r!3)M3N1)L1~{ z`#L_TctVtCInLITOI~Qt&Z1?cT6MX-KQDiJgGde)GV?7njp1^_A6@~_@l*Jw$Vhv` z-{PR5u6^FgDT}(npMD{x&nu)9CW!YaZo+@~z;l|51Z;1qU|%A_uCLh~jwGiTW9XoC z7-li+Xit-S(v{pA9NDCc&Ec2gu^#d^m_nz4?1-y(0HFb4UR<@Fx~n$ce;etr&ctF* z;ILCcl0ZGK*A0)vFcv#J_*fNQyu(C?X{iJh-O@~?j(>MS9*)95-Rgp{O|!pkU0gB4 z#Q4@3x^64w&`mTEv2M{AnLtfD8XhGh5DLv>px$}v{q>xIm%po#L$03k;tj_&`}_^s zI|z<*9#8+RmXGHr=9Idxt4_&j-!)2W?N&}uYsPBj%o`%R@7L6MC<xWm8C513>(%vK zQjh6%t?~vqD?*APk0X@pP)~0BN!zqIdBRBx3B2sH^?tlDU)JHPxpe=g+0w5Sz^6Jb zpDO)|i%WtWn;L>@LNteisz6@+-i`qHMRNpq9<ZgujuKi~&)URR8Qh2Gg5D>v7gQB1 z=*6(l`SxmY%-;Z8i9?hk{G_;)Mibh7b-EUS8vnrY(T7Q&ef*)p{-vY#ntlOYsK>au z4Y|3Ls~tS;jj2Ox*$LanT36fPSkeSjA%uDh$Z{d<>E&$e9oQbe@o_md(e{1ZzO0h3 z_y?7s&c!0P?3LT`IjxAKCb;-{M<xnL8gjYMtW{>3_3C>^+^a~{yG(WGic+ic;+nzr zJCYL@=vDQs@bg^u6+b!clt3l|Lc!iUFAqibn~%)eq3c1m+VR>vY0~$l889FLeoi#O z4P;2li8@o4<RmfQmx2B!5a(@{NOEFf;3dv>ik3!JR{QSFCC%K_O8fHM)O77opMz@E z1n^T*@sm@&uhcHFIOn&uLh-rX%&Y5LwJXjV#0FNPTX9!U3!Et$vdL~z7;bDa7lgiw z@En1GeP0P1n+!#GP6dgNvl)UsxR+>|S0{NosIt1nI9PD>FNJTb-0g_z*D{?RQk^Q) zsKp-j`uy<;qk7Krrsh^aCf8>2eB>6#cCPhw9o>EH_(VWtd0d^VZJMV8eZ*t{Yl6cN z#EMvI&nxLDcVvc~4w`BhK6rIn!p1Oo@(WF%)0F-gI&YTLQh{k5Qg&|g-@)D4H=<u^ zc{0RhIKjH9A{$@#iW$54H>U|0u&FkUw>1KfYhp@poN=We2XxQwY!Is&$W`FkO&Ck? zeNh@t)5UwLzgRcr_NCsSjZq#|B5+vj)%ZyDW9_c`dx31c2ZCREyJq}$XZMq;g>3&x zZ;b!Joc{rG|IhYBLMB1^)6BmkoDhKf&-+`60?4oB|70`fzwU3<m3}4tZ)pEB=|NKd z=SRO09`j#>|3}21#r%$Bs=pKy^n1j=<NV+2`bX$5U;ln~<bMeT;ry+`zZ??gzqI{( nnZFW$FO%^viD$&Wb^5n5|JQId^k2Uk?dOO`0syK=e!cw{N=L3O diff --git a/create-multi-platform-projects.py b/create-multi-platform-projects.py deleted file mode 100755 index 64540fba17..0000000000 --- a/create-multi-platform-projects.py +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env python -# filename = create-multi-platform-projects.py - -import os -from tools.project_creator import create_project - -if __name__ == '__main__': - root = os.path.abspath(os.path.dirname(__file__)) - os.chdir(os.path.join(root, 'tools/project_creator/')) - create_project.createPlatformProjects() diff --git a/document/Groups.h b/docs/Groups.h similarity index 100% rename from document/Groups.h rename to docs/Groups.h diff --git a/document/MainPage.h b/docs/MainPage.h similarity index 100% rename from document/MainPage.h rename to docs/MainPage.h diff --git a/document/doxygen.config b/docs/doxygen.config similarity index 100% rename from document/doxygen.config rename to docs/doxygen.config diff --git a/document/.gitignore b/document/.gitignore deleted file mode 100644 index 0120db9877..0000000000 --- a/document/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -html/ -.tee-*.txt - diff --git a/extensions/proj.emscripten/Makefile b/extensions/proj.emscripten/Makefile deleted file mode 100644 index e2ded4d8c0..0000000000 --- a/extensions/proj.emscripten/Makefile +++ /dev/null @@ -1,140 +0,0 @@ -TARGET = libextension.a - -COCOS_ROOT=../.. - -INCLUDES = -I$(COCOS_ROOT)/external \ - -I$(COCOS_ROOT)/external/chipmunk/include/chipmunk \ - -I$(COCOS_ROOT)/CocosDenshion/include \ - -I.. \ - -I../CCBReader \ - -I../GUI/CCControlExtension \ - -I../network \ - -I../GUI/CCEditBox \ - -I../CocoStudio/Components \ - -I../CocoStudio/Armature - -DEFINES += -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 -DEFINES += -D__CC_PLATFORM_IMAGE_CPP__ - -SOURCES = ../CCBReader/CCBFileLoader.cpp \ -../CCBReader/CCMenuItemImageLoader.cpp \ -../CCBReader/CCBReader.cpp \ -../CCBReader/CCMenuItemLoader.cpp \ -../CCBReader/CCControlButtonLoader.cpp \ -../CCBReader/CCNodeLoader.cpp \ -../CCBReader/CCControlLoader.cpp \ -../CCBReader/CCNodeLoaderLibrary.cpp \ -../CCBReader/CCLabelBMFontLoader.cpp \ -../CCBReader/CCParticleSystemQuadLoader.cpp \ -../CCBReader/CCLabelTTFLoader.cpp \ -../CCBReader/CCScale9SpriteLoader.cpp \ -../CCBReader/CCLayerColorLoader.cpp \ -../CCBReader/CCScrollViewLoader.cpp \ -../CCBReader/CCLayerGradientLoader.cpp \ -../CCBReader/CCSpriteLoader.cpp \ -../CCBReader/CCLayerLoader.cpp \ -../CCBReader/CCBAnimationManager.cpp \ -../CCBReader/CCBKeyframe.cpp \ -../CCBReader/CCBSequence.cpp \ -../CCBReader/CCBSequenceProperty.cpp \ -../CCBReader/CCBValue.cpp \ -../CCBReader/CCNode+CCBRelativePositioning.cpp \ -../GUI/CCScrollView/CCScrollView.cpp \ -../GUI/CCScrollView/CCSorting.cpp \ -../GUI/CCScrollView/CCTableView.cpp \ -../GUI/CCScrollView/CCTableViewCell.cpp \ -../GUI/CCControlExtension/CCControlButton.cpp \ -../GUI/CCControlExtension/CCControlColourPicker.cpp \ -../GUI/CCControlExtension/CCControl.cpp \ -../GUI/CCControlExtension/CCControlHuePicker.cpp \ -../GUI/CCControlExtension/CCControlSaturationBrightnessPicker.cpp \ -../GUI/CCControlExtension/CCControlSlider.cpp \ -../GUI/CCControlExtension/CCControlSwitch.cpp \ -../GUI/CCControlExtension/CCControlUtils.cpp \ -../GUI/CCControlExtension/CCInvocation.cpp \ -../GUI/CCControlExtension/CCScale9Sprite.cpp \ -../GUI/CCControlExtension/CCControlPotentiometer.cpp \ -../GUI/CCControlExtension/CCControlStepper.cpp \ -../GUI/CCEditBox/CCEditBox.cpp \ -../GUI/CCEditBox/CCEditBoxImplNone.cpp \ -../physics_nodes/CCPhysicsDebugNode.cpp \ -../physics_nodes/CCPhysicsSprite.cpp \ -../CocoStudio/Armature/CCArmature.cpp \ -../CocoStudio/Armature/CCBone.cpp \ -../CocoStudio/Armature/animation/CCArmatureAnimation.cpp \ -../CocoStudio/Armature/animation/CCProcessBase.cpp \ -../CocoStudio/Armature/animation/CCTween.cpp \ -../CocoStudio/Armature/datas/CCDatas.cpp \ -../CocoStudio/Armature/display/CCBatchNode.cpp \ -../CocoStudio/Armature/display/CCDecorativeDisplay.cpp \ -../CocoStudio/Armature/display/CCDisplayFactory.cpp \ -../CocoStudio/Armature/display/CCDisplayManager.cpp \ -../CocoStudio/Armature/display/CCSkin.cpp \ -../CocoStudio/Armature/physics/CCColliderDetector.cpp \ -../CocoStudio/Armature/utils/CCArmatureDefine.cpp \ -../CocoStudio/Armature/utils/CCArmatureDataManager.cpp \ -../CocoStudio/Armature/utils/CCDataReaderHelper.cpp \ -../CocoStudio/Armature/utils/CCSpriteFrameCacheHelper.cpp \ -../CocoStudio/Armature/utils/CCTransformHelp.cpp \ -../CocoStudio/Armature/utils/CCTweenFunction.cpp \ -../CocoStudio/Armature/utils/CCUtilMath.cpp \ -../CocoStudio/Components/CCComAttribute.cpp \ -../CocoStudio/Components/CCComAudio.cpp \ -../CocoStudio/Components/CCComController.cpp \ -../CocoStudio/Components/CCComRender.cpp \ -../CocoStudio/Components/CCInputDelegate.cpp \ -../CocoStudio/GUI/BaseClasses/UIRootWidget.cpp \ -../CocoStudio/GUI/BaseClasses/UIWidget.cpp \ -../CocoStudio/GUI/Layouts/Layout.cpp \ -../CocoStudio/GUI/Layouts/LayoutParameter.cpp \ -../CocoStudio/GUI/Layouts/UILayoutDefine.cpp \ -../CocoStudio/GUI/System/CocosGUI.cpp \ -../CocoStudio/GUI/System/UIHelper.cpp \ -../CocoStudio/GUI/System/UIInputManager.cpp \ -../CocoStudio/GUI/System/UILayer.cpp \ -../CocoStudio/GUI/UIWidgets/UIButton.cpp \ -../CocoStudio/GUI/UIWidgets/UICheckBox.cpp \ -../CocoStudio/GUI/UIWidgets/UIImageView.cpp \ -../CocoStudio/GUI/UIWidgets/UILabel.cpp \ -../CocoStudio/GUI/UIWidgets/UILabelAtlas.cpp \ -../CocoStudio/GUI/UIWidgets/UILabelBMFont.cpp \ -../CocoStudio/GUI/UIWidgets/UILoadingBar.cpp \ -../CocoStudio/GUI/UIWidgets/UISlider.cpp \ -../CocoStudio/GUI/UIWidgets/UITextField.cpp \ -../CocoStudio/GUI/UIWidgets/ScrollWidget/UIDragPanel.cpp \ -../CocoStudio/GUI/UIWidgets/ScrollWidget/UIListView.cpp \ -../CocoStudio/GUI/UIWidgets/ScrollWidget/UIPageView.cpp \ -../CocoStudio/GUI/UIWidgets/ScrollWidget/UIScrollView.cpp \ -../CocoStudio/Json/CSContentJsonDictionary.cpp \ -../CocoStudio/Json/DictionaryHelper.cpp \ -../CocoStudio/Json/lib_json/json_reader.cpp \ -../CocoStudio/Json/lib_json/json_value.cpp \ -../CocoStudio/Json/lib_json/json_writer.cpp \ -../CocoStudio/Reader/CCSGUIReader.cpp \ -../CocoStudio/Reader/CCSSceneReader.cpp \ -../CocoStudio/Action/CCActionFrame.cpp \ -../CocoStudio/Action/CCActionFrameEasing.cpp \ -../CocoStudio/Action/CCActionManagerEx.cpp \ -../CocoStudio/Action/CCActionNode.cpp \ -../CocoStudio/Action/CCActionObject.cpp \ -../CCDeprecated-ext.cpp - -include $(COCOS_ROOT)/cocos2dx/proj.emscripten/cocos2dx.mk - -CXXFLAGS += -Wno-multichar - -TARGET := $(LIB_DIR)/$(TARGET) - -all: $(TARGET) - -$(TARGET): $(OBJECTS) $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(AR) $(ARFLAGS) $@ $(OBJECTS) - -$(OBJ_DIR)/%.o: ../%.cpp $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@ - -$(OBJ_DIR)/%.o: ../%.c $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(CC) $(CCFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@ diff --git a/extensions/proj.ios/extensions-Prefix.pch b/extensions/proj.ios/extensions-Prefix.pch deleted file mode 100644 index a6bbd380f6..0000000000 --- a/extensions/proj.ios/extensions-Prefix.pch +++ /dev/null @@ -1,7 +0,0 @@ -// -// Prefix header for all source files of the 'extensions' target in the 'extensions' project -// - -#ifdef __OBJC__ - #import <Foundation/Foundation.h> -#endif diff --git a/extensions/proj.ios/extensions.xcodeproj/project.pbxproj b/extensions/proj.ios/extensions.xcodeproj/project.pbxproj deleted file mode 100644 index 27b4f0923e..0000000000 --- a/extensions/proj.ios/extensions.xcodeproj/project.pbxproj +++ /dev/null @@ -1,1123 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 1A0C0A7E1777F79700838530 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A0C0A7D1777F79700838530 /* Foundation.framework */; }; - 1A0C0CEA1777F9CD00838530 /* AssetsManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0BF01777F9CD00838530 /* AssetsManager.cpp */; }; - 1A0C0D051777F9CD00838530 /* CCBAnimationManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C3E1777F9CD00838530 /* CCBAnimationManager.cpp */; }; - 1A0C0D061777F9CD00838530 /* CCBFileLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C401777F9CD00838530 /* CCBFileLoader.cpp */; }; - 1A0C0D071777F9CD00838530 /* CCBKeyframe.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C421777F9CD00838530 /* CCBKeyframe.cpp */; }; - 1A0C0D081777F9CD00838530 /* CCBReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C451777F9CD00838530 /* CCBReader.cpp */; }; - 1A0C0D091777F9CD00838530 /* CCBSequence.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C481777F9CD00838530 /* CCBSequence.cpp */; }; - 1A0C0D0A1777F9CD00838530 /* CCBSequenceProperty.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C4A1777F9CD00838530 /* CCBSequenceProperty.cpp */; }; - 1A0C0D0B1777F9CD00838530 /* CCBValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C4C1777F9CD00838530 /* CCBValue.cpp */; }; - 1A0C0D0C1777F9CD00838530 /* CCControlButtonLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C4E1777F9CD00838530 /* CCControlButtonLoader.cpp */; }; - 1A0C0D0D1777F9CD00838530 /* CCControlLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C501777F9CD00838530 /* CCControlLoader.cpp */; }; - 1A0C0D0E1777F9CD00838530 /* CCLabelBMFontLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C521777F9CD00838530 /* CCLabelBMFontLoader.cpp */; }; - 1A0C0D0F1777F9CD00838530 /* CCLabelTTFLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C541777F9CD00838530 /* CCLabelTTFLoader.cpp */; }; - 1A0C0D101777F9CD00838530 /* CCLayerColorLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C561777F9CD00838530 /* CCLayerColorLoader.cpp */; }; - 1A0C0D111777F9CD00838530 /* CCLayerGradientLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C581777F9CD00838530 /* CCLayerGradientLoader.cpp */; }; - 1A0C0D121777F9CD00838530 /* CCLayerLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C5A1777F9CD00838530 /* CCLayerLoader.cpp */; }; - 1A0C0D131777F9CD00838530 /* CCMenuItemImageLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C5C1777F9CD00838530 /* CCMenuItemImageLoader.cpp */; }; - 1A0C0D141777F9CD00838530 /* CCMenuItemLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C5E1777F9CD00838530 /* CCMenuItemLoader.cpp */; }; - 1A0C0D151777F9CD00838530 /* CCNode+CCBRelativePositioning.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C611777F9CD00838530 /* CCNode+CCBRelativePositioning.cpp */; }; - 1A0C0D161777F9CD00838530 /* CCNodeLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C631777F9CD00838530 /* CCNodeLoader.cpp */; }; - 1A0C0D171777F9CD00838530 /* CCNodeLoaderLibrary.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C651777F9CD00838530 /* CCNodeLoaderLibrary.cpp */; }; - 1A0C0D181777F9CD00838530 /* CCParticleSystemQuadLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C681777F9CD00838530 /* CCParticleSystemQuadLoader.cpp */; }; - 1A0C0D191777F9CD00838530 /* CCScale9SpriteLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C6A1777F9CD00838530 /* CCScale9SpriteLoader.cpp */; }; - 1A0C0D1A1777F9CD00838530 /* CCScrollViewLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C6C1777F9CD00838530 /* CCScrollViewLoader.cpp */; }; - 1A0C0D1B1777F9CD00838530 /* CCSpriteLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C6E1777F9CD00838530 /* CCSpriteLoader.cpp */; }; - 1A0C0D201777F9CD00838530 /* CCControl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C7D1777F9CD00838530 /* CCControl.cpp */; }; - 1A0C0D211777F9CD00838530 /* CCControlButton.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C7F1777F9CD00838530 /* CCControlButton.cpp */; }; - 1A0C0D221777F9CD00838530 /* CCControlColourPicker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C811777F9CD00838530 /* CCControlColourPicker.cpp */; }; - 1A0C0D231777F9CD00838530 /* CCControlHuePicker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C841777F9CD00838530 /* CCControlHuePicker.cpp */; }; - 1A0C0D241777F9CD00838530 /* CCControlPotentiometer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C861777F9CD00838530 /* CCControlPotentiometer.cpp */; }; - 1A0C0D251777F9CD00838530 /* CCControlSaturationBrightnessPicker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C881777F9CD00838530 /* CCControlSaturationBrightnessPicker.cpp */; }; - 1A0C0D261777F9CD00838530 /* CCControlSlider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C8A1777F9CD00838530 /* CCControlSlider.cpp */; }; - 1A0C0D271777F9CD00838530 /* CCControlStepper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C8C1777F9CD00838530 /* CCControlStepper.cpp */; }; - 1A0C0D281777F9CD00838530 /* CCControlSwitch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C8E1777F9CD00838530 /* CCControlSwitch.cpp */; }; - 1A0C0D291777F9CD00838530 /* CCControlUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C901777F9CD00838530 /* CCControlUtils.cpp */; }; - 1A0C0D2A1777F9CD00838530 /* CCInvocation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C921777F9CD00838530 /* CCInvocation.cpp */; }; - 1A0C0D2B1777F9CD00838530 /* CCScale9Sprite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C941777F9CD00838530 /* CCScale9Sprite.cpp */; }; - 1A0C0D2C1777F9CD00838530 /* CCEditBox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C971777F9CD00838530 /* CCEditBox.cpp */; }; - 1A0C0D2D1777F9CD00838530 /* CCEditBoxImplAndroid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C9A1777F9CD00838530 /* CCEditBoxImplAndroid.cpp */; }; - 1A0C0D2E1777F9CD00838530 /* CCEditBoxImplIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C9D1777F9CD00838530 /* CCEditBoxImplIOS.mm */; }; - 1A0C0D2F1777F9CD00838530 /* CCEditBoxImplMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C9F1777F9CD00838530 /* CCEditBoxImplMac.mm */; }; - 1A0C0D301777F9CD00838530 /* CCEditBoxImplNone.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CA01777F9CD00838530 /* CCEditBoxImplNone.cpp */; }; - 1A0C0D311777F9CD00838530 /* CCEditBoxImplTizen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CA11777F9CD00838530 /* CCEditBoxImplTizen.cpp */; }; - 1A0C0D321777F9CD00838530 /* CCEditBoxImplWin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CA31777F9CD00838530 /* CCEditBoxImplWin.cpp */; }; - 1A0C0D331777F9CD00838530 /* CCScrollView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CA61777F9CD00838530 /* CCScrollView.cpp */; }; - 1A0C0D341777F9CD00838530 /* CCSorting.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CA81777F9CD00838530 /* CCSorting.cpp */; }; - 1A0C0D351777F9CD00838530 /* CCTableView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CAA1777F9CD00838530 /* CCTableView.cpp */; }; - 1A0C0D361777F9CD00838530 /* CCTableViewCell.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CAC1777F9CD00838530 /* CCTableViewCell.cpp */; }; - 1A0C0D371777F9CD00838530 /* LocalStorage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CAF1777F9CD00838530 /* LocalStorage.cpp */; }; - 1A0C0D381777F9CD00838530 /* LocalStorageAndroid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CB11777F9CD00838530 /* LocalStorageAndroid.cpp */; }; - 1A0C0D391777F9CD00838530 /* HttpClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CB31777F9CD00838530 /* HttpClient.cpp */; }; - 1A0C0D3A1777F9CD00838530 /* WebSocket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CB71777F9CD00838530 /* WebSocket.cpp */; }; - 1A0C0D3B1777F9CD00838530 /* CCPhysicsDebugNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CBA1777F9CD00838530 /* CCPhysicsDebugNode.cpp */; }; - 1A0C0D3C1777F9CD00838530 /* CCPhysicsSprite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CBC1777F9CD00838530 /* CCPhysicsSprite.cpp */; }; - 1A0C0D3D1777F9CD00838530 /* Animation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CBF1777F9CD00838530 /* Animation.cpp */; }; - 1A0C0D3E1777F9CD00838530 /* AnimationState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CC11777F9CD00838530 /* AnimationState.cpp */; }; - 1A0C0D3F1777F9CD00838530 /* AnimationStateData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CC31777F9CD00838530 /* AnimationStateData.cpp */; }; - 1A0C0D401777F9CD00838530 /* Atlas.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CC51777F9CD00838530 /* Atlas.cpp */; }; - 1A0C0D411777F9CD00838530 /* AtlasAttachmentLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CC71777F9CD00838530 /* AtlasAttachmentLoader.cpp */; }; - 1A0C0D421777F9CD00838530 /* Attachment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CC91777F9CD00838530 /* Attachment.cpp */; }; - 1A0C0D431777F9CD00838530 /* AttachmentLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CCB1777F9CD00838530 /* AttachmentLoader.cpp */; }; - 1A0C0D441777F9CD00838530 /* Bone.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CCD1777F9CD00838530 /* Bone.cpp */; }; - 1A0C0D451777F9CD00838530 /* BoneData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CCF1777F9CD00838530 /* BoneData.cpp */; }; - 1A0C0D461777F9CD00838530 /* CCSkeleton.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CD11777F9CD00838530 /* CCSkeleton.cpp */; }; - 1A0C0D471777F9CD00838530 /* CCSkeletonAnimation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CD31777F9CD00838530 /* CCSkeletonAnimation.cpp */; }; - 1A0C0D481777F9CD00838530 /* extension.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CD51777F9CD00838530 /* extension.cpp */; }; - 1A0C0D491777F9CD00838530 /* Json.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CD71777F9CD00838530 /* Json.cpp */; }; - 1A0C0D4A1777F9CD00838530 /* RegionAttachment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CD91777F9CD00838530 /* RegionAttachment.cpp */; }; - 1A0C0D4B1777F9CD00838530 /* Skeleton.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CDB1777F9CD00838530 /* Skeleton.cpp */; }; - 1A0C0D4C1777F9CD00838530 /* SkeletonData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CDD1777F9CD00838530 /* SkeletonData.cpp */; }; - 1A0C0D4D1777F9CD00838530 /* SkeletonJson.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CDF1777F9CD00838530 /* SkeletonJson.cpp */; }; - 1A0C0D4E1777F9CD00838530 /* Skin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CE11777F9CD00838530 /* Skin.cpp */; }; - 1A0C0D4F1777F9CD00838530 /* Slot.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CE31777F9CD00838530 /* Slot.cpp */; }; - 1A0C0D501777F9CD00838530 /* SlotData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CE51777F9CD00838530 /* SlotData.cpp */; }; - 1A0C0D511777F9CD00838530 /* spine-cocos2dx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CE71777F9CD00838530 /* spine-cocos2dx.cpp */; }; - 1A0C0D581777FAAD00838530 /* libwebsockets.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A0C0D571777FAAD00838530 /* libwebsockets.a */; }; - 1A0C0D5A1777FB1300838530 /* libcurl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A0C0D591777FB1300838530 /* libcurl.a */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 1A0C0A781777F79700838530 /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = "include/${PRODUCT_NAME}"; - dstSubfolderSpec = 16; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 1A0C0A7A1777F79700838530 /* libextensions.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libextensions.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 1A0C0A7D1777F79700838530 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; - 1A0C0A8B1777F7DD00838530 /* extensions-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "extensions-Prefix.pch"; sourceTree = "<group>"; }; - 1A0C0BF01777F9CD00838530 /* AssetsManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AssetsManager.cpp; sourceTree = "<group>"; }; - 1A0C0BF11777F9CD00838530 /* AssetsManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AssetsManager.h; sourceTree = "<group>"; }; - 1A0C0C3E1777F9CD00838530 /* CCBAnimationManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCBAnimationManager.cpp; sourceTree = "<group>"; }; - 1A0C0C3F1777F9CD00838530 /* CCBAnimationManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCBAnimationManager.h; sourceTree = "<group>"; }; - 1A0C0C401777F9CD00838530 /* CCBFileLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCBFileLoader.cpp; sourceTree = "<group>"; }; - 1A0C0C411777F9CD00838530 /* CCBFileLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCBFileLoader.h; sourceTree = "<group>"; }; - 1A0C0C421777F9CD00838530 /* CCBKeyframe.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCBKeyframe.cpp; sourceTree = "<group>"; }; - 1A0C0C431777F9CD00838530 /* CCBKeyframe.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCBKeyframe.h; sourceTree = "<group>"; }; - 1A0C0C441777F9CD00838530 /* CCBMemberVariableAssigner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCBMemberVariableAssigner.h; sourceTree = "<group>"; }; - 1A0C0C451777F9CD00838530 /* CCBReader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCBReader.cpp; sourceTree = "<group>"; }; - 1A0C0C461777F9CD00838530 /* CCBReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCBReader.h; sourceTree = "<group>"; }; - 1A0C0C471777F9CD00838530 /* CCBSelectorResolver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCBSelectorResolver.h; sourceTree = "<group>"; }; - 1A0C0C481777F9CD00838530 /* CCBSequence.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCBSequence.cpp; sourceTree = "<group>"; }; - 1A0C0C491777F9CD00838530 /* CCBSequence.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCBSequence.h; sourceTree = "<group>"; }; - 1A0C0C4A1777F9CD00838530 /* CCBSequenceProperty.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCBSequenceProperty.cpp; sourceTree = "<group>"; }; - 1A0C0C4B1777F9CD00838530 /* CCBSequenceProperty.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCBSequenceProperty.h; sourceTree = "<group>"; }; - 1A0C0C4C1777F9CD00838530 /* CCBValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCBValue.cpp; sourceTree = "<group>"; }; - 1A0C0C4D1777F9CD00838530 /* CCBValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCBValue.h; sourceTree = "<group>"; }; - 1A0C0C4E1777F9CD00838530 /* CCControlButtonLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlButtonLoader.cpp; sourceTree = "<group>"; }; - 1A0C0C4F1777F9CD00838530 /* CCControlButtonLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCControlButtonLoader.h; sourceTree = "<group>"; }; - 1A0C0C501777F9CD00838530 /* CCControlLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlLoader.cpp; sourceTree = "<group>"; }; - 1A0C0C511777F9CD00838530 /* CCControlLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCControlLoader.h; sourceTree = "<group>"; }; - 1A0C0C521777F9CD00838530 /* CCLabelBMFontLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCLabelBMFontLoader.cpp; sourceTree = "<group>"; }; - 1A0C0C531777F9CD00838530 /* CCLabelBMFontLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCLabelBMFontLoader.h; sourceTree = "<group>"; }; - 1A0C0C541777F9CD00838530 /* CCLabelTTFLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCLabelTTFLoader.cpp; sourceTree = "<group>"; }; - 1A0C0C551777F9CD00838530 /* CCLabelTTFLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCLabelTTFLoader.h; sourceTree = "<group>"; }; - 1A0C0C561777F9CD00838530 /* CCLayerColorLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCLayerColorLoader.cpp; sourceTree = "<group>"; }; - 1A0C0C571777F9CD00838530 /* CCLayerColorLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCLayerColorLoader.h; sourceTree = "<group>"; }; - 1A0C0C581777F9CD00838530 /* CCLayerGradientLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCLayerGradientLoader.cpp; sourceTree = "<group>"; }; - 1A0C0C591777F9CD00838530 /* CCLayerGradientLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCLayerGradientLoader.h; sourceTree = "<group>"; }; - 1A0C0C5A1777F9CD00838530 /* CCLayerLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCLayerLoader.cpp; sourceTree = "<group>"; }; - 1A0C0C5B1777F9CD00838530 /* CCLayerLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCLayerLoader.h; sourceTree = "<group>"; }; - 1A0C0C5C1777F9CD00838530 /* CCMenuItemImageLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCMenuItemImageLoader.cpp; sourceTree = "<group>"; }; - 1A0C0C5D1777F9CD00838530 /* CCMenuItemImageLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCMenuItemImageLoader.h; sourceTree = "<group>"; }; - 1A0C0C5E1777F9CD00838530 /* CCMenuItemLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCMenuItemLoader.cpp; sourceTree = "<group>"; }; - 1A0C0C5F1777F9CD00838530 /* CCMenuItemLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCMenuItemLoader.h; sourceTree = "<group>"; }; - 1A0C0C601777F9CD00838530 /* CCMenuLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCMenuLoader.h; sourceTree = "<group>"; }; - 1A0C0C611777F9CD00838530 /* CCNode+CCBRelativePositioning.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "CCNode+CCBRelativePositioning.cpp"; sourceTree = "<group>"; }; - 1A0C0C621777F9CD00838530 /* CCNode+CCBRelativePositioning.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CCNode+CCBRelativePositioning.h"; sourceTree = "<group>"; }; - 1A0C0C631777F9CD00838530 /* CCNodeLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCNodeLoader.cpp; sourceTree = "<group>"; }; - 1A0C0C641777F9CD00838530 /* CCNodeLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCNodeLoader.h; sourceTree = "<group>"; }; - 1A0C0C651777F9CD00838530 /* CCNodeLoaderLibrary.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCNodeLoaderLibrary.cpp; sourceTree = "<group>"; }; - 1A0C0C661777F9CD00838530 /* CCNodeLoaderLibrary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCNodeLoaderLibrary.h; sourceTree = "<group>"; }; - 1A0C0C671777F9CD00838530 /* CCNodeLoaderListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCNodeLoaderListener.h; sourceTree = "<group>"; }; - 1A0C0C681777F9CD00838530 /* CCParticleSystemQuadLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCParticleSystemQuadLoader.cpp; sourceTree = "<group>"; }; - 1A0C0C691777F9CD00838530 /* CCParticleSystemQuadLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCParticleSystemQuadLoader.h; sourceTree = "<group>"; }; - 1A0C0C6A1777F9CD00838530 /* CCScale9SpriteLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCScale9SpriteLoader.cpp; sourceTree = "<group>"; }; - 1A0C0C6B1777F9CD00838530 /* CCScale9SpriteLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCScale9SpriteLoader.h; sourceTree = "<group>"; }; - 1A0C0C6C1777F9CD00838530 /* CCScrollViewLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCScrollViewLoader.cpp; sourceTree = "<group>"; }; - 1A0C0C6D1777F9CD00838530 /* CCScrollViewLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCScrollViewLoader.h; sourceTree = "<group>"; }; - 1A0C0C6E1777F9CD00838530 /* CCSpriteLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCSpriteLoader.cpp; sourceTree = "<group>"; }; - 1A0C0C6F1777F9CD00838530 /* CCSpriteLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCSpriteLoader.h; sourceTree = "<group>"; }; - 1A0C0C701777F9CD00838530 /* cocos-ext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "cocos-ext.h"; path = "../cocos-ext.h"; sourceTree = "<group>"; }; - 1A0C0C7A1777F9CD00838530 /* ExtensionMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ExtensionMacros.h; path = ../ExtensionMacros.h; sourceTree = "<group>"; }; - 1A0C0C7D1777F9CD00838530 /* CCControl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCControl.cpp; sourceTree = "<group>"; }; - 1A0C0C7E1777F9CD00838530 /* CCControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCControl.h; sourceTree = "<group>"; }; - 1A0C0C7F1777F9CD00838530 /* CCControlButton.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlButton.cpp; sourceTree = "<group>"; }; - 1A0C0C801777F9CD00838530 /* CCControlButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCControlButton.h; sourceTree = "<group>"; }; - 1A0C0C811777F9CD00838530 /* CCControlColourPicker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlColourPicker.cpp; sourceTree = "<group>"; }; - 1A0C0C821777F9CD00838530 /* CCControlColourPicker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCControlColourPicker.h; sourceTree = "<group>"; }; - 1A0C0C831777F9CD00838530 /* CCControlExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCControlExtensions.h; sourceTree = "<group>"; }; - 1A0C0C841777F9CD00838530 /* CCControlHuePicker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlHuePicker.cpp; sourceTree = "<group>"; }; - 1A0C0C851777F9CD00838530 /* CCControlHuePicker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCControlHuePicker.h; sourceTree = "<group>"; }; - 1A0C0C861777F9CD00838530 /* CCControlPotentiometer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlPotentiometer.cpp; sourceTree = "<group>"; }; - 1A0C0C871777F9CD00838530 /* CCControlPotentiometer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCControlPotentiometer.h; sourceTree = "<group>"; }; - 1A0C0C881777F9CD00838530 /* CCControlSaturationBrightnessPicker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlSaturationBrightnessPicker.cpp; sourceTree = "<group>"; }; - 1A0C0C891777F9CD00838530 /* CCControlSaturationBrightnessPicker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCControlSaturationBrightnessPicker.h; sourceTree = "<group>"; }; - 1A0C0C8A1777F9CD00838530 /* CCControlSlider.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlSlider.cpp; sourceTree = "<group>"; }; - 1A0C0C8B1777F9CD00838530 /* CCControlSlider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCControlSlider.h; sourceTree = "<group>"; }; - 1A0C0C8C1777F9CD00838530 /* CCControlStepper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlStepper.cpp; sourceTree = "<group>"; }; - 1A0C0C8D1777F9CD00838530 /* CCControlStepper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCControlStepper.h; sourceTree = "<group>"; }; - 1A0C0C8E1777F9CD00838530 /* CCControlSwitch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlSwitch.cpp; sourceTree = "<group>"; }; - 1A0C0C8F1777F9CD00838530 /* CCControlSwitch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCControlSwitch.h; sourceTree = "<group>"; }; - 1A0C0C901777F9CD00838530 /* CCControlUtils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlUtils.cpp; sourceTree = "<group>"; }; - 1A0C0C911777F9CD00838530 /* CCControlUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCControlUtils.h; sourceTree = "<group>"; }; - 1A0C0C921777F9CD00838530 /* CCInvocation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCInvocation.cpp; sourceTree = "<group>"; }; - 1A0C0C931777F9CD00838530 /* CCInvocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCInvocation.h; sourceTree = "<group>"; }; - 1A0C0C941777F9CD00838530 /* CCScale9Sprite.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCScale9Sprite.cpp; sourceTree = "<group>"; }; - 1A0C0C951777F9CD00838530 /* CCScale9Sprite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCScale9Sprite.h; sourceTree = "<group>"; }; - 1A0C0C971777F9CD00838530 /* CCEditBox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCEditBox.cpp; sourceTree = "<group>"; }; - 1A0C0C981777F9CD00838530 /* CCEditBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCEditBox.h; sourceTree = "<group>"; }; - 1A0C0C991777F9CD00838530 /* CCEditBoxImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCEditBoxImpl.h; sourceTree = "<group>"; }; - 1A0C0C9A1777F9CD00838530 /* CCEditBoxImplAndroid.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCEditBoxImplAndroid.cpp; sourceTree = "<group>"; }; - 1A0C0C9B1777F9CD00838530 /* CCEditBoxImplAndroid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCEditBoxImplAndroid.h; sourceTree = "<group>"; }; - 1A0C0C9C1777F9CD00838530 /* CCEditBoxImplIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCEditBoxImplIOS.h; sourceTree = "<group>"; }; - 1A0C0C9D1777F9CD00838530 /* CCEditBoxImplIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CCEditBoxImplIOS.mm; sourceTree = "<group>"; }; - 1A0C0C9E1777F9CD00838530 /* CCEditBoxImplMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCEditBoxImplMac.h; sourceTree = "<group>"; }; - 1A0C0C9F1777F9CD00838530 /* CCEditBoxImplMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CCEditBoxImplMac.mm; sourceTree = "<group>"; }; - 1A0C0CA01777F9CD00838530 /* CCEditBoxImplNone.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCEditBoxImplNone.cpp; sourceTree = "<group>"; }; - 1A0C0CA11777F9CD00838530 /* CCEditBoxImplTizen.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCEditBoxImplTizen.cpp; sourceTree = "<group>"; }; - 1A0C0CA21777F9CD00838530 /* CCEditBoxImplTizen.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCEditBoxImplTizen.h; sourceTree = "<group>"; }; - 1A0C0CA31777F9CD00838530 /* CCEditBoxImplWin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCEditBoxImplWin.cpp; sourceTree = "<group>"; }; - 1A0C0CA41777F9CD00838530 /* CCEditBoxImplWin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCEditBoxImplWin.h; sourceTree = "<group>"; }; - 1A0C0CA61777F9CD00838530 /* CCScrollView.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCScrollView.cpp; sourceTree = "<group>"; }; - 1A0C0CA71777F9CD00838530 /* CCScrollView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCScrollView.h; sourceTree = "<group>"; }; - 1A0C0CA81777F9CD00838530 /* CCSorting.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCSorting.cpp; sourceTree = "<group>"; }; - 1A0C0CA91777F9CD00838530 /* CCSorting.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCSorting.h; sourceTree = "<group>"; }; - 1A0C0CAA1777F9CD00838530 /* CCTableView.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCTableView.cpp; sourceTree = "<group>"; }; - 1A0C0CAB1777F9CD00838530 /* CCTableView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTableView.h; sourceTree = "<group>"; }; - 1A0C0CAC1777F9CD00838530 /* CCTableViewCell.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCTableViewCell.cpp; sourceTree = "<group>"; }; - 1A0C0CAD1777F9CD00838530 /* CCTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTableViewCell.h; sourceTree = "<group>"; }; - 1A0C0CAF1777F9CD00838530 /* LocalStorage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LocalStorage.cpp; sourceTree = "<group>"; }; - 1A0C0CB01777F9CD00838530 /* LocalStorage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LocalStorage.h; sourceTree = "<group>"; }; - 1A0C0CB11777F9CD00838530 /* LocalStorageAndroid.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LocalStorageAndroid.cpp; sourceTree = "<group>"; }; - 1A0C0CB31777F9CD00838530 /* HttpClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HttpClient.cpp; sourceTree = "<group>"; }; - 1A0C0CB41777F9CD00838530 /* HttpClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HttpClient.h; sourceTree = "<group>"; }; - 1A0C0CB51777F9CD00838530 /* HttpRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HttpRequest.h; sourceTree = "<group>"; }; - 1A0C0CB61777F9CD00838530 /* HttpResponse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HttpResponse.h; sourceTree = "<group>"; }; - 1A0C0CB71777F9CD00838530 /* WebSocket.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebSocket.cpp; sourceTree = "<group>"; }; - 1A0C0CB81777F9CD00838530 /* WebSocket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSocket.h; sourceTree = "<group>"; }; - 1A0C0CBA1777F9CD00838530 /* CCPhysicsDebugNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCPhysicsDebugNode.cpp; sourceTree = "<group>"; }; - 1A0C0CBB1777F9CD00838530 /* CCPhysicsDebugNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCPhysicsDebugNode.h; sourceTree = "<group>"; }; - 1A0C0CBC1777F9CD00838530 /* CCPhysicsSprite.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCPhysicsSprite.cpp; sourceTree = "<group>"; }; - 1A0C0CBD1777F9CD00838530 /* CCPhysicsSprite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCPhysicsSprite.h; sourceTree = "<group>"; }; - 1A0C0CBF1777F9CD00838530 /* Animation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Animation.cpp; sourceTree = "<group>"; }; - 1A0C0CC01777F9CD00838530 /* Animation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Animation.h; sourceTree = "<group>"; }; - 1A0C0CC11777F9CD00838530 /* AnimationState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AnimationState.cpp; sourceTree = "<group>"; }; - 1A0C0CC21777F9CD00838530 /* AnimationState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AnimationState.h; sourceTree = "<group>"; }; - 1A0C0CC31777F9CD00838530 /* AnimationStateData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AnimationStateData.cpp; sourceTree = "<group>"; }; - 1A0C0CC41777F9CD00838530 /* AnimationStateData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AnimationStateData.h; sourceTree = "<group>"; }; - 1A0C0CC51777F9CD00838530 /* Atlas.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Atlas.cpp; sourceTree = "<group>"; }; - 1A0C0CC61777F9CD00838530 /* Atlas.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Atlas.h; sourceTree = "<group>"; }; - 1A0C0CC71777F9CD00838530 /* AtlasAttachmentLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AtlasAttachmentLoader.cpp; sourceTree = "<group>"; }; - 1A0C0CC81777F9CD00838530 /* AtlasAttachmentLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AtlasAttachmentLoader.h; sourceTree = "<group>"; }; - 1A0C0CC91777F9CD00838530 /* Attachment.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Attachment.cpp; sourceTree = "<group>"; }; - 1A0C0CCA1777F9CD00838530 /* Attachment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Attachment.h; sourceTree = "<group>"; }; - 1A0C0CCB1777F9CD00838530 /* AttachmentLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AttachmentLoader.cpp; sourceTree = "<group>"; }; - 1A0C0CCC1777F9CD00838530 /* AttachmentLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AttachmentLoader.h; sourceTree = "<group>"; }; - 1A0C0CCD1777F9CD00838530 /* Bone.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Bone.cpp; sourceTree = "<group>"; }; - 1A0C0CCE1777F9CD00838530 /* Bone.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Bone.h; sourceTree = "<group>"; }; - 1A0C0CCF1777F9CD00838530 /* BoneData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BoneData.cpp; sourceTree = "<group>"; }; - 1A0C0CD01777F9CD00838530 /* BoneData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BoneData.h; sourceTree = "<group>"; }; - 1A0C0CD11777F9CD00838530 /* CCSkeleton.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCSkeleton.cpp; sourceTree = "<group>"; }; - 1A0C0CD21777F9CD00838530 /* CCSkeleton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCSkeleton.h; sourceTree = "<group>"; }; - 1A0C0CD31777F9CD00838530 /* CCSkeletonAnimation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCSkeletonAnimation.cpp; sourceTree = "<group>"; }; - 1A0C0CD41777F9CD00838530 /* CCSkeletonAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCSkeletonAnimation.h; sourceTree = "<group>"; }; - 1A0C0CD51777F9CD00838530 /* extension.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = extension.cpp; sourceTree = "<group>"; }; - 1A0C0CD61777F9CD00838530 /* extension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = extension.h; sourceTree = "<group>"; }; - 1A0C0CD71777F9CD00838530 /* Json.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Json.cpp; sourceTree = "<group>"; }; - 1A0C0CD81777F9CD00838530 /* Json.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Json.h; sourceTree = "<group>"; }; - 1A0C0CD91777F9CD00838530 /* RegionAttachment.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegionAttachment.cpp; sourceTree = "<group>"; }; - 1A0C0CDA1777F9CD00838530 /* RegionAttachment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegionAttachment.h; sourceTree = "<group>"; }; - 1A0C0CDB1777F9CD00838530 /* Skeleton.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Skeleton.cpp; sourceTree = "<group>"; }; - 1A0C0CDC1777F9CD00838530 /* Skeleton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Skeleton.h; sourceTree = "<group>"; }; - 1A0C0CDD1777F9CD00838530 /* SkeletonData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SkeletonData.cpp; sourceTree = "<group>"; }; - 1A0C0CDE1777F9CD00838530 /* SkeletonData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SkeletonData.h; sourceTree = "<group>"; }; - 1A0C0CDF1777F9CD00838530 /* SkeletonJson.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SkeletonJson.cpp; sourceTree = "<group>"; }; - 1A0C0CE01777F9CD00838530 /* SkeletonJson.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SkeletonJson.h; sourceTree = "<group>"; }; - 1A0C0CE11777F9CD00838530 /* Skin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Skin.cpp; sourceTree = "<group>"; }; - 1A0C0CE21777F9CD00838530 /* Skin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Skin.h; sourceTree = "<group>"; }; - 1A0C0CE31777F9CD00838530 /* Slot.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Slot.cpp; sourceTree = "<group>"; }; - 1A0C0CE41777F9CD00838530 /* Slot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Slot.h; sourceTree = "<group>"; }; - 1A0C0CE51777F9CD00838530 /* SlotData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SlotData.cpp; sourceTree = "<group>"; }; - 1A0C0CE61777F9CD00838530 /* SlotData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SlotData.h; sourceTree = "<group>"; }; - 1A0C0CE71777F9CD00838530 /* spine-cocos2dx.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "spine-cocos2dx.cpp"; sourceTree = "<group>"; }; - 1A0C0CE81777F9CD00838530 /* spine-cocos2dx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "spine-cocos2dx.h"; sourceTree = "<group>"; }; - 1A0C0CE91777F9CD00838530 /* spine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = spine.h; sourceTree = "<group>"; }; - 1A0C0D551777FAAD00838530 /* libwebsockets.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = libwebsockets.h; sourceTree = "<group>"; }; - 1A0C0D571777FAAD00838530 /* libwebsockets.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libwebsockets.a; sourceTree = "<group>"; }; - 1A0C0D591777FB1300838530 /* libcurl.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcurl.a; path = ../../cocos2dx/platform/third_party/ios/libraries/libcurl.a; sourceTree = "<group>"; }; - 37B6EE8B17DEB3B0001BE102 /* CCArmatureAnimation.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCArmatureAnimation.cpp; sourceTree = "<group>"; }; - 37B6EE8C17DEB3B0001BE102 /* CCArmatureAnimation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCArmatureAnimation.h; sourceTree = "<group>"; }; - 37B6EE8D17DEB3B0001BE102 /* CCProcessBase.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCProcessBase.cpp; sourceTree = "<group>"; }; - 37B6EE8E17DEB3B0001BE102 /* CCProcessBase.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCProcessBase.h; sourceTree = "<group>"; }; - 37B6EE8F17DEB3B0001BE102 /* CCTween.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCTween.cpp; sourceTree = "<group>"; }; - 37B6EE9017DEB3B0001BE102 /* CCTween.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCTween.h; sourceTree = "<group>"; }; - 37B6EE9117DEB3B0001BE102 /* CCArmature.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCArmature.cpp; sourceTree = "<group>"; }; - 37B6EE9217DEB3B0001BE102 /* CCArmature.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCArmature.h; sourceTree = "<group>"; }; - 37B6EE9317DEB3B0001BE102 /* CCBone.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCBone.cpp; sourceTree = "<group>"; }; - 37B6EE9417DEB3B0001BE102 /* CCBone.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCBone.h; sourceTree = "<group>"; }; - 37B6EE9617DEB3B0001BE102 /* CCDatas.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCDatas.cpp; sourceTree = "<group>"; }; - 37B6EE9717DEB3B0001BE102 /* CCDatas.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCDatas.h; sourceTree = "<group>"; }; - 37B6EE9917DEB3B0001BE102 /* CCBatchNode.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCBatchNode.cpp; sourceTree = "<group>"; }; - 37B6EE9A17DEB3B0001BE102 /* CCBatchNode.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCBatchNode.h; sourceTree = "<group>"; }; - 37B6EE9B17DEB3B0001BE102 /* CCDecorativeDisplay.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCDecorativeDisplay.cpp; sourceTree = "<group>"; }; - 37B6EE9C17DEB3B0001BE102 /* CCDecorativeDisplay.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCDecorativeDisplay.h; sourceTree = "<group>"; }; - 37B6EE9D17DEB3B0001BE102 /* CCDisplayFactory.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCDisplayFactory.cpp; sourceTree = "<group>"; }; - 37B6EE9E17DEB3B0001BE102 /* CCDisplayFactory.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCDisplayFactory.h; sourceTree = "<group>"; }; - 37B6EE9F17DEB3B0001BE102 /* CCDisplayManager.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCDisplayManager.cpp; sourceTree = "<group>"; }; - 37B6EEA017DEB3B0001BE102 /* CCDisplayManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCDisplayManager.h; sourceTree = "<group>"; }; - 37B6EEA117DEB3B0001BE102 /* CCShaderNode.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCShaderNode.cpp; sourceTree = "<group>"; }; - 37B6EEA217DEB3B0001BE102 /* CCShaderNode.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCShaderNode.h; sourceTree = "<group>"; }; - 37B6EEA317DEB3B0001BE102 /* CCSkin.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCSkin.cpp; sourceTree = "<group>"; }; - 37B6EEA417DEB3B0001BE102 /* CCSkin.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCSkin.h; sourceTree = "<group>"; }; - 37B6EEA617DEB3B0001BE102 /* CCTexture2DMutable.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCTexture2DMutable.cpp; sourceTree = "<group>"; }; - 37B6EEA717DEB3B0001BE102 /* CCTexture2DMutable.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCTexture2DMutable.h; sourceTree = "<group>"; }; - 37B6EEA817DEB3B0001BE102 /* GLES-Render.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = "GLES-Render.cpp"; sourceTree = "<group>"; }; - 37B6EEA917DEB3B0001BE102 /* GLES-Render.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "GLES-Render.h"; sourceTree = "<group>"; }; - 37B6EEAA17DEB3B0001BE102 /* sigslot.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = sigslot.h; sourceTree = "<group>"; }; - 37B6EEAC17DEB3B0001BE102 /* CCColliderDetector.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCColliderDetector.cpp; sourceTree = "<group>"; }; - 37B6EEAD17DEB3B0001BE102 /* CCColliderDetector.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCColliderDetector.h; sourceTree = "<group>"; }; - 37B6EEAE17DEB3B0001BE102 /* CCPhysicsWorld.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCPhysicsWorld.cpp; sourceTree = "<group>"; }; - 37B6EEAF17DEB3B0001BE102 /* CCPhysicsWorld.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCPhysicsWorld.h; sourceTree = "<group>"; }; - 37B6EEB117DEB3B0001BE102 /* CCArmatureDataManager.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCArmatureDataManager.cpp; sourceTree = "<group>"; }; - 37B6EEB217DEB3B0001BE102 /* CCArmatureDataManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCArmatureDataManager.h; sourceTree = "<group>"; }; - 37B6EEB317DEB3B0001BE102 /* CCArmatureDefine.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCArmatureDefine.h; sourceTree = "<group>"; }; - 37B6EEB417DEB3B0001BE102 /* CCConstValue.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCConstValue.h; sourceTree = "<group>"; }; - 37B6EEB517DEB3B0001BE102 /* CCDataReaderHelper.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCDataReaderHelper.cpp; sourceTree = "<group>"; }; - 37B6EEB617DEB3B0001BE102 /* CCDataReaderHelper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCDataReaderHelper.h; sourceTree = "<group>"; }; - 37B6EEB717DEB3B0001BE102 /* CCSpriteFrameCacheHelper.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCSpriteFrameCacheHelper.cpp; sourceTree = "<group>"; }; - 37B6EEB817DEB3B0001BE102 /* CCSpriteFrameCacheHelper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCSpriteFrameCacheHelper.h; sourceTree = "<group>"; }; - 37B6EEB917DEB3B0001BE102 /* CCTransformHelp.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCTransformHelp.cpp; sourceTree = "<group>"; }; - 37B6EEBA17DEB3B0001BE102 /* CCTransformHelp.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCTransformHelp.h; sourceTree = "<group>"; }; - 37B6EEBB17DEB3B0001BE102 /* CCTweenFunction.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCTweenFunction.cpp; sourceTree = "<group>"; }; - 37B6EEBC17DEB3B0001BE102 /* CCTweenFunction.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCTweenFunction.h; sourceTree = "<group>"; }; - 37B6EEBD17DEB3B0001BE102 /* CCUtilMath.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCUtilMath.cpp; sourceTree = "<group>"; }; - 37B6EEBE17DEB3B0001BE102 /* CCUtilMath.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCUtilMath.h; sourceTree = "<group>"; }; - 37B6EEC017DEB3B0001BE102 /* CCComAttribute.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCComAttribute.cpp; sourceTree = "<group>"; }; - 37B6EEC117DEB3B0001BE102 /* CCComAttribute.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCComAttribute.h; sourceTree = "<group>"; }; - 37B6EEC217DEB3B0001BE102 /* CCComAudio.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCComAudio.cpp; sourceTree = "<group>"; }; - 37B6EEC317DEB3B0001BE102 /* CCComAudio.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCComAudio.h; sourceTree = "<group>"; }; - 37B6EEC417DEB3B0001BE102 /* CCComController.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCComController.cpp; sourceTree = "<group>"; }; - 37B6EEC517DEB3B0001BE102 /* CCComController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCComController.h; sourceTree = "<group>"; }; - 37B6EEC617DEB3B0001BE102 /* CCComRender.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCComRender.cpp; sourceTree = "<group>"; }; - 37B6EEC717DEB3B0001BE102 /* CCComRender.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCComRender.h; sourceTree = "<group>"; }; - 37B6EEC817DEB3B0001BE102 /* CCInputDelegate.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCInputDelegate.cpp; sourceTree = "<group>"; }; - 37B6EEC917DEB3B0001BE102 /* CCInputDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCInputDelegate.h; sourceTree = "<group>"; }; - 37B6EECB17DEB3B0001BE102 /* CSContentJsonDictionary.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CSContentJsonDictionary.cpp; sourceTree = "<group>"; }; - 37B6EECC17DEB3B0001BE102 /* CSContentJsonDictionary.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CSContentJsonDictionary.h; sourceTree = "<group>"; }; - 37B6EECD17DEB3B0001BE102 /* DictionaryHelper.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = DictionaryHelper.cpp; sourceTree = "<group>"; }; - 37B6EECE17DEB3B0001BE102 /* DictionaryHelper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DictionaryHelper.h; sourceTree = "<group>"; }; - 37B6EED017DEB3B0001BE102 /* autolink.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = autolink.h; sourceTree = "<group>"; }; - 37B6EED117DEB3B0001BE102 /* config.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = "<group>"; }; - 37B6EED217DEB3B0001BE102 /* features.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = features.h; sourceTree = "<group>"; }; - 37B6EED317DEB3B0001BE102 /* forwards.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = forwards.h; sourceTree = "<group>"; }; - 37B6EED417DEB3B0001BE102 /* json_batchallocator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = json_batchallocator.h; sourceTree = "<group>"; }; - 37B6EED517DEB3B0001BE102 /* json_internalarray.inl */ = {isa = PBXFileReference; lastKnownFileType = text; path = json_internalarray.inl; sourceTree = "<group>"; }; - 37B6EED617DEB3B0001BE102 /* json_internalmap.inl */ = {isa = PBXFileReference; lastKnownFileType = text; path = json_internalmap.inl; sourceTree = "<group>"; }; - 37B6EED717DEB3B0001BE102 /* json_lib.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = json_lib.h; sourceTree = "<group>"; }; - 37B6EED817DEB3B0001BE102 /* json_reader.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = json_reader.cpp; sourceTree = "<group>"; }; - 37B6EED917DEB3B0001BE102 /* json_tool.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = json_tool.h; sourceTree = "<group>"; }; - 37B6EEDA17DEB3B0001BE102 /* json_value.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = json_value.cpp; sourceTree = "<group>"; }; - 37B6EEDB17DEB3B0001BE102 /* json_valueiterator.inl */ = {isa = PBXFileReference; lastKnownFileType = text; path = json_valueiterator.inl; sourceTree = "<group>"; }; - 37B6EEDC17DEB3B0001BE102 /* json_writer.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = json_writer.cpp; sourceTree = "<group>"; }; - 37B6EEDD17DEB3B0001BE102 /* reader.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = reader.h; sourceTree = "<group>"; }; - 37B6EEDE17DEB3B0001BE102 /* sconscript */ = {isa = PBXFileReference; lastKnownFileType = text; path = sconscript; sourceTree = "<group>"; }; - 37B6EEDF17DEB3B0001BE102 /* value.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = value.h; sourceTree = "<group>"; }; - 37B6EEE017DEB3B0001BE102 /* writer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = writer.h; sourceTree = "<group>"; }; - 37B6EEE217DEB3B0001BE102 /* CCSSceneReader.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCSSceneReader.cpp; sourceTree = "<group>"; }; - 37B6EEE317DEB3B0001BE102 /* CCSSceneReader.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCSSceneReader.h; sourceTree = "<group>"; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 1A0C0A771777F79700838530 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 1A0C0A7E1777F79700838530 /* Foundation.framework in Frameworks */, - 1A0C0D581777FAAD00838530 /* libwebsockets.a in Frameworks */, - 1A0C0D5A1777FB1300838530 /* libcurl.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 1A0C0A711777F79700838530 = { - isa = PBXGroup; - children = ( - 37B6EE8817DEB3B0001BE102 /* CocoStudio */, - 1A0C0BEF1777F9CD00838530 /* AssetsManager */, - 1A0C0C3D1777F9CD00838530 /* CCBReader */, - 1A0C0C701777F9CD00838530 /* cocos-ext.h */, - 1A0C0C7A1777F9CD00838530 /* ExtensionMacros.h */, - 1A0C0C7B1777F9CD00838530 /* GUI */, - 1A0C0CAE1777F9CD00838530 /* LocalStorage */, - 1A0C0CB21777F9CD00838530 /* network */, - 1A0C0CB91777F9CD00838530 /* physics_nodes */, - 1A0C0CBE1777F9CD00838530 /* spine */, - 1A0C0A8B1777F7DD00838530 /* extensions-Prefix.pch */, - 1A0C0A7C1777F79700838530 /* Frameworks */, - 1A0C0A7B1777F79700838530 /* Products */, - ); - sourceTree = "<group>"; - }; - 1A0C0A7B1777F79700838530 /* Products */ = { - isa = PBXGroup; - children = ( - 1A0C0A7A1777F79700838530 /* libextensions.a */, - ); - name = Products; - sourceTree = "<group>"; - }; - 1A0C0A7C1777F79700838530 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 1A0C0D591777FB1300838530 /* libcurl.a */, - 1A0C0D521777FAAD00838530 /* libwebsockets */, - 1A0C0A7D1777F79700838530 /* Foundation.framework */, - ); - name = Frameworks; - sourceTree = "<group>"; - }; - 1A0C0BEF1777F9CD00838530 /* AssetsManager */ = { - isa = PBXGroup; - children = ( - 1A0C0BF01777F9CD00838530 /* AssetsManager.cpp */, - 1A0C0BF11777F9CD00838530 /* AssetsManager.h */, - ); - name = AssetsManager; - path = ../AssetsManager; - sourceTree = "<group>"; - }; - 1A0C0C3D1777F9CD00838530 /* CCBReader */ = { - isa = PBXGroup; - children = ( - 1A0C0C3E1777F9CD00838530 /* CCBAnimationManager.cpp */, - 1A0C0C3F1777F9CD00838530 /* CCBAnimationManager.h */, - 1A0C0C401777F9CD00838530 /* CCBFileLoader.cpp */, - 1A0C0C411777F9CD00838530 /* CCBFileLoader.h */, - 1A0C0C421777F9CD00838530 /* CCBKeyframe.cpp */, - 1A0C0C431777F9CD00838530 /* CCBKeyframe.h */, - 1A0C0C441777F9CD00838530 /* CCBMemberVariableAssigner.h */, - 1A0C0C451777F9CD00838530 /* CCBReader.cpp */, - 1A0C0C461777F9CD00838530 /* CCBReader.h */, - 1A0C0C471777F9CD00838530 /* CCBSelectorResolver.h */, - 1A0C0C481777F9CD00838530 /* CCBSequence.cpp */, - 1A0C0C491777F9CD00838530 /* CCBSequence.h */, - 1A0C0C4A1777F9CD00838530 /* CCBSequenceProperty.cpp */, - 1A0C0C4B1777F9CD00838530 /* CCBSequenceProperty.h */, - 1A0C0C4C1777F9CD00838530 /* CCBValue.cpp */, - 1A0C0C4D1777F9CD00838530 /* CCBValue.h */, - 1A0C0C4E1777F9CD00838530 /* CCControlButtonLoader.cpp */, - 1A0C0C4F1777F9CD00838530 /* CCControlButtonLoader.h */, - 1A0C0C501777F9CD00838530 /* CCControlLoader.cpp */, - 1A0C0C511777F9CD00838530 /* CCControlLoader.h */, - 1A0C0C521777F9CD00838530 /* CCLabelBMFontLoader.cpp */, - 1A0C0C531777F9CD00838530 /* CCLabelBMFontLoader.h */, - 1A0C0C541777F9CD00838530 /* CCLabelTTFLoader.cpp */, - 1A0C0C551777F9CD00838530 /* CCLabelTTFLoader.h */, - 1A0C0C561777F9CD00838530 /* CCLayerColorLoader.cpp */, - 1A0C0C571777F9CD00838530 /* CCLayerColorLoader.h */, - 1A0C0C581777F9CD00838530 /* CCLayerGradientLoader.cpp */, - 1A0C0C591777F9CD00838530 /* CCLayerGradientLoader.h */, - 1A0C0C5A1777F9CD00838530 /* CCLayerLoader.cpp */, - 1A0C0C5B1777F9CD00838530 /* CCLayerLoader.h */, - 1A0C0C5C1777F9CD00838530 /* CCMenuItemImageLoader.cpp */, - 1A0C0C5D1777F9CD00838530 /* CCMenuItemImageLoader.h */, - 1A0C0C5E1777F9CD00838530 /* CCMenuItemLoader.cpp */, - 1A0C0C5F1777F9CD00838530 /* CCMenuItemLoader.h */, - 1A0C0C601777F9CD00838530 /* CCMenuLoader.h */, - 1A0C0C611777F9CD00838530 /* CCNode+CCBRelativePositioning.cpp */, - 1A0C0C621777F9CD00838530 /* CCNode+CCBRelativePositioning.h */, - 1A0C0C631777F9CD00838530 /* CCNodeLoader.cpp */, - 1A0C0C641777F9CD00838530 /* CCNodeLoader.h */, - 1A0C0C651777F9CD00838530 /* CCNodeLoaderLibrary.cpp */, - 1A0C0C661777F9CD00838530 /* CCNodeLoaderLibrary.h */, - 1A0C0C671777F9CD00838530 /* CCNodeLoaderListener.h */, - 1A0C0C681777F9CD00838530 /* CCParticleSystemQuadLoader.cpp */, - 1A0C0C691777F9CD00838530 /* CCParticleSystemQuadLoader.h */, - 1A0C0C6A1777F9CD00838530 /* CCScale9SpriteLoader.cpp */, - 1A0C0C6B1777F9CD00838530 /* CCScale9SpriteLoader.h */, - 1A0C0C6C1777F9CD00838530 /* CCScrollViewLoader.cpp */, - 1A0C0C6D1777F9CD00838530 /* CCScrollViewLoader.h */, - 1A0C0C6E1777F9CD00838530 /* CCSpriteLoader.cpp */, - 1A0C0C6F1777F9CD00838530 /* CCSpriteLoader.h */, - ); - name = CCBReader; - path = ../CCBReader; - sourceTree = "<group>"; - }; - 1A0C0C7B1777F9CD00838530 /* GUI */ = { - isa = PBXGroup; - children = ( - 1A0C0C7C1777F9CD00838530 /* CCControlExtension */, - 1A0C0C961777F9CD00838530 /* CCEditBox */, - 1A0C0CA51777F9CD00838530 /* CCScrollView */, - ); - name = GUI; - path = ../GUI; - sourceTree = "<group>"; - }; - 1A0C0C7C1777F9CD00838530 /* CCControlExtension */ = { - isa = PBXGroup; - children = ( - 1A0C0C7D1777F9CD00838530 /* CCControl.cpp */, - 1A0C0C7E1777F9CD00838530 /* CCControl.h */, - 1A0C0C7F1777F9CD00838530 /* CCControlButton.cpp */, - 1A0C0C801777F9CD00838530 /* CCControlButton.h */, - 1A0C0C811777F9CD00838530 /* CCControlColourPicker.cpp */, - 1A0C0C821777F9CD00838530 /* CCControlColourPicker.h */, - 1A0C0C831777F9CD00838530 /* CCControlExtensions.h */, - 1A0C0C841777F9CD00838530 /* CCControlHuePicker.cpp */, - 1A0C0C851777F9CD00838530 /* CCControlHuePicker.h */, - 1A0C0C861777F9CD00838530 /* CCControlPotentiometer.cpp */, - 1A0C0C871777F9CD00838530 /* CCControlPotentiometer.h */, - 1A0C0C881777F9CD00838530 /* CCControlSaturationBrightnessPicker.cpp */, - 1A0C0C891777F9CD00838530 /* CCControlSaturationBrightnessPicker.h */, - 1A0C0C8A1777F9CD00838530 /* CCControlSlider.cpp */, - 1A0C0C8B1777F9CD00838530 /* CCControlSlider.h */, - 1A0C0C8C1777F9CD00838530 /* CCControlStepper.cpp */, - 1A0C0C8D1777F9CD00838530 /* CCControlStepper.h */, - 1A0C0C8E1777F9CD00838530 /* CCControlSwitch.cpp */, - 1A0C0C8F1777F9CD00838530 /* CCControlSwitch.h */, - 1A0C0C901777F9CD00838530 /* CCControlUtils.cpp */, - 1A0C0C911777F9CD00838530 /* CCControlUtils.h */, - 1A0C0C921777F9CD00838530 /* CCInvocation.cpp */, - 1A0C0C931777F9CD00838530 /* CCInvocation.h */, - 1A0C0C941777F9CD00838530 /* CCScale9Sprite.cpp */, - 1A0C0C951777F9CD00838530 /* CCScale9Sprite.h */, - ); - path = CCControlExtension; - sourceTree = "<group>"; - }; - 1A0C0C961777F9CD00838530 /* CCEditBox */ = { - isa = PBXGroup; - children = ( - 1A0C0C971777F9CD00838530 /* CCEditBox.cpp */, - 1A0C0C981777F9CD00838530 /* CCEditBox.h */, - 1A0C0C991777F9CD00838530 /* CCEditBoxImpl.h */, - 1A0C0C9A1777F9CD00838530 /* CCEditBoxImplAndroid.cpp */, - 1A0C0C9B1777F9CD00838530 /* CCEditBoxImplAndroid.h */, - 1A0C0C9C1777F9CD00838530 /* CCEditBoxImplIOS.h */, - 1A0C0C9D1777F9CD00838530 /* CCEditBoxImplIOS.mm */, - 1A0C0C9E1777F9CD00838530 /* CCEditBoxImplMac.h */, - 1A0C0C9F1777F9CD00838530 /* CCEditBoxImplMac.mm */, - 1A0C0CA01777F9CD00838530 /* CCEditBoxImplNone.cpp */, - 1A0C0CA11777F9CD00838530 /* CCEditBoxImplTizen.cpp */, - 1A0C0CA21777F9CD00838530 /* CCEditBoxImplTizen.h */, - 1A0C0CA31777F9CD00838530 /* CCEditBoxImplWin.cpp */, - 1A0C0CA41777F9CD00838530 /* CCEditBoxImplWin.h */, - ); - path = CCEditBox; - sourceTree = "<group>"; - }; - 1A0C0CA51777F9CD00838530 /* CCScrollView */ = { - isa = PBXGroup; - children = ( - 1A0C0CA61777F9CD00838530 /* CCScrollView.cpp */, - 1A0C0CA71777F9CD00838530 /* CCScrollView.h */, - 1A0C0CA81777F9CD00838530 /* CCSorting.cpp */, - 1A0C0CA91777F9CD00838530 /* CCSorting.h */, - 1A0C0CAA1777F9CD00838530 /* CCTableView.cpp */, - 1A0C0CAB1777F9CD00838530 /* CCTableView.h */, - 1A0C0CAC1777F9CD00838530 /* CCTableViewCell.cpp */, - 1A0C0CAD1777F9CD00838530 /* CCTableViewCell.h */, - ); - path = CCScrollView; - sourceTree = "<group>"; - }; - 1A0C0CAE1777F9CD00838530 /* LocalStorage */ = { - isa = PBXGroup; - children = ( - 1A0C0CAF1777F9CD00838530 /* LocalStorage.cpp */, - 1A0C0CB01777F9CD00838530 /* LocalStorage.h */, - 1A0C0CB11777F9CD00838530 /* LocalStorageAndroid.cpp */, - ); - name = LocalStorage; - path = ../LocalStorage; - sourceTree = "<group>"; - }; - 1A0C0CB21777F9CD00838530 /* network */ = { - isa = PBXGroup; - children = ( - 1A0C0CB31777F9CD00838530 /* HttpClient.cpp */, - 1A0C0CB41777F9CD00838530 /* HttpClient.h */, - 1A0C0CB51777F9CD00838530 /* HttpRequest.h */, - 1A0C0CB61777F9CD00838530 /* HttpResponse.h */, - 1A0C0CB71777F9CD00838530 /* WebSocket.cpp */, - 1A0C0CB81777F9CD00838530 /* WebSocket.h */, - ); - name = network; - path = ../network; - sourceTree = "<group>"; - }; - 1A0C0CB91777F9CD00838530 /* physics_nodes */ = { - isa = PBXGroup; - children = ( - 1A0C0CBA1777F9CD00838530 /* CCPhysicsDebugNode.cpp */, - 1A0C0CBB1777F9CD00838530 /* CCPhysicsDebugNode.h */, - 1A0C0CBC1777F9CD00838530 /* CCPhysicsSprite.cpp */, - 1A0C0CBD1777F9CD00838530 /* CCPhysicsSprite.h */, - ); - name = physics_nodes; - path = ../physics_nodes; - sourceTree = "<group>"; - }; - 1A0C0CBE1777F9CD00838530 /* spine */ = { - isa = PBXGroup; - children = ( - 1A0C0CBF1777F9CD00838530 /* Animation.cpp */, - 1A0C0CC01777F9CD00838530 /* Animation.h */, - 1A0C0CC11777F9CD00838530 /* AnimationState.cpp */, - 1A0C0CC21777F9CD00838530 /* AnimationState.h */, - 1A0C0CC31777F9CD00838530 /* AnimationStateData.cpp */, - 1A0C0CC41777F9CD00838530 /* AnimationStateData.h */, - 1A0C0CC51777F9CD00838530 /* Atlas.cpp */, - 1A0C0CC61777F9CD00838530 /* Atlas.h */, - 1A0C0CC71777F9CD00838530 /* AtlasAttachmentLoader.cpp */, - 1A0C0CC81777F9CD00838530 /* AtlasAttachmentLoader.h */, - 1A0C0CC91777F9CD00838530 /* Attachment.cpp */, - 1A0C0CCA1777F9CD00838530 /* Attachment.h */, - 1A0C0CCB1777F9CD00838530 /* AttachmentLoader.cpp */, - 1A0C0CCC1777F9CD00838530 /* AttachmentLoader.h */, - 1A0C0CCD1777F9CD00838530 /* Bone.cpp */, - 1A0C0CCE1777F9CD00838530 /* Bone.h */, - 1A0C0CCF1777F9CD00838530 /* BoneData.cpp */, - 1A0C0CD01777F9CD00838530 /* BoneData.h */, - 1A0C0CD11777F9CD00838530 /* CCSkeleton.cpp */, - 1A0C0CD21777F9CD00838530 /* CCSkeleton.h */, - 1A0C0CD31777F9CD00838530 /* CCSkeletonAnimation.cpp */, - 1A0C0CD41777F9CD00838530 /* CCSkeletonAnimation.h */, - 1A0C0CD51777F9CD00838530 /* extension.cpp */, - 1A0C0CD61777F9CD00838530 /* extension.h */, - 1A0C0CD71777F9CD00838530 /* Json.cpp */, - 1A0C0CD81777F9CD00838530 /* Json.h */, - 1A0C0CD91777F9CD00838530 /* RegionAttachment.cpp */, - 1A0C0CDA1777F9CD00838530 /* RegionAttachment.h */, - 1A0C0CDB1777F9CD00838530 /* Skeleton.cpp */, - 1A0C0CDC1777F9CD00838530 /* Skeleton.h */, - 1A0C0CDD1777F9CD00838530 /* SkeletonData.cpp */, - 1A0C0CDE1777F9CD00838530 /* SkeletonData.h */, - 1A0C0CDF1777F9CD00838530 /* SkeletonJson.cpp */, - 1A0C0CE01777F9CD00838530 /* SkeletonJson.h */, - 1A0C0CE11777F9CD00838530 /* Skin.cpp */, - 1A0C0CE21777F9CD00838530 /* Skin.h */, - 1A0C0CE31777F9CD00838530 /* Slot.cpp */, - 1A0C0CE41777F9CD00838530 /* Slot.h */, - 1A0C0CE51777F9CD00838530 /* SlotData.cpp */, - 1A0C0CE61777F9CD00838530 /* SlotData.h */, - 1A0C0CE71777F9CD00838530 /* spine-cocos2dx.cpp */, - 1A0C0CE81777F9CD00838530 /* spine-cocos2dx.h */, - 1A0C0CE91777F9CD00838530 /* spine.h */, - ); - name = spine; - path = ../spine; - sourceTree = "<group>"; - }; - 1A0C0D521777FAAD00838530 /* libwebsockets */ = { - isa = PBXGroup; - children = ( - 1A0C0D531777FAAD00838530 /* ios */, - ); - name = libwebsockets; - path = ../../external/libwebsockets; - sourceTree = "<group>"; - }; - 1A0C0D531777FAAD00838530 /* ios */ = { - isa = PBXGroup; - children = ( - 1A0C0D541777FAAD00838530 /* include */, - 1A0C0D561777FAAD00838530 /* lib */, - ); - path = ios; - sourceTree = "<group>"; - }; - 1A0C0D541777FAAD00838530 /* include */ = { - isa = PBXGroup; - children = ( - 1A0C0D551777FAAD00838530 /* libwebsockets.h */, - ); - path = include; - sourceTree = "<group>"; - }; - 1A0C0D561777FAAD00838530 /* lib */ = { - isa = PBXGroup; - children = ( - 1A0C0D571777FAAD00838530 /* libwebsockets.a */, - ); - path = lib; - sourceTree = "<group>"; - }; - 37B6EE8817DEB3B0001BE102 /* CocoStudio */ = { - isa = PBXGroup; - children = ( - 37B6EE8917DEB3B0001BE102 /* Armature */, - 37B6EEBF17DEB3B0001BE102 /* Components */, - 37B6EECA17DEB3B0001BE102 /* Json */, - 37B6EEE117DEB3B0001BE102 /* Reader */, - ); - name = CocoStudio; - path = ../CocoStudio; - sourceTree = "<group>"; - }; - 37B6EE8917DEB3B0001BE102 /* Armature */ = { - isa = PBXGroup; - children = ( - 37B6EE8A17DEB3B0001BE102 /* animation */, - 37B6EE9117DEB3B0001BE102 /* CCArmature.cpp */, - 37B6EE9217DEB3B0001BE102 /* CCArmature.h */, - 37B6EE9317DEB3B0001BE102 /* CCBone.cpp */, - 37B6EE9417DEB3B0001BE102 /* CCBone.h */, - 37B6EE9517DEB3B0001BE102 /* datas */, - 37B6EE9817DEB3B0001BE102 /* display */, - 37B6EEA517DEB3B0001BE102 /* external_tool */, - 37B6EEAB17DEB3B0001BE102 /* physics */, - 37B6EEB017DEB3B0001BE102 /* utils */, - ); - path = Armature; - sourceTree = "<group>"; - }; - 37B6EE8A17DEB3B0001BE102 /* animation */ = { - isa = PBXGroup; - children = ( - 37B6EE8B17DEB3B0001BE102 /* CCArmatureAnimation.cpp */, - 37B6EE8C17DEB3B0001BE102 /* CCArmatureAnimation.h */, - 37B6EE8D17DEB3B0001BE102 /* CCProcessBase.cpp */, - 37B6EE8E17DEB3B0001BE102 /* CCProcessBase.h */, - 37B6EE8F17DEB3B0001BE102 /* CCTween.cpp */, - 37B6EE9017DEB3B0001BE102 /* CCTween.h */, - ); - path = animation; - sourceTree = "<group>"; - }; - 37B6EE9517DEB3B0001BE102 /* datas */ = { - isa = PBXGroup; - children = ( - 37B6EE9617DEB3B0001BE102 /* CCDatas.cpp */, - 37B6EE9717DEB3B0001BE102 /* CCDatas.h */, - ); - path = datas; - sourceTree = "<group>"; - }; - 37B6EE9817DEB3B0001BE102 /* display */ = { - isa = PBXGroup; - children = ( - 37B6EE9917DEB3B0001BE102 /* CCBatchNode.cpp */, - 37B6EE9A17DEB3B0001BE102 /* CCBatchNode.h */, - 37B6EE9B17DEB3B0001BE102 /* CCDecorativeDisplay.cpp */, - 37B6EE9C17DEB3B0001BE102 /* CCDecorativeDisplay.h */, - 37B6EE9D17DEB3B0001BE102 /* CCDisplayFactory.cpp */, - 37B6EE9E17DEB3B0001BE102 /* CCDisplayFactory.h */, - 37B6EE9F17DEB3B0001BE102 /* CCDisplayManager.cpp */, - 37B6EEA017DEB3B0001BE102 /* CCDisplayManager.h */, - 37B6EEA117DEB3B0001BE102 /* CCShaderNode.cpp */, - 37B6EEA217DEB3B0001BE102 /* CCShaderNode.h */, - 37B6EEA317DEB3B0001BE102 /* CCSkin.cpp */, - 37B6EEA417DEB3B0001BE102 /* CCSkin.h */, - ); - path = display; - sourceTree = "<group>"; - }; - 37B6EEA517DEB3B0001BE102 /* external_tool */ = { - isa = PBXGroup; - children = ( - 37B6EEA617DEB3B0001BE102 /* CCTexture2DMutable.cpp */, - 37B6EEA717DEB3B0001BE102 /* CCTexture2DMutable.h */, - 37B6EEA817DEB3B0001BE102 /* GLES-Render.cpp */, - 37B6EEA917DEB3B0001BE102 /* GLES-Render.h */, - 37B6EEAA17DEB3B0001BE102 /* sigslot.h */, - ); - path = external_tool; - sourceTree = "<group>"; - }; - 37B6EEAB17DEB3B0001BE102 /* physics */ = { - isa = PBXGroup; - children = ( - 37B6EEAC17DEB3B0001BE102 /* CCColliderDetector.cpp */, - 37B6EEAD17DEB3B0001BE102 /* CCColliderDetector.h */, - 37B6EEAE17DEB3B0001BE102 /* CCPhysicsWorld.cpp */, - 37B6EEAF17DEB3B0001BE102 /* CCPhysicsWorld.h */, - ); - path = physics; - sourceTree = "<group>"; - }; - 37B6EEB017DEB3B0001BE102 /* utils */ = { - isa = PBXGroup; - children = ( - 37B6EEB117DEB3B0001BE102 /* CCArmatureDataManager.cpp */, - 37B6EEB217DEB3B0001BE102 /* CCArmatureDataManager.h */, - 37B6EEB317DEB3B0001BE102 /* CCArmatureDefine.h */, - 37B6EEB417DEB3B0001BE102 /* CCConstValue.h */, - 37B6EEB517DEB3B0001BE102 /* CCDataReaderHelper.cpp */, - 37B6EEB617DEB3B0001BE102 /* CCDataReaderHelper.h */, - 37B6EEB717DEB3B0001BE102 /* CCSpriteFrameCacheHelper.cpp */, - 37B6EEB817DEB3B0001BE102 /* CCSpriteFrameCacheHelper.h */, - 37B6EEB917DEB3B0001BE102 /* CCTransformHelp.cpp */, - 37B6EEBA17DEB3B0001BE102 /* CCTransformHelp.h */, - 37B6EEBB17DEB3B0001BE102 /* CCTweenFunction.cpp */, - 37B6EEBC17DEB3B0001BE102 /* CCTweenFunction.h */, - 37B6EEBD17DEB3B0001BE102 /* CCUtilMath.cpp */, - 37B6EEBE17DEB3B0001BE102 /* CCUtilMath.h */, - ); - path = utils; - sourceTree = "<group>"; - }; - 37B6EEBF17DEB3B0001BE102 /* Components */ = { - isa = PBXGroup; - children = ( - 37B6EEC017DEB3B0001BE102 /* CCComAttribute.cpp */, - 37B6EEC117DEB3B0001BE102 /* CCComAttribute.h */, - 37B6EEC217DEB3B0001BE102 /* CCComAudio.cpp */, - 37B6EEC317DEB3B0001BE102 /* CCComAudio.h */, - 37B6EEC417DEB3B0001BE102 /* CCComController.cpp */, - 37B6EEC517DEB3B0001BE102 /* CCComController.h */, - 37B6EEC617DEB3B0001BE102 /* CCComRender.cpp */, - 37B6EEC717DEB3B0001BE102 /* CCComRender.h */, - 37B6EEC817DEB3B0001BE102 /* CCInputDelegate.cpp */, - 37B6EEC917DEB3B0001BE102 /* CCInputDelegate.h */, - ); - path = Components; - sourceTree = "<group>"; - }; - 37B6EECA17DEB3B0001BE102 /* Json */ = { - isa = PBXGroup; - children = ( - 37B6EECB17DEB3B0001BE102 /* CSContentJsonDictionary.cpp */, - 37B6EECC17DEB3B0001BE102 /* CSContentJsonDictionary.h */, - 37B6EECD17DEB3B0001BE102 /* DictionaryHelper.cpp */, - 37B6EECE17DEB3B0001BE102 /* DictionaryHelper.h */, - 37B6EECF17DEB3B0001BE102 /* lib_json */, - ); - path = Json; - sourceTree = "<group>"; - }; - 37B6EECF17DEB3B0001BE102 /* lib_json */ = { - isa = PBXGroup; - children = ( - 37B6EED017DEB3B0001BE102 /* autolink.h */, - 37B6EED117DEB3B0001BE102 /* config.h */, - 37B6EED217DEB3B0001BE102 /* features.h */, - 37B6EED317DEB3B0001BE102 /* forwards.h */, - 37B6EED417DEB3B0001BE102 /* json_batchallocator.h */, - 37B6EED517DEB3B0001BE102 /* json_internalarray.inl */, - 37B6EED617DEB3B0001BE102 /* json_internalmap.inl */, - 37B6EED717DEB3B0001BE102 /* json_lib.h */, - 37B6EED817DEB3B0001BE102 /* json_reader.cpp */, - 37B6EED917DEB3B0001BE102 /* json_tool.h */, - 37B6EEDA17DEB3B0001BE102 /* json_value.cpp */, - 37B6EEDB17DEB3B0001BE102 /* json_valueiterator.inl */, - 37B6EEDC17DEB3B0001BE102 /* json_writer.cpp */, - 37B6EEDD17DEB3B0001BE102 /* reader.h */, - 37B6EEDE17DEB3B0001BE102 /* sconscript */, - 37B6EEDF17DEB3B0001BE102 /* value.h */, - 37B6EEE017DEB3B0001BE102 /* writer.h */, - ); - path = lib_json; - sourceTree = "<group>"; - }; - 37B6EEE117DEB3B0001BE102 /* Reader */ = { - isa = PBXGroup; - children = ( - 37B6EEE217DEB3B0001BE102 /* CCSSceneReader.cpp */, - 37B6EEE317DEB3B0001BE102 /* CCSSceneReader.h */, - ); - path = Reader; - sourceTree = "<group>"; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 1A0C0A791777F79700838530 /* extensions */ = { - isa = PBXNativeTarget; - buildConfigurationList = 1A0C0A881777F79700838530 /* Build configuration list for PBXNativeTarget "extensions" */; - buildPhases = ( - 1A0C0A761777F79700838530 /* Sources */, - 1A0C0A771777F79700838530 /* Frameworks */, - 1A0C0A781777F79700838530 /* CopyFiles */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = extensions; - productName = extensions; - productReference = 1A0C0A7A1777F79700838530 /* libextensions.a */; - productType = "com.apple.product-type.library.static"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 1A0C0A721777F79700838530 /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0460; - }; - buildConfigurationList = 1A0C0A751777F79700838530 /* Build configuration list for PBXProject "extensions" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - ); - mainGroup = 1A0C0A711777F79700838530; - productRefGroup = 1A0C0A7B1777F79700838530 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 1A0C0A791777F79700838530 /* extensions */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXSourcesBuildPhase section */ - 1A0C0A761777F79700838530 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 1A0C0CEA1777F9CD00838530 /* AssetsManager.cpp in Sources */, - 1A0C0D051777F9CD00838530 /* CCBAnimationManager.cpp in Sources */, - 1A0C0D061777F9CD00838530 /* CCBFileLoader.cpp in Sources */, - 1A0C0D071777F9CD00838530 /* CCBKeyframe.cpp in Sources */, - 1A0C0D081777F9CD00838530 /* CCBReader.cpp in Sources */, - 1A0C0D091777F9CD00838530 /* CCBSequence.cpp in Sources */, - 1A0C0D0A1777F9CD00838530 /* CCBSequenceProperty.cpp in Sources */, - 1A0C0D0B1777F9CD00838530 /* CCBValue.cpp in Sources */, - 1A0C0D0C1777F9CD00838530 /* CCControlButtonLoader.cpp in Sources */, - 1A0C0D0D1777F9CD00838530 /* CCControlLoader.cpp in Sources */, - 1A0C0D0E1777F9CD00838530 /* CCLabelBMFontLoader.cpp in Sources */, - 1A0C0D0F1777F9CD00838530 /* CCLabelTTFLoader.cpp in Sources */, - 1A0C0D101777F9CD00838530 /* CCLayerColorLoader.cpp in Sources */, - 1A0C0D111777F9CD00838530 /* CCLayerGradientLoader.cpp in Sources */, - 1A0C0D121777F9CD00838530 /* CCLayerLoader.cpp in Sources */, - 1A0C0D131777F9CD00838530 /* CCMenuItemImageLoader.cpp in Sources */, - 1A0C0D141777F9CD00838530 /* CCMenuItemLoader.cpp in Sources */, - 1A0C0D151777F9CD00838530 /* CCNode+CCBRelativePositioning.cpp in Sources */, - 1A0C0D161777F9CD00838530 /* CCNodeLoader.cpp in Sources */, - 1A0C0D171777F9CD00838530 /* CCNodeLoaderLibrary.cpp in Sources */, - 1A0C0D181777F9CD00838530 /* CCParticleSystemQuadLoader.cpp in Sources */, - 1A0C0D191777F9CD00838530 /* CCScale9SpriteLoader.cpp in Sources */, - 1A0C0D1A1777F9CD00838530 /* CCScrollViewLoader.cpp in Sources */, - 1A0C0D1B1777F9CD00838530 /* CCSpriteLoader.cpp in Sources */, - 1A0C0D201777F9CD00838530 /* CCControl.cpp in Sources */, - 1A0C0D211777F9CD00838530 /* CCControlButton.cpp in Sources */, - 1A0C0D221777F9CD00838530 /* CCControlColourPicker.cpp in Sources */, - 1A0C0D231777F9CD00838530 /* CCControlHuePicker.cpp in Sources */, - 1A0C0D241777F9CD00838530 /* CCControlPotentiometer.cpp in Sources */, - 1A0C0D251777F9CD00838530 /* CCControlSaturationBrightnessPicker.cpp in Sources */, - 1A0C0D261777F9CD00838530 /* CCControlSlider.cpp in Sources */, - 1A0C0D271777F9CD00838530 /* CCControlStepper.cpp in Sources */, - 1A0C0D281777F9CD00838530 /* CCControlSwitch.cpp in Sources */, - 1A0C0D291777F9CD00838530 /* CCControlUtils.cpp in Sources */, - 1A0C0D2A1777F9CD00838530 /* CCInvocation.cpp in Sources */, - 1A0C0D2B1777F9CD00838530 /* CCScale9Sprite.cpp in Sources */, - 1A0C0D2C1777F9CD00838530 /* CCEditBox.cpp in Sources */, - 1A0C0D2D1777F9CD00838530 /* CCEditBoxImplAndroid.cpp in Sources */, - 1A0C0D2E1777F9CD00838530 /* CCEditBoxImplIOS.mm in Sources */, - 1A0C0D2F1777F9CD00838530 /* CCEditBoxImplMac.mm in Sources */, - 1A0C0D301777F9CD00838530 /* CCEditBoxImplNone.cpp in Sources */, - 1A0C0D311777F9CD00838530 /* CCEditBoxImplTizen.cpp in Sources */, - 1A0C0D321777F9CD00838530 /* CCEditBoxImplWin.cpp in Sources */, - 1A0C0D331777F9CD00838530 /* CCScrollView.cpp in Sources */, - 1A0C0D341777F9CD00838530 /* CCSorting.cpp in Sources */, - 1A0C0D351777F9CD00838530 /* CCTableView.cpp in Sources */, - 1A0C0D361777F9CD00838530 /* CCTableViewCell.cpp in Sources */, - 1A0C0D371777F9CD00838530 /* LocalStorage.cpp in Sources */, - 1A0C0D381777F9CD00838530 /* LocalStorageAndroid.cpp in Sources */, - 1A0C0D391777F9CD00838530 /* HttpClient.cpp in Sources */, - 1A0C0D3A1777F9CD00838530 /* WebSocket.cpp in Sources */, - 1A0C0D3B1777F9CD00838530 /* CCPhysicsDebugNode.cpp in Sources */, - 1A0C0D3C1777F9CD00838530 /* CCPhysicsSprite.cpp in Sources */, - 1A0C0D3D1777F9CD00838530 /* Animation.cpp in Sources */, - 1A0C0D3E1777F9CD00838530 /* AnimationState.cpp in Sources */, - 1A0C0D3F1777F9CD00838530 /* AnimationStateData.cpp in Sources */, - 1A0C0D401777F9CD00838530 /* Atlas.cpp in Sources */, - 1A0C0D411777F9CD00838530 /* AtlasAttachmentLoader.cpp in Sources */, - 1A0C0D421777F9CD00838530 /* Attachment.cpp in Sources */, - 1A0C0D431777F9CD00838530 /* AttachmentLoader.cpp in Sources */, - 1A0C0D441777F9CD00838530 /* Bone.cpp in Sources */, - 1A0C0D451777F9CD00838530 /* BoneData.cpp in Sources */, - 1A0C0D461777F9CD00838530 /* CCSkeleton.cpp in Sources */, - 1A0C0D471777F9CD00838530 /* CCSkeletonAnimation.cpp in Sources */, - 1A0C0D481777F9CD00838530 /* extension.cpp in Sources */, - 1A0C0D491777F9CD00838530 /* Json.cpp in Sources */, - 1A0C0D4A1777F9CD00838530 /* RegionAttachment.cpp in Sources */, - 1A0C0D4B1777F9CD00838530 /* Skeleton.cpp in Sources */, - 1A0C0D4C1777F9CD00838530 /* SkeletonData.cpp in Sources */, - 1A0C0D4D1777F9CD00838530 /* SkeletonJson.cpp in Sources */, - 1A0C0D4E1777F9CD00838530 /* Skin.cpp in Sources */, - 1A0C0D4F1777F9CD00838530 /* Slot.cpp in Sources */, - 1A0C0D501777F9CD00838530 /* SlotData.cpp in Sources */, - 1A0C0D511777F9CD00838530 /* spine-cocos2dx.cpp in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 1A0C0A861777F79700838530 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 6.1; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - }; - name = Debug; - }; - 1A0C0A871777F79700838530 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 6.1; - SDKROOT = iphoneos; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 1A0C0A891777F79700838530 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; - DSTROOT = /tmp/extensions.dst; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "extensions-Prefix.pch"; - GCC_PREPROCESSOR_DEFINITIONS = ( - "COCOS2D_DEBUG=1", - "CC_ENABLE_CHIPMUNK_INTEGRATION=1", - CC_TARGET_OS_IPHONE, - ); - HEADER_SEARCH_PATHS = ( - "\"$(SRCROOT)/../../cocos2dx\"", - "\"$(SRCROOT)/../../cocos2dx/include\"", - "\"$(SRCROOT)/../../cocos2dx/platform/third_party/ios\"", - "\"$(SRCROOT)/../../cocos2dx/platform/ios\"", - "\"$(SRCROOT)/../../cocos2dx/kazmath/include\"", - "\"$(SRCROOT)/../../CocosDenshion/include\"", - "\"$(SRCROOT)/../../external/chipmunk/include/chipmunk\"", - "\"$(SRCROOT)/../../external\"", - "\"$(SRCROOT)/../../extensions\"", - ); - IPHONEOS_DEPLOYMENT_TARGET = 5.0; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "\"$(SRCROOT)/../../external/libwebsockets/ios/lib\"", - "\"$(SRCROOT)/../../cocos2dx/platform/third_party/ios/libraries\"", - ); - ONLY_ACTIVE_ARCH = YES; - OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 1A0C0A8A1777F79700838530 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; - DSTROOT = /tmp/extensions.dst; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "extensions-Prefix.pch"; - GCC_PREPROCESSOR_DEFINITIONS = ( - CC_TARGET_OS_IPHONE, - "CC_ENABLE_CHIPMUNK_INTEGRATION=1", - ); - HEADER_SEARCH_PATHS = ( - "\"$(SRCROOT)/../../cocos2dx\"", - "\"$(SRCROOT)/../../cocos2dx/include\"", - "\"$(SRCROOT)/../../cocos2dx/platform/third_party/ios\"", - "\"$(SRCROOT)/../../cocos2dx/platform/ios\"", - "\"$(SRCROOT)/../../cocos2dx/kazmath/include\"", - "\"$(SRCROOT)/../../CocosDenshion/include\"", - "\"$(SRCROOT)/../../external/chipmunk/include/chipmunk\"", - "\"$(SRCROOT)/../../external\"", - "\"$(SRCROOT)/../../extensions\"", - ); - IPHONEOS_DEPLOYMENT_TARGET = 5.0; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "\"$(SRCROOT)/../../external/libwebsockets/ios/lib\"", - "\"$(SRCROOT)/../../cocos2dx/platform/third_party/ios/libraries\"", - ); - ONLY_ACTIVE_ARCH = YES; - OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 1A0C0A751777F79700838530 /* Build configuration list for PBXProject "extensions" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1A0C0A861777F79700838530 /* Debug */, - 1A0C0A871777F79700838530 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 1A0C0A881777F79700838530 /* Build configuration list for PBXNativeTarget "extensions" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1A0C0A891777F79700838530 /* Debug */, - 1A0C0A8A1777F79700838530 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 1A0C0A721777F79700838530 /* Project object */; -} diff --git a/extensions/proj.mac/extensions-Prefix.pch b/extensions/proj.mac/extensions-Prefix.pch deleted file mode 100644 index a6bbd380f6..0000000000 --- a/extensions/proj.mac/extensions-Prefix.pch +++ /dev/null @@ -1,7 +0,0 @@ -// -// Prefix header for all source files of the 'extensions' target in the 'extensions' project -// - -#ifdef __OBJC__ - #import <Foundation/Foundation.h> -#endif diff --git a/extensions/proj.mac/extensions.xcodeproj/project.pbxproj b/extensions/proj.mac/extensions.xcodeproj/project.pbxproj deleted file mode 100644 index bdee787e8f..0000000000 --- a/extensions/proj.mac/extensions.xcodeproj/project.pbxproj +++ /dev/null @@ -1,1146 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 1A0C0A7E1777F79700838530 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A0C0A7D1777F79700838530 /* Foundation.framework */; }; - 1A0C0CEA1777F9CD00838530 /* AssetsManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0BF01777F9CD00838530 /* AssetsManager.cpp */; }; - 1A0C0CEB1777F9CD00838530 /* CCArmatureAnimation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0BF41777F9CD00838530 /* CCArmatureAnimation.cpp */; }; - 1A0C0CEC1777F9CD00838530 /* CCProcessBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0BF61777F9CD00838530 /* CCProcessBase.cpp */; }; - 1A0C0CED1777F9CD00838530 /* CCTween.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0BF81777F9CD00838530 /* CCTween.cpp */; }; - 1A0C0CEE1777F9CD00838530 /* CCArmature.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0BFA1777F9CD00838530 /* CCArmature.cpp */; }; - 1A0C0CEF1777F9CD00838530 /* CCBone.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0BFC1777F9CD00838530 /* CCBone.cpp */; }; - 1A0C0CF01777F9CD00838530 /* CCDatas.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0BFF1777F9CD00838530 /* CCDatas.cpp */; }; - 1A0C0CF11777F9CD00838530 /* CCBatchNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C021777F9CD00838530 /* CCBatchNode.cpp */; }; - 1A0C0CF21777F9CD00838530 /* CCDecorativeDisplay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C041777F9CD00838530 /* CCDecorativeDisplay.cpp */; }; - 1A0C0CF31777F9CD00838530 /* CCDisplayFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C061777F9CD00838530 /* CCDisplayFactory.cpp */; }; - 1A0C0CF41777F9CD00838530 /* CCDisplayManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C081777F9CD00838530 /* CCDisplayManager.cpp */; }; - 1A0C0CF51777F9CD00838530 /* CCShaderNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C0A1777F9CD00838530 /* CCShaderNode.cpp */; }; - 1A0C0CF61777F9CD00838530 /* CCSkin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C0C1777F9CD00838530 /* CCSkin.cpp */; }; - 1A0C0CF71777F9CD00838530 /* CCTexture2DMutable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C0F1777F9CD00838530 /* CCTexture2DMutable.cpp */; }; - 1A0C0CF81777F9CD00838530 /* GLES-Render.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C111777F9CD00838530 /* GLES-Render.cpp */; }; - 1A0C0CF91777F9CD00838530 /* CSContentJsonDictionary.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C141777F9CD00838530 /* CSContentJsonDictionary.cpp */; }; - 1A0C0CFA1777F9CD00838530 /* json_reader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C1F1777F9CD00838530 /* json_reader.cpp */; }; - 1A0C0CFB1777F9CD00838530 /* json_value.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C211777F9CD00838530 /* json_value.cpp */; }; - 1A0C0CFC1777F9CD00838530 /* json_writer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C231777F9CD00838530 /* json_writer.cpp */; }; - 1A0C0CFD1777F9CD00838530 /* CCColliderDetector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C2A1777F9CD00838530 /* CCColliderDetector.cpp */; }; - 1A0C0CFE1777F9CD00838530 /* CCPhysicsWorld.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C2C1777F9CD00838530 /* CCPhysicsWorld.cpp */; }; - 1A0C0CFF1777F9CD00838530 /* CCArmatureDataManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C2F1777F9CD00838530 /* CCArmatureDataManager.cpp */; }; - 1A0C0D001777F9CD00838530 /* CCDataReaderHelper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C331777F9CD00838530 /* CCDataReaderHelper.cpp */; }; - 1A0C0D011777F9CD00838530 /* CCSpriteFrameCacheHelper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C351777F9CD00838530 /* CCSpriteFrameCacheHelper.cpp */; }; - 1A0C0D021777F9CD00838530 /* CCTransformHelp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C371777F9CD00838530 /* CCTransformHelp.cpp */; }; - 1A0C0D031777F9CD00838530 /* CCTweenFunction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C391777F9CD00838530 /* CCTweenFunction.cpp */; }; - 1A0C0D041777F9CD00838530 /* CCUtilMath.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C3B1777F9CD00838530 /* CCUtilMath.cpp */; }; - 1A0C0D051777F9CD00838530 /* CCBAnimationManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C3E1777F9CD00838530 /* CCBAnimationManager.cpp */; }; - 1A0C0D061777F9CD00838530 /* CCBFileLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C401777F9CD00838530 /* CCBFileLoader.cpp */; }; - 1A0C0D071777F9CD00838530 /* CCBKeyframe.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C421777F9CD00838530 /* CCBKeyframe.cpp */; }; - 1A0C0D081777F9CD00838530 /* CCBReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C451777F9CD00838530 /* CCBReader.cpp */; }; - 1A0C0D091777F9CD00838530 /* CCBSequence.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C481777F9CD00838530 /* CCBSequence.cpp */; }; - 1A0C0D0A1777F9CD00838530 /* CCBSequenceProperty.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C4A1777F9CD00838530 /* CCBSequenceProperty.cpp */; }; - 1A0C0D0B1777F9CD00838530 /* CCBValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C4C1777F9CD00838530 /* CCBValue.cpp */; }; - 1A0C0D0C1777F9CD00838530 /* CCControlButtonLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C4E1777F9CD00838530 /* CCControlButtonLoader.cpp */; }; - 1A0C0D0D1777F9CD00838530 /* CCControlLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C501777F9CD00838530 /* CCControlLoader.cpp */; }; - 1A0C0D0E1777F9CD00838530 /* CCLabelBMFontLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C521777F9CD00838530 /* CCLabelBMFontLoader.cpp */; }; - 1A0C0D0F1777F9CD00838530 /* CCLabelTTFLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C541777F9CD00838530 /* CCLabelTTFLoader.cpp */; }; - 1A0C0D101777F9CD00838530 /* CCLayerColorLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C561777F9CD00838530 /* CCLayerColorLoader.cpp */; }; - 1A0C0D111777F9CD00838530 /* CCLayerGradientLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C581777F9CD00838530 /* CCLayerGradientLoader.cpp */; }; - 1A0C0D121777F9CD00838530 /* CCLayerLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C5A1777F9CD00838530 /* CCLayerLoader.cpp */; }; - 1A0C0D131777F9CD00838530 /* CCMenuItemImageLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C5C1777F9CD00838530 /* CCMenuItemImageLoader.cpp */; }; - 1A0C0D141777F9CD00838530 /* CCMenuItemLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C5E1777F9CD00838530 /* CCMenuItemLoader.cpp */; }; - 1A0C0D151777F9CD00838530 /* CCNode+CCBRelativePositioning.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C611777F9CD00838530 /* CCNode+CCBRelativePositioning.cpp */; }; - 1A0C0D161777F9CD00838530 /* CCNodeLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C631777F9CD00838530 /* CCNodeLoader.cpp */; }; - 1A0C0D171777F9CD00838530 /* CCNodeLoaderLibrary.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C651777F9CD00838530 /* CCNodeLoaderLibrary.cpp */; }; - 1A0C0D181777F9CD00838530 /* CCParticleSystemQuadLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C681777F9CD00838530 /* CCParticleSystemQuadLoader.cpp */; }; - 1A0C0D191777F9CD00838530 /* CCScale9SpriteLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C6A1777F9CD00838530 /* CCScale9SpriteLoader.cpp */; }; - 1A0C0D1A1777F9CD00838530 /* CCScrollViewLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C6C1777F9CD00838530 /* CCScrollViewLoader.cpp */; }; - 1A0C0D1B1777F9CD00838530 /* CCSpriteLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C6E1777F9CD00838530 /* CCSpriteLoader.cpp */; }; - 1A0C0D1C1777F9CD00838530 /* CCComAttribute.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C721777F9CD00838530 /* CCComAttribute.cpp */; }; - 1A0C0D1D1777F9CD00838530 /* CCComAudio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C741777F9CD00838530 /* CCComAudio.cpp */; }; - 1A0C0D1E1777F9CD00838530 /* CCComController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C761777F9CD00838530 /* CCComController.cpp */; }; - 1A0C0D1F1777F9CD00838530 /* CCInputDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C781777F9CD00838530 /* CCInputDelegate.cpp */; }; - 1A0C0D201777F9CD00838530 /* CCControl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C7D1777F9CD00838530 /* CCControl.cpp */; }; - 1A0C0D211777F9CD00838530 /* CCControlButton.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C7F1777F9CD00838530 /* CCControlButton.cpp */; }; - 1A0C0D221777F9CD00838530 /* CCControlColourPicker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C811777F9CD00838530 /* CCControlColourPicker.cpp */; }; - 1A0C0D231777F9CD00838530 /* CCControlHuePicker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C841777F9CD00838530 /* CCControlHuePicker.cpp */; }; - 1A0C0D241777F9CD00838530 /* CCControlPotentiometer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C861777F9CD00838530 /* CCControlPotentiometer.cpp */; }; - 1A0C0D251777F9CD00838530 /* CCControlSaturationBrightnessPicker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C881777F9CD00838530 /* CCControlSaturationBrightnessPicker.cpp */; }; - 1A0C0D261777F9CD00838530 /* CCControlSlider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C8A1777F9CD00838530 /* CCControlSlider.cpp */; }; - 1A0C0D271777F9CD00838530 /* CCControlStepper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C8C1777F9CD00838530 /* CCControlStepper.cpp */; }; - 1A0C0D281777F9CD00838530 /* CCControlSwitch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C8E1777F9CD00838530 /* CCControlSwitch.cpp */; }; - 1A0C0D291777F9CD00838530 /* CCControlUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C901777F9CD00838530 /* CCControlUtils.cpp */; }; - 1A0C0D2A1777F9CD00838530 /* CCInvocation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C921777F9CD00838530 /* CCInvocation.cpp */; }; - 1A0C0D2B1777F9CD00838530 /* CCScale9Sprite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C941777F9CD00838530 /* CCScale9Sprite.cpp */; }; - 1A0C0D2C1777F9CD00838530 /* CCEditBox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C971777F9CD00838530 /* CCEditBox.cpp */; }; - 1A0C0D2D1777F9CD00838530 /* CCEditBoxImplAndroid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C9A1777F9CD00838530 /* CCEditBoxImplAndroid.cpp */; }; - 1A0C0D2E1777F9CD00838530 /* CCEditBoxImplIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C9D1777F9CD00838530 /* CCEditBoxImplIOS.mm */; }; - 1A0C0D2F1777F9CD00838530 /* CCEditBoxImplMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0C9F1777F9CD00838530 /* CCEditBoxImplMac.mm */; }; - 1A0C0D301777F9CD00838530 /* CCEditBoxImplNone.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CA01777F9CD00838530 /* CCEditBoxImplNone.cpp */; }; - 1A0C0D311777F9CD00838530 /* CCEditBoxImplTizen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CA11777F9CD00838530 /* CCEditBoxImplTizen.cpp */; }; - 1A0C0D321777F9CD00838530 /* CCEditBoxImplWin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CA31777F9CD00838530 /* CCEditBoxImplWin.cpp */; }; - 1A0C0D331777F9CD00838530 /* CCScrollView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CA61777F9CD00838530 /* CCScrollView.cpp */; }; - 1A0C0D341777F9CD00838530 /* CCSorting.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CA81777F9CD00838530 /* CCSorting.cpp */; }; - 1A0C0D351777F9CD00838530 /* CCTableView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CAA1777F9CD00838530 /* CCTableView.cpp */; }; - 1A0C0D361777F9CD00838530 /* CCTableViewCell.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CAC1777F9CD00838530 /* CCTableViewCell.cpp */; }; - 1A0C0D371777F9CD00838530 /* LocalStorage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CAF1777F9CD00838530 /* LocalStorage.cpp */; }; - 1A0C0D381777F9CD00838530 /* LocalStorageAndroid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CB11777F9CD00838530 /* LocalStorageAndroid.cpp */; }; - 1A0C0D391777F9CD00838530 /* HttpClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CB31777F9CD00838530 /* HttpClient.cpp */; }; - 1A0C0D3A1777F9CD00838530 /* WebSocket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CB71777F9CD00838530 /* WebSocket.cpp */; }; - 1A0C0D3B1777F9CD00838530 /* CCPhysicsDebugNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CBA1777F9CD00838530 /* CCPhysicsDebugNode.cpp */; }; - 1A0C0D3C1777F9CD00838530 /* CCPhysicsSprite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CBC1777F9CD00838530 /* CCPhysicsSprite.cpp */; }; - 1A0C0D3D1777F9CD00838530 /* Animation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CBF1777F9CD00838530 /* Animation.cpp */; }; - 1A0C0D3E1777F9CD00838530 /* AnimationState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CC11777F9CD00838530 /* AnimationState.cpp */; }; - 1A0C0D3F1777F9CD00838530 /* AnimationStateData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CC31777F9CD00838530 /* AnimationStateData.cpp */; }; - 1A0C0D401777F9CD00838530 /* Atlas.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CC51777F9CD00838530 /* Atlas.cpp */; }; - 1A0C0D411777F9CD00838530 /* AtlasAttachmentLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CC71777F9CD00838530 /* AtlasAttachmentLoader.cpp */; }; - 1A0C0D421777F9CD00838530 /* Attachment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CC91777F9CD00838530 /* Attachment.cpp */; }; - 1A0C0D431777F9CD00838530 /* AttachmentLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CCB1777F9CD00838530 /* AttachmentLoader.cpp */; }; - 1A0C0D441777F9CD00838530 /* Bone.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CCD1777F9CD00838530 /* Bone.cpp */; }; - 1A0C0D451777F9CD00838530 /* BoneData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CCF1777F9CD00838530 /* BoneData.cpp */; }; - 1A0C0D461777F9CD00838530 /* CCSkeleton.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CD11777F9CD00838530 /* CCSkeleton.cpp */; }; - 1A0C0D471777F9CD00838530 /* CCSkeletonAnimation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CD31777F9CD00838530 /* CCSkeletonAnimation.cpp */; }; - 1A0C0D481777F9CD00838530 /* extension.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CD51777F9CD00838530 /* extension.cpp */; }; - 1A0C0D491777F9CD00838530 /* Json.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CD71777F9CD00838530 /* Json.cpp */; }; - 1A0C0D4A1777F9CD00838530 /* RegionAttachment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CD91777F9CD00838530 /* RegionAttachment.cpp */; }; - 1A0C0D4B1777F9CD00838530 /* Skeleton.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CDB1777F9CD00838530 /* Skeleton.cpp */; }; - 1A0C0D4C1777F9CD00838530 /* SkeletonData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CDD1777F9CD00838530 /* SkeletonData.cpp */; }; - 1A0C0D4D1777F9CD00838530 /* SkeletonJson.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CDF1777F9CD00838530 /* SkeletonJson.cpp */; }; - 1A0C0D4E1777F9CD00838530 /* Skin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CE11777F9CD00838530 /* Skin.cpp */; }; - 1A0C0D4F1777F9CD00838530 /* Slot.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CE31777F9CD00838530 /* Slot.cpp */; }; - 1A0C0D501777F9CD00838530 /* SlotData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CE51777F9CD00838530 /* SlotData.cpp */; }; - 1A0C0D511777F9CD00838530 /* spine-cocos2dx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CE71777F9CD00838530 /* spine-cocos2dx.cpp */; }; - A05FCAE8177C1A1400BE600E /* libwebsockets.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A05FCAE7177C1A1400BE600E /* libwebsockets.a */; }; - A05FCAEA177C1F8E00BE600E /* libcurl.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A05FCAE9177C1F8E00BE600E /* libcurl.dylib */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 1A0C0A781777F79700838530 /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = "include/${PRODUCT_NAME}"; - dstSubfolderSpec = 16; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 1A0C0A7A1777F79700838530 /* libextensions.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libextensions.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 1A0C0A7D1777F79700838530 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; - 1A0C0A8B1777F7DD00838530 /* extensions-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "extensions-Prefix.pch"; sourceTree = "<group>"; }; - 1A0C0BF01777F9CD00838530 /* AssetsManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AssetsManager.cpp; sourceTree = "<group>"; }; - 1A0C0BF11777F9CD00838530 /* AssetsManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AssetsManager.h; sourceTree = "<group>"; }; - 1A0C0BF41777F9CD00838530 /* CCArmatureAnimation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCArmatureAnimation.cpp; sourceTree = "<group>"; }; - 1A0C0BF51777F9CD00838530 /* CCArmatureAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCArmatureAnimation.h; sourceTree = "<group>"; }; - 1A0C0BF61777F9CD00838530 /* CCProcessBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCProcessBase.cpp; sourceTree = "<group>"; }; - 1A0C0BF71777F9CD00838530 /* CCProcessBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCProcessBase.h; sourceTree = "<group>"; }; - 1A0C0BF81777F9CD00838530 /* CCTween.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCTween.cpp; sourceTree = "<group>"; }; - 1A0C0BF91777F9CD00838530 /* CCTween.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTween.h; sourceTree = "<group>"; }; - 1A0C0BFA1777F9CD00838530 /* CCArmature.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCArmature.cpp; sourceTree = "<group>"; }; - 1A0C0BFB1777F9CD00838530 /* CCArmature.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCArmature.h; sourceTree = "<group>"; }; - 1A0C0BFC1777F9CD00838530 /* CCBone.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCBone.cpp; sourceTree = "<group>"; }; - 1A0C0BFD1777F9CD00838530 /* CCBone.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCBone.h; sourceTree = "<group>"; }; - 1A0C0BFF1777F9CD00838530 /* CCDatas.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCDatas.cpp; sourceTree = "<group>"; }; - 1A0C0C001777F9CD00838530 /* CCDatas.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCDatas.h; sourceTree = "<group>"; }; - 1A0C0C021777F9CD00838530 /* CCBatchNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCBatchNode.cpp; sourceTree = "<group>"; }; - 1A0C0C031777F9CD00838530 /* CCBatchNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCBatchNode.h; sourceTree = "<group>"; }; - 1A0C0C041777F9CD00838530 /* CCDecorativeDisplay.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCDecorativeDisplay.cpp; sourceTree = "<group>"; }; - 1A0C0C051777F9CD00838530 /* CCDecorativeDisplay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCDecorativeDisplay.h; sourceTree = "<group>"; }; - 1A0C0C061777F9CD00838530 /* CCDisplayFactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCDisplayFactory.cpp; sourceTree = "<group>"; }; - 1A0C0C071777F9CD00838530 /* CCDisplayFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCDisplayFactory.h; sourceTree = "<group>"; }; - 1A0C0C081777F9CD00838530 /* CCDisplayManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCDisplayManager.cpp; sourceTree = "<group>"; }; - 1A0C0C091777F9CD00838530 /* CCDisplayManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCDisplayManager.h; sourceTree = "<group>"; }; - 1A0C0C0A1777F9CD00838530 /* CCShaderNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCShaderNode.cpp; sourceTree = "<group>"; }; - 1A0C0C0B1777F9CD00838530 /* CCShaderNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCShaderNode.h; sourceTree = "<group>"; }; - 1A0C0C0C1777F9CD00838530 /* CCSkin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCSkin.cpp; sourceTree = "<group>"; }; - 1A0C0C0D1777F9CD00838530 /* CCSkin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCSkin.h; sourceTree = "<group>"; }; - 1A0C0C0F1777F9CD00838530 /* CCTexture2DMutable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCTexture2DMutable.cpp; sourceTree = "<group>"; }; - 1A0C0C101777F9CD00838530 /* CCTexture2DMutable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTexture2DMutable.h; sourceTree = "<group>"; }; - 1A0C0C111777F9CD00838530 /* GLES-Render.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "GLES-Render.cpp"; sourceTree = "<group>"; }; - 1A0C0C121777F9CD00838530 /* GLES-Render.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "GLES-Render.h"; sourceTree = "<group>"; }; - 1A0C0C141777F9CD00838530 /* CSContentJsonDictionary.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSContentJsonDictionary.cpp; sourceTree = "<group>"; }; - 1A0C0C151777F9CD00838530 /* CSContentJsonDictionary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSContentJsonDictionary.h; sourceTree = "<group>"; }; - 1A0C0C171777F9CD00838530 /* autolink.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = autolink.h; sourceTree = "<group>"; }; - 1A0C0C181777F9CD00838530 /* config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = "<group>"; }; - 1A0C0C191777F9CD00838530 /* features.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = features.h; sourceTree = "<group>"; }; - 1A0C0C1A1777F9CD00838530 /* forwards.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = forwards.h; sourceTree = "<group>"; }; - 1A0C0C1B1777F9CD00838530 /* json_batchallocator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = json_batchallocator.h; sourceTree = "<group>"; }; - 1A0C0C1C1777F9CD00838530 /* json_internalarray.inl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = json_internalarray.inl; sourceTree = "<group>"; }; - 1A0C0C1D1777F9CD00838530 /* json_internalmap.inl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = json_internalmap.inl; sourceTree = "<group>"; }; - 1A0C0C1E1777F9CD00838530 /* json_lib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = json_lib.h; sourceTree = "<group>"; }; - 1A0C0C1F1777F9CD00838530 /* json_reader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = json_reader.cpp; sourceTree = "<group>"; }; - 1A0C0C201777F9CD00838530 /* json_tool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = json_tool.h; sourceTree = "<group>"; }; - 1A0C0C211777F9CD00838530 /* json_value.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = json_value.cpp; sourceTree = "<group>"; }; - 1A0C0C221777F9CD00838530 /* json_valueiterator.inl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = json_valueiterator.inl; sourceTree = "<group>"; }; - 1A0C0C231777F9CD00838530 /* json_writer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = json_writer.cpp; sourceTree = "<group>"; }; - 1A0C0C241777F9CD00838530 /* reader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = reader.h; sourceTree = "<group>"; }; - 1A0C0C251777F9CD00838530 /* sconscript */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = sconscript; sourceTree = "<group>"; }; - 1A0C0C261777F9CD00838530 /* value.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = value.h; sourceTree = "<group>"; }; - 1A0C0C271777F9CD00838530 /* writer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = writer.h; sourceTree = "<group>"; }; - 1A0C0C281777F9CD00838530 /* sigslot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sigslot.h; sourceTree = "<group>"; }; - 1A0C0C2A1777F9CD00838530 /* CCColliderDetector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCColliderDetector.cpp; sourceTree = "<group>"; }; - 1A0C0C2B1777F9CD00838530 /* CCColliderDetector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCColliderDetector.h; sourceTree = "<group>"; }; - 1A0C0C2C1777F9CD00838530 /* CCPhysicsWorld.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCPhysicsWorld.cpp; sourceTree = "<group>"; }; - 1A0C0C2D1777F9CD00838530 /* CCPhysicsWorld.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCPhysicsWorld.h; sourceTree = "<group>"; }; - 1A0C0C2F1777F9CD00838530 /* CCArmatureDataManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCArmatureDataManager.cpp; sourceTree = "<group>"; }; - 1A0C0C301777F9CD00838530 /* CCArmatureDataManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCArmatureDataManager.h; sourceTree = "<group>"; }; - 1A0C0C311777F9CD00838530 /* CCArmatureDefine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCArmatureDefine.h; sourceTree = "<group>"; }; - 1A0C0C321777F9CD00838530 /* CCConstValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCConstValue.h; sourceTree = "<group>"; }; - 1A0C0C331777F9CD00838530 /* CCDataReaderHelper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCDataReaderHelper.cpp; sourceTree = "<group>"; }; - 1A0C0C341777F9CD00838530 /* CCDataReaderHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCDataReaderHelper.h; sourceTree = "<group>"; }; - 1A0C0C351777F9CD00838530 /* CCSpriteFrameCacheHelper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCSpriteFrameCacheHelper.cpp; sourceTree = "<group>"; }; - 1A0C0C361777F9CD00838530 /* CCSpriteFrameCacheHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCSpriteFrameCacheHelper.h; sourceTree = "<group>"; }; - 1A0C0C371777F9CD00838530 /* CCTransformHelp.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCTransformHelp.cpp; sourceTree = "<group>"; }; - 1A0C0C381777F9CD00838530 /* CCTransformHelp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTransformHelp.h; sourceTree = "<group>"; }; - 1A0C0C391777F9CD00838530 /* CCTweenFunction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCTweenFunction.cpp; sourceTree = "<group>"; }; - 1A0C0C3A1777F9CD00838530 /* CCTweenFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTweenFunction.h; sourceTree = "<group>"; }; - 1A0C0C3B1777F9CD00838530 /* CCUtilMath.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCUtilMath.cpp; sourceTree = "<group>"; }; - 1A0C0C3C1777F9CD00838530 /* CCUtilMath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCUtilMath.h; sourceTree = "<group>"; }; - 1A0C0C3E1777F9CD00838530 /* CCBAnimationManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCBAnimationManager.cpp; sourceTree = "<group>"; }; - 1A0C0C3F1777F9CD00838530 /* CCBAnimationManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCBAnimationManager.h; sourceTree = "<group>"; }; - 1A0C0C401777F9CD00838530 /* CCBFileLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCBFileLoader.cpp; sourceTree = "<group>"; }; - 1A0C0C411777F9CD00838530 /* CCBFileLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCBFileLoader.h; sourceTree = "<group>"; }; - 1A0C0C421777F9CD00838530 /* CCBKeyframe.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCBKeyframe.cpp; sourceTree = "<group>"; }; - 1A0C0C431777F9CD00838530 /* CCBKeyframe.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCBKeyframe.h; sourceTree = "<group>"; }; - 1A0C0C441777F9CD00838530 /* CCBMemberVariableAssigner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCBMemberVariableAssigner.h; sourceTree = "<group>"; }; - 1A0C0C451777F9CD00838530 /* CCBReader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCBReader.cpp; sourceTree = "<group>"; }; - 1A0C0C461777F9CD00838530 /* CCBReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCBReader.h; sourceTree = "<group>"; }; - 1A0C0C471777F9CD00838530 /* CCBSelectorResolver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCBSelectorResolver.h; sourceTree = "<group>"; }; - 1A0C0C481777F9CD00838530 /* CCBSequence.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCBSequence.cpp; sourceTree = "<group>"; }; - 1A0C0C491777F9CD00838530 /* CCBSequence.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCBSequence.h; sourceTree = "<group>"; }; - 1A0C0C4A1777F9CD00838530 /* CCBSequenceProperty.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCBSequenceProperty.cpp; sourceTree = "<group>"; }; - 1A0C0C4B1777F9CD00838530 /* CCBSequenceProperty.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCBSequenceProperty.h; sourceTree = "<group>"; }; - 1A0C0C4C1777F9CD00838530 /* CCBValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCBValue.cpp; sourceTree = "<group>"; }; - 1A0C0C4D1777F9CD00838530 /* CCBValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCBValue.h; sourceTree = "<group>"; }; - 1A0C0C4E1777F9CD00838530 /* CCControlButtonLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlButtonLoader.cpp; sourceTree = "<group>"; }; - 1A0C0C4F1777F9CD00838530 /* CCControlButtonLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCControlButtonLoader.h; sourceTree = "<group>"; }; - 1A0C0C501777F9CD00838530 /* CCControlLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlLoader.cpp; sourceTree = "<group>"; }; - 1A0C0C511777F9CD00838530 /* CCControlLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCControlLoader.h; sourceTree = "<group>"; }; - 1A0C0C521777F9CD00838530 /* CCLabelBMFontLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCLabelBMFontLoader.cpp; sourceTree = "<group>"; }; - 1A0C0C531777F9CD00838530 /* CCLabelBMFontLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCLabelBMFontLoader.h; sourceTree = "<group>"; }; - 1A0C0C541777F9CD00838530 /* CCLabelTTFLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCLabelTTFLoader.cpp; sourceTree = "<group>"; }; - 1A0C0C551777F9CD00838530 /* CCLabelTTFLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCLabelTTFLoader.h; sourceTree = "<group>"; }; - 1A0C0C561777F9CD00838530 /* CCLayerColorLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCLayerColorLoader.cpp; sourceTree = "<group>"; }; - 1A0C0C571777F9CD00838530 /* CCLayerColorLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCLayerColorLoader.h; sourceTree = "<group>"; }; - 1A0C0C581777F9CD00838530 /* CCLayerGradientLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCLayerGradientLoader.cpp; sourceTree = "<group>"; }; - 1A0C0C591777F9CD00838530 /* CCLayerGradientLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCLayerGradientLoader.h; sourceTree = "<group>"; }; - 1A0C0C5A1777F9CD00838530 /* CCLayerLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCLayerLoader.cpp; sourceTree = "<group>"; }; - 1A0C0C5B1777F9CD00838530 /* CCLayerLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCLayerLoader.h; sourceTree = "<group>"; }; - 1A0C0C5C1777F9CD00838530 /* CCMenuItemImageLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCMenuItemImageLoader.cpp; sourceTree = "<group>"; }; - 1A0C0C5D1777F9CD00838530 /* CCMenuItemImageLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCMenuItemImageLoader.h; sourceTree = "<group>"; }; - 1A0C0C5E1777F9CD00838530 /* CCMenuItemLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCMenuItemLoader.cpp; sourceTree = "<group>"; }; - 1A0C0C5F1777F9CD00838530 /* CCMenuItemLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCMenuItemLoader.h; sourceTree = "<group>"; }; - 1A0C0C601777F9CD00838530 /* CCMenuLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCMenuLoader.h; sourceTree = "<group>"; }; - 1A0C0C611777F9CD00838530 /* CCNode+CCBRelativePositioning.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "CCNode+CCBRelativePositioning.cpp"; sourceTree = "<group>"; }; - 1A0C0C621777F9CD00838530 /* CCNode+CCBRelativePositioning.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CCNode+CCBRelativePositioning.h"; sourceTree = "<group>"; }; - 1A0C0C631777F9CD00838530 /* CCNodeLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCNodeLoader.cpp; sourceTree = "<group>"; }; - 1A0C0C641777F9CD00838530 /* CCNodeLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCNodeLoader.h; sourceTree = "<group>"; }; - 1A0C0C651777F9CD00838530 /* CCNodeLoaderLibrary.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCNodeLoaderLibrary.cpp; sourceTree = "<group>"; }; - 1A0C0C661777F9CD00838530 /* CCNodeLoaderLibrary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCNodeLoaderLibrary.h; sourceTree = "<group>"; }; - 1A0C0C671777F9CD00838530 /* CCNodeLoaderListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCNodeLoaderListener.h; sourceTree = "<group>"; }; - 1A0C0C681777F9CD00838530 /* CCParticleSystemQuadLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCParticleSystemQuadLoader.cpp; sourceTree = "<group>"; }; - 1A0C0C691777F9CD00838530 /* CCParticleSystemQuadLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCParticleSystemQuadLoader.h; sourceTree = "<group>"; }; - 1A0C0C6A1777F9CD00838530 /* CCScale9SpriteLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCScale9SpriteLoader.cpp; sourceTree = "<group>"; }; - 1A0C0C6B1777F9CD00838530 /* CCScale9SpriteLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCScale9SpriteLoader.h; sourceTree = "<group>"; }; - 1A0C0C6C1777F9CD00838530 /* CCScrollViewLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCScrollViewLoader.cpp; sourceTree = "<group>"; }; - 1A0C0C6D1777F9CD00838530 /* CCScrollViewLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCScrollViewLoader.h; sourceTree = "<group>"; }; - 1A0C0C6E1777F9CD00838530 /* CCSpriteLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCSpriteLoader.cpp; sourceTree = "<group>"; }; - 1A0C0C6F1777F9CD00838530 /* CCSpriteLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCSpriteLoader.h; sourceTree = "<group>"; }; - 1A0C0C701777F9CD00838530 /* cocos-ext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "cocos-ext.h"; path = "../cocos-ext.h"; sourceTree = "<group>"; }; - 1A0C0C721777F9CD00838530 /* CCComAttribute.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCComAttribute.cpp; sourceTree = "<group>"; }; - 1A0C0C731777F9CD00838530 /* CCComAttribute.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCComAttribute.h; sourceTree = "<group>"; }; - 1A0C0C741777F9CD00838530 /* CCComAudio.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCComAudio.cpp; sourceTree = "<group>"; }; - 1A0C0C751777F9CD00838530 /* CCComAudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCComAudio.h; sourceTree = "<group>"; }; - 1A0C0C761777F9CD00838530 /* CCComController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCComController.cpp; sourceTree = "<group>"; }; - 1A0C0C771777F9CD00838530 /* CCComController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCComController.h; sourceTree = "<group>"; }; - 1A0C0C781777F9CD00838530 /* CCInputDelegate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCInputDelegate.cpp; sourceTree = "<group>"; }; - 1A0C0C791777F9CD00838530 /* CCInputDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCInputDelegate.h; sourceTree = "<group>"; }; - 1A0C0C7A1777F9CD00838530 /* ExtensionMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ExtensionMacros.h; path = ../ExtensionMacros.h; sourceTree = "<group>"; }; - 1A0C0C7D1777F9CD00838530 /* CCControl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCControl.cpp; sourceTree = "<group>"; }; - 1A0C0C7E1777F9CD00838530 /* CCControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCControl.h; sourceTree = "<group>"; }; - 1A0C0C7F1777F9CD00838530 /* CCControlButton.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlButton.cpp; sourceTree = "<group>"; }; - 1A0C0C801777F9CD00838530 /* CCControlButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCControlButton.h; sourceTree = "<group>"; }; - 1A0C0C811777F9CD00838530 /* CCControlColourPicker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlColourPicker.cpp; sourceTree = "<group>"; }; - 1A0C0C821777F9CD00838530 /* CCControlColourPicker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCControlColourPicker.h; sourceTree = "<group>"; }; - 1A0C0C831777F9CD00838530 /* CCControlExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCControlExtensions.h; sourceTree = "<group>"; }; - 1A0C0C841777F9CD00838530 /* CCControlHuePicker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlHuePicker.cpp; sourceTree = "<group>"; }; - 1A0C0C851777F9CD00838530 /* CCControlHuePicker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCControlHuePicker.h; sourceTree = "<group>"; }; - 1A0C0C861777F9CD00838530 /* CCControlPotentiometer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlPotentiometer.cpp; sourceTree = "<group>"; }; - 1A0C0C871777F9CD00838530 /* CCControlPotentiometer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCControlPotentiometer.h; sourceTree = "<group>"; }; - 1A0C0C881777F9CD00838530 /* CCControlSaturationBrightnessPicker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlSaturationBrightnessPicker.cpp; sourceTree = "<group>"; }; - 1A0C0C891777F9CD00838530 /* CCControlSaturationBrightnessPicker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCControlSaturationBrightnessPicker.h; sourceTree = "<group>"; }; - 1A0C0C8A1777F9CD00838530 /* CCControlSlider.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlSlider.cpp; sourceTree = "<group>"; }; - 1A0C0C8B1777F9CD00838530 /* CCControlSlider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCControlSlider.h; sourceTree = "<group>"; }; - 1A0C0C8C1777F9CD00838530 /* CCControlStepper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlStepper.cpp; sourceTree = "<group>"; }; - 1A0C0C8D1777F9CD00838530 /* CCControlStepper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCControlStepper.h; sourceTree = "<group>"; }; - 1A0C0C8E1777F9CD00838530 /* CCControlSwitch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlSwitch.cpp; sourceTree = "<group>"; }; - 1A0C0C8F1777F9CD00838530 /* CCControlSwitch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCControlSwitch.h; sourceTree = "<group>"; }; - 1A0C0C901777F9CD00838530 /* CCControlUtils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlUtils.cpp; sourceTree = "<group>"; }; - 1A0C0C911777F9CD00838530 /* CCControlUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCControlUtils.h; sourceTree = "<group>"; }; - 1A0C0C921777F9CD00838530 /* CCInvocation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCInvocation.cpp; sourceTree = "<group>"; }; - 1A0C0C931777F9CD00838530 /* CCInvocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCInvocation.h; sourceTree = "<group>"; }; - 1A0C0C941777F9CD00838530 /* CCScale9Sprite.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCScale9Sprite.cpp; sourceTree = "<group>"; }; - 1A0C0C951777F9CD00838530 /* CCScale9Sprite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCScale9Sprite.h; sourceTree = "<group>"; }; - 1A0C0C971777F9CD00838530 /* CCEditBox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCEditBox.cpp; sourceTree = "<group>"; }; - 1A0C0C981777F9CD00838530 /* CCEditBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCEditBox.h; sourceTree = "<group>"; }; - 1A0C0C991777F9CD00838530 /* CCEditBoxImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCEditBoxImpl.h; sourceTree = "<group>"; }; - 1A0C0C9A1777F9CD00838530 /* CCEditBoxImplAndroid.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCEditBoxImplAndroid.cpp; sourceTree = "<group>"; }; - 1A0C0C9B1777F9CD00838530 /* CCEditBoxImplAndroid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCEditBoxImplAndroid.h; sourceTree = "<group>"; }; - 1A0C0C9C1777F9CD00838530 /* CCEditBoxImplIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCEditBoxImplIOS.h; sourceTree = "<group>"; }; - 1A0C0C9D1777F9CD00838530 /* CCEditBoxImplIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CCEditBoxImplIOS.mm; sourceTree = "<group>"; }; - 1A0C0C9E1777F9CD00838530 /* CCEditBoxImplMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCEditBoxImplMac.h; sourceTree = "<group>"; }; - 1A0C0C9F1777F9CD00838530 /* CCEditBoxImplMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CCEditBoxImplMac.mm; sourceTree = "<group>"; }; - 1A0C0CA01777F9CD00838530 /* CCEditBoxImplNone.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCEditBoxImplNone.cpp; sourceTree = "<group>"; }; - 1A0C0CA11777F9CD00838530 /* CCEditBoxImplTizen.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCEditBoxImplTizen.cpp; sourceTree = "<group>"; }; - 1A0C0CA21777F9CD00838530 /* CCEditBoxImplTizen.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCEditBoxImplTizen.h; sourceTree = "<group>"; }; - 1A0C0CA31777F9CD00838530 /* CCEditBoxImplWin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCEditBoxImplWin.cpp; sourceTree = "<group>"; }; - 1A0C0CA41777F9CD00838530 /* CCEditBoxImplWin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCEditBoxImplWin.h; sourceTree = "<group>"; }; - 1A0C0CA61777F9CD00838530 /* CCScrollView.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCScrollView.cpp; sourceTree = "<group>"; }; - 1A0C0CA71777F9CD00838530 /* CCScrollView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCScrollView.h; sourceTree = "<group>"; }; - 1A0C0CA81777F9CD00838530 /* CCSorting.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCSorting.cpp; sourceTree = "<group>"; }; - 1A0C0CA91777F9CD00838530 /* CCSorting.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCSorting.h; sourceTree = "<group>"; }; - 1A0C0CAA1777F9CD00838530 /* CCTableView.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCTableView.cpp; sourceTree = "<group>"; }; - 1A0C0CAB1777F9CD00838530 /* CCTableView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTableView.h; sourceTree = "<group>"; }; - 1A0C0CAC1777F9CD00838530 /* CCTableViewCell.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCTableViewCell.cpp; sourceTree = "<group>"; }; - 1A0C0CAD1777F9CD00838530 /* CCTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTableViewCell.h; sourceTree = "<group>"; }; - 1A0C0CAF1777F9CD00838530 /* LocalStorage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LocalStorage.cpp; sourceTree = "<group>"; }; - 1A0C0CB01777F9CD00838530 /* LocalStorage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LocalStorage.h; sourceTree = "<group>"; }; - 1A0C0CB11777F9CD00838530 /* LocalStorageAndroid.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LocalStorageAndroid.cpp; sourceTree = "<group>"; }; - 1A0C0CB31777F9CD00838530 /* HttpClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HttpClient.cpp; sourceTree = "<group>"; }; - 1A0C0CB41777F9CD00838530 /* HttpClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HttpClient.h; sourceTree = "<group>"; }; - 1A0C0CB51777F9CD00838530 /* HttpRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HttpRequest.h; sourceTree = "<group>"; }; - 1A0C0CB61777F9CD00838530 /* HttpResponse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HttpResponse.h; sourceTree = "<group>"; }; - 1A0C0CB71777F9CD00838530 /* WebSocket.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebSocket.cpp; sourceTree = "<group>"; }; - 1A0C0CB81777F9CD00838530 /* WebSocket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSocket.h; sourceTree = "<group>"; }; - 1A0C0CBA1777F9CD00838530 /* CCPhysicsDebugNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCPhysicsDebugNode.cpp; sourceTree = "<group>"; }; - 1A0C0CBB1777F9CD00838530 /* CCPhysicsDebugNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCPhysicsDebugNode.h; sourceTree = "<group>"; }; - 1A0C0CBC1777F9CD00838530 /* CCPhysicsSprite.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCPhysicsSprite.cpp; sourceTree = "<group>"; }; - 1A0C0CBD1777F9CD00838530 /* CCPhysicsSprite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCPhysicsSprite.h; sourceTree = "<group>"; }; - 1A0C0CBF1777F9CD00838530 /* Animation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Animation.cpp; sourceTree = "<group>"; }; - 1A0C0CC01777F9CD00838530 /* Animation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Animation.h; sourceTree = "<group>"; }; - 1A0C0CC11777F9CD00838530 /* AnimationState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AnimationState.cpp; sourceTree = "<group>"; }; - 1A0C0CC21777F9CD00838530 /* AnimationState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AnimationState.h; sourceTree = "<group>"; }; - 1A0C0CC31777F9CD00838530 /* AnimationStateData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AnimationStateData.cpp; sourceTree = "<group>"; }; - 1A0C0CC41777F9CD00838530 /* AnimationStateData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AnimationStateData.h; sourceTree = "<group>"; }; - 1A0C0CC51777F9CD00838530 /* Atlas.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Atlas.cpp; sourceTree = "<group>"; }; - 1A0C0CC61777F9CD00838530 /* Atlas.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Atlas.h; sourceTree = "<group>"; }; - 1A0C0CC71777F9CD00838530 /* AtlasAttachmentLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AtlasAttachmentLoader.cpp; sourceTree = "<group>"; }; - 1A0C0CC81777F9CD00838530 /* AtlasAttachmentLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AtlasAttachmentLoader.h; sourceTree = "<group>"; }; - 1A0C0CC91777F9CD00838530 /* Attachment.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Attachment.cpp; sourceTree = "<group>"; }; - 1A0C0CCA1777F9CD00838530 /* Attachment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Attachment.h; sourceTree = "<group>"; }; - 1A0C0CCB1777F9CD00838530 /* AttachmentLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AttachmentLoader.cpp; sourceTree = "<group>"; }; - 1A0C0CCC1777F9CD00838530 /* AttachmentLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AttachmentLoader.h; sourceTree = "<group>"; }; - 1A0C0CCD1777F9CD00838530 /* Bone.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Bone.cpp; sourceTree = "<group>"; }; - 1A0C0CCE1777F9CD00838530 /* Bone.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Bone.h; sourceTree = "<group>"; }; - 1A0C0CCF1777F9CD00838530 /* BoneData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BoneData.cpp; sourceTree = "<group>"; }; - 1A0C0CD01777F9CD00838530 /* BoneData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BoneData.h; sourceTree = "<group>"; }; - 1A0C0CD11777F9CD00838530 /* CCSkeleton.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCSkeleton.cpp; sourceTree = "<group>"; }; - 1A0C0CD21777F9CD00838530 /* CCSkeleton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCSkeleton.h; sourceTree = "<group>"; }; - 1A0C0CD31777F9CD00838530 /* CCSkeletonAnimation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCSkeletonAnimation.cpp; sourceTree = "<group>"; }; - 1A0C0CD41777F9CD00838530 /* CCSkeletonAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCSkeletonAnimation.h; sourceTree = "<group>"; }; - 1A0C0CD51777F9CD00838530 /* extension.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = extension.cpp; sourceTree = "<group>"; }; - 1A0C0CD61777F9CD00838530 /* extension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = extension.h; sourceTree = "<group>"; }; - 1A0C0CD71777F9CD00838530 /* Json.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Json.cpp; sourceTree = "<group>"; }; - 1A0C0CD81777F9CD00838530 /* Json.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Json.h; sourceTree = "<group>"; }; - 1A0C0CD91777F9CD00838530 /* RegionAttachment.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegionAttachment.cpp; sourceTree = "<group>"; }; - 1A0C0CDA1777F9CD00838530 /* RegionAttachment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegionAttachment.h; sourceTree = "<group>"; }; - 1A0C0CDB1777F9CD00838530 /* Skeleton.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Skeleton.cpp; sourceTree = "<group>"; }; - 1A0C0CDC1777F9CD00838530 /* Skeleton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Skeleton.h; sourceTree = "<group>"; }; - 1A0C0CDD1777F9CD00838530 /* SkeletonData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SkeletonData.cpp; sourceTree = "<group>"; }; - 1A0C0CDE1777F9CD00838530 /* SkeletonData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SkeletonData.h; sourceTree = "<group>"; }; - 1A0C0CDF1777F9CD00838530 /* SkeletonJson.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SkeletonJson.cpp; sourceTree = "<group>"; }; - 1A0C0CE01777F9CD00838530 /* SkeletonJson.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SkeletonJson.h; sourceTree = "<group>"; }; - 1A0C0CE11777F9CD00838530 /* Skin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Skin.cpp; sourceTree = "<group>"; }; - 1A0C0CE21777F9CD00838530 /* Skin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Skin.h; sourceTree = "<group>"; }; - 1A0C0CE31777F9CD00838530 /* Slot.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Slot.cpp; sourceTree = "<group>"; }; - 1A0C0CE41777F9CD00838530 /* Slot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Slot.h; sourceTree = "<group>"; }; - 1A0C0CE51777F9CD00838530 /* SlotData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SlotData.cpp; sourceTree = "<group>"; }; - 1A0C0CE61777F9CD00838530 /* SlotData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SlotData.h; sourceTree = "<group>"; }; - 1A0C0CE71777F9CD00838530 /* spine-cocos2dx.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "spine-cocos2dx.cpp"; sourceTree = "<group>"; }; - 1A0C0CE81777F9CD00838530 /* spine-cocos2dx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "spine-cocos2dx.h"; sourceTree = "<group>"; }; - 1A0C0CE91777F9CD00838530 /* spine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = spine.h; sourceTree = "<group>"; }; - A05FCAE5177C1A1400BE600E /* libwebsockets.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = libwebsockets.h; sourceTree = "<group>"; }; - A05FCAE7177C1A1400BE600E /* libwebsockets.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libwebsockets.a; sourceTree = "<group>"; }; - A05FCAE9177C1F8E00BE600E /* libcurl.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libcurl.dylib; path = usr/lib/libcurl.dylib; sourceTree = SDKROOT; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 1A0C0A771777F79700838530 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - A05FCAEA177C1F8E00BE600E /* libcurl.dylib in Frameworks */, - 1A0C0A7E1777F79700838530 /* Foundation.framework in Frameworks */, - A05FCAE8177C1A1400BE600E /* libwebsockets.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 1A0C0A711777F79700838530 = { - isa = PBXGroup; - children = ( - 1A0C0BEF1777F9CD00838530 /* AssetsManager */, - 1A0C0BF21777F9CD00838530 /* CCArmature */, - 1A0C0C3D1777F9CD00838530 /* CCBReader */, - 1A0C0C701777F9CD00838530 /* cocos-ext.h */, - 1A0C0C711777F9CD00838530 /* Components */, - 1A0C0C7A1777F9CD00838530 /* ExtensionMacros.h */, - 1A0C0C7B1777F9CD00838530 /* GUI */, - 1A0C0CAE1777F9CD00838530 /* LocalStorage */, - 1A0C0CB21777F9CD00838530 /* network */, - 1A0C0CB91777F9CD00838530 /* physics_nodes */, - 1A0C0CBE1777F9CD00838530 /* spine */, - 1A0C0A8B1777F7DD00838530 /* extensions-Prefix.pch */, - 1A0C0A7C1777F79700838530 /* Frameworks */, - 1A0C0A7B1777F79700838530 /* Products */, - ); - sourceTree = "<group>"; - }; - 1A0C0A7B1777F79700838530 /* Products */ = { - isa = PBXGroup; - children = ( - 1A0C0A7A1777F79700838530 /* libextensions.a */, - ); - name = Products; - sourceTree = "<group>"; - }; - 1A0C0A7C1777F79700838530 /* Frameworks */ = { - isa = PBXGroup; - children = ( - A05FCAE9177C1F8E00BE600E /* libcurl.dylib */, - A05FCAE3177C1A1400BE600E /* libwebsockets */, - 1A0C0A7D1777F79700838530 /* Foundation.framework */, - ); - name = Frameworks; - sourceTree = "<group>"; - }; - 1A0C0BEF1777F9CD00838530 /* AssetsManager */ = { - isa = PBXGroup; - children = ( - 1A0C0BF01777F9CD00838530 /* AssetsManager.cpp */, - 1A0C0BF11777F9CD00838530 /* AssetsManager.h */, - ); - name = AssetsManager; - path = ../AssetsManager; - sourceTree = "<group>"; - }; - 1A0C0BF21777F9CD00838530 /* CCArmature */ = { - isa = PBXGroup; - children = ( - 1A0C0BF31777F9CD00838530 /* animation */, - 1A0C0BFA1777F9CD00838530 /* CCArmature.cpp */, - 1A0C0BFB1777F9CD00838530 /* CCArmature.h */, - 1A0C0BFC1777F9CD00838530 /* CCBone.cpp */, - 1A0C0BFD1777F9CD00838530 /* CCBone.h */, - 1A0C0BFE1777F9CD00838530 /* datas */, - 1A0C0C011777F9CD00838530 /* display */, - 1A0C0C0E1777F9CD00838530 /* external_tool */, - 1A0C0C291777F9CD00838530 /* physics */, - 1A0C0C2E1777F9CD00838530 /* utils */, - ); - name = CCArmature; - path = ../CCArmature; - sourceTree = "<group>"; - }; - 1A0C0BF31777F9CD00838530 /* animation */ = { - isa = PBXGroup; - children = ( - 1A0C0BF41777F9CD00838530 /* CCArmatureAnimation.cpp */, - 1A0C0BF51777F9CD00838530 /* CCArmatureAnimation.h */, - 1A0C0BF61777F9CD00838530 /* CCProcessBase.cpp */, - 1A0C0BF71777F9CD00838530 /* CCProcessBase.h */, - 1A0C0BF81777F9CD00838530 /* CCTween.cpp */, - 1A0C0BF91777F9CD00838530 /* CCTween.h */, - ); - path = animation; - sourceTree = "<group>"; - }; - 1A0C0BFE1777F9CD00838530 /* datas */ = { - isa = PBXGroup; - children = ( - 1A0C0BFF1777F9CD00838530 /* CCDatas.cpp */, - 1A0C0C001777F9CD00838530 /* CCDatas.h */, - ); - path = datas; - sourceTree = "<group>"; - }; - 1A0C0C011777F9CD00838530 /* display */ = { - isa = PBXGroup; - children = ( - 1A0C0C021777F9CD00838530 /* CCBatchNode.cpp */, - 1A0C0C031777F9CD00838530 /* CCBatchNode.h */, - 1A0C0C041777F9CD00838530 /* CCDecorativeDisplay.cpp */, - 1A0C0C051777F9CD00838530 /* CCDecorativeDisplay.h */, - 1A0C0C061777F9CD00838530 /* CCDisplayFactory.cpp */, - 1A0C0C071777F9CD00838530 /* CCDisplayFactory.h */, - 1A0C0C081777F9CD00838530 /* CCDisplayManager.cpp */, - 1A0C0C091777F9CD00838530 /* CCDisplayManager.h */, - 1A0C0C0A1777F9CD00838530 /* CCShaderNode.cpp */, - 1A0C0C0B1777F9CD00838530 /* CCShaderNode.h */, - 1A0C0C0C1777F9CD00838530 /* CCSkin.cpp */, - 1A0C0C0D1777F9CD00838530 /* CCSkin.h */, - ); - path = display; - sourceTree = "<group>"; - }; - 1A0C0C0E1777F9CD00838530 /* external_tool */ = { - isa = PBXGroup; - children = ( - 1A0C0C0F1777F9CD00838530 /* CCTexture2DMutable.cpp */, - 1A0C0C101777F9CD00838530 /* CCTexture2DMutable.h */, - 1A0C0C111777F9CD00838530 /* GLES-Render.cpp */, - 1A0C0C121777F9CD00838530 /* GLES-Render.h */, - 1A0C0C131777F9CD00838530 /* Json */, - 1A0C0C281777F9CD00838530 /* sigslot.h */, - ); - path = external_tool; - sourceTree = "<group>"; - }; - 1A0C0C131777F9CD00838530 /* Json */ = { - isa = PBXGroup; - children = ( - 1A0C0C141777F9CD00838530 /* CSContentJsonDictionary.cpp */, - 1A0C0C151777F9CD00838530 /* CSContentJsonDictionary.h */, - 1A0C0C161777F9CD00838530 /* lib_json */, - ); - path = Json; - sourceTree = "<group>"; - }; - 1A0C0C161777F9CD00838530 /* lib_json */ = { - isa = PBXGroup; - children = ( - 1A0C0C171777F9CD00838530 /* autolink.h */, - 1A0C0C181777F9CD00838530 /* config.h */, - 1A0C0C191777F9CD00838530 /* features.h */, - 1A0C0C1A1777F9CD00838530 /* forwards.h */, - 1A0C0C1B1777F9CD00838530 /* json_batchallocator.h */, - 1A0C0C1C1777F9CD00838530 /* json_internalarray.inl */, - 1A0C0C1D1777F9CD00838530 /* json_internalmap.inl */, - 1A0C0C1E1777F9CD00838530 /* json_lib.h */, - 1A0C0C1F1777F9CD00838530 /* json_reader.cpp */, - 1A0C0C201777F9CD00838530 /* json_tool.h */, - 1A0C0C211777F9CD00838530 /* json_value.cpp */, - 1A0C0C221777F9CD00838530 /* json_valueiterator.inl */, - 1A0C0C231777F9CD00838530 /* json_writer.cpp */, - 1A0C0C241777F9CD00838530 /* reader.h */, - 1A0C0C251777F9CD00838530 /* sconscript */, - 1A0C0C261777F9CD00838530 /* value.h */, - 1A0C0C271777F9CD00838530 /* writer.h */, - ); - path = lib_json; - sourceTree = "<group>"; - }; - 1A0C0C291777F9CD00838530 /* physics */ = { - isa = PBXGroup; - children = ( - 1A0C0C2A1777F9CD00838530 /* CCColliderDetector.cpp */, - 1A0C0C2B1777F9CD00838530 /* CCColliderDetector.h */, - 1A0C0C2C1777F9CD00838530 /* CCPhysicsWorld.cpp */, - 1A0C0C2D1777F9CD00838530 /* CCPhysicsWorld.h */, - ); - path = physics; - sourceTree = "<group>"; - }; - 1A0C0C2E1777F9CD00838530 /* utils */ = { - isa = PBXGroup; - children = ( - 1A0C0C2F1777F9CD00838530 /* CCArmatureDataManager.cpp */, - 1A0C0C301777F9CD00838530 /* CCArmatureDataManager.h */, - 1A0C0C311777F9CD00838530 /* CCArmatureDefine.h */, - 1A0C0C321777F9CD00838530 /* CCConstValue.h */, - 1A0C0C331777F9CD00838530 /* CCDataReaderHelper.cpp */, - 1A0C0C341777F9CD00838530 /* CCDataReaderHelper.h */, - 1A0C0C351777F9CD00838530 /* CCSpriteFrameCacheHelper.cpp */, - 1A0C0C361777F9CD00838530 /* CCSpriteFrameCacheHelper.h */, - 1A0C0C371777F9CD00838530 /* CCTransformHelp.cpp */, - 1A0C0C381777F9CD00838530 /* CCTransformHelp.h */, - 1A0C0C391777F9CD00838530 /* CCTweenFunction.cpp */, - 1A0C0C3A1777F9CD00838530 /* CCTweenFunction.h */, - 1A0C0C3B1777F9CD00838530 /* CCUtilMath.cpp */, - 1A0C0C3C1777F9CD00838530 /* CCUtilMath.h */, - ); - path = utils; - sourceTree = "<group>"; - }; - 1A0C0C3D1777F9CD00838530 /* CCBReader */ = { - isa = PBXGroup; - children = ( - 1A0C0C3E1777F9CD00838530 /* CCBAnimationManager.cpp */, - 1A0C0C3F1777F9CD00838530 /* CCBAnimationManager.h */, - 1A0C0C401777F9CD00838530 /* CCBFileLoader.cpp */, - 1A0C0C411777F9CD00838530 /* CCBFileLoader.h */, - 1A0C0C421777F9CD00838530 /* CCBKeyframe.cpp */, - 1A0C0C431777F9CD00838530 /* CCBKeyframe.h */, - 1A0C0C441777F9CD00838530 /* CCBMemberVariableAssigner.h */, - 1A0C0C451777F9CD00838530 /* CCBReader.cpp */, - 1A0C0C461777F9CD00838530 /* CCBReader.h */, - 1A0C0C471777F9CD00838530 /* CCBSelectorResolver.h */, - 1A0C0C481777F9CD00838530 /* CCBSequence.cpp */, - 1A0C0C491777F9CD00838530 /* CCBSequence.h */, - 1A0C0C4A1777F9CD00838530 /* CCBSequenceProperty.cpp */, - 1A0C0C4B1777F9CD00838530 /* CCBSequenceProperty.h */, - 1A0C0C4C1777F9CD00838530 /* CCBValue.cpp */, - 1A0C0C4D1777F9CD00838530 /* CCBValue.h */, - 1A0C0C4E1777F9CD00838530 /* CCControlButtonLoader.cpp */, - 1A0C0C4F1777F9CD00838530 /* CCControlButtonLoader.h */, - 1A0C0C501777F9CD00838530 /* CCControlLoader.cpp */, - 1A0C0C511777F9CD00838530 /* CCControlLoader.h */, - 1A0C0C521777F9CD00838530 /* CCLabelBMFontLoader.cpp */, - 1A0C0C531777F9CD00838530 /* CCLabelBMFontLoader.h */, - 1A0C0C541777F9CD00838530 /* CCLabelTTFLoader.cpp */, - 1A0C0C551777F9CD00838530 /* CCLabelTTFLoader.h */, - 1A0C0C561777F9CD00838530 /* CCLayerColorLoader.cpp */, - 1A0C0C571777F9CD00838530 /* CCLayerColorLoader.h */, - 1A0C0C581777F9CD00838530 /* CCLayerGradientLoader.cpp */, - 1A0C0C591777F9CD00838530 /* CCLayerGradientLoader.h */, - 1A0C0C5A1777F9CD00838530 /* CCLayerLoader.cpp */, - 1A0C0C5B1777F9CD00838530 /* CCLayerLoader.h */, - 1A0C0C5C1777F9CD00838530 /* CCMenuItemImageLoader.cpp */, - 1A0C0C5D1777F9CD00838530 /* CCMenuItemImageLoader.h */, - 1A0C0C5E1777F9CD00838530 /* CCMenuItemLoader.cpp */, - 1A0C0C5F1777F9CD00838530 /* CCMenuItemLoader.h */, - 1A0C0C601777F9CD00838530 /* CCMenuLoader.h */, - 1A0C0C611777F9CD00838530 /* CCNode+CCBRelativePositioning.cpp */, - 1A0C0C621777F9CD00838530 /* CCNode+CCBRelativePositioning.h */, - 1A0C0C631777F9CD00838530 /* CCNodeLoader.cpp */, - 1A0C0C641777F9CD00838530 /* CCNodeLoader.h */, - 1A0C0C651777F9CD00838530 /* CCNodeLoaderLibrary.cpp */, - 1A0C0C661777F9CD00838530 /* CCNodeLoaderLibrary.h */, - 1A0C0C671777F9CD00838530 /* CCNodeLoaderListener.h */, - 1A0C0C681777F9CD00838530 /* CCParticleSystemQuadLoader.cpp */, - 1A0C0C691777F9CD00838530 /* CCParticleSystemQuadLoader.h */, - 1A0C0C6A1777F9CD00838530 /* CCScale9SpriteLoader.cpp */, - 1A0C0C6B1777F9CD00838530 /* CCScale9SpriteLoader.h */, - 1A0C0C6C1777F9CD00838530 /* CCScrollViewLoader.cpp */, - 1A0C0C6D1777F9CD00838530 /* CCScrollViewLoader.h */, - 1A0C0C6E1777F9CD00838530 /* CCSpriteLoader.cpp */, - 1A0C0C6F1777F9CD00838530 /* CCSpriteLoader.h */, - ); - name = CCBReader; - path = ../CCBReader; - sourceTree = "<group>"; - }; - 1A0C0C711777F9CD00838530 /* Components */ = { - isa = PBXGroup; - children = ( - 1A0C0C721777F9CD00838530 /* CCComAttribute.cpp */, - 1A0C0C731777F9CD00838530 /* CCComAttribute.h */, - 1A0C0C741777F9CD00838530 /* CCComAudio.cpp */, - 1A0C0C751777F9CD00838530 /* CCComAudio.h */, - 1A0C0C761777F9CD00838530 /* CCComController.cpp */, - 1A0C0C771777F9CD00838530 /* CCComController.h */, - 1A0C0C781777F9CD00838530 /* CCInputDelegate.cpp */, - 1A0C0C791777F9CD00838530 /* CCInputDelegate.h */, - ); - name = Components; - path = ../Components; - sourceTree = "<group>"; - }; - 1A0C0C7B1777F9CD00838530 /* GUI */ = { - isa = PBXGroup; - children = ( - 1A0C0C7C1777F9CD00838530 /* CCControlExtension */, - 1A0C0C961777F9CD00838530 /* CCEditBox */, - 1A0C0CA51777F9CD00838530 /* CCScrollView */, - ); - name = GUI; - path = ../GUI; - sourceTree = "<group>"; - }; - 1A0C0C7C1777F9CD00838530 /* CCControlExtension */ = { - isa = PBXGroup; - children = ( - 1A0C0C7D1777F9CD00838530 /* CCControl.cpp */, - 1A0C0C7E1777F9CD00838530 /* CCControl.h */, - 1A0C0C7F1777F9CD00838530 /* CCControlButton.cpp */, - 1A0C0C801777F9CD00838530 /* CCControlButton.h */, - 1A0C0C811777F9CD00838530 /* CCControlColourPicker.cpp */, - 1A0C0C821777F9CD00838530 /* CCControlColourPicker.h */, - 1A0C0C831777F9CD00838530 /* CCControlExtensions.h */, - 1A0C0C841777F9CD00838530 /* CCControlHuePicker.cpp */, - 1A0C0C851777F9CD00838530 /* CCControlHuePicker.h */, - 1A0C0C861777F9CD00838530 /* CCControlPotentiometer.cpp */, - 1A0C0C871777F9CD00838530 /* CCControlPotentiometer.h */, - 1A0C0C881777F9CD00838530 /* CCControlSaturationBrightnessPicker.cpp */, - 1A0C0C891777F9CD00838530 /* CCControlSaturationBrightnessPicker.h */, - 1A0C0C8A1777F9CD00838530 /* CCControlSlider.cpp */, - 1A0C0C8B1777F9CD00838530 /* CCControlSlider.h */, - 1A0C0C8C1777F9CD00838530 /* CCControlStepper.cpp */, - 1A0C0C8D1777F9CD00838530 /* CCControlStepper.h */, - 1A0C0C8E1777F9CD00838530 /* CCControlSwitch.cpp */, - 1A0C0C8F1777F9CD00838530 /* CCControlSwitch.h */, - 1A0C0C901777F9CD00838530 /* CCControlUtils.cpp */, - 1A0C0C911777F9CD00838530 /* CCControlUtils.h */, - 1A0C0C921777F9CD00838530 /* CCInvocation.cpp */, - 1A0C0C931777F9CD00838530 /* CCInvocation.h */, - 1A0C0C941777F9CD00838530 /* CCScale9Sprite.cpp */, - 1A0C0C951777F9CD00838530 /* CCScale9Sprite.h */, - ); - path = CCControlExtension; - sourceTree = "<group>"; - }; - 1A0C0C961777F9CD00838530 /* CCEditBox */ = { - isa = PBXGroup; - children = ( - 1A0C0C971777F9CD00838530 /* CCEditBox.cpp */, - 1A0C0C981777F9CD00838530 /* CCEditBox.h */, - 1A0C0C991777F9CD00838530 /* CCEditBoxImpl.h */, - 1A0C0C9A1777F9CD00838530 /* CCEditBoxImplAndroid.cpp */, - 1A0C0C9B1777F9CD00838530 /* CCEditBoxImplAndroid.h */, - 1A0C0C9C1777F9CD00838530 /* CCEditBoxImplIOS.h */, - 1A0C0C9D1777F9CD00838530 /* CCEditBoxImplIOS.mm */, - 1A0C0C9E1777F9CD00838530 /* CCEditBoxImplMac.h */, - 1A0C0C9F1777F9CD00838530 /* CCEditBoxImplMac.mm */, - 1A0C0CA01777F9CD00838530 /* CCEditBoxImplNone.cpp */, - 1A0C0CA11777F9CD00838530 /* CCEditBoxImplTizen.cpp */, - 1A0C0CA21777F9CD00838530 /* CCEditBoxImplTizen.h */, - 1A0C0CA31777F9CD00838530 /* CCEditBoxImplWin.cpp */, - 1A0C0CA41777F9CD00838530 /* CCEditBoxImplWin.h */, - ); - path = CCEditBox; - sourceTree = "<group>"; - }; - 1A0C0CA51777F9CD00838530 /* CCScrollView */ = { - isa = PBXGroup; - children = ( - 1A0C0CA61777F9CD00838530 /* CCScrollView.cpp */, - 1A0C0CA71777F9CD00838530 /* CCScrollView.h */, - 1A0C0CA81777F9CD00838530 /* CCSorting.cpp */, - 1A0C0CA91777F9CD00838530 /* CCSorting.h */, - 1A0C0CAA1777F9CD00838530 /* CCTableView.cpp */, - 1A0C0CAB1777F9CD00838530 /* CCTableView.h */, - 1A0C0CAC1777F9CD00838530 /* CCTableViewCell.cpp */, - 1A0C0CAD1777F9CD00838530 /* CCTableViewCell.h */, - ); - path = CCScrollView; - sourceTree = "<group>"; - }; - 1A0C0CAE1777F9CD00838530 /* LocalStorage */ = { - isa = PBXGroup; - children = ( - 1A0C0CAF1777F9CD00838530 /* LocalStorage.cpp */, - 1A0C0CB01777F9CD00838530 /* LocalStorage.h */, - 1A0C0CB11777F9CD00838530 /* LocalStorageAndroid.cpp */, - ); - name = LocalStorage; - path = ../LocalStorage; - sourceTree = "<group>"; - }; - 1A0C0CB21777F9CD00838530 /* network */ = { - isa = PBXGroup; - children = ( - 1A0C0CB31777F9CD00838530 /* HttpClient.cpp */, - 1A0C0CB41777F9CD00838530 /* HttpClient.h */, - 1A0C0CB51777F9CD00838530 /* HttpRequest.h */, - 1A0C0CB61777F9CD00838530 /* HttpResponse.h */, - 1A0C0CB71777F9CD00838530 /* WebSocket.cpp */, - 1A0C0CB81777F9CD00838530 /* WebSocket.h */, - ); - name = network; - path = ../network; - sourceTree = "<group>"; - }; - 1A0C0CB91777F9CD00838530 /* physics_nodes */ = { - isa = PBXGroup; - children = ( - 1A0C0CBA1777F9CD00838530 /* CCPhysicsDebugNode.cpp */, - 1A0C0CBB1777F9CD00838530 /* CCPhysicsDebugNode.h */, - 1A0C0CBC1777F9CD00838530 /* CCPhysicsSprite.cpp */, - 1A0C0CBD1777F9CD00838530 /* CCPhysicsSprite.h */, - ); - name = physics_nodes; - path = ../physics_nodes; - sourceTree = "<group>"; - }; - 1A0C0CBE1777F9CD00838530 /* spine */ = { - isa = PBXGroup; - children = ( - 1A0C0CBF1777F9CD00838530 /* Animation.cpp */, - 1A0C0CC01777F9CD00838530 /* Animation.h */, - 1A0C0CC11777F9CD00838530 /* AnimationState.cpp */, - 1A0C0CC21777F9CD00838530 /* AnimationState.h */, - 1A0C0CC31777F9CD00838530 /* AnimationStateData.cpp */, - 1A0C0CC41777F9CD00838530 /* AnimationStateData.h */, - 1A0C0CC51777F9CD00838530 /* Atlas.cpp */, - 1A0C0CC61777F9CD00838530 /* Atlas.h */, - 1A0C0CC71777F9CD00838530 /* AtlasAttachmentLoader.cpp */, - 1A0C0CC81777F9CD00838530 /* AtlasAttachmentLoader.h */, - 1A0C0CC91777F9CD00838530 /* Attachment.cpp */, - 1A0C0CCA1777F9CD00838530 /* Attachment.h */, - 1A0C0CCB1777F9CD00838530 /* AttachmentLoader.cpp */, - 1A0C0CCC1777F9CD00838530 /* AttachmentLoader.h */, - 1A0C0CCD1777F9CD00838530 /* Bone.cpp */, - 1A0C0CCE1777F9CD00838530 /* Bone.h */, - 1A0C0CCF1777F9CD00838530 /* BoneData.cpp */, - 1A0C0CD01777F9CD00838530 /* BoneData.h */, - 1A0C0CD11777F9CD00838530 /* CCSkeleton.cpp */, - 1A0C0CD21777F9CD00838530 /* CCSkeleton.h */, - 1A0C0CD31777F9CD00838530 /* CCSkeletonAnimation.cpp */, - 1A0C0CD41777F9CD00838530 /* CCSkeletonAnimation.h */, - 1A0C0CD51777F9CD00838530 /* extension.cpp */, - 1A0C0CD61777F9CD00838530 /* extension.h */, - 1A0C0CD71777F9CD00838530 /* Json.cpp */, - 1A0C0CD81777F9CD00838530 /* Json.h */, - 1A0C0CD91777F9CD00838530 /* RegionAttachment.cpp */, - 1A0C0CDA1777F9CD00838530 /* RegionAttachment.h */, - 1A0C0CDB1777F9CD00838530 /* Skeleton.cpp */, - 1A0C0CDC1777F9CD00838530 /* Skeleton.h */, - 1A0C0CDD1777F9CD00838530 /* SkeletonData.cpp */, - 1A0C0CDE1777F9CD00838530 /* SkeletonData.h */, - 1A0C0CDF1777F9CD00838530 /* SkeletonJson.cpp */, - 1A0C0CE01777F9CD00838530 /* SkeletonJson.h */, - 1A0C0CE11777F9CD00838530 /* Skin.cpp */, - 1A0C0CE21777F9CD00838530 /* Skin.h */, - 1A0C0CE31777F9CD00838530 /* Slot.cpp */, - 1A0C0CE41777F9CD00838530 /* Slot.h */, - 1A0C0CE51777F9CD00838530 /* SlotData.cpp */, - 1A0C0CE61777F9CD00838530 /* SlotData.h */, - 1A0C0CE71777F9CD00838530 /* spine-cocos2dx.cpp */, - 1A0C0CE81777F9CD00838530 /* spine-cocos2dx.h */, - 1A0C0CE91777F9CD00838530 /* spine.h */, - ); - name = spine; - path = ../spine; - sourceTree = "<group>"; - }; - A05FCAE3177C1A1400BE600E /* libwebsockets */ = { - isa = PBXGroup; - children = ( - A05FCAE4177C1A1400BE600E /* include */, - A05FCAE6177C1A1400BE600E /* lib */, - ); - name = libwebsockets; - path = ../../external/libwebsockets/mac; - sourceTree = "<group>"; - }; - A05FCAE4177C1A1400BE600E /* include */ = { - isa = PBXGroup; - children = ( - A05FCAE5177C1A1400BE600E /* libwebsockets.h */, - ); - path = include; - sourceTree = "<group>"; - }; - A05FCAE6177C1A1400BE600E /* lib */ = { - isa = PBXGroup; - children = ( - A05FCAE7177C1A1400BE600E /* libwebsockets.a */, - ); - path = lib; - sourceTree = "<group>"; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 1A0C0A791777F79700838530 /* extensions */ = { - isa = PBXNativeTarget; - buildConfigurationList = 1A0C0A881777F79700838530 /* Build configuration list for PBXNativeTarget "extensions" */; - buildPhases = ( - 1A0C0A761777F79700838530 /* Sources */, - 1A0C0A771777F79700838530 /* Frameworks */, - 1A0C0A781777F79700838530 /* CopyFiles */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = extensions; - productName = extensions; - productReference = 1A0C0A7A1777F79700838530 /* libextensions.a */; - productType = "com.apple.product-type.library.static"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 1A0C0A721777F79700838530 /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0460; - }; - buildConfigurationList = 1A0C0A751777F79700838530 /* Build configuration list for PBXProject "extensions" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - ); - mainGroup = 1A0C0A711777F79700838530; - productRefGroup = 1A0C0A7B1777F79700838530 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 1A0C0A791777F79700838530 /* extensions */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXSourcesBuildPhase section */ - 1A0C0A761777F79700838530 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 1A0C0CEA1777F9CD00838530 /* AssetsManager.cpp in Sources */, - 1A0C0CEB1777F9CD00838530 /* CCArmatureAnimation.cpp in Sources */, - 1A0C0CEC1777F9CD00838530 /* CCProcessBase.cpp in Sources */, - 1A0C0CED1777F9CD00838530 /* CCTween.cpp in Sources */, - 1A0C0CEE1777F9CD00838530 /* CCArmature.cpp in Sources */, - 1A0C0CEF1777F9CD00838530 /* CCBone.cpp in Sources */, - 1A0C0CF01777F9CD00838530 /* CCDatas.cpp in Sources */, - 1A0C0CF11777F9CD00838530 /* CCBatchNode.cpp in Sources */, - 1A0C0CF21777F9CD00838530 /* CCDecorativeDisplay.cpp in Sources */, - 1A0C0CF31777F9CD00838530 /* CCDisplayFactory.cpp in Sources */, - 1A0C0CF41777F9CD00838530 /* CCDisplayManager.cpp in Sources */, - 1A0C0CF51777F9CD00838530 /* CCShaderNode.cpp in Sources */, - 1A0C0CF61777F9CD00838530 /* CCSkin.cpp in Sources */, - 1A0C0CF71777F9CD00838530 /* CCTexture2DMutable.cpp in Sources */, - 1A0C0CF81777F9CD00838530 /* GLES-Render.cpp in Sources */, - 1A0C0CF91777F9CD00838530 /* CSContentJsonDictionary.cpp in Sources */, - 1A0C0CFA1777F9CD00838530 /* json_reader.cpp in Sources */, - 1A0C0CFB1777F9CD00838530 /* json_value.cpp in Sources */, - 1A0C0CFC1777F9CD00838530 /* json_writer.cpp in Sources */, - 1A0C0CFD1777F9CD00838530 /* CCColliderDetector.cpp in Sources */, - 1A0C0CFE1777F9CD00838530 /* CCPhysicsWorld.cpp in Sources */, - 1A0C0CFF1777F9CD00838530 /* CCArmatureDataManager.cpp in Sources */, - 1A0C0D001777F9CD00838530 /* CCDataReaderHelper.cpp in Sources */, - 1A0C0D011777F9CD00838530 /* CCSpriteFrameCacheHelper.cpp in Sources */, - 1A0C0D021777F9CD00838530 /* CCTransformHelp.cpp in Sources */, - 1A0C0D031777F9CD00838530 /* CCTweenFunction.cpp in Sources */, - 1A0C0D041777F9CD00838530 /* CCUtilMath.cpp in Sources */, - 1A0C0D051777F9CD00838530 /* CCBAnimationManager.cpp in Sources */, - 1A0C0D061777F9CD00838530 /* CCBFileLoader.cpp in Sources */, - 1A0C0D071777F9CD00838530 /* CCBKeyframe.cpp in Sources */, - 1A0C0D081777F9CD00838530 /* CCBReader.cpp in Sources */, - 1A0C0D091777F9CD00838530 /* CCBSequence.cpp in Sources */, - 1A0C0D0A1777F9CD00838530 /* CCBSequenceProperty.cpp in Sources */, - 1A0C0D0B1777F9CD00838530 /* CCBValue.cpp in Sources */, - 1A0C0D0C1777F9CD00838530 /* CCControlButtonLoader.cpp in Sources */, - 1A0C0D0D1777F9CD00838530 /* CCControlLoader.cpp in Sources */, - 1A0C0D0E1777F9CD00838530 /* CCLabelBMFontLoader.cpp in Sources */, - 1A0C0D0F1777F9CD00838530 /* CCLabelTTFLoader.cpp in Sources */, - 1A0C0D101777F9CD00838530 /* CCLayerColorLoader.cpp in Sources */, - 1A0C0D111777F9CD00838530 /* CCLayerGradientLoader.cpp in Sources */, - 1A0C0D121777F9CD00838530 /* CCLayerLoader.cpp in Sources */, - 1A0C0D131777F9CD00838530 /* CCMenuItemImageLoader.cpp in Sources */, - 1A0C0D141777F9CD00838530 /* CCMenuItemLoader.cpp in Sources */, - 1A0C0D151777F9CD00838530 /* CCNode+CCBRelativePositioning.cpp in Sources */, - 1A0C0D161777F9CD00838530 /* CCNodeLoader.cpp in Sources */, - 1A0C0D171777F9CD00838530 /* CCNodeLoaderLibrary.cpp in Sources */, - 1A0C0D181777F9CD00838530 /* CCParticleSystemQuadLoader.cpp in Sources */, - 1A0C0D191777F9CD00838530 /* CCScale9SpriteLoader.cpp in Sources */, - 1A0C0D1A1777F9CD00838530 /* CCScrollViewLoader.cpp in Sources */, - 1A0C0D1B1777F9CD00838530 /* CCSpriteLoader.cpp in Sources */, - 1A0C0D1C1777F9CD00838530 /* CCComAttribute.cpp in Sources */, - 1A0C0D1D1777F9CD00838530 /* CCComAudio.cpp in Sources */, - 1A0C0D1E1777F9CD00838530 /* CCComController.cpp in Sources */, - 1A0C0D1F1777F9CD00838530 /* CCInputDelegate.cpp in Sources */, - 1A0C0D201777F9CD00838530 /* CCControl.cpp in Sources */, - 1A0C0D211777F9CD00838530 /* CCControlButton.cpp in Sources */, - 1A0C0D221777F9CD00838530 /* CCControlColourPicker.cpp in Sources */, - 1A0C0D231777F9CD00838530 /* CCControlHuePicker.cpp in Sources */, - 1A0C0D241777F9CD00838530 /* CCControlPotentiometer.cpp in Sources */, - 1A0C0D251777F9CD00838530 /* CCControlSaturationBrightnessPicker.cpp in Sources */, - 1A0C0D261777F9CD00838530 /* CCControlSlider.cpp in Sources */, - 1A0C0D271777F9CD00838530 /* CCControlStepper.cpp in Sources */, - 1A0C0D281777F9CD00838530 /* CCControlSwitch.cpp in Sources */, - 1A0C0D291777F9CD00838530 /* CCControlUtils.cpp in Sources */, - 1A0C0D2A1777F9CD00838530 /* CCInvocation.cpp in Sources */, - 1A0C0D2B1777F9CD00838530 /* CCScale9Sprite.cpp in Sources */, - 1A0C0D2C1777F9CD00838530 /* CCEditBox.cpp in Sources */, - 1A0C0D2D1777F9CD00838530 /* CCEditBoxImplAndroid.cpp in Sources */, - 1A0C0D2E1777F9CD00838530 /* CCEditBoxImplIOS.mm in Sources */, - 1A0C0D2F1777F9CD00838530 /* CCEditBoxImplMac.mm in Sources */, - 1A0C0D301777F9CD00838530 /* CCEditBoxImplNone.cpp in Sources */, - 1A0C0D311777F9CD00838530 /* CCEditBoxImplTizen.cpp in Sources */, - 1A0C0D321777F9CD00838530 /* CCEditBoxImplWin.cpp in Sources */, - 1A0C0D331777F9CD00838530 /* CCScrollView.cpp in Sources */, - 1A0C0D341777F9CD00838530 /* CCSorting.cpp in Sources */, - 1A0C0D351777F9CD00838530 /* CCTableView.cpp in Sources */, - 1A0C0D361777F9CD00838530 /* CCTableViewCell.cpp in Sources */, - 1A0C0D371777F9CD00838530 /* LocalStorage.cpp in Sources */, - 1A0C0D381777F9CD00838530 /* LocalStorageAndroid.cpp in Sources */, - 1A0C0D391777F9CD00838530 /* HttpClient.cpp in Sources */, - 1A0C0D3A1777F9CD00838530 /* WebSocket.cpp in Sources */, - 1A0C0D3B1777F9CD00838530 /* CCPhysicsDebugNode.cpp in Sources */, - 1A0C0D3C1777F9CD00838530 /* CCPhysicsSprite.cpp in Sources */, - 1A0C0D3D1777F9CD00838530 /* Animation.cpp in Sources */, - 1A0C0D3E1777F9CD00838530 /* AnimationState.cpp in Sources */, - 1A0C0D3F1777F9CD00838530 /* AnimationStateData.cpp in Sources */, - 1A0C0D401777F9CD00838530 /* Atlas.cpp in Sources */, - 1A0C0D411777F9CD00838530 /* AtlasAttachmentLoader.cpp in Sources */, - 1A0C0D421777F9CD00838530 /* Attachment.cpp in Sources */, - 1A0C0D431777F9CD00838530 /* AttachmentLoader.cpp in Sources */, - 1A0C0D441777F9CD00838530 /* Bone.cpp in Sources */, - 1A0C0D451777F9CD00838530 /* BoneData.cpp in Sources */, - 1A0C0D461777F9CD00838530 /* CCSkeleton.cpp in Sources */, - 1A0C0D471777F9CD00838530 /* CCSkeletonAnimation.cpp in Sources */, - 1A0C0D481777F9CD00838530 /* extension.cpp in Sources */, - 1A0C0D491777F9CD00838530 /* Json.cpp in Sources */, - 1A0C0D4A1777F9CD00838530 /* RegionAttachment.cpp in Sources */, - 1A0C0D4B1777F9CD00838530 /* Skeleton.cpp in Sources */, - 1A0C0D4C1777F9CD00838530 /* SkeletonData.cpp in Sources */, - 1A0C0D4D1777F9CD00838530 /* SkeletonJson.cpp in Sources */, - 1A0C0D4E1777F9CD00838530 /* Skin.cpp in Sources */, - 1A0C0D4F1777F9CD00838530 /* Slot.cpp in Sources */, - 1A0C0D501777F9CD00838530 /* SlotData.cpp in Sources */, - 1A0C0D511777F9CD00838530 /* spine-cocos2dx.cpp in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 1A0C0A861777F79700838530 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; - CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - CC_KEYBOARD_SUPPORT, - CC_TARGET_OS_MAC, - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = macosx; - }; - name = Debug; - }; - 1A0C0A871777F79700838530 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; - CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = YES; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_PREPROCESSOR_DEFINITIONS = ( - NDEBUG, - CC_TARGET_OS_MAC, - CC_KEYBOARD_SUPPORT, - ); - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - SDKROOT = macosx; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 1A0C0A891777F79700838530 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - DSTROOT = /tmp/extensions.dst; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "extensions-Prefix.pch"; - GCC_PREPROCESSOR_DEFINITIONS = ( - "$(inherited)", - "COCOS2D_DEBUG=1", - "CC_ENABLE_CHIPMUNK_INTEGRATION=1", - ); - HEADER_SEARCH_PATHS = ( - "\"$(SRCROOT)/../../cocos2dx\"", - "\"$(SRCROOT)/../../cocos2dx/include\"", - "\"$(SRCROOT)/../../cocos2dx/platform/third_party/mac\"", - "\"$(SRCROOT)/../../cocos2dx/platform/mac\"", - "\"$(SRCROOT)/../../cocos2dx/kazmath/include\"", - "\"$(SRCROOT)/../../CocosDenshion/include\"", - "\"$(SRCROOT)/../../external/chipmunk/include/chipmunk\"", - "\"$(SRCROOT)/../../external\"", - "\"$(SRCROOT)/../../extensions\"", - ); - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "\"$(SRCROOT)/../../external/libwebsockets/mac/lib\"", - "\"$(SRCROOT)/../../cocos2dx/platform/third_party/mac/libraries\"", - ); - ONLY_ACTIVE_ARCH = YES; - OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SKIP_INSTALL = YES; - }; - name = Debug; - }; - 1A0C0A8A1777F79700838530 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - DSTROOT = /tmp/extensions.dst; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "extensions-Prefix.pch"; - GCC_PREPROCESSOR_DEFINITIONS = ( - "$(inherited)", - "CC_ENABLE_CHIPMUNK_INTEGRATION=1", - ); - HEADER_SEARCH_PATHS = ( - "\"$(SRCROOT)/../../cocos2dx\"", - "\"$(SRCROOT)/../../cocos2dx/include\"", - "\"$(SRCROOT)/../../cocos2dx/platform/third_party/mac\"", - "\"$(SRCROOT)/../../cocos2dx/platform/mac\"", - "\"$(SRCROOT)/../../cocos2dx/kazmath/include\"", - "\"$(SRCROOT)/../../CocosDenshion/include\"", - "\"$(SRCROOT)/../../external/chipmunk/include/chipmunk\"", - "\"$(SRCROOT)/../../external\"", - "\"$(SRCROOT)/../../extensions\"", - ); - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "\"$(SRCROOT)/../../external/libwebsockets/mac/lib\"", - "\"$(SRCROOT)/../../cocos2dx/platform/third_party/mac/libraries\"", - ); - ONLY_ACTIVE_ARCH = YES; - OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SKIP_INSTALL = YES; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 1A0C0A751777F79700838530 /* Build configuration list for PBXProject "extensions" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1A0C0A861777F79700838530 /* Debug */, - 1A0C0A871777F79700838530 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 1A0C0A881777F79700838530 /* Build configuration list for PBXNativeTarget "extensions" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1A0C0A891777F79700838530 /* Debug */, - 1A0C0A8A1777F79700838530 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 1A0C0A721777F79700838530 /* Project object */; -} diff --git a/extensions/proj.nacl/Makefile b/extensions/proj.nacl/Makefile deleted file mode 100644 index 2b713969f3..0000000000 --- a/extensions/proj.nacl/Makefile +++ /dev/null @@ -1,130 +0,0 @@ -EXTENSIONS_SOURCES = ../CCBReader/CCBFileLoader.cpp \ -../CCBReader/CCMenuItemImageLoader.cpp \ -../CCBReader/CCBReader.cpp \ -../CCBReader/CCMenuItemLoader.cpp \ -../CCBReader/CCControlButtonLoader.cpp \ -../CCBReader/CCNodeLoader.cpp \ -../CCBReader/CCControlLoader.cpp \ -../CCBReader/CCNodeLoaderLibrary.cpp \ -../CCBReader/CCLabelBMFontLoader.cpp \ -../CCBReader/CCParticleSystemQuadLoader.cpp \ -../CCBReader/CCLabelTTFLoader.cpp \ -../CCBReader/CCScale9SpriteLoader.cpp \ -../CCBReader/CCLayerColorLoader.cpp \ -../CCBReader/CCScrollViewLoader.cpp \ -../CCBReader/CCLayerGradientLoader.cpp \ -../CCBReader/CCSpriteLoader.cpp \ -../CCBReader/CCLayerLoader.cpp \ -../CCBReader/CCBAnimationManager.cpp \ -../CCBReader/CCBKeyframe.cpp \ -../CCBReader/CCBSequence.cpp \ -../CCBReader/CCBSequenceProperty.cpp \ -../CCBReader/CCBValue.cpp \ -../CCBReader/CCNode+CCBRelativePositioning.cpp \ -../GUI/CCScrollView/CCScrollView.cpp \ -../GUI/CCScrollView/CCSorting.cpp \ -../GUI/CCScrollView/CCTableView.cpp \ -../GUI/CCScrollView/CCTableViewCell.cpp \ -../GUI/CCControlExtension/CCControlButton.cpp \ -../GUI/CCControlExtension/CCControlColourPicker.cpp \ -../GUI/CCControlExtension/CCControl.cpp \ -../GUI/CCControlExtension/CCControlHuePicker.cpp \ -../GUI/CCControlExtension/CCControlSaturationBrightnessPicker.cpp \ -../GUI/CCControlExtension/CCControlSlider.cpp \ -../GUI/CCControlExtension/CCControlSwitch.cpp \ -../GUI/CCControlExtension/CCControlUtils.cpp \ -../GUI/CCControlExtension/CCInvocation.cpp \ -../GUI/CCControlExtension/CCScale9Sprite.cpp \ -../GUI/CCControlExtension/CCControlPotentiometer.cpp \ -../GUI/CCControlExtension/CCControlStepper.cpp \ -../GUI/CCEditBox/CCEditBox.cpp \ -../GUI/CCEditBox/CCEditBoxImplNone.cpp \ -../physics_nodes/CCPhysicsDebugNode.cpp \ -../physics_nodes/CCPhysicsSprite.cpp \ -../CocoStudio/Armature/CCArmature.cpp \ -../CocoStudio/Armature/CCBone.cpp \ -../CocoStudio/Armature/animation/CCArmatureAnimation.cpp \ -../CocoStudio/Armature/animation/CCProcessBase.cpp \ -../CocoStudio/Armature/animation/CCTween.cpp \ -../CocoStudio/Armature/datas/CCDatas.cpp \ -../CocoStudio/Armature/display/CCBatchNode.cpp \ -../CocoStudio/Armature/display/CCDecorativeDisplay.cpp \ -../CocoStudio/Armature/display/CCDisplayFactory.cpp \ -../CocoStudio/Armature/display/CCDisplayManager.cpp \ -../CocoStudio/Armature/display/CCShaderNode.cpp \ -../CocoStudio/Armature/display/CCSkin.cpp \ -../CocoStudio/Armature/external_tool/CCTexture2DMutable.cpp \ -../CocoStudio/Armature/external_tool/GLES-Render.cpp \ -../CocoStudio/Armature/physics/CCColliderDetector.cpp \ -../CocoStudio/Armature/physics/CCPhysicsWorld.cpp \ -../CocoStudio/Armature/utils/CCArmatureDataManager.cpp \ -../CocoStudio/Armature/utils/CCDataReaderHelper.cpp \ -../CocoStudio/Armature/utils/CCSpriteFrameCacheHelper.cpp \ -../CocoStudio/Armature/utils/CCTransformHelp.cpp \ -../CocoStudio/Armature/utils/CCTweenFunction.cpp \ -../CocoStudio/Armature/utils/CCUtilMath.cpp \ -../CocoStudio/Components/CCComAttribute.cpp \ -../CocoStudio/Components/CCComAudio.cpp \ -../CocoStudio/Components/CCComController.cpp \ -../CocoStudio/Components/CCComRender.cpp \ -../CocoStudio/Components/CCInputDelegate.cpp \ -../CocoStudio/GUI/BaseClasses/UIRootWidget.cpp \ -../CocoStudio/GUI/BaseClasses/UIWidget.cpp \ -../CocoStudio/GUI/Layouts/Layout.cpp \ -../CocoStudio/GUI/Layouts/LayoutParameter.cpp \ -../CocoStudio/GUI/Layouts/UILayoutDefine.cpp \ -../CocoStudio/GUI/System/CocosGUI.cpp \ -../CocoStudio/GUI/System/UIHelper.cpp \ -../CocoStudio/GUI/System/UIInputManager.cpp \ -../CocoStudio/GUI/System/UILayer.cpp \ -../CocoStudio/GUI/UIWidgets/UIButton.cpp \ -../CocoStudio/GUI/UIWidgets/UICheckBox.cpp \ -../CocoStudio/GUI/UIWidgets/UIImageView.cpp \ -../CocoStudio/GUI/UIWidgets/UILabel.cpp \ -../CocoStudio/GUI/UIWidgets/UILabelAtlas.cpp \ -../CocoStudio/GUI/UIWidgets/UILabelBMFont.cpp \ -../CocoStudio/GUI/UIWidgets/UILoadingBar.cpp \ -../CocoStudio/GUI/UIWidgets/UISlider.cpp \ -../CocoStudio/GUI/UIWidgets/UITextField.cpp \ -../CocoStudio/GUI/UIWidgets/ScrollWidget/UIDragPanel.cpp \ -../CocoStudio/GUI/UIWidgets/ScrollWidget/UIListView.cpp \ -../CocoStudio/GUI/UIWidgets/ScrollWidget/UIPageView.cpp \ -../CocoStudio/GUI/UIWidgets/ScrollWidget/UIScrollView.cpp \ -../CocoStudio/Json/CSContentJsonDictionary.cpp \ -../CocoStudio/Json/DictionaryHelper.cpp \ -../CocoStudio/Json/lib_json/json_value.cpp \ -../CocoStudio/Json/lib_json/json_reader.cpp \ -../CocoStudio/Json/lib_json/json_writer.cpp \ -../CocoStudio/Reader/CCSSceneReader.cpp \ -../CocoStudio/Reader/CCSGUIReader.cpp \ -../CocoStudio/Action/CCActionFrame.cpp \ -../CocoStudio/Action/CCActionFrameEasing.cpp \ -../CocoStudio/Action/CCActionManagerEx.cpp \ -../CocoStudio/Action/CCActionNode.cpp \ -../CocoStudio/Action/CCActionObject.cpp \ -../spine/Animation.cpp \ -../spine/AnimationState.cpp \ -../spine/AnimationStateData.cpp \ -../spine/Atlas.cpp \ -../spine/AtlasAttachmentLoader.cpp \ -../spine/Attachment.cpp \ -../spine/AttachmentLoader.cpp \ -../spine/Bone.cpp \ -../spine/BoneData.cpp \ -../spine/Json.cpp \ -../spine/RegionAttachment.cpp \ -../spine/Skeleton.cpp \ -../spine/SkeletonData.cpp \ -../spine/SkeletonJson.cpp \ -../spine/Skin.cpp \ -../spine/Slot.cpp \ -../spine/SlotData.cpp \ -../spine/extension.cpp \ -../spine/spine-cocos2dx.cpp \ -../spine/CCSkeleton.cpp \ -../spine/CCSkeletonAnimation.cpp \ -../CCDprecated-ext.cpp - -all: - -clean: diff --git a/extensions/proj.qt5/extensions.pro b/extensions/proj.qt5/extensions.pro deleted file mode 100644 index 48ace018e9..0000000000 --- a/extensions/proj.qt5/extensions.pro +++ /dev/null @@ -1,116 +0,0 @@ - -include(../../cocos2dx/proj.qt5/common.pri) - -TEMPLATE = lib -CONFIG += static - -#SOURCES += $$files(../qt5/*.cpp) - -SOURCES += ../CCBReader/CCBFileLoader.cpp \ -../CCBReader/CCMenuItemImageLoader.cpp \ -../CCBReader/CCBReader.cpp \ -../CCBReader/CCMenuItemLoader.cpp \ -../CCBReader/CCControlButtonLoader.cpp \ -../CCBReader/CCNodeLoader.cpp \ -../CCBReader/CCControlLoader.cpp \ -../CCBReader/CCNodeLoaderLibrary.cpp \ -../CCBReader/CCLabelBMFontLoader.cpp \ -../CCBReader/CCParticleSystemQuadLoader.cpp \ -../CCBReader/CCLabelTTFLoader.cpp \ -../CCBReader/CCScale9SpriteLoader.cpp \ -../CCBReader/CCLayerColorLoader.cpp \ -../CCBReader/CCScrollViewLoader.cpp \ -../CCBReader/CCLayerGradientLoader.cpp \ -../CCBReader/CCSpriteLoader.cpp \ -../CCBReader/CCLayerLoader.cpp \ -../CCBReader/CCBAnimationManager.cpp \ -../CCBReader/CCBKeyframe.cpp \ -../CCBReader/CCBSequence.cpp \ -../CCBReader/CCBSequenceProperty.cpp \ -../CCBReader/CCBValue.cpp \ -../CCBReader/CCNode+CCBRelativePositioning.cpp \ -../GUI/CCScrollView/CCScrollView.cpp \ -../GUI/CCScrollView/CCSorting.cpp \ -../GUI/CCScrollView/CCTableView.cpp \ -../GUI/CCScrollView/CCTableViewCell.cpp \ -../GUI/CCControlExtension/CCControlButton.cpp \ -../GUI/CCControlExtension/CCControlColourPicker.cpp \ -../GUI/CCControlExtension/CCControl.cpp \ -../GUI/CCControlExtension/CCControlHuePicker.cpp \ -../GUI/CCControlExtension/CCControlSaturationBrightnessPicker.cpp \ -../GUI/CCControlExtension/CCControlSlider.cpp \ -../GUI/CCControlExtension/CCControlSwitch.cpp \ -../GUI/CCControlExtension/CCControlUtils.cpp \ -../GUI/CCControlExtension/CCInvocation.cpp \ -../GUI/CCControlExtension/CCScale9Sprite.cpp \ -../GUI/CCControlExtension/CCControlPotentiometer.cpp \ -../GUI/CCControlExtension/CCControlStepper.cpp \ -../GUI/CCEditBox/CCEditBox.cpp \ -../GUI/CCEditBox/CCEditBoxImplNone.cpp \ -../network/HttpClient.cpp \ -../physics_nodes/CCPhysicsDebugNode.cpp \ -../physics_nodes/CCPhysicsSprite.cpp \ -../spine/Animation.cpp \ -../spine/AnimationState.cpp \ -../spine/AnimationStateData.cpp \ -../spine/Atlas.cpp \ -../spine/AtlasAttachmentLoader.cpp \ -../spine/Attachment.cpp \ -../spine/AttachmentLoader.cpp \ -../spine/Bone.cpp \ -../spine/BoneData.cpp \ -../spine/Json.cpp \ -../spine/RegionAttachment.cpp \ -../spine/Skeleton.cpp \ -../spine/SkeletonData.cpp \ -../spine/SkeletonJson.cpp \ -../spine/Skin.cpp \ -../spine/Slot.cpp \ -../spine/SlotData.cpp \ -../spine/extension.cpp \ -../spine/spine-cocos2dx.cpp \ -../spine/CCSkeleton.cpp \ -../spine/CCSkeletonAnimation.cpp \ -../Components/CCComAttribute.cpp \ -../Components/CCComAudio.cpp \ -../Components/CCComController.cpp \ -../Components/CCInputDelegate.cpp \ -../CCArmature/CCArmature.cpp \ -../CCArmature/CCBone.cpp \ -../CCArmature/animation/CCArmatureAnimation.cpp \ -../CCArmature/animation/CCProcessBase.cpp \ -../CCArmature/animation/CCTween.cpp \ -../CCArmature/datas/CCDatas.cpp \ -../CCArmature/display/CCBatchNode.cpp \ -../CCArmature/display/CCDecorativeDisplay.cpp \ -../CCArmature/display/CCDisplayFactory.cpp \ -../CCArmature/display/CCDisplayManager.cpp \ -../CCArmature/display/CCShaderNode.cpp \ -../CCArmature/display/CCSkin.cpp \ -../CCArmature/external_tool/GLES-Render.cpp \ -../CCArmature/external_tool/Json/CSContentJsonDictionary.cpp \ -../CCArmature/external_tool/Json/lib_json/json_value.cpp \ -../CCArmature/external_tool/Json/lib_json/json_reader.cpp \ -../CCArmature/external_tool/Json/lib_json/json_writer.cpp \ -../CCArmature/physics/CCColliderDetector.cpp \ -../CCArmature/physics/CCPhysicsWorld.cpp \ -../CCArmature/utils/CCArmatureDataManager.cpp \ -../CCArmature/utils/CCDataReaderHelper.cpp \ -../CCArmature/utils/CCSpriteFrameCacheHelper.cpp \ -../CCArmature/utils/CCTransformHelp.cpp \ -../CCArmature/utils/CCTweenFunction.cpp \ -../CCArmature/utils/CCUtilMath.cpp - -INCLUDEPATH += .. -INCLUDEPATH += ../include -INCLUDEPATH += ../CCBReader -INCLUDEPATH += ../GUI/CCControlExtension -INCLUDEPATH += ../GUI/CCEditBox -INCLUDEPATH += ../network -INCLUDEPATH += ../Components -INCLUDEPATH += ../CCArmature - -#INCLUDES = -I$(COCOS_ROOT)/external \ - -TARGET = $${LIB_OUTPUT_DIR}/extension - diff --git a/extensions/proj.tizen/.cproject b/extensions/proj.tizen/.cproject deleted file mode 100644 index ae43f74b63..0000000000 --- a/extensions/proj.tizen/.cproject +++ /dev/null @@ -1,385 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage"> - <storageModule moduleId="org.eclipse.cdt.core.settings"> - <cconfiguration id="org.tizen.nativecpp.config.sbi.gcc45.lib.debug.emulator.1855378280"> - <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="org.tizen.nativecpp.config.sbi.gcc45.lib.debug.emulator.1855378280" moduleId="org.eclipse.cdt.core.settings" name="Debug-Tizen-Emulator"> - <macros> - <stringMacro name="COCOS_ROOT" type="VALUE_PATH_ANY" value="../../.."/> - <stringMacro name="COCOS_SRC" type="VALUE_PATH_ANY" value="${COCOS_ROOT}/cocos2dx"/> - </macros> - <externalSettings/> - <extensions> - <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/> - <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - </extensions> - </storageModule> - <storageModule moduleId="cdtBuildSystem" version="4.0.0"> - <configuration artifactExtension="a" artifactName="extensions" buildArtefactType="org.tizen.nativecpp.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.tizen.nativecpp.buildArtefactType.staticLib" cleanCommand="rm -f" description="" errorParsers="org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.CWDLocator;org.eclipse.cdt.core.GmakeErrorParser" id="org.tizen.nativecpp.config.sbi.gcc45.lib.debug.emulator.1855378280" name="Debug-Tizen-Emulator" parent="org.tizen.nativecpp.config.sbi.gcc45.lib.debug.emulator" postannouncebuildStep="" postbuildStep="" preannouncebuildStep="" prebuildStep=""> - <folderInfo id="org.tizen.nativecpp.config.sbi.gcc45.lib.debug.emulator.1855378280." name="/" resourcePath=""> - <toolChain errorParsers="" id="org.tizen.nativecpp.toolchain.sbi.gcc45.lib.debug.emulator.2014007899" name="Tizen Native Toolchain" superClass="org.tizen.nativecpp.toolchain.sbi.gcc45.lib.debug.emulator"> - <targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="org.tizen.nativeide.target.sbi.gnu.platform.base.1067387441" osList="linux,win32" superClass="org.tizen.nativeide.target.sbi.gnu.platform.base"/> - <builder autoBuildTarget="all" buildPath="${workspace_loc:/extensions/Debug-Tizen-Emulator}" enableAutoBuild="true" errorParsers="org.eclipse.cdt.core.GmakeErrorParser;org.eclipse.cdt.core.CWDLocator" id="org.tizen.nativecpp.target.sbi.gnu.builder.1261707379" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Tizen Application Builder" superClass="org.tizen.nativecpp.target.sbi.gnu.builder"> - <outputEntries> - <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="Debug-Tizen-Emulator"/> - <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="Debug-Tizen-Device"/> - <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="Release"/> - </outputEntries> - </builder> - <tool command="i386-linux-gnueabi-ar.exe" commandLinePattern="${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}" errorParsers="" id="org.tizen.nativecpp.tool.sbi.gnu.archiver.689316005" name="Archiver" superClass="org.tizen.nativecpp.tool.sbi.gnu.archiver"/> - <tool command="i386-linux-gnueabi-g++.exe" commandLinePattern="${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}" errorParsers="org.eclipse.cdt.core.GCCErrorParser" id="org.tizen.nativecpp.tool.sbi.gnu.cpp.compiler.1533358351" name="C++ Compiler" superClass="org.tizen.nativecpp.tool.sbi.gnu.cpp.compiler"> - <option id="gnu.cpp.compiler.option.optimization.level.1726560828" name="Optimization Level" superClass="gnu.cpp.compiler.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/> - <option id="sbi.gnu.cpp.compiler.option.debugging.level.1554282679" name="Debug level" superClass="sbi.gnu.cpp.compiler.option.debugging.level" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/> - <option id="sbi.gnu.cpp.compiler.option.debug.applog.1800109419" name="Enable application logging (-D_APP_LOG)" superClass="sbi.gnu.cpp.compiler.option.debug.applog" value="true" valueType="boolean"/> - <option id="sbi.gnu.cpp.compiler.option.796499718" name="Tizen-Target" superClass="sbi.gnu.cpp.compiler.option" valueType="userObjs"> - <listOptionValue builtIn="false" value="tizen-emulator-2.2.native_gcc45.i386.cpp.staticLib"/> - </option> - <option id="gnu.cpp.compiler.option.include.paths.1887202981" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath"> - <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/inc}""/> - <listOptionValue builtIn="false" value=""${COCOS_ROOT}/extensions""/> - <listOptionValue builtIn="false" value=""${COCOS_ROOT}/CocosDenshion/include""/> - <listOptionValue builtIn="false" value=""${COCOS_ROOT}/external/chipmunk/include/chipmunk""/> - <listOptionValue builtIn="false" value=""${COCOS_ROOT}/external/libwebsockets/tizen/include/""/> - <listOptionValue builtIn="false" value=""${COCOS_ROOT}/external""/> - <listOptionValue builtIn="false" value=""${COCOS_SRC}""/> - <listOptionValue builtIn="false" value=""${COCOS_SRC}/include""/> - <listOptionValue builtIn="false" value=""${COCOS_SRC}/kazmath/include""/> - <listOptionValue builtIn="false" value=""${COCOS_SRC}/platform/tizen""/> - <listOptionValue builtIn="false" value=""${COCOS_SRC}/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include""/> - </option> - <option id="sbi.gnu.cpp.compiler.option.frameworks.cpp.140749819" name="Tizen-Frameworks" superClass="sbi.gnu.cpp.compiler.option.frameworks.cpp" valueType="userObjs"> - <listOptionValue builtIn="false" value="osp-static"/> - </option> - <option id="sbi.gnu.cpp.compiler.option.frameworks_inc.cpp.1250550482" name="Tizen-Frameworks-Include-Path" superClass="sbi.gnu.cpp.compiler.option.frameworks_inc.cpp" valueType="includePath"> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/libxml2""/> - <listOptionValue builtIn="false" value=""C:\tizen-sdk\library""/> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include""/> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/osp""/> - </option> - <option id="sbi.gnu.cpp.compiler.option.frameworks_cflags.cpp.1942713160" name="Tizen-Frameworks-Other-Cflags" superClass="sbi.gnu.cpp.compiler.option.frameworks_cflags.cpp" valueType="stringList"> - <listOptionValue builtIn="false" value=" -fPIC"/> - <listOptionValue builtIn="false" value="--sysroot="${SBI_SYSROOT}""/> - </option> - <option id="gnu.cpp.compiler.option.preprocessor.def.67860287" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" valueType="definedSymbols"> - <listOptionValue builtIn="false" value="_DEBUG"/> - <listOptionValue builtIn="false" value="TIZEN"/> - <listOptionValue builtIn="false" value="CC_ENABLE_CHIPMUNK_INTEGRATION=1"/> - </option> - <option id="gnu.cpp.compiler.option.other.other.1562216418" name="Other flags" superClass="gnu.cpp.compiler.option.other.other" value="-c -fmessage-length=0 -std=c++0x" valueType="string"/> - <inputType id="sbi.gnu.cpp.compiler.tizen.inputType.2085750802" superClass="sbi.gnu.cpp.compiler.tizen.inputType"/> - </tool> - <tool command="i386-linux-gnueabi-gcc.exe" commandLinePattern="${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}" errorParsers="org.eclipse.cdt.core.GCCErrorParser" id="org.tizen.nativecpp.tool.sbi.gnu.c.compiler.263460224" name="C Compiler" superClass="org.tizen.nativecpp.tool.sbi.gnu.c.compiler"> - <option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.option.optimization.level.819197061" name="Optimization Level" superClass="gnu.c.compiler.option.optimization.level" valueType="enumerated"/> - <option id="sbi.gnu.c.compiler.option.debugging.level.709891206" name="Debug level" superClass="sbi.gnu.c.compiler.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/> - <option id="sbi.gnu.c.compiler.option.debug.applog.1166511754" name="Enable application logging (-D_APP_LOG)" superClass="sbi.gnu.c.compiler.option.debug.applog" value="true" valueType="boolean"/> - <option id="sbi.gnu.c.compiler.option.1738169580" name="Tizen-Target" superClass="sbi.gnu.c.compiler.option" valueType="userObjs"> - <listOptionValue builtIn="false" value="tizen-emulator-2.2.native_gcc45.i386.cpp.staticLib"/> - </option> - <option id="gnu.c.compiler.option.include.paths.821405214" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath"> - <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/inc}""/> - <listOptionValue builtIn="false" value=""${COCOS_SRC}""/> - <listOptionValue builtIn="false" value=""${COCOS_SRC}/include""/> - <listOptionValue builtIn="false" value=""${COCOS_SRC}/kazmath/include""/> - <listOptionValue builtIn="false" value=""${COCOS_SRC}/platform/tizen""/> - </option> - <option id="sbi.gnu.c.compiler.option.frameworks.cpp.229730784" name="Tizen-Frameworks" superClass="sbi.gnu.c.compiler.option.frameworks.cpp" valueType="userObjs"> - <listOptionValue builtIn="false" value="osp-static"/> - </option> - <option id="sbi.gnu.c.compiler.option.frameworks_inc.cpp.1139638882" name="Tizen-Frameworks-Include-Path" superClass="sbi.gnu.c.compiler.option.frameworks_inc.cpp" valueType="includePath"> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/libxml2""/> - <listOptionValue builtIn="false" value=""C:\tizen-sdk\library""/> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include""/> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/osp""/> - </option> - <option id="sbi.gnu.c.compiler.option.frameworks_cflags.cpp.1131449804" name="Tizen-Frameworks-Other-Cflags" superClass="sbi.gnu.c.compiler.option.frameworks_cflags.cpp" valueType="stringList"> - <listOptionValue builtIn="false" value=" -fPIC"/> - <listOptionValue builtIn="false" value="--sysroot="${SBI_SYSROOT}""/> - </option> - <option id="gnu.c.compiler.option.preprocessor.def.symbols.31661523" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" valueType="definedSymbols"> - <listOptionValue builtIn="false" value="_DEBUG"/> - <listOptionValue builtIn="false" value="TIZEN"/> - <listOptionValue builtIn="false" value="CC_ENABLE_CHIPMUNK_INTEGRATION=1"/> - </option> - <inputType id="sbi.gnu.c.compiler.tizen.inputType.94264147" superClass="sbi.gnu.c.compiler.tizen.inputType"/> - </tool> - <tool id="org.tizen.nativeide.tool.sbi.gnu.c.linker.base.792552065" name="C Linker" superClass="org.tizen.nativeide.tool.sbi.gnu.c.linker.base"/> - <tool command="i386-linux-gnueabi-g++.exe" id="org.tizen.nativecpp.tool.sbi.gnu.cpp.linker.1518096171" name="C++ Linker" superClass="org.tizen.nativecpp.tool.sbi.gnu.cpp.linker"> - <option id="gnu.cpp.link.option.paths.43791296" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths" valueType="libPaths"> - <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/lib}""/> - </option> - <option id="sbi.gnu.cpp.linker.option.frameworks_lflags.cpp.181465864" name="Tizen-Frameworks-Other-Lflags" superClass="sbi.gnu.cpp.linker.option.frameworks_lflags.cpp" valueType="stringList"> - <listOptionValue builtIn="false" value="--sysroot="${SBI_SYSROOT}""/> - </option> - </tool> - <tool command="i386-linux-gnueabi-as.exe" commandLinePattern="${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}" errorParsers="org.eclipse.cdt.core.GASErrorParser" id="org.tizen.nativeapp.tool.sbi.gnu.assembler.base.165476943" name="Assembler" superClass="org.tizen.nativeapp.tool.sbi.gnu.assembler.base"> - <option id="gnu.both.asm.option.include.paths.102270925" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths" valueType="includePath"> - <listOptionValue builtIn="false" value="../proj.tizen/inc"/> - <listOptionValue builtIn="false" value="C:/Users/pyrasis/Desktop/cocos2d-x/extensions"/> - <listOptionValue builtIn="false" value="C:/Users/pyrasis/Desktop/cocos2d-x/CocosDenshion/include"/> - <listOptionValue builtIn="false" value="C:/Users/pyrasis/Desktop/cocos2d-x/external/chipmunk/include/chipmunk"/> - <listOptionValue builtIn="false" value="C:/Users/pyrasis/Desktop/cocos2d-x/external"/> - <listOptionValue builtIn="false" value="C:/Users/pyrasis/Desktop/cocos2d-x/cocos2dx"/> - <listOptionValue builtIn="false" value="C:/Users/pyrasis/Desktop/cocos2d-x/cocos2dx/include"/> - <listOptionValue builtIn="false" value="C:/Users/pyrasis/Desktop/cocos2d-x/cocos2dx/kazmath/include"/> - <listOptionValue builtIn="false" value="C:/Users/pyrasis/Desktop/cocos2d-x/cocos2dx/platform/tizen"/> - <listOptionValue builtIn="false" value="C:/Users/pyrasis/Desktop/cocos2d-x/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.0.cpp/usr/include"/> - <listOptionValue builtIn="false" value="C:/tizen-sdk/platforms/tizen2.0/rootstraps/tizen-emulator-2.0.cpp/usr/include"/> - <listOptionValue builtIn="false" value="C:/tizen-sdk/platforms/tizen2.0/rootstraps/tizen-emulator-2.0.cpp/usr/include/libxml2"/> - <listOptionValue builtIn="false" value="C:/tizen-sdk/library"/> - <listOptionValue builtIn="false" value="C:/tizen-sdk/platforms/tizen2.0/rootstraps/tizen-emulator-2.0.cpp/usr/include/osp"/> - </option> - <inputType id="cdt.managedbuild.tool.gnu.assembler.input.517365643" superClass="cdt.managedbuild.tool.gnu.assembler.input"/> - </tool> - <tool id="org.tizen.nativecpp.tool.sbi.po.compiler.254627421" name="PO Resource Compiler" superClass="org.tizen.nativecpp.tool.sbi.po.compiler"/> - <tool id="org.tizen.nativecpp.tool.sbi.edc.compiler.8480881" name="EDC Resource Compiler" superClass="org.tizen.nativecpp.tool.sbi.edc.compiler"/> - </toolChain> - </folderInfo> - <sourceEntries> - <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/> - </sourceEntries> - </configuration> - </storageModule> - <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> - </cconfiguration> - <cconfiguration id="org.tizen.nativecpp.config.sbi.gcc45.lib.debug.device.1240851129"> - <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="org.tizen.nativecpp.config.sbi.gcc45.lib.debug.device.1240851129" moduleId="org.eclipse.cdt.core.settings" name="Debug-Tizen-Device"> - <macros> - <stringMacro name="COCOS_ROOT" type="VALUE_PATH_ANY" value="../../.."/> - <stringMacro name="COCOS_SRC" type="VALUE_PATH_ANY" value="${COCOS_ROOT}/cocos2dx"/> - </macros> - <externalSettings/> - <extensions> - <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/> - <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - </extensions> - </storageModule> - <storageModule moduleId="cdtBuildSystem" version="4.0.0"> - <configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.tizen.nativecpp.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.tizen.nativecpp.buildArtefactType.staticLib" cleanCommand="rm -f" description="" errorParsers="org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;" id="org.tizen.nativecpp.config.sbi.gcc45.lib.debug.device.1240851129" name="Debug-Tizen-Device" parent="org.tizen.nativecpp.config.sbi.gcc45.lib.debug.device"> - <folderInfo id="org.tizen.nativecpp.config.sbi.gcc45.lib.debug.device.1240851129." name="/" resourcePath=""> - <toolChain id="org.tizen.nativecpp.toolchain.sbi.gcc45.lib.debug.device.1011815399" name="Tizen Native Toolchain" superClass="org.tizen.nativecpp.toolchain.sbi.gcc45.lib.debug.device"> - <targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="org.tizen.nativeide.target.sbi.gnu.platform.base.205106495" osList="linux,win32" superClass="org.tizen.nativeide.target.sbi.gnu.platform.base"/> - <builder buildPath="${workspace_loc:/extensions/Debug-Tizen-Device}" id="org.tizen.nativecpp.target.sbi.gnu.builder.391616426" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Tizen Application Builder" superClass="org.tizen.nativecpp.target.sbi.gnu.builder"/> - <tool command="arm-linux-gnueabi-ar.exe" id="org.tizen.nativecpp.tool.sbi.gnu.archiver.1946190238" name="Archiver" superClass="org.tizen.nativecpp.tool.sbi.gnu.archiver"/> - <tool command="arm-linux-gnueabi-g++.exe" id="org.tizen.nativecpp.tool.sbi.gnu.cpp.compiler.806237946" name="C++ Compiler" superClass="org.tizen.nativecpp.tool.sbi.gnu.cpp.compiler"> - <option id="gnu.cpp.compiler.option.optimization.level.1141078136" name="Optimization Level" superClass="gnu.cpp.compiler.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/> - <option id="sbi.gnu.cpp.compiler.option.debugging.level.412266760" name="Debug level" superClass="sbi.gnu.cpp.compiler.option.debugging.level" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/> - <option id="sbi.gnu.cpp.compiler.option.debug.applog.48357772" name="Enable application logging (-D_APP_LOG)" superClass="sbi.gnu.cpp.compiler.option.debug.applog" value="true" valueType="boolean"/> - <option id="sbi.gnu.cpp.compiler.option.738324429" name="Tizen-Target" superClass="sbi.gnu.cpp.compiler.option" valueType="userObjs"> - <listOptionValue builtIn="false" value="tizen-device-2.2.native_gcc45.armel.cpp.staticLib"/> - </option> - <option id="gnu.cpp.compiler.option.include.paths.1372067183" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath"> - <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/inc}""/> - <listOptionValue builtIn="false" value=""${COCOS_ROOT}/extensions""/> - <listOptionValue builtIn="false" value=""${COCOS_ROOT}/CocosDenshion/include""/> - <listOptionValue builtIn="false" value=""${COCOS_ROOT}/external/chipmunk/include/chipmunk""/> - <listOptionValue builtIn="false" value=""${COCOS_ROOT}/external/libwebsockets/tizen/include/""/> - <listOptionValue builtIn="false" value=""${COCOS_ROOT}/external""/> - <listOptionValue builtIn="false" value=""${COCOS_SRC}""/> - <listOptionValue builtIn="false" value=""${COCOS_SRC}/include""/> - <listOptionValue builtIn="false" value=""${COCOS_SRC}/kazmath/include""/> - <listOptionValue builtIn="false" value=""${COCOS_SRC}/platform/tizen""/> - <listOptionValue builtIn="false" value=""${COCOS_SRC}/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include""/> - </option> - <option id="sbi.gnu.cpp.compiler.option.frameworks.cpp.1270990666" name="Tizen-Frameworks" superClass="sbi.gnu.cpp.compiler.option.frameworks.cpp" valueType="userObjs"> - <listOptionValue builtIn="false" value="osp-static"/> - </option> - <option id="sbi.gnu.cpp.compiler.option.frameworks_inc.cpp.579636391" name="Tizen-Frameworks-Include-Path" superClass="sbi.gnu.cpp.compiler.option.frameworks_inc.cpp" valueType="includePath"> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/libxml2""/> - <listOptionValue builtIn="false" value=""C:\tizen-sdk\library""/> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include""/> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/osp""/> - </option> - <option id="sbi.gnu.cpp.compiler.option.frameworks_cflags.cpp.1644102691" name="Tizen-Frameworks-Other-Cflags" superClass="sbi.gnu.cpp.compiler.option.frameworks_cflags.cpp" valueType="stringList"> - <listOptionValue builtIn="false" value=" -fPIC"/> - <listOptionValue builtIn="false" value="--sysroot="${SBI_SYSROOT}""/> - </option> - <option id="gnu.cpp.compiler.option.preprocessor.def.1398462050" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" valueType="definedSymbols"> - <listOptionValue builtIn="false" value="_DEBUG"/> - <listOptionValue builtIn="false" value="TIZEN"/> - <listOptionValue builtIn="false" value="CC_ENABLE_CHIPMUNK_INTEGRATION=1"/> - </option> - <option id="gnu.cpp.compiler.option.other.other.2066748684" name="Other flags" superClass="gnu.cpp.compiler.option.other.other" value="-c -fmessage-length=0 -std=c++0x" valueType="string"/> - <inputType id="sbi.gnu.cpp.compiler.tizen.inputType.1890676098" superClass="sbi.gnu.cpp.compiler.tizen.inputType"/> - </tool> - <tool command="arm-linux-gnueabi-gcc.exe" id="org.tizen.nativecpp.tool.sbi.gnu.c.compiler.800077346" name="C Compiler" superClass="org.tizen.nativecpp.tool.sbi.gnu.c.compiler"> - <option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.option.optimization.level.73052907" name="Optimization Level" superClass="gnu.c.compiler.option.optimization.level" valueType="enumerated"/> - <option id="sbi.gnu.c.compiler.option.debugging.level.641100997" name="Debug level" superClass="sbi.gnu.c.compiler.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/> - <option id="sbi.gnu.c.compiler.option.debug.applog.2000116514" name="Enable application logging (-D_APP_LOG)" superClass="sbi.gnu.c.compiler.option.debug.applog" value="true" valueType="boolean"/> - <option id="sbi.gnu.c.compiler.option.1751855743" name="Tizen-Target" superClass="sbi.gnu.c.compiler.option" valueType="userObjs"> - <listOptionValue builtIn="false" value="tizen-device-2.2.native_gcc45.armel.cpp.staticLib"/> - </option> - <option id="gnu.c.compiler.option.include.paths.1641648644" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath"> - <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/inc}""/> - </option> - <option id="sbi.gnu.c.compiler.option.frameworks.cpp.356824867" name="Tizen-Frameworks" superClass="sbi.gnu.c.compiler.option.frameworks.cpp" valueType="userObjs"> - <listOptionValue builtIn="false" value="osp-static"/> - </option> - <option id="sbi.gnu.c.compiler.option.frameworks_inc.cpp.843251170" name="Tizen-Frameworks-Include-Path" superClass="sbi.gnu.c.compiler.option.frameworks_inc.cpp" valueType="includePath"> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/libxml2""/> - <listOptionValue builtIn="false" value=""C:\tizen-sdk\library""/> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include""/> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/osp""/> - </option> - <option id="sbi.gnu.c.compiler.option.frameworks_cflags.cpp.2073478823" name="Tizen-Frameworks-Other-Cflags" superClass="sbi.gnu.c.compiler.option.frameworks_cflags.cpp" valueType="stringList"> - <listOptionValue builtIn="false" value=" -fPIC"/> - <listOptionValue builtIn="false" value="--sysroot="${SBI_SYSROOT}""/> - </option> - <option id="gnu.c.compiler.option.preprocessor.def.symbols.1732125980" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" valueType="definedSymbols"> - <listOptionValue builtIn="false" value="_DEBUG"/> - <listOptionValue builtIn="false" value="TIZEN"/> - <listOptionValue builtIn="false" value="CC_ENABLE_CHIPMUNK_INTEGRATION=1"/> - <listOptionValue builtIn="false" value="CC_ENABLE_BOX2D_INTEGRATION=0"/> - </option> - <inputType id="sbi.gnu.c.compiler.tizen.inputType.565155338" superClass="sbi.gnu.c.compiler.tizen.inputType"/> - </tool> - <tool id="org.tizen.nativeide.tool.sbi.gnu.c.linker.base.1321059471" name="C Linker" superClass="org.tizen.nativeide.tool.sbi.gnu.c.linker.base"/> - <tool command="arm-linux-gnueabi-g++.exe" id="org.tizen.nativecpp.tool.sbi.gnu.cpp.linker.517614783" name="C++ Linker" superClass="org.tizen.nativecpp.tool.sbi.gnu.cpp.linker"> - <option id="gnu.cpp.link.option.paths.316493253" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths" valueType="libPaths"> - <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/lib}""/> - </option> - <option id="sbi.gnu.cpp.linker.option.frameworks_lflags.cpp.557112687" name="Tizen-Frameworks-Other-Lflags" superClass="sbi.gnu.cpp.linker.option.frameworks_lflags.cpp" valueType="stringList"> - <listOptionValue builtIn="false" value="--sysroot="${SBI_SYSROOT}""/> - </option> - </tool> - <tool command="arm-linux-gnueabi-as.exe" id="org.tizen.nativeapp.tool.sbi.gnu.assembler.base.1047247012" name="Assembler" superClass="org.tizen.nativeapp.tool.sbi.gnu.assembler.base"> - <inputType id="cdt.managedbuild.tool.gnu.assembler.input.1262361730" superClass="cdt.managedbuild.tool.gnu.assembler.input"/> - </tool> - <tool id="org.tizen.nativecpp.tool.sbi.po.compiler.1138371781" name="PO Resource Compiler" superClass="org.tizen.nativecpp.tool.sbi.po.compiler"/> - <tool id="org.tizen.nativecpp.tool.sbi.edc.compiler.2045899075" name="EDC Resource Compiler" superClass="org.tizen.nativecpp.tool.sbi.edc.compiler"/> - </toolChain> - </folderInfo> - <sourceEntries> - <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/> - </sourceEntries> - </configuration> - </storageModule> - <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> - </cconfiguration> - <cconfiguration id="org.tizen.nativecpp.config.sbi.gcc45.lib.release.2023052084"> - <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="org.tizen.nativecpp.config.sbi.gcc45.lib.release.2023052084" moduleId="org.eclipse.cdt.core.settings" name="Release"> - <macros> - <stringMacro name="COCOS_ROOT" type="VALUE_PATH_ANY" value="../.."/> - <stringMacro name="COCOS_SRC" type="VALUE_PATH_ANY" value="${COCOS_ROOT}/cocos2dx"/> - </macros> - <externalSettings/> - <extensions> - <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/> - <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - </extensions> - </storageModule> - <storageModule moduleId="cdtBuildSystem" version="4.0.0"> - <configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.tizen.nativecpp.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release,org.eclipse.cdt.build.core.buildArtefactType=org.tizen.nativecpp.buildArtefactType.staticLib" cleanCommand="rm -f" description="" errorParsers="org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;" id="org.tizen.nativecpp.config.sbi.gcc45.lib.release.2023052084" name="Release" parent="org.tizen.nativecpp.config.sbi.gcc45.lib.release"> - <folderInfo id="org.tizen.nativecpp.config.sbi.gcc45.lib.release.2023052084." name="/" resourcePath=""> - <toolChain id="org.tizen.nativecpp.toolchain.sbi.gcc45.lib.release.1978438453" name="Tizen Native Toolchain" superClass="org.tizen.nativecpp.toolchain.sbi.gcc45.lib.release"> - <targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="org.tizen.nativeide.target.sbi.gnu.platform.base.216744962" osList="linux,win32" superClass="org.tizen.nativeide.target.sbi.gnu.platform.base"/> - <builder buildPath="${workspace_loc:/extensions/Release}" id="org.tizen.nativecpp.target.sbi.gnu.builder.2102360604" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Tizen Application Builder" superClass="org.tizen.nativecpp.target.sbi.gnu.builder"/> - <tool command="i386-linux-gnueabi-ar.exe" id="org.tizen.nativecpp.tool.sbi.gnu.archiver.1826014056" name="Archiver" superClass="org.tizen.nativecpp.tool.sbi.gnu.archiver"/> - <tool command="clang++.exe" id="org.tizen.nativecpp.tool.sbi.gnu.cpp.compiler.2111905100" name="C++ Compiler" superClass="org.tizen.nativecpp.tool.sbi.gnu.cpp.compiler"> - <option id="gnu.cpp.compiler.option.optimization.level.1297088223" name="Optimization Level" superClass="gnu.cpp.compiler.option.optimization.level" value="gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/> - <option id="sbi.gnu.cpp.compiler.option.debugging.level.459894355" name="Debug level" superClass="sbi.gnu.cpp.compiler.option.debugging.level"/> - <option id="sbi.gnu.cpp.compiler.option.debug.applog.849008186" name="Enable application logging (-D_APP_LOG)" superClass="sbi.gnu.cpp.compiler.option.debug.applog"/> - <option id="sbi.gnu.cpp.compiler.option.74299026" name="Tizen-Target" superClass="sbi.gnu.cpp.compiler.option" valueType="userObjs"> - <listOptionValue builtIn="false" value="tizen-emulator-2.2.native_llvm31.i386.cpp.staticLib"/> - </option> - <option id="gnu.cpp.compiler.option.include.paths.1217915212" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath"> - <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/inc}""/> - </option> - <option id="sbi.gnu.cpp.compiler.option.frameworks.cpp.448934412" name="Tizen-Frameworks" superClass="sbi.gnu.cpp.compiler.option.frameworks.cpp" valueType="userObjs"> - <listOptionValue builtIn="false" value="osp-static"/> - </option> - <option id="sbi.gnu.cpp.compiler.option.frameworks_inc.cpp.1627502718" name="Tizen-Frameworks-Include-Path" superClass="sbi.gnu.cpp.compiler.option.frameworks_inc.cpp" valueType="includePath"> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/libxml2""/> - <listOptionValue builtIn="false" value=""C:\tizen-sdk\library""/> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include""/> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/osp""/> - </option> - <option id="sbi.gnu.cpp.compiler.option.frameworks_cflags.cpp.138455270" name="Tizen-Frameworks-Other-Cflags" superClass="sbi.gnu.cpp.compiler.option.frameworks_cflags.cpp" valueType="stringList"> - <listOptionValue builtIn="false" value="-target i386-tizen-linux-gnueabi -gcc-toolchain C:/tizen-sdk/tools/smart-build-interface/../i386-linux-gnueabi-gcc-4.5/ -ccc-gcc-name i386-linux-gnueabi-g++ -march=i386 -Wno-gnu"/> - <listOptionValue builtIn="false" value=" -fPIC"/> - <listOptionValue builtIn="false" value="--sysroot="${SBI_SYSROOT}""/> - </option> - <inputType id="sbi.gnu.cpp.compiler.tizen.inputType.1145329261" superClass="sbi.gnu.cpp.compiler.tizen.inputType"/> - </tool> - <tool command="clang.exe" id="org.tizen.nativecpp.tool.sbi.gnu.c.compiler.19577634" name="C Compiler" superClass="org.tizen.nativecpp.tool.sbi.gnu.c.compiler"> - <option defaultValue="gnu.c.optimization.level.most" id="gnu.c.compiler.option.optimization.level.1635131080" name="Optimization Level" superClass="gnu.c.compiler.option.optimization.level" valueType="enumerated"/> - <option id="sbi.gnu.c.compiler.option.debugging.level.220381318" name="Debug level" superClass="sbi.gnu.c.compiler.option.debugging.level"/> - <option id="sbi.gnu.c.compiler.option.debug.applog.753089515" name="Enable application logging (-D_APP_LOG)" superClass="sbi.gnu.c.compiler.option.debug.applog"/> - <option id="sbi.gnu.c.compiler.option.215142124" name="Tizen-Target" superClass="sbi.gnu.c.compiler.option" valueType="userObjs"> - <listOptionValue builtIn="false" value="tizen-emulator-2.2.native_llvm31.i386.cpp.staticLib"/> - </option> - <option id="gnu.c.compiler.option.include.paths.632347119" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath"> - <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/inc}""/> - </option> - <option id="sbi.gnu.c.compiler.option.frameworks.cpp.1474026339" name="Tizen-Frameworks" superClass="sbi.gnu.c.compiler.option.frameworks.cpp" valueType="userObjs"> - <listOptionValue builtIn="false" value="osp-static"/> - </option> - <option id="sbi.gnu.c.compiler.option.frameworks_inc.cpp.468493190" name="Tizen-Frameworks-Include-Path" superClass="sbi.gnu.c.compiler.option.frameworks_inc.cpp" valueType="includePath"> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/libxml2""/> - <listOptionValue builtIn="false" value=""C:\tizen-sdk\library""/> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include""/> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/osp""/> - </option> - <option id="sbi.gnu.c.compiler.option.frameworks_cflags.cpp.1218800554" name="Tizen-Frameworks-Other-Cflags" superClass="sbi.gnu.c.compiler.option.frameworks_cflags.cpp" valueType="stringList"> - <listOptionValue builtIn="false" value="-target i386-tizen-linux-gnueabi -gcc-toolchain C:/tizen-sdk/tools/smart-build-interface/../i386-linux-gnueabi-gcc-4.5/ -ccc-gcc-name i386-linux-gnueabi-g++ -march=i386 -Wno-gnu"/> - <listOptionValue builtIn="false" value=" -fPIC"/> - <listOptionValue builtIn="false" value="--sysroot="${SBI_SYSROOT}""/> - </option> - <inputType id="sbi.gnu.c.compiler.tizen.inputType.1344515254" superClass="sbi.gnu.c.compiler.tizen.inputType"/> - </tool> - <tool id="org.tizen.nativeide.tool.sbi.gnu.c.linker.base.59626261" name="C Linker" superClass="org.tizen.nativeide.tool.sbi.gnu.c.linker.base"/> - <tool command="clang++.exe" id="org.tizen.nativecpp.tool.sbi.gnu.cpp.linker.563167499" name="C++ Linker" superClass="org.tizen.nativecpp.tool.sbi.gnu.cpp.linker"> - <option id="gnu.cpp.link.option.paths.618042967" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths" valueType="libPaths"> - <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/lib}""/> - </option> - <option id="sbi.gnu.cpp.linker.option.frameworks_lflags.cpp.620416347" name="Tizen-Frameworks-Other-Lflags" superClass="sbi.gnu.cpp.linker.option.frameworks_lflags.cpp" valueType="stringList"> - <listOptionValue builtIn="false" value="-target i386-tizen-linux-gnueabi -gcc-toolchain C:/tizen-sdk/tools/smart-build-interface/../i386-linux-gnueabi-gcc-4.5/ -ccc-gcc-name i386-linux-gnueabi-g++ -march=i386 -Xlinker --as-needed"/> - <listOptionValue builtIn="false" value="--sysroot="${SBI_SYSROOT}""/> - </option> - </tool> - <tool command="i386-linux-gnueabi-as.exe" id="org.tizen.nativeapp.tool.sbi.gnu.assembler.base.1990045494" name="Assembler" superClass="org.tizen.nativeapp.tool.sbi.gnu.assembler.base"> - <inputType id="cdt.managedbuild.tool.gnu.assembler.input.879926948" superClass="cdt.managedbuild.tool.gnu.assembler.input"/> - </tool> - <tool id="org.tizen.nativecpp.tool.sbi.po.compiler.1674758948" name="PO Resource Compiler" superClass="org.tizen.nativecpp.tool.sbi.po.compiler"/> - <tool id="org.tizen.nativecpp.tool.sbi.edc.compiler.1792629643" name="EDC Resource Compiler" superClass="org.tizen.nativecpp.tool.sbi.edc.compiler"/> - </toolChain> - </folderInfo> - <sourceEntries> - <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/> - </sourceEntries> - </configuration> - </storageModule> - <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> - </cconfiguration> - </storageModule> - <storageModule moduleId="cdtBuildSystem" version="4.0.0"> - <project id="extensions.org.tizen.nativecpp.target.sbi.gcc45.lib.1874463476" name="Tizen Static Library" projectType="org.tizen.nativecpp.target.sbi.gcc45.lib"/> - </storageModule> - <storageModule moduleId="com.samsung.tizen.nativeapp.projectInfo" version="1.0.0"/> - <storageModule moduleId="refreshScope" versionNumber="1"> - <resource resourceType="PROJECT" workspacePath="/extensions"/> - </storageModule> - <storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/> - <storageModule moduleId="scannerConfiguration"> - <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/> - <scannerConfigBuildInfo instanceId="org.tizen.nativecpp.config.sbi.gcc45.lib.debug.emulator.1855378280"> - <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.tizen.nativecommon.TizenGCCManagedMakePerProjectProfileCPP"/> - </scannerConfigBuildInfo> - <scannerConfigBuildInfo instanceId="org.tizen.nativecpp.config.sbi.gcc45.lib.release.2023052084"> - <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.tizen.nativecommon.TizenGCCManagedMakePerProjectProfileCPP"/> - </scannerConfigBuildInfo> - <scannerConfigBuildInfo instanceId="org.tizen.nativecpp.config.sbi.gcc45.lib.debug.device.1240851129"> - <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.tizen.nativecommon.TizenGCCManagedMakePerProjectProfileCPP"/> - </scannerConfigBuildInfo> - </storageModule> -</cproject> diff --git a/extensions/proj.tizen/.project b/extensions/proj.tizen/.project deleted file mode 100644 index f8c4432011..0000000000 --- a/extensions/proj.tizen/.project +++ /dev/null @@ -1,156 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>extensions</name> - <comment></comment> - <projects> - </projects> - <buildSpec> - <buildCommand> - <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name> - <triggers>clean,full,incremental,</triggers> - <arguments> - <dictionary> - <key>?name?</key> - <value></value> - </dictionary> - <dictionary> - <key>org.eclipse.cdt.make.core.append_environment</key> - <value>true</value> - </dictionary> - <dictionary> - <key>org.eclipse.cdt.make.core.autoBuildTarget</key> - <value>all</value> - </dictionary> - <dictionary> - <key>org.eclipse.cdt.make.core.buildArguments</key> - <value></value> - </dictionary> - <dictionary> - <key>org.eclipse.cdt.make.core.buildCommand</key> - <value>sbi-make</value> - </dictionary> - <dictionary> - <key>org.eclipse.cdt.make.core.buildLocation</key> - <value>${workspace_loc:/extensions/Debug-Tizen-Emulator}</value> - </dictionary> - <dictionary> - <key>org.eclipse.cdt.make.core.cleanBuildTarget</key> - <value>clean</value> - </dictionary> - <dictionary> - <key>org.eclipse.cdt.make.core.contents</key> - <value>org.eclipse.cdt.make.core.activeConfigSettings</value> - </dictionary> - <dictionary> - <key>org.eclipse.cdt.make.core.enableAutoBuild</key> - <value>false</value> - </dictionary> - <dictionary> - <key>org.eclipse.cdt.make.core.enableCleanBuild</key> - <value>true</value> - </dictionary> - <dictionary> - <key>org.eclipse.cdt.make.core.enableFullBuild</key> - <value>true</value> - </dictionary> - <dictionary> - <key>org.eclipse.cdt.make.core.fullBuildTarget</key> - <value>all</value> - </dictionary> - <dictionary> - <key>org.eclipse.cdt.make.core.stopOnError</key> - <value>true</value> - </dictionary> - <dictionary> - <key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key> - <value>true</value> - </dictionary> - </arguments> - </buildCommand> - <buildCommand> - <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name> - <triggers>full,incremental,</triggers> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>org.tizen.nativecpp.apichecker.core.builder</name> - <arguments> - </arguments> - </buildCommand> - </buildSpec> - <natures> - <nature>org.eclipse.cdt.core.cnature</nature> - <nature>org.eclipse.cdt.core.ccnature</nature> - <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature> - <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature> - <nature>org.tizen.nativecpp.apichecker.core.tizenCppNature</nature> - </natures> - <linkedResources> - <link> - <name>src/AssetsManager</name> - <type>2</type> - <locationURI>PARENT-1-PROJECT_LOC/AssetsManager</locationURI> - </link> - <link> - <name>src/CCArmature</name> - <type>2</type> - <locationURI>PARENT-1-PROJECT_LOC/CCArmature</locationURI> - </link> - <link> - <name>src/CCBReader</name> - <type>2</type> - <locationURI>PARENT-1-PROJECT_LOC/CCBReader</locationURI> - </link> - <link> - <name>src/CCDeprecated-ext.cpp</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/CCDeprecated-ext.cpp</locationURI> - </link> - <link> - <name>src/CCDeprecated-ext.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/CCDeprecated-ext.h</locationURI> - </link> - <link> - <name>src/Components</name> - <type>2</type> - <locationURI>PARENT-1-PROJECT_LOC/Components</locationURI> - </link> - <link> - <name>src/ExtensionMacros.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/ExtensionMacros.h</locationURI> - </link> - <link> - <name>src/GUI</name> - <type>2</type> - <locationURI>PARENT-1-PROJECT_LOC/GUI</locationURI> - </link> - <link> - <name>src/LocalStorage</name> - <type>2</type> - <locationURI>PARENT-1-PROJECT_LOC/LocalStorage</locationURI> - </link> - <link> - <name>src/cocos-ext.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/cocos-ext.h</locationURI> - </link> - <link> - <name>src/network</name> - <type>2</type> - <locationURI>PARENT-1-PROJECT_LOC/network</locationURI> - </link> - <link> - <name>src/physics_nodes</name> - <type>2</type> - <locationURI>PARENT-1-PROJECT_LOC/physics_nodes</locationURI> - </link> - <link> - <name>src/spine</name> - <type>2</type> - <locationURI>PARENT-1-PROJECT_LOC/spine</locationURI> - </link> - </linkedResources> -</projectDescription> diff --git a/extensions/proj.tizen/src/placeholder.txt b/extensions/proj.tizen/src/placeholder.txt deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/external/Box2D/proj.emscripten/Makefile b/external/Box2D/proj.emscripten/Makefile deleted file mode 100644 index b0cc6a5e93..0000000000 --- a/external/Box2D/proj.emscripten/Makefile +++ /dev/null @@ -1,72 +0,0 @@ -TARGET = libbox2d.a - -SOURCES = ../Collision/Shapes/b2ChainShape.cpp \ -../Collision/Shapes/b2CircleShape.cpp \ -../Collision/Shapes/b2EdgeShape.cpp \ -../Collision/Shapes/b2PolygonShape.cpp \ -../Collision/b2BroadPhase.cpp \ -../Collision/b2CollideCircle.cpp \ -../Collision/b2CollideEdge.cpp \ -../Collision/b2CollidePolygon.cpp \ -../Collision/b2Collision.cpp \ -../Collision/b2Distance.cpp \ -../Collision/b2DynamicTree.cpp \ -../Collision/b2TimeOfImpact.cpp \ -../Common/b2BlockAllocator.cpp \ -../Common/b2Draw.cpp \ -../Common/b2Math.cpp \ -../Common/b2Settings.cpp \ -../Common/b2StackAllocator.cpp \ -../Common/b2Timer.cpp \ -../Dynamics/Contacts/b2ChainAndCircleContact.cpp \ -../Dynamics/Contacts/b2ChainAndPolygonContact.cpp \ -../Dynamics/Contacts/b2CircleContact.cpp \ -../Dynamics/Contacts/b2Contact.cpp \ -../Dynamics/Contacts/b2ContactSolver.cpp \ -../Dynamics/Contacts/b2EdgeAndCircleContact.cpp \ -../Dynamics/Contacts/b2EdgeAndPolygonContact.cpp \ -../Dynamics/Contacts/b2PolygonAndCircleContact.cpp \ -../Dynamics/Contacts/b2PolygonContact.cpp \ -../Dynamics/Joints/b2DistanceJoint.cpp \ -../Dynamics/Joints/b2FrictionJoint.cpp \ -../Dynamics/Joints/b2GearJoint.cpp \ -../Dynamics/Joints/b2Joint.cpp \ -../Dynamics/Joints/b2MouseJoint.cpp \ -../Dynamics/Joints/b2PrismaticJoint.cpp \ -../Dynamics/Joints/b2PulleyJoint.cpp \ -../Dynamics/Joints/b2RevoluteJoint.cpp \ -../Dynamics/Joints/b2RopeJoint.cpp \ -../Dynamics/Joints/b2WeldJoint.cpp \ -../Dynamics/Joints/b2WheelJoint.cpp \ -../Dynamics/b2Body.cpp \ -../Dynamics/b2ContactManager.cpp \ -../Dynamics/b2Fixture.cpp \ -../Dynamics/b2Island.cpp \ -../Dynamics/b2World.cpp \ -../Dynamics/b2WorldCallbacks.cpp \ -../Rope/b2Rope.cpp - -include ../../../cocos2dx/proj.emscripten/cocos2dx.mk - -INCLUDES = -I../.. - -# Cocos2d is not responsible for warnings in external projects -CXXFLAGS += -w - -ifeq ($(DEBUG), 1) -DEFINES += -D_DEBUG -else -DEFINES += -endif - -TARGET := $(LIB_DIR)/$(TARGET) - -all: $(TARGET) - -$(TARGET): $(OBJECTS) $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(AR) $(ARFLAGS) $(TARGET) $(OBJECTS) - -$(OBJ_DIR)/%.o: ../%.cpp $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@ diff --git a/external/Box2D/proj.ios/Box2D-Prefix.pch b/external/Box2D/proj.ios/Box2D-Prefix.pch deleted file mode 100644 index c6446fa492..0000000000 --- a/external/Box2D/proj.ios/Box2D-Prefix.pch +++ /dev/null @@ -1,7 +0,0 @@ -// -// Prefix header for all source files of the 'Box2D' target in the 'Box2D' project -// - -#ifdef __OBJC__ - #import <Foundation/Foundation.h> -#endif diff --git a/external/Box2D/proj.ios/Box2D.xcodeproj/project.pbxproj b/external/Box2D/proj.ios/Box2D.xcodeproj/project.pbxproj deleted file mode 100644 index f19d98249a..0000000000 --- a/external/Box2D/proj.ios/Box2D.xcodeproj/project.pbxproj +++ /dev/null @@ -1,567 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 1A0C0D681777FBBE00838530 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A0C0D671777FBBE00838530 /* Foundation.framework */; }; - 1A0C0DD71777FC0500838530 /* b2BroadPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0D771777FC0500838530 /* b2BroadPhase.cpp */; }; - 1A0C0DD81777FC0500838530 /* b2CollideCircle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0D791777FC0500838530 /* b2CollideCircle.cpp */; }; - 1A0C0DD91777FC0500838530 /* b2CollideEdge.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0D7A1777FC0500838530 /* b2CollideEdge.cpp */; }; - 1A0C0DDA1777FC0500838530 /* b2CollidePolygon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0D7B1777FC0500838530 /* b2CollidePolygon.cpp */; }; - 1A0C0DDB1777FC0500838530 /* b2Collision.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0D7C1777FC0500838530 /* b2Collision.cpp */; }; - 1A0C0DDC1777FC0500838530 /* b2Distance.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0D7E1777FC0500838530 /* b2Distance.cpp */; }; - 1A0C0DDD1777FC0500838530 /* b2DynamicTree.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0D801777FC0500838530 /* b2DynamicTree.cpp */; }; - 1A0C0DDE1777FC0500838530 /* b2TimeOfImpact.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0D821777FC0500838530 /* b2TimeOfImpact.cpp */; }; - 1A0C0DDF1777FC0500838530 /* b2ChainShape.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0D851777FC0500838530 /* b2ChainShape.cpp */; }; - 1A0C0DE01777FC0500838530 /* b2CircleShape.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0D871777FC0500838530 /* b2CircleShape.cpp */; }; - 1A0C0DE11777FC0500838530 /* b2EdgeShape.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0D891777FC0500838530 /* b2EdgeShape.cpp */; }; - 1A0C0DE21777FC0500838530 /* b2PolygonShape.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0D8B1777FC0500838530 /* b2PolygonShape.cpp */; }; - 1A0C0DE31777FC0500838530 /* b2BlockAllocator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0D8F1777FC0500838530 /* b2BlockAllocator.cpp */; }; - 1A0C0DE41777FC0500838530 /* b2Draw.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0D911777FC0500838530 /* b2Draw.cpp */; }; - 1A0C0DE51777FC0500838530 /* b2Math.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0D941777FC0500838530 /* b2Math.cpp */; }; - 1A0C0DE61777FC0500838530 /* b2Settings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0D961777FC0500838530 /* b2Settings.cpp */; }; - 1A0C0DE71777FC0500838530 /* b2StackAllocator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0D981777FC0500838530 /* b2StackAllocator.cpp */; }; - 1A0C0DE81777FC0500838530 /* b2Timer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0D9A1777FC0500838530 /* b2Timer.cpp */; }; - 1A0C0DE91777FC0500838530 /* b2Body.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0D9D1777FC0500838530 /* b2Body.cpp */; }; - 1A0C0DEA1777FC0500838530 /* b2ContactManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0D9F1777FC0500838530 /* b2ContactManager.cpp */; }; - 1A0C0DEB1777FC0500838530 /* b2Fixture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0DA11777FC0500838530 /* b2Fixture.cpp */; }; - 1A0C0DEC1777FC0500838530 /* b2Island.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0DA31777FC0500838530 /* b2Island.cpp */; }; - 1A0C0DED1777FC0500838530 /* b2World.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0DA61777FC0500838530 /* b2World.cpp */; }; - 1A0C0DEE1777FC0500838530 /* b2WorldCallbacks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0DA81777FC0500838530 /* b2WorldCallbacks.cpp */; }; - 1A0C0DEF1777FC0500838530 /* b2ChainAndCircleContact.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0DAB1777FC0500838530 /* b2ChainAndCircleContact.cpp */; }; - 1A0C0DF01777FC0500838530 /* b2ChainAndPolygonContact.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0DAD1777FC0500838530 /* b2ChainAndPolygonContact.cpp */; }; - 1A0C0DF11777FC0500838530 /* b2CircleContact.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0DAF1777FC0500838530 /* b2CircleContact.cpp */; }; - 1A0C0DF21777FC0500838530 /* b2Contact.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0DB11777FC0500838530 /* b2Contact.cpp */; }; - 1A0C0DF31777FC0500838530 /* b2ContactSolver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0DB31777FC0500838530 /* b2ContactSolver.cpp */; }; - 1A0C0DF41777FC0500838530 /* b2EdgeAndCircleContact.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0DB51777FC0500838530 /* b2EdgeAndCircleContact.cpp */; }; - 1A0C0DF51777FC0500838530 /* b2EdgeAndPolygonContact.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0DB71777FC0500838530 /* b2EdgeAndPolygonContact.cpp */; }; - 1A0C0DF61777FC0500838530 /* b2PolygonAndCircleContact.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0DB91777FC0500838530 /* b2PolygonAndCircleContact.cpp */; }; - 1A0C0DF71777FC0500838530 /* b2PolygonContact.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0DBB1777FC0500838530 /* b2PolygonContact.cpp */; }; - 1A0C0DF81777FC0500838530 /* b2DistanceJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0DBE1777FC0500838530 /* b2DistanceJoint.cpp */; }; - 1A0C0DF91777FC0500838530 /* b2FrictionJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0DC01777FC0500838530 /* b2FrictionJoint.cpp */; }; - 1A0C0DFA1777FC0500838530 /* b2GearJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0DC21777FC0500838530 /* b2GearJoint.cpp */; }; - 1A0C0DFB1777FC0500838530 /* b2Joint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0DC41777FC0500838530 /* b2Joint.cpp */; }; - 1A0C0DFC1777FC0500838530 /* b2MouseJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0DC61777FC0500838530 /* b2MouseJoint.cpp */; }; - 1A0C0DFD1777FC0500838530 /* b2PrismaticJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0DC81777FC0500838530 /* b2PrismaticJoint.cpp */; }; - 1A0C0DFE1777FC0500838530 /* b2PulleyJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0DCA1777FC0500838530 /* b2PulleyJoint.cpp */; }; - 1A0C0DFF1777FC0500838530 /* b2RevoluteJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0DCC1777FC0500838530 /* b2RevoluteJoint.cpp */; }; - 1A0C0E001777FC0500838530 /* b2RopeJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0DCE1777FC0500838530 /* b2RopeJoint.cpp */; }; - 1A0C0E011777FC0500838530 /* b2WeldJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0DD01777FC0500838530 /* b2WeldJoint.cpp */; }; - 1A0C0E021777FC0500838530 /* b2WheelJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0DD21777FC0500838530 /* b2WheelJoint.cpp */; }; - 1A0C0E031777FC0500838530 /* b2Rope.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0DD51777FC0500838530 /* b2Rope.cpp */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 1A0C0D621777FBBE00838530 /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = "include/${PRODUCT_NAME}"; - dstSubfolderSpec = 16; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 1A0C0D641777FBBE00838530 /* libBox2D.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libBox2D.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 1A0C0D671777FBBE00838530 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; - 1A0C0D751777FC0500838530 /* Box2D.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Box2D.h; path = ../Box2D.h; sourceTree = "<group>"; }; - 1A0C0D771777FC0500838530 /* b2BroadPhase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2BroadPhase.cpp; sourceTree = "<group>"; }; - 1A0C0D781777FC0500838530 /* b2BroadPhase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2BroadPhase.h; sourceTree = "<group>"; }; - 1A0C0D791777FC0500838530 /* b2CollideCircle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2CollideCircle.cpp; sourceTree = "<group>"; }; - 1A0C0D7A1777FC0500838530 /* b2CollideEdge.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2CollideEdge.cpp; sourceTree = "<group>"; }; - 1A0C0D7B1777FC0500838530 /* b2CollidePolygon.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2CollidePolygon.cpp; sourceTree = "<group>"; }; - 1A0C0D7C1777FC0500838530 /* b2Collision.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2Collision.cpp; sourceTree = "<group>"; }; - 1A0C0D7D1777FC0500838530 /* b2Collision.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2Collision.h; sourceTree = "<group>"; }; - 1A0C0D7E1777FC0500838530 /* b2Distance.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2Distance.cpp; sourceTree = "<group>"; }; - 1A0C0D7F1777FC0500838530 /* b2Distance.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2Distance.h; sourceTree = "<group>"; }; - 1A0C0D801777FC0500838530 /* b2DynamicTree.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2DynamicTree.cpp; sourceTree = "<group>"; }; - 1A0C0D811777FC0500838530 /* b2DynamicTree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2DynamicTree.h; sourceTree = "<group>"; }; - 1A0C0D821777FC0500838530 /* b2TimeOfImpact.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2TimeOfImpact.cpp; sourceTree = "<group>"; }; - 1A0C0D831777FC0500838530 /* b2TimeOfImpact.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2TimeOfImpact.h; sourceTree = "<group>"; }; - 1A0C0D851777FC0500838530 /* b2ChainShape.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2ChainShape.cpp; sourceTree = "<group>"; }; - 1A0C0D861777FC0500838530 /* b2ChainShape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2ChainShape.h; sourceTree = "<group>"; }; - 1A0C0D871777FC0500838530 /* b2CircleShape.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2CircleShape.cpp; sourceTree = "<group>"; }; - 1A0C0D881777FC0500838530 /* b2CircleShape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2CircleShape.h; sourceTree = "<group>"; }; - 1A0C0D891777FC0500838530 /* b2EdgeShape.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2EdgeShape.cpp; sourceTree = "<group>"; }; - 1A0C0D8A1777FC0500838530 /* b2EdgeShape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2EdgeShape.h; sourceTree = "<group>"; }; - 1A0C0D8B1777FC0500838530 /* b2PolygonShape.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2PolygonShape.cpp; sourceTree = "<group>"; }; - 1A0C0D8C1777FC0500838530 /* b2PolygonShape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2PolygonShape.h; sourceTree = "<group>"; }; - 1A0C0D8D1777FC0500838530 /* b2Shape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2Shape.h; sourceTree = "<group>"; }; - 1A0C0D8F1777FC0500838530 /* b2BlockAllocator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2BlockAllocator.cpp; sourceTree = "<group>"; }; - 1A0C0D901777FC0500838530 /* b2BlockAllocator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2BlockAllocator.h; sourceTree = "<group>"; }; - 1A0C0D911777FC0500838530 /* b2Draw.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2Draw.cpp; sourceTree = "<group>"; }; - 1A0C0D921777FC0500838530 /* b2Draw.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2Draw.h; sourceTree = "<group>"; }; - 1A0C0D931777FC0500838530 /* b2GrowableStack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2GrowableStack.h; sourceTree = "<group>"; }; - 1A0C0D941777FC0500838530 /* b2Math.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2Math.cpp; sourceTree = "<group>"; }; - 1A0C0D951777FC0500838530 /* b2Math.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2Math.h; sourceTree = "<group>"; }; - 1A0C0D961777FC0500838530 /* b2Settings.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2Settings.cpp; sourceTree = "<group>"; }; - 1A0C0D971777FC0500838530 /* b2Settings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2Settings.h; sourceTree = "<group>"; }; - 1A0C0D981777FC0500838530 /* b2StackAllocator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2StackAllocator.cpp; sourceTree = "<group>"; }; - 1A0C0D991777FC0500838530 /* b2StackAllocator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2StackAllocator.h; sourceTree = "<group>"; }; - 1A0C0D9A1777FC0500838530 /* b2Timer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2Timer.cpp; sourceTree = "<group>"; }; - 1A0C0D9B1777FC0500838530 /* b2Timer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2Timer.h; sourceTree = "<group>"; }; - 1A0C0D9D1777FC0500838530 /* b2Body.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2Body.cpp; sourceTree = "<group>"; }; - 1A0C0D9E1777FC0500838530 /* b2Body.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2Body.h; sourceTree = "<group>"; }; - 1A0C0D9F1777FC0500838530 /* b2ContactManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2ContactManager.cpp; sourceTree = "<group>"; }; - 1A0C0DA01777FC0500838530 /* b2ContactManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2ContactManager.h; sourceTree = "<group>"; }; - 1A0C0DA11777FC0500838530 /* b2Fixture.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2Fixture.cpp; sourceTree = "<group>"; }; - 1A0C0DA21777FC0500838530 /* b2Fixture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2Fixture.h; sourceTree = "<group>"; }; - 1A0C0DA31777FC0500838530 /* b2Island.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2Island.cpp; sourceTree = "<group>"; }; - 1A0C0DA41777FC0500838530 /* b2Island.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2Island.h; sourceTree = "<group>"; }; - 1A0C0DA51777FC0500838530 /* b2TimeStep.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2TimeStep.h; sourceTree = "<group>"; }; - 1A0C0DA61777FC0500838530 /* b2World.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2World.cpp; sourceTree = "<group>"; }; - 1A0C0DA71777FC0500838530 /* b2World.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2World.h; sourceTree = "<group>"; }; - 1A0C0DA81777FC0500838530 /* b2WorldCallbacks.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2WorldCallbacks.cpp; sourceTree = "<group>"; }; - 1A0C0DA91777FC0500838530 /* b2WorldCallbacks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2WorldCallbacks.h; sourceTree = "<group>"; }; - 1A0C0DAB1777FC0500838530 /* b2ChainAndCircleContact.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2ChainAndCircleContact.cpp; sourceTree = "<group>"; }; - 1A0C0DAC1777FC0500838530 /* b2ChainAndCircleContact.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2ChainAndCircleContact.h; sourceTree = "<group>"; }; - 1A0C0DAD1777FC0500838530 /* b2ChainAndPolygonContact.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2ChainAndPolygonContact.cpp; sourceTree = "<group>"; }; - 1A0C0DAE1777FC0500838530 /* b2ChainAndPolygonContact.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2ChainAndPolygonContact.h; sourceTree = "<group>"; }; - 1A0C0DAF1777FC0500838530 /* b2CircleContact.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2CircleContact.cpp; sourceTree = "<group>"; }; - 1A0C0DB01777FC0500838530 /* b2CircleContact.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2CircleContact.h; sourceTree = "<group>"; }; - 1A0C0DB11777FC0500838530 /* b2Contact.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2Contact.cpp; sourceTree = "<group>"; }; - 1A0C0DB21777FC0500838530 /* b2Contact.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2Contact.h; sourceTree = "<group>"; }; - 1A0C0DB31777FC0500838530 /* b2ContactSolver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2ContactSolver.cpp; sourceTree = "<group>"; }; - 1A0C0DB41777FC0500838530 /* b2ContactSolver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2ContactSolver.h; sourceTree = "<group>"; }; - 1A0C0DB51777FC0500838530 /* b2EdgeAndCircleContact.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2EdgeAndCircleContact.cpp; sourceTree = "<group>"; }; - 1A0C0DB61777FC0500838530 /* b2EdgeAndCircleContact.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2EdgeAndCircleContact.h; sourceTree = "<group>"; }; - 1A0C0DB71777FC0500838530 /* b2EdgeAndPolygonContact.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2EdgeAndPolygonContact.cpp; sourceTree = "<group>"; }; - 1A0C0DB81777FC0500838530 /* b2EdgeAndPolygonContact.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2EdgeAndPolygonContact.h; sourceTree = "<group>"; }; - 1A0C0DB91777FC0500838530 /* b2PolygonAndCircleContact.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2PolygonAndCircleContact.cpp; sourceTree = "<group>"; }; - 1A0C0DBA1777FC0500838530 /* b2PolygonAndCircleContact.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2PolygonAndCircleContact.h; sourceTree = "<group>"; }; - 1A0C0DBB1777FC0500838530 /* b2PolygonContact.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2PolygonContact.cpp; sourceTree = "<group>"; }; - 1A0C0DBC1777FC0500838530 /* b2PolygonContact.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2PolygonContact.h; sourceTree = "<group>"; }; - 1A0C0DBE1777FC0500838530 /* b2DistanceJoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2DistanceJoint.cpp; sourceTree = "<group>"; }; - 1A0C0DBF1777FC0500838530 /* b2DistanceJoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2DistanceJoint.h; sourceTree = "<group>"; }; - 1A0C0DC01777FC0500838530 /* b2FrictionJoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2FrictionJoint.cpp; sourceTree = "<group>"; }; - 1A0C0DC11777FC0500838530 /* b2FrictionJoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2FrictionJoint.h; sourceTree = "<group>"; }; - 1A0C0DC21777FC0500838530 /* b2GearJoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2GearJoint.cpp; sourceTree = "<group>"; }; - 1A0C0DC31777FC0500838530 /* b2GearJoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2GearJoint.h; sourceTree = "<group>"; }; - 1A0C0DC41777FC0500838530 /* b2Joint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2Joint.cpp; sourceTree = "<group>"; }; - 1A0C0DC51777FC0500838530 /* b2Joint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2Joint.h; sourceTree = "<group>"; }; - 1A0C0DC61777FC0500838530 /* b2MouseJoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2MouseJoint.cpp; sourceTree = "<group>"; }; - 1A0C0DC71777FC0500838530 /* b2MouseJoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2MouseJoint.h; sourceTree = "<group>"; }; - 1A0C0DC81777FC0500838530 /* b2PrismaticJoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2PrismaticJoint.cpp; sourceTree = "<group>"; }; - 1A0C0DC91777FC0500838530 /* b2PrismaticJoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2PrismaticJoint.h; sourceTree = "<group>"; }; - 1A0C0DCA1777FC0500838530 /* b2PulleyJoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2PulleyJoint.cpp; sourceTree = "<group>"; }; - 1A0C0DCB1777FC0500838530 /* b2PulleyJoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2PulleyJoint.h; sourceTree = "<group>"; }; - 1A0C0DCC1777FC0500838530 /* b2RevoluteJoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2RevoluteJoint.cpp; sourceTree = "<group>"; }; - 1A0C0DCD1777FC0500838530 /* b2RevoluteJoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2RevoluteJoint.h; sourceTree = "<group>"; }; - 1A0C0DCE1777FC0500838530 /* b2RopeJoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2RopeJoint.cpp; sourceTree = "<group>"; }; - 1A0C0DCF1777FC0500838530 /* b2RopeJoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2RopeJoint.h; sourceTree = "<group>"; }; - 1A0C0DD01777FC0500838530 /* b2WeldJoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2WeldJoint.cpp; sourceTree = "<group>"; }; - 1A0C0DD11777FC0500838530 /* b2WeldJoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2WeldJoint.h; sourceTree = "<group>"; }; - 1A0C0DD21777FC0500838530 /* b2WheelJoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2WheelJoint.cpp; sourceTree = "<group>"; }; - 1A0C0DD31777FC0500838530 /* b2WheelJoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2WheelJoint.h; sourceTree = "<group>"; }; - 1A0C0DD51777FC0500838530 /* b2Rope.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2Rope.cpp; sourceTree = "<group>"; }; - 1A0C0DD61777FC0500838530 /* b2Rope.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2Rope.h; sourceTree = "<group>"; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 1A0C0D611777FBBE00838530 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 1A0C0D681777FBBE00838530 /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 1A0C0D5B1777FBBE00838530 = { - isa = PBXGroup; - children = ( - 1A0C0D751777FC0500838530 /* Box2D.h */, - 1A0C0D761777FC0500838530 /* Collision */, - 1A0C0D8E1777FC0500838530 /* Common */, - 1A0C0D9C1777FC0500838530 /* Dynamics */, - 1A0C0DD41777FC0500838530 /* Rope */, - 1A0C0D661777FBBE00838530 /* Frameworks */, - 1A0C0D651777FBBE00838530 /* Products */, - ); - sourceTree = "<group>"; - }; - 1A0C0D651777FBBE00838530 /* Products */ = { - isa = PBXGroup; - children = ( - 1A0C0D641777FBBE00838530 /* libBox2D.a */, - ); - name = Products; - sourceTree = "<group>"; - }; - 1A0C0D661777FBBE00838530 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 1A0C0D671777FBBE00838530 /* Foundation.framework */, - ); - name = Frameworks; - sourceTree = "<group>"; - }; - 1A0C0D761777FC0500838530 /* Collision */ = { - isa = PBXGroup; - children = ( - 1A0C0D771777FC0500838530 /* b2BroadPhase.cpp */, - 1A0C0D781777FC0500838530 /* b2BroadPhase.h */, - 1A0C0D791777FC0500838530 /* b2CollideCircle.cpp */, - 1A0C0D7A1777FC0500838530 /* b2CollideEdge.cpp */, - 1A0C0D7B1777FC0500838530 /* b2CollidePolygon.cpp */, - 1A0C0D7C1777FC0500838530 /* b2Collision.cpp */, - 1A0C0D7D1777FC0500838530 /* b2Collision.h */, - 1A0C0D7E1777FC0500838530 /* b2Distance.cpp */, - 1A0C0D7F1777FC0500838530 /* b2Distance.h */, - 1A0C0D801777FC0500838530 /* b2DynamicTree.cpp */, - 1A0C0D811777FC0500838530 /* b2DynamicTree.h */, - 1A0C0D821777FC0500838530 /* b2TimeOfImpact.cpp */, - 1A0C0D831777FC0500838530 /* b2TimeOfImpact.h */, - 1A0C0D841777FC0500838530 /* Shapes */, - ); - name = Collision; - path = ../Collision; - sourceTree = "<group>"; - }; - 1A0C0D841777FC0500838530 /* Shapes */ = { - isa = PBXGroup; - children = ( - 1A0C0D851777FC0500838530 /* b2ChainShape.cpp */, - 1A0C0D861777FC0500838530 /* b2ChainShape.h */, - 1A0C0D871777FC0500838530 /* b2CircleShape.cpp */, - 1A0C0D881777FC0500838530 /* b2CircleShape.h */, - 1A0C0D891777FC0500838530 /* b2EdgeShape.cpp */, - 1A0C0D8A1777FC0500838530 /* b2EdgeShape.h */, - 1A0C0D8B1777FC0500838530 /* b2PolygonShape.cpp */, - 1A0C0D8C1777FC0500838530 /* b2PolygonShape.h */, - 1A0C0D8D1777FC0500838530 /* b2Shape.h */, - ); - path = Shapes; - sourceTree = "<group>"; - }; - 1A0C0D8E1777FC0500838530 /* Common */ = { - isa = PBXGroup; - children = ( - 1A0C0D8F1777FC0500838530 /* b2BlockAllocator.cpp */, - 1A0C0D901777FC0500838530 /* b2BlockAllocator.h */, - 1A0C0D911777FC0500838530 /* b2Draw.cpp */, - 1A0C0D921777FC0500838530 /* b2Draw.h */, - 1A0C0D931777FC0500838530 /* b2GrowableStack.h */, - 1A0C0D941777FC0500838530 /* b2Math.cpp */, - 1A0C0D951777FC0500838530 /* b2Math.h */, - 1A0C0D961777FC0500838530 /* b2Settings.cpp */, - 1A0C0D971777FC0500838530 /* b2Settings.h */, - 1A0C0D981777FC0500838530 /* b2StackAllocator.cpp */, - 1A0C0D991777FC0500838530 /* b2StackAllocator.h */, - 1A0C0D9A1777FC0500838530 /* b2Timer.cpp */, - 1A0C0D9B1777FC0500838530 /* b2Timer.h */, - ); - name = Common; - path = ../Common; - sourceTree = "<group>"; - }; - 1A0C0D9C1777FC0500838530 /* Dynamics */ = { - isa = PBXGroup; - children = ( - 1A0C0D9D1777FC0500838530 /* b2Body.cpp */, - 1A0C0D9E1777FC0500838530 /* b2Body.h */, - 1A0C0D9F1777FC0500838530 /* b2ContactManager.cpp */, - 1A0C0DA01777FC0500838530 /* b2ContactManager.h */, - 1A0C0DA11777FC0500838530 /* b2Fixture.cpp */, - 1A0C0DA21777FC0500838530 /* b2Fixture.h */, - 1A0C0DA31777FC0500838530 /* b2Island.cpp */, - 1A0C0DA41777FC0500838530 /* b2Island.h */, - 1A0C0DA51777FC0500838530 /* b2TimeStep.h */, - 1A0C0DA61777FC0500838530 /* b2World.cpp */, - 1A0C0DA71777FC0500838530 /* b2World.h */, - 1A0C0DA81777FC0500838530 /* b2WorldCallbacks.cpp */, - 1A0C0DA91777FC0500838530 /* b2WorldCallbacks.h */, - 1A0C0DAA1777FC0500838530 /* Contacts */, - 1A0C0DBD1777FC0500838530 /* Joints */, - ); - name = Dynamics; - path = ../Dynamics; - sourceTree = "<group>"; - }; - 1A0C0DAA1777FC0500838530 /* Contacts */ = { - isa = PBXGroup; - children = ( - 1A0C0DAB1777FC0500838530 /* b2ChainAndCircleContact.cpp */, - 1A0C0DAC1777FC0500838530 /* b2ChainAndCircleContact.h */, - 1A0C0DAD1777FC0500838530 /* b2ChainAndPolygonContact.cpp */, - 1A0C0DAE1777FC0500838530 /* b2ChainAndPolygonContact.h */, - 1A0C0DAF1777FC0500838530 /* b2CircleContact.cpp */, - 1A0C0DB01777FC0500838530 /* b2CircleContact.h */, - 1A0C0DB11777FC0500838530 /* b2Contact.cpp */, - 1A0C0DB21777FC0500838530 /* b2Contact.h */, - 1A0C0DB31777FC0500838530 /* b2ContactSolver.cpp */, - 1A0C0DB41777FC0500838530 /* b2ContactSolver.h */, - 1A0C0DB51777FC0500838530 /* b2EdgeAndCircleContact.cpp */, - 1A0C0DB61777FC0500838530 /* b2EdgeAndCircleContact.h */, - 1A0C0DB71777FC0500838530 /* b2EdgeAndPolygonContact.cpp */, - 1A0C0DB81777FC0500838530 /* b2EdgeAndPolygonContact.h */, - 1A0C0DB91777FC0500838530 /* b2PolygonAndCircleContact.cpp */, - 1A0C0DBA1777FC0500838530 /* b2PolygonAndCircleContact.h */, - 1A0C0DBB1777FC0500838530 /* b2PolygonContact.cpp */, - 1A0C0DBC1777FC0500838530 /* b2PolygonContact.h */, - ); - path = Contacts; - sourceTree = "<group>"; - }; - 1A0C0DBD1777FC0500838530 /* Joints */ = { - isa = PBXGroup; - children = ( - 1A0C0DBE1777FC0500838530 /* b2DistanceJoint.cpp */, - 1A0C0DBF1777FC0500838530 /* b2DistanceJoint.h */, - 1A0C0DC01777FC0500838530 /* b2FrictionJoint.cpp */, - 1A0C0DC11777FC0500838530 /* b2FrictionJoint.h */, - 1A0C0DC21777FC0500838530 /* b2GearJoint.cpp */, - 1A0C0DC31777FC0500838530 /* b2GearJoint.h */, - 1A0C0DC41777FC0500838530 /* b2Joint.cpp */, - 1A0C0DC51777FC0500838530 /* b2Joint.h */, - 1A0C0DC61777FC0500838530 /* b2MouseJoint.cpp */, - 1A0C0DC71777FC0500838530 /* b2MouseJoint.h */, - 1A0C0DC81777FC0500838530 /* b2PrismaticJoint.cpp */, - 1A0C0DC91777FC0500838530 /* b2PrismaticJoint.h */, - 1A0C0DCA1777FC0500838530 /* b2PulleyJoint.cpp */, - 1A0C0DCB1777FC0500838530 /* b2PulleyJoint.h */, - 1A0C0DCC1777FC0500838530 /* b2RevoluteJoint.cpp */, - 1A0C0DCD1777FC0500838530 /* b2RevoluteJoint.h */, - 1A0C0DCE1777FC0500838530 /* b2RopeJoint.cpp */, - 1A0C0DCF1777FC0500838530 /* b2RopeJoint.h */, - 1A0C0DD01777FC0500838530 /* b2WeldJoint.cpp */, - 1A0C0DD11777FC0500838530 /* b2WeldJoint.h */, - 1A0C0DD21777FC0500838530 /* b2WheelJoint.cpp */, - 1A0C0DD31777FC0500838530 /* b2WheelJoint.h */, - ); - path = Joints; - sourceTree = "<group>"; - }; - 1A0C0DD41777FC0500838530 /* Rope */ = { - isa = PBXGroup; - children = ( - 1A0C0DD51777FC0500838530 /* b2Rope.cpp */, - 1A0C0DD61777FC0500838530 /* b2Rope.h */, - ); - name = Rope; - path = ../Rope; - sourceTree = "<group>"; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 1A0C0D631777FBBE00838530 /* Box2D */ = { - isa = PBXNativeTarget; - buildConfigurationList = 1A0C0D721777FBBE00838530 /* Build configuration list for PBXNativeTarget "Box2D" */; - buildPhases = ( - 1A0C0D601777FBBE00838530 /* Sources */, - 1A0C0D611777FBBE00838530 /* Frameworks */, - 1A0C0D621777FBBE00838530 /* CopyFiles */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Box2D; - productName = Box2D; - productReference = 1A0C0D641777FBBE00838530 /* libBox2D.a */; - productType = "com.apple.product-type.library.static"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 1A0C0D5C1777FBBE00838530 /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0460; - }; - buildConfigurationList = 1A0C0D5F1777FBBE00838530 /* Build configuration list for PBXProject "Box2D" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - ); - mainGroup = 1A0C0D5B1777FBBE00838530; - productRefGroup = 1A0C0D651777FBBE00838530 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 1A0C0D631777FBBE00838530 /* Box2D */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXSourcesBuildPhase section */ - 1A0C0D601777FBBE00838530 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 1A0C0DD71777FC0500838530 /* b2BroadPhase.cpp in Sources */, - 1A0C0DD81777FC0500838530 /* b2CollideCircle.cpp in Sources */, - 1A0C0DD91777FC0500838530 /* b2CollideEdge.cpp in Sources */, - 1A0C0DDA1777FC0500838530 /* b2CollidePolygon.cpp in Sources */, - 1A0C0DDB1777FC0500838530 /* b2Collision.cpp in Sources */, - 1A0C0DDC1777FC0500838530 /* b2Distance.cpp in Sources */, - 1A0C0DDD1777FC0500838530 /* b2DynamicTree.cpp in Sources */, - 1A0C0DDE1777FC0500838530 /* b2TimeOfImpact.cpp in Sources */, - 1A0C0DDF1777FC0500838530 /* b2ChainShape.cpp in Sources */, - 1A0C0DE01777FC0500838530 /* b2CircleShape.cpp in Sources */, - 1A0C0DE11777FC0500838530 /* b2EdgeShape.cpp in Sources */, - 1A0C0DE21777FC0500838530 /* b2PolygonShape.cpp in Sources */, - 1A0C0DE31777FC0500838530 /* b2BlockAllocator.cpp in Sources */, - 1A0C0DE41777FC0500838530 /* b2Draw.cpp in Sources */, - 1A0C0DE51777FC0500838530 /* b2Math.cpp in Sources */, - 1A0C0DE61777FC0500838530 /* b2Settings.cpp in Sources */, - 1A0C0DE71777FC0500838530 /* b2StackAllocator.cpp in Sources */, - 1A0C0DE81777FC0500838530 /* b2Timer.cpp in Sources */, - 1A0C0DE91777FC0500838530 /* b2Body.cpp in Sources */, - 1A0C0DEA1777FC0500838530 /* b2ContactManager.cpp in Sources */, - 1A0C0DEB1777FC0500838530 /* b2Fixture.cpp in Sources */, - 1A0C0DEC1777FC0500838530 /* b2Island.cpp in Sources */, - 1A0C0DED1777FC0500838530 /* b2World.cpp in Sources */, - 1A0C0DEE1777FC0500838530 /* b2WorldCallbacks.cpp in Sources */, - 1A0C0DEF1777FC0500838530 /* b2ChainAndCircleContact.cpp in Sources */, - 1A0C0DF01777FC0500838530 /* b2ChainAndPolygonContact.cpp in Sources */, - 1A0C0DF11777FC0500838530 /* b2CircleContact.cpp in Sources */, - 1A0C0DF21777FC0500838530 /* b2Contact.cpp in Sources */, - 1A0C0DF31777FC0500838530 /* b2ContactSolver.cpp in Sources */, - 1A0C0DF41777FC0500838530 /* b2EdgeAndCircleContact.cpp in Sources */, - 1A0C0DF51777FC0500838530 /* b2EdgeAndPolygonContact.cpp in Sources */, - 1A0C0DF61777FC0500838530 /* b2PolygonAndCircleContact.cpp in Sources */, - 1A0C0DF71777FC0500838530 /* b2PolygonContact.cpp in Sources */, - 1A0C0DF81777FC0500838530 /* b2DistanceJoint.cpp in Sources */, - 1A0C0DF91777FC0500838530 /* b2FrictionJoint.cpp in Sources */, - 1A0C0DFA1777FC0500838530 /* b2GearJoint.cpp in Sources */, - 1A0C0DFB1777FC0500838530 /* b2Joint.cpp in Sources */, - 1A0C0DFC1777FC0500838530 /* b2MouseJoint.cpp in Sources */, - 1A0C0DFD1777FC0500838530 /* b2PrismaticJoint.cpp in Sources */, - 1A0C0DFE1777FC0500838530 /* b2PulleyJoint.cpp in Sources */, - 1A0C0DFF1777FC0500838530 /* b2RevoluteJoint.cpp in Sources */, - 1A0C0E001777FC0500838530 /* b2RopeJoint.cpp in Sources */, - 1A0C0E011777FC0500838530 /* b2WeldJoint.cpp in Sources */, - 1A0C0E021777FC0500838530 /* b2WheelJoint.cpp in Sources */, - 1A0C0E031777FC0500838530 /* b2Rope.cpp in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 1A0C0D701777FBBE00838530 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 6.1; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - }; - name = Debug; - }; - 1A0C0D711777FBBE00838530 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 6.1; - SDKROOT = iphoneos; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 1A0C0D731777FBBE00838530 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; - DSTROOT = /tmp/Box2D.dst; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "Box2D-Prefix.pch"; - HEADER_SEARCH_PATHS = "\"$(SRCROOT)/../..\""; - IPHONEOS_DEPLOYMENT_TARGET = 5.0; - ONLY_ACTIVE_ARCH = YES; - OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - USER_HEADER_SEARCH_PATHS = ""; - }; - name = Debug; - }; - 1A0C0D741777FBBE00838530 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; - DSTROOT = /tmp/Box2D.dst; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "Box2D-Prefix.pch"; - HEADER_SEARCH_PATHS = "\"$(SRCROOT)/../..\""; - IPHONEOS_DEPLOYMENT_TARGET = 5.0; - ONLY_ACTIVE_ARCH = YES; - OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - USER_HEADER_SEARCH_PATHS = ""; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 1A0C0D5F1777FBBE00838530 /* Build configuration list for PBXProject "Box2D" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1A0C0D701777FBBE00838530 /* Debug */, - 1A0C0D711777FBBE00838530 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 1A0C0D721777FBBE00838530 /* Build configuration list for PBXNativeTarget "Box2D" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1A0C0D731777FBBE00838530 /* Debug */, - 1A0C0D741777FBBE00838530 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 1A0C0D5C1777FBBE00838530 /* Project object */; -} diff --git a/external/Box2D/proj.mac/Box2D-Prefix.pch b/external/Box2D/proj.mac/Box2D-Prefix.pch deleted file mode 100644 index c6446fa492..0000000000 --- a/external/Box2D/proj.mac/Box2D-Prefix.pch +++ /dev/null @@ -1,7 +0,0 @@ -// -// Prefix header for all source files of the 'Box2D' target in the 'Box2D' project -// - -#ifdef __OBJC__ - #import <Foundation/Foundation.h> -#endif diff --git a/external/Box2D/proj.mac/Box2D.xcodeproj/project.pbxproj b/external/Box2D/proj.mac/Box2D.xcodeproj/project.pbxproj deleted file mode 100644 index 046399629c..0000000000 --- a/external/Box2D/proj.mac/Box2D.xcodeproj/project.pbxproj +++ /dev/null @@ -1,566 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 1A0C0D681777FBBE00838530 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A0C0D671777FBBE00838530 /* Foundation.framework */; }; - 1A0C0DD71777FC0500838530 /* b2BroadPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0D771777FC0500838530 /* b2BroadPhase.cpp */; }; - 1A0C0DD81777FC0500838530 /* b2CollideCircle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0D791777FC0500838530 /* b2CollideCircle.cpp */; }; - 1A0C0DD91777FC0500838530 /* b2CollideEdge.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0D7A1777FC0500838530 /* b2CollideEdge.cpp */; }; - 1A0C0DDA1777FC0500838530 /* b2CollidePolygon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0D7B1777FC0500838530 /* b2CollidePolygon.cpp */; }; - 1A0C0DDB1777FC0500838530 /* b2Collision.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0D7C1777FC0500838530 /* b2Collision.cpp */; }; - 1A0C0DDC1777FC0500838530 /* b2Distance.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0D7E1777FC0500838530 /* b2Distance.cpp */; }; - 1A0C0DDD1777FC0500838530 /* b2DynamicTree.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0D801777FC0500838530 /* b2DynamicTree.cpp */; }; - 1A0C0DDE1777FC0500838530 /* b2TimeOfImpact.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0D821777FC0500838530 /* b2TimeOfImpact.cpp */; }; - 1A0C0DDF1777FC0500838530 /* b2ChainShape.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0D851777FC0500838530 /* b2ChainShape.cpp */; }; - 1A0C0DE01777FC0500838530 /* b2CircleShape.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0D871777FC0500838530 /* b2CircleShape.cpp */; }; - 1A0C0DE11777FC0500838530 /* b2EdgeShape.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0D891777FC0500838530 /* b2EdgeShape.cpp */; }; - 1A0C0DE21777FC0500838530 /* b2PolygonShape.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0D8B1777FC0500838530 /* b2PolygonShape.cpp */; }; - 1A0C0DE31777FC0500838530 /* b2BlockAllocator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0D8F1777FC0500838530 /* b2BlockAllocator.cpp */; }; - 1A0C0DE41777FC0500838530 /* b2Draw.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0D911777FC0500838530 /* b2Draw.cpp */; }; - 1A0C0DE51777FC0500838530 /* b2Math.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0D941777FC0500838530 /* b2Math.cpp */; }; - 1A0C0DE61777FC0500838530 /* b2Settings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0D961777FC0500838530 /* b2Settings.cpp */; }; - 1A0C0DE71777FC0500838530 /* b2StackAllocator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0D981777FC0500838530 /* b2StackAllocator.cpp */; }; - 1A0C0DE81777FC0500838530 /* b2Timer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0D9A1777FC0500838530 /* b2Timer.cpp */; }; - 1A0C0DE91777FC0500838530 /* b2Body.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0D9D1777FC0500838530 /* b2Body.cpp */; }; - 1A0C0DEA1777FC0500838530 /* b2ContactManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0D9F1777FC0500838530 /* b2ContactManager.cpp */; }; - 1A0C0DEB1777FC0500838530 /* b2Fixture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0DA11777FC0500838530 /* b2Fixture.cpp */; }; - 1A0C0DEC1777FC0500838530 /* b2Island.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0DA31777FC0500838530 /* b2Island.cpp */; }; - 1A0C0DED1777FC0500838530 /* b2World.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0DA61777FC0500838530 /* b2World.cpp */; }; - 1A0C0DEE1777FC0500838530 /* b2WorldCallbacks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0DA81777FC0500838530 /* b2WorldCallbacks.cpp */; }; - 1A0C0DEF1777FC0500838530 /* b2ChainAndCircleContact.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0DAB1777FC0500838530 /* b2ChainAndCircleContact.cpp */; }; - 1A0C0DF01777FC0500838530 /* b2ChainAndPolygonContact.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0DAD1777FC0500838530 /* b2ChainAndPolygonContact.cpp */; }; - 1A0C0DF11777FC0500838530 /* b2CircleContact.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0DAF1777FC0500838530 /* b2CircleContact.cpp */; }; - 1A0C0DF21777FC0500838530 /* b2Contact.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0DB11777FC0500838530 /* b2Contact.cpp */; }; - 1A0C0DF31777FC0500838530 /* b2ContactSolver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0DB31777FC0500838530 /* b2ContactSolver.cpp */; }; - 1A0C0DF41777FC0500838530 /* b2EdgeAndCircleContact.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0DB51777FC0500838530 /* b2EdgeAndCircleContact.cpp */; }; - 1A0C0DF51777FC0500838530 /* b2EdgeAndPolygonContact.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0DB71777FC0500838530 /* b2EdgeAndPolygonContact.cpp */; }; - 1A0C0DF61777FC0500838530 /* b2PolygonAndCircleContact.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0DB91777FC0500838530 /* b2PolygonAndCircleContact.cpp */; }; - 1A0C0DF71777FC0500838530 /* b2PolygonContact.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0DBB1777FC0500838530 /* b2PolygonContact.cpp */; }; - 1A0C0DF81777FC0500838530 /* b2DistanceJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0DBE1777FC0500838530 /* b2DistanceJoint.cpp */; }; - 1A0C0DF91777FC0500838530 /* b2FrictionJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0DC01777FC0500838530 /* b2FrictionJoint.cpp */; }; - 1A0C0DFA1777FC0500838530 /* b2GearJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0DC21777FC0500838530 /* b2GearJoint.cpp */; }; - 1A0C0DFB1777FC0500838530 /* b2Joint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0DC41777FC0500838530 /* b2Joint.cpp */; }; - 1A0C0DFC1777FC0500838530 /* b2MouseJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0DC61777FC0500838530 /* b2MouseJoint.cpp */; }; - 1A0C0DFD1777FC0500838530 /* b2PrismaticJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0DC81777FC0500838530 /* b2PrismaticJoint.cpp */; }; - 1A0C0DFE1777FC0500838530 /* b2PulleyJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0DCA1777FC0500838530 /* b2PulleyJoint.cpp */; }; - 1A0C0DFF1777FC0500838530 /* b2RevoluteJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0DCC1777FC0500838530 /* b2RevoluteJoint.cpp */; }; - 1A0C0E001777FC0500838530 /* b2RopeJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0DCE1777FC0500838530 /* b2RopeJoint.cpp */; }; - 1A0C0E011777FC0500838530 /* b2WeldJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0DD01777FC0500838530 /* b2WeldJoint.cpp */; }; - 1A0C0E021777FC0500838530 /* b2WheelJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0DD21777FC0500838530 /* b2WheelJoint.cpp */; }; - 1A0C0E031777FC0500838530 /* b2Rope.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0DD51777FC0500838530 /* b2Rope.cpp */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 1A0C0D621777FBBE00838530 /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = "include/${PRODUCT_NAME}"; - dstSubfolderSpec = 16; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 1A0C0D641777FBBE00838530 /* libBox2D.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libBox2D.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 1A0C0D671777FBBE00838530 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; - 1A0C0D751777FC0500838530 /* Box2D.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Box2D.h; path = ../Box2D.h; sourceTree = "<group>"; }; - 1A0C0D771777FC0500838530 /* b2BroadPhase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2BroadPhase.cpp; sourceTree = "<group>"; }; - 1A0C0D781777FC0500838530 /* b2BroadPhase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2BroadPhase.h; sourceTree = "<group>"; }; - 1A0C0D791777FC0500838530 /* b2CollideCircle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2CollideCircle.cpp; sourceTree = "<group>"; }; - 1A0C0D7A1777FC0500838530 /* b2CollideEdge.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2CollideEdge.cpp; sourceTree = "<group>"; }; - 1A0C0D7B1777FC0500838530 /* b2CollidePolygon.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2CollidePolygon.cpp; sourceTree = "<group>"; }; - 1A0C0D7C1777FC0500838530 /* b2Collision.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2Collision.cpp; sourceTree = "<group>"; }; - 1A0C0D7D1777FC0500838530 /* b2Collision.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2Collision.h; sourceTree = "<group>"; }; - 1A0C0D7E1777FC0500838530 /* b2Distance.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2Distance.cpp; sourceTree = "<group>"; }; - 1A0C0D7F1777FC0500838530 /* b2Distance.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2Distance.h; sourceTree = "<group>"; }; - 1A0C0D801777FC0500838530 /* b2DynamicTree.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2DynamicTree.cpp; sourceTree = "<group>"; }; - 1A0C0D811777FC0500838530 /* b2DynamicTree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2DynamicTree.h; sourceTree = "<group>"; }; - 1A0C0D821777FC0500838530 /* b2TimeOfImpact.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2TimeOfImpact.cpp; sourceTree = "<group>"; }; - 1A0C0D831777FC0500838530 /* b2TimeOfImpact.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2TimeOfImpact.h; sourceTree = "<group>"; }; - 1A0C0D851777FC0500838530 /* b2ChainShape.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2ChainShape.cpp; sourceTree = "<group>"; }; - 1A0C0D861777FC0500838530 /* b2ChainShape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2ChainShape.h; sourceTree = "<group>"; }; - 1A0C0D871777FC0500838530 /* b2CircleShape.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2CircleShape.cpp; sourceTree = "<group>"; }; - 1A0C0D881777FC0500838530 /* b2CircleShape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2CircleShape.h; sourceTree = "<group>"; }; - 1A0C0D891777FC0500838530 /* b2EdgeShape.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2EdgeShape.cpp; sourceTree = "<group>"; }; - 1A0C0D8A1777FC0500838530 /* b2EdgeShape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2EdgeShape.h; sourceTree = "<group>"; }; - 1A0C0D8B1777FC0500838530 /* b2PolygonShape.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2PolygonShape.cpp; sourceTree = "<group>"; }; - 1A0C0D8C1777FC0500838530 /* b2PolygonShape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2PolygonShape.h; sourceTree = "<group>"; }; - 1A0C0D8D1777FC0500838530 /* b2Shape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2Shape.h; sourceTree = "<group>"; }; - 1A0C0D8F1777FC0500838530 /* b2BlockAllocator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2BlockAllocator.cpp; sourceTree = "<group>"; }; - 1A0C0D901777FC0500838530 /* b2BlockAllocator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2BlockAllocator.h; sourceTree = "<group>"; }; - 1A0C0D911777FC0500838530 /* b2Draw.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2Draw.cpp; sourceTree = "<group>"; }; - 1A0C0D921777FC0500838530 /* b2Draw.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2Draw.h; sourceTree = "<group>"; }; - 1A0C0D931777FC0500838530 /* b2GrowableStack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2GrowableStack.h; sourceTree = "<group>"; }; - 1A0C0D941777FC0500838530 /* b2Math.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2Math.cpp; sourceTree = "<group>"; }; - 1A0C0D951777FC0500838530 /* b2Math.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2Math.h; sourceTree = "<group>"; }; - 1A0C0D961777FC0500838530 /* b2Settings.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2Settings.cpp; sourceTree = "<group>"; }; - 1A0C0D971777FC0500838530 /* b2Settings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2Settings.h; sourceTree = "<group>"; }; - 1A0C0D981777FC0500838530 /* b2StackAllocator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2StackAllocator.cpp; sourceTree = "<group>"; }; - 1A0C0D991777FC0500838530 /* b2StackAllocator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2StackAllocator.h; sourceTree = "<group>"; }; - 1A0C0D9A1777FC0500838530 /* b2Timer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2Timer.cpp; sourceTree = "<group>"; }; - 1A0C0D9B1777FC0500838530 /* b2Timer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2Timer.h; sourceTree = "<group>"; }; - 1A0C0D9D1777FC0500838530 /* b2Body.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2Body.cpp; sourceTree = "<group>"; }; - 1A0C0D9E1777FC0500838530 /* b2Body.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2Body.h; sourceTree = "<group>"; }; - 1A0C0D9F1777FC0500838530 /* b2ContactManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2ContactManager.cpp; sourceTree = "<group>"; }; - 1A0C0DA01777FC0500838530 /* b2ContactManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2ContactManager.h; sourceTree = "<group>"; }; - 1A0C0DA11777FC0500838530 /* b2Fixture.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2Fixture.cpp; sourceTree = "<group>"; }; - 1A0C0DA21777FC0500838530 /* b2Fixture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2Fixture.h; sourceTree = "<group>"; }; - 1A0C0DA31777FC0500838530 /* b2Island.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2Island.cpp; sourceTree = "<group>"; }; - 1A0C0DA41777FC0500838530 /* b2Island.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2Island.h; sourceTree = "<group>"; }; - 1A0C0DA51777FC0500838530 /* b2TimeStep.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2TimeStep.h; sourceTree = "<group>"; }; - 1A0C0DA61777FC0500838530 /* b2World.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2World.cpp; sourceTree = "<group>"; }; - 1A0C0DA71777FC0500838530 /* b2World.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2World.h; sourceTree = "<group>"; }; - 1A0C0DA81777FC0500838530 /* b2WorldCallbacks.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2WorldCallbacks.cpp; sourceTree = "<group>"; }; - 1A0C0DA91777FC0500838530 /* b2WorldCallbacks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2WorldCallbacks.h; sourceTree = "<group>"; }; - 1A0C0DAB1777FC0500838530 /* b2ChainAndCircleContact.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2ChainAndCircleContact.cpp; sourceTree = "<group>"; }; - 1A0C0DAC1777FC0500838530 /* b2ChainAndCircleContact.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2ChainAndCircleContact.h; sourceTree = "<group>"; }; - 1A0C0DAD1777FC0500838530 /* b2ChainAndPolygonContact.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2ChainAndPolygonContact.cpp; sourceTree = "<group>"; }; - 1A0C0DAE1777FC0500838530 /* b2ChainAndPolygonContact.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2ChainAndPolygonContact.h; sourceTree = "<group>"; }; - 1A0C0DAF1777FC0500838530 /* b2CircleContact.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2CircleContact.cpp; sourceTree = "<group>"; }; - 1A0C0DB01777FC0500838530 /* b2CircleContact.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2CircleContact.h; sourceTree = "<group>"; }; - 1A0C0DB11777FC0500838530 /* b2Contact.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2Contact.cpp; sourceTree = "<group>"; }; - 1A0C0DB21777FC0500838530 /* b2Contact.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2Contact.h; sourceTree = "<group>"; }; - 1A0C0DB31777FC0500838530 /* b2ContactSolver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2ContactSolver.cpp; sourceTree = "<group>"; }; - 1A0C0DB41777FC0500838530 /* b2ContactSolver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2ContactSolver.h; sourceTree = "<group>"; }; - 1A0C0DB51777FC0500838530 /* b2EdgeAndCircleContact.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2EdgeAndCircleContact.cpp; sourceTree = "<group>"; }; - 1A0C0DB61777FC0500838530 /* b2EdgeAndCircleContact.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2EdgeAndCircleContact.h; sourceTree = "<group>"; }; - 1A0C0DB71777FC0500838530 /* b2EdgeAndPolygonContact.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2EdgeAndPolygonContact.cpp; sourceTree = "<group>"; }; - 1A0C0DB81777FC0500838530 /* b2EdgeAndPolygonContact.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2EdgeAndPolygonContact.h; sourceTree = "<group>"; }; - 1A0C0DB91777FC0500838530 /* b2PolygonAndCircleContact.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2PolygonAndCircleContact.cpp; sourceTree = "<group>"; }; - 1A0C0DBA1777FC0500838530 /* b2PolygonAndCircleContact.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2PolygonAndCircleContact.h; sourceTree = "<group>"; }; - 1A0C0DBB1777FC0500838530 /* b2PolygonContact.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2PolygonContact.cpp; sourceTree = "<group>"; }; - 1A0C0DBC1777FC0500838530 /* b2PolygonContact.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2PolygonContact.h; sourceTree = "<group>"; }; - 1A0C0DBE1777FC0500838530 /* b2DistanceJoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2DistanceJoint.cpp; sourceTree = "<group>"; }; - 1A0C0DBF1777FC0500838530 /* b2DistanceJoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2DistanceJoint.h; sourceTree = "<group>"; }; - 1A0C0DC01777FC0500838530 /* b2FrictionJoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2FrictionJoint.cpp; sourceTree = "<group>"; }; - 1A0C0DC11777FC0500838530 /* b2FrictionJoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2FrictionJoint.h; sourceTree = "<group>"; }; - 1A0C0DC21777FC0500838530 /* b2GearJoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2GearJoint.cpp; sourceTree = "<group>"; }; - 1A0C0DC31777FC0500838530 /* b2GearJoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2GearJoint.h; sourceTree = "<group>"; }; - 1A0C0DC41777FC0500838530 /* b2Joint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2Joint.cpp; sourceTree = "<group>"; }; - 1A0C0DC51777FC0500838530 /* b2Joint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2Joint.h; sourceTree = "<group>"; }; - 1A0C0DC61777FC0500838530 /* b2MouseJoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2MouseJoint.cpp; sourceTree = "<group>"; }; - 1A0C0DC71777FC0500838530 /* b2MouseJoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2MouseJoint.h; sourceTree = "<group>"; }; - 1A0C0DC81777FC0500838530 /* b2PrismaticJoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2PrismaticJoint.cpp; sourceTree = "<group>"; }; - 1A0C0DC91777FC0500838530 /* b2PrismaticJoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2PrismaticJoint.h; sourceTree = "<group>"; }; - 1A0C0DCA1777FC0500838530 /* b2PulleyJoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2PulleyJoint.cpp; sourceTree = "<group>"; }; - 1A0C0DCB1777FC0500838530 /* b2PulleyJoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2PulleyJoint.h; sourceTree = "<group>"; }; - 1A0C0DCC1777FC0500838530 /* b2RevoluteJoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2RevoluteJoint.cpp; sourceTree = "<group>"; }; - 1A0C0DCD1777FC0500838530 /* b2RevoluteJoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2RevoluteJoint.h; sourceTree = "<group>"; }; - 1A0C0DCE1777FC0500838530 /* b2RopeJoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2RopeJoint.cpp; sourceTree = "<group>"; }; - 1A0C0DCF1777FC0500838530 /* b2RopeJoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2RopeJoint.h; sourceTree = "<group>"; }; - 1A0C0DD01777FC0500838530 /* b2WeldJoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2WeldJoint.cpp; sourceTree = "<group>"; }; - 1A0C0DD11777FC0500838530 /* b2WeldJoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2WeldJoint.h; sourceTree = "<group>"; }; - 1A0C0DD21777FC0500838530 /* b2WheelJoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2WheelJoint.cpp; sourceTree = "<group>"; }; - 1A0C0DD31777FC0500838530 /* b2WheelJoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2WheelJoint.h; sourceTree = "<group>"; }; - 1A0C0DD51777FC0500838530 /* b2Rope.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2Rope.cpp; sourceTree = "<group>"; }; - 1A0C0DD61777FC0500838530 /* b2Rope.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2Rope.h; sourceTree = "<group>"; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 1A0C0D611777FBBE00838530 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 1A0C0D681777FBBE00838530 /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 1A0C0D5B1777FBBE00838530 = { - isa = PBXGroup; - children = ( - 1A0C0D751777FC0500838530 /* Box2D.h */, - 1A0C0D761777FC0500838530 /* Collision */, - 1A0C0D8E1777FC0500838530 /* Common */, - 1A0C0D9C1777FC0500838530 /* Dynamics */, - 1A0C0DD41777FC0500838530 /* Rope */, - 1A0C0D661777FBBE00838530 /* Frameworks */, - 1A0C0D651777FBBE00838530 /* Products */, - ); - sourceTree = "<group>"; - }; - 1A0C0D651777FBBE00838530 /* Products */ = { - isa = PBXGroup; - children = ( - 1A0C0D641777FBBE00838530 /* libBox2D.a */, - ); - name = Products; - sourceTree = "<group>"; - }; - 1A0C0D661777FBBE00838530 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 1A0C0D671777FBBE00838530 /* Foundation.framework */, - ); - name = Frameworks; - sourceTree = "<group>"; - }; - 1A0C0D761777FC0500838530 /* Collision */ = { - isa = PBXGroup; - children = ( - 1A0C0D771777FC0500838530 /* b2BroadPhase.cpp */, - 1A0C0D781777FC0500838530 /* b2BroadPhase.h */, - 1A0C0D791777FC0500838530 /* b2CollideCircle.cpp */, - 1A0C0D7A1777FC0500838530 /* b2CollideEdge.cpp */, - 1A0C0D7B1777FC0500838530 /* b2CollidePolygon.cpp */, - 1A0C0D7C1777FC0500838530 /* b2Collision.cpp */, - 1A0C0D7D1777FC0500838530 /* b2Collision.h */, - 1A0C0D7E1777FC0500838530 /* b2Distance.cpp */, - 1A0C0D7F1777FC0500838530 /* b2Distance.h */, - 1A0C0D801777FC0500838530 /* b2DynamicTree.cpp */, - 1A0C0D811777FC0500838530 /* b2DynamicTree.h */, - 1A0C0D821777FC0500838530 /* b2TimeOfImpact.cpp */, - 1A0C0D831777FC0500838530 /* b2TimeOfImpact.h */, - 1A0C0D841777FC0500838530 /* Shapes */, - ); - name = Collision; - path = ../Collision; - sourceTree = "<group>"; - }; - 1A0C0D841777FC0500838530 /* Shapes */ = { - isa = PBXGroup; - children = ( - 1A0C0D851777FC0500838530 /* b2ChainShape.cpp */, - 1A0C0D861777FC0500838530 /* b2ChainShape.h */, - 1A0C0D871777FC0500838530 /* b2CircleShape.cpp */, - 1A0C0D881777FC0500838530 /* b2CircleShape.h */, - 1A0C0D891777FC0500838530 /* b2EdgeShape.cpp */, - 1A0C0D8A1777FC0500838530 /* b2EdgeShape.h */, - 1A0C0D8B1777FC0500838530 /* b2PolygonShape.cpp */, - 1A0C0D8C1777FC0500838530 /* b2PolygonShape.h */, - 1A0C0D8D1777FC0500838530 /* b2Shape.h */, - ); - path = Shapes; - sourceTree = "<group>"; - }; - 1A0C0D8E1777FC0500838530 /* Common */ = { - isa = PBXGroup; - children = ( - 1A0C0D8F1777FC0500838530 /* b2BlockAllocator.cpp */, - 1A0C0D901777FC0500838530 /* b2BlockAllocator.h */, - 1A0C0D911777FC0500838530 /* b2Draw.cpp */, - 1A0C0D921777FC0500838530 /* b2Draw.h */, - 1A0C0D931777FC0500838530 /* b2GrowableStack.h */, - 1A0C0D941777FC0500838530 /* b2Math.cpp */, - 1A0C0D951777FC0500838530 /* b2Math.h */, - 1A0C0D961777FC0500838530 /* b2Settings.cpp */, - 1A0C0D971777FC0500838530 /* b2Settings.h */, - 1A0C0D981777FC0500838530 /* b2StackAllocator.cpp */, - 1A0C0D991777FC0500838530 /* b2StackAllocator.h */, - 1A0C0D9A1777FC0500838530 /* b2Timer.cpp */, - 1A0C0D9B1777FC0500838530 /* b2Timer.h */, - ); - name = Common; - path = ../Common; - sourceTree = "<group>"; - }; - 1A0C0D9C1777FC0500838530 /* Dynamics */ = { - isa = PBXGroup; - children = ( - 1A0C0D9D1777FC0500838530 /* b2Body.cpp */, - 1A0C0D9E1777FC0500838530 /* b2Body.h */, - 1A0C0D9F1777FC0500838530 /* b2ContactManager.cpp */, - 1A0C0DA01777FC0500838530 /* b2ContactManager.h */, - 1A0C0DA11777FC0500838530 /* b2Fixture.cpp */, - 1A0C0DA21777FC0500838530 /* b2Fixture.h */, - 1A0C0DA31777FC0500838530 /* b2Island.cpp */, - 1A0C0DA41777FC0500838530 /* b2Island.h */, - 1A0C0DA51777FC0500838530 /* b2TimeStep.h */, - 1A0C0DA61777FC0500838530 /* b2World.cpp */, - 1A0C0DA71777FC0500838530 /* b2World.h */, - 1A0C0DA81777FC0500838530 /* b2WorldCallbacks.cpp */, - 1A0C0DA91777FC0500838530 /* b2WorldCallbacks.h */, - 1A0C0DAA1777FC0500838530 /* Contacts */, - 1A0C0DBD1777FC0500838530 /* Joints */, - ); - name = Dynamics; - path = ../Dynamics; - sourceTree = "<group>"; - }; - 1A0C0DAA1777FC0500838530 /* Contacts */ = { - isa = PBXGroup; - children = ( - 1A0C0DAB1777FC0500838530 /* b2ChainAndCircleContact.cpp */, - 1A0C0DAC1777FC0500838530 /* b2ChainAndCircleContact.h */, - 1A0C0DAD1777FC0500838530 /* b2ChainAndPolygonContact.cpp */, - 1A0C0DAE1777FC0500838530 /* b2ChainAndPolygonContact.h */, - 1A0C0DAF1777FC0500838530 /* b2CircleContact.cpp */, - 1A0C0DB01777FC0500838530 /* b2CircleContact.h */, - 1A0C0DB11777FC0500838530 /* b2Contact.cpp */, - 1A0C0DB21777FC0500838530 /* b2Contact.h */, - 1A0C0DB31777FC0500838530 /* b2ContactSolver.cpp */, - 1A0C0DB41777FC0500838530 /* b2ContactSolver.h */, - 1A0C0DB51777FC0500838530 /* b2EdgeAndCircleContact.cpp */, - 1A0C0DB61777FC0500838530 /* b2EdgeAndCircleContact.h */, - 1A0C0DB71777FC0500838530 /* b2EdgeAndPolygonContact.cpp */, - 1A0C0DB81777FC0500838530 /* b2EdgeAndPolygonContact.h */, - 1A0C0DB91777FC0500838530 /* b2PolygonAndCircleContact.cpp */, - 1A0C0DBA1777FC0500838530 /* b2PolygonAndCircleContact.h */, - 1A0C0DBB1777FC0500838530 /* b2PolygonContact.cpp */, - 1A0C0DBC1777FC0500838530 /* b2PolygonContact.h */, - ); - path = Contacts; - sourceTree = "<group>"; - }; - 1A0C0DBD1777FC0500838530 /* Joints */ = { - isa = PBXGroup; - children = ( - 1A0C0DBE1777FC0500838530 /* b2DistanceJoint.cpp */, - 1A0C0DBF1777FC0500838530 /* b2DistanceJoint.h */, - 1A0C0DC01777FC0500838530 /* b2FrictionJoint.cpp */, - 1A0C0DC11777FC0500838530 /* b2FrictionJoint.h */, - 1A0C0DC21777FC0500838530 /* b2GearJoint.cpp */, - 1A0C0DC31777FC0500838530 /* b2GearJoint.h */, - 1A0C0DC41777FC0500838530 /* b2Joint.cpp */, - 1A0C0DC51777FC0500838530 /* b2Joint.h */, - 1A0C0DC61777FC0500838530 /* b2MouseJoint.cpp */, - 1A0C0DC71777FC0500838530 /* b2MouseJoint.h */, - 1A0C0DC81777FC0500838530 /* b2PrismaticJoint.cpp */, - 1A0C0DC91777FC0500838530 /* b2PrismaticJoint.h */, - 1A0C0DCA1777FC0500838530 /* b2PulleyJoint.cpp */, - 1A0C0DCB1777FC0500838530 /* b2PulleyJoint.h */, - 1A0C0DCC1777FC0500838530 /* b2RevoluteJoint.cpp */, - 1A0C0DCD1777FC0500838530 /* b2RevoluteJoint.h */, - 1A0C0DCE1777FC0500838530 /* b2RopeJoint.cpp */, - 1A0C0DCF1777FC0500838530 /* b2RopeJoint.h */, - 1A0C0DD01777FC0500838530 /* b2WeldJoint.cpp */, - 1A0C0DD11777FC0500838530 /* b2WeldJoint.h */, - 1A0C0DD21777FC0500838530 /* b2WheelJoint.cpp */, - 1A0C0DD31777FC0500838530 /* b2WheelJoint.h */, - ); - path = Joints; - sourceTree = "<group>"; - }; - 1A0C0DD41777FC0500838530 /* Rope */ = { - isa = PBXGroup; - children = ( - 1A0C0DD51777FC0500838530 /* b2Rope.cpp */, - 1A0C0DD61777FC0500838530 /* b2Rope.h */, - ); - name = Rope; - path = ../Rope; - sourceTree = "<group>"; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 1A0C0D631777FBBE00838530 /* Box2D */ = { - isa = PBXNativeTarget; - buildConfigurationList = 1A0C0D721777FBBE00838530 /* Build configuration list for PBXNativeTarget "Box2D" */; - buildPhases = ( - 1A0C0D601777FBBE00838530 /* Sources */, - 1A0C0D611777FBBE00838530 /* Frameworks */, - 1A0C0D621777FBBE00838530 /* CopyFiles */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Box2D; - productName = Box2D; - productReference = 1A0C0D641777FBBE00838530 /* libBox2D.a */; - productType = "com.apple.product-type.library.static"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 1A0C0D5C1777FBBE00838530 /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0460; - }; - buildConfigurationList = 1A0C0D5F1777FBBE00838530 /* Build configuration list for PBXProject "Box2D" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - ); - mainGroup = 1A0C0D5B1777FBBE00838530; - productRefGroup = 1A0C0D651777FBBE00838530 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 1A0C0D631777FBBE00838530 /* Box2D */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXSourcesBuildPhase section */ - 1A0C0D601777FBBE00838530 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 1A0C0DD71777FC0500838530 /* b2BroadPhase.cpp in Sources */, - 1A0C0DD81777FC0500838530 /* b2CollideCircle.cpp in Sources */, - 1A0C0DD91777FC0500838530 /* b2CollideEdge.cpp in Sources */, - 1A0C0DDA1777FC0500838530 /* b2CollidePolygon.cpp in Sources */, - 1A0C0DDB1777FC0500838530 /* b2Collision.cpp in Sources */, - 1A0C0DDC1777FC0500838530 /* b2Distance.cpp in Sources */, - 1A0C0DDD1777FC0500838530 /* b2DynamicTree.cpp in Sources */, - 1A0C0DDE1777FC0500838530 /* b2TimeOfImpact.cpp in Sources */, - 1A0C0DDF1777FC0500838530 /* b2ChainShape.cpp in Sources */, - 1A0C0DE01777FC0500838530 /* b2CircleShape.cpp in Sources */, - 1A0C0DE11777FC0500838530 /* b2EdgeShape.cpp in Sources */, - 1A0C0DE21777FC0500838530 /* b2PolygonShape.cpp in Sources */, - 1A0C0DE31777FC0500838530 /* b2BlockAllocator.cpp in Sources */, - 1A0C0DE41777FC0500838530 /* b2Draw.cpp in Sources */, - 1A0C0DE51777FC0500838530 /* b2Math.cpp in Sources */, - 1A0C0DE61777FC0500838530 /* b2Settings.cpp in Sources */, - 1A0C0DE71777FC0500838530 /* b2StackAllocator.cpp in Sources */, - 1A0C0DE81777FC0500838530 /* b2Timer.cpp in Sources */, - 1A0C0DE91777FC0500838530 /* b2Body.cpp in Sources */, - 1A0C0DEA1777FC0500838530 /* b2ContactManager.cpp in Sources */, - 1A0C0DEB1777FC0500838530 /* b2Fixture.cpp in Sources */, - 1A0C0DEC1777FC0500838530 /* b2Island.cpp in Sources */, - 1A0C0DED1777FC0500838530 /* b2World.cpp in Sources */, - 1A0C0DEE1777FC0500838530 /* b2WorldCallbacks.cpp in Sources */, - 1A0C0DEF1777FC0500838530 /* b2ChainAndCircleContact.cpp in Sources */, - 1A0C0DF01777FC0500838530 /* b2ChainAndPolygonContact.cpp in Sources */, - 1A0C0DF11777FC0500838530 /* b2CircleContact.cpp in Sources */, - 1A0C0DF21777FC0500838530 /* b2Contact.cpp in Sources */, - 1A0C0DF31777FC0500838530 /* b2ContactSolver.cpp in Sources */, - 1A0C0DF41777FC0500838530 /* b2EdgeAndCircleContact.cpp in Sources */, - 1A0C0DF51777FC0500838530 /* b2EdgeAndPolygonContact.cpp in Sources */, - 1A0C0DF61777FC0500838530 /* b2PolygonAndCircleContact.cpp in Sources */, - 1A0C0DF71777FC0500838530 /* b2PolygonContact.cpp in Sources */, - 1A0C0DF81777FC0500838530 /* b2DistanceJoint.cpp in Sources */, - 1A0C0DF91777FC0500838530 /* b2FrictionJoint.cpp in Sources */, - 1A0C0DFA1777FC0500838530 /* b2GearJoint.cpp in Sources */, - 1A0C0DFB1777FC0500838530 /* b2Joint.cpp in Sources */, - 1A0C0DFC1777FC0500838530 /* b2MouseJoint.cpp in Sources */, - 1A0C0DFD1777FC0500838530 /* b2PrismaticJoint.cpp in Sources */, - 1A0C0DFE1777FC0500838530 /* b2PulleyJoint.cpp in Sources */, - 1A0C0DFF1777FC0500838530 /* b2RevoluteJoint.cpp in Sources */, - 1A0C0E001777FC0500838530 /* b2RopeJoint.cpp in Sources */, - 1A0C0E011777FC0500838530 /* b2WeldJoint.cpp in Sources */, - 1A0C0E021777FC0500838530 /* b2WheelJoint.cpp in Sources */, - 1A0C0E031777FC0500838530 /* b2Rope.cpp in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 1A0C0D701777FBBE00838530 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; - CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 6.1; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = macosx; - }; - name = Debug; - }; - 1A0C0D711777FBBE00838530 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; - CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = YES; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_PREPROCESSOR_DEFINITIONS = NDEBUG; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 6.1; - SDKROOT = macosx; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 1A0C0D731777FBBE00838530 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - DSTROOT = /tmp/Box2D.dst; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "Box2D-Prefix.pch"; - HEADER_SEARCH_PATHS = "\"$(SRCROOT)/../..\""; - IPHONEOS_DEPLOYMENT_TARGET = 5.0; - ONLY_ACTIVE_ARCH = YES; - OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - USER_HEADER_SEARCH_PATHS = ""; - }; - name = Debug; - }; - 1A0C0D741777FBBE00838530 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - DSTROOT = /tmp/Box2D.dst; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "Box2D-Prefix.pch"; - HEADER_SEARCH_PATHS = "\"$(SRCROOT)/../..\""; - IPHONEOS_DEPLOYMENT_TARGET = 5.0; - ONLY_ACTIVE_ARCH = YES; - OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - USER_HEADER_SEARCH_PATHS = ""; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 1A0C0D5F1777FBBE00838530 /* Build configuration list for PBXProject "Box2D" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1A0C0D701777FBBE00838530 /* Debug */, - 1A0C0D711777FBBE00838530 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 1A0C0D721777FBBE00838530 /* Build configuration list for PBXNativeTarget "Box2D" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1A0C0D731777FBBE00838530 /* Debug */, - 1A0C0D741777FBBE00838530 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 1A0C0D5C1777FBBE00838530 /* Project object */; -} diff --git a/external/Box2D/proj.nacl/Makefile b/external/Box2D/proj.nacl/Makefile deleted file mode 100644 index 56c2fa46dc..0000000000 --- a/external/Box2D/proj.nacl/Makefile +++ /dev/null @@ -1,78 +0,0 @@ -LIBS = - -INCLUDES = -I../.. - -SOURCES = ../Collision/Shapes/b2ChainShape.cpp \ -../Collision/Shapes/b2CircleShape.cpp \ -../Collision/Shapes/b2EdgeShape.cpp \ -../Collision/Shapes/b2PolygonShape.cpp \ -../Collision/b2BroadPhase.cpp \ -../Collision/b2CollideCircle.cpp \ -../Collision/b2CollideEdge.cpp \ -../Collision/b2CollidePolygon.cpp \ -../Collision/b2Collision.cpp \ -../Collision/b2Distance.cpp \ -../Collision/b2DynamicTree.cpp \ -../Collision/b2TimeOfImpact.cpp \ -../Common/b2BlockAllocator.cpp \ -../Common/b2Draw.cpp \ -../Common/b2Math.cpp \ -../Common/b2Settings.cpp \ -../Common/b2StackAllocator.cpp \ -../Common/b2Timer.cpp \ -../Dynamics/Contacts/b2ChainAndCircleContact.cpp \ -../Dynamics/Contacts/b2ChainAndPolygonContact.cpp \ -../Dynamics/Contacts/b2CircleContact.cpp \ -../Dynamics/Contacts/b2Contact.cpp \ -../Dynamics/Contacts/b2ContactSolver.cpp \ -../Dynamics/Contacts/b2EdgeAndCircleContact.cpp \ -../Dynamics/Contacts/b2EdgeAndPolygonContact.cpp \ -../Dynamics/Contacts/b2PolygonAndCircleContact.cpp \ -../Dynamics/Contacts/b2PolygonContact.cpp \ -../Dynamics/Joints/b2DistanceJoint.cpp \ -../Dynamics/Joints/b2FrictionJoint.cpp \ -../Dynamics/Joints/b2GearJoint.cpp \ -../Dynamics/Joints/b2Joint.cpp \ -../Dynamics/Joints/b2MouseJoint.cpp \ -../Dynamics/Joints/b2PrismaticJoint.cpp \ -../Dynamics/Joints/b2PulleyJoint.cpp \ -../Dynamics/Joints/b2RevoluteJoint.cpp \ -../Dynamics/Joints/b2RopeJoint.cpp \ -../Dynamics/Joints/b2WeldJoint.cpp \ -../Dynamics/Joints/b2WheelJoint.cpp \ -../Dynamics/b2Body.cpp \ -../Dynamics/b2ContactManager.cpp \ -../Dynamics/b2Fixture.cpp \ -../Dynamics/b2Island.cpp \ -../Dynamics/b2World.cpp \ -../Dynamics/b2WorldCallbacks.cpp \ -../Rope/b2Rope.cpp - -COCOS_ROOT = ../../../ - -include $(COCOS_ROOT)/cocos2dx/proj.nacl/cocos2dx.mk - -ifeq ($(NACL_ARCH),arm) -# The arm compiler in nacl is more recent and more fussy than the X86 ones. -CXXFLAGS += -Wno-unused-but-set-variable -Wno-maybe-uninitialized -else -CXXFLAGS += -Wno-uninitialized -endif - -ifeq ($(DEBUG), 1) -DEFINES = -D_DEBUG -else -DEFINES = -endif - -TARGET = $(LIB_DIR)/libbox2d.a - -all: $(TARGET) - -$(TARGET): $(OBJECTS) $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(LOG_AR)$(NACL_AR) $(ARFLAGS) $(TARGET) $(OBJECTS) - -$(OBJ_DIR)/%.o: ../%.cpp $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(LOG_CXX)$(NACL_CXX) -MMD $(CXXFLAGS) $(INCLUDES) $(DEFINES) $(VISIBILITY) -c $< -o $@ diff --git a/external/Box2D/proj.qt5/box2d.pro b/external/Box2D/proj.qt5/box2d.pro deleted file mode 100644 index 88d1654ae6..0000000000 --- a/external/Box2D/proj.qt5/box2d.pro +++ /dev/null @@ -1,18 +0,0 @@ - -include(../../../cocos2dx/proj.qt5/common.pri) - -TEMPLATE = lib -CONFIG += static - -SOURCES += $$files(../Collision/Shapes/*.cpp) -SOURCES += $$files(../Collision/*.cpp) -SOURCES += $$files(../Common/*.cpp) -SOURCES += $$files(../Dynamics/Contacts/*.cpp) -SOURCES += $$files(../Dynamics/Joints/*.cpp) -SOURCES += $$files(../Dynamics/*.cpp) -SOURCES += $$files(../Rope/*.cpp) - -INCLUDEPATH += ../.. - -TARGET = $${LIB_OUTPUT_DIR}/box2d - diff --git a/external/Box2D/proj.tizen/.cproject b/external/Box2D/proj.tizen/.cproject deleted file mode 100644 index 7b06756f85..0000000000 --- a/external/Box2D/proj.tizen/.cproject +++ /dev/null @@ -1,326 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage"> - <storageModule moduleId="org.eclipse.cdt.core.settings"> - <cconfiguration id="org.tizen.nativecpp.config.sbi.gcc45.lib.debug.emulator.1855378280"> - <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="org.tizen.nativecpp.config.sbi.gcc45.lib.debug.emulator.1855378280" moduleId="org.eclipse.cdt.core.settings" name="Debug-Tizen-Emulator"> - <externalSettings/> - <extensions> - <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/> - <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - </extensions> - </storageModule> - <storageModule moduleId="cdtBuildSystem" version="4.0.0"> - <configuration artifactExtension="a" artifactName="box2d" buildArtefactType="org.tizen.nativecpp.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.tizen.nativecpp.buildArtefactType.staticLib" cleanCommand="rm -f" description="" errorParsers="org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.CWDLocator;org.eclipse.cdt.core.GmakeErrorParser" id="org.tizen.nativecpp.config.sbi.gcc45.lib.debug.emulator.1855378280" name="Debug-Tizen-Emulator" parent="org.tizen.nativecpp.config.sbi.gcc45.lib.debug.emulator" postannouncebuildStep="" postbuildStep="" preannouncebuildStep="" prebuildStep=""> - <folderInfo id="org.tizen.nativecpp.config.sbi.gcc45.lib.debug.emulator.1855378280." name="/" resourcePath=""> - <toolChain errorParsers="" id="org.tizen.nativecpp.toolchain.sbi.gcc45.lib.debug.emulator.2014007899" name="Tizen Native Toolchain" superClass="org.tizen.nativecpp.toolchain.sbi.gcc45.lib.debug.emulator"> - <targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="org.tizen.nativeide.target.sbi.gnu.platform.base.1067387441" osList="linux,win32" superClass="org.tizen.nativeide.target.sbi.gnu.platform.base"/> - <builder autoBuildTarget="all" buildPath="${workspace_loc:/box2d/Debug-Tizen-Emulator}" enableAutoBuild="true" errorParsers="org.eclipse.cdt.core.GmakeErrorParser;org.eclipse.cdt.core.CWDLocator" id="org.tizen.nativecpp.target.sbi.gnu.builder.1261707379" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Tizen Application Builder" superClass="org.tizen.nativecpp.target.sbi.gnu.builder"/> - <tool command="i386-linux-gnueabi-ar.exe" commandLinePattern="${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}" errorParsers="" id="org.tizen.nativecpp.tool.sbi.gnu.archiver.689316005" name="Archiver" superClass="org.tizen.nativecpp.tool.sbi.gnu.archiver"/> - <tool command="clang++.exe" commandLinePattern="${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}" errorParsers="org.eclipse.cdt.core.GCCErrorParser" id="org.tizen.nativecpp.tool.sbi.gnu.cpp.compiler.1533358351" name="C++ Compiler" superClass="org.tizen.nativecpp.tool.sbi.gnu.cpp.compiler"> - <option id="gnu.cpp.compiler.option.optimization.level.1726560828" name="Optimization Level" superClass="gnu.cpp.compiler.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/> - <option id="sbi.gnu.cpp.compiler.option.debugging.level.1554282679" name="Debug level" superClass="sbi.gnu.cpp.compiler.option.debugging.level" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/> - <option id="sbi.gnu.cpp.compiler.option.debug.applog.1800109419" name="Enable application logging (-D_APP_LOG)" superClass="sbi.gnu.cpp.compiler.option.debug.applog" value="true" valueType="boolean"/> - <option id="sbi.gnu.cpp.compiler.option.796499718" name="Tizen-Target" superClass="sbi.gnu.cpp.compiler.option" valueType="userObjs"> - <listOptionValue builtIn="false" value="tizen-emulator-2.2.native_llvm31.i386.cpp.staticLib"/> - </option> - <option id="gnu.cpp.compiler.option.include.paths.1887202981" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath"> - <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/inc}""/> - <listOptionValue builtIn="false" value="../../.."/> - </option> - <option id="sbi.gnu.cpp.compiler.option.frameworks.cpp.140749819" name="Tizen-Frameworks" superClass="sbi.gnu.cpp.compiler.option.frameworks.cpp" valueType="userObjs"> - <listOptionValue builtIn="false" value="osp-static"/> - </option> - <option id="sbi.gnu.cpp.compiler.option.frameworks_inc.cpp.1250550482" name="Tizen-Frameworks-Include-Path" superClass="sbi.gnu.cpp.compiler.option.frameworks_inc.cpp" valueType="includePath"> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/libxml2""/> - <listOptionValue builtIn="false" value=""C:\tizen-sdk\library""/> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include""/> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/osp""/> - </option> - <option id="sbi.gnu.cpp.compiler.option.frameworks_cflags.cpp.1942713160" name="Tizen-Frameworks-Other-Cflags" superClass="sbi.gnu.cpp.compiler.option.frameworks_cflags.cpp" valueType="stringList"> - <listOptionValue builtIn="false" value="-target i386-tizen-linux-gnueabi -gcc-toolchain C:/tizen-sdk/tools/smart-build-interface/../i386-linux-gnueabi-gcc-4.5/ -ccc-gcc-name i386-linux-gnueabi-g++ -march=i386 -Wno-gnu"/> - <listOptionValue builtIn="false" value=" -fPIC"/> - <listOptionValue builtIn="false" value="--sysroot="${SBI_SYSROOT}""/> - </option> - <option id="gnu.cpp.compiler.option.preprocessor.def.67860287" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" valueType="definedSymbols"> - <listOptionValue builtIn="false" value="_DEBUG"/> - </option> - <inputType id="sbi.gnu.cpp.compiler.tizen.inputType.2085750802" superClass="sbi.gnu.cpp.compiler.tizen.inputType"/> - </tool> - <tool command="clang.exe" commandLinePattern="${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}" errorParsers="org.eclipse.cdt.core.GCCErrorParser" id="org.tizen.nativecpp.tool.sbi.gnu.c.compiler.263460224" name="C Compiler" superClass="org.tizen.nativecpp.tool.sbi.gnu.c.compiler"> - <option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.option.optimization.level.819197061" name="Optimization Level" superClass="gnu.c.compiler.option.optimization.level" valueType="enumerated"/> - <option id="sbi.gnu.c.compiler.option.debugging.level.709891206" name="Debug level" superClass="sbi.gnu.c.compiler.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/> - <option id="sbi.gnu.c.compiler.option.debug.applog.1166511754" name="Enable application logging (-D_APP_LOG)" superClass="sbi.gnu.c.compiler.option.debug.applog" value="true" valueType="boolean"/> - <option id="sbi.gnu.c.compiler.option.1738169580" name="Tizen-Target" superClass="sbi.gnu.c.compiler.option" valueType="userObjs"> - <listOptionValue builtIn="false" value="tizen-emulator-2.2.native_llvm31.i386.cpp.staticLib"/> - </option> - <option id="gnu.c.compiler.option.include.paths.821405214" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath"> - <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/inc}""/> - </option> - <option id="sbi.gnu.c.compiler.option.frameworks.cpp.229730784" name="Tizen-Frameworks" superClass="sbi.gnu.c.compiler.option.frameworks.cpp" valueType="userObjs"> - <listOptionValue builtIn="false" value="osp-static"/> - </option> - <option id="sbi.gnu.c.compiler.option.frameworks_inc.cpp.1139638882" name="Tizen-Frameworks-Include-Path" superClass="sbi.gnu.c.compiler.option.frameworks_inc.cpp" valueType="includePath"> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/libxml2""/> - <listOptionValue builtIn="false" value=""C:\tizen-sdk\library""/> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include""/> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/osp""/> - </option> - <option id="sbi.gnu.c.compiler.option.frameworks_cflags.cpp.1131449804" name="Tizen-Frameworks-Other-Cflags" superClass="sbi.gnu.c.compiler.option.frameworks_cflags.cpp" valueType="stringList"> - <listOptionValue builtIn="false" value="-target i386-tizen-linux-gnueabi -gcc-toolchain C:/tizen-sdk/tools/smart-build-interface/../i386-linux-gnueabi-gcc-4.5/ -ccc-gcc-name i386-linux-gnueabi-g++ -march=i386 -Wno-gnu"/> - <listOptionValue builtIn="false" value=" -fPIC"/> - <listOptionValue builtIn="false" value="--sysroot="${SBI_SYSROOT}""/> - </option> - <option id="gnu.c.compiler.option.preprocessor.def.symbols.31661523" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" valueType="definedSymbols"> - <listOptionValue builtIn="false" value="_DEBUG"/> - </option> - <inputType id="sbi.gnu.c.compiler.tizen.inputType.94264147" superClass="sbi.gnu.c.compiler.tizen.inputType"/> - </tool> - <tool id="org.tizen.nativeide.tool.sbi.gnu.c.linker.base.792552065" name="C Linker" superClass="org.tizen.nativeide.tool.sbi.gnu.c.linker.base"/> - <tool command="clang++.exe" id="org.tizen.nativecpp.tool.sbi.gnu.cpp.linker.1518096171" name="C++ Linker" superClass="org.tizen.nativecpp.tool.sbi.gnu.cpp.linker"> - <option id="gnu.cpp.link.option.paths.43791296" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths" valueType="libPaths"> - <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/lib}""/> - </option> - <option id="sbi.gnu.cpp.linker.option.frameworks_lflags.cpp.181465864" name="Tizen-Frameworks-Other-Lflags" superClass="sbi.gnu.cpp.linker.option.frameworks_lflags.cpp" valueType="stringList"> - <listOptionValue builtIn="false" value="-target i386-tizen-linux-gnueabi -gcc-toolchain C:/tizen-sdk/tools/smart-build-interface/../i386-linux-gnueabi-gcc-4.5/ -ccc-gcc-name i386-linux-gnueabi-g++ -march=i386 -Xlinker --as-needed"/> - <listOptionValue builtIn="false" value="--sysroot="${SBI_SYSROOT}""/> - </option> - </tool> - <tool command="i386-linux-gnueabi-as.exe" commandLinePattern="${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}" errorParsers="org.eclipse.cdt.core.GASErrorParser" id="org.tizen.nativeapp.tool.sbi.gnu.assembler.base.165476943" name="Assembler" superClass="org.tizen.nativeapp.tool.sbi.gnu.assembler.base"> - <inputType id="cdt.managedbuild.tool.gnu.assembler.input.517365643" superClass="cdt.managedbuild.tool.gnu.assembler.input"/> - </tool> - <tool id="org.tizen.nativecpp.tool.sbi.po.compiler.254627421" name="PO Resource Compiler" superClass="org.tizen.nativecpp.tool.sbi.po.compiler"/> - <tool id="org.tizen.nativecpp.tool.sbi.edc.compiler.8480881" name="EDC Resource Compiler" superClass="org.tizen.nativecpp.tool.sbi.edc.compiler"/> - </toolChain> - </folderInfo> - <sourceEntries> - <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/> - <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="inc"/> - </sourceEntries> - </configuration> - </storageModule> - <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> - </cconfiguration> - <cconfiguration id="org.tizen.nativecpp.config.sbi.gcc45.lib.debug.device.1240851129"> - <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="org.tizen.nativecpp.config.sbi.gcc45.lib.debug.device.1240851129" moduleId="org.eclipse.cdt.core.settings" name="Debug-Tizen-Device"> - <externalSettings/> - <extensions> - <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/> - <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - </extensions> - </storageModule> - <storageModule moduleId="cdtBuildSystem" version="4.0.0"> - <configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.tizen.nativecpp.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.tizen.nativecpp.buildArtefactType.staticLib" cleanCommand="rm -f" description="" errorParsers="org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;" id="org.tizen.nativecpp.config.sbi.gcc45.lib.debug.device.1240851129" name="Debug-Tizen-Device" parent="org.tizen.nativecpp.config.sbi.gcc45.lib.debug.device"> - <folderInfo id="org.tizen.nativecpp.config.sbi.gcc45.lib.debug.device.1240851129." name="/" resourcePath=""> - <toolChain id="org.tizen.nativecpp.toolchain.sbi.gcc45.lib.debug.device.1011815399" name="Tizen Native Toolchain" superClass="org.tizen.nativecpp.toolchain.sbi.gcc45.lib.debug.device"> - <targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="org.tizen.nativeide.target.sbi.gnu.platform.base.205106495" osList="linux,win32" superClass="org.tizen.nativeide.target.sbi.gnu.platform.base"/> - <builder buildPath="${workspace_loc:/box2d/Debug-Tizen-Device}" id="org.tizen.nativecpp.target.sbi.gnu.builder.391616426" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Tizen Application Builder" superClass="org.tizen.nativecpp.target.sbi.gnu.builder"/> - <tool command="arm-linux-gnueabi-ar.exe" id="org.tizen.nativecpp.tool.sbi.gnu.archiver.1946190238" name="Archiver" superClass="org.tizen.nativecpp.tool.sbi.gnu.archiver"/> - <tool command="clang++.exe" id="org.tizen.nativecpp.tool.sbi.gnu.cpp.compiler.806237946" name="C++ Compiler" superClass="org.tizen.nativecpp.tool.sbi.gnu.cpp.compiler"> - <option id="gnu.cpp.compiler.option.optimization.level.1141078136" name="Optimization Level" superClass="gnu.cpp.compiler.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/> - <option id="sbi.gnu.cpp.compiler.option.debugging.level.412266760" name="Debug level" superClass="sbi.gnu.cpp.compiler.option.debugging.level" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/> - <option id="sbi.gnu.cpp.compiler.option.debug.applog.48357772" name="Enable application logging (-D_APP_LOG)" superClass="sbi.gnu.cpp.compiler.option.debug.applog" value="true" valueType="boolean"/> - <option id="sbi.gnu.cpp.compiler.option.738324429" name="Tizen-Target" superClass="sbi.gnu.cpp.compiler.option" valueType="userObjs"> - <listOptionValue builtIn="false" value="tizen-device-2.2.native_llvm31.armel.cpp.staticLib"/> - </option> - <option id="gnu.cpp.compiler.option.include.paths.1372067183" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath"> - <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/inc}""/> - <listOptionValue builtIn="false" value="../../.."/> - </option> - <option id="sbi.gnu.cpp.compiler.option.frameworks.cpp.1270990666" name="Tizen-Frameworks" superClass="sbi.gnu.cpp.compiler.option.frameworks.cpp" valueType="userObjs"> - <listOptionValue builtIn="false" value="osp-static"/> - </option> - <option id="sbi.gnu.cpp.compiler.option.frameworks_inc.cpp.579636391" name="Tizen-Frameworks-Include-Path" superClass="sbi.gnu.cpp.compiler.option.frameworks_inc.cpp" valueType="includePath"> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/libxml2""/> - <listOptionValue builtIn="false" value=""C:\tizen-sdk\library""/> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include""/> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/osp""/> - </option> - <option id="sbi.gnu.cpp.compiler.option.frameworks_cflags.cpp.1644102691" name="Tizen-Frameworks-Other-Cflags" superClass="sbi.gnu.cpp.compiler.option.frameworks_cflags.cpp" valueType="stringList"> - <listOptionValue builtIn="false" value="-target arm-tizen-linux-gnueabi -gcc-toolchain C:/tizen-sdk/tools/smart-build-interface/../arm-linux-gnueabi-gcc-4.5/ -ccc-gcc-name arm-linux-gnueabi-g++ -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -mtune=cortex-a8 -Wno-gnu"/> - <listOptionValue builtIn="false" value=" -fPIC"/> - <listOptionValue builtIn="false" value="--sysroot="${SBI_SYSROOT}""/> - </option> - <option id="gnu.cpp.compiler.option.preprocessor.def.1398462050" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" valueType="definedSymbols"> - <listOptionValue builtIn="false" value="_DEBUG"/> - </option> - <inputType id="sbi.gnu.cpp.compiler.tizen.inputType.1890676098" superClass="sbi.gnu.cpp.compiler.tizen.inputType"/> - </tool> - <tool command="clang.exe" id="org.tizen.nativecpp.tool.sbi.gnu.c.compiler.800077346" name="C Compiler" superClass="org.tizen.nativecpp.tool.sbi.gnu.c.compiler"> - <option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.option.optimization.level.73052907" name="Optimization Level" superClass="gnu.c.compiler.option.optimization.level" valueType="enumerated"/> - <option id="sbi.gnu.c.compiler.option.debugging.level.641100997" name="Debug level" superClass="sbi.gnu.c.compiler.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/> - <option id="sbi.gnu.c.compiler.option.debug.applog.2000116514" name="Enable application logging (-D_APP_LOG)" superClass="sbi.gnu.c.compiler.option.debug.applog" value="true" valueType="boolean"/> - <option id="sbi.gnu.c.compiler.option.1751855743" name="Tizen-Target" superClass="sbi.gnu.c.compiler.option" valueType="userObjs"> - <listOptionValue builtIn="false" value="tizen-device-2.2.native_llvm31.armel.cpp.staticLib"/> - </option> - <option id="gnu.c.compiler.option.include.paths.1641648644" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath"> - <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/inc}""/> - </option> - <option id="sbi.gnu.c.compiler.option.frameworks.cpp.356824867" name="Tizen-Frameworks" superClass="sbi.gnu.c.compiler.option.frameworks.cpp" valueType="userObjs"> - <listOptionValue builtIn="false" value="osp-static"/> - </option> - <option id="sbi.gnu.c.compiler.option.frameworks_inc.cpp.843251170" name="Tizen-Frameworks-Include-Path" superClass="sbi.gnu.c.compiler.option.frameworks_inc.cpp" valueType="includePath"> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/libxml2""/> - <listOptionValue builtIn="false" value=""C:\tizen-sdk\library""/> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include""/> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/osp""/> - </option> - <option id="sbi.gnu.c.compiler.option.frameworks_cflags.cpp.2073478823" name="Tizen-Frameworks-Other-Cflags" superClass="sbi.gnu.c.compiler.option.frameworks_cflags.cpp" valueType="stringList"> - <listOptionValue builtIn="false" value="-target arm-tizen-linux-gnueabi -gcc-toolchain C:/tizen-sdk/tools/smart-build-interface/../arm-linux-gnueabi-gcc-4.5/ -ccc-gcc-name arm-linux-gnueabi-g++ -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -mtune=cortex-a8 -Wno-gnu"/> - <listOptionValue builtIn="false" value=" -fPIC"/> - <listOptionValue builtIn="false" value="--sysroot="${SBI_SYSROOT}""/> - </option> - <option id="gnu.c.compiler.option.preprocessor.def.symbols.1732125980" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" valueType="definedSymbols"> - <listOptionValue builtIn="false" value="_DEBUG"/> - </option> - <inputType id="sbi.gnu.c.compiler.tizen.inputType.565155338" superClass="sbi.gnu.c.compiler.tizen.inputType"/> - </tool> - <tool id="org.tizen.nativeide.tool.sbi.gnu.c.linker.base.1321059471" name="C Linker" superClass="org.tizen.nativeide.tool.sbi.gnu.c.linker.base"/> - <tool command="clang++.exe" id="org.tizen.nativecpp.tool.sbi.gnu.cpp.linker.517614783" name="C++ Linker" superClass="org.tizen.nativecpp.tool.sbi.gnu.cpp.linker"> - <option id="gnu.cpp.link.option.paths.316493253" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths" valueType="libPaths"> - <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/lib}""/> - </option> - <option id="sbi.gnu.cpp.linker.option.frameworks_lflags.cpp.557112687" name="Tizen-Frameworks-Other-Lflags" superClass="sbi.gnu.cpp.linker.option.frameworks_lflags.cpp" valueType="stringList"> - <listOptionValue builtIn="false" value="-target arm-tizen-linux-gnueabi -gcc-toolchain C:/tizen-sdk/tools/smart-build-interface/../arm-linux-gnueabi-gcc-4.5/ -ccc-gcc-name arm-linux-gnueabi-g++ -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -mtune=cortex-a8 -Xlinker --as-needed"/> - <listOptionValue builtIn="false" value="--sysroot="${SBI_SYSROOT}""/> - </option> - </tool> - <tool command="arm-linux-gnueabi-as.exe" id="org.tizen.nativeapp.tool.sbi.gnu.assembler.base.1047247012" name="Assembler" superClass="org.tizen.nativeapp.tool.sbi.gnu.assembler.base"> - <inputType id="cdt.managedbuild.tool.gnu.assembler.input.1262361730" superClass="cdt.managedbuild.tool.gnu.assembler.input"/> - </tool> - <tool id="org.tizen.nativecpp.tool.sbi.po.compiler.1138371781" name="PO Resource Compiler" superClass="org.tizen.nativecpp.tool.sbi.po.compiler"/> - <tool id="org.tizen.nativecpp.tool.sbi.edc.compiler.2045899075" name="EDC Resource Compiler" superClass="org.tizen.nativecpp.tool.sbi.edc.compiler"/> - </toolChain> - </folderInfo> - <sourceEntries> - <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/> - <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="inc"/> - </sourceEntries> - </configuration> - </storageModule> - <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> - </cconfiguration> - <cconfiguration id="org.tizen.nativecpp.config.sbi.gcc45.lib.release.2023052084"> - <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="org.tizen.nativecpp.config.sbi.gcc45.lib.release.2023052084" moduleId="org.eclipse.cdt.core.settings" name="Release"> - <externalSettings/> - <extensions> - <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/> - <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - </extensions> - </storageModule> - <storageModule moduleId="cdtBuildSystem" version="4.0.0"> - <configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.tizen.nativecpp.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release,org.eclipse.cdt.build.core.buildArtefactType=org.tizen.nativecpp.buildArtefactType.staticLib" cleanCommand="rm -f" description="" errorParsers="org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;" id="org.tizen.nativecpp.config.sbi.gcc45.lib.release.2023052084" name="Release" parent="org.tizen.nativecpp.config.sbi.gcc45.lib.release"> - <folderInfo id="org.tizen.nativecpp.config.sbi.gcc45.lib.release.2023052084." name="/" resourcePath=""> - <toolChain id="org.tizen.nativecpp.toolchain.sbi.gcc45.lib.release.1978438453" name="Tizen Native Toolchain" superClass="org.tizen.nativecpp.toolchain.sbi.gcc45.lib.release"> - <targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="org.tizen.nativeide.target.sbi.gnu.platform.base.216744962" osList="linux,win32" superClass="org.tizen.nativeide.target.sbi.gnu.platform.base"/> - <builder buildPath="${workspace_loc:/box2d/Release}" id="org.tizen.nativecpp.target.sbi.gnu.builder.2102360604" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Tizen Application Builder" superClass="org.tizen.nativecpp.target.sbi.gnu.builder"/> - <tool command="i386-linux-gnueabi-ar.exe" id="org.tizen.nativecpp.tool.sbi.gnu.archiver.1826014056" name="Archiver" superClass="org.tizen.nativecpp.tool.sbi.gnu.archiver"/> - <tool command="clang++.exe" id="org.tizen.nativecpp.tool.sbi.gnu.cpp.compiler.2111905100" name="C++ Compiler" superClass="org.tizen.nativecpp.tool.sbi.gnu.cpp.compiler"> - <option id="gnu.cpp.compiler.option.optimization.level.1297088223" name="Optimization Level" superClass="gnu.cpp.compiler.option.optimization.level" value="gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/> - <option id="sbi.gnu.cpp.compiler.option.debugging.level.459894355" name="Debug level" superClass="sbi.gnu.cpp.compiler.option.debugging.level"/> - <option id="sbi.gnu.cpp.compiler.option.debug.applog.849008186" name="Enable application logging (-D_APP_LOG)" superClass="sbi.gnu.cpp.compiler.option.debug.applog"/> - <option id="sbi.gnu.cpp.compiler.option.74299026" name="Tizen-Target" superClass="sbi.gnu.cpp.compiler.option" valueType="userObjs"> - <listOptionValue builtIn="false" value="tizen-emulator-2.2.native_llvm31.i386.cpp.staticLib"/> - </option> - <option id="gnu.cpp.compiler.option.include.paths.1217915212" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath"> - <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/inc}""/> - </option> - <option id="sbi.gnu.cpp.compiler.option.frameworks.cpp.448934412" name="Tizen-Frameworks" superClass="sbi.gnu.cpp.compiler.option.frameworks.cpp" valueType="userObjs"> - <listOptionValue builtIn="false" value="osp-static"/> - </option> - <option id="sbi.gnu.cpp.compiler.option.frameworks_inc.cpp.1627502718" name="Tizen-Frameworks-Include-Path" superClass="sbi.gnu.cpp.compiler.option.frameworks_inc.cpp" valueType="includePath"> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/libxml2""/> - <listOptionValue builtIn="false" value=""C:\tizen-sdk\library""/> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include""/> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/osp""/> - </option> - <option id="sbi.gnu.cpp.compiler.option.frameworks_cflags.cpp.138455270" name="Tizen-Frameworks-Other-Cflags" superClass="sbi.gnu.cpp.compiler.option.frameworks_cflags.cpp" valueType="stringList"> - <listOptionValue builtIn="false" value="-target i386-tizen-linux-gnueabi -gcc-toolchain C:/tizen-sdk/tools/smart-build-interface/../i386-linux-gnueabi-gcc-4.5/ -ccc-gcc-name i386-linux-gnueabi-g++ -march=i386 -Wno-gnu"/> - <listOptionValue builtIn="false" value=" -fPIC"/> - <listOptionValue builtIn="false" value="--sysroot="${SBI_SYSROOT}""/> - </option> - <inputType id="sbi.gnu.cpp.compiler.tizen.inputType.1145329261" superClass="sbi.gnu.cpp.compiler.tizen.inputType"/> - </tool> - <tool command="clang.exe" id="org.tizen.nativecpp.tool.sbi.gnu.c.compiler.19577634" name="C Compiler" superClass="org.tizen.nativecpp.tool.sbi.gnu.c.compiler"> - <option defaultValue="gnu.c.optimization.level.most" id="gnu.c.compiler.option.optimization.level.1635131080" name="Optimization Level" superClass="gnu.c.compiler.option.optimization.level" valueType="enumerated"/> - <option id="sbi.gnu.c.compiler.option.debugging.level.220381318" name="Debug level" superClass="sbi.gnu.c.compiler.option.debugging.level"/> - <option id="sbi.gnu.c.compiler.option.debug.applog.753089515" name="Enable application logging (-D_APP_LOG)" superClass="sbi.gnu.c.compiler.option.debug.applog"/> - <option id="sbi.gnu.c.compiler.option.215142124" name="Tizen-Target" superClass="sbi.gnu.c.compiler.option" valueType="userObjs"> - <listOptionValue builtIn="false" value="tizen-emulator-2.2.native_llvm31.i386.cpp.staticLib"/> - </option> - <option id="gnu.c.compiler.option.include.paths.632347119" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath"> - <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/inc}""/> - </option> - <option id="sbi.gnu.c.compiler.option.frameworks.cpp.1474026339" name="Tizen-Frameworks" superClass="sbi.gnu.c.compiler.option.frameworks.cpp" valueType="userObjs"> - <listOptionValue builtIn="false" value="osp-static"/> - </option> - <option id="sbi.gnu.c.compiler.option.frameworks_inc.cpp.468493190" name="Tizen-Frameworks-Include-Path" superClass="sbi.gnu.c.compiler.option.frameworks_inc.cpp" valueType="includePath"> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/libxml2""/> - <listOptionValue builtIn="false" value=""C:\tizen-sdk\library""/> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include""/> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/osp""/> - </option> - <option id="sbi.gnu.c.compiler.option.frameworks_cflags.cpp.1218800554" name="Tizen-Frameworks-Other-Cflags" superClass="sbi.gnu.c.compiler.option.frameworks_cflags.cpp" valueType="stringList"> - <listOptionValue builtIn="false" value="-target i386-tizen-linux-gnueabi -gcc-toolchain C:/tizen-sdk/tools/smart-build-interface/../i386-linux-gnueabi-gcc-4.5/ -ccc-gcc-name i386-linux-gnueabi-g++ -march=i386 -Wno-gnu"/> - <listOptionValue builtIn="false" value=" -fPIC"/> - <listOptionValue builtIn="false" value="--sysroot="${SBI_SYSROOT}""/> - </option> - <inputType id="sbi.gnu.c.compiler.tizen.inputType.1344515254" superClass="sbi.gnu.c.compiler.tizen.inputType"/> - </tool> - <tool id="org.tizen.nativeide.tool.sbi.gnu.c.linker.base.59626261" name="C Linker" superClass="org.tizen.nativeide.tool.sbi.gnu.c.linker.base"/> - <tool command="clang++.exe" id="org.tizen.nativecpp.tool.sbi.gnu.cpp.linker.563167499" name="C++ Linker" superClass="org.tizen.nativecpp.tool.sbi.gnu.cpp.linker"> - <option id="gnu.cpp.link.option.paths.618042967" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths" valueType="libPaths"> - <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/lib}""/> - </option> - <option id="sbi.gnu.cpp.linker.option.frameworks_lflags.cpp.620416347" name="Tizen-Frameworks-Other-Lflags" superClass="sbi.gnu.cpp.linker.option.frameworks_lflags.cpp" valueType="stringList"> - <listOptionValue builtIn="false" value="-target i386-tizen-linux-gnueabi -gcc-toolchain C:/tizen-sdk/tools/smart-build-interface/../i386-linux-gnueabi-gcc-4.5/ -ccc-gcc-name i386-linux-gnueabi-g++ -march=i386 -Xlinker --as-needed"/> - <listOptionValue builtIn="false" value="--sysroot="${SBI_SYSROOT}""/> - </option> - </tool> - <tool command="i386-linux-gnueabi-as.exe" id="org.tizen.nativeapp.tool.sbi.gnu.assembler.base.1990045494" name="Assembler" superClass="org.tizen.nativeapp.tool.sbi.gnu.assembler.base"> - <inputType id="cdt.managedbuild.tool.gnu.assembler.input.879926948" superClass="cdt.managedbuild.tool.gnu.assembler.input"/> - </tool> - <tool id="org.tizen.nativecpp.tool.sbi.po.compiler.1674758948" name="PO Resource Compiler" superClass="org.tizen.nativecpp.tool.sbi.po.compiler"/> - <tool id="org.tizen.nativecpp.tool.sbi.edc.compiler.1792629643" name="EDC Resource Compiler" superClass="org.tizen.nativecpp.tool.sbi.edc.compiler"/> - </toolChain> - </folderInfo> - <sourceEntries> - <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/> - <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="inc"/> - </sourceEntries> - </configuration> - </storageModule> - <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> - </cconfiguration> - </storageModule> - <storageModule moduleId="cdtBuildSystem" version="4.0.0"> - <project id="box2d.org.tizen.nativecpp.target.sbi.gcc45.lib.1874463476" name="Tizen Static Library" projectType="org.tizen.nativecpp.target.sbi.gcc45.lib"/> - </storageModule> - <storageModule moduleId="com.samsung.tizen.nativeapp.projectInfo" version="1.0.0"/> - <storageModule moduleId="refreshScope" versionNumber="1"> - <resource resourceType="PROJECT" workspacePath="/proj.tizen"/> - </storageModule> - <storageModule moduleId="scannerConfiguration"> - <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/> - <scannerConfigBuildInfo instanceId="org.tizen.nativecpp.config.sbi.gcc45.lib.release.2023052084"> - <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.tizen.nativecommon.TizenGCCManagedMakePerProjectProfileCPP"/> - </scannerConfigBuildInfo> - <scannerConfigBuildInfo instanceId="org.tizen.nativecpp.config.sbi.gcc45.lib.debug.device.1240851129"> - <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.tizen.nativecommon.TizenGCCManagedMakePerProjectProfileCPP"/> - </scannerConfigBuildInfo> - <scannerConfigBuildInfo instanceId="org.tizen.nativecpp.config.sbi.gcc45.lib.debug.emulator.1855378280"> - <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.tizen.nativecommon.TizenGCCManagedMakePerProjectProfileCPP"/> - </scannerConfigBuildInfo> - </storageModule> -</cproject> diff --git a/external/Box2D/proj.tizen/.project b/external/Box2D/proj.tizen/.project deleted file mode 100644 index 7c9fde0f43..0000000000 --- a/external/Box2D/proj.tizen/.project +++ /dev/null @@ -1,116 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>box2d</name> - <comment></comment> - <projects> - </projects> - <buildSpec> - <buildCommand> - <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name> - <triggers>clean,full,incremental,</triggers> - <arguments> - <dictionary> - <key>?name?</key> - <value></value> - </dictionary> - <dictionary> - <key>org.eclipse.cdt.make.core.append_environment</key> - <value>true</value> - </dictionary> - <dictionary> - <key>org.eclipse.cdt.make.core.autoBuildTarget</key> - <value>all</value> - </dictionary> - <dictionary> - <key>org.eclipse.cdt.make.core.buildArguments</key> - <value></value> - </dictionary> - <dictionary> - <key>org.eclipse.cdt.make.core.buildCommand</key> - <value>sbi-make</value> - </dictionary> - <dictionary> - <key>org.eclipse.cdt.make.core.buildLocation</key> - <value>${workspace_loc:/box2d/Debug-Tizen-Emulator}</value> - </dictionary> - <dictionary> - <key>org.eclipse.cdt.make.core.cleanBuildTarget</key> - <value>clean</value> - </dictionary> - <dictionary> - <key>org.eclipse.cdt.make.core.contents</key> - <value>org.eclipse.cdt.make.core.activeConfigSettings</value> - </dictionary> - <dictionary> - <key>org.eclipse.cdt.make.core.enableAutoBuild</key> - <value>false</value> - </dictionary> - <dictionary> - <key>org.eclipse.cdt.make.core.enableCleanBuild</key> - <value>true</value> - </dictionary> - <dictionary> - <key>org.eclipse.cdt.make.core.enableFullBuild</key> - <value>true</value> - </dictionary> - <dictionary> - <key>org.eclipse.cdt.make.core.fullBuildTarget</key> - <value>all</value> - </dictionary> - <dictionary> - <key>org.eclipse.cdt.make.core.stopOnError</key> - <value>true</value> - </dictionary> - <dictionary> - <key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key> - <value>true</value> - </dictionary> - </arguments> - </buildCommand> - <buildCommand> - <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name> - <triggers>full,incremental,</triggers> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>org.tizen.nativecpp.apichecker.core.builder</name> - <arguments> - </arguments> - </buildCommand> - </buildSpec> - <natures> - <nature>org.eclipse.cdt.core.cnature</nature> - <nature>org.eclipse.cdt.core.ccnature</nature> - <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature> - <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature> - <nature>org.tizen.nativecpp.apichecker.core.tizenCppNature</nature> - </natures> - <linkedResources> - <link> - <name>src/Box2D.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/Box2D.h</locationURI> - </link> - <link> - <name>src/Collision</name> - <type>2</type> - <locationURI>PARENT-1-PROJECT_LOC/Collision</locationURI> - </link> - <link> - <name>src/Common</name> - <type>2</type> - <locationURI>PARENT-1-PROJECT_LOC/Common</locationURI> - </link> - <link> - <name>src/Dynamics</name> - <type>2</type> - <locationURI>PARENT-1-PROJECT_LOC/Dynamics</locationURI> - </link> - <link> - <name>src/Rope</name> - <type>2</type> - <locationURI>PARENT-1-PROJECT_LOC/Rope</locationURI> - </link> - </linkedResources> -</projectDescription> diff --git a/external/Box2D/proj.tizen/src/.gitkeep b/external/Box2D/proj.tizen/src/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/cocos2dx/platform/third_party/common/atitc/atitc.cpp b/external/atitc/atitc.cpp similarity index 100% rename from cocos2dx/platform/third_party/common/atitc/atitc.cpp rename to external/atitc/atitc.cpp diff --git a/cocos2dx/platform/third_party/common/atitc/atitc.h b/external/atitc/atitc.h similarity index 100% rename from cocos2dx/platform/third_party/common/atitc/atitc.h rename to external/atitc/atitc.h diff --git a/external/chipmunk/proj.emscripten/Makefile b/external/chipmunk/proj.emscripten/Makefile deleted file mode 100644 index 6319e28095..0000000000 --- a/external/chipmunk/proj.emscripten/Makefile +++ /dev/null @@ -1,55 +0,0 @@ -SOURCES = ../src/chipmunk.cpp \ - ../src/cpBody.cpp \ - ../src/cpSpace.cpp \ - ../src/cpSpatialIndex.cpp \ - ../src/cpArbiter.cpp \ - ../src/cpCollision.cpp \ - ../src/cpSpaceComponent.cpp \ - ../src/cpSweep1D.cpp \ - ../src/cpArray.cpp \ - ../src/cpHashSet.cpp \ - ../src/cpSpaceHash.cpp \ - ../src/cpVect.cpp \ - ../src/cpBB.cpp \ - ../src/cpPolyShape.cpp \ - ../src/cpSpaceQuery.cpp \ - ../src/cpBBTree.cpp \ - ../src/cpShape.cpp \ - ../src/cpSpaceStep.cpp \ - ../src/constraints/cpConstraint.cpp \ - ../src/constraints/cpPivotJoint.cpp \ - ../src/constraints/cpDampedRotarySpring.cpp \ - ../src/constraints/cpRatchetJoint.cpp \ - ../src/constraints/cpDampedSpring.cpp \ - ../src/constraints/cpRotaryLimitJoint.cpp \ - ../src/constraints/cpGearJoint.cpp \ - ../src/constraints/cpSimpleMotor.cpp \ - ../src/constraints/cpGrooveJoint.cpp \ - ../src/constraints/cpSlideJoint.cpp \ - ../src/constraints/cpPinJoint.cpp \ - -include ../../../cocos2dx/proj.emscripten/cocos2dx.mk - -TARGET = $(LIB_DIR)/libchipmunk.a -INCLUDES = -I../include/chipmunk -OBJECTS := $(subst src/,,$(OBJECTS)) - -all: $(TARGET) - -# Egregious hack to force Emscripten to compile as C++. This is necessary as -# Emscripten uses different calling conventions for structs passed on the stack -# in C and C++. See this bug for more info: -# -# https://github.com/kripken/emscripten/issues/1101 -# -# Note that Make kindly cleans these files up afterwards -%.cpp: %.c - ln -f $< $@ - -$(TARGET): $(OBJECTS) $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(AR) $(ARFLAGS) $(TARGET) $(OBJECTS) - -$(OBJ_DIR)/%.o: ../src/%.cpp $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(CC) $(CCFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@ diff --git a/external/chipmunk/proj.ios/chipmunk-Prefix.pch b/external/chipmunk/proj.ios/chipmunk-Prefix.pch deleted file mode 100644 index a19911202f..0000000000 --- a/external/chipmunk/proj.ios/chipmunk-Prefix.pch +++ /dev/null @@ -1,7 +0,0 @@ -// -// Prefix header for all source files of the 'chipmunk' target in the 'chipmunk' project -// - -#ifdef __OBJC__ - #import <Foundation/Foundation.h> -#endif diff --git a/external/chipmunk/proj.ios/chipmunk.xcodeproj/project.pbxproj b/external/chipmunk/proj.ios/chipmunk.xcodeproj/project.pbxproj deleted file mode 100644 index 3a3f517f79..0000000000 --- a/external/chipmunk/proj.ios/chipmunk.xcodeproj/project.pbxproj +++ /dev/null @@ -1,445 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 1A0C0E111777FC7400838530 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A0C0E101777FC7400838530 /* Foundation.framework */; }; - 1A0C0E5B1777FC9F00838530 /* chipmunk.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E3B1777FC9F00838530 /* chipmunk.c */; }; - 1A0C0E5C1777FC9F00838530 /* cpConstraint.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E3E1777FC9F00838530 /* cpConstraint.c */; }; - 1A0C0E5D1777FC9F00838530 /* cpDampedRotarySpring.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E3F1777FC9F00838530 /* cpDampedRotarySpring.c */; }; - 1A0C0E5E1777FC9F00838530 /* cpDampedSpring.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E401777FC9F00838530 /* cpDampedSpring.c */; }; - 1A0C0E5F1777FC9F00838530 /* cpGearJoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E411777FC9F00838530 /* cpGearJoint.c */; }; - 1A0C0E601777FC9F00838530 /* cpGrooveJoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E421777FC9F00838530 /* cpGrooveJoint.c */; }; - 1A0C0E611777FC9F00838530 /* cpPinJoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E431777FC9F00838530 /* cpPinJoint.c */; }; - 1A0C0E621777FC9F00838530 /* cpPivotJoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E441777FC9F00838530 /* cpPivotJoint.c */; }; - 1A0C0E631777FC9F00838530 /* cpRatchetJoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E451777FC9F00838530 /* cpRatchetJoint.c */; }; - 1A0C0E641777FC9F00838530 /* cpRotaryLimitJoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E461777FC9F00838530 /* cpRotaryLimitJoint.c */; }; - 1A0C0E651777FC9F00838530 /* cpSimpleMotor.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E471777FC9F00838530 /* cpSimpleMotor.c */; }; - 1A0C0E661777FC9F00838530 /* cpSlideJoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E481777FC9F00838530 /* cpSlideJoint.c */; }; - 1A0C0E671777FC9F00838530 /* cpArbiter.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E491777FC9F00838530 /* cpArbiter.c */; }; - 1A0C0E681777FC9F00838530 /* cpArray.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E4A1777FC9F00838530 /* cpArray.c */; }; - 1A0C0E691777FC9F00838530 /* cpBB.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E4B1777FC9F00838530 /* cpBB.c */; }; - 1A0C0E6A1777FC9F00838530 /* cpBBTree.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E4C1777FC9F00838530 /* cpBBTree.c */; }; - 1A0C0E6B1777FC9F00838530 /* cpBody.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E4D1777FC9F00838530 /* cpBody.c */; }; - 1A0C0E6C1777FC9F00838530 /* cpCollision.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E4E1777FC9F00838530 /* cpCollision.c */; }; - 1A0C0E6D1777FC9F00838530 /* cpHashSet.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E4F1777FC9F00838530 /* cpHashSet.c */; }; - 1A0C0E6E1777FC9F00838530 /* cpPolyShape.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E501777FC9F00838530 /* cpPolyShape.c */; }; - 1A0C0E6F1777FC9F00838530 /* cpShape.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E511777FC9F00838530 /* cpShape.c */; }; - 1A0C0E701777FC9F00838530 /* cpSpace.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E521777FC9F00838530 /* cpSpace.c */; }; - 1A0C0E711777FC9F00838530 /* cpSpaceComponent.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E531777FC9F00838530 /* cpSpaceComponent.c */; }; - 1A0C0E721777FC9F00838530 /* cpSpaceHash.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E541777FC9F00838530 /* cpSpaceHash.c */; }; - 1A0C0E731777FC9F00838530 /* cpSpaceQuery.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E551777FC9F00838530 /* cpSpaceQuery.c */; }; - 1A0C0E741777FC9F00838530 /* cpSpaceStep.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E561777FC9F00838530 /* cpSpaceStep.c */; }; - 1A0C0E751777FC9F00838530 /* cpSpatialIndex.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E571777FC9F00838530 /* cpSpatialIndex.c */; }; - 1A0C0E761777FC9F00838530 /* cpSweep1D.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E581777FC9F00838530 /* cpSweep1D.c */; }; - 1A0C0E771777FC9F00838530 /* cpVect.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E591777FC9F00838530 /* cpVect.c */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 1A0C0E0B1777FC7400838530 /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = "include/${PRODUCT_NAME}"; - dstSubfolderSpec = 16; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 1A0C0E0D1777FC7400838530 /* libchipmunk.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libchipmunk.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 1A0C0E101777FC7400838530 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; - 1A0C0E201777FC9F00838530 /* chipmunk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = chipmunk.h; sourceTree = "<group>"; }; - 1A0C0E211777FC9F00838530 /* chipmunk_ffi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = chipmunk_ffi.h; sourceTree = "<group>"; }; - 1A0C0E221777FC9F00838530 /* chipmunk_private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = chipmunk_private.h; sourceTree = "<group>"; }; - 1A0C0E231777FC9F00838530 /* chipmunk_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = chipmunk_types.h; sourceTree = "<group>"; }; - 1A0C0E241777FC9F00838530 /* chipmunk_unsafe.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = chipmunk_unsafe.h; sourceTree = "<group>"; }; - 1A0C0E261777FC9F00838530 /* cpConstraint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpConstraint.h; sourceTree = "<group>"; }; - 1A0C0E271777FC9F00838530 /* cpDampedRotarySpring.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpDampedRotarySpring.h; sourceTree = "<group>"; }; - 1A0C0E281777FC9F00838530 /* cpDampedSpring.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpDampedSpring.h; sourceTree = "<group>"; }; - 1A0C0E291777FC9F00838530 /* cpGearJoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpGearJoint.h; sourceTree = "<group>"; }; - 1A0C0E2A1777FC9F00838530 /* cpGrooveJoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpGrooveJoint.h; sourceTree = "<group>"; }; - 1A0C0E2B1777FC9F00838530 /* cpPinJoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpPinJoint.h; sourceTree = "<group>"; }; - 1A0C0E2C1777FC9F00838530 /* cpPivotJoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpPivotJoint.h; sourceTree = "<group>"; }; - 1A0C0E2D1777FC9F00838530 /* cpRatchetJoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpRatchetJoint.h; sourceTree = "<group>"; }; - 1A0C0E2E1777FC9F00838530 /* cpRotaryLimitJoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpRotaryLimitJoint.h; sourceTree = "<group>"; }; - 1A0C0E2F1777FC9F00838530 /* cpSimpleMotor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpSimpleMotor.h; sourceTree = "<group>"; }; - 1A0C0E301777FC9F00838530 /* cpSlideJoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpSlideJoint.h; sourceTree = "<group>"; }; - 1A0C0E311777FC9F00838530 /* util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util.h; sourceTree = "<group>"; }; - 1A0C0E321777FC9F00838530 /* cpArbiter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpArbiter.h; sourceTree = "<group>"; }; - 1A0C0E331777FC9F00838530 /* cpBB.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpBB.h; sourceTree = "<group>"; }; - 1A0C0E341777FC9F00838530 /* cpBody.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpBody.h; sourceTree = "<group>"; }; - 1A0C0E351777FC9F00838530 /* cpPolyShape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpPolyShape.h; sourceTree = "<group>"; }; - 1A0C0E361777FC9F00838530 /* cpShape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpShape.h; sourceTree = "<group>"; }; - 1A0C0E371777FC9F00838530 /* cpSpace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpSpace.h; sourceTree = "<group>"; }; - 1A0C0E381777FC9F00838530 /* cpSpatialIndex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpSpatialIndex.h; sourceTree = "<group>"; }; - 1A0C0E391777FC9F00838530 /* cpVect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpVect.h; sourceTree = "<group>"; }; - 1A0C0E3B1777FC9F00838530 /* chipmunk.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = chipmunk.c; sourceTree = "<group>"; }; - 1A0C0E3C1777FC9F00838530 /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; }; - 1A0C0E3E1777FC9F00838530 /* cpConstraint.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpConstraint.c; sourceTree = "<group>"; }; - 1A0C0E3F1777FC9F00838530 /* cpDampedRotarySpring.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpDampedRotarySpring.c; sourceTree = "<group>"; }; - 1A0C0E401777FC9F00838530 /* cpDampedSpring.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpDampedSpring.c; sourceTree = "<group>"; }; - 1A0C0E411777FC9F00838530 /* cpGearJoint.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpGearJoint.c; sourceTree = "<group>"; }; - 1A0C0E421777FC9F00838530 /* cpGrooveJoint.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpGrooveJoint.c; sourceTree = "<group>"; }; - 1A0C0E431777FC9F00838530 /* cpPinJoint.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpPinJoint.c; sourceTree = "<group>"; }; - 1A0C0E441777FC9F00838530 /* cpPivotJoint.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpPivotJoint.c; sourceTree = "<group>"; }; - 1A0C0E451777FC9F00838530 /* cpRatchetJoint.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpRatchetJoint.c; sourceTree = "<group>"; }; - 1A0C0E461777FC9F00838530 /* cpRotaryLimitJoint.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpRotaryLimitJoint.c; sourceTree = "<group>"; }; - 1A0C0E471777FC9F00838530 /* cpSimpleMotor.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpSimpleMotor.c; sourceTree = "<group>"; }; - 1A0C0E481777FC9F00838530 /* cpSlideJoint.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpSlideJoint.c; sourceTree = "<group>"; }; - 1A0C0E491777FC9F00838530 /* cpArbiter.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpArbiter.c; sourceTree = "<group>"; }; - 1A0C0E4A1777FC9F00838530 /* cpArray.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpArray.c; sourceTree = "<group>"; }; - 1A0C0E4B1777FC9F00838530 /* cpBB.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpBB.c; sourceTree = "<group>"; }; - 1A0C0E4C1777FC9F00838530 /* cpBBTree.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpBBTree.c; sourceTree = "<group>"; }; - 1A0C0E4D1777FC9F00838530 /* cpBody.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpBody.c; sourceTree = "<group>"; }; - 1A0C0E4E1777FC9F00838530 /* cpCollision.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpCollision.c; sourceTree = "<group>"; }; - 1A0C0E4F1777FC9F00838530 /* cpHashSet.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpHashSet.c; sourceTree = "<group>"; }; - 1A0C0E501777FC9F00838530 /* cpPolyShape.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpPolyShape.c; sourceTree = "<group>"; }; - 1A0C0E511777FC9F00838530 /* cpShape.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpShape.c; sourceTree = "<group>"; }; - 1A0C0E521777FC9F00838530 /* cpSpace.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpSpace.c; sourceTree = "<group>"; }; - 1A0C0E531777FC9F00838530 /* cpSpaceComponent.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpSpaceComponent.c; sourceTree = "<group>"; }; - 1A0C0E541777FC9F00838530 /* cpSpaceHash.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpSpaceHash.c; sourceTree = "<group>"; }; - 1A0C0E551777FC9F00838530 /* cpSpaceQuery.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpSpaceQuery.c; sourceTree = "<group>"; }; - 1A0C0E561777FC9F00838530 /* cpSpaceStep.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpSpaceStep.c; sourceTree = "<group>"; }; - 1A0C0E571777FC9F00838530 /* cpSpatialIndex.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpSpatialIndex.c; sourceTree = "<group>"; }; - 1A0C0E581777FC9F00838530 /* cpSweep1D.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpSweep1D.c; sourceTree = "<group>"; }; - 1A0C0E591777FC9F00838530 /* cpVect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpVect.c; sourceTree = "<group>"; }; - 1A0C0E5A1777FC9F00838530 /* prime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = prime.h; sourceTree = "<group>"; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 1A0C0E0A1777FC7400838530 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 1A0C0E111777FC7400838530 /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 1A0C0E041777FC7400838530 = { - isa = PBXGroup; - children = ( - 1A0C0E1E1777FC9F00838530 /* include */, - 1A0C0E3A1777FC9F00838530 /* src */, - 1A0C0E0F1777FC7400838530 /* Frameworks */, - 1A0C0E0E1777FC7400838530 /* Products */, - ); - sourceTree = "<group>"; - }; - 1A0C0E0E1777FC7400838530 /* Products */ = { - isa = PBXGroup; - children = ( - 1A0C0E0D1777FC7400838530 /* libchipmunk.a */, - ); - name = Products; - sourceTree = "<group>"; - }; - 1A0C0E0F1777FC7400838530 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 1A0C0E101777FC7400838530 /* Foundation.framework */, - ); - name = Frameworks; - sourceTree = "<group>"; - }; - 1A0C0E1E1777FC9F00838530 /* include */ = { - isa = PBXGroup; - children = ( - 1A0C0E1F1777FC9F00838530 /* chipmunk */, - ); - name = include; - path = ../include; - sourceTree = "<group>"; - }; - 1A0C0E1F1777FC9F00838530 /* chipmunk */ = { - isa = PBXGroup; - children = ( - 1A0C0E201777FC9F00838530 /* chipmunk.h */, - 1A0C0E211777FC9F00838530 /* chipmunk_ffi.h */, - 1A0C0E221777FC9F00838530 /* chipmunk_private.h */, - 1A0C0E231777FC9F00838530 /* chipmunk_types.h */, - 1A0C0E241777FC9F00838530 /* chipmunk_unsafe.h */, - 1A0C0E251777FC9F00838530 /* constraints */, - 1A0C0E321777FC9F00838530 /* cpArbiter.h */, - 1A0C0E331777FC9F00838530 /* cpBB.h */, - 1A0C0E341777FC9F00838530 /* cpBody.h */, - 1A0C0E351777FC9F00838530 /* cpPolyShape.h */, - 1A0C0E361777FC9F00838530 /* cpShape.h */, - 1A0C0E371777FC9F00838530 /* cpSpace.h */, - 1A0C0E381777FC9F00838530 /* cpSpatialIndex.h */, - 1A0C0E391777FC9F00838530 /* cpVect.h */, - ); - path = chipmunk; - sourceTree = "<group>"; - }; - 1A0C0E251777FC9F00838530 /* constraints */ = { - isa = PBXGroup; - children = ( - 1A0C0E261777FC9F00838530 /* cpConstraint.h */, - 1A0C0E271777FC9F00838530 /* cpDampedRotarySpring.h */, - 1A0C0E281777FC9F00838530 /* cpDampedSpring.h */, - 1A0C0E291777FC9F00838530 /* cpGearJoint.h */, - 1A0C0E2A1777FC9F00838530 /* cpGrooveJoint.h */, - 1A0C0E2B1777FC9F00838530 /* cpPinJoint.h */, - 1A0C0E2C1777FC9F00838530 /* cpPivotJoint.h */, - 1A0C0E2D1777FC9F00838530 /* cpRatchetJoint.h */, - 1A0C0E2E1777FC9F00838530 /* cpRotaryLimitJoint.h */, - 1A0C0E2F1777FC9F00838530 /* cpSimpleMotor.h */, - 1A0C0E301777FC9F00838530 /* cpSlideJoint.h */, - 1A0C0E311777FC9F00838530 /* util.h */, - ); - path = constraints; - sourceTree = "<group>"; - }; - 1A0C0E3A1777FC9F00838530 /* src */ = { - isa = PBXGroup; - children = ( - 1A0C0E3B1777FC9F00838530 /* chipmunk.c */, - 1A0C0E3C1777FC9F00838530 /* CMakeLists.txt */, - 1A0C0E3D1777FC9F00838530 /* constraints */, - 1A0C0E491777FC9F00838530 /* cpArbiter.c */, - 1A0C0E4A1777FC9F00838530 /* cpArray.c */, - 1A0C0E4B1777FC9F00838530 /* cpBB.c */, - 1A0C0E4C1777FC9F00838530 /* cpBBTree.c */, - 1A0C0E4D1777FC9F00838530 /* cpBody.c */, - 1A0C0E4E1777FC9F00838530 /* cpCollision.c */, - 1A0C0E4F1777FC9F00838530 /* cpHashSet.c */, - 1A0C0E501777FC9F00838530 /* cpPolyShape.c */, - 1A0C0E511777FC9F00838530 /* cpShape.c */, - 1A0C0E521777FC9F00838530 /* cpSpace.c */, - 1A0C0E531777FC9F00838530 /* cpSpaceComponent.c */, - 1A0C0E541777FC9F00838530 /* cpSpaceHash.c */, - 1A0C0E551777FC9F00838530 /* cpSpaceQuery.c */, - 1A0C0E561777FC9F00838530 /* cpSpaceStep.c */, - 1A0C0E571777FC9F00838530 /* cpSpatialIndex.c */, - 1A0C0E581777FC9F00838530 /* cpSweep1D.c */, - 1A0C0E591777FC9F00838530 /* cpVect.c */, - 1A0C0E5A1777FC9F00838530 /* prime.h */, - ); - name = src; - path = ../src; - sourceTree = "<group>"; - }; - 1A0C0E3D1777FC9F00838530 /* constraints */ = { - isa = PBXGroup; - children = ( - 1A0C0E3E1777FC9F00838530 /* cpConstraint.c */, - 1A0C0E3F1777FC9F00838530 /* cpDampedRotarySpring.c */, - 1A0C0E401777FC9F00838530 /* cpDampedSpring.c */, - 1A0C0E411777FC9F00838530 /* cpGearJoint.c */, - 1A0C0E421777FC9F00838530 /* cpGrooveJoint.c */, - 1A0C0E431777FC9F00838530 /* cpPinJoint.c */, - 1A0C0E441777FC9F00838530 /* cpPivotJoint.c */, - 1A0C0E451777FC9F00838530 /* cpRatchetJoint.c */, - 1A0C0E461777FC9F00838530 /* cpRotaryLimitJoint.c */, - 1A0C0E471777FC9F00838530 /* cpSimpleMotor.c */, - 1A0C0E481777FC9F00838530 /* cpSlideJoint.c */, - ); - path = constraints; - sourceTree = "<group>"; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 1A0C0E0C1777FC7400838530 /* chipmunk */ = { - isa = PBXNativeTarget; - buildConfigurationList = 1A0C0E1B1777FC7400838530 /* Build configuration list for PBXNativeTarget "chipmunk" */; - buildPhases = ( - 1A0C0E091777FC7400838530 /* Sources */, - 1A0C0E0A1777FC7400838530 /* Frameworks */, - 1A0C0E0B1777FC7400838530 /* CopyFiles */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = chipmunk; - productName = chipmunk; - productReference = 1A0C0E0D1777FC7400838530 /* libchipmunk.a */; - productType = "com.apple.product-type.library.static"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 1A0C0E051777FC7400838530 /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0460; - }; - buildConfigurationList = 1A0C0E081777FC7400838530 /* Build configuration list for PBXProject "chipmunk" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - ); - mainGroup = 1A0C0E041777FC7400838530; - productRefGroup = 1A0C0E0E1777FC7400838530 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 1A0C0E0C1777FC7400838530 /* chipmunk */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXSourcesBuildPhase section */ - 1A0C0E091777FC7400838530 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 1A0C0E5B1777FC9F00838530 /* chipmunk.c in Sources */, - 1A0C0E5C1777FC9F00838530 /* cpConstraint.c in Sources */, - 1A0C0E5D1777FC9F00838530 /* cpDampedRotarySpring.c in Sources */, - 1A0C0E5E1777FC9F00838530 /* cpDampedSpring.c in Sources */, - 1A0C0E5F1777FC9F00838530 /* cpGearJoint.c in Sources */, - 1A0C0E601777FC9F00838530 /* cpGrooveJoint.c in Sources */, - 1A0C0E611777FC9F00838530 /* cpPinJoint.c in Sources */, - 1A0C0E621777FC9F00838530 /* cpPivotJoint.c in Sources */, - 1A0C0E631777FC9F00838530 /* cpRatchetJoint.c in Sources */, - 1A0C0E641777FC9F00838530 /* cpRotaryLimitJoint.c in Sources */, - 1A0C0E651777FC9F00838530 /* cpSimpleMotor.c in Sources */, - 1A0C0E661777FC9F00838530 /* cpSlideJoint.c in Sources */, - 1A0C0E671777FC9F00838530 /* cpArbiter.c in Sources */, - 1A0C0E681777FC9F00838530 /* cpArray.c in Sources */, - 1A0C0E691777FC9F00838530 /* cpBB.c in Sources */, - 1A0C0E6A1777FC9F00838530 /* cpBBTree.c in Sources */, - 1A0C0E6B1777FC9F00838530 /* cpBody.c in Sources */, - 1A0C0E6C1777FC9F00838530 /* cpCollision.c in Sources */, - 1A0C0E6D1777FC9F00838530 /* cpHashSet.c in Sources */, - 1A0C0E6E1777FC9F00838530 /* cpPolyShape.c in Sources */, - 1A0C0E6F1777FC9F00838530 /* cpShape.c in Sources */, - 1A0C0E701777FC9F00838530 /* cpSpace.c in Sources */, - 1A0C0E711777FC9F00838530 /* cpSpaceComponent.c in Sources */, - 1A0C0E721777FC9F00838530 /* cpSpaceHash.c in Sources */, - 1A0C0E731777FC9F00838530 /* cpSpaceQuery.c in Sources */, - 1A0C0E741777FC9F00838530 /* cpSpaceStep.c in Sources */, - 1A0C0E751777FC9F00838530 /* cpSpatialIndex.c in Sources */, - 1A0C0E761777FC9F00838530 /* cpSweep1D.c in Sources */, - 1A0C0E771777FC9F00838530 /* cpVect.c in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 1A0C0E191777FC7400838530 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 6.1; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - }; - name = Debug; - }; - 1A0C0E1A1777FC7400838530 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 6.1; - SDKROOT = iphoneos; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 1A0C0E1C1777FC7400838530 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; - DSTROOT = /tmp/chipmunk.dst; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "chipmunk-Prefix.pch"; - HEADER_SEARCH_PATHS = "\"$(SRCROOT)/../include/chipmunk\""; - IPHONEOS_DEPLOYMENT_TARGET = 5.0; - ONLY_ACTIVE_ARCH = YES; - OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 1A0C0E1D1777FC7400838530 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; - DSTROOT = /tmp/chipmunk.dst; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "chipmunk-Prefix.pch"; - HEADER_SEARCH_PATHS = "\"$(SRCROOT)/../include/chipmunk\""; - IPHONEOS_DEPLOYMENT_TARGET = 5.0; - ONLY_ACTIVE_ARCH = YES; - OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 1A0C0E081777FC7400838530 /* Build configuration list for PBXProject "chipmunk" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1A0C0E191777FC7400838530 /* Debug */, - 1A0C0E1A1777FC7400838530 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 1A0C0E1B1777FC7400838530 /* Build configuration list for PBXNativeTarget "chipmunk" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1A0C0E1C1777FC7400838530 /* Debug */, - 1A0C0E1D1777FC7400838530 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 1A0C0E051777FC7400838530 /* Project object */; -} diff --git a/external/chipmunk/proj.mac/chipmunk-Prefix.pch b/external/chipmunk/proj.mac/chipmunk-Prefix.pch deleted file mode 100644 index a19911202f..0000000000 --- a/external/chipmunk/proj.mac/chipmunk-Prefix.pch +++ /dev/null @@ -1,7 +0,0 @@ -// -// Prefix header for all source files of the 'chipmunk' target in the 'chipmunk' project -// - -#ifdef __OBJC__ - #import <Foundation/Foundation.h> -#endif diff --git a/external/chipmunk/proj.mac/chipmunk.xcodeproj/project.pbxproj b/external/chipmunk/proj.mac/chipmunk.xcodeproj/project.pbxproj deleted file mode 100644 index 32b34b8c0e..0000000000 --- a/external/chipmunk/proj.mac/chipmunk.xcodeproj/project.pbxproj +++ /dev/null @@ -1,434 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 1A0C0E111777FC7400838530 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A0C0E101777FC7400838530 /* Foundation.framework */; }; - 1A0C0E5B1777FC9F00838530 /* chipmunk.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E3B1777FC9F00838530 /* chipmunk.c */; }; - 1A0C0E5C1777FC9F00838530 /* cpConstraint.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E3E1777FC9F00838530 /* cpConstraint.c */; }; - 1A0C0E5D1777FC9F00838530 /* cpDampedRotarySpring.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E3F1777FC9F00838530 /* cpDampedRotarySpring.c */; }; - 1A0C0E5E1777FC9F00838530 /* cpDampedSpring.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E401777FC9F00838530 /* cpDampedSpring.c */; }; - 1A0C0E5F1777FC9F00838530 /* cpGearJoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E411777FC9F00838530 /* cpGearJoint.c */; }; - 1A0C0E601777FC9F00838530 /* cpGrooveJoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E421777FC9F00838530 /* cpGrooveJoint.c */; }; - 1A0C0E611777FC9F00838530 /* cpPinJoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E431777FC9F00838530 /* cpPinJoint.c */; }; - 1A0C0E621777FC9F00838530 /* cpPivotJoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E441777FC9F00838530 /* cpPivotJoint.c */; }; - 1A0C0E631777FC9F00838530 /* cpRatchetJoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E451777FC9F00838530 /* cpRatchetJoint.c */; }; - 1A0C0E641777FC9F00838530 /* cpRotaryLimitJoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E461777FC9F00838530 /* cpRotaryLimitJoint.c */; }; - 1A0C0E651777FC9F00838530 /* cpSimpleMotor.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E471777FC9F00838530 /* cpSimpleMotor.c */; }; - 1A0C0E661777FC9F00838530 /* cpSlideJoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E481777FC9F00838530 /* cpSlideJoint.c */; }; - 1A0C0E671777FC9F00838530 /* cpArbiter.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E491777FC9F00838530 /* cpArbiter.c */; }; - 1A0C0E681777FC9F00838530 /* cpArray.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E4A1777FC9F00838530 /* cpArray.c */; }; - 1A0C0E691777FC9F00838530 /* cpBB.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E4B1777FC9F00838530 /* cpBB.c */; }; - 1A0C0E6A1777FC9F00838530 /* cpBBTree.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E4C1777FC9F00838530 /* cpBBTree.c */; }; - 1A0C0E6B1777FC9F00838530 /* cpBody.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E4D1777FC9F00838530 /* cpBody.c */; }; - 1A0C0E6C1777FC9F00838530 /* cpCollision.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E4E1777FC9F00838530 /* cpCollision.c */; }; - 1A0C0E6D1777FC9F00838530 /* cpHashSet.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E4F1777FC9F00838530 /* cpHashSet.c */; }; - 1A0C0E6E1777FC9F00838530 /* cpPolyShape.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E501777FC9F00838530 /* cpPolyShape.c */; }; - 1A0C0E6F1777FC9F00838530 /* cpShape.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E511777FC9F00838530 /* cpShape.c */; }; - 1A0C0E701777FC9F00838530 /* cpSpace.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E521777FC9F00838530 /* cpSpace.c */; }; - 1A0C0E711777FC9F00838530 /* cpSpaceComponent.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E531777FC9F00838530 /* cpSpaceComponent.c */; }; - 1A0C0E721777FC9F00838530 /* cpSpaceHash.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E541777FC9F00838530 /* cpSpaceHash.c */; }; - 1A0C0E731777FC9F00838530 /* cpSpaceQuery.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E551777FC9F00838530 /* cpSpaceQuery.c */; }; - 1A0C0E741777FC9F00838530 /* cpSpaceStep.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E561777FC9F00838530 /* cpSpaceStep.c */; }; - 1A0C0E751777FC9F00838530 /* cpSpatialIndex.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E571777FC9F00838530 /* cpSpatialIndex.c */; }; - 1A0C0E761777FC9F00838530 /* cpSweep1D.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E581777FC9F00838530 /* cpSweep1D.c */; }; - 1A0C0E771777FC9F00838530 /* cpVect.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E591777FC9F00838530 /* cpVect.c */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 1A0C0E0B1777FC7400838530 /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = "include/${PRODUCT_NAME}"; - dstSubfolderSpec = 16; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 1A0C0E0D1777FC7400838530 /* libchipmunk.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libchipmunk.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 1A0C0E101777FC7400838530 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; - 1A0C0E201777FC9F00838530 /* chipmunk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = chipmunk.h; sourceTree = "<group>"; }; - 1A0C0E211777FC9F00838530 /* chipmunk_ffi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = chipmunk_ffi.h; sourceTree = "<group>"; }; - 1A0C0E221777FC9F00838530 /* chipmunk_private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = chipmunk_private.h; sourceTree = "<group>"; }; - 1A0C0E231777FC9F00838530 /* chipmunk_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = chipmunk_types.h; sourceTree = "<group>"; }; - 1A0C0E241777FC9F00838530 /* chipmunk_unsafe.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = chipmunk_unsafe.h; sourceTree = "<group>"; }; - 1A0C0E261777FC9F00838530 /* cpConstraint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpConstraint.h; sourceTree = "<group>"; }; - 1A0C0E271777FC9F00838530 /* cpDampedRotarySpring.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpDampedRotarySpring.h; sourceTree = "<group>"; }; - 1A0C0E281777FC9F00838530 /* cpDampedSpring.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpDampedSpring.h; sourceTree = "<group>"; }; - 1A0C0E291777FC9F00838530 /* cpGearJoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpGearJoint.h; sourceTree = "<group>"; }; - 1A0C0E2A1777FC9F00838530 /* cpGrooveJoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpGrooveJoint.h; sourceTree = "<group>"; }; - 1A0C0E2B1777FC9F00838530 /* cpPinJoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpPinJoint.h; sourceTree = "<group>"; }; - 1A0C0E2C1777FC9F00838530 /* cpPivotJoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpPivotJoint.h; sourceTree = "<group>"; }; - 1A0C0E2D1777FC9F00838530 /* cpRatchetJoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpRatchetJoint.h; sourceTree = "<group>"; }; - 1A0C0E2E1777FC9F00838530 /* cpRotaryLimitJoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpRotaryLimitJoint.h; sourceTree = "<group>"; }; - 1A0C0E2F1777FC9F00838530 /* cpSimpleMotor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpSimpleMotor.h; sourceTree = "<group>"; }; - 1A0C0E301777FC9F00838530 /* cpSlideJoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpSlideJoint.h; sourceTree = "<group>"; }; - 1A0C0E311777FC9F00838530 /* util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util.h; sourceTree = "<group>"; }; - 1A0C0E321777FC9F00838530 /* cpArbiter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpArbiter.h; sourceTree = "<group>"; }; - 1A0C0E331777FC9F00838530 /* cpBB.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpBB.h; sourceTree = "<group>"; }; - 1A0C0E341777FC9F00838530 /* cpBody.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpBody.h; sourceTree = "<group>"; }; - 1A0C0E351777FC9F00838530 /* cpPolyShape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpPolyShape.h; sourceTree = "<group>"; }; - 1A0C0E361777FC9F00838530 /* cpShape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpShape.h; sourceTree = "<group>"; }; - 1A0C0E371777FC9F00838530 /* cpSpace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpSpace.h; sourceTree = "<group>"; }; - 1A0C0E381777FC9F00838530 /* cpSpatialIndex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpSpatialIndex.h; sourceTree = "<group>"; }; - 1A0C0E391777FC9F00838530 /* cpVect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpVect.h; sourceTree = "<group>"; }; - 1A0C0E3B1777FC9F00838530 /* chipmunk.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = chipmunk.c; sourceTree = "<group>"; }; - 1A0C0E3C1777FC9F00838530 /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; }; - 1A0C0E3E1777FC9F00838530 /* cpConstraint.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpConstraint.c; sourceTree = "<group>"; }; - 1A0C0E3F1777FC9F00838530 /* cpDampedRotarySpring.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpDampedRotarySpring.c; sourceTree = "<group>"; }; - 1A0C0E401777FC9F00838530 /* cpDampedSpring.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpDampedSpring.c; sourceTree = "<group>"; }; - 1A0C0E411777FC9F00838530 /* cpGearJoint.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpGearJoint.c; sourceTree = "<group>"; }; - 1A0C0E421777FC9F00838530 /* cpGrooveJoint.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpGrooveJoint.c; sourceTree = "<group>"; }; - 1A0C0E431777FC9F00838530 /* cpPinJoint.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpPinJoint.c; sourceTree = "<group>"; }; - 1A0C0E441777FC9F00838530 /* cpPivotJoint.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpPivotJoint.c; sourceTree = "<group>"; }; - 1A0C0E451777FC9F00838530 /* cpRatchetJoint.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpRatchetJoint.c; sourceTree = "<group>"; }; - 1A0C0E461777FC9F00838530 /* cpRotaryLimitJoint.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpRotaryLimitJoint.c; sourceTree = "<group>"; }; - 1A0C0E471777FC9F00838530 /* cpSimpleMotor.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpSimpleMotor.c; sourceTree = "<group>"; }; - 1A0C0E481777FC9F00838530 /* cpSlideJoint.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpSlideJoint.c; sourceTree = "<group>"; }; - 1A0C0E491777FC9F00838530 /* cpArbiter.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpArbiter.c; sourceTree = "<group>"; }; - 1A0C0E4A1777FC9F00838530 /* cpArray.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpArray.c; sourceTree = "<group>"; }; - 1A0C0E4B1777FC9F00838530 /* cpBB.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpBB.c; sourceTree = "<group>"; }; - 1A0C0E4C1777FC9F00838530 /* cpBBTree.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpBBTree.c; sourceTree = "<group>"; }; - 1A0C0E4D1777FC9F00838530 /* cpBody.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpBody.c; sourceTree = "<group>"; }; - 1A0C0E4E1777FC9F00838530 /* cpCollision.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpCollision.c; sourceTree = "<group>"; }; - 1A0C0E4F1777FC9F00838530 /* cpHashSet.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpHashSet.c; sourceTree = "<group>"; }; - 1A0C0E501777FC9F00838530 /* cpPolyShape.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpPolyShape.c; sourceTree = "<group>"; }; - 1A0C0E511777FC9F00838530 /* cpShape.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpShape.c; sourceTree = "<group>"; }; - 1A0C0E521777FC9F00838530 /* cpSpace.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpSpace.c; sourceTree = "<group>"; }; - 1A0C0E531777FC9F00838530 /* cpSpaceComponent.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpSpaceComponent.c; sourceTree = "<group>"; }; - 1A0C0E541777FC9F00838530 /* cpSpaceHash.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpSpaceHash.c; sourceTree = "<group>"; }; - 1A0C0E551777FC9F00838530 /* cpSpaceQuery.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpSpaceQuery.c; sourceTree = "<group>"; }; - 1A0C0E561777FC9F00838530 /* cpSpaceStep.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpSpaceStep.c; sourceTree = "<group>"; }; - 1A0C0E571777FC9F00838530 /* cpSpatialIndex.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpSpatialIndex.c; sourceTree = "<group>"; }; - 1A0C0E581777FC9F00838530 /* cpSweep1D.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpSweep1D.c; sourceTree = "<group>"; }; - 1A0C0E591777FC9F00838530 /* cpVect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpVect.c; sourceTree = "<group>"; }; - 1A0C0E5A1777FC9F00838530 /* prime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = prime.h; sourceTree = "<group>"; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 1A0C0E0A1777FC7400838530 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 1A0C0E111777FC7400838530 /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 1A0C0E041777FC7400838530 = { - isa = PBXGroup; - children = ( - 1A0C0E1E1777FC9F00838530 /* include */, - 1A0C0E3A1777FC9F00838530 /* src */, - 1A0C0E0F1777FC7400838530 /* Frameworks */, - 1A0C0E0E1777FC7400838530 /* Products */, - ); - sourceTree = "<group>"; - }; - 1A0C0E0E1777FC7400838530 /* Products */ = { - isa = PBXGroup; - children = ( - 1A0C0E0D1777FC7400838530 /* libchipmunk.a */, - ); - name = Products; - sourceTree = "<group>"; - }; - 1A0C0E0F1777FC7400838530 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 1A0C0E101777FC7400838530 /* Foundation.framework */, - ); - name = Frameworks; - sourceTree = "<group>"; - }; - 1A0C0E1E1777FC9F00838530 /* include */ = { - isa = PBXGroup; - children = ( - 1A0C0E1F1777FC9F00838530 /* chipmunk */, - ); - name = include; - path = ../include; - sourceTree = "<group>"; - }; - 1A0C0E1F1777FC9F00838530 /* chipmunk */ = { - isa = PBXGroup; - children = ( - 1A0C0E201777FC9F00838530 /* chipmunk.h */, - 1A0C0E211777FC9F00838530 /* chipmunk_ffi.h */, - 1A0C0E221777FC9F00838530 /* chipmunk_private.h */, - 1A0C0E231777FC9F00838530 /* chipmunk_types.h */, - 1A0C0E241777FC9F00838530 /* chipmunk_unsafe.h */, - 1A0C0E251777FC9F00838530 /* constraints */, - 1A0C0E321777FC9F00838530 /* cpArbiter.h */, - 1A0C0E331777FC9F00838530 /* cpBB.h */, - 1A0C0E341777FC9F00838530 /* cpBody.h */, - 1A0C0E351777FC9F00838530 /* cpPolyShape.h */, - 1A0C0E361777FC9F00838530 /* cpShape.h */, - 1A0C0E371777FC9F00838530 /* cpSpace.h */, - 1A0C0E381777FC9F00838530 /* cpSpatialIndex.h */, - 1A0C0E391777FC9F00838530 /* cpVect.h */, - ); - path = chipmunk; - sourceTree = "<group>"; - }; - 1A0C0E251777FC9F00838530 /* constraints */ = { - isa = PBXGroup; - children = ( - 1A0C0E261777FC9F00838530 /* cpConstraint.h */, - 1A0C0E271777FC9F00838530 /* cpDampedRotarySpring.h */, - 1A0C0E281777FC9F00838530 /* cpDampedSpring.h */, - 1A0C0E291777FC9F00838530 /* cpGearJoint.h */, - 1A0C0E2A1777FC9F00838530 /* cpGrooveJoint.h */, - 1A0C0E2B1777FC9F00838530 /* cpPinJoint.h */, - 1A0C0E2C1777FC9F00838530 /* cpPivotJoint.h */, - 1A0C0E2D1777FC9F00838530 /* cpRatchetJoint.h */, - 1A0C0E2E1777FC9F00838530 /* cpRotaryLimitJoint.h */, - 1A0C0E2F1777FC9F00838530 /* cpSimpleMotor.h */, - 1A0C0E301777FC9F00838530 /* cpSlideJoint.h */, - 1A0C0E311777FC9F00838530 /* util.h */, - ); - path = constraints; - sourceTree = "<group>"; - }; - 1A0C0E3A1777FC9F00838530 /* src */ = { - isa = PBXGroup; - children = ( - 1A0C0E3B1777FC9F00838530 /* chipmunk.c */, - 1A0C0E3C1777FC9F00838530 /* CMakeLists.txt */, - 1A0C0E3D1777FC9F00838530 /* constraints */, - 1A0C0E491777FC9F00838530 /* cpArbiter.c */, - 1A0C0E4A1777FC9F00838530 /* cpArray.c */, - 1A0C0E4B1777FC9F00838530 /* cpBB.c */, - 1A0C0E4C1777FC9F00838530 /* cpBBTree.c */, - 1A0C0E4D1777FC9F00838530 /* cpBody.c */, - 1A0C0E4E1777FC9F00838530 /* cpCollision.c */, - 1A0C0E4F1777FC9F00838530 /* cpHashSet.c */, - 1A0C0E501777FC9F00838530 /* cpPolyShape.c */, - 1A0C0E511777FC9F00838530 /* cpShape.c */, - 1A0C0E521777FC9F00838530 /* cpSpace.c */, - 1A0C0E531777FC9F00838530 /* cpSpaceComponent.c */, - 1A0C0E541777FC9F00838530 /* cpSpaceHash.c */, - 1A0C0E551777FC9F00838530 /* cpSpaceQuery.c */, - 1A0C0E561777FC9F00838530 /* cpSpaceStep.c */, - 1A0C0E571777FC9F00838530 /* cpSpatialIndex.c */, - 1A0C0E581777FC9F00838530 /* cpSweep1D.c */, - 1A0C0E591777FC9F00838530 /* cpVect.c */, - 1A0C0E5A1777FC9F00838530 /* prime.h */, - ); - name = src; - path = ../src; - sourceTree = "<group>"; - }; - 1A0C0E3D1777FC9F00838530 /* constraints */ = { - isa = PBXGroup; - children = ( - 1A0C0E3E1777FC9F00838530 /* cpConstraint.c */, - 1A0C0E3F1777FC9F00838530 /* cpDampedRotarySpring.c */, - 1A0C0E401777FC9F00838530 /* cpDampedSpring.c */, - 1A0C0E411777FC9F00838530 /* cpGearJoint.c */, - 1A0C0E421777FC9F00838530 /* cpGrooveJoint.c */, - 1A0C0E431777FC9F00838530 /* cpPinJoint.c */, - 1A0C0E441777FC9F00838530 /* cpPivotJoint.c */, - 1A0C0E451777FC9F00838530 /* cpRatchetJoint.c */, - 1A0C0E461777FC9F00838530 /* cpRotaryLimitJoint.c */, - 1A0C0E471777FC9F00838530 /* cpSimpleMotor.c */, - 1A0C0E481777FC9F00838530 /* cpSlideJoint.c */, - ); - path = constraints; - sourceTree = "<group>"; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 1A0C0E0C1777FC7400838530 /* chipmunk */ = { - isa = PBXNativeTarget; - buildConfigurationList = 1A0C0E1B1777FC7400838530 /* Build configuration list for PBXNativeTarget "chipmunk" */; - buildPhases = ( - 1A0C0E091777FC7400838530 /* Sources */, - 1A0C0E0A1777FC7400838530 /* Frameworks */, - 1A0C0E0B1777FC7400838530 /* CopyFiles */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = chipmunk; - productName = chipmunk; - productReference = 1A0C0E0D1777FC7400838530 /* libchipmunk.a */; - productType = "com.apple.product-type.library.static"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 1A0C0E051777FC7400838530 /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0460; - }; - buildConfigurationList = 1A0C0E081777FC7400838530 /* Build configuration list for PBXProject "chipmunk" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - ); - mainGroup = 1A0C0E041777FC7400838530; - productRefGroup = 1A0C0E0E1777FC7400838530 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 1A0C0E0C1777FC7400838530 /* chipmunk */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXSourcesBuildPhase section */ - 1A0C0E091777FC7400838530 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 1A0C0E5B1777FC9F00838530 /* chipmunk.c in Sources */, - 1A0C0E5C1777FC9F00838530 /* cpConstraint.c in Sources */, - 1A0C0E5D1777FC9F00838530 /* cpDampedRotarySpring.c in Sources */, - 1A0C0E5E1777FC9F00838530 /* cpDampedSpring.c in Sources */, - 1A0C0E5F1777FC9F00838530 /* cpGearJoint.c in Sources */, - 1A0C0E601777FC9F00838530 /* cpGrooveJoint.c in Sources */, - 1A0C0E611777FC9F00838530 /* cpPinJoint.c in Sources */, - 1A0C0E621777FC9F00838530 /* cpPivotJoint.c in Sources */, - 1A0C0E631777FC9F00838530 /* cpRatchetJoint.c in Sources */, - 1A0C0E641777FC9F00838530 /* cpRotaryLimitJoint.c in Sources */, - 1A0C0E651777FC9F00838530 /* cpSimpleMotor.c in Sources */, - 1A0C0E661777FC9F00838530 /* cpSlideJoint.c in Sources */, - 1A0C0E671777FC9F00838530 /* cpArbiter.c in Sources */, - 1A0C0E681777FC9F00838530 /* cpArray.c in Sources */, - 1A0C0E691777FC9F00838530 /* cpBB.c in Sources */, - 1A0C0E6A1777FC9F00838530 /* cpBBTree.c in Sources */, - 1A0C0E6B1777FC9F00838530 /* cpBody.c in Sources */, - 1A0C0E6C1777FC9F00838530 /* cpCollision.c in Sources */, - 1A0C0E6D1777FC9F00838530 /* cpHashSet.c in Sources */, - 1A0C0E6E1777FC9F00838530 /* cpPolyShape.c in Sources */, - 1A0C0E6F1777FC9F00838530 /* cpShape.c in Sources */, - 1A0C0E701777FC9F00838530 /* cpSpace.c in Sources */, - 1A0C0E711777FC9F00838530 /* cpSpaceComponent.c in Sources */, - 1A0C0E721777FC9F00838530 /* cpSpaceHash.c in Sources */, - 1A0C0E731777FC9F00838530 /* cpSpaceQuery.c in Sources */, - 1A0C0E741777FC9F00838530 /* cpSpaceStep.c in Sources */, - 1A0C0E751777FC9F00838530 /* cpSpatialIndex.c in Sources */, - 1A0C0E761777FC9F00838530 /* cpSweep1D.c in Sources */, - 1A0C0E771777FC9F00838530 /* cpVect.c in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 1A0C0E191777FC7400838530 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; - CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = macosx; - }; - name = Debug; - }; - 1A0C0E1A1777FC7400838530 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; - CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = YES; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_PREPROCESSOR_DEFINITIONS = NDEBUG; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - SDKROOT = macosx; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 1A0C0E1C1777FC7400838530 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - DSTROOT = /tmp/chipmunk.dst; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "chipmunk-Prefix.pch"; - HEADER_SEARCH_PATHS = "\"$(SRCROOT)/../include/chipmunk\""; - PRODUCT_NAME = "$(TARGET_NAME)"; - SKIP_INSTALL = YES; - }; - name = Debug; - }; - 1A0C0E1D1777FC7400838530 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - DSTROOT = /tmp/chipmunk.dst; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "chipmunk-Prefix.pch"; - HEADER_SEARCH_PATHS = "\"$(SRCROOT)/../include/chipmunk\""; - PRODUCT_NAME = "$(TARGET_NAME)"; - SKIP_INSTALL = YES; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 1A0C0E081777FC7400838530 /* Build configuration list for PBXProject "chipmunk" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1A0C0E191777FC7400838530 /* Debug */, - 1A0C0E1A1777FC7400838530 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 1A0C0E1B1777FC7400838530 /* Build configuration list for PBXNativeTarget "chipmunk" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1A0C0E1C1777FC7400838530 /* Debug */, - 1A0C0E1D1777FC7400838530 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 1A0C0E051777FC7400838530 /* Project object */; -} diff --git a/external/chipmunk/proj.nacl/Makefile b/external/chipmunk/proj.nacl/Makefile deleted file mode 100644 index 22c4a93d07..0000000000 --- a/external/chipmunk/proj.nacl/Makefile +++ /dev/null @@ -1,58 +0,0 @@ -NACL_ARCH ?= x86_64 -NACL_AR ?= $(NACL_ARCH)-nacl-ar -NACL_CC ?= $(NACL_ARCH)-nacl-gcc -NACL_CXX ?= $(NACL_ARCH)-nacl-g++ -CCFLAGS = -Wall -std=gnu99 -CXXFLAGS = -Wall -VISIBILITY = -ARFLAGS = cr - -LIBS = - -INCLUDES = -I../include/chipmunk - -SOURCES = ../src/chipmunk.c \ -../src/cpBody.c \ -../src/cpSpace.c \ -../src/cpSpatialIndex.c \ -../src/cpArbiter.c \ -../src/cpCollision.c \ -../src/cpSpaceComponent.c \ -../src/cpSweep1D.c \ -../src/cpArray.c \ -../src/cpHashSet.c \ -../src/cpSpaceHash.c \ -../src/cpVect.c \ -../src/cpBB.c \ -../src/cpPolyShape.c \ -../src/cpSpaceQuery.c \ -../src/cpBBTree.c \ -../src/cpShape.c \ -../src/cpSpaceStep.c \ -../src/constraints/cpConstraint.c \ -../src/constraints/cpPivotJoint.c \ -../src/constraints/cpDampedRotarySpring.c \ -../src/constraints/cpRatchetJoint.c \ -../src/constraints/cpDampedSpring.c \ -../src/constraints/cpRotaryLimitJoint.c \ -../src/constraints/cpGearJoint.c \ -../src/constraints/cpSimpleMotor.c \ -../src/constraints/cpGrooveJoint.c \ -../src/constraints/cpSlideJoint.c \ -../src/constraints/cpPinJoint.c - -COCOS_ROOT = ../../.. - -include $(COCOS_ROOT)/cocos2dx/proj.nacl/cocos2dx.mk - -TARGET = $(LIB_DIR)/libchipmunk.a - -all: $(TARGET) - -$(TARGET): $(OBJECTS) $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(LOG_AR)$(NACL_AR) $(ARFLAGS) $(TARGET) $(OBJECTS) - -$(OBJ_DIR)/%.o: ../%.c $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(LOG_CC)$(NACL_CC) -MMD $(CCFLAGS) $(INCLUDES) $(DEFINES) $(VISIBILITY) -c $< -o $@ diff --git a/external/chipmunk/proj.qt5/chipmunk.pro b/external/chipmunk/proj.qt5/chipmunk.pro deleted file mode 100644 index 2e1f180363..0000000000 --- a/external/chipmunk/proj.qt5/chipmunk.pro +++ /dev/null @@ -1,15 +0,0 @@ - -include(../../../cocos2dx/proj.qt5/common.pri) - -TEMPLATE = lib -CONFIG += static - -SOURCES += $$files(../src/*.c) -SOURCES += $$files(../src/constraints/*.c) - -QMAKE_CFLAGS += -std=gnu99 - -INCLUDEPATH += ../include/chipmunk - -TARGET = $${LIB_OUTPUT_DIR}/chipmunk - diff --git a/external/chipmunk/proj.tizen/.cproject b/external/chipmunk/proj.tizen/.cproject deleted file mode 100644 index e10f790b62..0000000000 --- a/external/chipmunk/proj.tizen/.cproject +++ /dev/null @@ -1,326 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage"> - <storageModule moduleId="org.eclipse.cdt.core.settings"> - <cconfiguration id="org.tizen.nativecpp.config.sbi.gcc45.lib.debug.emulator.1855378280"> - <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="org.tizen.nativecpp.config.sbi.gcc45.lib.debug.emulator.1855378280" moduleId="org.eclipse.cdt.core.settings" name="Debug-Tizen-Emulator"> - <externalSettings/> - <extensions> - <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/> - <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - </extensions> - </storageModule> - <storageModule moduleId="cdtBuildSystem" version="4.0.0"> - <configuration artifactExtension="a" artifactName="chipmunk" buildArtefactType="org.tizen.nativecpp.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.tizen.nativecpp.buildArtefactType.staticLib" cleanCommand="rm -f" description="" errorParsers="org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;" id="org.tizen.nativecpp.config.sbi.gcc45.lib.debug.emulator.1855378280" name="Debug-Tizen-Emulator" parent="org.tizen.nativecpp.config.sbi.gcc45.lib.debug.emulator"> - <folderInfo id="org.tizen.nativecpp.config.sbi.gcc45.lib.debug.emulator.1855378280." name="/" resourcePath=""> - <toolChain id="org.tizen.nativecpp.toolchain.sbi.gcc45.lib.debug.emulator.2014007899" name="Tizen Native Toolchain" superClass="org.tizen.nativecpp.toolchain.sbi.gcc45.lib.debug.emulator"> - <targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="org.tizen.nativeide.target.sbi.gnu.platform.base.1067387441" osList="linux,win32" superClass="org.tizen.nativeide.target.sbi.gnu.platform.base"/> - <builder autoBuildTarget="all" buildPath="${workspace_loc:/chipmunk/Debug-Tizen-Emulator}" enableAutoBuild="true" id="org.tizen.nativecpp.target.sbi.gnu.builder.1261707379" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Tizen Application Builder" superClass="org.tizen.nativecpp.target.sbi.gnu.builder"/> - <tool command="i386-linux-gnueabi-ar.exe" id="org.tizen.nativecpp.tool.sbi.gnu.archiver.689316005" name="Archiver" superClass="org.tizen.nativecpp.tool.sbi.gnu.archiver"/> - <tool command="clang++.exe" id="org.tizen.nativecpp.tool.sbi.gnu.cpp.compiler.1533358351" name="C++ Compiler" superClass="org.tizen.nativecpp.tool.sbi.gnu.cpp.compiler"> - <option id="gnu.cpp.compiler.option.optimization.level.1726560828" name="Optimization Level" superClass="gnu.cpp.compiler.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/> - <option id="sbi.gnu.cpp.compiler.option.debugging.level.1554282679" name="Debug level" superClass="sbi.gnu.cpp.compiler.option.debugging.level" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/> - <option id="sbi.gnu.cpp.compiler.option.debug.applog.1800109419" name="Enable application logging (-D_APP_LOG)" superClass="sbi.gnu.cpp.compiler.option.debug.applog" value="true" valueType="boolean"/> - <option id="sbi.gnu.cpp.compiler.option.796499718" name="Tizen-Target" superClass="sbi.gnu.cpp.compiler.option" valueType="userObjs"> - <listOptionValue builtIn="false" value="tizen-emulator-2.2.native_llvm31.i386.cpp.staticLib"/> - </option> - <option id="gnu.cpp.compiler.option.include.paths.1887202981" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath"> - <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/inc}""/> - </option> - <option id="sbi.gnu.cpp.compiler.option.frameworks.cpp.140749819" name="Tizen-Frameworks" superClass="sbi.gnu.cpp.compiler.option.frameworks.cpp" valueType="userObjs"> - <listOptionValue builtIn="false" value="osp-static"/> - </option> - <option id="sbi.gnu.cpp.compiler.option.frameworks_inc.cpp.1250550482" name="Tizen-Frameworks-Include-Path" superClass="sbi.gnu.cpp.compiler.option.frameworks_inc.cpp" valueType="includePath"> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/libxml2""/> - <listOptionValue builtIn="false" value=""C:\tizen-sdk\library""/> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include""/> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/osp""/> - </option> - <option id="sbi.gnu.cpp.compiler.option.frameworks_cflags.cpp.1942713160" name="Tizen-Frameworks-Other-Cflags" superClass="sbi.gnu.cpp.compiler.option.frameworks_cflags.cpp" valueType="stringList"> - <listOptionValue builtIn="false" value="-target i386-tizen-linux-gnueabi -gcc-toolchain C:/tizen-sdk/tools/smart-build-interface/../i386-linux-gnueabi-gcc-4.5/ -ccc-gcc-name i386-linux-gnueabi-g++ -march=i386 -Wno-gnu"/> - <listOptionValue builtIn="false" value=" -fPIC"/> - <listOptionValue builtIn="false" value="--sysroot="${SBI_SYSROOT}""/> - </option> - <option id="gnu.cpp.compiler.option.preprocessor.def.67860287" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" valueType="definedSymbols"> - <listOptionValue builtIn="false" value="_DEBUG"/> - </option> - <inputType id="sbi.gnu.cpp.compiler.tizen.inputType.2085750802" superClass="sbi.gnu.cpp.compiler.tizen.inputType"/> - </tool> - <tool command="clang.exe" id="org.tizen.nativecpp.tool.sbi.gnu.c.compiler.263460224" name="C Compiler" superClass="org.tizen.nativecpp.tool.sbi.gnu.c.compiler"> - <option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.option.optimization.level.819197061" name="Optimization Level" superClass="gnu.c.compiler.option.optimization.level" valueType="enumerated"/> - <option id="sbi.gnu.c.compiler.option.debugging.level.709891206" name="Debug level" superClass="sbi.gnu.c.compiler.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/> - <option id="sbi.gnu.c.compiler.option.debug.applog.1166511754" name="Enable application logging (-D_APP_LOG)" superClass="sbi.gnu.c.compiler.option.debug.applog" value="true" valueType="boolean"/> - <option id="sbi.gnu.c.compiler.option.1738169580" name="Tizen-Target" superClass="sbi.gnu.c.compiler.option" valueType="userObjs"> - <listOptionValue builtIn="false" value="tizen-emulator-2.2.native_llvm31.i386.cpp.staticLib"/> - </option> - <option id="gnu.c.compiler.option.include.paths.821405214" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath"> - <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/inc}""/> - <listOptionValue builtIn="false" value="../../include/chipmunk"/> - </option> - <option id="sbi.gnu.c.compiler.option.frameworks.cpp.229730784" name="Tizen-Frameworks" superClass="sbi.gnu.c.compiler.option.frameworks.cpp" valueType="userObjs"> - <listOptionValue builtIn="false" value="osp-static"/> - </option> - <option id="sbi.gnu.c.compiler.option.frameworks_inc.cpp.1139638882" name="Tizen-Frameworks-Include-Path" superClass="sbi.gnu.c.compiler.option.frameworks_inc.cpp" valueType="includePath"> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/libxml2""/> - <listOptionValue builtIn="false" value=""C:\tizen-sdk\library""/> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include""/> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/osp""/> - </option> - <option id="sbi.gnu.c.compiler.option.frameworks_cflags.cpp.1131449804" name="Tizen-Frameworks-Other-Cflags" superClass="sbi.gnu.c.compiler.option.frameworks_cflags.cpp" valueType="stringList"> - <listOptionValue builtIn="false" value="-target i386-tizen-linux-gnueabi -gcc-toolchain C:/tizen-sdk/tools/smart-build-interface/../i386-linux-gnueabi-gcc-4.5/ -ccc-gcc-name i386-linux-gnueabi-g++ -march=i386 -Wno-gnu"/> - <listOptionValue builtIn="false" value=" -fPIC"/> - <listOptionValue builtIn="false" value="--sysroot="${SBI_SYSROOT}""/> - </option> - <option id="gnu.c.compiler.option.preprocessor.def.symbols.31661523" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" valueType="definedSymbols"> - <listOptionValue builtIn="false" value="_DEBUG"/> - </option> - <inputType id="sbi.gnu.c.compiler.tizen.inputType.94264147" superClass="sbi.gnu.c.compiler.tizen.inputType"/> - </tool> - <tool id="org.tizen.nativeide.tool.sbi.gnu.c.linker.base.792552065" name="C Linker" superClass="org.tizen.nativeide.tool.sbi.gnu.c.linker.base"/> - <tool command="clang++.exe" id="org.tizen.nativecpp.tool.sbi.gnu.cpp.linker.1518096171" name="C++ Linker" superClass="org.tizen.nativecpp.tool.sbi.gnu.cpp.linker"> - <option id="gnu.cpp.link.option.paths.43791296" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths" valueType="libPaths"> - <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/lib}""/> - </option> - <option id="sbi.gnu.cpp.linker.option.frameworks_lflags.cpp.181465864" name="Tizen-Frameworks-Other-Lflags" superClass="sbi.gnu.cpp.linker.option.frameworks_lflags.cpp" valueType="stringList"> - <listOptionValue builtIn="false" value="-target i386-tizen-linux-gnueabi -gcc-toolchain C:/tizen-sdk/tools/smart-build-interface/../i386-linux-gnueabi-gcc-4.5/ -ccc-gcc-name i386-linux-gnueabi-g++ -march=i386 -Xlinker --as-needed"/> - <listOptionValue builtIn="false" value="--sysroot="${SBI_SYSROOT}""/> - </option> - </tool> - <tool command="i386-linux-gnueabi-as.exe" id="org.tizen.nativeapp.tool.sbi.gnu.assembler.base.165476943" name="Assembler" superClass="org.tizen.nativeapp.tool.sbi.gnu.assembler.base"> - <inputType id="cdt.managedbuild.tool.gnu.assembler.input.517365643" superClass="cdt.managedbuild.tool.gnu.assembler.input"/> - </tool> - <tool id="org.tizen.nativecpp.tool.sbi.po.compiler.254627421" name="PO Resource Compiler" superClass="org.tizen.nativecpp.tool.sbi.po.compiler"/> - <tool id="org.tizen.nativecpp.tool.sbi.edc.compiler.8480881" name="EDC Resource Compiler" superClass="org.tizen.nativecpp.tool.sbi.edc.compiler"/> - </toolChain> - </folderInfo> - <sourceEntries> - <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/> - <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="inc"/> - </sourceEntries> - </configuration> - </storageModule> - <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> - </cconfiguration> - <cconfiguration id="org.tizen.nativecpp.config.sbi.gcc45.lib.debug.device.1240851129"> - <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="org.tizen.nativecpp.config.sbi.gcc45.lib.debug.device.1240851129" moduleId="org.eclipse.cdt.core.settings" name="Debug-Tizen-Device"> - <externalSettings/> - <extensions> - <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/> - <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - </extensions> - </storageModule> - <storageModule moduleId="cdtBuildSystem" version="4.0.0"> - <configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.tizen.nativecpp.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.tizen.nativecpp.buildArtefactType.staticLib" cleanCommand="rm -f" description="" errorParsers="org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;" id="org.tizen.nativecpp.config.sbi.gcc45.lib.debug.device.1240851129" name="Debug-Tizen-Device" parent="org.tizen.nativecpp.config.sbi.gcc45.lib.debug.device"> - <folderInfo id="org.tizen.nativecpp.config.sbi.gcc45.lib.debug.device.1240851129." name="/" resourcePath=""> - <toolChain id="org.tizen.nativecpp.toolchain.sbi.gcc45.lib.debug.device.1011815399" name="Tizen Native Toolchain" superClass="org.tizen.nativecpp.toolchain.sbi.gcc45.lib.debug.device"> - <targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="org.tizen.nativeide.target.sbi.gnu.platform.base.205106495" osList="linux,win32" superClass="org.tizen.nativeide.target.sbi.gnu.platform.base"/> - <builder buildPath="${workspace_loc:/chipmunk/Debug-Tizen-Device}" id="org.tizen.nativecpp.target.sbi.gnu.builder.391616426" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Tizen Application Builder" superClass="org.tizen.nativecpp.target.sbi.gnu.builder"/> - <tool command="arm-linux-gnueabi-ar.exe" id="org.tizen.nativecpp.tool.sbi.gnu.archiver.1946190238" name="Archiver" superClass="org.tizen.nativecpp.tool.sbi.gnu.archiver"/> - <tool command="clang++.exe" id="org.tizen.nativecpp.tool.sbi.gnu.cpp.compiler.806237946" name="C++ Compiler" superClass="org.tizen.nativecpp.tool.sbi.gnu.cpp.compiler"> - <option id="gnu.cpp.compiler.option.optimization.level.1141078136" name="Optimization Level" superClass="gnu.cpp.compiler.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/> - <option id="sbi.gnu.cpp.compiler.option.debugging.level.412266760" name="Debug level" superClass="sbi.gnu.cpp.compiler.option.debugging.level" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/> - <option id="sbi.gnu.cpp.compiler.option.debug.applog.48357772" name="Enable application logging (-D_APP_LOG)" superClass="sbi.gnu.cpp.compiler.option.debug.applog" value="true" valueType="boolean"/> - <option id="sbi.gnu.cpp.compiler.option.738324429" name="Tizen-Target" superClass="sbi.gnu.cpp.compiler.option" valueType="userObjs"> - <listOptionValue builtIn="false" value="tizen-device-2.2.native_llvm31.armel.cpp.staticLib"/> - </option> - <option id="gnu.cpp.compiler.option.include.paths.1372067183" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath"> - <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/inc}""/> - </option> - <option id="sbi.gnu.cpp.compiler.option.frameworks.cpp.1270990666" name="Tizen-Frameworks" superClass="sbi.gnu.cpp.compiler.option.frameworks.cpp" valueType="userObjs"> - <listOptionValue builtIn="false" value="osp-static"/> - </option> - <option id="sbi.gnu.cpp.compiler.option.frameworks_inc.cpp.579636391" name="Tizen-Frameworks-Include-Path" superClass="sbi.gnu.cpp.compiler.option.frameworks_inc.cpp" valueType="includePath"> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/libxml2""/> - <listOptionValue builtIn="false" value=""C:\tizen-sdk\library""/> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include""/> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/osp""/> - </option> - <option id="sbi.gnu.cpp.compiler.option.frameworks_cflags.cpp.1644102691" name="Tizen-Frameworks-Other-Cflags" superClass="sbi.gnu.cpp.compiler.option.frameworks_cflags.cpp" valueType="stringList"> - <listOptionValue builtIn="false" value="-target arm-tizen-linux-gnueabi -gcc-toolchain C:/tizen-sdk/tools/smart-build-interface/../arm-linux-gnueabi-gcc-4.5/ -ccc-gcc-name arm-linux-gnueabi-g++ -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -mtune=cortex-a8 -Wno-gnu"/> - <listOptionValue builtIn="false" value=" -fPIC"/> - <listOptionValue builtIn="false" value="--sysroot="${SBI_SYSROOT}""/> - </option> - <option id="gnu.cpp.compiler.option.preprocessor.def.1398462050" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" valueType="definedSymbols"> - <listOptionValue builtIn="false" value="_DEBUG"/> - </option> - <inputType id="sbi.gnu.cpp.compiler.tizen.inputType.1890676098" superClass="sbi.gnu.cpp.compiler.tizen.inputType"/> - </tool> - <tool command="clang.exe" id="org.tizen.nativecpp.tool.sbi.gnu.c.compiler.800077346" name="C Compiler" superClass="org.tizen.nativecpp.tool.sbi.gnu.c.compiler"> - <option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.option.optimization.level.73052907" name="Optimization Level" superClass="gnu.c.compiler.option.optimization.level" valueType="enumerated"/> - <option id="sbi.gnu.c.compiler.option.debugging.level.641100997" name="Debug level" superClass="sbi.gnu.c.compiler.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/> - <option id="sbi.gnu.c.compiler.option.debug.applog.2000116514" name="Enable application logging (-D_APP_LOG)" superClass="sbi.gnu.c.compiler.option.debug.applog" value="true" valueType="boolean"/> - <option id="sbi.gnu.c.compiler.option.1751855743" name="Tizen-Target" superClass="sbi.gnu.c.compiler.option" valueType="userObjs"> - <listOptionValue builtIn="false" value="tizen-device-2.2.native_llvm31.armel.cpp.staticLib"/> - </option> - <option id="gnu.c.compiler.option.include.paths.1641648644" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath"> - <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/inc}""/> - <listOptionValue builtIn="false" value="../../include/chipmunk"/> - </option> - <option id="sbi.gnu.c.compiler.option.frameworks.cpp.356824867" name="Tizen-Frameworks" superClass="sbi.gnu.c.compiler.option.frameworks.cpp" valueType="userObjs"> - <listOptionValue builtIn="false" value="osp-static"/> - </option> - <option id="sbi.gnu.c.compiler.option.frameworks_inc.cpp.843251170" name="Tizen-Frameworks-Include-Path" superClass="sbi.gnu.c.compiler.option.frameworks_inc.cpp" valueType="includePath"> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/libxml2""/> - <listOptionValue builtIn="false" value=""C:\tizen-sdk\library""/> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include""/> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/osp""/> - </option> - <option id="sbi.gnu.c.compiler.option.frameworks_cflags.cpp.2073478823" name="Tizen-Frameworks-Other-Cflags" superClass="sbi.gnu.c.compiler.option.frameworks_cflags.cpp" valueType="stringList"> - <listOptionValue builtIn="false" value="-target arm-tizen-linux-gnueabi -gcc-toolchain C:/tizen-sdk/tools/smart-build-interface/../arm-linux-gnueabi-gcc-4.5/ -ccc-gcc-name arm-linux-gnueabi-g++ -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -mtune=cortex-a8 -Wno-gnu"/> - <listOptionValue builtIn="false" value=" -fPIC"/> - <listOptionValue builtIn="false" value="--sysroot="${SBI_SYSROOT}""/> - </option> - <option id="gnu.c.compiler.option.preprocessor.def.symbols.1732125980" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" valueType="definedSymbols"> - <listOptionValue builtIn="false" value="_DEBUG"/> - </option> - <inputType id="sbi.gnu.c.compiler.tizen.inputType.565155338" superClass="sbi.gnu.c.compiler.tizen.inputType"/> - </tool> - <tool id="org.tizen.nativeide.tool.sbi.gnu.c.linker.base.1321059471" name="C Linker" superClass="org.tizen.nativeide.tool.sbi.gnu.c.linker.base"/> - <tool command="clang++.exe" id="org.tizen.nativecpp.tool.sbi.gnu.cpp.linker.517614783" name="C++ Linker" superClass="org.tizen.nativecpp.tool.sbi.gnu.cpp.linker"> - <option id="gnu.cpp.link.option.paths.316493253" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths" valueType="libPaths"> - <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/lib}""/> - </option> - <option id="sbi.gnu.cpp.linker.option.frameworks_lflags.cpp.557112687" name="Tizen-Frameworks-Other-Lflags" superClass="sbi.gnu.cpp.linker.option.frameworks_lflags.cpp" valueType="stringList"> - <listOptionValue builtIn="false" value="-target arm-tizen-linux-gnueabi -gcc-toolchain C:/tizen-sdk/tools/smart-build-interface/../arm-linux-gnueabi-gcc-4.5/ -ccc-gcc-name arm-linux-gnueabi-g++ -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -mtune=cortex-a8 -Xlinker --as-needed"/> - <listOptionValue builtIn="false" value="--sysroot="${SBI_SYSROOT}""/> - </option> - </tool> - <tool command="arm-linux-gnueabi-as.exe" id="org.tizen.nativeapp.tool.sbi.gnu.assembler.base.1047247012" name="Assembler" superClass="org.tizen.nativeapp.tool.sbi.gnu.assembler.base"> - <inputType id="cdt.managedbuild.tool.gnu.assembler.input.1262361730" superClass="cdt.managedbuild.tool.gnu.assembler.input"/> - </tool> - <tool id="org.tizen.nativecpp.tool.sbi.po.compiler.1138371781" name="PO Resource Compiler" superClass="org.tizen.nativecpp.tool.sbi.po.compiler"/> - <tool id="org.tizen.nativecpp.tool.sbi.edc.compiler.2045899075" name="EDC Resource Compiler" superClass="org.tizen.nativecpp.tool.sbi.edc.compiler"/> - </toolChain> - </folderInfo> - <sourceEntries> - <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/> - <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="inc"/> - </sourceEntries> - </configuration> - </storageModule> - <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> - </cconfiguration> - <cconfiguration id="org.tizen.nativecpp.config.sbi.gcc45.lib.release.2023052084"> - <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="org.tizen.nativecpp.config.sbi.gcc45.lib.release.2023052084" moduleId="org.eclipse.cdt.core.settings" name="Release"> - <externalSettings/> - <extensions> - <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/> - <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - </extensions> - </storageModule> - <storageModule moduleId="cdtBuildSystem" version="4.0.0"> - <configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.tizen.nativecpp.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release,org.eclipse.cdt.build.core.buildArtefactType=org.tizen.nativecpp.buildArtefactType.staticLib" cleanCommand="rm -f" description="" errorParsers="org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;" id="org.tizen.nativecpp.config.sbi.gcc45.lib.release.2023052084" name="Release" parent="org.tizen.nativecpp.config.sbi.gcc45.lib.release"> - <folderInfo id="org.tizen.nativecpp.config.sbi.gcc45.lib.release.2023052084." name="/" resourcePath=""> - <toolChain id="org.tizen.nativecpp.toolchain.sbi.gcc45.lib.release.1978438453" name="Tizen Native Toolchain" superClass="org.tizen.nativecpp.toolchain.sbi.gcc45.lib.release"> - <targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="org.tizen.nativeide.target.sbi.gnu.platform.base.216744962" osList="linux,win32" superClass="org.tizen.nativeide.target.sbi.gnu.platform.base"/> - <builder buildPath="${workspace_loc:/chipmunk/Release}" id="org.tizen.nativecpp.target.sbi.gnu.builder.2102360604" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Tizen Application Builder" superClass="org.tizen.nativecpp.target.sbi.gnu.builder"/> - <tool command="i386-linux-gnueabi-ar.exe" id="org.tizen.nativecpp.tool.sbi.gnu.archiver.1826014056" name="Archiver" superClass="org.tizen.nativecpp.tool.sbi.gnu.archiver"/> - <tool command="clang++.exe" id="org.tizen.nativecpp.tool.sbi.gnu.cpp.compiler.2111905100" name="C++ Compiler" superClass="org.tizen.nativecpp.tool.sbi.gnu.cpp.compiler"> - <option id="gnu.cpp.compiler.option.optimization.level.1297088223" name="Optimization Level" superClass="gnu.cpp.compiler.option.optimization.level" value="gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/> - <option id="sbi.gnu.cpp.compiler.option.debugging.level.459894355" name="Debug level" superClass="sbi.gnu.cpp.compiler.option.debugging.level"/> - <option id="sbi.gnu.cpp.compiler.option.debug.applog.849008186" name="Enable application logging (-D_APP_LOG)" superClass="sbi.gnu.cpp.compiler.option.debug.applog"/> - <option id="sbi.gnu.cpp.compiler.option.74299026" name="Tizen-Target" superClass="sbi.gnu.cpp.compiler.option" valueType="userObjs"> - <listOptionValue builtIn="false" value="tizen-emulator-2.2.native_llvm31.i386.cpp.staticLib"/> - </option> - <option id="gnu.cpp.compiler.option.include.paths.1217915212" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath"> - <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/inc}""/> - </option> - <option id="sbi.gnu.cpp.compiler.option.frameworks.cpp.448934412" name="Tizen-Frameworks" superClass="sbi.gnu.cpp.compiler.option.frameworks.cpp" valueType="userObjs"> - <listOptionValue builtIn="false" value="osp-static"/> - </option> - <option id="sbi.gnu.cpp.compiler.option.frameworks_inc.cpp.1627502718" name="Tizen-Frameworks-Include-Path" superClass="sbi.gnu.cpp.compiler.option.frameworks_inc.cpp" valueType="includePath"> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/libxml2""/> - <listOptionValue builtIn="false" value=""C:\tizen-sdk\library""/> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include""/> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/osp""/> - </option> - <option id="sbi.gnu.cpp.compiler.option.frameworks_cflags.cpp.138455270" name="Tizen-Frameworks-Other-Cflags" superClass="sbi.gnu.cpp.compiler.option.frameworks_cflags.cpp" valueType="stringList"> - <listOptionValue builtIn="false" value="-target i386-tizen-linux-gnueabi -gcc-toolchain C:/tizen-sdk/tools/smart-build-interface/../i386-linux-gnueabi-gcc-4.5/ -ccc-gcc-name i386-linux-gnueabi-g++ -march=i386 -Wno-gnu"/> - <listOptionValue builtIn="false" value=" -fPIC"/> - <listOptionValue builtIn="false" value="--sysroot="${SBI_SYSROOT}""/> - </option> - <inputType id="sbi.gnu.cpp.compiler.tizen.inputType.1145329261" superClass="sbi.gnu.cpp.compiler.tizen.inputType"/> - </tool> - <tool command="clang.exe" id="org.tizen.nativecpp.tool.sbi.gnu.c.compiler.19577634" name="C Compiler" superClass="org.tizen.nativecpp.tool.sbi.gnu.c.compiler"> - <option defaultValue="gnu.c.optimization.level.most" id="gnu.c.compiler.option.optimization.level.1635131080" name="Optimization Level" superClass="gnu.c.compiler.option.optimization.level" valueType="enumerated"/> - <option id="sbi.gnu.c.compiler.option.debugging.level.220381318" name="Debug level" superClass="sbi.gnu.c.compiler.option.debugging.level"/> - <option id="sbi.gnu.c.compiler.option.debug.applog.753089515" name="Enable application logging (-D_APP_LOG)" superClass="sbi.gnu.c.compiler.option.debug.applog"/> - <option id="sbi.gnu.c.compiler.option.215142124" name="Tizen-Target" superClass="sbi.gnu.c.compiler.option" valueType="userObjs"> - <listOptionValue builtIn="false" value="tizen-emulator-2.2.native_llvm31.i386.cpp.staticLib"/> - </option> - <option id="gnu.c.compiler.option.include.paths.632347119" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath"> - <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/inc}""/> - </option> - <option id="sbi.gnu.c.compiler.option.frameworks.cpp.1474026339" name="Tizen-Frameworks" superClass="sbi.gnu.c.compiler.option.frameworks.cpp" valueType="userObjs"> - <listOptionValue builtIn="false" value="osp-static"/> - </option> - <option id="sbi.gnu.c.compiler.option.frameworks_inc.cpp.468493190" name="Tizen-Frameworks-Include-Path" superClass="sbi.gnu.c.compiler.option.frameworks_inc.cpp" valueType="includePath"> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/libxml2""/> - <listOptionValue builtIn="false" value=""C:\tizen-sdk\library""/> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include""/> - <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/osp""/> - </option> - <option id="sbi.gnu.c.compiler.option.frameworks_cflags.cpp.1218800554" name="Tizen-Frameworks-Other-Cflags" superClass="sbi.gnu.c.compiler.option.frameworks_cflags.cpp" valueType="stringList"> - <listOptionValue builtIn="false" value="-target i386-tizen-linux-gnueabi -gcc-toolchain C:/tizen-sdk/tools/smart-build-interface/../i386-linux-gnueabi-gcc-4.5/ -ccc-gcc-name i386-linux-gnueabi-g++ -march=i386 -Wno-gnu"/> - <listOptionValue builtIn="false" value=" -fPIC"/> - <listOptionValue builtIn="false" value="--sysroot="${SBI_SYSROOT}""/> - </option> - <inputType id="sbi.gnu.c.compiler.tizen.inputType.1344515254" superClass="sbi.gnu.c.compiler.tizen.inputType"/> - </tool> - <tool id="org.tizen.nativeide.tool.sbi.gnu.c.linker.base.59626261" name="C Linker" superClass="org.tizen.nativeide.tool.sbi.gnu.c.linker.base"/> - <tool command="clang++.exe" id="org.tizen.nativecpp.tool.sbi.gnu.cpp.linker.563167499" name="C++ Linker" superClass="org.tizen.nativecpp.tool.sbi.gnu.cpp.linker"> - <option id="gnu.cpp.link.option.paths.618042967" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths" valueType="libPaths"> - <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/lib}""/> - </option> - <option id="sbi.gnu.cpp.linker.option.frameworks_lflags.cpp.620416347" name="Tizen-Frameworks-Other-Lflags" superClass="sbi.gnu.cpp.linker.option.frameworks_lflags.cpp" valueType="stringList"> - <listOptionValue builtIn="false" value="-target i386-tizen-linux-gnueabi -gcc-toolchain C:/tizen-sdk/tools/smart-build-interface/../i386-linux-gnueabi-gcc-4.5/ -ccc-gcc-name i386-linux-gnueabi-g++ -march=i386 -Xlinker --as-needed"/> - <listOptionValue builtIn="false" value="--sysroot="${SBI_SYSROOT}""/> - </option> - </tool> - <tool command="i386-linux-gnueabi-as.exe" id="org.tizen.nativeapp.tool.sbi.gnu.assembler.base.1990045494" name="Assembler" superClass="org.tizen.nativeapp.tool.sbi.gnu.assembler.base"> - <inputType id="cdt.managedbuild.tool.gnu.assembler.input.879926948" superClass="cdt.managedbuild.tool.gnu.assembler.input"/> - </tool> - <tool id="org.tizen.nativecpp.tool.sbi.po.compiler.1674758948" name="PO Resource Compiler" superClass="org.tizen.nativecpp.tool.sbi.po.compiler"/> - <tool id="org.tizen.nativecpp.tool.sbi.edc.compiler.1792629643" name="EDC Resource Compiler" superClass="org.tizen.nativecpp.tool.sbi.edc.compiler"/> - </toolChain> - </folderInfo> - <sourceEntries> - <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/> - <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="inc"/> - </sourceEntries> - </configuration> - </storageModule> - <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> - </cconfiguration> - </storageModule> - <storageModule moduleId="cdtBuildSystem" version="4.0.0"> - <project id="chipmunk.org.tizen.nativecpp.target.sbi.gcc45.lib.1874463476" name="Tizen Static Library" projectType="org.tizen.nativecpp.target.sbi.gcc45.lib"/> - </storageModule> - <storageModule moduleId="scannerConfiguration"> - <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/> - <scannerConfigBuildInfo instanceId="org.tizen.nativecpp.config.sbi.gcc45.lib.debug.emulator.1855378280"> - <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.tizen.nativecommon.TizenGCCManagedMakePerProjectProfileCPP"/> - </scannerConfigBuildInfo> - <scannerConfigBuildInfo instanceId="org.tizen.nativecpp.config.sbi.gcc45.lib.release.2023052084"> - <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.tizen.nativecommon.TizenGCCManagedMakePerProjectProfileCPP"/> - </scannerConfigBuildInfo> - <scannerConfigBuildInfo instanceId="org.tizen.nativecpp.config.sbi.gcc45.lib.debug.device.1240851129"> - <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.tizen.nativecommon.TizenGCCManagedMakePerProjectProfileCPP"/> - </scannerConfigBuildInfo> - </storageModule> - <storageModule moduleId="com.samsung.tizen.nativeapp.projectInfo" version="1.0.0"/> - <storageModule moduleId="refreshScope" versionNumber="1"> - <resource resourceType="PROJECT" workspacePath="/chipmunk"/> - </storageModule> -</cproject> diff --git a/external/chipmunk/proj.tizen/.project b/external/chipmunk/proj.tizen/.project deleted file mode 100644 index 9ef65cdb01..0000000000 --- a/external/chipmunk/proj.tizen/.project +++ /dev/null @@ -1,196 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>chipmunk</name> - <comment></comment> - <projects> - </projects> - <buildSpec> - <buildCommand> - <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name> - <triggers>clean,full,incremental,</triggers> - <arguments> - <dictionary> - <key>?name?</key> - <value></value> - </dictionary> - <dictionary> - <key>org.eclipse.cdt.make.core.append_environment</key> - <value>true</value> - </dictionary> - <dictionary> - <key>org.eclipse.cdt.make.core.autoBuildTarget</key> - <value>all</value> - </dictionary> - <dictionary> - <key>org.eclipse.cdt.make.core.buildArguments</key> - <value></value> - </dictionary> - <dictionary> - <key>org.eclipse.cdt.make.core.buildCommand</key> - <value>sbi-make</value> - </dictionary> - <dictionary> - <key>org.eclipse.cdt.make.core.buildLocation</key> - <value>${workspace_loc:/chipmunk/Debug-Tizen-Emulator}</value> - </dictionary> - <dictionary> - <key>org.eclipse.cdt.make.core.cleanBuildTarget</key> - <value>clean</value> - </dictionary> - <dictionary> - <key>org.eclipse.cdt.make.core.contents</key> - <value>org.eclipse.cdt.make.core.activeConfigSettings</value> - </dictionary> - <dictionary> - <key>org.eclipse.cdt.make.core.enableAutoBuild</key> - <value>false</value> - </dictionary> - <dictionary> - <key>org.eclipse.cdt.make.core.enableCleanBuild</key> - <value>true</value> - </dictionary> - <dictionary> - <key>org.eclipse.cdt.make.core.enableFullBuild</key> - <value>true</value> - </dictionary> - <dictionary> - <key>org.eclipse.cdt.make.core.fullBuildTarget</key> - <value>all</value> - </dictionary> - <dictionary> - <key>org.eclipse.cdt.make.core.stopOnError</key> - <value>true</value> - </dictionary> - <dictionary> - <key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key> - <value>true</value> - </dictionary> - </arguments> - </buildCommand> - <buildCommand> - <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name> - <triggers>full,incremental,</triggers> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>org.tizen.nativecpp.apichecker.core.builder</name> - <arguments> - </arguments> - </buildCommand> - </buildSpec> - <natures> - <nature>org.eclipse.cdt.core.cnature</nature> - <nature>org.eclipse.cdt.core.ccnature</nature> - <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature> - <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature> - <nature>org.tizen.nativecpp.apichecker.core.tizenCppNature</nature> - </natures> - <linkedResources> - <link> - <name>src/CMakeLists.txt</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/src/CMakeLists.txt</locationURI> - </link> - <link> - <name>src/chipmunk.c</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/src/chipmunk.c</locationURI> - </link> - <link> - <name>src/constraints</name> - <type>2</type> - <locationURI>PARENT-1-PROJECT_LOC/src/constraints</locationURI> - </link> - <link> - <name>src/cpArbiter.c</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/src/cpArbiter.c</locationURI> - </link> - <link> - <name>src/cpArray.c</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/src/cpArray.c</locationURI> - </link> - <link> - <name>src/cpBB.c</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/src/cpBB.c</locationURI> - </link> - <link> - <name>src/cpBBTree.c</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/src/cpBBTree.c</locationURI> - </link> - <link> - <name>src/cpBody.c</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/src/cpBody.c</locationURI> - </link> - <link> - <name>src/cpCollision.c</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/src/cpCollision.c</locationURI> - </link> - <link> - <name>src/cpHashSet.c</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/src/cpHashSet.c</locationURI> - </link> - <link> - <name>src/cpPolyShape.c</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/src/cpPolyShape.c</locationURI> - </link> - <link> - <name>src/cpShape.c</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/src/cpShape.c</locationURI> - </link> - <link> - <name>src/cpSpace.c</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/src/cpSpace.c</locationURI> - </link> - <link> - <name>src/cpSpaceComponent.c</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/src/cpSpaceComponent.c</locationURI> - </link> - <link> - <name>src/cpSpaceHash.c</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/src/cpSpaceHash.c</locationURI> - </link> - <link> - <name>src/cpSpaceQuery.c</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/src/cpSpaceQuery.c</locationURI> - </link> - <link> - <name>src/cpSpaceStep.c</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/src/cpSpaceStep.c</locationURI> - </link> - <link> - <name>src/cpSpatialIndex.c</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/src/cpSpatialIndex.c</locationURI> - </link> - <link> - <name>src/cpSweep1D.c</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/src/cpSweep1D.c</locationURI> - </link> - <link> - <name>src/cpVect.c</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/src/cpVect.c</locationURI> - </link> - <link> - <name>src/prime.h</name> - <type>1</type> - <locationURI>PARENT-1-PROJECT_LOC/src/prime.h</locationURI> - </link> - </linkedResources> -</projectDescription> diff --git a/external/chipmunk/proj.tizen/src/placeholder.txt b/external/chipmunk/proj.tizen/src/placeholder.txt deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/cocos2dx/platform/third_party/android/prebuilt/libcurl/include/curl/curl.h b/external/curl/include/andorid/curl.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libcurl/include/curl/curl.h rename to external/curl/include/andorid/curl.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libcurl/include/curl/curlbuild.h b/external/curl/include/andorid/curlbuild.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libcurl/include/curl/curlbuild.h rename to external/curl/include/andorid/curlbuild.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libcurl/include/curl/curlrules.h b/external/curl/include/andorid/curlrules.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libcurl/include/curl/curlrules.h rename to external/curl/include/andorid/curlrules.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libcurl/include/curl/curlver.h b/external/curl/include/andorid/curlver.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libcurl/include/curl/curlver.h rename to external/curl/include/andorid/curlver.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libcurl/include/curl/easy.h b/external/curl/include/andorid/easy.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libcurl/include/curl/easy.h rename to external/curl/include/andorid/easy.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libcurl/include/curl/mprintf.h b/external/curl/include/andorid/mprintf.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libcurl/include/curl/mprintf.h rename to external/curl/include/andorid/mprintf.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libcurl/include/curl/multi.h b/external/curl/include/andorid/multi.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libcurl/include/curl/multi.h rename to external/curl/include/andorid/multi.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libcurl/include/curl/stdcheaders.h b/external/curl/include/andorid/stdcheaders.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libcurl/include/curl/stdcheaders.h rename to external/curl/include/andorid/stdcheaders.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libcurl/include/curl/typecheck-gcc.h b/external/curl/include/andorid/typecheck-gcc.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libcurl/include/curl/typecheck-gcc.h rename to external/curl/include/andorid/typecheck-gcc.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libcurl/include/curl/types.h b/external/curl/include/andorid/types.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libcurl/include/curl/types.h rename to external/curl/include/andorid/types.h diff --git a/cocos2dx/platform/third_party/ios/curl/curl.h b/external/curl/include/ios/curl.h similarity index 100% rename from cocos2dx/platform/third_party/ios/curl/curl.h rename to external/curl/include/ios/curl.h diff --git a/cocos2dx/platform/third_party/ios/curl/curlbuild.h b/external/curl/include/ios/curlbuild.h similarity index 100% rename from cocos2dx/platform/third_party/ios/curl/curlbuild.h rename to external/curl/include/ios/curlbuild.h diff --git a/cocos2dx/platform/third_party/ios/curl/curlrules.h b/external/curl/include/ios/curlrules.h similarity index 100% rename from cocos2dx/platform/third_party/ios/curl/curlrules.h rename to external/curl/include/ios/curlrules.h diff --git a/cocos2dx/platform/third_party/ios/curl/curlver.h b/external/curl/include/ios/curlver.h similarity index 100% rename from cocos2dx/platform/third_party/ios/curl/curlver.h rename to external/curl/include/ios/curlver.h diff --git a/cocos2dx/platform/third_party/ios/curl/easy.h b/external/curl/include/ios/easy.h similarity index 100% rename from cocos2dx/platform/third_party/ios/curl/easy.h rename to external/curl/include/ios/easy.h diff --git a/cocos2dx/platform/third_party/ios/curl/mprintf.h b/external/curl/include/ios/mprintf.h similarity index 100% rename from cocos2dx/platform/third_party/ios/curl/mprintf.h rename to external/curl/include/ios/mprintf.h diff --git a/cocos2dx/platform/third_party/ios/curl/multi.h b/external/curl/include/ios/multi.h similarity index 100% rename from cocos2dx/platform/third_party/ios/curl/multi.h rename to external/curl/include/ios/multi.h diff --git a/cocos2dx/platform/third_party/ios/curl/stdcheaders.h b/external/curl/include/ios/stdcheaders.h similarity index 100% rename from cocos2dx/platform/third_party/ios/curl/stdcheaders.h rename to external/curl/include/ios/stdcheaders.h diff --git a/cocos2dx/platform/third_party/ios/curl/typecheck-gcc.h b/external/curl/include/ios/typecheck-gcc.h similarity index 100% rename from cocos2dx/platform/third_party/ios/curl/typecheck-gcc.h rename to external/curl/include/ios/typecheck-gcc.h diff --git a/cocos2dx/platform/third_party/linux/curl/curl.h b/external/curl/include/linux/32-bit/curl.h similarity index 100% rename from cocos2dx/platform/third_party/linux/curl/curl.h rename to external/curl/include/linux/32-bit/curl.h diff --git a/cocos2dx/platform/third_party/linux/curl/curlbuild.h b/external/curl/include/linux/32-bit/curlbuild.h similarity index 100% rename from cocos2dx/platform/third_party/linux/curl/curlbuild.h rename to external/curl/include/linux/32-bit/curlbuild.h diff --git a/cocos2dx/platform/third_party/linux/curl/curlrules.h b/external/curl/include/linux/32-bit/curlrules.h similarity index 100% rename from cocos2dx/platform/third_party/linux/curl/curlrules.h rename to external/curl/include/linux/32-bit/curlrules.h diff --git a/cocos2dx/platform/third_party/linux/curl/curlver.h b/external/curl/include/linux/32-bit/curlver.h similarity index 100% rename from cocos2dx/platform/third_party/linux/curl/curlver.h rename to external/curl/include/linux/32-bit/curlver.h diff --git a/cocos2dx/platform/third_party/linux/curl/easy.h b/external/curl/include/linux/32-bit/easy.h similarity index 100% rename from cocos2dx/platform/third_party/linux/curl/easy.h rename to external/curl/include/linux/32-bit/easy.h diff --git a/cocos2dx/platform/third_party/linux/curl/mprintf.h b/external/curl/include/linux/32-bit/mprintf.h similarity index 100% rename from cocos2dx/platform/third_party/linux/curl/mprintf.h rename to external/curl/include/linux/32-bit/mprintf.h diff --git a/cocos2dx/platform/third_party/linux/curl/multi.h b/external/curl/include/linux/32-bit/multi.h similarity index 100% rename from cocos2dx/platform/third_party/linux/curl/multi.h rename to external/curl/include/linux/32-bit/multi.h diff --git a/cocos2dx/platform/third_party/linux/curl/stdcheaders.h b/external/curl/include/linux/32-bit/stdcheaders.h similarity index 100% rename from cocos2dx/platform/third_party/linux/curl/stdcheaders.h rename to external/curl/include/linux/32-bit/stdcheaders.h diff --git a/cocos2dx/platform/third_party/linux/curl/typecheck-gcc.h b/external/curl/include/linux/32-bit/typecheck-gcc.h similarity index 100% rename from cocos2dx/platform/third_party/linux/curl/typecheck-gcc.h rename to external/curl/include/linux/32-bit/typecheck-gcc.h diff --git a/cocos2dx/platform/third_party/linux/include64/curl/curl.h b/external/curl/include/linux/64-bit/curl.h similarity index 100% rename from cocos2dx/platform/third_party/linux/include64/curl/curl.h rename to external/curl/include/linux/64-bit/curl.h diff --git a/cocos2dx/platform/third_party/linux/include64/curl/curlbuild.h b/external/curl/include/linux/64-bit/curlbuild.h similarity index 100% rename from cocos2dx/platform/third_party/linux/include64/curl/curlbuild.h rename to external/curl/include/linux/64-bit/curlbuild.h diff --git a/cocos2dx/platform/third_party/linux/include64/curl/curlrules.h b/external/curl/include/linux/64-bit/curlrules.h similarity index 100% rename from cocos2dx/platform/third_party/linux/include64/curl/curlrules.h rename to external/curl/include/linux/64-bit/curlrules.h diff --git a/cocos2dx/platform/third_party/linux/include64/curl/curlver.h b/external/curl/include/linux/64-bit/curlver.h similarity index 100% rename from cocos2dx/platform/third_party/linux/include64/curl/curlver.h rename to external/curl/include/linux/64-bit/curlver.h diff --git a/cocos2dx/platform/third_party/linux/include64/curl/easy.h b/external/curl/include/linux/64-bit/easy.h similarity index 100% rename from cocos2dx/platform/third_party/linux/include64/curl/easy.h rename to external/curl/include/linux/64-bit/easy.h diff --git a/cocos2dx/platform/third_party/linux/include64/curl/mprintf.h b/external/curl/include/linux/64-bit/mprintf.h similarity index 100% rename from cocos2dx/platform/third_party/linux/include64/curl/mprintf.h rename to external/curl/include/linux/64-bit/mprintf.h diff --git a/cocos2dx/platform/third_party/linux/include64/curl/multi.h b/external/curl/include/linux/64-bit/multi.h similarity index 100% rename from cocos2dx/platform/third_party/linux/include64/curl/multi.h rename to external/curl/include/linux/64-bit/multi.h diff --git a/cocos2dx/platform/third_party/linux/include64/curl/stdcheaders.h b/external/curl/include/linux/64-bit/stdcheaders.h similarity index 100% rename from cocos2dx/platform/third_party/linux/include64/curl/stdcheaders.h rename to external/curl/include/linux/64-bit/stdcheaders.h diff --git a/cocos2dx/platform/third_party/win32/curl/curl.h b/external/curl/include/win32/curl.h similarity index 100% rename from cocos2dx/platform/third_party/win32/curl/curl.h rename to external/curl/include/win32/curl.h diff --git a/cocos2dx/platform/third_party/win32/curl/curlbuild.h b/external/curl/include/win32/curlbuild.h similarity index 100% rename from cocos2dx/platform/third_party/win32/curl/curlbuild.h rename to external/curl/include/win32/curlbuild.h diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/curl/curlrules.h b/external/curl/include/win32/curlrules.h similarity index 100% rename from cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/curl/curlrules.h rename to external/curl/include/win32/curlrules.h diff --git a/cocos2dx/platform/third_party/win32/curl/curlver.h b/external/curl/include/win32/curlver.h similarity index 100% rename from cocos2dx/platform/third_party/win32/curl/curlver.h rename to external/curl/include/win32/curlver.h diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/curl/easy.h b/external/curl/include/win32/easy.h similarity index 100% rename from cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/curl/easy.h rename to external/curl/include/win32/easy.h diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/curl/mprintf.h b/external/curl/include/win32/mprintf.h similarity index 100% rename from cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/curl/mprintf.h rename to external/curl/include/win32/mprintf.h diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/curl/multi.h b/external/curl/include/win32/multi.h similarity index 100% rename from cocos2dx/platform/third_party/tizen/rootstraps/tizen-emulator-2.2.native/usr/include/curl/multi.h rename to external/curl/include/win32/multi.h diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/curl/stdcheaders.h b/external/curl/include/win32/stdcheaders.h similarity index 100% rename from cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/curl/stdcheaders.h rename to external/curl/include/win32/stdcheaders.h diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/curl/typecheck-gcc.h b/external/curl/include/win32/typecheck-gcc.h similarity index 100% rename from cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/curl/typecheck-gcc.h rename to external/curl/include/win32/typecheck-gcc.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libcurl/Android.mk b/external/curl/prebuilt/andorid/Android.mk similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libcurl/Android.mk rename to external/curl/prebuilt/andorid/Android.mk diff --git a/cocos2dx/platform/third_party/android/prebuilt/libcurl/libs/armeabi-v7a/libcurl.a.REMOVED.git-id b/external/curl/prebuilt/andorid/armeabi-v7a/libcurl.a.REMOVED.git-id similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libcurl/libs/armeabi-v7a/libcurl.a.REMOVED.git-id rename to external/curl/prebuilt/andorid/armeabi-v7a/libcurl.a.REMOVED.git-id diff --git a/cocos2dx/platform/third_party/android/prebuilt/libcurl/libs/armeabi/libcurl.a.REMOVED.git-id b/external/curl/prebuilt/andorid/armeabi/libcurl.a.REMOVED.git-id similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libcurl/libs/armeabi/libcurl.a.REMOVED.git-id rename to external/curl/prebuilt/andorid/armeabi/libcurl.a.REMOVED.git-id diff --git a/cocos2dx/platform/third_party/android/prebuilt/libcurl/libs/x86/libcurl.a.REMOVED.git-id b/external/curl/prebuilt/andorid/x86/libcurl.a.REMOVED.git-id similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libcurl/libs/x86/libcurl.a.REMOVED.git-id rename to external/curl/prebuilt/andorid/x86/libcurl.a.REMOVED.git-id diff --git a/cocos2dx/platform/third_party/ios/libraries/libcurl.a.REMOVED.git-id b/external/curl/prebuilt/ios/libcurl.a.REMOVED.git-id similarity index 100% rename from cocos2dx/platform/third_party/ios/libraries/libcurl.a.REMOVED.git-id rename to external/curl/prebuilt/ios/libcurl.a.REMOVED.git-id diff --git a/cocos2dx/platform/third_party/linux/libraries/libcurl.a.REMOVED.git-id b/external/curl/prebuilt/linux/32-bit/libcurl.a.REMOVED.git-id similarity index 100% rename from cocos2dx/platform/third_party/linux/libraries/libcurl.a.REMOVED.git-id rename to external/curl/prebuilt/linux/32-bit/libcurl.a.REMOVED.git-id diff --git a/cocos2dx/platform/third_party/linux/libraries/lib64/libcurl.a.REMOVED.git-id b/external/curl/prebuilt/linux/64-bit/libcurl.a.REMOVED.git-id similarity index 100% rename from cocos2dx/platform/third_party/linux/libraries/lib64/libcurl.a.REMOVED.git-id rename to external/curl/prebuilt/linux/64-bit/libcurl.a.REMOVED.git-id diff --git a/cocos2dx/platform/third_party/win32/libraries/libcurl.dll.REMOVED.git-id b/external/curl/prebuilt/win32/libcurl.dll.REMOVED.git-id similarity index 100% rename from cocos2dx/platform/third_party/win32/libraries/libcurl.dll.REMOVED.git-id rename to external/curl/prebuilt/win32/libcurl.dll.REMOVED.git-id diff --git a/external/emscripten b/external/emscripten deleted file mode 160000 index 0ad8724417..0000000000 --- a/external/emscripten +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 0ad87244178badf26cd5c8e0ed88116e87026472 diff --git a/cocos2dx/platform/third_party/common/etc/etc1.cpp b/external/etc1/etc1.cpp similarity index 100% rename from cocos2dx/platform/third_party/common/etc/etc1.cpp rename to external/etc1/etc1.cpp diff --git a/cocos2dx/platform/third_party/common/etc/etc1.h b/external/etc1/etc1.h similarity index 100% rename from cocos2dx/platform/third_party/common/etc/etc1.h rename to external/etc1/etc1.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/config/ftconfig.h b/external/freetype2/include/andorid/freetype2/freetype/config/ftconfig.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/config/ftconfig.h rename to external/freetype2/include/andorid/freetype2/freetype/config/ftconfig.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/config/ftheader.h b/external/freetype2/include/andorid/freetype2/freetype/config/ftheader.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/config/ftheader.h rename to external/freetype2/include/andorid/freetype2/freetype/config/ftheader.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/config/ftmodule.h b/external/freetype2/include/andorid/freetype2/freetype/config/ftmodule.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/config/ftmodule.h rename to external/freetype2/include/andorid/freetype2/freetype/config/ftmodule.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/config/ftoption.h b/external/freetype2/include/andorid/freetype2/freetype/config/ftoption.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/config/ftoption.h rename to external/freetype2/include/andorid/freetype2/freetype/config/ftoption.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/config/ftstdlib.h b/external/freetype2/include/andorid/freetype2/freetype/config/ftstdlib.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/config/ftstdlib.h rename to external/freetype2/include/andorid/freetype2/freetype/config/ftstdlib.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/freetype.h.REMOVED.git-id b/external/freetype2/include/andorid/freetype2/freetype/freetype.h.REMOVED.git-id similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/freetype.h.REMOVED.git-id rename to external/freetype2/include/andorid/freetype2/freetype/freetype.h.REMOVED.git-id diff --git a/cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftadvanc.h b/external/freetype2/include/andorid/freetype2/freetype/ftadvanc.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftadvanc.h rename to external/freetype2/include/andorid/freetype2/freetype/ftadvanc.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftautoh.h b/external/freetype2/include/andorid/freetype2/freetype/ftautoh.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftautoh.h rename to external/freetype2/include/andorid/freetype2/freetype/ftautoh.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftbbox.h b/external/freetype2/include/andorid/freetype2/freetype/ftbbox.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftbbox.h rename to external/freetype2/include/andorid/freetype2/freetype/ftbbox.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftbdf.h b/external/freetype2/include/andorid/freetype2/freetype/ftbdf.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftbdf.h rename to external/freetype2/include/andorid/freetype2/freetype/ftbdf.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftbitmap.h b/external/freetype2/include/andorid/freetype2/freetype/ftbitmap.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftbitmap.h rename to external/freetype2/include/andorid/freetype2/freetype/ftbitmap.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftbzip2.h b/external/freetype2/include/andorid/freetype2/freetype/ftbzip2.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftbzip2.h rename to external/freetype2/include/andorid/freetype2/freetype/ftbzip2.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftcache.h b/external/freetype2/include/andorid/freetype2/freetype/ftcache.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftcache.h rename to external/freetype2/include/andorid/freetype2/freetype/ftcache.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftcffdrv.h b/external/freetype2/include/andorid/freetype2/freetype/ftcffdrv.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftcffdrv.h rename to external/freetype2/include/andorid/freetype2/freetype/ftcffdrv.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftchapters.h b/external/freetype2/include/andorid/freetype2/freetype/ftchapters.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftchapters.h rename to external/freetype2/include/andorid/freetype2/freetype/ftchapters.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftcid.h b/external/freetype2/include/andorid/freetype2/freetype/ftcid.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftcid.h rename to external/freetype2/include/andorid/freetype2/freetype/ftcid.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/fterrdef.h b/external/freetype2/include/andorid/freetype2/freetype/fterrdef.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/fterrdef.h rename to external/freetype2/include/andorid/freetype2/freetype/fterrdef.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/fterrors.h b/external/freetype2/include/andorid/freetype2/freetype/fterrors.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/fterrors.h rename to external/freetype2/include/andorid/freetype2/freetype/fterrors.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftgasp.h b/external/freetype2/include/andorid/freetype2/freetype/ftgasp.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftgasp.h rename to external/freetype2/include/andorid/freetype2/freetype/ftgasp.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftglyph.h b/external/freetype2/include/andorid/freetype2/freetype/ftglyph.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftglyph.h rename to external/freetype2/include/andorid/freetype2/freetype/ftglyph.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftgxval.h b/external/freetype2/include/andorid/freetype2/freetype/ftgxval.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftgxval.h rename to external/freetype2/include/andorid/freetype2/freetype/ftgxval.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftgzip.h b/external/freetype2/include/andorid/freetype2/freetype/ftgzip.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftgzip.h rename to external/freetype2/include/andorid/freetype2/freetype/ftgzip.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftimage.h b/external/freetype2/include/andorid/freetype2/freetype/ftimage.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftimage.h rename to external/freetype2/include/andorid/freetype2/freetype/ftimage.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftincrem.h b/external/freetype2/include/andorid/freetype2/freetype/ftincrem.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftincrem.h rename to external/freetype2/include/andorid/freetype2/freetype/ftincrem.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftlcdfil.h b/external/freetype2/include/andorid/freetype2/freetype/ftlcdfil.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftlcdfil.h rename to external/freetype2/include/andorid/freetype2/freetype/ftlcdfil.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftlist.h b/external/freetype2/include/andorid/freetype2/freetype/ftlist.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftlist.h rename to external/freetype2/include/andorid/freetype2/freetype/ftlist.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftlzw.h b/external/freetype2/include/andorid/freetype2/freetype/ftlzw.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftlzw.h rename to external/freetype2/include/andorid/freetype2/freetype/ftlzw.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftmac.h b/external/freetype2/include/andorid/freetype2/freetype/ftmac.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftmac.h rename to external/freetype2/include/andorid/freetype2/freetype/ftmac.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftmm.h b/external/freetype2/include/andorid/freetype2/freetype/ftmm.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftmm.h rename to external/freetype2/include/andorid/freetype2/freetype/ftmm.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftmodapi.h b/external/freetype2/include/andorid/freetype2/freetype/ftmodapi.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftmodapi.h rename to external/freetype2/include/andorid/freetype2/freetype/ftmodapi.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftmoderr.h b/external/freetype2/include/andorid/freetype2/freetype/ftmoderr.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftmoderr.h rename to external/freetype2/include/andorid/freetype2/freetype/ftmoderr.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftotval.h b/external/freetype2/include/andorid/freetype2/freetype/ftotval.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftotval.h rename to external/freetype2/include/andorid/freetype2/freetype/ftotval.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftoutln.h b/external/freetype2/include/andorid/freetype2/freetype/ftoutln.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftoutln.h rename to external/freetype2/include/andorid/freetype2/freetype/ftoutln.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftpfr.h b/external/freetype2/include/andorid/freetype2/freetype/ftpfr.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftpfr.h rename to external/freetype2/include/andorid/freetype2/freetype/ftpfr.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftrender.h b/external/freetype2/include/andorid/freetype2/freetype/ftrender.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftrender.h rename to external/freetype2/include/andorid/freetype2/freetype/ftrender.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftsizes.h b/external/freetype2/include/andorid/freetype2/freetype/ftsizes.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftsizes.h rename to external/freetype2/include/andorid/freetype2/freetype/ftsizes.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftsnames.h b/external/freetype2/include/andorid/freetype2/freetype/ftsnames.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftsnames.h rename to external/freetype2/include/andorid/freetype2/freetype/ftsnames.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftstroke.h b/external/freetype2/include/andorid/freetype2/freetype/ftstroke.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftstroke.h rename to external/freetype2/include/andorid/freetype2/freetype/ftstroke.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftsynth.h b/external/freetype2/include/andorid/freetype2/freetype/ftsynth.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftsynth.h rename to external/freetype2/include/andorid/freetype2/freetype/ftsynth.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftsystem.h b/external/freetype2/include/andorid/freetype2/freetype/ftsystem.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftsystem.h rename to external/freetype2/include/andorid/freetype2/freetype/ftsystem.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/fttrigon.h b/external/freetype2/include/andorid/freetype2/freetype/fttrigon.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/fttrigon.h rename to external/freetype2/include/andorid/freetype2/freetype/fttrigon.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftttdrv.h b/external/freetype2/include/andorid/freetype2/freetype/ftttdrv.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftttdrv.h rename to external/freetype2/include/andorid/freetype2/freetype/ftttdrv.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/fttypes.h b/external/freetype2/include/andorid/freetype2/freetype/fttypes.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/fttypes.h rename to external/freetype2/include/andorid/freetype2/freetype/fttypes.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftwinfnt.h b/external/freetype2/include/andorid/freetype2/freetype/ftwinfnt.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftwinfnt.h rename to external/freetype2/include/andorid/freetype2/freetype/ftwinfnt.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftxf86.h b/external/freetype2/include/andorid/freetype2/freetype/ftxf86.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ftxf86.h rename to external/freetype2/include/andorid/freetype2/freetype/ftxf86.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/t1tables.h b/external/freetype2/include/andorid/freetype2/freetype/t1tables.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/t1tables.h rename to external/freetype2/include/andorid/freetype2/freetype/t1tables.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ttnameid.h b/external/freetype2/include/andorid/freetype2/freetype/ttnameid.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ttnameid.h rename to external/freetype2/include/andorid/freetype2/freetype/ttnameid.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/tttables.h b/external/freetype2/include/andorid/freetype2/freetype/tttables.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/tttables.h rename to external/freetype2/include/andorid/freetype2/freetype/tttables.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/tttags.h b/external/freetype2/include/andorid/freetype2/freetype/tttags.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/tttags.h rename to external/freetype2/include/andorid/freetype2/freetype/tttags.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ttunpat.h b/external/freetype2/include/andorid/freetype2/freetype/ttunpat.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/freetype2/freetype/ttunpat.h rename to external/freetype2/include/andorid/freetype2/freetype/ttunpat.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/ft2build.h b/external/freetype2/include/andorid/ft2build.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libfreetype2/include/ft2build.h rename to external/freetype2/include/andorid/ft2build.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/config/ftconfig.h b/external/freetype2/include/ios/freetype/config/ftconfig.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/config/ftconfig.h rename to external/freetype2/include/ios/freetype/config/ftconfig.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/config/ftheader.h b/external/freetype2/include/ios/freetype/config/ftheader.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/config/ftheader.h rename to external/freetype2/include/ios/freetype/config/ftheader.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/config/ftmodule.h b/external/freetype2/include/ios/freetype/config/ftmodule.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/config/ftmodule.h rename to external/freetype2/include/ios/freetype/config/ftmodule.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/config/ftoption.h b/external/freetype2/include/ios/freetype/config/ftoption.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/config/ftoption.h rename to external/freetype2/include/ios/freetype/config/ftoption.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/config/ftstdlib.h b/external/freetype2/include/ios/freetype/config/ftstdlib.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/config/ftstdlib.h rename to external/freetype2/include/ios/freetype/config/ftstdlib.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/freetype.h.REMOVED.git-id b/external/freetype2/include/ios/freetype/freetype.h.REMOVED.git-id similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/freetype.h.REMOVED.git-id rename to external/freetype2/include/ios/freetype/freetype.h.REMOVED.git-id diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftadvanc.h b/external/freetype2/include/ios/freetype/ftadvanc.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftadvanc.h rename to external/freetype2/include/ios/freetype/ftadvanc.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftautoh.h b/external/freetype2/include/ios/freetype/ftautoh.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftautoh.h rename to external/freetype2/include/ios/freetype/ftautoh.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftbbox.h b/external/freetype2/include/ios/freetype/ftbbox.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftbbox.h rename to external/freetype2/include/ios/freetype/ftbbox.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftbdf.h b/external/freetype2/include/ios/freetype/ftbdf.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftbdf.h rename to external/freetype2/include/ios/freetype/ftbdf.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftbitmap.h b/external/freetype2/include/ios/freetype/ftbitmap.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftbitmap.h rename to external/freetype2/include/ios/freetype/ftbitmap.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftbzip2.h b/external/freetype2/include/ios/freetype/ftbzip2.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftbzip2.h rename to external/freetype2/include/ios/freetype/ftbzip2.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftcache.h b/external/freetype2/include/ios/freetype/ftcache.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftcache.h rename to external/freetype2/include/ios/freetype/ftcache.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftcffdrv.h b/external/freetype2/include/ios/freetype/ftcffdrv.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftcffdrv.h rename to external/freetype2/include/ios/freetype/ftcffdrv.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftchapters.h b/external/freetype2/include/ios/freetype/ftchapters.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftchapters.h rename to external/freetype2/include/ios/freetype/ftchapters.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftcid.h b/external/freetype2/include/ios/freetype/ftcid.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftcid.h rename to external/freetype2/include/ios/freetype/ftcid.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/fterrdef.h b/external/freetype2/include/ios/freetype/fterrdef.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/fterrdef.h rename to external/freetype2/include/ios/freetype/fterrdef.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/fterrors.h b/external/freetype2/include/ios/freetype/fterrors.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/fterrors.h rename to external/freetype2/include/ios/freetype/fterrors.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftgasp.h b/external/freetype2/include/ios/freetype/ftgasp.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftgasp.h rename to external/freetype2/include/ios/freetype/ftgasp.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftglyph.h b/external/freetype2/include/ios/freetype/ftglyph.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftglyph.h rename to external/freetype2/include/ios/freetype/ftglyph.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftgxval.h b/external/freetype2/include/ios/freetype/ftgxval.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftgxval.h rename to external/freetype2/include/ios/freetype/ftgxval.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftgzip.h b/external/freetype2/include/ios/freetype/ftgzip.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftgzip.h rename to external/freetype2/include/ios/freetype/ftgzip.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftimage.h b/external/freetype2/include/ios/freetype/ftimage.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftimage.h rename to external/freetype2/include/ios/freetype/ftimage.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftincrem.h b/external/freetype2/include/ios/freetype/ftincrem.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftincrem.h rename to external/freetype2/include/ios/freetype/ftincrem.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftlcdfil.h b/external/freetype2/include/ios/freetype/ftlcdfil.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftlcdfil.h rename to external/freetype2/include/ios/freetype/ftlcdfil.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftlist.h b/external/freetype2/include/ios/freetype/ftlist.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftlist.h rename to external/freetype2/include/ios/freetype/ftlist.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftlzw.h b/external/freetype2/include/ios/freetype/ftlzw.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftlzw.h rename to external/freetype2/include/ios/freetype/ftlzw.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftmac.h b/external/freetype2/include/ios/freetype/ftmac.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftmac.h rename to external/freetype2/include/ios/freetype/ftmac.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftmm.h b/external/freetype2/include/ios/freetype/ftmm.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftmm.h rename to external/freetype2/include/ios/freetype/ftmm.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftmodapi.h b/external/freetype2/include/ios/freetype/ftmodapi.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftmodapi.h rename to external/freetype2/include/ios/freetype/ftmodapi.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftmoderr.h b/external/freetype2/include/ios/freetype/ftmoderr.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftmoderr.h rename to external/freetype2/include/ios/freetype/ftmoderr.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftotval.h b/external/freetype2/include/ios/freetype/ftotval.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftotval.h rename to external/freetype2/include/ios/freetype/ftotval.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftoutln.h b/external/freetype2/include/ios/freetype/ftoutln.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftoutln.h rename to external/freetype2/include/ios/freetype/ftoutln.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftpfr.h b/external/freetype2/include/ios/freetype/ftpfr.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftpfr.h rename to external/freetype2/include/ios/freetype/ftpfr.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftrender.h b/external/freetype2/include/ios/freetype/ftrender.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftrender.h rename to external/freetype2/include/ios/freetype/ftrender.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftsizes.h b/external/freetype2/include/ios/freetype/ftsizes.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftsizes.h rename to external/freetype2/include/ios/freetype/ftsizes.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftsnames.h b/external/freetype2/include/ios/freetype/ftsnames.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftsnames.h rename to external/freetype2/include/ios/freetype/ftsnames.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftstroke.h b/external/freetype2/include/ios/freetype/ftstroke.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftstroke.h rename to external/freetype2/include/ios/freetype/ftstroke.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftsynth.h b/external/freetype2/include/ios/freetype/ftsynth.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftsynth.h rename to external/freetype2/include/ios/freetype/ftsynth.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftsystem.h b/external/freetype2/include/ios/freetype/ftsystem.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftsystem.h rename to external/freetype2/include/ios/freetype/ftsystem.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/fttrigon.h b/external/freetype2/include/ios/freetype/fttrigon.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/fttrigon.h rename to external/freetype2/include/ios/freetype/fttrigon.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftttdrv.h b/external/freetype2/include/ios/freetype/ftttdrv.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftttdrv.h rename to external/freetype2/include/ios/freetype/ftttdrv.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/fttypes.h b/external/freetype2/include/ios/freetype/fttypes.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/fttypes.h rename to external/freetype2/include/ios/freetype/fttypes.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftwinfnt.h b/external/freetype2/include/ios/freetype/ftwinfnt.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftwinfnt.h rename to external/freetype2/include/ios/freetype/ftwinfnt.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftxf86.h b/external/freetype2/include/ios/freetype/ftxf86.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/ftxf86.h rename to external/freetype2/include/ios/freetype/ftxf86.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/autohint.h b/external/freetype2/include/ios/freetype/internal/autohint.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/autohint.h rename to external/freetype2/include/ios/freetype/internal/autohint.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/ftcalc.h b/external/freetype2/include/ios/freetype/internal/ftcalc.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/ftcalc.h rename to external/freetype2/include/ios/freetype/internal/ftcalc.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/ftdebug.h b/external/freetype2/include/ios/freetype/internal/ftdebug.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/ftdebug.h rename to external/freetype2/include/ios/freetype/internal/ftdebug.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/ftdriver.h b/external/freetype2/include/ios/freetype/internal/ftdriver.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/ftdriver.h rename to external/freetype2/include/ios/freetype/internal/ftdriver.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/ftgloadr.h b/external/freetype2/include/ios/freetype/internal/ftgloadr.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/ftgloadr.h rename to external/freetype2/include/ios/freetype/internal/ftgloadr.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/ftmemory.h b/external/freetype2/include/ios/freetype/internal/ftmemory.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/ftmemory.h rename to external/freetype2/include/ios/freetype/internal/ftmemory.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/ftobjs.h b/external/freetype2/include/ios/freetype/internal/ftobjs.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/ftobjs.h rename to external/freetype2/include/ios/freetype/internal/ftobjs.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/ftpic.h b/external/freetype2/include/ios/freetype/internal/ftpic.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/ftpic.h rename to external/freetype2/include/ios/freetype/internal/ftpic.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/ftrfork.h b/external/freetype2/include/ios/freetype/internal/ftrfork.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/ftrfork.h rename to external/freetype2/include/ios/freetype/internal/ftrfork.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/ftserv.h b/external/freetype2/include/ios/freetype/internal/ftserv.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/ftserv.h rename to external/freetype2/include/ios/freetype/internal/ftserv.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/ftstream.h b/external/freetype2/include/ios/freetype/internal/ftstream.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/ftstream.h rename to external/freetype2/include/ios/freetype/internal/ftstream.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/fttrace.h b/external/freetype2/include/ios/freetype/internal/fttrace.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/fttrace.h rename to external/freetype2/include/ios/freetype/internal/fttrace.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/ftvalid.h b/external/freetype2/include/ios/freetype/internal/ftvalid.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/ftvalid.h rename to external/freetype2/include/ios/freetype/internal/ftvalid.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/internal.h b/external/freetype2/include/ios/freetype/internal/internal.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/internal.h rename to external/freetype2/include/ios/freetype/internal/internal.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/psaux.h b/external/freetype2/include/ios/freetype/internal/psaux.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/psaux.h rename to external/freetype2/include/ios/freetype/internal/psaux.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/pshints.h b/external/freetype2/include/ios/freetype/internal/pshints.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/pshints.h rename to external/freetype2/include/ios/freetype/internal/pshints.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/services/svbdf.h b/external/freetype2/include/ios/freetype/internal/services/svbdf.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/services/svbdf.h rename to external/freetype2/include/ios/freetype/internal/services/svbdf.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/services/svcid.h b/external/freetype2/include/ios/freetype/internal/services/svcid.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/services/svcid.h rename to external/freetype2/include/ios/freetype/internal/services/svcid.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/services/svgldict.h b/external/freetype2/include/ios/freetype/internal/services/svgldict.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/services/svgldict.h rename to external/freetype2/include/ios/freetype/internal/services/svgldict.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/services/svgxval.h b/external/freetype2/include/ios/freetype/internal/services/svgxval.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/services/svgxval.h rename to external/freetype2/include/ios/freetype/internal/services/svgxval.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/services/svkern.h b/external/freetype2/include/ios/freetype/internal/services/svkern.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/services/svkern.h rename to external/freetype2/include/ios/freetype/internal/services/svkern.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/services/svmm.h b/external/freetype2/include/ios/freetype/internal/services/svmm.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/services/svmm.h rename to external/freetype2/include/ios/freetype/internal/services/svmm.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/services/svotval.h b/external/freetype2/include/ios/freetype/internal/services/svotval.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/services/svotval.h rename to external/freetype2/include/ios/freetype/internal/services/svotval.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/services/svpfr.h b/external/freetype2/include/ios/freetype/internal/services/svpfr.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/services/svpfr.h rename to external/freetype2/include/ios/freetype/internal/services/svpfr.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/services/svpostnm.h b/external/freetype2/include/ios/freetype/internal/services/svpostnm.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/services/svpostnm.h rename to external/freetype2/include/ios/freetype/internal/services/svpostnm.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/services/svprop.h b/external/freetype2/include/ios/freetype/internal/services/svprop.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/services/svprop.h rename to external/freetype2/include/ios/freetype/internal/services/svprop.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/services/svpscmap.h b/external/freetype2/include/ios/freetype/internal/services/svpscmap.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/services/svpscmap.h rename to external/freetype2/include/ios/freetype/internal/services/svpscmap.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/services/svpsinfo.h b/external/freetype2/include/ios/freetype/internal/services/svpsinfo.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/services/svpsinfo.h rename to external/freetype2/include/ios/freetype/internal/services/svpsinfo.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/services/svsfnt.h b/external/freetype2/include/ios/freetype/internal/services/svsfnt.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/services/svsfnt.h rename to external/freetype2/include/ios/freetype/internal/services/svsfnt.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/services/svttcmap.h b/external/freetype2/include/ios/freetype/internal/services/svttcmap.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/services/svttcmap.h rename to external/freetype2/include/ios/freetype/internal/services/svttcmap.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/services/svtteng.h b/external/freetype2/include/ios/freetype/internal/services/svtteng.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/services/svtteng.h rename to external/freetype2/include/ios/freetype/internal/services/svtteng.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/services/svttglyf.h b/external/freetype2/include/ios/freetype/internal/services/svttglyf.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/services/svttglyf.h rename to external/freetype2/include/ios/freetype/internal/services/svttglyf.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/services/svwinfnt.h b/external/freetype2/include/ios/freetype/internal/services/svwinfnt.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/services/svwinfnt.h rename to external/freetype2/include/ios/freetype/internal/services/svwinfnt.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/services/svxf86nm.h b/external/freetype2/include/ios/freetype/internal/services/svxf86nm.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/services/svxf86nm.h rename to external/freetype2/include/ios/freetype/internal/services/svxf86nm.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/sfnt.h b/external/freetype2/include/ios/freetype/internal/sfnt.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/sfnt.h rename to external/freetype2/include/ios/freetype/internal/sfnt.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/t1types.h b/external/freetype2/include/ios/freetype/internal/t1types.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/t1types.h rename to external/freetype2/include/ios/freetype/internal/t1types.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/tttypes.h b/external/freetype2/include/ios/freetype/internal/tttypes.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/internal/tttypes.h rename to external/freetype2/include/ios/freetype/internal/tttypes.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/t1tables.h b/external/freetype2/include/ios/freetype/t1tables.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/t1tables.h rename to external/freetype2/include/ios/freetype/t1tables.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/ttnameid.h b/external/freetype2/include/ios/freetype/ttnameid.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/ttnameid.h rename to external/freetype2/include/ios/freetype/ttnameid.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/tttables.h b/external/freetype2/include/ios/freetype/tttables.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/tttables.h rename to external/freetype2/include/ios/freetype/tttables.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/tttags.h b/external/freetype2/include/ios/freetype/tttags.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/tttags.h rename to external/freetype2/include/ios/freetype/tttags.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/freetype/ttunpat.h b/external/freetype2/include/ios/freetype/ttunpat.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/freetype/ttunpat.h rename to external/freetype2/include/ios/freetype/ttunpat.h diff --git a/cocos2dx/platform/third_party/ios/libfreetype2/ft2build.h b/external/freetype2/include/ios/ft2build.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libfreetype2/ft2build.h rename to external/freetype2/include/ios/ft2build.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/config/ftconfig.h b/external/freetype2/include/linux/freetype/config/ftconfig.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/config/ftconfig.h rename to external/freetype2/include/linux/freetype/config/ftconfig.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/config/ftheader.h b/external/freetype2/include/linux/freetype/config/ftheader.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/config/ftheader.h rename to external/freetype2/include/linux/freetype/config/ftheader.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/config/ftmodule.h b/external/freetype2/include/linux/freetype/config/ftmodule.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/config/ftmodule.h rename to external/freetype2/include/linux/freetype/config/ftmodule.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/config/ftoption.h b/external/freetype2/include/linux/freetype/config/ftoption.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/config/ftoption.h rename to external/freetype2/include/linux/freetype/config/ftoption.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/config/ftstdlib.h b/external/freetype2/include/linux/freetype/config/ftstdlib.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/config/ftstdlib.h rename to external/freetype2/include/linux/freetype/config/ftstdlib.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/freetype.h.REMOVED.git-id b/external/freetype2/include/linux/freetype/freetype.h.REMOVED.git-id similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/freetype.h.REMOVED.git-id rename to external/freetype2/include/linux/freetype/freetype.h.REMOVED.git-id diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftadvanc.h b/external/freetype2/include/linux/freetype/ftadvanc.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftadvanc.h rename to external/freetype2/include/linux/freetype/ftadvanc.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftbbox.h b/external/freetype2/include/linux/freetype/ftbbox.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftbbox.h rename to external/freetype2/include/linux/freetype/ftbbox.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftbdf.h b/external/freetype2/include/linux/freetype/ftbdf.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftbdf.h rename to external/freetype2/include/linux/freetype/ftbdf.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftbitmap.h b/external/freetype2/include/linux/freetype/ftbitmap.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftbitmap.h rename to external/freetype2/include/linux/freetype/ftbitmap.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftbzip2.h b/external/freetype2/include/linux/freetype/ftbzip2.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftbzip2.h rename to external/freetype2/include/linux/freetype/ftbzip2.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftcache.h b/external/freetype2/include/linux/freetype/ftcache.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftcache.h rename to external/freetype2/include/linux/freetype/ftcache.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftchapters.h b/external/freetype2/include/linux/freetype/ftchapters.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftchapters.h rename to external/freetype2/include/linux/freetype/ftchapters.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftcid.h b/external/freetype2/include/linux/freetype/ftcid.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftcid.h rename to external/freetype2/include/linux/freetype/ftcid.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/fterrdef.h b/external/freetype2/include/linux/freetype/fterrdef.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/fterrdef.h rename to external/freetype2/include/linux/freetype/fterrdef.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/fterrors.h b/external/freetype2/include/linux/freetype/fterrors.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/fterrors.h rename to external/freetype2/include/linux/freetype/fterrors.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftgasp.h b/external/freetype2/include/linux/freetype/ftgasp.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftgasp.h rename to external/freetype2/include/linux/freetype/ftgasp.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftglyph.h b/external/freetype2/include/linux/freetype/ftglyph.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftglyph.h rename to external/freetype2/include/linux/freetype/ftglyph.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftgxval.h b/external/freetype2/include/linux/freetype/ftgxval.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftgxval.h rename to external/freetype2/include/linux/freetype/ftgxval.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftgzip.h b/external/freetype2/include/linux/freetype/ftgzip.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftgzip.h rename to external/freetype2/include/linux/freetype/ftgzip.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftimage.h b/external/freetype2/include/linux/freetype/ftimage.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftimage.h rename to external/freetype2/include/linux/freetype/ftimage.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftincrem.h b/external/freetype2/include/linux/freetype/ftincrem.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftincrem.h rename to external/freetype2/include/linux/freetype/ftincrem.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftlcdfil.h b/external/freetype2/include/linux/freetype/ftlcdfil.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftlcdfil.h rename to external/freetype2/include/linux/freetype/ftlcdfil.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftlist.h b/external/freetype2/include/linux/freetype/ftlist.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftlist.h rename to external/freetype2/include/linux/freetype/ftlist.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftlzw.h b/external/freetype2/include/linux/freetype/ftlzw.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftlzw.h rename to external/freetype2/include/linux/freetype/ftlzw.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftmac.h b/external/freetype2/include/linux/freetype/ftmac.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftmac.h rename to external/freetype2/include/linux/freetype/ftmac.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftmm.h b/external/freetype2/include/linux/freetype/ftmm.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftmm.h rename to external/freetype2/include/linux/freetype/ftmm.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftmodapi.h b/external/freetype2/include/linux/freetype/ftmodapi.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftmodapi.h rename to external/freetype2/include/linux/freetype/ftmodapi.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftmoderr.h b/external/freetype2/include/linux/freetype/ftmoderr.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftmoderr.h rename to external/freetype2/include/linux/freetype/ftmoderr.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftotval.h b/external/freetype2/include/linux/freetype/ftotval.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftotval.h rename to external/freetype2/include/linux/freetype/ftotval.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftoutln.h b/external/freetype2/include/linux/freetype/ftoutln.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftoutln.h rename to external/freetype2/include/linux/freetype/ftoutln.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftpfr.h b/external/freetype2/include/linux/freetype/ftpfr.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftpfr.h rename to external/freetype2/include/linux/freetype/ftpfr.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftrender.h b/external/freetype2/include/linux/freetype/ftrender.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftrender.h rename to external/freetype2/include/linux/freetype/ftrender.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftsizes.h b/external/freetype2/include/linux/freetype/ftsizes.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftsizes.h rename to external/freetype2/include/linux/freetype/ftsizes.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftsnames.h b/external/freetype2/include/linux/freetype/ftsnames.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftsnames.h rename to external/freetype2/include/linux/freetype/ftsnames.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftstroke.h b/external/freetype2/include/linux/freetype/ftstroke.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftstroke.h rename to external/freetype2/include/linux/freetype/ftstroke.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftsynth.h b/external/freetype2/include/linux/freetype/ftsynth.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftsynth.h rename to external/freetype2/include/linux/freetype/ftsynth.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftsystem.h b/external/freetype2/include/linux/freetype/ftsystem.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftsystem.h rename to external/freetype2/include/linux/freetype/ftsystem.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/fttrigon.h b/external/freetype2/include/linux/freetype/fttrigon.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/fttrigon.h rename to external/freetype2/include/linux/freetype/fttrigon.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/fttypes.h b/external/freetype2/include/linux/freetype/fttypes.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/fttypes.h rename to external/freetype2/include/linux/freetype/fttypes.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftwinfnt.h b/external/freetype2/include/linux/freetype/ftwinfnt.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftwinfnt.h rename to external/freetype2/include/linux/freetype/ftwinfnt.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftxf86.h b/external/freetype2/include/linux/freetype/ftxf86.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/ftxf86.h rename to external/freetype2/include/linux/freetype/ftxf86.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/autohint.h b/external/freetype2/include/linux/freetype/internal/autohint.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/autohint.h rename to external/freetype2/include/linux/freetype/internal/autohint.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/ftcalc.h b/external/freetype2/include/linux/freetype/internal/ftcalc.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/ftcalc.h rename to external/freetype2/include/linux/freetype/internal/ftcalc.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/ftdebug.h b/external/freetype2/include/linux/freetype/internal/ftdebug.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/ftdebug.h rename to external/freetype2/include/linux/freetype/internal/ftdebug.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/ftdriver.h b/external/freetype2/include/linux/freetype/internal/ftdriver.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/ftdriver.h rename to external/freetype2/include/linux/freetype/internal/ftdriver.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/ftgloadr.h b/external/freetype2/include/linux/freetype/internal/ftgloadr.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/ftgloadr.h rename to external/freetype2/include/linux/freetype/internal/ftgloadr.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/ftmemory.h b/external/freetype2/include/linux/freetype/internal/ftmemory.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/ftmemory.h rename to external/freetype2/include/linux/freetype/internal/ftmemory.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/ftobjs.h b/external/freetype2/include/linux/freetype/internal/ftobjs.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/ftobjs.h rename to external/freetype2/include/linux/freetype/internal/ftobjs.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/ftpic.h b/external/freetype2/include/linux/freetype/internal/ftpic.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/ftpic.h rename to external/freetype2/include/linux/freetype/internal/ftpic.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/ftrfork.h b/external/freetype2/include/linux/freetype/internal/ftrfork.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/ftrfork.h rename to external/freetype2/include/linux/freetype/internal/ftrfork.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/ftserv.h b/external/freetype2/include/linux/freetype/internal/ftserv.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/ftserv.h rename to external/freetype2/include/linux/freetype/internal/ftserv.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/ftstream.h b/external/freetype2/include/linux/freetype/internal/ftstream.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/ftstream.h rename to external/freetype2/include/linux/freetype/internal/ftstream.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/fttrace.h b/external/freetype2/include/linux/freetype/internal/fttrace.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/fttrace.h rename to external/freetype2/include/linux/freetype/internal/fttrace.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/ftvalid.h b/external/freetype2/include/linux/freetype/internal/ftvalid.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/ftvalid.h rename to external/freetype2/include/linux/freetype/internal/ftvalid.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/internal.h b/external/freetype2/include/linux/freetype/internal/internal.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/internal.h rename to external/freetype2/include/linux/freetype/internal/internal.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/psaux.h b/external/freetype2/include/linux/freetype/internal/psaux.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/psaux.h rename to external/freetype2/include/linux/freetype/internal/psaux.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/pshints.h b/external/freetype2/include/linux/freetype/internal/pshints.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/pshints.h rename to external/freetype2/include/linux/freetype/internal/pshints.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/services/svbdf.h b/external/freetype2/include/linux/freetype/internal/services/svbdf.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/services/svbdf.h rename to external/freetype2/include/linux/freetype/internal/services/svbdf.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/services/svcid.h b/external/freetype2/include/linux/freetype/internal/services/svcid.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/services/svcid.h rename to external/freetype2/include/linux/freetype/internal/services/svcid.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/services/svgldict.h b/external/freetype2/include/linux/freetype/internal/services/svgldict.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/services/svgldict.h rename to external/freetype2/include/linux/freetype/internal/services/svgldict.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/services/svgxval.h b/external/freetype2/include/linux/freetype/internal/services/svgxval.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/services/svgxval.h rename to external/freetype2/include/linux/freetype/internal/services/svgxval.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/services/svkern.h b/external/freetype2/include/linux/freetype/internal/services/svkern.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/services/svkern.h rename to external/freetype2/include/linux/freetype/internal/services/svkern.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/services/svmm.h b/external/freetype2/include/linux/freetype/internal/services/svmm.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/services/svmm.h rename to external/freetype2/include/linux/freetype/internal/services/svmm.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/services/svotval.h b/external/freetype2/include/linux/freetype/internal/services/svotval.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/services/svotval.h rename to external/freetype2/include/linux/freetype/internal/services/svotval.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/services/svpfr.h b/external/freetype2/include/linux/freetype/internal/services/svpfr.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/services/svpfr.h rename to external/freetype2/include/linux/freetype/internal/services/svpfr.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/services/svpostnm.h b/external/freetype2/include/linux/freetype/internal/services/svpostnm.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/services/svpostnm.h rename to external/freetype2/include/linux/freetype/internal/services/svpostnm.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/services/svpscmap.h b/external/freetype2/include/linux/freetype/internal/services/svpscmap.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/services/svpscmap.h rename to external/freetype2/include/linux/freetype/internal/services/svpscmap.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/services/svpsinfo.h b/external/freetype2/include/linux/freetype/internal/services/svpsinfo.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/services/svpsinfo.h rename to external/freetype2/include/linux/freetype/internal/services/svpsinfo.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/services/svsfnt.h b/external/freetype2/include/linux/freetype/internal/services/svsfnt.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/services/svsfnt.h rename to external/freetype2/include/linux/freetype/internal/services/svsfnt.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/services/svttcmap.h b/external/freetype2/include/linux/freetype/internal/services/svttcmap.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/services/svttcmap.h rename to external/freetype2/include/linux/freetype/internal/services/svttcmap.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/services/svtteng.h b/external/freetype2/include/linux/freetype/internal/services/svtteng.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/services/svtteng.h rename to external/freetype2/include/linux/freetype/internal/services/svtteng.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/services/svttglyf.h b/external/freetype2/include/linux/freetype/internal/services/svttglyf.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/services/svttglyf.h rename to external/freetype2/include/linux/freetype/internal/services/svttglyf.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/services/svwinfnt.h b/external/freetype2/include/linux/freetype/internal/services/svwinfnt.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/services/svwinfnt.h rename to external/freetype2/include/linux/freetype/internal/services/svwinfnt.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/services/svxf86nm.h b/external/freetype2/include/linux/freetype/internal/services/svxf86nm.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/services/svxf86nm.h rename to external/freetype2/include/linux/freetype/internal/services/svxf86nm.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/sfnt.h b/external/freetype2/include/linux/freetype/internal/sfnt.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/sfnt.h rename to external/freetype2/include/linux/freetype/internal/sfnt.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/t1types.h b/external/freetype2/include/linux/freetype/internal/t1types.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/t1types.h rename to external/freetype2/include/linux/freetype/internal/t1types.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/tttypes.h b/external/freetype2/include/linux/freetype/internal/tttypes.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/internal/tttypes.h rename to external/freetype2/include/linux/freetype/internal/tttypes.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/t1tables.h b/external/freetype2/include/linux/freetype/t1tables.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/t1tables.h rename to external/freetype2/include/linux/freetype/t1tables.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/ttnameid.h b/external/freetype2/include/linux/freetype/ttnameid.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/ttnameid.h rename to external/freetype2/include/linux/freetype/ttnameid.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/tttables.h b/external/freetype2/include/linux/freetype/tttables.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/tttables.h rename to external/freetype2/include/linux/freetype/tttables.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/tttags.h b/external/freetype2/include/linux/freetype/tttags.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/tttags.h rename to external/freetype2/include/linux/freetype/tttags.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/freetype/ttunpat.h b/external/freetype2/include/linux/freetype/ttunpat.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/freetype/ttunpat.h rename to external/freetype2/include/linux/freetype/ttunpat.h diff --git a/cocos2dx/platform/third_party/linux/libfreetype2/ft2build.h b/external/freetype2/include/linux/ft2build.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libfreetype2/ft2build.h rename to external/freetype2/include/linux/ft2build.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/config/ftconfig.h b/external/freetype2/include/mac/freetype/config/ftconfig.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/config/ftconfig.h rename to external/freetype2/include/mac/freetype/config/ftconfig.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/config/ftheader.h b/external/freetype2/include/mac/freetype/config/ftheader.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/config/ftheader.h rename to external/freetype2/include/mac/freetype/config/ftheader.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/config/ftmodule.h b/external/freetype2/include/mac/freetype/config/ftmodule.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/config/ftmodule.h rename to external/freetype2/include/mac/freetype/config/ftmodule.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/config/ftoption.h b/external/freetype2/include/mac/freetype/config/ftoption.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/config/ftoption.h rename to external/freetype2/include/mac/freetype/config/ftoption.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/config/ftstdlib.h b/external/freetype2/include/mac/freetype/config/ftstdlib.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/config/ftstdlib.h rename to external/freetype2/include/mac/freetype/config/ftstdlib.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/freetype.h.REMOVED.git-id b/external/freetype2/include/mac/freetype/freetype.h.REMOVED.git-id similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/freetype.h.REMOVED.git-id rename to external/freetype2/include/mac/freetype/freetype.h.REMOVED.git-id diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftadvanc.h b/external/freetype2/include/mac/freetype/ftadvanc.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftadvanc.h rename to external/freetype2/include/mac/freetype/ftadvanc.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftautoh.h b/external/freetype2/include/mac/freetype/ftautoh.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftautoh.h rename to external/freetype2/include/mac/freetype/ftautoh.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftbbox.h b/external/freetype2/include/mac/freetype/ftbbox.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftbbox.h rename to external/freetype2/include/mac/freetype/ftbbox.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftbdf.h b/external/freetype2/include/mac/freetype/ftbdf.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftbdf.h rename to external/freetype2/include/mac/freetype/ftbdf.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftbitmap.h b/external/freetype2/include/mac/freetype/ftbitmap.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftbitmap.h rename to external/freetype2/include/mac/freetype/ftbitmap.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftbzip2.h b/external/freetype2/include/mac/freetype/ftbzip2.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftbzip2.h rename to external/freetype2/include/mac/freetype/ftbzip2.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftcache.h b/external/freetype2/include/mac/freetype/ftcache.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftcache.h rename to external/freetype2/include/mac/freetype/ftcache.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftcffdrv.h b/external/freetype2/include/mac/freetype/ftcffdrv.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftcffdrv.h rename to external/freetype2/include/mac/freetype/ftcffdrv.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftchapters.h b/external/freetype2/include/mac/freetype/ftchapters.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftchapters.h rename to external/freetype2/include/mac/freetype/ftchapters.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftcid.h b/external/freetype2/include/mac/freetype/ftcid.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftcid.h rename to external/freetype2/include/mac/freetype/ftcid.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/fterrdef.h b/external/freetype2/include/mac/freetype/fterrdef.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/fterrdef.h rename to external/freetype2/include/mac/freetype/fterrdef.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/fterrors.h b/external/freetype2/include/mac/freetype/fterrors.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/fterrors.h rename to external/freetype2/include/mac/freetype/fterrors.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftgasp.h b/external/freetype2/include/mac/freetype/ftgasp.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftgasp.h rename to external/freetype2/include/mac/freetype/ftgasp.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftglyph.h b/external/freetype2/include/mac/freetype/ftglyph.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftglyph.h rename to external/freetype2/include/mac/freetype/ftglyph.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftgxval.h b/external/freetype2/include/mac/freetype/ftgxval.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftgxval.h rename to external/freetype2/include/mac/freetype/ftgxval.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftgzip.h b/external/freetype2/include/mac/freetype/ftgzip.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftgzip.h rename to external/freetype2/include/mac/freetype/ftgzip.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftimage.h b/external/freetype2/include/mac/freetype/ftimage.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftimage.h rename to external/freetype2/include/mac/freetype/ftimage.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftincrem.h b/external/freetype2/include/mac/freetype/ftincrem.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftincrem.h rename to external/freetype2/include/mac/freetype/ftincrem.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftlcdfil.h b/external/freetype2/include/mac/freetype/ftlcdfil.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftlcdfil.h rename to external/freetype2/include/mac/freetype/ftlcdfil.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftlist.h b/external/freetype2/include/mac/freetype/ftlist.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftlist.h rename to external/freetype2/include/mac/freetype/ftlist.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftlzw.h b/external/freetype2/include/mac/freetype/ftlzw.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftlzw.h rename to external/freetype2/include/mac/freetype/ftlzw.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftmac.h b/external/freetype2/include/mac/freetype/ftmac.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftmac.h rename to external/freetype2/include/mac/freetype/ftmac.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftmm.h b/external/freetype2/include/mac/freetype/ftmm.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftmm.h rename to external/freetype2/include/mac/freetype/ftmm.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftmodapi.h b/external/freetype2/include/mac/freetype/ftmodapi.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftmodapi.h rename to external/freetype2/include/mac/freetype/ftmodapi.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftmoderr.h b/external/freetype2/include/mac/freetype/ftmoderr.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftmoderr.h rename to external/freetype2/include/mac/freetype/ftmoderr.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftotval.h b/external/freetype2/include/mac/freetype/ftotval.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftotval.h rename to external/freetype2/include/mac/freetype/ftotval.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftoutln.h b/external/freetype2/include/mac/freetype/ftoutln.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftoutln.h rename to external/freetype2/include/mac/freetype/ftoutln.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftpfr.h b/external/freetype2/include/mac/freetype/ftpfr.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftpfr.h rename to external/freetype2/include/mac/freetype/ftpfr.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftrender.h b/external/freetype2/include/mac/freetype/ftrender.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftrender.h rename to external/freetype2/include/mac/freetype/ftrender.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftsizes.h b/external/freetype2/include/mac/freetype/ftsizes.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftsizes.h rename to external/freetype2/include/mac/freetype/ftsizes.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftsnames.h b/external/freetype2/include/mac/freetype/ftsnames.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftsnames.h rename to external/freetype2/include/mac/freetype/ftsnames.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftstroke.h b/external/freetype2/include/mac/freetype/ftstroke.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftstroke.h rename to external/freetype2/include/mac/freetype/ftstroke.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftsynth.h b/external/freetype2/include/mac/freetype/ftsynth.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftsynth.h rename to external/freetype2/include/mac/freetype/ftsynth.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftsystem.h b/external/freetype2/include/mac/freetype/ftsystem.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftsystem.h rename to external/freetype2/include/mac/freetype/ftsystem.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/fttrigon.h b/external/freetype2/include/mac/freetype/fttrigon.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/fttrigon.h rename to external/freetype2/include/mac/freetype/fttrigon.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftttdrv.h b/external/freetype2/include/mac/freetype/ftttdrv.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftttdrv.h rename to external/freetype2/include/mac/freetype/ftttdrv.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/fttypes.h b/external/freetype2/include/mac/freetype/fttypes.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/fttypes.h rename to external/freetype2/include/mac/freetype/fttypes.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftwinfnt.h b/external/freetype2/include/mac/freetype/ftwinfnt.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftwinfnt.h rename to external/freetype2/include/mac/freetype/ftwinfnt.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftxf86.h b/external/freetype2/include/mac/freetype/ftxf86.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/ftxf86.h rename to external/freetype2/include/mac/freetype/ftxf86.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/autohint.h b/external/freetype2/include/mac/freetype/internal/autohint.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/autohint.h rename to external/freetype2/include/mac/freetype/internal/autohint.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/ftcalc.h b/external/freetype2/include/mac/freetype/internal/ftcalc.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/ftcalc.h rename to external/freetype2/include/mac/freetype/internal/ftcalc.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/ftdebug.h b/external/freetype2/include/mac/freetype/internal/ftdebug.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/ftdebug.h rename to external/freetype2/include/mac/freetype/internal/ftdebug.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/ftdriver.h b/external/freetype2/include/mac/freetype/internal/ftdriver.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/ftdriver.h rename to external/freetype2/include/mac/freetype/internal/ftdriver.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/ftgloadr.h b/external/freetype2/include/mac/freetype/internal/ftgloadr.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/ftgloadr.h rename to external/freetype2/include/mac/freetype/internal/ftgloadr.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/ftmemory.h b/external/freetype2/include/mac/freetype/internal/ftmemory.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/ftmemory.h rename to external/freetype2/include/mac/freetype/internal/ftmemory.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/ftobjs.h b/external/freetype2/include/mac/freetype/internal/ftobjs.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/ftobjs.h rename to external/freetype2/include/mac/freetype/internal/ftobjs.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/ftpic.h b/external/freetype2/include/mac/freetype/internal/ftpic.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/ftpic.h rename to external/freetype2/include/mac/freetype/internal/ftpic.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/ftrfork.h b/external/freetype2/include/mac/freetype/internal/ftrfork.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/ftrfork.h rename to external/freetype2/include/mac/freetype/internal/ftrfork.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/ftserv.h b/external/freetype2/include/mac/freetype/internal/ftserv.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/ftserv.h rename to external/freetype2/include/mac/freetype/internal/ftserv.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/ftstream.h b/external/freetype2/include/mac/freetype/internal/ftstream.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/ftstream.h rename to external/freetype2/include/mac/freetype/internal/ftstream.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/fttrace.h b/external/freetype2/include/mac/freetype/internal/fttrace.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/fttrace.h rename to external/freetype2/include/mac/freetype/internal/fttrace.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/ftvalid.h b/external/freetype2/include/mac/freetype/internal/ftvalid.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/ftvalid.h rename to external/freetype2/include/mac/freetype/internal/ftvalid.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/internal.h b/external/freetype2/include/mac/freetype/internal/internal.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/internal.h rename to external/freetype2/include/mac/freetype/internal/internal.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/psaux.h b/external/freetype2/include/mac/freetype/internal/psaux.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/psaux.h rename to external/freetype2/include/mac/freetype/internal/psaux.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/pshints.h b/external/freetype2/include/mac/freetype/internal/pshints.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/pshints.h rename to external/freetype2/include/mac/freetype/internal/pshints.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/services/svbdf.h b/external/freetype2/include/mac/freetype/internal/services/svbdf.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/services/svbdf.h rename to external/freetype2/include/mac/freetype/internal/services/svbdf.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/services/svcid.h b/external/freetype2/include/mac/freetype/internal/services/svcid.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/services/svcid.h rename to external/freetype2/include/mac/freetype/internal/services/svcid.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/services/svgldict.h b/external/freetype2/include/mac/freetype/internal/services/svgldict.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/services/svgldict.h rename to external/freetype2/include/mac/freetype/internal/services/svgldict.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/services/svgxval.h b/external/freetype2/include/mac/freetype/internal/services/svgxval.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/services/svgxval.h rename to external/freetype2/include/mac/freetype/internal/services/svgxval.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/services/svkern.h b/external/freetype2/include/mac/freetype/internal/services/svkern.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/services/svkern.h rename to external/freetype2/include/mac/freetype/internal/services/svkern.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/services/svmm.h b/external/freetype2/include/mac/freetype/internal/services/svmm.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/services/svmm.h rename to external/freetype2/include/mac/freetype/internal/services/svmm.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/services/svotval.h b/external/freetype2/include/mac/freetype/internal/services/svotval.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/services/svotval.h rename to external/freetype2/include/mac/freetype/internal/services/svotval.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/services/svpfr.h b/external/freetype2/include/mac/freetype/internal/services/svpfr.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/services/svpfr.h rename to external/freetype2/include/mac/freetype/internal/services/svpfr.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/services/svpostnm.h b/external/freetype2/include/mac/freetype/internal/services/svpostnm.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/services/svpostnm.h rename to external/freetype2/include/mac/freetype/internal/services/svpostnm.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/services/svprop.h b/external/freetype2/include/mac/freetype/internal/services/svprop.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/services/svprop.h rename to external/freetype2/include/mac/freetype/internal/services/svprop.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/services/svpscmap.h b/external/freetype2/include/mac/freetype/internal/services/svpscmap.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/services/svpscmap.h rename to external/freetype2/include/mac/freetype/internal/services/svpscmap.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/services/svpsinfo.h b/external/freetype2/include/mac/freetype/internal/services/svpsinfo.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/services/svpsinfo.h rename to external/freetype2/include/mac/freetype/internal/services/svpsinfo.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/services/svsfnt.h b/external/freetype2/include/mac/freetype/internal/services/svsfnt.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/services/svsfnt.h rename to external/freetype2/include/mac/freetype/internal/services/svsfnt.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/services/svttcmap.h b/external/freetype2/include/mac/freetype/internal/services/svttcmap.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/services/svttcmap.h rename to external/freetype2/include/mac/freetype/internal/services/svttcmap.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/services/svtteng.h b/external/freetype2/include/mac/freetype/internal/services/svtteng.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/services/svtteng.h rename to external/freetype2/include/mac/freetype/internal/services/svtteng.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/services/svttglyf.h b/external/freetype2/include/mac/freetype/internal/services/svttglyf.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/services/svttglyf.h rename to external/freetype2/include/mac/freetype/internal/services/svttglyf.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/services/svwinfnt.h b/external/freetype2/include/mac/freetype/internal/services/svwinfnt.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/services/svwinfnt.h rename to external/freetype2/include/mac/freetype/internal/services/svwinfnt.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/services/svxf86nm.h b/external/freetype2/include/mac/freetype/internal/services/svxf86nm.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/services/svxf86nm.h rename to external/freetype2/include/mac/freetype/internal/services/svxf86nm.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/sfnt.h b/external/freetype2/include/mac/freetype/internal/sfnt.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/sfnt.h rename to external/freetype2/include/mac/freetype/internal/sfnt.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/t1types.h b/external/freetype2/include/mac/freetype/internal/t1types.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/t1types.h rename to external/freetype2/include/mac/freetype/internal/t1types.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/tttypes.h b/external/freetype2/include/mac/freetype/internal/tttypes.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/internal/tttypes.h rename to external/freetype2/include/mac/freetype/internal/tttypes.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/t1tables.h b/external/freetype2/include/mac/freetype/t1tables.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/t1tables.h rename to external/freetype2/include/mac/freetype/t1tables.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/ttnameid.h b/external/freetype2/include/mac/freetype/ttnameid.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/ttnameid.h rename to external/freetype2/include/mac/freetype/ttnameid.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/tttables.h b/external/freetype2/include/mac/freetype/tttables.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/tttables.h rename to external/freetype2/include/mac/freetype/tttables.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/tttags.h b/external/freetype2/include/mac/freetype/tttags.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/tttags.h rename to external/freetype2/include/mac/freetype/tttags.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/freetype/ttunpat.h b/external/freetype2/include/mac/freetype/ttunpat.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/freetype/ttunpat.h rename to external/freetype2/include/mac/freetype/ttunpat.h diff --git a/cocos2dx/platform/third_party/mac/libfreetype2/ft2build.h b/external/freetype2/include/mac/ft2build.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libfreetype2/ft2build.h rename to external/freetype2/include/mac/ft2build.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/config/ftconfig.h b/external/freetype2/include/win32/freetype/config/ftconfig.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/config/ftconfig.h rename to external/freetype2/include/win32/freetype/config/ftconfig.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/config/ftheader.h b/external/freetype2/include/win32/freetype/config/ftheader.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/config/ftheader.h rename to external/freetype2/include/win32/freetype/config/ftheader.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/config/ftmodule.h b/external/freetype2/include/win32/freetype/config/ftmodule.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/config/ftmodule.h rename to external/freetype2/include/win32/freetype/config/ftmodule.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/config/ftoption.h b/external/freetype2/include/win32/freetype/config/ftoption.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/config/ftoption.h rename to external/freetype2/include/win32/freetype/config/ftoption.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/config/ftstdlib.h b/external/freetype2/include/win32/freetype/config/ftstdlib.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/config/ftstdlib.h rename to external/freetype2/include/win32/freetype/config/ftstdlib.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/freetype.h.REMOVED.git-id b/external/freetype2/include/win32/freetype/freetype.h.REMOVED.git-id similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/freetype.h.REMOVED.git-id rename to external/freetype2/include/win32/freetype/freetype.h.REMOVED.git-id diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftadvanc.h b/external/freetype2/include/win32/freetype/ftadvanc.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftadvanc.h rename to external/freetype2/include/win32/freetype/ftadvanc.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftautoh.h b/external/freetype2/include/win32/freetype/ftautoh.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftautoh.h rename to external/freetype2/include/win32/freetype/ftautoh.h diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftbbox.h b/external/freetype2/include/win32/freetype/ftbbox.h similarity index 100% rename from cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftbbox.h rename to external/freetype2/include/win32/freetype/ftbbox.h diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftbdf.h b/external/freetype2/include/win32/freetype/ftbdf.h similarity index 100% rename from cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftbdf.h rename to external/freetype2/include/win32/freetype/ftbdf.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftbitmap.h b/external/freetype2/include/win32/freetype/ftbitmap.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftbitmap.h rename to external/freetype2/include/win32/freetype/ftbitmap.h diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftbzip2.h b/external/freetype2/include/win32/freetype/ftbzip2.h similarity index 100% rename from cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftbzip2.h rename to external/freetype2/include/win32/freetype/ftbzip2.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftcache.h b/external/freetype2/include/win32/freetype/ftcache.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftcache.h rename to external/freetype2/include/win32/freetype/ftcache.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftcffdrv.h b/external/freetype2/include/win32/freetype/ftcffdrv.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftcffdrv.h rename to external/freetype2/include/win32/freetype/ftcffdrv.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftchapters.h b/external/freetype2/include/win32/freetype/ftchapters.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftchapters.h rename to external/freetype2/include/win32/freetype/ftchapters.h diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftcid.h b/external/freetype2/include/win32/freetype/ftcid.h similarity index 100% rename from cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftcid.h rename to external/freetype2/include/win32/freetype/ftcid.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/fterrdef.h b/external/freetype2/include/win32/freetype/fterrdef.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/fterrdef.h rename to external/freetype2/include/win32/freetype/fterrdef.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/fterrors.h b/external/freetype2/include/win32/freetype/fterrors.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/fterrors.h rename to external/freetype2/include/win32/freetype/fterrors.h diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftgasp.h b/external/freetype2/include/win32/freetype/ftgasp.h similarity index 100% rename from cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftgasp.h rename to external/freetype2/include/win32/freetype/ftgasp.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftglyph.h b/external/freetype2/include/win32/freetype/ftglyph.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftglyph.h rename to external/freetype2/include/win32/freetype/ftglyph.h diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftgxval.h b/external/freetype2/include/win32/freetype/ftgxval.h similarity index 100% rename from cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftgxval.h rename to external/freetype2/include/win32/freetype/ftgxval.h diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftgzip.h b/external/freetype2/include/win32/freetype/ftgzip.h similarity index 100% rename from cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftgzip.h rename to external/freetype2/include/win32/freetype/ftgzip.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftimage.h b/external/freetype2/include/win32/freetype/ftimage.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftimage.h rename to external/freetype2/include/win32/freetype/ftimage.h diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftincrem.h b/external/freetype2/include/win32/freetype/ftincrem.h similarity index 100% rename from cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftincrem.h rename to external/freetype2/include/win32/freetype/ftincrem.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftlcdfil.h b/external/freetype2/include/win32/freetype/ftlcdfil.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftlcdfil.h rename to external/freetype2/include/win32/freetype/ftlcdfil.h diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftlist.h b/external/freetype2/include/win32/freetype/ftlist.h similarity index 100% rename from cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftlist.h rename to external/freetype2/include/win32/freetype/ftlist.h diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftlzw.h b/external/freetype2/include/win32/freetype/ftlzw.h similarity index 100% rename from cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftlzw.h rename to external/freetype2/include/win32/freetype/ftlzw.h diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftmac.h b/external/freetype2/include/win32/freetype/ftmac.h similarity index 100% rename from cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftmac.h rename to external/freetype2/include/win32/freetype/ftmac.h diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftmm.h b/external/freetype2/include/win32/freetype/ftmm.h similarity index 100% rename from cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftmm.h rename to external/freetype2/include/win32/freetype/ftmm.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftmodapi.h b/external/freetype2/include/win32/freetype/ftmodapi.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftmodapi.h rename to external/freetype2/include/win32/freetype/ftmodapi.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftmoderr.h b/external/freetype2/include/win32/freetype/ftmoderr.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftmoderr.h rename to external/freetype2/include/win32/freetype/ftmoderr.h diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftotval.h b/external/freetype2/include/win32/freetype/ftotval.h similarity index 100% rename from cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftotval.h rename to external/freetype2/include/win32/freetype/ftotval.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftoutln.h b/external/freetype2/include/win32/freetype/ftoutln.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftoutln.h rename to external/freetype2/include/win32/freetype/ftoutln.h diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftpfr.h b/external/freetype2/include/win32/freetype/ftpfr.h similarity index 100% rename from cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftpfr.h rename to external/freetype2/include/win32/freetype/ftpfr.h diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftrender.h b/external/freetype2/include/win32/freetype/ftrender.h similarity index 100% rename from cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftrender.h rename to external/freetype2/include/win32/freetype/ftrender.h diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftsizes.h b/external/freetype2/include/win32/freetype/ftsizes.h similarity index 100% rename from cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftsizes.h rename to external/freetype2/include/win32/freetype/ftsizes.h diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftsnames.h b/external/freetype2/include/win32/freetype/ftsnames.h similarity index 100% rename from cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftsnames.h rename to external/freetype2/include/win32/freetype/ftsnames.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftstroke.h b/external/freetype2/include/win32/freetype/ftstroke.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftstroke.h rename to external/freetype2/include/win32/freetype/ftstroke.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftsynth.h b/external/freetype2/include/win32/freetype/ftsynth.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftsynth.h rename to external/freetype2/include/win32/freetype/ftsynth.h diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftsystem.h b/external/freetype2/include/win32/freetype/ftsystem.h similarity index 100% rename from cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftsystem.h rename to external/freetype2/include/win32/freetype/ftsystem.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/fttrigon.h b/external/freetype2/include/win32/freetype/fttrigon.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/fttrigon.h rename to external/freetype2/include/win32/freetype/fttrigon.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftttdrv.h b/external/freetype2/include/win32/freetype/ftttdrv.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/ftttdrv.h rename to external/freetype2/include/win32/freetype/ftttdrv.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/fttypes.h b/external/freetype2/include/win32/freetype/fttypes.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/fttypes.h rename to external/freetype2/include/win32/freetype/fttypes.h diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftwinfnt.h b/external/freetype2/include/win32/freetype/ftwinfnt.h similarity index 100% rename from cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftwinfnt.h rename to external/freetype2/include/win32/freetype/ftwinfnt.h diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftxf86.h b/external/freetype2/include/win32/freetype/ftxf86.h similarity index 100% rename from cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ftxf86.h rename to external/freetype2/include/win32/freetype/ftxf86.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/autohint.h b/external/freetype2/include/win32/freetype/internal/autohint.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/autohint.h rename to external/freetype2/include/win32/freetype/internal/autohint.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/ftcalc.h b/external/freetype2/include/win32/freetype/internal/ftcalc.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/ftcalc.h rename to external/freetype2/include/win32/freetype/internal/ftcalc.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/ftdebug.h b/external/freetype2/include/win32/freetype/internal/ftdebug.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/ftdebug.h rename to external/freetype2/include/win32/freetype/internal/ftdebug.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/ftdriver.h b/external/freetype2/include/win32/freetype/internal/ftdriver.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/ftdriver.h rename to external/freetype2/include/win32/freetype/internal/ftdriver.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/ftgloadr.h b/external/freetype2/include/win32/freetype/internal/ftgloadr.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/ftgloadr.h rename to external/freetype2/include/win32/freetype/internal/ftgloadr.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/ftmemory.h b/external/freetype2/include/win32/freetype/internal/ftmemory.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/ftmemory.h rename to external/freetype2/include/win32/freetype/internal/ftmemory.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/ftobjs.h b/external/freetype2/include/win32/freetype/internal/ftobjs.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/ftobjs.h rename to external/freetype2/include/win32/freetype/internal/ftobjs.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/ftpic.h b/external/freetype2/include/win32/freetype/internal/ftpic.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/ftpic.h rename to external/freetype2/include/win32/freetype/internal/ftpic.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/ftrfork.h b/external/freetype2/include/win32/freetype/internal/ftrfork.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/ftrfork.h rename to external/freetype2/include/win32/freetype/internal/ftrfork.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/ftserv.h b/external/freetype2/include/win32/freetype/internal/ftserv.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/ftserv.h rename to external/freetype2/include/win32/freetype/internal/ftserv.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/ftstream.h b/external/freetype2/include/win32/freetype/internal/ftstream.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/ftstream.h rename to external/freetype2/include/win32/freetype/internal/ftstream.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/fttrace.h b/external/freetype2/include/win32/freetype/internal/fttrace.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/fttrace.h rename to external/freetype2/include/win32/freetype/internal/fttrace.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/ftvalid.h b/external/freetype2/include/win32/freetype/internal/ftvalid.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/ftvalid.h rename to external/freetype2/include/win32/freetype/internal/ftvalid.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/internal.h b/external/freetype2/include/win32/freetype/internal/internal.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/internal.h rename to external/freetype2/include/win32/freetype/internal/internal.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/psaux.h b/external/freetype2/include/win32/freetype/internal/psaux.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/psaux.h rename to external/freetype2/include/win32/freetype/internal/psaux.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/pshints.h b/external/freetype2/include/win32/freetype/internal/pshints.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/pshints.h rename to external/freetype2/include/win32/freetype/internal/pshints.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/services/svbdf.h b/external/freetype2/include/win32/freetype/internal/services/svbdf.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/services/svbdf.h rename to external/freetype2/include/win32/freetype/internal/services/svbdf.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/services/svcid.h b/external/freetype2/include/win32/freetype/internal/services/svcid.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/services/svcid.h rename to external/freetype2/include/win32/freetype/internal/services/svcid.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/services/svgldict.h b/external/freetype2/include/win32/freetype/internal/services/svgldict.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/services/svgldict.h rename to external/freetype2/include/win32/freetype/internal/services/svgldict.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/services/svgxval.h b/external/freetype2/include/win32/freetype/internal/services/svgxval.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/services/svgxval.h rename to external/freetype2/include/win32/freetype/internal/services/svgxval.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/services/svkern.h b/external/freetype2/include/win32/freetype/internal/services/svkern.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/services/svkern.h rename to external/freetype2/include/win32/freetype/internal/services/svkern.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/services/svmm.h b/external/freetype2/include/win32/freetype/internal/services/svmm.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/services/svmm.h rename to external/freetype2/include/win32/freetype/internal/services/svmm.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/services/svotval.h b/external/freetype2/include/win32/freetype/internal/services/svotval.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/services/svotval.h rename to external/freetype2/include/win32/freetype/internal/services/svotval.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/services/svpfr.h b/external/freetype2/include/win32/freetype/internal/services/svpfr.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/services/svpfr.h rename to external/freetype2/include/win32/freetype/internal/services/svpfr.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/services/svpostnm.h b/external/freetype2/include/win32/freetype/internal/services/svpostnm.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/services/svpostnm.h rename to external/freetype2/include/win32/freetype/internal/services/svpostnm.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/services/svprop.h b/external/freetype2/include/win32/freetype/internal/services/svprop.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/services/svprop.h rename to external/freetype2/include/win32/freetype/internal/services/svprop.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/services/svpscmap.h b/external/freetype2/include/win32/freetype/internal/services/svpscmap.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/services/svpscmap.h rename to external/freetype2/include/win32/freetype/internal/services/svpscmap.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/services/svpsinfo.h b/external/freetype2/include/win32/freetype/internal/services/svpsinfo.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/services/svpsinfo.h rename to external/freetype2/include/win32/freetype/internal/services/svpsinfo.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/services/svsfnt.h b/external/freetype2/include/win32/freetype/internal/services/svsfnt.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/services/svsfnt.h rename to external/freetype2/include/win32/freetype/internal/services/svsfnt.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/services/svttcmap.h b/external/freetype2/include/win32/freetype/internal/services/svttcmap.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/services/svttcmap.h rename to external/freetype2/include/win32/freetype/internal/services/svttcmap.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/services/svtteng.h b/external/freetype2/include/win32/freetype/internal/services/svtteng.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/services/svtteng.h rename to external/freetype2/include/win32/freetype/internal/services/svtteng.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/services/svttglyf.h b/external/freetype2/include/win32/freetype/internal/services/svttglyf.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/services/svttglyf.h rename to external/freetype2/include/win32/freetype/internal/services/svttglyf.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/services/svwinfnt.h b/external/freetype2/include/win32/freetype/internal/services/svwinfnt.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/services/svwinfnt.h rename to external/freetype2/include/win32/freetype/internal/services/svwinfnt.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/services/svxf86nm.h b/external/freetype2/include/win32/freetype/internal/services/svxf86nm.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/services/svxf86nm.h rename to external/freetype2/include/win32/freetype/internal/services/svxf86nm.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/sfnt.h b/external/freetype2/include/win32/freetype/internal/sfnt.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/sfnt.h rename to external/freetype2/include/win32/freetype/internal/sfnt.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/t1types.h b/external/freetype2/include/win32/freetype/internal/t1types.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/t1types.h rename to external/freetype2/include/win32/freetype/internal/t1types.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/tttypes.h b/external/freetype2/include/win32/freetype/internal/tttypes.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/internal/tttypes.h rename to external/freetype2/include/win32/freetype/internal/tttypes.h diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/t1tables.h b/external/freetype2/include/win32/freetype/t1tables.h similarity index 100% rename from cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/t1tables.h rename to external/freetype2/include/win32/freetype/t1tables.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/ttnameid.h b/external/freetype2/include/win32/freetype/ttnameid.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/ttnameid.h rename to external/freetype2/include/win32/freetype/ttnameid.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/tttables.h b/external/freetype2/include/win32/freetype/tttables.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/tttables.h rename to external/freetype2/include/win32/freetype/tttables.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/freetype/tttags.h b/external/freetype2/include/win32/freetype/tttags.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/freetype/tttags.h rename to external/freetype2/include/win32/freetype/tttags.h diff --git a/cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ttunpat.h b/external/freetype2/include/win32/freetype/ttunpat.h similarity index 100% rename from cocos2dx/platform/third_party/tizen/rootstraps/tizen-device-2.2.native/usr/include/freetype2/freetype/ttunpat.h rename to external/freetype2/include/win32/freetype/ttunpat.h diff --git a/cocos2dx/platform/third_party/win32/libfreetype2/ft2build.h b/external/freetype2/include/win32/ft2build.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libfreetype2/ft2build.h rename to external/freetype2/include/win32/ft2build.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libfreetype2/Android.mk b/external/freetype2/prebuilt/andorid/Android.mk similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libfreetype2/Android.mk rename to external/freetype2/prebuilt/andorid/Android.mk diff --git a/cocos2dx/platform/third_party/android/prebuilt/libfreetype2/libs/armeabi-v7a/libfreetype.a.REMOVED.git-id b/external/freetype2/prebuilt/andorid/armeabi-v7a/libfreetype.a.REMOVED.git-id similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libfreetype2/libs/armeabi-v7a/libfreetype.a.REMOVED.git-id rename to external/freetype2/prebuilt/andorid/armeabi-v7a/libfreetype.a.REMOVED.git-id diff --git a/cocos2dx/platform/third_party/android/prebuilt/libfreetype2/libs/armeabi/libfreetype.a.REMOVED.git-id b/external/freetype2/prebuilt/andorid/armeabi/libfreetype.a.REMOVED.git-id similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libfreetype2/libs/armeabi/libfreetype.a.REMOVED.git-id rename to external/freetype2/prebuilt/andorid/armeabi/libfreetype.a.REMOVED.git-id diff --git a/cocos2dx/platform/third_party/android/prebuilt/libfreetype2/libs/x86/libfreetype.a.REMOVED.git-id b/external/freetype2/prebuilt/andorid/x86/libfreetype.a.REMOVED.git-id similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libfreetype2/libs/x86/libfreetype.a.REMOVED.git-id rename to external/freetype2/prebuilt/andorid/x86/libfreetype.a.REMOVED.git-id diff --git a/cocos2dx/platform/third_party/ios/libraries/libfreetype.a.REMOVED.git-id b/external/freetype2/prebuilt/ios/libfreetype.a.REMOVED.git-id similarity index 100% rename from cocos2dx/platform/third_party/ios/libraries/libfreetype.a.REMOVED.git-id rename to external/freetype2/prebuilt/ios/libfreetype.a.REMOVED.git-id diff --git a/cocos2dx/platform/third_party/linux/libraries/libfreetype.a.REMOVED.git-id b/external/freetype2/prebuilt/linux/32-bit/libfreetype.a.REMOVED.git-id similarity index 100% rename from cocos2dx/platform/third_party/linux/libraries/libfreetype.a.REMOVED.git-id rename to external/freetype2/prebuilt/linux/32-bit/libfreetype.a.REMOVED.git-id diff --git a/cocos2dx/platform/third_party/linux/libraries/lib64/libfreetype.a.REMOVED.git-id b/external/freetype2/prebuilt/linux/64-bit/libfreetype.a.REMOVED.git-id similarity index 100% rename from cocos2dx/platform/third_party/linux/libraries/lib64/libfreetype.a.REMOVED.git-id rename to external/freetype2/prebuilt/linux/64-bit/libfreetype.a.REMOVED.git-id diff --git a/cocos2dx/platform/third_party/mac/libraries/libfreetype.a.REMOVED.git-id b/external/freetype2/prebuilt/mac/libfreetype.a.REMOVED.git-id similarity index 100% rename from cocos2dx/platform/third_party/mac/libraries/libfreetype.a.REMOVED.git-id rename to external/freetype2/prebuilt/mac/libfreetype.a.REMOVED.git-id diff --git a/cocos2dx/platform/third_party/win32/libraries/freetype250.lib.REMOVED.git-id b/external/freetype2/prebuilt/win32/freetype250.lib.REMOVED.git-id similarity index 100% rename from cocos2dx/platform/third_party/win32/libraries/freetype250.lib.REMOVED.git-id rename to external/freetype2/prebuilt/win32/freetype250.lib.REMOVED.git-id diff --git a/cocos2dx/platform/third_party/linux/glfw/glfw3.h b/external/glfw3/include/linux/glfw3.h similarity index 100% rename from cocos2dx/platform/third_party/linux/glfw/glfw3.h rename to external/glfw3/include/linux/glfw3.h diff --git a/cocos2dx/platform/third_party/linux/glfw/glfw3native.h b/external/glfw3/include/linux/glfw3native.h similarity index 100% rename from cocos2dx/platform/third_party/linux/glfw/glfw3native.h rename to external/glfw3/include/linux/glfw3native.h diff --git a/cocos2dx/platform/third_party/mac/glfw/glfw3.h b/external/glfw3/include/mac/glfw3.h similarity index 100% rename from cocos2dx/platform/third_party/mac/glfw/glfw3.h rename to external/glfw3/include/mac/glfw3.h diff --git a/cocos2dx/platform/third_party/mac/glfw/glfw3native.h b/external/glfw3/include/mac/glfw3native.h similarity index 100% rename from cocos2dx/platform/third_party/mac/glfw/glfw3native.h rename to external/glfw3/include/mac/glfw3native.h diff --git a/cocos2dx/platform/third_party/win32/GLFW/glfw3.h b/external/glfw3/include/win32/glfw3.h similarity index 100% rename from cocos2dx/platform/third_party/win32/GLFW/glfw3.h rename to external/glfw3/include/win32/glfw3.h diff --git a/cocos2dx/platform/third_party/win32/GLFW/glfw3native.h b/external/glfw3/include/win32/glfw3native.h similarity index 100% rename from cocos2dx/platform/third_party/win32/GLFW/glfw3native.h rename to external/glfw3/include/win32/glfw3native.h diff --git a/cocos2dx/platform/third_party/mac/libraries/libglfw3.a.REMOVED.git-id b/external/glfw3/prebuilt/mac/libglfw3.a.REMOVED.git-id similarity index 100% rename from cocos2dx/platform/third_party/mac/libraries/libglfw3.a.REMOVED.git-id rename to external/glfw3/prebuilt/mac/libglfw3.a.REMOVED.git-id diff --git a/cocos2dx/platform/third_party/win32/libraries/glfw3.lib.REMOVED.git-id b/external/glfw3/prebuilt/win32/glfw3.lib.REMOVED.git-id similarity index 100% rename from cocos2dx/platform/third_party/win32/libraries/glfw3.lib.REMOVED.git-id rename to external/glfw3/prebuilt/win32/glfw3.lib.REMOVED.git-id diff --git a/cocos2dx/platform/third_party/android/prebuilt/libjpeg/include/jconfig.h b/external/jpeg/include/andorid/jconfig.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libjpeg/include/jconfig.h rename to external/jpeg/include/andorid/jconfig.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libjpeg/include/jerror.h b/external/jpeg/include/andorid/jerror.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libjpeg/include/jerror.h rename to external/jpeg/include/andorid/jerror.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libjpeg/include/jmorecfg.h b/external/jpeg/include/andorid/jmorecfg.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libjpeg/include/jmorecfg.h rename to external/jpeg/include/andorid/jmorecfg.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libjpeg/include/jpeglib.h b/external/jpeg/include/andorid/jpeglib.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libjpeg/include/jpeglib.h rename to external/jpeg/include/andorid/jpeglib.h diff --git a/cocos2dx/platform/third_party/ios/libjpeg/jconfig.h b/external/jpeg/include/ios/jconfig.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libjpeg/jconfig.h rename to external/jpeg/include/ios/jconfig.h diff --git a/cocos2dx/platform/third_party/emscripten/libjpeg/jmorecfg.h b/external/jpeg/include/ios/jmorecfg.h similarity index 100% rename from cocos2dx/platform/third_party/emscripten/libjpeg/jmorecfg.h rename to external/jpeg/include/ios/jmorecfg.h diff --git a/cocos2dx/platform/third_party/emscripten/libjpeg/jpeglib.h b/external/jpeg/include/ios/jpeglib.h similarity index 100% rename from cocos2dx/platform/third_party/emscripten/libjpeg/jpeglib.h rename to external/jpeg/include/ios/jpeglib.h diff --git a/cocos2dx/platform/third_party/emscripten/libjpeg/jconfig.h b/external/jpeg/include/linux/jconfig.h similarity index 100% rename from cocos2dx/platform/third_party/emscripten/libjpeg/jconfig.h rename to external/jpeg/include/linux/jconfig.h diff --git a/cocos2dx/platform/third_party/ios/libjpeg/jmorecfg.h b/external/jpeg/include/linux/jmorecfg.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libjpeg/jmorecfg.h rename to external/jpeg/include/linux/jmorecfg.h diff --git a/cocos2dx/platform/third_party/ios/libjpeg/jpeglib.h b/external/jpeg/include/linux/jpeglib.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libjpeg/jpeglib.h rename to external/jpeg/include/linux/jpeglib.h diff --git a/cocos2dx/platform/third_party/mac/libjpeg/jconfig.h b/external/jpeg/include/mac/jconfig.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libjpeg/jconfig.h rename to external/jpeg/include/mac/jconfig.h diff --git a/cocos2dx/platform/third_party/linux/libjpeg/jmorecfg.h b/external/jpeg/include/mac/jmorecfg.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libjpeg/jmorecfg.h rename to external/jpeg/include/mac/jmorecfg.h diff --git a/cocos2dx/platform/third_party/linux/libjpeg/jpeglib.h b/external/jpeg/include/mac/jpeglib.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libjpeg/jpeglib.h rename to external/jpeg/include/mac/jpeglib.h diff --git a/cocos2dx/platform/third_party/win32/libjpeg/jconfig.h b/external/jpeg/include/win32/jconfig.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libjpeg/jconfig.h rename to external/jpeg/include/win32/jconfig.h diff --git a/cocos2dx/platform/third_party/mac/libjpeg/jmorecfg.h b/external/jpeg/include/win32/jmorecfg.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libjpeg/jmorecfg.h rename to external/jpeg/include/win32/jmorecfg.h diff --git a/cocos2dx/platform/third_party/mac/libjpeg/jpeglib.h b/external/jpeg/include/win32/jpeglib.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libjpeg/jpeglib.h rename to external/jpeg/include/win32/jpeglib.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libjpeg/Android.mk b/external/jpeg/prebuilt/andorid/Android.mk similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libjpeg/Android.mk rename to external/jpeg/prebuilt/andorid/Android.mk diff --git a/cocos2dx/platform/third_party/android/prebuilt/libjpeg/libs/armeabi-v7a/libjpeg.a.REMOVED.git-id b/external/jpeg/prebuilt/andorid/armeabi-v7a/libjpeg.a.REMOVED.git-id similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libjpeg/libs/armeabi-v7a/libjpeg.a.REMOVED.git-id rename to external/jpeg/prebuilt/andorid/armeabi-v7a/libjpeg.a.REMOVED.git-id diff --git a/cocos2dx/platform/third_party/android/prebuilt/libjpeg/libs/armeabi/libjpeg.a.REMOVED.git-id b/external/jpeg/prebuilt/andorid/armeabi/libjpeg.a.REMOVED.git-id similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libjpeg/libs/armeabi/libjpeg.a.REMOVED.git-id rename to external/jpeg/prebuilt/andorid/armeabi/libjpeg.a.REMOVED.git-id diff --git a/cocos2dx/platform/third_party/android/prebuilt/libjpeg/libs/x86/libjpeg.a.REMOVED.git-id b/external/jpeg/prebuilt/andorid/x86/libjpeg.a.REMOVED.git-id similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libjpeg/libs/x86/libjpeg.a.REMOVED.git-id rename to external/jpeg/prebuilt/andorid/x86/libjpeg.a.REMOVED.git-id diff --git a/cocos2dx/platform/third_party/ios/libraries/libjpeg.a.REMOVED.git-id b/external/jpeg/prebuilt/ios/libjpeg.a.REMOVED.git-id similarity index 100% rename from cocos2dx/platform/third_party/ios/libraries/libjpeg.a.REMOVED.git-id rename to external/jpeg/prebuilt/ios/libjpeg.a.REMOVED.git-id diff --git a/cocos2dx/platform/third_party/linux/libraries/libjpeg.a.REMOVED.git-id b/external/jpeg/prebuilt/linux/32-bit/libjpeg.a.REMOVED.git-id similarity index 100% rename from cocos2dx/platform/third_party/linux/libraries/libjpeg.a.REMOVED.git-id rename to external/jpeg/prebuilt/linux/32-bit/libjpeg.a.REMOVED.git-id diff --git a/cocos2dx/platform/third_party/linux/libraries/lib64/libjpeg.a.REMOVED.git-id b/external/jpeg/prebuilt/linux/64-bit/libjpeg.a.REMOVED.git-id similarity index 100% rename from cocos2dx/platform/third_party/linux/libraries/lib64/libjpeg.a.REMOVED.git-id rename to external/jpeg/prebuilt/linux/64-bit/libjpeg.a.REMOVED.git-id diff --git a/cocos2dx/platform/third_party/mac/libraries/libjpeg.a.REMOVED.git-id b/external/jpeg/prebuilt/mac/libjpeg.a.REMOVED.git-id similarity index 100% rename from cocos2dx/platform/third_party/mac/libraries/libjpeg.a.REMOVED.git-id rename to external/jpeg/prebuilt/mac/libjpeg.a.REMOVED.git-id diff --git a/cocos2dx/platform/third_party/win32/libraries/libjpeg.lib.REMOVED.git-id b/external/jpeg/prebuilt/win32/libjpeg.lib.REMOVED.git-id similarity index 100% rename from cocos2dx/platform/third_party/win32/libraries/libjpeg.lib.REMOVED.git-id rename to external/jpeg/prebuilt/win32/libjpeg.lib.REMOVED.git-id diff --git a/extensions/CocoStudio/Json/lib_json/autolink.h b/external/jsoncpp/autolink.h similarity index 100% rename from extensions/CocoStudio/Json/lib_json/autolink.h rename to external/jsoncpp/autolink.h diff --git a/extensions/CocoStudio/Json/lib_json/config.h b/external/jsoncpp/config.h similarity index 100% rename from extensions/CocoStudio/Json/lib_json/config.h rename to external/jsoncpp/config.h diff --git a/extensions/CocoStudio/Json/lib_json/features.h b/external/jsoncpp/features.h similarity index 100% rename from extensions/CocoStudio/Json/lib_json/features.h rename to external/jsoncpp/features.h diff --git a/extensions/CocoStudio/Json/lib_json/forwards.h b/external/jsoncpp/forwards.h similarity index 100% rename from extensions/CocoStudio/Json/lib_json/forwards.h rename to external/jsoncpp/forwards.h diff --git a/extensions/CocoStudio/Json/lib_json/json_batchallocator.h b/external/jsoncpp/json_batchallocator.h similarity index 100% rename from extensions/CocoStudio/Json/lib_json/json_batchallocator.h rename to external/jsoncpp/json_batchallocator.h diff --git a/extensions/CocoStudio/Json/lib_json/json_internalarray.inl b/external/jsoncpp/json_internalarray.inl similarity index 100% rename from extensions/CocoStudio/Json/lib_json/json_internalarray.inl rename to external/jsoncpp/json_internalarray.inl diff --git a/extensions/CocoStudio/Json/lib_json/json_internalmap.inl b/external/jsoncpp/json_internalmap.inl similarity index 100% rename from extensions/CocoStudio/Json/lib_json/json_internalmap.inl rename to external/jsoncpp/json_internalmap.inl diff --git a/extensions/CocoStudio/Json/lib_json/json_lib.h b/external/jsoncpp/json_lib.h similarity index 100% rename from extensions/CocoStudio/Json/lib_json/json_lib.h rename to external/jsoncpp/json_lib.h diff --git a/extensions/CocoStudio/Json/lib_json/json_reader.cpp b/external/jsoncpp/json_reader.cpp similarity index 100% rename from extensions/CocoStudio/Json/lib_json/json_reader.cpp rename to external/jsoncpp/json_reader.cpp diff --git a/extensions/CocoStudio/Json/lib_json/json_tool.h b/external/jsoncpp/json_tool.h similarity index 100% rename from extensions/CocoStudio/Json/lib_json/json_tool.h rename to external/jsoncpp/json_tool.h diff --git a/extensions/CocoStudio/Json/lib_json/json_value.cpp b/external/jsoncpp/json_value.cpp similarity index 100% rename from extensions/CocoStudio/Json/lib_json/json_value.cpp rename to external/jsoncpp/json_value.cpp diff --git a/extensions/CocoStudio/Json/lib_json/json_valueiterator.inl b/external/jsoncpp/json_valueiterator.inl similarity index 100% rename from extensions/CocoStudio/Json/lib_json/json_valueiterator.inl rename to external/jsoncpp/json_valueiterator.inl diff --git a/extensions/CocoStudio/Json/lib_json/json_writer.cpp b/external/jsoncpp/json_writer.cpp similarity index 100% rename from extensions/CocoStudio/Json/lib_json/json_writer.cpp rename to external/jsoncpp/json_writer.cpp diff --git a/extensions/CocoStudio/Json/lib_json/reader.h b/external/jsoncpp/reader.h similarity index 100% rename from extensions/CocoStudio/Json/lib_json/reader.h rename to external/jsoncpp/reader.h diff --git a/extensions/CocoStudio/Json/lib_json/sconscript b/external/jsoncpp/sconscript similarity index 100% rename from extensions/CocoStudio/Json/lib_json/sconscript rename to external/jsoncpp/sconscript diff --git a/extensions/CocoStudio/Json/lib_json/value.h b/external/jsoncpp/value.h similarity index 100% rename from extensions/CocoStudio/Json/lib_json/value.h rename to external/jsoncpp/value.h diff --git a/extensions/CocoStudio/Json/lib_json/writer.h b/external/jsoncpp/writer.h similarity index 100% rename from extensions/CocoStudio/Json/lib_json/writer.h rename to external/jsoncpp/writer.h diff --git a/external/libwebp/dec/Makefile.am b/external/libwebp/dec/Makefile.am deleted file mode 100644 index 06142063f5..0000000000 --- a/external/libwebp/dec/Makefile.am +++ /dev/null @@ -1,28 +0,0 @@ -AM_CPPFLAGS = -I$(top_srcdir)/src -noinst_LTLIBRARIES = libwebpdecode.la - -libwebpdecode_la_SOURCES = -libwebpdecode_la_SOURCES += alpha.c -libwebpdecode_la_SOURCES += buffer.c -libwebpdecode_la_SOURCES += decode_vp8.h -libwebpdecode_la_SOURCES += frame.c -libwebpdecode_la_SOURCES += idec.c -libwebpdecode_la_SOURCES += io.c -libwebpdecode_la_SOURCES += layer.c -libwebpdecode_la_SOURCES += quant.c -libwebpdecode_la_SOURCES += tree.c -libwebpdecode_la_SOURCES += vp8.c -libwebpdecode_la_SOURCES += vp8i.h -libwebpdecode_la_SOURCES += vp8l.c -libwebpdecode_la_SOURCES += vp8li.h -libwebpdecode_la_SOURCES += webp.c -libwebpdecode_la_SOURCES += webpi.h - -libwebpdecodeinclude_HEADERS = -libwebpdecodeinclude_HEADERS += ../webp/decode.h -libwebpdecodeinclude_HEADERS += ../webp/types.h -noinst_HEADERS = -noinst_HEADERS += ../webp/format_constants.h - -libwebpdecode_la_CPPFLAGS = $(USE_EXPERIMENTAL_CODE) -libwebpdecodeincludedir = $(includedir)/webp diff --git a/external/libwebp/dec/alpha.c b/external/libwebp/dec/alpha.c deleted file mode 100644 index 6e65de9030..0000000000 --- a/external/libwebp/dec/alpha.c +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright 2011 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Alpha-plane decompression. -// -// Author: Skal (pascal.massimino@gmail.com) - -#include <stdlib.h> -#include "./vp8i.h" -#include "./vp8li.h" -#include "../utils/filters.h" -#include "../utils/quant_levels.h" -#include "../webp/format_constants.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -// TODO(skal): move to dsp/ ? -static void CopyPlane(const uint8_t* src, int src_stride, - uint8_t* dst, int dst_stride, int width, int height) { - while (height-- > 0) { - memcpy(dst, src, width); - src += src_stride; - dst += dst_stride; - } -} - -//------------------------------------------------------------------------------ -// Decodes the compressed data 'data' of size 'data_size' into the 'output'. -// The 'output' buffer should be pre-allocated and must be of the same -// dimension 'height'x'stride', as that of the image. -// -// Returns 1 on successfully decoding the compressed alpha and -// 0 if either: -// error in bit-stream header (invalid compression mode or filter), or -// error returned by appropriate compression method. - -static int DecodeAlpha(const uint8_t* data, size_t data_size, - int width, int height, int stride, uint8_t* output) { - uint8_t* decoded_data = NULL; - const size_t decoded_size = height * width; - uint8_t* unfiltered_data = NULL; - WEBP_FILTER_TYPE filter; - int pre_processing; - int rsrv; - int ok = 0; - int method; - - assert(width > 0 && height > 0 && stride >= width); - assert(data != NULL && output != NULL); - - if (data_size <= ALPHA_HEADER_LEN) { - return 0; - } - - method = (data[0] >> 0) & 0x03; - filter = (data[0] >> 2) & 0x03; - pre_processing = (data[0] >> 4) & 0x03; - rsrv = (data[0] >> 6) & 0x03; - if (method < ALPHA_NO_COMPRESSION || - method > ALPHA_LOSSLESS_COMPRESSION || - filter >= WEBP_FILTER_LAST || - pre_processing > ALPHA_PREPROCESSED_LEVELS || - rsrv != 0) { - return 0; - } - - if (method == ALPHA_NO_COMPRESSION) { - ok = (data_size >= decoded_size); - decoded_data = (uint8_t*)data + ALPHA_HEADER_LEN; - } else { - decoded_data = (uint8_t*)malloc(decoded_size); - if (decoded_data == NULL) return 0; - ok = VP8LDecodeAlphaImageStream(width, height, - data + ALPHA_HEADER_LEN, - data_size - ALPHA_HEADER_LEN, - decoded_data); - } - - if (ok) { - WebPFilterFunc unfilter_func = WebPUnfilters[filter]; - if (unfilter_func != NULL) { - unfiltered_data = (uint8_t*)malloc(decoded_size); - if (unfiltered_data == NULL) { - ok = 0; - goto Error; - } - // TODO(vikas): Implement on-the-fly decoding & filter mechanism to decode - // and apply filter per image-row. - unfilter_func(decoded_data, width, height, 1, width, unfiltered_data); - // Construct raw_data (height x stride) from alpha data (height x width). - CopyPlane(unfiltered_data, width, output, stride, width, height); - free(unfiltered_data); - } else { - // Construct raw_data (height x stride) from alpha data (height x width). - CopyPlane(decoded_data, width, output, stride, width, height); - } - if (pre_processing == ALPHA_PREPROCESSED_LEVELS) { - ok = DequantizeLevels(decoded_data, width, height); - } - } - - Error: - if (method != ALPHA_NO_COMPRESSION) { - free(decoded_data); - } - return ok; -} - -//------------------------------------------------------------------------------ - -const uint8_t* VP8DecompressAlphaRows(VP8Decoder* const dec, - int row, int num_rows) { - const int stride = dec->pic_hdr_.width_; - - if (row < 0 || num_rows < 0 || row + num_rows > dec->pic_hdr_.height_) { - return NULL; // sanity check. - } - - if (row == 0) { - // Decode everything during the first call. - if (!DecodeAlpha(dec->alpha_data_, (size_t)dec->alpha_data_size_, - dec->pic_hdr_.width_, dec->pic_hdr_.height_, stride, - dec->alpha_plane_)) { - return NULL; // Error. - } - } - - // Return a pointer to the current decoded row. - return dec->alpha_plane_ + row * stride; -} - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif diff --git a/external/libwebp/dec/buffer.c b/external/libwebp/dec/buffer.c deleted file mode 100644 index c159f6f248..0000000000 --- a/external/libwebp/dec/buffer.c +++ /dev/null @@ -1,215 +0,0 @@ -// Copyright 2011 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Everything about WebPDecBuffer -// -// Author: Skal (pascal.massimino@gmail.com) - -#include <stdlib.h> - -#include "./vp8i.h" -#include "./webpi.h" -#include "../utils/utils.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -//------------------------------------------------------------------------------ -// WebPDecBuffer - -// Number of bytes per pixel for the different color-spaces. -static const int kModeBpp[MODE_LAST] = { - 3, 4, 3, 4, 4, 2, 2, - 4, 4, 4, 2, // pre-multiplied modes - 1, 1 }; - -// Check that webp_csp_mode is within the bounds of WEBP_CSP_MODE. -// Convert to an integer to handle both the unsigned/signed enum cases -// without the need for casting to remove type limit warnings. -static int IsValidColorspace(int webp_csp_mode) { - return (webp_csp_mode >= MODE_RGB && webp_csp_mode < MODE_LAST); -} - -static VP8StatusCode CheckDecBuffer(const WebPDecBuffer* const buffer) { - int ok = 1; - const WEBP_CSP_MODE mode = buffer->colorspace; - const int width = buffer->width; - const int height = buffer->height; - if (!IsValidColorspace(mode)) { - ok = 0; - } else if (!WebPIsRGBMode(mode)) { // YUV checks - const WebPYUVABuffer* const buf = &buffer->u.YUVA; - const uint64_t y_size = (uint64_t)buf->y_stride * height; - const uint64_t u_size = (uint64_t)buf->u_stride * ((height + 1) / 2); - const uint64_t v_size = (uint64_t)buf->v_stride * ((height + 1) / 2); - const uint64_t a_size = (uint64_t)buf->a_stride * height; - ok &= (y_size <= buf->y_size); - ok &= (u_size <= buf->u_size); - ok &= (v_size <= buf->v_size); - ok &= (buf->y_stride >= width); - ok &= (buf->u_stride >= (width + 1) / 2); - ok &= (buf->v_stride >= (width + 1) / 2); - ok &= (buf->y != NULL); - ok &= (buf->u != NULL); - ok &= (buf->v != NULL); - if (mode == MODE_YUVA) { - ok &= (buf->a_stride >= width); - ok &= (a_size <= buf->a_size); - ok &= (buf->a != NULL); - } - } else { // RGB checks - const WebPRGBABuffer* const buf = &buffer->u.RGBA; - const uint64_t size = (uint64_t)buf->stride * height; - ok &= (size <= buf->size); - ok &= (buf->stride >= width * kModeBpp[mode]); - ok &= (buf->rgba != NULL); - } - return ok ? VP8_STATUS_OK : VP8_STATUS_INVALID_PARAM; -} - -static VP8StatusCode AllocateBuffer(WebPDecBuffer* const buffer) { - const int w = buffer->width; - const int h = buffer->height; - const WEBP_CSP_MODE mode = buffer->colorspace; - - if (w <= 0 || h <= 0 || !IsValidColorspace(mode)) { - return VP8_STATUS_INVALID_PARAM; - } - - if (!buffer->is_external_memory && buffer->private_memory == NULL) { - uint8_t* output; - int uv_stride = 0, a_stride = 0; - uint64_t uv_size = 0, a_size = 0, total_size; - // We need memory and it hasn't been allocated yet. - // => initialize output buffer, now that dimensions are known. - const int stride = w * kModeBpp[mode]; - const uint64_t size = (uint64_t)stride * h; - - if (!WebPIsRGBMode(mode)) { - uv_stride = (w + 1) / 2; - uv_size = (uint64_t)uv_stride * ((h + 1) / 2); - if (mode == MODE_YUVA) { - a_stride = w; - a_size = (uint64_t)a_stride * h; - } - } - total_size = size + 2 * uv_size + a_size; - - // Security/sanity checks - output = (uint8_t*)WebPSafeMalloc(total_size, sizeof(*output)); - if (output == NULL) { - return VP8_STATUS_OUT_OF_MEMORY; - } - buffer->private_memory = output; - - if (!WebPIsRGBMode(mode)) { // YUVA initialization - WebPYUVABuffer* const buf = &buffer->u.YUVA; - buf->y = output; - buf->y_stride = stride; - buf->y_size = (size_t)size; - buf->u = output + size; - buf->u_stride = uv_stride; - buf->u_size = (size_t)uv_size; - buf->v = output + size + uv_size; - buf->v_stride = uv_stride; - buf->v_size = (size_t)uv_size; - if (mode == MODE_YUVA) { - buf->a = output + size + 2 * uv_size; - } - buf->a_size = (size_t)a_size; - buf->a_stride = a_stride; - } else { // RGBA initialization - WebPRGBABuffer* const buf = &buffer->u.RGBA; - buf->rgba = output; - buf->stride = stride; - buf->size = (size_t)size; - } - } - return CheckDecBuffer(buffer); -} - -VP8StatusCode WebPAllocateDecBuffer(int w, int h, - const WebPDecoderOptions* const options, - WebPDecBuffer* const out) { - if (out == NULL || w <= 0 || h <= 0) { - return VP8_STATUS_INVALID_PARAM; - } - if (options != NULL) { // First, apply options if there is any. - if (options->use_cropping) { - const int cw = options->crop_width; - const int ch = options->crop_height; - const int x = options->crop_left & ~1; - const int y = options->crop_top & ~1; - if (x < 0 || y < 0 || cw <= 0 || ch <= 0 || x + cw > w || y + ch > h) { - return VP8_STATUS_INVALID_PARAM; // out of frame boundary. - } - w = cw; - h = ch; - } - if (options->use_scaling) { - if (options->scaled_width <= 0 || options->scaled_height <= 0) { - return VP8_STATUS_INVALID_PARAM; - } - w = options->scaled_width; - h = options->scaled_height; - } - } - out->width = w; - out->height = h; - - // Then, allocate buffer for real - return AllocateBuffer(out); -} - -//------------------------------------------------------------------------------ -// constructors / destructors - -int WebPInitDecBufferInternal(WebPDecBuffer* buffer, int version) { - if (WEBP_ABI_IS_INCOMPATIBLE(version, WEBP_DECODER_ABI_VERSION)) { - return 0; // version mismatch - } - if (buffer == NULL) return 0; - memset(buffer, 0, sizeof(*buffer)); - return 1; -} - -void WebPFreeDecBuffer(WebPDecBuffer* buffer) { - if (buffer != NULL) { - if (!buffer->is_external_memory) - free(buffer->private_memory); - buffer->private_memory = NULL; - } -} - -void WebPCopyDecBuffer(const WebPDecBuffer* const src, - WebPDecBuffer* const dst) { - if (src != NULL && dst != NULL) { - *dst = *src; - if (src->private_memory != NULL) { - dst->is_external_memory = 1; // dst buffer doesn't own the memory. - dst->private_memory = NULL; - } - } -} - -// Copy and transfer ownership from src to dst (beware of parameter order!) -void WebPGrabDecBuffer(WebPDecBuffer* const src, WebPDecBuffer* const dst) { - if (src != NULL && dst != NULL) { - *dst = *src; - if (src->private_memory != NULL) { - src->is_external_memory = 1; // src relinquishes ownership - src->private_memory = NULL; - } - } -} - -//------------------------------------------------------------------------------ - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif diff --git a/external/libwebp/dec/decode_vp8.h b/external/libwebp/dec/decode_vp8.h deleted file mode 100644 index 12c77bcbf6..0000000000 --- a/external/libwebp/dec/decode_vp8.h +++ /dev/null @@ -1,182 +0,0 @@ -// Copyright 2010 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Low-level API for VP8 decoder -// -// Author: Skal (pascal.massimino@gmail.com) - -#ifndef WEBP_WEBP_DECODE_VP8_H_ -#define WEBP_WEBP_DECODE_VP8_H_ - -#include "../webp/decode.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -//------------------------------------------------------------------------------ -// Lower-level API -// -// These functions provide fine-grained control of the decoding process. -// The call flow should resemble: -// -// VP8Io io; -// VP8InitIo(&io); -// io.data = data; -// io.data_size = size; -// /* customize io's functions (setup()/put()/teardown()) if needed. */ -// -// VP8Decoder* dec = VP8New(); -// bool ok = VP8Decode(dec); -// if (!ok) printf("Error: %s\n", VP8StatusMessage(dec)); -// VP8Delete(dec); -// return ok; - -// Input / Output -typedef struct VP8Io VP8Io; -typedef int (*VP8IoPutHook)(const VP8Io* io); -typedef int (*VP8IoSetupHook)(VP8Io* io); -typedef void (*VP8IoTeardownHook)(const VP8Io* io); - -struct VP8Io { - // set by VP8GetHeaders() - int width, height; // picture dimensions, in pixels (invariable). - // These are the original, uncropped dimensions. - // The actual area passed to put() is stored - // in mb_w / mb_h fields. - - // set before calling put() - int mb_y; // position of the current rows (in pixels) - int mb_w; // number of columns in the sample - int mb_h; // number of rows in the sample - const uint8_t* y, *u, *v; // rows to copy (in yuv420 format) - int y_stride; // row stride for luma - int uv_stride; // row stride for chroma - - void* opaque; // user data - - // called when fresh samples are available. Currently, samples are in - // YUV420 format, and can be up to width x 24 in size (depending on the - // in-loop filtering level, e.g.). Should return false in case of error - // or abort request. The actual size of the area to update is mb_w x mb_h - // in size, taking cropping into account. - VP8IoPutHook put; - - // called just before starting to decode the blocks. - // Must return false in case of setup error, true otherwise. If false is - // returned, teardown() will NOT be called. But if the setup succeeded - // and true is returned, then teardown() will always be called afterward. - VP8IoSetupHook setup; - - // Called just after block decoding is finished (or when an error occurred - // during put()). Is NOT called if setup() failed. - VP8IoTeardownHook teardown; - - // this is a recommendation for the user-side yuv->rgb converter. This flag - // is set when calling setup() hook and can be overwritten by it. It then - // can be taken into consideration during the put() method. - int fancy_upsampling; - - // Input buffer. - size_t data_size; - const uint8_t* data; - - // If true, in-loop filtering will not be performed even if present in the - // bitstream. Switching off filtering may speed up decoding at the expense - // of more visible blocking. Note that output will also be non-compliant - // with the VP8 specifications. - int bypass_filtering; - - // Cropping parameters. - int use_cropping; - int crop_left, crop_right, crop_top, crop_bottom; - - // Scaling parameters. - int use_scaling; - int scaled_width, scaled_height; - - // If non NULL, pointer to the alpha data (if present) corresponding to the - // start of the current row (That is: it is pre-offset by mb_y and takes - // cropping into account). - const uint8_t* a; -}; - -// Internal, version-checked, entry point -int VP8InitIoInternal(VP8Io* const, int); - -// Set the custom IO function pointers and user-data. The setter for IO hooks -// should be called before initiating incremental decoding. Returns true if -// WebPIDecoder object is successfully modified, false otherwise. -int WebPISetIOHooks(WebPIDecoder* const idec, - VP8IoPutHook put, - VP8IoSetupHook setup, - VP8IoTeardownHook teardown, - void* user_data); - -// Main decoding object. This is an opaque structure. -typedef struct VP8Decoder VP8Decoder; - -// Create a new decoder object. -VP8Decoder* VP8New(void); - -// Must be called to make sure 'io' is initialized properly. -// Returns false in case of version mismatch. Upon such failure, no other -// decoding function should be called (VP8Decode, VP8GetHeaders, ...) -static WEBP_INLINE int VP8InitIo(VP8Io* const io) { - return VP8InitIoInternal(io, WEBP_DECODER_ABI_VERSION); -} - -// Start decoding a new picture. Returns true if ok. -int VP8GetHeaders(VP8Decoder* const dec, VP8Io* const io); - -// Decode a picture. Will call VP8GetHeaders() if it wasn't done already. -// Returns false in case of error. -int VP8Decode(VP8Decoder* const dec, VP8Io* const io); - -// Return current status of the decoder: -VP8StatusCode VP8Status(VP8Decoder* const dec); - -// return readable string corresponding to the last status. -const char* VP8StatusMessage(VP8Decoder* const dec); - -// Resets the decoder in its initial state, reclaiming memory. -// Not a mandatory call between calls to VP8Decode(). -void VP8Clear(VP8Decoder* const dec); - -// Destroy the decoder object. -void VP8Delete(VP8Decoder* const dec); - -//------------------------------------------------------------------------------ -// Miscellaneous VP8/VP8L bitstream probing functions. - -// Returns true if the next 3 bytes in data contain the VP8 signature. -WEBP_EXTERN(int) VP8CheckSignature(const uint8_t* const data, size_t data_size); - -// Validates the VP8 data-header and retrieves basic header information viz -// width and height. Returns 0 in case of formatting error. *width/*height -// can be passed NULL. -WEBP_EXTERN(int) VP8GetInfo( - const uint8_t* data, - size_t data_size, // data available so far - size_t chunk_size, // total data size expected in the chunk - int* const width, int* const height); - -// Returns true if the next byte(s) in data is a VP8L signature. -WEBP_EXTERN(int) VP8LCheckSignature(const uint8_t* const data, size_t size); - -// Validates the VP8L data-header and retrieves basic header information viz -// width, height and alpha. Returns 0 in case of formatting error. -// width/height/has_alpha can be passed NULL. -WEBP_EXTERN(int) VP8LGetInfo( - const uint8_t* data, size_t data_size, // data available so far - int* const width, int* const height, int* const has_alpha); - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif - -#endif /* WEBP_WEBP_DECODE_VP8_H_ */ diff --git a/external/libwebp/dec/frame.c b/external/libwebp/dec/frame.c deleted file mode 100644 index 9c91a48e17..0000000000 --- a/external/libwebp/dec/frame.c +++ /dev/null @@ -1,679 +0,0 @@ -// Copyright 2010 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Frame-reconstruction function. Memory allocation. -// -// Author: Skal (pascal.massimino@gmail.com) - -#include <stdlib.h> -#include "./vp8i.h" -#include "../utils/utils.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -#define ALIGN_MASK (32 - 1) - -//------------------------------------------------------------------------------ -// Filtering - -// kFilterExtraRows[] = How many extra lines are needed on the MB boundary -// for caching, given a filtering level. -// Simple filter: up to 2 luma samples are read and 1 is written. -// Complex filter: up to 4 luma samples are read and 3 are written. Same for -// U/V, so it's 8 samples total (because of the 2x upsampling). -static const uint8_t kFilterExtraRows[3] = { 0, 2, 8 }; - -static WEBP_INLINE int hev_thresh_from_level(int level, int keyframe) { - if (keyframe) { - return (level >= 40) ? 2 : (level >= 15) ? 1 : 0; - } else { - return (level >= 40) ? 3 : (level >= 20) ? 2 : (level >= 15) ? 1 : 0; - } -} - -static void DoFilter(const VP8Decoder* const dec, int mb_x, int mb_y) { - const VP8ThreadContext* const ctx = &dec->thread_ctx_; - const int y_bps = dec->cache_y_stride_; - VP8FInfo* const f_info = ctx->f_info_ + mb_x; - uint8_t* const y_dst = dec->cache_y_ + ctx->id_ * 16 * y_bps + mb_x * 16; - const int level = f_info->f_level_; - const int ilevel = f_info->f_ilevel_; - const int limit = 2 * level + ilevel; - if (level == 0) { - return; - } - if (dec->filter_type_ == 1) { // simple - if (mb_x > 0) { - VP8SimpleHFilter16(y_dst, y_bps, limit + 4); - } - if (f_info->f_inner_) { - VP8SimpleHFilter16i(y_dst, y_bps, limit); - } - if (mb_y > 0) { - VP8SimpleVFilter16(y_dst, y_bps, limit + 4); - } - if (f_info->f_inner_) { - VP8SimpleVFilter16i(y_dst, y_bps, limit); - } - } else { // complex - const int uv_bps = dec->cache_uv_stride_; - uint8_t* const u_dst = dec->cache_u_ + ctx->id_ * 8 * uv_bps + mb_x * 8; - uint8_t* const v_dst = dec->cache_v_ + ctx->id_ * 8 * uv_bps + mb_x * 8; - const int hev_thresh = - hev_thresh_from_level(level, dec->frm_hdr_.key_frame_); - if (mb_x > 0) { - VP8HFilter16(y_dst, y_bps, limit + 4, ilevel, hev_thresh); - VP8HFilter8(u_dst, v_dst, uv_bps, limit + 4, ilevel, hev_thresh); - } - if (f_info->f_inner_) { - VP8HFilter16i(y_dst, y_bps, limit, ilevel, hev_thresh); - VP8HFilter8i(u_dst, v_dst, uv_bps, limit, ilevel, hev_thresh); - } - if (mb_y > 0) { - VP8VFilter16(y_dst, y_bps, limit + 4, ilevel, hev_thresh); - VP8VFilter8(u_dst, v_dst, uv_bps, limit + 4, ilevel, hev_thresh); - } - if (f_info->f_inner_) { - VP8VFilter16i(y_dst, y_bps, limit, ilevel, hev_thresh); - VP8VFilter8i(u_dst, v_dst, uv_bps, limit, ilevel, hev_thresh); - } - } -} - -// Filter the decoded macroblock row (if needed) -static void FilterRow(const VP8Decoder* const dec) { - int mb_x; - const int mb_y = dec->thread_ctx_.mb_y_; - assert(dec->thread_ctx_.filter_row_); - for (mb_x = dec->tl_mb_x_; mb_x < dec->br_mb_x_; ++mb_x) { - DoFilter(dec, mb_x, mb_y); - } -} - -//------------------------------------------------------------------------------ - -void VP8StoreBlock(VP8Decoder* const dec) { - if (dec->filter_type_ > 0) { - VP8FInfo* const info = dec->f_info_ + dec->mb_x_; - const int skip = dec->mb_info_[dec->mb_x_].skip_; - int level = dec->filter_levels_[dec->segment_]; - if (dec->filter_hdr_.use_lf_delta_) { - // TODO(skal): only CURRENT is handled for now. - level += dec->filter_hdr_.ref_lf_delta_[0]; - if (dec->is_i4x4_) { - level += dec->filter_hdr_.mode_lf_delta_[0]; - } - } - level = (level < 0) ? 0 : (level > 63) ? 63 : level; - info->f_level_ = level; - - if (dec->filter_hdr_.sharpness_ > 0) { - if (dec->filter_hdr_.sharpness_ > 4) { - level >>= 2; - } else { - level >>= 1; - } - if (level > 9 - dec->filter_hdr_.sharpness_) { - level = 9 - dec->filter_hdr_.sharpness_; - } - } - - info->f_ilevel_ = (level < 1) ? 1 : level; - info->f_inner_ = (!skip || dec->is_i4x4_); - } - { - // Transfer samples to row cache - int y; - const int y_offset = dec->cache_id_ * 16 * dec->cache_y_stride_; - const int uv_offset = dec->cache_id_ * 8 * dec->cache_uv_stride_; - uint8_t* const ydst = dec->cache_y_ + dec->mb_x_ * 16 + y_offset; - uint8_t* const udst = dec->cache_u_ + dec->mb_x_ * 8 + uv_offset; - uint8_t* const vdst = dec->cache_v_ + dec->mb_x_ * 8 + uv_offset; - for (y = 0; y < 16; ++y) { - memcpy(ydst + y * dec->cache_y_stride_, - dec->yuv_b_ + Y_OFF + y * BPS, 16); - } - for (y = 0; y < 8; ++y) { - memcpy(udst + y * dec->cache_uv_stride_, - dec->yuv_b_ + U_OFF + y * BPS, 8); - memcpy(vdst + y * dec->cache_uv_stride_, - dec->yuv_b_ + V_OFF + y * BPS, 8); - } - } -} - -//------------------------------------------------------------------------------ -// This function is called after a row of macroblocks is finished decoding. -// It also takes into account the following restrictions: -// * In case of in-loop filtering, we must hold off sending some of the bottom -// pixels as they are yet unfiltered. They will be when the next macroblock -// row is decoded. Meanwhile, we must preserve them by rotating them in the -// cache area. This doesn't hold for the very bottom row of the uncropped -// picture of course. -// * we must clip the remaining pixels against the cropping area. The VP8Io -// struct must have the following fields set correctly before calling put(): - -#define MACROBLOCK_VPOS(mb_y) ((mb_y) * 16) // vertical position of a MB - -// Finalize and transmit a complete row. Return false in case of user-abort. -static int FinishRow(VP8Decoder* const dec, VP8Io* const io) { - int ok = 1; - const VP8ThreadContext* const ctx = &dec->thread_ctx_; - const int extra_y_rows = kFilterExtraRows[dec->filter_type_]; - const int ysize = extra_y_rows * dec->cache_y_stride_; - const int uvsize = (extra_y_rows / 2) * dec->cache_uv_stride_; - const int y_offset = ctx->id_ * 16 * dec->cache_y_stride_; - const int uv_offset = ctx->id_ * 8 * dec->cache_uv_stride_; - uint8_t* const ydst = dec->cache_y_ - ysize + y_offset; - uint8_t* const udst = dec->cache_u_ - uvsize + uv_offset; - uint8_t* const vdst = dec->cache_v_ - uvsize + uv_offset; - const int first_row = (ctx->mb_y_ == 0); - const int last_row = (ctx->mb_y_ >= dec->br_mb_y_ - 1); - int y_start = MACROBLOCK_VPOS(ctx->mb_y_); - int y_end = MACROBLOCK_VPOS(ctx->mb_y_ + 1); - - if (ctx->filter_row_) { - FilterRow(dec); - } - - if (io->put) { - if (!first_row) { - y_start -= extra_y_rows; - io->y = ydst; - io->u = udst; - io->v = vdst; - } else { - io->y = dec->cache_y_ + y_offset; - io->u = dec->cache_u_ + uv_offset; - io->v = dec->cache_v_ + uv_offset; - } - - if (!last_row) { - y_end -= extra_y_rows; - } - if (y_end > io->crop_bottom) { - y_end = io->crop_bottom; // make sure we don't overflow on last row. - } - io->a = NULL; - if (dec->alpha_data_ != NULL && y_start < y_end) { - // TODO(skal): several things to correct here: - // * testing presence of alpha with dec->alpha_data_ is not a good idea - // * we're actually decompressing the full plane only once. It should be - // more obvious from signature. - // * we could free alpha_data_ right after this call, but we don't own. - io->a = VP8DecompressAlphaRows(dec, y_start, y_end - y_start); - if (io->a == NULL) { - return VP8SetError(dec, VP8_STATUS_BITSTREAM_ERROR, - "Could not decode alpha data."); - } - } - if (y_start < io->crop_top) { - const int delta_y = io->crop_top - y_start; - y_start = io->crop_top; - assert(!(delta_y & 1)); - io->y += dec->cache_y_stride_ * delta_y; - io->u += dec->cache_uv_stride_ * (delta_y >> 1); - io->v += dec->cache_uv_stride_ * (delta_y >> 1); - if (io->a != NULL) { - io->a += io->width * delta_y; - } - } - if (y_start < y_end) { - io->y += io->crop_left; - io->u += io->crop_left >> 1; - io->v += io->crop_left >> 1; - if (io->a != NULL) { - io->a += io->crop_left; - } - io->mb_y = y_start - io->crop_top; - io->mb_w = io->crop_right - io->crop_left; - io->mb_h = y_end - y_start; - ok = io->put(io); - } - } - // rotate top samples if needed - if (ctx->id_ + 1 == dec->num_caches_) { - if (!last_row) { - memcpy(dec->cache_y_ - ysize, ydst + 16 * dec->cache_y_stride_, ysize); - memcpy(dec->cache_u_ - uvsize, udst + 8 * dec->cache_uv_stride_, uvsize); - memcpy(dec->cache_v_ - uvsize, vdst + 8 * dec->cache_uv_stride_, uvsize); - } - } - - return ok; -} - -#undef MACROBLOCK_VPOS - -//------------------------------------------------------------------------------ - -int VP8ProcessRow(VP8Decoder* const dec, VP8Io* const io) { - int ok = 1; - VP8ThreadContext* const ctx = &dec->thread_ctx_; - if (!dec->use_threads_) { - // ctx->id_ and ctx->f_info_ are already set - ctx->mb_y_ = dec->mb_y_; - ctx->filter_row_ = dec->filter_row_; - ok = FinishRow(dec, io); - } else { - WebPWorker* const worker = &dec->worker_; - // Finish previous job *before* updating context - ok &= WebPWorkerSync(worker); - assert(worker->status_ == OK); - if (ok) { // spawn a new deblocking/output job - ctx->io_ = *io; - ctx->id_ = dec->cache_id_; - ctx->mb_y_ = dec->mb_y_; - ctx->filter_row_ = dec->filter_row_; - if (ctx->filter_row_) { // just swap filter info - VP8FInfo* const tmp = ctx->f_info_; - ctx->f_info_ = dec->f_info_; - dec->f_info_ = tmp; - } - WebPWorkerLaunch(worker); - if (++dec->cache_id_ == dec->num_caches_) { - dec->cache_id_ = 0; - } - } - } - return ok; -} - -//------------------------------------------------------------------------------ -// Finish setting up the decoding parameter once user's setup() is called. - -VP8StatusCode VP8EnterCritical(VP8Decoder* const dec, VP8Io* const io) { - // Call setup() first. This may trigger additional decoding features on 'io'. - // Note: Afterward, we must call teardown() not matter what. - if (io->setup && !io->setup(io)) { - VP8SetError(dec, VP8_STATUS_USER_ABORT, "Frame setup failed"); - return dec->status_; - } - - // Disable filtering per user request - if (io->bypass_filtering) { - dec->filter_type_ = 0; - } - // TODO(skal): filter type / strength / sharpness forcing - - // Define the area where we can skip in-loop filtering, in case of cropping. - // - // 'Simple' filter reads two luma samples outside of the macroblock and - // and filters one. It doesn't filter the chroma samples. Hence, we can - // avoid doing the in-loop filtering before crop_top/crop_left position. - // For the 'Complex' filter, 3 samples are read and up to 3 are filtered. - // Means: there's a dependency chain that goes all the way up to the - // top-left corner of the picture (MB #0). We must filter all the previous - // macroblocks. - // TODO(skal): add an 'approximate_decoding' option, that won't produce - // a 1:1 bit-exactness for complex filtering? - { - const int extra_pixels = kFilterExtraRows[dec->filter_type_]; - if (dec->filter_type_ == 2) { - // For complex filter, we need to preserve the dependency chain. - dec->tl_mb_x_ = 0; - dec->tl_mb_y_ = 0; - } else { - // For simple filter, we can filter only the cropped region. - // We include 'extra_pixels' on the other side of the boundary, since - // vertical or horizontal filtering of the previous macroblock can - // modify some abutting pixels. - dec->tl_mb_x_ = (io->crop_left - extra_pixels) >> 4; - dec->tl_mb_y_ = (io->crop_top - extra_pixels) >> 4; - if (dec->tl_mb_x_ < 0) dec->tl_mb_x_ = 0; - if (dec->tl_mb_y_ < 0) dec->tl_mb_y_ = 0; - } - // We need some 'extra' pixels on the right/bottom. - dec->br_mb_y_ = (io->crop_bottom + 15 + extra_pixels) >> 4; - dec->br_mb_x_ = (io->crop_right + 15 + extra_pixels) >> 4; - if (dec->br_mb_x_ > dec->mb_w_) { - dec->br_mb_x_ = dec->mb_w_; - } - if (dec->br_mb_y_ > dec->mb_h_) { - dec->br_mb_y_ = dec->mb_h_; - } - } - return VP8_STATUS_OK; -} - -int VP8ExitCritical(VP8Decoder* const dec, VP8Io* const io) { - int ok = 1; - if (dec->use_threads_) { - ok = WebPWorkerSync(&dec->worker_); - } - - if (io->teardown) { - io->teardown(io); - } - return ok; -} - -//------------------------------------------------------------------------------ -// For multi-threaded decoding we need to use 3 rows of 16 pixels as delay line. -// -// Reason is: the deblocking filter cannot deblock the bottom horizontal edges -// immediately, and needs to wait for first few rows of the next macroblock to -// be decoded. Hence, deblocking is lagging behind by 4 or 8 pixels (depending -// on strength). -// With two threads, the vertical positions of the rows being decoded are: -// Decode: [ 0..15][16..31][32..47][48..63][64..79][... -// Deblock: [ 0..11][12..27][28..43][44..59][... -// If we use two threads and two caches of 16 pixels, the sequence would be: -// Decode: [ 0..15][16..31][ 0..15!!][16..31][ 0..15][... -// Deblock: [ 0..11][12..27!!][-4..11][12..27][... -// The problem occurs during row [12..15!!] that both the decoding and -// deblocking threads are writing simultaneously. -// With 3 cache lines, one get a safe write pattern: -// Decode: [ 0..15][16..31][32..47][ 0..15][16..31][32..47][0.. -// Deblock: [ 0..11][12..27][28..43][-4..11][12..27][28... -// Note that multi-threaded output _without_ deblocking can make use of two -// cache lines of 16 pixels only, since there's no lagging behind. The decoding -// and output process have non-concurrent writing: -// Decode: [ 0..15][16..31][ 0..15][16..31][... -// io->put: [ 0..15][16..31][ 0..15][... - -#define MT_CACHE_LINES 3 -#define ST_CACHE_LINES 1 // 1 cache row only for single-threaded case - -// Initialize multi/single-thread worker -static int InitThreadContext(VP8Decoder* const dec) { - dec->cache_id_ = 0; - if (dec->use_threads_) { - WebPWorker* const worker = &dec->worker_; - if (!WebPWorkerReset(worker)) { - return VP8SetError(dec, VP8_STATUS_OUT_OF_MEMORY, - "thread initialization failed."); - } - worker->data1 = dec; - worker->data2 = (void*)&dec->thread_ctx_.io_; - worker->hook = (WebPWorkerHook)FinishRow; - dec->num_caches_ = - (dec->filter_type_ > 0) ? MT_CACHE_LINES : MT_CACHE_LINES - 1; - } else { - dec->num_caches_ = ST_CACHE_LINES; - } - return 1; -} - -#undef MT_CACHE_LINES -#undef ST_CACHE_LINES - -//------------------------------------------------------------------------------ -// Memory setup - -static int AllocateMemory(VP8Decoder* const dec) { - const int num_caches = dec->num_caches_; - const int mb_w = dec->mb_w_; - // Note: we use 'size_t' when there's no overflow risk, uint64_t otherwise. - const size_t intra_pred_mode_size = 4 * mb_w * sizeof(uint8_t); - const size_t top_size = (16 + 8 + 8) * mb_w; - const size_t mb_info_size = (mb_w + 1) * sizeof(VP8MB); - const size_t f_info_size = - (dec->filter_type_ > 0) ? - mb_w * (dec->use_threads_ ? 2 : 1) * sizeof(VP8FInfo) - : 0; - const size_t yuv_size = YUV_SIZE * sizeof(*dec->yuv_b_); - const size_t coeffs_size = 384 * sizeof(*dec->coeffs_); - const size_t cache_height = (16 * num_caches - + kFilterExtraRows[dec->filter_type_]) * 3 / 2; - const size_t cache_size = top_size * cache_height; - // alpha_size is the only one that scales as width x height. - const uint64_t alpha_size = (dec->alpha_data_ != NULL) ? - (uint64_t)dec->pic_hdr_.width_ * dec->pic_hdr_.height_ : 0ULL; - const uint64_t needed = (uint64_t)intra_pred_mode_size - + top_size + mb_info_size + f_info_size - + yuv_size + coeffs_size - + cache_size + alpha_size + ALIGN_MASK; - uint8_t* mem; - - if (needed != (size_t)needed) return 0; // check for overflow - if (needed > dec->mem_size_) { - free(dec->mem_); - dec->mem_size_ = 0; - dec->mem_ = WebPSafeMalloc(needed, sizeof(uint8_t)); - if (dec->mem_ == NULL) { - return VP8SetError(dec, VP8_STATUS_OUT_OF_MEMORY, - "no memory during frame initialization."); - } - // down-cast is ok, thanks to WebPSafeAlloc() above. - dec->mem_size_ = (size_t)needed; - } - - mem = (uint8_t*)dec->mem_; - dec->intra_t_ = (uint8_t*)mem; - mem += intra_pred_mode_size; - - dec->y_t_ = (uint8_t*)mem; - mem += 16 * mb_w; - dec->u_t_ = (uint8_t*)mem; - mem += 8 * mb_w; - dec->v_t_ = (uint8_t*)mem; - mem += 8 * mb_w; - - dec->mb_info_ = ((VP8MB*)mem) + 1; - mem += mb_info_size; - - dec->f_info_ = f_info_size ? (VP8FInfo*)mem : NULL; - mem += f_info_size; - dec->thread_ctx_.id_ = 0; - dec->thread_ctx_.f_info_ = dec->f_info_; - if (dec->use_threads_) { - // secondary cache line. The deblocking process need to make use of the - // filtering strength from previous macroblock row, while the new ones - // are being decoded in parallel. We'll just swap the pointers. - dec->thread_ctx_.f_info_ += mb_w; - } - - mem = (uint8_t*)((uintptr_t)(mem + ALIGN_MASK) & ~ALIGN_MASK); - assert((yuv_size & ALIGN_MASK) == 0); - dec->yuv_b_ = (uint8_t*)mem; - mem += yuv_size; - - dec->coeffs_ = (int16_t*)mem; - mem += coeffs_size; - - dec->cache_y_stride_ = 16 * mb_w; - dec->cache_uv_stride_ = 8 * mb_w; - { - const int extra_rows = kFilterExtraRows[dec->filter_type_]; - const int extra_y = extra_rows * dec->cache_y_stride_; - const int extra_uv = (extra_rows / 2) * dec->cache_uv_stride_; - dec->cache_y_ = ((uint8_t*)mem) + extra_y; - dec->cache_u_ = dec->cache_y_ - + 16 * num_caches * dec->cache_y_stride_ + extra_uv; - dec->cache_v_ = dec->cache_u_ - + 8 * num_caches * dec->cache_uv_stride_ + extra_uv; - dec->cache_id_ = 0; - } - mem += cache_size; - - // alpha plane - dec->alpha_plane_ = alpha_size ? (uint8_t*)mem : NULL; - mem += alpha_size; - - // note: left-info is initialized once for all. - memset(dec->mb_info_ - 1, 0, mb_info_size); - - // initialize top - memset(dec->intra_t_, B_DC_PRED, intra_pred_mode_size); - - return 1; -} - -static void InitIo(VP8Decoder* const dec, VP8Io* io) { - // prepare 'io' - io->mb_y = 0; - io->y = dec->cache_y_; - io->u = dec->cache_u_; - io->v = dec->cache_v_; - io->y_stride = dec->cache_y_stride_; - io->uv_stride = dec->cache_uv_stride_; - io->a = NULL; -} - -int VP8InitFrame(VP8Decoder* const dec, VP8Io* io) { - if (!InitThreadContext(dec)) return 0; // call first. Sets dec->num_caches_. - if (!AllocateMemory(dec)) return 0; - InitIo(dec, io); - VP8DspInit(); // Init critical function pointers and look-up tables. - return 1; -} - -//------------------------------------------------------------------------------ -// Main reconstruction function. - -static const int kScan[16] = { - 0 + 0 * BPS, 4 + 0 * BPS, 8 + 0 * BPS, 12 + 0 * BPS, - 0 + 4 * BPS, 4 + 4 * BPS, 8 + 4 * BPS, 12 + 4 * BPS, - 0 + 8 * BPS, 4 + 8 * BPS, 8 + 8 * BPS, 12 + 8 * BPS, - 0 + 12 * BPS, 4 + 12 * BPS, 8 + 12 * BPS, 12 + 12 * BPS -}; - -static WEBP_INLINE int CheckMode(VP8Decoder* const dec, int mode) { - if (mode == B_DC_PRED) { - if (dec->mb_x_ == 0) { - return (dec->mb_y_ == 0) ? B_DC_PRED_NOTOPLEFT : B_DC_PRED_NOLEFT; - } else { - return (dec->mb_y_ == 0) ? B_DC_PRED_NOTOP : B_DC_PRED; - } - } - return mode; -} - -static WEBP_INLINE void Copy32b(uint8_t* dst, uint8_t* src) { - *(uint32_t*)dst = *(uint32_t*)src; -} - -void VP8ReconstructBlock(VP8Decoder* const dec) { - uint8_t* const y_dst = dec->yuv_b_ + Y_OFF; - uint8_t* const u_dst = dec->yuv_b_ + U_OFF; - uint8_t* const v_dst = dec->yuv_b_ + V_OFF; - - // Rotate in the left samples from previously decoded block. We move four - // pixels at a time for alignment reason, and because of in-loop filter. - if (dec->mb_x_ > 0) { - int j; - for (j = -1; j < 16; ++j) { - Copy32b(&y_dst[j * BPS - 4], &y_dst[j * BPS + 12]); - } - for (j = -1; j < 8; ++j) { - Copy32b(&u_dst[j * BPS - 4], &u_dst[j * BPS + 4]); - Copy32b(&v_dst[j * BPS - 4], &v_dst[j * BPS + 4]); - } - } else { - int j; - for (j = 0; j < 16; ++j) { - y_dst[j * BPS - 1] = 129; - } - for (j = 0; j < 8; ++j) { - u_dst[j * BPS - 1] = 129; - v_dst[j * BPS - 1] = 129; - } - // Init top-left sample on left column too - if (dec->mb_y_ > 0) { - y_dst[-1 - BPS] = u_dst[-1 - BPS] = v_dst[-1 - BPS] = 129; - } - } - { - // bring top samples into the cache - uint8_t* const top_y = dec->y_t_ + dec->mb_x_ * 16; - uint8_t* const top_u = dec->u_t_ + dec->mb_x_ * 8; - uint8_t* const top_v = dec->v_t_ + dec->mb_x_ * 8; - const int16_t* coeffs = dec->coeffs_; - int n; - - if (dec->mb_y_ > 0) { - memcpy(y_dst - BPS, top_y, 16); - memcpy(u_dst - BPS, top_u, 8); - memcpy(v_dst - BPS, top_v, 8); - } else if (dec->mb_x_ == 0) { - // we only need to do this init once at block (0,0). - // Afterward, it remains valid for the whole topmost row. - memset(y_dst - BPS - 1, 127, 16 + 4 + 1); - memset(u_dst - BPS - 1, 127, 8 + 1); - memset(v_dst - BPS - 1, 127, 8 + 1); - } - - // predict and add residuals - - if (dec->is_i4x4_) { // 4x4 - uint32_t* const top_right = (uint32_t*)(y_dst - BPS + 16); - - if (dec->mb_y_ > 0) { - if (dec->mb_x_ >= dec->mb_w_ - 1) { // on rightmost border - top_right[0] = top_y[15] * 0x01010101u; - } else { - memcpy(top_right, top_y + 16, sizeof(*top_right)); - } - } - // replicate the top-right pixels below - top_right[BPS] = top_right[2 * BPS] = top_right[3 * BPS] = top_right[0]; - - // predict and add residues for all 4x4 blocks in turn. - for (n = 0; n < 16; n++) { - uint8_t* const dst = y_dst + kScan[n]; - VP8PredLuma4[dec->imodes_[n]](dst); - if (dec->non_zero_ac_ & (1 << n)) { - VP8Transform(coeffs + n * 16, dst, 0); - } else if (dec->non_zero_ & (1 << n)) { // only DC is present - VP8TransformDC(coeffs + n * 16, dst); - } - } - } else { // 16x16 - const int pred_func = CheckMode(dec, dec->imodes_[0]); - VP8PredLuma16[pred_func](y_dst); - if (dec->non_zero_) { - for (n = 0; n < 16; n++) { - uint8_t* const dst = y_dst + kScan[n]; - if (dec->non_zero_ac_ & (1 << n)) { - VP8Transform(coeffs + n * 16, dst, 0); - } else if (dec->non_zero_ & (1 << n)) { // only DC is present - VP8TransformDC(coeffs + n * 16, dst); - } - } - } - } - { - // Chroma - const int pred_func = CheckMode(dec, dec->uvmode_); - VP8PredChroma8[pred_func](u_dst); - VP8PredChroma8[pred_func](v_dst); - - if (dec->non_zero_ & 0x0f0000) { // chroma-U - const int16_t* const u_coeffs = dec->coeffs_ + 16 * 16; - if (dec->non_zero_ac_ & 0x0f0000) { - VP8TransformUV(u_coeffs, u_dst); - } else { - VP8TransformDCUV(u_coeffs, u_dst); - } - } - if (dec->non_zero_ & 0xf00000) { // chroma-V - const int16_t* const v_coeffs = dec->coeffs_ + 20 * 16; - if (dec->non_zero_ac_ & 0xf00000) { - VP8TransformUV(v_coeffs, v_dst); - } else { - VP8TransformDCUV(v_coeffs, v_dst); - } - } - - // stash away top samples for next block - if (dec->mb_y_ < dec->mb_h_ - 1) { - memcpy(top_y, y_dst + 15 * BPS, 16); - memcpy(top_u, u_dst + 7 * BPS, 8); - memcpy(top_v, v_dst + 7 * BPS, 8); - } - } - } -} - -//------------------------------------------------------------------------------ - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif diff --git a/external/libwebp/dec/idec.c b/external/libwebp/dec/idec.c deleted file mode 100644 index 7df790ced8..0000000000 --- a/external/libwebp/dec/idec.c +++ /dev/null @@ -1,785 +0,0 @@ -// Copyright 2011 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Incremental decoding -// -// Author: somnath@google.com (Somnath Banerjee) - -#include <assert.h> -#include <string.h> -#include <stdlib.h> - -#include "./webpi.h" -#include "./vp8i.h" -#include "../utils/utils.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -// In append mode, buffer allocations increase as multiples of this value. -// Needs to be a power of 2. -#define CHUNK_SIZE 4096 -#define MAX_MB_SIZE 4096 - -//------------------------------------------------------------------------------ -// Data structures for memory and states - -// Decoding states. State normally flows like HEADER->PARTS0->DATA->DONE. -// If there is any error the decoder goes into state ERROR. -typedef enum { - STATE_PRE_VP8, // All data before that of the first VP8 chunk. - STATE_VP8_FRAME_HEADER, // For VP8 Frame header (within VP8 chunk). - STATE_VP8_PARTS0, - STATE_VP8_DATA, - STATE_VP8L_HEADER, - STATE_VP8L_DATA, - STATE_DONE, - STATE_ERROR -} DecState; - -// Operating state for the MemBuffer -typedef enum { - MEM_MODE_NONE = 0, - MEM_MODE_APPEND, - MEM_MODE_MAP -} MemBufferMode; - -// storage for partition #0 and partial data (in a rolling fashion) -typedef struct { - MemBufferMode mode_; // Operation mode - size_t start_; // start location of the data to be decoded - size_t end_; // end location - size_t buf_size_; // size of the allocated buffer - uint8_t* buf_; // We don't own this buffer in case WebPIUpdate() - - size_t part0_size_; // size of partition #0 - const uint8_t* part0_buf_; // buffer to store partition #0 -} MemBuffer; - -struct WebPIDecoder { - DecState state_; // current decoding state - WebPDecParams params_; // Params to store output info - int is_lossless_; // for down-casting 'dec_'. - void* dec_; // either a VP8Decoder or a VP8LDecoder instance - VP8Io io_; - - MemBuffer mem_; // input memory buffer. - WebPDecBuffer output_; // output buffer (when no external one is supplied) - size_t chunk_size_; // Compressed VP8/VP8L size extracted from Header. -}; - -// MB context to restore in case VP8DecodeMB() fails -typedef struct { - VP8MB left_; - VP8MB info_; - uint8_t intra_t_[4]; - uint8_t intra_l_[4]; - VP8BitReader br_; - VP8BitReader token_br_; -} MBContext; - -//------------------------------------------------------------------------------ -// MemBuffer: incoming data handling - -static void RemapBitReader(VP8BitReader* const br, ptrdiff_t offset) { - if (br->buf_ != NULL) { - br->buf_ += offset; - br->buf_end_ += offset; - } -} - -static WEBP_INLINE size_t MemDataSize(const MemBuffer* mem) { - return (mem->end_ - mem->start_); -} - -static void DoRemap(WebPIDecoder* const idec, ptrdiff_t offset) { - MemBuffer* const mem = &idec->mem_; - const uint8_t* const new_base = mem->buf_ + mem->start_; - // note: for VP8, setting up idec->io_ is only really needed at the beginning - // of the decoding, till partition #0 is complete. - idec->io_.data = new_base; - idec->io_.data_size = MemDataSize(mem); - - if (idec->dec_ != NULL) { - if (!idec->is_lossless_) { - VP8Decoder* const dec = (VP8Decoder*)idec->dec_; - const int last_part = dec->num_parts_ - 1; - if (offset != 0) { - int p; - for (p = 0; p <= last_part; ++p) { - RemapBitReader(dec->parts_ + p, offset); - } - // Remap partition #0 data pointer to new offset, but only in MAP - // mode (in APPEND mode, partition #0 is copied into a fixed memory). - if (mem->mode_ == MEM_MODE_MAP) { - RemapBitReader(&dec->br_, offset); - } - } - assert(last_part >= 0); - dec->parts_[last_part].buf_end_ = mem->buf_ + mem->end_; - } else { // Resize lossless bitreader - VP8LDecoder* const dec = (VP8LDecoder*)idec->dec_; - VP8LBitReaderSetBuffer(&dec->br_, new_base, MemDataSize(mem)); - } - } -} - -// Appends data to the end of MemBuffer->buf_. It expands the allocated memory -// size if required and also updates VP8BitReader's if new memory is allocated. -static int AppendToMemBuffer(WebPIDecoder* const idec, - const uint8_t* const data, size_t data_size) { - MemBuffer* const mem = &idec->mem_; - const uint8_t* const old_base = mem->buf_ + mem->start_; - assert(mem->mode_ == MEM_MODE_APPEND); - if (data_size > MAX_CHUNK_PAYLOAD) { - // security safeguard: trying to allocate more than what the format - // allows for a chunk should be considered a smoke smell. - return 0; - } - - if (mem->end_ + data_size > mem->buf_size_) { // Need some free memory - const size_t current_size = MemDataSize(mem); - const uint64_t new_size = (uint64_t)current_size + data_size; - const uint64_t extra_size = (new_size + CHUNK_SIZE - 1) & ~(CHUNK_SIZE - 1); - uint8_t* const new_buf = - (uint8_t*)WebPSafeMalloc(extra_size, sizeof(*new_buf)); - if (new_buf == NULL) return 0; - memcpy(new_buf, old_base, current_size); - free(mem->buf_); - mem->buf_ = new_buf; - mem->buf_size_ = (size_t)extra_size; - mem->start_ = 0; - mem->end_ = current_size; - } - - memcpy(mem->buf_ + mem->end_, data, data_size); - mem->end_ += data_size; - assert(mem->end_ <= mem->buf_size_); - - DoRemap(idec, mem->buf_ + mem->start_ - old_base); - return 1; -} - -static int RemapMemBuffer(WebPIDecoder* const idec, - const uint8_t* const data, size_t data_size) { - MemBuffer* const mem = &idec->mem_; - const uint8_t* const old_base = mem->buf_ + mem->start_; - assert(mem->mode_ == MEM_MODE_MAP); - - if (data_size < mem->buf_size_) return 0; // can't remap to a shorter buffer! - - mem->buf_ = (uint8_t*)data; - mem->end_ = mem->buf_size_ = data_size; - - DoRemap(idec, mem->buf_ + mem->start_ - old_base); - return 1; -} - -static void InitMemBuffer(MemBuffer* const mem) { - mem->mode_ = MEM_MODE_NONE; - mem->buf_ = NULL; - mem->buf_size_ = 0; - mem->part0_buf_ = NULL; - mem->part0_size_ = 0; -} - -static void ClearMemBuffer(MemBuffer* const mem) { - assert(mem); - if (mem->mode_ == MEM_MODE_APPEND) { - free(mem->buf_); - free((void*)mem->part0_buf_); - } -} - -static int CheckMemBufferMode(MemBuffer* const mem, MemBufferMode expected) { - if (mem->mode_ == MEM_MODE_NONE) { - mem->mode_ = expected; // switch to the expected mode - } else if (mem->mode_ != expected) { - return 0; // we mixed the modes => error - } - assert(mem->mode_ == expected); // mode is ok - return 1; -} - -//------------------------------------------------------------------------------ -// Macroblock-decoding contexts - -static void SaveContext(const VP8Decoder* dec, const VP8BitReader* token_br, - MBContext* const context) { - const VP8BitReader* const br = &dec->br_; - const VP8MB* const left = dec->mb_info_ - 1; - const VP8MB* const info = dec->mb_info_ + dec->mb_x_; - - context->left_ = *left; - context->info_ = *info; - context->br_ = *br; - context->token_br_ = *token_br; - memcpy(context->intra_t_, dec->intra_t_ + 4 * dec->mb_x_, 4); - memcpy(context->intra_l_, dec->intra_l_, 4); -} - -static void RestoreContext(const MBContext* context, VP8Decoder* const dec, - VP8BitReader* const token_br) { - VP8BitReader* const br = &dec->br_; - VP8MB* const left = dec->mb_info_ - 1; - VP8MB* const info = dec->mb_info_ + dec->mb_x_; - - *left = context->left_; - *info = context->info_; - *br = context->br_; - *token_br = context->token_br_; - memcpy(dec->intra_t_ + 4 * dec->mb_x_, context->intra_t_, 4); - memcpy(dec->intra_l_, context->intra_l_, 4); -} - -//------------------------------------------------------------------------------ - -static VP8StatusCode IDecError(WebPIDecoder* const idec, VP8StatusCode error) { - if (idec->state_ == STATE_VP8_DATA) { - VP8Io* const io = &idec->io_; - if (io->teardown) { - io->teardown(io); - } - } - idec->state_ = STATE_ERROR; - return error; -} - -static void ChangeState(WebPIDecoder* const idec, DecState new_state, - size_t consumed_bytes) { - MemBuffer* const mem = &idec->mem_; - idec->state_ = new_state; - mem->start_ += consumed_bytes; - assert(mem->start_ <= mem->end_); - idec->io_.data = mem->buf_ + mem->start_; - idec->io_.data_size = MemDataSize(mem); -} - -// Headers -static VP8StatusCode DecodeWebPHeaders(WebPIDecoder* const idec) { - MemBuffer* const mem = &idec->mem_; - const uint8_t* data = mem->buf_ + mem->start_; - size_t curr_size = MemDataSize(mem); - VP8StatusCode status; - WebPHeaderStructure headers; - - headers.data = data; - headers.data_size = curr_size; - status = WebPParseHeaders(&headers); - if (status == VP8_STATUS_NOT_ENOUGH_DATA) { - return VP8_STATUS_SUSPENDED; // We haven't found a VP8 chunk yet. - } else if (status != VP8_STATUS_OK) { - return IDecError(idec, status); - } - - idec->chunk_size_ = headers.compressed_size; - idec->is_lossless_ = headers.is_lossless; - if (!idec->is_lossless_) { - VP8Decoder* const dec = VP8New(); - if (dec == NULL) { - return VP8_STATUS_OUT_OF_MEMORY; - } - idec->dec_ = dec; -#ifdef WEBP_USE_THREAD - dec->use_threads_ = (idec->params_.options != NULL) && - (idec->params_.options->use_threads > 0); -#else - dec->use_threads_ = 0; -#endif - dec->alpha_data_ = headers.alpha_data; - dec->alpha_data_size_ = headers.alpha_data_size; - ChangeState(idec, STATE_VP8_FRAME_HEADER, headers.offset); - } else { - VP8LDecoder* const dec = VP8LNew(); - if (dec == NULL) { - return VP8_STATUS_OUT_OF_MEMORY; - } - idec->dec_ = dec; - ChangeState(idec, STATE_VP8L_HEADER, headers.offset); - } - return VP8_STATUS_OK; -} - -static VP8StatusCode DecodeVP8FrameHeader(WebPIDecoder* const idec) { - const uint8_t* data = idec->mem_.buf_ + idec->mem_.start_; - const size_t curr_size = MemDataSize(&idec->mem_); - uint32_t bits; - - if (curr_size < VP8_FRAME_HEADER_SIZE) { - // Not enough data bytes to extract VP8 Frame Header. - return VP8_STATUS_SUSPENDED; - } - if (!VP8GetInfo(data, curr_size, idec->chunk_size_, NULL, NULL)) { - return IDecError(idec, VP8_STATUS_BITSTREAM_ERROR); - } - - bits = data[0] | (data[1] << 8) | (data[2] << 16); - idec->mem_.part0_size_ = (bits >> 5) + VP8_FRAME_HEADER_SIZE; - - idec->io_.data = data; - idec->io_.data_size = curr_size; - idec->state_ = STATE_VP8_PARTS0; - return VP8_STATUS_OK; -} - -// Partition #0 -static int CopyParts0Data(WebPIDecoder* const idec) { - VP8Decoder* const dec = (VP8Decoder*)idec->dec_; - VP8BitReader* const br = &dec->br_; - const size_t psize = br->buf_end_ - br->buf_; - MemBuffer* const mem = &idec->mem_; - assert(!idec->is_lossless_); - assert(mem->part0_buf_ == NULL); - assert(psize > 0); - assert(psize <= mem->part0_size_); // Format limit: no need for runtime check - if (mem->mode_ == MEM_MODE_APPEND) { - // We copy and grab ownership of the partition #0 data. - uint8_t* const part0_buf = (uint8_t*)malloc(psize); - if (part0_buf == NULL) { - return 0; - } - memcpy(part0_buf, br->buf_, psize); - mem->part0_buf_ = part0_buf; - br->buf_ = part0_buf; - br->buf_end_ = part0_buf + psize; - } else { - // Else: just keep pointers to the partition #0's data in dec_->br_. - } - mem->start_ += psize; - return 1; -} - -static VP8StatusCode DecodePartition0(WebPIDecoder* const idec) { - VP8Decoder* const dec = (VP8Decoder*)idec->dec_; - VP8Io* const io = &idec->io_; - const WebPDecParams* const params = &idec->params_; - WebPDecBuffer* const output = params->output; - - // Wait till we have enough data for the whole partition #0 - if (MemDataSize(&idec->mem_) < idec->mem_.part0_size_) { - return VP8_STATUS_SUSPENDED; - } - - if (!VP8GetHeaders(dec, io)) { - const VP8StatusCode status = dec->status_; - if (status == VP8_STATUS_SUSPENDED || - status == VP8_STATUS_NOT_ENOUGH_DATA) { - // treating NOT_ENOUGH_DATA as SUSPENDED state - return VP8_STATUS_SUSPENDED; - } - return IDecError(idec, status); - } - - // Allocate/Verify output buffer now - dec->status_ = WebPAllocateDecBuffer(io->width, io->height, params->options, - output); - if (dec->status_ != VP8_STATUS_OK) { - return IDecError(idec, dec->status_); - } - - if (!CopyParts0Data(idec)) { - return IDecError(idec, VP8_STATUS_OUT_OF_MEMORY); - } - - // Finish setting up the decoding parameters. Will call io->setup(). - if (VP8EnterCritical(dec, io) != VP8_STATUS_OK) { - return IDecError(idec, dec->status_); - } - - // Note: past this point, teardown() must always be called - // in case of error. - idec->state_ = STATE_VP8_DATA; - // Allocate memory and prepare everything. - if (!VP8InitFrame(dec, io)) { - return IDecError(idec, dec->status_); - } - return VP8_STATUS_OK; -} - -// Remaining partitions -static VP8StatusCode DecodeRemaining(WebPIDecoder* const idec) { - VP8Decoder* const dec = (VP8Decoder*)idec->dec_; - VP8Io* const io = &idec->io_; - - assert(dec->ready_); - - for (; dec->mb_y_ < dec->mb_h_; ++dec->mb_y_) { - VP8BitReader* token_br = &dec->parts_[dec->mb_y_ & (dec->num_parts_ - 1)]; - if (dec->mb_x_ == 0) { - VP8InitScanline(dec); - } - for (; dec->mb_x_ < dec->mb_w_; dec->mb_x_++) { - MBContext context; - SaveContext(dec, token_br, &context); - - if (!VP8DecodeMB(dec, token_br)) { - RestoreContext(&context, dec, token_br); - // We shouldn't fail when MAX_MB data was available - if (dec->num_parts_ == 1 && MemDataSize(&idec->mem_) > MAX_MB_SIZE) { - return IDecError(idec, VP8_STATUS_BITSTREAM_ERROR); - } - return VP8_STATUS_SUSPENDED; - } - VP8ReconstructBlock(dec); - // Store data and save block's filtering params - VP8StoreBlock(dec); - - // Release buffer only if there is only one partition - if (dec->num_parts_ == 1) { - idec->mem_.start_ = token_br->buf_ - idec->mem_.buf_; - assert(idec->mem_.start_ <= idec->mem_.end_); - } - } - if (!VP8ProcessRow(dec, io)) { - return IDecError(idec, VP8_STATUS_USER_ABORT); - } - dec->mb_x_ = 0; - } - // Synchronize the thread and check for errors. - if (!VP8ExitCritical(dec, io)) { - return IDecError(idec, VP8_STATUS_USER_ABORT); - } - dec->ready_ = 0; - idec->state_ = STATE_DONE; - - return VP8_STATUS_OK; -} - -static int ErrorStatusLossless(WebPIDecoder* const idec, VP8StatusCode status) { - if (status == VP8_STATUS_SUSPENDED || status == VP8_STATUS_NOT_ENOUGH_DATA) { - return VP8_STATUS_SUSPENDED; - } - return IDecError(idec, status); -} - -static VP8StatusCode DecodeVP8LHeader(WebPIDecoder* const idec) { - VP8Io* const io = &idec->io_; - VP8LDecoder* const dec = (VP8LDecoder*)idec->dec_; - const WebPDecParams* const params = &idec->params_; - WebPDecBuffer* const output = params->output; - size_t curr_size = MemDataSize(&idec->mem_); - assert(idec->is_lossless_); - - // Wait until there's enough data for decoding header. - if (curr_size < (idec->chunk_size_ >> 3)) { - return VP8_STATUS_SUSPENDED; - } - if (!VP8LDecodeHeader(dec, io)) { - return ErrorStatusLossless(idec, dec->status_); - } - // Allocate/verify output buffer now. - dec->status_ = WebPAllocateDecBuffer(io->width, io->height, params->options, - output); - if (dec->status_ != VP8_STATUS_OK) { - return IDecError(idec, dec->status_); - } - - idec->state_ = STATE_VP8L_DATA; - return VP8_STATUS_OK; -} - -static VP8StatusCode DecodeVP8LData(WebPIDecoder* const idec) { - VP8LDecoder* const dec = (VP8LDecoder*)idec->dec_; - const size_t curr_size = MemDataSize(&idec->mem_); - assert(idec->is_lossless_); - - // At present Lossless decoder can't decode image incrementally. So wait till - // all the image data is aggregated before image can be decoded. - if (curr_size < idec->chunk_size_) { - return VP8_STATUS_SUSPENDED; - } - - if (!VP8LDecodeImage(dec)) { - return ErrorStatusLossless(idec, dec->status_); - } - - idec->state_ = STATE_DONE; - - return VP8_STATUS_OK; -} - - // Main decoding loop -static VP8StatusCode IDecode(WebPIDecoder* idec) { - VP8StatusCode status = VP8_STATUS_SUSPENDED; - - if (idec->state_ == STATE_PRE_VP8) { - status = DecodeWebPHeaders(idec); - } else { - if (idec->dec_ == NULL) { - return VP8_STATUS_SUSPENDED; // can't continue if we have no decoder. - } - } - if (idec->state_ == STATE_VP8_FRAME_HEADER) { - status = DecodeVP8FrameHeader(idec); - } - if (idec->state_ == STATE_VP8_PARTS0) { - status = DecodePartition0(idec); - } - if (idec->state_ == STATE_VP8_DATA) { - status = DecodeRemaining(idec); - } - if (idec->state_ == STATE_VP8L_HEADER) { - status = DecodeVP8LHeader(idec); - } - if (idec->state_ == STATE_VP8L_DATA) { - status = DecodeVP8LData(idec); - } - return status; -} - -//------------------------------------------------------------------------------ -// Public functions - -WebPIDecoder* WebPINewDecoder(WebPDecBuffer* output_buffer) { - WebPIDecoder* idec = (WebPIDecoder*)calloc(1, sizeof(*idec)); - if (idec == NULL) { - return NULL; - } - - idec->state_ = STATE_PRE_VP8; - idec->chunk_size_ = 0; - - InitMemBuffer(&idec->mem_); - WebPInitDecBuffer(&idec->output_); - VP8InitIo(&idec->io_); - - WebPResetDecParams(&idec->params_); - idec->params_.output = output_buffer ? output_buffer : &idec->output_; - WebPInitCustomIo(&idec->params_, &idec->io_); // Plug the I/O functions. - - return idec; -} - -WebPIDecoder* WebPIDecode(const uint8_t* data, size_t data_size, - WebPDecoderConfig* config) { - WebPIDecoder* idec; - - // Parse the bitstream's features, if requested: - if (data != NULL && data_size > 0 && config != NULL) { - if (WebPGetFeatures(data, data_size, &config->input) != VP8_STATUS_OK) { - return NULL; - } - } - // Create an instance of the incremental decoder - idec = WebPINewDecoder(config ? &config->output : NULL); - if (idec == NULL) { - return NULL; - } - // Finish initialization - if (config != NULL) { - idec->params_.options = &config->options; - } - return idec; -} - -void WebPIDelete(WebPIDecoder* idec) { - if (idec == NULL) return; - if (idec->dec_ != NULL) { - if (!idec->is_lossless_) { - VP8Delete(idec->dec_); - } else { - VP8LDelete(idec->dec_); - } - } - ClearMemBuffer(&idec->mem_); - WebPFreeDecBuffer(&idec->output_); - free(idec); -} - -//------------------------------------------------------------------------------ -// Wrapper toward WebPINewDecoder - -WebPIDecoder* WebPINewRGB(WEBP_CSP_MODE mode, uint8_t* output_buffer, - size_t output_buffer_size, int output_stride) { - WebPIDecoder* idec; - if (mode >= MODE_YUV) return NULL; - idec = WebPINewDecoder(NULL); - if (idec == NULL) return NULL; - idec->output_.colorspace = mode; - idec->output_.is_external_memory = 1; - idec->output_.u.RGBA.rgba = output_buffer; - idec->output_.u.RGBA.stride = output_stride; - idec->output_.u.RGBA.size = output_buffer_size; - return idec; -} - -WebPIDecoder* WebPINewYUVA(uint8_t* luma, size_t luma_size, int luma_stride, - uint8_t* u, size_t u_size, int u_stride, - uint8_t* v, size_t v_size, int v_stride, - uint8_t* a, size_t a_size, int a_stride) { - WebPIDecoder* const idec = WebPINewDecoder(NULL); - if (idec == NULL) return NULL; - idec->output_.colorspace = (a == NULL) ? MODE_YUV : MODE_YUVA; - idec->output_.is_external_memory = 1; - idec->output_.u.YUVA.y = luma; - idec->output_.u.YUVA.y_stride = luma_stride; - idec->output_.u.YUVA.y_size = luma_size; - idec->output_.u.YUVA.u = u; - idec->output_.u.YUVA.u_stride = u_stride; - idec->output_.u.YUVA.u_size = u_size; - idec->output_.u.YUVA.v = v; - idec->output_.u.YUVA.v_stride = v_stride; - idec->output_.u.YUVA.v_size = v_size; - idec->output_.u.YUVA.a = a; - idec->output_.u.YUVA.a_stride = a_stride; - idec->output_.u.YUVA.a_size = a_size; - return idec; -} - -WebPIDecoder* WebPINewYUV(uint8_t* luma, size_t luma_size, int luma_stride, - uint8_t* u, size_t u_size, int u_stride, - uint8_t* v, size_t v_size, int v_stride) { - return WebPINewYUVA(luma, luma_size, luma_stride, - u, u_size, u_stride, - v, v_size, v_stride, - NULL, 0, 0); -} - -//------------------------------------------------------------------------------ - -static VP8StatusCode IDecCheckStatus(const WebPIDecoder* const idec) { - assert(idec); - if (idec->state_ == STATE_ERROR) { - return VP8_STATUS_BITSTREAM_ERROR; - } - if (idec->state_ == STATE_DONE) { - return VP8_STATUS_OK; - } - return VP8_STATUS_SUSPENDED; -} - -VP8StatusCode WebPIAppend(WebPIDecoder* idec, - const uint8_t* data, size_t data_size) { - VP8StatusCode status; - if (idec == NULL || data == NULL) { - return VP8_STATUS_INVALID_PARAM; - } - status = IDecCheckStatus(idec); - if (status != VP8_STATUS_SUSPENDED) { - return status; - } - // Check mixed calls between RemapMemBuffer and AppendToMemBuffer. - if (!CheckMemBufferMode(&idec->mem_, MEM_MODE_APPEND)) { - return VP8_STATUS_INVALID_PARAM; - } - // Append data to memory buffer - if (!AppendToMemBuffer(idec, data, data_size)) { - return VP8_STATUS_OUT_OF_MEMORY; - } - return IDecode(idec); -} - -VP8StatusCode WebPIUpdate(WebPIDecoder* idec, - const uint8_t* data, size_t data_size) { - VP8StatusCode status; - if (idec == NULL || data == NULL) { - return VP8_STATUS_INVALID_PARAM; - } - status = IDecCheckStatus(idec); - if (status != VP8_STATUS_SUSPENDED) { - return status; - } - // Check mixed calls between RemapMemBuffer and AppendToMemBuffer. - if (!CheckMemBufferMode(&idec->mem_, MEM_MODE_MAP)) { - return VP8_STATUS_INVALID_PARAM; - } - // Make the memory buffer point to the new buffer - if (!RemapMemBuffer(idec, data, data_size)) { - return VP8_STATUS_INVALID_PARAM; - } - return IDecode(idec); -} - -//------------------------------------------------------------------------------ - -static const WebPDecBuffer* GetOutputBuffer(const WebPIDecoder* const idec) { - if (idec == NULL || idec->dec_ == NULL) { - return NULL; - } - if (idec->state_ <= STATE_VP8_PARTS0) { - return NULL; - } - return idec->params_.output; -} - -const WebPDecBuffer* WebPIDecodedArea(const WebPIDecoder* idec, - int* left, int* top, - int* width, int* height) { - const WebPDecBuffer* const src = GetOutputBuffer(idec); - if (left != NULL) *left = 0; - if (top != NULL) *top = 0; - // TODO(skal): later include handling of rotations. - if (src) { - if (width != NULL) *width = src->width; - if (height != NULL) *height = idec->params_.last_y; - } else { - if (width != NULL) *width = 0; - if (height != NULL) *height = 0; - } - return src; -} - -uint8_t* WebPIDecGetRGB(const WebPIDecoder* idec, int* last_y, - int* width, int* height, int* stride) { - const WebPDecBuffer* const src = GetOutputBuffer(idec); - if (src == NULL) return NULL; - if (src->colorspace >= MODE_YUV) { - return NULL; - } - - if (last_y != NULL) *last_y = idec->params_.last_y; - if (width != NULL) *width = src->width; - if (height != NULL) *height = src->height; - if (stride != NULL) *stride = src->u.RGBA.stride; - - return src->u.RGBA.rgba; -} - -uint8_t* WebPIDecGetYUVA(const WebPIDecoder* idec, int* last_y, - uint8_t** u, uint8_t** v, uint8_t** a, - int* width, int* height, - int* stride, int* uv_stride, int* a_stride) { - const WebPDecBuffer* const src = GetOutputBuffer(idec); - if (src == NULL) return NULL; - if (src->colorspace < MODE_YUV) { - return NULL; - } - - if (last_y != NULL) *last_y = idec->params_.last_y; - if (u != NULL) *u = src->u.YUVA.u; - if (v != NULL) *v = src->u.YUVA.v; - if (a != NULL) *a = src->u.YUVA.a; - if (width != NULL) *width = src->width; - if (height != NULL) *height = src->height; - if (stride != NULL) *stride = src->u.YUVA.y_stride; - if (uv_stride != NULL) *uv_stride = src->u.YUVA.u_stride; - if (a_stride != NULL) *a_stride = src->u.YUVA.a_stride; - - return src->u.YUVA.y; -} - -int WebPISetIOHooks(WebPIDecoder* const idec, - VP8IoPutHook put, - VP8IoSetupHook setup, - VP8IoTeardownHook teardown, - void* user_data) { - if (idec == NULL || idec->state_ > STATE_PRE_VP8) { - return 0; - } - - idec->io_.put = put; - idec->io_.setup = setup; - idec->io_.teardown = teardown; - idec->io_.opaque = user_data; - - return 1; -} - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif diff --git a/external/libwebp/dec/io.c b/external/libwebp/dec/io.c deleted file mode 100644 index 594804c2e6..0000000000 --- a/external/libwebp/dec/io.c +++ /dev/null @@ -1,633 +0,0 @@ -// Copyright 2011 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// functions for sample output. -// -// Author: Skal (pascal.massimino@gmail.com) - -#include <assert.h> -#include <stdlib.h> -#include "../dec/vp8i.h" -#include "./webpi.h" -#include "../dsp/dsp.h" -#include "../dsp/yuv.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -//------------------------------------------------------------------------------ -// Main YUV<->RGB conversion functions - -static int EmitYUV(const VP8Io* const io, WebPDecParams* const p) { - WebPDecBuffer* output = p->output; - const WebPYUVABuffer* const buf = &output->u.YUVA; - uint8_t* const y_dst = buf->y + io->mb_y * buf->y_stride; - uint8_t* const u_dst = buf->u + (io->mb_y >> 1) * buf->u_stride; - uint8_t* const v_dst = buf->v + (io->mb_y >> 1) * buf->v_stride; - const int mb_w = io->mb_w; - const int mb_h = io->mb_h; - const int uv_w = (mb_w + 1) / 2; - const int uv_h = (mb_h + 1) / 2; - int j; - for (j = 0; j < mb_h; ++j) { - memcpy(y_dst + j * buf->y_stride, io->y + j * io->y_stride, mb_w); - } - for (j = 0; j < uv_h; ++j) { - memcpy(u_dst + j * buf->u_stride, io->u + j * io->uv_stride, uv_w); - memcpy(v_dst + j * buf->v_stride, io->v + j * io->uv_stride, uv_w); - } - return io->mb_h; -} - -// Point-sampling U/V sampler. -static int EmitSampledRGB(const VP8Io* const io, WebPDecParams* const p) { - WebPDecBuffer* output = p->output; - const WebPRGBABuffer* const buf = &output->u.RGBA; - uint8_t* dst = buf->rgba + io->mb_y * buf->stride; - const uint8_t* y_src = io->y; - const uint8_t* u_src = io->u; - const uint8_t* v_src = io->v; - const WebPSampleLinePairFunc sample = WebPSamplers[output->colorspace]; - const int mb_w = io->mb_w; - const int last = io->mb_h - 1; - int j; - for (j = 0; j < last; j += 2) { - sample(y_src, y_src + io->y_stride, u_src, v_src, - dst, dst + buf->stride, mb_w); - y_src += 2 * io->y_stride; - u_src += io->uv_stride; - v_src += io->uv_stride; - dst += 2 * buf->stride; - } - if (j == last) { // Just do the last line twice - sample(y_src, y_src, u_src, v_src, dst, dst, mb_w); - } - return io->mb_h; -} - -//------------------------------------------------------------------------------ -// YUV444 -> RGB conversion - -#if 0 // TODO(skal): this is for future rescaling. -static int EmitRGB(const VP8Io* const io, WebPDecParams* const p) { - WebPDecBuffer* output = p->output; - const WebPRGBABuffer* const buf = &output->u.RGBA; - uint8_t* dst = buf->rgba + io->mb_y * buf->stride; - const uint8_t* y_src = io->y; - const uint8_t* u_src = io->u; - const uint8_t* v_src = io->v; - const WebPYUV444Converter convert = WebPYUV444Converters[output->colorspace]; - const int mb_w = io->mb_w; - const int last = io->mb_h; - int j; - for (j = 0; j < last; ++j) { - convert(y_src, u_src, v_src, dst, mb_w); - y_src += io->y_stride; - u_src += io->uv_stride; - v_src += io->uv_stride; - dst += buf->stride; - } - return io->mb_h; -} -#endif - -//------------------------------------------------------------------------------ -// Fancy upsampling - -#ifdef FANCY_UPSAMPLING -static int EmitFancyRGB(const VP8Io* const io, WebPDecParams* const p) { - int num_lines_out = io->mb_h; // a priori guess - const WebPRGBABuffer* const buf = &p->output->u.RGBA; - uint8_t* dst = buf->rgba + io->mb_y * buf->stride; - WebPUpsampleLinePairFunc upsample = WebPUpsamplers[p->output->colorspace]; - const uint8_t* cur_y = io->y; - const uint8_t* cur_u = io->u; - const uint8_t* cur_v = io->v; - const uint8_t* top_u = p->tmp_u; - const uint8_t* top_v = p->tmp_v; - int y = io->mb_y; - const int y_end = io->mb_y + io->mb_h; - const int mb_w = io->mb_w; - const int uv_w = (mb_w + 1) / 2; - - if (y == 0) { - // First line is special cased. We mirror the u/v samples at boundary. - upsample(NULL, cur_y, cur_u, cur_v, cur_u, cur_v, NULL, dst, mb_w); - } else { - // We can finish the left-over line from previous call. - upsample(p->tmp_y, cur_y, top_u, top_v, cur_u, cur_v, - dst - buf->stride, dst, mb_w); - ++num_lines_out; - } - // Loop over each output pairs of row. - for (; y + 2 < y_end; y += 2) { - top_u = cur_u; - top_v = cur_v; - cur_u += io->uv_stride; - cur_v += io->uv_stride; - dst += 2 * buf->stride; - cur_y += 2 * io->y_stride; - upsample(cur_y - io->y_stride, cur_y, - top_u, top_v, cur_u, cur_v, - dst - buf->stride, dst, mb_w); - } - // move to last row - cur_y += io->y_stride; - if (io->crop_top + y_end < io->crop_bottom) { - // Save the unfinished samples for next call (as we're not done yet). - memcpy(p->tmp_y, cur_y, mb_w * sizeof(*p->tmp_y)); - memcpy(p->tmp_u, cur_u, uv_w * sizeof(*p->tmp_u)); - memcpy(p->tmp_v, cur_v, uv_w * sizeof(*p->tmp_v)); - // The fancy upsampler leaves a row unfinished behind - // (except for the very last row) - num_lines_out--; - } else { - // Process the very last row of even-sized picture - if (!(y_end & 1)) { - upsample(cur_y, NULL, cur_u, cur_v, cur_u, cur_v, - dst + buf->stride, NULL, mb_w); - } - } - return num_lines_out; -} - -#endif /* FANCY_UPSAMPLING */ - -//------------------------------------------------------------------------------ - -static int EmitAlphaYUV(const VP8Io* const io, WebPDecParams* const p) { - const uint8_t* alpha = io->a; - const WebPYUVABuffer* const buf = &p->output->u.YUVA; - const int mb_w = io->mb_w; - const int mb_h = io->mb_h; - uint8_t* dst = buf->a + io->mb_y * buf->a_stride; - int j; - - if (alpha != NULL) { - for (j = 0; j < mb_h; ++j) { - memcpy(dst, alpha, mb_w * sizeof(*dst)); - alpha += io->width; - dst += buf->a_stride; - } - } else if (buf->a != NULL) { - // the user requested alpha, but there is none, set it to opaque. - for (j = 0; j < mb_h; ++j) { - memset(dst, 0xff, mb_w * sizeof(*dst)); - dst += buf->a_stride; - } - } - return 0; -} - -static int GetAlphaSourceRow(const VP8Io* const io, - const uint8_t** alpha, int* const num_rows) { - int start_y = io->mb_y; - *num_rows = io->mb_h; - - // Compensate for the 1-line delay of the fancy upscaler. - // This is similar to EmitFancyRGB(). - if (io->fancy_upsampling) { - if (start_y == 0) { - // We don't process the last row yet. It'll be done during the next call. - --*num_rows; - } else { - --start_y; - // Fortunately, *alpha data is persistent, so we can go back - // one row and finish alpha blending, now that the fancy upscaler - // completed the YUV->RGB interpolation. - *alpha -= io->width; - } - if (io->crop_top + io->mb_y + io->mb_h == io->crop_bottom) { - // If it's the very last call, we process all the remaining rows! - *num_rows = io->crop_bottom - io->crop_top - start_y; - } - } - return start_y; -} - -static int EmitAlphaRGB(const VP8Io* const io, WebPDecParams* const p) { - const uint8_t* alpha = io->a; - if (alpha != NULL) { - const int mb_w = io->mb_w; - const WEBP_CSP_MODE colorspace = p->output->colorspace; - const int alpha_first = - (colorspace == MODE_ARGB || colorspace == MODE_Argb); - const WebPRGBABuffer* const buf = &p->output->u.RGBA; - int num_rows; - const int start_y = GetAlphaSourceRow(io, &alpha, &num_rows); - uint8_t* const base_rgba = buf->rgba + start_y * buf->stride; - uint8_t* dst = base_rgba + (alpha_first ? 0 : 3); - uint32_t alpha_mask = 0xff; - int i, j; - - for (j = 0; j < num_rows; ++j) { - for (i = 0; i < mb_w; ++i) { - const uint32_t alpha_value = alpha[i]; - dst[4 * i] = alpha_value; - alpha_mask &= alpha_value; - } - alpha += io->width; - dst += buf->stride; - } - // alpha_mask is < 0xff if there's non-trivial alpha to premultiply with. - if (alpha_mask != 0xff && WebPIsPremultipliedMode(colorspace)) { - WebPApplyAlphaMultiply(base_rgba, alpha_first, - mb_w, num_rows, buf->stride); - } - } - return 0; -} - -static int EmitAlphaRGBA4444(const VP8Io* const io, WebPDecParams* const p) { - const uint8_t* alpha = io->a; - if (alpha != NULL) { - const int mb_w = io->mb_w; - const WEBP_CSP_MODE colorspace = p->output->colorspace; - const WebPRGBABuffer* const buf = &p->output->u.RGBA; - int num_rows; - const int start_y = GetAlphaSourceRow(io, &alpha, &num_rows); - uint8_t* const base_rgba = buf->rgba + start_y * buf->stride; - uint8_t* alpha_dst = base_rgba + 1; - uint32_t alpha_mask = 0x0f; - int i, j; - - for (j = 0; j < num_rows; ++j) { - for (i = 0; i < mb_w; ++i) { - // Fill in the alpha value (converted to 4 bits). - const uint32_t alpha_value = alpha[i] >> 4; - alpha_dst[2 * i] = (alpha_dst[2 * i] & 0xf0) | alpha_value; - alpha_mask &= alpha_value; - } - alpha += io->width; - alpha_dst += buf->stride; - } - if (alpha_mask != 0x0f && WebPIsPremultipliedMode(colorspace)) { - WebPApplyAlphaMultiply4444(base_rgba, mb_w, num_rows, buf->stride); - } - } - return 0; -} - -//------------------------------------------------------------------------------ -// YUV rescaling (no final RGB conversion needed) - -static int Rescale(const uint8_t* src, int src_stride, - int new_lines, WebPRescaler* const wrk) { - int num_lines_out = 0; - while (new_lines > 0) { // import new contributions of source rows. - const int lines_in = WebPRescalerImport(wrk, new_lines, src, src_stride); - src += lines_in * src_stride; - new_lines -= lines_in; - num_lines_out += WebPRescalerExport(wrk); // emit output row(s) - } - return num_lines_out; -} - -static int EmitRescaledYUV(const VP8Io* const io, WebPDecParams* const p) { - const int mb_h = io->mb_h; - const int uv_mb_h = (mb_h + 1) >> 1; - const int num_lines_out = Rescale(io->y, io->y_stride, mb_h, &p->scaler_y); - Rescale(io->u, io->uv_stride, uv_mb_h, &p->scaler_u); - Rescale(io->v, io->uv_stride, uv_mb_h, &p->scaler_v); - return num_lines_out; -} - -static int EmitRescaledAlphaYUV(const VP8Io* const io, WebPDecParams* const p) { - if (io->a != NULL) { - Rescale(io->a, io->width, io->mb_h, &p->scaler_a); - } - return 0; -} - -static int InitYUVRescaler(const VP8Io* const io, WebPDecParams* const p) { - const int has_alpha = WebPIsAlphaMode(p->output->colorspace); - const WebPYUVABuffer* const buf = &p->output->u.YUVA; - const int out_width = io->scaled_width; - const int out_height = io->scaled_height; - const int uv_out_width = (out_width + 1) >> 1; - const int uv_out_height = (out_height + 1) >> 1; - const int uv_in_width = (io->mb_w + 1) >> 1; - const int uv_in_height = (io->mb_h + 1) >> 1; - const size_t work_size = 2 * out_width; // scratch memory for luma rescaler - const size_t uv_work_size = 2 * uv_out_width; // and for each u/v ones - size_t tmp_size; - int32_t* work; - - tmp_size = work_size + 2 * uv_work_size; - if (has_alpha) { - tmp_size += work_size; - } - p->memory = calloc(1, tmp_size * sizeof(*work)); - if (p->memory == NULL) { - return 0; // memory error - } - work = (int32_t*)p->memory; - WebPRescalerInit(&p->scaler_y, io->mb_w, io->mb_h, - buf->y, out_width, out_height, buf->y_stride, 1, - io->mb_w, out_width, io->mb_h, out_height, - work); - WebPRescalerInit(&p->scaler_u, uv_in_width, uv_in_height, - buf->u, uv_out_width, uv_out_height, buf->u_stride, 1, - uv_in_width, uv_out_width, - uv_in_height, uv_out_height, - work + work_size); - WebPRescalerInit(&p->scaler_v, uv_in_width, uv_in_height, - buf->v, uv_out_width, uv_out_height, buf->v_stride, 1, - uv_in_width, uv_out_width, - uv_in_height, uv_out_height, - work + work_size + uv_work_size); - p->emit = EmitRescaledYUV; - - if (has_alpha) { - WebPRescalerInit(&p->scaler_a, io->mb_w, io->mb_h, - buf->a, out_width, out_height, buf->a_stride, 1, - io->mb_w, out_width, io->mb_h, out_height, - work + work_size + 2 * uv_work_size); - p->emit_alpha = EmitRescaledAlphaYUV; - } - return 1; -} - -//------------------------------------------------------------------------------ -// RGBA rescaling - -static int ExportRGB(WebPDecParams* const p, int y_pos) { - const WebPYUV444Converter convert = - WebPYUV444Converters[p->output->colorspace]; - const WebPRGBABuffer* const buf = &p->output->u.RGBA; - uint8_t* dst = buf->rgba + (p->last_y + y_pos) * buf->stride; - int num_lines_out = 0; - // For RGB rescaling, because of the YUV420, current scan position - // U/V can be +1/-1 line from the Y one. Hence the double test. - while (WebPRescalerHasPendingOutput(&p->scaler_y) && - WebPRescalerHasPendingOutput(&p->scaler_u)) { - assert(p->last_y + y_pos + num_lines_out < p->output->height); - assert(p->scaler_u.y_accum == p->scaler_v.y_accum); - WebPRescalerExportRow(&p->scaler_y); - WebPRescalerExportRow(&p->scaler_u); - WebPRescalerExportRow(&p->scaler_v); - convert(p->scaler_y.dst, p->scaler_u.dst, p->scaler_v.dst, - dst, p->scaler_y.dst_width); - dst += buf->stride; - ++num_lines_out; - } - return num_lines_out; -} - -static int EmitRescaledRGB(const VP8Io* const io, WebPDecParams* const p) { - const int mb_h = io->mb_h; - const int uv_mb_h = (mb_h + 1) >> 1; - int j = 0, uv_j = 0; - int num_lines_out = 0; - while (j < mb_h) { - const int y_lines_in = - WebPRescalerImport(&p->scaler_y, mb_h - j, - io->y + j * io->y_stride, io->y_stride); - const int u_lines_in = - WebPRescalerImport(&p->scaler_u, uv_mb_h - uv_j, - io->u + uv_j * io->uv_stride, io->uv_stride); - const int v_lines_in = - WebPRescalerImport(&p->scaler_v, uv_mb_h - uv_j, - io->v + uv_j * io->uv_stride, io->uv_stride); - (void)v_lines_in; // remove a gcc warning - assert(u_lines_in == v_lines_in); - j += y_lines_in; - uv_j += u_lines_in; - num_lines_out += ExportRGB(p, num_lines_out); - } - return num_lines_out; -} - -static int ExportAlpha(WebPDecParams* const p, int y_pos) { - const WebPRGBABuffer* const buf = &p->output->u.RGBA; - uint8_t* const base_rgba = buf->rgba + (p->last_y + y_pos) * buf->stride; - const WEBP_CSP_MODE colorspace = p->output->colorspace; - const int alpha_first = - (colorspace == MODE_ARGB || colorspace == MODE_Argb); - uint8_t* dst = base_rgba + (alpha_first ? 0 : 3); - int num_lines_out = 0; - const int is_premult_alpha = WebPIsPremultipliedMode(colorspace); - uint32_t alpha_mask = 0xff; - const int width = p->scaler_a.dst_width; - - while (WebPRescalerHasPendingOutput(&p->scaler_a)) { - int i; - assert(p->last_y + y_pos + num_lines_out < p->output->height); - WebPRescalerExportRow(&p->scaler_a); - for (i = 0; i < width; ++i) { - const uint32_t alpha_value = p->scaler_a.dst[i]; - dst[4 * i] = alpha_value; - alpha_mask &= alpha_value; - } - dst += buf->stride; - ++num_lines_out; - } - if (is_premult_alpha && alpha_mask != 0xff) { - WebPApplyAlphaMultiply(base_rgba, alpha_first, - width, num_lines_out, buf->stride); - } - return num_lines_out; -} - -static int ExportAlphaRGBA4444(WebPDecParams* const p, int y_pos) { - const WebPRGBABuffer* const buf = &p->output->u.RGBA; - uint8_t* const base_rgba = buf->rgba + (p->last_y + y_pos) * buf->stride; - uint8_t* alpha_dst = base_rgba + 1; - int num_lines_out = 0; - const WEBP_CSP_MODE colorspace = p->output->colorspace; - const int width = p->scaler_a.dst_width; - const int is_premult_alpha = WebPIsPremultipliedMode(colorspace); - uint32_t alpha_mask = 0x0f; - - while (WebPRescalerHasPendingOutput(&p->scaler_a)) { - int i; - assert(p->last_y + y_pos + num_lines_out < p->output->height); - WebPRescalerExportRow(&p->scaler_a); - for (i = 0; i < width; ++i) { - // Fill in the alpha value (converted to 4 bits). - const uint32_t alpha_value = p->scaler_a.dst[i] >> 4; - alpha_dst[2 * i] = (alpha_dst[2 * i] & 0xf0) | alpha_value; - alpha_mask &= alpha_value; - } - alpha_dst += buf->stride; - ++num_lines_out; - } - if (is_premult_alpha && alpha_mask != 0x0f) { - WebPApplyAlphaMultiply4444(base_rgba, width, num_lines_out, buf->stride); - } - return num_lines_out; -} - -static int EmitRescaledAlphaRGB(const VP8Io* const io, WebPDecParams* const p) { - if (io->a != NULL) { - WebPRescaler* const scaler = &p->scaler_a; - int j = 0; - int pos = 0; - while (j < io->mb_h) { - j += WebPRescalerImport(scaler, io->mb_h - j, - io->a + j * io->width, io->width); - pos += p->emit_alpha_row(p, pos); - } - } - return 0; -} - -static int InitRGBRescaler(const VP8Io* const io, WebPDecParams* const p) { - const int has_alpha = WebPIsAlphaMode(p->output->colorspace); - const int out_width = io->scaled_width; - const int out_height = io->scaled_height; - const int uv_in_width = (io->mb_w + 1) >> 1; - const int uv_in_height = (io->mb_h + 1) >> 1; - const size_t work_size = 2 * out_width; // scratch memory for one rescaler - int32_t* work; // rescalers work area - uint8_t* tmp; // tmp storage for scaled YUV444 samples before RGB conversion - size_t tmp_size1, tmp_size2; - - tmp_size1 = 3 * work_size; - tmp_size2 = 3 * out_width; - if (has_alpha) { - tmp_size1 += work_size; - tmp_size2 += out_width; - } - p->memory = calloc(1, tmp_size1 * sizeof(*work) + tmp_size2 * sizeof(*tmp)); - if (p->memory == NULL) { - return 0; // memory error - } - work = (int32_t*)p->memory; - tmp = (uint8_t*)(work + tmp_size1); - WebPRescalerInit(&p->scaler_y, io->mb_w, io->mb_h, - tmp + 0 * out_width, out_width, out_height, 0, 1, - io->mb_w, out_width, io->mb_h, out_height, - work + 0 * work_size); - WebPRescalerInit(&p->scaler_u, uv_in_width, uv_in_height, - tmp + 1 * out_width, out_width, out_height, 0, 1, - io->mb_w, 2 * out_width, io->mb_h, 2 * out_height, - work + 1 * work_size); - WebPRescalerInit(&p->scaler_v, uv_in_width, uv_in_height, - tmp + 2 * out_width, out_width, out_height, 0, 1, - io->mb_w, 2 * out_width, io->mb_h, 2 * out_height, - work + 2 * work_size); - p->emit = EmitRescaledRGB; - - if (has_alpha) { - WebPRescalerInit(&p->scaler_a, io->mb_w, io->mb_h, - tmp + 3 * out_width, out_width, out_height, 0, 1, - io->mb_w, out_width, io->mb_h, out_height, - work + 3 * work_size); - p->emit_alpha = EmitRescaledAlphaRGB; - if (p->output->colorspace == MODE_RGBA_4444 || - p->output->colorspace == MODE_rgbA_4444) { - p->emit_alpha_row = ExportAlphaRGBA4444; - } else { - p->emit_alpha_row = ExportAlpha; - } - } - return 1; -} - -//------------------------------------------------------------------------------ -// Default custom functions - -static int CustomSetup(VP8Io* io) { - WebPDecParams* const p = (WebPDecParams*)io->opaque; - const WEBP_CSP_MODE colorspace = p->output->colorspace; - const int is_rgb = WebPIsRGBMode(colorspace); - const int is_alpha = WebPIsAlphaMode(colorspace); - - p->memory = NULL; - p->emit = NULL; - p->emit_alpha = NULL; - p->emit_alpha_row = NULL; - if (!WebPIoInitFromOptions(p->options, io, is_alpha ? MODE_YUV : MODE_YUVA)) { - return 0; - } - - if (io->use_scaling) { - const int ok = is_rgb ? InitRGBRescaler(io, p) : InitYUVRescaler(io, p); - if (!ok) { - return 0; // memory error - } - } else { - if (is_rgb) { - p->emit = EmitSampledRGB; // default -#ifdef FANCY_UPSAMPLING - if (io->fancy_upsampling) { - const int uv_width = (io->mb_w + 1) >> 1; - p->memory = malloc(io->mb_w + 2 * uv_width); - if (p->memory == NULL) { - return 0; // memory error. - } - p->tmp_y = (uint8_t*)p->memory; - p->tmp_u = p->tmp_y + io->mb_w; - p->tmp_v = p->tmp_u + uv_width; - p->emit = EmitFancyRGB; - WebPInitUpsamplers(); - } -#endif - } else { - p->emit = EmitYUV; - } - if (is_alpha) { // need transparency output - if (WebPIsPremultipliedMode(colorspace)) WebPInitPremultiply(); - p->emit_alpha = - (colorspace == MODE_RGBA_4444 || colorspace == MODE_rgbA_4444) ? - EmitAlphaRGBA4444 - : is_rgb ? EmitAlphaRGB - : EmitAlphaYUV; - } - } - - if (is_rgb) { - VP8YUVInit(); - } - return 1; -} - -//------------------------------------------------------------------------------ - -static int CustomPut(const VP8Io* io) { - WebPDecParams* const p = (WebPDecParams*)io->opaque; - const int mb_w = io->mb_w; - const int mb_h = io->mb_h; - int num_lines_out; - assert(!(io->mb_y & 1)); - - if (mb_w <= 0 || mb_h <= 0) { - return 0; - } - num_lines_out = p->emit(io, p); - if (p->emit_alpha) { - p->emit_alpha(io, p); - } - p->last_y += num_lines_out; - return 1; -} - -//------------------------------------------------------------------------------ - -static void CustomTeardown(const VP8Io* io) { - WebPDecParams* const p = (WebPDecParams*)io->opaque; - free(p->memory); - p->memory = NULL; -} - -//------------------------------------------------------------------------------ -// Main entry point - -void WebPInitCustomIo(WebPDecParams* const params, VP8Io* const io) { - io->put = CustomPut; - io->setup = CustomSetup; - io->teardown = CustomTeardown; - io->opaque = params; -} - -//------------------------------------------------------------------------------ - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif diff --git a/external/libwebp/dec/layer.c b/external/libwebp/dec/layer.c deleted file mode 100644 index a3a5bdcfe8..0000000000 --- a/external/libwebp/dec/layer.c +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2011 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Enhancement layer (for YUV444/422) -// -// Author: Skal (pascal.massimino@gmail.com) - -#include <assert.h> -#include <stdlib.h> - -#include "./vp8i.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -//------------------------------------------------------------------------------ - -int VP8DecodeLayer(VP8Decoder* const dec) { - assert(dec); - assert(dec->layer_data_size_ > 0); - (void)dec; - - // TODO: handle enhancement layer here. - - return 1; -} - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif diff --git a/external/libwebp/dec/quant.c b/external/libwebp/dec/quant.c deleted file mode 100644 index d54097af0d..0000000000 --- a/external/libwebp/dec/quant.c +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright 2010 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Quantizer initialization -// -// Author: Skal (pascal.massimino@gmail.com) - -#include "./vp8i.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -static WEBP_INLINE int clip(int v, int M) { - return v < 0 ? 0 : v > M ? M : v; -} - -// Paragraph 14.1 -static const uint8_t kDcTable[128] = { - 4, 5, 6, 7, 8, 9, 10, 10, - 11, 12, 13, 14, 15, 16, 17, 17, - 18, 19, 20, 20, 21, 21, 22, 22, - 23, 23, 24, 25, 25, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36, - 37, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, - 91, 93, 95, 96, 98, 100, 101, 102, - 104, 106, 108, 110, 112, 114, 116, 118, - 122, 124, 126, 128, 130, 132, 134, 136, - 138, 140, 143, 145, 148, 151, 154, 157 -}; - -static const uint16_t kAcTable[128] = { - 4, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 60, - 62, 64, 66, 68, 70, 72, 74, 76, - 78, 80, 82, 84, 86, 88, 90, 92, - 94, 96, 98, 100, 102, 104, 106, 108, - 110, 112, 114, 116, 119, 122, 125, 128, - 131, 134, 137, 140, 143, 146, 149, 152, - 155, 158, 161, 164, 167, 170, 173, 177, - 181, 185, 189, 193, 197, 201, 205, 209, - 213, 217, 221, 225, 229, 234, 239, 245, - 249, 254, 259, 264, 269, 274, 279, 284 -}; - -//------------------------------------------------------------------------------ -// Paragraph 9.6 - -void VP8ParseQuant(VP8Decoder* const dec) { - VP8BitReader* const br = &dec->br_; - const int base_q0 = VP8GetValue(br, 7); - const int dqy1_dc = VP8Get(br) ? VP8GetSignedValue(br, 4) : 0; - const int dqy2_dc = VP8Get(br) ? VP8GetSignedValue(br, 4) : 0; - const int dqy2_ac = VP8Get(br) ? VP8GetSignedValue(br, 4) : 0; - const int dquv_dc = VP8Get(br) ? VP8GetSignedValue(br, 4) : 0; - const int dquv_ac = VP8Get(br) ? VP8GetSignedValue(br, 4) : 0; - - const VP8SegmentHeader* const hdr = &dec->segment_hdr_; - int i; - - for (i = 0; i < NUM_MB_SEGMENTS; ++i) { - int q; - if (hdr->use_segment_) { - q = hdr->quantizer_[i]; - if (!hdr->absolute_delta_) { - q += base_q0; - } - } else { - if (i > 0) { - dec->dqm_[i] = dec->dqm_[0]; - continue; - } else { - q = base_q0; - } - } - { - VP8QuantMatrix* const m = &dec->dqm_[i]; - m->y1_mat_[0] = kDcTable[clip(q + dqy1_dc, 127)]; - m->y1_mat_[1] = kAcTable[clip(q + 0, 127)]; - - m->y2_mat_[0] = kDcTable[clip(q + dqy2_dc, 127)] * 2; - // For all x in [0..284], x*155/100 is bitwise equal to (x*101581) >> 16. - // The smallest precision for that is '(x*6349) >> 12' but 16 is a good - // word size. - m->y2_mat_[1] = (kAcTable[clip(q + dqy2_ac, 127)] * 101581) >> 16; - if (m->y2_mat_[1] < 8) m->y2_mat_[1] = 8; - - m->uv_mat_[0] = kDcTable[clip(q + dquv_dc, 117)]; - m->uv_mat_[1] = kAcTable[clip(q + dquv_ac, 127)]; - } - } -} - -//------------------------------------------------------------------------------ - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif diff --git a/external/libwebp/dec/tree.c b/external/libwebp/dec/tree.c deleted file mode 100644 index 82484e4c55..0000000000 --- a/external/libwebp/dec/tree.c +++ /dev/null @@ -1,589 +0,0 @@ -// Copyright 2010 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Coding trees and probas -// -// Author: Skal (pascal.massimino@gmail.com) - -#include "vp8i.h" - -#define USE_GENERIC_TREE - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -#ifdef USE_GENERIC_TREE -static const int8_t kYModesIntra4[18] = { - -B_DC_PRED, 1, - -B_TM_PRED, 2, - -B_VE_PRED, 3, - 4, 6, - -B_HE_PRED, 5, - -B_RD_PRED, -B_VR_PRED, - -B_LD_PRED, 7, - -B_VL_PRED, 8, - -B_HD_PRED, -B_HU_PRED -}; -#endif - -#ifndef ONLY_KEYFRAME_CODE - -// inter prediction modes -enum { - LEFT4 = 0, ABOVE4 = 1, ZERO4 = 2, NEW4 = 3, - NEARESTMV, NEARMV, ZEROMV, NEWMV, SPLITMV }; - -static const int8_t kYModesInter[8] = { - -DC_PRED, 1, - 2, 3, - -V_PRED, -H_PRED, - -TM_PRED, -B_PRED -}; - -static const int8_t kMBSplit[6] = { - -3, 1, - -2, 2, - -0, -1 -}; - -static const int8_t kMVRef[8] = { - -ZEROMV, 1, - -NEARESTMV, 2, - -NEARMV, 3, - -NEWMV, -SPLITMV -}; - -static const int8_t kMVRef4[6] = { - -LEFT4, 1, - -ABOVE4, 2, - -ZERO4, -NEW4 -}; -#endif - -//------------------------------------------------------------------------------ -// Default probabilities - -// Inter -#ifndef ONLY_KEYFRAME_CODE -static const uint8_t kYModeProbaInter0[4] = { 112, 86, 140, 37 }; -static const uint8_t kUVModeProbaInter0[3] = { 162, 101, 204 }; -static const uint8_t kMVProba0[2][NUM_MV_PROBAS] = { - { 162, 128, 225, 146, 172, 147, 214, 39, - 156, 128, 129, 132, 75, 145, 178, 206, - 239, 254, 254 }, - { 164, 128, 204, 170, 119, 235, 140, 230, - 228, 128, 130, 130, 74, 148, 180, 203, - 236, 254, 254 } -}; -#endif - -// Paragraph 13.5 -static const uint8_t - CoeffsProba0[NUM_TYPES][NUM_BANDS][NUM_CTX][NUM_PROBAS] = { - // genereated using vp8_default_coef_probs() in entropy.c:129 - { { { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }, - { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }, - { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 } - }, - { { 253, 136, 254, 255, 228, 219, 128, 128, 128, 128, 128 }, - { 189, 129, 242, 255, 227, 213, 255, 219, 128, 128, 128 }, - { 106, 126, 227, 252, 214, 209, 255, 255, 128, 128, 128 } - }, - { { 1, 98, 248, 255, 236, 226, 255, 255, 128, 128, 128 }, - { 181, 133, 238, 254, 221, 234, 255, 154, 128, 128, 128 }, - { 78, 134, 202, 247, 198, 180, 255, 219, 128, 128, 128 }, - }, - { { 1, 185, 249, 255, 243, 255, 128, 128, 128, 128, 128 }, - { 184, 150, 247, 255, 236, 224, 128, 128, 128, 128, 128 }, - { 77, 110, 216, 255, 236, 230, 128, 128, 128, 128, 128 }, - }, - { { 1, 101, 251, 255, 241, 255, 128, 128, 128, 128, 128 }, - { 170, 139, 241, 252, 236, 209, 255, 255, 128, 128, 128 }, - { 37, 116, 196, 243, 228, 255, 255, 255, 128, 128, 128 } - }, - { { 1, 204, 254, 255, 245, 255, 128, 128, 128, 128, 128 }, - { 207, 160, 250, 255, 238, 128, 128, 128, 128, 128, 128 }, - { 102, 103, 231, 255, 211, 171, 128, 128, 128, 128, 128 } - }, - { { 1, 152, 252, 255, 240, 255, 128, 128, 128, 128, 128 }, - { 177, 135, 243, 255, 234, 225, 128, 128, 128, 128, 128 }, - { 80, 129, 211, 255, 194, 224, 128, 128, 128, 128, 128 } - }, - { { 1, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, - { 246, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, - { 255, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 } - } - }, - { { { 198, 35, 237, 223, 193, 187, 162, 160, 145, 155, 62 }, - { 131, 45, 198, 221, 172, 176, 220, 157, 252, 221, 1 }, - { 68, 47, 146, 208, 149, 167, 221, 162, 255, 223, 128 } - }, - { { 1, 149, 241, 255, 221, 224, 255, 255, 128, 128, 128 }, - { 184, 141, 234, 253, 222, 220, 255, 199, 128, 128, 128 }, - { 81, 99, 181, 242, 176, 190, 249, 202, 255, 255, 128 } - }, - { { 1, 129, 232, 253, 214, 197, 242, 196, 255, 255, 128 }, - { 99, 121, 210, 250, 201, 198, 255, 202, 128, 128, 128 }, - { 23, 91, 163, 242, 170, 187, 247, 210, 255, 255, 128 } - }, - { { 1, 200, 246, 255, 234, 255, 128, 128, 128, 128, 128 }, - { 109, 178, 241, 255, 231, 245, 255, 255, 128, 128, 128 }, - { 44, 130, 201, 253, 205, 192, 255, 255, 128, 128, 128 } - }, - { { 1, 132, 239, 251, 219, 209, 255, 165, 128, 128, 128 }, - { 94, 136, 225, 251, 218, 190, 255, 255, 128, 128, 128 }, - { 22, 100, 174, 245, 186, 161, 255, 199, 128, 128, 128 } - }, - { { 1, 182, 249, 255, 232, 235, 128, 128, 128, 128, 128 }, - { 124, 143, 241, 255, 227, 234, 128, 128, 128, 128, 128 }, - { 35, 77, 181, 251, 193, 211, 255, 205, 128, 128, 128 } - }, - { { 1, 157, 247, 255, 236, 231, 255, 255, 128, 128, 128 }, - { 121, 141, 235, 255, 225, 227, 255, 255, 128, 128, 128 }, - { 45, 99, 188, 251, 195, 217, 255, 224, 128, 128, 128 } - }, - { { 1, 1, 251, 255, 213, 255, 128, 128, 128, 128, 128 }, - { 203, 1, 248, 255, 255, 128, 128, 128, 128, 128, 128 }, - { 137, 1, 177, 255, 224, 255, 128, 128, 128, 128, 128 } - } - }, - { { { 253, 9, 248, 251, 207, 208, 255, 192, 128, 128, 128 }, - { 175, 13, 224, 243, 193, 185, 249, 198, 255, 255, 128 }, - { 73, 17, 171, 221, 161, 179, 236, 167, 255, 234, 128 } - }, - { { 1, 95, 247, 253, 212, 183, 255, 255, 128, 128, 128 }, - { 239, 90, 244, 250, 211, 209, 255, 255, 128, 128, 128 }, - { 155, 77, 195, 248, 188, 195, 255, 255, 128, 128, 128 } - }, - { { 1, 24, 239, 251, 218, 219, 255, 205, 128, 128, 128 }, - { 201, 51, 219, 255, 196, 186, 128, 128, 128, 128, 128 }, - { 69, 46, 190, 239, 201, 218, 255, 228, 128, 128, 128 } - }, - { { 1, 191, 251, 255, 255, 128, 128, 128, 128, 128, 128 }, - { 223, 165, 249, 255, 213, 255, 128, 128, 128, 128, 128 }, - { 141, 124, 248, 255, 255, 128, 128, 128, 128, 128, 128 } - }, - { { 1, 16, 248, 255, 255, 128, 128, 128, 128, 128, 128 }, - { 190, 36, 230, 255, 236, 255, 128, 128, 128, 128, 128 }, - { 149, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 } - }, - { { 1, 226, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, - { 247, 192, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, - { 240, 128, 255, 128, 128, 128, 128, 128, 128, 128, 128 } - }, - { { 1, 134, 252, 255, 255, 128, 128, 128, 128, 128, 128 }, - { 213, 62, 250, 255, 255, 128, 128, 128, 128, 128, 128 }, - { 55, 93, 255, 128, 128, 128, 128, 128, 128, 128, 128 } - }, - { { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }, - { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }, - { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 } - } - }, - { { { 202, 24, 213, 235, 186, 191, 220, 160, 240, 175, 255 }, - { 126, 38, 182, 232, 169, 184, 228, 174, 255, 187, 128 }, - { 61, 46, 138, 219, 151, 178, 240, 170, 255, 216, 128 } - }, - { { 1, 112, 230, 250, 199, 191, 247, 159, 255, 255, 128 }, - { 166, 109, 228, 252, 211, 215, 255, 174, 128, 128, 128 }, - { 39, 77, 162, 232, 172, 180, 245, 178, 255, 255, 128 } - }, - { { 1, 52, 220, 246, 198, 199, 249, 220, 255, 255, 128 }, - { 124, 74, 191, 243, 183, 193, 250, 221, 255, 255, 128 }, - { 24, 71, 130, 219, 154, 170, 243, 182, 255, 255, 128 } - }, - { { 1, 182, 225, 249, 219, 240, 255, 224, 128, 128, 128 }, - { 149, 150, 226, 252, 216, 205, 255, 171, 128, 128, 128 }, - { 28, 108, 170, 242, 183, 194, 254, 223, 255, 255, 128 } - }, - { { 1, 81, 230, 252, 204, 203, 255, 192, 128, 128, 128 }, - { 123, 102, 209, 247, 188, 196, 255, 233, 128, 128, 128 }, - { 20, 95, 153, 243, 164, 173, 255, 203, 128, 128, 128 } - }, - { { 1, 222, 248, 255, 216, 213, 128, 128, 128, 128, 128 }, - { 168, 175, 246, 252, 235, 205, 255, 255, 128, 128, 128 }, - { 47, 116, 215, 255, 211, 212, 255, 255, 128, 128, 128 } - }, - { { 1, 121, 236, 253, 212, 214, 255, 255, 128, 128, 128 }, - { 141, 84, 213, 252, 201, 202, 255, 219, 128, 128, 128 }, - { 42, 80, 160, 240, 162, 185, 255, 205, 128, 128, 128 } - }, - { { 1, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, - { 244, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, - { 238, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 } - } - } -}; - -// Paragraph 11.5 -static const uint8_t kBModesProba[NUM_BMODES][NUM_BMODES][NUM_BMODES - 1] = { - { { 231, 120, 48, 89, 115, 113, 120, 152, 112 }, - { 152, 179, 64, 126, 170, 118, 46, 70, 95 }, - { 175, 69, 143, 80, 85, 82, 72, 155, 103 }, - { 56, 58, 10, 171, 218, 189, 17, 13, 152 }, - { 114, 26, 17, 163, 44, 195, 21, 10, 173 }, - { 121, 24, 80, 195, 26, 62, 44, 64, 85 }, - { 144, 71, 10, 38, 171, 213, 144, 34, 26 }, - { 170, 46, 55, 19, 136, 160, 33, 206, 71 }, - { 63, 20, 8, 114, 114, 208, 12, 9, 226 }, - { 81, 40, 11, 96, 182, 84, 29, 16, 36 } }, - { { 134, 183, 89, 137, 98, 101, 106, 165, 148 }, - { 72, 187, 100, 130, 157, 111, 32, 75, 80 }, - { 66, 102, 167, 99, 74, 62, 40, 234, 128 }, - { 41, 53, 9, 178, 241, 141, 26, 8, 107 }, - { 74, 43, 26, 146, 73, 166, 49, 23, 157 }, - { 65, 38, 105, 160, 51, 52, 31, 115, 128 }, - { 104, 79, 12, 27, 217, 255, 87, 17, 7 }, - { 87, 68, 71, 44, 114, 51, 15, 186, 23 }, - { 47, 41, 14, 110, 182, 183, 21, 17, 194 }, - { 66, 45, 25, 102, 197, 189, 23, 18, 22 } }, - { { 88, 88, 147, 150, 42, 46, 45, 196, 205 }, - { 43, 97, 183, 117, 85, 38, 35, 179, 61 }, - { 39, 53, 200, 87, 26, 21, 43, 232, 171 }, - { 56, 34, 51, 104, 114, 102, 29, 93, 77 }, - { 39, 28, 85, 171, 58, 165, 90, 98, 64 }, - { 34, 22, 116, 206, 23, 34, 43, 166, 73 }, - { 107, 54, 32, 26, 51, 1, 81, 43, 31 }, - { 68, 25, 106, 22, 64, 171, 36, 225, 114 }, - { 34, 19, 21, 102, 132, 188, 16, 76, 124 }, - { 62, 18, 78, 95, 85, 57, 50, 48, 51 } }, - { { 193, 101, 35, 159, 215, 111, 89, 46, 111 }, - { 60, 148, 31, 172, 219, 228, 21, 18, 111 }, - { 112, 113, 77, 85, 179, 255, 38, 120, 114 }, - { 40, 42, 1, 196, 245, 209, 10, 25, 109 }, - { 88, 43, 29, 140, 166, 213, 37, 43, 154 }, - { 61, 63, 30, 155, 67, 45, 68, 1, 209 }, - { 100, 80, 8, 43, 154, 1, 51, 26, 71 }, - { 142, 78, 78, 16, 255, 128, 34, 197, 171 }, - { 41, 40, 5, 102, 211, 183, 4, 1, 221 }, - { 51, 50, 17, 168, 209, 192, 23, 25, 82 } }, - { { 138, 31, 36, 171, 27, 166, 38, 44, 229 }, - { 67, 87, 58, 169, 82, 115, 26, 59, 179 }, - { 63, 59, 90, 180, 59, 166, 93, 73, 154 }, - { 40, 40, 21, 116, 143, 209, 34, 39, 175 }, - { 47, 15, 16, 183, 34, 223, 49, 45, 183 }, - { 46, 17, 33, 183, 6, 98, 15, 32, 183 }, - { 57, 46, 22, 24, 128, 1, 54, 17, 37 }, - { 65, 32, 73, 115, 28, 128, 23, 128, 205 }, - { 40, 3, 9, 115, 51, 192, 18, 6, 223 }, - { 87, 37, 9, 115, 59, 77, 64, 21, 47 } }, - { { 104, 55, 44, 218, 9, 54, 53, 130, 226 }, - { 64, 90, 70, 205, 40, 41, 23, 26, 57 }, - { 54, 57, 112, 184, 5, 41, 38, 166, 213 }, - { 30, 34, 26, 133, 152, 116, 10, 32, 134 }, - { 39, 19, 53, 221, 26, 114, 32, 73, 255 }, - { 31, 9, 65, 234, 2, 15, 1, 118, 73 }, - { 75, 32, 12, 51, 192, 255, 160, 43, 51 }, - { 88, 31, 35, 67, 102, 85, 55, 186, 85 }, - { 56, 21, 23, 111, 59, 205, 45, 37, 192 }, - { 55, 38, 70, 124, 73, 102, 1, 34, 98 } }, - { { 125, 98, 42, 88, 104, 85, 117, 175, 82 }, - { 95, 84, 53, 89, 128, 100, 113, 101, 45 }, - { 75, 79, 123, 47, 51, 128, 81, 171, 1 }, - { 57, 17, 5, 71, 102, 57, 53, 41, 49 }, - { 38, 33, 13, 121, 57, 73, 26, 1, 85 }, - { 41, 10, 67, 138, 77, 110, 90, 47, 114 }, - { 115, 21, 2, 10, 102, 255, 166, 23, 6 }, - { 101, 29, 16, 10, 85, 128, 101, 196, 26 }, - { 57, 18, 10, 102, 102, 213, 34, 20, 43 }, - { 117, 20, 15, 36, 163, 128, 68, 1, 26 } }, - { { 102, 61, 71, 37, 34, 53, 31, 243, 192 }, - { 69, 60, 71, 38, 73, 119, 28, 222, 37 }, - { 68, 45, 128, 34, 1, 47, 11, 245, 171 }, - { 62, 17, 19, 70, 146, 85, 55, 62, 70 }, - { 37, 43, 37, 154, 100, 163, 85, 160, 1 }, - { 63, 9, 92, 136, 28, 64, 32, 201, 85 }, - { 75, 15, 9, 9, 64, 255, 184, 119, 16 }, - { 86, 6, 28, 5, 64, 255, 25, 248, 1 }, - { 56, 8, 17, 132, 137, 255, 55, 116, 128 }, - { 58, 15, 20, 82, 135, 57, 26, 121, 40 } }, - { { 164, 50, 31, 137, 154, 133, 25, 35, 218 }, - { 51, 103, 44, 131, 131, 123, 31, 6, 158 }, - { 86, 40, 64, 135, 148, 224, 45, 183, 128 }, - { 22, 26, 17, 131, 240, 154, 14, 1, 209 }, - { 45, 16, 21, 91, 64, 222, 7, 1, 197 }, - { 56, 21, 39, 155, 60, 138, 23, 102, 213 }, - { 83, 12, 13, 54, 192, 255, 68, 47, 28 }, - { 85, 26, 85, 85, 128, 128, 32, 146, 171 }, - { 18, 11, 7, 63, 144, 171, 4, 4, 246 }, - { 35, 27, 10, 146, 174, 171, 12, 26, 128 } }, - { { 190, 80, 35, 99, 180, 80, 126, 54, 45 }, - { 85, 126, 47, 87, 176, 51, 41, 20, 32 }, - { 101, 75, 128, 139, 118, 146, 116, 128, 85 }, - { 56, 41, 15, 176, 236, 85, 37, 9, 62 }, - { 71, 30, 17, 119, 118, 255, 17, 18, 138 }, - { 101, 38, 60, 138, 55, 70, 43, 26, 142 }, - { 146, 36, 19, 30, 171, 255, 97, 27, 20 }, - { 138, 45, 61, 62, 219, 1, 81, 188, 64 }, - { 32, 41, 20, 117, 151, 142, 20, 21, 163 }, - { 112, 19, 12, 61, 195, 128, 48, 4, 24 } } -}; - -void VP8ResetProba(VP8Proba* const proba) { - memset(proba->segments_, 255u, sizeof(proba->segments_)); - memcpy(proba->coeffs_, CoeffsProba0, sizeof(CoeffsProba0)); -#ifndef ONLY_KEYFRAME_CODE - memcpy(proba->mv_, kMVProba0, sizeof(kMVProba0)); - memcpy(proba->ymode_, kYModeProbaInter0, sizeof(kYModeProbaInter0)); - memcpy(proba->uvmode_, kUVModeProbaInter0, sizeof(kUVModeProbaInter0)); -#endif -} - -void VP8ParseIntraMode(VP8BitReader* const br, VP8Decoder* const dec) { - uint8_t* const top = dec->intra_t_ + 4 * dec->mb_x_; - uint8_t* const left = dec->intra_l_; - // Hardcoded 16x16 intra-mode decision tree. - dec->is_i4x4_ = !VP8GetBit(br, 145); // decide for B_PRED first - if (!dec->is_i4x4_) { - const int ymode = - VP8GetBit(br, 156) ? (VP8GetBit(br, 128) ? TM_PRED : H_PRED) - : (VP8GetBit(br, 163) ? V_PRED : DC_PRED); - dec->imodes_[0] = ymode; - memset(top, ymode, 4 * sizeof(top[0])); - memset(left, ymode, 4 * sizeof(left[0])); - } else { - uint8_t* modes = dec->imodes_; - int y; - for (y = 0; y < 4; ++y) { - int ymode = left[y]; - int x; - for (x = 0; x < 4; ++x) { - const uint8_t* const prob = kBModesProba[top[x]][ymode]; -#ifdef USE_GENERIC_TREE - // Generic tree-parsing - int i = 0; - do { - i = kYModesIntra4[2 * i + VP8GetBit(br, prob[i])]; - } while (i > 0); - ymode = -i; -#else - // Hardcoded tree parsing - ymode = !VP8GetBit(br, prob[0]) ? B_DC_PRED : - !VP8GetBit(br, prob[1]) ? B_TM_PRED : - !VP8GetBit(br, prob[2]) ? B_VE_PRED : - !VP8GetBit(br, prob[3]) ? - (!VP8GetBit(br, prob[4]) ? B_HE_PRED : - (!VP8GetBit(br, prob[5]) ? B_RD_PRED : B_VR_PRED)) : - (!VP8GetBit(br, prob[6]) ? B_LD_PRED : - (!VP8GetBit(br, prob[7]) ? B_VL_PRED : - (!VP8GetBit(br, prob[8]) ? B_HD_PRED : B_HU_PRED))); -#endif // USE_GENERIC_TREE - top[x] = ymode; - *modes++ = ymode; - } - left[y] = ymode; - } - } - // Hardcoded UVMode decision tree - dec->uvmode_ = !VP8GetBit(br, 142) ? DC_PRED - : !VP8GetBit(br, 114) ? V_PRED - : VP8GetBit(br, 183) ? TM_PRED : H_PRED; -} - -//------------------------------------------------------------------------------ -// Paragraph 13 - -static const uint8_t - CoeffsUpdateProba[NUM_TYPES][NUM_BANDS][NUM_CTX][NUM_PROBAS] = { - { { { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 176, 246, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 223, 241, 252, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 249, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 244, 252, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 234, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 253, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 246, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 239, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 254, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 248, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 251, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 251, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 254, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 254, 253, 255, 254, 255, 255, 255, 255, 255, 255 }, - { 250, 255, 254, 255, 254, 255, 255, 255, 255, 255, 255 }, - { 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - } - }, - { { { 217, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 225, 252, 241, 253, 255, 255, 254, 255, 255, 255, 255 }, - { 234, 250, 241, 250, 253, 255, 253, 254, 255, 255, 255 } - }, - { { 255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 223, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 238, 253, 254, 254, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 248, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 249, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 253, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 247, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 252, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 253, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 254, 253, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 250, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - } - }, - { { { 186, 251, 250, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 234, 251, 244, 254, 255, 255, 255, 255, 255, 255, 255 }, - { 251, 251, 243, 253, 254, 255, 254, 255, 255, 255, 255 } - }, - { { 255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 236, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 251, 253, 253, 254, 254, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 254, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 254, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - } - }, - { { { 248, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 250, 254, 252, 254, 255, 255, 255, 255, 255, 255, 255 }, - { 248, 254, 249, 253, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 246, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 252, 254, 251, 254, 254, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 254, 252, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 248, 254, 253, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 253, 255, 254, 254, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 251, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 245, 251, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 253, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 251, 253, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 252, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 252, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 249, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 255, 253, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 250, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - } - } -}; - -#ifndef ONLY_KEYFRAME_CODE -static const uint8_t MVUpdateProba[2][NUM_MV_PROBAS] = { - { 237, 246, 253, 253, 254, 254, 254, 254, - 254, 254, 254, 254, 254, 254, 250, 250, - 252, 254, 254 }, - { 231, 243, 245, 253, 254, 254, 254, 254, - 254, 254, 254, 254, 254, 254, 251, 251, - 254, 254, 254 } -}; -#endif - -// Paragraph 9.9 -void VP8ParseProba(VP8BitReader* const br, VP8Decoder* const dec) { - VP8Proba* const proba = &dec->proba_; - int t, b, c, p; - for (t = 0; t < NUM_TYPES; ++t) { - for (b = 0; b < NUM_BANDS; ++b) { - for (c = 0; c < NUM_CTX; ++c) { - for (p = 0; p < NUM_PROBAS; ++p) { - if (VP8GetBit(br, CoeffsUpdateProba[t][b][c][p])) { - proba->coeffs_[t][b][c][p] = VP8GetValue(br, 8); - } - } - } - } - } - dec->use_skip_proba_ = VP8Get(br); - if (dec->use_skip_proba_) { - dec->skip_p_ = VP8GetValue(br, 8); - } -#ifndef ONLY_KEYFRAME_CODE - if (!dec->frm_hdr_.key_frame_) { - int i; - dec->intra_p_ = VP8GetValue(br, 8); - dec->last_p_ = VP8GetValue(br, 8); - dec->golden_p_ = VP8GetValue(br, 8); - if (VP8Get(br)) { // update y-mode - for (i = 0; i < 4; ++i) { - proba->ymode_[i] = VP8GetValue(br, 8); - } - } - if (VP8Get(br)) { // update uv-mode - for (i = 0; i < 3; ++i) { - proba->uvmode_[i] = VP8GetValue(br, 8); - } - } - // update MV - for (i = 0; i < 2; ++i) { - int k; - for (k = 0; k < NUM_MV_PROBAS; ++k) { - if (VP8GetBit(br, MVUpdateProba[i][k])) { - const int v = VP8GetValue(br, 7); - proba->mv_[i][k] = v ? v << 1 : 1; - } - } - } - } -#endif -} - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif diff --git a/external/libwebp/dec/vp8.c b/external/libwebp/dec/vp8.c deleted file mode 100644 index b0ccfa2a06..0000000000 --- a/external/libwebp/dec/vp8.c +++ /dev/null @@ -1,787 +0,0 @@ -// Copyright 2010 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// main entry for the decoder -// -// Author: Skal (pascal.massimino@gmail.com) - -#include <stdlib.h> - -#include "./vp8i.h" -#include "./vp8li.h" -#include "./webpi.h" -#include "../utils/bit_reader.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -//------------------------------------------------------------------------------ - -int WebPGetDecoderVersion(void) { - return (DEC_MAJ_VERSION << 16) | (DEC_MIN_VERSION << 8) | DEC_REV_VERSION; -} - -//------------------------------------------------------------------------------ -// VP8Decoder - -static void SetOk(VP8Decoder* const dec) { - dec->status_ = VP8_STATUS_OK; - dec->error_msg_ = "OK"; -} - -int VP8InitIoInternal(VP8Io* const io, int version) { - if (WEBP_ABI_IS_INCOMPATIBLE(version, WEBP_DECODER_ABI_VERSION)) { - return 0; // mismatch error - } - if (io != NULL) { - memset(io, 0, sizeof(*io)); - } - return 1; -} - -VP8Decoder* VP8New(void) { - VP8Decoder* const dec = (VP8Decoder*)calloc(1, sizeof(*dec)); - if (dec != NULL) { - SetOk(dec); - WebPWorkerInit(&dec->worker_); - dec->ready_ = 0; - dec->num_parts_ = 1; - } - return dec; -} - -VP8StatusCode VP8Status(VP8Decoder* const dec) { - if (!dec) return VP8_STATUS_INVALID_PARAM; - return dec->status_; -} - -const char* VP8StatusMessage(VP8Decoder* const dec) { - if (dec == NULL) return "no object"; - if (!dec->error_msg_) return "OK"; - return dec->error_msg_; -} - -void VP8Delete(VP8Decoder* const dec) { - if (dec != NULL) { - VP8Clear(dec); - free(dec); - } -} - -int VP8SetError(VP8Decoder* const dec, - VP8StatusCode error, const char* const msg) { - // TODO This check would be unnecessary if alpha decompression was separated - // from VP8ProcessRow/FinishRow. This avoids setting 'dec->status_' to - // something other than VP8_STATUS_BITSTREAM_ERROR on alpha decompression - // failure. - if (dec->status_ == VP8_STATUS_OK) { - dec->status_ = error; - dec->error_msg_ = msg; - dec->ready_ = 0; - } - return 0; -} - -//------------------------------------------------------------------------------ - -int VP8CheckSignature(const uint8_t* const data, size_t data_size) { - return (data_size >= 3 && - data[0] == 0x9d && data[1] == 0x01 && data[2] == 0x2a); -} - -int VP8GetInfo(const uint8_t* data, size_t data_size, size_t chunk_size, - int* const width, int* const height) { - if (data == NULL || data_size < VP8_FRAME_HEADER_SIZE) { - return 0; // not enough data - } - // check signature - if (!VP8CheckSignature(data + 3, data_size - 3)) { - return 0; // Wrong signature. - } else { - const uint32_t bits = data[0] | (data[1] << 8) | (data[2] << 16); - const int key_frame = !(bits & 1); - const int w = ((data[7] << 8) | data[6]) & 0x3fff; - const int h = ((data[9] << 8) | data[8]) & 0x3fff; - - if (!key_frame) { // Not a keyframe. - return 0; - } - - if (((bits >> 1) & 7) > 3) { - return 0; // unknown profile - } - if (!((bits >> 4) & 1)) { - return 0; // first frame is invisible! - } - if (((bits >> 5)) >= chunk_size) { // partition_length - return 0; // inconsistent size information. - } - - if (width) { - *width = w; - } - if (height) { - *height = h; - } - - return 1; - } -} - -//------------------------------------------------------------------------------ -// Header parsing - -static void ResetSegmentHeader(VP8SegmentHeader* const hdr) { - assert(hdr != NULL); - hdr->use_segment_ = 0; - hdr->update_map_ = 0; - hdr->absolute_delta_ = 1; - memset(hdr->quantizer_, 0, sizeof(hdr->quantizer_)); - memset(hdr->filter_strength_, 0, sizeof(hdr->filter_strength_)); -} - -// Paragraph 9.3 -static int ParseSegmentHeader(VP8BitReader* br, - VP8SegmentHeader* hdr, VP8Proba* proba) { - assert(br != NULL); - assert(hdr != NULL); - hdr->use_segment_ = VP8Get(br); - if (hdr->use_segment_) { - hdr->update_map_ = VP8Get(br); - if (VP8Get(br)) { // update data - int s; - hdr->absolute_delta_ = VP8Get(br); - for (s = 0; s < NUM_MB_SEGMENTS; ++s) { - hdr->quantizer_[s] = VP8Get(br) ? VP8GetSignedValue(br, 7) : 0; - } - for (s = 0; s < NUM_MB_SEGMENTS; ++s) { - hdr->filter_strength_[s] = VP8Get(br) ? VP8GetSignedValue(br, 6) : 0; - } - } - if (hdr->update_map_) { - int s; - for (s = 0; s < MB_FEATURE_TREE_PROBS; ++s) { - proba->segments_[s] = VP8Get(br) ? VP8GetValue(br, 8) : 255u; - } - } - } else { - hdr->update_map_ = 0; - } - return !br->eof_; -} - -// Paragraph 9.5 -// This function returns VP8_STATUS_SUSPENDED if we don't have all the -// necessary data in 'buf'. -// This case is not necessarily an error (for incremental decoding). -// Still, no bitreader is ever initialized to make it possible to read -// unavailable memory. -// If we don't even have the partitions' sizes, than VP8_STATUS_NOT_ENOUGH_DATA -// is returned, and this is an unrecoverable error. -// If the partitions were positioned ok, VP8_STATUS_OK is returned. -static VP8StatusCode ParsePartitions(VP8Decoder* const dec, - const uint8_t* buf, size_t size) { - VP8BitReader* const br = &dec->br_; - const uint8_t* sz = buf; - const uint8_t* buf_end = buf + size; - const uint8_t* part_start; - int last_part; - int p; - - dec->num_parts_ = 1 << VP8GetValue(br, 2); - last_part = dec->num_parts_ - 1; - part_start = buf + last_part * 3; - if (buf_end < part_start) { - // we can't even read the sizes with sz[]! That's a failure. - return VP8_STATUS_NOT_ENOUGH_DATA; - } - for (p = 0; p < last_part; ++p) { - const uint32_t psize = sz[0] | (sz[1] << 8) | (sz[2] << 16); - const uint8_t* part_end = part_start + psize; - if (part_end > buf_end) part_end = buf_end; - VP8InitBitReader(dec->parts_ + p, part_start, part_end); - part_start = part_end; - sz += 3; - } - VP8InitBitReader(dec->parts_ + last_part, part_start, buf_end); - return (part_start < buf_end) ? VP8_STATUS_OK : - VP8_STATUS_SUSPENDED; // Init is ok, but there's not enough data -} - -// Paragraph 9.4 -static int ParseFilterHeader(VP8BitReader* br, VP8Decoder* const dec) { - VP8FilterHeader* const hdr = &dec->filter_hdr_; - hdr->simple_ = VP8Get(br); - hdr->level_ = VP8GetValue(br, 6); - hdr->sharpness_ = VP8GetValue(br, 3); - hdr->use_lf_delta_ = VP8Get(br); - if (hdr->use_lf_delta_) { - if (VP8Get(br)) { // update lf-delta? - int i; - for (i = 0; i < NUM_REF_LF_DELTAS; ++i) { - if (VP8Get(br)) { - hdr->ref_lf_delta_[i] = VP8GetSignedValue(br, 6); - } - } - for (i = 0; i < NUM_MODE_LF_DELTAS; ++i) { - if (VP8Get(br)) { - hdr->mode_lf_delta_[i] = VP8GetSignedValue(br, 6); - } - } - } - } - dec->filter_type_ = (hdr->level_ == 0) ? 0 : hdr->simple_ ? 1 : 2; - if (dec->filter_type_ > 0) { // precompute filter levels per segment - if (dec->segment_hdr_.use_segment_) { - int s; - for (s = 0; s < NUM_MB_SEGMENTS; ++s) { - int strength = dec->segment_hdr_.filter_strength_[s]; - if (!dec->segment_hdr_.absolute_delta_) { - strength += hdr->level_; - } - dec->filter_levels_[s] = strength; - } - } else { - dec->filter_levels_[0] = hdr->level_; - } - } - return !br->eof_; -} - -// Topmost call -int VP8GetHeaders(VP8Decoder* const dec, VP8Io* const io) { - const uint8_t* buf; - size_t buf_size; - VP8FrameHeader* frm_hdr; - VP8PictureHeader* pic_hdr; - VP8BitReader* br; - VP8StatusCode status; - WebPHeaderStructure headers; - - if (dec == NULL) { - return 0; - } - SetOk(dec); - if (io == NULL) { - return VP8SetError(dec, VP8_STATUS_INVALID_PARAM, - "null VP8Io passed to VP8GetHeaders()"); - } - - // Process Pre-VP8 chunks. - headers.data = io->data; - headers.data_size = io->data_size; - status = WebPParseHeaders(&headers); - if (status != VP8_STATUS_OK) { - return VP8SetError(dec, status, "Incorrect/incomplete header."); - } - if (headers.is_lossless) { - return VP8SetError(dec, VP8_STATUS_BITSTREAM_ERROR, - "Unexpected lossless format encountered."); - } - - if (dec->alpha_data_ == NULL) { - assert(dec->alpha_data_size_ == 0); - // We have NOT set alpha data yet. Set it now. - // (This is to ensure that dec->alpha_data_ is NOT reset to NULL if - // WebPParseHeaders() is called more than once, as in incremental decoding - // case.) - dec->alpha_data_ = headers.alpha_data; - dec->alpha_data_size_ = headers.alpha_data_size; - } - - // Process the VP8 frame header. - buf = headers.data + headers.offset; - buf_size = headers.data_size - headers.offset; - assert(headers.data_size >= headers.offset); // WebPParseHeaders' guarantee - if (buf_size < 4) { - return VP8SetError(dec, VP8_STATUS_NOT_ENOUGH_DATA, - "Truncated header."); - } - - // Paragraph 9.1 - { - const uint32_t bits = buf[0] | (buf[1] << 8) | (buf[2] << 16); - frm_hdr = &dec->frm_hdr_; - frm_hdr->key_frame_ = !(bits & 1); - frm_hdr->profile_ = (bits >> 1) & 7; - frm_hdr->show_ = (bits >> 4) & 1; - frm_hdr->partition_length_ = (bits >> 5); - if (frm_hdr->profile_ > 3) - return VP8SetError(dec, VP8_STATUS_BITSTREAM_ERROR, - "Incorrect keyframe parameters."); - if (!frm_hdr->show_) - return VP8SetError(dec, VP8_STATUS_UNSUPPORTED_FEATURE, - "Frame not displayable."); - buf += 3; - buf_size -= 3; - } - - pic_hdr = &dec->pic_hdr_; - if (frm_hdr->key_frame_) { - // Paragraph 9.2 - if (buf_size < 7) { - return VP8SetError(dec, VP8_STATUS_NOT_ENOUGH_DATA, - "cannot parse picture header"); - } - if (!VP8CheckSignature(buf, buf_size)) { - return VP8SetError(dec, VP8_STATUS_BITSTREAM_ERROR, - "Bad code word"); - } - pic_hdr->width_ = ((buf[4] << 8) | buf[3]) & 0x3fff; - pic_hdr->xscale_ = buf[4] >> 6; // ratio: 1, 5/4 5/3 or 2 - pic_hdr->height_ = ((buf[6] << 8) | buf[5]) & 0x3fff; - pic_hdr->yscale_ = buf[6] >> 6; - buf += 7; - buf_size -= 7; - - dec->mb_w_ = (pic_hdr->width_ + 15) >> 4; - dec->mb_h_ = (pic_hdr->height_ + 15) >> 4; - // Setup default output area (can be later modified during io->setup()) - io->width = pic_hdr->width_; - io->height = pic_hdr->height_; - io->use_scaling = 0; - io->use_cropping = 0; - io->crop_top = 0; - io->crop_left = 0; - io->crop_right = io->width; - io->crop_bottom = io->height; - io->mb_w = io->width; // sanity check - io->mb_h = io->height; // ditto - - VP8ResetProba(&dec->proba_); - ResetSegmentHeader(&dec->segment_hdr_); - dec->segment_ = 0; // default for intra - } - - // Check if we have all the partition #0 available, and initialize dec->br_ - // to read this partition (and this partition only). - if (frm_hdr->partition_length_ > buf_size) { - return VP8SetError(dec, VP8_STATUS_NOT_ENOUGH_DATA, - "bad partition length"); - } - - br = &dec->br_; - VP8InitBitReader(br, buf, buf + frm_hdr->partition_length_); - buf += frm_hdr->partition_length_; - buf_size -= frm_hdr->partition_length_; - - if (frm_hdr->key_frame_) { - pic_hdr->colorspace_ = VP8Get(br); - pic_hdr->clamp_type_ = VP8Get(br); - } - if (!ParseSegmentHeader(br, &dec->segment_hdr_, &dec->proba_)) { - return VP8SetError(dec, VP8_STATUS_BITSTREAM_ERROR, - "cannot parse segment header"); - } - // Filter specs - if (!ParseFilterHeader(br, dec)) { - return VP8SetError(dec, VP8_STATUS_BITSTREAM_ERROR, - "cannot parse filter header"); - } - status = ParsePartitions(dec, buf, buf_size); - if (status != VP8_STATUS_OK) { - return VP8SetError(dec, status, "cannot parse partitions"); - } - - // quantizer change - VP8ParseQuant(dec); - - // Frame buffer marking - if (!frm_hdr->key_frame_) { - // Paragraph 9.7 -#ifndef ONLY_KEYFRAME_CODE - dec->buffer_flags_ = VP8Get(br) << 0; // update golden - dec->buffer_flags_ |= VP8Get(br) << 1; // update alt ref - if (!(dec->buffer_flags_ & 1)) { - dec->buffer_flags_ |= VP8GetValue(br, 2) << 2; - } - if (!(dec->buffer_flags_ & 2)) { - dec->buffer_flags_ |= VP8GetValue(br, 2) << 4; - } - dec->buffer_flags_ |= VP8Get(br) << 6; // sign bias golden - dec->buffer_flags_ |= VP8Get(br) << 7; // sign bias alt ref -#else - return VP8SetError(dec, VP8_STATUS_UNSUPPORTED_FEATURE, - "Not a key frame."); -#endif - } else { - dec->buffer_flags_ = 0x003 | 0x100; - } - - // Paragraph 9.8 -#ifndef ONLY_KEYFRAME_CODE - dec->update_proba_ = VP8Get(br); - if (!dec->update_proba_) { // save for later restore - dec->proba_saved_ = dec->proba_; - } - dec->buffer_flags_ &= 1 << 8; - dec->buffer_flags_ |= - (frm_hdr->key_frame_ || VP8Get(br)) << 8; // refresh last frame -#else - VP8Get(br); // just ignore the value of update_proba_ -#endif - - VP8ParseProba(br, dec); - -#ifdef WEBP_EXPERIMENTAL_FEATURES - // Extensions - if (dec->pic_hdr_.colorspace_) { - const size_t kTrailerSize = 8; - const uint8_t kTrailerMarker = 0x01; - const uint8_t* ext_buf = buf - kTrailerSize; - size_t size; - - if (frm_hdr->partition_length_ < kTrailerSize || - ext_buf[kTrailerSize - 1] != kTrailerMarker) { - return VP8SetError(dec, VP8_STATUS_BITSTREAM_ERROR, - "RIFF: Inconsistent extra information."); - } - - // Layer - size = (ext_buf[0] << 0) | (ext_buf[1] << 8) | (ext_buf[2] << 16); - dec->layer_data_size_ = size; - dec->layer_data_ = NULL; // will be set later - dec->layer_colorspace_ = ext_buf[3]; - } -#endif - - // sanitized state - dec->ready_ = 1; - return 1; -} - -//------------------------------------------------------------------------------ -// Residual decoding (Paragraph 13.2 / 13.3) - -static const uint8_t kBands[16 + 1] = { - 0, 1, 2, 3, 6, 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7, - 0 // extra entry as sentinel -}; - -static const uint8_t kCat3[] = { 173, 148, 140, 0 }; -static const uint8_t kCat4[] = { 176, 155, 140, 135, 0 }; -static const uint8_t kCat5[] = { 180, 157, 141, 134, 130, 0 }; -static const uint8_t kCat6[] = - { 254, 254, 243, 230, 196, 177, 153, 140, 133, 130, 129, 0 }; -static const uint8_t* const kCat3456[] = { kCat3, kCat4, kCat5, kCat6 }; -static const uint8_t kZigzag[16] = { - 0, 1, 4, 8, 5, 2, 3, 6, 9, 12, 13, 10, 7, 11, 14, 15 -}; - -typedef const uint8_t (*ProbaArray)[NUM_CTX][NUM_PROBAS]; // for const-casting - -// Returns the position of the last non-zero coeff plus one -// (and 0 if there's no coeff at all) -static int GetCoeffs(VP8BitReader* const br, ProbaArray prob, - int ctx, const quant_t dq, int n, int16_t* out) { - // n is either 0 or 1 here. kBands[n] is not necessary for extracting '*p'. - const uint8_t* p = prob[n][ctx]; - if (!VP8GetBit(br, p[0])) { // first EOB is more a 'CBP' bit. - return 0; - } - while (1) { - ++n; - if (!VP8GetBit(br, p[1])) { - p = prob[kBands[n]][0]; - } else { // non zero coeff - int v, j; - if (!VP8GetBit(br, p[2])) { - p = prob[kBands[n]][1]; - v = 1; - } else { - if (!VP8GetBit(br, p[3])) { - if (!VP8GetBit(br, p[4])) { - v = 2; - } else { - v = 3 + VP8GetBit(br, p[5]); - } - } else { - if (!VP8GetBit(br, p[6])) { - if (!VP8GetBit(br, p[7])) { - v = 5 + VP8GetBit(br, 159); - } else { - v = 7 + 2 * VP8GetBit(br, 165); - v += VP8GetBit(br, 145); - } - } else { - const uint8_t* tab; - const int bit1 = VP8GetBit(br, p[8]); - const int bit0 = VP8GetBit(br, p[9 + bit1]); - const int cat = 2 * bit1 + bit0; - v = 0; - for (tab = kCat3456[cat]; *tab; ++tab) { - v += v + VP8GetBit(br, *tab); - } - v += 3 + (8 << cat); - } - } - p = prob[kBands[n]][2]; - } - j = kZigzag[n - 1]; - out[j] = VP8GetSigned(br, v) * dq[j > 0]; - if (n == 16 || !VP8GetBit(br, p[0])) { // EOB - return n; - } - } - if (n == 16) { - return 16; - } - } -} - -// Alias-safe way of converting 4bytes to 32bits. -typedef union { - uint8_t i8[4]; - uint32_t i32; -} PackedNz; - -// Table to unpack four bits into four bytes -static const PackedNz kUnpackTab[16] = { - {{0, 0, 0, 0}}, {{1, 0, 0, 0}}, {{0, 1, 0, 0}}, {{1, 1, 0, 0}}, - {{0, 0, 1, 0}}, {{1, 0, 1, 0}}, {{0, 1, 1, 0}}, {{1, 1, 1, 0}}, - {{0, 0, 0, 1}}, {{1, 0, 0, 1}}, {{0, 1, 0, 1}}, {{1, 1, 0, 1}}, - {{0, 0, 1, 1}}, {{1, 0, 1, 1}}, {{0, 1, 1, 1}}, {{1, 1, 1, 1}} }; - -// Macro to pack four LSB of four bytes into four bits. -#if defined(__PPC__) || defined(_M_PPC) || defined(_ARCH_PPC) || \ - defined(__BIG_ENDIAN__) -#define PACK_CST 0x08040201U -#else -#define PACK_CST 0x01020408U -#endif -#define PACK(X, S) ((((X).i32 * PACK_CST) & 0xff000000) >> (S)) - -static void ParseResiduals(VP8Decoder* const dec, - VP8MB* const mb, VP8BitReader* const token_br) { - int out_t_nz, out_l_nz, first; - ProbaArray ac_prob; - const VP8QuantMatrix* q = &dec->dqm_[dec->segment_]; - int16_t* dst = dec->coeffs_; - VP8MB* const left_mb = dec->mb_info_ - 1; - PackedNz nz_ac, nz_dc; - PackedNz tnz, lnz; - uint32_t non_zero_ac = 0; - uint32_t non_zero_dc = 0; - int x, y, ch; - - nz_dc.i32 = nz_ac.i32 = 0; - memset(dst, 0, 384 * sizeof(*dst)); - if (!dec->is_i4x4_) { // parse DC - int16_t dc[16] = { 0 }; - const int ctx = mb->dc_nz_ + left_mb->dc_nz_; - mb->dc_nz_ = left_mb->dc_nz_ = - (GetCoeffs(token_br, (ProbaArray)dec->proba_.coeffs_[1], - ctx, q->y2_mat_, 0, dc) > 0); - first = 1; - ac_prob = (ProbaArray)dec->proba_.coeffs_[0]; - VP8TransformWHT(dc, dst); - } else { - first = 0; - ac_prob = (ProbaArray)dec->proba_.coeffs_[3]; - } - - tnz = kUnpackTab[mb->nz_ & 0xf]; - lnz = kUnpackTab[left_mb->nz_ & 0xf]; - for (y = 0; y < 4; ++y) { - int l = lnz.i8[y]; - for (x = 0; x < 4; ++x) { - const int ctx = l + tnz.i8[x]; - const int nz = GetCoeffs(token_br, ac_prob, ctx, - q->y1_mat_, first, dst); - tnz.i8[x] = l = (nz > 0); - nz_dc.i8[x] = (dst[0] != 0); - nz_ac.i8[x] = (nz > 1); - dst += 16; - } - lnz.i8[y] = l; - non_zero_dc |= PACK(nz_dc, 24 - y * 4); - non_zero_ac |= PACK(nz_ac, 24 - y * 4); - } - out_t_nz = PACK(tnz, 24); - out_l_nz = PACK(lnz, 24); - - tnz = kUnpackTab[mb->nz_ >> 4]; - lnz = kUnpackTab[left_mb->nz_ >> 4]; - for (ch = 0; ch < 4; ch += 2) { - for (y = 0; y < 2; ++y) { - int l = lnz.i8[ch + y]; - for (x = 0; x < 2; ++x) { - const int ctx = l + tnz.i8[ch + x]; - const int nz = - GetCoeffs(token_br, (ProbaArray)dec->proba_.coeffs_[2], - ctx, q->uv_mat_, 0, dst); - tnz.i8[ch + x] = l = (nz > 0); - nz_dc.i8[y * 2 + x] = (dst[0] != 0); - nz_ac.i8[y * 2 + x] = (nz > 1); - dst += 16; - } - lnz.i8[ch + y] = l; - } - non_zero_dc |= PACK(nz_dc, 8 - ch * 2); - non_zero_ac |= PACK(nz_ac, 8 - ch * 2); - } - out_t_nz |= PACK(tnz, 20); - out_l_nz |= PACK(lnz, 20); - mb->nz_ = out_t_nz; - left_mb->nz_ = out_l_nz; - - dec->non_zero_ac_ = non_zero_ac; - dec->non_zero_ = non_zero_ac | non_zero_dc; - mb->skip_ = !dec->non_zero_; -} -#undef PACK - -//------------------------------------------------------------------------------ -// Main loop - -int VP8DecodeMB(VP8Decoder* const dec, VP8BitReader* const token_br) { - VP8BitReader* const br = &dec->br_; - VP8MB* const left = dec->mb_info_ - 1; - VP8MB* const info = dec->mb_info_ + dec->mb_x_; - - // Note: we don't save segment map (yet), as we don't expect - // to decode more than 1 keyframe. - if (dec->segment_hdr_.update_map_) { - // Hardcoded tree parsing - dec->segment_ = !VP8GetBit(br, dec->proba_.segments_[0]) ? - VP8GetBit(br, dec->proba_.segments_[1]) : - 2 + VP8GetBit(br, dec->proba_.segments_[2]); - } - info->skip_ = dec->use_skip_proba_ ? VP8GetBit(br, dec->skip_p_) : 0; - - VP8ParseIntraMode(br, dec); - if (br->eof_) { - return 0; - } - - if (!info->skip_) { - ParseResiduals(dec, info, token_br); - } else { - left->nz_ = info->nz_ = 0; - if (!dec->is_i4x4_) { - left->dc_nz_ = info->dc_nz_ = 0; - } - dec->non_zero_ = 0; - dec->non_zero_ac_ = 0; - } - - return (!token_br->eof_); -} - -void VP8InitScanline(VP8Decoder* const dec) { - VP8MB* const left = dec->mb_info_ - 1; - left->nz_ = 0; - left->dc_nz_ = 0; - memset(dec->intra_l_, B_DC_PRED, sizeof(dec->intra_l_)); - dec->filter_row_ = - (dec->filter_type_ > 0) && - (dec->mb_y_ >= dec->tl_mb_y_) && (dec->mb_y_ <= dec->br_mb_y_); -} - -static int ParseFrame(VP8Decoder* const dec, VP8Io* io) { - for (dec->mb_y_ = 0; dec->mb_y_ < dec->br_mb_y_; ++dec->mb_y_) { - VP8BitReader* const token_br = - &dec->parts_[dec->mb_y_ & (dec->num_parts_ - 1)]; - VP8InitScanline(dec); - for (dec->mb_x_ = 0; dec->mb_x_ < dec->mb_w_; dec->mb_x_++) { - if (!VP8DecodeMB(dec, token_br)) { - return VP8SetError(dec, VP8_STATUS_NOT_ENOUGH_DATA, - "Premature end-of-file encountered."); - } - VP8ReconstructBlock(dec); - - // Store data and save block's filtering params - VP8StoreBlock(dec); - } - if (!VP8ProcessRow(dec, io)) { - return VP8SetError(dec, VP8_STATUS_USER_ABORT, "Output aborted."); - } - } - if (dec->use_threads_ && !WebPWorkerSync(&dec->worker_)) { - return 0; - } - - // Finish -#ifndef ONLY_KEYFRAME_CODE - if (!dec->update_proba_) { - dec->proba_ = dec->proba_saved_; - } -#endif - -#ifdef WEBP_EXPERIMENTAL_FEATURES - if (dec->layer_data_size_ > 0) { - if (!VP8DecodeLayer(dec)) { - return 0; - } - } -#endif - - return 1; -} - -// Main entry point -int VP8Decode(VP8Decoder* const dec, VP8Io* const io) { - int ok = 0; - if (dec == NULL) { - return 0; - } - if (io == NULL) { - return VP8SetError(dec, VP8_STATUS_INVALID_PARAM, - "NULL VP8Io parameter in VP8Decode()."); - } - - if (!dec->ready_) { - if (!VP8GetHeaders(dec, io)) { - return 0; - } - } - assert(dec->ready_); - - // Finish setting up the decoding parameter. Will call io->setup(). - ok = (VP8EnterCritical(dec, io) == VP8_STATUS_OK); - if (ok) { // good to go. - // Will allocate memory and prepare everything. - if (ok) ok = VP8InitFrame(dec, io); - - // Main decoding loop - if (ok) ok = ParseFrame(dec, io); - - // Exit. - ok &= VP8ExitCritical(dec, io); - } - - if (!ok) { - VP8Clear(dec); - return 0; - } - - dec->ready_ = 0; - return ok; -} - -void VP8Clear(VP8Decoder* const dec) { - if (dec == NULL) { - return; - } - if (dec->use_threads_) { - WebPWorkerEnd(&dec->worker_); - } - if (dec->mem_) { - free(dec->mem_); - } - dec->mem_ = NULL; - dec->mem_size_ = 0; - memset(&dec->br_, 0, sizeof(dec->br_)); - dec->ready_ = 0; -} - -//------------------------------------------------------------------------------ - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif diff --git a/external/libwebp/dec/vp8i.h b/external/libwebp/dec/vp8i.h deleted file mode 100644 index 6e27456fe1..0000000000 --- a/external/libwebp/dec/vp8i.h +++ /dev/null @@ -1,335 +0,0 @@ -// Copyright 2010 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// VP8 decoder: internal header. -// -// Author: Skal (pascal.massimino@gmail.com) - -#ifndef WEBP_DEC_VP8I_H_ -#define WEBP_DEC_VP8I_H_ - -#include <string.h> // for memcpy() -#include "./vp8li.h" -#include "../utils/bit_reader.h" -#include "../utils/thread.h" -#include "../dsp/dsp.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -//------------------------------------------------------------------------------ -// Various defines and enums - -// version numbers -#define DEC_MAJ_VERSION 0 -#define DEC_MIN_VERSION 2 -#define DEC_REV_VERSION 1 - -#define ONLY_KEYFRAME_CODE // to remove any code related to P-Frames - -// intra prediction modes -enum { B_DC_PRED = 0, // 4x4 modes - B_TM_PRED, - B_VE_PRED, - B_HE_PRED, - B_RD_PRED, - B_VR_PRED, - B_LD_PRED, - B_VL_PRED, - B_HD_PRED, - B_HU_PRED, - NUM_BMODES = B_HU_PRED + 1 - B_DC_PRED, // = 10 - - // Luma16 or UV modes - DC_PRED = B_DC_PRED, V_PRED = B_VE_PRED, - H_PRED = B_HE_PRED, TM_PRED = B_TM_PRED, - B_PRED = NUM_BMODES, // refined I4x4 mode - - // special modes - B_DC_PRED_NOTOP = 4, - B_DC_PRED_NOLEFT = 5, - B_DC_PRED_NOTOPLEFT = 6, - NUM_B_DC_MODES = 7 }; - -enum { MB_FEATURE_TREE_PROBS = 3, - NUM_MB_SEGMENTS = 4, - NUM_REF_LF_DELTAS = 4, - NUM_MODE_LF_DELTAS = 4, // I4x4, ZERO, *, SPLIT - MAX_NUM_PARTITIONS = 8, - // Probabilities - NUM_TYPES = 4, - NUM_BANDS = 8, - NUM_CTX = 3, - NUM_PROBAS = 11, - NUM_MV_PROBAS = 19 }; - -// YUV-cache parameters. -// Constraints are: We need to store one 16x16 block of luma samples (y), -// and two 8x8 chroma blocks (u/v). These are better be 16-bytes aligned, -// in order to be SIMD-friendly. We also need to store the top, left and -// top-left samples (from previously decoded blocks), along with four -// extra top-right samples for luma (intra4x4 prediction only). -// One possible layout is, using 32 * (17 + 9) bytes: -// -// .+------ <- only 1 pixel high -// .|yyyyt. -// .|yyyyt. -// .|yyyyt. -// .|yyyy.. -// .+--.+-- <- only 1 pixel high -// .|uu.|vv -// .|uu.|vv -// -// Every character is a 4x4 block, with legend: -// '.' = unused -// 'y' = y-samples 'u' = u-samples 'v' = u-samples -// '|' = left sample, '-' = top sample, '+' = top-left sample -// 't' = extra top-right sample for 4x4 modes -// With this layout, BPS (=Bytes Per Scan-line) is one cacheline size. -#define BPS 32 // this is the common stride used by yuv[] -#define YUV_SIZE (BPS * 17 + BPS * 9) -#define Y_SIZE (BPS * 17) -#define Y_OFF (BPS * 1 + 8) -#define U_OFF (Y_OFF + BPS * 16 + BPS) -#define V_OFF (U_OFF + 16) - -//------------------------------------------------------------------------------ -// Headers - -typedef struct { - uint8_t key_frame_; - uint8_t profile_; - uint8_t show_; - uint32_t partition_length_; -} VP8FrameHeader; - -typedef struct { - uint16_t width_; - uint16_t height_; - uint8_t xscale_; - uint8_t yscale_; - uint8_t colorspace_; // 0 = YCbCr - uint8_t clamp_type_; -} VP8PictureHeader; - -// segment features -typedef struct { - int use_segment_; - int update_map_; // whether to update the segment map or not - int absolute_delta_; // absolute or delta values for quantizer and filter - int8_t quantizer_[NUM_MB_SEGMENTS]; // quantization changes - int8_t filter_strength_[NUM_MB_SEGMENTS]; // filter strength for segments -} VP8SegmentHeader; - -// Struct collecting all frame-persistent probabilities. -typedef struct { - uint8_t segments_[MB_FEATURE_TREE_PROBS]; - // Type: 0:Intra16-AC 1:Intra16-DC 2:Chroma 3:Intra4 - uint8_t coeffs_[NUM_TYPES][NUM_BANDS][NUM_CTX][NUM_PROBAS]; -#ifndef ONLY_KEYFRAME_CODE - uint8_t ymode_[4], uvmode_[3]; - uint8_t mv_[2][NUM_MV_PROBAS]; -#endif -} VP8Proba; - -// Filter parameters -typedef struct { - int simple_; // 0=complex, 1=simple - int level_; // [0..63] - int sharpness_; // [0..7] - int use_lf_delta_; - int ref_lf_delta_[NUM_REF_LF_DELTAS]; - int mode_lf_delta_[NUM_MODE_LF_DELTAS]; -} VP8FilterHeader; - -//------------------------------------------------------------------------------ -// Informations about the macroblocks. - -typedef struct { // filter specs - unsigned int f_level_:6; // filter strength: 0..63 - unsigned int f_ilevel_:6; // inner limit: 1..63 - unsigned int f_inner_:1; // do inner filtering? -} VP8FInfo; - -typedef struct { // used for syntax-parsing - unsigned int nz_; // non-zero AC/DC coeffs - unsigned int dc_nz_:1; // non-zero DC coeffs - unsigned int skip_:1; // block type -} VP8MB; - -// Dequantization matrices -typedef int quant_t[2]; // [DC / AC]. Can be 'uint16_t[2]' too (~slower). -typedef struct { - quant_t y1_mat_, y2_mat_, uv_mat_; -} VP8QuantMatrix; - -// Persistent information needed by the parallel processing -typedef struct { - int id_; // cache row to process (in [0..2]) - int mb_y_; // macroblock position of the row - int filter_row_; // true if row-filtering is needed - VP8FInfo* f_info_; // filter strengths - VP8Io io_; // copy of the VP8Io to pass to put() -} VP8ThreadContext; - -//------------------------------------------------------------------------------ -// VP8Decoder: the main opaque structure handed over to user - -struct VP8Decoder { - VP8StatusCode status_; - int ready_; // true if ready to decode a picture with VP8Decode() - const char* error_msg_; // set when status_ is not OK. - - // Main data source - VP8BitReader br_; - - // headers - VP8FrameHeader frm_hdr_; - VP8PictureHeader pic_hdr_; - VP8FilterHeader filter_hdr_; - VP8SegmentHeader segment_hdr_; - - // Worker - WebPWorker worker_; - int use_threads_; // use multi-thread - int cache_id_; // current cache row - int num_caches_; // number of cached rows of 16 pixels (1, 2 or 3) - VP8ThreadContext thread_ctx_; // Thread context - - // dimension, in macroblock units. - int mb_w_, mb_h_; - - // Macroblock to process/filter, depending on cropping and filter_type. - int tl_mb_x_, tl_mb_y_; // top-left MB that must be in-loop filtered - int br_mb_x_, br_mb_y_; // last bottom-right MB that must be decoded - - // number of partitions. - int num_parts_; - // per-partition boolean decoders. - VP8BitReader parts_[MAX_NUM_PARTITIONS]; - - // buffer refresh flags - // bit 0: refresh Gold, bit 1: refresh Alt - // bit 2-3: copy to Gold, bit 4-5: copy to Alt - // bit 6: Gold sign bias, bit 7: Alt sign bias - // bit 8: refresh last frame - uint32_t buffer_flags_; - - // dequantization (one set of DC/AC dequant factor per segment) - VP8QuantMatrix dqm_[NUM_MB_SEGMENTS]; - - // probabilities - VP8Proba proba_; - int use_skip_proba_; - uint8_t skip_p_; -#ifndef ONLY_KEYFRAME_CODE - uint8_t intra_p_, last_p_, golden_p_; - VP8Proba proba_saved_; - int update_proba_; -#endif - - // Boundary data cache and persistent buffers. - uint8_t* intra_t_; // top intra modes values: 4 * mb_w_ - uint8_t intra_l_[4]; // left intra modes values - uint8_t* y_t_; // top luma samples: 16 * mb_w_ - uint8_t* u_t_, *v_t_; // top u/v samples: 8 * mb_w_ each - - VP8MB* mb_info_; // contextual macroblock info (mb_w_ + 1) - VP8FInfo* f_info_; // filter strength info - uint8_t* yuv_b_; // main block for Y/U/V (size = YUV_SIZE) - int16_t* coeffs_; // 384 coeffs = (16+8+8) * 4*4 - - uint8_t* cache_y_; // macroblock row for storing unfiltered samples - uint8_t* cache_u_; - uint8_t* cache_v_; - int cache_y_stride_; - int cache_uv_stride_; - - // main memory chunk for the above data. Persistent. - void* mem_; - size_t mem_size_; - - // Per macroblock non-persistent infos. - int mb_x_, mb_y_; // current position, in macroblock units - uint8_t is_i4x4_; // true if intra4x4 - uint8_t imodes_[16]; // one 16x16 mode (#0) or sixteen 4x4 modes - uint8_t uvmode_; // chroma prediction mode - uint8_t segment_; // block's segment - - // bit-wise info about the content of each sub-4x4 blocks: there are 16 bits - // for luma (bits #0->#15), then 4 bits for chroma-u (#16->#19) and 4 bits for - // chroma-v (#20->#23), each corresponding to one 4x4 block in decoding order. - // If the bit is set, the 4x4 block contains some non-zero coefficients. - uint32_t non_zero_; - uint32_t non_zero_ac_; - - // Filtering side-info - int filter_type_; // 0=off, 1=simple, 2=complex - int filter_row_; // per-row flag - uint8_t filter_levels_[NUM_MB_SEGMENTS]; // precalculated per-segment - - // extensions - const uint8_t* alpha_data_; // compressed alpha data (if present) - size_t alpha_data_size_; - uint8_t* alpha_plane_; // output. Persistent, contains the whole data. - - int layer_colorspace_; - const uint8_t* layer_data_; // compressed layer data (if present) - size_t layer_data_size_; -}; - -//------------------------------------------------------------------------------ -// internal functions. Not public. - -// in vp8.c -int VP8SetError(VP8Decoder* const dec, - VP8StatusCode error, const char* const msg); - -// in tree.c -void VP8ResetProba(VP8Proba* const proba); -void VP8ParseProba(VP8BitReader* const br, VP8Decoder* const dec); -void VP8ParseIntraMode(VP8BitReader* const br, VP8Decoder* const dec); - -// in quant.c -void VP8ParseQuant(VP8Decoder* const dec); - -// in frame.c -int VP8InitFrame(VP8Decoder* const dec, VP8Io* io); -// Predict a block and add residual -void VP8ReconstructBlock(VP8Decoder* const dec); -// Call io->setup() and finish setting up scan parameters. -// After this call returns, one must always call VP8ExitCritical() with the -// same parameters. Both functions should be used in pair. Returns VP8_STATUS_OK -// if ok, otherwise sets and returns the error status on *dec. -VP8StatusCode VP8EnterCritical(VP8Decoder* const dec, VP8Io* const io); -// Must always be called in pair with VP8EnterCritical(). -// Returns false in case of error. -int VP8ExitCritical(VP8Decoder* const dec, VP8Io* const io); -// Process the last decoded row (filtering + output) -int VP8ProcessRow(VP8Decoder* const dec, VP8Io* const io); -// Store a block, along with filtering params -void VP8StoreBlock(VP8Decoder* const dec); -// To be called at the start of a new scanline, to initialize predictors. -void VP8InitScanline(VP8Decoder* const dec); -// Decode one macroblock. Returns false if there is not enough data. -int VP8DecodeMB(VP8Decoder* const dec, VP8BitReader* const token_br); - -// in alpha.c -const uint8_t* VP8DecompressAlphaRows(VP8Decoder* const dec, - int row, int num_rows); - -// in layer.c -int VP8DecodeLayer(VP8Decoder* const dec); - -//------------------------------------------------------------------------------ - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif - -#endif /* WEBP_DEC_VP8I_H_ */ diff --git a/external/libwebp/dec/vp8l.c b/external/libwebp/dec/vp8l.c deleted file mode 100644 index 897e4395c7..0000000000 --- a/external/libwebp/dec/vp8l.c +++ /dev/null @@ -1,1200 +0,0 @@ -// Copyright 2012 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// main entry for the decoder -// -// Authors: Vikas Arora (vikaas.arora@gmail.com) -// Jyrki Alakuijala (jyrki@google.com) - -#include <stdio.h> -#include <stdlib.h> -#include "./vp8li.h" -#include "../dsp/lossless.h" -#include "../dsp/yuv.h" -#include "../utils/huffman.h" -#include "../utils/utils.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -#define NUM_ARGB_CACHE_ROWS 16 - -static const int kCodeLengthLiterals = 16; -static const int kCodeLengthRepeatCode = 16; -static const int kCodeLengthExtraBits[3] = { 2, 3, 7 }; -static const int kCodeLengthRepeatOffsets[3] = { 3, 3, 11 }; - -// ----------------------------------------------------------------------------- -// Five Huffman codes are used at each meta code: -// 1. green + length prefix codes + color cache codes, -// 2. alpha, -// 3. red, -// 4. blue, and, -// 5. distance prefix codes. -typedef enum { - GREEN = 0, - RED = 1, - BLUE = 2, - ALPHA = 3, - DIST = 4 -} HuffIndex; - -static const uint16_t kAlphabetSize[HUFFMAN_CODES_PER_META_CODE] = { - NUM_LITERAL_CODES + NUM_LENGTH_CODES, - NUM_LITERAL_CODES, NUM_LITERAL_CODES, NUM_LITERAL_CODES, - NUM_DISTANCE_CODES -}; - - -#define NUM_CODE_LENGTH_CODES 19 -static const uint8_t kCodeLengthCodeOrder[NUM_CODE_LENGTH_CODES] = { - 17, 18, 0, 1, 2, 3, 4, 5, 16, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 -}; - -#define CODE_TO_PLANE_CODES 120 -static const uint8_t code_to_plane_lut[CODE_TO_PLANE_CODES] = { - 0x18, 0x07, 0x17, 0x19, 0x28, 0x06, 0x27, 0x29, 0x16, 0x1a, - 0x26, 0x2a, 0x38, 0x05, 0x37, 0x39, 0x15, 0x1b, 0x36, 0x3a, - 0x25, 0x2b, 0x48, 0x04, 0x47, 0x49, 0x14, 0x1c, 0x35, 0x3b, - 0x46, 0x4a, 0x24, 0x2c, 0x58, 0x45, 0x4b, 0x34, 0x3c, 0x03, - 0x57, 0x59, 0x13, 0x1d, 0x56, 0x5a, 0x23, 0x2d, 0x44, 0x4c, - 0x55, 0x5b, 0x33, 0x3d, 0x68, 0x02, 0x67, 0x69, 0x12, 0x1e, - 0x66, 0x6a, 0x22, 0x2e, 0x54, 0x5c, 0x43, 0x4d, 0x65, 0x6b, - 0x32, 0x3e, 0x78, 0x01, 0x77, 0x79, 0x53, 0x5d, 0x11, 0x1f, - 0x64, 0x6c, 0x42, 0x4e, 0x76, 0x7a, 0x21, 0x2f, 0x75, 0x7b, - 0x31, 0x3f, 0x63, 0x6d, 0x52, 0x5e, 0x00, 0x74, 0x7c, 0x41, - 0x4f, 0x10, 0x20, 0x62, 0x6e, 0x30, 0x73, 0x7d, 0x51, 0x5f, - 0x40, 0x72, 0x7e, 0x61, 0x6f, 0x50, 0x71, 0x7f, 0x60, 0x70 -}; - -static int DecodeImageStream(int xsize, int ysize, - int is_level0, - VP8LDecoder* const dec, - uint32_t** const decoded_data); - -//------------------------------------------------------------------------------ - -int VP8LCheckSignature(const uint8_t* const data, size_t size) { - return (size >= 1) && (data[0] == VP8L_MAGIC_BYTE); -} - -static int ReadImageInfo(VP8LBitReader* const br, - int* const width, int* const height, - int* const has_alpha) { - const uint8_t signature = VP8LReadBits(br, 8); - if (!VP8LCheckSignature(&signature, 1)) { - return 0; - } - *width = VP8LReadBits(br, VP8L_IMAGE_SIZE_BITS) + 1; - *height = VP8LReadBits(br, VP8L_IMAGE_SIZE_BITS) + 1; - *has_alpha = VP8LReadBits(br, 1); - VP8LReadBits(br, VP8L_VERSION_BITS); // Read/ignore the version number. - return 1; -} - -int VP8LGetInfo(const uint8_t* data, size_t data_size, - int* const width, int* const height, int* const has_alpha) { - if (data == NULL || data_size < VP8L_FRAME_HEADER_SIZE) { - return 0; // not enough data - } else { - int w, h, a; - VP8LBitReader br; - VP8LInitBitReader(&br, data, data_size); - if (!ReadImageInfo(&br, &w, &h, &a)) { - return 0; - } - if (width != NULL) *width = w; - if (height != NULL) *height = h; - if (has_alpha != NULL) *has_alpha = a; - return 1; - } -} - -//------------------------------------------------------------------------------ - -static WEBP_INLINE int GetCopyDistance(int distance_symbol, - VP8LBitReader* const br) { - int extra_bits, offset; - if (distance_symbol < 4) { - return distance_symbol + 1; - } - extra_bits = (distance_symbol - 2) >> 1; - offset = (2 + (distance_symbol & 1)) << extra_bits; - return offset + VP8LReadBits(br, extra_bits) + 1; -} - -static WEBP_INLINE int GetCopyLength(int length_symbol, - VP8LBitReader* const br) { - // Length and distance prefixes are encoded the same way. - return GetCopyDistance(length_symbol, br); -} - -static WEBP_INLINE int PlaneCodeToDistance(int xsize, int plane_code) { - if (plane_code > CODE_TO_PLANE_CODES) { - return plane_code - CODE_TO_PLANE_CODES; - } else { - const int dist_code = code_to_plane_lut[plane_code - 1]; - const int yoffset = dist_code >> 4; - const int xoffset = 8 - (dist_code & 0xf); - const int dist = yoffset * xsize + xoffset; - return (dist >= 1) ? dist : 1; - } -} - -//------------------------------------------------------------------------------ -// Decodes the next Huffman code from bit-stream. -// FillBitWindow(br) needs to be called at minimum every second call -// to ReadSymbolUnsafe. -static int ReadSymbolUnsafe(const HuffmanTree* tree, VP8LBitReader* const br) { - const HuffmanTreeNode* node = tree->root_; - assert(node != NULL); - while (!HuffmanTreeNodeIsLeaf(node)) { - node = HuffmanTreeNextNode(node, VP8LReadOneBitUnsafe(br)); - } - return node->symbol_; -} - -static WEBP_INLINE int ReadSymbol(const HuffmanTree* tree, - VP8LBitReader* const br) { - const int read_safe = (br->pos_ + 8 > br->len_); - if (!read_safe) { - return ReadSymbolUnsafe(tree, br); - } else { - const HuffmanTreeNode* node = tree->root_; - assert(node != NULL); - while (!HuffmanTreeNodeIsLeaf(node)) { - node = HuffmanTreeNextNode(node, VP8LReadOneBit(br)); - } - return node->symbol_; - } -} - -static int ReadHuffmanCodeLengths( - VP8LDecoder* const dec, const int* const code_length_code_lengths, - int num_symbols, int* const code_lengths) { - int ok = 0; - VP8LBitReader* const br = &dec->br_; - int symbol; - int max_symbol; - int prev_code_len = DEFAULT_CODE_LENGTH; - HuffmanTree tree; - - if (!HuffmanTreeBuildImplicit(&tree, code_length_code_lengths, - NUM_CODE_LENGTH_CODES)) { - dec->status_ = VP8_STATUS_BITSTREAM_ERROR; - return 0; - } - - if (VP8LReadBits(br, 1)) { // use length - const int length_nbits = 2 + 2 * VP8LReadBits(br, 3); - max_symbol = 2 + VP8LReadBits(br, length_nbits); - if (max_symbol > num_symbols) { - dec->status_ = VP8_STATUS_BITSTREAM_ERROR; - goto End; - } - } else { - max_symbol = num_symbols; - } - - symbol = 0; - while (symbol < num_symbols) { - int code_len; - if (max_symbol-- == 0) break; - VP8LFillBitWindow(br); - code_len = ReadSymbol(&tree, br); - if (code_len < kCodeLengthLiterals) { - code_lengths[symbol++] = code_len; - if (code_len != 0) prev_code_len = code_len; - } else { - const int use_prev = (code_len == kCodeLengthRepeatCode); - const int slot = code_len - kCodeLengthLiterals; - const int extra_bits = kCodeLengthExtraBits[slot]; - const int repeat_offset = kCodeLengthRepeatOffsets[slot]; - int repeat = VP8LReadBits(br, extra_bits) + repeat_offset; - if (symbol + repeat > num_symbols) { - dec->status_ = VP8_STATUS_BITSTREAM_ERROR; - goto End; - } else { - const int length = use_prev ? prev_code_len : 0; - while (repeat-- > 0) code_lengths[symbol++] = length; - } - } - } - ok = 1; - - End: - HuffmanTreeRelease(&tree); - return ok; -} - -static int ReadHuffmanCode(int alphabet_size, VP8LDecoder* const dec, - HuffmanTree* const tree) { - int ok = 0; - VP8LBitReader* const br = &dec->br_; - const int simple_code = VP8LReadBits(br, 1); - - if (simple_code) { // Read symbols, codes & code lengths directly. - int symbols[2]; - int codes[2]; - int code_lengths[2]; - const int num_symbols = VP8LReadBits(br, 1) + 1; - const int first_symbol_len_code = VP8LReadBits(br, 1); - // The first code is either 1 bit or 8 bit code. - symbols[0] = VP8LReadBits(br, (first_symbol_len_code == 0) ? 1 : 8); - codes[0] = 0; - code_lengths[0] = num_symbols - 1; - // The second code (if present), is always 8 bit long. - if (num_symbols == 2) { - symbols[1] = VP8LReadBits(br, 8); - codes[1] = 1; - code_lengths[1] = num_symbols - 1; - } - ok = HuffmanTreeBuildExplicit(tree, code_lengths, codes, symbols, - alphabet_size, num_symbols); - } else { // Decode Huffman-coded code lengths. - int* code_lengths = NULL; - int i; - int code_length_code_lengths[NUM_CODE_LENGTH_CODES] = { 0 }; - const int num_codes = VP8LReadBits(br, 4) + 4; - if (num_codes > NUM_CODE_LENGTH_CODES) { - dec->status_ = VP8_STATUS_BITSTREAM_ERROR; - return 0; - } - - code_lengths = - (int*)WebPSafeCalloc((uint64_t)alphabet_size, sizeof(*code_lengths)); - if (code_lengths == NULL) { - dec->status_ = VP8_STATUS_OUT_OF_MEMORY; - return 0; - } - - for (i = 0; i < num_codes; ++i) { - code_length_code_lengths[kCodeLengthCodeOrder[i]] = VP8LReadBits(br, 3); - } - ok = ReadHuffmanCodeLengths(dec, code_length_code_lengths, alphabet_size, - code_lengths); - if (ok) { - ok = HuffmanTreeBuildImplicit(tree, code_lengths, alphabet_size); - } - free(code_lengths); - } - ok = ok && !br->error_; - if (!ok) { - dec->status_ = VP8_STATUS_BITSTREAM_ERROR; - return 0; - } - return 1; -} - -static void DeleteHtreeGroups(HTreeGroup* htree_groups, int num_htree_groups) { - if (htree_groups != NULL) { - int i, j; - for (i = 0; i < num_htree_groups; ++i) { - HuffmanTree* const htrees = htree_groups[i].htrees_; - for (j = 0; j < HUFFMAN_CODES_PER_META_CODE; ++j) { - HuffmanTreeRelease(&htrees[j]); - } - } - free(htree_groups); - } -} - -static int ReadHuffmanCodes(VP8LDecoder* const dec, int xsize, int ysize, - int color_cache_bits, int allow_recursion) { - int i, j; - VP8LBitReader* const br = &dec->br_; - VP8LMetadata* const hdr = &dec->hdr_; - uint32_t* huffman_image = NULL; - HTreeGroup* htree_groups = NULL; - int num_htree_groups = 1; - - if (allow_recursion && VP8LReadBits(br, 1)) { - // use meta Huffman codes. - const int huffman_precision = VP8LReadBits(br, 3) + 2; - const int huffman_xsize = VP8LSubSampleSize(xsize, huffman_precision); - const int huffman_ysize = VP8LSubSampleSize(ysize, huffman_precision); - const int huffman_pixs = huffman_xsize * huffman_ysize; - if (!DecodeImageStream(huffman_xsize, huffman_ysize, 0, dec, - &huffman_image)) { - dec->status_ = VP8_STATUS_BITSTREAM_ERROR; - goto Error; - } - hdr->huffman_subsample_bits_ = huffman_precision; - for (i = 0; i < huffman_pixs; ++i) { - // The huffman data is stored in red and green bytes. - const int index = (huffman_image[i] >> 8) & 0xffff; - huffman_image[i] = index; - if (index >= num_htree_groups) { - num_htree_groups = index + 1; - } - } - } - - if (br->error_) goto Error; - - assert(num_htree_groups <= 0x10000); - htree_groups = - (HTreeGroup*)WebPSafeCalloc((uint64_t)num_htree_groups, - sizeof(*htree_groups)); - if (htree_groups == NULL) { - dec->status_ = VP8_STATUS_OUT_OF_MEMORY; - goto Error; - } - - for (i = 0; i < num_htree_groups; ++i) { - HuffmanTree* const htrees = htree_groups[i].htrees_; - for (j = 0; j < HUFFMAN_CODES_PER_META_CODE; ++j) { - int alphabet_size = kAlphabetSize[j]; - if (j == 0 && color_cache_bits > 0) { - alphabet_size += 1 << color_cache_bits; - } - if (!ReadHuffmanCode(alphabet_size, dec, htrees + j)) goto Error; - } - } - - // All OK. Finalize pointers and return. - hdr->huffman_image_ = huffman_image; - hdr->num_htree_groups_ = num_htree_groups; - hdr->htree_groups_ = htree_groups; - return 1; - - Error: - free(huffman_image); - DeleteHtreeGroups(htree_groups, num_htree_groups); - return 0; -} - -//------------------------------------------------------------------------------ -// Scaling. - -static int AllocateAndInitRescaler(VP8LDecoder* const dec, VP8Io* const io) { - const int num_channels = 4; - const int in_width = io->mb_w; - const int out_width = io->scaled_width; - const int in_height = io->mb_h; - const int out_height = io->scaled_height; - const uint64_t work_size = 2 * num_channels * (uint64_t)out_width; - int32_t* work; // Rescaler work area. - const uint64_t scaled_data_size = num_channels * (uint64_t)out_width; - uint32_t* scaled_data; // Temporary storage for scaled BGRA data. - const uint64_t memory_size = sizeof(*dec->rescaler) + - work_size * sizeof(*work) + - scaled_data_size * sizeof(*scaled_data); - uint8_t* memory = (uint8_t*)WebPSafeCalloc(memory_size, sizeof(*memory)); - if (memory == NULL) { - dec->status_ = VP8_STATUS_OUT_OF_MEMORY; - return 0; - } - assert(dec->rescaler_memory == NULL); - dec->rescaler_memory = memory; - - dec->rescaler = (WebPRescaler*)memory; - memory += sizeof(*dec->rescaler); - work = (int32_t*)memory; - memory += work_size * sizeof(*work); - scaled_data = (uint32_t*)memory; - - WebPRescalerInit(dec->rescaler, in_width, in_height, (uint8_t*)scaled_data, - out_width, out_height, 0, num_channels, - in_width, out_width, in_height, out_height, work); - return 1; -} - -//------------------------------------------------------------------------------ -// Export to ARGB - -// We have special "export" function since we need to convert from BGRA -static int Export(WebPRescaler* const rescaler, WEBP_CSP_MODE colorspace, - int rgba_stride, uint8_t* const rgba) { - const uint32_t* const src = (const uint32_t*)rescaler->dst; - const int dst_width = rescaler->dst_width; - int num_lines_out = 0; - while (WebPRescalerHasPendingOutput(rescaler)) { - uint8_t* const dst = rgba + num_lines_out * rgba_stride; - WebPRescalerExportRow(rescaler); - VP8LConvertFromBGRA(src, dst_width, colorspace, dst); - ++num_lines_out; - } - return num_lines_out; -} - -// Emit scaled rows. -static int EmitRescaledRows(const VP8LDecoder* const dec, - const uint32_t* const data, int in_stride, int mb_h, - uint8_t* const out, int out_stride) { - const WEBP_CSP_MODE colorspace = dec->output_->colorspace; - const uint8_t* const in = (const uint8_t*)data; - int num_lines_in = 0; - int num_lines_out = 0; - while (num_lines_in < mb_h) { - const uint8_t* const row_in = in + num_lines_in * in_stride; - uint8_t* const row_out = out + num_lines_out * out_stride; - num_lines_in += WebPRescalerImport(dec->rescaler, mb_h - num_lines_in, - row_in, in_stride); - num_lines_out += Export(dec->rescaler, colorspace, out_stride, row_out); - } - return num_lines_out; -} - -// Emit rows without any scaling. -static int EmitRows(WEBP_CSP_MODE colorspace, - const uint32_t* const data, int in_stride, - int mb_w, int mb_h, - uint8_t* const out, int out_stride) { - int lines = mb_h; - const uint8_t* row_in = (const uint8_t*)data; - uint8_t* row_out = out; - while (lines-- > 0) { - VP8LConvertFromBGRA((const uint32_t*)row_in, mb_w, colorspace, row_out); - row_in += in_stride; - row_out += out_stride; - } - return mb_h; // Num rows out == num rows in. -} - -//------------------------------------------------------------------------------ -// Export to YUVA - -static void ConvertToYUVA(const uint32_t* const src, int width, int y_pos, - const WebPDecBuffer* const output) { - const WebPYUVABuffer* const buf = &output->u.YUVA; - // first, the luma plane - { - int i; - uint8_t* const y = buf->y + y_pos * buf->y_stride; - for (i = 0; i < width; ++i) { - const uint32_t p = src[i]; - y[i] = VP8RGBToY((p >> 16) & 0xff, (p >> 8) & 0xff, (p >> 0) & 0xff); - } - } - - // then U/V planes - { - uint8_t* const u = buf->u + (y_pos >> 1) * buf->u_stride; - uint8_t* const v = buf->v + (y_pos >> 1) * buf->v_stride; - const int uv_width = width >> 1; - int i; - for (i = 0; i < uv_width; ++i) { - const uint32_t v0 = src[2 * i + 0]; - const uint32_t v1 = src[2 * i + 1]; - // VP8RGBToU/V expects four accumulated pixels. Hence we need to - // scale r/g/b value by a factor 2. We just shift v0/v1 one bit less. - const int r = ((v0 >> 15) & 0x1fe) + ((v1 >> 15) & 0x1fe); - const int g = ((v0 >> 7) & 0x1fe) + ((v1 >> 7) & 0x1fe); - const int b = ((v0 << 1) & 0x1fe) + ((v1 << 1) & 0x1fe); - if (!(y_pos & 1)) { // even lines: store values - u[i] = VP8RGBToU(r, g, b); - v[i] = VP8RGBToV(r, g, b); - } else { // odd lines: average with previous values - const int tmp_u = VP8RGBToU(r, g, b); - const int tmp_v = VP8RGBToV(r, g, b); - // Approximated average-of-four. But it's an acceptable diff. - u[i] = (u[i] + tmp_u + 1) >> 1; - v[i] = (v[i] + tmp_v + 1) >> 1; - } - } - if (width & 1) { // last pixel - const uint32_t v0 = src[2 * i + 0]; - const int r = (v0 >> 14) & 0x3fc; - const int g = (v0 >> 6) & 0x3fc; - const int b = (v0 << 2) & 0x3fc; - if (!(y_pos & 1)) { // even lines - u[i] = VP8RGBToU(r, g, b); - v[i] = VP8RGBToV(r, g, b); - } else { // odd lines (note: we could just skip this) - const int tmp_u = VP8RGBToU(r, g, b); - const int tmp_v = VP8RGBToV(r, g, b); - u[i] = (u[i] + tmp_u + 1) >> 1; - v[i] = (v[i] + tmp_v + 1) >> 1; - } - } - } - // Lastly, store alpha if needed. - if (buf->a != NULL) { - int i; - uint8_t* const a = buf->a + y_pos * buf->a_stride; - for (i = 0; i < width; ++i) a[i] = (src[i] >> 24); - } -} - -static int ExportYUVA(const VP8LDecoder* const dec, int y_pos) { - WebPRescaler* const rescaler = dec->rescaler; - const uint32_t* const src = (const uint32_t*)rescaler->dst; - const int dst_width = rescaler->dst_width; - int num_lines_out = 0; - while (WebPRescalerHasPendingOutput(rescaler)) { - WebPRescalerExportRow(rescaler); - ConvertToYUVA(src, dst_width, y_pos, dec->output_); - ++y_pos; - ++num_lines_out; - } - return num_lines_out; -} - -static int EmitRescaledRowsYUVA(const VP8LDecoder* const dec, - const uint32_t* const data, - int in_stride, int mb_h) { - const uint8_t* const in = (const uint8_t*)data; - int num_lines_in = 0; - int y_pos = dec->last_out_row_; - while (num_lines_in < mb_h) { - const uint8_t* const row_in = in + num_lines_in * in_stride; - num_lines_in += WebPRescalerImport(dec->rescaler, mb_h - num_lines_in, - row_in, in_stride); - y_pos += ExportYUVA(dec, y_pos); - } - return y_pos; -} - -static int EmitRowsYUVA(const VP8LDecoder* const dec, - const uint32_t* const data, int in_stride, - int mb_w, int num_rows) { - int y_pos = dec->last_out_row_; - const uint8_t* row_in = (const uint8_t*)data; - while (num_rows-- > 0) { - ConvertToYUVA((const uint32_t*)row_in, mb_w, y_pos, dec->output_); - row_in += in_stride; - ++y_pos; - } - return y_pos; -} - -//------------------------------------------------------------------------------ -// Cropping. - -// Sets io->mb_y, io->mb_h & io->mb_w according to start row, end row and -// crop options. Also updates the input data pointer, so that it points to the -// start of the cropped window. -// Note that 'pixel_stride' is in units of 'uint32_t' (and not 'bytes). -// Returns true if the crop window is not empty. -static int SetCropWindow(VP8Io* const io, int y_start, int y_end, - const uint32_t** const in_data, int pixel_stride) { - assert(y_start < y_end); - assert(io->crop_left < io->crop_right); - if (y_end > io->crop_bottom) { - y_end = io->crop_bottom; // make sure we don't overflow on last row. - } - if (y_start < io->crop_top) { - const int delta = io->crop_top - y_start; - y_start = io->crop_top; - *in_data += pixel_stride * delta; - } - if (y_start >= y_end) return 0; // Crop window is empty. - - *in_data += io->crop_left; - - io->mb_y = y_start - io->crop_top; - io->mb_w = io->crop_right - io->crop_left; - io->mb_h = y_end - y_start; - return 1; // Non-empty crop window. -} - -//------------------------------------------------------------------------------ - -static WEBP_INLINE int GetMetaIndex( - const uint32_t* const image, int xsize, int bits, int x, int y) { - if (bits == 0) return 0; - return image[xsize * (y >> bits) + (x >> bits)]; -} - -static WEBP_INLINE HTreeGroup* GetHtreeGroupForPos(VP8LMetadata* const hdr, - int x, int y) { - const int meta_index = GetMetaIndex(hdr->huffman_image_, hdr->huffman_xsize_, - hdr->huffman_subsample_bits_, x, y); - assert(meta_index < hdr->num_htree_groups_); - return hdr->htree_groups_ + meta_index; -} - -//------------------------------------------------------------------------------ -// Main loop, with custom row-processing function - -typedef void (*ProcessRowsFunc)(VP8LDecoder* const dec, int row); - -static void ApplyInverseTransforms(VP8LDecoder* const dec, int num_rows, - const uint32_t* const rows) { - int n = dec->next_transform_; - const int cache_pixs = dec->width_ * num_rows; - const int start_row = dec->last_row_; - const int end_row = start_row + num_rows; - const uint32_t* rows_in = rows; - uint32_t* const rows_out = dec->argb_cache_; - - // Inverse transforms. - // TODO: most transforms only need to operate on the cropped region only. - memcpy(rows_out, rows_in, cache_pixs * sizeof(*rows_out)); - while (n-- > 0) { - VP8LTransform* const transform = &dec->transforms_[n]; - VP8LInverseTransform(transform, start_row, end_row, rows_in, rows_out); - rows_in = rows_out; - } -} - -// Processes (transforms, scales & color-converts) the rows decoded after the -// last call. -static void ProcessRows(VP8LDecoder* const dec, int row) { - const uint32_t* const rows = dec->argb_ + dec->width_ * dec->last_row_; - const int num_rows = row - dec->last_row_; - - if (num_rows <= 0) return; // Nothing to be done. - ApplyInverseTransforms(dec, num_rows, rows); - - // Emit output. - { - VP8Io* const io = dec->io_; - const uint32_t* rows_data = dec->argb_cache_; - if (!SetCropWindow(io, dec->last_row_, row, &rows_data, io->width)) { - // Nothing to output (this time). - } else { - const WebPDecBuffer* const output = dec->output_; - const int in_stride = io->width * sizeof(*rows_data); - if (output->colorspace < MODE_YUV) { // convert to RGBA - const WebPRGBABuffer* const buf = &output->u.RGBA; - uint8_t* const rgba = buf->rgba + dec->last_out_row_ * buf->stride; - const int num_rows_out = io->use_scaling ? - EmitRescaledRows(dec, rows_data, in_stride, io->mb_h, - rgba, buf->stride) : - EmitRows(output->colorspace, rows_data, in_stride, - io->mb_w, io->mb_h, rgba, buf->stride); - // Update 'last_out_row_'. - dec->last_out_row_ += num_rows_out; - } else { // convert to YUVA - dec->last_out_row_ = io->use_scaling ? - EmitRescaledRowsYUVA(dec, rows_data, in_stride, io->mb_h) : - EmitRowsYUVA(dec, rows_data, in_stride, io->mb_w, io->mb_h); - } - assert(dec->last_out_row_ <= output->height); - } - } - - // Update 'last_row_'. - dec->last_row_ = row; - assert(dec->last_row_ <= dec->height_); -} - -static int DecodeImageData(VP8LDecoder* const dec, - uint32_t* const data, int width, int height, - ProcessRowsFunc process_func) { - int ok = 1; - int col = 0, row = 0; - VP8LBitReader* const br = &dec->br_; - VP8LMetadata* const hdr = &dec->hdr_; - HTreeGroup* htree_group = hdr->htree_groups_; - uint32_t* src = data; - uint32_t* last_cached = data; - uint32_t* const src_end = data + width * height; - const int len_code_limit = NUM_LITERAL_CODES + NUM_LENGTH_CODES; - const int color_cache_limit = len_code_limit + hdr->color_cache_size_; - VP8LColorCache* const color_cache = - (hdr->color_cache_size_ > 0) ? &hdr->color_cache_ : NULL; - const int mask = hdr->huffman_mask_; - - assert(htree_group != NULL); - - while (!br->eos_ && src < src_end) { - int code; - // Only update when changing tile. Note we could use the following test: - // if "((((prev_col ^ col) | prev_row ^ row)) > mask)" -> tile changed - // but that's actually slower and requires storing the previous col/row - if ((col & mask) == 0) { - htree_group = GetHtreeGroupForPos(hdr, col, row); - } - VP8LFillBitWindow(br); - code = ReadSymbol(&htree_group->htrees_[GREEN], br); - if (code < NUM_LITERAL_CODES) { // Literal. - int red, green, blue, alpha; - red = ReadSymbol(&htree_group->htrees_[RED], br); - green = code; - VP8LFillBitWindow(br); - blue = ReadSymbol(&htree_group->htrees_[BLUE], br); - alpha = ReadSymbol(&htree_group->htrees_[ALPHA], br); - *src = (alpha << 24) + (red << 16) + (green << 8) + blue; - AdvanceByOne: - ++src; - ++col; - if (col >= width) { - col = 0; - ++row; - if ((process_func != NULL) && (row % NUM_ARGB_CACHE_ROWS == 0)) { - process_func(dec, row); - } - if (color_cache != NULL) { - while (last_cached < src) { - VP8LColorCacheInsert(color_cache, *last_cached++); - } - } - } - } else if (code < len_code_limit) { // Backward reference - int dist_code, dist; - const int length_sym = code - NUM_LITERAL_CODES; - const int length = GetCopyLength(length_sym, br); - const int dist_symbol = ReadSymbol(&htree_group->htrees_[DIST], br); - VP8LFillBitWindow(br); - dist_code = GetCopyDistance(dist_symbol, br); - dist = PlaneCodeToDistance(width, dist_code); - if (src - data < dist || src_end - src < length) { - ok = 0; - goto End; - } - { - int i; - for (i = 0; i < length; ++i) src[i] = src[i - dist]; - src += length; - } - col += length; - while (col >= width) { - col -= width; - ++row; - if ((process_func != NULL) && (row % NUM_ARGB_CACHE_ROWS == 0)) { - process_func(dec, row); - } - } - if (src < src_end) { - htree_group = GetHtreeGroupForPos(hdr, col, row); - if (color_cache != NULL) { - while (last_cached < src) { - VP8LColorCacheInsert(color_cache, *last_cached++); - } - } - } - } else if (code < color_cache_limit) { // Color cache. - const int key = code - len_code_limit; - assert(color_cache != NULL); - while (last_cached < src) { - VP8LColorCacheInsert(color_cache, *last_cached++); - } - *src = VP8LColorCacheLookup(color_cache, key); - goto AdvanceByOne; - } else { // Not reached. - ok = 0; - goto End; - } - ok = !br->error_; - if (!ok) goto End; - } - // Process the remaining rows corresponding to last row-block. - if (process_func != NULL) process_func(dec, row); - - End: - if (br->error_ || !ok || (br->eos_ && src < src_end)) { - ok = 0; - dec->status_ = (!br->eos_) ? - VP8_STATUS_BITSTREAM_ERROR : VP8_STATUS_SUSPENDED; - } else if (src == src_end) { - dec->state_ = READ_DATA; - } - - return ok; -} - -// ----------------------------------------------------------------------------- -// VP8LTransform - -static void ClearTransform(VP8LTransform* const transform) { - free(transform->data_); - transform->data_ = NULL; -} - -// For security reason, we need to remap the color map to span -// the total possible bundled values, and not just the num_colors. -static int ExpandColorMap(int num_colors, VP8LTransform* const transform) { - int i; - const int final_num_colors = 1 << (8 >> transform->bits_); - uint32_t* const new_color_map = - (uint32_t*)WebPSafeMalloc((uint64_t)final_num_colors, - sizeof(*new_color_map)); - if (new_color_map == NULL) { - return 0; - } else { - uint8_t* const data = (uint8_t*)transform->data_; - uint8_t* const new_data = (uint8_t*)new_color_map; - new_color_map[0] = transform->data_[0]; - for (i = 4; i < 4 * num_colors; ++i) { - // Equivalent to AddPixelEq(), on a byte-basis. - new_data[i] = (data[i] + new_data[i - 4]) & 0xff; - } - for (; i < 4 * final_num_colors; ++i) - new_data[i] = 0; // black tail. - free(transform->data_); - transform->data_ = new_color_map; - } - return 1; -} - -static int ReadTransform(int* const xsize, int const* ysize, - VP8LDecoder* const dec) { - int ok = 1; - VP8LBitReader* const br = &dec->br_; - VP8LTransform* transform = &dec->transforms_[dec->next_transform_]; - const VP8LImageTransformType type = - (VP8LImageTransformType)VP8LReadBits(br, 2); - - // Each transform type can only be present once in the stream. - if (dec->transforms_seen_ & (1U << type)) { - return 0; // Already there, let's not accept the second same transform. - } - dec->transforms_seen_ |= (1U << type); - - transform->type_ = type; - transform->xsize_ = *xsize; - transform->ysize_ = *ysize; - transform->data_ = NULL; - ++dec->next_transform_; - assert(dec->next_transform_ <= NUM_TRANSFORMS); - - switch (type) { - case PREDICTOR_TRANSFORM: - case CROSS_COLOR_TRANSFORM: - transform->bits_ = VP8LReadBits(br, 3) + 2; - ok = DecodeImageStream(VP8LSubSampleSize(transform->xsize_, - transform->bits_), - VP8LSubSampleSize(transform->ysize_, - transform->bits_), - 0, dec, &transform->data_); - break; - case COLOR_INDEXING_TRANSFORM: { - const int num_colors = VP8LReadBits(br, 8) + 1; - const int bits = (num_colors > 16) ? 0 - : (num_colors > 4) ? 1 - : (num_colors > 2) ? 2 - : 3; - *xsize = VP8LSubSampleSize(transform->xsize_, bits); - transform->bits_ = bits; - ok = DecodeImageStream(num_colors, 1, 0, dec, &transform->data_); - ok = ok && ExpandColorMap(num_colors, transform); - break; - } - case SUBTRACT_GREEN: - break; - default: - assert(0); // can't happen - break; - } - - return ok; -} - -// ----------------------------------------------------------------------------- -// VP8LMetadata - -static void InitMetadata(VP8LMetadata* const hdr) { - assert(hdr); - memset(hdr, 0, sizeof(*hdr)); -} - -static void ClearMetadata(VP8LMetadata* const hdr) { - assert(hdr); - - free(hdr->huffman_image_); - DeleteHtreeGroups(hdr->htree_groups_, hdr->num_htree_groups_); - VP8LColorCacheClear(&hdr->color_cache_); - InitMetadata(hdr); -} - -// ----------------------------------------------------------------------------- -// VP8LDecoder - -VP8LDecoder* VP8LNew(void) { - VP8LDecoder* const dec = (VP8LDecoder*)calloc(1, sizeof(*dec)); - if (dec == NULL) return NULL; - dec->status_ = VP8_STATUS_OK; - dec->action_ = READ_DIM; - dec->state_ = READ_DIM; - return dec; -} - -void VP8LClear(VP8LDecoder* const dec) { - int i; - if (dec == NULL) return; - ClearMetadata(&dec->hdr_); - - free(dec->argb_); - dec->argb_ = NULL; - for (i = 0; i < dec->next_transform_; ++i) { - ClearTransform(&dec->transforms_[i]); - } - dec->next_transform_ = 0; - dec->transforms_seen_ = 0; - - free(dec->rescaler_memory); - dec->rescaler_memory = NULL; - - dec->output_ = NULL; // leave no trace behind -} - -void VP8LDelete(VP8LDecoder* const dec) { - if (dec != NULL) { - VP8LClear(dec); - free(dec); - } -} - -static void UpdateDecoder(VP8LDecoder* const dec, int width, int height) { - VP8LMetadata* const hdr = &dec->hdr_; - const int num_bits = hdr->huffman_subsample_bits_; - dec->width_ = width; - dec->height_ = height; - - hdr->huffman_xsize_ = VP8LSubSampleSize(width, num_bits); - hdr->huffman_mask_ = (num_bits == 0) ? ~0 : (1 << num_bits) - 1; -} - -static int DecodeImageStream(int xsize, int ysize, - int is_level0, - VP8LDecoder* const dec, - uint32_t** const decoded_data) { - int ok = 1; - int transform_xsize = xsize; - int transform_ysize = ysize; - VP8LBitReader* const br = &dec->br_; - VP8LMetadata* const hdr = &dec->hdr_; - uint32_t* data = NULL; - int color_cache_bits = 0; - - // Read the transforms (may recurse). - if (is_level0) { - while (ok && VP8LReadBits(br, 1)) { - ok = ReadTransform(&transform_xsize, &transform_ysize, dec); - } - } - - // Color cache - if (ok && VP8LReadBits(br, 1)) { - color_cache_bits = VP8LReadBits(br, 4); - ok = (color_cache_bits >= 1 && color_cache_bits <= MAX_CACHE_BITS); - if (!ok) { - dec->status_ = VP8_STATUS_BITSTREAM_ERROR; - goto End; - } - } - - // Read the Huffman codes (may recurse). - ok = ok && ReadHuffmanCodes(dec, transform_xsize, transform_ysize, - color_cache_bits, is_level0); - if (!ok) { - dec->status_ = VP8_STATUS_BITSTREAM_ERROR; - goto End; - } - - // Finish setting up the color-cache - if (color_cache_bits > 0) { - hdr->color_cache_size_ = 1 << color_cache_bits; - if (!VP8LColorCacheInit(&hdr->color_cache_, color_cache_bits)) { - dec->status_ = VP8_STATUS_OUT_OF_MEMORY; - ok = 0; - goto End; - } - } else { - hdr->color_cache_size_ = 0; - } - UpdateDecoder(dec, transform_xsize, transform_ysize); - - if (is_level0) { // level 0 complete - dec->state_ = READ_HDR; - goto End; - } - - { - const uint64_t total_size = (uint64_t)transform_xsize * transform_ysize; - data = (uint32_t*)WebPSafeMalloc(total_size, sizeof(*data)); - if (data == NULL) { - dec->status_ = VP8_STATUS_OUT_OF_MEMORY; - ok = 0; - goto End; - } - } - - // Use the Huffman trees to decode the LZ77 encoded data. - ok = DecodeImageData(dec, data, transform_xsize, transform_ysize, NULL); - ok = ok && !br->error_; - - End: - - if (!ok) { - free(data); - ClearMetadata(hdr); - // If not enough data (br.eos_) resulted in BIT_STREAM_ERROR, update the - // status appropriately. - if (dec->status_ == VP8_STATUS_BITSTREAM_ERROR && dec->br_.eos_) { - dec->status_ = VP8_STATUS_SUSPENDED; - } - } else { - if (decoded_data != NULL) { - *decoded_data = data; - } else { - // We allocate image data in this function only for transforms. At level 0 - // (that is: not the transforms), we shouldn't have allocated anything. - assert(data == NULL); - assert(is_level0); - } - if (!is_level0) ClearMetadata(hdr); // Clean up temporary data behind. - } - return ok; -} - -//------------------------------------------------------------------------------ -// Allocate dec->argb_ and dec->argb_cache_ using dec->width_ and dec->height_ - -static int AllocateARGBBuffers(VP8LDecoder* const dec, int final_width) { - const uint64_t num_pixels = (uint64_t)dec->width_ * dec->height_; - // Scratch buffer corresponding to top-prediction row for transforming the - // first row in the row-blocks. - const uint64_t cache_top_pixels = final_width; - // Scratch buffer for temporary BGRA storage. - const uint64_t cache_pixels = (uint64_t)final_width * NUM_ARGB_CACHE_ROWS; - const uint64_t total_num_pixels = - num_pixels + cache_top_pixels + cache_pixels; - - assert(dec->width_ <= final_width); - dec->argb_ = (uint32_t*)WebPSafeMalloc(total_num_pixels, sizeof(*dec->argb_)); - if (dec->argb_ == NULL) { - dec->argb_cache_ = NULL; // for sanity check - dec->status_ = VP8_STATUS_OUT_OF_MEMORY; - return 0; - } - dec->argb_cache_ = dec->argb_ + num_pixels + cache_top_pixels; - return 1; -} - -//------------------------------------------------------------------------------ -// Special row-processing that only stores the alpha data. - -static void ExtractAlphaRows(VP8LDecoder* const dec, int row) { - const int num_rows = row - dec->last_row_; - const uint32_t* const in = dec->argb_ + dec->width_ * dec->last_row_; - - if (num_rows <= 0) return; // Nothing to be done. - ApplyInverseTransforms(dec, num_rows, in); - - // Extract alpha (which is stored in the green plane). - { - const int width = dec->io_->width; // the final width (!= dec->width_) - const int cache_pixs = width * num_rows; - uint8_t* const dst = (uint8_t*)dec->io_->opaque + width * dec->last_row_; - const uint32_t* const src = dec->argb_cache_; - int i; - for (i = 0; i < cache_pixs; ++i) dst[i] = (src[i] >> 8) & 0xff; - } - - dec->last_row_ = dec->last_out_row_ = row; -} - -int VP8LDecodeAlphaImageStream(int width, int height, const uint8_t* const data, - size_t data_size, uint8_t* const output) { - VP8Io io; - int ok = 0; - VP8LDecoder* const dec = VP8LNew(); - if (dec == NULL) return 0; - - dec->width_ = width; - dec->height_ = height; - dec->io_ = &io; - - VP8InitIo(&io); - WebPInitCustomIo(NULL, &io); // Just a sanity Init. io won't be used. - io.opaque = output; - io.width = width; - io.height = height; - - dec->status_ = VP8_STATUS_OK; - VP8LInitBitReader(&dec->br_, data, data_size); - - dec->action_ = READ_HDR; - if (!DecodeImageStream(width, height, 1, dec, NULL)) goto Err; - - // Allocate output (note that dec->width_ may have changed here). - if (!AllocateARGBBuffers(dec, width)) goto Err; - - // Decode (with special row processing). - dec->action_ = READ_DATA; - ok = DecodeImageData(dec, dec->argb_, dec->width_, dec->height_, - ExtractAlphaRows); - - Err: - VP8LDelete(dec); - return ok; -} - -//------------------------------------------------------------------------------ - -int VP8LDecodeHeader(VP8LDecoder* const dec, VP8Io* const io) { - int width, height, has_alpha; - - if (dec == NULL) return 0; - if (io == NULL) { - dec->status_ = VP8_STATUS_INVALID_PARAM; - return 0; - } - - dec->io_ = io; - dec->status_ = VP8_STATUS_OK; - VP8LInitBitReader(&dec->br_, io->data, io->data_size); - if (!ReadImageInfo(&dec->br_, &width, &height, &has_alpha)) { - dec->status_ = VP8_STATUS_BITSTREAM_ERROR; - goto Error; - } - dec->state_ = READ_DIM; - io->width = width; - io->height = height; - - dec->action_ = READ_HDR; - if (!DecodeImageStream(width, height, 1, dec, NULL)) goto Error; - return 1; - - Error: - VP8LClear(dec); - assert(dec->status_ != VP8_STATUS_OK); - return 0; -} - -int VP8LDecodeImage(VP8LDecoder* const dec) { - VP8Io* io = NULL; - WebPDecParams* params = NULL; - - // Sanity checks. - if (dec == NULL) return 0; - - io = dec->io_; - assert(io != NULL); - params = (WebPDecParams*)io->opaque; - assert(params != NULL); - dec->output_ = params->output; - assert(dec->output_ != NULL); - - // Initialization. - if (!WebPIoInitFromOptions(params->options, io, MODE_BGRA)) { - dec->status_ = VP8_STATUS_INVALID_PARAM; - goto Err; - } - - if (!AllocateARGBBuffers(dec, io->width)) goto Err; - - if (io->use_scaling && !AllocateAndInitRescaler(dec, io)) goto Err; - - // Decode. - dec->action_ = READ_DATA; - if (!DecodeImageData(dec, dec->argb_, dec->width_, dec->height_, - ProcessRows)) { - goto Err; - } - - // Cleanup. - params->last_y = dec->last_out_row_; - VP8LClear(dec); - return 1; - - Err: - VP8LClear(dec); - assert(dec->status_ != VP8_STATUS_OK); - return 0; -} - -//------------------------------------------------------------------------------ - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif diff --git a/external/libwebp/dec/vp8li.h b/external/libwebp/dec/vp8li.h deleted file mode 100644 index ee29eb5faf..0000000000 --- a/external/libwebp/dec/vp8li.h +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright 2012 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Lossless decoder: internal header. -// -// Author: Skal (pascal.massimino@gmail.com) -// Vikas Arora(vikaas.arora@gmail.com) - -#ifndef WEBP_DEC_VP8LI_H_ -#define WEBP_DEC_VP8LI_H_ - -#include <string.h> // for memcpy() -#include "./webpi.h" -#include "../utils/bit_reader.h" -#include "../utils/color_cache.h" -#include "../utils/huffman.h" -#include "../webp/format_constants.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -typedef enum { - READ_DATA = 0, - READ_HDR = 1, - READ_DIM = 2 -} VP8LDecodeState; - -typedef struct VP8LTransform VP8LTransform; -struct VP8LTransform { - VP8LImageTransformType type_; // transform type. - int bits_; // subsampling bits defining transform window. - int xsize_; // transform window X index. - int ysize_; // transform window Y index. - uint32_t *data_; // transform data. -}; - -typedef struct { - HuffmanTree htrees_[HUFFMAN_CODES_PER_META_CODE]; -} HTreeGroup; - -typedef struct { - int color_cache_size_; - VP8LColorCache color_cache_; - - int huffman_mask_; - int huffman_subsample_bits_; - int huffman_xsize_; - uint32_t *huffman_image_; - int num_htree_groups_; - HTreeGroup *htree_groups_; -} VP8LMetadata; - -typedef struct { - VP8StatusCode status_; - VP8LDecodeState action_; - VP8LDecodeState state_; - VP8Io *io_; - - const WebPDecBuffer *output_; // shortcut to io->opaque->output - - uint32_t *argb_; // Internal data: always in BGRA color mode. - uint32_t *argb_cache_; // Scratch buffer for temporary BGRA storage. - - VP8LBitReader br_; - - int width_; - int height_; - int last_row_; // last input row decoded so far. - int last_out_row_; // last row output so far. - - VP8LMetadata hdr_; - - int next_transform_; - VP8LTransform transforms_[NUM_TRANSFORMS]; - // or'd bitset storing the transforms types. - uint32_t transforms_seen_; - - uint8_t *rescaler_memory; // Working memory for rescaling work. - WebPRescaler *rescaler; // Common rescaler for all channels. -} VP8LDecoder; - -//------------------------------------------------------------------------------ -// internal functions. Not public. - -// in vp8l.c - -// Decodes a raw image stream (without header) and store the alpha data -// into *output, which must be of size width x height. Returns false in case -// of error. -int VP8LDecodeAlphaImageStream(int width, int height, const uint8_t* const data, - size_t data_size, uint8_t* const output); - -// Allocates and initialize a new lossless decoder instance. -VP8LDecoder* VP8LNew(void); - -// Decodes the image header. Returns false in case of error. -int VP8LDecodeHeader(VP8LDecoder* const dec, VP8Io* const io); - -// Decodes an image. It's required to decode the lossless header before calling -// this function. Returns false in case of error, with updated dec->status_. -int VP8LDecodeImage(VP8LDecoder* const dec); - -// Resets the decoder in its initial state, reclaiming memory. -// Preserves the dec->status_ value. -void VP8LClear(VP8LDecoder* const dec); - -// Clears and deallocate a lossless decoder instance. -void VP8LDelete(VP8LDecoder* const dec); - -//------------------------------------------------------------------------------ - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif - -#endif /* WEBP_DEC_VP8LI_H_ */ diff --git a/external/libwebp/dec/webp.c b/external/libwebp/dec/webp.c deleted file mode 100644 index 7455da9415..0000000000 --- a/external/libwebp/dec/webp.c +++ /dev/null @@ -1,777 +0,0 @@ -// Copyright 2010 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Main decoding functions for WEBP images. -// -// Author: Skal (pascal.massimino@gmail.com) - -#include <stdlib.h> - -#include "./vp8i.h" -#include "./vp8li.h" -#include "./webpi.h" -#include "../webp/format_constants.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -//------------------------------------------------------------------------------ -// RIFF layout is: -// Offset tag -// 0...3 "RIFF" 4-byte tag -// 4...7 size of image data (including metadata) starting at offset 8 -// 8...11 "WEBP" our form-type signature -// The RIFF container (12 bytes) is followed by appropriate chunks: -// 12..15 "VP8 ": 4-bytes tags, signaling the use of VP8 video format -// 16..19 size of the raw VP8 image data, starting at offset 20 -// 20.... the VP8 bytes -// Or, -// 12..15 "VP8L": 4-bytes tags, signaling the use of VP8L lossless format -// 16..19 size of the raw VP8L image data, starting at offset 20 -// 20.... the VP8L bytes -// Or, -// 12..15 "VP8X": 4-bytes tags, describing the extended-VP8 chunk. -// 16..19 size of the VP8X chunk starting at offset 20. -// 20..23 VP8X flags bit-map corresponding to the chunk-types present. -// 24..26 Width of the Canvas Image. -// 27..29 Height of the Canvas Image. -// There can be extra chunks after the "VP8X" chunk (ICCP, TILE, FRM, VP8, -// META ...) -// All sizes are in little-endian order. -// Note: chunk data size must be padded to multiple of 2 when written. - -static WEBP_INLINE uint32_t get_le24(const uint8_t* const data) { - return data[0] | (data[1] << 8) | (data[2] << 16); -} - -static WEBP_INLINE uint32_t get_le32(const uint8_t* const data) { - return (uint32_t)get_le24(data) | (data[3] << 24); -} - -// Validates the RIFF container (if detected) and skips over it. -// If a RIFF container is detected, -// Returns VP8_STATUS_BITSTREAM_ERROR for invalid header, and -// VP8_STATUS_OK otherwise. -// In case there are not enough bytes (partial RIFF container), return 0 for -// *riff_size. Else return the RIFF size extracted from the header. -static VP8StatusCode ParseRIFF(const uint8_t** const data, - size_t* const data_size, - size_t* const riff_size) { - assert(data != NULL); - assert(data_size != NULL); - assert(riff_size != NULL); - - *riff_size = 0; // Default: no RIFF present. - if (*data_size >= RIFF_HEADER_SIZE && !memcmp(*data, "RIFF", TAG_SIZE)) { - if (memcmp(*data + 8, "WEBP", TAG_SIZE)) { - return VP8_STATUS_BITSTREAM_ERROR; // Wrong image file signature. - } else { - const uint32_t size = get_le32(*data + TAG_SIZE); - // Check that we have at least one chunk (i.e "WEBP" + "VP8?nnnn"). - if (size < TAG_SIZE + CHUNK_HEADER_SIZE) { - return VP8_STATUS_BITSTREAM_ERROR; - } - if (size > MAX_CHUNK_PAYLOAD) { - return VP8_STATUS_BITSTREAM_ERROR; - } - // We have a RIFF container. Skip it. - *riff_size = size; - *data += RIFF_HEADER_SIZE; - *data_size -= RIFF_HEADER_SIZE; - } - } - return VP8_STATUS_OK; -} - -// Validates the VP8X header and skips over it. -// Returns VP8_STATUS_BITSTREAM_ERROR for invalid VP8X header, -// VP8_STATUS_NOT_ENOUGH_DATA in case of insufficient data, and -// VP8_STATUS_OK otherwise. -// If a VP8X chunk is found, found_vp8x is set to true and *width_ptr, -// *height_ptr and *flags_ptr are set to the corresponding values extracted -// from the VP8X chunk. -static VP8StatusCode ParseVP8X(const uint8_t** const data, - size_t* const data_size, - int* const found_vp8x, - int* const width_ptr, int* const height_ptr, - uint32_t* const flags_ptr) { - const uint32_t vp8x_size = CHUNK_HEADER_SIZE + VP8X_CHUNK_SIZE; - assert(data != NULL); - assert(data_size != NULL); - assert(found_vp8x != NULL); - - *found_vp8x = 0; - - if (*data_size < CHUNK_HEADER_SIZE) { - return VP8_STATUS_NOT_ENOUGH_DATA; // Insufficient data. - } - - if (!memcmp(*data, "VP8X", TAG_SIZE)) { - int width, height; - uint32_t flags; - const uint32_t chunk_size = get_le32(*data + TAG_SIZE); - if (chunk_size != VP8X_CHUNK_SIZE) { - return VP8_STATUS_BITSTREAM_ERROR; // Wrong chunk size. - } - - // Verify if enough data is available to validate the VP8X chunk. - if (*data_size < vp8x_size) { - return VP8_STATUS_NOT_ENOUGH_DATA; // Insufficient data. - } - flags = get_le32(*data + 8); - width = 1 + get_le24(*data + 12); - height = 1 + get_le24(*data + 15); - if (width * (uint64_t)height >= MAX_IMAGE_AREA) { - return VP8_STATUS_BITSTREAM_ERROR; // image is too large - } - - if (flags_ptr != NULL) *flags_ptr = flags; - if (width_ptr != NULL) *width_ptr = width; - if (height_ptr != NULL) *height_ptr = height; - // Skip over VP8X header bytes. - *data += vp8x_size; - *data_size -= vp8x_size; - *found_vp8x = 1; - } - return VP8_STATUS_OK; -} - -// Skips to the next VP8/VP8L chunk header in the data given the size of the -// RIFF chunk 'riff_size'. -// Returns VP8_STATUS_BITSTREAM_ERROR if any invalid chunk size is encountered, -// VP8_STATUS_NOT_ENOUGH_DATA in case of insufficient data, and -// VP8_STATUS_OK otherwise. -// If an alpha chunk is found, *alpha_data and *alpha_size are set -// appropriately. -static VP8StatusCode ParseOptionalChunks(const uint8_t** const data, - size_t* const data_size, - size_t const riff_size, - const uint8_t** const alpha_data, - size_t* const alpha_size) { - const uint8_t* buf; - size_t buf_size; - uint32_t total_size = TAG_SIZE + // "WEBP". - CHUNK_HEADER_SIZE + // "VP8Xnnnn". - VP8X_CHUNK_SIZE; // data. - assert(data != NULL); - assert(data_size != NULL); - buf = *data; - buf_size = *data_size; - - assert(alpha_data != NULL); - assert(alpha_size != NULL); - *alpha_data = NULL; - *alpha_size = 0; - - while (1) { - uint32_t chunk_size; - uint32_t disk_chunk_size; // chunk_size with padding - - *data = buf; - *data_size = buf_size; - - if (buf_size < CHUNK_HEADER_SIZE) { // Insufficient data. - return VP8_STATUS_NOT_ENOUGH_DATA; - } - - chunk_size = get_le32(buf + TAG_SIZE); - if (chunk_size > MAX_CHUNK_PAYLOAD) { - return VP8_STATUS_BITSTREAM_ERROR; // Not a valid chunk size. - } - // For odd-sized chunk-payload, there's one byte padding at the end. - disk_chunk_size = (CHUNK_HEADER_SIZE + chunk_size + 1) & ~1; - total_size += disk_chunk_size; - - // Check that total bytes skipped so far does not exceed riff_size. - if (riff_size > 0 && (total_size > riff_size)) { - return VP8_STATUS_BITSTREAM_ERROR; // Not a valid chunk size. - } - - if (buf_size < disk_chunk_size) { // Insufficient data. - return VP8_STATUS_NOT_ENOUGH_DATA; - } - - if (!memcmp(buf, "ALPH", TAG_SIZE)) { // A valid ALPH header. - *alpha_data = buf + CHUNK_HEADER_SIZE; - *alpha_size = chunk_size; - } else if (!memcmp(buf, "VP8 ", TAG_SIZE) || - !memcmp(buf, "VP8L", TAG_SIZE)) { // A valid VP8/VP8L header. - return VP8_STATUS_OK; // Found. - } - - // We have a full and valid chunk; skip it. - buf += disk_chunk_size; - buf_size -= disk_chunk_size; - } -} - -// Validates the VP8/VP8L Header ("VP8 nnnn" or "VP8L nnnn") and skips over it. -// Returns VP8_STATUS_BITSTREAM_ERROR for invalid (chunk larger than -// riff_size) VP8/VP8L header, -// VP8_STATUS_NOT_ENOUGH_DATA in case of insufficient data, and -// VP8_STATUS_OK otherwise. -// If a VP8/VP8L chunk is found, *chunk_size is set to the total number of bytes -// extracted from the VP8/VP8L chunk header. -// The flag '*is_lossless' is set to 1 in case of VP8L chunk / raw VP8L data. -static VP8StatusCode ParseVP8Header(const uint8_t** const data_ptr, - size_t* const data_size, - size_t riff_size, - size_t* const chunk_size, - int* const is_lossless) { - const uint8_t* const data = *data_ptr; - const int is_vp8 = !memcmp(data, "VP8 ", TAG_SIZE); - const int is_vp8l = !memcmp(data, "VP8L", TAG_SIZE); - const uint32_t minimal_size = - TAG_SIZE + CHUNK_HEADER_SIZE; // "WEBP" + "VP8 nnnn" OR - // "WEBP" + "VP8Lnnnn" - assert(data != NULL); - assert(data_size != NULL); - assert(chunk_size != NULL); - assert(is_lossless != NULL); - - if (*data_size < CHUNK_HEADER_SIZE) { - return VP8_STATUS_NOT_ENOUGH_DATA; // Insufficient data. - } - - if (is_vp8 || is_vp8l) { - // Bitstream contains VP8/VP8L header. - const uint32_t size = get_le32(data + TAG_SIZE); - if ((riff_size >= minimal_size) && (size > riff_size - minimal_size)) { - return VP8_STATUS_BITSTREAM_ERROR; // Inconsistent size information. - } - // Skip over CHUNK_HEADER_SIZE bytes from VP8/VP8L Header. - *chunk_size = size; - *data_ptr += CHUNK_HEADER_SIZE; - *data_size -= CHUNK_HEADER_SIZE; - *is_lossless = is_vp8l; - } else { - // Raw VP8/VP8L bitstream (no header). - *is_lossless = VP8LCheckSignature(data, *data_size); - *chunk_size = *data_size; - } - - return VP8_STATUS_OK; -} - -//------------------------------------------------------------------------------ - -// Fetch '*width', '*height', '*has_alpha' and fill out 'headers' based on -// 'data'. All the output parameters may be NULL. If 'headers' is NULL only the -// minimal amount will be read to fetch the remaining parameters. -// If 'headers' is non-NULL this function will attempt to locate both alpha -// data (with or without a VP8X chunk) and the bitstream chunk (VP8/VP8L). -// Note: The following chunk sequences (before the raw VP8/VP8L data) are -// considered valid by this function: -// RIFF + VP8(L) -// RIFF + VP8X + (optional chunks) + VP8(L) -// ALPH + VP8 <-- Not a valid WebP format: only allowed for internal purpose. -// VP8(L) <-- Not a valid WebP format: only allowed for internal purpose. -static VP8StatusCode ParseHeadersInternal(const uint8_t* data, - size_t data_size, - int* const width, - int* const height, - int* const has_alpha, - WebPHeaderStructure* const headers) { - int found_riff = 0; - int found_vp8x = 0; - VP8StatusCode status; - WebPHeaderStructure hdrs; - - if (data == NULL || data_size < RIFF_HEADER_SIZE) { - return VP8_STATUS_NOT_ENOUGH_DATA; - } - memset(&hdrs, 0, sizeof(hdrs)); - hdrs.data = data; - hdrs.data_size = data_size; - - // Skip over RIFF header. - status = ParseRIFF(&data, &data_size, &hdrs.riff_size); - if (status != VP8_STATUS_OK) { - return status; // Wrong RIFF header / insufficient data. - } - found_riff = (hdrs.riff_size > 0); - - // Skip over VP8X. - { - uint32_t flags = 0; - status = ParseVP8X(&data, &data_size, &found_vp8x, width, height, &flags); - if (status != VP8_STATUS_OK) { - return status; // Wrong VP8X / insufficient data. - } - if (!found_riff && found_vp8x) { - // Note: This restriction may be removed in the future, if it becomes - // necessary to send VP8X chunk to the decoder. - return VP8_STATUS_BITSTREAM_ERROR; - } - if (has_alpha != NULL) *has_alpha = !!(flags & ALPHA_FLAG_BIT); - if (found_vp8x && headers == NULL) { - return VP8_STATUS_OK; // Return features from VP8X header. - } - } - - if (data_size < TAG_SIZE) return VP8_STATUS_NOT_ENOUGH_DATA; - - // Skip over optional chunks if data started with "RIFF + VP8X" or "ALPH". - if ((found_riff && found_vp8x) || - (!found_riff && !found_vp8x && !memcmp(data, "ALPH", TAG_SIZE))) { - status = ParseOptionalChunks(&data, &data_size, hdrs.riff_size, - &hdrs.alpha_data, &hdrs.alpha_data_size); - if (status != VP8_STATUS_OK) { - return status; // Found an invalid chunk size / insufficient data. - } - } - - // Skip over VP8/VP8L header. - status = ParseVP8Header(&data, &data_size, hdrs.riff_size, - &hdrs.compressed_size, &hdrs.is_lossless); - if (status != VP8_STATUS_OK) { - return status; // Wrong VP8/VP8L chunk-header / insufficient data. - } - if (hdrs.compressed_size > MAX_CHUNK_PAYLOAD) { - return VP8_STATUS_BITSTREAM_ERROR; - } - - if (!hdrs.is_lossless) { - if (data_size < VP8_FRAME_HEADER_SIZE) { - return VP8_STATUS_NOT_ENOUGH_DATA; - } - // Validates raw VP8 data. - if (!VP8GetInfo(data, data_size, - (uint32_t)hdrs.compressed_size, width, height)) { - return VP8_STATUS_BITSTREAM_ERROR; - } - } else { - if (data_size < VP8L_FRAME_HEADER_SIZE) { - return VP8_STATUS_NOT_ENOUGH_DATA; - } - // Validates raw VP8L data. - if (!VP8LGetInfo(data, data_size, width, height, has_alpha)) { - return VP8_STATUS_BITSTREAM_ERROR; - } - } - - if (has_alpha != NULL) { - // If the data did not contain a VP8X/VP8L chunk the only definitive way - // to set this is by looking for alpha data (from an ALPH chunk). - *has_alpha |= (hdrs.alpha_data != NULL); - } - if (headers != NULL) { - *headers = hdrs; - headers->offset = data - headers->data; - assert((uint64_t)(data - headers->data) < MAX_CHUNK_PAYLOAD); - assert(headers->offset == headers->data_size - data_size); - } - return VP8_STATUS_OK; // Return features from VP8 header. -} - -VP8StatusCode WebPParseHeaders(WebPHeaderStructure* const headers) { - assert(headers != NULL); - // fill out headers, ignore width/height/has_alpha. - return ParseHeadersInternal(headers->data, headers->data_size, - NULL, NULL, NULL, headers); -} - -//------------------------------------------------------------------------------ -// WebPDecParams - -void WebPResetDecParams(WebPDecParams* const params) { - if (params) { - memset(params, 0, sizeof(*params)); - } -} - -//------------------------------------------------------------------------------ -// "Into" decoding variants - -// Main flow -static VP8StatusCode DecodeInto(const uint8_t* const data, size_t data_size, - WebPDecParams* const params) { - VP8StatusCode status; - VP8Io io; - WebPHeaderStructure headers; - - headers.data = data; - headers.data_size = data_size; - status = WebPParseHeaders(&headers); // Process Pre-VP8 chunks. - if (status != VP8_STATUS_OK) { - return status; - } - - assert(params != NULL); - VP8InitIo(&io); - io.data = headers.data + headers.offset; - io.data_size = headers.data_size - headers.offset; - WebPInitCustomIo(params, &io); // Plug the I/O functions. - - if (!headers.is_lossless) { - VP8Decoder* const dec = VP8New(); - if (dec == NULL) { - return VP8_STATUS_OUT_OF_MEMORY; - } -#ifdef WEBP_USE_THREAD - dec->use_threads_ = params->options && (params->options->use_threads > 0); -#else - dec->use_threads_ = 0; -#endif - dec->alpha_data_ = headers.alpha_data; - dec->alpha_data_size_ = headers.alpha_data_size; - - // Decode bitstream header, update io->width/io->height. - if (!VP8GetHeaders(dec, &io)) { - status = dec->status_; // An error occurred. Grab error status. - } else { - // Allocate/check output buffers. - status = WebPAllocateDecBuffer(io.width, io.height, params->options, - params->output); - if (status == VP8_STATUS_OK) { // Decode - if (!VP8Decode(dec, &io)) { - status = dec->status_; - } - } - } - VP8Delete(dec); - } else { - VP8LDecoder* const dec = VP8LNew(); - if (dec == NULL) { - return VP8_STATUS_OUT_OF_MEMORY; - } - if (!VP8LDecodeHeader(dec, &io)) { - status = dec->status_; // An error occurred. Grab error status. - } else { - // Allocate/check output buffers. - status = WebPAllocateDecBuffer(io.width, io.height, params->options, - params->output); - if (status == VP8_STATUS_OK) { // Decode - if (!VP8LDecodeImage(dec)) { - status = dec->status_; - } - } - } - VP8LDelete(dec); - } - - if (status != VP8_STATUS_OK) { - WebPFreeDecBuffer(params->output); - } - return status; -} - -// Helpers -static uint8_t* DecodeIntoRGBABuffer(WEBP_CSP_MODE colorspace, - const uint8_t* const data, - size_t data_size, - uint8_t* const rgba, - int stride, size_t size) { - WebPDecParams params; - WebPDecBuffer buf; - if (rgba == NULL) { - return NULL; - } - WebPInitDecBuffer(&buf); - WebPResetDecParams(¶ms); - params.output = &buf; - buf.colorspace = colorspace; - buf.u.RGBA.rgba = rgba; - buf.u.RGBA.stride = stride; - buf.u.RGBA.size = size; - buf.is_external_memory = 1; - if (DecodeInto(data, data_size, ¶ms) != VP8_STATUS_OK) { - return NULL; - } - return rgba; -} - -uint8_t* WebPDecodeRGBInto(const uint8_t* data, size_t data_size, - uint8_t* output, size_t size, int stride) { - return DecodeIntoRGBABuffer(MODE_RGB, data, data_size, output, stride, size); -} - -uint8_t* WebPDecodeRGBAInto(const uint8_t* data, size_t data_size, - uint8_t* output, size_t size, int stride) { - return DecodeIntoRGBABuffer(MODE_RGBA, data, data_size, output, stride, size); -} - -uint8_t* WebPDecodeARGBInto(const uint8_t* data, size_t data_size, - uint8_t* output, size_t size, int stride) { - return DecodeIntoRGBABuffer(MODE_ARGB, data, data_size, output, stride, size); -} - -uint8_t* WebPDecodeBGRInto(const uint8_t* data, size_t data_size, - uint8_t* output, size_t size, int stride) { - return DecodeIntoRGBABuffer(MODE_BGR, data, data_size, output, stride, size); -} - -uint8_t* WebPDecodeBGRAInto(const uint8_t* data, size_t data_size, - uint8_t* output, size_t size, int stride) { - return DecodeIntoRGBABuffer(MODE_BGRA, data, data_size, output, stride, size); -} - -uint8_t* WebPDecodeYUVInto(const uint8_t* data, size_t data_size, - uint8_t* luma, size_t luma_size, int luma_stride, - uint8_t* u, size_t u_size, int u_stride, - uint8_t* v, size_t v_size, int v_stride) { - WebPDecParams params; - WebPDecBuffer output; - if (luma == NULL) return NULL; - WebPInitDecBuffer(&output); - WebPResetDecParams(¶ms); - params.output = &output; - output.colorspace = MODE_YUV; - output.u.YUVA.y = luma; - output.u.YUVA.y_stride = luma_stride; - output.u.YUVA.y_size = luma_size; - output.u.YUVA.u = u; - output.u.YUVA.u_stride = u_stride; - output.u.YUVA.u_size = u_size; - output.u.YUVA.v = v; - output.u.YUVA.v_stride = v_stride; - output.u.YUVA.v_size = v_size; - output.is_external_memory = 1; - if (DecodeInto(data, data_size, ¶ms) != VP8_STATUS_OK) { - return NULL; - } - return luma; -} - -//------------------------------------------------------------------------------ - -static uint8_t* Decode(WEBP_CSP_MODE mode, const uint8_t* const data, - size_t data_size, int* const width, int* const height, - WebPDecBuffer* const keep_info) { - WebPDecParams params; - WebPDecBuffer output; - - WebPInitDecBuffer(&output); - WebPResetDecParams(¶ms); - params.output = &output; - output.colorspace = mode; - - // Retrieve (and report back) the required dimensions from bitstream. - if (!WebPGetInfo(data, data_size, &output.width, &output.height)) { - return NULL; - } - if (width != NULL) *width = output.width; - if (height != NULL) *height = output.height; - - // Decode - if (DecodeInto(data, data_size, ¶ms) != VP8_STATUS_OK) { - return NULL; - } - if (keep_info != NULL) { // keep track of the side-info - WebPCopyDecBuffer(&output, keep_info); - } - // return decoded samples (don't clear 'output'!) - return WebPIsRGBMode(mode) ? output.u.RGBA.rgba : output.u.YUVA.y; -} - -uint8_t* WebPDecodeRGB(const uint8_t* data, size_t data_size, - int* width, int* height) { - return Decode(MODE_RGB, data, data_size, width, height, NULL); -} - -uint8_t* WebPDecodeRGBA(const uint8_t* data, size_t data_size, - int* width, int* height) { - return Decode(MODE_RGBA, data, data_size, width, height, NULL); -} - -uint8_t* WebPDecodeARGB(const uint8_t* data, size_t data_size, - int* width, int* height) { - return Decode(MODE_ARGB, data, data_size, width, height, NULL); -} - -uint8_t* WebPDecodeBGR(const uint8_t* data, size_t data_size, - int* width, int* height) { - return Decode(MODE_BGR, data, data_size, width, height, NULL); -} - -uint8_t* WebPDecodeBGRA(const uint8_t* data, size_t data_size, - int* width, int* height) { - return Decode(MODE_BGRA, data, data_size, width, height, NULL); -} - -uint8_t* WebPDecodeYUV(const uint8_t* data, size_t data_size, - int* width, int* height, uint8_t** u, uint8_t** v, - int* stride, int* uv_stride) { - WebPDecBuffer output; // only to preserve the side-infos - uint8_t* const out = Decode(MODE_YUV, data, data_size, - width, height, &output); - - if (out != NULL) { - const WebPYUVABuffer* const buf = &output.u.YUVA; - *u = buf->u; - *v = buf->v; - *stride = buf->y_stride; - *uv_stride = buf->u_stride; - assert(buf->u_stride == buf->v_stride); - } - return out; -} - -static void DefaultFeatures(WebPBitstreamFeatures* const features) { - assert(features != NULL); - memset(features, 0, sizeof(*features)); - features->bitstream_version = 0; -} - -static VP8StatusCode GetFeatures(const uint8_t* const data, size_t data_size, - WebPBitstreamFeatures* const features) { - if (features == NULL || data == NULL) { - return VP8_STATUS_INVALID_PARAM; - } - DefaultFeatures(features); - - // Only parse enough of the data to retrieve width/height/has_alpha. - return ParseHeadersInternal(data, data_size, - &features->width, &features->height, - &features->has_alpha, NULL); -} - -//------------------------------------------------------------------------------ -// WebPGetInfo() - -int WebPGetInfo(const uint8_t* data, size_t data_size, - int* width, int* height) { - WebPBitstreamFeatures features; - - if (GetFeatures(data, data_size, &features) != VP8_STATUS_OK) { - return 0; - } - - if (width != NULL) { - *width = features.width; - } - if (height != NULL) { - *height = features.height; - } - - return 1; -} - -//------------------------------------------------------------------------------ -// Advance decoding API - -int WebPInitDecoderConfigInternal(WebPDecoderConfig* config, - int version) { - if (WEBP_ABI_IS_INCOMPATIBLE(version, WEBP_DECODER_ABI_VERSION)) { - return 0; // version mismatch - } - if (config == NULL) { - return 0; - } - memset(config, 0, sizeof(*config)); - DefaultFeatures(&config->input); - WebPInitDecBuffer(&config->output); - return 1; -} - -VP8StatusCode WebPGetFeaturesInternal(const uint8_t* data, size_t data_size, - WebPBitstreamFeatures* features, - int version) { - VP8StatusCode status; - if (WEBP_ABI_IS_INCOMPATIBLE(version, WEBP_DECODER_ABI_VERSION)) { - return VP8_STATUS_INVALID_PARAM; // version mismatch - } - if (features == NULL) { - return VP8_STATUS_INVALID_PARAM; - } - - status = GetFeatures(data, data_size, features); - if (status == VP8_STATUS_NOT_ENOUGH_DATA) { - return VP8_STATUS_BITSTREAM_ERROR; // Not-enough-data treated as error. - } - return status; -} - -VP8StatusCode WebPDecode(const uint8_t* data, size_t data_size, - WebPDecoderConfig* config) { - WebPDecParams params; - VP8StatusCode status; - - if (config == NULL) { - return VP8_STATUS_INVALID_PARAM; - } - - status = GetFeatures(data, data_size, &config->input); - if (status != VP8_STATUS_OK) { - if (status == VP8_STATUS_NOT_ENOUGH_DATA) { - return VP8_STATUS_BITSTREAM_ERROR; // Not-enough-data treated as error. - } - return status; - } - - WebPResetDecParams(¶ms); - params.output = &config->output; - params.options = &config->options; - status = DecodeInto(data, data_size, ¶ms); - - return status; -} - -//------------------------------------------------------------------------------ -// Cropping and rescaling. - -int WebPIoInitFromOptions(const WebPDecoderOptions* const options, - VP8Io* const io, WEBP_CSP_MODE src_colorspace) { - const int W = io->width; - const int H = io->height; - int x = 0, y = 0, w = W, h = H; - - // Cropping - io->use_cropping = (options != NULL) && (options->use_cropping > 0); - if (io->use_cropping) { - w = options->crop_width; - h = options->crop_height; - x = options->crop_left; - y = options->crop_top; - if (!WebPIsRGBMode(src_colorspace)) { // only snap for YUV420 or YUV422 - x &= ~1; - y &= ~1; // TODO(later): only for YUV420, not YUV422. - } - if (x < 0 || y < 0 || w <= 0 || h <= 0 || x + w > W || y + h > H) { - return 0; // out of frame boundary error - } - } - io->crop_left = x; - io->crop_top = y; - io->crop_right = x + w; - io->crop_bottom = y + h; - io->mb_w = w; - io->mb_h = h; - - // Scaling - io->use_scaling = (options != NULL) && (options->use_scaling > 0); - if (io->use_scaling) { - if (options->scaled_width <= 0 || options->scaled_height <= 0) { - return 0; - } - io->scaled_width = options->scaled_width; - io->scaled_height = options->scaled_height; - } - - // Filter - io->bypass_filtering = options && options->bypass_filtering; - - // Fancy upsampler -#ifdef FANCY_UPSAMPLING - io->fancy_upsampling = (options == NULL) || (!options->no_fancy_upsampling); -#endif - - if (io->use_scaling) { - // disable filter (only for large downscaling ratio). - io->bypass_filtering = (io->scaled_width < W * 3 / 4) && - (io->scaled_height < H * 3 / 4); - io->fancy_upsampling = 0; - } - return 1; -} - -//------------------------------------------------------------------------------ - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif diff --git a/external/libwebp/dec/webpi.h b/external/libwebp/dec/webpi.h deleted file mode 100644 index 44e5744411..0000000000 --- a/external/libwebp/dec/webpi.h +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright 2011 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Internal header: WebP decoding parameters and custom IO on buffer -// -// Author: somnath@google.com (Somnath Banerjee) - -#ifndef WEBP_DEC_WEBPI_H_ -#define WEBP_DEC_WEBPI_H_ - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -#include "../utils/rescaler.h" -#include "./decode_vp8.h" - -//------------------------------------------------------------------------------ -// WebPDecParams: Decoding output parameters. Transient internal object. - -typedef struct WebPDecParams WebPDecParams; -typedef int (*OutputFunc)(const VP8Io* const io, WebPDecParams* const p); -typedef int (*OutputRowFunc)(WebPDecParams* const p, int y_pos); - -struct WebPDecParams { - WebPDecBuffer* output; // output buffer. - uint8_t* tmp_y, *tmp_u, *tmp_v; // cache for the fancy upsampler - // or used for tmp rescaling - - int last_y; // coordinate of the line that was last output - const WebPDecoderOptions* options; // if not NULL, use alt decoding features - // rescalers - WebPRescaler scaler_y, scaler_u, scaler_v, scaler_a; - void* memory; // overall scratch memory for the output work. - - OutputFunc emit; // output RGB or YUV samples - OutputFunc emit_alpha; // output alpha channel - OutputRowFunc emit_alpha_row; // output one line of rescaled alpha values -}; - -// Should be called first, before any use of the WebPDecParams object. -void WebPResetDecParams(WebPDecParams* const params); - -//------------------------------------------------------------------------------ -// Header parsing helpers - -// Structure storing a description of the RIFF headers. -typedef struct { - const uint8_t* data; // input buffer - size_t data_size; // input buffer size - size_t offset; // offset to main data chunk (VP8 or VP8L) - const uint8_t* alpha_data; // points to alpha chunk (if present) - size_t alpha_data_size; // alpha chunk size - size_t compressed_size; // VP8/VP8L compressed data size - size_t riff_size; // size of the riff payload (or 0 if absent) - int is_lossless; // true if a VP8L chunk is present -} WebPHeaderStructure; - -// Skips over all valid chunks prior to the first VP8/VP8L frame header. -// Returns VP8_STATUS_OK on success, -// VP8_STATUS_BITSTREAM_ERROR if an invalid header/chunk is found, and -// VP8_STATUS_NOT_ENOUGH_DATA if case of insufficient data. -// In 'headers', compressed_size, offset, alpha_data, alpha_size and lossless -// fields are updated appropriately upon success. -VP8StatusCode WebPParseHeaders(WebPHeaderStructure* const headers); - -//------------------------------------------------------------------------------ -// Misc utils - -// Initializes VP8Io with custom setup, io and teardown functions. The default -// hooks will use the supplied 'params' as io->opaque handle. -void WebPInitCustomIo(WebPDecParams* const params, VP8Io* const io); - -// Setup crop_xxx fields, mb_w and mb_h in io. 'src_colorspace' refers -// to the *compressed* format, not the output one. -int WebPIoInitFromOptions(const WebPDecoderOptions* const options, - VP8Io* const io, WEBP_CSP_MODE src_colorspace); - -//------------------------------------------------------------------------------ -// Internal functions regarding WebPDecBuffer memory (in buffer.c). -// Don't really need to be externally visible for now. - -// Prepare 'buffer' with the requested initial dimensions width/height. -// If no external storage is supplied, initializes buffer by allocating output -// memory and setting up the stride information. Validate the parameters. Return -// an error code in case of problem (no memory, or invalid stride / size / -// dimension / etc.). If *options is not NULL, also verify that the options' -// parameters are valid and apply them to the width/height dimensions of the -// output buffer. This takes cropping / scaling / rotation into account. -VP8StatusCode WebPAllocateDecBuffer(int width, int height, - const WebPDecoderOptions* const options, - WebPDecBuffer* const buffer); - -// Copy 'src' into 'dst' buffer, making sure 'dst' is not marked as owner of the -// memory (still held by 'src'). -void WebPCopyDecBuffer(const WebPDecBuffer* const src, - WebPDecBuffer* const dst); - -// Copy and transfer ownership from src to dst (beware of parameter order!) -void WebPGrabDecBuffer(WebPDecBuffer* const src, WebPDecBuffer* const dst); - - - -//------------------------------------------------------------------------------ - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif - -#endif /* WEBP_DEC_WEBPI_H_ */ diff --git a/external/libwebp/dsp/Makefile.am b/external/libwebp/dsp/Makefile.am deleted file mode 100644 index c9dd7a552d..0000000000 --- a/external/libwebp/dsp/Makefile.am +++ /dev/null @@ -1,26 +0,0 @@ -AM_CPPFLAGS = -I$(top_srcdir)/src -noinst_LTLIBRARIES = libwebpdsp.la - -libwebpdsp_la_SOURCES = -libwebpdsp_la_SOURCES += cpu.c -libwebpdsp_la_SOURCES += dec.c -libwebpdsp_la_SOURCES += dec_neon.c -libwebpdsp_la_SOURCES += dec_sse2.c -libwebpdsp_la_SOURCES += dsp.h -libwebpdsp_la_SOURCES += enc.c -libwebpdsp_la_SOURCES += enc_sse2.c -libwebpdsp_la_SOURCES += lossless.c -libwebpdsp_la_SOURCES += lossless.h -libwebpdsp_la_SOURCES += upsampling.c -libwebpdsp_la_SOURCES += upsampling_sse2.c -libwebpdsp_la_SOURCES += yuv.c -libwebpdsp_la_SOURCES += yuv.h - -libwebpdspinclude_HEADERS = ../webp/types.h -noinst_HEADERS = -noinst_HEADERS += ../dec/decode_vp8.h -noinst_HEADERS += ../webp/decode.h - -libwebpdsp_la_LDFLAGS = -lm -libwebpdsp_la_CPPFLAGS = $(USE_EXPERIMENTAL_CODE) -libwebpdspincludedir = $(includedir)/webp diff --git a/external/libwebp/dsp/cpu.c b/external/libwebp/dsp/cpu.c deleted file mode 100644 index 4e7845c7d2..0000000000 --- a/external/libwebp/dsp/cpu.c +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright 2011 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// CPU detection -// -// Author: Christian Duvivier (cduvivier@google.com) - -#include "platform/CCPlatformConfig.h" - -#include "./dsp.h" - -#if defined(__ANDROID__) -#include <cpu-features.h> -#endif - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -//------------------------------------------------------------------------------ -// SSE2 detection. -// - -// apple/darwin gcc-4.0.1 defines __PIC__, but not __pic__ with -fPIC. -#if (defined(__pic__) || defined(__PIC__)) && defined(__i386__) -static WEBP_INLINE void GetCPUInfo(int cpu_info[4], int info_type) { - __asm__ volatile ( - "mov %%ebx, %%edi\n" - "cpuid\n" - "xchg %%edi, %%ebx\n" - : "=a"(cpu_info[0]), "=D"(cpu_info[1]), "=c"(cpu_info[2]), "=d"(cpu_info[3]) - : "a"(info_type)); -} -#elif (defined(__i386__) || defined(__x86_64__) ) && (CC_TARGET_PLATFORM != CC_PLATFORM_MARMALADE) -static WEBP_INLINE void GetCPUInfo(int cpu_info[4], int info_type) { - __asm__ volatile ( - "cpuid\n" - : "=a"(cpu_info[0]), "=b"(cpu_info[1]), "=c"(cpu_info[2]), "=d"(cpu_info[3]) - : "a"(info_type)); -} -#elif defined(WEBP_MSC_SSE2) -#define GetCPUInfo __cpuid -#endif - -#if (defined(__i386__) || defined(__x86_64__) || defined(WEBP_MSC_SSE2)) && (CC_TARGET_PLATFORM != CC_PLATFORM_MARMALADE) -static int x86CPUInfo(CPUFeature feature) { - int cpu_info[4]; - GetCPUInfo(cpu_info, 1); - if (feature == kSSE2) { - return 0 != (cpu_info[3] & 0x04000000); - } - if (feature == kSSE3) { - return 0 != (cpu_info[2] & 0x00000001); - } - return 0; -} -VP8CPUInfo VP8GetCPUInfo = x86CPUInfo; -#elif defined(WEBP_ANDROID_NEON) -static int AndroidCPUInfo(CPUFeature feature) { - const AndroidCpuFamily cpu_family = android_getCpuFamily(); - const uint64_t cpu_features = android_getCpuFeatures(); - if (feature == kNEON) { - return (cpu_family == ANDROID_CPU_FAMILY_ARM && - 0 != (cpu_features & ANDROID_CPU_ARM_FEATURE_NEON)); - } - return 0; -} -VP8CPUInfo VP8GetCPUInfo = AndroidCPUInfo; -#elif defined(__ARM_NEON__) -// define a dummy function to enable turning off NEON at runtime by setting -// VP8DecGetCPUInfo = NULL -static int armCPUInfo(CPUFeature feature) { - (void)feature; - return 1; -} -VP8CPUInfo VP8GetCPUInfo = armCPUInfo; -#else -VP8CPUInfo VP8GetCPUInfo = NULL; -#endif - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif diff --git a/external/libwebp/dsp/dec.c b/external/libwebp/dsp/dec.c deleted file mode 100644 index 9ae7b6fa76..0000000000 --- a/external/libwebp/dsp/dec.c +++ /dev/null @@ -1,732 +0,0 @@ -// Copyright 2010 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Speed-critical decoding functions. -// -// Author: Skal (pascal.massimino@gmail.com) - -#include "./dsp.h" -#include "../dec/vp8i.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -//------------------------------------------------------------------------------ -// run-time tables (~4k) - -static uint8_t abs0[255 + 255 + 1]; // abs(i) -static uint8_t abs1[255 + 255 + 1]; // abs(i)>>1 -static int8_t sclip1[1020 + 1020 + 1]; // clips [-1020, 1020] to [-128, 127] -static int8_t sclip2[112 + 112 + 1]; // clips [-112, 112] to [-16, 15] -static uint8_t clip1[255 + 510 + 1]; // clips [-255,510] to [0,255] - -// We declare this variable 'volatile' to prevent instruction reordering -// and make sure it's set to true _last_ (so as to be thread-safe) -static volatile int tables_ok = 0; - -static void DspInitTables(void) { - if (!tables_ok) { - int i; - for (i = -255; i <= 255; ++i) { - abs0[255 + i] = (i < 0) ? -i : i; - abs1[255 + i] = abs0[255 + i] >> 1; - } - for (i = -1020; i <= 1020; ++i) { - sclip1[1020 + i] = (i < -128) ? -128 : (i > 127) ? 127 : i; - } - for (i = -112; i <= 112; ++i) { - sclip2[112 + i] = (i < -16) ? -16 : (i > 15) ? 15 : i; - } - for (i = -255; i <= 255 + 255; ++i) { - clip1[255 + i] = (i < 0) ? 0 : (i > 255) ? 255 : i; - } - tables_ok = 1; - } -} - -static WEBP_INLINE uint8_t clip_8b(int v) { - return (!(v & ~0xff)) ? v : (v < 0) ? 0 : 255; -} - -//------------------------------------------------------------------------------ -// Transforms (Paragraph 14.4) - -#define STORE(x, y, v) \ - dst[x + y * BPS] = clip_8b(dst[x + y * BPS] + ((v) >> 3)) - -static const int kC1 = 20091 + (1 << 16); -static const int kC2 = 35468; -#define MUL(a, b) (((a) * (b)) >> 16) - -static void TransformOne(const int16_t* in, uint8_t* dst) { - int C[4 * 4], *tmp; - int i; - tmp = C; - for (i = 0; i < 4; ++i) { // vertical pass - const int a = in[0] + in[8]; // [-4096, 4094] - const int b = in[0] - in[8]; // [-4095, 4095] - const int c = MUL(in[4], kC2) - MUL(in[12], kC1); // [-3783, 3783] - const int d = MUL(in[4], kC1) + MUL(in[12], kC2); // [-3785, 3781] - tmp[0] = a + d; // [-7881, 7875] - tmp[1] = b + c; // [-7878, 7878] - tmp[2] = b - c; // [-7878, 7878] - tmp[3] = a - d; // [-7877, 7879] - tmp += 4; - in++; - } - // Each pass is expanding the dynamic range by ~3.85 (upper bound). - // The exact value is (2. + (kC1 + kC2) / 65536). - // After the second pass, maximum interval is [-3794, 3794], assuming - // an input in [-2048, 2047] interval. We then need to add a dst value - // in the [0, 255] range. - // In the worst case scenario, the input to clip_8b() can be as large as - // [-60713, 60968]. - tmp = C; - for (i = 0; i < 4; ++i) { // horizontal pass - const int dc = tmp[0] + 4; - const int a = dc + tmp[8]; - const int b = dc - tmp[8]; - const int c = MUL(tmp[4], kC2) - MUL(tmp[12], kC1); - const int d = MUL(tmp[4], kC1) + MUL(tmp[12], kC2); - STORE(0, 0, a + d); - STORE(1, 0, b + c); - STORE(2, 0, b - c); - STORE(3, 0, a - d); - tmp++; - dst += BPS; - } -} -#undef MUL - -static void TransformTwo(const int16_t* in, uint8_t* dst, int do_two) { - TransformOne(in, dst); - if (do_two) { - TransformOne(in + 16, dst + 4); - } -} - -static void TransformUV(const int16_t* in, uint8_t* dst) { - VP8Transform(in + 0 * 16, dst, 1); - VP8Transform(in + 2 * 16, dst + 4 * BPS, 1); -} - -static void TransformDC(const int16_t *in, uint8_t* dst) { - const int DC = in[0] + 4; - int i, j; - for (j = 0; j < 4; ++j) { - for (i = 0; i < 4; ++i) { - STORE(i, j, DC); - } - } -} - -static void TransformDCUV(const int16_t* in, uint8_t* dst) { - if (in[0 * 16]) TransformDC(in + 0 * 16, dst); - if (in[1 * 16]) TransformDC(in + 1 * 16, dst + 4); - if (in[2 * 16]) TransformDC(in + 2 * 16, dst + 4 * BPS); - if (in[3 * 16]) TransformDC(in + 3 * 16, dst + 4 * BPS + 4); -} - -#undef STORE - -//------------------------------------------------------------------------------ -// Paragraph 14.3 - -static void TransformWHT(const int16_t* in, int16_t* out) { - int tmp[16]; - int i; - for (i = 0; i < 4; ++i) { - const int a0 = in[0 + i] + in[12 + i]; - const int a1 = in[4 + i] + in[ 8 + i]; - const int a2 = in[4 + i] - in[ 8 + i]; - const int a3 = in[0 + i] - in[12 + i]; - tmp[0 + i] = a0 + a1; - tmp[8 + i] = a0 - a1; - tmp[4 + i] = a3 + a2; - tmp[12 + i] = a3 - a2; - } - for (i = 0; i < 4; ++i) { - const int dc = tmp[0 + i * 4] + 3; // w/ rounder - const int a0 = dc + tmp[3 + i * 4]; - const int a1 = tmp[1 + i * 4] + tmp[2 + i * 4]; - const int a2 = tmp[1 + i * 4] - tmp[2 + i * 4]; - const int a3 = dc - tmp[3 + i * 4]; - out[ 0] = (a0 + a1) >> 3; - out[16] = (a3 + a2) >> 3; - out[32] = (a0 - a1) >> 3; - out[48] = (a3 - a2) >> 3; - out += 64; - } -} - -void (*VP8TransformWHT)(const int16_t* in, int16_t* out) = TransformWHT; - -//------------------------------------------------------------------------------ -// Intra predictions - -#define DST(x, y) dst[(x) + (y) * BPS] - -static WEBP_INLINE void TrueMotion(uint8_t *dst, int size) { - const uint8_t* top = dst - BPS; - const uint8_t* const clip0 = clip1 + 255 - top[-1]; - int y; - for (y = 0; y < size; ++y) { - const uint8_t* const clip = clip0 + dst[-1]; - int x; - for (x = 0; x < size; ++x) { - dst[x] = clip[top[x]]; - } - dst += BPS; - } -} -static void TM4(uint8_t *dst) { TrueMotion(dst, 4); } -static void TM8uv(uint8_t *dst) { TrueMotion(dst, 8); } -static void TM16(uint8_t *dst) { TrueMotion(dst, 16); } - -//------------------------------------------------------------------------------ -// 16x16 - -static void VE16(uint8_t *dst) { // vertical - int j; - for (j = 0; j < 16; ++j) { - memcpy(dst + j * BPS, dst - BPS, 16); - } -} - -static void HE16(uint8_t *dst) { // horizontal - int j; - for (j = 16; j > 0; --j) { - memset(dst, dst[-1], 16); - dst += BPS; - } -} - -static WEBP_INLINE void Put16(int v, uint8_t* dst) { - int j; - for (j = 0; j < 16; ++j) { - memset(dst + j * BPS, v, 16); - } -} - -static void DC16(uint8_t *dst) { // DC - int DC = 16; - int j; - for (j = 0; j < 16; ++j) { - DC += dst[-1 + j * BPS] + dst[j - BPS]; - } - Put16(DC >> 5, dst); -} - -static void DC16NoTop(uint8_t *dst) { // DC with top samples not available - int DC = 8; - int j; - for (j = 0; j < 16; ++j) { - DC += dst[-1 + j * BPS]; - } - Put16(DC >> 4, dst); -} - -static void DC16NoLeft(uint8_t *dst) { // DC with left samples not available - int DC = 8; - int i; - for (i = 0; i < 16; ++i) { - DC += dst[i - BPS]; - } - Put16(DC >> 4, dst); -} - -static void DC16NoTopLeft(uint8_t *dst) { // DC with no top and left samples - Put16(0x80, dst); -} - -//------------------------------------------------------------------------------ -// 4x4 - -#define AVG3(a, b, c) (((a) + 2 * (b) + (c) + 2) >> 2) -#define AVG2(a, b) (((a) + (b) + 1) >> 1) - -static void VE4(uint8_t *dst) { // vertical - const uint8_t* top = dst - BPS; - const uint8_t vals[4] = { - AVG3(top[-1], top[0], top[1]), - AVG3(top[ 0], top[1], top[2]), - AVG3(top[ 1], top[2], top[3]), - AVG3(top[ 2], top[3], top[4]) - }; - int i; - for (i = 0; i < 4; ++i) { - memcpy(dst + i * BPS, vals, sizeof(vals)); - } -} - -static void HE4(uint8_t *dst) { // horizontal - const int A = dst[-1 - BPS]; - const int B = dst[-1]; - const int C = dst[-1 + BPS]; - const int D = dst[-1 + 2 * BPS]; - const int E = dst[-1 + 3 * BPS]; - *(uint32_t*)(dst + 0 * BPS) = 0x01010101U * AVG3(A, B, C); - *(uint32_t*)(dst + 1 * BPS) = 0x01010101U * AVG3(B, C, D); - *(uint32_t*)(dst + 2 * BPS) = 0x01010101U * AVG3(C, D, E); - *(uint32_t*)(dst + 3 * BPS) = 0x01010101U * AVG3(D, E, E); -} - -static void DC4(uint8_t *dst) { // DC - uint32_t dc = 4; - int i; - for (i = 0; i < 4; ++i) dc += dst[i - BPS] + dst[-1 + i * BPS]; - dc >>= 3; - for (i = 0; i < 4; ++i) memset(dst + i * BPS, dc, 4); -} - -static void RD4(uint8_t *dst) { // Down-right - const int I = dst[-1 + 0 * BPS]; - const int J = dst[-1 + 1 * BPS]; - const int K = dst[-1 + 2 * BPS]; - const int L = dst[-1 + 3 * BPS]; - const int X = dst[-1 - BPS]; - const int A = dst[0 - BPS]; - const int B = dst[1 - BPS]; - const int C = dst[2 - BPS]; - const int D = dst[3 - BPS]; - DST(0, 3) = AVG3(J, K, L); - DST(0, 2) = DST(1, 3) = AVG3(I, J, K); - DST(0, 1) = DST(1, 2) = DST(2, 3) = AVG3(X, I, J); - DST(0, 0) = DST(1, 1) = DST(2, 2) = DST(3, 3) = AVG3(A, X, I); - DST(1, 0) = DST(2, 1) = DST(3, 2) = AVG3(B, A, X); - DST(2, 0) = DST(3, 1) = AVG3(C, B, A); - DST(3, 0) = AVG3(D, C, B); -} - -static void LD4(uint8_t *dst) { // Down-Left - const int A = dst[0 - BPS]; - const int B = dst[1 - BPS]; - const int C = dst[2 - BPS]; - const int D = dst[3 - BPS]; - const int E = dst[4 - BPS]; - const int F = dst[5 - BPS]; - const int G = dst[6 - BPS]; - const int H = dst[7 - BPS]; - DST(0, 0) = AVG3(A, B, C); - DST(1, 0) = DST(0, 1) = AVG3(B, C, D); - DST(2, 0) = DST(1, 1) = DST(0, 2) = AVG3(C, D, E); - DST(3, 0) = DST(2, 1) = DST(1, 2) = DST(0, 3) = AVG3(D, E, F); - DST(3, 1) = DST(2, 2) = DST(1, 3) = AVG3(E, F, G); - DST(3, 2) = DST(2, 3) = AVG3(F, G, H); - DST(3, 3) = AVG3(G, H, H); -} - -static void VR4(uint8_t *dst) { // Vertical-Right - const int I = dst[-1 + 0 * BPS]; - const int J = dst[-1 + 1 * BPS]; - const int K = dst[-1 + 2 * BPS]; - const int X = dst[-1 - BPS]; - const int A = dst[0 - BPS]; - const int B = dst[1 - BPS]; - const int C = dst[2 - BPS]; - const int D = dst[3 - BPS]; - DST(0, 0) = DST(1, 2) = AVG2(X, A); - DST(1, 0) = DST(2, 2) = AVG2(A, B); - DST(2, 0) = DST(3, 2) = AVG2(B, C); - DST(3, 0) = AVG2(C, D); - - DST(0, 3) = AVG3(K, J, I); - DST(0, 2) = AVG3(J, I, X); - DST(0, 1) = DST(1, 3) = AVG3(I, X, A); - DST(1, 1) = DST(2, 3) = AVG3(X, A, B); - DST(2, 1) = DST(3, 3) = AVG3(A, B, C); - DST(3, 1) = AVG3(B, C, D); -} - -static void VL4(uint8_t *dst) { // Vertical-Left - const int A = dst[0 - BPS]; - const int B = dst[1 - BPS]; - const int C = dst[2 - BPS]; - const int D = dst[3 - BPS]; - const int E = dst[4 - BPS]; - const int F = dst[5 - BPS]; - const int G = dst[6 - BPS]; - const int H = dst[7 - BPS]; - DST(0, 0) = AVG2(A, B); - DST(1, 0) = DST(0, 2) = AVG2(B, C); - DST(2, 0) = DST(1, 2) = AVG2(C, D); - DST(3, 0) = DST(2, 2) = AVG2(D, E); - - DST(0, 1) = AVG3(A, B, C); - DST(1, 1) = DST(0, 3) = AVG3(B, C, D); - DST(2, 1) = DST(1, 3) = AVG3(C, D, E); - DST(3, 1) = DST(2, 3) = AVG3(D, E, F); - DST(3, 2) = AVG3(E, F, G); - DST(3, 3) = AVG3(F, G, H); -} - -static void HU4(uint8_t *dst) { // Horizontal-Up - const int I = dst[-1 + 0 * BPS]; - const int J = dst[-1 + 1 * BPS]; - const int K = dst[-1 + 2 * BPS]; - const int L = dst[-1 + 3 * BPS]; - DST(0, 0) = AVG2(I, J); - DST(2, 0) = DST(0, 1) = AVG2(J, K); - DST(2, 1) = DST(0, 2) = AVG2(K, L); - DST(1, 0) = AVG3(I, J, K); - DST(3, 0) = DST(1, 1) = AVG3(J, K, L); - DST(3, 1) = DST(1, 2) = AVG3(K, L, L); - DST(3, 2) = DST(2, 2) = - DST(0, 3) = DST(1, 3) = DST(2, 3) = DST(3, 3) = L; -} - -static void HD4(uint8_t *dst) { // Horizontal-Down - const int I = dst[-1 + 0 * BPS]; - const int J = dst[-1 + 1 * BPS]; - const int K = dst[-1 + 2 * BPS]; - const int L = dst[-1 + 3 * BPS]; - const int X = dst[-1 - BPS]; - const int A = dst[0 - BPS]; - const int B = dst[1 - BPS]; - const int C = dst[2 - BPS]; - - DST(0, 0) = DST(2, 1) = AVG2(I, X); - DST(0, 1) = DST(2, 2) = AVG2(J, I); - DST(0, 2) = DST(2, 3) = AVG2(K, J); - DST(0, 3) = AVG2(L, K); - - DST(3, 0) = AVG3(A, B, C); - DST(2, 0) = AVG3(X, A, B); - DST(1, 0) = DST(3, 1) = AVG3(I, X, A); - DST(1, 1) = DST(3, 2) = AVG3(J, I, X); - DST(1, 2) = DST(3, 3) = AVG3(K, J, I); - DST(1, 3) = AVG3(L, K, J); -} - -#undef DST -#undef AVG3 -#undef AVG2 - -//------------------------------------------------------------------------------ -// Chroma - -static void VE8uv(uint8_t *dst) { // vertical - int j; - for (j = 0; j < 8; ++j) { - memcpy(dst + j * BPS, dst - BPS, 8); - } -} - -static void HE8uv(uint8_t *dst) { // horizontal - int j; - for (j = 0; j < 8; ++j) { - memset(dst, dst[-1], 8); - dst += BPS; - } -} - -// helper for chroma-DC predictions -static WEBP_INLINE void Put8x8uv(uint64_t v, uint8_t* dst) { - int j; - for (j = 0; j < 8; ++j) { - *(uint64_t*)(dst + j * BPS) = v; - } -} - -static void DC8uv(uint8_t *dst) { // DC - int dc0 = 8; - int i; - for (i = 0; i < 8; ++i) { - dc0 += dst[i - BPS] + dst[-1 + i * BPS]; - } - Put8x8uv((uint64_t)((dc0 >> 4) * 0x0101010101010101ULL), dst); -} - -static void DC8uvNoLeft(uint8_t *dst) { // DC with no left samples - int dc0 = 4; - int i; - for (i = 0; i < 8; ++i) { - dc0 += dst[i - BPS]; - } - Put8x8uv((uint64_t)((dc0 >> 3) * 0x0101010101010101ULL), dst); -} - -static void DC8uvNoTop(uint8_t *dst) { // DC with no top samples - int dc0 = 4; - int i; - for (i = 0; i < 8; ++i) { - dc0 += dst[-1 + i * BPS]; - } - Put8x8uv((uint64_t)((dc0 >> 3) * 0x0101010101010101ULL), dst); -} - -static void DC8uvNoTopLeft(uint8_t *dst) { // DC with nothing - Put8x8uv(0x8080808080808080ULL, dst); -} - -//------------------------------------------------------------------------------ -// default C implementations - -const VP8PredFunc VP8PredLuma4[NUM_BMODES] = { - DC4, TM4, VE4, HE4, RD4, VR4, LD4, VL4, HD4, HU4 -}; - -const VP8PredFunc VP8PredLuma16[NUM_B_DC_MODES] = { - DC16, TM16, VE16, HE16, - DC16NoTop, DC16NoLeft, DC16NoTopLeft -}; - -const VP8PredFunc VP8PredChroma8[NUM_B_DC_MODES] = { - DC8uv, TM8uv, VE8uv, HE8uv, - DC8uvNoTop, DC8uvNoLeft, DC8uvNoTopLeft -}; - -//------------------------------------------------------------------------------ -// Edge filtering functions - -// 4 pixels in, 2 pixels out -static WEBP_INLINE void do_filter2(uint8_t* p, int step) { - const int p1 = p[-2*step], p0 = p[-step], q0 = p[0], q1 = p[step]; - const int a = 3 * (q0 - p0) + sclip1[1020 + p1 - q1]; - const int a1 = sclip2[112 + ((a + 4) >> 3)]; - const int a2 = sclip2[112 + ((a + 3) >> 3)]; - p[-step] = clip1[255 + p0 + a2]; - p[ 0] = clip1[255 + q0 - a1]; -} - -// 4 pixels in, 4 pixels out -static WEBP_INLINE void do_filter4(uint8_t* p, int step) { - const int p1 = p[-2*step], p0 = p[-step], q0 = p[0], q1 = p[step]; - const int a = 3 * (q0 - p0); - const int a1 = sclip2[112 + ((a + 4) >> 3)]; - const int a2 = sclip2[112 + ((a + 3) >> 3)]; - const int a3 = (a1 + 1) >> 1; - p[-2*step] = clip1[255 + p1 + a3]; - p[- step] = clip1[255 + p0 + a2]; - p[ 0] = clip1[255 + q0 - a1]; - p[ step] = clip1[255 + q1 - a3]; -} - -// 6 pixels in, 6 pixels out -static WEBP_INLINE void do_filter6(uint8_t* p, int step) { - const int p2 = p[-3*step], p1 = p[-2*step], p0 = p[-step]; - const int q0 = p[0], q1 = p[step], q2 = p[2*step]; - const int a = sclip1[1020 + 3 * (q0 - p0) + sclip1[1020 + p1 - q1]]; - const int a1 = (27 * a + 63) >> 7; // eq. to ((3 * a + 7) * 9) >> 7 - const int a2 = (18 * a + 63) >> 7; // eq. to ((2 * a + 7) * 9) >> 7 - const int a3 = (9 * a + 63) >> 7; // eq. to ((1 * a + 7) * 9) >> 7 - p[-3*step] = clip1[255 + p2 + a3]; - p[-2*step] = clip1[255 + p1 + a2]; - p[- step] = clip1[255 + p0 + a1]; - p[ 0] = clip1[255 + q0 - a1]; - p[ step] = clip1[255 + q1 - a2]; - p[ 2*step] = clip1[255 + q2 - a3]; -} - -static WEBP_INLINE int hev(const uint8_t* p, int step, int thresh) { - const int p1 = p[-2*step], p0 = p[-step], q0 = p[0], q1 = p[step]; - return (abs0[255 + p1 - p0] > thresh) || (abs0[255 + q1 - q0] > thresh); -} - -static WEBP_INLINE int needs_filter(const uint8_t* p, int step, int thresh) { - const int p1 = p[-2*step], p0 = p[-step], q0 = p[0], q1 = p[step]; - return (2 * abs0[255 + p0 - q0] + abs1[255 + p1 - q1]) <= thresh; -} - -static WEBP_INLINE int needs_filter2(const uint8_t* p, - int step, int t, int it) { - const int p3 = p[-4*step], p2 = p[-3*step], p1 = p[-2*step], p0 = p[-step]; - const int q0 = p[0], q1 = p[step], q2 = p[2*step], q3 = p[3*step]; - if ((2 * abs0[255 + p0 - q0] + abs1[255 + p1 - q1]) > t) - return 0; - return abs0[255 + p3 - p2] <= it && abs0[255 + p2 - p1] <= it && - abs0[255 + p1 - p0] <= it && abs0[255 + q3 - q2] <= it && - abs0[255 + q2 - q1] <= it && abs0[255 + q1 - q0] <= it; -} - -//------------------------------------------------------------------------------ -// Simple In-loop filtering (Paragraph 15.2) - -static void SimpleVFilter16(uint8_t* p, int stride, int thresh) { - int i; - for (i = 0; i < 16; ++i) { - if (needs_filter(p + i, stride, thresh)) { - do_filter2(p + i, stride); - } - } -} - -static void SimpleHFilter16(uint8_t* p, int stride, int thresh) { - int i; - for (i = 0; i < 16; ++i) { - if (needs_filter(p + i * stride, 1, thresh)) { - do_filter2(p + i * stride, 1); - } - } -} - -static void SimpleVFilter16i(uint8_t* p, int stride, int thresh) { - int k; - for (k = 3; k > 0; --k) { - p += 4 * stride; - SimpleVFilter16(p, stride, thresh); - } -} - -static void SimpleHFilter16i(uint8_t* p, int stride, int thresh) { - int k; - for (k = 3; k > 0; --k) { - p += 4; - SimpleHFilter16(p, stride, thresh); - } -} - -//------------------------------------------------------------------------------ -// Complex In-loop filtering (Paragraph 15.3) - -static WEBP_INLINE void FilterLoop26(uint8_t* p, - int hstride, int vstride, int size, - int thresh, int ithresh, int hev_thresh) { - while (size-- > 0) { - if (needs_filter2(p, hstride, thresh, ithresh)) { - if (hev(p, hstride, hev_thresh)) { - do_filter2(p, hstride); - } else { - do_filter6(p, hstride); - } - } - p += vstride; - } -} - -static WEBP_INLINE void FilterLoop24(uint8_t* p, - int hstride, int vstride, int size, - int thresh, int ithresh, int hev_thresh) { - while (size-- > 0) { - if (needs_filter2(p, hstride, thresh, ithresh)) { - if (hev(p, hstride, hev_thresh)) { - do_filter2(p, hstride); - } else { - do_filter4(p, hstride); - } - } - p += vstride; - } -} - -// on macroblock edges -static void VFilter16(uint8_t* p, int stride, - int thresh, int ithresh, int hev_thresh) { - FilterLoop26(p, stride, 1, 16, thresh, ithresh, hev_thresh); -} - -static void HFilter16(uint8_t* p, int stride, - int thresh, int ithresh, int hev_thresh) { - FilterLoop26(p, 1, stride, 16, thresh, ithresh, hev_thresh); -} - -// on three inner edges -static void VFilter16i(uint8_t* p, int stride, - int thresh, int ithresh, int hev_thresh) { - int k; - for (k = 3; k > 0; --k) { - p += 4 * stride; - FilterLoop24(p, stride, 1, 16, thresh, ithresh, hev_thresh); - } -} - -static void HFilter16i(uint8_t* p, int stride, - int thresh, int ithresh, int hev_thresh) { - int k; - for (k = 3; k > 0; --k) { - p += 4; - FilterLoop24(p, 1, stride, 16, thresh, ithresh, hev_thresh); - } -} - -// 8-pixels wide variant, for chroma filtering -static void VFilter8(uint8_t* u, uint8_t* v, int stride, - int thresh, int ithresh, int hev_thresh) { - FilterLoop26(u, stride, 1, 8, thresh, ithresh, hev_thresh); - FilterLoop26(v, stride, 1, 8, thresh, ithresh, hev_thresh); -} - -static void HFilter8(uint8_t* u, uint8_t* v, int stride, - int thresh, int ithresh, int hev_thresh) { - FilterLoop26(u, 1, stride, 8, thresh, ithresh, hev_thresh); - FilterLoop26(v, 1, stride, 8, thresh, ithresh, hev_thresh); -} - -static void VFilter8i(uint8_t* u, uint8_t* v, int stride, - int thresh, int ithresh, int hev_thresh) { - FilterLoop24(u + 4 * stride, stride, 1, 8, thresh, ithresh, hev_thresh); - FilterLoop24(v + 4 * stride, stride, 1, 8, thresh, ithresh, hev_thresh); -} - -static void HFilter8i(uint8_t* u, uint8_t* v, int stride, - int thresh, int ithresh, int hev_thresh) { - FilterLoop24(u + 4, 1, stride, 8, thresh, ithresh, hev_thresh); - FilterLoop24(v + 4, 1, stride, 8, thresh, ithresh, hev_thresh); -} - -//------------------------------------------------------------------------------ - -VP8DecIdct2 VP8Transform; -VP8DecIdct VP8TransformUV; -VP8DecIdct VP8TransformDC; -VP8DecIdct VP8TransformDCUV; - -VP8LumaFilterFunc VP8VFilter16; -VP8LumaFilterFunc VP8HFilter16; -VP8ChromaFilterFunc VP8VFilter8; -VP8ChromaFilterFunc VP8HFilter8; -VP8LumaFilterFunc VP8VFilter16i; -VP8LumaFilterFunc VP8HFilter16i; -VP8ChromaFilterFunc VP8VFilter8i; -VP8ChromaFilterFunc VP8HFilter8i; -VP8SimpleFilterFunc VP8SimpleVFilter16; -VP8SimpleFilterFunc VP8SimpleHFilter16; -VP8SimpleFilterFunc VP8SimpleVFilter16i; -VP8SimpleFilterFunc VP8SimpleHFilter16i; - -extern void VP8DspInitSSE2(void); -extern void VP8DspInitNEON(void); - -void VP8DspInit(void) { - DspInitTables(); - - VP8Transform = TransformTwo; - VP8TransformUV = TransformUV; - VP8TransformDC = TransformDC; - VP8TransformDCUV = TransformDCUV; - - VP8VFilter16 = VFilter16; - VP8HFilter16 = HFilter16; - VP8VFilter8 = VFilter8; - VP8HFilter8 = HFilter8; - VP8VFilter16i = VFilter16i; - VP8HFilter16i = HFilter16i; - VP8VFilter8i = VFilter8i; - VP8HFilter8i = HFilter8i; - VP8SimpleVFilter16 = SimpleVFilter16; - VP8SimpleHFilter16 = SimpleHFilter16; - VP8SimpleVFilter16i = SimpleVFilter16i; - VP8SimpleHFilter16i = SimpleHFilter16i; - - // If defined, use CPUInfo() to overwrite some pointers with faster versions. - if (VP8GetCPUInfo) { -#if defined(WEBP_USE_SSE2) - if (VP8GetCPUInfo(kSSE2)) { - VP8DspInitSSE2(); - } -#elif defined(WEBP_USE_NEON) - if (VP8GetCPUInfo(kNEON)) { - VP8DspInitNEON(); - } -#endif - } -} - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif diff --git a/external/libwebp/dsp/dec_neon.c b/external/libwebp/dsp/dec_neon.c deleted file mode 100644 index 09cafeef1c..0000000000 --- a/external/libwebp/dsp/dec_neon.c +++ /dev/null @@ -1,334 +0,0 @@ -// Copyright 2012 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// ARM NEON version of dsp functions and loop filtering. -// -// Authors: Somnath Banerjee (somnath@google.com) -// Johann Koenig (johannkoenig@google.com) - -#include "./dsp.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -#if defined(WEBP_USE_NEON) - -#include "../dec/vp8i.h" - -#define QRegs "q0", "q1", "q2", "q3", "q4", "q5", "q6", "q7", \ - "q8", "q9", "q10", "q11", "q12", "q13", "q14", "q15" - -#define FLIP_SIGN_BIT2(a, b, s) \ - "veor " #a "," #a "," #s " \n" \ - "veor " #b "," #b "," #s " \n" \ - -#define FLIP_SIGN_BIT4(a, b, c, d, s) \ - FLIP_SIGN_BIT2(a, b, s) \ - FLIP_SIGN_BIT2(c, d, s) \ - -#define NEEDS_FILTER(p1, p0, q0, q1, thresh, mask) \ - "vabd.u8 q15," #p0 "," #q0 " \n" /* abs(p0 - q0) */ \ - "vabd.u8 q14," #p1 "," #q1 " \n" /* abs(p1 - q1) */ \ - "vqadd.u8 q15, q15, q15 \n" /* abs(p0 - q0) * 2 */ \ - "vshr.u8 q14, q14, #1 \n" /* abs(p1 - q1) / 2 */ \ - "vqadd.u8 q15, q15, q14 \n" /* abs(p0 - q0) * 2 + abs(p1 - q1) / 2 */ \ - "vdup.8 q14, " #thresh " \n" \ - "vcge.u8 " #mask ", q14, q15 \n" /* mask <= thresh */ - -#define GET_BASE_DELTA(p1, p0, q0, q1, o) \ - "vqsub.s8 q15," #q0 "," #p0 " \n" /* (q0 - p0) */ \ - "vqsub.s8 " #o "," #p1 "," #q1 " \n" /* (p1 - q1) */ \ - "vqadd.s8 " #o "," #o ", q15 \n" /* (p1 - q1) + 1 * (p0 - q0) */ \ - "vqadd.s8 " #o "," #o ", q15 \n" /* (p1 - q1) + 2 * (p0 - q0) */ \ - "vqadd.s8 " #o "," #o ", q15 \n" /* (p1 - q1) + 3 * (p0 - q0) */ - -#define DO_SIMPLE_FILTER(p0, q0, fl) \ - "vmov.i8 q15, #0x03 \n" \ - "vqadd.s8 q15, q15, " #fl " \n" /* filter1 = filter + 3 */ \ - "vshr.s8 q15, q15, #3 \n" /* filter1 >> 3 */ \ - "vqadd.s8 " #p0 "," #p0 ", q15 \n" /* p0 += filter1 */ \ - \ - "vmov.i8 q15, #0x04 \n" \ - "vqadd.s8 q15, q15, " #fl " \n" /* filter1 = filter + 4 */ \ - "vshr.s8 q15, q15, #3 \n" /* filter2 >> 3 */ \ - "vqsub.s8 " #q0 "," #q0 ", q15 \n" /* q0 -= filter2 */ - -// Applies filter on 2 pixels (p0 and q0) -#define DO_FILTER2(p1, p0, q0, q1, thresh) \ - NEEDS_FILTER(p1, p0, q0, q1, thresh, q9) /* filter mask in q9 */ \ - "vmov.i8 q10, #0x80 \n" /* sign bit */ \ - FLIP_SIGN_BIT4(p1, p0, q0, q1, q10) /* convert to signed value */ \ - GET_BASE_DELTA(p1, p0, q0, q1, q11) /* get filter level */ \ - "vand q9, q9, q11 \n" /* apply filter mask */ \ - DO_SIMPLE_FILTER(p0, q0, q9) /* apply filter */ \ - FLIP_SIGN_BIT2(p0, q0, q10) - -// Load/Store vertical edge -#define LOAD8x4(c1, c2, c3, c4, b1, b2, stride) \ - "vld4.8 {" #c1"[0], " #c2"[0], " #c3"[0], " #c4"[0]}," #b1 "," #stride"\n" \ - "vld4.8 {" #c1"[1], " #c2"[1], " #c3"[1], " #c4"[1]}," #b2 "," #stride"\n" \ - "vld4.8 {" #c1"[2], " #c2"[2], " #c3"[2], " #c4"[2]}," #b1 "," #stride"\n" \ - "vld4.8 {" #c1"[3], " #c2"[3], " #c3"[3], " #c4"[3]}," #b2 "," #stride"\n" \ - "vld4.8 {" #c1"[4], " #c2"[4], " #c3"[4], " #c4"[4]}," #b1 "," #stride"\n" \ - "vld4.8 {" #c1"[5], " #c2"[5], " #c3"[5], " #c4"[5]}," #b2 "," #stride"\n" \ - "vld4.8 {" #c1"[6], " #c2"[6], " #c3"[6], " #c4"[6]}," #b1 "," #stride"\n" \ - "vld4.8 {" #c1"[7], " #c2"[7], " #c3"[7], " #c4"[7]}," #b2 "," #stride"\n" - -#define STORE8x2(c1, c2, p,stride) \ - "vst2.8 {" #c1"[0], " #c2"[0]}," #p "," #stride " \n" \ - "vst2.8 {" #c1"[1], " #c2"[1]}," #p "," #stride " \n" \ - "vst2.8 {" #c1"[2], " #c2"[2]}," #p "," #stride " \n" \ - "vst2.8 {" #c1"[3], " #c2"[3]}," #p "," #stride " \n" \ - "vst2.8 {" #c1"[4], " #c2"[4]}," #p "," #stride " \n" \ - "vst2.8 {" #c1"[5], " #c2"[5]}," #p "," #stride " \n" \ - "vst2.8 {" #c1"[6], " #c2"[6]}," #p "," #stride " \n" \ - "vst2.8 {" #c1"[7], " #c2"[7]}," #p "," #stride " \n" - -//----------------------------------------------------------------------------- -// Simple In-loop filtering (Paragraph 15.2) - -static void SimpleVFilter16NEON(uint8_t* p, int stride, int thresh) { - __asm__ volatile ( - "sub %[p], %[p], %[stride], lsl #1 \n" // p -= 2 * stride - - "vld1.u8 {q1}, [%[p]], %[stride] \n" // p1 - "vld1.u8 {q2}, [%[p]], %[stride] \n" // p0 - "vld1.u8 {q3}, [%[p]], %[stride] \n" // q0 - "vld1.u8 {q4}, [%[p]] \n" // q1 - - DO_FILTER2(q1, q2, q3, q4, %[thresh]) - - "sub %[p], %[p], %[stride], lsl #1 \n" // p -= 2 * stride - - "vst1.u8 {q2}, [%[p]], %[stride] \n" // store op0 - "vst1.u8 {q3}, [%[p]] \n" // store oq0 - : [p] "+r"(p) - : [stride] "r"(stride), [thresh] "r"(thresh) - : "memory", QRegs - ); -} - -static void SimpleHFilter16NEON(uint8_t* p, int stride, int thresh) { - __asm__ volatile ( - "sub r4, %[p], #2 \n" // base1 = p - 2 - "lsl r6, %[stride], #1 \n" // r6 = 2 * stride - "add r5, r4, %[stride] \n" // base2 = base1 + stride - - LOAD8x4(d2, d3, d4, d5, [r4], [r5], r6) - LOAD8x4(d6, d7, d8, d9, [r4], [r5], r6) - "vswp d3, d6 \n" // p1:q1 p0:q3 - "vswp d5, d8 \n" // q0:q2 q1:q4 - "vswp q2, q3 \n" // p1:q1 p0:q2 q0:q3 q1:q4 - - DO_FILTER2(q1, q2, q3, q4, %[thresh]) - - "sub %[p], %[p], #1 \n" // p - 1 - - "vswp d5, d6 \n" - STORE8x2(d4, d5, [%[p]], %[stride]) - STORE8x2(d6, d7, [%[p]], %[stride]) - - : [p] "+r"(p) - : [stride] "r"(stride), [thresh] "r"(thresh) - : "memory", "r4", "r5", "r6", QRegs - ); -} - -static void SimpleVFilter16iNEON(uint8_t* p, int stride, int thresh) { - int k; - for (k = 3; k > 0; --k) { - p += 4 * stride; - SimpleVFilter16NEON(p, stride, thresh); - } -} - -static void SimpleHFilter16iNEON(uint8_t* p, int stride, int thresh) { - int k; - for (k = 3; k > 0; --k) { - p += 4; - SimpleHFilter16NEON(p, stride, thresh); - } -} - -static void TransformOneNEON(const int16_t *in, uint8_t *dst) { - const int kBPS = BPS; - const int16_t constants[] = {20091, 17734, 0, 0}; - /* kC1, kC2. Padded because vld1.16 loads 8 bytes - * Technically these are unsigned but vqdmulh is only available in signed. - * vqdmulh returns high half (effectively >> 16) but also doubles the value, - * changing the >> 16 to >> 15 and requiring an additional >> 1. - * We use this to our advantage with kC2. The canonical value is 35468. - * However, the high bit is set so treating it as signed will give incorrect - * results. We avoid this by down shifting by 1 here to clear the highest bit. - * Combined with the doubling effect of vqdmulh we get >> 16. - * This can not be applied to kC1 because the lowest bit is set. Down shifting - * the constant would reduce precision. - */ - - /* libwebp uses a trick to avoid some extra addition that libvpx does. - * Instead of: - * temp2 = ip[12] + ((ip[12] * cospi8sqrt2minus1) >> 16); - * libwebp adds 1 << 16 to cospi8sqrt2minus1 (kC1). However, this causes the - * same issue with kC1 and vqdmulh that we work around by down shifting kC2 - */ - - /* Adapted from libvpx: vp8/common/arm/neon/shortidct4x4llm_neon.asm */ - __asm__ volatile ( - "vld1.16 {q1, q2}, [%[in]] \n" - "vld1.16 {d0}, [%[constants]] \n" - - /* d2: in[0] - * d3: in[8] - * d4: in[4] - * d5: in[12] - */ - "vswp d3, d4 \n" - - /* q8 = {in[4], in[12]} * kC1 * 2 >> 16 - * q9 = {in[4], in[12]} * kC2 >> 16 - */ - "vqdmulh.s16 q8, q2, d0[0] \n" - "vqdmulh.s16 q9, q2, d0[1] \n" - - /* d22 = a = in[0] + in[8] - * d23 = b = in[0] - in[8] - */ - "vqadd.s16 d22, d2, d3 \n" - "vqsub.s16 d23, d2, d3 \n" - - /* The multiplication should be x * kC1 >> 16 - * However, with vqdmulh we get x * kC1 * 2 >> 16 - * (multiply, double, return high half) - * We avoided this in kC2 by pre-shifting the constant. - * q8 = in[4]/[12] * kC1 >> 16 - */ - "vshr.s16 q8, q8, #1 \n" - - /* Add {in[4], in[12]} back after the multiplication. This is handled by - * adding 1 << 16 to kC1 in the libwebp C code. - */ - "vqadd.s16 q8, q2, q8 \n" - - /* d20 = c = in[4]*kC2 - in[12]*kC1 - * d21 = d = in[4]*kC1 + in[12]*kC2 - */ - "vqsub.s16 d20, d18, d17 \n" - "vqadd.s16 d21, d19, d16 \n" - - /* d2 = tmp[0] = a + d - * d3 = tmp[1] = b + c - * d4 = tmp[2] = b - c - * d5 = tmp[3] = a - d - */ - "vqadd.s16 d2, d22, d21 \n" - "vqadd.s16 d3, d23, d20 \n" - "vqsub.s16 d4, d23, d20 \n" - "vqsub.s16 d5, d22, d21 \n" - - "vzip.16 q1, q2 \n" - "vzip.16 q1, q2 \n" - - "vswp d3, d4 \n" - - /* q8 = {tmp[4], tmp[12]} * kC1 * 2 >> 16 - * q9 = {tmp[4], tmp[12]} * kC2 >> 16 - */ - "vqdmulh.s16 q8, q2, d0[0] \n" - "vqdmulh.s16 q9, q2, d0[1] \n" - - /* d22 = a = tmp[0] + tmp[8] - * d23 = b = tmp[0] - tmp[8] - */ - "vqadd.s16 d22, d2, d3 \n" - "vqsub.s16 d23, d2, d3 \n" - - /* See long winded explanations prior */ - "vshr.s16 q8, q8, #1 \n" - "vqadd.s16 q8, q2, q8 \n" - - /* d20 = c = in[4]*kC2 - in[12]*kC1 - * d21 = d = in[4]*kC1 + in[12]*kC2 - */ - "vqsub.s16 d20, d18, d17 \n" - "vqadd.s16 d21, d19, d16 \n" - - /* d2 = tmp[0] = a + d - * d3 = tmp[1] = b + c - * d4 = tmp[2] = b - c - * d5 = tmp[3] = a - d - */ - "vqadd.s16 d2, d22, d21 \n" - "vqadd.s16 d3, d23, d20 \n" - "vqsub.s16 d4, d23, d20 \n" - "vqsub.s16 d5, d22, d21 \n" - - "vld1.32 d6[0], [%[dst]], %[kBPS] \n" - "vld1.32 d6[1], [%[dst]], %[kBPS] \n" - "vld1.32 d7[0], [%[dst]], %[kBPS] \n" - "vld1.32 d7[1], [%[dst]], %[kBPS] \n" - - "sub %[dst], %[dst], %[kBPS], lsl #2 \n" - - /* (val) + 4 >> 3 */ - "vrshr.s16 d2, d2, #3 \n" - "vrshr.s16 d3, d3, #3 \n" - "vrshr.s16 d4, d4, #3 \n" - "vrshr.s16 d5, d5, #3 \n" - - "vzip.16 q1, q2 \n" - "vzip.16 q1, q2 \n" - - /* Must accumulate before saturating */ - "vmovl.u8 q8, d6 \n" - "vmovl.u8 q9, d7 \n" - - "vqadd.s16 q1, q1, q8 \n" - "vqadd.s16 q2, q2, q9 \n" - - "vqmovun.s16 d0, q1 \n" - "vqmovun.s16 d1, q2 \n" - - "vst1.32 d0[0], [%[dst]], %[kBPS] \n" - "vst1.32 d0[1], [%[dst]], %[kBPS] \n" - "vst1.32 d1[0], [%[dst]], %[kBPS] \n" - "vst1.32 d1[1], [%[dst]] \n" - - : [in] "+r"(in), [dst] "+r"(dst) /* modified registers */ - : [kBPS] "r"(kBPS), [constants] "r"(constants) /* constants */ - : "memory", "q0", "q1", "q2", "q8", "q9", "q10", "q11" /* clobbered */ - ); -} - -static void TransformTwoNEON(const int16_t* in, uint8_t* dst, int do_two) { - TransformOneNEON(in, dst); - if (do_two) { - TransformOneNEON(in + 16, dst + 4); - } -} - -#endif // WEBP_USE_NEON - -//------------------------------------------------------------------------------ -// Entry point - -extern void VP8DspInitNEON(void); - -void VP8DspInitNEON(void) { -#if defined(WEBP_USE_NEON) - VP8Transform = TransformTwoNEON; - - VP8SimpleVFilter16 = SimpleVFilter16NEON; - VP8SimpleHFilter16 = SimpleHFilter16NEON; - VP8SimpleVFilter16i = SimpleVFilter16iNEON; - VP8SimpleHFilter16i = SimpleHFilter16iNEON; -#endif // WEBP_USE_NEON -} - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif diff --git a/external/libwebp/dsp/dec_sse2.c b/external/libwebp/dsp/dec_sse2.c deleted file mode 100644 index 2cb55d013f..0000000000 --- a/external/libwebp/dsp/dec_sse2.c +++ /dev/null @@ -1,908 +0,0 @@ -// Copyright 2011 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// SSE2 version of some decoding functions (idct, loop filtering). -// -// Author: somnath@google.com (Somnath Banerjee) -// cduvivier@google.com (Christian Duvivier) - -#include "./dsp.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -#if defined(WEBP_USE_SSE2) - -#include <emmintrin.h> -#include "../dec/vp8i.h" - -//------------------------------------------------------------------------------ -// Transforms (Paragraph 14.4) - -static void TransformSSE2(const int16_t* in, uint8_t* dst, int do_two) { - // This implementation makes use of 16-bit fixed point versions of two - // multiply constants: - // K1 = sqrt(2) * cos (pi/8) ~= 85627 / 2^16 - // K2 = sqrt(2) * sin (pi/8) ~= 35468 / 2^16 - // - // To be able to use signed 16-bit integers, we use the following trick to - // have constants within range: - // - Associated constants are obtained by subtracting the 16-bit fixed point - // version of one: - // k = K - (1 << 16) => K = k + (1 << 16) - // K1 = 85267 => k1 = 20091 - // K2 = 35468 => k2 = -30068 - // - The multiplication of a variable by a constant become the sum of the - // variable and the multiplication of that variable by the associated - // constant: - // (x * K) >> 16 = (x * (k + (1 << 16))) >> 16 = ((x * k ) >> 16) + x - const __m128i k1 = _mm_set1_epi16(20091); - const __m128i k2 = _mm_set1_epi16(-30068); - __m128i T0, T1, T2, T3; - - // Load and concatenate the transform coefficients (we'll do two transforms - // in parallel). In the case of only one transform, the second half of the - // vectors will just contain random value we'll never use nor store. - __m128i in0, in1, in2, in3; - { - in0 = _mm_loadl_epi64((__m128i*)&in[0]); - in1 = _mm_loadl_epi64((__m128i*)&in[4]); - in2 = _mm_loadl_epi64((__m128i*)&in[8]); - in3 = _mm_loadl_epi64((__m128i*)&in[12]); - // a00 a10 a20 a30 x x x x - // a01 a11 a21 a31 x x x x - // a02 a12 a22 a32 x x x x - // a03 a13 a23 a33 x x x x - if (do_two) { - const __m128i inB0 = _mm_loadl_epi64((__m128i*)&in[16]); - const __m128i inB1 = _mm_loadl_epi64((__m128i*)&in[20]); - const __m128i inB2 = _mm_loadl_epi64((__m128i*)&in[24]); - const __m128i inB3 = _mm_loadl_epi64((__m128i*)&in[28]); - in0 = _mm_unpacklo_epi64(in0, inB0); - in1 = _mm_unpacklo_epi64(in1, inB1); - in2 = _mm_unpacklo_epi64(in2, inB2); - in3 = _mm_unpacklo_epi64(in3, inB3); - // a00 a10 a20 a30 b00 b10 b20 b30 - // a01 a11 a21 a31 b01 b11 b21 b31 - // a02 a12 a22 a32 b02 b12 b22 b32 - // a03 a13 a23 a33 b03 b13 b23 b33 - } - } - - // Vertical pass and subsequent transpose. - { - // First pass, c and d calculations are longer because of the "trick" - // multiplications. - const __m128i a = _mm_add_epi16(in0, in2); - const __m128i b = _mm_sub_epi16(in0, in2); - // c = MUL(in1, K2) - MUL(in3, K1) = MUL(in1, k2) - MUL(in3, k1) + in1 - in3 - const __m128i c1 = _mm_mulhi_epi16(in1, k2); - const __m128i c2 = _mm_mulhi_epi16(in3, k1); - const __m128i c3 = _mm_sub_epi16(in1, in3); - const __m128i c4 = _mm_sub_epi16(c1, c2); - const __m128i c = _mm_add_epi16(c3, c4); - // d = MUL(in1, K1) + MUL(in3, K2) = MUL(in1, k1) + MUL(in3, k2) + in1 + in3 - const __m128i d1 = _mm_mulhi_epi16(in1, k1); - const __m128i d2 = _mm_mulhi_epi16(in3, k2); - const __m128i d3 = _mm_add_epi16(in1, in3); - const __m128i d4 = _mm_add_epi16(d1, d2); - const __m128i d = _mm_add_epi16(d3, d4); - - // Second pass. - const __m128i tmp0 = _mm_add_epi16(a, d); - const __m128i tmp1 = _mm_add_epi16(b, c); - const __m128i tmp2 = _mm_sub_epi16(b, c); - const __m128i tmp3 = _mm_sub_epi16(a, d); - - // Transpose the two 4x4. - // a00 a01 a02 a03 b00 b01 b02 b03 - // a10 a11 a12 a13 b10 b11 b12 b13 - // a20 a21 a22 a23 b20 b21 b22 b23 - // a30 a31 a32 a33 b30 b31 b32 b33 - const __m128i transpose0_0 = _mm_unpacklo_epi16(tmp0, tmp1); - const __m128i transpose0_1 = _mm_unpacklo_epi16(tmp2, tmp3); - const __m128i transpose0_2 = _mm_unpackhi_epi16(tmp0, tmp1); - const __m128i transpose0_3 = _mm_unpackhi_epi16(tmp2, tmp3); - // a00 a10 a01 a11 a02 a12 a03 a13 - // a20 a30 a21 a31 a22 a32 a23 a33 - // b00 b10 b01 b11 b02 b12 b03 b13 - // b20 b30 b21 b31 b22 b32 b23 b33 - const __m128i transpose1_0 = _mm_unpacklo_epi32(transpose0_0, transpose0_1); - const __m128i transpose1_1 = _mm_unpacklo_epi32(transpose0_2, transpose0_3); - const __m128i transpose1_2 = _mm_unpackhi_epi32(transpose0_0, transpose0_1); - const __m128i transpose1_3 = _mm_unpackhi_epi32(transpose0_2, transpose0_3); - // a00 a10 a20 a30 a01 a11 a21 a31 - // b00 b10 b20 b30 b01 b11 b21 b31 - // a02 a12 a22 a32 a03 a13 a23 a33 - // b02 b12 a22 b32 b03 b13 b23 b33 - T0 = _mm_unpacklo_epi64(transpose1_0, transpose1_1); - T1 = _mm_unpackhi_epi64(transpose1_0, transpose1_1); - T2 = _mm_unpacklo_epi64(transpose1_2, transpose1_3); - T3 = _mm_unpackhi_epi64(transpose1_2, transpose1_3); - // a00 a10 a20 a30 b00 b10 b20 b30 - // a01 a11 a21 a31 b01 b11 b21 b31 - // a02 a12 a22 a32 b02 b12 b22 b32 - // a03 a13 a23 a33 b03 b13 b23 b33 - } - - // Horizontal pass and subsequent transpose. - { - // First pass, c and d calculations are longer because of the "trick" - // multiplications. - const __m128i four = _mm_set1_epi16(4); - const __m128i dc = _mm_add_epi16(T0, four); - const __m128i a = _mm_add_epi16(dc, T2); - const __m128i b = _mm_sub_epi16(dc, T2); - // c = MUL(T1, K2) - MUL(T3, K1) = MUL(T1, k2) - MUL(T3, k1) + T1 - T3 - const __m128i c1 = _mm_mulhi_epi16(T1, k2); - const __m128i c2 = _mm_mulhi_epi16(T3, k1); - const __m128i c3 = _mm_sub_epi16(T1, T3); - const __m128i c4 = _mm_sub_epi16(c1, c2); - const __m128i c = _mm_add_epi16(c3, c4); - // d = MUL(T1, K1) + MUL(T3, K2) = MUL(T1, k1) + MUL(T3, k2) + T1 + T3 - const __m128i d1 = _mm_mulhi_epi16(T1, k1); - const __m128i d2 = _mm_mulhi_epi16(T3, k2); - const __m128i d3 = _mm_add_epi16(T1, T3); - const __m128i d4 = _mm_add_epi16(d1, d2); - const __m128i d = _mm_add_epi16(d3, d4); - - // Second pass. - const __m128i tmp0 = _mm_add_epi16(a, d); - const __m128i tmp1 = _mm_add_epi16(b, c); - const __m128i tmp2 = _mm_sub_epi16(b, c); - const __m128i tmp3 = _mm_sub_epi16(a, d); - const __m128i shifted0 = _mm_srai_epi16(tmp0, 3); - const __m128i shifted1 = _mm_srai_epi16(tmp1, 3); - const __m128i shifted2 = _mm_srai_epi16(tmp2, 3); - const __m128i shifted3 = _mm_srai_epi16(tmp3, 3); - - // Transpose the two 4x4. - // a00 a01 a02 a03 b00 b01 b02 b03 - // a10 a11 a12 a13 b10 b11 b12 b13 - // a20 a21 a22 a23 b20 b21 b22 b23 - // a30 a31 a32 a33 b30 b31 b32 b33 - const __m128i transpose0_0 = _mm_unpacklo_epi16(shifted0, shifted1); - const __m128i transpose0_1 = _mm_unpacklo_epi16(shifted2, shifted3); - const __m128i transpose0_2 = _mm_unpackhi_epi16(shifted0, shifted1); - const __m128i transpose0_3 = _mm_unpackhi_epi16(shifted2, shifted3); - // a00 a10 a01 a11 a02 a12 a03 a13 - // a20 a30 a21 a31 a22 a32 a23 a33 - // b00 b10 b01 b11 b02 b12 b03 b13 - // b20 b30 b21 b31 b22 b32 b23 b33 - const __m128i transpose1_0 = _mm_unpacklo_epi32(transpose0_0, transpose0_1); - const __m128i transpose1_1 = _mm_unpacklo_epi32(transpose0_2, transpose0_3); - const __m128i transpose1_2 = _mm_unpackhi_epi32(transpose0_0, transpose0_1); - const __m128i transpose1_3 = _mm_unpackhi_epi32(transpose0_2, transpose0_3); - // a00 a10 a20 a30 a01 a11 a21 a31 - // b00 b10 b20 b30 b01 b11 b21 b31 - // a02 a12 a22 a32 a03 a13 a23 a33 - // b02 b12 a22 b32 b03 b13 b23 b33 - T0 = _mm_unpacklo_epi64(transpose1_0, transpose1_1); - T1 = _mm_unpackhi_epi64(transpose1_0, transpose1_1); - T2 = _mm_unpacklo_epi64(transpose1_2, transpose1_3); - T3 = _mm_unpackhi_epi64(transpose1_2, transpose1_3); - // a00 a10 a20 a30 b00 b10 b20 b30 - // a01 a11 a21 a31 b01 b11 b21 b31 - // a02 a12 a22 a32 b02 b12 b22 b32 - // a03 a13 a23 a33 b03 b13 b23 b33 - } - - // Add inverse transform to 'dst' and store. - { - const __m128i zero = _mm_set1_epi16(0); - // Load the reference(s). - __m128i dst0, dst1, dst2, dst3; - if (do_two) { - // Load eight bytes/pixels per line. - dst0 = _mm_loadl_epi64((__m128i*)&dst[0 * BPS]); - dst1 = _mm_loadl_epi64((__m128i*)&dst[1 * BPS]); - dst2 = _mm_loadl_epi64((__m128i*)&dst[2 * BPS]); - dst3 = _mm_loadl_epi64((__m128i*)&dst[3 * BPS]); - } else { - // Load four bytes/pixels per line. - dst0 = _mm_cvtsi32_si128(*(int*)&dst[0 * BPS]); - dst1 = _mm_cvtsi32_si128(*(int*)&dst[1 * BPS]); - dst2 = _mm_cvtsi32_si128(*(int*)&dst[2 * BPS]); - dst3 = _mm_cvtsi32_si128(*(int*)&dst[3 * BPS]); - } - // Convert to 16b. - dst0 = _mm_unpacklo_epi8(dst0, zero); - dst1 = _mm_unpacklo_epi8(dst1, zero); - dst2 = _mm_unpacklo_epi8(dst2, zero); - dst3 = _mm_unpacklo_epi8(dst3, zero); - // Add the inverse transform(s). - dst0 = _mm_add_epi16(dst0, T0); - dst1 = _mm_add_epi16(dst1, T1); - dst2 = _mm_add_epi16(dst2, T2); - dst3 = _mm_add_epi16(dst3, T3); - // Unsigned saturate to 8b. - dst0 = _mm_packus_epi16(dst0, dst0); - dst1 = _mm_packus_epi16(dst1, dst1); - dst2 = _mm_packus_epi16(dst2, dst2); - dst3 = _mm_packus_epi16(dst3, dst3); - // Store the results. - if (do_two) { - // Store eight bytes/pixels per line. - _mm_storel_epi64((__m128i*)&dst[0 * BPS], dst0); - _mm_storel_epi64((__m128i*)&dst[1 * BPS], dst1); - _mm_storel_epi64((__m128i*)&dst[2 * BPS], dst2); - _mm_storel_epi64((__m128i*)&dst[3 * BPS], dst3); - } else { - // Store four bytes/pixels per line. - *((int32_t *)&dst[0 * BPS]) = _mm_cvtsi128_si32(dst0); - *((int32_t *)&dst[1 * BPS]) = _mm_cvtsi128_si32(dst1); - *((int32_t *)&dst[2 * BPS]) = _mm_cvtsi128_si32(dst2); - *((int32_t *)&dst[3 * BPS]) = _mm_cvtsi128_si32(dst3); - } - } -} - -//------------------------------------------------------------------------------ -// Loop Filter (Paragraph 15) - -// Compute abs(p - q) = subs(p - q) OR subs(q - p) -#define MM_ABS(p, q) _mm_or_si128( \ - _mm_subs_epu8((q), (p)), \ - _mm_subs_epu8((p), (q))) - -// Shift each byte of "a" by N bits while preserving by the sign bit. -// -// It first shifts the lower bytes of the words and then the upper bytes and -// then merges the results together. -#define SIGNED_SHIFT_N(a, N) { \ - __m128i t = a; \ - t = _mm_slli_epi16(t, 8); \ - t = _mm_srai_epi16(t, N); \ - t = _mm_srli_epi16(t, 8); \ - \ - a = _mm_srai_epi16(a, N + 8); \ - a = _mm_slli_epi16(a, 8); \ - \ - a = _mm_or_si128(t, a); \ -} - -#define FLIP_SIGN_BIT2(a, b) { \ - a = _mm_xor_si128(a, sign_bit); \ - b = _mm_xor_si128(b, sign_bit); \ -} - -#define FLIP_SIGN_BIT4(a, b, c, d) { \ - FLIP_SIGN_BIT2(a, b); \ - FLIP_SIGN_BIT2(c, d); \ -} - -#define GET_NOTHEV(p1, p0, q0, q1, hev_thresh, not_hev) { \ - const __m128i zero = _mm_setzero_si128(); \ - const __m128i t1 = MM_ABS(p1, p0); \ - const __m128i t2 = MM_ABS(q1, q0); \ - \ - const __m128i h = _mm_set1_epi8(hev_thresh); \ - const __m128i t3 = _mm_subs_epu8(t1, h); /* abs(p1 - p0) - hev_tresh */ \ - const __m128i t4 = _mm_subs_epu8(t2, h); /* abs(q1 - q0) - hev_tresh */ \ - \ - not_hev = _mm_or_si128(t3, t4); \ - not_hev = _mm_cmpeq_epi8(not_hev, zero); /* not_hev <= t1 && not_hev <= t2 */\ -} - -#define GET_BASE_DELTA(p1, p0, q0, q1, o) { \ - const __m128i qp0 = _mm_subs_epi8(q0, p0); /* q0 - p0 */ \ - o = _mm_subs_epi8(p1, q1); /* p1 - q1 */ \ - o = _mm_adds_epi8(o, qp0); /* p1 - q1 + 1 * (q0 - p0) */ \ - o = _mm_adds_epi8(o, qp0); /* p1 - q1 + 2 * (q0 - p0) */ \ - o = _mm_adds_epi8(o, qp0); /* p1 - q1 + 3 * (q0 - p0) */ \ -} - -#define DO_SIMPLE_FILTER(p0, q0, fl) { \ - const __m128i three = _mm_set1_epi8(3); \ - const __m128i four = _mm_set1_epi8(4); \ - __m128i v3 = _mm_adds_epi8(fl, three); \ - __m128i v4 = _mm_adds_epi8(fl, four); \ - \ - /* Do +4 side */ \ - SIGNED_SHIFT_N(v4, 3); /* v4 >> 3 */ \ - q0 = _mm_subs_epi8(q0, v4); /* q0 -= v4 */ \ - \ - /* Now do +3 side */ \ - SIGNED_SHIFT_N(v3, 3); /* v3 >> 3 */ \ - p0 = _mm_adds_epi8(p0, v3); /* p0 += v3 */ \ -} - -// Updates values of 2 pixels at MB edge during complex filtering. -// Update operations: -// q = q - a and p = p + a; where a = [(a_hi >> 7), (a_lo >> 7)] -#define UPDATE_2PIXELS(pi, qi, a_lo, a_hi) { \ - const __m128i a_lo7 = _mm_srai_epi16(a_lo, 7); \ - const __m128i a_hi7 = _mm_srai_epi16(a_hi, 7); \ - const __m128i a = _mm_packs_epi16(a_lo7, a_hi7); \ - pi = _mm_adds_epi8(pi, a); \ - qi = _mm_subs_epi8(qi, a); \ -} - -static void NeedsFilter(const __m128i* p1, const __m128i* p0, const __m128i* q0, - const __m128i* q1, int thresh, __m128i *mask) { - __m128i t1 = MM_ABS(*p1, *q1); // abs(p1 - q1) - *mask = _mm_set1_epi8(0xFE); - t1 = _mm_and_si128(t1, *mask); // set lsb of each byte to zero - t1 = _mm_srli_epi16(t1, 1); // abs(p1 - q1) / 2 - - *mask = MM_ABS(*p0, *q0); // abs(p0 - q0) - *mask = _mm_adds_epu8(*mask, *mask); // abs(p0 - q0) * 2 - *mask = _mm_adds_epu8(*mask, t1); // abs(p0 - q0) * 2 + abs(p1 - q1) / 2 - - t1 = _mm_set1_epi8(thresh); - *mask = _mm_subs_epu8(*mask, t1); // mask <= thresh - *mask = _mm_cmpeq_epi8(*mask, _mm_setzero_si128()); -} - -//------------------------------------------------------------------------------ -// Edge filtering functions - -// Applies filter on 2 pixels (p0 and q0) -static WEBP_INLINE void DoFilter2(const __m128i* p1, __m128i* p0, __m128i* q0, - const __m128i* q1, int thresh) { - __m128i a, mask; - const __m128i sign_bit = _mm_set1_epi8(0x80); - const __m128i p1s = _mm_xor_si128(*p1, sign_bit); - const __m128i q1s = _mm_xor_si128(*q1, sign_bit); - - NeedsFilter(p1, p0, q0, q1, thresh, &mask); - - // convert to signed values - FLIP_SIGN_BIT2(*p0, *q0); - - GET_BASE_DELTA(p1s, *p0, *q0, q1s, a); - a = _mm_and_si128(a, mask); // mask filter values we don't care about - DO_SIMPLE_FILTER(*p0, *q0, a); - - // unoffset - FLIP_SIGN_BIT2(*p0, *q0); -} - -// Applies filter on 4 pixels (p1, p0, q0 and q1) -static WEBP_INLINE void DoFilter4(__m128i* p1, __m128i *p0, - __m128i* q0, __m128i* q1, - const __m128i* mask, int hev_thresh) { - __m128i not_hev; - __m128i t1, t2, t3; - const __m128i sign_bit = _mm_set1_epi8(0x80); - - // compute hev mask - GET_NOTHEV(*p1, *p0, *q0, *q1, hev_thresh, not_hev); - - // convert to signed values - FLIP_SIGN_BIT4(*p1, *p0, *q0, *q1); - - t1 = _mm_subs_epi8(*p1, *q1); // p1 - q1 - t1 = _mm_andnot_si128(not_hev, t1); // hev(p1 - q1) - t2 = _mm_subs_epi8(*q0, *p0); // q0 - p0 - t1 = _mm_adds_epi8(t1, t2); // hev(p1 - q1) + 1 * (q0 - p0) - t1 = _mm_adds_epi8(t1, t2); // hev(p1 - q1) + 2 * (q0 - p0) - t1 = _mm_adds_epi8(t1, t2); // hev(p1 - q1) + 3 * (q0 - p0) - t1 = _mm_and_si128(t1, *mask); // mask filter values we don't care about - - // Do +4 side - t2 = _mm_set1_epi8(4); - t2 = _mm_adds_epi8(t1, t2); // 3 * (q0 - p0) + (p1 - q1) + 4 - SIGNED_SHIFT_N(t2, 3); // (3 * (q0 - p0) + hev(p1 - q1) + 4) >> 3 - t3 = t2; // save t2 - *q0 = _mm_subs_epi8(*q0, t2); // q0 -= t2 - - // Now do +3 side - t2 = _mm_set1_epi8(3); - t2 = _mm_adds_epi8(t1, t2); // +3 instead of +4 - SIGNED_SHIFT_N(t2, 3); // (3 * (q0 - p0) + hev(p1 - q1) + 3) >> 3 - *p0 = _mm_adds_epi8(*p0, t2); // p0 += t2 - - t2 = _mm_set1_epi8(1); - t3 = _mm_adds_epi8(t3, t2); - SIGNED_SHIFT_N(t3, 1); // (3 * (q0 - p0) + hev(p1 - q1) + 4) >> 4 - - t3 = _mm_and_si128(not_hev, t3); // if !hev - *q1 = _mm_subs_epi8(*q1, t3); // q1 -= t3 - *p1 = _mm_adds_epi8(*p1, t3); // p1 += t3 - - // unoffset - FLIP_SIGN_BIT4(*p1, *p0, *q0, *q1); -} - -// Applies filter on 6 pixels (p2, p1, p0, q0, q1 and q2) -static WEBP_INLINE void DoFilter6(__m128i *p2, __m128i* p1, __m128i *p0, - __m128i* q0, __m128i* q1, __m128i *q2, - const __m128i* mask, int hev_thresh) { - __m128i a, not_hev; - const __m128i sign_bit = _mm_set1_epi8(0x80); - - // compute hev mask - GET_NOTHEV(*p1, *p0, *q0, *q1, hev_thresh, not_hev); - - // convert to signed values - FLIP_SIGN_BIT4(*p1, *p0, *q0, *q1); - FLIP_SIGN_BIT2(*p2, *q2); - - GET_BASE_DELTA(*p1, *p0, *q0, *q1, a); - - { // do simple filter on pixels with hev - const __m128i m = _mm_andnot_si128(not_hev, *mask); - const __m128i f = _mm_and_si128(a, m); - DO_SIMPLE_FILTER(*p0, *q0, f); - } - { // do strong filter on pixels with not hev - const __m128i zero = _mm_setzero_si128(); - const __m128i nine = _mm_set1_epi16(0x0900); - const __m128i sixty_three = _mm_set1_epi16(63); - - const __m128i m = _mm_and_si128(not_hev, *mask); - const __m128i f = _mm_and_si128(a, m); - const __m128i f_lo = _mm_unpacklo_epi8(zero, f); - const __m128i f_hi = _mm_unpackhi_epi8(zero, f); - - const __m128i f9_lo = _mm_mulhi_epi16(f_lo, nine); // Filter (lo) * 9 - const __m128i f9_hi = _mm_mulhi_epi16(f_hi, nine); // Filter (hi) * 9 - const __m128i f18_lo = _mm_add_epi16(f9_lo, f9_lo); // Filter (lo) * 18 - const __m128i f18_hi = _mm_add_epi16(f9_hi, f9_hi); // Filter (hi) * 18 - - const __m128i a2_lo = _mm_add_epi16(f9_lo, sixty_three); // Filter * 9 + 63 - const __m128i a2_hi = _mm_add_epi16(f9_hi, sixty_three); // Filter * 9 + 63 - - const __m128i a1_lo = _mm_add_epi16(f18_lo, sixty_three); // F... * 18 + 63 - const __m128i a1_hi = _mm_add_epi16(f18_hi, sixty_three); // F... * 18 + 63 - - const __m128i a0_lo = _mm_add_epi16(f18_lo, a2_lo); // Filter * 27 + 63 - const __m128i a0_hi = _mm_add_epi16(f18_hi, a2_hi); // Filter * 27 + 63 - - UPDATE_2PIXELS(*p2, *q2, a2_lo, a2_hi); - UPDATE_2PIXELS(*p1, *q1, a1_lo, a1_hi); - UPDATE_2PIXELS(*p0, *q0, a0_lo, a0_hi); - } - - // unoffset - FLIP_SIGN_BIT4(*p1, *p0, *q0, *q1); - FLIP_SIGN_BIT2(*p2, *q2); -} - -// reads 8 rows across a vertical edge. -// -// TODO(somnath): Investigate _mm_shuffle* also see if it can be broken into -// two Load4x4() to avoid code duplication. -static WEBP_INLINE void Load8x4(const uint8_t* b, int stride, - __m128i* p, __m128i* q) { - __m128i t1, t2; - - // Load 0th, 1st, 4th and 5th rows - __m128i r0 = _mm_cvtsi32_si128(*((int*)&b[0 * stride])); // 03 02 01 00 - __m128i r1 = _mm_cvtsi32_si128(*((int*)&b[1 * stride])); // 13 12 11 10 - __m128i r4 = _mm_cvtsi32_si128(*((int*)&b[4 * stride])); // 43 42 41 40 - __m128i r5 = _mm_cvtsi32_si128(*((int*)&b[5 * stride])); // 53 52 51 50 - - r0 = _mm_unpacklo_epi32(r0, r4); // 43 42 41 40 03 02 01 00 - r1 = _mm_unpacklo_epi32(r1, r5); // 53 52 51 50 13 12 11 10 - - // t1 = 53 43 52 42 51 41 50 40 13 03 12 02 11 01 10 00 - t1 = _mm_unpacklo_epi8(r0, r1); - - // Load 2nd, 3rd, 6th and 7th rows - r0 = _mm_cvtsi32_si128(*((int*)&b[2 * stride])); // 23 22 21 22 - r1 = _mm_cvtsi32_si128(*((int*)&b[3 * stride])); // 33 32 31 30 - r4 = _mm_cvtsi32_si128(*((int*)&b[6 * stride])); // 63 62 61 60 - r5 = _mm_cvtsi32_si128(*((int*)&b[7 * stride])); // 73 72 71 70 - - r0 = _mm_unpacklo_epi32(r0, r4); // 63 62 61 60 23 22 21 20 - r1 = _mm_unpacklo_epi32(r1, r5); // 73 72 71 70 33 32 31 30 - - // t2 = 73 63 72 62 71 61 70 60 33 23 32 22 31 21 30 20 - t2 = _mm_unpacklo_epi8(r0, r1); - - // t1 = 33 23 13 03 32 22 12 02 31 21 11 01 30 20 10 00 - // t2 = 73 63 53 43 72 62 52 42 71 61 51 41 70 60 50 40 - r0 = t1; - t1 = _mm_unpacklo_epi16(t1, t2); - t2 = _mm_unpackhi_epi16(r0, t2); - - // *p = 71 61 51 41 31 21 11 01 70 60 50 40 30 20 10 00 - // *q = 73 63 53 43 33 23 13 03 72 62 52 42 32 22 12 02 - *p = _mm_unpacklo_epi32(t1, t2); - *q = _mm_unpackhi_epi32(t1, t2); -} - -static WEBP_INLINE void Load16x4(const uint8_t* r0, const uint8_t* r8, - int stride, - __m128i* p1, __m128i* p0, - __m128i* q0, __m128i* q1) { - __m128i t1, t2; - // Assume the pixels around the edge (|) are numbered as follows - // 00 01 | 02 03 - // 10 11 | 12 13 - // ... | ... - // e0 e1 | e2 e3 - // f0 f1 | f2 f3 - // - // r0 is pointing to the 0th row (00) - // r8 is pointing to the 8th row (80) - - // Load - // p1 = 71 61 51 41 31 21 11 01 70 60 50 40 30 20 10 00 - // q0 = 73 63 53 43 33 23 13 03 72 62 52 42 32 22 12 02 - // p0 = f1 e1 d1 c1 b1 a1 91 81 f0 e0 d0 c0 b0 a0 90 80 - // q1 = f3 e3 d3 c3 b3 a3 93 83 f2 e2 d2 c2 b2 a2 92 82 - Load8x4(r0, stride, p1, q0); - Load8x4(r8, stride, p0, q1); - - t1 = *p1; - t2 = *q0; - // p1 = f0 e0 d0 c0 b0 a0 90 80 70 60 50 40 30 20 10 00 - // p0 = f1 e1 d1 c1 b1 a1 91 81 71 61 51 41 31 21 11 01 - // q0 = f2 e2 d2 c2 b2 a2 92 82 72 62 52 42 32 22 12 02 - // q1 = f3 e3 d3 c3 b3 a3 93 83 73 63 53 43 33 23 13 03 - *p1 = _mm_unpacklo_epi64(t1, *p0); - *p0 = _mm_unpackhi_epi64(t1, *p0); - *q0 = _mm_unpacklo_epi64(t2, *q1); - *q1 = _mm_unpackhi_epi64(t2, *q1); -} - -static WEBP_INLINE void Store4x4(__m128i* x, uint8_t* dst, int stride) { - int i; - for (i = 0; i < 4; ++i, dst += stride) { - *((int32_t*)dst) = _mm_cvtsi128_si32(*x); - *x = _mm_srli_si128(*x, 4); - } -} - -// Transpose back and store -static WEBP_INLINE void Store16x4(uint8_t* r0, uint8_t* r8, int stride, - __m128i* p1, __m128i* p0, - __m128i* q0, __m128i* q1) { - __m128i t1; - - // p0 = 71 70 61 60 51 50 41 40 31 30 21 20 11 10 01 00 - // p1 = f1 f0 e1 e0 d1 d0 c1 c0 b1 b0 a1 a0 91 90 81 80 - t1 = *p0; - *p0 = _mm_unpacklo_epi8(*p1, t1); - *p1 = _mm_unpackhi_epi8(*p1, t1); - - // q0 = 73 72 63 62 53 52 43 42 33 32 23 22 13 12 03 02 - // q1 = f3 f2 e3 e2 d3 d2 c3 c2 b3 b2 a3 a2 93 92 83 82 - t1 = *q0; - *q0 = _mm_unpacklo_epi8(t1, *q1); - *q1 = _mm_unpackhi_epi8(t1, *q1); - - // p0 = 33 32 31 30 23 22 21 20 13 12 11 10 03 02 01 00 - // q0 = 73 72 71 70 63 62 61 60 53 52 51 50 43 42 41 40 - t1 = *p0; - *p0 = _mm_unpacklo_epi16(t1, *q0); - *q0 = _mm_unpackhi_epi16(t1, *q0); - - // p1 = b3 b2 b1 b0 a3 a2 a1 a0 93 92 91 90 83 82 81 80 - // q1 = f3 f2 f1 f0 e3 e2 e1 e0 d3 d2 d1 d0 c3 c2 c1 c0 - t1 = *p1; - *p1 = _mm_unpacklo_epi16(t1, *q1); - *q1 = _mm_unpackhi_epi16(t1, *q1); - - Store4x4(p0, r0, stride); - r0 += 4 * stride; - Store4x4(q0, r0, stride); - - Store4x4(p1, r8, stride); - r8 += 4 * stride; - Store4x4(q1, r8, stride); -} - -//------------------------------------------------------------------------------ -// Simple In-loop filtering (Paragraph 15.2) - -static void SimpleVFilter16SSE2(uint8_t* p, int stride, int thresh) { - // Load - __m128i p1 = _mm_loadu_si128((__m128i*)&p[-2 * stride]); - __m128i p0 = _mm_loadu_si128((__m128i*)&p[-stride]); - __m128i q0 = _mm_loadu_si128((__m128i*)&p[0]); - __m128i q1 = _mm_loadu_si128((__m128i*)&p[stride]); - - DoFilter2(&p1, &p0, &q0, &q1, thresh); - - // Store - _mm_storeu_si128((__m128i*)&p[-stride], p0); - _mm_storeu_si128((__m128i*)p, q0); -} - -static void SimpleHFilter16SSE2(uint8_t* p, int stride, int thresh) { - __m128i p1, p0, q0, q1; - - p -= 2; // beginning of p1 - - Load16x4(p, p + 8 * stride, stride, &p1, &p0, &q0, &q1); - DoFilter2(&p1, &p0, &q0, &q1, thresh); - Store16x4(p, p + 8 * stride, stride, &p1, &p0, &q0, &q1); -} - -static void SimpleVFilter16iSSE2(uint8_t* p, int stride, int thresh) { - int k; - for (k = 3; k > 0; --k) { - p += 4 * stride; - SimpleVFilter16SSE2(p, stride, thresh); - } -} - -static void SimpleHFilter16iSSE2(uint8_t* p, int stride, int thresh) { - int k; - for (k = 3; k > 0; --k) { - p += 4; - SimpleHFilter16SSE2(p, stride, thresh); - } -} - -//------------------------------------------------------------------------------ -// Complex In-loop filtering (Paragraph 15.3) - -#define MAX_DIFF1(p3, p2, p1, p0, m) { \ - m = MM_ABS(p3, p2); \ - m = _mm_max_epu8(m, MM_ABS(p2, p1)); \ - m = _mm_max_epu8(m, MM_ABS(p1, p0)); \ -} - -#define MAX_DIFF2(p3, p2, p1, p0, m) { \ - m = _mm_max_epu8(m, MM_ABS(p3, p2)); \ - m = _mm_max_epu8(m, MM_ABS(p2, p1)); \ - m = _mm_max_epu8(m, MM_ABS(p1, p0)); \ -} - -#define LOAD_H_EDGES4(p, stride, e1, e2, e3, e4) { \ - e1 = _mm_loadu_si128((__m128i*)&(p)[0 * stride]); \ - e2 = _mm_loadu_si128((__m128i*)&(p)[1 * stride]); \ - e3 = _mm_loadu_si128((__m128i*)&(p)[2 * stride]); \ - e4 = _mm_loadu_si128((__m128i*)&(p)[3 * stride]); \ -} - -#define LOADUV_H_EDGE(p, u, v, stride) { \ - p = _mm_loadl_epi64((__m128i*)&(u)[(stride)]); \ - p = _mm_unpacklo_epi64(p, _mm_loadl_epi64((__m128i*)&(v)[(stride)])); \ -} - -#define LOADUV_H_EDGES4(u, v, stride, e1, e2, e3, e4) { \ - LOADUV_H_EDGE(e1, u, v, 0 * stride); \ - LOADUV_H_EDGE(e2, u, v, 1 * stride); \ - LOADUV_H_EDGE(e3, u, v, 2 * stride); \ - LOADUV_H_EDGE(e4, u, v, 3 * stride); \ -} - -#define STOREUV(p, u, v, stride) { \ - _mm_storel_epi64((__m128i*)&u[(stride)], p); \ - p = _mm_srli_si128(p, 8); \ - _mm_storel_epi64((__m128i*)&v[(stride)], p); \ -} - -#define COMPLEX_FL_MASK(p1, p0, q0, q1, thresh, ithresh, mask) { \ - __m128i fl_yes; \ - const __m128i it = _mm_set1_epi8(ithresh); \ - mask = _mm_subs_epu8(mask, it); \ - mask = _mm_cmpeq_epi8(mask, _mm_setzero_si128()); \ - NeedsFilter(&p1, &p0, &q0, &q1, thresh, &fl_yes); \ - mask = _mm_and_si128(mask, fl_yes); \ -} - -// on macroblock edges -static void VFilter16SSE2(uint8_t* p, int stride, - int thresh, int ithresh, int hev_thresh) { - __m128i t1; - __m128i mask; - __m128i p2, p1, p0, q0, q1, q2; - - // Load p3, p2, p1, p0 - LOAD_H_EDGES4(p - 4 * stride, stride, t1, p2, p1, p0); - MAX_DIFF1(t1, p2, p1, p0, mask); - - // Load q0, q1, q2, q3 - LOAD_H_EDGES4(p, stride, q0, q1, q2, t1); - MAX_DIFF2(t1, q2, q1, q0, mask); - - COMPLEX_FL_MASK(p1, p0, q0, q1, thresh, ithresh, mask); - DoFilter6(&p2, &p1, &p0, &q0, &q1, &q2, &mask, hev_thresh); - - // Store - _mm_storeu_si128((__m128i*)&p[-3 * stride], p2); - _mm_storeu_si128((__m128i*)&p[-2 * stride], p1); - _mm_storeu_si128((__m128i*)&p[-1 * stride], p0); - _mm_storeu_si128((__m128i*)&p[0 * stride], q0); - _mm_storeu_si128((__m128i*)&p[1 * stride], q1); - _mm_storeu_si128((__m128i*)&p[2 * stride], q2); -} - -static void HFilter16SSE2(uint8_t* p, int stride, - int thresh, int ithresh, int hev_thresh) { - __m128i mask; - __m128i p3, p2, p1, p0, q0, q1, q2, q3; - - uint8_t* const b = p - 4; - Load16x4(b, b + 8 * stride, stride, &p3, &p2, &p1, &p0); // p3, p2, p1, p0 - MAX_DIFF1(p3, p2, p1, p0, mask); - - Load16x4(p, p + 8 * stride, stride, &q0, &q1, &q2, &q3); // q0, q1, q2, q3 - MAX_DIFF2(q3, q2, q1, q0, mask); - - COMPLEX_FL_MASK(p1, p0, q0, q1, thresh, ithresh, mask); - DoFilter6(&p2, &p1, &p0, &q0, &q1, &q2, &mask, hev_thresh); - - Store16x4(b, b + 8 * stride, stride, &p3, &p2, &p1, &p0); - Store16x4(p, p + 8 * stride, stride, &q0, &q1, &q2, &q3); -} - -// on three inner edges -static void VFilter16iSSE2(uint8_t* p, int stride, - int thresh, int ithresh, int hev_thresh) { - int k; - __m128i mask; - __m128i t1, t2, p1, p0, q0, q1; - - for (k = 3; k > 0; --k) { - // Load p3, p2, p1, p0 - LOAD_H_EDGES4(p, stride, t2, t1, p1, p0); - MAX_DIFF1(t2, t1, p1, p0, mask); - - p += 4 * stride; - - // Load q0, q1, q2, q3 - LOAD_H_EDGES4(p, stride, q0, q1, t1, t2); - MAX_DIFF2(t2, t1, q1, q0, mask); - - COMPLEX_FL_MASK(p1, p0, q0, q1, thresh, ithresh, mask); - DoFilter4(&p1, &p0, &q0, &q1, &mask, hev_thresh); - - // Store - _mm_storeu_si128((__m128i*)&p[-2 * stride], p1); - _mm_storeu_si128((__m128i*)&p[-1 * stride], p0); - _mm_storeu_si128((__m128i*)&p[0 * stride], q0); - _mm_storeu_si128((__m128i*)&p[1 * stride], q1); - } -} - -static void HFilter16iSSE2(uint8_t* p, int stride, - int thresh, int ithresh, int hev_thresh) { - int k; - uint8_t* b; - __m128i mask; - __m128i t1, t2, p1, p0, q0, q1; - - for (k = 3; k > 0; --k) { - b = p; - Load16x4(b, b + 8 * stride, stride, &t2, &t1, &p1, &p0); // p3, p2, p1, p0 - MAX_DIFF1(t2, t1, p1, p0, mask); - - b += 4; // beginning of q0 - Load16x4(b, b + 8 * stride, stride, &q0, &q1, &t1, &t2); // q0, q1, q2, q3 - MAX_DIFF2(t2, t1, q1, q0, mask); - - COMPLEX_FL_MASK(p1, p0, q0, q1, thresh, ithresh, mask); - DoFilter4(&p1, &p0, &q0, &q1, &mask, hev_thresh); - - b -= 2; // beginning of p1 - Store16x4(b, b + 8 * stride, stride, &p1, &p0, &q0, &q1); - - p += 4; - } -} - -// 8-pixels wide variant, for chroma filtering -static void VFilter8SSE2(uint8_t* u, uint8_t* v, int stride, - int thresh, int ithresh, int hev_thresh) { - __m128i mask; - __m128i t1, p2, p1, p0, q0, q1, q2; - - // Load p3, p2, p1, p0 - LOADUV_H_EDGES4(u - 4 * stride, v - 4 * stride, stride, t1, p2, p1, p0); - MAX_DIFF1(t1, p2, p1, p0, mask); - - // Load q0, q1, q2, q3 - LOADUV_H_EDGES4(u, v, stride, q0, q1, q2, t1); - MAX_DIFF2(t1, q2, q1, q0, mask); - - COMPLEX_FL_MASK(p1, p0, q0, q1, thresh, ithresh, mask); - DoFilter6(&p2, &p1, &p0, &q0, &q1, &q2, &mask, hev_thresh); - - // Store - STOREUV(p2, u, v, -3 * stride); - STOREUV(p1, u, v, -2 * stride); - STOREUV(p0, u, v, -1 * stride); - STOREUV(q0, u, v, 0 * stride); - STOREUV(q1, u, v, 1 * stride); - STOREUV(q2, u, v, 2 * stride); -} - -static void HFilter8SSE2(uint8_t* u, uint8_t* v, int stride, - int thresh, int ithresh, int hev_thresh) { - __m128i mask; - __m128i p3, p2, p1, p0, q0, q1, q2, q3; - - uint8_t* const tu = u - 4; - uint8_t* const tv = v - 4; - Load16x4(tu, tv, stride, &p3, &p2, &p1, &p0); // p3, p2, p1, p0 - MAX_DIFF1(p3, p2, p1, p0, mask); - - Load16x4(u, v, stride, &q0, &q1, &q2, &q3); // q0, q1, q2, q3 - MAX_DIFF2(q3, q2, q1, q0, mask); - - COMPLEX_FL_MASK(p1, p0, q0, q1, thresh, ithresh, mask); - DoFilter6(&p2, &p1, &p0, &q0, &q1, &q2, &mask, hev_thresh); - - Store16x4(tu, tv, stride, &p3, &p2, &p1, &p0); - Store16x4(u, v, stride, &q0, &q1, &q2, &q3); -} - -static void VFilter8iSSE2(uint8_t* u, uint8_t* v, int stride, - int thresh, int ithresh, int hev_thresh) { - __m128i mask; - __m128i t1, t2, p1, p0, q0, q1; - - // Load p3, p2, p1, p0 - LOADUV_H_EDGES4(u, v, stride, t2, t1, p1, p0); - MAX_DIFF1(t2, t1, p1, p0, mask); - - u += 4 * stride; - v += 4 * stride; - - // Load q0, q1, q2, q3 - LOADUV_H_EDGES4(u, v, stride, q0, q1, t1, t2); - MAX_DIFF2(t2, t1, q1, q0, mask); - - COMPLEX_FL_MASK(p1, p0, q0, q1, thresh, ithresh, mask); - DoFilter4(&p1, &p0, &q0, &q1, &mask, hev_thresh); - - // Store - STOREUV(p1, u, v, -2 * stride); - STOREUV(p0, u, v, -1 * stride); - STOREUV(q0, u, v, 0 * stride); - STOREUV(q1, u, v, 1 * stride); -} - -static void HFilter8iSSE2(uint8_t* u, uint8_t* v, int stride, - int thresh, int ithresh, int hev_thresh) { - __m128i mask; - __m128i t1, t2, p1, p0, q0, q1; - Load16x4(u, v, stride, &t2, &t1, &p1, &p0); // p3, p2, p1, p0 - MAX_DIFF1(t2, t1, p1, p0, mask); - - u += 4; // beginning of q0 - v += 4; - Load16x4(u, v, stride, &q0, &q1, &t1, &t2); // q0, q1, q2, q3 - MAX_DIFF2(t2, t1, q1, q0, mask); - - COMPLEX_FL_MASK(p1, p0, q0, q1, thresh, ithresh, mask); - DoFilter4(&p1, &p0, &q0, &q1, &mask, hev_thresh); - - u -= 2; // beginning of p1 - v -= 2; - Store16x4(u, v, stride, &p1, &p0, &q0, &q1); -} - -#endif // WEBP_USE_SSE2 - -//------------------------------------------------------------------------------ -// Entry point - -extern void VP8DspInitSSE2(void); - -void VP8DspInitSSE2(void) { -#if defined(WEBP_USE_SSE2) - VP8Transform = TransformSSE2; - - VP8VFilter16 = VFilter16SSE2; - VP8HFilter16 = HFilter16SSE2; - VP8VFilter8 = VFilter8SSE2; - VP8HFilter8 = HFilter8SSE2; - VP8VFilter16i = VFilter16iSSE2; - VP8HFilter16i = HFilter16iSSE2; - VP8VFilter8i = VFilter8iSSE2; - VP8HFilter8i = HFilter8iSSE2; - - VP8SimpleVFilter16 = SimpleVFilter16SSE2; - VP8SimpleHFilter16 = SimpleHFilter16SSE2; - VP8SimpleVFilter16i = SimpleVFilter16iSSE2; - VP8SimpleHFilter16i = SimpleHFilter16iSSE2; -#endif // WEBP_USE_SSE2 -} - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif diff --git a/external/libwebp/dsp/dsp.h b/external/libwebp/dsp/dsp.h deleted file mode 100644 index 0982451520..0000000000 --- a/external/libwebp/dsp/dsp.h +++ /dev/null @@ -1,212 +0,0 @@ -// Copyright 2011 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Speed-critical functions. -// -// Author: Skal (pascal.massimino@gmail.com) - -#ifndef WEBP_DSP_DSP_H_ -#define WEBP_DSP_DSP_H_ - -#include "platform/CCPlatformConfig.h" - -#include "../webp/types.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -//------------------------------------------------------------------------------ -// CPU detection - -#if defined(_MSC_VER) && (defined(_M_X64) || defined(_M_IX86)) && (CC_TARGET_PLATFORM != CC_PLATFORM_MARMALADE) -#define WEBP_MSC_SSE2 // Visual C++ SSE2 targets -#endif - -#if (defined(__SSE2__) || defined(WEBP_MSC_SSE2)) && (CC_TARGET_PLATFORM != CC_PLATFORM_MARMALADE) -#define WEBP_USE_SSE2 -#endif - -#if defined(__ANDROID__) && defined(__ARM_ARCH_7A__) -#define WEBP_ANDROID_NEON // Android targets that might support NEON -#endif - -#if defined(__ARM_NEON__) || defined(WEBP_ANDROID_NEON) -#define WEBP_USE_NEON -#endif - -typedef enum { - kSSE2, - kSSE3, - kNEON -} CPUFeature; -// returns true if the CPU supports the feature. -typedef int (*VP8CPUInfo)(CPUFeature feature); -extern VP8CPUInfo VP8GetCPUInfo; - -//------------------------------------------------------------------------------ -// Encoding - -int VP8GetAlpha(const int histo[]); - -// Transforms -// VP8Idct: Does one of two inverse transforms. If do_two is set, the transforms -// will be done for (ref, in, dst) and (ref + 4, in + 16, dst + 4). -typedef void (*VP8Idct)(const uint8_t* ref, const int16_t* in, uint8_t* dst, - int do_two); -typedef void (*VP8Fdct)(const uint8_t* src, const uint8_t* ref, int16_t* out); -typedef void (*VP8WHT)(const int16_t* in, int16_t* out); -extern VP8Idct VP8ITransform; -extern VP8Fdct VP8FTransform; -extern VP8WHT VP8ITransformWHT; -extern VP8WHT VP8FTransformWHT; -// Predictions -// *dst is the destination block. *top and *left can be NULL. -typedef void (*VP8IntraPreds)(uint8_t *dst, const uint8_t* left, - const uint8_t* top); -typedef void (*VP8Intra4Preds)(uint8_t *dst, const uint8_t* top); -extern VP8Intra4Preds VP8EncPredLuma4; -extern VP8IntraPreds VP8EncPredLuma16; -extern VP8IntraPreds VP8EncPredChroma8; - -typedef int (*VP8Metric)(const uint8_t* pix, const uint8_t* ref); -extern VP8Metric VP8SSE16x16, VP8SSE16x8, VP8SSE8x8, VP8SSE4x4; -typedef int (*VP8WMetric)(const uint8_t* pix, const uint8_t* ref, - const uint16_t* const weights); -extern VP8WMetric VP8TDisto4x4, VP8TDisto16x16; - -typedef void (*VP8BlockCopy)(const uint8_t* src, uint8_t* dst); -extern VP8BlockCopy VP8Copy4x4; -// Quantization -struct VP8Matrix; // forward declaration -typedef int (*VP8QuantizeBlock)(int16_t in[16], int16_t out[16], - int n, const struct VP8Matrix* const mtx); -extern VP8QuantizeBlock VP8EncQuantizeBlock; - -// Compute susceptibility based on DCT-coeff histograms: -// the higher, the "easier" the macroblock is to compress. -typedef int (*VP8CHisto)(const uint8_t* ref, const uint8_t* pred, - int start_block, int end_block); -extern const int VP8DspScan[16 + 4 + 4]; -extern VP8CHisto VP8CollectHistogram; - -void VP8EncDspInit(void); // must be called before using any of the above - -//------------------------------------------------------------------------------ -// Decoding - -typedef void (*VP8DecIdct)(const int16_t* coeffs, uint8_t* dst); -// when doing two transforms, coeffs is actually int16_t[2][16]. -typedef void (*VP8DecIdct2)(const int16_t* coeffs, uint8_t* dst, int do_two); -extern VP8DecIdct2 VP8Transform; -extern VP8DecIdct VP8TransformUV; -extern VP8DecIdct VP8TransformDC; -extern VP8DecIdct VP8TransformDCUV; -extern void (*VP8TransformWHT)(const int16_t* in, int16_t* out); - -// *dst is the destination block, with stride BPS. Boundary samples are -// assumed accessible when needed. -typedef void (*VP8PredFunc)(uint8_t* dst); -extern const VP8PredFunc VP8PredLuma16[/* NUM_B_DC_MODES */]; -extern const VP8PredFunc VP8PredChroma8[/* NUM_B_DC_MODES */]; -extern const VP8PredFunc VP8PredLuma4[/* NUM_BMODES */]; - -// simple filter (only for luma) -typedef void (*VP8SimpleFilterFunc)(uint8_t* p, int stride, int thresh); -extern VP8SimpleFilterFunc VP8SimpleVFilter16; -extern VP8SimpleFilterFunc VP8SimpleHFilter16; -extern VP8SimpleFilterFunc VP8SimpleVFilter16i; // filter 3 inner edges -extern VP8SimpleFilterFunc VP8SimpleHFilter16i; - -// regular filter (on both macroblock edges and inner edges) -typedef void (*VP8LumaFilterFunc)(uint8_t* luma, int stride, - int thresh, int ithresh, int hev_t); -typedef void (*VP8ChromaFilterFunc)(uint8_t* u, uint8_t* v, int stride, - int thresh, int ithresh, int hev_t); -// on outer edge -extern VP8LumaFilterFunc VP8VFilter16; -extern VP8LumaFilterFunc VP8HFilter16; -extern VP8ChromaFilterFunc VP8VFilter8; -extern VP8ChromaFilterFunc VP8HFilter8; - -// on inner edge -extern VP8LumaFilterFunc VP8VFilter16i; // filtering 3 inner edges altogether -extern VP8LumaFilterFunc VP8HFilter16i; -extern VP8ChromaFilterFunc VP8VFilter8i; // filtering u and v altogether -extern VP8ChromaFilterFunc VP8HFilter8i; - -// must be called before anything using the above -void VP8DspInit(void); - -//------------------------------------------------------------------------------ -// WebP I/O - -#define FANCY_UPSAMPLING // undefined to remove fancy upsampling support - -typedef void (*WebPUpsampleLinePairFunc)( - const uint8_t* top_y, const uint8_t* bottom_y, - const uint8_t* top_u, const uint8_t* top_v, - const uint8_t* cur_u, const uint8_t* cur_v, - uint8_t* top_dst, uint8_t* bottom_dst, int len); - -#ifdef FANCY_UPSAMPLING - -// Fancy upsampling functions to convert YUV to RGB(A) modes -extern WebPUpsampleLinePairFunc WebPUpsamplers[/* MODE_LAST */]; - -// Initializes SSE2 version of the fancy upsamplers. -void WebPInitUpsamplersSSE2(void); - -#endif // FANCY_UPSAMPLING - -// Point-sampling methods. -typedef void (*WebPSampleLinePairFunc)( - const uint8_t* top_y, const uint8_t* bottom_y, - const uint8_t* u, const uint8_t* v, - uint8_t* top_dst, uint8_t* bottom_dst, int len); - -extern const WebPSampleLinePairFunc WebPSamplers[/* MODE_LAST */]; - -// General function for converting two lines of ARGB or RGBA. -// 'alpha_is_last' should be true if 0xff000000 is stored in memory as -// as 0x00, 0x00, 0x00, 0xff (little endian). -WebPUpsampleLinePairFunc WebPGetLinePairConverter(int alpha_is_last); - -// YUV444->RGB converters -typedef void (*WebPYUV444Converter)(const uint8_t* y, - const uint8_t* u, const uint8_t* v, - uint8_t* dst, int len); - -extern const WebPYUV444Converter WebPYUV444Converters[/* MODE_LAST */]; - -// Main function to be called -void WebPInitUpsamplers(void); - -//------------------------------------------------------------------------------ -// Pre-multiply planes with alpha values - -// Apply alpha pre-multiply on an rgba, bgra or argb plane of size w * h. -// alpha_first should be 0 for argb, 1 for rgba or bgra (where alpha is last). -extern void (*WebPApplyAlphaMultiply)( - uint8_t* rgba, int alpha_first, int w, int h, int stride); - -// Same, buf specifically for RGBA4444 format -extern void (*WebPApplyAlphaMultiply4444)( - uint8_t* rgba4444, int w, int h, int stride); - -// To be called first before using the above. -void WebPInitPremultiply(void); - -void WebPInitPremultiplySSE2(void); // should not be called directly. - -//------------------------------------------------------------------------------ - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif - -#endif /* WEBP_DSP_DSP_H_ */ diff --git a/external/libwebp/dsp/enc.c b/external/libwebp/dsp/enc.c deleted file mode 100644 index 02234564be..0000000000 --- a/external/libwebp/dsp/enc.c +++ /dev/null @@ -1,743 +0,0 @@ -// Copyright 2011 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Speed-critical encoding functions. -// -// Author: Skal (pascal.massimino@gmail.com) - -#include <stdlib.h> // for abs() -#include "./dsp.h" -#include "../enc/vp8enci.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -//------------------------------------------------------------------------------ -// Compute susceptibility based on DCT-coeff histograms: -// the higher, the "easier" the macroblock is to compress. - -static int ClipAlpha(int alpha) { - return alpha < 0 ? 0 : alpha > 255 ? 255 : alpha; -} - -int VP8GetAlpha(const int histo[MAX_COEFF_THRESH + 1]) { - int num = 0, den = 0, val = 0; - int k; - int alpha; - // note: changing this loop to avoid the numerous "k + 1" slows things down. - for (k = 0; k < MAX_COEFF_THRESH; ++k) { - if (histo[k + 1]) { - val += histo[k + 1]; - num += val * (k + 1); - den += (k + 1) * (k + 1); - } - } - // we scale the value to a usable [0..255] range - alpha = den ? 10 * num / den - 5 : 0; - return ClipAlpha(alpha); -} - -const int VP8DspScan[16 + 4 + 4] = { - // Luma - 0 + 0 * BPS, 4 + 0 * BPS, 8 + 0 * BPS, 12 + 0 * BPS, - 0 + 4 * BPS, 4 + 4 * BPS, 8 + 4 * BPS, 12 + 4 * BPS, - 0 + 8 * BPS, 4 + 8 * BPS, 8 + 8 * BPS, 12 + 8 * BPS, - 0 + 12 * BPS, 4 + 12 * BPS, 8 + 12 * BPS, 12 + 12 * BPS, - - 0 + 0 * BPS, 4 + 0 * BPS, 0 + 4 * BPS, 4 + 4 * BPS, // U - 8 + 0 * BPS, 12 + 0 * BPS, 8 + 4 * BPS, 12 + 4 * BPS // V -}; - -static int CollectHistogram(const uint8_t* ref, const uint8_t* pred, - int start_block, int end_block) { - int histo[MAX_COEFF_THRESH + 1] = { 0 }; - int16_t out[16]; - int j, k; - for (j = start_block; j < end_block; ++j) { - VP8FTransform(ref + VP8DspScan[j], pred + VP8DspScan[j], out); - - // Convert coefficients to bin (within out[]). - for (k = 0; k < 16; ++k) { - const int v = abs(out[k]) >> 2; - out[k] = (v > MAX_COEFF_THRESH) ? MAX_COEFF_THRESH : v; - } - - // Use bin to update histogram. - for (k = 0; k < 16; ++k) { - histo[out[k]]++; - } - } - - return VP8GetAlpha(histo); -} - -//------------------------------------------------------------------------------ -// run-time tables (~4k) - -static uint8_t clip1[255 + 510 + 1]; // clips [-255,510] to [0,255] - -// We declare this variable 'volatile' to prevent instruction reordering -// and make sure it's set to true _last_ (so as to be thread-safe) -static volatile int tables_ok = 0; - -static void InitTables(void) { - if (!tables_ok) { - int i; - for (i = -255; i <= 255 + 255; ++i) { - clip1[255 + i] = (i < 0) ? 0 : (i > 255) ? 255 : i; - } - tables_ok = 1; - } -} - -static WEBP_INLINE uint8_t clip_8b(int v) { - return (!(v & ~0xff)) ? v : v < 0 ? 0 : 255; -} - -//------------------------------------------------------------------------------ -// Transforms (Paragraph 14.4) - -#define STORE(x, y, v) \ - dst[(x) + (y) * BPS] = clip_8b(ref[(x) + (y) * BPS] + ((v) >> 3)) - -static const int kC1 = 20091 + (1 << 16); -static const int kC2 = 35468; -#define MUL(a, b) (((a) * (b)) >> 16) - -static WEBP_INLINE void ITransformOne(const uint8_t* ref, const int16_t* in, - uint8_t* dst) { - int C[4 * 4], *tmp; - int i; - tmp = C; - for (i = 0; i < 4; ++i) { // vertical pass - const int a = in[0] + in[8]; - const int b = in[0] - in[8]; - const int c = MUL(in[4], kC2) - MUL(in[12], kC1); - const int d = MUL(in[4], kC1) + MUL(in[12], kC2); - tmp[0] = a + d; - tmp[1] = b + c; - tmp[2] = b - c; - tmp[3] = a - d; - tmp += 4; - in++; - } - - tmp = C; - for (i = 0; i < 4; ++i) { // horizontal pass - const int dc = tmp[0] + 4; - const int a = dc + tmp[8]; - const int b = dc - tmp[8]; - const int c = MUL(tmp[4], kC2) - MUL(tmp[12], kC1); - const int d = MUL(tmp[4], kC1) + MUL(tmp[12], kC2); - STORE(0, i, a + d); - STORE(1, i, b + c); - STORE(2, i, b - c); - STORE(3, i, a - d); - tmp++; - } -} - -static void ITransform(const uint8_t* ref, const int16_t* in, uint8_t* dst, - int do_two) { - ITransformOne(ref, in, dst); - if (do_two) { - ITransformOne(ref + 4, in + 16, dst + 4); - } -} - -static void FTransform(const uint8_t* src, const uint8_t* ref, int16_t* out) { - int i; - int tmp[16]; - for (i = 0; i < 4; ++i, src += BPS, ref += BPS) { - const int d0 = src[0] - ref[0]; - const int d1 = src[1] - ref[1]; - const int d2 = src[2] - ref[2]; - const int d3 = src[3] - ref[3]; - const int a0 = (d0 + d3) << 3; - const int a1 = (d1 + d2) << 3; - const int a2 = (d1 - d2) << 3; - const int a3 = (d0 - d3) << 3; - tmp[0 + i * 4] = (a0 + a1); - tmp[1 + i * 4] = (a2 * 2217 + a3 * 5352 + 14500) >> 12; - tmp[2 + i * 4] = (a0 - a1); - tmp[3 + i * 4] = (a3 * 2217 - a2 * 5352 + 7500) >> 12; - } - for (i = 0; i < 4; ++i) { - const int a0 = (tmp[0 + i] + tmp[12 + i]); - const int a1 = (tmp[4 + i] + tmp[ 8 + i]); - const int a2 = (tmp[4 + i] - tmp[ 8 + i]); - const int a3 = (tmp[0 + i] - tmp[12 + i]); - out[0 + i] = (a0 + a1 + 7) >> 4; - out[4 + i] = ((a2 * 2217 + a3 * 5352 + 12000) >> 16) + (a3 != 0); - out[8 + i] = (a0 - a1 + 7) >> 4; - out[12+ i] = ((a3 * 2217 - a2 * 5352 + 51000) >> 16); - } -} - -static void ITransformWHT(const int16_t* in, int16_t* out) { - int tmp[16]; - int i; - for (i = 0; i < 4; ++i) { - const int a0 = in[0 + i] + in[12 + i]; - const int a1 = in[4 + i] + in[ 8 + i]; - const int a2 = in[4 + i] - in[ 8 + i]; - const int a3 = in[0 + i] - in[12 + i]; - tmp[0 + i] = a0 + a1; - tmp[8 + i] = a0 - a1; - tmp[4 + i] = a3 + a2; - tmp[12 + i] = a3 - a2; - } - for (i = 0; i < 4; ++i) { - const int dc = tmp[0 + i * 4] + 3; // w/ rounder - const int a0 = dc + tmp[3 + i * 4]; - const int a1 = tmp[1 + i * 4] + tmp[2 + i * 4]; - const int a2 = tmp[1 + i * 4] - tmp[2 + i * 4]; - const int a3 = dc - tmp[3 + i * 4]; - out[ 0] = (a0 + a1) >> 3; - out[16] = (a3 + a2) >> 3; - out[32] = (a0 - a1) >> 3; - out[48] = (a3 - a2) >> 3; - out += 64; - } -} - -static void FTransformWHT(const int16_t* in, int16_t* out) { - int tmp[16]; - int i; - for (i = 0; i < 4; ++i, in += 64) { - const int a0 = (in[0 * 16] + in[2 * 16]) << 2; - const int a1 = (in[1 * 16] + in[3 * 16]) << 2; - const int a2 = (in[1 * 16] - in[3 * 16]) << 2; - const int a3 = (in[0 * 16] - in[2 * 16]) << 2; - tmp[0 + i * 4] = (a0 + a1) + (a0 != 0); - tmp[1 + i * 4] = a3 + a2; - tmp[2 + i * 4] = a3 - a2; - tmp[3 + i * 4] = a0 - a1; - } - for (i = 0; i < 4; ++i) { - const int a0 = (tmp[0 + i] + tmp[8 + i]); - const int a1 = (tmp[4 + i] + tmp[12+ i]); - const int a2 = (tmp[4 + i] - tmp[12+ i]); - const int a3 = (tmp[0 + i] - tmp[8 + i]); - const int b0 = a0 + a1; - const int b1 = a3 + a2; - const int b2 = a3 - a2; - const int b3 = a0 - a1; - out[ 0 + i] = (b0 + (b0 > 0) + 3) >> 3; - out[ 4 + i] = (b1 + (b1 > 0) + 3) >> 3; - out[ 8 + i] = (b2 + (b2 > 0) + 3) >> 3; - out[12 + i] = (b3 + (b3 > 0) + 3) >> 3; - } -} - -#undef MUL -#undef STORE - -//------------------------------------------------------------------------------ -// Intra predictions - -#define DST(x, y) dst[(x) + (y) * BPS] - -static WEBP_INLINE void Fill(uint8_t* dst, int value, int size) { - int j; - for (j = 0; j < size; ++j) { - memset(dst + j * BPS, value, size); - } -} - -static WEBP_INLINE void VerticalPred(uint8_t* dst, - const uint8_t* top, int size) { - int j; - if (top) { - for (j = 0; j < size; ++j) memcpy(dst + j * BPS, top, size); - } else { - Fill(dst, 127, size); - } -} - -static WEBP_INLINE void HorizontalPred(uint8_t* dst, - const uint8_t* left, int size) { - if (left) { - int j; - for (j = 0; j < size; ++j) { - memset(dst + j * BPS, left[j], size); - } - } else { - Fill(dst, 129, size); - } -} - -static WEBP_INLINE void TrueMotion(uint8_t* dst, const uint8_t* left, - const uint8_t* top, int size) { - int y; - if (left) { - if (top) { - const uint8_t* const clip = clip1 + 255 - left[-1]; - for (y = 0; y < size; ++y) { - const uint8_t* const clip_table = clip + left[y]; - int x; - for (x = 0; x < size; ++x) { - dst[x] = clip_table[top[x]]; - } - dst += BPS; - } - } else { - HorizontalPred(dst, left, size); - } - } else { - // true motion without left samples (hence: with default 129 value) - // is equivalent to VE prediction where you just copy the top samples. - // Note that if top samples are not available, the default value is - // then 129, and not 127 as in the VerticalPred case. - if (top) { - VerticalPred(dst, top, size); - } else { - Fill(dst, 129, size); - } - } -} - -static WEBP_INLINE void DCMode(uint8_t* dst, const uint8_t* left, - const uint8_t* top, - int size, int round, int shift) { - int DC = 0; - int j; - if (top) { - for (j = 0; j < size; ++j) DC += top[j]; - if (left) { // top and left present - for (j = 0; j < size; ++j) DC += left[j]; - } else { // top, but no left - DC += DC; - } - DC = (DC + round) >> shift; - } else if (left) { // left but no top - for (j = 0; j < size; ++j) DC += left[j]; - DC += DC; - DC = (DC + round) >> shift; - } else { // no top, no left, nothing. - DC = 0x80; - } - Fill(dst, DC, size); -} - -//------------------------------------------------------------------------------ -// Chroma 8x8 prediction (paragraph 12.2) - -static void IntraChromaPreds(uint8_t* dst, const uint8_t* left, - const uint8_t* top) { - // U block - DCMode(C8DC8 + dst, left, top, 8, 8, 4); - VerticalPred(C8VE8 + dst, top, 8); - HorizontalPred(C8HE8 + dst, left, 8); - TrueMotion(C8TM8 + dst, left, top, 8); - // V block - dst += 8; - if (top) top += 8; - if (left) left += 16; - DCMode(C8DC8 + dst, left, top, 8, 8, 4); - VerticalPred(C8VE8 + dst, top, 8); - HorizontalPred(C8HE8 + dst, left, 8); - TrueMotion(C8TM8 + dst, left, top, 8); -} - -//------------------------------------------------------------------------------ -// luma 16x16 prediction (paragraph 12.3) - -static void Intra16Preds(uint8_t* dst, - const uint8_t* left, const uint8_t* top) { - DCMode(I16DC16 + dst, left, top, 16, 16, 5); - VerticalPred(I16VE16 + dst, top, 16); - HorizontalPred(I16HE16 + dst, left, 16); - TrueMotion(I16TM16 + dst, left, top, 16); -} - -//------------------------------------------------------------------------------ -// luma 4x4 prediction - -#define AVG3(a, b, c) (((a) + 2 * (b) + (c) + 2) >> 2) -#define AVG2(a, b) (((a) + (b) + 1) >> 1) - -static void VE4(uint8_t* dst, const uint8_t* top) { // vertical - const uint8_t vals[4] = { - AVG3(top[-1], top[0], top[1]), - AVG3(top[ 0], top[1], top[2]), - AVG3(top[ 1], top[2], top[3]), - AVG3(top[ 2], top[3], top[4]) - }; - int i; - for (i = 0; i < 4; ++i) { - memcpy(dst + i * BPS, vals, 4); - } -} - -static void HE4(uint8_t* dst, const uint8_t* top) { // horizontal - const int X = top[-1]; - const int I = top[-2]; - const int J = top[-3]; - const int K = top[-4]; - const int L = top[-5]; - *(uint32_t*)(dst + 0 * BPS) = 0x01010101U * AVG3(X, I, J); - *(uint32_t*)(dst + 1 * BPS) = 0x01010101U * AVG3(I, J, K); - *(uint32_t*)(dst + 2 * BPS) = 0x01010101U * AVG3(J, K, L); - *(uint32_t*)(dst + 3 * BPS) = 0x01010101U * AVG3(K, L, L); -} - -static void DC4(uint8_t* dst, const uint8_t* top) { - uint32_t dc = 4; - int i; - for (i = 0; i < 4; ++i) dc += top[i] + top[-5 + i]; - Fill(dst, dc >> 3, 4); -} - -static void RD4(uint8_t* dst, const uint8_t* top) { - const int X = top[-1]; - const int I = top[-2]; - const int J = top[-3]; - const int K = top[-4]; - const int L = top[-5]; - const int A = top[0]; - const int B = top[1]; - const int C = top[2]; - const int D = top[3]; - DST(0, 3) = AVG3(J, K, L); - DST(0, 2) = DST(1, 3) = AVG3(I, J, K); - DST(0, 1) = DST(1, 2) = DST(2, 3) = AVG3(X, I, J); - DST(0, 0) = DST(1, 1) = DST(2, 2) = DST(3, 3) = AVG3(A, X, I); - DST(1, 0) = DST(2, 1) = DST(3, 2) = AVG3(B, A, X); - DST(2, 0) = DST(3, 1) = AVG3(C, B, A); - DST(3, 0) = AVG3(D, C, B); -} - -static void LD4(uint8_t* dst, const uint8_t* top) { - const int A = top[0]; - const int B = top[1]; - const int C = top[2]; - const int D = top[3]; - const int E = top[4]; - const int F = top[5]; - const int G = top[6]; - const int H = top[7]; - DST(0, 0) = AVG3(A, B, C); - DST(1, 0) = DST(0, 1) = AVG3(B, C, D); - DST(2, 0) = DST(1, 1) = DST(0, 2) = AVG3(C, D, E); - DST(3, 0) = DST(2, 1) = DST(1, 2) = DST(0, 3) = AVG3(D, E, F); - DST(3, 1) = DST(2, 2) = DST(1, 3) = AVG3(E, F, G); - DST(3, 2) = DST(2, 3) = AVG3(F, G, H); - DST(3, 3) = AVG3(G, H, H); -} - -static void VR4(uint8_t* dst, const uint8_t* top) { - const int X = top[-1]; - const int I = top[-2]; - const int J = top[-3]; - const int K = top[-4]; - const int A = top[0]; - const int B = top[1]; - const int C = top[2]; - const int D = top[3]; - DST(0, 0) = DST(1, 2) = AVG2(X, A); - DST(1, 0) = DST(2, 2) = AVG2(A, B); - DST(2, 0) = DST(3, 2) = AVG2(B, C); - DST(3, 0) = AVG2(C, D); - - DST(0, 3) = AVG3(K, J, I); - DST(0, 2) = AVG3(J, I, X); - DST(0, 1) = DST(1, 3) = AVG3(I, X, A); - DST(1, 1) = DST(2, 3) = AVG3(X, A, B); - DST(2, 1) = DST(3, 3) = AVG3(A, B, C); - DST(3, 1) = AVG3(B, C, D); -} - -static void VL4(uint8_t* dst, const uint8_t* top) { - const int A = top[0]; - const int B = top[1]; - const int C = top[2]; - const int D = top[3]; - const int E = top[4]; - const int F = top[5]; - const int G = top[6]; - const int H = top[7]; - DST(0, 0) = AVG2(A, B); - DST(1, 0) = DST(0, 2) = AVG2(B, C); - DST(2, 0) = DST(1, 2) = AVG2(C, D); - DST(3, 0) = DST(2, 2) = AVG2(D, E); - - DST(0, 1) = AVG3(A, B, C); - DST(1, 1) = DST(0, 3) = AVG3(B, C, D); - DST(2, 1) = DST(1, 3) = AVG3(C, D, E); - DST(3, 1) = DST(2, 3) = AVG3(D, E, F); - DST(3, 2) = AVG3(E, F, G); - DST(3, 3) = AVG3(F, G, H); -} - -static void HU4(uint8_t* dst, const uint8_t* top) { - const int I = top[-2]; - const int J = top[-3]; - const int K = top[-4]; - const int L = top[-5]; - DST(0, 0) = AVG2(I, J); - DST(2, 0) = DST(0, 1) = AVG2(J, K); - DST(2, 1) = DST(0, 2) = AVG2(K, L); - DST(1, 0) = AVG3(I, J, K); - DST(3, 0) = DST(1, 1) = AVG3(J, K, L); - DST(3, 1) = DST(1, 2) = AVG3(K, L, L); - DST(3, 2) = DST(2, 2) = - DST(0, 3) = DST(1, 3) = DST(2, 3) = DST(3, 3) = L; -} - -static void HD4(uint8_t* dst, const uint8_t* top) { - const int X = top[-1]; - const int I = top[-2]; - const int J = top[-3]; - const int K = top[-4]; - const int L = top[-5]; - const int A = top[0]; - const int B = top[1]; - const int C = top[2]; - - DST(0, 0) = DST(2, 1) = AVG2(I, X); - DST(0, 1) = DST(2, 2) = AVG2(J, I); - DST(0, 2) = DST(2, 3) = AVG2(K, J); - DST(0, 3) = AVG2(L, K); - - DST(3, 0) = AVG3(A, B, C); - DST(2, 0) = AVG3(X, A, B); - DST(1, 0) = DST(3, 1) = AVG3(I, X, A); - DST(1, 1) = DST(3, 2) = AVG3(J, I, X); - DST(1, 2) = DST(3, 3) = AVG3(K, J, I); - DST(1, 3) = AVG3(L, K, J); -} - -static void TM4(uint8_t* dst, const uint8_t* top) { - int x, y; - const uint8_t* const clip = clip1 + 255 - top[-1]; - for (y = 0; y < 4; ++y) { - const uint8_t* const clip_table = clip + top[-2 - y]; - for (x = 0; x < 4; ++x) { - dst[x] = clip_table[top[x]]; - } - dst += BPS; - } -} - -#undef DST -#undef AVG3 -#undef AVG2 - -// Left samples are top[-5 .. -2], top_left is top[-1], top are -// located at top[0..3], and top right is top[4..7] -static void Intra4Preds(uint8_t* dst, const uint8_t* top) { - DC4(I4DC4 + dst, top); - TM4(I4TM4 + dst, top); - VE4(I4VE4 + dst, top); - HE4(I4HE4 + dst, top); - RD4(I4RD4 + dst, top); - VR4(I4VR4 + dst, top); - LD4(I4LD4 + dst, top); - VL4(I4VL4 + dst, top); - HD4(I4HD4 + dst, top); - HU4(I4HU4 + dst, top); -} - -//------------------------------------------------------------------------------ -// Metric - -static WEBP_INLINE int GetSSE(const uint8_t* a, const uint8_t* b, - int w, int h) { - int count = 0; - int y, x; - for (y = 0; y < h; ++y) { - for (x = 0; x < w; ++x) { - const int diff = (int)a[x] - b[x]; - count += diff * diff; - } - a += BPS; - b += BPS; - } - return count; -} - -static int SSE16x16(const uint8_t* a, const uint8_t* b) { - return GetSSE(a, b, 16, 16); -} -static int SSE16x8(const uint8_t* a, const uint8_t* b) { - return GetSSE(a, b, 16, 8); -} -static int SSE8x8(const uint8_t* a, const uint8_t* b) { - return GetSSE(a, b, 8, 8); -} -static int SSE4x4(const uint8_t* a, const uint8_t* b) { - return GetSSE(a, b, 4, 4); -} - -//------------------------------------------------------------------------------ -// Texture distortion -// -// We try to match the spectral content (weighted) between source and -// reconstructed samples. - -// Hadamard transform -// Returns the weighted sum of the absolute value of transformed coefficients. -static int TTransform(const uint8_t* in, const uint16_t* w) { - int sum = 0; - int tmp[16]; - int i; - // horizontal pass - for (i = 0; i < 4; ++i, in += BPS) { - const int a0 = (in[0] + in[2]) << 2; - const int a1 = (in[1] + in[3]) << 2; - const int a2 = (in[1] - in[3]) << 2; - const int a3 = (in[0] - in[2]) << 2; - tmp[0 + i * 4] = a0 + a1 + (a0 != 0); - tmp[1 + i * 4] = a3 + a2; - tmp[2 + i * 4] = a3 - a2; - tmp[3 + i * 4] = a0 - a1; - } - // vertical pass - for (i = 0; i < 4; ++i, ++w) { - const int a0 = (tmp[0 + i] + tmp[8 + i]); - const int a1 = (tmp[4 + i] + tmp[12+ i]); - const int a2 = (tmp[4 + i] - tmp[12+ i]); - const int a3 = (tmp[0 + i] - tmp[8 + i]); - const int b0 = a0 + a1; - const int b1 = a3 + a2; - const int b2 = a3 - a2; - const int b3 = a0 - a1; - // abs((b + (b<0) + 3) >> 3) = (abs(b) + 3) >> 3 - sum += w[ 0] * ((abs(b0) + 3) >> 3); - sum += w[ 4] * ((abs(b1) + 3) >> 3); - sum += w[ 8] * ((abs(b2) + 3) >> 3); - sum += w[12] * ((abs(b3) + 3) >> 3); - } - return sum; -} - -static int Disto4x4(const uint8_t* const a, const uint8_t* const b, - const uint16_t* const w) { - const int sum1 = TTransform(a, w); - const int sum2 = TTransform(b, w); - return (abs(sum2 - sum1) + 8) >> 4; -} - -static int Disto16x16(const uint8_t* const a, const uint8_t* const b, - const uint16_t* const w) { - int D = 0; - int x, y; - for (y = 0; y < 16 * BPS; y += 4 * BPS) { - for (x = 0; x < 16; x += 4) { - D += Disto4x4(a + x + y, b + x + y, w); - } - } - return D; -} - -//------------------------------------------------------------------------------ -// Quantization -// - -static const uint8_t kZigzag[16] = { - 0, 1, 4, 8, 5, 2, 3, 6, 9, 12, 13, 10, 7, 11, 14, 15 -}; - -// Simple quantization -static int QuantizeBlock(int16_t in[16], int16_t out[16], - int n, const VP8Matrix* const mtx) { - int last = -1; - for (; n < 16; ++n) { - const int j = kZigzag[n]; - const int sign = (in[j] < 0); - int coeff = (sign ? -in[j] : in[j]) + mtx->sharpen_[j]; - if (coeff > 2047) coeff = 2047; - if (coeff > mtx->zthresh_[j]) { - const int Q = mtx->q_[j]; - const int iQ = mtx->iq_[j]; - const int B = mtx->bias_[j]; - out[n] = QUANTDIV(coeff, iQ, B); - if (sign) out[n] = -out[n]; - in[j] = out[n] * Q; - if (out[n]) last = n; - } else { - out[n] = 0; - in[j] = 0; - } - } - return (last >= 0); -} - -//------------------------------------------------------------------------------ -// Block copy - -static WEBP_INLINE void Copy(const uint8_t* src, uint8_t* dst, int size) { - int y; - for (y = 0; y < size; ++y) { - memcpy(dst, src, size); - src += BPS; - dst += BPS; - } -} - -static void Copy4x4(const uint8_t* src, uint8_t* dst) { Copy(src, dst, 4); } - -//------------------------------------------------------------------------------ -// Initialization - -// Speed-critical function pointers. We have to initialize them to the default -// implementations within VP8EncDspInit(). -VP8CHisto VP8CollectHistogram; -VP8Idct VP8ITransform; -VP8Fdct VP8FTransform; -VP8WHT VP8ITransformWHT; -VP8WHT VP8FTransformWHT; -VP8Intra4Preds VP8EncPredLuma4; -VP8IntraPreds VP8EncPredLuma16; -VP8IntraPreds VP8EncPredChroma8; -VP8Metric VP8SSE16x16; -VP8Metric VP8SSE8x8; -VP8Metric VP8SSE16x8; -VP8Metric VP8SSE4x4; -VP8WMetric VP8TDisto4x4; -VP8WMetric VP8TDisto16x16; -VP8QuantizeBlock VP8EncQuantizeBlock; -VP8BlockCopy VP8Copy4x4; - -extern void VP8EncDspInitSSE2(void); - -void VP8EncDspInit(void) { - InitTables(); - - // default C implementations - VP8CollectHistogram = CollectHistogram; - VP8ITransform = ITransform; - VP8FTransform = FTransform; - VP8ITransformWHT = ITransformWHT; - VP8FTransformWHT = FTransformWHT; - VP8EncPredLuma4 = Intra4Preds; - VP8EncPredLuma16 = Intra16Preds; - VP8EncPredChroma8 = IntraChromaPreds; - VP8SSE16x16 = SSE16x16; - VP8SSE8x8 = SSE8x8; - VP8SSE16x8 = SSE16x8; - VP8SSE4x4 = SSE4x4; - VP8TDisto4x4 = Disto4x4; - VP8TDisto16x16 = Disto16x16; - VP8EncQuantizeBlock = QuantizeBlock; - VP8Copy4x4 = Copy4x4; - - // If defined, use CPUInfo() to overwrite some pointers with faster versions. - if (VP8GetCPUInfo) { -#if defined(WEBP_USE_SSE2) - if (VP8GetCPUInfo(kSSE2)) { - VP8EncDspInitSSE2(); - } -#endif - } -} - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif diff --git a/external/libwebp/dsp/enc_sse2.c b/external/libwebp/dsp/enc_sse2.c deleted file mode 100644 index 0986e82e31..0000000000 --- a/external/libwebp/dsp/enc_sse2.c +++ /dev/null @@ -1,843 +0,0 @@ -// Copyright 2011 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// SSE2 version of speed-critical encoding functions. -// -// Author: Christian Duvivier (cduvivier@google.com) - -#include "./dsp.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -#if defined(WEBP_USE_SSE2) -#include <stdlib.h> // for abs() -#include <emmintrin.h> - -#include "../enc/vp8enci.h" - -//------------------------------------------------------------------------------ -// Compute susceptibility based on DCT-coeff histograms: -// the higher, the "easier" the macroblock is to compress. - -static int CollectHistogramSSE2(const uint8_t* ref, const uint8_t* pred, - int start_block, int end_block) { - int histo[MAX_COEFF_THRESH + 1] = { 0 }; - int16_t out[16]; - int j, k; - const __m128i max_coeff_thresh = _mm_set1_epi16(MAX_COEFF_THRESH); - for (j = start_block; j < end_block; ++j) { - VP8FTransform(ref + VP8DspScan[j], pred + VP8DspScan[j], out); - - // Convert coefficients to bin (within out[]). - { - // Load. - const __m128i out0 = _mm_loadu_si128((__m128i*)&out[0]); - const __m128i out1 = _mm_loadu_si128((__m128i*)&out[8]); - // sign(out) = out >> 15 (0x0000 if positive, 0xffff if negative) - const __m128i sign0 = _mm_srai_epi16(out0, 15); - const __m128i sign1 = _mm_srai_epi16(out1, 15); - // abs(out) = (out ^ sign) - sign - const __m128i xor0 = _mm_xor_si128(out0, sign0); - const __m128i xor1 = _mm_xor_si128(out1, sign1); - const __m128i abs0 = _mm_sub_epi16(xor0, sign0); - const __m128i abs1 = _mm_sub_epi16(xor1, sign1); - // v = abs(out) >> 2 - const __m128i v0 = _mm_srai_epi16(abs0, 2); - const __m128i v1 = _mm_srai_epi16(abs1, 2); - // bin = min(v, MAX_COEFF_THRESH) - const __m128i bin0 = _mm_min_epi16(v0, max_coeff_thresh); - const __m128i bin1 = _mm_min_epi16(v1, max_coeff_thresh); - // Store. - _mm_storeu_si128((__m128i*)&out[0], bin0); - _mm_storeu_si128((__m128i*)&out[8], bin1); - } - - // Use bin to update histogram. - for (k = 0; k < 16; ++k) { - histo[out[k]]++; - } - } - - return VP8GetAlpha(histo); -} - -//------------------------------------------------------------------------------ -// Transforms (Paragraph 14.4) - -// Does one or two inverse transforms. -static void ITransformSSE2(const uint8_t* ref, const int16_t* in, uint8_t* dst, - int do_two) { - // This implementation makes use of 16-bit fixed point versions of two - // multiply constants: - // K1 = sqrt(2) * cos (pi/8) ~= 85627 / 2^16 - // K2 = sqrt(2) * sin (pi/8) ~= 35468 / 2^16 - // - // To be able to use signed 16-bit integers, we use the following trick to - // have constants within range: - // - Associated constants are obtained by subtracting the 16-bit fixed point - // version of one: - // k = K - (1 << 16) => K = k + (1 << 16) - // K1 = 85267 => k1 = 20091 - // K2 = 35468 => k2 = -30068 - // - The multiplication of a variable by a constant become the sum of the - // variable and the multiplication of that variable by the associated - // constant: - // (x * K) >> 16 = (x * (k + (1 << 16))) >> 16 = ((x * k ) >> 16) + x - const __m128i k1 = _mm_set1_epi16(20091); - const __m128i k2 = _mm_set1_epi16(-30068); - __m128i T0, T1, T2, T3; - - // Load and concatenate the transform coefficients (we'll do two inverse - // transforms in parallel). In the case of only one inverse transform, the - // second half of the vectors will just contain random value we'll never - // use nor store. - __m128i in0, in1, in2, in3; - { - in0 = _mm_loadl_epi64((__m128i*)&in[0]); - in1 = _mm_loadl_epi64((__m128i*)&in[4]); - in2 = _mm_loadl_epi64((__m128i*)&in[8]); - in3 = _mm_loadl_epi64((__m128i*)&in[12]); - // a00 a10 a20 a30 x x x x - // a01 a11 a21 a31 x x x x - // a02 a12 a22 a32 x x x x - // a03 a13 a23 a33 x x x x - if (do_two) { - const __m128i inB0 = _mm_loadl_epi64((__m128i*)&in[16]); - const __m128i inB1 = _mm_loadl_epi64((__m128i*)&in[20]); - const __m128i inB2 = _mm_loadl_epi64((__m128i*)&in[24]); - const __m128i inB3 = _mm_loadl_epi64((__m128i*)&in[28]); - in0 = _mm_unpacklo_epi64(in0, inB0); - in1 = _mm_unpacklo_epi64(in1, inB1); - in2 = _mm_unpacklo_epi64(in2, inB2); - in3 = _mm_unpacklo_epi64(in3, inB3); - // a00 a10 a20 a30 b00 b10 b20 b30 - // a01 a11 a21 a31 b01 b11 b21 b31 - // a02 a12 a22 a32 b02 b12 b22 b32 - // a03 a13 a23 a33 b03 b13 b23 b33 - } - } - - // Vertical pass and subsequent transpose. - { - // First pass, c and d calculations are longer because of the "trick" - // multiplications. - const __m128i a = _mm_add_epi16(in0, in2); - const __m128i b = _mm_sub_epi16(in0, in2); - // c = MUL(in1, K2) - MUL(in3, K1) = MUL(in1, k2) - MUL(in3, k1) + in1 - in3 - const __m128i c1 = _mm_mulhi_epi16(in1, k2); - const __m128i c2 = _mm_mulhi_epi16(in3, k1); - const __m128i c3 = _mm_sub_epi16(in1, in3); - const __m128i c4 = _mm_sub_epi16(c1, c2); - const __m128i c = _mm_add_epi16(c3, c4); - // d = MUL(in1, K1) + MUL(in3, K2) = MUL(in1, k1) + MUL(in3, k2) + in1 + in3 - const __m128i d1 = _mm_mulhi_epi16(in1, k1); - const __m128i d2 = _mm_mulhi_epi16(in3, k2); - const __m128i d3 = _mm_add_epi16(in1, in3); - const __m128i d4 = _mm_add_epi16(d1, d2); - const __m128i d = _mm_add_epi16(d3, d4); - - // Second pass. - const __m128i tmp0 = _mm_add_epi16(a, d); - const __m128i tmp1 = _mm_add_epi16(b, c); - const __m128i tmp2 = _mm_sub_epi16(b, c); - const __m128i tmp3 = _mm_sub_epi16(a, d); - - // Transpose the two 4x4. - // a00 a01 a02 a03 b00 b01 b02 b03 - // a10 a11 a12 a13 b10 b11 b12 b13 - // a20 a21 a22 a23 b20 b21 b22 b23 - // a30 a31 a32 a33 b30 b31 b32 b33 - const __m128i transpose0_0 = _mm_unpacklo_epi16(tmp0, tmp1); - const __m128i transpose0_1 = _mm_unpacklo_epi16(tmp2, tmp3); - const __m128i transpose0_2 = _mm_unpackhi_epi16(tmp0, tmp1); - const __m128i transpose0_3 = _mm_unpackhi_epi16(tmp2, tmp3); - // a00 a10 a01 a11 a02 a12 a03 a13 - // a20 a30 a21 a31 a22 a32 a23 a33 - // b00 b10 b01 b11 b02 b12 b03 b13 - // b20 b30 b21 b31 b22 b32 b23 b33 - const __m128i transpose1_0 = _mm_unpacklo_epi32(transpose0_0, transpose0_1); - const __m128i transpose1_1 = _mm_unpacklo_epi32(transpose0_2, transpose0_3); - const __m128i transpose1_2 = _mm_unpackhi_epi32(transpose0_0, transpose0_1); - const __m128i transpose1_3 = _mm_unpackhi_epi32(transpose0_2, transpose0_3); - // a00 a10 a20 a30 a01 a11 a21 a31 - // b00 b10 b20 b30 b01 b11 b21 b31 - // a02 a12 a22 a32 a03 a13 a23 a33 - // b02 b12 a22 b32 b03 b13 b23 b33 - T0 = _mm_unpacklo_epi64(transpose1_0, transpose1_1); - T1 = _mm_unpackhi_epi64(transpose1_0, transpose1_1); - T2 = _mm_unpacklo_epi64(transpose1_2, transpose1_3); - T3 = _mm_unpackhi_epi64(transpose1_2, transpose1_3); - // a00 a10 a20 a30 b00 b10 b20 b30 - // a01 a11 a21 a31 b01 b11 b21 b31 - // a02 a12 a22 a32 b02 b12 b22 b32 - // a03 a13 a23 a33 b03 b13 b23 b33 - } - - // Horizontal pass and subsequent transpose. - { - // First pass, c and d calculations are longer because of the "trick" - // multiplications. - const __m128i four = _mm_set1_epi16(4); - const __m128i dc = _mm_add_epi16(T0, four); - const __m128i a = _mm_add_epi16(dc, T2); - const __m128i b = _mm_sub_epi16(dc, T2); - // c = MUL(T1, K2) - MUL(T3, K1) = MUL(T1, k2) - MUL(T3, k1) + T1 - T3 - const __m128i c1 = _mm_mulhi_epi16(T1, k2); - const __m128i c2 = _mm_mulhi_epi16(T3, k1); - const __m128i c3 = _mm_sub_epi16(T1, T3); - const __m128i c4 = _mm_sub_epi16(c1, c2); - const __m128i c = _mm_add_epi16(c3, c4); - // d = MUL(T1, K1) + MUL(T3, K2) = MUL(T1, k1) + MUL(T3, k2) + T1 + T3 - const __m128i d1 = _mm_mulhi_epi16(T1, k1); - const __m128i d2 = _mm_mulhi_epi16(T3, k2); - const __m128i d3 = _mm_add_epi16(T1, T3); - const __m128i d4 = _mm_add_epi16(d1, d2); - const __m128i d = _mm_add_epi16(d3, d4); - - // Second pass. - const __m128i tmp0 = _mm_add_epi16(a, d); - const __m128i tmp1 = _mm_add_epi16(b, c); - const __m128i tmp2 = _mm_sub_epi16(b, c); - const __m128i tmp3 = _mm_sub_epi16(a, d); - const __m128i shifted0 = _mm_srai_epi16(tmp0, 3); - const __m128i shifted1 = _mm_srai_epi16(tmp1, 3); - const __m128i shifted2 = _mm_srai_epi16(tmp2, 3); - const __m128i shifted3 = _mm_srai_epi16(tmp3, 3); - - // Transpose the two 4x4. - // a00 a01 a02 a03 b00 b01 b02 b03 - // a10 a11 a12 a13 b10 b11 b12 b13 - // a20 a21 a22 a23 b20 b21 b22 b23 - // a30 a31 a32 a33 b30 b31 b32 b33 - const __m128i transpose0_0 = _mm_unpacklo_epi16(shifted0, shifted1); - const __m128i transpose0_1 = _mm_unpacklo_epi16(shifted2, shifted3); - const __m128i transpose0_2 = _mm_unpackhi_epi16(shifted0, shifted1); - const __m128i transpose0_3 = _mm_unpackhi_epi16(shifted2, shifted3); - // a00 a10 a01 a11 a02 a12 a03 a13 - // a20 a30 a21 a31 a22 a32 a23 a33 - // b00 b10 b01 b11 b02 b12 b03 b13 - // b20 b30 b21 b31 b22 b32 b23 b33 - const __m128i transpose1_0 = _mm_unpacklo_epi32(transpose0_0, transpose0_1); - const __m128i transpose1_1 = _mm_unpacklo_epi32(transpose0_2, transpose0_3); - const __m128i transpose1_2 = _mm_unpackhi_epi32(transpose0_0, transpose0_1); - const __m128i transpose1_3 = _mm_unpackhi_epi32(transpose0_2, transpose0_3); - // a00 a10 a20 a30 a01 a11 a21 a31 - // b00 b10 b20 b30 b01 b11 b21 b31 - // a02 a12 a22 a32 a03 a13 a23 a33 - // b02 b12 a22 b32 b03 b13 b23 b33 - T0 = _mm_unpacklo_epi64(transpose1_0, transpose1_1); - T1 = _mm_unpackhi_epi64(transpose1_0, transpose1_1); - T2 = _mm_unpacklo_epi64(transpose1_2, transpose1_3); - T3 = _mm_unpackhi_epi64(transpose1_2, transpose1_3); - // a00 a10 a20 a30 b00 b10 b20 b30 - // a01 a11 a21 a31 b01 b11 b21 b31 - // a02 a12 a22 a32 b02 b12 b22 b32 - // a03 a13 a23 a33 b03 b13 b23 b33 - } - - // Add inverse transform to 'ref' and store. - { - const __m128i zero = _mm_set1_epi16(0); - // Load the reference(s). - __m128i ref0, ref1, ref2, ref3; - if (do_two) { - // Load eight bytes/pixels per line. - ref0 = _mm_loadl_epi64((__m128i*)&ref[0 * BPS]); - ref1 = _mm_loadl_epi64((__m128i*)&ref[1 * BPS]); - ref2 = _mm_loadl_epi64((__m128i*)&ref[2 * BPS]); - ref3 = _mm_loadl_epi64((__m128i*)&ref[3 * BPS]); - } else { - // Load four bytes/pixels per line. - ref0 = _mm_cvtsi32_si128(*(int*)&ref[0 * BPS]); - ref1 = _mm_cvtsi32_si128(*(int*)&ref[1 * BPS]); - ref2 = _mm_cvtsi32_si128(*(int*)&ref[2 * BPS]); - ref3 = _mm_cvtsi32_si128(*(int*)&ref[3 * BPS]); - } - // Convert to 16b. - ref0 = _mm_unpacklo_epi8(ref0, zero); - ref1 = _mm_unpacklo_epi8(ref1, zero); - ref2 = _mm_unpacklo_epi8(ref2, zero); - ref3 = _mm_unpacklo_epi8(ref3, zero); - // Add the inverse transform(s). - ref0 = _mm_add_epi16(ref0, T0); - ref1 = _mm_add_epi16(ref1, T1); - ref2 = _mm_add_epi16(ref2, T2); - ref3 = _mm_add_epi16(ref3, T3); - // Unsigned saturate to 8b. - ref0 = _mm_packus_epi16(ref0, ref0); - ref1 = _mm_packus_epi16(ref1, ref1); - ref2 = _mm_packus_epi16(ref2, ref2); - ref3 = _mm_packus_epi16(ref3, ref3); - // Store the results. - if (do_two) { - // Store eight bytes/pixels per line. - _mm_storel_epi64((__m128i*)&dst[0 * BPS], ref0); - _mm_storel_epi64((__m128i*)&dst[1 * BPS], ref1); - _mm_storel_epi64((__m128i*)&dst[2 * BPS], ref2); - _mm_storel_epi64((__m128i*)&dst[3 * BPS], ref3); - } else { - // Store four bytes/pixels per line. - *((int32_t *)&dst[0 * BPS]) = _mm_cvtsi128_si32(ref0); - *((int32_t *)&dst[1 * BPS]) = _mm_cvtsi128_si32(ref1); - *((int32_t *)&dst[2 * BPS]) = _mm_cvtsi128_si32(ref2); - *((int32_t *)&dst[3 * BPS]) = _mm_cvtsi128_si32(ref3); - } - } -} - -static void FTransformSSE2(const uint8_t* src, const uint8_t* ref, - int16_t* out) { - const __m128i zero = _mm_setzero_si128(); - const __m128i seven = _mm_set1_epi16(7); - const __m128i k7500 = _mm_set1_epi32(7500); - const __m128i k14500 = _mm_set1_epi32(14500); - const __m128i k51000 = _mm_set1_epi32(51000); - const __m128i k12000_plus_one = _mm_set1_epi32(12000 + (1 << 16)); - const __m128i k5352_2217 = _mm_set_epi16(5352, 2217, 5352, 2217, - 5352, 2217, 5352, 2217); - const __m128i k2217_5352 = _mm_set_epi16(2217, -5352, 2217, -5352, - 2217, -5352, 2217, -5352); - - __m128i v01, v32; - - // Difference between src and ref and initial transpose. - { - // Load src and convert to 16b. - const __m128i src0 = _mm_loadl_epi64((__m128i*)&src[0 * BPS]); - const __m128i src1 = _mm_loadl_epi64((__m128i*)&src[1 * BPS]); - const __m128i src2 = _mm_loadl_epi64((__m128i*)&src[2 * BPS]); - const __m128i src3 = _mm_loadl_epi64((__m128i*)&src[3 * BPS]); - const __m128i src_0 = _mm_unpacklo_epi8(src0, zero); - const __m128i src_1 = _mm_unpacklo_epi8(src1, zero); - const __m128i src_2 = _mm_unpacklo_epi8(src2, zero); - const __m128i src_3 = _mm_unpacklo_epi8(src3, zero); - // Load ref and convert to 16b. - const __m128i ref0 = _mm_loadl_epi64((__m128i*)&ref[0 * BPS]); - const __m128i ref1 = _mm_loadl_epi64((__m128i*)&ref[1 * BPS]); - const __m128i ref2 = _mm_loadl_epi64((__m128i*)&ref[2 * BPS]); - const __m128i ref3 = _mm_loadl_epi64((__m128i*)&ref[3 * BPS]); - const __m128i ref_0 = _mm_unpacklo_epi8(ref0, zero); - const __m128i ref_1 = _mm_unpacklo_epi8(ref1, zero); - const __m128i ref_2 = _mm_unpacklo_epi8(ref2, zero); - const __m128i ref_3 = _mm_unpacklo_epi8(ref3, zero); - // Compute difference. - const __m128i diff0 = _mm_sub_epi16(src_0, ref_0); - const __m128i diff1 = _mm_sub_epi16(src_1, ref_1); - const __m128i diff2 = _mm_sub_epi16(src_2, ref_2); - const __m128i diff3 = _mm_sub_epi16(src_3, ref_3); - - // Transpose. - // 00 01 02 03 0 0 0 0 - // 10 11 12 13 0 0 0 0 - // 20 21 22 23 0 0 0 0 - // 30 31 32 33 0 0 0 0 - const __m128i transpose0_0 = _mm_unpacklo_epi16(diff0, diff1); - const __m128i transpose0_1 = _mm_unpacklo_epi16(diff2, diff3); - // 00 10 01 11 02 12 03 13 - // 20 30 21 31 22 32 23 33 - const __m128i v23 = _mm_unpackhi_epi32(transpose0_0, transpose0_1); - v01 = _mm_unpacklo_epi32(transpose0_0, transpose0_1); - v32 = _mm_shuffle_epi32(v23, _MM_SHUFFLE(1, 0, 3, 2)); - // a02 a12 a22 a32 a03 a13 a23 a33 - // a00 a10 a20 a30 a01 a11 a21 a31 - // a03 a13 a23 a33 a02 a12 a22 a32 - } - - // First pass and subsequent transpose. - { - // Same operations are done on the (0,3) and (1,2) pairs. - // b0 = (a0 + a3) << 3 - // b1 = (a1 + a2) << 3 - // b3 = (a0 - a3) << 3 - // b2 = (a1 - a2) << 3 - const __m128i a01 = _mm_add_epi16(v01, v32); - const __m128i a32 = _mm_sub_epi16(v01, v32); - const __m128i b01 = _mm_slli_epi16(a01, 3); - const __m128i b32 = _mm_slli_epi16(a32, 3); - const __m128i b11 = _mm_unpackhi_epi64(b01, b01); - const __m128i b22 = _mm_unpackhi_epi64(b32, b32); - - // e0 = b0 + b1 - // e2 = b0 - b1 - const __m128i e0 = _mm_add_epi16(b01, b11); - const __m128i e2 = _mm_sub_epi16(b01, b11); - const __m128i e02 = _mm_unpacklo_epi64(e0, e2); - - // e1 = (b3 * 5352 + b2 * 2217 + 14500) >> 12 - // e3 = (b3 * 2217 - b2 * 5352 + 7500) >> 12 - const __m128i b23 = _mm_unpacklo_epi16(b22, b32); - const __m128i c1 = _mm_madd_epi16(b23, k5352_2217); - const __m128i c3 = _mm_madd_epi16(b23, k2217_5352); - const __m128i d1 = _mm_add_epi32(c1, k14500); - const __m128i d3 = _mm_add_epi32(c3, k7500); - const __m128i e1 = _mm_srai_epi32(d1, 12); - const __m128i e3 = _mm_srai_epi32(d3, 12); - const __m128i e13 = _mm_packs_epi32(e1, e3); - - // Transpose. - // 00 01 02 03 20 21 22 23 - // 10 11 12 13 30 31 32 33 - const __m128i transpose0_0 = _mm_unpacklo_epi16(e02, e13); - const __m128i transpose0_1 = _mm_unpackhi_epi16(e02, e13); - // 00 10 01 11 02 12 03 13 - // 20 30 21 31 22 32 23 33 - const __m128i v23 = _mm_unpackhi_epi32(transpose0_0, transpose0_1); - v01 = _mm_unpacklo_epi32(transpose0_0, transpose0_1); - v32 = _mm_shuffle_epi32(v23, _MM_SHUFFLE(1, 0, 3, 2)); - // 02 12 22 32 03 13 23 33 - // 00 10 20 30 01 11 21 31 - // 03 13 23 33 02 12 22 32 - } - - // Second pass - { - // Same operations are done on the (0,3) and (1,2) pairs. - // a0 = v0 + v3 - // a1 = v1 + v2 - // a3 = v0 - v3 - // a2 = v1 - v2 - const __m128i a01 = _mm_add_epi16(v01, v32); - const __m128i a32 = _mm_sub_epi16(v01, v32); - const __m128i a11 = _mm_unpackhi_epi64(a01, a01); - const __m128i a22 = _mm_unpackhi_epi64(a32, a32); - - // d0 = (a0 + a1 + 7) >> 4; - // d2 = (a0 - a1 + 7) >> 4; - const __m128i b0 = _mm_add_epi16(a01, a11); - const __m128i b2 = _mm_sub_epi16(a01, a11); - const __m128i c0 = _mm_add_epi16(b0, seven); - const __m128i c2 = _mm_add_epi16(b2, seven); - const __m128i d0 = _mm_srai_epi16(c0, 4); - const __m128i d2 = _mm_srai_epi16(c2, 4); - - // f1 = ((b3 * 5352 + b2 * 2217 + 12000) >> 16) - // f3 = ((b3 * 2217 - b2 * 5352 + 51000) >> 16) - const __m128i b23 = _mm_unpacklo_epi16(a22, a32); - const __m128i c1 = _mm_madd_epi16(b23, k5352_2217); - const __m128i c3 = _mm_madd_epi16(b23, k2217_5352); - const __m128i d1 = _mm_add_epi32(c1, k12000_plus_one); - const __m128i d3 = _mm_add_epi32(c3, k51000); - const __m128i e1 = _mm_srai_epi32(d1, 16); - const __m128i e3 = _mm_srai_epi32(d3, 16); - const __m128i f1 = _mm_packs_epi32(e1, e1); - const __m128i f3 = _mm_packs_epi32(e3, e3); - // f1 = f1 + (a3 != 0); - // The compare will return (0xffff, 0) for (==0, !=0). To turn that into the - // desired (0, 1), we add one earlier through k12000_plus_one. - const __m128i g1 = _mm_add_epi16(f1, _mm_cmpeq_epi16(a32, zero)); - - _mm_storel_epi64((__m128i*)&out[ 0], d0); - _mm_storel_epi64((__m128i*)&out[ 4], g1); - _mm_storel_epi64((__m128i*)&out[ 8], d2); - _mm_storel_epi64((__m128i*)&out[12], f3); - } -} - -//------------------------------------------------------------------------------ -// Metric - -static int SSE4x4SSE2(const uint8_t* a, const uint8_t* b) { - const __m128i zero = _mm_set1_epi16(0); - - // Load values. - const __m128i a0 = _mm_loadl_epi64((__m128i*)&a[BPS * 0]); - const __m128i a1 = _mm_loadl_epi64((__m128i*)&a[BPS * 1]); - const __m128i a2 = _mm_loadl_epi64((__m128i*)&a[BPS * 2]); - const __m128i a3 = _mm_loadl_epi64((__m128i*)&a[BPS * 3]); - const __m128i b0 = _mm_loadl_epi64((__m128i*)&b[BPS * 0]); - const __m128i b1 = _mm_loadl_epi64((__m128i*)&b[BPS * 1]); - const __m128i b2 = _mm_loadl_epi64((__m128i*)&b[BPS * 2]); - const __m128i b3 = _mm_loadl_epi64((__m128i*)&b[BPS * 3]); - - // Combine pair of lines and convert to 16b. - const __m128i a01 = _mm_unpacklo_epi32(a0, a1); - const __m128i a23 = _mm_unpacklo_epi32(a2, a3); - const __m128i b01 = _mm_unpacklo_epi32(b0, b1); - const __m128i b23 = _mm_unpacklo_epi32(b2, b3); - const __m128i a01s = _mm_unpacklo_epi8(a01, zero); - const __m128i a23s = _mm_unpacklo_epi8(a23, zero); - const __m128i b01s = _mm_unpacklo_epi8(b01, zero); - const __m128i b23s = _mm_unpacklo_epi8(b23, zero); - - // Compute differences; (a-b)^2 = (abs(a-b))^2 = (sat8(a-b) + sat8(b-a))^2 - // TODO(cduvivier): Dissassemble and figure out why this is fastest. We don't - // need absolute values, there is no need to do calculation - // in 8bit as we are already in 16bit, ... Yet this is what - // benchmarks the fastest! - const __m128i d0 = _mm_subs_epu8(a01s, b01s); - const __m128i d1 = _mm_subs_epu8(b01s, a01s); - const __m128i d2 = _mm_subs_epu8(a23s, b23s); - const __m128i d3 = _mm_subs_epu8(b23s, a23s); - - // Square and add them all together. - const __m128i madd0 = _mm_madd_epi16(d0, d0); - const __m128i madd1 = _mm_madd_epi16(d1, d1); - const __m128i madd2 = _mm_madd_epi16(d2, d2); - const __m128i madd3 = _mm_madd_epi16(d3, d3); - const __m128i sum0 = _mm_add_epi32(madd0, madd1); - const __m128i sum1 = _mm_add_epi32(madd2, madd3); - const __m128i sum2 = _mm_add_epi32(sum0, sum1); - int32_t tmp[4]; - _mm_storeu_si128((__m128i*)tmp, sum2); - return (tmp[3] + tmp[2] + tmp[1] + tmp[0]); -} - -//------------------------------------------------------------------------------ -// Texture distortion -// -// We try to match the spectral content (weighted) between source and -// reconstructed samples. - -// Hadamard transform -// Returns the difference between the weighted sum of the absolute value of -// transformed coefficients. -static int TTransformSSE2(const uint8_t* inA, const uint8_t* inB, - const uint16_t* const w) { - int32_t sum[4]; - __m128i tmp_0, tmp_1, tmp_2, tmp_3; - const __m128i zero = _mm_setzero_si128(); - const __m128i one = _mm_set1_epi16(1); - const __m128i three = _mm_set1_epi16(3); - - // Load, combine and tranpose inputs. - { - const __m128i inA_0 = _mm_loadl_epi64((__m128i*)&inA[BPS * 0]); - const __m128i inA_1 = _mm_loadl_epi64((__m128i*)&inA[BPS * 1]); - const __m128i inA_2 = _mm_loadl_epi64((__m128i*)&inA[BPS * 2]); - const __m128i inA_3 = _mm_loadl_epi64((__m128i*)&inA[BPS * 3]); - const __m128i inB_0 = _mm_loadl_epi64((__m128i*)&inB[BPS * 0]); - const __m128i inB_1 = _mm_loadl_epi64((__m128i*)&inB[BPS * 1]); - const __m128i inB_2 = _mm_loadl_epi64((__m128i*)&inB[BPS * 2]); - const __m128i inB_3 = _mm_loadl_epi64((__m128i*)&inB[BPS * 3]); - - // Combine inA and inB (we'll do two transforms in parallel). - const __m128i inAB_0 = _mm_unpacklo_epi8(inA_0, inB_0); - const __m128i inAB_1 = _mm_unpacklo_epi8(inA_1, inB_1); - const __m128i inAB_2 = _mm_unpacklo_epi8(inA_2, inB_2); - const __m128i inAB_3 = _mm_unpacklo_epi8(inA_3, inB_3); - // a00 b00 a01 b01 a02 b03 a03 b03 0 0 0 0 0 0 0 0 - // a10 b10 a11 b11 a12 b12 a13 b13 0 0 0 0 0 0 0 0 - // a20 b20 a21 b21 a22 b22 a23 b23 0 0 0 0 0 0 0 0 - // a30 b30 a31 b31 a32 b32 a33 b33 0 0 0 0 0 0 0 0 - - // Transpose the two 4x4, discarding the filling zeroes. - const __m128i transpose0_0 = _mm_unpacklo_epi8(inAB_0, inAB_2); - const __m128i transpose0_1 = _mm_unpacklo_epi8(inAB_1, inAB_3); - // a00 a20 b00 b20 a01 a21 b01 b21 a02 a22 b02 b22 a03 a23 b03 b23 - // a10 a30 b10 b30 a11 a31 b11 b31 a12 a32 b12 b32 a13 a33 b13 b33 - const __m128i transpose1_0 = _mm_unpacklo_epi8(transpose0_0, transpose0_1); - const __m128i transpose1_1 = _mm_unpackhi_epi8(transpose0_0, transpose0_1); - // a00 a10 a20 a30 b00 b10 b20 b30 a01 a11 a21 a31 b01 b11 b21 b31 - // a02 a12 a22 a32 b02 b12 b22 b32 a03 a13 a23 a33 b03 b13 b23 b33 - - // Convert to 16b. - tmp_0 = _mm_unpacklo_epi8(transpose1_0, zero); - tmp_1 = _mm_unpackhi_epi8(transpose1_0, zero); - tmp_2 = _mm_unpacklo_epi8(transpose1_1, zero); - tmp_3 = _mm_unpackhi_epi8(transpose1_1, zero); - // a00 a10 a20 a30 b00 b10 b20 b30 - // a01 a11 a21 a31 b01 b11 b21 b31 - // a02 a12 a22 a32 b02 b12 b22 b32 - // a03 a13 a23 a33 b03 b13 b23 b33 - } - - // Horizontal pass and subsequent transpose. - { - // Calculate a and b (two 4x4 at once). - const __m128i a0 = _mm_slli_epi16(_mm_add_epi16(tmp_0, tmp_2), 2); - const __m128i a1 = _mm_slli_epi16(_mm_add_epi16(tmp_1, tmp_3), 2); - const __m128i a2 = _mm_slli_epi16(_mm_sub_epi16(tmp_1, tmp_3), 2); - const __m128i a3 = _mm_slli_epi16(_mm_sub_epi16(tmp_0, tmp_2), 2); - // b0_extra = (a0 != 0); - const __m128i b0_extra = _mm_andnot_si128(_mm_cmpeq_epi16 (a0, zero), one); - const __m128i b0_base = _mm_add_epi16(a0, a1); - const __m128i b1 = _mm_add_epi16(a3, a2); - const __m128i b2 = _mm_sub_epi16(a3, a2); - const __m128i b3 = _mm_sub_epi16(a0, a1); - const __m128i b0 = _mm_add_epi16(b0_base, b0_extra); - // a00 a01 a02 a03 b00 b01 b02 b03 - // a10 a11 a12 a13 b10 b11 b12 b13 - // a20 a21 a22 a23 b20 b21 b22 b23 - // a30 a31 a32 a33 b30 b31 b32 b33 - - // Transpose the two 4x4. - const __m128i transpose0_0 = _mm_unpacklo_epi16(b0, b1); - const __m128i transpose0_1 = _mm_unpacklo_epi16(b2, b3); - const __m128i transpose0_2 = _mm_unpackhi_epi16(b0, b1); - const __m128i transpose0_3 = _mm_unpackhi_epi16(b2, b3); - // a00 a10 a01 a11 a02 a12 a03 a13 - // a20 a30 a21 a31 a22 a32 a23 a33 - // b00 b10 b01 b11 b02 b12 b03 b13 - // b20 b30 b21 b31 b22 b32 b23 b33 - const __m128i transpose1_0 = _mm_unpacklo_epi32(transpose0_0, transpose0_1); - const __m128i transpose1_1 = _mm_unpacklo_epi32(transpose0_2, transpose0_3); - const __m128i transpose1_2 = _mm_unpackhi_epi32(transpose0_0, transpose0_1); - const __m128i transpose1_3 = _mm_unpackhi_epi32(transpose0_2, transpose0_3); - // a00 a10 a20 a30 a01 a11 a21 a31 - // b00 b10 b20 b30 b01 b11 b21 b31 - // a02 a12 a22 a32 a03 a13 a23 a33 - // b02 b12 a22 b32 b03 b13 b23 b33 - tmp_0 = _mm_unpacklo_epi64(transpose1_0, transpose1_1); - tmp_1 = _mm_unpackhi_epi64(transpose1_0, transpose1_1); - tmp_2 = _mm_unpacklo_epi64(transpose1_2, transpose1_3); - tmp_3 = _mm_unpackhi_epi64(transpose1_2, transpose1_3); - // a00 a10 a20 a30 b00 b10 b20 b30 - // a01 a11 a21 a31 b01 b11 b21 b31 - // a02 a12 a22 a32 b02 b12 b22 b32 - // a03 a13 a23 a33 b03 b13 b23 b33 - } - - // Vertical pass and difference of weighted sums. - { - // Load all inputs. - // TODO(cduvivier): Make variable declarations and allocations aligned so - // we can use _mm_load_si128 instead of _mm_loadu_si128. - const __m128i w_0 = _mm_loadu_si128((__m128i*)&w[0]); - const __m128i w_8 = _mm_loadu_si128((__m128i*)&w[8]); - - // Calculate a and b (two 4x4 at once). - const __m128i a0 = _mm_add_epi16(tmp_0, tmp_2); - const __m128i a1 = _mm_add_epi16(tmp_1, tmp_3); - const __m128i a2 = _mm_sub_epi16(tmp_1, tmp_3); - const __m128i a3 = _mm_sub_epi16(tmp_0, tmp_2); - const __m128i b0 = _mm_add_epi16(a0, a1); - const __m128i b1 = _mm_add_epi16(a3, a2); - const __m128i b2 = _mm_sub_epi16(a3, a2); - const __m128i b3 = _mm_sub_epi16(a0, a1); - - // Separate the transforms of inA and inB. - __m128i A_b0 = _mm_unpacklo_epi64(b0, b1); - __m128i A_b2 = _mm_unpacklo_epi64(b2, b3); - __m128i B_b0 = _mm_unpackhi_epi64(b0, b1); - __m128i B_b2 = _mm_unpackhi_epi64(b2, b3); - - { - // sign(b) = b >> 15 (0x0000 if positive, 0xffff if negative) - const __m128i sign_A_b0 = _mm_srai_epi16(A_b0, 15); - const __m128i sign_A_b2 = _mm_srai_epi16(A_b2, 15); - const __m128i sign_B_b0 = _mm_srai_epi16(B_b0, 15); - const __m128i sign_B_b2 = _mm_srai_epi16(B_b2, 15); - - // b = abs(b) = (b ^ sign) - sign - A_b0 = _mm_xor_si128(A_b0, sign_A_b0); - A_b2 = _mm_xor_si128(A_b2, sign_A_b2); - B_b0 = _mm_xor_si128(B_b0, sign_B_b0); - B_b2 = _mm_xor_si128(B_b2, sign_B_b2); - A_b0 = _mm_sub_epi16(A_b0, sign_A_b0); - A_b2 = _mm_sub_epi16(A_b2, sign_A_b2); - B_b0 = _mm_sub_epi16(B_b0, sign_B_b0); - B_b2 = _mm_sub_epi16(B_b2, sign_B_b2); - } - - // b = abs(b) + 3 - A_b0 = _mm_add_epi16(A_b0, three); - A_b2 = _mm_add_epi16(A_b2, three); - B_b0 = _mm_add_epi16(B_b0, three); - B_b2 = _mm_add_epi16(B_b2, three); - - // abs((b + (b<0) + 3) >> 3) = (abs(b) + 3) >> 3 - // b = (abs(b) + 3) >> 3 - A_b0 = _mm_srai_epi16(A_b0, 3); - A_b2 = _mm_srai_epi16(A_b2, 3); - B_b0 = _mm_srai_epi16(B_b0, 3); - B_b2 = _mm_srai_epi16(B_b2, 3); - - // weighted sums - A_b0 = _mm_madd_epi16(A_b0, w_0); - A_b2 = _mm_madd_epi16(A_b2, w_8); - B_b0 = _mm_madd_epi16(B_b0, w_0); - B_b2 = _mm_madd_epi16(B_b2, w_8); - A_b0 = _mm_add_epi32(A_b0, A_b2); - B_b0 = _mm_add_epi32(B_b0, B_b2); - - // difference of weighted sums - A_b0 = _mm_sub_epi32(A_b0, B_b0); - _mm_storeu_si128((__m128i*)&sum[0], A_b0); - } - return sum[0] + sum[1] + sum[2] + sum[3]; -} - -static int Disto4x4SSE2(const uint8_t* const a, const uint8_t* const b, - const uint16_t* const w) { - const int diff_sum = TTransformSSE2(a, b, w); - return (abs(diff_sum) + 8) >> 4; -} - -static int Disto16x16SSE2(const uint8_t* const a, const uint8_t* const b, - const uint16_t* const w) { - int D = 0; - int x, y; - for (y = 0; y < 16 * BPS; y += 4 * BPS) { - for (x = 0; x < 16; x += 4) { - D += Disto4x4SSE2(a + x + y, b + x + y, w); - } - } - return D; -} - - -//------------------------------------------------------------------------------ -// Quantization -// - -// Simple quantization -static int QuantizeBlockSSE2(int16_t in[16], int16_t out[16], - int n, const VP8Matrix* const mtx) { - const __m128i max_coeff_2047 = _mm_set1_epi16(2047); - const __m128i zero = _mm_set1_epi16(0); - __m128i sign0, sign8; - __m128i coeff0, coeff8; - __m128i out0, out8; - __m128i packed_out; - - // Load all inputs. - // TODO(cduvivier): Make variable declarations and allocations aligned so that - // we can use _mm_load_si128 instead of _mm_loadu_si128. - __m128i in0 = _mm_loadu_si128((__m128i*)&in[0]); - __m128i in8 = _mm_loadu_si128((__m128i*)&in[8]); - const __m128i sharpen0 = _mm_loadu_si128((__m128i*)&mtx->sharpen_[0]); - const __m128i sharpen8 = _mm_loadu_si128((__m128i*)&mtx->sharpen_[8]); - const __m128i iq0 = _mm_loadu_si128((__m128i*)&mtx->iq_[0]); - const __m128i iq8 = _mm_loadu_si128((__m128i*)&mtx->iq_[8]); - const __m128i bias0 = _mm_loadu_si128((__m128i*)&mtx->bias_[0]); - const __m128i bias8 = _mm_loadu_si128((__m128i*)&mtx->bias_[8]); - const __m128i q0 = _mm_loadu_si128((__m128i*)&mtx->q_[0]); - const __m128i q8 = _mm_loadu_si128((__m128i*)&mtx->q_[8]); - const __m128i zthresh0 = _mm_loadu_si128((__m128i*)&mtx->zthresh_[0]); - const __m128i zthresh8 = _mm_loadu_si128((__m128i*)&mtx->zthresh_[8]); - - // sign(in) = in >> 15 (0x0000 if positive, 0xffff if negative) - sign0 = _mm_srai_epi16(in0, 15); - sign8 = _mm_srai_epi16(in8, 15); - - // coeff = abs(in) = (in ^ sign) - sign - coeff0 = _mm_xor_si128(in0, sign0); - coeff8 = _mm_xor_si128(in8, sign8); - coeff0 = _mm_sub_epi16(coeff0, sign0); - coeff8 = _mm_sub_epi16(coeff8, sign8); - - // coeff = abs(in) + sharpen - coeff0 = _mm_add_epi16(coeff0, sharpen0); - coeff8 = _mm_add_epi16(coeff8, sharpen8); - - // if (coeff > 2047) coeff = 2047 - coeff0 = _mm_min_epi16(coeff0, max_coeff_2047); - coeff8 = _mm_min_epi16(coeff8, max_coeff_2047); - - // out = (coeff * iQ + B) >> QFIX; - { - // doing calculations with 32b precision (QFIX=17) - // out = (coeff * iQ) - __m128i coeff_iQ0H = _mm_mulhi_epu16(coeff0, iq0); - __m128i coeff_iQ0L = _mm_mullo_epi16(coeff0, iq0); - __m128i coeff_iQ8H = _mm_mulhi_epu16(coeff8, iq8); - __m128i coeff_iQ8L = _mm_mullo_epi16(coeff8, iq8); - __m128i out_00 = _mm_unpacklo_epi16(coeff_iQ0L, coeff_iQ0H); - __m128i out_04 = _mm_unpackhi_epi16(coeff_iQ0L, coeff_iQ0H); - __m128i out_08 = _mm_unpacklo_epi16(coeff_iQ8L, coeff_iQ8H); - __m128i out_12 = _mm_unpackhi_epi16(coeff_iQ8L, coeff_iQ8H); - // expand bias from 16b to 32b - __m128i bias_00 = _mm_unpacklo_epi16(bias0, zero); - __m128i bias_04 = _mm_unpackhi_epi16(bias0, zero); - __m128i bias_08 = _mm_unpacklo_epi16(bias8, zero); - __m128i bias_12 = _mm_unpackhi_epi16(bias8, zero); - // out = (coeff * iQ + B) - out_00 = _mm_add_epi32(out_00, bias_00); - out_04 = _mm_add_epi32(out_04, bias_04); - out_08 = _mm_add_epi32(out_08, bias_08); - out_12 = _mm_add_epi32(out_12, bias_12); - // out = (coeff * iQ + B) >> QFIX; - out_00 = _mm_srai_epi32(out_00, QFIX); - out_04 = _mm_srai_epi32(out_04, QFIX); - out_08 = _mm_srai_epi32(out_08, QFIX); - out_12 = _mm_srai_epi32(out_12, QFIX); - // pack result as 16b - out0 = _mm_packs_epi32(out_00, out_04); - out8 = _mm_packs_epi32(out_08, out_12); - } - - // get sign back (if (sign[j]) out_n = -out_n) - out0 = _mm_xor_si128(out0, sign0); - out8 = _mm_xor_si128(out8, sign8); - out0 = _mm_sub_epi16(out0, sign0); - out8 = _mm_sub_epi16(out8, sign8); - - // in = out * Q - in0 = _mm_mullo_epi16(out0, q0); - in8 = _mm_mullo_epi16(out8, q8); - - // if (coeff <= mtx->zthresh_) {in=0; out=0;} - { - __m128i cmp0 = _mm_cmpgt_epi16(coeff0, zthresh0); - __m128i cmp8 = _mm_cmpgt_epi16(coeff8, zthresh8); - in0 = _mm_and_si128(in0, cmp0); - in8 = _mm_and_si128(in8, cmp8); - _mm_storeu_si128((__m128i*)&in[0], in0); - _mm_storeu_si128((__m128i*)&in[8], in8); - out0 = _mm_and_si128(out0, cmp0); - out8 = _mm_and_si128(out8, cmp8); - } - - // zigzag the output before storing it. - // - // The zigzag pattern can almost be reproduced with a small sequence of - // shuffles. After it, we only need to swap the 7th (ending up in third - // position instead of twelfth) and 8th values. - { - __m128i outZ0, outZ8; - outZ0 = _mm_shufflehi_epi16(out0, _MM_SHUFFLE(2, 1, 3, 0)); - outZ0 = _mm_shuffle_epi32 (outZ0, _MM_SHUFFLE(3, 1, 2, 0)); - outZ0 = _mm_shufflehi_epi16(outZ0, _MM_SHUFFLE(3, 1, 0, 2)); - outZ8 = _mm_shufflelo_epi16(out8, _MM_SHUFFLE(3, 0, 2, 1)); - outZ8 = _mm_shuffle_epi32 (outZ8, _MM_SHUFFLE(3, 1, 2, 0)); - outZ8 = _mm_shufflelo_epi16(outZ8, _MM_SHUFFLE(1, 3, 2, 0)); - _mm_storeu_si128((__m128i*)&out[0], outZ0); - _mm_storeu_si128((__m128i*)&out[8], outZ8); - packed_out = _mm_packs_epi16(outZ0, outZ8); - } - { - const int16_t outZ_12 = out[12]; - const int16_t outZ_3 = out[3]; - out[3] = outZ_12; - out[12] = outZ_3; - } - - // detect if all 'out' values are zeroes or not - { - int32_t tmp[4]; - _mm_storeu_si128((__m128i*)tmp, packed_out); - if (n) { - tmp[0] &= ~0xff; - } - return (tmp[3] || tmp[2] || tmp[1] || tmp[0]); - } -} - -#endif // WEBP_USE_SSE2 - -//------------------------------------------------------------------------------ -// Entry point - -extern void VP8EncDspInitSSE2(void); - -void VP8EncDspInitSSE2(void) { -#if defined(WEBP_USE_SSE2) - VP8CollectHistogram = CollectHistogramSSE2; - VP8EncQuantizeBlock = QuantizeBlockSSE2; - VP8ITransform = ITransformSSE2; - VP8FTransform = FTransformSSE2; - VP8SSE4x4 = SSE4x4SSE2; - VP8TDisto4x4 = Disto4x4SSE2; - VP8TDisto16x16 = Disto16x16SSE2; -#endif // WEBP_USE_SSE2 -} - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif diff --git a/external/libwebp/dsp/lossless.c b/external/libwebp/dsp/lossless.c deleted file mode 100644 index a077f6e759..0000000000 --- a/external/libwebp/dsp/lossless.c +++ /dev/null @@ -1,1140 +0,0 @@ -// Copyright 2012 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Image transforms and color space conversion methods for lossless decoder. -// -// Authors: Vikas Arora (vikaas.arora@gmail.com) -// Jyrki Alakuijala (jyrki@google.com) -// Urvang Joshi (urvang@google.com) - -#include "platform/CCPlatformConfig.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -#include <math.h> -#include <stdlib.h> -#include "./lossless.h" -#include "../dec/vp8li.h" -#include "../dsp/yuv.h" -#include "../dsp/dsp.h" -#include "../enc/histogram.h" - -#define MAX_DIFF_COST (1e30f) - -// lookup table for small values of log2(int) -#define APPROX_LOG_MAX 4096 -#define LOG_2_RECIPROCAL 1.44269504088896338700465094007086 -#define LOG_LOOKUP_IDX_MAX 256 -static const float kLog2Table[LOG_LOOKUP_IDX_MAX] = { - 0.0000000000000000f, 0.0000000000000000f, - 1.0000000000000000f, 1.5849625007211560f, - 2.0000000000000000f, 2.3219280948873621f, - 2.5849625007211560f, 2.8073549220576041f, - 3.0000000000000000f, 3.1699250014423121f, - 3.3219280948873621f, 3.4594316186372973f, - 3.5849625007211560f, 3.7004397181410921f, - 3.8073549220576041f, 3.9068905956085187f, - 4.0000000000000000f, 4.0874628412503390f, - 4.1699250014423121f, 4.2479275134435852f, - 4.3219280948873626f, 4.3923174227787606f, - 4.4594316186372973f, 4.5235619560570130f, - 4.5849625007211560f, 4.6438561897747243f, - 4.7004397181410917f, 4.7548875021634682f, - 4.8073549220576037f, 4.8579809951275718f, - 4.9068905956085187f, 4.9541963103868749f, - 5.0000000000000000f, 5.0443941193584533f, - 5.0874628412503390f, 5.1292830169449663f, - 5.1699250014423121f, 5.2094533656289501f, - 5.2479275134435852f, 5.2854022188622487f, - 5.3219280948873626f, 5.3575520046180837f, - 5.3923174227787606f, 5.4262647547020979f, - 5.4594316186372973f, 5.4918530963296747f, - 5.5235619560570130f, 5.5545888516776376f, - 5.5849625007211560f, 5.6147098441152083f, - 5.6438561897747243f, 5.6724253419714951f, - 5.7004397181410917f, 5.7279204545631987f, - 5.7548875021634682f, 5.7813597135246599f, - 5.8073549220576037f, 5.8328900141647412f, - 5.8579809951275718f, 5.8826430493618415f, - 5.9068905956085187f, 5.9307373375628866f, - 5.9541963103868749f, 5.9772799234999167f, - 6.0000000000000000f, 6.0223678130284543f, - 6.0443941193584533f, 6.0660891904577720f, - 6.0874628412503390f, 6.1085244567781691f, - 6.1292830169449663f, 6.1497471195046822f, - 6.1699250014423121f, 6.1898245588800175f, - 6.2094533656289501f, 6.2288186904958804f, - 6.2479275134435852f, 6.2667865406949010f, - 6.2854022188622487f, 6.3037807481771030f, - 6.3219280948873626f, 6.3398500028846243f, - 6.3575520046180837f, 6.3750394313469245f, - 6.3923174227787606f, 6.4093909361377017f, - 6.4262647547020979f, 6.4429434958487279f, - 6.4594316186372973f, 6.4757334309663976f, - 6.4918530963296747f, 6.5077946401986963f, - 6.5235619560570130f, 6.5391588111080309f, - 6.5545888516776376f, 6.5698556083309478f, - 6.5849625007211560f, 6.5999128421871278f, - 6.6147098441152083f, 6.6293566200796094f, - 6.6438561897747243f, 6.6582114827517946f, - 6.6724253419714951f, 6.6865005271832185f, - 6.7004397181410917f, 6.7142455176661224f, - 6.7279204545631987f, 6.7414669864011464f, - 6.7548875021634682f, 6.7681843247769259f, - 6.7813597135246599f, 6.7944158663501061f, - 6.8073549220576037f, 6.8201789624151878f, - 6.8328900141647412f, 6.8454900509443747f, - 6.8579809951275718f, 6.8703647195834047f, - 6.8826430493618415f, 6.8948177633079437f, - 6.9068905956085187f, 6.9188632372745946f, - 6.9307373375628866f, 6.9425145053392398f, - 6.9541963103868749f, 6.9657842846620869f, - 6.9772799234999167f, 6.9886846867721654f, - 7.0000000000000000f, 7.0112272554232539f, - 7.0223678130284543f, 7.0334230015374501f, - 7.0443941193584533f, 7.0552824355011898f, - 7.0660891904577720f, 7.0768155970508308f, - 7.0874628412503390f, 7.0980320829605263f, - 7.1085244567781691f, 7.1189410727235076f, - 7.1292830169449663f, 7.1395513523987936f, - 7.1497471195046822f, 7.1598713367783890f, - 7.1699250014423121f, 7.1799090900149344f, - 7.1898245588800175f, 7.1996723448363644f, - 7.2094533656289501f, 7.2191685204621611f, - 7.2288186904958804f, 7.2384047393250785f, - 7.2479275134435852f, 7.2573878426926521f, - 7.2667865406949010f, 7.2761244052742375f, - 7.2854022188622487f, 7.2946207488916270f, - 7.3037807481771030f, 7.3128829552843557f, - 7.3219280948873626f, 7.3309168781146167f, - 7.3398500028846243f, 7.3487281542310771f, - 7.3575520046180837f, 7.3663222142458160f, - 7.3750394313469245f, 7.3837042924740519f, - 7.3923174227787606f, 7.4008794362821843f, - 7.4093909361377017f, 7.4178525148858982f, - 7.4262647547020979f, 7.4346282276367245f, - 7.4429434958487279f, 7.4512111118323289f, - 7.4594316186372973f, 7.4676055500829976f, - 7.4757334309663976f, 7.4838157772642563f, - 7.4918530963296747f, 7.4998458870832056f, - 7.5077946401986963f, 7.5156998382840427f, - 7.5235619560570130f, 7.5313814605163118f, - 7.5391588111080309f, 7.5468944598876364f, - 7.5545888516776376f, 7.5622424242210728f, - 7.5698556083309478f, 7.5774288280357486f, - 7.5849625007211560f, 7.5924570372680806f, - 7.5999128421871278f, 7.6073303137496104f, - 7.6147098441152083f, 7.6220518194563764f, - 7.6293566200796094f, 7.6366246205436487f, - 7.6438561897747243f, 7.6510516911789281f, - 7.6582114827517946f, 7.6653359171851764f, - 7.6724253419714951f, 7.6794800995054464f, - 7.6865005271832185f, 7.6934869574993252f, - 7.7004397181410917f, 7.7073591320808825f, - 7.7142455176661224f, 7.7210991887071855f, - 7.7279204545631987f, 7.7347096202258383f, - 7.7414669864011464f, 7.7481928495894605f, - 7.7548875021634682f, 7.7615512324444795f, - 7.7681843247769259f, 7.7747870596011736f, - 7.7813597135246599f, 7.7879025593914317f, - 7.7944158663501061f, 7.8008998999203047f, - 7.8073549220576037f, 7.8137811912170374f, - 7.8201789624151878f, 7.8265484872909150f, - 7.8328900141647412f, 7.8392037880969436f, - 7.8454900509443747f, 7.8517490414160571f, - 7.8579809951275718f, 7.8641861446542797f, - 7.8703647195834047f, 7.8765169465649993f, - 7.8826430493618415f, 7.8887432488982591f, - 7.8948177633079437f, 7.9008668079807486f, - 7.9068905956085187f, 7.9128893362299619f, - 7.9188632372745946f, 7.9248125036057812f, - 7.9307373375628866f, 7.9366379390025709f, - 7.9425145053392398f, 7.9483672315846778f, - 7.9541963103868749f, 7.9600019320680805f, - 7.9657842846620869f, 7.9715435539507719f, - 7.9772799234999167f, 7.9829935746943103f, - 7.9886846867721654f, 7.9943534368588577f -}; - -float VP8LFastLog2(int v) { - if (v < LOG_LOOKUP_IDX_MAX) { - return kLog2Table[v]; - } else if (v < APPROX_LOG_MAX) { - int log_cnt = 0; - while (v >= LOG_LOOKUP_IDX_MAX) { - ++log_cnt; - v = v >> 1; - } - return kLog2Table[v] + (float)log_cnt; - } else { - return (float)(LOG_2_RECIPROCAL * log((double)v)); - } -} - -//------------------------------------------------------------------------------ -// Image transforms. - -// In-place sum of each component with mod 256. -static WEBP_INLINE void AddPixelsEq(uint32_t* a, uint32_t b) { - const uint32_t alpha_and_green = (*a & 0xff00ff00u) + (b & 0xff00ff00u); - const uint32_t red_and_blue = (*a & 0x00ff00ffu) + (b & 0x00ff00ffu); - *a = (alpha_and_green & 0xff00ff00u) | (red_and_blue & 0x00ff00ffu); -} - -static WEBP_INLINE uint32_t Average2(uint32_t a0, uint32_t a1) { - return (((a0 ^ a1) & 0xfefefefeL) >> 1) + (a0 & a1); -} - -static WEBP_INLINE uint32_t Average3(uint32_t a0, uint32_t a1, uint32_t a2) { - return Average2(Average2(a0, a2), a1); -} - -static WEBP_INLINE uint32_t Average4(uint32_t a0, uint32_t a1, - uint32_t a2, uint32_t a3) { - return Average2(Average2(a0, a1), Average2(a2, a3)); -} - -static WEBP_INLINE uint32_t Clip255(uint32_t a) { - if (a < 256) { - return a; - } - // return 0, when a is a negative integer. - // return 255, when a is positive. - return ~a >> 24; -} - -static WEBP_INLINE int AddSubtractComponentFull(int a, int b, int c) { - return Clip255(a + b - c); -} - -static WEBP_INLINE uint32_t ClampedAddSubtractFull(uint32_t c0, uint32_t c1, - uint32_t c2) { - const int a = AddSubtractComponentFull(c0 >> 24, c1 >> 24, c2 >> 24); - const int r = AddSubtractComponentFull((c0 >> 16) & 0xff, - (c1 >> 16) & 0xff, - (c2 >> 16) & 0xff); - const int g = AddSubtractComponentFull((c0 >> 8) & 0xff, - (c1 >> 8) & 0xff, - (c2 >> 8) & 0xff); - const int b = AddSubtractComponentFull(c0 & 0xff, c1 & 0xff, c2 & 0xff); - return (a << 24) | (r << 16) | (g << 8) | b; -} - -static WEBP_INLINE int AddSubtractComponentHalf(int a, int b) { - return Clip255(a + (a - b) / 2); -} - -static WEBP_INLINE uint32_t ClampedAddSubtractHalf(uint32_t c0, uint32_t c1, - uint32_t c2) { - const uint32_t ave = Average2(c0, c1); - const int a = AddSubtractComponentHalf(ave >> 24, c2 >> 24); - const int r = AddSubtractComponentHalf((ave >> 16) & 0xff, (c2 >> 16) & 0xff); - const int g = AddSubtractComponentHalf((ave >> 8) & 0xff, (c2 >> 8) & 0xff); - const int b = AddSubtractComponentHalf((ave >> 0) & 0xff, (c2 >> 0) & 0xff); - return (a << 24) | (r << 16) | (g << 8) | b; -} - -static WEBP_INLINE int Sub3(int a, int b, int c) { - const int pa = b - c; - const int pb = a - c; - return abs(pa) - abs(pb); -} - -static WEBP_INLINE uint32_t Select(uint32_t a, uint32_t b, uint32_t c) { - const int pa_minus_pb = - Sub3((a >> 24) , (b >> 24) , (c >> 24) ) + - Sub3((a >> 16) & 0xff, (b >> 16) & 0xff, (c >> 16) & 0xff) + - Sub3((a >> 8) & 0xff, (b >> 8) & 0xff, (c >> 8) & 0xff) + - Sub3((a ) & 0xff, (b ) & 0xff, (c ) & 0xff); - - return (pa_minus_pb <= 0) ? a : b; -} - -//------------------------------------------------------------------------------ -// Predictors - -static uint32_t Predictor0(uint32_t left, const uint32_t* const top) { - (void)top; - (void)left; - return ARGB_BLACK; -} -static uint32_t Predictor1(uint32_t left, const uint32_t* const top) { - (void)top; - return left; -} -static uint32_t Predictor2(uint32_t left, const uint32_t* const top) { - (void)left; - return top[0]; -} -static uint32_t Predictor3(uint32_t left, const uint32_t* const top) { - (void)left; - return top[1]; -} -static uint32_t Predictor4(uint32_t left, const uint32_t* const top) { - (void)left; - return top[-1]; -} -static uint32_t Predictor5(uint32_t left, const uint32_t* const top) { - const uint32_t pred = Average3(left, top[0], top[1]); - return pred; -} -static uint32_t Predictor6(uint32_t left, const uint32_t* const top) { - const uint32_t pred = Average2(left, top[-1]); - return pred; -} -static uint32_t Predictor7(uint32_t left, const uint32_t* const top) { - const uint32_t pred = Average2(left, top[0]); - return pred; -} -static uint32_t Predictor8(uint32_t left, const uint32_t* const top) { - const uint32_t pred = Average2(top[-1], top[0]); - (void)left; - return pred; -} -static uint32_t Predictor9(uint32_t left, const uint32_t* const top) { - const uint32_t pred = Average2(top[0], top[1]); - (void)left; - return pred; -} -static uint32_t Predictor10(uint32_t left, const uint32_t* const top) { - const uint32_t pred = Average4(left, top[-1], top[0], top[1]); - return pred; -} -static uint32_t Predictor11(uint32_t left, const uint32_t* const top) { - const uint32_t pred = Select(top[0], left, top[-1]); - return pred; -} -static uint32_t Predictor12(uint32_t left, const uint32_t* const top) { - const uint32_t pred = ClampedAddSubtractFull(left, top[0], top[-1]); - return pred; -} -static uint32_t Predictor13(uint32_t left, const uint32_t* const top) { - const uint32_t pred = ClampedAddSubtractHalf(left, top[0], top[-1]); - return pred; -} - -typedef uint32_t (*PredictorFunc)(uint32_t left, const uint32_t* const top); -static const PredictorFunc kPredictors[16] = { - Predictor0, Predictor1, Predictor2, Predictor3, - Predictor4, Predictor5, Predictor6, Predictor7, - Predictor8, Predictor9, Predictor10, Predictor11, - Predictor12, Predictor13, - Predictor0, Predictor0 // <- padding security sentinels -}; - -// TODO(vikasa): Replace 256 etc with defines. -static float PredictionCostSpatial(const int* counts, - int weight_0, double exp_val) { - const int significant_symbols = 16; - const double exp_decay_factor = 0.6; - double bits = weight_0 * counts[0]; - int i; - for (i = 1; i < significant_symbols; ++i) { - bits += exp_val * (counts[i] + counts[256 - i]); - exp_val *= exp_decay_factor; - } - return (float)(-0.1 * bits); -} - -// Compute the Shanon's entropy: Sum(p*log2(p)) -static float ShannonEntropy(const int* const array, int n) { - int i; - float retval = 0.f; - int sum = 0; - for (i = 0; i < n; ++i) { - if (array[i] != 0) { - sum += array[i]; - retval -= VP8LFastSLog2(array[i]); - } - } - retval += VP8LFastSLog2(sum); - return retval; -} - -static float PredictionCostSpatialHistogram(int accumulated[4][256], - int tile[4][256]) { - int i; - int k; - int combo[256]; - double retval = 0; - for (i = 0; i < 4; ++i) { - const double exp_val = 0.94; - retval += PredictionCostSpatial(&tile[i][0], 1, exp_val); - retval += ShannonEntropy(&tile[i][0], 256); - for (k = 0; k < 256; ++k) { - combo[k] = accumulated[i][k] + tile[i][k]; - } - retval += ShannonEntropy(&combo[0], 256); - } - return (float)retval; -} - -static int GetBestPredictorForTile(int width, int height, - int tile_x, int tile_y, int bits, - int accumulated[4][256], - const uint32_t* const argb_scratch) { - const int kNumPredModes = 14; - const int col_start = tile_x << bits; - const int row_start = tile_y << bits; - const int tile_size = 1 << bits; - const int ymax = (tile_size <= height - row_start) ? - tile_size : height - row_start; - const int xmax = (tile_size <= width - col_start) ? - tile_size : width - col_start; - int histo[4][256]; - float best_diff = MAX_DIFF_COST; - int best_mode = 0; - - int mode; - for (mode = 0; mode < kNumPredModes; ++mode) { - const uint32_t* current_row = argb_scratch; - const PredictorFunc pred_func = kPredictors[mode]; - float cur_diff; - int y; - memset(&histo[0][0], 0, sizeof(histo)); - for (y = 0; y < ymax; ++y) { - int x; - const int row = row_start + y; - const uint32_t* const upper_row = current_row; - current_row = upper_row + width; - for (x = 0; x < xmax; ++x) { - const int col = col_start + x; - uint32_t predict; - uint32_t predict_diff; - if (row == 0) { - predict = (col == 0) ? ARGB_BLACK : current_row[col - 1]; // Left. - } else if (col == 0) { - predict = upper_row[col]; // Top. - } else { - predict = pred_func(current_row[col - 1], upper_row + col); - } - predict_diff = VP8LSubPixels(current_row[col], predict); - ++histo[0][predict_diff >> 24]; - ++histo[1][((predict_diff >> 16) & 0xff)]; - ++histo[2][((predict_diff >> 8) & 0xff)]; - ++histo[3][(predict_diff & 0xff)]; - } - } - cur_diff = PredictionCostSpatialHistogram(accumulated, histo); - if (cur_diff < best_diff) { - best_diff = cur_diff; - best_mode = mode; - } - } - - return best_mode; -} - -static void CopyTileWithPrediction(int width, int height, - int tile_x, int tile_y, int bits, int mode, - const uint32_t* const argb_scratch, - uint32_t* const argb) { - const int col_start = tile_x << bits; - const int row_start = tile_y << bits; - const int tile_size = 1 << bits; - const int ymax = (tile_size <= height - row_start) ? - tile_size : height - row_start; - const int xmax = (tile_size <= width - col_start) ? - tile_size : width - col_start; - const PredictorFunc pred_func = kPredictors[mode]; - const uint32_t* current_row = argb_scratch; - - int y; - for (y = 0; y < ymax; ++y) { - int x; - const int row = row_start + y; - const uint32_t* const upper_row = current_row; - current_row = upper_row + width; - for (x = 0; x < xmax; ++x) { - const int col = col_start + x; - const int pix = row * width + col; - uint32_t predict; - if (row == 0) { - predict = (col == 0) ? ARGB_BLACK : current_row[col - 1]; // Left. - } else if (col == 0) { - predict = upper_row[col]; // Top. - } else { - predict = pred_func(current_row[col - 1], upper_row + col); - } - argb[pix] = VP8LSubPixels(current_row[col], predict); - } - } -} - -void VP8LResidualImage(int width, int height, int bits, - uint32_t* const argb, uint32_t* const argb_scratch, - uint32_t* const image) { - const int max_tile_size = 1 << bits; - const int tiles_per_row = VP8LSubSampleSize(width, bits); - const int tiles_per_col = VP8LSubSampleSize(height, bits); - uint32_t* const upper_row = argb_scratch; - uint32_t* const current_tile_rows = argb_scratch + width; - int tile_y; - int histo[4][256]; - memset(histo, 0, sizeof(histo)); - for (tile_y = 0; tile_y < tiles_per_col; ++tile_y) { - const int tile_y_offset = tile_y * max_tile_size; - const int this_tile_height = - (tile_y < tiles_per_col - 1) ? max_tile_size : height - tile_y_offset; - int tile_x; - if (tile_y > 0) { - memcpy(upper_row, current_tile_rows + (max_tile_size - 1) * width, - width * sizeof(*upper_row)); - } - memcpy(current_tile_rows, &argb[tile_y_offset * width], - this_tile_height * width * sizeof(*current_tile_rows)); - for (tile_x = 0; tile_x < tiles_per_row; ++tile_x) { - int pred; - int y; - const int tile_x_offset = tile_x * max_tile_size; - int all_x_max = tile_x_offset + max_tile_size; - if (all_x_max > width) { - all_x_max = width; - } - pred = GetBestPredictorForTile(width, height, tile_x, tile_y, bits, histo, - argb_scratch); - image[tile_y * tiles_per_row + tile_x] = 0xff000000u | (pred << 8); - CopyTileWithPrediction(width, height, tile_x, tile_y, bits, pred, - argb_scratch, argb); - for (y = 0; y < max_tile_size; ++y) { - int ix; - int all_x; - int all_y = tile_y_offset + y; - if (all_y >= height) { - break; - } - ix = all_y * width + tile_x_offset; - for (all_x = tile_x_offset; all_x < all_x_max; ++all_x, ++ix) { - const uint32_t a = argb[ix]; - ++histo[0][a >> 24]; - ++histo[1][((a >> 16) & 0xff)]; - ++histo[2][((a >> 8) & 0xff)]; - ++histo[3][(a & 0xff)]; - } - } - } - } -} - -// Inverse prediction. -static void PredictorInverseTransform(const VP8LTransform* const transform, - int y_start, int y_end, uint32_t* data) { - const int width = transform->xsize_; - if (y_start == 0) { // First Row follows the L (mode=1) mode. - int x; - const uint32_t pred0 = Predictor0(data[-1], NULL); - AddPixelsEq(data, pred0); - for (x = 1; x < width; ++x) { - const uint32_t pred1 = Predictor1(data[x - 1], NULL); - AddPixelsEq(data + x, pred1); - } - data += width; - ++y_start; - } - - { - int y = y_start; - const int mask = (1 << transform->bits_) - 1; - const int tiles_per_row = VP8LSubSampleSize(width, transform->bits_); - const uint32_t* pred_mode_base = - transform->data_ + (y >> transform->bits_) * tiles_per_row; - - while (y < y_end) { - int x; - const uint32_t pred2 = Predictor2(data[-1], data - width); - const uint32_t* pred_mode_src = pred_mode_base; - PredictorFunc pred_func; - - // First pixel follows the T (mode=2) mode. - AddPixelsEq(data, pred2); - - // .. the rest: - pred_func = kPredictors[((*pred_mode_src++) >> 8) & 0xf]; - for (x = 1; x < width; ++x) { - uint32_t pred; - if ((x & mask) == 0) { // start of tile. Read predictor function. - pred_func = kPredictors[((*pred_mode_src++) >> 8) & 0xf]; - } - pred = pred_func(data[x - 1], data + x - width); - AddPixelsEq(data + x, pred); - } - data += width; - ++y; - if ((y & mask) == 0) { // Use the same mask, since tiles are squares. - pred_mode_base += tiles_per_row; - } - } - } -} - -void VP8LSubtractGreenFromBlueAndRed(uint32_t* argb_data, int num_pixs) { - int i; - for (i = 0; i < num_pixs; ++i) { - const uint32_t argb = argb_data[i]; - const uint32_t green = (argb >> 8) & 0xff; - const uint32_t new_r = (((argb >> 16) & 0xff) - green) & 0xff; - const uint32_t new_b = ((argb & 0xff) - green) & 0xff; - argb_data[i] = (argb & 0xff00ff00) | (new_r << 16) | new_b; - } -} - -// Add green to blue and red channels (i.e. perform the inverse transform of -// 'subtract green'). -static void AddGreenToBlueAndRed(const VP8LTransform* const transform, - int y_start, int y_end, uint32_t* data) { - const int width = transform->xsize_; - const uint32_t* const data_end = data + (y_end - y_start) * width; - while (data < data_end) { - const uint32_t argb = *data; - // "* 0001001u" is equivalent to "(green << 16) + green)" - const uint32_t green = ((argb >> 8) & 0xff); - uint32_t red_blue = (argb & 0x00ff00ffu); - red_blue += (green << 16) | green; - red_blue &= 0x00ff00ffu; - *data++ = (argb & 0xff00ff00u) | red_blue; - } -} - -typedef struct { - // Note: the members are uint8_t, so that any negative values are - // automatically converted to "mod 256" values. - uint8_t green_to_red_; - uint8_t green_to_blue_; - uint8_t red_to_blue_; -} Multipliers; - -static WEBP_INLINE void MultipliersClear(Multipliers* m) { - m->green_to_red_ = 0; - m->green_to_blue_ = 0; - m->red_to_blue_ = 0; -} - -static WEBP_INLINE uint32_t ColorTransformDelta(int8_t color_pred, - int8_t color) { - return (uint32_t)((int)(color_pred) * color) >> 5; -} - -static WEBP_INLINE void ColorCodeToMultipliers(uint32_t color_code, - Multipliers* const m) { - m->green_to_red_ = (color_code >> 0) & 0xff; - m->green_to_blue_ = (color_code >> 8) & 0xff; - m->red_to_blue_ = (color_code >> 16) & 0xff; -} - -static WEBP_INLINE uint32_t MultipliersToColorCode(Multipliers* const m) { - return 0xff000000u | - ((uint32_t)(m->red_to_blue_) << 16) | - ((uint32_t)(m->green_to_blue_) << 8) | - m->green_to_red_; -} - -static WEBP_INLINE uint32_t TransformColor(const Multipliers* const m, - uint32_t argb, int inverse) { - const uint32_t green = argb >> 8; - const uint32_t red = argb >> 16; - uint32_t new_red = red; - uint32_t new_blue = argb; - - if (inverse) { - new_red += ColorTransformDelta(m->green_to_red_, green); - new_red &= 0xff; - new_blue += ColorTransformDelta(m->green_to_blue_, green); - new_blue += ColorTransformDelta(m->red_to_blue_, new_red); - new_blue &= 0xff; - } else { - new_red -= ColorTransformDelta(m->green_to_red_, green); - new_red &= 0xff; - new_blue -= ColorTransformDelta(m->green_to_blue_, green); - new_blue -= ColorTransformDelta(m->red_to_blue_, red); - new_blue &= 0xff; - } - return (argb & 0xff00ff00u) | (new_red << 16) | (new_blue); -} - -static WEBP_INLINE int SkipRepeatedPixels(const uint32_t* const argb, - int ix, int xsize) { - const uint32_t v = argb[ix]; - if (ix >= xsize + 3) { - if (v == argb[ix - xsize] && - argb[ix - 1] == argb[ix - xsize - 1] && - argb[ix - 2] == argb[ix - xsize - 2] && - argb[ix - 3] == argb[ix - xsize - 3]) { - return 1; - } - return v == argb[ix - 3] && v == argb[ix - 2] && v == argb[ix - 1]; - } else if (ix >= 3) { - return v == argb[ix - 3] && v == argb[ix - 2] && v == argb[ix - 1]; - } - return 0; -} - -static float PredictionCostCrossColor(const int accumulated[256], - const int counts[256]) { - // Favor low entropy, locally and globally. - int i; - int combo[256]; - for (i = 0; i < 256; ++i) { - combo[i] = accumulated[i] + counts[i]; - } - return ShannonEntropy(combo, 256) + - ShannonEntropy(counts, 256) + - PredictionCostSpatial(counts, 3, 2.4); // Favor small absolute values. -} - -static Multipliers GetBestColorTransformForTile( - int tile_x, int tile_y, int bits, - Multipliers prevX, - Multipliers prevY, - int step, int xsize, int ysize, - int* accumulated_red_histo, - int* accumulated_blue_histo, - const uint32_t* const argb) { - float best_diff = MAX_DIFF_COST; - float cur_diff; - const int halfstep = step / 2; - const int max_tile_size = 1 << bits; - const int tile_y_offset = tile_y * max_tile_size; - const int tile_x_offset = tile_x * max_tile_size; - int green_to_red; - int green_to_blue; - int red_to_blue; - int all_x_max = tile_x_offset + max_tile_size; - int all_y_max = tile_y_offset + max_tile_size; - Multipliers best_tx; - MultipliersClear(&best_tx); - if (all_x_max > xsize) { - all_x_max = xsize; - } - if (all_y_max > ysize) { - all_y_max = ysize; - } - for (green_to_red = -64; green_to_red <= 64; green_to_red += halfstep) { - int histo[256] = { 0 }; - int all_y; - Multipliers tx; - MultipliersClear(&tx); - tx.green_to_red_ = green_to_red & 0xff; - - for (all_y = tile_y_offset; all_y < all_y_max; ++all_y) { - uint32_t predict; - int ix = all_y * xsize + tile_x_offset; - int all_x; - for (all_x = tile_x_offset; all_x < all_x_max; ++all_x, ++ix) { - if (SkipRepeatedPixels(argb, ix, xsize)) { - continue; - } - predict = TransformColor(&tx, argb[ix], 0); - ++histo[(predict >> 16) & 0xff]; // red. - } - } - cur_diff = PredictionCostCrossColor(&accumulated_red_histo[0], &histo[0]); - if (tx.green_to_red_ == prevX.green_to_red_) { - cur_diff -= 3; // favor keeping the areas locally similar - } - if (tx.green_to_red_ == prevY.green_to_red_) { - cur_diff -= 3; // favor keeping the areas locally similar - } - if (tx.green_to_red_ == 0) { - cur_diff -= 3; - } - if (cur_diff < best_diff) { - best_diff = cur_diff; - best_tx = tx; - } - } - best_diff = MAX_DIFF_COST; - green_to_red = best_tx.green_to_red_; - for (green_to_blue = -32; green_to_blue <= 32; green_to_blue += step) { - for (red_to_blue = -32; red_to_blue <= 32; red_to_blue += step) { - int all_y; - int histo[256] = { 0 }; - Multipliers tx; - tx.green_to_red_ = green_to_red; - tx.green_to_blue_ = green_to_blue; - tx.red_to_blue_ = red_to_blue; - for (all_y = tile_y_offset; all_y < all_y_max; ++all_y) { - uint32_t predict; - int all_x; - int ix = all_y * xsize + tile_x_offset; - for (all_x = tile_x_offset; all_x < all_x_max; ++all_x, ++ix) { - if (SkipRepeatedPixels(argb, ix, xsize)) { - continue; - } - predict = TransformColor(&tx, argb[ix], 0); - ++histo[predict & 0xff]; // blue. - } - } - cur_diff = - PredictionCostCrossColor(&accumulated_blue_histo[0], &histo[0]); - if (tx.green_to_blue_ == prevX.green_to_blue_) { - cur_diff -= 3; // favor keeping the areas locally similar - } - if (tx.green_to_blue_ == prevY.green_to_blue_) { - cur_diff -= 3; // favor keeping the areas locally similar - } - if (tx.red_to_blue_ == prevX.red_to_blue_) { - cur_diff -= 3; // favor keeping the areas locally similar - } - if (tx.red_to_blue_ == prevY.red_to_blue_) { - cur_diff -= 3; // favor keeping the areas locally similar - } - if (tx.green_to_blue_ == 0) { - cur_diff -= 3; - } - if (tx.red_to_blue_ == 0) { - cur_diff -= 3; - } - if (cur_diff < best_diff) { - best_diff = cur_diff; - best_tx = tx; - } - } - } - return best_tx; -} - -static void CopyTileWithColorTransform(int xsize, int ysize, - int tile_x, int tile_y, int bits, - Multipliers color_transform, - uint32_t* const argb) { - int y; - int xscan = 1 << bits; - int yscan = 1 << bits; - tile_x <<= bits; - tile_y <<= bits; - if (xscan > xsize - tile_x) { - xscan = xsize - tile_x; - } - if (yscan > ysize - tile_y) { - yscan = ysize - tile_y; - } - yscan += tile_y; - for (y = tile_y; y < yscan; ++y) { - int ix = y * xsize + tile_x; - const int end_ix = ix + xscan; - for (; ix < end_ix; ++ix) { - argb[ix] = TransformColor(&color_transform, argb[ix], 0); - } - } -} - -void VP8LColorSpaceTransform(int width, int height, int bits, int step, - uint32_t* const argb, uint32_t* image) { - const int max_tile_size = 1 << bits; - int tile_xsize = VP8LSubSampleSize(width, bits); - int tile_ysize = VP8LSubSampleSize(height, bits); - int accumulated_red_histo[256] = { 0 }; - int accumulated_blue_histo[256] = { 0 }; - int tile_y; - int tile_x; - Multipliers prevX; - Multipliers prevY; - MultipliersClear(&prevY); - MultipliersClear(&prevX); - for (tile_y = 0; tile_y < tile_ysize; ++tile_y) { - for (tile_x = 0; tile_x < tile_xsize; ++tile_x) { - Multipliers color_transform; - int all_x_max; - int y; - const int tile_y_offset = tile_y * max_tile_size; - const int tile_x_offset = tile_x * max_tile_size; - if (tile_y != 0) { - ColorCodeToMultipliers(image[tile_y * tile_xsize + tile_x - 1], &prevX); - ColorCodeToMultipliers(image[(tile_y - 1) * tile_xsize + tile_x], - &prevY); - } else if (tile_x != 0) { - ColorCodeToMultipliers(image[tile_y * tile_xsize + tile_x - 1], &prevX); - } - color_transform = - GetBestColorTransformForTile(tile_x, tile_y, bits, - prevX, prevY, - step, width, height, - &accumulated_red_histo[0], - &accumulated_blue_histo[0], - argb); - image[tile_y * tile_xsize + tile_x] = - MultipliersToColorCode(&color_transform); - CopyTileWithColorTransform(width, height, tile_x, tile_y, bits, - color_transform, argb); - - // Gather accumulated histogram data. - all_x_max = tile_x_offset + max_tile_size; - if (all_x_max > width) { - all_x_max = width; - } - for (y = 0; y < max_tile_size; ++y) { - int ix; - int all_x; - int all_y = tile_y_offset + y; - if (all_y >= height) { - break; - } - ix = all_y * width + tile_x_offset; - for (all_x = tile_x_offset; all_x < all_x_max; ++all_x, ++ix) { - if (ix >= 2 && - argb[ix] == argb[ix - 2] && - argb[ix] == argb[ix - 1]) { - continue; // repeated pixels are handled by backward references - } - if (ix >= width + 2 && - argb[ix - 2] == argb[ix - width - 2] && - argb[ix - 1] == argb[ix - width - 1] && - argb[ix] == argb[ix - width]) { - continue; // repeated pixels are handled by backward references - } - ++accumulated_red_histo[(argb[ix] >> 16) & 0xff]; - ++accumulated_blue_histo[argb[ix] & 0xff]; - } - } - } - } -} - -// Color space inverse transform. -static void ColorSpaceInverseTransform(const VP8LTransform* const transform, - int y_start, int y_end, uint32_t* data) { - const int width = transform->xsize_; - const int mask = (1 << transform->bits_) - 1; - const int tiles_per_row = VP8LSubSampleSize(width, transform->bits_); - int y = y_start; - const uint32_t* pred_row = - transform->data_ + (y >> transform->bits_) * tiles_per_row; - - while (y < y_end) { - const uint32_t* pred = pred_row; - Multipliers m = { 0, 0, 0 }; - int x; - - for (x = 0; x < width; ++x) { - if ((x & mask) == 0) ColorCodeToMultipliers(*pred++, &m); - data[x] = TransformColor(&m, data[x], 1); - } - data += width; - ++y; - if ((y & mask) == 0) pred_row += tiles_per_row;; - } -} - -// Separate out pixels packed together using pixel-bundling. -static void ColorIndexInverseTransform( - const VP8LTransform* const transform, - int y_start, int y_end, const uint32_t* src, uint32_t* dst) { - int y; - const int bits_per_pixel = 8 >> transform->bits_; - const int width = transform->xsize_; - const uint32_t* const color_map = transform->data_; - if (bits_per_pixel < 8) { - const int pixels_per_byte = 1 << transform->bits_; - const int count_mask = pixels_per_byte - 1; - const uint32_t bit_mask = (1 << bits_per_pixel) - 1; - for (y = y_start; y < y_end; ++y) { - uint32_t packed_pixels = 0; - int x; - for (x = 0; x < width; ++x) { - // We need to load fresh 'packed_pixels' once every 'pixels_per_byte' - // increments of x. Fortunately, pixels_per_byte is a power of 2, so - // can just use a mask for that, instead of decrementing a counter. - if ((x & count_mask) == 0) packed_pixels = ((*src++) >> 8) & 0xff; - *dst++ = color_map[packed_pixels & bit_mask]; - packed_pixels >>= bits_per_pixel; - } - } - } else { - for (y = y_start; y < y_end; ++y) { - int x; - for (x = 0; x < width; ++x) { - *dst++ = color_map[((*src++) >> 8) & 0xff]; - } - } - } -} - -void VP8LInverseTransform(const VP8LTransform* const transform, - int row_start, int row_end, - const uint32_t* const in, uint32_t* const out) { - assert(row_start < row_end); - assert(row_end <= transform->ysize_); - switch (transform->type_) { - case SUBTRACT_GREEN: - AddGreenToBlueAndRed(transform, row_start, row_end, out); - break; - case PREDICTOR_TRANSFORM: - PredictorInverseTransform(transform, row_start, row_end, out); - if (row_end != transform->ysize_) { - // The last predicted row in this iteration will be the top-pred row - // for the first row in next iteration. - const int width = transform->xsize_; - memcpy(out - width, out + (row_end - row_start - 1) * width, - width * sizeof(*out)); - } - break; - case CROSS_COLOR_TRANSFORM: - ColorSpaceInverseTransform(transform, row_start, row_end, out); - break; - case COLOR_INDEXING_TRANSFORM: - if (in == out && transform->bits_ > 0) { - // Move packed pixels to the end of unpacked region, so that unpacking - // can occur seamlessly. - // Also, note that this is the only transform that applies on - // the effective width of VP8LSubSampleSize(xsize_, bits_). All other - // transforms work on effective width of xsize_. - const int out_stride = (row_end - row_start) * transform->xsize_; - const int in_stride = (row_end - row_start) * - VP8LSubSampleSize(transform->xsize_, transform->bits_); - uint32_t* const src = out + out_stride - in_stride; - memmove(src, out, in_stride * sizeof(*src)); - ColorIndexInverseTransform(transform, row_start, row_end, src, out); - } else { - ColorIndexInverseTransform(transform, row_start, row_end, in, out); - } - break; - } -} - -//------------------------------------------------------------------------------ -// Color space conversion. - -static int is_big_endian(void) { - static const union { - uint16_t w; - uint8_t b[2]; - } tmp = { 1 }; - return (tmp.b[0] != 1); -} - -static void ConvertBGRAToRGB(const uint32_t* src, - int num_pixels, uint8_t* dst) { - const uint32_t* const src_end = src + num_pixels; - while (src < src_end) { - const uint32_t argb = *src++; - *dst++ = (argb >> 16) & 0xff; - *dst++ = (argb >> 8) & 0xff; - *dst++ = (argb >> 0) & 0xff; - } -} - -static void ConvertBGRAToRGBA(const uint32_t* src, - int num_pixels, uint8_t* dst) { - const uint32_t* const src_end = src + num_pixels; - while (src < src_end) { - const uint32_t argb = *src++; - *dst++ = (argb >> 16) & 0xff; - *dst++ = (argb >> 8) & 0xff; - *dst++ = (argb >> 0) & 0xff; - *dst++ = (argb >> 24) & 0xff; - } -} - -static void ConvertBGRAToRGBA4444(const uint32_t* src, - int num_pixels, uint8_t* dst) { - const uint32_t* const src_end = src + num_pixels; - while (src < src_end) { - const uint32_t argb = *src++; - *dst++ = ((argb >> 16) & 0xf0) | ((argb >> 12) & 0xf); - *dst++ = ((argb >> 0) & 0xf0) | ((argb >> 28) & 0xf); - } -} - -static void ConvertBGRAToRGB565(const uint32_t* src, - int num_pixels, uint8_t* dst) { - const uint32_t* const src_end = src + num_pixels; - while (src < src_end) { - const uint32_t argb = *src++; - *dst++ = ((argb >> 16) & 0xf8) | ((argb >> 13) & 0x7); - *dst++ = ((argb >> 5) & 0xe0) | ((argb >> 3) & 0x1f); - } -} - -static void ConvertBGRAToBGR(const uint32_t* src, - int num_pixels, uint8_t* dst) { - const uint32_t* const src_end = src + num_pixels; - while (src < src_end) { - const uint32_t argb = *src++; - *dst++ = (argb >> 0) & 0xff; - *dst++ = (argb >> 8) & 0xff; - *dst++ = (argb >> 16) & 0xff; - } -} - -static void CopyOrSwap(const uint32_t* src, int num_pixels, uint8_t* dst, - int swap_on_big_endian) { - if (is_big_endian() == swap_on_big_endian) { - const uint32_t* const src_end = src + num_pixels; - while (src < src_end) { - uint32_t argb = *src++; -#if (!defined(__BIG_ENDIAN__) && (defined(__i386__) || defined(__x86_64__))) && (CC_TARGET_PLATFORM != CC_PLATFORM_MARMALADE) - __asm__ volatile("bswap %0" : "=r"(argb) : "0"(argb)); - *(uint32_t*)dst = argb; - dst += sizeof(argb); -#elif (!defined(__BIG_ENDIAN__) && defined(_MSC_VER)) && (CC_TARGET_PLATFORM != CC_PLATFORM_MARMALADE) - argb = _byteswap_ulong(argb); - *(uint32_t*)dst = argb; - dst += sizeof(argb); -#else - *dst++ = (argb >> 24) & 0xff; - *dst++ = (argb >> 16) & 0xff; - *dst++ = (argb >> 8) & 0xff; - *dst++ = (argb >> 0) & 0xff; -#endif - } - } else { - memcpy(dst, src, num_pixels * sizeof(*src)); - } -} - -void VP8LConvertFromBGRA(const uint32_t* const in_data, int num_pixels, - WEBP_CSP_MODE out_colorspace, uint8_t* const rgba) { - switch (out_colorspace) { - case MODE_RGB: - ConvertBGRAToRGB(in_data, num_pixels, rgba); - break; - case MODE_RGBA: - ConvertBGRAToRGBA(in_data, num_pixels, rgba); - break; - case MODE_rgbA: - ConvertBGRAToRGBA(in_data, num_pixels, rgba); - WebPApplyAlphaMultiply(rgba, 0, num_pixels, 1, 0); - break; - case MODE_BGR: - ConvertBGRAToBGR(in_data, num_pixels, rgba); - break; - case MODE_BGRA: - CopyOrSwap(in_data, num_pixels, rgba, 1); - break; - case MODE_bgrA: - CopyOrSwap(in_data, num_pixels, rgba, 1); - WebPApplyAlphaMultiply(rgba, 0, num_pixels, 1, 0); - break; - case MODE_ARGB: - CopyOrSwap(in_data, num_pixels, rgba, 0); - break; - case MODE_Argb: - CopyOrSwap(in_data, num_pixels, rgba, 0); - WebPApplyAlphaMultiply(rgba, 1, num_pixels, 1, 0); - break; - case MODE_RGBA_4444: - ConvertBGRAToRGBA4444(in_data, num_pixels, rgba); - break; - case MODE_rgbA_4444: - ConvertBGRAToRGBA4444(in_data, num_pixels, rgba); - WebPApplyAlphaMultiply4444(rgba, num_pixels, 1, 0); - break; - case MODE_RGB_565: - ConvertBGRAToRGB565(in_data, num_pixels, rgba); - break; - default: - assert(0); // Code flow should not reach here. - } -} - -//------------------------------------------------------------------------------ - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif diff --git a/external/libwebp/dsp/lossless.h b/external/libwebp/dsp/lossless.h deleted file mode 100644 index 992516fcdf..0000000000 --- a/external/libwebp/dsp/lossless.h +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2012 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Image transforms and color space conversion methods for lossless decoder. -// -// Authors: Vikas Arora (vikaas.arora@gmail.com) -// Jyrki Alakuijala (jyrki@google.com) - -#ifndef WEBP_DSP_LOSSLESS_H_ -#define WEBP_DSP_LOSSLESS_H_ - -#include "../webp/types.h" -#include "../webp/decode.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -//------------------------------------------------------------------------------ -// Image transforms. - -struct VP8LTransform; // Defined in dec/vp8li.h. - -// Performs inverse transform of data given transform information, start and end -// rows. Transform will be applied to rows [row_start, row_end[. -// The *in and *out pointers refer to source and destination data respectively -// corresponding to the intermediate row (row_start). -void VP8LInverseTransform(const struct VP8LTransform* const transform, - int row_start, int row_end, - const uint32_t* const in, uint32_t* const out); - -// Subtracts green from blue and red channels. -void VP8LSubtractGreenFromBlueAndRed(uint32_t* argb_data, int num_pixs); - -void VP8LResidualImage(int width, int height, int bits, - uint32_t* const argb, uint32_t* const argb_scratch, - uint32_t* const image); - -void VP8LColorSpaceTransform(int width, int height, int bits, int step, - uint32_t* const argb, uint32_t* image); - -//------------------------------------------------------------------------------ -// Color space conversion. - -// Converts from BGRA to other color spaces. -void VP8LConvertFromBGRA(const uint32_t* const in_data, int num_pixels, - WEBP_CSP_MODE out_colorspace, uint8_t* const rgba); - -//------------------------------------------------------------------------------ -// Misc methods. - -// Computes sampled size of 'size' when sampling using 'sampling bits'. -static WEBP_INLINE uint32_t VP8LSubSampleSize(uint32_t size, - uint32_t sampling_bits) { - return (size + (1 << sampling_bits) - 1) >> sampling_bits; -} - -// Faster logarithm for integers, with the property of log2(0) == 0. -float VP8LFastLog2(int v); -// Fast calculation of v * log2(v) for integer input. -static WEBP_INLINE float VP8LFastSLog2(int v) { return VP8LFastLog2(v) * v; } - -// In-place difference of each component with mod 256. -static WEBP_INLINE uint32_t VP8LSubPixels(uint32_t a, uint32_t b) { - const uint32_t alpha_and_green = - 0x00ff00ffu + (a & 0xff00ff00u) - (b & 0xff00ff00u); - const uint32_t red_and_blue = - 0xff00ff00u + (a & 0x00ff00ffu) - (b & 0x00ff00ffu); - return (alpha_and_green & 0xff00ff00u) | (red_and_blue & 0x00ff00ffu); -} - -//------------------------------------------------------------------------------ - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif - -#endif // WEBP_DSP_LOSSLESS_H_ diff --git a/external/libwebp/dsp/upsampling.c b/external/libwebp/dsp/upsampling.c deleted file mode 100644 index 4855eb1432..0000000000 --- a/external/libwebp/dsp/upsampling.c +++ /dev/null @@ -1,357 +0,0 @@ -// Copyright 2011 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// YUV to RGB upsampling functions. -// -// Author: somnath@google.com (Somnath Banerjee) - -#include "./dsp.h" -#include "./yuv.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -//------------------------------------------------------------------------------ -// Fancy upsampler - -#ifdef FANCY_UPSAMPLING - -// Fancy upsampling functions to convert YUV to RGB -WebPUpsampleLinePairFunc WebPUpsamplers[MODE_LAST]; - -// Given samples laid out in a square as: -// [a b] -// [c d] -// we interpolate u/v as: -// ([9*a + 3*b + 3*c + d 3*a + 9*b + 3*c + d] + [8 8]) / 16 -// ([3*a + b + 9*c + 3*d a + 3*b + 3*c + 9*d] [8 8]) / 16 - -// We process u and v together stashed into 32bit (16bit each). -#define LOAD_UV(u,v) ((u) | ((v) << 16)) - -#define UPSAMPLE_FUNC(FUNC_NAME, FUNC, XSTEP) \ -static void FUNC_NAME(const uint8_t* top_y, const uint8_t* bottom_y, \ - const uint8_t* top_u, const uint8_t* top_v, \ - const uint8_t* cur_u, const uint8_t* cur_v, \ - uint8_t* top_dst, uint8_t* bottom_dst, int len) { \ - int x; \ - const int last_pixel_pair = (len - 1) >> 1; \ - uint32_t tl_uv = LOAD_UV(top_u[0], top_v[0]); /* top-left sample */ \ - uint32_t l_uv = LOAD_UV(cur_u[0], cur_v[0]); /* left-sample */ \ - if (top_y) { \ - const uint32_t uv0 = (3 * tl_uv + l_uv + 0x00020002u) >> 2; \ - FUNC(top_y[0], uv0 & 0xff, (uv0 >> 16), top_dst); \ - } \ - if (bottom_y) { \ - const uint32_t uv0 = (3 * l_uv + tl_uv + 0x00020002u) >> 2; \ - FUNC(bottom_y[0], uv0 & 0xff, (uv0 >> 16), bottom_dst); \ - } \ - for (x = 1; x <= last_pixel_pair; ++x) { \ - const uint32_t t_uv = LOAD_UV(top_u[x], top_v[x]); /* top sample */ \ - const uint32_t uv = LOAD_UV(cur_u[x], cur_v[x]); /* sample */ \ - /* precompute invariant values associated with first and second diagonals*/\ - const uint32_t avg = tl_uv + t_uv + l_uv + uv + 0x00080008u; \ - const uint32_t diag_12 = (avg + 2 * (t_uv + l_uv)) >> 3; \ - const uint32_t diag_03 = (avg + 2 * (tl_uv + uv)) >> 3; \ - if (top_y) { \ - const uint32_t uv0 = (diag_12 + tl_uv) >> 1; \ - const uint32_t uv1 = (diag_03 + t_uv) >> 1; \ - FUNC(top_y[2 * x - 1], uv0 & 0xff, (uv0 >> 16), \ - top_dst + (2 * x - 1) * XSTEP); \ - FUNC(top_y[2 * x - 0], uv1 & 0xff, (uv1 >> 16), \ - top_dst + (2 * x - 0) * XSTEP); \ - } \ - if (bottom_y) { \ - const uint32_t uv0 = (diag_03 + l_uv) >> 1; \ - const uint32_t uv1 = (diag_12 + uv) >> 1; \ - FUNC(bottom_y[2 * x - 1], uv0 & 0xff, (uv0 >> 16), \ - bottom_dst + (2 * x - 1) * XSTEP); \ - FUNC(bottom_y[2 * x + 0], uv1 & 0xff, (uv1 >> 16), \ - bottom_dst + (2 * x + 0) * XSTEP); \ - } \ - tl_uv = t_uv; \ - l_uv = uv; \ - } \ - if (!(len & 1)) { \ - if (top_y) { \ - const uint32_t uv0 = (3 * tl_uv + l_uv + 0x00020002u) >> 2; \ - FUNC(top_y[len - 1], uv0 & 0xff, (uv0 >> 16), \ - top_dst + (len - 1) * XSTEP); \ - } \ - if (bottom_y) { \ - const uint32_t uv0 = (3 * l_uv + tl_uv + 0x00020002u) >> 2; \ - FUNC(bottom_y[len - 1], uv0 & 0xff, (uv0 >> 16), \ - bottom_dst + (len - 1) * XSTEP); \ - } \ - } \ -} - -// All variants implemented. -UPSAMPLE_FUNC(UpsampleRgbLinePair, VP8YuvToRgb, 3) -UPSAMPLE_FUNC(UpsampleBgrLinePair, VP8YuvToBgr, 3) -UPSAMPLE_FUNC(UpsampleRgbaLinePair, VP8YuvToRgba, 4) -UPSAMPLE_FUNC(UpsampleBgraLinePair, VP8YuvToBgra, 4) -UPSAMPLE_FUNC(UpsampleArgbLinePair, VP8YuvToArgb, 4) -UPSAMPLE_FUNC(UpsampleRgba4444LinePair, VP8YuvToRgba4444, 2) -UPSAMPLE_FUNC(UpsampleRgb565LinePair, VP8YuvToRgb565, 2) - -#undef LOAD_UV -#undef UPSAMPLE_FUNC - -#endif // FANCY_UPSAMPLING - -//------------------------------------------------------------------------------ -// simple point-sampling - -#define SAMPLE_FUNC(FUNC_NAME, FUNC, XSTEP) \ -static void FUNC_NAME(const uint8_t* top_y, const uint8_t* bottom_y, \ - const uint8_t* u, const uint8_t* v, \ - uint8_t* top_dst, uint8_t* bottom_dst, int len) { \ - int i; \ - for (i = 0; i < len - 1; i += 2) { \ - FUNC(top_y[0], u[0], v[0], top_dst); \ - FUNC(top_y[1], u[0], v[0], top_dst + XSTEP); \ - FUNC(bottom_y[0], u[0], v[0], bottom_dst); \ - FUNC(bottom_y[1], u[0], v[0], bottom_dst + XSTEP); \ - top_y += 2; \ - bottom_y += 2; \ - u++; \ - v++; \ - top_dst += 2 * XSTEP; \ - bottom_dst += 2 * XSTEP; \ - } \ - if (i == len - 1) { /* last one */ \ - FUNC(top_y[0], u[0], v[0], top_dst); \ - FUNC(bottom_y[0], u[0], v[0], bottom_dst); \ - } \ -} - -// All variants implemented. -SAMPLE_FUNC(SampleRgbLinePair, VP8YuvToRgb, 3) -SAMPLE_FUNC(SampleBgrLinePair, VP8YuvToBgr, 3) -SAMPLE_FUNC(SampleRgbaLinePair, VP8YuvToRgba, 4) -SAMPLE_FUNC(SampleBgraLinePair, VP8YuvToBgra, 4) -SAMPLE_FUNC(SampleArgbLinePair, VP8YuvToArgb, 4) -SAMPLE_FUNC(SampleRgba4444LinePair, VP8YuvToRgba4444, 2) -SAMPLE_FUNC(SampleRgb565LinePair, VP8YuvToRgb565, 2) - -#undef SAMPLE_FUNC - -const WebPSampleLinePairFunc WebPSamplers[MODE_LAST] = { - SampleRgbLinePair, // MODE_RGB - SampleRgbaLinePair, // MODE_RGBA - SampleBgrLinePair, // MODE_BGR - SampleBgraLinePair, // MODE_BGRA - SampleArgbLinePair, // MODE_ARGB - SampleRgba4444LinePair, // MODE_RGBA_4444 - SampleRgb565LinePair, // MODE_RGB_565 - SampleRgbaLinePair, // MODE_rgbA - SampleBgraLinePair, // MODE_bgrA - SampleArgbLinePair, // MODE_Argb - SampleRgba4444LinePair // MODE_rgbA_4444 -}; - -//------------------------------------------------------------------------------ - -#if !defined(FANCY_UPSAMPLING) -#define DUAL_SAMPLE_FUNC(FUNC_NAME, FUNC) \ -static void FUNC_NAME(const uint8_t* top_y, const uint8_t* bot_y, \ - const uint8_t* top_u, const uint8_t* top_v, \ - const uint8_t* bot_u, const uint8_t* bot_v, \ - uint8_t* top_dst, uint8_t* bot_dst, int len) { \ - const int half_len = len >> 1; \ - int x; \ - if (top_dst != NULL) { \ - for (x = 0; x < half_len; ++x) { \ - FUNC(top_y[2 * x + 0], top_u[x], top_v[x], top_dst + 8 * x + 0); \ - FUNC(top_y[2 * x + 1], top_u[x], top_v[x], top_dst + 8 * x + 4); \ - } \ - if (len & 1) FUNC(top_y[2 * x + 0], top_u[x], top_v[x], top_dst + 8 * x); \ - } \ - if (bot_dst != NULL) { \ - for (x = 0; x < half_len; ++x) { \ - FUNC(bot_y[2 * x + 0], bot_u[x], bot_v[x], bot_dst + 8 * x + 0); \ - FUNC(bot_y[2 * x + 1], bot_u[x], bot_v[x], bot_dst + 8 * x + 4); \ - } \ - if (len & 1) FUNC(bot_y[2 * x + 0], bot_u[x], bot_v[x], bot_dst + 8 * x); \ - } \ -} - -DUAL_SAMPLE_FUNC(DualLineSamplerBGRA, VP8YuvToBgra) -DUAL_SAMPLE_FUNC(DualLineSamplerARGB, VP8YuvToArgb) -#undef DUAL_SAMPLE_FUNC - -#endif // !FANCY_UPSAMPLING - -WebPUpsampleLinePairFunc WebPGetLinePairConverter(int alpha_is_last) { - WebPInitUpsamplers(); - VP8YUVInit(); -#ifdef FANCY_UPSAMPLING - return WebPUpsamplers[alpha_is_last ? MODE_BGRA : MODE_ARGB]; -#else - return (alpha_is_last ? DualLineSamplerBGRA : DualLineSamplerARGB); -#endif -} - -//------------------------------------------------------------------------------ -// YUV444 converter - -#define YUV444_FUNC(FUNC_NAME, FUNC, XSTEP) \ -static void FUNC_NAME(const uint8_t* y, const uint8_t* u, const uint8_t* v, \ - uint8_t* dst, int len) { \ - int i; \ - for (i = 0; i < len; ++i) FUNC(y[i], u[i], v[i], &dst[i * XSTEP]); \ -} - -YUV444_FUNC(Yuv444ToRgb, VP8YuvToRgb, 3) -YUV444_FUNC(Yuv444ToBgr, VP8YuvToBgr, 3) -YUV444_FUNC(Yuv444ToRgba, VP8YuvToRgba, 4) -YUV444_FUNC(Yuv444ToBgra, VP8YuvToBgra, 4) -YUV444_FUNC(Yuv444ToArgb, VP8YuvToArgb, 4) -YUV444_FUNC(Yuv444ToRgba4444, VP8YuvToRgba4444, 2) -YUV444_FUNC(Yuv444ToRgb565, VP8YuvToRgb565, 2) - -#undef YUV444_FUNC - -const WebPYUV444Converter WebPYUV444Converters[MODE_LAST] = { - Yuv444ToRgb, // MODE_RGB - Yuv444ToRgba, // MODE_RGBA - Yuv444ToBgr, // MODE_BGR - Yuv444ToBgra, // MODE_BGRA - Yuv444ToArgb, // MODE_ARGB - Yuv444ToRgba4444, // MODE_RGBA_4444 - Yuv444ToRgb565, // MODE_RGB_565 - Yuv444ToRgba, // MODE_rgbA - Yuv444ToBgra, // MODE_bgrA - Yuv444ToArgb, // MODE_Argb - Yuv444ToRgba4444 // MODE_rgbA_4444 -}; - -//------------------------------------------------------------------------------ -// Premultiplied modes - -// non dithered-modes - -// (x * a * 32897) >> 23 is bit-wise equivalent to (int)(x * a / 255.) -// for all 8bit x or a. For bit-wise equivalence to (int)(x * a / 255. + .5), -// one can use instead: (x * a * 65793 + (1 << 23)) >> 24 -#if 1 // (int)(x * a / 255.) -#define MULTIPLIER(a) ((a) * 32897UL) -#define PREMULTIPLY(x, m) (((x) * (m)) >> 23) -#else // (int)(x * a / 255. + .5) -#define MULTIPLIER(a) ((a) * 65793UL) -#define PREMULTIPLY(x, m) (((x) * (m) + (1UL << 23)) >> 24) -#endif - -static void ApplyAlphaMultiply(uint8_t* rgba, int alpha_first, - int w, int h, int stride) { - while (h-- > 0) { - uint8_t* const rgb = rgba + (alpha_first ? 1 : 0); - const uint8_t* const alpha = rgba + (alpha_first ? 0 : 3); - int i; - for (i = 0; i < w; ++i) { - const uint32_t a = alpha[4 * i]; - if (a != 0xff) { - const uint32_t mult = MULTIPLIER(a); - rgb[4 * i + 0] = PREMULTIPLY(rgb[4 * i + 0], mult); - rgb[4 * i + 1] = PREMULTIPLY(rgb[4 * i + 1], mult); - rgb[4 * i + 2] = PREMULTIPLY(rgb[4 * i + 2], mult); - } - } - rgba += stride; - } -} -#undef MULTIPLIER -#undef PREMULTIPLY - -// rgbA4444 - -#define MULTIPLIER(a) ((a) * 0x1111) // 0x1111 ~= (1 << 16) / 15 - -static WEBP_INLINE uint8_t dither_hi(uint8_t x) { - return (x & 0xf0) | (x >> 4); -} - -static WEBP_INLINE uint8_t dither_lo(uint8_t x) { - return (x & 0x0f) | (x << 4); -} - -static WEBP_INLINE uint8_t multiply(uint8_t x, uint32_t m) { - return (x * m) >> 16; -} - -static void ApplyAlphaMultiply4444(uint8_t* rgba4444, - int w, int h, int stride) { - while (h-- > 0) { - int i; - for (i = 0; i < w; ++i) { - const uint8_t a = (rgba4444[2 * i + 1] & 0x0f); - const uint32_t mult = MULTIPLIER(a); - const uint8_t r = multiply(dither_hi(rgba4444[2 * i + 0]), mult); - const uint8_t g = multiply(dither_lo(rgba4444[2 * i + 0]), mult); - const uint8_t b = multiply(dither_hi(rgba4444[2 * i + 1]), mult); - rgba4444[2 * i + 0] = (r & 0xf0) | ((g >> 4) & 0x0f); - rgba4444[2 * i + 1] = (b & 0xf0) | a; - } - rgba4444 += stride; - } -} -#undef MULTIPLIER - -void (*WebPApplyAlphaMultiply)(uint8_t*, int, int, int, int) - = ApplyAlphaMultiply; -void (*WebPApplyAlphaMultiply4444)(uint8_t*, int, int, int) - = ApplyAlphaMultiply4444; - -//------------------------------------------------------------------------------ -// Main call - -void WebPInitUpsamplers(void) { -#ifdef FANCY_UPSAMPLING - WebPUpsamplers[MODE_RGB] = UpsampleRgbLinePair; - WebPUpsamplers[MODE_RGBA] = UpsampleRgbaLinePair; - WebPUpsamplers[MODE_BGR] = UpsampleBgrLinePair; - WebPUpsamplers[MODE_BGRA] = UpsampleBgraLinePair; - WebPUpsamplers[MODE_ARGB] = UpsampleArgbLinePair; - WebPUpsamplers[MODE_RGBA_4444] = UpsampleRgba4444LinePair; - WebPUpsamplers[MODE_RGB_565] = UpsampleRgb565LinePair; - - // If defined, use CPUInfo() to overwrite some pointers with faster versions. - if (VP8GetCPUInfo != NULL) { -#if defined(WEBP_USE_SSE2) - if (VP8GetCPUInfo(kSSE2)) { - WebPInitUpsamplersSSE2(); - } -#endif - } -#endif // FANCY_UPSAMPLING -} - -void WebPInitPremultiply(void) { - WebPApplyAlphaMultiply = ApplyAlphaMultiply; - WebPApplyAlphaMultiply4444 = ApplyAlphaMultiply4444; - -#ifdef FANCY_UPSAMPLING - WebPUpsamplers[MODE_rgbA] = UpsampleRgbaLinePair; - WebPUpsamplers[MODE_bgrA] = UpsampleBgraLinePair; - WebPUpsamplers[MODE_Argb] = UpsampleArgbLinePair; - WebPUpsamplers[MODE_rgbA_4444] = UpsampleRgba4444LinePair; - - if (VP8GetCPUInfo != NULL) { -#if defined(WEBP_USE_SSE2) - if (VP8GetCPUInfo(kSSE2)) { - WebPInitPremultiplySSE2(); - } -#endif - } -#endif // FANCY_UPSAMPLING -} - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif diff --git a/external/libwebp/dsp/upsampling_sse2.c b/external/libwebp/dsp/upsampling_sse2.c deleted file mode 100644 index 500760546b..0000000000 --- a/external/libwebp/dsp/upsampling_sse2.c +++ /dev/null @@ -1,215 +0,0 @@ -// Copyright 2011 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// SSE2 version of YUV to RGB upsampling functions. -// -// Author: somnath@google.com (Somnath Banerjee) - -#include "./dsp.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -#if defined(WEBP_USE_SSE2) - -#include <assert.h> -#include <emmintrin.h> -#include <string.h> -#include "./yuv.h" - -#ifdef FANCY_UPSAMPLING - -// We compute (9*a + 3*b + 3*c + d + 8) / 16 as follows -// u = (9*a + 3*b + 3*c + d + 8) / 16 -// = (a + (a + 3*b + 3*c + d) / 8 + 1) / 2 -// = (a + m + 1) / 2 -// where m = (a + 3*b + 3*c + d) / 8 -// = ((a + b + c + d) / 2 + b + c) / 4 -// -// Let's say k = (a + b + c + d) / 4. -// We can compute k as -// k = (s + t + 1) / 2 - ((a^d) | (b^c) | (s^t)) & 1 -// where s = (a + d + 1) / 2 and t = (b + c + 1) / 2 -// -// Then m can be written as -// m = (k + t + 1) / 2 - (((b^c) & (s^t)) | (k^t)) & 1 - -// Computes out = (k + in + 1) / 2 - ((ij & (s^t)) | (k^in)) & 1 -#define GET_M(ij, in, out) do { \ - const __m128i tmp0 = _mm_avg_epu8(k, (in)); /* (k + in + 1) / 2 */ \ - const __m128i tmp1 = _mm_and_si128((ij), st); /* (ij) & (s^t) */ \ - const __m128i tmp2 = _mm_xor_si128(k, (in)); /* (k^in) */ \ - const __m128i tmp3 = _mm_or_si128(tmp1, tmp2); /* ((ij) & (s^t)) | (k^in) */\ - const __m128i tmp4 = _mm_and_si128(tmp3, one); /* & 1 -> lsb_correction */ \ - (out) = _mm_sub_epi8(tmp0, tmp4); /* (k + in + 1) / 2 - lsb_correction */ \ -} while (0) - -// pack and store two alterning pixel rows -#define PACK_AND_STORE(a, b, da, db, out) do { \ - const __m128i ta = _mm_avg_epu8(a, da); /* (9a + 3b + 3c + d + 8) / 16 */ \ - const __m128i tb = _mm_avg_epu8(b, db); /* (3a + 9b + c + 3d + 8) / 16 */ \ - const __m128i t1 = _mm_unpacklo_epi8(ta, tb); \ - const __m128i t2 = _mm_unpackhi_epi8(ta, tb); \ - _mm_store_si128(((__m128i*)(out)) + 0, t1); \ - _mm_store_si128(((__m128i*)(out)) + 1, t2); \ -} while (0) - -// Loads 17 pixels each from rows r1 and r2 and generates 32 pixels. -#define UPSAMPLE_32PIXELS(r1, r2, out) { \ - const __m128i one = _mm_set1_epi8(1); \ - const __m128i a = _mm_loadu_si128((__m128i*)&(r1)[0]); \ - const __m128i b = _mm_loadu_si128((__m128i*)&(r1)[1]); \ - const __m128i c = _mm_loadu_si128((__m128i*)&(r2)[0]); \ - const __m128i d = _mm_loadu_si128((__m128i*)&(r2)[1]); \ - \ - const __m128i s = _mm_avg_epu8(a, d); /* s = (a + d + 1) / 2 */ \ - const __m128i t = _mm_avg_epu8(b, c); /* t = (b + c + 1) / 2 */ \ - const __m128i st = _mm_xor_si128(s, t); /* st = s^t */ \ - \ - const __m128i ad = _mm_xor_si128(a, d); /* ad = a^d */ \ - const __m128i bc = _mm_xor_si128(b, c); /* bc = b^c */ \ - \ - const __m128i t1 = _mm_or_si128(ad, bc); /* (a^d) | (b^c) */ \ - const __m128i t2 = _mm_or_si128(t1, st); /* (a^d) | (b^c) | (s^t) */ \ - const __m128i t3 = _mm_and_si128(t2, one); /* (a^d) | (b^c) | (s^t) & 1 */ \ - const __m128i t4 = _mm_avg_epu8(s, t); \ - const __m128i k = _mm_sub_epi8(t4, t3); /* k = (a + b + c + d) / 4 */ \ - __m128i diag1, diag2; \ - \ - GET_M(bc, t, diag1); /* diag1 = (a + 3b + 3c + d) / 8 */ \ - GET_M(ad, s, diag2); /* diag2 = (3a + b + c + 3d) / 8 */ \ - \ - /* pack the alternate pixels */ \ - PACK_AND_STORE(a, b, diag1, diag2, &(out)[0 * 32]); \ - PACK_AND_STORE(c, d, diag2, diag1, &(out)[2 * 32]); \ -} - -// Turn the macro into a function for reducing code-size when non-critical -static void Upsample32Pixels(const uint8_t r1[], const uint8_t r2[], - uint8_t* const out) { - UPSAMPLE_32PIXELS(r1, r2, out); -} - -#define UPSAMPLE_LAST_BLOCK(tb, bb, num_pixels, out) { \ - uint8_t r1[17], r2[17]; \ - memcpy(r1, (tb), (num_pixels)); \ - memcpy(r2, (bb), (num_pixels)); \ - /* replicate last byte */ \ - memset(r1 + (num_pixels), r1[(num_pixels) - 1], 17 - (num_pixels)); \ - memset(r2 + (num_pixels), r2[(num_pixels) - 1], 17 - (num_pixels)); \ - /* using the shared function instead of the macro saves ~3k code size */ \ - Upsample32Pixels(r1, r2, out); \ -} - -#define CONVERT2RGB(FUNC, XSTEP, top_y, bottom_y, uv, \ - top_dst, bottom_dst, cur_x, num_pixels) { \ - int n; \ - if (top_y) { \ - for (n = 0; n < (num_pixels); ++n) { \ - FUNC(top_y[(cur_x) + n], (uv)[n], (uv)[32 + n], \ - top_dst + ((cur_x) + n) * XSTEP); \ - } \ - } \ - if (bottom_y) { \ - for (n = 0; n < (num_pixels); ++n) { \ - FUNC(bottom_y[(cur_x) + n], (uv)[64 + n], (uv)[64 + 32 + n], \ - bottom_dst + ((cur_x) + n) * XSTEP); \ - } \ - } \ -} - -#define SSE2_UPSAMPLE_FUNC(FUNC_NAME, FUNC, XSTEP) \ -static void FUNC_NAME(const uint8_t* top_y, const uint8_t* bottom_y, \ - const uint8_t* top_u, const uint8_t* top_v, \ - const uint8_t* cur_u, const uint8_t* cur_v, \ - uint8_t* top_dst, uint8_t* bottom_dst, int len) { \ - int b; \ - /* 16 byte aligned array to cache reconstructed u and v */ \ - uint8_t uv_buf[4 * 32 + 15]; \ - uint8_t* const r_uv = (uint8_t*)((uintptr_t)(uv_buf + 15) & ~15); \ - const int uv_len = (len + 1) >> 1; \ - /* 17 pixels must be read-able for each block */ \ - const int num_blocks = (uv_len - 1) >> 4; \ - const int leftover = uv_len - num_blocks * 16; \ - const int last_pos = 1 + 32 * num_blocks; \ - \ - const int u_diag = ((top_u[0] + cur_u[0]) >> 1) + 1; \ - const int v_diag = ((top_v[0] + cur_v[0]) >> 1) + 1; \ - \ - assert(len > 0); \ - /* Treat the first pixel in regular way */ \ - if (top_y) { \ - const int u0 = (top_u[0] + u_diag) >> 1; \ - const int v0 = (top_v[0] + v_diag) >> 1; \ - FUNC(top_y[0], u0, v0, top_dst); \ - } \ - if (bottom_y) { \ - const int u0 = (cur_u[0] + u_diag) >> 1; \ - const int v0 = (cur_v[0] + v_diag) >> 1; \ - FUNC(bottom_y[0], u0, v0, bottom_dst); \ - } \ - \ - for (b = 0; b < num_blocks; ++b) { \ - UPSAMPLE_32PIXELS(top_u, cur_u, r_uv + 0 * 32); \ - UPSAMPLE_32PIXELS(top_v, cur_v, r_uv + 1 * 32); \ - CONVERT2RGB(FUNC, XSTEP, top_y, bottom_y, r_uv, top_dst, bottom_dst, \ - 32 * b + 1, 32) \ - top_u += 16; \ - cur_u += 16; \ - top_v += 16; \ - cur_v += 16; \ - } \ - \ - UPSAMPLE_LAST_BLOCK(top_u, cur_u, leftover, r_uv + 0 * 32); \ - UPSAMPLE_LAST_BLOCK(top_v, cur_v, leftover, r_uv + 1 * 32); \ - CONVERT2RGB(FUNC, XSTEP, top_y, bottom_y, r_uv, top_dst, bottom_dst, \ - last_pos, len - last_pos); \ -} - -// SSE2 variants of the fancy upsampler. -SSE2_UPSAMPLE_FUNC(UpsampleRgbLinePairSSE2, VP8YuvToRgb, 3) -SSE2_UPSAMPLE_FUNC(UpsampleBgrLinePairSSE2, VP8YuvToBgr, 3) -SSE2_UPSAMPLE_FUNC(UpsampleRgbaLinePairSSE2, VP8YuvToRgba, 4) -SSE2_UPSAMPLE_FUNC(UpsampleBgraLinePairSSE2, VP8YuvToBgra, 4) - -#undef GET_M -#undef PACK_AND_STORE -#undef UPSAMPLE_32PIXELS -#undef UPSAMPLE_LAST_BLOCK -#undef CONVERT2RGB -#undef SSE2_UPSAMPLE_FUNC - -#endif // FANCY_UPSAMPLING - -#endif // WEBP_USE_SSE2 - -//------------------------------------------------------------------------------ - -extern WebPUpsampleLinePairFunc WebPUpsamplers[/* MODE_LAST */]; - -void WebPInitUpsamplersSSE2(void) { -#if defined(WEBP_USE_SSE2) - WebPUpsamplers[MODE_RGB] = UpsampleRgbLinePairSSE2; - WebPUpsamplers[MODE_RGBA] = UpsampleRgbaLinePairSSE2; - WebPUpsamplers[MODE_BGR] = UpsampleBgrLinePairSSE2; - WebPUpsamplers[MODE_BGRA] = UpsampleBgraLinePairSSE2; -#endif // WEBP_USE_SSE2 -} - -void WebPInitPremultiplySSE2(void) { -#if defined(WEBP_USE_SSE2) - WebPUpsamplers[MODE_rgbA] = UpsampleRgbaLinePairSSE2; - WebPUpsamplers[MODE_bgrA] = UpsampleBgraLinePairSSE2; -#endif // WEBP_USE_SSE2 -} - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif - - diff --git a/external/libwebp/dsp/yuv.c b/external/libwebp/dsp/yuv.c deleted file mode 100644 index 7f05f9a3aa..0000000000 --- a/external/libwebp/dsp/yuv.c +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2010 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// YUV->RGB conversion function -// -// Author: Skal (pascal.massimino@gmail.com) - -#include "./yuv.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -enum { YUV_HALF = 1 << (YUV_FIX - 1) }; - -int16_t VP8kVToR[256], VP8kUToB[256]; -int32_t VP8kVToG[256], VP8kUToG[256]; -uint8_t VP8kClip[YUV_RANGE_MAX - YUV_RANGE_MIN]; -uint8_t VP8kClip4Bits[YUV_RANGE_MAX - YUV_RANGE_MIN]; - -static int done = 0; - -static WEBP_INLINE uint8_t clip(int v, int max_value) { - return v < 0 ? 0 : v > max_value ? max_value : v; -} - -void VP8YUVInit(void) { - int i; - if (done) { - return; - } - for (i = 0; i < 256; ++i) { - VP8kVToR[i] = (89858 * (i - 128) + YUV_HALF) >> YUV_FIX; - VP8kUToG[i] = -22014 * (i - 128) + YUV_HALF; - VP8kVToG[i] = -45773 * (i - 128); - VP8kUToB[i] = (113618 * (i - 128) + YUV_HALF) >> YUV_FIX; - } - for (i = YUV_RANGE_MIN; i < YUV_RANGE_MAX; ++i) { - const int k = ((i - 16) * 76283 + YUV_HALF) >> YUV_FIX; - VP8kClip[i - YUV_RANGE_MIN] = clip(k, 255); - VP8kClip4Bits[i - YUV_RANGE_MIN] = clip((k + 8) >> 4, 15); - } - done = 1; -} - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif diff --git a/external/libwebp/dsp/yuv.h b/external/libwebp/dsp/yuv.h deleted file mode 100644 index a569109c54..0000000000 --- a/external/libwebp/dsp/yuv.h +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright 2010 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// inline YUV<->RGB conversion function -// -// Author: Skal (pascal.massimino@gmail.com) - -#ifndef WEBP_DSP_YUV_H_ -#define WEBP_DSP_YUV_H_ - -#include "../dec/decode_vp8.h" - -//------------------------------------------------------------------------------ -// YUV -> RGB conversion - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -enum { YUV_FIX = 16, // fixed-point precision - YUV_RANGE_MIN = -227, // min value of r/g/b output - YUV_RANGE_MAX = 256 + 226 // max value of r/g/b output -}; -extern int16_t VP8kVToR[256], VP8kUToB[256]; -extern int32_t VP8kVToG[256], VP8kUToG[256]; -extern uint8_t VP8kClip[YUV_RANGE_MAX - YUV_RANGE_MIN]; -extern uint8_t VP8kClip4Bits[YUV_RANGE_MAX - YUV_RANGE_MIN]; - -static WEBP_INLINE void VP8YuvToRgb(uint8_t y, uint8_t u, uint8_t v, - uint8_t* const rgb) { - const int r_off = VP8kVToR[v]; - const int g_off = (VP8kVToG[v] + VP8kUToG[u]) >> YUV_FIX; - const int b_off = VP8kUToB[u]; - rgb[0] = VP8kClip[y + r_off - YUV_RANGE_MIN]; - rgb[1] = VP8kClip[y + g_off - YUV_RANGE_MIN]; - rgb[2] = VP8kClip[y + b_off - YUV_RANGE_MIN]; -} - -static WEBP_INLINE void VP8YuvToRgb565(uint8_t y, uint8_t u, uint8_t v, - uint8_t* const rgb) { - const int r_off = VP8kVToR[v]; - const int g_off = (VP8kVToG[v] + VP8kUToG[u]) >> YUV_FIX; - const int b_off = VP8kUToB[u]; - rgb[0] = ((VP8kClip[y + r_off - YUV_RANGE_MIN] & 0xf8) | - (VP8kClip[y + g_off - YUV_RANGE_MIN] >> 5)); - rgb[1] = (((VP8kClip[y + g_off - YUV_RANGE_MIN] << 3) & 0xe0) | - (VP8kClip[y + b_off - YUV_RANGE_MIN] >> 3)); -} - -static WEBP_INLINE void VP8YuvToArgb(uint8_t y, uint8_t u, uint8_t v, - uint8_t* const argb) { - argb[0] = 0xff; - VP8YuvToRgb(y, u, v, argb + 1); -} - -static WEBP_INLINE void VP8YuvToRgba4444(uint8_t y, uint8_t u, uint8_t v, - uint8_t* const argb) { - const int r_off = VP8kVToR[v]; - const int g_off = (VP8kVToG[v] + VP8kUToG[u]) >> YUV_FIX; - const int b_off = VP8kUToB[u]; - // Don't update alpha (last 4 bits of argb[1]) - argb[0] = ((VP8kClip4Bits[y + r_off - YUV_RANGE_MIN] << 4) | - VP8kClip4Bits[y + g_off - YUV_RANGE_MIN]); - argb[1] = 0x0f | (VP8kClip4Bits[y + b_off - YUV_RANGE_MIN] << 4); -} - -static WEBP_INLINE void VP8YuvToBgr(uint8_t y, uint8_t u, uint8_t v, - uint8_t* const bgr) { - const int r_off = VP8kVToR[v]; - const int g_off = (VP8kVToG[v] + VP8kUToG[u]) >> YUV_FIX; - const int b_off = VP8kUToB[u]; - bgr[0] = VP8kClip[y + b_off - YUV_RANGE_MIN]; - bgr[1] = VP8kClip[y + g_off - YUV_RANGE_MIN]; - bgr[2] = VP8kClip[y + r_off - YUV_RANGE_MIN]; -} - -static WEBP_INLINE void VP8YuvToBgra(uint8_t y, uint8_t u, uint8_t v, - uint8_t* const bgra) { - VP8YuvToBgr(y, u, v, bgra); - bgra[3] = 0xff; -} - -static WEBP_INLINE void VP8YuvToRgba(uint8_t y, uint8_t u, uint8_t v, - uint8_t* const rgba) { - VP8YuvToRgb(y, u, v, rgba); - rgba[3] = 0xff; -} - -// Must be called before everything, to initialize the tables. -void VP8YUVInit(void); - -//------------------------------------------------------------------------------ -// RGB -> YUV conversion -// The exact naming is Y'CbCr, following the ITU-R BT.601 standard. -// More information at: http://en.wikipedia.org/wiki/YCbCr -// Y = 0.2569 * R + 0.5044 * G + 0.0979 * B + 16 -// U = -0.1483 * R - 0.2911 * G + 0.4394 * B + 128 -// V = 0.4394 * R - 0.3679 * G - 0.0715 * B + 128 -// We use 16bit fixed point operations. - -static WEBP_INLINE int VP8ClipUV(int v) { - v = (v + (257 << (YUV_FIX + 2 - 1))) >> (YUV_FIX + 2); - return ((v & ~0xff) == 0) ? v : (v < 0) ? 0 : 255; -} - -static WEBP_INLINE int VP8RGBToY(int r, int g, int b) { - const int kRound = (1 << (YUV_FIX - 1)) + (16 << YUV_FIX); - const int luma = 16839 * r + 33059 * g + 6420 * b; - return (luma + kRound) >> YUV_FIX; // no need to clip -} - -static WEBP_INLINE int VP8RGBToU(int r, int g, int b) { - return VP8ClipUV(-9719 * r - 19081 * g + 28800 * b); -} - -static WEBP_INLINE int VP8RGBToV(int r, int g, int b) { - return VP8ClipUV(+28800 * r - 24116 * g - 4684 * b); -} - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif - -#endif /* WEBP_DSP_YUV_H_ */ diff --git a/external/libwebp/enc/Makefile.am b/external/libwebp/enc/Makefile.am deleted file mode 100644 index 26698d2efa..0000000000 --- a/external/libwebp/enc/Makefile.am +++ /dev/null @@ -1,32 +0,0 @@ -AM_CPPFLAGS = -I$(top_srcdir)/src -noinst_LTLIBRARIES = libwebpencode.la - -libwebpencode_la_SOURCES = -libwebpencode_la_SOURCES += alpha.c -libwebpencode_la_SOURCES += analysis.c -libwebpencode_la_SOURCES += backward_references.c -libwebpencode_la_SOURCES += config.c -libwebpencode_la_SOURCES += cost.c -libwebpencode_la_SOURCES += cost.h -libwebpencode_la_SOURCES += filter.c -libwebpencode_la_SOURCES += frame.c -libwebpencode_la_SOURCES += histogram.c -libwebpencode_la_SOURCES += iterator.c -libwebpencode_la_SOURCES += layer.c -libwebpencode_la_SOURCES += picture.c -libwebpencode_la_SOURCES += quant.c -libwebpencode_la_SOURCES += syntax.c -libwebpencode_la_SOURCES += tree.c -libwebpencode_la_SOURCES += vp8enci.h -libwebpencode_la_SOURCES += vp8l.c -libwebpencode_la_SOURCES += webpenc.c - -libwebpencodeinclude_HEADERS = -libwebpencodeinclude_HEADERS += ../webp/encode.h -libwebpencodeinclude_HEADERS += ../webp/types.h -noinst_HEADERS = -noinst_HEADERS += ../webp/format_constants.h - -libwebpencode_la_LDFLAGS = -lm -libwebpencode_la_CPPFLAGS = $(USE_EXPERIMENTAL_CODE) -libwebpencodeincludedir = $(includedir)/webp diff --git a/external/libwebp/enc/alpha.c b/external/libwebp/enc/alpha.c deleted file mode 100644 index 0e519b6c66..0000000000 --- a/external/libwebp/enc/alpha.c +++ /dev/null @@ -1,330 +0,0 @@ -// Copyright 2011 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Alpha-plane compression. -// -// Author: Skal (pascal.massimino@gmail.com) - -#include <assert.h> -#include <stdlib.h> - -#include "./vp8enci.h" -#include "../utils/filters.h" -#include "../utils/quant_levels.h" -#include "../webp/format_constants.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -// ----------------------------------------------------------------------------- -// Encodes the given alpha data via specified compression method 'method'. -// The pre-processing (quantization) is performed if 'quality' is less than 100. -// For such cases, the encoding is lossy. The valid range is [0, 100] for -// 'quality' and [0, 1] for 'method': -// 'method = 0' - No compression; -// 'method = 1' - Use lossless coder on the alpha plane only -// 'filter' values [0, 4] correspond to prediction modes none, horizontal, -// vertical & gradient filters. The prediction mode 4 will try all the -// prediction modes 0 to 3 and pick the best one. -// 'effort_level': specifies how much effort must be spent to try and reduce -// the compressed output size. In range 0 (quick) to 6 (slow). -// -// 'output' corresponds to the buffer containing compressed alpha data. -// This buffer is allocated by this method and caller should call -// free(*output) when done. -// 'output_size' corresponds to size of this compressed alpha buffer. -// -// Returns 1 on successfully encoding the alpha and -// 0 if either: -// invalid quality or method, or -// memory allocation for the compressed data fails. - -#include "../enc/vp8li.h" - -static int EncodeLossless(const uint8_t* const data, int width, int height, - int effort_level, // in [0..6] range - VP8BitWriter* const bw, - WebPAuxStats* const stats) { - int ok = 0; - WebPConfig config; - WebPPicture picture; - VP8LBitWriter tmp_bw; - - WebPPictureInit(&picture); - picture.width = width; - picture.height = height; - picture.use_argb = 1; - picture.stats = stats; - if (!WebPPictureAlloc(&picture)) return 0; - - // Transfer the alpha values to the green channel. - { - int i, j; - uint32_t* dst = picture.argb; - const uint8_t* src = data; - for (j = 0; j < picture.height; ++j) { - for (i = 0; i < picture.width; ++i) { - dst[i] = (src[i] << 8) | 0xff000000u; - } - src += width; - dst += picture.argb_stride; - } - } - - WebPConfigInit(&config); - config.lossless = 1; - config.method = effort_level; // impact is very small - // Set moderate default quality setting for alpha. Higher qualities (80 and - // above) could be very slow. - config.quality = 10.f + 15.f * effort_level; - if (config.quality > 100.f) config.quality = 100.f; - - ok = VP8LBitWriterInit(&tmp_bw, (width * height) >> 3); - ok = ok && (VP8LEncodeStream(&config, &picture, &tmp_bw) == VP8_ENC_OK); - WebPPictureFree(&picture); - if (ok) { - const uint8_t* const data = VP8LBitWriterFinish(&tmp_bw); - const size_t data_size = VP8LBitWriterNumBytes(&tmp_bw); - VP8BitWriterAppend(bw, data, data_size); - } - VP8LBitWriterDestroy(&tmp_bw); - return ok && !bw->error_; -} - -// ----------------------------------------------------------------------------- - -static int EncodeAlphaInternal(const uint8_t* const data, int width, int height, - int method, int filter, int reduce_levels, - int effort_level, // in [0..6] range - uint8_t* const tmp_alpha, - VP8BitWriter* const bw, - WebPAuxStats* const stats) { - int ok = 0; - const uint8_t* alpha_src; - WebPFilterFunc filter_func; - uint8_t header; - size_t expected_size; - const size_t data_size = width * height; - - assert((uint64_t)data_size == (uint64_t)width * height); // as per spec - assert(filter >= 0 && filter < WEBP_FILTER_LAST); - assert(method >= ALPHA_NO_COMPRESSION); - assert(method <= ALPHA_LOSSLESS_COMPRESSION); - assert(sizeof(header) == ALPHA_HEADER_LEN); - // TODO(skal): have a common function and #define's to validate alpha params. - - expected_size = - (method == ALPHA_NO_COMPRESSION) ? (ALPHA_HEADER_LEN + data_size) - : (data_size >> 5); - header = method | (filter << 2); - if (reduce_levels) header |= ALPHA_PREPROCESSED_LEVELS << 4; - - VP8BitWriterInit(bw, expected_size); - VP8BitWriterAppend(bw, &header, ALPHA_HEADER_LEN); - - filter_func = WebPFilters[filter]; - if (filter_func) { - filter_func(data, width, height, 1, width, tmp_alpha); - alpha_src = tmp_alpha; - } else { - alpha_src = data; - } - - if (method == ALPHA_NO_COMPRESSION) { - ok = VP8BitWriterAppend(bw, alpha_src, width * height); - ok = ok && !bw->error_; - } else { - ok = EncodeLossless(alpha_src, width, height, effort_level, bw, stats); - VP8BitWriterFinish(bw); - } - return ok; -} - -// ----------------------------------------------------------------------------- - -// TODO(skal): move to dsp/ ? -static void CopyPlane(const uint8_t* src, int src_stride, - uint8_t* dst, int dst_stride, int width, int height) { - while (height-- > 0) { - memcpy(dst, src, width); - src += src_stride; - dst += dst_stride; - } -} - -static int EncodeAlpha(VP8Encoder* const enc, - int quality, int method, int filter, - int effort_level, - uint8_t** const output, size_t* const output_size) { - const WebPPicture* const pic = enc->pic_; - const int width = pic->width; - const int height = pic->height; - - uint8_t* quant_alpha = NULL; - const size_t data_size = width * height; - uint64_t sse = 0; - int ok = 1; - const int reduce_levels = (quality < 100); - - // quick sanity checks - assert((uint64_t)data_size == (uint64_t)width * height); // as per spec - assert(enc != NULL && pic != NULL && pic->a != NULL); - assert(output != NULL && output_size != NULL); - assert(width > 0 && height > 0); - assert(pic->a_stride >= width); - assert(filter >= WEBP_FILTER_NONE && filter <= WEBP_FILTER_FAST); - - if (quality < 0 || quality > 100) { - return 0; - } - - if (method < ALPHA_NO_COMPRESSION || method > ALPHA_LOSSLESS_COMPRESSION) { - return 0; - } - - quant_alpha = (uint8_t*)malloc(data_size); - if (quant_alpha == NULL) { - return 0; - } - - // Extract alpha data (width x height) from raw_data (stride x height). - CopyPlane(pic->a, pic->a_stride, quant_alpha, width, width, height); - - if (reduce_levels) { // No Quantization required for 'quality = 100'. - // 16 alpha levels gives quite a low MSE w.r.t original alpha plane hence - // mapped to moderate quality 70. Hence Quality:[0, 70] -> Levels:[2, 16] - // and Quality:]70, 100] -> Levels:]16, 256]. - const int alpha_levels = (quality <= 70) ? (2 + quality / 5) - : (16 + (quality - 70) * 8); - ok = QuantizeLevels(quant_alpha, width, height, alpha_levels, &sse); - } - - if (ok) { - VP8BitWriter bw; - int test_filter; - uint8_t* filtered_alpha = NULL; - - // We always test WEBP_FILTER_NONE first. - ok = EncodeAlphaInternal(quant_alpha, width, height, - method, WEBP_FILTER_NONE, reduce_levels, - effort_level, NULL, &bw, pic->stats); - if (!ok) { - VP8BitWriterWipeOut(&bw); - goto End; - } - - if (filter == WEBP_FILTER_FAST) { // Quick estimate of a second candidate? - filter = EstimateBestFilter(quant_alpha, width, height, width); - } - // Stop? - if (filter == WEBP_FILTER_NONE) { - goto Ok; - } - - filtered_alpha = (uint8_t*)malloc(data_size); - ok = (filtered_alpha != NULL); - if (!ok) { - goto End; - } - - // Try the other mode(s). - { - WebPAuxStats best_stats; - size_t best_score = VP8BitWriterSize(&bw); - - memset(&best_stats, 0, sizeof(best_stats)); // prevent spurious warning - if (pic->stats != NULL) best_stats = *pic->stats; - for (test_filter = WEBP_FILTER_HORIZONTAL; - ok && (test_filter <= WEBP_FILTER_GRADIENT); - ++test_filter) { - VP8BitWriter tmp_bw; - if (filter != WEBP_FILTER_BEST && test_filter != filter) { - continue; - } - ok = EncodeAlphaInternal(quant_alpha, width, height, - method, test_filter, reduce_levels, - effort_level, filtered_alpha, &tmp_bw, - pic->stats); - if (ok) { - const size_t score = VP8BitWriterSize(&tmp_bw); - if (score < best_score) { - // swap bitwriter objects. - VP8BitWriter tmp = tmp_bw; - tmp_bw = bw; - bw = tmp; - best_score = score; - if (pic->stats != NULL) best_stats = *pic->stats; - } - } else { - VP8BitWriterWipeOut(&bw); - } - VP8BitWriterWipeOut(&tmp_bw); - } - if (pic->stats != NULL) *pic->stats = best_stats; - } - Ok: - if (ok) { - *output_size = VP8BitWriterSize(&bw); - *output = VP8BitWriterBuf(&bw); - if (pic->stats != NULL) { // need stats? - pic->stats->coded_size += (int)(*output_size); - enc->sse_[3] = sse; - } - } - free(filtered_alpha); - } - End: - free(quant_alpha); - return ok; -} - - -//------------------------------------------------------------------------------ -// Main calls - -void VP8EncInitAlpha(VP8Encoder* const enc) { - enc->has_alpha_ = WebPPictureHasTransparency(enc->pic_); - enc->alpha_data_ = NULL; - enc->alpha_data_size_ = 0; -} - -int VP8EncFinishAlpha(VP8Encoder* const enc) { - if (enc->has_alpha_) { - const WebPConfig* config = enc->config_; - uint8_t* tmp_data = NULL; - size_t tmp_size = 0; - const int effort_level = config->method; // maps to [0..6] - const WEBP_FILTER_TYPE filter = - (config->alpha_filtering == 0) ? WEBP_FILTER_NONE : - (config->alpha_filtering == 1) ? WEBP_FILTER_FAST : - WEBP_FILTER_BEST; - - if (!EncodeAlpha(enc, config->alpha_quality, config->alpha_compression, - filter, effort_level, &tmp_data, &tmp_size)) { - return 0; - } - if (tmp_size != (uint32_t)tmp_size) { // Sanity check. - free(tmp_data); - return 0; - } - enc->alpha_data_size_ = (uint32_t)tmp_size; - enc->alpha_data_ = tmp_data; - } - return WebPReportProgress(enc->pic_, enc->percent_ + 20, &enc->percent_); -} - -void VP8EncDeleteAlpha(VP8Encoder* const enc) { - free(enc->alpha_data_); - enc->alpha_data_ = NULL; - enc->alpha_data_size_ = 0; - enc->has_alpha_ = 0; -} - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif diff --git a/external/libwebp/enc/analysis.c b/external/libwebp/enc/analysis.c deleted file mode 100644 index 22cfb492e7..0000000000 --- a/external/libwebp/enc/analysis.c +++ /dev/null @@ -1,364 +0,0 @@ -// Copyright 2011 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Macroblock analysis -// -// Author: Skal (pascal.massimino@gmail.com) - -#include <stdlib.h> -#include <string.h> -#include <assert.h> - -#include "./vp8enci.h" -#include "./cost.h" -#include "../utils/utils.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -#define MAX_ITERS_K_MEANS 6 - -static int ClipAlpha(int alpha) { - return alpha < 0 ? 0 : alpha > 255 ? 255 : alpha; -} - -//------------------------------------------------------------------------------ -// Smooth the segment map by replacing isolated block by the majority of its -// neighbours. - -static void SmoothSegmentMap(VP8Encoder* const enc) { - int n, x, y; - const int w = enc->mb_w_; - const int h = enc->mb_h_; - const int majority_cnt_3_x_3_grid = 5; - uint8_t* const tmp = (uint8_t*)WebPSafeMalloc((uint64_t)w * h, sizeof(*tmp)); - assert((uint64_t)(w * h) == (uint64_t)w * h); // no overflow, as per spec - - if (tmp == NULL) return; - for (y = 1; y < h - 1; ++y) { - for (x = 1; x < w - 1; ++x) { - int cnt[NUM_MB_SEGMENTS] = { 0 }; - const VP8MBInfo* const mb = &enc->mb_info_[x + w * y]; - int majority_seg = mb->segment_; - // Check the 8 neighbouring segment values. - cnt[mb[-w - 1].segment_]++; // top-left - cnt[mb[-w + 0].segment_]++; // top - cnt[mb[-w + 1].segment_]++; // top-right - cnt[mb[ - 1].segment_]++; // left - cnt[mb[ + 1].segment_]++; // right - cnt[mb[ w - 1].segment_]++; // bottom-left - cnt[mb[ w + 0].segment_]++; // bottom - cnt[mb[ w + 1].segment_]++; // bottom-right - for (n = 0; n < NUM_MB_SEGMENTS; ++n) { - if (cnt[n] >= majority_cnt_3_x_3_grid) { - majority_seg = n; - } - } - tmp[x + y * w] = majority_seg; - } - } - for (y = 1; y < h - 1; ++y) { - for (x = 1; x < w - 1; ++x) { - VP8MBInfo* const mb = &enc->mb_info_[x + w * y]; - mb->segment_ = tmp[x + y * w]; - } - } - free(tmp); -} - -//------------------------------------------------------------------------------ -// Finalize Segment probability based on the coding tree - -static int GetProba(int a, int b) { - int proba; - const int total = a + b; - if (total == 0) return 255; // that's the default probability. - proba = (255 * a + total / 2) / total; - return proba; -} - -static void SetSegmentProbas(VP8Encoder* const enc) { - int p[NUM_MB_SEGMENTS] = { 0 }; - int n; - - for (n = 0; n < enc->mb_w_ * enc->mb_h_; ++n) { - const VP8MBInfo* const mb = &enc->mb_info_[n]; - p[mb->segment_]++; - } - if (enc->pic_->stats) { - for (n = 0; n < NUM_MB_SEGMENTS; ++n) { - enc->pic_->stats->segment_size[n] = p[n]; - } - } - if (enc->segment_hdr_.num_segments_ > 1) { - uint8_t* const probas = enc->proba_.segments_; - probas[0] = GetProba(p[0] + p[1], p[2] + p[3]); - probas[1] = GetProba(p[0], p[1]); - probas[2] = GetProba(p[2], p[3]); - - enc->segment_hdr_.update_map_ = - (probas[0] != 255) || (probas[1] != 255) || (probas[2] != 255); - enc->segment_hdr_.size_ = - p[0] * (VP8BitCost(0, probas[0]) + VP8BitCost(0, probas[1])) + - p[1] * (VP8BitCost(0, probas[0]) + VP8BitCost(1, probas[1])) + - p[2] * (VP8BitCost(1, probas[0]) + VP8BitCost(0, probas[2])) + - p[3] * (VP8BitCost(1, probas[0]) + VP8BitCost(1, probas[2])); - } else { - enc->segment_hdr_.update_map_ = 0; - enc->segment_hdr_.size_ = 0; - } -} - -static WEBP_INLINE int clip(int v, int m, int M) { - return v < m ? m : v > M ? M : v; -} - -static void SetSegmentAlphas(VP8Encoder* const enc, - const int centers[NUM_MB_SEGMENTS], - int mid) { - const int nb = enc->segment_hdr_.num_segments_; - int min = centers[0], max = centers[0]; - int n; - - if (nb > 1) { - for (n = 0; n < nb; ++n) { - if (min > centers[n]) min = centers[n]; - if (max < centers[n]) max = centers[n]; - } - } - if (max == min) max = min + 1; - assert(mid <= max && mid >= min); - for (n = 0; n < nb; ++n) { - const int alpha = 255 * (centers[n] - mid) / (max - min); - const int beta = 255 * (centers[n] - min) / (max - min); - enc->dqm_[n].alpha_ = clip(alpha, -127, 127); - enc->dqm_[n].beta_ = clip(beta, 0, 255); - } -} - -//------------------------------------------------------------------------------ -// Simplified k-Means, to assign Nb segments based on alpha-histogram - -static void AssignSegments(VP8Encoder* const enc, const int alphas[256]) { - const int nb = enc->segment_hdr_.num_segments_; - int centers[NUM_MB_SEGMENTS]; - int weighted_average = 0; - int map[256]; - int a, n, k; - int min_a = 0, max_a = 255, range_a; - // 'int' type is ok for histo, and won't overflow - int accum[NUM_MB_SEGMENTS], dist_accum[NUM_MB_SEGMENTS]; - - // bracket the input - for (n = 0; n < 256 && alphas[n] == 0; ++n) {} - min_a = n; - for (n = 255; n > min_a && alphas[n] == 0; --n) {} - max_a = n; - range_a = max_a - min_a; - - // Spread initial centers evenly - for (n = 1, k = 0; n < 2 * nb; n += 2) { - centers[k++] = min_a + (n * range_a) / (2 * nb); - } - - for (k = 0; k < MAX_ITERS_K_MEANS; ++k) { // few iters are enough - int total_weight; - int displaced; - // Reset stats - for (n = 0; n < nb; ++n) { - accum[n] = 0; - dist_accum[n] = 0; - } - // Assign nearest center for each 'a' - n = 0; // track the nearest center for current 'a' - for (a = min_a; a <= max_a; ++a) { - if (alphas[a]) { - while (n < nb - 1 && abs(a - centers[n + 1]) < abs(a - centers[n])) { - n++; - } - map[a] = n; - // accumulate contribution into best centroid - dist_accum[n] += a * alphas[a]; - accum[n] += alphas[a]; - } - } - // All point are classified. Move the centroids to the - // center of their respective cloud. - displaced = 0; - weighted_average = 0; - total_weight = 0; - for (n = 0; n < nb; ++n) { - if (accum[n]) { - const int new_center = (dist_accum[n] + accum[n] / 2) / accum[n]; - displaced += abs(centers[n] - new_center); - centers[n] = new_center; - weighted_average += new_center * accum[n]; - total_weight += accum[n]; - } - } - weighted_average = (weighted_average + total_weight / 2) / total_weight; - if (displaced < 5) break; // no need to keep on looping... - } - - // Map each original value to the closest centroid - for (n = 0; n < enc->mb_w_ * enc->mb_h_; ++n) { - VP8MBInfo* const mb = &enc->mb_info_[n]; - const int alpha = mb->alpha_; - mb->segment_ = map[alpha]; - mb->alpha_ = centers[map[alpha]]; // just for the record. - } - - if (nb > 1) { - const int smooth = (enc->config_->preprocessing & 1); - if (smooth) SmoothSegmentMap(enc); - } - - SetSegmentProbas(enc); // Assign final proba - SetSegmentAlphas(enc, centers, weighted_average); // pick some alphas. -} - -//------------------------------------------------------------------------------ -// Macroblock analysis: collect histogram for each mode, deduce the maximal -// susceptibility and set best modes for this macroblock. -// Segment assignment is done later. - -// Number of modes to inspect for alpha_ evaluation. For high-quality settings, -// we don't need to test all the possible modes during the analysis phase. -#define MAX_INTRA16_MODE 2 -#define MAX_INTRA4_MODE 2 -#define MAX_UV_MODE 2 - -static int MBAnalyzeBestIntra16Mode(VP8EncIterator* const it) { - const int max_mode = (it->enc_->method_ >= 3) ? MAX_INTRA16_MODE : 4; - int mode; - int best_alpha = -1; - int best_mode = 0; - - VP8MakeLuma16Preds(it); - for (mode = 0; mode < max_mode; ++mode) { - const int alpha = VP8CollectHistogram(it->yuv_in_ + Y_OFF, - it->yuv_p_ + VP8I16ModeOffsets[mode], - 0, 16); - if (alpha > best_alpha) { - best_alpha = alpha; - best_mode = mode; - } - } - VP8SetIntra16Mode(it, best_mode); - return best_alpha; -} - -static int MBAnalyzeBestIntra4Mode(VP8EncIterator* const it, - int best_alpha) { - uint8_t modes[16]; - const int max_mode = (it->enc_->method_ >= 3) ? MAX_INTRA4_MODE : NUM_BMODES; - int i4_alpha = 0; - VP8IteratorStartI4(it); - do { - int mode; - int best_mode_alpha = -1; - const uint8_t* const src = it->yuv_in_ + Y_OFF + VP8Scan[it->i4_]; - - VP8MakeIntra4Preds(it); - for (mode = 0; mode < max_mode; ++mode) { - const int alpha = VP8CollectHistogram(src, - it->yuv_p_ + VP8I4ModeOffsets[mode], - 0, 1); - if (alpha > best_mode_alpha) { - best_mode_alpha = alpha; - modes[it->i4_] = mode; - } - } - i4_alpha += best_mode_alpha; - // Note: we reuse the original samples for predictors - } while (VP8IteratorRotateI4(it, it->yuv_in_ + Y_OFF)); - - if (i4_alpha > best_alpha) { - VP8SetIntra4Mode(it, modes); - best_alpha = ClipAlpha(i4_alpha); - } - return best_alpha; -} - -static int MBAnalyzeBestUVMode(VP8EncIterator* const it) { - int best_alpha = -1; - int best_mode = 0; - const int max_mode = (it->enc_->method_ >= 3) ? MAX_UV_MODE : 4; - int mode; - VP8MakeChroma8Preds(it); - for (mode = 0; mode < max_mode; ++mode) { - const int alpha = VP8CollectHistogram(it->yuv_in_ + U_OFF, - it->yuv_p_ + VP8UVModeOffsets[mode], - 16, 16 + 4 + 4); - if (alpha > best_alpha) { - best_alpha = alpha; - best_mode = mode; - } - } - VP8SetIntraUVMode(it, best_mode); - return best_alpha; -} - -static void MBAnalyze(VP8EncIterator* const it, - int alphas[256], int* const uv_alpha) { - const VP8Encoder* const enc = it->enc_; - int best_alpha, best_uv_alpha; - - VP8SetIntra16Mode(it, 0); // default: Intra16, DC_PRED - VP8SetSkip(it, 0); // not skipped - VP8SetSegment(it, 0); // default segment, spec-wise. - - best_alpha = MBAnalyzeBestIntra16Mode(it); - if (enc->method_ != 3) { - // We go and make a fast decision for intra4/intra16. - // It's usually not a good and definitive pick, but helps seeding the stats - // about level bit-cost. - // TODO(skal): improve criterion. - best_alpha = MBAnalyzeBestIntra4Mode(it, best_alpha); - } - best_uv_alpha = MBAnalyzeBestUVMode(it); - - // Final susceptibility mix - best_alpha = (best_alpha + best_uv_alpha + 1) / 2; - alphas[best_alpha]++; - *uv_alpha += best_uv_alpha; - it->mb_->alpha_ = best_alpha; // Informative only. -} - -//------------------------------------------------------------------------------ -// Main analysis loop: -// Collect all susceptibilities for each macroblock and record their -// distribution in alphas[]. Segments is assigned a-posteriori, based on -// this histogram. -// We also pick an intra16 prediction mode, which shouldn't be considered -// final except for fast-encode settings. We can also pick some intra4 modes -// and decide intra4/intra16, but that's usually almost always a bad choice at -// this stage. - -int VP8EncAnalyze(VP8Encoder* const enc) { - int ok = 1; - int alphas[256] = { 0 }; - VP8EncIterator it; - - VP8IteratorInit(enc, &it); - enc->uv_alpha_ = 0; - do { - VP8IteratorImport(&it); - MBAnalyze(&it, alphas, &enc->uv_alpha_); - ok = VP8IteratorProgress(&it, 20); - // Let's pretend we have perfect lossless reconstruction. - } while (ok && VP8IteratorNext(&it, it.yuv_in_)); - enc->uv_alpha_ /= enc->mb_w_ * enc->mb_h_; - if (ok) AssignSegments(enc, alphas); - - return ok; -} - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif diff --git a/external/libwebp/enc/backward_references.c b/external/libwebp/enc/backward_references.c deleted file mode 100644 index fd30f307df..0000000000 --- a/external/libwebp/enc/backward_references.c +++ /dev/null @@ -1,873 +0,0 @@ -// Copyright 2012 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Author: Jyrki Alakuijala (jyrki@google.com) -// - -#include <assert.h> -#include <math.h> -#include <stdio.h> - -#include "./backward_references.h" -#include "./histogram.h" -#include "../dsp/lossless.h" -#include "../utils/color_cache.h" -#include "../utils/utils.h" - -#define VALUES_IN_BYTE 256 - -#define HASH_BITS 18 -#define HASH_SIZE (1 << HASH_BITS) -#define HASH_MULTIPLIER (0xc6a4a7935bd1e995ULL) - -// 1M window (4M bytes) minus 120 special codes for short distances. -#define WINDOW_SIZE ((1 << 20) - 120) - -// Bounds for the match length. -#define MIN_LENGTH 2 -#define MAX_LENGTH 4096 - -typedef struct { - // Stores the most recently added position with the given hash value. - int32_t hash_to_first_index_[HASH_SIZE]; - // chain_[pos] stores the previous position with the same hash value - // for every pixel in the image. - int32_t* chain_; -} HashChain; - -// ----------------------------------------------------------------------------- - -static const uint8_t plane_to_code_lut[128] = { - 96, 73, 55, 39, 23, 13, 5, 1, 255, 255, 255, 255, 255, 255, 255, 255, - 101, 78, 58, 42, 26, 16, 8, 2, 0, 3, 9, 17, 27, 43, 59, 79, - 102, 86, 62, 46, 32, 20, 10, 6, 4, 7, 11, 21, 33, 47, 63, 87, - 105, 90, 70, 52, 37, 28, 18, 14, 12, 15, 19, 29, 38, 53, 71, 91, - 110, 99, 82, 66, 48, 35, 30, 24, 22, 25, 31, 36, 49, 67, 83, 100, - 115, 108, 94, 76, 64, 50, 44, 40, 34, 41, 45, 51, 65, 77, 95, 109, - 118, 113, 103, 92, 80, 68, 60, 56, 54, 57, 61, 69, 81, 93, 104, 114, - 119, 116, 111, 106, 97, 88, 84, 74, 72, 75, 85, 89, 98, 107, 112, 117 -}; - -static int DistanceToPlaneCode(int xsize, int dist) { - const int yoffset = dist / xsize; - const int xoffset = dist - yoffset * xsize; - if (xoffset <= 8 && yoffset < 8) { - return plane_to_code_lut[yoffset * 16 + 8 - xoffset] + 1; - } else if (xoffset > xsize - 8 && yoffset < 7) { - return plane_to_code_lut[(yoffset + 1) * 16 + 8 + (xsize - xoffset)] + 1; - } - return dist + 120; -} - -static WEBP_INLINE int FindMatchLength(const uint32_t* const array1, - const uint32_t* const array2, - const int max_limit) { - int match_len = 0; - while (match_len < max_limit && array1[match_len] == array2[match_len]) { - ++match_len; - } - return match_len; -} - -// ----------------------------------------------------------------------------- -// VP8LBackwardRefs - -void VP8LInitBackwardRefs(VP8LBackwardRefs* const refs) { - if (refs != NULL) { - refs->refs = NULL; - refs->size = 0; - refs->max_size = 0; - } -} - -void VP8LClearBackwardRefs(VP8LBackwardRefs* const refs) { - if (refs != NULL) { - free(refs->refs); - VP8LInitBackwardRefs(refs); - } -} - -int VP8LBackwardRefsAlloc(VP8LBackwardRefs* const refs, int max_size) { - assert(refs != NULL); - refs->size = 0; - refs->max_size = 0; - refs->refs = (PixOrCopy*)WebPSafeMalloc((uint64_t)max_size, - sizeof(*refs->refs)); - if (refs->refs == NULL) return 0; - refs->max_size = max_size; - return 1; -} - -// ----------------------------------------------------------------------------- -// Hash chains - -static WEBP_INLINE uint64_t GetPixPairHash64(const uint32_t* const argb) { - uint64_t key = ((uint64_t)(argb[1]) << 32) | argb[0]; - key = (key * HASH_MULTIPLIER) >> (64 - HASH_BITS); - return key; -} - -static int HashChainInit(HashChain* const p, int size) { - int i; - p->chain_ = (int*)WebPSafeMalloc((uint64_t)size, sizeof(*p->chain_)); - if (p->chain_ == NULL) { - return 0; - } - for (i = 0; i < size; ++i) { - p->chain_[i] = -1; - } - for (i = 0; i < HASH_SIZE; ++i) { - p->hash_to_first_index_[i] = -1; - } - return 1; -} - -static void HashChainDelete(HashChain* const p) { - if (p != NULL) { - free(p->chain_); - free(p); - } -} - -// Insertion of two pixels at a time. -static void HashChainInsert(HashChain* const p, - const uint32_t* const argb, int pos) { - const uint64_t hash_code = GetPixPairHash64(argb); - p->chain_[pos] = p->hash_to_first_index_[hash_code]; - p->hash_to_first_index_[hash_code] = pos; -} - -static int HashChainFindCopy(const HashChain* const p, - int quality, int index, int xsize, - const uint32_t* const argb, int maxlen, - int* const distance_ptr, - int* const length_ptr) { - const uint64_t hash_code = GetPixPairHash64(&argb[index]); - int prev_length = 0; - int64_t best_val = 0; - int best_length = 0; - int best_distance = 0; - const uint32_t* const argb_start = argb + index; - const int iter_min_mult = (quality < 50) ? 2 : (quality < 75) ? 4 : 8; - const int iter_min = -quality * iter_min_mult; - int iter_cnt = 10 + (quality >> 1); - const int min_pos = (index > WINDOW_SIZE) ? index - WINDOW_SIZE : 0; - int pos; - - assert(xsize > 0); - for (pos = p->hash_to_first_index_[hash_code]; - pos >= min_pos; - pos = p->chain_[pos]) { - int64_t val; - int curr_length; - if (iter_cnt < 0) { - if (iter_cnt < iter_min || best_val >= 0xff0000) { - break; - } - } - --iter_cnt; - if (best_length != 0 && - argb[pos + best_length - 1] != argb_start[best_length - 1]) { - continue; - } - curr_length = FindMatchLength(argb + pos, argb_start, maxlen); - if (curr_length < prev_length) { - continue; - } - val = 65536 * curr_length; - // Favoring 2d locality here gives savings for certain images. - if (index - pos < 9 * xsize) { - const int y = (index - pos) / xsize; - int x = (index - pos) % xsize; - if (x > xsize / 2) { - x = xsize - x; - } - if (x <= 7 && x >= -8) { - val -= y * y + x * x; - } else { - val -= 9 * 9 + 9 * 9; - } - } else { - val -= 9 * 9 + 9 * 9; - } - if (best_val < val) { - prev_length = curr_length; - best_val = val; - best_length = curr_length; - best_distance = index - pos; - if (curr_length >= MAX_LENGTH) { - break; - } - if ((best_distance == 1 || best_distance == xsize) && - best_length >= 128) { - break; - } - } - } - *distance_ptr = best_distance; - *length_ptr = best_length; - return (best_length >= MIN_LENGTH); -} - -static WEBP_INLINE void PushBackCopy(VP8LBackwardRefs* const refs, int length) { - int size = refs->size; - while (length >= MAX_LENGTH) { - refs->refs[size++] = PixOrCopyCreateCopy(1, MAX_LENGTH); - length -= MAX_LENGTH; - } - if (length > 0) { - refs->refs[size++] = PixOrCopyCreateCopy(1, length); - } - refs->size = size; -} - -static void BackwardReferencesRle(int xsize, int ysize, - const uint32_t* const argb, - VP8LBackwardRefs* const refs) { - const int pix_count = xsize * ysize; - int match_len = 0; - int i; - refs->size = 0; - PushBackCopy(refs, match_len); // i=0 case - refs->refs[refs->size++] = PixOrCopyCreateLiteral(argb[0]); - for (i = 1; i < pix_count; ++i) { - if (argb[i] == argb[i - 1]) { - ++match_len; - } else { - PushBackCopy(refs, match_len); - match_len = 0; - refs->refs[refs->size++] = PixOrCopyCreateLiteral(argb[i]); - } - } - PushBackCopy(refs, match_len); -} - -static int BackwardReferencesHashChain(int xsize, int ysize, - const uint32_t* const argb, - int cache_bits, int quality, - VP8LBackwardRefs* const refs) { - int i; - int ok = 0; - int cc_init = 0; - const int use_color_cache = (cache_bits > 0); - const int pix_count = xsize * ysize; - HashChain* const hash_chain = (HashChain*)malloc(sizeof(*hash_chain)); - VP8LColorCache hashers; - - if (hash_chain == NULL) return 0; - if (use_color_cache) { - cc_init = VP8LColorCacheInit(&hashers, cache_bits); - if (!cc_init) goto Error; - } - - if (!HashChainInit(hash_chain, pix_count)) goto Error; - - refs->size = 0; - for (i = 0; i < pix_count; ) { - // Alternative#1: Code the pixels starting at 'i' using backward reference. - int offset = 0; - int len = 0; - if (i < pix_count - 1) { // FindCopy(i,..) reads pixels at [i] and [i + 1]. - int maxlen = pix_count - i; - if (maxlen > MAX_LENGTH) { - maxlen = MAX_LENGTH; - } - HashChainFindCopy(hash_chain, quality, i, xsize, argb, maxlen, - &offset, &len); - } - if (len >= MIN_LENGTH) { - // Alternative#2: Insert the pixel at 'i' as literal, and code the - // pixels starting at 'i + 1' using backward reference. - int offset2 = 0; - int len2 = 0; - int k; - HashChainInsert(hash_chain, &argb[i], i); - if (i < pix_count - 2) { // FindCopy(i+1,..) reads [i + 1] and [i + 2]. - int maxlen = pix_count - (i + 1); - if (maxlen > MAX_LENGTH) { - maxlen = MAX_LENGTH; - } - HashChainFindCopy(hash_chain, quality, - i + 1, xsize, argb, maxlen, &offset2, &len2); - if (len2 > len + 1) { - const uint32_t pixel = argb[i]; - // Alternative#2 is a better match. So push pixel at 'i' as literal. - if (use_color_cache && VP8LColorCacheContains(&hashers, pixel)) { - const int ix = VP8LColorCacheGetIndex(&hashers, pixel); - refs->refs[refs->size] = PixOrCopyCreateCacheIdx(ix); - } else { - refs->refs[refs->size] = PixOrCopyCreateLiteral(pixel); - } - ++refs->size; - if (use_color_cache) VP8LColorCacheInsert(&hashers, pixel); - i++; // Backward reference to be done for next pixel. - len = len2; - offset = offset2; - } - } - if (len >= MAX_LENGTH) { - len = MAX_LENGTH - 1; - } - refs->refs[refs->size++] = PixOrCopyCreateCopy(offset, len); - if (use_color_cache) { - for (k = 0; k < len; ++k) { - VP8LColorCacheInsert(&hashers, argb[i + k]); - } - } - // Add to the hash_chain (but cannot add the last pixel). - { - const int last = (len < pix_count - 1 - i) ? len : pix_count - 1 - i; - for (k = 1; k < last; ++k) { - HashChainInsert(hash_chain, &argb[i + k], i + k); - } - } - i += len; - } else { - const uint32_t pixel = argb[i]; - if (use_color_cache && VP8LColorCacheContains(&hashers, pixel)) { - // push pixel as a PixOrCopyCreateCacheIdx pixel - const int ix = VP8LColorCacheGetIndex(&hashers, pixel); - refs->refs[refs->size] = PixOrCopyCreateCacheIdx(ix); - } else { - refs->refs[refs->size] = PixOrCopyCreateLiteral(pixel); - } - ++refs->size; - if (use_color_cache) VP8LColorCacheInsert(&hashers, pixel); - if (i + 1 < pix_count) { - HashChainInsert(hash_chain, &argb[i], i); - } - ++i; - } - } - ok = 1; -Error: - if (cc_init) VP8LColorCacheClear(&hashers); - HashChainDelete(hash_chain); - return ok; -} - -// ----------------------------------------------------------------------------- - -typedef struct { - double alpha_[VALUES_IN_BYTE]; - double red_[VALUES_IN_BYTE]; - double literal_[PIX_OR_COPY_CODES_MAX]; - double blue_[VALUES_IN_BYTE]; - double distance_[NUM_DISTANCE_CODES]; -} CostModel; - -static int BackwardReferencesTraceBackwards( - int xsize, int ysize, int recursive_cost_model, - const uint32_t* const argb, int cache_bits, VP8LBackwardRefs* const refs); - -static void ConvertPopulationCountTableToBitEstimates( - int num_symbols, const int population_counts[], double output[]) { - int sum = 0; - int nonzeros = 0; - int i; - for (i = 0; i < num_symbols; ++i) { - sum += population_counts[i]; - if (population_counts[i] > 0) { - ++nonzeros; - } - } - if (nonzeros <= 1) { - memset(output, 0, num_symbols * sizeof(*output)); - } else { - const double logsum = VP8LFastLog2(sum); - for (i = 0; i < num_symbols; ++i) { - output[i] = logsum - VP8LFastLog2(population_counts[i]); - } - } -} - -static int CostModelBuild(CostModel* const m, int xsize, int ysize, - int recursion_level, const uint32_t* const argb, - int cache_bits) { - int ok = 0; - VP8LHistogram histo; - VP8LBackwardRefs refs; - const int quality = 100; - - if (!VP8LBackwardRefsAlloc(&refs, xsize * ysize)) goto Error; - - if (recursion_level > 0) { - if (!BackwardReferencesTraceBackwards(xsize, ysize, recursion_level - 1, - argb, cache_bits, &refs)) { - goto Error; - } - } else { - if (!BackwardReferencesHashChain(xsize, ysize, argb, cache_bits, quality, - &refs)) { - goto Error; - } - } - VP8LHistogramCreate(&histo, &refs, cache_bits); - ConvertPopulationCountTableToBitEstimates( - VP8LHistogramNumCodes(&histo), histo.literal_, m->literal_); - ConvertPopulationCountTableToBitEstimates( - VALUES_IN_BYTE, histo.red_, m->red_); - ConvertPopulationCountTableToBitEstimates( - VALUES_IN_BYTE, histo.blue_, m->blue_); - ConvertPopulationCountTableToBitEstimates( - VALUES_IN_BYTE, histo.alpha_, m->alpha_); - ConvertPopulationCountTableToBitEstimates( - NUM_DISTANCE_CODES, histo.distance_, m->distance_); - ok = 1; - - Error: - VP8LClearBackwardRefs(&refs); - return ok; -} - -static WEBP_INLINE double GetLiteralCost(const CostModel* const m, uint32_t v) { - return m->alpha_[v >> 24] + - m->red_[(v >> 16) & 0xff] + - m->literal_[(v >> 8) & 0xff] + - m->blue_[v & 0xff]; -} - -static WEBP_INLINE double GetCacheCost(const CostModel* const m, uint32_t idx) { - const int literal_idx = VALUES_IN_BYTE + NUM_LENGTH_CODES + idx; - return m->literal_[literal_idx]; -} - -static WEBP_INLINE double GetLengthCost(const CostModel* const m, - uint32_t length) { - int code, extra_bits_count, extra_bits_value; - PrefixEncode(length, &code, &extra_bits_count, &extra_bits_value); - return m->literal_[VALUES_IN_BYTE + code] + extra_bits_count; -} - -static WEBP_INLINE double GetDistanceCost(const CostModel* const m, - uint32_t distance) { - int code, extra_bits_count, extra_bits_value; - PrefixEncode(distance, &code, &extra_bits_count, &extra_bits_value); - return m->distance_[code] + extra_bits_count; -} - -static int BackwardReferencesHashChainDistanceOnly( - int xsize, int ysize, int recursive_cost_model, const uint32_t* const argb, - int cache_bits, uint32_t* const dist_array) { - int i; - int ok = 0; - int cc_init = 0; - const int quality = 100; - const int pix_count = xsize * ysize; - const int use_color_cache = (cache_bits > 0); - float* const cost = - (float*)WebPSafeMalloc((uint64_t)pix_count, sizeof(*cost)); - CostModel* cost_model = (CostModel*)malloc(sizeof(*cost_model)); - HashChain* hash_chain = (HashChain*)malloc(sizeof(*hash_chain)); - VP8LColorCache hashers; - const double mul0 = (recursive_cost_model != 0) ? 1.0 : 0.68; - const double mul1 = (recursive_cost_model != 0) ? 1.0 : 0.82; - - if (cost == NULL || cost_model == NULL || hash_chain == NULL) goto Error; - - if (!HashChainInit(hash_chain, pix_count)) goto Error; - - if (use_color_cache) { - cc_init = VP8LColorCacheInit(&hashers, cache_bits); - if (!cc_init) goto Error; - } - - if (!CostModelBuild(cost_model, xsize, ysize, recursive_cost_model, argb, - cache_bits)) { - goto Error; - } - - for (i = 0; i < pix_count; ++i) cost[i] = 1e38f; - - // We loop one pixel at a time, but store all currently best points to - // non-processed locations from this point. - dist_array[0] = 0; - for (i = 0; i < pix_count; ++i) { - double prev_cost = 0.0; - int shortmax; - if (i > 0) { - prev_cost = cost[i - 1]; - } - for (shortmax = 0; shortmax < 2; ++shortmax) { - int offset = 0; - int len = 0; - if (i < pix_count - 1) { // FindCopy reads pixels at [i] and [i + 1]. - int maxlen = shortmax ? 2 : MAX_LENGTH; - if (maxlen > pix_count - i) { - maxlen = pix_count - i; - } - HashChainFindCopy(hash_chain, quality, i, xsize, argb, maxlen, - &offset, &len); - } - if (len >= MIN_LENGTH) { - const int code = DistanceToPlaneCode(xsize, offset); - const double distance_cost = - prev_cost + GetDistanceCost(cost_model, code); - int k; - for (k = 1; k < len; ++k) { - const double cost_val = distance_cost + GetLengthCost(cost_model, k); - if (cost[i + k] > cost_val) { - cost[i + k] = (float)cost_val; - dist_array[i + k] = k + 1; - } - } - // This if is for speedup only. It roughly doubles the speed, and - // makes compression worse by .1 %. - if (len >= 128 && code < 2) { - // Long copy for short distances, let's skip the middle - // lookups for better copies. - // 1) insert the hashes. - if (use_color_cache) { - for (k = 0; k < len; ++k) { - VP8LColorCacheInsert(&hashers, argb[i + k]); - } - } - // 2) Add to the hash_chain (but cannot add the last pixel) - { - const int last = (len < pix_count - 1 - i) ? len - : pix_count - 1 - i; - for (k = 0; k < last; ++k) { - HashChainInsert(hash_chain, &argb[i + k], i + k); - } - } - // 3) jump. - i += len - 1; // for loop does ++i, thus -1 here. - goto next_symbol; - } - } - } - if (i < pix_count - 1) { - HashChainInsert(hash_chain, &argb[i], i); - } - { - // inserting a literal pixel - double cost_val = prev_cost; - if (use_color_cache && VP8LColorCacheContains(&hashers, argb[i])) { - const int ix = VP8LColorCacheGetIndex(&hashers, argb[i]); - cost_val += GetCacheCost(cost_model, ix) * mul0; - } else { - cost_val += GetLiteralCost(cost_model, argb[i]) * mul1; - } - if (cost[i] > cost_val) { - cost[i] = (float)cost_val; - dist_array[i] = 1; // only one is inserted. - } - if (use_color_cache) VP8LColorCacheInsert(&hashers, argb[i]); - } - next_symbol: ; - } - // Last pixel still to do, it can only be a single step if not reached - // through cheaper means already. - ok = 1; -Error: - if (cc_init) VP8LColorCacheClear(&hashers); - HashChainDelete(hash_chain); - free(cost_model); - free(cost); - return ok; -} - -static int TraceBackwards(const uint32_t* const dist_array, - int dist_array_size, - uint32_t** const chosen_path, - int* const chosen_path_size) { - int i; - // Count how many. - int count = 0; - for (i = dist_array_size - 1; i >= 0; ) { - int k = dist_array[i]; - assert(k >= 1); - ++count; - i -= k; - } - // Allocate. - *chosen_path_size = count; - *chosen_path = - (uint32_t*)WebPSafeMalloc((uint64_t)count, sizeof(**chosen_path)); - if (*chosen_path == NULL) return 0; - - // Write in reverse order. - for (i = dist_array_size - 1; i >= 0; ) { - int k = dist_array[i]; - assert(k >= 1); - (*chosen_path)[--count] = k; - i -= k; - } - return 1; -} - -static int BackwardReferencesHashChainFollowChosenPath( - int xsize, int ysize, const uint32_t* const argb, int cache_bits, - const uint32_t* const chosen_path, int chosen_path_size, - VP8LBackwardRefs* const refs) { - const int quality = 100; - const int pix_count = xsize * ysize; - const int use_color_cache = (cache_bits > 0); - int size = 0; - int i = 0; - int k; - int ix; - int ok = 0; - int cc_init = 0; - HashChain* hash_chain = (HashChain*)malloc(sizeof(*hash_chain)); - VP8LColorCache hashers; - - if (hash_chain == NULL || !HashChainInit(hash_chain, pix_count)) { - goto Error; - } - if (use_color_cache) { - cc_init = VP8LColorCacheInit(&hashers, cache_bits); - if (!cc_init) goto Error; - } - - refs->size = 0; - for (ix = 0; ix < chosen_path_size; ++ix, ++size) { - int offset = 0; - int len = 0; - int maxlen = chosen_path[ix]; - if (maxlen != 1) { - HashChainFindCopy(hash_chain, quality, - i, xsize, argb, maxlen, &offset, &len); - assert(len == maxlen); - refs->refs[size] = PixOrCopyCreateCopy(offset, len); - if (use_color_cache) { - for (k = 0; k < len; ++k) { - VP8LColorCacheInsert(&hashers, argb[i + k]); - } - } - { - const int last = (len < pix_count - 1 - i) ? len : pix_count - 1 - i; - for (k = 0; k < last; ++k) { - HashChainInsert(hash_chain, &argb[i + k], i + k); - } - } - i += len; - } else { - if (use_color_cache && VP8LColorCacheContains(&hashers, argb[i])) { - // push pixel as a color cache index - const int idx = VP8LColorCacheGetIndex(&hashers, argb[i]); - refs->refs[size] = PixOrCopyCreateCacheIdx(idx); - } else { - refs->refs[size] = PixOrCopyCreateLiteral(argb[i]); - } - if (use_color_cache) VP8LColorCacheInsert(&hashers, argb[i]); - if (i + 1 < pix_count) { - HashChainInsert(hash_chain, &argb[i], i); - } - ++i; - } - } - assert(size <= refs->max_size); - refs->size = size; - ok = 1; -Error: - if (cc_init) VP8LColorCacheClear(&hashers); - HashChainDelete(hash_chain); - return ok; -} - -// Returns 1 on success. -static int BackwardReferencesTraceBackwards(int xsize, int ysize, - int recursive_cost_model, - const uint32_t* const argb, - int cache_bits, - VP8LBackwardRefs* const refs) { - int ok = 0; - const int dist_array_size = xsize * ysize; - uint32_t* chosen_path = NULL; - int chosen_path_size = 0; - uint32_t* dist_array = - (uint32_t*)WebPSafeMalloc((uint64_t)dist_array_size, sizeof(*dist_array)); - - if (dist_array == NULL) goto Error; - - if (!BackwardReferencesHashChainDistanceOnly( - xsize, ysize, recursive_cost_model, argb, cache_bits, dist_array)) { - goto Error; - } - if (!TraceBackwards(dist_array, dist_array_size, - &chosen_path, &chosen_path_size)) { - goto Error; - } - free(dist_array); // no need to retain this memory any longer - dist_array = NULL; - if (!BackwardReferencesHashChainFollowChosenPath( - xsize, ysize, argb, cache_bits, chosen_path, chosen_path_size, refs)) { - goto Error; - } - ok = 1; - Error: - free(chosen_path); - free(dist_array); - return ok; -} - -static void BackwardReferences2DLocality(int xsize, - VP8LBackwardRefs* const refs) { - int i; - for (i = 0; i < refs->size; ++i) { - if (PixOrCopyIsCopy(&refs->refs[i])) { - const int dist = refs->refs[i].argb_or_distance; - const int transformed_dist = DistanceToPlaneCode(xsize, dist); - refs->refs[i].argb_or_distance = transformed_dist; - } - } -} - -int VP8LGetBackwardReferences(int width, int height, - const uint32_t* const argb, - int quality, int cache_bits, int use_2d_locality, - VP8LBackwardRefs* const best) { - int ok = 0; - int lz77_is_useful; - VP8LBackwardRefs refs_rle, refs_lz77; - const int num_pix = width * height; - - VP8LBackwardRefsAlloc(&refs_rle, num_pix); - VP8LBackwardRefsAlloc(&refs_lz77, num_pix); - VP8LInitBackwardRefs(best); - if (refs_rle.refs == NULL || refs_lz77.refs == NULL) { - Error1: - VP8LClearBackwardRefs(&refs_rle); - VP8LClearBackwardRefs(&refs_lz77); - goto End; - } - - if (!BackwardReferencesHashChain(width, height, argb, cache_bits, quality, - &refs_lz77)) { - goto End; - } - // Backward Reference using RLE only. - BackwardReferencesRle(width, height, argb, &refs_rle); - - { - double bit_cost_lz77, bit_cost_rle; - VP8LHistogram* const histo = (VP8LHistogram*)malloc(sizeof(*histo)); - if (histo == NULL) goto Error1; - // Evaluate lz77 coding - VP8LHistogramCreate(histo, &refs_lz77, cache_bits); - bit_cost_lz77 = VP8LHistogramEstimateBits(histo); - // Evaluate RLE coding - VP8LHistogramCreate(histo, &refs_rle, cache_bits); - bit_cost_rle = VP8LHistogramEstimateBits(histo); - // Decide if LZ77 is useful. - lz77_is_useful = (bit_cost_lz77 < bit_cost_rle); - free(histo); - } - - // Choose appropriate backward reference. - if (lz77_is_useful) { - // TraceBackwards is costly. Run it for higher qualities. - const int try_lz77_trace_backwards = (quality >= 75); - *best = refs_lz77; // default guess: lz77 is better - VP8LClearBackwardRefs(&refs_rle); - if (try_lz77_trace_backwards) { - const int recursion_level = (num_pix < 320 * 200) ? 1 : 0; - VP8LBackwardRefs refs_trace; - if (!VP8LBackwardRefsAlloc(&refs_trace, num_pix)) { - goto End; - } - if (BackwardReferencesTraceBackwards( - width, height, recursion_level, argb, cache_bits, &refs_trace)) { - VP8LClearBackwardRefs(&refs_lz77); - *best = refs_trace; - } - } - } else { - VP8LClearBackwardRefs(&refs_lz77); - *best = refs_rle; - } - - if (use_2d_locality) BackwardReferences2DLocality(width, best); - - ok = 1; - - End: - if (!ok) { - VP8LClearBackwardRefs(best); - } - return ok; -} - -// Returns 1 on success. -static int ComputeCacheHistogram(const uint32_t* const argb, - int xsize, int ysize, - const VP8LBackwardRefs* const refs, - int cache_bits, - VP8LHistogram* const histo) { - int pixel_index = 0; - int i; - uint32_t k; - VP8LColorCache hashers; - const int use_color_cache = (cache_bits > 0); - int cc_init = 0; - - if (use_color_cache) { - cc_init = VP8LColorCacheInit(&hashers, cache_bits); - if (!cc_init) return 0; - } - - for (i = 0; i < refs->size; ++i) { - const PixOrCopy* const v = &refs->refs[i]; - if (PixOrCopyIsLiteral(v)) { - if (use_color_cache && - VP8LColorCacheContains(&hashers, argb[pixel_index])) { - // push pixel as a cache index - const int ix = VP8LColorCacheGetIndex(&hashers, argb[pixel_index]); - const PixOrCopy token = PixOrCopyCreateCacheIdx(ix); - VP8LHistogramAddSinglePixOrCopy(histo, &token); - } else { - VP8LHistogramAddSinglePixOrCopy(histo, v); - } - } else { - VP8LHistogramAddSinglePixOrCopy(histo, v); - } - if (use_color_cache) { - for (k = 0; k < PixOrCopyLength(v); ++k) { - VP8LColorCacheInsert(&hashers, argb[pixel_index + k]); - } - } - pixel_index += PixOrCopyLength(v); - } - assert(pixel_index == xsize * ysize); - (void)xsize; // xsize is not used in non-debug compilations otherwise. - (void)ysize; // ysize is not used in non-debug compilations otherwise. - if (cc_init) VP8LColorCacheClear(&hashers); - return 1; -} - -// Returns how many bits are to be used for a color cache. -int VP8LCalculateEstimateForCacheSize(const uint32_t* const argb, - int xsize, int ysize, - int* const best_cache_bits) { - int ok = 0; - int cache_bits; - double lowest_entropy = 1e99; - VP8LBackwardRefs refs; - static const double kSmallPenaltyForLargeCache = 4.0; - static const int quality = 30; - if (!VP8LBackwardRefsAlloc(&refs, xsize * ysize) || - !BackwardReferencesHashChain(xsize, ysize, argb, 0, quality, &refs)) { - goto Error; - } - for (cache_bits = 0; cache_bits <= MAX_COLOR_CACHE_BITS; ++cache_bits) { - double cur_entropy; - VP8LHistogram histo; - VP8LHistogramInit(&histo, cache_bits); - ComputeCacheHistogram(argb, xsize, ysize, &refs, cache_bits, &histo); - cur_entropy = VP8LHistogramEstimateBits(&histo) + - kSmallPenaltyForLargeCache * cache_bits; - if (cache_bits == 0 || cur_entropy < lowest_entropy) { - *best_cache_bits = cache_bits; - lowest_entropy = cur_entropy; - } - } - ok = 1; - Error: - VP8LClearBackwardRefs(&refs); - return ok; -} diff --git a/external/libwebp/enc/backward_references.h b/external/libwebp/enc/backward_references.h deleted file mode 100644 index 2fb1aecc5d..0000000000 --- a/external/libwebp/enc/backward_references.h +++ /dev/null @@ -1,214 +0,0 @@ -// Copyright 2012 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Author: Jyrki Alakuijala (jyrki@google.com) -// - -#ifndef WEBP_ENC_BACKWARD_REFERENCES_H_ -#define WEBP_ENC_BACKWARD_REFERENCES_H_ - -#include "platform/CCPlatformConfig.h" - -#include <assert.h> -#include <stdlib.h> -#include "../webp/types.h" -#include "../webp/format_constants.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -// The spec allows 11, we use 9 bits to reduce memory consumption in encoding. -// Having 9 instead of 11 only removes about 0.25 % of compression density. -#define MAX_COLOR_CACHE_BITS 9 - -// Max ever number of codes we'll use: -#define PIX_OR_COPY_CODES_MAX \ - (NUM_LITERAL_CODES + NUM_LENGTH_CODES + (1 << MAX_COLOR_CACHE_BITS)) - -// ----------------------------------------------------------------------------- -// PrefixEncode() - -// use GNU builtins where available. -#if defined(__GNUC__) && \ - ((__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || __GNUC__ >= 4) -static WEBP_INLINE int BitsLog2Floor(uint32_t n) { - return n == 0 ? -1 : 31 ^ __builtin_clz(n); -} -#elif (defined(_MSC_VER) && (defined(_M_X64) || defined(_M_IX86))) && (CC_TARGET_PLATFORM != CC_PLATFORM_MARMALADE) -#include <intrin.h> -#pragma intrinsic(_BitScanReverse) - -static WEBP_INLINE int BitsLog2Floor(uint32_t n) { - unsigned long first_set_bit; - return _BitScanReverse(&first_set_bit, n) ? first_set_bit : -1; -} -#else -static WEBP_INLINE int BitsLog2Floor(uint32_t n) { - int log = 0; - uint32_t value = n; - int i; - - if (value == 0) return -1; - for (i = 4; i >= 0; --i) { - const int shift = (1 << i); - const uint32_t x = value >> shift; - if (x != 0) { - value = x; - log += shift; - } - } - return log; -} -#endif - -static WEBP_INLINE int VP8LBitsLog2Ceiling(uint32_t n) { - const int floor = BitsLog2Floor(n); - if (n == (n & ~(n - 1))) // zero or a power of two. - return floor; - else - return floor + 1; -} - -// Splitting of distance and length codes into prefixes and -// extra bits. The prefixes are encoded with an entropy code -// while the extra bits are stored just as normal bits. -static WEBP_INLINE void PrefixEncode(int distance, int* const code, - int* const extra_bits_count, - int* const extra_bits_value) { - // Collect the two most significant bits where the highest bit is 1. - const int highest_bit = BitsLog2Floor(--distance); - // & 0x3f is to make behavior well defined when highest_bit - // does not exist or is the least significant bit. - const int second_highest_bit = - (distance >> ((highest_bit - 1) & 0x3f)) & 1; - *extra_bits_count = (highest_bit > 0) ? (highest_bit - 1) : 0; - *extra_bits_value = distance & ((1 << *extra_bits_count) - 1); - *code = (highest_bit > 0) ? (2 * highest_bit + second_highest_bit) - : (highest_bit == 0) ? 1 : 0; -} - -// ----------------------------------------------------------------------------- -// PixOrCopy - -enum Mode { - kLiteral, - kCacheIdx, - kCopy, - kNone -}; - -typedef struct { - // mode as uint8_t to make the memory layout to be exactly 8 bytes. - uint8_t mode; - uint16_t len; - uint32_t argb_or_distance; -} PixOrCopy; - -static WEBP_INLINE PixOrCopy PixOrCopyCreateCopy(uint32_t distance, - uint16_t len) { - PixOrCopy retval; - retval.mode = kCopy; - retval.argb_or_distance = distance; - retval.len = len; - return retval; -} - -static WEBP_INLINE PixOrCopy PixOrCopyCreateCacheIdx(int idx) { - PixOrCopy retval; - assert(idx >= 0); - assert(idx < (1 << MAX_COLOR_CACHE_BITS)); - retval.mode = kCacheIdx; - retval.argb_or_distance = idx; - retval.len = 1; - return retval; -} - -static WEBP_INLINE PixOrCopy PixOrCopyCreateLiteral(uint32_t argb) { - PixOrCopy retval; - retval.mode = kLiteral; - retval.argb_or_distance = argb; - retval.len = 1; - return retval; -} - -static WEBP_INLINE int PixOrCopyIsLiteral(const PixOrCopy* const p) { - return (p->mode == kLiteral); -} - -static WEBP_INLINE int PixOrCopyIsCacheIdx(const PixOrCopy* const p) { - return (p->mode == kCacheIdx); -} - -static WEBP_INLINE int PixOrCopyIsCopy(const PixOrCopy* const p) { - return (p->mode == kCopy); -} - -static WEBP_INLINE uint32_t PixOrCopyLiteral(const PixOrCopy* const p, - int component) { - assert(p->mode == kLiteral); - return (p->argb_or_distance >> (component * 8)) & 0xff; -} - -static WEBP_INLINE uint32_t PixOrCopyLength(const PixOrCopy* const p) { - return p->len; -} - -static WEBP_INLINE uint32_t PixOrCopyArgb(const PixOrCopy* const p) { - assert(p->mode == kLiteral); - return p->argb_or_distance; -} - -static WEBP_INLINE uint32_t PixOrCopyCacheIdx(const PixOrCopy* const p) { - assert(p->mode == kCacheIdx); - assert(p->argb_or_distance < (1U << MAX_COLOR_CACHE_BITS)); - return p->argb_or_distance; -} - -static WEBP_INLINE uint32_t PixOrCopyDistance(const PixOrCopy* const p) { - assert(p->mode == kCopy); - return p->argb_or_distance; -} - -// ----------------------------------------------------------------------------- -// VP8LBackwardRefs - -typedef struct { - PixOrCopy* refs; - int size; // currently used - int max_size; // maximum capacity -} VP8LBackwardRefs; - -// Initialize the object. Must be called first. 'refs' can be NULL. -void VP8LInitBackwardRefs(VP8LBackwardRefs* const refs); - -// Release memory and re-initialize the object. 'refs' can be NULL. -void VP8LClearBackwardRefs(VP8LBackwardRefs* const refs); - -// Allocate 'max_size' references. Returns false in case of memory error. -int VP8LBackwardRefsAlloc(VP8LBackwardRefs* const refs, int max_size); - -// ----------------------------------------------------------------------------- -// Main entry points - -// Evaluates best possible backward references for specified quality. -// Further optimize for 2D locality if use_2d_locality flag is set. -int VP8LGetBackwardReferences(int width, int height, - const uint32_t* const argb, - int quality, int cache_bits, int use_2d_locality, - VP8LBackwardRefs* const best); - -// Produce an estimate for a good color cache size for the image. -int VP8LCalculateEstimateForCacheSize(const uint32_t* const argb, - int xsize, int ysize, - int* const best_cache_bits); - -#if defined(__cplusplus) || defined(c_plusplus) -} -#endif - -#endif // WEBP_ENC_BACKWARD_REFERENCES_H_ diff --git a/external/libwebp/enc/config.c b/external/libwebp/enc/config.c deleted file mode 100644 index 1a26113554..0000000000 --- a/external/libwebp/enc/config.c +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright 2011 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Coding tools configuration -// -// Author: Skal (pascal.massimino@gmail.com) - -#include "../webp/encode.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -//------------------------------------------------------------------------------ -// WebPConfig -//------------------------------------------------------------------------------ - -int WebPConfigInitInternal(WebPConfig* config, - WebPPreset preset, float quality, int version) { - if (WEBP_ABI_IS_INCOMPATIBLE(version, WEBP_ENCODER_ABI_VERSION)) { - return 0; // caller/system version mismatch! - } - if (config == NULL) return 0; - - config->quality = quality; - config->target_size = 0; - config->target_PSNR = 0.; - config->method = 4; - config->sns_strength = 50; - config->filter_strength = 20; // default: light filtering - config->filter_sharpness = 0; - config->filter_type = 0; // default: simple - config->partitions = 0; - config->segments = 4; - config->pass = 1; - config->show_compressed = 0; - config->preprocessing = 0; - config->autofilter = 0; - config->partition_limit = 0; - config->alpha_compression = 1; - config->alpha_filtering = 1; - config->alpha_quality = 100; - config->lossless = 0; - config->image_hint = WEBP_HINT_DEFAULT; - - // TODO(skal): tune. - switch (preset) { - case WEBP_PRESET_PICTURE: - config->sns_strength = 80; - config->filter_sharpness = 4; - config->filter_strength = 35; - break; - case WEBP_PRESET_PHOTO: - config->sns_strength = 80; - config->filter_sharpness = 3; - config->filter_strength = 30; - break; - case WEBP_PRESET_DRAWING: - config->sns_strength = 25; - config->filter_sharpness = 6; - config->filter_strength = 10; - break; - case WEBP_PRESET_ICON: - config->sns_strength = 0; - config->filter_strength = 0; // disable filtering to retain sharpness - break; - case WEBP_PRESET_TEXT: - config->sns_strength = 0; - config->filter_strength = 0; // disable filtering to retain sharpness - config->segments = 2; - break; - case WEBP_PRESET_DEFAULT: - default: - break; - } - return WebPValidateConfig(config); -} - -int WebPValidateConfig(const WebPConfig* config) { - if (config == NULL) return 0; - if (config->quality < 0 || config->quality > 100) - return 0; - if (config->target_size < 0) - return 0; - if (config->target_PSNR < 0) - return 0; - if (config->method < 0 || config->method > 6) - return 0; - if (config->segments < 1 || config->segments > 4) - return 0; - if (config->sns_strength < 0 || config->sns_strength > 100) - return 0; - if (config->filter_strength < 0 || config->filter_strength > 100) - return 0; - if (config->filter_sharpness < 0 || config->filter_sharpness > 7) - return 0; - if (config->filter_type < 0 || config->filter_type > 1) - return 0; - if (config->autofilter < 0 || config->autofilter > 1) - return 0; - if (config->pass < 1 || config->pass > 10) - return 0; - if (config->show_compressed < 0 || config->show_compressed > 1) - return 0; - if (config->preprocessing < 0 || config->preprocessing > 1) - return 0; - if (config->partitions < 0 || config->partitions > 3) - return 0; - if (config->partition_limit < 0 || config->partition_limit > 100) - return 0; - if (config->alpha_compression < 0) - return 0; - if (config->alpha_filtering < 0) - return 0; - if (config->alpha_quality < 0 || config->alpha_quality > 100) - return 0; - if (config->lossless < 0 || config->lossless > 1) - return 0; - if (config->image_hint >= WEBP_HINT_LAST) - return 0; - return 1; -} - -//------------------------------------------------------------------------------ - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif diff --git a/external/libwebp/enc/cost.c b/external/libwebp/enc/cost.c deleted file mode 100644 index 92e0cc713c..0000000000 --- a/external/libwebp/enc/cost.c +++ /dev/null @@ -1,494 +0,0 @@ -// Copyright 2011 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Cost tables for level and modes -// -// Author: Skal (pascal.massimino@gmail.com) - -#include "./cost.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -//------------------------------------------------------------------------------ -// Boolean-cost cost table - -const uint16_t VP8EntropyCost[256] = { - 1792, 1792, 1792, 1536, 1536, 1408, 1366, 1280, 1280, 1216, - 1178, 1152, 1110, 1076, 1061, 1024, 1024, 992, 968, 951, - 939, 911, 896, 878, 871, 854, 838, 820, 811, 794, - 786, 768, 768, 752, 740, 732, 720, 709, 704, 690, - 683, 672, 666, 655, 647, 640, 631, 622, 615, 607, - 598, 592, 586, 576, 572, 564, 559, 555, 547, 541, - 534, 528, 522, 512, 512, 504, 500, 494, 488, 483, - 477, 473, 467, 461, 458, 452, 448, 443, 438, 434, - 427, 424, 419, 415, 410, 406, 403, 399, 394, 390, - 384, 384, 377, 374, 370, 366, 362, 359, 355, 351, - 347, 342, 342, 336, 333, 330, 326, 323, 320, 316, - 312, 308, 305, 302, 299, 296, 293, 288, 287, 283, - 280, 277, 274, 272, 268, 266, 262, 256, 256, 256, - 251, 248, 245, 242, 240, 237, 234, 232, 228, 226, - 223, 221, 218, 216, 214, 211, 208, 205, 203, 201, - 198, 196, 192, 191, 188, 187, 183, 181, 179, 176, - 175, 171, 171, 168, 165, 163, 160, 159, 156, 154, - 152, 150, 148, 146, 144, 142, 139, 138, 135, 133, - 131, 128, 128, 125, 123, 121, 119, 117, 115, 113, - 111, 110, 107, 105, 103, 102, 100, 98, 96, 94, - 92, 91, 89, 86, 86, 83, 82, 80, 77, 76, - 74, 73, 71, 69, 67, 66, 64, 63, 61, 59, - 57, 55, 54, 52, 51, 49, 47, 46, 44, 43, - 41, 40, 38, 36, 35, 33, 32, 30, 29, 27, - 25, 24, 22, 21, 19, 18, 16, 15, 13, 12, - 10, 9, 7, 6, 4, 3 -}; - -//------------------------------------------------------------------------------ -// Level cost tables - -// For each given level, the following table gives the pattern of contexts to -// use for coding it (in [][0]) as well as the bit value to use for each -// context (in [][1]). -const uint16_t VP8LevelCodes[MAX_VARIABLE_LEVEL][2] = { - {0x001, 0x000}, {0x007, 0x001}, {0x00f, 0x005}, - {0x00f, 0x00d}, {0x033, 0x003}, {0x033, 0x003}, {0x033, 0x023}, - {0x033, 0x023}, {0x033, 0x023}, {0x033, 0x023}, {0x0d3, 0x013}, - {0x0d3, 0x013}, {0x0d3, 0x013}, {0x0d3, 0x013}, {0x0d3, 0x013}, - {0x0d3, 0x013}, {0x0d3, 0x013}, {0x0d3, 0x013}, {0x0d3, 0x093}, - {0x0d3, 0x093}, {0x0d3, 0x093}, {0x0d3, 0x093}, {0x0d3, 0x093}, - {0x0d3, 0x093}, {0x0d3, 0x093}, {0x0d3, 0x093}, {0x0d3, 0x093}, - {0x0d3, 0x093}, {0x0d3, 0x093}, {0x0d3, 0x093}, {0x0d3, 0x093}, - {0x0d3, 0x093}, {0x0d3, 0x093}, {0x0d3, 0x093}, {0x153, 0x053}, - {0x153, 0x053}, {0x153, 0x053}, {0x153, 0x053}, {0x153, 0x053}, - {0x153, 0x053}, {0x153, 0x053}, {0x153, 0x053}, {0x153, 0x053}, - {0x153, 0x053}, {0x153, 0x053}, {0x153, 0x053}, {0x153, 0x053}, - {0x153, 0x053}, {0x153, 0x053}, {0x153, 0x053}, {0x153, 0x053}, - {0x153, 0x053}, {0x153, 0x053}, {0x153, 0x053}, {0x153, 0x053}, - {0x153, 0x053}, {0x153, 0x053}, {0x153, 0x053}, {0x153, 0x053}, - {0x153, 0x053}, {0x153, 0x053}, {0x153, 0x053}, {0x153, 0x053}, - {0x153, 0x053}, {0x153, 0x053}, {0x153, 0x053}, {0x153, 0x153} -}; - -// fixed costs for coding levels, deduce from the coding tree. -// This is only the part that doesn't depend on the probability state. -const uint16_t VP8LevelFixedCosts[2048] = { - 0, 256, 256, 256, 256, 432, 618, 630, - 731, 640, 640, 828, 901, 948, 1021, 1101, - 1174, 1221, 1294, 1042, 1085, 1115, 1158, 1202, - 1245, 1275, 1318, 1337, 1380, 1410, 1453, 1497, - 1540, 1570, 1613, 1280, 1295, 1317, 1332, 1358, - 1373, 1395, 1410, 1454, 1469, 1491, 1506, 1532, - 1547, 1569, 1584, 1601, 1616, 1638, 1653, 1679, - 1694, 1716, 1731, 1775, 1790, 1812, 1827, 1853, - 1868, 1890, 1905, 1727, 1733, 1742, 1748, 1759, - 1765, 1774, 1780, 1800, 1806, 1815, 1821, 1832, - 1838, 1847, 1853, 1878, 1884, 1893, 1899, 1910, - 1916, 1925, 1931, 1951, 1957, 1966, 1972, 1983, - 1989, 1998, 2004, 2027, 2033, 2042, 2048, 2059, - 2065, 2074, 2080, 2100, 2106, 2115, 2121, 2132, - 2138, 2147, 2153, 2178, 2184, 2193, 2199, 2210, - 2216, 2225, 2231, 2251, 2257, 2266, 2272, 2283, - 2289, 2298, 2304, 2168, 2174, 2183, 2189, 2200, - 2206, 2215, 2221, 2241, 2247, 2256, 2262, 2273, - 2279, 2288, 2294, 2319, 2325, 2334, 2340, 2351, - 2357, 2366, 2372, 2392, 2398, 2407, 2413, 2424, - 2430, 2439, 2445, 2468, 2474, 2483, 2489, 2500, - 2506, 2515, 2521, 2541, 2547, 2556, 2562, 2573, - 2579, 2588, 2594, 2619, 2625, 2634, 2640, 2651, - 2657, 2666, 2672, 2692, 2698, 2707, 2713, 2724, - 2730, 2739, 2745, 2540, 2546, 2555, 2561, 2572, - 2578, 2587, 2593, 2613, 2619, 2628, 2634, 2645, - 2651, 2660, 2666, 2691, 2697, 2706, 2712, 2723, - 2729, 2738, 2744, 2764, 2770, 2779, 2785, 2796, - 2802, 2811, 2817, 2840, 2846, 2855, 2861, 2872, - 2878, 2887, 2893, 2913, 2919, 2928, 2934, 2945, - 2951, 2960, 2966, 2991, 2997, 3006, 3012, 3023, - 3029, 3038, 3044, 3064, 3070, 3079, 3085, 3096, - 3102, 3111, 3117, 2981, 2987, 2996, 3002, 3013, - 3019, 3028, 3034, 3054, 3060, 3069, 3075, 3086, - 3092, 3101, 3107, 3132, 3138, 3147, 3153, 3164, - 3170, 3179, 3185, 3205, 3211, 3220, 3226, 3237, - 3243, 3252, 3258, 3281, 3287, 3296, 3302, 3313, - 3319, 3328, 3334, 3354, 3360, 3369, 3375, 3386, - 3392, 3401, 3407, 3432, 3438, 3447, 3453, 3464, - 3470, 3479, 3485, 3505, 3511, 3520, 3526, 3537, - 3543, 3552, 3558, 2816, 2822, 2831, 2837, 2848, - 2854, 2863, 2869, 2889, 2895, 2904, 2910, 2921, - 2927, 2936, 2942, 2967, 2973, 2982, 2988, 2999, - 3005, 3014, 3020, 3040, 3046, 3055, 3061, 3072, - 3078, 3087, 3093, 3116, 3122, 3131, 3137, 3148, - 3154, 3163, 3169, 3189, 3195, 3204, 3210, 3221, - 3227, 3236, 3242, 3267, 3273, 3282, 3288, 3299, - 3305, 3314, 3320, 3340, 3346, 3355, 3361, 3372, - 3378, 3387, 3393, 3257, 3263, 3272, 3278, 3289, - 3295, 3304, 3310, 3330, 3336, 3345, 3351, 3362, - 3368, 3377, 3383, 3408, 3414, 3423, 3429, 3440, - 3446, 3455, 3461, 3481, 3487, 3496, 3502, 3513, - 3519, 3528, 3534, 3557, 3563, 3572, 3578, 3589, - 3595, 3604, 3610, 3630, 3636, 3645, 3651, 3662, - 3668, 3677, 3683, 3708, 3714, 3723, 3729, 3740, - 3746, 3755, 3761, 3781, 3787, 3796, 3802, 3813, - 3819, 3828, 3834, 3629, 3635, 3644, 3650, 3661, - 3667, 3676, 3682, 3702, 3708, 3717, 3723, 3734, - 3740, 3749, 3755, 3780, 3786, 3795, 3801, 3812, - 3818, 3827, 3833, 3853, 3859, 3868, 3874, 3885, - 3891, 3900, 3906, 3929, 3935, 3944, 3950, 3961, - 3967, 3976, 3982, 4002, 4008, 4017, 4023, 4034, - 4040, 4049, 4055, 4080, 4086, 4095, 4101, 4112, - 4118, 4127, 4133, 4153, 4159, 4168, 4174, 4185, - 4191, 4200, 4206, 4070, 4076, 4085, 4091, 4102, - 4108, 4117, 4123, 4143, 4149, 4158, 4164, 4175, - 4181, 4190, 4196, 4221, 4227, 4236, 4242, 4253, - 4259, 4268, 4274, 4294, 4300, 4309, 4315, 4326, - 4332, 4341, 4347, 4370, 4376, 4385, 4391, 4402, - 4408, 4417, 4423, 4443, 4449, 4458, 4464, 4475, - 4481, 4490, 4496, 4521, 4527, 4536, 4542, 4553, - 4559, 4568, 4574, 4594, 4600, 4609, 4615, 4626, - 4632, 4641, 4647, 3515, 3521, 3530, 3536, 3547, - 3553, 3562, 3568, 3588, 3594, 3603, 3609, 3620, - 3626, 3635, 3641, 3666, 3672, 3681, 3687, 3698, - 3704, 3713, 3719, 3739, 3745, 3754, 3760, 3771, - 3777, 3786, 3792, 3815, 3821, 3830, 3836, 3847, - 3853, 3862, 3868, 3888, 3894, 3903, 3909, 3920, - 3926, 3935, 3941, 3966, 3972, 3981, 3987, 3998, - 4004, 4013, 4019, 4039, 4045, 4054, 4060, 4071, - 4077, 4086, 4092, 3956, 3962, 3971, 3977, 3988, - 3994, 4003, 4009, 4029, 4035, 4044, 4050, 4061, - 4067, 4076, 4082, 4107, 4113, 4122, 4128, 4139, - 4145, 4154, 4160, 4180, 4186, 4195, 4201, 4212, - 4218, 4227, 4233, 4256, 4262, 4271, 4277, 4288, - 4294, 4303, 4309, 4329, 4335, 4344, 4350, 4361, - 4367, 4376, 4382, 4407, 4413, 4422, 4428, 4439, - 4445, 4454, 4460, 4480, 4486, 4495, 4501, 4512, - 4518, 4527, 4533, 4328, 4334, 4343, 4349, 4360, - 4366, 4375, 4381, 4401, 4407, 4416, 4422, 4433, - 4439, 4448, 4454, 4479, 4485, 4494, 4500, 4511, - 4517, 4526, 4532, 4552, 4558, 4567, 4573, 4584, - 4590, 4599, 4605, 4628, 4634, 4643, 4649, 4660, - 4666, 4675, 4681, 4701, 4707, 4716, 4722, 4733, - 4739, 4748, 4754, 4779, 4785, 4794, 4800, 4811, - 4817, 4826, 4832, 4852, 4858, 4867, 4873, 4884, - 4890, 4899, 4905, 4769, 4775, 4784, 4790, 4801, - 4807, 4816, 4822, 4842, 4848, 4857, 4863, 4874, - 4880, 4889, 4895, 4920, 4926, 4935, 4941, 4952, - 4958, 4967, 4973, 4993, 4999, 5008, 5014, 5025, - 5031, 5040, 5046, 5069, 5075, 5084, 5090, 5101, - 5107, 5116, 5122, 5142, 5148, 5157, 5163, 5174, - 5180, 5189, 5195, 5220, 5226, 5235, 5241, 5252, - 5258, 5267, 5273, 5293, 5299, 5308, 5314, 5325, - 5331, 5340, 5346, 4604, 4610, 4619, 4625, 4636, - 4642, 4651, 4657, 4677, 4683, 4692, 4698, 4709, - 4715, 4724, 4730, 4755, 4761, 4770, 4776, 4787, - 4793, 4802, 4808, 4828, 4834, 4843, 4849, 4860, - 4866, 4875, 4881, 4904, 4910, 4919, 4925, 4936, - 4942, 4951, 4957, 4977, 4983, 4992, 4998, 5009, - 5015, 5024, 5030, 5055, 5061, 5070, 5076, 5087, - 5093, 5102, 5108, 5128, 5134, 5143, 5149, 5160, - 5166, 5175, 5181, 5045, 5051, 5060, 5066, 5077, - 5083, 5092, 5098, 5118, 5124, 5133, 5139, 5150, - 5156, 5165, 5171, 5196, 5202, 5211, 5217, 5228, - 5234, 5243, 5249, 5269, 5275, 5284, 5290, 5301, - 5307, 5316, 5322, 5345, 5351, 5360, 5366, 5377, - 5383, 5392, 5398, 5418, 5424, 5433, 5439, 5450, - 5456, 5465, 5471, 5496, 5502, 5511, 5517, 5528, - 5534, 5543, 5549, 5569, 5575, 5584, 5590, 5601, - 5607, 5616, 5622, 5417, 5423, 5432, 5438, 5449, - 5455, 5464, 5470, 5490, 5496, 5505, 5511, 5522, - 5528, 5537, 5543, 5568, 5574, 5583, 5589, 5600, - 5606, 5615, 5621, 5641, 5647, 5656, 5662, 5673, - 5679, 5688, 5694, 5717, 5723, 5732, 5738, 5749, - 5755, 5764, 5770, 5790, 5796, 5805, 5811, 5822, - 5828, 5837, 5843, 5868, 5874, 5883, 5889, 5900, - 5906, 5915, 5921, 5941, 5947, 5956, 5962, 5973, - 5979, 5988, 5994, 5858, 5864, 5873, 5879, 5890, - 5896, 5905, 5911, 5931, 5937, 5946, 5952, 5963, - 5969, 5978, 5984, 6009, 6015, 6024, 6030, 6041, - 6047, 6056, 6062, 6082, 6088, 6097, 6103, 6114, - 6120, 6129, 6135, 6158, 6164, 6173, 6179, 6190, - 6196, 6205, 6211, 6231, 6237, 6246, 6252, 6263, - 6269, 6278, 6284, 6309, 6315, 6324, 6330, 6341, - 6347, 6356, 6362, 6382, 6388, 6397, 6403, 6414, - 6420, 6429, 6435, 3515, 3521, 3530, 3536, 3547, - 3553, 3562, 3568, 3588, 3594, 3603, 3609, 3620, - 3626, 3635, 3641, 3666, 3672, 3681, 3687, 3698, - 3704, 3713, 3719, 3739, 3745, 3754, 3760, 3771, - 3777, 3786, 3792, 3815, 3821, 3830, 3836, 3847, - 3853, 3862, 3868, 3888, 3894, 3903, 3909, 3920, - 3926, 3935, 3941, 3966, 3972, 3981, 3987, 3998, - 4004, 4013, 4019, 4039, 4045, 4054, 4060, 4071, - 4077, 4086, 4092, 3956, 3962, 3971, 3977, 3988, - 3994, 4003, 4009, 4029, 4035, 4044, 4050, 4061, - 4067, 4076, 4082, 4107, 4113, 4122, 4128, 4139, - 4145, 4154, 4160, 4180, 4186, 4195, 4201, 4212, - 4218, 4227, 4233, 4256, 4262, 4271, 4277, 4288, - 4294, 4303, 4309, 4329, 4335, 4344, 4350, 4361, - 4367, 4376, 4382, 4407, 4413, 4422, 4428, 4439, - 4445, 4454, 4460, 4480, 4486, 4495, 4501, 4512, - 4518, 4527, 4533, 4328, 4334, 4343, 4349, 4360, - 4366, 4375, 4381, 4401, 4407, 4416, 4422, 4433, - 4439, 4448, 4454, 4479, 4485, 4494, 4500, 4511, - 4517, 4526, 4532, 4552, 4558, 4567, 4573, 4584, - 4590, 4599, 4605, 4628, 4634, 4643, 4649, 4660, - 4666, 4675, 4681, 4701, 4707, 4716, 4722, 4733, - 4739, 4748, 4754, 4779, 4785, 4794, 4800, 4811, - 4817, 4826, 4832, 4852, 4858, 4867, 4873, 4884, - 4890, 4899, 4905, 4769, 4775, 4784, 4790, 4801, - 4807, 4816, 4822, 4842, 4848, 4857, 4863, 4874, - 4880, 4889, 4895, 4920, 4926, 4935, 4941, 4952, - 4958, 4967, 4973, 4993, 4999, 5008, 5014, 5025, - 5031, 5040, 5046, 5069, 5075, 5084, 5090, 5101, - 5107, 5116, 5122, 5142, 5148, 5157, 5163, 5174, - 5180, 5189, 5195, 5220, 5226, 5235, 5241, 5252, - 5258, 5267, 5273, 5293, 5299, 5308, 5314, 5325, - 5331, 5340, 5346, 4604, 4610, 4619, 4625, 4636, - 4642, 4651, 4657, 4677, 4683, 4692, 4698, 4709, - 4715, 4724, 4730, 4755, 4761, 4770, 4776, 4787, - 4793, 4802, 4808, 4828, 4834, 4843, 4849, 4860, - 4866, 4875, 4881, 4904, 4910, 4919, 4925, 4936, - 4942, 4951, 4957, 4977, 4983, 4992, 4998, 5009, - 5015, 5024, 5030, 5055, 5061, 5070, 5076, 5087, - 5093, 5102, 5108, 5128, 5134, 5143, 5149, 5160, - 5166, 5175, 5181, 5045, 5051, 5060, 5066, 5077, - 5083, 5092, 5098, 5118, 5124, 5133, 5139, 5150, - 5156, 5165, 5171, 5196, 5202, 5211, 5217, 5228, - 5234, 5243, 5249, 5269, 5275, 5284, 5290, 5301, - 5307, 5316, 5322, 5345, 5351, 5360, 5366, 5377, - 5383, 5392, 5398, 5418, 5424, 5433, 5439, 5450, - 5456, 5465, 5471, 5496, 5502, 5511, 5517, 5528, - 5534, 5543, 5549, 5569, 5575, 5584, 5590, 5601, - 5607, 5616, 5622, 5417, 5423, 5432, 5438, 5449, - 5455, 5464, 5470, 5490, 5496, 5505, 5511, 5522, - 5528, 5537, 5543, 5568, 5574, 5583, 5589, 5600, - 5606, 5615, 5621, 5641, 5647, 5656, 5662, 5673, - 5679, 5688, 5694, 5717, 5723, 5732, 5738, 5749, - 5755, 5764, 5770, 5790, 5796, 5805, 5811, 5822, - 5828, 5837, 5843, 5868, 5874, 5883, 5889, 5900, - 5906, 5915, 5921, 5941, 5947, 5956, 5962, 5973, - 5979, 5988, 5994, 5858, 5864, 5873, 5879, 5890, - 5896, 5905, 5911, 5931, 5937, 5946, 5952, 5963, - 5969, 5978, 5984, 6009, 6015, 6024, 6030, 6041, - 6047, 6056, 6062, 6082, 6088, 6097, 6103, 6114, - 6120, 6129, 6135, 6158, 6164, 6173, 6179, 6190, - 6196, 6205, 6211, 6231, 6237, 6246, 6252, 6263, - 6269, 6278, 6284, 6309, 6315, 6324, 6330, 6341, - 6347, 6356, 6362, 6382, 6388, 6397, 6403, 6414, - 6420, 6429, 6435, 5303, 5309, 5318, 5324, 5335, - 5341, 5350, 5356, 5376, 5382, 5391, 5397, 5408, - 5414, 5423, 5429, 5454, 5460, 5469, 5475, 5486, - 5492, 5501, 5507, 5527, 5533, 5542, 5548, 5559, - 5565, 5574, 5580, 5603, 5609, 5618, 5624, 5635, - 5641, 5650, 5656, 5676, 5682, 5691, 5697, 5708, - 5714, 5723, 5729, 5754, 5760, 5769, 5775, 5786, - 5792, 5801, 5807, 5827, 5833, 5842, 5848, 5859, - 5865, 5874, 5880, 5744, 5750, 5759, 5765, 5776, - 5782, 5791, 5797, 5817, 5823, 5832, 5838, 5849, - 5855, 5864, 5870, 5895, 5901, 5910, 5916, 5927, - 5933, 5942, 5948, 5968, 5974, 5983, 5989, 6000, - 6006, 6015, 6021, 6044, 6050, 6059, 6065, 6076, - 6082, 6091, 6097, 6117, 6123, 6132, 6138, 6149, - 6155, 6164, 6170, 6195, 6201, 6210, 6216, 6227, - 6233, 6242, 6248, 6268, 6274, 6283, 6289, 6300, - 6306, 6315, 6321, 6116, 6122, 6131, 6137, 6148, - 6154, 6163, 6169, 6189, 6195, 6204, 6210, 6221, - 6227, 6236, 6242, 6267, 6273, 6282, 6288, 6299, - 6305, 6314, 6320, 6340, 6346, 6355, 6361, 6372, - 6378, 6387, 6393, 6416, 6422, 6431, 6437, 6448, - 6454, 6463, 6469, 6489, 6495, 6504, 6510, 6521, - 6527, 6536, 6542, 6567, 6573, 6582, 6588, 6599, - 6605, 6614, 6620, 6640, 6646, 6655, 6661, 6672, - 6678, 6687, 6693, 6557, 6563, 6572, 6578, 6589, - 6595, 6604, 6610, 6630, 6636, 6645, 6651, 6662, - 6668, 6677, 6683, 6708, 6714, 6723, 6729, 6740, - 6746, 6755, 6761, 6781, 6787, 6796, 6802, 6813, - 6819, 6828, 6834, 6857, 6863, 6872, 6878, 6889, - 6895, 6904, 6910, 6930, 6936, 6945, 6951, 6962, - 6968, 6977, 6983, 7008, 7014, 7023, 7029, 7040, - 7046, 7055, 7061, 7081, 7087, 7096, 7102, 7113, - 7119, 7128, 7134, 6392, 6398, 6407, 6413, 6424, - 6430, 6439, 6445, 6465, 6471, 6480, 6486, 6497, - 6503, 6512, 6518, 6543, 6549, 6558, 6564, 6575, - 6581, 6590, 6596, 6616, 6622, 6631, 6637, 6648, - 6654, 6663, 6669, 6692, 6698, 6707, 6713, 6724, - 6730, 6739, 6745, 6765, 6771, 6780, 6786, 6797, - 6803, 6812, 6818, 6843, 6849, 6858, 6864, 6875, - 6881, 6890, 6896, 6916, 6922, 6931, 6937, 6948, - 6954, 6963, 6969, 6833, 6839, 6848, 6854, 6865, - 6871, 6880, 6886, 6906, 6912, 6921, 6927, 6938, - 6944, 6953, 6959, 6984, 6990, 6999, 7005, 7016, - 7022, 7031, 7037, 7057, 7063, 7072, 7078, 7089, - 7095, 7104, 7110, 7133, 7139, 7148, 7154, 7165, - 7171, 7180, 7186, 7206, 7212, 7221, 7227, 7238, - 7244, 7253, 7259, 7284, 7290, 7299, 7305, 7316, - 7322, 7331, 7337, 7357, 7363, 7372, 7378, 7389, - 7395, 7404, 7410, 7205, 7211, 7220, 7226, 7237, - 7243, 7252, 7258, 7278, 7284, 7293, 7299, 7310, - 7316, 7325, 7331, 7356, 7362, 7371, 7377, 7388, - 7394, 7403, 7409, 7429, 7435, 7444, 7450, 7461, - 7467, 7476, 7482, 7505, 7511, 7520, 7526, 7537, - 7543, 7552, 7558, 7578, 7584, 7593, 7599, 7610, - 7616, 7625, 7631, 7656, 7662, 7671, 7677, 7688, - 7694, 7703, 7709, 7729, 7735, 7744, 7750, 7761 -}; - -static int VariableLevelCost(int level, const uint8_t probas[NUM_PROBAS]) { - int pattern = VP8LevelCodes[level - 1][0]; - int bits = VP8LevelCodes[level - 1][1]; - int cost = 0; - int i; - for (i = 2; pattern; ++i) { - if (pattern & 1) { - cost += VP8BitCost(bits & 1, probas[i]); - } - bits >>= 1; - pattern >>= 1; - } - return cost; -} - -//------------------------------------------------------------------------------ -// Pre-calc level costs once for all - -void VP8CalculateLevelCosts(VP8Proba* const proba) { - int ctype, band, ctx; - - if (!proba->dirty_) return; // nothing to do. - - for (ctype = 0; ctype < NUM_TYPES; ++ctype) { - for (band = 0; band < NUM_BANDS; ++band) { - for(ctx = 0; ctx < NUM_CTX; ++ctx) { - const uint8_t* const p = proba->coeffs_[ctype][band][ctx]; - uint16_t* const table = proba->level_cost_[ctype][band][ctx]; - const int cost_base = VP8BitCost(1, p[1]); - int v; - table[0] = VP8BitCost(0, p[1]); - for (v = 1; v <= MAX_VARIABLE_LEVEL; ++v) { - table[v] = cost_base + VariableLevelCost(v, p); - } - // Starting at level 67 and up, the variable part of the cost is - // actually constant. - } - } - } - proba->dirty_ = 0; -} - -//------------------------------------------------------------------------------ -// Mode cost tables. - -// These are the fixed probabilities (in the coding trees) turned into bit-cost -// by calling VP8BitCost(). -const uint16_t VP8FixedCostsUV[4] = { 302, 984, 439, 642 }; -// note: these values include the fixed VP8BitCost(1, 145) mode selection cost. -const uint16_t VP8FixedCostsI16[4] = { 663, 919, 872, 919 }; -const uint16_t VP8FixedCostsI4[NUM_BMODES][NUM_BMODES][NUM_BMODES] = { - { { 251, 1362, 1934, 2085, 2314, 2230, 1839, 1988, 2437, 2348 }, - { 403, 680, 1507, 1519, 2060, 2005, 1992, 1914, 1924, 1733 }, - { 353, 1121, 973, 1895, 2060, 1787, 1671, 1516, 2012, 1868 }, - { 770, 852, 1581, 632, 1393, 1780, 1823, 1936, 1074, 1218 }, - { 510, 1270, 1467, 1319, 847, 1279, 1792, 2094, 1080, 1353 }, - { 488, 1322, 918, 1573, 1300, 883, 1814, 1752, 1756, 1502 }, - { 425, 992, 1820, 1514, 1843, 2440, 937, 1771, 1924, 1129 }, - { 363, 1248, 1257, 1970, 2194, 2385, 1569, 953, 1951, 1601 }, - { 723, 1257, 1631, 964, 963, 1508, 1697, 1824, 671, 1418 }, - { 635, 1038, 1573, 930, 1673, 1413, 1410, 1687, 1410, 749 } }, - { { 451, 613, 1345, 1702, 1870, 1716, 1728, 1766, 2190, 2310 }, - { 678, 453, 1171, 1443, 1925, 1831, 2045, 1781, 1887, 1602 }, - { 711, 666, 674, 1718, 1910, 1493, 1775, 1193, 2325, 2325 }, - { 883, 854, 1583, 542, 1800, 1878, 1664, 2149, 1207, 1087 }, - { 669, 994, 1248, 1122, 949, 1179, 1376, 1729, 1070, 1244 }, - { 715, 1026, 715, 1350, 1430, 930, 1717, 1296, 1479, 1479 }, - { 544, 841, 1656, 1450, 2094, 3883, 1010, 1759, 2076, 809 }, - { 610, 855, 957, 1553, 2067, 1561, 1704, 824, 2066, 1226 }, - { 833, 960, 1416, 819, 1277, 1619, 1501, 1617, 757, 1182 }, - { 711, 964, 1252, 879, 1441, 1828, 1508, 1636, 1594, 734 } }, - { { 605, 764, 734, 1713, 1747, 1192, 1819, 1353, 1877, 2392 }, - { 866, 641, 586, 1622, 2072, 1431, 1888, 1346, 2189, 1764 }, - { 901, 851, 456, 2165, 2281, 1405, 1739, 1193, 2183, 2443 }, - { 770, 1045, 952, 1078, 1342, 1191, 1436, 1063, 1303, 995 }, - { 901, 1086, 727, 1170, 884, 1105, 1267, 1401, 1739, 1337 }, - { 951, 1162, 595, 1488, 1388, 703, 1790, 1366, 2057, 1724 }, - { 534, 986, 1273, 1987, 3273, 1485, 1024, 1399, 1583, 866 }, - { 699, 1182, 695, 1978, 1726, 1986, 1326, 714, 1750, 1672 }, - { 951, 1217, 1209, 920, 1062, 1441, 1548, 999, 952, 932 }, - { 733, 1284, 784, 1256, 1557, 1098, 1257, 1357, 1414, 908 } }, - { { 316, 1075, 1653, 1220, 2145, 2051, 1730, 2131, 1884, 1790 }, - { 745, 516, 1404, 894, 1599, 2375, 2013, 2105, 1475, 1381 }, - { 516, 729, 1088, 1319, 1637, 3426, 1636, 1275, 1531, 1453 }, - { 894, 943, 2138, 468, 1704, 2259, 2069, 1763, 1266, 1158 }, - { 605, 1025, 1235, 871, 1170, 1767, 1493, 1500, 1104, 1258 }, - { 739, 826, 1207, 1151, 1412, 846, 1305, 2726, 1014, 1569 }, - { 558, 825, 1820, 1398, 3344, 1556, 1218, 1550, 1228, 878 }, - { 429, 951, 1089, 1816, 3861, 3861, 1556, 969, 1568, 1828 }, - { 883, 961, 1752, 769, 1468, 1810, 2081, 2346, 613, 1298 }, - { 803, 895, 1372, 641, 1303, 1708, 1686, 1700, 1306, 1033 } }, - { { 439, 1267, 1270, 1579, 963, 1193, 1723, 1729, 1198, 1993 }, - { 705, 725, 1029, 1153, 1176, 1103, 1821, 1567, 1259, 1574 }, - { 723, 859, 802, 1253, 972, 1202, 1407, 1665, 1520, 1674 }, - { 894, 960, 1254, 887, 1052, 1607, 1344, 1349, 865, 1150 }, - { 833, 1312, 1337, 1205, 572, 1288, 1414, 1529, 1088, 1430 }, - { 842, 1279, 1068, 1861, 862, 688, 1861, 1630, 1039, 1381 }, - { 766, 938, 1279, 1546, 3338, 1550, 1031, 1542, 1288, 640 }, - { 715, 1090, 835, 1609, 1100, 1100, 1603, 1019, 1102, 1617 }, - { 894, 1813, 1500, 1188, 789, 1194, 1491, 1919, 617, 1333 }, - { 610, 1076, 1644, 1281, 1283, 975, 1179, 1688, 1434, 889 } }, - { { 544, 971, 1146, 1849, 1221, 740, 1857, 1621, 1683, 2430 }, - { 723, 705, 961, 1371, 1426, 821, 2081, 2079, 1839, 1380 }, - { 783, 857, 703, 2145, 1419, 814, 1791, 1310, 1609, 2206 }, - { 997, 1000, 1153, 792, 1229, 1162, 1810, 1418, 942, 979 }, - { 901, 1226, 883, 1289, 793, 715, 1904, 1649, 1319, 3108 }, - { 979, 1478, 782, 2216, 1454, 455, 3092, 1591, 1997, 1664 }, - { 663, 1110, 1504, 1114, 1522, 3311, 676, 1522, 1530, 1024 }, - { 605, 1138, 1153, 1314, 1569, 1315, 1157, 804, 1574, 1320 }, - { 770, 1216, 1218, 1227, 869, 1384, 1232, 1375, 834, 1239 }, - { 775, 1007, 843, 1216, 1225, 1074, 2527, 1479, 1149, 975 } }, - { { 477, 817, 1309, 1439, 1708, 1454, 1159, 1241, 1945, 1672 }, - { 577, 796, 1112, 1271, 1618, 1458, 1087, 1345, 1831, 1265 }, - { 663, 776, 753, 1940, 1690, 1690, 1227, 1097, 3149, 1361 }, - { 766, 1299, 1744, 1161, 1565, 1106, 1045, 1230, 1232, 707 }, - { 915, 1026, 1404, 1182, 1184, 851, 1428, 2425, 1043, 789 }, - { 883, 1456, 790, 1082, 1086, 985, 1083, 1484, 1238, 1160 }, - { 507, 1345, 2261, 1995, 1847, 3636, 653, 1761, 2287, 933 }, - { 553, 1193, 1470, 2057, 2059, 2059, 833, 779, 2058, 1263 }, - { 766, 1275, 1515, 1039, 957, 1554, 1286, 1540, 1289, 705 }, - { 499, 1378, 1496, 1385, 1850, 1850, 1044, 2465, 1515, 720 } }, - { { 553, 930, 978, 2077, 1968, 1481, 1457, 761, 1957, 2362 }, - { 694, 864, 905, 1720, 1670, 1621, 1429, 718, 2125, 1477 }, - { 699, 968, 658, 3190, 2024, 1479, 1865, 750, 2060, 2320 }, - { 733, 1308, 1296, 1062, 1576, 1322, 1062, 1112, 1172, 816 }, - { 920, 927, 1052, 939, 947, 1156, 1152, 1073, 3056, 1268 }, - { 723, 1534, 711, 1547, 1294, 892, 1553, 928, 1815, 1561 }, - { 663, 1366, 1583, 2111, 1712, 3501, 522, 1155, 2130, 1133 }, - { 614, 1731, 1188, 2343, 1944, 3733, 1287, 487, 3546, 1758 }, - { 770, 1585, 1312, 826, 884, 2673, 1185, 1006, 1195, 1195 }, - { 758, 1333, 1273, 1023, 1621, 1162, 1351, 833, 1479, 862 } }, - { { 376, 1193, 1446, 1149, 1545, 1577, 1870, 1789, 1175, 1823 }, - { 803, 633, 1136, 1058, 1350, 1323, 1598, 2247, 1072, 1252 }, - { 614, 1048, 943, 981, 1152, 1869, 1461, 1020, 1618, 1618 }, - { 1107, 1085, 1282, 592, 1779, 1933, 1648, 2403, 691, 1246 }, - { 851, 1309, 1223, 1243, 895, 1593, 1792, 2317, 627, 1076 }, - { 770, 1216, 1030, 1125, 921, 981, 1629, 1131, 1049, 1646 }, - { 626, 1469, 1456, 1081, 1489, 3278, 981, 1232, 1498, 733 }, - { 617, 1201, 812, 1220, 1476, 1476, 1478, 970, 1228, 1488 }, - { 1179, 1393, 1540, 999, 1243, 1503, 1916, 1925, 414, 1614 }, - { 943, 1088, 1490, 682, 1112, 1372, 1756, 1505, 966, 966 } }, - { { 322, 1142, 1589, 1396, 2144, 1859, 1359, 1925, 2084, 1518 }, - { 617, 625, 1241, 1234, 2121, 1615, 1524, 1858, 1720, 1004 }, - { 553, 851, 786, 1299, 1452, 1560, 1372, 1561, 1967, 1713 }, - { 770, 977, 1396, 568, 1893, 1639, 1540, 2108, 1430, 1013 }, - { 684, 1120, 1375, 982, 930, 2719, 1638, 1643, 933, 993 }, - { 553, 1103, 996, 1356, 1361, 1005, 1507, 1761, 1184, 1268 }, - { 419, 1247, 1537, 1554, 1817, 3606, 1026, 1666, 1829, 923 }, - { 439, 1139, 1101, 1257, 3710, 1922, 1205, 1040, 1931, 1529 }, - { 979, 935, 1269, 847, 1202, 1286, 1530, 1535, 827, 1036 }, - { 516, 1378, 1569, 1110, 1798, 1798, 1198, 2199, 1543, 712 } }, -}; - -//------------------------------------------------------------------------------ - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif diff --git a/external/libwebp/enc/cost.h b/external/libwebp/enc/cost.h deleted file mode 100644 index 09b75b699d..0000000000 --- a/external/libwebp/enc/cost.h +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2011 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Cost tables for level and modes. -// -// Author: Skal (pascal.massimino@gmail.com) - -#ifndef WEBP_ENC_COST_H_ -#define WEBP_ENC_COST_H_ - -#include "./vp8enci.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -extern const uint16_t VP8LevelFixedCosts[2048]; // approximate cost per level -extern const uint16_t VP8EntropyCost[256]; // 8bit fixed-point log(p) - -// Cost of coding one event with probability 'proba'. -static WEBP_INLINE int VP8BitCost(int bit, uint8_t proba) { - return !bit ? VP8EntropyCost[proba] : VP8EntropyCost[255 - proba]; -} - -// Level cost calculations -extern const uint16_t VP8LevelCodes[MAX_VARIABLE_LEVEL][2]; -void VP8CalculateLevelCosts(VP8Proba* const proba); -static WEBP_INLINE int VP8LevelCost(const uint16_t* const table, int level) { - return VP8LevelFixedCosts[level] - + table[(level > MAX_VARIABLE_LEVEL) ? MAX_VARIABLE_LEVEL : level]; -} - -// Mode costs -extern const uint16_t VP8FixedCostsUV[4]; -extern const uint16_t VP8FixedCostsI16[4]; -extern const uint16_t VP8FixedCostsI4[NUM_BMODES][NUM_BMODES][NUM_BMODES]; - -//------------------------------------------------------------------------------ - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif - -#endif /* WEBP_ENC_COST_H_ */ diff --git a/external/libwebp/enc/filter.c b/external/libwebp/enc/filter.c deleted file mode 100644 index 7fb78a3949..0000000000 --- a/external/libwebp/enc/filter.c +++ /dev/null @@ -1,409 +0,0 @@ -// Copyright 2011 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Selecting filter level -// -// Author: somnath@google.com (Somnath Banerjee) - -#include "./vp8enci.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -// NOTE: clip1, tables and InitTables are repeated entries of dsp.c -static uint8_t abs0[255 + 255 + 1]; // abs(i) -static uint8_t abs1[255 + 255 + 1]; // abs(i)>>1 -static int8_t sclip1[1020 + 1020 + 1]; // clips [-1020, 1020] to [-128, 127] -static int8_t sclip2[112 + 112 + 1]; // clips [-112, 112] to [-16, 15] -static uint8_t clip1[255 + 510 + 1]; // clips [-255,510] to [0,255] - -static int tables_ok = 0; - -static void InitTables(void) { - if (!tables_ok) { - int i; - for (i = -255; i <= 255; ++i) { - abs0[255 + i] = (i < 0) ? -i : i; - abs1[255 + i] = abs0[255 + i] >> 1; - } - for (i = -1020; i <= 1020; ++i) { - sclip1[1020 + i] = (i < -128) ? -128 : (i > 127) ? 127 : i; - } - for (i = -112; i <= 112; ++i) { - sclip2[112 + i] = (i < -16) ? -16 : (i > 15) ? 15 : i; - } - for (i = -255; i <= 255 + 255; ++i) { - clip1[255 + i] = (i < 0) ? 0 : (i > 255) ? 255 : i; - } - tables_ok = 1; - } -} - -//------------------------------------------------------------------------------ -// Edge filtering functions - -// 4 pixels in, 2 pixels out -static WEBP_INLINE void do_filter2(uint8_t* p, int step) { - const int p1 = p[-2*step], p0 = p[-step], q0 = p[0], q1 = p[step]; - const int a = 3 * (q0 - p0) + sclip1[1020 + p1 - q1]; - const int a1 = sclip2[112 + ((a + 4) >> 3)]; - const int a2 = sclip2[112 + ((a + 3) >> 3)]; - p[-step] = clip1[255 + p0 + a2]; - p[ 0] = clip1[255 + q0 - a1]; -} - -// 4 pixels in, 4 pixels out -static WEBP_INLINE void do_filter4(uint8_t* p, int step) { - const int p1 = p[-2*step], p0 = p[-step], q0 = p[0], q1 = p[step]; - const int a = 3 * (q0 - p0); - const int a1 = sclip2[112 + ((a + 4) >> 3)]; - const int a2 = sclip2[112 + ((a + 3) >> 3)]; - const int a3 = (a1 + 1) >> 1; - p[-2*step] = clip1[255 + p1 + a3]; - p[- step] = clip1[255 + p0 + a2]; - p[ 0] = clip1[255 + q0 - a1]; - p[ step] = clip1[255 + q1 - a3]; -} - -// high edge-variance -static WEBP_INLINE int hev(const uint8_t* p, int step, int thresh) { - const int p1 = p[-2*step], p0 = p[-step], q0 = p[0], q1 = p[step]; - return (abs0[255 + p1 - p0] > thresh) || (abs0[255 + q1 - q0] > thresh); -} - -static WEBP_INLINE int needs_filter(const uint8_t* p, int step, int thresh) { - const int p1 = p[-2*step], p0 = p[-step], q0 = p[0], q1 = p[step]; - return (2 * abs0[255 + p0 - q0] + abs1[255 + p1 - q1]) <= thresh; -} - -static WEBP_INLINE int needs_filter2(const uint8_t* p, - int step, int t, int it) { - const int p3 = p[-4*step], p2 = p[-3*step], p1 = p[-2*step], p0 = p[-step]; - const int q0 = p[0], q1 = p[step], q2 = p[2*step], q3 = p[3*step]; - if ((2 * abs0[255 + p0 - q0] + abs1[255 + p1 - q1]) > t) - return 0; - return abs0[255 + p3 - p2] <= it && abs0[255 + p2 - p1] <= it && - abs0[255 + p1 - p0] <= it && abs0[255 + q3 - q2] <= it && - abs0[255 + q2 - q1] <= it && abs0[255 + q1 - q0] <= it; -} - -//------------------------------------------------------------------------------ -// Simple In-loop filtering (Paragraph 15.2) - -static void SimpleVFilter16(uint8_t* p, int stride, int thresh) { - int i; - for (i = 0; i < 16; ++i) { - if (needs_filter(p + i, stride, thresh)) { - do_filter2(p + i, stride); - } - } -} - -static void SimpleHFilter16(uint8_t* p, int stride, int thresh) { - int i; - for (i = 0; i < 16; ++i) { - if (needs_filter(p + i * stride, 1, thresh)) { - do_filter2(p + i * stride, 1); - } - } -} - -static void SimpleVFilter16i(uint8_t* p, int stride, int thresh) { - int k; - for (k = 3; k > 0; --k) { - p += 4 * stride; - SimpleVFilter16(p, stride, thresh); - } -} - -static void SimpleHFilter16i(uint8_t* p, int stride, int thresh) { - int k; - for (k = 3; k > 0; --k) { - p += 4; - SimpleHFilter16(p, stride, thresh); - } -} - -//------------------------------------------------------------------------------ -// Complex In-loop filtering (Paragraph 15.3) - -static WEBP_INLINE void FilterLoop24(uint8_t* p, - int hstride, int vstride, int size, - int thresh, int ithresh, int hev_thresh) { - while (size-- > 0) { - if (needs_filter2(p, hstride, thresh, ithresh)) { - if (hev(p, hstride, hev_thresh)) { - do_filter2(p, hstride); - } else { - do_filter4(p, hstride); - } - } - p += vstride; - } -} - -// on three inner edges -static void VFilter16i(uint8_t* p, int stride, - int thresh, int ithresh, int hev_thresh) { - int k; - for (k = 3; k > 0; --k) { - p += 4 * stride; - FilterLoop24(p, stride, 1, 16, thresh, ithresh, hev_thresh); - } -} - -static void HFilter16i(uint8_t* p, int stride, - int thresh, int ithresh, int hev_thresh) { - int k; - for (k = 3; k > 0; --k) { - p += 4; - FilterLoop24(p, 1, stride, 16, thresh, ithresh, hev_thresh); - } -} - -static void VFilter8i(uint8_t* u, uint8_t* v, int stride, - int thresh, int ithresh, int hev_thresh) { - FilterLoop24(u + 4 * stride, stride, 1, 8, thresh, ithresh, hev_thresh); - FilterLoop24(v + 4 * stride, stride, 1, 8, thresh, ithresh, hev_thresh); -} - -static void HFilter8i(uint8_t* u, uint8_t* v, int stride, - int thresh, int ithresh, int hev_thresh) { - FilterLoop24(u + 4, 1, stride, 8, thresh, ithresh, hev_thresh); - FilterLoop24(v + 4, 1, stride, 8, thresh, ithresh, hev_thresh); -} - -//------------------------------------------------------------------------------ - -void (*VP8EncVFilter16i)(uint8_t*, int, int, int, int) = VFilter16i; -void (*VP8EncHFilter16i)(uint8_t*, int, int, int, int) = HFilter16i; -void (*VP8EncVFilter8i)(uint8_t*, uint8_t*, int, int, int, int) = VFilter8i; -void (*VP8EncHFilter8i)(uint8_t*, uint8_t*, int, int, int, int) = HFilter8i; - -void (*VP8EncSimpleVFilter16i)(uint8_t*, int, int) = SimpleVFilter16i; -void (*VP8EncSimpleHFilter16i)(uint8_t*, int, int) = SimpleHFilter16i; - -//------------------------------------------------------------------------------ -// Paragraph 15.4: compute the inner-edge filtering strength - -static int GetILevel(int sharpness, int level) { - if (sharpness > 0) { - if (sharpness > 4) { - level >>= 2; - } else { - level >>= 1; - } - if (level > 9 - sharpness) { - level = 9 - sharpness; - } - } - if (level < 1) level = 1; - return level; -} - -static void DoFilter(const VP8EncIterator* const it, int level) { - const VP8Encoder* const enc = it->enc_; - const int ilevel = GetILevel(enc->config_->filter_sharpness, level); - const int limit = 2 * level + ilevel; - - uint8_t* const y_dst = it->yuv_out2_ + Y_OFF; - uint8_t* const u_dst = it->yuv_out2_ + U_OFF; - uint8_t* const v_dst = it->yuv_out2_ + V_OFF; - - // copy current block to yuv_out2_ - memcpy(y_dst, it->yuv_out_, YUV_SIZE * sizeof(uint8_t)); - - if (enc->filter_hdr_.simple_ == 1) { // simple - VP8EncSimpleHFilter16i(y_dst, BPS, limit); - VP8EncSimpleVFilter16i(y_dst, BPS, limit); - } else { // complex - const int hev_thresh = (level >= 40) ? 2 : (level >= 15) ? 1 : 0; - VP8EncHFilter16i(y_dst, BPS, limit, ilevel, hev_thresh); - VP8EncHFilter8i(u_dst, v_dst, BPS, limit, ilevel, hev_thresh); - VP8EncVFilter16i(y_dst, BPS, limit, ilevel, hev_thresh); - VP8EncVFilter8i(u_dst, v_dst, BPS, limit, ilevel, hev_thresh); - } -} - -//------------------------------------------------------------------------------ -// SSIM metric - -enum { KERNEL = 3 }; -static const double kMinValue = 1.e-10; // minimal threshold - -void VP8SSIMAddStats(const DistoStats* const src, DistoStats* const dst) { - dst->w += src->w; - dst->xm += src->xm; - dst->ym += src->ym; - dst->xxm += src->xxm; - dst->xym += src->xym; - dst->yym += src->yym; -} - -static void VP8SSIMAccumulate(const uint8_t* src1, int stride1, - const uint8_t* src2, int stride2, - int xo, int yo, int W, int H, - DistoStats* const stats) { - const int ymin = (yo - KERNEL < 0) ? 0 : yo - KERNEL; - const int ymax = (yo + KERNEL > H - 1) ? H - 1 : yo + KERNEL; - const int xmin = (xo - KERNEL < 0) ? 0 : xo - KERNEL; - const int xmax = (xo + KERNEL > W - 1) ? W - 1 : xo + KERNEL; - int x, y; - src1 += ymin * stride1; - src2 += ymin * stride2; - for (y = ymin; y <= ymax; ++y, src1 += stride1, src2 += stride2) { - for (x = xmin; x <= xmax; ++x) { - const int s1 = src1[x]; - const int s2 = src2[x]; - stats->w += 1; - stats->xm += s1; - stats->ym += s2; - stats->xxm += s1 * s1; - stats->xym += s1 * s2; - stats->yym += s2 * s2; - } - } -} - -double VP8SSIMGet(const DistoStats* const stats) { - const double xmxm = stats->xm * stats->xm; - const double ymym = stats->ym * stats->ym; - const double xmym = stats->xm * stats->ym; - const double w2 = stats->w * stats->w; - double sxx = stats->xxm * stats->w - xmxm; - double syy = stats->yym * stats->w - ymym; - double sxy = stats->xym * stats->w - xmym; - double C1, C2; - double fnum; - double fden; - // small errors are possible, due to rounding. Clamp to zero. - if (sxx < 0.) sxx = 0.; - if (syy < 0.) syy = 0.; - C1 = 6.5025 * w2; - C2 = 58.5225 * w2; - fnum = (2 * xmym + C1) * (2 * sxy + C2); - fden = (xmxm + ymym + C1) * (sxx + syy + C2); - return (fden != 0.) ? fnum / fden : kMinValue; -} - -double VP8SSIMGetSquaredError(const DistoStats* const s) { - if (s->w > 0.) { - const double iw2 = 1. / (s->w * s->w); - const double sxx = s->xxm * s->w - s->xm * s->xm; - const double syy = s->yym * s->w - s->ym * s->ym; - const double sxy = s->xym * s->w - s->xm * s->ym; - const double SSE = iw2 * (sxx + syy - 2. * sxy); - if (SSE > kMinValue) return SSE; - } - return kMinValue; -} - -void VP8SSIMAccumulatePlane(const uint8_t* src1, int stride1, - const uint8_t* src2, int stride2, - int W, int H, DistoStats* const stats) { - int x, y; - for (y = 0; y < H; ++y) { - for (x = 0; x < W; ++x) { - VP8SSIMAccumulate(src1, stride1, src2, stride2, x, y, W, H, stats); - } - } -} - -static double GetMBSSIM(const uint8_t* yuv1, const uint8_t* yuv2) { - int x, y; - DistoStats s = { .0, .0, .0, .0, .0, .0 }; - - // compute SSIM in a 10 x 10 window - for (x = 3; x < 13; x++) { - for (y = 3; y < 13; y++) { - VP8SSIMAccumulate(yuv1 + Y_OFF, BPS, yuv2 + Y_OFF, BPS, x, y, 16, 16, &s); - } - } - for (x = 1; x < 7; x++) { - for (y = 1; y < 7; y++) { - VP8SSIMAccumulate(yuv1 + U_OFF, BPS, yuv2 + U_OFF, BPS, x, y, 8, 8, &s); - VP8SSIMAccumulate(yuv1 + V_OFF, BPS, yuv2 + V_OFF, BPS, x, y, 8, 8, &s); - } - } - return VP8SSIMGet(&s); -} - -//------------------------------------------------------------------------------ -// Exposed APIs: Encoder should call the following 3 functions to adjust -// loop filter strength - -void VP8InitFilter(VP8EncIterator* const it) { - int s, i; - if (!it->lf_stats_) return; - - InitTables(); - for (s = 0; s < NUM_MB_SEGMENTS; s++) { - for (i = 0; i < MAX_LF_LEVELS; i++) { - (*it->lf_stats_)[s][i] = 0; - } - } -} - -void VP8StoreFilterStats(VP8EncIterator* const it) { - int d; - const int s = it->mb_->segment_; - const int level0 = it->enc_->dqm_[s].fstrength_; // TODO: ref_lf_delta[] - - // explore +/-quant range of values around level0 - const int delta_min = -it->enc_->dqm_[s].quant_; - const int delta_max = it->enc_->dqm_[s].quant_; - const int step_size = (delta_max - delta_min >= 4) ? 4 : 1; - - if (!it->lf_stats_) return; - - // NOTE: Currently we are applying filter only across the sublock edges - // There are two reasons for that. - // 1. Applying filter on macro block edges will change the pixels in - // the left and top macro blocks. That will be hard to restore - // 2. Macro Blocks on the bottom and right are not yet compressed. So we - // cannot apply filter on the right and bottom macro block edges. - if (it->mb_->type_ == 1 && it->mb_->skip_) return; - - // Always try filter level zero - (*it->lf_stats_)[s][0] += GetMBSSIM(it->yuv_in_, it->yuv_out_); - - for (d = delta_min; d <= delta_max; d += step_size) { - const int level = level0 + d; - if (level <= 0 || level >= MAX_LF_LEVELS) { - continue; - } - DoFilter(it, level); - (*it->lf_stats_)[s][level] += GetMBSSIM(it->yuv_in_, it->yuv_out2_); - } -} - -void VP8AdjustFilterStrength(VP8EncIterator* const it) { - int s; - VP8Encoder* const enc = it->enc_; - - if (!it->lf_stats_) { - return; - } - for (s = 0; s < NUM_MB_SEGMENTS; s++) { - int i, best_level = 0; - // Improvement over filter level 0 should be at least 1e-5 (relatively) - double best_v = 1.00001 * (*it->lf_stats_)[s][0]; - for (i = 1; i < MAX_LF_LEVELS; i++) { - const double v = (*it->lf_stats_)[s][i]; - if (v > best_v) { - best_v = v; - best_level = i; - } - } - enc->dqm_[s].fstrength_ = best_level; - } -} - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif diff --git a/external/libwebp/enc/frame.c b/external/libwebp/enc/frame.c deleted file mode 100644 index bdd360069b..0000000000 --- a/external/libwebp/enc/frame.c +++ /dev/null @@ -1,939 +0,0 @@ -// Copyright 2011 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// frame coding and analysis -// -// Author: Skal (pascal.massimino@gmail.com) - -#include <assert.h> -#include <stdlib.h> -#include <string.h> -#include <math.h> - -#include "./vp8enci.h" -#include "./cost.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -#define SEGMENT_VISU 0 -#define DEBUG_SEARCH 0 // useful to track search convergence - -// On-the-fly info about the current set of residuals. Handy to avoid -// passing zillions of params. -typedef struct { - int first; - int last; - const int16_t* coeffs; - - int coeff_type; - ProbaArray* prob; - StatsArray* stats; - CostArray* cost; -} VP8Residual; - -//------------------------------------------------------------------------------ -// Tables for level coding - -const uint8_t VP8EncBands[16 + 1] = { - 0, 1, 2, 3, 6, 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7, - 0 // sentinel -}; - -static const uint8_t kCat3[] = { 173, 148, 140 }; -static const uint8_t kCat4[] = { 176, 155, 140, 135 }; -static const uint8_t kCat5[] = { 180, 157, 141, 134, 130 }; -static const uint8_t kCat6[] = - { 254, 254, 243, 230, 196, 177, 153, 140, 133, 130, 129 }; - -//------------------------------------------------------------------------------ -// Reset the statistics about: number of skips, token proba, level cost,... - -static void ResetStats(VP8Encoder* const enc) { - VP8Proba* const proba = &enc->proba_; - VP8CalculateLevelCosts(proba); - proba->nb_skip_ = 0; -} - -//------------------------------------------------------------------------------ -// Skip decision probability - -#define SKIP_PROBA_THRESHOLD 250 // value below which using skip_proba is OK. - -static int CalcSkipProba(uint64_t nb, uint64_t total) { - return (int)(total ? (total - nb) * 255 / total : 255); -} - -// Returns the bit-cost for coding the skip probability. -static int FinalizeSkipProba(VP8Encoder* const enc) { - VP8Proba* const proba = &enc->proba_; - const int nb_mbs = enc->mb_w_ * enc->mb_h_; - const int nb_events = proba->nb_skip_; - int size; - proba->skip_proba_ = CalcSkipProba(nb_events, nb_mbs); - proba->use_skip_proba_ = (proba->skip_proba_ < SKIP_PROBA_THRESHOLD); - size = 256; // 'use_skip_proba' bit - if (proba->use_skip_proba_) { - size += nb_events * VP8BitCost(1, proba->skip_proba_) - + (nb_mbs - nb_events) * VP8BitCost(0, proba->skip_proba_); - size += 8 * 256; // cost of signaling the skip_proba_ itself. - } - return size; -} - -//------------------------------------------------------------------------------ -// Recording of token probabilities. - -static void ResetTokenStats(VP8Encoder* const enc) { - VP8Proba* const proba = &enc->proba_; - memset(proba->stats_, 0, sizeof(proba->stats_)); -} - -// Record proba context used -static int Record(int bit, proba_t* const stats) { - proba_t p = *stats; - if (p >= 0xffff0000u) { // an overflow is inbound. - p = ((p + 1u) >> 1) & 0x7fff7fffu; // -> divide the stats by 2. - } - // record bit count (lower 16 bits) and increment total count (upper 16 bits). - p += 0x00010000u + bit; - *stats = p; - return bit; -} - -// We keep the table free variant around for reference, in case. -#define USE_LEVEL_CODE_TABLE - -// Simulate block coding, but only record statistics. -// Note: no need to record the fixed probas. -static int RecordCoeffs(int ctx, const VP8Residual* const res) { - int n = res->first; - proba_t* s = res->stats[VP8EncBands[n]][ctx]; - if (res->last < 0) { - Record(0, s + 0); - return 0; - } - while (n <= res->last) { - int v; - Record(1, s + 0); - while ((v = res->coeffs[n++]) == 0) { - Record(0, s + 1); - s = res->stats[VP8EncBands[n]][0]; - } - Record(1, s + 1); - if (!Record(2u < (unsigned int)(v + 1), s + 2)) { // v = -1 or 1 - s = res->stats[VP8EncBands[n]][1]; - } else { - v = abs(v); -#if !defined(USE_LEVEL_CODE_TABLE) - if (!Record(v > 4, s + 3)) { - if (Record(v != 2, s + 4)) - Record(v == 4, s + 5); - } else if (!Record(v > 10, s + 6)) { - Record(v > 6, s + 7); - } else if (!Record((v >= 3 + (8 << 2)), s + 8)) { - Record((v >= 3 + (8 << 1)), s + 9); - } else { - Record((v >= 3 + (8 << 3)), s + 10); - } -#else - if (v > MAX_VARIABLE_LEVEL) - v = MAX_VARIABLE_LEVEL; - - { - const int bits = VP8LevelCodes[v - 1][1]; - int pattern = VP8LevelCodes[v - 1][0]; - int i; - for (i = 0; (pattern >>= 1) != 0; ++i) { - const int mask = 2 << i; - if (pattern & 1) Record(!!(bits & mask), s + 3 + i); - } - } -#endif - s = res->stats[VP8EncBands[n]][2]; - } - } - if (n < 16) Record(0, s + 0); - return 1; -} - -// Collect statistics and deduce probabilities for next coding pass. -// Return the total bit-cost for coding the probability updates. -static int CalcTokenProba(int nb, int total) { - assert(nb <= total); - return nb ? (255 - nb * 255 / total) : 255; -} - -// Cost of coding 'nb' 1's and 'total-nb' 0's using 'proba' probability. -static int BranchCost(int nb, int total, int proba) { - return nb * VP8BitCost(1, proba) + (total - nb) * VP8BitCost(0, proba); -} - -static int FinalizeTokenProbas(VP8Encoder* const enc) { - VP8Proba* const proba = &enc->proba_; - int has_changed = 0; - int size = 0; - int t, b, c, p; - for (t = 0; t < NUM_TYPES; ++t) { - for (b = 0; b < NUM_BANDS; ++b) { - for (c = 0; c < NUM_CTX; ++c) { - for (p = 0; p < NUM_PROBAS; ++p) { - const proba_t stats = proba->stats_[t][b][c][p]; - const int nb = (stats >> 0) & 0xffff; - const int total = (stats >> 16) & 0xffff; - const int update_proba = VP8CoeffsUpdateProba[t][b][c][p]; - const int old_p = VP8CoeffsProba0[t][b][c][p]; - const int new_p = CalcTokenProba(nb, total); - const int old_cost = BranchCost(nb, total, old_p) - + VP8BitCost(0, update_proba); - const int new_cost = BranchCost(nb, total, new_p) - + VP8BitCost(1, update_proba) - + 8 * 256; - const int use_new_p = (old_cost > new_cost); - size += VP8BitCost(use_new_p, update_proba); - if (use_new_p) { // only use proba that seem meaningful enough. - proba->coeffs_[t][b][c][p] = new_p; - has_changed |= (new_p != old_p); - size += 8 * 256; - } else { - proba->coeffs_[t][b][c][p] = old_p; - } - } - } - } - } - proba->dirty_ = has_changed; - return size; -} - -//------------------------------------------------------------------------------ -// helper functions for residuals struct VP8Residual. - -static void InitResidual(int first, int coeff_type, - VP8Encoder* const enc, VP8Residual* const res) { - res->coeff_type = coeff_type; - res->prob = enc->proba_.coeffs_[coeff_type]; - res->stats = enc->proba_.stats_[coeff_type]; - res->cost = enc->proba_.level_cost_[coeff_type]; - res->first = first; -} - -static void SetResidualCoeffs(const int16_t* const coeffs, - VP8Residual* const res) { - int n; - res->last = -1; - for (n = 15; n >= res->first; --n) { - if (coeffs[n]) { - res->last = n; - break; - } - } - res->coeffs = coeffs; -} - -//------------------------------------------------------------------------------ -// Mode costs - -static int GetResidualCost(int ctx, const VP8Residual* const res) { - int n = res->first; - int p0 = res->prob[VP8EncBands[n]][ctx][0]; - const uint16_t* t = res->cost[VP8EncBands[n]][ctx]; - int cost; - - if (res->last < 0) { - return VP8BitCost(0, p0); - } - cost = 0; - while (n <= res->last) { - const int v = res->coeffs[n]; - const int b = VP8EncBands[n + 1]; - ++n; - if (v == 0) { - // short-case for VP8LevelCost(t, 0) (note: VP8LevelFixedCosts[0] == 0): - cost += t[0]; - t = res->cost[b][0]; - continue; - } - cost += VP8BitCost(1, p0); - if (2u >= (unsigned int)(v + 1)) { // v = -1 or 1 - // short-case for "VP8LevelCost(t, 1)" (256 is VP8LevelFixedCosts[1]): - cost += 256 + t[1]; - p0 = res->prob[b][1][0]; - t = res->cost[b][1]; - } else { - cost += VP8LevelCost(t, abs(v)); - p0 = res->prob[b][2][0]; - t = res->cost[b][2]; - } - } - if (n < 16) cost += VP8BitCost(0, p0); - return cost; -} - -int VP8GetCostLuma4(VP8EncIterator* const it, const int16_t levels[16]) { - const int x = (it->i4_ & 3), y = (it->i4_ >> 2); - VP8Residual res; - VP8Encoder* const enc = it->enc_; - int R = 0; - int ctx; - - InitResidual(0, 3, enc, &res); - ctx = it->top_nz_[x] + it->left_nz_[y]; - SetResidualCoeffs(levels, &res); - R += GetResidualCost(ctx, &res); - return R; -} - -int VP8GetCostLuma16(VP8EncIterator* const it, const VP8ModeScore* const rd) { - VP8Residual res; - VP8Encoder* const enc = it->enc_; - int x, y; - int R = 0; - - VP8IteratorNzToBytes(it); // re-import the non-zero context - - // DC - InitResidual(0, 1, enc, &res); - SetResidualCoeffs(rd->y_dc_levels, &res); - R += GetResidualCost(it->top_nz_[8] + it->left_nz_[8], &res); - - // AC - InitResidual(1, 0, enc, &res); - for (y = 0; y < 4; ++y) { - for (x = 0; x < 4; ++x) { - const int ctx = it->top_nz_[x] + it->left_nz_[y]; - SetResidualCoeffs(rd->y_ac_levels[x + y * 4], &res); - R += GetResidualCost(ctx, &res); - it->top_nz_[x] = it->left_nz_[y] = (res.last >= 0); - } - } - return R; -} - -int VP8GetCostUV(VP8EncIterator* const it, const VP8ModeScore* const rd) { - VP8Residual res; - VP8Encoder* const enc = it->enc_; - int ch, x, y; - int R = 0; - - VP8IteratorNzToBytes(it); // re-import the non-zero context - - InitResidual(0, 2, enc, &res); - for (ch = 0; ch <= 2; ch += 2) { - for (y = 0; y < 2; ++y) { - for (x = 0; x < 2; ++x) { - const int ctx = it->top_nz_[4 + ch + x] + it->left_nz_[4 + ch + y]; - SetResidualCoeffs(rd->uv_levels[ch * 2 + x + y * 2], &res); - R += GetResidualCost(ctx, &res); - it->top_nz_[4 + ch + x] = it->left_nz_[4 + ch + y] = (res.last >= 0); - } - } - } - return R; -} - -//------------------------------------------------------------------------------ -// Coefficient coding - -static int PutCoeffs(VP8BitWriter* const bw, int ctx, const VP8Residual* res) { - int n = res->first; - const uint8_t* p = res->prob[VP8EncBands[n]][ctx]; - if (!VP8PutBit(bw, res->last >= 0, p[0])) { - return 0; - } - - while (n < 16) { - const int c = res->coeffs[n++]; - const int sign = c < 0; - int v = sign ? -c : c; - if (!VP8PutBit(bw, v != 0, p[1])) { - p = res->prob[VP8EncBands[n]][0]; - continue; - } - if (!VP8PutBit(bw, v > 1, p[2])) { - p = res->prob[VP8EncBands[n]][1]; - } else { - if (!VP8PutBit(bw, v > 4, p[3])) { - if (VP8PutBit(bw, v != 2, p[4])) - VP8PutBit(bw, v == 4, p[5]); - } else if (!VP8PutBit(bw, v > 10, p[6])) { - if (!VP8PutBit(bw, v > 6, p[7])) { - VP8PutBit(bw, v == 6, 159); - } else { - VP8PutBit(bw, v >= 9, 165); - VP8PutBit(bw, !(v & 1), 145); - } - } else { - int mask; - const uint8_t* tab; - if (v < 3 + (8 << 1)) { // kCat3 (3b) - VP8PutBit(bw, 0, p[8]); - VP8PutBit(bw, 0, p[9]); - v -= 3 + (8 << 0); - mask = 1 << 2; - tab = kCat3; - } else if (v < 3 + (8 << 2)) { // kCat4 (4b) - VP8PutBit(bw, 0, p[8]); - VP8PutBit(bw, 1, p[9]); - v -= 3 + (8 << 1); - mask = 1 << 3; - tab = kCat4; - } else if (v < 3 + (8 << 3)) { // kCat5 (5b) - VP8PutBit(bw, 1, p[8]); - VP8PutBit(bw, 0, p[10]); - v -= 3 + (8 << 2); - mask = 1 << 4; - tab = kCat5; - } else { // kCat6 (11b) - VP8PutBit(bw, 1, p[8]); - VP8PutBit(bw, 1, p[10]); - v -= 3 + (8 << 3); - mask = 1 << 10; - tab = kCat6; - } - while (mask) { - VP8PutBit(bw, !!(v & mask), *tab++); - mask >>= 1; - } - } - p = res->prob[VP8EncBands[n]][2]; - } - VP8PutBitUniform(bw, sign); - if (n == 16 || !VP8PutBit(bw, n <= res->last, p[0])) { - return 1; // EOB - } - } - return 1; -} - -static void CodeResiduals(VP8BitWriter* const bw, - VP8EncIterator* const it, - const VP8ModeScore* const rd) { - int x, y, ch; - VP8Residual res; - uint64_t pos1, pos2, pos3; - const int i16 = (it->mb_->type_ == 1); - const int segment = it->mb_->segment_; - VP8Encoder* const enc = it->enc_; - - VP8IteratorNzToBytes(it); - - pos1 = VP8BitWriterPos(bw); - if (i16) { - InitResidual(0, 1, enc, &res); - SetResidualCoeffs(rd->y_dc_levels, &res); - it->top_nz_[8] = it->left_nz_[8] = - PutCoeffs(bw, it->top_nz_[8] + it->left_nz_[8], &res); - InitResidual(1, 0, enc, &res); - } else { - InitResidual(0, 3, enc, &res); - } - - // luma-AC - for (y = 0; y < 4; ++y) { - for (x = 0; x < 4; ++x) { - const int ctx = it->top_nz_[x] + it->left_nz_[y]; - SetResidualCoeffs(rd->y_ac_levels[x + y * 4], &res); - it->top_nz_[x] = it->left_nz_[y] = PutCoeffs(bw, ctx, &res); - } - } - pos2 = VP8BitWriterPos(bw); - - // U/V - InitResidual(0, 2, enc, &res); - for (ch = 0; ch <= 2; ch += 2) { - for (y = 0; y < 2; ++y) { - for (x = 0; x < 2; ++x) { - const int ctx = it->top_nz_[4 + ch + x] + it->left_nz_[4 + ch + y]; - SetResidualCoeffs(rd->uv_levels[ch * 2 + x + y * 2], &res); - it->top_nz_[4 + ch + x] = it->left_nz_[4 + ch + y] = - PutCoeffs(bw, ctx, &res); - } - } - } - pos3 = VP8BitWriterPos(bw); - it->luma_bits_ = pos2 - pos1; - it->uv_bits_ = pos3 - pos2; - it->bit_count_[segment][i16] += it->luma_bits_; - it->bit_count_[segment][2] += it->uv_bits_; - VP8IteratorBytesToNz(it); -} - -// Same as CodeResiduals, but doesn't actually write anything. -// Instead, it just records the event distribution. -static void RecordResiduals(VP8EncIterator* const it, - const VP8ModeScore* const rd) { - int x, y, ch; - VP8Residual res; - VP8Encoder* const enc = it->enc_; - - VP8IteratorNzToBytes(it); - - if (it->mb_->type_ == 1) { // i16x16 - InitResidual(0, 1, enc, &res); - SetResidualCoeffs(rd->y_dc_levels, &res); - it->top_nz_[8] = it->left_nz_[8] = - RecordCoeffs(it->top_nz_[8] + it->left_nz_[8], &res); - InitResidual(1, 0, enc, &res); - } else { - InitResidual(0, 3, enc, &res); - } - - // luma-AC - for (y = 0; y < 4; ++y) { - for (x = 0; x < 4; ++x) { - const int ctx = it->top_nz_[x] + it->left_nz_[y]; - SetResidualCoeffs(rd->y_ac_levels[x + y * 4], &res); - it->top_nz_[x] = it->left_nz_[y] = RecordCoeffs(ctx, &res); - } - } - - // U/V - InitResidual(0, 2, enc, &res); - for (ch = 0; ch <= 2; ch += 2) { - for (y = 0; y < 2; ++y) { - for (x = 0; x < 2; ++x) { - const int ctx = it->top_nz_[4 + ch + x] + it->left_nz_[4 + ch + y]; - SetResidualCoeffs(rd->uv_levels[ch * 2 + x + y * 2], &res); - it->top_nz_[4 + ch + x] = it->left_nz_[4 + ch + y] = - RecordCoeffs(ctx, &res); - } - } - } - - VP8IteratorBytesToNz(it); -} - -//------------------------------------------------------------------------------ -// Token buffer - -#ifdef USE_TOKEN_BUFFER - -void VP8TBufferInit(VP8TBuffer* const b) { - b->rows_ = NULL; - b->tokens_ = NULL; - b->last_ = &b->rows_; - b->left_ = 0; - b->error_ = 0; -} - -int VP8TBufferNewPage(VP8TBuffer* const b) { - VP8Tokens* const page = b->error_ ? NULL : (VP8Tokens*)malloc(sizeof(*page)); - if (page == NULL) { - b->error_ = 1; - return 0; - } - *b->last_ = page; - b->last_ = &page->next_; - b->left_ = MAX_NUM_TOKEN; - b->tokens_ = page->tokens_; - return 1; -} - -void VP8TBufferClear(VP8TBuffer* const b) { - if (b != NULL) { - const VP8Tokens* p = b->rows_; - while (p != NULL) { - const VP8Tokens* const next = p->next_; - free((void*)p); - p = next; - } - VP8TBufferInit(b); - } -} - -int VP8EmitTokens(const VP8TBuffer* const b, VP8BitWriter* const bw, - const uint8_t* const probas) { - VP8Tokens* p = b->rows_; - if (b->error_) return 0; - while (p != NULL) { - const int N = (p->next_ == NULL) ? b->left_ : 0; - int n = MAX_NUM_TOKEN; - while (n-- > N) { - VP8PutBit(bw, (p->tokens_[n] >> 15) & 1, probas[p->tokens_[n] & 0x7fff]); - } - p = p->next_; - } - return 1; -} - -#define TOKEN_ID(b, ctx, p) ((p) + NUM_PROBAS * ((ctx) + (b) * NUM_CTX)) - -static int RecordCoeffTokens(int ctx, const VP8Residual* const res, - VP8TBuffer* tokens) { - int n = res->first; - int b = VP8EncBands[n]; - if (!VP8AddToken(tokens, res->last >= 0, TOKEN_ID(b, ctx, 0))) { - return 0; - } - - while (n < 16) { - const int c = res->coeffs[n++]; - const int sign = c < 0; - int v = sign ? -c : c; - const int base_id = TOKEN_ID(b, ctx, 0); - if (!VP8AddToken(tokens, v != 0, base_id + 1)) { - b = VP8EncBands[n]; - ctx = 0; - continue; - } - if (!VP8AddToken(tokens, v > 1, base_id + 2)) { - b = VP8EncBands[n]; - ctx = 1; - } else { - if (!VP8AddToken(tokens, v > 4, base_id + 3)) { - if (VP8AddToken(tokens, v != 2, base_id + 4)) - VP8AddToken(tokens, v == 4, base_id + 5); - } else if (!VP8AddToken(tokens, v > 10, base_id + 6)) { - if (!VP8AddToken(tokens, v > 6, base_id + 7)) { -// VP8AddToken(tokens, v == 6, 159); - } else { -// VP8AddToken(tokens, v >= 9, 165); -// VP8AddToken(tokens, !(v & 1), 145); - } - } else { - int mask; - const uint8_t* tab; - if (v < 3 + (8 << 1)) { // kCat3 (3b) - VP8AddToken(tokens, 0, base_id + 8); - VP8AddToken(tokens, 0, base_id + 9); - v -= 3 + (8 << 0); - mask = 1 << 2; - tab = kCat3; - } else if (v < 3 + (8 << 2)) { // kCat4 (4b) - VP8AddToken(tokens, 0, base_id + 8); - VP8AddToken(tokens, 1, base_id + 9); - v -= 3 + (8 << 1); - mask = 1 << 3; - tab = kCat4; - } else if (v < 3 + (8 << 3)) { // kCat5 (5b) - VP8AddToken(tokens, 1, base_id + 8); - VP8AddToken(tokens, 0, base_id + 10); - v -= 3 + (8 << 2); - mask = 1 << 4; - tab = kCat5; - } else { // kCat6 (11b) - VP8AddToken(tokens, 1, base_id + 8); - VP8AddToken(tokens, 1, base_id + 10); - v -= 3 + (8 << 3); - mask = 1 << 10; - tab = kCat6; - } - while (mask) { - // VP8AddToken(tokens, !!(v & mask), *tab++); - mask >>= 1; - } - } - ctx = 2; - } - b = VP8EncBands[n]; - // VP8PutBitUniform(bw, sign); - if (n == 16 || !VP8AddToken(tokens, n <= res->last, TOKEN_ID(b, ctx, 0))) { - return 1; // EOB - } - } - return 1; -} - -static void RecordTokens(VP8EncIterator* const it, - const VP8ModeScore* const rd, VP8TBuffer tokens[2]) { - int x, y, ch; - VP8Residual res; - VP8Encoder* const enc = it->enc_; - - VP8IteratorNzToBytes(it); - if (it->mb_->type_ == 1) { // i16x16 - InitResidual(0, 1, enc, &res); - SetResidualCoeffs(rd->y_dc_levels, &res); -// TODO(skal): FIX -> it->top_nz_[8] = it->left_nz_[8] = - RecordCoeffTokens(it->top_nz_[8] + it->left_nz_[8], &res, &tokens[0]); - InitResidual(1, 0, enc, &res); - } else { - InitResidual(0, 3, enc, &res); - } - - // luma-AC - for (y = 0; y < 4; ++y) { - for (x = 0; x < 4; ++x) { - const int ctx = it->top_nz_[x] + it->left_nz_[y]; - SetResidualCoeffs(rd->y_ac_levels[x + y * 4], &res); - it->top_nz_[x] = it->left_nz_[y] = - RecordCoeffTokens(ctx, &res, &tokens[0]); - } - } - - // U/V - InitResidual(0, 2, enc, &res); - for (ch = 0; ch <= 2; ch += 2) { - for (y = 0; y < 2; ++y) { - for (x = 0; x < 2; ++x) { - const int ctx = it->top_nz_[4 + ch + x] + it->left_nz_[4 + ch + y]; - SetResidualCoeffs(rd->uv_levels[ch * 2 + x + y * 2], &res); - it->top_nz_[4 + ch + x] = it->left_nz_[4 + ch + y] = - RecordCoeffTokens(ctx, &res, &tokens[1]); - } - } - } -} - -#endif // USE_TOKEN_BUFFER - -//------------------------------------------------------------------------------ -// ExtraInfo map / Debug function - -#if SEGMENT_VISU -static void SetBlock(uint8_t* p, int value, int size) { - int y; - for (y = 0; y < size; ++y) { - memset(p, value, size); - p += BPS; - } -} -#endif - -static void ResetSSE(VP8Encoder* const enc) { - memset(enc->sse_, 0, sizeof(enc->sse_)); - enc->sse_count_ = 0; -} - -static void StoreSSE(const VP8EncIterator* const it) { - VP8Encoder* const enc = it->enc_; - const uint8_t* const in = it->yuv_in_; - const uint8_t* const out = it->yuv_out_; - // Note: not totally accurate at boundary. And doesn't include in-loop filter. - enc->sse_[0] += VP8SSE16x16(in + Y_OFF, out + Y_OFF); - enc->sse_[1] += VP8SSE8x8(in + U_OFF, out + U_OFF); - enc->sse_[2] += VP8SSE8x8(in + V_OFF, out + V_OFF); - enc->sse_count_ += 16 * 16; -} - -static void StoreSideInfo(const VP8EncIterator* const it) { - VP8Encoder* const enc = it->enc_; - const VP8MBInfo* const mb = it->mb_; - WebPPicture* const pic = enc->pic_; - - if (pic->stats != NULL) { - StoreSSE(it); - enc->block_count_[0] += (mb->type_ == 0); - enc->block_count_[1] += (mb->type_ == 1); - enc->block_count_[2] += (mb->skip_ != 0); - } - - if (pic->extra_info != NULL) { - uint8_t* const info = &pic->extra_info[it->x_ + it->y_ * enc->mb_w_]; - switch (pic->extra_info_type) { - case 1: *info = mb->type_; break; - case 2: *info = mb->segment_; break; - case 3: *info = enc->dqm_[mb->segment_].quant_; break; - case 4: *info = (mb->type_ == 1) ? it->preds_[0] : 0xff; break; - case 5: *info = mb->uv_mode_; break; - case 6: { - const int b = (int)((it->luma_bits_ + it->uv_bits_ + 7) >> 3); - *info = (b > 255) ? 255 : b; break; - } - default: *info = 0; break; - }; - } -#if SEGMENT_VISU // visualize segments and prediction modes - SetBlock(it->yuv_out_ + Y_OFF, mb->segment_ * 64, 16); - SetBlock(it->yuv_out_ + U_OFF, it->preds_[0] * 64, 8); - SetBlock(it->yuv_out_ + V_OFF, mb->uv_mode_ * 64, 8); -#endif -} - -//------------------------------------------------------------------------------ -// Main loops -// -// VP8EncLoop(): does the final bitstream coding. - -static void ResetAfterSkip(VP8EncIterator* const it) { - if (it->mb_->type_ == 1) { - *it->nz_ = 0; // reset all predictors - it->left_nz_[8] = 0; - } else { - *it->nz_ &= (1 << 24); // preserve the dc_nz bit - } -} - -int VP8EncLoop(VP8Encoder* const enc) { - int i, s, p; - int ok = 1; - VP8EncIterator it; - VP8ModeScore info; - const int dont_use_skip = !enc->proba_.use_skip_proba_; - const int rd_opt = enc->rd_opt_level_; - const int kAverageBytesPerMB = 5; // TODO: have a kTable[quality/10] - const int bytes_per_parts = - enc->mb_w_ * enc->mb_h_ * kAverageBytesPerMB / enc->num_parts_; - - // Initialize the bit-writers - for (p = 0; p < enc->num_parts_; ++p) { - VP8BitWriterInit(enc->parts_ + p, bytes_per_parts); - } - - ResetStats(enc); - ResetSSE(enc); - - VP8IteratorInit(enc, &it); - VP8InitFilter(&it); - do { - VP8IteratorImport(&it); - // Warning! order is important: first call VP8Decimate() and - // *then* decide how to code the skip decision if there's one. - if (!VP8Decimate(&it, &info, rd_opt) || dont_use_skip) { - CodeResiduals(it.bw_, &it, &info); - } else { // reset predictors after a skip - ResetAfterSkip(&it); - } -#ifdef WEBP_EXPERIMENTAL_FEATURES - if (enc->use_layer_) { - VP8EncCodeLayerBlock(&it); - } -#endif - StoreSideInfo(&it); - VP8StoreFilterStats(&it); - VP8IteratorExport(&it); - ok = VP8IteratorProgress(&it, 20); - } while (ok && VP8IteratorNext(&it, it.yuv_out_)); - - if (ok) { // Finalize the partitions, check for extra errors. - for (p = 0; p < enc->num_parts_; ++p) { - VP8BitWriterFinish(enc->parts_ + p); - ok &= !enc->parts_[p].error_; - } - } - - if (ok) { // All good. Finish up. - if (enc->pic_->stats) { // finalize byte counters... - for (i = 0; i <= 2; ++i) { - for (s = 0; s < NUM_MB_SEGMENTS; ++s) { - enc->residual_bytes_[i][s] = (int)((it.bit_count_[s][i] + 7) >> 3); - } - } - } - VP8AdjustFilterStrength(&it); // ...and store filter stats. - } else { - // Something bad happened -> need to do some memory cleanup. - VP8EncFreeBitWriters(enc); - } - - return ok; -} - -//------------------------------------------------------------------------------ -// VP8StatLoop(): only collect statistics (number of skips, token usage, ...) -// This is used for deciding optimal probabilities. It also -// modifies the quantizer value if some target (size, PNSR) -// was specified. - -#define kHeaderSizeEstimate (15 + 20 + 10) // TODO: fix better - -static int OneStatPass(VP8Encoder* const enc, float q, int rd_opt, int nb_mbs, - float* const PSNR, int percent_delta) { - VP8EncIterator it; - uint64_t size = 0; - uint64_t distortion = 0; - const uint64_t pixel_count = nb_mbs * 384; - - // Make sure the quality parameter is inside valid bounds - if (q < 0.) { - q = 0; - } else if (q > 100.) { - q = 100; - } - - VP8SetSegmentParams(enc, q); // setup segment quantizations and filters - - ResetStats(enc); - ResetTokenStats(enc); - - VP8IteratorInit(enc, &it); - do { - VP8ModeScore info; - VP8IteratorImport(&it); - if (VP8Decimate(&it, &info, rd_opt)) { - // Just record the number of skips and act like skip_proba is not used. - enc->proba_.nb_skip_++; - } - RecordResiduals(&it, &info); - size += info.R; - distortion += info.D; - if (percent_delta && !VP8IteratorProgress(&it, percent_delta)) - return 0; - } while (VP8IteratorNext(&it, it.yuv_out_) && --nb_mbs > 0); - size += FinalizeSkipProba(enc); - size += FinalizeTokenProbas(enc); - size += enc->segment_hdr_.size_; - size = ((size + 1024) >> 11) + kHeaderSizeEstimate; - - if (PSNR) { - *PSNR = (float)(10.* log10(255. * 255. * pixel_count / distortion)); - } - return (int)size; -} - -// successive refinement increments. -static const int dqs[] = { 20, 15, 10, 8, 6, 4, 2, 1, 0 }; - -int VP8StatLoop(VP8Encoder* const enc) { - const int do_search = - (enc->config_->target_size > 0 || enc->config_->target_PSNR > 0); - const int fast_probe = (enc->method_ < 2 && !do_search); - float q = enc->config_->quality; - const int max_passes = enc->config_->pass; - const int task_percent = 20; - const int percent_per_pass = (task_percent + max_passes / 2) / max_passes; - const int final_percent = enc->percent_ + task_percent; - int pass; - int nb_mbs; - - // Fast mode: quick analysis pass over few mbs. Better than nothing. - nb_mbs = enc->mb_w_ * enc->mb_h_; - if (fast_probe && nb_mbs > 100) nb_mbs = 100; - - // No target size: just do several pass without changing 'q' - if (!do_search) { - for (pass = 0; pass < max_passes; ++pass) { - const int rd_opt = (enc->method_ > 2); - if (!OneStatPass(enc, q, rd_opt, nb_mbs, NULL, percent_per_pass)) { - return 0; - } - } - } else { - // binary search for a size close to target - for (pass = 0; pass < max_passes && (dqs[pass] > 0); ++pass) { - const int rd_opt = 1; - float PSNR; - int criterion; - const int size = OneStatPass(enc, q, rd_opt, nb_mbs, &PSNR, - percent_per_pass); -#if DEBUG_SEARCH - printf("#%d size=%d PSNR=%.2f q=%.2f\n", pass, size, PSNR, q); -#endif - if (!size) return 0; - if (enc->config_->target_PSNR > 0) { - criterion = (PSNR < enc->config_->target_PSNR); - } else { - criterion = (size < enc->config_->target_size); - } - // dichotomize - if (criterion) { - q += dqs[pass]; - } else { - q -= dqs[pass]; - } - } - } - return WebPReportProgress(enc->pic_, final_percent, &enc->percent_); -} - -//------------------------------------------------------------------------------ - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif diff --git a/external/libwebp/enc/histogram.c b/external/libwebp/enc/histogram.c deleted file mode 100644 index fb4044bfd3..0000000000 --- a/external/libwebp/enc/histogram.c +++ /dev/null @@ -1,406 +0,0 @@ -// Copyright 2012 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Author: Jyrki Alakuijala (jyrki@google.com) -// -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <math.h> -#include <stdio.h> - -#include "./backward_references.h" -#include "./histogram.h" -#include "../dsp/lossless.h" -#include "../utils/utils.h" - -static void HistogramClear(VP8LHistogram* const p) { - memset(p->literal_, 0, sizeof(p->literal_)); - memset(p->red_, 0, sizeof(p->red_)); - memset(p->blue_, 0, sizeof(p->blue_)); - memset(p->alpha_, 0, sizeof(p->alpha_)); - memset(p->distance_, 0, sizeof(p->distance_)); - p->bit_cost_ = 0; -} - -void VP8LHistogramStoreRefs(const VP8LBackwardRefs* const refs, - VP8LHistogram* const histo) { - int i; - for (i = 0; i < refs->size; ++i) { - VP8LHistogramAddSinglePixOrCopy(histo, &refs->refs[i]); - } -} - -void VP8LHistogramCreate(VP8LHistogram* const p, - const VP8LBackwardRefs* const refs, - int palette_code_bits) { - if (palette_code_bits >= 0) { - p->palette_code_bits_ = palette_code_bits; - } - HistogramClear(p); - VP8LHistogramStoreRefs(refs, p); -} - -void VP8LHistogramInit(VP8LHistogram* const p, int palette_code_bits) { - p->palette_code_bits_ = palette_code_bits; - HistogramClear(p); -} - -VP8LHistogramSet* VP8LAllocateHistogramSet(int size, int cache_bits) { - int i; - VP8LHistogramSet* set; - VP8LHistogram* bulk; - const uint64_t total_size = sizeof(*set) - + (uint64_t)size * sizeof(*set->histograms) - + (uint64_t)size * sizeof(**set->histograms); - uint8_t* memory = (uint8_t*)WebPSafeMalloc(total_size, sizeof(*memory)); - if (memory == NULL) return NULL; - - set = (VP8LHistogramSet*)memory; - memory += sizeof(*set); - set->histograms = (VP8LHistogram**)memory; - memory += size * sizeof(*set->histograms); - bulk = (VP8LHistogram*)memory; - set->max_size = size; - set->size = size; - for (i = 0; i < size; ++i) { - set->histograms[i] = bulk + i; - VP8LHistogramInit(set->histograms[i], cache_bits); - } - return set; -} - -// ----------------------------------------------------------------------------- - -void VP8LHistogramAddSinglePixOrCopy(VP8LHistogram* const histo, - const PixOrCopy* const v) { - if (PixOrCopyIsLiteral(v)) { - ++histo->alpha_[PixOrCopyLiteral(v, 3)]; - ++histo->red_[PixOrCopyLiteral(v, 2)]; - ++histo->literal_[PixOrCopyLiteral(v, 1)]; - ++histo->blue_[PixOrCopyLiteral(v, 0)]; - } else if (PixOrCopyIsCacheIdx(v)) { - int literal_ix = 256 + NUM_LENGTH_CODES + PixOrCopyCacheIdx(v); - ++histo->literal_[literal_ix]; - } else { - int code, extra_bits_count, extra_bits_value; - PrefixEncode(PixOrCopyLength(v), - &code, &extra_bits_count, &extra_bits_value); - ++histo->literal_[256 + code]; - PrefixEncode(PixOrCopyDistance(v), - &code, &extra_bits_count, &extra_bits_value); - ++histo->distance_[code]; - } -} - - - -static double BitsEntropy(const int* const array, int n) { - double retval = 0.; - int sum = 0; - int nonzeros = 0; - int max_val = 0; - int i; - double mix; - for (i = 0; i < n; ++i) { - if (array[i] != 0) { - sum += array[i]; - ++nonzeros; - retval -= VP8LFastSLog2(array[i]); - if (max_val < array[i]) { - max_val = array[i]; - } - } - } - retval += VP8LFastSLog2(sum); - - if (nonzeros < 5) { - if (nonzeros <= 1) { - return 0; - } - // Two symbols, they will be 0 and 1 in a Huffman code. - // Let's mix in a bit of entropy to favor good clustering when - // distributions of these are combined. - if (nonzeros == 2) { - return 0.99 * sum + 0.01 * retval; - } - // No matter what the entropy says, we cannot be better than min_limit - // with Huffman coding. I am mixing a bit of entropy into the - // min_limit since it produces much better (~0.5 %) compression results - // perhaps because of better entropy clustering. - if (nonzeros == 3) { - mix = 0.95; - } else { - mix = 0.7; // nonzeros == 4. - } - } else { - mix = 0.627; - } - - { - double min_limit = 2 * sum - max_val; - min_limit = mix * min_limit + (1.0 - mix) * retval; - return (retval < min_limit) ? min_limit : retval; - } -} - -double VP8LHistogramEstimateBitsBulk(const VP8LHistogram* const p) { - double retval = BitsEntropy(&p->literal_[0], VP8LHistogramNumCodes(p)) - + BitsEntropy(&p->red_[0], 256) - + BitsEntropy(&p->blue_[0], 256) - + BitsEntropy(&p->alpha_[0], 256) - + BitsEntropy(&p->distance_[0], NUM_DISTANCE_CODES); - // Compute the extra bits cost. - int i; - for (i = 2; i < NUM_LENGTH_CODES - 2; ++i) { - retval += - (i >> 1) * p->literal_[256 + i + 2]; - } - for (i = 2; i < NUM_DISTANCE_CODES - 2; ++i) { - retval += (i >> 1) * p->distance_[i + 2]; - } - return retval; -} - - -// Returns the cost encode the rle-encoded entropy code. -// The constants in this function are experimental. -static double HuffmanCost(const int* const population, int length) { - // Small bias because Huffman code length is typically not stored in - // full length. - static const int kHuffmanCodeOfHuffmanCodeSize = CODE_LENGTH_CODES * 3; - static const double kSmallBias = 9.1; - double retval = kHuffmanCodeOfHuffmanCodeSize - kSmallBias; - int streak = 0; - int i = 0; - for (; i < length - 1; ++i) { - ++streak; - if (population[i] == population[i + 1]) { - continue; - } - last_streak_hack: - // population[i] points now to the symbol in the streak of same values. - if (streak > 3) { - if (population[i] == 0) { - retval += 1.5625 + 0.234375 * streak; - } else { - retval += 2.578125 + 0.703125 * streak; - } - } else { - if (population[i] == 0) { - retval += 1.796875 * streak; - } else { - retval += 3.28125 * streak; - } - } - streak = 0; - } - if (i == length - 1) { - ++streak; - goto last_streak_hack; - } - return retval; -} - -// Estimates the Huffman dictionary + other block overhead size. -static double HistogramEstimateBitsHeader(const VP8LHistogram* const p) { - return HuffmanCost(&p->alpha_[0], 256) + - HuffmanCost(&p->red_[0], 256) + - HuffmanCost(&p->literal_[0], VP8LHistogramNumCodes(p)) + - HuffmanCost(&p->blue_[0], 256) + - HuffmanCost(&p->distance_[0], NUM_DISTANCE_CODES); -} - -double VP8LHistogramEstimateBits(const VP8LHistogram* const p) { - return HistogramEstimateBitsHeader(p) + VP8LHistogramEstimateBitsBulk(p); -} - -static void HistogramBuildImage(int xsize, int histo_bits, - const VP8LBackwardRefs* const backward_refs, - VP8LHistogramSet* const image) { - int i; - int x = 0, y = 0; - const int histo_xsize = VP8LSubSampleSize(xsize, histo_bits); - VP8LHistogram** const histograms = image->histograms; - assert(histo_bits > 0); - for (i = 0; i < backward_refs->size; ++i) { - const PixOrCopy* const v = &backward_refs->refs[i]; - const int ix = (y >> histo_bits) * histo_xsize + (x >> histo_bits); - VP8LHistogramAddSinglePixOrCopy(histograms[ix], v); - x += PixOrCopyLength(v); - while (x >= xsize) { - x -= xsize; - ++y; - } - } -} - -static uint32_t MyRand(uint32_t *seed) { - *seed *= 16807U; - if (*seed == 0) { - *seed = 1; - } - return *seed; -} - -static int HistogramCombine(const VP8LHistogramSet* const in, - VP8LHistogramSet* const out, int num_pairs) { - int ok = 0; - int i, iter; - uint32_t seed = 0; - int tries_with_no_success = 0; - const int min_cluster_size = 2; - int out_size = in->size; - const int outer_iters = in->size * 3; - VP8LHistogram* const histos = (VP8LHistogram*)malloc(2 * sizeof(*histos)); - VP8LHistogram* cur_combo = histos + 0; // trial merged histogram - VP8LHistogram* best_combo = histos + 1; // best merged histogram so far - if (histos == NULL) goto End; - - // Copy histograms from in[] to out[]. - assert(in->size <= out->size); - for (i = 0; i < in->size; ++i) { - in->histograms[i]->bit_cost_ = VP8LHistogramEstimateBits(in->histograms[i]); - *out->histograms[i] = *in->histograms[i]; - } - - // Collapse similar histograms in 'out'. - for (iter = 0; iter < outer_iters && out_size >= min_cluster_size; ++iter) { - // We pick the best pair to be combined out of 'inner_iters' pairs. - double best_cost_diff = 0.; - int best_idx1 = 0, best_idx2 = 1; - int j; - seed += iter; - for (j = 0; j < num_pairs; ++j) { - double curr_cost_diff; - // Choose two histograms at random and try to combine them. - const uint32_t idx1 = MyRand(&seed) % out_size; - const uint32_t tmp = ((j & 7) + 1) % (out_size - 1); - const uint32_t diff = (tmp < 3) ? tmp : MyRand(&seed) % (out_size - 1); - const uint32_t idx2 = (idx1 + diff + 1) % out_size; - if (idx1 == idx2) { - continue; - } - *cur_combo = *out->histograms[idx1]; - VP8LHistogramAdd(cur_combo, out->histograms[idx2]); - cur_combo->bit_cost_ = VP8LHistogramEstimateBits(cur_combo); - // Calculate cost reduction on combining. - curr_cost_diff = cur_combo->bit_cost_ - - out->histograms[idx1]->bit_cost_ - - out->histograms[idx2]->bit_cost_; - if (best_cost_diff > curr_cost_diff) { // found a better pair? - { // swap cur/best combo histograms - VP8LHistogram* const tmp_histo = cur_combo; - cur_combo = best_combo; - best_combo = tmp_histo; - } - best_cost_diff = curr_cost_diff; - best_idx1 = idx1; - best_idx2 = idx2; - } - } - - if (best_cost_diff < 0.0) { - *out->histograms[best_idx1] = *best_combo; - // swap best_idx2 slot with last one (which is now unused) - --out_size; - if (best_idx2 != out_size) { - out->histograms[best_idx2] = out->histograms[out_size]; - out->histograms[out_size] = NULL; // just for sanity check. - } - tries_with_no_success = 0; - } - if (++tries_with_no_success >= 50) { - break; - } - } - out->size = out_size; - ok = 1; - - End: - free(histos); - return ok; -} - -// ----------------------------------------------------------------------------- -// Histogram refinement - -// What is the bit cost of moving square_histogram from -// cur_symbol to candidate_symbol. -// TODO(skal): we don't really need to copy the histogram and Add(). Instead -// we just need VP8LDualHistogramEstimateBits(A, B) estimation function. -static double HistogramDistance(const VP8LHistogram* const square_histogram, - const VP8LHistogram* const candidate) { - const double previous_bit_cost = candidate->bit_cost_; - double new_bit_cost; - VP8LHistogram modified_histo; - modified_histo = *candidate; - VP8LHistogramAdd(&modified_histo, square_histogram); - new_bit_cost = VP8LHistogramEstimateBits(&modified_histo); - - return new_bit_cost - previous_bit_cost; -} - -// Find the best 'out' histogram for each of the 'in' histograms. -// Note: we assume that out[]->bit_cost_ is already up-to-date. -static void HistogramRemap(const VP8LHistogramSet* const in, - const VP8LHistogramSet* const out, - uint16_t* const symbols) { - int i; - for (i = 0; i < in->size; ++i) { - int best_out = 0; - double best_bits = HistogramDistance(in->histograms[i], out->histograms[0]); - int k; - for (k = 1; k < out->size; ++k) { - const double cur_bits = - HistogramDistance(in->histograms[i], out->histograms[k]); - if (cur_bits < best_bits) { - best_bits = cur_bits; - best_out = k; - } - } - symbols[i] = best_out; - } - - // Recompute each out based on raw and symbols. - for (i = 0; i < out->size; ++i) { - HistogramClear(out->histograms[i]); - } - for (i = 0; i < in->size; ++i) { - VP8LHistogramAdd(out->histograms[symbols[i]], in->histograms[i]); - } -} - -int VP8LGetHistoImageSymbols(int xsize, int ysize, - const VP8LBackwardRefs* const refs, - int quality, int histo_bits, int cache_bits, - VP8LHistogramSet* const image_in, - uint16_t* const histogram_symbols) { - int ok = 0; - const int histo_xsize = histo_bits ? VP8LSubSampleSize(xsize, histo_bits) : 1; - const int histo_ysize = histo_bits ? VP8LSubSampleSize(ysize, histo_bits) : 1; - const int num_histo_pairs = 10 + quality / 2; // For HistogramCombine(). - const int histo_image_raw_size = histo_xsize * histo_ysize; - VP8LHistogramSet* const image_out = - VP8LAllocateHistogramSet(histo_image_raw_size, cache_bits); - if (image_out == NULL) return 0; - - // Build histogram image. - HistogramBuildImage(xsize, histo_bits, refs, image_out); - // Collapse similar histograms. - if (!HistogramCombine(image_out, image_in, num_histo_pairs)) { - goto Error; - } - // Find the optimal map from original histograms to the final ones. - HistogramRemap(image_out, image_in, histogram_symbols); - ok = 1; - -Error: - free(image_out); - return ok; -} diff --git a/external/libwebp/enc/histogram.h b/external/libwebp/enc/histogram.h deleted file mode 100644 index ec573c5c85..0000000000 --- a/external/libwebp/enc/histogram.h +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright 2012 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Author: Jyrki Alakuijala (jyrki@google.com) -// -// Models the histograms of literal and distance codes. - -#ifndef WEBP_ENC_HISTOGRAM_H_ -#define WEBP_ENC_HISTOGRAM_H_ - -#include <assert.h> -#include <stddef.h> -#include <stdlib.h> -#include <stdio.h> -#include <string.h> - -#include "./backward_references.h" -#include "../webp/format_constants.h" -#include "../webp/types.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -// A simple container for histograms of data. -typedef struct { - // literal_ contains green literal, palette-code and - // copy-length-prefix histogram - int literal_[PIX_OR_COPY_CODES_MAX]; - int red_[256]; - int blue_[256]; - int alpha_[256]; - // Backward reference prefix-code histogram. - int distance_[NUM_DISTANCE_CODES]; - int palette_code_bits_; - double bit_cost_; // cached value of VP8LHistogramEstimateBits(this) -} VP8LHistogram; - -// Collection of histograms with fixed capacity, allocated as one -// big memory chunk. Can be destroyed by simply calling 'free()'. -typedef struct { - int size; // number of slots currently in use - int max_size; // maximum capacity - VP8LHistogram** histograms; -} VP8LHistogramSet; - -// Create the histogram. -// -// The input data is the PixOrCopy data, which models the literals, stop -// codes and backward references (both distances and lengths). Also: if -// palette_code_bits is >= 0, initialize the histogram with this value. -void VP8LHistogramCreate(VP8LHistogram* const p, - const VP8LBackwardRefs* const refs, - int palette_code_bits); - -// Set the palette_code_bits and reset the stats. -void VP8LHistogramInit(VP8LHistogram* const p, int palette_code_bits); - -// Collect all the references into a histogram (without reset) -void VP8LHistogramStoreRefs(const VP8LBackwardRefs* const refs, - VP8LHistogram* const histo); - -// Allocate an array of pointer to histograms, allocated and initialized -// using 'cache_bits'. Return NULL in case of memory error. -VP8LHistogramSet* VP8LAllocateHistogramSet(int size, int cache_bits); - -// Accumulate a token 'v' into a histogram. -void VP8LHistogramAddSinglePixOrCopy(VP8LHistogram* const histo, - const PixOrCopy* const v); - -// Estimate how many bits the combined entropy of literals and distance -// approximately maps to. -double VP8LHistogramEstimateBits(const VP8LHistogram* const p); - -// This function estimates the cost in bits excluding the bits needed to -// represent the entropy code itself. -double VP8LHistogramEstimateBitsBulk(const VP8LHistogram* const p); - -static WEBP_INLINE void VP8LHistogramAdd(VP8LHistogram* const p, - const VP8LHistogram* const a) { - int i; - for (i = 0; i < PIX_OR_COPY_CODES_MAX; ++i) { - p->literal_[i] += a->literal_[i]; - } - for (i = 0; i < NUM_DISTANCE_CODES; ++i) { - p->distance_[i] += a->distance_[i]; - } - for (i = 0; i < 256; ++i) { - p->red_[i] += a->red_[i]; - p->blue_[i] += a->blue_[i]; - p->alpha_[i] += a->alpha_[i]; - } -} - -static WEBP_INLINE int VP8LHistogramNumCodes(const VP8LHistogram* const p) { - return 256 + NUM_LENGTH_CODES + - ((p->palette_code_bits_ > 0) ? (1 << p->palette_code_bits_) : 0); -} - -// Builds the histogram image. -int VP8LGetHistoImageSymbols(int xsize, int ysize, - const VP8LBackwardRefs* const refs, - int quality, int histogram_bits, int cache_bits, - VP8LHistogramSet* const image_in, - uint16_t* const histogram_symbols); - -#if defined(__cplusplus) || defined(c_plusplus) -} -#endif - -#endif // WEBP_ENC_HISTOGRAM_H_ diff --git a/external/libwebp/enc/iterator.c b/external/libwebp/enc/iterator.c deleted file mode 100644 index 86e473bcf0..0000000000 --- a/external/libwebp/enc/iterator.c +++ /dev/null @@ -1,422 +0,0 @@ -// Copyright 2011 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// VP8Iterator: block iterator -// -// Author: Skal (pascal.massimino@gmail.com) - -#include <string.h> - -#include "./vp8enci.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -//------------------------------------------------------------------------------ -// VP8Iterator -//------------------------------------------------------------------------------ - -static void InitLeft(VP8EncIterator* const it) { - const VP8Encoder* const enc = it->enc_; - enc->y_left_[-1] = enc->u_left_[-1] = enc->v_left_[-1] = - (it->y_ > 0) ? 129 : 127; - memset(enc->y_left_, 129, 16); - memset(enc->u_left_, 129, 8); - memset(enc->v_left_, 129, 8); - it->left_nz_[8] = 0; -} - -static void InitTop(VP8EncIterator* const it) { - const VP8Encoder* const enc = it->enc_; - const size_t top_size = enc->mb_w_ * 16; - memset(enc->y_top_, 127, 2 * top_size); - memset(enc->nz_, 0, enc->mb_w_ * sizeof(*enc->nz_)); -} - -void VP8IteratorReset(VP8EncIterator* const it) { - VP8Encoder* const enc = it->enc_; - it->x_ = 0; - it->y_ = 0; - it->y_offset_ = 0; - it->uv_offset_ = 0; - it->mb_ = enc->mb_info_; - it->preds_ = enc->preds_; - it->nz_ = enc->nz_; - it->bw_ = &enc->parts_[0]; - it->done_ = enc->mb_w_* enc->mb_h_; - InitTop(it); - InitLeft(it); - memset(it->bit_count_, 0, sizeof(it->bit_count_)); - it->do_trellis_ = 0; -} - -void VP8IteratorInit(VP8Encoder* const enc, VP8EncIterator* const it) { - it->enc_ = enc; - it->y_stride_ = enc->pic_->y_stride; - it->uv_stride_ = enc->pic_->uv_stride; - // TODO(later): for multithreading, these should be owned by 'it'. - it->yuv_in_ = enc->yuv_in_; - it->yuv_out_ = enc->yuv_out_; - it->yuv_out2_ = enc->yuv_out2_; - it->yuv_p_ = enc->yuv_p_; - it->lf_stats_ = enc->lf_stats_; - it->percent0_ = enc->percent_; - VP8IteratorReset(it); -} - -int VP8IteratorProgress(const VP8EncIterator* const it, int delta) { - VP8Encoder* const enc = it->enc_; - if (delta && enc->pic_->progress_hook) { - const int percent = (enc->mb_h_ <= 1) - ? it->percent0_ - : it->percent0_ + delta * it->y_ / (enc->mb_h_ - 1); - return WebPReportProgress(enc->pic_, percent, &enc->percent_); - } - return 1; -} - -//------------------------------------------------------------------------------ -// Import the source samples into the cache. Takes care of replicating -// boundary pixels if necessary. - -static void ImportBlock(const uint8_t* src, int src_stride, - uint8_t* dst, int w, int h, int size) { - int i; - for (i = 0; i < h; ++i) { - memcpy(dst, src, w); - if (w < size) { - memset(dst + w, dst[w - 1], size - w); - } - dst += BPS; - src += src_stride; - } - for (i = h; i < size; ++i) { - memcpy(dst, dst - BPS, size); - dst += BPS; - } -} - -void VP8IteratorImport(const VP8EncIterator* const it) { - const VP8Encoder* const enc = it->enc_; - const int x = it->x_, y = it->y_; - const WebPPicture* const pic = enc->pic_; - const uint8_t* const ysrc = pic->y + (y * pic->y_stride + x) * 16; - const uint8_t* const usrc = pic->u + (y * pic->uv_stride + x) * 8; - const uint8_t* const vsrc = pic->v + (y * pic->uv_stride + x) * 8; - uint8_t* const ydst = it->yuv_in_ + Y_OFF; - uint8_t* const udst = it->yuv_in_ + U_OFF; - uint8_t* const vdst = it->yuv_in_ + V_OFF; - int w = (pic->width - x * 16); - int h = (pic->height - y * 16); - - if (w > 16) w = 16; - if (h > 16) h = 16; - - // Luma plane - ImportBlock(ysrc, pic->y_stride, ydst, w, h, 16); - - { // U/V planes - const int uv_w = (w + 1) >> 1; - const int uv_h = (h + 1) >> 1; - ImportBlock(usrc, pic->uv_stride, udst, uv_w, uv_h, 8); - ImportBlock(vsrc, pic->uv_stride, vdst, uv_w, uv_h, 8); - } -} - -//------------------------------------------------------------------------------ -// Copy back the compressed samples into user space if requested. - -static void ExportBlock(const uint8_t* src, uint8_t* dst, int dst_stride, - int w, int h) { - while (h-- > 0) { - memcpy(dst, src, w); - dst += dst_stride; - src += BPS; - } -} - -void VP8IteratorExport(const VP8EncIterator* const it) { - const VP8Encoder* const enc = it->enc_; - if (enc->config_->show_compressed) { - const int x = it->x_, y = it->y_; - const uint8_t* const ysrc = it->yuv_out_ + Y_OFF; - const uint8_t* const usrc = it->yuv_out_ + U_OFF; - const uint8_t* const vsrc = it->yuv_out_ + V_OFF; - const WebPPicture* const pic = enc->pic_; - uint8_t* const ydst = pic->y + (y * pic->y_stride + x) * 16; - uint8_t* const udst = pic->u + (y * pic->uv_stride + x) * 8; - uint8_t* const vdst = pic->v + (y * pic->uv_stride + x) * 8; - int w = (pic->width - x * 16); - int h = (pic->height - y * 16); - - if (w > 16) w = 16; - if (h > 16) h = 16; - - // Luma plane - ExportBlock(ysrc, ydst, pic->y_stride, w, h); - - { // U/V planes - const int uv_w = (w + 1) >> 1; - const int uv_h = (h + 1) >> 1; - ExportBlock(usrc, udst, pic->uv_stride, uv_w, uv_h); - ExportBlock(vsrc, vdst, pic->uv_stride, uv_w, uv_h); - } - } -} - -//------------------------------------------------------------------------------ -// Non-zero contexts setup/teardown - -// Nz bits: -// 0 1 2 3 Y -// 4 5 6 7 -// 8 9 10 11 -// 12 13 14 15 -// 16 17 U -// 18 19 -// 20 21 V -// 22 23 -// 24 DC-intra16 - -// Convert packed context to byte array -#define BIT(nz, n) (!!((nz) & (1 << (n)))) - -void VP8IteratorNzToBytes(VP8EncIterator* const it) { - const int tnz = it->nz_[0], lnz = it->nz_[-1]; - int* const top_nz = it->top_nz_; - int* const left_nz = it->left_nz_; - - // Top-Y - top_nz[0] = BIT(tnz, 12); - top_nz[1] = BIT(tnz, 13); - top_nz[2] = BIT(tnz, 14); - top_nz[3] = BIT(tnz, 15); - // Top-U - top_nz[4] = BIT(tnz, 18); - top_nz[5] = BIT(tnz, 19); - // Top-V - top_nz[6] = BIT(tnz, 22); - top_nz[7] = BIT(tnz, 23); - // DC - top_nz[8] = BIT(tnz, 24); - - // left-Y - left_nz[0] = BIT(lnz, 3); - left_nz[1] = BIT(lnz, 7); - left_nz[2] = BIT(lnz, 11); - left_nz[3] = BIT(lnz, 15); - // left-U - left_nz[4] = BIT(lnz, 17); - left_nz[5] = BIT(lnz, 19); - // left-V - left_nz[6] = BIT(lnz, 21); - left_nz[7] = BIT(lnz, 23); - // left-DC is special, iterated separately -} - -void VP8IteratorBytesToNz(VP8EncIterator* const it) { - uint32_t nz = 0; - const int* const top_nz = it->top_nz_; - const int* const left_nz = it->left_nz_; - // top - nz |= (top_nz[0] << 12) | (top_nz[1] << 13); - nz |= (top_nz[2] << 14) | (top_nz[3] << 15); - nz |= (top_nz[4] << 18) | (top_nz[5] << 19); - nz |= (top_nz[6] << 22) | (top_nz[7] << 23); - nz |= (top_nz[8] << 24); // we propagate the _top_ bit, esp. for intra4 - // left - nz |= (left_nz[0] << 3) | (left_nz[1] << 7); - nz |= (left_nz[2] << 11); - nz |= (left_nz[4] << 17) | (left_nz[6] << 21); - - *it->nz_ = nz; -} - -#undef BIT - -//------------------------------------------------------------------------------ -// Advance to the next position, doing the bookeeping. - -int VP8IteratorNext(VP8EncIterator* const it, - const uint8_t* const block_to_save) { - VP8Encoder* const enc = it->enc_; - if (block_to_save) { - const int x = it->x_, y = it->y_; - const uint8_t* const ysrc = block_to_save + Y_OFF; - const uint8_t* const usrc = block_to_save + U_OFF; - if (x < enc->mb_w_ - 1) { // left - int i; - for (i = 0; i < 16; ++i) { - enc->y_left_[i] = ysrc[15 + i * BPS]; - } - for (i = 0; i < 8; ++i) { - enc->u_left_[i] = usrc[7 + i * BPS]; - enc->v_left_[i] = usrc[15 + i * BPS]; - } - // top-left (before 'top'!) - enc->y_left_[-1] = enc->y_top_[x * 16 + 15]; - enc->u_left_[-1] = enc->uv_top_[x * 16 + 0 + 7]; - enc->v_left_[-1] = enc->uv_top_[x * 16 + 8 + 7]; - } - if (y < enc->mb_h_ - 1) { // top - memcpy(enc->y_top_ + x * 16, ysrc + 15 * BPS, 16); - memcpy(enc->uv_top_ + x * 16, usrc + 7 * BPS, 8 + 8); - } - } - - it->mb_++; - it->preds_ += 4; - it->nz_++; - it->x_++; - if (it->x_ == enc->mb_w_) { - it->x_ = 0; - it->y_++; - it->bw_ = &enc->parts_[it->y_ & (enc->num_parts_ - 1)]; - it->preds_ = enc->preds_ + it->y_ * 4 * enc->preds_w_; - it->nz_ = enc->nz_; - InitLeft(it); - } - return (0 < --it->done_); -} - -//------------------------------------------------------------------------------ -// Helper function to set mode properties - -void VP8SetIntra16Mode(const VP8EncIterator* const it, int mode) { - uint8_t* preds = it->preds_; - int y; - for (y = 0; y < 4; ++y) { - memset(preds, mode, 4); - preds += it->enc_->preds_w_; - } - it->mb_->type_ = 1; -} - -void VP8SetIntra4Mode(const VP8EncIterator* const it, const uint8_t* modes) { - uint8_t* preds = it->preds_; - int y; - for (y = 4; y > 0; --y) { - memcpy(preds, modes, 4 * sizeof(*modes)); - preds += it->enc_->preds_w_; - modes += 4; - } - it->mb_->type_ = 0; -} - -void VP8SetIntraUVMode(const VP8EncIterator* const it, int mode) { - it->mb_->uv_mode_ = mode; -} - -void VP8SetSkip(const VP8EncIterator* const it, int skip) { - it->mb_->skip_ = skip; -} - -void VP8SetSegment(const VP8EncIterator* const it, int segment) { - it->mb_->segment_ = segment; -} - -//------------------------------------------------------------------------------ -// Intra4x4 sub-blocks iteration -// -// We store and update the boundary samples into an array of 37 pixels. They -// are updated as we iterate and reconstructs each intra4x4 blocks in turn. -// The position of the samples has the following snake pattern: -// -// 16|17 18 19 20|21 22 23 24|25 26 27 28|29 30 31 32|33 34 35 36 <- Top-right -// --+-----------+-----------+-----------+-----------+ -// 15| 19| 23| 27| 31| -// 14| 18| 22| 26| 30| -// 13| 17| 21| 25| 29| -// 12|13 14 15 16|17 18 19 20|21 22 23 24|25 26 27 28| -// --+-----------+-----------+-----------+-----------+ -// 11| 15| 19| 23| 27| -// 10| 14| 18| 22| 26| -// 9| 13| 17| 21| 25| -// 8| 9 10 11 12|13 14 15 16|17 18 19 20|21 22 23 24| -// --+-----------+-----------+-----------+-----------+ -// 7| 11| 15| 19| 23| -// 6| 10| 14| 18| 22| -// 5| 9| 13| 17| 21| -// 4| 5 6 7 8| 9 10 11 12|13 14 15 16|17 18 19 20| -// --+-----------+-----------+-----------+-----------+ -// 3| 7| 11| 15| 19| -// 2| 6| 10| 14| 18| -// 1| 5| 9| 13| 17| -// 0| 1 2 3 4| 5 6 7 8| 9 10 11 12|13 14 15 16| -// --+-----------+-----------+-----------+-----------+ - -// Array to record the position of the top sample to pass to the prediction -// functions in dsp.c. -static const uint8_t VP8TopLeftI4[16] = { - 17, 21, 25, 29, - 13, 17, 21, 25, - 9, 13, 17, 21, - 5, 9, 13, 17 -}; - -void VP8IteratorStartI4(VP8EncIterator* const it) { - const VP8Encoder* const enc = it->enc_; - int i; - - it->i4_ = 0; // first 4x4 sub-block - it->i4_top_ = it->i4_boundary_ + VP8TopLeftI4[0]; - - // Import the boundary samples - for (i = 0; i < 17; ++i) { // left - it->i4_boundary_[i] = enc->y_left_[15 - i]; - } - for (i = 0; i < 16; ++i) { // top - it->i4_boundary_[17 + i] = enc->y_top_[it->x_ * 16 + i]; - } - // top-right samples have a special case on the far right of the picture - if (it->x_ < enc->mb_w_ - 1) { - for (i = 16; i < 16 + 4; ++i) { - it->i4_boundary_[17 + i] = enc->y_top_[it->x_ * 16 + i]; - } - } else { // else, replicate the last valid pixel four times - for (i = 16; i < 16 + 4; ++i) { - it->i4_boundary_[17 + i] = it->i4_boundary_[17 + 15]; - } - } - VP8IteratorNzToBytes(it); // import the non-zero context -} - -int VP8IteratorRotateI4(VP8EncIterator* const it, - const uint8_t* const yuv_out) { - const uint8_t* const blk = yuv_out + VP8Scan[it->i4_]; - uint8_t* const top = it->i4_top_; - int i; - - // Update the cache with 7 fresh samples - for (i = 0; i <= 3; ++i) { - top[-4 + i] = blk[i + 3 * BPS]; // store future top samples - } - if ((it->i4_ & 3) != 3) { // if not on the right sub-blocks #3, #7, #11, #15 - for (i = 0; i <= 2; ++i) { // store future left samples - top[i] = blk[3 + (2 - i) * BPS]; - } - } else { // else replicate top-right samples, as says the specs. - for (i = 0; i <= 3; ++i) { - top[i] = top[i + 4]; - } - } - // move pointers to next sub-block - ++it->i4_; - if (it->i4_ == 16) { // we're done - return 0; - } - - it->i4_top_ = it->i4_boundary_ + VP8TopLeftI4[it->i4_]; - return 1; -} - -//------------------------------------------------------------------------------ - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif diff --git a/external/libwebp/enc/layer.c b/external/libwebp/enc/layer.c deleted file mode 100644 index 423127df63..0000000000 --- a/external/libwebp/enc/layer.c +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2011 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Enhancement layer (for YUV444/422) -// -// Author: Skal (pascal.massimino@gmail.com) - -#include <stdlib.h> - -#include "./vp8enci.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -//------------------------------------------------------------------------------ - -void VP8EncInitLayer(VP8Encoder* const enc) { - enc->use_layer_ = (enc->pic_->u0 != NULL); - enc->layer_data_size_ = 0; - enc->layer_data_ = NULL; - if (enc->use_layer_) { - VP8BitWriterInit(&enc->layer_bw_, enc->mb_w_ * enc->mb_h_ * 3); - } -} - -void VP8EncCodeLayerBlock(VP8EncIterator* it) { - (void)it; // remove a warning -} - -int VP8EncFinishLayer(VP8Encoder* const enc) { - if (enc->use_layer_) { - enc->layer_data_ = VP8BitWriterFinish(&enc->layer_bw_); - enc->layer_data_size_ = VP8BitWriterSize(&enc->layer_bw_); - } - return 1; -} - -void VP8EncDeleteLayer(VP8Encoder* enc) { - free(enc->layer_data_); -} - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif diff --git a/external/libwebp/enc/picture.c b/external/libwebp/enc/picture.c deleted file mode 100644 index 44eed06083..0000000000 --- a/external/libwebp/enc/picture.c +++ /dev/null @@ -1,1041 +0,0 @@ -// Copyright 2011 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// WebPPicture utils: colorspace conversion, crop, ... -// -// Author: Skal (pascal.massimino@gmail.com) - -#include <assert.h> -#include <stdlib.h> -#include <math.h> - -#include "./vp8enci.h" -#include "../utils/rescaler.h" -#include "../utils/utils.h" -#include "../dsp/dsp.h" -#include "../dsp/yuv.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -#define HALVE(x) (((x) + 1) >> 1) -#define IS_YUV_CSP(csp, YUV_CSP) (((csp) & WEBP_CSP_UV_MASK) == (YUV_CSP)) - -static const union { - uint32_t argb; - uint8_t bytes[4]; -} test_endian = { 0xff000000u }; -#define ALPHA_IS_LAST (test_endian.bytes[3] == 0xff) - -//------------------------------------------------------------------------------ -// WebPPicture -//------------------------------------------------------------------------------ - -int WebPPictureAlloc(WebPPicture* picture) { - if (picture != NULL) { - const WebPEncCSP uv_csp = picture->colorspace & WEBP_CSP_UV_MASK; - const int has_alpha = picture->colorspace & WEBP_CSP_ALPHA_BIT; - const int width = picture->width; - const int height = picture->height; - - if (!picture->use_argb) { - const int y_stride = width; - const int uv_width = HALVE(width); - const int uv_height = HALVE(height); - const int uv_stride = uv_width; - int uv0_stride = 0; - int a_width, a_stride; - uint64_t y_size, uv_size, uv0_size, a_size, total_size; - uint8_t* mem; - - // U/V - switch (uv_csp) { - case WEBP_YUV420: - break; -#ifdef WEBP_EXPERIMENTAL_FEATURES - case WEBP_YUV400: // for now, we'll just reset the U/V samples - break; - case WEBP_YUV422: - uv0_stride = uv_width; - break; - case WEBP_YUV444: - uv0_stride = width; - break; -#endif - default: - return 0; - } - uv0_size = height * uv0_stride; - - // alpha - a_width = has_alpha ? width : 0; - a_stride = a_width; - y_size = (uint64_t)y_stride * height; - uv_size = (uint64_t)uv_stride * uv_height; - a_size = (uint64_t)a_stride * height; - - total_size = y_size + a_size + 2 * uv_size + 2 * uv0_size; - - // Security and validation checks - if (width <= 0 || height <= 0 || // luma/alpha param error - uv_width < 0 || uv_height < 0) { // u/v param error - return 0; - } - // Clear previous buffer and allocate a new one. - WebPPictureFree(picture); // erase previous buffer - mem = (uint8_t*)WebPSafeMalloc(total_size, sizeof(*mem)); - if (mem == NULL) return 0; - - // From now on, we're in the clear, we can no longer fail... - picture->memory_ = (void*)mem; - picture->y_stride = y_stride; - picture->uv_stride = uv_stride; - picture->a_stride = a_stride; - picture->uv0_stride = uv0_stride; - // TODO(skal): we could align the y/u/v planes and adjust stride. - picture->y = mem; - mem += y_size; - - picture->u = mem; - mem += uv_size; - picture->v = mem; - mem += uv_size; - - if (a_size) { - picture->a = mem; - mem += a_size; - } - if (uv0_size) { - picture->u0 = mem; - mem += uv0_size; - picture->v0 = mem; - mem += uv0_size; - } - } else { - void* memory; - const uint64_t argb_size = (uint64_t)width * height; - if (width <= 0 || height <= 0) { - return 0; - } - // Clear previous buffer and allocate a new one. - WebPPictureFree(picture); // erase previous buffer - memory = WebPSafeMalloc(argb_size, sizeof(*picture->argb)); - if (memory == NULL) return 0; - - // TODO(skal): align plane to cache line? - picture->memory_argb_ = memory; - picture->argb = (uint32_t*)memory; - picture->argb_stride = width; - } - } - return 1; -} - -// Remove reference to the ARGB buffer (doesn't free anything). -static void PictureResetARGB(WebPPicture* const picture) { - picture->memory_argb_ = NULL; - picture->argb = NULL; - picture->argb_stride = 0; -} - -// Remove reference to the YUVA buffer (doesn't free anything). -static void PictureResetYUVA(WebPPicture* const picture) { - picture->memory_ = NULL; - picture->y = picture->u = picture->v = picture->a = NULL; - picture->u0 = picture->v0 = NULL; - picture->y_stride = picture->uv_stride = 0; - picture->a_stride = 0; - picture->uv0_stride = 0; -} - -// Grab the 'specs' (writer, *opaque, width, height...) from 'src' and copy them -// into 'dst'. Mark 'dst' as not owning any memory. -static void WebPPictureGrabSpecs(const WebPPicture* const src, - WebPPicture* const dst) { - assert(src != NULL && dst != NULL); - *dst = *src; - PictureResetYUVA(dst); - PictureResetARGB(dst); -} - -// Allocate a new argb buffer, discarding any existing one and preserving -// the other YUV(A) buffer. -static int PictureAllocARGB(WebPPicture* const picture) { - WebPPicture tmp; - free(picture->memory_argb_); - PictureResetARGB(picture); - picture->use_argb = 1; - WebPPictureGrabSpecs(picture, &tmp); - if (!WebPPictureAlloc(&tmp)) { - return WebPEncodingSetError(picture, VP8_ENC_ERROR_OUT_OF_MEMORY); - } - picture->memory_argb_ = tmp.memory_argb_; - picture->argb = tmp.argb; - picture->argb_stride = tmp.argb_stride; - return 1; -} - -// Release memory owned by 'picture' (both YUV and ARGB buffers). -void WebPPictureFree(WebPPicture* picture) { - if (picture != NULL) { - free(picture->memory_); - free(picture->memory_argb_); - PictureResetYUVA(picture); - PictureResetARGB(picture); - } -} - -//------------------------------------------------------------------------------ -// Picture copying - -// Not worth moving to dsp/enc.c (only used here). -static void CopyPlane(const uint8_t* src, int src_stride, - uint8_t* dst, int dst_stride, int width, int height) { - while (height-- > 0) { - memcpy(dst, src, width); - src += src_stride; - dst += dst_stride; - } -} - -// Adjust top-left corner to chroma sample position. -static void SnapTopLeftPosition(const WebPPicture* const pic, - int* const left, int* const top) { - if (!pic->use_argb) { - const int is_yuv422 = IS_YUV_CSP(pic->colorspace, WEBP_YUV422); - if (IS_YUV_CSP(pic->colorspace, WEBP_YUV420) || is_yuv422) { - *left &= ~1; - if (!is_yuv422) *top &= ~1; - } - } -} - -// Adjust top-left corner and verify that the sub-rectangle is valid. -static int AdjustAndCheckRectangle(const WebPPicture* const pic, - int* const left, int* const top, - int width, int height) { - SnapTopLeftPosition(pic, left, top); - if ((*left) < 0 || (*top) < 0) return 0; - if (width <= 0 || height <= 0) return 0; - if ((*left) + width > pic->width) return 0; - if ((*top) + height > pic->height) return 0; - return 1; -} - -int WebPPictureCopy(const WebPPicture* src, WebPPicture* dst) { - if (src == NULL || dst == NULL) return 0; - if (src == dst) return 1; - - WebPPictureGrabSpecs(src, dst); - if (!WebPPictureAlloc(dst)) return 0; - - if (!src->use_argb) { - CopyPlane(src->y, src->y_stride, - dst->y, dst->y_stride, dst->width, dst->height); - CopyPlane(src->u, src->uv_stride, - dst->u, dst->uv_stride, HALVE(dst->width), HALVE(dst->height)); - CopyPlane(src->v, src->uv_stride, - dst->v, dst->uv_stride, HALVE(dst->width), HALVE(dst->height)); - if (dst->a != NULL) { - CopyPlane(src->a, src->a_stride, - dst->a, dst->a_stride, dst->width, dst->height); - } -#ifdef WEBP_EXPERIMENTAL_FEATURES - if (dst->u0 != NULL) { - int uv0_width = src->width; - if (IS_YUV_CSP(dst->colorspace, WEBP_YUV422)) { - uv0_width = HALVE(uv0_width); - } - CopyPlane(src->u0, src->uv0_stride, - dst->u0, dst->uv0_stride, uv0_width, dst->height); - CopyPlane(src->v0, src->uv0_stride, - dst->v0, dst->uv0_stride, uv0_width, dst->height); - } -#endif - } else { - CopyPlane((const uint8_t*)src->argb, 4 * src->argb_stride, - (uint8_t*)dst->argb, 4 * dst->argb_stride, - 4 * dst->width, dst->height); - } - return 1; -} - -int WebPPictureIsView(const WebPPicture* picture) { - if (picture == NULL) return 0; - if (picture->use_argb) { - return (picture->memory_argb_ == NULL); - } - return (picture->memory_ == NULL); -} - -int WebPPictureView(const WebPPicture* src, - int left, int top, int width, int height, - WebPPicture* dst) { - if (src == NULL || dst == NULL) return 0; - - // verify rectangle position. - if (!AdjustAndCheckRectangle(src, &left, &top, width, height)) return 0; - - if (src != dst) { // beware of aliasing! We don't want to leak 'memory_'. - WebPPictureGrabSpecs(src, dst); - } - dst->width = width; - dst->height = height; - if (!src->use_argb) { - dst->y = src->y + top * src->y_stride + left; - dst->u = src->u + (top >> 1) * src->uv_stride + (left >> 1); - dst->v = src->v + (top >> 1) * src->uv_stride + (left >> 1); - if (src->a != NULL) { - dst->a = src->a + top * src->a_stride + left; - } -#ifdef WEBP_EXPERIMENTAL_FEATURES - if (src->u0 != NULL) { - const int left_pos = - IS_YUV_CSP(dst->colorspace, WEBP_YUV422) ? (left >> 1) : left; - dst->u0 = src->u0 + top * src->uv0_stride + left_pos; - dst->v0 = src->v0 + top * src->uv0_stride + left_pos; - } -#endif - } else { - dst->argb = src->argb + top * src->argb_stride + left; - } - return 1; -} - -//------------------------------------------------------------------------------ -// Picture cropping - -int WebPPictureCrop(WebPPicture* pic, - int left, int top, int width, int height) { - WebPPicture tmp; - - if (pic == NULL) return 0; - if (!AdjustAndCheckRectangle(pic, &left, &top, width, height)) return 0; - - WebPPictureGrabSpecs(pic, &tmp); - tmp.width = width; - tmp.height = height; - if (!WebPPictureAlloc(&tmp)) return 0; - - if (!pic->use_argb) { - const int y_offset = top * pic->y_stride + left; - const int uv_offset = (top / 2) * pic->uv_stride + left / 2; - CopyPlane(pic->y + y_offset, pic->y_stride, - tmp.y, tmp.y_stride, width, height); - CopyPlane(pic->u + uv_offset, pic->uv_stride, - tmp.u, tmp.uv_stride, HALVE(width), HALVE(height)); - CopyPlane(pic->v + uv_offset, pic->uv_stride, - tmp.v, tmp.uv_stride, HALVE(width), HALVE(height)); - - if (tmp.a != NULL) { - const int a_offset = top * pic->a_stride + left; - CopyPlane(pic->a + a_offset, pic->a_stride, - tmp.a, tmp.a_stride, width, height); - } -#ifdef WEBP_EXPERIMENTAL_FEATURES - if (tmp.u0 != NULL) { - int w = width; - int left_pos = left; - if (IS_YUV_CSP(tmp.colorspace, WEBP_YUV422)) { - w = HALVE(w); - left_pos = HALVE(left_pos); - } - CopyPlane(pic->u0 + top * pic->uv0_stride + left_pos, pic->uv0_stride, - tmp.u0, tmp.uv0_stride, w, height); - CopyPlane(pic->v0 + top * pic->uv0_stride + left_pos, pic->uv0_stride, - tmp.v0, tmp.uv0_stride, w, height); - } -#endif - } else { - const uint8_t* const src = - (const uint8_t*)(pic->argb + top * pic->argb_stride + left); - CopyPlane(src, pic->argb_stride * 4, - (uint8_t*)tmp.argb, tmp.argb_stride * 4, - width * 4, height); - } - WebPPictureFree(pic); - *pic = tmp; - return 1; -} - -//------------------------------------------------------------------------------ -// Simple picture rescaler - -static void RescalePlane(const uint8_t* src, - int src_width, int src_height, int src_stride, - uint8_t* dst, - int dst_width, int dst_height, int dst_stride, - int32_t* const work, - int num_channels) { - WebPRescaler rescaler; - int y = 0; - WebPRescalerInit(&rescaler, src_width, src_height, - dst, dst_width, dst_height, dst_stride, - num_channels, - src_width, dst_width, - src_height, dst_height, - work); - memset(work, 0, 2 * dst_width * num_channels * sizeof(*work)); - while (y < src_height) { - y += WebPRescalerImport(&rescaler, src_height - y, - src + y * src_stride, src_stride); - WebPRescalerExport(&rescaler); - } -} - -int WebPPictureRescale(WebPPicture* pic, int width, int height) { - WebPPicture tmp; - int prev_width, prev_height; - int32_t* work; - - if (pic == NULL) return 0; - prev_width = pic->width; - prev_height = pic->height; - // if width is unspecified, scale original proportionally to height ratio. - if (width == 0) { - width = (prev_width * height + prev_height / 2) / prev_height; - } - // if height is unspecified, scale original proportionally to width ratio. - if (height == 0) { - height = (prev_height * width + prev_width / 2) / prev_width; - } - // Check if the overall dimensions still make sense. - if (width <= 0 || height <= 0) return 0; - - WebPPictureGrabSpecs(pic, &tmp); - tmp.width = width; - tmp.height = height; - if (!WebPPictureAlloc(&tmp)) return 0; - - if (!pic->use_argb) { - work = (int32_t*)WebPSafeMalloc(2ULL * width, sizeof(*work)); - if (work == NULL) { - WebPPictureFree(&tmp); - return 0; - } - - RescalePlane(pic->y, prev_width, prev_height, pic->y_stride, - tmp.y, width, height, tmp.y_stride, work, 1); - RescalePlane(pic->u, - HALVE(prev_width), HALVE(prev_height), pic->uv_stride, - tmp.u, - HALVE(width), HALVE(height), tmp.uv_stride, work, 1); - RescalePlane(pic->v, - HALVE(prev_width), HALVE(prev_height), pic->uv_stride, - tmp.v, - HALVE(width), HALVE(height), tmp.uv_stride, work, 1); - - if (tmp.a != NULL) { - RescalePlane(pic->a, prev_width, prev_height, pic->a_stride, - tmp.a, width, height, tmp.a_stride, work, 1); - } -#ifdef WEBP_EXPERIMENTAL_FEATURES - if (tmp.u0 != NULL) { - const int s = IS_YUV_CSP(tmp.colorspace, WEBP_YUV422) ? 2 : 1; - RescalePlane( - pic->u0, (prev_width + s / 2) / s, prev_height, pic->uv0_stride, - tmp.u0, (width + s / 2) / s, height, tmp.uv0_stride, work, 1); - RescalePlane( - pic->v0, (prev_width + s / 2) / s, prev_height, pic->uv0_stride, - tmp.v0, (width + s / 2) / s, height, tmp.uv0_stride, work, 1); - } -#endif - } else { - work = (int32_t*)WebPSafeMalloc(2ULL * width * 4, sizeof(*work)); - if (work == NULL) { - WebPPictureFree(&tmp); - return 0; - } - - RescalePlane((const uint8_t*)pic->argb, prev_width, prev_height, - pic->argb_stride * 4, - (uint8_t*)tmp.argb, width, height, - tmp.argb_stride * 4, - work, 4); - - } - WebPPictureFree(pic); - free(work); - *pic = tmp; - return 1; -} - -//------------------------------------------------------------------------------ -// WebPMemoryWriter: Write-to-memory - -void WebPMemoryWriterInit(WebPMemoryWriter* writer) { - writer->mem = NULL; - writer->size = 0; - writer->max_size = 0; -} - -int WebPMemoryWrite(const uint8_t* data, size_t data_size, - const WebPPicture* picture) { - WebPMemoryWriter* const w = (WebPMemoryWriter*)picture->custom_ptr; - uint64_t next_size; - if (w == NULL) { - return 1; - } - next_size = (uint64_t)w->size + data_size; - if (next_size > w->max_size) { - uint8_t* new_mem; - uint64_t next_max_size = 2ULL * w->max_size; - if (next_max_size < next_size) next_max_size = next_size; - if (next_max_size < 8192ULL) next_max_size = 8192ULL; - new_mem = (uint8_t*)WebPSafeMalloc(next_max_size, 1); - if (new_mem == NULL) { - return 0; - } - if (w->size > 0) { - memcpy(new_mem, w->mem, w->size); - } - free(w->mem); - w->mem = new_mem; - // down-cast is ok, thanks to WebPSafeMalloc - w->max_size = (size_t)next_max_size; - } - if (data_size > 0) { - memcpy(w->mem + w->size, data, data_size); - w->size += data_size; - } - return 1; -} - -//------------------------------------------------------------------------------ -// Detection of non-trivial transparency - -// Returns true if alpha[] has non-0xff values. -static int CheckNonOpaque(const uint8_t* alpha, int width, int height, - int x_step, int y_step) { - if (alpha == NULL) return 0; - while (height-- > 0) { - int x; - for (x = 0; x < width * x_step; x += x_step) { - if (alpha[x] != 0xff) return 1; // TODO(skal): check 4/8 bytes at a time. - } - alpha += y_step; - } - return 0; -} - -// Checking for the presence of non-opaque alpha. -int WebPPictureHasTransparency(const WebPPicture* picture) { - if (picture == NULL) return 0; - if (!picture->use_argb) { - return CheckNonOpaque(picture->a, picture->width, picture->height, - 1, picture->a_stride); - } else { - int x, y; - const uint32_t* argb = picture->argb; - if (argb == NULL) return 0; - for (y = 0; y < picture->height; ++y) { - for (x = 0; x < picture->width; ++x) { - if (argb[x] < 0xff000000u) return 1; // test any alpha values != 0xff - } - argb += picture->argb_stride; - } - } - return 0; -} - -//------------------------------------------------------------------------------ -// RGB -> YUV conversion - -// TODO: we can do better than simply 2x2 averaging on U/V samples. -#define SUM4(ptr) ((ptr)[0] + (ptr)[step] + \ - (ptr)[rgb_stride] + (ptr)[rgb_stride + step]) -#define SUM2H(ptr) (2 * (ptr)[0] + 2 * (ptr)[step]) -#define SUM2V(ptr) (2 * (ptr)[0] + 2 * (ptr)[rgb_stride]) -#define SUM1(ptr) (4 * (ptr)[0]) -#define RGB_TO_UV(x, y, SUM) { \ - const int src = (2 * (step * (x) + (y) * rgb_stride)); \ - const int dst = (x) + (y) * picture->uv_stride; \ - const int r = SUM(r_ptr + src); \ - const int g = SUM(g_ptr + src); \ - const int b = SUM(b_ptr + src); \ - picture->u[dst] = VP8RGBToU(r, g, b); \ - picture->v[dst] = VP8RGBToV(r, g, b); \ -} - -#define RGB_TO_UV0(x_in, x_out, y, SUM) { \ - const int src = (step * (x_in) + (y) * rgb_stride); \ - const int dst = (x_out) + (y) * picture->uv0_stride; \ - const int r = SUM(r_ptr + src); \ - const int g = SUM(g_ptr + src); \ - const int b = SUM(b_ptr + src); \ - picture->u0[dst] = VP8RGBToU(r, g, b); \ - picture->v0[dst] = VP8RGBToV(r, g, b); \ -} - -static void MakeGray(WebPPicture* const picture) { - int y; - const int uv_width = HALVE(picture->width); - const int uv_height = HALVE(picture->height); - for (y = 0; y < uv_height; ++y) { - memset(picture->u + y * picture->uv_stride, 128, uv_width); - memset(picture->v + y * picture->uv_stride, 128, uv_width); - } -} - -static int ImportYUVAFromRGBA(const uint8_t* const r_ptr, - const uint8_t* const g_ptr, - const uint8_t* const b_ptr, - const uint8_t* const a_ptr, - int step, // bytes per pixel - int rgb_stride, // bytes per scanline - WebPPicture* const picture) { - const WebPEncCSP uv_csp = picture->colorspace & WEBP_CSP_UV_MASK; - int x, y; - const int width = picture->width; - const int height = picture->height; - const int has_alpha = CheckNonOpaque(a_ptr, width, height, step, rgb_stride); - - picture->colorspace = uv_csp; - picture->use_argb = 0; - if (has_alpha) { - picture->colorspace |= WEBP_CSP_ALPHA_BIT; - } - if (!WebPPictureAlloc(picture)) return 0; - - // Import luma plane - for (y = 0; y < height; ++y) { - for (x = 0; x < width; ++x) { - const int offset = step * x + y * rgb_stride; - picture->y[x + y * picture->y_stride] = - VP8RGBToY(r_ptr[offset], g_ptr[offset], b_ptr[offset]); - } - } - - // Downsample U/V plane - if (uv_csp != WEBP_YUV400) { - for (y = 0; y < (height >> 1); ++y) { - for (x = 0; x < (width >> 1); ++x) { - RGB_TO_UV(x, y, SUM4); - } - if (width & 1) { - RGB_TO_UV(x, y, SUM2V); - } - } - if (height & 1) { - for (x = 0; x < (width >> 1); ++x) { - RGB_TO_UV(x, y, SUM2H); - } - if (width & 1) { - RGB_TO_UV(x, y, SUM1); - } - } - -#ifdef WEBP_EXPERIMENTAL_FEATURES - // Store original U/V samples too - if (uv_csp == WEBP_YUV422) { - for (y = 0; y < height; ++y) { - for (x = 0; x < (width >> 1); ++x) { - RGB_TO_UV0(2 * x, x, y, SUM2H); - } - if (width & 1) { - RGB_TO_UV0(2 * x, x, y, SUM1); - } - } - } else if (uv_csp == WEBP_YUV444) { - for (y = 0; y < height; ++y) { - for (x = 0; x < width; ++x) { - RGB_TO_UV0(x, x, y, SUM1); - } - } - } -#endif - } else { - MakeGray(picture); - } - - if (has_alpha) { - assert(step >= 4); - for (y = 0; y < height; ++y) { - for (x = 0; x < width; ++x) { - picture->a[x + y * picture->a_stride] = - a_ptr[step * x + y * rgb_stride]; - } - } - } - return 1; -} - -static int Import(WebPPicture* const picture, - const uint8_t* const rgb, int rgb_stride, - int step, int swap_rb, int import_alpha) { - const uint8_t* const r_ptr = rgb + (swap_rb ? 2 : 0); - const uint8_t* const g_ptr = rgb + 1; - const uint8_t* const b_ptr = rgb + (swap_rb ? 0 : 2); - const uint8_t* const a_ptr = import_alpha ? rgb + 3 : NULL; - const int width = picture->width; - const int height = picture->height; - - if (!picture->use_argb) { - return ImportYUVAFromRGBA(r_ptr, g_ptr, b_ptr, a_ptr, step, rgb_stride, - picture); - } - if (import_alpha) { - picture->colorspace |= WEBP_CSP_ALPHA_BIT; - } else { - picture->colorspace &= ~WEBP_CSP_ALPHA_BIT; - } - if (!WebPPictureAlloc(picture)) return 0; - - if (!import_alpha) { - int x, y; - for (y = 0; y < height; ++y) { - for (x = 0; x < width; ++x) { - const int offset = step * x + y * rgb_stride; - const uint32_t argb = - 0xff000000u | - (r_ptr[offset] << 16) | - (g_ptr[offset] << 8) | - (b_ptr[offset]); - picture->argb[x + y * picture->argb_stride] = argb; - } - } - } else { - int x, y; - assert(step >= 4); - for (y = 0; y < height; ++y) { - for (x = 0; x < width; ++x) { - const int offset = step * x + y * rgb_stride; - const uint32_t argb = (a_ptr[offset] << 24) | - (r_ptr[offset] << 16) | - (g_ptr[offset] << 8) | - (b_ptr[offset]); - picture->argb[x + y * picture->argb_stride] = argb; - } - } - } - return 1; -} -#undef SUM4 -#undef SUM2V -#undef SUM2H -#undef SUM1 -#undef RGB_TO_UV - -int WebPPictureImportRGB(WebPPicture* picture, - const uint8_t* rgb, int rgb_stride) { - return Import(picture, rgb, rgb_stride, 3, 0, 0); -} - -int WebPPictureImportBGR(WebPPicture* picture, - const uint8_t* rgb, int rgb_stride) { - return Import(picture, rgb, rgb_stride, 3, 1, 0); -} - -int WebPPictureImportRGBA(WebPPicture* picture, - const uint8_t* rgba, int rgba_stride) { - return Import(picture, rgba, rgba_stride, 4, 0, 1); -} - -int WebPPictureImportBGRA(WebPPicture* picture, - const uint8_t* rgba, int rgba_stride) { - return Import(picture, rgba, rgba_stride, 4, 1, 1); -} - -int WebPPictureImportRGBX(WebPPicture* picture, - const uint8_t* rgba, int rgba_stride) { - return Import(picture, rgba, rgba_stride, 4, 0, 0); -} - -int WebPPictureImportBGRX(WebPPicture* picture, - const uint8_t* rgba, int rgba_stride) { - return Import(picture, rgba, rgba_stride, 4, 1, 0); -} - -//------------------------------------------------------------------------------ -// Automatic YUV <-> ARGB conversions. - -int WebPPictureYUVAToARGB(WebPPicture* picture) { - if (picture == NULL) return 0; - if (picture->memory_ == NULL || picture->y == NULL || - picture->u == NULL || picture->v == NULL) { - return WebPEncodingSetError(picture, VP8_ENC_ERROR_NULL_PARAMETER); - } - if ((picture->colorspace & WEBP_CSP_ALPHA_BIT) && picture->a == NULL) { - return WebPEncodingSetError(picture, VP8_ENC_ERROR_NULL_PARAMETER); - } - if ((picture->colorspace & WEBP_CSP_UV_MASK) != WEBP_YUV420) { - return WebPEncodingSetError(picture, VP8_ENC_ERROR_INVALID_CONFIGURATION); - } - // Allocate a new argb buffer (discarding the previous one). - if (!PictureAllocARGB(picture)) return 0; - - // Convert - { - int y; - const int width = picture->width; - const int height = picture->height; - const int argb_stride = 4 * picture->argb_stride; - uint8_t* dst = (uint8_t*)picture->argb; - const uint8_t *cur_u = picture->u, *cur_v = picture->v, *cur_y = picture->y; - WebPUpsampleLinePairFunc upsample = WebPGetLinePairConverter(ALPHA_IS_LAST); - - // First row, with replicated top samples. - upsample(NULL, cur_y, cur_u, cur_v, cur_u, cur_v, NULL, dst, width); - cur_y += picture->y_stride; - dst += argb_stride; - // Center rows. - for (y = 1; y + 1 < height; y += 2) { - const uint8_t* const top_u = cur_u; - const uint8_t* const top_v = cur_v; - cur_u += picture->uv_stride; - cur_v += picture->uv_stride; - upsample(cur_y, cur_y + picture->y_stride, top_u, top_v, cur_u, cur_v, - dst, dst + argb_stride, width); - cur_y += 2 * picture->y_stride; - dst += 2 * argb_stride; - } - // Last row (if needed), with replicated bottom samples. - if (height > 1 && !(height & 1)) { - upsample(cur_y, NULL, cur_u, cur_v, cur_u, cur_v, dst, NULL, width); - } - // Insert alpha values if needed, in replacement for the default 0xff ones. - if (picture->colorspace & WEBP_CSP_ALPHA_BIT) { - for (y = 0; y < height; ++y) { - uint32_t* const dst = picture->argb + y * picture->argb_stride; - const uint8_t* const src = picture->a + y * picture->a_stride; - int x; - for (x = 0; x < width; ++x) { - dst[x] = (dst[x] & 0x00ffffffu) | (src[x] << 24); - } - } - } - } - return 1; -} - -int WebPPictureARGBToYUVA(WebPPicture* picture, WebPEncCSP colorspace) { - if (picture == NULL) return 0; - if (picture->argb == NULL) { - return WebPEncodingSetError(picture, VP8_ENC_ERROR_NULL_PARAMETER); - } else { - const uint8_t* const argb = (const uint8_t*)picture->argb; - const uint8_t* const r = ALPHA_IS_LAST ? argb + 2 : argb + 1; - const uint8_t* const g = ALPHA_IS_LAST ? argb + 1 : argb + 2; - const uint8_t* const b = ALPHA_IS_LAST ? argb + 0 : argb + 3; - const uint8_t* const a = ALPHA_IS_LAST ? argb + 3 : argb + 0; - // We work on a tmp copy of 'picture', because ImportYUVAFromRGBA() - // would be calling WebPPictureFree(picture) otherwise. - WebPPicture tmp = *picture; - PictureResetARGB(&tmp); // reset ARGB buffer so that it's not free()'d. - tmp.use_argb = 0; - tmp.colorspace = colorspace & WEBP_CSP_UV_MASK; - if (!ImportYUVAFromRGBA(r, g, b, a, 4, 4 * picture->argb_stride, &tmp)) { - return WebPEncodingSetError(picture, VP8_ENC_ERROR_OUT_OF_MEMORY); - } - // Copy back the YUV specs into 'picture'. - tmp.argb = picture->argb; - tmp.argb_stride = picture->argb_stride; - tmp.memory_argb_ = picture->memory_argb_; - *picture = tmp; - } - return 1; -} - -//------------------------------------------------------------------------------ -// Helper: clean up fully transparent area to help compressibility. - -#define SIZE 8 -#define SIZE2 (SIZE / 2) -static int is_transparent_area(const uint8_t* ptr, int stride, int size) { - int y, x; - for (y = 0; y < size; ++y) { - for (x = 0; x < size; ++x) { - if (ptr[x]) { - return 0; - } - } - ptr += stride; - } - return 1; -} - -static WEBP_INLINE void flatten(uint8_t* ptr, int v, int stride, int size) { - int y; - for (y = 0; y < size; ++y) { - memset(ptr, v, size); - ptr += stride; - } -} - -void WebPCleanupTransparentArea(WebPPicture* pic) { - int x, y, w, h; - const uint8_t* a_ptr; - int values[3] = { 0 }; - - if (pic == NULL) return; - - a_ptr = pic->a; - if (a_ptr == NULL) return; // nothing to do - - w = pic->width / SIZE; - h = pic->height / SIZE; - for (y = 0; y < h; ++y) { - int need_reset = 1; - for (x = 0; x < w; ++x) { - const int off_a = (y * pic->a_stride + x) * SIZE; - const int off_y = (y * pic->y_stride + x) * SIZE; - const int off_uv = (y * pic->uv_stride + x) * SIZE2; - if (is_transparent_area(a_ptr + off_a, pic->a_stride, SIZE)) { - if (need_reset) { - values[0] = pic->y[off_y]; - values[1] = pic->u[off_uv]; - values[2] = pic->v[off_uv]; - need_reset = 0; - } - flatten(pic->y + off_y, values[0], pic->y_stride, SIZE); - flatten(pic->u + off_uv, values[1], pic->uv_stride, SIZE2); - flatten(pic->v + off_uv, values[2], pic->uv_stride, SIZE2); - } else { - need_reset = 1; - } - } - // ignore the left-overs on right/bottom - } -} - -#undef SIZE -#undef SIZE2 - - -//------------------------------------------------------------------------------ -// Distortion - -// Max value returned in case of exact similarity. -static const double kMinDistortion_dB = 99.; - -int WebPPictureDistortion(const WebPPicture* pic1, const WebPPicture* pic2, - int type, float result[5]) { - int c; - DistoStats stats[5]; - int has_alpha; - - if (pic1 == NULL || pic2 == NULL || - pic1->width != pic2->width || pic1->height != pic2->height || - pic1->y == NULL || pic2->y == NULL || - pic1->u == NULL || pic2->u == NULL || - pic1->v == NULL || pic2->v == NULL || - result == NULL) { - return 0; - } - // TODO(skal): provide distortion for ARGB too. - if (pic1->use_argb == 1 || pic1->use_argb != pic2->use_argb) { - return 0; - } - - has_alpha = !!(pic1->colorspace & WEBP_CSP_ALPHA_BIT); - if (has_alpha != !!(pic2->colorspace & WEBP_CSP_ALPHA_BIT) || - (has_alpha && (pic1->a == NULL || pic2->a == NULL))) { - return 0; - } - - memset(stats, 0, sizeof(stats)); - VP8SSIMAccumulatePlane(pic1->y, pic1->y_stride, - pic2->y, pic2->y_stride, - pic1->width, pic1->height, &stats[0]); - VP8SSIMAccumulatePlane(pic1->u, pic1->uv_stride, - pic2->u, pic2->uv_stride, - (pic1->width + 1) >> 1, (pic1->height + 1) >> 1, - &stats[1]); - VP8SSIMAccumulatePlane(pic1->v, pic1->uv_stride, - pic2->v, pic2->uv_stride, - (pic1->width + 1) >> 1, (pic1->height + 1) >> 1, - &stats[2]); - if (has_alpha) { - VP8SSIMAccumulatePlane(pic1->a, pic1->a_stride, - pic2->a, pic2->a_stride, - pic1->width, pic1->height, &stats[3]); - } - for (c = 0; c <= 4; ++c) { - if (type == 1) { - const double v = VP8SSIMGet(&stats[c]); - result[c] = (float)((v < 1.) ? -10.0 * log10(1. - v) - : kMinDistortion_dB); - } else { - const double v = VP8SSIMGetSquaredError(&stats[c]); - result[c] = (float)((v > 0.) ? -4.3429448 * log(v / (255 * 255.)) - : kMinDistortion_dB); - } - // Accumulate forward - if (c < 4) VP8SSIMAddStats(&stats[c], &stats[4]); - } - return 1; -} - -//------------------------------------------------------------------------------ -// Simplest high-level calls: - -typedef int (*Importer)(WebPPicture* const, const uint8_t* const, int); - -static size_t Encode(const uint8_t* rgba, int width, int height, int stride, - Importer import, float quality_factor, int lossless, - uint8_t** output) { - WebPPicture pic; - WebPConfig config; - WebPMemoryWriter wrt; - int ok; - - if (!WebPConfigPreset(&config, WEBP_PRESET_DEFAULT, quality_factor) || - !WebPPictureInit(&pic)) { - return 0; // shouldn't happen, except if system installation is broken - } - - config.lossless = !!lossless; - pic.use_argb = !!lossless; - pic.width = width; - pic.height = height; - pic.writer = WebPMemoryWrite; - pic.custom_ptr = &wrt; - WebPMemoryWriterInit(&wrt); - - ok = import(&pic, rgba, stride) && WebPEncode(&config, &pic); - WebPPictureFree(&pic); - if (!ok) { - free(wrt.mem); - *output = NULL; - return 0; - } - *output = wrt.mem; - return wrt.size; -} - -#define ENCODE_FUNC(NAME, IMPORTER) \ -size_t NAME(const uint8_t* in, int w, int h, int bps, float q, \ - uint8_t** out) { \ - return Encode(in, w, h, bps, IMPORTER, q, 0, out); \ -} - -ENCODE_FUNC(WebPEncodeRGB, WebPPictureImportRGB); -ENCODE_FUNC(WebPEncodeBGR, WebPPictureImportBGR); -ENCODE_FUNC(WebPEncodeRGBA, WebPPictureImportRGBA); -ENCODE_FUNC(WebPEncodeBGRA, WebPPictureImportBGRA); - -#undef ENCODE_FUNC - -#define LOSSLESS_DEFAULT_QUALITY 70. -#define LOSSLESS_ENCODE_FUNC(NAME, IMPORTER) \ -size_t NAME(const uint8_t* in, int w, int h, int bps, uint8_t** out) { \ - return Encode(in, w, h, bps, IMPORTER, LOSSLESS_DEFAULT_QUALITY, 1, out); \ -} - -LOSSLESS_ENCODE_FUNC(WebPEncodeLosslessRGB, WebPPictureImportRGB); -LOSSLESS_ENCODE_FUNC(WebPEncodeLosslessBGR, WebPPictureImportBGR); -LOSSLESS_ENCODE_FUNC(WebPEncodeLosslessRGBA, WebPPictureImportRGBA); -LOSSLESS_ENCODE_FUNC(WebPEncodeLosslessBGRA, WebPPictureImportBGRA); - -#undef LOSSLESS_ENCODE_FUNC - -//------------------------------------------------------------------------------ - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif diff --git a/external/libwebp/enc/quant.c b/external/libwebp/enc/quant.c deleted file mode 100644 index ea153849c8..0000000000 --- a/external/libwebp/enc/quant.c +++ /dev/null @@ -1,930 +0,0 @@ -// Copyright 2011 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Quantization -// -// Author: Skal (pascal.massimino@gmail.com) - -#include <assert.h> -#include <math.h> - -#include "./vp8enci.h" -#include "./cost.h" - -#define DO_TRELLIS_I4 1 -#define DO_TRELLIS_I16 1 // not a huge gain, but ok at low bitrate. -#define DO_TRELLIS_UV 0 // disable trellis for UV. Risky. Not worth. -#define USE_TDISTO 1 - -#define MID_ALPHA 64 // neutral value for susceptibility -#define MIN_ALPHA 30 // lowest usable value for susceptibility -#define MAX_ALPHA 100 // higher meaninful value for susceptibility - -#define SNS_TO_DQ 0.9 // Scaling constant between the sns value and the QP - // power-law modulation. Must be strictly less than 1. - -#define MULT_8B(a, b) (((a) * (b) + 128) >> 8) - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -//------------------------------------------------------------------------------ - -static WEBP_INLINE int clip(int v, int m, int M) { - return v < m ? m : v > M ? M : v; -} - -static const uint8_t kZigzag[16] = { - 0, 1, 4, 8, 5, 2, 3, 6, 9, 12, 13, 10, 7, 11, 14, 15 -}; - -static const uint8_t kDcTable[128] = { - 4, 5, 6, 7, 8, 9, 10, 10, - 11, 12, 13, 14, 15, 16, 17, 17, - 18, 19, 20, 20, 21, 21, 22, 22, - 23, 23, 24, 25, 25, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36, - 37, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, - 91, 93, 95, 96, 98, 100, 101, 102, - 104, 106, 108, 110, 112, 114, 116, 118, - 122, 124, 126, 128, 130, 132, 134, 136, - 138, 140, 143, 145, 148, 151, 154, 157 -}; - -static const uint16_t kAcTable[128] = { - 4, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 60, - 62, 64, 66, 68, 70, 72, 74, 76, - 78, 80, 82, 84, 86, 88, 90, 92, - 94, 96, 98, 100, 102, 104, 106, 108, - 110, 112, 114, 116, 119, 122, 125, 128, - 131, 134, 137, 140, 143, 146, 149, 152, - 155, 158, 161, 164, 167, 170, 173, 177, - 181, 185, 189, 193, 197, 201, 205, 209, - 213, 217, 221, 225, 229, 234, 239, 245, - 249, 254, 259, 264, 269, 274, 279, 284 -}; - -static const uint16_t kAcTable2[128] = { - 8, 8, 9, 10, 12, 13, 15, 17, - 18, 20, 21, 23, 24, 26, 27, 29, - 31, 32, 34, 35, 37, 38, 40, 41, - 43, 44, 46, 48, 49, 51, 52, 54, - 55, 57, 58, 60, 62, 63, 65, 66, - 68, 69, 71, 72, 74, 75, 77, 79, - 80, 82, 83, 85, 86, 88, 89, 93, - 96, 99, 102, 105, 108, 111, 114, 117, - 120, 124, 127, 130, 133, 136, 139, 142, - 145, 148, 151, 155, 158, 161, 164, 167, - 170, 173, 176, 179, 184, 189, 193, 198, - 203, 207, 212, 217, 221, 226, 230, 235, - 240, 244, 249, 254, 258, 263, 268, 274, - 280, 286, 292, 299, 305, 311, 317, 323, - 330, 336, 342, 348, 354, 362, 370, 379, - 385, 393, 401, 409, 416, 424, 432, 440 -}; - -static const uint16_t kCoeffThresh[16] = { - 0, 10, 20, 30, - 10, 20, 30, 30, - 20, 30, 30, 30, - 30, 30, 30, 30 -}; - -// TODO(skal): tune more. Coeff thresholding? -static const uint8_t kBiasMatrices[3][16] = { // [3] = [luma-ac,luma-dc,chroma] - { 96, 96, 96, 96, - 96, 96, 96, 96, - 96, 96, 96, 96, - 96, 96, 96, 96 }, - { 96, 96, 96, 96, - 96, 96, 96, 96, - 96, 96, 96, 96, - 96, 96, 96, 96 }, - { 96, 96, 96, 96, - 96, 96, 96, 96, - 96, 96, 96, 96, - 96, 96, 96, 96 } -}; - -// Sharpening by (slightly) raising the hi-frequency coeffs (only for trellis). -// Hack-ish but helpful for mid-bitrate range. Use with care. -static const uint8_t kFreqSharpening[16] = { - 0, 30, 60, 90, - 30, 60, 90, 90, - 60, 90, 90, 90, - 90, 90, 90, 90 -}; - -//------------------------------------------------------------------------------ -// Initialize quantization parameters in VP8Matrix - -// Returns the average quantizer -static int ExpandMatrix(VP8Matrix* const m, int type) { - int i; - int sum = 0; - for (i = 2; i < 16; ++i) { - m->q_[i] = m->q_[1]; - } - for (i = 0; i < 16; ++i) { - const int j = kZigzag[i]; - const int bias = kBiasMatrices[type][j]; - m->iq_[j] = (1 << QFIX) / m->q_[j]; - m->bias_[j] = BIAS(bias); - // TODO(skal): tune kCoeffThresh[] - m->zthresh_[j] = ((256 /*+ kCoeffThresh[j]*/ - bias) * m->q_[j] + 127) >> 8; - m->sharpen_[j] = (kFreqSharpening[j] * m->q_[j]) >> 11; - sum += m->q_[j]; - } - return (sum + 8) >> 4; -} - -static void SetupMatrices(VP8Encoder* enc) { - int i; - const int tlambda_scale = - (enc->method_ >= 4) ? enc->config_->sns_strength - : 0; - const int num_segments = enc->segment_hdr_.num_segments_; - for (i = 0; i < num_segments; ++i) { - VP8SegmentInfo* const m = &enc->dqm_[i]; - const int q = m->quant_; - int q4, q16, quv; - m->y1_.q_[0] = kDcTable[clip(q + enc->dq_y1_dc_, 0, 127)]; - m->y1_.q_[1] = kAcTable[clip(q, 0, 127)]; - - m->y2_.q_[0] = kDcTable[ clip(q + enc->dq_y2_dc_, 0, 127)] * 2; - m->y2_.q_[1] = kAcTable2[clip(q + enc->dq_y2_ac_, 0, 127)]; - - m->uv_.q_[0] = kDcTable[clip(q + enc->dq_uv_dc_, 0, 117)]; - m->uv_.q_[1] = kAcTable[clip(q + enc->dq_uv_ac_, 0, 127)]; - - q4 = ExpandMatrix(&m->y1_, 0); - q16 = ExpandMatrix(&m->y2_, 1); - quv = ExpandMatrix(&m->uv_, 2); - - // TODO: Switch to kLambda*[] tables? - { - m->lambda_i4_ = (3 * q4 * q4) >> 7; - m->lambda_i16_ = (3 * q16 * q16); - m->lambda_uv_ = (3 * quv * quv) >> 6; - m->lambda_mode_ = (1 * q4 * q4) >> 7; - m->lambda_trellis_i4_ = (7 * q4 * q4) >> 3; - m->lambda_trellis_i16_ = (q16 * q16) >> 2; - m->lambda_trellis_uv_ = (quv *quv) << 1; - m->tlambda_ = (tlambda_scale * q4) >> 5; - } - } -} - -//------------------------------------------------------------------------------ -// Initialize filtering parameters - -// Very small filter-strength values have close to no visual effect. So we can -// save a little decoding-CPU by turning filtering off for these. -#define FSTRENGTH_CUTOFF 3 - -static void SetupFilterStrength(VP8Encoder* const enc) { - int i; - const int level0 = enc->config_->filter_strength; - for (i = 0; i < NUM_MB_SEGMENTS; ++i) { - // Segments with lower quantizer will be less filtered. TODO: tune (wrt SNS) - const int level = level0 * 256 * enc->dqm_[i].quant_ / 128; - const int f = level / (256 + enc->dqm_[i].beta_); - enc->dqm_[i].fstrength_ = (f < FSTRENGTH_CUTOFF) ? 0 : (f > 63) ? 63 : f; - } - // We record the initial strength (mainly for the case of 1-segment only). - enc->filter_hdr_.level_ = enc->dqm_[0].fstrength_; - enc->filter_hdr_.simple_ = (enc->config_->filter_type == 0); - enc->filter_hdr_.sharpness_ = enc->config_->filter_sharpness; -} - -//------------------------------------------------------------------------------ - -// Note: if you change the values below, remember that the max range -// allowed by the syntax for DQ_UV is [-16,16]. -#define MAX_DQ_UV (6) -#define MIN_DQ_UV (-4) - -// We want to emulate jpeg-like behaviour where the expected "good" quality -// is around q=75. Internally, our "good" middle is around c=50. So we -// map accordingly using linear piece-wise function -static double QualityToCompression(double q) { - const double c = q / 100.; - return (c < 0.75) ? c * (2. / 3.) : 2. * c - 1.; -} - -void VP8SetSegmentParams(VP8Encoder* const enc, float quality) { - int i; - int dq_uv_ac, dq_uv_dc; - const int num_segments = enc->config_->segments; - const double amp = SNS_TO_DQ * enc->config_->sns_strength / 100. / 128.; - const double c_base = QualityToCompression(quality); - for (i = 0; i < num_segments; ++i) { - // The file size roughly scales as pow(quantizer, 3.). Actually, the - // exponent is somewhere between 2.8 and 3.2, but we're mostly interested - // in the mid-quant range. So we scale the compressibility inversely to - // this power-law: quant ~= compression ^ 1/3. This law holds well for - // low quant. Finer modelling for high-quant would make use of kAcTable[] - // more explicitely. - // Additionally, we modulate the base exponent 1/3 to accommodate for the - // quantization susceptibility and allow denser segments to be quantized - // more. - const double expn = (1. - amp * enc->dqm_[i].alpha_) / 3.; - const double c = pow(c_base, expn); - const int q = (int)(127. * (1. - c)); - assert(expn > 0.); - enc->dqm_[i].quant_ = clip(q, 0, 127); - } - - // purely indicative in the bitstream (except for the 1-segment case) - enc->base_quant_ = enc->dqm_[0].quant_; - - // fill-in values for the unused segments (required by the syntax) - for (i = num_segments; i < NUM_MB_SEGMENTS; ++i) { - enc->dqm_[i].quant_ = enc->base_quant_; - } - - // uv_alpha_ is normally spread around ~60. The useful range is - // typically ~30 (quite bad) to ~100 (ok to decimate UV more). - // We map it to the safe maximal range of MAX/MIN_DQ_UV for dq_uv. - dq_uv_ac = (enc->uv_alpha_ - MID_ALPHA) * (MAX_DQ_UV - MIN_DQ_UV) - / (MAX_ALPHA - MIN_ALPHA); - // we rescale by the user-defined strength of adaptation - dq_uv_ac = dq_uv_ac * enc->config_->sns_strength / 100; - // and make it safe. - dq_uv_ac = clip(dq_uv_ac, MIN_DQ_UV, MAX_DQ_UV); - // We also boost the dc-uv-quant a little, based on sns-strength, since - // U/V channels are quite more reactive to high quants (flat DC-blocks - // tend to appear, and are displeasant). - dq_uv_dc = -4 * enc->config_->sns_strength / 100; - dq_uv_dc = clip(dq_uv_dc, -15, 15); // 4bit-signed max allowed - - enc->dq_y1_dc_ = 0; // TODO(skal): dq-lum - enc->dq_y2_dc_ = 0; - enc->dq_y2_ac_ = 0; - enc->dq_uv_dc_ = dq_uv_dc; - enc->dq_uv_ac_ = dq_uv_ac; - - SetupMatrices(enc); - - SetupFilterStrength(enc); // initialize segments' filtering, eventually -} - -//------------------------------------------------------------------------------ -// Form the predictions in cache - -// Must be ordered using {DC_PRED, TM_PRED, V_PRED, H_PRED} as index -const int VP8I16ModeOffsets[4] = { I16DC16, I16TM16, I16VE16, I16HE16 }; -const int VP8UVModeOffsets[4] = { C8DC8, C8TM8, C8VE8, C8HE8 }; - -// Must be indexed using {B_DC_PRED -> B_HU_PRED} as index -const int VP8I4ModeOffsets[NUM_BMODES] = { - I4DC4, I4TM4, I4VE4, I4HE4, I4RD4, I4VR4, I4LD4, I4VL4, I4HD4, I4HU4 -}; - -void VP8MakeLuma16Preds(const VP8EncIterator* const it) { - const VP8Encoder* const enc = it->enc_; - const uint8_t* const left = it->x_ ? enc->y_left_ : NULL; - const uint8_t* const top = it->y_ ? enc->y_top_ + it->x_ * 16 : NULL; - VP8EncPredLuma16(it->yuv_p_, left, top); -} - -void VP8MakeChroma8Preds(const VP8EncIterator* const it) { - const VP8Encoder* const enc = it->enc_; - const uint8_t* const left = it->x_ ? enc->u_left_ : NULL; - const uint8_t* const top = it->y_ ? enc->uv_top_ + it->x_ * 16 : NULL; - VP8EncPredChroma8(it->yuv_p_, left, top); -} - -void VP8MakeIntra4Preds(const VP8EncIterator* const it) { - VP8EncPredLuma4(it->yuv_p_, it->i4_top_); -} - -//------------------------------------------------------------------------------ -// Quantize - -// Layout: -// +----+ -// |YYYY| 0 -// |YYYY| 4 -// |YYYY| 8 -// |YYYY| 12 -// +----+ -// |UUVV| 16 -// |UUVV| 20 -// +----+ - -const int VP8Scan[16 + 4 + 4] = { - // Luma - 0 + 0 * BPS, 4 + 0 * BPS, 8 + 0 * BPS, 12 + 0 * BPS, - 0 + 4 * BPS, 4 + 4 * BPS, 8 + 4 * BPS, 12 + 4 * BPS, - 0 + 8 * BPS, 4 + 8 * BPS, 8 + 8 * BPS, 12 + 8 * BPS, - 0 + 12 * BPS, 4 + 12 * BPS, 8 + 12 * BPS, 12 + 12 * BPS, - - 0 + 0 * BPS, 4 + 0 * BPS, 0 + 4 * BPS, 4 + 4 * BPS, // U - 8 + 0 * BPS, 12 + 0 * BPS, 8 + 4 * BPS, 12 + 4 * BPS // V -}; - -//------------------------------------------------------------------------------ -// Distortion measurement - -static const uint16_t kWeightY[16] = { - 38, 32, 20, 9, 32, 28, 17, 7, 20, 17, 10, 4, 9, 7, 4, 2 -}; - -static const uint16_t kWeightTrellis[16] = { -#if USE_TDISTO == 0 - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16 -#else - 30, 27, 19, 11, - 27, 24, 17, 10, - 19, 17, 12, 8, - 11, 10, 8, 6 -#endif -}; - -// Init/Copy the common fields in score. -static void InitScore(VP8ModeScore* const rd) { - rd->D = 0; - rd->SD = 0; - rd->R = 0; - rd->nz = 0; - rd->score = MAX_COST; -} - -static void CopyScore(VP8ModeScore* const dst, const VP8ModeScore* const src) { - dst->D = src->D; - dst->SD = src->SD; - dst->R = src->R; - dst->nz = src->nz; // note that nz is not accumulated, but just copied. - dst->score = src->score; -} - -static void AddScore(VP8ModeScore* const dst, const VP8ModeScore* const src) { - dst->D += src->D; - dst->SD += src->SD; - dst->R += src->R; - dst->nz |= src->nz; // here, new nz bits are accumulated. - dst->score += src->score; -} - -//------------------------------------------------------------------------------ -// Performs trellis-optimized quantization. - -// Trellis - -typedef struct { - int prev; // best previous - int level; // level - int sign; // sign of coeff_i - score_t cost; // bit cost - score_t error; // distortion = sum of (|coeff_i| - level_i * Q_i)^2 - int ctx; // context (only depends on 'level'. Could be spared.) -} Node; - -// If a coefficient was quantized to a value Q (using a neutral bias), -// we test all alternate possibilities between [Q-MIN_DELTA, Q+MAX_DELTA] -// We don't test negative values though. -#define MIN_DELTA 0 // how much lower level to try -#define MAX_DELTA 1 // how much higher -#define NUM_NODES (MIN_DELTA + 1 + MAX_DELTA) -#define NODE(n, l) (nodes[(n) + 1][(l) + MIN_DELTA]) - -static WEBP_INLINE void SetRDScore(int lambda, VP8ModeScore* const rd) { - // TODO: incorporate the "* 256" in the tables? - rd->score = rd->R * lambda + 256 * (rd->D + rd->SD); -} - -static WEBP_INLINE score_t RDScoreTrellis(int lambda, score_t rate, - score_t distortion) { - return rate * lambda + 256 * distortion; -} - -static int TrellisQuantizeBlock(const VP8EncIterator* const it, - int16_t in[16], int16_t out[16], - int ctx0, int coeff_type, - const VP8Matrix* const mtx, - int lambda) { - ProbaArray* const last_costs = it->enc_->proba_.coeffs_[coeff_type]; - CostArray* const costs = it->enc_->proba_.level_cost_[coeff_type]; - const int first = (coeff_type == 0) ? 1 : 0; - Node nodes[17][NUM_NODES]; - int best_path[3] = {-1, -1, -1}; // store best-last/best-level/best-previous - score_t best_score; - int best_node; - int last = first - 1; - int n, m, p, nz; - - { - score_t cost; - score_t max_error; - const int thresh = mtx->q_[1] * mtx->q_[1] / 4; - const int last_proba = last_costs[VP8EncBands[first]][ctx0][0]; - - // compute maximal distortion. - max_error = 0; - for (n = first; n < 16; ++n) { - const int j = kZigzag[n]; - const int err = in[j] * in[j]; - max_error += kWeightTrellis[j] * err; - if (err > thresh) last = n; - } - // we don't need to go inspect up to n = 16 coeffs. We can just go up - // to last + 1 (inclusive) without losing much. - if (last < 15) ++last; - - // compute 'skip' score. This is the max score one can do. - cost = VP8BitCost(0, last_proba); - best_score = RDScoreTrellis(lambda, cost, max_error); - - // initialize source node. - n = first - 1; - for (m = -MIN_DELTA; m <= MAX_DELTA; ++m) { - NODE(n, m).cost = 0; - NODE(n, m).error = max_error; - NODE(n, m).ctx = ctx0; - } - } - - // traverse trellis. - for (n = first; n <= last; ++n) { - const int j = kZigzag[n]; - const int Q = mtx->q_[j]; - const int iQ = mtx->iq_[j]; - const int B = BIAS(0x00); // neutral bias - // note: it's important to take sign of the _original_ coeff, - // so we don't have to consider level < 0 afterward. - const int sign = (in[j] < 0); - int coeff0 = (sign ? -in[j] : in[j]) + mtx->sharpen_[j]; - int level0; - if (coeff0 > 2047) coeff0 = 2047; - - level0 = QUANTDIV(coeff0, iQ, B); - // test all alternate level values around level0. - for (m = -MIN_DELTA; m <= MAX_DELTA; ++m) { - Node* const cur = &NODE(n, m); - int delta_error, new_error; - score_t cur_score = MAX_COST; - int level = level0 + m; - int last_proba; - - cur->sign = sign; - cur->level = level; - cur->ctx = (level == 0) ? 0 : (level == 1) ? 1 : 2; - if (level >= 2048 || level < 0) { // node is dead? - cur->cost = MAX_COST; - continue; - } - last_proba = last_costs[VP8EncBands[n + 1]][cur->ctx][0]; - - // Compute delta_error = how much coding this level will - // subtract as distortion to max_error - new_error = coeff0 - level * Q; - delta_error = - kWeightTrellis[j] * (coeff0 * coeff0 - new_error * new_error); - - // Inspect all possible non-dead predecessors. Retain only the best one. - for (p = -MIN_DELTA; p <= MAX_DELTA; ++p) { - const Node* const prev = &NODE(n - 1, p); - const int prev_ctx = prev->ctx; - const uint16_t* const tcost = costs[VP8EncBands[n]][prev_ctx]; - const score_t total_error = prev->error - delta_error; - score_t cost, base_cost, score; - - if (prev->cost >= MAX_COST) { // dead node? - continue; - } - - // Base cost of both terminal/non-terminal - base_cost = prev->cost + VP8LevelCost(tcost, level); - - // Examine node assuming it's a non-terminal one. - cost = base_cost; - if (level && n < 15) { - cost += VP8BitCost(1, last_proba); - } - score = RDScoreTrellis(lambda, cost, total_error); - if (score < cur_score) { - cur_score = score; - cur->cost = cost; - cur->error = total_error; - cur->prev = p; - } - - // Now, record best terminal node (and thus best entry in the graph). - if (level) { - cost = base_cost; - if (n < 15) cost += VP8BitCost(0, last_proba); - score = RDScoreTrellis(lambda, cost, total_error); - if (score < best_score) { - best_score = score; - best_path[0] = n; // best eob position - best_path[1] = m; // best level - best_path[2] = p; // best predecessor - } - } - } - } - } - - // Fresh start - memset(in + first, 0, (16 - first) * sizeof(*in)); - memset(out + first, 0, (16 - first) * sizeof(*out)); - if (best_path[0] == -1) { - return 0; // skip! - } - - // Unwind the best path. - // Note: best-prev on terminal node is not necessarily equal to the - // best_prev for non-terminal. So we patch best_path[2] in. - n = best_path[0]; - best_node = best_path[1]; - NODE(n, best_node).prev = best_path[2]; // force best-prev for terminal - nz = 0; - - for (; n >= first; --n) { - const Node* const node = &NODE(n, best_node); - const int j = kZigzag[n]; - out[n] = node->sign ? -node->level : node->level; - nz |= (node->level != 0); - in[j] = out[n] * mtx->q_[j]; - best_node = node->prev; - } - return nz; -} - -#undef NODE - -//------------------------------------------------------------------------------ -// Performs: difference, transform, quantize, back-transform, add -// all at once. Output is the reconstructed block in *yuv_out, and the -// quantized levels in *levels. - -static int ReconstructIntra16(VP8EncIterator* const it, - VP8ModeScore* const rd, - uint8_t* const yuv_out, - int mode) { - const VP8Encoder* const enc = it->enc_; - const uint8_t* const ref = it->yuv_p_ + VP8I16ModeOffsets[mode]; - const uint8_t* const src = it->yuv_in_ + Y_OFF; - const VP8SegmentInfo* const dqm = &enc->dqm_[it->mb_->segment_]; - int nz = 0; - int n; - int16_t tmp[16][16], dc_tmp[16]; - - for (n = 0; n < 16; ++n) { - VP8FTransform(src + VP8Scan[n], ref + VP8Scan[n], tmp[n]); - } - VP8FTransformWHT(tmp[0], dc_tmp); - nz |= VP8EncQuantizeBlock(dc_tmp, rd->y_dc_levels, 0, &dqm->y2_) << 24; - - if (DO_TRELLIS_I16 && it->do_trellis_) { - int x, y; - VP8IteratorNzToBytes(it); - for (y = 0, n = 0; y < 4; ++y) { - for (x = 0; x < 4; ++x, ++n) { - const int ctx = it->top_nz_[x] + it->left_nz_[y]; - const int non_zero = - TrellisQuantizeBlock(it, tmp[n], rd->y_ac_levels[n], ctx, 0, - &dqm->y1_, dqm->lambda_trellis_i16_); - it->top_nz_[x] = it->left_nz_[y] = non_zero; - nz |= non_zero << n; - } - } - } else { - for (n = 0; n < 16; ++n) { - nz |= VP8EncQuantizeBlock(tmp[n], rd->y_ac_levels[n], 1, &dqm->y1_) << n; - } - } - - // Transform back - VP8ITransformWHT(dc_tmp, tmp[0]); - for (n = 0; n < 16; n += 2) { - VP8ITransform(ref + VP8Scan[n], tmp[n], yuv_out + VP8Scan[n], 1); - } - - return nz; -} - -static int ReconstructIntra4(VP8EncIterator* const it, - int16_t levels[16], - const uint8_t* const src, - uint8_t* const yuv_out, - int mode) { - const VP8Encoder* const enc = it->enc_; - const uint8_t* const ref = it->yuv_p_ + VP8I4ModeOffsets[mode]; - const VP8SegmentInfo* const dqm = &enc->dqm_[it->mb_->segment_]; - int nz = 0; - int16_t tmp[16]; - - VP8FTransform(src, ref, tmp); - if (DO_TRELLIS_I4 && it->do_trellis_) { - const int x = it->i4_ & 3, y = it->i4_ >> 2; - const int ctx = it->top_nz_[x] + it->left_nz_[y]; - nz = TrellisQuantizeBlock(it, tmp, levels, ctx, 3, &dqm->y1_, - dqm->lambda_trellis_i4_); - } else { - nz = VP8EncQuantizeBlock(tmp, levels, 0, &dqm->y1_); - } - VP8ITransform(ref, tmp, yuv_out, 0); - return nz; -} - -static int ReconstructUV(VP8EncIterator* const it, VP8ModeScore* const rd, - uint8_t* const yuv_out, int mode) { - const VP8Encoder* const enc = it->enc_; - const uint8_t* const ref = it->yuv_p_ + VP8UVModeOffsets[mode]; - const uint8_t* const src = it->yuv_in_ + U_OFF; - const VP8SegmentInfo* const dqm = &enc->dqm_[it->mb_->segment_]; - int nz = 0; - int n; - int16_t tmp[8][16]; - - for (n = 0; n < 8; ++n) { - VP8FTransform(src + VP8Scan[16 + n], ref + VP8Scan[16 + n], tmp[n]); - } - if (DO_TRELLIS_UV && it->do_trellis_) { - int ch, x, y; - for (ch = 0, n = 0; ch <= 2; ch += 2) { - for (y = 0; y < 2; ++y) { - for (x = 0; x < 2; ++x, ++n) { - const int ctx = it->top_nz_[4 + ch + x] + it->left_nz_[4 + ch + y]; - const int non_zero = - TrellisQuantizeBlock(it, tmp[n], rd->uv_levels[n], ctx, 2, - &dqm->uv_, dqm->lambda_trellis_uv_); - it->top_nz_[4 + ch + x] = it->left_nz_[4 + ch + y] = non_zero; - nz |= non_zero << n; - } - } - } - } else { - for (n = 0; n < 8; ++n) { - nz |= VP8EncQuantizeBlock(tmp[n], rd->uv_levels[n], 0, &dqm->uv_) << n; - } - } - - for (n = 0; n < 8; n += 2) { - VP8ITransform(ref + VP8Scan[16 + n], tmp[n], yuv_out + VP8Scan[16 + n], 1); - } - return (nz << 16); -} - -//------------------------------------------------------------------------------ -// RD-opt decision. Reconstruct each modes, evalue distortion and bit-cost. -// Pick the mode is lower RD-cost = Rate + lamba * Distortion. - -static void SwapPtr(uint8_t** a, uint8_t** b) { - uint8_t* const tmp = *a; - *a = *b; - *b = tmp; -} - -static void SwapOut(VP8EncIterator* const it) { - SwapPtr(&it->yuv_out_, &it->yuv_out2_); -} - -static void PickBestIntra16(VP8EncIterator* const it, VP8ModeScore* const rd) { - const VP8Encoder* const enc = it->enc_; - const VP8SegmentInfo* const dqm = &enc->dqm_[it->mb_->segment_]; - const int lambda = dqm->lambda_i16_; - const int tlambda = dqm->tlambda_; - const uint8_t* const src = it->yuv_in_ + Y_OFF; - VP8ModeScore rd16; - int mode; - - rd->mode_i16 = -1; - for (mode = 0; mode < 4; ++mode) { - uint8_t* const tmp_dst = it->yuv_out2_ + Y_OFF; // scratch buffer - int nz; - - // Reconstruct - nz = ReconstructIntra16(it, &rd16, tmp_dst, mode); - - // Measure RD-score - rd16.D = VP8SSE16x16(src, tmp_dst); - rd16.SD = tlambda ? MULT_8B(tlambda, VP8TDisto16x16(src, tmp_dst, kWeightY)) - : 0; - rd16.R = VP8GetCostLuma16(it, &rd16); - rd16.R += VP8FixedCostsI16[mode]; - - // Since we always examine Intra16 first, we can overwrite *rd directly. - SetRDScore(lambda, &rd16); - if (mode == 0 || rd16.score < rd->score) { - CopyScore(rd, &rd16); - rd->mode_i16 = mode; - rd->nz = nz; - memcpy(rd->y_ac_levels, rd16.y_ac_levels, sizeof(rd16.y_ac_levels)); - memcpy(rd->y_dc_levels, rd16.y_dc_levels, sizeof(rd16.y_dc_levels)); - SwapOut(it); - } - } - SetRDScore(dqm->lambda_mode_, rd); // finalize score for mode decision. - VP8SetIntra16Mode(it, rd->mode_i16); -} - -//------------------------------------------------------------------------------ - -// return the cost array corresponding to the surrounding prediction modes. -static const uint16_t* GetCostModeI4(VP8EncIterator* const it, - const uint8_t modes[16]) { - const int preds_w = it->enc_->preds_w_; - const int x = (it->i4_ & 3), y = it->i4_ >> 2; - const int left = (x == 0) ? it->preds_[y * preds_w - 1] : modes[it->i4_ - 1]; - const int top = (y == 0) ? it->preds_[-preds_w + x] : modes[it->i4_ - 4]; - return VP8FixedCostsI4[top][left]; -} - -static int PickBestIntra4(VP8EncIterator* const it, VP8ModeScore* const rd) { - const VP8Encoder* const enc = it->enc_; - const VP8SegmentInfo* const dqm = &enc->dqm_[it->mb_->segment_]; - const int lambda = dqm->lambda_i4_; - const int tlambda = dqm->tlambda_; - const uint8_t* const src0 = it->yuv_in_ + Y_OFF; - uint8_t* const best_blocks = it->yuv_out2_ + Y_OFF; - int total_header_bits = 0; - VP8ModeScore rd_best; - - if (enc->max_i4_header_bits_ == 0) { - return 0; - } - - InitScore(&rd_best); - rd_best.score = 211; // '211' is the value of VP8BitCost(0, 145) - VP8IteratorStartI4(it); - do { - VP8ModeScore rd_i4; - int mode; - int best_mode = -1; - const uint8_t* const src = src0 + VP8Scan[it->i4_]; - const uint16_t* const mode_costs = GetCostModeI4(it, rd->modes_i4); - uint8_t* best_block = best_blocks + VP8Scan[it->i4_]; - uint8_t* tmp_dst = it->yuv_p_ + I4TMP; // scratch buffer. - - InitScore(&rd_i4); - VP8MakeIntra4Preds(it); - for (mode = 0; mode < NUM_BMODES; ++mode) { - VP8ModeScore rd_tmp; - int16_t tmp_levels[16]; - - // Reconstruct - rd_tmp.nz = - ReconstructIntra4(it, tmp_levels, src, tmp_dst, mode) << it->i4_; - - // Compute RD-score - rd_tmp.D = VP8SSE4x4(src, tmp_dst); - rd_tmp.SD = - tlambda ? MULT_8B(tlambda, VP8TDisto4x4(src, tmp_dst, kWeightY)) - : 0; - rd_tmp.R = VP8GetCostLuma4(it, tmp_levels); - rd_tmp.R += mode_costs[mode]; - - SetRDScore(lambda, &rd_tmp); - if (best_mode < 0 || rd_tmp.score < rd_i4.score) { - CopyScore(&rd_i4, &rd_tmp); - best_mode = mode; - SwapPtr(&tmp_dst, &best_block); - memcpy(rd_best.y_ac_levels[it->i4_], tmp_levels, sizeof(tmp_levels)); - } - } - SetRDScore(dqm->lambda_mode_, &rd_i4); - AddScore(&rd_best, &rd_i4); - total_header_bits += mode_costs[best_mode]; - if (rd_best.score >= rd->score || - total_header_bits > enc->max_i4_header_bits_) { - return 0; - } - // Copy selected samples if not in the right place already. - if (best_block != best_blocks + VP8Scan[it->i4_]) - VP8Copy4x4(best_block, best_blocks + VP8Scan[it->i4_]); - rd->modes_i4[it->i4_] = best_mode; - it->top_nz_[it->i4_ & 3] = it->left_nz_[it->i4_ >> 2] = (rd_i4.nz ? 1 : 0); - } while (VP8IteratorRotateI4(it, best_blocks)); - - // finalize state - CopyScore(rd, &rd_best); - VP8SetIntra4Mode(it, rd->modes_i4); - SwapOut(it); - memcpy(rd->y_ac_levels, rd_best.y_ac_levels, sizeof(rd->y_ac_levels)); - return 1; // select intra4x4 over intra16x16 -} - -//------------------------------------------------------------------------------ - -static void PickBestUV(VP8EncIterator* const it, VP8ModeScore* const rd) { - const VP8Encoder* const enc = it->enc_; - const VP8SegmentInfo* const dqm = &enc->dqm_[it->mb_->segment_]; - const int lambda = dqm->lambda_uv_; - const uint8_t* const src = it->yuv_in_ + U_OFF; - uint8_t* const tmp_dst = it->yuv_out2_ + U_OFF; // scratch buffer - uint8_t* const dst0 = it->yuv_out_ + U_OFF; - VP8ModeScore rd_best; - int mode; - - rd->mode_uv = -1; - InitScore(&rd_best); - for (mode = 0; mode < 4; ++mode) { - VP8ModeScore rd_uv; - - // Reconstruct - rd_uv.nz = ReconstructUV(it, &rd_uv, tmp_dst, mode); - - // Compute RD-score - rd_uv.D = VP8SSE16x8(src, tmp_dst); - rd_uv.SD = 0; // TODO: should we call TDisto? it tends to flatten areas. - rd_uv.R = VP8GetCostUV(it, &rd_uv); - rd_uv.R += VP8FixedCostsUV[mode]; - - SetRDScore(lambda, &rd_uv); - if (mode == 0 || rd_uv.score < rd_best.score) { - CopyScore(&rd_best, &rd_uv); - rd->mode_uv = mode; - memcpy(rd->uv_levels, rd_uv.uv_levels, sizeof(rd->uv_levels)); - memcpy(dst0, tmp_dst, UV_SIZE); // TODO: SwapUVOut() ? - } - } - VP8SetIntraUVMode(it, rd->mode_uv); - AddScore(rd, &rd_best); -} - -//------------------------------------------------------------------------------ -// Final reconstruction and quantization. - -static void SimpleQuantize(VP8EncIterator* const it, VP8ModeScore* const rd) { - const VP8Encoder* const enc = it->enc_; - const int i16 = (it->mb_->type_ == 1); - int nz = 0; - - if (i16) { - nz = ReconstructIntra16(it, rd, it->yuv_out_ + Y_OFF, it->preds_[0]); - } else { - VP8IteratorStartI4(it); - do { - const int mode = - it->preds_[(it->i4_ & 3) + (it->i4_ >> 2) * enc->preds_w_]; - const uint8_t* const src = it->yuv_in_ + Y_OFF + VP8Scan[it->i4_]; - uint8_t* const dst = it->yuv_out_ + Y_OFF + VP8Scan[it->i4_]; - VP8MakeIntra4Preds(it); - nz |= ReconstructIntra4(it, rd->y_ac_levels[it->i4_], - src, dst, mode) << it->i4_; - } while (VP8IteratorRotateI4(it, it->yuv_out_ + Y_OFF)); - } - - nz |= ReconstructUV(it, rd, it->yuv_out_ + U_OFF, it->mb_->uv_mode_); - rd->nz = nz; -} - -//------------------------------------------------------------------------------ -// Entry point - -int VP8Decimate(VP8EncIterator* const it, VP8ModeScore* const rd, int rd_opt) { - int is_skipped; - - InitScore(rd); - - // We can perform predictions for Luma16x16 and Chroma8x8 already. - // Luma4x4 predictions needs to be done as-we-go. - VP8MakeLuma16Preds(it); - VP8MakeChroma8Preds(it); - - // for rd_opt = 2, we perform trellis-quant on the final decision only. - // for rd_opt > 2, we use it for every scoring (=much slower). - if (rd_opt > 0) { - it->do_trellis_ = (rd_opt > 2); - PickBestIntra16(it, rd); - if (it->enc_->method_ >= 2) { - PickBestIntra4(it, rd); - } - PickBestUV(it, rd); - if (rd_opt == 2) { - it->do_trellis_ = 1; - SimpleQuantize(it, rd); - } - } else { - // TODO: for method_ == 2, pick the best intra4/intra16 based on SSE - it->do_trellis_ = (it->enc_->method_ == 2); - SimpleQuantize(it, rd); - } - is_skipped = (rd->nz == 0); - VP8SetSkip(it, is_skipped); - return is_skipped; -} - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif diff --git a/external/libwebp/enc/syntax.c b/external/libwebp/enc/syntax.c deleted file mode 100644 index 7c8c7b1a84..0000000000 --- a/external/libwebp/enc/syntax.c +++ /dev/null @@ -1,437 +0,0 @@ -// Copyright 2011 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Header syntax writing -// -// Author: Skal (pascal.massimino@gmail.com) - -#include <assert.h> - -#include "../webp/format_constants.h" -#include "./vp8enci.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -//------------------------------------------------------------------------------ -// Helper functions - -// TODO(later): Move to webp/format_constants.h? -static void PutLE24(uint8_t* const data, uint32_t val) { - data[0] = (val >> 0) & 0xff; - data[1] = (val >> 8) & 0xff; - data[2] = (val >> 16) & 0xff; -} - -static void PutLE32(uint8_t* const data, uint32_t val) { - PutLE24(data, val); - data[3] = (val >> 24) & 0xff; -} - -static int IsVP8XNeeded(const VP8Encoder* const enc) { - return !!enc->has_alpha_; // Currently the only case when VP8X is needed. - // This could change in the future. -} - -static int PutPaddingByte(const WebPPicture* const pic) { - - const uint8_t pad_byte[1] = { 0 }; - return !!pic->writer(pad_byte, 1, pic); -} - -//------------------------------------------------------------------------------ -// Writers for header's various pieces (in order of appearance) - -static WebPEncodingError PutRIFFHeader(const VP8Encoder* const enc, - size_t riff_size) { - const WebPPicture* const pic = enc->pic_; - uint8_t riff[RIFF_HEADER_SIZE] = { - 'R', 'I', 'F', 'F', 0, 0, 0, 0, 'W', 'E', 'B', 'P' - }; - assert(riff_size == (uint32_t)riff_size); - PutLE32(riff + TAG_SIZE, (uint32_t)riff_size); - if (!pic->writer(riff, sizeof(riff), pic)) { - return VP8_ENC_ERROR_BAD_WRITE; - } - return VP8_ENC_OK; -} - -static WebPEncodingError PutVP8XHeader(const VP8Encoder* const enc) { - const WebPPicture* const pic = enc->pic_; - uint8_t vp8x[CHUNK_HEADER_SIZE + VP8X_CHUNK_SIZE] = { - 'V', 'P', '8', 'X' - }; - uint32_t flags = 0; - - assert(IsVP8XNeeded(enc)); - assert(pic->width >= 1 && pic->height >= 1); - assert(pic->width <= MAX_CANVAS_SIZE && pic->height <= MAX_CANVAS_SIZE); - - if (enc->has_alpha_) { - flags |= ALPHA_FLAG_BIT; - } - - PutLE32(vp8x + TAG_SIZE, VP8X_CHUNK_SIZE); - PutLE32(vp8x + CHUNK_HEADER_SIZE, flags); - PutLE24(vp8x + CHUNK_HEADER_SIZE + 4, pic->width - 1); - PutLE24(vp8x + CHUNK_HEADER_SIZE + 7, pic->height - 1); - if(!pic->writer(vp8x, sizeof(vp8x), pic)) { - return VP8_ENC_ERROR_BAD_WRITE; - } - return VP8_ENC_OK; -} - -static WebPEncodingError PutAlphaChunk(const VP8Encoder* const enc) { - const WebPPicture* const pic = enc->pic_; - uint8_t alpha_chunk_hdr[CHUNK_HEADER_SIZE] = { - 'A', 'L', 'P', 'H' - }; - - assert(enc->has_alpha_); - - // Alpha chunk header. - PutLE32(alpha_chunk_hdr + TAG_SIZE, enc->alpha_data_size_); - if (!pic->writer(alpha_chunk_hdr, sizeof(alpha_chunk_hdr), pic)) { - return VP8_ENC_ERROR_BAD_WRITE; - } - - // Alpha chunk data. - if (!pic->writer(enc->alpha_data_, enc->alpha_data_size_, pic)) { - return VP8_ENC_ERROR_BAD_WRITE; - } - - // Padding. - if ((enc->alpha_data_size_ & 1) && !PutPaddingByte(pic)) { - return VP8_ENC_ERROR_BAD_WRITE; - } - return VP8_ENC_OK; -} - -static WebPEncodingError PutVP8Header(const WebPPicture* const pic, - size_t vp8_size) { - uint8_t vp8_chunk_hdr[CHUNK_HEADER_SIZE] = { - 'V', 'P', '8', ' ' - }; - assert(vp8_size == (uint32_t)vp8_size); - PutLE32(vp8_chunk_hdr + TAG_SIZE, (uint32_t)vp8_size); - if (!pic->writer(vp8_chunk_hdr, sizeof(vp8_chunk_hdr), pic)) { - return VP8_ENC_ERROR_BAD_WRITE; - } - return VP8_ENC_OK; -} - -static WebPEncodingError PutVP8FrameHeader(const WebPPicture* const pic, - int profile, size_t size0) { - uint8_t vp8_frm_hdr[VP8_FRAME_HEADER_SIZE]; - uint32_t bits; - - if (size0 >= VP8_MAX_PARTITION0_SIZE) { // partition #0 is too big to fit - return VP8_ENC_ERROR_PARTITION0_OVERFLOW; - } - - // Paragraph 9.1. - bits = 0 // keyframe (1b) - | (profile << 1) // profile (3b) - | (1 << 4) // visible (1b) - | ((uint32_t)size0 << 5); // partition length (19b) - vp8_frm_hdr[0] = (bits >> 0) & 0xff; - vp8_frm_hdr[1] = (bits >> 8) & 0xff; - vp8_frm_hdr[2] = (bits >> 16) & 0xff; - // signature - vp8_frm_hdr[3] = (VP8_SIGNATURE >> 16) & 0xff; - vp8_frm_hdr[4] = (VP8_SIGNATURE >> 8) & 0xff; - vp8_frm_hdr[5] = (VP8_SIGNATURE >> 0) & 0xff; - // dimensions - vp8_frm_hdr[6] = pic->width & 0xff; - vp8_frm_hdr[7] = pic->width >> 8; - vp8_frm_hdr[8] = pic->height & 0xff; - vp8_frm_hdr[9] = pic->height >> 8; - - if (!pic->writer(vp8_frm_hdr, sizeof(vp8_frm_hdr), pic)) { - return VP8_ENC_ERROR_BAD_WRITE; - } - return VP8_ENC_OK; -} - -// WebP Headers. -static int PutWebPHeaders(const VP8Encoder* const enc, size_t size0, - size_t vp8_size, size_t riff_size) { - WebPPicture* const pic = enc->pic_; - WebPEncodingError err = VP8_ENC_OK; - - // RIFF header. - err = PutRIFFHeader(enc, riff_size); - if (err != VP8_ENC_OK) goto Error; - - // VP8X. - if (IsVP8XNeeded(enc)) { - err = PutVP8XHeader(enc); - if (err != VP8_ENC_OK) goto Error; - } - - // Alpha. - if (enc->has_alpha_) { - err = PutAlphaChunk(enc); - if (err != VP8_ENC_OK) goto Error; - } - - // VP8 header. - err = PutVP8Header(pic, vp8_size); - if (err != VP8_ENC_OK) goto Error; - - // VP8 frame header. - err = PutVP8FrameHeader(pic, enc->profile_, size0); - if (err != VP8_ENC_OK) goto Error; - - // All OK. - return 1; - - // Error. - Error: - return WebPEncodingSetError(pic, err); -} - -// Segmentation header -static void PutSegmentHeader(VP8BitWriter* const bw, - const VP8Encoder* const enc) { - const VP8SegmentHeader* const hdr = &enc->segment_hdr_; - const VP8Proba* const proba = &enc->proba_; - if (VP8PutBitUniform(bw, (hdr->num_segments_ > 1))) { - // We always 'update' the quant and filter strength values - const int update_data = 1; - int s; - VP8PutBitUniform(bw, hdr->update_map_); - if (VP8PutBitUniform(bw, update_data)) { - // we always use absolute values, not relative ones - VP8PutBitUniform(bw, 1); // (segment_feature_mode = 1. Paragraph 9.3.) - for (s = 0; s < NUM_MB_SEGMENTS; ++s) { - VP8PutSignedValue(bw, enc->dqm_[s].quant_, 7); - } - for (s = 0; s < NUM_MB_SEGMENTS; ++s) { - VP8PutSignedValue(bw, enc->dqm_[s].fstrength_, 6); - } - } - if (hdr->update_map_) { - for (s = 0; s < 3; ++s) { - if (VP8PutBitUniform(bw, (proba->segments_[s] != 255u))) { - VP8PutValue(bw, proba->segments_[s], 8); - } - } - } - } -} - -// Filtering parameters header -static void PutFilterHeader(VP8BitWriter* const bw, - const VP8FilterHeader* const hdr) { - const int use_lf_delta = (hdr->i4x4_lf_delta_ != 0); - VP8PutBitUniform(bw, hdr->simple_); - VP8PutValue(bw, hdr->level_, 6); - VP8PutValue(bw, hdr->sharpness_, 3); - if (VP8PutBitUniform(bw, use_lf_delta)) { - // '0' is the default value for i4x4_lf_delta_ at frame #0. - const int need_update = (hdr->i4x4_lf_delta_ != 0); - if (VP8PutBitUniform(bw, need_update)) { - // we don't use ref_lf_delta => emit four 0 bits - VP8PutValue(bw, 0, 4); - // we use mode_lf_delta for i4x4 - VP8PutSignedValue(bw, hdr->i4x4_lf_delta_, 6); - VP8PutValue(bw, 0, 3); // all others unused - } - } -} - -// Nominal quantization parameters -static void PutQuant(VP8BitWriter* const bw, - const VP8Encoder* const enc) { - VP8PutValue(bw, enc->base_quant_, 7); - VP8PutSignedValue(bw, enc->dq_y1_dc_, 4); - VP8PutSignedValue(bw, enc->dq_y2_dc_, 4); - VP8PutSignedValue(bw, enc->dq_y2_ac_, 4); - VP8PutSignedValue(bw, enc->dq_uv_dc_, 4); - VP8PutSignedValue(bw, enc->dq_uv_ac_, 4); -} - -// Partition sizes -static int EmitPartitionsSize(const VP8Encoder* const enc, - WebPPicture* const pic) { - uint8_t buf[3 * (MAX_NUM_PARTITIONS - 1)]; - int p; - for (p = 0; p < enc->num_parts_ - 1; ++p) { - const size_t part_size = VP8BitWriterSize(enc->parts_ + p); - if (part_size >= VP8_MAX_PARTITION_SIZE) { - return WebPEncodingSetError(pic, VP8_ENC_ERROR_PARTITION_OVERFLOW); - } - buf[3 * p + 0] = (part_size >> 0) & 0xff; - buf[3 * p + 1] = (part_size >> 8) & 0xff; - buf[3 * p + 2] = (part_size >> 16) & 0xff; - } - return p ? pic->writer(buf, 3 * p, pic) : 1; -} - -//------------------------------------------------------------------------------ - -#ifdef WEBP_EXPERIMENTAL_FEATURES - -#define KTRAILER_SIZE 8 - -static int WriteExtensions(VP8Encoder* const enc) { - uint8_t buffer[KTRAILER_SIZE]; - VP8BitWriter* const bw = &enc->bw_; - WebPPicture* const pic = enc->pic_; - - // Layer (bytes 0..3) - PutLE24(buffer + 0, enc->layer_data_size_); - buffer[3] = enc->pic_->colorspace & WEBP_CSP_UV_MASK; - if (enc->layer_data_size_ > 0) { - assert(enc->use_layer_); - // append layer data to last partition - if (!VP8BitWriterAppend(&enc->parts_[enc->num_parts_ - 1], - enc->layer_data_, enc->layer_data_size_)) { - return WebPEncodingSetError(pic, VP8_ENC_ERROR_BITSTREAM_OUT_OF_MEMORY); - } - } - - buffer[KTRAILER_SIZE - 1] = 0x01; // marker - if (!VP8BitWriterAppend(bw, buffer, KTRAILER_SIZE)) { - return WebPEncodingSetError(pic, VP8_ENC_ERROR_BITSTREAM_OUT_OF_MEMORY); - } - return 1; -} - -#endif /* WEBP_EXPERIMENTAL_FEATURES */ - -//------------------------------------------------------------------------------ - -static size_t GeneratePartition0(VP8Encoder* const enc) { - VP8BitWriter* const bw = &enc->bw_; - const int mb_size = enc->mb_w_ * enc->mb_h_; - uint64_t pos1, pos2, pos3; -#ifdef WEBP_EXPERIMENTAL_FEATURES - const int need_extensions = enc->use_layer_; -#endif - - pos1 = VP8BitWriterPos(bw); - VP8BitWriterInit(bw, mb_size * 7 / 8); // ~7 bits per macroblock -#ifdef WEBP_EXPERIMENTAL_FEATURES - VP8PutBitUniform(bw, need_extensions); // extensions -#else - VP8PutBitUniform(bw, 0); // colorspace -#endif - VP8PutBitUniform(bw, 0); // clamp type - - PutSegmentHeader(bw, enc); - PutFilterHeader(bw, &enc->filter_hdr_); - VP8PutValue(bw, enc->config_->partitions, 2); - PutQuant(bw, enc); - VP8PutBitUniform(bw, 0); // no proba update - VP8WriteProbas(bw, &enc->proba_); - pos2 = VP8BitWriterPos(bw); - VP8CodeIntraModes(enc); - VP8BitWriterFinish(bw); - -#ifdef WEBP_EXPERIMENTAL_FEATURES - if (need_extensions && !WriteExtensions(enc)) { - return 0; - } -#endif - - pos3 = VP8BitWriterPos(bw); - - if (enc->pic_->stats) { - enc->pic_->stats->header_bytes[0] = (int)((pos2 - pos1 + 7) >> 3); - enc->pic_->stats->header_bytes[1] = (int)((pos3 - pos2 + 7) >> 3); - enc->pic_->stats->alpha_data_size = (int)enc->alpha_data_size_; - enc->pic_->stats->layer_data_size = (int)enc->layer_data_size_; - } - return !bw->error_; -} - -void VP8EncFreeBitWriters(VP8Encoder* const enc) { - int p; - VP8BitWriterWipeOut(&enc->bw_); - for (p = 0; p < enc->num_parts_; ++p) { - VP8BitWriterWipeOut(enc->parts_ + p); - } -} - -int VP8EncWrite(VP8Encoder* const enc) { - WebPPicture* const pic = enc->pic_; - VP8BitWriter* const bw = &enc->bw_; - const int task_percent = 19; - const int percent_per_part = task_percent / enc->num_parts_; - const int final_percent = enc->percent_ + task_percent; - int ok = 0; - size_t vp8_size, pad, riff_size; - int p; - - // Partition #0 with header and partition sizes - ok = !!GeneratePartition0(enc); - - // Compute VP8 size - vp8_size = VP8_FRAME_HEADER_SIZE + - VP8BitWriterSize(bw) + - 3 * (enc->num_parts_ - 1); - for (p = 0; p < enc->num_parts_; ++p) { - vp8_size += VP8BitWriterSize(enc->parts_ + p); - } - pad = vp8_size & 1; - vp8_size += pad; - - // Compute RIFF size - // At the minimum it is: "WEBPVP8 nnnn" + VP8 data size. - riff_size = TAG_SIZE + CHUNK_HEADER_SIZE + vp8_size; - if (IsVP8XNeeded(enc)) { // Add size for: VP8X header + data. - riff_size += CHUNK_HEADER_SIZE + VP8X_CHUNK_SIZE; - } - if (enc->has_alpha_) { // Add size for: ALPH header + data. - const uint32_t padded_alpha_size = enc->alpha_data_size_ + - (enc->alpha_data_size_ & 1); - riff_size += CHUNK_HEADER_SIZE + padded_alpha_size; - } - // Sanity check. - if (riff_size > 0xfffffffeU) { - return WebPEncodingSetError(pic, VP8_ENC_ERROR_FILE_TOO_BIG); - } - - // Emit headers and partition #0 - { - const uint8_t* const part0 = VP8BitWriterBuf(bw); - const size_t size0 = VP8BitWriterSize(bw); - ok = ok && PutWebPHeaders(enc, size0, vp8_size, riff_size) - && pic->writer(part0, size0, pic) - && EmitPartitionsSize(enc, pic); - VP8BitWriterWipeOut(bw); // will free the internal buffer. - } - - // Token partitions - for (p = 0; p < enc->num_parts_; ++p) { - const uint8_t* const buf = VP8BitWriterBuf(enc->parts_ + p); - const size_t size = VP8BitWriterSize(enc->parts_ + p); - if (size) - ok = ok && pic->writer(buf, size, pic); - VP8BitWriterWipeOut(enc->parts_ + p); // will free the internal buffer. - ok = ok && WebPReportProgress(pic, enc->percent_ + percent_per_part, - &enc->percent_); - } - - // Padding byte - if (ok && pad) { - ok = PutPaddingByte(pic); - } - - enc->coded_size_ = (int)(CHUNK_HEADER_SIZE + riff_size); - ok = ok && WebPReportProgress(pic, final_percent, &enc->percent_); - return ok; -} - -//------------------------------------------------------------------------------ - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif diff --git a/external/libwebp/enc/tree.c b/external/libwebp/enc/tree.c deleted file mode 100644 index 8b25e5e488..0000000000 --- a/external/libwebp/enc/tree.c +++ /dev/null @@ -1,510 +0,0 @@ -// Copyright 2011 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Token probabilities -// -// Author: Skal (pascal.massimino@gmail.com) - -#include "./vp8enci.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -//------------------------------------------------------------------------------ -// Default probabilities - -// Paragraph 13.5 -const uint8_t - VP8CoeffsProba0[NUM_TYPES][NUM_BANDS][NUM_CTX][NUM_PROBAS] = { - // genereated using vp8_default_coef_probs() in entropy.c:129 - { { { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }, - { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }, - { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 } - }, - { { 253, 136, 254, 255, 228, 219, 128, 128, 128, 128, 128 }, - { 189, 129, 242, 255, 227, 213, 255, 219, 128, 128, 128 }, - { 106, 126, 227, 252, 214, 209, 255, 255, 128, 128, 128 } - }, - { { 1, 98, 248, 255, 236, 226, 255, 255, 128, 128, 128 }, - { 181, 133, 238, 254, 221, 234, 255, 154, 128, 128, 128 }, - { 78, 134, 202, 247, 198, 180, 255, 219, 128, 128, 128 }, - }, - { { 1, 185, 249, 255, 243, 255, 128, 128, 128, 128, 128 }, - { 184, 150, 247, 255, 236, 224, 128, 128, 128, 128, 128 }, - { 77, 110, 216, 255, 236, 230, 128, 128, 128, 128, 128 }, - }, - { { 1, 101, 251, 255, 241, 255, 128, 128, 128, 128, 128 }, - { 170, 139, 241, 252, 236, 209, 255, 255, 128, 128, 128 }, - { 37, 116, 196, 243, 228, 255, 255, 255, 128, 128, 128 } - }, - { { 1, 204, 254, 255, 245, 255, 128, 128, 128, 128, 128 }, - { 207, 160, 250, 255, 238, 128, 128, 128, 128, 128, 128 }, - { 102, 103, 231, 255, 211, 171, 128, 128, 128, 128, 128 } - }, - { { 1, 152, 252, 255, 240, 255, 128, 128, 128, 128, 128 }, - { 177, 135, 243, 255, 234, 225, 128, 128, 128, 128, 128 }, - { 80, 129, 211, 255, 194, 224, 128, 128, 128, 128, 128 } - }, - { { 1, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, - { 246, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, - { 255, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 } - } - }, - { { { 198, 35, 237, 223, 193, 187, 162, 160, 145, 155, 62 }, - { 131, 45, 198, 221, 172, 176, 220, 157, 252, 221, 1 }, - { 68, 47, 146, 208, 149, 167, 221, 162, 255, 223, 128 } - }, - { { 1, 149, 241, 255, 221, 224, 255, 255, 128, 128, 128 }, - { 184, 141, 234, 253, 222, 220, 255, 199, 128, 128, 128 }, - { 81, 99, 181, 242, 176, 190, 249, 202, 255, 255, 128 } - }, - { { 1, 129, 232, 253, 214, 197, 242, 196, 255, 255, 128 }, - { 99, 121, 210, 250, 201, 198, 255, 202, 128, 128, 128 }, - { 23, 91, 163, 242, 170, 187, 247, 210, 255, 255, 128 } - }, - { { 1, 200, 246, 255, 234, 255, 128, 128, 128, 128, 128 }, - { 109, 178, 241, 255, 231, 245, 255, 255, 128, 128, 128 }, - { 44, 130, 201, 253, 205, 192, 255, 255, 128, 128, 128 } - }, - { { 1, 132, 239, 251, 219, 209, 255, 165, 128, 128, 128 }, - { 94, 136, 225, 251, 218, 190, 255, 255, 128, 128, 128 }, - { 22, 100, 174, 245, 186, 161, 255, 199, 128, 128, 128 } - }, - { { 1, 182, 249, 255, 232, 235, 128, 128, 128, 128, 128 }, - { 124, 143, 241, 255, 227, 234, 128, 128, 128, 128, 128 }, - { 35, 77, 181, 251, 193, 211, 255, 205, 128, 128, 128 } - }, - { { 1, 157, 247, 255, 236, 231, 255, 255, 128, 128, 128 }, - { 121, 141, 235, 255, 225, 227, 255, 255, 128, 128, 128 }, - { 45, 99, 188, 251, 195, 217, 255, 224, 128, 128, 128 } - }, - { { 1, 1, 251, 255, 213, 255, 128, 128, 128, 128, 128 }, - { 203, 1, 248, 255, 255, 128, 128, 128, 128, 128, 128 }, - { 137, 1, 177, 255, 224, 255, 128, 128, 128, 128, 128 } - } - }, - { { { 253, 9, 248, 251, 207, 208, 255, 192, 128, 128, 128 }, - { 175, 13, 224, 243, 193, 185, 249, 198, 255, 255, 128 }, - { 73, 17, 171, 221, 161, 179, 236, 167, 255, 234, 128 } - }, - { { 1, 95, 247, 253, 212, 183, 255, 255, 128, 128, 128 }, - { 239, 90, 244, 250, 211, 209, 255, 255, 128, 128, 128 }, - { 155, 77, 195, 248, 188, 195, 255, 255, 128, 128, 128 } - }, - { { 1, 24, 239, 251, 218, 219, 255, 205, 128, 128, 128 }, - { 201, 51, 219, 255, 196, 186, 128, 128, 128, 128, 128 }, - { 69, 46, 190, 239, 201, 218, 255, 228, 128, 128, 128 } - }, - { { 1, 191, 251, 255, 255, 128, 128, 128, 128, 128, 128 }, - { 223, 165, 249, 255, 213, 255, 128, 128, 128, 128, 128 }, - { 141, 124, 248, 255, 255, 128, 128, 128, 128, 128, 128 } - }, - { { 1, 16, 248, 255, 255, 128, 128, 128, 128, 128, 128 }, - { 190, 36, 230, 255, 236, 255, 128, 128, 128, 128, 128 }, - { 149, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 } - }, - { { 1, 226, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, - { 247, 192, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, - { 240, 128, 255, 128, 128, 128, 128, 128, 128, 128, 128 } - }, - { { 1, 134, 252, 255, 255, 128, 128, 128, 128, 128, 128 }, - { 213, 62, 250, 255, 255, 128, 128, 128, 128, 128, 128 }, - { 55, 93, 255, 128, 128, 128, 128, 128, 128, 128, 128 } - }, - { { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }, - { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }, - { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 } - } - }, - { { { 202, 24, 213, 235, 186, 191, 220, 160, 240, 175, 255 }, - { 126, 38, 182, 232, 169, 184, 228, 174, 255, 187, 128 }, - { 61, 46, 138, 219, 151, 178, 240, 170, 255, 216, 128 } - }, - { { 1, 112, 230, 250, 199, 191, 247, 159, 255, 255, 128 }, - { 166, 109, 228, 252, 211, 215, 255, 174, 128, 128, 128 }, - { 39, 77, 162, 232, 172, 180, 245, 178, 255, 255, 128 } - }, - { { 1, 52, 220, 246, 198, 199, 249, 220, 255, 255, 128 }, - { 124, 74, 191, 243, 183, 193, 250, 221, 255, 255, 128 }, - { 24, 71, 130, 219, 154, 170, 243, 182, 255, 255, 128 } - }, - { { 1, 182, 225, 249, 219, 240, 255, 224, 128, 128, 128 }, - { 149, 150, 226, 252, 216, 205, 255, 171, 128, 128, 128 }, - { 28, 108, 170, 242, 183, 194, 254, 223, 255, 255, 128 } - }, - { { 1, 81, 230, 252, 204, 203, 255, 192, 128, 128, 128 }, - { 123, 102, 209, 247, 188, 196, 255, 233, 128, 128, 128 }, - { 20, 95, 153, 243, 164, 173, 255, 203, 128, 128, 128 } - }, - { { 1, 222, 248, 255, 216, 213, 128, 128, 128, 128, 128 }, - { 168, 175, 246, 252, 235, 205, 255, 255, 128, 128, 128 }, - { 47, 116, 215, 255, 211, 212, 255, 255, 128, 128, 128 } - }, - { { 1, 121, 236, 253, 212, 214, 255, 255, 128, 128, 128 }, - { 141, 84, 213, 252, 201, 202, 255, 219, 128, 128, 128 }, - { 42, 80, 160, 240, 162, 185, 255, 205, 128, 128, 128 } - }, - { { 1, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, - { 244, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, - { 238, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 } - } - } -}; - -void VP8DefaultProbas(VP8Encoder* const enc) { - VP8Proba* const probas = &enc->proba_; - probas->use_skip_proba_ = 0; - memset(probas->segments_, 255u, sizeof(probas->segments_)); - memcpy(probas->coeffs_, VP8CoeffsProba0, sizeof(VP8CoeffsProba0)); - // Note: we could hard-code the level_costs_ corresponding to VP8CoeffsProba0, - // but that's ~11k of static data. Better call VP8CalculateLevelCosts() later. - probas->dirty_ = 1; -} - -// Paragraph 11.5. 900bytes. -static const uint8_t kBModesProba[NUM_BMODES][NUM_BMODES][NUM_BMODES - 1] = { - { { 231, 120, 48, 89, 115, 113, 120, 152, 112 }, - { 152, 179, 64, 126, 170, 118, 46, 70, 95 }, - { 175, 69, 143, 80, 85, 82, 72, 155, 103 }, - { 56, 58, 10, 171, 218, 189, 17, 13, 152 }, - { 114, 26, 17, 163, 44, 195, 21, 10, 173 }, - { 121, 24, 80, 195, 26, 62, 44, 64, 85 }, - { 144, 71, 10, 38, 171, 213, 144, 34, 26 }, - { 170, 46, 55, 19, 136, 160, 33, 206, 71 }, - { 63, 20, 8, 114, 114, 208, 12, 9, 226 }, - { 81, 40, 11, 96, 182, 84, 29, 16, 36 } }, - { { 134, 183, 89, 137, 98, 101, 106, 165, 148 }, - { 72, 187, 100, 130, 157, 111, 32, 75, 80 }, - { 66, 102, 167, 99, 74, 62, 40, 234, 128 }, - { 41, 53, 9, 178, 241, 141, 26, 8, 107 }, - { 74, 43, 26, 146, 73, 166, 49, 23, 157 }, - { 65, 38, 105, 160, 51, 52, 31, 115, 128 }, - { 104, 79, 12, 27, 217, 255, 87, 17, 7 }, - { 87, 68, 71, 44, 114, 51, 15, 186, 23 }, - { 47, 41, 14, 110, 182, 183, 21, 17, 194 }, - { 66, 45, 25, 102, 197, 189, 23, 18, 22 } }, - { { 88, 88, 147, 150, 42, 46, 45, 196, 205 }, - { 43, 97, 183, 117, 85, 38, 35, 179, 61 }, - { 39, 53, 200, 87, 26, 21, 43, 232, 171 }, - { 56, 34, 51, 104, 114, 102, 29, 93, 77 }, - { 39, 28, 85, 171, 58, 165, 90, 98, 64 }, - { 34, 22, 116, 206, 23, 34, 43, 166, 73 }, - { 107, 54, 32, 26, 51, 1, 81, 43, 31 }, - { 68, 25, 106, 22, 64, 171, 36, 225, 114 }, - { 34, 19, 21, 102, 132, 188, 16, 76, 124 }, - { 62, 18, 78, 95, 85, 57, 50, 48, 51 } }, - { { 193, 101, 35, 159, 215, 111, 89, 46, 111 }, - { 60, 148, 31, 172, 219, 228, 21, 18, 111 }, - { 112, 113, 77, 85, 179, 255, 38, 120, 114 }, - { 40, 42, 1, 196, 245, 209, 10, 25, 109 }, - { 88, 43, 29, 140, 166, 213, 37, 43, 154 }, - { 61, 63, 30, 155, 67, 45, 68, 1, 209 }, - { 100, 80, 8, 43, 154, 1, 51, 26, 71 }, - { 142, 78, 78, 16, 255, 128, 34, 197, 171 }, - { 41, 40, 5, 102, 211, 183, 4, 1, 221 }, - { 51, 50, 17, 168, 209, 192, 23, 25, 82 } }, - { { 138, 31, 36, 171, 27, 166, 38, 44, 229 }, - { 67, 87, 58, 169, 82, 115, 26, 59, 179 }, - { 63, 59, 90, 180, 59, 166, 93, 73, 154 }, - { 40, 40, 21, 116, 143, 209, 34, 39, 175 }, - { 47, 15, 16, 183, 34, 223, 49, 45, 183 }, - { 46, 17, 33, 183, 6, 98, 15, 32, 183 }, - { 57, 46, 22, 24, 128, 1, 54, 17, 37 }, - { 65, 32, 73, 115, 28, 128, 23, 128, 205 }, - { 40, 3, 9, 115, 51, 192, 18, 6, 223 }, - { 87, 37, 9, 115, 59, 77, 64, 21, 47 } }, - { { 104, 55, 44, 218, 9, 54, 53, 130, 226 }, - { 64, 90, 70, 205, 40, 41, 23, 26, 57 }, - { 54, 57, 112, 184, 5, 41, 38, 166, 213 }, - { 30, 34, 26, 133, 152, 116, 10, 32, 134 }, - { 39, 19, 53, 221, 26, 114, 32, 73, 255 }, - { 31, 9, 65, 234, 2, 15, 1, 118, 73 }, - { 75, 32, 12, 51, 192, 255, 160, 43, 51 }, - { 88, 31, 35, 67, 102, 85, 55, 186, 85 }, - { 56, 21, 23, 111, 59, 205, 45, 37, 192 }, - { 55, 38, 70, 124, 73, 102, 1, 34, 98 } }, - { { 125, 98, 42, 88, 104, 85, 117, 175, 82 }, - { 95, 84, 53, 89, 128, 100, 113, 101, 45 }, - { 75, 79, 123, 47, 51, 128, 81, 171, 1 }, - { 57, 17, 5, 71, 102, 57, 53, 41, 49 }, - { 38, 33, 13, 121, 57, 73, 26, 1, 85 }, - { 41, 10, 67, 138, 77, 110, 90, 47, 114 }, - { 115, 21, 2, 10, 102, 255, 166, 23, 6 }, - { 101, 29, 16, 10, 85, 128, 101, 196, 26 }, - { 57, 18, 10, 102, 102, 213, 34, 20, 43 }, - { 117, 20, 15, 36, 163, 128, 68, 1, 26 } }, - { { 102, 61, 71, 37, 34, 53, 31, 243, 192 }, - { 69, 60, 71, 38, 73, 119, 28, 222, 37 }, - { 68, 45, 128, 34, 1, 47, 11, 245, 171 }, - { 62, 17, 19, 70, 146, 85, 55, 62, 70 }, - { 37, 43, 37, 154, 100, 163, 85, 160, 1 }, - { 63, 9, 92, 136, 28, 64, 32, 201, 85 }, - { 75, 15, 9, 9, 64, 255, 184, 119, 16 }, - { 86, 6, 28, 5, 64, 255, 25, 248, 1 }, - { 56, 8, 17, 132, 137, 255, 55, 116, 128 }, - { 58, 15, 20, 82, 135, 57, 26, 121, 40 } }, - { { 164, 50, 31, 137, 154, 133, 25, 35, 218 }, - { 51, 103, 44, 131, 131, 123, 31, 6, 158 }, - { 86, 40, 64, 135, 148, 224, 45, 183, 128 }, - { 22, 26, 17, 131, 240, 154, 14, 1, 209 }, - { 45, 16, 21, 91, 64, 222, 7, 1, 197 }, - { 56, 21, 39, 155, 60, 138, 23, 102, 213 }, - { 83, 12, 13, 54, 192, 255, 68, 47, 28 }, - { 85, 26, 85, 85, 128, 128, 32, 146, 171 }, - { 18, 11, 7, 63, 144, 171, 4, 4, 246 }, - { 35, 27, 10, 146, 174, 171, 12, 26, 128 } }, - { { 190, 80, 35, 99, 180, 80, 126, 54, 45 }, - { 85, 126, 47, 87, 176, 51, 41, 20, 32 }, - { 101, 75, 128, 139, 118, 146, 116, 128, 85 }, - { 56, 41, 15, 176, 236, 85, 37, 9, 62 }, - { 71, 30, 17, 119, 118, 255, 17, 18, 138 }, - { 101, 38, 60, 138, 55, 70, 43, 26, 142 }, - { 146, 36, 19, 30, 171, 255, 97, 27, 20 }, - { 138, 45, 61, 62, 219, 1, 81, 188, 64 }, - { 32, 41, 20, 117, 151, 142, 20, 21, 163 }, - { 112, 19, 12, 61, 195, 128, 48, 4, 24 } } -}; - -static int PutI4Mode(VP8BitWriter* const bw, int mode, - const uint8_t* const prob) { - if (VP8PutBit(bw, mode != B_DC_PRED, prob[0])) { - if (VP8PutBit(bw, mode != B_TM_PRED, prob[1])) { - if (VP8PutBit(bw, mode != B_VE_PRED, prob[2])) { - if (!VP8PutBit(bw, mode >= B_LD_PRED, prob[3])) { - if (VP8PutBit(bw, mode != B_HE_PRED, prob[4])) { - VP8PutBit(bw, mode != B_RD_PRED, prob[5]); - } - } else { - if (VP8PutBit(bw, mode != B_LD_PRED, prob[6])) { - if (VP8PutBit(bw, mode != B_VL_PRED, prob[7])) { - VP8PutBit(bw, mode != B_HD_PRED, prob[8]); - } - } - } - } - } - } - return mode; -} - -static void PutI16Mode(VP8BitWriter* const bw, int mode) { - if (VP8PutBit(bw, (mode == TM_PRED || mode == H_PRED), 156)) { - VP8PutBit(bw, mode == TM_PRED, 128); // TM or HE - } else { - VP8PutBit(bw, mode == V_PRED, 163); // VE or DC - } -} - -static void PutUVMode(VP8BitWriter* const bw, int uv_mode) { - if (VP8PutBit(bw, uv_mode != DC_PRED, 142)) { - if (VP8PutBit(bw, uv_mode != V_PRED, 114)) { - VP8PutBit(bw, uv_mode != H_PRED, 183); // else: TM_PRED - } - } -} - -static void PutSegment(VP8BitWriter* const bw, int s, const uint8_t* p) { - if (VP8PutBit(bw, s >= 2, p[0])) p += 1; - VP8PutBit(bw, s & 1, p[1]); -} - -void VP8CodeIntraModes(VP8Encoder* const enc) { - VP8BitWriter* const bw = &enc->bw_; - VP8EncIterator it; - VP8IteratorInit(enc, &it); - do { - const VP8MBInfo* mb = it.mb_; - const uint8_t* preds = it.preds_; - if (enc->segment_hdr_.update_map_) { - PutSegment(bw, mb->segment_, enc->proba_.segments_); - } - if (enc->proba_.use_skip_proba_) { - VP8PutBit(bw, mb->skip_, enc->proba_.skip_proba_); - } - if (VP8PutBit(bw, (mb->type_ != 0), 145)) { // i16x16 - PutI16Mode(bw, preds[0]); - } else { - const int preds_w = enc->preds_w_; - const uint8_t* top_pred = preds - preds_w; - int x, y; - for (y = 0; y < 4; ++y) { - int left = preds[-1]; - for (x = 0; x < 4; ++x) { - const uint8_t* const probas = kBModesProba[top_pred[x]][left]; - left = PutI4Mode(bw, preds[x], probas); - } - top_pred = preds; - preds += preds_w; - } - } - PutUVMode(bw, mb->uv_mode_); - } while (VP8IteratorNext(&it, 0)); -} - -//------------------------------------------------------------------------------ -// Paragraph 13 - -const uint8_t - VP8CoeffsUpdateProba[NUM_TYPES][NUM_BANDS][NUM_CTX][NUM_PROBAS] = { - { { { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 176, 246, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 223, 241, 252, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 249, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 244, 252, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 234, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 253, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 246, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 239, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 254, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 248, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 251, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 251, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 254, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 254, 253, 255, 254, 255, 255, 255, 255, 255, 255 }, - { 250, 255, 254, 255, 254, 255, 255, 255, 255, 255, 255 }, - { 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - } - }, - { { { 217, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 225, 252, 241, 253, 255, 255, 254, 255, 255, 255, 255 }, - { 234, 250, 241, 250, 253, 255, 253, 254, 255, 255, 255 } - }, - { { 255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 223, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 238, 253, 254, 254, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 248, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 249, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 253, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 247, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 252, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 253, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 254, 253, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 250, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - } - }, - { { { 186, 251, 250, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 234, 251, 244, 254, 255, 255, 255, 255, 255, 255, 255 }, - { 251, 251, 243, 253, 254, 255, 254, 255, 255, 255, 255 } - }, - { { 255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 236, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 251, 253, 253, 254, 254, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 254, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 254, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - } - }, - { { { 248, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 250, 254, 252, 254, 255, 255, 255, 255, 255, 255, 255 }, - { 248, 254, 249, 253, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 246, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 252, 254, 251, 254, 254, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 254, 252, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 248, 254, 253, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 253, 255, 254, 254, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 251, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 245, 251, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 253, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 251, 253, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 252, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 252, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 249, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 255, 253, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 250, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - } - } -}; - -void VP8WriteProbas(VP8BitWriter* const bw, const VP8Proba* const probas) { - int t, b, c, p; - for (t = 0; t < NUM_TYPES; ++t) { - for (b = 0; b < NUM_BANDS; ++b) { - for (c = 0; c < NUM_CTX; ++c) { - for (p = 0; p < NUM_PROBAS; ++p) { - const uint8_t p0 = probas->coeffs_[t][b][c][p]; - const int update = (p0 != VP8CoeffsProba0[t][b][c][p]); - if (VP8PutBit(bw, update, VP8CoeffsUpdateProba[t][b][c][p])) { - VP8PutValue(bw, p0, 8); - } - } - } - } - } - if (VP8PutBitUniform(bw, probas->use_skip_proba_)) { - VP8PutValue(bw, probas->skip_proba_, 8); - } -} - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif diff --git a/external/libwebp/enc/vp8enci.h b/external/libwebp/enc/vp8enci.h deleted file mode 100644 index f660eeec55..0000000000 --- a/external/libwebp/enc/vp8enci.h +++ /dev/null @@ -1,525 +0,0 @@ -// Copyright 2011 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// WebP encoder: internal header. -// -// Author: Skal (pascal.massimino@gmail.com) - -#ifndef WEBP_ENC_VP8ENCI_H_ -#define WEBP_ENC_VP8ENCI_H_ - -#include <string.h> // for memcpy() -#include "../webp/encode.h" -#include "../dsp/dsp.h" -#include "../utils/bit_writer.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -//------------------------------------------------------------------------------ -// Various defines and enums - -// version numbers -#define ENC_MAJ_VERSION 0 -#define ENC_MIN_VERSION 2 -#define ENC_REV_VERSION 1 - -// size of histogram used by CollectHistogram. -#define MAX_COEFF_THRESH 64 - -// intra prediction modes -enum { B_DC_PRED = 0, // 4x4 modes - B_TM_PRED = 1, - B_VE_PRED = 2, - B_HE_PRED = 3, - B_RD_PRED = 4, - B_VR_PRED = 5, - B_LD_PRED = 6, - B_VL_PRED = 7, - B_HD_PRED = 8, - B_HU_PRED = 9, - NUM_BMODES = B_HU_PRED + 1 - B_DC_PRED, // = 10 - - // Luma16 or UV modes - DC_PRED = B_DC_PRED, V_PRED = B_VE_PRED, - H_PRED = B_HE_PRED, TM_PRED = B_TM_PRED - }; - -enum { NUM_MB_SEGMENTS = 4, - MAX_NUM_PARTITIONS = 8, - NUM_TYPES = 4, // 0: i16-AC, 1: i16-DC, 2:chroma-AC, 3:i4-AC - NUM_BANDS = 8, - NUM_CTX = 3, - NUM_PROBAS = 11, - MAX_LF_LEVELS = 64, // Maximum loop filter level - MAX_VARIABLE_LEVEL = 67 // last (inclusive) level with variable cost - }; - -// YUV-cache parameters. Cache is 16-pixels wide. -// The original or reconstructed samples can be accessed using VP8Scan[] -// The predicted blocks can be accessed using offsets to yuv_p_ and -// the arrays VP8*ModeOffsets[]; -// +----+ YUV Samples area. See VP8Scan[] for accessing the blocks. -// Y_OFF |YYYY| <- original samples (enc->yuv_in_) -// |YYYY| -// |YYYY| -// |YYYY| -// U_OFF |UUVV| V_OFF (=U_OFF + 8) -// |UUVV| -// +----+ -// Y_OFF |YYYY| <- compressed/decoded samples ('yuv_out_') -// |YYYY| There are two buffers like this ('yuv_out_'/'yuv_out2_') -// |YYYY| -// |YYYY| -// U_OFF |UUVV| V_OFF -// |UUVV| -// x2 (for yuv_out2_) -// +----+ Prediction area ('yuv_p_', size = PRED_SIZE) -// I16DC16 |YYYY| Intra16 predictions (16x16 block each) -// |YYYY| -// |YYYY| -// |YYYY| -// I16TM16 |YYYY| -// |YYYY| -// |YYYY| -// |YYYY| -// I16VE16 |YYYY| -// |YYYY| -// |YYYY| -// |YYYY| -// I16HE16 |YYYY| -// |YYYY| -// |YYYY| -// |YYYY| -// +----+ Chroma U/V predictions (16x8 block each) -// C8DC8 |UUVV| -// |UUVV| -// C8TM8 |UUVV| -// |UUVV| -// C8VE8 |UUVV| -// |UUVV| -// C8HE8 |UUVV| -// |UUVV| -// +----+ Intra 4x4 predictions (4x4 block each) -// |YYYY| I4DC4 I4TM4 I4VE4 I4HE4 -// |YYYY| I4RD4 I4VR4 I4LD4 I4VL4 -// |YY..| I4HD4 I4HU4 I4TMP -// +----+ -#define BPS 16 // this is the common stride -#define Y_SIZE (BPS * 16) -#define UV_SIZE (BPS * 8) -#define YUV_SIZE (Y_SIZE + UV_SIZE) -#define PRED_SIZE (6 * 16 * BPS + 12 * BPS) -#define Y_OFF (0) -#define U_OFF (Y_SIZE) -#define V_OFF (U_OFF + 8) -#define ALIGN_CST 15 -#define DO_ALIGN(PTR) ((uintptr_t)((PTR) + ALIGN_CST) & ~ALIGN_CST) - -extern const int VP8Scan[16 + 4 + 4]; // in quant.c -extern const int VP8UVModeOffsets[4]; // in analyze.c -extern const int VP8I16ModeOffsets[4]; -extern const int VP8I4ModeOffsets[NUM_BMODES]; - -// Layout of prediction blocks -// intra 16x16 -#define I16DC16 (0 * 16 * BPS) -#define I16TM16 (1 * 16 * BPS) -#define I16VE16 (2 * 16 * BPS) -#define I16HE16 (3 * 16 * BPS) -// chroma 8x8, two U/V blocks side by side (hence: 16x8 each) -#define C8DC8 (4 * 16 * BPS) -#define C8TM8 (4 * 16 * BPS + 8 * BPS) -#define C8VE8 (5 * 16 * BPS) -#define C8HE8 (5 * 16 * BPS + 8 * BPS) -// intra 4x4 -#define I4DC4 (6 * 16 * BPS + 0) -#define I4TM4 (6 * 16 * BPS + 4) -#define I4VE4 (6 * 16 * BPS + 8) -#define I4HE4 (6 * 16 * BPS + 12) -#define I4RD4 (6 * 16 * BPS + 4 * BPS + 0) -#define I4VR4 (6 * 16 * BPS + 4 * BPS + 4) -#define I4LD4 (6 * 16 * BPS + 4 * BPS + 8) -#define I4VL4 (6 * 16 * BPS + 4 * BPS + 12) -#define I4HD4 (6 * 16 * BPS + 8 * BPS + 0) -#define I4HU4 (6 * 16 * BPS + 8 * BPS + 4) -#define I4TMP (6 * 16 * BPS + 8 * BPS + 8) - -typedef int64_t score_t; // type used for scores, rate, distortion -#define MAX_COST ((score_t)0x7fffffffffffffLL) - -#define QFIX 17 -#define BIAS(b) ((b) << (QFIX - 8)) -// Fun fact: this is the _only_ line where we're actually being lossy and -// discarding bits. -static WEBP_INLINE int QUANTDIV(int n, int iQ, int B) { - return (n * iQ + B) >> QFIX; -} -extern const uint8_t VP8Zigzag[16]; - -//------------------------------------------------------------------------------ -// Headers - -typedef uint32_t proba_t; // 16b + 16b -typedef uint8_t ProbaArray[NUM_CTX][NUM_PROBAS]; -typedef proba_t StatsArray[NUM_CTX][NUM_PROBAS]; -typedef uint16_t CostArray[NUM_CTX][MAX_VARIABLE_LEVEL + 1]; -typedef double LFStats[NUM_MB_SEGMENTS][MAX_LF_LEVELS]; // filter stats - -typedef struct VP8Encoder VP8Encoder; - -// segment features -typedef struct { - int num_segments_; // Actual number of segments. 1 segment only = unused. - int update_map_; // whether to update the segment map or not. - // must be 0 if there's only 1 segment. - int size_; // bit-cost for transmitting the segment map -} VP8SegmentHeader; - -// Struct collecting all frame-persistent probabilities. -typedef struct { - uint8_t segments_[3]; // probabilities for segment tree - uint8_t skip_proba_; // final probability of being skipped. - ProbaArray coeffs_[NUM_TYPES][NUM_BANDS]; // 924 bytes - StatsArray stats_[NUM_TYPES][NUM_BANDS]; // 4224 bytes - CostArray level_cost_[NUM_TYPES][NUM_BANDS]; // 11.4k - int dirty_; // if true, need to call VP8CalculateLevelCosts() - int use_skip_proba_; // Note: we always use skip_proba for now. - int nb_skip_; // number of skipped blocks -} VP8Proba; - -// Filter parameters. Not actually used in the code (we don't perform -// the in-loop filtering), but filled from user's config -typedef struct { - int simple_; // filtering type: 0=complex, 1=simple - int level_; // base filter level [0..63] - int sharpness_; // [0..7] - int i4x4_lf_delta_; // delta filter level for i4x4 relative to i16x16 -} VP8FilterHeader; - -//------------------------------------------------------------------------------ -// Informations about the macroblocks. - -typedef struct { - // block type - unsigned int type_:2; // 0=i4x4, 1=i16x16 - unsigned int uv_mode_:2; - unsigned int skip_:1; - unsigned int segment_:2; - uint8_t alpha_; // quantization-susceptibility -} VP8MBInfo; - -typedef struct VP8Matrix { - uint16_t q_[16]; // quantizer steps - uint16_t iq_[16]; // reciprocals, fixed point. - uint16_t bias_[16]; // rounding bias - uint16_t zthresh_[16]; // value under which a coefficient is zeroed - uint16_t sharpen_[16]; // frequency boosters for slight sharpening -} VP8Matrix; - -typedef struct { - VP8Matrix y1_, y2_, uv_; // quantization matrices - int alpha_; // quant-susceptibility, range [-127,127]. Zero is neutral. - // Lower values indicate a lower risk of blurriness. - int beta_; // filter-susceptibility, range [0,255]. - int quant_; // final segment quantizer. - int fstrength_; // final in-loop filtering strength - // reactivities - int lambda_i16_, lambda_i4_, lambda_uv_; - int lambda_mode_, lambda_trellis_, tlambda_; - int lambda_trellis_i16_, lambda_trellis_i4_, lambda_trellis_uv_; -} VP8SegmentInfo; - -// Handy transcient struct to accumulate score and info during RD-optimization -// and mode evaluation. -typedef struct { - score_t D, SD, R, score; // Distortion, spectral distortion, rate, score. - int16_t y_dc_levels[16]; // Quantized levels for luma-DC, luma-AC, chroma. - int16_t y_ac_levels[16][16]; - int16_t uv_levels[4 + 4][16]; - int mode_i16; // mode number for intra16 prediction - uint8_t modes_i4[16]; // mode numbers for intra4 predictions - int mode_uv; // mode number of chroma prediction - uint32_t nz; // non-zero blocks -} VP8ModeScore; - -// Iterator structure to iterate through macroblocks, pointing to the -// right neighbouring data (samples, predictions, contexts, ...) -typedef struct { - int x_, y_; // current macroblock - int y_offset_, uv_offset_; // offset to the luma / chroma planes - int y_stride_, uv_stride_; // respective strides - uint8_t* yuv_in_; // borrowed from enc_ (for now) - uint8_t* yuv_out_; // '' - uint8_t* yuv_out2_; // '' - uint8_t* yuv_p_; // '' - VP8Encoder* enc_; // back-pointer - VP8MBInfo* mb_; // current macroblock - VP8BitWriter* bw_; // current bit-writer - uint8_t* preds_; // intra mode predictors (4x4 blocks) - uint32_t* nz_; // non-zero pattern - uint8_t i4_boundary_[37]; // 32+5 boundary samples needed by intra4x4 - uint8_t* i4_top_; // pointer to the current top boundary sample - int i4_; // current intra4x4 mode being tested - int top_nz_[9]; // top-non-zero context. - int left_nz_[9]; // left-non-zero. left_nz[8] is independent. - uint64_t bit_count_[4][3]; // bit counters for coded levels. - uint64_t luma_bits_; // macroblock bit-cost for luma - uint64_t uv_bits_; // macroblock bit-cost for chroma - LFStats* lf_stats_; // filter stats (borrowed from enc_) - int do_trellis_; // if true, perform extra level optimisation - int done_; // true when scan is finished - int percent0_; // saved initial progress percent -} VP8EncIterator; - - // in iterator.c -// must be called first. -void VP8IteratorInit(VP8Encoder* const enc, VP8EncIterator* const it); -// restart a scan. -void VP8IteratorReset(VP8EncIterator* const it); -// import samples from source -void VP8IteratorImport(const VP8EncIterator* const it); -// export decimated samples -void VP8IteratorExport(const VP8EncIterator* const it); -// go to next macroblock. Returns !done_. If *block_to_save is non-null, will -// save the boundary values to top_/left_ arrays. block_to_save can be -// it->yuv_out_ or it->yuv_in_. -int VP8IteratorNext(VP8EncIterator* const it, - const uint8_t* const block_to_save); -// Report progression based on macroblock rows. Return 0 for user-abort request. -int VP8IteratorProgress(const VP8EncIterator* const it, - int final_delta_percent); -// Intra4x4 iterations -void VP8IteratorStartI4(VP8EncIterator* const it); -// returns true if not done. -int VP8IteratorRotateI4(VP8EncIterator* const it, - const uint8_t* const yuv_out); - -// Non-zero context setup/teardown -void VP8IteratorNzToBytes(VP8EncIterator* const it); -void VP8IteratorBytesToNz(VP8EncIterator* const it); - -// Helper functions to set mode properties -void VP8SetIntra16Mode(const VP8EncIterator* const it, int mode); -void VP8SetIntra4Mode(const VP8EncIterator* const it, const uint8_t* modes); -void VP8SetIntraUVMode(const VP8EncIterator* const it, int mode); -void VP8SetSkip(const VP8EncIterator* const it, int skip); -void VP8SetSegment(const VP8EncIterator* const it, int segment); - -//------------------------------------------------------------------------------ -// Paginated token buffer - -// WIP: #define USE_TOKEN_BUFFER - -#ifdef USE_TOKEN_BUFFER - -#define MAX_NUM_TOKEN 2048 - -typedef struct VP8Tokens VP8Tokens; -struct VP8Tokens { - uint16_t tokens_[MAX_NUM_TOKEN]; // bit#15: bit, bits 0..14: slot - int left_; - VP8Tokens* next_; -}; - -typedef struct { - VP8Tokens* rows_; - uint16_t* tokens_; // set to (*last_)->tokens_ - VP8Tokens** last_; - int left_; - int error_; // true in case of malloc error -} VP8TBuffer; - -void VP8TBufferInit(VP8TBuffer* const b); // initialize an empty buffer -int VP8TBufferNewPage(VP8TBuffer* const b); // allocate a new page -void VP8TBufferClear(VP8TBuffer* const b); // de-allocate memory - -int VP8EmitTokens(const VP8TBuffer* const b, VP8BitWriter* const bw, - const uint8_t* const probas); - -static WEBP_INLINE int VP8AddToken(VP8TBuffer* const b, - int bit, int proba_idx) { - if (b->left_ > 0 || VP8TBufferNewPage(b)) { - const int slot = --b->left_; - b->tokens_[slot] = (bit << 15) | proba_idx; - } - return bit; -} - -#endif // USE_TOKEN_BUFFER - -//------------------------------------------------------------------------------ -// VP8Encoder - -struct VP8Encoder { - const WebPConfig* config_; // user configuration and parameters - WebPPicture* pic_; // input / output picture - - // headers - VP8FilterHeader filter_hdr_; // filtering information - VP8SegmentHeader segment_hdr_; // segment information - - int profile_; // VP8's profile, deduced from Config. - - // dimension, in macroblock units. - int mb_w_, mb_h_; - int preds_w_; // stride of the *preds_ prediction plane (=4*mb_w + 1) - - // number of partitions (1, 2, 4 or 8 = MAX_NUM_PARTITIONS) - int num_parts_; - - // per-partition boolean decoders. - VP8BitWriter bw_; // part0 - VP8BitWriter parts_[MAX_NUM_PARTITIONS]; // token partitions - - int percent_; // for progress - - // transparency blob - int has_alpha_; - uint8_t* alpha_data_; // non-NULL if transparency is present - uint32_t alpha_data_size_; - - // enhancement layer - int use_layer_; - VP8BitWriter layer_bw_; - uint8_t* layer_data_; - size_t layer_data_size_; - - // quantization info (one set of DC/AC dequant factor per segment) - VP8SegmentInfo dqm_[NUM_MB_SEGMENTS]; - int base_quant_; // nominal quantizer value. Only used - // for relative coding of segments' quant. - int uv_alpha_; // U/V quantization susceptibility - // global offset of quantizers, shared by all segments - int dq_y1_dc_; - int dq_y2_dc_, dq_y2_ac_; - int dq_uv_dc_, dq_uv_ac_; - - // probabilities and statistics - VP8Proba proba_; - uint64_t sse_[4]; // sum of Y/U/V/A squared errors for all macroblocks - uint64_t sse_count_; // pixel count for the sse_[] stats - int coded_size_; - int residual_bytes_[3][4]; - int block_count_[3]; - - // quality/speed settings - int method_; // 0=fastest, 6=best/slowest. - int rd_opt_level_; // Deduced from method_. - int max_i4_header_bits_; // partition #0 safeness factor - - // Memory - VP8MBInfo* mb_info_; // contextual macroblock infos (mb_w_ + 1) - uint8_t* preds_; // predictions modes: (4*mb_w+1) * (4*mb_h+1) - uint32_t* nz_; // non-zero bit context: mb_w+1 - uint8_t* yuv_in_; // input samples - uint8_t* yuv_out_; // output samples - uint8_t* yuv_out2_; // secondary scratch out-buffer. swapped with yuv_out_. - uint8_t* yuv_p_; // scratch buffer for prediction - uint8_t *y_top_; // top luma samples. - uint8_t *uv_top_; // top u/v samples. - // U and V are packed into 16 pixels (8 U + 8 V) - uint8_t *y_left_; // left luma samples (adressable from index -1 to 15). - uint8_t *u_left_; // left u samples (adressable from index -1 to 7) - uint8_t *v_left_; // left v samples (adressable from index -1 to 7) - - LFStats *lf_stats_; // autofilter stats (if NULL, autofilter is off) -}; - -//------------------------------------------------------------------------------ -// internal functions. Not public. - - // in tree.c -extern const uint8_t VP8CoeffsProba0[NUM_TYPES][NUM_BANDS][NUM_CTX][NUM_PROBAS]; -extern const uint8_t - VP8CoeffsUpdateProba[NUM_TYPES][NUM_BANDS][NUM_CTX][NUM_PROBAS]; -// Reset the token probabilities to their initial (default) values -void VP8DefaultProbas(VP8Encoder* const enc); -// Write the token probabilities -void VP8WriteProbas(VP8BitWriter* const bw, const VP8Proba* const probas); -// Writes the partition #0 modes (that is: all intra modes) -void VP8CodeIntraModes(VP8Encoder* const enc); - - // in syntax.c -// Generates the final bitstream by coding the partition0 and headers, -// and appending an assembly of all the pre-coded token partitions. -// Return true if everything is ok. -int VP8EncWrite(VP8Encoder* const enc); -// Release memory allocated for bit-writing in VP8EncLoop & seq. -void VP8EncFreeBitWriters(VP8Encoder* const enc); - - // in frame.c -extern const uint8_t VP8EncBands[16 + 1]; -// Form all the four Intra16x16 predictions in the yuv_p_ cache -void VP8MakeLuma16Preds(const VP8EncIterator* const it); -// Form all the four Chroma8x8 predictions in the yuv_p_ cache -void VP8MakeChroma8Preds(const VP8EncIterator* const it); -// Form all the ten Intra4x4 predictions in the yuv_p_ cache -// for the 4x4 block it->i4_ -void VP8MakeIntra4Preds(const VP8EncIterator* const it); -// Rate calculation -int VP8GetCostLuma16(VP8EncIterator* const it, const VP8ModeScore* const rd); -int VP8GetCostLuma4(VP8EncIterator* const it, const int16_t levels[16]); -int VP8GetCostUV(VP8EncIterator* const it, const VP8ModeScore* const rd); -// Main stat / coding passes -int VP8EncLoop(VP8Encoder* const enc); -int VP8StatLoop(VP8Encoder* const enc); - - // in webpenc.c -// Assign an error code to a picture. Return false for convenience. -int WebPEncodingSetError(const WebPPicture* const pic, WebPEncodingError error); -int WebPReportProgress(const WebPPicture* const pic, - int percent, int* const percent_store); - - // in analysis.c -// Main analysis loop. Decides the segmentations and complexity. -// Assigns a first guess for Intra16 and uvmode_ prediction modes. -int VP8EncAnalyze(VP8Encoder* const enc); - - // in quant.c -// Sets up segment's quantization values, base_quant_ and filter strengths. -void VP8SetSegmentParams(VP8Encoder* const enc, float quality); -// Pick best modes and fills the levels. Returns true if skipped. -int VP8Decimate(VP8EncIterator* const it, VP8ModeScore* const rd, int rd_opt); - - // in alpha.c -void VP8EncInitAlpha(VP8Encoder* const enc); // initialize alpha compression -int VP8EncFinishAlpha(VP8Encoder* const enc); // finalize compressed data -void VP8EncDeleteAlpha(VP8Encoder* const enc); // delete compressed data - - // in layer.c -void VP8EncInitLayer(VP8Encoder* const enc); // init everything -void VP8EncCodeLayerBlock(VP8EncIterator* it); // code one more macroblock -int VP8EncFinishLayer(VP8Encoder* const enc); // finalize coding -void VP8EncDeleteLayer(VP8Encoder* enc); // reclaim memory - - // in filter.c - -// SSIM utils -typedef struct { - double w, xm, ym, xxm, xym, yym; -} DistoStats; -void VP8SSIMAddStats(const DistoStats* const src, DistoStats* const dst); -void VP8SSIMAccumulatePlane(const uint8_t* src1, int stride1, - const uint8_t* src2, int stride2, - int W, int H, DistoStats* const stats); -double VP8SSIMGet(const DistoStats* const stats); -double VP8SSIMGetSquaredError(const DistoStats* const stats); - -// autofilter -void VP8InitFilter(VP8EncIterator* const it); -void VP8StoreFilterStats(VP8EncIterator* const it); -void VP8AdjustFilterStrength(VP8EncIterator* const it); - -//------------------------------------------------------------------------------ - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif - -#endif /* WEBP_ENC_VP8ENCI_H_ */ diff --git a/external/libwebp/enc/vp8l.c b/external/libwebp/enc/vp8l.c deleted file mode 100644 index 2abc30f464..0000000000 --- a/external/libwebp/enc/vp8l.c +++ /dev/null @@ -1,1155 +0,0 @@ -// Copyright 2012 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// main entry for the lossless encoder. -// -// Author: Vikas Arora (vikaas.arora@gmail.com) -// - -#include <assert.h> -#include <stdio.h> -#include <stdlib.h> - -#include "./backward_references.h" -#include "./vp8enci.h" -#include "./vp8li.h" -#include "../dsp/lossless.h" -#include "../utils/bit_writer.h" -#include "../utils/huffman_encode.h" -#include "../utils/utils.h" -#include "../webp/format_constants.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -#define PALETTE_KEY_RIGHT_SHIFT 22 // Key for 1K buffer. -#define MAX_HUFF_IMAGE_SIZE (16 * 1024 * 1024) -#define MAX_COLORS_FOR_GRAPH 64 - -// ----------------------------------------------------------------------------- -// Palette - -static int CompareColors(const void* p1, const void* p2) { - const uint32_t a = *(const uint32_t*)p1; - const uint32_t b = *(const uint32_t*)p2; - return (a < b) ? -1 : (a > b) ? 1 : 0; -} - -// If number of colors in the image is less than or equal to MAX_PALETTE_SIZE, -// creates a palette and returns true, else returns false. -static int AnalyzeAndCreatePalette(const WebPPicture* const pic, - uint32_t palette[MAX_PALETTE_SIZE], - int* const palette_size) { - int i, x, y, key; - int num_colors = 0; - uint8_t in_use[MAX_PALETTE_SIZE * 4] = { 0 }; - uint32_t colors[MAX_PALETTE_SIZE * 4]; - static const uint32_t kHashMul = 0x1e35a7bd; - const uint32_t* argb = pic->argb; - const int width = pic->width; - const int height = pic->height; - uint32_t last_pix = ~argb[0]; // so we're sure that last_pix != argb[0] - - for (y = 0; y < height; ++y) { - for (x = 0; x < width; ++x) { - if (argb[x] == last_pix) { - continue; - } - last_pix = argb[x]; - key = (kHashMul * last_pix) >> PALETTE_KEY_RIGHT_SHIFT; - while (1) { - if (!in_use[key]) { - colors[key] = last_pix; - in_use[key] = 1; - ++num_colors; - if (num_colors > MAX_PALETTE_SIZE) { - return 0; - } - break; - } else if (colors[key] == last_pix) { - // The color is already there. - break; - } else { - // Some other color sits there. - // Do linear conflict resolution. - ++key; - key &= (MAX_PALETTE_SIZE * 4 - 1); // key mask for 1K buffer. - } - } - } - argb += pic->argb_stride; - } - - // TODO(skal): could we reuse in_use[] to speed up ApplyPalette()? - num_colors = 0; - for (i = 0; i < (int)(sizeof(in_use) / sizeof(in_use[0])); ++i) { - if (in_use[i]) { - palette[num_colors] = colors[i]; - ++num_colors; - } - } - - qsort(palette, num_colors, sizeof(*palette), CompareColors); - *palette_size = num_colors; - return 1; -} - -static int AnalyzeEntropy(const uint32_t* argb, - int width, int height, int argb_stride, - double* const nonpredicted_bits, - double* const predicted_bits) { - int x, y; - const uint32_t* last_line = NULL; - uint32_t last_pix = argb[0]; // so we're sure that pix_diff == 0 - - VP8LHistogram* nonpredicted = NULL; - VP8LHistogram* predicted = - (VP8LHistogram*)malloc(2 * sizeof(*predicted)); - if (predicted == NULL) return 0; - nonpredicted = predicted + 1; - - VP8LHistogramInit(predicted, 0); - VP8LHistogramInit(nonpredicted, 0); - for (y = 0; y < height; ++y) { - for (x = 0; x < width; ++x) { - const uint32_t pix = argb[x]; - const uint32_t pix_diff = VP8LSubPixels(pix, last_pix); - if (pix_diff == 0) continue; - if (last_line != NULL && pix == last_line[x]) { - continue; - } - last_pix = pix; - { - const PixOrCopy pix_token = PixOrCopyCreateLiteral(pix); - const PixOrCopy pix_diff_token = PixOrCopyCreateLiteral(pix_diff); - VP8LHistogramAddSinglePixOrCopy(nonpredicted, &pix_token); - VP8LHistogramAddSinglePixOrCopy(predicted, &pix_diff_token); - } - } - last_line = argb; - argb += argb_stride; - } - *nonpredicted_bits = VP8LHistogramEstimateBitsBulk(nonpredicted); - *predicted_bits = VP8LHistogramEstimateBitsBulk(predicted); - free(predicted); - return 1; -} - -static int VP8LEncAnalyze(VP8LEncoder* const enc, WebPImageHint image_hint) { - const WebPPicture* const pic = enc->pic_; - assert(pic != NULL && pic->argb != NULL); - - enc->use_palette_ = - AnalyzeAndCreatePalette(pic, enc->palette_, &enc->palette_size_); - - if (image_hint == WEBP_HINT_GRAPH) { - if (enc->use_palette_ && enc->palette_size_ < MAX_COLORS_FOR_GRAPH) { - enc->use_palette_ = 0; - } - } - - if (!enc->use_palette_) { - if (image_hint == WEBP_HINT_PHOTO) { - enc->use_predict_ = 1; - enc->use_cross_color_ = 1; - } else { - double non_pred_entropy, pred_entropy; - if (!AnalyzeEntropy(pic->argb, pic->width, pic->height, pic->argb_stride, - &non_pred_entropy, &pred_entropy)) { - return 0; - } - if (pred_entropy < 0.95 * non_pred_entropy) { - enc->use_predict_ = 1; - // TODO(vikasa): Observed some correlation of cross_color transform with - // predict. Need to investigate this further and add separate heuristic - // for setting use_cross_color flag. - enc->use_cross_color_ = 1; - } - } - } - - return 1; -} - -static int GetHuffBitLengthsAndCodes( - const VP8LHistogramSet* const histogram_image, - HuffmanTreeCode* const huffman_codes) { - int i, k; - int ok = 1; - uint64_t total_length_size = 0; - uint8_t* mem_buf = NULL; - const int histogram_image_size = histogram_image->size; - - // Iterate over all histograms and get the aggregate number of codes used. - for (i = 0; i < histogram_image_size; ++i) { - const VP8LHistogram* const histo = histogram_image->histograms[i]; - HuffmanTreeCode* const codes = &huffman_codes[5 * i]; - for (k = 0; k < 5; ++k) { - const int num_symbols = (k == 0) ? VP8LHistogramNumCodes(histo) - : (k == 4) ? NUM_DISTANCE_CODES - : 256; - codes[k].num_symbols = num_symbols; - total_length_size += num_symbols; - } - } - - // Allocate and Set Huffman codes. - { - uint16_t* codes; - uint8_t* lengths; - mem_buf = (uint8_t*)WebPSafeCalloc(total_length_size, - sizeof(*lengths) + sizeof(*codes)); - if (mem_buf == NULL) { - ok = 0; - goto End; - } - codes = (uint16_t*)mem_buf; - lengths = (uint8_t*)&codes[total_length_size]; - for (i = 0; i < 5 * histogram_image_size; ++i) { - const int bit_length = huffman_codes[i].num_symbols; - huffman_codes[i].codes = codes; - huffman_codes[i].code_lengths = lengths; - codes += bit_length; - lengths += bit_length; - } - } - - // Create Huffman trees. - for (i = 0; i < histogram_image_size; ++i) { - HuffmanTreeCode* const codes = &huffman_codes[5 * i]; - VP8LHistogram* const histo = histogram_image->histograms[i]; - ok = ok && VP8LCreateHuffmanTree(histo->literal_, 15, codes + 0); - ok = ok && VP8LCreateHuffmanTree(histo->red_, 15, codes + 1); - ok = ok && VP8LCreateHuffmanTree(histo->blue_, 15, codes + 2); - ok = ok && VP8LCreateHuffmanTree(histo->alpha_, 15, codes + 3); - ok = ok && VP8LCreateHuffmanTree(histo->distance_, 15, codes + 4); - } - - End: - if (!ok) free(mem_buf); - return ok; -} - -static void StoreHuffmanTreeOfHuffmanTreeToBitMask( - VP8LBitWriter* const bw, const uint8_t* code_length_bitdepth) { - // RFC 1951 will calm you down if you are worried about this funny sequence. - // This sequence is tuned from that, but more weighted for lower symbol count, - // and more spiking histograms. - static const uint8_t kStorageOrder[CODE_LENGTH_CODES] = { - 17, 18, 0, 1, 2, 3, 4, 5, 16, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 - }; - int i; - // Throw away trailing zeros: - int codes_to_store = CODE_LENGTH_CODES; - for (; codes_to_store > 4; --codes_to_store) { - if (code_length_bitdepth[kStorageOrder[codes_to_store - 1]] != 0) { - break; - } - } - VP8LWriteBits(bw, 4, codes_to_store - 4); - for (i = 0; i < codes_to_store; ++i) { - VP8LWriteBits(bw, 3, code_length_bitdepth[kStorageOrder[i]]); - } -} - -static void ClearHuffmanTreeIfOnlyOneSymbol( - HuffmanTreeCode* const huffman_code) { - int k; - int count = 0; - for (k = 0; k < huffman_code->num_symbols; ++k) { - if (huffman_code->code_lengths[k] != 0) { - ++count; - if (count > 1) return; - } - } - for (k = 0; k < huffman_code->num_symbols; ++k) { - huffman_code->code_lengths[k] = 0; - huffman_code->codes[k] = 0; - } -} - -static void StoreHuffmanTreeToBitMask( - VP8LBitWriter* const bw, - const HuffmanTreeToken* const tokens, const int num_tokens, - const HuffmanTreeCode* const huffman_code) { - int i; - for (i = 0; i < num_tokens; ++i) { - const int ix = tokens[i].code; - const int extra_bits = tokens[i].extra_bits; - VP8LWriteBits(bw, huffman_code->code_lengths[ix], huffman_code->codes[ix]); - switch (ix) { - case 16: - VP8LWriteBits(bw, 2, extra_bits); - break; - case 17: - VP8LWriteBits(bw, 3, extra_bits); - break; - case 18: - VP8LWriteBits(bw, 7, extra_bits); - break; - } - } -} - -static int StoreFullHuffmanCode(VP8LBitWriter* const bw, - const HuffmanTreeCode* const tree) { - int ok = 0; - uint8_t code_length_bitdepth[CODE_LENGTH_CODES] = { 0 }; - uint16_t code_length_bitdepth_symbols[CODE_LENGTH_CODES] = { 0 }; - const int max_tokens = tree->num_symbols; - int num_tokens; - HuffmanTreeCode huffman_code; - HuffmanTreeToken* const tokens = - (HuffmanTreeToken*)WebPSafeMalloc((uint64_t)max_tokens, sizeof(*tokens)); - if (tokens == NULL) return 0; - - huffman_code.num_symbols = CODE_LENGTH_CODES; - huffman_code.code_lengths = code_length_bitdepth; - huffman_code.codes = code_length_bitdepth_symbols; - - VP8LWriteBits(bw, 1, 0); - num_tokens = VP8LCreateCompressedHuffmanTree(tree, tokens, max_tokens); - { - int histogram[CODE_LENGTH_CODES] = { 0 }; - int i; - for (i = 0; i < num_tokens; ++i) { - ++histogram[tokens[i].code]; - } - - if (!VP8LCreateHuffmanTree(histogram, 7, &huffman_code)) { - goto End; - } - } - - StoreHuffmanTreeOfHuffmanTreeToBitMask(bw, code_length_bitdepth); - ClearHuffmanTreeIfOnlyOneSymbol(&huffman_code); - { - int trailing_zero_bits = 0; - int trimmed_length = num_tokens; - int write_trimmed_length; - int length; - int i = num_tokens; - while (i-- > 0) { - const int ix = tokens[i].code; - if (ix == 0 || ix == 17 || ix == 18) { - --trimmed_length; // discount trailing zeros - trailing_zero_bits += code_length_bitdepth[ix]; - if (ix == 17) { - trailing_zero_bits += 3; - } else if (ix == 18) { - trailing_zero_bits += 7; - } - } else { - break; - } - } - write_trimmed_length = (trimmed_length > 1 && trailing_zero_bits > 12); - length = write_trimmed_length ? trimmed_length : num_tokens; - VP8LWriteBits(bw, 1, write_trimmed_length); - if (write_trimmed_length) { - const int nbits = VP8LBitsLog2Ceiling(trimmed_length - 1); - const int nbitpairs = (nbits == 0) ? 1 : (nbits + 1) / 2; - VP8LWriteBits(bw, 3, nbitpairs - 1); - assert(trimmed_length >= 2); - VP8LWriteBits(bw, nbitpairs * 2, trimmed_length - 2); - } - StoreHuffmanTreeToBitMask(bw, tokens, length, &huffman_code); - } - ok = 1; - End: - free(tokens); - return ok; -} - -static int StoreHuffmanCode(VP8LBitWriter* const bw, - const HuffmanTreeCode* const huffman_code) { - int i; - int count = 0; - int symbols[2] = { 0, 0 }; - const int kMaxBits = 8; - const int kMaxSymbol = 1 << kMaxBits; - - // Check whether it's a small tree. - for (i = 0; i < huffman_code->num_symbols && count < 3; ++i) { - if (huffman_code->code_lengths[i] != 0) { - if (count < 2) symbols[count] = i; - ++count; - } - } - - if (count == 0) { // emit minimal tree for empty cases - // bits: small tree marker: 1, count-1: 0, large 8-bit code: 0, code: 0 - VP8LWriteBits(bw, 4, 0x01); - return 1; - } else if (count <= 2 && symbols[0] < kMaxSymbol && symbols[1] < kMaxSymbol) { - VP8LWriteBits(bw, 1, 1); // Small tree marker to encode 1 or 2 symbols. - VP8LWriteBits(bw, 1, count - 1); - if (symbols[0] <= 1) { - VP8LWriteBits(bw, 1, 0); // Code bit for small (1 bit) symbol value. - VP8LWriteBits(bw, 1, symbols[0]); - } else { - VP8LWriteBits(bw, 1, 1); - VP8LWriteBits(bw, 8, symbols[0]); - } - if (count == 2) { - VP8LWriteBits(bw, 8, symbols[1]); - } - return 1; - } else { - return StoreFullHuffmanCode(bw, huffman_code); - } -} - -static void WriteHuffmanCode(VP8LBitWriter* const bw, - const HuffmanTreeCode* const code, int index) { - const int depth = code->code_lengths[index]; - const int symbol = code->codes[index]; - VP8LWriteBits(bw, depth, symbol); -} - -static void StoreImageToBitMask( - VP8LBitWriter* const bw, int width, int histo_bits, - const VP8LBackwardRefs* const refs, - const uint16_t* histogram_symbols, - const HuffmanTreeCode* const huffman_codes) { - // x and y trace the position in the image. - int x = 0; - int y = 0; - const int histo_xsize = histo_bits ? VP8LSubSampleSize(width, histo_bits) : 1; - int i; - for (i = 0; i < refs->size; ++i) { - const PixOrCopy* const v = &refs->refs[i]; - const int histogram_ix = histogram_symbols[histo_bits ? - (y >> histo_bits) * histo_xsize + - (x >> histo_bits) : 0]; - const HuffmanTreeCode* const codes = huffman_codes + 5 * histogram_ix; - if (PixOrCopyIsCacheIdx(v)) { - const int code = PixOrCopyCacheIdx(v); - const int literal_ix = 256 + NUM_LENGTH_CODES + code; - WriteHuffmanCode(bw, codes, literal_ix); - } else if (PixOrCopyIsLiteral(v)) { - static const int order[] = { 1, 2, 0, 3 }; - int k; - for (k = 0; k < 4; ++k) { - const int code = PixOrCopyLiteral(v, order[k]); - WriteHuffmanCode(bw, codes + k, code); - } - } else { - int bits, n_bits; - int code, distance; - - PrefixEncode(v->len, &code, &n_bits, &bits); - WriteHuffmanCode(bw, codes, 256 + code); - VP8LWriteBits(bw, n_bits, bits); - - distance = PixOrCopyDistance(v); - PrefixEncode(distance, &code, &n_bits, &bits); - WriteHuffmanCode(bw, codes + 4, code); - VP8LWriteBits(bw, n_bits, bits); - } - x += PixOrCopyLength(v); - while (x >= width) { - x -= width; - ++y; - } - } -} - -// Special case of EncodeImageInternal() for cache-bits=0, histo_bits=31 -static int EncodeImageNoHuffman(VP8LBitWriter* const bw, - const uint32_t* const argb, - int width, int height, int quality) { - int i; - int ok = 0; - VP8LBackwardRefs refs; - HuffmanTreeCode huffman_codes[5] = { { 0, NULL, NULL } }; - const uint16_t histogram_symbols[1] = { 0 }; // only one tree, one symbol - VP8LHistogramSet* const histogram_image = VP8LAllocateHistogramSet(1, 0); - if (histogram_image == NULL) return 0; - - // Calculate backward references from ARGB image. - if (!VP8LGetBackwardReferences(width, height, argb, quality, 0, 1, &refs)) { - goto Error; - } - // Build histogram image and symbols from backward references. - VP8LHistogramStoreRefs(&refs, histogram_image->histograms[0]); - - // Create Huffman bit lengths and codes for each histogram image. - assert(histogram_image->size == 1); - if (!GetHuffBitLengthsAndCodes(histogram_image, huffman_codes)) { - goto Error; - } - - // No color cache, no Huffman image. - VP8LWriteBits(bw, 1, 0); - - // Store Huffman codes. - for (i = 0; i < 5; ++i) { - HuffmanTreeCode* const codes = &huffman_codes[i]; - if (!StoreHuffmanCode(bw, codes)) { - goto Error; - } - ClearHuffmanTreeIfOnlyOneSymbol(codes); - } - - // Store actual literals. - StoreImageToBitMask(bw, width, 0, &refs, histogram_symbols, huffman_codes); - ok = 1; - - Error: - free(histogram_image); - VP8LClearBackwardRefs(&refs); - free(huffman_codes[0].codes); - return ok; -} - -static int EncodeImageInternal(VP8LBitWriter* const bw, - const uint32_t* const argb, - int width, int height, int quality, - int cache_bits, int histogram_bits) { - int ok = 0; - const int use_2d_locality = 1; - const int use_color_cache = (cache_bits > 0); - const uint32_t histogram_image_xysize = - VP8LSubSampleSize(width, histogram_bits) * - VP8LSubSampleSize(height, histogram_bits); - VP8LHistogramSet* histogram_image = - VP8LAllocateHistogramSet(histogram_image_xysize, 0); - int histogram_image_size = 0; - size_t bit_array_size = 0; - HuffmanTreeCode* huffman_codes = NULL; - VP8LBackwardRefs refs; - uint16_t* const histogram_symbols = - (uint16_t*)WebPSafeMalloc((uint64_t)histogram_image_xysize, - sizeof(*histogram_symbols)); - assert(histogram_bits >= MIN_HUFFMAN_BITS); - assert(histogram_bits <= MAX_HUFFMAN_BITS); - - if (histogram_image == NULL || histogram_symbols == NULL) { - free(histogram_image); - free(histogram_symbols); - return 0; - } - - // Calculate backward references from ARGB image. - if (!VP8LGetBackwardReferences(width, height, argb, quality, cache_bits, - use_2d_locality, &refs)) { - goto Error; - } - // Build histogram image and symbols from backward references. - if (!VP8LGetHistoImageSymbols(width, height, &refs, - quality, histogram_bits, cache_bits, - histogram_image, - histogram_symbols)) { - goto Error; - } - // Create Huffman bit lengths and codes for each histogram image. - histogram_image_size = histogram_image->size; - bit_array_size = 5 * histogram_image_size; - huffman_codes = (HuffmanTreeCode*)WebPSafeCalloc(bit_array_size, - sizeof(*huffman_codes)); - if (huffman_codes == NULL || - !GetHuffBitLengthsAndCodes(histogram_image, huffman_codes)) { - goto Error; - } - - // Color Cache parameters. - VP8LWriteBits(bw, 1, use_color_cache); - if (use_color_cache) { - VP8LWriteBits(bw, 4, cache_bits); - } - - // Huffman image + meta huffman. - { - const int write_histogram_image = (histogram_image_size > 1); - VP8LWriteBits(bw, 1, write_histogram_image); - if (write_histogram_image) { - uint32_t* const histogram_argb = - (uint32_t*)WebPSafeMalloc((uint64_t)histogram_image_xysize, - sizeof(*histogram_argb)); - int max_index = 0; - uint32_t i; - if (histogram_argb == NULL) goto Error; - for (i = 0; i < histogram_image_xysize; ++i) { - const int index = histogram_symbols[i] & 0xffff; - histogram_argb[i] = 0xff000000 | (index << 8); - if (index >= max_index) { - max_index = index + 1; - } - } - histogram_image_size = max_index; - - VP8LWriteBits(bw, 3, histogram_bits - 2); - ok = EncodeImageNoHuffman(bw, histogram_argb, - VP8LSubSampleSize(width, histogram_bits), - VP8LSubSampleSize(height, histogram_bits), - quality); - free(histogram_argb); - if (!ok) goto Error; - } - } - - // Store Huffman codes. - { - int i; - for (i = 0; i < 5 * histogram_image_size; ++i) { - HuffmanTreeCode* const codes = &huffman_codes[i]; - if (!StoreHuffmanCode(bw, codes)) goto Error; - ClearHuffmanTreeIfOnlyOneSymbol(codes); - } - } - // Free combined histograms. - free(histogram_image); - histogram_image = NULL; - - // Store actual literals. - StoreImageToBitMask(bw, width, histogram_bits, &refs, - histogram_symbols, huffman_codes); - ok = 1; - - Error: - if (!ok) free(histogram_image); - - VP8LClearBackwardRefs(&refs); - if (huffman_codes != NULL) { - free(huffman_codes->codes); - free(huffman_codes); - } - free(histogram_symbols); - return ok; -} - -// ----------------------------------------------------------------------------- -// Transforms - -// Check if it would be a good idea to subtract green from red and blue. We -// only impact entropy in red/blue components, don't bother to look at others. -static int EvalAndApplySubtractGreen(VP8LEncoder* const enc, - int width, int height, - VP8LBitWriter* const bw) { - if (!enc->use_palette_) { - int i; - const uint32_t* const argb = enc->argb_; - double bit_cost_before, bit_cost_after; - VP8LHistogram* const histo = (VP8LHistogram*)malloc(sizeof(*histo)); - if (histo == NULL) return 0; - - VP8LHistogramInit(histo, 1); - for (i = 0; i < width * height; ++i) { - const uint32_t c = argb[i]; - ++histo->red_[(c >> 16) & 0xff]; - ++histo->blue_[(c >> 0) & 0xff]; - } - bit_cost_before = VP8LHistogramEstimateBits(histo); - - VP8LHistogramInit(histo, 1); - for (i = 0; i < width * height; ++i) { - const uint32_t c = argb[i]; - const int green = (c >> 8) & 0xff; - ++histo->red_[((c >> 16) - green) & 0xff]; - ++histo->blue_[((c >> 0) - green) & 0xff]; - } - bit_cost_after = VP8LHistogramEstimateBits(histo); - free(histo); - - // Check if subtracting green yields low entropy. - enc->use_subtract_green_ = (bit_cost_after < bit_cost_before); - if (enc->use_subtract_green_) { - VP8LWriteBits(bw, 1, TRANSFORM_PRESENT); - VP8LWriteBits(bw, 2, SUBTRACT_GREEN); - VP8LSubtractGreenFromBlueAndRed(enc->argb_, width * height); - } - } - return 1; -} - -static int ApplyPredictFilter(const VP8LEncoder* const enc, - int width, int height, int quality, - VP8LBitWriter* const bw) { - const int pred_bits = enc->transform_bits_; - const int transform_width = VP8LSubSampleSize(width, pred_bits); - const int transform_height = VP8LSubSampleSize(height, pred_bits); - - VP8LResidualImage(width, height, pred_bits, enc->argb_, enc->argb_scratch_, - enc->transform_data_); - VP8LWriteBits(bw, 1, TRANSFORM_PRESENT); - VP8LWriteBits(bw, 2, PREDICTOR_TRANSFORM); - assert(pred_bits >= 2); - VP8LWriteBits(bw, 3, pred_bits - 2); - if (!EncodeImageNoHuffman(bw, enc->transform_data_, - transform_width, transform_height, quality)) { - return 0; - } - return 1; -} - -static int ApplyCrossColorFilter(const VP8LEncoder* const enc, - int width, int height, int quality, - VP8LBitWriter* const bw) { - const int ccolor_transform_bits = enc->transform_bits_; - const int transform_width = VP8LSubSampleSize(width, ccolor_transform_bits); - const int transform_height = VP8LSubSampleSize(height, ccolor_transform_bits); - const int step = (quality == 0) ? 32 : 8; - - VP8LColorSpaceTransform(width, height, ccolor_transform_bits, step, - enc->argb_, enc->transform_data_); - VP8LWriteBits(bw, 1, TRANSFORM_PRESENT); - VP8LWriteBits(bw, 2, CROSS_COLOR_TRANSFORM); - assert(ccolor_transform_bits >= 2); - VP8LWriteBits(bw, 3, ccolor_transform_bits - 2); - if (!EncodeImageNoHuffman(bw, enc->transform_data_, - transform_width, transform_height, quality)) { - return 0; - } - return 1; -} - -// ----------------------------------------------------------------------------- - -static void PutLE32(uint8_t* const data, uint32_t val) { - data[0] = (val >> 0) & 0xff; - data[1] = (val >> 8) & 0xff; - data[2] = (val >> 16) & 0xff; - data[3] = (val >> 24) & 0xff; -} - -static WebPEncodingError WriteRiffHeader(const WebPPicture* const pic, - size_t riff_size, size_t vp8l_size) { - uint8_t riff[RIFF_HEADER_SIZE + CHUNK_HEADER_SIZE + VP8L_SIGNATURE_SIZE] = { - 'R', 'I', 'F', 'F', 0, 0, 0, 0, 'W', 'E', 'B', 'P', - 'V', 'P', '8', 'L', 0, 0, 0, 0, VP8L_MAGIC_BYTE, - }; - PutLE32(riff + TAG_SIZE, (uint32_t)riff_size); - PutLE32(riff + RIFF_HEADER_SIZE + TAG_SIZE, (uint32_t)vp8l_size); - if (!pic->writer(riff, sizeof(riff), pic)) { - return VP8_ENC_ERROR_BAD_WRITE; - } - return VP8_ENC_OK; -} - -static int WriteImageSize(const WebPPicture* const pic, - VP8LBitWriter* const bw) { - const int width = pic->width - 1; - const int height = pic->height - 1; - assert(width < WEBP_MAX_DIMENSION && height < WEBP_MAX_DIMENSION); - - VP8LWriteBits(bw, VP8L_IMAGE_SIZE_BITS, width); - VP8LWriteBits(bw, VP8L_IMAGE_SIZE_BITS, height); - return !bw->error_; -} - -static int WriteRealAlphaAndVersion(VP8LBitWriter* const bw, int has_alpha) { - VP8LWriteBits(bw, 1, has_alpha); - VP8LWriteBits(bw, VP8L_VERSION_BITS, VP8L_VERSION); - return !bw->error_; -} - -static WebPEncodingError WriteImage(const WebPPicture* const pic, - VP8LBitWriter* const bw, - size_t* const coded_size) { - WebPEncodingError err = VP8_ENC_OK; - const uint8_t* const webpll_data = VP8LBitWriterFinish(bw); - const size_t webpll_size = VP8LBitWriterNumBytes(bw); - const size_t vp8l_size = VP8L_SIGNATURE_SIZE + webpll_size; - const size_t pad = vp8l_size & 1; - const size_t riff_size = TAG_SIZE + CHUNK_HEADER_SIZE + vp8l_size + pad; - - err = WriteRiffHeader(pic, riff_size, vp8l_size); - if (err != VP8_ENC_OK) goto Error; - - if (!pic->writer(webpll_data, webpll_size, pic)) { - err = VP8_ENC_ERROR_BAD_WRITE; - goto Error; - } - - if (pad) { - const uint8_t pad_byte[1] = { 0 }; - if (!pic->writer(pad_byte, 1, pic)) { - err = VP8_ENC_ERROR_BAD_WRITE; - goto Error; - } - } - *coded_size = CHUNK_HEADER_SIZE + riff_size; - return VP8_ENC_OK; - - Error: - return err; -} - -// ----------------------------------------------------------------------------- - -// Allocates the memory for argb (W x H) buffer, 2 rows of context for -// prediction and transform data. -static WebPEncodingError AllocateTransformBuffer(VP8LEncoder* const enc, - int width, int height) { - WebPEncodingError err = VP8_ENC_OK; - const int tile_size = 1 << enc->transform_bits_; - const uint64_t image_size = width * height; - const uint64_t argb_scratch_size = tile_size * width + width; - const uint64_t transform_data_size = - (uint64_t)VP8LSubSampleSize(width, enc->transform_bits_) * - (uint64_t)VP8LSubSampleSize(height, enc->transform_bits_); - const uint64_t total_size = - image_size + argb_scratch_size + transform_data_size; - uint32_t* mem = (uint32_t*)WebPSafeMalloc(total_size, sizeof(*mem)); - if (mem == NULL) { - err = VP8_ENC_ERROR_OUT_OF_MEMORY; - goto Error; - } - enc->argb_ = mem; - mem += image_size; - enc->argb_scratch_ = mem; - mem += argb_scratch_size; - enc->transform_data_ = mem; - enc->current_width_ = width; - - Error: - return err; -} - -// Bundles multiple (2, 4 or 8) pixels into a single pixel. -// Returns the new xsize. -static void BundleColorMap(const WebPPicture* const pic, - int xbits, uint32_t* bundled_argb, int xs) { - int y; - const int bit_depth = 1 << (3 - xbits); - uint32_t code = 0; - const uint32_t* argb = pic->argb; - const int width = pic->width; - const int height = pic->height; - - for (y = 0; y < height; ++y) { - int x; - for (x = 0; x < width; ++x) { - const int mask = (1 << xbits) - 1; - const int xsub = x & mask; - if (xsub == 0) { - code = 0; - } - // TODO(vikasa): simplify the bundling logic. - code |= (argb[x] & 0xff00) << (bit_depth * xsub); - bundled_argb[y * xs + (x >> xbits)] = 0xff000000 | code; - } - argb += pic->argb_stride; - } -} - -// Note: Expects "enc->palette_" to be set properly. -// Also, "enc->palette_" will be modified after this call and should not be used -// later. -static WebPEncodingError ApplyPalette(VP8LBitWriter* const bw, - VP8LEncoder* const enc, int quality) { - WebPEncodingError err = VP8_ENC_OK; - int i, x, y; - const WebPPicture* const pic = enc->pic_; - uint32_t* argb = pic->argb; - const int width = pic->width; - const int height = pic->height; - uint32_t* const palette = enc->palette_; - const int palette_size = enc->palette_size_; - - // Replace each input pixel by corresponding palette index. - for (y = 0; y < height; ++y) { - for (x = 0; x < width; ++x) { - const uint32_t pix = argb[x]; - for (i = 0; i < palette_size; ++i) { - if (pix == palette[i]) { - argb[x] = 0xff000000u | (i << 8); - break; - } - } - } - argb += pic->argb_stride; - } - - // Save palette to bitstream. - VP8LWriteBits(bw, 1, TRANSFORM_PRESENT); - VP8LWriteBits(bw, 2, COLOR_INDEXING_TRANSFORM); - assert(palette_size >= 1); - VP8LWriteBits(bw, 8, palette_size - 1); - for (i = palette_size - 1; i >= 1; --i) { - palette[i] = VP8LSubPixels(palette[i], palette[i - 1]); - } - if (!EncodeImageNoHuffman(bw, palette, palette_size, 1, quality)) { - err = VP8_ENC_ERROR_INVALID_CONFIGURATION; - goto Error; - } - - if (palette_size <= 16) { - // Image can be packed (multiple pixels per uint32_t). - int xbits = 1; - if (palette_size <= 2) { - xbits = 3; - } else if (palette_size <= 4) { - xbits = 2; - } - err = AllocateTransformBuffer(enc, VP8LSubSampleSize(width, xbits), height); - if (err != VP8_ENC_OK) goto Error; - BundleColorMap(pic, xbits, enc->argb_, enc->current_width_); - } - - Error: - return err; -} - -// ----------------------------------------------------------------------------- - -static int GetHistoBits(const WebPConfig* const config, - const WebPPicture* const pic) { - const int width = pic->width; - const int height = pic->height; - const uint64_t hist_size = sizeof(VP8LHistogram); - // Make tile size a function of encoding method (Range: 0 to 6). - int histo_bits = 7 - config->method; - while (1) { - const uint64_t huff_image_size = VP8LSubSampleSize(width, histo_bits) * - VP8LSubSampleSize(height, histo_bits) * - hist_size; - if (huff_image_size <= MAX_HUFF_IMAGE_SIZE) break; - ++histo_bits; - } - return (histo_bits < MIN_HUFFMAN_BITS) ? MIN_HUFFMAN_BITS : - (histo_bits > MAX_HUFFMAN_BITS) ? MAX_HUFFMAN_BITS : histo_bits; -} - -static void InitEncParams(VP8LEncoder* const enc) { - const WebPConfig* const config = enc->config_; - const WebPPicture* const picture = enc->pic_; - const int method = config->method; - const float quality = config->quality; - enc->transform_bits_ = (method < 4) ? 5 : (method > 4) ? 3 : 4; - enc->histo_bits_ = GetHistoBits(config, picture); - enc->cache_bits_ = (quality <= 25.f) ? 0 : 7; -} - -// ----------------------------------------------------------------------------- -// VP8LEncoder - -static VP8LEncoder* VP8LEncoderNew(const WebPConfig* const config, - const WebPPicture* const picture) { - VP8LEncoder* const enc = (VP8LEncoder*)calloc(1, sizeof(*enc)); - if (enc == NULL) { - WebPEncodingSetError(picture, VP8_ENC_ERROR_OUT_OF_MEMORY); - return NULL; - } - enc->config_ = config; - enc->pic_ = picture; - return enc; -} - -static void VP8LEncoderDelete(VP8LEncoder* enc) { - free(enc->argb_); - free(enc); -} - -// ----------------------------------------------------------------------------- -// Main call - -WebPEncodingError VP8LEncodeStream(const WebPConfig* const config, - const WebPPicture* const picture, - VP8LBitWriter* const bw) { - WebPEncodingError err = VP8_ENC_OK; - const int quality = (int)config->quality; - const int width = picture->width; - const int height = picture->height; - VP8LEncoder* const enc = VP8LEncoderNew(config, picture); - const size_t byte_position = VP8LBitWriterNumBytes(bw); - - if (enc == NULL) { - err = VP8_ENC_ERROR_OUT_OF_MEMORY; - goto Error; - } - - InitEncParams(enc); - - // --------------------------------------------------------------------------- - // Analyze image (entropy, num_palettes etc) - - if (!VP8LEncAnalyze(enc, config->image_hint)) { - err = VP8_ENC_ERROR_OUT_OF_MEMORY; - goto Error; - } - - if (enc->use_palette_) { - err = ApplyPalette(bw, enc, quality); - if (err != VP8_ENC_OK) goto Error; - // Color cache is disabled for palette. - enc->cache_bits_ = 0; - } - - // In case image is not packed. - if (enc->argb_ == NULL) { - int y; - err = AllocateTransformBuffer(enc, width, height); - if (err != VP8_ENC_OK) goto Error; - for (y = 0; y < height; ++y) { - memcpy(enc->argb_ + y * width, - picture->argb + y * picture->argb_stride, - width * sizeof(*enc->argb_)); - } - enc->current_width_ = width; - } - - // --------------------------------------------------------------------------- - // Apply transforms and write transform data. - - if (!EvalAndApplySubtractGreen(enc, enc->current_width_, height, bw)) { - err = VP8_ENC_ERROR_OUT_OF_MEMORY; - goto Error; - } - - if (enc->use_predict_) { - if (!ApplyPredictFilter(enc, enc->current_width_, height, quality, bw)) { - err = VP8_ENC_ERROR_INVALID_CONFIGURATION; - goto Error; - } - } - - if (enc->use_cross_color_) { - if (!ApplyCrossColorFilter(enc, enc->current_width_, height, quality, bw)) { - err = VP8_ENC_ERROR_INVALID_CONFIGURATION; - goto Error; - } - } - - VP8LWriteBits(bw, 1, !TRANSFORM_PRESENT); // No more transforms. - - // --------------------------------------------------------------------------- - // Estimate the color cache size. - - if (enc->cache_bits_ > 0) { - if (!VP8LCalculateEstimateForCacheSize(enc->argb_, enc->current_width_, - height, &enc->cache_bits_)) { - err = VP8_ENC_ERROR_INVALID_CONFIGURATION; - goto Error; - } - } - - // --------------------------------------------------------------------------- - // Encode and write the transformed image. - - if (!EncodeImageInternal(bw, enc->argb_, enc->current_width_, height, - quality, enc->cache_bits_, enc->histo_bits_)) { - err = VP8_ENC_ERROR_OUT_OF_MEMORY; - goto Error; - } - - if (picture->stats != NULL) { - WebPAuxStats* const stats = picture->stats; - stats->lossless_features = 0; - if (enc->use_predict_) stats->lossless_features |= 1; - if (enc->use_cross_color_) stats->lossless_features |= 2; - if (enc->use_subtract_green_) stats->lossless_features |= 4; - if (enc->use_palette_) stats->lossless_features |= 8; - stats->histogram_bits = enc->histo_bits_; - stats->transform_bits = enc->transform_bits_; - stats->cache_bits = enc->cache_bits_; - stats->palette_size = enc->palette_size_; - stats->lossless_size = (int)(VP8LBitWriterNumBytes(bw) - byte_position); - } - - Error: - VP8LEncoderDelete(enc); - return err; -} - -int VP8LEncodeImage(const WebPConfig* const config, - const WebPPicture* const picture) { - int width, height; - int has_alpha; - size_t coded_size; - int percent = 0; - WebPEncodingError err = VP8_ENC_OK; - VP8LBitWriter bw; - - if (picture == NULL) return 0; - - if (config == NULL || picture->argb == NULL) { - err = VP8_ENC_ERROR_NULL_PARAMETER; - WebPEncodingSetError(picture, err); - return 0; - } - - width = picture->width; - height = picture->height; - if (!VP8LBitWriterInit(&bw, (width * height) >> 1)) { - err = VP8_ENC_ERROR_OUT_OF_MEMORY; - goto Error; - } - - if (!WebPReportProgress(picture, 1, &percent)) { - UserAbort: - err = VP8_ENC_ERROR_USER_ABORT; - goto Error; - } - // Reset stats (for pure lossless coding) - if (picture->stats != NULL) { - WebPAuxStats* const stats = picture->stats; - memset(stats, 0, sizeof(*stats)); - stats->PSNR[0] = 99.f; - stats->PSNR[1] = 99.f; - stats->PSNR[2] = 99.f; - stats->PSNR[3] = 99.f; - stats->PSNR[4] = 99.f; - } - - // Write image size. - if (!WriteImageSize(picture, &bw)) { - err = VP8_ENC_ERROR_OUT_OF_MEMORY; - goto Error; - } - - has_alpha = WebPPictureHasTransparency(picture); - // Write the non-trivial Alpha flag and lossless version. - if (!WriteRealAlphaAndVersion(&bw, has_alpha)) { - err = VP8_ENC_ERROR_OUT_OF_MEMORY; - goto Error; - } - - if (!WebPReportProgress(picture, 5, &percent)) goto UserAbort; - - // Encode main image stream. - err = VP8LEncodeStream(config, picture, &bw); - if (err != VP8_ENC_OK) goto Error; - - // TODO(skal): have a fine-grained progress report in VP8LEncodeStream(). - if (!WebPReportProgress(picture, 90, &percent)) goto UserAbort; - - // Finish the RIFF chunk. - err = WriteImage(picture, &bw, &coded_size); - if (err != VP8_ENC_OK) goto Error; - - if (!WebPReportProgress(picture, 100, &percent)) goto UserAbort; - - // Save size. - if (picture->stats != NULL) { - picture->stats->coded_size += (int)coded_size; - picture->stats->lossless_size = (int)coded_size; - } - - if (picture->extra_info != NULL) { - const int mb_w = (width + 15) >> 4; - const int mb_h = (height + 15) >> 4; - memset(picture->extra_info, 0, mb_w * mb_h * sizeof(*picture->extra_info)); - } - - Error: - if (bw.error_) err = VP8_ENC_ERROR_OUT_OF_MEMORY; - VP8LBitWriterDestroy(&bw); - if (err != VP8_ENC_OK) { - WebPEncodingSetError(picture, err); - return 0; - } - return 1; -} - -//------------------------------------------------------------------------------ - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif diff --git a/external/libwebp/enc/vp8li.h b/external/libwebp/enc/vp8li.h deleted file mode 100644 index eae90dd61f..0000000000 --- a/external/libwebp/enc/vp8li.h +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2012 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Lossless encoder: internal header. -// -// Author: Vikas Arora (vikaas.arora@gmail.com) - -#ifndef WEBP_ENC_VP8LI_H_ -#define WEBP_ENC_VP8LI_H_ - -#include "./histogram.h" -#include "../utils/bit_writer.h" -#include "../webp/encode.h" -#include "../webp/format_constants.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -typedef struct { - const WebPConfig* config_; // user configuration and parameters - const WebPPicture* pic_; // input picture. - - uint32_t* argb_; // Transformed argb image data. - uint32_t* argb_scratch_; // Scratch memory for argb rows - // (used for prediction). - uint32_t* transform_data_; // Scratch memory for transform data. - int current_width_; // Corresponds to packed image width. - - // Encoding parameters derived from quality parameter. - int histo_bits_; - int transform_bits_; - int cache_bits_; // If equal to 0, don't use color cache. - - // Encoding parameters derived from image characteristics. - int use_cross_color_; - int use_subtract_green_; - int use_predict_; - int use_palette_; - int palette_size_; - uint32_t palette_[MAX_PALETTE_SIZE]; -} VP8LEncoder; - -//------------------------------------------------------------------------------ -// internal functions. Not public. - -// Encodes the picture. -// Returns 0 if config or picture is NULL or picture doesn't have valid argb -// input. -int VP8LEncodeImage(const WebPConfig* const config, - const WebPPicture* const picture); - -// Encodes the main image stream using the supplied bit writer. -WebPEncodingError VP8LEncodeStream(const WebPConfig* const config, - const WebPPicture* const picture, - VP8LBitWriter* const bw); - -//------------------------------------------------------------------------------ - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif - -#endif /* WEBP_ENC_VP8LI_H_ */ diff --git a/external/libwebp/enc/webpenc.c b/external/libwebp/enc/webpenc.c deleted file mode 100644 index 3c275589fc..0000000000 --- a/external/libwebp/enc/webpenc.c +++ /dev/null @@ -1,389 +0,0 @@ -// Copyright 2011 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// WebP encoder: main entry point -// -// Author: Skal (pascal.massimino@gmail.com) - -#include <assert.h> -#include <stdlib.h> -#include <string.h> -#include <math.h> - -#include "./vp8enci.h" -#include "./vp8li.h" -#include "../utils/utils.h" - -// #define PRINT_MEMORY_INFO - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -#ifdef PRINT_MEMORY_INFO -#include <stdio.h> -#endif - -//------------------------------------------------------------------------------ - -int WebPGetEncoderVersion(void) { - return (ENC_MAJ_VERSION << 16) | (ENC_MIN_VERSION << 8) | ENC_REV_VERSION; -} - -//------------------------------------------------------------------------------ -// WebPPicture -//------------------------------------------------------------------------------ - -static int DummyWriter(const uint8_t* data, size_t data_size, - const WebPPicture* const picture) { - // The following are to prevent 'unused variable' error message. - (void)data; - (void)data_size; - (void)picture; - return 1; -} - -int WebPPictureInitInternal(WebPPicture* picture, int version) { - if (WEBP_ABI_IS_INCOMPATIBLE(version, WEBP_ENCODER_ABI_VERSION)) { - return 0; // caller/system version mismatch! - } - if (picture != NULL) { - memset(picture, 0, sizeof(*picture)); - picture->writer = DummyWriter; - WebPEncodingSetError(picture, VP8_ENC_OK); - } - return 1; -} - -//------------------------------------------------------------------------------ -// VP8Encoder -//------------------------------------------------------------------------------ - -static void ResetSegmentHeader(VP8Encoder* const enc) { - VP8SegmentHeader* const hdr = &enc->segment_hdr_; - hdr->num_segments_ = enc->config_->segments; - hdr->update_map_ = (hdr->num_segments_ > 1); - hdr->size_ = 0; -} - -static void ResetFilterHeader(VP8Encoder* const enc) { - VP8FilterHeader* const hdr = &enc->filter_hdr_; - hdr->simple_ = 1; - hdr->level_ = 0; - hdr->sharpness_ = 0; - hdr->i4x4_lf_delta_ = 0; -} - -static void ResetBoundaryPredictions(VP8Encoder* const enc) { - // init boundary values once for all - // Note: actually, initializing the preds_[] is only needed for intra4. - int i; - uint8_t* const top = enc->preds_ - enc->preds_w_; - uint8_t* const left = enc->preds_ - 1; - for (i = -1; i < 4 * enc->mb_w_; ++i) { - top[i] = B_DC_PRED; - } - for (i = 0; i < 4 * enc->mb_h_; ++i) { - left[i * enc->preds_w_] = B_DC_PRED; - } - enc->nz_[-1] = 0; // constant -} - -// Map configured quality level to coding tools used. -//-------------+---+---+---+---+---+---+ -// Quality | 0 | 1 | 2 | 3 | 4 | 5 + -//-------------+---+---+---+---+---+---+ -// dynamic prob| ~ | x | x | x | x | x | -//-------------+---+---+---+---+---+---+ -// rd-opt modes| | | x | x | x | x | -//-------------+---+---+---+---+---+---+ -// fast i4/i16 | x | x | | | | | -//-------------+---+---+---+---+---+---+ -// rd-opt i4/16| | | x | x | x | x | -//-------------+---+---+---+---+---+---+ -// Trellis | | x | | | x | x | -//-------------+---+---+---+---+---+---+ -// full-SNS | | | | | | x | -//-------------+---+---+---+---+---+---+ - -static void MapConfigToTools(VP8Encoder* const enc) { - const int method = enc->config_->method; - const int limit = 100 - enc->config_->partition_limit; - enc->method_ = method; - enc->rd_opt_level_ = (method >= 6) ? 3 - : (method >= 5) ? 2 - : (method >= 3) ? 1 - : 0; - enc->max_i4_header_bits_ = - 256 * 16 * 16 * // upper bound: up to 16bit per 4x4 block - (limit * limit) / (100 * 100); // ... modulated with a quadratic curve. -} - -// Memory scaling with dimensions: -// memory (bytes) ~= 2.25 * w + 0.0625 * w * h -// -// Typical memory footprint (768x510 picture) -// Memory used: -// encoder: 33919 -// block cache: 2880 -// info: 3072 -// preds: 24897 -// top samples: 1623 -// non-zero: 196 -// lf-stats: 2048 -// total: 68635 -// Transcient object sizes: -// VP8EncIterator: 352 -// VP8ModeScore: 912 -// VP8SegmentInfo: 532 -// VP8Proba: 31032 -// LFStats: 2048 -// Picture size (yuv): 589824 - -static VP8Encoder* InitVP8Encoder(const WebPConfig* const config, - WebPPicture* const picture) { - const int use_filter = - (config->filter_strength > 0) || (config->autofilter > 0); - const int mb_w = (picture->width + 15) >> 4; - const int mb_h = (picture->height + 15) >> 4; - const int preds_w = 4 * mb_w + 1; - const int preds_h = 4 * mb_h + 1; - const size_t preds_size = preds_w * preds_h * sizeof(uint8_t); - const int top_stride = mb_w * 16; - const size_t nz_size = (mb_w + 1) * sizeof(uint32_t); - const size_t cache_size = (3 * YUV_SIZE + PRED_SIZE) * sizeof(uint8_t); - const size_t info_size = mb_w * mb_h * sizeof(VP8MBInfo); - const size_t samples_size = (2 * top_stride + // top-luma/u/v - 16 + 16 + 16 + 8 + 1 + // left y/u/v - 2 * ALIGN_CST) // align all - * sizeof(uint8_t); - const size_t lf_stats_size = - config->autofilter ? sizeof(LFStats) + ALIGN_CST : 0; - VP8Encoder* enc; - uint8_t* mem; - const uint64_t size = (uint64_t)sizeof(VP8Encoder) // main struct - + ALIGN_CST // cache alignment - + cache_size // working caches - + info_size // modes info - + preds_size // prediction modes - + samples_size // top/left samples - + nz_size // coeff context bits - + lf_stats_size; // autofilter stats - -#ifdef PRINT_MEMORY_INFO - printf("===================================\n"); - printf("Memory used:\n" - " encoder: %ld\n" - " block cache: %ld\n" - " info: %ld\n" - " preds: %ld\n" - " top samples: %ld\n" - " non-zero: %ld\n" - " lf-stats: %ld\n" - " total: %ld\n", - sizeof(VP8Encoder) + ALIGN_CST, cache_size, info_size, - preds_size, samples_size, nz_size, lf_stats_size, size); - printf("Transcient object sizes:\n" - " VP8EncIterator: %ld\n" - " VP8ModeScore: %ld\n" - " VP8SegmentInfo: %ld\n" - " VP8Proba: %ld\n" - " LFStats: %ld\n", - sizeof(VP8EncIterator), sizeof(VP8ModeScore), - sizeof(VP8SegmentInfo), sizeof(VP8Proba), - sizeof(LFStats)); - printf("Picture size (yuv): %ld\n", - mb_w * mb_h * 384 * sizeof(uint8_t)); - printf("===================================\n"); -#endif - mem = (uint8_t*)WebPSafeMalloc(size, sizeof(*mem)); - if (mem == NULL) { - WebPEncodingSetError(picture, VP8_ENC_ERROR_OUT_OF_MEMORY); - return NULL; - } - enc = (VP8Encoder*)mem; - mem = (uint8_t*)DO_ALIGN(mem + sizeof(*enc)); - memset(enc, 0, sizeof(*enc)); - enc->num_parts_ = 1 << config->partitions; - enc->mb_w_ = mb_w; - enc->mb_h_ = mb_h; - enc->preds_w_ = preds_w; - enc->yuv_in_ = (uint8_t*)mem; - mem += YUV_SIZE; - enc->yuv_out_ = (uint8_t*)mem; - mem += YUV_SIZE; - enc->yuv_out2_ = (uint8_t*)mem; - mem += YUV_SIZE; - enc->yuv_p_ = (uint8_t*)mem; - mem += PRED_SIZE; - enc->mb_info_ = (VP8MBInfo*)mem; - mem += info_size; - enc->preds_ = ((uint8_t*)mem) + 1 + enc->preds_w_; - mem += preds_w * preds_h * sizeof(uint8_t); - enc->nz_ = 1 + (uint32_t*)mem; - mem += nz_size; - enc->lf_stats_ = lf_stats_size ? (LFStats*)DO_ALIGN(mem) : NULL; - mem += lf_stats_size; - - // top samples (all 16-aligned) - mem = (uint8_t*)DO_ALIGN(mem); - enc->y_top_ = (uint8_t*)mem; - enc->uv_top_ = enc->y_top_ + top_stride; - mem += 2 * top_stride; - mem = (uint8_t*)DO_ALIGN(mem + 1); - enc->y_left_ = (uint8_t*)mem; - mem += 16 + 16; - enc->u_left_ = (uint8_t*)mem; - mem += 16; - enc->v_left_ = (uint8_t*)mem; - mem += 8; - - enc->config_ = config; - enc->profile_ = use_filter ? ((config->filter_type == 1) ? 0 : 1) : 2; - enc->pic_ = picture; - enc->percent_ = 0; - - MapConfigToTools(enc); - VP8EncDspInit(); - VP8DefaultProbas(enc); - ResetSegmentHeader(enc); - ResetFilterHeader(enc); - ResetBoundaryPredictions(enc); - - VP8EncInitAlpha(enc); -#ifdef WEBP_EXPERIMENTAL_FEATURES - VP8EncInitLayer(enc); -#endif - - return enc; -} - -static void DeleteVP8Encoder(VP8Encoder* enc) { - if (enc != NULL) { - VP8EncDeleteAlpha(enc); -#ifdef WEBP_EXPERIMENTAL_FEATURES - VP8EncDeleteLayer(enc); -#endif - free(enc); - } -} - -//------------------------------------------------------------------------------ - -static double GetPSNR(uint64_t err, uint64_t size) { - return err ? 10. * log10(255. * 255. * size / err) : 99.; -} - -static void FinalizePSNR(const VP8Encoder* const enc) { - WebPAuxStats* stats = enc->pic_->stats; - const uint64_t size = enc->sse_count_; - const uint64_t* const sse = enc->sse_; - stats->PSNR[0] = (float)GetPSNR(sse[0], size); - stats->PSNR[1] = (float)GetPSNR(sse[1], size / 4); - stats->PSNR[2] = (float)GetPSNR(sse[2], size / 4); - stats->PSNR[3] = (float)GetPSNR(sse[0] + sse[1] + sse[2], size * 3 / 2); - stats->PSNR[4] = (float)GetPSNR(sse[3], size); -} - -static void StoreStats(VP8Encoder* const enc) { - WebPAuxStats* const stats = enc->pic_->stats; - if (stats != NULL) { - int i, s; - for (i = 0; i < NUM_MB_SEGMENTS; ++i) { - stats->segment_level[i] = enc->dqm_[i].fstrength_; - stats->segment_quant[i] = enc->dqm_[i].quant_; - for (s = 0; s <= 2; ++s) { - stats->residual_bytes[s][i] = enc->residual_bytes_[s][i]; - } - } - FinalizePSNR(enc); - stats->coded_size = enc->coded_size_; - for (i = 0; i < 3; ++i) { - stats->block_count[i] = enc->block_count_[i]; - } - } - WebPReportProgress(enc->pic_, 100, &enc->percent_); // done! -} - -int WebPEncodingSetError(const WebPPicture* const pic, - WebPEncodingError error) { - assert((int)error < VP8_ENC_ERROR_LAST); - assert((int)error >= VP8_ENC_OK); - ((WebPPicture*)pic)->error_code = error; - return 0; -} - -int WebPReportProgress(const WebPPicture* const pic, - int percent, int* const percent_store) { - if (percent_store != NULL && percent != *percent_store) { - *percent_store = percent; - if (pic->progress_hook && !pic->progress_hook(percent, pic)) { - // user abort requested - WebPEncodingSetError(pic, VP8_ENC_ERROR_USER_ABORT); - return 0; - } - } - return 1; // ok -} -//------------------------------------------------------------------------------ - -int WebPEncode(const WebPConfig* config, WebPPicture* pic) { - int ok; - - if (pic == NULL) - return 0; - WebPEncodingSetError(pic, VP8_ENC_OK); // all ok so far - if (config == NULL) // bad params - return WebPEncodingSetError(pic, VP8_ENC_ERROR_NULL_PARAMETER); - if (!WebPValidateConfig(config)) - return WebPEncodingSetError(pic, VP8_ENC_ERROR_INVALID_CONFIGURATION); - if (pic->width <= 0 || pic->height <= 0) - return WebPEncodingSetError(pic, VP8_ENC_ERROR_BAD_DIMENSION); - if (pic->width > WEBP_MAX_DIMENSION || pic->height > WEBP_MAX_DIMENSION) - return WebPEncodingSetError(pic, VP8_ENC_ERROR_BAD_DIMENSION); - - if (pic->stats != NULL) memset(pic->stats, 0, sizeof(*pic->stats)); - - if (!config->lossless) { - VP8Encoder* enc = NULL; - if (pic->y == NULL || pic->u == NULL || pic->v == NULL) { - if (pic->argb != NULL) { - if (!WebPPictureARGBToYUVA(pic, WEBP_YUV420)) return 0; - } else { - return WebPEncodingSetError(pic, VP8_ENC_ERROR_NULL_PARAMETER); - } - } - - enc = InitVP8Encoder(config, pic); - if (enc == NULL) return 0; // pic->error is already set. - // Note: each of the tasks below account for 20% in the progress report. - ok = VP8EncAnalyze(enc) - && VP8StatLoop(enc) - && VP8EncLoop(enc) - && VP8EncFinishAlpha(enc) -#ifdef WEBP_EXPERIMENTAL_FEATURES - && VP8EncFinishLayer(enc) -#endif - && VP8EncWrite(enc); - StoreStats(enc); - if (!ok) { - VP8EncFreeBitWriters(enc); - } - DeleteVP8Encoder(enc); - } else { - if (pic->argb == NULL) - return WebPEncodingSetError(pic, VP8_ENC_ERROR_NULL_PARAMETER); - - ok = VP8LEncodeImage(config, pic); // Sets pic->error in case of problem. - } - - return ok; -} - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif diff --git a/external/libwebp/mux/Makefile.am b/external/libwebp/mux/Makefile.am deleted file mode 100644 index 3beb240eef..0000000000 --- a/external/libwebp/mux/Makefile.am +++ /dev/null @@ -1,16 +0,0 @@ -AM_CPPFLAGS = -I$(top_srcdir)/src -lib_LTLIBRARIES = libwebpmux.la - -libwebpmux_la_SOURCES = -libwebpmux_la_SOURCES += demux.c -libwebpmux_la_SOURCES += muxedit.c -libwebpmux_la_SOURCES += muxi.h -libwebpmux_la_SOURCES += muxinternal.c -libwebpmux_la_SOURCES += muxread.c - -libwebpmuxinclude_HEADERS = -libwebpmuxinclude_HEADERS += ../webp/mux.h -libwebpmuxinclude_HEADERS += ../webp/types.h - -libwebpmux_la_LDFLAGS = -version-info 0:0:0 -libwebpmuxincludedir = $(includedir)/webp diff --git a/external/libwebp/mux/demux.c b/external/libwebp/mux/demux.c deleted file mode 100644 index 4519f7d55b..0000000000 --- a/external/libwebp/mux/demux.c +++ /dev/null @@ -1,902 +0,0 @@ -// Copyright 2012 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// WebP container demux. -// - -#include "../webp/mux.h" - -#include <stdlib.h> -#include <string.h> - -#include "../webp/decode.h" // WebPGetInfo -#include "../webp/format_constants.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -#define MKFOURCC(a, b, c, d) ((uint32_t)(a) | (b) << 8 | (c) << 16 | (d) << 24) - -typedef struct { - size_t start_; // start location of the data - size_t end_; // end location - size_t riff_end_; // riff chunk end location, can be > end_. - size_t buf_size_; // size of the buffer - const uint8_t* buf_; -} MemBuffer; - -typedef struct { - size_t offset_; - size_t size_; -} ChunkData; - -typedef struct Frame { - int x_offset_, y_offset_; - int width_, height_; - int duration_; - int is_tile_; // this is an image fragment from a 'TILE'. - int frame_num_; // the referent frame number for use in assembling tiles. - int complete_; // img_components_ contains a full image. - ChunkData img_components_[2]; // 0=VP8{,L} 1=ALPH - struct Frame* next_; -} Frame; - -typedef struct Chunk { - ChunkData data_; - struct Chunk* next_; -} Chunk; - -struct WebPDemuxer { - MemBuffer mem_; - WebPDemuxState state_; - int is_ext_format_; - uint32_t feature_flags_; - int canvas_width_, canvas_height_; - int loop_count_; - int num_frames_; - Frame* frames_; - Chunk* chunks_; // non-image chunks -}; - -typedef enum { - PARSE_OK, - PARSE_NEED_MORE_DATA, - PARSE_ERROR -} ParseStatus; - -typedef struct ChunkParser { - uint8_t id[4]; - ParseStatus (*parse)(WebPDemuxer* const dmux); - int (*valid)(const WebPDemuxer* const dmux); -} ChunkParser; - -static ParseStatus ParseSingleImage(WebPDemuxer* const dmux); -static ParseStatus ParseVP8X(WebPDemuxer* const dmux); -static int IsValidSimpleFormat(const WebPDemuxer* const dmux); -static int IsValidExtendedFormat(const WebPDemuxer* const dmux); - -static const ChunkParser kMasterChunks[] = { - { { 'V', 'P', '8', ' ' }, ParseSingleImage, IsValidSimpleFormat }, - { { 'V', 'P', '8', 'L' }, ParseSingleImage, IsValidSimpleFormat }, - { { 'V', 'P', '8', 'X' }, ParseVP8X, IsValidExtendedFormat }, - { { '0', '0', '0', '0' }, NULL, NULL }, -}; - -// ----------------------------------------------------------------------------- -// MemBuffer - -static int RemapMemBuffer(MemBuffer* const mem, - const uint8_t* data, size_t size) { - if (size < mem->buf_size_) return 0; // can't remap to a shorter buffer! - - mem->buf_ = data; - mem->end_ = mem->buf_size_ = size; - return 1; -} - -static int InitMemBuffer(MemBuffer* const mem, - const uint8_t* data, size_t size) { - memset(mem, 0, sizeof(*mem)); - return RemapMemBuffer(mem, data, size); -} - -// Return the remaining data size available in 'mem'. -static WEBP_INLINE size_t MemDataSize(const MemBuffer* const mem) { - return (mem->end_ - mem->start_); -} - -// Return true if 'size' exceeds the end of the RIFF chunk. -static WEBP_INLINE int SizeIsInvalid(const MemBuffer* const mem, size_t size) { - return (size > mem->riff_end_ - mem->start_); -} - -static WEBP_INLINE void Skip(MemBuffer* const mem, size_t size) { - mem->start_ += size; -} - -static WEBP_INLINE void Rewind(MemBuffer* const mem, size_t size) { - mem->start_ -= size; -} - -static WEBP_INLINE const uint8_t* GetBuffer(MemBuffer* const mem) { - return mem->buf_ + mem->start_; -} - -static WEBP_INLINE uint8_t GetByte(MemBuffer* const mem) { - const uint8_t byte = mem->buf_[mem->start_]; - Skip(mem, 1); - return byte; -} - -// Read 16, 24 or 32 bits stored in little-endian order. -static WEBP_INLINE int ReadLE16s(const uint8_t* const data) { - return (int)(data[0] << 0) | (data[1] << 8); -} - -static WEBP_INLINE int ReadLE24s(const uint8_t* const data) { - return ReadLE16s(data) | (data[2] << 16); -} - -static WEBP_INLINE uint32_t ReadLE32(const uint8_t* const data) { - return (uint32_t)ReadLE24s(data) | (data[3] << 24); -} - -// In addition to reading, skip the read bytes. -static WEBP_INLINE int GetLE16s(MemBuffer* const mem) { - const uint8_t* const data = mem->buf_ + mem->start_; - const int val = ReadLE16s(data); - Skip(mem, 2); - return val; -} - -static WEBP_INLINE int GetLE24s(MemBuffer* const mem) { - const uint8_t* const data = mem->buf_ + mem->start_; - const int val = ReadLE24s(data); - Skip(mem, 3); - return val; -} - -static WEBP_INLINE uint32_t GetLE32(MemBuffer* const mem) { - const uint8_t* const data = mem->buf_ + mem->start_; - const uint32_t val = ReadLE32(data); - Skip(mem, 4); - return val; -} - -// ----------------------------------------------------------------------------- -// Secondary chunk parsing - -static void AddChunk(WebPDemuxer* const dmux, Chunk* const chunk) { - Chunk** c = &dmux->chunks_; - while (*c != NULL) c = &(*c)->next_; - *c = chunk; - chunk->next_ = NULL; -} - -// Add a frame to the end of the list, ensuring the last frame is complete. -// Returns true on success, false otherwise. -static int AddFrame(WebPDemuxer* const dmux, Frame* const frame) { - const Frame* last_frame = NULL; - Frame** f = &dmux->frames_; - while (*f != NULL) { - last_frame = *f; - f = &(*f)->next_; - } - if (last_frame != NULL && !last_frame->complete_) return 0; - *f = frame; - frame->next_ = NULL; - return 1; -} - -// Store image bearing chunks to 'frame'. -static ParseStatus StoreFrame(int frame_num, MemBuffer* const mem, - Frame* const frame) { - int alpha_chunks = 0; - int image_chunks = 0; - int done = (MemDataSize(mem) < CHUNK_HEADER_SIZE); - ParseStatus status = PARSE_OK; - - if (done) return PARSE_NEED_MORE_DATA; - - do { - const size_t chunk_start_offset = mem->start_; - const uint32_t fourcc = GetLE32(mem); - const uint32_t payload_size = GetLE32(mem); - const uint32_t payload_size_padded = payload_size + (payload_size & 1); - const size_t payload_available = (payload_size_padded > MemDataSize(mem)) - ? MemDataSize(mem) : payload_size_padded; - const size_t chunk_size = CHUNK_HEADER_SIZE + payload_available; - - if (payload_size > MAX_CHUNK_PAYLOAD) return PARSE_ERROR; - if (SizeIsInvalid(mem, payload_size_padded)) return PARSE_ERROR; - if (payload_size_padded > MemDataSize(mem)) status = PARSE_NEED_MORE_DATA; - - switch (fourcc) { - case MKFOURCC('A', 'L', 'P', 'H'): - if (alpha_chunks == 0) { - ++alpha_chunks; - frame->img_components_[1].offset_ = chunk_start_offset; - frame->img_components_[1].size_ = chunk_size; - frame->frame_num_ = frame_num; - Skip(mem, payload_available); - } else { - goto Done; - } - break; - case MKFOURCC('V', 'P', '8', ' '): - case MKFOURCC('V', 'P', '8', 'L'): - if (image_chunks == 0) { - int width = 0, height = 0; - ++image_chunks; - frame->img_components_[0].offset_ = chunk_start_offset; - frame->img_components_[0].size_ = chunk_size; - // Extract the width and height from the bitstream, tolerating - // failures when the data is incomplete. - if (!WebPGetInfo(mem->buf_ + frame->img_components_[0].offset_, - frame->img_components_[0].size_, &width, &height) && - status != PARSE_NEED_MORE_DATA) { - return PARSE_ERROR; - } - - frame->width_ = width; - frame->height_ = height; - frame->frame_num_ = frame_num; - frame->complete_ = (status == PARSE_OK); - Skip(mem, payload_available); - } else { - goto Done; - } - break; - Done: - default: - // Restore fourcc/size when moving up one level in parsing. - Rewind(mem, CHUNK_HEADER_SIZE); - done = 1; - break; - } - - if (mem->start_ == mem->riff_end_) { - done = 1; - } else if (MemDataSize(mem) < CHUNK_HEADER_SIZE) { - status = PARSE_NEED_MORE_DATA; - } - } while (!done && status == PARSE_OK); - - return status; -} - -// Creates a new Frame if 'actual_size' is within bounds and 'mem' contains -// enough data ('min_size') to parse the payload. -// Returns PARSE_OK on success with *frame pointing to the new Frame. -// Returns PARSE_NEED_MORE_DATA with insufficient data, PARSE_ERROR otherwise. -static ParseStatus NewFrame(const MemBuffer* const mem, - uint32_t min_size, uint32_t expected_size, - uint32_t actual_size, Frame** frame) { - if (SizeIsInvalid(mem, min_size)) return PARSE_ERROR; - if (actual_size < expected_size) return PARSE_ERROR; - if (MemDataSize(mem) < min_size) return PARSE_NEED_MORE_DATA; - - *frame = (Frame*)calloc(1, sizeof(**frame)); - return (*frame == NULL) ? PARSE_ERROR : PARSE_OK; -} - -// Parse a 'FRM ' chunk and any image bearing chunks that immediately follow. -// 'frame_chunk_size' is the previously validated, padded chunk size. -static ParseStatus ParseFrame( - WebPDemuxer* const dmux, uint32_t frame_chunk_size) { - const int has_frames = !!(dmux->feature_flags_ & ANIMATION_FLAG); - const uint32_t min_size = frame_chunk_size + CHUNK_HEADER_SIZE; - int added_frame = 0; - MemBuffer* const mem = &dmux->mem_; - Frame* frame; - ParseStatus status = - NewFrame(mem, min_size, FRAME_CHUNK_SIZE, frame_chunk_size, &frame); - if (status != PARSE_OK) return status; - - frame->x_offset_ = 2 * GetLE24s(mem); - frame->y_offset_ = 2 * GetLE24s(mem); - frame->width_ = 1 + GetLE24s(mem); - frame->height_ = 1 + GetLE24s(mem); - frame->duration_ = 1 + GetLE24s(mem); - Skip(mem, frame_chunk_size - FRAME_CHUNK_SIZE); // skip any trailing data. - if (frame->width_ * (uint64_t)frame->height_ >= MAX_IMAGE_AREA) { - return PARSE_ERROR; - } - - // Store a (potentially partial) frame only if the animation flag is set - // and there is some data in 'frame'. - status = StoreFrame(dmux->num_frames_ + 1, mem, frame); - if (status != PARSE_ERROR && has_frames && frame->frame_num_ > 0) { - added_frame = AddFrame(dmux, frame); - if (added_frame) { - ++dmux->num_frames_; - } else { - status = PARSE_ERROR; - } - } - - if (!added_frame) free(frame); - return status; -} - -// Parse a 'TILE' chunk and any image bearing chunks that immediately follow. -// 'tile_chunk_size' is the previously validated, padded chunk size. -static ParseStatus ParseTile(WebPDemuxer* const dmux, - uint32_t tile_chunk_size) { - const int has_tiles = !!(dmux->feature_flags_ & TILE_FLAG); - const uint32_t min_size = tile_chunk_size + CHUNK_HEADER_SIZE; - int added_tile = 0; - MemBuffer* const mem = &dmux->mem_; - Frame* frame; - ParseStatus status = - NewFrame(mem, min_size, TILE_CHUNK_SIZE, tile_chunk_size, &frame); - if (status != PARSE_OK) return status; - - frame->is_tile_ = 1; - frame->x_offset_ = 2 * GetLE24s(mem); - frame->y_offset_ = 2 * GetLE24s(mem); - Skip(mem, tile_chunk_size - TILE_CHUNK_SIZE); // skip any trailing data. - - // Store a (potentially partial) tile only if the tile flag is set - // and the tile contains some data. - status = StoreFrame(dmux->num_frames_, mem, frame); - if (status != PARSE_ERROR && has_tiles && frame->frame_num_ > 0) { - // Note num_frames_ is incremented only when all tiles have been consumed. - added_tile = AddFrame(dmux, frame); - if (!added_tile) status = PARSE_ERROR; - } - - if (!added_tile) free(frame); - return status; -} - -// General chunk storage starting with the header at 'start_offset' allowing -// the user to request the payload via a fourcc string. 'size' includes the -// header and the unpadded payload size. -// Returns true on success, false otherwise. -static int StoreChunk(WebPDemuxer* const dmux, - size_t start_offset, uint32_t size) { - Chunk* const chunk = (Chunk*)calloc(1, sizeof(*chunk)); - if (chunk == NULL) return 0; - - chunk->data_.offset_ = start_offset; - chunk->data_.size_ = size; - AddChunk(dmux, chunk); - return 1; -} - -// ----------------------------------------------------------------------------- -// Primary chunk parsing - -static int ReadHeader(MemBuffer* const mem) { - const size_t min_size = RIFF_HEADER_SIZE + CHUNK_HEADER_SIZE; - uint32_t riff_size; - - // Basic file level validation. - if (MemDataSize(mem) < min_size) return 0; - if (memcmp(GetBuffer(mem), "RIFF", CHUNK_SIZE_BYTES) || - memcmp(GetBuffer(mem) + CHUNK_HEADER_SIZE, "WEBP", CHUNK_SIZE_BYTES)) { - return 0; - } - - riff_size = ReadLE32(GetBuffer(mem) + TAG_SIZE); - if (riff_size < CHUNK_HEADER_SIZE) return 0; - if (riff_size > MAX_CHUNK_PAYLOAD) return 0; - - // There's no point in reading past the end of the RIFF chunk - mem->riff_end_ = riff_size + CHUNK_HEADER_SIZE; - if (mem->buf_size_ > mem->riff_end_) { - mem->buf_size_ = mem->end_ = mem->riff_end_; - } - - Skip(mem, RIFF_HEADER_SIZE); - return 1; -} - -static ParseStatus ParseSingleImage(WebPDemuxer* const dmux) { - const size_t min_size = CHUNK_HEADER_SIZE; - MemBuffer* const mem = &dmux->mem_; - Frame* frame; - ParseStatus status; - - if (dmux->frames_ != NULL) return PARSE_ERROR; - if (SizeIsInvalid(mem, min_size)) return PARSE_ERROR; - if (MemDataSize(mem) < min_size) return PARSE_NEED_MORE_DATA; - - frame = (Frame*)calloc(1, sizeof(*frame)); - if (frame == NULL) return PARSE_ERROR; - - status = StoreFrame(1, &dmux->mem_, frame); - if (status != PARSE_ERROR) { - const int has_alpha = !!(dmux->feature_flags_ & ALPHA_FLAG); - // Clear any alpha when the alpha flag is missing. - if (!has_alpha && frame->img_components_[1].size_ > 0) { - frame->img_components_[1].offset_ = 0; - frame->img_components_[1].size_ = 0; - } - - // Use the frame width/height as the canvas values for non-vp8x files. - if (!dmux->is_ext_format_ && frame->width_ > 0 && frame->height_ > 0) { - dmux->state_ = WEBP_DEMUX_PARSED_HEADER; - dmux->canvas_width_ = frame->width_; - dmux->canvas_height_ = frame->height_; - } - AddFrame(dmux, frame); - dmux->num_frames_ = 1; - } else { - free(frame); - } - - return status; -} - -static ParseStatus ParseVP8X(WebPDemuxer* const dmux) { - MemBuffer* const mem = &dmux->mem_; - int loop_chunks = 0; - uint32_t vp8x_size; - ParseStatus status = PARSE_OK; - - if (MemDataSize(mem) < CHUNK_HEADER_SIZE) return PARSE_NEED_MORE_DATA; - - dmux->is_ext_format_ = 1; - Skip(mem, TAG_SIZE); // VP8X - vp8x_size = GetLE32(mem); - if (vp8x_size > MAX_CHUNK_PAYLOAD) return PARSE_ERROR; - if (vp8x_size < VP8X_CHUNK_SIZE) return PARSE_ERROR; - vp8x_size += vp8x_size & 1; - if (SizeIsInvalid(mem, vp8x_size)) return PARSE_ERROR; - if (MemDataSize(mem) < vp8x_size) return PARSE_NEED_MORE_DATA; - - dmux->feature_flags_ = GetByte(mem); - Skip(mem, 3); // Reserved. - dmux->canvas_width_ = 1 + GetLE24s(mem); - dmux->canvas_height_ = 1 + GetLE24s(mem); - if (dmux->canvas_width_ * (uint64_t)dmux->canvas_height_ >= MAX_IMAGE_AREA) { - return PARSE_ERROR; // image final dimension is too large - } - Skip(mem, vp8x_size - VP8X_CHUNK_SIZE); // skip any trailing data. - dmux->state_ = WEBP_DEMUX_PARSED_HEADER; - - if (SizeIsInvalid(mem, CHUNK_HEADER_SIZE)) return PARSE_ERROR; - if (MemDataSize(mem) < CHUNK_HEADER_SIZE) return PARSE_NEED_MORE_DATA; - - do { - int store_chunk = 1; - const size_t chunk_start_offset = mem->start_; - const uint32_t fourcc = GetLE32(mem); - const uint32_t chunk_size = GetLE32(mem); - const uint32_t chunk_size_padded = chunk_size + (chunk_size & 1); - - if (chunk_size > MAX_CHUNK_PAYLOAD) return PARSE_ERROR; - if (SizeIsInvalid(mem, chunk_size_padded)) return PARSE_ERROR; - - switch (fourcc) { - case MKFOURCC('V', 'P', '8', 'X'): { - return PARSE_ERROR; - } - case MKFOURCC('A', 'L', 'P', 'H'): - case MKFOURCC('V', 'P', '8', ' '): - case MKFOURCC('V', 'P', '8', 'L'): { - Rewind(mem, CHUNK_HEADER_SIZE); - status = ParseSingleImage(dmux); - break; - } - case MKFOURCC('L', 'O', 'O', 'P'): { - if (chunk_size_padded < LOOP_CHUNK_SIZE) return PARSE_ERROR; - - if (MemDataSize(mem) < chunk_size_padded) { - status = PARSE_NEED_MORE_DATA; - } else if (loop_chunks == 0) { - ++loop_chunks; - dmux->loop_count_ = GetLE16s(mem); - Skip(mem, chunk_size_padded - LOOP_CHUNK_SIZE); - } else { - store_chunk = 0; - goto Skip; - } - break; - } - case MKFOURCC('F', 'R', 'M', ' '): { - status = ParseFrame(dmux, chunk_size_padded); - break; - } - case MKFOURCC('T', 'I', 'L', 'E'): { - if (dmux->num_frames_ == 0) dmux->num_frames_ = 1; - status = ParseTile(dmux, chunk_size_padded); - break; - } - case MKFOURCC('I', 'C', 'C', 'P'): { - store_chunk = !!(dmux->feature_flags_ & ICCP_FLAG); - goto Skip; - } - case MKFOURCC('M', 'E', 'T', 'A'): { - store_chunk = !!(dmux->feature_flags_ & META_FLAG); - goto Skip; - } - Skip: - default: { - if (chunk_size_padded <= MemDataSize(mem)) { - if (store_chunk) { - // Store only the chunk header and unpadded size as only the payload - // will be returned to the user. - if (!StoreChunk(dmux, chunk_start_offset, - CHUNK_HEADER_SIZE + chunk_size)) { - return PARSE_ERROR; - } - } - Skip(mem, chunk_size_padded); - } else { - status = PARSE_NEED_MORE_DATA; - } - } - } - - if (mem->start_ == mem->riff_end_) { - break; - } else if (MemDataSize(mem) < CHUNK_HEADER_SIZE) { - status = PARSE_NEED_MORE_DATA; - } - } while (status == PARSE_OK); - - return status; -} - -// ----------------------------------------------------------------------------- -// Format validation - -static int IsValidSimpleFormat(const WebPDemuxer* const dmux) { - const Frame* const frame = dmux->frames_; - if (dmux->state_ == WEBP_DEMUX_PARSING_HEADER) return 1; - - if (dmux->canvas_width_ <= 0 || dmux->canvas_height_ <= 0) return 0; - if (dmux->state_ == WEBP_DEMUX_DONE && frame == NULL) return 0; - - if (frame->width_ <= 0 || frame->height_ <= 0) return 0; - return 1; -} - -static int IsValidExtendedFormat(const WebPDemuxer* const dmux) { - const int has_tiles = !!(dmux->feature_flags_ & TILE_FLAG); - const int has_frames = !!(dmux->feature_flags_ & ANIMATION_FLAG); - const Frame* f; - - if (dmux->state_ == WEBP_DEMUX_PARSING_HEADER) return 1; - - if (dmux->canvas_width_ <= 0 || dmux->canvas_height_ <= 0) return 0; - if (dmux->loop_count_ < 0) return 0; - if (dmux->state_ == WEBP_DEMUX_DONE && dmux->frames_ == NULL) return 0; - - for (f = dmux->frames_; f != NULL; f = f->next_) { - const int cur_frame_set = f->frame_num_; - int frame_count = 0, tile_count = 0; - - // Check frame properties and if the image is composed of tiles that each - // fragment came from a 'TILE'. - for (; f != NULL && f->frame_num_ == cur_frame_set; f = f->next_) { - const ChunkData* const image = f->img_components_; - const ChunkData* const alpha = f->img_components_ + 1; - - if (!has_tiles && f->is_tile_) return 0; - if (!has_frames && f->frame_num_ > 1) return 0; - if (f->x_offset_ < 0 || f->y_offset_ < 0) return 0; - if (f->complete_) { - if (alpha->size_ == 0 && image->size_ == 0) return 0; - // Ensure alpha precedes image bitstream. - if (alpha->size_ > 0 && alpha->offset_ > image->offset_) { - return 0; - } - - if (f->width_ <= 0 || f->height_ <= 0) return 0; - } else { - // Ensure alpha precedes image bitstream. - if (alpha->size_ > 0 && image->size_ > 0 && - alpha->offset_ > image->offset_) { - return 0; - } - // There shouldn't be any frames after an incomplete one. - if (f->next_ != NULL) return 0; - } - - tile_count += f->is_tile_; - ++frame_count; - } - if (!has_tiles && frame_count > 1) return 0; - if (tile_count > 0 && frame_count != tile_count) return 0; - if (f == NULL) break; - } - return 1; -} - -// ----------------------------------------------------------------------------- -// WebPDemuxer object - -static void InitDemux(WebPDemuxer* const dmux, const MemBuffer* const mem) { - dmux->state_ = WEBP_DEMUX_PARSING_HEADER; - dmux->loop_count_ = 1; - dmux->canvas_width_ = -1; - dmux->canvas_height_ = -1; - dmux->mem_ = *mem; -} - -WebPDemuxer* WebPDemuxInternal(const WebPData* data, int allow_partial, - WebPDemuxState* state, int version) { - const ChunkParser* parser; - int partial; - ParseStatus status = PARSE_ERROR; - MemBuffer mem; - WebPDemuxer* dmux; - - if (WEBP_ABI_IS_INCOMPATIBLE(version, WEBP_DEMUX_ABI_VERSION)) return NULL; - if (data == NULL || data->bytes_ == NULL || data->size_ == 0) return NULL; - - if (!InitMemBuffer(&mem, data->bytes_, data->size_)) return NULL; - if (!ReadHeader(&mem)) return NULL; - - partial = (mem.buf_size_ < mem.riff_end_); - if (!allow_partial && partial) return NULL; - - dmux = (WebPDemuxer*)calloc(1, sizeof(*dmux)); - if (dmux == NULL) return NULL; - InitDemux(dmux, &mem); - - for (parser = kMasterChunks; parser->parse != NULL; ++parser) { - if (!memcmp(parser->id, GetBuffer(&dmux->mem_), TAG_SIZE)) { - status = parser->parse(dmux); - if (status == PARSE_OK) dmux->state_ = WEBP_DEMUX_DONE; - if (status != PARSE_ERROR && !parser->valid(dmux)) status = PARSE_ERROR; - break; - } - } - if (state) *state = dmux->state_; - - if (status == PARSE_ERROR) { - WebPDemuxDelete(dmux); - return NULL; - } - return dmux; -} - -void WebPDemuxDelete(WebPDemuxer* dmux) { - Chunk* c; - Frame* f; - if (dmux == NULL) return; - - for (f = dmux->frames_; f != NULL;) { - Frame* const cur_frame = f; - f = f->next_; - free(cur_frame); - } - for (c = dmux->chunks_; c != NULL;) { - Chunk* const cur_chunk = c; - c = c->next_; - free(cur_chunk); - } - free(dmux); -} - -// ----------------------------------------------------------------------------- - -uint32_t WebPDemuxGetI(const WebPDemuxer* dmux, WebPFormatFeature feature) { - if (dmux == NULL) return 0; - - switch (feature) { - case WEBP_FF_FORMAT_FLAGS: return dmux->feature_flags_; - case WEBP_FF_CANVAS_WIDTH: return (uint32_t)dmux->canvas_width_; - case WEBP_FF_CANVAS_HEIGHT: return (uint32_t)dmux->canvas_height_; - case WEBP_FF_LOOP_COUNT: return (uint32_t)dmux->loop_count_; - } - return 0; -} - -// ----------------------------------------------------------------------------- -// Frame iteration - -// Find the first 'frame_num' frame. There may be multiple in a tiled frame. -static const Frame* GetFrame(const WebPDemuxer* const dmux, int frame_num) { - const Frame* f; - for (f = dmux->frames_; f != NULL; f = f->next_) { - if (frame_num == f->frame_num_) break; - } - return f; -} - -// Returns tile 'tile_num' and the total count. -static const Frame* GetTile( - const Frame* const frame_set, int tile_num, int* const count) { - const int this_frame = frame_set->frame_num_; - const Frame* f = frame_set; - const Frame* tile = NULL; - int total; - - for (total = 0; f != NULL && f->frame_num_ == this_frame; f = f->next_) { - if (++total == tile_num) tile = f; - } - *count = total; - return tile; -} - -static const uint8_t* GetFramePayload(const uint8_t* const mem_buf, - const Frame* const frame, - size_t* const data_size) { - *data_size = 0; - if (frame != NULL) { - const ChunkData* const image = frame->img_components_; - const ChunkData* const alpha = frame->img_components_ + 1; - size_t start_offset = image->offset_; - *data_size = image->size_; - - // if alpha exists it precedes image, update the size allowing for - // intervening chunks. - if (alpha->size_ > 0) { - const size_t inter_size = (image->offset_ > 0) - ? image->offset_ - (alpha->offset_ + alpha->size_) - : 0; - start_offset = alpha->offset_; - *data_size += alpha->size_ + inter_size; - } - return mem_buf + start_offset; - } - return NULL; -} - -// Create a whole 'frame' from VP8 (+ alpha) or lossless. -static int SynthesizeFrame(const WebPDemuxer* const dmux, - const Frame* const first_frame, - int tile_num, WebPIterator* const iter) { - const uint8_t* const mem_buf = dmux->mem_.buf_; - int num_tiles; - size_t payload_size = 0; - const Frame* const tile = GetTile(first_frame, tile_num, &num_tiles); - const uint8_t* const payload = GetFramePayload(mem_buf, tile, &payload_size); - if (payload == NULL) return 0; - - iter->frame_num_ = first_frame->frame_num_; - iter->num_frames_ = dmux->num_frames_; - iter->tile_num_ = tile_num; - iter->num_tiles_ = num_tiles; - iter->x_offset_ = tile->x_offset_; - iter->y_offset_ = tile->y_offset_; - iter->width_ = tile->width_; - iter->height_ = tile->height_; - iter->duration_ = tile->duration_; - iter->complete_ = tile->complete_; - iter->tile_.bytes_ = payload; - iter->tile_.size_ = payload_size; - // TODO(jzern): adjust offsets for 'TILE's embedded in 'FRM 's - return 1; -} - -static int SetFrame(int frame_num, WebPIterator* const iter) { - const Frame* frame; - const WebPDemuxer* const dmux = (WebPDemuxer*)iter->private_; - if (dmux == NULL || frame_num < 0) return 0; - if (frame_num > dmux->num_frames_) return 0; - if (frame_num == 0) frame_num = dmux->num_frames_; - - frame = GetFrame(dmux, frame_num); - return SynthesizeFrame(dmux, frame, 1, iter); -} - -int WebPDemuxGetFrame(const WebPDemuxer* dmux, int frame, WebPIterator* iter) { - if (iter == NULL) return 0; - - memset(iter, 0, sizeof(*iter)); - iter->private_ = (void*)dmux; - return SetFrame(frame, iter); -} - -int WebPDemuxNextFrame(WebPIterator* iter) { - if (iter == NULL) return 0; - return SetFrame(iter->frame_num_ + 1, iter); -} - -int WebPDemuxPrevFrame(WebPIterator* iter) { - if (iter == NULL) return 0; - if (iter->frame_num_ <= 1) return 0; - return SetFrame(iter->frame_num_ - 1, iter); -} - -int WebPDemuxSelectTile(WebPIterator* iter, int tile) { - if (iter != NULL && iter->private_ != NULL && tile > 0) { - const WebPDemuxer* const dmux = (WebPDemuxer*)iter->private_; - const Frame* const frame = GetFrame(dmux, iter->frame_num_); - if (frame == NULL) return 0; - - return SynthesizeFrame(dmux, frame, tile, iter); - } - return 0; -} - -void WebPDemuxReleaseIterator(WebPIterator* iter) { - (void)iter; -} - -// ----------------------------------------------------------------------------- -// Chunk iteration - -static int ChunkCount(const WebPDemuxer* const dmux, const char fourcc[4]) { - const uint8_t* const mem_buf = dmux->mem_.buf_; - const Chunk* c; - int count = 0; - for (c = dmux->chunks_; c != NULL; c = c->next_) { - const uint8_t* const header = mem_buf + c->data_.offset_; - if (!memcmp(header, fourcc, TAG_SIZE)) ++count; - } - return count; -} - -static const Chunk* GetChunk(const WebPDemuxer* const dmux, - const char fourcc[4], int chunk_num) { - const uint8_t* const mem_buf = dmux->mem_.buf_; - const Chunk* c; - int count = 0; - for (c = dmux->chunks_; c != NULL; c = c->next_) { - const uint8_t* const header = mem_buf + c->data_.offset_; - if (!memcmp(header, fourcc, TAG_SIZE)) ++count; - if (count == chunk_num) break; - } - return c; -} - -static int SetChunk(const char fourcc[4], int chunk_num, - WebPChunkIterator* const iter) { - const WebPDemuxer* const dmux = (WebPDemuxer*)iter->private_; - int count; - - if (dmux == NULL || fourcc == NULL || chunk_num < 0) return 0; - count = ChunkCount(dmux, fourcc); - if (count == 0) return 0; - if (chunk_num == 0) chunk_num = count; - - if (chunk_num <= count) { - const uint8_t* const mem_buf = dmux->mem_.buf_; - const Chunk* const chunk = GetChunk(dmux, fourcc, chunk_num); - iter->chunk_.bytes_ = mem_buf + chunk->data_.offset_ + CHUNK_HEADER_SIZE; - iter->chunk_.size_ = chunk->data_.size_ - CHUNK_HEADER_SIZE; - iter->num_chunks_ = count; - iter->chunk_num_ = chunk_num; - return 1; - } - return 0; -} - -int WebPDemuxGetChunk(const WebPDemuxer* dmux, - const char fourcc[4], int chunk_num, - WebPChunkIterator* iter) { - if (iter == NULL) return 0; - - memset(iter, 0, sizeof(*iter)); - iter->private_ = (void*)dmux; - return SetChunk(fourcc, chunk_num, iter); -} - -int WebPDemuxNextChunk(WebPChunkIterator* iter) { - if (iter != NULL) { - const char* const fourcc = - (const char*)iter->chunk_.bytes_ - CHUNK_HEADER_SIZE; - return SetChunk(fourcc, iter->chunk_num_ + 1, iter); - } - return 0; -} - -int WebPDemuxPrevChunk(WebPChunkIterator* iter) { - if (iter != NULL && iter->chunk_num_ > 1) { - const char* const fourcc = - (const char*)iter->chunk_.bytes_ - CHUNK_HEADER_SIZE; - return SetChunk(fourcc, iter->chunk_num_ - 1, iter); - } - return 0; -} - -void WebPDemuxReleaseChunkIterator(WebPChunkIterator* iter) { - (void)iter; -} - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif diff --git a/external/libwebp/mux/muxedit.c b/external/libwebp/mux/muxedit.c deleted file mode 100644 index 08629d4ae2..0000000000 --- a/external/libwebp/mux/muxedit.c +++ /dev/null @@ -1,712 +0,0 @@ -// Copyright 2011 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Set and delete APIs for mux. -// -// Authors: Urvang (urvang@google.com) -// Vikas (vikasa@google.com) - -#include <assert.h> -#include "./muxi.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -//------------------------------------------------------------------------------ -// Life of a mux object. - -static void MuxInit(WebPMux* const mux) { - if (mux == NULL) return; - memset(mux, 0, sizeof(*mux)); -} - -WebPMux* WebPNewInternal(int version) { - if (WEBP_ABI_IS_INCOMPATIBLE(version, WEBP_MUX_ABI_VERSION)) { - return NULL; - } else { - WebPMux* const mux = (WebPMux*)malloc(sizeof(WebPMux)); - // If mux is NULL MuxInit is a noop. - MuxInit(mux); - return mux; - } -} - -static void DeleteAllChunks(WebPChunk** const chunk_list) { - while (*chunk_list) { - *chunk_list = ChunkDelete(*chunk_list); - } -} - -static void MuxRelease(WebPMux* const mux) { - if (mux == NULL) return; - MuxImageDeleteAll(&mux->images_); - DeleteAllChunks(&mux->vp8x_); - DeleteAllChunks(&mux->iccp_); - DeleteAllChunks(&mux->loop_); - DeleteAllChunks(&mux->meta_); - DeleteAllChunks(&mux->unknown_); -} - -void WebPMuxDelete(WebPMux* mux) { - // If mux is NULL MuxRelease is a noop. - MuxRelease(mux); - free(mux); -} - -//------------------------------------------------------------------------------ -// Helper method(s). - -// Handy MACRO, makes MuxSet() very symmetric to MuxGet(). -#define SWITCH_ID_LIST(INDEX, LIST) \ - if (idx == (INDEX)) { \ - err = ChunkAssignData(&chunk, data, copy_data, kChunks[(INDEX)].tag); \ - if (err == WEBP_MUX_OK) { \ - err = ChunkSetNth(&chunk, (LIST), nth); \ - } \ - return err; \ - } - -static WebPMuxError MuxSet(WebPMux* const mux, CHUNK_INDEX idx, uint32_t nth, - const WebPData* const data, int copy_data) { - WebPChunk chunk; - WebPMuxError err = WEBP_MUX_NOT_FOUND; - assert(mux != NULL); - assert(!IsWPI(kChunks[idx].id)); - - ChunkInit(&chunk); - SWITCH_ID_LIST(IDX_VP8X, &mux->vp8x_); - SWITCH_ID_LIST(IDX_ICCP, &mux->iccp_); - SWITCH_ID_LIST(IDX_LOOP, &mux->loop_); - SWITCH_ID_LIST(IDX_META, &mux->meta_); - if (idx == IDX_UNKNOWN && data->size_ > TAG_SIZE) { - // For raw-data unknown chunk, the first four bytes should be the tag to be - // used for the chunk. - const WebPData tmp = { data->bytes_ + TAG_SIZE, data->size_ - TAG_SIZE }; - err = ChunkAssignData(&chunk, &tmp, copy_data, GetLE32(data->bytes_ + 0)); - if (err == WEBP_MUX_OK) - err = ChunkSetNth(&chunk, &mux->unknown_, nth); - } - return err; -} -#undef SWITCH_ID_LIST - -static WebPMuxError MuxAddChunk(WebPMux* const mux, uint32_t nth, uint32_t tag, - const uint8_t* data, size_t size, - int copy_data) { - const CHUNK_INDEX idx = ChunkGetIndexFromTag(tag); - const WebPData chunk_data = { data, size }; - assert(mux != NULL); - assert(size <= MAX_CHUNK_PAYLOAD); - assert(idx != IDX_NIL); - return MuxSet(mux, idx, nth, &chunk_data, copy_data); -} - -// Create data for frame/tile given image data, offsets and duration. -static WebPMuxError CreateFrameTileData(const WebPData* const image, - int x_offset, int y_offset, - int duration, int is_lossless, - int is_frame, - WebPData* const frame_tile) { - int width; - int height; - uint8_t* frame_tile_bytes; - const size_t frame_tile_size = kChunks[is_frame ? IDX_FRAME : IDX_TILE].size; - - const int ok = is_lossless ? - VP8LGetInfo(image->bytes_, image->size_, &width, &height, NULL) : - VP8GetInfo(image->bytes_, image->size_, image->size_, &width, &height); - if (!ok) return WEBP_MUX_INVALID_ARGUMENT; - - assert(width > 0 && height > 0 && duration > 0); - // Note: assertion on upper bounds is done in PutLE24(). - - frame_tile_bytes = (uint8_t*)malloc(frame_tile_size); - if (frame_tile_bytes == NULL) return WEBP_MUX_MEMORY_ERROR; - - PutLE24(frame_tile_bytes + 0, x_offset / 2); - PutLE24(frame_tile_bytes + 3, y_offset / 2); - - if (is_frame) { - PutLE24(frame_tile_bytes + 6, width - 1); - PutLE24(frame_tile_bytes + 9, height - 1); - PutLE24(frame_tile_bytes + 12, duration - 1); - } - - frame_tile->bytes_ = frame_tile_bytes; - frame_tile->size_ = frame_tile_size; - return WEBP_MUX_OK; -} - -// Outputs image data given a bitstream. The bitstream can either be a -// single-image WebP file or raw VP8/VP8L data. -// Also outputs 'is_lossless' to be true if the given bitstream is lossless. -static WebPMuxError GetImageData(const WebPData* const bitstream, - WebPData* const image, WebPData* const alpha, - int* const is_lossless) { - WebPDataInit(alpha); // Default: no alpha. - if (bitstream->size_ < TAG_SIZE || - memcmp(bitstream->bytes_, "RIFF", TAG_SIZE)) { - // It is NOT webp file data. Return input data as is. - *image = *bitstream; - } else { - // It is webp file data. Extract image data from it. - const WebPMuxImage* wpi; - WebPMux* const mux = WebPMuxCreate(bitstream, 0); - if (mux == NULL) return WEBP_MUX_BAD_DATA; - wpi = mux->images_; - assert(wpi != NULL && wpi->img_ != NULL); - *image = wpi->img_->data_; - if (wpi->alpha_ != NULL) { - *alpha = wpi->alpha_->data_; - } - WebPMuxDelete(mux); - } - *is_lossless = VP8LCheckSignature(image->bytes_, image->size_); - return WEBP_MUX_OK; -} - -static WebPMuxError DeleteChunks(WebPChunk** chunk_list, uint32_t tag) { - WebPMuxError err = WEBP_MUX_NOT_FOUND; - assert(chunk_list); - while (*chunk_list) { - WebPChunk* const chunk = *chunk_list; - if (chunk->tag_ == tag) { - *chunk_list = ChunkDelete(chunk); - err = WEBP_MUX_OK; - } else { - chunk_list = &chunk->next_; - } - } - return err; -} - -static WebPMuxError MuxDeleteAllNamedData(WebPMux* const mux, CHUNK_INDEX idx) { - const WebPChunkId id = kChunks[idx].id; - WebPChunk** chunk_list; - - if (mux == NULL) return WEBP_MUX_INVALID_ARGUMENT; - if (IsWPI(id)) return WEBP_MUX_INVALID_ARGUMENT; - - chunk_list = MuxGetChunkListFromId(mux, id); - if (chunk_list == NULL) return WEBP_MUX_INVALID_ARGUMENT; - - return DeleteChunks(chunk_list, kChunks[idx].tag); -} - -static WebPMuxError DeleteLoopCount(WebPMux* const mux) { - return MuxDeleteAllNamedData(mux, IDX_LOOP); -} - -//------------------------------------------------------------------------------ -// Set API(s). - -WebPMuxError WebPMuxSetImage(WebPMux* mux, - const WebPData* bitstream, int copy_data) { - WebPMuxError err; - WebPChunk chunk; - WebPMuxImage wpi; - WebPData image; - WebPData alpha; - int is_lossless; - int image_tag; - - if (mux == NULL || bitstream == NULL || bitstream->bytes_ == NULL || - bitstream->size_ > MAX_CHUNK_PAYLOAD) { - return WEBP_MUX_INVALID_ARGUMENT; - } - - // If given data is for a whole webp file, - // extract only the VP8/VP8L data from it. - err = GetImageData(bitstream, &image, &alpha, &is_lossless); - if (err != WEBP_MUX_OK) return err; - image_tag = is_lossless ? kChunks[IDX_VP8L].tag : kChunks[IDX_VP8].tag; - - // Delete the existing images. - MuxImageDeleteAll(&mux->images_); - - MuxImageInit(&wpi); - - if (alpha.bytes_ != NULL) { // Add alpha chunk. - ChunkInit(&chunk); - err = ChunkAssignData(&chunk, &alpha, copy_data, kChunks[IDX_ALPHA].tag); - if (err != WEBP_MUX_OK) goto Err; - err = ChunkSetNth(&chunk, &wpi.alpha_, 1); - if (err != WEBP_MUX_OK) goto Err; - } - - // Add image chunk. - ChunkInit(&chunk); - err = ChunkAssignData(&chunk, &image, copy_data, image_tag); - if (err != WEBP_MUX_OK) goto Err; - err = ChunkSetNth(&chunk, &wpi.img_, 1); - if (err != WEBP_MUX_OK) goto Err; - - // Add this image to mux. - err = MuxImagePush(&wpi, &mux->images_); - if (err != WEBP_MUX_OK) goto Err; - - // All OK. - return WEBP_MUX_OK; - - Err: - // Something bad happened. - ChunkRelease(&chunk); - MuxImageRelease(&wpi); - return err; -} - -WebPMuxError WebPMuxSetMetadata(WebPMux* mux, const WebPData* metadata, - int copy_data) { - WebPMuxError err; - - if (mux == NULL || metadata == NULL || metadata->bytes_ == NULL || - metadata->size_ > MAX_CHUNK_PAYLOAD) { - return WEBP_MUX_INVALID_ARGUMENT; - } - - // Delete the existing metadata chunk(s). - err = WebPMuxDeleteMetadata(mux); - if (err != WEBP_MUX_OK && err != WEBP_MUX_NOT_FOUND) return err; - - // Add the given metadata chunk. - return MuxSet(mux, IDX_META, 1, metadata, copy_data); -} - -WebPMuxError WebPMuxSetColorProfile(WebPMux* mux, const WebPData* color_profile, - int copy_data) { - WebPMuxError err; - - if (mux == NULL || color_profile == NULL || color_profile->bytes_ == NULL || - color_profile->size_ > MAX_CHUNK_PAYLOAD) { - return WEBP_MUX_INVALID_ARGUMENT; - } - - // Delete the existing ICCP chunk(s). - err = WebPMuxDeleteColorProfile(mux); - if (err != WEBP_MUX_OK && err != WEBP_MUX_NOT_FOUND) return err; - - // Add the given ICCP chunk. - return MuxSet(mux, IDX_ICCP, 1, color_profile, copy_data); -} - -WebPMuxError WebPMuxSetLoopCount(WebPMux* mux, int loop_count) { - WebPMuxError err; - uint8_t* data = NULL; - - if (mux == NULL) return WEBP_MUX_INVALID_ARGUMENT; - if (loop_count >= MAX_LOOP_COUNT) return WEBP_MUX_INVALID_ARGUMENT; - - // Delete the existing LOOP chunk(s). - err = DeleteLoopCount(mux); - if (err != WEBP_MUX_OK && err != WEBP_MUX_NOT_FOUND) return err; - - // Add the given loop count. - data = (uint8_t*)malloc(kChunks[IDX_LOOP].size); - if (data == NULL) return WEBP_MUX_MEMORY_ERROR; - - PutLE16(data, loop_count); - err = MuxAddChunk(mux, 1, kChunks[IDX_LOOP].tag, data, - kChunks[IDX_LOOP].size, 1); - free(data); - return err; -} - -static WebPMuxError MuxPushFrameTileInternal( - WebPMux* const mux, const WebPData* const bitstream, int x_offset, - int y_offset, int duration, int copy_data, uint32_t tag) { - WebPChunk chunk; - WebPData image; - WebPData alpha; - WebPMuxImage wpi; - WebPMuxError err; - WebPData frame_tile; - const int is_frame = (tag == kChunks[IDX_FRAME].tag) ? 1 : 0; - int is_lossless; - int image_tag; - - // Sanity checks. - if (mux == NULL || bitstream == NULL || bitstream->bytes_ == NULL || - bitstream->size_ > MAX_CHUNK_PAYLOAD) { - return WEBP_MUX_INVALID_ARGUMENT; - } - if (x_offset < 0 || x_offset >= MAX_POSITION_OFFSET || - y_offset < 0 || y_offset >= MAX_POSITION_OFFSET || - duration <= 0 || duration > MAX_DURATION) { - return WEBP_MUX_INVALID_ARGUMENT; - } - - // Snap offsets to even positions. - x_offset &= ~1; - y_offset &= ~1; - - // If given data is for a whole webp file, - // extract only the VP8/VP8L data from it. - err = GetImageData(bitstream, &image, &alpha, &is_lossless); - if (err != WEBP_MUX_OK) return err; - image_tag = is_lossless ? kChunks[IDX_VP8L].tag : kChunks[IDX_VP8].tag; - - WebPDataInit(&frame_tile); - ChunkInit(&chunk); - MuxImageInit(&wpi); - - if (alpha.bytes_ != NULL) { - // Add alpha chunk. - err = ChunkAssignData(&chunk, &alpha, copy_data, kChunks[IDX_ALPHA].tag); - if (err != WEBP_MUX_OK) goto Err; - err = ChunkSetNth(&chunk, &wpi.alpha_, 1); - if (err != WEBP_MUX_OK) goto Err; - ChunkInit(&chunk); // chunk owned by wpi.alpha_ now. - } - - // Add image chunk. - err = ChunkAssignData(&chunk, &image, copy_data, image_tag); - if (err != WEBP_MUX_OK) goto Err; - err = ChunkSetNth(&chunk, &wpi.img_, 1); - if (err != WEBP_MUX_OK) goto Err; - ChunkInit(&chunk); // chunk owned by wpi.img_ now. - - // Create frame/tile data. - err = CreateFrameTileData(&image, x_offset, y_offset, duration, is_lossless, - is_frame, &frame_tile); - if (err != WEBP_MUX_OK) goto Err; - - // Add frame/tile chunk (with copy_data = 1). - err = ChunkAssignData(&chunk, &frame_tile, 1, tag); - if (err != WEBP_MUX_OK) goto Err; - WebPDataClear(&frame_tile); - err = ChunkSetNth(&chunk, &wpi.header_, 1); - if (err != WEBP_MUX_OK) goto Err; - ChunkInit(&chunk); // chunk owned by wpi.header_ now. - - // Add this WebPMuxImage to mux. - err = MuxImagePush(&wpi, &mux->images_); - if (err != WEBP_MUX_OK) goto Err; - - // All is well. - return WEBP_MUX_OK; - - Err: // Something bad happened. - WebPDataClear(&frame_tile); - ChunkRelease(&chunk); - MuxImageRelease(&wpi); - return err; -} - -WebPMuxError WebPMuxPushFrame(WebPMux* mux, const WebPData* bitstream, - int x_offset, int y_offset, - int duration, int copy_data) { - return MuxPushFrameTileInternal(mux, bitstream, x_offset, y_offset, - duration, copy_data, kChunks[IDX_FRAME].tag); -} - -WebPMuxError WebPMuxPushTile(WebPMux* mux, const WebPData* bitstream, - int x_offset, int y_offset, - int copy_data) { - return MuxPushFrameTileInternal(mux, bitstream, x_offset, y_offset, - 1 /* unused duration */, copy_data, - kChunks[IDX_TILE].tag); -} - -//------------------------------------------------------------------------------ -// Delete API(s). - -WebPMuxError WebPMuxDeleteImage(WebPMux* mux) { - WebPMuxError err; - - if (mux == NULL) return WEBP_MUX_INVALID_ARGUMENT; - - err = MuxValidateForImage(mux); - if (err != WEBP_MUX_OK) return err; - - // All well, delete image. - MuxImageDeleteAll(&mux->images_); - return WEBP_MUX_OK; -} - -WebPMuxError WebPMuxDeleteMetadata(WebPMux* mux) { - return MuxDeleteAllNamedData(mux, IDX_META); -} - -WebPMuxError WebPMuxDeleteColorProfile(WebPMux* mux) { - return MuxDeleteAllNamedData(mux, IDX_ICCP); -} - -static WebPMuxError DeleteFrameTileInternal(WebPMux* const mux, uint32_t nth, - CHUNK_INDEX idx) { - const WebPChunkId id = kChunks[idx].id; - if (mux == NULL) return WEBP_MUX_INVALID_ARGUMENT; - - assert(idx == IDX_FRAME || idx == IDX_TILE); - return MuxImageDeleteNth(&mux->images_, nth, id); -} - -WebPMuxError WebPMuxDeleteFrame(WebPMux* mux, uint32_t nth) { - return DeleteFrameTileInternal(mux, nth, IDX_FRAME); -} - -WebPMuxError WebPMuxDeleteTile(WebPMux* mux, uint32_t nth) { - return DeleteFrameTileInternal(mux, nth, IDX_TILE); -} - -//------------------------------------------------------------------------------ -// Assembly of the WebP RIFF file. - -static WebPMuxError GetFrameTileInfo(const WebPChunk* const frame_tile_chunk, - int* const x_offset, int* const y_offset, - int* const duration) { - const uint32_t tag = frame_tile_chunk->tag_; - const int is_frame = (tag == kChunks[IDX_FRAME].tag); - const WebPData* const data = &frame_tile_chunk->data_; - const size_t expected_data_size = - is_frame ? FRAME_CHUNK_SIZE : TILE_CHUNK_SIZE; - assert(frame_tile_chunk != NULL); - assert(tag == kChunks[IDX_FRAME].tag || tag == kChunks[IDX_TILE].tag); - if (data->size_ != expected_data_size) return WEBP_MUX_INVALID_ARGUMENT; - - *x_offset = 2 * GetLE24(data->bytes_ + 0); - *y_offset = 2 * GetLE24(data->bytes_ + 3); - if (is_frame) *duration = 1 + GetLE24(data->bytes_ + 12); - return WEBP_MUX_OK; -} - -WebPMuxError MuxGetImageWidthHeight(const WebPChunk* const image_chunk, - int* const width, int* const height) { - const uint32_t tag = image_chunk->tag_; - const WebPData* const data = &image_chunk->data_; - int w, h; - int ok; - assert(image_chunk != NULL); - assert(tag == kChunks[IDX_VP8].tag || tag == kChunks[IDX_VP8L].tag); - ok = (tag == kChunks[IDX_VP8].tag) ? - VP8GetInfo(data->bytes_, data->size_, data->size_, &w, &h) : - VP8LGetInfo(data->bytes_, data->size_, &w, &h, NULL); - if (ok) { - *width = w; - *height = h; - return WEBP_MUX_OK; - } else { - return WEBP_MUX_BAD_DATA; - } -} - -static WebPMuxError GetImageInfo(const WebPMuxImage* const wpi, - int* const x_offset, int* const y_offset, - int* const duration, - int* const width, int* const height) { - const WebPChunk* const image_chunk = wpi->img_; - const WebPChunk* const frame_tile_chunk = wpi->header_; - - // Get offsets and duration from FRM/TILE chunk. - const WebPMuxError err = - GetFrameTileInfo(frame_tile_chunk, x_offset, y_offset, duration); - if (err != WEBP_MUX_OK) return err; - - // Get width and height from VP8/VP8L chunk. - return MuxGetImageWidthHeight(image_chunk, width, height); -} - -static WebPMuxError GetImageCanvasWidthHeight( - const WebPMux* const mux, uint32_t flags, - int* const width, int* const height) { - WebPMuxImage* wpi = NULL; - assert(mux != NULL); - assert(width != NULL && height != NULL); - - wpi = mux->images_; - assert(wpi != NULL); - assert(wpi->img_ != NULL); - - if (wpi->next_) { - int max_x = 0; - int max_y = 0; - int64_t image_area = 0; - // Aggregate the bounding box for animation frames & tiled images. - for (; wpi != NULL; wpi = wpi->next_) { - int x_offset, y_offset, duration, w, h; - const WebPMuxError err = GetImageInfo(wpi, &x_offset, &y_offset, - &duration, &w, &h); - const int max_x_pos = x_offset + w; - const int max_y_pos = y_offset + h; - if (err != WEBP_MUX_OK) return err; - assert(x_offset < MAX_POSITION_OFFSET); - assert(y_offset < MAX_POSITION_OFFSET); - - if (max_x_pos > max_x) max_x = max_x_pos; - if (max_y_pos > max_y) max_y = max_y_pos; - image_area += w * h; - } - *width = max_x; - *height = max_y; - // Crude check to validate that there are no image overlaps/holes for tile - // images. Check that the aggregated image area for individual tiles exactly - // matches the image area of the constructed canvas. However, the area-match - // is necessary but not sufficient condition. - if ((flags & TILE_FLAG) && (image_area != (max_x * max_y))) { - *width = 0; - *height = 0; - return WEBP_MUX_INVALID_ARGUMENT; - } - } else { - // For a single image, extract the width & height from VP8/VP8L image-data. - int w, h; - const WebPChunk* const image_chunk = wpi->img_; - const WebPMuxError err = MuxGetImageWidthHeight(image_chunk, &w, &h); - if (err != WEBP_MUX_OK) return err; - *width = w; - *height = h; - } - return WEBP_MUX_OK; -} - -// VP8X format: -// Total Size : 10, -// Flags : 4 bytes, -// Width : 3 bytes, -// Height : 3 bytes. -static WebPMuxError CreateVP8XChunk(WebPMux* const mux) { - WebPMuxError err = WEBP_MUX_OK; - uint32_t flags = 0; - int width = 0; - int height = 0; - uint8_t data[VP8X_CHUNK_SIZE]; - const size_t data_size = VP8X_CHUNK_SIZE; - const WebPMuxImage* images = NULL; - - assert(mux != NULL); - images = mux->images_; // First image. - if (images == NULL || images->img_ == NULL || - images->img_->data_.bytes_ == NULL) { - return WEBP_MUX_INVALID_ARGUMENT; - } - - // If VP8X chunk(s) is(are) already present, remove them (and later add new - // VP8X chunk with updated flags). - err = MuxDeleteAllNamedData(mux, IDX_VP8X); - if (err != WEBP_MUX_OK && err != WEBP_MUX_NOT_FOUND) return err; - - // Set flags. - if (mux->iccp_ != NULL && mux->iccp_->data_.bytes_ != NULL) { - flags |= ICCP_FLAG; - } - - if (mux->meta_ != NULL && mux->meta_->data_.bytes_ != NULL) { - flags |= META_FLAG; - } - - if (images->header_ != NULL) { - if (images->header_->tag_ == kChunks[IDX_TILE].tag) { - // This is a tiled image. - flags |= TILE_FLAG; - } else if (images->header_->tag_ == kChunks[IDX_FRAME].tag) { - // This is an image with animation. - flags |= ANIMATION_FLAG; - } - } - - if (MuxImageCount(images, WEBP_CHUNK_ALPHA) > 0) { - flags |= ALPHA_FLAG; // Some images have an alpha channel. - } - - if (flags == 0) { - // For Simple Image, VP8X chunk should not be added. - return WEBP_MUX_OK; - } - - err = GetImageCanvasWidthHeight(mux, flags, &width, &height); - if (err != WEBP_MUX_OK) return err; - - if (width <= 0 || height <= 0) { - return WEBP_MUX_INVALID_ARGUMENT; - } - if (width > MAX_CANVAS_SIZE || height > MAX_CANVAS_SIZE) { - return WEBP_MUX_INVALID_ARGUMENT; - } - - if (MuxHasLosslessImages(images)) { - // We have a file with a VP8X chunk having some lossless images. - // As lossless images implicitly contain alpha, force ALPHA_FLAG to be true. - // Note: This 'flags' update must NOT be done for a lossless image - // without a VP8X chunk! - flags |= ALPHA_FLAG; - } - - PutLE32(data + 0, flags); // VP8X chunk flags. - PutLE24(data + 4, width - 1); // canvas width. - PutLE24(data + 7, height - 1); // canvas height. - - err = MuxAddChunk(mux, 1, kChunks[IDX_VP8X].tag, data, data_size, 1); - return err; -} - -WebPMuxError WebPMuxAssemble(WebPMux* mux, WebPData* assembled_data) { - size_t size = 0; - uint8_t* data = NULL; - uint8_t* dst = NULL; - int num_frames; - int num_loop_chunks; - WebPMuxError err; - - if (mux == NULL || assembled_data == NULL) { - return WEBP_MUX_INVALID_ARGUMENT; - } - - // Remove LOOP chunk if unnecessary. - err = WebPMuxNumChunks(mux, kChunks[IDX_LOOP].id, &num_loop_chunks); - if (err != WEBP_MUX_OK) return err; - if (num_loop_chunks >= 1) { - err = WebPMuxNumChunks(mux, kChunks[IDX_FRAME].id, &num_frames); - if (err != WEBP_MUX_OK) return err; - if (num_frames == 0) { - err = DeleteLoopCount(mux); - if (err != WEBP_MUX_OK) return err; - } - } - - // Create VP8X chunk. - err = CreateVP8XChunk(mux); - if (err != WEBP_MUX_OK) return err; - - // Allocate data. - size = ChunksListDiskSize(mux->vp8x_) + ChunksListDiskSize(mux->iccp_) - + ChunksListDiskSize(mux->loop_) + MuxImageListDiskSize(mux->images_) - + ChunksListDiskSize(mux->meta_) + ChunksListDiskSize(mux->unknown_) - + RIFF_HEADER_SIZE; - - data = (uint8_t*)malloc(size); - if (data == NULL) return WEBP_MUX_MEMORY_ERROR; - - // Emit header & chunks. - dst = MuxEmitRiffHeader(data, size); - dst = ChunkListEmit(mux->vp8x_, dst); - dst = ChunkListEmit(mux->iccp_, dst); - dst = ChunkListEmit(mux->loop_, dst); - dst = MuxImageListEmit(mux->images_, dst); - dst = ChunkListEmit(mux->meta_, dst); - dst = ChunkListEmit(mux->unknown_, dst); - assert(dst == data + size); - - // Validate mux. - err = MuxValidate(mux); - if (err != WEBP_MUX_OK) { - free(data); - data = NULL; - size = 0; - } - - // Finalize. - assembled_data->bytes_ = data; - assembled_data->size_ = size; - - return err; -} - -//------------------------------------------------------------------------------ - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif diff --git a/external/libwebp/mux/muxi.h b/external/libwebp/mux/muxi.h deleted file mode 100644 index edd8c368cd..0000000000 --- a/external/libwebp/mux/muxi.h +++ /dev/null @@ -1,271 +0,0 @@ -// Copyright 2011 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Internal header for mux library. -// -// Author: Urvang (urvang@google.com) - -#ifndef WEBP_MUX_MUXI_H_ -#define WEBP_MUX_MUXI_H_ - -#include <stdlib.h> -#include "../dec/vp8i.h" -#include "../dec/vp8li.h" -#include "../webp/format_constants.h" -#include "../webp/mux.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -//------------------------------------------------------------------------------ -// Defines and constants. - -// Chunk object. -typedef struct WebPChunk WebPChunk; -struct WebPChunk { - uint32_t tag_; - int owner_; // True if *data_ memory is owned internally. - // VP8X, Loop, and other internally created chunks - // like frame/tile are always owned. - WebPData data_; - WebPChunk* next_; -}; - -// MuxImage object. Store a full webp image (including frame/tile chunk, alpha -// chunk and VP8/VP8L chunk), -typedef struct WebPMuxImage WebPMuxImage; -struct WebPMuxImage { - WebPChunk* header_; // Corresponds to WEBP_CHUNK_FRAME/WEBP_CHUNK_TILE. - WebPChunk* alpha_; // Corresponds to WEBP_CHUNK_ALPHA. - WebPChunk* img_; // Corresponds to WEBP_CHUNK_IMAGE. - int is_partial_; // True if only some of the chunks are filled. - WebPMuxImage* next_; -}; - -// Main mux object. Stores data chunks. -struct WebPMux { - WebPMuxImage* images_; - WebPChunk* iccp_; - WebPChunk* meta_; - WebPChunk* loop_; - WebPChunk* vp8x_; - - WebPChunk* unknown_; -}; - -// CHUNK_INDEX enum: used for indexing within 'kChunks' (defined below) only. -// Note: the reason for having two enums ('WebPChunkId' and 'CHUNK_INDEX') is to -// allow two different chunks to have the same id (e.g. WebPChunkId -// 'WEBP_CHUNK_IMAGE' can correspond to CHUNK_INDEX 'IDX_VP8' or 'IDX_VP8L'). -typedef enum { - IDX_VP8X = 0, - IDX_ICCP, - IDX_LOOP, - IDX_FRAME, - IDX_TILE, - IDX_ALPHA, - IDX_VP8, - IDX_VP8L, - IDX_META, - IDX_UNKNOWN, - - IDX_NIL, - IDX_LAST_CHUNK -} CHUNK_INDEX; - -#define NIL_TAG 0x00000000u // To signal void chunk. - -#define MKFOURCC(a, b, c, d) ((uint32_t)(a) | (b) << 8 | (c) << 16 | (d) << 24) - -typedef struct { - uint32_t tag; - WebPChunkId id; - uint32_t size; -} ChunkInfo; - -extern const ChunkInfo kChunks[IDX_LAST_CHUNK]; - -//------------------------------------------------------------------------------ -// Helper functions. - -// Read 16, 24 or 32 bits stored in little-endian order. -static WEBP_INLINE int GetLE16(const uint8_t* const data) { - return (int)(data[0] << 0) | (data[1] << 8); -} - -static WEBP_INLINE int GetLE24(const uint8_t* const data) { - return GetLE16(data) | (data[2] << 16); -} - -static WEBP_INLINE uint32_t GetLE32(const uint8_t* const data) { - return (uint32_t)GetLE16(data) | (GetLE16(data + 2) << 16); -} - -// Store 16, 24 or 32 bits in little-endian order. -static WEBP_INLINE void PutLE16(uint8_t* const data, int val) { - assert(val < (1 << 16)); - data[0] = (val >> 0); - data[1] = (val >> 8); -} - -static WEBP_INLINE void PutLE24(uint8_t* const data, int val) { - assert(val < (1 << 24)); - PutLE16(data, val & 0xffff); - data[2] = (val >> 16); -} - -static WEBP_INLINE void PutLE32(uint8_t* const data, uint32_t val) { - PutLE16(data, (int)(val & 0xffff)); - PutLE16(data + 2, (int)(val >> 16)); -} - -static WEBP_INLINE size_t SizeWithPadding(size_t chunk_size) { - return CHUNK_HEADER_SIZE + ((chunk_size + 1) & ~1U); -} - -//------------------------------------------------------------------------------ -// Chunk object management. - -// Initialize. -void ChunkInit(WebPChunk* const chunk); - -// Get chunk index from chunk tag. Returns IDX_NIL if not found. -CHUNK_INDEX ChunkGetIndexFromTag(uint32_t tag); - -// Get chunk id from chunk tag. Returns WEBP_CHUNK_NIL if not found. -WebPChunkId ChunkGetIdFromTag(uint32_t tag); - -// Search for nth chunk with given 'tag' in the chunk list. -// nth = 0 means "last of the list". -WebPChunk* ChunkSearchList(WebPChunk* first, uint32_t nth, uint32_t tag); - -// Fill the chunk with the given data. -WebPMuxError ChunkAssignData(WebPChunk* chunk, const WebPData* const data, - int copy_data, uint32_t tag); - -// Sets 'chunk' at nth position in the 'chunk_list'. -// nth = 0 has the special meaning "last of the list". -WebPMuxError ChunkSetNth(const WebPChunk* chunk, WebPChunk** chunk_list, - uint32_t nth); - -// Releases chunk and returns chunk->next_. -WebPChunk* ChunkRelease(WebPChunk* const chunk); - -// Deletes given chunk & returns chunk->next_. -WebPChunk* ChunkDelete(WebPChunk* const chunk); - -// Size of a chunk including header and padding. -static WEBP_INLINE size_t ChunkDiskSize(const WebPChunk* chunk) { - const size_t data_size = chunk->data_.size_; - assert(data_size < MAX_CHUNK_PAYLOAD); - return SizeWithPadding(data_size); -} - -// Total size of a list of chunks. -size_t ChunksListDiskSize(const WebPChunk* chunk_list); - -// Write out the given list of chunks into 'dst'. -uint8_t* ChunkListEmit(const WebPChunk* chunk_list, uint8_t* dst); - -// Get the width & height of image stored in 'image_chunk'. -WebPMuxError MuxGetImageWidthHeight(const WebPChunk* const image_chunk, - int* const width, int* const height); - -//------------------------------------------------------------------------------ -// MuxImage object management. - -// Initialize. -void MuxImageInit(WebPMuxImage* const wpi); - -// Releases image 'wpi' and returns wpi->next. -WebPMuxImage* MuxImageRelease(WebPMuxImage* const wpi); - -// Delete image 'wpi' and return the next image in the list or NULL. -// 'wpi' can be NULL. -WebPMuxImage* MuxImageDelete(WebPMuxImage* const wpi); - -// Delete all images in 'wpi_list'. -void MuxImageDeleteAll(WebPMuxImage** const wpi_list); - -// Count number of images matching the given tag id in the 'wpi_list'. -int MuxImageCount(const WebPMuxImage* wpi_list, WebPChunkId id); - -// Check if given ID corresponds to an image related chunk. -static WEBP_INLINE int IsWPI(WebPChunkId id) { - switch (id) { - case WEBP_CHUNK_FRAME: - case WEBP_CHUNK_TILE: - case WEBP_CHUNK_ALPHA: - case WEBP_CHUNK_IMAGE: return 1; - default: return 0; - } -} - -// Get a reference to appropriate chunk list within an image given chunk tag. -static WEBP_INLINE WebPChunk** MuxImageGetListFromId( - const WebPMuxImage* const wpi, WebPChunkId id) { - assert(wpi != NULL); - switch (id) { - case WEBP_CHUNK_FRAME: - case WEBP_CHUNK_TILE: return (WebPChunk**)&wpi->header_; - case WEBP_CHUNK_ALPHA: return (WebPChunk**)&wpi->alpha_; - case WEBP_CHUNK_IMAGE: return (WebPChunk**)&wpi->img_; - default: return NULL; - } -} - -// Pushes 'wpi' at the end of 'wpi_list'. -WebPMuxError MuxImagePush(const WebPMuxImage* wpi, WebPMuxImage** wpi_list); - -// Delete nth image in the image list with given tag id. -WebPMuxError MuxImageDeleteNth(WebPMuxImage** wpi_list, uint32_t nth, - WebPChunkId id); - -// Get nth image in the image list with given tag id. -WebPMuxError MuxImageGetNth(const WebPMuxImage** wpi_list, uint32_t nth, - WebPChunkId id, WebPMuxImage** wpi); - -// Total size of the given image. -size_t MuxImageDiskSize(const WebPMuxImage* const wpi); - -// Total size of a list of images. -size_t MuxImageListDiskSize(const WebPMuxImage* wpi_list); - -// Write out the given image into 'dst'. -uint8_t* MuxImageEmit(const WebPMuxImage* const wpi, uint8_t* dst); - -// Write out the given list of images into 'dst'. -uint8_t* MuxImageListEmit(const WebPMuxImage* wpi_list, uint8_t* dst); - -//------------------------------------------------------------------------------ -// Helper methods for mux. - -// Checks if the given image list contains at least one lossless image. -int MuxHasLosslessImages(const WebPMuxImage* images); - -// Write out RIFF header into 'data', given total data size 'size'. -uint8_t* MuxEmitRiffHeader(uint8_t* const data, size_t size); - -// Returns the list where chunk with given ID is to be inserted in mux. -// Return value is NULL if this chunk should be inserted in mux->images_ list -// or if 'id' is not known. -WebPChunk** MuxGetChunkListFromId(const WebPMux* mux, WebPChunkId id); - -// Validates that the given mux has a single image. -WebPMuxError MuxValidateForImage(const WebPMux* const mux); - -// Validates the given mux object. -WebPMuxError MuxValidate(const WebPMux* const mux); - -//------------------------------------------------------------------------------ - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif - -#endif /* WEBP_MUX_MUXI_H_ */ diff --git a/external/libwebp/mux/muxinternal.c b/external/libwebp/mux/muxinternal.c deleted file mode 100644 index 6c3c4fe60a..0000000000 --- a/external/libwebp/mux/muxinternal.c +++ /dev/null @@ -1,576 +0,0 @@ -// Copyright 2011 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Internal objects and utils for mux. -// -// Authors: Urvang (urvang@google.com) -// Vikas (vikasa@google.com) - -#include <assert.h> -#include "./muxi.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -#define UNDEFINED_CHUNK_SIZE (-1) - -const ChunkInfo kChunks[] = { - { MKFOURCC('V', 'P', '8', 'X'), WEBP_CHUNK_VP8X, VP8X_CHUNK_SIZE }, - { MKFOURCC('I', 'C', 'C', 'P'), WEBP_CHUNK_ICCP, UNDEFINED_CHUNK_SIZE }, - { MKFOURCC('L', 'O', 'O', 'P'), WEBP_CHUNK_LOOP, LOOP_CHUNK_SIZE }, - { MKFOURCC('F', 'R', 'M', ' '), WEBP_CHUNK_FRAME, FRAME_CHUNK_SIZE }, - { MKFOURCC('T', 'I', 'L', 'E'), WEBP_CHUNK_TILE, TILE_CHUNK_SIZE }, - { MKFOURCC('A', 'L', 'P', 'H'), WEBP_CHUNK_ALPHA, UNDEFINED_CHUNK_SIZE }, - { MKFOURCC('V', 'P', '8', ' '), WEBP_CHUNK_IMAGE, UNDEFINED_CHUNK_SIZE }, - { MKFOURCC('V', 'P', '8', 'L'), WEBP_CHUNK_IMAGE, UNDEFINED_CHUNK_SIZE }, - { MKFOURCC('M', 'E', 'T', 'A'), WEBP_CHUNK_META, UNDEFINED_CHUNK_SIZE }, - { MKFOURCC('U', 'N', 'K', 'N'), WEBP_CHUNK_UNKNOWN, UNDEFINED_CHUNK_SIZE }, - - { NIL_TAG, WEBP_CHUNK_NIL, UNDEFINED_CHUNK_SIZE } -}; - -//------------------------------------------------------------------------------ -// Life of a chunk object. - -void ChunkInit(WebPChunk* const chunk) { - assert(chunk); - memset(chunk, 0, sizeof(*chunk)); - chunk->tag_ = NIL_TAG; -} - -WebPChunk* ChunkRelease(WebPChunk* const chunk) { - WebPChunk* next; - if (chunk == NULL) return NULL; - if (chunk->owner_) { - WebPDataClear(&chunk->data_); - } - next = chunk->next_; - ChunkInit(chunk); - return next; -} - -//------------------------------------------------------------------------------ -// Chunk misc methods. - -CHUNK_INDEX ChunkGetIndexFromTag(uint32_t tag) { - int i; - for (i = 0; kChunks[i].tag != NIL_TAG; ++i) { - if (tag == kChunks[i].tag) return i; - } - return IDX_NIL; -} - -WebPChunkId ChunkGetIdFromTag(uint32_t tag) { - int i; - for (i = 0; kChunks[i].tag != NIL_TAG; ++i) { - if (tag == kChunks[i].tag) return kChunks[i].id; - } - return WEBP_CHUNK_NIL; -} - -//------------------------------------------------------------------------------ -// Chunk search methods. - -// Returns next chunk in the chunk list with the given tag. -static WebPChunk* ChunkSearchNextInList(WebPChunk* chunk, uint32_t tag) { - while (chunk && chunk->tag_ != tag) { - chunk = chunk->next_; - } - return chunk; -} - -WebPChunk* ChunkSearchList(WebPChunk* first, uint32_t nth, uint32_t tag) { - uint32_t iter = nth; - first = ChunkSearchNextInList(first, tag); - if (!first) return NULL; - - while (--iter != 0) { - WebPChunk* next_chunk = ChunkSearchNextInList(first->next_, tag); - if (next_chunk == NULL) break; - first = next_chunk; - } - return ((nth > 0) && (iter > 0)) ? NULL : first; -} - -// Outputs a pointer to 'prev_chunk->next_', -// where 'prev_chunk' is the pointer to the chunk at position (nth - 1). -// Returns 1 if nth chunk was found, 0 otherwise. -static int ChunkSearchListToSet(WebPChunk** chunk_list, uint32_t nth, - WebPChunk*** const location) { - uint32_t count = 0; - assert(chunk_list); - *location = chunk_list; - - while (*chunk_list) { - WebPChunk* const cur_chunk = *chunk_list; - ++count; - if (count == nth) return 1; // Found. - chunk_list = &cur_chunk->next_; - *location = chunk_list; - } - - // *chunk_list is ok to be NULL if adding at last location. - return (nth == 0 || (count == nth - 1)) ? 1 : 0; -} - -//------------------------------------------------------------------------------ -// Chunk writer methods. - -WebPMuxError ChunkAssignData(WebPChunk* chunk, const WebPData* const data, - int copy_data, uint32_t tag) { - // For internally allocated chunks, always copy data & make it owner of data. - if (tag == kChunks[IDX_VP8X].tag || tag == kChunks[IDX_LOOP].tag) { - copy_data = 1; - } - - ChunkRelease(chunk); - - if (data != NULL) { - if (copy_data) { - // Copy data. - chunk->data_.bytes_ = (uint8_t*)malloc(data->size_); - if (chunk->data_.bytes_ == NULL) return WEBP_MUX_MEMORY_ERROR; - memcpy((uint8_t*)chunk->data_.bytes_, data->bytes_, data->size_); - chunk->data_.size_ = data->size_; - - // Chunk is owner of data. - chunk->owner_ = 1; - } else { - // Don't copy data. - chunk->data_ = *data; - } - } - - chunk->tag_ = tag; - - return WEBP_MUX_OK; -} - -WebPMuxError ChunkSetNth(const WebPChunk* chunk, WebPChunk** chunk_list, - uint32_t nth) { - WebPChunk* new_chunk; - - if (!ChunkSearchListToSet(chunk_list, nth, &chunk_list)) { - return WEBP_MUX_NOT_FOUND; - } - - new_chunk = (WebPChunk*)malloc(sizeof(*new_chunk)); - if (new_chunk == NULL) return WEBP_MUX_MEMORY_ERROR; - *new_chunk = *chunk; - new_chunk->next_ = *chunk_list; - *chunk_list = new_chunk; - return WEBP_MUX_OK; -} - -//------------------------------------------------------------------------------ -// Chunk deletion method(s). - -WebPChunk* ChunkDelete(WebPChunk* const chunk) { - WebPChunk* const next = ChunkRelease(chunk); - free(chunk); - return next; -} - -//------------------------------------------------------------------------------ -// Chunk serialization methods. - -size_t ChunksListDiskSize(const WebPChunk* chunk_list) { - size_t size = 0; - while (chunk_list) { - size += ChunkDiskSize(chunk_list); - chunk_list = chunk_list->next_; - } - return size; -} - -static uint8_t* ChunkEmit(const WebPChunk* const chunk, uint8_t* dst) { - const size_t chunk_size = chunk->data_.size_; - assert(chunk); - assert(chunk->tag_ != NIL_TAG); - PutLE32(dst + 0, chunk->tag_); - PutLE32(dst + TAG_SIZE, (uint32_t)chunk_size); - assert(chunk_size == (uint32_t)chunk_size); - memcpy(dst + CHUNK_HEADER_SIZE, chunk->data_.bytes_, chunk_size); - if (chunk_size & 1) - dst[CHUNK_HEADER_SIZE + chunk_size] = 0; // Add padding. - return dst + ChunkDiskSize(chunk); -} - -uint8_t* ChunkListEmit(const WebPChunk* chunk_list, uint8_t* dst) { - while (chunk_list) { - dst = ChunkEmit(chunk_list, dst); - chunk_list = chunk_list->next_; - } - return dst; -} - -//------------------------------------------------------------------------------ -// Manipulation of a WebPData object. - -void WebPDataInit(WebPData* webp_data) { - if (webp_data != NULL) { - memset(webp_data, 0, sizeof(*webp_data)); - } -} - -void WebPDataClear(WebPData* webp_data) { - if (webp_data != NULL) { - free((void*)webp_data->bytes_); - WebPDataInit(webp_data); - } -} - -int WebPDataCopy(const WebPData* src, WebPData* dst) { - if (src == NULL || dst == NULL) return 0; - - WebPDataInit(dst); - if (src->bytes_ != NULL && src->size_ != 0) { - dst->bytes_ = (uint8_t*)malloc(src->size_); - if (dst->bytes_ == NULL) return 0; - memcpy((void*)dst->bytes_, src->bytes_, src->size_); - dst->size_ = src->size_; - } - return 1; -} - -//------------------------------------------------------------------------------ -// Life of a MuxImage object. - -void MuxImageInit(WebPMuxImage* const wpi) { - assert(wpi); - memset(wpi, 0, sizeof(*wpi)); -} - -WebPMuxImage* MuxImageRelease(WebPMuxImage* const wpi) { - WebPMuxImage* next; - if (wpi == NULL) return NULL; - ChunkDelete(wpi->header_); - ChunkDelete(wpi->alpha_); - ChunkDelete(wpi->img_); - - next = wpi->next_; - MuxImageInit(wpi); - return next; -} - -//------------------------------------------------------------------------------ -// MuxImage search methods. - -int MuxImageCount(const WebPMuxImage* wpi_list, WebPChunkId id) { - int count = 0; - const WebPMuxImage* current; - for (current = wpi_list; current != NULL; current = current->next_) { - const WebPChunk* const wpi_chunk = *MuxImageGetListFromId(current, id); - if (wpi_chunk != NULL) { - const WebPChunkId wpi_chunk_id = ChunkGetIdFromTag(wpi_chunk->tag_); - if (wpi_chunk_id == id) ++count; - } - } - return count; -} - -// Outputs a pointer to 'prev_wpi->next_', -// where 'prev_wpi' is the pointer to the image at position (nth - 1). -// Returns 1 if nth image with given id was found, 0 otherwise. -static int SearchImageToGetOrDelete(WebPMuxImage** wpi_list, uint32_t nth, - WebPChunkId id, - WebPMuxImage*** const location) { - uint32_t count = 0; - assert(wpi_list); - *location = wpi_list; - - // Search makes sense only for the following. - assert(id == WEBP_CHUNK_FRAME || id == WEBP_CHUNK_TILE || - id == WEBP_CHUNK_IMAGE); - assert(id != WEBP_CHUNK_IMAGE || nth == 1); - - if (nth == 0) { - nth = MuxImageCount(*wpi_list, id); - if (nth == 0) return 0; // Not found. - } - - while (*wpi_list) { - WebPMuxImage* const cur_wpi = *wpi_list; - const WebPChunk* const wpi_chunk = *MuxImageGetListFromId(cur_wpi, id); - if (wpi_chunk != NULL) { - const WebPChunkId wpi_chunk_id = ChunkGetIdFromTag(wpi_chunk->tag_); - if (wpi_chunk_id == id) { - ++count; - if (count == nth) return 1; // Found. - } - } - wpi_list = &cur_wpi->next_; - *location = wpi_list; - } - return 0; // Not found. -} - -//------------------------------------------------------------------------------ -// MuxImage writer methods. - -WebPMuxError MuxImagePush(const WebPMuxImage* wpi, WebPMuxImage** wpi_list) { - WebPMuxImage* new_wpi; - - while (*wpi_list != NULL) { - WebPMuxImage* const cur_wpi = *wpi_list; - if (cur_wpi->next_ == NULL) break; - wpi_list = &cur_wpi->next_; - } - - new_wpi = (WebPMuxImage*)malloc(sizeof(*new_wpi)); - if (new_wpi == NULL) return WEBP_MUX_MEMORY_ERROR; - *new_wpi = *wpi; - new_wpi->next_ = NULL; - - if (*wpi_list != NULL) { - (*wpi_list)->next_ = new_wpi; - } else { - *wpi_list = new_wpi; - } - return WEBP_MUX_OK; -} - -//------------------------------------------------------------------------------ -// MuxImage deletion methods. - -WebPMuxImage* MuxImageDelete(WebPMuxImage* const wpi) { - // Delete the components of wpi. If wpi is NULL this is a noop. - WebPMuxImage* const next = MuxImageRelease(wpi); - free(wpi); - return next; -} - -void MuxImageDeleteAll(WebPMuxImage** const wpi_list) { - while (*wpi_list) { - *wpi_list = MuxImageDelete(*wpi_list); - } -} - -WebPMuxError MuxImageDeleteNth(WebPMuxImage** wpi_list, uint32_t nth, - WebPChunkId id) { - assert(wpi_list); - if (!SearchImageToGetOrDelete(wpi_list, nth, id, &wpi_list)) { - return WEBP_MUX_NOT_FOUND; - } - *wpi_list = MuxImageDelete(*wpi_list); - return WEBP_MUX_OK; -} - -//------------------------------------------------------------------------------ -// MuxImage reader methods. - -WebPMuxError MuxImageGetNth(const WebPMuxImage** wpi_list, uint32_t nth, - WebPChunkId id, WebPMuxImage** wpi) { - assert(wpi_list); - assert(wpi); - if (!SearchImageToGetOrDelete((WebPMuxImage**)wpi_list, nth, id, - (WebPMuxImage***)&wpi_list)) { - return WEBP_MUX_NOT_FOUND; - } - *wpi = (WebPMuxImage*)*wpi_list; - return WEBP_MUX_OK; -} - -//------------------------------------------------------------------------------ -// MuxImage serialization methods. - -// Size of an image. -size_t MuxImageDiskSize(const WebPMuxImage* const wpi) { - size_t size = 0; - if (wpi->header_ != NULL) size += ChunkDiskSize(wpi->header_); - if (wpi->alpha_ != NULL) size += ChunkDiskSize(wpi->alpha_); - if (wpi->img_ != NULL) size += ChunkDiskSize(wpi->img_); - return size; -} - -size_t MuxImageListDiskSize(const WebPMuxImage* wpi_list) { - size_t size = 0; - while (wpi_list) { - size += MuxImageDiskSize(wpi_list); - wpi_list = wpi_list->next_; - } - return size; -} - -uint8_t* MuxImageEmit(const WebPMuxImage* const wpi, uint8_t* dst) { - // Ordering of chunks to be emitted is strictly as follows: - // 1. Frame/Tile chunk (if present). - // 2. Alpha chunk (if present). - // 3. VP8/VP8L chunk. - assert(wpi); - if (wpi->header_ != NULL) dst = ChunkEmit(wpi->header_, dst); - if (wpi->alpha_ != NULL) dst = ChunkEmit(wpi->alpha_, dst); - if (wpi->img_ != NULL) dst = ChunkEmit(wpi->img_, dst); - return dst; -} - -uint8_t* MuxImageListEmit(const WebPMuxImage* wpi_list, uint8_t* dst) { - while (wpi_list) { - dst = MuxImageEmit(wpi_list, dst); - wpi_list = wpi_list->next_; - } - return dst; -} - -//------------------------------------------------------------------------------ -// Helper methods for mux. - -int MuxHasLosslessImages(const WebPMuxImage* images) { - while (images != NULL) { - assert(images->img_ != NULL); - if (images->img_->tag_ == kChunks[IDX_VP8L].tag) { - return 1; - } - images = images->next_; - } - return 0; -} - -uint8_t* MuxEmitRiffHeader(uint8_t* const data, size_t size) { - PutLE32(data + 0, MKFOURCC('R', 'I', 'F', 'F')); - PutLE32(data + TAG_SIZE, (uint32_t)size - CHUNK_HEADER_SIZE); - assert(size == (uint32_t)size); - PutLE32(data + TAG_SIZE + CHUNK_SIZE_BYTES, MKFOURCC('W', 'E', 'B', 'P')); - return data + RIFF_HEADER_SIZE; -} - -WebPChunk** MuxGetChunkListFromId(const WebPMux* mux, WebPChunkId id) { - assert(mux != NULL); - switch(id) { - case WEBP_CHUNK_VP8X: return (WebPChunk**)&mux->vp8x_; - case WEBP_CHUNK_ICCP: return (WebPChunk**)&mux->iccp_; - case WEBP_CHUNK_LOOP: return (WebPChunk**)&mux->loop_; - case WEBP_CHUNK_META: return (WebPChunk**)&mux->meta_; - case WEBP_CHUNK_UNKNOWN: return (WebPChunk**)&mux->unknown_; - default: return NULL; - } -} - -WebPMuxError MuxValidateForImage(const WebPMux* const mux) { - const int num_images = MuxImageCount(mux->images_, WEBP_CHUNK_IMAGE); - const int num_frames = MuxImageCount(mux->images_, WEBP_CHUNK_FRAME); - const int num_tiles = MuxImageCount(mux->images_, WEBP_CHUNK_TILE); - - if (num_images == 0) { - // No images in mux. - return WEBP_MUX_NOT_FOUND; - } else if (num_images == 1 && num_frames == 0 && num_tiles == 0) { - // Valid case (single image). - return WEBP_MUX_OK; - } else { - // Frame/Tile case OR an invalid mux. - return WEBP_MUX_INVALID_ARGUMENT; - } -} - -static int IsNotCompatible(int feature, int num_items) { - return (feature != 0) != (num_items > 0); -} - -#define NO_FLAG 0 - -// Test basic constraints: -// retrieval, maximum number of chunks by index (use -1 to skip) -// and feature incompatibility (use NO_FLAG to skip). -// On success returns WEBP_MUX_OK and stores the chunk count in *num. -static WebPMuxError ValidateChunk(const WebPMux* const mux, CHUNK_INDEX idx, - WebPFeatureFlags feature, - WebPFeatureFlags vp8x_flags, - int max, int* num) { - const WebPMuxError err = - WebPMuxNumChunks(mux, kChunks[idx].id, num); - if (err != WEBP_MUX_OK) return err; - if (max > -1 && *num > max) return WEBP_MUX_INVALID_ARGUMENT; - if (feature != NO_FLAG && IsNotCompatible(vp8x_flags & feature, *num)) { - return WEBP_MUX_INVALID_ARGUMENT; - } - return WEBP_MUX_OK; -} - -WebPMuxError MuxValidate(const WebPMux* const mux) { - int num_iccp; - int num_meta; - int num_loop_chunks; - int num_frames; - int num_tiles; - int num_vp8x; - int num_images; - int num_alpha; - uint32_t flags; - WebPMuxError err; - - // Verify mux is not NULL. - if (mux == NULL) return WEBP_MUX_INVALID_ARGUMENT; - - // Verify mux has at least one image. - if (mux->images_ == NULL) return WEBP_MUX_INVALID_ARGUMENT; - - err = WebPMuxGetFeatures(mux, &flags); - if (err != WEBP_MUX_OK) return err; - - // At most one color profile chunk. - err = ValidateChunk(mux, IDX_ICCP, ICCP_FLAG, flags, 1, &num_iccp); - if (err != WEBP_MUX_OK) return err; - - // At most one XMP metadata. - err = ValidateChunk(mux, IDX_META, META_FLAG, flags, 1, &num_meta); - if (err != WEBP_MUX_OK) return err; - - // Animation: ANIMATION_FLAG, loop chunk and frame chunk(s) are consistent. - // At most one loop chunk. - err = ValidateChunk(mux, IDX_LOOP, NO_FLAG, flags, 1, &num_loop_chunks); - if (err != WEBP_MUX_OK) return err; - err = ValidateChunk(mux, IDX_FRAME, NO_FLAG, flags, -1, &num_frames); - if (err != WEBP_MUX_OK) return err; - - { - const int has_animation = !!(flags & ANIMATION_FLAG); - if (has_animation && (num_loop_chunks == 0 || num_frames == 0)) { - return WEBP_MUX_INVALID_ARGUMENT; - } - if (!has_animation && (num_loop_chunks == 1 || num_frames > 0)) { - return WEBP_MUX_INVALID_ARGUMENT; - } - } - - // Tiling: TILE_FLAG and tile chunk(s) are consistent. - err = ValidateChunk(mux, IDX_TILE, TILE_FLAG, flags, -1, &num_tiles); - if (err != WEBP_MUX_OK) return err; - - // Verify either VP8X chunk is present OR there is only one elem in - // mux->images_. - err = ValidateChunk(mux, IDX_VP8X, NO_FLAG, flags, 1, &num_vp8x); - if (err != WEBP_MUX_OK) return err; - err = ValidateChunk(mux, IDX_VP8, NO_FLAG, flags, -1, &num_images); - if (err != WEBP_MUX_OK) return err; - if (num_vp8x == 0 && num_images != 1) return WEBP_MUX_INVALID_ARGUMENT; - - // ALPHA_FLAG & alpha chunk(s) are consistent. - if (num_vp8x > 0 && MuxHasLosslessImages(mux->images_)) { - // Special case: we have a VP8X chunk as well as some lossless images. - if (!(flags & ALPHA_FLAG)) return WEBP_MUX_INVALID_ARGUMENT; - } else { - err = ValidateChunk(mux, IDX_ALPHA, ALPHA_FLAG, flags, -1, &num_alpha); - if (err != WEBP_MUX_OK) return err; - } - - // num_tiles & num_images are consistent. - if (num_tiles > 0 && num_images != num_tiles) { - return WEBP_MUX_INVALID_ARGUMENT; - } - - return WEBP_MUX_OK; -} - -#undef NO_FLAG - -//------------------------------------------------------------------------------ - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif diff --git a/external/libwebp/mux/muxread.c b/external/libwebp/mux/muxread.c deleted file mode 100644 index 21c3cfbaeb..0000000000 --- a/external/libwebp/mux/muxread.c +++ /dev/null @@ -1,411 +0,0 @@ -// Copyright 2011 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Read APIs for mux. -// -// Authors: Urvang (urvang@google.com) -// Vikas (vikasa@google.com) - -#include <assert.h> -#include "./muxi.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -//------------------------------------------------------------------------------ -// Helper method(s). - -// Handy MACRO. -#define SWITCH_ID_LIST(INDEX, LIST) \ - if (idx == (INDEX)) { \ - const WebPChunk* const chunk = ChunkSearchList((LIST), nth, \ - kChunks[(INDEX)].tag); \ - if (chunk) { \ - *data = chunk->data_; \ - return WEBP_MUX_OK; \ - } else { \ - return WEBP_MUX_NOT_FOUND; \ - } \ - } - -static WebPMuxError MuxGet(const WebPMux* const mux, CHUNK_INDEX idx, - uint32_t nth, WebPData* const data) { - assert(mux != NULL); - assert(!IsWPI(kChunks[idx].id)); - WebPDataInit(data); - - SWITCH_ID_LIST(IDX_VP8X, mux->vp8x_); - SWITCH_ID_LIST(IDX_ICCP, mux->iccp_); - SWITCH_ID_LIST(IDX_LOOP, mux->loop_); - SWITCH_ID_LIST(IDX_META, mux->meta_); - SWITCH_ID_LIST(IDX_UNKNOWN, mux->unknown_); - return WEBP_MUX_NOT_FOUND; -} -#undef SWITCH_ID_LIST - -// Fill the chunk with the given data (includes chunk header bytes), after some -// verifications. -static WebPMuxError ChunkVerifyAndAssignData(WebPChunk* chunk, - const uint8_t* data, - size_t data_size, size_t riff_size, - int copy_data) { - uint32_t chunk_size; - WebPData chunk_data; - - // Sanity checks. - if (data_size < TAG_SIZE) return WEBP_MUX_NOT_ENOUGH_DATA; - chunk_size = GetLE32(data + TAG_SIZE); - - { - const size_t chunk_disk_size = SizeWithPadding(chunk_size); - if (chunk_disk_size > riff_size) return WEBP_MUX_BAD_DATA; - if (chunk_disk_size > data_size) return WEBP_MUX_NOT_ENOUGH_DATA; - } - - // Data assignment. - chunk_data.bytes_ = data + CHUNK_HEADER_SIZE; - chunk_data.size_ = chunk_size; - return ChunkAssignData(chunk, &chunk_data, copy_data, GetLE32(data + 0)); -} - -//------------------------------------------------------------------------------ -// Create a mux object from WebP-RIFF data. - -WebPMux* WebPMuxCreateInternal(const WebPData* bitstream, int copy_data, - int version) { - size_t riff_size; - uint32_t tag; - const uint8_t* end; - WebPMux* mux = NULL; - WebPMuxImage* wpi = NULL; - const uint8_t* data; - size_t size; - WebPChunk chunk; - ChunkInit(&chunk); - - // Sanity checks. - if (WEBP_ABI_IS_INCOMPATIBLE(version, WEBP_MUX_ABI_VERSION)) { - return NULL; // version mismatch - } - if (bitstream == NULL) return NULL; - - data = bitstream->bytes_; - size = bitstream->size_; - - if (data == NULL) return NULL; - if (size < RIFF_HEADER_SIZE) return NULL; - if (GetLE32(data + 0) != MKFOURCC('R', 'I', 'F', 'F') || - GetLE32(data + CHUNK_HEADER_SIZE) != MKFOURCC('W', 'E', 'B', 'P')) { - return NULL; - } - - mux = WebPMuxNew(); - if (mux == NULL) return NULL; - - if (size < RIFF_HEADER_SIZE + TAG_SIZE) goto Err; - - tag = GetLE32(data + RIFF_HEADER_SIZE); - if (tag != kChunks[IDX_VP8].tag && - tag != kChunks[IDX_VP8L].tag && - tag != kChunks[IDX_VP8X].tag) { - goto Err; // First chunk should be VP8, VP8L or VP8X. - } - - riff_size = SizeWithPadding(GetLE32(data + TAG_SIZE)); - if (riff_size > MAX_CHUNK_PAYLOAD || riff_size > size) { - goto Err; - } else { - if (riff_size < size) { // Redundant data after last chunk. - size = riff_size; // To make sure we don't read any data beyond mux_size. - } - } - - end = data + size; - data += RIFF_HEADER_SIZE; - size -= RIFF_HEADER_SIZE; - - wpi = (WebPMuxImage*)malloc(sizeof(*wpi)); - if (wpi == NULL) goto Err; - MuxImageInit(wpi); - - // Loop over chunks. - while (data != end) { - WebPChunkId id; - WebPMuxError err; - - err = ChunkVerifyAndAssignData(&chunk, data, size, riff_size, copy_data); - if (err != WEBP_MUX_OK) goto Err; - - id = ChunkGetIdFromTag(chunk.tag_); - - if (IsWPI(id)) { // An image chunk (frame/tile/alpha/vp8). - WebPChunk** wpi_chunk_ptr = - MuxImageGetListFromId(wpi, id); // Image chunk to set. - assert(wpi_chunk_ptr != NULL); - if (*wpi_chunk_ptr != NULL) goto Err; // Consecutive alpha chunks or - // consecutive frame/tile chunks. - if (ChunkSetNth(&chunk, wpi_chunk_ptr, 1) != WEBP_MUX_OK) goto Err; - if (id == WEBP_CHUNK_IMAGE) { - wpi->is_partial_ = 0; // wpi is completely filled. - // Add this to mux->images_ list. - if (MuxImagePush(wpi, &mux->images_) != WEBP_MUX_OK) goto Err; - MuxImageInit(wpi); // Reset for reading next image. - } else { - wpi->is_partial_ = 1; // wpi is only partially filled. - } - } else { // A non-image chunk. - WebPChunk** chunk_list; - if (wpi->is_partial_) goto Err; // Encountered a non-image chunk before - // getting all chunks of an image. - chunk_list = MuxGetChunkListFromId(mux, id); // List to add this chunk. - if (chunk_list == NULL) chunk_list = &mux->unknown_; - if (ChunkSetNth(&chunk, chunk_list, 0) != WEBP_MUX_OK) goto Err; - } - { - const size_t data_size = ChunkDiskSize(&chunk); - data += data_size; - size -= data_size; - } - ChunkInit(&chunk); - } - - // Validate mux if complete. - if (MuxValidate(mux) != WEBP_MUX_OK) goto Err; - - MuxImageDelete(wpi); - return mux; // All OK; - - Err: // Something bad happened. - ChunkRelease(&chunk); - MuxImageDelete(wpi); - WebPMuxDelete(mux); - return NULL; -} - -//------------------------------------------------------------------------------ -// Get API(s). - -WebPMuxError WebPMuxGetFeatures(const WebPMux* mux, uint32_t* flags) { - WebPData data; - WebPMuxError err; - - if (mux == NULL || flags == NULL) return WEBP_MUX_INVALID_ARGUMENT; - *flags = 0; - - // Check if VP8X chunk is present. - err = MuxGet(mux, IDX_VP8X, 1, &data); - if (err == WEBP_MUX_NOT_FOUND) { - // Check if VP8/VP8L chunk is present. - err = WebPMuxGetImage(mux, &data); - WebPDataClear(&data); - return err; - } else if (err != WEBP_MUX_OK) { - return err; - } - - if (data.size_ < CHUNK_SIZE_BYTES) return WEBP_MUX_BAD_DATA; - - // All OK. Fill up flags. - *flags = GetLE32(data.bytes_); - return WEBP_MUX_OK; -} - -static uint8_t* EmitVP8XChunk(uint8_t* const dst, int width, - int height, uint32_t flags) { - const size_t vp8x_size = CHUNK_HEADER_SIZE + VP8X_CHUNK_SIZE; - assert(width >= 1 && height >= 1); - assert(width <= MAX_CANVAS_SIZE && height <= MAX_CANVAS_SIZE); - assert(width * (uint64_t)height < MAX_IMAGE_AREA); - PutLE32(dst, MKFOURCC('V', 'P', '8', 'X')); - PutLE32(dst + TAG_SIZE, VP8X_CHUNK_SIZE); - PutLE32(dst + CHUNK_HEADER_SIZE, flags); - PutLE24(dst + CHUNK_HEADER_SIZE + 4, width - 1); - PutLE24(dst + CHUNK_HEADER_SIZE + 7, height - 1); - return dst + vp8x_size; -} - -// Assemble a single image WebP bitstream from 'wpi'. -static WebPMuxError SynthesizeBitstream(WebPMuxImage* const wpi, - WebPData* const bitstream) { - uint8_t* dst; - - // Allocate data. - const int need_vp8x = (wpi->alpha_ != NULL); - const size_t vp8x_size = need_vp8x ? CHUNK_HEADER_SIZE + VP8X_CHUNK_SIZE : 0; - const size_t alpha_size = need_vp8x ? ChunkDiskSize(wpi->alpha_) : 0; - // Note: No need to output FRM/TILE chunk for a single image. - const size_t size = RIFF_HEADER_SIZE + vp8x_size + alpha_size + - ChunkDiskSize(wpi->img_); - uint8_t* const data = (uint8_t*)malloc(size); - if (data == NULL) return WEBP_MUX_MEMORY_ERROR; - - // Main RIFF header. - dst = MuxEmitRiffHeader(data, size); - - if (need_vp8x) { - int w, h; - WebPMuxError err; - assert(wpi->img_ != NULL); - err = MuxGetImageWidthHeight(wpi->img_, &w, &h); - if (err != WEBP_MUX_OK) { - free(data); - return err; - } - dst = EmitVP8XChunk(dst, w, h, ALPHA_FLAG); // VP8X. - dst = ChunkListEmit(wpi->alpha_, dst); // ALPH. - } - - // Bitstream. - dst = ChunkListEmit(wpi->img_, dst); - assert(dst == data + size); - - // Output. - bitstream->bytes_ = data; - bitstream->size_ = size; - return WEBP_MUX_OK; -} - -WebPMuxError WebPMuxGetImage(const WebPMux* mux, WebPData* bitstream) { - WebPMuxError err; - WebPMuxImage* wpi = NULL; - - if (mux == NULL || bitstream == NULL) { - return WEBP_MUX_INVALID_ARGUMENT; - } - - err = MuxValidateForImage(mux); - if (err != WEBP_MUX_OK) return err; - - // All well. Get the image. - err = MuxImageGetNth((const WebPMuxImage**)&mux->images_, 1, WEBP_CHUNK_IMAGE, - &wpi); - assert(err == WEBP_MUX_OK); // Already tested above. - - return SynthesizeBitstream(wpi, bitstream); -} - -WebPMuxError WebPMuxGetMetadata(const WebPMux* mux, WebPData* metadata) { - if (mux == NULL || metadata == NULL) return WEBP_MUX_INVALID_ARGUMENT; - return MuxGet(mux, IDX_META, 1, metadata); -} - -WebPMuxError WebPMuxGetColorProfile(const WebPMux* mux, - WebPData* color_profile) { - if (mux == NULL || color_profile == NULL) return WEBP_MUX_INVALID_ARGUMENT; - return MuxGet(mux, IDX_ICCP, 1, color_profile); -} - -WebPMuxError WebPMuxGetLoopCount(const WebPMux* mux, int* loop_count) { - WebPData image; - WebPMuxError err; - - if (mux == NULL || loop_count == NULL) return WEBP_MUX_INVALID_ARGUMENT; - - err = MuxGet(mux, IDX_LOOP, 1, &image); - if (err != WEBP_MUX_OK) return err; - if (image.size_ < kChunks[WEBP_CHUNK_LOOP].size) return WEBP_MUX_BAD_DATA; - *loop_count = GetLE16(image.bytes_); - - return WEBP_MUX_OK; -} - -static WebPMuxError MuxGetFrameTileInternal( - const WebPMux* const mux, uint32_t nth, WebPData* const bitstream, - int* const x_offset, int* const y_offset, int* const duration, - uint32_t tag) { - const WebPData* frame_tile_data; - WebPMuxError err; - WebPMuxImage* wpi; - - const int is_frame = (tag == kChunks[WEBP_CHUNK_FRAME].tag) ? 1 : 0; - const CHUNK_INDEX idx = is_frame ? IDX_FRAME : IDX_TILE; - const WebPChunkId id = kChunks[idx].id; - - if (mux == NULL || bitstream == NULL || - x_offset == NULL || y_offset == NULL || (is_frame && duration == NULL)) { - return WEBP_MUX_INVALID_ARGUMENT; - } - - // Get the nth WebPMuxImage. - err = MuxImageGetNth((const WebPMuxImage**)&mux->images_, nth, id, &wpi); - if (err != WEBP_MUX_OK) return err; - - // Get frame chunk. - assert(wpi->header_ != NULL); // As MuxImageGetNth() already checked header_. - frame_tile_data = &wpi->header_->data_; - - if (frame_tile_data->size_ < kChunks[idx].size) return WEBP_MUX_BAD_DATA; - *x_offset = 2 * GetLE24(frame_tile_data->bytes_ + 0); - *y_offset = 2 * GetLE24(frame_tile_data->bytes_ + 3); - if (is_frame) *duration = 1 + GetLE24(frame_tile_data->bytes_ + 12); - - return SynthesizeBitstream(wpi, bitstream); -} - -WebPMuxError WebPMuxGetFrame(const WebPMux* mux, uint32_t nth, - WebPData* bitstream, - int* x_offset, int* y_offset, int* duration) { - return MuxGetFrameTileInternal(mux, nth, bitstream, x_offset, y_offset, - duration, kChunks[IDX_FRAME].tag); -} - -WebPMuxError WebPMuxGetTile(const WebPMux* mux, uint32_t nth, - WebPData* bitstream, - int* x_offset, int* y_offset) { - return MuxGetFrameTileInternal(mux, nth, bitstream, x_offset, y_offset, NULL, - kChunks[IDX_TILE].tag); -} - -// Get chunk index from chunk id. Returns IDX_NIL if not found. -static CHUNK_INDEX ChunkGetIndexFromId(WebPChunkId id) { - int i; - for (i = 0; kChunks[i].id != WEBP_CHUNK_NIL; ++i) { - if (id == kChunks[i].id) return i; - } - return IDX_NIL; -} - -// Count number of chunks matching 'tag' in the 'chunk_list'. -// If tag == NIL_TAG, any tag will be matched. -static int CountChunks(const WebPChunk* const chunk_list, uint32_t tag) { - int count = 0; - const WebPChunk* current; - for (current = chunk_list; current != NULL; current = current->next_) { - if (tag == NIL_TAG || current->tag_ == tag) { - count++; // Count chunks whose tags match. - } - } - return count; -} - -WebPMuxError WebPMuxNumChunks(const WebPMux* mux, - WebPChunkId id, int* num_elements) { - if (mux == NULL || num_elements == NULL) { - return WEBP_MUX_INVALID_ARGUMENT; - } - - if (IsWPI(id)) { - *num_elements = MuxImageCount(mux->images_, id); - } else { - WebPChunk* const* chunk_list = MuxGetChunkListFromId(mux, id); - if (chunk_list == NULL) { - *num_elements = 0; - } else { - const CHUNK_INDEX idx = ChunkGetIndexFromId(id); - *num_elements = CountChunks(*chunk_list, kChunks[idx].tag); - } - } - - return WEBP_MUX_OK; -} - -//------------------------------------------------------------------------------ - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif diff --git a/external/libwebp/utils/Makefile.am b/external/libwebp/utils/Makefile.am deleted file mode 100644 index 65054c036b..0000000000 --- a/external/libwebp/utils/Makefile.am +++ /dev/null @@ -1,27 +0,0 @@ -AM_CPPFLAGS = -I$(top_srcdir)/src -noinst_LTLIBRARIES = libwebputils.la - -libwebputils_la_SOURCES = -libwebputils_la_SOURCES += bit_reader.c -libwebputils_la_SOURCES += bit_reader.h -libwebputils_la_SOURCES += bit_writer.c -libwebputils_la_SOURCES += bit_writer.h -libwebputils_la_SOURCES += color_cache.c -libwebputils_la_SOURCES += color_cache.h -libwebputils_la_SOURCES += filters.c -libwebputils_la_SOURCES += filters.h -libwebputils_la_SOURCES += huffman.c -libwebputils_la_SOURCES += huffman.h -libwebputils_la_SOURCES += huffman_encode.c -libwebputils_la_SOURCES += huffman_encode.h -libwebputils_la_SOURCES += quant_levels.c -libwebputils_la_SOURCES += quant_levels.h -libwebputils_la_SOURCES += rescaler.c -libwebputils_la_SOURCES += rescaler.h -libwebputils_la_SOURCES += thread.c -libwebputils_la_SOURCES += thread.h -libwebputils_la_SOURCES += utils.c -libwebputils_la_SOURCES += utils.h - -libwebputilsinclude_HEADERS = ../webp/types.h -libwebputilsincludedir = $(includedir)/webp diff --git a/external/libwebp/utils/bit_reader.c b/external/libwebp/utils/bit_reader.c deleted file mode 100644 index 1afb1db890..0000000000 --- a/external/libwebp/utils/bit_reader.c +++ /dev/null @@ -1,229 +0,0 @@ -// Copyright 2010 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Boolean decoder -// -// Author: Skal (pascal.massimino@gmail.com) - -#include "./bit_reader.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -#define MK(X) (((bit_t)(X) << (BITS)) | (MASK)) - -//------------------------------------------------------------------------------ -// VP8BitReader - -void VP8InitBitReader(VP8BitReader* const br, - const uint8_t* const start, const uint8_t* const end) { - assert(br != NULL); - assert(start != NULL); - assert(start <= end); - br->range_ = MK(255 - 1); - br->buf_ = start; - br->buf_end_ = end; - br->value_ = 0; - br->missing_ = 8; // to load the very first 8bits - br->eof_ = 0; -} - -const uint8_t kVP8Log2Range[128] = { - 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 0 -}; - -// range = (range << kVP8Log2Range[range]) + trailing 1's -const bit_t kVP8NewRange[128] = { - MK(127), MK(127), MK(191), MK(127), MK(159), MK(191), MK(223), MK(127), - MK(143), MK(159), MK(175), MK(191), MK(207), MK(223), MK(239), MK(127), - MK(135), MK(143), MK(151), MK(159), MK(167), MK(175), MK(183), MK(191), - MK(199), MK(207), MK(215), MK(223), MK(231), MK(239), MK(247), MK(127), - MK(131), MK(135), MK(139), MK(143), MK(147), MK(151), MK(155), MK(159), - MK(163), MK(167), MK(171), MK(175), MK(179), MK(183), MK(187), MK(191), - MK(195), MK(199), MK(203), MK(207), MK(211), MK(215), MK(219), MK(223), - MK(227), MK(231), MK(235), MK(239), MK(243), MK(247), MK(251), MK(127), - MK(129), MK(131), MK(133), MK(135), MK(137), MK(139), MK(141), MK(143), - MK(145), MK(147), MK(149), MK(151), MK(153), MK(155), MK(157), MK(159), - MK(161), MK(163), MK(165), MK(167), MK(169), MK(171), MK(173), MK(175), - MK(177), MK(179), MK(181), MK(183), MK(185), MK(187), MK(189), MK(191), - MK(193), MK(195), MK(197), MK(199), MK(201), MK(203), MK(205), MK(207), - MK(209), MK(211), MK(213), MK(215), MK(217), MK(219), MK(221), MK(223), - MK(225), MK(227), MK(229), MK(231), MK(233), MK(235), MK(237), MK(239), - MK(241), MK(243), MK(245), MK(247), MK(249), MK(251), MK(253), MK(127) -}; - -#undef MK - -void VP8LoadFinalBytes(VP8BitReader* const br) { - assert(br != NULL && br->buf_ != NULL); - // Only read 8bits at a time - if (br->buf_ < br->buf_end_) { - br->value_ |= (bit_t)(*br->buf_++) << ((BITS) - 8 + br->missing_); - br->missing_ -= 8; - } else { - br->eof_ = 1; - } -} - -//------------------------------------------------------------------------------ -// Higher-level calls - -uint32_t VP8GetValue(VP8BitReader* const br, int bits) { - uint32_t v = 0; - while (bits-- > 0) { - v |= VP8GetBit(br, 0x80) << bits; - } - return v; -} - -int32_t VP8GetSignedValue(VP8BitReader* const br, int bits) { - const int value = VP8GetValue(br, bits); - return VP8Get(br) ? -value : value; -} - -//------------------------------------------------------------------------------ -// VP8LBitReader - -#define MAX_NUM_BIT_READ 25 - -static const uint32_t kBitMask[MAX_NUM_BIT_READ] = { - 0, 1, 3, 7, 15, 31, 63, 127, 255, 511, 1023, 2047, 4095, 8191, 16383, 32767, - 65535, 131071, 262143, 524287, 1048575, 2097151, 4194303, 8388607, 16777215 -}; - -void VP8LInitBitReader(VP8LBitReader* const br, - const uint8_t* const start, - size_t length) { - size_t i; - assert(br != NULL); - assert(start != NULL); - assert(length < 0xfffffff8u); // can't happen with a RIFF chunk. - - br->buf_ = start; - br->len_ = length; - br->val_ = 0; - br->pos_ = 0; - br->bit_pos_ = 0; - br->eos_ = 0; - br->error_ = 0; - for (i = 0; i < sizeof(br->val_) && i < br->len_; ++i) { - br->val_ |= ((uint64_t)br->buf_[br->pos_]) << (8 * i); - ++br->pos_; - } -} - -void VP8LBitReaderSetBuffer(VP8LBitReader* const br, - const uint8_t* const buf, size_t len) { - assert(br != NULL); - assert(buf != NULL); - assert(len < 0xfffffff8u); // can't happen with a RIFF chunk. - br->eos_ = (br->pos_ >= len); - br->buf_ = buf; - br->len_ = len; -} - -static void ShiftBytes(VP8LBitReader* const br) { - while (br->bit_pos_ >= 8 && br->pos_ < br->len_) { - br->val_ >>= 8; - br->val_ |= ((uint64_t)br->buf_[br->pos_]) << 56; - ++br->pos_; - br->bit_pos_ -= 8; - } -} - -void VP8LFillBitWindow(VP8LBitReader* const br) { - if (br->bit_pos_ >= 32) { -#if defined(__x86_64__) || defined(_M_X64) - if (br->pos_ + 8 < br->len_) { - br->val_ >>= 32; - // The expression below needs a little-endian arch to work correctly. - // This gives a large speedup for decoding speed. - br->val_ |= *(const uint64_t *)(br->buf_ + br->pos_) << 32; - br->pos_ += 4; - br->bit_pos_ -= 32; - } else { - // Slow path. - ShiftBytes(br); - } -#else - // Always the slow path. - ShiftBytes(br); -#endif - } - if (br->pos_ == br->len_ && br->bit_pos_ == 64) { - br->eos_ = 1; - } -} - -uint32_t VP8LReadOneBit(VP8LBitReader* const br) { - const uint32_t val = (br->val_ >> br->bit_pos_) & 1; - // Flag an error at end_of_stream. - if (!br->eos_) { - ++br->bit_pos_; - if (br->bit_pos_ >= 32) { - ShiftBytes(br); - } - // After this last bit is read, check if eos needs to be flagged. - if (br->pos_ == br->len_ && br->bit_pos_ == 64) { - br->eos_ = 1; - } - } else { - br->error_ = 1; - } - return val; -} - -uint32_t VP8LReadBits(VP8LBitReader* const br, int n_bits) { - uint32_t val = 0; - assert(n_bits >= 0); - // Flag an error if end_of_stream or n_bits is more than allowed limit. - if (!br->eos_ && n_bits < MAX_NUM_BIT_READ) { - // If this read is going to cross the read buffer, set the eos flag. - if (br->pos_ == br->len_) { - if ((br->bit_pos_ + n_bits) >= 64) { - br->eos_ = 1; - if ((br->bit_pos_ + n_bits) > 64) return val; - } - } - val = (br->val_ >> br->bit_pos_) & kBitMask[n_bits]; - br->bit_pos_ += n_bits; - if (br->bit_pos_ >= 40) { - if (br->pos_ + 5 < br->len_) { - br->val_ >>= 40; - br->val_ |= - (((uint64_t)br->buf_[br->pos_ + 0]) << 24) | - (((uint64_t)br->buf_[br->pos_ + 1]) << 32) | - (((uint64_t)br->buf_[br->pos_ + 2]) << 40) | - (((uint64_t)br->buf_[br->pos_ + 3]) << 48) | - (((uint64_t)br->buf_[br->pos_ + 4]) << 56); - br->pos_ += 5; - br->bit_pos_ -= 40; - } - if (br->bit_pos_ >= 8) { - ShiftBytes(br); - } - } - } else { - br->error_ = 1; - } - return val; -} - -//------------------------------------------------------------------------------ - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif diff --git a/external/libwebp/utils/bit_reader.h b/external/libwebp/utils/bit_reader.h deleted file mode 100644 index b0324c951c..0000000000 --- a/external/libwebp/utils/bit_reader.h +++ /dev/null @@ -1,201 +0,0 @@ -// Copyright 2010 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Boolean decoder -// -// Author: Skal (pascal.massimino@gmail.com) -// Vikas Arora (vikaas.arora@gmail.com) - -#ifndef WEBP_UTILS_BIT_READER_H_ -#define WEBP_UTILS_BIT_READER_H_ - -#include "platform/CCPlatformConfig.h" - -#include <assert.h> -#ifdef _MSC_VER -#include <stdlib.h> // _byteswap_ulong -#endif -#include <string.h> // For memcpy -#include "../webp/types.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -#define BITS 32 // can be 32, 16 or 8 -#define MASK ((((bit_t)1) << (BITS)) - 1) -#if (BITS == 32) -typedef uint64_t bit_t; // natural register type -typedef uint32_t lbit_t; // natural type for memory I/O -#elif (BITS == 16) -typedef uint32_t bit_t; -typedef uint16_t lbit_t; -#else -typedef uint32_t bit_t; -typedef uint8_t lbit_t; -#endif - -//------------------------------------------------------------------------------ -// Bitreader and code-tree reader - -typedef struct VP8BitReader VP8BitReader; -struct VP8BitReader { - const uint8_t* buf_; // next byte to be read - const uint8_t* buf_end_; // end of read buffer - int eof_; // true if input is exhausted - - // boolean decoder - bit_t range_; // current range minus 1. In [127, 254] interval. - bit_t value_; // current value - int missing_; // number of missing bits in value_ (8bit) -}; - -// Initialize the bit reader and the boolean decoder. -void VP8InitBitReader(VP8BitReader* const br, - const uint8_t* const start, const uint8_t* const end); - -// return the next value made of 'num_bits' bits -uint32_t VP8GetValue(VP8BitReader* const br, int num_bits); -static WEBP_INLINE uint32_t VP8Get(VP8BitReader* const br) { - return VP8GetValue(br, 1); -} - -// return the next value with sign-extension. -int32_t VP8GetSignedValue(VP8BitReader* const br, int num_bits); - -// Read a bit with proba 'prob'. Speed-critical function! -extern const uint8_t kVP8Log2Range[128]; -extern const bit_t kVP8NewRange[128]; - -void VP8LoadFinalBytes(VP8BitReader* const br); // special case for the tail - -static WEBP_INLINE void VP8LoadNewBytes(VP8BitReader* const br) { - assert(br && br->buf_); - // Read 'BITS' bits at a time if possible. - if (br->buf_ + sizeof(lbit_t) <= br->buf_end_) { - // convert memory type to register type (with some zero'ing!) - bit_t bits; - lbit_t in_bits = *(lbit_t*)br->buf_; - br->buf_ += (BITS) >> 3; -#if !defined(__BIG_ENDIAN__) -#if (BITS == 32) -#if (defined(__i386__) || defined(__x86_64__) ) && (CC_TARGET_PLATFORM != CC_PLATFORM_MARMALADE) - __asm__ volatile("bswap %k0" : "=r"(in_bits) : "0"(in_bits)); - bits = (bit_t)in_bits; // 32b -> 64b zero-extension -#elif defined(_MSC_VER) && (CC_TARGET_PLATFORM != CC_PLATFORM_MARMALADE) - bits = _byteswap_ulong(in_bits); -#else - bits = (bit_t)(in_bits >> 24) | ((in_bits >> 8) & 0xff00) - | ((in_bits << 8) & 0xff0000) | (in_bits << 24); -#endif // x86 -#elif (BITS == 16) - // gcc will recognize a 'rorw $8, ...' here: - bits = (bit_t)(in_bits >> 8) | ((in_bits & 0xff) << 8); -#else // BITS == 8 - bits = (bit_t)in_bits; -#endif -#else // LITTLE_ENDIAN - bits = (bit_t)in_bits; -#endif - br->value_ |= bits << br->missing_; - br->missing_ -= (BITS); - } else { - VP8LoadFinalBytes(br); // no need to be inlined - } -} - -static WEBP_INLINE int VP8BitUpdate(VP8BitReader* const br, bit_t split) { - const bit_t value_split = split | (MASK); - if (br->missing_ > 0) { // Make sure we have a least BITS bits in 'value_' - VP8LoadNewBytes(br); - } - if (br->value_ > value_split) { - br->range_ -= value_split + 1; - br->value_ -= value_split + 1; - return 1; - } else { - br->range_ = value_split; - return 0; - } -} - -static WEBP_INLINE void VP8Shift(VP8BitReader* const br) { - // range_ is in [0..127] interval here. - const int idx = br->range_ >> (BITS); - const int shift = kVP8Log2Range[idx]; - br->range_ = kVP8NewRange[idx]; - br->value_ <<= shift; - br->missing_ += shift; -} - -static WEBP_INLINE int VP8GetBit(VP8BitReader* const br, int prob) { - // It's important to avoid generating a 64bit x 64bit multiply here. - // We just need an 8b x 8b after all. - const bit_t split = - (bit_t)((uint32_t)(br->range_ >> (BITS)) * prob) << ((BITS) - 8); - const int bit = VP8BitUpdate(br, split); - if (br->range_ <= (((bit_t)0x7e << (BITS)) | (MASK))) { - VP8Shift(br); - } - return bit; -} - -static WEBP_INLINE int VP8GetSigned(VP8BitReader* const br, int v) { - const bit_t split = (br->range_ >> 1); - const int bit = VP8BitUpdate(br, split); - VP8Shift(br); - return bit ? -v : v; -} - - -// ----------------------------------------------------------------------------- -// Bitreader - -typedef struct { - uint64_t val_; - const uint8_t* buf_; - size_t len_; - size_t pos_; - int bit_pos_; - int eos_; - int error_; -} VP8LBitReader; - -void VP8LInitBitReader(VP8LBitReader* const br, - const uint8_t* const start, - size_t length); - -// Sets a new data buffer. -void VP8LBitReaderSetBuffer(VP8LBitReader* const br, - const uint8_t* const buffer, size_t length); - -// Reads the specified number of bits from Read Buffer. -// Flags an error in case end_of_stream or n_bits is more than allowed limit. -// Flags eos if this read attempt is going to cross the read buffer. -uint32_t VP8LReadBits(VP8LBitReader* const br, int n_bits); - -// Reads one bit from Read Buffer. Flags an error in case end_of_stream. -// Flags eos after reading last bit from the buffer. -uint32_t VP8LReadOneBit(VP8LBitReader* const br); - -// VP8LReadOneBitUnsafe is faster than VP8LReadOneBit, but it can be called only -// 32 times after the last VP8LFillBitWindow. Any subsequent calls -// (without VP8LFillBitWindow) will return invalid data. -static WEBP_INLINE uint32_t VP8LReadOneBitUnsafe(VP8LBitReader* const br) { - const uint32_t val = (br->val_ >> br->bit_pos_) & 1; - ++br->bit_pos_; - return val; -} - -// Advances the Read buffer by 4 bytes to make room for reading next 32 bits. -void VP8LFillBitWindow(VP8LBitReader* const br); - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif - -#endif /* WEBP_UTILS_BIT_READER_H_ */ diff --git a/external/libwebp/utils/bit_writer.c b/external/libwebp/utils/bit_writer.c deleted file mode 100644 index 671159cacd..0000000000 --- a/external/libwebp/utils/bit_writer.c +++ /dev/null @@ -1,284 +0,0 @@ -// Copyright 2011 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Bit writing and boolean coder -// -// Author: Skal (pascal.massimino@gmail.com) -// Vikas Arora (vikaas.arora@gmail.com) - -#include <assert.h> -#include <string.h> // for memcpy() -#include <stdlib.h> -#include "./bit_writer.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -//------------------------------------------------------------------------------ -// VP8BitWriter - -static int BitWriterResize(VP8BitWriter* const bw, size_t extra_size) { - uint8_t* new_buf; - size_t new_size; - const uint64_t needed_size_64b = (uint64_t)bw->pos_ + extra_size; - const size_t needed_size = (size_t)needed_size_64b; - if (needed_size_64b != needed_size) { - bw->error_ = 1; - return 0; - } - if (needed_size <= bw->max_pos_) return 1; - // If the following line wraps over 32bit, the test just after will catch it. - new_size = 2 * bw->max_pos_; - if (new_size < needed_size) new_size = needed_size; - if (new_size < 1024) new_size = 1024; - new_buf = (uint8_t*)malloc(new_size); - if (new_buf == NULL) { - bw->error_ = 1; - return 0; - } - memcpy(new_buf, bw->buf_, bw->pos_); - free(bw->buf_); - bw->buf_ = new_buf; - bw->max_pos_ = new_size; - return 1; -} - -static void kFlush(VP8BitWriter* const bw) { - const int s = 8 + bw->nb_bits_; - const int32_t bits = bw->value_ >> s; - assert(bw->nb_bits_ >= 0); - bw->value_ -= bits << s; - bw->nb_bits_ -= 8; - if ((bits & 0xff) != 0xff) { - size_t pos = bw->pos_; - if (!BitWriterResize(bw, bw->run_ + 1)) { - return; - } - if (bits & 0x100) { // overflow -> propagate carry over pending 0xff's - if (pos > 0) bw->buf_[pos - 1]++; - } - if (bw->run_ > 0) { - const int value = (bits & 0x100) ? 0x00 : 0xff; - for (; bw->run_ > 0; --bw->run_) bw->buf_[pos++] = value; - } - bw->buf_[pos++] = bits; - bw->pos_ = pos; - } else { - bw->run_++; // delay writing of bytes 0xff, pending eventual carry. - } -} - -//------------------------------------------------------------------------------ -// renormalization - -static const uint8_t kNorm[128] = { // renorm_sizes[i] = 8 - log2(i) - 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 0 -}; - -// range = ((range + 1) << kVP8Log2Range[range]) - 1 -static const uint8_t kNewRange[128] = { - 127, 127, 191, 127, 159, 191, 223, 127, 143, 159, 175, 191, 207, 223, 239, - 127, 135, 143, 151, 159, 167, 175, 183, 191, 199, 207, 215, 223, 231, 239, - 247, 127, 131, 135, 139, 143, 147, 151, 155, 159, 163, 167, 171, 175, 179, - 183, 187, 191, 195, 199, 203, 207, 211, 215, 219, 223, 227, 231, 235, 239, - 243, 247, 251, 127, 129, 131, 133, 135, 137, 139, 141, 143, 145, 147, 149, - 151, 153, 155, 157, 159, 161, 163, 165, 167, 169, 171, 173, 175, 177, 179, - 181, 183, 185, 187, 189, 191, 193, 195, 197, 199, 201, 203, 205, 207, 209, - 211, 213, 215, 217, 219, 221, 223, 225, 227, 229, 231, 233, 235, 237, 239, - 241, 243, 245, 247, 249, 251, 253, 127 -}; - -int VP8PutBit(VP8BitWriter* const bw, int bit, int prob) { - const int split = (bw->range_ * prob) >> 8; - if (bit) { - bw->value_ += split + 1; - bw->range_ -= split + 1; - } else { - bw->range_ = split; - } - if (bw->range_ < 127) { // emit 'shift' bits out and renormalize - const int shift = kNorm[bw->range_]; - bw->range_ = kNewRange[bw->range_]; - bw->value_ <<= shift; - bw->nb_bits_ += shift; - if (bw->nb_bits_ > 0) kFlush(bw); - } - return bit; -} - -int VP8PutBitUniform(VP8BitWriter* const bw, int bit) { - const int split = bw->range_ >> 1; - if (bit) { - bw->value_ += split + 1; - bw->range_ -= split + 1; - } else { - bw->range_ = split; - } - if (bw->range_ < 127) { - bw->range_ = kNewRange[bw->range_]; - bw->value_ <<= 1; - bw->nb_bits_ += 1; - if (bw->nb_bits_ > 0) kFlush(bw); - } - return bit; -} - -void VP8PutValue(VP8BitWriter* const bw, int value, int nb_bits) { - int mask; - for (mask = 1 << (nb_bits - 1); mask; mask >>= 1) - VP8PutBitUniform(bw, value & mask); -} - -void VP8PutSignedValue(VP8BitWriter* const bw, int value, int nb_bits) { - if (!VP8PutBitUniform(bw, value != 0)) - return; - if (value < 0) { - VP8PutValue(bw, ((-value) << 1) | 1, nb_bits + 1); - } else { - VP8PutValue(bw, value << 1, nb_bits + 1); - } -} - -//------------------------------------------------------------------------------ - -int VP8BitWriterInit(VP8BitWriter* const bw, size_t expected_size) { - bw->range_ = 255 - 1; - bw->value_ = 0; - bw->run_ = 0; - bw->nb_bits_ = -8; - bw->pos_ = 0; - bw->max_pos_ = 0; - bw->error_ = 0; - bw->buf_ = NULL; - return (expected_size > 0) ? BitWriterResize(bw, expected_size) : 1; -} - -uint8_t* VP8BitWriterFinish(VP8BitWriter* const bw) { - VP8PutValue(bw, 0, 9 - bw->nb_bits_); - bw->nb_bits_ = 0; // pad with zeroes - kFlush(bw); - return bw->buf_; -} - -int VP8BitWriterAppend(VP8BitWriter* const bw, - const uint8_t* data, size_t size) { - assert(data); - if (bw->nb_bits_ != -8) return 0; // kFlush() must have been called - if (!BitWriterResize(bw, size)) return 0; - memcpy(bw->buf_ + bw->pos_, data, size); - bw->pos_ += size; - return 1; -} - -void VP8BitWriterWipeOut(VP8BitWriter* const bw) { - if (bw) { - free(bw->buf_); - memset(bw, 0, sizeof(*bw)); - } -} - -//------------------------------------------------------------------------------ -// VP8LBitWriter - -// Returns 1 on success. -static int VP8LBitWriterResize(VP8LBitWriter* const bw, size_t extra_size) { - uint8_t* allocated_buf; - size_t allocated_size; - const size_t current_size = VP8LBitWriterNumBytes(bw); - const uint64_t size_required_64b = (uint64_t)current_size + extra_size; - const size_t size_required = (size_t)size_required_64b; - if (size_required != size_required_64b) { - bw->error_ = 1; - return 0; - } - if (bw->max_bytes_ > 0 && size_required <= bw->max_bytes_) return 1; - allocated_size = (3 * bw->max_bytes_) >> 1; - if (allocated_size < size_required) allocated_size = size_required; - // make allocated size multiple of 1k - allocated_size = (((allocated_size >> 10) + 1) << 10); - allocated_buf = (uint8_t*)malloc(allocated_size); - if (allocated_buf == NULL) { - bw->error_ = 1; - return 0; - } - memcpy(allocated_buf, bw->buf_, current_size); - free(bw->buf_); - bw->buf_ = allocated_buf; - bw->max_bytes_ = allocated_size; - memset(allocated_buf + current_size, 0, allocated_size - current_size); - return 1; -} - -int VP8LBitWriterInit(VP8LBitWriter* const bw, size_t expected_size) { - memset(bw, 0, sizeof(*bw)); - return VP8LBitWriterResize(bw, expected_size); -} - -void VP8LBitWriterDestroy(VP8LBitWriter* const bw) { - if (bw != NULL) { - free(bw->buf_); - memset(bw, 0, sizeof(*bw)); - } -} - -void VP8LWriteBits(VP8LBitWriter* const bw, int n_bits, uint32_t bits) { - if (n_bits < 1) return; -#if !defined(__BIG_ENDIAN__) - // Technically, this branch of the code can write up to 25 bits at a time, - // but in prefix encoding, the maximum number of bits written is 18 at a time. - { - uint8_t* const p = &bw->buf_[bw->bit_pos_ >> 3]; - uint32_t v = *(const uint32_t*)p; - v |= bits << (bw->bit_pos_ & 7); - *(uint32_t*)p = v; - bw->bit_pos_ += n_bits; - } -#else // BIG_ENDIAN - { - uint8_t* p = &bw->buf_[bw->bit_pos_ >> 3]; - const int bits_reserved_in_first_byte = bw->bit_pos_ & 7; - const int bits_left_to_write = n_bits - 8 + bits_reserved_in_first_byte; - // implicit & 0xff is assumed for uint8_t arithmetics - *p++ |= bits << bits_reserved_in_first_byte; - bits >>= 8 - bits_reserved_in_first_byte; - if (bits_left_to_write >= 1) { - *p++ = bits; - bits >>= 8; - if (bits_left_to_write >= 9) { - *p++ = bits; - bits >>= 8; - } - } - assert(n_bits <= 25); - *p = bits; - bw->bit_pos_ += n_bits; - } -#endif - if ((bw->bit_pos_ >> 3) > (bw->max_bytes_ - 8)) { - const uint64_t extra_size = 32768ULL + bw->max_bytes_; - if (extra_size != (size_t)extra_size || - !VP8LBitWriterResize(bw, (size_t)extra_size)) { - bw->bit_pos_ = 0; - bw->error_ = 1; - } - } -} - -//------------------------------------------------------------------------------ - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif diff --git a/external/libwebp/utils/bit_writer.h b/external/libwebp/utils/bit_writer.h deleted file mode 100644 index f7ca08497f..0000000000 --- a/external/libwebp/utils/bit_writer.h +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright 2011 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Bit writing and boolean coder -// -// Author: Skal (pascal.massimino@gmail.com) - -#ifndef WEBP_UTILS_BIT_WRITER_H_ -#define WEBP_UTILS_BIT_WRITER_H_ - -#include "../webp/types.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -//------------------------------------------------------------------------------ -// Bit-writing - -typedef struct VP8BitWriter VP8BitWriter; -struct VP8BitWriter { - int32_t range_; // range-1 - int32_t value_; - int run_; // number of outstanding bits - int nb_bits_; // number of pending bits - uint8_t* buf_; // internal buffer. Re-allocated regularly. Not owned. - size_t pos_; - size_t max_pos_; - int error_; // true in case of error -}; - -// Initialize the object. Allocates some initial memory based on expected_size. -int VP8BitWriterInit(VP8BitWriter* const bw, size_t expected_size); -// Finalize the bitstream coding. Returns a pointer to the internal buffer. -uint8_t* VP8BitWriterFinish(VP8BitWriter* const bw); -// Release any pending memory and zeroes the object. Not a mandatory call. -// Only useful in case of error, when the internal buffer hasn't been grabbed! -void VP8BitWriterWipeOut(VP8BitWriter* const bw); - -int VP8PutBit(VP8BitWriter* const bw, int bit, int prob); -int VP8PutBitUniform(VP8BitWriter* const bw, int bit); -void VP8PutValue(VP8BitWriter* const bw, int value, int nb_bits); -void VP8PutSignedValue(VP8BitWriter* const bw, int value, int nb_bits); - -// Appends some bytes to the internal buffer. Data is copied. -int VP8BitWriterAppend(VP8BitWriter* const bw, - const uint8_t* data, size_t size); - -// return approximate write position (in bits) -static WEBP_INLINE uint64_t VP8BitWriterPos(const VP8BitWriter* const bw) { - return (uint64_t)(bw->pos_ + bw->run_) * 8 + 8 + bw->nb_bits_; -} - -// Returns a pointer to the internal buffer. -static WEBP_INLINE uint8_t* VP8BitWriterBuf(const VP8BitWriter* const bw) { - return bw->buf_; -} -// Returns the size of the internal buffer. -static WEBP_INLINE size_t VP8BitWriterSize(const VP8BitWriter* const bw) { - return bw->pos_; -} - -//------------------------------------------------------------------------------ -// VP8LBitWriter -// TODO(vikasa): VP8LBitWriter is copied as-is from lossless code. There's scope -// of re-using VP8BitWriter. Will evaluate once basic lossless encoder is -// implemented. - -typedef struct { - uint8_t* buf_; - size_t bit_pos_; - size_t max_bytes_; - - // After all bits are written, the caller must observe the state of - // error_. A value of 1 indicates that a memory allocation failure - // has happened during bit writing. A value of 0 indicates successful - // writing of bits. - int error_; -} VP8LBitWriter; - -static WEBP_INLINE size_t VP8LBitWriterNumBytes(VP8LBitWriter* const bw) { - return (bw->bit_pos_ + 7) >> 3; -} - -static WEBP_INLINE uint8_t* VP8LBitWriterFinish(VP8LBitWriter* const bw) { - return bw->buf_; -} - -// Returns 0 in case of memory allocation error. -int VP8LBitWriterInit(VP8LBitWriter* const bw, size_t expected_size); - -void VP8LBitWriterDestroy(VP8LBitWriter* const bw); - -// This function writes bits into bytes in increasing addresses, and within -// a byte least-significant-bit first. -// -// The function can write up to 16 bits in one go with WriteBits -// Example: let's assume that 3 bits (Rs below) have been written already: -// -// BYTE-0 BYTE+1 BYTE+2 -// -// 0000 0RRR 0000 0000 0000 0000 -// -// Now, we could write 5 or less bits in MSB by just sifting by 3 -// and OR'ing to BYTE-0. -// -// For n bits, we take the last 5 bytes, OR that with high bits in BYTE-0, -// and locate the rest in BYTE+1 and BYTE+2. -// -// VP8LBitWriter's error_ flag is set in case of memory allocation error. -void VP8LWriteBits(VP8LBitWriter* const bw, int n_bits, uint32_t bits); - -//------------------------------------------------------------------------------ - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif - -#endif /* WEBP_UTILS_BIT_WRITER_H_ */ diff --git a/external/libwebp/utils/color_cache.c b/external/libwebp/utils/color_cache.c deleted file mode 100644 index 560f81db10..0000000000 --- a/external/libwebp/utils/color_cache.c +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2012 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Color Cache for WebP Lossless -// -// Author: Jyrki Alakuijala (jyrki@google.com) - -#include <assert.h> -#include <stdlib.h> -#include "./color_cache.h" -#include "../utils/utils.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -//------------------------------------------------------------------------------ -// VP8LColorCache. - -int VP8LColorCacheInit(VP8LColorCache* const cc, int hash_bits) { - const int hash_size = 1 << hash_bits; - assert(cc != NULL); - assert(hash_bits > 0); - cc->colors_ = (uint32_t*)WebPSafeCalloc((uint64_t)hash_size, - sizeof(*cc->colors_)); - if (cc->colors_ == NULL) return 0; - cc->hash_shift_ = 32 - hash_bits; - return 1; -} - -void VP8LColorCacheClear(VP8LColorCache* const cc) { - if (cc != NULL) { - free(cc->colors_); - cc->colors_ = NULL; - } -} - -#if defined(__cplusplus) || defined(c_plusplus) -} -#endif diff --git a/external/libwebp/utils/color_cache.h b/external/libwebp/utils/color_cache.h deleted file mode 100644 index 13be629f36..0000000000 --- a/external/libwebp/utils/color_cache.h +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2012 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Color Cache for WebP Lossless -// -// Authors: Jyrki Alakuijala (jyrki@google.com) -// Urvang Joshi (urvang@google.com) - -#ifndef WEBP_UTILS_COLOR_CACHE_H_ -#define WEBP_UTILS_COLOR_CACHE_H_ - -#include "../webp/types.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -// Main color cache struct. -typedef struct { - uint32_t *colors_; // color entries - int hash_shift_; // Hash shift: 32 - hash_bits. -} VP8LColorCache; - -static const uint32_t kHashMul = 0x1e35a7bd; - -static WEBP_INLINE uint32_t VP8LColorCacheLookup( - const VP8LColorCache* const cc, uint32_t key) { - assert(key <= (~0U >> cc->hash_shift_)); - return cc->colors_[key]; -} - -static WEBP_INLINE void VP8LColorCacheInsert(const VP8LColorCache* const cc, - uint32_t argb) { - const uint32_t key = (kHashMul * argb) >> cc->hash_shift_; - cc->colors_[key] = argb; -} - -static WEBP_INLINE int VP8LColorCacheGetIndex(const VP8LColorCache* const cc, - uint32_t argb) { - return (kHashMul * argb) >> cc->hash_shift_; -} - -static WEBP_INLINE int VP8LColorCacheContains(const VP8LColorCache* const cc, - uint32_t argb) { - const uint32_t key = (kHashMul * argb) >> cc->hash_shift_; - return cc->colors_[key] == argb; -} - -//------------------------------------------------------------------------------ - -// Initializes the color cache with 'hash_bits' bits for the keys. -// Returns false in case of memory error. -int VP8LColorCacheInit(VP8LColorCache* const color_cache, int hash_bits); - -// Delete the memory associated to color cache. -void VP8LColorCacheClear(VP8LColorCache* const color_cache); - -//------------------------------------------------------------------------------ - -#if defined(__cplusplus) || defined(c_plusplus) -} -#endif - -#endif // WEBP_UTILS_COLOR_CACHE_H_ diff --git a/external/libwebp/utils/filters.c b/external/libwebp/utils/filters.c deleted file mode 100644 index 08f52a3d20..0000000000 --- a/external/libwebp/utils/filters.c +++ /dev/null @@ -1,229 +0,0 @@ -// Copyright 2011 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Spatial prediction using various filters -// -// Author: Urvang (urvang@google.com) - -#include "./filters.h" -#include <assert.h> -#include <stdlib.h> -#include <string.h> - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -//------------------------------------------------------------------------------ -// Helpful macro. - -# define SANITY_CHECK(in, out) \ - assert(in != NULL); \ - assert(out != NULL); \ - assert(width > 0); \ - assert(height > 0); \ - assert(bpp > 0); \ - assert(stride >= width * bpp); - -static WEBP_INLINE void PredictLine(const uint8_t* src, const uint8_t* pred, - uint8_t* dst, int length, int inverse) { - int i; - if (inverse) { - for (i = 0; i < length; ++i) dst[i] = src[i] + pred[i]; - } else { - for (i = 0; i < length; ++i) dst[i] = src[i] - pred[i]; - } -} - -//------------------------------------------------------------------------------ -// Horizontal filter. - -static WEBP_INLINE void DoHorizontalFilter(const uint8_t* in, - int width, int height, int bpp, int stride, int inverse, uint8_t* out) { - int h; - const uint8_t* preds = (inverse ? out : in); - SANITY_CHECK(in, out); - - // Filter line-by-line. - for (h = 0; h < height; ++h) { - // Leftmost pixel is predicted from above (except for topmost scanline). - if (h == 0) { - memcpy((void*)out, (const void*)in, bpp); - } else { - PredictLine(in, preds - stride, out, bpp, inverse); - } - PredictLine(in + bpp, preds, out + bpp, bpp * (width - 1), inverse); - preds += stride; - in += stride; - out += stride; - } -} - -static void HorizontalFilter(const uint8_t* data, int width, int height, - int bpp, int stride, uint8_t* filtered_data) { - DoHorizontalFilter(data, width, height, bpp, stride, 0, filtered_data); -} - -static void HorizontalUnfilter(const uint8_t* data, int width, int height, - int bpp, int stride, uint8_t* recon_data) { - DoHorizontalFilter(data, width, height, bpp, stride, 1, recon_data); -} - -//------------------------------------------------------------------------------ -// Vertical filter. - -static WEBP_INLINE void DoVerticalFilter(const uint8_t* in, - int width, int height, int bpp, int stride, int inverse, uint8_t* out) { - int h; - const uint8_t* preds = (inverse ? out : in); - SANITY_CHECK(in, out); - - // Very first top-left pixel is copied. - memcpy((void*)out, (const void*)in, bpp); - // Rest of top scan-line is left-predicted. - PredictLine(in + bpp, preds, out + bpp, bpp * (width - 1), inverse); - - // Filter line-by-line. - for (h = 1; h < height; ++h) { - in += stride; - out += stride; - PredictLine(in, preds, out, bpp * width, inverse); - preds += stride; - } -} - -static void VerticalFilter(const uint8_t* data, int width, int height, - int bpp, int stride, uint8_t* filtered_data) { - DoVerticalFilter(data, width, height, bpp, stride, 0, filtered_data); -} - -static void VerticalUnfilter(const uint8_t* data, int width, int height, - int bpp, int stride, uint8_t* recon_data) { - DoVerticalFilter(data, width, height, bpp, stride, 1, recon_data); -} - -//------------------------------------------------------------------------------ -// Gradient filter. - -static WEBP_INLINE int GradientPredictor(uint8_t a, uint8_t b, uint8_t c) { - const int g = a + b - c; - return (g < 0) ? 0 : (g > 255) ? 255 : g; -} - -static WEBP_INLINE -void DoGradientFilter(const uint8_t* in, int width, int height, - int bpp, int stride, int inverse, uint8_t* out) { - const uint8_t* preds = (inverse ? out : in); - int h; - SANITY_CHECK(in, out); - - // left prediction for top scan-line - memcpy((void*)out, (const void*)in, bpp); - PredictLine(in + bpp, preds, out + bpp, bpp * (width - 1), inverse); - - // Filter line-by-line. - for (h = 1; h < height; ++h) { - int w; - preds += stride; - in += stride; - out += stride; - // leftmost pixel: predict from above. - PredictLine(in, preds - stride, out, bpp, inverse); - for (w = bpp; w < width * bpp; ++w) { - const int pred = GradientPredictor(preds[w - bpp], - preds[w - stride], - preds[w - stride - bpp]); - out[w] = in[w] + (inverse ? pred : -pred); - } - } -} - -static void GradientFilter(const uint8_t* data, int width, int height, - int bpp, int stride, uint8_t* filtered_data) { - DoGradientFilter(data, width, height, bpp, stride, 0, filtered_data); -} - -static void GradientUnfilter(const uint8_t* data, int width, int height, - int bpp, int stride, uint8_t* recon_data) { - DoGradientFilter(data, width, height, bpp, stride, 1, recon_data); -} - -#undef SANITY_CHECK - -// ----------------------------------------------------------------------------- -// Quick estimate of a potentially interesting filter mode to try, in addition -// to the default NONE. - -#define SMAX 16 -#define SDIFF(a, b) (abs((a) - (b)) >> 4) // Scoring diff, in [0..SMAX) - -WEBP_FILTER_TYPE EstimateBestFilter(const uint8_t* data, - int width, int height, int stride) { - int i, j; - int bins[WEBP_FILTER_LAST][SMAX]; - memset(bins, 0, sizeof(bins)); - // We only sample every other pixels. That's enough. - for (j = 2; j < height - 1; j += 2) { - const uint8_t* const p = data + j * stride; - int mean = p[0]; - for (i = 2; i < width - 1; i += 2) { - const int diff0 = SDIFF(p[i], mean); - const int diff1 = SDIFF(p[i], p[i - 1]); - const int diff2 = SDIFF(p[i], p[i - width]); - const int grad_pred = - GradientPredictor(p[i - 1], p[i - width], p[i - width - 1]); - const int diff3 = SDIFF(p[i], grad_pred); - bins[WEBP_FILTER_NONE][diff0] = 1; - bins[WEBP_FILTER_HORIZONTAL][diff1] = 1; - bins[WEBP_FILTER_VERTICAL][diff2] = 1; - bins[WEBP_FILTER_GRADIENT][diff3] = 1; - mean = (3 * mean + p[i] + 2) >> 2; - } - } - { - WEBP_FILTER_TYPE filter, best_filter = WEBP_FILTER_NONE; - int best_score = 0x7fffffff; - for (filter = WEBP_FILTER_NONE; filter < WEBP_FILTER_LAST; ++filter) { - int score = 0; - for (i = 0; i < SMAX; ++i) { - if (bins[filter][i] > 0) { - score += i; - } - } - if (score < best_score) { - best_score = score; - best_filter = filter; - } - } - return best_filter; - } -} - -#undef SMAX -#undef SDIFF - -//------------------------------------------------------------------------------ - -const WebPFilterFunc WebPFilters[WEBP_FILTER_LAST] = { - NULL, // WEBP_FILTER_NONE - HorizontalFilter, // WEBP_FILTER_HORIZONTAL - VerticalFilter, // WEBP_FILTER_VERTICAL - GradientFilter // WEBP_FILTER_GRADIENT -}; - -const WebPFilterFunc WebPUnfilters[WEBP_FILTER_LAST] = { - NULL, // WEBP_FILTER_NONE - HorizontalUnfilter, // WEBP_FILTER_HORIZONTAL - VerticalUnfilter, // WEBP_FILTER_VERTICAL - GradientUnfilter // WEBP_FILTER_GRADIENT -}; - -//------------------------------------------------------------------------------ - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif diff --git a/external/libwebp/utils/filters.h b/external/libwebp/utils/filters.h deleted file mode 100644 index c5cdbd6deb..0000000000 --- a/external/libwebp/utils/filters.h +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2011 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Spatial prediction using various filters -// -// Author: Urvang (urvang@google.com) - -#ifndef WEBP_UTILS_FILTERS_H_ -#define WEBP_UTILS_FILTERS_H_ - -#include "../webp/types.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -// Filters. -typedef enum { - WEBP_FILTER_NONE = 0, - WEBP_FILTER_HORIZONTAL, - WEBP_FILTER_VERTICAL, - WEBP_FILTER_GRADIENT, - WEBP_FILTER_LAST = WEBP_FILTER_GRADIENT + 1, // end marker - WEBP_FILTER_BEST, - WEBP_FILTER_FAST -} WEBP_FILTER_TYPE; - -typedef void (*WebPFilterFunc)(const uint8_t* in, int width, int height, - int bpp, int stride, uint8_t* out); - -// Filter the given data using the given predictor. -// 'in' corresponds to a 2-dimensional pixel array of size (stride * height) -// in raster order. -// 'bpp' is number of bytes per pixel, and -// 'stride' is number of bytes per scan line (with possible padding). -// 'out' should be pre-allocated. -extern const WebPFilterFunc WebPFilters[WEBP_FILTER_LAST]; - -// Reconstruct the original data from the given filtered data. -extern const WebPFilterFunc WebPUnfilters[WEBP_FILTER_LAST]; - -// Fast estimate of a potentially good filter. -extern WEBP_FILTER_TYPE EstimateBestFilter(const uint8_t* data, - int width, int height, int stride); - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif - -#endif /* WEBP_UTILS_FILTERS_H_ */ diff --git a/external/libwebp/utils/huffman.c b/external/libwebp/utils/huffman.c deleted file mode 100644 index 41529cc9da..0000000000 --- a/external/libwebp/utils/huffman.c +++ /dev/null @@ -1,238 +0,0 @@ -// Copyright 2012 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Utilities for building and looking up Huffman trees. -// -// Author: Urvang Joshi (urvang@google.com) - -#include <assert.h> -#include <stdlib.h> -#include "./huffman.h" -#include "../utils/utils.h" -#include "../webp/format_constants.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -#define NON_EXISTENT_SYMBOL (-1) - -static void TreeNodeInit(HuffmanTreeNode* const node) { - node->children_ = -1; // means: 'unassigned so far' -} - -static int NodeIsEmpty(const HuffmanTreeNode* const node) { - return (node->children_ < 0); -} - -static int IsFull(const HuffmanTree* const tree) { - return (tree->num_nodes_ == tree->max_nodes_); -} - -static void AssignChildren(HuffmanTree* const tree, - HuffmanTreeNode* const node) { - HuffmanTreeNode* const children = tree->root_ + tree->num_nodes_; - node->children_ = (int)(children - node); - assert(children - node == (int)(children - node)); - tree->num_nodes_ += 2; - TreeNodeInit(children + 0); - TreeNodeInit(children + 1); -} - -static int TreeInit(HuffmanTree* const tree, int num_leaves) { - assert(tree != NULL); - if (num_leaves == 0) return 0; - // We allocate maximum possible nodes in the tree at once. - // Note that a Huffman tree is a full binary tree; and in a full binary tree - // with L leaves, the total number of nodes N = 2 * L - 1. - tree->max_nodes_ = 2 * num_leaves - 1; - tree->root_ = (HuffmanTreeNode*)WebPSafeMalloc((uint64_t)tree->max_nodes_, - sizeof(*tree->root_)); - if (tree->root_ == NULL) return 0; - TreeNodeInit(tree->root_); // Initialize root. - tree->num_nodes_ = 1; - return 1; -} - -void HuffmanTreeRelease(HuffmanTree* const tree) { - if (tree != NULL) { - free(tree->root_); - tree->root_ = NULL; - tree->max_nodes_ = 0; - tree->num_nodes_ = 0; - } -} - -int HuffmanCodeLengthsToCodes(const int* const code_lengths, - int code_lengths_size, int* const huff_codes) { - int symbol; - int code_len; - int code_length_hist[MAX_ALLOWED_CODE_LENGTH + 1] = { 0 }; - int curr_code; - int next_codes[MAX_ALLOWED_CODE_LENGTH + 1] = { 0 }; - int max_code_length = 0; - - assert(code_lengths != NULL); - assert(code_lengths_size > 0); - assert(huff_codes != NULL); - - // Calculate max code length. - for (symbol = 0; symbol < code_lengths_size; ++symbol) { - if (code_lengths[symbol] > max_code_length) { - max_code_length = code_lengths[symbol]; - } - } - if (max_code_length > MAX_ALLOWED_CODE_LENGTH) return 0; - - // Calculate code length histogram. - for (symbol = 0; symbol < code_lengths_size; ++symbol) { - ++code_length_hist[code_lengths[symbol]]; - } - code_length_hist[0] = 0; - - // Calculate the initial values of 'next_codes' for each code length. - // next_codes[code_len] denotes the code to be assigned to the next symbol - // of code length 'code_len'. - curr_code = 0; - next_codes[0] = -1; // Unused, as code length = 0 implies code doesn't exist. - for (code_len = 1; code_len <= max_code_length; ++code_len) { - curr_code = (curr_code + code_length_hist[code_len - 1]) << 1; - next_codes[code_len] = curr_code; - } - - // Get symbols. - for (symbol = 0; symbol < code_lengths_size; ++symbol) { - if (code_lengths[symbol] > 0) { - huff_codes[symbol] = next_codes[code_lengths[symbol]]++; - } else { - huff_codes[symbol] = NON_EXISTENT_SYMBOL; - } - } - return 1; -} - -static int TreeAddSymbol(HuffmanTree* const tree, - int symbol, int code, int code_length) { - HuffmanTreeNode* node = tree->root_; - const HuffmanTreeNode* const max_node = tree->root_ + tree->max_nodes_; - while (code_length-- > 0) { - if (node >= max_node) { - return 0; - } - if (NodeIsEmpty(node)) { - if (IsFull(tree)) return 0; // error: too many symbols. - AssignChildren(tree, node); - } else if (HuffmanTreeNodeIsLeaf(node)) { - return 0; // leaf is already occupied. - } - node += node->children_ + ((code >> code_length) & 1); - } - if (NodeIsEmpty(node)) { - node->children_ = 0; // turn newly created node into a leaf. - } else if (!HuffmanTreeNodeIsLeaf(node)) { - return 0; // trying to assign a symbol to already used code. - } - node->symbol_ = symbol; // Add symbol in this node. - return 1; -} - -int HuffmanTreeBuildImplicit(HuffmanTree* const tree, - const int* const code_lengths, - int code_lengths_size) { - int symbol; - int num_symbols = 0; - int root_symbol = 0; - - assert(tree != NULL); - assert(code_lengths != NULL); - - // Find out number of symbols and the root symbol. - for (symbol = 0; symbol < code_lengths_size; ++symbol) { - if (code_lengths[symbol] > 0) { - // Note: code length = 0 indicates non-existent symbol. - ++num_symbols; - root_symbol = symbol; - } - } - - // Initialize the tree. Will fail for num_symbols = 0 - if (!TreeInit(tree, num_symbols)) return 0; - - // Build tree. - if (num_symbols == 1) { // Trivial case. - const int max_symbol = code_lengths_size; - if (root_symbol < 0 || root_symbol >= max_symbol) { - HuffmanTreeRelease(tree); - return 0; - } - return TreeAddSymbol(tree, root_symbol, 0, 0); - } else { // Normal case. - int ok = 0; - - // Get Huffman codes from the code lengths. - int* const codes = - (int*)WebPSafeMalloc((uint64_t)code_lengths_size, sizeof(*codes)); - if (codes == NULL) goto End; - - if (!HuffmanCodeLengthsToCodes(code_lengths, code_lengths_size, codes)) { - goto End; - } - - // Add symbols one-by-one. - for (symbol = 0; symbol < code_lengths_size; ++symbol) { - if (code_lengths[symbol] > 0) { - if (!TreeAddSymbol(tree, symbol, codes[symbol], code_lengths[symbol])) { - goto End; - } - } - } - ok = 1; - End: - free(codes); - ok = ok && IsFull(tree); - if (!ok) HuffmanTreeRelease(tree); - return ok; - } -} - -int HuffmanTreeBuildExplicit(HuffmanTree* const tree, - const int* const code_lengths, - const int* const codes, - const int* const symbols, int max_symbol, - int num_symbols) { - int ok = 0; - int i; - - assert(tree != NULL); - assert(code_lengths != NULL); - assert(codes != NULL); - assert(symbols != NULL); - - // Initialize the tree. Will fail if num_symbols = 0. - if (!TreeInit(tree, num_symbols)) return 0; - - // Add symbols one-by-one. - for (i = 0; i < num_symbols; ++i) { - if (codes[i] != NON_EXISTENT_SYMBOL) { - if (symbols[i] < 0 || symbols[i] >= max_symbol) { - goto End; - } - if (!TreeAddSymbol(tree, symbols[i], codes[i], code_lengths[i])) { - goto End; - } - } - } - ok = 1; - End: - ok = ok && IsFull(tree); - if (!ok) HuffmanTreeRelease(tree); - return ok; -} - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif diff --git a/external/libwebp/utils/huffman.h b/external/libwebp/utils/huffman.h deleted file mode 100644 index 70220a67fb..0000000000 --- a/external/libwebp/utils/huffman.h +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright 2012 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Utilities for building and looking up Huffman trees. -// -// Author: Urvang Joshi (urvang@google.com) - -#ifndef WEBP_UTILS_HUFFMAN_H_ -#define WEBP_UTILS_HUFFMAN_H_ - -#include <assert.h> -#include "../webp/types.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -// A node of a Huffman tree. -typedef struct { - int symbol_; - int children_; // delta offset to both children (contiguous) or 0 if leaf. -} HuffmanTreeNode; - -// Huffman Tree. -typedef struct HuffmanTree HuffmanTree; -struct HuffmanTree { - HuffmanTreeNode* root_; // all the nodes, starting at root. - int max_nodes_; // max number of nodes - int num_nodes_; // number of currently occupied nodes -}; - -// Returns true if the given node is a leaf of the Huffman tree. -static WEBP_INLINE int HuffmanTreeNodeIsLeaf( - const HuffmanTreeNode* const node) { - return (node->children_ == 0); -} - -// Go down one level. Most critical function. 'right_child' must be 0 or 1. -static WEBP_INLINE const HuffmanTreeNode* HuffmanTreeNextNode( - const HuffmanTreeNode* node, int right_child) { - return node + node->children_ + right_child; -} - -// Releases the nodes of the Huffman tree. -// Note: It does NOT free 'tree' itself. -void HuffmanTreeRelease(HuffmanTree* const tree); - -// Builds Huffman tree assuming code lengths are implicitly in symbol order. -// Returns false in case of error (invalid tree or memory error). -int HuffmanTreeBuildImplicit(HuffmanTree* const tree, - const int* const code_lengths, - int code_lengths_size); - -// Build a Huffman tree with explicitly given lists of code lengths, codes -// and symbols. Verifies that all symbols added are smaller than max_symbol. -// Returns false in case of an invalid symbol, invalid tree or memory error. -int HuffmanTreeBuildExplicit(HuffmanTree* const tree, - const int* const code_lengths, - const int* const codes, - const int* const symbols, int max_symbol, - int num_symbols); - -// Utility: converts Huffman code lengths to corresponding Huffman codes. -// 'huff_codes' should be pre-allocated. -// Returns false in case of error (memory allocation, invalid codes). -int HuffmanCodeLengthsToCodes(const int* const code_lengths, - int code_lengths_size, int* const huff_codes); - - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif - -#endif // WEBP_UTILS_HUFFMAN_H_ diff --git a/external/libwebp/utils/huffman_encode.c b/external/libwebp/utils/huffman_encode.c deleted file mode 100644 index 8ccd291d22..0000000000 --- a/external/libwebp/utils/huffman_encode.c +++ /dev/null @@ -1,439 +0,0 @@ -// Copyright 2011 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Author: Jyrki Alakuijala (jyrki@google.com) -// -// Entropy encoding (Huffman) for webp lossless. - -#include <assert.h> -#include <stdlib.h> -#include <string.h> -#include "./huffman_encode.h" -#include "../utils/utils.h" -#include "../webp/format_constants.h" - -// ----------------------------------------------------------------------------- -// Util function to optimize the symbol map for RLE coding - -// Heuristics for selecting the stride ranges to collapse. -static int ValuesShouldBeCollapsedToStrideAverage(int a, int b) { - return abs(a - b) < 4; -} - -// Change the population counts in a way that the consequent -// Hufmann tree compression, especially its RLE-part, give smaller output. -static int OptimizeHuffmanForRle(int length, int* const counts) { - uint8_t* good_for_rle; - // 1) Let's make the Huffman code more compatible with rle encoding. - int i; - for (; length >= 0; --length) { - if (length == 0) { - return 1; // All zeros. - } - if (counts[length - 1] != 0) { - // Now counts[0..length - 1] does not have trailing zeros. - break; - } - } - // 2) Let's mark all population counts that already can be encoded - // with an rle code. - good_for_rle = (uint8_t*)calloc(length, 1); - if (good_for_rle == NULL) { - return 0; - } - { - // Let's not spoil any of the existing good rle codes. - // Mark any seq of 0's that is longer as 5 as a good_for_rle. - // Mark any seq of non-0's that is longer as 7 as a good_for_rle. - int symbol = counts[0]; - int stride = 0; - for (i = 0; i < length + 1; ++i) { - if (i == length || counts[i] != symbol) { - if ((symbol == 0 && stride >= 5) || - (symbol != 0 && stride >= 7)) { - int k; - for (k = 0; k < stride; ++k) { - good_for_rle[i - k - 1] = 1; - } - } - stride = 1; - if (i != length) { - symbol = counts[i]; - } - } else { - ++stride; - } - } - } - // 3) Let's replace those population counts that lead to more rle codes. - { - int stride = 0; - int limit = counts[0]; - int sum = 0; - for (i = 0; i < length + 1; ++i) { - if (i == length || good_for_rle[i] || - (i != 0 && good_for_rle[i - 1]) || - !ValuesShouldBeCollapsedToStrideAverage(counts[i], limit)) { - if (stride >= 4 || (stride >= 3 && sum == 0)) { - int k; - // The stride must end, collapse what we have, if we have enough (4). - int count = (sum + stride / 2) / stride; - if (count < 1) { - count = 1; - } - if (sum == 0) { - // Don't make an all zeros stride to be upgraded to ones. - count = 0; - } - for (k = 0; k < stride; ++k) { - // We don't want to change value at counts[i], - // that is already belonging to the next stride. Thus - 1. - counts[i - k - 1] = count; - } - } - stride = 0; - sum = 0; - if (i < length - 3) { - // All interesting strides have a count of at least 4, - // at least when non-zeros. - limit = (counts[i] + counts[i + 1] + - counts[i + 2] + counts[i + 3] + 2) / 4; - } else if (i < length) { - limit = counts[i]; - } else { - limit = 0; - } - } - ++stride; - if (i != length) { - sum += counts[i]; - if (stride >= 4) { - limit = (sum + stride / 2) / stride; - } - } - } - } - free(good_for_rle); - return 1; -} - -typedef struct { - int total_count_; - int value_; - int pool_index_left_; - int pool_index_right_; -} HuffmanTree; - -// A comparer function for two Huffman trees: sorts first by 'total count' -// (more comes first), and then by 'value' (more comes first). -static int CompareHuffmanTrees(const void* ptr1, const void* ptr2) { - const HuffmanTree* const t1 = (const HuffmanTree*)ptr1; - const HuffmanTree* const t2 = (const HuffmanTree*)ptr2; - if (t1->total_count_ > t2->total_count_) { - return -1; - } else if (t1->total_count_ < t2->total_count_) { - return 1; - } else { - if (t1->value_ < t2->value_) { - return -1; - } - if (t1->value_ > t2->value_) { - return 1; - } - return 0; - } -} - -static void SetBitDepths(const HuffmanTree* const tree, - const HuffmanTree* const pool, - uint8_t* const bit_depths, int level) { - if (tree->pool_index_left_ >= 0) { - SetBitDepths(&pool[tree->pool_index_left_], pool, bit_depths, level + 1); - SetBitDepths(&pool[tree->pool_index_right_], pool, bit_depths, level + 1); - } else { - bit_depths[tree->value_] = level; - } -} - -// Create an optimal Huffman tree. -// -// (data,length): population counts. -// tree_limit: maximum bit depth (inclusive) of the codes. -// bit_depths[]: how many bits are used for the symbol. -// -// Returns 0 when an error has occurred. -// -// The catch here is that the tree cannot be arbitrarily deep -// -// count_limit is the value that is to be faked as the minimum value -// and this minimum value is raised until the tree matches the -// maximum length requirement. -// -// This algorithm is not of excellent performance for very long data blocks, -// especially when population counts are longer than 2**tree_limit, but -// we are not planning to use this with extremely long blocks. -// -// See http://en.wikipedia.org/wiki/Huffman_coding -static int GenerateOptimalTree(const int* const histogram, int histogram_size, - int tree_depth_limit, - uint8_t* const bit_depths) { - int count_min; - HuffmanTree* tree_pool; - HuffmanTree* tree; - int tree_size_orig = 0; - int i; - - for (i = 0; i < histogram_size; ++i) { - if (histogram[i] != 0) { - ++tree_size_orig; - } - } - - // 3 * tree_size is enough to cover all the nodes representing a - // population and all the inserted nodes combining two existing nodes. - // The tree pool needs 2 * (tree_size_orig - 1) entities, and the - // tree needs exactly tree_size_orig entities. - tree = (HuffmanTree*)WebPSafeMalloc(3ULL * tree_size_orig, sizeof(*tree)); - if (tree == NULL) return 0; - tree_pool = tree + tree_size_orig; - - // For block sizes with less than 64k symbols we never need to do a - // second iteration of this loop. - // If we actually start running inside this loop a lot, we would perhaps - // be better off with the Katajainen algorithm. - assert(tree_size_orig <= (1 << (tree_depth_limit - 1))); - for (count_min = 1; ; count_min *= 2) { - int tree_size = tree_size_orig; - // We need to pack the Huffman tree in tree_depth_limit bits. - // So, we try by faking histogram entries to be at least 'count_min'. - int idx = 0; - int j; - for (j = 0; j < histogram_size; ++j) { - if (histogram[j] != 0) { - const int count = - (histogram[j] < count_min) ? count_min : histogram[j]; - tree[idx].total_count_ = count; - tree[idx].value_ = j; - tree[idx].pool_index_left_ = -1; - tree[idx].pool_index_right_ = -1; - ++idx; - } - } - - // Build the Huffman tree. - qsort(tree, tree_size, sizeof(*tree), CompareHuffmanTrees); - - if (tree_size > 1) { // Normal case. - int tree_pool_size = 0; - while (tree_size > 1) { // Finish when we have only one root. - int count; - tree_pool[tree_pool_size++] = tree[tree_size - 1]; - tree_pool[tree_pool_size++] = tree[tree_size - 2]; - count = tree_pool[tree_pool_size - 1].total_count_ + - tree_pool[tree_pool_size - 2].total_count_; - tree_size -= 2; - { - // Search for the insertion point. - int k; - for (k = 0; k < tree_size; ++k) { - if (tree[k].total_count_ <= count) { - break; - } - } - memmove(tree + (k + 1), tree + k, (tree_size - k) * sizeof(*tree)); - tree[k].total_count_ = count; - tree[k].value_ = -1; - - tree[k].pool_index_left_ = tree_pool_size - 1; - tree[k].pool_index_right_ = tree_pool_size - 2; - tree_size = tree_size + 1; - } - } - SetBitDepths(&tree[0], tree_pool, bit_depths, 0); - } else if (tree_size == 1) { // Trivial case: only one element. - bit_depths[tree[0].value_] = 1; - } - - { - // Test if this Huffman tree satisfies our 'tree_depth_limit' criteria. - int max_depth = bit_depths[0]; - for (j = 1; j < histogram_size; ++j) { - if (max_depth < bit_depths[j]) { - max_depth = bit_depths[j]; - } - } - if (max_depth <= tree_depth_limit) { - break; - } - } - } - free(tree); - return 1; -} - -// ----------------------------------------------------------------------------- -// Coding of the Huffman tree values - -static HuffmanTreeToken* CodeRepeatedValues(int repetitions, - HuffmanTreeToken* tokens, - int value, int prev_value) { - assert(value <= MAX_ALLOWED_CODE_LENGTH); - if (value != prev_value) { - tokens->code = value; - tokens->extra_bits = 0; - ++tokens; - --repetitions; - } - while (repetitions >= 1) { - if (repetitions < 3) { - int i; - for (i = 0; i < repetitions; ++i) { - tokens->code = value; - tokens->extra_bits = 0; - ++tokens; - } - break; - } else if (repetitions < 7) { - tokens->code = 16; - tokens->extra_bits = repetitions - 3; - ++tokens; - break; - } else { - tokens->code = 16; - tokens->extra_bits = 3; - ++tokens; - repetitions -= 6; - } - } - return tokens; -} - -static HuffmanTreeToken* CodeRepeatedZeros(int repetitions, - HuffmanTreeToken* tokens) { - while (repetitions >= 1) { - if (repetitions < 3) { - int i; - for (i = 0; i < repetitions; ++i) { - tokens->code = 0; // 0-value - tokens->extra_bits = 0; - ++tokens; - } - break; - } else if (repetitions < 11) { - tokens->code = 17; - tokens->extra_bits = repetitions - 3; - ++tokens; - break; - } else if (repetitions < 139) { - tokens->code = 18; - tokens->extra_bits = repetitions - 11; - ++tokens; - break; - } else { - tokens->code = 18; - tokens->extra_bits = 0x7f; // 138 repeated 0s - ++tokens; - repetitions -= 138; - } - } - return tokens; -} - -int VP8LCreateCompressedHuffmanTree(const HuffmanTreeCode* const tree, - HuffmanTreeToken* tokens, int max_tokens) { - HuffmanTreeToken* const starting_token = tokens; - HuffmanTreeToken* const ending_token = tokens + max_tokens; - const int depth_size = tree->num_symbols; - int prev_value = 8; // 8 is the initial value for rle. - int i = 0; - assert(tokens != NULL); - while (i < depth_size) { - const int value = tree->code_lengths[i]; - int k = i + 1; - int runs; - while (k < depth_size && tree->code_lengths[k] == value) ++k; - runs = k - i; - if (value == 0) { - tokens = CodeRepeatedZeros(runs, tokens); - } else { - tokens = CodeRepeatedValues(runs, tokens, value, prev_value); - prev_value = value; - } - i += runs; - assert(tokens <= ending_token); - } - (void)ending_token; // suppress 'unused variable' warning - return (int)(tokens - starting_token); -} - -// ----------------------------------------------------------------------------- - -// Pre-reversed 4-bit values. -static const uint8_t kReversedBits[16] = { - 0x0, 0x8, 0x4, 0xc, 0x2, 0xa, 0x6, 0xe, - 0x1, 0x9, 0x5, 0xd, 0x3, 0xb, 0x7, 0xf -}; - -static uint32_t ReverseBits(int num_bits, uint32_t bits) { - uint32_t retval = 0; - int i = 0; - while (i < num_bits) { - i += 4; - retval |= kReversedBits[bits & 0xf] << (MAX_ALLOWED_CODE_LENGTH + 1 - i); - bits >>= 4; - } - retval >>= (MAX_ALLOWED_CODE_LENGTH + 1 - num_bits); - return retval; -} - -// Get the actual bit values for a tree of bit depths. -static void ConvertBitDepthsToSymbols(HuffmanTreeCode* const tree) { - // 0 bit-depth means that the symbol does not exist. - int i; - int len; - uint32_t next_code[MAX_ALLOWED_CODE_LENGTH + 1]; - int depth_count[MAX_ALLOWED_CODE_LENGTH + 1] = { 0 }; - - assert(tree != NULL); - len = tree->num_symbols; - for (i = 0; i < len; ++i) { - const int code_length = tree->code_lengths[i]; - assert(code_length <= MAX_ALLOWED_CODE_LENGTH); - ++depth_count[code_length]; - } - depth_count[0] = 0; // ignore unused symbol - next_code[0] = 0; - { - uint32_t code = 0; - for (i = 1; i <= MAX_ALLOWED_CODE_LENGTH; ++i) { - code = (code + depth_count[i - 1]) << 1; - next_code[i] = code; - } - } - for (i = 0; i < len; ++i) { - const int code_length = tree->code_lengths[i]; - tree->codes[i] = ReverseBits(code_length, next_code[code_length]++); - } -} - -// ----------------------------------------------------------------------------- -// Main entry point - -int VP8LCreateHuffmanTree(int* const histogram, int tree_depth_limit, - HuffmanTreeCode* const tree) { - const int num_symbols = tree->num_symbols; - if (!OptimizeHuffmanForRle(num_symbols, histogram)) { - return 0; - } - if (!GenerateOptimalTree(histogram, num_symbols, - tree_depth_limit, tree->code_lengths)) { - return 0; - } - // Create the actual bit codes for the bit lengths. - ConvertBitDepthsToSymbols(tree); - return 1; -} diff --git a/external/libwebp/utils/huffman_encode.h b/external/libwebp/utils/huffman_encode.h deleted file mode 100644 index cc3b38d330..0000000000 --- a/external/libwebp/utils/huffman_encode.h +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2011 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Author: Jyrki Alakuijala (jyrki@google.com) -// -// Entropy encoding (Huffman) for webp lossless - -#ifndef WEBP_UTILS_HUFFMAN_ENCODE_H_ -#define WEBP_UTILS_HUFFMAN_ENCODE_H_ - -#include "../webp/types.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -// Struct for holding the tree header in coded form. -typedef struct { - uint8_t code; // value (0..15) or escape code (16,17,18) - uint8_t extra_bits; // extra bits for escape codes -} HuffmanTreeToken; - -// Struct to represent the tree codes (depth and bits array). -typedef struct { - int num_symbols; // Number of symbols. - uint8_t* code_lengths; // Code lengths of the symbols. - uint16_t* codes; // Symbol Codes. -} HuffmanTreeCode; - -// Turn the Huffman tree into a token sequence. -// Returns the number of tokens used. -int VP8LCreateCompressedHuffmanTree(const HuffmanTreeCode* const tree, - HuffmanTreeToken* tokens, int max_tokens); - -// Create an optimized tree, and tokenize it. -int VP8LCreateHuffmanTree(int* const histogram, int tree_depth_limit, - HuffmanTreeCode* const tree); - -#if defined(__cplusplus) || defined(c_plusplus) -} -#endif - -#endif // WEBP_UTILS_HUFFMAN_ENCODE_H_ diff --git a/external/libwebp/utils/quant_levels.c b/external/libwebp/utils/quant_levels.c deleted file mode 100644 index f6884392aa..0000000000 --- a/external/libwebp/utils/quant_levels.c +++ /dev/null @@ -1,154 +0,0 @@ -// Copyright 2011 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Quantize levels for specified number of quantization-levels ([2, 256]). -// Min and max values are preserved (usual 0 and 255 for alpha plane). -// -// Author: Skal (pascal.massimino@gmail.com) - -#include <assert.h> - -#include "./quant_levels.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -#define NUM_SYMBOLS 256 - -#define MAX_ITER 6 // Maximum number of convergence steps. -#define ERROR_THRESHOLD 1e-4 // MSE stopping criterion. - -// ----------------------------------------------------------------------------- -// Quantize levels. - -int QuantizeLevels(uint8_t* const data, int width, int height, - int num_levels, uint64_t* const sse) { - int freq[NUM_SYMBOLS] = { 0 }; - int q_level[NUM_SYMBOLS] = { 0 }; - double inv_q_level[NUM_SYMBOLS] = { 0 }; - int min_s = 255, max_s = 0; - const size_t data_size = height * width; - int i, num_levels_in, iter; - double last_err = 1.e38, err = 0.; - const double err_threshold = ERROR_THRESHOLD * data_size; - - if (data == NULL) { - return 0; - } - - if (width <= 0 || height <= 0) { - return 0; - } - - if (num_levels < 2 || num_levels > 256) { - return 0; - } - - { - size_t n; - num_levels_in = 0; - for (n = 0; n < data_size; ++n) { - num_levels_in += (freq[data[n]] == 0); - if (min_s > data[n]) min_s = data[n]; - if (max_s < data[n]) max_s = data[n]; - ++freq[data[n]]; - } - } - - if (num_levels_in <= num_levels) goto End; // nothing to do! - - // Start with uniformly spread centroids. - for (i = 0; i < num_levels; ++i) { - inv_q_level[i] = min_s + (double)(max_s - min_s) * i / (num_levels - 1); - } - - // Fixed values. Won't be changed. - q_level[min_s] = 0; - q_level[max_s] = num_levels - 1; - assert(inv_q_level[0] == min_s); - assert(inv_q_level[num_levels - 1] == max_s); - - // k-Means iterations. - for (iter = 0; iter < MAX_ITER; ++iter) { - double q_sum[NUM_SYMBOLS] = { 0 }; - double q_count[NUM_SYMBOLS] = { 0 }; - int s, slot = 0; - - // Assign classes to representatives. - for (s = min_s; s <= max_s; ++s) { - // Keep track of the nearest neighbour 'slot' - while (slot < num_levels - 1 && - 2 * s > inv_q_level[slot] + inv_q_level[slot + 1]) { - ++slot; - } - if (freq[s] > 0) { - q_sum[slot] += s * freq[s]; - q_count[slot] += freq[s]; - } - q_level[s] = slot; - } - - // Assign new representatives to classes. - if (num_levels > 2) { - for (slot = 1; slot < num_levels - 1; ++slot) { - const double count = q_count[slot]; - if (count > 0.) { - inv_q_level[slot] = q_sum[slot] / count; - } - } - } - - // Compute convergence error. - err = 0.; - for (s = min_s; s <= max_s; ++s) { - const double error = s - inv_q_level[q_level[s]]; - err += freq[s] * error * error; - } - - // Check for convergence: we stop as soon as the error is no - // longer improving. - if (last_err - err < err_threshold) break; - last_err = err; - } - - // Remap the alpha plane to quantized values. - { - // double->int rounding operation can be costly, so we do it - // once for all before remapping. We also perform the data[] -> slot - // mapping, while at it (avoid one indirection in the final loop). - uint8_t map[NUM_SYMBOLS]; - int s; - size_t n; - for (s = min_s; s <= max_s; ++s) { - const int slot = q_level[s]; - map[s] = (uint8_t)(inv_q_level[slot] + .5); - } - // Final pass. - for (n = 0; n < data_size; ++n) { - data[n] = map[data[n]]; - } - } - End: - // Store sum of squared error if needed. - if (sse != NULL) *sse = (uint64_t)err; - - return 1; -} - -int DequantizeLevels(uint8_t* const data, int width, int height) { - if (data == NULL || width <= 0 || height <= 0) return 0; - // TODO(skal): implement gradient smoothing. - (void)data; - (void)width; - (void)height; - return 1; -} - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif diff --git a/external/libwebp/utils/quant_levels.h b/external/libwebp/utils/quant_levels.h deleted file mode 100644 index 89ccafe40d..0000000000 --- a/external/libwebp/utils/quant_levels.h +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2011 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Alpha plane quantization utility -// -// Author: Vikas Arora (vikasa@google.com) - -#ifndef WEBP_UTILS_QUANT_LEVELS_H_ -#define WEBP_UTILS_QUANT_LEVELS_H_ - -#include <stdlib.h> - -#include "../webp/types.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -// Replace the input 'data' of size 'width'x'height' with 'num-levels' -// quantized values. If not NULL, 'sse' will contain the sum of squared error. -// Valid range for 'num_levels' is [2, 256]. -// Returns false in case of error (data is NULL, or parameters are invalid). -int QuantizeLevels(uint8_t* const data, int width, int height, int num_levels, - uint64_t* const sse); - -// Apply post-processing to input 'data' of size 'width'x'height' assuming -// that the source was quantized to a reduced number of levels. -// Returns false in case of error (data is NULL, invalid parameters, ...). -int DequantizeLevels(uint8_t* const data, int width, int height); - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif - -#endif /* WEBP_UTILS_QUANT_LEVELS_H_ */ diff --git a/external/libwebp/utils/rescaler.c b/external/libwebp/utils/rescaler.c deleted file mode 100644 index 9825dcbc5f..0000000000 --- a/external/libwebp/utils/rescaler.c +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright 2012 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Rescaling functions -// -// Author: Skal (pascal.massimino@gmail.com) - -#include <assert.h> -#include <stdlib.h> -#include "./rescaler.h" - -//------------------------------------------------------------------------------ - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -#define RFIX 30 -#define MULT_FIX(x,y) (((int64_t)(x) * (y) + (1 << (RFIX - 1))) >> RFIX) - -void WebPRescalerInit(WebPRescaler* const wrk, int src_width, int src_height, - uint8_t* const dst, int dst_width, int dst_height, - int dst_stride, int num_channels, int x_add, int x_sub, - int y_add, int y_sub, int32_t* const work) { - wrk->x_expand = (src_width < dst_width); - wrk->src_width = src_width; - wrk->src_height = src_height; - wrk->dst_width = dst_width; - wrk->dst_height = dst_height; - wrk->dst = dst; - wrk->dst_stride = dst_stride; - wrk->num_channels = num_channels; - // for 'x_expand', we use bilinear interpolation - wrk->x_add = wrk->x_expand ? (x_sub - 1) : x_add - x_sub; - wrk->x_sub = wrk->x_expand ? (x_add - 1) : x_sub; - wrk->y_accum = y_add; - wrk->y_add = y_add; - wrk->y_sub = y_sub; - wrk->fx_scale = (1 << RFIX) / x_sub; - wrk->fy_scale = (1 << RFIX) / y_sub; - wrk->fxy_scale = wrk->x_expand ? - ((int64_t)dst_height << RFIX) / (x_sub * src_height) : - ((int64_t)dst_height << RFIX) / (x_add * src_height); - wrk->irow = work; - wrk->frow = work + num_channels * dst_width; -} - -void WebPRescalerImportRow(WebPRescaler* const wrk, - const uint8_t* const src, int channel) { - const int x_stride = wrk->num_channels; - const int x_out_max = wrk->dst_width * wrk->num_channels; - int x_in = channel; - int x_out; - int accum = 0; - if (!wrk->x_expand) { - int sum = 0; - for (x_out = channel; x_out < x_out_max; x_out += x_stride) { - accum += wrk->x_add; - for (; accum > 0; accum -= wrk->x_sub) { - sum += src[x_in]; - x_in += x_stride; - } - { // Emit next horizontal pixel. - const int32_t base = src[x_in]; - const int32_t frac = base * (-accum); - x_in += x_stride; - wrk->frow[x_out] = (sum + base) * wrk->x_sub - frac; - // fresh fractional start for next pixel - sum = (int)MULT_FIX(frac, wrk->fx_scale); - } - } - } else { // simple bilinear interpolation - int left = src[channel], right = src[channel]; - for (x_out = channel; x_out < x_out_max; x_out += x_stride) { - if (accum < 0) { - left = right; - x_in += x_stride; - right = src[x_in]; - accum += wrk->x_add; - } - wrk->frow[x_out] = right * wrk->x_add + (left - right) * accum; - accum -= wrk->x_sub; - } - } - // Accumulate the new row's contribution - for (x_out = channel; x_out < x_out_max; x_out += x_stride) { - wrk->irow[x_out] += wrk->frow[x_out]; - } -} - -uint8_t* WebPRescalerExportRow(WebPRescaler* const wrk) { - if (wrk->y_accum <= 0) { - int x_out; - uint8_t* const dst = wrk->dst; - int32_t* const irow = wrk->irow; - const int32_t* const frow = wrk->frow; - const int yscale = wrk->fy_scale * (-wrk->y_accum); - const int x_out_max = wrk->dst_width * wrk->num_channels; - - for (x_out = 0; x_out < x_out_max; ++x_out) { - const int frac = (int)MULT_FIX(frow[x_out], yscale); - const int v = (int)MULT_FIX(irow[x_out] - frac, wrk->fxy_scale); - dst[x_out] = (!(v & ~0xff)) ? v : (v < 0) ? 0 : 255; - irow[x_out] = frac; // new fractional start - } - wrk->y_accum += wrk->y_add; - wrk->dst += wrk->dst_stride; - return dst; - } else { - return NULL; - } -} - -#undef MULT_FIX -#undef RFIX - -//------------------------------------------------------------------------------ -// all-in-one calls - -int WebPRescalerImport(WebPRescaler* const wrk, int num_lines, - const uint8_t* src, int src_stride) { - int total_imported = 0; - while (total_imported < num_lines && wrk->y_accum > 0) { - int channel; - for (channel = 0; channel < wrk->num_channels; ++channel) { - WebPRescalerImportRow(wrk, src, channel); - } - src += src_stride; - ++total_imported; - wrk->y_accum -= wrk->y_sub; - } - return total_imported; -} - -int WebPRescalerExport(WebPRescaler* const rescaler) { - int total_exported = 0; - while (WebPRescalerHasPendingOutput(rescaler)) { - WebPRescalerExportRow(rescaler); - ++total_exported; - } - return total_exported; -} - -//------------------------------------------------------------------------------ - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif diff --git a/external/libwebp/utils/rescaler.h b/external/libwebp/utils/rescaler.h deleted file mode 100644 index ef93d465f0..0000000000 --- a/external/libwebp/utils/rescaler.h +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2012 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Rescaling functions -// -// Author: Skal (pascal.massimino@gmail.com) - -#ifndef WEBP_UTILS_RESCALER_H_ -#define WEBP_UTILS_RESCALER_H_ - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -#include "../webp/types.h" - -// Structure used for on-the-fly rescaling -typedef struct { - int x_expand; // true if we're expanding in the x direction - int num_channels; // bytes to jump between pixels - int fy_scale, fx_scale; // fixed-point scaling factor - int64_t fxy_scale; // '' - // we need hpel-precise add/sub increments, for the downsampled U/V planes. - int y_accum; // vertical accumulator - int y_add, y_sub; // vertical increments (add ~= src, sub ~= dst) - int x_add, x_sub; // horizontal increments (add ~= src, sub ~= dst) - int src_width, src_height; // source dimensions - int dst_width, dst_height; // destination dimensions - uint8_t* dst; - int dst_stride; - int32_t* irow, *frow; // work buffer -} WebPRescaler; - -// Initialize a rescaler given scratch area 'work' and dimensions of src & dst. -void WebPRescalerInit(WebPRescaler* const wrk, int src_width, int src_height, - uint8_t* const dst, - int dst_width, int dst_height, int dst_stride, - int num_channels, - int x_add, int x_sub, - int y_add, int y_sub, - int32_t* const work); - -// Import a row of data and save its contribution in the rescaler. -// 'channel' denotes the channel number to be imported. -void WebPRescalerImportRow(WebPRescaler* const rescaler, - const uint8_t* const src, int channel); - -// Import multiple rows over all channels, until at least one row is ready to -// be exported. Returns the actual number of lines that were imported. -int WebPRescalerImport(WebPRescaler* const rescaler, int num_rows, - const uint8_t* src, int src_stride); - -// Return true if there is pending output rows ready. -static WEBP_INLINE -int WebPRescalerHasPendingOutput(const WebPRescaler* const rescaler) { - return (rescaler->y_accum <= 0); -} - -// Export one row from rescaler. Returns the pointer where output was written, -// or NULL if no row was pending. -uint8_t* WebPRescalerExportRow(WebPRescaler* const wrk); - -// Export as many rows as possible. Return the numbers of rows written. -int WebPRescalerExport(WebPRescaler* const wrk); - -//------------------------------------------------------------------------------ - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif - -#endif /* WEBP_UTILS_RESCALER_H_ */ diff --git a/external/libwebp/utils/thread.c b/external/libwebp/utils/thread.c deleted file mode 100644 index ce89cf9dc7..0000000000 --- a/external/libwebp/utils/thread.c +++ /dev/null @@ -1,247 +0,0 @@ -// Copyright 2011 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Multi-threaded worker -// -// Author: Skal (pascal.massimino@gmail.com) - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <assert.h> -#include <string.h> // for memset() -#include "./thread.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -#ifdef WEBP_USE_THREAD - -#if defined(_WIN32) - -//------------------------------------------------------------------------------ -// simplistic pthread emulation layer - -#include <process.h> - -// _beginthreadex requires __stdcall -#define THREADFN unsigned int __stdcall -#define THREAD_RETURN(val) (unsigned int)((DWORD_PTR)val) - -static int pthread_create(pthread_t* const thread, const void* attr, - unsigned int (__stdcall *start)(void*), void* arg) { - (void)attr; - *thread = (pthread_t)_beginthreadex(NULL, /* void *security */ - 0, /* unsigned stack_size */ - start, - arg, - 0, /* unsigned initflag */ - NULL); /* unsigned *thrdaddr */ - if (*thread == NULL) return 1; - SetThreadPriority(*thread, THREAD_PRIORITY_ABOVE_NORMAL); - return 0; -} - -static int pthread_join(pthread_t thread, void** value_ptr) { - (void)value_ptr; - return (WaitForSingleObject(thread, INFINITE) != WAIT_OBJECT_0 || - CloseHandle(thread) == 0); -} - -// Mutex -static int pthread_mutex_init(pthread_mutex_t* const mutex, void* mutexattr) { - (void)mutexattr; - InitializeCriticalSection(mutex); - return 0; -} - -static int pthread_mutex_lock(pthread_mutex_t* const mutex) { - EnterCriticalSection(mutex); - return 0; -} - -static int pthread_mutex_unlock(pthread_mutex_t* const mutex) { - LeaveCriticalSection(mutex); - return 0; -} - -static int pthread_mutex_destroy(pthread_mutex_t* const mutex) { - DeleteCriticalSection(mutex); - return 0; -} - -// Condition -static int pthread_cond_destroy(pthread_cond_t* const condition) { - int ok = 1; - ok &= (CloseHandle(condition->waiting_sem_) != 0); - ok &= (CloseHandle(condition->received_sem_) != 0); - ok &= (CloseHandle(condition->signal_event_) != 0); - return !ok; -} - -static int pthread_cond_init(pthread_cond_t* const condition, void* cond_attr) { - (void)cond_attr; - condition->waiting_sem_ = CreateSemaphore(NULL, 0, 1, NULL); - condition->received_sem_ = CreateSemaphore(NULL, 0, 1, NULL); - condition->signal_event_ = CreateEvent(NULL, FALSE, FALSE, NULL); - if (condition->waiting_sem_ == NULL || - condition->received_sem_ == NULL || - condition->signal_event_ == NULL) { - pthread_cond_destroy(condition); - return 1; - } - return 0; -} - -static int pthread_cond_signal(pthread_cond_t* const condition) { - int ok = 1; - if (WaitForSingleObject(condition->waiting_sem_, 0) == WAIT_OBJECT_0) { - // a thread is waiting in pthread_cond_wait: allow it to be notified - ok = SetEvent(condition->signal_event_); - // wait until the event is consumed so the signaler cannot consume - // the event via its own pthread_cond_wait. - ok &= (WaitForSingleObject(condition->received_sem_, INFINITE) != - WAIT_OBJECT_0); - } - return !ok; -} - -static int pthread_cond_wait(pthread_cond_t* const condition, - pthread_mutex_t* const mutex) { - int ok; - // note that there is a consumer available so the signal isn't dropped in - // pthread_cond_signal - if (!ReleaseSemaphore(condition->waiting_sem_, 1, NULL)) - return 1; - // now unlock the mutex so pthread_cond_signal may be issued - pthread_mutex_unlock(mutex); - ok = (WaitForSingleObject(condition->signal_event_, INFINITE) == - WAIT_OBJECT_0); - ok &= ReleaseSemaphore(condition->received_sem_, 1, NULL); - pthread_mutex_lock(mutex); - return !ok; -} - -#else // _WIN32 -# define THREADFN void* -# define THREAD_RETURN(val) val -#endif - -//------------------------------------------------------------------------------ - -static THREADFN WebPWorkerThreadLoop(void *ptr) { // thread loop - WebPWorker* const worker = (WebPWorker*)ptr; - int done = 0; - while (!done) { - pthread_mutex_lock(&worker->mutex_); - while (worker->status_ == OK) { // wait in idling mode - pthread_cond_wait(&worker->condition_, &worker->mutex_); - } - if (worker->status_ == WORK) { - if (worker->hook) { - worker->had_error |= !worker->hook(worker->data1, worker->data2); - } - worker->status_ = OK; - } else if (worker->status_ == NOT_OK) { // finish the worker - done = 1; - } - // signal to the main thread that we're done (for Sync()) - pthread_cond_signal(&worker->condition_); - pthread_mutex_unlock(&worker->mutex_); - } - return THREAD_RETURN(NULL); // Thread is finished -} - -// main thread state control -static void WebPWorkerChangeState(WebPWorker* const worker, - WebPWorkerStatus new_status) { - // no-op when attempting to change state on a thread that didn't come up - if (worker->status_ < OK) return; - - pthread_mutex_lock(&worker->mutex_); - // wait for the worker to finish - while (worker->status_ != OK) { - pthread_cond_wait(&worker->condition_, &worker->mutex_); - } - // assign new status and release the working thread if needed - if (new_status != OK) { - worker->status_ = new_status; - pthread_cond_signal(&worker->condition_); - } - pthread_mutex_unlock(&worker->mutex_); -} - -#endif - -//------------------------------------------------------------------------------ - -void WebPWorkerInit(WebPWorker* const worker) { - memset(worker, 0, sizeof(*worker)); - worker->status_ = NOT_OK; -} - -int WebPWorkerSync(WebPWorker* const worker) { -#ifdef WEBP_USE_THREAD - WebPWorkerChangeState(worker, OK); -#endif - assert(worker->status_ <= OK); - return !worker->had_error; -} - -int WebPWorkerReset(WebPWorker* const worker) { - int ok = 1; - worker->had_error = 0; - if (worker->status_ < OK) { -#ifdef WEBP_USE_THREAD - if (pthread_mutex_init(&worker->mutex_, NULL) || - pthread_cond_init(&worker->condition_, NULL)) { - return 0; - } - pthread_mutex_lock(&worker->mutex_); - ok = !pthread_create(&worker->thread_, NULL, WebPWorkerThreadLoop, worker); - if (ok) worker->status_ = OK; - pthread_mutex_unlock(&worker->mutex_); -#else - worker->status_ = OK; -#endif - } else if (worker->status_ > OK) { - ok = WebPWorkerSync(worker); - } - assert(!ok || (worker->status_ == OK)); - return ok; -} - -void WebPWorkerLaunch(WebPWorker* const worker) { -#ifdef WEBP_USE_THREAD - WebPWorkerChangeState(worker, WORK); -#else - if (worker->hook) - worker->had_error |= !worker->hook(worker->data1, worker->data2); -#endif -} - -void WebPWorkerEnd(WebPWorker* const worker) { - if (worker->status_ >= OK) { -#ifdef WEBP_USE_THREAD - WebPWorkerChangeState(worker, NOT_OK); - pthread_join(worker->thread_, NULL); - pthread_mutex_destroy(&worker->mutex_); - pthread_cond_destroy(&worker->condition_); -#else - worker->status_ = NOT_OK; -#endif - } - assert(worker->status_ == NOT_OK); -} - -//------------------------------------------------------------------------------ - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif diff --git a/external/libwebp/utils/thread.h b/external/libwebp/utils/thread.h deleted file mode 100644 index 3191890b76..0000000000 --- a/external/libwebp/utils/thread.h +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright 2011 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Multi-threaded worker -// -// Author: Skal (pascal.massimino@gmail.com) - -#ifndef WEBP_UTILS_THREAD_H_ -#define WEBP_UTILS_THREAD_H_ - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -#if WEBP_USE_THREAD - -#if defined(_WIN32) - -#include <windows.h> -typedef HANDLE pthread_t; -typedef CRITICAL_SECTION pthread_mutex_t; -typedef struct { - HANDLE waiting_sem_; - HANDLE received_sem_; - HANDLE signal_event_; -} pthread_cond_t; - -#else - -#include <pthread.h> - -#endif /* _WIN32 */ -#endif /* WEBP_USE_THREAD */ - -// State of the worker thread object -typedef enum { - NOT_OK = 0, // object is unusable - OK, // ready to work - WORK // busy finishing the current task -} WebPWorkerStatus; - -// Function to be called by the worker thread. Takes two opaque pointers as -// arguments (data1 and data2), and should return false in case of error. -typedef int (*WebPWorkerHook)(void*, void*); - -// Synchronize object used to launch job in the worker thread -typedef struct { -#if WEBP_USE_THREAD - pthread_mutex_t mutex_; - pthread_cond_t condition_; - pthread_t thread_; -#endif - WebPWorkerStatus status_; - WebPWorkerHook hook; // hook to call - void* data1; // first argument passed to 'hook' - void* data2; // second argument passed to 'hook' - int had_error; // return value of the last call to 'hook' -} WebPWorker; - -// Must be called first, before any other method. -void WebPWorkerInit(WebPWorker* const worker); -// Must be called initialize the object and spawn the thread. Re-entrant. -// Will potentially launch the thread. Returns false in case of error. -int WebPWorkerReset(WebPWorker* const worker); -// Make sure the previous work is finished. Returns true if worker->had_error -// was not set and not error condition was triggered by the working thread. -int WebPWorkerSync(WebPWorker* const worker); -// Trigger the thread to call hook() with data1 and data2 argument. These -// hook/data1/data2 can be changed at any time before calling this function, -// but not be changed afterward until the next call to WebPWorkerSync(). -void WebPWorkerLaunch(WebPWorker* const worker); -// Kill the thread and terminate the object. To use the object again, one -// must call WebPWorkerReset() again. -void WebPWorkerEnd(WebPWorker* const worker); - -//------------------------------------------------------------------------------ - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif - -#endif /* WEBP_UTILS_THREAD_H_ */ diff --git a/external/libwebp/utils/utils.c b/external/libwebp/utils/utils.c deleted file mode 100644 index 673b7e284c..0000000000 --- a/external/libwebp/utils/utils.c +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2012 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Misc. common utility functions -// -// Author: Skal (pascal.massimino@gmail.com) - -#include <stdlib.h> -#include "./utils.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -//------------------------------------------------------------------------------ -// Checked memory allocation - -static int CheckSizeArguments(uint64_t nmemb, size_t size) { - const uint64_t total_size = nmemb * size; - if (nmemb == 0) return 1; - if ((uint64_t)size > WEBP_MAX_ALLOCABLE_MEMORY / nmemb) return 0; - if (total_size != (size_t)total_size) return 0; - return 1; -} - -void* WebPSafeMalloc(uint64_t nmemb, size_t size) { - if (!CheckSizeArguments(nmemb, size)) return NULL; - return malloc((size_t)(nmemb * size)); -} - -void* WebPSafeCalloc(uint64_t nmemb, size_t size) { - if (!CheckSizeArguments(nmemb, size)) return NULL; - return calloc((size_t)nmemb, size); -} - -//------------------------------------------------------------------------------ - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif diff --git a/external/libwebp/utils/utils.h b/external/libwebp/utils/utils.h deleted file mode 100644 index a034762556..0000000000 --- a/external/libwebp/utils/utils.h +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2012 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Misc. common utility functions -// -// Author: Skal (pascal.massimino@gmail.com) - -#ifndef WEBP_UTILS_UTILS_H_ -#define WEBP_UTILS_UTILS_H_ - -#include "../webp/types.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -//------------------------------------------------------------------------------ -// Memory allocation - -// This is the maximum memory amount that libwebp will ever try to allocate. -#define WEBP_MAX_ALLOCABLE_MEMORY (1ULL << 40) - -// size-checking safe malloc/calloc: verify that the requested size is not too -// large, or return NULL. You don't need to call these for constructs like -// malloc(sizeof(foo)), but only if there's picture-dependent size involved -// somewhere (like: malloc(num_pixels * sizeof(*something))). That's why this -// safe malloc() borrows the signature from calloc(), pointing at the dangerous -// underlying multiply involved. -void* WebPSafeMalloc(uint64_t nmemb, size_t size); -// Note that WebPSafeCalloc() expects the second argument type to be 'size_t' -// in order to favor the "calloc(num_foo, sizeof(foo))" pattern. -void* WebPSafeCalloc(uint64_t nmemb, size_t size); - -//------------------------------------------------------------------------------ - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif - -#endif /* WEBP_UTILS_UTILS_H_ */ diff --git a/external/libwebp/webp/decode.h b/external/libwebp/webp/decode.h deleted file mode 100644 index 43b6c58f4f..0000000000 --- a/external/libwebp/webp/decode.h +++ /dev/null @@ -1,454 +0,0 @@ -// Copyright 2010 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Main decoding functions for WebP images. -// -// Author: Skal (pascal.massimino@gmail.com) - -#ifndef WEBP_WEBP_DECODE_H_ -#define WEBP_WEBP_DECODE_H_ - -#include "./types.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -#define WEBP_DECODER_ABI_VERSION 0x0200 // MAJOR(8b) + MINOR(8b) - -// Return the decoder's version number, packed in hexadecimal using 8bits for -// each of major/minor/revision. E.g: v2.5.7 is 0x020507. -WEBP_EXTERN(int) WebPGetDecoderVersion(void); - -// Retrieve basic header information: width, height. -// This function will also validate the header and return 0 in -// case of formatting error. -// Pointers 'width' and 'height' can be passed NULL if deemed irrelevant. -WEBP_EXTERN(int) WebPGetInfo(const uint8_t* data, size_t data_size, - int* width, int* height); - -// Decodes WebP images pointed to by 'data' and returns RGBA samples, along -// with the dimensions in *width and *height. The ordering of samples in -// memory is R, G, B, A, R, G, B, A... in scan order (endian-independent). -// The returned pointer should be deleted calling free(). -// Returns NULL in case of error. -WEBP_EXTERN(uint8_t*) WebPDecodeRGBA(const uint8_t* data, size_t data_size, - int* width, int* height); - -// Same as WebPDecodeRGBA, but returning A, R, G, B, A, R, G, B... ordered data. -WEBP_EXTERN(uint8_t*) WebPDecodeARGB(const uint8_t* data, size_t data_size, - int* width, int* height); - -// Same as WebPDecodeRGBA, but returning B, G, R, A, B, G, R, A... ordered data. -WEBP_EXTERN(uint8_t*) WebPDecodeBGRA(const uint8_t* data, size_t data_size, - int* width, int* height); - -// Same as WebPDecodeRGBA, but returning R, G, B, R, G, B... ordered data. -// If the bitstream contains transparency, it is ignored. -WEBP_EXTERN(uint8_t*) WebPDecodeRGB(const uint8_t* data, size_t data_size, - int* width, int* height); - -// Same as WebPDecodeRGB, but returning B, G, R, B, G, R... ordered data. -WEBP_EXTERN(uint8_t*) WebPDecodeBGR(const uint8_t* data, size_t data_size, - int* width, int* height); - - -// Decode WebP images pointed to by 'data' to Y'UV format(*). The pointer -// returned is the Y samples buffer. Upon return, *u and *v will point to -// the U and V chroma data. These U and V buffers need NOT be free()'d, -// unlike the returned Y luma one. The dimension of the U and V planes -// are both (*width + 1) / 2 and (*height + 1)/ 2. -// Upon return, the Y buffer has a stride returned as '*stride', while U and V -// have a common stride returned as '*uv_stride'. -// Return NULL in case of error. -// (*) Also named Y'CbCr. See: http://en.wikipedia.org/wiki/YCbCr -WEBP_EXTERN(uint8_t*) WebPDecodeYUV(const uint8_t* data, size_t data_size, - int* width, int* height, - uint8_t** u, uint8_t** v, - int* stride, int* uv_stride); - -// These five functions are variants of the above ones, that decode the image -// directly into a pre-allocated buffer 'output_buffer'. The maximum storage -// available in this buffer is indicated by 'output_buffer_size'. If this -// storage is not sufficient (or an error occurred), NULL is returned. -// Otherwise, output_buffer is returned, for convenience. -// The parameter 'output_stride' specifies the distance (in bytes) -// between scanlines. Hence, output_buffer_size is expected to be at least -// output_stride x picture-height. -WEBP_EXTERN(uint8_t*) WebPDecodeRGBAInto( - const uint8_t* data, size_t data_size, - uint8_t* output_buffer, size_t output_buffer_size, int output_stride); -WEBP_EXTERN(uint8_t*) WebPDecodeARGBInto( - const uint8_t* data, size_t data_size, - uint8_t* output_buffer, size_t output_buffer_size, int output_stride); -WEBP_EXTERN(uint8_t*) WebPDecodeBGRAInto( - const uint8_t* data, size_t data_size, - uint8_t* output_buffer, size_t output_buffer_size, int output_stride); - -// RGB and BGR variants. Here too the transparency information, if present, -// will be dropped and ignored. -WEBP_EXTERN(uint8_t*) WebPDecodeRGBInto( - const uint8_t* data, size_t data_size, - uint8_t* output_buffer, size_t output_buffer_size, int output_stride); -WEBP_EXTERN(uint8_t*) WebPDecodeBGRInto( - const uint8_t* data, size_t data_size, - uint8_t* output_buffer, size_t output_buffer_size, int output_stride); - -// WebPDecodeYUVInto() is a variant of WebPDecodeYUV() that operates directly -// into pre-allocated luma/chroma plane buffers. This function requires the -// strides to be passed: one for the luma plane and one for each of the -// chroma ones. The size of each plane buffer is passed as 'luma_size', -// 'u_size' and 'v_size' respectively. -// Pointer to the luma plane ('*luma') is returned or NULL if an error occurred -// during decoding (or because some buffers were found to be too small). -WEBP_EXTERN(uint8_t*) WebPDecodeYUVInto( - const uint8_t* data, size_t data_size, - uint8_t* luma, size_t luma_size, int luma_stride, - uint8_t* u, size_t u_size, int u_stride, - uint8_t* v, size_t v_size, int v_stride); - -//------------------------------------------------------------------------------ -// Output colorspaces and buffer - -// Colorspaces -// Note: the naming describes the byte-ordering of packed samples in memory. -// For instance, MODE_BGRA relates to samples ordered as B,G,R,A,B,G,R,A,... -// Non-capital names (e.g.:MODE_Argb) relates to pre-multiplied RGB channels. -// RGB-565 and RGBA-4444 are also endian-agnostic and byte-oriented. -typedef enum { MODE_RGB = 0, MODE_RGBA = 1, - MODE_BGR = 2, MODE_BGRA = 3, - MODE_ARGB = 4, MODE_RGBA_4444 = 5, - MODE_RGB_565 = 6, - // RGB-premultiplied transparent modes (alpha value is preserved) - MODE_rgbA = 7, - MODE_bgrA = 8, - MODE_Argb = 9, - MODE_rgbA_4444 = 10, - // YUV modes must come after RGB ones. - MODE_YUV = 11, MODE_YUVA = 12, // yuv 4:2:0 - MODE_LAST = 13 - } WEBP_CSP_MODE; - -// Some useful macros: -static WEBP_INLINE int WebPIsPremultipliedMode(WEBP_CSP_MODE mode) { - return (mode == MODE_rgbA || mode == MODE_bgrA || mode == MODE_Argb || - mode == MODE_rgbA_4444); -} - -static WEBP_INLINE int WebPIsAlphaMode(WEBP_CSP_MODE mode) { - return (mode == MODE_RGBA || mode == MODE_BGRA || mode == MODE_ARGB || - mode == MODE_RGBA_4444 || mode == MODE_YUVA || - WebPIsPremultipliedMode(mode)); -} - -static WEBP_INLINE int WebPIsRGBMode(WEBP_CSP_MODE mode) { - return (mode < MODE_YUV); -} - -//------------------------------------------------------------------------------ -// WebPDecBuffer: Generic structure for describing the output sample buffer. - -typedef struct { // view as RGBA - uint8_t* rgba; // pointer to RGBA samples - int stride; // stride in bytes from one scanline to the next. - size_t size; // total size of the *rgba buffer. -} WebPRGBABuffer; - -typedef struct { // view as YUVA - uint8_t* y, *u, *v, *a; // pointer to luma, chroma U/V, alpha samples - int y_stride; // luma stride - int u_stride, v_stride; // chroma strides - int a_stride; // alpha stride - size_t y_size; // luma plane size - size_t u_size, v_size; // chroma planes size - size_t a_size; // alpha-plane size -} WebPYUVABuffer; - -// Output buffer -typedef struct { - WEBP_CSP_MODE colorspace; // Colorspace. - int width, height; // Dimensions. - int is_external_memory; // If true, 'internal_memory' pointer is not used. - union { - WebPRGBABuffer RGBA; - WebPYUVABuffer YUVA; - } u; // Nameless union of buffer parameters. - uint32_t pad[4]; // padding for later use - - uint8_t* private_memory; // Internally allocated memory (only when - // is_external_memory is false). Should not be used - // externally, but accessed via the buffer union. -} WebPDecBuffer; - -// Internal, version-checked, entry point -WEBP_EXTERN(int) WebPInitDecBufferInternal(WebPDecBuffer*, int); - -// Initialize the structure as empty. Must be called before any other use. -// Returns false in case of version mismatch -static WEBP_INLINE int WebPInitDecBuffer(WebPDecBuffer* buffer) { - return WebPInitDecBufferInternal(buffer, WEBP_DECODER_ABI_VERSION); -} - -// Free any memory associated with the buffer. Must always be called last. -// Note: doesn't free the 'buffer' structure itself. -WEBP_EXTERN(void) WebPFreeDecBuffer(WebPDecBuffer* buffer); - -//------------------------------------------------------------------------------ -// Enumeration of the status codes - -typedef enum { - VP8_STATUS_OK = 0, - VP8_STATUS_OUT_OF_MEMORY, - VP8_STATUS_INVALID_PARAM, - VP8_STATUS_BITSTREAM_ERROR, - VP8_STATUS_UNSUPPORTED_FEATURE, - VP8_STATUS_SUSPENDED, - VP8_STATUS_USER_ABORT, - VP8_STATUS_NOT_ENOUGH_DATA -} VP8StatusCode; - -//------------------------------------------------------------------------------ -// Incremental decoding -// -// This API allows streamlined decoding of partial data. -// Picture can be incrementally decoded as data become available thanks to the -// WebPIDecoder object. This object can be left in a SUSPENDED state if the -// picture is only partially decoded, pending additional input. -// Code example: -// -// WebPInitDecBuffer(&buffer); -// buffer.colorspace = mode; -// ... -// WebPIDecoder* idec = WebPINewDecoder(&buffer); -// while (has_more_data) { -// // ... (get additional data) -// status = WebPIAppend(idec, new_data, new_data_size); -// if (status != VP8_STATUS_SUSPENDED || -// break; -// } -// -// // The above call decodes the current available buffer. -// // Part of the image can now be refreshed by calling to -// // WebPIDecGetRGB()/WebPIDecGetYUVA() etc. -// } -// WebPIDelete(idec); - -typedef struct WebPIDecoder WebPIDecoder; - -// Creates a new incremental decoder with the supplied buffer parameter. -// This output_buffer can be passed NULL, in which case a default output buffer -// is used (with MODE_RGB). Otherwise, an internal reference to 'output_buffer' -// is kept, which means that the lifespan of 'output_buffer' must be larger than -// that of the returned WebPIDecoder object. -// Returns NULL if the allocation failed. -WEBP_EXTERN(WebPIDecoder*) WebPINewDecoder(WebPDecBuffer* output_buffer); - -// This function allocates and initializes an incremental-decoder object, which -// will output the RGB/A samples specified by 'csp' into a preallocated -// buffer 'output_buffer'. The size of this buffer is at least -// 'output_buffer_size' and the stride (distance in bytes between two scanlines) -// is specified by 'output_stride'. Returns NULL if the allocation failed. -WEBP_EXTERN(WebPIDecoder*) WebPINewRGB( - WEBP_CSP_MODE csp, - uint8_t* output_buffer, size_t output_buffer_size, int output_stride); - -// This function allocates and initializes an incremental-decoder object, which -// will output the raw luma/chroma samples into a preallocated planes. The luma -// plane is specified by its pointer 'luma', its size 'luma_size' and its stride -// 'luma_stride'. Similarly, the chroma-u plane is specified by the 'u', -// 'u_size' and 'u_stride' parameters, and the chroma-v plane by 'v' -// and 'v_size'. And same for the alpha-plane. The 'a' pointer can be pass -// NULL in case one is not interested in the transparency plane. -// Returns NULL if the allocation failed. -WEBP_EXTERN(WebPIDecoder*) WebPINewYUVA( - uint8_t* luma, size_t luma_size, int luma_stride, - uint8_t* u, size_t u_size, int u_stride, - uint8_t* v, size_t v_size, int v_stride, - uint8_t* a, size_t a_size, int a_stride); - -// Deprecated version of the above, without the alpha plane. -// Kept for backward compatibility. -WEBP_EXTERN(WebPIDecoder*) WebPINewYUV( - uint8_t* luma, size_t luma_size, int luma_stride, - uint8_t* u, size_t u_size, int u_stride, - uint8_t* v, size_t v_size, int v_stride); - -// Deletes the WebPIDecoder object and associated memory. Must always be called -// if WebPINewDecoder, WebPINewRGB or WebPINewYUV succeeded. -WEBP_EXTERN(void) WebPIDelete(WebPIDecoder* idec); - -// Copies and decodes the next available data. Returns VP8_STATUS_OK when -// the image is successfully decoded. Returns VP8_STATUS_SUSPENDED when more -// data is expected. Returns error in other cases. -WEBP_EXTERN(VP8StatusCode) WebPIAppend( - WebPIDecoder* idec, const uint8_t* data, size_t data_size); - -// A variant of the above function to be used when data buffer contains -// partial data from the beginning. In this case data buffer is not copied -// to the internal memory. -// Note that the value of the 'data' pointer can change between calls to -// WebPIUpdate, for instance when the data buffer is resized to fit larger data. -WEBP_EXTERN(VP8StatusCode) WebPIUpdate( - WebPIDecoder* idec, const uint8_t* data, size_t data_size); - -// Returns the RGB/A image decoded so far. Returns NULL if output params -// are not initialized yet. The RGB/A output type corresponds to the colorspace -// specified during call to WebPINewDecoder() or WebPINewRGB(). -// *last_y is the index of last decoded row in raster scan order. Some pointers -// (*last_y, *width etc.) can be NULL if corresponding information is not -// needed. -WEBP_EXTERN(uint8_t*) WebPIDecGetRGB( - const WebPIDecoder* idec, int* last_y, - int* width, int* height, int* stride); - -// Same as above function to get a YUVA image. Returns pointer to the luma -// plane or NULL in case of error. If there is no alpha information -// the alpha pointer '*a' will be returned NULL. -WEBP_EXTERN(uint8_t*) WebPIDecGetYUVA( - const WebPIDecoder* idec, int* last_y, - uint8_t** u, uint8_t** v, uint8_t** a, - int* width, int* height, int* stride, int* uv_stride, int* a_stride); - -// Deprecated alpha-less version of WebPIDecGetYUVA(): it will ignore the -// alpha information (if present). Kept for backward compatibility. -static WEBP_INLINE uint8_t* WebPIDecGetYUV( - const WebPIDecoder* idec, int* last_y, uint8_t** u, uint8_t** v, - int* width, int* height, int* stride, int* uv_stride) { - return WebPIDecGetYUVA(idec, last_y, u, v, NULL, width, height, - stride, uv_stride, NULL); -} - -// Generic call to retrieve information about the displayable area. -// If non NULL, the left/right/width/height pointers are filled with the visible -// rectangular area so far. -// Returns NULL in case the incremental decoder object is in an invalid state. -// Otherwise returns the pointer to the internal representation. This structure -// is read-only, tied to WebPIDecoder's lifespan and should not be modified. -WEBP_EXTERN(const WebPDecBuffer*) WebPIDecodedArea( - const WebPIDecoder* idec, int* left, int* top, int* width, int* height); - -//------------------------------------------------------------------------------ -// Advanced decoding parametrization -// -// Code sample for using the advanced decoding API -/* - // A) Init a configuration object - WebPDecoderConfig config; - CHECK(WebPInitDecoderConfig(&config)); - - // B) optional: retrieve the bitstream's features. - CHECK(WebPGetFeatures(data, data_size, &config.input) == VP8_STATUS_OK); - - // C) Adjust 'config', if needed - config.no_fancy = 1; - config.output.colorspace = MODE_BGRA; - // etc. - - // Note that you can also make config.output point to an externally - // supplied memory buffer, provided it's big enough to store the decoded - // picture. Otherwise, config.output will just be used to allocate memory - // and store the decoded picture. - - // D) Decode! - CHECK(WebPDecode(data, data_size, &config) == VP8_STATUS_OK); - - // E) Decoded image is now in config.output (and config.output.u.RGBA) - - // F) Reclaim memory allocated in config's object. It's safe to call - // this function even if the memory is external and wasn't allocated - // by WebPDecode(). - WebPFreeDecBuffer(&config.output); -*/ - -// Features gathered from the bitstream -typedef struct { - int width; // Width in pixels, as read from the bitstream. - int height; // Height in pixels, as read from the bitstream. - int has_alpha; // True if the bitstream contains an alpha channel. - - // Unused for now: - int bitstream_version; // should be 0 for now. TODO(later) - int no_incremental_decoding; // if true, using incremental decoding is not - // recommended. - int rotate; // TODO(later) - int uv_sampling; // should be 0 for now. TODO(later) - uint32_t pad[3]; // padding for later use -} WebPBitstreamFeatures; - -// Internal, version-checked, entry point -WEBP_EXTERN(VP8StatusCode) WebPGetFeaturesInternal( - const uint8_t*, size_t, WebPBitstreamFeatures*, int); - -// Retrieve features from the bitstream. The *features structure is filled -// with information gathered from the bitstream. -// Returns false in case of error or version mismatch. -// In case of error, features->bitstream_status will reflect the error code. -static WEBP_INLINE VP8StatusCode WebPGetFeatures( - const uint8_t* data, size_t data_size, - WebPBitstreamFeatures* features) { - return WebPGetFeaturesInternal(data, data_size, features, - WEBP_DECODER_ABI_VERSION); -} - -// Decoding options -typedef struct { - int bypass_filtering; // if true, skip the in-loop filtering - int no_fancy_upsampling; // if true, use faster pointwise upsampler - int use_cropping; // if true, cropping is applied _first_ - int crop_left, crop_top; // top-left position for cropping. - // Will be snapped to even values. - int crop_width, crop_height; // dimension of the cropping area - int use_scaling; // if true, scaling is applied _afterward_ - int scaled_width, scaled_height; // final resolution - int use_threads; // if true, use multi-threaded decoding - - // Unused for now: - int force_rotation; // forced rotation (to be applied _last_) - int no_enhancement; // if true, discard enhancement layer - uint32_t pad[6]; // padding for later use -} WebPDecoderOptions; - -// Main object storing the configuration for advanced decoding. -typedef struct { - WebPBitstreamFeatures input; // Immutable bitstream features (optional) - WebPDecBuffer output; // Output buffer (can point to external mem) - WebPDecoderOptions options; // Decoding options -} WebPDecoderConfig; - -// Internal, version-checked, entry point -WEBP_EXTERN(int) WebPInitDecoderConfigInternal(WebPDecoderConfig*, int); - -// Initialize the configuration as empty. This function must always be -// called first, unless WebPGetFeatures() is to be called. -// Returns false in case of mismatched version. -static WEBP_INLINE int WebPInitDecoderConfig(WebPDecoderConfig* config) { - return WebPInitDecoderConfigInternal(config, WEBP_DECODER_ABI_VERSION); -} - -// Instantiate a new incremental decoder object with the requested -// configuration. The bitstream can be passed using 'data' and 'data_size' -// parameter, in which case the features will be parsed and stored into -// config->input. Otherwise, 'data' can be NULL and no parsing will occur. -// Note that 'config' can be NULL too, in which case a default configuration -// is used. -// The return WebPIDecoder object must always be deleted calling WebPIDelete(). -// Returns NULL in case of error (and config->status will then reflect -// the error condition). -WEBP_EXTERN(WebPIDecoder*) WebPIDecode(const uint8_t* data, size_t data_size, - WebPDecoderConfig* config); - -// Non-incremental version. This version decodes the full data at once, taking -// 'config' into account. Returns decoding status (which should be VP8_STATUS_OK -// if the decoding was successful). -WEBP_EXTERN(VP8StatusCode) WebPDecode(const uint8_t* data, size_t data_size, - WebPDecoderConfig* config); - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif - -#endif /* WEBP_WEBP_DECODE_H_ */ diff --git a/external/libwebp/webp/encode.h b/external/libwebp/webp/encode.h deleted file mode 100644 index 2e37cfabe7..0000000000 --- a/external/libwebp/webp/encode.h +++ /dev/null @@ -1,463 +0,0 @@ -// Copyright 2011 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// WebP encoder: main interface -// -// Author: Skal (pascal.massimino@gmail.com) - -#ifndef WEBP_WEBP_ENCODE_H_ -#define WEBP_WEBP_ENCODE_H_ - -#include "./types.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -#define WEBP_ENCODER_ABI_VERSION 0x0200 // MAJOR(8b) + MINOR(8b) - -// Return the encoder's version number, packed in hexadecimal using 8bits for -// each of major/minor/revision. E.g: v2.5.7 is 0x020507. -WEBP_EXTERN(int) WebPGetEncoderVersion(void); - -//------------------------------------------------------------------------------ -// One-stop-shop call! No questions asked: - -// Returns the size of the compressed data (pointed to by *output), or 0 if -// an error occurred. The compressed data must be released by the caller -// using the call 'free(*output)'. -// These functions compress using the lossy format, and the quality_factor -// can go from 0 (smaller output, lower quality) to 100 (best quality, -// larger output). -WEBP_EXTERN(size_t) WebPEncodeRGB(const uint8_t* rgb, - int width, int height, int stride, - float quality_factor, uint8_t** output); -WEBP_EXTERN(size_t) WebPEncodeBGR(const uint8_t* bgr, - int width, int height, int stride, - float quality_factor, uint8_t** output); -WEBP_EXTERN(size_t) WebPEncodeRGBA(const uint8_t* rgba, - int width, int height, int stride, - float quality_factor, uint8_t** output); -WEBP_EXTERN(size_t) WebPEncodeBGRA(const uint8_t* bgra, - int width, int height, int stride, - float quality_factor, uint8_t** output); - -// These functions are the equivalent of the above, but compressing in a -// lossless manner. Files are usually larger than lossy format, but will -// not suffer any compression loss. -WEBP_EXTERN(size_t) WebPEncodeLosslessRGB(const uint8_t* rgb, - int width, int height, int stride, - uint8_t** output); -WEBP_EXTERN(size_t) WebPEncodeLosslessBGR(const uint8_t* bgr, - int width, int height, int stride, - uint8_t** output); -WEBP_EXTERN(size_t) WebPEncodeLosslessRGBA(const uint8_t* rgba, - int width, int height, int stride, - uint8_t** output); -WEBP_EXTERN(size_t) WebPEncodeLosslessBGRA(const uint8_t* bgra, - int width, int height, int stride, - uint8_t** output); - -//------------------------------------------------------------------------------ -// Coding parameters - -// Image characteristics hint for the underlying encoder. -typedef enum { - WEBP_HINT_DEFAULT = 0, // default preset. - WEBP_HINT_PICTURE, // digital picture, like portrait, inner shot - WEBP_HINT_PHOTO, // outdoor photograph, with natural lighting - WEBP_HINT_GRAPH, // Discrete tone image (graph, map-tile etc). - WEBP_HINT_LAST -} WebPImageHint; - -typedef struct { - int lossless; // Lossless encoding (0=lossy(default), 1=lossless). - float quality; // between 0 (smallest file) and 100 (biggest) - int method; // quality/speed trade-off (0=fast, 6=slower-better) - - WebPImageHint image_hint; // Hint for image type (lossless only for now). - - // Parameters related to lossy compression only: - int target_size; // if non-zero, set the desired target size in bytes. - // Takes precedence over the 'compression' parameter. - float target_PSNR; // if non-zero, specifies the minimal distortion to - // try to achieve. Takes precedence over target_size. - int segments; // maximum number of segments to use, in [1..4] - int sns_strength; // Spatial Noise Shaping. 0=off, 100=maximum. - int filter_strength; // range: [0 = off .. 100 = strongest] - int filter_sharpness; // range: [0 = off .. 7 = least sharp] - int filter_type; // filtering type: 0 = simple, 1 = strong (only used - // if filter_strength > 0 or autofilter > 0) - int autofilter; // Auto adjust filter's strength [0 = off, 1 = on] - int alpha_compression; // Algorithm for encoding the alpha plane (0 = none, - // 1 = compressed with WebP lossless). Default is 1. - int alpha_filtering; // Predictive filtering method for alpha plane. - // 0: none, 1: fast, 2: best. Default if 1. - int alpha_quality; // Between 0 (smallest size) and 100 (lossless). - // Default is 100. - int pass; // number of entropy-analysis passes (in [1..10]). - - int show_compressed; // if true, export the compressed picture back. - // In-loop filtering is not applied. - int preprocessing; // preprocessing filter (0=none, 1=segment-smooth) - int partitions; // log2(number of token partitions) in [0..3]. Default - // is set to 0 for easier progressive decoding. - int partition_limit; // quality degradation allowed to fit the 512k limit - // on prediction modes coding (0: no degradation, - // 100: maximum possible degradation). - - uint32_t pad[8]; // padding for later use -} WebPConfig; - -// Enumerate some predefined settings for WebPConfig, depending on the type -// of source picture. These presets are used when calling WebPConfigPreset(). -typedef enum { - WEBP_PRESET_DEFAULT = 0, // default preset. - WEBP_PRESET_PICTURE, // digital picture, like portrait, inner shot - WEBP_PRESET_PHOTO, // outdoor photograph, with natural lighting - WEBP_PRESET_DRAWING, // hand or line drawing, with high-contrast details - WEBP_PRESET_ICON, // small-sized colorful images - WEBP_PRESET_TEXT // text-like -} WebPPreset; - -// Internal, version-checked, entry point -WEBP_EXTERN(int) WebPConfigInitInternal(WebPConfig*, WebPPreset, float, int); - -// Should always be called, to initialize a fresh WebPConfig structure before -// modification. Returns false in case of version mismatch. WebPConfigInit() -// must have succeeded before using the 'config' object. -// Note that the default values are lossless=0 and quality=75. -static WEBP_INLINE int WebPConfigInit(WebPConfig* config) { - return WebPConfigInitInternal(config, WEBP_PRESET_DEFAULT, 75.f, - WEBP_ENCODER_ABI_VERSION); -} - -// This function will initialize the configuration according to a predefined -// set of parameters (referred to by 'preset') and a given quality factor. -// This function can be called as a replacement to WebPConfigInit(). Will -// return false in case of error. -static WEBP_INLINE int WebPConfigPreset(WebPConfig* config, - WebPPreset preset, float quality) { - return WebPConfigInitInternal(config, preset, quality, - WEBP_ENCODER_ABI_VERSION); -} - -// Returns true if 'config' is non-NULL and all configuration parameters are -// within their valid ranges. -WEBP_EXTERN(int) WebPValidateConfig(const WebPConfig* config); - -//------------------------------------------------------------------------------ -// Input / Output - -typedef struct WebPPicture WebPPicture; // main structure for I/O - -// Structure for storing auxiliary statistics (mostly for lossy encoding). -typedef struct { - int coded_size; // final size - - float PSNR[5]; // peak-signal-to-noise ratio for Y/U/V/All/Alpha - int block_count[3]; // number of intra4/intra16/skipped macroblocks - int header_bytes[2]; // approximate number of bytes spent for header - // and mode-partition #0 - int residual_bytes[3][4]; // approximate number of bytes spent for - // DC/AC/uv coefficients for each (0..3) segments. - int segment_size[4]; // number of macroblocks in each segments - int segment_quant[4]; // quantizer values for each segments - int segment_level[4]; // filtering strength for each segments [0..63] - - int alpha_data_size; // size of the transparency data - int layer_data_size; // size of the enhancement layer data - - // lossless encoder statistics - uint32_t lossless_features; // bit0:predictor bit1:cross-color transform - // bit2:subtract-green bit3:color indexing - int histogram_bits; // number of precision bits of histogram - int transform_bits; // precision bits for transform - int cache_bits; // number of bits for color cache lookup - int palette_size; // number of color in palette, if used - int lossless_size; // final lossless size - - uint32_t pad[4]; // padding for later use -} WebPAuxStats; - -// Signature for output function. Should return true if writing was successful. -// data/data_size is the segment of data to write, and 'picture' is for -// reference (and so one can make use of picture->custom_ptr). -typedef int (*WebPWriterFunction)(const uint8_t* data, size_t data_size, - const WebPPicture* picture); - -// WebPMemoryWrite: a special WebPWriterFunction that writes to memory using -// the following WebPMemoryWriter object (to be set as a custom_ptr). -typedef struct { - uint8_t* mem; // final buffer (of size 'max_size', larger than 'size'). - size_t size; // final size - size_t max_size; // total capacity - uint32_t pad[1]; // padding for later use -} WebPMemoryWriter; - -// The following must be called first before any use. -WEBP_EXTERN(void) WebPMemoryWriterInit(WebPMemoryWriter* writer); - -// The custom writer to be used with WebPMemoryWriter as custom_ptr. Upon -// completion, writer.mem and writer.size will hold the coded data. -WEBP_EXTERN(int) WebPMemoryWrite(const uint8_t* data, size_t data_size, - const WebPPicture* picture); - -// Progress hook, called from time to time to report progress. It can return -// false to request an abort of the encoding process, or true otherwise if -// everything is OK. -typedef int (*WebPProgressHook)(int percent, const WebPPicture* picture); - -typedef enum { - // chroma sampling - WEBP_YUV420 = 0, // 4:2:0 - WEBP_YUV422 = 1, // 4:2:2 - WEBP_YUV444 = 2, // 4:4:4 - WEBP_YUV400 = 3, // grayscale - WEBP_CSP_UV_MASK = 3, // bit-mask to get the UV sampling factors - // alpha channel variants - WEBP_YUV420A = 4, - WEBP_YUV422A = 5, - WEBP_YUV444A = 6, - WEBP_YUV400A = 7, // grayscale + alpha - WEBP_CSP_ALPHA_BIT = 4 // bit that is set if alpha is present -} WebPEncCSP; - -// Encoding error conditions. -typedef enum { - VP8_ENC_OK = 0, - VP8_ENC_ERROR_OUT_OF_MEMORY, // memory error allocating objects - VP8_ENC_ERROR_BITSTREAM_OUT_OF_MEMORY, // memory error while flushing bits - VP8_ENC_ERROR_NULL_PARAMETER, // a pointer parameter is NULL - VP8_ENC_ERROR_INVALID_CONFIGURATION, // configuration is invalid - VP8_ENC_ERROR_BAD_DIMENSION, // picture has invalid width/height - VP8_ENC_ERROR_PARTITION0_OVERFLOW, // partition is bigger than 512k - VP8_ENC_ERROR_PARTITION_OVERFLOW, // partition is bigger than 16M - VP8_ENC_ERROR_BAD_WRITE, // error while flushing bytes - VP8_ENC_ERROR_FILE_TOO_BIG, // file is bigger than 4G - VP8_ENC_ERROR_USER_ABORT, // abort request by user - VP8_ENC_ERROR_LAST // list terminator. always last. -} WebPEncodingError; - -// maximum width/height allowed (inclusive), in pixels -#define WEBP_MAX_DIMENSION 16383 - -// Main exchange structure (input samples, output bytes, statistics) -struct WebPPicture { - - // INPUT - ////////////// - // Main flag for encoder selecting between ARGB or YUV input. - // It is recommended to use ARGB input (*argb, argb_stride) for lossless - // compression, and YUV input (*y, *u, *v, etc.) for lossy compression - // since these are the respective native colorspace for these formats. - int use_argb; - - // YUV input (mostly used for input to lossy compression) - WebPEncCSP colorspace; // colorspace: should be YUV420 for now (=Y'CbCr). - int width, height; // dimensions (less or equal to WEBP_MAX_DIMENSION) - uint8_t *y, *u, *v; // pointers to luma/chroma planes. - int y_stride, uv_stride; // luma/chroma strides. - uint8_t* a; // pointer to the alpha plane - int a_stride; // stride of the alpha plane - uint32_t pad1[2]; // padding for later use - - // ARGB input (mostly used for input to lossless compression) - uint32_t* argb; // Pointer to argb (32 bit) plane. - int argb_stride; // This is stride in pixels units, not bytes. - uint32_t pad2[3]; // padding for later use - - // OUTPUT - /////////////// - // Byte-emission hook, to store compressed bytes as they are ready. - WebPWriterFunction writer; // can be NULL - void* custom_ptr; // can be used by the writer. - - // map for extra information (only for lossy compression mode) - int extra_info_type; // 1: intra type, 2: segment, 3: quant - // 4: intra-16 prediction mode, - // 5: chroma prediction mode, - // 6: bit cost, 7: distortion - uint8_t* extra_info; // if not NULL, points to an array of size - // ((width + 15) / 16) * ((height + 15) / 16) that - // will be filled with a macroblock map, depending - // on extra_info_type. - - // STATS AND REPORTS - /////////////////////////// - // Pointer to side statistics (updated only if not NULL) - WebPAuxStats* stats; - - // Error code for the latest error encountered during encoding - WebPEncodingError error_code; - - // If not NULL, report progress during encoding. - WebPProgressHook progress_hook; - - void* user_data; // this field is free to be set to any value and - // used during callbacks (like progress-report e.g.). - - uint32_t pad3[3]; // padding for later use - - // Unused for now: original samples (for non-YUV420 modes) - uint8_t *u0, *v0; - int uv0_stride; - - uint32_t pad4[7]; // padding for later use - - // PRIVATE FIELDS - //////////////////// - void* memory_; // row chunk of memory for yuva planes - void* memory_argb_; // and for argb too. - void* pad5[2]; // padding for later use -}; - -// Internal, version-checked, entry point -WEBP_EXTERN(int) WebPPictureInitInternal(WebPPicture*, int); - -// Should always be called, to initialize the structure. Returns false in case -// of version mismatch. WebPPictureInit() must have succeeded before using the -// 'picture' object. -// Note that, by default, use_argb is false and colorspace is WEBP_YUV420. -static WEBP_INLINE int WebPPictureInit(WebPPicture* picture) { - return WebPPictureInitInternal(picture, WEBP_ENCODER_ABI_VERSION); -} - -//------------------------------------------------------------------------------ -// WebPPicture utils - -// Convenience allocation / deallocation based on picture->width/height: -// Allocate y/u/v buffers as per colorspace/width/height specification. -// Note! This function will free the previous buffer if needed. -// Returns false in case of memory error. -WEBP_EXTERN(int) WebPPictureAlloc(WebPPicture* picture); - -// Release the memory allocated by WebPPictureAlloc() or WebPPictureImport*(). -// Note that this function does _not_ free the memory used by the 'picture' -// object itself. -// Besides memory (which is reclaimed) all other fields of 'picture' are -// preserved. -WEBP_EXTERN(void) WebPPictureFree(WebPPicture* picture); - -// Copy the pixels of *src into *dst, using WebPPictureAlloc. Upon return, -// *dst will fully own the copied pixels (this is not a view). -// Returns false in case of memory allocation error. -WEBP_EXTERN(int) WebPPictureCopy(const WebPPicture* src, WebPPicture* dst); - -// Compute PSNR or SSIM distortion between two pictures. -// Result is in dB, stores in result[] in the Y/U/V/Alpha/All order. -// Returns false in case of error (pic1 and pic2 don't have same dimension, ...) -// Warning: this function is rather CPU-intensive. -WEBP_EXTERN(int) WebPPictureDistortion( - const WebPPicture* pic1, const WebPPicture* pic2, - int metric_type, // 0 = PSNR, 1 = SSIM - float result[5]); - -// self-crops a picture to the rectangle defined by top/left/width/height. -// Returns false in case of memory allocation error, or if the rectangle is -// outside of the source picture. -// The rectangle for the view is defined by the top-left corner pixel -// coordinates (left, top) as well as its width and height. This rectangle -// must be fully be comprised inside the 'src' source picture. If the source -// picture uses the YUV420 colorspace, the top and left coordinates will be -// snapped to even values. -WEBP_EXTERN(int) WebPPictureCrop(WebPPicture* picture, - int left, int top, int width, int height); - -// Extracts a view from 'src' picture into 'dst'. The rectangle for the view -// is defined by the top-left corner pixel coordinates (left, top) as well -// as its width and height. This rectangle must be fully be comprised inside -// the 'src' source picture. If the source picture uses the YUV420 colorspace, -// the top and left coordinates will be snapped to even values. -// Picture 'src' must out-live 'dst' picture. Self-extraction of view is allowed -// ('src' equal to 'dst') as a mean of fast-cropping (but note that doing so, -// the original dimension will be lost). -// Returns false in case of memory allocation error or invalid parameters. -WEBP_EXTERN(int) WebPPictureView(const WebPPicture* src, - int left, int top, int width, int height, - WebPPicture* dst); - -// Returns true if the 'picture' is actually a view and therefore does -// not own the memory for pixels. -WEBP_EXTERN(int) WebPPictureIsView(const WebPPicture* picture); - -// Rescale a picture to new dimension width x height. -// Now gamma correction is applied. -// Returns false in case of error (invalid parameter or insufficient memory). -WEBP_EXTERN(int) WebPPictureRescale(WebPPicture* pic, int width, int height); - -// Colorspace conversion function to import RGB samples. -// Previous buffer will be free'd, if any. -// *rgb buffer should have a size of at least height * rgb_stride. -// Returns false in case of memory error. -WEBP_EXTERN(int) WebPPictureImportRGB( - WebPPicture* picture, const uint8_t* rgb, int rgb_stride); -// Same, but for RGBA buffer. -WEBP_EXTERN(int) WebPPictureImportRGBA( - WebPPicture* picture, const uint8_t* rgba, int rgba_stride); -// Same, but for RGBA buffer. Imports the RGB direct from the 32-bit format -// input buffer ignoring the alpha channel. Avoids needing to copy the data -// to a temporary 24-bit RGB buffer to import the RGB only. -WEBP_EXTERN(int) WebPPictureImportRGBX( - WebPPicture* picture, const uint8_t* rgbx, int rgbx_stride); - -// Variants of the above, but taking BGR(A|X) input. -WEBP_EXTERN(int) WebPPictureImportBGR( - WebPPicture* picture, const uint8_t* bgr, int bgr_stride); -WEBP_EXTERN(int) WebPPictureImportBGRA( - WebPPicture* picture, const uint8_t* bgra, int bgra_stride); -WEBP_EXTERN(int) WebPPictureImportBGRX( - WebPPicture* picture, const uint8_t* bgrx, int bgrx_stride); - -// Converts picture->argb data to the YUVA format specified by 'colorspace'. -// Upon return, picture->use_argb is set to false. The presence of real -// non-opaque transparent values is detected, and 'colorspace' will be -// adjusted accordingly. Note that this method is lossy. -// Returns false in case of error. -WEBP_EXTERN(int) WebPPictureARGBToYUVA(WebPPicture* picture, - WebPEncCSP colorspace); - -// Converts picture->yuv to picture->argb and sets picture->use_argb to true. -// The input format must be YUV_420 or YUV_420A. -// Note that the use of this method is discouraged if one has access to the -// raw ARGB samples, since using YUV420 is comparatively lossy. Also, the -// conversion from YUV420 to ARGB incurs a small loss too. -// Returns false in case of error. -WEBP_EXTERN(int) WebPPictureYUVAToARGB(WebPPicture* picture); - -// Helper function: given a width x height plane of YUV(A) samples -// (with stride 'stride'), clean-up the YUV samples under fully transparent -// area, to help compressibility (no guarantee, though). -WEBP_EXTERN(void) WebPCleanupTransparentArea(WebPPicture* picture); - -// Scan the picture 'picture' for the presence of non fully opaque alpha values. -// Returns true in such case. Otherwise returns false (indicating that the -// alpha plane can be ignored altogether e.g.). -WEBP_EXTERN(int) WebPPictureHasTransparency(const WebPPicture* picture); - -//------------------------------------------------------------------------------ -// Main call - -// Main encoding call, after config and picture have been initialized. -// 'picture' must be less than 16384x16384 in dimension (cf WEBP_MAX_DIMENSION), -// and the 'config' object must be a valid one. -// Returns false in case of error, true otherwise. -// In case of error, picture->error_code is updated accordingly. -// 'picture' can hold the source samples in both YUV(A) or ARGB input, depending -// on the value of 'picture->use_argb'. It is highly recommended to use -// the former for lossy encoding, and the latter for lossless encoding -// (when config.lossless is true). Automatic conversion from one format to -// another is provided but they both incur some loss. -WEBP_EXTERN(int) WebPEncode(const WebPConfig* config, WebPPicture* picture); - -//------------------------------------------------------------------------------ - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif - -#endif /* WEBP_WEBP_ENCODE_H_ */ diff --git a/external/libwebp/webp/format_constants.h b/external/libwebp/webp/format_constants.h deleted file mode 100644 index 7ce498f672..0000000000 --- a/external/libwebp/webp/format_constants.h +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright 2012 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Internal header for constants related to WebP file format. -// -// Author: Urvang (urvang@google.com) - -#ifndef WEBP_WEBP_FORMAT_CONSTANTS_H_ -#define WEBP_WEBP_FORMAT_CONSTANTS_H_ - -// VP8 related constants. -#define VP8_SIGNATURE 0x9d012a // Signature in VP8 data. -#define VP8_MAX_PARTITION0_SIZE (1 << 19) // max size of mode partition -#define VP8_MAX_PARTITION_SIZE (1 << 24) // max size for token partition -#define VP8_FRAME_HEADER_SIZE 10 // Size of the frame header within VP8 data. - -// VP8L related constants. -#define VP8L_SIGNATURE_SIZE 1 // VP8L signature size. -#define VP8L_MAGIC_BYTE 0x2f // VP8L signature byte. -#define VP8L_IMAGE_SIZE_BITS 14 // Number of bits used to store - // width and height. -#define VP8L_VERSION_BITS 3 // 3 bits reserved for version. -#define VP8L_VERSION 0 // version 0 -#define VP8L_FRAME_HEADER_SIZE 5 // Size of the VP8L frame header. - -#define MAX_PALETTE_SIZE 256 -#define MAX_CACHE_BITS 11 -#define HUFFMAN_CODES_PER_META_CODE 5 -#define ARGB_BLACK 0xff000000 - -#define DEFAULT_CODE_LENGTH 8 -#define MAX_ALLOWED_CODE_LENGTH 15 - -#define NUM_LITERAL_CODES 256 -#define NUM_LENGTH_CODES 24 -#define NUM_DISTANCE_CODES 40 -#define CODE_LENGTH_CODES 19 - -#define MIN_HUFFMAN_BITS 2 // min number of Huffman bits -#define MAX_HUFFMAN_BITS 9 // max number of Huffman bits - -#define TRANSFORM_PRESENT 1 // The bit to be written when next data - // to be read is a transform. -#define NUM_TRANSFORMS 4 // Maximum number of allowed transform - // in a bitstream. -typedef enum { - PREDICTOR_TRANSFORM = 0, - CROSS_COLOR_TRANSFORM = 1, - SUBTRACT_GREEN = 2, - COLOR_INDEXING_TRANSFORM = 3 -} VP8LImageTransformType; - -// Alpha related constants. -#define ALPHA_HEADER_LEN 1 -#define ALPHA_NO_COMPRESSION 0 -#define ALPHA_LOSSLESS_COMPRESSION 1 -#define ALPHA_PREPROCESSED_LEVELS 1 - -// Mux related constants. -#define TAG_SIZE 4 // Size of a chunk tag (e.g. "VP8L"). -#define CHUNK_SIZE_BYTES 4 // Size needed to store chunk's size. -#define CHUNK_HEADER_SIZE 8 // Size of a chunk header. -#define RIFF_HEADER_SIZE 12 // Size of the RIFF header ("RIFFnnnnWEBP"). -#define FRAME_CHUNK_SIZE 15 // Size of a FRM chunk. -#define LOOP_CHUNK_SIZE 2 // Size of a LOOP chunk. -#define TILE_CHUNK_SIZE 6 // Size of a TILE chunk. -#define VP8X_CHUNK_SIZE 10 // Size of a VP8X chunk. - -#define TILING_FLAG_BIT 0x01 // Set if tiles are possibly used. -#define ANIMATION_FLAG_BIT 0x02 // Set if some animation is expected -#define ICC_FLAG_BIT 0x04 // Whether ICC is present or not. -#define METADATA_FLAG_BIT 0x08 // Set if some META chunk is possibly present. -#define ALPHA_FLAG_BIT 0x10 // Should be same as the ALPHA_FLAG in mux.h -#define ROTATION_FLAG_BITS 0xe0 // all 3 bits for rotation + symmetry - -#define MAX_CANVAS_SIZE (1 << 24) // 24-bit max for VP8X width/height. -#define MAX_IMAGE_AREA (1ULL << 32) // 32-bit max for width x height. -#define MAX_LOOP_COUNT (1 << 16) // maximum value for loop-count -#define MAX_DURATION (1 << 24) // maximum duration -#define MAX_POSITION_OFFSET (1 << 24) // maximum frame/tile x/y offset - -// Maximum chunk payload is such that adding the header and padding won't -// overflow a uint32_t. -#define MAX_CHUNK_PAYLOAD (~0U - CHUNK_HEADER_SIZE - 1) - -#endif /* WEBP_WEBP_FORMAT_CONSTANTS_H_ */ diff --git a/external/libwebp/webp/mux.h b/external/libwebp/webp/mux.h deleted file mode 100644 index 5139af80fa..0000000000 --- a/external/libwebp/webp/mux.h +++ /dev/null @@ -1,604 +0,0 @@ -// Copyright 2011 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// RIFF container manipulation for WEBP images. -// -// Authors: Urvang (urvang@google.com) -// Vikas (vikasa@google.com) - -// This API allows manipulation of WebP container images containing features -// like Color profile, XMP metadata, Animation and Tiling. -// -// Code Example#1: Creating a MUX with image data, color profile and XMP -// metadata. -// -// int copy_data = 0; -// WebPMux* mux = WebPMuxNew(); -// // ... (Prepare image data). -// WebPMuxSetImage(mux, &image, copy_data); -// // ... (Prepare ICCP color profile data). -// WebPMuxSetColorProfile(mux, &icc_profile, copy_data); -// // ... (Prepare XMP metadata). -// WebPMuxSetMetadata(mux, &xmp, copy_data); -// // Get data from mux in WebP RIFF format. -// WebPMuxAssemble(mux, &output_data); -// WebPMuxDelete(mux); -// // ... (Consume output_data; e.g. write output_data.bytes_ to file). -// WebPDataClear(&output_data); -// -// Code Example#2: Get image and color profile data from a WebP file. -// -// int copy_data = 0; -// // ... (Read data from file). -// WebPMux* mux = WebPMuxCreate(&data, copy_data); -// WebPMuxGetImage(mux, &image); -// // ... (Consume image; e.g. call WebPDecode() to decode the data). -// WebPMuxGetColorProfile(mux, &icc_profile); -// // ... (Consume icc_data). -// WebPMuxDelete(mux); -// free(data); - -#ifndef WEBP_WEBP_MUX_H_ -#define WEBP_WEBP_MUX_H_ - -#include "./types.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -#define WEBP_MUX_ABI_VERSION 0x0100 // MAJOR(8b) + MINOR(8b) - -// Error codes -typedef enum { - WEBP_MUX_OK = 1, - WEBP_MUX_NOT_FOUND = 0, - WEBP_MUX_INVALID_ARGUMENT = -1, - WEBP_MUX_BAD_DATA = -2, - WEBP_MUX_MEMORY_ERROR = -3, - WEBP_MUX_NOT_ENOUGH_DATA = -4 -} WebPMuxError; - -// Flag values for different features used in VP8X chunk. -typedef enum { - TILE_FLAG = 0x00000001, - ANIMATION_FLAG = 0x00000002, - ICCP_FLAG = 0x00000004, - META_FLAG = 0x00000008, - ALPHA_FLAG = 0x00000010 -} WebPFeatureFlags; - -// IDs for different types of chunks. -typedef enum { - WEBP_CHUNK_VP8X, // VP8X - WEBP_CHUNK_ICCP, // ICCP - WEBP_CHUNK_LOOP, // LOOP - WEBP_CHUNK_FRAME, // FRM - WEBP_CHUNK_TILE, // TILE - WEBP_CHUNK_ALPHA, // ALPH - WEBP_CHUNK_IMAGE, // VP8/VP8L - WEBP_CHUNK_META, // META - WEBP_CHUNK_UNKNOWN, // Other chunks. - WEBP_CHUNK_NIL -} WebPChunkId; - -typedef struct WebPMux WebPMux; // main opaque object. - -// Data type used to describe 'raw' data, e.g., chunk data -// (ICC profile, metadata) and WebP compressed image data. -typedef struct { - const uint8_t* bytes_; - size_t size_; -} WebPData; - -//------------------------------------------------------------------------------ -// Manipulation of a WebPData object. - -// Initializes the contents of the 'webp_data' object with default values. -WEBP_EXTERN(void) WebPDataInit(WebPData* webp_data); - -// Clears the contents of the 'webp_data' object by calling free(). Does not -// deallocate the object itself. -WEBP_EXTERN(void) WebPDataClear(WebPData* webp_data); - -// Allocates necessary storage for 'dst' and copies the contents of 'src'. -// Returns true on success. -WEBP_EXTERN(int) WebPDataCopy(const WebPData* src, WebPData* dst); - -//------------------------------------------------------------------------------ -// Life of a Mux object - -// Internal, version-checked, entry point -WEBP_EXTERN(WebPMux*) WebPNewInternal(int); - -// Creates an empty mux object. -// Returns: -// A pointer to the newly created empty mux object. -static WEBP_INLINE WebPMux* WebPMuxNew(void) { - return WebPNewInternal(WEBP_MUX_ABI_VERSION); -} - -// Deletes the mux object. -// Parameters: -// mux - (in/out) object to be deleted -WEBP_EXTERN(void) WebPMuxDelete(WebPMux* mux); - -//------------------------------------------------------------------------------ -// Mux creation. - -// Internal, version-checked, entry point -WEBP_EXTERN(WebPMux*) WebPMuxCreateInternal(const WebPData*, int, int); - -// Creates a mux object from raw data given in WebP RIFF format. -// Parameters: -// bitstream - (in) the bitstream data in WebP RIFF format -// copy_data - (in) value 1 indicates given data WILL copied to the mux, and -// value 0 indicates data will NOT be copied. -// Returns: -// A pointer to the mux object created from given data - on success. -// NULL - In case of invalid data or memory error. -static WEBP_INLINE WebPMux* WebPMuxCreate(const WebPData* bitstream, - int copy_data) { - return WebPMuxCreateInternal(bitstream, copy_data, WEBP_MUX_ABI_VERSION); -} - -//------------------------------------------------------------------------------ -// Single Image. - -// Sets the image in the mux object. Any existing images (including frame/tile) -// will be removed. -// Parameters: -// mux - (in/out) object in which the image is to be set -// bitstream - (in) can either be a raw VP8/VP8L bitstream or a single-image -// WebP file (non-animated and non-tiled) -// copy_data - (in) value 1 indicates given data WILL copied to the mux, and -// value 0 indicates data will NOT be copied. -// Returns: -// WEBP_MUX_INVALID_ARGUMENT - if mux is NULL or bitstream is NULL. -// WEBP_MUX_MEMORY_ERROR - on memory allocation error. -// WEBP_MUX_OK - on success. -WEBP_EXTERN(WebPMuxError) WebPMuxSetImage(WebPMux* mux, - const WebPData* bitstream, - int copy_data); - -// Gets image data from the mux object. -// The content of 'bitstream' is allocated using malloc(), and NOT -// owned by the 'mux' object. It MUST be deallocated by the caller by calling -// WebPDataClear(). -// Parameters: -// mux - (in) object from which the image is to be fetched -// bitstream - (out) the image data -// Returns: -// WEBP_MUX_INVALID_ARGUMENT - if either mux or bitstream is NULL -// OR mux contains animation/tiling. -// WEBP_MUX_NOT_FOUND - if image is not present in mux object. -// WEBP_MUX_OK - on success. -WEBP_EXTERN(WebPMuxError) WebPMuxGetImage(const WebPMux* mux, - WebPData* bitstream); - -// Deletes the image in the mux object. -// Parameters: -// mux - (in/out) object from which the image is to be deleted -// Returns: -// WEBP_MUX_INVALID_ARGUMENT - if mux is NULL -// OR if mux contains animation/tiling. -// WEBP_MUX_NOT_FOUND - if image is not present in mux object. -// WEBP_MUX_OK - on success. -WEBP_EXTERN(WebPMuxError) WebPMuxDeleteImage(WebPMux* mux); - -//------------------------------------------------------------------------------ -// XMP Metadata. - -// Sets the XMP metadata in the mux object. Any existing metadata chunk(s) will -// be removed. -// Parameters: -// mux - (in/out) object to which the XMP metadata is to be added -// metadata - (in) the XMP metadata data to be added -// copy_data - (in) value 1 indicates given data WILL copied to the mux, and -// value 0 indicates data will NOT be copied. -// Returns: -// WEBP_MUX_INVALID_ARGUMENT - if mux or metadata is NULL. -// WEBP_MUX_MEMORY_ERROR - on memory allocation error. -// WEBP_MUX_OK - on success. -WEBP_EXTERN(WebPMuxError) WebPMuxSetMetadata(WebPMux* mux, - const WebPData* metadata, - int copy_data); - -// Gets a reference to the XMP metadata in the mux object. -// The caller should NOT free the returned data. -// Parameters: -// mux - (in) object from which the XMP metadata is to be fetched -// metadata - (out) XMP metadata -// Returns: -// WEBP_MUX_INVALID_ARGUMENT - if either mux or metadata is NULL. -// WEBP_MUX_NOT_FOUND - if metadata is not present in mux object. -// WEBP_MUX_OK - on success. -WEBP_EXTERN(WebPMuxError) WebPMuxGetMetadata(const WebPMux* mux, - WebPData* metadata); - -// Deletes the XMP metadata in the mux object. -// Parameters: -// mux - (in/out) object from which XMP metadata is to be deleted -// Returns: -// WEBP_MUX_INVALID_ARGUMENT - if mux is NULL -// WEBP_MUX_NOT_FOUND - If mux does not contain metadata. -// WEBP_MUX_OK - on success. -WEBP_EXTERN(WebPMuxError) WebPMuxDeleteMetadata(WebPMux* mux); - -//------------------------------------------------------------------------------ -// ICC Color Profile. - -// Sets the color profile in the mux object. Any existing color profile chunk(s) -// will be removed. -// Parameters: -// mux - (in/out) object to which the color profile is to be added -// color_profile - (in) the color profile data to be added -// copy_data - (in) value 1 indicates given data WILL copied to the mux, and -// value 0 indicates data will NOT be copied. -// Returns: -// WEBP_MUX_INVALID_ARGUMENT - if mux or color_profile is NULL -// WEBP_MUX_MEMORY_ERROR - on memory allocation error -// WEBP_MUX_OK - on success -WEBP_EXTERN(WebPMuxError) WebPMuxSetColorProfile(WebPMux* mux, - const WebPData* color_profile, - int copy_data); - -// Gets a reference to the color profile in the mux object. -// The caller should NOT free the returned data. -// Parameters: -// mux - (in) object from which the color profile data is to be fetched -// color_profile - (out) color profile data -// Returns: -// WEBP_MUX_INVALID_ARGUMENT - if either mux or color_profile is NULL. -// WEBP_MUX_NOT_FOUND - if color profile is not present in mux object. -// WEBP_MUX_OK - on success. -WEBP_EXTERN(WebPMuxError) WebPMuxGetColorProfile(const WebPMux* mux, - WebPData* color_profile); - -// Deletes the color profile in the mux object. -// Parameters: -// mux - (in/out) object from which color profile is to be deleted -// Returns: -// WEBP_MUX_INVALID_ARGUMENT - if mux is NULL -// WEBP_MUX_NOT_FOUND - If mux does not contain color profile. -// WEBP_MUX_OK - on success. -WEBP_EXTERN(WebPMuxError) WebPMuxDeleteColorProfile(WebPMux* mux); - -//------------------------------------------------------------------------------ -// Animation. - -// Adds an animation frame at the end of the mux object. -// Note: as WebP only supports even offsets, any odd offset will be snapped to -// an even location using: offset &= ~1 -// Parameters: -// mux - (in/out) object to which an animation frame is to be added -// bitstream - (in) the image data corresponding to the frame. It can either -// be a raw VP8/VP8L bitstream or a single-image WebP file -// (non-animated and non-tiled) -// x_offset - (in) x-offset of the frame to be added -// y_offset - (in) y-offset of the frame to be added -// duration - (in) duration of the frame to be added (in milliseconds) -// copy_data - (in) value 1 indicates given data WILL copied to the mux, and -// value 0 indicates data will NOT be copied. -// Returns: -// WEBP_MUX_INVALID_ARGUMENT - if mux is NULL or bitstream is NULL -// WEBP_MUX_MEMORY_ERROR - on memory allocation error. -// WEBP_MUX_OK - on success. -WEBP_EXTERN(WebPMuxError) WebPMuxPushFrame( - WebPMux* mux, const WebPData* bitstream, - int x_offset, int y_offset, int duration, int copy_data); - -// TODO(urvang): Create a struct as follows to reduce argument list size: -// typedef struct { -// WebPData bitstream; -// int x_offset, y_offset; -// int duration; -// } FrameInfo; - -// Gets the nth animation frame from the mux object. -// The content of 'bitstream' is allocated using malloc(), and NOT -// owned by the 'mux' object. It MUST be deallocated by the caller by calling -// WebPDataClear(). -// nth=0 has a special meaning - last position. -// Parameters: -// mux - (in) object from which the info is to be fetched -// nth - (in) index of the frame in the mux object -// bitstream - (out) the image data -// x_offset - (out) x-offset of the returned frame -// y_offset - (out) y-offset of the returned frame -// duration - (out) duration of the returned frame (in milliseconds) -// Returns: -// WEBP_MUX_INVALID_ARGUMENT - if either mux, bitstream, x_offset, -// y_offset, or duration is NULL -// WEBP_MUX_NOT_FOUND - if there are less than nth frames in the mux object. -// WEBP_MUX_BAD_DATA - if nth frame chunk in mux is invalid. -// WEBP_MUX_OK - on success. -WEBP_EXTERN(WebPMuxError) WebPMuxGetFrame( - const WebPMux* mux, uint32_t nth, WebPData* bitstream, - int* x_offset, int* y_offset, int* duration); - -// Deletes an animation frame from the mux object. -// nth=0 has a special meaning - last position. -// Parameters: -// mux - (in/out) object from which a frame is to be deleted -// nth - (in) The position from which the frame is to be deleted -// Returns: -// WEBP_MUX_INVALID_ARGUMENT - if mux is NULL -// WEBP_MUX_NOT_FOUND - If there are less than nth frames in the mux object -// before deletion. -// WEBP_MUX_OK - on success. -WEBP_EXTERN(WebPMuxError) WebPMuxDeleteFrame(WebPMux* mux, uint32_t nth); - -// Sets the animation loop count in the mux object. Any existing loop count -// value(s) will be removed. -// Parameters: -// mux - (in/out) object in which loop chunk is to be set/added -// loop_count - (in) animation loop count value. -// Note that loop_count of zero denotes infinite loop. -// Returns: -// WEBP_MUX_INVALID_ARGUMENT - if mux is NULL -// WEBP_MUX_MEMORY_ERROR - on memory allocation error. -// WEBP_MUX_OK - on success. -WEBP_EXTERN(WebPMuxError) WebPMuxSetLoopCount(WebPMux* mux, int loop_count); - -// Gets the animation loop count from the mux object. -// Parameters: -// mux - (in) object from which the loop count is to be fetched -// loop_count - (out) the loop_count value present in the LOOP chunk -// Returns: -// WEBP_MUX_INVALID_ARGUMENT - if either of mux or loop_count is NULL -// WEBP_MUX_NOT_FOUND - if loop chunk is not present in mux object. -// WEBP_MUX_OK - on success. -WEBP_EXTERN(WebPMuxError) WebPMuxGetLoopCount(const WebPMux* mux, - int* loop_count); - -//------------------------------------------------------------------------------ -// Tiling. - -// Adds a tile at the end of the mux object. -// Note: as WebP only supports even offsets, any odd offset will be snapped to -// an even location using: offset &= ~1 -// Parameters: -// mux - (in/out) object to which a tile is to be added. -// bitstream - (in) the image data corresponding to the frame. It can either -// be a raw VP8/VP8L bitstream or a single-image WebP file -// (non-animated and non-tiled) -// x_offset - (in) x-offset of the tile to be added -// y_offset - (in) y-offset of the tile to be added -// copy_data - (in) value 1 indicates given data WILL copied to the mux, and -// value 0 indicates data will NOT be copied. -// Returns: -// WEBP_MUX_INVALID_ARGUMENT - if mux is NULL or bitstream is NULL -// WEBP_MUX_MEMORY_ERROR - on memory allocation error. -// WEBP_MUX_OK - on success. -WEBP_EXTERN(WebPMuxError) WebPMuxPushTile( - WebPMux* mux, const WebPData* bitstream, - int x_offset, int y_offset, int copy_data); - -// Gets the nth tile from the mux object. -// The content of 'bitstream' is allocated using malloc(), and NOT -// owned by the 'mux' object. It MUST be deallocated by the caller by calling -// WebPDataClear(). -// nth=0 has a special meaning - last position. -// Parameters: -// mux - (in) object from which the info is to be fetched -// nth - (in) index of the tile in the mux object -// bitstream - (out) the image data -// x_offset - (out) x-offset of the returned tile -// y_offset - (out) y-offset of the returned tile -// Returns: -// WEBP_MUX_INVALID_ARGUMENT - if either mux, bitstream, x_offset or -// y_offset is NULL -// WEBP_MUX_NOT_FOUND - if there are less than nth tiles in the mux object. -// WEBP_MUX_BAD_DATA - if nth tile chunk in mux is invalid. -// WEBP_MUX_OK - on success. -WEBP_EXTERN(WebPMuxError) WebPMuxGetTile( - const WebPMux* mux, uint32_t nth, WebPData* bitstream, - int* x_offset, int* y_offset); - -// Deletes a tile from the mux object. -// nth=0 has a special meaning - last position -// Parameters: -// mux - (in/out) object from which a tile is to be deleted -// nth - (in) The position from which the tile is to be deleted -// Returns: -// WEBP_MUX_INVALID_ARGUMENT - if mux is NULL -// WEBP_MUX_NOT_FOUND - If there are less than nth tiles in the mux object -// before deletion. -// WEBP_MUX_OK - on success. -WEBP_EXTERN(WebPMuxError) WebPMuxDeleteTile(WebPMux* mux, uint32_t nth); - -//------------------------------------------------------------------------------ -// Misc Utilities. - -// Gets the feature flags from the mux object. -// Parameters: -// mux - (in) object from which the features are to be fetched -// flags - (out) the flags specifying which features are present in the -// mux object. This will be an OR of various flag values. -// Enum 'WebPFeatureFlags' can be used to test individual flag values. -// Returns: -// WEBP_MUX_INVALID_ARGUMENT - if mux or flags is NULL -// WEBP_MUX_NOT_FOUND - if VP8X chunk is not present in mux object. -// WEBP_MUX_BAD_DATA - if VP8X chunk in mux is invalid. -// WEBP_MUX_OK - on success. -WEBP_EXTERN(WebPMuxError) WebPMuxGetFeatures(const WebPMux* mux, - uint32_t* flags); - -// Gets number of chunks having tag value tag in the mux object. -// Parameters: -// mux - (in) object from which the info is to be fetched -// id - (in) chunk id specifying the type of chunk -// num_elements - (out) number of chunks with the given chunk id -// Returns: -// WEBP_MUX_INVALID_ARGUMENT - if either mux, or num_elements is NULL -// WEBP_MUX_OK - on success. -WEBP_EXTERN(WebPMuxError) WebPMuxNumChunks(const WebPMux* mux, - WebPChunkId id, int* num_elements); - -// Assembles all chunks in WebP RIFF format and returns in 'assembled_data'. -// This function also validates the mux object. -// Note: The content of 'assembled_data' will be ignored and overwritten. -// Also, the content of 'assembled_data' is allocated using malloc(), and NOT -// owned by the 'mux' object. It MUST be deallocated by the caller by calling -// WebPDataClear(). -// Parameters: -// mux - (in/out) object whose chunks are to be assembled -// assembled_data - (out) assembled WebP data -// Returns: -// WEBP_MUX_BAD_DATA - if mux object is invalid. -// WEBP_MUX_INVALID_ARGUMENT - if either mux, output_data or output_size is -// NULL. -// WEBP_MUX_MEMORY_ERROR - on memory allocation error. -// WEBP_MUX_OK - on success -WEBP_EXTERN(WebPMuxError) WebPMuxAssemble(WebPMux* mux, - WebPData* assembled_data); - -//------------------------------------------------------------------------------ -// Demux API. -// Enables extraction of image and extended format data from WebP files. - -#define WEBP_DEMUX_ABI_VERSION 0x0100 // MAJOR(8b) + MINOR(8b) - -typedef struct WebPDemuxer WebPDemuxer; - -typedef enum { - WEBP_DEMUX_PARSING_HEADER, // Not enough data to parse full header. - WEBP_DEMUX_PARSED_HEADER, // Header parsing complete, data may be available. - WEBP_DEMUX_DONE // Entire file has been parsed. -} WebPDemuxState; - -//------------------------------------------------------------------------------ -// Life of a Demux object - -// Internal, version-checked, entry point -WEBP_EXTERN(WebPDemuxer*) WebPDemuxInternal( - const WebPData*, int, WebPDemuxState*, int); - -// Parses the WebP file given by 'data'. -// A complete WebP file must be present in 'data' for the function to succeed. -// Returns a WebPDemuxer object on successful parse, NULL otherwise. -static WEBP_INLINE WebPDemuxer* WebPDemux(const WebPData* data) { - return WebPDemuxInternal(data, 0, NULL, WEBP_DEMUX_ABI_VERSION); -} - -// Parses the WebP file given by 'data'. -// If 'state' is non-NULL it will be set to indicate the status of the demuxer. -// Returns a WebPDemuxer object on successful parse, NULL otherwise. -static WEBP_INLINE WebPDemuxer* WebPDemuxPartial( - const WebPData* data, WebPDemuxState* state) { - return WebPDemuxInternal(data, 1, state, WEBP_DEMUX_ABI_VERSION); -} - -// Frees memory associated with 'dmux'. -WEBP_EXTERN(void) WebPDemuxDelete(WebPDemuxer* dmux); - -//------------------------------------------------------------------------------ -// Data/information extraction. - -typedef enum { - WEBP_FF_FORMAT_FLAGS, // Extended format flags present in the 'VP8X' chunk. - WEBP_FF_CANVAS_WIDTH, - WEBP_FF_CANVAS_HEIGHT, - WEBP_FF_LOOP_COUNT -} WebPFormatFeature; - -// Get the 'feature' value from the 'dmux'. -// NOTE: values are only valid if WebPDemux() was used or WebPDemuxPartial() -// returned a state > WEBP_DEMUX_PARSING_HEADER. -WEBP_EXTERN(uint32_t) WebPDemuxGetI( - const WebPDemuxer* dmux, WebPFormatFeature feature); - -//------------------------------------------------------------------------------ -// Frame iteration. - -typedef struct { - int frame_num_; - int num_frames_; - int tile_num_; - int num_tiles_; - int x_offset_, y_offset_; // offset relative to the canvas. - int width_, height_; // dimensions of this frame or tile. - int duration_; // display duration in milliseconds. - int complete_; // true if 'tile_' contains a full frame. partial images may - // still be decoded with the WebP incremental decoder. - WebPData tile_; // The frame or tile given by 'frame_num_' and 'tile_num_'. - - uint32_t pad[4]; // padding for later use - void* private_; -} WebPIterator; - -// Retrieves frame 'frame_number' from 'dmux'. -// 'iter->tile_' points to the first tile on return from this function. -// Individual tiles may be extracted using WebPDemuxSetTile(). -// Setting 'frame_number' equal to 0 will return the last frame of the image. -// Returns false if 'dmux' is NULL or frame 'frame_number' is not present. -// Call WebPDemuxReleaseIterator() when use of the iterator is complete. -// NOTE: 'dmux' must persist for the lifetime of 'iter'. -WEBP_EXTERN(int) WebPDemuxGetFrame( - const WebPDemuxer* dmux, int frame_number, WebPIterator* iter); - -// Sets 'iter->tile_' to point to the next ('iter->frame_num_' + 1) or previous -// ('iter->frame_num_' - 1) frame. These functions do not loop. -// Returns true on success, false otherwise. -WEBP_EXTERN(int) WebPDemuxNextFrame(WebPIterator* iter); -WEBP_EXTERN(int) WebPDemuxPrevFrame(WebPIterator* iter); - -// Sets 'iter->tile_' to reflect tile number 'tile_number'. -// Returns true if tile 'tile_number' is present, false otherwise. -WEBP_EXTERN(int) WebPDemuxSelectTile(WebPIterator* iter, int tile_number); - -// Releases any memory associated with 'iter'. -// Must be called before destroying the associated WebPDemuxer with -// WebPDemuxDelete(). -WEBP_EXTERN(void) WebPDemuxReleaseIterator(WebPIterator* iter); - -//------------------------------------------------------------------------------ -// Chunk iteration. - -typedef struct { - // The current and total number of chunks with the fourcc given to - // WebPDemuxGetChunk(). - int chunk_num_; - int num_chunks_; - WebPData chunk_; // The payload of the chunk. - - uint32_t pad[6]; // padding for later use - void* private_; -} WebPChunkIterator; - -// Retrieves the 'chunk_number' instance of the chunk with id 'fourcc' from -// 'dmux'. -// 'fourcc' is a character array containing the fourcc of the chunk to return, -// e.g., "ICCP", "META", "EXIF", etc. -// Setting 'chunk_number' equal to 0 will return the last chunk in a set. -// Returns true if the chunk is found, false otherwise. Image related chunk -// payloads are accessed through WebPDemuxGetFrame() and related functions. -// Call WebPDemuxReleaseChunkIterator() when use of the iterator is complete. -// NOTE: 'dmux' must persist for the lifetime of the iterator. -WEBP_EXTERN(int) WebPDemuxGetChunk(const WebPDemuxer* dmux, - const char fourcc[4], int chunk_number, - WebPChunkIterator* iter); - -// Sets 'iter->chunk_' to point to the next ('iter->chunk_num_' + 1) or previous -// ('iter->chunk_num_' - 1) chunk. These functions do not loop. -// Returns true on success, false otherwise. -WEBP_EXTERN(int) WebPDemuxNextChunk(WebPChunkIterator* iter); -WEBP_EXTERN(int) WebPDemuxPrevChunk(WebPChunkIterator* iter); - -// Releases any memory associated with 'iter'. -// Must be called before destroying the associated WebPDemuxer with -// WebPDemuxDelete(). -WEBP_EXTERN(void) WebPDemuxReleaseChunkIterator(WebPChunkIterator* iter); - -//------------------------------------------------------------------------------ - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif - -#endif /* WEBP_WEBP_MUX_H_ */ diff --git a/external/libwebp/webp/types.h b/external/libwebp/webp/types.h deleted file mode 100644 index 3e27190bef..0000000000 --- a/external/libwebp/webp/types.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2010 Google Inc. All Rights Reserved. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Common types -// -// Author: Skal (pascal.massimino@gmail.com) - -#ifndef WEBP_WEBP_TYPES_H_ -#define WEBP_WEBP_TYPES_H_ - -#include <stddef.h> // for size_t - -#ifndef _MSC_VER -#include <inttypes.h> -#ifdef __STRICT_ANSI__ -#define WEBP_INLINE -#else /* __STRICT_ANSI__ */ -#define WEBP_INLINE inline -#endif -#else -typedef signed char int8_t; -typedef unsigned char uint8_t; -typedef signed short int16_t; -typedef unsigned short uint16_t; -typedef signed int int32_t; -typedef unsigned int uint32_t; -typedef unsigned long long int uint64_t; -typedef long long int int64_t; -#define WEBP_INLINE __forceinline -#endif /* _MSC_VER */ - -#ifndef WEBP_EXTERN -// This explicitly marks library functions and allows for changing the -// signature for e.g., Windows DLL builds. -#define WEBP_EXTERN(type) extern type -#endif /* WEBP_EXTERN */ - -// Macro to check ABI compatibility (same major revision number) -#define WEBP_ABI_IS_INCOMPATIBLE(a, b) (((a) >> 8) != ((b) >> 8)) - -#endif /* WEBP_WEBP_TYPES_H_ */ diff --git a/cocos2dx/platform/third_party/android/prebuilt/libpng/include/png.h.REMOVED.git-id b/external/png/include/andorid/png.h.REMOVED.git-id similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libpng/include/png.h.REMOVED.git-id rename to external/png/include/andorid/png.h.REMOVED.git-id diff --git a/cocos2dx/platform/third_party/android/prebuilt/libpng/include/pngconf.h b/external/png/include/andorid/pngconf.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libpng/include/pngconf.h rename to external/png/include/andorid/pngconf.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libpng/include/pnglibconf.h b/external/png/include/andorid/pnglibconf.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libpng/include/pnglibconf.h rename to external/png/include/andorid/pnglibconf.h diff --git a/cocos2dx/platform/third_party/ios/libpng/png.h.REMOVED.git-id b/external/png/include/ios/png.h.REMOVED.git-id similarity index 100% rename from cocos2dx/platform/third_party/ios/libpng/png.h.REMOVED.git-id rename to external/png/include/ios/png.h.REMOVED.git-id diff --git a/cocos2dx/platform/third_party/ios/libpng/pngconf.h b/external/png/include/ios/pngconf.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libpng/pngconf.h rename to external/png/include/ios/pngconf.h diff --git a/cocos2dx/platform/third_party/ios/libpng/pnglibconf.h b/external/png/include/ios/pnglibconf.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libpng/pnglibconf.h rename to external/png/include/ios/pnglibconf.h diff --git a/cocos2dx/platform/third_party/mac/libpng/png.h.REMOVED.git-id b/external/png/include/mac/png.h.REMOVED.git-id similarity index 100% rename from cocos2dx/platform/third_party/mac/libpng/png.h.REMOVED.git-id rename to external/png/include/mac/png.h.REMOVED.git-id diff --git a/cocos2dx/platform/third_party/mac/libpng/pngconf.h b/external/png/include/mac/pngconf.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libpng/pngconf.h rename to external/png/include/mac/pngconf.h diff --git a/cocos2dx/platform/third_party/mac/libpng/pnglibconf.h b/external/png/include/mac/pnglibconf.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libpng/pnglibconf.h rename to external/png/include/mac/pnglibconf.h diff --git a/cocos2dx/platform/third_party/win32/libpng/png.h.REMOVED.git-id b/external/png/include/win32/png.h.REMOVED.git-id similarity index 100% rename from cocos2dx/platform/third_party/win32/libpng/png.h.REMOVED.git-id rename to external/png/include/win32/png.h.REMOVED.git-id diff --git a/cocos2dx/platform/third_party/win32/libpng/pngconf.h b/external/png/include/win32/pngconf.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libpng/pngconf.h rename to external/png/include/win32/pngconf.h diff --git a/cocos2dx/platform/third_party/win32/libpng/pnglibconf.h b/external/png/include/win32/pnglibconf.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libpng/pnglibconf.h rename to external/png/include/win32/pnglibconf.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libpng/Android.mk b/external/png/prebuilt/andorid/Android.mk similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libpng/Android.mk rename to external/png/prebuilt/andorid/Android.mk diff --git a/cocos2dx/platform/third_party/android/prebuilt/libpng/libs/armeabi-v7a/libpng.a.REMOVED.git-id b/external/png/prebuilt/andorid/armeabi-v7a/libpng.a.REMOVED.git-id similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libpng/libs/armeabi-v7a/libpng.a.REMOVED.git-id rename to external/png/prebuilt/andorid/armeabi-v7a/libpng.a.REMOVED.git-id diff --git a/cocos2dx/platform/third_party/android/prebuilt/libpng/libs/armeabi/libpng.a.REMOVED.git-id b/external/png/prebuilt/andorid/armeabi/libpng.a.REMOVED.git-id similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libpng/libs/armeabi/libpng.a.REMOVED.git-id rename to external/png/prebuilt/andorid/armeabi/libpng.a.REMOVED.git-id diff --git a/cocos2dx/platform/third_party/android/prebuilt/libpng/libs/x86/libpng.a.REMOVED.git-id b/external/png/prebuilt/andorid/x86/libpng.a.REMOVED.git-id similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libpng/libs/x86/libpng.a.REMOVED.git-id rename to external/png/prebuilt/andorid/x86/libpng.a.REMOVED.git-id diff --git a/cocos2dx/platform/third_party/ios/libraries/libpng.a.REMOVED.git-id b/external/png/prebuilt/ios/libpng.a.REMOVED.git-id similarity index 100% rename from cocos2dx/platform/third_party/ios/libraries/libpng.a.REMOVED.git-id rename to external/png/prebuilt/ios/libpng.a.REMOVED.git-id diff --git a/cocos2dx/platform/third_party/mac/libraries/libpng.a.REMOVED.git-id b/external/png/prebuilt/mac/libpng.a.REMOVED.git-id similarity index 100% rename from cocos2dx/platform/third_party/mac/libraries/libpng.a.REMOVED.git-id rename to external/png/prebuilt/mac/libpng.a.REMOVED.git-id diff --git a/cocos2dx/platform/third_party/win32/libraries/libpng.lib.REMOVED.git-id b/external/png/prebuilt/win32/libpng.lib.REMOVED.git-id similarity index 100% rename from cocos2dx/platform/third_party/win32/libraries/libpng.lib.REMOVED.git-id rename to external/png/prebuilt/win32/libpng.lib.REMOVED.git-id diff --git a/cocos2dx/platform/third_party/common/s3tc/s3tc.cpp b/external/s3tc/s3tc.cpp similarity index 100% rename from cocos2dx/platform/third_party/common/s3tc/s3tc.cpp rename to external/s3tc/s3tc.cpp diff --git a/cocos2dx/platform/third_party/common/s3tc/s3tc.h b/external/s3tc/s3tc.h similarity index 100% rename from cocos2dx/platform/third_party/common/s3tc/s3tc.h rename to external/s3tc/s3tc.h diff --git a/scripting/javascript/spidermonkey-android/include/js-config.h b/external/spidermonkey/include/andorid/js-config.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/js-config.h rename to external/spidermonkey/include/andorid/js-config.h diff --git a/scripting/javascript/spidermonkey-android/include/js.msg b/external/spidermonkey/include/andorid/js.msg similarity index 100% rename from scripting/javascript/spidermonkey-android/include/js.msg rename to external/spidermonkey/include/andorid/js.msg diff --git a/scripting/javascript/spidermonkey-android/include/js/Anchor.h b/external/spidermonkey/include/andorid/js/Anchor.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/js/Anchor.h rename to external/spidermonkey/include/andorid/js/Anchor.h diff --git a/scripting/javascript/spidermonkey-android/include/js/CallArgs.h b/external/spidermonkey/include/andorid/js/CallArgs.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/js/CallArgs.h rename to external/spidermonkey/include/andorid/js/CallArgs.h diff --git a/scripting/javascript/spidermonkey-android/include/js/CharacterEncoding.h b/external/spidermonkey/include/andorid/js/CharacterEncoding.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/js/CharacterEncoding.h rename to external/spidermonkey/include/andorid/js/CharacterEncoding.h diff --git a/scripting/javascript/spidermonkey-android/include/js/Date.h b/external/spidermonkey/include/andorid/js/Date.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/js/Date.h rename to external/spidermonkey/include/andorid/js/Date.h diff --git a/scripting/javascript/spidermonkey-android/include/js/GCAPI.h b/external/spidermonkey/include/andorid/js/GCAPI.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/js/GCAPI.h rename to external/spidermonkey/include/andorid/js/GCAPI.h diff --git a/scripting/javascript/spidermonkey-android/include/js/HashTable.h b/external/spidermonkey/include/andorid/js/HashTable.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/js/HashTable.h rename to external/spidermonkey/include/andorid/js/HashTable.h diff --git a/scripting/javascript/spidermonkey-android/include/js/HeapAPI.h b/external/spidermonkey/include/andorid/js/HeapAPI.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/js/HeapAPI.h rename to external/spidermonkey/include/andorid/js/HeapAPI.h diff --git a/scripting/javascript/spidermonkey-android/include/js/LegacyIntTypes.h b/external/spidermonkey/include/andorid/js/LegacyIntTypes.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/js/LegacyIntTypes.h rename to external/spidermonkey/include/andorid/js/LegacyIntTypes.h diff --git a/scripting/javascript/spidermonkey-android/include/js/MemoryMetrics.h b/external/spidermonkey/include/andorid/js/MemoryMetrics.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/js/MemoryMetrics.h rename to external/spidermonkey/include/andorid/js/MemoryMetrics.h diff --git a/scripting/javascript/spidermonkey-android/include/js/PropertyKey.h b/external/spidermonkey/include/andorid/js/PropertyKey.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/js/PropertyKey.h rename to external/spidermonkey/include/andorid/js/PropertyKey.h diff --git a/scripting/javascript/spidermonkey-android/include/js/RequiredDefines.h b/external/spidermonkey/include/andorid/js/RequiredDefines.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/js/RequiredDefines.h rename to external/spidermonkey/include/andorid/js/RequiredDefines.h diff --git a/scripting/javascript/spidermonkey-android/include/js/RootingAPI.h b/external/spidermonkey/include/andorid/js/RootingAPI.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/js/RootingAPI.h rename to external/spidermonkey/include/andorid/js/RootingAPI.h diff --git a/scripting/javascript/spidermonkey-android/include/js/TemplateLib.h b/external/spidermonkey/include/andorid/js/TemplateLib.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/js/TemplateLib.h rename to external/spidermonkey/include/andorid/js/TemplateLib.h diff --git a/scripting/javascript/spidermonkey-android/include/js/Utility.h b/external/spidermonkey/include/andorid/js/Utility.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/js/Utility.h rename to external/spidermonkey/include/andorid/js/Utility.h diff --git a/scripting/javascript/spidermonkey-android/include/js/Value.h b/external/spidermonkey/include/andorid/js/Value.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/js/Value.h rename to external/spidermonkey/include/andorid/js/Value.h diff --git a/scripting/javascript/spidermonkey-android/include/js/Vector.h b/external/spidermonkey/include/andorid/js/Vector.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/js/Vector.h rename to external/spidermonkey/include/andorid/js/Vector.h diff --git a/scripting/javascript/spidermonkey-android/include/jsalloc.h b/external/spidermonkey/include/andorid/jsalloc.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/jsalloc.h rename to external/spidermonkey/include/andorid/jsalloc.h diff --git a/scripting/javascript/spidermonkey-android/include/jsapi.h.REMOVED.git-id b/external/spidermonkey/include/andorid/jsapi.h.REMOVED.git-id similarity index 100% rename from scripting/javascript/spidermonkey-android/include/jsapi.h.REMOVED.git-id rename to external/spidermonkey/include/andorid/jsapi.h.REMOVED.git-id diff --git a/scripting/javascript/spidermonkey-android/include/jsclass.h b/external/spidermonkey/include/andorid/jsclass.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/jsclass.h rename to external/spidermonkey/include/andorid/jsclass.h diff --git a/scripting/javascript/spidermonkey-android/include/jsclist.h b/external/spidermonkey/include/andorid/jsclist.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/jsclist.h rename to external/spidermonkey/include/andorid/jsclist.h diff --git a/scripting/javascript/spidermonkey-android/include/jscpucfg.h b/external/spidermonkey/include/andorid/jscpucfg.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/jscpucfg.h rename to external/spidermonkey/include/andorid/jscpucfg.h diff --git a/scripting/javascript/spidermonkey-android/include/jsdbgapi.h b/external/spidermonkey/include/andorid/jsdbgapi.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/jsdbgapi.h rename to external/spidermonkey/include/andorid/jsdbgapi.h diff --git a/scripting/javascript/spidermonkey-android/include/jsdhash.h b/external/spidermonkey/include/andorid/jsdhash.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/jsdhash.h rename to external/spidermonkey/include/andorid/jsdhash.h diff --git a/scripting/javascript/spidermonkey-android/include/jsfriendapi.h b/external/spidermonkey/include/andorid/jsfriendapi.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/jsfriendapi.h rename to external/spidermonkey/include/andorid/jsfriendapi.h diff --git a/scripting/javascript/spidermonkey-android/include/jslock.h b/external/spidermonkey/include/andorid/jslock.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/jslock.h rename to external/spidermonkey/include/andorid/jslock.h diff --git a/scripting/javascript/spidermonkey-android/include/json.h b/external/spidermonkey/include/andorid/json.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/json.h rename to external/spidermonkey/include/andorid/json.h diff --git a/scripting/javascript/spidermonkey-android/include/jsperf.h b/external/spidermonkey/include/andorid/jsperf.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/jsperf.h rename to external/spidermonkey/include/andorid/jsperf.h diff --git a/scripting/javascript/spidermonkey-android/include/jsprf.h b/external/spidermonkey/include/andorid/jsprf.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/jsprf.h rename to external/spidermonkey/include/andorid/jsprf.h diff --git a/scripting/javascript/spidermonkey-android/include/jsprototypes.h b/external/spidermonkey/include/andorid/jsprototypes.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/jsprototypes.h rename to external/spidermonkey/include/andorid/jsprototypes.h diff --git a/scripting/javascript/spidermonkey-android/include/jsproxy.h b/external/spidermonkey/include/andorid/jsproxy.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/jsproxy.h rename to external/spidermonkey/include/andorid/jsproxy.h diff --git a/scripting/javascript/spidermonkey-android/include/jsprvtd.h b/external/spidermonkey/include/andorid/jsprvtd.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/jsprvtd.h rename to external/spidermonkey/include/andorid/jsprvtd.h diff --git a/scripting/javascript/spidermonkey-android/include/jspubtd.h b/external/spidermonkey/include/andorid/jspubtd.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/jspubtd.h rename to external/spidermonkey/include/andorid/jspubtd.h diff --git a/scripting/javascript/spidermonkey-android/include/jstypes.h b/external/spidermonkey/include/andorid/jstypes.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/jstypes.h rename to external/spidermonkey/include/andorid/jstypes.h diff --git a/scripting/javascript/spidermonkey-android/include/jsutil.h b/external/spidermonkey/include/andorid/jsutil.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/jsutil.h rename to external/spidermonkey/include/andorid/jsutil.h diff --git a/scripting/javascript/spidermonkey-android/include/jsversion.h b/external/spidermonkey/include/andorid/jsversion.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/jsversion.h rename to external/spidermonkey/include/andorid/jsversion.h diff --git a/scripting/javascript/spidermonkey-android/include/jswrapper.h b/external/spidermonkey/include/andorid/jswrapper.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/jswrapper.h rename to external/spidermonkey/include/andorid/jswrapper.h diff --git a/scripting/javascript/spidermonkey-android/include/mozilla/Assertions.h b/external/spidermonkey/include/andorid/mozilla/Assertions.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/mozilla/Assertions.h rename to external/spidermonkey/include/andorid/mozilla/Assertions.h diff --git a/scripting/javascript/spidermonkey-android/include/mozilla/Attributes.h b/external/spidermonkey/include/andorid/mozilla/Attributes.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/mozilla/Attributes.h rename to external/spidermonkey/include/andorid/mozilla/Attributes.h diff --git a/scripting/javascript/spidermonkey-android/include/mozilla/BloomFilter.h b/external/spidermonkey/include/andorid/mozilla/BloomFilter.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/mozilla/BloomFilter.h rename to external/spidermonkey/include/andorid/mozilla/BloomFilter.h diff --git a/scripting/javascript/spidermonkey-android/include/mozilla/Casting.h b/external/spidermonkey/include/andorid/mozilla/Casting.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/mozilla/Casting.h rename to external/spidermonkey/include/andorid/mozilla/Casting.h diff --git a/scripting/javascript/spidermonkey-android/include/mozilla/Char16.h b/external/spidermonkey/include/andorid/mozilla/Char16.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/mozilla/Char16.h rename to external/spidermonkey/include/andorid/mozilla/Char16.h diff --git a/scripting/javascript/spidermonkey-android/include/mozilla/CheckedInt.h b/external/spidermonkey/include/andorid/mozilla/CheckedInt.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/mozilla/CheckedInt.h rename to external/spidermonkey/include/andorid/mozilla/CheckedInt.h diff --git a/scripting/javascript/spidermonkey-android/include/mozilla/Compiler.h b/external/spidermonkey/include/andorid/mozilla/Compiler.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/mozilla/Compiler.h rename to external/spidermonkey/include/andorid/mozilla/Compiler.h diff --git a/scripting/javascript/spidermonkey-android/include/mozilla/Constants.h b/external/spidermonkey/include/andorid/mozilla/Constants.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/mozilla/Constants.h rename to external/spidermonkey/include/andorid/mozilla/Constants.h diff --git a/scripting/javascript/spidermonkey-android/include/mozilla/DebugOnly.h b/external/spidermonkey/include/andorid/mozilla/DebugOnly.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/mozilla/DebugOnly.h rename to external/spidermonkey/include/andorid/mozilla/DebugOnly.h diff --git a/scripting/javascript/spidermonkey-android/include/mozilla/Decimal.h b/external/spidermonkey/include/andorid/mozilla/Decimal.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/mozilla/Decimal.h rename to external/spidermonkey/include/andorid/mozilla/Decimal.h diff --git a/scripting/javascript/spidermonkey-android/include/mozilla/Endian.h b/external/spidermonkey/include/andorid/mozilla/Endian.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/mozilla/Endian.h rename to external/spidermonkey/include/andorid/mozilla/Endian.h diff --git a/scripting/javascript/spidermonkey-android/include/mozilla/EnumSet.h b/external/spidermonkey/include/andorid/mozilla/EnumSet.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/mozilla/EnumSet.h rename to external/spidermonkey/include/andorid/mozilla/EnumSet.h diff --git a/scripting/javascript/spidermonkey-android/include/mozilla/FloatingPoint.h b/external/spidermonkey/include/andorid/mozilla/FloatingPoint.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/mozilla/FloatingPoint.h rename to external/spidermonkey/include/andorid/mozilla/FloatingPoint.h diff --git a/scripting/javascript/spidermonkey-android/include/mozilla/GuardObjects.h b/external/spidermonkey/include/andorid/mozilla/GuardObjects.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/mozilla/GuardObjects.h rename to external/spidermonkey/include/andorid/mozilla/GuardObjects.h diff --git a/scripting/javascript/spidermonkey-android/include/mozilla/HashFunctions.h b/external/spidermonkey/include/andorid/mozilla/HashFunctions.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/mozilla/HashFunctions.h rename to external/spidermonkey/include/andorid/mozilla/HashFunctions.h diff --git a/scripting/javascript/spidermonkey-android/include/mozilla/Likely.h b/external/spidermonkey/include/andorid/mozilla/Likely.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/mozilla/Likely.h rename to external/spidermonkey/include/andorid/mozilla/Likely.h diff --git a/scripting/javascript/spidermonkey-android/include/mozilla/LinkedList.h b/external/spidermonkey/include/andorid/mozilla/LinkedList.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/mozilla/LinkedList.h rename to external/spidermonkey/include/andorid/mozilla/LinkedList.h diff --git a/scripting/javascript/spidermonkey-android/include/mozilla/MSStdInt.h b/external/spidermonkey/include/andorid/mozilla/MSStdInt.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/mozilla/MSStdInt.h rename to external/spidermonkey/include/andorid/mozilla/MSStdInt.h diff --git a/scripting/javascript/spidermonkey-android/include/mozilla/MathAlgorithms.h b/external/spidermonkey/include/andorid/mozilla/MathAlgorithms.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/mozilla/MathAlgorithms.h rename to external/spidermonkey/include/andorid/mozilla/MathAlgorithms.h diff --git a/scripting/javascript/spidermonkey-android/include/mozilla/MemoryChecking.h b/external/spidermonkey/include/andorid/mozilla/MemoryChecking.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/mozilla/MemoryChecking.h rename to external/spidermonkey/include/andorid/mozilla/MemoryChecking.h diff --git a/scripting/javascript/spidermonkey-android/include/mozilla/NullPtr.h b/external/spidermonkey/include/andorid/mozilla/NullPtr.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/mozilla/NullPtr.h rename to external/spidermonkey/include/andorid/mozilla/NullPtr.h diff --git a/scripting/javascript/spidermonkey-android/include/mozilla/PodOperations.h b/external/spidermonkey/include/andorid/mozilla/PodOperations.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/mozilla/PodOperations.h rename to external/spidermonkey/include/andorid/mozilla/PodOperations.h diff --git a/scripting/javascript/spidermonkey-android/include/mozilla/Poison.h b/external/spidermonkey/include/andorid/mozilla/Poison.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/mozilla/Poison.h rename to external/spidermonkey/include/andorid/mozilla/Poison.h diff --git a/scripting/javascript/spidermonkey-android/include/mozilla/Range.h b/external/spidermonkey/include/andorid/mozilla/Range.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/mozilla/Range.h rename to external/spidermonkey/include/andorid/mozilla/Range.h diff --git a/scripting/javascript/spidermonkey-android/include/mozilla/RangedPtr.h b/external/spidermonkey/include/andorid/mozilla/RangedPtr.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/mozilla/RangedPtr.h rename to external/spidermonkey/include/andorid/mozilla/RangedPtr.h diff --git a/scripting/javascript/spidermonkey-android/include/mozilla/RefPtr.h b/external/spidermonkey/include/andorid/mozilla/RefPtr.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/mozilla/RefPtr.h rename to external/spidermonkey/include/andorid/mozilla/RefPtr.h diff --git a/scripting/javascript/spidermonkey-android/include/mozilla/SHA1.h b/external/spidermonkey/include/andorid/mozilla/SHA1.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/mozilla/SHA1.h rename to external/spidermonkey/include/andorid/mozilla/SHA1.h diff --git a/scripting/javascript/spidermonkey-android/include/mozilla/Scoped.h b/external/spidermonkey/include/andorid/mozilla/Scoped.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/mozilla/Scoped.h rename to external/spidermonkey/include/andorid/mozilla/Scoped.h diff --git a/scripting/javascript/spidermonkey-android/include/mozilla/SplayTree.h b/external/spidermonkey/include/andorid/mozilla/SplayTree.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/mozilla/SplayTree.h rename to external/spidermonkey/include/andorid/mozilla/SplayTree.h diff --git a/scripting/javascript/spidermonkey-android/include/mozilla/StandardInteger.h b/external/spidermonkey/include/andorid/mozilla/StandardInteger.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/mozilla/StandardInteger.h rename to external/spidermonkey/include/andorid/mozilla/StandardInteger.h diff --git a/scripting/javascript/spidermonkey-android/include/mozilla/ThreadLocal.h b/external/spidermonkey/include/andorid/mozilla/ThreadLocal.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/mozilla/ThreadLocal.h rename to external/spidermonkey/include/andorid/mozilla/ThreadLocal.h diff --git a/scripting/javascript/spidermonkey-android/include/mozilla/TypeTraits.h b/external/spidermonkey/include/andorid/mozilla/TypeTraits.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/mozilla/TypeTraits.h rename to external/spidermonkey/include/andorid/mozilla/TypeTraits.h diff --git a/scripting/javascript/spidermonkey-android/include/mozilla/TypedEnum.h b/external/spidermonkey/include/andorid/mozilla/TypedEnum.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/mozilla/TypedEnum.h rename to external/spidermonkey/include/andorid/mozilla/TypedEnum.h diff --git a/scripting/javascript/spidermonkey-android/include/mozilla/Types.h b/external/spidermonkey/include/andorid/mozilla/Types.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/mozilla/Types.h rename to external/spidermonkey/include/andorid/mozilla/Types.h diff --git a/scripting/javascript/spidermonkey-android/include/mozilla/Util.h b/external/spidermonkey/include/andorid/mozilla/Util.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/mozilla/Util.h rename to external/spidermonkey/include/andorid/mozilla/Util.h diff --git a/scripting/javascript/spidermonkey-android/include/mozilla/WeakPtr.h b/external/spidermonkey/include/andorid/mozilla/WeakPtr.h similarity index 100% rename from scripting/javascript/spidermonkey-android/include/mozilla/WeakPtr.h rename to external/spidermonkey/include/andorid/mozilla/WeakPtr.h diff --git a/scripting/javascript/spidermonkey-ios/include/js-config.h b/external/spidermonkey/include/ios/js-config.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/js-config.h rename to external/spidermonkey/include/ios/js-config.h diff --git a/scripting/javascript/spidermonkey-ios/include/js.msg b/external/spidermonkey/include/ios/js.msg similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/js.msg rename to external/spidermonkey/include/ios/js.msg diff --git a/scripting/javascript/spidermonkey-ios/include/js/Anchor.h b/external/spidermonkey/include/ios/js/Anchor.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/js/Anchor.h rename to external/spidermonkey/include/ios/js/Anchor.h diff --git a/scripting/javascript/spidermonkey-ios/include/js/CallArgs.h b/external/spidermonkey/include/ios/js/CallArgs.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/js/CallArgs.h rename to external/spidermonkey/include/ios/js/CallArgs.h diff --git a/scripting/javascript/spidermonkey-ios/include/js/CharacterEncoding.h b/external/spidermonkey/include/ios/js/CharacterEncoding.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/js/CharacterEncoding.h rename to external/spidermonkey/include/ios/js/CharacterEncoding.h diff --git a/scripting/javascript/spidermonkey-ios/include/js/Date.h b/external/spidermonkey/include/ios/js/Date.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/js/Date.h rename to external/spidermonkey/include/ios/js/Date.h diff --git a/scripting/javascript/spidermonkey-ios/include/js/GCAPI.h b/external/spidermonkey/include/ios/js/GCAPI.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/js/GCAPI.h rename to external/spidermonkey/include/ios/js/GCAPI.h diff --git a/scripting/javascript/spidermonkey-ios/include/js/HashTable.h b/external/spidermonkey/include/ios/js/HashTable.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/js/HashTable.h rename to external/spidermonkey/include/ios/js/HashTable.h diff --git a/scripting/javascript/spidermonkey-ios/include/js/HeapAPI.h b/external/spidermonkey/include/ios/js/HeapAPI.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/js/HeapAPI.h rename to external/spidermonkey/include/ios/js/HeapAPI.h diff --git a/scripting/javascript/spidermonkey-ios/include/js/LegacyIntTypes.h b/external/spidermonkey/include/ios/js/LegacyIntTypes.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/js/LegacyIntTypes.h rename to external/spidermonkey/include/ios/js/LegacyIntTypes.h diff --git a/scripting/javascript/spidermonkey-ios/include/js/MemoryMetrics.h b/external/spidermonkey/include/ios/js/MemoryMetrics.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/js/MemoryMetrics.h rename to external/spidermonkey/include/ios/js/MemoryMetrics.h diff --git a/scripting/javascript/spidermonkey-ios/include/js/PropertyKey.h b/external/spidermonkey/include/ios/js/PropertyKey.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/js/PropertyKey.h rename to external/spidermonkey/include/ios/js/PropertyKey.h diff --git a/scripting/javascript/spidermonkey-ios/include/js/RequiredDefines.h b/external/spidermonkey/include/ios/js/RequiredDefines.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/js/RequiredDefines.h rename to external/spidermonkey/include/ios/js/RequiredDefines.h diff --git a/scripting/javascript/spidermonkey-ios/include/js/RootingAPI.h b/external/spidermonkey/include/ios/js/RootingAPI.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/js/RootingAPI.h rename to external/spidermonkey/include/ios/js/RootingAPI.h diff --git a/scripting/javascript/spidermonkey-ios/include/js/TemplateLib.h b/external/spidermonkey/include/ios/js/TemplateLib.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/js/TemplateLib.h rename to external/spidermonkey/include/ios/js/TemplateLib.h diff --git a/scripting/javascript/spidermonkey-ios/include/js/Utility.h b/external/spidermonkey/include/ios/js/Utility.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/js/Utility.h rename to external/spidermonkey/include/ios/js/Utility.h diff --git a/scripting/javascript/spidermonkey-ios/include/js/Value.h b/external/spidermonkey/include/ios/js/Value.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/js/Value.h rename to external/spidermonkey/include/ios/js/Value.h diff --git a/scripting/javascript/spidermonkey-ios/include/js/Vector.h b/external/spidermonkey/include/ios/js/Vector.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/js/Vector.h rename to external/spidermonkey/include/ios/js/Vector.h diff --git a/scripting/javascript/spidermonkey-ios/include/jsalloc.h b/external/spidermonkey/include/ios/jsalloc.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/jsalloc.h rename to external/spidermonkey/include/ios/jsalloc.h diff --git a/scripting/javascript/spidermonkey-ios/include/jsapi.h.REMOVED.git-id b/external/spidermonkey/include/ios/jsapi.h.REMOVED.git-id similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/jsapi.h.REMOVED.git-id rename to external/spidermonkey/include/ios/jsapi.h.REMOVED.git-id diff --git a/scripting/javascript/spidermonkey-ios/include/jsclass.h b/external/spidermonkey/include/ios/jsclass.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/jsclass.h rename to external/spidermonkey/include/ios/jsclass.h diff --git a/scripting/javascript/spidermonkey-ios/include/jsclist.h b/external/spidermonkey/include/ios/jsclist.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/jsclist.h rename to external/spidermonkey/include/ios/jsclist.h diff --git a/scripting/javascript/spidermonkey-ios/include/jscpucfg.h b/external/spidermonkey/include/ios/jscpucfg.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/jscpucfg.h rename to external/spidermonkey/include/ios/jscpucfg.h diff --git a/scripting/javascript/spidermonkey-ios/include/jsdbgapi.h b/external/spidermonkey/include/ios/jsdbgapi.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/jsdbgapi.h rename to external/spidermonkey/include/ios/jsdbgapi.h diff --git a/scripting/javascript/spidermonkey-ios/include/jsdhash.h b/external/spidermonkey/include/ios/jsdhash.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/jsdhash.h rename to external/spidermonkey/include/ios/jsdhash.h diff --git a/scripting/javascript/spidermonkey-ios/include/jsfriendapi.h b/external/spidermonkey/include/ios/jsfriendapi.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/jsfriendapi.h rename to external/spidermonkey/include/ios/jsfriendapi.h diff --git a/scripting/javascript/spidermonkey-ios/include/jslock.h b/external/spidermonkey/include/ios/jslock.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/jslock.h rename to external/spidermonkey/include/ios/jslock.h diff --git a/scripting/javascript/spidermonkey-ios/include/json.h b/external/spidermonkey/include/ios/json.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/json.h rename to external/spidermonkey/include/ios/json.h diff --git a/scripting/javascript/spidermonkey-ios/include/jsperf.h b/external/spidermonkey/include/ios/jsperf.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/jsperf.h rename to external/spidermonkey/include/ios/jsperf.h diff --git a/scripting/javascript/spidermonkey-ios/include/jsprf.h b/external/spidermonkey/include/ios/jsprf.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/jsprf.h rename to external/spidermonkey/include/ios/jsprf.h diff --git a/scripting/javascript/spidermonkey-ios/include/jsprototypes.h b/external/spidermonkey/include/ios/jsprototypes.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/jsprototypes.h rename to external/spidermonkey/include/ios/jsprototypes.h diff --git a/scripting/javascript/spidermonkey-ios/include/jsproxy.h b/external/spidermonkey/include/ios/jsproxy.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/jsproxy.h rename to external/spidermonkey/include/ios/jsproxy.h diff --git a/scripting/javascript/spidermonkey-ios/include/jsprvtd.h b/external/spidermonkey/include/ios/jsprvtd.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/jsprvtd.h rename to external/spidermonkey/include/ios/jsprvtd.h diff --git a/scripting/javascript/spidermonkey-ios/include/jspubtd.h b/external/spidermonkey/include/ios/jspubtd.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/jspubtd.h rename to external/spidermonkey/include/ios/jspubtd.h diff --git a/scripting/javascript/spidermonkey-ios/include/jstypes.h b/external/spidermonkey/include/ios/jstypes.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/jstypes.h rename to external/spidermonkey/include/ios/jstypes.h diff --git a/scripting/javascript/spidermonkey-ios/include/jsutil.h b/external/spidermonkey/include/ios/jsutil.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/jsutil.h rename to external/spidermonkey/include/ios/jsutil.h diff --git a/scripting/javascript/spidermonkey-ios/include/jsversion.h b/external/spidermonkey/include/ios/jsversion.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/jsversion.h rename to external/spidermonkey/include/ios/jsversion.h diff --git a/scripting/javascript/spidermonkey-ios/include/jswrapper.h b/external/spidermonkey/include/ios/jswrapper.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/jswrapper.h rename to external/spidermonkey/include/ios/jswrapper.h diff --git a/scripting/javascript/spidermonkey-ios/include/mozilla/Assertions.h b/external/spidermonkey/include/ios/mozilla/Assertions.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/mozilla/Assertions.h rename to external/spidermonkey/include/ios/mozilla/Assertions.h diff --git a/scripting/javascript/spidermonkey-ios/include/mozilla/Attributes.h b/external/spidermonkey/include/ios/mozilla/Attributes.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/mozilla/Attributes.h rename to external/spidermonkey/include/ios/mozilla/Attributes.h diff --git a/scripting/javascript/spidermonkey-ios/include/mozilla/BloomFilter.h b/external/spidermonkey/include/ios/mozilla/BloomFilter.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/mozilla/BloomFilter.h rename to external/spidermonkey/include/ios/mozilla/BloomFilter.h diff --git a/scripting/javascript/spidermonkey-ios/include/mozilla/Casting.h b/external/spidermonkey/include/ios/mozilla/Casting.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/mozilla/Casting.h rename to external/spidermonkey/include/ios/mozilla/Casting.h diff --git a/scripting/javascript/spidermonkey-ios/include/mozilla/Char16.h b/external/spidermonkey/include/ios/mozilla/Char16.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/mozilla/Char16.h rename to external/spidermonkey/include/ios/mozilla/Char16.h diff --git a/scripting/javascript/spidermonkey-ios/include/mozilla/CheckedInt.h b/external/spidermonkey/include/ios/mozilla/CheckedInt.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/mozilla/CheckedInt.h rename to external/spidermonkey/include/ios/mozilla/CheckedInt.h diff --git a/scripting/javascript/spidermonkey-ios/include/mozilla/Compiler.h b/external/spidermonkey/include/ios/mozilla/Compiler.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/mozilla/Compiler.h rename to external/spidermonkey/include/ios/mozilla/Compiler.h diff --git a/scripting/javascript/spidermonkey-ios/include/mozilla/Constants.h b/external/spidermonkey/include/ios/mozilla/Constants.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/mozilla/Constants.h rename to external/spidermonkey/include/ios/mozilla/Constants.h diff --git a/scripting/javascript/spidermonkey-ios/include/mozilla/DebugOnly.h b/external/spidermonkey/include/ios/mozilla/DebugOnly.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/mozilla/DebugOnly.h rename to external/spidermonkey/include/ios/mozilla/DebugOnly.h diff --git a/scripting/javascript/spidermonkey-ios/include/mozilla/Decimal.h b/external/spidermonkey/include/ios/mozilla/Decimal.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/mozilla/Decimal.h rename to external/spidermonkey/include/ios/mozilla/Decimal.h diff --git a/scripting/javascript/spidermonkey-ios/include/mozilla/Endian.h b/external/spidermonkey/include/ios/mozilla/Endian.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/mozilla/Endian.h rename to external/spidermonkey/include/ios/mozilla/Endian.h diff --git a/scripting/javascript/spidermonkey-ios/include/mozilla/EnumSet.h b/external/spidermonkey/include/ios/mozilla/EnumSet.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/mozilla/EnumSet.h rename to external/spidermonkey/include/ios/mozilla/EnumSet.h diff --git a/scripting/javascript/spidermonkey-ios/include/mozilla/FloatingPoint.h b/external/spidermonkey/include/ios/mozilla/FloatingPoint.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/mozilla/FloatingPoint.h rename to external/spidermonkey/include/ios/mozilla/FloatingPoint.h diff --git a/scripting/javascript/spidermonkey-ios/include/mozilla/GuardObjects.h b/external/spidermonkey/include/ios/mozilla/GuardObjects.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/mozilla/GuardObjects.h rename to external/spidermonkey/include/ios/mozilla/GuardObjects.h diff --git a/scripting/javascript/spidermonkey-ios/include/mozilla/HashFunctions.h b/external/spidermonkey/include/ios/mozilla/HashFunctions.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/mozilla/HashFunctions.h rename to external/spidermonkey/include/ios/mozilla/HashFunctions.h diff --git a/scripting/javascript/spidermonkey-ios/include/mozilla/Likely.h b/external/spidermonkey/include/ios/mozilla/Likely.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/mozilla/Likely.h rename to external/spidermonkey/include/ios/mozilla/Likely.h diff --git a/scripting/javascript/spidermonkey-ios/include/mozilla/LinkedList.h b/external/spidermonkey/include/ios/mozilla/LinkedList.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/mozilla/LinkedList.h rename to external/spidermonkey/include/ios/mozilla/LinkedList.h diff --git a/scripting/javascript/spidermonkey-ios/include/mozilla/MSStdInt.h b/external/spidermonkey/include/ios/mozilla/MSStdInt.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/mozilla/MSStdInt.h rename to external/spidermonkey/include/ios/mozilla/MSStdInt.h diff --git a/scripting/javascript/spidermonkey-ios/include/mozilla/MathAlgorithms.h b/external/spidermonkey/include/ios/mozilla/MathAlgorithms.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/mozilla/MathAlgorithms.h rename to external/spidermonkey/include/ios/mozilla/MathAlgorithms.h diff --git a/scripting/javascript/spidermonkey-ios/include/mozilla/MemoryChecking.h b/external/spidermonkey/include/ios/mozilla/MemoryChecking.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/mozilla/MemoryChecking.h rename to external/spidermonkey/include/ios/mozilla/MemoryChecking.h diff --git a/scripting/javascript/spidermonkey-ios/include/mozilla/NullPtr.h b/external/spidermonkey/include/ios/mozilla/NullPtr.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/mozilla/NullPtr.h rename to external/spidermonkey/include/ios/mozilla/NullPtr.h diff --git a/scripting/javascript/spidermonkey-ios/include/mozilla/PodOperations.h b/external/spidermonkey/include/ios/mozilla/PodOperations.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/mozilla/PodOperations.h rename to external/spidermonkey/include/ios/mozilla/PodOperations.h diff --git a/scripting/javascript/spidermonkey-ios/include/mozilla/Poison.h b/external/spidermonkey/include/ios/mozilla/Poison.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/mozilla/Poison.h rename to external/spidermonkey/include/ios/mozilla/Poison.h diff --git a/scripting/javascript/spidermonkey-ios/include/mozilla/Range.h b/external/spidermonkey/include/ios/mozilla/Range.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/mozilla/Range.h rename to external/spidermonkey/include/ios/mozilla/Range.h diff --git a/scripting/javascript/spidermonkey-ios/include/mozilla/RangedPtr.h b/external/spidermonkey/include/ios/mozilla/RangedPtr.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/mozilla/RangedPtr.h rename to external/spidermonkey/include/ios/mozilla/RangedPtr.h diff --git a/scripting/javascript/spidermonkey-ios/include/mozilla/RefPtr.h b/external/spidermonkey/include/ios/mozilla/RefPtr.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/mozilla/RefPtr.h rename to external/spidermonkey/include/ios/mozilla/RefPtr.h diff --git a/scripting/javascript/spidermonkey-ios/include/mozilla/SHA1.h b/external/spidermonkey/include/ios/mozilla/SHA1.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/mozilla/SHA1.h rename to external/spidermonkey/include/ios/mozilla/SHA1.h diff --git a/scripting/javascript/spidermonkey-ios/include/mozilla/Scoped.h b/external/spidermonkey/include/ios/mozilla/Scoped.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/mozilla/Scoped.h rename to external/spidermonkey/include/ios/mozilla/Scoped.h diff --git a/scripting/javascript/spidermonkey-ios/include/mozilla/SplayTree.h b/external/spidermonkey/include/ios/mozilla/SplayTree.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/mozilla/SplayTree.h rename to external/spidermonkey/include/ios/mozilla/SplayTree.h diff --git a/scripting/javascript/spidermonkey-ios/include/mozilla/StandardInteger.h b/external/spidermonkey/include/ios/mozilla/StandardInteger.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/mozilla/StandardInteger.h rename to external/spidermonkey/include/ios/mozilla/StandardInteger.h diff --git a/scripting/javascript/spidermonkey-ios/include/mozilla/ThreadLocal.h b/external/spidermonkey/include/ios/mozilla/ThreadLocal.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/mozilla/ThreadLocal.h rename to external/spidermonkey/include/ios/mozilla/ThreadLocal.h diff --git a/scripting/javascript/spidermonkey-ios/include/mozilla/TypeTraits.h b/external/spidermonkey/include/ios/mozilla/TypeTraits.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/mozilla/TypeTraits.h rename to external/spidermonkey/include/ios/mozilla/TypeTraits.h diff --git a/scripting/javascript/spidermonkey-ios/include/mozilla/TypedEnum.h b/external/spidermonkey/include/ios/mozilla/TypedEnum.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/mozilla/TypedEnum.h rename to external/spidermonkey/include/ios/mozilla/TypedEnum.h diff --git a/scripting/javascript/spidermonkey-ios/include/mozilla/Types.h b/external/spidermonkey/include/ios/mozilla/Types.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/mozilla/Types.h rename to external/spidermonkey/include/ios/mozilla/Types.h diff --git a/scripting/javascript/spidermonkey-ios/include/mozilla/Util.h b/external/spidermonkey/include/ios/mozilla/Util.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/mozilla/Util.h rename to external/spidermonkey/include/ios/mozilla/Util.h diff --git a/scripting/javascript/spidermonkey-ios/include/mozilla/WeakPtr.h b/external/spidermonkey/include/ios/mozilla/WeakPtr.h similarity index 100% rename from scripting/javascript/spidermonkey-ios/include/mozilla/WeakPtr.h rename to external/spidermonkey/include/ios/mozilla/WeakPtr.h diff --git a/scripting/javascript/spidermonkey-mac/include/js-config.h b/external/spidermonkey/include/mac/js-config.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/js-config.h rename to external/spidermonkey/include/mac/js-config.h diff --git a/scripting/javascript/spidermonkey-mac/include/js.msg b/external/spidermonkey/include/mac/js.msg similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/js.msg rename to external/spidermonkey/include/mac/js.msg diff --git a/scripting/javascript/spidermonkey-mac/include/js/Anchor.h b/external/spidermonkey/include/mac/js/Anchor.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/js/Anchor.h rename to external/spidermonkey/include/mac/js/Anchor.h diff --git a/scripting/javascript/spidermonkey-mac/include/js/CallArgs.h b/external/spidermonkey/include/mac/js/CallArgs.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/js/CallArgs.h rename to external/spidermonkey/include/mac/js/CallArgs.h diff --git a/scripting/javascript/spidermonkey-mac/include/js/CharacterEncoding.h b/external/spidermonkey/include/mac/js/CharacterEncoding.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/js/CharacterEncoding.h rename to external/spidermonkey/include/mac/js/CharacterEncoding.h diff --git a/scripting/javascript/spidermonkey-mac/include/js/Date.h b/external/spidermonkey/include/mac/js/Date.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/js/Date.h rename to external/spidermonkey/include/mac/js/Date.h diff --git a/scripting/javascript/spidermonkey-mac/include/js/GCAPI.h b/external/spidermonkey/include/mac/js/GCAPI.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/js/GCAPI.h rename to external/spidermonkey/include/mac/js/GCAPI.h diff --git a/scripting/javascript/spidermonkey-mac/include/js/HashTable.h b/external/spidermonkey/include/mac/js/HashTable.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/js/HashTable.h rename to external/spidermonkey/include/mac/js/HashTable.h diff --git a/scripting/javascript/spidermonkey-mac/include/js/HeapAPI.h b/external/spidermonkey/include/mac/js/HeapAPI.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/js/HeapAPI.h rename to external/spidermonkey/include/mac/js/HeapAPI.h diff --git a/scripting/javascript/spidermonkey-mac/include/js/LegacyIntTypes.h b/external/spidermonkey/include/mac/js/LegacyIntTypes.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/js/LegacyIntTypes.h rename to external/spidermonkey/include/mac/js/LegacyIntTypes.h diff --git a/scripting/javascript/spidermonkey-mac/include/js/MemoryMetrics.h b/external/spidermonkey/include/mac/js/MemoryMetrics.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/js/MemoryMetrics.h rename to external/spidermonkey/include/mac/js/MemoryMetrics.h diff --git a/scripting/javascript/spidermonkey-mac/include/js/PropertyKey.h b/external/spidermonkey/include/mac/js/PropertyKey.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/js/PropertyKey.h rename to external/spidermonkey/include/mac/js/PropertyKey.h diff --git a/scripting/javascript/spidermonkey-mac/include/js/RequiredDefines.h b/external/spidermonkey/include/mac/js/RequiredDefines.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/js/RequiredDefines.h rename to external/spidermonkey/include/mac/js/RequiredDefines.h diff --git a/scripting/javascript/spidermonkey-mac/include/js/RootingAPI.h b/external/spidermonkey/include/mac/js/RootingAPI.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/js/RootingAPI.h rename to external/spidermonkey/include/mac/js/RootingAPI.h diff --git a/scripting/javascript/spidermonkey-mac/include/js/TemplateLib.h b/external/spidermonkey/include/mac/js/TemplateLib.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/js/TemplateLib.h rename to external/spidermonkey/include/mac/js/TemplateLib.h diff --git a/scripting/javascript/spidermonkey-mac/include/js/Utility.h b/external/spidermonkey/include/mac/js/Utility.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/js/Utility.h rename to external/spidermonkey/include/mac/js/Utility.h diff --git a/scripting/javascript/spidermonkey-mac/include/js/Value.h b/external/spidermonkey/include/mac/js/Value.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/js/Value.h rename to external/spidermonkey/include/mac/js/Value.h diff --git a/scripting/javascript/spidermonkey-mac/include/js/Vector.h b/external/spidermonkey/include/mac/js/Vector.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/js/Vector.h rename to external/spidermonkey/include/mac/js/Vector.h diff --git a/scripting/javascript/spidermonkey-mac/include/jsalloc.h b/external/spidermonkey/include/mac/jsalloc.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/jsalloc.h rename to external/spidermonkey/include/mac/jsalloc.h diff --git a/scripting/javascript/spidermonkey-mac/include/jsapi.h.REMOVED.git-id b/external/spidermonkey/include/mac/jsapi.h.REMOVED.git-id similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/jsapi.h.REMOVED.git-id rename to external/spidermonkey/include/mac/jsapi.h.REMOVED.git-id diff --git a/scripting/javascript/spidermonkey-mac/include/jsclass.h b/external/spidermonkey/include/mac/jsclass.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/jsclass.h rename to external/spidermonkey/include/mac/jsclass.h diff --git a/scripting/javascript/spidermonkey-mac/include/jsclist.h b/external/spidermonkey/include/mac/jsclist.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/jsclist.h rename to external/spidermonkey/include/mac/jsclist.h diff --git a/scripting/javascript/spidermonkey-mac/include/jscpucfg.h b/external/spidermonkey/include/mac/jscpucfg.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/jscpucfg.h rename to external/spidermonkey/include/mac/jscpucfg.h diff --git a/scripting/javascript/spidermonkey-mac/include/jsdbgapi.h b/external/spidermonkey/include/mac/jsdbgapi.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/jsdbgapi.h rename to external/spidermonkey/include/mac/jsdbgapi.h diff --git a/scripting/javascript/spidermonkey-mac/include/jsdhash.h b/external/spidermonkey/include/mac/jsdhash.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/jsdhash.h rename to external/spidermonkey/include/mac/jsdhash.h diff --git a/scripting/javascript/spidermonkey-mac/include/jsfriendapi.h b/external/spidermonkey/include/mac/jsfriendapi.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/jsfriendapi.h rename to external/spidermonkey/include/mac/jsfriendapi.h diff --git a/scripting/javascript/spidermonkey-mac/include/jslock.h b/external/spidermonkey/include/mac/jslock.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/jslock.h rename to external/spidermonkey/include/mac/jslock.h diff --git a/scripting/javascript/spidermonkey-mac/include/json.h b/external/spidermonkey/include/mac/json.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/json.h rename to external/spidermonkey/include/mac/json.h diff --git a/scripting/javascript/spidermonkey-mac/include/jsperf.h b/external/spidermonkey/include/mac/jsperf.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/jsperf.h rename to external/spidermonkey/include/mac/jsperf.h diff --git a/scripting/javascript/spidermonkey-mac/include/jsprf.h b/external/spidermonkey/include/mac/jsprf.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/jsprf.h rename to external/spidermonkey/include/mac/jsprf.h diff --git a/scripting/javascript/spidermonkey-mac/include/jsprototypes.h b/external/spidermonkey/include/mac/jsprototypes.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/jsprototypes.h rename to external/spidermonkey/include/mac/jsprototypes.h diff --git a/scripting/javascript/spidermonkey-mac/include/jsproxy.h b/external/spidermonkey/include/mac/jsproxy.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/jsproxy.h rename to external/spidermonkey/include/mac/jsproxy.h diff --git a/scripting/javascript/spidermonkey-mac/include/jsprvtd.h b/external/spidermonkey/include/mac/jsprvtd.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/jsprvtd.h rename to external/spidermonkey/include/mac/jsprvtd.h diff --git a/scripting/javascript/spidermonkey-mac/include/jspubtd.h b/external/spidermonkey/include/mac/jspubtd.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/jspubtd.h rename to external/spidermonkey/include/mac/jspubtd.h diff --git a/scripting/javascript/spidermonkey-mac/include/jstypes.h b/external/spidermonkey/include/mac/jstypes.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/jstypes.h rename to external/spidermonkey/include/mac/jstypes.h diff --git a/scripting/javascript/spidermonkey-mac/include/jsutil.h b/external/spidermonkey/include/mac/jsutil.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/jsutil.h rename to external/spidermonkey/include/mac/jsutil.h diff --git a/scripting/javascript/spidermonkey-mac/include/jsversion.h b/external/spidermonkey/include/mac/jsversion.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/jsversion.h rename to external/spidermonkey/include/mac/jsversion.h diff --git a/scripting/javascript/spidermonkey-mac/include/jswrapper.h b/external/spidermonkey/include/mac/jswrapper.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/jswrapper.h rename to external/spidermonkey/include/mac/jswrapper.h diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/Assertions.h b/external/spidermonkey/include/mac/mozilla/Assertions.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/mozilla/Assertions.h rename to external/spidermonkey/include/mac/mozilla/Assertions.h diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/Attributes.h b/external/spidermonkey/include/mac/mozilla/Attributes.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/mozilla/Attributes.h rename to external/spidermonkey/include/mac/mozilla/Attributes.h diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/BloomFilter.h b/external/spidermonkey/include/mac/mozilla/BloomFilter.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/mozilla/BloomFilter.h rename to external/spidermonkey/include/mac/mozilla/BloomFilter.h diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/Casting.h b/external/spidermonkey/include/mac/mozilla/Casting.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/mozilla/Casting.h rename to external/spidermonkey/include/mac/mozilla/Casting.h diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/Char16.h b/external/spidermonkey/include/mac/mozilla/Char16.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/mozilla/Char16.h rename to external/spidermonkey/include/mac/mozilla/Char16.h diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/CheckedInt.h b/external/spidermonkey/include/mac/mozilla/CheckedInt.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/mozilla/CheckedInt.h rename to external/spidermonkey/include/mac/mozilla/CheckedInt.h diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/Compiler.h b/external/spidermonkey/include/mac/mozilla/Compiler.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/mozilla/Compiler.h rename to external/spidermonkey/include/mac/mozilla/Compiler.h diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/Constants.h b/external/spidermonkey/include/mac/mozilla/Constants.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/mozilla/Constants.h rename to external/spidermonkey/include/mac/mozilla/Constants.h diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/DebugOnly.h b/external/spidermonkey/include/mac/mozilla/DebugOnly.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/mozilla/DebugOnly.h rename to external/spidermonkey/include/mac/mozilla/DebugOnly.h diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/Decimal.h b/external/spidermonkey/include/mac/mozilla/Decimal.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/mozilla/Decimal.h rename to external/spidermonkey/include/mac/mozilla/Decimal.h diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/Endian.h b/external/spidermonkey/include/mac/mozilla/Endian.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/mozilla/Endian.h rename to external/spidermonkey/include/mac/mozilla/Endian.h diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/EnumSet.h b/external/spidermonkey/include/mac/mozilla/EnumSet.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/mozilla/EnumSet.h rename to external/spidermonkey/include/mac/mozilla/EnumSet.h diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/FloatingPoint.h b/external/spidermonkey/include/mac/mozilla/FloatingPoint.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/mozilla/FloatingPoint.h rename to external/spidermonkey/include/mac/mozilla/FloatingPoint.h diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/GuardObjects.h b/external/spidermonkey/include/mac/mozilla/GuardObjects.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/mozilla/GuardObjects.h rename to external/spidermonkey/include/mac/mozilla/GuardObjects.h diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/HashFunctions.h b/external/spidermonkey/include/mac/mozilla/HashFunctions.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/mozilla/HashFunctions.h rename to external/spidermonkey/include/mac/mozilla/HashFunctions.h diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/Likely.h b/external/spidermonkey/include/mac/mozilla/Likely.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/mozilla/Likely.h rename to external/spidermonkey/include/mac/mozilla/Likely.h diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/LinkedList.h b/external/spidermonkey/include/mac/mozilla/LinkedList.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/mozilla/LinkedList.h rename to external/spidermonkey/include/mac/mozilla/LinkedList.h diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/MSStdInt.h b/external/spidermonkey/include/mac/mozilla/MSStdInt.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/mozilla/MSStdInt.h rename to external/spidermonkey/include/mac/mozilla/MSStdInt.h diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/MathAlgorithms.h b/external/spidermonkey/include/mac/mozilla/MathAlgorithms.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/mozilla/MathAlgorithms.h rename to external/spidermonkey/include/mac/mozilla/MathAlgorithms.h diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/MemoryChecking.h b/external/spidermonkey/include/mac/mozilla/MemoryChecking.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/mozilla/MemoryChecking.h rename to external/spidermonkey/include/mac/mozilla/MemoryChecking.h diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/NullPtr.h b/external/spidermonkey/include/mac/mozilla/NullPtr.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/mozilla/NullPtr.h rename to external/spidermonkey/include/mac/mozilla/NullPtr.h diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/PodOperations.h b/external/spidermonkey/include/mac/mozilla/PodOperations.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/mozilla/PodOperations.h rename to external/spidermonkey/include/mac/mozilla/PodOperations.h diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/Poison.h b/external/spidermonkey/include/mac/mozilla/Poison.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/mozilla/Poison.h rename to external/spidermonkey/include/mac/mozilla/Poison.h diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/Range.h b/external/spidermonkey/include/mac/mozilla/Range.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/mozilla/Range.h rename to external/spidermonkey/include/mac/mozilla/Range.h diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/RangedPtr.h b/external/spidermonkey/include/mac/mozilla/RangedPtr.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/mozilla/RangedPtr.h rename to external/spidermonkey/include/mac/mozilla/RangedPtr.h diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/RefPtr.h b/external/spidermonkey/include/mac/mozilla/RefPtr.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/mozilla/RefPtr.h rename to external/spidermonkey/include/mac/mozilla/RefPtr.h diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/SHA1.h b/external/spidermonkey/include/mac/mozilla/SHA1.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/mozilla/SHA1.h rename to external/spidermonkey/include/mac/mozilla/SHA1.h diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/Scoped.h b/external/spidermonkey/include/mac/mozilla/Scoped.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/mozilla/Scoped.h rename to external/spidermonkey/include/mac/mozilla/Scoped.h diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/SplayTree.h b/external/spidermonkey/include/mac/mozilla/SplayTree.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/mozilla/SplayTree.h rename to external/spidermonkey/include/mac/mozilla/SplayTree.h diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/StandardInteger.h b/external/spidermonkey/include/mac/mozilla/StandardInteger.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/mozilla/StandardInteger.h rename to external/spidermonkey/include/mac/mozilla/StandardInteger.h diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/ThreadLocal.h b/external/spidermonkey/include/mac/mozilla/ThreadLocal.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/mozilla/ThreadLocal.h rename to external/spidermonkey/include/mac/mozilla/ThreadLocal.h diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/TypeTraits.h b/external/spidermonkey/include/mac/mozilla/TypeTraits.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/mozilla/TypeTraits.h rename to external/spidermonkey/include/mac/mozilla/TypeTraits.h diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/TypedEnum.h b/external/spidermonkey/include/mac/mozilla/TypedEnum.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/mozilla/TypedEnum.h rename to external/spidermonkey/include/mac/mozilla/TypedEnum.h diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/Types.h b/external/spidermonkey/include/mac/mozilla/Types.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/mozilla/Types.h rename to external/spidermonkey/include/mac/mozilla/Types.h diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/Util.h b/external/spidermonkey/include/mac/mozilla/Util.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/mozilla/Util.h rename to external/spidermonkey/include/mac/mozilla/Util.h diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/WeakPtr.h b/external/spidermonkey/include/mac/mozilla/WeakPtr.h similarity index 100% rename from scripting/javascript/spidermonkey-mac/include/mozilla/WeakPtr.h rename to external/spidermonkey/include/mac/mozilla/WeakPtr.h diff --git a/scripting/javascript/spidermonkey-win32/include/js-config.h b/external/spidermonkey/include/win32/js-config.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/js-config.h rename to external/spidermonkey/include/win32/js-config.h diff --git a/scripting/javascript/spidermonkey-win32/include/js.msg b/external/spidermonkey/include/win32/js.msg similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/js.msg rename to external/spidermonkey/include/win32/js.msg diff --git a/scripting/javascript/spidermonkey-win32/include/js/Anchor.h b/external/spidermonkey/include/win32/js/Anchor.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/js/Anchor.h rename to external/spidermonkey/include/win32/js/Anchor.h diff --git a/scripting/javascript/spidermonkey-win32/include/js/CallArgs.h b/external/spidermonkey/include/win32/js/CallArgs.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/js/CallArgs.h rename to external/spidermonkey/include/win32/js/CallArgs.h diff --git a/scripting/javascript/spidermonkey-win32/include/js/CharacterEncoding.h b/external/spidermonkey/include/win32/js/CharacterEncoding.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/js/CharacterEncoding.h rename to external/spidermonkey/include/win32/js/CharacterEncoding.h diff --git a/scripting/javascript/spidermonkey-win32/include/js/Date.h b/external/spidermonkey/include/win32/js/Date.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/js/Date.h rename to external/spidermonkey/include/win32/js/Date.h diff --git a/scripting/javascript/spidermonkey-win32/include/js/GCAPI.h b/external/spidermonkey/include/win32/js/GCAPI.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/js/GCAPI.h rename to external/spidermonkey/include/win32/js/GCAPI.h diff --git a/scripting/javascript/spidermonkey-win32/include/js/HashTable.h b/external/spidermonkey/include/win32/js/HashTable.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/js/HashTable.h rename to external/spidermonkey/include/win32/js/HashTable.h diff --git a/scripting/javascript/spidermonkey-win32/include/js/HeapAPI.h b/external/spidermonkey/include/win32/js/HeapAPI.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/js/HeapAPI.h rename to external/spidermonkey/include/win32/js/HeapAPI.h diff --git a/scripting/javascript/spidermonkey-win32/include/js/LegacyIntTypes.h b/external/spidermonkey/include/win32/js/LegacyIntTypes.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/js/LegacyIntTypes.h rename to external/spidermonkey/include/win32/js/LegacyIntTypes.h diff --git a/scripting/javascript/spidermonkey-win32/include/js/MemoryMetrics.h b/external/spidermonkey/include/win32/js/MemoryMetrics.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/js/MemoryMetrics.h rename to external/spidermonkey/include/win32/js/MemoryMetrics.h diff --git a/scripting/javascript/spidermonkey-win32/include/js/PropertyKey.h b/external/spidermonkey/include/win32/js/PropertyKey.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/js/PropertyKey.h rename to external/spidermonkey/include/win32/js/PropertyKey.h diff --git a/scripting/javascript/spidermonkey-win32/include/js/RequiredDefines.h b/external/spidermonkey/include/win32/js/RequiredDefines.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/js/RequiredDefines.h rename to external/spidermonkey/include/win32/js/RequiredDefines.h diff --git a/scripting/javascript/spidermonkey-win32/include/js/RootingAPI.h b/external/spidermonkey/include/win32/js/RootingAPI.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/js/RootingAPI.h rename to external/spidermonkey/include/win32/js/RootingAPI.h diff --git a/scripting/javascript/spidermonkey-win32/include/js/TemplateLib.h b/external/spidermonkey/include/win32/js/TemplateLib.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/js/TemplateLib.h rename to external/spidermonkey/include/win32/js/TemplateLib.h diff --git a/scripting/javascript/spidermonkey-win32/include/js/Utility.h b/external/spidermonkey/include/win32/js/Utility.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/js/Utility.h rename to external/spidermonkey/include/win32/js/Utility.h diff --git a/scripting/javascript/spidermonkey-win32/include/js/Value.h b/external/spidermonkey/include/win32/js/Value.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/js/Value.h rename to external/spidermonkey/include/win32/js/Value.h diff --git a/scripting/javascript/spidermonkey-win32/include/js/Vector.h b/external/spidermonkey/include/win32/js/Vector.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/js/Vector.h rename to external/spidermonkey/include/win32/js/Vector.h diff --git a/scripting/javascript/spidermonkey-win32/include/jsalloc.h b/external/spidermonkey/include/win32/jsalloc.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/jsalloc.h rename to external/spidermonkey/include/win32/jsalloc.h diff --git a/scripting/javascript/spidermonkey-win32/include/jsapi.h.REMOVED.git-id b/external/spidermonkey/include/win32/jsapi.h.REMOVED.git-id similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/jsapi.h.REMOVED.git-id rename to external/spidermonkey/include/win32/jsapi.h.REMOVED.git-id diff --git a/scripting/javascript/spidermonkey-win32/include/jsclass.h b/external/spidermonkey/include/win32/jsclass.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/jsclass.h rename to external/spidermonkey/include/win32/jsclass.h diff --git a/scripting/javascript/spidermonkey-win32/include/jsclist.h b/external/spidermonkey/include/win32/jsclist.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/jsclist.h rename to external/spidermonkey/include/win32/jsclist.h diff --git a/scripting/javascript/spidermonkey-win32/include/jscpucfg.h b/external/spidermonkey/include/win32/jscpucfg.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/jscpucfg.h rename to external/spidermonkey/include/win32/jscpucfg.h diff --git a/scripting/javascript/spidermonkey-win32/include/jsdbgapi.h b/external/spidermonkey/include/win32/jsdbgapi.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/jsdbgapi.h rename to external/spidermonkey/include/win32/jsdbgapi.h diff --git a/scripting/javascript/spidermonkey-win32/include/jsdhash.h b/external/spidermonkey/include/win32/jsdhash.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/jsdhash.h rename to external/spidermonkey/include/win32/jsdhash.h diff --git a/scripting/javascript/spidermonkey-win32/include/jsfriendapi.h b/external/spidermonkey/include/win32/jsfriendapi.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/jsfriendapi.h rename to external/spidermonkey/include/win32/jsfriendapi.h diff --git a/scripting/javascript/spidermonkey-win32/include/jslock.h b/external/spidermonkey/include/win32/jslock.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/jslock.h rename to external/spidermonkey/include/win32/jslock.h diff --git a/scripting/javascript/spidermonkey-win32/include/json.h b/external/spidermonkey/include/win32/json.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/json.h rename to external/spidermonkey/include/win32/json.h diff --git a/scripting/javascript/spidermonkey-win32/include/jsperf.h b/external/spidermonkey/include/win32/jsperf.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/jsperf.h rename to external/spidermonkey/include/win32/jsperf.h diff --git a/scripting/javascript/spidermonkey-win32/include/jsprf.h b/external/spidermonkey/include/win32/jsprf.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/jsprf.h rename to external/spidermonkey/include/win32/jsprf.h diff --git a/scripting/javascript/spidermonkey-win32/include/jsprototypes.h b/external/spidermonkey/include/win32/jsprototypes.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/jsprototypes.h rename to external/spidermonkey/include/win32/jsprototypes.h diff --git a/scripting/javascript/spidermonkey-win32/include/jsproxy.h b/external/spidermonkey/include/win32/jsproxy.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/jsproxy.h rename to external/spidermonkey/include/win32/jsproxy.h diff --git a/scripting/javascript/spidermonkey-win32/include/jsprvtd.h b/external/spidermonkey/include/win32/jsprvtd.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/jsprvtd.h rename to external/spidermonkey/include/win32/jsprvtd.h diff --git a/scripting/javascript/spidermonkey-win32/include/jspubtd.h b/external/spidermonkey/include/win32/jspubtd.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/jspubtd.h rename to external/spidermonkey/include/win32/jspubtd.h diff --git a/scripting/javascript/spidermonkey-win32/include/jstypes.h b/external/spidermonkey/include/win32/jstypes.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/jstypes.h rename to external/spidermonkey/include/win32/jstypes.h diff --git a/scripting/javascript/spidermonkey-win32/include/jsutil.h b/external/spidermonkey/include/win32/jsutil.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/jsutil.h rename to external/spidermonkey/include/win32/jsutil.h diff --git a/scripting/javascript/spidermonkey-win32/include/jsversion.h b/external/spidermonkey/include/win32/jsversion.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/jsversion.h rename to external/spidermonkey/include/win32/jsversion.h diff --git a/scripting/javascript/spidermonkey-win32/include/jswrapper.h b/external/spidermonkey/include/win32/jswrapper.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/jswrapper.h rename to external/spidermonkey/include/win32/jswrapper.h diff --git a/scripting/javascript/spidermonkey-win32/include/mozilla/Assertions.h b/external/spidermonkey/include/win32/mozilla/Assertions.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/mozilla/Assertions.h rename to external/spidermonkey/include/win32/mozilla/Assertions.h diff --git a/scripting/javascript/spidermonkey-win32/include/mozilla/Attributes.h b/external/spidermonkey/include/win32/mozilla/Attributes.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/mozilla/Attributes.h rename to external/spidermonkey/include/win32/mozilla/Attributes.h diff --git a/scripting/javascript/spidermonkey-win32/include/mozilla/BloomFilter.h b/external/spidermonkey/include/win32/mozilla/BloomFilter.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/mozilla/BloomFilter.h rename to external/spidermonkey/include/win32/mozilla/BloomFilter.h diff --git a/scripting/javascript/spidermonkey-win32/include/mozilla/Casting.h b/external/spidermonkey/include/win32/mozilla/Casting.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/mozilla/Casting.h rename to external/spidermonkey/include/win32/mozilla/Casting.h diff --git a/scripting/javascript/spidermonkey-win32/include/mozilla/Char16.h b/external/spidermonkey/include/win32/mozilla/Char16.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/mozilla/Char16.h rename to external/spidermonkey/include/win32/mozilla/Char16.h diff --git a/scripting/javascript/spidermonkey-win32/include/mozilla/CheckedInt.h b/external/spidermonkey/include/win32/mozilla/CheckedInt.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/mozilla/CheckedInt.h rename to external/spidermonkey/include/win32/mozilla/CheckedInt.h diff --git a/scripting/javascript/spidermonkey-win32/include/mozilla/Compiler.h b/external/spidermonkey/include/win32/mozilla/Compiler.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/mozilla/Compiler.h rename to external/spidermonkey/include/win32/mozilla/Compiler.h diff --git a/scripting/javascript/spidermonkey-win32/include/mozilla/Constants.h b/external/spidermonkey/include/win32/mozilla/Constants.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/mozilla/Constants.h rename to external/spidermonkey/include/win32/mozilla/Constants.h diff --git a/scripting/javascript/spidermonkey-win32/include/mozilla/DebugOnly.h b/external/spidermonkey/include/win32/mozilla/DebugOnly.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/mozilla/DebugOnly.h rename to external/spidermonkey/include/win32/mozilla/DebugOnly.h diff --git a/scripting/javascript/spidermonkey-win32/include/mozilla/Decimal.h b/external/spidermonkey/include/win32/mozilla/Decimal.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/mozilla/Decimal.h rename to external/spidermonkey/include/win32/mozilla/Decimal.h diff --git a/scripting/javascript/spidermonkey-win32/include/mozilla/Endian.h b/external/spidermonkey/include/win32/mozilla/Endian.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/mozilla/Endian.h rename to external/spidermonkey/include/win32/mozilla/Endian.h diff --git a/scripting/javascript/spidermonkey-win32/include/mozilla/EnumSet.h b/external/spidermonkey/include/win32/mozilla/EnumSet.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/mozilla/EnumSet.h rename to external/spidermonkey/include/win32/mozilla/EnumSet.h diff --git a/scripting/javascript/spidermonkey-win32/include/mozilla/FloatingPoint.h b/external/spidermonkey/include/win32/mozilla/FloatingPoint.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/mozilla/FloatingPoint.h rename to external/spidermonkey/include/win32/mozilla/FloatingPoint.h diff --git a/scripting/javascript/spidermonkey-win32/include/mozilla/GuardObjects.h b/external/spidermonkey/include/win32/mozilla/GuardObjects.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/mozilla/GuardObjects.h rename to external/spidermonkey/include/win32/mozilla/GuardObjects.h diff --git a/scripting/javascript/spidermonkey-win32/include/mozilla/HashFunctions.h b/external/spidermonkey/include/win32/mozilla/HashFunctions.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/mozilla/HashFunctions.h rename to external/spidermonkey/include/win32/mozilla/HashFunctions.h diff --git a/scripting/javascript/spidermonkey-win32/include/mozilla/Likely.h b/external/spidermonkey/include/win32/mozilla/Likely.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/mozilla/Likely.h rename to external/spidermonkey/include/win32/mozilla/Likely.h diff --git a/scripting/javascript/spidermonkey-win32/include/mozilla/LinkedList.h b/external/spidermonkey/include/win32/mozilla/LinkedList.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/mozilla/LinkedList.h rename to external/spidermonkey/include/win32/mozilla/LinkedList.h diff --git a/scripting/javascript/spidermonkey-win32/include/mozilla/MSStdInt.h b/external/spidermonkey/include/win32/mozilla/MSStdInt.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/mozilla/MSStdInt.h rename to external/spidermonkey/include/win32/mozilla/MSStdInt.h diff --git a/scripting/javascript/spidermonkey-win32/include/mozilla/MathAlgorithms.h b/external/spidermonkey/include/win32/mozilla/MathAlgorithms.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/mozilla/MathAlgorithms.h rename to external/spidermonkey/include/win32/mozilla/MathAlgorithms.h diff --git a/scripting/javascript/spidermonkey-win32/include/mozilla/MemoryChecking.h b/external/spidermonkey/include/win32/mozilla/MemoryChecking.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/mozilla/MemoryChecking.h rename to external/spidermonkey/include/win32/mozilla/MemoryChecking.h diff --git a/scripting/javascript/spidermonkey-win32/include/mozilla/NullPtr.h b/external/spidermonkey/include/win32/mozilla/NullPtr.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/mozilla/NullPtr.h rename to external/spidermonkey/include/win32/mozilla/NullPtr.h diff --git a/scripting/javascript/spidermonkey-win32/include/mozilla/PodOperations.h b/external/spidermonkey/include/win32/mozilla/PodOperations.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/mozilla/PodOperations.h rename to external/spidermonkey/include/win32/mozilla/PodOperations.h diff --git a/scripting/javascript/spidermonkey-win32/include/mozilla/Poison.h b/external/spidermonkey/include/win32/mozilla/Poison.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/mozilla/Poison.h rename to external/spidermonkey/include/win32/mozilla/Poison.h diff --git a/scripting/javascript/spidermonkey-win32/include/mozilla/Range.h b/external/spidermonkey/include/win32/mozilla/Range.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/mozilla/Range.h rename to external/spidermonkey/include/win32/mozilla/Range.h diff --git a/scripting/javascript/spidermonkey-win32/include/mozilla/RangedPtr.h b/external/spidermonkey/include/win32/mozilla/RangedPtr.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/mozilla/RangedPtr.h rename to external/spidermonkey/include/win32/mozilla/RangedPtr.h diff --git a/scripting/javascript/spidermonkey-win32/include/mozilla/RefPtr.h b/external/spidermonkey/include/win32/mozilla/RefPtr.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/mozilla/RefPtr.h rename to external/spidermonkey/include/win32/mozilla/RefPtr.h diff --git a/scripting/javascript/spidermonkey-win32/include/mozilla/SHA1.h b/external/spidermonkey/include/win32/mozilla/SHA1.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/mozilla/SHA1.h rename to external/spidermonkey/include/win32/mozilla/SHA1.h diff --git a/scripting/javascript/spidermonkey-win32/include/mozilla/Scoped.h b/external/spidermonkey/include/win32/mozilla/Scoped.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/mozilla/Scoped.h rename to external/spidermonkey/include/win32/mozilla/Scoped.h diff --git a/scripting/javascript/spidermonkey-win32/include/mozilla/SplayTree.h b/external/spidermonkey/include/win32/mozilla/SplayTree.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/mozilla/SplayTree.h rename to external/spidermonkey/include/win32/mozilla/SplayTree.h diff --git a/scripting/javascript/spidermonkey-win32/include/mozilla/StandardInteger.h b/external/spidermonkey/include/win32/mozilla/StandardInteger.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/mozilla/StandardInteger.h rename to external/spidermonkey/include/win32/mozilla/StandardInteger.h diff --git a/scripting/javascript/spidermonkey-win32/include/mozilla/ThreadLocal.h b/external/spidermonkey/include/win32/mozilla/ThreadLocal.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/mozilla/ThreadLocal.h rename to external/spidermonkey/include/win32/mozilla/ThreadLocal.h diff --git a/scripting/javascript/spidermonkey-win32/include/mozilla/TypeTraits.h b/external/spidermonkey/include/win32/mozilla/TypeTraits.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/mozilla/TypeTraits.h rename to external/spidermonkey/include/win32/mozilla/TypeTraits.h diff --git a/scripting/javascript/spidermonkey-win32/include/mozilla/TypedEnum.h b/external/spidermonkey/include/win32/mozilla/TypedEnum.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/mozilla/TypedEnum.h rename to external/spidermonkey/include/win32/mozilla/TypedEnum.h diff --git a/scripting/javascript/spidermonkey-win32/include/mozilla/Types.h b/external/spidermonkey/include/win32/mozilla/Types.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/mozilla/Types.h rename to external/spidermonkey/include/win32/mozilla/Types.h diff --git a/scripting/javascript/spidermonkey-win32/include/mozilla/Util.h b/external/spidermonkey/include/win32/mozilla/Util.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/mozilla/Util.h rename to external/spidermonkey/include/win32/mozilla/Util.h diff --git a/scripting/javascript/spidermonkey-win32/include/mozilla/WeakPtr.h b/external/spidermonkey/include/win32/mozilla/WeakPtr.h similarity index 100% rename from scripting/javascript/spidermonkey-win32/include/mozilla/WeakPtr.h rename to external/spidermonkey/include/win32/mozilla/WeakPtr.h diff --git a/scripting/javascript/spidermonkey-android/Android.mk b/external/spidermonkey/prebuilt/andorid/Android.mk similarity index 100% rename from scripting/javascript/spidermonkey-android/Android.mk rename to external/spidermonkey/prebuilt/andorid/Android.mk diff --git a/scripting/javascript/spidermonkey-android/lib/armeabi-v7a/libjs_static.a.REMOVED.git-id b/external/spidermonkey/prebuilt/andorid/armeabi-v7a/libjs_static.a.REMOVED.git-id similarity index 100% rename from scripting/javascript/spidermonkey-android/lib/armeabi-v7a/libjs_static.a.REMOVED.git-id rename to external/spidermonkey/prebuilt/andorid/armeabi-v7a/libjs_static.a.REMOVED.git-id diff --git a/scripting/javascript/spidermonkey-android/lib/armeabi/libjs_static.a.REMOVED.git-id b/external/spidermonkey/prebuilt/andorid/armeabi/libjs_static.a.REMOVED.git-id similarity index 100% rename from scripting/javascript/spidermonkey-android/lib/armeabi/libjs_static.a.REMOVED.git-id rename to external/spidermonkey/prebuilt/andorid/armeabi/libjs_static.a.REMOVED.git-id diff --git a/scripting/javascript/spidermonkey-android/lib/x86/libjs_static.a.REMOVED.git-id b/external/spidermonkey/prebuilt/andorid/x86/libjs_static.a.REMOVED.git-id similarity index 100% rename from scripting/javascript/spidermonkey-android/lib/x86/libjs_static.a.REMOVED.git-id rename to external/spidermonkey/prebuilt/andorid/x86/libjs_static.a.REMOVED.git-id diff --git a/scripting/javascript/spidermonkey-ios/lib/libjs_static.a.REMOVED.git-id b/external/spidermonkey/prebuilt/ios/libjs_static.a.REMOVED.git-id similarity index 100% rename from scripting/javascript/spidermonkey-ios/lib/libjs_static.a.REMOVED.git-id rename to external/spidermonkey/prebuilt/ios/libjs_static.a.REMOVED.git-id diff --git a/scripting/javascript/spidermonkey-mac/lib/libjs_static.a.REMOVED.git-id b/external/spidermonkey/prebuilt/mac/libjs_static.a.REMOVED.git-id similarity index 100% rename from scripting/javascript/spidermonkey-mac/lib/libjs_static.a.REMOVED.git-id rename to external/spidermonkey/prebuilt/mac/libjs_static.a.REMOVED.git-id diff --git a/scripting/javascript/spidermonkey-win32/lib/mozjs-23.0.dll.REMOVED.git-id b/external/spidermonkey/prebuilt/win32/mozjs-23.0.dll.REMOVED.git-id similarity index 100% rename from scripting/javascript/spidermonkey-win32/lib/mozjs-23.0.dll.REMOVED.git-id rename to external/spidermonkey/prebuilt/win32/mozjs-23.0.dll.REMOVED.git-id diff --git a/scripting/javascript/spidermonkey-win32/lib/mozjs-23.0.lib.REMOVED.git-id b/external/spidermonkey/prebuilt/win32/mozjs-23.0.lib.REMOVED.git-id similarity index 100% rename from scripting/javascript/spidermonkey-win32/lib/mozjs-23.0.lib.REMOVED.git-id rename to external/spidermonkey/prebuilt/win32/mozjs-23.0.lib.REMOVED.git-id diff --git a/cocos2dx/platform/third_party/android/prebuilt/libtiff/include/tiff.h b/external/tiff/include/andorid/tiff.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libtiff/include/tiff.h rename to external/tiff/include/andorid/tiff.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libtiff/include/tiffconf.h b/external/tiff/include/andorid/tiffconf.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libtiff/include/tiffconf.h rename to external/tiff/include/andorid/tiffconf.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libtiff/include/tiffio.h b/external/tiff/include/andorid/tiffio.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libtiff/include/tiffio.h rename to external/tiff/include/andorid/tiffio.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libtiff/include/tiffvers.h b/external/tiff/include/andorid/tiffvers.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libtiff/include/tiffvers.h rename to external/tiff/include/andorid/tiffvers.h diff --git a/cocos2dx/platform/third_party/emscripten/libtiff/include/tiff.h b/external/tiff/include/ios/tiff.h similarity index 100% rename from cocos2dx/platform/third_party/emscripten/libtiff/include/tiff.h rename to external/tiff/include/ios/tiff.h diff --git a/cocos2dx/platform/third_party/ios/libtiff/tiffconf.h b/external/tiff/include/ios/tiffconf.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libtiff/tiffconf.h rename to external/tiff/include/ios/tiffconf.h diff --git a/cocos2dx/platform/third_party/emscripten/libtiff/include/tiffio.h b/external/tiff/include/ios/tiffio.h similarity index 100% rename from cocos2dx/platform/third_party/emscripten/libtiff/include/tiffio.h rename to external/tiff/include/ios/tiffio.h diff --git a/cocos2dx/platform/third_party/emscripten/libtiff/include/tiffvers.h b/external/tiff/include/ios/tiffvers.h similarity index 100% rename from cocos2dx/platform/third_party/emscripten/libtiff/include/tiffvers.h rename to external/tiff/include/ios/tiffvers.h diff --git a/cocos2dx/platform/third_party/ios/libtiff/tiff.h b/external/tiff/include/linux/tiff.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libtiff/tiff.h rename to external/tiff/include/linux/tiff.h diff --git a/cocos2dx/platform/third_party/linux/libtiff/tiffconf.h b/external/tiff/include/linux/tiffconf.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libtiff/tiffconf.h rename to external/tiff/include/linux/tiffconf.h diff --git a/cocos2dx/platform/third_party/ios/libtiff/tiffio.h b/external/tiff/include/linux/tiffio.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libtiff/tiffio.h rename to external/tiff/include/linux/tiffio.h diff --git a/cocos2dx/platform/third_party/ios/libtiff/tiffvers.h b/external/tiff/include/linux/tiffvers.h similarity index 100% rename from cocos2dx/platform/third_party/ios/libtiff/tiffvers.h rename to external/tiff/include/linux/tiffvers.h diff --git a/cocos2dx/platform/third_party/linux/libtiff/tiff.h b/external/tiff/include/mac/tiff.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libtiff/tiff.h rename to external/tiff/include/mac/tiff.h diff --git a/cocos2dx/platform/third_party/mac/libtiff/tiffconf.h b/external/tiff/include/mac/tiffconf.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libtiff/tiffconf.h rename to external/tiff/include/mac/tiffconf.h diff --git a/cocos2dx/platform/third_party/linux/libtiff/tiffio.h b/external/tiff/include/mac/tiffio.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libtiff/tiffio.h rename to external/tiff/include/mac/tiffio.h diff --git a/cocos2dx/platform/third_party/linux/libtiff/tiffvers.h b/external/tiff/include/mac/tiffvers.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libtiff/tiffvers.h rename to external/tiff/include/mac/tiffvers.h diff --git a/cocos2dx/platform/third_party/mac/libtiff/tiff.h b/external/tiff/include/win32/tiff.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libtiff/tiff.h rename to external/tiff/include/win32/tiff.h diff --git a/cocos2dx/platform/third_party/win32/libtiff/tiffconf.h b/external/tiff/include/win32/tiffconf.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libtiff/tiffconf.h rename to external/tiff/include/win32/tiffconf.h diff --git a/cocos2dx/platform/third_party/mac/libtiff/tiffio.h b/external/tiff/include/win32/tiffio.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libtiff/tiffio.h rename to external/tiff/include/win32/tiffio.h diff --git a/cocos2dx/platform/third_party/mac/libtiff/tiffvers.h b/external/tiff/include/win32/tiffvers.h similarity index 100% rename from cocos2dx/platform/third_party/mac/libtiff/tiffvers.h rename to external/tiff/include/win32/tiffvers.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libtiff/Android.mk b/external/tiff/prebuilt/andorid/Android.mk similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libtiff/Android.mk rename to external/tiff/prebuilt/andorid/Android.mk diff --git a/cocos2dx/platform/third_party/android/prebuilt/libtiff/libs/armeabi-v7a/libtiff.a.REMOVED.git-id b/external/tiff/prebuilt/andorid/armeabi-v7a/libtiff.a.REMOVED.git-id similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libtiff/libs/armeabi-v7a/libtiff.a.REMOVED.git-id rename to external/tiff/prebuilt/andorid/armeabi-v7a/libtiff.a.REMOVED.git-id diff --git a/cocos2dx/platform/third_party/android/prebuilt/libtiff/libs/armeabi/libtiff.a.REMOVED.git-id b/external/tiff/prebuilt/andorid/armeabi/libtiff.a.REMOVED.git-id similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libtiff/libs/armeabi/libtiff.a.REMOVED.git-id rename to external/tiff/prebuilt/andorid/armeabi/libtiff.a.REMOVED.git-id diff --git a/cocos2dx/platform/third_party/android/prebuilt/libtiff/libs/x86/libtiff.a.REMOVED.git-id b/external/tiff/prebuilt/andorid/x86/libtiff.a.REMOVED.git-id similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libtiff/libs/x86/libtiff.a.REMOVED.git-id rename to external/tiff/prebuilt/andorid/x86/libtiff.a.REMOVED.git-id diff --git a/cocos2dx/platform/third_party/ios/libraries/libtiff.a.REMOVED.git-id b/external/tiff/prebuilt/ios/libtiff.a.REMOVED.git-id similarity index 100% rename from cocos2dx/platform/third_party/ios/libraries/libtiff.a.REMOVED.git-id rename to external/tiff/prebuilt/ios/libtiff.a.REMOVED.git-id diff --git a/cocos2dx/platform/third_party/linux/libraries/libtiff.a.REMOVED.git-id b/external/tiff/prebuilt/linux/32-bit/libtiff.a.REMOVED.git-id similarity index 100% rename from cocos2dx/platform/third_party/linux/libraries/libtiff.a.REMOVED.git-id rename to external/tiff/prebuilt/linux/32-bit/libtiff.a.REMOVED.git-id diff --git a/cocos2dx/platform/third_party/linux/libraries/lib64/libtiff.a.REMOVED.git-id b/external/tiff/prebuilt/linux/64-bit/libtiff.a.REMOVED.git-id similarity index 100% rename from cocos2dx/platform/third_party/linux/libraries/lib64/libtiff.a.REMOVED.git-id rename to external/tiff/prebuilt/linux/64-bit/libtiff.a.REMOVED.git-id diff --git a/cocos2dx/platform/third_party/mac/libraries/libtiff.a.REMOVED.git-id b/external/tiff/prebuilt/mac/libtiff.a.REMOVED.git-id similarity index 100% rename from cocos2dx/platform/third_party/mac/libraries/libtiff.a.REMOVED.git-id rename to external/tiff/prebuilt/mac/libtiff.a.REMOVED.git-id diff --git a/cocos2dx/platform/third_party/win32/libraries/libtiff.dll.REMOVED.git-id b/external/tiff/prebuilt/win32/libtiff.dll.REMOVED.git-id similarity index 100% rename from cocos2dx/platform/third_party/win32/libraries/libtiff.dll.REMOVED.git-id rename to external/tiff/prebuilt/win32/libtiff.dll.REMOVED.git-id diff --git a/cocos2dx/platform/third_party/win32/libraries/libtiff.lib.REMOVED.git-id b/external/tiff/prebuilt/win32/libtiff.lib.REMOVED.git-id similarity index 100% rename from cocos2dx/platform/third_party/win32/libraries/libtiff.lib.REMOVED.git-id rename to external/tiff/prebuilt/win32/libtiff.lib.REMOVED.git-id diff --git a/cocos2dx/platform/third_party/android/prebuilt/libwebp/include/decode.h b/external/webp/include/andorid/decode.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libwebp/include/decode.h rename to external/webp/include/andorid/decode.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libwebp/include/encode.h b/external/webp/include/andorid/encode.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libwebp/include/encode.h rename to external/webp/include/andorid/encode.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libwebp/include/types.h b/external/webp/include/andorid/types.h similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libwebp/include/types.h rename to external/webp/include/andorid/types.h diff --git a/cocos2dx/platform/third_party/ios/webp/decode.h b/external/webp/include/ios/decode.h similarity index 100% rename from cocos2dx/platform/third_party/ios/webp/decode.h rename to external/webp/include/ios/decode.h diff --git a/cocos2dx/platform/third_party/ios/webp/encode.h b/external/webp/include/ios/encode.h similarity index 100% rename from cocos2dx/platform/third_party/ios/webp/encode.h rename to external/webp/include/ios/encode.h diff --git a/cocos2dx/platform/third_party/emscripten/libwebp/webp/types.h b/external/webp/include/ios/types.h similarity index 100% rename from cocos2dx/platform/third_party/emscripten/libwebp/webp/types.h rename to external/webp/include/ios/types.h diff --git a/cocos2dx/platform/third_party/linux/libwebp/decode.h b/external/webp/include/linux/decode.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libwebp/decode.h rename to external/webp/include/linux/decode.h diff --git a/cocos2dx/platform/third_party/linux/libwebp/encode.h b/external/webp/include/linux/encode.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libwebp/encode.h rename to external/webp/include/linux/encode.h diff --git a/cocos2dx/platform/third_party/ios/webp/types.h b/external/webp/include/linux/types.h similarity index 100% rename from cocos2dx/platform/third_party/ios/webp/types.h rename to external/webp/include/linux/types.h diff --git a/cocos2dx/platform/third_party/mac/webp/decode.h b/external/webp/include/mac/decode.h similarity index 100% rename from cocos2dx/platform/third_party/mac/webp/decode.h rename to external/webp/include/mac/decode.h diff --git a/cocos2dx/platform/third_party/mac/webp/encode.h b/external/webp/include/mac/encode.h similarity index 100% rename from cocos2dx/platform/third_party/mac/webp/encode.h rename to external/webp/include/mac/encode.h diff --git a/cocos2dx/platform/third_party/linux/libwebp/types.h b/external/webp/include/mac/types.h similarity index 100% rename from cocos2dx/platform/third_party/linux/libwebp/types.h rename to external/webp/include/mac/types.h diff --git a/cocos2dx/platform/third_party/win32/libwebp/decode.h b/external/webp/include/win32/decode.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libwebp/decode.h rename to external/webp/include/win32/decode.h diff --git a/cocos2dx/platform/third_party/win32/libwebp/encode.h b/external/webp/include/win32/encode.h similarity index 100% rename from cocos2dx/platform/third_party/win32/libwebp/encode.h rename to external/webp/include/win32/encode.h diff --git a/cocos2dx/platform/third_party/mac/webp/types.h b/external/webp/include/win32/types.h similarity index 100% rename from cocos2dx/platform/third_party/mac/webp/types.h rename to external/webp/include/win32/types.h diff --git a/cocos2dx/platform/third_party/android/prebuilt/libwebp/Android.mk b/external/webp/prebuilt/andorid/Android.mk similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libwebp/Android.mk rename to external/webp/prebuilt/andorid/Android.mk diff --git a/cocos2dx/platform/third_party/android/prebuilt/libwebp/libs/armeabi-v7a/libwebp.a.REMOVED.git-id b/external/webp/prebuilt/andorid/armeabi-v7a/libwebp.a.REMOVED.git-id similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libwebp/libs/armeabi-v7a/libwebp.a.REMOVED.git-id rename to external/webp/prebuilt/andorid/armeabi-v7a/libwebp.a.REMOVED.git-id diff --git a/cocos2dx/platform/third_party/android/prebuilt/libwebp/libs/armeabi/libwebp.a.REMOVED.git-id b/external/webp/prebuilt/andorid/armeabi/libwebp.a.REMOVED.git-id similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libwebp/libs/armeabi/libwebp.a.REMOVED.git-id rename to external/webp/prebuilt/andorid/armeabi/libwebp.a.REMOVED.git-id diff --git a/cocos2dx/platform/third_party/android/prebuilt/libwebp/libs/x86/libwebp.a.REMOVED.git-id b/external/webp/prebuilt/andorid/x86/libwebp.a.REMOVED.git-id similarity index 100% rename from cocos2dx/platform/third_party/android/prebuilt/libwebp/libs/x86/libwebp.a.REMOVED.git-id rename to external/webp/prebuilt/andorid/x86/libwebp.a.REMOVED.git-id diff --git a/cocos2dx/platform/third_party/ios/libraries/libwebp.a.REMOVED.git-id b/external/webp/prebuilt/ios/libwebp.a.REMOVED.git-id similarity index 100% rename from cocos2dx/platform/third_party/ios/libraries/libwebp.a.REMOVED.git-id rename to external/webp/prebuilt/ios/libwebp.a.REMOVED.git-id diff --git a/cocos2dx/platform/third_party/linux/libraries/libwebp.a.REMOVED.git-id b/external/webp/prebuilt/linux/32-bit/libwebp.a.REMOVED.git-id similarity index 100% rename from cocos2dx/platform/third_party/linux/libraries/libwebp.a.REMOVED.git-id rename to external/webp/prebuilt/linux/32-bit/libwebp.a.REMOVED.git-id diff --git a/cocos2dx/platform/third_party/linux/libraries/lib64/libwebp.a.REMOVED.git-id b/external/webp/prebuilt/linux/64-bit/libwebp.a.REMOVED.git-id similarity index 100% rename from cocos2dx/platform/third_party/linux/libraries/lib64/libwebp.a.REMOVED.git-id rename to external/webp/prebuilt/linux/64-bit/libwebp.a.REMOVED.git-id diff --git a/cocos2dx/platform/third_party/mac/libraries/libwebp.a.REMOVED.git-id b/external/webp/prebuilt/mac/libwebp.a.REMOVED.git-id similarity index 100% rename from cocos2dx/platform/third_party/mac/libraries/libwebp.a.REMOVED.git-id rename to external/webp/prebuilt/mac/libwebp.a.REMOVED.git-id diff --git a/cocos2dx/platform/third_party/win32/libraries/libwebp.lib.REMOVED.git-id b/external/webp/prebuilt/win32/libwebp.lib.REMOVED.git-id similarity index 100% rename from cocos2dx/platform/third_party/win32/libraries/libwebp.lib.REMOVED.git-id rename to external/webp/prebuilt/win32/libwebp.lib.REMOVED.git-id diff --git a/external/libwebsockets/android/Android.mk b/external/websockets/android/Android.mk similarity index 100% rename from external/libwebsockets/android/Android.mk rename to external/websockets/android/Android.mk diff --git a/external/libwebsockets/android/include/libwebsockets.h b/external/websockets/android/include/libwebsockets.h similarity index 100% rename from external/libwebsockets/android/include/libwebsockets.h rename to external/websockets/android/include/libwebsockets.h diff --git a/external/libwebsockets/ios/include/libwebsockets.h b/external/websockets/ios/include/libwebsockets.h similarity index 100% rename from external/libwebsockets/ios/include/libwebsockets.h rename to external/websockets/ios/include/libwebsockets.h diff --git a/external/libwebsockets/ios/lib/libwebsockets.a.REMOVED.git-id b/external/websockets/ios/lib/libwebsockets.a.REMOVED.git-id similarity index 100% rename from external/libwebsockets/ios/lib/libwebsockets.a.REMOVED.git-id rename to external/websockets/ios/lib/libwebsockets.a.REMOVED.git-id diff --git a/external/libwebsockets/mac/include/libwebsockets.h b/external/websockets/mac/include/libwebsockets.h similarity index 100% rename from external/libwebsockets/mac/include/libwebsockets.h rename to external/websockets/mac/include/libwebsockets.h diff --git a/external/libwebsockets/mac/lib/libwebsockets.a.REMOVED.git-id b/external/websockets/mac/lib/libwebsockets.a.REMOVED.git-id similarity index 100% rename from external/libwebsockets/mac/lib/libwebsockets.a.REMOVED.git-id rename to external/websockets/mac/lib/libwebsockets.a.REMOVED.git-id diff --git a/external/libwebsockets/tizen/include/libwebsockets.h b/external/websockets/tizen/include/libwebsockets.h similarity index 100% rename from external/libwebsockets/tizen/include/libwebsockets.h rename to external/websockets/tizen/include/libwebsockets.h diff --git a/external/libwebsockets/tizen/lib/armv7l/libwebsockets.a.REMOVED.git-id b/external/websockets/tizen/lib/armv7l/libwebsockets.a.REMOVED.git-id similarity index 100% rename from external/libwebsockets/tizen/lib/armv7l/libwebsockets.a.REMOVED.git-id rename to external/websockets/tizen/lib/armv7l/libwebsockets.a.REMOVED.git-id diff --git a/external/libwebsockets/tizen/lib/x86/libwebsockets.a.REMOVED.git-id b/external/websockets/tizen/lib/x86/libwebsockets.a.REMOVED.git-id similarity index 100% rename from external/libwebsockets/tizen/lib/x86/libwebsockets.a.REMOVED.git-id rename to external/websockets/tizen/lib/x86/libwebsockets.a.REMOVED.git-id diff --git a/external/libwebsockets/win32/include/libwebsockets.h b/external/websockets/win32/include/libwebsockets.h similarity index 100% rename from external/libwebsockets/win32/include/libwebsockets.h rename to external/websockets/win32/include/libwebsockets.h diff --git a/external/libwebsockets/win32/include/win32helpers/gettimeofday.h b/external/websockets/win32/include/win32helpers/gettimeofday.h similarity index 100% rename from external/libwebsockets/win32/include/win32helpers/gettimeofday.h rename to external/websockets/win32/include/win32helpers/gettimeofday.h diff --git a/external/libwebsockets/win32/include/win32helpers/websock-w32.h b/external/websockets/win32/include/win32helpers/websock-w32.h similarity index 100% rename from external/libwebsockets/win32/include/win32helpers/websock-w32.h rename to external/websockets/win32/include/win32helpers/websock-w32.h diff --git a/cocos2dx/platform/third_party/win32/OGLES/GL/glew.h.REMOVED.git-id b/external/win32-specific/gles/include/OGLES/GL/glew.h.REMOVED.git-id similarity index 100% rename from cocos2dx/platform/third_party/win32/OGLES/GL/glew.h.REMOVED.git-id rename to external/win32-specific/gles/include/OGLES/GL/glew.h.REMOVED.git-id diff --git a/cocos2dx/platform/third_party/win32/OGLES/GL/glxew.h b/external/win32-specific/gles/include/OGLES/GL/glxew.h similarity index 100% rename from cocos2dx/platform/third_party/win32/OGLES/GL/glxew.h rename to external/win32-specific/gles/include/OGLES/GL/glxew.h diff --git a/cocos2dx/platform/third_party/win32/OGLES/GL/wglew.h b/external/win32-specific/gles/include/OGLES/GL/wglew.h similarity index 100% rename from cocos2dx/platform/third_party/win32/OGLES/GL/wglew.h rename to external/win32-specific/gles/include/OGLES/GL/wglew.h diff --git a/cocos2dx/platform/third_party/win32/libraries/glew32.dll.REMOVED.git-id b/external/win32-specific/gles/prebuilt/glew32.dll.REMOVED.git-id similarity index 100% rename from cocos2dx/platform/third_party/win32/libraries/glew32.dll.REMOVED.git-id rename to external/win32-specific/gles/prebuilt/glew32.dll.REMOVED.git-id diff --git a/cocos2dx/platform/third_party/win32/libraries/glew32.lib.REMOVED.git-id b/external/win32-specific/gles/prebuilt/glew32.lib.REMOVED.git-id similarity index 100% rename from cocos2dx/platform/third_party/win32/libraries/glew32.lib.REMOVED.git-id rename to external/win32-specific/gles/prebuilt/glew32.lib.REMOVED.git-id diff --git a/cocos2dx/platform/third_party/win32/iconv/iconv.h b/external/win32-specific/icon/include/iconv.h similarity index 100% rename from cocos2dx/platform/third_party/win32/iconv/iconv.h rename to external/win32-specific/icon/include/iconv.h diff --git a/cocos2dx/platform/third_party/win32/libraries/iconv.dll.REMOVED.git-id b/external/win32-specific/icon/prebuilt/iconv.dll.REMOVED.git-id similarity index 100% rename from cocos2dx/platform/third_party/win32/libraries/iconv.dll.REMOVED.git-id rename to external/win32-specific/icon/prebuilt/iconv.dll.REMOVED.git-id diff --git a/cocos2dx/platform/third_party/win32/zlib/zconf.h b/external/win32-specific/zlib/include/zconf.h similarity index 100% rename from cocos2dx/platform/third_party/win32/zlib/zconf.h rename to external/win32-specific/zlib/include/zconf.h diff --git a/cocos2dx/platform/third_party/win32/zlib/zlib.h b/external/win32-specific/zlib/include/zlib.h similarity index 100% rename from cocos2dx/platform/third_party/win32/zlib/zlib.h rename to external/win32-specific/zlib/include/zlib.h diff --git a/samples/Cpp/HelloCpp/proj.emscripten/Makefile b/samples/Cpp/HelloCpp/proj.emscripten/Makefile deleted file mode 100644 index c45123f260..0000000000 --- a/samples/Cpp/HelloCpp/proj.emscripten/Makefile +++ /dev/null @@ -1,58 +0,0 @@ -EXECUTABLE = HelloCpp - -INCLUDES = -I.. -I../Classes - -SOURCES = main.cpp \ - ../Classes/AppDelegate.cpp \ - ../Classes/HelloWorldScene.cpp - -RESOURCE_PATH = ../Resources - -RESOURCES = $(shell (cd $(RESOURCE_PATH); find . -type f ! -name '* *')) - -FONT_PATH = ../Resources/fonts - -COCOS_ROOT = ../../../.. -include $(COCOS_ROOT)/cocos2dx/proj.emscripten/cocos2dx.mk - -HTMLTPL_DIR = $(COCOS_ROOT)/tools/emscripten-templates/iphone-ipad-ipadhd -SHAREDLIBS += -lcocos2d -COCOS_LIBS= $(LIB_DIR)/libcocos2d.so - -$(TARGET).js: $(OBJECTS) $(STATICLIBS) $(COCOS_LIBS) $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(CXX) $(CXXFLAGS) $(OBJECTS) -o $@ $(SHAREDLIBS) $(STATICLIBS) - - -ifeq ($(shell uname -s),Darwin) -ARIAL_TTF := /Library/Fonts/Arial.ttf -else -ARIAL_TTF := $(COCOS_ROOT)/samples/Cpp/TestCpp/Resources/fonts/arial.ttf -endif - -$(TARGET).data: - @mkdir -p $(@D) - $(eval RESTMP := $(shell mktemp -d /tmp/cocos-emscripten.XXXXXX)) - # Always need a font path, so ensure that it is created first. - mkdir -p $(RESTMP)/fonts - (cd $(RESOURCE_PATH) && cp -Rf . $(RESTMP)) - (cd $(FONT_PATH) && cp -a * $(RESTMP)/fonts) - # NOTE: we copy the system arial.ttf so that there is always a fallback. - cp $(ARIAL_TTF) $(RESTMP)/fonts/arial.ttf - (cd $(RESTMP); python $(PACKAGER) $(EXECUTABLE).data $(patsubst %,--preload %,$(RESOURCES)) --preload fonts --pre-run > $(EXECUTABLE).data.js) - mv $(RESTMP)/$(EXECUTABLE).data $@ - mv $(RESTMP)/$(EXECUTABLE).data.js $@.js - rm -rf $(RESTMP) - -$(BIN_DIR)/$(HTMLTPL_FILE): $(HTMLTPL_DIR)/$(HTMLTPL_FILE) - @mkdir -p $(@D) - @cp -Rf $(HTMLTPL_DIR)/* $(BIN_DIR) - @sed -i -e "s/JS_APPLICATION/$(EXECUTABLE)/g" $(BIN_DIR)/$(HTMLTPL_FILE) - -$(OBJ_DIR)/%.o: %.cpp $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) $(VISIBILITY) -c $< -o $@ - -$(OBJ_DIR)/%.o: ../%.cpp $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) $(VISIBILITY) -c $< -o $@ diff --git a/samples/Cpp/HelloCpp/proj.emscripten/main.cpp b/samples/Cpp/HelloCpp/proj.emscripten/main.cpp deleted file mode 100644 index a260b6204a..0000000000 --- a/samples/Cpp/HelloCpp/proj.emscripten/main.cpp +++ /dev/null @@ -1,19 +0,0 @@ -#include "../Classes/AppDelegate.h" -#include "cocos2d.h" - -#include <stdlib.h> -#include <stdio.h> -#include <unistd.h> -#include <string> - -USING_NS_CC; - -int main(int argc, char **argv) -{ - // create the application instance - AppDelegate app; - - EGLView::getInstance(); - - return Application::getInstance()->run(); -} diff --git a/samples/Cpp/HelloCpp/proj.nacl/Makefile b/samples/Cpp/HelloCpp/proj.nacl/Makefile deleted file mode 100644 index 5c9ed5b189..0000000000 --- a/samples/Cpp/HelloCpp/proj.nacl/Makefile +++ /dev/null @@ -1,36 +0,0 @@ -COCOS_ROOT = ../../../.. -COCOS2DX_PATH = $(COCOS_ROOT)/cocos2dx -INCLUDES = -I../ -I../Classes - -SOURCES = main.cpp \ - ../Classes/AppDelegate.cpp \ - ../Classes/HelloWorldScene.cpp - -include $(COCOS_ROOT)/cocos2dx/proj.nacl/cocos2dx.mk - -APP_NAME = HelloCpp -TARGET = $(BIN_DIR)/$(APP_NAME)_$(NACL_ARCH).nexe -NMF = $(BIN_DIR)/$(APP_NAME).nmf - -all: $(NMF) - -$(TARGET): $(OBJECTS) $(LIB_DIR)/libcocos2d.a $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(LOG_LINK)$(NACL_CXX) $(CXXFLAGS) $(LDFLAGS) $(OBJECTS) -o $@ $(SHAREDLIBS) $(STATICLIBS) - -$(OBJ_DIR)/%.o: ../%.cpp $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(LOG_CXX)$(NACL_CXX) -MMD $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@ - -$(OBJ_DIR)/%.o: %.cpp $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(LOG_CXX)$(NACL_CXX) -MMD $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@ - -$(NMF): $(TARGET) - $(NACL_SDK_ROOT)/tools/create_nmf.py -o $@ $(BIN_DIR)/*.nexe -s $(BIN_DIR) $(NMF_FLAGS) - -run: all - /bin/cp -ar ../Resources/ . - $(NACL_SDK_ROOT)/tools/httpd.py --no_dir_check - -.PHONY: run diff --git a/samples/Cpp/HelloCpp/proj.nacl/index.html b/samples/Cpp/HelloCpp/proj.nacl/index.html deleted file mode 100644 index 70e642e59c..0000000000 --- a/samples/Cpp/HelloCpp/proj.nacl/index.html +++ /dev/null @@ -1,24 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html> - <!-- - Copyright (c) 2011 The Native Client Authors. All rights reserved. - Use of this source code is governed by a BSD-style license that can be - found in the LICENSE file. - --> - <head> - <title>cocos2dx CppHello - - -

cocos2dx CppHello

- - - -

-

- - diff --git a/samples/Cpp/HelloCpp/proj.nacl/main.cpp b/samples/Cpp/HelloCpp/proj.nacl/main.cpp deleted file mode 100644 index df53f32ee1..0000000000 --- a/samples/Cpp/HelloCpp/proj.nacl/main.cpp +++ /dev/null @@ -1,32 +0,0 @@ -#include "main.h" -#include "../Classes/AppDelegate.h" -#include "cocos2d.h" -#include "CCInstance.h" -#include "CCModule.h" - -#include -#include -#include -#include - -USING_NS_CC; - -AppDelegate g_app; - -void* cocos_main(void* arg) -{ - fprintf(stderr, "in cocos_main\n"); - int rtn = Application::getInstance()->run(); - fprintf(stderr, "app run returned: %d\n", rtn); - return NULL; -} - -namespace pp -{ - -Module* CreateModule() -{ - return new CocosPepperModule(); -} - -} diff --git a/samples/Cpp/HelloCpp/proj.nacl/main.h b/samples/Cpp/HelloCpp/proj.nacl/main.h deleted file mode 100644 index 7ad9d5c9e4..0000000000 --- a/samples/Cpp/HelloCpp/proj.nacl/main.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef __MAIN_H__ -#define __MAIN_H__ - -// C RunTime Header Files -#include "CCStdC.h" - -#endif // __MAIN_H__ diff --git a/samples/Cpp/HelloCpp/proj.qt5/HelloCpp.pro b/samples/Cpp/HelloCpp/proj.qt5/HelloCpp.pro deleted file mode 100644 index 3f194de311..0000000000 --- a/samples/Cpp/HelloCpp/proj.qt5/HelloCpp.pro +++ /dev/null @@ -1,14 +0,0 @@ - -include(../../../../cocos2dx/proj.qt5/common.pri) - -TARGET = HelloCpp - -INCLUDEPATH += .. -INCLUDEPATH += ../Classes - -SOURCES += main.cpp -SOURCES += ../Classes/AppDelegate.cpp -SOURCES += ../Classes/HelloWorldScene.cpp - -LIBS += $${LINK_AGAINST_COCOS2DX} - diff --git a/samples/Cpp/HelloCpp/proj.qt5/main.cpp b/samples/Cpp/HelloCpp/proj.qt5/main.cpp deleted file mode 100644 index 1c7e442bc4..0000000000 --- a/samples/Cpp/HelloCpp/proj.qt5/main.cpp +++ /dev/null @@ -1,21 +0,0 @@ - -#include "../Classes/AppDelegate.h" -#include "cocos2d.h" - -#include -#include -#include -#include - -USING_NS_CC; - -int main(int argc, char **argv) -{ - // create the application instance - AppDelegate app; - - auto eglView = CCEGLView::sharedOpenGLView(); - eglView->setFrameSize(800, 480); - - return CCApplication::sharedApplication()->run(); -} diff --git a/samples/Cpp/HelloCpp/proj.tizen/.cproject b/samples/Cpp/HelloCpp/proj.tizen/.cproject deleted file mode 100644 index f84f3f131f..0000000000 --- a/samples/Cpp/HelloCpp/proj.tizen/.cproject +++ /dev/null @@ -1,651 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/Cpp/HelloCpp/proj.tizen/.project b/samples/Cpp/HelloCpp/proj.tizen/.project deleted file mode 100644 index 52cd3d11ab..0000000000 --- a/samples/Cpp/HelloCpp/proj.tizen/.project +++ /dev/null @@ -1,106 +0,0 @@ - - - proj.tizen - - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - - - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.autoBuildTarget - all - - - org.eclipse.cdt.make.core.buildArguments - - - - org.eclipse.cdt.make.core.buildCommand - sbi-make - - - org.eclipse.cdt.make.core.buildLocation - ${workspace_loc:/${ProjName}/Debug-Tizen-Emulator} - - - org.eclipse.cdt.make.core.cleanBuildTarget - clean - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - true - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.fullBuildTarget - all - - - org.eclipse.cdt.make.core.stopOnError - true - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - true - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - org.tizen.nativecpp.apichecker.core.builder - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.core.ccnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - org.tizen.nativecpp.apichecker.core.tizenCppNature - - - - src/Classes - 2 - PARENT-1-PROJECT_LOC/Classes - - - - - 1372995128994 - - 26 - - org.eclipse.ui.ide.multiFilter - 1.0-projectRelativePath-matches-false-false-*/.tpk - - - - diff --git a/samples/Cpp/HelloCpp/proj.tizen/README.mdown b/samples/Cpp/HelloCpp/proj.tizen/README.mdown deleted file mode 100644 index f71f9abaad..0000000000 --- a/samples/Cpp/HelloCpp/proj.tizen/README.mdown +++ /dev/null @@ -1,6 +0,0 @@ -HelloCpp for Tizen -================== - - * Create Tizen IDE workspace in cocos2d-x/samples/Cpp/HelloCpp - * Import proj.tizen - * Copy cocos2d-x/samples/Cpp/HelloCpp/Resources/*.* to cocos2d-x/samples/Cpp/HelloCpp/proj.tizen/res diff --git a/samples/Cpp/HelloCpp/proj.tizen/data/.gitkeep b/samples/Cpp/HelloCpp/proj.tizen/data/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/samples/Cpp/HelloCpp/proj.tizen/inc/.gitkeep b/samples/Cpp/HelloCpp/proj.tizen/inc/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/samples/Cpp/HelloCpp/proj.tizen/lib/.gitkeep b/samples/Cpp/HelloCpp/proj.tizen/lib/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/samples/Cpp/HelloCpp/proj.tizen/manifest.xml b/samples/Cpp/HelloCpp/proj.tizen/manifest.xml deleted file mode 100644 index 68b1350aa3..0000000000 --- a/samples/Cpp/HelloCpp/proj.tizen/manifest.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - Ea48obap0R - 1.0.0 - C++App - - true - - - 2.2 - - - - - - HelloCpp - - - mainmenu.png - - - - - diff --git a/samples/Cpp/HelloCpp/proj.tizen/res/.gitkeep b/samples/Cpp/HelloCpp/proj.tizen/res/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/samples/Cpp/HelloCpp/proj.tizen/shared/data/.gitkeep b/samples/Cpp/HelloCpp/proj.tizen/shared/data/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/samples/Cpp/HelloCpp/proj.tizen/shared/trusted/.gitkeep b/samples/Cpp/HelloCpp/proj.tizen/shared/trusted/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/samples/Cpp/HelloCpp/proj.tizen/src/HelloCppEntry.cpp b/samples/Cpp/HelloCpp/proj.tizen/src/HelloCppEntry.cpp deleted file mode 100644 index 8b447bfc41..0000000000 --- a/samples/Cpp/HelloCpp/proj.tizen/src/HelloCppEntry.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** -Copyright (c) 2013 cocos2d-x.org -Copyright (c) 2013 Lee, Jae-Hong - -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. -****************************************************************************/ - -// -// This file contains the Tizen application entry point. -// -#include "../../Classes/AppDelegate.h" -#include "cocos2d.h" - -USING_NS_CC; - -using namespace Tizen::Base; -using namespace Tizen::Base::Collection; - -#ifdef __cplusplus -extern "C" -{ -#endif // __cplusplus - -void -ApplicationInitialized(void) -{ - AppDelegate* pAppDelegate = new AppDelegate; - - auto eglView = EGLView::getInstance(); - eglView->setFrameSize(1280, 720); - - Application::getInstance()->run(); -} - -// -// The entry function of Tizen application called by the operating system. -// -_EXPORT_ int -OspMain(int argc, char *pArgv[]) -{ - AppLog("Application started."); - ArrayList args(SingleObjectDeleter); - args.Construct(); - for (int i = 0; i < argc; i++) - { - args.Add(new (std::nothrow) Tizen::Base::String(pArgv[i])); - } - - OspApplication::SetApplicationInitializedCallback(ApplicationInitialized); - OspApplication::SetScreenOrientation(Tizen::Ui::ORIENTATION_LANDSCAPE); - result r = Tizen::App::Application::Execute(OspApplication::CreateInstance, &args); - TryLog(r == E_SUCCESS, "[%s] Application execution failed", GetErrorMessage(r)); - AppLog("Application finished."); - - return static_cast(r); -} -#ifdef __cplusplus -} -#endif // __cplusplus diff --git a/samples/Cpp/SimpleGame/proj.emscripten/Makefile b/samples/Cpp/SimpleGame/proj.emscripten/Makefile deleted file mode 100644 index cc538b4d65..0000000000 --- a/samples/Cpp/SimpleGame/proj.emscripten/Makefile +++ /dev/null @@ -1,71 +0,0 @@ -EXECUTABLE = SimpleGame - -INCLUDES = -I.. -I../Classes - -SOURCES = main.cpp \ - ../Classes/AppDelegate.cpp \ - ../Classes/HelloWorldScene.cpp \ - ../Classes/GameOverScene.cpp - -RESOURCE_PATH = ../Resources - -RESOURCES = app.config.txt \ - app.icf \ - background-music-aac.wav \ - development.icf \ - pew-pew-lei.wav - -SD_RESOURCE_PATH = ../Resources/sd - -SD_RESOURCES = app.icf \ - CloseNormal.png \ - CloseSelected.png \ - Player.png \ - Projectile.png \ - Target.png - -ALL_ASSETS := $(SD_RESOURCES) $(RESOURCES) - -COCOS_ROOT = ../../../.. -include $(COCOS_ROOT)/cocos2dx/proj.emscripten/cocos2dx.mk - -SHAREDLIBS += -lcocos2d -lcocosdenshion -COCOS_LIBS = $(LIB_DIR)/libcocos2d.so $(LIB_DIR)/libcocosdenshion.so -INCLUDES += -I$(COCOS_ROOT)/CocosDenshion/include - -$(TARGET).js: $(OBJECTS) $(STATICLIBS) $(COCOS_LIBS) $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(CXX) $(CXXFLAGS) $(OBJECTS) -o $@ $(SHAREDLIBS) $(STATICLIBS) - -ifeq ($(shell uname -s),Darwin) -ARIEL_TTF := /Library/Fonts/Arial.ttf -else -ARIEL_TTF := $(COCOS_ROOT)/samples/Cpp/TestCpp/Resources/fonts/arial.ttf -endif - -$(TARGET).data: - @mkdir -p $(@D) - $(eval RESTMP := $(shell mktemp -d /tmp/cocos-emscripten.XXXXXX)) - # Always need a font path, so ensure that it is created first. - mkdir -p $(RESTMP)/fonts - (cd $(RESOURCE_PATH) && tar cf - $(RESOURCES)) | (cd $(RESTMP) && tar xvf -) - (cd $(SD_RESOURCE_PATH) && tar cf - $(SD_RESOURCES)) | (cd $(RESTMP) && tar xvf -) - # NOTE: we copy the system arial.ttf so that there is always a fallback. - cp $(ARIEL_TTF) $(RESTMP)/fonts/arial.ttf - (cd $(RESTMP); python $(PACKAGER) $(EXECUTABLE).data $(patsubst %,--preload %,$(ALL_ASSETS)) --preload fonts --pre-run > $(EXECUTABLE).data.js) - mv $(RESTMP)/$(EXECUTABLE).data $@ - mv $(RESTMP)/$(EXECUTABLE).data.js $@.js - rm -rf $(RESTMP) - -$(BIN_DIR)/$(HTMLTPL_FILE): $(HTMLTPL_DIR)/$(HTMLTPL_FILE) - @mkdir -p $(@D) - @cp -Rf $(HTMLTPL_DIR)/* $(BIN_DIR) - @sed -i -e "s/JS_APPLICATION/$(EXECUTABLE)/g" $(BIN_DIR)/$(HTMLTPL_FILE) - -$(OBJ_DIR)/%.o: %.cpp $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) $(VISIBILITY) -c $< -o $@ - -$(OBJ_DIR)/%.o: ../%.cpp $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) $(VISIBILITY) -c $< -o $@ diff --git a/samples/Cpp/SimpleGame/proj.emscripten/main.cpp b/samples/Cpp/SimpleGame/proj.emscripten/main.cpp deleted file mode 100644 index a260b6204a..0000000000 --- a/samples/Cpp/SimpleGame/proj.emscripten/main.cpp +++ /dev/null @@ -1,19 +0,0 @@ -#include "../Classes/AppDelegate.h" -#include "cocos2d.h" - -#include -#include -#include -#include - -USING_NS_CC; - -int main(int argc, char **argv) -{ - // create the application instance - AppDelegate app; - - EGLView::getInstance(); - - return Application::getInstance()->run(); -} diff --git a/samples/Cpp/SimpleGame/proj.nacl/Makefile b/samples/Cpp/SimpleGame/proj.nacl/Makefile deleted file mode 100644 index 3e6cde4319..0000000000 --- a/samples/Cpp/SimpleGame/proj.nacl/Makefile +++ /dev/null @@ -1,42 +0,0 @@ -COCOS_ROOT = ../../../.. -COCOS2DX_PATH = $(COCOS_ROOT)/cocos2dx - -INCLUDES = -I.. \ - -I../Classes \ - -I$(COCOS_ROOT)/CocosDenshion/include \ - -SOURCES = main.cpp \ - ../Classes/AppDelegate.cpp \ - ../Classes/HelloWorldScene.cpp \ - ../Classes/GameOverScene.cpp - -include $(COCOS_ROOT)/cocos2dx/proj.nacl/cocos2dx.mk - -SHAREDLIBS += -lbox2d - -APP_NAME = SimpleGame -TARGET = $(BIN_DIR)/$(APP_NAME)_$(NACL_ARCH).nexe -NMF = $(BIN_DIR)/$(APP_NAME).nmf - -all: $(NMF) - -$(TARGET): $(OBJECTS) $(LIB_DIR)/libcocos2d.a - @mkdir -p $(@D) - $(LOG_LINK)$(NACL_CXX) $(CXXFLAGS) $(LDFLAGS) $(OBJECTS) -o $@ $(SHAREDLIBS) $(STATICLIBS) - -$(OBJ_DIR)/%.o: ../%.cpp - @mkdir -p $(@D) - $(LOG_CXX)$(NACL_CXX) -MMD $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@ - -$(OBJ_DIR)/%.o: %.cpp - @mkdir -p $(@D) - $(LOG_CXX)$(NACL_CXX) -MMD $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@ - -$(NMF): $(TARGET) - $(NACL_SDK_ROOT)/tools/create_nmf.py -o $@ $(BIN_DIR)/*.nexe $(NMF_FLAGS) -s $(BIN_DIR) - -run: all - /bin/cp -ar ../Resources/ . - $(NACL_SDK_ROOT)/tools/httpd.py --no_dir_check - -.PHONY: run diff --git a/samples/Cpp/SimpleGame/proj.nacl/index.html b/samples/Cpp/SimpleGame/proj.nacl/index.html deleted file mode 100644 index c91e458ed8..0000000000 --- a/samples/Cpp/SimpleGame/proj.nacl/index.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - - cocos2dx SimpleGame - - -

cocos2dx SimpleGame

- - - -

-

- - diff --git a/samples/Cpp/SimpleGame/proj.nacl/main.cpp b/samples/Cpp/SimpleGame/proj.nacl/main.cpp deleted file mode 100644 index d3899c47c7..0000000000 --- a/samples/Cpp/SimpleGame/proj.nacl/main.cpp +++ /dev/null @@ -1,36 +0,0 @@ -#include "main.h" -#include "../Classes/AppDelegate.h" -#include "cocos2d.h" -#include "CCInstance.h" -#include "CCModule.h" - -#include -#include -#include -#include -#include "AL/alc.h" - -USING_NS_CC; - -AppDelegate g_app; - -void* cocos_main(void* arg) -{ - fprintf(stderr, "in cocos_main\n"); - CocosPepperInstance* instance = (CocosPepperInstance*)arg; - alSetPpapiInfo(instance->pp_instance(), pp::Module::Get()->get_browser_interface()); - fprintf(stderr, "calling application->run\n"); - int rtn = Application::getInstance()->run(); - fprintf(stderr, "app run returned: %d\n", rtn); - return NULL; -} - -namespace pp -{ - -Module* CreateModule() -{ - return new CocosPepperModule(); -} - -} diff --git a/samples/Cpp/SimpleGame/proj.nacl/main.h b/samples/Cpp/SimpleGame/proj.nacl/main.h deleted file mode 100644 index 7ad9d5c9e4..0000000000 --- a/samples/Cpp/SimpleGame/proj.nacl/main.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef __MAIN_H__ -#define __MAIN_H__ - -// C RunTime Header Files -#include "CCStdC.h" - -#endif // __MAIN_H__ diff --git a/samples/Cpp/SimpleGame/proj.qt5/SimpleGame.pro b/samples/Cpp/SimpleGame/proj.qt5/SimpleGame.pro deleted file mode 100644 index 9626f7c123..0000000000 --- a/samples/Cpp/SimpleGame/proj.qt5/SimpleGame.pro +++ /dev/null @@ -1,16 +0,0 @@ - -include(../../../../cocos2dx/proj.qt5/common.pri) - -TARGET = SimpleGame - -INCLUDEPATH += .. -INCLUDEPATH += ../Classes - -SOURCES += main.cpp -SOURCES += ../Classes/AppDelegate.cpp -SOURCES += ../Classes/HelloWorldScene.cpp -SOURCES += ../Classes/GameOverScene.cpp - -LIBS += $${LINK_AGAINST_COCOS2DX} -LIBS += $${LINK_AGAINST_COCOSDENSHION} - diff --git a/samples/Cpp/SimpleGame/proj.qt5/main.cpp b/samples/Cpp/SimpleGame/proj.qt5/main.cpp deleted file mode 100644 index e7baa657b6..0000000000 --- a/samples/Cpp/SimpleGame/proj.qt5/main.cpp +++ /dev/null @@ -1,20 +0,0 @@ -#include "../Classes/AppDelegate.h" -#include "cocos2d.h" - -#include -#include -#include -#include - -USING_NS_CC; - -int main(int argc, char **argv) -{ - // create the application instance - AppDelegate app; - - auto eglView = CCEGLView::sharedOpenGLView(); - eglView->setFrameSize(800, 480); - - return CCApplication::sharedApplication()->run(); -} diff --git a/samples/Cpp/SimpleGame/proj.tizen/.cproject b/samples/Cpp/SimpleGame/proj.tizen/.cproject deleted file mode 100644 index c9dc8112ac..0000000000 --- a/samples/Cpp/SimpleGame/proj.tizen/.cproject +++ /dev/null @@ -1,673 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/Cpp/SimpleGame/proj.tizen/.project b/samples/Cpp/SimpleGame/proj.tizen/.project deleted file mode 100644 index 69d492adfb..0000000000 --- a/samples/Cpp/SimpleGame/proj.tizen/.project +++ /dev/null @@ -1,110 +0,0 @@ - - - proj.tizen - - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - - - ?children? - ?name?=outputEntries\|?children?=?name?=entry\\\\\\\|\\\|?name?=entry\\\\\\\|\\\|?name?=entry\\\\\\\|\\\|\|| - - - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.autoBuildTarget - all - - - org.eclipse.cdt.make.core.buildArguments - - - - org.eclipse.cdt.make.core.buildCommand - sbi-make - - - org.eclipse.cdt.make.core.buildLocation - ${workspace_loc:/${ProjName}/Debug-Tizen-Emulator} - - - org.eclipse.cdt.make.core.cleanBuildTarget - clean - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - true - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.fullBuildTarget - all - - - org.eclipse.cdt.make.core.stopOnError - true - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - true - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - org.tizen.nativecpp.apichecker.core.builder - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.core.ccnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - org.tizen.nativecpp.apichecker.core.tizenCppNature - - - - src/Classes - 2 - PARENT-1-PROJECT_LOC/Classes - - - - - 1373002322874 - - 26 - - org.eclipse.ui.ide.multiFilter - 1.0-projectRelativePath-matches-false-false-*/.tpk - - - - diff --git a/samples/Cpp/SimpleGame/proj.tizen/README.mdown b/samples/Cpp/SimpleGame/proj.tizen/README.mdown deleted file mode 100644 index f657b5f413..0000000000 --- a/samples/Cpp/SimpleGame/proj.tizen/README.mdown +++ /dev/null @@ -1,6 +0,0 @@ -SampleGame for Tizen -==================== - - * Create Tizen IDE workspace in cocos2d-x/samples/Cpp/SampleGame - * Import proj.tizen - * Copy cocos2d-x/samples/Cpp/SampleGame/Resources/*.* to cocos2d-x/samples/Cpp/SampleGame/proj.tizen/res diff --git a/samples/Cpp/SimpleGame/proj.tizen/data/.gitkeep b/samples/Cpp/SimpleGame/proj.tizen/data/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/samples/Cpp/SimpleGame/proj.tizen/lib/.gitkeep b/samples/Cpp/SimpleGame/proj.tizen/lib/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/samples/Cpp/SimpleGame/proj.tizen/manifest.xml b/samples/Cpp/SimpleGame/proj.tizen/manifest.xml deleted file mode 100644 index 0874e51b79..0000000000 --- a/samples/Cpp/SimpleGame/proj.tizen/manifest.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - S0Dmp4UN6i - 1.0.0 - C++App - - true - - - 2.2 - - - - - - SimpleGame - - - mainmenu.png - - - - - diff --git a/samples/Cpp/SimpleGame/proj.tizen/res/.gitkeep b/samples/Cpp/SimpleGame/proj.tizen/res/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/samples/Cpp/SimpleGame/proj.tizen/shared/data/.gitkeep b/samples/Cpp/SimpleGame/proj.tizen/shared/data/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/samples/Cpp/SimpleGame/proj.tizen/shared/trusted/.gitkeep b/samples/Cpp/SimpleGame/proj.tizen/shared/trusted/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/samples/Cpp/SimpleGame/proj.tizen/src/SimpleGameEntry.cpp b/samples/Cpp/SimpleGame/proj.tizen/src/SimpleGameEntry.cpp deleted file mode 100644 index 0c18462c6f..0000000000 --- a/samples/Cpp/SimpleGame/proj.tizen/src/SimpleGameEntry.cpp +++ /dev/null @@ -1,76 +0,0 @@ -/**************************************************************************** -Copyright (c) 2013 cocos2d-x.org -Copyright (c) 2013 Lee, Jae-Hong - -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. -****************************************************************************/ - -// -// This file contains the Tizen application entry point. -// -#include "../../Classes/AppDelegate.h" -#include "cocos2d.h" - -USING_NS_CC; - -using namespace Tizen::Base; -using namespace Tizen::Base::Collection; - -#ifdef __cplusplus -extern "C" -{ -#endif // __cplusplus - -void -ApplicationInitialized(void) -{ - AppDelegate* pAppDelegate = new AppDelegate; - - auto eglView = EGLView::getInstance(); - eglView->setFrameSize(720, 1280); - - Application::getInstance()->run(); -} - -// -// The entry function of Tizen application called by the operating system. -// -_EXPORT_ int -OspMain(int argc, char *pArgv[]) -{ - AppLog("Application started."); - ArrayList args(SingleObjectDeleter); - args.Construct(); - for (int i = 0; i < argc; i++) - { - args.Add(new (std::nothrow) Tizen::Base::String(pArgv[i])); - } - - OspApplication::SetApplicationInitializedCallback(ApplicationInitialized); - result r = Tizen::App::Application::Execute(OspApplication::CreateInstance, &args); - TryLog(r == E_SUCCESS, "[%s] Application execution failed", GetErrorMessage(r)); - AppLog("Application finished."); - - return static_cast(r); -} -#ifdef __cplusplus -} -#endif // __cplusplus diff --git a/samples/Cpp/TestCpp/proj.emscripten/Makefile b/samples/Cpp/TestCpp/proj.emscripten/Makefile deleted file mode 100644 index 67b18155c0..0000000000 --- a/samples/Cpp/TestCpp/proj.emscripten/Makefile +++ /dev/null @@ -1,166 +0,0 @@ -EXECUTABLE = TestCpp - -SOURCES = ../Classes/AccelerometerTest/AccelerometerTest.cpp \ - ../Classes/ActionManagerTest/ActionManagerTest.cpp \ - ../Classes/ActionsEaseTest/ActionsEaseTest.cpp \ - ../Classes/ActionsProgressTest/ActionsProgressTest.cpp \ - ../Classes/ActionsTest/ActionsTest.cpp \ - ../Classes/Box2DTest/Box2dTest.cpp \ - ../Classes/Box2DTestBed/Box2dView.cpp \ - ../Classes/Box2DTestBed/GLES-Render.cpp \ - ../Classes/Box2DTestBed/Test.cpp \ - ../Classes/Box2DTestBed/TestEntries.cpp \ - ../Classes/BugsTest/Bug-1159.cpp \ - ../Classes/BugsTest/Bug-1174.cpp \ - ../Classes/BugsTest/Bug-350.cpp \ - ../Classes/BugsTest/Bug-422.cpp \ - ../Classes/BugsTest/Bug-458/Bug-458.cpp \ - ../Classes/BugsTest/Bug-458/QuestionContainerSprite.cpp \ - ../Classes/BugsTest/Bug-624.cpp \ - ../Classes/BugsTest/Bug-886.cpp \ - ../Classes/BugsTest/Bug-899.cpp \ - ../Classes/BugsTest/Bug-914.cpp \ - ../Classes/BugsTest/BugsTest.cpp \ - ../Classes/ChipmunkTest/ChipmunkTest.cpp \ - ../Classes/ClickAndMoveTest/ClickAndMoveTest.cpp \ - ../Classes/ClippingNodeTest/ClippingNodeTest.cpp \ - ../Classes/CocosDenshionTest/CocosDenshionTest.cpp \ - ../Classes/CurrentLanguageTest/CurrentLanguageTest.cpp \ - ../Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp \ - ../Classes/EffectsAdvancedTest/EffectsAdvancedTest.cpp \ - ../Classes/EffectsTest/EffectsTest.cpp \ - ../Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.cpp \ - ../Classes/ExtensionsTest/CocosBuilderTest/CocosBuilderTest.cpp \ - ../Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.cpp \ - ../Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.cpp \ - ../Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.cpp \ - ../Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.cpp \ - ../Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.cpp \ - ../Classes/ExtensionsTest/ControlExtensionTest/CCControlButtonTest/CCControlButtonTest.cpp \ - ../Classes/ExtensionsTest/ControlExtensionTest/CCControlColourPicker/CCControlColourPickerTest.cpp \ - ../Classes/ExtensionsTest/ControlExtensionTest/CCControlScene.cpp \ - ../Classes/ExtensionsTest/ControlExtensionTest/CCControlSceneManager.cpp \ - ../Classes/ExtensionsTest/ControlExtensionTest/CCControlSliderTest/CCControlSliderTest.cpp \ - ../Classes/ExtensionsTest/ControlExtensionTest/CCControlSwitchTest/CCControlSwitchTest.cpp \ - ../Classes/ExtensionsTest/ControlExtensionTest/CCControlPotentiometerTest/CCControlPotentiometerTest.cpp \ - ../Classes/ExtensionsTest/ControlExtensionTest/CCControlStepperTest/CCControlStepperTest.cpp \ - ../Classes/ExtensionsTest/TableViewTest/TableViewTestScene.cpp \ - ../Classes/ExtensionsTest/TableViewTest/CustomTableViewCell.cpp \ - ../Classes/ExtensionsTest/ExtensionsTest.cpp \ - ../Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.cpp \ - ../Classes/ExtensionsTest/NetworkTest/HttpClientTest.cpp \ - ../Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp \ - ../Classes/ExtensionsTest/CocoStudioComponentsTest/ComponentsTestScene.cpp \ - ../Classes/ExtensionsTest/CocoStudioComponentsTest/EnemyController.cpp \ - ../Classes/ExtensionsTest/CocoStudioComponentsTest/GameOverScene.cpp \ - ../Classes/ExtensionsTest/CocoStudioComponentsTest/PlayerController.cpp \ - ../Classes/ExtensionsTest/CocoStudioComponentsTest/ProjectileController.cpp \ - ../Classes/ExtensionsTest/CocoStudioComponentsTest/SceneController.cpp \ - ../Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp \ - ../Classes/ExtensionsTest/CocoStudioGUITest/CocosGUIScene.cpp \ - ../Classes/ExtensionsTest/Scale9SpriteTest/Scale9SpriteTest.cpp \ - ../Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp \ - ../Classes/FontTest/FontTest.cpp \ - ../Classes/IntervalTest/IntervalTest.cpp \ - ../Classes/KeypadTest/KeypadTest.cpp \ - ../Classes/LabelTest/LabelTest.cpp \ - ../Classes/LayerTest/LayerTest.cpp \ - ../Classes/MenuTest/MenuTest.cpp \ - ../Classes/MotionStreakTest/MotionStreakTest.cpp \ - ../Classes/MutiTouchTest/MutiTouchTest.cpp \ - ../Classes/NodeTest/NodeTest.cpp \ - ../Classes/ParallaxTest/ParallaxTest.cpp \ - ../Classes/ParticleTest/ParticleTest.cpp \ - ../Classes/PerformanceTest/PerformanceNodeChildrenTest.cpp \ - ../Classes/PerformanceTest/PerformanceParticleTest.cpp \ - ../Classes/PerformanceTest/PerformanceSpriteTest.cpp \ - ../Classes/PerformanceTest/PerformanceTest.cpp \ - ../Classes/PerformanceTest/PerformanceTextureTest.cpp \ - ../Classes/PerformanceTest/PerformanceTouchesTest.cpp \ - ../Classes/PhysicsTest/PhysicsTest.cpp \ - ../Classes/RenderTextureTest/RenderTextureTest.cpp \ - ../Classes/RotateWorldTest/RotateWorldTest.cpp \ - ../Classes/SceneTest/SceneTest.cpp \ - ../Classes/SchedulerTest/SchedulerTest.cpp \ - ../Classes/ShaderTest/ShaderTest.cpp \ - ../Classes/SpriteTest/SpriteTest.cpp \ - ../Classes/TextInputTest/TextInputTest.cpp \ - ../Classes/Texture2dTest/Texture2dTest.cpp \ - ../Classes/TextureCacheTest/TextureCacheTest.cpp \ - ../Classes/TileMapTest/TileMapTest.cpp \ - ../Classes/TouchesTest/Ball.cpp \ - ../Classes/TouchesTest/Paddle.cpp \ - ../Classes/TouchesTest/TouchesTest.cpp \ - ../Classes/TransitionsTest/TransitionsTest.cpp \ - ../Classes/UserDefaultTest/UserDefaultTest.cpp \ - ../Classes/ZwoptexTest/ZwoptexTest.cpp \ - ../Classes/FileUtilsTest/FileUtilsTest.cpp \ - ../Classes/DataVisitorTest/DataVisitorTest.cpp \ - ../Classes/ConfigurationTest/ConfigurationTest.cpp \ - ../Classes/controller.cpp \ - ../Classes/testBasic.cpp \ - ../Classes/AppDelegate.cpp \ - ../Classes/BaseTest.cpp \ - ../Classes/VisibleRect.cpp \ - main.cpp - -RESOURCE_PATH = ../Resources - -RESOURCES := $(shell (cd $(RESOURCE_PATH); find . -type f ! -name '* *')) - -SHAREDLIBS = -lcocos2d -lcocosdenshion -COCOS_LIBS = $(LIB_DIR)/libcocos2d.so $(LIB_DIR)/libcocosdenshion.so - -include ../../../../cocos2dx/proj.emscripten/cocos2dx.mk - -INCLUDES += -I../ \ - -I../../ \ - -I../Classes \ - -I$(COCOS_ROOT)/CocosDenshion/include \ - -I$(COCOS_ROOT)/extensions/ \ - -I$(COCOS_ROOT)/external/ \ - -I$(COCOS_ROOT)/external/chipmunk/include/chipmunk - -STATICLIBS += \ - $(LIB_DIR)/libextension.a \ - $(LIB_DIR)/libbox2d.a \ - $(LIB_DIR)/libchipmunk.a - -DEFINES += -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 - -####### Build rules -$(TARGET).js: $(OBJECTS) $(STATICLIBS) $(COCOS_LIBS) $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(CXX) $(CXXFLAGS) $(OBJECTS) -o $@ $(SHAREDLIBS) $(STATICLIBS) $(LIBS) - -$(TARGET).data: $(CORE_MAKEFILE_LIST) $(patsubst %,$(RESOURCE_PATH)/%,$(RESOURCES)) - @mkdir -p $(@D) - $(eval RESTMP := $(shell mktemp -d /tmp/cocos-emscripten.XXXXXX)) - # Always need a font path, so ensure that it is created first. - mkdir -p $(RESTMP)/fonts - (cd $(RESOURCE_PATH) && tar cf - $(RESOURCES)) | (cd $(RESTMP) && tar xvf -) - (cd $(RESTMP); python $(PACKAGER) $(EXECUTABLE).data $(patsubst %,--preload %,$(RESOURCES)) --preload fonts --pre-run > $(EXECUTABLE).data.js) - mv $(RESTMP)/$(EXECUTABLE).data $@ - mv $(RESTMP)/$(EXECUTABLE).data.js $@.js - # Copy the assets as individual files to the output directory in addition - # to building the .data file so that async texture loading works. - cp -av $(RESOURCE_PATH)/* $(shell dirname $@) - rm -rf $(RESTMP) - -$(BIN_DIR)/$(HTMLTPL_FILE): $(HTMLTPL_DIR)/$(HTMLTPL_FILE) $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - @cp -Rf $(HTMLTPL_DIR)/* $(BIN_DIR) - @sed -i -e "s/JS_APPLICATION/$(EXECUTABLE)/g" $(BIN_DIR)/$(HTMLTPL_FILE) - -####### Compile -$(OBJ_DIR)/%.o: ../%.cpp $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@ - -$(OBJ_DIR)/%.o: %.cpp $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@ - -$(OBJ_DIR)/%.o: %.c $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(CC) $(CCFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@ diff --git a/samples/Cpp/TestCpp/proj.emscripten/main.cpp b/samples/Cpp/TestCpp/proj.emscripten/main.cpp deleted file mode 100644 index eb17c636bf..0000000000 --- a/samples/Cpp/TestCpp/proj.emscripten/main.cpp +++ /dev/null @@ -1,18 +0,0 @@ -#include "../Classes/AppDelegate.h" -#include "cocos2d.h" -#include "CCEGLView.h" - -#include -#include -#include -#include - -USING_NS_CC; - -int main(int argc, char **argv) -{ - // create the application instance - AppDelegate app; - EGLView::getInstance(); - return Application::getInstance()->run(); -} diff --git a/samples/Cpp/TestCpp/proj.nacl/Makefile b/samples/Cpp/TestCpp/proj.nacl/Makefile deleted file mode 100644 index 4cf49f9e5e..0000000000 --- a/samples/Cpp/TestCpp/proj.nacl/Makefile +++ /dev/null @@ -1,170 +0,0 @@ -COCOS_ROOT = ../../../.. -COCOS2DX_PATH = $(COCOS_ROOT)/cocos2dx - -INCLUDES = -I.. -I../Classes \ - -I$(COCOS_ROOT)/CocosDenshion/include \ - -I$(COCOS_ROOT)/extensions \ - -I$(COCOS_ROOT)/external \ - -I$(COCOS_ROOT)/external/chipmunk/include/chipmunk \ - -SOURCES = ../Classes/AccelerometerTest/AccelerometerTest.cpp \ - ../Classes/ActionManagerTest/ActionManagerTest.cpp \ - ../Classes/ActionsEaseTest/ActionsEaseTest.cpp \ - ../Classes/ActionsProgressTest/ActionsProgressTest.cpp \ - ../Classes/ActionsTest/ActionsTest.cpp \ - ../Classes/Box2DTest/Box2dTest.cpp \ - ../Classes/Box2DTestBed/Box2dView.cpp \ - ../Classes/Box2DTestBed/GLES-Render.cpp \ - ../Classes/Box2DTestBed/Test.cpp \ - ../Classes/Box2DTestBed/TestEntries.cpp \ - ../Classes/BugsTest/Bug-1159.cpp \ - ../Classes/BugsTest/Bug-1174.cpp \ - ../Classes/BugsTest/Bug-350.cpp \ - ../Classes/BugsTest/Bug-422.cpp \ - ../Classes/BugsTest/Bug-458/Bug-458.cpp \ - ../Classes/BugsTest/Bug-458/QuestionContainerSprite.cpp \ - ../Classes/BugsTest/Bug-624.cpp \ - ../Classes/BugsTest/Bug-886.cpp \ - ../Classes/BugsTest/Bug-899.cpp \ - ../Classes/BugsTest/Bug-914.cpp \ - ../Classes/BugsTest/BugsTest.cpp \ - ../Classes/ChipmunkTest/ChipmunkTest.cpp \ - ../Classes/ClickAndMoveTest/ClickAndMoveTest.cpp \ - ../Classes/ClippingNodeTest/ClippingNodeTest.cpp \ - ../Classes/CocosDenshionTest/CocosDenshionTest.cpp \ - ../Classes/CurrentLanguageTest/CurrentLanguageTest.cpp \ - ../Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp \ - ../Classes/EffectsAdvancedTest/EffectsAdvancedTest.cpp \ - ../Classes/EffectsTest/EffectsTest.cpp \ - ../Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.cpp \ - ../Classes/ExtensionsTest/CocosBuilderTest/CocosBuilderTest.cpp \ - ../Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.cpp \ - ../Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.cpp \ - ../Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.cpp \ - ../Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.cpp \ - ../Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.cpp \ - ../Classes/ExtensionsTest/ControlExtensionTest/CCControlButtonTest/CCControlButtonTest.cpp \ - ../Classes/ExtensionsTest/ControlExtensionTest/CCControlColourPicker/CCControlColourPickerTest.cpp \ - ../Classes/ExtensionsTest/ControlExtensionTest/CCControlScene.cpp \ - ../Classes/ExtensionsTest/ControlExtensionTest/CCControlSceneManager.cpp \ - ../Classes/ExtensionsTest/ControlExtensionTest/CCControlSliderTest/CCControlSliderTest.cpp \ - ../Classes/ExtensionsTest/ControlExtensionTest/CCControlSwitchTest/CCControlSwitchTest.cpp \ - ../Classes/ExtensionsTest/ControlExtensionTest/CCControlPotentiometerTest/CCControlPotentiometerTest.cpp \ - ../Classes/ExtensionsTest/ControlExtensionTest/CCControlStepperTest/CCControlStepperTest.cpp \ - ../Classes/ExtensionsTest/TableViewTest/TableViewTestScene.cpp \ - ../Classes/ExtensionsTest/TableViewTest/CustomTableViewCell.cpp \ - ../Classes/ExtensionsTest/ExtensionsTest.cpp \ - ../Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.cpp \ - ../Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp \ - ../Classes/ExtensionsTest/CocoStudioComponentsTest/ComponentsTestScene.cpp \ - ../Classes/ExtensionsTest/CocoStudioComponentsTest/EnemyController.cpp \ - ../Classes/ExtensionsTest/CocoStudioComponentsTest/GameOverScene.cpp \ - ../Classes/ExtensionsTest/CocoStudioComponentsTest/PlayerController.cpp \ - ../Classes/ExtensionsTest/CocoStudioComponentsTest/ProjectileController.cpp \ - ../Classes/ExtensionsTest/CocoStudioComponentsTest/SceneController.cpp \ - ../Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp \ - ../Classes/ExtensionsTest/Scale9SpriteTest/Scale9SpriteTest.cpp \ - ../Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp \ - ../Classes/FileUtilsTest/FileUtilsTest.cpp \ - ../Classes/FontTest/FontTest.cpp \ - ../Classes/IntervalTest/IntervalTest.cpp \ - ../Classes/KeypadTest/KeypadTest.cpp \ - ../Classes/LabelTest/LabelTest.cpp \ - ../Classes/LabelTest/LabelTestNew.cpp \ - ../Classes/LayerTest/LayerTest.cpp \ - ../Classes/MenuTest/MenuTest.cpp \ - ../Classes/MotionStreakTest/MotionStreakTest.cpp \ - ../Classes/MutiTouchTest/MutiTouchTest.cpp \ - ../Classes/NodeTest/NodeTest.cpp \ - ../Classes/ParallaxTest/ParallaxTest.cpp \ - ../Classes/ParticleTest/ParticleTest.cpp \ - ../Classes/PerformanceTest/PerformanceNodeChildrenTest.cpp \ - ../Classes/PerformanceTest/PerformanceParticleTest.cpp \ - ../Classes/PerformanceTest/PerformanceSpriteTest.cpp \ - ../Classes/PerformanceTest/PerformanceTest.cpp \ - ../Classes/PerformanceTest/PerformanceTextureTest.cpp \ - ../Classes/PerformanceTest/PerformanceTouchesTest.cpp \ - ../Classes/RenderTextureTest/RenderTextureTest.cpp \ - ../Classes/RotateWorldTest/RotateWorldTest.cpp \ - ../Classes/SceneTest/SceneTest.cpp \ - ../Classes/SchedulerTest/SchedulerTest.cpp \ - ../Classes/ShaderTest/ShaderTest.cpp \ - ../Classes/SpriteTest/SpriteTest.cpp \ - ../Classes/TextInputTest/TextInputTest.cpp \ - ../Classes/Texture2dTest/Texture2dTest.cpp \ - ../Classes/TextureCacheTest/TextureCacheTest.cpp \ - ../Classes/TexturePackerEncryptionTest/TextureAtlasEncryptionTest.cpp \ - ../Classes/TileMapTest/TileMapTest.cpp \ - ../Classes/TouchesTest/Ball.cpp \ - ../Classes/TouchesTest/Paddle.cpp \ - ../Classes/TouchesTest/TouchesTest.cpp \ - ../Classes/TransitionsTest/TransitionsTest.cpp \ - ../Classes/UserDefaultTest/UserDefaultTest.cpp \ - ../Classes/ZwoptexTest/ZwoptexTest.cpp \ - ../Classes/SpineTest/SpineTest.cpp \ - ../Classes/DataVisitorTest/DataVisitorTest.cpp \ - ../Classes/ConfigurationTest/ConfigurationTest.cpp \ - ../Classes/controller.cpp \ - ../Classes/testBasic.cpp \ - ../Classes/AppDelegate.cpp \ - ../Classes/BaseTest.cpp \ - ../Classes/VisibleRect.cpp \ - main.cpp - -include $(COCOS2DX_PATH)/../extensions/proj.nacl/Makefile -SOURCES += $(addprefix $(COCOS_ROOT)/extensions/, $(EXTENSIONS_SOURCES)) - -include $(COCOS_ROOT)/cocos2dx/proj.nacl/cocos2dx.mk - -CXXFLAGS += -Wno-multichar - -SHAREDLIBS += -lchipmunk -lbox2d - -APP_NAME = TestCpp -TARGET = $(BIN_DIR)/$(APP_NAME)_$(NACL_ARCH).nexe -NMF = $(BIN_DIR)/$(APP_NAME).nmf - -all: $(NMF) - -$(TARGET): $(OBJECTS) $(LIB_DIR)/libcocos2d.a $(LIB_DIR)/libcocosdenshion.a $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(LOG_LINK)$(NACL_CXX) $(CXXFLAGS) $(LDFLAGS) $(OBJECTS) -o $@ $(SHAREDLIBS) $(STATICLIBS) - -$(OBJ_DIR)/%.o: ../%.cpp $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(LOG_CXX)$(NACL_CXX) -MMD $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@ - -$(OBJ_DIR)/%.o: ../../../../%.cpp $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(LOG_CXX)$(NACL_CXX) -MMD $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@ - -$(OBJ_DIR)/%.o: %.cpp $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(LOG_CXX)$(NACL_CXX) -MMD $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@ - -$(OBJ_DIR)/%.o: ../%.c $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(LOG_CC)$(NACL_CC) -MMD $(CCFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@ - -$(NMF): $(TARGET) - $(NACL_SDK_ROOT)/tools/create_nmf.py -o $@ $(BIN_DIR)/*.nexe $(NMF_FLAGS) -s $(BIN_DIR) - -PACKAGE_ROOT = $(OUT_DIR)/package - -package: all - rm -rf $(PACKAGE_ROOT) - mkdir -p $(PACKAGE_ROOT) - /bin/cp -ar ../Resources/ $(PACKAGE_ROOT) - /bin/cp -ar $(BIN_DIR)/* $(PACKAGE_ROOT) - /bin/cp res/*.js res/icon*.png res/manifest.json $(PACKAGE_ROOT) - /bin/cp res/package_index.html $(PACKAGE_ROOT)/index.html - -zipfile: package - rm -f $(OUT_DIR)/$(APP_NAME).zip - cd $(PACKAGE_ROOT) && zip -r ../$(APP_NAME).zip . - -run: all - /bin/cp -ar ../Resources/ . - $(NACL_SDK_ROOT)/tools/httpd.py --no_dir_check - -.PHONY: run zipfile package diff --git a/samples/Cpp/TestCpp/proj.nacl/index.html b/samples/Cpp/TestCpp/proj.nacl/index.html deleted file mode 100644 index b89a122705..0000000000 --- a/samples/Cpp/TestCpp/proj.nacl/index.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - - cocos2dx TestCpp - - -

cocos2dx TestCpp

-
- -
- - diff --git a/samples/Cpp/TestCpp/proj.nacl/main.cpp b/samples/Cpp/TestCpp/proj.nacl/main.cpp deleted file mode 100644 index 8053de5798..0000000000 --- a/samples/Cpp/TestCpp/proj.nacl/main.cpp +++ /dev/null @@ -1,36 +0,0 @@ -#include "main.h" -#include "../Classes/AppDelegate.h" -#include "cocos2d.h" -#include "CCInstance.h" -#include "CCModule.h" - -#include -#include -#include -#include -#include - -USING_NS_CC; - -AppDelegate g_app; - -void* cocos_main(void* arg) -{ - CocosPepperInstance* instance = (CocosPepperInstance*)arg; - fprintf(stderr, "in cocos_main: %p\n", instance); - alSetPpapiInfo(instance->pp_instance(), pp::Module::Get()->get_browser_interface()); - fprintf(stderr, "calling application->run\n"); - int rtn = Application::getInstance()->run(); - fprintf(stderr, "app run returned: %d\n", rtn); - return NULL; -} - -namespace pp -{ - -Module* CreateModule() -{ - return new CocosPepperModule(); -} - -} diff --git a/samples/Cpp/TestCpp/proj.nacl/main.h b/samples/Cpp/TestCpp/proj.nacl/main.h deleted file mode 100644 index 7ad9d5c9e4..0000000000 --- a/samples/Cpp/TestCpp/proj.nacl/main.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef __MAIN_H__ -#define __MAIN_H__ - -// C RunTime Header Files -#include "CCStdC.h" - -#endif // __MAIN_H__ diff --git a/samples/Cpp/TestCpp/proj.nacl/res/listener.js b/samples/Cpp/TestCpp/proj.nacl/res/listener.js deleted file mode 100644 index 1374633201..0000000000 --- a/samples/Cpp/TestCpp/proj.nacl/res/listener.js +++ /dev/null @@ -1,11 +0,0 @@ -function crashed() { - // nacl modules send "crashed" when they call exit() and this sample - // calls exit() when the exit icon is pressed. - window.close() -} - -function addListeners() { - document.getElementById('nacl_module').addEventListener('crash', crashed, true); -} - -document.addEventListener('DOMContentLoaded', addListeners); diff --git a/samples/Cpp/TestCpp/proj.nacl/res/main.js b/samples/Cpp/TestCpp/proj.nacl/res/main.js deleted file mode 100644 index ffdafd1c1e..0000000000 --- a/samples/Cpp/TestCpp/proj.nacl/res/main.js +++ /dev/null @@ -1,16 +0,0 @@ -chrome.app.runtime.onLaunched.addListener(function() { - var screenWidth = screen.availWidth; - var screenHeight = screen.availHeight; - var width = 800; - var height = 640; - - chrome.app.window.create('index.html', { - width: width, - height: height, - minWidth: width, - minHeight: height, - type: 'panel', - left: (screenWidth-width)/2, - top: (screenHeight-height)/2 - }); -}); diff --git a/samples/Cpp/TestCpp/proj.nacl/res/package_index.html b/samples/Cpp/TestCpp/proj.nacl/res/package_index.html deleted file mode 100644 index bfd9548851..0000000000 --- a/samples/Cpp/TestCpp/proj.nacl/res/package_index.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - - cocos2dx Test App - - - - -
- -
- - diff --git a/samples/Cpp/TestCpp/proj.qt5/TestCpp.pro b/samples/Cpp/TestCpp/proj.qt5/TestCpp.pro deleted file mode 100644 index 1678596819..0000000000 --- a/samples/Cpp/TestCpp/proj.qt5/TestCpp.pro +++ /dev/null @@ -1,128 +0,0 @@ - -include(../../../../cocos2dx/proj.qt5/common.pri) - -TARGET = cocos2dx_TestCpp - -INCLUDEPATH += .. -INCLUDEPATH += ../Classes - -SOURCES += main.cpp -SOURCES += ../Classes/AccelerometerTest/AccelerometerTest.cpp \ - ../Classes/ActionManagerTest/ActionManagerTest.cpp \ - ../Classes/ActionsEaseTest/ActionsEaseTest.cpp \ - ../Classes/ActionsProgressTest/ActionsProgressTest.cpp \ - ../Classes/ActionsTest/ActionsTest.cpp \ - ../Classes/Box2DTest/Box2dTest.cpp \ - ../Classes/Box2DTestBed/Box2dView.cpp \ - ../Classes/Box2DTestBed/GLES-Render.cpp \ - ../Classes/Box2DTestBed/Test.cpp \ - ../Classes/Box2DTestBed/TestEntries.cpp \ - ../Classes/BugsTest/Bug-1159.cpp \ - ../Classes/BugsTest/Bug-1174.cpp \ - ../Classes/BugsTest/Bug-350.cpp \ - ../Classes/BugsTest/Bug-422.cpp \ - ../Classes/BugsTest/Bug-458/Bug-458.cpp \ - ../Classes/BugsTest/Bug-458/QuestionContainerSprite.cpp \ - ../Classes/BugsTest/Bug-624.cpp \ - ../Classes/BugsTest/Bug-886.cpp \ - ../Classes/BugsTest/Bug-899.cpp \ - ../Classes/BugsTest/Bug-914.cpp \ - ../Classes/BugsTest/BugsTest.cpp \ - ../Classes/ChipmunkTest/ChipmunkTest.cpp \ - ../Classes/ClickAndMoveTest/ClickAndMoveTest.cpp \ - ../Classes/ClippingNodeTest/ClippingNodeTest.cpp \ - ../Classes/CocosDenshionTest/CocosDenshionTest.cpp \ - ../Classes/CurlTest/CurlTest.cpp \ - ../Classes/CurrentLanguageTest/CurrentLanguageTest.cpp \ - ../Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp \ - ../Classes/EffectsAdvancedTest/EffectsAdvancedTest.cpp \ - ../Classes/EffectsTest/EffectsTest.cpp \ - ../Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.cpp \ - ../Classes/ExtensionsTest/CocosBuilderTest/CocosBuilderTest.cpp \ - ../Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.cpp \ - ../Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.cpp \ - ../Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.cpp \ - ../Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.cpp \ - ../Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.cpp \ - ../Classes/ExtensionsTest/ControlExtensionTest/CCControlButtonTest/CCControlButtonTest.cpp \ - ../Classes/ExtensionsTest/ControlExtensionTest/CCControlColourPicker/CCControlColourPickerTest.cpp \ - ../Classes/ExtensionsTest/ControlExtensionTest/CCControlScene.cpp \ - ../Classes/ExtensionsTest/ControlExtensionTest/CCControlSceneManager.cpp \ - ../Classes/ExtensionsTest/ControlExtensionTest/CCControlSliderTest/CCControlSliderTest.cpp \ - ../Classes/ExtensionsTest/ControlExtensionTest/CCControlSwitchTest/CCControlSwitchTest.cpp \ - ../Classes/ExtensionsTest/ControlExtensionTest/CCControlPotentiometerTest/CCControlPotentiometerTest.cpp \ - ../Classes/ExtensionsTest/ControlExtensionTest/CCControlStepperTest/CCControlStepperTest.cpp \ - ../Classes/ExtensionsTest/TableViewTest/TableViewTestScene.cpp \ - ../Classes/ExtensionsTest/TableViewTest/CustomTableViewCell.cpp \ - ../Classes/ExtensionsTest/ExtensionsTest.cpp \ - ../Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.cpp \ - ../Classes/ExtensionsTest/NetworkTest/HttpClientTest.cpp \ - ../Classes/ExtensionsTest/ComponentsTest/ComponentsTestScene.cpp \ - ../Classes/ExtensionsTest/ComponentsTest/EnemyController.cpp \ - ../Classes/ExtensionsTest/ComponentsTest/GameOverScene.cpp \ - ../Classes/ExtensionsTest/ComponentsTest/PlayerController.cpp \ - ../Classes/ExtensionsTest/ComponentsTest/ProjectileController.cpp \ - ../Classes/ExtensionsTest/ComponentsTest/SceneController.cpp \ - ../Classes/ExtensionsTest/ArmatureTest/ArmatureScene.cpp \ - ../Classes/ExtensionsTest/Scale9SpriteTest/Scale9SpriteTest.cpp \ - ../Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp \ - ../Classes/FontTest/FontTest.cpp \ - ../Classes/IntervalTest/IntervalTest.cpp \ - ../Classes/KeyboardTest/KeyboardTest.cpp \ - ../Classes/KeypadTest/KeypadTest.cpp \ - ../Classes/LabelTest/LabelTest.cpp \ - ../Classes/LayerTest/LayerTest.cpp \ - ../Classes/MenuTest/MenuTest.cpp \ - ../Classes/MotionStreakTest/MotionStreakTest.cpp \ - ../Classes/MutiTouchTest/MutiTouchTest.cpp \ - ../Classes/NodeTest/NodeTest.cpp \ - ../Classes/ParallaxTest/ParallaxTest.cpp \ - ../Classes/ParticleTest/ParticleTest.cpp \ - ../Classes/PerformanceTest/PerformanceNodeChildrenTest.cpp \ - ../Classes/PerformanceTest/PerformanceParticleTest.cpp \ - ../Classes/PerformanceTest/PerformanceSpriteTest.cpp \ - ../Classes/PerformanceTest/PerformanceTest.cpp \ - ../Classes/PerformanceTest/PerformanceTextureTest.cpp \ - ../Classes/PerformanceTest/PerformanceTouchesTest.cpp \ - ../Classes/RenderTextureTest/RenderTextureTest.cpp \ - ../Classes/RotateWorldTest/RotateWorldTest.cpp \ - ../Classes/SceneTest/SceneTest.cpp \ - ../Classes/SchedulerTest/SchedulerTest.cpp \ - ../Classes/ShaderTest/ShaderTest.cpp \ - ../Classes/SpriteTest/SpriteTest.cpp \ - ../Classes/TextInputTest/TextInputTest.cpp \ - ../Classes/Texture2dTest/Texture2dTest.cpp \ - ../Classes/TexturePackerEncryptionTest/TextureAtlasEncryptionTest.cpp \ - ../Classes/TextureCacheTest/TextureCacheTest.cpp \ - ../Classes/TileMapTest/TileMapTest.cpp \ - ../Classes/TouchesTest/Ball.cpp \ - ../Classes/TouchesTest/Paddle.cpp \ - ../Classes/TouchesTest/TouchesTest.cpp \ - ../Classes/TransitionsTest/TransitionsTest.cpp \ - ../Classes/UserDefaultTest/UserDefaultTest.cpp \ - ../Classes/ZwoptexTest/ZwoptexTest.cpp \ - ../Classes/FileUtilsTest/FileUtilsTest.cpp \ - ../Classes/SpineTest/SpineTest.cpp \ - ../Classes/DataVisitorTest/DataVisitorTest.cpp \ - ../Classes/ConfigurationTest/ConfigurationTest.cpp \ - ../Classes/controller.cpp \ - ../Classes/testBasic.cpp \ - ../Classes/AppDelegate.cpp \ - ../Classes/BaseTest.cpp \ - ../Classes/VisibleRect.cpp - -LIBS += $${LINK_AGAINST_COCOS2DX} -LIBS += $${LINK_AGAINST_COCOSDENSHION} -LIBS += $${LINK_AGAINST_COCOSEXTENSION} - -INSTALLS += target -target.path = /opt/$${TARGET} - -INSTALLS += desktop -desktop.files = $${TARGET}.desktop -desktop.path = $${DESKTOP_INSTALL_DIR} - -INSTALLS += resources -resources.files = icon.png ../Resources -resources.path = /opt/$${TARGET} - diff --git a/samples/Cpp/TestCpp/proj.qt5/cocos2dx_TestCpp.desktop b/samples/Cpp/TestCpp/proj.qt5/cocos2dx_TestCpp.desktop deleted file mode 100644 index 8447988c7f..0000000000 --- a/samples/Cpp/TestCpp/proj.qt5/cocos2dx_TestCpp.desktop +++ /dev/null @@ -1,5 +0,0 @@ -[Desktop Entry] -Type=Application -Name=Cocos2D-X -Icon=/opt/cocos2dx_TestCpp/icon.png -Exec=/opt/cocos2dx_TestCpp/cocos2dx_TestCpp diff --git a/samples/Cpp/TestCpp/proj.qt5/main.cpp b/samples/Cpp/TestCpp/proj.qt5/main.cpp deleted file mode 100644 index 87fe8873df..0000000000 --- a/samples/Cpp/TestCpp/proj.qt5/main.cpp +++ /dev/null @@ -1,19 +0,0 @@ -#include "../Classes/AppDelegate.h" -#include "cocos2d.h" -#include "CCEGLView.h" - -#include -#include -#include -#include - -USING_NS_CC; - -int main(int argc, char **argv) -{ - // create the application instance - AppDelegate app; - auto eglView = CCEGLView::sharedOpenGLView(); - eglView->setFrameSize(800, 480); - return CCApplication::sharedApplication()->run(); -} diff --git a/samples/Cpp/TestCpp/proj.tizen/.cproject b/samples/Cpp/TestCpp/proj.tizen/.cproject deleted file mode 100644 index 9cb31d8072..0000000000 --- a/samples/Cpp/TestCpp/proj.tizen/.cproject +++ /dev/null @@ -1,701 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/Cpp/TestCpp/proj.tizen/.project b/samples/Cpp/TestCpp/proj.tizen/.project deleted file mode 100644 index ad264e16ca..0000000000 --- a/samples/Cpp/TestCpp/proj.tizen/.project +++ /dev/null @@ -1,106 +0,0 @@ - - - proj.tizen - - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - - - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.autoBuildTarget - all - - - org.eclipse.cdt.make.core.buildArguments - - - - org.eclipse.cdt.make.core.buildCommand - sbi-make - - - org.eclipse.cdt.make.core.buildLocation - ${workspace_loc:/${ProjName}/Debug-Tizen-Emulator} - - - org.eclipse.cdt.make.core.cleanBuildTarget - clean - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - true - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.fullBuildTarget - all - - - org.eclipse.cdt.make.core.stopOnError - true - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - true - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - org.tizen.nativecpp.apichecker.core.builder - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.core.ccnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - org.tizen.nativecpp.apichecker.core.tizenCppNature - - - - src/Classes - 2 - PARENT-1-PROJECT_LOC/Classes - - - - - 1372993495655 - - 26 - - org.eclipse.ui.ide.multiFilter - 1.0-projectRelativePath-matches-false-false-*/.tpk - - - - diff --git a/samples/Cpp/TestCpp/proj.tizen/README.mdown b/samples/Cpp/TestCpp/proj.tizen/README.mdown deleted file mode 100644 index 68e93e99e0..0000000000 --- a/samples/Cpp/TestCpp/proj.tizen/README.mdown +++ /dev/null @@ -1,6 +0,0 @@ -TestCpp for Tizen -================== - - * Create Tizen IDE workspace in cocos2d-x/samples/Cpp/TestCpp - * Import proj.tizen - * Copy cocos2d-x/samples/Cpp/TestCpp/Resources/*.* to cocos2d-x/samples/Cpp/TestCpp/proj.tizen/res diff --git a/samples/Cpp/TestCpp/proj.tizen/data/.gitkeep b/samples/Cpp/TestCpp/proj.tizen/data/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/samples/Cpp/TestCpp/proj.tizen/inc/.gitkeep b/samples/Cpp/TestCpp/proj.tizen/inc/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/samples/Cpp/TestCpp/proj.tizen/lib/.gitkeep b/samples/Cpp/TestCpp/proj.tizen/lib/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/samples/Cpp/TestCpp/proj.tizen/manifest.xml b/samples/Cpp/TestCpp/proj.tizen/manifest.xml deleted file mode 100644 index 32976beeb6..0000000000 --- a/samples/Cpp/TestCpp/proj.tizen/manifest.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - WMrZqguX0B - 1.0.0 - C++App - - true - - - 2.2 - - - - - - TestCpp - - - mainmenu.png - - - - - diff --git a/samples/Cpp/TestCpp/proj.tizen/res/.gitignore b/samples/Cpp/TestCpp/proj.tizen/res/.gitignore deleted file mode 100644 index 1d65afe366..0000000000 --- a/samples/Cpp/TestCpp/proj.tizen/res/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -#Do now ignore Marmalade icf files -!*.icf diff --git a/samples/Cpp/TestCpp/proj.tizen/res/.gitkeep b/samples/Cpp/TestCpp/proj.tizen/res/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/samples/Cpp/TestCpp/proj.tizen/shared/data/.gitkeep b/samples/Cpp/TestCpp/proj.tizen/shared/data/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/samples/Cpp/TestCpp/proj.tizen/shared/trusted/.gitkeep b/samples/Cpp/TestCpp/proj.tizen/shared/trusted/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/samples/Cpp/TestCpp/proj.tizen/src/TestCppEntry.cpp b/samples/Cpp/TestCpp/proj.tizen/src/TestCppEntry.cpp deleted file mode 100644 index 3ec1b2ae63..0000000000 --- a/samples/Cpp/TestCpp/proj.tizen/src/TestCppEntry.cpp +++ /dev/null @@ -1,76 +0,0 @@ -/**************************************************************************** -Copyright (c) 2013 cocos2d-x.org -Copyright (c) 2013 Lee, Jae-Hong - -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. -****************************************************************************/ - -// -// This file contains the Tizen application entry point. -// -#include "../../Classes/AppDelegate.h" -#include "cocos2d.h" - -USING_NS_CC; -using namespace Tizen::Base; -using namespace Tizen::Base::Collection; - -#ifdef __cplusplus -extern "C" -{ -#endif // __cplusplus - -void -ApplicationInitialized(void) -{ - AppDelegate* pAppDelegate = new AppDelegate; - - auto eglView = EGLView::getInstance(); - eglView->setFrameSize(1280, 720); - - Application::getInstance()->run(); -} - -// -// The entry function of Tizen application called by the operating system. -// -_EXPORT_ int -OspMain(int argc, char *pArgv[]) -{ - AppLog("Application started."); - ArrayList args(SingleObjectDeleter); - args.Construct(); - for (int i = 0; i < argc; i++) - { - args.Add(new (std::nothrow) Tizen::Base::String(pArgv[i])); - } - - OspApplication::SetApplicationInitializedCallback(ApplicationInitialized); - OspApplication::SetScreenOrientation(Tizen::Ui::ORIENTATION_LANDSCAPE); - result r = Tizen::App::Application::Execute(OspApplication::CreateInstance, &args); - TryLog(r == E_SUCCESS, "[%s] Application execution failed", GetErrorMessage(r)); - AppLog("Application finished."); - - return static_cast(r); -} -#ifdef __cplusplus -} -#endif // __cplusplus diff --git a/samples/Lua/HelloLua/proj.emscripten/Makefile b/samples/Lua/HelloLua/proj.emscripten/Makefile deleted file mode 100644 index 3cb02a4db5..0000000000 --- a/samples/Lua/HelloLua/proj.emscripten/Makefile +++ /dev/null @@ -1,28 +0,0 @@ -EXECUTABLE = HelloLua - -COCOS_ROOT = ../../../.. -INCLUDES = -I../ -I../Classes -I$(COCOS_ROOT)/CocosDenshion/include \ - -I$(COCOS_ROOT)/scripting/lua/lua \ - -I$(COCOS_ROOT)/scripting/lua/tolua \ - -I$(COCOS_ROOT)/scripting/lua/cocos2dx_support \ - -I$(COCOS_ROOT)/extensions \ - -SOURCES = main.cpp ../Classes/AppDelegate.cpp - -SHAREDLIBS += -lcocos2d -lcocosdenshion -llua -COCOS_LIBS = $(LIB_DIR)/libcocos2d.so $(LIB_DIR)/libcocosdenshion.so $(LIB_DIR)/liblua.so - -include $(COCOS_ROOT)/cocos2dx/proj.emscripten/cocos2dx.mk - -$(TARGET): $(OBJECTS) $(STATICLIBS) $(COCOS_LIBS) $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - cp -r ../../../../scripting/lua/script/ ../../../../samples/Lua/HelloLua/Resources - $(CXX) $(CXXFLAGS) $(OBJECTS) -o $@ $(SHAREDLIBS) $(STATICLIBS) $(LIBS) - -$(OBJ_DIR)/%.o: ../%.cpp $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) $(VISIBILITY) -c $< -o $@ - -$(OBJ_DIR)/%.o: %.cpp $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) $(VISIBILITY) -c $< -o $@ diff --git a/samples/Lua/HelloLua/proj.emscripten/main.cpp b/samples/Lua/HelloLua/proj.emscripten/main.cpp deleted file mode 100644 index 92b65bdca4..0000000000 --- a/samples/Lua/HelloLua/proj.emscripten/main.cpp +++ /dev/null @@ -1,18 +0,0 @@ -#include "../Classes/AppDelegate.h" -#include "cocos2d.h" - -#include -#include -#include -#include - -USING_NS_CC; - -int main(int argc, char **argv) -{ - // create the application instance - AppDelegate app; - auto eglView = EGLView::getInstance(); - eglView->setFrameSize(960, 640); - return Application::getInstance()->run(); -} diff --git a/samples/Lua/HelloLua/proj.nacl/Makefile b/samples/Lua/HelloLua/proj.nacl/Makefile deleted file mode 100644 index 64ee13248e..0000000000 --- a/samples/Lua/HelloLua/proj.nacl/Makefile +++ /dev/null @@ -1,67 +0,0 @@ -COCOS_ROOT = ../../../.. -COCOS2DX_PATH = $(COCOS_ROOT)/cocos2dx - -INCLUDES = -I.. \ - -I../Classes \ - -I$(COCOS_ROOT)/CocosDenshion/include \ - -I$(COCOS_ROOT)/scripting/lua/lua \ - -I$(COCOS_ROOT)/scripting/lua/tolua \ - -I$(COCOS_ROOT)/scripting/lua/cocos2dx_support \ - -I$(NACL_SDK_ROOT)/include \ - -I$(COCOS_ROOT)/external \ - -I$(COCOS_ROOT)/external/chipmunk/include/chipmunk \ - -I$(COCOS_ROOT)/extensions \ - -I$(COCOS_ROOT)/extensions/Components - -SOURCES = main.cpp \ - ../Classes/AppDelegate.cpp \ - $(COCOS_ROOT)/scripting/lua/cocos2dx_support/CCLuaEngine.cpp \ - $(COCOS_ROOT)/scripting/lua/cocos2dx_support/CCLuaStack.cpp \ - $(COCOS_ROOT)/scripting/lua/cocos2dx_support/CCLuaValue.cpp \ - $(COCOS_ROOT)/scripting/lua/cocos2dx_support/Cocos2dxLuaLoader.cpp \ - $(COCOS_ROOT)/scripting/lua/cocos2dx_support/LuaCocos2d.cpp \ - $(COCOS_ROOT)/scripting/lua/cocos2dx_support/tolua_fix.c \ - $(COCOS_ROOT)/scripting/lua/cocos2dx_support/CCBProxy.cpp \ - $(COCOS_ROOT)/scripting/lua/cocos2dx_support/Lua_extensions_CCB.cpp - -include $(COCOS2DX_PATH)/../extensions/proj.nacl/Makefile -SOURCES += $(addprefix $(COCOS_ROOT)/extensions/, $(EXTENSIONS_SOURCES)) - -include $(COCOS_ROOT)/cocos2dx/proj.nacl/cocos2dx.mk - -CXXFLAGS += -Wno-multichar -STATICLIBS += -llua -lnosys -SHAREDLIBS += -lbox2d - -APP_NAME = HelloLua -TARGET = $(BIN_DIR)/$(APP_NAME)_$(NACL_ARCH).nexe -NMF = $(BIN_DIR)/$(APP_NAME).nmf - -all: $(NMF) - -$(TARGET): $(OBJECTS) $(LIB_DIR)/libcocos2d.a - @mkdir -p $(@D) - $(LOG_LINK)$(NACL_CXX) $(CXXFLAGS) $(LDFLAGS) $(OBJECTS) -o $@ $(SHAREDLIBS) $(STATICLIBS) - -$(OBJ_DIR)/%.o: ../%.cpp - @mkdir -p $(@D) - $(LOG_CXX)$(NACL_CXX) -MMD $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@ - -$(OBJ_DIR)/%.o: %.cpp - @mkdir -p $(@D) - $(LOG_CXX)$(NACL_CXX) -MMD $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@ - -$(OBJ_DIR)/%.o: $(COCOS_ROOT)/%.cpp - @mkdir -p $(@D) - $(LOG_CXX)$(NACL_CXX) -MMD $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@ - -$(OBJ_DIR)/%.o: $(COCOS_ROOT)/%.c - @mkdir -p $(@D) - $(LOG_CC)$(NACL_CC) -MMD $(CCFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@ - -$(NMF): $(TARGET) - $(NACL_SDK_ROOT)/tools/create_nmf.py -o $@ $(BIN_DIR)/*.nexe $(NMF_FLAGS) -s $(BIN_DIR) - -run: all - /bin/cp -ar ../Resources/ . - $(NACL_SDK_ROOT)/tools/httpd.py --no_dir_check diff --git a/samples/Lua/HelloLua/proj.nacl/index.html b/samples/Lua/HelloLua/proj.nacl/index.html deleted file mode 100644 index cd401f1626..0000000000 --- a/samples/Lua/HelloLua/proj.nacl/index.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - - cocos2dx HelloLua - - -

cocos2dx HelloLua

- - - -

-

- - diff --git a/samples/Lua/HelloLua/proj.nacl/main.cpp b/samples/Lua/HelloLua/proj.nacl/main.cpp deleted file mode 100644 index e4bce8fc75..0000000000 --- a/samples/Lua/HelloLua/proj.nacl/main.cpp +++ /dev/null @@ -1,39 +0,0 @@ -#include "main.h" -#include "../Classes/AppDelegate.h" -#include "cocos2d.h" -#include "CCInstance.h" -#include "CCModule.h" - -#include -#include -#include -#include -#include - -#include "fcntl.h" -#include "sys/stat.h" - -USING_NS_CC; - -AppDelegate g_app; - -void* cocos_main(void* arg) -{ - fprintf(stderr, "in cocos_main\n"); - CocosPepperInstance* instance = (CocosPepperInstance*)arg; - alSetPpapiInfo(instance->pp_instance(), pp::Module::Get()->get_browser_interface()); - fprintf(stderr, "calling application->run\n"); - int rtn = Application::getInstance()->run(); - fprintf(stderr, "app run returned: %d\n", rtn); - return NULL; -} - -namespace pp -{ - -Module* CreateModule() -{ - return new CocosPepperModule(); -} - -} diff --git a/samples/Lua/HelloLua/proj.nacl/main.h b/samples/Lua/HelloLua/proj.nacl/main.h deleted file mode 100644 index 7ad9d5c9e4..0000000000 --- a/samples/Lua/HelloLua/proj.nacl/main.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef __MAIN_H__ -#define __MAIN_H__ - -// C RunTime Header Files -#include "CCStdC.h" - -#endif // __MAIN_H__ diff --git a/samples/Lua/HelloLua/proj.tizen/.cproject b/samples/Lua/HelloLua/proj.tizen/.cproject deleted file mode 100644 index 082b16066d..0000000000 --- a/samples/Lua/HelloLua/proj.tizen/.cproject +++ /dev/null @@ -1,760 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/Lua/HelloLua/proj.tizen/.project b/samples/Lua/HelloLua/proj.tizen/.project deleted file mode 100644 index 06b6c44cf6..0000000000 --- a/samples/Lua/HelloLua/proj.tizen/.project +++ /dev/null @@ -1,110 +0,0 @@ - - - proj.tizen - - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - - - ?children? - ?name?=outputEntries\|?children?=?name?=entry\\\\\\\|\\\|?name?=entry\\\\\\\|\\\|?name?=entry\\\\\\\|\\\|\|| - - - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.autoBuildTarget - all - - - org.eclipse.cdt.make.core.buildArguments - - - - org.eclipse.cdt.make.core.buildCommand - sbi-make - - - org.eclipse.cdt.make.core.buildLocation - ${workspace_loc:/${ProjName}/Debug-Tizen-Emulator} - - - org.eclipse.cdt.make.core.cleanBuildTarget - clean - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - true - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.fullBuildTarget - all - - - org.eclipse.cdt.make.core.stopOnError - true - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - true - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - org.tizen.nativecpp.apichecker.core.builder - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.core.ccnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - org.tizen.nativecpp.apichecker.core.tizenCppNature - - - - src/Classes - 2 - PARENT-1-PROJECT_LOC/Classes - - - - - 1373007589779 - - 26 - - org.eclipse.ui.ide.multiFilter - 1.0-projectRelativePath-matches-false-false-*/.tpk - - - - diff --git a/samples/Lua/HelloLua/proj.tizen/data/.gitkeep b/samples/Lua/HelloLua/proj.tizen/data/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/samples/Lua/HelloLua/proj.tizen/lib/.gitkeep b/samples/Lua/HelloLua/proj.tizen/lib/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/samples/Lua/HelloLua/proj.tizen/manifest.xml b/samples/Lua/HelloLua/proj.tizen/manifest.xml deleted file mode 100644 index 2518a97d98..0000000000 --- a/samples/Lua/HelloLua/proj.tizen/manifest.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - qc0zxC9NQi - 1.0.0 - C++App - - true - - - 2.2 - - - - - - HelloLua - - - mainmenu.png - - - - - diff --git a/samples/Lua/HelloLua/proj.tizen/res/.gitkeep b/samples/Lua/HelloLua/proj.tizen/res/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/samples/Lua/HelloLua/proj.tizen/shared/data/.gitkeep b/samples/Lua/HelloLua/proj.tizen/shared/data/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/samples/Lua/HelloLua/proj.tizen/shared/trusted/.gitkeep b/samples/Lua/HelloLua/proj.tizen/shared/trusted/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/samples/Lua/HelloLua/proj.tizen/src/HelloLuaEntry.cpp b/samples/Lua/HelloLua/proj.tizen/src/HelloLuaEntry.cpp deleted file mode 100644 index 3ec1b2ae63..0000000000 --- a/samples/Lua/HelloLua/proj.tizen/src/HelloLuaEntry.cpp +++ /dev/null @@ -1,76 +0,0 @@ -/**************************************************************************** -Copyright (c) 2013 cocos2d-x.org -Copyright (c) 2013 Lee, Jae-Hong - -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. -****************************************************************************/ - -// -// This file contains the Tizen application entry point. -// -#include "../../Classes/AppDelegate.h" -#include "cocos2d.h" - -USING_NS_CC; -using namespace Tizen::Base; -using namespace Tizen::Base::Collection; - -#ifdef __cplusplus -extern "C" -{ -#endif // __cplusplus - -void -ApplicationInitialized(void) -{ - AppDelegate* pAppDelegate = new AppDelegate; - - auto eglView = EGLView::getInstance(); - eglView->setFrameSize(1280, 720); - - Application::getInstance()->run(); -} - -// -// The entry function of Tizen application called by the operating system. -// -_EXPORT_ int -OspMain(int argc, char *pArgv[]) -{ - AppLog("Application started."); - ArrayList args(SingleObjectDeleter); - args.Construct(); - for (int i = 0; i < argc; i++) - { - args.Add(new (std::nothrow) Tizen::Base::String(pArgv[i])); - } - - OspApplication::SetApplicationInitializedCallback(ApplicationInitialized); - OspApplication::SetScreenOrientation(Tizen::Ui::ORIENTATION_LANDSCAPE); - result r = Tizen::App::Application::Execute(OspApplication::CreateInstance, &args); - TryLog(r == E_SUCCESS, "[%s] Application execution failed", GetErrorMessage(r)); - AppLog("Application finished."); - - return static_cast(r); -} -#ifdef __cplusplus -} -#endif // __cplusplus diff --git a/samples/Lua/TestLua/proj.emscripten/Makefile b/samples/Lua/TestLua/proj.emscripten/Makefile deleted file mode 100644 index 89fbdf9a12..0000000000 --- a/samples/Lua/TestLua/proj.emscripten/Makefile +++ /dev/null @@ -1,28 +0,0 @@ -EXECUTABLE = TestLua - -COCOS_ROOT = ../../../.. -INCLUDES = -I../ -I../Classes -I$(COCOS_ROOT)/CocosDenshion/include \ - -I$(COCOS_ROOT)/scripting/lua/lua \ - -I$(COCOS_ROOT)/scripting/lua/tolua \ - -I$(COCOS_ROOT)/scripting/lua/cocos2dx_support - -SOURCES = main.cpp ../Classes/AppDelegate.cpp - -SHAREDLIBS += -lcocos2d -lcocosdenshion -llua -COCOS_LIBS = $(LIB_DIR)/libcocos2d.so $(LIB_DIR)/libcocosdenshion.so $(LIB_DIR)/liblua.so - -include $(COCOS_ROOT)/cocos2dx/proj.emscripten/cocos2dx.mk - -$(TARGET): $(OBJECTS) $(STATICLIBS) $(COCOS_LIBS) $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - cp -a ../../../../samples/Cpp/TestCpp/Resources ../../../../samples/Lua/TestLua - cp -r ../../../../scripting/lua/script/ ../../../../samples/Lua/TestLua/Resources - $(CXX) $(CXXFLAGS) $(OBJECTS) -o $@ $(SHAREDLIBS) $(STATICLIBS) $(LIBS) - -$(OBJ_DIR)/%.o: ../%.cpp $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) $(VISIBILITY) -c $< -o $@ - -$(OBJ_DIR)/%.o: %.cpp $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) $(VISIBILITY) -c $< -o $@ diff --git a/samples/Lua/TestLua/proj.emscripten/main.cpp b/samples/Lua/TestLua/proj.emscripten/main.cpp deleted file mode 100644 index f114dbc8b7..0000000000 --- a/samples/Lua/TestLua/proj.emscripten/main.cpp +++ /dev/null @@ -1,19 +0,0 @@ -#include "../Classes/AppDelegate.h" -#include "cocos2d.h" -#include "CCEGLView.h" - -#include -#include -#include -#include - -USING_NS_CC; - -int main(int argc, char **argv) -{ - // create the application instance - AppDelegate app; - auto eglView = EGLView::getInstance(); - eglView->setFrameSize(800, 480); - return Application::getInstance()->run(); -} diff --git a/samples/Lua/TestLua/proj.nacl/Makefile b/samples/Lua/TestLua/proj.nacl/Makefile deleted file mode 100644 index 2895ab652c..0000000000 --- a/samples/Lua/TestLua/proj.nacl/Makefile +++ /dev/null @@ -1,69 +0,0 @@ -COCOS_ROOT = ../../../../ -COCOS2DX_PATH = $(COCOS_ROOT)/cocos2dx - -INCLUDES = -I.. \ - -I../Classes \ - -I$(COCOS_ROOT)/CocosDenshion/include \ - -I$(COCOS_ROOT)/scripting/lua/lua \ - -I$(COCOS_ROOT)/scripting/lua/tolua \ - -I$(COCOS_ROOT)/scripting/lua/cocos2dx_support \ - -I$(NACL_SDK_ROOT)/include \ - -I$(COCOS_ROOT)/external \ - -I$(COCOS_ROOT)/external/chipmunk/include/chipmunk \ - -I$(COCOS_ROOT)/extensions \ - -I$(COCOS_ROOT)/extensions/Components - -SOURCES = main.cpp \ - ../Classes/AppDelegate.cpp \ - $(COCOS_ROOT)/scripting/lua/cocos2dx_support/CCLuaEngine.cpp \ - $(COCOS_ROOT)/scripting/lua/cocos2dx_support/CCLuaStack.cpp \ - $(COCOS_ROOT)/scripting/lua/cocos2dx_support/CCLuaValue.cpp \ - $(COCOS_ROOT)/scripting/lua/cocos2dx_support/Cocos2dxLuaLoader.cpp \ - $(COCOS_ROOT)/scripting/lua/cocos2dx_support/LuaCocos2d.cpp \ - $(COCOS_ROOT)/scripting/lua/cocos2dx_support/tolua_fix.c \ - $(COCOS_ROOT)/scripting/lua/cocos2dx_support/CCBProxy.cpp \ - $(COCOS_ROOT)/scripting/lua/cocos2dx_support/Lua_extensions_CCB.cpp \ - $(COCOS_ROOT)/scripting/lua/cocos2dx_support/LuaOpengl.cpp \ - $(COCOS_ROOT)/scripting/lua/cocos2dx_support/LuaScrollView.cpp - -include $(COCOS2DX_PATH)/../extensions/proj.nacl/Makefile -SOURCES += $(addprefix $(COCOS_ROOT)/extensions/, $(EXTENSIONS_SOURCES)) - -include $(COCOS_ROOT)/cocos2dx/proj.nacl/cocos2dx.mk - -CXXFLAGS += -Wno-multichar -STATICLIBS += -llua -SHAREDLIBS += -lbox2d - -APP_NAME = TestLua -TARGET = $(BIN_DIR)/$(APP_NAME)_$(NACL_ARCH).nexe -NMF = $(BIN_DIR)/$(APP_NAME).nmf - -all: $(NMF) - -$(TARGET): $(OBJECTS) $(LIB_DIR)/libcocos2d.a $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(LOG_LINK)$(NACL_CXX) $(CXXFLAGS) $(LDFLAGS) $(OBJECTS) -o $@ $(SHAREDLIBS) $(STATICLIBS) - -$(OBJ_DIR)/%.o: %.cpp $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(LOG_CXX)$(NACL_CXX) -MMD $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@ - -$(OBJ_DIR)/%.o: ../%.cpp $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(LOG_CXX)$(NACL_CXX) -MMD $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@ - -$(OBJ_DIR)/%.o: $(COCOS_ROOT)/%.cpp $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(LOG_CXX)$(NACL_CXX) -MMD $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@ - -$(OBJ_DIR)/%.o: $(COCOS_ROOT)/%.c $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(LOG_CC)$(NACL_CC) -MMD $(CCFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@ - -$(NMF): $(TARGET) - $(NACL_SDK_ROOT)/tools/create_nmf.py -o $@ $(BIN_DIR)/*.nexe $(NMF_FLAGS) -s $(BIN_DIR) - -run: all - /bin/cp -ar ../Resources/ . - $(NACL_SDK_ROOT)/tools/httpd.py --no_dir_check diff --git a/samples/Lua/TestLua/proj.nacl/index.html b/samples/Lua/TestLua/proj.nacl/index.html deleted file mode 100644 index 1c999373ca..0000000000 --- a/samples/Lua/TestLua/proj.nacl/index.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - - cocos2dx TestLua - - -

cocos2dx TestLua

- - - -

-

- - diff --git a/samples/Lua/TestLua/proj.nacl/main.cpp b/samples/Lua/TestLua/proj.nacl/main.cpp deleted file mode 100644 index e8571e92c5..0000000000 --- a/samples/Lua/TestLua/proj.nacl/main.cpp +++ /dev/null @@ -1,36 +0,0 @@ -#include "main.h" -#include "../Classes/AppDelegate.h" -#include "cocos2d.h" -#include "CCInstance.h" -#include "CCModule.h" - -#include -#include -#include -#include -#include - -USING_NS_CC; - -AppDelegate g_app; - -void* cocos_main(void* arg) -{ - fprintf(stderr, "in cocos_main\n"); - CocosPepperInstance* instance = (CocosPepperInstance*)arg; - alSetPpapiInfo(instance->pp_instance(), pp::Module::Get()->get_browser_interface()); - fprintf(stderr, "calling application->run\n"); - int rtn = Application::getInstance()->run(); - fprintf(stderr, "app run returned: %d\n", rtn); - return NULL; -} - -namespace pp -{ - -Module* CreateModule() -{ - return new CocosPepperModule(); -} - -} diff --git a/samples/Lua/TestLua/proj.nacl/main.h b/samples/Lua/TestLua/proj.nacl/main.h deleted file mode 100644 index 7ad9d5c9e4..0000000000 --- a/samples/Lua/TestLua/proj.nacl/main.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef __MAIN_H__ -#define __MAIN_H__ - -// C RunTime Header Files -#include "CCStdC.h" - -#endif // __MAIN_H__ diff --git a/samples/Lua/TestLua/proj.tizen/.cproject b/samples/Lua/TestLua/proj.tizen/.cproject deleted file mode 100644 index 173493f4c3..0000000000 --- a/samples/Lua/TestLua/proj.tizen/.cproject +++ /dev/null @@ -1,692 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/Lua/TestLua/proj.tizen/.project b/samples/Lua/TestLua/proj.tizen/.project deleted file mode 100644 index 93037cf80e..0000000000 --- a/samples/Lua/TestLua/proj.tizen/.project +++ /dev/null @@ -1,106 +0,0 @@ - - - proj.tizen - - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - - - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.autoBuildTarget - all - - - org.eclipse.cdt.make.core.buildArguments - - - - org.eclipse.cdt.make.core.buildCommand - sbi-make - - - org.eclipse.cdt.make.core.buildLocation - ${workspace_loc:/${ProjName}/Debug-Tizen-Emulator} - - - org.eclipse.cdt.make.core.cleanBuildTarget - clean - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - true - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.fullBuildTarget - all - - - org.eclipse.cdt.make.core.stopOnError - true - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - true - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - org.tizen.nativecpp.apichecker.core.builder - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.core.ccnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - org.tizen.nativecpp.apichecker.core.tizenCppNature - - - - src/Classes - 2 - PARENT-2-PROJECT_LOC/HelloLua/Classes - - - - - 1373009863403 - - 26 - - org.eclipse.ui.ide.multiFilter - 1.0-projectRelativePath-matches-false-false-*/.tpk - - - - diff --git a/samples/Lua/TestLua/proj.tizen/data/.gitkeep b/samples/Lua/TestLua/proj.tizen/data/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/samples/Lua/TestLua/proj.tizen/inc/.gitkeep b/samples/Lua/TestLua/proj.tizen/inc/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/samples/Lua/TestLua/proj.tizen/lib/.gitkeep b/samples/Lua/TestLua/proj.tizen/lib/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/samples/Lua/TestLua/proj.tizen/manifest.xml b/samples/Lua/TestLua/proj.tizen/manifest.xml deleted file mode 100644 index 689fd8cfa4..0000000000 --- a/samples/Lua/TestLua/proj.tizen/manifest.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - PHG8MiVSLl - 1.0.0 - C++App - - true - - - 2.2 - - - - - - TestLua - - - mainmenu.png - - - - - diff --git a/samples/Lua/TestLua/proj.tizen/res/.gitkeep b/samples/Lua/TestLua/proj.tizen/res/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/samples/Lua/TestLua/proj.tizen/shared/data/.gitkeep b/samples/Lua/TestLua/proj.tizen/shared/data/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/samples/Lua/TestLua/proj.tizen/shared/trusted/.gitkeep b/samples/Lua/TestLua/proj.tizen/shared/trusted/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/samples/Lua/TestLua/proj.tizen/src/TestLuaEntry.cpp b/samples/Lua/TestLua/proj.tizen/src/TestLuaEntry.cpp deleted file mode 100644 index 3ec1b2ae63..0000000000 --- a/samples/Lua/TestLua/proj.tizen/src/TestLuaEntry.cpp +++ /dev/null @@ -1,76 +0,0 @@ -/**************************************************************************** -Copyright (c) 2013 cocos2d-x.org -Copyright (c) 2013 Lee, Jae-Hong - -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. -****************************************************************************/ - -// -// This file contains the Tizen application entry point. -// -#include "../../Classes/AppDelegate.h" -#include "cocos2d.h" - -USING_NS_CC; -using namespace Tizen::Base; -using namespace Tizen::Base::Collection; - -#ifdef __cplusplus -extern "C" -{ -#endif // __cplusplus - -void -ApplicationInitialized(void) -{ - AppDelegate* pAppDelegate = new AppDelegate; - - auto eglView = EGLView::getInstance(); - eglView->setFrameSize(1280, 720); - - Application::getInstance()->run(); -} - -// -// The entry function of Tizen application called by the operating system. -// -_EXPORT_ int -OspMain(int argc, char *pArgv[]) -{ - AppLog("Application started."); - ArrayList args(SingleObjectDeleter); - args.Construct(); - for (int i = 0; i < argc; i++) - { - args.Add(new (std::nothrow) Tizen::Base::String(pArgv[i])); - } - - OspApplication::SetApplicationInitializedCallback(ApplicationInitialized); - OspApplication::SetScreenOrientation(Tizen::Ui::ORIENTATION_LANDSCAPE); - result r = Tizen::App::Application::Execute(OspApplication::CreateInstance, &args); - TryLog(r == E_SUCCESS, "[%s] Application execution failed", GetErrorMessage(r)); - AppLog("Application finished."); - - return static_cast(r); -} -#ifdef __cplusplus -} -#endif // __cplusplus diff --git a/samples/samples.xcodeproj/project.pbxproj.REMOVED.git-id b/samples/samples.xcodeproj/project.pbxproj.REMOVED.git-id deleted file mode 100644 index 131372c79f..0000000000 --- a/samples/samples.xcodeproj/project.pbxproj.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -0243fae13fc45728b6dfe8d61ab64782e34c145f \ No newline at end of file diff --git a/scripting/auto-generated b/scripting/auto-generated deleted file mode 160000 index 6f5bc7bbd0..0000000000 --- a/scripting/auto-generated +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 6f5bc7bbd036c76e7c6be121573662099997a0a4 diff --git a/scripting/javascript/bindings/js/debugger/DevToolsUtils.js b/scripting/javascript/bindings/js/debugger/DevToolsUtils.js deleted file mode 100644 index 26d0597644..0000000000 --- a/scripting/javascript/bindings/js/debugger/DevToolsUtils.js +++ /dev/null @@ -1,133 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -"use strict"; - -function utf16to8(str) { - var out, i, len, c; - - out = ""; - len = str.length; - for(i = 0; i < len; i++) - { - c = str.charCodeAt(i); - if ((c >= 0x0001) && (c <= 0x007F)) - { - out += str.charAt(i); - } - else if (c > 0x07FF) - { - out += String.fromCharCode(0xE0 | ((c >> 12) & 0x0F)); - out += String.fromCharCode(0x80 | ((c >> 6) & 0x3F)); - out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F)); - } - else - { - out += String.fromCharCode(0xC0 | ((c >> 6) & 0x1F)); - out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F)); - } - } - return out; -} - -function utf8to16(str) { - var out, i, len, c; - var char2, char3; - - out = ""; - len = str.length; - i = 0; - while(i < len) { c = str.charCodeAt(i++); switch(c >> 4) - { - case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: - // 0xxxxxxx - out += str.charAt(i-1); - break; - case 12: case 13: - // 110x xxxx 10xx xxxx - char2 = str.charCodeAt(i++); - out += String.fromCharCode(((c & 0x1F) << 6) | (char2 & 0x3F)); - break; - case 14: - // 1110 xxxx 10xx xxxx 10xx xxxx - char2 = str.charCodeAt(i++); - char3 = str.charCodeAt(i++); - out += String.fromCharCode(((c & 0x0F) << 12) | - ((char2 & 0x3F) << 6) | - ((char3 & 0x3F) << 0)); - break; - } - } - - return out; - } - -var dump = function(msg) { - log(msg); -}; - -/* General utilities used throughout devtools. */ - -/* Turn the error e into a string, without fail. */ -this.safeErrorString = function safeErrorString(aError) { - try { - var s = aError.toString(); - if (typeof s === "string") - return s; - } catch (ee) { } - - return ""; -} - -/** - * Report that |aWho| threw an exception, |aException|. - */ -this.reportException = function reportException(aWho, aException) { - let msg = aWho + " threw an exception: " + safeErrorString(aException); - if (aException.stack) { - msg += "\nCall stack:\n" + aException.stack; - } - - dump(msg + "\n"); - - // if (Components.utils.reportError) { - // /* - // * Note that the xpcshell test harness registers an observer for - // * console messages, so when we're running tests, this will cause - // * the test to quit. - // */ - // Components.utils.reportError(msg); - // } -} - -/** - * Given a handler function that may throw, return an infallible handler - * function that calls the fallible handler, and logs any exceptions it - * throws. - * - * @param aHandler function - * A handler function, which may throw. - * @param aName string - * A name for aHandler, for use in error messages. If omitted, we use - * aHandler.name. - * - * (SpiderMonkey does generate good names for anonymous functions, but we - * don't have a way to get at them from JavaScript at the moment.) - */ -this.makeInfallible = function makeInfallible(aHandler, aName) { - if (!aName) - aName = aHandler.name; - - return function (/* arguments */) { - try { - return aHandler.apply(this, arguments); - } catch (ex) { - let who = "Handler function"; - if (aName) { - who += " " + aName; - } - reportException(who, ex); - } - } -} diff --git a/scripting/javascript/bindings/js/debugger/README.md b/scripting/javascript/bindings/js/debugger/README.md deleted file mode 100644 index 9e1d7bebd0..0000000000 --- a/scripting/javascript/bindings/js/debugger/README.md +++ /dev/null @@ -1,54 +0,0 @@ -Remote Debugging By Using FireFox -================================= - -Requirement ------------ - -* Firefox: From v24 - -How To Use ----------- - -### Prepare ### - -Please refer to https://developer.mozilla.org/en-US/docs/Tools/Remote_Debugging . - -### Enable Debugger Support For Your JSB Project ### - -``` -bool AppDelegate::applicationDidFinishLaunching() -{ - ... - - ScriptingCore* sc = ScriptingCore::getInstance(); - sc->addRegisterCallback(register_all_cocos2dx); - sc->addRegisterCallback(register_all_cocos2dx_extension); - sc->addRegisterCallback(register_cocos2dx_js_extensions); - sc->addRegisterCallback(jsb_register_chipmunk); - sc->addRegisterCallback(register_all_cocos2dx_extension_manual); - sc->addRegisterCallback(register_CCBuilderReader); - sc->addRegisterCallback(jsb_register_system); - sc->addRegisterCallback(JSB_register_opengl); - - sc->start(); - -#if defined(COCOS2D_DEBUG) && (COCOS2D_DEBUG > 0) - sc->enableDebugger(); // Enable debugger here -#endif - - ... -} -``` - -Run your game. - -### Open Firefox And Follow The Step As Follows ### - - -![pic 1](https://lh5.googleusercontent.com/-HoxLGBdV2J0/UlZ7ZoFUjyI/AAAAAAAAADM/68GDaCQ1vP0/s0-I/Firefox-Remote-Debug01.jpg) -![pic 2](https://lh6.googleusercontent.com/-7FDIHAYsKAY/UlZ7Yf8W-pI/AAAAAAAAAFQ/joG0AymnuBk/s0-I/Firefox-Remote-Debug02.jpg) -![pic 3](https://lh4.googleusercontent.com/-idvnMRGcGy8/UlZ7Wj6DDuI/AAAAAAAAAC0/L9IVyHLNqeQ/s0-I/Firefox-Remote-Debug04.jpg) -![pic 4](https://lh6.googleusercontent.com/-YuZj7JGAtFE/UlZ9DDGDczI/AAAAAAAAAEQ/D2qIedjP5FU/s0-I/Firefox-Remote-Debug04.png.png) -![pic 5](https://lh3.googleusercontent.com/-cdIcNa3jT5c/UlZ9uapf3OI/AAAAAAAAAEg/MGq3vLHsauw/s0-I/Firefox-Remote-Debug05.png) -![pic 6](https://lh5.googleusercontent.com/-T79-o5ylJKI/UlZ_JJQe3MI/AAAAAAAAAE8/F63fSVxlJKs/s0-I/Firefox-Remote-Debug06.png) - diff --git a/scripting/javascript/bindings/js/debugger/actors/root.js b/scripting/javascript/bindings/js/debugger/actors/root.js deleted file mode 100644 index aa0d85342b..0000000000 --- a/scripting/javascript/bindings/js/debugger/actors/root.js +++ /dev/null @@ -1,329 +0,0 @@ -/* -*- tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim: set ft=javascript ts=2 et sw=2 tw=80: */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -"use strict"; - -/* Root actor for the remote debugging protocol. */ - -/** - * Methods shared between RootActor and BrowserTabActor. - */ - -/** - * Populate |this._extraActors| as specified by |aFactories|, reusing whatever - * actors are already there. Add all actors in the final extra actors table to - * |aPool|. - * - * The root actor and the tab actor use this to instantiate actors that other - * parts of the browser have specified with DebuggerServer.addTabActor antd - * DebuggerServer.addGlobalActor. - * - * @param aFactories - * An object whose own property names are the names of properties to add to - * some reply packet (say, a tab actor grip or the "listTabs" response - * form), and whose own property values are actor constructor functions, as - * documented for addTabActor and addGlobalActor. - * - * @param this - * The BrowserRootActor or BrowserTabActor with which the new actors will - * be associated. It should support whatever API the |aFactories| - * constructor functions might be interested in, as it is passed to them. - * For the sake of CommonCreateExtraActors itself, it should have at least - * the following properties: - * - * - _extraActors - * An object whose own property names are factory table (and packet) - * property names, and whose values are no-argument actor constructors, - * of the sort that one can add to an ActorPool. - * - * - conn - * The DebuggerServerConnection in which the new actors will participate. - * - * - actorID - * The actor's name, for use as the new actors' parentID. - */ -function CommonCreateExtraActors(aFactories, aPool) { - // Walk over global actors added by extensions. - for (let name in aFactories) { - let actor = this._extraActors[name]; - if (!actor) { - actor = aFactories[name].bind(null, this.conn, this); - actor.prototype = aFactories[name].prototype; - actor.parentID = this.actorID; - this._extraActors[name] = actor; - } - aPool.addActor(actor); - } -} - -/** - * Append the extra actors in |this._extraActors|, constructed by a prior call - * to CommonCreateExtraActors, to |aObject|. - * - * @param aObject - * The object to which the extra actors should be added, under the - * property names given in the |aFactories| table passed to - * CommonCreateExtraActors. - * - * @param this - * The BrowserRootActor or BrowserTabActor whose |_extraActors| table we - * should use; see above. - */ -function CommonAppendExtraActors(aObject) { - for (let name in this._extraActors) { - let actor = this._extraActors[name]; - aObject[name] = actor.actorID; - } -} - -/** - * Create a remote debugging protocol root actor. - * - * @param aConnection - * The DebuggerServerConnection whose root actor we are constructing. - * - * @param aParameters - * The properties of |aParameters| provide backing objects for the root - * actor's requests; if a given property is omitted from |aParameters|, the - * root actor won't implement the corresponding requests or notifications. - * Supported properties: - * - * - tabList: a live list (see below) of tab actors. If present, the - * new root actor supports the 'listTabs' request, providing the live - * list's elements as its tab actors, and sending 'tabListChanged' - * notifications when the live list's contents change. One actor in - * this list must have a true '.selected' property. - * - * - globalActorFactories: an object |A| describing further actors to - * attach to the 'listTabs' reply. This is the type accumulated by - * DebuggerServer.addGlobalActor. For each own property |P| of |A|, - * the root actor adds a property named |P| to the 'listTabs' - * reply whose value is the name of an actor constructed by - * |A[P]|. - * - * - onShutdown: a function to call when the root actor is disconnected. - * - * Instance properties: - * - * - applicationType: the string the root actor will include as the - * "applicationType" property in the greeting packet. By default, this - * is "browser". - * - * Live lists: - * - * A "live list", as used for the |tabList|, is an object that presents a - * list of actors, and also notifies its clients of changes to the list. A - * live list's interface is two properties: - * - * - iterator: a method that returns an iterator. A for-of loop will call - * this method to obtain an iterator for the loop, so if LL is - * a live list, one can simply write 'for (i of LL) ...'. - * - * - onListChanged: a handler called, with no arguments, when the set of - * values the iterator would produce has changed since the last - * time 'iterator' was called. This may only be set to null or a - * callable value (one for which the typeof operator returns - * 'function'). (Note that the live list will not call the - * onListChanged handler until the list has been iterated over - * once; if nobody's seen the list in the first place, nobody - * should care if its contents have changed!) - * - * When the list changes, the list implementation should ensure that any - * actors yielded in previous iterations whose referents (tabs) still exist - * get yielded again in subsequent iterations. If the underlying referent - * is the same, the same actor should be presented for it. - * - * The root actor registers an 'onListChanged' handler on the appropriate - * list when it may need to send the client 'tabListChanged' notifications, - * and is careful to remove the handler whenever it does not need to send - * such notifications (including when it is disconnected). This means that - * live list implementations can use the state of the handler property (set - * or null) to install and remove observers and event listeners. - * - * Note that, as the only way for the root actor to see the members of the - * live list is to begin an iteration over the list, the live list need not - * actually produce any actors until they are reached in the course of - * iteration: alliterative lazy live lists. - */ -function RootActor(aConnection, aParameters) { - this.conn = aConnection; - this._parameters = aParameters; - this._onTabListChanged = this.onTabListChanged.bind(this); - this._extraActors = {}; -} - -RootActor.prototype = { - constructor: RootActor, - applicationType: "browser", - - /** - * Return a 'hello' packet as specified by the Remote Debugging Protocol. - */ - sayHello: function() { - return { - from: "root", - applicationType: this.applicationType, - /* This is not in the spec, but it's used by tests. */ - testConnectionPrefix: this.conn.prefix, - traits: { - sources: true - } - }; - }, - - /** - * Disconnects the actor from the browser window. - */ - disconnect: function() { - /* Tell the live lists we aren't watching any more. */ - if (this._parameters.tabList) { - this._parameters.tabList.onListChanged = null; - } - if (typeof this._parameters.onShutdown === 'function') { - this._parameters.onShutdown(); - } - this._extraActors = null; - }, - - /* The 'listTabs' request and the 'tabListChanged' notification. */ - - /** - * Handles the listTabs request. The actors will survive until at least - * the next listTabs request. - */ - onListTabs: function() { - - let tabList = this._parameters.tabList; - if (!tabList) { - return { from: "root", error: "noTabs", - message: "This root actor has no browser tabs." }; - } - - /* - * Walk the tab list, accumulating the array of tab actors for the - * reply, and moving all the actors to a new ActorPool. We'll - * replace the old tab actor pool with the one we build here, thus - * retiring any actors that didn't get listed again, and preparing any - * new actors to receive packets. - */ - let newActorPool = new ActorPool(this.conn); - let tabActorList = []; - let selected; - for (let tabActor of tabList) { - if (tabActor.selected) { - selected = tabActorList.length; - } - tabActor.parentID = this.actorID; - newActorPool.addActor(tabActor); - tabActorList.push(tabActor); - } - - /* DebuggerServer.addGlobalActor support: create actors. */ - this._createExtraActors(this._parameters.globalActorFactories, newActorPool); - - /* - * Drop the old actorID -> actor map. Actors that still mattered were - * added to the new map; others will go away. - */ - if (this._tabActorPool) { - this.conn.removeActorPool(this._tabActorPool); - } - this._tabActorPool = newActorPool; - this.conn.addActorPool(this._tabActorPool); - - let reply = { - "from": "root", - "selected": selected || 0, - "tabs": [actor.grip() for (actor of tabActorList)] - }; - - /* DebuggerServer.addGlobalActor support: name actors in 'listTabs' reply. */ - this._appendExtraActors(reply); - - /* - * Now that we're actually going to report the contents of tabList to - * the client, we're responsible for letting the client know if it - * changes. - */ - tabList.onListChanged = this._onTabListChanged; - - return reply; - }, - - onTabListChanged: function () { - this.conn.send({ from:"root", type:"tabListChanged" }); - /* It's a one-shot notification; no need to watch any more. */ - this._parameters.tabList.onListChanged = null; - }, - - /* This is not in the spec, but it's used by tests. */ - onEcho: (aRequest) => aRequest, - - /* Support for DebuggerServer.addGlobalActor. */ - _createExtraActors: CommonCreateExtraActors, - _appendExtraActors: CommonAppendExtraActors, - - /* ThreadActor hooks. */ - - /** - * Prepare to enter a nested event loop by disabling debuggee events. - */ - preNest: function() { - // Disable events in all open windows. - let e = windowMediator.getEnumerator(null); - while (e.hasMoreElements()) { - let win = e.getNext(); - let windowUtils = win.QueryInterface(Ci.nsIInterfaceRequestor) - .getInterface(Ci.nsIDOMWindowUtils); - windowUtils.suppressEventHandling(true); - windowUtils.suspendTimeouts(); - } - }, - - /** - * Prepare to exit a nested event loop by enabling debuggee events. - */ - postNest: function(aNestData) { - // Enable events in all open windows. - let e = windowMediator.getEnumerator(null); - while (e.hasMoreElements()) { - let win = e.getNext(); - let windowUtils = win.QueryInterface(Ci.nsIInterfaceRequestor) - .getInterface(Ci.nsIDOMWindowUtils); - windowUtils.resumeTimeouts(); - windowUtils.suppressEventHandling(false); - } - }, - - /* ChromeDebuggerActor hooks. */ - - /** - * Add the specified actor to the default actor pool connection, in order to - * keep it alive as long as the server is. This is used by breakpoints in the - * thread and chrome debugger actors. - * - * @param actor aActor - * The actor object. - */ - addToParentPool: function(aActor) { - this.conn.addActor(aActor); - }, - - /** - * Remove the specified actor from the default actor pool. - * - * @param BreakpointActor aActor - * The actor object. - */ - removeFromParentPool: function(aActor) { - this.conn.removeActor(aActor); - } -} - -RootActor.prototype.requestTypes = { - "listTabs": RootActor.prototype.onListTabs, - "echo": RootActor.prototype.onEcho -}; diff --git a/scripting/javascript/bindings/js/debugger/actors/script.js b/scripting/javascript/bindings/js/debugger/actors/script.js deleted file mode 100644 index 7ddade2b54..0000000000 --- a/scripting/javascript/bindings/js/debugger/actors/script.js +++ /dev/null @@ -1,2948 +0,0 @@ -/* -*- Mode: javascript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; js-indent-level: 2; -*- */ -/* vim: set ft=javascript ts=2 et sw=2 tw=80: */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -"use strict"; - -/** - * JSD2 actors. - */ -/** - * Creates a ThreadActor. - * - * ThreadActors manage a JSInspector object and manage execution/inspection - * of debuggees. - * - * @param aHooks object - * An object with preNest and postNest methods for calling when entering - * and exiting a nested event loop, addToParentPool and - * removeFromParentPool methods for handling the lifetime of actors that - * will outlive the thread, like breakpoints. - * @param aGlobal object [optional] - * An optional (for content debugging only) reference to the content - * window. - */ -function ThreadActor(aHooks, aGlobal) -{ - this._state = "detached"; - this._frameActors = []; - this._environmentActors = []; - this._hooks = aHooks; - this.global = aGlobal; - - this.findGlobals = this.globalManager.findGlobals.bind(this); - this.onNewGlobal = this.globalManager.onNewGlobal.bind(this); - this.onNewSource = this.onNewSource.bind(this); - - this._options = { - useSourceMaps: false - }; -} - -/** - * The breakpoint store must be shared across instances of ThreadActor so that - * page reloads don't blow away all of our breakpoints. - */ -ThreadActor._breakpointStore = {}; - -ThreadActor.prototype = { - actorPrefix: "context", - - get state() { return this._state; }, - get attached() this.state == "attached" || - this.state == "running" || - this.state == "paused", - - get _breakpointStore() { return ThreadActor._breakpointStore; }, - - get threadLifetimePool() { - if (!this._threadLifetimePool) { - this._threadLifetimePool = new ActorPool(this.conn); - this.conn.addActorPool(this._threadLifetimePool); - this._threadLifetimePool.objectActors = new WeakMap(); - } - return this._threadLifetimePool; - }, - - get sources() { - if (!this._sources) { - this._sources = new ThreadSources(this, this._options.useSourceMaps, - this._allowSource, this.onNewSource); - } - return this._sources; - }, - - clearDebuggees: function TA_clearDebuggees() { - if (this.dbg) { - this.dbg.removeAllDebuggees(); - } - this.conn.removeActorPool(this._threadLifetimePool || undefined); - this._threadLifetimePool = null; - this._sources = null; - }, - - /** - * Add a debuggee global to the Debugger object. - */ - addDebuggee: function TA_addDebuggee(aGlobal) { - try { - this.dbg.addDebuggee(aGlobal); - } catch (e) { - // Ignore attempts to add the debugger's compartment as a debuggee. - dumpn("Ignoring request to add the debugger's compartment as a debuggee"); - } - }, - - /** - * Initialize the Debugger. - */ - _initDebugger: function TA__initDebugger() { - this.dbg = new Debugger(); - this.dbg.uncaughtExceptionHook = this.uncaughtExceptionHook.bind(this); - this.dbg.onDebuggerStatement = this.onDebuggerStatement.bind(this); - this.dbg.onNewScript = this.onNewScript.bind(this); - this.dbg.onNewGlobalObject = this.globalManager.onNewGlobal.bind(this); - // Keep the debugger disabled until a client attaches. - this.dbg.enabled = this._state != "detached"; - }, - - /** - * Remove a debuggee global from the JSInspector. - */ - removeDebugee: function TA_removeDebuggee(aGlobal) { - try { - this.dbg.removeDebuggee(aGlobal); - } catch(ex) { - // XXX: This debuggee has code currently executing on the stack, - // we need to save this for later. - } - }, - - /** - * Add the provided window and all windows in its frame tree as debuggees. - */ - _addDebuggees: function TA__addDebuggees(aWindow) { - this.addDebuggee(aWindow); - let frames = aWindow.frames; - if (frames) { - for (let i = 0; i < frames.length; i++) { - this._addDebuggees(frames[i]); - } - } - }, - - /** - * An object that will be used by ThreadActors to tailor their behavior - * depending on the debugging context being required (chrome or content). - */ - globalManager: { - findGlobals: function TA_findGlobals() { - this._addDebuggees(this.global); - }, - - /** - * A function that the engine calls when a new global object has been - * created. - * - * @param aGlobal Debugger.Object - * The new global object that was created. - */ - onNewGlobal: function TA_onNewGlobal(aGlobal) { - // Content debugging only cares about new globals in the contant window, - // like iframe children. - if (aGlobal.hostAnnotations && - aGlobal.hostAnnotations.type == "document" && - aGlobal.hostAnnotations.element === this.global) { - this.addDebuggee(aGlobal); - // Notify the client. - this.conn.send({ - from: this.actorID, - type: "newGlobal", - // TODO: after bug 801084 lands see if we need to JSONify this. - hostAnnotations: aGlobal.hostAnnotations - }); - } - } - }, - - disconnect: function TA_disconnect() { - dumpn("in ThreadActor.prototype.disconnect"); - if (this._state == "paused") { - this.onResume(); - } - - this._state = "exited"; - - this.clearDebuggees(); - - if (!this.dbg) { - return; - } - this.dbg.enabled = false; - this.dbg = null; - }, - - /** - * Disconnect the debugger and put the actor in the exited state. - */ - exit: function TA_exit() { - this.disconnect(); - }, - - // Request handlers - onAttach: function TA_onAttach(aRequest) { - if (this.state === "exited") { - return { type: "exited" }; - } - - if (this.state !== "detached") { - return { error: "wrongState" }; - } - - this._state = "attached"; - - update(this._options, aRequest.options || {}); - - if (!this.dbg) { - this._initDebugger(); - } - this.findGlobals(); - this.dbg.enabled = true; - try { - // Put ourselves in the paused state. - let packet = this._paused(); - if (!packet) { - return { error: "notAttached" }; - } - packet.why = { type: "attached" }; - - this._restoreBreakpoints(); - - // Send the response to the attach request now (rather than - // returning it), because we're going to start a nested event loop - // here. - this.conn.send(packet); - - // Start a nested event loop. - this._nest(); - - // We already sent a response to this request, don't send one - // now. - return null; - } catch (e) { - reportError(e); - return { error: "notAttached", message: e.toString() }; - } - }, - - onDetach: function TA_onDetach(aRequest) { - this.disconnect(); - dumpn("ThreadActor.prototype.onDetach: returning 'detached' packet"); - return { - type: "detached" - }; - }, - - onReconfigure: function TA_onReconfigure(aRequest) { - if (this.state == "exited") { - return { error: "wrongState" }; - } - - update(this._options, aRequest.options || {}); - // Clear existing sources, so they can be recreated on next access. - this._sources = null; - - return {}; - }, - - /** - * Pause the debuggee, by entering a nested event loop, and return a 'paused' - * packet to the client. - * - * @param Debugger.Frame aFrame - * The newest debuggee frame in the stack. - * @param object aReason - * An object with a 'type' property containing the reason for the pause. - * @param function onPacket - * Hook to modify the packet before it is sent. Feel free to return a - * promise. - */ - _pauseAndRespond: function TA__pauseAndRespond(aFrame, aReason, - onPacket=function (k) k) { - try { - let packet = this._paused(aFrame); - if (!packet) { - return undefined; - } - packet.why = aReason; - resolve(onPacket(packet)).then(this.conn.send.bind(this.conn)); - return this._nest(); - } catch(e) { - let msg = "Got an exception during TA__pauseAndRespond: " + e + - ": " + e.stack; - // Cu.reportError(msg); - dumpn(msg); - return undefined; - } - }, - - /** - * Handle a protocol request to resume execution of the debuggee. - */ - onResume: function TA_onResume(aRequest) { - if (this._state !== "paused") { - return { - error: "wrongState", - message: "Can't resume when debuggee isn't paused. Current state is '" - + this._state + "'" - }; - } - - // In case of multiple nested event loops (due to multiple debuggers open in - // different tabs or multiple debugger clients connected to the same tab) - // only allow resumption in a LIFO order. - if (DebuggerServer.xpcInspector.eventLoopNestLevel() > 1) { - log("DebuggerServer.xpcInspector.eventLoopNestLevel: "+DebuggerServer.xpcInspector.eventLoopNestLevel()); - // let lastNestRequestor = DebuggerServer.xpcInspector.lastNestRequestor; - // if (lastNestRequestor.connection != this.conn) { - // return { error: "wrongOrder", - // message: "trying to resume in the wrong order.", - // lastPausedUrl: lastNestRequestor.url }; - // } - } - - if (aRequest && aRequest.forceCompletion) { - // TODO: remove this when Debugger.Frame.prototype.pop is implemented in - // bug 736733. - if (typeof this.frame.pop != "function") { - return { error: "notImplemented", - message: "forced completion is not yet implemented." }; - } - - this.dbg.getNewestFrame().pop(aRequest.completionValue); - let packet = this._resumed(); - DebuggerServer.xpcInspector.exitNestedEventLoop(); - return { type: "resumeLimit", frameFinished: aRequest.forceCompletion }; - } - - if (aRequest && aRequest.resumeLimit) { - log("resumeLimit..."); - // Bind these methods because some of the hooks are called with 'this' - // set to the current frame. - let pauseAndRespond = (aFrame, onPacket=function (k) k) => { - this._pauseAndRespond(aFrame, { type: "resumeLimit" }, onPacket); - }; - let createValueGrip = this.createValueGrip.bind(this); - - let startFrame = this.youngestFrame; - let startLine; - if (this.youngestFrame.script) { - let offset = this.youngestFrame.offset; - startLine = this.youngestFrame.script.getOffsetLine(offset); - } - - // Define the JS hook functions for stepping. - - let onEnterFrame = aFrame => { - if (this.sources.isBlackBoxed(aFrame.script.url)) { - return undefined; - } - return pauseAndRespond(aFrame); - }; - - let thread = this; - - let onPop = function TA_onPop(aCompletion) { - // onPop is called with 'this' set to the current frame. - if (thread.sources.isBlackBoxed(this.script.url)) { - return undefined; - } - - // Note that we're popping this frame; we need to watch for - // subsequent step events on its caller. - this.reportedPop = true; - - return pauseAndRespond(this, (aPacket) => { - aPacket.why.frameFinished = {}; - if (!aCompletion) { - aPacket.why.frameFinished.terminated = true; - } else if (aCompletion.hasOwnProperty("return")) { - aPacket.why.frameFinished.return = createValueGrip(aCompletion.return); - } else if (aCompletion.hasOwnProperty("yield")) { - aPacket.why.frameFinished.return = createValueGrip(aCompletion.yield); - } else { - aPacket.why.frameFinished.throw = createValueGrip(aCompletion.throw); - } - return aPacket; - }); - }; - - let onStep = function TA_onStep() { - // onStep is called with 'this' set to the current frame. - - if (thread.sources.isBlackBoxed(this.script.url)) { - return undefined; - } - - // If we've changed frame or line, then report that. - if (this !== startFrame || - (this.script && - this.script.getOffsetLine(this.offset) != startLine)) { - return pauseAndRespond(this); - } - - // Otherwise, let execution continue. - return undefined; - }; - - let steppingType = aRequest.resumeLimit.type; - if (["step", "next", "finish"].indexOf(steppingType) == -1) { - return { error: "badParameterType", - message: "Unknown resumeLimit type" }; - } - // Make sure there is still a frame on the stack if we are to continue - // stepping. - let stepFrame = this._getNextStepFrame(startFrame); - if (stepFrame) { - switch (steppingType) { - case "step": - log("--> step..."); - this.dbg.onEnterFrame = onEnterFrame; - // Fall through. - case "next": - log("--> next..."); - stepFrame.onStep = onStep; - stepFrame.onPop = onPop; - break; - case "finish": - log("--> finish..."); - stepFrame.onPop = onPop; - } - } - - } - - if (aRequest && aRequest.pauseOnExceptions) { - this.dbg.onExceptionUnwind = this.onExceptionUnwind.bind(this); - } - let packet = this._resumed(); - DebuggerServer.xpcInspector.exitNestedEventLoop(); - return packet; - }, - - /** - * Helper method that returns the next frame when stepping. - */ - _getNextStepFrame: function TA__getNextStepFrame(aFrame) { - let stepFrame = aFrame.reportedPop ? aFrame.older : aFrame; - if (!stepFrame || !stepFrame.script) { - stepFrame = null; - } - return stepFrame; - }, - - onClientEvaluate: function TA_onClientEvaluate(aRequest) { - if (this.state !== "paused") { - return { error: "wrongState", - message: "Debuggee must be paused to evaluate code." }; - }; - - let frame = this._requestFrame(aRequest.frame); - if (!frame) { - return { error: "unknownFrame", - message: "Evaluation frame not found" }; - } - - if (!frame.environment) { - return { error: "notDebuggee", - message: "cannot access the environment of this frame." }; - }; - - // We'll clobber the youngest frame if the eval causes a pause, so - // save our frame now to be restored after eval returns. - // XXX: or we could just start using dbg.getNewestFrame() now that it - // works as expected. - let youngest = this.youngestFrame; - - // Put ourselves back in the running state and inform the client. - let resumedPacket = this._resumed(); - this.conn.send(resumedPacket); - - // Run the expression. - // XXX: test syntax errors - let completion = frame.eval(aRequest.expression); - - // Put ourselves back in the pause state. - let packet = this._paused(youngest); - packet.why = { type: "clientEvaluated", - frameFinished: this.createProtocolCompletionValue(completion) }; - - // Return back to our previous pause's event loop. - return packet; - }, - - onFrames: function TA_onFrames(aRequest) { - if (this.state !== "paused") { - return { error: "wrongState", - message: "Stack frames are only available while the debuggee is paused."}; - } - - let start = aRequest.start ? aRequest.start : 0; - let count = aRequest.count; - - // Find the starting frame... - let frame = this.youngestFrame; - let i = 0; - while (frame && (i < start)) { - frame = frame.older; - i++; - } - - // Return request.count frames, or all remaining - // frames if count is not defined. - let frames = []; - let promises = []; - for (; frame && (!count || i < (start + count)); i++, frame=frame.older) { - let form = this._createFrameActor(frame).form(); - form.depth = i; - frames.push(form); - - let promise = this.sources.getOriginalLocation(form.where.url, - form.where.line) - .then(function (aOrigLocation) { - form.where = aOrigLocation; - }); - promises.push(promise); - } - - return all(promises).then(function () { - return { frames: frames }; - }); - }, - - onReleaseMany: function TA_onReleaseMany(aRequest) { - if (!aRequest.actors) { - return { error: "missingParameter", - message: "no actors were specified" }; - } - - let res; - for each (let actorID in aRequest.actors) { - let actor = this.threadLifetimePool.get(actorID); - if (!actor) { - if (!res) { - res = { error: "notReleasable", - message: "Only thread-lifetime actors can be released." }; - } - continue; - } - actor.onRelease(); - } - return res ? res : {}; - }, - - /** - * Handle a protocol request to set a breakpoint. - */ - onSetBreakpoint: function TA_onSetBreakpoint(aRequest) { - if (this.state !== "paused") { - return { error: "wrongState", - message: "Breakpoints can only be set while the debuggee is paused."}; - } - - // XXX: `originalColumn` is never used. See bug 827639. - let { url: originalSource, - line: originalLine, - column: originalColumn } = aRequest.location; - - let locationPromise = this.sources.getGeneratedLocation(originalSource, - originalLine) - return locationPromise.then((aLocation) => { - let line = aLocation.line; - if (this.dbg.findScripts({ url: aLocation.url }).length == 0 || - line < 0 || - line == null) { - return { error: "noScript" }; - } - - // Add the breakpoint to the store for later reuse, in case it belongs to a - // script that hasn't appeared yet. - if (!this._breakpointStore[aLocation.url]) { - this._breakpointStore[aLocation.url] = []; - } - let scriptBreakpoints = this._breakpointStore[aLocation.url]; - scriptBreakpoints[line] = { - url: aLocation.url, - line: line, - column: aLocation.column - }; - - let response = this._setBreakpoint(aLocation); - // If the original location of our generated location is different from - // the original location we attempted to set the breakpoint on, we will - // need to know so that we can set actualLocation on the response. - let originalLocation = this.sources.getOriginalLocation(aLocation.url, - aLocation.line); - - return all([response, originalLocation]) - .then(([aResponse, {url, line}]) => { - if (aResponse.actualLocation) { - let actualOrigLocation = this.sources.getOriginalLocation( - aResponse.actualLocation.url, aResponse.actualLocation.line); - return actualOrigLocation.then(function ({ url, line }) { - if (url !== originalSource || line !== originalLine) { - aResponse.actualLocation = { url: url, line: line }; - } - return aResponse; - }); - } - - if (url !== originalSource || line !== originalLine) { - aResponse.actualLocation = { url: url, line: line }; - } - - return aResponse; - }); - }); - }, - - /** - * Set a breakpoint using the jsdbg2 API. If the line on which the breakpoint - * is being set contains no code, then the breakpoint will slide down to the - * next line that has runnable code. In this case the server breakpoint cache - * will be updated, so callers that iterate over the breakpoint cache should - * take that into account. - * - * @param object aLocation - * The location of the breakpoint as specified in the protocol. - */ - _setBreakpoint: function TA__setBreakpoint(aLocation) { - let breakpoints = this._breakpointStore[aLocation.url]; - - // Get or create the breakpoint actor for the given location - let actor; - if (breakpoints[aLocation.line].actor) { - actor = breakpoints[aLocation.line].actor; - } else { - actor = breakpoints[aLocation.line].actor = new BreakpointActor(this, { - url: aLocation.url, - line: aLocation.line - }); - this._hooks.addToParentPool(actor); - } - - // Find all scripts matching the given location - let scripts = this.dbg.findScripts(aLocation); - if (scripts.length == 0) { - return { - error: "noScript", - actor: actor.actorID - }; - } - - /** - * For each script, if the given line has at least one entry point, set - * breakpoint on the bytecode offet for each of them. - */ - let found = false; - for (let script of scripts) { - let offsets = script.getLineOffsets(aLocation.line); - if (offsets.length > 0) { - for (let offset of offsets) { - script.setBreakpoint(offset, actor); - } - actor.addScript(script, this); - found = true; - } - } - if (found) { - return { - actor: actor.actorID - }; - } - - /** - * If we get here, no breakpoint was set. This is because the given line - * has no entry points, for example because it is empty. As a fallback - * strategy, we try to set the breakpoint on the smallest line greater - * than or equal to the given line that as at least one entry point. - */ - - // Find all innermost scripts matching the given location - let scripts = this.dbg.findScripts({ - url: aLocation.url, - line: aLocation.line, - innermost: true - }); - - /** - * For each innermost script, look for the smallest line greater than or - * equal to the given line that has one or more entry points. If found, set - * a breakpoint on the bytecode offset for each of its entry points. - */ - let actualLocation; - let found = false; - for (let script of scripts) { - let offsets = script.getAllOffsets(); - for (let line = aLocation.line; line < offsets.length; ++line) { - if (offsets[line]) { - for (let offset of offsets[line]) { - script.setBreakpoint(offset, actor); - } - actor.addScript(script, this); - if (!actualLocation) { - actualLocation = { - url: aLocation.url, - line: line, - column: 0 - }; - } - found = true; - break; - } - } - } - if (found) { - if (breakpoints[actualLocation.line] && - breakpoints[actualLocation.line].actor) { - /** - * We already have a breakpoint actor for the actual location, so - * actor we created earlier is now redundant. Delete it, update the - * breakpoint store, and return the actor for the actual location. - */ - actor.onDelete(); - delete breakpoints[aLocation.line]; - return { - actor: breakpoints[actualLocation.line].actor.actorID, - actualLocation: actualLocation - }; - } else { - /** - * We don't have a breakpoint actor for the actual location yet. - * Instead or creating a new actor, reuse the actor we created earlier, - * and update the breakpoint store. - */ - actor.location = actualLocation; - breakpoints[actualLocation.line] = breakpoints[aLocation.line]; - delete breakpoints[aLocation.line]; - // WARNING: This overwrites aLocation.line - breakpoints[actualLocation.line].line = actualLocation.line; - return { - actor: actor.actorID, - actualLocation: actualLocation - }; - } - } - - /** - * If we get here, no line matching the given line was found, so just - * epically. - */ - return { - error: "noCodeAtLineColumn", - actor: actor.actorID - }; - }, - - /** - * Get the script and source lists from the debugger. - * - * TODO bug 637572: we should be dealing with sources directly, not inferring - * them through scripts. - */ - _discoverSources: function TA__discoverSources() { - // Only get one script per url. - let scriptsByUrl = {}; - for (let s of this.dbg.findScripts()) { - scriptsByUrl[s.url] = s; - } - - return all([this.sources.sourcesForScript(scriptsByUrl[s]) - for (s of Object.keys(scriptsByUrl))]); - }, - - onSources: function TA_onSources(aRequest) { - return this._discoverSources().then(() => { - return { - sources: [s.form() for (s of this.sources.iter())] - }; - }); - }, - - /** - * Disassociate all breakpoint actors from their scripts and clear the - * breakpoint handlers. This method can be used when the thread actor intends - * to keep the breakpoint store, but needs to clear any actual breakpoints, - * e.g. due to a page navigation. This way the breakpoint actors' script - * caches won't hold on to the Debugger.Script objects leaking memory. - */ - disableAllBreakpoints: function () { - for (let url in this._breakpointStore) { - for (let line in this._breakpointStore[url]) { - let bp = this._breakpointStore[url][line]; - bp.actor.removeScripts(); - } - } - }, - - /** - * Handle a protocol request to pause the debuggee. - */ - onInterrupt: function TA_onInterrupt(aRequest) { - if (this.state == "exited") { - return { type: "exited" }; - } else if (this.state == "paused") { - // TODO: return the actual reason for the existing pause. - return { type: "paused", why: { type: "alreadyPaused" } }; - } else if (this.state != "running") { - return { error: "wrongState", - message: "Received interrupt request in " + this.state + - " state." }; - } - - try { - // Put ourselves in the paused state. - let packet = this._paused(); - if (!packet) { - return { error: "notInterrupted" }; - } - packet.why = { type: "interrupted" }; - - // Send the response to the interrupt request now (rather than - // returning it), because we're going to start a nested event loop - // here. - this.conn.send(packet); - - // Start a nested event loop. - this._nest(); - - // We already sent a response to this request, don't send one - // now. - return null; - } catch (e) { - reportError(e); - return { error: "notInterrupted", message: e.toString() }; - } - }, - - /** - * Return the Debug.Frame for a frame mentioned by the protocol. - */ - _requestFrame: function TA_requestFrame(aFrameID) { - if (!aFrameID) { - return this.youngestFrame; - } - - if (this._framePool.has(aFrameID)) { - return this._framePool.get(aFrameID).frame; - } - - return undefined; - }, - - _paused: function TA_paused(aFrame) { - // We don't handle nested pauses correctly. Don't try - if we're - // paused, just continue running whatever code triggered the pause. - // We don't want to actually have nested pauses (although we - // have nested event loops). If code runs in the debuggee during - // a pause, it should cause the actor to resume (dropping - // pause-lifetime actors etc) and then repause when complete. - - if (this.state === "paused") { - return undefined; - } - - // Clear stepping hooks. - this.dbg.onEnterFrame = undefined; - this.dbg.onExceptionUnwind = undefined; - if (aFrame) { - aFrame.onStep = undefined; - aFrame.onPop = undefined; - } - - this._state = "paused"; - - // Save the pause frame (if any) as the youngest frame for - // stack viewing. - this.youngestFrame = aFrame; - - // Create the actor pool that will hold the pause actor and its - // children. - dbg_assert(!this._pausePool); - this._pausePool = new ActorPool(this.conn); - this.conn.addActorPool(this._pausePool); - - // Give children of the pause pool a quick link back to the - // thread... - this._pausePool.threadActor = this; - - // Create the pause actor itself... - dbg_assert(!this._pauseActor); - this._pauseActor = new PauseActor(this._pausePool); - this._pausePool.addActor(this._pauseActor); - - // Update the list of frames. - let poppedFrames = this._updateFrames(); - - // Send off the paused packet and spin an event loop. - let packet = { from: this.actorID, - type: "paused", - actor: this._pauseActor.actorID }; - if (aFrame) { - packet.frame = this._createFrameActor(aFrame).form(); - } - - if (poppedFrames) { - packet.poppedFrames = poppedFrames; - } - - return packet; - }, - - _nest: function TA_nest() { - if (this._hooks.preNest) { - var nestData = this._hooks.preNest(); - } - - let requestor = Object.create(null); - requestor.url = this._hooks.url; - requestor.connection = this.conn; - DebuggerServer.xpcInspector.enterNestedEventLoop(requestor); - - dbg_assert(this.state === "running"); - - if (this._hooks.postNest) { - this._hooks.postNest(nestData) - } - - // "continue" resumption value. - return undefined; - }, - - _resumed: function TA_resumed() { - this._state = "running"; - - // Drop the actors in the pause actor pool. - this.conn.removeActorPool(this._pausePool); - - this._pausePool = null; - this._pauseActor = null; - this.youngestFrame = null; - - return { from: this.actorID, type: "resumed" }; - }, - - /** - * Expire frame actors for frames that have been popped. - * - * @returns A list of actor IDs whose frames have been popped. - */ - _updateFrames: function TA_updateFrames() { - let popped = []; - - // Create the actor pool that will hold the still-living frames. - let framePool = new ActorPool(this.conn); - let frameList = []; - - for each (let frameActor in this._frameActors) { - if (frameActor.frame.live) { - framePool.addActor(frameActor); - frameList.push(frameActor); - } else { - popped.push(frameActor.actorID); - } - } - - // Remove the old frame actor pool, this will expire - // any actors that weren't added to the new pool. - if (this._framePool) { - this.conn.removeActorPool(this._framePool); - } - - this._frameActors = frameList; - this._framePool = framePool; - this.conn.addActorPool(framePool); - - return popped; - }, - - _createFrameActor: function TA_createFrameActor(aFrame) { - if (aFrame.actor) { - return aFrame.actor; - } - - let actor = new FrameActor(aFrame, this); - this._frameActors.push(actor); - this._framePool.addActor(actor); - aFrame.actor = actor; - - return actor; - }, - - /** - * Create and return an environment actor that corresponds to the provided - * Debugger.Environment. - * @param Debugger.Environment aEnvironment - * The lexical environment we want to extract. - * @param object aPool - * The pool where the newly-created actor will be placed. - * @return The EnvironmentActor for aEnvironment or undefined for host - * functions or functions scoped to a non-debuggee global. - */ - createEnvironmentActor: - function TA_createEnvironmentActor(aEnvironment, aPool) { - if (!aEnvironment) { - return undefined; - } - - if (aEnvironment.actor) { - return aEnvironment.actor; - } - - let actor = new EnvironmentActor(aEnvironment, this); - this._environmentActors.push(actor); - aPool.addActor(actor); - aEnvironment.actor = actor; - - return actor; - }, - - /** - * Create a grip for the given debuggee value. If the value is an - * object, will create an actor with the given lifetime. - */ - createValueGrip: function TA_createValueGrip(aValue, aPool=false) { - if (!aPool) { - aPool = this._pausePool; - } - let type = typeof(aValue); - - if (type === "string" && this._stringIsLong(aValue)) { - return this.longStringGrip(aValue, aPool); - } - - if (type === "boolean" || type === "string" || type === "number") { - return aValue; - } - - if (aValue === null) { - return { type: "null" }; - } - - if (aValue === undefined) { - return { type: "undefined" } - } - - if (typeof(aValue) === "object") { - return this.objectGrip(aValue, aPool); - } - - dbg_assert(false, "Failed to provide a grip for: " + aValue); - return null; - }, - - /** - * Return a protocol completion value representing the given - * Debugger-provided completion value. - */ - createProtocolCompletionValue: - function TA_createProtocolCompletionValue(aCompletion) { - let protoValue = {}; - if ("return" in aCompletion) { - protoValue.return = this.createValueGrip(aCompletion.return); - } else if ("yield" in aCompletion) { - protoValue.return = this.createValueGrip(aCompletion.yield); - } else if ("throw" in aCompletion) { - protoValue.throw = this.createValueGrip(aCompletion.throw); - } else { - protoValue.terminated = true; - } - return protoValue; - }, - - /** - * Create a grip for the given debuggee object. - * - * @param aValue Debugger.Object - * The debuggee object value. - * @param aPool ActorPool - * The actor pool where the new object actor will be added. - */ - objectGrip: function TA_objectGrip(aValue, aPool) { - if (!aPool.objectActors) { - aPool.objectActors = new WeakMap(); - } - - if (aPool.objectActors.has(aValue)) { - return aPool.objectActors.get(aValue).grip(); - } else if (this.threadLifetimePool.objectActors.has(aValue)) { - return this.threadLifetimePool.objectActors.get(aValue).grip(); - } - - let actor = new PauseScopedObjectActor(aValue, this); - aPool.addActor(actor); - aPool.objectActors.set(aValue, actor); - return actor.grip(); - }, - - /** - * Create a grip for the given debuggee object with a pause lifetime. - * - * @param aValue Debugger.Object - * The debuggee object value. - */ - pauseObjectGrip: function TA_pauseObjectGrip(aValue) { - if (!this._pausePool) { - throw "Object grip requested while not paused."; - } - - return this.objectGrip(aValue, this._pausePool); - }, - - /** - * Extend the lifetime of the provided object actor to thread lifetime. - * - * @param aActor object - * The object actor. - */ - threadObjectGrip: function TA_threadObjectGrip(aActor) { - // We want to reuse the existing actor ID, so we just remove it from the - // current pool's weak map and then let pool.addActor do the rest. - aActor.registeredPool.objectActors.delete(aActor.obj); - this.threadLifetimePool.addActor(aActor); - this.threadLifetimePool.objectActors.set(aActor.obj, aActor); - }, - - /** - * Handle a protocol request to promote multiple pause-lifetime grips to - * thread-lifetime grips. - * - * @param aRequest object - * The protocol request object. - */ - onThreadGrips: function OA_onThreadGrips(aRequest) { - if (this.state != "paused") { - return { error: "wrongState" }; - } - - if (!aRequest.actors) { - return { error: "missingParameter", - message: "no actors were specified" }; - } - - for (let actorID of aRequest.actors) { - let actor = this._pausePool.get(actorID); - if (actor) { - this.threadObjectGrip(actor); - } - } - return {}; - }, - - /** - * Create a grip for the given string. - * - * @param aString String - * The string we are creating a grip for. - * @param aPool ActorPool - * The actor pool where the new actor will be added. - */ - longStringGrip: function TA_longStringGrip(aString, aPool) { - if (!aPool.longStringActors) { - aPool.longStringActors = {}; - } - - if (aPool.longStringActors.hasOwnProperty(aString)) { - return aPool.longStringActors[aString].grip(); - } - - let actor = new LongStringActor(aString, this); - aPool.addActor(actor); - aPool.longStringActors[aString] = actor; - return actor.grip(); - }, - - /** - * Create a long string grip that is scoped to a pause. - * - * @param aString String - * The string we are creating a grip for. - */ - pauseLongStringGrip: function TA_pauseLongStringGrip (aString) { - return this.longStringGrip(aString, this._pausePool); - }, - - /** - * Create a long string grip that is scoped to a thread. - * - * @param aString String - * The string we are creating a grip for. - */ - threadLongStringGrip: function TA_pauseLongStringGrip (aString) { - return this.longStringGrip(aString, this._threadLifetimePool); - }, - - /** - * Returns true if the string is long enough to use a LongStringActor instead - * of passing the value directly over the protocol. - * - * @param aString String - * The string we are checking the length of. - */ - _stringIsLong: function TA__stringIsLong(aString) { - return aString.length >= DebuggerServer.LONG_STRING_LENGTH; - }, - - // JS Debugger API hooks. - - /** - * A function that the engine calls when a call to a debug event hook, - * breakpoint handler, watchpoint handler, or similar function throws some - * exception. - * - * @param aException exception - * The exception that was thrown in the debugger code. - */ - uncaughtExceptionHook: function TA_uncaughtExceptionHook(aException) { - dumpn("Got an exception: " + aException.message + "\n" + aException.stack); - }, - - /** - * A function that the engine calls when a debugger statement has been - * executed in the specified frame. - * - * @param aFrame Debugger.Frame - * The stack frame that contained the debugger statement. - */ - onDebuggerStatement: function TA_onDebuggerStatement(aFrame) { - if (this.sources.isBlackBoxed(aFrame.script.url)) { - return undefined; - } - return this._pauseAndRespond(aFrame, { type: "debuggerStatement" }); - }, - - /** - * A function that the engine calls when an exception has been thrown and has - * propagated to the specified frame. - * - * @param aFrame Debugger.Frame - * The youngest remaining stack frame. - * @param aValue object - * The exception that was thrown. - */ - onExceptionUnwind: function TA_onExceptionUnwind(aFrame, aValue) { - if (this.sources.isBlackBoxed(aFrame.script.url)) { - return undefined; - } - try { - let packet = this._paused(aFrame); - if (!packet) { - return undefined; - } - - packet.why = { type: "exception", - exception: this.createValueGrip(aValue) }; - this.conn.send(packet); - return this._nest(); - } catch(e) { - log("Got an exception during TA_onExceptionUnwind: " + e + - ": " + e.stack); - return undefined; - } - }, - - /** - * A function that the engine calls when a new script has been loaded into the - * scope of the specified debuggee global. - * - * @param aScript Debugger.Script - * The source script that has been loaded into a debuggee compartment. - * @param aGlobal Debugger.Object - * A Debugger.Object instance whose referent is the global object. - */ - onNewScript: function TA_onNewScript(aScript, aGlobal) { - this._addScript(aScript); - this.sources.sourcesForScript(aScript); - }, - - onNewSource: function TA_onNewSource(aSource) { - this.conn.send({ - from: this.actorID, - type: "newSource", - source: aSource.form() - }); - }, - - /** - * Check if scripts from the provided source URL are allowed to be stored in - * the cache. - * - * @param aSourceUrl String - * The url of the script's source that will be stored. - * @returns true, if the script can be added, false otherwise. - */ - _allowSource: function TA__allowSource(aSourceUrl) { - // Ignore anything we don't have a URL for (eval scripts, for example). - if (!aSourceUrl) - return false; - // Ignore XBL bindings for content debugging. - if (aSourceUrl.indexOf("chrome://") == 0) { - return false; - } - // Ignore about:* pages for content debugging. - if (aSourceUrl.indexOf("about:") == 0) { - return false; - } - return true; - }, - - /** - * Restore any pre-existing breakpoints to the scripts that we have access to. - */ - _restoreBreakpoints: function TA__restoreBreakpoints() { - for (let s of this.dbg.findScripts()) { - this._addScript(s); - } - }, - - /** - * Add the provided script to the server cache. - * - * @param aScript Debugger.Script - * The source script that will be stored. - * @returns true, if the script was added; false otherwise. - */ - _addScript: function TA__addScript(aScript) { - if (!this._allowSource(aScript.url)) { - return false; - } - - // Set any stored breakpoints. - let existing = this._breakpointStore[aScript.url]; - if (existing) { - let endLine = aScript.startLine + aScript.lineCount - 1; - // Iterate over the lines backwards, so that sliding breakpoints don't - // affect the loop. - for (let line = existing.length - 1; line >= aScript.startLine; line--) { - let bp = existing[line]; - // Only consider breakpoints that are not already associated with - // scripts, and limit search to the line numbers contained in the new - // script. - if (bp && !bp.actor.scripts.length && line <= endLine) { - this._setBreakpoint(bp); - } - } - } - return true; - }, - -}; - -ThreadActor.prototype.requestTypes = { - "attach": ThreadActor.prototype.onAttach, - "detach": ThreadActor.prototype.onDetach, - "reconfigure": ThreadActor.prototype.onReconfigure, - "resume": ThreadActor.prototype.onResume, - "clientEvaluate": ThreadActor.prototype.onClientEvaluate, - "frames": ThreadActor.prototype.onFrames, - "interrupt": ThreadActor.prototype.onInterrupt, - "releaseMany": ThreadActor.prototype.onReleaseMany, - "setBreakpoint": ThreadActor.prototype.onSetBreakpoint, - "sources": ThreadActor.prototype.onSources, - "threadGrips": ThreadActor.prototype.onThreadGrips -}; - - -/** - * Creates a PauseActor. - * - * PauseActors exist for the lifetime of a given debuggee pause. Used to - * scope pause-lifetime grips. - * - * @param ActorPool aPool - * The actor pool created for this pause. - */ -function PauseActor(aPool) -{ - this.pool = aPool; -} - -PauseActor.prototype = { - actorPrefix: "pause" -}; - - -/** - * A base actor for any actors that should only respond receive messages in the - * paused state. Subclasses may expose a `threadActor` which is used to help - * determine when we are in a paused state. Subclasses should set their own - * "constructor" property if they want better error messages. You should never - * instantiate a PauseScopedActor directly, only through subclasses. - */ -function PauseScopedActor() -{ -} - -/** - * A function decorator for creating methods to handle protocol messages that - * should only be received while in the paused state. - * - * @param aMethod Function - * The function we are decorating. - */ -PauseScopedActor.withPaused = function PSA_withPaused(aMethod) { - return function () { - if (this.isPaused()) { - return aMethod.apply(this, arguments); - } else { - return this._wrongState(); - } - }; -}; - -PauseScopedActor.prototype = { - - /** - * Returns true if we are in the paused state. - */ - isPaused: function PSA_isPaused() { - // When there is not a ThreadActor available (like in the webconsole) we - // have to be optimistic and assume that we are paused so that we can - // respond to requests. - return this.threadActor ? this.threadActor.state === "paused" : true; - }, - - /** - * Returns the wrongState response packet for this actor. - */ - _wrongState: function PSA_wrongState() { - return { - error: "wrongState", - message: this.constructor.name + - " actors can only be accessed while the thread is paused." - }; - } -}; - - -/** - * A SourceActor provides information about the source of a script. - * - * @param aUrl String - * The url of the source we are representing. - * @param aThreadActor ThreadActor - * The current thread actor. - * @param aSourceMap SourceMapConsumer - * Optional. The source map that introduced this source, if available. - */ -function SourceActor(aUrl, aThreadActor, aSourceMap=null) { - this._threadActor = aThreadActor; - this._url = aUrl; - this._sourceMap = aSourceMap; -} - -SourceActor.prototype = { - constructor: SourceActor, - actorPrefix: "source", - - get threadActor() this._threadActor, - get url() this._url, - - form: function SA_form() { - return { - actor: this.actorID, - url: this._url, - isBlackBoxed: this.threadActor.sources.isBlackBoxed(this.url) - // TODO bug 637572: introductionScript - }; - }, - - disconnect: function LSA_disconnect() { - if (this.registeredPool && this.registeredPool.sourceActors) { - delete this.registeredPool.sourceActors[this.actorID]; - } - }, - - /** - * Handler for the "source" packet. - */ - onSource: function SA_onSource(aRequest) { - let sourceContent = null; - if (this._sourceMap) { - sourceContent = this._sourceMap.sourceContentFor(this._url); - } - - if (sourceContent) { - return { - from: this.actorID, - source: this.threadActor.createValueGrip( - sourceContent, this.threadActor.threadLifetimePool) - }; - } - - // XXX bug 865252: Don't load from the cache if this is a source mapped - // source because we can't guarantee that the cache has the most up to date - // content for this source like we can if it isn't source mapped. - return fetch(this._url, { loadFromCache: !this._sourceMap }) - .then((aSource) => { - return this.threadActor.createValueGrip( - aSource, this.threadActor.threadLifetimePool); - }) - .then((aSourceGrip) => { - return { - from: this.actorID, - source: aSourceGrip - }; - }, (aError) => { - let msg = "Got an exception during SA_onSource: " + aError + - "\n" + aError.stack; - // Cu.reportError(msg); - dumpn(msg); - return { - "from": this.actorID, - "error": "loadSourceError", - "message": "Could not load the source for " + this._url + "." - }; - }); - }, - - /** - * Handler for the "blackbox" packet. - */ - onBlackBox: function SA_onBlackBox(aRequest) { - this.threadActor.sources.blackBox(this.url); - let packet = { - from: this.actorID - }; - if (this.threadActor.state == "paused" - && this.threadActor.youngestFrame - && this.threadActor.youngestFrame.script.url == this.url) { - packet.pausedInSource = true; - } - return packet; - }, - - /** - * Handler for the "unblackbox" packet. - */ - onUnblackBox: function SA_onUnblackBox(aRequest) { - this.threadActor.sources.unblackBox(this.url); - return { - from: this.actorID - }; - } -}; - -SourceActor.prototype.requestTypes = { - "source": SourceActor.prototype.onSource, - "blackbox": SourceActor.prototype.onBlackBox, - "unblackbox": SourceActor.prototype.onUnblackBox -}; - - -/** - * Creates an actor for the specified object. - * - * @param aObj Debugger.Object - * The debuggee object. - * @param aThreadActor ThreadActor - * The parent thread actor for this object. - */ -function ObjectActor(aObj, aThreadActor) -{ - this.obj = aObj; - this.threadActor = aThreadActor; -} - -ObjectActor.prototype = { - actorPrefix: "obj", - - /** - * Returns a grip for this actor for returning in a protocol message. - */ - grip: function OA_grip() { - let g = { - "type": "object", - "class": this.obj.class, - "actor": this.actorID, - "extensible": this.obj.isExtensible(), - "frozen": this.obj.isFrozen(), - "sealed": this.obj.isSealed() - }; - - // Add additional properties for functions. - if (this.obj.class === "Function") { - if (this.obj.name) { - g.name = this.obj.name; - } else if (this.obj.displayName) { - g.displayName = this.obj.displayName; - } - - // Check if the developer has added a de-facto standard displayName - // property for us to use. - let desc = this.obj.getOwnPropertyDescriptor("displayName"); - if (desc && desc.value && typeof desc.value == "string") { - g.userDisplayName = this.threadActor.createValueGrip(desc.value); - } - } - - return g; - }, - - /** - * Releases this actor from the pool. - */ - release: function OA_release() { - if (this.registeredPool.objectActors) { - this.registeredPool.objectActors.delete(this.obj); - } - this.registeredPool.removeActor(this); - }, - - /** - * Handle a protocol request to provide the names of the properties defined on - * the object and not its prototype. - * - * @param aRequest object - * The protocol request object. - */ - onOwnPropertyNames: function OA_onOwnPropertyNames(aRequest) { - return { from: this.actorID, - ownPropertyNames: this.obj.getOwnPropertyNames() }; - }, - - /** - * Handle a protocol request to provide the prototype and own properties of - * the object. - * - * @param aRequest object - * The protocol request object. - */ - onPrototypeAndProperties: function OA_onPrototypeAndProperties(aRequest) { - let ownProperties = Object.create(null); - let names; - try { - names = this.obj.getOwnPropertyNames(); - } catch (ex) { - // The above can throw if this.obj points to a dead object. - // TODO: we should use Cu.isDeadWrapper() - see bug 885800. - return { from: this.actorID, - prototype: this.threadActor.createValueGrip(null), - ownProperties: ownProperties, - safeGetterValues: Object.create(null) }; - } - for (let name of names) { - ownProperties[name] = this._propertyDescriptor(name); - } - return { from: this.actorID, - prototype: this.threadActor.createValueGrip(this.obj.proto), - ownProperties: ownProperties, - safeGetterValues: this._findSafeGetterValues(ownProperties) }; - }, - - /** - * Find the safe getter values for the current Debugger.Object, |this.obj|. - * - * @private - * @param object aOwnProperties - * The object that holds the list of known ownProperties for - * |this.obj|. - * @return object - * An object that maps property names to safe getter descriptors as - * defined by the remote debugging protocol. - */ - _findSafeGetterValues: function OA__findSafeGetterValues(aOwnProperties) - { - let safeGetterValues = Object.create(null); - let obj = this.obj; - let level = 0; - - while (obj) { - let getters = this._findSafeGetters(obj); - for (let name of getters) { - // Avoid overwriting properties from prototypes closer to this.obj. Also - // avoid providing safeGetterValues from prototypes if property |name| - // is already defined as an own property. - if (name in safeGetterValues || - (obj != this.obj && name in aOwnProperties)) { - continue; - } - - let desc = null, getter = null; - try { - desc = obj.getOwnPropertyDescriptor(name); - getter = desc.get; - } catch (ex) { - // The above can throw if the cache becomes stale. - } - if (!getter) { - obj._safeGetters = null; - continue; - } - - let result = getter.call(this.obj); - if (result && !("throw" in result)) { - let getterValue = undefined; - if ("return" in result) { - getterValue = result.return; - } else if ("yield" in result) { - getterValue = result.yield; - } - // WebIDL attributes specified with the LenientThis extended attribute - // return undefined and should be ignored. - if (getterValue !== undefined) { - safeGetterValues[name] = { - getterValue: this.threadActor.createValueGrip(getterValue), - getterPrototypeLevel: level, - enumerable: desc.enumerable, - writable: level == 0 ? desc.writable : true, - }; - } - } - } - - obj = obj.proto; - level++; - } - - return safeGetterValues; - }, - - /** - * Find the safe getters for a given Debugger.Object. Safe getters are native - * getters which are safe to execute. - * - * @private - * @param Debugger.Object aObject - * The Debugger.Object where you want to find safe getters. - * @return Set - * A Set of names of safe getters. This result is cached for each - * Debugger.Object. - */ - _findSafeGetters: function OA__findSafeGetters(aObject) - { - if (aObject._safeGetters) { - return aObject._safeGetters; - } - - let getters = new Set(); - for (let name of aObject.getOwnPropertyNames()) { - let desc = null; - try { - desc = aObject.getOwnPropertyDescriptor(name); - } catch (e) { - // Calling getOwnPropertyDescriptor on wrapped native prototypes is not - // allowed (bug 560072). - } - if (!desc || desc.value !== undefined || !("get" in desc)) { - continue; - } - - let fn = desc.get; - if (fn && fn.callable && fn.class == "Function" && - fn.script === undefined) { - getters.add(name); - } - } - - aObject._safeGetters = getters; - return getters; - }, - - /** - * Handle a protocol request to provide the prototype of the object. - * - * @param aRequest object - * The protocol request object. - */ - onPrototype: function OA_onPrototype(aRequest) { - return { from: this.actorID, - prototype: this.threadActor.createValueGrip(this.obj.proto) }; - }, - - /** - * Handle a protocol request to provide the property descriptor of the - * object's specified property. - * - * @param aRequest object - * The protocol request object. - */ - onProperty: function OA_onProperty(aRequest) { - if (!aRequest.name) { - return { error: "missingParameter", - message: "no property name was specified" }; - } - - return { from: this.actorID, - descriptor: this._propertyDescriptor(aRequest.name) }; - }, - - /** - * A helper method that creates a property descriptor for the provided object, - * properly formatted for sending in a protocol response. - * - * @param string aName - * The property that the descriptor is generated for. - */ - _propertyDescriptor: function OA_propertyDescriptor(aName) { - let desc; - try { - desc = this.obj.getOwnPropertyDescriptor(aName); - } catch (e) { - // Calling getOwnPropertyDescriptor on wrapped native prototypes is not - // allowed (bug 560072). Inform the user with a bogus, but hopefully - // explanatory, descriptor. - return { - configurable: false, - writable: false, - enumerable: false, - value: e.name - }; - } - - let retval = { - configurable: desc.configurable, - enumerable: desc.enumerable - }; - - if ("value" in desc) { - retval.writable = desc.writable; - retval.value = this.threadActor.createValueGrip(desc.value); - } else { - if ("get" in desc) { - retval.get = this.threadActor.createValueGrip(desc.get); - } - if ("set" in desc) { - retval.set = this.threadActor.createValueGrip(desc.set); - } - } - return retval; - }, - - /** - * Handle a protocol request to provide the source code of a function. - * - * @param aRequest object - * The protocol request object. - */ - onDecompile: function OA_onDecompile(aRequest) { - if (this.obj.class !== "Function") { - return { error: "objectNotFunction", - message: "decompile request is only valid for object grips " + - "with a 'Function' class." }; - } - - return { from: this.actorID, - decompiledCode: this.obj.decompile(!!aRequest.pretty) }; - }, - - /** - * Handle a protocol request to provide the parameters of a function. - * - * @param aRequest object - * The protocol request object. - */ - onParameterNames: function OA_onParameterNames(aRequest) { - if (this.obj.class !== "Function") { - return { error: "objectNotFunction", - message: "'parameterNames' request is only valid for object " + - "grips with a 'Function' class." }; - } - - return { parameterNames: this.obj.parameterNames }; - }, - - /** - * Handle a protocol request to release a thread-lifetime grip. - * - * @param aRequest object - * The protocol request object. - */ - onRelease: function OA_onRelease(aRequest) { - this.release(); - return {}; - }, -}; - -ObjectActor.prototype.requestTypes = { - "parameterNames": ObjectActor.prototype.onParameterNames, - "prototypeAndProperties": ObjectActor.prototype.onPrototypeAndProperties, - "prototype": ObjectActor.prototype.onPrototype, - "property": ObjectActor.prototype.onProperty, - "ownPropertyNames": ObjectActor.prototype.onOwnPropertyNames, - "decompile": ObjectActor.prototype.onDecompile, - "release": ObjectActor.prototype.onRelease, -}; - - -/** - * Creates a pause-scoped actor for the specified object. - * @see ObjectActor - */ -function PauseScopedObjectActor() -{ - ObjectActor.apply(this, arguments); -} - -PauseScopedObjectActor.prototype = Object.create(PauseScopedActor.prototype); - -update(PauseScopedObjectActor.prototype, ObjectActor.prototype); - -update(PauseScopedObjectActor.prototype, { - constructor: PauseScopedObjectActor, - - onOwnPropertyNames: - PauseScopedActor.withPaused(ObjectActor.prototype.onOwnPropertyNames), - - onPrototypeAndProperties: - PauseScopedActor.withPaused(ObjectActor.prototype.onPrototypeAndProperties), - - onPrototype: PauseScopedActor.withPaused(ObjectActor.prototype.onPrototype), - onProperty: PauseScopedActor.withPaused(ObjectActor.prototype.onProperty), - onDecompile: PauseScopedActor.withPaused(ObjectActor.prototype.onDecompile), - - onParameterNames: - PauseScopedActor.withPaused(ObjectActor.prototype.onParameterNames), - - /** - * Handle a protocol request to provide the lexical scope of a function. - * - * @param aRequest object - * The protocol request object. - */ - onScope: PauseScopedActor.withPaused(function OA_onScope(aRequest) { - if (this.obj.class !== "Function") { - return { error: "objectNotFunction", - message: "scope request is only valid for object grips with a" + - " 'Function' class." }; - } - - let envActor = this.threadActor.createEnvironmentActor(this.obj.environment, - this.registeredPool); - if (!envActor) { - return { error: "notDebuggee", - message: "cannot access the environment of this function." }; - } - - return { from: this.actorID, scope: envActor.form() }; - }), - - /** - * Handle a protocol request to promote a pause-lifetime grip to a - * thread-lifetime grip. - * - * @param aRequest object - * The protocol request object. - */ - onThreadGrip: PauseScopedActor.withPaused(function OA_onThreadGrip(aRequest) { - this.threadActor.threadObjectGrip(this); - return {}; - }), - - /** - * Handle a protocol request to release a thread-lifetime grip. - * - * @param aRequest object - * The protocol request object. - */ - onRelease: PauseScopedActor.withPaused(function OA_onRelease(aRequest) { - if (this.registeredPool !== this.threadActor.threadLifetimePool) { - return { error: "notReleasable", - message: "Only thread-lifetime actors can be released." }; - } - - this.release(); - return {}; - }), -}); - -update(PauseScopedObjectActor.prototype.requestTypes, { - "scope": PauseScopedObjectActor.prototype.onScope, - "threadGrip": PauseScopedObjectActor.prototype.onThreadGrip, -}); - - -/** - * Creates an actor for the specied "very long" string. "Very long" is specified - * at the server's discretion. - * - * @param aString String - * The string. - */ -function LongStringActor(aString) -{ - this.string = aString; - this.stringLength = aString.length; -} - -LongStringActor.prototype = { - - actorPrefix: "longString", - - disconnect: function LSA_disconnect() { - // Because longStringActors is not a weak map, we won't automatically leave - // it so we need to manually leave on disconnect so that we don't leak - // memory. - if (this.registeredPool && this.registeredPool.longStringActors) { - delete this.registeredPool.longStringActors[this.actorID]; - } - }, - - /** - * Returns a grip for this actor for returning in a protocol message. - */ - grip: function LSA_grip() { - return { - "type": "longString", - "initial": this.string.substring( - 0, DebuggerServer.LONG_STRING_INITIAL_LENGTH), - "length": this.stringLength, - "actor": this.actorID - }; - }, - - /** - * Handle a request to extract part of this actor's string. - * - * @param aRequest object - * The protocol request object. - */ - onSubstring: function LSA_onSubString(aRequest) { - return { - "from": this.actorID, - "substring": this.string.substring(aRequest.start, aRequest.end) - }; - }, - - /** - * Handle a request to release this LongStringActor instance. - */ - onRelease: function LSA_onRelease() { - // TODO: also check if registeredPool === threadActor.threadLifetimePool - // when the web console moves aray from manually releasing pause-scoped - // actors. - if (this.registeredPool.longStringActors) { - delete this.registeredPool.longStringActors[this.actorID]; - } - this.registeredPool.removeActor(this); - return {}; - }, -}; - -LongStringActor.prototype.requestTypes = { - "substring": LongStringActor.prototype.onSubstring, - "release": LongStringActor.prototype.onRelease -}; - - -/** - * Creates an actor for the specified stack frame. - * - * @param aFrame Debugger.Frame - * The debuggee frame. - * @param aThreadActor ThreadActor - * The parent thread actor for this frame. - */ -function FrameActor(aFrame, aThreadActor) -{ - this.frame = aFrame; - this.threadActor = aThreadActor; -} - -FrameActor.prototype = { - actorPrefix: "frame", - - /** - * A pool that contains frame-lifetime objects, like the environment. - */ - _frameLifetimePool: null, - get frameLifetimePool() { - if (!this._frameLifetimePool) { - this._frameLifetimePool = new ActorPool(this.conn); - this.conn.addActorPool(this._frameLifetimePool); - } - return this._frameLifetimePool; - }, - - /** - * Finalization handler that is called when the actor is being evicted from - * the pool. - */ - disconnect: function FA_disconnect() { - this.conn.removeActorPool(this._frameLifetimePool); - this._frameLifetimePool = null; - }, - - /** - * Returns a frame form for use in a protocol message. - */ - form: function FA_form() { - let form = { actor: this.actorID, - type: this.frame.type }; - if (this.frame.type === "call") { - form.callee = this.threadActor.createValueGrip(this.frame.callee); - } - - if (this.frame.environment) { - let envActor = this.threadActor - .createEnvironmentActor(this.frame.environment, - this.frameLifetimePool); - form.environment = envActor.form(); - } - form.this = this.threadActor.createValueGrip(this.frame.this); - form.arguments = this._args(); - if (this.frame.script) { - form.where = { url: this.frame.script.url, - line: this.frame.script.getOffsetLine(this.frame.offset) }; - form.isBlackBoxed = this.threadActor.sources.isBlackBoxed(this.frame.script.url) - } - - if (!this.frame.older) { - form.oldest = true; - } - - return form; - }, - - _args: function FA__args() { - if (!this.frame.arguments) { - return []; - } - - return [this.threadActor.createValueGrip(arg) - for each (arg in this.frame.arguments)]; - }, - - /** - * Handle a protocol request to pop this frame from the stack. - * - * @param aRequest object - * The protocol request object. - */ - onPop: function FA_onPop(aRequest) { - // TODO: remove this when Debugger.Frame.prototype.pop is implemented - if (typeof this.frame.pop != "function") { - return { error: "notImplemented", - message: "Popping frames is not yet implemented." }; - } - - while (this.frame != this.threadActor.dbg.getNewestFrame()) { - this.threadActor.dbg.getNewestFrame().pop(); - } - this.frame.pop(aRequest.completionValue); - - // TODO: return the watches property when frame pop watch actors are - // implemented. - return { from: this.actorID }; - } -}; - -FrameActor.prototype.requestTypes = { - "pop": FrameActor.prototype.onPop, -}; - - -/** - * Creates a BreakpointActor. BreakpointActors exist for the lifetime of their - * containing thread and are responsible for deleting breakpoints, handling - * breakpoint hits and associating breakpoints with scripts. - * - * @param ThreadActor aThreadActor - * The parent thread actor that contains this breakpoint. - * @param object aLocation - * The location of the breakpoint as specified in the protocol. - */ -function BreakpointActor(aThreadActor, aLocation) -{ - this.scripts = []; - this.threadActor = aThreadActor; - this.location = aLocation; -} - -BreakpointActor.prototype = { - actorPrefix: "breakpoint", - - /** - * Called when this same breakpoint is added to another Debugger.Script - * instance, in the case of a page reload. - * - * @param aScript Debugger.Script - * The new source script on which the breakpoint has been set. - * @param ThreadActor aThreadActor - * The parent thread actor that contains this breakpoint. - */ - addScript: function BA_addScript(aScript, aThreadActor) { - this.threadActor = aThreadActor; - this.scripts.push(aScript); - }, - - /** - * Remove the breakpoints from associated scripts and clear the script cache. - */ - removeScripts: function () { - for (let script of this.scripts) { - script.clearBreakpoint(this); - } - this.scripts = []; - }, - - /** - * A function that the engine calls when a breakpoint has been hit. - * - * @param aFrame Debugger.Frame - * The stack frame that contained the breakpoint. - */ - hit: function BA_hit(aFrame) { - if (this.threadActor.sources.isBlackBoxed(this.location.url)) { - return undefined; - } - - // TODO: add the rest of the breakpoints on that line (bug 676602). - let reason = { type: "breakpoint", actors: [ this.actorID ] }; - return this.threadActor._pauseAndRespond(aFrame, reason, (aPacket) => { - log("pause callback ..."); - - let { url, line } = aPacket.frame.where; - return this.threadActor.sources.getOriginalLocation(url, line) - .then(function (aOrigPosition) { - aPacket.frame.where = aOrigPosition; - return aPacket; - }); - }); - }, - - /** - * Handle a protocol request to remove this breakpoint. - * - * @param aRequest object - * The protocol request object. - */ - onDelete: function BA_onDelete(aRequest) { - // Remove from the breakpoint store. - let scriptBreakpoints = this.threadActor._breakpointStore[this.location.url]; - delete scriptBreakpoints[this.location.line]; - this.threadActor._hooks.removeFromParentPool(this); - // Remove the actual breakpoint from the associated scripts. - this.removeScripts(); - - return { from: this.actorID }; - } -}; - -BreakpointActor.prototype.requestTypes = { - "delete": BreakpointActor.prototype.onDelete -}; - - -/** - * Creates an EnvironmentActor. EnvironmentActors are responsible for listing - * the bindings introduced by a lexical environment and assigning new values to - * those identifier bindings. - * - * @param Debugger.Environment aEnvironment - * The lexical environment that will be used to create the actor. - * @param ThreadActor aThreadActor - * The parent thread actor that contains this environment. - */ -function EnvironmentActor(aEnvironment, aThreadActor) -{ - this.obj = aEnvironment; - this.threadActor = aThreadActor; -} - -EnvironmentActor.prototype = { - actorPrefix: "environment", - - /** - * Return an environment form for use in a protocol message. - */ - form: function EA_form() { - let form = { actor: this.actorID }; - - // What is this environment's type? - if (this.obj.type == "declarative") { - form.type = this.obj.callee ? "function" : "block"; - } else { - form.type = this.obj.type; - } - - // Does this environment have a parent? - if (this.obj.parent) { - form.parent = (this.threadActor - .createEnvironmentActor(this.obj.parent, - this.registeredPool) - .form()); - } - - // Does this environment reflect the properties of an object as variables? - if (this.obj.type == "object" || this.obj.type == "with") { - form.object = this.threadActor.createValueGrip(this.obj.object); - } - - // Is this the environment created for a function call? - if (this.obj.callee) { - form.function = this.threadActor.createValueGrip(this.obj.callee); - } - - // Shall we list this environment's bindings? - if (this.obj.type == "declarative") { - form.bindings = this._bindings(); - } - - return form; - }, - - /** - * Return the identifier bindings object as required by the remote protocol - * specification. - */ - _bindings: function EA_bindings() { - let bindings = { arguments: [], variables: {} }; - - // TODO: this part should be removed in favor of the commented-out part - // below when getVariableDescriptor lands (bug 725815). - if (typeof this.obj.getVariable != "function") { - //if (typeof this.obj.getVariableDescriptor != "function") { - return bindings; - } - - let parameterNames; - if (this.obj.callee) { - parameterNames = this.obj.callee.parameterNames; - } - for each (let name in parameterNames) { - let arg = {}; - // TODO: this part should be removed in favor of the commented-out part - // below when getVariableDescriptor lands (bug 725815). - let desc = { - value: this.obj.getVariable(name), - configurable: false, - writable: true, - enumerable: true - }; - - // let desc = this.obj.getVariableDescriptor(name); - let descForm = { - enumerable: true, - configurable: desc.configurable - }; - if ("value" in desc) { - descForm.value = this.threadActor.createValueGrip(desc.value); - descForm.writable = desc.writable; - } else { - descForm.get = this.threadActor.createValueGrip(desc.get); - descForm.set = this.threadActor.createValueGrip(desc.set); - } - arg[name] = descForm; - bindings.arguments.push(arg); - } - - for each (let name in this.obj.names()) { - if (bindings.arguments.some(function exists(element) { - return !!element[name]; - })) { - continue; - } - - // TODO: this part should be removed in favor of the commented-out part - // below when getVariableDescriptor lands. - let desc = { - configurable: false, - writable: true, - enumerable: true - }; - try { - desc.value = this.obj.getVariable(name); - } catch (e) { - // Avoid "Debugger scope is not live" errors for |arguments|, introduced - // in bug 746601. - if (name != "arguments") { - throw e; - } - } - //let desc = this.obj.getVariableDescriptor(name); - let descForm = { - enumerable: true, - configurable: desc.configurable - }; - if ("value" in desc) { - descForm.value = this.threadActor.createValueGrip(desc.value); - descForm.writable = desc.writable; - } else { - descForm.get = this.threadActor.createValueGrip(desc.get); - descForm.set = this.threadActor.createValueGrip(desc.set); - } - bindings.variables[name] = descForm; - } - - return bindings; - }, - - /** - * Handle a protocol request to change the value of a variable bound in this - * lexical environment. - * - * @param aRequest object - * The protocol request object. - */ - onAssign: function EA_onAssign(aRequest) { - // TODO: enable the commented-out part when getVariableDescriptor lands - // (bug 725815). - /*let desc = this.obj.getVariableDescriptor(aRequest.name); - - if (!desc.writable) { - return { error: "immutableBinding", - message: "Changing the value of an immutable binding is not " + - "allowed" }; - }*/ - - try { - this.obj.setVariable(aRequest.name, aRequest.value); - } catch (e) { - if (e instanceof Debugger.DebuggeeWouldRun) { - return { error: "threadWouldRun", - cause: e.cause ? e.cause : "setter", - message: "Assigning a value would cause the debuggee to run" }; - } - // This should never happen, so let it complain loudly if it does. - throw e; - } - return { from: this.actorID }; - }, - - /** - * Handle a protocol request to fully enumerate the bindings introduced by the - * lexical environment. - * - * @param aRequest object - * The protocol request object. - */ - onBindings: function EA_onBindings(aRequest) { - return { from: this.actorID, - bindings: this._bindings() }; - } -}; - -EnvironmentActor.prototype.requestTypes = { - "assign": EnvironmentActor.prototype.onAssign, - "bindings": EnvironmentActor.prototype.onBindings -}; - -/** - * Override the toString method in order to get more meaningful script output - * for debugging the debugger. - */ -Debugger.Script.prototype.toString = function() { - let output = ""; - if (this.url) { - output += this.url; - } - if (typeof this.startLine != "undefined") { - output += ":" + this.startLine; - if (this.lineCount && this.lineCount > 1) { - output += "-" + (this.startLine + this.lineCount - 1); - } - } - if (this.strictMode) { - output += ":strict"; - } - return output; -}; - -/** - * Helper property for quickly getting to the line number a stack frame is - * currently paused at. - */ -Object.defineProperty(Debugger.Frame.prototype, "line", { - configurable: true, - get: function() { - if (this.script) { - return this.script.getOffsetLine(this.offset); - } else { - return null; - } - } -}); - - -/** - * Creates an actor for handling chrome debugging. ChromeDebuggerActor is a - * thin wrapper over ThreadActor, slightly changing some of its behavior. - * - * @param aConnection object - * The DebuggerServerConnection with which this ChromeDebuggerActor - * is associated. (Currently unused, but required to make this - * constructor usable with addGlobalActor.) - * - * @param aHooks object - * An object with preNest and postNest methods for calling when entering - * and exiting a nested event loop and also addToParentPool and - * removeFromParentPool methods for handling the lifetime of actors that - * will outlive the thread, like breakpoints. - */ -function ChromeDebuggerActor(aConnection, aHooks) -{ - ThreadActor.call(this, aHooks); -} - -ChromeDebuggerActor.prototype = Object.create(ThreadActor.prototype); - -update(ChromeDebuggerActor.prototype, { - constructor: ChromeDebuggerActor, - - // A constant prefix that will be used to form the actor ID by the server. - actorPrefix: "chromeDebugger", - - /** - * Override the eligibility check for scripts and sources to make sure every - * script and source with a URL is stored when debugging chrome. - */ - _allowSource: function(aSourceURL) !!aSourceURL, - - /** - * An object that will be used by ThreadActors to tailor their behavior - * depending on the debugging context being required (chrome or content). - * The methods that this object provides must be bound to the ThreadActor - * before use. - */ - globalManager: { - findGlobals: function CDA_findGlobals() { - // Add every global known to the debugger as debuggee. - this.dbg.addAllGlobalsAsDebuggees(); - }, - - /** - * A function that the engine calls when a new global object has been - * created. - * - * @param aGlobal Debugger.Object - * The new global object that was created. - */ - onNewGlobal: function CDA_onNewGlobal(aGlobal) { - this.addDebuggee(aGlobal); - // Notify the client. - this.conn.send({ - from: this.actorID, - type: "newGlobal", - // TODO: after bug 801084 lands see if we need to JSONify this. - hostAnnotations: aGlobal.hostAnnotations - }); - } - } -}); - - -/** - * Manages the sources for a thread. Handles source maps, locations in the - * sources, etc for ThreadActors. - */ -function ThreadSources(aThreadActor, aUseSourceMaps, aAllowPredicate, - aOnNewSource) { - this._thread = aThreadActor; - this._useSourceMaps = aUseSourceMaps; - this._allow = aAllowPredicate; - this._onNewSource = aOnNewSource; - - // source map URL --> promise of SourceMapConsumer - this._sourceMaps = Object.create(null); - // generated source url --> promise of SourceMapConsumer - this._sourceMapsByGeneratedSource = Object.create(null); - // original source url --> promise of SourceMapConsumer - this._sourceMapsByOriginalSource = Object.create(null); - // source url --> SourceActor - this._sourceActors = Object.create(null); - // original url --> generated url - this._generatedUrlsByOriginalUrl = Object.create(null); -} - -/** - * Must be a class property because it needs to persist across reloads, same as - * the breakpoint store. - */ -ThreadSources._blackBoxedSources = new Set(); - -ThreadSources.prototype = { - /** - * Return the source actor representing |aURL|, creating one if none - * exists already. Returns null if |aURL| is not allowed by the 'allow' - * predicate. - * - * Right now this takes a URL, but in the future it should - * take a Debugger.Source. See bug 637572. - * - * @param String aURL - * The source URL. - * @param optional SourceMapConsumer aSourceMap - * The source map that introduced this source, if any. - * @returns a SourceActor representing the source at aURL or null. - */ - source: function TS_source(aURL, aSourceMap=null) { - if (!this._allow(aURL)) { - return null; - } - - if (aURL in this._sourceActors) { - return this._sourceActors[aURL]; - } - - let actor = new SourceActor(aURL, this._thread, aSourceMap); - this._thread.threadLifetimePool.addActor(actor); - this._sourceActors[aURL] = actor; - try { - this._onNewSource(actor); - } catch (e) { - reportError(e); - } - return actor; - }, - - /** - * Return a promise of an array of source actors representing all the - * sources of |aScript|. - * - * If source map handling is enabled and |aScript| has a source map, then - * use it to find all of |aScript|'s *original* sources; return a promise - * of an array of source actors for those. - */ - sourcesForScript: function TS_sourcesForScript(aScript) { - if (!this._useSourceMaps || !aScript.sourceMapURL) { - return resolve([this.source(aScript.url)].filter(isNotNull)); - } - - return this.sourceMap(aScript) - .then((aSourceMap) => { - return [ - this.source(s, aSourceMap) for (s of aSourceMap.sources) - ]; - }) - .then(null, (e) => { - reportError(e); - delete this._sourceMaps[this._normalize(aScript.sourceMapURL, aScript.url)]; - delete this._sourceMapsByGeneratedSource[aScript.url]; - return [this.source(aScript.url)]; - }) - .then(function (aSources) { - return aSources.filter(isNotNull); - }); - }, - - /** - * Return a promise of a SourceMapConsumer for the source map for - * |aScript|; if we already have such a promise extant, return that. - * |aScript| must have a non-null sourceMapURL. - */ - sourceMap: function TS_sourceMap(aScript) { - if (aScript.url in this._sourceMapsByGeneratedSource) { - return this._sourceMapsByGeneratedSource[aScript.url]; - } - dbg_assert(aScript.sourceMapURL); - let sourceMapURL = this._normalize(aScript.sourceMapURL, aScript.url); - let map = this._fetchSourceMap(sourceMapURL) - .then((aSourceMap) => { - for (let s of aSourceMap.sources) { - this._generatedUrlsByOriginalUrl[s] = aScript.url; - this._sourceMapsByOriginalSource[s] = resolve(aSourceMap); - } - return aSourceMap; - }); - this._sourceMapsByGeneratedSource[aScript.url] = map; - return map; - }, - - /** - * Return a promise of a SourceMapConsumer for the source map located at - * |aAbsSourceMapURL|, which must be absolute. If there is already such a - * promise extant, return it. - */ - _fetchSourceMap: function TS__fetchSourceMap(aAbsSourceMapURL) { - if (aAbsSourceMapURL in this._sourceMaps) { - return this._sourceMaps[aAbsSourceMapURL]; - } else { - let promise = fetch(aAbsSourceMapURL).then((rawSourceMap) => { - let map = new SourceMapConsumer(rawSourceMap); - let base = aAbsSourceMapURL.replace(/\/[^\/]+$/, '/'); - if (base.indexOf("data:") !== 0) { - map.sourceRoot = map.sourceRoot - ? this._normalize(map.sourceRoot, base) - : base; - } - return map; - }); - this._sourceMaps[aAbsSourceMapURL] = promise; - return promise; - } - }, - - /** - * Returns a promise of the location in the original source if the source is - * source mapped, otherwise a promise of the same location. - * - * TODO bug 637572: take/return a column - */ - getOriginalLocation: function TS_getOriginalLocation(aSourceUrl, aLine) { - if (aSourceUrl in this._sourceMapsByGeneratedSource) { - return this._sourceMapsByGeneratedSource[aSourceUrl] - .then(function (aSourceMap) { - let { source, line } = aSourceMap.originalPositionFor({ - source: aSourceUrl, - line: aLine, - column: Infinity - }); - return { - url: source, - line: line - }; - }); - } - - // No source map - return resolve({ - url: aSourceUrl, - line: aLine - }); - }, - - /** - * Returns a promise of the location in the generated source corresponding to - * the original source and line given. - * - * When we pass a script S representing generated code to |sourceMap|, - * above, that returns a promise P. The process of resolving P populates - * the tables this function uses; thus, it won't know that S's original - * source URLs map to S until P is resolved. - * - * TODO bug 637572: take/return a column - */ - getGeneratedLocation: function TS_getGeneratedLocation(aSourceUrl, aLine) { - if (aSourceUrl in this._sourceMapsByOriginalSource) { - return this._sourceMapsByOriginalSource[aSourceUrl] - .then((aSourceMap) => { - let { line } = aSourceMap.generatedPositionFor({ - source: aSourceUrl, - line: aLine, - column: Infinity - }); - return { - url: this._generatedUrlsByOriginalUrl[aSourceUrl], - line: line - }; - }); - } - - // No source map - return resolve({ - url: aSourceUrl, - line: aLine - }); - }, - - /** - * Returns true if URL for the given source is black boxed. - * - * @param aURL String - * The URL of the source which we are checking whether it is black - * boxed or not. - */ - isBlackBoxed: function TS_isBlackBoxed(aURL) { - return ThreadSources._blackBoxedSources.has(aURL); - }, - - /** - * Add the given source URL to the set of sources that are black boxed. If the - * thread is currently paused and we are black boxing the yougest frame's - * source, this will force a step. - * - * @param aURL String - * The URL of the source which we are black boxing. - */ - blackBox: function TS_blackBox(aURL) { - ThreadSources._blackBoxedSources.add(aURL); - }, - - /** - * Remove the given source URL to the set of sources that are black boxed. - * - * @param aURL String - * The URL of the source which we are no longer black boxing. - */ - unblackBox: function TS_unblackBox(aURL) { - ThreadSources._blackBoxedSources.delete(aURL); - }, - - /** - * Normalize multiple relative paths towards the base paths on the right. - */ - _normalize: function TS__normalize(...aURLs) { - dbg_assert(aURLs.length > 1); - let base = Services.io.newURI(aURLs.pop(), null, null); - let url; - while ((url = aURLs.pop())) { - base = Services.io.newURI(url, null, base); - } - return base.spec; - }, - - iter: function TS_iter() { - for (let url in this._sourceActors) { - yield this._sourceActors[url]; - } - } -}; - -// Utility functions. - -/** - * Utility function for updating an object with the properties of another - * object. - * - * @param aTarget Object - * The object being updated. - * @param aNewAttrs Object - * The new attributes being set on the target. - */ -function update(aTarget, aNewAttrs) { - for (let key in aNewAttrs) { - let desc = Object.getOwnPropertyDescriptor(aNewAttrs, key); - - if (desc) { - Object.defineProperty(aTarget, key, desc); - } - } -} - -/** - * Returns true if its argument is not null. - */ -function isNotNull(aThing) { - return aThing !== null; -} - -/** - * Performs a request to load the desired URL and returns a promise. - * - * @param aURL String - * The URL we will request. - * @returns Promise - * A promise of the document at that URL, as a string. - * - * XXX: It may be better to use nsITraceableChannel to get to the sources - * without relying on caching when we can (not for eval, etc.): - * http://www.softwareishard.com/blog/firebug/nsitraceablechannel-intercept-http-traffic/ - */ -function fetch(aURL, aOptions={ loadFromCache: true }) { - let deferred = defer(); - let scheme; - let url = aURL.split(" -> ").pop(); - let charset; - let filePath = url; - // try { - // scheme = Services.io.extractScheme(url); - // } catch (e) { - // In the xpcshell tests, the script url is the absolute path of the test - // file, which will make a malformed URI error be thrown. Add the file - // scheme prefix ourselves. - url = "file://" + url; - // scheme = Services.io.extractScheme(url); - // } - scheme = "file"; - - switch (scheme) { - case "file": - case "chrome": - case "resource": - try { - // NetUtil.asyncFetch(url, function onFetch(aStream, aStatus) { - // if (!Components.isSuccessCode(aStatus)) { - // deferred.reject("Request failed: " + url); - // return; - // } - let cc = globalDebuggee.cc; - let fileUtils = cc.FileUtils.getInstance(); - let source = fileUtils.getStringFromFile(filePath);//NetUtil.readInputStreamToString(aStream, aStream.available()); - if (!source) - { - deferred.reject("Request failed: " + url); - } - else - { - deferred.resolve(source); - } - // aStream.close(); - // }); - } catch (ex) { - deferred.reject("Request failed: " + url); - } - break; - - default: - let channel; - try { - channel = Services.io.newChannel(url, null, null); - } catch (e if e.name == "NS_ERROR_UNKNOWN_PROTOCOL") { - // On Windows xpcshell tests, c:/foo/bar can pass as a valid URL, but - // newChannel won't be able to handle it. - url = "file:///" + url; - channel = Services.io.newChannel(url, null, null); - } - let chunks = []; - let streamListener = { - onStartRequest: function(aRequest, aContext, aStatusCode) { - if (!Components.isSuccessCode(aStatusCode)) { - deferred.reject("Request failed: " + url); - } - }, - onDataAvailable: function(aRequest, aContext, aStream, aOffset, aCount) { - chunks.push(NetUtil.readInputStreamToString(aStream, aCount)); - }, - onStopRequest: function(aRequest, aContext, aStatusCode) { - if (!Components.isSuccessCode(aStatusCode)) { - deferred.reject("Request failed: " + url); - return; - } - - charset = channel.contentCharset; - deferred.resolve(chunks.join("")); - } - }; - - channel.loadFlags = aOptions.loadFromCache - ? channel.LOAD_FROM_CACHE - : channel.LOAD_BYPASS_CACHE; - channel.asyncOpen(streamListener, null); - break; - } - - return deferred.promise.then(function (source) { - return convertToUnicode(source, charset); - }); -} - -/** - * Convert a given string, encoded in a given character set, to unicode. - * - * @param string aString - * A string. - * @param string aCharset - * A character set. - */ -function convertToUnicode(aString, aCharset=null) { - // Decoding primitives. - // let converter = Cc["@mozilla.org/intl/scriptableunicodeconverter"] - // .createInstance(Ci.nsIScriptableUnicodeConverter); - // try { - // converter.charset = aCharset || "UTF-8"; - // return converter.ConvertToUnicode(aString); - // } catch(e) { - return aString; - // } -} - -/** - * Report the given error in the error console and to stdout. - */ -function reportError(aError) { - // Cu.reportError(aError); - dumpn(aError.message + ":\n" + aError.stack); -} diff --git a/scripting/javascript/bindings/js/debugger/core/promise.js b/scripting/javascript/bindings/js/debugger/core/promise.js deleted file mode 100644 index a695f5a3ad..0000000000 --- a/scripting/javascript/bindings/js/debugger/core/promise.js +++ /dev/null @@ -1,294 +0,0 @@ -/* vim:set ts=2 sw=2 sts=2 expandtab */ -/*jshint undef: true es5: true node: true browser: true devel: true - forin: true latedef: false */ -/*global define: true, Cu: true, __URI__: true */ -//;(function(id, factory) { // Module boilerplate :( -// if (typeof(define) === 'function') { // RequireJS -// define(factory); -// } else if (typeof(require) === 'function') { // CommonJS -// factory.call(this, require, exports, module); -// } else if (String(this).indexOf('BackstagePass') >= 0) { // JSM -// this[factory.name] = {}; -// try { -// this.console = this['Components'].utils -// .import('resource://gre/modules/devtools/Console.jsm', {}).console; -// } -// catch (ex) { -// // Avoid failures on different toolkit configurations. -// } -// factory(function require(uri) { -// var imports = {}; -// this['Components'].utils.import(uri, imports); -// return imports; -// }, this[factory.name], { uri: __URI__, id: id }); -// this.EXPORTED_SYMBOLS = [factory.name]; -// } else { // Browser or alike -// var globals = this; -// factory(function require(id) { -// return globals[id]; -// }, (globals[id] = {}), { uri: document.location.href + '#' + id, id: id }); -// } -//}).call(this, 'promise/core', function Promise(require, exports, module) { - -'use strict'; - -var exports = exports || {}; - -//module.metadata = { -// "stability": "unstable" -//}; - -/** - * Internal utility: Wraps given `value` into simplified promise, successfully - * fulfilled to a given `value`. Note the result is not a complete promise - * implementation, as its method `then` does not returns anything. - */ -function fulfilled(value) { - return { then: function then(fulfill) { fulfill(value); } }; -} - -/** - * Internal utility: Wraps given input into simplified promise, pre-rejected - * with a given `reason`. Note the result is not a complete promise - * implementation, as its method `then` does not returns anything. - */ -function rejected(reason) { - return { then: function then(fulfill, reject) { reject(reason); } }; -} - -/** - * Internal utility: Returns `true` if given `value` is a promise. Value is - * assumed to be a promise if it implements method `then`. - */ -function isPromise(value) { - return value && typeof(value.then) === 'function'; -} - -/** - * Creates deferred object containing fresh promise & methods to either resolve - * or reject it. The result is an object with the following properties: - * - `promise` Eventual value representation implementing CommonJS [Promises/A] - * (http://wiki.commonjs.org/wiki/Promises/A) API. - * - `resolve` Single shot function that resolves enclosed `promise` with a - * given `value`. - * - `reject` Single shot function that rejects enclosed `promise` with a given - * `reason`. - * - * An optional `prototype` argument is used as a prototype of the returned - * `promise` allowing one to implement additional API. If prototype is not - * passed then it falls back to `Object.prototype`. - * - * ## Example - * - * function fetchURI(uri, type) { - * var deferred = defer(); - * var request = new XMLHttpRequest(); - * request.open("GET", uri, true); - * request.responseType = type; - * request.onload = function onload() { - * deferred.resolve(request.response); - * } - * request.onerror = function(event) { - * deferred.reject(event); - * } - * request.send(); - * - * return deferred.promise; - * } - */ -function defer(prototype) { - // Define FIFO queue of observer pairs. Once promise is resolved & all queued - // observers are forwarded to `result` and variable is set to `null`. - var observers = []; - - // Promise `result`, which will be assigned a resolution value once promise - // is resolved. Note that result will always be assigned promise (or alike) - // object to take care of propagation through promise chains. If result is - // `null` promise is not resolved yet. - var result = null; - - prototype = (prototype || prototype === null) ? prototype : Object.prototype; - - // Create an object implementing promise API. - var promise = Object.create(prototype, { - then: { value: function then(onFulfill, onError) { - var deferred = defer(prototype); - - function resolve(value) { - // If `onFulfill` handler is provided resolve `deferred.promise` with - // result of invoking it with a resolution value. If handler is not - // provided propagate value through. - try { - deferred.resolve(onFulfill ? onFulfill(value) : value); - } - // `onFulfill` may throw exception in which case resulting promise - // is rejected with thrown exception. - catch(error) { - if (exports._reportErrors && typeof(console) === 'object') - console.error(error); - // Note: Following is equivalent of `deferred.reject(error)`, - // we use this shortcut to reduce a stack. - deferred.resolve(rejected(error)); - } - } - - function reject(reason) { - try { - if (onError) deferred.resolve(onError(reason)); - else deferred.resolve(rejected(reason)); - } - catch(error) { - if (exports._reportErrors && typeof(console) === 'object') - console.error(error); - deferred.resolve(rejected(error)); - } - } - - // If enclosed promise (`this.promise`) observers queue is still alive - // enqueue a new observer pair into it. Note that this does not - // necessary means that promise is pending, it may already be resolved, - // but we still have to queue observers to guarantee an order of - // propagation. - if (observers) { - observers.push({ resolve: resolve, reject: reject }); - } - // Otherwise just forward observer pair right to a `result` promise. - else { - result.then(resolve, reject); - } - - return deferred.promise; - }} - }) - - var deferred = { - promise: promise, - /** - * Resolves associated `promise` to a given `value`, unless it's already - * resolved or rejected. Note that resolved promise is not necessary a - * successfully fulfilled. Promise may be resolved with a promise `value` - * in which case `value` promise's fulfillment / rejection will propagate - * up to a promise resolved with `value`. - */ - resolve: function resolve(value) { - if (!result) { - // Store resolution `value` in a `result` as a promise, so that all - // the subsequent handlers can be simply forwarded to it. Since - // `result` will be a promise all the value / error propagation will - // be uniformly taken care of. - result = isPromise(value) ? value : fulfilled(value); - - // Forward already registered observers to a `result` promise in the - // order they were registered. Note that we intentionally dequeue - // observer at a time until queue is exhausted. This makes sure that - // handlers registered as side effect of observer forwarding are - // queued instead of being invoked immediately, guaranteeing FIFO - // order. - while (observers.length) { - var observer = observers.shift(); - result.then(observer.resolve, observer.reject); - } - - // Once `observers` queue is exhausted we `null`-ify it, so that - // new handlers are forwarded straight to the `result`. - observers = null; - } - }, - /** - * Rejects associated `promise` with a given `reason`, unless it's already - * resolved / rejected. This is just a (better performing) convenience - * shortcut for `deferred.resolve(reject(reason))`. - */ - reject: function reject(reason) { - // Note that if promise is resolved that does not necessary means that it - // is successfully fulfilled. Resolution value may be a promise in which - // case its result propagates. In other words if promise `a` is resolved - // with promise `b`, `a` is either fulfilled or rejected depending - // on weather `b` is fulfilled or rejected. Here `deferred.promise` is - // resolved with a promise pre-rejected with a given `reason`, there for - // `deferred.promise` is rejected with a given `reason`. This may feel - // little awkward first, but doing it this way greatly simplifies - // propagation through promise chains. - deferred.resolve(rejected(reason)); - } - }; - - return deferred; -} -exports.defer = defer; - -/** - * Returns a promise resolved to a given `value`. Optionally a second - * `prototype` argument may be provided to be used as a prototype for the - * returned promise. - */ -function resolve(value, prototype) { - var deferred = defer(prototype); - deferred.resolve(value); - return deferred.promise; -} -exports.resolve = resolve; - -/** - * Returns a promise rejected with a given `reason`. Optionally a second - * `prototype` argument may be provided to be used as a prototype for the - * returned promise. - */ -function reject(reason, prototype) { - var deferred = defer(prototype); - deferred.reject(reason); - return deferred.promise; -} -exports.reject = reject; - -var promised = (function() { - // Note: Define shortcuts and utility functions here in order to avoid - // slower property accesses and unnecessary closure creations on each - // call of this popular function. - - var call = Function.call; - var concat = Array.prototype.concat; - - // Utility function that does following: - // execute([ f, self, args...]) => f.apply(self, args) - function execute(args) { return call.apply(call, args) } - - // Utility function that takes promise of `a` array and maybe promise `b` - // as arguments and returns promise for `a.concat(b)`. - function promisedConcat(promises, unknown) { - return promises.then(function(values) { - return resolve(unknown).then(function(value) { - return values.concat([ value ]); - }); - }); - } - - return function promised(f, prototype) { - /** - Returns a wrapped `f`, which when called returns a promise that resolves to - `f(...)` passing all the given arguments to it, which by the way may be - promises. Optionally second `prototype` argument may be provided to be used - a prototype for a returned promise. - - ## Example - - var promise = promised(Array)(1, promise(2), promise(3)) - promise.then(console.log) // => [ 1, 2, 3 ] - **/ - - return function promised() { - // create array of [ f, this, args... ] - return concat.apply([ f, this ], arguments). - // reduce it via `promisedConcat` to get promised array of fulfillments - reduce(promisedConcat, resolve([], prototype)). - // finally map that to promise of `f.apply(this, args...)` - then(execute); - }; - } -})(); -exports.promised = promised; -// -var all = promised(Array); -exports.all = all; -// -//}); diff --git a/scripting/javascript/bindings/js/debugger/main.js b/scripting/javascript/bindings/js/debugger/main.js deleted file mode 100644 index f08009ade6..0000000000 --- a/scripting/javascript/bindings/js/debugger/main.js +++ /dev/null @@ -1,928 +0,0 @@ -/* -*- Mode: javascript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim: set ft=javascript ts=2 et sw=2 tw=80: */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -"use strict"; -/** - * Toolkit glue for the remote debugging protocol, loaded into the - * debugging global. - */ - -//const Ci = Components.interfaces; -//const Cc = Components.classes; -//const CC = Components.Constructor; -//const Cu = Components.utils; -//const Cr = Components.results; -//const DBG_STRINGS_URI = "chrome://global/locale/devtools/debugger.properties"; -// -//Cu.import("resource://gre/modules/Services.jsm"); -//Cu.import("resource://gre/modules/XPCOMUtils.jsm"); -//let wantLogging = Services.prefs.getBoolPref("devtools.debugger.log"); -// -//Cu.import("resource://gre/modules/jsdebugger.jsm"); -//addDebuggerToGlobal(this); -// -//Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js"); -//const { defer, resolve, reject, all } = Promise; -// -//Cu.import("resource://gre/modules/devtools/SourceMap.jsm"); -// -//loadSubScript.call(this, "resource://gre/modules/devtools/DevToolsUtils.js"); - -let wantLogging = true; -let debuggerServer = null; - -function dumpn(str) { - if (wantLogging) { - log("DBG-SERVER: " + str + "\n"); - } -} - -function dbg_assert(cond, e) { - if (!cond) { - log("assert >>>> " + cond.toString()); - return e; - } -} - -function XPCInspector() { - this.exitNestedEventLoop = _exitNestedEventLoop; - this.enterNestedEventLoop = _enterNestedEventLoop; - this.eventLoopNestLevel = _getEventLoopNestLevel; -} - -//loadSubScript.call(this, "resource://gre/modules/devtools/server/transport.js"); - -// XPCOM constructors -// const ServerSocket = CC("@mozilla.org/network/server-socket;1", -// "nsIServerSocket", -// "initSpecialConnection"); - -function ServerSocket(aPort, flags, c){ - this.asyncListen = function(server){ - log("asyncListen...."); - debuggerServer = server; - }; -}; - -var gRegisteredModules = Object.create(null); - -/** - * The ModuleAPI object is passed to modules loaded using the - * DebuggerServer.registerModule() API. Modules can use this - * object to register actor factories. - * Factories registered through the module API will be removed - * when the module is unregistered or when the server is - * destroyed. - */ -function ModuleAPI() { - let activeTabActors = new Set(); - let activeGlobalActors = new Set(); - - return { - // See DebuggerServer.addGlobalActor for a description. - addGlobalActor: function(factory, name) { - DebuggerServer.addGlobalActor(factory, name); - activeGlobalActors.add(factory); - }, - // See DebuggerServer.removeGlobalActor for a description. - removeGlobalActor: function(factory) { - DebuggerServer.removeGlobalActor(factory); - activeGlobalActors.delete(factory); - }, - - // See DebuggerServer.addTabActor for a description. - addTabActor: function(factory, name) { - DebuggerServer.addTabActor(factory, name); - activeTabActors.add(factory); - }, - // See DebuggerServer.removeTabActor for a description. - removeTabActor: function(factory) { - DebuggerServer.removeTabActor(factory); - activeTabActors.delete(factory); - }, - - // Destroy the module API object, unregistering any - // factories registered by the module. - destroy: function() { - for (let factory of activeTabActors) { - DebuggerServer.removeTabActor(factory); - } - activeTabActors = null; - for (let factory of activeGlobalActors) { - DebuggerServer.removeGlobalActor(factory); - } - activeGlobalActors = null; - } - } -}; - -/*** - * Public API - */ -var DebuggerServer = { - _listener: null, - _initialized: false, - _transportInitialized: false, - xpcInspector: null, - _transport: null, - // Number of currently open TCP connections. - _socketConnections: 0, - // Map of global actor names to actor constructors provided by extensions. - globalActorFactories: {}, - // Map of tab actor names to actor constructors provided by extensions. - tabActorFactories: {}, - - LONG_STRING_LENGTH: 10000, - LONG_STRING_INITIAL_LENGTH: 1000, - LONG_STRING_READ_LENGTH: 1000, - - /** - * A handler function that prompts the user to accept or decline the incoming - * connection. - */ - _allowConnection: null, - - /** - * Prompt the user to accept or decline the incoming connection. This is the - * default implementation that products embedding the debugger server may - * choose to override. - * - * @return true if the connection should be permitted, false otherwise - */ - _defaultAllowConnection: function DS__defaultAllowConnection() { - // let title = L10N.getStr("remoteIncomingPromptTitle"); - // let msg = L10N.getStr("remoteIncomingPromptMessage"); - // let disableButton = L10N.getStr("remoteIncomingPromptDisable"); - // let prompt = Services.prompt; - // let flags = prompt.BUTTON_POS_0 * prompt.BUTTON_TITLE_OK + - // prompt.BUTTON_POS_1 * prompt.BUTTON_TITLE_CANCEL + - // prompt.BUTTON_POS_2 * prompt.BUTTON_TITLE_IS_STRING + - // prompt.BUTTON_POS_1_DEFAULT; - // let result = prompt.confirmEx(null, title, msg, flags, null, null, - // disableButton, null, { value: false }); - // if (result == 0) { - // return true; - // } - // if (result == 2) { - // DebuggerServer.closeListener(true); - // Services.prefs.setBoolPref("devtools.debugger.remote-enabled", false); - // } - // return false; - return true; - }, - - /** - * Initialize the debugger server. - * - * @param function aAllowConnectionCallback - * The embedder-provider callback, that decides whether an incoming - * remote protocol conection should be allowed or refused. - */ - init: function DS_init(aAllowConnectionCallback) { - if (this.initialized) { - return; - } - - this.xpcInspector = new XPCInspector();//Cc["@mozilla.org/jsinspector;1"].getService(Ci.nsIJSInspector); - this.initTransport(aAllowConnectionCallback); - this.addActors("resource://gre/modules/devtools/server/actors/root.js"); - - this._initialized = true; - }, - - /** - * Initialize the debugger server's transport variables. This can be - * in place of init() for cases where the jsdebugger isn't needed. - * - * @param function aAllowConnectionCallback - * The embedder-provider callback, that decides whether an incoming - * remote protocol conection should be allowed or refused. - */ - initTransport: function DS_initTransport(aAllowConnectionCallback) { - if (this._transportInitialized) { - return; - } - - this._connections = {}; - this._nextConnID = 0; - this._transportInitialized = true; - this._allowConnection = aAllowConnectionCallback ? - aAllowConnectionCallback : - this._defaultAllowConnection; - }, - - get initialized() this._initialized, - - /** - * Performs cleanup tasks before shutting down the debugger server, if no - * connections are currently open. Such tasks include clearing any actor - * constructors added at runtime. This method should be called whenever a - * debugger server is no longer useful, to avoid memory leaks. After this - * method returns, the debugger server must be initialized again before use. - */ - destroy: function DS_destroy() { - if (!this._initialized) { - return; - } - - for (let connID of Object.getOwnPropertyNames(this._connections)) { - this._connections[connID].close(); - } - - for (let id of Object.getOwnPropertyNames(gRegisteredModules)) { - let mod = gRegisteredModules[id]; - mod.module.unregister(mod.api); - } - gRegisteredModules = {}; - - this.closeListener(); - this.globalActorFactories = {}; - this.tabActorFactories = {}; - delete this._allowConnection; - this._transportInitialized = false; - this._initialized = false; - dumpn("Debugger server is shut down."); - }, - - /** - * Load a subscript into the debugging global. - * - * @param aURL string A url that will be loaded as a subscript into the - * debugging global. The user must load at least one script - * that implements a createRootActor() function to create the - * server's root actor. - */ - addActors: function DS_addActors(aURL) { - //loadSubScript.call(this, aURL); - }, - - /** - * Register a CommonJS module with the debugger server. - * @param id string - * The ID of a CommonJS module. This module must export - * 'register' and 'unregister' functions. - */ - registerModule: function(id) { - if (id in gRegisteredModules) { - throw new Error("Tried to register a module twice: " + id + "\n"); - } - - let moduleAPI = ModuleAPI(); - - let {devtools} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {}); - let mod = devtools.require(id); - mod.register(moduleAPI); - gRegisteredModules[id] = { module: mod, api: moduleAPI }; - }, - - /** - * Returns true if a module id has been registered. - */ - isModuleRegistered: function(id) { - return (id in gRegisteredModules); - }, - - /** - * Unregister a previously-loaded CommonJS module from the debugger server. - */ - unregisterModule: function(id) { - let mod = gRegisteredModules[id]; - if (!mod) { - throw new Error("Tried to unregister a module that was not previously registered."); - } - mod.module.unregister(mod.api); - mod.api.destroy(); - delete gRegisteredModules[id]; - }, - - /** - * Install Firefox-specific actors. - */ - addBrowserActors: function DS_addBrowserActors() { - this.addActors("resource://gre/modules/devtools/server/actors/webbrowser.js"); - this.addActors("resource://gre/modules/devtools/server/actors/script.js"); - this.addGlobalActor(this.ChromeDebuggerActor, "chromeDebugger"); - this.addActors("resource://gre/modules/devtools/server/actors/webconsole.js"); - this.addActors("resource://gre/modules/devtools/server/actors/gcli.js"); - if ("nsIProfiler" in Ci) - this.addActors("resource://gre/modules/devtools/server/actors/profiler.js"); - - this.addActors("resource://gre/modules/devtools/server/actors/styleeditor.js"); - this.addActors("resource://gre/modules/devtools/server/actors/webapps.js"); - this.registerModule("devtools/server/actors/inspector"); - }, - - /** - * Listens on the given port for remote debugger connections. - * - * @param aPort int - * The port to listen on. - */ - openListener: function DS_openListener(aPort) { - // if (!Services.prefs.getBoolPref("devtools.debugger.remote-enabled")) { - // return false; - // } - this._checkInit(); - - // Return early if the server is already listening. - if (this._listener) { - return true; - } - - // let flags = Ci.nsIServerSocket.KeepWhenOffline; - // A preference setting can force binding on the loopback interface. - // if (Services.prefs.getBoolPref("devtools.debugger.force-local")) { - // flags |= Ci.nsIServerSocket.LoopbackOnly; - // } - - let flags = 0; - - try { - let socket = new ServerSocket(aPort, flags, 4); - socket.asyncListen(this); - this._listener = socket; - } catch (e) { - dumpn("Could not start debugging listener on port " + aPort + ": " + e); - throw "Cr.NS_ERROR_NOT_AVAILABLE"; - } - this._socketConnections++; - - return true; - }, - - /** - * Close a previously-opened TCP listener. - * - * @param aForce boolean [optional] - * If set to true, then the socket will be closed, regardless of the - * number of open connections. - */ - closeListener: function DS_closeListener(aForce) { - if (!this._listener || this._socketConnections == 0) { - return false; - } - - // Only close the listener when the last connection is closed, or if the - // aForce flag is passed. - if (--this._socketConnections == 0 || aForce) { - this._listener.close(); - this._listener = null; - this._socketConnections = 0; - } - - return true; - }, - - /** - * Creates a new connection to the local debugger speaking over a fake - * transport. This connection results in straightforward calls to the onPacket - * handlers of each side. - * - * @returns a client-side DebuggerTransport for communicating with - * the newly-created connection. - */ - connectPipe: function DS_connectPipe() { - this._checkInit(); - - let serverTransport = new LocalDebuggerTransport; - let clientTransport = new LocalDebuggerTransport(serverTransport); - serverTransport.other = clientTransport; - let connection = this._onConnection(serverTransport); - - // I'm putting this here because I trust you. - // - // There are times, when using a local connection, when you're going - // to be tempted to just get direct access to the server. Resist that - // temptation! If you succumb to that temptation, you will make the - // fine developers that work on Fennec and Firefox OS sad. They're - // professionals, they'll try to act like they understand, but deep - // down you'll know that you hurt them. - // - // This reference allows you to give in to that temptation. There are - // times this makes sense: tests, for example, and while porting a - // previously local-only codebase to the remote protocol. - // - // But every time you use this, you will feel the shame of having - // used a property that starts with a '_'. - clientTransport._serverConnection = connection; - - return clientTransport; - }, - - - // nsIServerSocketListener implementation - - onSocketAccepted: - makeInfallible(function DS_onSocketAccepted(aSocket, aTransport) { - if (!this._allowConnection()) { - return; - } - dumpn("New debugging connection on " + aTransport.host + ":" + aTransport.port); - - let input = aTransport.openInputStream(0, 0, 0); - let output = aTransport.openOutputStream(0, 0, 0); - let transport = new DebuggerTransport(input, output); - DebuggerServer._onConnection(transport); - }, "DebuggerServer.onSocketAccepted"), - - onStopListening: function DS_onStopListening(aSocket, status) { - dumpn("onStopListening, status: " + status); - }, - - /** - * Raises an exception if the server has not been properly initialized. - */ - _checkInit: function DS_checkInit() { - if (!this._transportInitialized) { - throw "DebuggerServer has not been initialized."; - } - - if (!this.createRootActor) { - throw "Use DebuggerServer.addActors() to add a root actor implementation."; - } - }, - - /** - * Create a new debugger connection for the given transport. Called - * after connectPipe() or after an incoming socket connection. - */ - _onConnection: function DS_onConnection(aTransport) { - log("DebuggerServer._onConnection...."); - - this._transport = aTransport; - - let connID = "conn" + this._nextConnID++ + '.'; - let conn = new DebuggerServerConnection(connID, aTransport); - this._connections[connID] = conn; - - // Create a root actor for the connection and send the hello packet. - conn.rootActor = this.createRootActor(conn); - conn.addActor(conn.rootActor); - - aTransport.send(conn.rootActor.sayHello()); - aTransport.ready(); - - return conn; - }, - - /** - * Remove the connection from the debugging server. - */ - _connectionClosed: function DS_connectionClosed(aConnection) { - delete this._connections[aConnection.prefix]; - }, - - // DebuggerServer extension API. - - /** - * Registers handlers for new tab-scoped request types defined dynamically. - * This is used for example by add-ons to augment the functionality of the tab - * actor. Note that the name or actorPrefix of the request type is not allowed - * to clash with existing protocol packet properties, like 'title', 'url' or - * 'actor', since that would break the protocol. - * - * @param aFunction function - * The constructor function for this request type. This expects to be - * called as a constructor (i.e. with 'new'), and passed two - * arguments: the DebuggerServerConnection, and the BrowserTabActor - * with which it will be associated. - * - * @param aName string [optional] - * The name of the new request type. If this is not present, the - * actorPrefix property of the constructor prototype is used. - */ - addTabActor: function DS_addTabActor(aFunction, aName) { - let name = aName ? aName : aFunction.prototype.actorPrefix; - if (["title", "url", "actor"].indexOf(name) != -1) { - throw Error(name + " is not allowed"); - } - if (DebuggerServer.tabActorFactories.hasOwnProperty(name)) { - throw Error(name + " already exists"); - } - DebuggerServer.tabActorFactories[name] = aFunction; - }, - - /** - * Unregisters the handler for the specified tab-scoped request type. - * This may be used for example by add-ons when shutting down or upgrading. - * - * @param aFunction function - * The constructor function for this request type. - */ - removeTabActor: function DS_removeTabActor(aFunction) { - for (let name in DebuggerServer.tabActorFactories) { - let handler = DebuggerServer.tabActorFactories[name]; - if (handler.name == aFunction.name) { - delete DebuggerServer.tabActorFactories[name]; - } - } - }, - - /** - * Registers handlers for new browser-scoped request types defined - * dynamically. This is used for example by add-ons to augment the - * functionality of the root actor. Note that the name or actorPrefix of the - * request type is not allowed to clash with existing protocol packet - * properties, like 'from', 'tabs' or 'selected', since that would break the - * protocol. - * - * @param aFunction function - * The constructor function for this request type. This expects to be - * called as a constructor (i.e. with 'new'), and passed two - * arguments: the DebuggerServerConnection, and the BrowserRootActor - * with which it will be associated. - * - * @param aName string [optional] - * The name of the new request type. If this is not present, the - * actorPrefix property of the constructor prototype is used. - */ - addGlobalActor: function DS_addGlobalActor(aFunction, aName) { - let name = aName ? aName : aFunction.prototype.actorPrefix; - if (["from", "tabs", "selected"].indexOf(name) != -1) { - throw Error(name + " is not allowed"); - } - if (DebuggerServer.globalActorFactories.hasOwnProperty(name)) { - throw Error(name + " already exists"); - } - DebuggerServer.globalActorFactories[name] = aFunction; - }, - - /** - * Unregisters the handler for the specified browser-scoped request type. - * This may be used for example by add-ons when shutting down or upgrading. - * - * @param aFunction function - * The constructor function for this request type. - */ - removeGlobalActor: function DS_removeGlobalActor(aFunction) { - for (let name in DebuggerServer.globalActorFactories) { - let handler = DebuggerServer.globalActorFactories[name]; - if (handler.name == aFunction.name) { - delete DebuggerServer.globalActorFactories[name]; - } - } - } -}; - - -/** - * Construct an ActorPool. - * - * ActorPools are actorID -> actor mapping and storage. These are - * used to accumulate and quickly dispose of groups of actors that - * share a lifetime. - */ -function ActorPool(aConnection) -{ - this.conn = aConnection; - this._cleanups = {}; - this._actors = {}; -} - -ActorPool.prototype = { - /** - * Add an actor to the actor pool. If the actor doesn't have an ID, - * allocate one from the connection. - * - * @param aActor object - * The actor implementation. If the object has a - * 'disconnect' property, it will be called when the actor - * pool is cleaned up. - */ - addActor: function AP_addActor(aActor) { - aActor.conn = this.conn; - if (!aActor.actorID) { - let prefix = aActor.actorPrefix; - if (typeof aActor == "function") { - prefix = aActor.prototype.actorPrefix; - } - aActor.actorID = this.conn.allocID(prefix || undefined); - } - - if (aActor.registeredPool) { - aActor.registeredPool.removeActor(aActor); - } - aActor.registeredPool = this; - - this._actors[aActor.actorID] = aActor; - if (aActor.disconnect) { - this._cleanups[aActor.actorID] = aActor; - } - }, - - get: function AP_get(aActorID) { - return this._actors[aActorID]; - }, - - has: function AP_has(aActorID) { - return aActorID in this._actors; - }, - - /** - * Returns true if the pool is empty. - */ - isEmpty: function AP_isEmpty() { - return Object.keys(this._actors).length == 0; - }, - - /** - * Remove an actor from the actor pool. - */ - removeActor: function AP_remove(aActor) { - delete this._actors[aActor.actorID]; - delete this._cleanups[aActor.actorID]; - }, - - /** - * Match the api expected by the protocol library. - */ - unmanage: function(aActor) { - return this.removeActor(aActor); - }, - - /** - * Run all actor cleanups. - */ - cleanup: function AP_cleanup() { - for each (let actor in this._cleanups) { - actor.disconnect(); - } - this._cleanups = {}; - } -} - -/** - * Creates a DebuggerServerConnection. - * - * Represents a connection to this debugging global from a client. - * Manages a set of actors and actor pools, allocates actor ids, and - * handles incoming requests. - * - * @param aPrefix string - * All actor IDs created by this connection should be prefixed - * with aPrefix. - * @param aTransport transport - * Packet transport for the debugging protocol. - */ -function DebuggerServerConnection(aPrefix, aTransport) -{ - this._prefix = aPrefix; - this._transport = aTransport; - this._transport.hooks = this; - this._nextID = 1; - - this._actorPool = new ActorPool(this); - this._extraPools = []; -} - -DebuggerServerConnection.prototype = { - _prefix: null, - get prefix() { return this._prefix }, - - _transport: null, - get transport() { return this._transport }, - - close: function() { - this._transport.close(); - }, - - send: function DSC_send(aPacket) { - this.transport.send(aPacket); - }, - - allocID: function DSC_allocID(aPrefix) { - return this.prefix + (aPrefix || '') + this._nextID++; - }, - - /** - * Add a map of actor IDs to the connection. - */ - addActorPool: function DSC_addActorPool(aActorPool) { - this._extraPools.push(aActorPool); - }, - - /** - * Remove a previously-added pool of actors to the connection. - * - * @param ActorPool aActorPool - * The ActorPool instance you want to remove. - * @param boolean aCleanup - * True if you want to disconnect each actor from the pool, false - * otherwise. - */ - removeActorPool: function DSC_removeActorPool(aActorPool, aCleanup) { - let index = this._extraPools.lastIndexOf(aActorPool); - if (index > -1) { - let pool = this._extraPools.splice(index, 1); - if (aCleanup) { - pool.map(function(p) { p.cleanup(); }); - } - } - }, - - /** - * Add an actor to the default actor pool for this connection. - */ - addActor: function DSC_addActor(aActor) { - this._actorPool.addActor(aActor); - }, - - /** - * Remove an actor to the default actor pool for this connection. - */ - removeActor: function DSC_removeActor(aActor) { - this._actorPool.removeActor(aActor); - }, - - /** - * Match the api expected by the protocol library. - */ - unmanage: function(aActor) { - return this.removeActor(aActor); - }, - - /** - * Look up an actor implementation for an actorID. Will search - * all the actor pools registered with the connection. - * - * @param aActorID string - * Actor ID to look up. - */ - getActor: function DSC_getActor(aActorID) { - let pool = this.poolFor(aActorID); - if (pool) { - return pool.get(aActorID); - } - - if (aActorID === "root") { - return this.rootActor; - } - - return null; - }, - - poolFor: function DSC_actorPool(aActorID) { - if (this._actorPool && this._actorPool.has(aActorID)) { - return this._actorPool; - } - - for (let pool of this._extraPools) { - if (pool.has(aActorID)) { - return pool; - } - } - return null; - }, - - _unknownError: function DSC__unknownError(aPrefix, aError) { - let errorString = safeErrorString(aError); - errorString += "\n" + aError.stack; - // Cu.reportError(errorString); - dumpn(errorString); - return { - error: "unknownError", - message: (aPrefix + "': " + errorString) - }; - }, - - // Transport hooks. - - /** - * Called by DebuggerTransport to dispatch incoming packets as appropriate. - * - * @param aPacket object - * The incoming packet. - */ - onPacket: function DSC_onPacket(aPacket) { - let actor = this.getActor(aPacket.to); - if (!actor) { - this.transport.send({ from: aPacket.to ? aPacket.to : "root", - error: "noSuchActor" }); - return; - } - - // Dyamically-loaded actors have to be created lazily. - if (typeof actor == "function") { - let instance; - try { - instance = new actor(); - } catch (e) { - this.transport.send(this._unknownError( - "Error occurred while creating actor '" + actor.name, - e)); - } - instance.parentID = actor.parentID; - // We want the newly-constructed actor to completely replace the factory - // actor. Reusing the existing actor ID will make sure ActorPool.addActor - // does the right thing. - instance.actorID = actor.actorID; - actor.registeredPool.addActor(instance); - actor = instance; - } - - var ret = null; - // log("actor.requestTypes: "+actor.requestTypes+", cb: "+actor.requestTypes[aPacket.type]); - // Dispatch the request to the actor. - if (actor.requestTypes && actor.requestTypes[aPacket.type]) { - try { - this.currentPacket = aPacket; - ret = actor.requestTypes[aPacket.type].bind(actor)(aPacket, this); - } catch(e) { - this.transport.send(this._unknownError( - "error occurred while processing '" + aPacket.type, - e)); - } finally { - delete this.currentPacket; - } - } else { - ret = { error: "unrecognizedPacketType", - message: ('Actor "' + actor.actorID + - '" does not recognize the packet type "' + - aPacket.type + '"') }; - } - - if (!ret) { - // This should become an error once we've converted every user - // of this to promises in bug 794078. - return; - } - - resolve(ret) - .then(null, (e) => { - return this._unknownError( - "error occurred while processing '" + aPacket.type, - e); - }) - .then(function (aResponse) { - if (!aResponse.from) { - aResponse.from = aPacket.to; - } - return aResponse; - }) - .then(this.transport.send.bind(this.transport)); - }, - - /** - * Called by DebuggerTransport when the underlying stream is closed. - * - * @param aStatus nsresult - * The status code that corresponds to the reason for closing - * the stream. - */ - onClosed: function DSC_onClosed(aStatus) { - dumpn("Cleaning up connection."); - - this._actorPool.cleanup(); - this._actorPool = null; - this._extraPools.map(function(p) { p.cleanup(); }); - this._extraPools = null; - - DebuggerServer._connectionClosed(this); - }, - - /* - * Debugging helper for inspecting the state of the actor pools. - */ - _dumpPools: function DSC_dumpPools() { - dumpn("/-------------------- dumping pools:"); - if (this._actorPool) { - dumpn("--------------------- actorPool actors: " + - uneval(Object.keys(this._actorPool._actors))); - } - for each (let pool in this._extraPools) - dumpn("--------------------- extraPool actors: " + - uneval(Object.keys(pool._actors))); - }, - - /* - * Debugging helper for inspecting the state of an actor pool. - */ - _dumpPool: function DSC_dumpPools(aPool) { - dumpn("/-------------------- dumping pool:"); - dumpn("--------------------- actorPool actors: " + - uneval(Object.keys(aPool._actors))); - } -}; - -/** - * Localization convenience methods. - */ -// let L10N = { - -// /** -// * L10N shortcut function. -// * -// * @param string aName -// * @return string -// */ -// getStr: function L10N_getStr(aName) { -// return this.stringBundle.GetStringFromName(aName); -// } -// }; - -// XPCOMUtils.defineLazyGetter(L10N, "stringBundle", function() { -// return Services.strings.createBundle(DBG_STRINGS_URI); -// }); diff --git a/scripting/javascript/bindings/js/debugger/transport.js b/scripting/javascript/bindings/js/debugger/transport.js deleted file mode 100644 index 8676e367a8..0000000000 --- a/scripting/javascript/bindings/js/debugger/transport.js +++ /dev/null @@ -1,288 +0,0 @@ -/* -*- Mode: javascript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim: set ft=javascript ts=2 et sw=2 tw=80: */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -"use strict"; -// Components.utils.import("resource://gre/modules/NetUtil.jsm"); - -/** - * An adapter that handles data transfers between the debugger client and - * server. It can work with both nsIPipe and nsIServerSocket transports so - * long as the properly created input and output streams are specified. - * - * @param aInput nsIInputStream - * The input stream. - * @param aOutput nsIAsyncOutputStream - * The output stream. - * - * Given a DebuggerTransport instance dt: - * 1) Set dt.hooks to a packet handler object (described below). - * 2) Call dt.ready() to begin watching for input packets. - * 3) Send packets as you please, and handle incoming packets passed to - * hook.onPacket. - * 4) Call dt.close() to close the connection, and disengage from the event - * loop. - * - * A packet handler object is an object with two methods: - * - * - onPacket(packet) - called when we have received a complete packet. - * |Packet| is the parsed form of the packet --- a JavaScript value, not - * a JSON-syntax string. - * - * - onClosed(status) - called when the connection is closed. |Status| is - * an nsresult, of the sort passed to nsIRequestObserver. - * - * Data is transferred as a JSON packet serialized into a string, with the - * string length prepended to the packet, followed by a colon - * ([length]:[packet]). The contents of the JSON packet are specified in - * the Remote Debugging Protocol specification. - */ -this.DebuggerTransport = function DebuggerTransport(aInput, aOutput) -{ - this._input = aInput; - this._output = aOutput; - - this._converter = null;//Cc["@mozilla.org/intl/scriptableunicodeconverter"] - // .createInstance(Ci.nsIScriptableUnicodeConverter); - // this._converter.charset = "UTF-8"; - - this._outgoing = ""; - this._incoming = ""; - - this.hooks = null; -} - -DebuggerTransport.prototype = { - /** - * Transmit a packet. - * - * This method returns immediately, without waiting for the entire - * packet to be transmitted, registering event handlers as needed to - * transmit the entire packet. Packets are transmitted in the order - * they are passed to this method. - */ - send: function DT_send(aPacket) { - // TODO (bug 709088): remove pretty printing when the protocol is done. - let data = JSON.stringify(aPacket, null, 2); - // data = this._converter.ConvertFromUnicode(data); - - let data_for_len = utf16to8(data); - - this._outgoing = data_for_len.length + ':' + data; - - this._flushOutgoing(); - }, - - /** - * Close the transport. - */ - close: function DT_close() { - this._input.close(); - this._output.close(); - }, - - /** - * Flush the outgoing stream. - */ - _flushOutgoing: function DT_flushOutgoing() { - if (this._outgoing.length > 0) { - // var threadManager = Cc["@mozilla.org/thread-manager;1"].getService(); - // this._output.asyncWait(this, 0, 0, threadManager.currentThread); - log("outgoing: " + this._outgoing);//.substring(0, 200)); - _bufferWrite(this._outgoing); - } - }, - - onOutputStreamReady: - makeInfallible(function DT_onOutputStreamReady(aStream) { - let written = 0; - try { - written = aStream.write(this._outgoing, this._outgoing.length); - } catch(e if e.result == Components.results.NS_BASE_STREAM_CLOSED) { - dumpn("Connection closed."); - this.close(); - return; - } - this._outgoing = this._outgoing.slice(written); - this._flushOutgoing(); - }, "DebuggerTransport.prototype.onOutputStreamReady"), - - /** - * Initialize the input stream for reading. Once this method has been - * called, we watch for packets on the input stream, and pass them to - * this.hook.onPacket. - */ - ready: function DT_ready() { - // let pump = Cc["@mozilla.org/network/input-stream-pump;1"] - // .createInstance(Ci.nsIInputStreamPump); - // pump.init(this._input, -1, -1, 0, 0, false); - // pump.asyncRead(this, null); - }, - - // nsIStreamListener - onStartRequest: - makeInfallible(function DT_onStartRequest(aRequest, aContext) {}, - "DebuggerTransport.prototype.onStartRequest"), - - onStopRequest: - makeInfallible(function DT_onStopRequest(aRequest, aContext, aStatus) { - this.close(); - if (this.hooks) { - this.hooks.onClosed(aStatus); - this.hooks = null; - } - }, "DebuggerTransport.prototype.onStopRequest"), - - onDataAvailable: makeInfallible(function DT_onDataAvailable (incoming) -// makeInfallible(function DT_onDataAvailable(aRequest, aContext, -// aStream, aOffset, aCount) - { - this._incoming = incoming;//+= NetUtil.readInputStreamToString(aStream, - // aStream.available()); - while (this._processIncoming()) {}; - }, "DebuggerTransport.prototype.onDataAvailable"), - - /** - * Process incoming packets. Returns true if a packet has been received, either - * if it was properly parsed or not. Returns false if the incoming stream does - * not contain a full packet yet. After a proper packet is parsed, the dispatch - * handler DebuggerTransport.hooks.onPacket is called with the packet as a - * parameter. - */ - _processIncoming: function DT__processIncoming() { - // Well this is ugly. - let sep = this._incoming.indexOf(':'); - if (sep < 0) { - return false; - } - - let count = parseInt(this._incoming.substring(0, sep)); - if (this._incoming.length - (sep + 1) < count) { - // Don't have a complete request yet. - return false; - } - - // We have a complete request, pluck it out of the data and parse it. - this._incoming = this._incoming.substring(sep + 1); - let packet = this._incoming.substring(0, count); - this._incoming = this._incoming.substring(count); - - try { - // packet = this._converter.ConvertToUnicode(packet); - packet = utf8to16(packet); - var parsed = JSON.parse(packet); - } catch(e) { - let msg = "Error parsing incoming packet: " + packet + " (" + e + " - " + e.stack + ")"; - // if (Cu.reportError) { - // Cu.reportError(msg); - // } - dump(msg + "\n"); - return true; - } - - dumpn("Got: " + packet); - let self = this; - - // Services.tm.currentThread.dispatch(makeInfallible(function() { - self.hooks.onPacket(parsed); - // }, "DebuggerTransport instance's this.hooks.onPacket"), 0); - - return true; - } -} - - -/** - * An adapter that handles data transfers between the debugger client and - * server when they both run in the same process. It presents the same API as - * DebuggerTransport, but instead of transmitting serialized messages across a - * connection it merely calls the packet dispatcher of the other side. - * - * @param aOther LocalDebuggerTransport - * The other endpoint for this debugger connection. - * - * @see DebuggerTransport - */ -this.LocalDebuggerTransport = function LocalDebuggerTransport(aOther) -{ - this.other = aOther; - this.hooks = null; - - /* - * A packet number, shared between this and this.other. This isn't used - * by the protocol at all, but it makes the packet traces a lot easier to - * follow. - */ - this._serial = this.other ? this.other._serial : { count: 0 }; -} - -LocalDebuggerTransport.prototype = { - /** - * Transmit a message by directly calling the onPacket handler of the other - * endpoint. - */ - send: function LDT_send(aPacket) { - let serial = this._serial.count++; - if (wantLogging) { - if (aPacket.to) { - dumpn("Packet " + serial + " sent to " + uneval(aPacket.to)); - } else if (aPacket.from) { - dumpn("Packet " + serial + " sent from " + uneval(aPacket.from)); - } - } - this._deepFreeze(aPacket); - let other = this.other; - if (other) { - Services.tm.currentThread.dispatch(makeInfallible(function() { - // Avoid the cost of JSON.stringify() when logging is disabled. - if (wantLogging) { - dumpn("Received packet " + serial + ": " + JSON.stringify(aPacket, null, 2)); - } - if (other.hooks) { - other.hooks.onPacket(aPacket); - } - }, "LocalDebuggerTransport instance's this.other.hooks.onPacket"), 0); - } - }, - - /** - * Close the transport. - */ - close: function LDT_close() { - if (this.other) { - // Remove the reference to the other endpoint before calling close(), to - // avoid infinite recursion. - let other = this.other; - delete this.other; - other.close(); - } - if (this.hooks) { - this.hooks.onClosed(); - this.hooks = null; - } - }, - - /** - * An empty method for emulating the DebuggerTransport API. - */ - ready: function LDT_ready() {}, - - /** - * Helper function that makes an object fully immutable. - */ - _deepFreeze: function LDT_deepFreeze(aObject) { - Object.freeze(aObject); - for (let prop in aObject) { - // Freeze the properties that are objects, not on the prototype, and not - // already frozen. Note that this might leave an unfrozen reference - // somewhere in the object if there is an already frozen object containing - // an unfrozen object. - if (aObject.hasOwnProperty(prop) && typeof aObject === "object" && - !Object.isFrozen(aObject)) { - this._deepFreeze(o[prop]); - } - } - } -}; diff --git a/scripting/lua/proj.emscripten/Makefile b/scripting/lua/proj.emscripten/Makefile deleted file mode 100644 index 5c978d7a0f..0000000000 --- a/scripting/lua/proj.emscripten/Makefile +++ /dev/null @@ -1,77 +0,0 @@ -TARGET = liblua.so - -INCLUDES += -I.. -I../lua -I../tolua -I../cocos2dx_support -I../../auto-generated/lua-bindings \ - -I../Classes -I../../../CocosDenshion/include -I../../../extensions - -SOURCES = ../lua/lapi.c \ - ../lua/lauxlib.c \ - ../lua/lbaselib.c \ - ../lua/lcode.c \ - ../lua/ldblib.c \ - ../lua/ldebug.c \ - ../lua/ldo.c \ - ../lua/ldump.c \ - ../lua/lfunc.c \ - ../lua/lgc.c \ - ../lua/linit.c \ - ../lua/liolib.c \ - ../lua/llex.c \ - ../lua/lmathlib.c \ - ../lua/lmem.c \ - ../lua/loadlib.c \ - ../lua/lobject.c \ - ../lua/lopcodes.c \ - ../lua/loslib.c \ - ../lua/lparser.c \ - ../lua/lstate.c \ - ../lua/lstring.c \ - ../lua/lstrlib.c \ - ../lua/ltable.c \ - ../lua/ltablib.c \ - ../lua/ltm.c \ - ../lua/lundump.c \ - ../lua/lvm.c \ - ../lua/lzio.c \ - ../lua/print.c \ - ../tolua/tolua_event.c \ - ../tolua/tolua_is.c \ - ../tolua/tolua_map.c \ - ../tolua/tolua_push.c \ - ../tolua/tolua_to.c \ - ../cocos2dx_support/tolua_fix.c \ - ../../auto-generated/lua-bindings/lua_cocos2dx_auto.cpp \ - ../../auto-generated/lua-bindings/lua_cocos2dx_extension_auto.cpp \ - ../cocos2dx_support/CCLuaBridge.cpp \ - ../cocos2dx_support/CCLuaEngine.cpp \ - ../cocos2dx_support/CCLuaStack.cpp \ - ../cocos2dx_support/CCLuaValue.cpp \ - ../cocos2dx_support/Cocos2dxLuaLoader.cpp \ - ../cocos2dx_support/CCBProxy.cpp \ - ../cocos2dx_support/LuaOpengl.cpp \ - ../cocos2dx_support/LuaScriptHandlerMgr.cpp \ - ../cocos2dx_support/LuaBasicConversions.cpp \ - ../cocos2dx_support/lua_cocos2dx_manual.cpp \ - ../cocos2dx_support/lua_cocos2dx_extension_manual.cpp \ - ../cocos2dx_support/lua_cocos2dx_deprecated.cpp - -include ../../../cocos2dx/proj.emscripten/cocos2dx.mk - -TARGET := $(LIB_DIR)/$(TARGET) - -all: $(TARGET) - -$(TARGET): $(OBJECTS) $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(CXX) $(CXXFLAGS) $(OBJECTS) -shared -o $@ $(SHAREDLIBS) $(STATICLIBS) - -$(OBJ_DIR)/%.o: ../../%.cpp $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@ - -$(OBJ_DIR)/%.o: ../%.cpp $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@ - -$(OBJ_DIR)/%.o: ../%.c $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(CC) $(CCFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@ diff --git a/scripting/lua/proj.nacl/Makefile b/scripting/lua/proj.nacl/Makefile deleted file mode 100644 index 2a5c081487..0000000000 --- a/scripting/lua/proj.nacl/Makefile +++ /dev/null @@ -1,57 +0,0 @@ -INCLUDES = -I.. -I../lua -I../../../extensions -I../../../external/chipmunk/include/chipmunk - -SOURCES = ../lua/lapi.c \ - ../lua/lauxlib.c \ - ../lua/lbaselib.c \ - ../lua/lcode.c \ - ../lua/ldblib.c \ - ../lua/ldebug.c \ - ../lua/ldo.c \ - ../lua/ldump.c \ - ../lua/lfunc.c \ - ../lua/lgc.c \ - ../lua/linit.c \ - ../lua/liolib.c \ - ../lua/llex.c \ - ../lua/lmathlib.c \ - ../lua/lmem.c \ - ../lua/loadlib.c \ - ../lua/lobject.c \ - ../lua/lopcodes.c \ - ../lua/loslib.c \ - ../lua/lparser.c \ - ../lua/lstate.c \ - ../lua/lstring.c \ - ../lua/lstrlib.c \ - ../lua/ltable.c \ - ../lua/ltablib.c \ - ../lua/ltm.c \ - ../lua/lundump.c \ - ../lua/lvm.c \ - ../lua/lzio.c \ - ../lua/print.c \ - ../tolua/tolua_event.c \ - ../tolua/tolua_is.c \ - ../tolua/tolua_map.c \ - ../tolua/tolua_push.c \ - ../tolua/tolua_to.c - -COCOS_ROOT = ../../.. - -include $(COCOS_ROOT)/cocos2dx/proj.nacl/cocos2dx.mk - -CCFLAGS = -Wno-uninitialized - -TARGET = $(LIB_DIR)/liblua.a -all: $(TARGET) - -$(TARGET): $(OBJECTS) $(CORE_MAKEFILE_LIST) - $(LOG_AR)$(NACL_AR) $(ARFLAGS) $(TARGET) $(OBJECTS) - -$(OBJ_DIR)/%.o: ../%.c $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(LOG_CC)$(NACL_CC) -MMD $(CCFLAGS) $(INCLUDES) $(DEFINES) $(VISIBILITY) -c $< -o $@ - -$(OBJ_DIR)/%.o: ../%.cpp $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(LOG_CXX)$(NACL_CXX) -MMD $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@ diff --git a/scripting/lua/proj.qt5/lua.pro b/scripting/lua/proj.qt5/lua.pro deleted file mode 100644 index c6a146d36e..0000000000 --- a/scripting/lua/proj.qt5/lua.pro +++ /dev/null @@ -1,33 +0,0 @@ - -include(../../../cocos2dx/proj.qt5/common.pri) - -TEMPLATE = lib -CONFIG += static -CONFIG += c++11 - -SOURCES += $$files(../lua/*.c) -SOURCES += $$files(../tolua/*.c) -SOURCES += $$files(../cocos2dx_support/*.c) -SOURCES += $$files(../cocos2dx_support/*.cpp) -SOURCES += $$files(../cocos2dx_support/generated/*.cpp) - -DEFINES += CC_TARGET_OS_MAC - -INCLUDEPATH += .. -INCLUDEPATH += ../lua -INCLUDEPATH += ../tolua -INCLUDEPATH += ../Classes -INCLUDEPATH += ../../../CocosDenshion/include -INCLUDEPATH += ../../../extensions -INCLUDEPATH += ../../../external/chipmunk/include/chipmunk -INCLUDEPATH += ../../../cocos2dx/include -INCLUDEPATH += ../../../cocos2dx -INCLUDEPATH += ../../../cocos2dx/platform/qt5 -INCLUDEPATH += ../../../cocos2dx/kazmath/include -INCLUDEPATH += ../cocos2dx_support -INCLUDEPATH += ../cocos2dx_support/generated - -# XXX SHAREDLIBS += -lextension - -TARGET = $${LIB_OUTPUT_DIR}/lua - diff --git a/scripting/lua/proj.tizen/.cproject b/scripting/lua/proj.tizen/.cproject deleted file mode 100644 index 115700b2ea..0000000000 --- a/scripting/lua/proj.tizen/.cproject +++ /dev/null @@ -1,349 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/scripting/lua/proj.tizen/.project b/scripting/lua/proj.tizen/.project deleted file mode 100644 index 63ebdf667e..0000000000 --- a/scripting/lua/proj.tizen/.project +++ /dev/null @@ -1,106 +0,0 @@ - - - lua - - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.autoBuildTarget - all - - - org.eclipse.cdt.make.core.buildArguments - - - - org.eclipse.cdt.make.core.buildCommand - sbi-make - - - org.eclipse.cdt.make.core.buildLocation - ${workspace_loc:/${ProjName}/Debug-Tizen-Emulator} - - - org.eclipse.cdt.make.core.cleanBuildTarget - clean - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - false - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.fullBuildTarget - all - - - org.eclipse.cdt.make.core.stopOnError - true - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - true - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - org.tizen.nativecpp.apichecker.core.builder - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.core.ccnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - org.tizen.nativecpp.apichecker.core.tizenCppNature - - - - src/cocos2dx_support - 2 - PARENT-1-PROJECT_LOC/cocos2dx_support - - - src/lua - 2 - PARENT-1-PROJECT_LOC/lua - - - src/tolua - 2 - PARENT-1-PROJECT_LOC/tolua - - - diff --git a/scripting/lua/proj.tizen/src/placeholder.txt b/scripting/lua/proj.tizen/src/placeholder.txt deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tools/android-buildsetup.sh b/tools/android-buildsetup.sh deleted file mode 100755 index 1854d99b4d..0000000000 --- a/tools/android-buildsetup.sh +++ /dev/null @@ -1,85 +0,0 @@ -#!/bin/bash - -# Set up this cocos2d-x directory to build the Android port -# -# 1. Generate local.properties where necessary -# The END - -# exit this script if any commmand fails -set -e - -# read user.cfg if it exists and is readable - -_CFG_FILE=$(dirname "$0")"/user.cfg" -if [ -f "$_CFG_FILE" ] -then - [ -r "$_CFG_FILE" ] || die "Fatal Error: $_CFG_FILE exists but is unreadable" - . "$_CFG_FILE" -fi - -# paths - -if [ -z "${ANDROID_SDK_ROOT+aaa}" ]; then -# ... if ANDROID_SDK_ROOT is not set, use "$HOME/bin/android-sdk" - ANDROID_SDK_ROOT="$HOME/bin/android-sdk" -fi - -if [ -z "${ANDROID_NDK_ROOT+aaa}" ]; then -# ... if ANDROID_NDK_ROOT is not set, use "$HOME/bin/android-ndk" - ANDROID_NDK_ROOT="$HOME/bin/android-ndk" -fi - -# find current dir -SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - -# find working dir -WORKINGDIR="$(pwd)" - -# paths with defaults hardcoded to relative paths - -if [ -z "${COCOS2DX_ROOT+aaa}" ]; then - COCOS2DX_ROOT="$WORKINGDIR" -fi - -if [ ! -f "$COCOS2DX_ROOT/tools/android-buildsetup.sh" ] -then - echo "Run..." - echo "> ./tools/android-buildsetup.sh" - echo "... from the top level of the cocos2d-x source tree" - echo "OR" - echo "Run..." - echo "> COCOS2DX_ROOT= /build/setupandroid.sh" - exit -1 -fi - -echo "Paths :" -echo " ANDROID_SDK_ROOT: $ANDROID_SDK_ROOT" -echo " ANDROID_NDK_ROOT: $ANDROID_NDK_ROOT" -echo " COCOS2DX_ROOT : $COCOS2DX_ROOT" -echo " WORKINGDIR : $WORKINGDIR" -echo " SCRIPTDIR : $SCRIPTDIR" - -_CONTENTS="" -_CONTENTS+="sdk.dir=$ANDROID_SDK_ROOT"'\n' -_CONTENTS+="NDK_ROOT=$ANDROID_NDK_ROOT"'\n' -echo -echo "--- local.properties" -echo "---" -echo -e "$_CONTENTS" -echo "---" - -_ANDROIDMANIFESTS=(`find "$COCOS2DX_ROOT/cocos2dx" -type f -name "AndroidManifest.xml"`) -_ANDROIDMANIFESTS+=(`find "$COCOS2DX_ROOT/samples" -type f -name "AndroidManifest.xml"`) - -for a in "${_ANDROIDMANIFESTS[@]}"; do - _LOCAL_PROPERTIES_FILE=${a/AndroidManifest\.xml/local\.properties} - -# write local.properties if it doesn't already exist - if [ -f "$_LOCAL_PROPERTIES_FILE" ] - then - echo "$_LOCAL_PROPERTIES_FILE exists. skipping overwrite" - else - echo "writing $_LOCAL_PROPERTIES_FILE" - echo -e "$_CONTENTS" > "$_LOCAL_PROPERTIES_FILE" - fi -done diff --git a/tools/android_mk_generator/android_mk_generator.py b/tools/android-mk-generator/android_mk_generator.py similarity index 100% rename from tools/android_mk_generator/android_mk_generator.py rename to tools/android-mk-generator/android_mk_generator.py diff --git a/tools/android_mk_generator/config.py b/tools/android-mk-generator/config.py similarity index 100% rename from tools/android_mk_generator/config.py rename to tools/android-mk-generator/config.py diff --git a/tools/emscripten-templates/basic/index.html b/tools/emscripten-templates/basic/index.html deleted file mode 100644 index 2a30217165..0000000000 --- a/tools/emscripten-templates/basic/index.html +++ /dev/null @@ -1,146 +0,0 @@ - - - - - - JS_APPLICATION generated by emscripten - - - -
- Cocos2d-x -

JS_APPLICATION

-
-
- Downloading... -
-
-

WebGL Error

-

WebGL is not supported by your browser.

-
-
-

Default quality

- Not ready yet - GO! -
-
-
- -
-
- Resize canvas - Lock/hide mouse pointer -     - -
- - - - - diff --git a/tools/emscripten-templates/iphone-ipad-ipadhd/index.html b/tools/emscripten-templates/iphone-ipad-ipadhd/index.html deleted file mode 100644 index b19939e956..0000000000 --- a/tools/emscripten-templates/iphone-ipad-ipadhd/index.html +++ /dev/null @@ -1,181 +0,0 @@ - - - - - - JS_APPLICATION generated by emscripten - - - -
- Cocos2d-x -

JS_APPLICATION

-
-
- Downloading... -
-
-

WebGL Error

-

WebGL is not supported by your browser.

-
-
-

IPad HD quality

-

2048×1536px

- Not ready yet - GO! -
-
-

IPad quality

-

1024×768px

- Not ready yet - GO! -
-
-

IPhone quality

-

480×320px

- Not ready yet - GO! -
-
- - -
-
-
- -
-
- Resize canvas - Lock/hide mouse pointer -     - -
- - - - - diff --git a/tools/jenkins_scripts/Monkeyrunner_TestCpp.py b/tools/jenkins-scripts/Monkeyrunner_TestCpp.py similarity index 100% rename from tools/jenkins_scripts/Monkeyrunner_TestCpp.py rename to tools/jenkins-scripts/Monkeyrunner_TestCpp.py diff --git a/tools/jenkins_scripts/ReportManager.py b/tools/jenkins-scripts/ReportManager.py similarity index 100% rename from tools/jenkins_scripts/ReportManager.py rename to tools/jenkins-scripts/ReportManager.py diff --git a/tools/jenkins_scripts/ant.properties b/tools/jenkins-scripts/ant.properties similarity index 100% rename from tools/jenkins_scripts/ant.properties rename to tools/jenkins-scripts/ant.properties diff --git a/tools/jenkins_scripts/build.xml b/tools/jenkins-scripts/build.xml similarity index 100% rename from tools/jenkins_scripts/build.xml rename to tools/jenkins-scripts/build.xml diff --git a/tools/jenkins_scripts/mac/android/build-android-2.2-3.2-debug.sh b/tools/jenkins-scripts/mac/android/build-android-2.2-3.2-debug.sh similarity index 100% rename from tools/jenkins_scripts/mac/android/build-android-2.2-3.2-debug.sh rename to tools/jenkins-scripts/mac/android/build-android-2.2-3.2-debug.sh diff --git a/tools/jenkins_scripts/mac/android/build-android-2.2-3.2-release.sh b/tools/jenkins-scripts/mac/android/build-android-2.2-3.2-release.sh similarity index 100% rename from tools/jenkins_scripts/mac/android/build-android-2.2-3.2-release.sh rename to tools/jenkins-scripts/mac/android/build-android-2.2-3.2-release.sh diff --git a/tools/jenkins_scripts/mac/android/build-android-4.x-debug.sh b/tools/jenkins-scripts/mac/android/build-android-4.x-debug.sh similarity index 100% rename from tools/jenkins_scripts/mac/android/build-android-4.x-debug.sh rename to tools/jenkins-scripts/mac/android/build-android-4.x-debug.sh diff --git a/tools/jenkins_scripts/mac/android/build-android-4.x-release.sh b/tools/jenkins-scripts/mac/android/build-android-4.x-release.sh similarity index 100% rename from tools/jenkins_scripts/mac/android/build-android-4.x-release.sh rename to tools/jenkins-scripts/mac/android/build-android-4.x-release.sh diff --git a/tools/jenkins_scripts/mac/android/generate-js-cxx-bindings.sh b/tools/jenkins-scripts/mac/android/generate-js-cxx-bindings.sh similarity index 100% rename from tools/jenkins_scripts/mac/android/generate-js-cxx-bindings.sh rename to tools/jenkins-scripts/mac/android/generate-js-cxx-bindings.sh diff --git a/tools/jenkins_scripts/mac/android/test-android-2.2-3.2-debug.sh b/tools/jenkins-scripts/mac/android/test-android-2.2-3.2-debug.sh similarity index 100% rename from tools/jenkins_scripts/mac/android/test-android-2.2-3.2-debug.sh rename to tools/jenkins-scripts/mac/android/test-android-2.2-3.2-debug.sh diff --git a/tools/jenkins_scripts/mac/android/test-android-2.2-3.2-release.sh b/tools/jenkins-scripts/mac/android/test-android-2.2-3.2-release.sh similarity index 100% rename from tools/jenkins_scripts/mac/android/test-android-2.2-3.2-release.sh rename to tools/jenkins-scripts/mac/android/test-android-2.2-3.2-release.sh diff --git a/tools/jenkins_scripts/mac/android/test-android-4.x-debug.sh b/tools/jenkins-scripts/mac/android/test-android-4.x-debug.sh similarity index 100% rename from tools/jenkins_scripts/mac/android/test-android-4.x-debug.sh rename to tools/jenkins-scripts/mac/android/test-android-4.x-debug.sh diff --git a/tools/jenkins_scripts/mac/android/test-android-4.x-release.sh b/tools/jenkins-scripts/mac/android/test-android-4.x-release.sh similarity index 100% rename from tools/jenkins_scripts/mac/android/test-android-4.x-release.sh rename to tools/jenkins-scripts/mac/android/test-android-4.x-release.sh diff --git a/tools/jenkins_scripts/mac/debug.keystore b/tools/jenkins-scripts/mac/debug.keystore similarity index 100% rename from tools/jenkins_scripts/mac/debug.keystore rename to tools/jenkins-scripts/mac/debug.keystore diff --git a/tools/jenkins_scripts/mac/iOS_SikuliTest.sikuli/iOS_SikuliTest.html b/tools/jenkins-scripts/mac/iOS_SikuliTest.sikuli/iOS_SikuliTest.html similarity index 100% rename from tools/jenkins_scripts/mac/iOS_SikuliTest.sikuli/iOS_SikuliTest.html rename to tools/jenkins-scripts/mac/iOS_SikuliTest.sikuli/iOS_SikuliTest.html diff --git a/tools/jenkins_scripts/mac/iOS_SikuliTest.sikuli/iOS_SikuliTest.py b/tools/jenkins-scripts/mac/iOS_SikuliTest.sikuli/iOS_SikuliTest.py similarity index 100% rename from tools/jenkins_scripts/mac/iOS_SikuliTest.sikuli/iOS_SikuliTest.py rename to tools/jenkins-scripts/mac/iOS_SikuliTest.sikuli/iOS_SikuliTest.py diff --git a/tools/jenkins_scripts/mac/ios/build-ios-all.sh b/tools/jenkins-scripts/mac/ios/build-ios-all.sh similarity index 100% rename from tools/jenkins_scripts/mac/ios/build-ios-all.sh rename to tools/jenkins-scripts/mac/ios/build-ios-all.sh diff --git a/tools/jenkins_scripts/mac/ios/build-ios-debug.sh b/tools/jenkins-scripts/mac/ios/build-ios-debug.sh similarity index 100% rename from tools/jenkins_scripts/mac/ios/build-ios-debug.sh rename to tools/jenkins-scripts/mac/ios/build-ios-debug.sh diff --git a/tools/jenkins_scripts/mac/ios/build-ios-release.sh b/tools/jenkins-scripts/mac/ios/build-ios-release.sh similarity index 100% rename from tools/jenkins_scripts/mac/ios/build-ios-release.sh rename to tools/jenkins-scripts/mac/ios/build-ios-release.sh diff --git a/tools/jenkins_scripts/mac/ios/iphonesim b/tools/jenkins-scripts/mac/ios/iphonesim similarity index 100% rename from tools/jenkins_scripts/mac/ios/iphonesim rename to tools/jenkins-scripts/mac/ios/iphonesim diff --git a/tools/jenkins_scripts/mac/ios/test-ios-debug.sh b/tools/jenkins-scripts/mac/ios/test-ios-debug.sh similarity index 100% rename from tools/jenkins_scripts/mac/ios/test-ios-debug.sh rename to tools/jenkins-scripts/mac/ios/test-ios-debug.sh diff --git a/tools/jenkins_scripts/mac/ios/test-ios-release.sh b/tools/jenkins-scripts/mac/ios/test-ios-release.sh similarity index 100% rename from tools/jenkins_scripts/mac/ios/test-ios-release.sh rename to tools/jenkins-scripts/mac/ios/test-ios-release.sh diff --git a/tools/jenkins_scripts/mac/mac/build-mac-all.sh b/tools/jenkins-scripts/mac/mac/build-mac-all.sh similarity index 100% rename from tools/jenkins_scripts/mac/mac/build-mac-all.sh rename to tools/jenkins-scripts/mac/mac/build-mac-all.sh diff --git a/tools/jenkins_scripts/mac/mac/build-mac-debug.sh b/tools/jenkins-scripts/mac/mac/build-mac-debug.sh similarity index 100% rename from tools/jenkins_scripts/mac/mac/build-mac-debug.sh rename to tools/jenkins-scripts/mac/mac/build-mac-debug.sh diff --git a/tools/jenkins_scripts/mac/mac/build-mac-release.sh b/tools/jenkins-scripts/mac/mac/build-mac-release.sh similarity index 100% rename from tools/jenkins_scripts/mac/mac/build-mac-release.sh rename to tools/jenkins-scripts/mac/mac/build-mac-release.sh diff --git a/tools/jenkins_scripts/mac/mac/test-mac-debug.sh b/tools/jenkins-scripts/mac/mac/test-mac-debug.sh similarity index 100% rename from tools/jenkins_scripts/mac/mac/test-mac-debug.sh rename to tools/jenkins-scripts/mac/mac/test-mac-debug.sh diff --git a/tools/jenkins_scripts/mac/mac/test-mac-release.sh b/tools/jenkins-scripts/mac/mac/test-mac-release.sh similarity index 100% rename from tools/jenkins_scripts/mac/mac/test-mac-release.sh rename to tools/jenkins-scripts/mac/mac/test-mac-release.sh diff --git a/tools/jenkins_scripts/mac/rootconfig-mac.sh b/tools/jenkins-scripts/mac/rootconfig-mac.sh similarity index 100% rename from tools/jenkins_scripts/mac/rootconfig-mac.sh rename to tools/jenkins-scripts/mac/rootconfig-mac.sh diff --git a/tools/jenkins_scripts/windows/android/androidtestcommon.bat b/tools/jenkins-scripts/windows/android/androidtestcommon.bat similarity index 100% rename from tools/jenkins_scripts/windows/android/androidtestcommon.bat rename to tools/jenkins-scripts/windows/android/androidtestcommon.bat diff --git a/tools/jenkins_scripts/windows/android/build-android-2.2-3.2-debug.bat b/tools/jenkins-scripts/windows/android/build-android-2.2-3.2-debug.bat similarity index 100% rename from tools/jenkins_scripts/windows/android/build-android-2.2-3.2-debug.bat rename to tools/jenkins-scripts/windows/android/build-android-2.2-3.2-debug.bat diff --git a/tools/jenkins_scripts/windows/android/build-android-2.2-3.2-release.bat b/tools/jenkins-scripts/windows/android/build-android-2.2-3.2-release.bat similarity index 100% rename from tools/jenkins_scripts/windows/android/build-android-2.2-3.2-release.bat rename to tools/jenkins-scripts/windows/android/build-android-2.2-3.2-release.bat diff --git a/tools/jenkins_scripts/windows/android/build-android-4.x-debug.bat b/tools/jenkins-scripts/windows/android/build-android-4.x-debug.bat similarity index 100% rename from tools/jenkins_scripts/windows/android/build-android-4.x-debug.bat rename to tools/jenkins-scripts/windows/android/build-android-4.x-debug.bat diff --git a/tools/jenkins_scripts/windows/android/build-android-4.x-release.bat b/tools/jenkins-scripts/windows/android/build-android-4.x-release.bat similarity index 100% rename from tools/jenkins_scripts/windows/android/build-android-4.x-release.bat rename to tools/jenkins-scripts/windows/android/build-android-4.x-release.bat diff --git a/tools/jenkins_scripts/windows/android/rootconfig.sh b/tools/jenkins-scripts/windows/android/rootconfig.sh similarity index 100% rename from tools/jenkins_scripts/windows/android/rootconfig.sh rename to tools/jenkins-scripts/windows/android/rootconfig.sh diff --git a/tools/jenkins_scripts/windows/android/test-android-2.2-3.2-debug.bat b/tools/jenkins-scripts/windows/android/test-android-2.2-3.2-debug.bat similarity index 100% rename from tools/jenkins_scripts/windows/android/test-android-2.2-3.2-debug.bat rename to tools/jenkins-scripts/windows/android/test-android-2.2-3.2-debug.bat diff --git a/tools/jenkins_scripts/windows/android/test-android-2.2-3.2-release.bat b/tools/jenkins-scripts/windows/android/test-android-2.2-3.2-release.bat similarity index 100% rename from tools/jenkins_scripts/windows/android/test-android-2.2-3.2-release.bat rename to tools/jenkins-scripts/windows/android/test-android-2.2-3.2-release.bat diff --git a/tools/jenkins_scripts/windows/android/test-android-4.x-debug.bat b/tools/jenkins-scripts/windows/android/test-android-4.x-debug.bat similarity index 100% rename from tools/jenkins_scripts/windows/android/test-android-4.x-debug.bat rename to tools/jenkins-scripts/windows/android/test-android-4.x-debug.bat diff --git a/tools/jenkins_scripts/windows/android/test-android-4.x-release.bat b/tools/jenkins-scripts/windows/android/test-android-4.x-release.bat similarity index 100% rename from tools/jenkins_scripts/windows/android/test-android-4.x-release.bat rename to tools/jenkins-scripts/windows/android/test-android-4.x-release.bat diff --git a/tools/jenkins_scripts/windows/win32/qtp_win32/Action0/ObjectRepository.bdb.REMOVED.git-id b/tools/jenkins-scripts/windows/win32/qtp_win32/Action0/ObjectRepository.bdb.REMOVED.git-id similarity index 100% rename from tools/jenkins_scripts/windows/win32/qtp_win32/Action0/ObjectRepository.bdb.REMOVED.git-id rename to tools/jenkins-scripts/windows/win32/qtp_win32/Action0/ObjectRepository.bdb.REMOVED.git-id diff --git a/tools/jenkins_scripts/windows/win32/qtp_win32/Action0/Resource.mtr b/tools/jenkins-scripts/windows/win32/qtp_win32/Action0/Resource.mtr similarity index 100% rename from tools/jenkins_scripts/windows/win32/qtp_win32/Action0/Resource.mtr rename to tools/jenkins-scripts/windows/win32/qtp_win32/Action0/Resource.mtr diff --git a/tools/jenkins_scripts/windows/win32/qtp_win32/Action0/Script.mts b/tools/jenkins-scripts/windows/win32/qtp_win32/Action0/Script.mts similarity index 100% rename from tools/jenkins_scripts/windows/win32/qtp_win32/Action0/Script.mts rename to tools/jenkins-scripts/windows/win32/qtp_win32/Action0/Script.mts diff --git a/tools/jenkins_scripts/windows/win32/qtp_win32/Action1/ObjectRepository.bdb.REMOVED.git-id b/tools/jenkins-scripts/windows/win32/qtp_win32/Action1/ObjectRepository.bdb.REMOVED.git-id similarity index 100% rename from tools/jenkins_scripts/windows/win32/qtp_win32/Action1/ObjectRepository.bdb.REMOVED.git-id rename to tools/jenkins-scripts/windows/win32/qtp_win32/Action1/ObjectRepository.bdb.REMOVED.git-id diff --git a/tools/jenkins_scripts/windows/win32/qtp_win32/Action1/Resource.mtr b/tools/jenkins-scripts/windows/win32/qtp_win32/Action1/Resource.mtr similarity index 100% rename from tools/jenkins_scripts/windows/win32/qtp_win32/Action1/Resource.mtr rename to tools/jenkins-scripts/windows/win32/qtp_win32/Action1/Resource.mtr diff --git a/tools/jenkins_scripts/windows/win32/qtp_win32/Action1/Script.mts b/tools/jenkins-scripts/windows/win32/qtp_win32/Action1/Script.mts similarity index 100% rename from tools/jenkins_scripts/windows/win32/qtp_win32/Action1/Script.mts rename to tools/jenkins-scripts/windows/win32/qtp_win32/Action1/Script.mts diff --git a/tools/jenkins_scripts/windows/win32/qtp_win32/Default.xls b/tools/jenkins-scripts/windows/win32/qtp_win32/Default.xls similarity index 100% rename from tools/jenkins_scripts/windows/win32/qtp_win32/Default.xls rename to tools/jenkins-scripts/windows/win32/qtp_win32/Default.xls diff --git a/tools/jenkins_scripts/windows/win32/qtp_win32/Error_Sub.vbs b/tools/jenkins-scripts/windows/win32/qtp_win32/Error_Sub.vbs similarity index 100% rename from tools/jenkins_scripts/windows/win32/qtp_win32/Error_Sub.vbs rename to tools/jenkins-scripts/windows/win32/qtp_win32/Error_Sub.vbs diff --git a/tools/jenkins_scripts/windows/win32/qtp_win32/Error_appcrash.qrs b/tools/jenkins-scripts/windows/win32/qtp_win32/Error_appcrash.qrs similarity index 100% rename from tools/jenkins_scripts/windows/win32/qtp_win32/Error_appcrash.qrs rename to tools/jenkins-scripts/windows/win32/qtp_win32/Error_appcrash.qrs diff --git a/tools/jenkins_scripts/windows/win32/qtp_win32/Parameters.mtr b/tools/jenkins-scripts/windows/win32/qtp_win32/Parameters.mtr similarity index 100% rename from tools/jenkins_scripts/windows/win32/qtp_win32/Parameters.mtr rename to tools/jenkins-scripts/windows/win32/qtp_win32/Parameters.mtr diff --git a/tools/jenkins_scripts/windows/win32/qtp_win32/Test.tsp b/tools/jenkins-scripts/windows/win32/qtp_win32/Test.tsp similarity index 100% rename from tools/jenkins_scripts/windows/win32/qtp_win32/Test.tsp rename to tools/jenkins-scripts/windows/win32/qtp_win32/Test.tsp diff --git a/tools/jenkins_scripts/windows/win32/qtp_win32/TestCpp_Appcrash.tsr.REMOVED.git-id b/tools/jenkins-scripts/windows/win32/qtp_win32/TestCpp_Appcrash.tsr.REMOVED.git-id similarity index 100% rename from tools/jenkins_scripts/windows/win32/qtp_win32/TestCpp_Appcrash.tsr.REMOVED.git-id rename to tools/jenkins-scripts/windows/win32/qtp_win32/TestCpp_Appcrash.tsr.REMOVED.git-id diff --git a/tools/jenkins_scripts/windows/win32/qtp_win32/default.cfg b/tools/jenkins-scripts/windows/win32/qtp_win32/default.cfg similarity index 100% rename from tools/jenkins_scripts/windows/win32/qtp_win32/default.cfg rename to tools/jenkins-scripts/windows/win32/qtp_win32/default.cfg diff --git a/tools/jenkins_scripts/windows/win32/qtp_win32/default.usp b/tools/jenkins-scripts/windows/win32/qtp_win32/default.usp similarity index 100% rename from tools/jenkins_scripts/windows/win32/qtp_win32/default.usp rename to tools/jenkins-scripts/windows/win32/qtp_win32/default.usp diff --git a/tools/jenkins_scripts/windows/win32/qtp_win32/lock.lck b/tools/jenkins-scripts/windows/win32/qtp_win32/lock.lck similarity index 100% rename from tools/jenkins_scripts/windows/win32/qtp_win32/lock.lck rename to tools/jenkins-scripts/windows/win32/qtp_win32/lock.lck diff --git a/tools/jenkins_scripts/windows/win32/qtp_win32/qtp_win32.usr b/tools/jenkins-scripts/windows/win32/qtp_win32/qtp_win32.usr similarity index 100% rename from tools/jenkins_scripts/windows/win32/qtp_win32/qtp_win32.usr rename to tools/jenkins-scripts/windows/win32/qtp_win32/qtp_win32.usr diff --git a/tools/jenkins_scripts/windows/win32/qtp_win32/qtrunner.vbs b/tools/jenkins-scripts/windows/win32/qtp_win32/qtrunner.vbs similarity index 100% rename from tools/jenkins_scripts/windows/win32/qtp_win32/qtrunner.vbs rename to tools/jenkins-scripts/windows/win32/qtp_win32/qtrunner.vbs diff --git a/tools/jenkins_scripts/windows/win32/test-win-vs2008-debug.bat b/tools/jenkins-scripts/windows/win32/test-win-vs2008-debug.bat similarity index 100% rename from tools/jenkins_scripts/windows/win32/test-win-vs2008-debug.bat rename to tools/jenkins-scripts/windows/win32/test-win-vs2008-debug.bat diff --git a/tools/jenkins_scripts/windows/win32/test-win-vs2008_release.bat b/tools/jenkins-scripts/windows/win32/test-win-vs2008_release.bat similarity index 100% rename from tools/jenkins_scripts/windows/win32/test-win-vs2008_release.bat rename to tools/jenkins-scripts/windows/win32/test-win-vs2008_release.bat diff --git a/tools/jenkins_scripts/windows/win32/test-win-vs2010_debug.bat b/tools/jenkins-scripts/windows/win32/test-win-vs2010_debug.bat similarity index 100% rename from tools/jenkins_scripts/windows/win32/test-win-vs2010_debug.bat rename to tools/jenkins-scripts/windows/win32/test-win-vs2010_debug.bat diff --git a/tools/jenkins_scripts/windows/win32/test-win-vs2010_release.bat b/tools/jenkins-scripts/windows/win32/test-win-vs2010_release.bat similarity index 100% rename from tools/jenkins_scripts/windows/win32/test-win-vs2010_release.bat rename to tools/jenkins-scripts/windows/win32/test-win-vs2010_release.bat diff --git a/tools/project_creator/__init__.py b/tools/project-creator/__init__.py similarity index 100% rename from tools/project_creator/__init__.py rename to tools/project-creator/__init__.py diff --git a/tools/project_creator/create_project.py b/tools/project-creator/create_project.py similarity index 100% rename from tools/project_creator/create_project.py rename to tools/project-creator/create_project.py From 5acbe663e09c0199263bbaa9b0434d4082eb53d0 Mon Sep 17 00:00:00 2001 From: minggo Date: Sat, 12 Oct 2013 13:44:57 +0800 Subject: [PATCH 13/64] issue #2905: add missing files --- CODING_STYLE.md | 131 - Emscripten.TODO | 60 - RELEASE_NOTES | 4 - .../bindings/js/debugger/DevToolsUtils.js | 133 + .../javascript/bindings/js/debugger/README.md | 54 + .../bindings/js/debugger/actors/root.js | 329 ++ .../bindings/js/debugger/actors/script.js | 2948 +++++++++++++++++ .../bindings/js/debugger/core/promise.js | 294 ++ .../javascript/bindings/js/debugger/main.js | 928 ++++++ .../bindings/js/debugger/transport.js | 288 ++ 10 files changed, 4974 insertions(+), 195 deletions(-) delete mode 100644 CODING_STYLE.md delete mode 100644 Emscripten.TODO delete mode 100644 RELEASE_NOTES create mode 100644 cocos/scripting/javascript/bindings/js/debugger/DevToolsUtils.js create mode 100644 cocos/scripting/javascript/bindings/js/debugger/README.md create mode 100644 cocos/scripting/javascript/bindings/js/debugger/actors/root.js create mode 100644 cocos/scripting/javascript/bindings/js/debugger/actors/script.js create mode 100644 cocos/scripting/javascript/bindings/js/debugger/core/promise.js create mode 100644 cocos/scripting/javascript/bindings/js/debugger/main.js create mode 100644 cocos/scripting/javascript/bindings/js/debugger/transport.js diff --git a/CODING_STYLE.md b/CODING_STYLE.md deleted file mode 100644 index 4b7bf2a7c8..0000000000 --- a/CODING_STYLE.md +++ /dev/null @@ -1,131 +0,0 @@ -# cocos2d-x C++ coding sytle - - -## Detailed information - -Please, refer to this document for a detailed version of the cocos2d-x C++ coding sytle: - -* [cocos2d-x c++ coding style](http://www.cocos2d-x.org/wiki/Cocos2d_c++_coding_style) - - -## Quick Sample - -Use this sample as a quick reference. But DO READ the detailed doc for more info. - -Header file: - -```c++ -/** - * We use Doxygen strings for documentation. - * All public classes, methods, structs should be documented using Doxygen Strings - */ -class CC_DLL Sprite : public NodeRGBA, public TextureProtocol -{ /* class braces start in a new line */ - -/* no indentation here for public, protected or private */ -/* First add all the "public" stuff, then all the "protected" stuff, and finally all the "private" stuff -public: - - /* we don't use tabs, we use spaces, and we use a 4 space identation */ - /* 1st add all static const */ - static const int INDEX_NOT_INITIALIZED = -1; - - /* then add all the creators and other relevant static methods */ - static Sprite* create(); - static Sprite* create(const char *filename); - static Sprite* create(const char *filename, const Rect& rect); - - /* if applicable, then add the consturctors / destructors */ - Sprite(); - virtual ~Sprite(void); - - /* then add all the initialization methods */ - /* notice that they are in the same order as the creators */ - virtual bool init(void); - virtual bool initWithTexture(Texture2D *texture); - virtual bool initWithTexture(Texture2D *texture, const Rect& rect); - - - - /* then add the regular instace methods */ - virtual void updateTransform(void); - virtual SpriteBatchNode* getBatchNode(void); - virtual void setBatchNode(SpriteBatchNode *spriteBatchNode); - - - /* then add all the overriden methods */ - /* notice that all overriden methods must use the 'override' keyword */ - /* overriden methods are not forced to have doxygen strings UNLESS they change the behavior in a non obvios way */ - virtual void setPosition(const Point& pos) override; - virtual void setRotation(float rotation) override; - virtual void setRotationX(float rotationX) override; - - - /* once you finish with the 'public' methods, start with the 'protected' ones */ -protected: - - /* protected methods are not forced to have Doxygen strings, but if they have it, better */ - void updateColor(void); - virtual void setTextureCoords(Rect rect); - - /* After adding all the methods, add the ivars */ - /* all ivars must start with _ */ - /* Do not use Hungarian notation */ - TextureAtlas* _textureAtlas; - int _atlasIndex; - SpriteBatchNode* _batchNode; -}; - -``` - -Implementation file: - -```c++ -/* Do not use doxygen comments on the implementation file */ - -/* The methos MUST be in the same order as where declared in the header file */ - -Sprite* Sprite::create(const char *filename) -{ - /* Don't use tabs. Use spaces. Use 4-space indentation */ - Sprite *sprite = new Sprite(); - - /* put curly braces in the same line as in the 'if'*/ - /* leave a space between the 'if' and the '(' */ - /* don't leave spaces between '()' */ - if (sprite && sprite->initWithFile(filename)) { - sprite->autorelease(); - return sprite; - } - CC_SAFE_DELETE(sprite); - return NULL; -} - -/* Initialization list can be indented to 0 spaces, or to 4 spaces. If in doubt, be consistent with the indentation already used in the file */ -/* Only use the Initialization lists for types that can't fail when initialized */ -Sprite::Sprite() -: _shouldBeHidden(false) -, _texture(nullptr) -, _physicsBody(nullptr) -{ -} - -/* use the 'initXXX' methods to initialize types that might fail */ -bool Sprite::initWithTexture(Texture2D *texture, const Rect& rect, bool rotated) -{ - /* it ok not use use curly braces */ - if (something) - do_something(); - else - something_else(); - - /* but if you use curly branches in one branch, all the branches should use curly branches */ - if (something) { - do_something1(); - do_something2(); - } else { - so_something_else(); - } -} - -``` diff --git a/Emscripten.TODO b/Emscripten.TODO deleted file mode 100644 index a00ca3ce9e..0000000000 --- a/Emscripten.TODO +++ /dev/null @@ -1,60 +0,0 @@ -* Need to figure out how to get correct screen resolutions consistently. - -* Touch handler screwed up after TouchesTest? MenuTest? (TestCpp sample) - -* TTF Font rendering is slow and seems to wrap around by a few pixels - horizontally. Need to investigate here, but I suspect the right answer is to - offload font rendering to an offscreen canvas and let the browser handle it. - Potentially creates new challenges in packaging which would need to be solved - somehow. - - - -### -DONE: -### - -* Need to switch to server-side buffers in -- cocos2dx/draw_nodes/CCDrawingPrimitives - -* Need to compile with -O2 -- possible -s VERBOSE=1 will give a clue? - -* SchedulerTest crashes - - cocos2d::CCNode::boundingBox() - -* Parallax Test crashes - - cocos2d::CCAtlasNode::calculateMaxItems() - -* Particle Test crashes - - TIFFClientOpen not a function. Looks like we need to build and link in libtiff. - -* cocos2d::CCAtlasNode::calculateMaxItems() throwing an error; related to - CCTextureAtlas? Preventing particle test from working. - -* Need to switch to server-side buffers in -- cocos2dx/draw_nodes/CCDrawNode.cpp -- Think this is fixed by undef CC_TEXTURE_ATLAS_USE_VAO? -- cocos2dx/particle_nodes/CCParticleSystemQuad.cpp -- Think this is fixed by CC_REBIND_INDICES_BUFFER? -- cocos2dx/textures/CCTextureAtlas.cpp -- Think this works already. - -* Layer Test crashes - - cocos2d::CCLabelBMFont::create(char const*, char const*, float, cocos2d::CCTextAlignment, cocos2d::CCPoint) - -* IntervalTest crashes - - cocos2d::CCLabelBMFont::create(char const*, char const*, float, cocos2d::CCTextAlignment, cocos2d::CCPoint) - -* TileMap Test crashes - - void CCNode::insertChild(CCNode* child, int z) - -* LabelTest crashes - - cocos2d::CCAtlasNode::calculateMaxItems() - -* ZwoptexTest crashes. - - ZwoptexGenericTest::onEnter() - -* ChipmunkTest crashes: - Aborting due to Chipmunk error: Moment of Inertia must be positive and non-zero. - Failed condition: moment > 0.0f - Source:../src/cpBody.c:151 - -* Add linkage to libjpeg to get RenderTexture test to work. - diff --git a/RELEASE_NOTES b/RELEASE_NOTES deleted file mode 100644 index f10872da6c..0000000000 --- a/RELEASE_NOTES +++ /dev/null @@ -1,4 +0,0 @@ -===== cocos2d-x 3.0 Release Notes ===== - -Please, read the online release notes document: -http://www.cocos2d-x.org/wiki/Release_Notes_for_Cocos2d-x_v300 \ No newline at end of file diff --git a/cocos/scripting/javascript/bindings/js/debugger/DevToolsUtils.js b/cocos/scripting/javascript/bindings/js/debugger/DevToolsUtils.js new file mode 100644 index 0000000000..26d0597644 --- /dev/null +++ b/cocos/scripting/javascript/bindings/js/debugger/DevToolsUtils.js @@ -0,0 +1,133 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +"use strict"; + +function utf16to8(str) { + var out, i, len, c; + + out = ""; + len = str.length; + for(i = 0; i < len; i++) + { + c = str.charCodeAt(i); + if ((c >= 0x0001) && (c <= 0x007F)) + { + out += str.charAt(i); + } + else if (c > 0x07FF) + { + out += String.fromCharCode(0xE0 | ((c >> 12) & 0x0F)); + out += String.fromCharCode(0x80 | ((c >> 6) & 0x3F)); + out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F)); + } + else + { + out += String.fromCharCode(0xC0 | ((c >> 6) & 0x1F)); + out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F)); + } + } + return out; +} + +function utf8to16(str) { + var out, i, len, c; + var char2, char3; + + out = ""; + len = str.length; + i = 0; + while(i < len) { c = str.charCodeAt(i++); switch(c >> 4) + { + case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: + // 0xxxxxxx + out += str.charAt(i-1); + break; + case 12: case 13: + // 110x xxxx 10xx xxxx + char2 = str.charCodeAt(i++); + out += String.fromCharCode(((c & 0x1F) << 6) | (char2 & 0x3F)); + break; + case 14: + // 1110 xxxx 10xx xxxx 10xx xxxx + char2 = str.charCodeAt(i++); + char3 = str.charCodeAt(i++); + out += String.fromCharCode(((c & 0x0F) << 12) | + ((char2 & 0x3F) << 6) | + ((char3 & 0x3F) << 0)); + break; + } + } + + return out; + } + +var dump = function(msg) { + log(msg); +}; + +/* General utilities used throughout devtools. */ + +/* Turn the error e into a string, without fail. */ +this.safeErrorString = function safeErrorString(aError) { + try { + var s = aError.toString(); + if (typeof s === "string") + return s; + } catch (ee) { } + + return ""; +} + +/** + * Report that |aWho| threw an exception, |aException|. + */ +this.reportException = function reportException(aWho, aException) { + let msg = aWho + " threw an exception: " + safeErrorString(aException); + if (aException.stack) { + msg += "\nCall stack:\n" + aException.stack; + } + + dump(msg + "\n"); + + // if (Components.utils.reportError) { + // /* + // * Note that the xpcshell test harness registers an observer for + // * console messages, so when we're running tests, this will cause + // * the test to quit. + // */ + // Components.utils.reportError(msg); + // } +} + +/** + * Given a handler function that may throw, return an infallible handler + * function that calls the fallible handler, and logs any exceptions it + * throws. + * + * @param aHandler function + * A handler function, which may throw. + * @param aName string + * A name for aHandler, for use in error messages. If omitted, we use + * aHandler.name. + * + * (SpiderMonkey does generate good names for anonymous functions, but we + * don't have a way to get at them from JavaScript at the moment.) + */ +this.makeInfallible = function makeInfallible(aHandler, aName) { + if (!aName) + aName = aHandler.name; + + return function (/* arguments */) { + try { + return aHandler.apply(this, arguments); + } catch (ex) { + let who = "Handler function"; + if (aName) { + who += " " + aName; + } + reportException(who, ex); + } + } +} diff --git a/cocos/scripting/javascript/bindings/js/debugger/README.md b/cocos/scripting/javascript/bindings/js/debugger/README.md new file mode 100644 index 0000000000..9e1d7bebd0 --- /dev/null +++ b/cocos/scripting/javascript/bindings/js/debugger/README.md @@ -0,0 +1,54 @@ +Remote Debugging By Using FireFox +================================= + +Requirement +----------- + +* Firefox: From v24 + +How To Use +---------- + +### Prepare ### + +Please refer to https://developer.mozilla.org/en-US/docs/Tools/Remote_Debugging . + +### Enable Debugger Support For Your JSB Project ### + +``` +bool AppDelegate::applicationDidFinishLaunching() +{ + ... + + ScriptingCore* sc = ScriptingCore::getInstance(); + sc->addRegisterCallback(register_all_cocos2dx); + sc->addRegisterCallback(register_all_cocos2dx_extension); + sc->addRegisterCallback(register_cocos2dx_js_extensions); + sc->addRegisterCallback(jsb_register_chipmunk); + sc->addRegisterCallback(register_all_cocos2dx_extension_manual); + sc->addRegisterCallback(register_CCBuilderReader); + sc->addRegisterCallback(jsb_register_system); + sc->addRegisterCallback(JSB_register_opengl); + + sc->start(); + +#if defined(COCOS2D_DEBUG) && (COCOS2D_DEBUG > 0) + sc->enableDebugger(); // Enable debugger here +#endif + + ... +} +``` + +Run your game. + +### Open Firefox And Follow The Step As Follows ### + + +![pic 1](https://lh5.googleusercontent.com/-HoxLGBdV2J0/UlZ7ZoFUjyI/AAAAAAAAADM/68GDaCQ1vP0/s0-I/Firefox-Remote-Debug01.jpg) +![pic 2](https://lh6.googleusercontent.com/-7FDIHAYsKAY/UlZ7Yf8W-pI/AAAAAAAAAFQ/joG0AymnuBk/s0-I/Firefox-Remote-Debug02.jpg) +![pic 3](https://lh4.googleusercontent.com/-idvnMRGcGy8/UlZ7Wj6DDuI/AAAAAAAAAC0/L9IVyHLNqeQ/s0-I/Firefox-Remote-Debug04.jpg) +![pic 4](https://lh6.googleusercontent.com/-YuZj7JGAtFE/UlZ9DDGDczI/AAAAAAAAAEQ/D2qIedjP5FU/s0-I/Firefox-Remote-Debug04.png.png) +![pic 5](https://lh3.googleusercontent.com/-cdIcNa3jT5c/UlZ9uapf3OI/AAAAAAAAAEg/MGq3vLHsauw/s0-I/Firefox-Remote-Debug05.png) +![pic 6](https://lh5.googleusercontent.com/-T79-o5ylJKI/UlZ_JJQe3MI/AAAAAAAAAE8/F63fSVxlJKs/s0-I/Firefox-Remote-Debug06.png) + diff --git a/cocos/scripting/javascript/bindings/js/debugger/actors/root.js b/cocos/scripting/javascript/bindings/js/debugger/actors/root.js new file mode 100644 index 0000000000..aa0d85342b --- /dev/null +++ b/cocos/scripting/javascript/bindings/js/debugger/actors/root.js @@ -0,0 +1,329 @@ +/* -*- tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ft=javascript ts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +"use strict"; + +/* Root actor for the remote debugging protocol. */ + +/** + * Methods shared between RootActor and BrowserTabActor. + */ + +/** + * Populate |this._extraActors| as specified by |aFactories|, reusing whatever + * actors are already there. Add all actors in the final extra actors table to + * |aPool|. + * + * The root actor and the tab actor use this to instantiate actors that other + * parts of the browser have specified with DebuggerServer.addTabActor antd + * DebuggerServer.addGlobalActor. + * + * @param aFactories + * An object whose own property names are the names of properties to add to + * some reply packet (say, a tab actor grip or the "listTabs" response + * form), and whose own property values are actor constructor functions, as + * documented for addTabActor and addGlobalActor. + * + * @param this + * The BrowserRootActor or BrowserTabActor with which the new actors will + * be associated. It should support whatever API the |aFactories| + * constructor functions might be interested in, as it is passed to them. + * For the sake of CommonCreateExtraActors itself, it should have at least + * the following properties: + * + * - _extraActors + * An object whose own property names are factory table (and packet) + * property names, and whose values are no-argument actor constructors, + * of the sort that one can add to an ActorPool. + * + * - conn + * The DebuggerServerConnection in which the new actors will participate. + * + * - actorID + * The actor's name, for use as the new actors' parentID. + */ +function CommonCreateExtraActors(aFactories, aPool) { + // Walk over global actors added by extensions. + for (let name in aFactories) { + let actor = this._extraActors[name]; + if (!actor) { + actor = aFactories[name].bind(null, this.conn, this); + actor.prototype = aFactories[name].prototype; + actor.parentID = this.actorID; + this._extraActors[name] = actor; + } + aPool.addActor(actor); + } +} + +/** + * Append the extra actors in |this._extraActors|, constructed by a prior call + * to CommonCreateExtraActors, to |aObject|. + * + * @param aObject + * The object to which the extra actors should be added, under the + * property names given in the |aFactories| table passed to + * CommonCreateExtraActors. + * + * @param this + * The BrowserRootActor or BrowserTabActor whose |_extraActors| table we + * should use; see above. + */ +function CommonAppendExtraActors(aObject) { + for (let name in this._extraActors) { + let actor = this._extraActors[name]; + aObject[name] = actor.actorID; + } +} + +/** + * Create a remote debugging protocol root actor. + * + * @param aConnection + * The DebuggerServerConnection whose root actor we are constructing. + * + * @param aParameters + * The properties of |aParameters| provide backing objects for the root + * actor's requests; if a given property is omitted from |aParameters|, the + * root actor won't implement the corresponding requests or notifications. + * Supported properties: + * + * - tabList: a live list (see below) of tab actors. If present, the + * new root actor supports the 'listTabs' request, providing the live + * list's elements as its tab actors, and sending 'tabListChanged' + * notifications when the live list's contents change. One actor in + * this list must have a true '.selected' property. + * + * - globalActorFactories: an object |A| describing further actors to + * attach to the 'listTabs' reply. This is the type accumulated by + * DebuggerServer.addGlobalActor. For each own property |P| of |A|, + * the root actor adds a property named |P| to the 'listTabs' + * reply whose value is the name of an actor constructed by + * |A[P]|. + * + * - onShutdown: a function to call when the root actor is disconnected. + * + * Instance properties: + * + * - applicationType: the string the root actor will include as the + * "applicationType" property in the greeting packet. By default, this + * is "browser". + * + * Live lists: + * + * A "live list", as used for the |tabList|, is an object that presents a + * list of actors, and also notifies its clients of changes to the list. A + * live list's interface is two properties: + * + * - iterator: a method that returns an iterator. A for-of loop will call + * this method to obtain an iterator for the loop, so if LL is + * a live list, one can simply write 'for (i of LL) ...'. + * + * - onListChanged: a handler called, with no arguments, when the set of + * values the iterator would produce has changed since the last + * time 'iterator' was called. This may only be set to null or a + * callable value (one for which the typeof operator returns + * 'function'). (Note that the live list will not call the + * onListChanged handler until the list has been iterated over + * once; if nobody's seen the list in the first place, nobody + * should care if its contents have changed!) + * + * When the list changes, the list implementation should ensure that any + * actors yielded in previous iterations whose referents (tabs) still exist + * get yielded again in subsequent iterations. If the underlying referent + * is the same, the same actor should be presented for it. + * + * The root actor registers an 'onListChanged' handler on the appropriate + * list when it may need to send the client 'tabListChanged' notifications, + * and is careful to remove the handler whenever it does not need to send + * such notifications (including when it is disconnected). This means that + * live list implementations can use the state of the handler property (set + * or null) to install and remove observers and event listeners. + * + * Note that, as the only way for the root actor to see the members of the + * live list is to begin an iteration over the list, the live list need not + * actually produce any actors until they are reached in the course of + * iteration: alliterative lazy live lists. + */ +function RootActor(aConnection, aParameters) { + this.conn = aConnection; + this._parameters = aParameters; + this._onTabListChanged = this.onTabListChanged.bind(this); + this._extraActors = {}; +} + +RootActor.prototype = { + constructor: RootActor, + applicationType: "browser", + + /** + * Return a 'hello' packet as specified by the Remote Debugging Protocol. + */ + sayHello: function() { + return { + from: "root", + applicationType: this.applicationType, + /* This is not in the spec, but it's used by tests. */ + testConnectionPrefix: this.conn.prefix, + traits: { + sources: true + } + }; + }, + + /** + * Disconnects the actor from the browser window. + */ + disconnect: function() { + /* Tell the live lists we aren't watching any more. */ + if (this._parameters.tabList) { + this._parameters.tabList.onListChanged = null; + } + if (typeof this._parameters.onShutdown === 'function') { + this._parameters.onShutdown(); + } + this._extraActors = null; + }, + + /* The 'listTabs' request and the 'tabListChanged' notification. */ + + /** + * Handles the listTabs request. The actors will survive until at least + * the next listTabs request. + */ + onListTabs: function() { + + let tabList = this._parameters.tabList; + if (!tabList) { + return { from: "root", error: "noTabs", + message: "This root actor has no browser tabs." }; + } + + /* + * Walk the tab list, accumulating the array of tab actors for the + * reply, and moving all the actors to a new ActorPool. We'll + * replace the old tab actor pool with the one we build here, thus + * retiring any actors that didn't get listed again, and preparing any + * new actors to receive packets. + */ + let newActorPool = new ActorPool(this.conn); + let tabActorList = []; + let selected; + for (let tabActor of tabList) { + if (tabActor.selected) { + selected = tabActorList.length; + } + tabActor.parentID = this.actorID; + newActorPool.addActor(tabActor); + tabActorList.push(tabActor); + } + + /* DebuggerServer.addGlobalActor support: create actors. */ + this._createExtraActors(this._parameters.globalActorFactories, newActorPool); + + /* + * Drop the old actorID -> actor map. Actors that still mattered were + * added to the new map; others will go away. + */ + if (this._tabActorPool) { + this.conn.removeActorPool(this._tabActorPool); + } + this._tabActorPool = newActorPool; + this.conn.addActorPool(this._tabActorPool); + + let reply = { + "from": "root", + "selected": selected || 0, + "tabs": [actor.grip() for (actor of tabActorList)] + }; + + /* DebuggerServer.addGlobalActor support: name actors in 'listTabs' reply. */ + this._appendExtraActors(reply); + + /* + * Now that we're actually going to report the contents of tabList to + * the client, we're responsible for letting the client know if it + * changes. + */ + tabList.onListChanged = this._onTabListChanged; + + return reply; + }, + + onTabListChanged: function () { + this.conn.send({ from:"root", type:"tabListChanged" }); + /* It's a one-shot notification; no need to watch any more. */ + this._parameters.tabList.onListChanged = null; + }, + + /* This is not in the spec, but it's used by tests. */ + onEcho: (aRequest) => aRequest, + + /* Support for DebuggerServer.addGlobalActor. */ + _createExtraActors: CommonCreateExtraActors, + _appendExtraActors: CommonAppendExtraActors, + + /* ThreadActor hooks. */ + + /** + * Prepare to enter a nested event loop by disabling debuggee events. + */ + preNest: function() { + // Disable events in all open windows. + let e = windowMediator.getEnumerator(null); + while (e.hasMoreElements()) { + let win = e.getNext(); + let windowUtils = win.QueryInterface(Ci.nsIInterfaceRequestor) + .getInterface(Ci.nsIDOMWindowUtils); + windowUtils.suppressEventHandling(true); + windowUtils.suspendTimeouts(); + } + }, + + /** + * Prepare to exit a nested event loop by enabling debuggee events. + */ + postNest: function(aNestData) { + // Enable events in all open windows. + let e = windowMediator.getEnumerator(null); + while (e.hasMoreElements()) { + let win = e.getNext(); + let windowUtils = win.QueryInterface(Ci.nsIInterfaceRequestor) + .getInterface(Ci.nsIDOMWindowUtils); + windowUtils.resumeTimeouts(); + windowUtils.suppressEventHandling(false); + } + }, + + /* ChromeDebuggerActor hooks. */ + + /** + * Add the specified actor to the default actor pool connection, in order to + * keep it alive as long as the server is. This is used by breakpoints in the + * thread and chrome debugger actors. + * + * @param actor aActor + * The actor object. + */ + addToParentPool: function(aActor) { + this.conn.addActor(aActor); + }, + + /** + * Remove the specified actor from the default actor pool. + * + * @param BreakpointActor aActor + * The actor object. + */ + removeFromParentPool: function(aActor) { + this.conn.removeActor(aActor); + } +} + +RootActor.prototype.requestTypes = { + "listTabs": RootActor.prototype.onListTabs, + "echo": RootActor.prototype.onEcho +}; diff --git a/cocos/scripting/javascript/bindings/js/debugger/actors/script.js b/cocos/scripting/javascript/bindings/js/debugger/actors/script.js new file mode 100644 index 0000000000..7ddade2b54 --- /dev/null +++ b/cocos/scripting/javascript/bindings/js/debugger/actors/script.js @@ -0,0 +1,2948 @@ +/* -*- Mode: javascript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; js-indent-level: 2; -*- */ +/* vim: set ft=javascript ts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +"use strict"; + +/** + * JSD2 actors. + */ +/** + * Creates a ThreadActor. + * + * ThreadActors manage a JSInspector object and manage execution/inspection + * of debuggees. + * + * @param aHooks object + * An object with preNest and postNest methods for calling when entering + * and exiting a nested event loop, addToParentPool and + * removeFromParentPool methods for handling the lifetime of actors that + * will outlive the thread, like breakpoints. + * @param aGlobal object [optional] + * An optional (for content debugging only) reference to the content + * window. + */ +function ThreadActor(aHooks, aGlobal) +{ + this._state = "detached"; + this._frameActors = []; + this._environmentActors = []; + this._hooks = aHooks; + this.global = aGlobal; + + this.findGlobals = this.globalManager.findGlobals.bind(this); + this.onNewGlobal = this.globalManager.onNewGlobal.bind(this); + this.onNewSource = this.onNewSource.bind(this); + + this._options = { + useSourceMaps: false + }; +} + +/** + * The breakpoint store must be shared across instances of ThreadActor so that + * page reloads don't blow away all of our breakpoints. + */ +ThreadActor._breakpointStore = {}; + +ThreadActor.prototype = { + actorPrefix: "context", + + get state() { return this._state; }, + get attached() this.state == "attached" || + this.state == "running" || + this.state == "paused", + + get _breakpointStore() { return ThreadActor._breakpointStore; }, + + get threadLifetimePool() { + if (!this._threadLifetimePool) { + this._threadLifetimePool = new ActorPool(this.conn); + this.conn.addActorPool(this._threadLifetimePool); + this._threadLifetimePool.objectActors = new WeakMap(); + } + return this._threadLifetimePool; + }, + + get sources() { + if (!this._sources) { + this._sources = new ThreadSources(this, this._options.useSourceMaps, + this._allowSource, this.onNewSource); + } + return this._sources; + }, + + clearDebuggees: function TA_clearDebuggees() { + if (this.dbg) { + this.dbg.removeAllDebuggees(); + } + this.conn.removeActorPool(this._threadLifetimePool || undefined); + this._threadLifetimePool = null; + this._sources = null; + }, + + /** + * Add a debuggee global to the Debugger object. + */ + addDebuggee: function TA_addDebuggee(aGlobal) { + try { + this.dbg.addDebuggee(aGlobal); + } catch (e) { + // Ignore attempts to add the debugger's compartment as a debuggee. + dumpn("Ignoring request to add the debugger's compartment as a debuggee"); + } + }, + + /** + * Initialize the Debugger. + */ + _initDebugger: function TA__initDebugger() { + this.dbg = new Debugger(); + this.dbg.uncaughtExceptionHook = this.uncaughtExceptionHook.bind(this); + this.dbg.onDebuggerStatement = this.onDebuggerStatement.bind(this); + this.dbg.onNewScript = this.onNewScript.bind(this); + this.dbg.onNewGlobalObject = this.globalManager.onNewGlobal.bind(this); + // Keep the debugger disabled until a client attaches. + this.dbg.enabled = this._state != "detached"; + }, + + /** + * Remove a debuggee global from the JSInspector. + */ + removeDebugee: function TA_removeDebuggee(aGlobal) { + try { + this.dbg.removeDebuggee(aGlobal); + } catch(ex) { + // XXX: This debuggee has code currently executing on the stack, + // we need to save this for later. + } + }, + + /** + * Add the provided window and all windows in its frame tree as debuggees. + */ + _addDebuggees: function TA__addDebuggees(aWindow) { + this.addDebuggee(aWindow); + let frames = aWindow.frames; + if (frames) { + for (let i = 0; i < frames.length; i++) { + this._addDebuggees(frames[i]); + } + } + }, + + /** + * An object that will be used by ThreadActors to tailor their behavior + * depending on the debugging context being required (chrome or content). + */ + globalManager: { + findGlobals: function TA_findGlobals() { + this._addDebuggees(this.global); + }, + + /** + * A function that the engine calls when a new global object has been + * created. + * + * @param aGlobal Debugger.Object + * The new global object that was created. + */ + onNewGlobal: function TA_onNewGlobal(aGlobal) { + // Content debugging only cares about new globals in the contant window, + // like iframe children. + if (aGlobal.hostAnnotations && + aGlobal.hostAnnotations.type == "document" && + aGlobal.hostAnnotations.element === this.global) { + this.addDebuggee(aGlobal); + // Notify the client. + this.conn.send({ + from: this.actorID, + type: "newGlobal", + // TODO: after bug 801084 lands see if we need to JSONify this. + hostAnnotations: aGlobal.hostAnnotations + }); + } + } + }, + + disconnect: function TA_disconnect() { + dumpn("in ThreadActor.prototype.disconnect"); + if (this._state == "paused") { + this.onResume(); + } + + this._state = "exited"; + + this.clearDebuggees(); + + if (!this.dbg) { + return; + } + this.dbg.enabled = false; + this.dbg = null; + }, + + /** + * Disconnect the debugger and put the actor in the exited state. + */ + exit: function TA_exit() { + this.disconnect(); + }, + + // Request handlers + onAttach: function TA_onAttach(aRequest) { + if (this.state === "exited") { + return { type: "exited" }; + } + + if (this.state !== "detached") { + return { error: "wrongState" }; + } + + this._state = "attached"; + + update(this._options, aRequest.options || {}); + + if (!this.dbg) { + this._initDebugger(); + } + this.findGlobals(); + this.dbg.enabled = true; + try { + // Put ourselves in the paused state. + let packet = this._paused(); + if (!packet) { + return { error: "notAttached" }; + } + packet.why = { type: "attached" }; + + this._restoreBreakpoints(); + + // Send the response to the attach request now (rather than + // returning it), because we're going to start a nested event loop + // here. + this.conn.send(packet); + + // Start a nested event loop. + this._nest(); + + // We already sent a response to this request, don't send one + // now. + return null; + } catch (e) { + reportError(e); + return { error: "notAttached", message: e.toString() }; + } + }, + + onDetach: function TA_onDetach(aRequest) { + this.disconnect(); + dumpn("ThreadActor.prototype.onDetach: returning 'detached' packet"); + return { + type: "detached" + }; + }, + + onReconfigure: function TA_onReconfigure(aRequest) { + if (this.state == "exited") { + return { error: "wrongState" }; + } + + update(this._options, aRequest.options || {}); + // Clear existing sources, so they can be recreated on next access. + this._sources = null; + + return {}; + }, + + /** + * Pause the debuggee, by entering a nested event loop, and return a 'paused' + * packet to the client. + * + * @param Debugger.Frame aFrame + * The newest debuggee frame in the stack. + * @param object aReason + * An object with a 'type' property containing the reason for the pause. + * @param function onPacket + * Hook to modify the packet before it is sent. Feel free to return a + * promise. + */ + _pauseAndRespond: function TA__pauseAndRespond(aFrame, aReason, + onPacket=function (k) k) { + try { + let packet = this._paused(aFrame); + if (!packet) { + return undefined; + } + packet.why = aReason; + resolve(onPacket(packet)).then(this.conn.send.bind(this.conn)); + return this._nest(); + } catch(e) { + let msg = "Got an exception during TA__pauseAndRespond: " + e + + ": " + e.stack; + // Cu.reportError(msg); + dumpn(msg); + return undefined; + } + }, + + /** + * Handle a protocol request to resume execution of the debuggee. + */ + onResume: function TA_onResume(aRequest) { + if (this._state !== "paused") { + return { + error: "wrongState", + message: "Can't resume when debuggee isn't paused. Current state is '" + + this._state + "'" + }; + } + + // In case of multiple nested event loops (due to multiple debuggers open in + // different tabs or multiple debugger clients connected to the same tab) + // only allow resumption in a LIFO order. + if (DebuggerServer.xpcInspector.eventLoopNestLevel() > 1) { + log("DebuggerServer.xpcInspector.eventLoopNestLevel: "+DebuggerServer.xpcInspector.eventLoopNestLevel()); + // let lastNestRequestor = DebuggerServer.xpcInspector.lastNestRequestor; + // if (lastNestRequestor.connection != this.conn) { + // return { error: "wrongOrder", + // message: "trying to resume in the wrong order.", + // lastPausedUrl: lastNestRequestor.url }; + // } + } + + if (aRequest && aRequest.forceCompletion) { + // TODO: remove this when Debugger.Frame.prototype.pop is implemented in + // bug 736733. + if (typeof this.frame.pop != "function") { + return { error: "notImplemented", + message: "forced completion is not yet implemented." }; + } + + this.dbg.getNewestFrame().pop(aRequest.completionValue); + let packet = this._resumed(); + DebuggerServer.xpcInspector.exitNestedEventLoop(); + return { type: "resumeLimit", frameFinished: aRequest.forceCompletion }; + } + + if (aRequest && aRequest.resumeLimit) { + log("resumeLimit..."); + // Bind these methods because some of the hooks are called with 'this' + // set to the current frame. + let pauseAndRespond = (aFrame, onPacket=function (k) k) => { + this._pauseAndRespond(aFrame, { type: "resumeLimit" }, onPacket); + }; + let createValueGrip = this.createValueGrip.bind(this); + + let startFrame = this.youngestFrame; + let startLine; + if (this.youngestFrame.script) { + let offset = this.youngestFrame.offset; + startLine = this.youngestFrame.script.getOffsetLine(offset); + } + + // Define the JS hook functions for stepping. + + let onEnterFrame = aFrame => { + if (this.sources.isBlackBoxed(aFrame.script.url)) { + return undefined; + } + return pauseAndRespond(aFrame); + }; + + let thread = this; + + let onPop = function TA_onPop(aCompletion) { + // onPop is called with 'this' set to the current frame. + if (thread.sources.isBlackBoxed(this.script.url)) { + return undefined; + } + + // Note that we're popping this frame; we need to watch for + // subsequent step events on its caller. + this.reportedPop = true; + + return pauseAndRespond(this, (aPacket) => { + aPacket.why.frameFinished = {}; + if (!aCompletion) { + aPacket.why.frameFinished.terminated = true; + } else if (aCompletion.hasOwnProperty("return")) { + aPacket.why.frameFinished.return = createValueGrip(aCompletion.return); + } else if (aCompletion.hasOwnProperty("yield")) { + aPacket.why.frameFinished.return = createValueGrip(aCompletion.yield); + } else { + aPacket.why.frameFinished.throw = createValueGrip(aCompletion.throw); + } + return aPacket; + }); + }; + + let onStep = function TA_onStep() { + // onStep is called with 'this' set to the current frame. + + if (thread.sources.isBlackBoxed(this.script.url)) { + return undefined; + } + + // If we've changed frame or line, then report that. + if (this !== startFrame || + (this.script && + this.script.getOffsetLine(this.offset) != startLine)) { + return pauseAndRespond(this); + } + + // Otherwise, let execution continue. + return undefined; + }; + + let steppingType = aRequest.resumeLimit.type; + if (["step", "next", "finish"].indexOf(steppingType) == -1) { + return { error: "badParameterType", + message: "Unknown resumeLimit type" }; + } + // Make sure there is still a frame on the stack if we are to continue + // stepping. + let stepFrame = this._getNextStepFrame(startFrame); + if (stepFrame) { + switch (steppingType) { + case "step": + log("--> step..."); + this.dbg.onEnterFrame = onEnterFrame; + // Fall through. + case "next": + log("--> next..."); + stepFrame.onStep = onStep; + stepFrame.onPop = onPop; + break; + case "finish": + log("--> finish..."); + stepFrame.onPop = onPop; + } + } + + } + + if (aRequest && aRequest.pauseOnExceptions) { + this.dbg.onExceptionUnwind = this.onExceptionUnwind.bind(this); + } + let packet = this._resumed(); + DebuggerServer.xpcInspector.exitNestedEventLoop(); + return packet; + }, + + /** + * Helper method that returns the next frame when stepping. + */ + _getNextStepFrame: function TA__getNextStepFrame(aFrame) { + let stepFrame = aFrame.reportedPop ? aFrame.older : aFrame; + if (!stepFrame || !stepFrame.script) { + stepFrame = null; + } + return stepFrame; + }, + + onClientEvaluate: function TA_onClientEvaluate(aRequest) { + if (this.state !== "paused") { + return { error: "wrongState", + message: "Debuggee must be paused to evaluate code." }; + }; + + let frame = this._requestFrame(aRequest.frame); + if (!frame) { + return { error: "unknownFrame", + message: "Evaluation frame not found" }; + } + + if (!frame.environment) { + return { error: "notDebuggee", + message: "cannot access the environment of this frame." }; + }; + + // We'll clobber the youngest frame if the eval causes a pause, so + // save our frame now to be restored after eval returns. + // XXX: or we could just start using dbg.getNewestFrame() now that it + // works as expected. + let youngest = this.youngestFrame; + + // Put ourselves back in the running state and inform the client. + let resumedPacket = this._resumed(); + this.conn.send(resumedPacket); + + // Run the expression. + // XXX: test syntax errors + let completion = frame.eval(aRequest.expression); + + // Put ourselves back in the pause state. + let packet = this._paused(youngest); + packet.why = { type: "clientEvaluated", + frameFinished: this.createProtocolCompletionValue(completion) }; + + // Return back to our previous pause's event loop. + return packet; + }, + + onFrames: function TA_onFrames(aRequest) { + if (this.state !== "paused") { + return { error: "wrongState", + message: "Stack frames are only available while the debuggee is paused."}; + } + + let start = aRequest.start ? aRequest.start : 0; + let count = aRequest.count; + + // Find the starting frame... + let frame = this.youngestFrame; + let i = 0; + while (frame && (i < start)) { + frame = frame.older; + i++; + } + + // Return request.count frames, or all remaining + // frames if count is not defined. + let frames = []; + let promises = []; + for (; frame && (!count || i < (start + count)); i++, frame=frame.older) { + let form = this._createFrameActor(frame).form(); + form.depth = i; + frames.push(form); + + let promise = this.sources.getOriginalLocation(form.where.url, + form.where.line) + .then(function (aOrigLocation) { + form.where = aOrigLocation; + }); + promises.push(promise); + } + + return all(promises).then(function () { + return { frames: frames }; + }); + }, + + onReleaseMany: function TA_onReleaseMany(aRequest) { + if (!aRequest.actors) { + return { error: "missingParameter", + message: "no actors were specified" }; + } + + let res; + for each (let actorID in aRequest.actors) { + let actor = this.threadLifetimePool.get(actorID); + if (!actor) { + if (!res) { + res = { error: "notReleasable", + message: "Only thread-lifetime actors can be released." }; + } + continue; + } + actor.onRelease(); + } + return res ? res : {}; + }, + + /** + * Handle a protocol request to set a breakpoint. + */ + onSetBreakpoint: function TA_onSetBreakpoint(aRequest) { + if (this.state !== "paused") { + return { error: "wrongState", + message: "Breakpoints can only be set while the debuggee is paused."}; + } + + // XXX: `originalColumn` is never used. See bug 827639. + let { url: originalSource, + line: originalLine, + column: originalColumn } = aRequest.location; + + let locationPromise = this.sources.getGeneratedLocation(originalSource, + originalLine) + return locationPromise.then((aLocation) => { + let line = aLocation.line; + if (this.dbg.findScripts({ url: aLocation.url }).length == 0 || + line < 0 || + line == null) { + return { error: "noScript" }; + } + + // Add the breakpoint to the store for later reuse, in case it belongs to a + // script that hasn't appeared yet. + if (!this._breakpointStore[aLocation.url]) { + this._breakpointStore[aLocation.url] = []; + } + let scriptBreakpoints = this._breakpointStore[aLocation.url]; + scriptBreakpoints[line] = { + url: aLocation.url, + line: line, + column: aLocation.column + }; + + let response = this._setBreakpoint(aLocation); + // If the original location of our generated location is different from + // the original location we attempted to set the breakpoint on, we will + // need to know so that we can set actualLocation on the response. + let originalLocation = this.sources.getOriginalLocation(aLocation.url, + aLocation.line); + + return all([response, originalLocation]) + .then(([aResponse, {url, line}]) => { + if (aResponse.actualLocation) { + let actualOrigLocation = this.sources.getOriginalLocation( + aResponse.actualLocation.url, aResponse.actualLocation.line); + return actualOrigLocation.then(function ({ url, line }) { + if (url !== originalSource || line !== originalLine) { + aResponse.actualLocation = { url: url, line: line }; + } + return aResponse; + }); + } + + if (url !== originalSource || line !== originalLine) { + aResponse.actualLocation = { url: url, line: line }; + } + + return aResponse; + }); + }); + }, + + /** + * Set a breakpoint using the jsdbg2 API. If the line on which the breakpoint + * is being set contains no code, then the breakpoint will slide down to the + * next line that has runnable code. In this case the server breakpoint cache + * will be updated, so callers that iterate over the breakpoint cache should + * take that into account. + * + * @param object aLocation + * The location of the breakpoint as specified in the protocol. + */ + _setBreakpoint: function TA__setBreakpoint(aLocation) { + let breakpoints = this._breakpointStore[aLocation.url]; + + // Get or create the breakpoint actor for the given location + let actor; + if (breakpoints[aLocation.line].actor) { + actor = breakpoints[aLocation.line].actor; + } else { + actor = breakpoints[aLocation.line].actor = new BreakpointActor(this, { + url: aLocation.url, + line: aLocation.line + }); + this._hooks.addToParentPool(actor); + } + + // Find all scripts matching the given location + let scripts = this.dbg.findScripts(aLocation); + if (scripts.length == 0) { + return { + error: "noScript", + actor: actor.actorID + }; + } + + /** + * For each script, if the given line has at least one entry point, set + * breakpoint on the bytecode offet for each of them. + */ + let found = false; + for (let script of scripts) { + let offsets = script.getLineOffsets(aLocation.line); + if (offsets.length > 0) { + for (let offset of offsets) { + script.setBreakpoint(offset, actor); + } + actor.addScript(script, this); + found = true; + } + } + if (found) { + return { + actor: actor.actorID + }; + } + + /** + * If we get here, no breakpoint was set. This is because the given line + * has no entry points, for example because it is empty. As a fallback + * strategy, we try to set the breakpoint on the smallest line greater + * than or equal to the given line that as at least one entry point. + */ + + // Find all innermost scripts matching the given location + let scripts = this.dbg.findScripts({ + url: aLocation.url, + line: aLocation.line, + innermost: true + }); + + /** + * For each innermost script, look for the smallest line greater than or + * equal to the given line that has one or more entry points. If found, set + * a breakpoint on the bytecode offset for each of its entry points. + */ + let actualLocation; + let found = false; + for (let script of scripts) { + let offsets = script.getAllOffsets(); + for (let line = aLocation.line; line < offsets.length; ++line) { + if (offsets[line]) { + for (let offset of offsets[line]) { + script.setBreakpoint(offset, actor); + } + actor.addScript(script, this); + if (!actualLocation) { + actualLocation = { + url: aLocation.url, + line: line, + column: 0 + }; + } + found = true; + break; + } + } + } + if (found) { + if (breakpoints[actualLocation.line] && + breakpoints[actualLocation.line].actor) { + /** + * We already have a breakpoint actor for the actual location, so + * actor we created earlier is now redundant. Delete it, update the + * breakpoint store, and return the actor for the actual location. + */ + actor.onDelete(); + delete breakpoints[aLocation.line]; + return { + actor: breakpoints[actualLocation.line].actor.actorID, + actualLocation: actualLocation + }; + } else { + /** + * We don't have a breakpoint actor for the actual location yet. + * Instead or creating a new actor, reuse the actor we created earlier, + * and update the breakpoint store. + */ + actor.location = actualLocation; + breakpoints[actualLocation.line] = breakpoints[aLocation.line]; + delete breakpoints[aLocation.line]; + // WARNING: This overwrites aLocation.line + breakpoints[actualLocation.line].line = actualLocation.line; + return { + actor: actor.actorID, + actualLocation: actualLocation + }; + } + } + + /** + * If we get here, no line matching the given line was found, so just + * epically. + */ + return { + error: "noCodeAtLineColumn", + actor: actor.actorID + }; + }, + + /** + * Get the script and source lists from the debugger. + * + * TODO bug 637572: we should be dealing with sources directly, not inferring + * them through scripts. + */ + _discoverSources: function TA__discoverSources() { + // Only get one script per url. + let scriptsByUrl = {}; + for (let s of this.dbg.findScripts()) { + scriptsByUrl[s.url] = s; + } + + return all([this.sources.sourcesForScript(scriptsByUrl[s]) + for (s of Object.keys(scriptsByUrl))]); + }, + + onSources: function TA_onSources(aRequest) { + return this._discoverSources().then(() => { + return { + sources: [s.form() for (s of this.sources.iter())] + }; + }); + }, + + /** + * Disassociate all breakpoint actors from their scripts and clear the + * breakpoint handlers. This method can be used when the thread actor intends + * to keep the breakpoint store, but needs to clear any actual breakpoints, + * e.g. due to a page navigation. This way the breakpoint actors' script + * caches won't hold on to the Debugger.Script objects leaking memory. + */ + disableAllBreakpoints: function () { + for (let url in this._breakpointStore) { + for (let line in this._breakpointStore[url]) { + let bp = this._breakpointStore[url][line]; + bp.actor.removeScripts(); + } + } + }, + + /** + * Handle a protocol request to pause the debuggee. + */ + onInterrupt: function TA_onInterrupt(aRequest) { + if (this.state == "exited") { + return { type: "exited" }; + } else if (this.state == "paused") { + // TODO: return the actual reason for the existing pause. + return { type: "paused", why: { type: "alreadyPaused" } }; + } else if (this.state != "running") { + return { error: "wrongState", + message: "Received interrupt request in " + this.state + + " state." }; + } + + try { + // Put ourselves in the paused state. + let packet = this._paused(); + if (!packet) { + return { error: "notInterrupted" }; + } + packet.why = { type: "interrupted" }; + + // Send the response to the interrupt request now (rather than + // returning it), because we're going to start a nested event loop + // here. + this.conn.send(packet); + + // Start a nested event loop. + this._nest(); + + // We already sent a response to this request, don't send one + // now. + return null; + } catch (e) { + reportError(e); + return { error: "notInterrupted", message: e.toString() }; + } + }, + + /** + * Return the Debug.Frame for a frame mentioned by the protocol. + */ + _requestFrame: function TA_requestFrame(aFrameID) { + if (!aFrameID) { + return this.youngestFrame; + } + + if (this._framePool.has(aFrameID)) { + return this._framePool.get(aFrameID).frame; + } + + return undefined; + }, + + _paused: function TA_paused(aFrame) { + // We don't handle nested pauses correctly. Don't try - if we're + // paused, just continue running whatever code triggered the pause. + // We don't want to actually have nested pauses (although we + // have nested event loops). If code runs in the debuggee during + // a pause, it should cause the actor to resume (dropping + // pause-lifetime actors etc) and then repause when complete. + + if (this.state === "paused") { + return undefined; + } + + // Clear stepping hooks. + this.dbg.onEnterFrame = undefined; + this.dbg.onExceptionUnwind = undefined; + if (aFrame) { + aFrame.onStep = undefined; + aFrame.onPop = undefined; + } + + this._state = "paused"; + + // Save the pause frame (if any) as the youngest frame for + // stack viewing. + this.youngestFrame = aFrame; + + // Create the actor pool that will hold the pause actor and its + // children. + dbg_assert(!this._pausePool); + this._pausePool = new ActorPool(this.conn); + this.conn.addActorPool(this._pausePool); + + // Give children of the pause pool a quick link back to the + // thread... + this._pausePool.threadActor = this; + + // Create the pause actor itself... + dbg_assert(!this._pauseActor); + this._pauseActor = new PauseActor(this._pausePool); + this._pausePool.addActor(this._pauseActor); + + // Update the list of frames. + let poppedFrames = this._updateFrames(); + + // Send off the paused packet and spin an event loop. + let packet = { from: this.actorID, + type: "paused", + actor: this._pauseActor.actorID }; + if (aFrame) { + packet.frame = this._createFrameActor(aFrame).form(); + } + + if (poppedFrames) { + packet.poppedFrames = poppedFrames; + } + + return packet; + }, + + _nest: function TA_nest() { + if (this._hooks.preNest) { + var nestData = this._hooks.preNest(); + } + + let requestor = Object.create(null); + requestor.url = this._hooks.url; + requestor.connection = this.conn; + DebuggerServer.xpcInspector.enterNestedEventLoop(requestor); + + dbg_assert(this.state === "running"); + + if (this._hooks.postNest) { + this._hooks.postNest(nestData) + } + + // "continue" resumption value. + return undefined; + }, + + _resumed: function TA_resumed() { + this._state = "running"; + + // Drop the actors in the pause actor pool. + this.conn.removeActorPool(this._pausePool); + + this._pausePool = null; + this._pauseActor = null; + this.youngestFrame = null; + + return { from: this.actorID, type: "resumed" }; + }, + + /** + * Expire frame actors for frames that have been popped. + * + * @returns A list of actor IDs whose frames have been popped. + */ + _updateFrames: function TA_updateFrames() { + let popped = []; + + // Create the actor pool that will hold the still-living frames. + let framePool = new ActorPool(this.conn); + let frameList = []; + + for each (let frameActor in this._frameActors) { + if (frameActor.frame.live) { + framePool.addActor(frameActor); + frameList.push(frameActor); + } else { + popped.push(frameActor.actorID); + } + } + + // Remove the old frame actor pool, this will expire + // any actors that weren't added to the new pool. + if (this._framePool) { + this.conn.removeActorPool(this._framePool); + } + + this._frameActors = frameList; + this._framePool = framePool; + this.conn.addActorPool(framePool); + + return popped; + }, + + _createFrameActor: function TA_createFrameActor(aFrame) { + if (aFrame.actor) { + return aFrame.actor; + } + + let actor = new FrameActor(aFrame, this); + this._frameActors.push(actor); + this._framePool.addActor(actor); + aFrame.actor = actor; + + return actor; + }, + + /** + * Create and return an environment actor that corresponds to the provided + * Debugger.Environment. + * @param Debugger.Environment aEnvironment + * The lexical environment we want to extract. + * @param object aPool + * The pool where the newly-created actor will be placed. + * @return The EnvironmentActor for aEnvironment or undefined for host + * functions or functions scoped to a non-debuggee global. + */ + createEnvironmentActor: + function TA_createEnvironmentActor(aEnvironment, aPool) { + if (!aEnvironment) { + return undefined; + } + + if (aEnvironment.actor) { + return aEnvironment.actor; + } + + let actor = new EnvironmentActor(aEnvironment, this); + this._environmentActors.push(actor); + aPool.addActor(actor); + aEnvironment.actor = actor; + + return actor; + }, + + /** + * Create a grip for the given debuggee value. If the value is an + * object, will create an actor with the given lifetime. + */ + createValueGrip: function TA_createValueGrip(aValue, aPool=false) { + if (!aPool) { + aPool = this._pausePool; + } + let type = typeof(aValue); + + if (type === "string" && this._stringIsLong(aValue)) { + return this.longStringGrip(aValue, aPool); + } + + if (type === "boolean" || type === "string" || type === "number") { + return aValue; + } + + if (aValue === null) { + return { type: "null" }; + } + + if (aValue === undefined) { + return { type: "undefined" } + } + + if (typeof(aValue) === "object") { + return this.objectGrip(aValue, aPool); + } + + dbg_assert(false, "Failed to provide a grip for: " + aValue); + return null; + }, + + /** + * Return a protocol completion value representing the given + * Debugger-provided completion value. + */ + createProtocolCompletionValue: + function TA_createProtocolCompletionValue(aCompletion) { + let protoValue = {}; + if ("return" in aCompletion) { + protoValue.return = this.createValueGrip(aCompletion.return); + } else if ("yield" in aCompletion) { + protoValue.return = this.createValueGrip(aCompletion.yield); + } else if ("throw" in aCompletion) { + protoValue.throw = this.createValueGrip(aCompletion.throw); + } else { + protoValue.terminated = true; + } + return protoValue; + }, + + /** + * Create a grip for the given debuggee object. + * + * @param aValue Debugger.Object + * The debuggee object value. + * @param aPool ActorPool + * The actor pool where the new object actor will be added. + */ + objectGrip: function TA_objectGrip(aValue, aPool) { + if (!aPool.objectActors) { + aPool.objectActors = new WeakMap(); + } + + if (aPool.objectActors.has(aValue)) { + return aPool.objectActors.get(aValue).grip(); + } else if (this.threadLifetimePool.objectActors.has(aValue)) { + return this.threadLifetimePool.objectActors.get(aValue).grip(); + } + + let actor = new PauseScopedObjectActor(aValue, this); + aPool.addActor(actor); + aPool.objectActors.set(aValue, actor); + return actor.grip(); + }, + + /** + * Create a grip for the given debuggee object with a pause lifetime. + * + * @param aValue Debugger.Object + * The debuggee object value. + */ + pauseObjectGrip: function TA_pauseObjectGrip(aValue) { + if (!this._pausePool) { + throw "Object grip requested while not paused."; + } + + return this.objectGrip(aValue, this._pausePool); + }, + + /** + * Extend the lifetime of the provided object actor to thread lifetime. + * + * @param aActor object + * The object actor. + */ + threadObjectGrip: function TA_threadObjectGrip(aActor) { + // We want to reuse the existing actor ID, so we just remove it from the + // current pool's weak map and then let pool.addActor do the rest. + aActor.registeredPool.objectActors.delete(aActor.obj); + this.threadLifetimePool.addActor(aActor); + this.threadLifetimePool.objectActors.set(aActor.obj, aActor); + }, + + /** + * Handle a protocol request to promote multiple pause-lifetime grips to + * thread-lifetime grips. + * + * @param aRequest object + * The protocol request object. + */ + onThreadGrips: function OA_onThreadGrips(aRequest) { + if (this.state != "paused") { + return { error: "wrongState" }; + } + + if (!aRequest.actors) { + return { error: "missingParameter", + message: "no actors were specified" }; + } + + for (let actorID of aRequest.actors) { + let actor = this._pausePool.get(actorID); + if (actor) { + this.threadObjectGrip(actor); + } + } + return {}; + }, + + /** + * Create a grip for the given string. + * + * @param aString String + * The string we are creating a grip for. + * @param aPool ActorPool + * The actor pool where the new actor will be added. + */ + longStringGrip: function TA_longStringGrip(aString, aPool) { + if (!aPool.longStringActors) { + aPool.longStringActors = {}; + } + + if (aPool.longStringActors.hasOwnProperty(aString)) { + return aPool.longStringActors[aString].grip(); + } + + let actor = new LongStringActor(aString, this); + aPool.addActor(actor); + aPool.longStringActors[aString] = actor; + return actor.grip(); + }, + + /** + * Create a long string grip that is scoped to a pause. + * + * @param aString String + * The string we are creating a grip for. + */ + pauseLongStringGrip: function TA_pauseLongStringGrip (aString) { + return this.longStringGrip(aString, this._pausePool); + }, + + /** + * Create a long string grip that is scoped to a thread. + * + * @param aString String + * The string we are creating a grip for. + */ + threadLongStringGrip: function TA_pauseLongStringGrip (aString) { + return this.longStringGrip(aString, this._threadLifetimePool); + }, + + /** + * Returns true if the string is long enough to use a LongStringActor instead + * of passing the value directly over the protocol. + * + * @param aString String + * The string we are checking the length of. + */ + _stringIsLong: function TA__stringIsLong(aString) { + return aString.length >= DebuggerServer.LONG_STRING_LENGTH; + }, + + // JS Debugger API hooks. + + /** + * A function that the engine calls when a call to a debug event hook, + * breakpoint handler, watchpoint handler, or similar function throws some + * exception. + * + * @param aException exception + * The exception that was thrown in the debugger code. + */ + uncaughtExceptionHook: function TA_uncaughtExceptionHook(aException) { + dumpn("Got an exception: " + aException.message + "\n" + aException.stack); + }, + + /** + * A function that the engine calls when a debugger statement has been + * executed in the specified frame. + * + * @param aFrame Debugger.Frame + * The stack frame that contained the debugger statement. + */ + onDebuggerStatement: function TA_onDebuggerStatement(aFrame) { + if (this.sources.isBlackBoxed(aFrame.script.url)) { + return undefined; + } + return this._pauseAndRespond(aFrame, { type: "debuggerStatement" }); + }, + + /** + * A function that the engine calls when an exception has been thrown and has + * propagated to the specified frame. + * + * @param aFrame Debugger.Frame + * The youngest remaining stack frame. + * @param aValue object + * The exception that was thrown. + */ + onExceptionUnwind: function TA_onExceptionUnwind(aFrame, aValue) { + if (this.sources.isBlackBoxed(aFrame.script.url)) { + return undefined; + } + try { + let packet = this._paused(aFrame); + if (!packet) { + return undefined; + } + + packet.why = { type: "exception", + exception: this.createValueGrip(aValue) }; + this.conn.send(packet); + return this._nest(); + } catch(e) { + log("Got an exception during TA_onExceptionUnwind: " + e + + ": " + e.stack); + return undefined; + } + }, + + /** + * A function that the engine calls when a new script has been loaded into the + * scope of the specified debuggee global. + * + * @param aScript Debugger.Script + * The source script that has been loaded into a debuggee compartment. + * @param aGlobal Debugger.Object + * A Debugger.Object instance whose referent is the global object. + */ + onNewScript: function TA_onNewScript(aScript, aGlobal) { + this._addScript(aScript); + this.sources.sourcesForScript(aScript); + }, + + onNewSource: function TA_onNewSource(aSource) { + this.conn.send({ + from: this.actorID, + type: "newSource", + source: aSource.form() + }); + }, + + /** + * Check if scripts from the provided source URL are allowed to be stored in + * the cache. + * + * @param aSourceUrl String + * The url of the script's source that will be stored. + * @returns true, if the script can be added, false otherwise. + */ + _allowSource: function TA__allowSource(aSourceUrl) { + // Ignore anything we don't have a URL for (eval scripts, for example). + if (!aSourceUrl) + return false; + // Ignore XBL bindings for content debugging. + if (aSourceUrl.indexOf("chrome://") == 0) { + return false; + } + // Ignore about:* pages for content debugging. + if (aSourceUrl.indexOf("about:") == 0) { + return false; + } + return true; + }, + + /** + * Restore any pre-existing breakpoints to the scripts that we have access to. + */ + _restoreBreakpoints: function TA__restoreBreakpoints() { + for (let s of this.dbg.findScripts()) { + this._addScript(s); + } + }, + + /** + * Add the provided script to the server cache. + * + * @param aScript Debugger.Script + * The source script that will be stored. + * @returns true, if the script was added; false otherwise. + */ + _addScript: function TA__addScript(aScript) { + if (!this._allowSource(aScript.url)) { + return false; + } + + // Set any stored breakpoints. + let existing = this._breakpointStore[aScript.url]; + if (existing) { + let endLine = aScript.startLine + aScript.lineCount - 1; + // Iterate over the lines backwards, so that sliding breakpoints don't + // affect the loop. + for (let line = existing.length - 1; line >= aScript.startLine; line--) { + let bp = existing[line]; + // Only consider breakpoints that are not already associated with + // scripts, and limit search to the line numbers contained in the new + // script. + if (bp && !bp.actor.scripts.length && line <= endLine) { + this._setBreakpoint(bp); + } + } + } + return true; + }, + +}; + +ThreadActor.prototype.requestTypes = { + "attach": ThreadActor.prototype.onAttach, + "detach": ThreadActor.prototype.onDetach, + "reconfigure": ThreadActor.prototype.onReconfigure, + "resume": ThreadActor.prototype.onResume, + "clientEvaluate": ThreadActor.prototype.onClientEvaluate, + "frames": ThreadActor.prototype.onFrames, + "interrupt": ThreadActor.prototype.onInterrupt, + "releaseMany": ThreadActor.prototype.onReleaseMany, + "setBreakpoint": ThreadActor.prototype.onSetBreakpoint, + "sources": ThreadActor.prototype.onSources, + "threadGrips": ThreadActor.prototype.onThreadGrips +}; + + +/** + * Creates a PauseActor. + * + * PauseActors exist for the lifetime of a given debuggee pause. Used to + * scope pause-lifetime grips. + * + * @param ActorPool aPool + * The actor pool created for this pause. + */ +function PauseActor(aPool) +{ + this.pool = aPool; +} + +PauseActor.prototype = { + actorPrefix: "pause" +}; + + +/** + * A base actor for any actors that should only respond receive messages in the + * paused state. Subclasses may expose a `threadActor` which is used to help + * determine when we are in a paused state. Subclasses should set their own + * "constructor" property if they want better error messages. You should never + * instantiate a PauseScopedActor directly, only through subclasses. + */ +function PauseScopedActor() +{ +} + +/** + * A function decorator for creating methods to handle protocol messages that + * should only be received while in the paused state. + * + * @param aMethod Function + * The function we are decorating. + */ +PauseScopedActor.withPaused = function PSA_withPaused(aMethod) { + return function () { + if (this.isPaused()) { + return aMethod.apply(this, arguments); + } else { + return this._wrongState(); + } + }; +}; + +PauseScopedActor.prototype = { + + /** + * Returns true if we are in the paused state. + */ + isPaused: function PSA_isPaused() { + // When there is not a ThreadActor available (like in the webconsole) we + // have to be optimistic and assume that we are paused so that we can + // respond to requests. + return this.threadActor ? this.threadActor.state === "paused" : true; + }, + + /** + * Returns the wrongState response packet for this actor. + */ + _wrongState: function PSA_wrongState() { + return { + error: "wrongState", + message: this.constructor.name + + " actors can only be accessed while the thread is paused." + }; + } +}; + + +/** + * A SourceActor provides information about the source of a script. + * + * @param aUrl String + * The url of the source we are representing. + * @param aThreadActor ThreadActor + * The current thread actor. + * @param aSourceMap SourceMapConsumer + * Optional. The source map that introduced this source, if available. + */ +function SourceActor(aUrl, aThreadActor, aSourceMap=null) { + this._threadActor = aThreadActor; + this._url = aUrl; + this._sourceMap = aSourceMap; +} + +SourceActor.prototype = { + constructor: SourceActor, + actorPrefix: "source", + + get threadActor() this._threadActor, + get url() this._url, + + form: function SA_form() { + return { + actor: this.actorID, + url: this._url, + isBlackBoxed: this.threadActor.sources.isBlackBoxed(this.url) + // TODO bug 637572: introductionScript + }; + }, + + disconnect: function LSA_disconnect() { + if (this.registeredPool && this.registeredPool.sourceActors) { + delete this.registeredPool.sourceActors[this.actorID]; + } + }, + + /** + * Handler for the "source" packet. + */ + onSource: function SA_onSource(aRequest) { + let sourceContent = null; + if (this._sourceMap) { + sourceContent = this._sourceMap.sourceContentFor(this._url); + } + + if (sourceContent) { + return { + from: this.actorID, + source: this.threadActor.createValueGrip( + sourceContent, this.threadActor.threadLifetimePool) + }; + } + + // XXX bug 865252: Don't load from the cache if this is a source mapped + // source because we can't guarantee that the cache has the most up to date + // content for this source like we can if it isn't source mapped. + return fetch(this._url, { loadFromCache: !this._sourceMap }) + .then((aSource) => { + return this.threadActor.createValueGrip( + aSource, this.threadActor.threadLifetimePool); + }) + .then((aSourceGrip) => { + return { + from: this.actorID, + source: aSourceGrip + }; + }, (aError) => { + let msg = "Got an exception during SA_onSource: " + aError + + "\n" + aError.stack; + // Cu.reportError(msg); + dumpn(msg); + return { + "from": this.actorID, + "error": "loadSourceError", + "message": "Could not load the source for " + this._url + "." + }; + }); + }, + + /** + * Handler for the "blackbox" packet. + */ + onBlackBox: function SA_onBlackBox(aRequest) { + this.threadActor.sources.blackBox(this.url); + let packet = { + from: this.actorID + }; + if (this.threadActor.state == "paused" + && this.threadActor.youngestFrame + && this.threadActor.youngestFrame.script.url == this.url) { + packet.pausedInSource = true; + } + return packet; + }, + + /** + * Handler for the "unblackbox" packet. + */ + onUnblackBox: function SA_onUnblackBox(aRequest) { + this.threadActor.sources.unblackBox(this.url); + return { + from: this.actorID + }; + } +}; + +SourceActor.prototype.requestTypes = { + "source": SourceActor.prototype.onSource, + "blackbox": SourceActor.prototype.onBlackBox, + "unblackbox": SourceActor.prototype.onUnblackBox +}; + + +/** + * Creates an actor for the specified object. + * + * @param aObj Debugger.Object + * The debuggee object. + * @param aThreadActor ThreadActor + * The parent thread actor for this object. + */ +function ObjectActor(aObj, aThreadActor) +{ + this.obj = aObj; + this.threadActor = aThreadActor; +} + +ObjectActor.prototype = { + actorPrefix: "obj", + + /** + * Returns a grip for this actor for returning in a protocol message. + */ + grip: function OA_grip() { + let g = { + "type": "object", + "class": this.obj.class, + "actor": this.actorID, + "extensible": this.obj.isExtensible(), + "frozen": this.obj.isFrozen(), + "sealed": this.obj.isSealed() + }; + + // Add additional properties for functions. + if (this.obj.class === "Function") { + if (this.obj.name) { + g.name = this.obj.name; + } else if (this.obj.displayName) { + g.displayName = this.obj.displayName; + } + + // Check if the developer has added a de-facto standard displayName + // property for us to use. + let desc = this.obj.getOwnPropertyDescriptor("displayName"); + if (desc && desc.value && typeof desc.value == "string") { + g.userDisplayName = this.threadActor.createValueGrip(desc.value); + } + } + + return g; + }, + + /** + * Releases this actor from the pool. + */ + release: function OA_release() { + if (this.registeredPool.objectActors) { + this.registeredPool.objectActors.delete(this.obj); + } + this.registeredPool.removeActor(this); + }, + + /** + * Handle a protocol request to provide the names of the properties defined on + * the object and not its prototype. + * + * @param aRequest object + * The protocol request object. + */ + onOwnPropertyNames: function OA_onOwnPropertyNames(aRequest) { + return { from: this.actorID, + ownPropertyNames: this.obj.getOwnPropertyNames() }; + }, + + /** + * Handle a protocol request to provide the prototype and own properties of + * the object. + * + * @param aRequest object + * The protocol request object. + */ + onPrototypeAndProperties: function OA_onPrototypeAndProperties(aRequest) { + let ownProperties = Object.create(null); + let names; + try { + names = this.obj.getOwnPropertyNames(); + } catch (ex) { + // The above can throw if this.obj points to a dead object. + // TODO: we should use Cu.isDeadWrapper() - see bug 885800. + return { from: this.actorID, + prototype: this.threadActor.createValueGrip(null), + ownProperties: ownProperties, + safeGetterValues: Object.create(null) }; + } + for (let name of names) { + ownProperties[name] = this._propertyDescriptor(name); + } + return { from: this.actorID, + prototype: this.threadActor.createValueGrip(this.obj.proto), + ownProperties: ownProperties, + safeGetterValues: this._findSafeGetterValues(ownProperties) }; + }, + + /** + * Find the safe getter values for the current Debugger.Object, |this.obj|. + * + * @private + * @param object aOwnProperties + * The object that holds the list of known ownProperties for + * |this.obj|. + * @return object + * An object that maps property names to safe getter descriptors as + * defined by the remote debugging protocol. + */ + _findSafeGetterValues: function OA__findSafeGetterValues(aOwnProperties) + { + let safeGetterValues = Object.create(null); + let obj = this.obj; + let level = 0; + + while (obj) { + let getters = this._findSafeGetters(obj); + for (let name of getters) { + // Avoid overwriting properties from prototypes closer to this.obj. Also + // avoid providing safeGetterValues from prototypes if property |name| + // is already defined as an own property. + if (name in safeGetterValues || + (obj != this.obj && name in aOwnProperties)) { + continue; + } + + let desc = null, getter = null; + try { + desc = obj.getOwnPropertyDescriptor(name); + getter = desc.get; + } catch (ex) { + // The above can throw if the cache becomes stale. + } + if (!getter) { + obj._safeGetters = null; + continue; + } + + let result = getter.call(this.obj); + if (result && !("throw" in result)) { + let getterValue = undefined; + if ("return" in result) { + getterValue = result.return; + } else if ("yield" in result) { + getterValue = result.yield; + } + // WebIDL attributes specified with the LenientThis extended attribute + // return undefined and should be ignored. + if (getterValue !== undefined) { + safeGetterValues[name] = { + getterValue: this.threadActor.createValueGrip(getterValue), + getterPrototypeLevel: level, + enumerable: desc.enumerable, + writable: level == 0 ? desc.writable : true, + }; + } + } + } + + obj = obj.proto; + level++; + } + + return safeGetterValues; + }, + + /** + * Find the safe getters for a given Debugger.Object. Safe getters are native + * getters which are safe to execute. + * + * @private + * @param Debugger.Object aObject + * The Debugger.Object where you want to find safe getters. + * @return Set + * A Set of names of safe getters. This result is cached for each + * Debugger.Object. + */ + _findSafeGetters: function OA__findSafeGetters(aObject) + { + if (aObject._safeGetters) { + return aObject._safeGetters; + } + + let getters = new Set(); + for (let name of aObject.getOwnPropertyNames()) { + let desc = null; + try { + desc = aObject.getOwnPropertyDescriptor(name); + } catch (e) { + // Calling getOwnPropertyDescriptor on wrapped native prototypes is not + // allowed (bug 560072). + } + if (!desc || desc.value !== undefined || !("get" in desc)) { + continue; + } + + let fn = desc.get; + if (fn && fn.callable && fn.class == "Function" && + fn.script === undefined) { + getters.add(name); + } + } + + aObject._safeGetters = getters; + return getters; + }, + + /** + * Handle a protocol request to provide the prototype of the object. + * + * @param aRequest object + * The protocol request object. + */ + onPrototype: function OA_onPrototype(aRequest) { + return { from: this.actorID, + prototype: this.threadActor.createValueGrip(this.obj.proto) }; + }, + + /** + * Handle a protocol request to provide the property descriptor of the + * object's specified property. + * + * @param aRequest object + * The protocol request object. + */ + onProperty: function OA_onProperty(aRequest) { + if (!aRequest.name) { + return { error: "missingParameter", + message: "no property name was specified" }; + } + + return { from: this.actorID, + descriptor: this._propertyDescriptor(aRequest.name) }; + }, + + /** + * A helper method that creates a property descriptor for the provided object, + * properly formatted for sending in a protocol response. + * + * @param string aName + * The property that the descriptor is generated for. + */ + _propertyDescriptor: function OA_propertyDescriptor(aName) { + let desc; + try { + desc = this.obj.getOwnPropertyDescriptor(aName); + } catch (e) { + // Calling getOwnPropertyDescriptor on wrapped native prototypes is not + // allowed (bug 560072). Inform the user with a bogus, but hopefully + // explanatory, descriptor. + return { + configurable: false, + writable: false, + enumerable: false, + value: e.name + }; + } + + let retval = { + configurable: desc.configurable, + enumerable: desc.enumerable + }; + + if ("value" in desc) { + retval.writable = desc.writable; + retval.value = this.threadActor.createValueGrip(desc.value); + } else { + if ("get" in desc) { + retval.get = this.threadActor.createValueGrip(desc.get); + } + if ("set" in desc) { + retval.set = this.threadActor.createValueGrip(desc.set); + } + } + return retval; + }, + + /** + * Handle a protocol request to provide the source code of a function. + * + * @param aRequest object + * The protocol request object. + */ + onDecompile: function OA_onDecompile(aRequest) { + if (this.obj.class !== "Function") { + return { error: "objectNotFunction", + message: "decompile request is only valid for object grips " + + "with a 'Function' class." }; + } + + return { from: this.actorID, + decompiledCode: this.obj.decompile(!!aRequest.pretty) }; + }, + + /** + * Handle a protocol request to provide the parameters of a function. + * + * @param aRequest object + * The protocol request object. + */ + onParameterNames: function OA_onParameterNames(aRequest) { + if (this.obj.class !== "Function") { + return { error: "objectNotFunction", + message: "'parameterNames' request is only valid for object " + + "grips with a 'Function' class." }; + } + + return { parameterNames: this.obj.parameterNames }; + }, + + /** + * Handle a protocol request to release a thread-lifetime grip. + * + * @param aRequest object + * The protocol request object. + */ + onRelease: function OA_onRelease(aRequest) { + this.release(); + return {}; + }, +}; + +ObjectActor.prototype.requestTypes = { + "parameterNames": ObjectActor.prototype.onParameterNames, + "prototypeAndProperties": ObjectActor.prototype.onPrototypeAndProperties, + "prototype": ObjectActor.prototype.onPrototype, + "property": ObjectActor.prototype.onProperty, + "ownPropertyNames": ObjectActor.prototype.onOwnPropertyNames, + "decompile": ObjectActor.prototype.onDecompile, + "release": ObjectActor.prototype.onRelease, +}; + + +/** + * Creates a pause-scoped actor for the specified object. + * @see ObjectActor + */ +function PauseScopedObjectActor() +{ + ObjectActor.apply(this, arguments); +} + +PauseScopedObjectActor.prototype = Object.create(PauseScopedActor.prototype); + +update(PauseScopedObjectActor.prototype, ObjectActor.prototype); + +update(PauseScopedObjectActor.prototype, { + constructor: PauseScopedObjectActor, + + onOwnPropertyNames: + PauseScopedActor.withPaused(ObjectActor.prototype.onOwnPropertyNames), + + onPrototypeAndProperties: + PauseScopedActor.withPaused(ObjectActor.prototype.onPrototypeAndProperties), + + onPrototype: PauseScopedActor.withPaused(ObjectActor.prototype.onPrototype), + onProperty: PauseScopedActor.withPaused(ObjectActor.prototype.onProperty), + onDecompile: PauseScopedActor.withPaused(ObjectActor.prototype.onDecompile), + + onParameterNames: + PauseScopedActor.withPaused(ObjectActor.prototype.onParameterNames), + + /** + * Handle a protocol request to provide the lexical scope of a function. + * + * @param aRequest object + * The protocol request object. + */ + onScope: PauseScopedActor.withPaused(function OA_onScope(aRequest) { + if (this.obj.class !== "Function") { + return { error: "objectNotFunction", + message: "scope request is only valid for object grips with a" + + " 'Function' class." }; + } + + let envActor = this.threadActor.createEnvironmentActor(this.obj.environment, + this.registeredPool); + if (!envActor) { + return { error: "notDebuggee", + message: "cannot access the environment of this function." }; + } + + return { from: this.actorID, scope: envActor.form() }; + }), + + /** + * Handle a protocol request to promote a pause-lifetime grip to a + * thread-lifetime grip. + * + * @param aRequest object + * The protocol request object. + */ + onThreadGrip: PauseScopedActor.withPaused(function OA_onThreadGrip(aRequest) { + this.threadActor.threadObjectGrip(this); + return {}; + }), + + /** + * Handle a protocol request to release a thread-lifetime grip. + * + * @param aRequest object + * The protocol request object. + */ + onRelease: PauseScopedActor.withPaused(function OA_onRelease(aRequest) { + if (this.registeredPool !== this.threadActor.threadLifetimePool) { + return { error: "notReleasable", + message: "Only thread-lifetime actors can be released." }; + } + + this.release(); + return {}; + }), +}); + +update(PauseScopedObjectActor.prototype.requestTypes, { + "scope": PauseScopedObjectActor.prototype.onScope, + "threadGrip": PauseScopedObjectActor.prototype.onThreadGrip, +}); + + +/** + * Creates an actor for the specied "very long" string. "Very long" is specified + * at the server's discretion. + * + * @param aString String + * The string. + */ +function LongStringActor(aString) +{ + this.string = aString; + this.stringLength = aString.length; +} + +LongStringActor.prototype = { + + actorPrefix: "longString", + + disconnect: function LSA_disconnect() { + // Because longStringActors is not a weak map, we won't automatically leave + // it so we need to manually leave on disconnect so that we don't leak + // memory. + if (this.registeredPool && this.registeredPool.longStringActors) { + delete this.registeredPool.longStringActors[this.actorID]; + } + }, + + /** + * Returns a grip for this actor for returning in a protocol message. + */ + grip: function LSA_grip() { + return { + "type": "longString", + "initial": this.string.substring( + 0, DebuggerServer.LONG_STRING_INITIAL_LENGTH), + "length": this.stringLength, + "actor": this.actorID + }; + }, + + /** + * Handle a request to extract part of this actor's string. + * + * @param aRequest object + * The protocol request object. + */ + onSubstring: function LSA_onSubString(aRequest) { + return { + "from": this.actorID, + "substring": this.string.substring(aRequest.start, aRequest.end) + }; + }, + + /** + * Handle a request to release this LongStringActor instance. + */ + onRelease: function LSA_onRelease() { + // TODO: also check if registeredPool === threadActor.threadLifetimePool + // when the web console moves aray from manually releasing pause-scoped + // actors. + if (this.registeredPool.longStringActors) { + delete this.registeredPool.longStringActors[this.actorID]; + } + this.registeredPool.removeActor(this); + return {}; + }, +}; + +LongStringActor.prototype.requestTypes = { + "substring": LongStringActor.prototype.onSubstring, + "release": LongStringActor.prototype.onRelease +}; + + +/** + * Creates an actor for the specified stack frame. + * + * @param aFrame Debugger.Frame + * The debuggee frame. + * @param aThreadActor ThreadActor + * The parent thread actor for this frame. + */ +function FrameActor(aFrame, aThreadActor) +{ + this.frame = aFrame; + this.threadActor = aThreadActor; +} + +FrameActor.prototype = { + actorPrefix: "frame", + + /** + * A pool that contains frame-lifetime objects, like the environment. + */ + _frameLifetimePool: null, + get frameLifetimePool() { + if (!this._frameLifetimePool) { + this._frameLifetimePool = new ActorPool(this.conn); + this.conn.addActorPool(this._frameLifetimePool); + } + return this._frameLifetimePool; + }, + + /** + * Finalization handler that is called when the actor is being evicted from + * the pool. + */ + disconnect: function FA_disconnect() { + this.conn.removeActorPool(this._frameLifetimePool); + this._frameLifetimePool = null; + }, + + /** + * Returns a frame form for use in a protocol message. + */ + form: function FA_form() { + let form = { actor: this.actorID, + type: this.frame.type }; + if (this.frame.type === "call") { + form.callee = this.threadActor.createValueGrip(this.frame.callee); + } + + if (this.frame.environment) { + let envActor = this.threadActor + .createEnvironmentActor(this.frame.environment, + this.frameLifetimePool); + form.environment = envActor.form(); + } + form.this = this.threadActor.createValueGrip(this.frame.this); + form.arguments = this._args(); + if (this.frame.script) { + form.where = { url: this.frame.script.url, + line: this.frame.script.getOffsetLine(this.frame.offset) }; + form.isBlackBoxed = this.threadActor.sources.isBlackBoxed(this.frame.script.url) + } + + if (!this.frame.older) { + form.oldest = true; + } + + return form; + }, + + _args: function FA__args() { + if (!this.frame.arguments) { + return []; + } + + return [this.threadActor.createValueGrip(arg) + for each (arg in this.frame.arguments)]; + }, + + /** + * Handle a protocol request to pop this frame from the stack. + * + * @param aRequest object + * The protocol request object. + */ + onPop: function FA_onPop(aRequest) { + // TODO: remove this when Debugger.Frame.prototype.pop is implemented + if (typeof this.frame.pop != "function") { + return { error: "notImplemented", + message: "Popping frames is not yet implemented." }; + } + + while (this.frame != this.threadActor.dbg.getNewestFrame()) { + this.threadActor.dbg.getNewestFrame().pop(); + } + this.frame.pop(aRequest.completionValue); + + // TODO: return the watches property when frame pop watch actors are + // implemented. + return { from: this.actorID }; + } +}; + +FrameActor.prototype.requestTypes = { + "pop": FrameActor.prototype.onPop, +}; + + +/** + * Creates a BreakpointActor. BreakpointActors exist for the lifetime of their + * containing thread and are responsible for deleting breakpoints, handling + * breakpoint hits and associating breakpoints with scripts. + * + * @param ThreadActor aThreadActor + * The parent thread actor that contains this breakpoint. + * @param object aLocation + * The location of the breakpoint as specified in the protocol. + */ +function BreakpointActor(aThreadActor, aLocation) +{ + this.scripts = []; + this.threadActor = aThreadActor; + this.location = aLocation; +} + +BreakpointActor.prototype = { + actorPrefix: "breakpoint", + + /** + * Called when this same breakpoint is added to another Debugger.Script + * instance, in the case of a page reload. + * + * @param aScript Debugger.Script + * The new source script on which the breakpoint has been set. + * @param ThreadActor aThreadActor + * The parent thread actor that contains this breakpoint. + */ + addScript: function BA_addScript(aScript, aThreadActor) { + this.threadActor = aThreadActor; + this.scripts.push(aScript); + }, + + /** + * Remove the breakpoints from associated scripts and clear the script cache. + */ + removeScripts: function () { + for (let script of this.scripts) { + script.clearBreakpoint(this); + } + this.scripts = []; + }, + + /** + * A function that the engine calls when a breakpoint has been hit. + * + * @param aFrame Debugger.Frame + * The stack frame that contained the breakpoint. + */ + hit: function BA_hit(aFrame) { + if (this.threadActor.sources.isBlackBoxed(this.location.url)) { + return undefined; + } + + // TODO: add the rest of the breakpoints on that line (bug 676602). + let reason = { type: "breakpoint", actors: [ this.actorID ] }; + return this.threadActor._pauseAndRespond(aFrame, reason, (aPacket) => { + log("pause callback ..."); + + let { url, line } = aPacket.frame.where; + return this.threadActor.sources.getOriginalLocation(url, line) + .then(function (aOrigPosition) { + aPacket.frame.where = aOrigPosition; + return aPacket; + }); + }); + }, + + /** + * Handle a protocol request to remove this breakpoint. + * + * @param aRequest object + * The protocol request object. + */ + onDelete: function BA_onDelete(aRequest) { + // Remove from the breakpoint store. + let scriptBreakpoints = this.threadActor._breakpointStore[this.location.url]; + delete scriptBreakpoints[this.location.line]; + this.threadActor._hooks.removeFromParentPool(this); + // Remove the actual breakpoint from the associated scripts. + this.removeScripts(); + + return { from: this.actorID }; + } +}; + +BreakpointActor.prototype.requestTypes = { + "delete": BreakpointActor.prototype.onDelete +}; + + +/** + * Creates an EnvironmentActor. EnvironmentActors are responsible for listing + * the bindings introduced by a lexical environment and assigning new values to + * those identifier bindings. + * + * @param Debugger.Environment aEnvironment + * The lexical environment that will be used to create the actor. + * @param ThreadActor aThreadActor + * The parent thread actor that contains this environment. + */ +function EnvironmentActor(aEnvironment, aThreadActor) +{ + this.obj = aEnvironment; + this.threadActor = aThreadActor; +} + +EnvironmentActor.prototype = { + actorPrefix: "environment", + + /** + * Return an environment form for use in a protocol message. + */ + form: function EA_form() { + let form = { actor: this.actorID }; + + // What is this environment's type? + if (this.obj.type == "declarative") { + form.type = this.obj.callee ? "function" : "block"; + } else { + form.type = this.obj.type; + } + + // Does this environment have a parent? + if (this.obj.parent) { + form.parent = (this.threadActor + .createEnvironmentActor(this.obj.parent, + this.registeredPool) + .form()); + } + + // Does this environment reflect the properties of an object as variables? + if (this.obj.type == "object" || this.obj.type == "with") { + form.object = this.threadActor.createValueGrip(this.obj.object); + } + + // Is this the environment created for a function call? + if (this.obj.callee) { + form.function = this.threadActor.createValueGrip(this.obj.callee); + } + + // Shall we list this environment's bindings? + if (this.obj.type == "declarative") { + form.bindings = this._bindings(); + } + + return form; + }, + + /** + * Return the identifier bindings object as required by the remote protocol + * specification. + */ + _bindings: function EA_bindings() { + let bindings = { arguments: [], variables: {} }; + + // TODO: this part should be removed in favor of the commented-out part + // below when getVariableDescriptor lands (bug 725815). + if (typeof this.obj.getVariable != "function") { + //if (typeof this.obj.getVariableDescriptor != "function") { + return bindings; + } + + let parameterNames; + if (this.obj.callee) { + parameterNames = this.obj.callee.parameterNames; + } + for each (let name in parameterNames) { + let arg = {}; + // TODO: this part should be removed in favor of the commented-out part + // below when getVariableDescriptor lands (bug 725815). + let desc = { + value: this.obj.getVariable(name), + configurable: false, + writable: true, + enumerable: true + }; + + // let desc = this.obj.getVariableDescriptor(name); + let descForm = { + enumerable: true, + configurable: desc.configurable + }; + if ("value" in desc) { + descForm.value = this.threadActor.createValueGrip(desc.value); + descForm.writable = desc.writable; + } else { + descForm.get = this.threadActor.createValueGrip(desc.get); + descForm.set = this.threadActor.createValueGrip(desc.set); + } + arg[name] = descForm; + bindings.arguments.push(arg); + } + + for each (let name in this.obj.names()) { + if (bindings.arguments.some(function exists(element) { + return !!element[name]; + })) { + continue; + } + + // TODO: this part should be removed in favor of the commented-out part + // below when getVariableDescriptor lands. + let desc = { + configurable: false, + writable: true, + enumerable: true + }; + try { + desc.value = this.obj.getVariable(name); + } catch (e) { + // Avoid "Debugger scope is not live" errors for |arguments|, introduced + // in bug 746601. + if (name != "arguments") { + throw e; + } + } + //let desc = this.obj.getVariableDescriptor(name); + let descForm = { + enumerable: true, + configurable: desc.configurable + }; + if ("value" in desc) { + descForm.value = this.threadActor.createValueGrip(desc.value); + descForm.writable = desc.writable; + } else { + descForm.get = this.threadActor.createValueGrip(desc.get); + descForm.set = this.threadActor.createValueGrip(desc.set); + } + bindings.variables[name] = descForm; + } + + return bindings; + }, + + /** + * Handle a protocol request to change the value of a variable bound in this + * lexical environment. + * + * @param aRequest object + * The protocol request object. + */ + onAssign: function EA_onAssign(aRequest) { + // TODO: enable the commented-out part when getVariableDescriptor lands + // (bug 725815). + /*let desc = this.obj.getVariableDescriptor(aRequest.name); + + if (!desc.writable) { + return { error: "immutableBinding", + message: "Changing the value of an immutable binding is not " + + "allowed" }; + }*/ + + try { + this.obj.setVariable(aRequest.name, aRequest.value); + } catch (e) { + if (e instanceof Debugger.DebuggeeWouldRun) { + return { error: "threadWouldRun", + cause: e.cause ? e.cause : "setter", + message: "Assigning a value would cause the debuggee to run" }; + } + // This should never happen, so let it complain loudly if it does. + throw e; + } + return { from: this.actorID }; + }, + + /** + * Handle a protocol request to fully enumerate the bindings introduced by the + * lexical environment. + * + * @param aRequest object + * The protocol request object. + */ + onBindings: function EA_onBindings(aRequest) { + return { from: this.actorID, + bindings: this._bindings() }; + } +}; + +EnvironmentActor.prototype.requestTypes = { + "assign": EnvironmentActor.prototype.onAssign, + "bindings": EnvironmentActor.prototype.onBindings +}; + +/** + * Override the toString method in order to get more meaningful script output + * for debugging the debugger. + */ +Debugger.Script.prototype.toString = function() { + let output = ""; + if (this.url) { + output += this.url; + } + if (typeof this.startLine != "undefined") { + output += ":" + this.startLine; + if (this.lineCount && this.lineCount > 1) { + output += "-" + (this.startLine + this.lineCount - 1); + } + } + if (this.strictMode) { + output += ":strict"; + } + return output; +}; + +/** + * Helper property for quickly getting to the line number a stack frame is + * currently paused at. + */ +Object.defineProperty(Debugger.Frame.prototype, "line", { + configurable: true, + get: function() { + if (this.script) { + return this.script.getOffsetLine(this.offset); + } else { + return null; + } + } +}); + + +/** + * Creates an actor for handling chrome debugging. ChromeDebuggerActor is a + * thin wrapper over ThreadActor, slightly changing some of its behavior. + * + * @param aConnection object + * The DebuggerServerConnection with which this ChromeDebuggerActor + * is associated. (Currently unused, but required to make this + * constructor usable with addGlobalActor.) + * + * @param aHooks object + * An object with preNest and postNest methods for calling when entering + * and exiting a nested event loop and also addToParentPool and + * removeFromParentPool methods for handling the lifetime of actors that + * will outlive the thread, like breakpoints. + */ +function ChromeDebuggerActor(aConnection, aHooks) +{ + ThreadActor.call(this, aHooks); +} + +ChromeDebuggerActor.prototype = Object.create(ThreadActor.prototype); + +update(ChromeDebuggerActor.prototype, { + constructor: ChromeDebuggerActor, + + // A constant prefix that will be used to form the actor ID by the server. + actorPrefix: "chromeDebugger", + + /** + * Override the eligibility check for scripts and sources to make sure every + * script and source with a URL is stored when debugging chrome. + */ + _allowSource: function(aSourceURL) !!aSourceURL, + + /** + * An object that will be used by ThreadActors to tailor their behavior + * depending on the debugging context being required (chrome or content). + * The methods that this object provides must be bound to the ThreadActor + * before use. + */ + globalManager: { + findGlobals: function CDA_findGlobals() { + // Add every global known to the debugger as debuggee. + this.dbg.addAllGlobalsAsDebuggees(); + }, + + /** + * A function that the engine calls when a new global object has been + * created. + * + * @param aGlobal Debugger.Object + * The new global object that was created. + */ + onNewGlobal: function CDA_onNewGlobal(aGlobal) { + this.addDebuggee(aGlobal); + // Notify the client. + this.conn.send({ + from: this.actorID, + type: "newGlobal", + // TODO: after bug 801084 lands see if we need to JSONify this. + hostAnnotations: aGlobal.hostAnnotations + }); + } + } +}); + + +/** + * Manages the sources for a thread. Handles source maps, locations in the + * sources, etc for ThreadActors. + */ +function ThreadSources(aThreadActor, aUseSourceMaps, aAllowPredicate, + aOnNewSource) { + this._thread = aThreadActor; + this._useSourceMaps = aUseSourceMaps; + this._allow = aAllowPredicate; + this._onNewSource = aOnNewSource; + + // source map URL --> promise of SourceMapConsumer + this._sourceMaps = Object.create(null); + // generated source url --> promise of SourceMapConsumer + this._sourceMapsByGeneratedSource = Object.create(null); + // original source url --> promise of SourceMapConsumer + this._sourceMapsByOriginalSource = Object.create(null); + // source url --> SourceActor + this._sourceActors = Object.create(null); + // original url --> generated url + this._generatedUrlsByOriginalUrl = Object.create(null); +} + +/** + * Must be a class property because it needs to persist across reloads, same as + * the breakpoint store. + */ +ThreadSources._blackBoxedSources = new Set(); + +ThreadSources.prototype = { + /** + * Return the source actor representing |aURL|, creating one if none + * exists already. Returns null if |aURL| is not allowed by the 'allow' + * predicate. + * + * Right now this takes a URL, but in the future it should + * take a Debugger.Source. See bug 637572. + * + * @param String aURL + * The source URL. + * @param optional SourceMapConsumer aSourceMap + * The source map that introduced this source, if any. + * @returns a SourceActor representing the source at aURL or null. + */ + source: function TS_source(aURL, aSourceMap=null) { + if (!this._allow(aURL)) { + return null; + } + + if (aURL in this._sourceActors) { + return this._sourceActors[aURL]; + } + + let actor = new SourceActor(aURL, this._thread, aSourceMap); + this._thread.threadLifetimePool.addActor(actor); + this._sourceActors[aURL] = actor; + try { + this._onNewSource(actor); + } catch (e) { + reportError(e); + } + return actor; + }, + + /** + * Return a promise of an array of source actors representing all the + * sources of |aScript|. + * + * If source map handling is enabled and |aScript| has a source map, then + * use it to find all of |aScript|'s *original* sources; return a promise + * of an array of source actors for those. + */ + sourcesForScript: function TS_sourcesForScript(aScript) { + if (!this._useSourceMaps || !aScript.sourceMapURL) { + return resolve([this.source(aScript.url)].filter(isNotNull)); + } + + return this.sourceMap(aScript) + .then((aSourceMap) => { + return [ + this.source(s, aSourceMap) for (s of aSourceMap.sources) + ]; + }) + .then(null, (e) => { + reportError(e); + delete this._sourceMaps[this._normalize(aScript.sourceMapURL, aScript.url)]; + delete this._sourceMapsByGeneratedSource[aScript.url]; + return [this.source(aScript.url)]; + }) + .then(function (aSources) { + return aSources.filter(isNotNull); + }); + }, + + /** + * Return a promise of a SourceMapConsumer for the source map for + * |aScript|; if we already have such a promise extant, return that. + * |aScript| must have a non-null sourceMapURL. + */ + sourceMap: function TS_sourceMap(aScript) { + if (aScript.url in this._sourceMapsByGeneratedSource) { + return this._sourceMapsByGeneratedSource[aScript.url]; + } + dbg_assert(aScript.sourceMapURL); + let sourceMapURL = this._normalize(aScript.sourceMapURL, aScript.url); + let map = this._fetchSourceMap(sourceMapURL) + .then((aSourceMap) => { + for (let s of aSourceMap.sources) { + this._generatedUrlsByOriginalUrl[s] = aScript.url; + this._sourceMapsByOriginalSource[s] = resolve(aSourceMap); + } + return aSourceMap; + }); + this._sourceMapsByGeneratedSource[aScript.url] = map; + return map; + }, + + /** + * Return a promise of a SourceMapConsumer for the source map located at + * |aAbsSourceMapURL|, which must be absolute. If there is already such a + * promise extant, return it. + */ + _fetchSourceMap: function TS__fetchSourceMap(aAbsSourceMapURL) { + if (aAbsSourceMapURL in this._sourceMaps) { + return this._sourceMaps[aAbsSourceMapURL]; + } else { + let promise = fetch(aAbsSourceMapURL).then((rawSourceMap) => { + let map = new SourceMapConsumer(rawSourceMap); + let base = aAbsSourceMapURL.replace(/\/[^\/]+$/, '/'); + if (base.indexOf("data:") !== 0) { + map.sourceRoot = map.sourceRoot + ? this._normalize(map.sourceRoot, base) + : base; + } + return map; + }); + this._sourceMaps[aAbsSourceMapURL] = promise; + return promise; + } + }, + + /** + * Returns a promise of the location in the original source if the source is + * source mapped, otherwise a promise of the same location. + * + * TODO bug 637572: take/return a column + */ + getOriginalLocation: function TS_getOriginalLocation(aSourceUrl, aLine) { + if (aSourceUrl in this._sourceMapsByGeneratedSource) { + return this._sourceMapsByGeneratedSource[aSourceUrl] + .then(function (aSourceMap) { + let { source, line } = aSourceMap.originalPositionFor({ + source: aSourceUrl, + line: aLine, + column: Infinity + }); + return { + url: source, + line: line + }; + }); + } + + // No source map + return resolve({ + url: aSourceUrl, + line: aLine + }); + }, + + /** + * Returns a promise of the location in the generated source corresponding to + * the original source and line given. + * + * When we pass a script S representing generated code to |sourceMap|, + * above, that returns a promise P. The process of resolving P populates + * the tables this function uses; thus, it won't know that S's original + * source URLs map to S until P is resolved. + * + * TODO bug 637572: take/return a column + */ + getGeneratedLocation: function TS_getGeneratedLocation(aSourceUrl, aLine) { + if (aSourceUrl in this._sourceMapsByOriginalSource) { + return this._sourceMapsByOriginalSource[aSourceUrl] + .then((aSourceMap) => { + let { line } = aSourceMap.generatedPositionFor({ + source: aSourceUrl, + line: aLine, + column: Infinity + }); + return { + url: this._generatedUrlsByOriginalUrl[aSourceUrl], + line: line + }; + }); + } + + // No source map + return resolve({ + url: aSourceUrl, + line: aLine + }); + }, + + /** + * Returns true if URL for the given source is black boxed. + * + * @param aURL String + * The URL of the source which we are checking whether it is black + * boxed or not. + */ + isBlackBoxed: function TS_isBlackBoxed(aURL) { + return ThreadSources._blackBoxedSources.has(aURL); + }, + + /** + * Add the given source URL to the set of sources that are black boxed. If the + * thread is currently paused and we are black boxing the yougest frame's + * source, this will force a step. + * + * @param aURL String + * The URL of the source which we are black boxing. + */ + blackBox: function TS_blackBox(aURL) { + ThreadSources._blackBoxedSources.add(aURL); + }, + + /** + * Remove the given source URL to the set of sources that are black boxed. + * + * @param aURL String + * The URL of the source which we are no longer black boxing. + */ + unblackBox: function TS_unblackBox(aURL) { + ThreadSources._blackBoxedSources.delete(aURL); + }, + + /** + * Normalize multiple relative paths towards the base paths on the right. + */ + _normalize: function TS__normalize(...aURLs) { + dbg_assert(aURLs.length > 1); + let base = Services.io.newURI(aURLs.pop(), null, null); + let url; + while ((url = aURLs.pop())) { + base = Services.io.newURI(url, null, base); + } + return base.spec; + }, + + iter: function TS_iter() { + for (let url in this._sourceActors) { + yield this._sourceActors[url]; + } + } +}; + +// Utility functions. + +/** + * Utility function for updating an object with the properties of another + * object. + * + * @param aTarget Object + * The object being updated. + * @param aNewAttrs Object + * The new attributes being set on the target. + */ +function update(aTarget, aNewAttrs) { + for (let key in aNewAttrs) { + let desc = Object.getOwnPropertyDescriptor(aNewAttrs, key); + + if (desc) { + Object.defineProperty(aTarget, key, desc); + } + } +} + +/** + * Returns true if its argument is not null. + */ +function isNotNull(aThing) { + return aThing !== null; +} + +/** + * Performs a request to load the desired URL and returns a promise. + * + * @param aURL String + * The URL we will request. + * @returns Promise + * A promise of the document at that URL, as a string. + * + * XXX: It may be better to use nsITraceableChannel to get to the sources + * without relying on caching when we can (not for eval, etc.): + * http://www.softwareishard.com/blog/firebug/nsitraceablechannel-intercept-http-traffic/ + */ +function fetch(aURL, aOptions={ loadFromCache: true }) { + let deferred = defer(); + let scheme; + let url = aURL.split(" -> ").pop(); + let charset; + let filePath = url; + // try { + // scheme = Services.io.extractScheme(url); + // } catch (e) { + // In the xpcshell tests, the script url is the absolute path of the test + // file, which will make a malformed URI error be thrown. Add the file + // scheme prefix ourselves. + url = "file://" + url; + // scheme = Services.io.extractScheme(url); + // } + scheme = "file"; + + switch (scheme) { + case "file": + case "chrome": + case "resource": + try { + // NetUtil.asyncFetch(url, function onFetch(aStream, aStatus) { + // if (!Components.isSuccessCode(aStatus)) { + // deferred.reject("Request failed: " + url); + // return; + // } + let cc = globalDebuggee.cc; + let fileUtils = cc.FileUtils.getInstance(); + let source = fileUtils.getStringFromFile(filePath);//NetUtil.readInputStreamToString(aStream, aStream.available()); + if (!source) + { + deferred.reject("Request failed: " + url); + } + else + { + deferred.resolve(source); + } + // aStream.close(); + // }); + } catch (ex) { + deferred.reject("Request failed: " + url); + } + break; + + default: + let channel; + try { + channel = Services.io.newChannel(url, null, null); + } catch (e if e.name == "NS_ERROR_UNKNOWN_PROTOCOL") { + // On Windows xpcshell tests, c:/foo/bar can pass as a valid URL, but + // newChannel won't be able to handle it. + url = "file:///" + url; + channel = Services.io.newChannel(url, null, null); + } + let chunks = []; + let streamListener = { + onStartRequest: function(aRequest, aContext, aStatusCode) { + if (!Components.isSuccessCode(aStatusCode)) { + deferred.reject("Request failed: " + url); + } + }, + onDataAvailable: function(aRequest, aContext, aStream, aOffset, aCount) { + chunks.push(NetUtil.readInputStreamToString(aStream, aCount)); + }, + onStopRequest: function(aRequest, aContext, aStatusCode) { + if (!Components.isSuccessCode(aStatusCode)) { + deferred.reject("Request failed: " + url); + return; + } + + charset = channel.contentCharset; + deferred.resolve(chunks.join("")); + } + }; + + channel.loadFlags = aOptions.loadFromCache + ? channel.LOAD_FROM_CACHE + : channel.LOAD_BYPASS_CACHE; + channel.asyncOpen(streamListener, null); + break; + } + + return deferred.promise.then(function (source) { + return convertToUnicode(source, charset); + }); +} + +/** + * Convert a given string, encoded in a given character set, to unicode. + * + * @param string aString + * A string. + * @param string aCharset + * A character set. + */ +function convertToUnicode(aString, aCharset=null) { + // Decoding primitives. + // let converter = Cc["@mozilla.org/intl/scriptableunicodeconverter"] + // .createInstance(Ci.nsIScriptableUnicodeConverter); + // try { + // converter.charset = aCharset || "UTF-8"; + // return converter.ConvertToUnicode(aString); + // } catch(e) { + return aString; + // } +} + +/** + * Report the given error in the error console and to stdout. + */ +function reportError(aError) { + // Cu.reportError(aError); + dumpn(aError.message + ":\n" + aError.stack); +} diff --git a/cocos/scripting/javascript/bindings/js/debugger/core/promise.js b/cocos/scripting/javascript/bindings/js/debugger/core/promise.js new file mode 100644 index 0000000000..a695f5a3ad --- /dev/null +++ b/cocos/scripting/javascript/bindings/js/debugger/core/promise.js @@ -0,0 +1,294 @@ +/* vim:set ts=2 sw=2 sts=2 expandtab */ +/*jshint undef: true es5: true node: true browser: true devel: true + forin: true latedef: false */ +/*global define: true, Cu: true, __URI__: true */ +//;(function(id, factory) { // Module boilerplate :( +// if (typeof(define) === 'function') { // RequireJS +// define(factory); +// } else if (typeof(require) === 'function') { // CommonJS +// factory.call(this, require, exports, module); +// } else if (String(this).indexOf('BackstagePass') >= 0) { // JSM +// this[factory.name] = {}; +// try { +// this.console = this['Components'].utils +// .import('resource://gre/modules/devtools/Console.jsm', {}).console; +// } +// catch (ex) { +// // Avoid failures on different toolkit configurations. +// } +// factory(function require(uri) { +// var imports = {}; +// this['Components'].utils.import(uri, imports); +// return imports; +// }, this[factory.name], { uri: __URI__, id: id }); +// this.EXPORTED_SYMBOLS = [factory.name]; +// } else { // Browser or alike +// var globals = this; +// factory(function require(id) { +// return globals[id]; +// }, (globals[id] = {}), { uri: document.location.href + '#' + id, id: id }); +// } +//}).call(this, 'promise/core', function Promise(require, exports, module) { + +'use strict'; + +var exports = exports || {}; + +//module.metadata = { +// "stability": "unstable" +//}; + +/** + * Internal utility: Wraps given `value` into simplified promise, successfully + * fulfilled to a given `value`. Note the result is not a complete promise + * implementation, as its method `then` does not returns anything. + */ +function fulfilled(value) { + return { then: function then(fulfill) { fulfill(value); } }; +} + +/** + * Internal utility: Wraps given input into simplified promise, pre-rejected + * with a given `reason`. Note the result is not a complete promise + * implementation, as its method `then` does not returns anything. + */ +function rejected(reason) { + return { then: function then(fulfill, reject) { reject(reason); } }; +} + +/** + * Internal utility: Returns `true` if given `value` is a promise. Value is + * assumed to be a promise if it implements method `then`. + */ +function isPromise(value) { + return value && typeof(value.then) === 'function'; +} + +/** + * Creates deferred object containing fresh promise & methods to either resolve + * or reject it. The result is an object with the following properties: + * - `promise` Eventual value representation implementing CommonJS [Promises/A] + * (http://wiki.commonjs.org/wiki/Promises/A) API. + * - `resolve` Single shot function that resolves enclosed `promise` with a + * given `value`. + * - `reject` Single shot function that rejects enclosed `promise` with a given + * `reason`. + * + * An optional `prototype` argument is used as a prototype of the returned + * `promise` allowing one to implement additional API. If prototype is not + * passed then it falls back to `Object.prototype`. + * + * ## Example + * + * function fetchURI(uri, type) { + * var deferred = defer(); + * var request = new XMLHttpRequest(); + * request.open("GET", uri, true); + * request.responseType = type; + * request.onload = function onload() { + * deferred.resolve(request.response); + * } + * request.onerror = function(event) { + * deferred.reject(event); + * } + * request.send(); + * + * return deferred.promise; + * } + */ +function defer(prototype) { + // Define FIFO queue of observer pairs. Once promise is resolved & all queued + // observers are forwarded to `result` and variable is set to `null`. + var observers = []; + + // Promise `result`, which will be assigned a resolution value once promise + // is resolved. Note that result will always be assigned promise (or alike) + // object to take care of propagation through promise chains. If result is + // `null` promise is not resolved yet. + var result = null; + + prototype = (prototype || prototype === null) ? prototype : Object.prototype; + + // Create an object implementing promise API. + var promise = Object.create(prototype, { + then: { value: function then(onFulfill, onError) { + var deferred = defer(prototype); + + function resolve(value) { + // If `onFulfill` handler is provided resolve `deferred.promise` with + // result of invoking it with a resolution value. If handler is not + // provided propagate value through. + try { + deferred.resolve(onFulfill ? onFulfill(value) : value); + } + // `onFulfill` may throw exception in which case resulting promise + // is rejected with thrown exception. + catch(error) { + if (exports._reportErrors && typeof(console) === 'object') + console.error(error); + // Note: Following is equivalent of `deferred.reject(error)`, + // we use this shortcut to reduce a stack. + deferred.resolve(rejected(error)); + } + } + + function reject(reason) { + try { + if (onError) deferred.resolve(onError(reason)); + else deferred.resolve(rejected(reason)); + } + catch(error) { + if (exports._reportErrors && typeof(console) === 'object') + console.error(error); + deferred.resolve(rejected(error)); + } + } + + // If enclosed promise (`this.promise`) observers queue is still alive + // enqueue a new observer pair into it. Note that this does not + // necessary means that promise is pending, it may already be resolved, + // but we still have to queue observers to guarantee an order of + // propagation. + if (observers) { + observers.push({ resolve: resolve, reject: reject }); + } + // Otherwise just forward observer pair right to a `result` promise. + else { + result.then(resolve, reject); + } + + return deferred.promise; + }} + }) + + var deferred = { + promise: promise, + /** + * Resolves associated `promise` to a given `value`, unless it's already + * resolved or rejected. Note that resolved promise is not necessary a + * successfully fulfilled. Promise may be resolved with a promise `value` + * in which case `value` promise's fulfillment / rejection will propagate + * up to a promise resolved with `value`. + */ + resolve: function resolve(value) { + if (!result) { + // Store resolution `value` in a `result` as a promise, so that all + // the subsequent handlers can be simply forwarded to it. Since + // `result` will be a promise all the value / error propagation will + // be uniformly taken care of. + result = isPromise(value) ? value : fulfilled(value); + + // Forward already registered observers to a `result` promise in the + // order they were registered. Note that we intentionally dequeue + // observer at a time until queue is exhausted. This makes sure that + // handlers registered as side effect of observer forwarding are + // queued instead of being invoked immediately, guaranteeing FIFO + // order. + while (observers.length) { + var observer = observers.shift(); + result.then(observer.resolve, observer.reject); + } + + // Once `observers` queue is exhausted we `null`-ify it, so that + // new handlers are forwarded straight to the `result`. + observers = null; + } + }, + /** + * Rejects associated `promise` with a given `reason`, unless it's already + * resolved / rejected. This is just a (better performing) convenience + * shortcut for `deferred.resolve(reject(reason))`. + */ + reject: function reject(reason) { + // Note that if promise is resolved that does not necessary means that it + // is successfully fulfilled. Resolution value may be a promise in which + // case its result propagates. In other words if promise `a` is resolved + // with promise `b`, `a` is either fulfilled or rejected depending + // on weather `b` is fulfilled or rejected. Here `deferred.promise` is + // resolved with a promise pre-rejected with a given `reason`, there for + // `deferred.promise` is rejected with a given `reason`. This may feel + // little awkward first, but doing it this way greatly simplifies + // propagation through promise chains. + deferred.resolve(rejected(reason)); + } + }; + + return deferred; +} +exports.defer = defer; + +/** + * Returns a promise resolved to a given `value`. Optionally a second + * `prototype` argument may be provided to be used as a prototype for the + * returned promise. + */ +function resolve(value, prototype) { + var deferred = defer(prototype); + deferred.resolve(value); + return deferred.promise; +} +exports.resolve = resolve; + +/** + * Returns a promise rejected with a given `reason`. Optionally a second + * `prototype` argument may be provided to be used as a prototype for the + * returned promise. + */ +function reject(reason, prototype) { + var deferred = defer(prototype); + deferred.reject(reason); + return deferred.promise; +} +exports.reject = reject; + +var promised = (function() { + // Note: Define shortcuts and utility functions here in order to avoid + // slower property accesses and unnecessary closure creations on each + // call of this popular function. + + var call = Function.call; + var concat = Array.prototype.concat; + + // Utility function that does following: + // execute([ f, self, args...]) => f.apply(self, args) + function execute(args) { return call.apply(call, args) } + + // Utility function that takes promise of `a` array and maybe promise `b` + // as arguments and returns promise for `a.concat(b)`. + function promisedConcat(promises, unknown) { + return promises.then(function(values) { + return resolve(unknown).then(function(value) { + return values.concat([ value ]); + }); + }); + } + + return function promised(f, prototype) { + /** + Returns a wrapped `f`, which when called returns a promise that resolves to + `f(...)` passing all the given arguments to it, which by the way may be + promises. Optionally second `prototype` argument may be provided to be used + a prototype for a returned promise. + + ## Example + + var promise = promised(Array)(1, promise(2), promise(3)) + promise.then(console.log) // => [ 1, 2, 3 ] + **/ + + return function promised() { + // create array of [ f, this, args... ] + return concat.apply([ f, this ], arguments). + // reduce it via `promisedConcat` to get promised array of fulfillments + reduce(promisedConcat, resolve([], prototype)). + // finally map that to promise of `f.apply(this, args...)` + then(execute); + }; + } +})(); +exports.promised = promised; +// +var all = promised(Array); +exports.all = all; +// +//}); diff --git a/cocos/scripting/javascript/bindings/js/debugger/main.js b/cocos/scripting/javascript/bindings/js/debugger/main.js new file mode 100644 index 0000000000..f08009ade6 --- /dev/null +++ b/cocos/scripting/javascript/bindings/js/debugger/main.js @@ -0,0 +1,928 @@ +/* -*- Mode: javascript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ft=javascript ts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +"use strict"; +/** + * Toolkit glue for the remote debugging protocol, loaded into the + * debugging global. + */ + +//const Ci = Components.interfaces; +//const Cc = Components.classes; +//const CC = Components.Constructor; +//const Cu = Components.utils; +//const Cr = Components.results; +//const DBG_STRINGS_URI = "chrome://global/locale/devtools/debugger.properties"; +// +//Cu.import("resource://gre/modules/Services.jsm"); +//Cu.import("resource://gre/modules/XPCOMUtils.jsm"); +//let wantLogging = Services.prefs.getBoolPref("devtools.debugger.log"); +// +//Cu.import("resource://gre/modules/jsdebugger.jsm"); +//addDebuggerToGlobal(this); +// +//Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js"); +//const { defer, resolve, reject, all } = Promise; +// +//Cu.import("resource://gre/modules/devtools/SourceMap.jsm"); +// +//loadSubScript.call(this, "resource://gre/modules/devtools/DevToolsUtils.js"); + +let wantLogging = true; +let debuggerServer = null; + +function dumpn(str) { + if (wantLogging) { + log("DBG-SERVER: " + str + "\n"); + } +} + +function dbg_assert(cond, e) { + if (!cond) { + log("assert >>>> " + cond.toString()); + return e; + } +} + +function XPCInspector() { + this.exitNestedEventLoop = _exitNestedEventLoop; + this.enterNestedEventLoop = _enterNestedEventLoop; + this.eventLoopNestLevel = _getEventLoopNestLevel; +} + +//loadSubScript.call(this, "resource://gre/modules/devtools/server/transport.js"); + +// XPCOM constructors +// const ServerSocket = CC("@mozilla.org/network/server-socket;1", +// "nsIServerSocket", +// "initSpecialConnection"); + +function ServerSocket(aPort, flags, c){ + this.asyncListen = function(server){ + log("asyncListen...."); + debuggerServer = server; + }; +}; + +var gRegisteredModules = Object.create(null); + +/** + * The ModuleAPI object is passed to modules loaded using the + * DebuggerServer.registerModule() API. Modules can use this + * object to register actor factories. + * Factories registered through the module API will be removed + * when the module is unregistered or when the server is + * destroyed. + */ +function ModuleAPI() { + let activeTabActors = new Set(); + let activeGlobalActors = new Set(); + + return { + // See DebuggerServer.addGlobalActor for a description. + addGlobalActor: function(factory, name) { + DebuggerServer.addGlobalActor(factory, name); + activeGlobalActors.add(factory); + }, + // See DebuggerServer.removeGlobalActor for a description. + removeGlobalActor: function(factory) { + DebuggerServer.removeGlobalActor(factory); + activeGlobalActors.delete(factory); + }, + + // See DebuggerServer.addTabActor for a description. + addTabActor: function(factory, name) { + DebuggerServer.addTabActor(factory, name); + activeTabActors.add(factory); + }, + // See DebuggerServer.removeTabActor for a description. + removeTabActor: function(factory) { + DebuggerServer.removeTabActor(factory); + activeTabActors.delete(factory); + }, + + // Destroy the module API object, unregistering any + // factories registered by the module. + destroy: function() { + for (let factory of activeTabActors) { + DebuggerServer.removeTabActor(factory); + } + activeTabActors = null; + for (let factory of activeGlobalActors) { + DebuggerServer.removeGlobalActor(factory); + } + activeGlobalActors = null; + } + } +}; + +/*** + * Public API + */ +var DebuggerServer = { + _listener: null, + _initialized: false, + _transportInitialized: false, + xpcInspector: null, + _transport: null, + // Number of currently open TCP connections. + _socketConnections: 0, + // Map of global actor names to actor constructors provided by extensions. + globalActorFactories: {}, + // Map of tab actor names to actor constructors provided by extensions. + tabActorFactories: {}, + + LONG_STRING_LENGTH: 10000, + LONG_STRING_INITIAL_LENGTH: 1000, + LONG_STRING_READ_LENGTH: 1000, + + /** + * A handler function that prompts the user to accept or decline the incoming + * connection. + */ + _allowConnection: null, + + /** + * Prompt the user to accept or decline the incoming connection. This is the + * default implementation that products embedding the debugger server may + * choose to override. + * + * @return true if the connection should be permitted, false otherwise + */ + _defaultAllowConnection: function DS__defaultAllowConnection() { + // let title = L10N.getStr("remoteIncomingPromptTitle"); + // let msg = L10N.getStr("remoteIncomingPromptMessage"); + // let disableButton = L10N.getStr("remoteIncomingPromptDisable"); + // let prompt = Services.prompt; + // let flags = prompt.BUTTON_POS_0 * prompt.BUTTON_TITLE_OK + + // prompt.BUTTON_POS_1 * prompt.BUTTON_TITLE_CANCEL + + // prompt.BUTTON_POS_2 * prompt.BUTTON_TITLE_IS_STRING + + // prompt.BUTTON_POS_1_DEFAULT; + // let result = prompt.confirmEx(null, title, msg, flags, null, null, + // disableButton, null, { value: false }); + // if (result == 0) { + // return true; + // } + // if (result == 2) { + // DebuggerServer.closeListener(true); + // Services.prefs.setBoolPref("devtools.debugger.remote-enabled", false); + // } + // return false; + return true; + }, + + /** + * Initialize the debugger server. + * + * @param function aAllowConnectionCallback + * The embedder-provider callback, that decides whether an incoming + * remote protocol conection should be allowed or refused. + */ + init: function DS_init(aAllowConnectionCallback) { + if (this.initialized) { + return; + } + + this.xpcInspector = new XPCInspector();//Cc["@mozilla.org/jsinspector;1"].getService(Ci.nsIJSInspector); + this.initTransport(aAllowConnectionCallback); + this.addActors("resource://gre/modules/devtools/server/actors/root.js"); + + this._initialized = true; + }, + + /** + * Initialize the debugger server's transport variables. This can be + * in place of init() for cases where the jsdebugger isn't needed. + * + * @param function aAllowConnectionCallback + * The embedder-provider callback, that decides whether an incoming + * remote protocol conection should be allowed or refused. + */ + initTransport: function DS_initTransport(aAllowConnectionCallback) { + if (this._transportInitialized) { + return; + } + + this._connections = {}; + this._nextConnID = 0; + this._transportInitialized = true; + this._allowConnection = aAllowConnectionCallback ? + aAllowConnectionCallback : + this._defaultAllowConnection; + }, + + get initialized() this._initialized, + + /** + * Performs cleanup tasks before shutting down the debugger server, if no + * connections are currently open. Such tasks include clearing any actor + * constructors added at runtime. This method should be called whenever a + * debugger server is no longer useful, to avoid memory leaks. After this + * method returns, the debugger server must be initialized again before use. + */ + destroy: function DS_destroy() { + if (!this._initialized) { + return; + } + + for (let connID of Object.getOwnPropertyNames(this._connections)) { + this._connections[connID].close(); + } + + for (let id of Object.getOwnPropertyNames(gRegisteredModules)) { + let mod = gRegisteredModules[id]; + mod.module.unregister(mod.api); + } + gRegisteredModules = {}; + + this.closeListener(); + this.globalActorFactories = {}; + this.tabActorFactories = {}; + delete this._allowConnection; + this._transportInitialized = false; + this._initialized = false; + dumpn("Debugger server is shut down."); + }, + + /** + * Load a subscript into the debugging global. + * + * @param aURL string A url that will be loaded as a subscript into the + * debugging global. The user must load at least one script + * that implements a createRootActor() function to create the + * server's root actor. + */ + addActors: function DS_addActors(aURL) { + //loadSubScript.call(this, aURL); + }, + + /** + * Register a CommonJS module with the debugger server. + * @param id string + * The ID of a CommonJS module. This module must export + * 'register' and 'unregister' functions. + */ + registerModule: function(id) { + if (id in gRegisteredModules) { + throw new Error("Tried to register a module twice: " + id + "\n"); + } + + let moduleAPI = ModuleAPI(); + + let {devtools} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {}); + let mod = devtools.require(id); + mod.register(moduleAPI); + gRegisteredModules[id] = { module: mod, api: moduleAPI }; + }, + + /** + * Returns true if a module id has been registered. + */ + isModuleRegistered: function(id) { + return (id in gRegisteredModules); + }, + + /** + * Unregister a previously-loaded CommonJS module from the debugger server. + */ + unregisterModule: function(id) { + let mod = gRegisteredModules[id]; + if (!mod) { + throw new Error("Tried to unregister a module that was not previously registered."); + } + mod.module.unregister(mod.api); + mod.api.destroy(); + delete gRegisteredModules[id]; + }, + + /** + * Install Firefox-specific actors. + */ + addBrowserActors: function DS_addBrowserActors() { + this.addActors("resource://gre/modules/devtools/server/actors/webbrowser.js"); + this.addActors("resource://gre/modules/devtools/server/actors/script.js"); + this.addGlobalActor(this.ChromeDebuggerActor, "chromeDebugger"); + this.addActors("resource://gre/modules/devtools/server/actors/webconsole.js"); + this.addActors("resource://gre/modules/devtools/server/actors/gcli.js"); + if ("nsIProfiler" in Ci) + this.addActors("resource://gre/modules/devtools/server/actors/profiler.js"); + + this.addActors("resource://gre/modules/devtools/server/actors/styleeditor.js"); + this.addActors("resource://gre/modules/devtools/server/actors/webapps.js"); + this.registerModule("devtools/server/actors/inspector"); + }, + + /** + * Listens on the given port for remote debugger connections. + * + * @param aPort int + * The port to listen on. + */ + openListener: function DS_openListener(aPort) { + // if (!Services.prefs.getBoolPref("devtools.debugger.remote-enabled")) { + // return false; + // } + this._checkInit(); + + // Return early if the server is already listening. + if (this._listener) { + return true; + } + + // let flags = Ci.nsIServerSocket.KeepWhenOffline; + // A preference setting can force binding on the loopback interface. + // if (Services.prefs.getBoolPref("devtools.debugger.force-local")) { + // flags |= Ci.nsIServerSocket.LoopbackOnly; + // } + + let flags = 0; + + try { + let socket = new ServerSocket(aPort, flags, 4); + socket.asyncListen(this); + this._listener = socket; + } catch (e) { + dumpn("Could not start debugging listener on port " + aPort + ": " + e); + throw "Cr.NS_ERROR_NOT_AVAILABLE"; + } + this._socketConnections++; + + return true; + }, + + /** + * Close a previously-opened TCP listener. + * + * @param aForce boolean [optional] + * If set to true, then the socket will be closed, regardless of the + * number of open connections. + */ + closeListener: function DS_closeListener(aForce) { + if (!this._listener || this._socketConnections == 0) { + return false; + } + + // Only close the listener when the last connection is closed, or if the + // aForce flag is passed. + if (--this._socketConnections == 0 || aForce) { + this._listener.close(); + this._listener = null; + this._socketConnections = 0; + } + + return true; + }, + + /** + * Creates a new connection to the local debugger speaking over a fake + * transport. This connection results in straightforward calls to the onPacket + * handlers of each side. + * + * @returns a client-side DebuggerTransport for communicating with + * the newly-created connection. + */ + connectPipe: function DS_connectPipe() { + this._checkInit(); + + let serverTransport = new LocalDebuggerTransport; + let clientTransport = new LocalDebuggerTransport(serverTransport); + serverTransport.other = clientTransport; + let connection = this._onConnection(serverTransport); + + // I'm putting this here because I trust you. + // + // There are times, when using a local connection, when you're going + // to be tempted to just get direct access to the server. Resist that + // temptation! If you succumb to that temptation, you will make the + // fine developers that work on Fennec and Firefox OS sad. They're + // professionals, they'll try to act like they understand, but deep + // down you'll know that you hurt them. + // + // This reference allows you to give in to that temptation. There are + // times this makes sense: tests, for example, and while porting a + // previously local-only codebase to the remote protocol. + // + // But every time you use this, you will feel the shame of having + // used a property that starts with a '_'. + clientTransport._serverConnection = connection; + + return clientTransport; + }, + + + // nsIServerSocketListener implementation + + onSocketAccepted: + makeInfallible(function DS_onSocketAccepted(aSocket, aTransport) { + if (!this._allowConnection()) { + return; + } + dumpn("New debugging connection on " + aTransport.host + ":" + aTransport.port); + + let input = aTransport.openInputStream(0, 0, 0); + let output = aTransport.openOutputStream(0, 0, 0); + let transport = new DebuggerTransport(input, output); + DebuggerServer._onConnection(transport); + }, "DebuggerServer.onSocketAccepted"), + + onStopListening: function DS_onStopListening(aSocket, status) { + dumpn("onStopListening, status: " + status); + }, + + /** + * Raises an exception if the server has not been properly initialized. + */ + _checkInit: function DS_checkInit() { + if (!this._transportInitialized) { + throw "DebuggerServer has not been initialized."; + } + + if (!this.createRootActor) { + throw "Use DebuggerServer.addActors() to add a root actor implementation."; + } + }, + + /** + * Create a new debugger connection for the given transport. Called + * after connectPipe() or after an incoming socket connection. + */ + _onConnection: function DS_onConnection(aTransport) { + log("DebuggerServer._onConnection...."); + + this._transport = aTransport; + + let connID = "conn" + this._nextConnID++ + '.'; + let conn = new DebuggerServerConnection(connID, aTransport); + this._connections[connID] = conn; + + // Create a root actor for the connection and send the hello packet. + conn.rootActor = this.createRootActor(conn); + conn.addActor(conn.rootActor); + + aTransport.send(conn.rootActor.sayHello()); + aTransport.ready(); + + return conn; + }, + + /** + * Remove the connection from the debugging server. + */ + _connectionClosed: function DS_connectionClosed(aConnection) { + delete this._connections[aConnection.prefix]; + }, + + // DebuggerServer extension API. + + /** + * Registers handlers for new tab-scoped request types defined dynamically. + * This is used for example by add-ons to augment the functionality of the tab + * actor. Note that the name or actorPrefix of the request type is not allowed + * to clash with existing protocol packet properties, like 'title', 'url' or + * 'actor', since that would break the protocol. + * + * @param aFunction function + * The constructor function for this request type. This expects to be + * called as a constructor (i.e. with 'new'), and passed two + * arguments: the DebuggerServerConnection, and the BrowserTabActor + * with which it will be associated. + * + * @param aName string [optional] + * The name of the new request type. If this is not present, the + * actorPrefix property of the constructor prototype is used. + */ + addTabActor: function DS_addTabActor(aFunction, aName) { + let name = aName ? aName : aFunction.prototype.actorPrefix; + if (["title", "url", "actor"].indexOf(name) != -1) { + throw Error(name + " is not allowed"); + } + if (DebuggerServer.tabActorFactories.hasOwnProperty(name)) { + throw Error(name + " already exists"); + } + DebuggerServer.tabActorFactories[name] = aFunction; + }, + + /** + * Unregisters the handler for the specified tab-scoped request type. + * This may be used for example by add-ons when shutting down or upgrading. + * + * @param aFunction function + * The constructor function for this request type. + */ + removeTabActor: function DS_removeTabActor(aFunction) { + for (let name in DebuggerServer.tabActorFactories) { + let handler = DebuggerServer.tabActorFactories[name]; + if (handler.name == aFunction.name) { + delete DebuggerServer.tabActorFactories[name]; + } + } + }, + + /** + * Registers handlers for new browser-scoped request types defined + * dynamically. This is used for example by add-ons to augment the + * functionality of the root actor. Note that the name or actorPrefix of the + * request type is not allowed to clash with existing protocol packet + * properties, like 'from', 'tabs' or 'selected', since that would break the + * protocol. + * + * @param aFunction function + * The constructor function for this request type. This expects to be + * called as a constructor (i.e. with 'new'), and passed two + * arguments: the DebuggerServerConnection, and the BrowserRootActor + * with which it will be associated. + * + * @param aName string [optional] + * The name of the new request type. If this is not present, the + * actorPrefix property of the constructor prototype is used. + */ + addGlobalActor: function DS_addGlobalActor(aFunction, aName) { + let name = aName ? aName : aFunction.prototype.actorPrefix; + if (["from", "tabs", "selected"].indexOf(name) != -1) { + throw Error(name + " is not allowed"); + } + if (DebuggerServer.globalActorFactories.hasOwnProperty(name)) { + throw Error(name + " already exists"); + } + DebuggerServer.globalActorFactories[name] = aFunction; + }, + + /** + * Unregisters the handler for the specified browser-scoped request type. + * This may be used for example by add-ons when shutting down or upgrading. + * + * @param aFunction function + * The constructor function for this request type. + */ + removeGlobalActor: function DS_removeGlobalActor(aFunction) { + for (let name in DebuggerServer.globalActorFactories) { + let handler = DebuggerServer.globalActorFactories[name]; + if (handler.name == aFunction.name) { + delete DebuggerServer.globalActorFactories[name]; + } + } + } +}; + + +/** + * Construct an ActorPool. + * + * ActorPools are actorID -> actor mapping and storage. These are + * used to accumulate and quickly dispose of groups of actors that + * share a lifetime. + */ +function ActorPool(aConnection) +{ + this.conn = aConnection; + this._cleanups = {}; + this._actors = {}; +} + +ActorPool.prototype = { + /** + * Add an actor to the actor pool. If the actor doesn't have an ID, + * allocate one from the connection. + * + * @param aActor object + * The actor implementation. If the object has a + * 'disconnect' property, it will be called when the actor + * pool is cleaned up. + */ + addActor: function AP_addActor(aActor) { + aActor.conn = this.conn; + if (!aActor.actorID) { + let prefix = aActor.actorPrefix; + if (typeof aActor == "function") { + prefix = aActor.prototype.actorPrefix; + } + aActor.actorID = this.conn.allocID(prefix || undefined); + } + + if (aActor.registeredPool) { + aActor.registeredPool.removeActor(aActor); + } + aActor.registeredPool = this; + + this._actors[aActor.actorID] = aActor; + if (aActor.disconnect) { + this._cleanups[aActor.actorID] = aActor; + } + }, + + get: function AP_get(aActorID) { + return this._actors[aActorID]; + }, + + has: function AP_has(aActorID) { + return aActorID in this._actors; + }, + + /** + * Returns true if the pool is empty. + */ + isEmpty: function AP_isEmpty() { + return Object.keys(this._actors).length == 0; + }, + + /** + * Remove an actor from the actor pool. + */ + removeActor: function AP_remove(aActor) { + delete this._actors[aActor.actorID]; + delete this._cleanups[aActor.actorID]; + }, + + /** + * Match the api expected by the protocol library. + */ + unmanage: function(aActor) { + return this.removeActor(aActor); + }, + + /** + * Run all actor cleanups. + */ + cleanup: function AP_cleanup() { + for each (let actor in this._cleanups) { + actor.disconnect(); + } + this._cleanups = {}; + } +} + +/** + * Creates a DebuggerServerConnection. + * + * Represents a connection to this debugging global from a client. + * Manages a set of actors and actor pools, allocates actor ids, and + * handles incoming requests. + * + * @param aPrefix string + * All actor IDs created by this connection should be prefixed + * with aPrefix. + * @param aTransport transport + * Packet transport for the debugging protocol. + */ +function DebuggerServerConnection(aPrefix, aTransport) +{ + this._prefix = aPrefix; + this._transport = aTransport; + this._transport.hooks = this; + this._nextID = 1; + + this._actorPool = new ActorPool(this); + this._extraPools = []; +} + +DebuggerServerConnection.prototype = { + _prefix: null, + get prefix() { return this._prefix }, + + _transport: null, + get transport() { return this._transport }, + + close: function() { + this._transport.close(); + }, + + send: function DSC_send(aPacket) { + this.transport.send(aPacket); + }, + + allocID: function DSC_allocID(aPrefix) { + return this.prefix + (aPrefix || '') + this._nextID++; + }, + + /** + * Add a map of actor IDs to the connection. + */ + addActorPool: function DSC_addActorPool(aActorPool) { + this._extraPools.push(aActorPool); + }, + + /** + * Remove a previously-added pool of actors to the connection. + * + * @param ActorPool aActorPool + * The ActorPool instance you want to remove. + * @param boolean aCleanup + * True if you want to disconnect each actor from the pool, false + * otherwise. + */ + removeActorPool: function DSC_removeActorPool(aActorPool, aCleanup) { + let index = this._extraPools.lastIndexOf(aActorPool); + if (index > -1) { + let pool = this._extraPools.splice(index, 1); + if (aCleanup) { + pool.map(function(p) { p.cleanup(); }); + } + } + }, + + /** + * Add an actor to the default actor pool for this connection. + */ + addActor: function DSC_addActor(aActor) { + this._actorPool.addActor(aActor); + }, + + /** + * Remove an actor to the default actor pool for this connection. + */ + removeActor: function DSC_removeActor(aActor) { + this._actorPool.removeActor(aActor); + }, + + /** + * Match the api expected by the protocol library. + */ + unmanage: function(aActor) { + return this.removeActor(aActor); + }, + + /** + * Look up an actor implementation for an actorID. Will search + * all the actor pools registered with the connection. + * + * @param aActorID string + * Actor ID to look up. + */ + getActor: function DSC_getActor(aActorID) { + let pool = this.poolFor(aActorID); + if (pool) { + return pool.get(aActorID); + } + + if (aActorID === "root") { + return this.rootActor; + } + + return null; + }, + + poolFor: function DSC_actorPool(aActorID) { + if (this._actorPool && this._actorPool.has(aActorID)) { + return this._actorPool; + } + + for (let pool of this._extraPools) { + if (pool.has(aActorID)) { + return pool; + } + } + return null; + }, + + _unknownError: function DSC__unknownError(aPrefix, aError) { + let errorString = safeErrorString(aError); + errorString += "\n" + aError.stack; + // Cu.reportError(errorString); + dumpn(errorString); + return { + error: "unknownError", + message: (aPrefix + "': " + errorString) + }; + }, + + // Transport hooks. + + /** + * Called by DebuggerTransport to dispatch incoming packets as appropriate. + * + * @param aPacket object + * The incoming packet. + */ + onPacket: function DSC_onPacket(aPacket) { + let actor = this.getActor(aPacket.to); + if (!actor) { + this.transport.send({ from: aPacket.to ? aPacket.to : "root", + error: "noSuchActor" }); + return; + } + + // Dyamically-loaded actors have to be created lazily. + if (typeof actor == "function") { + let instance; + try { + instance = new actor(); + } catch (e) { + this.transport.send(this._unknownError( + "Error occurred while creating actor '" + actor.name, + e)); + } + instance.parentID = actor.parentID; + // We want the newly-constructed actor to completely replace the factory + // actor. Reusing the existing actor ID will make sure ActorPool.addActor + // does the right thing. + instance.actorID = actor.actorID; + actor.registeredPool.addActor(instance); + actor = instance; + } + + var ret = null; + // log("actor.requestTypes: "+actor.requestTypes+", cb: "+actor.requestTypes[aPacket.type]); + // Dispatch the request to the actor. + if (actor.requestTypes && actor.requestTypes[aPacket.type]) { + try { + this.currentPacket = aPacket; + ret = actor.requestTypes[aPacket.type].bind(actor)(aPacket, this); + } catch(e) { + this.transport.send(this._unknownError( + "error occurred while processing '" + aPacket.type, + e)); + } finally { + delete this.currentPacket; + } + } else { + ret = { error: "unrecognizedPacketType", + message: ('Actor "' + actor.actorID + + '" does not recognize the packet type "' + + aPacket.type + '"') }; + } + + if (!ret) { + // This should become an error once we've converted every user + // of this to promises in bug 794078. + return; + } + + resolve(ret) + .then(null, (e) => { + return this._unknownError( + "error occurred while processing '" + aPacket.type, + e); + }) + .then(function (aResponse) { + if (!aResponse.from) { + aResponse.from = aPacket.to; + } + return aResponse; + }) + .then(this.transport.send.bind(this.transport)); + }, + + /** + * Called by DebuggerTransport when the underlying stream is closed. + * + * @param aStatus nsresult + * The status code that corresponds to the reason for closing + * the stream. + */ + onClosed: function DSC_onClosed(aStatus) { + dumpn("Cleaning up connection."); + + this._actorPool.cleanup(); + this._actorPool = null; + this._extraPools.map(function(p) { p.cleanup(); }); + this._extraPools = null; + + DebuggerServer._connectionClosed(this); + }, + + /* + * Debugging helper for inspecting the state of the actor pools. + */ + _dumpPools: function DSC_dumpPools() { + dumpn("/-------------------- dumping pools:"); + if (this._actorPool) { + dumpn("--------------------- actorPool actors: " + + uneval(Object.keys(this._actorPool._actors))); + } + for each (let pool in this._extraPools) + dumpn("--------------------- extraPool actors: " + + uneval(Object.keys(pool._actors))); + }, + + /* + * Debugging helper for inspecting the state of an actor pool. + */ + _dumpPool: function DSC_dumpPools(aPool) { + dumpn("/-------------------- dumping pool:"); + dumpn("--------------------- actorPool actors: " + + uneval(Object.keys(aPool._actors))); + } +}; + +/** + * Localization convenience methods. + */ +// let L10N = { + +// /** +// * L10N shortcut function. +// * +// * @param string aName +// * @return string +// */ +// getStr: function L10N_getStr(aName) { +// return this.stringBundle.GetStringFromName(aName); +// } +// }; + +// XPCOMUtils.defineLazyGetter(L10N, "stringBundle", function() { +// return Services.strings.createBundle(DBG_STRINGS_URI); +// }); diff --git a/cocos/scripting/javascript/bindings/js/debugger/transport.js b/cocos/scripting/javascript/bindings/js/debugger/transport.js new file mode 100644 index 0000000000..8676e367a8 --- /dev/null +++ b/cocos/scripting/javascript/bindings/js/debugger/transport.js @@ -0,0 +1,288 @@ +/* -*- Mode: javascript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ft=javascript ts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +"use strict"; +// Components.utils.import("resource://gre/modules/NetUtil.jsm"); + +/** + * An adapter that handles data transfers between the debugger client and + * server. It can work with both nsIPipe and nsIServerSocket transports so + * long as the properly created input and output streams are specified. + * + * @param aInput nsIInputStream + * The input stream. + * @param aOutput nsIAsyncOutputStream + * The output stream. + * + * Given a DebuggerTransport instance dt: + * 1) Set dt.hooks to a packet handler object (described below). + * 2) Call dt.ready() to begin watching for input packets. + * 3) Send packets as you please, and handle incoming packets passed to + * hook.onPacket. + * 4) Call dt.close() to close the connection, and disengage from the event + * loop. + * + * A packet handler object is an object with two methods: + * + * - onPacket(packet) - called when we have received a complete packet. + * |Packet| is the parsed form of the packet --- a JavaScript value, not + * a JSON-syntax string. + * + * - onClosed(status) - called when the connection is closed. |Status| is + * an nsresult, of the sort passed to nsIRequestObserver. + * + * Data is transferred as a JSON packet serialized into a string, with the + * string length prepended to the packet, followed by a colon + * ([length]:[packet]). The contents of the JSON packet are specified in + * the Remote Debugging Protocol specification. + */ +this.DebuggerTransport = function DebuggerTransport(aInput, aOutput) +{ + this._input = aInput; + this._output = aOutput; + + this._converter = null;//Cc["@mozilla.org/intl/scriptableunicodeconverter"] + // .createInstance(Ci.nsIScriptableUnicodeConverter); + // this._converter.charset = "UTF-8"; + + this._outgoing = ""; + this._incoming = ""; + + this.hooks = null; +} + +DebuggerTransport.prototype = { + /** + * Transmit a packet. + * + * This method returns immediately, without waiting for the entire + * packet to be transmitted, registering event handlers as needed to + * transmit the entire packet. Packets are transmitted in the order + * they are passed to this method. + */ + send: function DT_send(aPacket) { + // TODO (bug 709088): remove pretty printing when the protocol is done. + let data = JSON.stringify(aPacket, null, 2); + // data = this._converter.ConvertFromUnicode(data); + + let data_for_len = utf16to8(data); + + this._outgoing = data_for_len.length + ':' + data; + + this._flushOutgoing(); + }, + + /** + * Close the transport. + */ + close: function DT_close() { + this._input.close(); + this._output.close(); + }, + + /** + * Flush the outgoing stream. + */ + _flushOutgoing: function DT_flushOutgoing() { + if (this._outgoing.length > 0) { + // var threadManager = Cc["@mozilla.org/thread-manager;1"].getService(); + // this._output.asyncWait(this, 0, 0, threadManager.currentThread); + log("outgoing: " + this._outgoing);//.substring(0, 200)); + _bufferWrite(this._outgoing); + } + }, + + onOutputStreamReady: + makeInfallible(function DT_onOutputStreamReady(aStream) { + let written = 0; + try { + written = aStream.write(this._outgoing, this._outgoing.length); + } catch(e if e.result == Components.results.NS_BASE_STREAM_CLOSED) { + dumpn("Connection closed."); + this.close(); + return; + } + this._outgoing = this._outgoing.slice(written); + this._flushOutgoing(); + }, "DebuggerTransport.prototype.onOutputStreamReady"), + + /** + * Initialize the input stream for reading. Once this method has been + * called, we watch for packets on the input stream, and pass them to + * this.hook.onPacket. + */ + ready: function DT_ready() { + // let pump = Cc["@mozilla.org/network/input-stream-pump;1"] + // .createInstance(Ci.nsIInputStreamPump); + // pump.init(this._input, -1, -1, 0, 0, false); + // pump.asyncRead(this, null); + }, + + // nsIStreamListener + onStartRequest: + makeInfallible(function DT_onStartRequest(aRequest, aContext) {}, + "DebuggerTransport.prototype.onStartRequest"), + + onStopRequest: + makeInfallible(function DT_onStopRequest(aRequest, aContext, aStatus) { + this.close(); + if (this.hooks) { + this.hooks.onClosed(aStatus); + this.hooks = null; + } + }, "DebuggerTransport.prototype.onStopRequest"), + + onDataAvailable: makeInfallible(function DT_onDataAvailable (incoming) +// makeInfallible(function DT_onDataAvailable(aRequest, aContext, +// aStream, aOffset, aCount) + { + this._incoming = incoming;//+= NetUtil.readInputStreamToString(aStream, + // aStream.available()); + while (this._processIncoming()) {}; + }, "DebuggerTransport.prototype.onDataAvailable"), + + /** + * Process incoming packets. Returns true if a packet has been received, either + * if it was properly parsed or not. Returns false if the incoming stream does + * not contain a full packet yet. After a proper packet is parsed, the dispatch + * handler DebuggerTransport.hooks.onPacket is called with the packet as a + * parameter. + */ + _processIncoming: function DT__processIncoming() { + // Well this is ugly. + let sep = this._incoming.indexOf(':'); + if (sep < 0) { + return false; + } + + let count = parseInt(this._incoming.substring(0, sep)); + if (this._incoming.length - (sep + 1) < count) { + // Don't have a complete request yet. + return false; + } + + // We have a complete request, pluck it out of the data and parse it. + this._incoming = this._incoming.substring(sep + 1); + let packet = this._incoming.substring(0, count); + this._incoming = this._incoming.substring(count); + + try { + // packet = this._converter.ConvertToUnicode(packet); + packet = utf8to16(packet); + var parsed = JSON.parse(packet); + } catch(e) { + let msg = "Error parsing incoming packet: " + packet + " (" + e + " - " + e.stack + ")"; + // if (Cu.reportError) { + // Cu.reportError(msg); + // } + dump(msg + "\n"); + return true; + } + + dumpn("Got: " + packet); + let self = this; + + // Services.tm.currentThread.dispatch(makeInfallible(function() { + self.hooks.onPacket(parsed); + // }, "DebuggerTransport instance's this.hooks.onPacket"), 0); + + return true; + } +} + + +/** + * An adapter that handles data transfers between the debugger client and + * server when they both run in the same process. It presents the same API as + * DebuggerTransport, but instead of transmitting serialized messages across a + * connection it merely calls the packet dispatcher of the other side. + * + * @param aOther LocalDebuggerTransport + * The other endpoint for this debugger connection. + * + * @see DebuggerTransport + */ +this.LocalDebuggerTransport = function LocalDebuggerTransport(aOther) +{ + this.other = aOther; + this.hooks = null; + + /* + * A packet number, shared between this and this.other. This isn't used + * by the protocol at all, but it makes the packet traces a lot easier to + * follow. + */ + this._serial = this.other ? this.other._serial : { count: 0 }; +} + +LocalDebuggerTransport.prototype = { + /** + * Transmit a message by directly calling the onPacket handler of the other + * endpoint. + */ + send: function LDT_send(aPacket) { + let serial = this._serial.count++; + if (wantLogging) { + if (aPacket.to) { + dumpn("Packet " + serial + " sent to " + uneval(aPacket.to)); + } else if (aPacket.from) { + dumpn("Packet " + serial + " sent from " + uneval(aPacket.from)); + } + } + this._deepFreeze(aPacket); + let other = this.other; + if (other) { + Services.tm.currentThread.dispatch(makeInfallible(function() { + // Avoid the cost of JSON.stringify() when logging is disabled. + if (wantLogging) { + dumpn("Received packet " + serial + ": " + JSON.stringify(aPacket, null, 2)); + } + if (other.hooks) { + other.hooks.onPacket(aPacket); + } + }, "LocalDebuggerTransport instance's this.other.hooks.onPacket"), 0); + } + }, + + /** + * Close the transport. + */ + close: function LDT_close() { + if (this.other) { + // Remove the reference to the other endpoint before calling close(), to + // avoid infinite recursion. + let other = this.other; + delete this.other; + other.close(); + } + if (this.hooks) { + this.hooks.onClosed(); + this.hooks = null; + } + }, + + /** + * An empty method for emulating the DebuggerTransport API. + */ + ready: function LDT_ready() {}, + + /** + * Helper function that makes an object fully immutable. + */ + _deepFreeze: function LDT_deepFreeze(aObject) { + Object.freeze(aObject); + for (let prop in aObject) { + // Freeze the properties that are objects, not on the prototype, and not + // already frozen. Note that this might leave an unfrozen reference + // somewhere in the object if there is an already frozen object containing + // an unfrozen object. + if (aObject.hasOwnProperty(prop) && typeof aObject === "object" && + !Object.isFrozen(aObject)) { + this._deepFreeze(o[prop]); + } + } + } +}; From f3f24e3bbd9ad9ab1e8147b9cb6c5a1006c02ed4 Mon Sep 17 00:00:00 2001 From: minggo Date: Sat, 12 Oct 2013 13:54:16 +0800 Subject: [PATCH 14/64] issue #2905:use - to connect multiple words --- docs/CODING_STYLE.md | 131 ++++++++++++++++++ docs/RELEASE_NOTES | 4 + .../AssetsManager.cpp | 0 .../AssetsManager.h | 0 .../CCPhysicsDebugNode.cpp | 0 .../CCPhysicsDebugNode.h | 0 .../CCPhysicsSprite.cpp | 0 .../CCPhysicsSprite.h | 0 8 files changed, 135 insertions(+) create mode 100644 docs/CODING_STYLE.md create mode 100644 docs/RELEASE_NOTES rename extensions/{AssetsManager => assets-manager}/AssetsManager.cpp (100%) rename extensions/{AssetsManager => assets-manager}/AssetsManager.h (100%) rename extensions/{physics_nodes => physics-nodes}/CCPhysicsDebugNode.cpp (100%) rename extensions/{physics_nodes => physics-nodes}/CCPhysicsDebugNode.h (100%) rename extensions/{physics_nodes => physics-nodes}/CCPhysicsSprite.cpp (100%) rename extensions/{physics_nodes => physics-nodes}/CCPhysicsSprite.h (100%) diff --git a/docs/CODING_STYLE.md b/docs/CODING_STYLE.md new file mode 100644 index 0000000000..4b7bf2a7c8 --- /dev/null +++ b/docs/CODING_STYLE.md @@ -0,0 +1,131 @@ +# cocos2d-x C++ coding sytle + + +## Detailed information + +Please, refer to this document for a detailed version of the cocos2d-x C++ coding sytle: + +* [cocos2d-x c++ coding style](http://www.cocos2d-x.org/wiki/Cocos2d_c++_coding_style) + + +## Quick Sample + +Use this sample as a quick reference. But DO READ the detailed doc for more info. + +Header file: + +```c++ +/** + * We use Doxygen strings for documentation. + * All public classes, methods, structs should be documented using Doxygen Strings + */ +class CC_DLL Sprite : public NodeRGBA, public TextureProtocol +{ /* class braces start in a new line */ + +/* no indentation here for public, protected or private */ +/* First add all the "public" stuff, then all the "protected" stuff, and finally all the "private" stuff +public: + + /* we don't use tabs, we use spaces, and we use a 4 space identation */ + /* 1st add all static const */ + static const int INDEX_NOT_INITIALIZED = -1; + + /* then add all the creators and other relevant static methods */ + static Sprite* create(); + static Sprite* create(const char *filename); + static Sprite* create(const char *filename, const Rect& rect); + + /* if applicable, then add the consturctors / destructors */ + Sprite(); + virtual ~Sprite(void); + + /* then add all the initialization methods */ + /* notice that they are in the same order as the creators */ + virtual bool init(void); + virtual bool initWithTexture(Texture2D *texture); + virtual bool initWithTexture(Texture2D *texture, const Rect& rect); + + + + /* then add the regular instace methods */ + virtual void updateTransform(void); + virtual SpriteBatchNode* getBatchNode(void); + virtual void setBatchNode(SpriteBatchNode *spriteBatchNode); + + + /* then add all the overriden methods */ + /* notice that all overriden methods must use the 'override' keyword */ + /* overriden methods are not forced to have doxygen strings UNLESS they change the behavior in a non obvios way */ + virtual void setPosition(const Point& pos) override; + virtual void setRotation(float rotation) override; + virtual void setRotationX(float rotationX) override; + + + /* once you finish with the 'public' methods, start with the 'protected' ones */ +protected: + + /* protected methods are not forced to have Doxygen strings, but if they have it, better */ + void updateColor(void); + virtual void setTextureCoords(Rect rect); + + /* After adding all the methods, add the ivars */ + /* all ivars must start with _ */ + /* Do not use Hungarian notation */ + TextureAtlas* _textureAtlas; + int _atlasIndex; + SpriteBatchNode* _batchNode; +}; + +``` + +Implementation file: + +```c++ +/* Do not use doxygen comments on the implementation file */ + +/* The methos MUST be in the same order as where declared in the header file */ + +Sprite* Sprite::create(const char *filename) +{ + /* Don't use tabs. Use spaces. Use 4-space indentation */ + Sprite *sprite = new Sprite(); + + /* put curly braces in the same line as in the 'if'*/ + /* leave a space between the 'if' and the '(' */ + /* don't leave spaces between '()' */ + if (sprite && sprite->initWithFile(filename)) { + sprite->autorelease(); + return sprite; + } + CC_SAFE_DELETE(sprite); + return NULL; +} + +/* Initialization list can be indented to 0 spaces, or to 4 spaces. If in doubt, be consistent with the indentation already used in the file */ +/* Only use the Initialization lists for types that can't fail when initialized */ +Sprite::Sprite() +: _shouldBeHidden(false) +, _texture(nullptr) +, _physicsBody(nullptr) +{ +} + +/* use the 'initXXX' methods to initialize types that might fail */ +bool Sprite::initWithTexture(Texture2D *texture, const Rect& rect, bool rotated) +{ + /* it ok not use use curly braces */ + if (something) + do_something(); + else + something_else(); + + /* but if you use curly branches in one branch, all the branches should use curly branches */ + if (something) { + do_something1(); + do_something2(); + } else { + so_something_else(); + } +} + +``` diff --git a/docs/RELEASE_NOTES b/docs/RELEASE_NOTES new file mode 100644 index 0000000000..f10872da6c --- /dev/null +++ b/docs/RELEASE_NOTES @@ -0,0 +1,4 @@ +===== cocos2d-x 3.0 Release Notes ===== + +Please, read the online release notes document: +http://www.cocos2d-x.org/wiki/Release_Notes_for_Cocos2d-x_v300 \ No newline at end of file diff --git a/extensions/AssetsManager/AssetsManager.cpp b/extensions/assets-manager/AssetsManager.cpp similarity index 100% rename from extensions/AssetsManager/AssetsManager.cpp rename to extensions/assets-manager/AssetsManager.cpp diff --git a/extensions/AssetsManager/AssetsManager.h b/extensions/assets-manager/AssetsManager.h similarity index 100% rename from extensions/AssetsManager/AssetsManager.h rename to extensions/assets-manager/AssetsManager.h diff --git a/extensions/physics_nodes/CCPhysicsDebugNode.cpp b/extensions/physics-nodes/CCPhysicsDebugNode.cpp similarity index 100% rename from extensions/physics_nodes/CCPhysicsDebugNode.cpp rename to extensions/physics-nodes/CCPhysicsDebugNode.cpp diff --git a/extensions/physics_nodes/CCPhysicsDebugNode.h b/extensions/physics-nodes/CCPhysicsDebugNode.h similarity index 100% rename from extensions/physics_nodes/CCPhysicsDebugNode.h rename to extensions/physics-nodes/CCPhysicsDebugNode.h diff --git a/extensions/physics_nodes/CCPhysicsSprite.cpp b/extensions/physics-nodes/CCPhysicsSprite.cpp similarity index 100% rename from extensions/physics_nodes/CCPhysicsSprite.cpp rename to extensions/physics-nodes/CCPhysicsSprite.cpp diff --git a/extensions/physics_nodes/CCPhysicsSprite.h b/extensions/physics-nodes/CCPhysicsSprite.h similarity index 100% rename from extensions/physics_nodes/CCPhysicsSprite.h rename to extensions/physics-nodes/CCPhysicsSprite.h From 1f38636e84bde6407d9b6e2deeacac1ec6ebe2ea Mon Sep 17 00:00:00 2001 From: minggo Date: Sat, 12 Oct 2013 14:02:13 +0800 Subject: [PATCH 15/64] issue #2905: step1 Box2D -> box2d --- cocos/physics/Box2D/CCPhysicsBodyInfo.cpp | 39 - cocos/physics/Box2D/CCPhysicsBodyInfo.h | 43 - cocos/physics/Box2D/CCPhysicsContactInfo.cpp | 39 - cocos/physics/Box2D/CCPhysicsContactInfo.h | 43 - cocos/physics/Box2D/CCPhysicsHelper.h | 43 - cocos/physics/Box2D/CCPhysicsJointInfo.cpp | 39 - cocos/physics/Box2D/CCPhysicsJointInfo.h | 43 - cocos/physics/Box2D/CCPhysicsShapeInfo.cpp | 39 - cocos/physics/Box2D/CCPhysicsShapeInfo.h | 43 - cocos/physics/Box2D/CCPhysicsWorldInfo.cpp | 39 - cocos/physics/Box2D/CCPhysicsWorldInfo.h | 43 - external/Box2D/Android.mk | 60 - external/Box2D/Box2D.h | 67 - .../Box2D/Collision/Shapes/b2ChainShape.cpp | 171 --- .../Box2D/Collision/Shapes/b2ChainShape.h | 102 -- .../Box2D/Collision/Shapes/b2CircleShape.cpp | 100 -- .../Box2D/Collision/Shapes/b2CircleShape.h | 91 -- .../Box2D/Collision/Shapes/b2EdgeShape.cpp | 139 -- external/Box2D/Collision/Shapes/b2EdgeShape.h | 74 - .../Box2D/Collision/Shapes/b2PolygonShape.cpp | 361 ----- .../Box2D/Collision/Shapes/b2PolygonShape.h | 95 -- external/Box2D/Collision/Shapes/b2Shape.h | 101 -- external/Box2D/Collision/b2BroadPhase.cpp | 122 -- external/Box2D/Collision/b2BroadPhase.h | 248 ---- external/Box2D/Collision/b2CollideCircle.cpp | 154 -- external/Box2D/Collision/b2CollideEdge.cpp | 698 --------- external/Box2D/Collision/b2CollidePolygon.cpp | 317 ---- external/Box2D/Collision/b2Collision.cpp | 249 ---- external/Box2D/Collision/b2Collision.h | 276 ---- external/Box2D/Collision/b2Distance.cpp | 603 -------- external/Box2D/Collision/b2Distance.h | 141 -- external/Box2D/Collision/b2DynamicTree.cpp | 775 ---------- external/Box2D/Collision/b2DynamicTree.h | 284 ---- external/Box2D/Collision/b2TimeOfImpact.cpp | 488 ------ external/Box2D/Collision/b2TimeOfImpact.h | 58 - external/Box2D/Common/b2BlockAllocator.cpp | 218 --- external/Box2D/Common/b2BlockAllocator.h | 62 - external/Box2D/Common/b2Draw.cpp | 44 - external/Box2D/Common/b2Draw.h | 81 - external/Box2D/Common/b2GrowableStack.h | 85 -- external/Box2D/Common/b2Math.cpp | 94 -- external/Box2D/Common/b2Math.h | 738 --------- external/Box2D/Common/b2Settings.cpp | 61 - external/Box2D/Common/b2Settings.h | 150 -- external/Box2D/Common/b2StackAllocator.cpp | 83 -- external/Box2D/Common/b2StackAllocator.h | 60 - external/Box2D/Common/b2Timer.cpp | 100 -- external/Box2D/Common/b2Timer.h | 45 - .../Contacts/b2ChainAndCircleContact.cpp | 54 - .../Contacts/b2ChainAndCircleContact.h | 39 - .../Contacts/b2ChainAndPolygonContact.cpp | 54 - .../Contacts/b2ChainAndPolygonContact.h | 39 - .../Dynamics/Contacts/b2CircleContact.cpp | 53 - .../Box2D/Dynamics/Contacts/b2CircleContact.h | 39 - .../Box2D/Dynamics/Contacts/b2Contact.cpp | 240 --- external/Box2D/Dynamics/Contacts/b2Contact.h | 331 ----- .../Dynamics/Contacts/b2ContactSolver.cpp | 832 ----------- .../Box2D/Dynamics/Contacts/b2ContactSolver.h | 94 -- .../Contacts/b2EdgeAndCircleContact.cpp | 50 - .../Contacts/b2EdgeAndCircleContact.h | 39 - .../Contacts/b2EdgeAndPolygonContact.cpp | 50 - .../Contacts/b2EdgeAndPolygonContact.h | 39 - .../Contacts/b2PolygonAndCircleContact.cpp | 50 - .../Contacts/b2PolygonAndCircleContact.h | 38 - .../Dynamics/Contacts/b2PolygonContact.cpp | 53 - .../Dynamics/Contacts/b2PolygonContact.h | 39 - .../Box2D/Dynamics/Joints/b2DistanceJoint.cpp | 260 ---- .../Box2D/Dynamics/Joints/b2DistanceJoint.h | 169 --- .../Box2D/Dynamics/Joints/b2FrictionJoint.cpp | 251 ---- .../Box2D/Dynamics/Joints/b2FrictionJoint.h | 119 -- .../Box2D/Dynamics/Joints/b2GearJoint.cpp | 423 ------ external/Box2D/Dynamics/Joints/b2GearJoint.h | 125 -- external/Box2D/Dynamics/Joints/b2Joint.cpp | 199 --- external/Box2D/Dynamics/Joints/b2Joint.h | 222 --- .../Box2D/Dynamics/Joints/b2MouseJoint.cpp | 217 --- external/Box2D/Dynamics/Joints/b2MouseJoint.h | 126 -- .../Dynamics/Joints/b2PrismaticJoint.cpp | 637 -------- .../Box2D/Dynamics/Joints/b2PrismaticJoint.h | 196 --- .../Box2D/Dynamics/Joints/b2PulleyJoint.cpp | 332 ----- .../Box2D/Dynamics/Joints/b2PulleyJoint.h | 143 -- .../Box2D/Dynamics/Joints/b2RevoluteJoint.cpp | 504 ------- .../Box2D/Dynamics/Joints/b2RevoluteJoint.h | 204 --- .../Box2D/Dynamics/Joints/b2RopeJoint.cpp | 241 --- external/Box2D/Dynamics/Joints/b2RopeJoint.h | 114 -- .../Box2D/Dynamics/Joints/b2WeldJoint.cpp | 330 ----- external/Box2D/Dynamics/Joints/b2WeldJoint.h | 126 -- .../Box2D/Dynamics/Joints/b2WheelJoint.cpp | 419 ------ external/Box2D/Dynamics/Joints/b2WheelJoint.h | 213 --- external/Box2D/Dynamics/b2Body.cpp | 514 ------- external/Box2D/Dynamics/b2Body.h | 846 ----------- external/Box2D/Dynamics/b2ContactManager.cpp | 293 ---- external/Box2D/Dynamics/b2ContactManager.h | 52 - external/Box2D/Dynamics/b2Fixture.cpp | 303 ---- external/Box2D/Dynamics/b2Fixture.h | 345 ----- external/Box2D/Dynamics/b2Island.cpp | 539 ------- external/Box2D/Dynamics/b2Island.h | 93 -- external/Box2D/Dynamics/b2TimeStep.h | 70 - external/Box2D/Dynamics/b2World.cpp | 1316 ----------------- external/Box2D/Dynamics/b2World.h | 349 ----- external/Box2D/Dynamics/b2WorldCallbacks.cpp | 36 - external/Box2D/Dynamics/b2WorldCallbacks.h | 155 -- external/Box2D/Rope/b2Rope.cpp | 259 ---- external/Box2D/Rope/b2Rope.h | 115 -- external/Box2D/proj.linux/.cproject | 267 ---- external/Box2D/proj.linux/.project | 110 -- external/Box2D/proj.linux/Makefile | 72 - external/Box2D/proj.linux/box2d.prf | 19 - external/Box2D/proj.win32/Box2D.vcxproj | 194 --- .../Box2D/proj.win32/Box2D.vcxproj.filters | 301 ---- external/Box2D/proj.win32/Box2D.vcxproj.user | 3 - 110 files changed, 22002 deletions(-) delete mode 100644 cocos/physics/Box2D/CCPhysicsBodyInfo.cpp delete mode 100644 cocos/physics/Box2D/CCPhysicsBodyInfo.h delete mode 100644 cocos/physics/Box2D/CCPhysicsContactInfo.cpp delete mode 100644 cocos/physics/Box2D/CCPhysicsContactInfo.h delete mode 100644 cocos/physics/Box2D/CCPhysicsHelper.h delete mode 100644 cocos/physics/Box2D/CCPhysicsJointInfo.cpp delete mode 100644 cocos/physics/Box2D/CCPhysicsJointInfo.h delete mode 100644 cocos/physics/Box2D/CCPhysicsShapeInfo.cpp delete mode 100644 cocos/physics/Box2D/CCPhysicsShapeInfo.h delete mode 100644 cocos/physics/Box2D/CCPhysicsWorldInfo.cpp delete mode 100644 cocos/physics/Box2D/CCPhysicsWorldInfo.h delete mode 100644 external/Box2D/Android.mk delete mode 100644 external/Box2D/Box2D.h delete mode 100644 external/Box2D/Collision/Shapes/b2ChainShape.cpp delete mode 100644 external/Box2D/Collision/Shapes/b2ChainShape.h delete mode 100644 external/Box2D/Collision/Shapes/b2CircleShape.cpp delete mode 100644 external/Box2D/Collision/Shapes/b2CircleShape.h delete mode 100644 external/Box2D/Collision/Shapes/b2EdgeShape.cpp delete mode 100644 external/Box2D/Collision/Shapes/b2EdgeShape.h delete mode 100644 external/Box2D/Collision/Shapes/b2PolygonShape.cpp delete mode 100644 external/Box2D/Collision/Shapes/b2PolygonShape.h delete mode 100644 external/Box2D/Collision/Shapes/b2Shape.h delete mode 100644 external/Box2D/Collision/b2BroadPhase.cpp delete mode 100644 external/Box2D/Collision/b2BroadPhase.h delete mode 100644 external/Box2D/Collision/b2CollideCircle.cpp delete mode 100644 external/Box2D/Collision/b2CollideEdge.cpp delete mode 100644 external/Box2D/Collision/b2CollidePolygon.cpp delete mode 100644 external/Box2D/Collision/b2Collision.cpp delete mode 100644 external/Box2D/Collision/b2Collision.h delete mode 100644 external/Box2D/Collision/b2Distance.cpp delete mode 100644 external/Box2D/Collision/b2Distance.h delete mode 100644 external/Box2D/Collision/b2DynamicTree.cpp delete mode 100644 external/Box2D/Collision/b2DynamicTree.h delete mode 100644 external/Box2D/Collision/b2TimeOfImpact.cpp delete mode 100644 external/Box2D/Collision/b2TimeOfImpact.h delete mode 100644 external/Box2D/Common/b2BlockAllocator.cpp delete mode 100644 external/Box2D/Common/b2BlockAllocator.h delete mode 100644 external/Box2D/Common/b2Draw.cpp delete mode 100644 external/Box2D/Common/b2Draw.h delete mode 100644 external/Box2D/Common/b2GrowableStack.h delete mode 100644 external/Box2D/Common/b2Math.cpp delete mode 100644 external/Box2D/Common/b2Math.h delete mode 100644 external/Box2D/Common/b2Settings.cpp delete mode 100644 external/Box2D/Common/b2Settings.h delete mode 100644 external/Box2D/Common/b2StackAllocator.cpp delete mode 100644 external/Box2D/Common/b2StackAllocator.h delete mode 100644 external/Box2D/Common/b2Timer.cpp delete mode 100644 external/Box2D/Common/b2Timer.h delete mode 100644 external/Box2D/Dynamics/Contacts/b2ChainAndCircleContact.cpp delete mode 100644 external/Box2D/Dynamics/Contacts/b2ChainAndCircleContact.h delete mode 100644 external/Box2D/Dynamics/Contacts/b2ChainAndPolygonContact.cpp delete mode 100644 external/Box2D/Dynamics/Contacts/b2ChainAndPolygonContact.h delete mode 100644 external/Box2D/Dynamics/Contacts/b2CircleContact.cpp delete mode 100644 external/Box2D/Dynamics/Contacts/b2CircleContact.h delete mode 100644 external/Box2D/Dynamics/Contacts/b2Contact.cpp delete mode 100644 external/Box2D/Dynamics/Contacts/b2Contact.h delete mode 100644 external/Box2D/Dynamics/Contacts/b2ContactSolver.cpp delete mode 100644 external/Box2D/Dynamics/Contacts/b2ContactSolver.h delete mode 100644 external/Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.cpp delete mode 100644 external/Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.h delete mode 100644 external/Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.cpp delete mode 100644 external/Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.h delete mode 100644 external/Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.cpp delete mode 100644 external/Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.h delete mode 100644 external/Box2D/Dynamics/Contacts/b2PolygonContact.cpp delete mode 100644 external/Box2D/Dynamics/Contacts/b2PolygonContact.h delete mode 100644 external/Box2D/Dynamics/Joints/b2DistanceJoint.cpp delete mode 100644 external/Box2D/Dynamics/Joints/b2DistanceJoint.h delete mode 100644 external/Box2D/Dynamics/Joints/b2FrictionJoint.cpp delete mode 100644 external/Box2D/Dynamics/Joints/b2FrictionJoint.h delete mode 100644 external/Box2D/Dynamics/Joints/b2GearJoint.cpp delete mode 100644 external/Box2D/Dynamics/Joints/b2GearJoint.h delete mode 100644 external/Box2D/Dynamics/Joints/b2Joint.cpp delete mode 100644 external/Box2D/Dynamics/Joints/b2Joint.h delete mode 100644 external/Box2D/Dynamics/Joints/b2MouseJoint.cpp delete mode 100644 external/Box2D/Dynamics/Joints/b2MouseJoint.h delete mode 100644 external/Box2D/Dynamics/Joints/b2PrismaticJoint.cpp delete mode 100644 external/Box2D/Dynamics/Joints/b2PrismaticJoint.h delete mode 100644 external/Box2D/Dynamics/Joints/b2PulleyJoint.cpp delete mode 100644 external/Box2D/Dynamics/Joints/b2PulleyJoint.h delete mode 100644 external/Box2D/Dynamics/Joints/b2RevoluteJoint.cpp delete mode 100644 external/Box2D/Dynamics/Joints/b2RevoluteJoint.h delete mode 100644 external/Box2D/Dynamics/Joints/b2RopeJoint.cpp delete mode 100644 external/Box2D/Dynamics/Joints/b2RopeJoint.h delete mode 100644 external/Box2D/Dynamics/Joints/b2WeldJoint.cpp delete mode 100644 external/Box2D/Dynamics/Joints/b2WeldJoint.h delete mode 100644 external/Box2D/Dynamics/Joints/b2WheelJoint.cpp delete mode 100644 external/Box2D/Dynamics/Joints/b2WheelJoint.h delete mode 100644 external/Box2D/Dynamics/b2Body.cpp delete mode 100644 external/Box2D/Dynamics/b2Body.h delete mode 100644 external/Box2D/Dynamics/b2ContactManager.cpp delete mode 100644 external/Box2D/Dynamics/b2ContactManager.h delete mode 100644 external/Box2D/Dynamics/b2Fixture.cpp delete mode 100644 external/Box2D/Dynamics/b2Fixture.h delete mode 100644 external/Box2D/Dynamics/b2Island.cpp delete mode 100644 external/Box2D/Dynamics/b2Island.h delete mode 100644 external/Box2D/Dynamics/b2TimeStep.h delete mode 100644 external/Box2D/Dynamics/b2World.cpp delete mode 100644 external/Box2D/Dynamics/b2World.h delete mode 100644 external/Box2D/Dynamics/b2WorldCallbacks.cpp delete mode 100644 external/Box2D/Dynamics/b2WorldCallbacks.h delete mode 100644 external/Box2D/Rope/b2Rope.cpp delete mode 100644 external/Box2D/Rope/b2Rope.h delete mode 100644 external/Box2D/proj.linux/.cproject delete mode 100644 external/Box2D/proj.linux/.project delete mode 100644 external/Box2D/proj.linux/Makefile delete mode 100644 external/Box2D/proj.linux/box2d.prf delete mode 100644 external/Box2D/proj.win32/Box2D.vcxproj delete mode 100644 external/Box2D/proj.win32/Box2D.vcxproj.filters delete mode 100644 external/Box2D/proj.win32/Box2D.vcxproj.user diff --git a/cocos/physics/Box2D/CCPhysicsBodyInfo.cpp b/cocos/physics/Box2D/CCPhysicsBodyInfo.cpp deleted file mode 100644 index bfa20b616a..0000000000 --- a/cocos/physics/Box2D/CCPhysicsBodyInfo.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - 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 "CCPhysicsBodyInfo.h" - -#if (CC_PHYSICS_ENGINE == CC_PHYSICS_BOX2D) -NS_CC_BEGIN - -PhysicsBodyInfo::PhysicsBodyInfo() -{ -} - -PhysicsBodyInfo::~PhysicsBodyInfo() -{ -} - -NS_CC_END -#endif // CC_PHYSICS_ENGINE == CC_PHYSICS_BOX2D diff --git a/cocos/physics/Box2D/CCPhysicsBodyInfo.h b/cocos/physics/Box2D/CCPhysicsBodyInfo.h deleted file mode 100644 index 730837ed9d..0000000000 --- a/cocos/physics/Box2D/CCPhysicsBodyInfo.h +++ /dev/null @@ -1,43 +0,0 @@ -/**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - 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 "../CCPhysicsSetting.h" -#if (CC_PHYSICS_ENGINE == CC_PHYSICS_BOX2D) - -#ifndef __CCPHYSICS_BODY_INFO_H__ -#define __CCPHYSICS_BODY_INFO_H__ -#include "platform/CCPlatformMacros.h" -NS_CC_BEGIN - -class PhysicsBodyInfo -{ -public: - PhysicsBodyInfo(); - ~PhysicsBodyInfo(); -}; - -NS_CC_END -#endif // __CCPHYSICS_BODY_INFO_H__ - -#endif // CC_PHYSICS_ENGINE == CC_PHYSICS_BOX2D diff --git a/cocos/physics/Box2D/CCPhysicsContactInfo.cpp b/cocos/physics/Box2D/CCPhysicsContactInfo.cpp deleted file mode 100644 index 41eaa4f831..0000000000 --- a/cocos/physics/Box2D/CCPhysicsContactInfo.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - 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 "CCPhysicsContactInfo.h" - -#if (CC_PHYSICS_ENGINE == CC_PHYSICS_BOX2D) -NS_CC_BEGIN - -PhysicsContactInfo::PhysicsContactInfo() -{ -} - -PhysicsContactInfo::~PhysicsContactInfo() -{ -} - -NS_CC_END -#endif // CC_PHYSICS_ENGINE == CC_PHYSICS_BOX2D diff --git a/cocos/physics/Box2D/CCPhysicsContactInfo.h b/cocos/physics/Box2D/CCPhysicsContactInfo.h deleted file mode 100644 index b592caa0af..0000000000 --- a/cocos/physics/Box2D/CCPhysicsContactInfo.h +++ /dev/null @@ -1,43 +0,0 @@ -/**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - 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 "../CCPhysicsSetting.h" -#if (CC_PHYSICS_ENGINE == CC_PHYSICS_BOX2D) - -#ifndef __CCPHYSICS_CONTACT_INFO_H__ -#define __CCPHYSICS_CONTACT_INFO_H__ -#include "platform/CCPlatformMacros.h" -NS_CC_BEGIN - -class PhysicsContactInfo -{ -public: - PhysicsContactInfo(); - ~PhysicsContactInfo(); -}; - -NS_CC_END -#endif // __CCPHYSICS_CONTACT_INFO_H__ - -#endif // CC_PHYSICS_ENGINE == CC_PHYSICS_BOX2D diff --git a/cocos/physics/Box2D/CCPhysicsHelper.h b/cocos/physics/Box2D/CCPhysicsHelper.h deleted file mode 100644 index 86ef7d74ee..0000000000 --- a/cocos/physics/Box2D/CCPhysicsHelper.h +++ /dev/null @@ -1,43 +0,0 @@ -/**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - 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 "../CCPhysicsSetting.h" -#if (CC_PHYSICS_ENGINE == CC_PHYSICS_BOX2D) - -#ifndef __CCPHYSICS_HELPER_H__ -#define __CCPHYSICS_HELPER_H__ - -#include "platform/CCPlatformMacros.h" -#include "cocoa/CCGeometry.h" - -NS_CC_BEGIN - -class PhysicsHelper -{ -}; - -NS_CC_END -#endif // __CCPHYSICS_HELPER_H__ - -#endif // CC_PHYSICS_ENGINE == CC_PHYSICS_BOX2D diff --git a/cocos/physics/Box2D/CCPhysicsJointInfo.cpp b/cocos/physics/Box2D/CCPhysicsJointInfo.cpp deleted file mode 100644 index 753ba41534..0000000000 --- a/cocos/physics/Box2D/CCPhysicsJointInfo.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - 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 "CCPhysicsJointInfo.h" - -#if (CC_PHYSICS_ENGINE == CC_PHYSICS_BOX2D) -NS_CC_BEGIN - -PhysicsJointInfo::PhysicsJointInfo() -{ -} - -PhysicsJointInfo::~PhysicsJointInfo() -{ -} - -NS_CC_END -#endif // CC_PHYSICS_ENGINE == CC_PHYSICS_BOX2D diff --git a/cocos/physics/Box2D/CCPhysicsJointInfo.h b/cocos/physics/Box2D/CCPhysicsJointInfo.h deleted file mode 100644 index abcf089387..0000000000 --- a/cocos/physics/Box2D/CCPhysicsJointInfo.h +++ /dev/null @@ -1,43 +0,0 @@ -/**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - 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 "../CCPhysicsSetting.h" -#if (CC_PHYSICS_ENGINE == CC_PHYSICS_BOX2D) - -#ifndef __CCPHYSICS_JOINT_INFO_H__ -#define __CCPHYSICS_JOINT_INFO_H__ -#include "platform/CCPlatformMacros.h" -NS_CC_BEGIN - -class PhysicsJointInfo -{ -public: - PhysicsJointInfo(); - ~PhysicsJointInfo(); -}; - -NS_CC_END -#endif // __CCPHYSICS_JOINT_INFO_H__ - -#endif // CC_PHYSICS_ENGINE == CC_PHYSICS_BOX2D diff --git a/cocos/physics/Box2D/CCPhysicsShapeInfo.cpp b/cocos/physics/Box2D/CCPhysicsShapeInfo.cpp deleted file mode 100644 index a89ba7dae7..0000000000 --- a/cocos/physics/Box2D/CCPhysicsShapeInfo.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - 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 "CCPhysicsShapeInfo.h" - -#if (CC_PHYSICS_ENGINE == CC_PHYSICS_BOX2D) -NS_CC_BEGIN - -PhysicsShapeInfo::PhysicsShapeInfo() -{ -} - -PhysicsShapeInfo::~PhysicsShapeInfo() -{ -} - -NS_CC_END -#endif // CC_PHYSICS_ENGINE == CC_PHYSICS_BOX2D diff --git a/cocos/physics/Box2D/CCPhysicsShapeInfo.h b/cocos/physics/Box2D/CCPhysicsShapeInfo.h deleted file mode 100644 index 9091001887..0000000000 --- a/cocos/physics/Box2D/CCPhysicsShapeInfo.h +++ /dev/null @@ -1,43 +0,0 @@ -/**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - 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 "../CCPhysicsSetting.h" -#if (CC_PHYSICS_ENGINE == CC_PHYSICS_BOX2D) - -#ifndef __CCPHYSICS_SHAPE_INFO_H__ -#define __CCPHYSICS_SHAPE_INFO_H__ -#include "platform/CCPlatformMacros.h" -NS_CC_BEGIN - -class PhysicsShapeInfo -{ -public: - PhysicsShapeInfo(); - ~PhysicsShapeInfo(); -}; - -NS_CC_END -#endif // __CCPHYSICS_SHAPE_INFO_H__ - -#endif // CC_PHYSICS_ENGINE == CC_PHYSICS_BOX2D diff --git a/cocos/physics/Box2D/CCPhysicsWorldInfo.cpp b/cocos/physics/Box2D/CCPhysicsWorldInfo.cpp deleted file mode 100644 index 0de6c00d82..0000000000 --- a/cocos/physics/Box2D/CCPhysicsWorldInfo.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - 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 "CCPhysicsWorldInfo.h" - -#if (CC_PHYSICS_ENGINE == CC_PHYSICS_BOX2D) -NS_CC_BEGIN - -PhysicsWorldInfo::PhysicsWorldInfo() -{ -} - -PhysicsWorldInfo::~PhysicsWorldInfo() -{ -} - -NS_CC_END -#endif // CC_PHYSICS_ENGINE == CC_PHYSICS_BOX2D diff --git a/cocos/physics/Box2D/CCPhysicsWorldInfo.h b/cocos/physics/Box2D/CCPhysicsWorldInfo.h deleted file mode 100644 index bcc09124db..0000000000 --- a/cocos/physics/Box2D/CCPhysicsWorldInfo.h +++ /dev/null @@ -1,43 +0,0 @@ -/**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - 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 "../CCPhysicsSetting.h" -#if (CC_PHYSICS_ENGINE == CC_PHYSICS_BOX2D) - -#ifndef __CCPHYSICS_WORLD_INFO_H__ -#define __CCPHYSICS_WORLD_INFO_H__ -#include "platform/CCPlatformMacros.h" -NS_CC_BEGIN - -class PhysicsWorldInfo -{ -public: - PhysicsWorldInfo(); - ~PhysicsWorldInfo(); -}; - -NS_CC_END -#endif // __CCPHYSICS_WORLD_INFO_H__ - -#endif // CC_PHYSICS_ENGINE == CC_PHYSICS_BOX2D diff --git a/external/Box2D/Android.mk b/external/Box2D/Android.mk deleted file mode 100644 index c366750c01..0000000000 --- a/external/Box2D/Android.mk +++ /dev/null @@ -1,60 +0,0 @@ -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) - -LOCAL_MODULE := box2d_static - -LOCAL_MODULE_FILENAME := libbox2d - -LOCAL_SRC_FILES := \ -Collision/b2BroadPhase.cpp \ -Collision/b2CollideCircle.cpp \ -Collision/b2CollideEdge.cpp \ -Collision/b2CollidePolygon.cpp \ -Collision/b2Collision.cpp \ -Collision/b2Distance.cpp \ -Collision/b2DynamicTree.cpp \ -Collision/b2TimeOfImpact.cpp \ -Collision/Shapes/b2ChainShape.cpp \ -Collision/Shapes/b2CircleShape.cpp \ -Collision/Shapes/b2EdgeShape.cpp \ -Collision/Shapes/b2PolygonShape.cpp \ -Common/b2BlockAllocator.cpp \ -Common/b2Draw.cpp \ -Common/b2Math.cpp \ -Common/b2Settings.cpp \ -Common/b2StackAllocator.cpp \ -Common/b2Timer.cpp \ -Dynamics/b2Body.cpp \ -Dynamics/b2ContactManager.cpp \ -Dynamics/b2Fixture.cpp \ -Dynamics/b2Island.cpp \ -Dynamics/b2World.cpp \ -Dynamics/b2WorldCallbacks.cpp \ -Dynamics/Contacts/b2ChainAndCircleContact.cpp \ -Dynamics/Contacts/b2ChainAndPolygonContact.cpp \ -Dynamics/Contacts/b2CircleContact.cpp \ -Dynamics/Contacts/b2Contact.cpp \ -Dynamics/Contacts/b2ContactSolver.cpp \ -Dynamics/Contacts/b2EdgeAndCircleContact.cpp \ -Dynamics/Contacts/b2EdgeAndPolygonContact.cpp \ -Dynamics/Contacts/b2PolygonAndCircleContact.cpp \ -Dynamics/Contacts/b2PolygonContact.cpp \ -Dynamics/Joints/b2DistanceJoint.cpp \ -Dynamics/Joints/b2FrictionJoint.cpp \ -Dynamics/Joints/b2GearJoint.cpp \ -Dynamics/Joints/b2Joint.cpp \ -Dynamics/Joints/b2MouseJoint.cpp \ -Dynamics/Joints/b2PrismaticJoint.cpp \ -Dynamics/Joints/b2PulleyJoint.cpp \ -Dynamics/Joints/b2RevoluteJoint.cpp \ -Dynamics/Joints/b2RopeJoint.cpp \ -Dynamics/Joints/b2WeldJoint.cpp \ -Dynamics/Joints/b2WheelJoint.cpp \ -Rope/b2Rope.cpp - -LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/.. - -LOCAL_C_INCLUDES := $(LOCAL_PATH)/.. - -include $(BUILD_STATIC_LIBRARY) diff --git a/external/Box2D/Box2D.h b/external/Box2D/Box2D.h deleted file mode 100644 index f674d82269..0000000000 --- a/external/Box2D/Box2D.h +++ /dev/null @@ -1,67 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef BOX2D_H -#define BOX2D_H - -/** -\mainpage Box2D API Documentation - -\section intro_sec Getting Started - -For documentation please see http://box2d.org/documentation.html - -For discussion please visit http://box2d.org/forum -*/ - -// These include files constitute the main Box2D API - -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#endif diff --git a/external/Box2D/Collision/Shapes/b2ChainShape.cpp b/external/Box2D/Collision/Shapes/b2ChainShape.cpp deleted file mode 100644 index 79b4304b5b..0000000000 --- a/external/Box2D/Collision/Shapes/b2ChainShape.cpp +++ /dev/null @@ -1,171 +0,0 @@ -/* -* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include -#include -using namespace std; - -b2ChainShape::~b2ChainShape() -{ - b2Free(m_vertices); - m_vertices = NULL; - m_count = 0; -} - -void b2ChainShape::CreateLoop(const b2Vec2* vertices, int32 count) -{ - b2Assert(m_vertices == NULL && m_count == 0); - b2Assert(count >= 3); - m_count = count + 1; - m_vertices = (b2Vec2*)b2Alloc(m_count * sizeof(b2Vec2)); - memcpy(m_vertices, vertices, count * sizeof(b2Vec2)); - m_vertices[count] = m_vertices[0]; - m_prevVertex = m_vertices[m_count - 2]; - m_nextVertex = m_vertices[1]; - m_hasPrevVertex = true; - m_hasNextVertex = true; -} - -void b2ChainShape::CreateChain(const b2Vec2* vertices, int32 count) -{ - b2Assert(m_vertices == NULL && m_count == 0); - b2Assert(count >= 2); - m_count = count; - m_vertices = (b2Vec2*)b2Alloc(count * sizeof(b2Vec2)); - memcpy(m_vertices, vertices, m_count * sizeof(b2Vec2)); - m_hasPrevVertex = false; - m_hasNextVertex = false; -} - -void b2ChainShape::SetPrevVertex(const b2Vec2& prevVertex) -{ - m_prevVertex = prevVertex; - m_hasPrevVertex = true; -} - -void b2ChainShape::SetNextVertex(const b2Vec2& nextVertex) -{ - m_nextVertex = nextVertex; - m_hasNextVertex = true; -} - -b2Shape* b2ChainShape::Clone(b2BlockAllocator* allocator) const -{ - void* mem = allocator->Allocate(sizeof(b2ChainShape)); - b2ChainShape* clone = new (mem) b2ChainShape; - clone->CreateChain(m_vertices, m_count); - clone->m_prevVertex = m_prevVertex; - clone->m_nextVertex = m_nextVertex; - clone->m_hasPrevVertex = m_hasPrevVertex; - clone->m_hasNextVertex = m_hasNextVertex; - return clone; -} - -int32 b2ChainShape::GetChildCount() const -{ - // edge count = vertex count - 1 - return m_count - 1; -} - -void b2ChainShape::GetChildEdge(b2EdgeShape* edge, int32 index) const -{ - b2Assert(0 <= index && index < m_count - 1); - edge->m_type = b2Shape::e_edge; - edge->m_radius = m_radius; - - edge->m_vertex1 = m_vertices[index + 0]; - edge->m_vertex2 = m_vertices[index + 1]; - - if (index > 0) - { - edge->m_vertex0 = m_vertices[index - 1]; - edge->m_hasVertex0 = true; - } - else - { - edge->m_vertex0 = m_prevVertex; - edge->m_hasVertex0 = m_hasPrevVertex; - } - - if (index < m_count - 2) - { - edge->m_vertex3 = m_vertices[index + 2]; - edge->m_hasVertex3 = true; - } - else - { - edge->m_vertex3 = m_nextVertex; - edge->m_hasVertex3 = m_hasNextVertex; - } -} - -bool b2ChainShape::TestPoint(const b2Transform& xf, const b2Vec2& p) const -{ - B2_NOT_USED(xf); - B2_NOT_USED(p); - return false; -} - -bool b2ChainShape::RayCast(b2RayCastOutput* output, const b2RayCastInput& input, - const b2Transform& xf, int32 childIndex) const -{ - b2Assert(childIndex < m_count); - - b2EdgeShape edgeShape; - - int32 i1 = childIndex; - int32 i2 = childIndex + 1; - if (i2 == m_count) - { - i2 = 0; - } - - edgeShape.m_vertex1 = m_vertices[i1]; - edgeShape.m_vertex2 = m_vertices[i2]; - - return edgeShape.RayCast(output, input, xf, 0); -} - -void b2ChainShape::ComputeAABB(b2AABB* aabb, const b2Transform& xf, int32 childIndex) const -{ - b2Assert(childIndex < m_count); - - int32 i1 = childIndex; - int32 i2 = childIndex + 1; - if (i2 == m_count) - { - i2 = 0; - } - - b2Vec2 v1 = b2Mul(xf, m_vertices[i1]); - b2Vec2 v2 = b2Mul(xf, m_vertices[i2]); - - aabb->lowerBound = b2Min(v1, v2); - aabb->upperBound = b2Max(v1, v2); -} - -void b2ChainShape::ComputeMass(b2MassData* massData, float32 density) const -{ - B2_NOT_USED(density); - - massData->mass = 0.0f; - massData->center.SetZero(); - massData->I = 0.0f; -} diff --git a/external/Box2D/Collision/Shapes/b2ChainShape.h b/external/Box2D/Collision/Shapes/b2ChainShape.h deleted file mode 100644 index 9c9a9eaa7d..0000000000 --- a/external/Box2D/Collision/Shapes/b2ChainShape.h +++ /dev/null @@ -1,102 +0,0 @@ -/* -* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_CHAIN_SHAPE_H -#define B2_CHAIN_SHAPE_H - -#include - -class b2EdgeShape; - -/// A chain shape is a free form sequence of line segments. -/// The chain has two-sided collision, so you can use inside and outside collision. -/// Therefore, you may use any winding order. -/// Since there may be many vertices, they are allocated using b2Alloc. -/// Connectivity information is used to create smooth collisions. -/// WARNING: The chain will not collide properly if there are self-intersections. -class b2ChainShape : public b2Shape -{ -public: - b2ChainShape(); - - /// The destructor frees the vertices using b2Free. - ~b2ChainShape(); - - /// Create a loop. This automatically adjusts connectivity. - /// @param vertices an array of vertices, these are copied - /// @param count the vertex count - void CreateLoop(const b2Vec2* vertices, int32 count); - - /// Create a chain with isolated end vertices. - /// @param vertices an array of vertices, these are copied - /// @param count the vertex count - void CreateChain(const b2Vec2* vertices, int32 count); - - /// Establish connectivity to a vertex that precedes the first vertex. - /// Don't call this for loops. - void SetPrevVertex(const b2Vec2& prevVertex); - - /// Establish connectivity to a vertex that follows the last vertex. - /// Don't call this for loops. - void SetNextVertex(const b2Vec2& nextVertex); - - /// Implement b2Shape. Vertices are cloned using b2Alloc. - b2Shape* Clone(b2BlockAllocator* allocator) const; - - /// @see b2Shape::GetChildCount - int32 GetChildCount() const; - - /// Get a child edge. - void GetChildEdge(b2EdgeShape* edge, int32 index) const; - - /// This always return false. - /// @see b2Shape::TestPoint - bool TestPoint(const b2Transform& transform, const b2Vec2& p) const; - - /// Implement b2Shape. - bool RayCast(b2RayCastOutput* output, const b2RayCastInput& input, - const b2Transform& transform, int32 childIndex) const; - - /// @see b2Shape::ComputeAABB - void ComputeAABB(b2AABB* aabb, const b2Transform& transform, int32 childIndex) const; - - /// Chains have zero mass. - /// @see b2Shape::ComputeMass - void ComputeMass(b2MassData* massData, float32 density) const; - - /// The vertices. Owned by this class. - b2Vec2* m_vertices; - - /// The vertex count. - int32 m_count; - - b2Vec2 m_prevVertex, m_nextVertex; - bool m_hasPrevVertex, m_hasNextVertex; -}; - -inline b2ChainShape::b2ChainShape() -{ - m_type = e_chain; - m_radius = b2_polygonRadius; - m_vertices = NULL; - m_count = 0; - m_hasPrevVertex = false; - m_hasNextVertex = false; -} - -#endif diff --git a/external/Box2D/Collision/Shapes/b2CircleShape.cpp b/external/Box2D/Collision/Shapes/b2CircleShape.cpp deleted file mode 100644 index 587ca960b2..0000000000 --- a/external/Box2D/Collision/Shapes/b2CircleShape.cpp +++ /dev/null @@ -1,100 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -using namespace std; - -b2Shape* b2CircleShape::Clone(b2BlockAllocator* allocator) const -{ - void* mem = allocator->Allocate(sizeof(b2CircleShape)); - b2CircleShape* clone = new (mem) b2CircleShape; - *clone = *this; - return clone; -} - -int32 b2CircleShape::GetChildCount() const -{ - return 1; -} - -bool b2CircleShape::TestPoint(const b2Transform& transform, const b2Vec2& p) const -{ - b2Vec2 center = transform.p + b2Mul(transform.q, m_p); - b2Vec2 d = p - center; - return b2Dot(d, d) <= m_radius * m_radius; -} - -// Collision Detection in Interactive 3D Environments by Gino van den Bergen -// From Section 3.1.2 -// x = s + a * r -// norm(x) = radius -bool b2CircleShape::RayCast(b2RayCastOutput* output, const b2RayCastInput& input, - const b2Transform& transform, int32 childIndex) const -{ - B2_NOT_USED(childIndex); - - b2Vec2 position = transform.p + b2Mul(transform.q, m_p); - b2Vec2 s = input.p1 - position; - float32 b = b2Dot(s, s) - m_radius * m_radius; - - // Solve quadratic equation. - b2Vec2 r = input.p2 - input.p1; - float32 c = b2Dot(s, r); - float32 rr = b2Dot(r, r); - float32 sigma = c * c - rr * b; - - // Check for negative discriminant and short segment. - if (sigma < 0.0f || rr < b2_epsilon) - { - return false; - } - - // Find the point of intersection of the line with the circle. - float32 a = -(c + b2Sqrt(sigma)); - - // Is the intersection point on the segment? - if (0.0f <= a && a <= input.maxFraction * rr) - { - a /= rr; - output->fraction = a; - output->normal = s + a * r; - output->normal.Normalize(); - return true; - } - - return false; -} - -void b2CircleShape::ComputeAABB(b2AABB* aabb, const b2Transform& transform, int32 childIndex) const -{ - B2_NOT_USED(childIndex); - - b2Vec2 p = transform.p + b2Mul(transform.q, m_p); - aabb->lowerBound.Set(p.x - m_radius, p.y - m_radius); - aabb->upperBound.Set(p.x + m_radius, p.y + m_radius); -} - -void b2CircleShape::ComputeMass(b2MassData* massData, float32 density) const -{ - massData->mass = density * b2_pi * m_radius * m_radius; - massData->center = m_p; - - // inertia about the local origin - massData->I = massData->mass * (0.5f * m_radius * m_radius + b2Dot(m_p, m_p)); -} diff --git a/external/Box2D/Collision/Shapes/b2CircleShape.h b/external/Box2D/Collision/Shapes/b2CircleShape.h deleted file mode 100644 index c4e23a475b..0000000000 --- a/external/Box2D/Collision/Shapes/b2CircleShape.h +++ /dev/null @@ -1,91 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_CIRCLE_SHAPE_H -#define B2_CIRCLE_SHAPE_H - -#include - -/// A circle shape. -class b2CircleShape : public b2Shape -{ -public: - b2CircleShape(); - - /// Implement b2Shape. - b2Shape* Clone(b2BlockAllocator* allocator) const; - - /// @see b2Shape::GetChildCount - int32 GetChildCount() const; - - /// Implement b2Shape. - bool TestPoint(const b2Transform& transform, const b2Vec2& p) const; - - /// Implement b2Shape. - bool RayCast(b2RayCastOutput* output, const b2RayCastInput& input, - const b2Transform& transform, int32 childIndex) const; - - /// @see b2Shape::ComputeAABB - void ComputeAABB(b2AABB* aabb, const b2Transform& transform, int32 childIndex) const; - - /// @see b2Shape::ComputeMass - void ComputeMass(b2MassData* massData, float32 density) const; - - /// Get the supporting vertex index in the given direction. - int32 GetSupport(const b2Vec2& d) const; - - /// Get the supporting vertex in the given direction. - const b2Vec2& GetSupportVertex(const b2Vec2& d) const; - - /// Get the vertex count. - int32 GetVertexCount() const { return 1; } - - /// Get a vertex by index. Used by b2Distance. - const b2Vec2& GetVertex(int32 index) const; - - /// Position - b2Vec2 m_p; -}; - -inline b2CircleShape::b2CircleShape() -{ - m_type = e_circle; - m_radius = 0.0f; - m_p.SetZero(); -} - -inline int32 b2CircleShape::GetSupport(const b2Vec2 &d) const -{ - B2_NOT_USED(d); - return 0; -} - -inline const b2Vec2& b2CircleShape::GetSupportVertex(const b2Vec2 &d) const -{ - B2_NOT_USED(d); - return m_p; -} - -inline const b2Vec2& b2CircleShape::GetVertex(int32 index) const -{ - B2_NOT_USED(index); - b2Assert(index == 0); - return m_p; -} - -#endif diff --git a/external/Box2D/Collision/Shapes/b2EdgeShape.cpp b/external/Box2D/Collision/Shapes/b2EdgeShape.cpp deleted file mode 100644 index 7b09e55bf4..0000000000 --- a/external/Box2D/Collision/Shapes/b2EdgeShape.cpp +++ /dev/null @@ -1,139 +0,0 @@ -/* -* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -using namespace std; - -void b2EdgeShape::Set(const b2Vec2& v1, const b2Vec2& v2) -{ - m_vertex1 = v1; - m_vertex2 = v2; - m_hasVertex0 = false; - m_hasVertex3 = false; -} - -b2Shape* b2EdgeShape::Clone(b2BlockAllocator* allocator) const -{ - void* mem = allocator->Allocate(sizeof(b2EdgeShape)); - b2EdgeShape* clone = new (mem) b2EdgeShape; - *clone = *this; - return clone; -} - -int32 b2EdgeShape::GetChildCount() const -{ - return 1; -} - -bool b2EdgeShape::TestPoint(const b2Transform& xf, const b2Vec2& p) const -{ - B2_NOT_USED(xf); - B2_NOT_USED(p); - return false; -} - -// p = p1 + t * d -// v = v1 + s * e -// p1 + t * d = v1 + s * e -// s * e - t * d = p1 - v1 -bool b2EdgeShape::RayCast(b2RayCastOutput* output, const b2RayCastInput& input, - const b2Transform& xf, int32 childIndex) const -{ - B2_NOT_USED(childIndex); - - // Put the ray into the edge's frame of reference. - b2Vec2 p1 = b2MulT(xf.q, input.p1 - xf.p); - b2Vec2 p2 = b2MulT(xf.q, input.p2 - xf.p); - b2Vec2 d = p2 - p1; - - b2Vec2 v1 = m_vertex1; - b2Vec2 v2 = m_vertex2; - b2Vec2 e = v2 - v1; - b2Vec2 normal(e.y, -e.x); - normal.Normalize(); - - // q = p1 + t * d - // dot(normal, q - v1) = 0 - // dot(normal, p1 - v1) + t * dot(normal, d) = 0 - float32 numerator = b2Dot(normal, v1 - p1); - float32 denominator = b2Dot(normal, d); - - if (denominator == 0.0f) - { - return false; - } - - float32 t = numerator / denominator; - if (t < 0.0f || input.maxFraction < t) - { - return false; - } - - b2Vec2 q = p1 + t * d; - - // q = v1 + s * r - // s = dot(q - v1, r) / dot(r, r) - b2Vec2 r = v2 - v1; - float32 rr = b2Dot(r, r); - if (rr == 0.0f) - { - return false; - } - - float32 s = b2Dot(q - v1, r) / rr; - if (s < 0.0f || 1.0f < s) - { - return false; - } - - output->fraction = t; - if (numerator > 0.0f) - { - output->normal = -normal; - } - else - { - output->normal = normal; - } - return true; -} - -void b2EdgeShape::ComputeAABB(b2AABB* aabb, const b2Transform& xf, int32 childIndex) const -{ - B2_NOT_USED(childIndex); - - b2Vec2 v1 = b2Mul(xf, m_vertex1); - b2Vec2 v2 = b2Mul(xf, m_vertex2); - - b2Vec2 lower = b2Min(v1, v2); - b2Vec2 upper = b2Max(v1, v2); - - b2Vec2 r(m_radius, m_radius); - aabb->lowerBound = lower - r; - aabb->upperBound = upper + r; -} - -void b2EdgeShape::ComputeMass(b2MassData* massData, float32 density) const -{ - B2_NOT_USED(density); - - massData->mass = 0.0f; - massData->center = 0.5f * (m_vertex1 + m_vertex2); - massData->I = 0.0f; -} diff --git a/external/Box2D/Collision/Shapes/b2EdgeShape.h b/external/Box2D/Collision/Shapes/b2EdgeShape.h deleted file mode 100644 index 6163bcbf1c..0000000000 --- a/external/Box2D/Collision/Shapes/b2EdgeShape.h +++ /dev/null @@ -1,74 +0,0 @@ -/* -* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_EDGE_SHAPE_H -#define B2_EDGE_SHAPE_H - -#include - -/// A line segment (edge) shape. These can be connected in chains or loops -/// to other edge shapes. The connectivity information is used to ensure -/// correct contact normals. -class b2EdgeShape : public b2Shape -{ -public: - b2EdgeShape(); - - /// Set this as an isolated edge. - void Set(const b2Vec2& v1, const b2Vec2& v2); - - /// Implement b2Shape. - b2Shape* Clone(b2BlockAllocator* allocator) const; - - /// @see b2Shape::GetChildCount - int32 GetChildCount() const; - - /// @see b2Shape::TestPoint - bool TestPoint(const b2Transform& transform, const b2Vec2& p) const; - - /// Implement b2Shape. - bool RayCast(b2RayCastOutput* output, const b2RayCastInput& input, - const b2Transform& transform, int32 childIndex) const; - - /// @see b2Shape::ComputeAABB - void ComputeAABB(b2AABB* aabb, const b2Transform& transform, int32 childIndex) const; - - /// @see b2Shape::ComputeMass - void ComputeMass(b2MassData* massData, float32 density) const; - - /// These are the edge vertices - b2Vec2 m_vertex1, m_vertex2; - - /// Optional adjacent vertices. These are used for smooth collision. - b2Vec2 m_vertex0, m_vertex3; - bool m_hasVertex0, m_hasVertex3; -}; - -inline b2EdgeShape::b2EdgeShape() -{ - m_type = e_edge; - m_radius = b2_polygonRadius; - m_vertex0.x = 0.0f; - m_vertex0.y = 0.0f; - m_vertex3.x = 0.0f; - m_vertex3.y = 0.0f; - m_hasVertex0 = false; - m_hasVertex3 = false; -} - -#endif diff --git a/external/Box2D/Collision/Shapes/b2PolygonShape.cpp b/external/Box2D/Collision/Shapes/b2PolygonShape.cpp deleted file mode 100644 index c04c1dc49b..0000000000 --- a/external/Box2D/Collision/Shapes/b2PolygonShape.cpp +++ /dev/null @@ -1,361 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include - -b2Shape* b2PolygonShape::Clone(b2BlockAllocator* allocator) const -{ - void* mem = allocator->Allocate(sizeof(b2PolygonShape)); - b2PolygonShape* clone = new (mem) b2PolygonShape; - *clone = *this; - return clone; -} - -void b2PolygonShape::SetAsBox(float32 hx, float32 hy) -{ - m_vertexCount = 4; - m_vertices[0].Set(-hx, -hy); - m_vertices[1].Set( hx, -hy); - m_vertices[2].Set( hx, hy); - m_vertices[3].Set(-hx, hy); - m_normals[0].Set(0.0f, -1.0f); - m_normals[1].Set(1.0f, 0.0f); - m_normals[2].Set(0.0f, 1.0f); - m_normals[3].Set(-1.0f, 0.0f); - m_centroid.SetZero(); -} - -void b2PolygonShape::SetAsBox(float32 hx, float32 hy, const b2Vec2& center, float32 angle) -{ - m_vertexCount = 4; - m_vertices[0].Set(-hx, -hy); - m_vertices[1].Set( hx, -hy); - m_vertices[2].Set( hx, hy); - m_vertices[3].Set(-hx, hy); - m_normals[0].Set(0.0f, -1.0f); - m_normals[1].Set(1.0f, 0.0f); - m_normals[2].Set(0.0f, 1.0f); - m_normals[3].Set(-1.0f, 0.0f); - m_centroid = center; - - b2Transform xf; - xf.p = center; - xf.q.Set(angle); - - // Transform vertices and normals. - for (int32 i = 0; i < m_vertexCount; ++i) - { - m_vertices[i] = b2Mul(xf, m_vertices[i]); - m_normals[i] = b2Mul(xf.q, m_normals[i]); - } -} - -int32 b2PolygonShape::GetChildCount() const -{ - return 1; -} - -static b2Vec2 ComputeCentroid(const b2Vec2* vs, int32 count) -{ - b2Assert(count >= 3); - - b2Vec2 c; c.Set(0.0f, 0.0f); - float32 area = 0.0f; - - // pRef is the reference point for forming triangles. - // It's location doesn't change the result (except for rounding error). - b2Vec2 pRef(0.0f, 0.0f); -#if 0 - // This code would put the reference point inside the polygon. - for (int32 i = 0; i < count; ++i) - { - pRef += vs[i]; - } - pRef *= 1.0f / count; -#endif - - const float32 inv3 = 1.0f / 3.0f; - - for (int32 i = 0; i < count; ++i) - { - // Triangle vertices. - b2Vec2 p1 = pRef; - b2Vec2 p2 = vs[i]; - b2Vec2 p3 = i + 1 < count ? vs[i+1] : vs[0]; - - b2Vec2 e1 = p2 - p1; - b2Vec2 e2 = p3 - p1; - - float32 D = b2Cross(e1, e2); - - float32 triangleArea = 0.5f * D; - area += triangleArea; - - // Area weighted centroid - c += triangleArea * inv3 * (p1 + p2 + p3); - } - - // Centroid - b2Assert(area > b2_epsilon); - c *= 1.0f / area; - return c; -} - -void b2PolygonShape::Set(const b2Vec2* vertices, int32 count) -{ - b2Assert(3 <= count && count <= b2_maxPolygonVertices); - m_vertexCount = count; - - // Copy vertices. - for (int32 i = 0; i < m_vertexCount; ++i) - { - m_vertices[i] = vertices[i]; - } - - // Compute normals. Ensure the edges have non-zero length. - for (int32 i = 0; i < m_vertexCount; ++i) - { - int32 i1 = i; - int32 i2 = i + 1 < m_vertexCount ? i + 1 : 0; - b2Vec2 edge = m_vertices[i2] - m_vertices[i1]; - b2Assert(edge.LengthSquared() > b2_epsilon * b2_epsilon); - m_normals[i] = b2Cross(edge, 1.0f); - m_normals[i].Normalize(); - } - -#ifdef _DEBUG - // Ensure the polygon is convex and the interior - // is to the left of each edge. - for (int32 i = 0; i < m_vertexCount; ++i) - { - int32 i1 = i; - int32 i2 = i + 1 < m_vertexCount ? i + 1 : 0; - b2Vec2 edge = m_vertices[i2] - m_vertices[i1]; - - for (int32 j = 0; j < m_vertexCount; ++j) - { - // Don't check vertices on the current edge. - if (j == i1 || j == i2) - { - continue; - } - - b2Vec2 r = m_vertices[j] - m_vertices[i1]; - - // If this crashes, your polygon is non-convex, has colinear edges, - // or the winding order is wrong. - float32 s = b2Cross(edge, r); - b2Assert(s > 0.0f && "ERROR: Please ensure your polygon is convex and has a CCW winding order"); - } - } -#endif - - // Compute the polygon centroid. - m_centroid = ComputeCentroid(m_vertices, m_vertexCount); -} - -bool b2PolygonShape::TestPoint(const b2Transform& xf, const b2Vec2& p) const -{ - b2Vec2 pLocal = b2MulT(xf.q, p - xf.p); - - for (int32 i = 0; i < m_vertexCount; ++i) - { - float32 dot = b2Dot(m_normals[i], pLocal - m_vertices[i]); - if (dot > 0.0f) - { - return false; - } - } - - return true; -} - -bool b2PolygonShape::RayCast(b2RayCastOutput* output, const b2RayCastInput& input, - const b2Transform& xf, int32 childIndex) const -{ - B2_NOT_USED(childIndex); - - // Put the ray into the polygon's frame of reference. - b2Vec2 p1 = b2MulT(xf.q, input.p1 - xf.p); - b2Vec2 p2 = b2MulT(xf.q, input.p2 - xf.p); - b2Vec2 d = p2 - p1; - - float32 lower = 0.0f, upper = input.maxFraction; - - int32 index = -1; - - for (int32 i = 0; i < m_vertexCount; ++i) - { - // p = p1 + a * d - // dot(normal, p - v) = 0 - // dot(normal, p1 - v) + a * dot(normal, d) = 0 - float32 numerator = b2Dot(m_normals[i], m_vertices[i] - p1); - float32 denominator = b2Dot(m_normals[i], d); - - if (denominator == 0.0f) - { - if (numerator < 0.0f) - { - return false; - } - } - else - { - // Note: we want this predicate without division: - // lower < numerator / denominator, where denominator < 0 - // Since denominator < 0, we have to flip the inequality: - // lower < numerator / denominator <==> denominator * lower > numerator. - if (denominator < 0.0f && numerator < lower * denominator) - { - // Increase lower. - // The segment enters this half-space. - lower = numerator / denominator; - index = i; - } - else if (denominator > 0.0f && numerator < upper * denominator) - { - // Decrease upper. - // The segment exits this half-space. - upper = numerator / denominator; - } - } - - // The use of epsilon here causes the assert on lower to trip - // in some cases. Apparently the use of epsilon was to make edge - // shapes work, but now those are handled separately. - //if (upper < lower - b2_epsilon) - if (upper < lower) - { - return false; - } - } - - b2Assert(0.0f <= lower && lower <= input.maxFraction); - - if (index >= 0) - { - output->fraction = lower; - output->normal = b2Mul(xf.q, m_normals[index]); - return true; - } - - return false; -} - -void b2PolygonShape::ComputeAABB(b2AABB* aabb, const b2Transform& xf, int32 childIndex) const -{ - B2_NOT_USED(childIndex); - - b2Vec2 lower = b2Mul(xf, m_vertices[0]); - b2Vec2 upper = lower; - - for (int32 i = 1; i < m_vertexCount; ++i) - { - b2Vec2 v = b2Mul(xf, m_vertices[i]); - lower = b2Min(lower, v); - upper = b2Max(upper, v); - } - - b2Vec2 r(m_radius, m_radius); - aabb->lowerBound = lower - r; - aabb->upperBound = upper + r; -} - -void b2PolygonShape::ComputeMass(b2MassData* massData, float32 density) const -{ - // Polygon mass, centroid, and inertia. - // Let rho be the polygon density in mass per unit area. - // Then: - // mass = rho * int(dA) - // centroid.x = (1/mass) * rho * int(x * dA) - // centroid.y = (1/mass) * rho * int(y * dA) - // I = rho * int((x*x + y*y) * dA) - // - // We can compute these integrals by summing all the integrals - // for each triangle of the polygon. To evaluate the integral - // for a single triangle, we make a change of variables to - // the (u,v) coordinates of the triangle: - // x = x0 + e1x * u + e2x * v - // y = y0 + e1y * u + e2y * v - // where 0 <= u && 0 <= v && u + v <= 1. - // - // We integrate u from [0,1-v] and then v from [0,1]. - // We also need to use the Jacobian of the transformation: - // D = cross(e1, e2) - // - // Simplification: triangle centroid = (1/3) * (p1 + p2 + p3) - // - // The rest of the derivation is handled by computer algebra. - - b2Assert(m_vertexCount >= 3); - - b2Vec2 center; center.Set(0.0f, 0.0f); - float32 area = 0.0f; - float32 I = 0.0f; - - // s is the reference point for forming triangles. - // It's location doesn't change the result (except for rounding error). - b2Vec2 s(0.0f, 0.0f); - - // This code would put the reference point inside the polygon. - for (int32 i = 0; i < m_vertexCount; ++i) - { - s += m_vertices[i]; - } - s *= 1.0f / m_vertexCount; - - const float32 k_inv3 = 1.0f / 3.0f; - - for (int32 i = 0; i < m_vertexCount; ++i) - { - // Triangle vertices. - b2Vec2 e1 = m_vertices[i] - s; - b2Vec2 e2 = i + 1 < m_vertexCount ? m_vertices[i+1] - s : m_vertices[0] - s; - - float32 D = b2Cross(e1, e2); - - float32 triangleArea = 0.5f * D; - area += triangleArea; - - // Area weighted centroid - center += triangleArea * k_inv3 * (e1 + e2); - - float32 ex1 = e1.x, ey1 = e1.y; - float32 ex2 = e2.x, ey2 = e2.y; - - float32 intx2 = ex1*ex1 + ex2*ex1 + ex2*ex2; - float32 inty2 = ey1*ey1 + ey2*ey1 + ey2*ey2; - - I += (0.25f * k_inv3 * D) * (intx2 + inty2); - } - - // Total mass - massData->mass = density * area; - - // Center of mass - b2Assert(area > b2_epsilon); - center *= 1.0f / area; - massData->center = center + s; - - // Inertia tensor relative to the local origin (point s). - massData->I = density * I; - - // Shift to center of mass then to original body origin. - massData->I += massData->mass * (b2Dot(massData->center, massData->center) - b2Dot(center, center)); -} diff --git a/external/Box2D/Collision/Shapes/b2PolygonShape.h b/external/Box2D/Collision/Shapes/b2PolygonShape.h deleted file mode 100644 index 70daccb2ff..0000000000 --- a/external/Box2D/Collision/Shapes/b2PolygonShape.h +++ /dev/null @@ -1,95 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_POLYGON_SHAPE_H -#define B2_POLYGON_SHAPE_H - -#include - -/// A convex polygon. It is assumed that the interior of the polygon is to -/// the left of each edge. -/// Polygons have a maximum number of vertices equal to b2_maxPolygonVertices. -/// In most cases you should not need many vertices for a convex polygon. -class b2PolygonShape : public b2Shape -{ -public: - b2PolygonShape(); - - /// Implement b2Shape. - b2Shape* Clone(b2BlockAllocator* allocator) const; - - /// @see b2Shape::GetChildCount - int32 GetChildCount() const; - - /// Copy vertices. This assumes the vertices define a convex polygon. - /// It is assumed that the exterior is the the right of each edge. - /// The count must be in the range [3, b2_maxPolygonVertices]. - void Set(const b2Vec2* vertices, int32 vertexCount); - - /// Build vertices to represent an axis-aligned box. - /// @param hx the half-width. - /// @param hy the half-height. - void SetAsBox(float32 hx, float32 hy); - - /// Build vertices to represent an oriented box. - /// @param hx the half-width. - /// @param hy the half-height. - /// @param center the center of the box in local coordinates. - /// @param angle the rotation of the box in local coordinates. - void SetAsBox(float32 hx, float32 hy, const b2Vec2& center, float32 angle); - - /// @see b2Shape::TestPoint - bool TestPoint(const b2Transform& transform, const b2Vec2& p) const; - - /// Implement b2Shape. - bool RayCast(b2RayCastOutput* output, const b2RayCastInput& input, - const b2Transform& transform, int32 childIndex) const; - - /// @see b2Shape::ComputeAABB - void ComputeAABB(b2AABB* aabb, const b2Transform& transform, int32 childIndex) const; - - /// @see b2Shape::ComputeMass - void ComputeMass(b2MassData* massData, float32 density) const; - - /// Get the vertex count. - int32 GetVertexCount() const { return m_vertexCount; } - - /// Get a vertex by index. - const b2Vec2& GetVertex(int32 index) const; - - b2Vec2 m_centroid; - b2Vec2 m_vertices[b2_maxPolygonVertices]; - b2Vec2 m_normals[b2_maxPolygonVertices]; - int32 m_vertexCount; -}; - -inline b2PolygonShape::b2PolygonShape() -{ - m_type = e_polygon; - m_radius = b2_polygonRadius; - m_vertexCount = 0; - m_centroid.SetZero(); -} - -inline const b2Vec2& b2PolygonShape::GetVertex(int32 index) const -{ - b2Assert(0 <= index && index < m_vertexCount); - return m_vertices[index]; -} - -#endif diff --git a/external/Box2D/Collision/Shapes/b2Shape.h b/external/Box2D/Collision/Shapes/b2Shape.h deleted file mode 100644 index 2e2aedd14a..0000000000 --- a/external/Box2D/Collision/Shapes/b2Shape.h +++ /dev/null @@ -1,101 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_SHAPE_H -#define B2_SHAPE_H - -#include -#include -#include - -/// This holds the mass data computed for a shape. -struct b2MassData -{ - /// The mass of the shape, usually in kilograms. - float32 mass; - - /// The position of the shape's centroid relative to the shape's origin. - b2Vec2 center; - - /// The rotational inertia of the shape about the local origin. - float32 I; -}; - -/// A shape is used for collision detection. You can create a shape however you like. -/// Shapes used for simulation in b2World are created automatically when a b2Fixture -/// is created. Shapes may encapsulate a one or more child shapes. -class b2Shape -{ -public: - - enum Type - { - e_circle = 0, - e_edge = 1, - e_polygon = 2, - e_chain = 3, - e_typeCount = 4 - }; - - virtual ~b2Shape() {} - - /// Clone the concrete shape using the provided allocator. - virtual b2Shape* Clone(b2BlockAllocator* allocator) const = 0; - - /// Get the type of this shape. You can use this to down cast to the concrete shape. - /// @return the shape type. - Type GetType() const; - - /// Get the number of child primitives. - virtual int32 GetChildCount() const = 0; - - /// Test a point for containment in this shape. This only works for convex shapes. - /// @param xf the shape world transform. - /// @param p a point in world coordinates. - virtual bool TestPoint(const b2Transform& xf, const b2Vec2& p) const = 0; - - /// Cast a ray against a child shape. - /// @param output the ray-cast results. - /// @param input the ray-cast input parameters. - /// @param transform the transform to be applied to the shape. - /// @param childIndex the child shape index - virtual bool RayCast(b2RayCastOutput* output, const b2RayCastInput& input, - const b2Transform& transform, int32 childIndex) const = 0; - - /// Given a transform, compute the associated axis aligned bounding box for a child shape. - /// @param aabb returns the axis aligned box. - /// @param xf the world transform of the shape. - /// @param childIndex the child shape - virtual void ComputeAABB(b2AABB* aabb, const b2Transform& xf, int32 childIndex) const = 0; - - /// Compute the mass properties of this shape using its dimensions and density. - /// The inertia tensor is computed about the local origin. - /// @param massData returns the mass data for this shape. - /// @param density the density in kilograms per meter squared. - virtual void ComputeMass(b2MassData* massData, float32 density) const = 0; - - Type m_type; - float32 m_radius; -}; - -inline b2Shape::Type b2Shape::GetType() const -{ - return m_type; -} - -#endif diff --git a/external/Box2D/Collision/b2BroadPhase.cpp b/external/Box2D/Collision/b2BroadPhase.cpp deleted file mode 100644 index 431f6de1ee..0000000000 --- a/external/Box2D/Collision/b2BroadPhase.cpp +++ /dev/null @@ -1,122 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -using namespace std; - -b2BroadPhase::b2BroadPhase() -{ - m_proxyCount = 0; - - m_pairCapacity = 16; - m_pairCount = 0; - m_pairBuffer = (b2Pair*)b2Alloc(m_pairCapacity * sizeof(b2Pair)); - - m_moveCapacity = 16; - m_moveCount = 0; - m_moveBuffer = (int32*)b2Alloc(m_moveCapacity * sizeof(int32)); -} - -b2BroadPhase::~b2BroadPhase() -{ - b2Free(m_moveBuffer); - b2Free(m_pairBuffer); -} - -int32 b2BroadPhase::CreateProxy(const b2AABB& aabb, void* userData) -{ - int32 proxyId = m_tree.CreateProxy(aabb, userData); - ++m_proxyCount; - BufferMove(proxyId); - return proxyId; -} - -void b2BroadPhase::DestroyProxy(int32 proxyId) -{ - UnBufferMove(proxyId); - --m_proxyCount; - m_tree.DestroyProxy(proxyId); -} - -void b2BroadPhase::MoveProxy(int32 proxyId, const b2AABB& aabb, const b2Vec2& displacement) -{ - bool buffer = m_tree.MoveProxy(proxyId, aabb, displacement); - if (buffer) - { - BufferMove(proxyId); - } -} - -void b2BroadPhase::TouchProxy(int32 proxyId) -{ - BufferMove(proxyId); -} - -void b2BroadPhase::BufferMove(int32 proxyId) -{ - if (m_moveCount == m_moveCapacity) - { - int32* oldBuffer = m_moveBuffer; - m_moveCapacity *= 2; - m_moveBuffer = (int32*)b2Alloc(m_moveCapacity * sizeof(int32)); - memcpy(m_moveBuffer, oldBuffer, m_moveCount * sizeof(int32)); - b2Free(oldBuffer); - } - - m_moveBuffer[m_moveCount] = proxyId; - ++m_moveCount; -} - -void b2BroadPhase::UnBufferMove(int32 proxyId) -{ - for (int32 i = 0; i < m_moveCount; ++i) - { - if (m_moveBuffer[i] == proxyId) - { - m_moveBuffer[i] = e_nullProxy; - return; - } - } -} - -// This is called from b2DynamicTree::Query when we are gathering pairs. -bool b2BroadPhase::QueryCallback(int32 proxyId) -{ - // A proxy cannot form a pair with itself. - if (proxyId == m_queryProxyId) - { - return true; - } - - // Grow the pair buffer as needed. - if (m_pairCount == m_pairCapacity) - { - b2Pair* oldBuffer = m_pairBuffer; - m_pairCapacity *= 2; - m_pairBuffer = (b2Pair*)b2Alloc(m_pairCapacity * sizeof(b2Pair)); - memcpy(m_pairBuffer, oldBuffer, m_pairCount * sizeof(b2Pair)); - b2Free(oldBuffer); - } - - m_pairBuffer[m_pairCount].proxyIdA = b2Min(proxyId, m_queryProxyId); - m_pairBuffer[m_pairCount].proxyIdB = b2Max(proxyId, m_queryProxyId); - ++m_pairCount; - - return true; -} diff --git a/external/Box2D/Collision/b2BroadPhase.h b/external/Box2D/Collision/b2BroadPhase.h deleted file mode 100644 index cf2414730a..0000000000 --- a/external/Box2D/Collision/b2BroadPhase.h +++ /dev/null @@ -1,248 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_BROAD_PHASE_H -#define B2_BROAD_PHASE_H - -#include -#include -#include -#include - -struct b2Pair -{ - int32 proxyIdA; - int32 proxyIdB; - int32 next; -}; - -/// The broad-phase is used for computing pairs and performing volume queries and ray casts. -/// This broad-phase does not persist pairs. Instead, this reports potentially new pairs. -/// It is up to the client to consume the new pairs and to track subsequent overlap. -class b2BroadPhase -{ -public: - - enum - { - e_nullProxy = -1 - }; - - b2BroadPhase(); - ~b2BroadPhase(); - - /// Create a proxy with an initial AABB. Pairs are not reported until - /// UpdatePairs is called. - int32 CreateProxy(const b2AABB& aabb, void* userData); - - /// Destroy a proxy. It is up to the client to remove any pairs. - void DestroyProxy(int32 proxyId); - - /// Call MoveProxy as many times as you like, then when you are done - /// call UpdatePairs to finalized the proxy pairs (for your time step). - void MoveProxy(int32 proxyId, const b2AABB& aabb, const b2Vec2& displacement); - - /// Call to trigger a re-processing of it's pairs on the next call to UpdatePairs. - void TouchProxy(int32 proxyId); - - /// Get the fat AABB for a proxy. - const b2AABB& GetFatAABB(int32 proxyId) const; - - /// Get user data from a proxy. Returns NULL if the id is invalid. - void* GetUserData(int32 proxyId) const; - - /// Test overlap of fat AABBs. - bool TestOverlap(int32 proxyIdA, int32 proxyIdB) const; - - /// Get the number of proxies. - int32 GetProxyCount() const; - - /// Update the pairs. This results in pair callbacks. This can only add pairs. - template - void UpdatePairs(T* callback); - - /// Query an AABB for overlapping proxies. The callback class - /// is called for each proxy that overlaps the supplied AABB. - template - void Query(T* callback, const b2AABB& aabb) const; - - /// Ray-cast against the proxies in the tree. This relies on the callback - /// to perform a exact ray-cast in the case were the proxy contains a shape. - /// The callback also performs the any collision filtering. This has performance - /// roughly equal to k * log(n), where k is the number of collisions and n is the - /// number of proxies in the tree. - /// @param input the ray-cast input data. The ray extends from p1 to p1 + maxFraction * (p2 - p1). - /// @param callback a callback class that is called for each proxy that is hit by the ray. - template - void RayCast(T* callback, const b2RayCastInput& input) const; - - /// Get the height of the embedded tree. - int32 GetTreeHeight() const; - - /// Get the balance of the embedded tree. - int32 GetTreeBalance() const; - - /// Get the quality metric of the embedded tree. - float32 GetTreeQuality() const; - -private: - - friend class b2DynamicTree; - - void BufferMove(int32 proxyId); - void UnBufferMove(int32 proxyId); - - bool QueryCallback(int32 proxyId); - - b2DynamicTree m_tree; - - int32 m_proxyCount; - - int32* m_moveBuffer; - int32 m_moveCapacity; - int32 m_moveCount; - - b2Pair* m_pairBuffer; - int32 m_pairCapacity; - int32 m_pairCount; - - int32 m_queryProxyId; -}; - -/// This is used to sort pairs. -inline bool b2PairLessThan(const b2Pair& pair1, const b2Pair& pair2) -{ - if (pair1.proxyIdA < pair2.proxyIdA) - { - return true; - } - - if (pair1.proxyIdA == pair2.proxyIdA) - { - return pair1.proxyIdB < pair2.proxyIdB; - } - - return false; -} - -inline void* b2BroadPhase::GetUserData(int32 proxyId) const -{ - return m_tree.GetUserData(proxyId); -} - -inline bool b2BroadPhase::TestOverlap(int32 proxyIdA, int32 proxyIdB) const -{ - const b2AABB& aabbA = m_tree.GetFatAABB(proxyIdA); - const b2AABB& aabbB = m_tree.GetFatAABB(proxyIdB); - return b2TestOverlap(aabbA, aabbB); -} - -inline const b2AABB& b2BroadPhase::GetFatAABB(int32 proxyId) const -{ - return m_tree.GetFatAABB(proxyId); -} - -inline int32 b2BroadPhase::GetProxyCount() const -{ - return m_proxyCount; -} - -inline int32 b2BroadPhase::GetTreeHeight() const -{ - return m_tree.GetHeight(); -} - -inline int32 b2BroadPhase::GetTreeBalance() const -{ - return m_tree.GetMaxBalance(); -} - -inline float32 b2BroadPhase::GetTreeQuality() const -{ - return m_tree.GetAreaRatio(); -} - -template -void b2BroadPhase::UpdatePairs(T* callback) -{ - // Reset pair buffer - m_pairCount = 0; - - // Perform tree queries for all moving proxies. - for (int32 i = 0; i < m_moveCount; ++i) - { - m_queryProxyId = m_moveBuffer[i]; - if (m_queryProxyId == e_nullProxy) - { - continue; - } - - // We have to query the tree with the fat AABB so that - // we don't fail to create a pair that may touch later. - const b2AABB& fatAABB = m_tree.GetFatAABB(m_queryProxyId); - - // Query tree, create pairs and add them pair buffer. - m_tree.Query(this, fatAABB); - } - - // Reset move buffer - m_moveCount = 0; - - // Sort the pair buffer to expose duplicates. - std::sort(m_pairBuffer, m_pairBuffer + m_pairCount, b2PairLessThan); - - // Send the pairs back to the client. - int32 i = 0; - while (i < m_pairCount) - { - b2Pair* primaryPair = m_pairBuffer + i; - void* userDataA = m_tree.GetUserData(primaryPair->proxyIdA); - void* userDataB = m_tree.GetUserData(primaryPair->proxyIdB); - - callback->AddPair(userDataA, userDataB); - ++i; - - // Skip any duplicate pairs. - while (i < m_pairCount) - { - b2Pair* pair = m_pairBuffer + i; - if (pair->proxyIdA != primaryPair->proxyIdA || pair->proxyIdB != primaryPair->proxyIdB) - { - break; - } - ++i; - } - } - - // Try to keep the tree balanced. - //m_tree.Rebalance(4); -} - -template -inline void b2BroadPhase::Query(T* callback, const b2AABB& aabb) const -{ - m_tree.Query(callback, aabb); -} - -template -inline void b2BroadPhase::RayCast(T* callback, const b2RayCastInput& input) const -{ - m_tree.RayCast(callback, input); -} - -#endif diff --git a/external/Box2D/Collision/b2CollideCircle.cpp b/external/Box2D/Collision/b2CollideCircle.cpp deleted file mode 100644 index ed561eb04b..0000000000 --- a/external/Box2D/Collision/b2CollideCircle.cpp +++ /dev/null @@ -1,154 +0,0 @@ -/* -* Copyright (c) 2007-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include - -void b2CollideCircles( - b2Manifold* manifold, - const b2CircleShape* circleA, const b2Transform& xfA, - const b2CircleShape* circleB, const b2Transform& xfB) -{ - manifold->pointCount = 0; - - b2Vec2 pA = b2Mul(xfA, circleA->m_p); - b2Vec2 pB = b2Mul(xfB, circleB->m_p); - - b2Vec2 d = pB - pA; - float32 distSqr = b2Dot(d, d); - float32 rA = circleA->m_radius, rB = circleB->m_radius; - float32 radius = rA + rB; - if (distSqr > radius * radius) - { - return; - } - - manifold->type = b2Manifold::e_circles; - manifold->localPoint = circleA->m_p; - manifold->localNormal.SetZero(); - manifold->pointCount = 1; - - manifold->points[0].localPoint = circleB->m_p; - manifold->points[0].id.key = 0; -} - -void b2CollidePolygonAndCircle( - b2Manifold* manifold, - const b2PolygonShape* polygonA, const b2Transform& xfA, - const b2CircleShape* circleB, const b2Transform& xfB) -{ - manifold->pointCount = 0; - - // Compute circle position in the frame of the polygon. - b2Vec2 c = b2Mul(xfB, circleB->m_p); - b2Vec2 cLocal = b2MulT(xfA, c); - - // Find the min separating edge. - int32 normalIndex = 0; - float32 separation = -b2_maxFloat; - float32 radius = polygonA->m_radius + circleB->m_radius; - int32 vertexCount = polygonA->m_vertexCount; - const b2Vec2* vertices = polygonA->m_vertices; - const b2Vec2* normals = polygonA->m_normals; - - for (int32 i = 0; i < vertexCount; ++i) - { - float32 s = b2Dot(normals[i], cLocal - vertices[i]); - - if (s > radius) - { - // Early out. - return; - } - - if (s > separation) - { - separation = s; - normalIndex = i; - } - } - - // Vertices that subtend the incident face. - int32 vertIndex1 = normalIndex; - int32 vertIndex2 = vertIndex1 + 1 < vertexCount ? vertIndex1 + 1 : 0; - b2Vec2 v1 = vertices[vertIndex1]; - b2Vec2 v2 = vertices[vertIndex2]; - - // If the center is inside the polygon ... - if (separation < b2_epsilon) - { - manifold->pointCount = 1; - manifold->type = b2Manifold::e_faceA; - manifold->localNormal = normals[normalIndex]; - manifold->localPoint = 0.5f * (v1 + v2); - manifold->points[0].localPoint = circleB->m_p; - manifold->points[0].id.key = 0; - return; - } - - // Compute barycentric coordinates - float32 u1 = b2Dot(cLocal - v1, v2 - v1); - float32 u2 = b2Dot(cLocal - v2, v1 - v2); - if (u1 <= 0.0f) - { - if (b2DistanceSquared(cLocal, v1) > radius * radius) - { - return; - } - - manifold->pointCount = 1; - manifold->type = b2Manifold::e_faceA; - manifold->localNormal = cLocal - v1; - manifold->localNormal.Normalize(); - manifold->localPoint = v1; - manifold->points[0].localPoint = circleB->m_p; - manifold->points[0].id.key = 0; - } - else if (u2 <= 0.0f) - { - if (b2DistanceSquared(cLocal, v2) > radius * radius) - { - return; - } - - manifold->pointCount = 1; - manifold->type = b2Manifold::e_faceA; - manifold->localNormal = cLocal - v2; - manifold->localNormal.Normalize(); - manifold->localPoint = v2; - manifold->points[0].localPoint = circleB->m_p; - manifold->points[0].id.key = 0; - } - else - { - b2Vec2 faceCenter = 0.5f * (v1 + v2); - float32 separation = b2Dot(cLocal - faceCenter, normals[vertIndex1]); - if (separation > radius) - { - return; - } - - manifold->pointCount = 1; - manifold->type = b2Manifold::e_faceA; - manifold->localNormal = normals[vertIndex1]; - manifold->localPoint = faceCenter; - manifold->points[0].localPoint = circleB->m_p; - manifold->points[0].id.key = 0; - } -} diff --git a/external/Box2D/Collision/b2CollideEdge.cpp b/external/Box2D/Collision/b2CollideEdge.cpp deleted file mode 100644 index 96ca71dccc..0000000000 --- a/external/Box2D/Collision/b2CollideEdge.cpp +++ /dev/null @@ -1,698 +0,0 @@ -/* - * Copyright (c) 2007-2009 Erin Catto http://www.box2d.org - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - */ - -#include -#include -#include -#include - - -// Compute contact points for edge versus circle. -// This accounts for edge connectivity. -void b2CollideEdgeAndCircle(b2Manifold* manifold, - const b2EdgeShape* edgeA, const b2Transform& xfA, - const b2CircleShape* circleB, const b2Transform& xfB) -{ - manifold->pointCount = 0; - - // Compute circle in frame of edge - b2Vec2 Q = b2MulT(xfA, b2Mul(xfB, circleB->m_p)); - - b2Vec2 A = edgeA->m_vertex1, B = edgeA->m_vertex2; - b2Vec2 e = B - A; - - // Barycentric coordinates - float32 u = b2Dot(e, B - Q); - float32 v = b2Dot(e, Q - A); - - float32 radius = edgeA->m_radius + circleB->m_radius; - - b2ContactFeature cf; - cf.indexB = 0; - cf.typeB = b2ContactFeature::e_vertex; - - // Region A - if (v <= 0.0f) - { - b2Vec2 P = A; - b2Vec2 d = Q - P; - float32 dd = b2Dot(d, d); - if (dd > radius * radius) - { - return; - } - - // Is there an edge connected to A? - if (edgeA->m_hasVertex0) - { - b2Vec2 A1 = edgeA->m_vertex0; - b2Vec2 B1 = A; - b2Vec2 e1 = B1 - A1; - float32 u1 = b2Dot(e1, B1 - Q); - - // Is the circle in Region AB of the previous edge? - if (u1 > 0.0f) - { - return; - } - } - - cf.indexA = 0; - cf.typeA = b2ContactFeature::e_vertex; - manifold->pointCount = 1; - manifold->type = b2Manifold::e_circles; - manifold->localNormal.SetZero(); - manifold->localPoint = P; - manifold->points[0].id.key = 0; - manifold->points[0].id.cf = cf; - manifold->points[0].localPoint = circleB->m_p; - return; - } - - // Region B - if (u <= 0.0f) - { - b2Vec2 P = B; - b2Vec2 d = Q - P; - float32 dd = b2Dot(d, d); - if (dd > radius * radius) - { - return; - } - - // Is there an edge connected to B? - if (edgeA->m_hasVertex3) - { - b2Vec2 B2 = edgeA->m_vertex3; - b2Vec2 A2 = B; - b2Vec2 e2 = B2 - A2; - float32 v2 = b2Dot(e2, Q - A2); - - // Is the circle in Region AB of the next edge? - if (v2 > 0.0f) - { - return; - } - } - - cf.indexA = 1; - cf.typeA = b2ContactFeature::e_vertex; - manifold->pointCount = 1; - manifold->type = b2Manifold::e_circles; - manifold->localNormal.SetZero(); - manifold->localPoint = P; - manifold->points[0].id.key = 0; - manifold->points[0].id.cf = cf; - manifold->points[0].localPoint = circleB->m_p; - return; - } - - // Region AB - float32 den = b2Dot(e, e); - b2Assert(den > 0.0f); - b2Vec2 P = (1.0f / den) * (u * A + v * B); - b2Vec2 d = Q - P; - float32 dd = b2Dot(d, d); - if (dd > radius * radius) - { - return; - } - - b2Vec2 n(-e.y, e.x); - if (b2Dot(n, Q - A) < 0.0f) - { - n.Set(-n.x, -n.y); - } - n.Normalize(); - - cf.indexA = 0; - cf.typeA = b2ContactFeature::e_face; - manifold->pointCount = 1; - manifold->type = b2Manifold::e_faceA; - manifold->localNormal = n; - manifold->localPoint = A; - manifold->points[0].id.key = 0; - manifold->points[0].id.cf = cf; - manifold->points[0].localPoint = circleB->m_p; -} - -// This structure is used to keep track of the best separating axis. -struct b2EPAxis -{ - enum Type - { - e_unknown, - e_edgeA, - e_edgeB - }; - - Type type; - int32 index; - float32 separation; -}; - -// This holds polygon B expressed in frame A. -struct b2TempPolygon -{ - b2Vec2 vertices[b2_maxPolygonVertices]; - b2Vec2 normals[b2_maxPolygonVertices]; - int32 count; -}; - -// Reference face used for clipping -struct b2ReferenceFace -{ - int32 i1, i2; - - b2Vec2 v1, v2; - - b2Vec2 normal; - - b2Vec2 sideNormal1; - float32 sideOffset1; - - b2Vec2 sideNormal2; - float32 sideOffset2; -}; - -// This class collides and edge and a polygon, taking into account edge adjacency. -struct b2EPCollider -{ - void Collide(b2Manifold* manifold, const b2EdgeShape* edgeA, const b2Transform& xfA, - const b2PolygonShape* polygonB, const b2Transform& xfB); - b2EPAxis ComputeEdgeSeparation(); - b2EPAxis ComputePolygonSeparation(); - - enum VertexType - { - e_isolated, - e_concave, - e_convex - }; - - b2TempPolygon m_polygonB; - - b2Transform m_xf; - b2Vec2 m_centroidB; - b2Vec2 m_v0, m_v1, m_v2, m_v3; - b2Vec2 m_normal0, m_normal1, m_normal2; - b2Vec2 m_normal; - VertexType m_type1, m_type2; - b2Vec2 m_lowerLimit, m_upperLimit; - float32 m_radius; - bool m_front; -}; - -// Algorithm: -// 1. Classify v1 and v2 -// 2. Classify polygon centroid as front or back -// 3. Flip normal if necessary -// 4. Initialize normal range to [-pi, pi] about face normal -// 5. Adjust normal range according to adjacent edges -// 6. Visit each separating axes, only accept axes within the range -// 7. Return if _any_ axis indicates separation -// 8. Clip -void b2EPCollider::Collide(b2Manifold* manifold, const b2EdgeShape* edgeA, const b2Transform& xfA, - const b2PolygonShape* polygonB, const b2Transform& xfB) -{ - m_xf = b2MulT(xfA, xfB); - - m_centroidB = b2Mul(m_xf, polygonB->m_centroid); - - m_v0 = edgeA->m_vertex0; - m_v1 = edgeA->m_vertex1; - m_v2 = edgeA->m_vertex2; - m_v3 = edgeA->m_vertex3; - - bool hasVertex0 = edgeA->m_hasVertex0; - bool hasVertex3F = edgeA->m_hasVertex3; - - b2Vec2 edge1 = m_v2 - m_v1; - edge1.Normalize(); - m_normal1.Set(edge1.y, -edge1.x); - float32 offset1 = b2Dot(m_normal1, m_centroidB - m_v1); - float32 offset0 = 0.0f, offset2 = 0.0f; - bool convex1 = false, convex2 = false; - - // Is there a preceding edge? - if (hasVertex0) - { - b2Vec2 edge0 = m_v1 - m_v0; - edge0.Normalize(); - m_normal0.Set(edge0.y, -edge0.x); - convex1 = b2Cross(edge0, edge1) >= 0.0f; - offset0 = b2Dot(m_normal0, m_centroidB - m_v0); - } - - // Is there a following edge? - if (hasVertex3F) - { - b2Vec2 edge2 = m_v3 - m_v2; - edge2.Normalize(); - m_normal2.Set(edge2.y, -edge2.x); - convex2 = b2Cross(edge1, edge2) > 0.0f; - offset2 = b2Dot(m_normal2, m_centroidB - m_v2); - } - - // Determine front or back collision. Determine collision normal limits. - if (hasVertex0 && hasVertex3F) - { - if (convex1 && convex2) - { - m_front = offset0 >= 0.0f || offset1 >= 0.0f || offset2 >= 0.0f; - if (m_front) - { - m_normal = m_normal1; - m_lowerLimit = m_normal0; - m_upperLimit = m_normal2; - } - else - { - m_normal = -m_normal1; - m_lowerLimit = -m_normal1; - m_upperLimit = -m_normal1; - } - } - else if (convex1) - { - m_front = offset0 >= 0.0f || (offset1 >= 0.0f && offset2 >= 0.0f); - if (m_front) - { - m_normal = m_normal1; - m_lowerLimit = m_normal0; - m_upperLimit = m_normal1; - } - else - { - m_normal = -m_normal1; - m_lowerLimit = -m_normal2; - m_upperLimit = -m_normal1; - } - } - else if (convex2) - { - m_front = offset2 >= 0.0f || (offset0 >= 0.0f && offset1 >= 0.0f); - if (m_front) - { - m_normal = m_normal1; - m_lowerLimit = m_normal1; - m_upperLimit = m_normal2; - } - else - { - m_normal = -m_normal1; - m_lowerLimit = -m_normal1; - m_upperLimit = -m_normal0; - } - } - else - { - m_front = offset0 >= 0.0f && offset1 >= 0.0f && offset2 >= 0.0f; - if (m_front) - { - m_normal = m_normal1; - m_lowerLimit = m_normal1; - m_upperLimit = m_normal1; - } - else - { - m_normal = -m_normal1; - m_lowerLimit = -m_normal2; - m_upperLimit = -m_normal0; - } - } - } - else if (hasVertex0) - { - if (convex1) - { - m_front = offset0 >= 0.0f || offset1 >= 0.0f; - if (m_front) - { - m_normal = m_normal1; - m_lowerLimit = m_normal0; - m_upperLimit = -m_normal1; - } - else - { - m_normal = -m_normal1; - m_lowerLimit = m_normal1; - m_upperLimit = -m_normal1; - } - } - else - { - m_front = offset0 >= 0.0f && offset1 >= 0.0f; - if (m_front) - { - m_normal = m_normal1; - m_lowerLimit = m_normal1; - m_upperLimit = -m_normal1; - } - else - { - m_normal = -m_normal1; - m_lowerLimit = m_normal1; - m_upperLimit = -m_normal0; - } - } - } - else if (hasVertex3F) - { - if (convex2) - { - m_front = offset1 >= 0.0f || offset2 >= 0.0f; - if (m_front) - { - m_normal = m_normal1; - m_lowerLimit = -m_normal1; - m_upperLimit = m_normal2; - } - else - { - m_normal = -m_normal1; - m_lowerLimit = -m_normal1; - m_upperLimit = m_normal1; - } - } - else - { - m_front = offset1 >= 0.0f && offset2 >= 0.0f; - if (m_front) - { - m_normal = m_normal1; - m_lowerLimit = -m_normal1; - m_upperLimit = m_normal1; - } - else - { - m_normal = -m_normal1; - m_lowerLimit = -m_normal2; - m_upperLimit = m_normal1; - } - } - } - else - { - m_front = offset1 >= 0.0f; - if (m_front) - { - m_normal = m_normal1; - m_lowerLimit = -m_normal1; - m_upperLimit = -m_normal1; - } - else - { - m_normal = -m_normal1; - m_lowerLimit = m_normal1; - m_upperLimit = m_normal1; - } - } - - // Get polygonB in frameA - m_polygonB.count = polygonB->m_vertexCount; - for (int32 i = 0; i < polygonB->m_vertexCount; ++i) - { - m_polygonB.vertices[i] = b2Mul(m_xf, polygonB->m_vertices[i]); - m_polygonB.normals[i] = b2Mul(m_xf.q, polygonB->m_normals[i]); - } - - m_radius = 2.0f * b2_polygonRadius; - - manifold->pointCount = 0; - - b2EPAxis edgeAxis = ComputeEdgeSeparation(); - - // If no valid normal can be found than this edge should not collide. - if (edgeAxis.type == b2EPAxis::e_unknown) - { - return; - } - - if (edgeAxis.separation > m_radius) - { - return; - } - - b2EPAxis polygonAxis = ComputePolygonSeparation(); - if (polygonAxis.type != b2EPAxis::e_unknown && polygonAxis.separation > m_radius) - { - return; - } - - // Use hysteresis for jitter reduction. - const float32 k_relativeTol = 0.98f; - const float32 k_absoluteTol = 0.001f; - - b2EPAxis primaryAxis; - if (polygonAxis.type == b2EPAxis::e_unknown) - { - primaryAxis = edgeAxis; - } - else if (polygonAxis.separation > k_relativeTol * edgeAxis.separation + k_absoluteTol) - { - primaryAxis = polygonAxis; - } - else - { - primaryAxis = edgeAxis; - } - - b2ClipVertex ie[2]; - b2ReferenceFace rf; - if (primaryAxis.type == b2EPAxis::e_edgeA) - { - manifold->type = b2Manifold::e_faceA; - - // Search for the polygon normal that is most anti-parallel to the edge normal. - int32 bestIndex = 0; - float32 bestValue = b2Dot(m_normal, m_polygonB.normals[0]); - for (int32 i = 1; i < m_polygonB.count; ++i) - { - float32 value = b2Dot(m_normal, m_polygonB.normals[i]); - if (value < bestValue) - { - bestValue = value; - bestIndex = i; - } - } - - int32 i1 = bestIndex; - int32 i2 = i1 + 1 < m_polygonB.count ? i1 + 1 : 0; - - ie[0].v = m_polygonB.vertices[i1]; - ie[0].id.cf.indexA = 0; - ie[0].id.cf.indexB = i1; - ie[0].id.cf.typeA = b2ContactFeature::e_face; - ie[0].id.cf.typeB = b2ContactFeature::e_vertex; - - ie[1].v = m_polygonB.vertices[i2]; - ie[1].id.cf.indexA = 0; - ie[1].id.cf.indexB = i2; - ie[1].id.cf.typeA = b2ContactFeature::e_face; - ie[1].id.cf.typeB = b2ContactFeature::e_vertex; - - if (m_front) - { - rf.i1 = 0; - rf.i2 = 1; - rf.v1 = m_v1; - rf.v2 = m_v2; - rf.normal = m_normal1; - } - else - { - rf.i1 = 1; - rf.i2 = 0; - rf.v1 = m_v2; - rf.v2 = m_v1; - rf.normal = -m_normal1; - } - } - else - { - manifold->type = b2Manifold::e_faceB; - - ie[0].v = m_v1; - ie[0].id.cf.indexA = 0; - ie[0].id.cf.indexB = primaryAxis.index; - ie[0].id.cf.typeA = b2ContactFeature::e_vertex; - ie[0].id.cf.typeB = b2ContactFeature::e_face; - - ie[1].v = m_v2; - ie[1].id.cf.indexA = 0; - ie[1].id.cf.indexB = primaryAxis.index; - ie[1].id.cf.typeA = b2ContactFeature::e_vertex; - ie[1].id.cf.typeB = b2ContactFeature::e_face; - - rf.i1 = primaryAxis.index; - rf.i2 = rf.i1 + 1 < m_polygonB.count ? rf.i1 + 1 : 0; - rf.v1 = m_polygonB.vertices[rf.i1]; - rf.v2 = m_polygonB.vertices[rf.i2]; - rf.normal = m_polygonB.normals[rf.i1]; - } - - rf.sideNormal1.Set(rf.normal.y, -rf.normal.x); - rf.sideNormal2 = -rf.sideNormal1; - rf.sideOffset1 = b2Dot(rf.sideNormal1, rf.v1); - rf.sideOffset2 = b2Dot(rf.sideNormal2, rf.v2); - - // Clip incident edge against extruded edge1 side edges. - b2ClipVertex clipPoints1[2]; - b2ClipVertex clipPoints2[2]; - int32 np; - - // Clip to box side 1 - np = b2ClipSegmentToLine(clipPoints1, ie, rf.sideNormal1, rf.sideOffset1, rf.i1); - - if (np < b2_maxManifoldPoints) - { - return; - } - - // Clip to negative box side 1 - np = b2ClipSegmentToLine(clipPoints2, clipPoints1, rf.sideNormal2, rf.sideOffset2, rf.i2); - - if (np < b2_maxManifoldPoints) - { - return; - } - - // Now clipPoints2 contains the clipped points. - if (primaryAxis.type == b2EPAxis::e_edgeA) - { - manifold->localNormal = rf.normal; - manifold->localPoint = rf.v1; - } - else - { - manifold->localNormal = polygonB->m_normals[rf.i1]; - manifold->localPoint = polygonB->m_vertices[rf.i1]; - } - - int32 pointCount = 0; - for (int32 i = 0; i < b2_maxManifoldPoints; ++i) - { - float32 separation; - - separation = b2Dot(rf.normal, clipPoints2[i].v - rf.v1); - - if (separation <= m_radius) - { - b2ManifoldPoint* cp = manifold->points + pointCount; - - if (primaryAxis.type == b2EPAxis::e_edgeA) - { - cp->localPoint = b2MulT(m_xf, clipPoints2[i].v); - cp->id = clipPoints2[i].id; - } - else - { - cp->localPoint = clipPoints2[i].v; - cp->id.cf.typeA = clipPoints2[i].id.cf.typeB; - cp->id.cf.typeB = clipPoints2[i].id.cf.typeA; - cp->id.cf.indexA = clipPoints2[i].id.cf.indexB; - cp->id.cf.indexB = clipPoints2[i].id.cf.indexA; - } - - ++pointCount; - } - } - - manifold->pointCount = pointCount; -} - -b2EPAxis b2EPCollider::ComputeEdgeSeparation() -{ - b2EPAxis axis; - axis.type = b2EPAxis::e_edgeA; - axis.index = m_front ? 0 : 1; - axis.separation = FLT_MAX; - - for (int32 i = 0; i < m_polygonB.count; ++i) - { - float32 s = b2Dot(m_normal, m_polygonB.vertices[i] - m_v1); - if (s < axis.separation) - { - axis.separation = s; - } - } - - return axis; -} - -b2EPAxis b2EPCollider::ComputePolygonSeparation() -{ - b2EPAxis axis; - axis.type = b2EPAxis::e_unknown; - axis.index = -1; - axis.separation = -FLT_MAX; - - b2Vec2 perp(-m_normal.y, m_normal.x); - - for (int32 i = 0; i < m_polygonB.count; ++i) - { - b2Vec2 n = -m_polygonB.normals[i]; - - float32 s1 = b2Dot(n, m_polygonB.vertices[i] - m_v1); - float32 s2 = b2Dot(n, m_polygonB.vertices[i] - m_v2); - float32 s = b2Min(s1, s2); - - if (s > m_radius) - { - // No collision - axis.type = b2EPAxis::e_edgeB; - axis.index = i; - axis.separation = s; - return axis; - } - - // Adjacency - if (b2Dot(n, perp) >= 0.0f) - { - if (b2Dot(n - m_upperLimit, m_normal) < -b2_angularSlop) - { - continue; - } - } - else - { - if (b2Dot(n - m_lowerLimit, m_normal) < -b2_angularSlop) - { - continue; - } - } - - if (s > axis.separation) - { - axis.type = b2EPAxis::e_edgeB; - axis.index = i; - axis.separation = s; - } - } - - return axis; -} - -void b2CollideEdgeAndPolygon( b2Manifold* manifold, - const b2EdgeShape* edgeA, const b2Transform& xfA, - const b2PolygonShape* polygonB, const b2Transform& xfB) -{ - b2EPCollider collider; - collider.Collide(manifold, edgeA, xfA, polygonB, xfB); -} diff --git a/external/Box2D/Collision/b2CollidePolygon.cpp b/external/Box2D/Collision/b2CollidePolygon.cpp deleted file mode 100644 index be2518d966..0000000000 --- a/external/Box2D/Collision/b2CollidePolygon.cpp +++ /dev/null @@ -1,317 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include - -// Find the separation between poly1 and poly2 for a give edge normal on poly1. -static float32 b2EdgeSeparation(const b2PolygonShape* poly1, const b2Transform& xf1, int32 edge1, - const b2PolygonShape* poly2, const b2Transform& xf2) -{ - const b2Vec2* vertices1 = poly1->m_vertices; - const b2Vec2* normals1 = poly1->m_normals; - - int32 count2 = poly2->m_vertexCount; - const b2Vec2* vertices2 = poly2->m_vertices; - - b2Assert(0 <= edge1 && edge1 < poly1->m_vertexCount); - - // Convert normal from poly1's frame into poly2's frame. - b2Vec2 normal1World = b2Mul(xf1.q, normals1[edge1]); - b2Vec2 normal1 = b2MulT(xf2.q, normal1World); - - // Find support vertex on poly2 for -normal. - int32 index = 0; - float32 minDot = b2_maxFloat; - - for (int32 i = 0; i < count2; ++i) - { - float32 dot = b2Dot(vertices2[i], normal1); - if (dot < minDot) - { - minDot = dot; - index = i; - } - } - - b2Vec2 v1 = b2Mul(xf1, vertices1[edge1]); - b2Vec2 v2 = b2Mul(xf2, vertices2[index]); - float32 separation = b2Dot(v2 - v1, normal1World); - return separation; -} - -// Find the max separation between poly1 and poly2 using edge normals from poly1. -static float32 b2FindMaxSeparation(int32* edgeIndex, - const b2PolygonShape* poly1, const b2Transform& xf1, - const b2PolygonShape* poly2, const b2Transform& xf2) -{ - int32 count1 = poly1->m_vertexCount; - const b2Vec2* normals1 = poly1->m_normals; - - // Vector pointing from the centroid of poly1 to the centroid of poly2. - b2Vec2 d = b2Mul(xf2, poly2->m_centroid) - b2Mul(xf1, poly1->m_centroid); - b2Vec2 dLocal1 = b2MulT(xf1.q, d); - - // Find edge normal on poly1 that has the largest projection onto d. - int32 edge = 0; - float32 maxDot = -b2_maxFloat; - for (int32 i = 0; i < count1; ++i) - { - float32 dot = b2Dot(normals1[i], dLocal1); - if (dot > maxDot) - { - maxDot = dot; - edge = i; - } - } - - // Get the separation for the edge normal. - float32 s = b2EdgeSeparation(poly1, xf1, edge, poly2, xf2); - - // Check the separation for the previous edge normal. - int32 prevEdge = edge - 1 >= 0 ? edge - 1 : count1 - 1; - float32 sPrev = b2EdgeSeparation(poly1, xf1, prevEdge, poly2, xf2); - - // Check the separation for the next edge normal. - int32 nextEdge = edge + 1 < count1 ? edge + 1 : 0; - float32 sNext = b2EdgeSeparation(poly1, xf1, nextEdge, poly2, xf2); - - // Find the best edge and the search direction. - int32 bestEdge; - float32 bestSeparation; - int32 increment; - if (sPrev > s && sPrev > sNext) - { - increment = -1; - bestEdge = prevEdge; - bestSeparation = sPrev; - } - else if (sNext > s) - { - increment = 1; - bestEdge = nextEdge; - bestSeparation = sNext; - } - else - { - *edgeIndex = edge; - return s; - } - - // Perform a local search for the best edge normal. - for ( ; ; ) - { - if (increment == -1) - edge = bestEdge - 1 >= 0 ? bestEdge - 1 : count1 - 1; - else - edge = bestEdge + 1 < count1 ? bestEdge + 1 : 0; - - s = b2EdgeSeparation(poly1, xf1, edge, poly2, xf2); - - if (s > bestSeparation) - { - bestEdge = edge; - bestSeparation = s; - } - else - { - break; - } - } - - *edgeIndex = bestEdge; - return bestSeparation; -} - -static void b2FindIncidentEdge(b2ClipVertex c[2], - const b2PolygonShape* poly1, const b2Transform& xf1, int32 edge1, - const b2PolygonShape* poly2, const b2Transform& xf2) -{ - const b2Vec2* normals1 = poly1->m_normals; - - int32 count2 = poly2->m_vertexCount; - const b2Vec2* vertices2 = poly2->m_vertices; - const b2Vec2* normals2 = poly2->m_normals; - - b2Assert(0 <= edge1 && edge1 < poly1->m_vertexCount); - - // Get the normal of the reference edge in poly2's frame. - b2Vec2 normal1 = b2MulT(xf2.q, b2Mul(xf1.q, normals1[edge1])); - - // Find the incident edge on poly2. - int32 index = 0; - float32 minDot = b2_maxFloat; - for (int32 i = 0; i < count2; ++i) - { - float32 dot = b2Dot(normal1, normals2[i]); - if (dot < minDot) - { - minDot = dot; - index = i; - } - } - - // Build the clip vertices for the incident edge. - int32 i1 = index; - int32 i2 = i1 + 1 < count2 ? i1 + 1 : 0; - - c[0].v = b2Mul(xf2, vertices2[i1]); - c[0].id.cf.indexA = (uint8)edge1; - c[0].id.cf.indexB = (uint8)i1; - c[0].id.cf.typeA = b2ContactFeature::e_face; - c[0].id.cf.typeB = b2ContactFeature::e_vertex; - - c[1].v = b2Mul(xf2, vertices2[i2]); - c[1].id.cf.indexA = (uint8)edge1; - c[1].id.cf.indexB = (uint8)i2; - c[1].id.cf.typeA = b2ContactFeature::e_face; - c[1].id.cf.typeB = b2ContactFeature::e_vertex; -} - -// Find edge normal of max separation on A - return if separating axis is found -// Find edge normal of max separation on B - return if separation axis is found -// Choose reference edge as min(minA, minB) -// Find incident edge -// Clip - -// The normal points from 1 to 2 -void b2CollidePolygons(b2Manifold* manifold, - const b2PolygonShape* polyA, const b2Transform& xfA, - const b2PolygonShape* polyB, const b2Transform& xfB) -{ - manifold->pointCount = 0; - float32 totalRadius = polyA->m_radius + polyB->m_radius; - - int32 edgeA = 0; - float32 separationA = b2FindMaxSeparation(&edgeA, polyA, xfA, polyB, xfB); - if (separationA > totalRadius) - return; - - int32 edgeB = 0; - float32 separationB = b2FindMaxSeparation(&edgeB, polyB, xfB, polyA, xfA); - if (separationB > totalRadius) - return; - - const b2PolygonShape* poly1; // reference polygon - const b2PolygonShape* poly2; // incident polygon - b2Transform xf1, xf2; - int32 edge1; // reference edge - uint8 flip; - const float32 k_relativeTol = 0.98f; - const float32 k_absoluteTol = 0.001f; - - if (separationB > k_relativeTol * separationA + k_absoluteTol) - { - poly1 = polyB; - poly2 = polyA; - xf1 = xfB; - xf2 = xfA; - edge1 = edgeB; - manifold->type = b2Manifold::e_faceB; - flip = 1; - } - else - { - poly1 = polyA; - poly2 = polyB; - xf1 = xfA; - xf2 = xfB; - edge1 = edgeA; - manifold->type = b2Manifold::e_faceA; - flip = 0; - } - - b2ClipVertex incidentEdge[2]; - b2FindIncidentEdge(incidentEdge, poly1, xf1, edge1, poly2, xf2); - - int32 count1 = poly1->m_vertexCount; - const b2Vec2* vertices1 = poly1->m_vertices; - - int32 iv1 = edge1; - int32 iv2 = edge1 + 1 < count1 ? edge1 + 1 : 0; - - b2Vec2 v11 = vertices1[iv1]; - b2Vec2 v12 = vertices1[iv2]; - - b2Vec2 localTangent = v12 - v11; - localTangent.Normalize(); - - b2Vec2 localNormal = b2Cross(localTangent, 1.0f); - b2Vec2 planePoint = 0.5f * (v11 + v12); - - b2Vec2 tangent = b2Mul(xf1.q, localTangent); - b2Vec2 normal = b2Cross(tangent, 1.0f); - - v11 = b2Mul(xf1, v11); - v12 = b2Mul(xf1, v12); - - // Face offset. - float32 frontOffset = b2Dot(normal, v11); - - // Side offsets, extended by polytope skin thickness. - float32 sideOffset1 = -b2Dot(tangent, v11) + totalRadius; - float32 sideOffset2 = b2Dot(tangent, v12) + totalRadius; - - // Clip incident edge against extruded edge1 side edges. - b2ClipVertex clipPoints1[2]; - b2ClipVertex clipPoints2[2]; - int np; - - // Clip to box side 1 - np = b2ClipSegmentToLine(clipPoints1, incidentEdge, -tangent, sideOffset1, iv1); - - if (np < 2) - return; - - // Clip to negative box side 1 - np = b2ClipSegmentToLine(clipPoints2, clipPoints1, tangent, sideOffset2, iv2); - - if (np < 2) - { - return; - } - - // Now clipPoints2 contains the clipped points. - manifold->localNormal = localNormal; - manifold->localPoint = planePoint; - - int32 pointCount = 0; - for (int32 i = 0; i < b2_maxManifoldPoints; ++i) - { - float32 separation = b2Dot(normal, clipPoints2[i].v) - frontOffset; - - if (separation <= totalRadius) - { - b2ManifoldPoint* cp = manifold->points + pointCount; - cp->localPoint = b2MulT(xf2, clipPoints2[i].v); - cp->id = clipPoints2[i].id; - if (flip) - { - // Swap features - b2ContactFeature cf = cp->id.cf; - cp->id.cf.indexA = cf.indexB; - cp->id.cf.indexB = cf.indexA; - cp->id.cf.typeA = cf.typeB; - cp->id.cf.typeB = cf.typeA; - } - ++pointCount; - } - } - - manifold->pointCount = pointCount; -} diff --git a/external/Box2D/Collision/b2Collision.cpp b/external/Box2D/Collision/b2Collision.cpp deleted file mode 100644 index 2dd5ff0ab6..0000000000 --- a/external/Box2D/Collision/b2Collision.cpp +++ /dev/null @@ -1,249 +0,0 @@ -/* -* Copyright (c) 2007-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include - -void b2WorldManifold::Initialize(const b2Manifold* manifold, - const b2Transform& xfA, float32 radiusA, - const b2Transform& xfB, float32 radiusB) -{ - if (manifold->pointCount == 0) - { - return; - } - - switch (manifold->type) - { - case b2Manifold::e_circles: - { - normal.Set(1.0f, 0.0f); - b2Vec2 pointA = b2Mul(xfA, manifold->localPoint); - b2Vec2 pointB = b2Mul(xfB, manifold->points[0].localPoint); - if (b2DistanceSquared(pointA, pointB) > b2_epsilon * b2_epsilon) - { - normal = pointB - pointA; - normal.Normalize(); - } - - b2Vec2 cA = pointA + radiusA * normal; - b2Vec2 cB = pointB - radiusB * normal; - points[0] = 0.5f * (cA + cB); - } - break; - - case b2Manifold::e_faceA: - { - normal = b2Mul(xfA.q, manifold->localNormal); - b2Vec2 planePoint = b2Mul(xfA, manifold->localPoint); - - for (int32 i = 0; i < manifold->pointCount; ++i) - { - b2Vec2 clipPoint = b2Mul(xfB, manifold->points[i].localPoint); - b2Vec2 cA = clipPoint + (radiusA - b2Dot(clipPoint - planePoint, normal)) * normal; - b2Vec2 cB = clipPoint - radiusB * normal; - points[i] = 0.5f * (cA + cB); - } - } - break; - - case b2Manifold::e_faceB: - { - normal = b2Mul(xfB.q, manifold->localNormal); - b2Vec2 planePoint = b2Mul(xfB, manifold->localPoint); - - for (int32 i = 0; i < manifold->pointCount; ++i) - { - b2Vec2 clipPoint = b2Mul(xfA, manifold->points[i].localPoint); - b2Vec2 cB = clipPoint + (radiusB - b2Dot(clipPoint - planePoint, normal)) * normal; - b2Vec2 cA = clipPoint - radiusA * normal; - points[i] = 0.5f * (cA + cB); - } - - // Ensure normal points from A to B. - normal = -normal; - } - break; - } -} - -void b2GetPointStates(b2PointState state1[b2_maxManifoldPoints], b2PointState state2[b2_maxManifoldPoints], - const b2Manifold* manifold1, const b2Manifold* manifold2) -{ - for (int32 i = 0; i < b2_maxManifoldPoints; ++i) - { - state1[i] = b2_nullState; - state2[i] = b2_nullState; - } - - // Detect persists and removes. - for (int32 i = 0; i < manifold1->pointCount; ++i) - { - b2ContactID id = manifold1->points[i].id; - - state1[i] = b2_removeState; - - for (int32 j = 0; j < manifold2->pointCount; ++j) - { - if (manifold2->points[j].id.key == id.key) - { - state1[i] = b2_persistState; - break; - } - } - } - - // Detect persists and adds. - for (int32 i = 0; i < manifold2->pointCount; ++i) - { - b2ContactID id = manifold2->points[i].id; - - state2[i] = b2_addState; - - for (int32 j = 0; j < manifold1->pointCount; ++j) - { - if (manifold1->points[j].id.key == id.key) - { - state2[i] = b2_persistState; - break; - } - } - } -} - -// From Real-time Collision Detection, p179. -bool b2AABB::RayCast(b2RayCastOutput* output, const b2RayCastInput& input) const -{ - float32 tmin = -b2_maxFloat; - float32 tmax = b2_maxFloat; - - b2Vec2 p = input.p1; - b2Vec2 d = input.p2 - input.p1; - b2Vec2 absD = b2Abs(d); - - b2Vec2 normal; - - for (int32 i = 0; i < 2; ++i) - { - if (absD(i) < b2_epsilon) - { - // Parallel. - if (p(i) < lowerBound(i) || upperBound(i) < p(i)) - { - return false; - } - } - else - { - float32 inv_d = 1.0f / d(i); - float32 t1 = (lowerBound(i) - p(i)) * inv_d; - float32 t2 = (upperBound(i) - p(i)) * inv_d; - - // Sign of the normal vector. - float32 s = -1.0f; - - if (t1 > t2) - { - b2Swap(t1, t2); - s = 1.0f; - } - - // Push the min up - if (t1 > tmin) - { - normal.SetZero(); - normal(i) = s; - tmin = t1; - } - - // Pull the max down - tmax = b2Min(tmax, t2); - - if (tmin > tmax) - { - return false; - } - } - } - - // Does the ray start inside the box? - // Does the ray intersect beyond the max fraction? - if (tmin < 0.0f || input.maxFraction < tmin) - { - return false; - } - - // Intersection. - output->fraction = tmin; - output->normal = normal; - return true; -} - -// Sutherland-Hodgman clipping. -int32 b2ClipSegmentToLine(b2ClipVertex vOut[2], const b2ClipVertex vIn[2], - const b2Vec2& normal, float32 offset, int32 vertexIndexA) -{ - // Start with no output points - int32 numOut = 0; - - // Calculate the distance of end points to the line - float32 distance0 = b2Dot(normal, vIn[0].v) - offset; - float32 distance1 = b2Dot(normal, vIn[1].v) - offset; - - // If the points are behind the plane - if (distance0 <= 0.0f) vOut[numOut++] = vIn[0]; - if (distance1 <= 0.0f) vOut[numOut++] = vIn[1]; - - // If the points are on different sides of the plane - if (distance0 * distance1 < 0.0f) - { - // Find intersection point of edge and plane - float32 interp = distance0 / (distance0 - distance1); - vOut[numOut].v = vIn[0].v + interp * (vIn[1].v - vIn[0].v); - - // VertexA is hitting edgeB. - vOut[numOut].id.cf.indexA = vertexIndexA; - vOut[numOut].id.cf.indexB = vIn[0].id.cf.indexB; - vOut[numOut].id.cf.typeA = b2ContactFeature::e_vertex; - vOut[numOut].id.cf.typeB = b2ContactFeature::e_face; - ++numOut; - } - - return numOut; -} - -bool b2TestOverlap( const b2Shape* shapeA, int32 indexA, - const b2Shape* shapeB, int32 indexB, - const b2Transform& xfA, const b2Transform& xfB) -{ - b2DistanceInput input; - input.proxyA.Set(shapeA, indexA); - input.proxyB.Set(shapeB, indexB); - input.transformA = xfA; - input.transformB = xfB; - input.useRadii = true; - - b2SimplexCache cache; - cache.count = 0; - - b2DistanceOutput output; - - b2Distance(&output, &cache, &input); - - return output.distance < 10.0f * b2_epsilon; -} diff --git a/external/Box2D/Collision/b2Collision.h b/external/Box2D/Collision/b2Collision.h deleted file mode 100644 index 2e7386232b..0000000000 --- a/external/Box2D/Collision/b2Collision.h +++ /dev/null @@ -1,276 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_COLLISION_H -#define B2_COLLISION_H - -#include -#include - -/// @file -/// Structures and functions used for computing contact points, distance -/// queries, and TOI queries. - -class b2Shape; -class b2CircleShape; -class b2EdgeShape; -class b2PolygonShape; - -const uint8 b2_nullFeature = UCHAR_MAX; - -/// The features that intersect to form the contact point -/// This must be 4 bytes or less. -struct b2ContactFeature -{ - enum Type - { - e_vertex = 0, - e_face = 1 - }; - - uint8 indexA; ///< Feature index on shapeA - uint8 indexB; ///< Feature index on shapeB - uint8 typeA; ///< The feature type on shapeA - uint8 typeB; ///< The feature type on shapeB -}; - -/// Contact ids to facilitate warm starting. -union b2ContactID -{ - b2ContactFeature cf; - uint32 key; ///< Used to quickly compare contact ids. -}; - -/// A manifold point is a contact point belonging to a contact -/// manifold. It holds details related to the geometry and dynamics -/// of the contact points. -/// The local point usage depends on the manifold type: -/// -e_circles: the local center of circleB -/// -e_faceA: the local center of cirlceB or the clip point of polygonB -/// -e_faceB: the clip point of polygonA -/// This structure is stored across time steps, so we keep it small. -/// Note: the impulses are used for internal caching and may not -/// provide reliable contact forces, especially for high speed collisions. -struct b2ManifoldPoint -{ - b2Vec2 localPoint; ///< usage depends on manifold type - float32 normalImpulse; ///< the non-penetration impulse - float32 tangentImpulse; ///< the friction impulse - b2ContactID id; ///< uniquely identifies a contact point between two shapes -}; - -/// A manifold for two touching convex shapes. -/// Box2D supports multiple types of contact: -/// - clip point versus plane with radius -/// - point versus point with radius (circles) -/// The local point usage depends on the manifold type: -/// -e_circles: the local center of circleA -/// -e_faceA: the center of faceA -/// -e_faceB: the center of faceB -/// Similarly the local normal usage: -/// -e_circles: not used -/// -e_faceA: the normal on polygonA -/// -e_faceB: the normal on polygonB -/// We store contacts in this way so that position correction can -/// account for movement, which is critical for continuous physics. -/// All contact scenarios must be expressed in one of these types. -/// This structure is stored across time steps, so we keep it small. -struct b2Manifold -{ - enum Type - { - e_circles, - e_faceA, - e_faceB - }; - - b2ManifoldPoint points[b2_maxManifoldPoints]; ///< the points of contact - b2Vec2 localNormal; ///< not use for Type::e_points - b2Vec2 localPoint; ///< usage depends on manifold type - Type type; - int32 pointCount; ///< the number of manifold points -}; - -/// This is used to compute the current state of a contact manifold. -struct b2WorldManifold -{ - /// Evaluate the manifold with supplied transforms. This assumes - /// modest motion from the original state. This does not change the - /// point count, impulses, etc. The radii must come from the shapes - /// that generated the manifold. - void Initialize(const b2Manifold* manifold, - const b2Transform& xfA, float32 radiusA, - const b2Transform& xfB, float32 radiusB); - - b2Vec2 normal; ///< world vector pointing from A to B - b2Vec2 points[b2_maxManifoldPoints]; ///< world contact point (point of intersection) -}; - -/// This is used for determining the state of contact points. -enum b2PointState -{ - b2_nullState, ///< point does not exist - b2_addState, ///< point was added in the update - b2_persistState, ///< point persisted across the update - b2_removeState ///< point was removed in the update -}; - -/// Compute the point states given two manifolds. The states pertain to the transition from manifold1 -/// to manifold2. So state1 is either persist or remove while state2 is either add or persist. -void b2GetPointStates(b2PointState state1[b2_maxManifoldPoints], b2PointState state2[b2_maxManifoldPoints], - const b2Manifold* manifold1, const b2Manifold* manifold2); - -/// Used for computing contact manifolds. -struct b2ClipVertex -{ - b2Vec2 v; - b2ContactID id; -}; - -/// Ray-cast input data. The ray extends from p1 to p1 + maxFraction * (p2 - p1). -struct b2RayCastInput -{ - b2Vec2 p1, p2; - float32 maxFraction; -}; - -/// Ray-cast output data. The ray hits at p1 + fraction * (p2 - p1), where p1 and p2 -/// come from b2RayCastInput. -struct b2RayCastOutput -{ - b2Vec2 normal; - float32 fraction; -}; - -/// An axis aligned bounding box. -struct b2AABB -{ - /// Verify that the bounds are sorted. - bool IsValid() const; - - /// Get the center of the AABB. - b2Vec2 GetCenter() const - { - return 0.5f * (lowerBound + upperBound); - } - - /// Get the extents of the AABB (half-widths). - b2Vec2 GetExtents() const - { - return 0.5f * (upperBound - lowerBound); - } - - /// Get the perimeter length - float32 GetPerimeter() const - { - float32 wx = upperBound.x - lowerBound.x; - float32 wy = upperBound.y - lowerBound.y; - return 2.0f * (wx + wy); - } - - /// Combine an AABB into this one. - void Combine(const b2AABB& aabb) - { - lowerBound = b2Min(lowerBound, aabb.lowerBound); - upperBound = b2Max(upperBound, aabb.upperBound); - } - - /// Combine two AABBs into this one. - void Combine(const b2AABB& aabb1, const b2AABB& aabb2) - { - lowerBound = b2Min(aabb1.lowerBound, aabb2.lowerBound); - upperBound = b2Max(aabb1.upperBound, aabb2.upperBound); - } - - /// Does this aabb contain the provided AABB. - bool Contains(const b2AABB& aabb) const - { - bool result = true; - result = result && lowerBound.x <= aabb.lowerBound.x; - result = result && lowerBound.y <= aabb.lowerBound.y; - result = result && aabb.upperBound.x <= upperBound.x; - result = result && aabb.upperBound.y <= upperBound.y; - return result; - } - - bool RayCast(b2RayCastOutput* output, const b2RayCastInput& input) const; - - b2Vec2 lowerBound; ///< the lower vertex - b2Vec2 upperBound; ///< the upper vertex -}; - -/// Compute the collision manifold between two circles. -void b2CollideCircles(b2Manifold* manifold, - const b2CircleShape* circleA, const b2Transform& xfA, - const b2CircleShape* circleB, const b2Transform& xfB); - -/// Compute the collision manifold between a polygon and a circle. -void b2CollidePolygonAndCircle(b2Manifold* manifold, - const b2PolygonShape* polygonA, const b2Transform& xfA, - const b2CircleShape* circleB, const b2Transform& xfB); - -/// Compute the collision manifold between two polygons. -void b2CollidePolygons(b2Manifold* manifold, - const b2PolygonShape* polygonA, const b2Transform& xfA, - const b2PolygonShape* polygonB, const b2Transform& xfB); - -/// Compute the collision manifold between an edge and a circle. -void b2CollideEdgeAndCircle(b2Manifold* manifold, - const b2EdgeShape* polygonA, const b2Transform& xfA, - const b2CircleShape* circleB, const b2Transform& xfB); - -/// Compute the collision manifold between an edge and a circle. -void b2CollideEdgeAndPolygon(b2Manifold* manifold, - const b2EdgeShape* edgeA, const b2Transform& xfA, - const b2PolygonShape* circleB, const b2Transform& xfB); - -/// Clipping for contact manifolds. -int32 b2ClipSegmentToLine(b2ClipVertex vOut[2], const b2ClipVertex vIn[2], - const b2Vec2& normal, float32 offset, int32 vertexIndexA); - -/// Determine if two generic shapes overlap. -bool b2TestOverlap( const b2Shape* shapeA, int32 indexA, - const b2Shape* shapeB, int32 indexB, - const b2Transform& xfA, const b2Transform& xfB); - -// ---------------- Inline Functions ------------------------------------------ - -inline bool b2AABB::IsValid() const -{ - b2Vec2 d = upperBound - lowerBound; - bool valid = d.x >= 0.0f && d.y >= 0.0f; - valid = valid && lowerBound.IsValid() && upperBound.IsValid(); - return valid; -} - -inline bool b2TestOverlap(const b2AABB& a, const b2AABB& b) -{ - b2Vec2 d1, d2; - d1 = b.lowerBound - a.upperBound; - d2 = a.lowerBound - b.upperBound; - - if (d1.x > 0.0f || d1.y > 0.0f) - return false; - - if (d2.x > 0.0f || d2.y > 0.0f) - return false; - - return true; -} - -#endif diff --git a/external/Box2D/Collision/b2Distance.cpp b/external/Box2D/Collision/b2Distance.cpp deleted file mode 100644 index ac67d3be43..0000000000 --- a/external/Box2D/Collision/b2Distance.cpp +++ /dev/null @@ -1,603 +0,0 @@ -/* -* Copyright (c) 2007-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include -#include -#include - -// GJK using Voronoi regions (Christer Ericson) and Barycentric coordinates. -int32 b2_gjkCalls, b2_gjkIters, b2_gjkMaxIters; - -void b2DistanceProxy::Set(const b2Shape* shape, int32 index) -{ - switch (shape->GetType()) - { - case b2Shape::e_circle: - { - const b2CircleShape* circle = (b2CircleShape*)shape; - m_vertices = &circle->m_p; - m_count = 1; - m_radius = circle->m_radius; - } - break; - - case b2Shape::e_polygon: - { - const b2PolygonShape* polygon = (b2PolygonShape*)shape; - m_vertices = polygon->m_vertices; - m_count = polygon->m_vertexCount; - m_radius = polygon->m_radius; - } - break; - - case b2Shape::e_chain: - { - const b2ChainShape* chain = (b2ChainShape*)shape; - b2Assert(0 <= index && index < chain->m_count); - - m_buffer[0] = chain->m_vertices[index]; - if (index + 1 < chain->m_count) - { - m_buffer[1] = chain->m_vertices[index + 1]; - } - else - { - m_buffer[1] = chain->m_vertices[0]; - } - - m_vertices = m_buffer; - m_count = 2; - m_radius = chain->m_radius; - } - break; - - case b2Shape::e_edge: - { - const b2EdgeShape* edge = (b2EdgeShape*)shape; - m_vertices = &edge->m_vertex1; - m_count = 2; - m_radius = edge->m_radius; - } - break; - - default: - b2Assert(false); - } -} - - -struct b2SimplexVertex -{ - b2Vec2 wA; // support point in proxyA - b2Vec2 wB; // support point in proxyB - b2Vec2 w; // wB - wA - float32 a; // barycentric coordinate for closest point - int32 indexA; // wA index - int32 indexB; // wB index -}; - -struct b2Simplex -{ - void ReadCache( const b2SimplexCache* cache, - const b2DistanceProxy* proxyA, const b2Transform& transformA, - const b2DistanceProxy* proxyB, const b2Transform& transformB) - { - b2Assert(cache->count <= 3); - - // Copy data from cache. - m_count = cache->count; - b2SimplexVertex* vertices = &m_v1; - for (int32 i = 0; i < m_count; ++i) - { - b2SimplexVertex* v = vertices + i; - v->indexA = cache->indexA[i]; - v->indexB = cache->indexB[i]; - b2Vec2 wALocal = proxyA->GetVertex(v->indexA); - b2Vec2 wBLocal = proxyB->GetVertex(v->indexB); - v->wA = b2Mul(transformA, wALocal); - v->wB = b2Mul(transformB, wBLocal); - v->w = v->wB - v->wA; - v->a = 0.0f; - } - - // Compute the new simplex metric, if it is substantially different than - // old metric then flush the simplex. - if (m_count > 1) - { - float32 metric1 = cache->metric; - float32 metric2 = GetMetric(); - if (metric2 < 0.5f * metric1 || 2.0f * metric1 < metric2 || metric2 < b2_epsilon) - { - // Reset the simplex. - m_count = 0; - } - } - - // If the cache is empty or invalid ... - if (m_count == 0) - { - b2SimplexVertex* v = vertices + 0; - v->indexA = 0; - v->indexB = 0; - b2Vec2 wALocal = proxyA->GetVertex(0); - b2Vec2 wBLocal = proxyB->GetVertex(0); - v->wA = b2Mul(transformA, wALocal); - v->wB = b2Mul(transformB, wBLocal); - v->w = v->wB - v->wA; - m_count = 1; - } - } - - void WriteCache(b2SimplexCache* cache) const - { - cache->metric = GetMetric(); - cache->count = uint16(m_count); - const b2SimplexVertex* vertices = &m_v1; - for (int32 i = 0; i < m_count; ++i) - { - cache->indexA[i] = uint8(vertices[i].indexA); - cache->indexB[i] = uint8(vertices[i].indexB); - } - } - - b2Vec2 GetSearchDirection() const - { - switch (m_count) - { - case 1: - return -m_v1.w; - - case 2: - { - b2Vec2 e12 = m_v2.w - m_v1.w; - float32 sgn = b2Cross(e12, -m_v1.w); - if (sgn > 0.0f) - { - // Origin is left of e12. - return b2Cross(1.0f, e12); - } - else - { - // Origin is right of e12. - return b2Cross(e12, 1.0f); - } - } - - default: - b2Assert(false); - return b2Vec2_zero; - } - } - - b2Vec2 GetClosestPoint() const - { - switch (m_count) - { - case 0: - b2Assert(false); - return b2Vec2_zero; - - case 1: - return m_v1.w; - - case 2: - return m_v1.a * m_v1.w + m_v2.a * m_v2.w; - - case 3: - return b2Vec2_zero; - - default: - b2Assert(false); - return b2Vec2_zero; - } - } - - void GetWitnessPoints(b2Vec2* pA, b2Vec2* pB) const - { - switch (m_count) - { - case 0: - b2Assert(false); - break; - - case 1: - *pA = m_v1.wA; - *pB = m_v1.wB; - break; - - case 2: - *pA = m_v1.a * m_v1.wA + m_v2.a * m_v2.wA; - *pB = m_v1.a * m_v1.wB + m_v2.a * m_v2.wB; - break; - - case 3: - *pA = m_v1.a * m_v1.wA + m_v2.a * m_v2.wA + m_v3.a * m_v3.wA; - *pB = *pA; - break; - - default: - b2Assert(false); - break; - } - } - - float32 GetMetric() const - { - switch (m_count) - { - case 0: - b2Assert(false); - return 0.0; - - case 1: - return 0.0f; - - case 2: - return b2Distance(m_v1.w, m_v2.w); - - case 3: - return b2Cross(m_v2.w - m_v1.w, m_v3.w - m_v1.w); - - default: - b2Assert(false); - return 0.0f; - } - } - - void Solve2(); - void Solve3(); - - b2SimplexVertex m_v1, m_v2, m_v3; - int32 m_count; -}; - - -// Solve a line segment using barycentric coordinates. -// -// p = a1 * w1 + a2 * w2 -// a1 + a2 = 1 -// -// The vector from the origin to the closest point on the line is -// perpendicular to the line. -// e12 = w2 - w1 -// dot(p, e) = 0 -// a1 * dot(w1, e) + a2 * dot(w2, e) = 0 -// -// 2-by-2 linear system -// [1 1 ][a1] = [1] -// [w1.e12 w2.e12][a2] = [0] -// -// Define -// d12_1 = dot(w2, e12) -// d12_2 = -dot(w1, e12) -// d12 = d12_1 + d12_2 -// -// Solution -// a1 = d12_1 / d12 -// a2 = d12_2 / d12 -void b2Simplex::Solve2() -{ - b2Vec2 w1 = m_v1.w; - b2Vec2 w2 = m_v2.w; - b2Vec2 e12 = w2 - w1; - - // w1 region - float32 d12_2 = -b2Dot(w1, e12); - if (d12_2 <= 0.0f) - { - // a2 <= 0, so we clamp it to 0 - m_v1.a = 1.0f; - m_count = 1; - return; - } - - // w2 region - float32 d12_1 = b2Dot(w2, e12); - if (d12_1 <= 0.0f) - { - // a1 <= 0, so we clamp it to 0 - m_v2.a = 1.0f; - m_count = 1; - m_v1 = m_v2; - return; - } - - // Must be in e12 region. - float32 inv_d12 = 1.0f / (d12_1 + d12_2); - m_v1.a = d12_1 * inv_d12; - m_v2.a = d12_2 * inv_d12; - m_count = 2; -} - -// Possible regions: -// - points[2] -// - edge points[0]-points[2] -// - edge points[1]-points[2] -// - inside the triangle -void b2Simplex::Solve3() -{ - b2Vec2 w1 = m_v1.w; - b2Vec2 w2 = m_v2.w; - b2Vec2 w3 = m_v3.w; - - // Edge12 - // [1 1 ][a1] = [1] - // [w1.e12 w2.e12][a2] = [0] - // a3 = 0 - b2Vec2 e12 = w2 - w1; - float32 w1e12 = b2Dot(w1, e12); - float32 w2e12 = b2Dot(w2, e12); - float32 d12_1 = w2e12; - float32 d12_2 = -w1e12; - - // Edge13 - // [1 1 ][a1] = [1] - // [w1.e13 w3.e13][a3] = [0] - // a2 = 0 - b2Vec2 e13 = w3 - w1; - float32 w1e13 = b2Dot(w1, e13); - float32 w3e13 = b2Dot(w3, e13); - float32 d13_1 = w3e13; - float32 d13_2 = -w1e13; - - // Edge23 - // [1 1 ][a2] = [1] - // [w2.e23 w3.e23][a3] = [0] - // a1 = 0 - b2Vec2 e23 = w3 - w2; - float32 w2e23 = b2Dot(w2, e23); - float32 w3e23 = b2Dot(w3, e23); - float32 d23_1 = w3e23; - float32 d23_2 = -w2e23; - - // Triangle123 - float32 n123 = b2Cross(e12, e13); - - float32 d123_1 = n123 * b2Cross(w2, w3); - float32 d123_2 = n123 * b2Cross(w3, w1); - float32 d123_3 = n123 * b2Cross(w1, w2); - - // w1 region - if (d12_2 <= 0.0f && d13_2 <= 0.0f) - { - m_v1.a = 1.0f; - m_count = 1; - return; - } - - // e12 - if (d12_1 > 0.0f && d12_2 > 0.0f && d123_3 <= 0.0f) - { - float32 inv_d12 = 1.0f / (d12_1 + d12_2); - m_v1.a = d12_1 * inv_d12; - m_v2.a = d12_2 * inv_d12; - m_count = 2; - return; - } - - // e13 - if (d13_1 > 0.0f && d13_2 > 0.0f && d123_2 <= 0.0f) - { - float32 inv_d13 = 1.0f / (d13_1 + d13_2); - m_v1.a = d13_1 * inv_d13; - m_v3.a = d13_2 * inv_d13; - m_count = 2; - m_v2 = m_v3; - return; - } - - // w2 region - if (d12_1 <= 0.0f && d23_2 <= 0.0f) - { - m_v2.a = 1.0f; - m_count = 1; - m_v1 = m_v2; - return; - } - - // w3 region - if (d13_1 <= 0.0f && d23_1 <= 0.0f) - { - m_v3.a = 1.0f; - m_count = 1; - m_v1 = m_v3; - return; - } - - // e23 - if (d23_1 > 0.0f && d23_2 > 0.0f && d123_1 <= 0.0f) - { - float32 inv_d23 = 1.0f / (d23_1 + d23_2); - m_v2.a = d23_1 * inv_d23; - m_v3.a = d23_2 * inv_d23; - m_count = 2; - m_v1 = m_v3; - return; - } - - // Must be in triangle123 - float32 inv_d123 = 1.0f / (d123_1 + d123_2 + d123_3); - m_v1.a = d123_1 * inv_d123; - m_v2.a = d123_2 * inv_d123; - m_v3.a = d123_3 * inv_d123; - m_count = 3; -} - -void b2Distance(b2DistanceOutput* output, - b2SimplexCache* cache, - const b2DistanceInput* input) -{ - ++b2_gjkCalls; - - const b2DistanceProxy* proxyA = &input->proxyA; - const b2DistanceProxy* proxyB = &input->proxyB; - - b2Transform transformA = input->transformA; - b2Transform transformB = input->transformB; - - // Initialize the simplex. - b2Simplex simplex; - simplex.ReadCache(cache, proxyA, transformA, proxyB, transformB); - - // Get simplex vertices as an array. - b2SimplexVertex* vertices = &simplex.m_v1; - const int32 k_maxIters = 20; - - // These store the vertices of the last simplex so that we - // can check for duplicates and prevent cycling. - int32 saveA[3], saveB[3]; - int32 saveCount = 0; - - b2Vec2 closestPoint = simplex.GetClosestPoint(); - float32 distanceSqr1 = closestPoint.LengthSquared(); - float32 distanceSqr2 = distanceSqr1; - - // Main iteration loop. - int32 iter = 0; - while (iter < k_maxIters) - { - // Copy simplex so we can identify duplicates. - saveCount = simplex.m_count; - for (int32 i = 0; i < saveCount; ++i) - { - saveA[i] = vertices[i].indexA; - saveB[i] = vertices[i].indexB; - } - - switch (simplex.m_count) - { - case 1: - break; - - case 2: - simplex.Solve2(); - break; - - case 3: - simplex.Solve3(); - break; - - default: - b2Assert(false); - } - - // If we have 3 points, then the origin is in the corresponding triangle. - if (simplex.m_count == 3) - { - break; - } - - // Compute closest point. - b2Vec2 p = simplex.GetClosestPoint(); - distanceSqr2 = p.LengthSquared(); - - // Ensure progress - if (distanceSqr2 >= distanceSqr1) - { - //break; - } - distanceSqr1 = distanceSqr2; - - // Get search direction. - b2Vec2 d = simplex.GetSearchDirection(); - - // Ensure the search direction is numerically fit. - if (d.LengthSquared() < b2_epsilon * b2_epsilon) - { - // The origin is probably contained by a line segment - // or triangle. Thus the shapes are overlapped. - - // We can't return zero here even though there may be overlap. - // In case the simplex is a point, segment, or triangle it is difficult - // to determine if the origin is contained in the CSO or very close to it. - break; - } - - // Compute a tentative new simplex vertex using support points. - b2SimplexVertex* vertex = vertices + simplex.m_count; - vertex->indexA = proxyA->GetSupport(b2MulT(transformA.q, -d)); - vertex->wA = b2Mul(transformA, proxyA->GetVertex(vertex->indexA)); - b2Vec2 wBLocal; - vertex->indexB = proxyB->GetSupport(b2MulT(transformB.q, d)); - vertex->wB = b2Mul(transformB, proxyB->GetVertex(vertex->indexB)); - vertex->w = vertex->wB - vertex->wA; - - // Iteration count is equated to the number of support point calls. - ++iter; - ++b2_gjkIters; - - // Check for duplicate support points. This is the main termination criteria. - bool duplicate = false; - for (int32 i = 0; i < saveCount; ++i) - { - if (vertex->indexA == saveA[i] && vertex->indexB == saveB[i]) - { - duplicate = true; - break; - } - } - - // If we found a duplicate support point we must exit to avoid cycling. - if (duplicate) - { - break; - } - - // New vertex is ok and needed. - ++simplex.m_count; - } - - b2_gjkMaxIters = b2Max(b2_gjkMaxIters, iter); - - // Prepare output. - simplex.GetWitnessPoints(&output->pointA, &output->pointB); - output->distance = b2Distance(output->pointA, output->pointB); - output->iterations = iter; - - // Cache the simplex. - simplex.WriteCache(cache); - - // Apply radii if requested. - if (input->useRadii) - { - float32 rA = proxyA->m_radius; - float32 rB = proxyB->m_radius; - - if (output->distance > rA + rB && output->distance > b2_epsilon) - { - // Shapes are still no overlapped. - // Move the witness points to the outer surface. - output->distance -= rA + rB; - b2Vec2 normal = output->pointB - output->pointA; - normal.Normalize(); - output->pointA += rA * normal; - output->pointB -= rB * normal; - } - else - { - // Shapes are overlapped when radii are considered. - // Move the witness points to the middle. - b2Vec2 p = 0.5f * (output->pointA + output->pointB); - output->pointA = p; - output->pointB = p; - output->distance = 0.0f; - } - } -} diff --git a/external/Box2D/Collision/b2Distance.h b/external/Box2D/Collision/b2Distance.h deleted file mode 100644 index d598b7339d..0000000000 --- a/external/Box2D/Collision/b2Distance.h +++ /dev/null @@ -1,141 +0,0 @@ - -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_DISTANCE_H -#define B2_DISTANCE_H - -#include - -class b2Shape; - -/// A distance proxy is used by the GJK algorithm. -/// It encapsulates any shape. -struct b2DistanceProxy -{ - b2DistanceProxy() : m_vertices(NULL), m_count(0), m_radius(0.0f) {} - - /// Initialize the proxy using the given shape. The shape - /// must remain in scope while the proxy is in use. - void Set(const b2Shape* shape, int32 index); - - /// Get the supporting vertex index in the given direction. - int32 GetSupport(const b2Vec2& d) const; - - /// Get the supporting vertex in the given direction. - const b2Vec2& GetSupportVertex(const b2Vec2& d) const; - - /// Get the vertex count. - int32 GetVertexCount() const; - - /// Get a vertex by index. Used by b2Distance. - const b2Vec2& GetVertex(int32 index) const; - - b2Vec2 m_buffer[2]; - const b2Vec2* m_vertices; - int32 m_count; - float32 m_radius; -}; - -/// Used to warm start b2Distance. -/// Set count to zero on first call. -struct b2SimplexCache -{ - float32 metric; ///< length or area - uint16 count; - uint8 indexA[3]; ///< vertices on shape A - uint8 indexB[3]; ///< vertices on shape B -}; - -/// Input for b2Distance. -/// You have to option to use the shape radii -/// in the computation. Even -struct b2DistanceInput -{ - b2DistanceProxy proxyA; - b2DistanceProxy proxyB; - b2Transform transformA; - b2Transform transformB; - bool useRadii; -}; - -/// Output for b2Distance. -struct b2DistanceOutput -{ - b2Vec2 pointA; ///< closest point on shapeA - b2Vec2 pointB; ///< closest point on shapeB - float32 distance; - int32 iterations; ///< number of GJK iterations used -}; - -/// Compute the closest points between two shapes. Supports any combination of: -/// b2CircleShape, b2PolygonShape, b2EdgeShape. The simplex cache is input/output. -/// On the first call set b2SimplexCache.count to zero. -void b2Distance(b2DistanceOutput* output, - b2SimplexCache* cache, - const b2DistanceInput* input); - - -////////////////////////////////////////////////////////////////////////// - -inline int32 b2DistanceProxy::GetVertexCount() const -{ - return m_count; -} - -inline const b2Vec2& b2DistanceProxy::GetVertex(int32 index) const -{ - b2Assert(0 <= index && index < m_count); - return m_vertices[index]; -} - -inline int32 b2DistanceProxy::GetSupport(const b2Vec2& d) const -{ - int32 bestIndex = 0; - float32 bestValue = b2Dot(m_vertices[0], d); - for (int32 i = 1; i < m_count; ++i) - { - float32 value = b2Dot(m_vertices[i], d); - if (value > bestValue) - { - bestIndex = i; - bestValue = value; - } - } - - return bestIndex; -} - -inline const b2Vec2& b2DistanceProxy::GetSupportVertex(const b2Vec2& d) const -{ - int32 bestIndex = 0; - float32 bestValue = b2Dot(m_vertices[0], d); - for (int32 i = 1; i < m_count; ++i) - { - float32 value = b2Dot(m_vertices[i], d); - if (value > bestValue) - { - bestIndex = i; - bestValue = value; - } - } - - return m_vertices[bestIndex]; -} - -#endif diff --git a/external/Box2D/Collision/b2DynamicTree.cpp b/external/Box2D/Collision/b2DynamicTree.cpp deleted file mode 100644 index d1d53297e2..0000000000 --- a/external/Box2D/Collision/b2DynamicTree.cpp +++ /dev/null @@ -1,775 +0,0 @@ -/* -* Copyright (c) 2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#ifndef SHP -#include -#else -#include -#endif -using namespace std; - - -b2DynamicTree::b2DynamicTree() -{ - m_root = b2_nullNode; - - m_nodeCapacity = 16; - m_nodeCount = 0; - m_nodes = (b2TreeNode*)b2Alloc(m_nodeCapacity * sizeof(b2TreeNode)); - memset(m_nodes, 0, m_nodeCapacity * sizeof(b2TreeNode)); - - // Build a linked list for the free list. - for (int32 i = 0; i < m_nodeCapacity - 1; ++i) - { - m_nodes[i].next = i + 1; - m_nodes[i].height = -1; - } - m_nodes[m_nodeCapacity-1].next = b2_nullNode; - m_nodes[m_nodeCapacity-1].height = -1; - m_freeList = 0; - - m_path = 0; - - m_insertionCount = 0; -} - -b2DynamicTree::~b2DynamicTree() -{ - // This frees the entire tree in one shot. - b2Free(m_nodes); -} - -// Allocate a node from the pool. Grow the pool if necessary. -int32 b2DynamicTree::AllocateNode() -{ - // Expand the node pool as needed. - if (m_freeList == b2_nullNode) - { - b2Assert(m_nodeCount == m_nodeCapacity); - - // The free list is empty. Rebuild a bigger pool. - b2TreeNode* oldNodes = m_nodes; - m_nodeCapacity *= 2; - m_nodes = (b2TreeNode*)b2Alloc(m_nodeCapacity * sizeof(b2TreeNode)); - memcpy(m_nodes, oldNodes, m_nodeCount * sizeof(b2TreeNode)); - b2Free(oldNodes); - - // Build a linked list for the free list. The parent - // pointer becomes the "next" pointer. - for (int32 i = m_nodeCount; i < m_nodeCapacity - 1; ++i) - { - m_nodes[i].next = i + 1; - m_nodes[i].height = -1; - } - m_nodes[m_nodeCapacity-1].next = b2_nullNode; - m_nodes[m_nodeCapacity-1].height = -1; - m_freeList = m_nodeCount; - } - - // Peel a node off the free list. - int32 nodeId = m_freeList; - m_freeList = m_nodes[nodeId].next; - m_nodes[nodeId].parent = b2_nullNode; - m_nodes[nodeId].child1 = b2_nullNode; - m_nodes[nodeId].child2 = b2_nullNode; - m_nodes[nodeId].height = 0; - m_nodes[nodeId].userData = NULL; - ++m_nodeCount; - return nodeId; -} - -// Return a node to the pool. -void b2DynamicTree::FreeNode(int32 nodeId) -{ - b2Assert(0 <= nodeId && nodeId < m_nodeCapacity); - b2Assert(0 < m_nodeCount); - m_nodes[nodeId].next = m_freeList; - m_nodes[nodeId].height = -1; - m_freeList = nodeId; - --m_nodeCount; -} - -// Create a proxy in the tree as a leaf node. We return the index -// of the node instead of a pointer so that we can grow -// the node pool. -int32 b2DynamicTree::CreateProxy(const b2AABB& aabb, void* userData) -{ - int32 proxyId = AllocateNode(); - - // Fatten the aabb. - b2Vec2 r(b2_aabbExtension, b2_aabbExtension); - m_nodes[proxyId].aabb.lowerBound = aabb.lowerBound - r; - m_nodes[proxyId].aabb.upperBound = aabb.upperBound + r; - m_nodes[proxyId].userData = userData; - m_nodes[proxyId].height = 0; - - InsertLeaf(proxyId); - - return proxyId; -} - -void b2DynamicTree::DestroyProxy(int32 proxyId) -{ - b2Assert(0 <= proxyId && proxyId < m_nodeCapacity); - b2Assert(m_nodes[proxyId].IsLeaf()); - - RemoveLeaf(proxyId); - FreeNode(proxyId); -} - -bool b2DynamicTree::MoveProxy(int32 proxyId, const b2AABB& aabb, const b2Vec2& displacement) -{ - b2Assert(0 <= proxyId && proxyId < m_nodeCapacity); - - b2Assert(m_nodes[proxyId].IsLeaf()); - - if (m_nodes[proxyId].aabb.Contains(aabb)) - { - return false; - } - - RemoveLeaf(proxyId); - - // Extend AABB. - b2AABB b = aabb; - b2Vec2 r(b2_aabbExtension, b2_aabbExtension); - b.lowerBound = b.lowerBound - r; - b.upperBound = b.upperBound + r; - - // Predict AABB displacement. - b2Vec2 d = b2_aabbMultiplier * displacement; - - if (d.x < 0.0f) - { - b.lowerBound.x += d.x; - } - else - { - b.upperBound.x += d.x; - } - - if (d.y < 0.0f) - { - b.lowerBound.y += d.y; - } - else - { - b.upperBound.y += d.y; - } - - m_nodes[proxyId].aabb = b; - - InsertLeaf(proxyId); - return true; -} - -void b2DynamicTree::InsertLeaf(int32 leaf) -{ - ++m_insertionCount; - - if (m_root == b2_nullNode) - { - m_root = leaf; - m_nodes[m_root].parent = b2_nullNode; - return; - } - - // Find the best sibling for this node - b2AABB leafAABB = m_nodes[leaf].aabb; - int32 index = m_root; - while (m_nodes[index].IsLeaf() == false) - { - int32 child1 = m_nodes[index].child1; - int32 child2 = m_nodes[index].child2; - - float32 area = m_nodes[index].aabb.GetPerimeter(); - - b2AABB combinedAABB; - combinedAABB.Combine(m_nodes[index].aabb, leafAABB); - float32 combinedArea = combinedAABB.GetPerimeter(); - - // Cost of creating a new parent for this node and the new leaf - float32 cost = 2.0f * combinedArea; - - // Minimum cost of pushing the leaf further down the tree - float32 inheritanceCost = 2.0f * (combinedArea - area); - - // Cost of descending into child1 - float32 cost1; - if (m_nodes[child1].IsLeaf()) - { - b2AABB aabb; - aabb.Combine(leafAABB, m_nodes[child1].aabb); - cost1 = aabb.GetPerimeter() + inheritanceCost; - } - else - { - b2AABB aabb; - aabb.Combine(leafAABB, m_nodes[child1].aabb); - float32 oldArea = m_nodes[child1].aabb.GetPerimeter(); - float32 newArea = aabb.GetPerimeter(); - cost1 = (newArea - oldArea) + inheritanceCost; - } - - // Cost of descending into child2 - float32 cost2; - if (m_nodes[child2].IsLeaf()) - { - b2AABB aabb; - aabb.Combine(leafAABB, m_nodes[child2].aabb); - cost2 = aabb.GetPerimeter() + inheritanceCost; - } - else - { - b2AABB aabb; - aabb.Combine(leafAABB, m_nodes[child2].aabb); - float32 oldArea = m_nodes[child2].aabb.GetPerimeter(); - float32 newArea = aabb.GetPerimeter(); - cost2 = newArea - oldArea + inheritanceCost; - } - - // Descend according to the minimum cost. - if (cost < cost1 && cost < cost2) - { - break; - } - - // Descend - if (cost1 < cost2) - { - index = child1; - } - else - { - index = child2; - } - } - - int32 sibling = index; - - // Create a new parent. - int32 oldParent = m_nodes[sibling].parent; - int32 newParent = AllocateNode(); - m_nodes[newParent].parent = oldParent; - m_nodes[newParent].userData = NULL; - m_nodes[newParent].aabb.Combine(leafAABB, m_nodes[sibling].aabb); - m_nodes[newParent].height = m_nodes[sibling].height + 1; - - if (oldParent != b2_nullNode) - { - // The sibling was not the root. - if (m_nodes[oldParent].child1 == sibling) - { - m_nodes[oldParent].child1 = newParent; - } - else - { - m_nodes[oldParent].child2 = newParent; - } - - m_nodes[newParent].child1 = sibling; - m_nodes[newParent].child2 = leaf; - m_nodes[sibling].parent = newParent; - m_nodes[leaf].parent = newParent; - } - else - { - // The sibling was the root. - m_nodes[newParent].child1 = sibling; - m_nodes[newParent].child2 = leaf; - m_nodes[sibling].parent = newParent; - m_nodes[leaf].parent = newParent; - m_root = newParent; - } - - // Walk back up the tree fixing heights and AABBs - index = m_nodes[leaf].parent; - while (index != b2_nullNode) - { - index = Balance(index); - - int32 child1 = m_nodes[index].child1; - int32 child2 = m_nodes[index].child2; - - b2Assert(child1 != b2_nullNode); - b2Assert(child2 != b2_nullNode); - - m_nodes[index].height = 1 + b2Max(m_nodes[child1].height, m_nodes[child2].height); - m_nodes[index].aabb.Combine(m_nodes[child1].aabb, m_nodes[child2].aabb); - - index = m_nodes[index].parent; - } - - //Validate(); -} - -void b2DynamicTree::RemoveLeaf(int32 leaf) -{ - if (leaf == m_root) - { - m_root = b2_nullNode; - return; - } - - int32 parent = m_nodes[leaf].parent; - int32 grandParent = m_nodes[parent].parent; - int32 sibling; - if (m_nodes[parent].child1 == leaf) - { - sibling = m_nodes[parent].child2; - } - else - { - sibling = m_nodes[parent].child1; - } - - if (grandParent != b2_nullNode) - { - // Destroy parent and connect sibling to grandParent. - if (m_nodes[grandParent].child1 == parent) - { - m_nodes[grandParent].child1 = sibling; - } - else - { - m_nodes[grandParent].child2 = sibling; - } - m_nodes[sibling].parent = grandParent; - FreeNode(parent); - - // Adjust ancestor bounds. - int32 index = grandParent; - while (index != b2_nullNode) - { - index = Balance(index); - - int32 child1 = m_nodes[index].child1; - int32 child2 = m_nodes[index].child2; - - m_nodes[index].aabb.Combine(m_nodes[child1].aabb, m_nodes[child2].aabb); - m_nodes[index].height = 1 + b2Max(m_nodes[child1].height, m_nodes[child2].height); - - index = m_nodes[index].parent; - } - } - else - { - m_root = sibling; - m_nodes[sibling].parent = b2_nullNode; - FreeNode(parent); - } - - //Validate(); -} - -// Perform a left or right rotation if node A is imbalanced. -// Returns the new root index. -int32 b2DynamicTree::Balance(int32 iA) -{ - b2Assert(iA != b2_nullNode); - - b2TreeNode* A = m_nodes + iA; - if (A->IsLeaf() || A->height < 2) - { - return iA; - } - - int32 iB = A->child1; - int32 iC = A->child2; - b2Assert(0 <= iB && iB < m_nodeCapacity); - b2Assert(0 <= iC && iC < m_nodeCapacity); - - b2TreeNode* B = m_nodes + iB; - b2TreeNode* C = m_nodes + iC; - - int32 balance = C->height - B->height; - - // Rotate C up - if (balance > 1) - { - int32 iF = C->child1; - int32 iG = C->child2; - b2TreeNode* F = m_nodes + iF; - b2TreeNode* G = m_nodes + iG; - b2Assert(0 <= iF && iF < m_nodeCapacity); - b2Assert(0 <= iG && iG < m_nodeCapacity); - - // Swap A and C - C->child1 = iA; - C->parent = A->parent; - A->parent = iC; - - // A's old parent should point to C - if (C->parent != b2_nullNode) - { - if (m_nodes[C->parent].child1 == iA) - { - m_nodes[C->parent].child1 = iC; - } - else - { - b2Assert(m_nodes[C->parent].child2 == iA); - m_nodes[C->parent].child2 = iC; - } - } - else - { - m_root = iC; - } - - // Rotate - if (F->height > G->height) - { - C->child2 = iF; - A->child2 = iG; - G->parent = iA; - A->aabb.Combine(B->aabb, G->aabb); - C->aabb.Combine(A->aabb, F->aabb); - - A->height = 1 + b2Max(B->height, G->height); - C->height = 1 + b2Max(A->height, F->height); - } - else - { - C->child2 = iG; - A->child2 = iF; - F->parent = iA; - A->aabb.Combine(B->aabb, F->aabb); - C->aabb.Combine(A->aabb, G->aabb); - - A->height = 1 + b2Max(B->height, F->height); - C->height = 1 + b2Max(A->height, G->height); - } - - return iC; - } - - // Rotate B up - if (balance < -1) - { - int32 iD = B->child1; - int32 iE = B->child2; - b2TreeNode* D = m_nodes + iD; - b2TreeNode* E = m_nodes + iE; - b2Assert(0 <= iD && iD < m_nodeCapacity); - b2Assert(0 <= iE && iE < m_nodeCapacity); - - // Swap A and B - B->child1 = iA; - B->parent = A->parent; - A->parent = iB; - - // A's old parent should point to B - if (B->parent != b2_nullNode) - { - if (m_nodes[B->parent].child1 == iA) - { - m_nodes[B->parent].child1 = iB; - } - else - { - b2Assert(m_nodes[B->parent].child2 == iA); - m_nodes[B->parent].child2 = iB; - } - } - else - { - m_root = iB; - } - - // Rotate - if (D->height > E->height) - { - B->child2 = iD; - A->child1 = iE; - E->parent = iA; - A->aabb.Combine(C->aabb, E->aabb); - B->aabb.Combine(A->aabb, D->aabb); - - A->height = 1 + b2Max(C->height, E->height); - B->height = 1 + b2Max(A->height, D->height); - } - else - { - B->child2 = iE; - A->child1 = iD; - D->parent = iA; - A->aabb.Combine(C->aabb, D->aabb); - B->aabb.Combine(A->aabb, E->aabb); - - A->height = 1 + b2Max(C->height, D->height); - B->height = 1 + b2Max(A->height, E->height); - } - - return iB; - } - - return iA; -} - -int32 b2DynamicTree::GetHeight() const -{ - if (m_root == b2_nullNode) - { - return 0; - } - - return m_nodes[m_root].height; -} - -// -float32 b2DynamicTree::GetAreaRatio() const -{ - if (m_root == b2_nullNode) - { - return 0.0f; - } - - const b2TreeNode* root = m_nodes + m_root; - float32 rootArea = root->aabb.GetPerimeter(); - - float32 totalArea = 0.0f; - for (int32 i = 0; i < m_nodeCapacity; ++i) - { - const b2TreeNode* node = m_nodes + i; - if (node->height < 0) - { - // Free node in pool - continue; - } - - totalArea += node->aabb.GetPerimeter(); - } - - return totalArea / rootArea; -} - -// Compute the height of a sub-tree. -int32 b2DynamicTree::ComputeHeight(int32 nodeId) const -{ - b2Assert(0 <= nodeId && nodeId < m_nodeCapacity); - b2TreeNode* node = m_nodes + nodeId; - - if (node->IsLeaf()) - { - return 0; - } - - int32 height1 = ComputeHeight(node->child1); - int32 height2 = ComputeHeight(node->child2); - return 1 + b2Max(height1, height2); -} - -int32 b2DynamicTree::ComputeHeight() const -{ - int32 height = ComputeHeight(m_root); - return height; -} - -void b2DynamicTree::ValidateStructure(int32 index) const -{ - if (index == b2_nullNode) - { - return; - } - - if (index == m_root) - { - b2Assert(m_nodes[index].parent == b2_nullNode); - } - - const b2TreeNode* node = m_nodes + index; - - int32 child1 = node->child1; - int32 child2 = node->child2; - - if (node->IsLeaf()) - { - b2Assert(child1 == b2_nullNode); - b2Assert(child2 == b2_nullNode); - b2Assert(node->height == 0); - return; - } - - b2Assert(0 <= child1 && child1 < m_nodeCapacity); - b2Assert(0 <= child2 && child2 < m_nodeCapacity); - - b2Assert(m_nodes[child1].parent == index); - b2Assert(m_nodes[child2].parent == index); - - ValidateStructure(child1); - ValidateStructure(child2); -} - -void b2DynamicTree::ValidateMetrics(int32 index) const -{ - if (index == b2_nullNode) - { - return; - } - - const b2TreeNode* node = m_nodes + index; - - int32 child1 = node->child1; - int32 child2 = node->child2; - - if (node->IsLeaf()) - { - b2Assert(child1 == b2_nullNode); - b2Assert(child2 == b2_nullNode); - b2Assert(node->height == 0); - return; - } - - b2Assert(0 <= child1 && child1 < m_nodeCapacity); - b2Assert(0 <= child2 && child2 < m_nodeCapacity); - - int32 height1 = m_nodes[child1].height; - int32 height2 = m_nodes[child2].height; - int32 height; - height = 1 + b2Max(height1, height2); - b2Assert(node->height == height); - - b2AABB aabb; - aabb.Combine(m_nodes[child1].aabb, m_nodes[child2].aabb); - - b2Assert(aabb.lowerBound == node->aabb.lowerBound); - b2Assert(aabb.upperBound == node->aabb.upperBound); - - ValidateMetrics(child1); - ValidateMetrics(child2); -} - -void b2DynamicTree::Validate() const -{ - ValidateStructure(m_root); - ValidateMetrics(m_root); - - int32 freeCount = 0; - int32 freeIndex = m_freeList; - while (freeIndex != b2_nullNode) - { - b2Assert(0 <= freeIndex && freeIndex < m_nodeCapacity); - freeIndex = m_nodes[freeIndex].next; - ++freeCount; - } - - b2Assert(GetHeight() == ComputeHeight()); - - b2Assert(m_nodeCount + freeCount == m_nodeCapacity); -} - -int32 b2DynamicTree::GetMaxBalance() const -{ - int32 maxBalance = 0; - for (int32 i = 0; i < m_nodeCapacity; ++i) - { - const b2TreeNode* node = m_nodes + i; - if (node->height <= 1) - { - continue; - } - - b2Assert(node->IsLeaf() == false); - - int32 child1 = node->child1; - int32 child2 = node->child2; - int32 balance = b2Abs(m_nodes[child2].height - m_nodes[child1].height); - maxBalance = b2Max(maxBalance, balance); - } - - return maxBalance; -} - -void b2DynamicTree::RebuildBottomUp() -{ - int32* nodes = (int32*)b2Alloc(m_nodeCount * sizeof(int32)); - int32 count = 0; - - // Build array of leaves. Free the rest. - for (int32 i = 0; i < m_nodeCapacity; ++i) - { - if (m_nodes[i].height < 0) - { - // free node in pool - continue; - } - - if (m_nodes[i].IsLeaf()) - { - m_nodes[i].parent = b2_nullNode; - nodes[count] = i; - ++count; - } - else - { - FreeNode(i); - } - } - - while (count > 1) - { - float32 minCost = b2_maxFloat; - int32 iMin = -1, jMin = -1; - for (int32 i = 0; i < count; ++i) - { - b2AABB aabbi = m_nodes[nodes[i]].aabb; - - for (int32 j = i + 1; j < count; ++j) - { - b2AABB aabbj = m_nodes[nodes[j]].aabb; - b2AABB b; - b.Combine(aabbi, aabbj); - float32 cost = b.GetPerimeter(); - if (cost < minCost) - { - iMin = i; - jMin = j; - minCost = cost; - } - } - } - - int32 index1 = nodes[iMin]; - int32 index2 = nodes[jMin]; - b2TreeNode* child1 = m_nodes + index1; - b2TreeNode* child2 = m_nodes + index2; - - int32 parentIndex = AllocateNode(); - b2TreeNode* parent = m_nodes + parentIndex; - parent->child1 = index1; - parent->child2 = index2; - parent->height = 1 + b2Max(child1->height, child2->height); - parent->aabb.Combine(child1->aabb, child2->aabb); - parent->parent = b2_nullNode; - - child1->parent = parentIndex; - child2->parent = parentIndex; - - nodes[jMin] = nodes[count-1]; - nodes[iMin] = parentIndex; - --count; - } - - m_root = nodes[0]; - b2Free(nodes); - - Validate(); -} diff --git a/external/Box2D/Collision/b2DynamicTree.h b/external/Box2D/Collision/b2DynamicTree.h deleted file mode 100644 index 33f16b0f32..0000000000 --- a/external/Box2D/Collision/b2DynamicTree.h +++ /dev/null @@ -1,284 +0,0 @@ -/* -* Copyright (c) 2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_DYNAMIC_TREE_H -#define B2_DYNAMIC_TREE_H - -#include -#include - -#define b2_nullNode (-1) - -/// A node in the dynamic tree. The client does not interact with this directly. -struct b2TreeNode -{ - bool IsLeaf() const - { - return child1 == b2_nullNode; - } - - /// Enlarged AABB - b2AABB aabb; - - void* userData; - - union - { - int32 parent; - int32 next; - }; - - int32 child1; - int32 child2; - - // leaf = 0, free node = -1 - int32 height; -}; - -/// A dynamic AABB tree broad-phase, inspired by Nathanael Presson's btDbvt. -/// A dynamic tree arranges data in a binary tree to accelerate -/// queries such as volume queries and ray casts. Leafs are proxies -/// with an AABB. In the tree we expand the proxy AABB by b2_fatAABBFactor -/// so that the proxy AABB is bigger than the client object. This allows the client -/// object to move by small amounts without triggering a tree update. -/// -/// Nodes are pooled and relocatable, so we use node indices rather than pointers. -class b2DynamicTree -{ -public: - /// Constructing the tree initializes the node pool. - b2DynamicTree(); - - /// Destroy the tree, freeing the node pool. - ~b2DynamicTree(); - - /// Create a proxy. Provide a tight fitting AABB and a userData pointer. - int32 CreateProxy(const b2AABB& aabb, void* userData); - - /// Destroy a proxy. This asserts if the id is invalid. - void DestroyProxy(int32 proxyId); - - /// Move a proxy with a swepted AABB. If the proxy has moved outside of its fattened AABB, - /// then the proxy is removed from the tree and re-inserted. Otherwise - /// the function returns immediately. - /// @return true if the proxy was re-inserted. - bool MoveProxy(int32 proxyId, const b2AABB& aabb1, const b2Vec2& displacement); - - /// Get proxy user data. - /// @return the proxy user data or 0 if the id is invalid. - void* GetUserData(int32 proxyId) const; - - /// Get the fat AABB for a proxy. - const b2AABB& GetFatAABB(int32 proxyId) const; - - /// Query an AABB for overlapping proxies. The callback class - /// is called for each proxy that overlaps the supplied AABB. - template - void Query(T* callback, const b2AABB& aabb) const; - - /// Ray-cast against the proxies in the tree. This relies on the callback - /// to perform a exact ray-cast in the case were the proxy contains a shape. - /// The callback also performs the any collision filtering. This has performance - /// roughly equal to k * log(n), where k is the number of collisions and n is the - /// number of proxies in the tree. - /// @param input the ray-cast input data. The ray extends from p1 to p1 + maxFraction * (p2 - p1). - /// @param callback a callback class that is called for each proxy that is hit by the ray. - template - void RayCast(T* callback, const b2RayCastInput& input) const; - - /// Validate this tree. For testing. - void Validate() const; - - /// Compute the height of the binary tree in O(N) time. Should not be - /// called often. - int32 GetHeight() const; - - /// Get the maximum balance of an node in the tree. The balance is the difference - /// in height of the two children of a node. - int32 GetMaxBalance() const; - - /// Get the ratio of the sum of the node areas to the root area. - float32 GetAreaRatio() const; - - /// Build an optimal tree. Very expensive. For testing. - void RebuildBottomUp(); - -private: - - int32 AllocateNode(); - void FreeNode(int32 node); - - void InsertLeaf(int32 node); - void RemoveLeaf(int32 node); - - int32 Balance(int32 index); - - int32 ComputeHeight() const; - int32 ComputeHeight(int32 nodeId) const; - - void ValidateStructure(int32 index) const; - void ValidateMetrics(int32 index) const; - - int32 m_root; - - b2TreeNode* m_nodes; - int32 m_nodeCount; - int32 m_nodeCapacity; - - int32 m_freeList; - - /// This is used to incrementally traverse the tree for re-balancing. - uint32 m_path; - - int32 m_insertionCount; -}; - -inline void* b2DynamicTree::GetUserData(int32 proxyId) const -{ - b2Assert(0 <= proxyId && proxyId < m_nodeCapacity); - return m_nodes[proxyId].userData; -} - -inline const b2AABB& b2DynamicTree::GetFatAABB(int32 proxyId) const -{ - b2Assert(0 <= proxyId && proxyId < m_nodeCapacity); - return m_nodes[proxyId].aabb; -} - -template -inline void b2DynamicTree::Query(T* callback, const b2AABB& aabb) const -{ - b2GrowableStack stack; - stack.Push(m_root); - - while (stack.GetCount() > 0) - { - int32 nodeId = stack.Pop(); - if (nodeId == b2_nullNode) - { - continue; - } - - const b2TreeNode* node = m_nodes + nodeId; - - if (b2TestOverlap(node->aabb, aabb)) - { - if (node->IsLeaf()) - { - bool proceed = callback->QueryCallback(nodeId); - if (proceed == false) - { - return; - } - } - else - { - stack.Push(node->child1); - stack.Push(node->child2); - } - } - } -} - -template -inline void b2DynamicTree::RayCast(T* callback, const b2RayCastInput& input) const -{ - b2Vec2 p1 = input.p1; - b2Vec2 p2 = input.p2; - b2Vec2 r = p2 - p1; - b2Assert(r.LengthSquared() > 0.0f); - r.Normalize(); - - // v is perpendicular to the segment. - b2Vec2 v = b2Cross(1.0f, r); - b2Vec2 abs_v = b2Abs(v); - - // Separating axis for segment (Gino, p80). - // |dot(v, p1 - c)| > dot(|v|, h) - - float32 maxFraction = input.maxFraction; - - // Build a bounding box for the segment. - b2AABB segmentAABB; - { - b2Vec2 t = p1 + maxFraction * (p2 - p1); - segmentAABB.lowerBound = b2Min(p1, t); - segmentAABB.upperBound = b2Max(p1, t); - } - - b2GrowableStack stack; - stack.Push(m_root); - - while (stack.GetCount() > 0) - { - int32 nodeId = stack.Pop(); - if (nodeId == b2_nullNode) - { - continue; - } - - const b2TreeNode* node = m_nodes + nodeId; - - if (b2TestOverlap(node->aabb, segmentAABB) == false) - { - continue; - } - - // Separating axis for segment (Gino, p80). - // |dot(v, p1 - c)| > dot(|v|, h) - b2Vec2 c = node->aabb.GetCenter(); - b2Vec2 h = node->aabb.GetExtents(); - float32 separation = b2Abs(b2Dot(v, p1 - c)) - b2Dot(abs_v, h); - if (separation > 0.0f) - { - continue; - } - - if (node->IsLeaf()) - { - b2RayCastInput subInput; - subInput.p1 = input.p1; - subInput.p2 = input.p2; - subInput.maxFraction = maxFraction; - - float32 value = callback->RayCastCallback(subInput, nodeId); - - if (value == 0.0f) - { - // The client has terminated the ray cast. - return; - } - - if (value > 0.0f) - { - // Update segment bounding box. - maxFraction = value; - b2Vec2 t = p1 + maxFraction * (p2 - p1); - segmentAABB.lowerBound = b2Min(p1, t); - segmentAABB.upperBound = b2Max(p1, t); - } - } - else - { - stack.Push(node->child1); - stack.Push(node->child2); - } - } -} - -#endif diff --git a/external/Box2D/Collision/b2TimeOfImpact.cpp b/external/Box2D/Collision/b2TimeOfImpact.cpp deleted file mode 100644 index 1d643addd8..0000000000 --- a/external/Box2D/Collision/b2TimeOfImpact.cpp +++ /dev/null @@ -1,488 +0,0 @@ -/* -* Copyright (c) 2007-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include -#include -#include - -#ifdef SHP -#include -#else -#include -#endif - -using namespace std; - -int32 b2_toiCalls, b2_toiIters, b2_toiMaxIters; -int32 b2_toiRootIters, b2_toiMaxRootIters; - -struct b2SeparationFunction -{ - enum Type - { - e_points, - e_faceA, - e_faceB - }; - - // TODO_ERIN might not need to return the separation - - float32 Initialize(const b2SimplexCache* cache, - const b2DistanceProxy* proxyA, const b2Sweep& sweepA, - const b2DistanceProxy* proxyB, const b2Sweep& sweepB, - float32 t1) - { - m_proxyA = proxyA; - m_proxyB = proxyB; - int32 count = cache->count; - b2Assert(0 < count && count < 3); - - m_sweepA = sweepA; - m_sweepB = sweepB; - - b2Transform xfA, xfB; - m_sweepA.GetTransform(&xfA, t1); - m_sweepB.GetTransform(&xfB, t1); - - if (count == 1) - { - m_type = e_points; - b2Vec2 localPointA = m_proxyA->GetVertex(cache->indexA[0]); - b2Vec2 localPointB = m_proxyB->GetVertex(cache->indexB[0]); - b2Vec2 pointA = b2Mul(xfA, localPointA); - b2Vec2 pointB = b2Mul(xfB, localPointB); - m_axis = pointB - pointA; - float32 s = m_axis.Normalize(); - return s; - } - else if (cache->indexA[0] == cache->indexA[1]) - { - // Two points on B and one on A. - m_type = e_faceB; - b2Vec2 localPointB1 = proxyB->GetVertex(cache->indexB[0]); - b2Vec2 localPointB2 = proxyB->GetVertex(cache->indexB[1]); - - m_axis = b2Cross(localPointB2 - localPointB1, 1.0f); - m_axis.Normalize(); - b2Vec2 normal = b2Mul(xfB.q, m_axis); - - m_localPoint = 0.5f * (localPointB1 + localPointB2); - b2Vec2 pointB = b2Mul(xfB, m_localPoint); - - b2Vec2 localPointA = proxyA->GetVertex(cache->indexA[0]); - b2Vec2 pointA = b2Mul(xfA, localPointA); - - float32 s = b2Dot(pointA - pointB, normal); - if (s < 0.0f) - { - m_axis = -m_axis; - s = -s; - } - return s; - } - else - { - // Two points on A and one or two points on B. - m_type = e_faceA; - b2Vec2 localPointA1 = m_proxyA->GetVertex(cache->indexA[0]); - b2Vec2 localPointA2 = m_proxyA->GetVertex(cache->indexA[1]); - - m_axis = b2Cross(localPointA2 - localPointA1, 1.0f); - m_axis.Normalize(); - b2Vec2 normal = b2Mul(xfA.q, m_axis); - - m_localPoint = 0.5f * (localPointA1 + localPointA2); - b2Vec2 pointA = b2Mul(xfA, m_localPoint); - - b2Vec2 localPointB = m_proxyB->GetVertex(cache->indexB[0]); - b2Vec2 pointB = b2Mul(xfB, localPointB); - - float32 s = b2Dot(pointB - pointA, normal); - if (s < 0.0f) - { - m_axis = -m_axis; - s = -s; - } - return s; - } - } - - float32 FindMinSeparation(int32* indexA, int32* indexB, float32 t) const - { - b2Transform xfA, xfB; - m_sweepA.GetTransform(&xfA, t); - m_sweepB.GetTransform(&xfB, t); - - switch (m_type) - { - case e_points: - { - b2Vec2 axisA = b2MulT(xfA.q, m_axis); - b2Vec2 axisB = b2MulT(xfB.q, -m_axis); - - *indexA = m_proxyA->GetSupport(axisA); - *indexB = m_proxyB->GetSupport(axisB); - - b2Vec2 localPointA = m_proxyA->GetVertex(*indexA); - b2Vec2 localPointB = m_proxyB->GetVertex(*indexB); - - b2Vec2 pointA = b2Mul(xfA, localPointA); - b2Vec2 pointB = b2Mul(xfB, localPointB); - - float32 separation = b2Dot(pointB - pointA, m_axis); - return separation; - } - - case e_faceA: - { - b2Vec2 normal = b2Mul(xfA.q, m_axis); - b2Vec2 pointA = b2Mul(xfA, m_localPoint); - - b2Vec2 axisB = b2MulT(xfB.q, -normal); - - *indexA = -1; - *indexB = m_proxyB->GetSupport(axisB); - - b2Vec2 localPointB = m_proxyB->GetVertex(*indexB); - b2Vec2 pointB = b2Mul(xfB, localPointB); - - float32 separation = b2Dot(pointB - pointA, normal); - return separation; - } - - case e_faceB: - { - b2Vec2 normal = b2Mul(xfB.q, m_axis); - b2Vec2 pointB = b2Mul(xfB, m_localPoint); - - b2Vec2 axisA = b2MulT(xfA.q, -normal); - - *indexB = -1; - *indexA = m_proxyA->GetSupport(axisA); - - b2Vec2 localPointA = m_proxyA->GetVertex(*indexA); - b2Vec2 pointA = b2Mul(xfA, localPointA); - - float32 separation = b2Dot(pointA - pointB, normal); - return separation; - } - - default: - b2Assert(false); - *indexA = -1; - *indexB = -1; - return 0.0f; - } - } - - float32 Evaluate(int32 indexA, int32 indexB, float32 t) const - { - b2Transform xfA, xfB; - m_sweepA.GetTransform(&xfA, t); - m_sweepB.GetTransform(&xfB, t); - - switch (m_type) - { - case e_points: - { - b2Vec2 axisA = b2MulT(xfA.q, m_axis); - b2Vec2 axisB = b2MulT(xfB.q, -m_axis); - - b2Vec2 localPointA = m_proxyA->GetVertex(indexA); - b2Vec2 localPointB = m_proxyB->GetVertex(indexB); - - b2Vec2 pointA = b2Mul(xfA, localPointA); - b2Vec2 pointB = b2Mul(xfB, localPointB); - float32 separation = b2Dot(pointB - pointA, m_axis); - - return separation; - } - - case e_faceA: - { - b2Vec2 normal = b2Mul(xfA.q, m_axis); - b2Vec2 pointA = b2Mul(xfA, m_localPoint); - - b2Vec2 axisB = b2MulT(xfB.q, -normal); - - b2Vec2 localPointB = m_proxyB->GetVertex(indexB); - b2Vec2 pointB = b2Mul(xfB, localPointB); - - float32 separation = b2Dot(pointB - pointA, normal); - return separation; - } - - case e_faceB: - { - b2Vec2 normal = b2Mul(xfB.q, m_axis); - b2Vec2 pointB = b2Mul(xfB, m_localPoint); - - b2Vec2 axisA = b2MulT(xfA.q, -normal); - - b2Vec2 localPointA = m_proxyA->GetVertex(indexA); - b2Vec2 pointA = b2Mul(xfA, localPointA); - - float32 separation = b2Dot(pointA - pointB, normal); - return separation; - } - - default: - b2Assert(false); - return 0.0f; - } - } - - const b2DistanceProxy* m_proxyA; - const b2DistanceProxy* m_proxyB; - b2Sweep m_sweepA, m_sweepB; - Type m_type; - b2Vec2 m_localPoint; - b2Vec2 m_axis; -}; - -// CCD via the local separating axis method. This seeks progression -// by computing the largest time at which separation is maintained. -void b2TimeOfImpact(b2TOIOutput* output, const b2TOIInput* input) -{ - ++b2_toiCalls; - - output->state = b2TOIOutput::e_unknown; - output->t = input->tMax; - - const b2DistanceProxy* proxyA = &input->proxyA; - const b2DistanceProxy* proxyB = &input->proxyB; - - b2Sweep sweepA = input->sweepA; - b2Sweep sweepB = input->sweepB; - - // Large rotations can make the root finder fail, so we normalize the - // sweep angles. - sweepA.Normalize(); - sweepB.Normalize(); - - float32 tMax = input->tMax; - - float32 totalRadius = proxyA->m_radius + proxyB->m_radius; - float32 target = b2Max(b2_linearSlop, totalRadius - 3.0f * b2_linearSlop); - float32 tolerance = 0.25f * b2_linearSlop; - b2Assert(target > tolerance); - - float32 t1 = 0.0f; - const int32 k_maxIterations = 20; // TODO_ERIN b2Settings - int32 iter = 0; - - // Prepare input for distance query. - b2SimplexCache cache; - cache.count = 0; - b2DistanceInput distanceInput; - distanceInput.proxyA = input->proxyA; - distanceInput.proxyB = input->proxyB; - distanceInput.useRadii = false; - - // The outer loop progressively attempts to compute new separating axes. - // This loop terminates when an axis is repeated (no progress is made). - for(;;) - { - b2Transform xfA, xfB; - sweepA.GetTransform(&xfA, t1); - sweepB.GetTransform(&xfB, t1); - - // Get the distance between shapes. We can also use the results - // to get a separating axis. - distanceInput.transformA = xfA; - distanceInput.transformB = xfB; - b2DistanceOutput distanceOutput; - b2Distance(&distanceOutput, &cache, &distanceInput); - - // If the shapes are overlapped, we give up on continuous collision. - if (distanceOutput.distance <= 0.0f) - { - // Failure! - output->state = b2TOIOutput::e_overlapped; - output->t = 0.0f; - break; - } - - if (distanceOutput.distance < target + tolerance) - { - // Victory! - output->state = b2TOIOutput::e_touching; - output->t = t1; - break; - } - - // Initialize the separating axis. - b2SeparationFunction fcn; - fcn.Initialize(&cache, proxyA, sweepA, proxyB, sweepB, t1); -#if 0 - // Dump the curve seen by the root finder - { - const int32 N = 100; - float32 dx = 1.0f / N; - float32 xs[N+1]; - float32 fs[N+1]; - - float32 x = 0.0f; - - for (int32 i = 0; i <= N; ++i) - { - sweepA.GetTransform(&xfA, x); - sweepB.GetTransform(&xfB, x); - float32 f = fcn.Evaluate(xfA, xfB) - target; - - printf("%g %g\n", x, f); - - xs[i] = x; - fs[i] = f; - - x += dx; - } - } -#endif - - // Compute the TOI on the separating axis. We do this by successively - // resolving the deepest point. This loop is bounded by the number of vertices. - bool done = false; - float32 t2 = tMax; - int32 pushBackIter = 0; - for (;;) - { - // Find the deepest point at t2. Store the witness point indices. - int32 indexA, indexB; - float32 s2 = fcn.FindMinSeparation(&indexA, &indexB, t2); - - // Is the final configuration separated? - if (s2 > target + tolerance) - { - // Victory! - output->state = b2TOIOutput::e_separated; - output->t = tMax; - done = true; - break; - } - - // Has the separation reached tolerance? - if (s2 > target - tolerance) - { - // Advance the sweeps - t1 = t2; - break; - } - - // Compute the initial separation of the witness points. - float32 s1 = fcn.Evaluate(indexA, indexB, t1); - - // Check for initial overlap. This might happen if the root finder - // runs out of iterations. - if (s1 < target - tolerance) - { - output->state = b2TOIOutput::e_failed; - output->t = t1; - done = true; - break; - } - - // Check for touching - if (s1 <= target + tolerance) - { - // Victory! t1 should hold the TOI (could be 0.0). - output->state = b2TOIOutput::e_touching; - output->t = t1; - done = true; - break; - } - - // Compute 1D root of: f(x) - target = 0 - int32 rootIterCount = 0; - float32 a1 = t1, a2 = t2; - for (;;) - { - // Use a mix of the secant rule and bisection. - float32 t; - if (rootIterCount & 1) - { - // Secant rule to improve convergence. - t = a1 + (target - s1) * (a2 - a1) / (s2 - s1); - } - else - { - // Bisection to guarantee progress. - t = 0.5f * (a1 + a2); - } - - float32 s = fcn.Evaluate(indexA, indexB, t); - - if (b2Abs(s - target) < tolerance) - { - // t2 holds a tentative value for t1 - t2 = t; - break; - } - - // Ensure we continue to bracket the root. - if (s > target) - { - a1 = t; - s1 = s; - } - else - { - a2 = t; - s2 = s; - } - - ++rootIterCount; - ++b2_toiRootIters; - - if (rootIterCount == 50) - { - break; - } - } - - b2_toiMaxRootIters = b2Max(b2_toiMaxRootIters, rootIterCount); - - ++pushBackIter; - - if (pushBackIter == b2_maxPolygonVertices) - { - break; - } - } - - ++iter; - ++b2_toiIters; - - if (done) - { - break; - } - - if (iter == k_maxIterations) - { - // Root finder got stuck. Semi-victory. - output->state = b2TOIOutput::e_failed; - output->t = t1; - break; - } - } - - b2_toiMaxIters = b2Max(b2_toiMaxIters, iter); -} diff --git a/external/Box2D/Collision/b2TimeOfImpact.h b/external/Box2D/Collision/b2TimeOfImpact.h deleted file mode 100644 index 2e4f8228ff..0000000000 --- a/external/Box2D/Collision/b2TimeOfImpact.h +++ /dev/null @@ -1,58 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_TIME_OF_IMPACT_H -#define B2_TIME_OF_IMPACT_H - -#include -#include - -/// Input parameters for b2TimeOfImpact -struct b2TOIInput -{ - b2DistanceProxy proxyA; - b2DistanceProxy proxyB; - b2Sweep sweepA; - b2Sweep sweepB; - float32 tMax; // defines sweep interval [0, tMax] -}; - -// Output parameters for b2TimeOfImpact. -struct b2TOIOutput -{ - enum State - { - e_unknown, - e_failed, - e_overlapped, - e_touching, - e_separated - }; - - State state; - float32 t; -}; - -/// Compute the upper bound on time before two shapes penetrate. Time is represented as -/// a fraction between [0,tMax]. This uses a swept separating axis and may miss some intermediate, -/// non-tunneling collision. If you change the time interval, you should call this function -/// again. -/// Note: use b2Distance to compute the contact point and normal at the time of impact. -void b2TimeOfImpact(b2TOIOutput* output, const b2TOIInput* input); - -#endif diff --git a/external/Box2D/Common/b2BlockAllocator.cpp b/external/Box2D/Common/b2BlockAllocator.cpp deleted file mode 100644 index 2e862091f9..0000000000 --- a/external/Box2D/Common/b2BlockAllocator.cpp +++ /dev/null @@ -1,218 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include -#include -#include - -using namespace std; - -int32 b2BlockAllocator::s_blockSizes[b2_blockSizes] = -{ - 16, // 0 - 32, // 1 - 64, // 2 - 96, // 3 - 128, // 4 - 160, // 5 - 192, // 6 - 224, // 7 - 256, // 8 - 320, // 9 - 384, // 10 - 448, // 11 - 512, // 12 - 640, // 13 -}; -uint8 b2BlockAllocator::s_blockSizeLookup[b2_maxBlockSize + 1]; -bool b2BlockAllocator::s_blockSizeLookupInitialized; - -struct b2Chunk -{ - int32 blockSize; - b2Block* blocks; -}; - -struct b2Block -{ - b2Block* next; -}; - -b2BlockAllocator::b2BlockAllocator() -{ - b2Assert(b2_blockSizes < UCHAR_MAX); - - m_chunkSpace = b2_chunkArrayIncrement; - m_chunkCount = 0; - m_chunks = (b2Chunk*)b2Alloc(m_chunkSpace * sizeof(b2Chunk)); - - memset(m_chunks, 0, m_chunkSpace * sizeof(b2Chunk)); - memset(m_freeLists, 0, sizeof(m_freeLists)); - - if (s_blockSizeLookupInitialized == false) - { - int32 j = 0; - for (int32 i = 1; i <= b2_maxBlockSize; ++i) - { - b2Assert(j < b2_blockSizes); - if (i <= s_blockSizes[j]) - { - s_blockSizeLookup[i] = (uint8)j; - } - else - { - ++j; - s_blockSizeLookup[i] = (uint8)j; - } - } - - s_blockSizeLookupInitialized = true; - } -} - -b2BlockAllocator::~b2BlockAllocator() -{ - for (int32 i = 0; i < m_chunkCount; ++i) - { - b2Free(m_chunks[i].blocks); - } - - b2Free(m_chunks); -} - -void* b2BlockAllocator::Allocate(int32 size) -{ - if (size == 0) - return NULL; - - b2Assert(0 < size); - - if (size > b2_maxBlockSize) - { - return b2Alloc(size); - } - - int32 index = s_blockSizeLookup[size]; - b2Assert(0 <= index && index < b2_blockSizes); - - if (m_freeLists[index]) - { - b2Block* block = m_freeLists[index]; - m_freeLists[index] = block->next; - return block; - } - else - { - if (m_chunkCount == m_chunkSpace) - { - b2Chunk* oldChunks = m_chunks; - m_chunkSpace += b2_chunkArrayIncrement; - m_chunks = (b2Chunk*)b2Alloc(m_chunkSpace * sizeof(b2Chunk)); - memcpy(m_chunks, oldChunks, m_chunkCount * sizeof(b2Chunk)); - memset(m_chunks + m_chunkCount, 0, b2_chunkArrayIncrement * sizeof(b2Chunk)); - b2Free(oldChunks); - } - - b2Chunk* chunk = m_chunks + m_chunkCount; - chunk->blocks = (b2Block*)b2Alloc(b2_chunkSize); -#if defined(_DEBUG) - memset(chunk->blocks, 0xcd, b2_chunkSize); -#endif - int32 blockSize = s_blockSizes[index]; - chunk->blockSize = blockSize; - int32 blockCount = b2_chunkSize / blockSize; - b2Assert(blockCount * blockSize <= b2_chunkSize); - for (int32 i = 0; i < blockCount - 1; ++i) - { - b2Block* block = (b2Block*)((int8*)chunk->blocks + blockSize * i); - b2Block* next = (b2Block*)((int8*)chunk->blocks + blockSize * (i + 1)); - block->next = next; - } - b2Block* last = (b2Block*)((int8*)chunk->blocks + blockSize * (blockCount - 1)); - last->next = NULL; - - m_freeLists[index] = chunk->blocks->next; - ++m_chunkCount; - - return chunk->blocks; - } -} - -void b2BlockAllocator::Free(void* p, int32 size) -{ - if (size == 0) - { - return; - } - - b2Assert(0 < size); - - if (size > b2_maxBlockSize) - { - b2Free(p); - return; - } - - int32 index = s_blockSizeLookup[size]; - b2Assert(0 <= index && index < b2_blockSizes); - -#ifdef _DEBUG - // Verify the memory address and size is valid. - int32 blockSize = s_blockSizes[index]; - bool found = false; - for (int32 i = 0; i < m_chunkCount; ++i) - { - b2Chunk* chunk = m_chunks + i; - if (chunk->blockSize != blockSize) - { - b2Assert( (int8*)p + blockSize <= (int8*)chunk->blocks || - (int8*)chunk->blocks + b2_chunkSize <= (int8*)p); - } - else - { - if ((int8*)chunk->blocks <= (int8*)p && (int8*)p + blockSize <= (int8*)chunk->blocks + b2_chunkSize) - { - found = true; - } - } - } - - b2Assert(found); - - memset(p, 0xfd, blockSize); -#endif - - b2Block* block = (b2Block*)p; - block->next = m_freeLists[index]; - m_freeLists[index] = block; -} - -void b2BlockAllocator::Clear() -{ - for (int32 i = 0; i < m_chunkCount; ++i) - { - b2Free(m_chunks[i].blocks); - } - - m_chunkCount = 0; - memset(m_chunks, 0, m_chunkSpace * sizeof(b2Chunk)); - - memset(m_freeLists, 0, sizeof(m_freeLists)); -} diff --git a/external/Box2D/Common/b2BlockAllocator.h b/external/Box2D/Common/b2BlockAllocator.h deleted file mode 100644 index ec221fdf61..0000000000 --- a/external/Box2D/Common/b2BlockAllocator.h +++ /dev/null @@ -1,62 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_BLOCK_ALLOCATOR_H -#define B2_BLOCK_ALLOCATOR_H - -#include - -const int32 b2_chunkSize = 16 * 1024; -const int32 b2_maxBlockSize = 640; -const int32 b2_blockSizes = 14; -const int32 b2_chunkArrayIncrement = 128; - -struct b2Block; -struct b2Chunk; - -/// This is a small object allocator used for allocating small -/// objects that persist for more than one time step. -/// See: http://www.codeproject.com/useritems/Small_Block_Allocator.asp -class b2BlockAllocator -{ -public: - b2BlockAllocator(); - ~b2BlockAllocator(); - - /// Allocate memory. This will use b2Alloc if the size is larger than b2_maxBlockSize. - void* Allocate(int32 size); - - /// Free memory. This will use b2Free if the size is larger than b2_maxBlockSize. - void Free(void* p, int32 size); - - void Clear(); - -private: - - b2Chunk* m_chunks; - int32 m_chunkCount; - int32 m_chunkSpace; - - b2Block* m_freeLists[b2_blockSizes]; - - static int32 s_blockSizes[b2_blockSizes]; - static uint8 s_blockSizeLookup[b2_maxBlockSize + 1]; - static bool s_blockSizeLookupInitialized; -}; - -#endif diff --git a/external/Box2D/Common/b2Draw.cpp b/external/Box2D/Common/b2Draw.cpp deleted file mode 100644 index cb760025e9..0000000000 --- a/external/Box2D/Common/b2Draw.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/* -* Copyright (c) 2011 Erin Catto http://box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include - -b2Draw::b2Draw() -{ - m_drawFlags = 0; -} - -void b2Draw::SetFlags(uint32 flags) -{ - m_drawFlags = flags; -} - -uint32 b2Draw::GetFlags() const -{ - return m_drawFlags; -} - -void b2Draw::AppendFlags(uint32 flags) -{ - m_drawFlags |= flags; -} - -void b2Draw::ClearFlags(uint32 flags) -{ - m_drawFlags &= ~flags; -} diff --git a/external/Box2D/Common/b2Draw.h b/external/Box2D/Common/b2Draw.h deleted file mode 100644 index b33cd8d38f..0000000000 --- a/external/Box2D/Common/b2Draw.h +++ /dev/null @@ -1,81 +0,0 @@ -/* -* Copyright (c) 2011 Erin Catto http://box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include - -/// Color for debug drawing. Each value has the range [0,1]. -struct b2Color -{ - b2Color() {} - b2Color(float32 r, float32 g, float32 b) : r(r), g(g), b(b) {} - void Set(float32 ri, float32 gi, float32 bi) { r = ri; g = gi; b = bi; } - float32 r, g, b; -}; - -/// Implement and register this class with a b2World to provide debug drawing of physics -/// entities in your game. -class b2Draw -{ -public: - b2Draw(); - - virtual ~b2Draw() {} - - enum - { - e_shapeBit = 0x0001, ///< draw shapes - e_jointBit = 0x0002, ///< draw joint connections - e_aabbBit = 0x0004, ///< draw axis aligned bounding boxes - e_pairBit = 0x0008, ///< draw broad-phase pairs - e_centerOfMassBit = 0x0010 ///< draw center of mass frame - }; - - /// Set the drawing flags. - void SetFlags(uint32 flags); - - /// Get the drawing flags. - uint32 GetFlags() const; - - /// Append flags to the current flags. - void AppendFlags(uint32 flags); - - /// Clear flags from the current flags. - void ClearFlags(uint32 flags); - - /// Draw a closed polygon provided in CCW order. - virtual void DrawPolygon(const b2Vec2* vertices, int32 vertexCount, const b2Color& color) = 0; - - /// Draw a solid closed polygon provided in CCW order. - virtual void DrawSolidPolygon(const b2Vec2* vertices, int32 vertexCount, const b2Color& color) = 0; - - /// Draw a circle. - virtual void DrawCircle(const b2Vec2& center, float32 radius, const b2Color& color) = 0; - - /// Draw a solid circle. - virtual void DrawSolidCircle(const b2Vec2& center, float32 radius, const b2Vec2& axis, const b2Color& color) = 0; - - /// Draw a line segment. - virtual void DrawSegment(const b2Vec2& p1, const b2Vec2& p2, const b2Color& color) = 0; - - /// Draw a transform. Choose your own length scale. - /// @param xf a transform. - virtual void DrawTransform(const b2Transform& xf) = 0; - -protected: - uint32 m_drawFlags; -}; diff --git a/external/Box2D/Common/b2GrowableStack.h b/external/Box2D/Common/b2GrowableStack.h deleted file mode 100644 index 68809521f4..0000000000 --- a/external/Box2D/Common/b2GrowableStack.h +++ /dev/null @@ -1,85 +0,0 @@ -/* -* Copyright (c) 2010 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_GROWABLE_STACK_H -#define B2_GROWABLE_STACK_H -#include -#include - -/// This is a growable LIFO stack with an initial capacity of N. -/// If the stack size exceeds the initial capacity, the heap is used -/// to increase the size of the stack. -template -class b2GrowableStack -{ -public: - b2GrowableStack() - { - m_stack = m_array; - m_count = 0; - m_capacity = N; - } - - ~b2GrowableStack() - { - if (m_stack != m_array) - { - b2Free(m_stack); - m_stack = NULL; - } - } - - void Push(const T& element) - { - if (m_count == m_capacity) - { - T* old = m_stack; - m_capacity *= 2; - m_stack = (T*)b2Alloc(m_capacity * sizeof(T)); - std::memcpy(m_stack, old, m_count * sizeof(T)); - if (old != m_array) - { - b2Free(old); - } - } - - m_stack[m_count] = element; - ++m_count; - } - - T Pop() - { - b2Assert(m_count > 0); - --m_count; - return m_stack[m_count]; - } - - int32 GetCount() - { - return m_count; - } - -private: - T* m_stack; - T m_array[N]; - int32 m_count; - int32 m_capacity; -}; - - -#endif diff --git a/external/Box2D/Common/b2Math.cpp b/external/Box2D/Common/b2Math.cpp deleted file mode 100644 index 15d68fce96..0000000000 --- a/external/Box2D/Common/b2Math.cpp +++ /dev/null @@ -1,94 +0,0 @@ -/* -* Copyright (c) 2007-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include - -const b2Vec2 b2Vec2_zero(0.0f, 0.0f); - -/// Solve A * x = b, where b is a column vector. This is more efficient -/// than computing the inverse in one-shot cases. -b2Vec3 b2Mat33::Solve33(const b2Vec3& b) const -{ - float32 det = b2Dot(ex, b2Cross(ey, ez)); - if (det != 0.0f) - { - det = 1.0f / det; - } - b2Vec3 x; - x.x = det * b2Dot(b, b2Cross(ey, ez)); - x.y = det * b2Dot(ex, b2Cross(b, ez)); - x.z = det * b2Dot(ex, b2Cross(ey, b)); - return x; -} - -/// Solve A * x = b, where b is a column vector. This is more efficient -/// than computing the inverse in one-shot cases. -b2Vec2 b2Mat33::Solve22(const b2Vec2& b) const -{ - float32 a11 = ex.x, a12 = ey.x, a21 = ex.y, a22 = ey.y; - float32 det = a11 * a22 - a12 * a21; - if (det != 0.0f) - { - det = 1.0f / det; - } - b2Vec2 x; - x.x = det * (a22 * b.x - a12 * b.y); - x.y = det * (a11 * b.y - a21 * b.x); - return x; -} - -/// -void b2Mat33::GetInverse22(b2Mat33* M) const -{ - float32 a = ex.x, b = ey.x, c = ex.y, d = ey.y; - float32 det = a * d - b * c; - if (det != 0.0f) - { - det = 1.0f / det; - } - - M->ex.x = det * d; M->ey.x = -det * b; M->ex.z = 0.0f; - M->ex.y = -det * c; M->ey.y = det * a; M->ey.z = 0.0f; - M->ez.x = 0.0f; M->ez.y = 0.0f; M->ez.z = 0.0f; -} - -/// Returns the zero matrix if singular. -void b2Mat33::GetSymInverse33(b2Mat33* M) const -{ - float32 det = b2Dot(ex, b2Cross(ey, ez)); - if (det != 0.0f) - { - det = 1.0f / det; - } - - float32 a11 = ex.x, a12 = ey.x, a13 = ez.x; - float32 a22 = ey.y, a23 = ez.y; - float32 a33 = ez.z; - - M->ex.x = det * (a22 * a33 - a23 * a23); - M->ex.y = det * (a13 * a23 - a12 * a33); - M->ex.z = det * (a12 * a23 - a13 * a22); - - M->ey.x = M->ex.y; - M->ey.y = det * (a11 * a33 - a13 * a13); - M->ey.z = det * (a13 * a12 - a11 * a23); - - M->ez.x = M->ex.z; - M->ez.y = M->ey.z; - M->ez.z = det * (a11 * a22 - a12 * a12); -} diff --git a/external/Box2D/Common/b2Math.h b/external/Box2D/Common/b2Math.h deleted file mode 100644 index a6be671139..0000000000 --- a/external/Box2D/Common/b2Math.h +++ /dev/null @@ -1,738 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_MATH_H -#define B2_MATH_H - -#include - -#include -#ifndef SHP -#include -#else -#include -#endif -#include -#include - -using namespace std; - - -/// This function is used to ensure that a floating point number is -/// not a NaN or infinity. -inline bool b2IsValid(float32 x) -{ - if (x != x) - { - // NaN. - return false; - } - - float32 infinity = std::numeric_limits::infinity(); - return -infinity < x && x < infinity; -} - -/// This is a approximate yet fast inverse square-root. -inline float32 b2InvSqrt(float32 x) -{ - union - { - float32 x; - int32 i; - } convert; - - convert.x = x; - float32 xhalf = 0.5f * x; - convert.i = 0x5f3759df - (convert.i >> 1); - x = convert.x; - x = x * (1.5f - xhalf * x * x); - return x; -} - -#define b2Sqrt(x) std::sqrt(x) -#define b2Atan2(y, x) std::atan2(y, x) - -/// A 2D column vector. -struct b2Vec2 -{ - /// Default constructor does nothing (for performance). - b2Vec2() {} - - /// Construct using coordinates. - b2Vec2(float32 x, float32 y) : x(x), y(y) {} - - /// Set this vector to all zeros. - void SetZero() { x = 0.0f; y = 0.0f; } - - /// Set this vector to some specified coordinates. - void Set(float32 x_, float32 y_) { x = x_; y = y_; } - - /// Negate this vector. - b2Vec2 operator -() const { b2Vec2 v; v.Set(-x, -y); return v; } - - /// Read from and indexed element. - float32 operator () (int32 i) const - { - return (&x)[i]; - } - - /// Write to an indexed element. - float32& operator () (int32 i) - { - return (&x)[i]; - } - - /// Add a vector to this vector. - void operator += (const b2Vec2& v) - { - x += v.x; y += v.y; - } - - /// Subtract a vector from this vector. - void operator -= (const b2Vec2& v) - { - x -= v.x; y -= v.y; - } - - /// Multiply this vector by a scalar. - void operator *= (float32 a) - { - x *= a; y *= a; - } - - /// Get the length of this vector (the norm). - float32 Length() const - { - return b2Sqrt(x * x + y * y); - } - - /// Get the length squared. For performance, use this instead of - /// b2Vec2::Length (if possible). - float32 LengthSquared() const - { - return x * x + y * y; - } - - /// Convert this vector into a unit vector. Returns the length. - float32 Normalize() - { - float32 length = Length(); - if (length < b2_epsilon) - { - return 0.0f; - } - float32 invLength = 1.0f / length; - x *= invLength; - y *= invLength; - - return length; - } - - /// Does this vector contain finite coordinates? - bool IsValid() const - { - return b2IsValid(x) && b2IsValid(y); - } - - /// Get the skew vector such that dot(skew_vec, other) == cross(vec, other) - b2Vec2 Skew() const - { - return b2Vec2(-y, x); - } - - float32 x, y; -}; - -/// A 2D column vector with 3 elements. -struct b2Vec3 -{ - /// Default constructor does nothing (for performance). - b2Vec3() {} - - /// Construct using coordinates. - b2Vec3(float32 x, float32 y, float32 z) : x(x), y(y), z(z) {} - - /// Set this vector to all zeros. - void SetZero() { x = 0.0f; y = 0.0f; z = 0.0f; } - - /// Set this vector to some specified coordinates. - void Set(float32 x_, float32 y_, float32 z_) { x = x_; y = y_; z = z_; } - - /// Negate this vector. - b2Vec3 operator -() const { b2Vec3 v; v.Set(-x, -y, -z); return v; } - - /// Add a vector to this vector. - void operator += (const b2Vec3& v) - { - x += v.x; y += v.y; z += v.z; - } - - /// Subtract a vector from this vector. - void operator -= (const b2Vec3& v) - { - x -= v.x; y -= v.y; z -= v.z; - } - - /// Multiply this vector by a scalar. - void operator *= (float32 s) - { - x *= s; y *= s; z *= s; - } - - float32 x, y, z; -}; - -/// A 2-by-2 matrix. Stored in column-major order. -struct b2Mat22 -{ - /// The default constructor does nothing (for performance). - b2Mat22() {} - - /// Construct this matrix using columns. - b2Mat22(const b2Vec2& c1, const b2Vec2& c2) - { - ex = c1; - ey = c2; - } - - /// Construct this matrix using scalars. - b2Mat22(float32 a11, float32 a12, float32 a21, float32 a22) - { - ex.x = a11; ex.y = a21; - ey.x = a12; ey.y = a22; - } - - /// Initialize this matrix using columns. - void Set(const b2Vec2& c1, const b2Vec2& c2) - { - ex = c1; - ey = c2; - } - - /// Set this to the identity matrix. - void SetIdentity() - { - ex.x = 1.0f; ey.x = 0.0f; - ex.y = 0.0f; ey.y = 1.0f; - } - - /// Set this matrix to all zeros. - void SetZero() - { - ex.x = 0.0f; ey.x = 0.0f; - ex.y = 0.0f; ey.y = 0.0f; - } - - b2Mat22 GetInverse() const - { - float32 a = ex.x, b = ey.x, c = ex.y, d = ey.y; - b2Mat22 B; - float32 det = a * d - b * c; - if (det != 0.0f) - { - det = 1.0f / det; - } - B.ex.x = det * d; B.ey.x = -det * b; - B.ex.y = -det * c; B.ey.y = det * a; - return B; - } - - /// Solve A * x = b, where b is a column vector. This is more efficient - /// than computing the inverse in one-shot cases. - b2Vec2 Solve(const b2Vec2& b) const - { - float32 a11 = ex.x, a12 = ey.x, a21 = ex.y, a22 = ey.y; - float32 det = a11 * a22 - a12 * a21; - if (det != 0.0f) - { - det = 1.0f / det; - } - b2Vec2 x; - x.x = det * (a22 * b.x - a12 * b.y); - x.y = det * (a11 * b.y - a21 * b.x); - return x; - } - - b2Vec2 ex, ey; -}; - -/// A 3-by-3 matrix. Stored in column-major order. -struct b2Mat33 -{ - /// The default constructor does nothing (for performance). - b2Mat33() {} - - /// Construct this matrix using columns. - b2Mat33(const b2Vec3& c1, const b2Vec3& c2, const b2Vec3& c3) - { - ex = c1; - ey = c2; - ez = c3; - } - - /// Set this matrix to all zeros. - void SetZero() - { - ex.SetZero(); - ey.SetZero(); - ez.SetZero(); - } - - /// Solve A * x = b, where b is a column vector. This is more efficient - /// than computing the inverse in one-shot cases. - b2Vec3 Solve33(const b2Vec3& b) const; - - /// Solve A * x = b, where b is a column vector. This is more efficient - /// than computing the inverse in one-shot cases. Solve only the upper - /// 2-by-2 matrix equation. - b2Vec2 Solve22(const b2Vec2& b) const; - - /// Get the inverse of this matrix as a 2-by-2. - /// Returns the zero matrix if singular. - void GetInverse22(b2Mat33* M) const; - - /// Get the symmetric inverse of this matrix as a 3-by-3. - /// Returns the zero matrix if singular. - void GetSymInverse33(b2Mat33* M) const; - - b2Vec3 ex, ey, ez; -}; - -/// Rotation -struct b2Rot -{ - b2Rot() {} - - /// Initialize from an angle in radians - explicit b2Rot(float32 angle) - { - /// TODO_ERIN optimize - s = sinf(angle); - c = cosf(angle); - } - - /// Set using an angle in radians. - void Set(float32 angle) - { - /// TODO_ERIN optimize - s = sinf(angle); - c = cosf(angle); - } - - /// Set to the identity rotation - void SetIdentity() - { - s = 0.0f; - c = 1.0f; - } - - /// Get the angle in radians - float32 GetAngle() const - { - return b2Atan2(s, c); - } - - /// Get the x-axis - b2Vec2 GetXAxis() const - { - return b2Vec2(c, s); - } - - /// Get the u-axis - b2Vec2 GetYAxis() const - { - return b2Vec2(-s, c); - } - - /// Sine and cosine - float32 s, c; -}; - -/// A transform contains translation and rotation. It is used to represent -/// the position and orientation of rigid frames. -struct b2Transform -{ - /// The default constructor does nothing. - b2Transform() {} - - /// Initialize using a position vector and a rotation. - b2Transform(const b2Vec2& position, const b2Rot& rotation) : p(position), q(rotation) {} - - /// Set this to the identity transform. - void SetIdentity() - { - p.SetZero(); - q.SetIdentity(); - } - - /// Set this based on the position and angle. - void Set(const b2Vec2& position, float32 angle) - { - p = position; - q.Set(angle); - } - - b2Vec2 p; - b2Rot q; -}; - -/// This describes the motion of a body/shape for TOI computation. -/// Shapes are defined with respect to the body origin, which may -/// no coincide with the center of mass. However, to support dynamics -/// we must interpolate the center of mass position. -struct b2Sweep -{ - /// Get the interpolated transform at a specific time. - /// @param beta is a factor in [0,1], where 0 indicates alpha0. - void GetTransform(b2Transform* xfb, float32 beta) const; - - /// Advance the sweep forward, yielding a new initial state. - /// @param alpha the new initial time. - void Advance(float32 alpha); - - /// Normalize the angles. - void Normalize(); - - b2Vec2 localCenter; ///< local center of mass position - b2Vec2 c0, c; ///< center world positions - float32 a0, a; ///< world angles - - /// Fraction of the current time step in the range [0,1] - /// c0 and a0 are the positions at alpha0. - float32 alpha0; -}; - -/// Useful constant -extern const b2Vec2 b2Vec2_zero; - -/// Perform the dot product on two vectors. -inline float32 b2Dot(const b2Vec2& a, const b2Vec2& b) -{ - return a.x * b.x + a.y * b.y; -} - -/// Perform the cross product on two vectors. In 2D this produces a scalar. -inline float32 b2Cross(const b2Vec2& a, const b2Vec2& b) -{ - return a.x * b.y - a.y * b.x; -} - -/// Perform the cross product on a vector and a scalar. In 2D this produces -/// a vector. -inline b2Vec2 b2Cross(const b2Vec2& a, float32 s) -{ - return b2Vec2(s * a.y, -s * a.x); -} - -/// Perform the cross product on a scalar and a vector. In 2D this produces -/// a vector. -inline b2Vec2 b2Cross(float32 s, const b2Vec2& a) -{ - return b2Vec2(-s * a.y, s * a.x); -} - -/// Multiply a matrix times a vector. If a rotation matrix is provided, -/// then this transforms the vector from one frame to another. -inline b2Vec2 b2Mul(const b2Mat22& A, const b2Vec2& v) -{ - return b2Vec2(A.ex.x * v.x + A.ey.x * v.y, A.ex.y * v.x + A.ey.y * v.y); -} - -/// Multiply a matrix transpose times a vector. If a rotation matrix is provided, -/// then this transforms the vector from one frame to another (inverse transform). -inline b2Vec2 b2MulT(const b2Mat22& A, const b2Vec2& v) -{ - return b2Vec2(b2Dot(v, A.ex), b2Dot(v, A.ey)); -} - -/// Add two vectors component-wise. -inline b2Vec2 operator + (const b2Vec2& a, const b2Vec2& b) -{ - return b2Vec2(a.x + b.x, a.y + b.y); -} - -/// Subtract two vectors component-wise. -inline b2Vec2 operator - (const b2Vec2& a, const b2Vec2& b) -{ - return b2Vec2(a.x - b.x, a.y - b.y); -} - -inline b2Vec2 operator * (float32 s, const b2Vec2& a) -{ - return b2Vec2(s * a.x, s * a.y); -} - -inline bool operator == (const b2Vec2& a, const b2Vec2& b) -{ - return a.x == b.x && a.y == b.y; -} - -inline float32 b2Distance(const b2Vec2& a, const b2Vec2& b) -{ - b2Vec2 c = a - b; - return c.Length(); -} - -inline float32 b2DistanceSquared(const b2Vec2& a, const b2Vec2& b) -{ - b2Vec2 c = a - b; - return b2Dot(c, c); -} - -inline b2Vec3 operator * (float32 s, const b2Vec3& a) -{ - return b2Vec3(s * a.x, s * a.y, s * a.z); -} - -/// Add two vectors component-wise. -inline b2Vec3 operator + (const b2Vec3& a, const b2Vec3& b) -{ - return b2Vec3(a.x + b.x, a.y + b.y, a.z + b.z); -} - -/// Subtract two vectors component-wise. -inline b2Vec3 operator - (const b2Vec3& a, const b2Vec3& b) -{ - return b2Vec3(a.x - b.x, a.y - b.y, a.z - b.z); -} - -/// Perform the dot product on two vectors. -inline float32 b2Dot(const b2Vec3& a, const b2Vec3& b) -{ - return a.x * b.x + a.y * b.y + a.z * b.z; -} - -/// Perform the cross product on two vectors. -inline b2Vec3 b2Cross(const b2Vec3& a, const b2Vec3& b) -{ - return b2Vec3(a.y * b.z - a.z * b.y, a.z * b.x - a.x * b.z, a.x * b.y - a.y * b.x); -} - -inline b2Mat22 operator + (const b2Mat22& A, const b2Mat22& B) -{ - return b2Mat22(A.ex + B.ex, A.ey + B.ey); -} - -// A * B -inline b2Mat22 b2Mul(const b2Mat22& A, const b2Mat22& B) -{ - return b2Mat22(b2Mul(A, B.ex), b2Mul(A, B.ey)); -} - -// A^T * B -inline b2Mat22 b2MulT(const b2Mat22& A, const b2Mat22& B) -{ - b2Vec2 c1(b2Dot(A.ex, B.ex), b2Dot(A.ey, B.ex)); - b2Vec2 c2(b2Dot(A.ex, B.ey), b2Dot(A.ey, B.ey)); - return b2Mat22(c1, c2); -} - -/// Multiply a matrix times a vector. -inline b2Vec3 b2Mul(const b2Mat33& A, const b2Vec3& v) -{ - return v.x * A.ex + v.y * A.ey + v.z * A.ez; -} - -/// Multiply a matrix times a vector. -inline b2Vec2 b2Mul22(const b2Mat33& A, const b2Vec2& v) -{ - return b2Vec2(A.ex.x * v.x + A.ey.x * v.y, A.ex.y * v.x + A.ey.y * v.y); -} - -/// Multiply two rotations: q * r -inline b2Rot b2Mul(const b2Rot& q, const b2Rot& r) -{ - // [qc -qs] * [rc -rs] = [qc*rc-qs*rs -qc*rs-qs*rc] - // [qs qc] [rs rc] [qs*rc+qc*rs -qs*rs+qc*rc] - // s = qs * rc + qc * rs - // c = qc * rc - qs * rs - b2Rot qr; - qr.s = q.s * r.c + q.c * r.s; - qr.c = q.c * r.c - q.s * r.s; - return qr; -} - -/// Transpose multiply two rotations: qT * r -inline b2Rot b2MulT(const b2Rot& q, const b2Rot& r) -{ - // [ qc qs] * [rc -rs] = [qc*rc+qs*rs -qc*rs+qs*rc] - // [-qs qc] [rs rc] [-qs*rc+qc*rs qs*rs+qc*rc] - // s = qc * rs - qs * rc - // c = qc * rc + qs * rs - b2Rot qr; - qr.s = q.c * r.s - q.s * r.c; - qr.c = q.c * r.c + q.s * r.s; - return qr; -} - -/// Rotate a vector -inline b2Vec2 b2Mul(const b2Rot& q, const b2Vec2& v) -{ - return b2Vec2(q.c * v.x - q.s * v.y, q.s * v.x + q.c * v.y); -} - -/// Inverse rotate a vector -inline b2Vec2 b2MulT(const b2Rot& q, const b2Vec2& v) -{ - return b2Vec2(q.c * v.x + q.s * v.y, -q.s * v.x + q.c * v.y); -} - -inline b2Vec2 b2Mul(const b2Transform& T, const b2Vec2& v) -{ - float32 x = (T.q.c * v.x - T.q.s * v.y) + T.p.x; - float32 y = (T.q.s * v.x + T.q.c * v.y) + T.p.y; - - return b2Vec2(x, y); -} - -inline b2Vec2 b2MulT(const b2Transform& T, const b2Vec2& v) -{ - float32 px = v.x - T.p.x; - float32 py = v.y - T.p.y; - float32 x = (T.q.c * px + T.q.s * py); - float32 y = (-T.q.s * px + T.q.c * py); - - return b2Vec2(x, y); -} - -// v2 = A.q.Rot(B.q.Rot(v1) + B.p) + A.p -// = (A.q * B.q).Rot(v1) + A.q.Rot(B.p) + A.p -inline b2Transform b2Mul(const b2Transform& A, const b2Transform& B) -{ - b2Transform C; - C.q = b2Mul(A.q, B.q); - C.p = b2Mul(A.q, B.p) + A.p; - return C; -} - -// v2 = A.q' * (B.q * v1 + B.p - A.p) -// = A.q' * B.q * v1 + A.q' * (B.p - A.p) -inline b2Transform b2MulT(const b2Transform& A, const b2Transform& B) -{ - b2Transform C; - C.q = b2MulT(A.q, B.q); - C.p = b2MulT(A.q, B.p - A.p); - return C; -} - -template -inline T b2Abs(T a) -{ - return a > T(0) ? a : -a; -} - -inline b2Vec2 b2Abs(const b2Vec2& a) -{ - return b2Vec2(b2Abs(a.x), b2Abs(a.y)); -} - -inline b2Mat22 b2Abs(const b2Mat22& A) -{ - return b2Mat22(b2Abs(A.ex), b2Abs(A.ey)); -} - -template -inline T b2Min(T a, T b) -{ - return a < b ? a : b; -} - -inline b2Vec2 b2Min(const b2Vec2& a, const b2Vec2& b) -{ - return b2Vec2(b2Min(a.x, b.x), b2Min(a.y, b.y)); -} - -template -inline T b2Max(T a, T b) -{ - return a > b ? a : b; -} - -inline b2Vec2 b2Max(const b2Vec2& a, const b2Vec2& b) -{ - return b2Vec2(b2Max(a.x, b.x), b2Max(a.y, b.y)); -} - -template -inline T b2Clamp(T a, T low, T high) -{ - return b2Max(low, b2Min(a, high)); -} - -inline b2Vec2 b2Clamp(const b2Vec2& a, const b2Vec2& low, const b2Vec2& high) -{ - return b2Max(low, b2Min(a, high)); -} - -template inline void b2Swap(T& a, T& b) -{ - T tmp = a; - a = b; - b = tmp; -} - -/// "Next Largest Power of 2 -/// Given a binary integer value x, the next largest power of 2 can be computed by a SWAR algorithm -/// that recursively "folds" the upper bits into the lower bits. This process yields a bit vector with -/// the same most significant 1 as x, but all 1's below it. Adding 1 to that value yields the next -/// largest power of 2. For a 32-bit value:" -inline uint32 b2NextPowerOfTwo(uint32 x) -{ - x |= (x >> 1); - x |= (x >> 2); - x |= (x >> 4); - x |= (x >> 8); - x |= (x >> 16); - return x + 1; -} - -inline bool b2IsPowerOfTwo(uint32 x) -{ - bool result = x > 0 && (x & (x - 1)) == 0; - return result; -} - -inline void b2Sweep::GetTransform(b2Transform* xf, float32 beta) const -{ - xf->p = (1.0f - beta) * c0 + beta * c; - float32 angle = (1.0f - beta) * a0 + beta * a; - xf->q.Set(angle); - - // Shift to origin - xf->p -= b2Mul(xf->q, localCenter); -} - -inline void b2Sweep::Advance(float32 alpha) -{ - b2Assert(alpha0 < 1.0f); - float32 beta = (alpha - alpha0) / (1.0f - alpha0); - c0 = (1.0f - beta) * c0 + beta * c; - a0 = (1.0f - beta) * a0 + beta * a; - alpha0 = alpha; -} - -/// Normalize an angle in radians to be between -pi and pi -inline void b2Sweep::Normalize() -{ - float32 twoPi = 2.0f * b2_pi; - float32 d = twoPi * floorf(a0 / twoPi); - a0 -= d; - a -= d; -} - -#endif diff --git a/external/Box2D/Common/b2Settings.cpp b/external/Box2D/Common/b2Settings.cpp deleted file mode 100644 index 84d6f1d0e4..0000000000 --- a/external/Box2D/Common/b2Settings.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#ifdef SHP -#include -#include -#include -#include -#else -#include -#include -#include -#endif - - -using namespace std; - - -b2Version b2_version = {2, 2, 1}; - -// Memory allocators. Modify these to use your own allocator. -void* b2Alloc(int32 size) -{ - return malloc(size); -} - -void b2Free(void* mem) -{ - free(mem); -} - -// You can modify this to use your logging facility. -void b2Log(const char* string, ...) -{ -#if defined(SHP) - #ifdef _DEBUG - __App_info(__PRETTY_FUNCTION__ , __LINE__, string); - #endif -#else - va_list args; - va_start(args, string); - vprintf(string, args); - va_end(args); -#endif -} diff --git a/external/Box2D/Common/b2Settings.h b/external/Box2D/Common/b2Settings.h deleted file mode 100644 index aaf4b12ccf..0000000000 --- a/external/Box2D/Common/b2Settings.h +++ /dev/null @@ -1,150 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_SETTINGS_H -#define B2_SETTINGS_H - -#include -#include - -#define B2_NOT_USED(x) ((void)(x)) -#define b2Assert(A) assert(A) - -typedef signed char int8; -typedef signed short int16; -typedef signed int int32; -typedef unsigned char uint8; -typedef unsigned short uint16; -typedef unsigned int uint32; -typedef float float32; -typedef double float64; - -#define b2_maxFloat FLT_MAX -#define b2_epsilon FLT_EPSILON -#define b2_pi 3.14159265359f - -/// @file -/// Global tuning constants based on meters-kilograms-seconds (MKS) units. -/// - -// Collision - -/// The maximum number of contact points between two convex shapes. Do -/// not change this value. -#define b2_maxManifoldPoints 2 - -/// The maximum number of vertices on a convex polygon. You cannot increase -/// this too much because b2BlockAllocator has a maximum object size. -#define b2_maxPolygonVertices 8 - -/// This is used to fatten AABBs in the dynamic tree. This allows proxies -/// to move by a small amount without triggering a tree adjustment. -/// This is in meters. -#define b2_aabbExtension 0.1f - -/// This is used to fatten AABBs in the dynamic tree. This is used to predict -/// the future position based on the current displacement. -/// This is a dimensionless multiplier. -#define b2_aabbMultiplier 2.0f - -/// A small length used as a collision and constraint tolerance. Usually it is -/// chosen to be numerically significant, but visually insignificant. -#define b2_linearSlop 0.005f - -/// A small angle used as a collision and constraint tolerance. Usually it is -/// chosen to be numerically significant, but visually insignificant. -#define b2_angularSlop (2.0f / 180.0f * b2_pi) - -/// The radius of the polygon/edge shape skin. This should not be modified. Making -/// this smaller means polygons will have an insufficient buffer for continuous collision. -/// Making it larger may create artifacts for vertex collision. -#define b2_polygonRadius (2.0f * b2_linearSlop) - -/// Maximum number of sub-steps per contact in continuous physics simulation. -#define b2_maxSubSteps 8 - - -// Dynamics - -/// Maximum number of contacts to be handled to solve a TOI impact. -#define b2_maxTOIContacts 32 - -/// A velocity threshold for elastic collisions. Any collision with a relative linear -/// velocity below this threshold will be treated as inelastic. -#define b2_velocityThreshold 1.0f - -/// The maximum linear position correction used when solving constraints. This helps to -/// prevent overshoot. -#define b2_maxLinearCorrection 0.2f - -/// The maximum angular position correction used when solving constraints. This helps to -/// prevent overshoot. -#define b2_maxAngularCorrection (8.0f / 180.0f * b2_pi) - -/// The maximum linear velocity of a body. This limit is very large and is used -/// to prevent numerical problems. You shouldn't need to adjust this. -#define b2_maxTranslation 2.0f -#define b2_maxTranslationSquared (b2_maxTranslation * b2_maxTranslation) - -/// The maximum angular velocity of a body. This limit is very large and is used -/// to prevent numerical problems. You shouldn't need to adjust this. -#define b2_maxRotation (0.5f * b2_pi) -#define b2_maxRotationSquared (b2_maxRotation * b2_maxRotation) - -/// This scale factor controls how fast overlap is resolved. Ideally this would be 1 so -/// that overlap is removed in one time step. However using values close to 1 often lead -/// to overshoot. -#define b2_baumgarte 0.2f -#define b2_toiBaugarte 0.75f - - -// Sleep - -/// The time that a body must be still before it will go to sleep. -#define b2_timeToSleep 0.5f - -/// A body cannot sleep if its linear velocity is above this tolerance. -#define b2_linearSleepTolerance 0.01f - -/// A body cannot sleep if its angular velocity is above this tolerance. -#define b2_angularSleepTolerance (2.0f / 180.0f * b2_pi) - -// Memory Allocation - -/// Implement this function to use your own memory allocator. -void* b2Alloc(int32 size); - -/// If you implement b2Alloc, you should also implement this function. -void b2Free(void* mem); - -/// Logging function. -void b2Log(const char* string, ...); - -/// Version numbering scheme. -/// See http://en.wikipedia.org/wiki/Software_versioning -struct b2Version -{ - int32 major; ///< significant changes - int32 minor; ///< incremental changes - int32 revision; ///< bug fixes -}; - -/// Current version. -extern b2Version b2_version; - -#endif diff --git a/external/Box2D/Common/b2StackAllocator.cpp b/external/Box2D/Common/b2StackAllocator.cpp deleted file mode 100644 index 3caa5d9127..0000000000 --- a/external/Box2D/Common/b2StackAllocator.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include - -b2StackAllocator::b2StackAllocator() -{ - m_index = 0; - m_allocation = 0; - m_maxAllocation = 0; - m_entryCount = 0; -} - -b2StackAllocator::~b2StackAllocator() -{ - b2Assert(m_index == 0); - b2Assert(m_entryCount == 0); -} - -void* b2StackAllocator::Allocate(int32 size) -{ - b2Assert(m_entryCount < b2_maxStackEntries); - - b2StackEntry* entry = m_entries + m_entryCount; - entry->size = size; - if (m_index + size > b2_stackSize) - { - entry->data = (char*)b2Alloc(size); - entry->usedMalloc = true; - } - else - { - entry->data = m_data + m_index; - entry->usedMalloc = false; - m_index += size; - } - - m_allocation += size; - m_maxAllocation = b2Max(m_maxAllocation, m_allocation); - ++m_entryCount; - - return entry->data; -} - -void b2StackAllocator::Free(void* p) -{ - b2Assert(m_entryCount > 0); - b2StackEntry* entry = m_entries + m_entryCount - 1; - b2Assert(p == entry->data); - if (entry->usedMalloc) - { - b2Free(p); - } - else - { - m_index -= entry->size; - } - m_allocation -= entry->size; - --m_entryCount; - - p = NULL; -} - -int32 b2StackAllocator::GetMaxAllocation() const -{ - return m_maxAllocation; -} diff --git a/external/Box2D/Common/b2StackAllocator.h b/external/Box2D/Common/b2StackAllocator.h deleted file mode 100644 index 6140d0d802..0000000000 --- a/external/Box2D/Common/b2StackAllocator.h +++ /dev/null @@ -1,60 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_STACK_ALLOCATOR_H -#define B2_STACK_ALLOCATOR_H - -#include - -const int32 b2_stackSize = 100 * 1024; // 100k -const int32 b2_maxStackEntries = 32; - -struct b2StackEntry -{ - char* data; - int32 size; - bool usedMalloc; -}; - -// This is a stack allocator used for fast per step allocations. -// You must nest allocate/free pairs. The code will assert -// if you try to interleave multiple allocate/free pairs. -class b2StackAllocator -{ -public: - b2StackAllocator(); - ~b2StackAllocator(); - - void* Allocate(int32 size); - void Free(void* p); - - int32 GetMaxAllocation() const; - -private: - - char m_data[b2_stackSize]; - int32 m_index; - - int32 m_allocation; - int32 m_maxAllocation; - - b2StackEntry m_entries[b2_maxStackEntries]; - int32 m_entryCount; -}; - -#endif diff --git a/external/Box2D/Common/b2Timer.cpp b/external/Box2D/Common/b2Timer.cpp deleted file mode 100644 index b2bee94513..0000000000 --- a/external/Box2D/Common/b2Timer.cpp +++ /dev/null @@ -1,100 +0,0 @@ -/* -* Copyright (c) 2011 Erin Catto http://box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include - -#if defined(_WIN32) && !defined(SHP) - -float64 b2Timer::s_invFrequency = 0.0f; - -#include - -b2Timer::b2Timer() -{ - LARGE_INTEGER largeInteger; - - if (s_invFrequency == 0.0f) - { - QueryPerformanceFrequency(&largeInteger); - s_invFrequency = float64(largeInteger.QuadPart); - if (s_invFrequency > 0.0f) - { - s_invFrequency = 1000.0f / s_invFrequency; - } - } - - QueryPerformanceCounter(&largeInteger); - m_start = float64(largeInteger.QuadPart); -} - -void b2Timer::Reset() -{ - LARGE_INTEGER largeInteger; - QueryPerformanceCounter(&largeInteger); - m_start = float64(largeInteger.QuadPart); -} - -float32 b2Timer::GetMilliseconds() const -{ - LARGE_INTEGER largeInteger; - QueryPerformanceCounter(&largeInteger); - float64 count = float64(largeInteger.QuadPart); - float32 ms = float32(s_invFrequency * (count - m_start)); - return ms; -} - -#elif defined(__linux__) || defined (__APPLE__) - -#include - -b2Timer::b2Timer() -{ - Reset(); -} - -void b2Timer::Reset() -{ - timeval t; - gettimeofday(&t, 0); - m_start_sec = t.tv_sec; - m_start_msec = t.tv_usec * 0.001f; -} - -float32 b2Timer::GetMilliseconds() const -{ - timeval t; - gettimeofday(&t, 0); - return (t.tv_sec - m_start_sec) * 1000 + t.tv_usec * 0.001f - m_start_msec; -} - -#else - -b2Timer::b2Timer() -{ -} - -void b2Timer::Reset() -{ -} - -float32 b2Timer::GetMilliseconds() const -{ - return 0.0f; -} - -#endif diff --git a/external/Box2D/Common/b2Timer.h b/external/Box2D/Common/b2Timer.h deleted file mode 100644 index 053a107a56..0000000000 --- a/external/Box2D/Common/b2Timer.h +++ /dev/null @@ -1,45 +0,0 @@ -/* -* Copyright (c) 2011 Erin Catto http://box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include - -/// Timer for profiling. This has platform specific code and may -/// not work on every platform. -class b2Timer -{ -public: - - /// Constructor - b2Timer(); - - /// Reset the timer. - void Reset(); - - /// Get the time since construction or the last reset. - float32 GetMilliseconds() const; - -private: - -#if defined(_WIN32) - float64 m_start; - static float64 s_invFrequency; -#elif defined(__linux__) || defined (__APPLE__) - unsigned long m_start_sec; - unsigned long m_start_msec; -#endif -}; diff --git a/external/Box2D/Dynamics/Contacts/b2ChainAndCircleContact.cpp b/external/Box2D/Dynamics/Contacts/b2ChainAndCircleContact.cpp deleted file mode 100644 index 4ae4c41cd3..0000000000 --- a/external/Box2D/Dynamics/Contacts/b2ChainAndCircleContact.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/* -* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include -#include -#include - -#include -using namespace std; - -b2Contact* b2ChainAndCircleContact::Create(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator) -{ - void* mem = allocator->Allocate(sizeof(b2ChainAndCircleContact)); - return new (mem) b2ChainAndCircleContact(fixtureA, indexA, fixtureB, indexB); -} - -void b2ChainAndCircleContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) -{ - ((b2ChainAndCircleContact*)contact)->~b2ChainAndCircleContact(); - allocator->Free(contact, sizeof(b2ChainAndCircleContact)); -} - -b2ChainAndCircleContact::b2ChainAndCircleContact(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB) -: b2Contact(fixtureA, indexA, fixtureB, indexB) -{ - b2Assert(m_fixtureA->GetType() == b2Shape::e_chain); - b2Assert(m_fixtureB->GetType() == b2Shape::e_circle); -} - -void b2ChainAndCircleContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) -{ - b2ChainShape* chain = (b2ChainShape*)m_fixtureA->GetShape(); - b2EdgeShape edge; - chain->GetChildEdge(&edge, m_indexA); - b2CollideEdgeAndCircle( manifold, &edge, xfA, - (b2CircleShape*)m_fixtureB->GetShape(), xfB); -} diff --git a/external/Box2D/Dynamics/Contacts/b2ChainAndCircleContact.h b/external/Box2D/Dynamics/Contacts/b2ChainAndCircleContact.h deleted file mode 100644 index 1cf601a61f..0000000000 --- a/external/Box2D/Dynamics/Contacts/b2ChainAndCircleContact.h +++ /dev/null @@ -1,39 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_CHAIN_AND_CIRCLE_CONTACT_H -#define B2_CHAIN_AND_CIRCLE_CONTACT_H - -#include - -class b2BlockAllocator; - -class b2ChainAndCircleContact : public b2Contact -{ -public: - static b2Contact* Create( b2Fixture* fixtureA, int32 indexA, - b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); - static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); - - b2ChainAndCircleContact(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB); - ~b2ChainAndCircleContact() {} - - void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB); -}; - -#endif diff --git a/external/Box2D/Dynamics/Contacts/b2ChainAndPolygonContact.cpp b/external/Box2D/Dynamics/Contacts/b2ChainAndPolygonContact.cpp deleted file mode 100644 index 8116c34d1b..0000000000 --- a/external/Box2D/Dynamics/Contacts/b2ChainAndPolygonContact.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/* -* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include -#include -#include - -#include -using namespace std; - -b2Contact* b2ChainAndPolygonContact::Create(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator) -{ - void* mem = allocator->Allocate(sizeof(b2ChainAndPolygonContact)); - return new (mem) b2ChainAndPolygonContact(fixtureA, indexA, fixtureB, indexB); -} - -void b2ChainAndPolygonContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) -{ - ((b2ChainAndPolygonContact*)contact)->~b2ChainAndPolygonContact(); - allocator->Free(contact, sizeof(b2ChainAndPolygonContact)); -} - -b2ChainAndPolygonContact::b2ChainAndPolygonContact(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB) -: b2Contact(fixtureA, indexA, fixtureB, indexB) -{ - b2Assert(m_fixtureA->GetType() == b2Shape::e_chain); - b2Assert(m_fixtureB->GetType() == b2Shape::e_polygon); -} - -void b2ChainAndPolygonContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) -{ - b2ChainShape* chain = (b2ChainShape*)m_fixtureA->GetShape(); - b2EdgeShape edge; - chain->GetChildEdge(&edge, m_indexA); - b2CollideEdgeAndPolygon( manifold, &edge, xfA, - (b2PolygonShape*)m_fixtureB->GetShape(), xfB); -} diff --git a/external/Box2D/Dynamics/Contacts/b2ChainAndPolygonContact.h b/external/Box2D/Dynamics/Contacts/b2ChainAndPolygonContact.h deleted file mode 100644 index 381c49b844..0000000000 --- a/external/Box2D/Dynamics/Contacts/b2ChainAndPolygonContact.h +++ /dev/null @@ -1,39 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_CHAIN_AND_POLYGON_CONTACT_H -#define B2_CHAIN_AND_POLYGON_CONTACT_H - -#include - -class b2BlockAllocator; - -class b2ChainAndPolygonContact : public b2Contact -{ -public: - static b2Contact* Create( b2Fixture* fixtureA, int32 indexA, - b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); - static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); - - b2ChainAndPolygonContact(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB); - ~b2ChainAndPolygonContact() {} - - void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB); -}; - -#endif diff --git a/external/Box2D/Dynamics/Contacts/b2CircleContact.cpp b/external/Box2D/Dynamics/Contacts/b2CircleContact.cpp deleted file mode 100644 index 2436da5132..0000000000 --- a/external/Box2D/Dynamics/Contacts/b2CircleContact.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include -#include -#include -#include - -#include -using namespace std; - -b2Contact* b2CircleContact::Create(b2Fixture* fixtureA, int32, b2Fixture* fixtureB, int32, b2BlockAllocator* allocator) -{ - void* mem = allocator->Allocate(sizeof(b2CircleContact)); - return new (mem) b2CircleContact(fixtureA, fixtureB); -} - -void b2CircleContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) -{ - ((b2CircleContact*)contact)->~b2CircleContact(); - allocator->Free(contact, sizeof(b2CircleContact)); -} - -b2CircleContact::b2CircleContact(b2Fixture* fixtureA, b2Fixture* fixtureB) - : b2Contact(fixtureA, 0, fixtureB, 0) -{ - b2Assert(m_fixtureA->GetType() == b2Shape::e_circle); - b2Assert(m_fixtureB->GetType() == b2Shape::e_circle); -} - -void b2CircleContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) -{ - b2CollideCircles(manifold, - (b2CircleShape*)m_fixtureA->GetShape(), xfA, - (b2CircleShape*)m_fixtureB->GetShape(), xfB); -} diff --git a/external/Box2D/Dynamics/Contacts/b2CircleContact.h b/external/Box2D/Dynamics/Contacts/b2CircleContact.h deleted file mode 100644 index 6da056ae0d..0000000000 --- a/external/Box2D/Dynamics/Contacts/b2CircleContact.h +++ /dev/null @@ -1,39 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_CIRCLE_CONTACT_H -#define B2_CIRCLE_CONTACT_H - -#include - -class b2BlockAllocator; - -class b2CircleContact : public b2Contact -{ -public: - static b2Contact* Create( b2Fixture* fixtureA, int32 indexA, - b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); - static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); - - b2CircleContact(b2Fixture* fixtureA, b2Fixture* fixtureB); - ~b2CircleContact() {} - - void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB); -}; - -#endif diff --git a/external/Box2D/Dynamics/Contacts/b2Contact.cpp b/external/Box2D/Dynamics/Contacts/b2Contact.cpp deleted file mode 100644 index 2389af6434..0000000000 --- a/external/Box2D/Dynamics/Contacts/b2Contact.cpp +++ /dev/null @@ -1,240 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -b2ContactRegister b2Contact::s_registers[b2Shape::e_typeCount][b2Shape::e_typeCount]; -bool b2Contact::s_initialized = false; - -void b2Contact::InitializeRegisters() -{ - AddType(b2CircleContact::Create, b2CircleContact::Destroy, b2Shape::e_circle, b2Shape::e_circle); - AddType(b2PolygonAndCircleContact::Create, b2PolygonAndCircleContact::Destroy, b2Shape::e_polygon, b2Shape::e_circle); - AddType(b2PolygonContact::Create, b2PolygonContact::Destroy, b2Shape::e_polygon, b2Shape::e_polygon); - AddType(b2EdgeAndCircleContact::Create, b2EdgeAndCircleContact::Destroy, b2Shape::e_edge, b2Shape::e_circle); - AddType(b2EdgeAndPolygonContact::Create, b2EdgeAndPolygonContact::Destroy, b2Shape::e_edge, b2Shape::e_polygon); - AddType(b2ChainAndCircleContact::Create, b2ChainAndCircleContact::Destroy, b2Shape::e_chain, b2Shape::e_circle); - AddType(b2ChainAndPolygonContact::Create, b2ChainAndPolygonContact::Destroy, b2Shape::e_chain, b2Shape::e_polygon); -} - -void b2Contact::AddType(b2ContactCreateFcn* createFcn, b2ContactDestroyFcn* destoryFcn, - b2Shape::Type type1, b2Shape::Type type2) -{ - b2Assert(0 <= type1 && type1 < b2Shape::e_typeCount); - b2Assert(0 <= type2 && type2 < b2Shape::e_typeCount); - - s_registers[type1][type2].createFcn = createFcn; - s_registers[type1][type2].destroyFcn = destoryFcn; - s_registers[type1][type2].primary = true; - - if (type1 != type2) - { - s_registers[type2][type1].createFcn = createFcn; - s_registers[type2][type1].destroyFcn = destoryFcn; - s_registers[type2][type1].primary = false; - } -} - -b2Contact* b2Contact::Create(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator) -{ - if (s_initialized == false) - { - InitializeRegisters(); - s_initialized = true; - } - - b2Shape::Type type1 = fixtureA->GetType(); - b2Shape::Type type2 = fixtureB->GetType(); - - b2Assert(0 <= type1 && type1 < b2Shape::e_typeCount); - b2Assert(0 <= type2 && type2 < b2Shape::e_typeCount); - - b2ContactCreateFcn* createFcn = s_registers[type1][type2].createFcn; - if (createFcn) - { - if (s_registers[type1][type2].primary) - { - return createFcn(fixtureA, indexA, fixtureB, indexB, allocator); - } - else - { - return createFcn(fixtureB, indexB, fixtureA, indexA, allocator); - } - } - else - { - return NULL; - } -} - -void b2Contact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) -{ - b2Assert(s_initialized == true); - - if (contact->m_manifold.pointCount > 0) - { - contact->GetFixtureA()->GetBody()->SetAwake(true); - contact->GetFixtureB()->GetBody()->SetAwake(true); - } - - b2Shape::Type typeA = contact->GetFixtureA()->GetType(); - b2Shape::Type typeB = contact->GetFixtureB()->GetType(); - - b2Assert(0 <= typeA && typeB < b2Shape::e_typeCount); - b2Assert(0 <= typeA && typeB < b2Shape::e_typeCount); - - b2ContactDestroyFcn* destroyFcn = s_registers[typeA][typeB].destroyFcn; - destroyFcn(contact, allocator); -} - -b2Contact::b2Contact(b2Fixture* fA, int32 indexA, b2Fixture* fB, int32 indexB) -{ - m_flags = e_enabledFlag; - - m_fixtureA = fA; - m_fixtureB = fB; - - m_indexA = indexA; - m_indexB = indexB; - - m_manifold.pointCount = 0; - - m_prev = NULL; - m_next = NULL; - - m_nodeA.contact = NULL; - m_nodeA.prev = NULL; - m_nodeA.next = NULL; - m_nodeA.other = NULL; - - m_nodeB.contact = NULL; - m_nodeB.prev = NULL; - m_nodeB.next = NULL; - m_nodeB.other = NULL; - - m_toiCount = 0; - - m_friction = b2MixFriction(m_fixtureA->m_friction, m_fixtureB->m_friction); - m_restitution = b2MixRestitution(m_fixtureA->m_restitution, m_fixtureB->m_restitution); -} - -// Update the contact manifold and touching status. -// Note: do not assume the fixture AABBs are overlapping or are valid. -void b2Contact::Update(b2ContactListener* listener) -{ - b2Manifold oldManifold = m_manifold; - - // Re-enable this contact. - m_flags |= e_enabledFlag; - - bool touching = false; - bool wasTouching = (m_flags & e_touchingFlag) == e_touchingFlag; - - bool sensorA = m_fixtureA->IsSensor(); - bool sensorB = m_fixtureB->IsSensor(); - bool sensor = sensorA || sensorB; - - b2Body* bodyA = m_fixtureA->GetBody(); - b2Body* bodyB = m_fixtureB->GetBody(); - const b2Transform& xfA = bodyA->GetTransform(); - const b2Transform& xfB = bodyB->GetTransform(); - - // Is this contact a sensor? - if (sensor) - { - const b2Shape* shapeA = m_fixtureA->GetShape(); - const b2Shape* shapeB = m_fixtureB->GetShape(); - touching = b2TestOverlap(shapeA, m_indexA, shapeB, m_indexB, xfA, xfB); - - // Sensors don't generate manifolds. - m_manifold.pointCount = 0; - } - else - { - Evaluate(&m_manifold, xfA, xfB); - touching = m_manifold.pointCount > 0; - - // Match old contact ids to new contact ids and copy the - // stored impulses to warm start the solver. - for (int32 i = 0; i < m_manifold.pointCount; ++i) - { - b2ManifoldPoint* mp2 = m_manifold.points + i; - mp2->normalImpulse = 0.0f; - mp2->tangentImpulse = 0.0f; - b2ContactID id2 = mp2->id; - - for (int32 j = 0; j < oldManifold.pointCount; ++j) - { - b2ManifoldPoint* mp1 = oldManifold.points + j; - - if (mp1->id.key == id2.key) - { - mp2->normalImpulse = mp1->normalImpulse; - mp2->tangentImpulse = mp1->tangentImpulse; - break; - } - } - } - - if (touching != wasTouching) - { - bodyA->SetAwake(true); - bodyB->SetAwake(true); - } - } - - if (touching) - { - m_flags |= e_touchingFlag; - } - else - { - m_flags &= ~e_touchingFlag; - } - - if (wasTouching == false && touching == true && listener) - { - listener->BeginContact(this); - } - - if (wasTouching == true && touching == false && listener) - { - listener->EndContact(this); - } - - if (sensor == false && touching && listener) - { - listener->PreSolve(this, &oldManifold); - } -} diff --git a/external/Box2D/Dynamics/Contacts/b2Contact.h b/external/Box2D/Dynamics/Contacts/b2Contact.h deleted file mode 100644 index 20d9403ce7..0000000000 --- a/external/Box2D/Dynamics/Contacts/b2Contact.h +++ /dev/null @@ -1,331 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_CONTACT_H -#define B2_CONTACT_H - -#include -#include -#include -#include - -class b2Body; -class b2Contact; -class b2Fixture; -class b2World; -class b2BlockAllocator; -class b2StackAllocator; -class b2ContactListener; - -/// Friction mixing law. The idea is to allow either fixture to drive the restitution to zero. -/// For example, anything slides on ice. -inline float32 b2MixFriction(float32 friction1, float32 friction2) -{ - return std::sqrt(friction1 * friction2); -} - -/// Restitution mixing law. The idea is allow for anything to bounce off an inelastic surface. -/// For example, a superball bounces on anything. -inline float32 b2MixRestitution(float32 restitution1, float32 restitution2) -{ - return restitution1 > restitution2 ? restitution1 : restitution2; -} - -typedef b2Contact* b2ContactCreateFcn( b2Fixture* fixtureA, int32 indexA, - b2Fixture* fixtureB, int32 indexB, - b2BlockAllocator* allocator); -typedef void b2ContactDestroyFcn(b2Contact* contact, b2BlockAllocator* allocator); - -struct b2ContactRegister -{ - b2ContactCreateFcn* createFcn; - b2ContactDestroyFcn* destroyFcn; - bool primary; -}; - -/// A contact edge is used to connect bodies and contacts together -/// in a contact graph where each body is a node and each contact -/// is an edge. A contact edge belongs to a doubly linked list -/// maintained in each attached body. Each contact has two contact -/// nodes, one for each attached body. -struct b2ContactEdge -{ - b2Body* other; ///< provides quick access to the other body attached. - b2Contact* contact; ///< the contact - b2ContactEdge* prev; ///< the previous contact edge in the body's contact list - b2ContactEdge* next; ///< the next contact edge in the body's contact list -}; - -/// The class manages contact between two shapes. A contact exists for each overlapping -/// AABB in the broad-phase (except if filtered). Therefore a contact object may exist -/// that has no contact points. -class b2Contact -{ -public: - - /// Get the contact manifold. Do not modify the manifold unless you understand the - /// internals of Box2D. - b2Manifold* GetManifold(); - const b2Manifold* GetManifold() const; - - /// Get the world manifold. - void GetWorldManifold(b2WorldManifold* worldManifold) const; - - /// Is this contact touching? - bool IsTouching() const; - - /// Enable/disable this contact. This can be used inside the pre-solve - /// contact listener. The contact is only disabled for the current - /// time step (or sub-step in continuous collisions). - void SetEnabled(bool flag); - - /// Has this contact been disabled? - bool IsEnabled() const; - - /// Get the next contact in the world's contact list. - b2Contact* GetNext(); - const b2Contact* GetNext() const; - - /// Get fixture A in this contact. - b2Fixture* GetFixtureA(); - const b2Fixture* GetFixtureA() const; - - /// Get the child primitive index for fixture A. - int32 GetChildIndexA() const; - - /// Get fixture B in this contact. - b2Fixture* GetFixtureB(); - const b2Fixture* GetFixtureB() const; - - /// Get the child primitive index for fixture B. - int32 GetChildIndexB() const; - - /// Override the default friction mixture. You can call this in b2ContactListener::PreSolve. - /// This value persists until set or reset. - void SetFriction(float32 friction); - - /// Get the friction. - float32 GetFriction() const; - - /// Reset the friction mixture to the default value. - void ResetFriction(); - - /// Override the default restitution mixture. You can call this in b2ContactListener::PreSolve. - /// The value persists until you set or reset. - void SetRestitution(float32 restitution); - - /// Get the restitution. - float32 GetRestitution() const; - - /// Reset the restitution to the default value. - void ResetRestitution(); - - /// Evaluate this contact with your own manifold and transforms. - virtual void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) = 0; - -protected: - friend class b2ContactManager; - friend class b2World; - friend class b2ContactSolver; - friend class b2Body; - friend class b2Fixture; - - // Flags stored in m_flags - enum - { - // Used when crawling contact graph when forming islands. - e_islandFlag = 0x0001, - - // Set when the shapes are touching. - e_touchingFlag = 0x0002, - - // This contact can be disabled (by user) - e_enabledFlag = 0x0004, - - // This contact needs filtering because a fixture filter was changed. - e_filterFlag = 0x0008, - - // This bullet contact had a TOI event - e_bulletHitFlag = 0x0010, - - // This contact has a valid TOI in m_toi - e_toiFlag = 0x0020 - }; - - /// Flag this contact for filtering. Filtering will occur the next time step. - void FlagForFiltering(); - - static void AddType(b2ContactCreateFcn* createFcn, b2ContactDestroyFcn* destroyFcn, - b2Shape::Type typeA, b2Shape::Type typeB); - static void InitializeRegisters(); - static b2Contact* Create(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); - static void Destroy(b2Contact* contact, b2Shape::Type typeA, b2Shape::Type typeB, b2BlockAllocator* allocator); - static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); - - b2Contact() : m_fixtureA(NULL), m_fixtureB(NULL) {} - b2Contact(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB); - virtual ~b2Contact() {} - - void Update(b2ContactListener* listener); - - static b2ContactRegister s_registers[b2Shape::e_typeCount][b2Shape::e_typeCount]; - static bool s_initialized; - - uint32 m_flags; - - // World pool and list pointers. - b2Contact* m_prev; - b2Contact* m_next; - - // Nodes for connecting bodies. - b2ContactEdge m_nodeA; - b2ContactEdge m_nodeB; - - b2Fixture* m_fixtureA; - b2Fixture* m_fixtureB; - - int32 m_indexA; - int32 m_indexB; - - b2Manifold m_manifold; - - int32 m_toiCount; - float32 m_toi; - - float32 m_friction; - float32 m_restitution; -}; - -inline b2Manifold* b2Contact::GetManifold() -{ - return &m_manifold; -} - -inline const b2Manifold* b2Contact::GetManifold() const -{ - return &m_manifold; -} - -inline void b2Contact::GetWorldManifold(b2WorldManifold* worldManifold) const -{ - const b2Body* bodyA = m_fixtureA->GetBody(); - const b2Body* bodyB = m_fixtureB->GetBody(); - const b2Shape* shapeA = m_fixtureA->GetShape(); - const b2Shape* shapeB = m_fixtureB->GetShape(); - - worldManifold->Initialize(&m_manifold, bodyA->GetTransform(), shapeA->m_radius, bodyB->GetTransform(), shapeB->m_radius); -} - -inline void b2Contact::SetEnabled(bool flag) -{ - if (flag) - { - m_flags |= e_enabledFlag; - } - else - { - m_flags &= ~e_enabledFlag; - } -} - -inline bool b2Contact::IsEnabled() const -{ - return (m_flags & e_enabledFlag) == e_enabledFlag; -} - -inline bool b2Contact::IsTouching() const -{ - return (m_flags & e_touchingFlag) == e_touchingFlag; -} - -inline b2Contact* b2Contact::GetNext() -{ - return m_next; -} - -inline const b2Contact* b2Contact::GetNext() const -{ - return m_next; -} - -inline b2Fixture* b2Contact::GetFixtureA() -{ - return m_fixtureA; -} - -inline const b2Fixture* b2Contact::GetFixtureA() const -{ - return m_fixtureA; -} - -inline b2Fixture* b2Contact::GetFixtureB() -{ - return m_fixtureB; -} - -inline int32 b2Contact::GetChildIndexA() const -{ - return m_indexA; -} - -inline const b2Fixture* b2Contact::GetFixtureB() const -{ - return m_fixtureB; -} - -inline int32 b2Contact::GetChildIndexB() const -{ - return m_indexB; -} - -inline void b2Contact::FlagForFiltering() -{ - m_flags |= e_filterFlag; -} - -inline void b2Contact::SetFriction(float32 friction) -{ - m_friction = friction; -} - -inline float32 b2Contact::GetFriction() const -{ - return m_friction; -} - -inline void b2Contact::ResetFriction() -{ - m_friction = b2MixFriction(m_fixtureA->m_friction, m_fixtureB->m_friction); -} - -inline void b2Contact::SetRestitution(float32 restitution) -{ - m_restitution = restitution; -} - -inline float32 b2Contact::GetRestitution() const -{ - return m_restitution; -} - -inline void b2Contact::ResetRestitution() -{ - m_restitution = b2MixRestitution(m_fixtureA->m_restitution, m_fixtureB->m_restitution); -} - -#endif diff --git a/external/Box2D/Dynamics/Contacts/b2ContactSolver.cpp b/external/Box2D/Dynamics/Contacts/b2ContactSolver.cpp deleted file mode 100644 index 0dc740342a..0000000000 --- a/external/Box2D/Dynamics/Contacts/b2ContactSolver.cpp +++ /dev/null @@ -1,832 +0,0 @@ -/* -* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include - -#include -#include -#include -#include -#include - -#define B2_DEBUG_SOLVER 0 - -struct b2ContactPositionConstraint -{ - b2Vec2 localPoints[b2_maxManifoldPoints]; - b2Vec2 localNormal; - b2Vec2 localPoint; - int32 indexA; - int32 indexB; - float32 invMassA, invMassB; - b2Vec2 localCenterA, localCenterB; - float32 invIA, invIB; - b2Manifold::Type type; - float32 radiusA, radiusB; - int32 pointCount; -}; - -b2ContactSolver::b2ContactSolver(b2ContactSolverDef* def) -{ - m_step = def->step; - m_allocator = def->allocator; - m_count = def->count; - m_positionConstraints = (b2ContactPositionConstraint*)m_allocator->Allocate(m_count * sizeof(b2ContactPositionConstraint)); - m_velocityConstraints = (b2ContactVelocityConstraint*)m_allocator->Allocate(m_count * sizeof(b2ContactVelocityConstraint)); - m_positions = def->positions; - m_velocities = def->velocities; - m_contacts = def->contacts; - - // Initialize position independent portions of the constraints. - for (int32 i = 0; i < m_count; ++i) - { - b2Contact* contact = m_contacts[i]; - - b2Fixture* fixtureA = contact->m_fixtureA; - b2Fixture* fixtureB = contact->m_fixtureB; - b2Shape* shapeA = fixtureA->GetShape(); - b2Shape* shapeB = fixtureB->GetShape(); - float32 radiusA = shapeA->m_radius; - float32 radiusB = shapeB->m_radius; - b2Body* bodyA = fixtureA->GetBody(); - b2Body* bodyB = fixtureB->GetBody(); - b2Manifold* manifold = contact->GetManifold(); - - int32 pointCount = manifold->pointCount; - b2Assert(pointCount > 0); - - b2ContactVelocityConstraint* vc = m_velocityConstraints + i; - vc->friction = contact->m_friction; - vc->restitution = contact->m_restitution; - vc->indexA = bodyA->m_islandIndex; - vc->indexB = bodyB->m_islandIndex; - vc->invMassA = bodyA->m_invMass; - vc->invMassB = bodyB->m_invMass; - vc->invIA = bodyA->m_invI; - vc->invIB = bodyB->m_invI; - vc->contactIndex = i; - vc->pointCount = pointCount; - vc->K.SetZero(); - vc->normalMass.SetZero(); - - b2ContactPositionConstraint* pc = m_positionConstraints + i; - pc->indexA = bodyA->m_islandIndex; - pc->indexB = bodyB->m_islandIndex; - pc->invMassA = bodyA->m_invMass; - pc->invMassB = bodyB->m_invMass; - pc->localCenterA = bodyA->m_sweep.localCenter; - pc->localCenterB = bodyB->m_sweep.localCenter; - pc->invIA = bodyA->m_invI; - pc->invIB = bodyB->m_invI; - pc->localNormal = manifold->localNormal; - pc->localPoint = manifold->localPoint; - pc->pointCount = pointCount; - pc->radiusA = radiusA; - pc->radiusB = radiusB; - pc->type = manifold->type; - - for (int32 j = 0; j < pointCount; ++j) - { - b2ManifoldPoint* cp = manifold->points + j; - b2VelocityConstraintPoint* vcp = vc->points + j; - - if (m_step.warmStarting) - { - vcp->normalImpulse = m_step.dtRatio * cp->normalImpulse; - vcp->tangentImpulse = m_step.dtRatio * cp->tangentImpulse; - } - else - { - vcp->normalImpulse = 0.0f; - vcp->tangentImpulse = 0.0f; - } - - vcp->rA.SetZero(); - vcp->rB.SetZero(); - vcp->normalMass = 0.0f; - vcp->tangentMass = 0.0f; - vcp->velocityBias = 0.0f; - - pc->localPoints[j] = cp->localPoint; - } - } -} - -b2ContactSolver::~b2ContactSolver() -{ - m_allocator->Free(m_velocityConstraints); - m_allocator->Free(m_positionConstraints); -} - -// Initialize position dependent portions of the velocity constraints. -void b2ContactSolver::InitializeVelocityConstraints() -{ - for (int32 i = 0; i < m_count; ++i) - { - b2ContactVelocityConstraint* vc = m_velocityConstraints + i; - b2ContactPositionConstraint* pc = m_positionConstraints + i; - - float32 radiusA = pc->radiusA; - float32 radiusB = pc->radiusB; - b2Manifold* manifold = m_contacts[vc->contactIndex]->GetManifold(); - - int32 indexA = vc->indexA; - int32 indexB = vc->indexB; - - float32 mA = vc->invMassA; - float32 mB = vc->invMassB; - float32 iA = vc->invIA; - float32 iB = vc->invIB; - b2Vec2 localCenterA = pc->localCenterA; - b2Vec2 localCenterB = pc->localCenterB; - - b2Vec2 cA = m_positions[indexA].c; - float32 aA = m_positions[indexA].a; - b2Vec2 vA = m_velocities[indexA].v; - float32 wA = m_velocities[indexA].w; - - b2Vec2 cB = m_positions[indexB].c; - float32 aB = m_positions[indexB].a; - b2Vec2 vB = m_velocities[indexB].v; - float32 wB = m_velocities[indexB].w; - - b2Assert(manifold->pointCount > 0); - - b2Transform xfA, xfB; - xfA.q.Set(aA); - xfB.q.Set(aB); - xfA.p = cA - b2Mul(xfA.q, localCenterA); - xfB.p = cB - b2Mul(xfB.q, localCenterB); - - b2WorldManifold worldManifold; - worldManifold.Initialize(manifold, xfA, radiusA, xfB, radiusB); - - vc->normal = worldManifold.normal; - - int32 pointCount = vc->pointCount; - for (int32 j = 0; j < pointCount; ++j) - { - b2VelocityConstraintPoint* vcp = vc->points + j; - - vcp->rA = worldManifold.points[j] - cA; - vcp->rB = worldManifold.points[j] - cB; - - float32 rnA = b2Cross(vcp->rA, vc->normal); - float32 rnB = b2Cross(vcp->rB, vc->normal); - - float32 kNormal = mA + mB + iA * rnA * rnA + iB * rnB * rnB; - - vcp->normalMass = kNormal > 0.0f ? 1.0f / kNormal : 0.0f; - - b2Vec2 tangent = b2Cross(vc->normal, 1.0f); - - float32 rtA = b2Cross(vcp->rA, tangent); - float32 rtB = b2Cross(vcp->rB, tangent); - - float32 kTangent = mA + mB + iA * rtA * rtA + iB * rtB * rtB; - - vcp->tangentMass = kTangent > 0.0f ? 1.0f / kTangent : 0.0f; - - // Setup a velocity bias for restitution. - vcp->velocityBias = 0.0f; - float32 vRel = b2Dot(vc->normal, vB + b2Cross(wB, vcp->rB) - vA - b2Cross(wA, vcp->rA)); - if (vRel < -b2_velocityThreshold) - { - vcp->velocityBias = -vc->restitution * vRel; - } - } - - // If we have two points, then prepare the block solver. - if (vc->pointCount == 2) - { - b2VelocityConstraintPoint* vcp1 = vc->points + 0; - b2VelocityConstraintPoint* vcp2 = vc->points + 1; - - float32 rn1A = b2Cross(vcp1->rA, vc->normal); - float32 rn1B = b2Cross(vcp1->rB, vc->normal); - float32 rn2A = b2Cross(vcp2->rA, vc->normal); - float32 rn2B = b2Cross(vcp2->rB, vc->normal); - - float32 k11 = mA + mB + iA * rn1A * rn1A + iB * rn1B * rn1B; - float32 k22 = mA + mB + iA * rn2A * rn2A + iB * rn2B * rn2B; - float32 k12 = mA + mB + iA * rn1A * rn2A + iB * rn1B * rn2B; - - // Ensure a reasonable condition number. - const float32 k_maxConditionNumber = 1000.0f; - if (k11 * k11 < k_maxConditionNumber * (k11 * k22 - k12 * k12)) - { - // K is safe to invert. - vc->K.ex.Set(k11, k12); - vc->K.ey.Set(k12, k22); - vc->normalMass = vc->K.GetInverse(); - } - else - { - // The constraints are redundant, just use one. - // TODO_ERIN use deepest? - vc->pointCount = 1; - } - } - } -} - -void b2ContactSolver::WarmStart() -{ - // Warm start. - for (int32 i = 0; i < m_count; ++i) - { - b2ContactVelocityConstraint* vc = m_velocityConstraints + i; - - int32 indexA = vc->indexA; - int32 indexB = vc->indexB; - float32 mA = vc->invMassA; - float32 iA = vc->invIA; - float32 mB = vc->invMassB; - float32 iB = vc->invIB; - int32 pointCount = vc->pointCount; - - b2Vec2 vA = m_velocities[indexA].v; - float32 wA = m_velocities[indexA].w; - b2Vec2 vB = m_velocities[indexB].v; - float32 wB = m_velocities[indexB].w; - - b2Vec2 normal = vc->normal; - b2Vec2 tangent = b2Cross(normal, 1.0f); - - for (int32 j = 0; j < pointCount; ++j) - { - b2VelocityConstraintPoint* vcp = vc->points + j; - b2Vec2 P = vcp->normalImpulse * normal + vcp->tangentImpulse * tangent; - wA -= iA * b2Cross(vcp->rA, P); - vA -= mA * P; - wB += iB * b2Cross(vcp->rB, P); - vB += mB * P; - } - - m_velocities[indexA].v = vA; - m_velocities[indexA].w = wA; - m_velocities[indexB].v = vB; - m_velocities[indexB].w = wB; - } -} - -void b2ContactSolver::SolveVelocityConstraints() -{ - for (int32 i = 0; i < m_count; ++i) - { - b2ContactVelocityConstraint* vc = m_velocityConstraints + i; - - int32 indexA = vc->indexA; - int32 indexB = vc->indexB; - float32 mA = vc->invMassA; - float32 iA = vc->invIA; - float32 mB = vc->invMassB; - float32 iB = vc->invIB; - int32 pointCount = vc->pointCount; - - b2Vec2 vA = m_velocities[indexA].v; - float32 wA = m_velocities[indexA].w; - b2Vec2 vB = m_velocities[indexB].v; - float32 wB = m_velocities[indexB].w; - - b2Vec2 normal = vc->normal; - b2Vec2 tangent = b2Cross(normal, 1.0f); - float32 friction = vc->friction; - - b2Assert(pointCount == 1 || pointCount == 2); - - // Solve tangent constraints first because non-penetration is more important - // than friction. - for (int32 j = 0; j < pointCount; ++j) - { - b2VelocityConstraintPoint* vcp = vc->points + j; - - // Relative velocity at contact - b2Vec2 dv = vB + b2Cross(wB, vcp->rB) - vA - b2Cross(wA, vcp->rA); - - // Compute tangent force - float32 vt = b2Dot(dv, tangent); - float32 lambda = vcp->tangentMass * (-vt); - - // b2Clamp the accumulated force - float32 maxFriction = friction * vcp->normalImpulse; - float32 newImpulse = b2Clamp(vcp->tangentImpulse + lambda, -maxFriction, maxFriction); - lambda = newImpulse - vcp->tangentImpulse; - vcp->tangentImpulse = newImpulse; - - // Apply contact impulse - b2Vec2 P = lambda * tangent; - - vA -= mA * P; - wA -= iA * b2Cross(vcp->rA, P); - - vB += mB * P; - wB += iB * b2Cross(vcp->rB, P); - } - - // Solve normal constraints - if (vc->pointCount == 1) - { - b2VelocityConstraintPoint* vcp = vc->points + 0; - - // Relative velocity at contact - b2Vec2 dv = vB + b2Cross(wB, vcp->rB) - vA - b2Cross(wA, vcp->rA); - - // Compute normal impulse - float32 vn = b2Dot(dv, normal); - float32 lambda = -vcp->normalMass * (vn - vcp->velocityBias); - - // b2Clamp the accumulated impulse - float32 newImpulse = b2Max(vcp->normalImpulse + lambda, 0.0f); - lambda = newImpulse - vcp->normalImpulse; - vcp->normalImpulse = newImpulse; - - // Apply contact impulse - b2Vec2 P = lambda * normal; - vA -= mA * P; - wA -= iA * b2Cross(vcp->rA, P); - - vB += mB * P; - wB += iB * b2Cross(vcp->rB, P); - } - else - { - // Block solver developed in collaboration with Dirk Gregorius (back in 01/07 on Box2D_Lite). - // Build the mini LCP for this contact patch - // - // vn = A * x + b, vn >= 0, , vn >= 0, x >= 0 and vn_i * x_i = 0 with i = 1..2 - // - // A = J * W * JT and J = ( -n, -r1 x n, n, r2 x n ) - // b = vn0 - velocityBias - // - // The system is solved using the "Total enumeration method" (s. Murty). The complementary constraint vn_i * x_i - // implies that we must have in any solution either vn_i = 0 or x_i = 0. So for the 2D contact problem the cases - // vn1 = 0 and vn2 = 0, x1 = 0 and x2 = 0, x1 = 0 and vn2 = 0, x2 = 0 and vn1 = 0 need to be tested. The first valid - // solution that satisfies the problem is chosen. - // - // In order to account of the accumulated impulse 'a' (because of the iterative nature of the solver which only requires - // that the accumulated impulse is clamped and not the incremental impulse) we change the impulse variable (x_i). - // - // Substitute: - // - // x = a + d - // - // a := old total impulse - // x := new total impulse - // d := incremental impulse - // - // For the current iteration we extend the formula for the incremental impulse - // to compute the new total impulse: - // - // vn = A * d + b - // = A * (x - a) + b - // = A * x + b - A * a - // = A * x + b' - // b' = b - A * a; - - b2VelocityConstraintPoint* cp1 = vc->points + 0; - b2VelocityConstraintPoint* cp2 = vc->points + 1; - - b2Vec2 a(cp1->normalImpulse, cp2->normalImpulse); - b2Assert(a.x >= 0.0f && a.y >= 0.0f); - - // Relative velocity at contact - b2Vec2 dv1 = vB + b2Cross(wB, cp1->rB) - vA - b2Cross(wA, cp1->rA); - b2Vec2 dv2 = vB + b2Cross(wB, cp2->rB) - vA - b2Cross(wA, cp2->rA); - - // Compute normal velocity - float32 vn1 = b2Dot(dv1, normal); - float32 vn2 = b2Dot(dv2, normal); - - b2Vec2 b; - b.x = vn1 - cp1->velocityBias; - b.y = vn2 - cp2->velocityBias; - - // Compute b' - b -= b2Mul(vc->K, a); - - const float32 k_errorTol = 1e-3f; - B2_NOT_USED(k_errorTol); - - for (;;) - { - // - // Case 1: vn = 0 - // - // 0 = A * x + b' - // - // Solve for x: - // - // x = - inv(A) * b' - // - b2Vec2 x = - b2Mul(vc->normalMass, b); - - if (x.x >= 0.0f && x.y >= 0.0f) - { - // Get the incremental impulse - b2Vec2 d = x - a; - - // Apply incremental impulse - b2Vec2 P1 = d.x * normal; - b2Vec2 P2 = d.y * normal; - vA -= mA * (P1 + P2); - wA -= iA * (b2Cross(cp1->rA, P1) + b2Cross(cp2->rA, P2)); - - vB += mB * (P1 + P2); - wB += iB * (b2Cross(cp1->rB, P1) + b2Cross(cp2->rB, P2)); - - // Accumulate - cp1->normalImpulse = x.x; - cp2->normalImpulse = x.y; - -#if B2_DEBUG_SOLVER == 1 - // Postconditions - dv1 = vB + b2Cross(wB, cp1->rB) - vA - b2Cross(wA, cp1->rA); - dv2 = vB + b2Cross(wB, cp2->rB) - vA - b2Cross(wA, cp2->rA); - - // Compute normal velocity - vn1 = b2Dot(dv1, normal); - vn2 = b2Dot(dv2, normal); - - b2Assert(b2Abs(vn1 - cp1->velocityBias) < k_errorTol); - b2Assert(b2Abs(vn2 - cp2->velocityBias) < k_errorTol); -#endif - break; - } - - // - // Case 2: vn1 = 0 and x2 = 0 - // - // 0 = a11 * x1 + a12 * 0 + b1' - // vn2 = a21 * x1 + a22 * 0 + b2' - // - x.x = - cp1->normalMass * b.x; - x.y = 0.0f; - vn1 = 0.0f; - vn2 = vc->K.ex.y * x.x + b.y; - - if (x.x >= 0.0f && vn2 >= 0.0f) - { - // Get the incremental impulse - b2Vec2 d = x - a; - - // Apply incremental impulse - b2Vec2 P1 = d.x * normal; - b2Vec2 P2 = d.y * normal; - vA -= mA * (P1 + P2); - wA -= iA * (b2Cross(cp1->rA, P1) + b2Cross(cp2->rA, P2)); - - vB += mB * (P1 + P2); - wB += iB * (b2Cross(cp1->rB, P1) + b2Cross(cp2->rB, P2)); - - // Accumulate - cp1->normalImpulse = x.x; - cp2->normalImpulse = x.y; - -#if B2_DEBUG_SOLVER == 1 - // Postconditions - dv1 = vB + b2Cross(wB, cp1->rB) - vA - b2Cross(wA, cp1->rA); - - // Compute normal velocity - vn1 = b2Dot(dv1, normal); - - b2Assert(b2Abs(vn1 - cp1->velocityBias) < k_errorTol); -#endif - break; - } - - - // - // Case 3: vn2 = 0 and x1 = 0 - // - // vn1 = a11 * 0 + a12 * x2 + b1' - // 0 = a21 * 0 + a22 * x2 + b2' - // - x.x = 0.0f; - x.y = - cp2->normalMass * b.y; - vn1 = vc->K.ey.x * x.y + b.x; - vn2 = 0.0f; - - if (x.y >= 0.0f && vn1 >= 0.0f) - { - // Resubstitute for the incremental impulse - b2Vec2 d = x - a; - - // Apply incremental impulse - b2Vec2 P1 = d.x * normal; - b2Vec2 P2 = d.y * normal; - vA -= mA * (P1 + P2); - wA -= iA * (b2Cross(cp1->rA, P1) + b2Cross(cp2->rA, P2)); - - vB += mB * (P1 + P2); - wB += iB * (b2Cross(cp1->rB, P1) + b2Cross(cp2->rB, P2)); - - // Accumulate - cp1->normalImpulse = x.x; - cp2->normalImpulse = x.y; - -#if B2_DEBUG_SOLVER == 1 - // Postconditions - dv2 = vB + b2Cross(wB, cp2->rB) - vA - b2Cross(wA, cp2->rA); - - // Compute normal velocity - vn2 = b2Dot(dv2, normal); - - b2Assert(b2Abs(vn2 - cp2->velocityBias) < k_errorTol); -#endif - break; - } - - // - // Case 4: x1 = 0 and x2 = 0 - // - // vn1 = b1 - // vn2 = b2; - x.x = 0.0f; - x.y = 0.0f; - vn1 = b.x; - vn2 = b.y; - - if (vn1 >= 0.0f && vn2 >= 0.0f ) - { - // Resubstitute for the incremental impulse - b2Vec2 d = x - a; - - // Apply incremental impulse - b2Vec2 P1 = d.x * normal; - b2Vec2 P2 = d.y * normal; - vA -= mA * (P1 + P2); - wA -= iA * (b2Cross(cp1->rA, P1) + b2Cross(cp2->rA, P2)); - - vB += mB * (P1 + P2); - wB += iB * (b2Cross(cp1->rB, P1) + b2Cross(cp2->rB, P2)); - - // Accumulate - cp1->normalImpulse = x.x; - cp2->normalImpulse = x.y; - - break; - } - - // No solution, give up. This is hit sometimes, but it doesn't seem to matter. - break; - } - } - - m_velocities[indexA].v = vA; - m_velocities[indexA].w = wA; - m_velocities[indexB].v = vB; - m_velocities[indexB].w = wB; - } -} - -void b2ContactSolver::StoreImpulses() -{ - for (int32 i = 0; i < m_count; ++i) - { - b2ContactVelocityConstraint* vc = m_velocityConstraints + i; - b2Manifold* manifold = m_contacts[vc->contactIndex]->GetManifold(); - - for (int32 j = 0; j < vc->pointCount; ++j) - { - manifold->points[j].normalImpulse = vc->points[j].normalImpulse; - manifold->points[j].tangentImpulse = vc->points[j].tangentImpulse; - } - } -} - -struct b2PositionSolverManifold -{ - void Initialize(b2ContactPositionConstraint* pc, const b2Transform& xfA, const b2Transform& xfB, int32 index) - { - b2Assert(pc->pointCount > 0); - - switch (pc->type) - { - case b2Manifold::e_circles: - { - b2Vec2 pointA = b2Mul(xfA, pc->localPoint); - b2Vec2 pointB = b2Mul(xfB, pc->localPoints[0]); - normal = pointB - pointA; - normal.Normalize(); - point = 0.5f * (pointA + pointB); - separation = b2Dot(pointB - pointA, normal) - pc->radiusA - pc->radiusB; - } - break; - - case b2Manifold::e_faceA: - { - normal = b2Mul(xfA.q, pc->localNormal); - b2Vec2 planePoint = b2Mul(xfA, pc->localPoint); - - b2Vec2 clipPoint = b2Mul(xfB, pc->localPoints[index]); - separation = b2Dot(clipPoint - planePoint, normal) - pc->radiusA - pc->radiusB; - point = clipPoint; - } - break; - - case b2Manifold::e_faceB: - { - normal = b2Mul(xfB.q, pc->localNormal); - b2Vec2 planePoint = b2Mul(xfB, pc->localPoint); - - b2Vec2 clipPoint = b2Mul(xfA, pc->localPoints[index]); - separation = b2Dot(clipPoint - planePoint, normal) - pc->radiusA - pc->radiusB; - point = clipPoint; - - // Ensure normal points from A to B - normal = -normal; - } - break; - } - } - - b2Vec2 normal; - b2Vec2 point; - float32 separation; -}; - -// Sequential solver. -bool b2ContactSolver::SolvePositionConstraints() -{ - float32 minSeparation = 0.0f; - - for (int32 i = 0; i < m_count; ++i) - { - b2ContactPositionConstraint* pc = m_positionConstraints + i; - - int32 indexA = pc->indexA; - int32 indexB = pc->indexB; - b2Vec2 localCenterA = pc->localCenterA; - float32 mA = pc->invMassA; - float32 iA = pc->invIA; - b2Vec2 localCenterB = pc->localCenterB; - float32 mB = pc->invMassB; - float32 iB = pc->invIB; - int32 pointCount = pc->pointCount; - - b2Vec2 cA = m_positions[indexA].c; - float32 aA = m_positions[indexA].a; - - b2Vec2 cB = m_positions[indexB].c; - float32 aB = m_positions[indexB].a; - - // Solve normal constraints - for (int32 j = 0; j < pointCount; ++j) - { - b2Transform xfA, xfB; - xfA.q.Set(aA); - xfB.q.Set(aB); - xfA.p = cA - b2Mul(xfA.q, localCenterA); - xfB.p = cB - b2Mul(xfB.q, localCenterB); - - b2PositionSolverManifold psm; - psm.Initialize(pc, xfA, xfB, j); - b2Vec2 normal = psm.normal; - - b2Vec2 point = psm.point; - float32 separation = psm.separation; - - b2Vec2 rA = point - cA; - b2Vec2 rB = point - cB; - - // Track max constraint error. - minSeparation = b2Min(minSeparation, separation); - - // Prevent large corrections and allow slop. - float32 C = b2Clamp(b2_baumgarte * (separation + b2_linearSlop), -b2_maxLinearCorrection, 0.0f); - - // Compute the effective mass. - float32 rnA = b2Cross(rA, normal); - float32 rnB = b2Cross(rB, normal); - float32 K = mA + mB + iA * rnA * rnA + iB * rnB * rnB; - - // Compute normal impulse - float32 impulse = K > 0.0f ? - C / K : 0.0f; - - b2Vec2 P = impulse * normal; - - cA -= mA * P; - aA -= iA * b2Cross(rA, P); - - cB += mB * P; - aB += iB * b2Cross(rB, P); - } - - m_positions[indexA].c = cA; - m_positions[indexA].a = aA; - - m_positions[indexB].c = cB; - m_positions[indexB].a = aB; - } - - // We can't expect minSpeparation >= -b2_linearSlop because we don't - // push the separation above -b2_linearSlop. - return minSeparation >= -3.0f * b2_linearSlop; -} - -// Sequential position solver for position constraints. -bool b2ContactSolver::SolveTOIPositionConstraints(int32 toiIndexA, int32 toiIndexB) -{ - float32 minSeparation = 0.0f; - - for (int32 i = 0; i < m_count; ++i) - { - b2ContactPositionConstraint* pc = m_positionConstraints + i; - - int32 indexA = pc->indexA; - int32 indexB = pc->indexB; - b2Vec2 localCenterA = pc->localCenterA; - b2Vec2 localCenterB = pc->localCenterB; - int32 pointCount = pc->pointCount; - - float32 mA = 0.0f; - float32 iA = 0.0f; - if (indexA == toiIndexA || indexA == toiIndexB) - { - mA = pc->invMassA; - iA = pc->invIA; - } - - float32 mB = pc->invMassB; - float32 iB = pc->invIB; - if (indexB == toiIndexA || indexB == toiIndexB) - { - mB = pc->invMassB; - iB = pc->invIB; - } - - b2Vec2 cA = m_positions[indexA].c; - float32 aA = m_positions[indexA].a; - - b2Vec2 cB = m_positions[indexB].c; - float32 aB = m_positions[indexB].a; - - // Solve normal constraints - for (int32 j = 0; j < pointCount; ++j) - { - b2Transform xfA, xfB; - xfA.q.Set(aA); - xfB.q.Set(aB); - xfA.p = cA - b2Mul(xfA.q, localCenterA); - xfB.p = cB - b2Mul(xfB.q, localCenterB); - - b2PositionSolverManifold psm; - psm.Initialize(pc, xfA, xfB, j); - b2Vec2 normal = psm.normal; - - b2Vec2 point = psm.point; - float32 separation = psm.separation; - - b2Vec2 rA = point - cA; - b2Vec2 rB = point - cB; - - // Track max constraint error. - minSeparation = b2Min(minSeparation, separation); - - // Prevent large corrections and allow slop. - float32 C = b2Clamp(b2_toiBaugarte * (separation + b2_linearSlop), -b2_maxLinearCorrection, 0.0f); - - // Compute the effective mass. - float32 rnA = b2Cross(rA, normal); - float32 rnB = b2Cross(rB, normal); - float32 K = mA + mB + iA * rnA * rnA + iB * rnB * rnB; - - // Compute normal impulse - float32 impulse = K > 0.0f ? - C / K : 0.0f; - - b2Vec2 P = impulse * normal; - - cA -= mA * P; - aA -= iA * b2Cross(rA, P); - - cB += mB * P; - aB += iB * b2Cross(rB, P); - } - - m_positions[indexA].c = cA; - m_positions[indexA].a = aA; - - m_positions[indexB].c = cB; - m_positions[indexB].a = aB; - } - - // We can't expect minSpeparation >= -b2_linearSlop because we don't - // push the separation above -b2_linearSlop. - return minSeparation >= -1.5f * b2_linearSlop; -} diff --git a/external/Box2D/Dynamics/Contacts/b2ContactSolver.h b/external/Box2D/Dynamics/Contacts/b2ContactSolver.h deleted file mode 100644 index aef1987a9e..0000000000 --- a/external/Box2D/Dynamics/Contacts/b2ContactSolver.h +++ /dev/null @@ -1,94 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_CONTACT_SOLVER_H -#define B2_CONTACT_SOLVER_H - -#include -#include -#include - -class b2Contact; -class b2Body; -class b2StackAllocator; -struct b2ContactPositionConstraint; - -struct b2VelocityConstraintPoint -{ - b2Vec2 rA; - b2Vec2 rB; - float32 normalImpulse; - float32 tangentImpulse; - float32 normalMass; - float32 tangentMass; - float32 velocityBias; -}; - -struct b2ContactVelocityConstraint -{ - b2VelocityConstraintPoint points[b2_maxManifoldPoints]; - b2Vec2 normal; - b2Mat22 normalMass; - b2Mat22 K; - int32 indexA; - int32 indexB; - float32 invMassA, invMassB; - float32 invIA, invIB; - float32 friction; - float32 restitution; - int32 pointCount; - int32 contactIndex; -}; - -struct b2ContactSolverDef -{ - b2TimeStep step; - b2Contact** contacts; - int32 count; - b2Position* positions; - b2Velocity* velocities; - b2StackAllocator* allocator; -}; - -class b2ContactSolver -{ -public: - b2ContactSolver(b2ContactSolverDef* def); - ~b2ContactSolver(); - - void InitializeVelocityConstraints(); - - void WarmStart(); - void SolveVelocityConstraints(); - void StoreImpulses(); - - bool SolvePositionConstraints(); - bool SolveTOIPositionConstraints(int32 toiIndexA, int32 toiIndexB); - - b2TimeStep m_step; - b2Position* m_positions; - b2Velocity* m_velocities; - b2StackAllocator* m_allocator; - b2ContactPositionConstraint* m_positionConstraints; - b2ContactVelocityConstraint* m_velocityConstraints; - b2Contact** m_contacts; - int m_count; -}; - -#endif - diff --git a/external/Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.cpp b/external/Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.cpp deleted file mode 100644 index aade42880a..0000000000 --- a/external/Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/* -* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include - -#include -using namespace std; - -b2Contact* b2EdgeAndCircleContact::Create(b2Fixture* fixtureA, int32, b2Fixture* fixtureB, int32, b2BlockAllocator* allocator) -{ - void* mem = allocator->Allocate(sizeof(b2EdgeAndCircleContact)); - return new (mem) b2EdgeAndCircleContact(fixtureA, fixtureB); -} - -void b2EdgeAndCircleContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) -{ - ((b2EdgeAndCircleContact*)contact)->~b2EdgeAndCircleContact(); - allocator->Free(contact, sizeof(b2EdgeAndCircleContact)); -} - -b2EdgeAndCircleContact::b2EdgeAndCircleContact(b2Fixture* fixtureA, b2Fixture* fixtureB) -: b2Contact(fixtureA, 0, fixtureB, 0) -{ - b2Assert(m_fixtureA->GetType() == b2Shape::e_edge); - b2Assert(m_fixtureB->GetType() == b2Shape::e_circle); -} - -void b2EdgeAndCircleContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) -{ - b2CollideEdgeAndCircle( manifold, - (b2EdgeShape*)m_fixtureA->GetShape(), xfA, - (b2CircleShape*)m_fixtureB->GetShape(), xfB); -} diff --git a/external/Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.h b/external/Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.h deleted file mode 100644 index 70771ec536..0000000000 --- a/external/Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.h +++ /dev/null @@ -1,39 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_EDGE_AND_CIRCLE_CONTACT_H -#define B2_EDGE_AND_CIRCLE_CONTACT_H - -#include - -class b2BlockAllocator; - -class b2EdgeAndCircleContact : public b2Contact -{ -public: - static b2Contact* Create( b2Fixture* fixtureA, int32 indexA, - b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); - static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); - - b2EdgeAndCircleContact(b2Fixture* fixtureA, b2Fixture* fixtureB); - ~b2EdgeAndCircleContact() {} - - void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB); -}; - -#endif diff --git a/external/Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.cpp b/external/Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.cpp deleted file mode 100644 index 04ce394107..0000000000 --- a/external/Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/* -* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include - -#include -using namespace std; - -b2Contact* b2EdgeAndPolygonContact::Create(b2Fixture* fixtureA, int32, b2Fixture* fixtureB, int32, b2BlockAllocator* allocator) -{ - void* mem = allocator->Allocate(sizeof(b2EdgeAndPolygonContact)); - return new (mem) b2EdgeAndPolygonContact(fixtureA, fixtureB); -} - -void b2EdgeAndPolygonContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) -{ - ((b2EdgeAndPolygonContact*)contact)->~b2EdgeAndPolygonContact(); - allocator->Free(contact, sizeof(b2EdgeAndPolygonContact)); -} - -b2EdgeAndPolygonContact::b2EdgeAndPolygonContact(b2Fixture* fixtureA, b2Fixture* fixtureB) -: b2Contact(fixtureA, 0, fixtureB, 0) -{ - b2Assert(m_fixtureA->GetType() == b2Shape::e_edge); - b2Assert(m_fixtureB->GetType() == b2Shape::e_polygon); -} - -void b2EdgeAndPolygonContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) -{ - b2CollideEdgeAndPolygon( manifold, - (b2EdgeShape*)m_fixtureA->GetShape(), xfA, - (b2PolygonShape*)m_fixtureB->GetShape(), xfB); -} diff --git a/external/Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.h b/external/Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.h deleted file mode 100644 index f65f3acca9..0000000000 --- a/external/Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.h +++ /dev/null @@ -1,39 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_EDGE_AND_POLYGON_CONTACT_H -#define B2_EDGE_AND_POLYGON_CONTACT_H - -#include - -class b2BlockAllocator; - -class b2EdgeAndPolygonContact : public b2Contact -{ -public: - static b2Contact* Create( b2Fixture* fixtureA, int32 indexA, - b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); - static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); - - b2EdgeAndPolygonContact(b2Fixture* fixtureA, b2Fixture* fixtureB); - ~b2EdgeAndPolygonContact() {} - - void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB); -}; - -#endif diff --git a/external/Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.cpp b/external/Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.cpp deleted file mode 100644 index 961b26f38a..0000000000 --- a/external/Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include - -#include -using namespace std; - -b2Contact* b2PolygonAndCircleContact::Create(b2Fixture* fixtureA, int32, b2Fixture* fixtureB, int32, b2BlockAllocator* allocator) -{ - void* mem = allocator->Allocate(sizeof(b2PolygonAndCircleContact)); - return new (mem) b2PolygonAndCircleContact(fixtureA, fixtureB); -} - -void b2PolygonAndCircleContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) -{ - ((b2PolygonAndCircleContact*)contact)->~b2PolygonAndCircleContact(); - allocator->Free(contact, sizeof(b2PolygonAndCircleContact)); -} - -b2PolygonAndCircleContact::b2PolygonAndCircleContact(b2Fixture* fixtureA, b2Fixture* fixtureB) -: b2Contact(fixtureA, 0, fixtureB, 0) -{ - b2Assert(m_fixtureA->GetType() == b2Shape::e_polygon); - b2Assert(m_fixtureB->GetType() == b2Shape::e_circle); -} - -void b2PolygonAndCircleContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) -{ - b2CollidePolygonAndCircle( manifold, - (b2PolygonShape*)m_fixtureA->GetShape(), xfA, - (b2CircleShape*)m_fixtureB->GetShape(), xfB); -} diff --git a/external/Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.h b/external/Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.h deleted file mode 100644 index 7b1a5288b4..0000000000 --- a/external/Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.h +++ /dev/null @@ -1,38 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_POLYGON_AND_CIRCLE_CONTACT_H -#define B2_POLYGON_AND_CIRCLE_CONTACT_H - -#include - -class b2BlockAllocator; - -class b2PolygonAndCircleContact : public b2Contact -{ -public: - static b2Contact* Create(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); - static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); - - b2PolygonAndCircleContact(b2Fixture* fixtureA, b2Fixture* fixtureB); - ~b2PolygonAndCircleContact() {} - - void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB); -}; - -#endif diff --git a/external/Box2D/Dynamics/Contacts/b2PolygonContact.cpp b/external/Box2D/Dynamics/Contacts/b2PolygonContact.cpp deleted file mode 100644 index a2884a440d..0000000000 --- a/external/Box2D/Dynamics/Contacts/b2PolygonContact.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include -#include -#include -#include - -#include -using namespace std; - -b2Contact* b2PolygonContact::Create(b2Fixture* fixtureA, int32, b2Fixture* fixtureB, int32, b2BlockAllocator* allocator) -{ - void* mem = allocator->Allocate(sizeof(b2PolygonContact)); - return new (mem) b2PolygonContact(fixtureA, fixtureB); -} - -void b2PolygonContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) -{ - ((b2PolygonContact*)contact)->~b2PolygonContact(); - allocator->Free(contact, sizeof(b2PolygonContact)); -} - -b2PolygonContact::b2PolygonContact(b2Fixture* fixtureA, b2Fixture* fixtureB) - : b2Contact(fixtureA, 0, fixtureB, 0) -{ - b2Assert(m_fixtureA->GetType() == b2Shape::e_polygon); - b2Assert(m_fixtureB->GetType() == b2Shape::e_polygon); -} - -void b2PolygonContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) -{ - b2CollidePolygons( manifold, - (b2PolygonShape*)m_fixtureA->GetShape(), xfA, - (b2PolygonShape*)m_fixtureB->GetShape(), xfB); -} diff --git a/external/Box2D/Dynamics/Contacts/b2PolygonContact.h b/external/Box2D/Dynamics/Contacts/b2PolygonContact.h deleted file mode 100644 index 302684232a..0000000000 --- a/external/Box2D/Dynamics/Contacts/b2PolygonContact.h +++ /dev/null @@ -1,39 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_POLYGON_CONTACT_H -#define B2_POLYGON_CONTACT_H - -#include - -class b2BlockAllocator; - -class b2PolygonContact : public b2Contact -{ -public: - static b2Contact* Create( b2Fixture* fixtureA, int32 indexA, - b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); - static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); - - b2PolygonContact(b2Fixture* fixtureA, b2Fixture* fixtureB); - ~b2PolygonContact() {} - - void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB); -}; - -#endif diff --git a/external/Box2D/Dynamics/Joints/b2DistanceJoint.cpp b/external/Box2D/Dynamics/Joints/b2DistanceJoint.cpp deleted file mode 100644 index b2d4bd006c..0000000000 --- a/external/Box2D/Dynamics/Joints/b2DistanceJoint.cpp +++ /dev/null @@ -1,260 +0,0 @@ -/* -* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include - -// 1-D constrained system -// m (v2 - v1) = lambda -// v2 + (beta/h) * x1 + gamma * lambda = 0, gamma has units of inverse mass. -// x2 = x1 + h * v2 - -// 1-D mass-damper-spring system -// m (v2 - v1) + h * d * v2 + h * k * - -// C = norm(p2 - p1) - L -// u = (p2 - p1) / norm(p2 - p1) -// Cdot = dot(u, v2 + cross(w2, r2) - v1 - cross(w1, r1)) -// J = [-u -cross(r1, u) u cross(r2, u)] -// K = J * invM * JT -// = invMass1 + invI1 * cross(r1, u)^2 + invMass2 + invI2 * cross(r2, u)^2 - -void b2DistanceJointDef::Initialize(b2Body* b1, b2Body* b2, - const b2Vec2& anchor1, const b2Vec2& anchor2) -{ - bodyA = b1; - bodyB = b2; - localAnchorA = bodyA->GetLocalPoint(anchor1); - localAnchorB = bodyB->GetLocalPoint(anchor2); - b2Vec2 d = anchor2 - anchor1; - length = d.Length(); -} - -b2DistanceJoint::b2DistanceJoint(const b2DistanceJointDef* def) -: b2Joint(def) -{ - m_localAnchorA = def->localAnchorA; - m_localAnchorB = def->localAnchorB; - m_length = def->length; - m_frequencyHz = def->frequencyHz; - m_dampingRatio = def->dampingRatio; - m_impulse = 0.0f; - m_gamma = 0.0f; - m_bias = 0.0f; -} - -void b2DistanceJoint::InitVelocityConstraints(const b2SolverData& data) -{ - m_indexA = m_bodyA->m_islandIndex; - m_indexB = m_bodyB->m_islandIndex; - m_localCenterA = m_bodyA->m_sweep.localCenter; - m_localCenterB = m_bodyB->m_sweep.localCenter; - m_invMassA = m_bodyA->m_invMass; - m_invMassB = m_bodyB->m_invMass; - m_invIA = m_bodyA->m_invI; - m_invIB = m_bodyB->m_invI; - - b2Vec2 cA = data.positions[m_indexA].c; - float32 aA = data.positions[m_indexA].a; - b2Vec2 vA = data.velocities[m_indexA].v; - float32 wA = data.velocities[m_indexA].w; - - b2Vec2 cB = data.positions[m_indexB].c; - float32 aB = data.positions[m_indexB].a; - b2Vec2 vB = data.velocities[m_indexB].v; - float32 wB = data.velocities[m_indexB].w; - - b2Rot qA(aA), qB(aB); - - m_rA = b2Mul(qA, m_localAnchorA - m_localCenterA); - m_rB = b2Mul(qB, m_localAnchorB - m_localCenterB); - m_u = cB + m_rB - cA - m_rA; - - // Handle singularity. - float32 length = m_u.Length(); - if (length > b2_linearSlop) - { - m_u *= 1.0f / length; - } - else - { - m_u.Set(0.0f, 0.0f); - } - - float32 crAu = b2Cross(m_rA, m_u); - float32 crBu = b2Cross(m_rB, m_u); - float32 invMass = m_invMassA + m_invIA * crAu * crAu + m_invMassB + m_invIB * crBu * crBu; - - // Compute the effective mass matrix. - m_mass = invMass != 0.0f ? 1.0f / invMass : 0.0f; - - if (m_frequencyHz > 0.0f) - { - float32 C = length - m_length; - - // Frequency - float32 omega = 2.0f * b2_pi * m_frequencyHz; - - // Damping coefficient - float32 d = 2.0f * m_mass * m_dampingRatio * omega; - - // Spring stiffness - float32 k = m_mass * omega * omega; - - // magic formulas - float32 h = data.step.dt; - m_gamma = h * (d + h * k); - m_gamma = m_gamma != 0.0f ? 1.0f / m_gamma : 0.0f; - m_bias = C * h * k * m_gamma; - - invMass += m_gamma; - m_mass = invMass != 0.0f ? 1.0f / invMass : 0.0f; - } - else - { - m_gamma = 0.0f; - m_bias = 0.0f; - } - - if (data.step.warmStarting) - { - // Scale the impulse to support a variable time step. - m_impulse *= data.step.dtRatio; - - b2Vec2 P = m_impulse * m_u; - vA -= m_invMassA * P; - wA -= m_invIA * b2Cross(m_rA, P); - vB += m_invMassB * P; - wB += m_invIB * b2Cross(m_rB, P); - } - else - { - m_impulse = 0.0f; - } - - data.velocities[m_indexA].v = vA; - data.velocities[m_indexA].w = wA; - data.velocities[m_indexB].v = vB; - data.velocities[m_indexB].w = wB; -} - -void b2DistanceJoint::SolveVelocityConstraints(const b2SolverData& data) -{ - b2Vec2 vA = data.velocities[m_indexA].v; - float32 wA = data.velocities[m_indexA].w; - b2Vec2 vB = data.velocities[m_indexB].v; - float32 wB = data.velocities[m_indexB].w; - - // Cdot = dot(u, v + cross(w, r)) - b2Vec2 vpA = vA + b2Cross(wA, m_rA); - b2Vec2 vpB = vB + b2Cross(wB, m_rB); - float32 Cdot = b2Dot(m_u, vpB - vpA); - - float32 impulse = -m_mass * (Cdot + m_bias + m_gamma * m_impulse); - m_impulse += impulse; - - b2Vec2 P = impulse * m_u; - vA -= m_invMassA * P; - wA -= m_invIA * b2Cross(m_rA, P); - vB += m_invMassB * P; - wB += m_invIB * b2Cross(m_rB, P); - - data.velocities[m_indexA].v = vA; - data.velocities[m_indexA].w = wA; - data.velocities[m_indexB].v = vB; - data.velocities[m_indexB].w = wB; -} - -bool b2DistanceJoint::SolvePositionConstraints(const b2SolverData& data) -{ - if (m_frequencyHz > 0.0f) - { - // There is no position correction for soft distance constraints. - return true; - } - - b2Vec2 cA = data.positions[m_indexA].c; - float32 aA = data.positions[m_indexA].a; - b2Vec2 cB = data.positions[m_indexB].c; - float32 aB = data.positions[m_indexB].a; - - b2Rot qA(aA), qB(aB); - - b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA); - b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB); - b2Vec2 u = cB + rB - cA - rA; - - float32 length = u.Normalize(); - float32 C = length - m_length; - C = b2Clamp(C, -b2_maxLinearCorrection, b2_maxLinearCorrection); - - float32 impulse = -m_mass * C; - b2Vec2 P = impulse * u; - - cA -= m_invMassA * P; - aA -= m_invIA * b2Cross(rA, P); - cB += m_invMassB * P; - aB += m_invIB * b2Cross(rB, P); - - data.positions[m_indexA].c = cA; - data.positions[m_indexA].a = aA; - data.positions[m_indexB].c = cB; - data.positions[m_indexB].a = aB; - - return b2Abs(C) < b2_linearSlop; -} - -b2Vec2 b2DistanceJoint::GetAnchorA() const -{ - return m_bodyA->GetWorldPoint(m_localAnchorA); -} - -b2Vec2 b2DistanceJoint::GetAnchorB() const -{ - return m_bodyB->GetWorldPoint(m_localAnchorB); -} - -b2Vec2 b2DistanceJoint::GetReactionForce(float32 inv_dt) const -{ - b2Vec2 F = (inv_dt * m_impulse) * m_u; - return F; -} - -float32 b2DistanceJoint::GetReactionTorque(float32 inv_dt) const -{ - B2_NOT_USED(inv_dt); - return 0.0f; -} - -void b2DistanceJoint::Dump() -{ - int32 indexA = m_bodyA->m_islandIndex; - int32 indexB = m_bodyB->m_islandIndex; - - b2Log(" b2DistanceJointDef jd;\n"); - b2Log(" jd.bodyA = bodies[%d];\n", indexA); - b2Log(" jd.bodyB = bodies[%d];\n", indexB); - b2Log(" jd.collideConnected = bool(%d);\n", m_collideConnected); - b2Log(" jd.localAnchorA.Set(%.15lef, %.15lef);\n", m_localAnchorA.x, m_localAnchorA.y); - b2Log(" jd.localAnchorB.Set(%.15lef, %.15lef);\n", m_localAnchorB.x, m_localAnchorB.y); - b2Log(" jd.length = %.15lef;\n", m_length); - b2Log(" jd.frequencyHz = %.15lef;\n", m_frequencyHz); - b2Log(" jd.dampingRatio = %.15lef;\n", m_dampingRatio); - b2Log(" joints[%d] = m_world->CreateJoint(&jd);\n", m_index); -} diff --git a/external/Box2D/Dynamics/Joints/b2DistanceJoint.h b/external/Box2D/Dynamics/Joints/b2DistanceJoint.h deleted file mode 100644 index fc11476ff9..0000000000 --- a/external/Box2D/Dynamics/Joints/b2DistanceJoint.h +++ /dev/null @@ -1,169 +0,0 @@ -/* -* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_DISTANCE_JOINT_H -#define B2_DISTANCE_JOINT_H - -#include - -/// Distance joint definition. This requires defining an -/// anchor point on both bodies and the non-zero length of the -/// distance joint. The definition uses local anchor points -/// so that the initial configuration can violate the constraint -/// slightly. This helps when saving and loading a game. -/// @warning Do not use a zero or short length. -struct b2DistanceJointDef : public b2JointDef -{ - b2DistanceJointDef() - { - type = e_distanceJoint; - localAnchorA.Set(0.0f, 0.0f); - localAnchorB.Set(0.0f, 0.0f); - length = 1.0f; - frequencyHz = 0.0f; - dampingRatio = 0.0f; - } - - /// Initialize the bodies, anchors, and length using the world - /// anchors. - void Initialize(b2Body* bodyA, b2Body* bodyB, - const b2Vec2& anchorA, const b2Vec2& anchorB); - - /// The local anchor point relative to bodyA's origin. - b2Vec2 localAnchorA; - - /// The local anchor point relative to bodyB's origin. - b2Vec2 localAnchorB; - - /// The natural length between the anchor points. - float32 length; - - /// The mass-spring-damper frequency in Hertz. A value of 0 - /// disables softness. - float32 frequencyHz; - - /// The damping ratio. 0 = no damping, 1 = critical damping. - float32 dampingRatio; -}; - -/// A distance joint constrains two points on two bodies -/// to remain at a fixed distance from each other. You can view -/// this as a massless, rigid rod. -class b2DistanceJoint : public b2Joint -{ -public: - - b2Vec2 GetAnchorA() const; - b2Vec2 GetAnchorB() const; - - /// Get the reaction force given the inverse time step. - /// Unit is N. - b2Vec2 GetReactionForce(float32 inv_dt) const; - - /// Get the reaction torque given the inverse time step. - /// Unit is N*m. This is always zero for a distance joint. - float32 GetReactionTorque(float32 inv_dt) const; - - /// The local anchor point relative to bodyA's origin. - const b2Vec2& GetLocalAnchorA() const { return m_localAnchorA; } - - /// The local anchor point relative to bodyB's origin. - const b2Vec2& GetLocalAnchorB() const { return m_localAnchorB; } - - /// Set/get the natural length. - /// Manipulating the length can lead to non-physical behavior when the frequency is zero. - void SetLength(float32 length); - float32 GetLength() const; - - /// Set/get frequency in Hz. - void SetFrequency(float32 hz); - float32 GetFrequency() const; - - /// Set/get damping ratio. - void SetDampingRatio(float32 ratio); - float32 GetDampingRatio() const; - - /// Dump joint to dmLog - void Dump(); - -protected: - - friend class b2Joint; - b2DistanceJoint(const b2DistanceJointDef* data); - - void InitVelocityConstraints(const b2SolverData& data); - void SolveVelocityConstraints(const b2SolverData& data); - bool SolvePositionConstraints(const b2SolverData& data); - - float32 m_frequencyHz; - float32 m_dampingRatio; - float32 m_bias; - - // Solver shared - b2Vec2 m_localAnchorA; - b2Vec2 m_localAnchorB; - float32 m_gamma; - float32 m_impulse; - float32 m_length; - - // Solver temp - int32 m_indexA; - int32 m_indexB; - b2Vec2 m_u; - b2Vec2 m_rA; - b2Vec2 m_rB; - b2Vec2 m_localCenterA; - b2Vec2 m_localCenterB; - float32 m_invMassA; - float32 m_invMassB; - float32 m_invIA; - float32 m_invIB; - float32 m_mass; -}; - -inline void b2DistanceJoint::SetLength(float32 length) -{ - m_length = length; -} - -inline float32 b2DistanceJoint::GetLength() const -{ - return m_length; -} - -inline void b2DistanceJoint::SetFrequency(float32 hz) -{ - m_frequencyHz = hz; -} - -inline float32 b2DistanceJoint::GetFrequency() const -{ - return m_frequencyHz; -} - -inline void b2DistanceJoint::SetDampingRatio(float32 ratio) -{ - m_dampingRatio = ratio; -} - -inline float32 b2DistanceJoint::GetDampingRatio() const -{ - return m_dampingRatio; -} - -#endif diff --git a/external/Box2D/Dynamics/Joints/b2FrictionJoint.cpp b/external/Box2D/Dynamics/Joints/b2FrictionJoint.cpp deleted file mode 100644 index 6e6018db10..0000000000 --- a/external/Box2D/Dynamics/Joints/b2FrictionJoint.cpp +++ /dev/null @@ -1,251 +0,0 @@ -/* -* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include - -// Point-to-point constraint -// Cdot = v2 - v1 -// = v2 + cross(w2, r2) - v1 - cross(w1, r1) -// J = [-I -r1_skew I r2_skew ] -// Identity used: -// w k % (rx i + ry j) = w * (-ry i + rx j) - -// Angle constraint -// Cdot = w2 - w1 -// J = [0 0 -1 0 0 1] -// K = invI1 + invI2 - -void b2FrictionJointDef::Initialize(b2Body* bA, b2Body* bB, const b2Vec2& anchor) -{ - bodyA = bA; - bodyB = bB; - localAnchorA = bodyA->GetLocalPoint(anchor); - localAnchorB = bodyB->GetLocalPoint(anchor); -} - -b2FrictionJoint::b2FrictionJoint(const b2FrictionJointDef* def) -: b2Joint(def) -{ - m_localAnchorA = def->localAnchorA; - m_localAnchorB = def->localAnchorB; - - m_linearImpulse.SetZero(); - m_angularImpulse = 0.0f; - - m_maxForce = def->maxForce; - m_maxTorque = def->maxTorque; -} - -void b2FrictionJoint::InitVelocityConstraints(const b2SolverData& data) -{ - m_indexA = m_bodyA->m_islandIndex; - m_indexB = m_bodyB->m_islandIndex; - m_localCenterA = m_bodyA->m_sweep.localCenter; - m_localCenterB = m_bodyB->m_sweep.localCenter; - m_invMassA = m_bodyA->m_invMass; - m_invMassB = m_bodyB->m_invMass; - m_invIA = m_bodyA->m_invI; - m_invIB = m_bodyB->m_invI; - - float32 aA = data.positions[m_indexA].a; - b2Vec2 vA = data.velocities[m_indexA].v; - float32 wA = data.velocities[m_indexA].w; - - float32 aB = data.positions[m_indexB].a; - b2Vec2 vB = data.velocities[m_indexB].v; - float32 wB = data.velocities[m_indexB].w; - - b2Rot qA(aA), qB(aB); - - // Compute the effective mass matrix. - m_rA = b2Mul(qA, m_localAnchorA - m_localCenterA); - m_rB = b2Mul(qB, m_localAnchorB - m_localCenterB); - - // J = [-I -r1_skew I r2_skew] - // [ 0 -1 0 1] - // r_skew = [-ry; rx] - - // Matlab - // K = [ mA+r1y^2*iA+mB+r2y^2*iB, -r1y*iA*r1x-r2y*iB*r2x, -r1y*iA-r2y*iB] - // [ -r1y*iA*r1x-r2y*iB*r2x, mA+r1x^2*iA+mB+r2x^2*iB, r1x*iA+r2x*iB] - // [ -r1y*iA-r2y*iB, r1x*iA+r2x*iB, iA+iB] - - float32 mA = m_invMassA, mB = m_invMassB; - float32 iA = m_invIA, iB = m_invIB; - - b2Mat22 K; - K.ex.x = mA + mB + iA * m_rA.y * m_rA.y + iB * m_rB.y * m_rB.y; - K.ex.y = -iA * m_rA.x * m_rA.y - iB * m_rB.x * m_rB.y; - K.ey.x = K.ex.y; - K.ey.y = mA + mB + iA * m_rA.x * m_rA.x + iB * m_rB.x * m_rB.x; - - m_linearMass = K.GetInverse(); - - m_angularMass = iA + iB; - if (m_angularMass > 0.0f) - { - m_angularMass = 1.0f / m_angularMass; - } - - if (data.step.warmStarting) - { - // Scale impulses to support a variable time step. - m_linearImpulse *= data.step.dtRatio; - m_angularImpulse *= data.step.dtRatio; - - b2Vec2 P(m_linearImpulse.x, m_linearImpulse.y); - vA -= mA * P; - wA -= iA * (b2Cross(m_rA, P) + m_angularImpulse); - vB += mB * P; - wB += iB * (b2Cross(m_rB, P) + m_angularImpulse); - } - else - { - m_linearImpulse.SetZero(); - m_angularImpulse = 0.0f; - } - - data.velocities[m_indexA].v = vA; - data.velocities[m_indexA].w = wA; - data.velocities[m_indexB].v = vB; - data.velocities[m_indexB].w = wB; -} - -void b2FrictionJoint::SolveVelocityConstraints(const b2SolverData& data) -{ - b2Vec2 vA = data.velocities[m_indexA].v; - float32 wA = data.velocities[m_indexA].w; - b2Vec2 vB = data.velocities[m_indexB].v; - float32 wB = data.velocities[m_indexB].w; - - float32 mA = m_invMassA, mB = m_invMassB; - float32 iA = m_invIA, iB = m_invIB; - - float32 h = data.step.dt; - - // Solve angular friction - { - float32 Cdot = wB - wA; - float32 impulse = -m_angularMass * Cdot; - - float32 oldImpulse = m_angularImpulse; - float32 maxImpulse = h * m_maxTorque; - m_angularImpulse = b2Clamp(m_angularImpulse + impulse, -maxImpulse, maxImpulse); - impulse = m_angularImpulse - oldImpulse; - - wA -= iA * impulse; - wB += iB * impulse; - } - - // Solve linear friction - { - b2Vec2 Cdot = vB + b2Cross(wB, m_rB) - vA - b2Cross(wA, m_rA); - - b2Vec2 impulse = -b2Mul(m_linearMass, Cdot); - b2Vec2 oldImpulse = m_linearImpulse; - m_linearImpulse += impulse; - - float32 maxImpulse = h * m_maxForce; - - if (m_linearImpulse.LengthSquared() > maxImpulse * maxImpulse) - { - m_linearImpulse.Normalize(); - m_linearImpulse *= maxImpulse; - } - - impulse = m_linearImpulse - oldImpulse; - - vA -= mA * impulse; - wA -= iA * b2Cross(m_rA, impulse); - - vB += mB * impulse; - wB += iB * b2Cross(m_rB, impulse); - } - - data.velocities[m_indexA].v = vA; - data.velocities[m_indexA].w = wA; - data.velocities[m_indexB].v = vB; - data.velocities[m_indexB].w = wB; -} - -bool b2FrictionJoint::SolvePositionConstraints(const b2SolverData& data) -{ - B2_NOT_USED(data); - - return true; -} - -b2Vec2 b2FrictionJoint::GetAnchorA() const -{ - return m_bodyA->GetWorldPoint(m_localAnchorA); -} - -b2Vec2 b2FrictionJoint::GetAnchorB() const -{ - return m_bodyB->GetWorldPoint(m_localAnchorB); -} - -b2Vec2 b2FrictionJoint::GetReactionForce(float32 inv_dt) const -{ - return inv_dt * m_linearImpulse; -} - -float32 b2FrictionJoint::GetReactionTorque(float32 inv_dt) const -{ - return inv_dt * m_angularImpulse; -} - -void b2FrictionJoint::SetMaxForce(float32 force) -{ - b2Assert(b2IsValid(force) && force >= 0.0f); - m_maxForce = force; -} - -float32 b2FrictionJoint::GetMaxForce() const -{ - return m_maxForce; -} - -void b2FrictionJoint::SetMaxTorque(float32 torque) -{ - b2Assert(b2IsValid(torque) && torque >= 0.0f); - m_maxTorque = torque; -} - -float32 b2FrictionJoint::GetMaxTorque() const -{ - return m_maxTorque; -} - -void b2FrictionJoint::Dump() -{ - int32 indexA = m_bodyA->m_islandIndex; - int32 indexB = m_bodyB->m_islandIndex; - - b2Log(" b2FrictionJointDef jd;\n"); - b2Log(" jd.bodyA = bodies[%d];\n", indexA); - b2Log(" jd.bodyB = bodies[%d];\n", indexB); - b2Log(" jd.collideConnected = bool(%d);\n", m_collideConnected); - b2Log(" jd.localAnchorA.Set(%.15lef, %.15lef);\n", m_localAnchorA.x, m_localAnchorA.y); - b2Log(" jd.localAnchorB.Set(%.15lef, %.15lef);\n", m_localAnchorB.x, m_localAnchorB.y); - b2Log(" jd.maxForce = %.15lef;\n", m_maxForce); - b2Log(" jd.maxTorque = %.15lef;\n", m_maxTorque); - b2Log(" joints[%d] = m_world->CreateJoint(&jd);\n", m_index); -} diff --git a/external/Box2D/Dynamics/Joints/b2FrictionJoint.h b/external/Box2D/Dynamics/Joints/b2FrictionJoint.h deleted file mode 100644 index 3ee40c6298..0000000000 --- a/external/Box2D/Dynamics/Joints/b2FrictionJoint.h +++ /dev/null @@ -1,119 +0,0 @@ -/* -* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_FRICTION_JOINT_H -#define B2_FRICTION_JOINT_H - -#include - -/// Friction joint definition. -struct b2FrictionJointDef : public b2JointDef -{ - b2FrictionJointDef() - { - type = e_frictionJoint; - localAnchorA.SetZero(); - localAnchorB.SetZero(); - maxForce = 0.0f; - maxTorque = 0.0f; - } - - /// Initialize the bodies, anchors, axis, and reference angle using the world - /// anchor and world axis. - void Initialize(b2Body* bodyA, b2Body* bodyB, const b2Vec2& anchor); - - /// The local anchor point relative to bodyA's origin. - b2Vec2 localAnchorA; - - /// The local anchor point relative to bodyB's origin. - b2Vec2 localAnchorB; - - /// The maximum friction force in N. - float32 maxForce; - - /// The maximum friction torque in N-m. - float32 maxTorque; -}; - -/// Friction joint. This is used for top-down friction. -/// It provides 2D translational friction and angular friction. -class b2FrictionJoint : public b2Joint -{ -public: - b2Vec2 GetAnchorA() const; - b2Vec2 GetAnchorB() const; - - b2Vec2 GetReactionForce(float32 inv_dt) const; - float32 GetReactionTorque(float32 inv_dt) const; - - /// The local anchor point relative to bodyA's origin. - const b2Vec2& GetLocalAnchorA() const { return m_localAnchorA; } - - /// The local anchor point relative to bodyB's origin. - const b2Vec2& GetLocalAnchorB() const { return m_localAnchorB; } - - /// Set the maximum friction force in N. - void SetMaxForce(float32 force); - - /// Get the maximum friction force in N. - float32 GetMaxForce() const; - - /// Set the maximum friction torque in N*m. - void SetMaxTorque(float32 torque); - - /// Get the maximum friction torque in N*m. - float32 GetMaxTorque() const; - - /// Dump joint to dmLog - void Dump(); - -protected: - - friend class b2Joint; - - b2FrictionJoint(const b2FrictionJointDef* def); - - void InitVelocityConstraints(const b2SolverData& data); - void SolveVelocityConstraints(const b2SolverData& data); - bool SolvePositionConstraints(const b2SolverData& data); - - b2Vec2 m_localAnchorA; - b2Vec2 m_localAnchorB; - - // Solver shared - b2Vec2 m_linearImpulse; - float32 m_angularImpulse; - float32 m_maxForce; - float32 m_maxTorque; - - // Solver temp - int32 m_indexA; - int32 m_indexB; - b2Vec2 m_rA; - b2Vec2 m_rB; - b2Vec2 m_localCenterA; - b2Vec2 m_localCenterB; - float32 m_invMassA; - float32 m_invMassB; - float32 m_invIA; - float32 m_invIB; - b2Mat22 m_linearMass; - float32 m_angularMass; -}; - -#endif diff --git a/external/Box2D/Dynamics/Joints/b2GearJoint.cpp b/external/Box2D/Dynamics/Joints/b2GearJoint.cpp deleted file mode 100644 index 9741cdd5a4..0000000000 --- a/external/Box2D/Dynamics/Joints/b2GearJoint.cpp +++ /dev/null @@ -1,423 +0,0 @@ -/* -* Copyright (c) 2007-2011 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include -#include -#include - -// Gear Joint: -// C0 = (coordinate1 + ratio * coordinate2)_initial -// C = (coordinate1 + ratio * coordinate2) - C0 = 0 -// J = [J1 ratio * J2] -// K = J * invM * JT -// = J1 * invM1 * J1T + ratio * ratio * J2 * invM2 * J2T -// -// Revolute: -// coordinate = rotation -// Cdot = angularVelocity -// J = [0 0 1] -// K = J * invM * JT = invI -// -// Prismatic: -// coordinate = dot(p - pg, ug) -// Cdot = dot(v + cross(w, r), ug) -// J = [ug cross(r, ug)] -// K = J * invM * JT = invMass + invI * cross(r, ug)^2 - -b2GearJoint::b2GearJoint(const b2GearJointDef* def) -: b2Joint(def) -{ - m_joint1 = def->joint1; - m_joint2 = def->joint2; - - m_typeA = m_joint1->GetType(); - m_typeB = m_joint2->GetType(); - - b2Assert(m_typeA == e_revoluteJoint || m_typeA == e_prismaticJoint); - b2Assert(m_typeB == e_revoluteJoint || m_typeB == e_prismaticJoint); - - float32 coordinateA, coordinateB; - - // TODO_ERIN there might be some problem with the joint edges in b2Joint. - - m_bodyC = m_joint1->GetBodyA(); - m_bodyA = m_joint1->GetBodyB(); - - // Get geometry of joint1 - b2Transform xfA = m_bodyA->m_xf; - float32 aA = m_bodyA->m_sweep.a; - b2Transform xfC = m_bodyC->m_xf; - float32 aC = m_bodyC->m_sweep.a; - - if (m_typeA == e_revoluteJoint) - { - b2RevoluteJoint* revolute = (b2RevoluteJoint*)def->joint1; - m_localAnchorC = revolute->m_localAnchorA; - m_localAnchorA = revolute->m_localAnchorB; - m_referenceAngleA = revolute->m_referenceAngle; - m_localAxisC.SetZero(); - - coordinateA = aA - aC - m_referenceAngleA; - } - else - { - b2PrismaticJoint* prismatic = (b2PrismaticJoint*)def->joint1; - m_localAnchorC = prismatic->m_localAnchorA; - m_localAnchorA = prismatic->m_localAnchorB; - m_referenceAngleA = prismatic->m_referenceAngle; - m_localAxisC = prismatic->m_localXAxisA; - - b2Vec2 pC = m_localAnchorC; - b2Vec2 pA = b2MulT(xfC.q, b2Mul(xfA.q, m_localAnchorA) + (xfA.p - xfC.p)); - coordinateA = b2Dot(pA - pC, m_localAxisC); - } - - m_bodyD = m_joint2->GetBodyA(); - m_bodyB = m_joint2->GetBodyB(); - - // Get geometry of joint2 - b2Transform xfB = m_bodyB->m_xf; - float32 aB = m_bodyB->m_sweep.a; - b2Transform xfD = m_bodyD->m_xf; - float32 aD = m_bodyD->m_sweep.a; - - if (m_typeB == e_revoluteJoint) - { - b2RevoluteJoint* revolute = (b2RevoluteJoint*)def->joint2; - m_localAnchorD = revolute->m_localAnchorA; - m_localAnchorB = revolute->m_localAnchorB; - m_referenceAngleB = revolute->m_referenceAngle; - m_localAxisD.SetZero(); - - coordinateB = aB - aD - m_referenceAngleB; - } - else - { - b2PrismaticJoint* prismatic = (b2PrismaticJoint*)def->joint2; - m_localAnchorD = prismatic->m_localAnchorA; - m_localAnchorB = prismatic->m_localAnchorB; - m_referenceAngleB = prismatic->m_referenceAngle; - m_localAxisD = prismatic->m_localXAxisA; - - b2Vec2 pD = m_localAnchorD; - b2Vec2 pB = b2MulT(xfD.q, b2Mul(xfB.q, m_localAnchorB) + (xfB.p - xfD.p)); - coordinateB = b2Dot(pB - pD, m_localAxisD); - } - - m_ratio = def->ratio; - - m_constant = coordinateA + m_ratio * coordinateB; - - m_impulse = 0.0f; -} - -void b2GearJoint::InitVelocityConstraints(const b2SolverData& data) -{ - m_indexA = m_bodyA->m_islandIndex; - m_indexB = m_bodyB->m_islandIndex; - m_indexC = m_bodyC->m_islandIndex; - m_indexD = m_bodyD->m_islandIndex; - m_lcA = m_bodyA->m_sweep.localCenter; - m_lcB = m_bodyB->m_sweep.localCenter; - m_lcC = m_bodyC->m_sweep.localCenter; - m_lcD = m_bodyD->m_sweep.localCenter; - m_mA = m_bodyA->m_invMass; - m_mB = m_bodyB->m_invMass; - m_mC = m_bodyC->m_invMass; - m_mD = m_bodyD->m_invMass; - m_iA = m_bodyA->m_invI; - m_iB = m_bodyB->m_invI; - m_iC = m_bodyC->m_invI; - m_iD = m_bodyD->m_invI; - - b2Vec2 cA = data.positions[m_indexA].c; - float32 aA = data.positions[m_indexA].a; - b2Vec2 vA = data.velocities[m_indexA].v; - float32 wA = data.velocities[m_indexA].w; - - b2Vec2 cB = data.positions[m_indexB].c; - float32 aB = data.positions[m_indexB].a; - b2Vec2 vB = data.velocities[m_indexB].v; - float32 wB = data.velocities[m_indexB].w; - - b2Vec2 cC = data.positions[m_indexC].c; - float32 aC = data.positions[m_indexC].a; - b2Vec2 vC = data.velocities[m_indexC].v; - float32 wC = data.velocities[m_indexC].w; - - b2Vec2 cD = data.positions[m_indexD].c; - float32 aD = data.positions[m_indexD].a; - b2Vec2 vD = data.velocities[m_indexD].v; - float32 wD = data.velocities[m_indexD].w; - - b2Rot qA(aA), qB(aB), qC(aC), qD(aD); - - m_mass = 0.0f; - - if (m_typeA == e_revoluteJoint) - { - m_JvAC.SetZero(); - m_JwA = 1.0f; - m_JwC = 1.0f; - m_mass += m_iA + m_iC; - } - else - { - b2Vec2 u = b2Mul(qC, m_localAxisC); - b2Vec2 rC = b2Mul(qC, m_localAnchorC - m_lcC); - b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_lcA); - m_JvAC = u; - m_JwC = b2Cross(rC, u); - m_JwA = b2Cross(rA, u); - m_mass += m_mC + m_mA + m_iC * m_JwC * m_JwC + m_iA * m_JwA * m_JwA; - } - - if (m_typeB == e_revoluteJoint) - { - m_JvBD.SetZero(); - m_JwB = m_ratio; - m_JwD = m_ratio; - m_mass += m_ratio * m_ratio * (m_iB + m_iD); - } - else - { - b2Vec2 u = b2Mul(qD, m_localAxisD); - b2Vec2 rD = b2Mul(qD, m_localAnchorD - m_lcD); - b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_lcB); - m_JvBD = m_ratio * u; - m_JwD = m_ratio * b2Cross(rD, u); - m_JwB = m_ratio * b2Cross(rB, u); - m_mass += m_ratio * m_ratio * (m_mD + m_mB) + m_iD * m_JwD * m_JwD + m_iB * m_JwB * m_JwB; - } - - // Compute effective mass. - m_mass = m_mass > 0.0f ? 1.0f / m_mass : 0.0f; - - if (data.step.warmStarting) - { - vA += (m_mA * m_impulse) * m_JvAC; - wA += m_iA * m_impulse * m_JwA; - vB += (m_mB * m_impulse) * m_JvBD; - wB += m_iB * m_impulse * m_JwB; - vC -= (m_mC * m_impulse) * m_JvAC; - wC -= m_iC * m_impulse * m_JwC; - vD -= (m_mD * m_impulse) * m_JvBD; - wD -= m_iD * m_impulse * m_JwD; - } - else - { - m_impulse = 0.0f; - } - - data.velocities[m_indexA].v = vA; - data.velocities[m_indexA].w = wA; - data.velocities[m_indexB].v = vB; - data.velocities[m_indexB].w = wB; - data.velocities[m_indexC].v = vC; - data.velocities[m_indexC].w = wC; - data.velocities[m_indexD].v = vD; - data.velocities[m_indexD].w = wD; -} - -void b2GearJoint::SolveVelocityConstraints(const b2SolverData& data) -{ - b2Vec2 vA = data.velocities[m_indexA].v; - float32 wA = data.velocities[m_indexA].w; - b2Vec2 vB = data.velocities[m_indexB].v; - float32 wB = data.velocities[m_indexB].w; - b2Vec2 vC = data.velocities[m_indexC].v; - float32 wC = data.velocities[m_indexC].w; - b2Vec2 vD = data.velocities[m_indexD].v; - float32 wD = data.velocities[m_indexD].w; - - float32 Cdot = b2Dot(m_JvAC, vA - vC) + b2Dot(m_JvBD, vB - vD); - Cdot += (m_JwA * wA - m_JwC * wC) + (m_JwB * wB - m_JwD * wD); - - float32 impulse = -m_mass * Cdot; - m_impulse += impulse; - - vA += (m_mA * impulse) * m_JvAC; - wA += m_iA * impulse * m_JwA; - vB += (m_mB * impulse) * m_JvBD; - wB += m_iB * impulse * m_JwB; - vC -= (m_mC * impulse) * m_JvAC; - wC -= m_iC * impulse * m_JwC; - vD -= (m_mD * impulse) * m_JvBD; - wD -= m_iD * impulse * m_JwD; - - data.velocities[m_indexA].v = vA; - data.velocities[m_indexA].w = wA; - data.velocities[m_indexB].v = vB; - data.velocities[m_indexB].w = wB; - data.velocities[m_indexC].v = vC; - data.velocities[m_indexC].w = wC; - data.velocities[m_indexD].v = vD; - data.velocities[m_indexD].w = wD; -} - -bool b2GearJoint::SolvePositionConstraints(const b2SolverData& data) -{ - b2Vec2 cA = data.positions[m_indexA].c; - float32 aA = data.positions[m_indexA].a; - b2Vec2 cB = data.positions[m_indexB].c; - float32 aB = data.positions[m_indexB].a; - b2Vec2 cC = data.positions[m_indexC].c; - float32 aC = data.positions[m_indexC].a; - b2Vec2 cD = data.positions[m_indexD].c; - float32 aD = data.positions[m_indexD].a; - - b2Rot qA(aA), qB(aB), qC(aC), qD(aD); - - float32 linearError = 0.0f; - - float32 coordinateA, coordinateB; - - b2Vec2 JvAC, JvBD; - float32 JwA, JwB, JwC, JwD; - float32 mass = 0.0f; - - if (m_typeA == e_revoluteJoint) - { - JvAC.SetZero(); - JwA = 1.0f; - JwC = 1.0f; - mass += m_iA + m_iC; - - coordinateA = aA - aC - m_referenceAngleA; - } - else - { - b2Vec2 u = b2Mul(qC, m_localAxisC); - b2Vec2 rC = b2Mul(qC, m_localAnchorC - m_lcC); - b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_lcA); - JvAC = u; - JwC = b2Cross(rC, u); - JwA = b2Cross(rA, u); - mass += m_mC + m_mA + m_iC * JwC * JwC + m_iA * JwA * JwA; - - b2Vec2 pC = m_localAnchorC - m_lcC; - b2Vec2 pA = b2MulT(qC, rA + (cA - cC)); - coordinateA = b2Dot(pA - pC, m_localAxisC); - } - - if (m_typeB == e_revoluteJoint) - { - JvBD.SetZero(); - JwB = m_ratio; - JwD = m_ratio; - mass += m_ratio * m_ratio * (m_iB + m_iD); - - coordinateB = aB - aD - m_referenceAngleB; - } - else - { - b2Vec2 u = b2Mul(qD, m_localAxisD); - b2Vec2 rD = b2Mul(qD, m_localAnchorD - m_lcD); - b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_lcB); - JvBD = m_ratio * u; - JwD = m_ratio * b2Cross(rD, u); - JwB = m_ratio * b2Cross(rB, u); - mass += m_ratio * m_ratio * (m_mD + m_mB) + m_iD * JwD * JwD + m_iB * JwB * JwB; - - b2Vec2 pD = m_localAnchorD - m_lcD; - b2Vec2 pB = b2MulT(qD, rB + (cB - cD)); - coordinateB = b2Dot(pB - pD, m_localAxisD); - } - - float32 C = (coordinateA + m_ratio * coordinateB) - m_constant; - - float32 impulse = 0.0f; - if (mass > 0.0f) - { - impulse = -C / mass; - } - - cA += m_mA * impulse * JvAC; - aA += m_iA * impulse * JwA; - cB += m_mB * impulse * JvBD; - aB += m_iB * impulse * JwB; - cC -= m_mC * impulse * JvAC; - aC -= m_iC * impulse * JwC; - cD -= m_mD * impulse * JvBD; - aD -= m_iD * impulse * JwD; - - data.positions[m_indexA].c = cA; - data.positions[m_indexA].a = aA; - data.positions[m_indexB].c = cB; - data.positions[m_indexB].a = aB; - data.positions[m_indexC].c = cC; - data.positions[m_indexC].a = aC; - data.positions[m_indexD].c = cD; - data.positions[m_indexD].a = aD; - - // TODO_ERIN not implemented - return linearError < b2_linearSlop; -} - -b2Vec2 b2GearJoint::GetAnchorA() const -{ - return m_bodyA->GetWorldPoint(m_localAnchorA); -} - -b2Vec2 b2GearJoint::GetAnchorB() const -{ - return m_bodyB->GetWorldPoint(m_localAnchorB); -} - -b2Vec2 b2GearJoint::GetReactionForce(float32 inv_dt) const -{ - b2Vec2 P = m_impulse * m_JvAC; - return inv_dt * P; -} - -float32 b2GearJoint::GetReactionTorque(float32 inv_dt) const -{ - float32 L = m_impulse * m_JwA; - return inv_dt * L; -} - -void b2GearJoint::SetRatio(float32 ratio) -{ - b2Assert(b2IsValid(ratio)); - m_ratio = ratio; -} - -float32 b2GearJoint::GetRatio() const -{ - return m_ratio; -} - -void b2GearJoint::Dump() -{ - int32 indexA = m_bodyA->m_islandIndex; - int32 indexB = m_bodyB->m_islandIndex; - - int32 index1 = m_joint1->m_index; - int32 index2 = m_joint2->m_index; - - b2Log(" b2GearJointDef jd;\n"); - b2Log(" jd.bodyA = bodies[%d];\n", indexA); - b2Log(" jd.bodyB = bodies[%d];\n", indexB); - b2Log(" jd.collideConnected = bool(%d);\n", m_collideConnected); - b2Log(" jd.joint1 = joints[%d];\n", index1); - b2Log(" jd.joint2 = joints[%d];\n", index2); - b2Log(" jd.ratio = %.15lef;\n", m_ratio); - b2Log(" joints[%d] = m_world->CreateJoint(&jd);\n", m_index); -} diff --git a/external/Box2D/Dynamics/Joints/b2GearJoint.h b/external/Box2D/Dynamics/Joints/b2GearJoint.h deleted file mode 100644 index f926bf6ef1..0000000000 --- a/external/Box2D/Dynamics/Joints/b2GearJoint.h +++ /dev/null @@ -1,125 +0,0 @@ -/* -* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_GEAR_JOINT_H -#define B2_GEAR_JOINT_H - -#include - -/// Gear joint definition. This definition requires two existing -/// revolute or prismatic joints (any combination will work). -struct b2GearJointDef : public b2JointDef -{ - b2GearJointDef() - { - type = e_gearJoint; - joint1 = NULL; - joint2 = NULL; - ratio = 1.0f; - } - - /// The first revolute/prismatic joint attached to the gear joint. - b2Joint* joint1; - - /// The second revolute/prismatic joint attached to the gear joint. - b2Joint* joint2; - - /// The gear ratio. - /// @see b2GearJoint for explanation. - float32 ratio; -}; - -/// A gear joint is used to connect two joints together. Either joint -/// can be a revolute or prismatic joint. You specify a gear ratio -/// to bind the motions together: -/// coordinate1 + ratio * coordinate2 = constant -/// The ratio can be negative or positive. If one joint is a revolute joint -/// and the other joint is a prismatic joint, then the ratio will have units -/// of length or units of 1/length. -/// @warning You have to manually destroy the gear joint if joint1 or joint2 -/// is destroyed. -class b2GearJoint : public b2Joint -{ -public: - b2Vec2 GetAnchorA() const; - b2Vec2 GetAnchorB() const; - - b2Vec2 GetReactionForce(float32 inv_dt) const; - float32 GetReactionTorque(float32 inv_dt) const; - - /// Get the first joint. - b2Joint* GetJoint1() { return m_joint1; } - - /// Get the second joint. - b2Joint* GetJoint2() { return m_joint2; } - - /// Set/Get the gear ratio. - void SetRatio(float32 ratio); - float32 GetRatio() const; - - /// Dump joint to dmLog - void Dump(); - -protected: - - friend class b2Joint; - b2GearJoint(const b2GearJointDef* data); - - void InitVelocityConstraints(const b2SolverData& data); - void SolveVelocityConstraints(const b2SolverData& data); - bool SolvePositionConstraints(const b2SolverData& data); - - b2Joint* m_joint1; - b2Joint* m_joint2; - - b2JointType m_typeA; - b2JointType m_typeB; - - // Body A is connected to body C - // Body B is connected to body D - b2Body* m_bodyC; - b2Body* m_bodyD; - - // Solver shared - b2Vec2 m_localAnchorA; - b2Vec2 m_localAnchorB; - b2Vec2 m_localAnchorC; - b2Vec2 m_localAnchorD; - - b2Vec2 m_localAxisC; - b2Vec2 m_localAxisD; - - float32 m_referenceAngleA; - float32 m_referenceAngleB; - - float32 m_constant; - float32 m_ratio; - - float32 m_impulse; - - // Solver temp - int32 m_indexA, m_indexB, m_indexC, m_indexD; - b2Vec2 m_lcA, m_lcB, m_lcC, m_lcD; - float32 m_mA, m_mB, m_mC, m_mD; - float32 m_iA, m_iB, m_iC, m_iD; - b2Vec2 m_JvAC, m_JvBD; - float32 m_JwA, m_JwB, m_JwC, m_JwD; - float32 m_mass; -}; - -#endif diff --git a/external/Box2D/Dynamics/Joints/b2Joint.cpp b/external/Box2D/Dynamics/Joints/b2Joint.cpp deleted file mode 100644 index 6853b09f0b..0000000000 --- a/external/Box2D/Dynamics/Joints/b2Joint.cpp +++ /dev/null @@ -1,199 +0,0 @@ -/* -* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -b2Joint* b2Joint::Create(const b2JointDef* def, b2BlockAllocator* allocator) -{ - b2Joint* joint = NULL; - - switch (def->type) - { - case e_distanceJoint: - { - void* mem = allocator->Allocate(sizeof(b2DistanceJoint)); - joint = new (mem) b2DistanceJoint((b2DistanceJointDef*)def); - } - break; - - case e_mouseJoint: - { - void* mem = allocator->Allocate(sizeof(b2MouseJoint)); - joint = new (mem) b2MouseJoint((b2MouseJointDef*)def); - } - break; - - case e_prismaticJoint: - { - void* mem = allocator->Allocate(sizeof(b2PrismaticJoint)); - joint = new (mem) b2PrismaticJoint((b2PrismaticJointDef*)def); - } - break; - - case e_revoluteJoint: - { - void* mem = allocator->Allocate(sizeof(b2RevoluteJoint)); - joint = new (mem) b2RevoluteJoint((b2RevoluteJointDef*)def); - } - break; - - case e_pulleyJoint: - { - void* mem = allocator->Allocate(sizeof(b2PulleyJoint)); - joint = new (mem) b2PulleyJoint((b2PulleyJointDef*)def); - } - break; - - case e_gearJoint: - { - void* mem = allocator->Allocate(sizeof(b2GearJoint)); - joint = new (mem) b2GearJoint((b2GearJointDef*)def); - } - break; - - case e_wheelJoint: - { - void* mem = allocator->Allocate(sizeof(b2WheelJoint)); - joint = new (mem) b2WheelJoint((b2WheelJointDef*)def); - } - break; - - case e_weldJoint: - { - void* mem = allocator->Allocate(sizeof(b2WeldJoint)); - joint = new (mem) b2WeldJoint((b2WeldJointDef*)def); - } - break; - - case e_frictionJoint: - { - void* mem = allocator->Allocate(sizeof(b2FrictionJoint)); - joint = new (mem) b2FrictionJoint((b2FrictionJointDef*)def); - } - break; - - case e_ropeJoint: - { - void* mem = allocator->Allocate(sizeof(b2RopeJoint)); - joint = new (mem) b2RopeJoint((b2RopeJointDef*)def); - } - break; - - default: - b2Assert(false); - break; - } - - return joint; -} - -void b2Joint::Destroy(b2Joint* joint, b2BlockAllocator* allocator) -{ - joint->~b2Joint(); - switch (joint->m_type) - { - case e_distanceJoint: - allocator->Free(joint, sizeof(b2DistanceJoint)); - break; - - case e_mouseJoint: - allocator->Free(joint, sizeof(b2MouseJoint)); - break; - - case e_prismaticJoint: - allocator->Free(joint, sizeof(b2PrismaticJoint)); - break; - - case e_revoluteJoint: - allocator->Free(joint, sizeof(b2RevoluteJoint)); - break; - - case e_pulleyJoint: - allocator->Free(joint, sizeof(b2PulleyJoint)); - break; - - case e_gearJoint: - allocator->Free(joint, sizeof(b2GearJoint)); - break; - - case e_wheelJoint: - allocator->Free(joint, sizeof(b2WheelJoint)); - break; - - case e_weldJoint: - allocator->Free(joint, sizeof(b2WeldJoint)); - break; - - case e_frictionJoint: - allocator->Free(joint, sizeof(b2FrictionJoint)); - break; - - case e_ropeJoint: - allocator->Free(joint, sizeof(b2RopeJoint)); - break; - - default: - b2Assert(false); - break; - } -} - -b2Joint::b2Joint(const b2JointDef* def) -{ - b2Assert(def->bodyA != def->bodyB); - - m_type = def->type; - m_prev = NULL; - m_next = NULL; - m_bodyA = def->bodyA; - m_bodyB = def->bodyB; - m_index = 0; - m_collideConnected = def->collideConnected; - m_islandFlag = false; - m_userData = def->userData; - - m_edgeA.joint = NULL; - m_edgeA.other = NULL; - m_edgeA.prev = NULL; - m_edgeA.next = NULL; - - m_edgeB.joint = NULL; - m_edgeB.other = NULL; - m_edgeB.prev = NULL; - m_edgeB.next = NULL; -} - -bool b2Joint::IsActive() const -{ - return m_bodyA->IsActive() && m_bodyB->IsActive(); -} diff --git a/external/Box2D/Dynamics/Joints/b2Joint.h b/external/Box2D/Dynamics/Joints/b2Joint.h deleted file mode 100644 index b4ea576665..0000000000 --- a/external/Box2D/Dynamics/Joints/b2Joint.h +++ /dev/null @@ -1,222 +0,0 @@ -/* -* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_JOINT_H -#define B2_JOINT_H - -#include - -class b2Body; -class b2Joint; -struct b2SolverData; -class b2BlockAllocator; - -enum b2JointType -{ - e_unknownJoint, - e_revoluteJoint, - e_prismaticJoint, - e_distanceJoint, - e_pulleyJoint, - e_mouseJoint, - e_gearJoint, - e_wheelJoint, - e_weldJoint, - e_frictionJoint, - e_ropeJoint -}; - -enum b2LimitState -{ - e_inactiveLimit, - e_atLowerLimit, - e_atUpperLimit, - e_equalLimits -}; - -struct b2Jacobian -{ - b2Vec2 linear; - float32 angularA; - float32 angularB; -}; - -/// A joint edge is used to connect bodies and joints together -/// in a joint graph where each body is a node and each joint -/// is an edge. A joint edge belongs to a doubly linked list -/// maintained in each attached body. Each joint has two joint -/// nodes, one for each attached body. -struct b2JointEdge -{ - b2Body* other; ///< provides quick access to the other body attached. - b2Joint* joint; ///< the joint - b2JointEdge* prev; ///< the previous joint edge in the body's joint list - b2JointEdge* next; ///< the next joint edge in the body's joint list -}; - -/// Joint definitions are used to construct joints. -struct b2JointDef -{ - b2JointDef() - { - type = e_unknownJoint; - userData = NULL; - bodyA = NULL; - bodyB = NULL; - collideConnected = false; - } - - /// The joint type is set automatically for concrete joint types. - b2JointType type; - - /// Use this to attach application specific data to your joints. - void* userData; - - /// The first attached body. - b2Body* bodyA; - - /// The second attached body. - b2Body* bodyB; - - /// Set this flag to true if the attached bodies should collide. - bool collideConnected; -}; - -/// The base joint class. Joints are used to constraint two bodies together in -/// various fashions. Some joints also feature limits and motors. -class b2Joint -{ -public: - - /// Get the type of the concrete joint. - b2JointType GetType() const; - - /// Get the first body attached to this joint. - b2Body* GetBodyA(); - - /// Get the second body attached to this joint. - b2Body* GetBodyB(); - - /// Get the anchor point on bodyA in world coordinates. - virtual b2Vec2 GetAnchorA() const = 0; - - /// Get the anchor point on bodyB in world coordinates. - virtual b2Vec2 GetAnchorB() const = 0; - - /// Get the reaction force on bodyB at the joint anchor in Newtons. - virtual b2Vec2 GetReactionForce(float32 inv_dt) const = 0; - - /// Get the reaction torque on bodyB in N*m. - virtual float32 GetReactionTorque(float32 inv_dt) const = 0; - - /// Get the next joint the world joint list. - b2Joint* GetNext(); - const b2Joint* GetNext() const; - - /// Get the user data pointer. - void* GetUserData() const; - - /// Set the user data pointer. - void SetUserData(void* data); - - /// Short-cut function to determine if either body is inactive. - bool IsActive() const; - - /// Get collide connected. - /// Note: modifying the collide connect flag won't work correctly because - /// the flag is only checked when fixture AABBs begin to overlap. - bool GetCollideConnected() const; - - /// Dump this joint to the log file. - virtual void Dump() { b2Log("// Dump is not supported for this joint type.\n"); } - -protected: - friend class b2World; - friend class b2Body; - friend class b2Island; - friend class b2GearJoint; - - static b2Joint* Create(const b2JointDef* def, b2BlockAllocator* allocator); - static void Destroy(b2Joint* joint, b2BlockAllocator* allocator); - - b2Joint(const b2JointDef* def); - virtual ~b2Joint() {} - - virtual void InitVelocityConstraints(const b2SolverData& data) = 0; - virtual void SolveVelocityConstraints(const b2SolverData& data) = 0; - - // This returns true if the position errors are within tolerance. - virtual bool SolvePositionConstraints(const b2SolverData& data) = 0; - - b2JointType m_type; - b2Joint* m_prev; - b2Joint* m_next; - b2JointEdge m_edgeA; - b2JointEdge m_edgeB; - b2Body* m_bodyA; - b2Body* m_bodyB; - - int32 m_index; - - bool m_islandFlag; - bool m_collideConnected; - - void* m_userData; -}; - -inline b2JointType b2Joint::GetType() const -{ - return m_type; -} - -inline b2Body* b2Joint::GetBodyA() -{ - return m_bodyA; -} - -inline b2Body* b2Joint::GetBodyB() -{ - return m_bodyB; -} - -inline b2Joint* b2Joint::GetNext() -{ - return m_next; -} - -inline const b2Joint* b2Joint::GetNext() const -{ - return m_next; -} - -inline void* b2Joint::GetUserData() const -{ - return m_userData; -} - -inline void b2Joint::SetUserData(void* data) -{ - m_userData = data; -} - -inline bool b2Joint::GetCollideConnected() const -{ - return m_collideConnected; -} - -#endif diff --git a/external/Box2D/Dynamics/Joints/b2MouseJoint.cpp b/external/Box2D/Dynamics/Joints/b2MouseJoint.cpp deleted file mode 100644 index 237d9d519a..0000000000 --- a/external/Box2D/Dynamics/Joints/b2MouseJoint.cpp +++ /dev/null @@ -1,217 +0,0 @@ -/* -* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include - -// p = attached point, m = mouse point -// C = p - m -// Cdot = v -// = v + cross(w, r) -// J = [I r_skew] -// Identity used: -// w k % (rx i + ry j) = w * (-ry i + rx j) - -b2MouseJoint::b2MouseJoint(const b2MouseJointDef* def) -: b2Joint(def) -{ - b2Assert(def->target.IsValid()); - b2Assert(b2IsValid(def->maxForce) && def->maxForce >= 0.0f); - b2Assert(b2IsValid(def->frequencyHz) && def->frequencyHz >= 0.0f); - b2Assert(b2IsValid(def->dampingRatio) && def->dampingRatio >= 0.0f); - - m_targetA = def->target; - m_localAnchorB = b2MulT(m_bodyB->GetTransform(), m_targetA); - - m_maxForce = def->maxForce; - m_impulse.SetZero(); - - m_frequencyHz = def->frequencyHz; - m_dampingRatio = def->dampingRatio; - - m_beta = 0.0f; - m_gamma = 0.0f; -} - -void b2MouseJoint::SetTarget(const b2Vec2& target) -{ - if (m_bodyB->IsAwake() == false) - { - m_bodyB->SetAwake(true); - } - m_targetA = target; -} - -const b2Vec2& b2MouseJoint::GetTarget() const -{ - return m_targetA; -} - -void b2MouseJoint::SetMaxForce(float32 force) -{ - m_maxForce = force; -} - -float32 b2MouseJoint::GetMaxForce() const -{ - return m_maxForce; -} - -void b2MouseJoint::SetFrequency(float32 hz) -{ - m_frequencyHz = hz; -} - -float32 b2MouseJoint::GetFrequency() const -{ - return m_frequencyHz; -} - -void b2MouseJoint::SetDampingRatio(float32 ratio) -{ - m_dampingRatio = ratio; -} - -float32 b2MouseJoint::GetDampingRatio() const -{ - return m_dampingRatio; -} - -void b2MouseJoint::InitVelocityConstraints(const b2SolverData& data) -{ - m_indexB = m_bodyB->m_islandIndex; - m_localCenterB = m_bodyB->m_sweep.localCenter; - m_invMassB = m_bodyB->m_invMass; - m_invIB = m_bodyB->m_invI; - - b2Vec2 cB = data.positions[m_indexB].c; - float32 aB = data.positions[m_indexB].a; - b2Vec2 vB = data.velocities[m_indexB].v; - float32 wB = data.velocities[m_indexB].w; - - b2Rot qB(aB); - - float32 mass = m_bodyB->GetMass(); - - // Frequency - float32 omega = 2.0f * b2_pi * m_frequencyHz; - - // Damping coefficient - float32 d = 2.0f * mass * m_dampingRatio * omega; - - // Spring stiffness - float32 k = mass * (omega * omega); - - // magic formulas - // gamma has units of inverse mass. - // beta has units of inverse time. - float32 h = data.step.dt; - b2Assert(d + h * k > b2_epsilon); - m_gamma = h * (d + h * k); - if (m_gamma != 0.0f) - { - m_gamma = 1.0f / m_gamma; - } - m_beta = h * k * m_gamma; - - // Compute the effective mass matrix. - m_rB = b2Mul(qB, m_localAnchorB - m_localCenterB); - - // K = [(1/m1 + 1/m2) * eye(2) - skew(r1) * invI1 * skew(r1) - skew(r2) * invI2 * skew(r2)] - // = [1/m1+1/m2 0 ] + invI1 * [r1.y*r1.y -r1.x*r1.y] + invI2 * [r1.y*r1.y -r1.x*r1.y] - // [ 0 1/m1+1/m2] [-r1.x*r1.y r1.x*r1.x] [-r1.x*r1.y r1.x*r1.x] - b2Mat22 K; - K.ex.x = m_invMassB + m_invIB * m_rB.y * m_rB.y + m_gamma; - K.ex.y = -m_invIB * m_rB.x * m_rB.y; - K.ey.x = K.ex.y; - K.ey.y = m_invMassB + m_invIB * m_rB.x * m_rB.x + m_gamma; - - m_mass = K.GetInverse(); - - m_C = cB + m_rB - m_targetA; - m_C *= m_beta; - - // Cheat with some damping - wB *= 0.98f; - - if (data.step.warmStarting) - { - m_impulse *= data.step.dtRatio; - vB += m_invMassB * m_impulse; - wB += m_invIB * b2Cross(m_rB, m_impulse); - } - else - { - m_impulse.SetZero(); - } - - data.velocities[m_indexB].v = vB; - data.velocities[m_indexB].w = wB; -} - -void b2MouseJoint::SolveVelocityConstraints(const b2SolverData& data) -{ - b2Vec2 vB = data.velocities[m_indexB].v; - float32 wB = data.velocities[m_indexB].w; - - // Cdot = v + cross(w, r) - b2Vec2 Cdot = vB + b2Cross(wB, m_rB); - b2Vec2 impulse = b2Mul(m_mass, -(Cdot + m_C + m_gamma * m_impulse)); - - b2Vec2 oldImpulse = m_impulse; - m_impulse += impulse; - float32 maxImpulse = data.step.dt * m_maxForce; - if (m_impulse.LengthSquared() > maxImpulse * maxImpulse) - { - m_impulse *= maxImpulse / m_impulse.Length(); - } - impulse = m_impulse - oldImpulse; - - vB += m_invMassB * impulse; - wB += m_invIB * b2Cross(m_rB, impulse); - - data.velocities[m_indexB].v = vB; - data.velocities[m_indexB].w = wB; -} - -bool b2MouseJoint::SolvePositionConstraints(const b2SolverData& data) -{ - B2_NOT_USED(data); - return true; -} - -b2Vec2 b2MouseJoint::GetAnchorA() const -{ - return m_targetA; -} - -b2Vec2 b2MouseJoint::GetAnchorB() const -{ - return m_bodyB->GetWorldPoint(m_localAnchorB); -} - -b2Vec2 b2MouseJoint::GetReactionForce(float32 inv_dt) const -{ - return inv_dt * m_impulse; -} - -float32 b2MouseJoint::GetReactionTorque(float32 inv_dt) const -{ - return inv_dt * 0.0f; -} diff --git a/external/Box2D/Dynamics/Joints/b2MouseJoint.h b/external/Box2D/Dynamics/Joints/b2MouseJoint.h deleted file mode 100644 index 1bbc194f4c..0000000000 --- a/external/Box2D/Dynamics/Joints/b2MouseJoint.h +++ /dev/null @@ -1,126 +0,0 @@ -/* -* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_MOUSE_JOINT_H -#define B2_MOUSE_JOINT_H - -#include - -/// Mouse joint definition. This requires a world target point, -/// tuning parameters, and the time step. -struct b2MouseJointDef : public b2JointDef -{ - b2MouseJointDef() - { - type = e_mouseJoint; - target.Set(0.0f, 0.0f); - maxForce = 0.0f; - frequencyHz = 5.0f; - dampingRatio = 0.7f; - } - - /// The initial world target point. This is assumed - /// to coincide with the body anchor initially. - b2Vec2 target; - - /// The maximum constraint force that can be exerted - /// to move the candidate body. Usually you will express - /// as some multiple of the weight (multiplier * mass * gravity). - float32 maxForce; - - /// The response speed. - float32 frequencyHz; - - /// The damping ratio. 0 = no damping, 1 = critical damping. - float32 dampingRatio; -}; - -/// A mouse joint is used to make a point on a body track a -/// specified world point. This a soft constraint with a maximum -/// force. This allows the constraint to stretch and without -/// applying huge forces. -/// NOTE: this joint is not documented in the manual because it was -/// developed to be used in the testbed. If you want to learn how to -/// use the mouse joint, look at the testbed. -class b2MouseJoint : public b2Joint -{ -public: - - /// Implements b2Joint. - b2Vec2 GetAnchorA() const; - - /// Implements b2Joint. - b2Vec2 GetAnchorB() const; - - /// Implements b2Joint. - b2Vec2 GetReactionForce(float32 inv_dt) const; - - /// Implements b2Joint. - float32 GetReactionTorque(float32 inv_dt) const; - - /// Use this to update the target point. - void SetTarget(const b2Vec2& target); - const b2Vec2& GetTarget() const; - - /// Set/get the maximum force in Newtons. - void SetMaxForce(float32 force); - float32 GetMaxForce() const; - - /// Set/get the frequency in Hertz. - void SetFrequency(float32 hz); - float32 GetFrequency() const; - - /// Set/get the damping ratio (dimensionless). - void SetDampingRatio(float32 ratio); - float32 GetDampingRatio() const; - - /// The mouse joint does not support dumping. - void Dump() { b2Log("Mouse joint dumping is not supported.\n"); } - -protected: - friend class b2Joint; - - b2MouseJoint(const b2MouseJointDef* def); - - void InitVelocityConstraints(const b2SolverData& data); - void SolveVelocityConstraints(const b2SolverData& data); - bool SolvePositionConstraints(const b2SolverData& data); - - b2Vec2 m_localAnchorB; - b2Vec2 m_targetA; - float32 m_frequencyHz; - float32 m_dampingRatio; - float32 m_beta; - - // Solver shared - b2Vec2 m_impulse; - float32 m_maxForce; - float32 m_gamma; - - // Solver temp - int32 m_indexA; - int32 m_indexB; - b2Vec2 m_rB; - b2Vec2 m_localCenterB; - float32 m_invMassB; - float32 m_invIB; - b2Mat22 m_mass; - b2Vec2 m_C; -}; - -#endif diff --git a/external/Box2D/Dynamics/Joints/b2PrismaticJoint.cpp b/external/Box2D/Dynamics/Joints/b2PrismaticJoint.cpp deleted file mode 100644 index 4849f729f5..0000000000 --- a/external/Box2D/Dynamics/Joints/b2PrismaticJoint.cpp +++ /dev/null @@ -1,637 +0,0 @@ -/* -* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include - -// Linear constraint (point-to-line) -// d = p2 - p1 = x2 + r2 - x1 - r1 -// C = dot(perp, d) -// Cdot = dot(d, cross(w1, perp)) + dot(perp, v2 + cross(w2, r2) - v1 - cross(w1, r1)) -// = -dot(perp, v1) - dot(cross(d + r1, perp), w1) + dot(perp, v2) + dot(cross(r2, perp), v2) -// J = [-perp, -cross(d + r1, perp), perp, cross(r2,perp)] -// -// Angular constraint -// C = a2 - a1 + a_initial -// Cdot = w2 - w1 -// J = [0 0 -1 0 0 1] -// -// K = J * invM * JT -// -// J = [-a -s1 a s2] -// [0 -1 0 1] -// a = perp -// s1 = cross(d + r1, a) = cross(p2 - x1, a) -// s2 = cross(r2, a) = cross(p2 - x2, a) - - -// Motor/Limit linear constraint -// C = dot(ax1, d) -// Cdot = = -dot(ax1, v1) - dot(cross(d + r1, ax1), w1) + dot(ax1, v2) + dot(cross(r2, ax1), v2) -// J = [-ax1 -cross(d+r1,ax1) ax1 cross(r2,ax1)] - -// Block Solver -// We develop a block solver that includes the joint limit. This makes the limit stiff (inelastic) even -// when the mass has poor distribution (leading to large torques about the joint anchor points). -// -// The Jacobian has 3 rows: -// J = [-uT -s1 uT s2] // linear -// [0 -1 0 1] // angular -// [-vT -a1 vT a2] // limit -// -// u = perp -// v = axis -// s1 = cross(d + r1, u), s2 = cross(r2, u) -// a1 = cross(d + r1, v), a2 = cross(r2, v) - -// M * (v2 - v1) = JT * df -// J * v2 = bias -// -// v2 = v1 + invM * JT * df -// J * (v1 + invM * JT * df) = bias -// K * df = bias - J * v1 = -Cdot -// K = J * invM * JT -// Cdot = J * v1 - bias -// -// Now solve for f2. -// df = f2 - f1 -// K * (f2 - f1) = -Cdot -// f2 = invK * (-Cdot) + f1 -// -// Clamp accumulated limit impulse. -// lower: f2(3) = max(f2(3), 0) -// upper: f2(3) = min(f2(3), 0) -// -// Solve for correct f2(1:2) -// K(1:2, 1:2) * f2(1:2) = -Cdot(1:2) - K(1:2,3) * f2(3) + K(1:2,1:3) * f1 -// = -Cdot(1:2) - K(1:2,3) * f2(3) + K(1:2,1:2) * f1(1:2) + K(1:2,3) * f1(3) -// K(1:2, 1:2) * f2(1:2) = -Cdot(1:2) - K(1:2,3) * (f2(3) - f1(3)) + K(1:2,1:2) * f1(1:2) -// f2(1:2) = invK(1:2,1:2) * (-Cdot(1:2) - K(1:2,3) * (f2(3) - f1(3))) + f1(1:2) -// -// Now compute impulse to be applied: -// df = f2 - f1 - -void b2PrismaticJointDef::Initialize(b2Body* bA, b2Body* bB, const b2Vec2& anchor, const b2Vec2& axis) -{ - bodyA = bA; - bodyB = bB; - localAnchorA = bodyA->GetLocalPoint(anchor); - localAnchorB = bodyB->GetLocalPoint(anchor); - localAxisA = bodyA->GetLocalVector(axis); - referenceAngle = bodyB->GetAngle() - bodyA->GetAngle(); -} - -b2PrismaticJoint::b2PrismaticJoint(const b2PrismaticJointDef* def) -: b2Joint(def) -{ - m_localAnchorA = def->localAnchorA; - m_localAnchorB = def->localAnchorB; - m_localXAxisA = def->localAxisA; - m_localXAxisA.Normalize(); - m_localYAxisA = b2Cross(1.0f, m_localXAxisA); - m_referenceAngle = def->referenceAngle; - - m_impulse.SetZero(); - m_motorMass = 0.0; - m_motorImpulse = 0.0f; - - m_lowerTranslation = def->lowerTranslation; - m_upperTranslation = def->upperTranslation; - m_maxMotorForce = def->maxMotorForce; - m_motorSpeed = def->motorSpeed; - m_enableLimit = def->enableLimit; - m_enableMotor = def->enableMotor; - m_limitState = e_inactiveLimit; - - m_axis.SetZero(); - m_perp.SetZero(); -} - -void b2PrismaticJoint::InitVelocityConstraints(const b2SolverData& data) -{ - m_indexA = m_bodyA->m_islandIndex; - m_indexB = m_bodyB->m_islandIndex; - m_localCenterA = m_bodyA->m_sweep.localCenter; - m_localCenterB = m_bodyB->m_sweep.localCenter; - m_invMassA = m_bodyA->m_invMass; - m_invMassB = m_bodyB->m_invMass; - m_invIA = m_bodyA->m_invI; - m_invIB = m_bodyB->m_invI; - - b2Vec2 cA = data.positions[m_indexA].c; - float32 aA = data.positions[m_indexA].a; - b2Vec2 vA = data.velocities[m_indexA].v; - float32 wA = data.velocities[m_indexA].w; - - b2Vec2 cB = data.positions[m_indexB].c; - float32 aB = data.positions[m_indexB].a; - b2Vec2 vB = data.velocities[m_indexB].v; - float32 wB = data.velocities[m_indexB].w; - - b2Rot qA(aA), qB(aB); - - // Compute the effective masses. - b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA); - b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB); - b2Vec2 d = (cB - cA) + rB - rA; - - float32 mA = m_invMassA, mB = m_invMassB; - float32 iA = m_invIA, iB = m_invIB; - - // Compute motor Jacobian and effective mass. - { - m_axis = b2Mul(qA, m_localXAxisA); - m_a1 = b2Cross(d + rA, m_axis); - m_a2 = b2Cross(rB, m_axis); - - m_motorMass = mA + mB + iA * m_a1 * m_a1 + iB * m_a2 * m_a2; - if (m_motorMass > 0.0f) - { - m_motorMass = 1.0f / m_motorMass; - } - } - - // Prismatic constraint. - { - m_perp = b2Mul(qA, m_localYAxisA); - - m_s1 = b2Cross(d + rA, m_perp); - m_s2 = b2Cross(rB, m_perp); - - float32 k11 = mA + mB + iA * m_s1 * m_s1 + iB * m_s2 * m_s2; - float32 k12 = iA * m_s1 + iB * m_s2; - float32 k13 = iA * m_s1 * m_a1 + iB * m_s2 * m_a2; - float32 k22 = iA + iB; - if (k22 == 0.0f) - { - // For bodies with fixed rotation. - k22 = 1.0f; - } - float32 k23 = iA * m_a1 + iB * m_a2; - float32 k33 = mA + mB + iA * m_a1 * m_a1 + iB * m_a2 * m_a2; - - m_K.ex.Set(k11, k12, k13); - m_K.ey.Set(k12, k22, k23); - m_K.ez.Set(k13, k23, k33); - } - - // Compute motor and limit terms. - if (m_enableLimit) - { - float32 jointTranslation = b2Dot(m_axis, d); - if (b2Abs(m_upperTranslation - m_lowerTranslation) < 2.0f * b2_linearSlop) - { - m_limitState = e_equalLimits; - } - else if (jointTranslation <= m_lowerTranslation) - { - if (m_limitState != e_atLowerLimit) - { - m_limitState = e_atLowerLimit; - m_impulse.z = 0.0f; - } - } - else if (jointTranslation >= m_upperTranslation) - { - if (m_limitState != e_atUpperLimit) - { - m_limitState = e_atUpperLimit; - m_impulse.z = 0.0f; - } - } - else - { - m_limitState = e_inactiveLimit; - m_impulse.z = 0.0f; - } - } - else - { - m_limitState = e_inactiveLimit; - m_impulse.z = 0.0f; - } - - if (m_enableMotor == false) - { - m_motorImpulse = 0.0f; - } - - if (data.step.warmStarting) - { - // Account for variable time step. - m_impulse *= data.step.dtRatio; - m_motorImpulse *= data.step.dtRatio; - - b2Vec2 P = m_impulse.x * m_perp + (m_motorImpulse + m_impulse.z) * m_axis; - float32 LA = m_impulse.x * m_s1 + m_impulse.y + (m_motorImpulse + m_impulse.z) * m_a1; - float32 LB = m_impulse.x * m_s2 + m_impulse.y + (m_motorImpulse + m_impulse.z) * m_a2; - - vA -= mA * P; - wA -= iA * LA; - - vB += mB * P; - wB += iB * LB; - } - else - { - m_impulse.SetZero(); - m_motorImpulse = 0.0f; - } - - data.velocities[m_indexA].v = vA; - data.velocities[m_indexA].w = wA; - data.velocities[m_indexB].v = vB; - data.velocities[m_indexB].w = wB; -} - -void b2PrismaticJoint::SolveVelocityConstraints(const b2SolverData& data) -{ - b2Vec2 vA = data.velocities[m_indexA].v; - float32 wA = data.velocities[m_indexA].w; - b2Vec2 vB = data.velocities[m_indexB].v; - float32 wB = data.velocities[m_indexB].w; - - float32 mA = m_invMassA, mB = m_invMassB; - float32 iA = m_invIA, iB = m_invIB; - - // Solve linear motor constraint. - if (m_enableMotor && m_limitState != e_equalLimits) - { - float32 Cdot = b2Dot(m_axis, vB - vA) + m_a2 * wB - m_a1 * wA; - float32 impulse = m_motorMass * (m_motorSpeed - Cdot); - float32 oldImpulse = m_motorImpulse; - float32 maxImpulse = data.step.dt * m_maxMotorForce; - m_motorImpulse = b2Clamp(m_motorImpulse + impulse, -maxImpulse, maxImpulse); - impulse = m_motorImpulse - oldImpulse; - - b2Vec2 P = impulse * m_axis; - float32 LA = impulse * m_a1; - float32 LB = impulse * m_a2; - - vA -= mA * P; - wA -= iA * LA; - - vB += mB * P; - wB += iB * LB; - } - - b2Vec2 Cdot1; - Cdot1.x = b2Dot(m_perp, vB - vA) + m_s2 * wB - m_s1 * wA; - Cdot1.y = wB - wA; - - if (m_enableLimit && m_limitState != e_inactiveLimit) - { - // Solve prismatic and limit constraint in block form. - float32 Cdot2; - Cdot2 = b2Dot(m_axis, vB - vA) + m_a2 * wB - m_a1 * wA; - b2Vec3 Cdot(Cdot1.x, Cdot1.y, Cdot2); - - b2Vec3 f1 = m_impulse; - b2Vec3 df = m_K.Solve33(-Cdot); - m_impulse += df; - - if (m_limitState == e_atLowerLimit) - { - m_impulse.z = b2Max(m_impulse.z, 0.0f); - } - else if (m_limitState == e_atUpperLimit) - { - m_impulse.z = b2Min(m_impulse.z, 0.0f); - } - - // f2(1:2) = invK(1:2,1:2) * (-Cdot(1:2) - K(1:2,3) * (f2(3) - f1(3))) + f1(1:2) - b2Vec2 b = -Cdot1 - (m_impulse.z - f1.z) * b2Vec2(m_K.ez.x, m_K.ez.y); - b2Vec2 f2r = m_K.Solve22(b) + b2Vec2(f1.x, f1.y); - m_impulse.x = f2r.x; - m_impulse.y = f2r.y; - - df = m_impulse - f1; - - b2Vec2 P = df.x * m_perp + df.z * m_axis; - float32 LA = df.x * m_s1 + df.y + df.z * m_a1; - float32 LB = df.x * m_s2 + df.y + df.z * m_a2; - - vA -= mA * P; - wA -= iA * LA; - - vB += mB * P; - wB += iB * LB; - } - else - { - // Limit is inactive, just solve the prismatic constraint in block form. - b2Vec2 df = m_K.Solve22(-Cdot1); - m_impulse.x += df.x; - m_impulse.y += df.y; - - b2Vec2 P = df.x * m_perp; - float32 LA = df.x * m_s1 + df.y; - float32 LB = df.x * m_s2 + df.y; - - vA -= mA * P; - wA -= iA * LA; - - vB += mB * P; - wB += iB * LB; - - b2Vec2 Cdot10 = Cdot1; - - Cdot1.x = b2Dot(m_perp, vB - vA) + m_s2 * wB - m_s1 * wA; - Cdot1.y = wB - wA; - - if (b2Abs(Cdot1.x) > 0.01f || b2Abs(Cdot1.y) > 0.01f) - { - b2Vec2 test = b2Mul22(m_K, df); - Cdot1.x += 0.0f; - } - } - - data.velocities[m_indexA].v = vA; - data.velocities[m_indexA].w = wA; - data.velocities[m_indexB].v = vB; - data.velocities[m_indexB].w = wB; -} - -bool b2PrismaticJoint::SolvePositionConstraints(const b2SolverData& data) -{ - b2Vec2 cA = data.positions[m_indexA].c; - float32 aA = data.positions[m_indexA].a; - b2Vec2 cB = data.positions[m_indexB].c; - float32 aB = data.positions[m_indexB].a; - - b2Rot qA(aA), qB(aB); - - float32 mA = m_invMassA, mB = m_invMassB; - float32 iA = m_invIA, iB = m_invIB; - - // Compute fresh Jacobians - b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA); - b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB); - b2Vec2 d = cB + rB - cA - rA; - - b2Vec2 axis = b2Mul(qA, m_localXAxisA); - float32 a1 = b2Cross(d + rA, axis); - float32 a2 = b2Cross(rB, axis); - b2Vec2 perp = b2Mul(qA, m_localYAxisA); - - float32 s1 = b2Cross(d + rA, perp); - float32 s2 = b2Cross(rB, perp); - - b2Vec3 impulse; - b2Vec2 C1; - C1.x = b2Dot(perp, d); - C1.y = aB - aA - m_referenceAngle; - - float32 linearError = b2Abs(C1.x); - float32 angularError = b2Abs(C1.y); - - bool active = false; - float32 C2 = 0.0f; - if (m_enableLimit) - { - float32 translation = b2Dot(axis, d); - if (b2Abs(m_upperTranslation - m_lowerTranslation) < 2.0f * b2_linearSlop) - { - // Prevent large angular corrections - C2 = b2Clamp(translation, -b2_maxLinearCorrection, b2_maxLinearCorrection); - linearError = b2Max(linearError, b2Abs(translation)); - active = true; - } - else if (translation <= m_lowerTranslation) - { - // Prevent large linear corrections and allow some slop. - C2 = b2Clamp(translation - m_lowerTranslation + b2_linearSlop, -b2_maxLinearCorrection, 0.0f); - linearError = b2Max(linearError, m_lowerTranslation - translation); - active = true; - } - else if (translation >= m_upperTranslation) - { - // Prevent large linear corrections and allow some slop. - C2 = b2Clamp(translation - m_upperTranslation - b2_linearSlop, 0.0f, b2_maxLinearCorrection); - linearError = b2Max(linearError, translation - m_upperTranslation); - active = true; - } - } - - if (active) - { - float32 k11 = mA + mB + iA * s1 * s1 + iB * s2 * s2; - float32 k12 = iA * s1 + iB * s2; - float32 k13 = iA * s1 * a1 + iB * s2 * a2; - float32 k22 = iA + iB; - if (k22 == 0.0f) - { - // For fixed rotation - k22 = 1.0f; - } - float32 k23 = iA * a1 + iB * a2; - float32 k33 = mA + mB + iA * a1 * a1 + iB * a2 * a2; - - b2Mat33 K; - K.ex.Set(k11, k12, k13); - K.ey.Set(k12, k22, k23); - K.ez.Set(k13, k23, k33); - - b2Vec3 C; - C.x = C1.x; - C.y = C1.y; - C.z = C2; - - impulse = K.Solve33(-C); - } - else - { - float32 k11 = mA + mB + iA * s1 * s1 + iB * s2 * s2; - float32 k12 = iA * s1 + iB * s2; - float32 k22 = iA + iB; - if (k22 == 0.0f) - { - k22 = 1.0f; - } - - b2Mat22 K; - K.ex.Set(k11, k12); - K.ey.Set(k12, k22); - - b2Vec2 impulse1 = K.Solve(-C1); - impulse.x = impulse1.x; - impulse.y = impulse1.y; - impulse.z = 0.0f; - } - - b2Vec2 P = impulse.x * perp + impulse.z * axis; - float32 LA = impulse.x * s1 + impulse.y + impulse.z * a1; - float32 LB = impulse.x * s2 + impulse.y + impulse.z * a2; - - cA -= mA * P; - aA -= iA * LA; - cB += mB * P; - aB += iB * LB; - - data.positions[m_indexA].c = cA; - data.positions[m_indexA].a = aA; - data.positions[m_indexB].c = cB; - data.positions[m_indexB].a = aB; - - return linearError <= b2_linearSlop && angularError <= b2_angularSlop; -} - -b2Vec2 b2PrismaticJoint::GetAnchorA() const -{ - return m_bodyA->GetWorldPoint(m_localAnchorA); -} - -b2Vec2 b2PrismaticJoint::GetAnchorB() const -{ - return m_bodyB->GetWorldPoint(m_localAnchorB); -} - -b2Vec2 b2PrismaticJoint::GetReactionForce(float32 inv_dt) const -{ - return inv_dt * (m_impulse.x * m_perp + (m_motorImpulse + m_impulse.z) * m_axis); -} - -float32 b2PrismaticJoint::GetReactionTorque(float32 inv_dt) const -{ - return inv_dt * m_impulse.y; -} - -float32 b2PrismaticJoint::GetJointTranslation() const -{ - b2Vec2 pA = m_bodyA->GetWorldPoint(m_localAnchorA); - b2Vec2 pB = m_bodyB->GetWorldPoint(m_localAnchorB); - b2Vec2 d = pB - pA; - b2Vec2 axis = m_bodyA->GetWorldVector(m_localXAxisA); - - float32 translation = b2Dot(d, axis); - return translation; -} - -float32 b2PrismaticJoint::GetJointSpeed() const -{ - b2Body* bA = m_bodyA; - b2Body* bB = m_bodyB; - - b2Vec2 rA = b2Mul(bA->m_xf.q, m_localAnchorA - bA->m_sweep.localCenter); - b2Vec2 rB = b2Mul(bB->m_xf.q, m_localAnchorB - bB->m_sweep.localCenter); - b2Vec2 p1 = bA->m_sweep.c + rA; - b2Vec2 p2 = bB->m_sweep.c + rB; - b2Vec2 d = p2 - p1; - b2Vec2 axis = b2Mul(bA->m_xf.q, m_localXAxisA); - - b2Vec2 vA = bA->m_linearVelocity; - b2Vec2 vB = bB->m_linearVelocity; - float32 wA = bA->m_angularVelocity; - float32 wB = bB->m_angularVelocity; - - float32 speed = b2Dot(d, b2Cross(wA, axis)) + b2Dot(axis, vB + b2Cross(wB, rB) - vA - b2Cross(wA, rA)); - return speed; -} - -bool b2PrismaticJoint::IsLimitEnabled() const -{ - return m_enableLimit; -} - -void b2PrismaticJoint::EnableLimit(bool flag) -{ - if (flag != m_enableLimit) - { - m_bodyA->SetAwake(true); - m_bodyB->SetAwake(true); - m_enableLimit = flag; - m_impulse.z = 0.0f; - } -} - -float32 b2PrismaticJoint::GetLowerLimit() const -{ - return m_lowerTranslation; -} - -float32 b2PrismaticJoint::GetUpperLimit() const -{ - return m_upperTranslation; -} - -void b2PrismaticJoint::SetLimits(float32 lower, float32 upper) -{ - b2Assert(lower <= upper); - if (lower != m_lowerTranslation || upper != m_upperTranslation) - { - m_bodyA->SetAwake(true); - m_bodyB->SetAwake(true); - m_lowerTranslation = lower; - m_upperTranslation = upper; - m_impulse.z = 0.0f; - } -} - -bool b2PrismaticJoint::IsMotorEnabled() const -{ - return m_enableMotor; -} - -void b2PrismaticJoint::EnableMotor(bool flag) -{ - m_bodyA->SetAwake(true); - m_bodyB->SetAwake(true); - m_enableMotor = flag; -} - -void b2PrismaticJoint::SetMotorSpeed(float32 speed) -{ - m_bodyA->SetAwake(true); - m_bodyB->SetAwake(true); - m_motorSpeed = speed; -} - -void b2PrismaticJoint::SetMaxMotorForce(float32 force) -{ - m_bodyA->SetAwake(true); - m_bodyB->SetAwake(true); - m_maxMotorForce = force; -} - -float32 b2PrismaticJoint::GetMotorForce(float32 inv_dt) const -{ - return inv_dt * m_motorImpulse; -} - -void b2PrismaticJoint::Dump() -{ - int32 indexA = m_bodyA->m_islandIndex; - int32 indexB = m_bodyB->m_islandIndex; - - b2Log(" b2PrismaticJointDef jd;\n"); - b2Log(" jd.bodyA = bodies[%d];\n", indexA); - b2Log(" jd.bodyB = bodies[%d];\n", indexB); - b2Log(" jd.collideConnected = bool(%d);\n", m_collideConnected); - b2Log(" jd.localAnchorA.Set(%.15lef, %.15lef);\n", m_localAnchorA.x, m_localAnchorA.y); - b2Log(" jd.localAnchorB.Set(%.15lef, %.15lef);\n", m_localAnchorB.x, m_localAnchorB.y); - b2Log(" jd.localAxisA.Set(%.15lef, %.15lef);\n", m_localXAxisA.x, m_localXAxisA.y); - b2Log(" jd.referenceAngle = %.15lef;\n", m_referenceAngle); - b2Log(" jd.enableLimit = bool(%d);\n", m_enableLimit); - b2Log(" jd.lowerTranslation = %.15lef;\n", m_lowerTranslation); - b2Log(" jd.upperTranslation = %.15lef;\n", m_upperTranslation); - b2Log(" jd.enableMotor = bool(%d);\n", m_enableMotor); - b2Log(" jd.motorSpeed = %.15lef;\n", m_motorSpeed); - b2Log(" jd.maxMotorForce = %.15lef;\n", m_maxMotorForce); - b2Log(" joints[%d] = m_world->CreateJoint(&jd);\n", m_index); -} diff --git a/external/Box2D/Dynamics/Joints/b2PrismaticJoint.h b/external/Box2D/Dynamics/Joints/b2PrismaticJoint.h deleted file mode 100644 index aca2859b45..0000000000 --- a/external/Box2D/Dynamics/Joints/b2PrismaticJoint.h +++ /dev/null @@ -1,196 +0,0 @@ -/* -* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_PRISMATIC_JOINT_H -#define B2_PRISMATIC_JOINT_H - -#include - -/// Prismatic joint definition. This requires defining a line of -/// motion using an axis and an anchor point. The definition uses local -/// anchor points and a local axis so that the initial configuration -/// can violate the constraint slightly. The joint translation is zero -/// when the local anchor points coincide in world space. Using local -/// anchors and a local axis helps when saving and loading a game. -struct b2PrismaticJointDef : public b2JointDef -{ - b2PrismaticJointDef() - { - type = e_prismaticJoint; - localAnchorA.SetZero(); - localAnchorB.SetZero(); - localAxisA.Set(1.0f, 0.0f); - referenceAngle = 0.0f; - enableLimit = false; - lowerTranslation = 0.0f; - upperTranslation = 0.0f; - enableMotor = false; - maxMotorForce = 0.0f; - motorSpeed = 0.0f; - } - - /// Initialize the bodies, anchors, axis, and reference angle using the world - /// anchor and unit world axis. - void Initialize(b2Body* bodyA, b2Body* bodyB, const b2Vec2& anchor, const b2Vec2& axis); - - /// The local anchor point relative to bodyA's origin. - b2Vec2 localAnchorA; - - /// The local anchor point relative to bodyB's origin. - b2Vec2 localAnchorB; - - /// The local translation unit axis in bodyA. - b2Vec2 localAxisA; - - /// The constrained angle between the bodies: bodyB_angle - bodyA_angle. - float32 referenceAngle; - - /// Enable/disable the joint limit. - bool enableLimit; - - /// The lower translation limit, usually in meters. - float32 lowerTranslation; - - /// The upper translation limit, usually in meters. - float32 upperTranslation; - - /// Enable/disable the joint motor. - bool enableMotor; - - /// The maximum motor torque, usually in N-m. - float32 maxMotorForce; - - /// The desired motor speed in radians per second. - float32 motorSpeed; -}; - -/// A prismatic joint. This joint provides one degree of freedom: translation -/// along an axis fixed in bodyA. Relative rotation is prevented. You can -/// use a joint limit to restrict the range of motion and a joint motor to -/// drive the motion or to model joint friction. -class b2PrismaticJoint : public b2Joint -{ -public: - b2Vec2 GetAnchorA() const; - b2Vec2 GetAnchorB() const; - - b2Vec2 GetReactionForce(float32 inv_dt) const; - float32 GetReactionTorque(float32 inv_dt) const; - - /// The local anchor point relative to bodyA's origin. - const b2Vec2& GetLocalAnchorA() const { return m_localAnchorA; } - - /// The local anchor point relative to bodyB's origin. - const b2Vec2& GetLocalAnchorB() const { return m_localAnchorB; } - - /// The local joint axis relative to bodyA. - const b2Vec2& GetLocalAxisA() const { return m_localXAxisA; } - - /// Get the reference angle. - float32 GetReferenceAngle() const { return m_referenceAngle; } - - /// Get the current joint translation, usually in meters. - float32 GetJointTranslation() const; - - /// Get the current joint translation speed, usually in meters per second. - float32 GetJointSpeed() const; - - /// Is the joint limit enabled? - bool IsLimitEnabled() const; - - /// Enable/disable the joint limit. - void EnableLimit(bool flag); - - /// Get the lower joint limit, usually in meters. - float32 GetLowerLimit() const; - - /// Get the upper joint limit, usually in meters. - float32 GetUpperLimit() const; - - /// Set the joint limits, usually in meters. - void SetLimits(float32 lower, float32 upper); - - /// Is the joint motor enabled? - bool IsMotorEnabled() const; - - /// Enable/disable the joint motor. - void EnableMotor(bool flag); - - /// Set the motor speed, usually in meters per second. - void SetMotorSpeed(float32 speed); - - /// Get the motor speed, usually in meters per second. - float32 GetMotorSpeed() const; - - /// Set the maximum motor force, usually in N. - void SetMaxMotorForce(float32 force); - float32 GetMaxMotorForce() const { return m_maxMotorForce; } - - /// Get the current motor force given the inverse time step, usually in N. - float32 GetMotorForce(float32 inv_dt) const; - - /// Dump to b2Log - void Dump(); - -protected: - friend class b2Joint; - friend class b2GearJoint; - b2PrismaticJoint(const b2PrismaticJointDef* def); - - void InitVelocityConstraints(const b2SolverData& data); - void SolveVelocityConstraints(const b2SolverData& data); - bool SolvePositionConstraints(const b2SolverData& data); - - // Solver shared - b2Vec2 m_localAnchorA; - b2Vec2 m_localAnchorB; - b2Vec2 m_localXAxisA; - b2Vec2 m_localYAxisA; - float32 m_referenceAngle; - b2Vec3 m_impulse; - float32 m_motorImpulse; - float32 m_lowerTranslation; - float32 m_upperTranslation; - float32 m_maxMotorForce; - float32 m_motorSpeed; - bool m_enableLimit; - bool m_enableMotor; - b2LimitState m_limitState; - - // Solver temp - int32 m_indexA; - int32 m_indexB; - b2Vec2 m_localCenterA; - b2Vec2 m_localCenterB; - float32 m_invMassA; - float32 m_invMassB; - float32 m_invIA; - float32 m_invIB; - b2Vec2 m_axis, m_perp; - float32 m_s1, m_s2; - float32 m_a1, m_a2; - b2Mat33 m_K; - float32 m_motorMass; -}; - -inline float32 b2PrismaticJoint::GetMotorSpeed() const -{ - return m_motorSpeed; -} - -#endif diff --git a/external/Box2D/Dynamics/Joints/b2PulleyJoint.cpp b/external/Box2D/Dynamics/Joints/b2PulleyJoint.cpp deleted file mode 100644 index da30fae222..0000000000 --- a/external/Box2D/Dynamics/Joints/b2PulleyJoint.cpp +++ /dev/null @@ -1,332 +0,0 @@ -/* -* Copyright (c) 2007 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include - -// Pulley: -// length1 = norm(p1 - s1) -// length2 = norm(p2 - s2) -// C0 = (length1 + ratio * length2)_initial -// C = C0 - (length1 + ratio * length2) -// u1 = (p1 - s1) / norm(p1 - s1) -// u2 = (p2 - s2) / norm(p2 - s2) -// Cdot = -dot(u1, v1 + cross(w1, r1)) - ratio * dot(u2, v2 + cross(w2, r2)) -// J = -[u1 cross(r1, u1) ratio * u2 ratio * cross(r2, u2)] -// K = J * invM * JT -// = invMass1 + invI1 * cross(r1, u1)^2 + ratio^2 * (invMass2 + invI2 * cross(r2, u2)^2) - -void b2PulleyJointDef::Initialize(b2Body* bA, b2Body* bB, - const b2Vec2& groundA, const b2Vec2& groundB, - const b2Vec2& anchorA, const b2Vec2& anchorB, - float32 r) -{ - bodyA = bA; - bodyB = bB; - groundAnchorA = groundA; - groundAnchorB = groundB; - localAnchorA = bodyA->GetLocalPoint(anchorA); - localAnchorB = bodyB->GetLocalPoint(anchorB); - b2Vec2 dA = anchorA - groundA; - lengthA = dA.Length(); - b2Vec2 dB = anchorB - groundB; - lengthB = dB.Length(); - ratio = r; - b2Assert(ratio > b2_epsilon); -} - -b2PulleyJoint::b2PulleyJoint(const b2PulleyJointDef* def) -: b2Joint(def) -{ - m_groundAnchorA = def->groundAnchorA; - m_groundAnchorB = def->groundAnchorB; - m_localAnchorA = def->localAnchorA; - m_localAnchorB = def->localAnchorB; - - m_lengthA = def->lengthA; - m_lengthB = def->lengthB; - - b2Assert(def->ratio != 0.0f); - m_ratio = def->ratio; - - m_constant = def->lengthA + m_ratio * def->lengthB; - - m_impulse = 0.0f; -} - -void b2PulleyJoint::InitVelocityConstraints(const b2SolverData& data) -{ - m_indexA = m_bodyA->m_islandIndex; - m_indexB = m_bodyB->m_islandIndex; - m_localCenterA = m_bodyA->m_sweep.localCenter; - m_localCenterB = m_bodyB->m_sweep.localCenter; - m_invMassA = m_bodyA->m_invMass; - m_invMassB = m_bodyB->m_invMass; - m_invIA = m_bodyA->m_invI; - m_invIB = m_bodyB->m_invI; - - b2Vec2 cA = data.positions[m_indexA].c; - float32 aA = data.positions[m_indexA].a; - b2Vec2 vA = data.velocities[m_indexA].v; - float32 wA = data.velocities[m_indexA].w; - - b2Vec2 cB = data.positions[m_indexB].c; - float32 aB = data.positions[m_indexB].a; - b2Vec2 vB = data.velocities[m_indexB].v; - float32 wB = data.velocities[m_indexB].w; - - b2Rot qA(aA), qB(aB); - - m_rA = b2Mul(qA, m_localAnchorA - m_localCenterA); - m_rB = b2Mul(qB, m_localAnchorB - m_localCenterB); - - // Get the pulley axes. - m_uA = cA + m_rA - m_groundAnchorA; - m_uB = cB + m_rB - m_groundAnchorB; - - float32 lengthA = m_uA.Length(); - float32 lengthB = m_uB.Length(); - - if (lengthA > 10.0f * b2_linearSlop) - { - m_uA *= 1.0f / lengthA; - } - else - { - m_uA.SetZero(); - } - - if (lengthB > 10.0f * b2_linearSlop) - { - m_uB *= 1.0f / lengthB; - } - else - { - m_uB.SetZero(); - } - - // Compute effective mass. - float32 ruA = b2Cross(m_rA, m_uA); - float32 ruB = b2Cross(m_rB, m_uB); - - float32 mA = m_invMassA + m_invIA * ruA * ruA; - float32 mB = m_invMassB + m_invIB * ruB * ruB; - - m_mass = mA + m_ratio * m_ratio * mB; - - if (m_mass > 0.0f) - { - m_mass = 1.0f / m_mass; - } - - if (data.step.warmStarting) - { - // Scale impulses to support variable time steps. - m_impulse *= data.step.dtRatio; - - // Warm starting. - b2Vec2 PA = -(m_impulse) * m_uA; - b2Vec2 PB = (-m_ratio * m_impulse) * m_uB; - - vA += m_invMassA * PA; - wA += m_invIA * b2Cross(m_rA, PA); - vB += m_invMassB * PB; - wB += m_invIB * b2Cross(m_rB, PB); - } - else - { - m_impulse = 0.0f; - } - - data.velocities[m_indexA].v = vA; - data.velocities[m_indexA].w = wA; - data.velocities[m_indexB].v = vB; - data.velocities[m_indexB].w = wB; -} - -void b2PulleyJoint::SolveVelocityConstraints(const b2SolverData& data) -{ - b2Vec2 vA = data.velocities[m_indexA].v; - float32 wA = data.velocities[m_indexA].w; - b2Vec2 vB = data.velocities[m_indexB].v; - float32 wB = data.velocities[m_indexB].w; - - b2Vec2 vpA = vA + b2Cross(wA, m_rA); - b2Vec2 vpB = vB + b2Cross(wB, m_rB); - - float32 Cdot = -b2Dot(m_uA, vpA) - m_ratio * b2Dot(m_uB, vpB); - float32 impulse = -m_mass * Cdot; - m_impulse += impulse; - - b2Vec2 PA = -impulse * m_uA; - b2Vec2 PB = -m_ratio * impulse * m_uB; - vA += m_invMassA * PA; - wA += m_invIA * b2Cross(m_rA, PA); - vB += m_invMassB * PB; - wB += m_invIB * b2Cross(m_rB, PB); - - data.velocities[m_indexA].v = vA; - data.velocities[m_indexA].w = wA; - data.velocities[m_indexB].v = vB; - data.velocities[m_indexB].w = wB; -} - -bool b2PulleyJoint::SolvePositionConstraints(const b2SolverData& data) -{ - b2Vec2 cA = data.positions[m_indexA].c; - float32 aA = data.positions[m_indexA].a; - b2Vec2 cB = data.positions[m_indexB].c; - float32 aB = data.positions[m_indexB].a; - - b2Rot qA(aA), qB(aB); - - b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA); - b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB); - - // Get the pulley axes. - b2Vec2 uA = cA + rA - m_groundAnchorA; - b2Vec2 uB = cB + rB - m_groundAnchorB; - - float32 lengthA = uA.Length(); - float32 lengthB = uB.Length(); - - if (lengthA > 10.0f * b2_linearSlop) - { - uA *= 1.0f / lengthA; - } - else - { - uA.SetZero(); - } - - if (lengthB > 10.0f * b2_linearSlop) - { - uB *= 1.0f / lengthB; - } - else - { - uB.SetZero(); - } - - // Compute effective mass. - float32 ruA = b2Cross(rA, uA); - float32 ruB = b2Cross(rB, uB); - - float32 mA = m_invMassA + m_invIA * ruA * ruA; - float32 mB = m_invMassB + m_invIB * ruB * ruB; - - float32 mass = mA + m_ratio * m_ratio * mB; - - if (mass > 0.0f) - { - mass = 1.0f / mass; - } - - float32 C = m_constant - lengthA - m_ratio * lengthB; - float32 linearError = b2Abs(C); - - float32 impulse = -mass * C; - - b2Vec2 PA = -impulse * uA; - b2Vec2 PB = -m_ratio * impulse * uB; - - cA += m_invMassA * PA; - aA += m_invIA * b2Cross(rA, PA); - cB += m_invMassB * PB; - aB += m_invIB * b2Cross(rB, PB); - - data.positions[m_indexA].c = cA; - data.positions[m_indexA].a = aA; - data.positions[m_indexB].c = cB; - data.positions[m_indexB].a = aB; - - return linearError < b2_linearSlop; -} - -b2Vec2 b2PulleyJoint::GetAnchorA() const -{ - return m_bodyA->GetWorldPoint(m_localAnchorA); -} - -b2Vec2 b2PulleyJoint::GetAnchorB() const -{ - return m_bodyB->GetWorldPoint(m_localAnchorB); -} - -b2Vec2 b2PulleyJoint::GetReactionForce(float32 inv_dt) const -{ - b2Vec2 P = m_impulse * m_uB; - return inv_dt * P; -} - -float32 b2PulleyJoint::GetReactionTorque(float32 inv_dt) const -{ - B2_NOT_USED(inv_dt); - return 0.0f; -} - -b2Vec2 b2PulleyJoint::GetGroundAnchorA() const -{ - return m_groundAnchorA; -} - -b2Vec2 b2PulleyJoint::GetGroundAnchorB() const -{ - return m_groundAnchorB; -} - -float32 b2PulleyJoint::GetLengthA() const -{ - b2Vec2 p = m_bodyA->GetWorldPoint(m_localAnchorA); - b2Vec2 s = m_groundAnchorA; - b2Vec2 d = p - s; - return d.Length(); -} - -float32 b2PulleyJoint::GetLengthB() const -{ - b2Vec2 p = m_bodyB->GetWorldPoint(m_localAnchorB); - b2Vec2 s = m_groundAnchorB; - b2Vec2 d = p - s; - return d.Length(); -} - -float32 b2PulleyJoint::GetRatio() const -{ - return m_ratio; -} - -void b2PulleyJoint::Dump() -{ - int32 indexA = m_bodyA->m_islandIndex; - int32 indexB = m_bodyB->m_islandIndex; - - b2Log(" b2PulleyJointDef jd;\n"); - b2Log(" jd.bodyA = bodies[%d];\n", indexA); - b2Log(" jd.bodyB = bodies[%d];\n", indexB); - b2Log(" jd.collideConnected = bool(%d);\n", m_collideConnected); - b2Log(" jd.groundAnchorA.Set(%.15lef, %.15lef);\n", m_groundAnchorA.x, m_groundAnchorA.y); - b2Log(" jd.groundAnchorB.Set(%.15lef, %.15lef);\n", m_groundAnchorB.x, m_groundAnchorB.y); - b2Log(" jd.localAnchorA.Set(%.15lef, %.15lef);\n", m_localAnchorA.x, m_localAnchorA.y); - b2Log(" jd.localAnchorB.Set(%.15lef, %.15lef);\n", m_localAnchorB.x, m_localAnchorB.y); - b2Log(" jd.lengthA = %.15lef;\n", m_lengthA); - b2Log(" jd.lengthB = %.15lef;\n", m_lengthB); - b2Log(" jd.ratio = %.15lef;\n", m_ratio); - b2Log(" joints[%d] = m_world->CreateJoint(&jd);\n", m_index); -} diff --git a/external/Box2D/Dynamics/Joints/b2PulleyJoint.h b/external/Box2D/Dynamics/Joints/b2PulleyJoint.h deleted file mode 100644 index 2f6df4395c..0000000000 --- a/external/Box2D/Dynamics/Joints/b2PulleyJoint.h +++ /dev/null @@ -1,143 +0,0 @@ -/* -* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_PULLEY_JOINT_H -#define B2_PULLEY_JOINT_H - -#include - -const float32 b2_minPulleyLength = 2.0f; - -/// Pulley joint definition. This requires two ground anchors, -/// two dynamic body anchor points, and a pulley ratio. -struct b2PulleyJointDef : public b2JointDef -{ - b2PulleyJointDef() - { - type = e_pulleyJoint; - groundAnchorA.Set(-1.0f, 1.0f); - groundAnchorB.Set(1.0f, 1.0f); - localAnchorA.Set(-1.0f, 0.0f); - localAnchorB.Set(1.0f, 0.0f); - lengthA = 0.0f; - lengthB = 0.0f; - ratio = 1.0f; - collideConnected = true; - } - - /// Initialize the bodies, anchors, lengths, max lengths, and ratio using the world anchors. - void Initialize(b2Body* bodyA, b2Body* bodyB, - const b2Vec2& groundAnchorA, const b2Vec2& groundAnchorB, - const b2Vec2& anchorA, const b2Vec2& anchorB, - float32 ratio); - - /// The first ground anchor in world coordinates. This point never moves. - b2Vec2 groundAnchorA; - - /// The second ground anchor in world coordinates. This point never moves. - b2Vec2 groundAnchorB; - - /// The local anchor point relative to bodyA's origin. - b2Vec2 localAnchorA; - - /// The local anchor point relative to bodyB's origin. - b2Vec2 localAnchorB; - - /// The a reference length for the segment attached to bodyA. - float32 lengthA; - - /// The a reference length for the segment attached to bodyB. - float32 lengthB; - - /// The pulley ratio, used to simulate a block-and-tackle. - float32 ratio; -}; - -/// The pulley joint is connected to two bodies and two fixed ground points. -/// The pulley supports a ratio such that: -/// length1 + ratio * length2 <= constant -/// Yes, the force transmitted is scaled by the ratio. -/// Warning: the pulley joint can get a bit squirrelly by itself. They often -/// work better when combined with prismatic joints. You should also cover the -/// the anchor points with static shapes to prevent one side from going to -/// zero length. -class b2PulleyJoint : public b2Joint -{ -public: - b2Vec2 GetAnchorA() const; - b2Vec2 GetAnchorB() const; - - b2Vec2 GetReactionForce(float32 inv_dt) const; - float32 GetReactionTorque(float32 inv_dt) const; - - /// Get the first ground anchor. - b2Vec2 GetGroundAnchorA() const; - - /// Get the second ground anchor. - b2Vec2 GetGroundAnchorB() const; - - /// Get the current length of the segment attached to bodyA. - float32 GetLengthA() const; - - /// Get the current length of the segment attached to bodyB. - float32 GetLengthB() const; - - /// Get the pulley ratio. - float32 GetRatio() const; - - /// Dump joint to dmLog - void Dump(); - -protected: - - friend class b2Joint; - b2PulleyJoint(const b2PulleyJointDef* data); - - void InitVelocityConstraints(const b2SolverData& data); - void SolveVelocityConstraints(const b2SolverData& data); - bool SolvePositionConstraints(const b2SolverData& data); - - b2Vec2 m_groundAnchorA; - b2Vec2 m_groundAnchorB; - float32 m_lengthA; - float32 m_lengthB; - - // Solver shared - b2Vec2 m_localAnchorA; - b2Vec2 m_localAnchorB; - float32 m_constant; - float32 m_ratio; - float32 m_impulse; - - // Solver temp - int32 m_indexA; - int32 m_indexB; - b2Vec2 m_uA; - b2Vec2 m_uB; - b2Vec2 m_rA; - b2Vec2 m_rB; - b2Vec2 m_localCenterA; - b2Vec2 m_localCenterB; - float32 m_invMassA; - float32 m_invMassB; - float32 m_invIA; - float32 m_invIB; - float32 m_mass; -}; - -#endif diff --git a/external/Box2D/Dynamics/Joints/b2RevoluteJoint.cpp b/external/Box2D/Dynamics/Joints/b2RevoluteJoint.cpp deleted file mode 100644 index e265d8192b..0000000000 --- a/external/Box2D/Dynamics/Joints/b2RevoluteJoint.cpp +++ /dev/null @@ -1,504 +0,0 @@ -/* -* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include - -// Point-to-point constraint -// C = p2 - p1 -// Cdot = v2 - v1 -// = v2 + cross(w2, r2) - v1 - cross(w1, r1) -// J = [-I -r1_skew I r2_skew ] -// Identity used: -// w k % (rx i + ry j) = w * (-ry i + rx j) - -// Motor constraint -// Cdot = w2 - w1 -// J = [0 0 -1 0 0 1] -// K = invI1 + invI2 - -void b2RevoluteJointDef::Initialize(b2Body* bA, b2Body* bB, const b2Vec2& anchor) -{ - bodyA = bA; - bodyB = bB; - localAnchorA = bodyA->GetLocalPoint(anchor); - localAnchorB = bodyB->GetLocalPoint(anchor); - referenceAngle = bodyB->GetAngle() - bodyA->GetAngle(); -} - -b2RevoluteJoint::b2RevoluteJoint(const b2RevoluteJointDef* def) -: b2Joint(def) -{ - m_localAnchorA = def->localAnchorA; - m_localAnchorB = def->localAnchorB; - m_referenceAngle = def->referenceAngle; - - m_impulse.SetZero(); - m_motorImpulse = 0.0f; - - m_lowerAngle = def->lowerAngle; - m_upperAngle = def->upperAngle; - m_maxMotorTorque = def->maxMotorTorque; - m_motorSpeed = def->motorSpeed; - m_enableLimit = def->enableLimit; - m_enableMotor = def->enableMotor; - m_limitState = e_inactiveLimit; -} - -void b2RevoluteJoint::InitVelocityConstraints(const b2SolverData& data) -{ - m_indexA = m_bodyA->m_islandIndex; - m_indexB = m_bodyB->m_islandIndex; - m_localCenterA = m_bodyA->m_sweep.localCenter; - m_localCenterB = m_bodyB->m_sweep.localCenter; - m_invMassA = m_bodyA->m_invMass; - m_invMassB = m_bodyB->m_invMass; - m_invIA = m_bodyA->m_invI; - m_invIB = m_bodyB->m_invI; - - b2Vec2 cA = data.positions[m_indexA].c; - float32 aA = data.positions[m_indexA].a; - b2Vec2 vA = data.velocities[m_indexA].v; - float32 wA = data.velocities[m_indexA].w; - - b2Vec2 cB = data.positions[m_indexB].c; - float32 aB = data.positions[m_indexB].a; - b2Vec2 vB = data.velocities[m_indexB].v; - float32 wB = data.velocities[m_indexB].w; - - b2Rot qA(aA), qB(aB); - - m_rA = b2Mul(qA, m_localAnchorA - m_localCenterA); - m_rB = b2Mul(qB, m_localAnchorB - m_localCenterB); - - // J = [-I -r1_skew I r2_skew] - // [ 0 -1 0 1] - // r_skew = [-ry; rx] - - // Matlab - // K = [ mA+r1y^2*iA+mB+r2y^2*iB, -r1y*iA*r1x-r2y*iB*r2x, -r1y*iA-r2y*iB] - // [ -r1y*iA*r1x-r2y*iB*r2x, mA+r1x^2*iA+mB+r2x^2*iB, r1x*iA+r2x*iB] - // [ -r1y*iA-r2y*iB, r1x*iA+r2x*iB, iA+iB] - - float32 mA = m_invMassA, mB = m_invMassB; - float32 iA = m_invIA, iB = m_invIB; - - bool fixedRotation = (iA + iB == 0.0f); - - m_mass.ex.x = mA + mB + m_rA.y * m_rA.y * iA + m_rB.y * m_rB.y * iB; - m_mass.ey.x = -m_rA.y * m_rA.x * iA - m_rB.y * m_rB.x * iB; - m_mass.ez.x = -m_rA.y * iA - m_rB.y * iB; - m_mass.ex.y = m_mass.ey.x; - m_mass.ey.y = mA + mB + m_rA.x * m_rA.x * iA + m_rB.x * m_rB.x * iB; - m_mass.ez.y = m_rA.x * iA + m_rB.x * iB; - m_mass.ex.z = m_mass.ez.x; - m_mass.ey.z = m_mass.ez.y; - m_mass.ez.z = iA + iB; - - m_motorMass = iA + iB; - if (m_motorMass > 0.0f) - { - m_motorMass = 1.0f / m_motorMass; - } - - if (m_enableMotor == false || fixedRotation) - { - m_motorImpulse = 0.0f; - } - - if (m_enableLimit && fixedRotation == false) - { - float32 jointAngle = aB - aA - m_referenceAngle; - if (b2Abs(m_upperAngle - m_lowerAngle) < 2.0f * b2_angularSlop) - { - m_limitState = e_equalLimits; - } - else if (jointAngle <= m_lowerAngle) - { - if (m_limitState != e_atLowerLimit) - { - m_impulse.z = 0.0f; - } - m_limitState = e_atLowerLimit; - } - else if (jointAngle >= m_upperAngle) - { - if (m_limitState != e_atUpperLimit) - { - m_impulse.z = 0.0f; - } - m_limitState = e_atUpperLimit; - } - else - { - m_limitState = e_inactiveLimit; - m_impulse.z = 0.0f; - } - } - else - { - m_limitState = e_inactiveLimit; - } - - if (data.step.warmStarting) - { - // Scale impulses to support a variable time step. - m_impulse *= data.step.dtRatio; - m_motorImpulse *= data.step.dtRatio; - - b2Vec2 P(m_impulse.x, m_impulse.y); - - vA -= mA * P; - wA -= iA * (b2Cross(m_rA, P) + m_motorImpulse + m_impulse.z); - - vB += mB * P; - wB += iB * (b2Cross(m_rB, P) + m_motorImpulse + m_impulse.z); - } - else - { - m_impulse.SetZero(); - m_motorImpulse = 0.0f; - } - - data.velocities[m_indexA].v = vA; - data.velocities[m_indexA].w = wA; - data.velocities[m_indexB].v = vB; - data.velocities[m_indexB].w = wB; -} - -void b2RevoluteJoint::SolveVelocityConstraints(const b2SolverData& data) -{ - b2Vec2 vA = data.velocities[m_indexA].v; - float32 wA = data.velocities[m_indexA].w; - b2Vec2 vB = data.velocities[m_indexB].v; - float32 wB = data.velocities[m_indexB].w; - - float32 mA = m_invMassA, mB = m_invMassB; - float32 iA = m_invIA, iB = m_invIB; - - bool fixedRotation = (iA + iB == 0.0f); - - // Solve motor constraint. - if (m_enableMotor && m_limitState != e_equalLimits && fixedRotation == false) - { - float32 Cdot = wB - wA - m_motorSpeed; - float32 impulse = -m_motorMass * Cdot; - float32 oldImpulse = m_motorImpulse; - float32 maxImpulse = data.step.dt * m_maxMotorTorque; - m_motorImpulse = b2Clamp(m_motorImpulse + impulse, -maxImpulse, maxImpulse); - impulse = m_motorImpulse - oldImpulse; - - wA -= iA * impulse; - wB += iB * impulse; - } - - // Solve limit constraint. - if (m_enableLimit && m_limitState != e_inactiveLimit && fixedRotation == false) - { - b2Vec2 Cdot1 = vB + b2Cross(wB, m_rB) - vA - b2Cross(wA, m_rA); - float32 Cdot2 = wB - wA; - b2Vec3 Cdot(Cdot1.x, Cdot1.y, Cdot2); - - b2Vec3 impulse = -m_mass.Solve33(Cdot); - - if (m_limitState == e_equalLimits) - { - m_impulse += impulse; - } - else if (m_limitState == e_atLowerLimit) - { - float32 newImpulse = m_impulse.z + impulse.z; - if (newImpulse < 0.0f) - { - b2Vec2 rhs = -Cdot1 + m_impulse.z * b2Vec2(m_mass.ez.x, m_mass.ez.y); - b2Vec2 reduced = m_mass.Solve22(rhs); - impulse.x = reduced.x; - impulse.y = reduced.y; - impulse.z = -m_impulse.z; - m_impulse.x += reduced.x; - m_impulse.y += reduced.y; - m_impulse.z = 0.0f; - } - else - { - m_impulse += impulse; - } - } - else if (m_limitState == e_atUpperLimit) - { - float32 newImpulse = m_impulse.z + impulse.z; - if (newImpulse > 0.0f) - { - b2Vec2 rhs = -Cdot1 + m_impulse.z * b2Vec2(m_mass.ez.x, m_mass.ez.y); - b2Vec2 reduced = m_mass.Solve22(rhs); - impulse.x = reduced.x; - impulse.y = reduced.y; - impulse.z = -m_impulse.z; - m_impulse.x += reduced.x; - m_impulse.y += reduced.y; - m_impulse.z = 0.0f; - } - else - { - m_impulse += impulse; - } - } - - b2Vec2 P(impulse.x, impulse.y); - - vA -= mA * P; - wA -= iA * (b2Cross(m_rA, P) + impulse.z); - - vB += mB * P; - wB += iB * (b2Cross(m_rB, P) + impulse.z); - } - else - { - // Solve point-to-point constraint - b2Vec2 Cdot = vB + b2Cross(wB, m_rB) - vA - b2Cross(wA, m_rA); - b2Vec2 impulse = m_mass.Solve22(-Cdot); - - m_impulse.x += impulse.x; - m_impulse.y += impulse.y; - - vA -= mA * impulse; - wA -= iA * b2Cross(m_rA, impulse); - - vB += mB * impulse; - wB += iB * b2Cross(m_rB, impulse); - } - - data.velocities[m_indexA].v = vA; - data.velocities[m_indexA].w = wA; - data.velocities[m_indexB].v = vB; - data.velocities[m_indexB].w = wB; -} - -bool b2RevoluteJoint::SolvePositionConstraints(const b2SolverData& data) -{ - b2Vec2 cA = data.positions[m_indexA].c; - float32 aA = data.positions[m_indexA].a; - b2Vec2 cB = data.positions[m_indexB].c; - float32 aB = data.positions[m_indexB].a; - - b2Rot qA(aA), qB(aB); - - float32 angularError = 0.0f; - float32 positionError = 0.0f; - - bool fixedRotation = (m_invIA + m_invIB == 0.0f); - - // Solve angular limit constraint. - if (m_enableLimit && m_limitState != e_inactiveLimit && fixedRotation == false) - { - float32 angle = aB - aA - m_referenceAngle; - float32 limitImpulse = 0.0f; - - if (m_limitState == e_equalLimits) - { - // Prevent large angular corrections - float32 C = b2Clamp(angle - m_lowerAngle, -b2_maxAngularCorrection, b2_maxAngularCorrection); - limitImpulse = -m_motorMass * C; - angularError = b2Abs(C); - } - else if (m_limitState == e_atLowerLimit) - { - float32 C = angle - m_lowerAngle; - angularError = -C; - - // Prevent large angular corrections and allow some slop. - C = b2Clamp(C + b2_angularSlop, -b2_maxAngularCorrection, 0.0f); - limitImpulse = -m_motorMass * C; - } - else if (m_limitState == e_atUpperLimit) - { - float32 C = angle - m_upperAngle; - angularError = C; - - // Prevent large angular corrections and allow some slop. - C = b2Clamp(C - b2_angularSlop, 0.0f, b2_maxAngularCorrection); - limitImpulse = -m_motorMass * C; - } - - aA -= m_invIA * limitImpulse; - aB += m_invIB * limitImpulse; - } - - // Solve point-to-point constraint. - { - qA.Set(aA); - qB.Set(aB); - b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA); - b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB); - - b2Vec2 C = cB + rB - cA - rA; - positionError = C.Length(); - - float32 mA = m_invMassA, mB = m_invMassB; - float32 iA = m_invIA, iB = m_invIB; - - b2Mat22 K; - K.ex.x = mA + mB + iA * rA.y * rA.y + iB * rB.y * rB.y; - K.ex.y = -iA * rA.x * rA.y - iB * rB.x * rB.y; - K.ey.x = K.ex.y; - K.ey.y = mA + mB + iA * rA.x * rA.x + iB * rB.x * rB.x; - - b2Vec2 impulse = -K.Solve(C); - - cA -= mA * impulse; - aA -= iA * b2Cross(rA, impulse); - - cB += mB * impulse; - aB += iB * b2Cross(rB, impulse); - } - - data.positions[m_indexA].c = cA; - data.positions[m_indexA].a = aA; - data.positions[m_indexB].c = cB; - data.positions[m_indexB].a = aB; - - return positionError <= b2_linearSlop && angularError <= b2_angularSlop; -} - -b2Vec2 b2RevoluteJoint::GetAnchorA() const -{ - return m_bodyA->GetWorldPoint(m_localAnchorA); -} - -b2Vec2 b2RevoluteJoint::GetAnchorB() const -{ - return m_bodyB->GetWorldPoint(m_localAnchorB); -} - -b2Vec2 b2RevoluteJoint::GetReactionForce(float32 inv_dt) const -{ - b2Vec2 P(m_impulse.x, m_impulse.y); - return inv_dt * P; -} - -float32 b2RevoluteJoint::GetReactionTorque(float32 inv_dt) const -{ - return inv_dt * m_impulse.z; -} - -float32 b2RevoluteJoint::GetJointAngle() const -{ - b2Body* bA = m_bodyA; - b2Body* bB = m_bodyB; - return bB->m_sweep.a - bA->m_sweep.a - m_referenceAngle; -} - -float32 b2RevoluteJoint::GetJointSpeed() const -{ - b2Body* bA = m_bodyA; - b2Body* bB = m_bodyB; - return bB->m_angularVelocity - bA->m_angularVelocity; -} - -bool b2RevoluteJoint::IsMotorEnabled() const -{ - return m_enableMotor; -} - -void b2RevoluteJoint::EnableMotor(bool flag) -{ - m_bodyA->SetAwake(true); - m_bodyB->SetAwake(true); - m_enableMotor = flag; -} - -float32 b2RevoluteJoint::GetMotorTorque(float32 inv_dt) const -{ - return inv_dt * m_motorImpulse; -} - -void b2RevoluteJoint::SetMotorSpeed(float32 speed) -{ - m_bodyA->SetAwake(true); - m_bodyB->SetAwake(true); - m_motorSpeed = speed; -} - -void b2RevoluteJoint::SetMaxMotorTorque(float32 torque) -{ - m_bodyA->SetAwake(true); - m_bodyB->SetAwake(true); - m_maxMotorTorque = torque; -} - -bool b2RevoluteJoint::IsLimitEnabled() const -{ - return m_enableLimit; -} - -void b2RevoluteJoint::EnableLimit(bool flag) -{ - if (flag != m_enableLimit) - { - m_bodyA->SetAwake(true); - m_bodyB->SetAwake(true); - m_enableLimit = flag; - m_impulse.z = 0.0f; - } -} - -float32 b2RevoluteJoint::GetLowerLimit() const -{ - return m_lowerAngle; -} - -float32 b2RevoluteJoint::GetUpperLimit() const -{ - return m_upperAngle; -} - -void b2RevoluteJoint::SetLimits(float32 lower, float32 upper) -{ - b2Assert(lower <= upper); - - if (lower != m_lowerAngle || upper != m_upperAngle) - { - m_bodyA->SetAwake(true); - m_bodyB->SetAwake(true); - m_impulse.z = 0.0f; - m_lowerAngle = lower; - m_upperAngle = upper; - } -} - -void b2RevoluteJoint::Dump() -{ - int32 indexA = m_bodyA->m_islandIndex; - int32 indexB = m_bodyB->m_islandIndex; - - b2Log(" b2RevoluteJointDef jd;\n"); - b2Log(" jd.bodyA = bodies[%d];\n", indexA); - b2Log(" jd.bodyB = bodies[%d];\n", indexB); - b2Log(" jd.collideConnected = bool(%d);\n", m_collideConnected); - b2Log(" jd.localAnchorA.Set(%.15lef, %.15lef);\n", m_localAnchorA.x, m_localAnchorA.y); - b2Log(" jd.localAnchorB.Set(%.15lef, %.15lef);\n", m_localAnchorB.x, m_localAnchorB.y); - b2Log(" jd.referenceAngle = %.15lef;\n", m_referenceAngle); - b2Log(" jd.enableLimit = bool(%d);\n", m_enableLimit); - b2Log(" jd.lowerAngle = %.15lef;\n", m_lowerAngle); - b2Log(" jd.upperAngle = %.15lef;\n", m_upperAngle); - b2Log(" jd.enableMotor = bool(%d);\n", m_enableMotor); - b2Log(" jd.motorSpeed = %.15lef;\n", m_motorSpeed); - b2Log(" jd.maxMotorTorque = %.15lef;\n", m_maxMotorTorque); - b2Log(" joints[%d] = m_world->CreateJoint(&jd);\n", m_index); -} diff --git a/external/Box2D/Dynamics/Joints/b2RevoluteJoint.h b/external/Box2D/Dynamics/Joints/b2RevoluteJoint.h deleted file mode 100644 index 978f16259a..0000000000 --- a/external/Box2D/Dynamics/Joints/b2RevoluteJoint.h +++ /dev/null @@ -1,204 +0,0 @@ -/* -* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_REVOLUTE_JOINT_H -#define B2_REVOLUTE_JOINT_H - -#include - -/// Revolute joint definition. This requires defining an -/// anchor point where the bodies are joined. The definition -/// uses local anchor points so that the initial configuration -/// can violate the constraint slightly. You also need to -/// specify the initial relative angle for joint limits. This -/// helps when saving and loading a game. -/// The local anchor points are measured from the body's origin -/// rather than the center of mass because: -/// 1. you might not know where the center of mass will be. -/// 2. if you add/remove shapes from a body and recompute the mass, -/// the joints will be broken. -struct b2RevoluteJointDef : public b2JointDef -{ - b2RevoluteJointDef() - { - type = e_revoluteJoint; - localAnchorA.Set(0.0f, 0.0f); - localAnchorB.Set(0.0f, 0.0f); - referenceAngle = 0.0f; - lowerAngle = 0.0f; - upperAngle = 0.0f; - maxMotorTorque = 0.0f; - motorSpeed = 0.0f; - enableLimit = false; - enableMotor = false; - } - - /// Initialize the bodies, anchors, and reference angle using a world - /// anchor point. - void Initialize(b2Body* bodyA, b2Body* bodyB, const b2Vec2& anchor); - - /// The local anchor point relative to bodyA's origin. - b2Vec2 localAnchorA; - - /// The local anchor point relative to bodyB's origin. - b2Vec2 localAnchorB; - - /// The bodyB angle minus bodyA angle in the reference state (radians). - float32 referenceAngle; - - /// A flag to enable joint limits. - bool enableLimit; - - /// The lower angle for the joint limit (radians). - float32 lowerAngle; - - /// The upper angle for the joint limit (radians). - float32 upperAngle; - - /// A flag to enable the joint motor. - bool enableMotor; - - /// The desired motor speed. Usually in radians per second. - float32 motorSpeed; - - /// The maximum motor torque used to achieve the desired motor speed. - /// Usually in N-m. - float32 maxMotorTorque; -}; - -/// A revolute joint constrains two bodies to share a common point while they -/// are free to rotate about the point. The relative rotation about the shared -/// point is the joint angle. You can limit the relative rotation with -/// a joint limit that specifies a lower and upper angle. You can use a motor -/// to drive the relative rotation about the shared point. A maximum motor torque -/// is provided so that infinite forces are not generated. -class b2RevoluteJoint : public b2Joint -{ -public: - b2Vec2 GetAnchorA() const; - b2Vec2 GetAnchorB() const; - - /// The local anchor point relative to bodyA's origin. - const b2Vec2& GetLocalAnchorA() const { return m_localAnchorA; } - - /// The local anchor point relative to bodyB's origin. - const b2Vec2& GetLocalAnchorB() const { return m_localAnchorB; } - - /// Get the reference angle. - float32 GetReferenceAngle() const { return m_referenceAngle; } - - /// Get the current joint angle in radians. - float32 GetJointAngle() const; - - /// Get the current joint angle speed in radians per second. - float32 GetJointSpeed() const; - - /// Is the joint limit enabled? - bool IsLimitEnabled() const; - - /// Enable/disable the joint limit. - void EnableLimit(bool flag); - - /// Get the lower joint limit in radians. - float32 GetLowerLimit() const; - - /// Get the upper joint limit in radians. - float32 GetUpperLimit() const; - - /// Set the joint limits in radians. - void SetLimits(float32 lower, float32 upper); - - /// Is the joint motor enabled? - bool IsMotorEnabled() const; - - /// Enable/disable the joint motor. - void EnableMotor(bool flag); - - /// Set the motor speed in radians per second. - void SetMotorSpeed(float32 speed); - - /// Get the motor speed in radians per second. - float32 GetMotorSpeed() const; - - /// Set the maximum motor torque, usually in N-m. - void SetMaxMotorTorque(float32 torque); - float32 GetMaxMotorTorque() const { return m_maxMotorTorque; } - - /// Get the reaction force given the inverse time step. - /// Unit is N. - b2Vec2 GetReactionForce(float32 inv_dt) const; - - /// Get the reaction torque due to the joint limit given the inverse time step. - /// Unit is N*m. - float32 GetReactionTorque(float32 inv_dt) const; - - /// Get the current motor torque given the inverse time step. - /// Unit is N*m. - float32 GetMotorTorque(float32 inv_dt) const; - - /// Dump to b2Log. - void Dump(); - -protected: - - friend class b2Joint; - friend class b2GearJoint; - - b2RevoluteJoint(const b2RevoluteJointDef* def); - - void InitVelocityConstraints(const b2SolverData& data); - void SolveVelocityConstraints(const b2SolverData& data); - bool SolvePositionConstraints(const b2SolverData& data); - - // Solver shared - b2Vec2 m_localAnchorA; - b2Vec2 m_localAnchorB; - b2Vec3 m_impulse; - float32 m_motorImpulse; - - bool m_enableMotor; - float32 m_maxMotorTorque; - float32 m_motorSpeed; - - bool m_enableLimit; - float32 m_referenceAngle; - float32 m_lowerAngle; - float32 m_upperAngle; - - // Solver temp - int32 m_indexA; - int32 m_indexB; - b2Vec2 m_rA; - b2Vec2 m_rB; - b2Vec2 m_localCenterA; - b2Vec2 m_localCenterB; - float32 m_invMassA; - float32 m_invMassB; - float32 m_invIA; - float32 m_invIB; - b2Mat33 m_mass; // effective mass for point-to-point constraint. - float32 m_motorMass; // effective mass for motor/limit angular constraint. - b2LimitState m_limitState; -}; - -inline float32 b2RevoluteJoint::GetMotorSpeed() const -{ - return m_motorSpeed; -} - -#endif diff --git a/external/Box2D/Dynamics/Joints/b2RopeJoint.cpp b/external/Box2D/Dynamics/Joints/b2RopeJoint.cpp deleted file mode 100644 index 17a70d9230..0000000000 --- a/external/Box2D/Dynamics/Joints/b2RopeJoint.cpp +++ /dev/null @@ -1,241 +0,0 @@ -/* -* Copyright (c) 2007-2011 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include - - -// Limit: -// C = norm(pB - pA) - L -// u = (pB - pA) / norm(pB - pA) -// Cdot = dot(u, vB + cross(wB, rB) - vA - cross(wA, rA)) -// J = [-u -cross(rA, u) u cross(rB, u)] -// K = J * invM * JT -// = invMassA + invIA * cross(rA, u)^2 + invMassB + invIB * cross(rB, u)^2 - -b2RopeJoint::b2RopeJoint(const b2RopeJointDef* def) -: b2Joint(def) -{ - m_localAnchorA = def->localAnchorA; - m_localAnchorB = def->localAnchorB; - - m_maxLength = def->maxLength; - - m_mass = 0.0f; - m_impulse = 0.0f; - m_state = e_inactiveLimit; - m_length = 0.0f; -} - -void b2RopeJoint::InitVelocityConstraints(const b2SolverData& data) -{ - m_indexA = m_bodyA->m_islandIndex; - m_indexB = m_bodyB->m_islandIndex; - m_localCenterA = m_bodyA->m_sweep.localCenter; - m_localCenterB = m_bodyB->m_sweep.localCenter; - m_invMassA = m_bodyA->m_invMass; - m_invMassB = m_bodyB->m_invMass; - m_invIA = m_bodyA->m_invI; - m_invIB = m_bodyB->m_invI; - - b2Vec2 cA = data.positions[m_indexA].c; - float32 aA = data.positions[m_indexA].a; - b2Vec2 vA = data.velocities[m_indexA].v; - float32 wA = data.velocities[m_indexA].w; - - b2Vec2 cB = data.positions[m_indexB].c; - float32 aB = data.positions[m_indexB].a; - b2Vec2 vB = data.velocities[m_indexB].v; - float32 wB = data.velocities[m_indexB].w; - - b2Rot qA(aA), qB(aB); - - m_rA = b2Mul(qA, m_localAnchorA - m_localCenterA); - m_rB = b2Mul(qB, m_localAnchorB - m_localCenterB); - m_u = cB + m_rB - cA - m_rA; - - m_length = m_u.Length(); - - float32 C = m_length - m_maxLength; - if (C > 0.0f) - { - m_state = e_atUpperLimit; - } - else - { - m_state = e_inactiveLimit; - } - - if (m_length > b2_linearSlop) - { - m_u *= 1.0f / m_length; - } - else - { - m_u.SetZero(); - m_mass = 0.0f; - m_impulse = 0.0f; - return; - } - - // Compute effective mass. - float32 crA = b2Cross(m_rA, m_u); - float32 crB = b2Cross(m_rB, m_u); - float32 invMass = m_invMassA + m_invIA * crA * crA + m_invMassB + m_invIB * crB * crB; - - m_mass = invMass != 0.0f ? 1.0f / invMass : 0.0f; - - if (data.step.warmStarting) - { - // Scale the impulse to support a variable time step. - m_impulse *= data.step.dtRatio; - - b2Vec2 P = m_impulse * m_u; - vA -= m_invMassA * P; - wA -= m_invIA * b2Cross(m_rA, P); - vB += m_invMassB * P; - wB += m_invIB * b2Cross(m_rB, P); - } - else - { - m_impulse = 0.0f; - } - - data.velocities[m_indexA].v = vA; - data.velocities[m_indexA].w = wA; - data.velocities[m_indexB].v = vB; - data.velocities[m_indexB].w = wB; -} - -void b2RopeJoint::SolveVelocityConstraints(const b2SolverData& data) -{ - b2Vec2 vA = data.velocities[m_indexA].v; - float32 wA = data.velocities[m_indexA].w; - b2Vec2 vB = data.velocities[m_indexB].v; - float32 wB = data.velocities[m_indexB].w; - - // Cdot = dot(u, v + cross(w, r)) - b2Vec2 vpA = vA + b2Cross(wA, m_rA); - b2Vec2 vpB = vB + b2Cross(wB, m_rB); - float32 C = m_length - m_maxLength; - float32 Cdot = b2Dot(m_u, vpB - vpA); - - // Predictive constraint. - if (C < 0.0f) - { - Cdot += data.step.inv_dt * C; - } - - float32 impulse = -m_mass * Cdot; - float32 oldImpulse = m_impulse; - m_impulse = b2Min(0.0f, m_impulse + impulse); - impulse = m_impulse - oldImpulse; - - b2Vec2 P = impulse * m_u; - vA -= m_invMassA * P; - wA -= m_invIA * b2Cross(m_rA, P); - vB += m_invMassB * P; - wB += m_invIB * b2Cross(m_rB, P); - - data.velocities[m_indexA].v = vA; - data.velocities[m_indexA].w = wA; - data.velocities[m_indexB].v = vB; - data.velocities[m_indexB].w = wB; -} - -bool b2RopeJoint::SolvePositionConstraints(const b2SolverData& data) -{ - b2Vec2 cA = data.positions[m_indexA].c; - float32 aA = data.positions[m_indexA].a; - b2Vec2 cB = data.positions[m_indexB].c; - float32 aB = data.positions[m_indexB].a; - - b2Rot qA(aA), qB(aB); - - b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA); - b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB); - b2Vec2 u = cB + rB - cA - rA; - - float32 length = u.Normalize(); - float32 C = length - m_maxLength; - - C = b2Clamp(C, 0.0f, b2_maxLinearCorrection); - - float32 impulse = -m_mass * C; - b2Vec2 P = impulse * u; - - cA -= m_invMassA * P; - aA -= m_invIA * b2Cross(rA, P); - cB += m_invMassB * P; - aB += m_invIB * b2Cross(rB, P); - - data.positions[m_indexA].c = cA; - data.positions[m_indexA].a = aA; - data.positions[m_indexB].c = cB; - data.positions[m_indexB].a = aB; - - return length - m_maxLength < b2_linearSlop; -} - -b2Vec2 b2RopeJoint::GetAnchorA() const -{ - return m_bodyA->GetWorldPoint(m_localAnchorA); -} - -b2Vec2 b2RopeJoint::GetAnchorB() const -{ - return m_bodyB->GetWorldPoint(m_localAnchorB); -} - -b2Vec2 b2RopeJoint::GetReactionForce(float32 inv_dt) const -{ - b2Vec2 F = (inv_dt * m_impulse) * m_u; - return F; -} - -float32 b2RopeJoint::GetReactionTorque(float32 inv_dt) const -{ - B2_NOT_USED(inv_dt); - return 0.0f; -} - -float32 b2RopeJoint::GetMaxLength() const -{ - return m_maxLength; -} - -b2LimitState b2RopeJoint::GetLimitState() const -{ - return m_state; -} - -void b2RopeJoint::Dump() -{ - int32 indexA = m_bodyA->m_islandIndex; - int32 indexB = m_bodyB->m_islandIndex; - - b2Log(" b2RopeJointDef jd;\n"); - b2Log(" jd.bodyA = bodies[%d];\n", indexA); - b2Log(" jd.bodyB = bodies[%d];\n", indexB); - b2Log(" jd.collideConnected = bool(%d);\n", m_collideConnected); - b2Log(" jd.localAnchorA.Set(%.15lef, %.15lef);\n", m_localAnchorA.x, m_localAnchorA.y); - b2Log(" jd.localAnchorB.Set(%.15lef, %.15lef);\n", m_localAnchorB.x, m_localAnchorB.y); - b2Log(" jd.maxLength = %.15lef;\n", m_maxLength); - b2Log(" joints[%d] = m_world->CreateJoint(&jd);\n", m_index); -} diff --git a/external/Box2D/Dynamics/Joints/b2RopeJoint.h b/external/Box2D/Dynamics/Joints/b2RopeJoint.h deleted file mode 100644 index d7091b6650..0000000000 --- a/external/Box2D/Dynamics/Joints/b2RopeJoint.h +++ /dev/null @@ -1,114 +0,0 @@ -/* -* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_ROPE_JOINT_H -#define B2_ROPE_JOINT_H - -#include - -/// Rope joint definition. This requires two body anchor points and -/// a maximum lengths. -/// Note: by default the connected objects will not collide. -/// see collideConnected in b2JointDef. -struct b2RopeJointDef : public b2JointDef -{ - b2RopeJointDef() - { - type = e_ropeJoint; - localAnchorA.Set(-1.0f, 0.0f); - localAnchorB.Set(1.0f, 0.0f); - maxLength = 0.0f; - } - - /// The local anchor point relative to bodyA's origin. - b2Vec2 localAnchorA; - - /// The local anchor point relative to bodyB's origin. - b2Vec2 localAnchorB; - - /// The maximum length of the rope. - /// Warning: this must be larger than b2_linearSlop or - /// the joint will have no effect. - float32 maxLength; -}; - -/// A rope joint enforces a maximum distance between two points -/// on two bodies. It has no other effect. -/// Warning: if you attempt to change the maximum length during -/// the simulation you will get some non-physical behavior. -/// A model that would allow you to dynamically modify the length -/// would have some sponginess, so I chose not to implement it -/// that way. See b2DistanceJoint if you want to dynamically -/// control length. -class b2RopeJoint : public b2Joint -{ -public: - b2Vec2 GetAnchorA() const; - b2Vec2 GetAnchorB() const; - - b2Vec2 GetReactionForce(float32 inv_dt) const; - float32 GetReactionTorque(float32 inv_dt) const; - - /// The local anchor point relative to bodyA's origin. - const b2Vec2& GetLocalAnchorA() const { return m_localAnchorA; } - - /// The local anchor point relative to bodyB's origin. - const b2Vec2& GetLocalAnchorB() const { return m_localAnchorB; } - - /// Set/Get the maximum length of the rope. - void SetMaxLength(float32 length) { m_maxLength = length; } - float32 GetMaxLength() const; - - b2LimitState GetLimitState() const; - - /// Dump joint to dmLog - void Dump(); - -protected: - - friend class b2Joint; - b2RopeJoint(const b2RopeJointDef* data); - - void InitVelocityConstraints(const b2SolverData& data); - void SolveVelocityConstraints(const b2SolverData& data); - bool SolvePositionConstraints(const b2SolverData& data); - - // Solver shared - b2Vec2 m_localAnchorA; - b2Vec2 m_localAnchorB; - float32 m_maxLength; - float32 m_length; - float32 m_impulse; - - // Solver temp - int32 m_indexA; - int32 m_indexB; - b2Vec2 m_u; - b2Vec2 m_rA; - b2Vec2 m_rB; - b2Vec2 m_localCenterA; - b2Vec2 m_localCenterB; - float32 m_invMassA; - float32 m_invMassB; - float32 m_invIA; - float32 m_invIB; - float32 m_mass; - b2LimitState m_state; -}; - -#endif diff --git a/external/Box2D/Dynamics/Joints/b2WeldJoint.cpp b/external/Box2D/Dynamics/Joints/b2WeldJoint.cpp deleted file mode 100644 index f50bdd6587..0000000000 --- a/external/Box2D/Dynamics/Joints/b2WeldJoint.cpp +++ /dev/null @@ -1,330 +0,0 @@ -/* -* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include - -// Point-to-point constraint -// C = p2 - p1 -// Cdot = v2 - v1 -// = v2 + cross(w2, r2) - v1 - cross(w1, r1) -// J = [-I -r1_skew I r2_skew ] -// Identity used: -// w k % (rx i + ry j) = w * (-ry i + rx j) - -// Angle constraint -// C = angle2 - angle1 - referenceAngle -// Cdot = w2 - w1 -// J = [0 0 -1 0 0 1] -// K = invI1 + invI2 - -void b2WeldJointDef::Initialize(b2Body* bA, b2Body* bB, const b2Vec2& anchor) -{ - bodyA = bA; - bodyB = bB; - localAnchorA = bodyA->GetLocalPoint(anchor); - localAnchorB = bodyB->GetLocalPoint(anchor); - referenceAngle = bodyB->GetAngle() - bodyA->GetAngle(); -} - -b2WeldJoint::b2WeldJoint(const b2WeldJointDef* def) -: b2Joint(def) -{ - m_localAnchorA = def->localAnchorA; - m_localAnchorB = def->localAnchorB; - m_referenceAngle = def->referenceAngle; - m_frequencyHz = def->frequencyHz; - m_dampingRatio = def->dampingRatio; - - m_impulse.SetZero(); -} - -void b2WeldJoint::InitVelocityConstraints(const b2SolverData& data) -{ - m_indexA = m_bodyA->m_islandIndex; - m_indexB = m_bodyB->m_islandIndex; - m_localCenterA = m_bodyA->m_sweep.localCenter; - m_localCenterB = m_bodyB->m_sweep.localCenter; - m_invMassA = m_bodyA->m_invMass; - m_invMassB = m_bodyB->m_invMass; - m_invIA = m_bodyA->m_invI; - m_invIB = m_bodyB->m_invI; - - b2Vec2 cA = data.positions[m_indexA].c; - float32 aA = data.positions[m_indexA].a; - b2Vec2 vA = data.velocities[m_indexA].v; - float32 wA = data.velocities[m_indexA].w; - - b2Vec2 cB = data.positions[m_indexB].c; - float32 aB = data.positions[m_indexB].a; - b2Vec2 vB = data.velocities[m_indexB].v; - float32 wB = data.velocities[m_indexB].w; - - b2Rot qA(aA), qB(aB); - - m_rA = b2Mul(qA, m_localAnchorA - m_localCenterA); - m_rB = b2Mul(qB, m_localAnchorB - m_localCenterB); - - // J = [-I -r1_skew I r2_skew] - // [ 0 -1 0 1] - // r_skew = [-ry; rx] - - // Matlab - // K = [ mA+r1y^2*iA+mB+r2y^2*iB, -r1y*iA*r1x-r2y*iB*r2x, -r1y*iA-r2y*iB] - // [ -r1y*iA*r1x-r2y*iB*r2x, mA+r1x^2*iA+mB+r2x^2*iB, r1x*iA+r2x*iB] - // [ -r1y*iA-r2y*iB, r1x*iA+r2x*iB, iA+iB] - - float32 mA = m_invMassA, mB = m_invMassB; - float32 iA = m_invIA, iB = m_invIB; - - b2Mat33 K; - K.ex.x = mA + mB + m_rA.y * m_rA.y * iA + m_rB.y * m_rB.y * iB; - K.ey.x = -m_rA.y * m_rA.x * iA - m_rB.y * m_rB.x * iB; - K.ez.x = -m_rA.y * iA - m_rB.y * iB; - K.ex.y = K.ey.x; - K.ey.y = mA + mB + m_rA.x * m_rA.x * iA + m_rB.x * m_rB.x * iB; - K.ez.y = m_rA.x * iA + m_rB.x * iB; - K.ex.z = K.ez.x; - K.ey.z = K.ez.y; - K.ez.z = iA + iB; - - if (m_frequencyHz > 0.0f) - { - K.GetInverse22(&m_mass); - - float32 invM = iA + iB; - float32 m = invM > 0.0f ? 1.0f / invM : 0.0f; - - float32 C = aB - aA - m_referenceAngle; - - // Frequency - float32 omega = 2.0f * b2_pi * m_frequencyHz; - - // Damping coefficient - float32 d = 2.0f * m * m_dampingRatio * omega; - - // Spring stiffness - float32 k = m * omega * omega; - - // magic formulas - float32 h = data.step.dt; - m_gamma = h * (d + h * k); - m_gamma = m_gamma != 0.0f ? 1.0f / m_gamma : 0.0f; - m_bias = C * h * k * m_gamma; - - invM += m_gamma; - m_mass.ez.z = invM != 0.0f ? 1.0f / invM : 0.0f; - } - else - { - K.GetSymInverse33(&m_mass); - m_gamma = 0.0f; - m_bias = 0.0f; - } - - if (data.step.warmStarting) - { - // Scale impulses to support a variable time step. - m_impulse *= data.step.dtRatio; - - b2Vec2 P(m_impulse.x, m_impulse.y); - - vA -= mA * P; - wA -= iA * (b2Cross(m_rA, P) + m_impulse.z); - - vB += mB * P; - wB += iB * (b2Cross(m_rB, P) + m_impulse.z); - } - else - { - m_impulse.SetZero(); - } - - data.velocities[m_indexA].v = vA; - data.velocities[m_indexA].w = wA; - data.velocities[m_indexB].v = vB; - data.velocities[m_indexB].w = wB; -} - -void b2WeldJoint::SolveVelocityConstraints(const b2SolverData& data) -{ - b2Vec2 vA = data.velocities[m_indexA].v; - float32 wA = data.velocities[m_indexA].w; - b2Vec2 vB = data.velocities[m_indexB].v; - float32 wB = data.velocities[m_indexB].w; - - float32 mA = m_invMassA, mB = m_invMassB; - float32 iA = m_invIA, iB = m_invIB; - - if (m_frequencyHz > 0.0f) - { - float32 Cdot2 = wB - wA; - - float32 impulse2 = -m_mass.ez.z * (Cdot2 + m_bias + m_gamma * m_impulse.z); - m_impulse.z += impulse2; - - wA -= iA * impulse2; - wB += iB * impulse2; - - b2Vec2 Cdot1 = vB + b2Cross(wB, m_rB) - vA - b2Cross(wA, m_rA); - - b2Vec2 impulse1 = -b2Mul22(m_mass, Cdot1); - m_impulse.x += impulse1.x; - m_impulse.y += impulse1.y; - - b2Vec2 P = impulse1; - - vA -= mA * P; - wA -= iA * b2Cross(m_rA, P); - - vB += mB * P; - wB += iB * b2Cross(m_rB, P); - } - else - { - b2Vec2 Cdot1 = vB + b2Cross(wB, m_rB) - vA - b2Cross(wA, m_rA); - float32 Cdot2 = wB - wA; - b2Vec3 Cdot(Cdot1.x, Cdot1.y, Cdot2); - - b2Vec3 impulse = -b2Mul(m_mass, Cdot); - m_impulse += impulse; - - b2Vec2 P(impulse.x, impulse.y); - - vA -= mA * P; - wA -= iA * (b2Cross(m_rA, P) + impulse.z); - - vB += mB * P; - wB += iB * (b2Cross(m_rB, P) + impulse.z); - } - - data.velocities[m_indexA].v = vA; - data.velocities[m_indexA].w = wA; - data.velocities[m_indexB].v = vB; - data.velocities[m_indexB].w = wB; -} - -bool b2WeldJoint::SolvePositionConstraints(const b2SolverData& data) -{ - b2Vec2 cA = data.positions[m_indexA].c; - float32 aA = data.positions[m_indexA].a; - b2Vec2 cB = data.positions[m_indexB].c; - float32 aB = data.positions[m_indexB].a; - - b2Rot qA(aA), qB(aB); - - float32 mA = m_invMassA, mB = m_invMassB; - float32 iA = m_invIA, iB = m_invIB; - - b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA); - b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB); - - float32 positionError, angularError; - - b2Mat33 K; - K.ex.x = mA + mB + rA.y * rA.y * iA + rB.y * rB.y * iB; - K.ey.x = -rA.y * rA.x * iA - rB.y * rB.x * iB; - K.ez.x = -rA.y * iA - rB.y * iB; - K.ex.y = K.ey.x; - K.ey.y = mA + mB + rA.x * rA.x * iA + rB.x * rB.x * iB; - K.ez.y = rA.x * iA + rB.x * iB; - K.ex.z = K.ez.x; - K.ey.z = K.ez.y; - K.ez.z = iA + iB; - - if (m_frequencyHz > 0.0f) - { - b2Vec2 C1 = cB + rB - cA - rA; - - positionError = C1.Length(); - angularError = 0.0f; - - b2Vec2 P = -K.Solve22(C1); - - cA -= mA * P; - aA -= iA * b2Cross(rA, P); - - cB += mB * P; - aB += iB * b2Cross(rB, P); - } - else - { - b2Vec2 C1 = cB + rB - cA - rA; - float32 C2 = aB - aA - m_referenceAngle; - - positionError = C1.Length(); - angularError = b2Abs(C2); - - b2Vec3 C(C1.x, C1.y, C2); - - b2Vec3 impulse = -K.Solve33(C); - b2Vec2 P(impulse.x, impulse.y); - - cA -= mA * P; - aA -= iA * (b2Cross(rA, P) + impulse.z); - - cB += mB * P; - aB += iB * (b2Cross(rB, P) + impulse.z); - } - - data.positions[m_indexA].c = cA; - data.positions[m_indexA].a = aA; - data.positions[m_indexB].c = cB; - data.positions[m_indexB].a = aB; - - return positionError <= b2_linearSlop && angularError <= b2_angularSlop; -} - -b2Vec2 b2WeldJoint::GetAnchorA() const -{ - return m_bodyA->GetWorldPoint(m_localAnchorA); -} - -b2Vec2 b2WeldJoint::GetAnchorB() const -{ - return m_bodyB->GetWorldPoint(m_localAnchorB); -} - -b2Vec2 b2WeldJoint::GetReactionForce(float32 inv_dt) const -{ - b2Vec2 P(m_impulse.x, m_impulse.y); - return inv_dt * P; -} - -float32 b2WeldJoint::GetReactionTorque(float32 inv_dt) const -{ - return inv_dt * m_impulse.z; -} - -void b2WeldJoint::Dump() -{ - int32 indexA = m_bodyA->m_islandIndex; - int32 indexB = m_bodyB->m_islandIndex; - - b2Log(" b2WeldJointDef jd;\n"); - b2Log(" jd.bodyA = bodies[%d];\n", indexA); - b2Log(" jd.bodyB = bodies[%d];\n", indexB); - b2Log(" jd.collideConnected = bool(%d);\n", m_collideConnected); - b2Log(" jd.localAnchorA.Set(%.15lef, %.15lef);\n", m_localAnchorA.x, m_localAnchorA.y); - b2Log(" jd.localAnchorB.Set(%.15lef, %.15lef);\n", m_localAnchorB.x, m_localAnchorB.y); - b2Log(" jd.referenceAngle = %.15lef;\n", m_referenceAngle); - b2Log(" jd.frequencyHz = %.15lef;\n", m_frequencyHz); - b2Log(" jd.dampingRatio = %.15lef;\n", m_dampingRatio); - b2Log(" joints[%d] = m_world->CreateJoint(&jd);\n", m_index); -} diff --git a/external/Box2D/Dynamics/Joints/b2WeldJoint.h b/external/Box2D/Dynamics/Joints/b2WeldJoint.h deleted file mode 100644 index 751c6a8770..0000000000 --- a/external/Box2D/Dynamics/Joints/b2WeldJoint.h +++ /dev/null @@ -1,126 +0,0 @@ -/* -* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_WELD_JOINT_H -#define B2_WELD_JOINT_H - -#include - -/// Weld joint definition. You need to specify local anchor points -/// where they are attached and the relative body angle. The position -/// of the anchor points is important for computing the reaction torque. -struct b2WeldJointDef : public b2JointDef -{ - b2WeldJointDef() - { - type = e_weldJoint; - localAnchorA.Set(0.0f, 0.0f); - localAnchorB.Set(0.0f, 0.0f); - referenceAngle = 0.0f; - frequencyHz = 0.0f; - dampingRatio = 0.0f; - } - - /// Initialize the bodies, anchors, and reference angle using a world - /// anchor point. - void Initialize(b2Body* bodyA, b2Body* bodyB, const b2Vec2& anchor); - - /// The local anchor point relative to bodyA's origin. - b2Vec2 localAnchorA; - - /// The local anchor point relative to bodyB's origin. - b2Vec2 localAnchorB; - - /// The bodyB angle minus bodyA angle in the reference state (radians). - float32 referenceAngle; - - /// The mass-spring-damper frequency in Hertz. Rotation only. - /// Disable softness with a value of 0. - float32 frequencyHz; - - /// The damping ratio. 0 = no damping, 1 = critical damping. - float32 dampingRatio; -}; - -/// A weld joint essentially glues two bodies together. A weld joint may -/// distort somewhat because the island constraint solver is approximate. -class b2WeldJoint : public b2Joint -{ -public: - b2Vec2 GetAnchorA() const; - b2Vec2 GetAnchorB() const; - - b2Vec2 GetReactionForce(float32 inv_dt) const; - float32 GetReactionTorque(float32 inv_dt) const; - - /// The local anchor point relative to bodyA's origin. - const b2Vec2& GetLocalAnchorA() const { return m_localAnchorA; } - - /// The local anchor point relative to bodyB's origin. - const b2Vec2& GetLocalAnchorB() const { return m_localAnchorB; } - - /// Get the reference angle. - float32 GetReferenceAngle() const { return m_referenceAngle; } - - /// Set/get frequency in Hz. - void SetFrequency(float32 hz) { m_frequencyHz = hz; } - float32 GetFrequency() const { return m_frequencyHz; } - - /// Set/get damping ratio. - void SetDampingRatio(float32 ratio) { m_dampingRatio = ratio; } - float32 GetDampingRatio() const { return m_dampingRatio; } - - /// Dump to b2Log - void Dump(); - -protected: - - friend class b2Joint; - - b2WeldJoint(const b2WeldJointDef* def); - - void InitVelocityConstraints(const b2SolverData& data); - void SolveVelocityConstraints(const b2SolverData& data); - bool SolvePositionConstraints(const b2SolverData& data); - - float32 m_frequencyHz; - float32 m_dampingRatio; - float32 m_bias; - - // Solver shared - b2Vec2 m_localAnchorA; - b2Vec2 m_localAnchorB; - float32 m_referenceAngle; - float32 m_gamma; - b2Vec3 m_impulse; - - // Solver temp - int32 m_indexA; - int32 m_indexB; - b2Vec2 m_rA; - b2Vec2 m_rB; - b2Vec2 m_localCenterA; - b2Vec2 m_localCenterB; - float32 m_invMassA; - float32 m_invMassB; - float32 m_invIA; - float32 m_invIB; - b2Mat33 m_mass; -}; - -#endif diff --git a/external/Box2D/Dynamics/Joints/b2WheelJoint.cpp b/external/Box2D/Dynamics/Joints/b2WheelJoint.cpp deleted file mode 100644 index 6253437706..0000000000 --- a/external/Box2D/Dynamics/Joints/b2WheelJoint.cpp +++ /dev/null @@ -1,419 +0,0 @@ -/* -* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include - -// Linear constraint (point-to-line) -// d = pB - pA = xB + rB - xA - rA -// C = dot(ay, d) -// Cdot = dot(d, cross(wA, ay)) + dot(ay, vB + cross(wB, rB) - vA - cross(wA, rA)) -// = -dot(ay, vA) - dot(cross(d + rA, ay), wA) + dot(ay, vB) + dot(cross(rB, ay), vB) -// J = [-ay, -cross(d + rA, ay), ay, cross(rB, ay)] - -// Spring linear constraint -// C = dot(ax, d) -// Cdot = = -dot(ax, vA) - dot(cross(d + rA, ax), wA) + dot(ax, vB) + dot(cross(rB, ax), vB) -// J = [-ax -cross(d+rA, ax) ax cross(rB, ax)] - -// Motor rotational constraint -// Cdot = wB - wA -// J = [0 0 -1 0 0 1] - -void b2WheelJointDef::Initialize(b2Body* bA, b2Body* bB, const b2Vec2& anchor, const b2Vec2& axis) -{ - bodyA = bA; - bodyB = bB; - localAnchorA = bodyA->GetLocalPoint(anchor); - localAnchorB = bodyB->GetLocalPoint(anchor); - localAxisA = bodyA->GetLocalVector(axis); -} - -b2WheelJoint::b2WheelJoint(const b2WheelJointDef* def) -: b2Joint(def) -{ - m_localAnchorA = def->localAnchorA; - m_localAnchorB = def->localAnchorB; - m_localXAxisA = def->localAxisA; - m_localYAxisA = b2Cross(1.0f, m_localXAxisA); - - m_mass = 0.0f; - m_impulse = 0.0f; - m_motorMass = 0.0; - m_motorImpulse = 0.0f; - m_springMass = 0.0f; - m_springImpulse = 0.0f; - - m_maxMotorTorque = def->maxMotorTorque; - m_motorSpeed = def->motorSpeed; - m_enableMotor = def->enableMotor; - - m_frequencyHz = def->frequencyHz; - m_dampingRatio = def->dampingRatio; - - m_bias = 0.0f; - m_gamma = 0.0f; - - m_ax.SetZero(); - m_ay.SetZero(); -} - -void b2WheelJoint::InitVelocityConstraints(const b2SolverData& data) -{ - m_indexA = m_bodyA->m_islandIndex; - m_indexB = m_bodyB->m_islandIndex; - m_localCenterA = m_bodyA->m_sweep.localCenter; - m_localCenterB = m_bodyB->m_sweep.localCenter; - m_invMassA = m_bodyA->m_invMass; - m_invMassB = m_bodyB->m_invMass; - m_invIA = m_bodyA->m_invI; - m_invIB = m_bodyB->m_invI; - - float32 mA = m_invMassA, mB = m_invMassB; - float32 iA = m_invIA, iB = m_invIB; - - b2Vec2 cA = data.positions[m_indexA].c; - float32 aA = data.positions[m_indexA].a; - b2Vec2 vA = data.velocities[m_indexA].v; - float32 wA = data.velocities[m_indexA].w; - - b2Vec2 cB = data.positions[m_indexB].c; - float32 aB = data.positions[m_indexB].a; - b2Vec2 vB = data.velocities[m_indexB].v; - float32 wB = data.velocities[m_indexB].w; - - b2Rot qA(aA), qB(aB); - - // Compute the effective masses. - b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA); - b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB); - b2Vec2 d = cB + rB - cA - rA; - - // Point to line constraint - { - m_ay = b2Mul(qA, m_localYAxisA); - m_sAy = b2Cross(d + rA, m_ay); - m_sBy = b2Cross(rB, m_ay); - - m_mass = mA + mB + iA * m_sAy * m_sAy + iB * m_sBy * m_sBy; - - if (m_mass > 0.0f) - { - m_mass = 1.0f / m_mass; - } - } - - // Spring constraint - m_springMass = 0.0f; - m_bias = 0.0f; - m_gamma = 0.0f; - if (m_frequencyHz > 0.0f) - { - m_ax = b2Mul(qA, m_localXAxisA); - m_sAx = b2Cross(d + rA, m_ax); - m_sBx = b2Cross(rB, m_ax); - - float32 invMass = mA + mB + iA * m_sAx * m_sAx + iB * m_sBx * m_sBx; - - if (invMass > 0.0f) - { - m_springMass = 1.0f / invMass; - - float32 C = b2Dot(d, m_ax); - - // Frequency - float32 omega = 2.0f * b2_pi * m_frequencyHz; - - // Damping coefficient - float32 d = 2.0f * m_springMass * m_dampingRatio * omega; - - // Spring stiffness - float32 k = m_springMass * omega * omega; - - // magic formulas - float32 h = data.step.dt; - m_gamma = h * (d + h * k); - if (m_gamma > 0.0f) - { - m_gamma = 1.0f / m_gamma; - } - - m_bias = C * h * k * m_gamma; - - m_springMass = invMass + m_gamma; - if (m_springMass > 0.0f) - { - m_springMass = 1.0f / m_springMass; - } - } - } - else - { - m_springImpulse = 0.0f; - } - - // Rotational motor - if (m_enableMotor) - { - m_motorMass = iA + iB; - if (m_motorMass > 0.0f) - { - m_motorMass = 1.0f / m_motorMass; - } - } - else - { - m_motorMass = 0.0f; - m_motorImpulse = 0.0f; - } - - if (data.step.warmStarting) - { - // Account for variable time step. - m_impulse *= data.step.dtRatio; - m_springImpulse *= data.step.dtRatio; - m_motorImpulse *= data.step.dtRatio; - - b2Vec2 P = m_impulse * m_ay + m_springImpulse * m_ax; - float32 LA = m_impulse * m_sAy + m_springImpulse * m_sAx + m_motorImpulse; - float32 LB = m_impulse * m_sBy + m_springImpulse * m_sBx + m_motorImpulse; - - vA -= m_invMassA * P; - wA -= m_invIA * LA; - - vB += m_invMassB * P; - wB += m_invIB * LB; - } - else - { - m_impulse = 0.0f; - m_springImpulse = 0.0f; - m_motorImpulse = 0.0f; - } - - data.velocities[m_indexA].v = vA; - data.velocities[m_indexA].w = wA; - data.velocities[m_indexB].v = vB; - data.velocities[m_indexB].w = wB; -} - -void b2WheelJoint::SolveVelocityConstraints(const b2SolverData& data) -{ - float32 mA = m_invMassA, mB = m_invMassB; - float32 iA = m_invIA, iB = m_invIB; - - b2Vec2 vA = data.velocities[m_indexA].v; - float32 wA = data.velocities[m_indexA].w; - b2Vec2 vB = data.velocities[m_indexB].v; - float32 wB = data.velocities[m_indexB].w; - - // Solve spring constraint - { - float32 Cdot = b2Dot(m_ax, vB - vA) + m_sBx * wB - m_sAx * wA; - float32 impulse = -m_springMass * (Cdot + m_bias + m_gamma * m_springImpulse); - m_springImpulse += impulse; - - b2Vec2 P = impulse * m_ax; - float32 LA = impulse * m_sAx; - float32 LB = impulse * m_sBx; - - vA -= mA * P; - wA -= iA * LA; - - vB += mB * P; - wB += iB * LB; - } - - // Solve rotational motor constraint - { - float32 Cdot = wB - wA - m_motorSpeed; - float32 impulse = -m_motorMass * Cdot; - - float32 oldImpulse = m_motorImpulse; - float32 maxImpulse = data.step.dt * m_maxMotorTorque; - m_motorImpulse = b2Clamp(m_motorImpulse + impulse, -maxImpulse, maxImpulse); - impulse = m_motorImpulse - oldImpulse; - - wA -= iA * impulse; - wB += iB * impulse; - } - - // Solve point to line constraint - { - float32 Cdot = b2Dot(m_ay, vB - vA) + m_sBy * wB - m_sAy * wA; - float32 impulse = -m_mass * Cdot; - m_impulse += impulse; - - b2Vec2 P = impulse * m_ay; - float32 LA = impulse * m_sAy; - float32 LB = impulse * m_sBy; - - vA -= mA * P; - wA -= iA * LA; - - vB += mB * P; - wB += iB * LB; - } - - data.velocities[m_indexA].v = vA; - data.velocities[m_indexA].w = wA; - data.velocities[m_indexB].v = vB; - data.velocities[m_indexB].w = wB; -} - -bool b2WheelJoint::SolvePositionConstraints(const b2SolverData& data) -{ - b2Vec2 cA = data.positions[m_indexA].c; - float32 aA = data.positions[m_indexA].a; - b2Vec2 cB = data.positions[m_indexB].c; - float32 aB = data.positions[m_indexB].a; - - b2Rot qA(aA), qB(aB); - - b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA); - b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB); - b2Vec2 d = (cB - cA) + rB - rA; - - b2Vec2 ay = b2Mul(qA, m_localYAxisA); - - float32 sAy = b2Cross(d + rA, ay); - float32 sBy = b2Cross(rB, ay); - - float32 C = b2Dot(d, ay); - - float32 k = m_invMassA + m_invMassB + m_invIA * m_sAy * m_sAy + m_invIB * m_sBy * m_sBy; - - float32 impulse; - if (k != 0.0f) - { - impulse = - C / k; - } - else - { - impulse = 0.0f; - } - - b2Vec2 P = impulse * ay; - float32 LA = impulse * sAy; - float32 LB = impulse * sBy; - - cA -= m_invMassA * P; - aA -= m_invIA * LA; - cB += m_invMassB * P; - aB += m_invIB * LB; - - data.positions[m_indexA].c = cA; - data.positions[m_indexA].a = aA; - data.positions[m_indexB].c = cB; - data.positions[m_indexB].a = aB; - - return b2Abs(C) <= b2_linearSlop; -} - -b2Vec2 b2WheelJoint::GetAnchorA() const -{ - return m_bodyA->GetWorldPoint(m_localAnchorA); -} - -b2Vec2 b2WheelJoint::GetAnchorB() const -{ - return m_bodyB->GetWorldPoint(m_localAnchorB); -} - -b2Vec2 b2WheelJoint::GetReactionForce(float32 inv_dt) const -{ - return inv_dt * (m_impulse * m_ay + m_springImpulse * m_ax); -} - -float32 b2WheelJoint::GetReactionTorque(float32 inv_dt) const -{ - return inv_dt * m_motorImpulse; -} - -float32 b2WheelJoint::GetJointTranslation() const -{ - b2Body* bA = m_bodyA; - b2Body* bB = m_bodyB; - - b2Vec2 pA = bA->GetWorldPoint(m_localAnchorA); - b2Vec2 pB = bB->GetWorldPoint(m_localAnchorB); - b2Vec2 d = pB - pA; - b2Vec2 axis = bA->GetWorldVector(m_localXAxisA); - - float32 translation = b2Dot(d, axis); - return translation; -} - -float32 b2WheelJoint::GetJointSpeed() const -{ - float32 wA = m_bodyA->m_angularVelocity; - float32 wB = m_bodyB->m_angularVelocity; - return wB - wA; -} - -bool b2WheelJoint::IsMotorEnabled() const -{ - return m_enableMotor; -} - -void b2WheelJoint::EnableMotor(bool flag) -{ - m_bodyA->SetAwake(true); - m_bodyB->SetAwake(true); - m_enableMotor = flag; -} - -void b2WheelJoint::SetMotorSpeed(float32 speed) -{ - m_bodyA->SetAwake(true); - m_bodyB->SetAwake(true); - m_motorSpeed = speed; -} - -void b2WheelJoint::SetMaxMotorTorque(float32 torque) -{ - m_bodyA->SetAwake(true); - m_bodyB->SetAwake(true); - m_maxMotorTorque = torque; -} - -float32 b2WheelJoint::GetMotorTorque(float32 inv_dt) const -{ - return inv_dt * m_motorImpulse; -} - -void b2WheelJoint::Dump() -{ - int32 indexA = m_bodyA->m_islandIndex; - int32 indexB = m_bodyB->m_islandIndex; - - b2Log(" b2WheelJointDef jd;\n"); - b2Log(" jd.bodyA = bodies[%d];\n", indexA); - b2Log(" jd.bodyB = bodies[%d];\n", indexB); - b2Log(" jd.collideConnected = bool(%d);\n", m_collideConnected); - b2Log(" jd.localAnchorA.Set(%.15lef, %.15lef);\n", m_localAnchorA.x, m_localAnchorA.y); - b2Log(" jd.localAnchorB.Set(%.15lef, %.15lef);\n", m_localAnchorB.x, m_localAnchorB.y); - b2Log(" jd.localAxisA.Set(%.15lef, %.15lef);\n", m_localXAxisA.x, m_localXAxisA.y); - b2Log(" jd.enableMotor = bool(%d);\n", m_enableMotor); - b2Log(" jd.motorSpeed = %.15lef;\n", m_motorSpeed); - b2Log(" jd.maxMotorTorque = %.15lef;\n", m_maxMotorTorque); - b2Log(" jd.frequencyHz = %.15lef;\n", m_frequencyHz); - b2Log(" jd.dampingRatio = %.15lef;\n", m_dampingRatio); - b2Log(" joints[%d] = m_world->CreateJoint(&jd);\n", m_index); -} diff --git a/external/Box2D/Dynamics/Joints/b2WheelJoint.h b/external/Box2D/Dynamics/Joints/b2WheelJoint.h deleted file mode 100644 index ede1b08b7c..0000000000 --- a/external/Box2D/Dynamics/Joints/b2WheelJoint.h +++ /dev/null @@ -1,213 +0,0 @@ -/* -* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_WHEEL_JOINT_H -#define B2_WHEEL_JOINT_H - -#include - -/// Wheel joint definition. This requires defining a line of -/// motion using an axis and an anchor point. The definition uses local -/// anchor points and a local axis so that the initial configuration -/// can violate the constraint slightly. The joint translation is zero -/// when the local anchor points coincide in world space. Using local -/// anchors and a local axis helps when saving and loading a game. -struct b2WheelJointDef : public b2JointDef -{ - b2WheelJointDef() - { - type = e_wheelJoint; - localAnchorA.SetZero(); - localAnchorB.SetZero(); - localAxisA.Set(1.0f, 0.0f); - enableMotor = false; - maxMotorTorque = 0.0f; - motorSpeed = 0.0f; - frequencyHz = 2.0f; - dampingRatio = 0.7f; - } - - /// Initialize the bodies, anchors, axis, and reference angle using the world - /// anchor and world axis. - void Initialize(b2Body* bodyA, b2Body* bodyB, const b2Vec2& anchor, const b2Vec2& axis); - - /// The local anchor point relative to bodyA's origin. - b2Vec2 localAnchorA; - - /// The local anchor point relative to bodyB's origin. - b2Vec2 localAnchorB; - - /// The local translation axis in bodyA. - b2Vec2 localAxisA; - - /// Enable/disable the joint motor. - bool enableMotor; - - /// The maximum motor torque, usually in N-m. - float32 maxMotorTorque; - - /// The desired motor speed in radians per second. - float32 motorSpeed; - - /// Suspension frequency, zero indicates no suspension - float32 frequencyHz; - - /// Suspension damping ratio, one indicates critical damping - float32 dampingRatio; -}; - -/// A wheel joint. This joint provides two degrees of freedom: translation -/// along an axis fixed in bodyA and rotation in the plane. You can use a -/// joint limit to restrict the range of motion and a joint motor to drive -/// the rotation or to model rotational friction. -/// This joint is designed for vehicle suspensions. -class b2WheelJoint : public b2Joint -{ -public: - void GetDefinition(b2WheelJointDef* def) const; - - b2Vec2 GetAnchorA() const; - b2Vec2 GetAnchorB() const; - - b2Vec2 GetReactionForce(float32 inv_dt) const; - float32 GetReactionTorque(float32 inv_dt) const; - - /// The local anchor point relative to bodyA's origin. - const b2Vec2& GetLocalAnchorA() const { return m_localAnchorA; } - - /// The local anchor point relative to bodyB's origin. - const b2Vec2& GetLocalAnchorB() const { return m_localAnchorB; } - - /// The local joint axis relative to bodyA. - const b2Vec2& GetLocalAxisA() const { return m_localXAxisA; } - - /// Get the current joint translation, usually in meters. - float32 GetJointTranslation() const; - - /// Get the current joint translation speed, usually in meters per second. - float32 GetJointSpeed() const; - - /// Is the joint motor enabled? - bool IsMotorEnabled() const; - - /// Enable/disable the joint motor. - void EnableMotor(bool flag); - - /// Set the motor speed, usually in radians per second. - void SetMotorSpeed(float32 speed); - - /// Get the motor speed, usually in radians per second. - float32 GetMotorSpeed() const; - - /// Set/Get the maximum motor force, usually in N-m. - void SetMaxMotorTorque(float32 torque); - float32 GetMaxMotorTorque() const; - - /// Get the current motor torque given the inverse time step, usually in N-m. - float32 GetMotorTorque(float32 inv_dt) const; - - /// Set/Get the spring frequency in hertz. Setting the frequency to zero disables the spring. - void SetSpringFrequencyHz(float32 hz); - float32 GetSpringFrequencyHz() const; - - /// Set/Get the spring damping ratio - void SetSpringDampingRatio(float32 ratio); - float32 GetSpringDampingRatio() const; - - /// Dump to b2Log - void Dump(); - -protected: - - friend class b2Joint; - b2WheelJoint(const b2WheelJointDef* def); - - void InitVelocityConstraints(const b2SolverData& data); - void SolveVelocityConstraints(const b2SolverData& data); - bool SolvePositionConstraints(const b2SolverData& data); - - float32 m_frequencyHz; - float32 m_dampingRatio; - - // Solver shared - b2Vec2 m_localAnchorA; - b2Vec2 m_localAnchorB; - b2Vec2 m_localXAxisA; - b2Vec2 m_localYAxisA; - - float32 m_impulse; - float32 m_motorImpulse; - float32 m_springImpulse; - - float32 m_maxMotorTorque; - float32 m_motorSpeed; - bool m_enableMotor; - - // Solver temp - int32 m_indexA; - int32 m_indexB; - b2Vec2 m_localCenterA; - b2Vec2 m_localCenterB; - float32 m_invMassA; - float32 m_invMassB; - float32 m_invIA; - float32 m_invIB; - - b2Vec2 m_ax, m_ay; - float32 m_sAx, m_sBx; - float32 m_sAy, m_sBy; - - float32 m_mass; - float32 m_motorMass; - float32 m_springMass; - - float32 m_bias; - float32 m_gamma; -}; - -inline float32 b2WheelJoint::GetMotorSpeed() const -{ - return m_motorSpeed; -} - -inline float32 b2WheelJoint::GetMaxMotorTorque() const -{ - return m_maxMotorTorque; -} - -inline void b2WheelJoint::SetSpringFrequencyHz(float32 hz) -{ - m_frequencyHz = hz; -} - -inline float32 b2WheelJoint::GetSpringFrequencyHz() const -{ - return m_frequencyHz; -} - -inline void b2WheelJoint::SetSpringDampingRatio(float32 ratio) -{ - m_dampingRatio = ratio; -} - -inline float32 b2WheelJoint::GetSpringDampingRatio() const -{ - return m_dampingRatio; -} - -#endif diff --git a/external/Box2D/Dynamics/b2Body.cpp b/external/Box2D/Dynamics/b2Body.cpp deleted file mode 100644 index b22b574023..0000000000 --- a/external/Box2D/Dynamics/b2Body.cpp +++ /dev/null @@ -1,514 +0,0 @@ -/* -* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include -#include -#include - -b2Body::b2Body(const b2BodyDef* bd, b2World* world) -{ - b2Assert(bd->position.IsValid()); - b2Assert(bd->linearVelocity.IsValid()); - b2Assert(b2IsValid(bd->angle)); - b2Assert(b2IsValid(bd->angularVelocity)); - b2Assert(b2IsValid(bd->angularDamping) && bd->angularDamping >= 0.0f); - b2Assert(b2IsValid(bd->linearDamping) && bd->linearDamping >= 0.0f); - - m_flags = 0; - - if (bd->bullet) - { - m_flags |= e_bulletFlag; - } - if (bd->fixedRotation) - { - m_flags |= e_fixedRotationFlag; - } - if (bd->allowSleep) - { - m_flags |= e_autoSleepFlag; - } - if (bd->awake) - { - m_flags |= e_awakeFlag; - } - if (bd->active) - { - m_flags |= e_activeFlag; - } - - m_world = world; - - m_xf.p = bd->position; - m_xf.q.Set(bd->angle); - - m_sweep.localCenter.SetZero(); - m_sweep.c0 = m_xf.p; - m_sweep.c = m_xf.p; - m_sweep.a0 = bd->angle; - m_sweep.a = bd->angle; - m_sweep.alpha0 = 0.0f; - - m_jointList = NULL; - m_contactList = NULL; - m_prev = NULL; - m_next = NULL; - - m_linearVelocity = bd->linearVelocity; - m_angularVelocity = bd->angularVelocity; - - m_linearDamping = bd->linearDamping; - m_angularDamping = bd->angularDamping; - m_gravityScale = bd->gravityScale; - - m_force.SetZero(); - m_torque = 0.0f; - - m_sleepTime = 0.0f; - - m_type = bd->type; - - if (m_type == b2_dynamicBody) - { - m_mass = 1.0f; - m_invMass = 1.0f; - } - else - { - m_mass = 0.0f; - m_invMass = 0.0f; - } - - m_I = 0.0f; - m_invI = 0.0f; - - m_userData = bd->userData; - - m_fixtureList = NULL; - m_fixtureCount = 0; -} - -b2Body::~b2Body() -{ - // shapes and joints are destroyed in b2World::Destroy -} - -void b2Body::SetType(b2BodyType type) -{ - b2Assert(m_world->IsLocked() == false); - if (m_world->IsLocked() == true) - { - return; - } - - if (m_type == type) - { - return; - } - - m_type = type; - - ResetMassData(); - - if (m_type == b2_staticBody) - { - m_linearVelocity.SetZero(); - m_angularVelocity = 0.0f; - m_sweep.a0 = m_sweep.a; - m_sweep.c0 = m_sweep.c; - SynchronizeFixtures(); - } - - SetAwake(true); - - m_force.SetZero(); - m_torque = 0.0f; - - // Since the body type changed, we need to flag contacts for filtering. - for (b2Fixture* f = m_fixtureList; f; f = f->m_next) - { - f->Refilter(); - } -} - -b2Fixture* b2Body::CreateFixture(const b2FixtureDef* def) -{ - b2Assert(m_world->IsLocked() == false); - if (m_world->IsLocked() == true) - { - return NULL; - } - - b2BlockAllocator* allocator = &m_world->m_blockAllocator; - - void* memory = allocator->Allocate(sizeof(b2Fixture)); - b2Fixture* fixture = new (memory) b2Fixture; - fixture->Create(allocator, this, def); - - if (m_flags & e_activeFlag) - { - b2BroadPhase* broadPhase = &m_world->m_contactManager.m_broadPhase; - fixture->CreateProxies(broadPhase, m_xf); - } - - fixture->m_next = m_fixtureList; - m_fixtureList = fixture; - ++m_fixtureCount; - - fixture->m_body = this; - - // Adjust mass properties if needed. - if (fixture->m_density > 0.0f) - { - ResetMassData(); - } - - // Let the world know we have a new fixture. This will cause new contacts - // to be created at the beginning of the next time step. - m_world->m_flags |= b2World::e_newFixture; - - return fixture; -} - -b2Fixture* b2Body::CreateFixture(const b2Shape* shape, float32 density) -{ - b2FixtureDef def; - def.shape = shape; - def.density = density; - - return CreateFixture(&def); -} - -void b2Body::DestroyFixture(b2Fixture* fixture) -{ - b2Assert(m_world->IsLocked() == false); - if (m_world->IsLocked() == true) - { - return; - } - - b2Assert(fixture->m_body == this); - - // Remove the fixture from this body's singly linked list. - b2Assert(m_fixtureCount > 0); - b2Fixture** node = &m_fixtureList; - bool found = false; - while (*node != NULL) - { - if (*node == fixture) - { - *node = fixture->m_next; - found = true; - break; - } - - node = &(*node)->m_next; - } - - // You tried to remove a shape that is not attached to this body. - b2Assert(found); - - // Destroy any contacts associated with the fixture. - b2ContactEdge* edge = m_contactList; - while (edge) - { - b2Contact* c = edge->contact; - edge = edge->next; - - b2Fixture* fixtureA = c->GetFixtureA(); - b2Fixture* fixtureB = c->GetFixtureB(); - - if (fixture == fixtureA || fixture == fixtureB) - { - // This destroys the contact and removes it from - // this body's contact list. - m_world->m_contactManager.Destroy(c); - } - } - - b2BlockAllocator* allocator = &m_world->m_blockAllocator; - - if (m_flags & e_activeFlag) - { - b2BroadPhase* broadPhase = &m_world->m_contactManager.m_broadPhase; - fixture->DestroyProxies(broadPhase); - } - - fixture->Destroy(allocator); - fixture->m_body = NULL; - fixture->m_next = NULL; - fixture->~b2Fixture(); - allocator->Free(fixture, sizeof(b2Fixture)); - - --m_fixtureCount; - - // Reset the mass data. - ResetMassData(); -} - -void b2Body::ResetMassData() -{ - // Compute mass data from shapes. Each shape has its own density. - m_mass = 0.0f; - m_invMass = 0.0f; - m_I = 0.0f; - m_invI = 0.0f; - m_sweep.localCenter.SetZero(); - - // Static and kinematic bodies have zero mass. - if (m_type == b2_staticBody || m_type == b2_kinematicBody) - { - m_sweep.c0 = m_xf.p; - m_sweep.c = m_xf.p; - m_sweep.a0 = m_sweep.a; - return; - } - - b2Assert(m_type == b2_dynamicBody); - - // Accumulate mass over all fixtures. - b2Vec2 localCenter = b2Vec2_zero; - for (b2Fixture* f = m_fixtureList; f; f = f->m_next) - { - if (f->m_density == 0.0f) - { - continue; - } - - b2MassData massData; - f->GetMassData(&massData); - m_mass += massData.mass; - localCenter += massData.mass * massData.center; - m_I += massData.I; - } - - // Compute center of mass. - if (m_mass > 0.0f) - { - m_invMass = 1.0f / m_mass; - localCenter *= m_invMass; - } - else - { - // Force all dynamic bodies to have a positive mass. - m_mass = 1.0f; - m_invMass = 1.0f; - } - - if (m_I > 0.0f && (m_flags & e_fixedRotationFlag) == 0) - { - // Center the inertia about the center of mass. - m_I -= m_mass * b2Dot(localCenter, localCenter); - b2Assert(m_I > 0.0f); - m_invI = 1.0f / m_I; - - } - else - { - m_I = 0.0f; - m_invI = 0.0f; - } - - // Move center of mass. - b2Vec2 oldCenter = m_sweep.c; - m_sweep.localCenter = localCenter; - m_sweep.c0 = m_sweep.c = b2Mul(m_xf, m_sweep.localCenter); - - // Update center of mass velocity. - m_linearVelocity += b2Cross(m_angularVelocity, m_sweep.c - oldCenter); -} - -void b2Body::SetMassData(const b2MassData* massData) -{ - b2Assert(m_world->IsLocked() == false); - if (m_world->IsLocked() == true) - { - return; - } - - if (m_type != b2_dynamicBody) - { - return; - } - - m_invMass = 0.0f; - m_I = 0.0f; - m_invI = 0.0f; - - m_mass = massData->mass; - if (m_mass <= 0.0f) - { - m_mass = 1.0f; - } - - m_invMass = 1.0f / m_mass; - - if (massData->I > 0.0f && (m_flags & b2Body::e_fixedRotationFlag) == 0) - { - m_I = massData->I - m_mass * b2Dot(massData->center, massData->center); - b2Assert(m_I > 0.0f); - m_invI = 1.0f / m_I; - } - - // Move center of mass. - b2Vec2 oldCenter = m_sweep.c; - m_sweep.localCenter = massData->center; - m_sweep.c0 = m_sweep.c = b2Mul(m_xf, m_sweep.localCenter); - - // Update center of mass velocity. - m_linearVelocity += b2Cross(m_angularVelocity, m_sweep.c - oldCenter); -} - -bool b2Body::ShouldCollide(const b2Body* other) const -{ - // At least one body should be dynamic. - if (m_type != b2_dynamicBody && other->m_type != b2_dynamicBody) - { - return false; - } - - // Does a joint prevent collision? - for (b2JointEdge* jn = m_jointList; jn; jn = jn->next) - { - if (jn->other == other) - { - if (jn->joint->m_collideConnected == false) - { - return false; - } - } - } - - return true; -} - -void b2Body::SetTransform(const b2Vec2& position, float32 angle) -{ - b2Assert(m_world->IsLocked() == false); - if (m_world->IsLocked() == true) - { - return; - } - - m_xf.q.Set(angle); - m_xf.p = position; - - m_sweep.c = b2Mul(m_xf, m_sweep.localCenter); - m_sweep.a = angle; - - m_sweep.c0 = m_sweep.c; - m_sweep.a0 = angle; - - b2BroadPhase* broadPhase = &m_world->m_contactManager.m_broadPhase; - for (b2Fixture* f = m_fixtureList; f; f = f->m_next) - { - f->Synchronize(broadPhase, m_xf, m_xf); - } - - m_world->m_contactManager.FindNewContacts(); -} - -void b2Body::SynchronizeFixtures() -{ - b2Transform xf1; - xf1.q.Set(m_sweep.a0); - xf1.p = m_sweep.c0 - b2Mul(xf1.q, m_sweep.localCenter); - - b2BroadPhase* broadPhase = &m_world->m_contactManager.m_broadPhase; - for (b2Fixture* f = m_fixtureList; f; f = f->m_next) - { - f->Synchronize(broadPhase, xf1, m_xf); - } -} - -void b2Body::SetActive(bool flag) -{ - b2Assert(m_world->IsLocked() == false); - - if (flag == IsActive()) - { - return; - } - - if (flag) - { - m_flags |= e_activeFlag; - - // Create all proxies. - b2BroadPhase* broadPhase = &m_world->m_contactManager.m_broadPhase; - for (b2Fixture* f = m_fixtureList; f; f = f->m_next) - { - f->CreateProxies(broadPhase, m_xf); - } - - // Contacts are created the next time step. - } - else - { - m_flags &= ~e_activeFlag; - - // Destroy all proxies. - b2BroadPhase* broadPhase = &m_world->m_contactManager.m_broadPhase; - for (b2Fixture* f = m_fixtureList; f; f = f->m_next) - { - f->DestroyProxies(broadPhase); - } - - // Destroy the attached contacts. - b2ContactEdge* ce = m_contactList; - while (ce) - { - b2ContactEdge* ce0 = ce; - ce = ce->next; - m_world->m_contactManager.Destroy(ce0->contact); - } - m_contactList = NULL; - } -} - -void b2Body::Dump() -{ - int32 bodyIndex = m_islandIndex; - - b2Log("{\n"); - b2Log(" b2BodyDef bd;\n"); - b2Log(" bd.type = b2BodyType(%d);\n", m_type); - b2Log(" bd.position.Set(%.15lef, %.15lef);\n", m_xf.p.x, m_xf.p.y); - b2Log(" bd.angle = %.15lef;\n", m_sweep.a); - b2Log(" bd.linearVelocity.Set(%.15lef, %.15lef);\n", m_linearVelocity.x, m_linearVelocity.y); - b2Log(" bd.angularVelocity = %.15lef;\n", m_angularVelocity); - b2Log(" bd.linearDamping = %.15lef;\n", m_linearDamping); - b2Log(" bd.angularDamping = %.15lef;\n", m_angularDamping); - b2Log(" bd.allowSleep = bool(%d);\n", m_flags & e_autoSleepFlag); - b2Log(" bd.awake = bool(%d);\n", m_flags & e_awakeFlag); - b2Log(" bd.fixedRotation = bool(%d);\n", m_flags & e_fixedRotationFlag); - b2Log(" bd.bullet = bool(%d);\n", m_flags & e_bulletFlag); - b2Log(" bd.active = bool(%d);\n", m_flags & e_activeFlag); - b2Log(" bd.gravityScale = %.15lef;\n", m_gravityScale); - b2Log(" bodies[%d] = m_world->CreateBody(&bd);\n", m_islandIndex); - b2Log("\n"); - for (b2Fixture* f = m_fixtureList; f; f = f->m_next) - { - b2Log(" {\n"); - f->Dump(bodyIndex); - b2Log(" }\n"); - } - b2Log("}\n"); -} \ No newline at end of file diff --git a/external/Box2D/Dynamics/b2Body.h b/external/Box2D/Dynamics/b2Body.h deleted file mode 100644 index e2d16bf630..0000000000 --- a/external/Box2D/Dynamics/b2Body.h +++ /dev/null @@ -1,846 +0,0 @@ -/* -* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_BODY_H -#define B2_BODY_H - -#include -#include -#include - -class b2Fixture; -class b2Joint; -class b2Contact; -class b2Controller; -class b2World; -struct b2FixtureDef; -struct b2JointEdge; -struct b2ContactEdge; - -/// The body type. -/// static: zero mass, zero velocity, may be manually moved -/// kinematic: zero mass, non-zero velocity set by user, moved by solver -/// dynamic: positive mass, non-zero velocity determined by forces, moved by solver -enum b2BodyType -{ - b2_staticBody = 0, - b2_kinematicBody, - b2_dynamicBody - - // TODO_ERIN - //b2_bulletBody, -}; - -/// A body definition holds all the data needed to construct a rigid body. -/// You can safely re-use body definitions. Shapes are added to a body after construction. -struct b2BodyDef -{ - /// This constructor sets the body definition default values. - b2BodyDef() - { - userData = NULL; - position.Set(0.0f, 0.0f); - angle = 0.0f; - linearVelocity.Set(0.0f, 0.0f); - angularVelocity = 0.0f; - linearDamping = 0.0f; - angularDamping = 0.0f; - allowSleep = true; - awake = true; - fixedRotation = false; - bullet = false; - type = b2_staticBody; - active = true; - gravityScale = 1.0f; - } - - /// The body type: static, kinematic, or dynamic. - /// Note: if a dynamic body would have zero mass, the mass is set to one. - b2BodyType type; - - /// The world position of the body. Avoid creating bodies at the origin - /// since this can lead to many overlapping shapes. - b2Vec2 position; - - /// The world angle of the body in radians. - float32 angle; - - /// The linear velocity of the body's origin in world co-ordinates. - b2Vec2 linearVelocity; - - /// The angular velocity of the body. - float32 angularVelocity; - - /// Linear damping is use to reduce the linear velocity. The damping parameter - /// can be larger than 1.0f but the damping effect becomes sensitive to the - /// time step when the damping parameter is large. - float32 linearDamping; - - /// Angular damping is use to reduce the angular velocity. The damping parameter - /// can be larger than 1.0f but the damping effect becomes sensitive to the - /// time step when the damping parameter is large. - float32 angularDamping; - - /// Set this flag to false if this body should never fall asleep. Note that - /// this increases CPU usage. - bool allowSleep; - - /// Is this body initially awake or sleeping? - bool awake; - - /// Should this body be prevented from rotating? Useful for characters. - bool fixedRotation; - - /// Is this a fast moving body that should be prevented from tunneling through - /// other moving bodies? Note that all bodies are prevented from tunneling through - /// kinematic and static bodies. This setting is only considered on dynamic bodies. - /// @warning You should use this flag sparingly since it increases processing time. - bool bullet; - - /// Does this body start out active? - bool active; - - /// Use this to store application specific body data. - void* userData; - - /// Scale the gravity applied to this body. - float32 gravityScale; -}; - -/// A rigid body. These are created via b2World::CreateBody. -class b2Body -{ -public: - /// Creates a fixture and attach it to this body. Use this function if you need - /// to set some fixture parameters, like friction. Otherwise you can create the - /// fixture directly from a shape. - /// If the density is non-zero, this function automatically updates the mass of the body. - /// Contacts are not created until the next time step. - /// @param def the fixture definition. - /// @warning This function is locked during callbacks. - b2Fixture* CreateFixture(const b2FixtureDef* def); - - /// Creates a fixture from a shape and attach it to this body. - /// This is a convenience function. Use b2FixtureDef if you need to set parameters - /// like friction, restitution, user data, or filtering. - /// If the density is non-zero, this function automatically updates the mass of the body. - /// @param shape the shape to be cloned. - /// @param density the shape density (set to zero for static bodies). - /// @warning This function is locked during callbacks. - b2Fixture* CreateFixture(const b2Shape* shape, float32 density); - - /// Destroy a fixture. This removes the fixture from the broad-phase and - /// destroys all contacts associated with this fixture. This will - /// automatically adjust the mass of the body if the body is dynamic and the - /// fixture has positive density. - /// All fixtures attached to a body are implicitly destroyed when the body is destroyed. - /// @param fixture the fixture to be removed. - /// @warning This function is locked during callbacks. - void DestroyFixture(b2Fixture* fixture); - - /// Set the position of the body's origin and rotation. - /// This breaks any contacts and wakes the other bodies. - /// Manipulating a body's transform may cause non-physical behavior. - /// @param position the world position of the body's local origin. - /// @param angle the world rotation in radians. - void SetTransform(const b2Vec2& position, float32 angle); - - /// Get the body transform for the body's origin. - /// @return the world transform of the body's origin. - const b2Transform& GetTransform() const; - - /// Get the world body origin position. - /// @return the world position of the body's origin. - const b2Vec2& GetPosition() const; - - /// Get the angle in radians. - /// @return the current world rotation angle in radians. - float32 GetAngle() const; - - /// Get the world position of the center of mass. - const b2Vec2& GetWorldCenter() const; - - /// Get the local position of the center of mass. - const b2Vec2& GetLocalCenter() const; - - /// Set the linear velocity of the center of mass. - /// @param v the new linear velocity of the center of mass. - void SetLinearVelocity(const b2Vec2& v); - - /// Get the linear velocity of the center of mass. - /// @return the linear velocity of the center of mass. - b2Vec2 GetLinearVelocity() const; - - /// Set the angular velocity. - /// @param omega the new angular velocity in radians/second. - void SetAngularVelocity(float32 omega); - - /// Get the angular velocity. - /// @return the angular velocity in radians/second. - float32 GetAngularVelocity() const; - - /// Apply a force at a world point. If the force is not - /// applied at the center of mass, it will generate a torque and - /// affect the angular velocity. This wakes up the body. - /// @param force the world force vector, usually in Newtons (N). - /// @param point the world position of the point of application. - void ApplyForce(const b2Vec2& force, const b2Vec2& point); - - /// Apply a force to the center of mass. This wakes up the body. - /// @param force the world force vector, usually in Newtons (N). - void ApplyForceToCenter(const b2Vec2& force); - - /// Apply a torque. This affects the angular velocity - /// without affecting the linear velocity of the center of mass. - /// This wakes up the body. - /// @param torque about the z-axis (out of the screen), usually in N-m. - void ApplyTorque(float32 torque); - - /// Apply an impulse at a point. This immediately modifies the velocity. - /// It also modifies the angular velocity if the point of application - /// is not at the center of mass. This wakes up the body. - /// @param impulse the world impulse vector, usually in N-seconds or kg-m/s. - /// @param point the world position of the point of application. - void ApplyLinearImpulse(const b2Vec2& impulse, const b2Vec2& point); - - /// Apply an angular impulse. - /// @param impulse the angular impulse in units of kg*m*m/s - void ApplyAngularImpulse(float32 impulse); - - /// Get the total mass of the body. - /// @return the mass, usually in kilograms (kg). - float32 GetMass() const; - - /// Get the rotational inertia of the body about the local origin. - /// @return the rotational inertia, usually in kg-m^2. - float32 GetInertia() const; - - /// Get the mass data of the body. - /// @return a struct containing the mass, inertia and center of the body. - void GetMassData(b2MassData* data) const; - - /// Set the mass properties to override the mass properties of the fixtures. - /// Note that this changes the center of mass position. - /// Note that creating or destroying fixtures can also alter the mass. - /// This function has no effect if the body isn't dynamic. - /// @param massData the mass properties. - void SetMassData(const b2MassData* data); - - /// This resets the mass properties to the sum of the mass properties of the fixtures. - /// This normally does not need to be called unless you called SetMassData to override - /// the mass and you later want to reset the mass. - void ResetMassData(); - - /// Get the world coordinates of a point given the local coordinates. - /// @param localPoint a point on the body measured relative the the body's origin. - /// @return the same point expressed in world coordinates. - b2Vec2 GetWorldPoint(const b2Vec2& localPoint) const; - - /// Get the world coordinates of a vector given the local coordinates. - /// @param localVector a vector fixed in the body. - /// @return the same vector expressed in world coordinates. - b2Vec2 GetWorldVector(const b2Vec2& localVector) const; - - /// Gets a local point relative to the body's origin given a world point. - /// @param a point in world coordinates. - /// @return the corresponding local point relative to the body's origin. - b2Vec2 GetLocalPoint(const b2Vec2& worldPoint) const; - - /// Gets a local vector given a world vector. - /// @param a vector in world coordinates. - /// @return the corresponding local vector. - b2Vec2 GetLocalVector(const b2Vec2& worldVector) const; - - /// Get the world linear velocity of a world point attached to this body. - /// @param a point in world coordinates. - /// @return the world velocity of a point. - b2Vec2 GetLinearVelocityFromWorldPoint(const b2Vec2& worldPoint) const; - - /// Get the world velocity of a local point. - /// @param a point in local coordinates. - /// @return the world velocity of a point. - b2Vec2 GetLinearVelocityFromLocalPoint(const b2Vec2& localPoint) const; - - /// Get the linear damping of the body. - float32 GetLinearDamping() const; - - /// Set the linear damping of the body. - void SetLinearDamping(float32 linearDamping); - - /// Get the angular damping of the body. - float32 GetAngularDamping() const; - - /// Set the angular damping of the body. - void SetAngularDamping(float32 angularDamping); - - /// Get the gravity scale of the body. - float32 GetGravityScale() const; - - /// Set the gravity scale of the body. - void SetGravityScale(float32 scale); - - /// Set the type of this body. This may alter the mass and velocity. - void SetType(b2BodyType type); - - /// Get the type of this body. - b2BodyType GetType() const; - - /// Should this body be treated like a bullet for continuous collision detection? - void SetBullet(bool flag); - - /// Is this body treated like a bullet for continuous collision detection? - bool IsBullet() const; - - /// You can disable sleeping on this body. If you disable sleeping, the - /// body will be woken. - void SetSleepingAllowed(bool flag); - - /// Is this body allowed to sleep - bool IsSleepingAllowed() const; - - /// Set the sleep state of the body. A sleeping body has very - /// low CPU cost. - /// @param flag set to true to put body to sleep, false to wake it. - void SetAwake(bool flag); - - /// Get the sleeping state of this body. - /// @return true if the body is sleeping. - bool IsAwake() const; - - /// Set the active state of the body. An inactive body is not - /// simulated and cannot be collided with or woken up. - /// If you pass a flag of true, all fixtures will be added to the - /// broad-phase. - /// If you pass a flag of false, all fixtures will be removed from - /// the broad-phase and all contacts will be destroyed. - /// Fixtures and joints are otherwise unaffected. You may continue - /// to create/destroy fixtures and joints on inactive bodies. - /// Fixtures on an inactive body are implicitly inactive and will - /// not participate in collisions, ray-casts, or queries. - /// Joints connected to an inactive body are implicitly inactive. - /// An inactive body is still owned by a b2World object and remains - /// in the body list. - void SetActive(bool flag); - - /// Get the active state of the body. - bool IsActive() const; - - /// Set this body to have fixed rotation. This causes the mass - /// to be reset. - void SetFixedRotation(bool flag); - - /// Does this body have fixed rotation? - bool IsFixedRotation() const; - - /// Get the list of all fixtures attached to this body. - b2Fixture* GetFixtureList(); - const b2Fixture* GetFixtureList() const; - - /// Get the list of all joints attached to this body. - b2JointEdge* GetJointList(); - const b2JointEdge* GetJointList() const; - - /// Get the list of all contacts attached to this body. - /// @warning this list changes during the time step and you may - /// miss some collisions if you don't use b2ContactListener. - b2ContactEdge* GetContactList(); - const b2ContactEdge* GetContactList() const; - - /// Get the next body in the world's body list. - b2Body* GetNext(); - const b2Body* GetNext() const; - - /// Get the user data pointer that was provided in the body definition. - void* GetUserData() const; - - /// Set the user data. Use this to store your application specific data. - void SetUserData(void* data); - - /// Get the parent world of this body. - b2World* GetWorld(); - const b2World* GetWorld() const; - - /// Dump this body to a log file - void Dump(); - -private: - - friend class b2World; - friend class b2Island; - friend class b2ContactManager; - friend class b2ContactSolver; - friend class b2Contact; - - friend class b2DistanceJoint; - friend class b2GearJoint; - friend class b2WheelJoint; - friend class b2MouseJoint; - friend class b2PrismaticJoint; - friend class b2PulleyJoint; - friend class b2RevoluteJoint; - friend class b2WeldJoint; - friend class b2FrictionJoint; - friend class b2RopeJoint; - - // m_flags - enum - { - e_islandFlag = 0x0001, - e_awakeFlag = 0x0002, - e_autoSleepFlag = 0x0004, - e_bulletFlag = 0x0008, - e_fixedRotationFlag = 0x0010, - e_activeFlag = 0x0020, - e_toiFlag = 0x0040 - }; - - b2Body(const b2BodyDef* bd, b2World* world); - ~b2Body(); - - void SynchronizeFixtures(); - void SynchronizeTransform(); - - // This is used to prevent connected bodies from colliding. - // It may lie, depending on the collideConnected flag. - bool ShouldCollide(const b2Body* other) const; - - void Advance(float32 t); - - b2BodyType m_type; - - uint16 m_flags; - - int32 m_islandIndex; - - b2Transform m_xf; // the body origin transform - b2Sweep m_sweep; // the swept motion for CCD - - b2Vec2 m_linearVelocity; - float32 m_angularVelocity; - - b2Vec2 m_force; - float32 m_torque; - - b2World* m_world; - b2Body* m_prev; - b2Body* m_next; - - b2Fixture* m_fixtureList; - int32 m_fixtureCount; - - b2JointEdge* m_jointList; - b2ContactEdge* m_contactList; - - float32 m_mass, m_invMass; - - // Rotational inertia about the center of mass. - float32 m_I, m_invI; - - float32 m_linearDamping; - float32 m_angularDamping; - float32 m_gravityScale; - - float32 m_sleepTime; - - void* m_userData; -}; - -inline b2BodyType b2Body::GetType() const -{ - return m_type; -} - -inline const b2Transform& b2Body::GetTransform() const -{ - return m_xf; -} - -inline const b2Vec2& b2Body::GetPosition() const -{ - return m_xf.p; -} - -inline float32 b2Body::GetAngle() const -{ - return m_sweep.a; -} - -inline const b2Vec2& b2Body::GetWorldCenter() const -{ - return m_sweep.c; -} - -inline const b2Vec2& b2Body::GetLocalCenter() const -{ - return m_sweep.localCenter; -} - -inline void b2Body::SetLinearVelocity(const b2Vec2& v) -{ - if (m_type == b2_staticBody) - { - return; - } - - if (b2Dot(v,v) > 0.0f) - { - SetAwake(true); - } - - m_linearVelocity = v; -} - -inline b2Vec2 b2Body::GetLinearVelocity() const -{ - return m_linearVelocity; -} - -inline void b2Body::SetAngularVelocity(float32 w) -{ - if (m_type == b2_staticBody) - { - return; - } - - if (w * w > 0.0f) - { - SetAwake(true); - } - - m_angularVelocity = w; -} - -inline float32 b2Body::GetAngularVelocity() const -{ - return m_angularVelocity; -} - -inline float32 b2Body::GetMass() const -{ - return m_mass; -} - -inline float32 b2Body::GetInertia() const -{ - return m_I + m_mass * b2Dot(m_sweep.localCenter, m_sweep.localCenter); -} - -inline void b2Body::GetMassData(b2MassData* data) const -{ - data->mass = m_mass; - data->I = m_I + m_mass * b2Dot(m_sweep.localCenter, m_sweep.localCenter); - data->center = m_sweep.localCenter; -} - -inline b2Vec2 b2Body::GetWorldPoint(const b2Vec2& localPoint) const -{ - return b2Mul(m_xf, localPoint); -} - -inline b2Vec2 b2Body::GetWorldVector(const b2Vec2& localVector) const -{ - return b2Mul(m_xf.q, localVector); -} - -inline b2Vec2 b2Body::GetLocalPoint(const b2Vec2& worldPoint) const -{ - return b2MulT(m_xf, worldPoint); -} - -inline b2Vec2 b2Body::GetLocalVector(const b2Vec2& worldVector) const -{ - return b2MulT(m_xf.q, worldVector); -} - -inline b2Vec2 b2Body::GetLinearVelocityFromWorldPoint(const b2Vec2& worldPoint) const -{ - return m_linearVelocity + b2Cross(m_angularVelocity, worldPoint - m_sweep.c); -} - -inline b2Vec2 b2Body::GetLinearVelocityFromLocalPoint(const b2Vec2& localPoint) const -{ - return GetLinearVelocityFromWorldPoint(GetWorldPoint(localPoint)); -} - -inline float32 b2Body::GetLinearDamping() const -{ - return m_linearDamping; -} - -inline void b2Body::SetLinearDamping(float32 linearDamping) -{ - m_linearDamping = linearDamping; -} - -inline float32 b2Body::GetAngularDamping() const -{ - return m_angularDamping; -} - -inline void b2Body::SetAngularDamping(float32 angularDamping) -{ - m_angularDamping = angularDamping; -} - -inline float32 b2Body::GetGravityScale() const -{ - return m_gravityScale; -} - -inline void b2Body::SetGravityScale(float32 scale) -{ - m_gravityScale = scale; -} - -inline void b2Body::SetBullet(bool flag) -{ - if (flag) - { - m_flags |= e_bulletFlag; - } - else - { - m_flags &= ~e_bulletFlag; - } -} - -inline bool b2Body::IsBullet() const -{ - return (m_flags & e_bulletFlag) == e_bulletFlag; -} - -inline void b2Body::SetAwake(bool flag) -{ - if (flag) - { - if ((m_flags & e_awakeFlag) == 0) - { - m_flags |= e_awakeFlag; - m_sleepTime = 0.0f; - } - } - else - { - m_flags &= ~e_awakeFlag; - m_sleepTime = 0.0f; - m_linearVelocity.SetZero(); - m_angularVelocity = 0.0f; - m_force.SetZero(); - m_torque = 0.0f; - } -} - -inline bool b2Body::IsAwake() const -{ - return (m_flags & e_awakeFlag) == e_awakeFlag; -} - -inline bool b2Body::IsActive() const -{ - return (m_flags & e_activeFlag) == e_activeFlag; -} - -inline void b2Body::SetFixedRotation(bool flag) -{ - if (flag) - { - m_flags |= e_fixedRotationFlag; - } - else - { - m_flags &= ~e_fixedRotationFlag; - } - - ResetMassData(); -} - -inline bool b2Body::IsFixedRotation() const -{ - return (m_flags & e_fixedRotationFlag) == e_fixedRotationFlag; -} - -inline void b2Body::SetSleepingAllowed(bool flag) -{ - if (flag) - { - m_flags |= e_autoSleepFlag; - } - else - { - m_flags &= ~e_autoSleepFlag; - SetAwake(true); - } -} - -inline bool b2Body::IsSleepingAllowed() const -{ - return (m_flags & e_autoSleepFlag) == e_autoSleepFlag; -} - -inline b2Fixture* b2Body::GetFixtureList() -{ - return m_fixtureList; -} - -inline const b2Fixture* b2Body::GetFixtureList() const -{ - return m_fixtureList; -} - -inline b2JointEdge* b2Body::GetJointList() -{ - return m_jointList; -} - -inline const b2JointEdge* b2Body::GetJointList() const -{ - return m_jointList; -} - -inline b2ContactEdge* b2Body::GetContactList() -{ - return m_contactList; -} - -inline const b2ContactEdge* b2Body::GetContactList() const -{ - return m_contactList; -} - -inline b2Body* b2Body::GetNext() -{ - return m_next; -} - -inline const b2Body* b2Body::GetNext() const -{ - return m_next; -} - -inline void b2Body::SetUserData(void* data) -{ - m_userData = data; -} - -inline void* b2Body::GetUserData() const -{ - return m_userData; -} - -inline void b2Body::ApplyForce(const b2Vec2& force, const b2Vec2& point) -{ - if (m_type != b2_dynamicBody) - { - return; - } - - if (IsAwake() == false) - { - SetAwake(true); - } - - m_force += force; - m_torque += b2Cross(point - m_sweep.c, force); -} - -inline void b2Body::ApplyForceToCenter(const b2Vec2& force) -{ - if (m_type != b2_dynamicBody) - { - return; - } - - if (IsAwake() == false) - { - SetAwake(true); - } - - m_force += force; -} - -inline void b2Body::ApplyTorque(float32 torque) -{ - if (m_type != b2_dynamicBody) - { - return; - } - - if (IsAwake() == false) - { - SetAwake(true); - } - - m_torque += torque; -} - -inline void b2Body::ApplyLinearImpulse(const b2Vec2& impulse, const b2Vec2& point) -{ - if (m_type != b2_dynamicBody) - { - return; - } - - if (IsAwake() == false) - { - SetAwake(true); - } - m_linearVelocity += m_invMass * impulse; - m_angularVelocity += m_invI * b2Cross(point - m_sweep.c, impulse); -} - -inline void b2Body::ApplyAngularImpulse(float32 impulse) -{ - if (m_type != b2_dynamicBody) - { - return; - } - - if (IsAwake() == false) - { - SetAwake(true); - } - m_angularVelocity += m_invI * impulse; -} - -inline void b2Body::SynchronizeTransform() -{ - m_xf.q.Set(m_sweep.a); - m_xf.p = m_sweep.c - b2Mul(m_xf.q, m_sweep.localCenter); -} - -inline void b2Body::Advance(float32 alpha) -{ - // Advance to the new safe time. This doesn't sync the broad-phase. - m_sweep.Advance(alpha); - m_sweep.c = m_sweep.c0; - m_sweep.a = m_sweep.a0; - m_xf.q.Set(m_sweep.a); - m_xf.p = m_sweep.c - b2Mul(m_xf.q, m_sweep.localCenter); -} - -inline b2World* b2Body::GetWorld() -{ - return m_world; -} - -inline const b2World* b2Body::GetWorld() const -{ - return m_world; -} - -#endif diff --git a/external/Box2D/Dynamics/b2ContactManager.cpp b/external/Box2D/Dynamics/b2ContactManager.cpp deleted file mode 100644 index c14cc4ce45..0000000000 --- a/external/Box2D/Dynamics/b2ContactManager.cpp +++ /dev/null @@ -1,293 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include -#include -#include - -b2ContactFilter b2_defaultFilter; -b2ContactListener b2_defaultListener; - -b2ContactManager::b2ContactManager() -{ - m_contactList = NULL; - m_contactCount = 0; - m_contactFilter = &b2_defaultFilter; - m_contactListener = &b2_defaultListener; - m_allocator = NULL; -} - -void b2ContactManager::Destroy(b2Contact* c) -{ - b2Fixture* fixtureA = c->GetFixtureA(); - b2Fixture* fixtureB = c->GetFixtureB(); - b2Body* bodyA = fixtureA->GetBody(); - b2Body* bodyB = fixtureB->GetBody(); - - if (m_contactListener && c->IsTouching()) - { - m_contactListener->EndContact(c); - } - - // Remove from the world. - if (c->m_prev) - { - c->m_prev->m_next = c->m_next; - } - - if (c->m_next) - { - c->m_next->m_prev = c->m_prev; - } - - if (c == m_contactList) - { - m_contactList = c->m_next; - } - - // Remove from body 1 - if (c->m_nodeA.prev) - { - c->m_nodeA.prev->next = c->m_nodeA.next; - } - - if (c->m_nodeA.next) - { - c->m_nodeA.next->prev = c->m_nodeA.prev; - } - - if (&c->m_nodeA == bodyA->m_contactList) - { - bodyA->m_contactList = c->m_nodeA.next; - } - - // Remove from body 2 - if (c->m_nodeB.prev) - { - c->m_nodeB.prev->next = c->m_nodeB.next; - } - - if (c->m_nodeB.next) - { - c->m_nodeB.next->prev = c->m_nodeB.prev; - } - - if (&c->m_nodeB == bodyB->m_contactList) - { - bodyB->m_contactList = c->m_nodeB.next; - } - - // Call the factory. - b2Contact::Destroy(c, m_allocator); - --m_contactCount; -} - -// This is the top level collision call for the time step. Here -// all the narrow phase collision is processed for the world -// contact list. -void b2ContactManager::Collide() -{ - // Update awake contacts. - b2Contact* c = m_contactList; - while (c) - { - b2Fixture* fixtureA = c->GetFixtureA(); - b2Fixture* fixtureB = c->GetFixtureB(); - int32 indexA = c->GetChildIndexA(); - int32 indexB = c->GetChildIndexB(); - b2Body* bodyA = fixtureA->GetBody(); - b2Body* bodyB = fixtureB->GetBody(); - - // Is this contact flagged for filtering? - if (c->m_flags & b2Contact::e_filterFlag) - { - // Should these bodies collide? - if (bodyB->ShouldCollide(bodyA) == false) - { - b2Contact* cNuke = c; - c = cNuke->GetNext(); - Destroy(cNuke); - continue; - } - - // Check user filtering. - if (m_contactFilter && m_contactFilter->ShouldCollide(fixtureA, fixtureB) == false) - { - b2Contact* cNuke = c; - c = cNuke->GetNext(); - Destroy(cNuke); - continue; - } - - // Clear the filtering flag. - c->m_flags &= ~b2Contact::e_filterFlag; - } - - bool activeA = bodyA->IsAwake() && bodyA->m_type != b2_staticBody; - bool activeB = bodyB->IsAwake() && bodyB->m_type != b2_staticBody; - - // At least one body must be awake and it must be dynamic or kinematic. - if (activeA == false && activeB == false) - { - c = c->GetNext(); - continue; - } - - int32 proxyIdA = fixtureA->m_proxies[indexA].proxyId; - int32 proxyIdB = fixtureB->m_proxies[indexB].proxyId; - bool overlap = m_broadPhase.TestOverlap(proxyIdA, proxyIdB); - - // Here we destroy contacts that cease to overlap in the broad-phase. - if (overlap == false) - { - b2Contact* cNuke = c; - c = cNuke->GetNext(); - Destroy(cNuke); - continue; - } - - // The contact persists. - c->Update(m_contactListener); - c = c->GetNext(); - } -} - -void b2ContactManager::FindNewContacts() -{ - m_broadPhase.UpdatePairs(this); -} - -void b2ContactManager::AddPair(void* proxyUserDataA, void* proxyUserDataB) -{ - b2FixtureProxy* proxyA = (b2FixtureProxy*)proxyUserDataA; - b2FixtureProxy* proxyB = (b2FixtureProxy*)proxyUserDataB; - - b2Fixture* fixtureA = proxyA->fixture; - b2Fixture* fixtureB = proxyB->fixture; - - int32 indexA = proxyA->childIndex; - int32 indexB = proxyB->childIndex; - - b2Body* bodyA = fixtureA->GetBody(); - b2Body* bodyB = fixtureB->GetBody(); - - // Are the fixtures on the same body? - if (bodyA == bodyB) - { - return; - } - - // TODO_ERIN use a hash table to remove a potential bottleneck when both - // bodies have a lot of contacts. - // Does a contact already exist? - b2ContactEdge* edge = bodyB->GetContactList(); - while (edge) - { - if (edge->other == bodyA) - { - b2Fixture* fA = edge->contact->GetFixtureA(); - b2Fixture* fB = edge->contact->GetFixtureB(); - int32 iA = edge->contact->GetChildIndexA(); - int32 iB = edge->contact->GetChildIndexB(); - - if (fA == fixtureA && fB == fixtureB && iA == indexA && iB == indexB) - { - // A contact already exists. - return; - } - - if (fA == fixtureB && fB == fixtureA && iA == indexB && iB == indexA) - { - // A contact already exists. - return; - } - } - - edge = edge->next; - } - - // Does a joint override collision? Is at least one body dynamic? - if (bodyB->ShouldCollide(bodyA) == false) - { - return; - } - - // Check user filtering. - if (m_contactFilter && m_contactFilter->ShouldCollide(fixtureA, fixtureB) == false) - { - return; - } - - // Call the factory. - b2Contact* c = b2Contact::Create(fixtureA, indexA, fixtureB, indexB, m_allocator); - if (c == NULL) - { - return; - } - - // Contact creation may swap fixtures. - fixtureA = c->GetFixtureA(); - fixtureB = c->GetFixtureB(); - indexA = c->GetChildIndexA(); - indexB = c->GetChildIndexB(); - bodyA = fixtureA->GetBody(); - bodyB = fixtureB->GetBody(); - - // Insert into the world. - c->m_prev = NULL; - c->m_next = m_contactList; - if (m_contactList != NULL) - { - m_contactList->m_prev = c; - } - m_contactList = c; - - // Connect to island graph. - - // Connect to body A - c->m_nodeA.contact = c; - c->m_nodeA.other = bodyB; - - c->m_nodeA.prev = NULL; - c->m_nodeA.next = bodyA->m_contactList; - if (bodyA->m_contactList != NULL) - { - bodyA->m_contactList->prev = &c->m_nodeA; - } - bodyA->m_contactList = &c->m_nodeA; - - // Connect to body B - c->m_nodeB.contact = c; - c->m_nodeB.other = bodyA; - - c->m_nodeB.prev = NULL; - c->m_nodeB.next = bodyB->m_contactList; - if (bodyB->m_contactList != NULL) - { - bodyB->m_contactList->prev = &c->m_nodeB; - } - bodyB->m_contactList = &c->m_nodeB; - - // Wake up the bodies - bodyA->SetAwake(true); - bodyB->SetAwake(true); - - ++m_contactCount; -} diff --git a/external/Box2D/Dynamics/b2ContactManager.h b/external/Box2D/Dynamics/b2ContactManager.h deleted file mode 100644 index 9cb5718145..0000000000 --- a/external/Box2D/Dynamics/b2ContactManager.h +++ /dev/null @@ -1,52 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_CONTACT_MANAGER_H -#define B2_CONTACT_MANAGER_H - -#include - -class b2Contact; -class b2ContactFilter; -class b2ContactListener; -class b2BlockAllocator; - -// Delegate of b2World. -class b2ContactManager -{ -public: - b2ContactManager(); - - // Broad-phase callback. - void AddPair(void* proxyUserDataA, void* proxyUserDataB); - - void FindNewContacts(); - - void Destroy(b2Contact* c); - - void Collide(); - - b2BroadPhase m_broadPhase; - b2Contact* m_contactList; - int32 m_contactCount; - b2ContactFilter* m_contactFilter; - b2ContactListener* m_contactListener; - b2BlockAllocator* m_allocator; -}; - -#endif diff --git a/external/Box2D/Dynamics/b2Fixture.cpp b/external/Box2D/Dynamics/b2Fixture.cpp deleted file mode 100644 index 774a78e5bb..0000000000 --- a/external/Box2D/Dynamics/b2Fixture.cpp +++ /dev/null @@ -1,303 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -b2Fixture::b2Fixture() -{ - m_userData = NULL; - m_body = NULL; - m_next = NULL; - m_proxies = NULL; - m_proxyCount = 0; - m_shape = NULL; - m_density = 0.0f; -} - -void b2Fixture::Create(b2BlockAllocator* allocator, b2Body* body, const b2FixtureDef* def) -{ - m_userData = def->userData; - m_friction = def->friction; - m_restitution = def->restitution; - - m_body = body; - m_next = NULL; - - m_filter = def->filter; - - m_isSensor = def->isSensor; - - m_shape = def->shape->Clone(allocator); - - // Reserve proxy space - int32 childCount = m_shape->GetChildCount(); - m_proxies = (b2FixtureProxy*)allocator->Allocate(childCount * sizeof(b2FixtureProxy)); - for (int32 i = 0; i < childCount; ++i) - { - m_proxies[i].fixture = NULL; - m_proxies[i].proxyId = b2BroadPhase::e_nullProxy; - } - m_proxyCount = 0; - - m_density = def->density; -} - -void b2Fixture::Destroy(b2BlockAllocator* allocator) -{ - // The proxies must be destroyed before calling this. - b2Assert(m_proxyCount == 0); - - // Free the proxy array. - int32 childCount = m_shape->GetChildCount(); - allocator->Free(m_proxies, childCount * sizeof(b2FixtureProxy)); - m_proxies = NULL; - - // Free the child shape. - switch (m_shape->m_type) - { - case b2Shape::e_circle: - { - b2CircleShape* s = (b2CircleShape*)m_shape; - s->~b2CircleShape(); - allocator->Free(s, sizeof(b2CircleShape)); - } - break; - - case b2Shape::e_edge: - { - b2EdgeShape* s = (b2EdgeShape*)m_shape; - s->~b2EdgeShape(); - allocator->Free(s, sizeof(b2EdgeShape)); - } - break; - - case b2Shape::e_polygon: - { - b2PolygonShape* s = (b2PolygonShape*)m_shape; - s->~b2PolygonShape(); - allocator->Free(s, sizeof(b2PolygonShape)); - } - break; - - case b2Shape::e_chain: - { - b2ChainShape* s = (b2ChainShape*)m_shape; - s->~b2ChainShape(); - allocator->Free(s, sizeof(b2ChainShape)); - } - break; - - default: - b2Assert(false); - break; - } - - m_shape = NULL; -} - -void b2Fixture::CreateProxies(b2BroadPhase* broadPhase, const b2Transform& xf) -{ - b2Assert(m_proxyCount == 0); - - // Create proxies in the broad-phase. - m_proxyCount = m_shape->GetChildCount(); - - for (int32 i = 0; i < m_proxyCount; ++i) - { - b2FixtureProxy* proxy = m_proxies + i; - m_shape->ComputeAABB(&proxy->aabb, xf, i); - proxy->proxyId = broadPhase->CreateProxy(proxy->aabb, proxy); - proxy->fixture = this; - proxy->childIndex = i; - } -} - -void b2Fixture::DestroyProxies(b2BroadPhase* broadPhase) -{ - // Destroy proxies in the broad-phase. - for (int32 i = 0; i < m_proxyCount; ++i) - { - b2FixtureProxy* proxy = m_proxies + i; - broadPhase->DestroyProxy(proxy->proxyId); - proxy->proxyId = b2BroadPhase::e_nullProxy; - } - - m_proxyCount = 0; -} - -void b2Fixture::Synchronize(b2BroadPhase* broadPhase, const b2Transform& transform1, const b2Transform& transform2) -{ - if (m_proxyCount == 0) - { - return; - } - - for (int32 i = 0; i < m_proxyCount; ++i) - { - b2FixtureProxy* proxy = m_proxies + i; - - // Compute an AABB that covers the swept shape (may miss some rotation effect). - b2AABB aabb1, aabb2; - m_shape->ComputeAABB(&aabb1, transform1, proxy->childIndex); - m_shape->ComputeAABB(&aabb2, transform2, proxy->childIndex); - - proxy->aabb.Combine(aabb1, aabb2); - - b2Vec2 displacement = transform2.p - transform1.p; - - broadPhase->MoveProxy(proxy->proxyId, proxy->aabb, displacement); - } -} - -void b2Fixture::SetFilterData(const b2Filter& filter) -{ - m_filter = filter; - - Refilter(); -} - -void b2Fixture::Refilter() -{ - if (m_body == NULL) - { - return; - } - - // Flag associated contacts for filtering. - b2ContactEdge* edge = m_body->GetContactList(); - while (edge) - { - b2Contact* contact = edge->contact; - b2Fixture* fixtureA = contact->GetFixtureA(); - b2Fixture* fixtureB = contact->GetFixtureB(); - if (fixtureA == this || fixtureB == this) - { - contact->FlagForFiltering(); - } - - edge = edge->next; - } - - b2World* world = m_body->GetWorld(); - - if (world == NULL) - { - return; - } - - // Touch each proxy so that new pairs may be created - b2BroadPhase* broadPhase = &world->m_contactManager.m_broadPhase; - for (int32 i = 0; i < m_proxyCount; ++i) - { - broadPhase->TouchProxy(m_proxies[i].proxyId); - } -} - -void b2Fixture::SetSensor(bool sensor) -{ - if (sensor != m_isSensor) - { - m_body->SetAwake(true); - m_isSensor = sensor; - } -} - -void b2Fixture::Dump(int32 bodyIndex) -{ - b2Log(" b2FixtureDef fd;\n"); - b2Log(" fd.friction = %.15lef;\n", m_friction); - b2Log(" fd.restitution = %.15lef;\n", m_restitution); - b2Log(" fd.density = %.15lef;\n", m_density); - b2Log(" fd.isSensor = bool(%d);\n", m_isSensor); - b2Log(" fd.filter.categoryBits = uint16(%d);\n", m_filter.categoryBits); - b2Log(" fd.filter.maskBits = uint16(%d);\n", m_filter.maskBits); - b2Log(" fd.filter.groupIndex = int16(%d);\n", m_filter.groupIndex); - - switch (m_shape->m_type) - { - case b2Shape::e_circle: - { - b2CircleShape* s = (b2CircleShape*)m_shape; - b2Log(" b2CircleShape shape;\n"); - b2Log(" shape.m_radius = %.15lef;\n", s->m_radius); - b2Log(" shape.m_p.Set(%.15lef, %.15lef);\n", s->m_p.x, s->m_p.y); - } - break; - - case b2Shape::e_edge: - { - b2EdgeShape* s = (b2EdgeShape*)m_shape; - b2Log(" b2EdgeShape shape;\n"); - b2Log(" shape.m_radius = %.15lef;\n", s->m_radius); - b2Log(" shape.m_vertex0.Set(%.15lef, %.15lef);\n", s->m_vertex0.x, s->m_vertex0.y); - b2Log(" shape.m_vertex1.Set(%.15lef, %.15lef);\n", s->m_vertex1.x, s->m_vertex1.y); - b2Log(" shape.m_vertex2.Set(%.15lef, %.15lef);\n", s->m_vertex2.x, s->m_vertex2.y); - b2Log(" shape.m_vertex3.Set(%.15lef, %.15lef);\n", s->m_vertex3.x, s->m_vertex3.y); - b2Log(" shape.m_hasVertex0 = bool(%d);\n", s->m_hasVertex0); - b2Log(" shape.m_hasVertex3 = bool(%d);\n", s->m_hasVertex3); - } - break; - - case b2Shape::e_polygon: - { - b2PolygonShape* s = (b2PolygonShape*)m_shape; - b2Log(" b2PolygonShape shape;\n"); - b2Log(" b2Vec2 vs[%d];\n", b2_maxPolygonVertices); - for (int32 i = 0; i < s->m_vertexCount; ++i) - { - b2Log(" vs[%d].Set(%.15lef, %.15lef);\n", i, s->m_vertices[i].x, s->m_vertices[i].y); - } - b2Log(" shape.Set(vs, %d);\n", s->m_vertexCount); - } - break; - - case b2Shape::e_chain: - { - b2ChainShape* s = (b2ChainShape*)m_shape; - b2Log(" b2ChainShape shape;\n"); - b2Log(" b2Vec2 vs[%d];\n", s->m_count); - for (int32 i = 0; i < s->m_count; ++i) - { - b2Log(" vs[%d].Set(%.15lef, %.15lef);\n", i, s->m_vertices[i].x, s->m_vertices[i].y); - } - b2Log(" shape.CreateChain(vs, %d);\n", s->m_count); - b2Log(" shape.m_prevVertex.Set(%.15lef, %.15lef);\n", s->m_prevVertex.x, s->m_prevVertex.y); - b2Log(" shape.m_nextVertex.Set(%.15lef, %.15lef);\n", s->m_nextVertex.x, s->m_nextVertex.y); - b2Log(" shape.m_hasPrevVertex = bool(%d);\n", s->m_hasPrevVertex); - b2Log(" shape.m_hasNextVertex = bool(%d);\n", s->m_hasNextVertex); - } - break; - - default: - return; - } - - b2Log("\n"); - b2Log(" fd.shape = &shape;\n"); - b2Log("\n"); - b2Log(" bodies[%d]->CreateFixture(&fd);\n", bodyIndex); -} diff --git a/external/Box2D/Dynamics/b2Fixture.h b/external/Box2D/Dynamics/b2Fixture.h deleted file mode 100644 index d390410b93..0000000000 --- a/external/Box2D/Dynamics/b2Fixture.h +++ /dev/null @@ -1,345 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_FIXTURE_H -#define B2_FIXTURE_H - -#include -#include -#include - -class b2BlockAllocator; -class b2Body; -class b2BroadPhase; -class b2Fixture; - -/// This holds contact filtering data. -struct b2Filter -{ - b2Filter() - { - categoryBits = 0x0001; - maskBits = 0xFFFF; - groupIndex = 0; - } - - /// The collision category bits. Normally you would just set one bit. - uint16 categoryBits; - - /// The collision mask bits. This states the categories that this - /// shape would accept for collision. - uint16 maskBits; - - /// Collision groups allow a certain group of objects to never collide (negative) - /// or always collide (positive). Zero means no collision group. Non-zero group - /// filtering always wins against the mask bits. - int16 groupIndex; -}; - -/// A fixture definition is used to create a fixture. This class defines an -/// abstract fixture definition. You can reuse fixture definitions safely. -struct b2FixtureDef -{ - /// The constructor sets the default fixture definition values. - b2FixtureDef() - { - shape = NULL; - userData = NULL; - friction = 0.2f; - restitution = 0.0f; - density = 0.0f; - isSensor = false; - } - - /// The shape, this must be set. The shape will be cloned, so you - /// can create the shape on the stack. - const b2Shape* shape; - - /// Use this to store application specific fixture data. - void* userData; - - /// The friction coefficient, usually in the range [0,1]. - float32 friction; - - /// The restitution (elasticity) usually in the range [0,1]. - float32 restitution; - - /// The density, usually in kg/m^2. - float32 density; - - /// A sensor shape collects contact information but never generates a collision - /// response. - bool isSensor; - - /// Contact filtering data. - b2Filter filter; -}; - -/// This proxy is used internally to connect fixtures to the broad-phase. -struct b2FixtureProxy -{ - b2AABB aabb; - b2Fixture* fixture; - int32 childIndex; - int32 proxyId; -}; - -/// A fixture is used to attach a shape to a body for collision detection. A fixture -/// inherits its transform from its parent. Fixtures hold additional non-geometric data -/// such as friction, collision filters, etc. -/// Fixtures are created via b2Body::CreateFixture. -/// @warning you cannot reuse fixtures. -class b2Fixture -{ -public: - /// Get the type of the child shape. You can use this to down cast to the concrete shape. - /// @return the shape type. - b2Shape::Type GetType() const; - - /// Get the child shape. You can modify the child shape, however you should not change the - /// number of vertices because this will crash some collision caching mechanisms. - /// Manipulating the shape may lead to non-physical behavior. - b2Shape* GetShape(); - const b2Shape* GetShape() const; - - /// Set if this fixture is a sensor. - void SetSensor(bool sensor); - - /// Is this fixture a sensor (non-solid)? - /// @return the true if the shape is a sensor. - bool IsSensor() const; - - /// Set the contact filtering data. This will not update contacts until the next time - /// step when either parent body is active and awake. - /// This automatically calls Refilter. - void SetFilterData(const b2Filter& filter); - - /// Get the contact filtering data. - const b2Filter& GetFilterData() const; - - /// Call this if you want to establish collision that was previously disabled by b2ContactFilter::ShouldCollide. - void Refilter(); - - /// Get the parent body of this fixture. This is NULL if the fixture is not attached. - /// @return the parent body. - b2Body* GetBody(); - const b2Body* GetBody() const; - - /// Get the next fixture in the parent body's fixture list. - /// @return the next shape. - b2Fixture* GetNext(); - const b2Fixture* GetNext() const; - - /// Get the user data that was assigned in the fixture definition. Use this to - /// store your application specific data. - void* GetUserData() const; - - /// Set the user data. Use this to store your application specific data. - void SetUserData(void* data); - - /// Test a point for containment in this fixture. - /// @param p a point in world coordinates. - bool TestPoint(const b2Vec2& p) const; - - /// Cast a ray against this shape. - /// @param output the ray-cast results. - /// @param input the ray-cast input parameters. - bool RayCast(b2RayCastOutput* output, const b2RayCastInput& input, int32 childIndex) const; - - /// Get the mass data for this fixture. The mass data is based on the density and - /// the shape. The rotational inertia is about the shape's origin. This operation - /// may be expensive. - void GetMassData(b2MassData* massData) const; - - /// Set the density of this fixture. This will _not_ automatically adjust the mass - /// of the body. You must call b2Body::ResetMassData to update the body's mass. - void SetDensity(float32 density); - - /// Get the density of this fixture. - float32 GetDensity() const; - - /// Get the coefficient of friction. - float32 GetFriction() const; - - /// Set the coefficient of friction. This will _not_ change the friction of - /// existing contacts. - void SetFriction(float32 friction); - - /// Get the coefficient of restitution. - float32 GetRestitution() const; - - /// Set the coefficient of restitution. This will _not_ change the restitution of - /// existing contacts. - void SetRestitution(float32 restitution); - - /// Get the fixture's AABB. This AABB may be enlarge and/or stale. - /// If you need a more accurate AABB, compute it using the shape and - /// the body transform. - const b2AABB& GetAABB(int32 childIndex) const; - - /// Dump this fixture to the log file. - void Dump(int32 bodyIndex); - -protected: - - friend class b2Body; - friend class b2World; - friend class b2Contact; - friend class b2ContactManager; - - b2Fixture(); - - // We need separation create/destroy functions from the constructor/destructor because - // the destructor cannot access the allocator (no destructor arguments allowed by C++). - void Create(b2BlockAllocator* allocator, b2Body* body, const b2FixtureDef* def); - void Destroy(b2BlockAllocator* allocator); - - // These support body activation/deactivation. - void CreateProxies(b2BroadPhase* broadPhase, const b2Transform& xf); - void DestroyProxies(b2BroadPhase* broadPhase); - - void Synchronize(b2BroadPhase* broadPhase, const b2Transform& xf1, const b2Transform& xf2); - - float32 m_density; - - b2Fixture* m_next; - b2Body* m_body; - - b2Shape* m_shape; - - float32 m_friction; - float32 m_restitution; - - b2FixtureProxy* m_proxies; - int32 m_proxyCount; - - b2Filter m_filter; - - bool m_isSensor; - - void* m_userData; -}; - -inline b2Shape::Type b2Fixture::GetType() const -{ - return m_shape->GetType(); -} - -inline b2Shape* b2Fixture::GetShape() -{ - return m_shape; -} - -inline const b2Shape* b2Fixture::GetShape() const -{ - return m_shape; -} - -inline bool b2Fixture::IsSensor() const -{ - return m_isSensor; -} - -inline const b2Filter& b2Fixture::GetFilterData() const -{ - return m_filter; -} - -inline void* b2Fixture::GetUserData() const -{ - return m_userData; -} - -inline void b2Fixture::SetUserData(void* data) -{ - m_userData = data; -} - -inline b2Body* b2Fixture::GetBody() -{ - return m_body; -} - -inline const b2Body* b2Fixture::GetBody() const -{ - return m_body; -} - -inline b2Fixture* b2Fixture::GetNext() -{ - return m_next; -} - -inline const b2Fixture* b2Fixture::GetNext() const -{ - return m_next; -} - -inline void b2Fixture::SetDensity(float32 density) -{ - b2Assert(b2IsValid(density) && density >= 0.0f); - m_density = density; -} - -inline float32 b2Fixture::GetDensity() const -{ - return m_density; -} - -inline float32 b2Fixture::GetFriction() const -{ - return m_friction; -} - -inline void b2Fixture::SetFriction(float32 friction) -{ - m_friction = friction; -} - -inline float32 b2Fixture::GetRestitution() const -{ - return m_restitution; -} - -inline void b2Fixture::SetRestitution(float32 restitution) -{ - m_restitution = restitution; -} - -inline bool b2Fixture::TestPoint(const b2Vec2& p) const -{ - return m_shape->TestPoint(m_body->GetTransform(), p); -} - -inline bool b2Fixture::RayCast(b2RayCastOutput* output, const b2RayCastInput& input, int32 childIndex) const -{ - return m_shape->RayCast(output, input, m_body->GetTransform(), childIndex); -} - -inline void b2Fixture::GetMassData(b2MassData* massData) const -{ - m_shape->ComputeMass(massData, m_density); -} - -inline const b2AABB& b2Fixture::GetAABB(int32 childIndex) const -{ - b2Assert(0 <= childIndex && childIndex < m_proxyCount); - return m_proxies[childIndex].aabb; -} - -#endif diff --git a/external/Box2D/Dynamics/b2Island.cpp b/external/Box2D/Dynamics/b2Island.cpp deleted file mode 100644 index e767d383d5..0000000000 --- a/external/Box2D/Dynamics/b2Island.cpp +++ /dev/null @@ -1,539 +0,0 @@ -/* -* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* -Position Correction Notes -========================= -I tried the several algorithms for position correction of the 2D revolute joint. -I looked at these systems: -- simple pendulum (1m diameter sphere on massless 5m stick) with initial angular velocity of 100 rad/s. -- suspension bridge with 30 1m long planks of length 1m. -- multi-link chain with 30 1m long links. - -Here are the algorithms: - -Baumgarte - A fraction of the position error is added to the velocity error. There is no -separate position solver. - -Pseudo Velocities - After the velocity solver and position integration, -the position error, Jacobian, and effective mass are recomputed. Then -the velocity constraints are solved with pseudo velocities and a fraction -of the position error is added to the pseudo velocity error. The pseudo -velocities are initialized to zero and there is no warm-starting. After -the position solver, the pseudo velocities are added to the positions. -This is also called the First Order World method or the Position LCP method. - -Modified Nonlinear Gauss-Seidel (NGS) - Like Pseudo Velocities except the -position error is re-computed for each constraint and the positions are updated -after the constraint is solved. The radius vectors (aka Jacobians) are -re-computed too (otherwise the algorithm has horrible instability). The pseudo -velocity states are not needed because they are effectively zero at the beginning -of each iteration. Since we have the current position error, we allow the -iterations to terminate early if the error becomes smaller than b2_linearSlop. - -Full NGS or just NGS - Like Modified NGS except the effective mass are re-computed -each time a constraint is solved. - -Here are the results: -Baumgarte - this is the cheapest algorithm but it has some stability problems, -especially with the bridge. The chain links separate easily close to the root -and they jitter as they struggle to pull together. This is one of the most common -methods in the field. The big drawback is that the position correction artificially -affects the momentum, thus leading to instabilities and false bounce. I used a -bias factor of 0.2. A larger bias factor makes the bridge less stable, a smaller -factor makes joints and contacts more spongy. - -Pseudo Velocities - the is more stable than the Baumgarte method. The bridge is -stable. However, joints still separate with large angular velocities. Drag the -simple pendulum in a circle quickly and the joint will separate. The chain separates -easily and does not recover. I used a bias factor of 0.2. A larger value lead to -the bridge collapsing when a heavy cube drops on it. - -Modified NGS - this algorithm is better in some ways than Baumgarte and Pseudo -Velocities, but in other ways it is worse. The bridge and chain are much more -stable, but the simple pendulum goes unstable at high angular velocities. - -Full NGS - stable in all tests. The joints display good stiffness. The bridge -still sags, but this is better than infinite forces. - -Recommendations -Pseudo Velocities are not really worthwhile because the bridge and chain cannot -recover from joint separation. In other cases the benefit over Baumgarte is small. - -Modified NGS is not a robust method for the revolute joint due to the violent -instability seen in the simple pendulum. Perhaps it is viable with other constraint -types, especially scalar constraints where the effective mass is a scalar. - -This leaves Baumgarte and Full NGS. Baumgarte has small, but manageable instabilities -and is very fast. I don't think we can escape Baumgarte, especially in highly -demanding cases where high constraint fidelity is not needed. - -Full NGS is robust and easy on the eyes. I recommend this as an option for -higher fidelity simulation and certainly for suspension bridges and long chains. -Full NGS might be a good choice for ragdolls, especially motorized ragdolls where -joint separation can be problematic. The number of NGS iterations can be reduced -for better performance without harming robustness much. - -Each joint in a can be handled differently in the position solver. So I recommend -a system where the user can select the algorithm on a per joint basis. I would -probably default to the slower Full NGS and let the user select the faster -Baumgarte method in performance critical scenarios. -*/ - -/* -Cache Performance - -The Box2D solvers are dominated by cache misses. Data structures are designed -to increase the number of cache hits. Much of misses are due to random access -to body data. The constraint structures are iterated over linearly, which leads -to few cache misses. - -The bodies are not accessed during iteration. Instead read only data, such as -the mass values are stored with the constraints. The mutable data are the constraint -impulses and the bodies velocities/positions. The impulses are held inside the -constraint structures. The body velocities/positions are held in compact, temporary -arrays to increase the number of cache hits. Linear and angular velocity are -stored in a single array since multiple arrays lead to multiple misses. -*/ - -/* -2D Rotation - -R = [cos(theta) -sin(theta)] - [sin(theta) cos(theta) ] - -thetaDot = omega - -Let q1 = cos(theta), q2 = sin(theta). -R = [q1 -q2] - [q2 q1] - -q1Dot = -thetaDot * q2 -q2Dot = thetaDot * q1 - -q1_new = q1_old - dt * w * q2 -q2_new = q2_old + dt * w * q1 -then normalize. - -This might be faster than computing sin+cos. -However, we can compute sin+cos of the same angle fast. -*/ - -b2Island::b2Island( - int32 bodyCapacity, - int32 contactCapacity, - int32 jointCapacity, - b2StackAllocator* allocator, - b2ContactListener* listener) -{ - m_bodyCapacity = bodyCapacity; - m_contactCapacity = contactCapacity; - m_jointCapacity = jointCapacity; - m_bodyCount = 0; - m_contactCount = 0; - m_jointCount = 0; - - m_allocator = allocator; - m_listener = listener; - - m_bodies = (b2Body**)m_allocator->Allocate(bodyCapacity * sizeof(b2Body*)); - m_contacts = (b2Contact**)m_allocator->Allocate(contactCapacity * sizeof(b2Contact*)); - m_joints = (b2Joint**)m_allocator->Allocate(jointCapacity * sizeof(b2Joint*)); - - m_velocities = (b2Velocity*)m_allocator->Allocate(m_bodyCapacity * sizeof(b2Velocity)); - m_positions = (b2Position*)m_allocator->Allocate(m_bodyCapacity * sizeof(b2Position)); -} - -b2Island::~b2Island() -{ - // Warning: the order should reverse the constructor order. - m_allocator->Free(m_positions); - m_allocator->Free(m_velocities); - m_allocator->Free(m_joints); - m_allocator->Free(m_contacts); - m_allocator->Free(m_bodies); -} - -void b2Island::Solve(b2Profile* profile, const b2TimeStep& step, const b2Vec2& gravity, bool allowSleep) -{ - b2Timer timer; - - float32 h = step.dt; - - // Integrate velocities and apply damping. Initialize the body state. - for (int32 i = 0; i < m_bodyCount; ++i) - { - b2Body* b = m_bodies[i]; - - b2Vec2 c = b->m_sweep.c; - float32 a = b->m_sweep.a; - b2Vec2 v = b->m_linearVelocity; - float32 w = b->m_angularVelocity; - - // Store positions for continuous collision. - b->m_sweep.c0 = b->m_sweep.c; - b->m_sweep.a0 = b->m_sweep.a; - - if (b->m_type == b2_dynamicBody) - { - // Integrate velocities. - v += h * (b->m_gravityScale * gravity + b->m_invMass * b->m_force); - w += h * b->m_invI * b->m_torque; - - // Apply damping. - // ODE: dv/dt + c * v = 0 - // Solution: v(t) = v0 * exp(-c * t) - // Time step: v(t + dt) = v0 * exp(-c * (t + dt)) = v0 * exp(-c * t) * exp(-c * dt) = v * exp(-c * dt) - // v2 = exp(-c * dt) * v1 - // Taylor expansion: - // v2 = (1.0f - c * dt) * v1 - v *= b2Clamp(1.0f - h * b->m_linearDamping, 0.0f, 1.0f); - w *= b2Clamp(1.0f - h * b->m_angularDamping, 0.0f, 1.0f); - } - - m_positions[i].c = c; - m_positions[i].a = a; - m_velocities[i].v = v; - m_velocities[i].w = w; - } - - timer.Reset(); - - // Solver data - b2SolverData solverData; - solverData.step = step; - solverData.positions = m_positions; - solverData.velocities = m_velocities; - - // Initialize velocity constraints. - b2ContactSolverDef contactSolverDef; - contactSolverDef.step = step; - contactSolverDef.contacts = m_contacts; - contactSolverDef.count = m_contactCount; - contactSolverDef.positions = m_positions; - contactSolverDef.velocities = m_velocities; - contactSolverDef.allocator = m_allocator; - - b2ContactSolver contactSolver(&contactSolverDef); - contactSolver.InitializeVelocityConstraints(); - - if (step.warmStarting) - { - contactSolver.WarmStart(); - } - - for (int32 i = 0; i < m_jointCount; ++i) - { - m_joints[i]->InitVelocityConstraints(solverData); - } - - profile->solveInit = timer.GetMilliseconds(); - - // Solve velocity constraints - timer.Reset(); - for (int32 i = 0; i < step.velocityIterations; ++i) - { - for (int32 j = 0; j < m_jointCount; ++j) - { - m_joints[j]->SolveVelocityConstraints(solverData); - } - - contactSolver.SolveVelocityConstraints(); - } - - // Store impulses for warm starting - contactSolver.StoreImpulses(); - profile->solveVelocity = timer.GetMilliseconds(); - - // Integrate positions - for (int32 i = 0; i < m_bodyCount; ++i) - { - b2Vec2 c = m_positions[i].c; - float32 a = m_positions[i].a; - b2Vec2 v = m_velocities[i].v; - float32 w = m_velocities[i].w; - - // Check for large velocities - b2Vec2 translation = h * v; - if (b2Dot(translation, translation) > b2_maxTranslationSquared) - { - float32 ratio = b2_maxTranslation / translation.Length(); - v *= ratio; - } - - float32 rotation = h * w; - if (rotation * rotation > b2_maxRotationSquared) - { - float32 ratio = b2_maxRotation / b2Abs(rotation); - w *= ratio; - } - - // Integrate - c += h * v; - a += h * w; - - m_positions[i].c = c; - m_positions[i].a = a; - m_velocities[i].v = v; - m_velocities[i].w = w; - } - - // Solve position constraints - timer.Reset(); - bool positionSolved = false; - for (int32 i = 0; i < step.positionIterations; ++i) - { - bool contactsOkay = contactSolver.SolvePositionConstraints(); - - bool jointsOkay = true; - for (int32 i = 0; i < m_jointCount; ++i) - { - bool jointOkay = m_joints[i]->SolvePositionConstraints(solverData); - jointsOkay = jointsOkay && jointOkay; - } - - if (contactsOkay && jointsOkay) - { - // Exit early if the position errors are small. - positionSolved = true; - break; - } - } - - // Copy state buffers back to the bodies - for (int32 i = 0; i < m_bodyCount; ++i) - { - b2Body* body = m_bodies[i]; - body->m_sweep.c = m_positions[i].c; - body->m_sweep.a = m_positions[i].a; - body->m_linearVelocity = m_velocities[i].v; - body->m_angularVelocity = m_velocities[i].w; - body->SynchronizeTransform(); - } - - profile->solvePosition = timer.GetMilliseconds(); - - Report(contactSolver.m_velocityConstraints); - - if (allowSleep) - { - float32 minSleepTime = b2_maxFloat; - - const float32 linTolSqr = b2_linearSleepTolerance * b2_linearSleepTolerance; - const float32 angTolSqr = b2_angularSleepTolerance * b2_angularSleepTolerance; - - for (int32 i = 0; i < m_bodyCount; ++i) - { - b2Body* b = m_bodies[i]; - if (b->GetType() == b2_staticBody) - { - continue; - } - - if ((b->m_flags & b2Body::e_autoSleepFlag) == 0 || - b->m_angularVelocity * b->m_angularVelocity > angTolSqr || - b2Dot(b->m_linearVelocity, b->m_linearVelocity) > linTolSqr) - { - b->m_sleepTime = 0.0f; - minSleepTime = 0.0f; - } - else - { - b->m_sleepTime += h; - minSleepTime = b2Min(minSleepTime, b->m_sleepTime); - } - } - - if (minSleepTime >= b2_timeToSleep && positionSolved) - { - for (int32 i = 0; i < m_bodyCount; ++i) - { - b2Body* b = m_bodies[i]; - b->SetAwake(false); - } - } - } -} - -void b2Island::SolveTOI(const b2TimeStep& subStep, int32 toiIndexA, int32 toiIndexB) -{ - b2Assert(toiIndexA < m_bodyCount); - b2Assert(toiIndexB < m_bodyCount); - - // Initialize the body state. - for (int32 i = 0; i < m_bodyCount; ++i) - { - b2Body* b = m_bodies[i]; - m_positions[i].c = b->m_sweep.c; - m_positions[i].a = b->m_sweep.a; - m_velocities[i].v = b->m_linearVelocity; - m_velocities[i].w = b->m_angularVelocity; - } - - b2ContactSolverDef contactSolverDef; - contactSolverDef.contacts = m_contacts; - contactSolverDef.count = m_contactCount; - contactSolverDef.allocator = m_allocator; - contactSolverDef.step = subStep; - contactSolverDef.positions = m_positions; - contactSolverDef.velocities = m_velocities; - b2ContactSolver contactSolver(&contactSolverDef); - - // Solve position constraints. - for (int32 i = 0; i < subStep.positionIterations; ++i) - { - bool contactsOkay = contactSolver.SolveTOIPositionConstraints(toiIndexA, toiIndexB); - if (contactsOkay) - { - break; - } - } - -#if 0 - // Is the new position really safe? - for (int32 i = 0; i < m_contactCount; ++i) - { - b2Contact* c = m_contacts[i]; - b2Fixture* fA = c->GetFixtureA(); - b2Fixture* fB = c->GetFixtureB(); - - b2Body* bA = fA->GetBody(); - b2Body* bB = fB->GetBody(); - - int32 indexA = c->GetChildIndexA(); - int32 indexB = c->GetChildIndexB(); - - b2DistanceInput input; - input.proxyA.Set(fA->GetShape(), indexA); - input.proxyB.Set(fB->GetShape(), indexB); - input.transformA = bA->GetTransform(); - input.transformB = bB->GetTransform(); - input.useRadii = false; - - b2DistanceOutput output; - b2SimplexCache cache; - cache.count = 0; - b2Distance(&output, &cache, &input); - - if (output.distance == 0 || cache.count == 3) - { - cache.count += 0; - } - } -#endif - - // Leap of faith to new safe state. - m_bodies[toiIndexA]->m_sweep.c0 = m_positions[toiIndexA].c; - m_bodies[toiIndexA]->m_sweep.a0 = m_positions[toiIndexA].a; - m_bodies[toiIndexB]->m_sweep.c0 = m_positions[toiIndexB].c; - m_bodies[toiIndexB]->m_sweep.a0 = m_positions[toiIndexB].a; - - // No warm starting is needed for TOI events because warm - // starting impulses were applied in the discrete solver. - contactSolver.InitializeVelocityConstraints(); - - // Solve velocity constraints. - for (int32 i = 0; i < subStep.velocityIterations; ++i) - { - contactSolver.SolveVelocityConstraints(); - } - - // Don't store the TOI contact forces for warm starting - // because they can be quite large. - - float32 h = subStep.dt; - - // Integrate positions - for (int32 i = 0; i < m_bodyCount; ++i) - { - b2Vec2 c = m_positions[i].c; - float32 a = m_positions[i].a; - b2Vec2 v = m_velocities[i].v; - float32 w = m_velocities[i].w; - - // Check for large velocities - b2Vec2 translation = h * v; - if (b2Dot(translation, translation) > b2_maxTranslationSquared) - { - float32 ratio = b2_maxTranslation / translation.Length(); - v *= ratio; - } - - float32 rotation = h * w; - if (rotation * rotation > b2_maxRotationSquared) - { - float32 ratio = b2_maxRotation / b2Abs(rotation); - w *= ratio; - } - - // Integrate - c += h * v; - a += h * w; - - m_positions[i].c = c; - m_positions[i].a = a; - m_velocities[i].v = v; - m_velocities[i].w = w; - - // Sync bodies - b2Body* body = m_bodies[i]; - body->m_sweep.c = c; - body->m_sweep.a = a; - body->m_linearVelocity = v; - body->m_angularVelocity = w; - body->SynchronizeTransform(); - } - - Report(contactSolver.m_velocityConstraints); -} - -void b2Island::Report(const b2ContactVelocityConstraint* constraints) -{ - if (m_listener == NULL) - { - return; - } - - for (int32 i = 0; i < m_contactCount; ++i) - { - b2Contact* c = m_contacts[i]; - - const b2ContactVelocityConstraint* vc = constraints + i; - - b2ContactImpulse impulse; - impulse.count = vc->pointCount; - for (int32 j = 0; j < vc->pointCount; ++j) - { - impulse.normalImpulses[j] = vc->points[j].normalImpulse; - impulse.tangentImpulses[j] = vc->points[j].tangentImpulse; - } - - m_listener->PostSolve(c, &impulse); - } -} diff --git a/external/Box2D/Dynamics/b2Island.h b/external/Box2D/Dynamics/b2Island.h deleted file mode 100644 index e0a6e41fc3..0000000000 --- a/external/Box2D/Dynamics/b2Island.h +++ /dev/null @@ -1,93 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_ISLAND_H -#define B2_ISLAND_H - -#include -#include -#include - -class b2Contact; -class b2Joint; -class b2StackAllocator; -class b2ContactListener; -struct b2ContactVelocityConstraint; -struct b2Profile; - -/// This is an internal class. -class b2Island -{ -public: - b2Island(int32 bodyCapacity, int32 contactCapacity, int32 jointCapacity, - b2StackAllocator* allocator, b2ContactListener* listener); - ~b2Island(); - - void Clear() - { - m_bodyCount = 0; - m_contactCount = 0; - m_jointCount = 0; - } - - void Solve(b2Profile* profile, const b2TimeStep& step, const b2Vec2& gravity, bool allowSleep); - - void SolveTOI(const b2TimeStep& subStep, int32 toiIndexA, int32 toiIndexB); - - void Add(b2Body* body) - { - b2Assert(m_bodyCount < m_bodyCapacity); - body->m_islandIndex = m_bodyCount; - m_bodies[m_bodyCount] = body; - ++m_bodyCount; - } - - void Add(b2Contact* contact) - { - b2Assert(m_contactCount < m_contactCapacity); - m_contacts[m_contactCount++] = contact; - } - - void Add(b2Joint* joint) - { - b2Assert(m_jointCount < m_jointCapacity); - m_joints[m_jointCount++] = joint; - } - - void Report(const b2ContactVelocityConstraint* constraints); - - b2StackAllocator* m_allocator; - b2ContactListener* m_listener; - - b2Body** m_bodies; - b2Contact** m_contacts; - b2Joint** m_joints; - - b2Position* m_positions; - b2Velocity* m_velocities; - - int32 m_bodyCount; - int32 m_jointCount; - int32 m_contactCount; - - int32 m_bodyCapacity; - int32 m_contactCapacity; - int32 m_jointCapacity; -}; - -#endif diff --git a/external/Box2D/Dynamics/b2TimeStep.h b/external/Box2D/Dynamics/b2TimeStep.h deleted file mode 100644 index 30d723fcc3..0000000000 --- a/external/Box2D/Dynamics/b2TimeStep.h +++ /dev/null @@ -1,70 +0,0 @@ -/* -* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_TIME_STEP_H -#define B2_TIME_STEP_H - -#include - -/// Profiling data. Times are in milliseconds. -struct b2Profile -{ - float32 step; - float32 collide; - float32 solve; - float32 solveInit; - float32 solveVelocity; - float32 solvePosition; - float32 broadphase; - float32 solveTOI; -}; - -/// This is an internal structure. -struct b2TimeStep -{ - float32 dt; // time step - float32 inv_dt; // inverse time step (0 if dt == 0). - float32 dtRatio; // dt * inv_dt0 - int32 velocityIterations; - int32 positionIterations; - bool warmStarting; -}; - -/// This is an internal structure. -struct b2Position -{ - b2Vec2 c; - float32 a; -}; - -/// This is an internal structure. -struct b2Velocity -{ - b2Vec2 v; - float32 w; -}; - -/// Solver Data -struct b2SolverData -{ - b2TimeStep step; - b2Position* positions; - b2Velocity* velocities; -}; - -#endif diff --git a/external/Box2D/Dynamics/b2World.cpp b/external/Box2D/Dynamics/b2World.cpp deleted file mode 100644 index 8a0aff5114..0000000000 --- a/external/Box2D/Dynamics/b2World.cpp +++ /dev/null @@ -1,1316 +0,0 @@ -/* -* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -b2World::b2World(const b2Vec2& gravity) -{ - m_destructionListener = NULL; - m_debugDraw = NULL; - - m_bodyList = NULL; - m_jointList = NULL; - - m_bodyCount = 0; - m_jointCount = 0; - - m_warmStarting = true; - m_continuousPhysics = true; - m_subStepping = false; - - m_stepComplete = true; - - m_allowSleep = true; - m_gravity = gravity; - - m_flags = e_clearForces; - - m_inv_dt0 = 0.0f; - - m_contactManager.m_allocator = &m_blockAllocator; - - memset(&m_profile, 0, sizeof(b2Profile)); -} - -b2World::~b2World() -{ - // Some shapes allocate using b2Alloc. - b2Body* b = m_bodyList; - while (b) - { - b2Body* bNext = b->m_next; - - b2Fixture* f = b->m_fixtureList; - while (f) - { - b2Fixture* fNext = f->m_next; - f->m_proxyCount = 0; - f->Destroy(&m_blockAllocator); - f = fNext; - } - - b = bNext; - } -} - -void b2World::SetDestructionListener(b2DestructionListener* listener) -{ - m_destructionListener = listener; -} - -void b2World::SetContactFilter(b2ContactFilter* filter) -{ - m_contactManager.m_contactFilter = filter; -} - -void b2World::SetContactListener(b2ContactListener* listener) -{ - m_contactManager.m_contactListener = listener; -} - -void b2World::SetDebugDraw(b2Draw* debugDraw) -{ - m_debugDraw = debugDraw; -} - -b2Body* b2World::CreateBody(const b2BodyDef* def) -{ - b2Assert(IsLocked() == false); - if (IsLocked()) - { - return NULL; - } - - void* mem = m_blockAllocator.Allocate(sizeof(b2Body)); - b2Body* b = new (mem) b2Body(def, this); - - // Add to world doubly linked list. - b->m_prev = NULL; - b->m_next = m_bodyList; - if (m_bodyList) - { - m_bodyList->m_prev = b; - } - m_bodyList = b; - ++m_bodyCount; - - return b; -} - -void b2World::DestroyBody(b2Body* b) -{ - b2Assert(m_bodyCount > 0); - b2Assert(IsLocked() == false); - if (IsLocked()) - { - return; - } - - // Delete the attached joints. - b2JointEdge* je = b->m_jointList; - while (je) - { - b2JointEdge* je0 = je; - je = je->next; - - if (m_destructionListener) - { - m_destructionListener->SayGoodbye(je0->joint); - } - - DestroyJoint(je0->joint); - - b->m_jointList = je; - } - b->m_jointList = NULL; - - // Delete the attached contacts. - b2ContactEdge* ce = b->m_contactList; - while (ce) - { - b2ContactEdge* ce0 = ce; - ce = ce->next; - m_contactManager.Destroy(ce0->contact); - } - b->m_contactList = NULL; - - // Delete the attached fixtures. This destroys broad-phase proxies. - b2Fixture* f = b->m_fixtureList; - while (f) - { - b2Fixture* f0 = f; - f = f->m_next; - - if (m_destructionListener) - { - m_destructionListener->SayGoodbye(f0); - } - - f0->DestroyProxies(&m_contactManager.m_broadPhase); - f0->Destroy(&m_blockAllocator); - f0->~b2Fixture(); - m_blockAllocator.Free(f0, sizeof(b2Fixture)); - - b->m_fixtureList = f; - b->m_fixtureCount -= 1; - } - b->m_fixtureList = NULL; - b->m_fixtureCount = 0; - - // Remove world body list. - if (b->m_prev) - { - b->m_prev->m_next = b->m_next; - } - - if (b->m_next) - { - b->m_next->m_prev = b->m_prev; - } - - if (b == m_bodyList) - { - m_bodyList = b->m_next; - } - - --m_bodyCount; - b->~b2Body(); - m_blockAllocator.Free(b, sizeof(b2Body)); -} - -b2Joint* b2World::CreateJoint(const b2JointDef* def) -{ - b2Assert(IsLocked() == false); - if (IsLocked()) - { - return NULL; - } - - b2Joint* j = b2Joint::Create(def, &m_blockAllocator); - - // Connect to the world list. - j->m_prev = NULL; - j->m_next = m_jointList; - if (m_jointList) - { - m_jointList->m_prev = j; - } - m_jointList = j; - ++m_jointCount; - - // Connect to the bodies' doubly linked lists. - j->m_edgeA.joint = j; - j->m_edgeA.other = j->m_bodyB; - j->m_edgeA.prev = NULL; - j->m_edgeA.next = j->m_bodyA->m_jointList; - if (j->m_bodyA->m_jointList) j->m_bodyA->m_jointList->prev = &j->m_edgeA; - j->m_bodyA->m_jointList = &j->m_edgeA; - - j->m_edgeB.joint = j; - j->m_edgeB.other = j->m_bodyA; - j->m_edgeB.prev = NULL; - j->m_edgeB.next = j->m_bodyB->m_jointList; - if (j->m_bodyB->m_jointList) j->m_bodyB->m_jointList->prev = &j->m_edgeB; - j->m_bodyB->m_jointList = &j->m_edgeB; - - b2Body* bodyA = def->bodyA; - b2Body* bodyB = def->bodyB; - - // If the joint prevents collisions, then flag any contacts for filtering. - if (def->collideConnected == false) - { - b2ContactEdge* edge = bodyB->GetContactList(); - while (edge) - { - if (edge->other == bodyA) - { - // Flag the contact for filtering at the next time step (where either - // body is awake). - edge->contact->FlagForFiltering(); - } - - edge = edge->next; - } - } - - // Note: creating a joint doesn't wake the bodies. - - return j; -} - -void b2World::DestroyJoint(b2Joint* j) -{ - b2Assert(IsLocked() == false); - if (IsLocked()) - { - return; - } - - bool collideConnected = j->m_collideConnected; - - // Remove from the doubly linked list. - if (j->m_prev) - { - j->m_prev->m_next = j->m_next; - } - - if (j->m_next) - { - j->m_next->m_prev = j->m_prev; - } - - if (j == m_jointList) - { - m_jointList = j->m_next; - } - - // Disconnect from island graph. - b2Body* bodyA = j->m_bodyA; - b2Body* bodyB = j->m_bodyB; - - // Wake up connected bodies. - bodyA->SetAwake(true); - bodyB->SetAwake(true); - - // Remove from body 1. - if (j->m_edgeA.prev) - { - j->m_edgeA.prev->next = j->m_edgeA.next; - } - - if (j->m_edgeA.next) - { - j->m_edgeA.next->prev = j->m_edgeA.prev; - } - - if (&j->m_edgeA == bodyA->m_jointList) - { - bodyA->m_jointList = j->m_edgeA.next; - } - - j->m_edgeA.prev = NULL; - j->m_edgeA.next = NULL; - - // Remove from body 2 - if (j->m_edgeB.prev) - { - j->m_edgeB.prev->next = j->m_edgeB.next; - } - - if (j->m_edgeB.next) - { - j->m_edgeB.next->prev = j->m_edgeB.prev; - } - - if (&j->m_edgeB == bodyB->m_jointList) - { - bodyB->m_jointList = j->m_edgeB.next; - } - - j->m_edgeB.prev = NULL; - j->m_edgeB.next = NULL; - - b2Joint::Destroy(j, &m_blockAllocator); - - b2Assert(m_jointCount > 0); - --m_jointCount; - - // If the joint prevents collisions, then flag any contacts for filtering. - if (collideConnected == false) - { - b2ContactEdge* edge = bodyB->GetContactList(); - while (edge) - { - if (edge->other == bodyA) - { - // Flag the contact for filtering at the next time step (where either - // body is awake). - edge->contact->FlagForFiltering(); - } - - edge = edge->next; - } - } -} - -// -void b2World::SetAllowSleeping(bool flag) -{ - if (flag == m_allowSleep) - { - return; - } - - m_allowSleep = flag; - if (m_allowSleep == false) - { - for (b2Body* b = m_bodyList; b; b = b->m_next) - { - b->SetAwake(true); - } - } -} - -// Find islands, integrate and solve constraints, solve position constraints -void b2World::Solve(const b2TimeStep& step) -{ - m_profile.solveInit = 0.0f; - m_profile.solveVelocity = 0.0f; - m_profile.solvePosition = 0.0f; - - // Size the island for the worst case. - b2Island island(m_bodyCount, - m_contactManager.m_contactCount, - m_jointCount, - &m_stackAllocator, - m_contactManager.m_contactListener); - - // Clear all the island flags. - for (b2Body* b = m_bodyList; b; b = b->m_next) - { - b->m_flags &= ~b2Body::e_islandFlag; - } - for (b2Contact* c = m_contactManager.m_contactList; c; c = c->m_next) - { - c->m_flags &= ~b2Contact::e_islandFlag; - } - for (b2Joint* j = m_jointList; j; j = j->m_next) - { - j->m_islandFlag = false; - } - - // Build and simulate all awake islands. - int32 stackSize = m_bodyCount; - b2Body** stack = (b2Body**)m_stackAllocator.Allocate(stackSize * sizeof(b2Body*)); - for (b2Body* seed = m_bodyList; seed; seed = seed->m_next) - { - if (seed->m_flags & b2Body::e_islandFlag) - { - continue; - } - - if (seed->IsAwake() == false || seed->IsActive() == false) - { - continue; - } - - // The seed can be dynamic or kinematic. - if (seed->GetType() == b2_staticBody) - { - continue; - } - - // Reset island and stack. - island.Clear(); - int32 stackCount = 0; - stack[stackCount++] = seed; - seed->m_flags |= b2Body::e_islandFlag; - - // Perform a depth first search (DFS) on the constraint graph. - while (stackCount > 0) - { - // Grab the next body off the stack and add it to the island. - b2Body* b = stack[--stackCount]; - b2Assert(b->IsActive() == true); - island.Add(b); - - // Make sure the body is awake. - b->SetAwake(true); - - // To keep islands as small as possible, we don't - // propagate islands across static bodies. - if (b->GetType() == b2_staticBody) - { - continue; - } - - // Search all contacts connected to this body. - for (b2ContactEdge* ce = b->m_contactList; ce; ce = ce->next) - { - b2Contact* contact = ce->contact; - - // Has this contact already been added to an island? - if (contact->m_flags & b2Contact::e_islandFlag) - { - continue; - } - - // Is this contact solid and touching? - if (contact->IsEnabled() == false || - contact->IsTouching() == false) - { - continue; - } - - // Skip sensors. - bool sensorA = contact->m_fixtureA->m_isSensor; - bool sensorB = contact->m_fixtureB->m_isSensor; - if (sensorA || sensorB) - { - continue; - } - - island.Add(contact); - contact->m_flags |= b2Contact::e_islandFlag; - - b2Body* other = ce->other; - - // Was the other body already added to this island? - if (other->m_flags & b2Body::e_islandFlag) - { - continue; - } - - b2Assert(stackCount < stackSize); - stack[stackCount++] = other; - other->m_flags |= b2Body::e_islandFlag; - } - - // Search all joints connect to this body. - for (b2JointEdge* je = b->m_jointList; je; je = je->next) - { - if (je->joint->m_islandFlag == true) - { - continue; - } - - b2Body* other = je->other; - - // Don't simulate joints connected to inactive bodies. - if (other->IsActive() == false) - { - continue; - } - - island.Add(je->joint); - je->joint->m_islandFlag = true; - - if (other->m_flags & b2Body::e_islandFlag) - { - continue; - } - - b2Assert(stackCount < stackSize); - stack[stackCount++] = other; - other->m_flags |= b2Body::e_islandFlag; - } - } - - b2Profile profile; - island.Solve(&profile, step, m_gravity, m_allowSleep); - m_profile.solveInit += profile.solveInit; - m_profile.solveVelocity += profile.solveVelocity; - m_profile.solvePosition += profile.solvePosition; - - // Post solve cleanup. - for (int32 i = 0; i < island.m_bodyCount; ++i) - { - // Allow static bodies to participate in other islands. - b2Body* b = island.m_bodies[i]; - if (b->GetType() == b2_staticBody) - { - b->m_flags &= ~b2Body::e_islandFlag; - } - } - } - - m_stackAllocator.Free(stack); - - { - b2Timer timer; - // Synchronize fixtures, check for out of range bodies. - for (b2Body* b = m_bodyList; b; b = b->GetNext()) - { - // If a body was not in an island then it did not move. - if ((b->m_flags & b2Body::e_islandFlag) == 0) - { - continue; - } - - if (b->GetType() == b2_staticBody) - { - continue; - } - - // Update fixtures (for broad-phase). - b->SynchronizeFixtures(); - } - - // Look for new contacts. - m_contactManager.FindNewContacts(); - m_profile.broadphase = timer.GetMilliseconds(); - } -} - -// Find TOI contacts and solve them. -void b2World::SolveTOI(const b2TimeStep& step) -{ - b2Island island(2 * b2_maxTOIContacts, b2_maxTOIContacts, 0, &m_stackAllocator, m_contactManager.m_contactListener); - - if (m_stepComplete) - { - for (b2Body* b = m_bodyList; b; b = b->m_next) - { - b->m_flags &= ~b2Body::e_islandFlag; - b->m_sweep.alpha0 = 0.0f; - } - - for (b2Contact* c = m_contactManager.m_contactList; c; c = c->m_next) - { - // Invalidate TOI - c->m_flags &= ~(b2Contact::e_toiFlag | b2Contact::e_islandFlag); - c->m_toiCount = 0; - c->m_toi = 1.0f; - } - } - - // Find TOI events and solve them. - for (;;) - { - // Find the first TOI. - b2Contact* minContact = NULL; - float32 minAlpha = 1.0f; - - for (b2Contact* c = m_contactManager.m_contactList; c; c = c->m_next) - { - // Is this contact disabled? - if (c->IsEnabled() == false) - { - continue; - } - - // Prevent excessive sub-stepping. - if (c->m_toiCount > b2_maxSubSteps) - { - continue; - } - - float32 alpha = 1.0f; - if (c->m_flags & b2Contact::e_toiFlag) - { - // This contact has a valid cached TOI. - alpha = c->m_toi; - } - else - { - b2Fixture* fA = c->GetFixtureA(); - b2Fixture* fB = c->GetFixtureB(); - - // Is there a sensor? - if (fA->IsSensor() || fB->IsSensor()) - { - continue; - } - - b2Body* bA = fA->GetBody(); - b2Body* bB = fB->GetBody(); - - b2BodyType typeA = bA->m_type; - b2BodyType typeB = bB->m_type; - b2Assert(typeA == b2_dynamicBody || typeB == b2_dynamicBody); - - bool activeA = bA->IsAwake() && typeA != b2_staticBody; - bool activeB = bB->IsAwake() && typeB != b2_staticBody; - - // Is at least one body active (awake and dynamic or kinematic)? - if (activeA == false && activeB == false) - { - continue; - } - - bool collideA = bA->IsBullet() || typeA != b2_dynamicBody; - bool collideB = bB->IsBullet() || typeB != b2_dynamicBody; - - // Are these two non-bullet dynamic bodies? - if (collideA == false && collideB == false) - { - continue; - } - - // Compute the TOI for this contact. - // Put the sweeps onto the same time interval. - float32 alpha0 = bA->m_sweep.alpha0; - - if (bA->m_sweep.alpha0 < bB->m_sweep.alpha0) - { - alpha0 = bB->m_sweep.alpha0; - bA->m_sweep.Advance(alpha0); - } - else if (bB->m_sweep.alpha0 < bA->m_sweep.alpha0) - { - alpha0 = bA->m_sweep.alpha0; - bB->m_sweep.Advance(alpha0); - } - - b2Assert(alpha0 < 1.0f); - - int32 indexA = c->GetChildIndexA(); - int32 indexB = c->GetChildIndexB(); - - // Compute the time of impact in interval [0, minTOI] - b2TOIInput input; - input.proxyA.Set(fA->GetShape(), indexA); - input.proxyB.Set(fB->GetShape(), indexB); - input.sweepA = bA->m_sweep; - input.sweepB = bB->m_sweep; - input.tMax = 1.0f; - - b2TOIOutput output; - b2TimeOfImpact(&output, &input); - - // Beta is the fraction of the remaining portion of the . - float32 beta = output.t; - if (output.state == b2TOIOutput::e_touching) - { - alpha = b2Min(alpha0 + (1.0f - alpha0) * beta, 1.0f); - } - else - { - alpha = 1.0f; - } - - c->m_toi = alpha; - c->m_flags |= b2Contact::e_toiFlag; - } - - if (alpha < minAlpha) - { - // This is the minimum TOI found so far. - minContact = c; - minAlpha = alpha; - } - } - - if (minContact == NULL || 1.0f - 10.0f * b2_epsilon < minAlpha) - { - // No more TOI events. Done! - m_stepComplete = true; - break; - } - - // Advance the bodies to the TOI. - b2Fixture* fA = minContact->GetFixtureA(); - b2Fixture* fB = minContact->GetFixtureB(); - b2Body* bA = fA->GetBody(); - b2Body* bB = fB->GetBody(); - - b2Sweep backup1 = bA->m_sweep; - b2Sweep backup2 = bB->m_sweep; - - bA->Advance(minAlpha); - bB->Advance(minAlpha); - - // The TOI contact likely has some new contact points. - minContact->Update(m_contactManager.m_contactListener); - minContact->m_flags &= ~b2Contact::e_toiFlag; - ++minContact->m_toiCount; - - // Is the contact solid? - if (minContact->IsEnabled() == false || minContact->IsTouching() == false) - { - // Restore the sweeps. - minContact->SetEnabled(false); - bA->m_sweep = backup1; - bB->m_sweep = backup2; - bA->SynchronizeTransform(); - bB->SynchronizeTransform(); - continue; - } - - bA->SetAwake(true); - bB->SetAwake(true); - - // Build the island - island.Clear(); - island.Add(bA); - island.Add(bB); - island.Add(minContact); - - bA->m_flags |= b2Body::e_islandFlag; - bB->m_flags |= b2Body::e_islandFlag; - minContact->m_flags |= b2Contact::e_islandFlag; - - // Get contacts on bodyA and bodyB. - b2Body* bodies[2] = {bA, bB}; - for (int32 i = 0; i < 2; ++i) - { - b2Body* body = bodies[i]; - if (body->m_type == b2_dynamicBody) - { - for (b2ContactEdge* ce = body->m_contactList; ce; ce = ce->next) - { - if (island.m_bodyCount == island.m_bodyCapacity) - { - break; - } - - if (island.m_contactCount == island.m_contactCapacity) - { - break; - } - - b2Contact* contact = ce->contact; - - // Has this contact already been added to the island? - if (contact->m_flags & b2Contact::e_islandFlag) - { - continue; - } - - // Only add static, kinematic, or bullet bodies. - b2Body* other = ce->other; - if (other->m_type == b2_dynamicBody && - body->IsBullet() == false && other->IsBullet() == false) - { - continue; - } - - // Skip sensors. - bool sensorA = contact->m_fixtureA->m_isSensor; - bool sensorB = contact->m_fixtureB->m_isSensor; - if (sensorA || sensorB) - { - continue; - } - - // Tentatively advance the body to the TOI. - b2Sweep backup = other->m_sweep; - if ((other->m_flags & b2Body::e_islandFlag) == 0) - { - other->Advance(minAlpha); - } - - // Update the contact points - contact->Update(m_contactManager.m_contactListener); - - // Was the contact disabled by the user? - if (contact->IsEnabled() == false) - { - other->m_sweep = backup; - other->SynchronizeTransform(); - continue; - } - - // Are there contact points? - if (contact->IsTouching() == false) - { - other->m_sweep = backup; - other->SynchronizeTransform(); - continue; - } - - // Add the contact to the island - contact->m_flags |= b2Contact::e_islandFlag; - island.Add(contact); - - // Has the other body already been added to the island? - if (other->m_flags & b2Body::e_islandFlag) - { - continue; - } - - // Add the other body to the island. - other->m_flags |= b2Body::e_islandFlag; - - if (other->m_type != b2_staticBody) - { - other->SetAwake(true); - } - - island.Add(other); - } - } - } - - b2TimeStep subStep; - subStep.dt = (1.0f - minAlpha) * step.dt; - subStep.inv_dt = 1.0f / subStep.dt; - subStep.dtRatio = 1.0f; - subStep.positionIterations = 20; - subStep.velocityIterations = step.velocityIterations; - subStep.warmStarting = false; - island.SolveTOI(subStep, bA->m_islandIndex, bB->m_islandIndex); - - // Reset island flags and synchronize broad-phase proxies. - for (int32 i = 0; i < island.m_bodyCount; ++i) - { - b2Body* body = island.m_bodies[i]; - body->m_flags &= ~b2Body::e_islandFlag; - - if (body->m_type != b2_dynamicBody) - { - continue; - } - - body->SynchronizeFixtures(); - - // Invalidate all contact TOIs on this displaced body. - for (b2ContactEdge* ce = body->m_contactList; ce; ce = ce->next) - { - ce->contact->m_flags &= ~(b2Contact::e_toiFlag | b2Contact::e_islandFlag); - } - } - - // Commit fixture proxy movements to the broad-phase so that new contacts are created. - // Also, some contacts can be destroyed. - m_contactManager.FindNewContacts(); - - if (m_subStepping) - { - m_stepComplete = false; - break; - } - } -} - -void b2World::Step(float32 dt, int32 velocityIterations, int32 positionIterations) -{ - b2Timer stepTimer; - - // If new fixtures were added, we need to find the new contacts. - if (m_flags & e_newFixture) - { - m_contactManager.FindNewContacts(); - m_flags &= ~e_newFixture; - } - - m_flags |= e_locked; - - b2TimeStep step; - step.dt = dt; - step.velocityIterations = velocityIterations; - step.positionIterations = positionIterations; - if (dt > 0.0f) - { - step.inv_dt = 1.0f / dt; - } - else - { - step.inv_dt = 0.0f; - } - - step.dtRatio = m_inv_dt0 * dt; - - step.warmStarting = m_warmStarting; - - // Update contacts. This is where some contacts are destroyed. - { - b2Timer timer; - m_contactManager.Collide(); - m_profile.collide = timer.GetMilliseconds(); - } - - // Integrate velocities, solve velocity constraints, and integrate positions. - if (m_stepComplete && step.dt > 0.0f) - { - b2Timer timer; - Solve(step); - m_profile.solve = timer.GetMilliseconds(); - } - - // Handle TOI events. - if (m_continuousPhysics && step.dt > 0.0f) - { - b2Timer timer; - SolveTOI(step); - m_profile.solveTOI = timer.GetMilliseconds(); - } - - if (step.dt > 0.0f) - { - m_inv_dt0 = step.inv_dt; - } - - if (m_flags & e_clearForces) - { - ClearForces(); - } - - m_flags &= ~e_locked; - - m_profile.step = stepTimer.GetMilliseconds(); -} - -void b2World::ClearForces() -{ - for (b2Body* body = m_bodyList; body; body = body->GetNext()) - { - body->m_force.SetZero(); - body->m_torque = 0.0f; - } -} - -struct b2WorldQueryWrapper -{ - bool QueryCallback(int32 proxyId) - { - b2FixtureProxy* proxy = (b2FixtureProxy*)broadPhase->GetUserData(proxyId); - return callback->ReportFixture(proxy->fixture); - } - - const b2BroadPhase* broadPhase; - b2QueryCallback* callback; -}; - -void b2World::QueryAABB(b2QueryCallback* callback, const b2AABB& aabb) const -{ - b2WorldQueryWrapper wrapper; - wrapper.broadPhase = &m_contactManager.m_broadPhase; - wrapper.callback = callback; - m_contactManager.m_broadPhase.Query(&wrapper, aabb); -} - -struct b2WorldRayCastWrapper -{ - float32 RayCastCallback(const b2RayCastInput& input, int32 proxyId) - { - void* userData = broadPhase->GetUserData(proxyId); - b2FixtureProxy* proxy = (b2FixtureProxy*)userData; - b2Fixture* fixture = proxy->fixture; - int32 index = proxy->childIndex; - b2RayCastOutput output; - bool hit = fixture->RayCast(&output, input, index); - - if (hit) - { - float32 fraction = output.fraction; - b2Vec2 point = (1.0f - fraction) * input.p1 + fraction * input.p2; - return callback->ReportFixture(fixture, point, output.normal, fraction); - } - - return input.maxFraction; - } - - const b2BroadPhase* broadPhase; - b2RayCastCallback* callback; -}; - -void b2World::RayCast(b2RayCastCallback* callback, const b2Vec2& point1, const b2Vec2& point2) const -{ - b2WorldRayCastWrapper wrapper; - wrapper.broadPhase = &m_contactManager.m_broadPhase; - wrapper.callback = callback; - b2RayCastInput input; - input.maxFraction = 1.0f; - input.p1 = point1; - input.p2 = point2; - m_contactManager.m_broadPhase.RayCast(&wrapper, input); -} - -void b2World::DrawShape(b2Fixture* fixture, const b2Transform& xf, const b2Color& color) -{ - switch (fixture->GetType()) - { - case b2Shape::e_circle: - { - b2CircleShape* circle = (b2CircleShape*)fixture->GetShape(); - - b2Vec2 center = b2Mul(xf, circle->m_p); - float32 radius = circle->m_radius; - b2Vec2 axis = b2Mul(xf.q, b2Vec2(1.0f, 0.0f)); - - m_debugDraw->DrawSolidCircle(center, radius, axis, color); - } - break; - - case b2Shape::e_edge: - { - b2EdgeShape* edge = (b2EdgeShape*)fixture->GetShape(); - b2Vec2 v1 = b2Mul(xf, edge->m_vertex1); - b2Vec2 v2 = b2Mul(xf, edge->m_vertex2); - m_debugDraw->DrawSegment(v1, v2, color); - } - break; - - case b2Shape::e_chain: - { - b2ChainShape* chain = (b2ChainShape*)fixture->GetShape(); - int32 count = chain->m_count; - const b2Vec2* vertices = chain->m_vertices; - - b2Vec2 v1 = b2Mul(xf, vertices[0]); - for (int32 i = 1; i < count; ++i) - { - b2Vec2 v2 = b2Mul(xf, vertices[i]); - m_debugDraw->DrawSegment(v1, v2, color); - m_debugDraw->DrawCircle(v1, 0.05f, color); - v1 = v2; - } - } - break; - - case b2Shape::e_polygon: - { - b2PolygonShape* poly = (b2PolygonShape*)fixture->GetShape(); - int32 vertexCount = poly->m_vertexCount; - b2Assert(vertexCount <= b2_maxPolygonVertices); - b2Vec2 vertices[b2_maxPolygonVertices]; - - for (int32 i = 0; i < vertexCount; ++i) - { - vertices[i] = b2Mul(xf, poly->m_vertices[i]); - } - - m_debugDraw->DrawSolidPolygon(vertices, vertexCount, color); - } - break; - - default: - break; - } -} - -void b2World::DrawJoint(b2Joint* joint) -{ - b2Body* bodyA = joint->GetBodyA(); - b2Body* bodyB = joint->GetBodyB(); - const b2Transform& xf1 = bodyA->GetTransform(); - const b2Transform& xf2 = bodyB->GetTransform(); - b2Vec2 x1 = xf1.p; - b2Vec2 x2 = xf2.p; - b2Vec2 p1 = joint->GetAnchorA(); - b2Vec2 p2 = joint->GetAnchorB(); - - b2Color color(0.5f, 0.8f, 0.8f); - - switch (joint->GetType()) - { - case e_distanceJoint: - m_debugDraw->DrawSegment(p1, p2, color); - break; - - case e_pulleyJoint: - { - b2PulleyJoint* pulley = (b2PulleyJoint*)joint; - b2Vec2 s1 = pulley->GetGroundAnchorA(); - b2Vec2 s2 = pulley->GetGroundAnchorB(); - m_debugDraw->DrawSegment(s1, p1, color); - m_debugDraw->DrawSegment(s2, p2, color); - m_debugDraw->DrawSegment(s1, s2, color); - } - break; - - case e_mouseJoint: - // don't draw this - break; - - default: - m_debugDraw->DrawSegment(x1, p1, color); - m_debugDraw->DrawSegment(p1, p2, color); - m_debugDraw->DrawSegment(x2, p2, color); - } -} - -void b2World::DrawDebugData() -{ - if (m_debugDraw == NULL) - { - return; - } - - uint32 flags = m_debugDraw->GetFlags(); - - if (flags & b2Draw::e_shapeBit) - { - for (b2Body* b = m_bodyList; b; b = b->GetNext()) - { - const b2Transform& xf = b->GetTransform(); - for (b2Fixture* f = b->GetFixtureList(); f; f = f->GetNext()) - { - if (b->IsActive() == false) - { - DrawShape(f, xf, b2Color(0.5f, 0.5f, 0.3f)); - } - else if (b->GetType() == b2_staticBody) - { - DrawShape(f, xf, b2Color(0.5f, 0.9f, 0.5f)); - } - else if (b->GetType() == b2_kinematicBody) - { - DrawShape(f, xf, b2Color(0.5f, 0.5f, 0.9f)); - } - else if (b->IsAwake() == false) - { - DrawShape(f, xf, b2Color(0.6f, 0.6f, 0.6f)); - } - else - { - DrawShape(f, xf, b2Color(0.9f, 0.7f, 0.7f)); - } - } - } - } - - if (flags & b2Draw::e_jointBit) - { - for (b2Joint* j = m_jointList; j; j = j->GetNext()) - { - DrawJoint(j); - } - } - - if (flags & b2Draw::e_pairBit) - { - b2Color color(0.3f, 0.9f, 0.9f); - for (b2Contact* c = m_contactManager.m_contactList; c; c = c->GetNext()) - { - //b2Fixture* fixtureA = c->GetFixtureA(); - //b2Fixture* fixtureB = c->GetFixtureB(); - - //b2Vec2 cA = fixtureA->GetAABB().GetCenter(); - //b2Vec2 cB = fixtureB->GetAABB().GetCenter(); - - //m_debugDraw->DrawSegment(cA, cB, color); - } - } - - if (flags & b2Draw::e_aabbBit) - { - b2Color color(0.9f, 0.3f, 0.9f); - b2BroadPhase* bp = &m_contactManager.m_broadPhase; - - for (b2Body* b = m_bodyList; b; b = b->GetNext()) - { - if (b->IsActive() == false) - { - continue; - } - - for (b2Fixture* f = b->GetFixtureList(); f; f = f->GetNext()) - { - for (int32 i = 0; i < f->m_proxyCount; ++i) - { - b2FixtureProxy* proxy = f->m_proxies + i; - b2AABB aabb = bp->GetFatAABB(proxy->proxyId); - b2Vec2 vs[4]; - vs[0].Set(aabb.lowerBound.x, aabb.lowerBound.y); - vs[1].Set(aabb.upperBound.x, aabb.lowerBound.y); - vs[2].Set(aabb.upperBound.x, aabb.upperBound.y); - vs[3].Set(aabb.lowerBound.x, aabb.upperBound.y); - - m_debugDraw->DrawPolygon(vs, 4, color); - } - } - } - } - - if (flags & b2Draw::e_centerOfMassBit) - { - for (b2Body* b = m_bodyList; b; b = b->GetNext()) - { - b2Transform xf = b->GetTransform(); - xf.p = b->GetWorldCenter(); - m_debugDraw->DrawTransform(xf); - } - } -} - -int32 b2World::GetProxyCount() const -{ - return m_contactManager.m_broadPhase.GetProxyCount(); -} - -int32 b2World::GetTreeHeight() const -{ - return m_contactManager.m_broadPhase.GetTreeHeight(); -} - -int32 b2World::GetTreeBalance() const -{ - return m_contactManager.m_broadPhase.GetTreeBalance(); -} - -float32 b2World::GetTreeQuality() const -{ - return m_contactManager.m_broadPhase.GetTreeQuality(); -} - -void b2World::Dump() -{ - if ((m_flags & e_locked) == e_locked) - { - return; - } - - b2Log("b2Vec2 g(%.15lef, %.15lef);\n", m_gravity.x, m_gravity.y); - b2Log("m_world->SetGravity(g);\n"); - - b2Log("b2Body** bodies = (b2Body**)b2Alloc(%d * sizeof(b2Body*));\n", m_bodyCount); - b2Log("b2Joint** joints = (b2Joint**)b2Alloc(%d * sizeof(b2Joint*));\n", m_jointCount); - int32 i = 0; - for (b2Body* b = m_bodyList; b; b = b->m_next) - { - b->m_islandIndex = i; - b->Dump(); - ++i; - } - - i = 0; - for (b2Joint* j = m_jointList; j; j = j->m_next) - { - j->m_index = i; - ++i; - } - - // First pass on joints, skip gear joints. - for (b2Joint* j = m_jointList; j; j = j->m_next) - { - if (j->m_type == e_gearJoint) - { - continue; - } - - b2Log("{\n"); - j->Dump(); - b2Log("}\n"); - } - - // Second pass on joints, only gear joints. - for (b2Joint* j = m_jointList; j; j = j->m_next) - { - if (j->m_type != e_gearJoint) - { - continue; - } - - b2Log("{\n"); - j->Dump(); - b2Log("}\n"); - } - - b2Log("b2Free(joints);\n"); - b2Log("b2Free(bodies);\n"); - b2Log("joints = NULL;\n"); - b2Log("bodies = NULL;\n"); -} diff --git a/external/Box2D/Dynamics/b2World.h b/external/Box2D/Dynamics/b2World.h deleted file mode 100644 index f207930511..0000000000 --- a/external/Box2D/Dynamics/b2World.h +++ /dev/null @@ -1,349 +0,0 @@ -/* -* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_WORLD_H -#define B2_WORLD_H - -#include -#include -#include -#include -#include -#include - -struct b2AABB; -struct b2BodyDef; -struct b2Color; -struct b2JointDef; -class b2Body; -class b2Draw; -class b2Fixture; -class b2Joint; - -/// The world class manages all physics entities, dynamic simulation, -/// and asynchronous queries. The world also contains efficient memory -/// management facilities. -class b2World -{ -public: - /// Construct a world object. - /// @param gravity the world gravity vector. - b2World(const b2Vec2& gravity); - - /// Destruct the world. All physics entities are destroyed and all heap memory is released. - ~b2World(); - - /// Register a destruction listener. The listener is owned by you and must - /// remain in scope. - void SetDestructionListener(b2DestructionListener* listener); - - /// Register a contact filter to provide specific control over collision. - /// Otherwise the default filter is used (b2_defaultFilter). The listener is - /// owned by you and must remain in scope. - void SetContactFilter(b2ContactFilter* filter); - - /// Register a contact event listener. The listener is owned by you and must - /// remain in scope. - void SetContactListener(b2ContactListener* listener); - - /// Register a routine for debug drawing. The debug draw functions are called - /// inside with b2World::DrawDebugData method. The debug draw object is owned - /// by you and must remain in scope. - void SetDebugDraw(b2Draw* debugDraw); - - /// Create a rigid body given a definition. No reference to the definition - /// is retained. - /// @warning This function is locked during callbacks. - b2Body* CreateBody(const b2BodyDef* def); - - /// Destroy a rigid body given a definition. No reference to the definition - /// is retained. This function is locked during callbacks. - /// @warning This automatically deletes all associated shapes and joints. - /// @warning This function is locked during callbacks. - void DestroyBody(b2Body* body); - - /// Create a joint to constrain bodies together. No reference to the definition - /// is retained. This may cause the connected bodies to cease colliding. - /// @warning This function is locked during callbacks. - b2Joint* CreateJoint(const b2JointDef* def); - - /// Destroy a joint. This may cause the connected bodies to begin colliding. - /// @warning This function is locked during callbacks. - void DestroyJoint(b2Joint* joint); - - /// Take a time step. This performs collision detection, integration, - /// and constraint solution. - /// @param timeStep the amount of time to simulate, this should not vary. - /// @param velocityIterations for the velocity constraint solver. - /// @param positionIterations for the position constraint solver. - void Step( float32 timeStep, - int32 velocityIterations, - int32 positionIterations); - - /// Manually clear the force buffer on all bodies. By default, forces are cleared automatically - /// after each call to Step. The default behavior is modified by calling SetAutoClearForces. - /// The purpose of this function is to support sub-stepping. Sub-stepping is often used to maintain - /// a fixed sized time step under a variable frame-rate. - /// When you perform sub-stepping you will disable auto clearing of forces and instead call - /// ClearForces after all sub-steps are complete in one pass of your game loop. - /// @see SetAutoClearForces - void ClearForces(); - - /// Call this to draw shapes and other debug draw data. - void DrawDebugData(); - - /// Query the world for all fixtures that potentially overlap the - /// provided AABB. - /// @param callback a user implemented callback class. - /// @param aabb the query box. - void QueryAABB(b2QueryCallback* callback, const b2AABB& aabb) const; - - /// Ray-cast the world for all fixtures in the path of the ray. Your callback - /// controls whether you get the closest point, any point, or n-points. - /// The ray-cast ignores shapes that contain the starting point. - /// @param callback a user implemented callback class. - /// @param point1 the ray starting point - /// @param point2 the ray ending point - void RayCast(b2RayCastCallback* callback, const b2Vec2& point1, const b2Vec2& point2) const; - - /// Get the world body list. With the returned body, use b2Body::GetNext to get - /// the next body in the world list. A NULL body indicates the end of the list. - /// @return the head of the world body list. - b2Body* GetBodyList(); - const b2Body* GetBodyList() const; - - /// Get the world joint list. With the returned joint, use b2Joint::GetNext to get - /// the next joint in the world list. A NULL joint indicates the end of the list. - /// @return the head of the world joint list. - b2Joint* GetJointList(); - const b2Joint* GetJointList() const; - - /// Get the world contact list. With the returned contact, use b2Contact::GetNext to get - /// the next contact in the world list. A NULL contact indicates the end of the list. - /// @return the head of the world contact list. - /// @warning contacts are created and destroyed in the middle of a time step. - /// Use b2ContactListener to avoid missing contacts. - b2Contact* GetContactList(); - const b2Contact* GetContactList() const; - - /// Enable/disable sleep. - void SetAllowSleeping(bool flag); - bool GetAllowSleeping() const { return m_allowSleep; } - - /// Enable/disable warm starting. For testing. - void SetWarmStarting(bool flag) { m_warmStarting = flag; } - bool GetWarmStarting() const { return m_warmStarting; } - - /// Enable/disable continuous physics. For testing. - void SetContinuousPhysics(bool flag) { m_continuousPhysics = flag; } - bool GetContinuousPhysics() const { return m_continuousPhysics; } - - /// Enable/disable single stepped continuous physics. For testing. - void SetSubStepping(bool flag) { m_subStepping = flag; } - bool GetSubStepping() const { return m_subStepping; } - - /// Get the number of broad-phase proxies. - int32 GetProxyCount() const; - - /// Get the number of bodies. - int32 GetBodyCount() const; - - /// Get the number of joints. - int32 GetJointCount() const; - - /// Get the number of contacts (each may have 0 or more contact points). - int32 GetContactCount() const; - - /// Get the height of the dynamic tree. - int32 GetTreeHeight() const; - - /// Get the balance of the dynamic tree. - int32 GetTreeBalance() const; - - /// Get the quality metric of the dynamic tree. The smaller the better. - /// The minimum is 1. - float32 GetTreeQuality() const; - - /// Change the global gravity vector. - void SetGravity(const b2Vec2& gravity); - - /// Get the global gravity vector. - b2Vec2 GetGravity() const; - - /// Is the world locked (in the middle of a time step). - bool IsLocked() const; - - /// Set flag to control automatic clearing of forces after each time step. - void SetAutoClearForces(bool flag); - - /// Get the flag that controls automatic clearing of forces after each time step. - bool GetAutoClearForces() const; - - /// Get the contact manager for testing. - const b2ContactManager& GetContactManager() const; - - /// Get the current profile. - const b2Profile& GetProfile() const; - - /// Dump the world into the log file. - /// @warning this should be called outside of a time step. - void Dump(); - -private: - - // m_flags - enum - { - e_newFixture = 0x0001, - e_locked = 0x0002, - e_clearForces = 0x0004 - }; - - friend class b2Body; - friend class b2Fixture; - friend class b2ContactManager; - friend class b2Controller; - - void Solve(const b2TimeStep& step); - void SolveTOI(const b2TimeStep& step); - - void DrawJoint(b2Joint* joint); - void DrawShape(b2Fixture* shape, const b2Transform& xf, const b2Color& color); - - b2BlockAllocator m_blockAllocator; - b2StackAllocator m_stackAllocator; - - int32 m_flags; - - b2ContactManager m_contactManager; - - b2Body* m_bodyList; - b2Joint* m_jointList; - - int32 m_bodyCount; - int32 m_jointCount; - - b2Vec2 m_gravity; - bool m_allowSleep; - - b2DestructionListener* m_destructionListener; - b2Draw* m_debugDraw; - - // This is used to compute the time step ratio to - // support a variable time step. - float32 m_inv_dt0; - - // These are for debugging the solver. - bool m_warmStarting; - bool m_continuousPhysics; - bool m_subStepping; - - bool m_stepComplete; - - b2Profile m_profile; -}; - -inline b2Body* b2World::GetBodyList() -{ - return m_bodyList; -} - -inline const b2Body* b2World::GetBodyList() const -{ - return m_bodyList; -} - -inline b2Joint* b2World::GetJointList() -{ - return m_jointList; -} - -inline const b2Joint* b2World::GetJointList() const -{ - return m_jointList; -} - -inline b2Contact* b2World::GetContactList() -{ - return m_contactManager.m_contactList; -} - -inline const b2Contact* b2World::GetContactList() const -{ - return m_contactManager.m_contactList; -} - -inline int32 b2World::GetBodyCount() const -{ - return m_bodyCount; -} - -inline int32 b2World::GetJointCount() const -{ - return m_jointCount; -} - -inline int32 b2World::GetContactCount() const -{ - return m_contactManager.m_contactCount; -} - -inline void b2World::SetGravity(const b2Vec2& gravity) -{ - m_gravity = gravity; -} - -inline b2Vec2 b2World::GetGravity() const -{ - return m_gravity; -} - -inline bool b2World::IsLocked() const -{ - return (m_flags & e_locked) == e_locked; -} - -inline void b2World::SetAutoClearForces(bool flag) -{ - if (flag) - { - m_flags |= e_clearForces; - } - else - { - m_flags &= ~e_clearForces; - } -} - -/// Get the flag that controls automatic clearing of forces after each time step. -inline bool b2World::GetAutoClearForces() const -{ - return (m_flags & e_clearForces) == e_clearForces; -} - -inline const b2ContactManager& b2World::GetContactManager() const -{ - return m_contactManager; -} - -inline const b2Profile& b2World::GetProfile() const -{ - return m_profile; -} - -#endif diff --git a/external/Box2D/Dynamics/b2WorldCallbacks.cpp b/external/Box2D/Dynamics/b2WorldCallbacks.cpp deleted file mode 100644 index 48ad0cc46a..0000000000 --- a/external/Box2D/Dynamics/b2WorldCallbacks.cpp +++ /dev/null @@ -1,36 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include - -// Return true if contact calculations should be performed between these two shapes. -// If you implement your own collision filter you may want to build from this implementation. -bool b2ContactFilter::ShouldCollide(b2Fixture* fixtureA, b2Fixture* fixtureB) -{ - const b2Filter& filterA = fixtureA->GetFilterData(); - const b2Filter& filterB = fixtureB->GetFilterData(); - - if (filterA.groupIndex == filterB.groupIndex && filterA.groupIndex != 0) - { - return filterA.groupIndex > 0; - } - - bool collide = (filterA.maskBits & filterB.categoryBits) != 0 && (filterA.categoryBits & filterB.maskBits) != 0; - return collide; -} diff --git a/external/Box2D/Dynamics/b2WorldCallbacks.h b/external/Box2D/Dynamics/b2WorldCallbacks.h deleted file mode 100644 index 86c04e3e32..0000000000 --- a/external/Box2D/Dynamics/b2WorldCallbacks.h +++ /dev/null @@ -1,155 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_WORLD_CALLBACKS_H -#define B2_WORLD_CALLBACKS_H - -#include - -struct b2Vec2; -struct b2Transform; -class b2Fixture; -class b2Body; -class b2Joint; -class b2Contact; -struct b2ContactResult; -struct b2Manifold; - -/// Joints and fixtures are destroyed when their associated -/// body is destroyed. Implement this listener so that you -/// may nullify references to these joints and shapes. -class b2DestructionListener -{ -public: - virtual ~b2DestructionListener() {} - - /// Called when any joint is about to be destroyed due - /// to the destruction of one of its attached bodies. - virtual void SayGoodbye(b2Joint* joint) = 0; - - /// Called when any fixture is about to be destroyed due - /// to the destruction of its parent body. - virtual void SayGoodbye(b2Fixture* fixture) = 0; -}; - -/// Implement this class to provide collision filtering. In other words, you can implement -/// this class if you want finer control over contact creation. -class b2ContactFilter -{ -public: - virtual ~b2ContactFilter() {} - - /// Return true if contact calculations should be performed between these two shapes. - /// @warning for performance reasons this is only called when the AABBs begin to overlap. - virtual bool ShouldCollide(b2Fixture* fixtureA, b2Fixture* fixtureB); -}; - -/// Contact impulses for reporting. Impulses are used instead of forces because -/// sub-step forces may approach infinity for rigid body collisions. These -/// match up one-to-one with the contact points in b2Manifold. -struct b2ContactImpulse -{ - float32 normalImpulses[b2_maxManifoldPoints]; - float32 tangentImpulses[b2_maxManifoldPoints]; - int32 count; -}; - -/// Implement this class to get contact information. You can use these results for -/// things like sounds and game logic. You can also get contact results by -/// traversing the contact lists after the time step. However, you might miss -/// some contacts because continuous physics leads to sub-stepping. -/// Additionally you may receive multiple callbacks for the same contact in a -/// single time step. -/// You should strive to make your callbacks efficient because there may be -/// many callbacks per time step. -/// @warning You cannot create/destroy Box2D entities inside these callbacks. -class b2ContactListener -{ -public: - virtual ~b2ContactListener() {} - - /// Called when two fixtures begin to touch. - virtual void BeginContact(b2Contact* contact) { B2_NOT_USED(contact); } - - /// Called when two fixtures cease to touch. - virtual void EndContact(b2Contact* contact) { B2_NOT_USED(contact); } - - /// This is called after a contact is updated. This allows you to inspect a - /// contact before it goes to the solver. If you are careful, you can modify the - /// contact manifold (e.g. disable contact). - /// A copy of the old manifold is provided so that you can detect changes. - /// Note: this is called only for awake bodies. - /// Note: this is called even when the number of contact points is zero. - /// Note: this is not called for sensors. - /// Note: if you set the number of contact points to zero, you will not - /// get an EndContact callback. However, you may get a BeginContact callback - /// the next step. - virtual void PreSolve(b2Contact* contact, const b2Manifold* oldManifold) - { - B2_NOT_USED(contact); - B2_NOT_USED(oldManifold); - } - - /// This lets you inspect a contact after the solver is finished. This is useful - /// for inspecting impulses. - /// Note: the contact manifold does not include time of impact impulses, which can be - /// arbitrarily large if the sub-step is small. Hence the impulse is provided explicitly - /// in a separate data structure. - /// Note: this is only called for contacts that are touching, solid, and awake. - virtual void PostSolve(b2Contact* contact, const b2ContactImpulse* impulse) - { - B2_NOT_USED(contact); - B2_NOT_USED(impulse); - } -}; - -/// Callback class for AABB queries. -/// See b2World::Query -class b2QueryCallback -{ -public: - virtual ~b2QueryCallback() {} - - /// Called for each fixture found in the query AABB. - /// @return false to terminate the query. - virtual bool ReportFixture(b2Fixture* fixture) = 0; -}; - -/// Callback class for ray casts. -/// See b2World::RayCast -class b2RayCastCallback -{ -public: - virtual ~b2RayCastCallback() {} - - /// Called for each fixture found in the query. You control how the ray cast - /// proceeds by returning a float: - /// return -1: ignore this fixture and continue - /// return 0: terminate the ray cast - /// return fraction: clip the ray to this point - /// return 1: don't clip the ray and continue - /// @param fixture the fixture hit by the ray - /// @param point the point of initial intersection - /// @param normal the normal vector at the point of intersection - /// @return -1 to filter, 0 to terminate, fraction to clip the ray for - /// closest hit, 1 to continue - virtual float32 ReportFixture( b2Fixture* fixture, const b2Vec2& point, - const b2Vec2& normal, float32 fraction) = 0; -}; - -#endif diff --git a/external/Box2D/Rope/b2Rope.cpp b/external/Box2D/Rope/b2Rope.cpp deleted file mode 100644 index 9bf671aec9..0000000000 --- a/external/Box2D/Rope/b2Rope.cpp +++ /dev/null @@ -1,259 +0,0 @@ -/* -* Copyright (c) 2011 Erin Catto http://box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include - -b2Rope::b2Rope() -{ - m_count = 0; - m_ps = NULL; - m_p0s = NULL; - m_vs = NULL; - m_ims = NULL; - m_Ls = NULL; - m_as = NULL; - m_gravity.SetZero(); - m_k2 = 1.0f; - m_k3 = 0.1f; -} - -b2Rope::~b2Rope() -{ - b2Free(m_ps); - b2Free(m_p0s); - b2Free(m_vs); - b2Free(m_ims); - b2Free(m_Ls); - b2Free(m_as); -} - -void b2Rope::Initialize(const b2RopeDef* def) -{ - b2Assert(def->count >= 3); - m_count = def->count; - m_ps = (b2Vec2*)b2Alloc(m_count * sizeof(b2Vec2)); - m_p0s = (b2Vec2*)b2Alloc(m_count * sizeof(b2Vec2)); - m_vs = (b2Vec2*)b2Alloc(m_count * sizeof(b2Vec2)); - m_ims = (float32*)b2Alloc(m_count * sizeof(float32)); - - for (int32 i = 0; i < m_count; ++i) - { - m_ps[i] = def->vertices[i]; - m_p0s[i] = def->vertices[i]; - m_vs[i].SetZero(); - - float32 m = def->masses[i]; - if (m > 0.0f) - { - m_ims[i] = 1.0f / m; - } - else - { - m_ims[i] = 0.0f; - } - } - - int32 count2 = m_count - 1; - int32 count3 = m_count - 2; - m_Ls = (float32*)b2Alloc(count2 * sizeof(float32)); - m_as = (float32*)b2Alloc(count3 * sizeof(float32)); - - for (int32 i = 0; i < count2; ++i) - { - b2Vec2 p1 = m_ps[i]; - b2Vec2 p2 = m_ps[i+1]; - m_Ls[i] = b2Distance(p1, p2); - } - - for (int32 i = 0; i < count3; ++i) - { - b2Vec2 p1 = m_ps[i]; - b2Vec2 p2 = m_ps[i + 1]; - b2Vec2 p3 = m_ps[i + 2]; - - b2Vec2 d1 = p2 - p1; - b2Vec2 d2 = p3 - p2; - - float32 a = b2Cross(d1, d2); - float32 b = b2Dot(d1, d2); - - m_as[i] = b2Atan2(a, b); - } - - m_gravity = def->gravity; - m_damping = def->damping; - m_k2 = def->k2; - m_k3 = def->k3; -} - -void b2Rope::Step(float32 h, int32 iterations) -{ - if (h == 0.0) - { - return; - } - - float32 d = expf(- h * m_damping); - - for (int32 i = 0; i < m_count; ++i) - { - m_p0s[i] = m_ps[i]; - if (m_ims[i] > 0.0f) - { - m_vs[i] += h * m_gravity; - } - m_vs[i] *= d; - m_ps[i] += h * m_vs[i]; - - } - - for (int32 i = 0; i < iterations; ++i) - { - SolveC2(); - SolveC3(); - SolveC2(); - } - - float32 inv_h = 1.0f / h; - for (int32 i = 0; i < m_count; ++i) - { - m_vs[i] = inv_h * (m_ps[i] - m_p0s[i]); - } -} - -void b2Rope::SolveC2() -{ - int32 count2 = m_count - 1; - - for (int32 i = 0; i < count2; ++i) - { - b2Vec2 p1 = m_ps[i]; - b2Vec2 p2 = m_ps[i + 1]; - - b2Vec2 d = p2 - p1; - float32 L = d.Normalize(); - - float32 im1 = m_ims[i]; - float32 im2 = m_ims[i + 1]; - - if (im1 + im2 == 0.0f) - { - continue; - } - - float32 s1 = im1 / (im1 + im2); - float32 s2 = im2 / (im1 + im2); - - p1 -= m_k2 * s1 * (m_Ls[i] - L) * d; - p2 += m_k2 * s2 * (m_Ls[i] - L) * d; - - m_ps[i] = p1; - m_ps[i + 1] = p2; - } -} - -void b2Rope::SetAngle(float32 angle) -{ - int32 count3 = m_count - 2; - for (int32 i = 0; i < count3; ++i) - { - m_as[i] = angle; - } -} - -void b2Rope::SolveC3() -{ - int32 count3 = m_count - 2; - - for (int32 i = 0; i < count3; ++i) - { - b2Vec2 p1 = m_ps[i]; - b2Vec2 p2 = m_ps[i + 1]; - b2Vec2 p3 = m_ps[i + 2]; - - float32 m1 = m_ims[i]; - float32 m2 = m_ims[i + 1]; - float32 m3 = m_ims[i + 2]; - - b2Vec2 d1 = p2 - p1; - b2Vec2 d2 = p3 - p2; - - float32 L1sqr = d1.LengthSquared(); - float32 L2sqr = d2.LengthSquared(); - - if (L1sqr * L2sqr == 0.0f) - { - continue; - } - - float32 a = b2Cross(d1, d2); - float32 b = b2Dot(d1, d2); - - float32 angle = b2Atan2(a, b); - - b2Vec2 Jd1 = (-1.0f / L1sqr) * d1.Skew(); - b2Vec2 Jd2 = (1.0f / L2sqr) * d2.Skew(); - - b2Vec2 J1 = -Jd1; - b2Vec2 J2 = Jd1 - Jd2; - b2Vec2 J3 = Jd2; - - float32 mass = m1 * b2Dot(J1, J1) + m2 * b2Dot(J2, J2) + m3 * b2Dot(J3, J3); - if (mass == 0.0f) - { - continue; - } - - mass = 1.0f / mass; - - float32 C = angle - m_as[i]; - - while (C > b2_pi) - { - angle -= 2 * b2_pi; - C = angle - m_as[i]; - } - - while (C < -b2_pi) - { - angle += 2.0f * b2_pi; - C = angle - m_as[i]; - } - - float32 impulse = - m_k3 * mass * C; - - p1 += (m1 * impulse) * J1; - p2 += (m2 * impulse) * J2; - p3 += (m3 * impulse) * J3; - - m_ps[i] = p1; - m_ps[i + 1] = p2; - m_ps[i + 2] = p3; - } -} - -void b2Rope::Draw(b2Draw* draw) const -{ - b2Color c(0.4f, 0.5f, 0.7f); - - for (int32 i = 0; i < m_count - 1; ++i) - { - draw->DrawSegment(m_ps[i], m_ps[i+1], c); - } -} diff --git a/external/Box2D/Rope/b2Rope.h b/external/Box2D/Rope/b2Rope.h deleted file mode 100644 index b981dfd6c5..0000000000 --- a/external/Box2D/Rope/b2Rope.h +++ /dev/null @@ -1,115 +0,0 @@ -/* -* Copyright (c) 2011 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_ROPE_H -#define B2_ROPE_H - -#include - -class b2Draw; - -/// -struct b2RopeDef -{ - b2RopeDef() - { - vertices = NULL; - count = 0; - masses = NULL; - gravity.SetZero(); - damping = 0.1f; - k2 = 0.9f; - k3 = 0.1f; - } - - /// - b2Vec2* vertices; - - /// - int32 count; - - /// - float32* masses; - - /// - b2Vec2 gravity; - - /// - float32 damping; - - /// Stretching stiffness - float32 k2; - - /// Bending stiffness. Values above 0.5 can make the simulation blow up. - float32 k3; -}; - -/// -class b2Rope -{ -public: - b2Rope(); - ~b2Rope(); - - /// - void Initialize(const b2RopeDef* def); - - /// - void Step(float32 timeStep, int32 iterations); - - /// - int32 GetVertexCount() const - { - return m_count; - } - - /// - const b2Vec2* GetVertices() const - { - return m_ps; - } - - /// - void Draw(b2Draw* draw) const; - - /// - void SetAngle(float32 angle); - -private: - - void SolveC2(); - void SolveC3(); - - int32 m_count; - b2Vec2* m_ps; - b2Vec2* m_p0s; - b2Vec2* m_vs; - - float32* m_ims; - - float32* m_Ls; - float32* m_as; - - b2Vec2 m_gravity; - float32 m_damping; - - float32 m_k2; - float32 m_k3; -}; - -#endif diff --git a/external/Box2D/proj.linux/.cproject b/external/Box2D/proj.linux/.cproject deleted file mode 100644 index 5aa092cac3..0000000000 --- a/external/Box2D/proj.linux/.cproject +++ /dev/null @@ -1,267 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/external/Box2D/proj.linux/.project b/external/Box2D/proj.linux/.project deleted file mode 100644 index 164d50f52a..0000000000 --- a/external/Box2D/proj.linux/.project +++ /dev/null @@ -1,110 +0,0 @@ - - - libBox2D - - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.autoBuildTarget - all - - - org.eclipse.cdt.make.core.buildArguments - - - - org.eclipse.cdt.make.core.buildCommand - make - - - org.eclipse.cdt.make.core.buildLocation - ${workspace_loc:/libBox2D/Debug} - - - org.eclipse.cdt.make.core.cleanBuildTarget - clean - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - false - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.fullBuildTarget - all - - - org.eclipse.cdt.make.core.stopOnError - true - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - true - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.core.ccnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - - - - Box2D.h - 1 - PARENT-1-PROJECT_LOC/Box2D.h - - - Collision - 2 - PARENT-1-PROJECT_LOC/Collision - - - Common - 2 - PARENT-1-PROJECT_LOC/Common - - - Dynamics - 2 - PARENT-1-PROJECT_LOC/Dynamics - - - Rope - 2 - PARENT-1-PROJECT_LOC/Rope - - - diff --git a/external/Box2D/proj.linux/Makefile b/external/Box2D/proj.linux/Makefile deleted file mode 100644 index e430bc9883..0000000000 --- a/external/Box2D/proj.linux/Makefile +++ /dev/null @@ -1,72 +0,0 @@ -TARGET = libbox2d.a - -SOURCES = ../Collision/Shapes/b2ChainShape.cpp \ -../Collision/Shapes/b2CircleShape.cpp \ -../Collision/Shapes/b2EdgeShape.cpp \ -../Collision/Shapes/b2PolygonShape.cpp \ -../Collision/b2BroadPhase.cpp \ -../Collision/b2CollideCircle.cpp \ -../Collision/b2CollideEdge.cpp \ -../Collision/b2CollidePolygon.cpp \ -../Collision/b2Collision.cpp \ -../Collision/b2Distance.cpp \ -../Collision/b2DynamicTree.cpp \ -../Collision/b2TimeOfImpact.cpp \ -../Common/b2BlockAllocator.cpp \ -../Common/b2Draw.cpp \ -../Common/b2Math.cpp \ -../Common/b2Settings.cpp \ -../Common/b2StackAllocator.cpp \ -../Common/b2Timer.cpp \ -../Dynamics/Contacts/b2ChainAndCircleContact.cpp \ -../Dynamics/Contacts/b2ChainAndPolygonContact.cpp \ -../Dynamics/Contacts/b2CircleContact.cpp \ -../Dynamics/Contacts/b2Contact.cpp \ -../Dynamics/Contacts/b2ContactSolver.cpp \ -../Dynamics/Contacts/b2EdgeAndCircleContact.cpp \ -../Dynamics/Contacts/b2EdgeAndPolygonContact.cpp \ -../Dynamics/Contacts/b2PolygonAndCircleContact.cpp \ -../Dynamics/Contacts/b2PolygonContact.cpp \ -../Dynamics/Joints/b2DistanceJoint.cpp \ -../Dynamics/Joints/b2FrictionJoint.cpp \ -../Dynamics/Joints/b2GearJoint.cpp \ -../Dynamics/Joints/b2Joint.cpp \ -../Dynamics/Joints/b2MouseJoint.cpp \ -../Dynamics/Joints/b2PrismaticJoint.cpp \ -../Dynamics/Joints/b2PulleyJoint.cpp \ -../Dynamics/Joints/b2RevoluteJoint.cpp \ -../Dynamics/Joints/b2RopeJoint.cpp \ -../Dynamics/Joints/b2WeldJoint.cpp \ -../Dynamics/Joints/b2WheelJoint.cpp \ -../Dynamics/b2Body.cpp \ -../Dynamics/b2ContactManager.cpp \ -../Dynamics/b2Fixture.cpp \ -../Dynamics/b2Island.cpp \ -../Dynamics/b2World.cpp \ -../Dynamics/b2WorldCallbacks.cpp \ -../Rope/b2Rope.cpp - -include ../../../cocos2dx/proj.linux/cocos2dx.mk - -INCLUDES = -I../.. - -# Cocos2d is not responsible for warnings in external projects -CXXFLAGS += -w - -ifeq ($(DEBUG), 1) -DEFINES = -D_DEBUG -else -DEFINES = -endif - -TARGET := $(LIB_DIR)/$(TARGET) - -all: $(TARGET) - -$(TARGET): $(OBJECTS) $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(LOG_AR)$(AR) $(ARFLAGS) $(TARGET) $(OBJECTS) - -$(OBJ_DIR)/%.o: ../%.cpp $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(LOG_CXX)$(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@ diff --git a/external/Box2D/proj.linux/box2d.prf b/external/Box2D/proj.linux/box2d.prf deleted file mode 100644 index 434ad88406..0000000000 --- a/external/Box2D/proj.linux/box2d.prf +++ /dev/null @@ -1,19 +0,0 @@ -################################################################################ -# Do not include this file in your project: see cocos2dx.pri. -################################################################################ - -linux { - # We will compile box2d on demand using Makefile. - build_box2d.name = Build box2d static library - build_box2d.input = $$PWD/Makefile - build_box2d.output = $$CC_LIBRARY_DIR/libbox2d.a - build_box2d.target = $$CC_LIBRARY_DIR/libbox2d.a - build_box2d.CONFIG = no_link target_predeps - build_box2d.commands = cd $$PWD && make $$CC_MAKE_FLAGS - - QMAKE_EXTRA_COMPILERS += build_box2d - QMAKE_EXTRA_TARGETS += build_box2d - - PRE_TARGETDEPS += $$CC_LIBRARY_DIR/libbox2d.a - LIBS += -Wl,-Bstatic -lbox2d -Wl,-Bdynamic -} diff --git a/external/Box2D/proj.win32/Box2D.vcxproj b/external/Box2D/proj.win32/Box2D.vcxproj deleted file mode 100644 index cd4bd2086c..0000000000 --- a/external/Box2D/proj.win32/Box2D.vcxproj +++ /dev/null @@ -1,194 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - libBox2D - {929480E7-23C0-4DF6-8456-096D71547116} - Box2D.win32 - Win32Proj - - - - StaticLibrary - Unicode - v100 - v110 - v110_xp - - - StaticLibrary - Unicode - v100 - v110 - v110_xp - - - - - - - - - - - - - <_ProjectFileVersion>10.0.40219.1 - $(SolutionDir)$(Configuration).win32\ - $(Configuration).win32\ - $(SolutionDir)$(Configuration).win32\ - $(Configuration).win32\ - AllRules.ruleset - - - AllRules.ruleset - - - - - $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\lib;$(LibraryPath) - - - $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\lib;$(LibraryPath) - - - - Disabled - $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\include;../../;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) - false - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - EditAndContinue - true - - - $(OutDir)$(ProjectName).lib - - - - - $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\include;../../;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) - MultiThreadedDLL - - - Level3 - ProgramDatabase - true - - - $(OutDir)$(ProjectName).lib - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/external/Box2D/proj.win32/Box2D.vcxproj.filters b/external/Box2D/proj.win32/Box2D.vcxproj.filters deleted file mode 100644 index e810cbb0cf..0000000000 --- a/external/Box2D/proj.win32/Box2D.vcxproj.filters +++ /dev/null @@ -1,301 +0,0 @@ - - - - - {bdf099c5-cc32-468b-b53f-ec010d7f823f} - - - {92792f88-4e5c-46ee-8d87-002f3b2297ae} - - - {f41a6fa6-5ac1-4514-9ac0-6f3a38f35b4d} - - - {0b56913a-34b7-410a-b386-869d6f7a20be} - - - {f0e7b230-79cc-49b8-9ed7-9dbfa062f2a4} - - - {932f2008-afbe-42f5-993d-a1df0ec67756} - - - {f8937e09-93a4-49fa-8f3e-dfc36da764df} - - - - - Collision - - - Collision - - - Collision - - - Collision - - - Collision - - - Collision - - - Collision - - - Collision - - - Collision\Shapes - - - Collision\Shapes - - - Collision\Shapes - - - Collision\Shapes - - - Common - - - Common - - - Common - - - Common - - - Common - - - Common - - - Dynamics - - - Dynamics - - - Dynamics - - - Dynamics - - - Dynamics - - - Dynamics - - - Dynamics\Contacts - - - Dynamics\Contacts - - - Dynamics\Contacts - - - Dynamics\Contacts - - - Dynamics\Contacts - - - Dynamics\Contacts - - - Dynamics\Contacts - - - Dynamics\Contacts - - - Dynamics\Contacts - - - Dynamics\Joints - - - Dynamics\Joints - - - Dynamics\Joints - - - Dynamics\Joints - - - Dynamics\Joints - - - Dynamics\Joints - - - Dynamics\Joints - - - Dynamics\Joints - - - Dynamics\Joints - - - Dynamics\Joints - - - Dynamics\Joints - - - Rope - - - - - Collision - - - Collision - - - Collision - - - Collision - - - Collision - - - Collision\Shapes - - - Collision\Shapes - - - Collision\Shapes - - - Collision\Shapes - - - Collision\Shapes - - - Common - - - Common - - - Common - - - Common - - - Common - - - Common - - - Common - - - Dynamics - - - Dynamics - - - Dynamics - - - Dynamics - - - Dynamics - - - Dynamics - - - Dynamics - - - Dynamics\Contacts - - - Dynamics\Contacts - - - Dynamics\Contacts - - - Dynamics\Contacts - - - Dynamics\Contacts - - - Dynamics\Contacts - - - Dynamics\Contacts - - - Dynamics\Contacts - - - Dynamics\Contacts - - - Dynamics\Joints - - - Dynamics\Joints - - - Dynamics\Joints - - - Dynamics\Joints - - - Dynamics\Joints - - - Dynamics\Joints - - - Dynamics\Joints - - - Dynamics\Joints - - - Dynamics\Joints - - - Dynamics\Joints - - - Dynamics\Joints - - - Rope - - - - \ No newline at end of file diff --git a/external/Box2D/proj.win32/Box2D.vcxproj.user b/external/Box2D/proj.win32/Box2D.vcxproj.user deleted file mode 100644 index ace9a86acb..0000000000 --- a/external/Box2D/proj.win32/Box2D.vcxproj.user +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file From 19ee87e29a16bc086e2b2eb3e5582d87b27fd970 Mon Sep 17 00:00:00 2001 From: minggo Date: Sat, 12 Oct 2013 14:03:04 +0800 Subject: [PATCH 16/64] issue #2905: step2 Box2D -> box2d --- cocos/physics/box2d/CCPhysicsBodyInfo.cpp | 39 + cocos/physics/box2d/CCPhysicsBodyInfo.h | 43 + cocos/physics/box2d/CCPhysicsContactInfo.cpp | 39 + cocos/physics/box2d/CCPhysicsContactInfo.h | 43 + cocos/physics/box2d/CCPhysicsHelper.h | 43 + cocos/physics/box2d/CCPhysicsJointInfo.cpp | 39 + cocos/physics/box2d/CCPhysicsJointInfo.h | 43 + cocos/physics/box2d/CCPhysicsShapeInfo.cpp | 39 + cocos/physics/box2d/CCPhysicsShapeInfo.h | 43 + cocos/physics/box2d/CCPhysicsWorldInfo.cpp | 39 + cocos/physics/box2d/CCPhysicsWorldInfo.h | 43 + external/box2d/Android.mk | 60 + external/box2d/Box2D.h | 67 + .../box2d/Collision/Shapes/b2ChainShape.cpp | 171 +++ .../box2d/Collision/Shapes/b2ChainShape.h | 102 ++ .../box2d/Collision/Shapes/b2CircleShape.cpp | 100 ++ .../box2d/Collision/Shapes/b2CircleShape.h | 91 ++ .../box2d/Collision/Shapes/b2EdgeShape.cpp | 139 ++ external/box2d/Collision/Shapes/b2EdgeShape.h | 74 + .../box2d/Collision/Shapes/b2PolygonShape.cpp | 361 +++++ .../box2d/Collision/Shapes/b2PolygonShape.h | 95 ++ external/box2d/Collision/Shapes/b2Shape.h | 101 ++ external/box2d/Collision/b2BroadPhase.cpp | 122 ++ external/box2d/Collision/b2BroadPhase.h | 248 ++++ external/box2d/Collision/b2CollideCircle.cpp | 154 ++ external/box2d/Collision/b2CollideEdge.cpp | 698 +++++++++ external/box2d/Collision/b2CollidePolygon.cpp | 317 ++++ external/box2d/Collision/b2Collision.cpp | 249 ++++ external/box2d/Collision/b2Collision.h | 276 ++++ external/box2d/Collision/b2Distance.cpp | 603 ++++++++ external/box2d/Collision/b2Distance.h | 141 ++ external/box2d/Collision/b2DynamicTree.cpp | 775 ++++++++++ external/box2d/Collision/b2DynamicTree.h | 284 ++++ external/box2d/Collision/b2TimeOfImpact.cpp | 488 ++++++ external/box2d/Collision/b2TimeOfImpact.h | 58 + external/box2d/Common/b2BlockAllocator.cpp | 218 +++ external/box2d/Common/b2BlockAllocator.h | 62 + external/box2d/Common/b2Draw.cpp | 44 + external/box2d/Common/b2Draw.h | 81 + external/box2d/Common/b2GrowableStack.h | 85 ++ external/box2d/Common/b2Math.cpp | 94 ++ external/box2d/Common/b2Math.h | 738 +++++++++ external/box2d/Common/b2Settings.cpp | 61 + external/box2d/Common/b2Settings.h | 150 ++ external/box2d/Common/b2StackAllocator.cpp | 83 ++ external/box2d/Common/b2StackAllocator.h | 60 + external/box2d/Common/b2Timer.cpp | 100 ++ external/box2d/Common/b2Timer.h | 45 + .../Contacts/b2ChainAndCircleContact.cpp | 54 + .../Contacts/b2ChainAndCircleContact.h | 39 + .../Contacts/b2ChainAndPolygonContact.cpp | 54 + .../Contacts/b2ChainAndPolygonContact.h | 39 + .../Dynamics/Contacts/b2CircleContact.cpp | 53 + .../box2d/Dynamics/Contacts/b2CircleContact.h | 39 + .../box2d/Dynamics/Contacts/b2Contact.cpp | 240 +++ external/box2d/Dynamics/Contacts/b2Contact.h | 331 +++++ .../Dynamics/Contacts/b2ContactSolver.cpp | 832 +++++++++++ .../box2d/Dynamics/Contacts/b2ContactSolver.h | 94 ++ .../Contacts/b2EdgeAndCircleContact.cpp | 50 + .../Contacts/b2EdgeAndCircleContact.h | 39 + .../Contacts/b2EdgeAndPolygonContact.cpp | 50 + .../Contacts/b2EdgeAndPolygonContact.h | 39 + .../Contacts/b2PolygonAndCircleContact.cpp | 50 + .../Contacts/b2PolygonAndCircleContact.h | 38 + .../Dynamics/Contacts/b2PolygonContact.cpp | 53 + .../Dynamics/Contacts/b2PolygonContact.h | 39 + .../box2d/Dynamics/Joints/b2DistanceJoint.cpp | 260 ++++ .../box2d/Dynamics/Joints/b2DistanceJoint.h | 169 +++ .../box2d/Dynamics/Joints/b2FrictionJoint.cpp | 251 ++++ .../box2d/Dynamics/Joints/b2FrictionJoint.h | 119 ++ .../box2d/Dynamics/Joints/b2GearJoint.cpp | 423 ++++++ external/box2d/Dynamics/Joints/b2GearJoint.h | 125 ++ external/box2d/Dynamics/Joints/b2Joint.cpp | 199 +++ external/box2d/Dynamics/Joints/b2Joint.h | 222 +++ .../box2d/Dynamics/Joints/b2MouseJoint.cpp | 217 +++ external/box2d/Dynamics/Joints/b2MouseJoint.h | 126 ++ .../Dynamics/Joints/b2PrismaticJoint.cpp | 637 ++++++++ .../box2d/Dynamics/Joints/b2PrismaticJoint.h | 196 +++ .../box2d/Dynamics/Joints/b2PulleyJoint.cpp | 332 +++++ .../box2d/Dynamics/Joints/b2PulleyJoint.h | 143 ++ .../box2d/Dynamics/Joints/b2RevoluteJoint.cpp | 504 +++++++ .../box2d/Dynamics/Joints/b2RevoluteJoint.h | 204 +++ .../box2d/Dynamics/Joints/b2RopeJoint.cpp | 241 +++ external/box2d/Dynamics/Joints/b2RopeJoint.h | 114 ++ .../box2d/Dynamics/Joints/b2WeldJoint.cpp | 330 +++++ external/box2d/Dynamics/Joints/b2WeldJoint.h | 126 ++ .../box2d/Dynamics/Joints/b2WheelJoint.cpp | 419 ++++++ external/box2d/Dynamics/Joints/b2WheelJoint.h | 213 +++ external/box2d/Dynamics/b2Body.cpp | 514 +++++++ external/box2d/Dynamics/b2Body.h | 846 +++++++++++ external/box2d/Dynamics/b2ContactManager.cpp | 293 ++++ external/box2d/Dynamics/b2ContactManager.h | 52 + external/box2d/Dynamics/b2Fixture.cpp | 303 ++++ external/box2d/Dynamics/b2Fixture.h | 345 +++++ external/box2d/Dynamics/b2Island.cpp | 539 +++++++ external/box2d/Dynamics/b2Island.h | 93 ++ external/box2d/Dynamics/b2TimeStep.h | 70 + external/box2d/Dynamics/b2World.cpp | 1316 +++++++++++++++++ external/box2d/Dynamics/b2World.h | 349 +++++ external/box2d/Dynamics/b2WorldCallbacks.cpp | 36 + external/box2d/Dynamics/b2WorldCallbacks.h | 155 ++ external/box2d/Rope/b2Rope.cpp | 259 ++++ external/box2d/Rope/b2Rope.h | 115 ++ external/box2d/proj.linux/.cproject | 267 ++++ external/box2d/proj.linux/.project | 110 ++ external/box2d/proj.linux/Makefile | 72 + external/box2d/proj.linux/box2d.prf | 19 + external/box2d/proj.win32/Box2D.vcxproj | 194 +++ .../box2d/proj.win32/Box2D.vcxproj.filters | 301 ++++ external/box2d/proj.win32/Box2D.vcxproj.user | 3 + 110 files changed, 22002 insertions(+) create mode 100644 cocos/physics/box2d/CCPhysicsBodyInfo.cpp create mode 100644 cocos/physics/box2d/CCPhysicsBodyInfo.h create mode 100644 cocos/physics/box2d/CCPhysicsContactInfo.cpp create mode 100644 cocos/physics/box2d/CCPhysicsContactInfo.h create mode 100644 cocos/physics/box2d/CCPhysicsHelper.h create mode 100644 cocos/physics/box2d/CCPhysicsJointInfo.cpp create mode 100644 cocos/physics/box2d/CCPhysicsJointInfo.h create mode 100644 cocos/physics/box2d/CCPhysicsShapeInfo.cpp create mode 100644 cocos/physics/box2d/CCPhysicsShapeInfo.h create mode 100644 cocos/physics/box2d/CCPhysicsWorldInfo.cpp create mode 100644 cocos/physics/box2d/CCPhysicsWorldInfo.h create mode 100644 external/box2d/Android.mk create mode 100644 external/box2d/Box2D.h create mode 100644 external/box2d/Collision/Shapes/b2ChainShape.cpp create mode 100644 external/box2d/Collision/Shapes/b2ChainShape.h create mode 100644 external/box2d/Collision/Shapes/b2CircleShape.cpp create mode 100644 external/box2d/Collision/Shapes/b2CircleShape.h create mode 100644 external/box2d/Collision/Shapes/b2EdgeShape.cpp create mode 100644 external/box2d/Collision/Shapes/b2EdgeShape.h create mode 100644 external/box2d/Collision/Shapes/b2PolygonShape.cpp create mode 100644 external/box2d/Collision/Shapes/b2PolygonShape.h create mode 100644 external/box2d/Collision/Shapes/b2Shape.h create mode 100644 external/box2d/Collision/b2BroadPhase.cpp create mode 100644 external/box2d/Collision/b2BroadPhase.h create mode 100644 external/box2d/Collision/b2CollideCircle.cpp create mode 100644 external/box2d/Collision/b2CollideEdge.cpp create mode 100644 external/box2d/Collision/b2CollidePolygon.cpp create mode 100644 external/box2d/Collision/b2Collision.cpp create mode 100644 external/box2d/Collision/b2Collision.h create mode 100644 external/box2d/Collision/b2Distance.cpp create mode 100644 external/box2d/Collision/b2Distance.h create mode 100644 external/box2d/Collision/b2DynamicTree.cpp create mode 100644 external/box2d/Collision/b2DynamicTree.h create mode 100644 external/box2d/Collision/b2TimeOfImpact.cpp create mode 100644 external/box2d/Collision/b2TimeOfImpact.h create mode 100644 external/box2d/Common/b2BlockAllocator.cpp create mode 100644 external/box2d/Common/b2BlockAllocator.h create mode 100644 external/box2d/Common/b2Draw.cpp create mode 100644 external/box2d/Common/b2Draw.h create mode 100644 external/box2d/Common/b2GrowableStack.h create mode 100644 external/box2d/Common/b2Math.cpp create mode 100644 external/box2d/Common/b2Math.h create mode 100644 external/box2d/Common/b2Settings.cpp create mode 100644 external/box2d/Common/b2Settings.h create mode 100644 external/box2d/Common/b2StackAllocator.cpp create mode 100644 external/box2d/Common/b2StackAllocator.h create mode 100644 external/box2d/Common/b2Timer.cpp create mode 100644 external/box2d/Common/b2Timer.h create mode 100644 external/box2d/Dynamics/Contacts/b2ChainAndCircleContact.cpp create mode 100644 external/box2d/Dynamics/Contacts/b2ChainAndCircleContact.h create mode 100644 external/box2d/Dynamics/Contacts/b2ChainAndPolygonContact.cpp create mode 100644 external/box2d/Dynamics/Contacts/b2ChainAndPolygonContact.h create mode 100644 external/box2d/Dynamics/Contacts/b2CircleContact.cpp create mode 100644 external/box2d/Dynamics/Contacts/b2CircleContact.h create mode 100644 external/box2d/Dynamics/Contacts/b2Contact.cpp create mode 100644 external/box2d/Dynamics/Contacts/b2Contact.h create mode 100644 external/box2d/Dynamics/Contacts/b2ContactSolver.cpp create mode 100644 external/box2d/Dynamics/Contacts/b2ContactSolver.h create mode 100644 external/box2d/Dynamics/Contacts/b2EdgeAndCircleContact.cpp create mode 100644 external/box2d/Dynamics/Contacts/b2EdgeAndCircleContact.h create mode 100644 external/box2d/Dynamics/Contacts/b2EdgeAndPolygonContact.cpp create mode 100644 external/box2d/Dynamics/Contacts/b2EdgeAndPolygonContact.h create mode 100644 external/box2d/Dynamics/Contacts/b2PolygonAndCircleContact.cpp create mode 100644 external/box2d/Dynamics/Contacts/b2PolygonAndCircleContact.h create mode 100644 external/box2d/Dynamics/Contacts/b2PolygonContact.cpp create mode 100644 external/box2d/Dynamics/Contacts/b2PolygonContact.h create mode 100644 external/box2d/Dynamics/Joints/b2DistanceJoint.cpp create mode 100644 external/box2d/Dynamics/Joints/b2DistanceJoint.h create mode 100644 external/box2d/Dynamics/Joints/b2FrictionJoint.cpp create mode 100644 external/box2d/Dynamics/Joints/b2FrictionJoint.h create mode 100644 external/box2d/Dynamics/Joints/b2GearJoint.cpp create mode 100644 external/box2d/Dynamics/Joints/b2GearJoint.h create mode 100644 external/box2d/Dynamics/Joints/b2Joint.cpp create mode 100644 external/box2d/Dynamics/Joints/b2Joint.h create mode 100644 external/box2d/Dynamics/Joints/b2MouseJoint.cpp create mode 100644 external/box2d/Dynamics/Joints/b2MouseJoint.h create mode 100644 external/box2d/Dynamics/Joints/b2PrismaticJoint.cpp create mode 100644 external/box2d/Dynamics/Joints/b2PrismaticJoint.h create mode 100644 external/box2d/Dynamics/Joints/b2PulleyJoint.cpp create mode 100644 external/box2d/Dynamics/Joints/b2PulleyJoint.h create mode 100644 external/box2d/Dynamics/Joints/b2RevoluteJoint.cpp create mode 100644 external/box2d/Dynamics/Joints/b2RevoluteJoint.h create mode 100644 external/box2d/Dynamics/Joints/b2RopeJoint.cpp create mode 100644 external/box2d/Dynamics/Joints/b2RopeJoint.h create mode 100644 external/box2d/Dynamics/Joints/b2WeldJoint.cpp create mode 100644 external/box2d/Dynamics/Joints/b2WeldJoint.h create mode 100644 external/box2d/Dynamics/Joints/b2WheelJoint.cpp create mode 100644 external/box2d/Dynamics/Joints/b2WheelJoint.h create mode 100644 external/box2d/Dynamics/b2Body.cpp create mode 100644 external/box2d/Dynamics/b2Body.h create mode 100644 external/box2d/Dynamics/b2ContactManager.cpp create mode 100644 external/box2d/Dynamics/b2ContactManager.h create mode 100644 external/box2d/Dynamics/b2Fixture.cpp create mode 100644 external/box2d/Dynamics/b2Fixture.h create mode 100644 external/box2d/Dynamics/b2Island.cpp create mode 100644 external/box2d/Dynamics/b2Island.h create mode 100644 external/box2d/Dynamics/b2TimeStep.h create mode 100644 external/box2d/Dynamics/b2World.cpp create mode 100644 external/box2d/Dynamics/b2World.h create mode 100644 external/box2d/Dynamics/b2WorldCallbacks.cpp create mode 100644 external/box2d/Dynamics/b2WorldCallbacks.h create mode 100644 external/box2d/Rope/b2Rope.cpp create mode 100644 external/box2d/Rope/b2Rope.h create mode 100644 external/box2d/proj.linux/.cproject create mode 100644 external/box2d/proj.linux/.project create mode 100644 external/box2d/proj.linux/Makefile create mode 100644 external/box2d/proj.linux/box2d.prf create mode 100644 external/box2d/proj.win32/Box2D.vcxproj create mode 100644 external/box2d/proj.win32/Box2D.vcxproj.filters create mode 100644 external/box2d/proj.win32/Box2D.vcxproj.user diff --git a/cocos/physics/box2d/CCPhysicsBodyInfo.cpp b/cocos/physics/box2d/CCPhysicsBodyInfo.cpp new file mode 100644 index 0000000000..bfa20b616a --- /dev/null +++ b/cocos/physics/box2d/CCPhysicsBodyInfo.cpp @@ -0,0 +1,39 @@ +/**************************************************************************** + Copyright (c) 2013 cocos2d-x.org + + 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 "CCPhysicsBodyInfo.h" + +#if (CC_PHYSICS_ENGINE == CC_PHYSICS_BOX2D) +NS_CC_BEGIN + +PhysicsBodyInfo::PhysicsBodyInfo() +{ +} + +PhysicsBodyInfo::~PhysicsBodyInfo() +{ +} + +NS_CC_END +#endif // CC_PHYSICS_ENGINE == CC_PHYSICS_BOX2D diff --git a/cocos/physics/box2d/CCPhysicsBodyInfo.h b/cocos/physics/box2d/CCPhysicsBodyInfo.h new file mode 100644 index 0000000000..730837ed9d --- /dev/null +++ b/cocos/physics/box2d/CCPhysicsBodyInfo.h @@ -0,0 +1,43 @@ +/**************************************************************************** + Copyright (c) 2013 cocos2d-x.org + + 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 "../CCPhysicsSetting.h" +#if (CC_PHYSICS_ENGINE == CC_PHYSICS_BOX2D) + +#ifndef __CCPHYSICS_BODY_INFO_H__ +#define __CCPHYSICS_BODY_INFO_H__ +#include "platform/CCPlatformMacros.h" +NS_CC_BEGIN + +class PhysicsBodyInfo +{ +public: + PhysicsBodyInfo(); + ~PhysicsBodyInfo(); +}; + +NS_CC_END +#endif // __CCPHYSICS_BODY_INFO_H__ + +#endif // CC_PHYSICS_ENGINE == CC_PHYSICS_BOX2D diff --git a/cocos/physics/box2d/CCPhysicsContactInfo.cpp b/cocos/physics/box2d/CCPhysicsContactInfo.cpp new file mode 100644 index 0000000000..41eaa4f831 --- /dev/null +++ b/cocos/physics/box2d/CCPhysicsContactInfo.cpp @@ -0,0 +1,39 @@ +/**************************************************************************** + Copyright (c) 2013 cocos2d-x.org + + 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 "CCPhysicsContactInfo.h" + +#if (CC_PHYSICS_ENGINE == CC_PHYSICS_BOX2D) +NS_CC_BEGIN + +PhysicsContactInfo::PhysicsContactInfo() +{ +} + +PhysicsContactInfo::~PhysicsContactInfo() +{ +} + +NS_CC_END +#endif // CC_PHYSICS_ENGINE == CC_PHYSICS_BOX2D diff --git a/cocos/physics/box2d/CCPhysicsContactInfo.h b/cocos/physics/box2d/CCPhysicsContactInfo.h new file mode 100644 index 0000000000..b592caa0af --- /dev/null +++ b/cocos/physics/box2d/CCPhysicsContactInfo.h @@ -0,0 +1,43 @@ +/**************************************************************************** + Copyright (c) 2013 cocos2d-x.org + + 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 "../CCPhysicsSetting.h" +#if (CC_PHYSICS_ENGINE == CC_PHYSICS_BOX2D) + +#ifndef __CCPHYSICS_CONTACT_INFO_H__ +#define __CCPHYSICS_CONTACT_INFO_H__ +#include "platform/CCPlatformMacros.h" +NS_CC_BEGIN + +class PhysicsContactInfo +{ +public: + PhysicsContactInfo(); + ~PhysicsContactInfo(); +}; + +NS_CC_END +#endif // __CCPHYSICS_CONTACT_INFO_H__ + +#endif // CC_PHYSICS_ENGINE == CC_PHYSICS_BOX2D diff --git a/cocos/physics/box2d/CCPhysicsHelper.h b/cocos/physics/box2d/CCPhysicsHelper.h new file mode 100644 index 0000000000..86ef7d74ee --- /dev/null +++ b/cocos/physics/box2d/CCPhysicsHelper.h @@ -0,0 +1,43 @@ +/**************************************************************************** + Copyright (c) 2013 cocos2d-x.org + + 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 "../CCPhysicsSetting.h" +#if (CC_PHYSICS_ENGINE == CC_PHYSICS_BOX2D) + +#ifndef __CCPHYSICS_HELPER_H__ +#define __CCPHYSICS_HELPER_H__ + +#include "platform/CCPlatformMacros.h" +#include "cocoa/CCGeometry.h" + +NS_CC_BEGIN + +class PhysicsHelper +{ +}; + +NS_CC_END +#endif // __CCPHYSICS_HELPER_H__ + +#endif // CC_PHYSICS_ENGINE == CC_PHYSICS_BOX2D diff --git a/cocos/physics/box2d/CCPhysicsJointInfo.cpp b/cocos/physics/box2d/CCPhysicsJointInfo.cpp new file mode 100644 index 0000000000..753ba41534 --- /dev/null +++ b/cocos/physics/box2d/CCPhysicsJointInfo.cpp @@ -0,0 +1,39 @@ +/**************************************************************************** + Copyright (c) 2013 cocos2d-x.org + + 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 "CCPhysicsJointInfo.h" + +#if (CC_PHYSICS_ENGINE == CC_PHYSICS_BOX2D) +NS_CC_BEGIN + +PhysicsJointInfo::PhysicsJointInfo() +{ +} + +PhysicsJointInfo::~PhysicsJointInfo() +{ +} + +NS_CC_END +#endif // CC_PHYSICS_ENGINE == CC_PHYSICS_BOX2D diff --git a/cocos/physics/box2d/CCPhysicsJointInfo.h b/cocos/physics/box2d/CCPhysicsJointInfo.h new file mode 100644 index 0000000000..abcf089387 --- /dev/null +++ b/cocos/physics/box2d/CCPhysicsJointInfo.h @@ -0,0 +1,43 @@ +/**************************************************************************** + Copyright (c) 2013 cocos2d-x.org + + 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 "../CCPhysicsSetting.h" +#if (CC_PHYSICS_ENGINE == CC_PHYSICS_BOX2D) + +#ifndef __CCPHYSICS_JOINT_INFO_H__ +#define __CCPHYSICS_JOINT_INFO_H__ +#include "platform/CCPlatformMacros.h" +NS_CC_BEGIN + +class PhysicsJointInfo +{ +public: + PhysicsJointInfo(); + ~PhysicsJointInfo(); +}; + +NS_CC_END +#endif // __CCPHYSICS_JOINT_INFO_H__ + +#endif // CC_PHYSICS_ENGINE == CC_PHYSICS_BOX2D diff --git a/cocos/physics/box2d/CCPhysicsShapeInfo.cpp b/cocos/physics/box2d/CCPhysicsShapeInfo.cpp new file mode 100644 index 0000000000..a89ba7dae7 --- /dev/null +++ b/cocos/physics/box2d/CCPhysicsShapeInfo.cpp @@ -0,0 +1,39 @@ +/**************************************************************************** + Copyright (c) 2013 cocos2d-x.org + + 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 "CCPhysicsShapeInfo.h" + +#if (CC_PHYSICS_ENGINE == CC_PHYSICS_BOX2D) +NS_CC_BEGIN + +PhysicsShapeInfo::PhysicsShapeInfo() +{ +} + +PhysicsShapeInfo::~PhysicsShapeInfo() +{ +} + +NS_CC_END +#endif // CC_PHYSICS_ENGINE == CC_PHYSICS_BOX2D diff --git a/cocos/physics/box2d/CCPhysicsShapeInfo.h b/cocos/physics/box2d/CCPhysicsShapeInfo.h new file mode 100644 index 0000000000..9091001887 --- /dev/null +++ b/cocos/physics/box2d/CCPhysicsShapeInfo.h @@ -0,0 +1,43 @@ +/**************************************************************************** + Copyright (c) 2013 cocos2d-x.org + + 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 "../CCPhysicsSetting.h" +#if (CC_PHYSICS_ENGINE == CC_PHYSICS_BOX2D) + +#ifndef __CCPHYSICS_SHAPE_INFO_H__ +#define __CCPHYSICS_SHAPE_INFO_H__ +#include "platform/CCPlatformMacros.h" +NS_CC_BEGIN + +class PhysicsShapeInfo +{ +public: + PhysicsShapeInfo(); + ~PhysicsShapeInfo(); +}; + +NS_CC_END +#endif // __CCPHYSICS_SHAPE_INFO_H__ + +#endif // CC_PHYSICS_ENGINE == CC_PHYSICS_BOX2D diff --git a/cocos/physics/box2d/CCPhysicsWorldInfo.cpp b/cocos/physics/box2d/CCPhysicsWorldInfo.cpp new file mode 100644 index 0000000000..0de6c00d82 --- /dev/null +++ b/cocos/physics/box2d/CCPhysicsWorldInfo.cpp @@ -0,0 +1,39 @@ +/**************************************************************************** + Copyright (c) 2013 cocos2d-x.org + + 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 "CCPhysicsWorldInfo.h" + +#if (CC_PHYSICS_ENGINE == CC_PHYSICS_BOX2D) +NS_CC_BEGIN + +PhysicsWorldInfo::PhysicsWorldInfo() +{ +} + +PhysicsWorldInfo::~PhysicsWorldInfo() +{ +} + +NS_CC_END +#endif // CC_PHYSICS_ENGINE == CC_PHYSICS_BOX2D diff --git a/cocos/physics/box2d/CCPhysicsWorldInfo.h b/cocos/physics/box2d/CCPhysicsWorldInfo.h new file mode 100644 index 0000000000..bcc09124db --- /dev/null +++ b/cocos/physics/box2d/CCPhysicsWorldInfo.h @@ -0,0 +1,43 @@ +/**************************************************************************** + Copyright (c) 2013 cocos2d-x.org + + 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 "../CCPhysicsSetting.h" +#if (CC_PHYSICS_ENGINE == CC_PHYSICS_BOX2D) + +#ifndef __CCPHYSICS_WORLD_INFO_H__ +#define __CCPHYSICS_WORLD_INFO_H__ +#include "platform/CCPlatformMacros.h" +NS_CC_BEGIN + +class PhysicsWorldInfo +{ +public: + PhysicsWorldInfo(); + ~PhysicsWorldInfo(); +}; + +NS_CC_END +#endif // __CCPHYSICS_WORLD_INFO_H__ + +#endif // CC_PHYSICS_ENGINE == CC_PHYSICS_BOX2D diff --git a/external/box2d/Android.mk b/external/box2d/Android.mk new file mode 100644 index 0000000000..c366750c01 --- /dev/null +++ b/external/box2d/Android.mk @@ -0,0 +1,60 @@ +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := box2d_static + +LOCAL_MODULE_FILENAME := libbox2d + +LOCAL_SRC_FILES := \ +Collision/b2BroadPhase.cpp \ +Collision/b2CollideCircle.cpp \ +Collision/b2CollideEdge.cpp \ +Collision/b2CollidePolygon.cpp \ +Collision/b2Collision.cpp \ +Collision/b2Distance.cpp \ +Collision/b2DynamicTree.cpp \ +Collision/b2TimeOfImpact.cpp \ +Collision/Shapes/b2ChainShape.cpp \ +Collision/Shapes/b2CircleShape.cpp \ +Collision/Shapes/b2EdgeShape.cpp \ +Collision/Shapes/b2PolygonShape.cpp \ +Common/b2BlockAllocator.cpp \ +Common/b2Draw.cpp \ +Common/b2Math.cpp \ +Common/b2Settings.cpp \ +Common/b2StackAllocator.cpp \ +Common/b2Timer.cpp \ +Dynamics/b2Body.cpp \ +Dynamics/b2ContactManager.cpp \ +Dynamics/b2Fixture.cpp \ +Dynamics/b2Island.cpp \ +Dynamics/b2World.cpp \ +Dynamics/b2WorldCallbacks.cpp \ +Dynamics/Contacts/b2ChainAndCircleContact.cpp \ +Dynamics/Contacts/b2ChainAndPolygonContact.cpp \ +Dynamics/Contacts/b2CircleContact.cpp \ +Dynamics/Contacts/b2Contact.cpp \ +Dynamics/Contacts/b2ContactSolver.cpp \ +Dynamics/Contacts/b2EdgeAndCircleContact.cpp \ +Dynamics/Contacts/b2EdgeAndPolygonContact.cpp \ +Dynamics/Contacts/b2PolygonAndCircleContact.cpp \ +Dynamics/Contacts/b2PolygonContact.cpp \ +Dynamics/Joints/b2DistanceJoint.cpp \ +Dynamics/Joints/b2FrictionJoint.cpp \ +Dynamics/Joints/b2GearJoint.cpp \ +Dynamics/Joints/b2Joint.cpp \ +Dynamics/Joints/b2MouseJoint.cpp \ +Dynamics/Joints/b2PrismaticJoint.cpp \ +Dynamics/Joints/b2PulleyJoint.cpp \ +Dynamics/Joints/b2RevoluteJoint.cpp \ +Dynamics/Joints/b2RopeJoint.cpp \ +Dynamics/Joints/b2WeldJoint.cpp \ +Dynamics/Joints/b2WheelJoint.cpp \ +Rope/b2Rope.cpp + +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/.. + +LOCAL_C_INCLUDES := $(LOCAL_PATH)/.. + +include $(BUILD_STATIC_LIBRARY) diff --git a/external/box2d/Box2D.h b/external/box2d/Box2D.h new file mode 100644 index 0000000000..f674d82269 --- /dev/null +++ b/external/box2d/Box2D.h @@ -0,0 +1,67 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef BOX2D_H +#define BOX2D_H + +/** +\mainpage Box2D API Documentation + +\section intro_sec Getting Started + +For documentation please see http://box2d.org/documentation.html + +For discussion please visit http://box2d.org/forum +*/ + +// These include files constitute the main Box2D API + +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif diff --git a/external/box2d/Collision/Shapes/b2ChainShape.cpp b/external/box2d/Collision/Shapes/b2ChainShape.cpp new file mode 100644 index 0000000000..79b4304b5b --- /dev/null +++ b/external/box2d/Collision/Shapes/b2ChainShape.cpp @@ -0,0 +1,171 @@ +/* +* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include +#include +using namespace std; + +b2ChainShape::~b2ChainShape() +{ + b2Free(m_vertices); + m_vertices = NULL; + m_count = 0; +} + +void b2ChainShape::CreateLoop(const b2Vec2* vertices, int32 count) +{ + b2Assert(m_vertices == NULL && m_count == 0); + b2Assert(count >= 3); + m_count = count + 1; + m_vertices = (b2Vec2*)b2Alloc(m_count * sizeof(b2Vec2)); + memcpy(m_vertices, vertices, count * sizeof(b2Vec2)); + m_vertices[count] = m_vertices[0]; + m_prevVertex = m_vertices[m_count - 2]; + m_nextVertex = m_vertices[1]; + m_hasPrevVertex = true; + m_hasNextVertex = true; +} + +void b2ChainShape::CreateChain(const b2Vec2* vertices, int32 count) +{ + b2Assert(m_vertices == NULL && m_count == 0); + b2Assert(count >= 2); + m_count = count; + m_vertices = (b2Vec2*)b2Alloc(count * sizeof(b2Vec2)); + memcpy(m_vertices, vertices, m_count * sizeof(b2Vec2)); + m_hasPrevVertex = false; + m_hasNextVertex = false; +} + +void b2ChainShape::SetPrevVertex(const b2Vec2& prevVertex) +{ + m_prevVertex = prevVertex; + m_hasPrevVertex = true; +} + +void b2ChainShape::SetNextVertex(const b2Vec2& nextVertex) +{ + m_nextVertex = nextVertex; + m_hasNextVertex = true; +} + +b2Shape* b2ChainShape::Clone(b2BlockAllocator* allocator) const +{ + void* mem = allocator->Allocate(sizeof(b2ChainShape)); + b2ChainShape* clone = new (mem) b2ChainShape; + clone->CreateChain(m_vertices, m_count); + clone->m_prevVertex = m_prevVertex; + clone->m_nextVertex = m_nextVertex; + clone->m_hasPrevVertex = m_hasPrevVertex; + clone->m_hasNextVertex = m_hasNextVertex; + return clone; +} + +int32 b2ChainShape::GetChildCount() const +{ + // edge count = vertex count - 1 + return m_count - 1; +} + +void b2ChainShape::GetChildEdge(b2EdgeShape* edge, int32 index) const +{ + b2Assert(0 <= index && index < m_count - 1); + edge->m_type = b2Shape::e_edge; + edge->m_radius = m_radius; + + edge->m_vertex1 = m_vertices[index + 0]; + edge->m_vertex2 = m_vertices[index + 1]; + + if (index > 0) + { + edge->m_vertex0 = m_vertices[index - 1]; + edge->m_hasVertex0 = true; + } + else + { + edge->m_vertex0 = m_prevVertex; + edge->m_hasVertex0 = m_hasPrevVertex; + } + + if (index < m_count - 2) + { + edge->m_vertex3 = m_vertices[index + 2]; + edge->m_hasVertex3 = true; + } + else + { + edge->m_vertex3 = m_nextVertex; + edge->m_hasVertex3 = m_hasNextVertex; + } +} + +bool b2ChainShape::TestPoint(const b2Transform& xf, const b2Vec2& p) const +{ + B2_NOT_USED(xf); + B2_NOT_USED(p); + return false; +} + +bool b2ChainShape::RayCast(b2RayCastOutput* output, const b2RayCastInput& input, + const b2Transform& xf, int32 childIndex) const +{ + b2Assert(childIndex < m_count); + + b2EdgeShape edgeShape; + + int32 i1 = childIndex; + int32 i2 = childIndex + 1; + if (i2 == m_count) + { + i2 = 0; + } + + edgeShape.m_vertex1 = m_vertices[i1]; + edgeShape.m_vertex2 = m_vertices[i2]; + + return edgeShape.RayCast(output, input, xf, 0); +} + +void b2ChainShape::ComputeAABB(b2AABB* aabb, const b2Transform& xf, int32 childIndex) const +{ + b2Assert(childIndex < m_count); + + int32 i1 = childIndex; + int32 i2 = childIndex + 1; + if (i2 == m_count) + { + i2 = 0; + } + + b2Vec2 v1 = b2Mul(xf, m_vertices[i1]); + b2Vec2 v2 = b2Mul(xf, m_vertices[i2]); + + aabb->lowerBound = b2Min(v1, v2); + aabb->upperBound = b2Max(v1, v2); +} + +void b2ChainShape::ComputeMass(b2MassData* massData, float32 density) const +{ + B2_NOT_USED(density); + + massData->mass = 0.0f; + massData->center.SetZero(); + massData->I = 0.0f; +} diff --git a/external/box2d/Collision/Shapes/b2ChainShape.h b/external/box2d/Collision/Shapes/b2ChainShape.h new file mode 100644 index 0000000000..9c9a9eaa7d --- /dev/null +++ b/external/box2d/Collision/Shapes/b2ChainShape.h @@ -0,0 +1,102 @@ +/* +* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_CHAIN_SHAPE_H +#define B2_CHAIN_SHAPE_H + +#include + +class b2EdgeShape; + +/// A chain shape is a free form sequence of line segments. +/// The chain has two-sided collision, so you can use inside and outside collision. +/// Therefore, you may use any winding order. +/// Since there may be many vertices, they are allocated using b2Alloc. +/// Connectivity information is used to create smooth collisions. +/// WARNING: The chain will not collide properly if there are self-intersections. +class b2ChainShape : public b2Shape +{ +public: + b2ChainShape(); + + /// The destructor frees the vertices using b2Free. + ~b2ChainShape(); + + /// Create a loop. This automatically adjusts connectivity. + /// @param vertices an array of vertices, these are copied + /// @param count the vertex count + void CreateLoop(const b2Vec2* vertices, int32 count); + + /// Create a chain with isolated end vertices. + /// @param vertices an array of vertices, these are copied + /// @param count the vertex count + void CreateChain(const b2Vec2* vertices, int32 count); + + /// Establish connectivity to a vertex that precedes the first vertex. + /// Don't call this for loops. + void SetPrevVertex(const b2Vec2& prevVertex); + + /// Establish connectivity to a vertex that follows the last vertex. + /// Don't call this for loops. + void SetNextVertex(const b2Vec2& nextVertex); + + /// Implement b2Shape. Vertices are cloned using b2Alloc. + b2Shape* Clone(b2BlockAllocator* allocator) const; + + /// @see b2Shape::GetChildCount + int32 GetChildCount() const; + + /// Get a child edge. + void GetChildEdge(b2EdgeShape* edge, int32 index) const; + + /// This always return false. + /// @see b2Shape::TestPoint + bool TestPoint(const b2Transform& transform, const b2Vec2& p) const; + + /// Implement b2Shape. + bool RayCast(b2RayCastOutput* output, const b2RayCastInput& input, + const b2Transform& transform, int32 childIndex) const; + + /// @see b2Shape::ComputeAABB + void ComputeAABB(b2AABB* aabb, const b2Transform& transform, int32 childIndex) const; + + /// Chains have zero mass. + /// @see b2Shape::ComputeMass + void ComputeMass(b2MassData* massData, float32 density) const; + + /// The vertices. Owned by this class. + b2Vec2* m_vertices; + + /// The vertex count. + int32 m_count; + + b2Vec2 m_prevVertex, m_nextVertex; + bool m_hasPrevVertex, m_hasNextVertex; +}; + +inline b2ChainShape::b2ChainShape() +{ + m_type = e_chain; + m_radius = b2_polygonRadius; + m_vertices = NULL; + m_count = 0; + m_hasPrevVertex = false; + m_hasNextVertex = false; +} + +#endif diff --git a/external/box2d/Collision/Shapes/b2CircleShape.cpp b/external/box2d/Collision/Shapes/b2CircleShape.cpp new file mode 100644 index 0000000000..587ca960b2 --- /dev/null +++ b/external/box2d/Collision/Shapes/b2CircleShape.cpp @@ -0,0 +1,100 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +using namespace std; + +b2Shape* b2CircleShape::Clone(b2BlockAllocator* allocator) const +{ + void* mem = allocator->Allocate(sizeof(b2CircleShape)); + b2CircleShape* clone = new (mem) b2CircleShape; + *clone = *this; + return clone; +} + +int32 b2CircleShape::GetChildCount() const +{ + return 1; +} + +bool b2CircleShape::TestPoint(const b2Transform& transform, const b2Vec2& p) const +{ + b2Vec2 center = transform.p + b2Mul(transform.q, m_p); + b2Vec2 d = p - center; + return b2Dot(d, d) <= m_radius * m_radius; +} + +// Collision Detection in Interactive 3D Environments by Gino van den Bergen +// From Section 3.1.2 +// x = s + a * r +// norm(x) = radius +bool b2CircleShape::RayCast(b2RayCastOutput* output, const b2RayCastInput& input, + const b2Transform& transform, int32 childIndex) const +{ + B2_NOT_USED(childIndex); + + b2Vec2 position = transform.p + b2Mul(transform.q, m_p); + b2Vec2 s = input.p1 - position; + float32 b = b2Dot(s, s) - m_radius * m_radius; + + // Solve quadratic equation. + b2Vec2 r = input.p2 - input.p1; + float32 c = b2Dot(s, r); + float32 rr = b2Dot(r, r); + float32 sigma = c * c - rr * b; + + // Check for negative discriminant and short segment. + if (sigma < 0.0f || rr < b2_epsilon) + { + return false; + } + + // Find the point of intersection of the line with the circle. + float32 a = -(c + b2Sqrt(sigma)); + + // Is the intersection point on the segment? + if (0.0f <= a && a <= input.maxFraction * rr) + { + a /= rr; + output->fraction = a; + output->normal = s + a * r; + output->normal.Normalize(); + return true; + } + + return false; +} + +void b2CircleShape::ComputeAABB(b2AABB* aabb, const b2Transform& transform, int32 childIndex) const +{ + B2_NOT_USED(childIndex); + + b2Vec2 p = transform.p + b2Mul(transform.q, m_p); + aabb->lowerBound.Set(p.x - m_radius, p.y - m_radius); + aabb->upperBound.Set(p.x + m_radius, p.y + m_radius); +} + +void b2CircleShape::ComputeMass(b2MassData* massData, float32 density) const +{ + massData->mass = density * b2_pi * m_radius * m_radius; + massData->center = m_p; + + // inertia about the local origin + massData->I = massData->mass * (0.5f * m_radius * m_radius + b2Dot(m_p, m_p)); +} diff --git a/external/box2d/Collision/Shapes/b2CircleShape.h b/external/box2d/Collision/Shapes/b2CircleShape.h new file mode 100644 index 0000000000..c4e23a475b --- /dev/null +++ b/external/box2d/Collision/Shapes/b2CircleShape.h @@ -0,0 +1,91 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_CIRCLE_SHAPE_H +#define B2_CIRCLE_SHAPE_H + +#include + +/// A circle shape. +class b2CircleShape : public b2Shape +{ +public: + b2CircleShape(); + + /// Implement b2Shape. + b2Shape* Clone(b2BlockAllocator* allocator) const; + + /// @see b2Shape::GetChildCount + int32 GetChildCount() const; + + /// Implement b2Shape. + bool TestPoint(const b2Transform& transform, const b2Vec2& p) const; + + /// Implement b2Shape. + bool RayCast(b2RayCastOutput* output, const b2RayCastInput& input, + const b2Transform& transform, int32 childIndex) const; + + /// @see b2Shape::ComputeAABB + void ComputeAABB(b2AABB* aabb, const b2Transform& transform, int32 childIndex) const; + + /// @see b2Shape::ComputeMass + void ComputeMass(b2MassData* massData, float32 density) const; + + /// Get the supporting vertex index in the given direction. + int32 GetSupport(const b2Vec2& d) const; + + /// Get the supporting vertex in the given direction. + const b2Vec2& GetSupportVertex(const b2Vec2& d) const; + + /// Get the vertex count. + int32 GetVertexCount() const { return 1; } + + /// Get a vertex by index. Used by b2Distance. + const b2Vec2& GetVertex(int32 index) const; + + /// Position + b2Vec2 m_p; +}; + +inline b2CircleShape::b2CircleShape() +{ + m_type = e_circle; + m_radius = 0.0f; + m_p.SetZero(); +} + +inline int32 b2CircleShape::GetSupport(const b2Vec2 &d) const +{ + B2_NOT_USED(d); + return 0; +} + +inline const b2Vec2& b2CircleShape::GetSupportVertex(const b2Vec2 &d) const +{ + B2_NOT_USED(d); + return m_p; +} + +inline const b2Vec2& b2CircleShape::GetVertex(int32 index) const +{ + B2_NOT_USED(index); + b2Assert(index == 0); + return m_p; +} + +#endif diff --git a/external/box2d/Collision/Shapes/b2EdgeShape.cpp b/external/box2d/Collision/Shapes/b2EdgeShape.cpp new file mode 100644 index 0000000000..7b09e55bf4 --- /dev/null +++ b/external/box2d/Collision/Shapes/b2EdgeShape.cpp @@ -0,0 +1,139 @@ +/* +* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +using namespace std; + +void b2EdgeShape::Set(const b2Vec2& v1, const b2Vec2& v2) +{ + m_vertex1 = v1; + m_vertex2 = v2; + m_hasVertex0 = false; + m_hasVertex3 = false; +} + +b2Shape* b2EdgeShape::Clone(b2BlockAllocator* allocator) const +{ + void* mem = allocator->Allocate(sizeof(b2EdgeShape)); + b2EdgeShape* clone = new (mem) b2EdgeShape; + *clone = *this; + return clone; +} + +int32 b2EdgeShape::GetChildCount() const +{ + return 1; +} + +bool b2EdgeShape::TestPoint(const b2Transform& xf, const b2Vec2& p) const +{ + B2_NOT_USED(xf); + B2_NOT_USED(p); + return false; +} + +// p = p1 + t * d +// v = v1 + s * e +// p1 + t * d = v1 + s * e +// s * e - t * d = p1 - v1 +bool b2EdgeShape::RayCast(b2RayCastOutput* output, const b2RayCastInput& input, + const b2Transform& xf, int32 childIndex) const +{ + B2_NOT_USED(childIndex); + + // Put the ray into the edge's frame of reference. + b2Vec2 p1 = b2MulT(xf.q, input.p1 - xf.p); + b2Vec2 p2 = b2MulT(xf.q, input.p2 - xf.p); + b2Vec2 d = p2 - p1; + + b2Vec2 v1 = m_vertex1; + b2Vec2 v2 = m_vertex2; + b2Vec2 e = v2 - v1; + b2Vec2 normal(e.y, -e.x); + normal.Normalize(); + + // q = p1 + t * d + // dot(normal, q - v1) = 0 + // dot(normal, p1 - v1) + t * dot(normal, d) = 0 + float32 numerator = b2Dot(normal, v1 - p1); + float32 denominator = b2Dot(normal, d); + + if (denominator == 0.0f) + { + return false; + } + + float32 t = numerator / denominator; + if (t < 0.0f || input.maxFraction < t) + { + return false; + } + + b2Vec2 q = p1 + t * d; + + // q = v1 + s * r + // s = dot(q - v1, r) / dot(r, r) + b2Vec2 r = v2 - v1; + float32 rr = b2Dot(r, r); + if (rr == 0.0f) + { + return false; + } + + float32 s = b2Dot(q - v1, r) / rr; + if (s < 0.0f || 1.0f < s) + { + return false; + } + + output->fraction = t; + if (numerator > 0.0f) + { + output->normal = -normal; + } + else + { + output->normal = normal; + } + return true; +} + +void b2EdgeShape::ComputeAABB(b2AABB* aabb, const b2Transform& xf, int32 childIndex) const +{ + B2_NOT_USED(childIndex); + + b2Vec2 v1 = b2Mul(xf, m_vertex1); + b2Vec2 v2 = b2Mul(xf, m_vertex2); + + b2Vec2 lower = b2Min(v1, v2); + b2Vec2 upper = b2Max(v1, v2); + + b2Vec2 r(m_radius, m_radius); + aabb->lowerBound = lower - r; + aabb->upperBound = upper + r; +} + +void b2EdgeShape::ComputeMass(b2MassData* massData, float32 density) const +{ + B2_NOT_USED(density); + + massData->mass = 0.0f; + massData->center = 0.5f * (m_vertex1 + m_vertex2); + massData->I = 0.0f; +} diff --git a/external/box2d/Collision/Shapes/b2EdgeShape.h b/external/box2d/Collision/Shapes/b2EdgeShape.h new file mode 100644 index 0000000000..6163bcbf1c --- /dev/null +++ b/external/box2d/Collision/Shapes/b2EdgeShape.h @@ -0,0 +1,74 @@ +/* +* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_EDGE_SHAPE_H +#define B2_EDGE_SHAPE_H + +#include + +/// A line segment (edge) shape. These can be connected in chains or loops +/// to other edge shapes. The connectivity information is used to ensure +/// correct contact normals. +class b2EdgeShape : public b2Shape +{ +public: + b2EdgeShape(); + + /// Set this as an isolated edge. + void Set(const b2Vec2& v1, const b2Vec2& v2); + + /// Implement b2Shape. + b2Shape* Clone(b2BlockAllocator* allocator) const; + + /// @see b2Shape::GetChildCount + int32 GetChildCount() const; + + /// @see b2Shape::TestPoint + bool TestPoint(const b2Transform& transform, const b2Vec2& p) const; + + /// Implement b2Shape. + bool RayCast(b2RayCastOutput* output, const b2RayCastInput& input, + const b2Transform& transform, int32 childIndex) const; + + /// @see b2Shape::ComputeAABB + void ComputeAABB(b2AABB* aabb, const b2Transform& transform, int32 childIndex) const; + + /// @see b2Shape::ComputeMass + void ComputeMass(b2MassData* massData, float32 density) const; + + /// These are the edge vertices + b2Vec2 m_vertex1, m_vertex2; + + /// Optional adjacent vertices. These are used for smooth collision. + b2Vec2 m_vertex0, m_vertex3; + bool m_hasVertex0, m_hasVertex3; +}; + +inline b2EdgeShape::b2EdgeShape() +{ + m_type = e_edge; + m_radius = b2_polygonRadius; + m_vertex0.x = 0.0f; + m_vertex0.y = 0.0f; + m_vertex3.x = 0.0f; + m_vertex3.y = 0.0f; + m_hasVertex0 = false; + m_hasVertex3 = false; +} + +#endif diff --git a/external/box2d/Collision/Shapes/b2PolygonShape.cpp b/external/box2d/Collision/Shapes/b2PolygonShape.cpp new file mode 100644 index 0000000000..c04c1dc49b --- /dev/null +++ b/external/box2d/Collision/Shapes/b2PolygonShape.cpp @@ -0,0 +1,361 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include + +b2Shape* b2PolygonShape::Clone(b2BlockAllocator* allocator) const +{ + void* mem = allocator->Allocate(sizeof(b2PolygonShape)); + b2PolygonShape* clone = new (mem) b2PolygonShape; + *clone = *this; + return clone; +} + +void b2PolygonShape::SetAsBox(float32 hx, float32 hy) +{ + m_vertexCount = 4; + m_vertices[0].Set(-hx, -hy); + m_vertices[1].Set( hx, -hy); + m_vertices[2].Set( hx, hy); + m_vertices[3].Set(-hx, hy); + m_normals[0].Set(0.0f, -1.0f); + m_normals[1].Set(1.0f, 0.0f); + m_normals[2].Set(0.0f, 1.0f); + m_normals[3].Set(-1.0f, 0.0f); + m_centroid.SetZero(); +} + +void b2PolygonShape::SetAsBox(float32 hx, float32 hy, const b2Vec2& center, float32 angle) +{ + m_vertexCount = 4; + m_vertices[0].Set(-hx, -hy); + m_vertices[1].Set( hx, -hy); + m_vertices[2].Set( hx, hy); + m_vertices[3].Set(-hx, hy); + m_normals[0].Set(0.0f, -1.0f); + m_normals[1].Set(1.0f, 0.0f); + m_normals[2].Set(0.0f, 1.0f); + m_normals[3].Set(-1.0f, 0.0f); + m_centroid = center; + + b2Transform xf; + xf.p = center; + xf.q.Set(angle); + + // Transform vertices and normals. + for (int32 i = 0; i < m_vertexCount; ++i) + { + m_vertices[i] = b2Mul(xf, m_vertices[i]); + m_normals[i] = b2Mul(xf.q, m_normals[i]); + } +} + +int32 b2PolygonShape::GetChildCount() const +{ + return 1; +} + +static b2Vec2 ComputeCentroid(const b2Vec2* vs, int32 count) +{ + b2Assert(count >= 3); + + b2Vec2 c; c.Set(0.0f, 0.0f); + float32 area = 0.0f; + + // pRef is the reference point for forming triangles. + // It's location doesn't change the result (except for rounding error). + b2Vec2 pRef(0.0f, 0.0f); +#if 0 + // This code would put the reference point inside the polygon. + for (int32 i = 0; i < count; ++i) + { + pRef += vs[i]; + } + pRef *= 1.0f / count; +#endif + + const float32 inv3 = 1.0f / 3.0f; + + for (int32 i = 0; i < count; ++i) + { + // Triangle vertices. + b2Vec2 p1 = pRef; + b2Vec2 p2 = vs[i]; + b2Vec2 p3 = i + 1 < count ? vs[i+1] : vs[0]; + + b2Vec2 e1 = p2 - p1; + b2Vec2 e2 = p3 - p1; + + float32 D = b2Cross(e1, e2); + + float32 triangleArea = 0.5f * D; + area += triangleArea; + + // Area weighted centroid + c += triangleArea * inv3 * (p1 + p2 + p3); + } + + // Centroid + b2Assert(area > b2_epsilon); + c *= 1.0f / area; + return c; +} + +void b2PolygonShape::Set(const b2Vec2* vertices, int32 count) +{ + b2Assert(3 <= count && count <= b2_maxPolygonVertices); + m_vertexCount = count; + + // Copy vertices. + for (int32 i = 0; i < m_vertexCount; ++i) + { + m_vertices[i] = vertices[i]; + } + + // Compute normals. Ensure the edges have non-zero length. + for (int32 i = 0; i < m_vertexCount; ++i) + { + int32 i1 = i; + int32 i2 = i + 1 < m_vertexCount ? i + 1 : 0; + b2Vec2 edge = m_vertices[i2] - m_vertices[i1]; + b2Assert(edge.LengthSquared() > b2_epsilon * b2_epsilon); + m_normals[i] = b2Cross(edge, 1.0f); + m_normals[i].Normalize(); + } + +#ifdef _DEBUG + // Ensure the polygon is convex and the interior + // is to the left of each edge. + for (int32 i = 0; i < m_vertexCount; ++i) + { + int32 i1 = i; + int32 i2 = i + 1 < m_vertexCount ? i + 1 : 0; + b2Vec2 edge = m_vertices[i2] - m_vertices[i1]; + + for (int32 j = 0; j < m_vertexCount; ++j) + { + // Don't check vertices on the current edge. + if (j == i1 || j == i2) + { + continue; + } + + b2Vec2 r = m_vertices[j] - m_vertices[i1]; + + // If this crashes, your polygon is non-convex, has colinear edges, + // or the winding order is wrong. + float32 s = b2Cross(edge, r); + b2Assert(s > 0.0f && "ERROR: Please ensure your polygon is convex and has a CCW winding order"); + } + } +#endif + + // Compute the polygon centroid. + m_centroid = ComputeCentroid(m_vertices, m_vertexCount); +} + +bool b2PolygonShape::TestPoint(const b2Transform& xf, const b2Vec2& p) const +{ + b2Vec2 pLocal = b2MulT(xf.q, p - xf.p); + + for (int32 i = 0; i < m_vertexCount; ++i) + { + float32 dot = b2Dot(m_normals[i], pLocal - m_vertices[i]); + if (dot > 0.0f) + { + return false; + } + } + + return true; +} + +bool b2PolygonShape::RayCast(b2RayCastOutput* output, const b2RayCastInput& input, + const b2Transform& xf, int32 childIndex) const +{ + B2_NOT_USED(childIndex); + + // Put the ray into the polygon's frame of reference. + b2Vec2 p1 = b2MulT(xf.q, input.p1 - xf.p); + b2Vec2 p2 = b2MulT(xf.q, input.p2 - xf.p); + b2Vec2 d = p2 - p1; + + float32 lower = 0.0f, upper = input.maxFraction; + + int32 index = -1; + + for (int32 i = 0; i < m_vertexCount; ++i) + { + // p = p1 + a * d + // dot(normal, p - v) = 0 + // dot(normal, p1 - v) + a * dot(normal, d) = 0 + float32 numerator = b2Dot(m_normals[i], m_vertices[i] - p1); + float32 denominator = b2Dot(m_normals[i], d); + + if (denominator == 0.0f) + { + if (numerator < 0.0f) + { + return false; + } + } + else + { + // Note: we want this predicate without division: + // lower < numerator / denominator, where denominator < 0 + // Since denominator < 0, we have to flip the inequality: + // lower < numerator / denominator <==> denominator * lower > numerator. + if (denominator < 0.0f && numerator < lower * denominator) + { + // Increase lower. + // The segment enters this half-space. + lower = numerator / denominator; + index = i; + } + else if (denominator > 0.0f && numerator < upper * denominator) + { + // Decrease upper. + // The segment exits this half-space. + upper = numerator / denominator; + } + } + + // The use of epsilon here causes the assert on lower to trip + // in some cases. Apparently the use of epsilon was to make edge + // shapes work, but now those are handled separately. + //if (upper < lower - b2_epsilon) + if (upper < lower) + { + return false; + } + } + + b2Assert(0.0f <= lower && lower <= input.maxFraction); + + if (index >= 0) + { + output->fraction = lower; + output->normal = b2Mul(xf.q, m_normals[index]); + return true; + } + + return false; +} + +void b2PolygonShape::ComputeAABB(b2AABB* aabb, const b2Transform& xf, int32 childIndex) const +{ + B2_NOT_USED(childIndex); + + b2Vec2 lower = b2Mul(xf, m_vertices[0]); + b2Vec2 upper = lower; + + for (int32 i = 1; i < m_vertexCount; ++i) + { + b2Vec2 v = b2Mul(xf, m_vertices[i]); + lower = b2Min(lower, v); + upper = b2Max(upper, v); + } + + b2Vec2 r(m_radius, m_radius); + aabb->lowerBound = lower - r; + aabb->upperBound = upper + r; +} + +void b2PolygonShape::ComputeMass(b2MassData* massData, float32 density) const +{ + // Polygon mass, centroid, and inertia. + // Let rho be the polygon density in mass per unit area. + // Then: + // mass = rho * int(dA) + // centroid.x = (1/mass) * rho * int(x * dA) + // centroid.y = (1/mass) * rho * int(y * dA) + // I = rho * int((x*x + y*y) * dA) + // + // We can compute these integrals by summing all the integrals + // for each triangle of the polygon. To evaluate the integral + // for a single triangle, we make a change of variables to + // the (u,v) coordinates of the triangle: + // x = x0 + e1x * u + e2x * v + // y = y0 + e1y * u + e2y * v + // where 0 <= u && 0 <= v && u + v <= 1. + // + // We integrate u from [0,1-v] and then v from [0,1]. + // We also need to use the Jacobian of the transformation: + // D = cross(e1, e2) + // + // Simplification: triangle centroid = (1/3) * (p1 + p2 + p3) + // + // The rest of the derivation is handled by computer algebra. + + b2Assert(m_vertexCount >= 3); + + b2Vec2 center; center.Set(0.0f, 0.0f); + float32 area = 0.0f; + float32 I = 0.0f; + + // s is the reference point for forming triangles. + // It's location doesn't change the result (except for rounding error). + b2Vec2 s(0.0f, 0.0f); + + // This code would put the reference point inside the polygon. + for (int32 i = 0; i < m_vertexCount; ++i) + { + s += m_vertices[i]; + } + s *= 1.0f / m_vertexCount; + + const float32 k_inv3 = 1.0f / 3.0f; + + for (int32 i = 0; i < m_vertexCount; ++i) + { + // Triangle vertices. + b2Vec2 e1 = m_vertices[i] - s; + b2Vec2 e2 = i + 1 < m_vertexCount ? m_vertices[i+1] - s : m_vertices[0] - s; + + float32 D = b2Cross(e1, e2); + + float32 triangleArea = 0.5f * D; + area += triangleArea; + + // Area weighted centroid + center += triangleArea * k_inv3 * (e1 + e2); + + float32 ex1 = e1.x, ey1 = e1.y; + float32 ex2 = e2.x, ey2 = e2.y; + + float32 intx2 = ex1*ex1 + ex2*ex1 + ex2*ex2; + float32 inty2 = ey1*ey1 + ey2*ey1 + ey2*ey2; + + I += (0.25f * k_inv3 * D) * (intx2 + inty2); + } + + // Total mass + massData->mass = density * area; + + // Center of mass + b2Assert(area > b2_epsilon); + center *= 1.0f / area; + massData->center = center + s; + + // Inertia tensor relative to the local origin (point s). + massData->I = density * I; + + // Shift to center of mass then to original body origin. + massData->I += massData->mass * (b2Dot(massData->center, massData->center) - b2Dot(center, center)); +} diff --git a/external/box2d/Collision/Shapes/b2PolygonShape.h b/external/box2d/Collision/Shapes/b2PolygonShape.h new file mode 100644 index 0000000000..70daccb2ff --- /dev/null +++ b/external/box2d/Collision/Shapes/b2PolygonShape.h @@ -0,0 +1,95 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_POLYGON_SHAPE_H +#define B2_POLYGON_SHAPE_H + +#include + +/// A convex polygon. It is assumed that the interior of the polygon is to +/// the left of each edge. +/// Polygons have a maximum number of vertices equal to b2_maxPolygonVertices. +/// In most cases you should not need many vertices for a convex polygon. +class b2PolygonShape : public b2Shape +{ +public: + b2PolygonShape(); + + /// Implement b2Shape. + b2Shape* Clone(b2BlockAllocator* allocator) const; + + /// @see b2Shape::GetChildCount + int32 GetChildCount() const; + + /// Copy vertices. This assumes the vertices define a convex polygon. + /// It is assumed that the exterior is the the right of each edge. + /// The count must be in the range [3, b2_maxPolygonVertices]. + void Set(const b2Vec2* vertices, int32 vertexCount); + + /// Build vertices to represent an axis-aligned box. + /// @param hx the half-width. + /// @param hy the half-height. + void SetAsBox(float32 hx, float32 hy); + + /// Build vertices to represent an oriented box. + /// @param hx the half-width. + /// @param hy the half-height. + /// @param center the center of the box in local coordinates. + /// @param angle the rotation of the box in local coordinates. + void SetAsBox(float32 hx, float32 hy, const b2Vec2& center, float32 angle); + + /// @see b2Shape::TestPoint + bool TestPoint(const b2Transform& transform, const b2Vec2& p) const; + + /// Implement b2Shape. + bool RayCast(b2RayCastOutput* output, const b2RayCastInput& input, + const b2Transform& transform, int32 childIndex) const; + + /// @see b2Shape::ComputeAABB + void ComputeAABB(b2AABB* aabb, const b2Transform& transform, int32 childIndex) const; + + /// @see b2Shape::ComputeMass + void ComputeMass(b2MassData* massData, float32 density) const; + + /// Get the vertex count. + int32 GetVertexCount() const { return m_vertexCount; } + + /// Get a vertex by index. + const b2Vec2& GetVertex(int32 index) const; + + b2Vec2 m_centroid; + b2Vec2 m_vertices[b2_maxPolygonVertices]; + b2Vec2 m_normals[b2_maxPolygonVertices]; + int32 m_vertexCount; +}; + +inline b2PolygonShape::b2PolygonShape() +{ + m_type = e_polygon; + m_radius = b2_polygonRadius; + m_vertexCount = 0; + m_centroid.SetZero(); +} + +inline const b2Vec2& b2PolygonShape::GetVertex(int32 index) const +{ + b2Assert(0 <= index && index < m_vertexCount); + return m_vertices[index]; +} + +#endif diff --git a/external/box2d/Collision/Shapes/b2Shape.h b/external/box2d/Collision/Shapes/b2Shape.h new file mode 100644 index 0000000000..2e2aedd14a --- /dev/null +++ b/external/box2d/Collision/Shapes/b2Shape.h @@ -0,0 +1,101 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_SHAPE_H +#define B2_SHAPE_H + +#include +#include +#include + +/// This holds the mass data computed for a shape. +struct b2MassData +{ + /// The mass of the shape, usually in kilograms. + float32 mass; + + /// The position of the shape's centroid relative to the shape's origin. + b2Vec2 center; + + /// The rotational inertia of the shape about the local origin. + float32 I; +}; + +/// A shape is used for collision detection. You can create a shape however you like. +/// Shapes used for simulation in b2World are created automatically when a b2Fixture +/// is created. Shapes may encapsulate a one or more child shapes. +class b2Shape +{ +public: + + enum Type + { + e_circle = 0, + e_edge = 1, + e_polygon = 2, + e_chain = 3, + e_typeCount = 4 + }; + + virtual ~b2Shape() {} + + /// Clone the concrete shape using the provided allocator. + virtual b2Shape* Clone(b2BlockAllocator* allocator) const = 0; + + /// Get the type of this shape. You can use this to down cast to the concrete shape. + /// @return the shape type. + Type GetType() const; + + /// Get the number of child primitives. + virtual int32 GetChildCount() const = 0; + + /// Test a point for containment in this shape. This only works for convex shapes. + /// @param xf the shape world transform. + /// @param p a point in world coordinates. + virtual bool TestPoint(const b2Transform& xf, const b2Vec2& p) const = 0; + + /// Cast a ray against a child shape. + /// @param output the ray-cast results. + /// @param input the ray-cast input parameters. + /// @param transform the transform to be applied to the shape. + /// @param childIndex the child shape index + virtual bool RayCast(b2RayCastOutput* output, const b2RayCastInput& input, + const b2Transform& transform, int32 childIndex) const = 0; + + /// Given a transform, compute the associated axis aligned bounding box for a child shape. + /// @param aabb returns the axis aligned box. + /// @param xf the world transform of the shape. + /// @param childIndex the child shape + virtual void ComputeAABB(b2AABB* aabb, const b2Transform& xf, int32 childIndex) const = 0; + + /// Compute the mass properties of this shape using its dimensions and density. + /// The inertia tensor is computed about the local origin. + /// @param massData returns the mass data for this shape. + /// @param density the density in kilograms per meter squared. + virtual void ComputeMass(b2MassData* massData, float32 density) const = 0; + + Type m_type; + float32 m_radius; +}; + +inline b2Shape::Type b2Shape::GetType() const +{ + return m_type; +} + +#endif diff --git a/external/box2d/Collision/b2BroadPhase.cpp b/external/box2d/Collision/b2BroadPhase.cpp new file mode 100644 index 0000000000..431f6de1ee --- /dev/null +++ b/external/box2d/Collision/b2BroadPhase.cpp @@ -0,0 +1,122 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +using namespace std; + +b2BroadPhase::b2BroadPhase() +{ + m_proxyCount = 0; + + m_pairCapacity = 16; + m_pairCount = 0; + m_pairBuffer = (b2Pair*)b2Alloc(m_pairCapacity * sizeof(b2Pair)); + + m_moveCapacity = 16; + m_moveCount = 0; + m_moveBuffer = (int32*)b2Alloc(m_moveCapacity * sizeof(int32)); +} + +b2BroadPhase::~b2BroadPhase() +{ + b2Free(m_moveBuffer); + b2Free(m_pairBuffer); +} + +int32 b2BroadPhase::CreateProxy(const b2AABB& aabb, void* userData) +{ + int32 proxyId = m_tree.CreateProxy(aabb, userData); + ++m_proxyCount; + BufferMove(proxyId); + return proxyId; +} + +void b2BroadPhase::DestroyProxy(int32 proxyId) +{ + UnBufferMove(proxyId); + --m_proxyCount; + m_tree.DestroyProxy(proxyId); +} + +void b2BroadPhase::MoveProxy(int32 proxyId, const b2AABB& aabb, const b2Vec2& displacement) +{ + bool buffer = m_tree.MoveProxy(proxyId, aabb, displacement); + if (buffer) + { + BufferMove(proxyId); + } +} + +void b2BroadPhase::TouchProxy(int32 proxyId) +{ + BufferMove(proxyId); +} + +void b2BroadPhase::BufferMove(int32 proxyId) +{ + if (m_moveCount == m_moveCapacity) + { + int32* oldBuffer = m_moveBuffer; + m_moveCapacity *= 2; + m_moveBuffer = (int32*)b2Alloc(m_moveCapacity * sizeof(int32)); + memcpy(m_moveBuffer, oldBuffer, m_moveCount * sizeof(int32)); + b2Free(oldBuffer); + } + + m_moveBuffer[m_moveCount] = proxyId; + ++m_moveCount; +} + +void b2BroadPhase::UnBufferMove(int32 proxyId) +{ + for (int32 i = 0; i < m_moveCount; ++i) + { + if (m_moveBuffer[i] == proxyId) + { + m_moveBuffer[i] = e_nullProxy; + return; + } + } +} + +// This is called from b2DynamicTree::Query when we are gathering pairs. +bool b2BroadPhase::QueryCallback(int32 proxyId) +{ + // A proxy cannot form a pair with itself. + if (proxyId == m_queryProxyId) + { + return true; + } + + // Grow the pair buffer as needed. + if (m_pairCount == m_pairCapacity) + { + b2Pair* oldBuffer = m_pairBuffer; + m_pairCapacity *= 2; + m_pairBuffer = (b2Pair*)b2Alloc(m_pairCapacity * sizeof(b2Pair)); + memcpy(m_pairBuffer, oldBuffer, m_pairCount * sizeof(b2Pair)); + b2Free(oldBuffer); + } + + m_pairBuffer[m_pairCount].proxyIdA = b2Min(proxyId, m_queryProxyId); + m_pairBuffer[m_pairCount].proxyIdB = b2Max(proxyId, m_queryProxyId); + ++m_pairCount; + + return true; +} diff --git a/external/box2d/Collision/b2BroadPhase.h b/external/box2d/Collision/b2BroadPhase.h new file mode 100644 index 0000000000..cf2414730a --- /dev/null +++ b/external/box2d/Collision/b2BroadPhase.h @@ -0,0 +1,248 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_BROAD_PHASE_H +#define B2_BROAD_PHASE_H + +#include +#include +#include +#include + +struct b2Pair +{ + int32 proxyIdA; + int32 proxyIdB; + int32 next; +}; + +/// The broad-phase is used for computing pairs and performing volume queries and ray casts. +/// This broad-phase does not persist pairs. Instead, this reports potentially new pairs. +/// It is up to the client to consume the new pairs and to track subsequent overlap. +class b2BroadPhase +{ +public: + + enum + { + e_nullProxy = -1 + }; + + b2BroadPhase(); + ~b2BroadPhase(); + + /// Create a proxy with an initial AABB. Pairs are not reported until + /// UpdatePairs is called. + int32 CreateProxy(const b2AABB& aabb, void* userData); + + /// Destroy a proxy. It is up to the client to remove any pairs. + void DestroyProxy(int32 proxyId); + + /// Call MoveProxy as many times as you like, then when you are done + /// call UpdatePairs to finalized the proxy pairs (for your time step). + void MoveProxy(int32 proxyId, const b2AABB& aabb, const b2Vec2& displacement); + + /// Call to trigger a re-processing of it's pairs on the next call to UpdatePairs. + void TouchProxy(int32 proxyId); + + /// Get the fat AABB for a proxy. + const b2AABB& GetFatAABB(int32 proxyId) const; + + /// Get user data from a proxy. Returns NULL if the id is invalid. + void* GetUserData(int32 proxyId) const; + + /// Test overlap of fat AABBs. + bool TestOverlap(int32 proxyIdA, int32 proxyIdB) const; + + /// Get the number of proxies. + int32 GetProxyCount() const; + + /// Update the pairs. This results in pair callbacks. This can only add pairs. + template + void UpdatePairs(T* callback); + + /// Query an AABB for overlapping proxies. The callback class + /// is called for each proxy that overlaps the supplied AABB. + template + void Query(T* callback, const b2AABB& aabb) const; + + /// Ray-cast against the proxies in the tree. This relies on the callback + /// to perform a exact ray-cast in the case were the proxy contains a shape. + /// The callback also performs the any collision filtering. This has performance + /// roughly equal to k * log(n), where k is the number of collisions and n is the + /// number of proxies in the tree. + /// @param input the ray-cast input data. The ray extends from p1 to p1 + maxFraction * (p2 - p1). + /// @param callback a callback class that is called for each proxy that is hit by the ray. + template + void RayCast(T* callback, const b2RayCastInput& input) const; + + /// Get the height of the embedded tree. + int32 GetTreeHeight() const; + + /// Get the balance of the embedded tree. + int32 GetTreeBalance() const; + + /// Get the quality metric of the embedded tree. + float32 GetTreeQuality() const; + +private: + + friend class b2DynamicTree; + + void BufferMove(int32 proxyId); + void UnBufferMove(int32 proxyId); + + bool QueryCallback(int32 proxyId); + + b2DynamicTree m_tree; + + int32 m_proxyCount; + + int32* m_moveBuffer; + int32 m_moveCapacity; + int32 m_moveCount; + + b2Pair* m_pairBuffer; + int32 m_pairCapacity; + int32 m_pairCount; + + int32 m_queryProxyId; +}; + +/// This is used to sort pairs. +inline bool b2PairLessThan(const b2Pair& pair1, const b2Pair& pair2) +{ + if (pair1.proxyIdA < pair2.proxyIdA) + { + return true; + } + + if (pair1.proxyIdA == pair2.proxyIdA) + { + return pair1.proxyIdB < pair2.proxyIdB; + } + + return false; +} + +inline void* b2BroadPhase::GetUserData(int32 proxyId) const +{ + return m_tree.GetUserData(proxyId); +} + +inline bool b2BroadPhase::TestOverlap(int32 proxyIdA, int32 proxyIdB) const +{ + const b2AABB& aabbA = m_tree.GetFatAABB(proxyIdA); + const b2AABB& aabbB = m_tree.GetFatAABB(proxyIdB); + return b2TestOverlap(aabbA, aabbB); +} + +inline const b2AABB& b2BroadPhase::GetFatAABB(int32 proxyId) const +{ + return m_tree.GetFatAABB(proxyId); +} + +inline int32 b2BroadPhase::GetProxyCount() const +{ + return m_proxyCount; +} + +inline int32 b2BroadPhase::GetTreeHeight() const +{ + return m_tree.GetHeight(); +} + +inline int32 b2BroadPhase::GetTreeBalance() const +{ + return m_tree.GetMaxBalance(); +} + +inline float32 b2BroadPhase::GetTreeQuality() const +{ + return m_tree.GetAreaRatio(); +} + +template +void b2BroadPhase::UpdatePairs(T* callback) +{ + // Reset pair buffer + m_pairCount = 0; + + // Perform tree queries for all moving proxies. + for (int32 i = 0; i < m_moveCount; ++i) + { + m_queryProxyId = m_moveBuffer[i]; + if (m_queryProxyId == e_nullProxy) + { + continue; + } + + // We have to query the tree with the fat AABB so that + // we don't fail to create a pair that may touch later. + const b2AABB& fatAABB = m_tree.GetFatAABB(m_queryProxyId); + + // Query tree, create pairs and add them pair buffer. + m_tree.Query(this, fatAABB); + } + + // Reset move buffer + m_moveCount = 0; + + // Sort the pair buffer to expose duplicates. + std::sort(m_pairBuffer, m_pairBuffer + m_pairCount, b2PairLessThan); + + // Send the pairs back to the client. + int32 i = 0; + while (i < m_pairCount) + { + b2Pair* primaryPair = m_pairBuffer + i; + void* userDataA = m_tree.GetUserData(primaryPair->proxyIdA); + void* userDataB = m_tree.GetUserData(primaryPair->proxyIdB); + + callback->AddPair(userDataA, userDataB); + ++i; + + // Skip any duplicate pairs. + while (i < m_pairCount) + { + b2Pair* pair = m_pairBuffer + i; + if (pair->proxyIdA != primaryPair->proxyIdA || pair->proxyIdB != primaryPair->proxyIdB) + { + break; + } + ++i; + } + } + + // Try to keep the tree balanced. + //m_tree.Rebalance(4); +} + +template +inline void b2BroadPhase::Query(T* callback, const b2AABB& aabb) const +{ + m_tree.Query(callback, aabb); +} + +template +inline void b2BroadPhase::RayCast(T* callback, const b2RayCastInput& input) const +{ + m_tree.RayCast(callback, input); +} + +#endif diff --git a/external/box2d/Collision/b2CollideCircle.cpp b/external/box2d/Collision/b2CollideCircle.cpp new file mode 100644 index 0000000000..ed561eb04b --- /dev/null +++ b/external/box2d/Collision/b2CollideCircle.cpp @@ -0,0 +1,154 @@ +/* +* Copyright (c) 2007-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include + +void b2CollideCircles( + b2Manifold* manifold, + const b2CircleShape* circleA, const b2Transform& xfA, + const b2CircleShape* circleB, const b2Transform& xfB) +{ + manifold->pointCount = 0; + + b2Vec2 pA = b2Mul(xfA, circleA->m_p); + b2Vec2 pB = b2Mul(xfB, circleB->m_p); + + b2Vec2 d = pB - pA; + float32 distSqr = b2Dot(d, d); + float32 rA = circleA->m_radius, rB = circleB->m_radius; + float32 radius = rA + rB; + if (distSqr > radius * radius) + { + return; + } + + manifold->type = b2Manifold::e_circles; + manifold->localPoint = circleA->m_p; + manifold->localNormal.SetZero(); + manifold->pointCount = 1; + + manifold->points[0].localPoint = circleB->m_p; + manifold->points[0].id.key = 0; +} + +void b2CollidePolygonAndCircle( + b2Manifold* manifold, + const b2PolygonShape* polygonA, const b2Transform& xfA, + const b2CircleShape* circleB, const b2Transform& xfB) +{ + manifold->pointCount = 0; + + // Compute circle position in the frame of the polygon. + b2Vec2 c = b2Mul(xfB, circleB->m_p); + b2Vec2 cLocal = b2MulT(xfA, c); + + // Find the min separating edge. + int32 normalIndex = 0; + float32 separation = -b2_maxFloat; + float32 radius = polygonA->m_radius + circleB->m_radius; + int32 vertexCount = polygonA->m_vertexCount; + const b2Vec2* vertices = polygonA->m_vertices; + const b2Vec2* normals = polygonA->m_normals; + + for (int32 i = 0; i < vertexCount; ++i) + { + float32 s = b2Dot(normals[i], cLocal - vertices[i]); + + if (s > radius) + { + // Early out. + return; + } + + if (s > separation) + { + separation = s; + normalIndex = i; + } + } + + // Vertices that subtend the incident face. + int32 vertIndex1 = normalIndex; + int32 vertIndex2 = vertIndex1 + 1 < vertexCount ? vertIndex1 + 1 : 0; + b2Vec2 v1 = vertices[vertIndex1]; + b2Vec2 v2 = vertices[vertIndex2]; + + // If the center is inside the polygon ... + if (separation < b2_epsilon) + { + manifold->pointCount = 1; + manifold->type = b2Manifold::e_faceA; + manifold->localNormal = normals[normalIndex]; + manifold->localPoint = 0.5f * (v1 + v2); + manifold->points[0].localPoint = circleB->m_p; + manifold->points[0].id.key = 0; + return; + } + + // Compute barycentric coordinates + float32 u1 = b2Dot(cLocal - v1, v2 - v1); + float32 u2 = b2Dot(cLocal - v2, v1 - v2); + if (u1 <= 0.0f) + { + if (b2DistanceSquared(cLocal, v1) > radius * radius) + { + return; + } + + manifold->pointCount = 1; + manifold->type = b2Manifold::e_faceA; + manifold->localNormal = cLocal - v1; + manifold->localNormal.Normalize(); + manifold->localPoint = v1; + manifold->points[0].localPoint = circleB->m_p; + manifold->points[0].id.key = 0; + } + else if (u2 <= 0.0f) + { + if (b2DistanceSquared(cLocal, v2) > radius * radius) + { + return; + } + + manifold->pointCount = 1; + manifold->type = b2Manifold::e_faceA; + manifold->localNormal = cLocal - v2; + manifold->localNormal.Normalize(); + manifold->localPoint = v2; + manifold->points[0].localPoint = circleB->m_p; + manifold->points[0].id.key = 0; + } + else + { + b2Vec2 faceCenter = 0.5f * (v1 + v2); + float32 separation = b2Dot(cLocal - faceCenter, normals[vertIndex1]); + if (separation > radius) + { + return; + } + + manifold->pointCount = 1; + manifold->type = b2Manifold::e_faceA; + manifold->localNormal = normals[vertIndex1]; + manifold->localPoint = faceCenter; + manifold->points[0].localPoint = circleB->m_p; + manifold->points[0].id.key = 0; + } +} diff --git a/external/box2d/Collision/b2CollideEdge.cpp b/external/box2d/Collision/b2CollideEdge.cpp new file mode 100644 index 0000000000..96ca71dccc --- /dev/null +++ b/external/box2d/Collision/b2CollideEdge.cpp @@ -0,0 +1,698 @@ +/* + * Copyright (c) 2007-2009 Erin Catto http://www.box2d.org + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + */ + +#include +#include +#include +#include + + +// Compute contact points for edge versus circle. +// This accounts for edge connectivity. +void b2CollideEdgeAndCircle(b2Manifold* manifold, + const b2EdgeShape* edgeA, const b2Transform& xfA, + const b2CircleShape* circleB, const b2Transform& xfB) +{ + manifold->pointCount = 0; + + // Compute circle in frame of edge + b2Vec2 Q = b2MulT(xfA, b2Mul(xfB, circleB->m_p)); + + b2Vec2 A = edgeA->m_vertex1, B = edgeA->m_vertex2; + b2Vec2 e = B - A; + + // Barycentric coordinates + float32 u = b2Dot(e, B - Q); + float32 v = b2Dot(e, Q - A); + + float32 radius = edgeA->m_radius + circleB->m_radius; + + b2ContactFeature cf; + cf.indexB = 0; + cf.typeB = b2ContactFeature::e_vertex; + + // Region A + if (v <= 0.0f) + { + b2Vec2 P = A; + b2Vec2 d = Q - P; + float32 dd = b2Dot(d, d); + if (dd > radius * radius) + { + return; + } + + // Is there an edge connected to A? + if (edgeA->m_hasVertex0) + { + b2Vec2 A1 = edgeA->m_vertex0; + b2Vec2 B1 = A; + b2Vec2 e1 = B1 - A1; + float32 u1 = b2Dot(e1, B1 - Q); + + // Is the circle in Region AB of the previous edge? + if (u1 > 0.0f) + { + return; + } + } + + cf.indexA = 0; + cf.typeA = b2ContactFeature::e_vertex; + manifold->pointCount = 1; + manifold->type = b2Manifold::e_circles; + manifold->localNormal.SetZero(); + manifold->localPoint = P; + manifold->points[0].id.key = 0; + manifold->points[0].id.cf = cf; + manifold->points[0].localPoint = circleB->m_p; + return; + } + + // Region B + if (u <= 0.0f) + { + b2Vec2 P = B; + b2Vec2 d = Q - P; + float32 dd = b2Dot(d, d); + if (dd > radius * radius) + { + return; + } + + // Is there an edge connected to B? + if (edgeA->m_hasVertex3) + { + b2Vec2 B2 = edgeA->m_vertex3; + b2Vec2 A2 = B; + b2Vec2 e2 = B2 - A2; + float32 v2 = b2Dot(e2, Q - A2); + + // Is the circle in Region AB of the next edge? + if (v2 > 0.0f) + { + return; + } + } + + cf.indexA = 1; + cf.typeA = b2ContactFeature::e_vertex; + manifold->pointCount = 1; + manifold->type = b2Manifold::e_circles; + manifold->localNormal.SetZero(); + manifold->localPoint = P; + manifold->points[0].id.key = 0; + manifold->points[0].id.cf = cf; + manifold->points[0].localPoint = circleB->m_p; + return; + } + + // Region AB + float32 den = b2Dot(e, e); + b2Assert(den > 0.0f); + b2Vec2 P = (1.0f / den) * (u * A + v * B); + b2Vec2 d = Q - P; + float32 dd = b2Dot(d, d); + if (dd > radius * radius) + { + return; + } + + b2Vec2 n(-e.y, e.x); + if (b2Dot(n, Q - A) < 0.0f) + { + n.Set(-n.x, -n.y); + } + n.Normalize(); + + cf.indexA = 0; + cf.typeA = b2ContactFeature::e_face; + manifold->pointCount = 1; + manifold->type = b2Manifold::e_faceA; + manifold->localNormal = n; + manifold->localPoint = A; + manifold->points[0].id.key = 0; + manifold->points[0].id.cf = cf; + manifold->points[0].localPoint = circleB->m_p; +} + +// This structure is used to keep track of the best separating axis. +struct b2EPAxis +{ + enum Type + { + e_unknown, + e_edgeA, + e_edgeB + }; + + Type type; + int32 index; + float32 separation; +}; + +// This holds polygon B expressed in frame A. +struct b2TempPolygon +{ + b2Vec2 vertices[b2_maxPolygonVertices]; + b2Vec2 normals[b2_maxPolygonVertices]; + int32 count; +}; + +// Reference face used for clipping +struct b2ReferenceFace +{ + int32 i1, i2; + + b2Vec2 v1, v2; + + b2Vec2 normal; + + b2Vec2 sideNormal1; + float32 sideOffset1; + + b2Vec2 sideNormal2; + float32 sideOffset2; +}; + +// This class collides and edge and a polygon, taking into account edge adjacency. +struct b2EPCollider +{ + void Collide(b2Manifold* manifold, const b2EdgeShape* edgeA, const b2Transform& xfA, + const b2PolygonShape* polygonB, const b2Transform& xfB); + b2EPAxis ComputeEdgeSeparation(); + b2EPAxis ComputePolygonSeparation(); + + enum VertexType + { + e_isolated, + e_concave, + e_convex + }; + + b2TempPolygon m_polygonB; + + b2Transform m_xf; + b2Vec2 m_centroidB; + b2Vec2 m_v0, m_v1, m_v2, m_v3; + b2Vec2 m_normal0, m_normal1, m_normal2; + b2Vec2 m_normal; + VertexType m_type1, m_type2; + b2Vec2 m_lowerLimit, m_upperLimit; + float32 m_radius; + bool m_front; +}; + +// Algorithm: +// 1. Classify v1 and v2 +// 2. Classify polygon centroid as front or back +// 3. Flip normal if necessary +// 4. Initialize normal range to [-pi, pi] about face normal +// 5. Adjust normal range according to adjacent edges +// 6. Visit each separating axes, only accept axes within the range +// 7. Return if _any_ axis indicates separation +// 8. Clip +void b2EPCollider::Collide(b2Manifold* manifold, const b2EdgeShape* edgeA, const b2Transform& xfA, + const b2PolygonShape* polygonB, const b2Transform& xfB) +{ + m_xf = b2MulT(xfA, xfB); + + m_centroidB = b2Mul(m_xf, polygonB->m_centroid); + + m_v0 = edgeA->m_vertex0; + m_v1 = edgeA->m_vertex1; + m_v2 = edgeA->m_vertex2; + m_v3 = edgeA->m_vertex3; + + bool hasVertex0 = edgeA->m_hasVertex0; + bool hasVertex3F = edgeA->m_hasVertex3; + + b2Vec2 edge1 = m_v2 - m_v1; + edge1.Normalize(); + m_normal1.Set(edge1.y, -edge1.x); + float32 offset1 = b2Dot(m_normal1, m_centroidB - m_v1); + float32 offset0 = 0.0f, offset2 = 0.0f; + bool convex1 = false, convex2 = false; + + // Is there a preceding edge? + if (hasVertex0) + { + b2Vec2 edge0 = m_v1 - m_v0; + edge0.Normalize(); + m_normal0.Set(edge0.y, -edge0.x); + convex1 = b2Cross(edge0, edge1) >= 0.0f; + offset0 = b2Dot(m_normal0, m_centroidB - m_v0); + } + + // Is there a following edge? + if (hasVertex3F) + { + b2Vec2 edge2 = m_v3 - m_v2; + edge2.Normalize(); + m_normal2.Set(edge2.y, -edge2.x); + convex2 = b2Cross(edge1, edge2) > 0.0f; + offset2 = b2Dot(m_normal2, m_centroidB - m_v2); + } + + // Determine front or back collision. Determine collision normal limits. + if (hasVertex0 && hasVertex3F) + { + if (convex1 && convex2) + { + m_front = offset0 >= 0.0f || offset1 >= 0.0f || offset2 >= 0.0f; + if (m_front) + { + m_normal = m_normal1; + m_lowerLimit = m_normal0; + m_upperLimit = m_normal2; + } + else + { + m_normal = -m_normal1; + m_lowerLimit = -m_normal1; + m_upperLimit = -m_normal1; + } + } + else if (convex1) + { + m_front = offset0 >= 0.0f || (offset1 >= 0.0f && offset2 >= 0.0f); + if (m_front) + { + m_normal = m_normal1; + m_lowerLimit = m_normal0; + m_upperLimit = m_normal1; + } + else + { + m_normal = -m_normal1; + m_lowerLimit = -m_normal2; + m_upperLimit = -m_normal1; + } + } + else if (convex2) + { + m_front = offset2 >= 0.0f || (offset0 >= 0.0f && offset1 >= 0.0f); + if (m_front) + { + m_normal = m_normal1; + m_lowerLimit = m_normal1; + m_upperLimit = m_normal2; + } + else + { + m_normal = -m_normal1; + m_lowerLimit = -m_normal1; + m_upperLimit = -m_normal0; + } + } + else + { + m_front = offset0 >= 0.0f && offset1 >= 0.0f && offset2 >= 0.0f; + if (m_front) + { + m_normal = m_normal1; + m_lowerLimit = m_normal1; + m_upperLimit = m_normal1; + } + else + { + m_normal = -m_normal1; + m_lowerLimit = -m_normal2; + m_upperLimit = -m_normal0; + } + } + } + else if (hasVertex0) + { + if (convex1) + { + m_front = offset0 >= 0.0f || offset1 >= 0.0f; + if (m_front) + { + m_normal = m_normal1; + m_lowerLimit = m_normal0; + m_upperLimit = -m_normal1; + } + else + { + m_normal = -m_normal1; + m_lowerLimit = m_normal1; + m_upperLimit = -m_normal1; + } + } + else + { + m_front = offset0 >= 0.0f && offset1 >= 0.0f; + if (m_front) + { + m_normal = m_normal1; + m_lowerLimit = m_normal1; + m_upperLimit = -m_normal1; + } + else + { + m_normal = -m_normal1; + m_lowerLimit = m_normal1; + m_upperLimit = -m_normal0; + } + } + } + else if (hasVertex3F) + { + if (convex2) + { + m_front = offset1 >= 0.0f || offset2 >= 0.0f; + if (m_front) + { + m_normal = m_normal1; + m_lowerLimit = -m_normal1; + m_upperLimit = m_normal2; + } + else + { + m_normal = -m_normal1; + m_lowerLimit = -m_normal1; + m_upperLimit = m_normal1; + } + } + else + { + m_front = offset1 >= 0.0f && offset2 >= 0.0f; + if (m_front) + { + m_normal = m_normal1; + m_lowerLimit = -m_normal1; + m_upperLimit = m_normal1; + } + else + { + m_normal = -m_normal1; + m_lowerLimit = -m_normal2; + m_upperLimit = m_normal1; + } + } + } + else + { + m_front = offset1 >= 0.0f; + if (m_front) + { + m_normal = m_normal1; + m_lowerLimit = -m_normal1; + m_upperLimit = -m_normal1; + } + else + { + m_normal = -m_normal1; + m_lowerLimit = m_normal1; + m_upperLimit = m_normal1; + } + } + + // Get polygonB in frameA + m_polygonB.count = polygonB->m_vertexCount; + for (int32 i = 0; i < polygonB->m_vertexCount; ++i) + { + m_polygonB.vertices[i] = b2Mul(m_xf, polygonB->m_vertices[i]); + m_polygonB.normals[i] = b2Mul(m_xf.q, polygonB->m_normals[i]); + } + + m_radius = 2.0f * b2_polygonRadius; + + manifold->pointCount = 0; + + b2EPAxis edgeAxis = ComputeEdgeSeparation(); + + // If no valid normal can be found than this edge should not collide. + if (edgeAxis.type == b2EPAxis::e_unknown) + { + return; + } + + if (edgeAxis.separation > m_radius) + { + return; + } + + b2EPAxis polygonAxis = ComputePolygonSeparation(); + if (polygonAxis.type != b2EPAxis::e_unknown && polygonAxis.separation > m_radius) + { + return; + } + + // Use hysteresis for jitter reduction. + const float32 k_relativeTol = 0.98f; + const float32 k_absoluteTol = 0.001f; + + b2EPAxis primaryAxis; + if (polygonAxis.type == b2EPAxis::e_unknown) + { + primaryAxis = edgeAxis; + } + else if (polygonAxis.separation > k_relativeTol * edgeAxis.separation + k_absoluteTol) + { + primaryAxis = polygonAxis; + } + else + { + primaryAxis = edgeAxis; + } + + b2ClipVertex ie[2]; + b2ReferenceFace rf; + if (primaryAxis.type == b2EPAxis::e_edgeA) + { + manifold->type = b2Manifold::e_faceA; + + // Search for the polygon normal that is most anti-parallel to the edge normal. + int32 bestIndex = 0; + float32 bestValue = b2Dot(m_normal, m_polygonB.normals[0]); + for (int32 i = 1; i < m_polygonB.count; ++i) + { + float32 value = b2Dot(m_normal, m_polygonB.normals[i]); + if (value < bestValue) + { + bestValue = value; + bestIndex = i; + } + } + + int32 i1 = bestIndex; + int32 i2 = i1 + 1 < m_polygonB.count ? i1 + 1 : 0; + + ie[0].v = m_polygonB.vertices[i1]; + ie[0].id.cf.indexA = 0; + ie[0].id.cf.indexB = i1; + ie[0].id.cf.typeA = b2ContactFeature::e_face; + ie[0].id.cf.typeB = b2ContactFeature::e_vertex; + + ie[1].v = m_polygonB.vertices[i2]; + ie[1].id.cf.indexA = 0; + ie[1].id.cf.indexB = i2; + ie[1].id.cf.typeA = b2ContactFeature::e_face; + ie[1].id.cf.typeB = b2ContactFeature::e_vertex; + + if (m_front) + { + rf.i1 = 0; + rf.i2 = 1; + rf.v1 = m_v1; + rf.v2 = m_v2; + rf.normal = m_normal1; + } + else + { + rf.i1 = 1; + rf.i2 = 0; + rf.v1 = m_v2; + rf.v2 = m_v1; + rf.normal = -m_normal1; + } + } + else + { + manifold->type = b2Manifold::e_faceB; + + ie[0].v = m_v1; + ie[0].id.cf.indexA = 0; + ie[0].id.cf.indexB = primaryAxis.index; + ie[0].id.cf.typeA = b2ContactFeature::e_vertex; + ie[0].id.cf.typeB = b2ContactFeature::e_face; + + ie[1].v = m_v2; + ie[1].id.cf.indexA = 0; + ie[1].id.cf.indexB = primaryAxis.index; + ie[1].id.cf.typeA = b2ContactFeature::e_vertex; + ie[1].id.cf.typeB = b2ContactFeature::e_face; + + rf.i1 = primaryAxis.index; + rf.i2 = rf.i1 + 1 < m_polygonB.count ? rf.i1 + 1 : 0; + rf.v1 = m_polygonB.vertices[rf.i1]; + rf.v2 = m_polygonB.vertices[rf.i2]; + rf.normal = m_polygonB.normals[rf.i1]; + } + + rf.sideNormal1.Set(rf.normal.y, -rf.normal.x); + rf.sideNormal2 = -rf.sideNormal1; + rf.sideOffset1 = b2Dot(rf.sideNormal1, rf.v1); + rf.sideOffset2 = b2Dot(rf.sideNormal2, rf.v2); + + // Clip incident edge against extruded edge1 side edges. + b2ClipVertex clipPoints1[2]; + b2ClipVertex clipPoints2[2]; + int32 np; + + // Clip to box side 1 + np = b2ClipSegmentToLine(clipPoints1, ie, rf.sideNormal1, rf.sideOffset1, rf.i1); + + if (np < b2_maxManifoldPoints) + { + return; + } + + // Clip to negative box side 1 + np = b2ClipSegmentToLine(clipPoints2, clipPoints1, rf.sideNormal2, rf.sideOffset2, rf.i2); + + if (np < b2_maxManifoldPoints) + { + return; + } + + // Now clipPoints2 contains the clipped points. + if (primaryAxis.type == b2EPAxis::e_edgeA) + { + manifold->localNormal = rf.normal; + manifold->localPoint = rf.v1; + } + else + { + manifold->localNormal = polygonB->m_normals[rf.i1]; + manifold->localPoint = polygonB->m_vertices[rf.i1]; + } + + int32 pointCount = 0; + for (int32 i = 0; i < b2_maxManifoldPoints; ++i) + { + float32 separation; + + separation = b2Dot(rf.normal, clipPoints2[i].v - rf.v1); + + if (separation <= m_radius) + { + b2ManifoldPoint* cp = manifold->points + pointCount; + + if (primaryAxis.type == b2EPAxis::e_edgeA) + { + cp->localPoint = b2MulT(m_xf, clipPoints2[i].v); + cp->id = clipPoints2[i].id; + } + else + { + cp->localPoint = clipPoints2[i].v; + cp->id.cf.typeA = clipPoints2[i].id.cf.typeB; + cp->id.cf.typeB = clipPoints2[i].id.cf.typeA; + cp->id.cf.indexA = clipPoints2[i].id.cf.indexB; + cp->id.cf.indexB = clipPoints2[i].id.cf.indexA; + } + + ++pointCount; + } + } + + manifold->pointCount = pointCount; +} + +b2EPAxis b2EPCollider::ComputeEdgeSeparation() +{ + b2EPAxis axis; + axis.type = b2EPAxis::e_edgeA; + axis.index = m_front ? 0 : 1; + axis.separation = FLT_MAX; + + for (int32 i = 0; i < m_polygonB.count; ++i) + { + float32 s = b2Dot(m_normal, m_polygonB.vertices[i] - m_v1); + if (s < axis.separation) + { + axis.separation = s; + } + } + + return axis; +} + +b2EPAxis b2EPCollider::ComputePolygonSeparation() +{ + b2EPAxis axis; + axis.type = b2EPAxis::e_unknown; + axis.index = -1; + axis.separation = -FLT_MAX; + + b2Vec2 perp(-m_normal.y, m_normal.x); + + for (int32 i = 0; i < m_polygonB.count; ++i) + { + b2Vec2 n = -m_polygonB.normals[i]; + + float32 s1 = b2Dot(n, m_polygonB.vertices[i] - m_v1); + float32 s2 = b2Dot(n, m_polygonB.vertices[i] - m_v2); + float32 s = b2Min(s1, s2); + + if (s > m_radius) + { + // No collision + axis.type = b2EPAxis::e_edgeB; + axis.index = i; + axis.separation = s; + return axis; + } + + // Adjacency + if (b2Dot(n, perp) >= 0.0f) + { + if (b2Dot(n - m_upperLimit, m_normal) < -b2_angularSlop) + { + continue; + } + } + else + { + if (b2Dot(n - m_lowerLimit, m_normal) < -b2_angularSlop) + { + continue; + } + } + + if (s > axis.separation) + { + axis.type = b2EPAxis::e_edgeB; + axis.index = i; + axis.separation = s; + } + } + + return axis; +} + +void b2CollideEdgeAndPolygon( b2Manifold* manifold, + const b2EdgeShape* edgeA, const b2Transform& xfA, + const b2PolygonShape* polygonB, const b2Transform& xfB) +{ + b2EPCollider collider; + collider.Collide(manifold, edgeA, xfA, polygonB, xfB); +} diff --git a/external/box2d/Collision/b2CollidePolygon.cpp b/external/box2d/Collision/b2CollidePolygon.cpp new file mode 100644 index 0000000000..be2518d966 --- /dev/null +++ b/external/box2d/Collision/b2CollidePolygon.cpp @@ -0,0 +1,317 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include + +// Find the separation between poly1 and poly2 for a give edge normal on poly1. +static float32 b2EdgeSeparation(const b2PolygonShape* poly1, const b2Transform& xf1, int32 edge1, + const b2PolygonShape* poly2, const b2Transform& xf2) +{ + const b2Vec2* vertices1 = poly1->m_vertices; + const b2Vec2* normals1 = poly1->m_normals; + + int32 count2 = poly2->m_vertexCount; + const b2Vec2* vertices2 = poly2->m_vertices; + + b2Assert(0 <= edge1 && edge1 < poly1->m_vertexCount); + + // Convert normal from poly1's frame into poly2's frame. + b2Vec2 normal1World = b2Mul(xf1.q, normals1[edge1]); + b2Vec2 normal1 = b2MulT(xf2.q, normal1World); + + // Find support vertex on poly2 for -normal. + int32 index = 0; + float32 minDot = b2_maxFloat; + + for (int32 i = 0; i < count2; ++i) + { + float32 dot = b2Dot(vertices2[i], normal1); + if (dot < minDot) + { + minDot = dot; + index = i; + } + } + + b2Vec2 v1 = b2Mul(xf1, vertices1[edge1]); + b2Vec2 v2 = b2Mul(xf2, vertices2[index]); + float32 separation = b2Dot(v2 - v1, normal1World); + return separation; +} + +// Find the max separation between poly1 and poly2 using edge normals from poly1. +static float32 b2FindMaxSeparation(int32* edgeIndex, + const b2PolygonShape* poly1, const b2Transform& xf1, + const b2PolygonShape* poly2, const b2Transform& xf2) +{ + int32 count1 = poly1->m_vertexCount; + const b2Vec2* normals1 = poly1->m_normals; + + // Vector pointing from the centroid of poly1 to the centroid of poly2. + b2Vec2 d = b2Mul(xf2, poly2->m_centroid) - b2Mul(xf1, poly1->m_centroid); + b2Vec2 dLocal1 = b2MulT(xf1.q, d); + + // Find edge normal on poly1 that has the largest projection onto d. + int32 edge = 0; + float32 maxDot = -b2_maxFloat; + for (int32 i = 0; i < count1; ++i) + { + float32 dot = b2Dot(normals1[i], dLocal1); + if (dot > maxDot) + { + maxDot = dot; + edge = i; + } + } + + // Get the separation for the edge normal. + float32 s = b2EdgeSeparation(poly1, xf1, edge, poly2, xf2); + + // Check the separation for the previous edge normal. + int32 prevEdge = edge - 1 >= 0 ? edge - 1 : count1 - 1; + float32 sPrev = b2EdgeSeparation(poly1, xf1, prevEdge, poly2, xf2); + + // Check the separation for the next edge normal. + int32 nextEdge = edge + 1 < count1 ? edge + 1 : 0; + float32 sNext = b2EdgeSeparation(poly1, xf1, nextEdge, poly2, xf2); + + // Find the best edge and the search direction. + int32 bestEdge; + float32 bestSeparation; + int32 increment; + if (sPrev > s && sPrev > sNext) + { + increment = -1; + bestEdge = prevEdge; + bestSeparation = sPrev; + } + else if (sNext > s) + { + increment = 1; + bestEdge = nextEdge; + bestSeparation = sNext; + } + else + { + *edgeIndex = edge; + return s; + } + + // Perform a local search for the best edge normal. + for ( ; ; ) + { + if (increment == -1) + edge = bestEdge - 1 >= 0 ? bestEdge - 1 : count1 - 1; + else + edge = bestEdge + 1 < count1 ? bestEdge + 1 : 0; + + s = b2EdgeSeparation(poly1, xf1, edge, poly2, xf2); + + if (s > bestSeparation) + { + bestEdge = edge; + bestSeparation = s; + } + else + { + break; + } + } + + *edgeIndex = bestEdge; + return bestSeparation; +} + +static void b2FindIncidentEdge(b2ClipVertex c[2], + const b2PolygonShape* poly1, const b2Transform& xf1, int32 edge1, + const b2PolygonShape* poly2, const b2Transform& xf2) +{ + const b2Vec2* normals1 = poly1->m_normals; + + int32 count2 = poly2->m_vertexCount; + const b2Vec2* vertices2 = poly2->m_vertices; + const b2Vec2* normals2 = poly2->m_normals; + + b2Assert(0 <= edge1 && edge1 < poly1->m_vertexCount); + + // Get the normal of the reference edge in poly2's frame. + b2Vec2 normal1 = b2MulT(xf2.q, b2Mul(xf1.q, normals1[edge1])); + + // Find the incident edge on poly2. + int32 index = 0; + float32 minDot = b2_maxFloat; + for (int32 i = 0; i < count2; ++i) + { + float32 dot = b2Dot(normal1, normals2[i]); + if (dot < minDot) + { + minDot = dot; + index = i; + } + } + + // Build the clip vertices for the incident edge. + int32 i1 = index; + int32 i2 = i1 + 1 < count2 ? i1 + 1 : 0; + + c[0].v = b2Mul(xf2, vertices2[i1]); + c[0].id.cf.indexA = (uint8)edge1; + c[0].id.cf.indexB = (uint8)i1; + c[0].id.cf.typeA = b2ContactFeature::e_face; + c[0].id.cf.typeB = b2ContactFeature::e_vertex; + + c[1].v = b2Mul(xf2, vertices2[i2]); + c[1].id.cf.indexA = (uint8)edge1; + c[1].id.cf.indexB = (uint8)i2; + c[1].id.cf.typeA = b2ContactFeature::e_face; + c[1].id.cf.typeB = b2ContactFeature::e_vertex; +} + +// Find edge normal of max separation on A - return if separating axis is found +// Find edge normal of max separation on B - return if separation axis is found +// Choose reference edge as min(minA, minB) +// Find incident edge +// Clip + +// The normal points from 1 to 2 +void b2CollidePolygons(b2Manifold* manifold, + const b2PolygonShape* polyA, const b2Transform& xfA, + const b2PolygonShape* polyB, const b2Transform& xfB) +{ + manifold->pointCount = 0; + float32 totalRadius = polyA->m_radius + polyB->m_radius; + + int32 edgeA = 0; + float32 separationA = b2FindMaxSeparation(&edgeA, polyA, xfA, polyB, xfB); + if (separationA > totalRadius) + return; + + int32 edgeB = 0; + float32 separationB = b2FindMaxSeparation(&edgeB, polyB, xfB, polyA, xfA); + if (separationB > totalRadius) + return; + + const b2PolygonShape* poly1; // reference polygon + const b2PolygonShape* poly2; // incident polygon + b2Transform xf1, xf2; + int32 edge1; // reference edge + uint8 flip; + const float32 k_relativeTol = 0.98f; + const float32 k_absoluteTol = 0.001f; + + if (separationB > k_relativeTol * separationA + k_absoluteTol) + { + poly1 = polyB; + poly2 = polyA; + xf1 = xfB; + xf2 = xfA; + edge1 = edgeB; + manifold->type = b2Manifold::e_faceB; + flip = 1; + } + else + { + poly1 = polyA; + poly2 = polyB; + xf1 = xfA; + xf2 = xfB; + edge1 = edgeA; + manifold->type = b2Manifold::e_faceA; + flip = 0; + } + + b2ClipVertex incidentEdge[2]; + b2FindIncidentEdge(incidentEdge, poly1, xf1, edge1, poly2, xf2); + + int32 count1 = poly1->m_vertexCount; + const b2Vec2* vertices1 = poly1->m_vertices; + + int32 iv1 = edge1; + int32 iv2 = edge1 + 1 < count1 ? edge1 + 1 : 0; + + b2Vec2 v11 = vertices1[iv1]; + b2Vec2 v12 = vertices1[iv2]; + + b2Vec2 localTangent = v12 - v11; + localTangent.Normalize(); + + b2Vec2 localNormal = b2Cross(localTangent, 1.0f); + b2Vec2 planePoint = 0.5f * (v11 + v12); + + b2Vec2 tangent = b2Mul(xf1.q, localTangent); + b2Vec2 normal = b2Cross(tangent, 1.0f); + + v11 = b2Mul(xf1, v11); + v12 = b2Mul(xf1, v12); + + // Face offset. + float32 frontOffset = b2Dot(normal, v11); + + // Side offsets, extended by polytope skin thickness. + float32 sideOffset1 = -b2Dot(tangent, v11) + totalRadius; + float32 sideOffset2 = b2Dot(tangent, v12) + totalRadius; + + // Clip incident edge against extruded edge1 side edges. + b2ClipVertex clipPoints1[2]; + b2ClipVertex clipPoints2[2]; + int np; + + // Clip to box side 1 + np = b2ClipSegmentToLine(clipPoints1, incidentEdge, -tangent, sideOffset1, iv1); + + if (np < 2) + return; + + // Clip to negative box side 1 + np = b2ClipSegmentToLine(clipPoints2, clipPoints1, tangent, sideOffset2, iv2); + + if (np < 2) + { + return; + } + + // Now clipPoints2 contains the clipped points. + manifold->localNormal = localNormal; + manifold->localPoint = planePoint; + + int32 pointCount = 0; + for (int32 i = 0; i < b2_maxManifoldPoints; ++i) + { + float32 separation = b2Dot(normal, clipPoints2[i].v) - frontOffset; + + if (separation <= totalRadius) + { + b2ManifoldPoint* cp = manifold->points + pointCount; + cp->localPoint = b2MulT(xf2, clipPoints2[i].v); + cp->id = clipPoints2[i].id; + if (flip) + { + // Swap features + b2ContactFeature cf = cp->id.cf; + cp->id.cf.indexA = cf.indexB; + cp->id.cf.indexB = cf.indexA; + cp->id.cf.typeA = cf.typeB; + cp->id.cf.typeB = cf.typeA; + } + ++pointCount; + } + } + + manifold->pointCount = pointCount; +} diff --git a/external/box2d/Collision/b2Collision.cpp b/external/box2d/Collision/b2Collision.cpp new file mode 100644 index 0000000000..2dd5ff0ab6 --- /dev/null +++ b/external/box2d/Collision/b2Collision.cpp @@ -0,0 +1,249 @@ +/* +* Copyright (c) 2007-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include + +void b2WorldManifold::Initialize(const b2Manifold* manifold, + const b2Transform& xfA, float32 radiusA, + const b2Transform& xfB, float32 radiusB) +{ + if (manifold->pointCount == 0) + { + return; + } + + switch (manifold->type) + { + case b2Manifold::e_circles: + { + normal.Set(1.0f, 0.0f); + b2Vec2 pointA = b2Mul(xfA, manifold->localPoint); + b2Vec2 pointB = b2Mul(xfB, manifold->points[0].localPoint); + if (b2DistanceSquared(pointA, pointB) > b2_epsilon * b2_epsilon) + { + normal = pointB - pointA; + normal.Normalize(); + } + + b2Vec2 cA = pointA + radiusA * normal; + b2Vec2 cB = pointB - radiusB * normal; + points[0] = 0.5f * (cA + cB); + } + break; + + case b2Manifold::e_faceA: + { + normal = b2Mul(xfA.q, manifold->localNormal); + b2Vec2 planePoint = b2Mul(xfA, manifold->localPoint); + + for (int32 i = 0; i < manifold->pointCount; ++i) + { + b2Vec2 clipPoint = b2Mul(xfB, manifold->points[i].localPoint); + b2Vec2 cA = clipPoint + (radiusA - b2Dot(clipPoint - planePoint, normal)) * normal; + b2Vec2 cB = clipPoint - radiusB * normal; + points[i] = 0.5f * (cA + cB); + } + } + break; + + case b2Manifold::e_faceB: + { + normal = b2Mul(xfB.q, manifold->localNormal); + b2Vec2 planePoint = b2Mul(xfB, manifold->localPoint); + + for (int32 i = 0; i < manifold->pointCount; ++i) + { + b2Vec2 clipPoint = b2Mul(xfA, manifold->points[i].localPoint); + b2Vec2 cB = clipPoint + (radiusB - b2Dot(clipPoint - planePoint, normal)) * normal; + b2Vec2 cA = clipPoint - radiusA * normal; + points[i] = 0.5f * (cA + cB); + } + + // Ensure normal points from A to B. + normal = -normal; + } + break; + } +} + +void b2GetPointStates(b2PointState state1[b2_maxManifoldPoints], b2PointState state2[b2_maxManifoldPoints], + const b2Manifold* manifold1, const b2Manifold* manifold2) +{ + for (int32 i = 0; i < b2_maxManifoldPoints; ++i) + { + state1[i] = b2_nullState; + state2[i] = b2_nullState; + } + + // Detect persists and removes. + for (int32 i = 0; i < manifold1->pointCount; ++i) + { + b2ContactID id = manifold1->points[i].id; + + state1[i] = b2_removeState; + + for (int32 j = 0; j < manifold2->pointCount; ++j) + { + if (manifold2->points[j].id.key == id.key) + { + state1[i] = b2_persistState; + break; + } + } + } + + // Detect persists and adds. + for (int32 i = 0; i < manifold2->pointCount; ++i) + { + b2ContactID id = manifold2->points[i].id; + + state2[i] = b2_addState; + + for (int32 j = 0; j < manifold1->pointCount; ++j) + { + if (manifold1->points[j].id.key == id.key) + { + state2[i] = b2_persistState; + break; + } + } + } +} + +// From Real-time Collision Detection, p179. +bool b2AABB::RayCast(b2RayCastOutput* output, const b2RayCastInput& input) const +{ + float32 tmin = -b2_maxFloat; + float32 tmax = b2_maxFloat; + + b2Vec2 p = input.p1; + b2Vec2 d = input.p2 - input.p1; + b2Vec2 absD = b2Abs(d); + + b2Vec2 normal; + + for (int32 i = 0; i < 2; ++i) + { + if (absD(i) < b2_epsilon) + { + // Parallel. + if (p(i) < lowerBound(i) || upperBound(i) < p(i)) + { + return false; + } + } + else + { + float32 inv_d = 1.0f / d(i); + float32 t1 = (lowerBound(i) - p(i)) * inv_d; + float32 t2 = (upperBound(i) - p(i)) * inv_d; + + // Sign of the normal vector. + float32 s = -1.0f; + + if (t1 > t2) + { + b2Swap(t1, t2); + s = 1.0f; + } + + // Push the min up + if (t1 > tmin) + { + normal.SetZero(); + normal(i) = s; + tmin = t1; + } + + // Pull the max down + tmax = b2Min(tmax, t2); + + if (tmin > tmax) + { + return false; + } + } + } + + // Does the ray start inside the box? + // Does the ray intersect beyond the max fraction? + if (tmin < 0.0f || input.maxFraction < tmin) + { + return false; + } + + // Intersection. + output->fraction = tmin; + output->normal = normal; + return true; +} + +// Sutherland-Hodgman clipping. +int32 b2ClipSegmentToLine(b2ClipVertex vOut[2], const b2ClipVertex vIn[2], + const b2Vec2& normal, float32 offset, int32 vertexIndexA) +{ + // Start with no output points + int32 numOut = 0; + + // Calculate the distance of end points to the line + float32 distance0 = b2Dot(normal, vIn[0].v) - offset; + float32 distance1 = b2Dot(normal, vIn[1].v) - offset; + + // If the points are behind the plane + if (distance0 <= 0.0f) vOut[numOut++] = vIn[0]; + if (distance1 <= 0.0f) vOut[numOut++] = vIn[1]; + + // If the points are on different sides of the plane + if (distance0 * distance1 < 0.0f) + { + // Find intersection point of edge and plane + float32 interp = distance0 / (distance0 - distance1); + vOut[numOut].v = vIn[0].v + interp * (vIn[1].v - vIn[0].v); + + // VertexA is hitting edgeB. + vOut[numOut].id.cf.indexA = vertexIndexA; + vOut[numOut].id.cf.indexB = vIn[0].id.cf.indexB; + vOut[numOut].id.cf.typeA = b2ContactFeature::e_vertex; + vOut[numOut].id.cf.typeB = b2ContactFeature::e_face; + ++numOut; + } + + return numOut; +} + +bool b2TestOverlap( const b2Shape* shapeA, int32 indexA, + const b2Shape* shapeB, int32 indexB, + const b2Transform& xfA, const b2Transform& xfB) +{ + b2DistanceInput input; + input.proxyA.Set(shapeA, indexA); + input.proxyB.Set(shapeB, indexB); + input.transformA = xfA; + input.transformB = xfB; + input.useRadii = true; + + b2SimplexCache cache; + cache.count = 0; + + b2DistanceOutput output; + + b2Distance(&output, &cache, &input); + + return output.distance < 10.0f * b2_epsilon; +} diff --git a/external/box2d/Collision/b2Collision.h b/external/box2d/Collision/b2Collision.h new file mode 100644 index 0000000000..2e7386232b --- /dev/null +++ b/external/box2d/Collision/b2Collision.h @@ -0,0 +1,276 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_COLLISION_H +#define B2_COLLISION_H + +#include +#include + +/// @file +/// Structures and functions used for computing contact points, distance +/// queries, and TOI queries. + +class b2Shape; +class b2CircleShape; +class b2EdgeShape; +class b2PolygonShape; + +const uint8 b2_nullFeature = UCHAR_MAX; + +/// The features that intersect to form the contact point +/// This must be 4 bytes or less. +struct b2ContactFeature +{ + enum Type + { + e_vertex = 0, + e_face = 1 + }; + + uint8 indexA; ///< Feature index on shapeA + uint8 indexB; ///< Feature index on shapeB + uint8 typeA; ///< The feature type on shapeA + uint8 typeB; ///< The feature type on shapeB +}; + +/// Contact ids to facilitate warm starting. +union b2ContactID +{ + b2ContactFeature cf; + uint32 key; ///< Used to quickly compare contact ids. +}; + +/// A manifold point is a contact point belonging to a contact +/// manifold. It holds details related to the geometry and dynamics +/// of the contact points. +/// The local point usage depends on the manifold type: +/// -e_circles: the local center of circleB +/// -e_faceA: the local center of cirlceB or the clip point of polygonB +/// -e_faceB: the clip point of polygonA +/// This structure is stored across time steps, so we keep it small. +/// Note: the impulses are used for internal caching and may not +/// provide reliable contact forces, especially for high speed collisions. +struct b2ManifoldPoint +{ + b2Vec2 localPoint; ///< usage depends on manifold type + float32 normalImpulse; ///< the non-penetration impulse + float32 tangentImpulse; ///< the friction impulse + b2ContactID id; ///< uniquely identifies a contact point between two shapes +}; + +/// A manifold for two touching convex shapes. +/// Box2D supports multiple types of contact: +/// - clip point versus plane with radius +/// - point versus point with radius (circles) +/// The local point usage depends on the manifold type: +/// -e_circles: the local center of circleA +/// -e_faceA: the center of faceA +/// -e_faceB: the center of faceB +/// Similarly the local normal usage: +/// -e_circles: not used +/// -e_faceA: the normal on polygonA +/// -e_faceB: the normal on polygonB +/// We store contacts in this way so that position correction can +/// account for movement, which is critical for continuous physics. +/// All contact scenarios must be expressed in one of these types. +/// This structure is stored across time steps, so we keep it small. +struct b2Manifold +{ + enum Type + { + e_circles, + e_faceA, + e_faceB + }; + + b2ManifoldPoint points[b2_maxManifoldPoints]; ///< the points of contact + b2Vec2 localNormal; ///< not use for Type::e_points + b2Vec2 localPoint; ///< usage depends on manifold type + Type type; + int32 pointCount; ///< the number of manifold points +}; + +/// This is used to compute the current state of a contact manifold. +struct b2WorldManifold +{ + /// Evaluate the manifold with supplied transforms. This assumes + /// modest motion from the original state. This does not change the + /// point count, impulses, etc. The radii must come from the shapes + /// that generated the manifold. + void Initialize(const b2Manifold* manifold, + const b2Transform& xfA, float32 radiusA, + const b2Transform& xfB, float32 radiusB); + + b2Vec2 normal; ///< world vector pointing from A to B + b2Vec2 points[b2_maxManifoldPoints]; ///< world contact point (point of intersection) +}; + +/// This is used for determining the state of contact points. +enum b2PointState +{ + b2_nullState, ///< point does not exist + b2_addState, ///< point was added in the update + b2_persistState, ///< point persisted across the update + b2_removeState ///< point was removed in the update +}; + +/// Compute the point states given two manifolds. The states pertain to the transition from manifold1 +/// to manifold2. So state1 is either persist or remove while state2 is either add or persist. +void b2GetPointStates(b2PointState state1[b2_maxManifoldPoints], b2PointState state2[b2_maxManifoldPoints], + const b2Manifold* manifold1, const b2Manifold* manifold2); + +/// Used for computing contact manifolds. +struct b2ClipVertex +{ + b2Vec2 v; + b2ContactID id; +}; + +/// Ray-cast input data. The ray extends from p1 to p1 + maxFraction * (p2 - p1). +struct b2RayCastInput +{ + b2Vec2 p1, p2; + float32 maxFraction; +}; + +/// Ray-cast output data. The ray hits at p1 + fraction * (p2 - p1), where p1 and p2 +/// come from b2RayCastInput. +struct b2RayCastOutput +{ + b2Vec2 normal; + float32 fraction; +}; + +/// An axis aligned bounding box. +struct b2AABB +{ + /// Verify that the bounds are sorted. + bool IsValid() const; + + /// Get the center of the AABB. + b2Vec2 GetCenter() const + { + return 0.5f * (lowerBound + upperBound); + } + + /// Get the extents of the AABB (half-widths). + b2Vec2 GetExtents() const + { + return 0.5f * (upperBound - lowerBound); + } + + /// Get the perimeter length + float32 GetPerimeter() const + { + float32 wx = upperBound.x - lowerBound.x; + float32 wy = upperBound.y - lowerBound.y; + return 2.0f * (wx + wy); + } + + /// Combine an AABB into this one. + void Combine(const b2AABB& aabb) + { + lowerBound = b2Min(lowerBound, aabb.lowerBound); + upperBound = b2Max(upperBound, aabb.upperBound); + } + + /// Combine two AABBs into this one. + void Combine(const b2AABB& aabb1, const b2AABB& aabb2) + { + lowerBound = b2Min(aabb1.lowerBound, aabb2.lowerBound); + upperBound = b2Max(aabb1.upperBound, aabb2.upperBound); + } + + /// Does this aabb contain the provided AABB. + bool Contains(const b2AABB& aabb) const + { + bool result = true; + result = result && lowerBound.x <= aabb.lowerBound.x; + result = result && lowerBound.y <= aabb.lowerBound.y; + result = result && aabb.upperBound.x <= upperBound.x; + result = result && aabb.upperBound.y <= upperBound.y; + return result; + } + + bool RayCast(b2RayCastOutput* output, const b2RayCastInput& input) const; + + b2Vec2 lowerBound; ///< the lower vertex + b2Vec2 upperBound; ///< the upper vertex +}; + +/// Compute the collision manifold between two circles. +void b2CollideCircles(b2Manifold* manifold, + const b2CircleShape* circleA, const b2Transform& xfA, + const b2CircleShape* circleB, const b2Transform& xfB); + +/// Compute the collision manifold between a polygon and a circle. +void b2CollidePolygonAndCircle(b2Manifold* manifold, + const b2PolygonShape* polygonA, const b2Transform& xfA, + const b2CircleShape* circleB, const b2Transform& xfB); + +/// Compute the collision manifold between two polygons. +void b2CollidePolygons(b2Manifold* manifold, + const b2PolygonShape* polygonA, const b2Transform& xfA, + const b2PolygonShape* polygonB, const b2Transform& xfB); + +/// Compute the collision manifold between an edge and a circle. +void b2CollideEdgeAndCircle(b2Manifold* manifold, + const b2EdgeShape* polygonA, const b2Transform& xfA, + const b2CircleShape* circleB, const b2Transform& xfB); + +/// Compute the collision manifold between an edge and a circle. +void b2CollideEdgeAndPolygon(b2Manifold* manifold, + const b2EdgeShape* edgeA, const b2Transform& xfA, + const b2PolygonShape* circleB, const b2Transform& xfB); + +/// Clipping for contact manifolds. +int32 b2ClipSegmentToLine(b2ClipVertex vOut[2], const b2ClipVertex vIn[2], + const b2Vec2& normal, float32 offset, int32 vertexIndexA); + +/// Determine if two generic shapes overlap. +bool b2TestOverlap( const b2Shape* shapeA, int32 indexA, + const b2Shape* shapeB, int32 indexB, + const b2Transform& xfA, const b2Transform& xfB); + +// ---------------- Inline Functions ------------------------------------------ + +inline bool b2AABB::IsValid() const +{ + b2Vec2 d = upperBound - lowerBound; + bool valid = d.x >= 0.0f && d.y >= 0.0f; + valid = valid && lowerBound.IsValid() && upperBound.IsValid(); + return valid; +} + +inline bool b2TestOverlap(const b2AABB& a, const b2AABB& b) +{ + b2Vec2 d1, d2; + d1 = b.lowerBound - a.upperBound; + d2 = a.lowerBound - b.upperBound; + + if (d1.x > 0.0f || d1.y > 0.0f) + return false; + + if (d2.x > 0.0f || d2.y > 0.0f) + return false; + + return true; +} + +#endif diff --git a/external/box2d/Collision/b2Distance.cpp b/external/box2d/Collision/b2Distance.cpp new file mode 100644 index 0000000000..ac67d3be43 --- /dev/null +++ b/external/box2d/Collision/b2Distance.cpp @@ -0,0 +1,603 @@ +/* +* Copyright (c) 2007-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include +#include +#include + +// GJK using Voronoi regions (Christer Ericson) and Barycentric coordinates. +int32 b2_gjkCalls, b2_gjkIters, b2_gjkMaxIters; + +void b2DistanceProxy::Set(const b2Shape* shape, int32 index) +{ + switch (shape->GetType()) + { + case b2Shape::e_circle: + { + const b2CircleShape* circle = (b2CircleShape*)shape; + m_vertices = &circle->m_p; + m_count = 1; + m_radius = circle->m_radius; + } + break; + + case b2Shape::e_polygon: + { + const b2PolygonShape* polygon = (b2PolygonShape*)shape; + m_vertices = polygon->m_vertices; + m_count = polygon->m_vertexCount; + m_radius = polygon->m_radius; + } + break; + + case b2Shape::e_chain: + { + const b2ChainShape* chain = (b2ChainShape*)shape; + b2Assert(0 <= index && index < chain->m_count); + + m_buffer[0] = chain->m_vertices[index]; + if (index + 1 < chain->m_count) + { + m_buffer[1] = chain->m_vertices[index + 1]; + } + else + { + m_buffer[1] = chain->m_vertices[0]; + } + + m_vertices = m_buffer; + m_count = 2; + m_radius = chain->m_radius; + } + break; + + case b2Shape::e_edge: + { + const b2EdgeShape* edge = (b2EdgeShape*)shape; + m_vertices = &edge->m_vertex1; + m_count = 2; + m_radius = edge->m_radius; + } + break; + + default: + b2Assert(false); + } +} + + +struct b2SimplexVertex +{ + b2Vec2 wA; // support point in proxyA + b2Vec2 wB; // support point in proxyB + b2Vec2 w; // wB - wA + float32 a; // barycentric coordinate for closest point + int32 indexA; // wA index + int32 indexB; // wB index +}; + +struct b2Simplex +{ + void ReadCache( const b2SimplexCache* cache, + const b2DistanceProxy* proxyA, const b2Transform& transformA, + const b2DistanceProxy* proxyB, const b2Transform& transformB) + { + b2Assert(cache->count <= 3); + + // Copy data from cache. + m_count = cache->count; + b2SimplexVertex* vertices = &m_v1; + for (int32 i = 0; i < m_count; ++i) + { + b2SimplexVertex* v = vertices + i; + v->indexA = cache->indexA[i]; + v->indexB = cache->indexB[i]; + b2Vec2 wALocal = proxyA->GetVertex(v->indexA); + b2Vec2 wBLocal = proxyB->GetVertex(v->indexB); + v->wA = b2Mul(transformA, wALocal); + v->wB = b2Mul(transformB, wBLocal); + v->w = v->wB - v->wA; + v->a = 0.0f; + } + + // Compute the new simplex metric, if it is substantially different than + // old metric then flush the simplex. + if (m_count > 1) + { + float32 metric1 = cache->metric; + float32 metric2 = GetMetric(); + if (metric2 < 0.5f * metric1 || 2.0f * metric1 < metric2 || metric2 < b2_epsilon) + { + // Reset the simplex. + m_count = 0; + } + } + + // If the cache is empty or invalid ... + if (m_count == 0) + { + b2SimplexVertex* v = vertices + 0; + v->indexA = 0; + v->indexB = 0; + b2Vec2 wALocal = proxyA->GetVertex(0); + b2Vec2 wBLocal = proxyB->GetVertex(0); + v->wA = b2Mul(transformA, wALocal); + v->wB = b2Mul(transformB, wBLocal); + v->w = v->wB - v->wA; + m_count = 1; + } + } + + void WriteCache(b2SimplexCache* cache) const + { + cache->metric = GetMetric(); + cache->count = uint16(m_count); + const b2SimplexVertex* vertices = &m_v1; + for (int32 i = 0; i < m_count; ++i) + { + cache->indexA[i] = uint8(vertices[i].indexA); + cache->indexB[i] = uint8(vertices[i].indexB); + } + } + + b2Vec2 GetSearchDirection() const + { + switch (m_count) + { + case 1: + return -m_v1.w; + + case 2: + { + b2Vec2 e12 = m_v2.w - m_v1.w; + float32 sgn = b2Cross(e12, -m_v1.w); + if (sgn > 0.0f) + { + // Origin is left of e12. + return b2Cross(1.0f, e12); + } + else + { + // Origin is right of e12. + return b2Cross(e12, 1.0f); + } + } + + default: + b2Assert(false); + return b2Vec2_zero; + } + } + + b2Vec2 GetClosestPoint() const + { + switch (m_count) + { + case 0: + b2Assert(false); + return b2Vec2_zero; + + case 1: + return m_v1.w; + + case 2: + return m_v1.a * m_v1.w + m_v2.a * m_v2.w; + + case 3: + return b2Vec2_zero; + + default: + b2Assert(false); + return b2Vec2_zero; + } + } + + void GetWitnessPoints(b2Vec2* pA, b2Vec2* pB) const + { + switch (m_count) + { + case 0: + b2Assert(false); + break; + + case 1: + *pA = m_v1.wA; + *pB = m_v1.wB; + break; + + case 2: + *pA = m_v1.a * m_v1.wA + m_v2.a * m_v2.wA; + *pB = m_v1.a * m_v1.wB + m_v2.a * m_v2.wB; + break; + + case 3: + *pA = m_v1.a * m_v1.wA + m_v2.a * m_v2.wA + m_v3.a * m_v3.wA; + *pB = *pA; + break; + + default: + b2Assert(false); + break; + } + } + + float32 GetMetric() const + { + switch (m_count) + { + case 0: + b2Assert(false); + return 0.0; + + case 1: + return 0.0f; + + case 2: + return b2Distance(m_v1.w, m_v2.w); + + case 3: + return b2Cross(m_v2.w - m_v1.w, m_v3.w - m_v1.w); + + default: + b2Assert(false); + return 0.0f; + } + } + + void Solve2(); + void Solve3(); + + b2SimplexVertex m_v1, m_v2, m_v3; + int32 m_count; +}; + + +// Solve a line segment using barycentric coordinates. +// +// p = a1 * w1 + a2 * w2 +// a1 + a2 = 1 +// +// The vector from the origin to the closest point on the line is +// perpendicular to the line. +// e12 = w2 - w1 +// dot(p, e) = 0 +// a1 * dot(w1, e) + a2 * dot(w2, e) = 0 +// +// 2-by-2 linear system +// [1 1 ][a1] = [1] +// [w1.e12 w2.e12][a2] = [0] +// +// Define +// d12_1 = dot(w2, e12) +// d12_2 = -dot(w1, e12) +// d12 = d12_1 + d12_2 +// +// Solution +// a1 = d12_1 / d12 +// a2 = d12_2 / d12 +void b2Simplex::Solve2() +{ + b2Vec2 w1 = m_v1.w; + b2Vec2 w2 = m_v2.w; + b2Vec2 e12 = w2 - w1; + + // w1 region + float32 d12_2 = -b2Dot(w1, e12); + if (d12_2 <= 0.0f) + { + // a2 <= 0, so we clamp it to 0 + m_v1.a = 1.0f; + m_count = 1; + return; + } + + // w2 region + float32 d12_1 = b2Dot(w2, e12); + if (d12_1 <= 0.0f) + { + // a1 <= 0, so we clamp it to 0 + m_v2.a = 1.0f; + m_count = 1; + m_v1 = m_v2; + return; + } + + // Must be in e12 region. + float32 inv_d12 = 1.0f / (d12_1 + d12_2); + m_v1.a = d12_1 * inv_d12; + m_v2.a = d12_2 * inv_d12; + m_count = 2; +} + +// Possible regions: +// - points[2] +// - edge points[0]-points[2] +// - edge points[1]-points[2] +// - inside the triangle +void b2Simplex::Solve3() +{ + b2Vec2 w1 = m_v1.w; + b2Vec2 w2 = m_v2.w; + b2Vec2 w3 = m_v3.w; + + // Edge12 + // [1 1 ][a1] = [1] + // [w1.e12 w2.e12][a2] = [0] + // a3 = 0 + b2Vec2 e12 = w2 - w1; + float32 w1e12 = b2Dot(w1, e12); + float32 w2e12 = b2Dot(w2, e12); + float32 d12_1 = w2e12; + float32 d12_2 = -w1e12; + + // Edge13 + // [1 1 ][a1] = [1] + // [w1.e13 w3.e13][a3] = [0] + // a2 = 0 + b2Vec2 e13 = w3 - w1; + float32 w1e13 = b2Dot(w1, e13); + float32 w3e13 = b2Dot(w3, e13); + float32 d13_1 = w3e13; + float32 d13_2 = -w1e13; + + // Edge23 + // [1 1 ][a2] = [1] + // [w2.e23 w3.e23][a3] = [0] + // a1 = 0 + b2Vec2 e23 = w3 - w2; + float32 w2e23 = b2Dot(w2, e23); + float32 w3e23 = b2Dot(w3, e23); + float32 d23_1 = w3e23; + float32 d23_2 = -w2e23; + + // Triangle123 + float32 n123 = b2Cross(e12, e13); + + float32 d123_1 = n123 * b2Cross(w2, w3); + float32 d123_2 = n123 * b2Cross(w3, w1); + float32 d123_3 = n123 * b2Cross(w1, w2); + + // w1 region + if (d12_2 <= 0.0f && d13_2 <= 0.0f) + { + m_v1.a = 1.0f; + m_count = 1; + return; + } + + // e12 + if (d12_1 > 0.0f && d12_2 > 0.0f && d123_3 <= 0.0f) + { + float32 inv_d12 = 1.0f / (d12_1 + d12_2); + m_v1.a = d12_1 * inv_d12; + m_v2.a = d12_2 * inv_d12; + m_count = 2; + return; + } + + // e13 + if (d13_1 > 0.0f && d13_2 > 0.0f && d123_2 <= 0.0f) + { + float32 inv_d13 = 1.0f / (d13_1 + d13_2); + m_v1.a = d13_1 * inv_d13; + m_v3.a = d13_2 * inv_d13; + m_count = 2; + m_v2 = m_v3; + return; + } + + // w2 region + if (d12_1 <= 0.0f && d23_2 <= 0.0f) + { + m_v2.a = 1.0f; + m_count = 1; + m_v1 = m_v2; + return; + } + + // w3 region + if (d13_1 <= 0.0f && d23_1 <= 0.0f) + { + m_v3.a = 1.0f; + m_count = 1; + m_v1 = m_v3; + return; + } + + // e23 + if (d23_1 > 0.0f && d23_2 > 0.0f && d123_1 <= 0.0f) + { + float32 inv_d23 = 1.0f / (d23_1 + d23_2); + m_v2.a = d23_1 * inv_d23; + m_v3.a = d23_2 * inv_d23; + m_count = 2; + m_v1 = m_v3; + return; + } + + // Must be in triangle123 + float32 inv_d123 = 1.0f / (d123_1 + d123_2 + d123_3); + m_v1.a = d123_1 * inv_d123; + m_v2.a = d123_2 * inv_d123; + m_v3.a = d123_3 * inv_d123; + m_count = 3; +} + +void b2Distance(b2DistanceOutput* output, + b2SimplexCache* cache, + const b2DistanceInput* input) +{ + ++b2_gjkCalls; + + const b2DistanceProxy* proxyA = &input->proxyA; + const b2DistanceProxy* proxyB = &input->proxyB; + + b2Transform transformA = input->transformA; + b2Transform transformB = input->transformB; + + // Initialize the simplex. + b2Simplex simplex; + simplex.ReadCache(cache, proxyA, transformA, proxyB, transformB); + + // Get simplex vertices as an array. + b2SimplexVertex* vertices = &simplex.m_v1; + const int32 k_maxIters = 20; + + // These store the vertices of the last simplex so that we + // can check for duplicates and prevent cycling. + int32 saveA[3], saveB[3]; + int32 saveCount = 0; + + b2Vec2 closestPoint = simplex.GetClosestPoint(); + float32 distanceSqr1 = closestPoint.LengthSquared(); + float32 distanceSqr2 = distanceSqr1; + + // Main iteration loop. + int32 iter = 0; + while (iter < k_maxIters) + { + // Copy simplex so we can identify duplicates. + saveCount = simplex.m_count; + for (int32 i = 0; i < saveCount; ++i) + { + saveA[i] = vertices[i].indexA; + saveB[i] = vertices[i].indexB; + } + + switch (simplex.m_count) + { + case 1: + break; + + case 2: + simplex.Solve2(); + break; + + case 3: + simplex.Solve3(); + break; + + default: + b2Assert(false); + } + + // If we have 3 points, then the origin is in the corresponding triangle. + if (simplex.m_count == 3) + { + break; + } + + // Compute closest point. + b2Vec2 p = simplex.GetClosestPoint(); + distanceSqr2 = p.LengthSquared(); + + // Ensure progress + if (distanceSqr2 >= distanceSqr1) + { + //break; + } + distanceSqr1 = distanceSqr2; + + // Get search direction. + b2Vec2 d = simplex.GetSearchDirection(); + + // Ensure the search direction is numerically fit. + if (d.LengthSquared() < b2_epsilon * b2_epsilon) + { + // The origin is probably contained by a line segment + // or triangle. Thus the shapes are overlapped. + + // We can't return zero here even though there may be overlap. + // In case the simplex is a point, segment, or triangle it is difficult + // to determine if the origin is contained in the CSO or very close to it. + break; + } + + // Compute a tentative new simplex vertex using support points. + b2SimplexVertex* vertex = vertices + simplex.m_count; + vertex->indexA = proxyA->GetSupport(b2MulT(transformA.q, -d)); + vertex->wA = b2Mul(transformA, proxyA->GetVertex(vertex->indexA)); + b2Vec2 wBLocal; + vertex->indexB = proxyB->GetSupport(b2MulT(transformB.q, d)); + vertex->wB = b2Mul(transformB, proxyB->GetVertex(vertex->indexB)); + vertex->w = vertex->wB - vertex->wA; + + // Iteration count is equated to the number of support point calls. + ++iter; + ++b2_gjkIters; + + // Check for duplicate support points. This is the main termination criteria. + bool duplicate = false; + for (int32 i = 0; i < saveCount; ++i) + { + if (vertex->indexA == saveA[i] && vertex->indexB == saveB[i]) + { + duplicate = true; + break; + } + } + + // If we found a duplicate support point we must exit to avoid cycling. + if (duplicate) + { + break; + } + + // New vertex is ok and needed. + ++simplex.m_count; + } + + b2_gjkMaxIters = b2Max(b2_gjkMaxIters, iter); + + // Prepare output. + simplex.GetWitnessPoints(&output->pointA, &output->pointB); + output->distance = b2Distance(output->pointA, output->pointB); + output->iterations = iter; + + // Cache the simplex. + simplex.WriteCache(cache); + + // Apply radii if requested. + if (input->useRadii) + { + float32 rA = proxyA->m_radius; + float32 rB = proxyB->m_radius; + + if (output->distance > rA + rB && output->distance > b2_epsilon) + { + // Shapes are still no overlapped. + // Move the witness points to the outer surface. + output->distance -= rA + rB; + b2Vec2 normal = output->pointB - output->pointA; + normal.Normalize(); + output->pointA += rA * normal; + output->pointB -= rB * normal; + } + else + { + // Shapes are overlapped when radii are considered. + // Move the witness points to the middle. + b2Vec2 p = 0.5f * (output->pointA + output->pointB); + output->pointA = p; + output->pointB = p; + output->distance = 0.0f; + } + } +} diff --git a/external/box2d/Collision/b2Distance.h b/external/box2d/Collision/b2Distance.h new file mode 100644 index 0000000000..d598b7339d --- /dev/null +++ b/external/box2d/Collision/b2Distance.h @@ -0,0 +1,141 @@ + +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_DISTANCE_H +#define B2_DISTANCE_H + +#include + +class b2Shape; + +/// A distance proxy is used by the GJK algorithm. +/// It encapsulates any shape. +struct b2DistanceProxy +{ + b2DistanceProxy() : m_vertices(NULL), m_count(0), m_radius(0.0f) {} + + /// Initialize the proxy using the given shape. The shape + /// must remain in scope while the proxy is in use. + void Set(const b2Shape* shape, int32 index); + + /// Get the supporting vertex index in the given direction. + int32 GetSupport(const b2Vec2& d) const; + + /// Get the supporting vertex in the given direction. + const b2Vec2& GetSupportVertex(const b2Vec2& d) const; + + /// Get the vertex count. + int32 GetVertexCount() const; + + /// Get a vertex by index. Used by b2Distance. + const b2Vec2& GetVertex(int32 index) const; + + b2Vec2 m_buffer[2]; + const b2Vec2* m_vertices; + int32 m_count; + float32 m_radius; +}; + +/// Used to warm start b2Distance. +/// Set count to zero on first call. +struct b2SimplexCache +{ + float32 metric; ///< length or area + uint16 count; + uint8 indexA[3]; ///< vertices on shape A + uint8 indexB[3]; ///< vertices on shape B +}; + +/// Input for b2Distance. +/// You have to option to use the shape radii +/// in the computation. Even +struct b2DistanceInput +{ + b2DistanceProxy proxyA; + b2DistanceProxy proxyB; + b2Transform transformA; + b2Transform transformB; + bool useRadii; +}; + +/// Output for b2Distance. +struct b2DistanceOutput +{ + b2Vec2 pointA; ///< closest point on shapeA + b2Vec2 pointB; ///< closest point on shapeB + float32 distance; + int32 iterations; ///< number of GJK iterations used +}; + +/// Compute the closest points between two shapes. Supports any combination of: +/// b2CircleShape, b2PolygonShape, b2EdgeShape. The simplex cache is input/output. +/// On the first call set b2SimplexCache.count to zero. +void b2Distance(b2DistanceOutput* output, + b2SimplexCache* cache, + const b2DistanceInput* input); + + +////////////////////////////////////////////////////////////////////////// + +inline int32 b2DistanceProxy::GetVertexCount() const +{ + return m_count; +} + +inline const b2Vec2& b2DistanceProxy::GetVertex(int32 index) const +{ + b2Assert(0 <= index && index < m_count); + return m_vertices[index]; +} + +inline int32 b2DistanceProxy::GetSupport(const b2Vec2& d) const +{ + int32 bestIndex = 0; + float32 bestValue = b2Dot(m_vertices[0], d); + for (int32 i = 1; i < m_count; ++i) + { + float32 value = b2Dot(m_vertices[i], d); + if (value > bestValue) + { + bestIndex = i; + bestValue = value; + } + } + + return bestIndex; +} + +inline const b2Vec2& b2DistanceProxy::GetSupportVertex(const b2Vec2& d) const +{ + int32 bestIndex = 0; + float32 bestValue = b2Dot(m_vertices[0], d); + for (int32 i = 1; i < m_count; ++i) + { + float32 value = b2Dot(m_vertices[i], d); + if (value > bestValue) + { + bestIndex = i; + bestValue = value; + } + } + + return m_vertices[bestIndex]; +} + +#endif diff --git a/external/box2d/Collision/b2DynamicTree.cpp b/external/box2d/Collision/b2DynamicTree.cpp new file mode 100644 index 0000000000..d1d53297e2 --- /dev/null +++ b/external/box2d/Collision/b2DynamicTree.cpp @@ -0,0 +1,775 @@ +/* +* Copyright (c) 2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#ifndef SHP +#include +#else +#include +#endif +using namespace std; + + +b2DynamicTree::b2DynamicTree() +{ + m_root = b2_nullNode; + + m_nodeCapacity = 16; + m_nodeCount = 0; + m_nodes = (b2TreeNode*)b2Alloc(m_nodeCapacity * sizeof(b2TreeNode)); + memset(m_nodes, 0, m_nodeCapacity * sizeof(b2TreeNode)); + + // Build a linked list for the free list. + for (int32 i = 0; i < m_nodeCapacity - 1; ++i) + { + m_nodes[i].next = i + 1; + m_nodes[i].height = -1; + } + m_nodes[m_nodeCapacity-1].next = b2_nullNode; + m_nodes[m_nodeCapacity-1].height = -1; + m_freeList = 0; + + m_path = 0; + + m_insertionCount = 0; +} + +b2DynamicTree::~b2DynamicTree() +{ + // This frees the entire tree in one shot. + b2Free(m_nodes); +} + +// Allocate a node from the pool. Grow the pool if necessary. +int32 b2DynamicTree::AllocateNode() +{ + // Expand the node pool as needed. + if (m_freeList == b2_nullNode) + { + b2Assert(m_nodeCount == m_nodeCapacity); + + // The free list is empty. Rebuild a bigger pool. + b2TreeNode* oldNodes = m_nodes; + m_nodeCapacity *= 2; + m_nodes = (b2TreeNode*)b2Alloc(m_nodeCapacity * sizeof(b2TreeNode)); + memcpy(m_nodes, oldNodes, m_nodeCount * sizeof(b2TreeNode)); + b2Free(oldNodes); + + // Build a linked list for the free list. The parent + // pointer becomes the "next" pointer. + for (int32 i = m_nodeCount; i < m_nodeCapacity - 1; ++i) + { + m_nodes[i].next = i + 1; + m_nodes[i].height = -1; + } + m_nodes[m_nodeCapacity-1].next = b2_nullNode; + m_nodes[m_nodeCapacity-1].height = -1; + m_freeList = m_nodeCount; + } + + // Peel a node off the free list. + int32 nodeId = m_freeList; + m_freeList = m_nodes[nodeId].next; + m_nodes[nodeId].parent = b2_nullNode; + m_nodes[nodeId].child1 = b2_nullNode; + m_nodes[nodeId].child2 = b2_nullNode; + m_nodes[nodeId].height = 0; + m_nodes[nodeId].userData = NULL; + ++m_nodeCount; + return nodeId; +} + +// Return a node to the pool. +void b2DynamicTree::FreeNode(int32 nodeId) +{ + b2Assert(0 <= nodeId && nodeId < m_nodeCapacity); + b2Assert(0 < m_nodeCount); + m_nodes[nodeId].next = m_freeList; + m_nodes[nodeId].height = -1; + m_freeList = nodeId; + --m_nodeCount; +} + +// Create a proxy in the tree as a leaf node. We return the index +// of the node instead of a pointer so that we can grow +// the node pool. +int32 b2DynamicTree::CreateProxy(const b2AABB& aabb, void* userData) +{ + int32 proxyId = AllocateNode(); + + // Fatten the aabb. + b2Vec2 r(b2_aabbExtension, b2_aabbExtension); + m_nodes[proxyId].aabb.lowerBound = aabb.lowerBound - r; + m_nodes[proxyId].aabb.upperBound = aabb.upperBound + r; + m_nodes[proxyId].userData = userData; + m_nodes[proxyId].height = 0; + + InsertLeaf(proxyId); + + return proxyId; +} + +void b2DynamicTree::DestroyProxy(int32 proxyId) +{ + b2Assert(0 <= proxyId && proxyId < m_nodeCapacity); + b2Assert(m_nodes[proxyId].IsLeaf()); + + RemoveLeaf(proxyId); + FreeNode(proxyId); +} + +bool b2DynamicTree::MoveProxy(int32 proxyId, const b2AABB& aabb, const b2Vec2& displacement) +{ + b2Assert(0 <= proxyId && proxyId < m_nodeCapacity); + + b2Assert(m_nodes[proxyId].IsLeaf()); + + if (m_nodes[proxyId].aabb.Contains(aabb)) + { + return false; + } + + RemoveLeaf(proxyId); + + // Extend AABB. + b2AABB b = aabb; + b2Vec2 r(b2_aabbExtension, b2_aabbExtension); + b.lowerBound = b.lowerBound - r; + b.upperBound = b.upperBound + r; + + // Predict AABB displacement. + b2Vec2 d = b2_aabbMultiplier * displacement; + + if (d.x < 0.0f) + { + b.lowerBound.x += d.x; + } + else + { + b.upperBound.x += d.x; + } + + if (d.y < 0.0f) + { + b.lowerBound.y += d.y; + } + else + { + b.upperBound.y += d.y; + } + + m_nodes[proxyId].aabb = b; + + InsertLeaf(proxyId); + return true; +} + +void b2DynamicTree::InsertLeaf(int32 leaf) +{ + ++m_insertionCount; + + if (m_root == b2_nullNode) + { + m_root = leaf; + m_nodes[m_root].parent = b2_nullNode; + return; + } + + // Find the best sibling for this node + b2AABB leafAABB = m_nodes[leaf].aabb; + int32 index = m_root; + while (m_nodes[index].IsLeaf() == false) + { + int32 child1 = m_nodes[index].child1; + int32 child2 = m_nodes[index].child2; + + float32 area = m_nodes[index].aabb.GetPerimeter(); + + b2AABB combinedAABB; + combinedAABB.Combine(m_nodes[index].aabb, leafAABB); + float32 combinedArea = combinedAABB.GetPerimeter(); + + // Cost of creating a new parent for this node and the new leaf + float32 cost = 2.0f * combinedArea; + + // Minimum cost of pushing the leaf further down the tree + float32 inheritanceCost = 2.0f * (combinedArea - area); + + // Cost of descending into child1 + float32 cost1; + if (m_nodes[child1].IsLeaf()) + { + b2AABB aabb; + aabb.Combine(leafAABB, m_nodes[child1].aabb); + cost1 = aabb.GetPerimeter() + inheritanceCost; + } + else + { + b2AABB aabb; + aabb.Combine(leafAABB, m_nodes[child1].aabb); + float32 oldArea = m_nodes[child1].aabb.GetPerimeter(); + float32 newArea = aabb.GetPerimeter(); + cost1 = (newArea - oldArea) + inheritanceCost; + } + + // Cost of descending into child2 + float32 cost2; + if (m_nodes[child2].IsLeaf()) + { + b2AABB aabb; + aabb.Combine(leafAABB, m_nodes[child2].aabb); + cost2 = aabb.GetPerimeter() + inheritanceCost; + } + else + { + b2AABB aabb; + aabb.Combine(leafAABB, m_nodes[child2].aabb); + float32 oldArea = m_nodes[child2].aabb.GetPerimeter(); + float32 newArea = aabb.GetPerimeter(); + cost2 = newArea - oldArea + inheritanceCost; + } + + // Descend according to the minimum cost. + if (cost < cost1 && cost < cost2) + { + break; + } + + // Descend + if (cost1 < cost2) + { + index = child1; + } + else + { + index = child2; + } + } + + int32 sibling = index; + + // Create a new parent. + int32 oldParent = m_nodes[sibling].parent; + int32 newParent = AllocateNode(); + m_nodes[newParent].parent = oldParent; + m_nodes[newParent].userData = NULL; + m_nodes[newParent].aabb.Combine(leafAABB, m_nodes[sibling].aabb); + m_nodes[newParent].height = m_nodes[sibling].height + 1; + + if (oldParent != b2_nullNode) + { + // The sibling was not the root. + if (m_nodes[oldParent].child1 == sibling) + { + m_nodes[oldParent].child1 = newParent; + } + else + { + m_nodes[oldParent].child2 = newParent; + } + + m_nodes[newParent].child1 = sibling; + m_nodes[newParent].child2 = leaf; + m_nodes[sibling].parent = newParent; + m_nodes[leaf].parent = newParent; + } + else + { + // The sibling was the root. + m_nodes[newParent].child1 = sibling; + m_nodes[newParent].child2 = leaf; + m_nodes[sibling].parent = newParent; + m_nodes[leaf].parent = newParent; + m_root = newParent; + } + + // Walk back up the tree fixing heights and AABBs + index = m_nodes[leaf].parent; + while (index != b2_nullNode) + { + index = Balance(index); + + int32 child1 = m_nodes[index].child1; + int32 child2 = m_nodes[index].child2; + + b2Assert(child1 != b2_nullNode); + b2Assert(child2 != b2_nullNode); + + m_nodes[index].height = 1 + b2Max(m_nodes[child1].height, m_nodes[child2].height); + m_nodes[index].aabb.Combine(m_nodes[child1].aabb, m_nodes[child2].aabb); + + index = m_nodes[index].parent; + } + + //Validate(); +} + +void b2DynamicTree::RemoveLeaf(int32 leaf) +{ + if (leaf == m_root) + { + m_root = b2_nullNode; + return; + } + + int32 parent = m_nodes[leaf].parent; + int32 grandParent = m_nodes[parent].parent; + int32 sibling; + if (m_nodes[parent].child1 == leaf) + { + sibling = m_nodes[parent].child2; + } + else + { + sibling = m_nodes[parent].child1; + } + + if (grandParent != b2_nullNode) + { + // Destroy parent and connect sibling to grandParent. + if (m_nodes[grandParent].child1 == parent) + { + m_nodes[grandParent].child1 = sibling; + } + else + { + m_nodes[grandParent].child2 = sibling; + } + m_nodes[sibling].parent = grandParent; + FreeNode(parent); + + // Adjust ancestor bounds. + int32 index = grandParent; + while (index != b2_nullNode) + { + index = Balance(index); + + int32 child1 = m_nodes[index].child1; + int32 child2 = m_nodes[index].child2; + + m_nodes[index].aabb.Combine(m_nodes[child1].aabb, m_nodes[child2].aabb); + m_nodes[index].height = 1 + b2Max(m_nodes[child1].height, m_nodes[child2].height); + + index = m_nodes[index].parent; + } + } + else + { + m_root = sibling; + m_nodes[sibling].parent = b2_nullNode; + FreeNode(parent); + } + + //Validate(); +} + +// Perform a left or right rotation if node A is imbalanced. +// Returns the new root index. +int32 b2DynamicTree::Balance(int32 iA) +{ + b2Assert(iA != b2_nullNode); + + b2TreeNode* A = m_nodes + iA; + if (A->IsLeaf() || A->height < 2) + { + return iA; + } + + int32 iB = A->child1; + int32 iC = A->child2; + b2Assert(0 <= iB && iB < m_nodeCapacity); + b2Assert(0 <= iC && iC < m_nodeCapacity); + + b2TreeNode* B = m_nodes + iB; + b2TreeNode* C = m_nodes + iC; + + int32 balance = C->height - B->height; + + // Rotate C up + if (balance > 1) + { + int32 iF = C->child1; + int32 iG = C->child2; + b2TreeNode* F = m_nodes + iF; + b2TreeNode* G = m_nodes + iG; + b2Assert(0 <= iF && iF < m_nodeCapacity); + b2Assert(0 <= iG && iG < m_nodeCapacity); + + // Swap A and C + C->child1 = iA; + C->parent = A->parent; + A->parent = iC; + + // A's old parent should point to C + if (C->parent != b2_nullNode) + { + if (m_nodes[C->parent].child1 == iA) + { + m_nodes[C->parent].child1 = iC; + } + else + { + b2Assert(m_nodes[C->parent].child2 == iA); + m_nodes[C->parent].child2 = iC; + } + } + else + { + m_root = iC; + } + + // Rotate + if (F->height > G->height) + { + C->child2 = iF; + A->child2 = iG; + G->parent = iA; + A->aabb.Combine(B->aabb, G->aabb); + C->aabb.Combine(A->aabb, F->aabb); + + A->height = 1 + b2Max(B->height, G->height); + C->height = 1 + b2Max(A->height, F->height); + } + else + { + C->child2 = iG; + A->child2 = iF; + F->parent = iA; + A->aabb.Combine(B->aabb, F->aabb); + C->aabb.Combine(A->aabb, G->aabb); + + A->height = 1 + b2Max(B->height, F->height); + C->height = 1 + b2Max(A->height, G->height); + } + + return iC; + } + + // Rotate B up + if (balance < -1) + { + int32 iD = B->child1; + int32 iE = B->child2; + b2TreeNode* D = m_nodes + iD; + b2TreeNode* E = m_nodes + iE; + b2Assert(0 <= iD && iD < m_nodeCapacity); + b2Assert(0 <= iE && iE < m_nodeCapacity); + + // Swap A and B + B->child1 = iA; + B->parent = A->parent; + A->parent = iB; + + // A's old parent should point to B + if (B->parent != b2_nullNode) + { + if (m_nodes[B->parent].child1 == iA) + { + m_nodes[B->parent].child1 = iB; + } + else + { + b2Assert(m_nodes[B->parent].child2 == iA); + m_nodes[B->parent].child2 = iB; + } + } + else + { + m_root = iB; + } + + // Rotate + if (D->height > E->height) + { + B->child2 = iD; + A->child1 = iE; + E->parent = iA; + A->aabb.Combine(C->aabb, E->aabb); + B->aabb.Combine(A->aabb, D->aabb); + + A->height = 1 + b2Max(C->height, E->height); + B->height = 1 + b2Max(A->height, D->height); + } + else + { + B->child2 = iE; + A->child1 = iD; + D->parent = iA; + A->aabb.Combine(C->aabb, D->aabb); + B->aabb.Combine(A->aabb, E->aabb); + + A->height = 1 + b2Max(C->height, D->height); + B->height = 1 + b2Max(A->height, E->height); + } + + return iB; + } + + return iA; +} + +int32 b2DynamicTree::GetHeight() const +{ + if (m_root == b2_nullNode) + { + return 0; + } + + return m_nodes[m_root].height; +} + +// +float32 b2DynamicTree::GetAreaRatio() const +{ + if (m_root == b2_nullNode) + { + return 0.0f; + } + + const b2TreeNode* root = m_nodes + m_root; + float32 rootArea = root->aabb.GetPerimeter(); + + float32 totalArea = 0.0f; + for (int32 i = 0; i < m_nodeCapacity; ++i) + { + const b2TreeNode* node = m_nodes + i; + if (node->height < 0) + { + // Free node in pool + continue; + } + + totalArea += node->aabb.GetPerimeter(); + } + + return totalArea / rootArea; +} + +// Compute the height of a sub-tree. +int32 b2DynamicTree::ComputeHeight(int32 nodeId) const +{ + b2Assert(0 <= nodeId && nodeId < m_nodeCapacity); + b2TreeNode* node = m_nodes + nodeId; + + if (node->IsLeaf()) + { + return 0; + } + + int32 height1 = ComputeHeight(node->child1); + int32 height2 = ComputeHeight(node->child2); + return 1 + b2Max(height1, height2); +} + +int32 b2DynamicTree::ComputeHeight() const +{ + int32 height = ComputeHeight(m_root); + return height; +} + +void b2DynamicTree::ValidateStructure(int32 index) const +{ + if (index == b2_nullNode) + { + return; + } + + if (index == m_root) + { + b2Assert(m_nodes[index].parent == b2_nullNode); + } + + const b2TreeNode* node = m_nodes + index; + + int32 child1 = node->child1; + int32 child2 = node->child2; + + if (node->IsLeaf()) + { + b2Assert(child1 == b2_nullNode); + b2Assert(child2 == b2_nullNode); + b2Assert(node->height == 0); + return; + } + + b2Assert(0 <= child1 && child1 < m_nodeCapacity); + b2Assert(0 <= child2 && child2 < m_nodeCapacity); + + b2Assert(m_nodes[child1].parent == index); + b2Assert(m_nodes[child2].parent == index); + + ValidateStructure(child1); + ValidateStructure(child2); +} + +void b2DynamicTree::ValidateMetrics(int32 index) const +{ + if (index == b2_nullNode) + { + return; + } + + const b2TreeNode* node = m_nodes + index; + + int32 child1 = node->child1; + int32 child2 = node->child2; + + if (node->IsLeaf()) + { + b2Assert(child1 == b2_nullNode); + b2Assert(child2 == b2_nullNode); + b2Assert(node->height == 0); + return; + } + + b2Assert(0 <= child1 && child1 < m_nodeCapacity); + b2Assert(0 <= child2 && child2 < m_nodeCapacity); + + int32 height1 = m_nodes[child1].height; + int32 height2 = m_nodes[child2].height; + int32 height; + height = 1 + b2Max(height1, height2); + b2Assert(node->height == height); + + b2AABB aabb; + aabb.Combine(m_nodes[child1].aabb, m_nodes[child2].aabb); + + b2Assert(aabb.lowerBound == node->aabb.lowerBound); + b2Assert(aabb.upperBound == node->aabb.upperBound); + + ValidateMetrics(child1); + ValidateMetrics(child2); +} + +void b2DynamicTree::Validate() const +{ + ValidateStructure(m_root); + ValidateMetrics(m_root); + + int32 freeCount = 0; + int32 freeIndex = m_freeList; + while (freeIndex != b2_nullNode) + { + b2Assert(0 <= freeIndex && freeIndex < m_nodeCapacity); + freeIndex = m_nodes[freeIndex].next; + ++freeCount; + } + + b2Assert(GetHeight() == ComputeHeight()); + + b2Assert(m_nodeCount + freeCount == m_nodeCapacity); +} + +int32 b2DynamicTree::GetMaxBalance() const +{ + int32 maxBalance = 0; + for (int32 i = 0; i < m_nodeCapacity; ++i) + { + const b2TreeNode* node = m_nodes + i; + if (node->height <= 1) + { + continue; + } + + b2Assert(node->IsLeaf() == false); + + int32 child1 = node->child1; + int32 child2 = node->child2; + int32 balance = b2Abs(m_nodes[child2].height - m_nodes[child1].height); + maxBalance = b2Max(maxBalance, balance); + } + + return maxBalance; +} + +void b2DynamicTree::RebuildBottomUp() +{ + int32* nodes = (int32*)b2Alloc(m_nodeCount * sizeof(int32)); + int32 count = 0; + + // Build array of leaves. Free the rest. + for (int32 i = 0; i < m_nodeCapacity; ++i) + { + if (m_nodes[i].height < 0) + { + // free node in pool + continue; + } + + if (m_nodes[i].IsLeaf()) + { + m_nodes[i].parent = b2_nullNode; + nodes[count] = i; + ++count; + } + else + { + FreeNode(i); + } + } + + while (count > 1) + { + float32 minCost = b2_maxFloat; + int32 iMin = -1, jMin = -1; + for (int32 i = 0; i < count; ++i) + { + b2AABB aabbi = m_nodes[nodes[i]].aabb; + + for (int32 j = i + 1; j < count; ++j) + { + b2AABB aabbj = m_nodes[nodes[j]].aabb; + b2AABB b; + b.Combine(aabbi, aabbj); + float32 cost = b.GetPerimeter(); + if (cost < minCost) + { + iMin = i; + jMin = j; + minCost = cost; + } + } + } + + int32 index1 = nodes[iMin]; + int32 index2 = nodes[jMin]; + b2TreeNode* child1 = m_nodes + index1; + b2TreeNode* child2 = m_nodes + index2; + + int32 parentIndex = AllocateNode(); + b2TreeNode* parent = m_nodes + parentIndex; + parent->child1 = index1; + parent->child2 = index2; + parent->height = 1 + b2Max(child1->height, child2->height); + parent->aabb.Combine(child1->aabb, child2->aabb); + parent->parent = b2_nullNode; + + child1->parent = parentIndex; + child2->parent = parentIndex; + + nodes[jMin] = nodes[count-1]; + nodes[iMin] = parentIndex; + --count; + } + + m_root = nodes[0]; + b2Free(nodes); + + Validate(); +} diff --git a/external/box2d/Collision/b2DynamicTree.h b/external/box2d/Collision/b2DynamicTree.h new file mode 100644 index 0000000000..33f16b0f32 --- /dev/null +++ b/external/box2d/Collision/b2DynamicTree.h @@ -0,0 +1,284 @@ +/* +* Copyright (c) 2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_DYNAMIC_TREE_H +#define B2_DYNAMIC_TREE_H + +#include +#include + +#define b2_nullNode (-1) + +/// A node in the dynamic tree. The client does not interact with this directly. +struct b2TreeNode +{ + bool IsLeaf() const + { + return child1 == b2_nullNode; + } + + /// Enlarged AABB + b2AABB aabb; + + void* userData; + + union + { + int32 parent; + int32 next; + }; + + int32 child1; + int32 child2; + + // leaf = 0, free node = -1 + int32 height; +}; + +/// A dynamic AABB tree broad-phase, inspired by Nathanael Presson's btDbvt. +/// A dynamic tree arranges data in a binary tree to accelerate +/// queries such as volume queries and ray casts. Leafs are proxies +/// with an AABB. In the tree we expand the proxy AABB by b2_fatAABBFactor +/// so that the proxy AABB is bigger than the client object. This allows the client +/// object to move by small amounts without triggering a tree update. +/// +/// Nodes are pooled and relocatable, so we use node indices rather than pointers. +class b2DynamicTree +{ +public: + /// Constructing the tree initializes the node pool. + b2DynamicTree(); + + /// Destroy the tree, freeing the node pool. + ~b2DynamicTree(); + + /// Create a proxy. Provide a tight fitting AABB and a userData pointer. + int32 CreateProxy(const b2AABB& aabb, void* userData); + + /// Destroy a proxy. This asserts if the id is invalid. + void DestroyProxy(int32 proxyId); + + /// Move a proxy with a swepted AABB. If the proxy has moved outside of its fattened AABB, + /// then the proxy is removed from the tree and re-inserted. Otherwise + /// the function returns immediately. + /// @return true if the proxy was re-inserted. + bool MoveProxy(int32 proxyId, const b2AABB& aabb1, const b2Vec2& displacement); + + /// Get proxy user data. + /// @return the proxy user data or 0 if the id is invalid. + void* GetUserData(int32 proxyId) const; + + /// Get the fat AABB for a proxy. + const b2AABB& GetFatAABB(int32 proxyId) const; + + /// Query an AABB for overlapping proxies. The callback class + /// is called for each proxy that overlaps the supplied AABB. + template + void Query(T* callback, const b2AABB& aabb) const; + + /// Ray-cast against the proxies in the tree. This relies on the callback + /// to perform a exact ray-cast in the case were the proxy contains a shape. + /// The callback also performs the any collision filtering. This has performance + /// roughly equal to k * log(n), where k is the number of collisions and n is the + /// number of proxies in the tree. + /// @param input the ray-cast input data. The ray extends from p1 to p1 + maxFraction * (p2 - p1). + /// @param callback a callback class that is called for each proxy that is hit by the ray. + template + void RayCast(T* callback, const b2RayCastInput& input) const; + + /// Validate this tree. For testing. + void Validate() const; + + /// Compute the height of the binary tree in O(N) time. Should not be + /// called often. + int32 GetHeight() const; + + /// Get the maximum balance of an node in the tree. The balance is the difference + /// in height of the two children of a node. + int32 GetMaxBalance() const; + + /// Get the ratio of the sum of the node areas to the root area. + float32 GetAreaRatio() const; + + /// Build an optimal tree. Very expensive. For testing. + void RebuildBottomUp(); + +private: + + int32 AllocateNode(); + void FreeNode(int32 node); + + void InsertLeaf(int32 node); + void RemoveLeaf(int32 node); + + int32 Balance(int32 index); + + int32 ComputeHeight() const; + int32 ComputeHeight(int32 nodeId) const; + + void ValidateStructure(int32 index) const; + void ValidateMetrics(int32 index) const; + + int32 m_root; + + b2TreeNode* m_nodes; + int32 m_nodeCount; + int32 m_nodeCapacity; + + int32 m_freeList; + + /// This is used to incrementally traverse the tree for re-balancing. + uint32 m_path; + + int32 m_insertionCount; +}; + +inline void* b2DynamicTree::GetUserData(int32 proxyId) const +{ + b2Assert(0 <= proxyId && proxyId < m_nodeCapacity); + return m_nodes[proxyId].userData; +} + +inline const b2AABB& b2DynamicTree::GetFatAABB(int32 proxyId) const +{ + b2Assert(0 <= proxyId && proxyId < m_nodeCapacity); + return m_nodes[proxyId].aabb; +} + +template +inline void b2DynamicTree::Query(T* callback, const b2AABB& aabb) const +{ + b2GrowableStack stack; + stack.Push(m_root); + + while (stack.GetCount() > 0) + { + int32 nodeId = stack.Pop(); + if (nodeId == b2_nullNode) + { + continue; + } + + const b2TreeNode* node = m_nodes + nodeId; + + if (b2TestOverlap(node->aabb, aabb)) + { + if (node->IsLeaf()) + { + bool proceed = callback->QueryCallback(nodeId); + if (proceed == false) + { + return; + } + } + else + { + stack.Push(node->child1); + stack.Push(node->child2); + } + } + } +} + +template +inline void b2DynamicTree::RayCast(T* callback, const b2RayCastInput& input) const +{ + b2Vec2 p1 = input.p1; + b2Vec2 p2 = input.p2; + b2Vec2 r = p2 - p1; + b2Assert(r.LengthSquared() > 0.0f); + r.Normalize(); + + // v is perpendicular to the segment. + b2Vec2 v = b2Cross(1.0f, r); + b2Vec2 abs_v = b2Abs(v); + + // Separating axis for segment (Gino, p80). + // |dot(v, p1 - c)| > dot(|v|, h) + + float32 maxFraction = input.maxFraction; + + // Build a bounding box for the segment. + b2AABB segmentAABB; + { + b2Vec2 t = p1 + maxFraction * (p2 - p1); + segmentAABB.lowerBound = b2Min(p1, t); + segmentAABB.upperBound = b2Max(p1, t); + } + + b2GrowableStack stack; + stack.Push(m_root); + + while (stack.GetCount() > 0) + { + int32 nodeId = stack.Pop(); + if (nodeId == b2_nullNode) + { + continue; + } + + const b2TreeNode* node = m_nodes + nodeId; + + if (b2TestOverlap(node->aabb, segmentAABB) == false) + { + continue; + } + + // Separating axis for segment (Gino, p80). + // |dot(v, p1 - c)| > dot(|v|, h) + b2Vec2 c = node->aabb.GetCenter(); + b2Vec2 h = node->aabb.GetExtents(); + float32 separation = b2Abs(b2Dot(v, p1 - c)) - b2Dot(abs_v, h); + if (separation > 0.0f) + { + continue; + } + + if (node->IsLeaf()) + { + b2RayCastInput subInput; + subInput.p1 = input.p1; + subInput.p2 = input.p2; + subInput.maxFraction = maxFraction; + + float32 value = callback->RayCastCallback(subInput, nodeId); + + if (value == 0.0f) + { + // The client has terminated the ray cast. + return; + } + + if (value > 0.0f) + { + // Update segment bounding box. + maxFraction = value; + b2Vec2 t = p1 + maxFraction * (p2 - p1); + segmentAABB.lowerBound = b2Min(p1, t); + segmentAABB.upperBound = b2Max(p1, t); + } + } + else + { + stack.Push(node->child1); + stack.Push(node->child2); + } + } +} + +#endif diff --git a/external/box2d/Collision/b2TimeOfImpact.cpp b/external/box2d/Collision/b2TimeOfImpact.cpp new file mode 100644 index 0000000000..1d643addd8 --- /dev/null +++ b/external/box2d/Collision/b2TimeOfImpact.cpp @@ -0,0 +1,488 @@ +/* +* Copyright (c) 2007-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include +#include +#include + +#ifdef SHP +#include +#else +#include +#endif + +using namespace std; + +int32 b2_toiCalls, b2_toiIters, b2_toiMaxIters; +int32 b2_toiRootIters, b2_toiMaxRootIters; + +struct b2SeparationFunction +{ + enum Type + { + e_points, + e_faceA, + e_faceB + }; + + // TODO_ERIN might not need to return the separation + + float32 Initialize(const b2SimplexCache* cache, + const b2DistanceProxy* proxyA, const b2Sweep& sweepA, + const b2DistanceProxy* proxyB, const b2Sweep& sweepB, + float32 t1) + { + m_proxyA = proxyA; + m_proxyB = proxyB; + int32 count = cache->count; + b2Assert(0 < count && count < 3); + + m_sweepA = sweepA; + m_sweepB = sweepB; + + b2Transform xfA, xfB; + m_sweepA.GetTransform(&xfA, t1); + m_sweepB.GetTransform(&xfB, t1); + + if (count == 1) + { + m_type = e_points; + b2Vec2 localPointA = m_proxyA->GetVertex(cache->indexA[0]); + b2Vec2 localPointB = m_proxyB->GetVertex(cache->indexB[0]); + b2Vec2 pointA = b2Mul(xfA, localPointA); + b2Vec2 pointB = b2Mul(xfB, localPointB); + m_axis = pointB - pointA; + float32 s = m_axis.Normalize(); + return s; + } + else if (cache->indexA[0] == cache->indexA[1]) + { + // Two points on B and one on A. + m_type = e_faceB; + b2Vec2 localPointB1 = proxyB->GetVertex(cache->indexB[0]); + b2Vec2 localPointB2 = proxyB->GetVertex(cache->indexB[1]); + + m_axis = b2Cross(localPointB2 - localPointB1, 1.0f); + m_axis.Normalize(); + b2Vec2 normal = b2Mul(xfB.q, m_axis); + + m_localPoint = 0.5f * (localPointB1 + localPointB2); + b2Vec2 pointB = b2Mul(xfB, m_localPoint); + + b2Vec2 localPointA = proxyA->GetVertex(cache->indexA[0]); + b2Vec2 pointA = b2Mul(xfA, localPointA); + + float32 s = b2Dot(pointA - pointB, normal); + if (s < 0.0f) + { + m_axis = -m_axis; + s = -s; + } + return s; + } + else + { + // Two points on A and one or two points on B. + m_type = e_faceA; + b2Vec2 localPointA1 = m_proxyA->GetVertex(cache->indexA[0]); + b2Vec2 localPointA2 = m_proxyA->GetVertex(cache->indexA[1]); + + m_axis = b2Cross(localPointA2 - localPointA1, 1.0f); + m_axis.Normalize(); + b2Vec2 normal = b2Mul(xfA.q, m_axis); + + m_localPoint = 0.5f * (localPointA1 + localPointA2); + b2Vec2 pointA = b2Mul(xfA, m_localPoint); + + b2Vec2 localPointB = m_proxyB->GetVertex(cache->indexB[0]); + b2Vec2 pointB = b2Mul(xfB, localPointB); + + float32 s = b2Dot(pointB - pointA, normal); + if (s < 0.0f) + { + m_axis = -m_axis; + s = -s; + } + return s; + } + } + + float32 FindMinSeparation(int32* indexA, int32* indexB, float32 t) const + { + b2Transform xfA, xfB; + m_sweepA.GetTransform(&xfA, t); + m_sweepB.GetTransform(&xfB, t); + + switch (m_type) + { + case e_points: + { + b2Vec2 axisA = b2MulT(xfA.q, m_axis); + b2Vec2 axisB = b2MulT(xfB.q, -m_axis); + + *indexA = m_proxyA->GetSupport(axisA); + *indexB = m_proxyB->GetSupport(axisB); + + b2Vec2 localPointA = m_proxyA->GetVertex(*indexA); + b2Vec2 localPointB = m_proxyB->GetVertex(*indexB); + + b2Vec2 pointA = b2Mul(xfA, localPointA); + b2Vec2 pointB = b2Mul(xfB, localPointB); + + float32 separation = b2Dot(pointB - pointA, m_axis); + return separation; + } + + case e_faceA: + { + b2Vec2 normal = b2Mul(xfA.q, m_axis); + b2Vec2 pointA = b2Mul(xfA, m_localPoint); + + b2Vec2 axisB = b2MulT(xfB.q, -normal); + + *indexA = -1; + *indexB = m_proxyB->GetSupport(axisB); + + b2Vec2 localPointB = m_proxyB->GetVertex(*indexB); + b2Vec2 pointB = b2Mul(xfB, localPointB); + + float32 separation = b2Dot(pointB - pointA, normal); + return separation; + } + + case e_faceB: + { + b2Vec2 normal = b2Mul(xfB.q, m_axis); + b2Vec2 pointB = b2Mul(xfB, m_localPoint); + + b2Vec2 axisA = b2MulT(xfA.q, -normal); + + *indexB = -1; + *indexA = m_proxyA->GetSupport(axisA); + + b2Vec2 localPointA = m_proxyA->GetVertex(*indexA); + b2Vec2 pointA = b2Mul(xfA, localPointA); + + float32 separation = b2Dot(pointA - pointB, normal); + return separation; + } + + default: + b2Assert(false); + *indexA = -1; + *indexB = -1; + return 0.0f; + } + } + + float32 Evaluate(int32 indexA, int32 indexB, float32 t) const + { + b2Transform xfA, xfB; + m_sweepA.GetTransform(&xfA, t); + m_sweepB.GetTransform(&xfB, t); + + switch (m_type) + { + case e_points: + { + b2Vec2 axisA = b2MulT(xfA.q, m_axis); + b2Vec2 axisB = b2MulT(xfB.q, -m_axis); + + b2Vec2 localPointA = m_proxyA->GetVertex(indexA); + b2Vec2 localPointB = m_proxyB->GetVertex(indexB); + + b2Vec2 pointA = b2Mul(xfA, localPointA); + b2Vec2 pointB = b2Mul(xfB, localPointB); + float32 separation = b2Dot(pointB - pointA, m_axis); + + return separation; + } + + case e_faceA: + { + b2Vec2 normal = b2Mul(xfA.q, m_axis); + b2Vec2 pointA = b2Mul(xfA, m_localPoint); + + b2Vec2 axisB = b2MulT(xfB.q, -normal); + + b2Vec2 localPointB = m_proxyB->GetVertex(indexB); + b2Vec2 pointB = b2Mul(xfB, localPointB); + + float32 separation = b2Dot(pointB - pointA, normal); + return separation; + } + + case e_faceB: + { + b2Vec2 normal = b2Mul(xfB.q, m_axis); + b2Vec2 pointB = b2Mul(xfB, m_localPoint); + + b2Vec2 axisA = b2MulT(xfA.q, -normal); + + b2Vec2 localPointA = m_proxyA->GetVertex(indexA); + b2Vec2 pointA = b2Mul(xfA, localPointA); + + float32 separation = b2Dot(pointA - pointB, normal); + return separation; + } + + default: + b2Assert(false); + return 0.0f; + } + } + + const b2DistanceProxy* m_proxyA; + const b2DistanceProxy* m_proxyB; + b2Sweep m_sweepA, m_sweepB; + Type m_type; + b2Vec2 m_localPoint; + b2Vec2 m_axis; +}; + +// CCD via the local separating axis method. This seeks progression +// by computing the largest time at which separation is maintained. +void b2TimeOfImpact(b2TOIOutput* output, const b2TOIInput* input) +{ + ++b2_toiCalls; + + output->state = b2TOIOutput::e_unknown; + output->t = input->tMax; + + const b2DistanceProxy* proxyA = &input->proxyA; + const b2DistanceProxy* proxyB = &input->proxyB; + + b2Sweep sweepA = input->sweepA; + b2Sweep sweepB = input->sweepB; + + // Large rotations can make the root finder fail, so we normalize the + // sweep angles. + sweepA.Normalize(); + sweepB.Normalize(); + + float32 tMax = input->tMax; + + float32 totalRadius = proxyA->m_radius + proxyB->m_radius; + float32 target = b2Max(b2_linearSlop, totalRadius - 3.0f * b2_linearSlop); + float32 tolerance = 0.25f * b2_linearSlop; + b2Assert(target > tolerance); + + float32 t1 = 0.0f; + const int32 k_maxIterations = 20; // TODO_ERIN b2Settings + int32 iter = 0; + + // Prepare input for distance query. + b2SimplexCache cache; + cache.count = 0; + b2DistanceInput distanceInput; + distanceInput.proxyA = input->proxyA; + distanceInput.proxyB = input->proxyB; + distanceInput.useRadii = false; + + // The outer loop progressively attempts to compute new separating axes. + // This loop terminates when an axis is repeated (no progress is made). + for(;;) + { + b2Transform xfA, xfB; + sweepA.GetTransform(&xfA, t1); + sweepB.GetTransform(&xfB, t1); + + // Get the distance between shapes. We can also use the results + // to get a separating axis. + distanceInput.transformA = xfA; + distanceInput.transformB = xfB; + b2DistanceOutput distanceOutput; + b2Distance(&distanceOutput, &cache, &distanceInput); + + // If the shapes are overlapped, we give up on continuous collision. + if (distanceOutput.distance <= 0.0f) + { + // Failure! + output->state = b2TOIOutput::e_overlapped; + output->t = 0.0f; + break; + } + + if (distanceOutput.distance < target + tolerance) + { + // Victory! + output->state = b2TOIOutput::e_touching; + output->t = t1; + break; + } + + // Initialize the separating axis. + b2SeparationFunction fcn; + fcn.Initialize(&cache, proxyA, sweepA, proxyB, sweepB, t1); +#if 0 + // Dump the curve seen by the root finder + { + const int32 N = 100; + float32 dx = 1.0f / N; + float32 xs[N+1]; + float32 fs[N+1]; + + float32 x = 0.0f; + + for (int32 i = 0; i <= N; ++i) + { + sweepA.GetTransform(&xfA, x); + sweepB.GetTransform(&xfB, x); + float32 f = fcn.Evaluate(xfA, xfB) - target; + + printf("%g %g\n", x, f); + + xs[i] = x; + fs[i] = f; + + x += dx; + } + } +#endif + + // Compute the TOI on the separating axis. We do this by successively + // resolving the deepest point. This loop is bounded by the number of vertices. + bool done = false; + float32 t2 = tMax; + int32 pushBackIter = 0; + for (;;) + { + // Find the deepest point at t2. Store the witness point indices. + int32 indexA, indexB; + float32 s2 = fcn.FindMinSeparation(&indexA, &indexB, t2); + + // Is the final configuration separated? + if (s2 > target + tolerance) + { + // Victory! + output->state = b2TOIOutput::e_separated; + output->t = tMax; + done = true; + break; + } + + // Has the separation reached tolerance? + if (s2 > target - tolerance) + { + // Advance the sweeps + t1 = t2; + break; + } + + // Compute the initial separation of the witness points. + float32 s1 = fcn.Evaluate(indexA, indexB, t1); + + // Check for initial overlap. This might happen if the root finder + // runs out of iterations. + if (s1 < target - tolerance) + { + output->state = b2TOIOutput::e_failed; + output->t = t1; + done = true; + break; + } + + // Check for touching + if (s1 <= target + tolerance) + { + // Victory! t1 should hold the TOI (could be 0.0). + output->state = b2TOIOutput::e_touching; + output->t = t1; + done = true; + break; + } + + // Compute 1D root of: f(x) - target = 0 + int32 rootIterCount = 0; + float32 a1 = t1, a2 = t2; + for (;;) + { + // Use a mix of the secant rule and bisection. + float32 t; + if (rootIterCount & 1) + { + // Secant rule to improve convergence. + t = a1 + (target - s1) * (a2 - a1) / (s2 - s1); + } + else + { + // Bisection to guarantee progress. + t = 0.5f * (a1 + a2); + } + + float32 s = fcn.Evaluate(indexA, indexB, t); + + if (b2Abs(s - target) < tolerance) + { + // t2 holds a tentative value for t1 + t2 = t; + break; + } + + // Ensure we continue to bracket the root. + if (s > target) + { + a1 = t; + s1 = s; + } + else + { + a2 = t; + s2 = s; + } + + ++rootIterCount; + ++b2_toiRootIters; + + if (rootIterCount == 50) + { + break; + } + } + + b2_toiMaxRootIters = b2Max(b2_toiMaxRootIters, rootIterCount); + + ++pushBackIter; + + if (pushBackIter == b2_maxPolygonVertices) + { + break; + } + } + + ++iter; + ++b2_toiIters; + + if (done) + { + break; + } + + if (iter == k_maxIterations) + { + // Root finder got stuck. Semi-victory. + output->state = b2TOIOutput::e_failed; + output->t = t1; + break; + } + } + + b2_toiMaxIters = b2Max(b2_toiMaxIters, iter); +} diff --git a/external/box2d/Collision/b2TimeOfImpact.h b/external/box2d/Collision/b2TimeOfImpact.h new file mode 100644 index 0000000000..2e4f8228ff --- /dev/null +++ b/external/box2d/Collision/b2TimeOfImpact.h @@ -0,0 +1,58 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_TIME_OF_IMPACT_H +#define B2_TIME_OF_IMPACT_H + +#include +#include + +/// Input parameters for b2TimeOfImpact +struct b2TOIInput +{ + b2DistanceProxy proxyA; + b2DistanceProxy proxyB; + b2Sweep sweepA; + b2Sweep sweepB; + float32 tMax; // defines sweep interval [0, tMax] +}; + +// Output parameters for b2TimeOfImpact. +struct b2TOIOutput +{ + enum State + { + e_unknown, + e_failed, + e_overlapped, + e_touching, + e_separated + }; + + State state; + float32 t; +}; + +/// Compute the upper bound on time before two shapes penetrate. Time is represented as +/// a fraction between [0,tMax]. This uses a swept separating axis and may miss some intermediate, +/// non-tunneling collision. If you change the time interval, you should call this function +/// again. +/// Note: use b2Distance to compute the contact point and normal at the time of impact. +void b2TimeOfImpact(b2TOIOutput* output, const b2TOIInput* input); + +#endif diff --git a/external/box2d/Common/b2BlockAllocator.cpp b/external/box2d/Common/b2BlockAllocator.cpp new file mode 100644 index 0000000000..2e862091f9 --- /dev/null +++ b/external/box2d/Common/b2BlockAllocator.cpp @@ -0,0 +1,218 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include +#include +#include + +using namespace std; + +int32 b2BlockAllocator::s_blockSizes[b2_blockSizes] = +{ + 16, // 0 + 32, // 1 + 64, // 2 + 96, // 3 + 128, // 4 + 160, // 5 + 192, // 6 + 224, // 7 + 256, // 8 + 320, // 9 + 384, // 10 + 448, // 11 + 512, // 12 + 640, // 13 +}; +uint8 b2BlockAllocator::s_blockSizeLookup[b2_maxBlockSize + 1]; +bool b2BlockAllocator::s_blockSizeLookupInitialized; + +struct b2Chunk +{ + int32 blockSize; + b2Block* blocks; +}; + +struct b2Block +{ + b2Block* next; +}; + +b2BlockAllocator::b2BlockAllocator() +{ + b2Assert(b2_blockSizes < UCHAR_MAX); + + m_chunkSpace = b2_chunkArrayIncrement; + m_chunkCount = 0; + m_chunks = (b2Chunk*)b2Alloc(m_chunkSpace * sizeof(b2Chunk)); + + memset(m_chunks, 0, m_chunkSpace * sizeof(b2Chunk)); + memset(m_freeLists, 0, sizeof(m_freeLists)); + + if (s_blockSizeLookupInitialized == false) + { + int32 j = 0; + for (int32 i = 1; i <= b2_maxBlockSize; ++i) + { + b2Assert(j < b2_blockSizes); + if (i <= s_blockSizes[j]) + { + s_blockSizeLookup[i] = (uint8)j; + } + else + { + ++j; + s_blockSizeLookup[i] = (uint8)j; + } + } + + s_blockSizeLookupInitialized = true; + } +} + +b2BlockAllocator::~b2BlockAllocator() +{ + for (int32 i = 0; i < m_chunkCount; ++i) + { + b2Free(m_chunks[i].blocks); + } + + b2Free(m_chunks); +} + +void* b2BlockAllocator::Allocate(int32 size) +{ + if (size == 0) + return NULL; + + b2Assert(0 < size); + + if (size > b2_maxBlockSize) + { + return b2Alloc(size); + } + + int32 index = s_blockSizeLookup[size]; + b2Assert(0 <= index && index < b2_blockSizes); + + if (m_freeLists[index]) + { + b2Block* block = m_freeLists[index]; + m_freeLists[index] = block->next; + return block; + } + else + { + if (m_chunkCount == m_chunkSpace) + { + b2Chunk* oldChunks = m_chunks; + m_chunkSpace += b2_chunkArrayIncrement; + m_chunks = (b2Chunk*)b2Alloc(m_chunkSpace * sizeof(b2Chunk)); + memcpy(m_chunks, oldChunks, m_chunkCount * sizeof(b2Chunk)); + memset(m_chunks + m_chunkCount, 0, b2_chunkArrayIncrement * sizeof(b2Chunk)); + b2Free(oldChunks); + } + + b2Chunk* chunk = m_chunks + m_chunkCount; + chunk->blocks = (b2Block*)b2Alloc(b2_chunkSize); +#if defined(_DEBUG) + memset(chunk->blocks, 0xcd, b2_chunkSize); +#endif + int32 blockSize = s_blockSizes[index]; + chunk->blockSize = blockSize; + int32 blockCount = b2_chunkSize / blockSize; + b2Assert(blockCount * blockSize <= b2_chunkSize); + for (int32 i = 0; i < blockCount - 1; ++i) + { + b2Block* block = (b2Block*)((int8*)chunk->blocks + blockSize * i); + b2Block* next = (b2Block*)((int8*)chunk->blocks + blockSize * (i + 1)); + block->next = next; + } + b2Block* last = (b2Block*)((int8*)chunk->blocks + blockSize * (blockCount - 1)); + last->next = NULL; + + m_freeLists[index] = chunk->blocks->next; + ++m_chunkCount; + + return chunk->blocks; + } +} + +void b2BlockAllocator::Free(void* p, int32 size) +{ + if (size == 0) + { + return; + } + + b2Assert(0 < size); + + if (size > b2_maxBlockSize) + { + b2Free(p); + return; + } + + int32 index = s_blockSizeLookup[size]; + b2Assert(0 <= index && index < b2_blockSizes); + +#ifdef _DEBUG + // Verify the memory address and size is valid. + int32 blockSize = s_blockSizes[index]; + bool found = false; + for (int32 i = 0; i < m_chunkCount; ++i) + { + b2Chunk* chunk = m_chunks + i; + if (chunk->blockSize != blockSize) + { + b2Assert( (int8*)p + blockSize <= (int8*)chunk->blocks || + (int8*)chunk->blocks + b2_chunkSize <= (int8*)p); + } + else + { + if ((int8*)chunk->blocks <= (int8*)p && (int8*)p + blockSize <= (int8*)chunk->blocks + b2_chunkSize) + { + found = true; + } + } + } + + b2Assert(found); + + memset(p, 0xfd, blockSize); +#endif + + b2Block* block = (b2Block*)p; + block->next = m_freeLists[index]; + m_freeLists[index] = block; +} + +void b2BlockAllocator::Clear() +{ + for (int32 i = 0; i < m_chunkCount; ++i) + { + b2Free(m_chunks[i].blocks); + } + + m_chunkCount = 0; + memset(m_chunks, 0, m_chunkSpace * sizeof(b2Chunk)); + + memset(m_freeLists, 0, sizeof(m_freeLists)); +} diff --git a/external/box2d/Common/b2BlockAllocator.h b/external/box2d/Common/b2BlockAllocator.h new file mode 100644 index 0000000000..ec221fdf61 --- /dev/null +++ b/external/box2d/Common/b2BlockAllocator.h @@ -0,0 +1,62 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_BLOCK_ALLOCATOR_H +#define B2_BLOCK_ALLOCATOR_H + +#include + +const int32 b2_chunkSize = 16 * 1024; +const int32 b2_maxBlockSize = 640; +const int32 b2_blockSizes = 14; +const int32 b2_chunkArrayIncrement = 128; + +struct b2Block; +struct b2Chunk; + +/// This is a small object allocator used for allocating small +/// objects that persist for more than one time step. +/// See: http://www.codeproject.com/useritems/Small_Block_Allocator.asp +class b2BlockAllocator +{ +public: + b2BlockAllocator(); + ~b2BlockAllocator(); + + /// Allocate memory. This will use b2Alloc if the size is larger than b2_maxBlockSize. + void* Allocate(int32 size); + + /// Free memory. This will use b2Free if the size is larger than b2_maxBlockSize. + void Free(void* p, int32 size); + + void Clear(); + +private: + + b2Chunk* m_chunks; + int32 m_chunkCount; + int32 m_chunkSpace; + + b2Block* m_freeLists[b2_blockSizes]; + + static int32 s_blockSizes[b2_blockSizes]; + static uint8 s_blockSizeLookup[b2_maxBlockSize + 1]; + static bool s_blockSizeLookupInitialized; +}; + +#endif diff --git a/external/box2d/Common/b2Draw.cpp b/external/box2d/Common/b2Draw.cpp new file mode 100644 index 0000000000..cb760025e9 --- /dev/null +++ b/external/box2d/Common/b2Draw.cpp @@ -0,0 +1,44 @@ +/* +* Copyright (c) 2011 Erin Catto http://box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include + +b2Draw::b2Draw() +{ + m_drawFlags = 0; +} + +void b2Draw::SetFlags(uint32 flags) +{ + m_drawFlags = flags; +} + +uint32 b2Draw::GetFlags() const +{ + return m_drawFlags; +} + +void b2Draw::AppendFlags(uint32 flags) +{ + m_drawFlags |= flags; +} + +void b2Draw::ClearFlags(uint32 flags) +{ + m_drawFlags &= ~flags; +} diff --git a/external/box2d/Common/b2Draw.h b/external/box2d/Common/b2Draw.h new file mode 100644 index 0000000000..b33cd8d38f --- /dev/null +++ b/external/box2d/Common/b2Draw.h @@ -0,0 +1,81 @@ +/* +* Copyright (c) 2011 Erin Catto http://box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include + +/// Color for debug drawing. Each value has the range [0,1]. +struct b2Color +{ + b2Color() {} + b2Color(float32 r, float32 g, float32 b) : r(r), g(g), b(b) {} + void Set(float32 ri, float32 gi, float32 bi) { r = ri; g = gi; b = bi; } + float32 r, g, b; +}; + +/// Implement and register this class with a b2World to provide debug drawing of physics +/// entities in your game. +class b2Draw +{ +public: + b2Draw(); + + virtual ~b2Draw() {} + + enum + { + e_shapeBit = 0x0001, ///< draw shapes + e_jointBit = 0x0002, ///< draw joint connections + e_aabbBit = 0x0004, ///< draw axis aligned bounding boxes + e_pairBit = 0x0008, ///< draw broad-phase pairs + e_centerOfMassBit = 0x0010 ///< draw center of mass frame + }; + + /// Set the drawing flags. + void SetFlags(uint32 flags); + + /// Get the drawing flags. + uint32 GetFlags() const; + + /// Append flags to the current flags. + void AppendFlags(uint32 flags); + + /// Clear flags from the current flags. + void ClearFlags(uint32 flags); + + /// Draw a closed polygon provided in CCW order. + virtual void DrawPolygon(const b2Vec2* vertices, int32 vertexCount, const b2Color& color) = 0; + + /// Draw a solid closed polygon provided in CCW order. + virtual void DrawSolidPolygon(const b2Vec2* vertices, int32 vertexCount, const b2Color& color) = 0; + + /// Draw a circle. + virtual void DrawCircle(const b2Vec2& center, float32 radius, const b2Color& color) = 0; + + /// Draw a solid circle. + virtual void DrawSolidCircle(const b2Vec2& center, float32 radius, const b2Vec2& axis, const b2Color& color) = 0; + + /// Draw a line segment. + virtual void DrawSegment(const b2Vec2& p1, const b2Vec2& p2, const b2Color& color) = 0; + + /// Draw a transform. Choose your own length scale. + /// @param xf a transform. + virtual void DrawTransform(const b2Transform& xf) = 0; + +protected: + uint32 m_drawFlags; +}; diff --git a/external/box2d/Common/b2GrowableStack.h b/external/box2d/Common/b2GrowableStack.h new file mode 100644 index 0000000000..68809521f4 --- /dev/null +++ b/external/box2d/Common/b2GrowableStack.h @@ -0,0 +1,85 @@ +/* +* Copyright (c) 2010 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_GROWABLE_STACK_H +#define B2_GROWABLE_STACK_H +#include +#include + +/// This is a growable LIFO stack with an initial capacity of N. +/// If the stack size exceeds the initial capacity, the heap is used +/// to increase the size of the stack. +template +class b2GrowableStack +{ +public: + b2GrowableStack() + { + m_stack = m_array; + m_count = 0; + m_capacity = N; + } + + ~b2GrowableStack() + { + if (m_stack != m_array) + { + b2Free(m_stack); + m_stack = NULL; + } + } + + void Push(const T& element) + { + if (m_count == m_capacity) + { + T* old = m_stack; + m_capacity *= 2; + m_stack = (T*)b2Alloc(m_capacity * sizeof(T)); + std::memcpy(m_stack, old, m_count * sizeof(T)); + if (old != m_array) + { + b2Free(old); + } + } + + m_stack[m_count] = element; + ++m_count; + } + + T Pop() + { + b2Assert(m_count > 0); + --m_count; + return m_stack[m_count]; + } + + int32 GetCount() + { + return m_count; + } + +private: + T* m_stack; + T m_array[N]; + int32 m_count; + int32 m_capacity; +}; + + +#endif diff --git a/external/box2d/Common/b2Math.cpp b/external/box2d/Common/b2Math.cpp new file mode 100644 index 0000000000..15d68fce96 --- /dev/null +++ b/external/box2d/Common/b2Math.cpp @@ -0,0 +1,94 @@ +/* +* Copyright (c) 2007-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include + +const b2Vec2 b2Vec2_zero(0.0f, 0.0f); + +/// Solve A * x = b, where b is a column vector. This is more efficient +/// than computing the inverse in one-shot cases. +b2Vec3 b2Mat33::Solve33(const b2Vec3& b) const +{ + float32 det = b2Dot(ex, b2Cross(ey, ez)); + if (det != 0.0f) + { + det = 1.0f / det; + } + b2Vec3 x; + x.x = det * b2Dot(b, b2Cross(ey, ez)); + x.y = det * b2Dot(ex, b2Cross(b, ez)); + x.z = det * b2Dot(ex, b2Cross(ey, b)); + return x; +} + +/// Solve A * x = b, where b is a column vector. This is more efficient +/// than computing the inverse in one-shot cases. +b2Vec2 b2Mat33::Solve22(const b2Vec2& b) const +{ + float32 a11 = ex.x, a12 = ey.x, a21 = ex.y, a22 = ey.y; + float32 det = a11 * a22 - a12 * a21; + if (det != 0.0f) + { + det = 1.0f / det; + } + b2Vec2 x; + x.x = det * (a22 * b.x - a12 * b.y); + x.y = det * (a11 * b.y - a21 * b.x); + return x; +} + +/// +void b2Mat33::GetInverse22(b2Mat33* M) const +{ + float32 a = ex.x, b = ey.x, c = ex.y, d = ey.y; + float32 det = a * d - b * c; + if (det != 0.0f) + { + det = 1.0f / det; + } + + M->ex.x = det * d; M->ey.x = -det * b; M->ex.z = 0.0f; + M->ex.y = -det * c; M->ey.y = det * a; M->ey.z = 0.0f; + M->ez.x = 0.0f; M->ez.y = 0.0f; M->ez.z = 0.0f; +} + +/// Returns the zero matrix if singular. +void b2Mat33::GetSymInverse33(b2Mat33* M) const +{ + float32 det = b2Dot(ex, b2Cross(ey, ez)); + if (det != 0.0f) + { + det = 1.0f / det; + } + + float32 a11 = ex.x, a12 = ey.x, a13 = ez.x; + float32 a22 = ey.y, a23 = ez.y; + float32 a33 = ez.z; + + M->ex.x = det * (a22 * a33 - a23 * a23); + M->ex.y = det * (a13 * a23 - a12 * a33); + M->ex.z = det * (a12 * a23 - a13 * a22); + + M->ey.x = M->ex.y; + M->ey.y = det * (a11 * a33 - a13 * a13); + M->ey.z = det * (a13 * a12 - a11 * a23); + + M->ez.x = M->ex.z; + M->ez.y = M->ey.z; + M->ez.z = det * (a11 * a22 - a12 * a12); +} diff --git a/external/box2d/Common/b2Math.h b/external/box2d/Common/b2Math.h new file mode 100644 index 0000000000..a6be671139 --- /dev/null +++ b/external/box2d/Common/b2Math.h @@ -0,0 +1,738 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_MATH_H +#define B2_MATH_H + +#include + +#include +#ifndef SHP +#include +#else +#include +#endif +#include +#include + +using namespace std; + + +/// This function is used to ensure that a floating point number is +/// not a NaN or infinity. +inline bool b2IsValid(float32 x) +{ + if (x != x) + { + // NaN. + return false; + } + + float32 infinity = std::numeric_limits::infinity(); + return -infinity < x && x < infinity; +} + +/// This is a approximate yet fast inverse square-root. +inline float32 b2InvSqrt(float32 x) +{ + union + { + float32 x; + int32 i; + } convert; + + convert.x = x; + float32 xhalf = 0.5f * x; + convert.i = 0x5f3759df - (convert.i >> 1); + x = convert.x; + x = x * (1.5f - xhalf * x * x); + return x; +} + +#define b2Sqrt(x) std::sqrt(x) +#define b2Atan2(y, x) std::atan2(y, x) + +/// A 2D column vector. +struct b2Vec2 +{ + /// Default constructor does nothing (for performance). + b2Vec2() {} + + /// Construct using coordinates. + b2Vec2(float32 x, float32 y) : x(x), y(y) {} + + /// Set this vector to all zeros. + void SetZero() { x = 0.0f; y = 0.0f; } + + /// Set this vector to some specified coordinates. + void Set(float32 x_, float32 y_) { x = x_; y = y_; } + + /// Negate this vector. + b2Vec2 operator -() const { b2Vec2 v; v.Set(-x, -y); return v; } + + /// Read from and indexed element. + float32 operator () (int32 i) const + { + return (&x)[i]; + } + + /// Write to an indexed element. + float32& operator () (int32 i) + { + return (&x)[i]; + } + + /// Add a vector to this vector. + void operator += (const b2Vec2& v) + { + x += v.x; y += v.y; + } + + /// Subtract a vector from this vector. + void operator -= (const b2Vec2& v) + { + x -= v.x; y -= v.y; + } + + /// Multiply this vector by a scalar. + void operator *= (float32 a) + { + x *= a; y *= a; + } + + /// Get the length of this vector (the norm). + float32 Length() const + { + return b2Sqrt(x * x + y * y); + } + + /// Get the length squared. For performance, use this instead of + /// b2Vec2::Length (if possible). + float32 LengthSquared() const + { + return x * x + y * y; + } + + /// Convert this vector into a unit vector. Returns the length. + float32 Normalize() + { + float32 length = Length(); + if (length < b2_epsilon) + { + return 0.0f; + } + float32 invLength = 1.0f / length; + x *= invLength; + y *= invLength; + + return length; + } + + /// Does this vector contain finite coordinates? + bool IsValid() const + { + return b2IsValid(x) && b2IsValid(y); + } + + /// Get the skew vector such that dot(skew_vec, other) == cross(vec, other) + b2Vec2 Skew() const + { + return b2Vec2(-y, x); + } + + float32 x, y; +}; + +/// A 2D column vector with 3 elements. +struct b2Vec3 +{ + /// Default constructor does nothing (for performance). + b2Vec3() {} + + /// Construct using coordinates. + b2Vec3(float32 x, float32 y, float32 z) : x(x), y(y), z(z) {} + + /// Set this vector to all zeros. + void SetZero() { x = 0.0f; y = 0.0f; z = 0.0f; } + + /// Set this vector to some specified coordinates. + void Set(float32 x_, float32 y_, float32 z_) { x = x_; y = y_; z = z_; } + + /// Negate this vector. + b2Vec3 operator -() const { b2Vec3 v; v.Set(-x, -y, -z); return v; } + + /// Add a vector to this vector. + void operator += (const b2Vec3& v) + { + x += v.x; y += v.y; z += v.z; + } + + /// Subtract a vector from this vector. + void operator -= (const b2Vec3& v) + { + x -= v.x; y -= v.y; z -= v.z; + } + + /// Multiply this vector by a scalar. + void operator *= (float32 s) + { + x *= s; y *= s; z *= s; + } + + float32 x, y, z; +}; + +/// A 2-by-2 matrix. Stored in column-major order. +struct b2Mat22 +{ + /// The default constructor does nothing (for performance). + b2Mat22() {} + + /// Construct this matrix using columns. + b2Mat22(const b2Vec2& c1, const b2Vec2& c2) + { + ex = c1; + ey = c2; + } + + /// Construct this matrix using scalars. + b2Mat22(float32 a11, float32 a12, float32 a21, float32 a22) + { + ex.x = a11; ex.y = a21; + ey.x = a12; ey.y = a22; + } + + /// Initialize this matrix using columns. + void Set(const b2Vec2& c1, const b2Vec2& c2) + { + ex = c1; + ey = c2; + } + + /// Set this to the identity matrix. + void SetIdentity() + { + ex.x = 1.0f; ey.x = 0.0f; + ex.y = 0.0f; ey.y = 1.0f; + } + + /// Set this matrix to all zeros. + void SetZero() + { + ex.x = 0.0f; ey.x = 0.0f; + ex.y = 0.0f; ey.y = 0.0f; + } + + b2Mat22 GetInverse() const + { + float32 a = ex.x, b = ey.x, c = ex.y, d = ey.y; + b2Mat22 B; + float32 det = a * d - b * c; + if (det != 0.0f) + { + det = 1.0f / det; + } + B.ex.x = det * d; B.ey.x = -det * b; + B.ex.y = -det * c; B.ey.y = det * a; + return B; + } + + /// Solve A * x = b, where b is a column vector. This is more efficient + /// than computing the inverse in one-shot cases. + b2Vec2 Solve(const b2Vec2& b) const + { + float32 a11 = ex.x, a12 = ey.x, a21 = ex.y, a22 = ey.y; + float32 det = a11 * a22 - a12 * a21; + if (det != 0.0f) + { + det = 1.0f / det; + } + b2Vec2 x; + x.x = det * (a22 * b.x - a12 * b.y); + x.y = det * (a11 * b.y - a21 * b.x); + return x; + } + + b2Vec2 ex, ey; +}; + +/// A 3-by-3 matrix. Stored in column-major order. +struct b2Mat33 +{ + /// The default constructor does nothing (for performance). + b2Mat33() {} + + /// Construct this matrix using columns. + b2Mat33(const b2Vec3& c1, const b2Vec3& c2, const b2Vec3& c3) + { + ex = c1; + ey = c2; + ez = c3; + } + + /// Set this matrix to all zeros. + void SetZero() + { + ex.SetZero(); + ey.SetZero(); + ez.SetZero(); + } + + /// Solve A * x = b, where b is a column vector. This is more efficient + /// than computing the inverse in one-shot cases. + b2Vec3 Solve33(const b2Vec3& b) const; + + /// Solve A * x = b, where b is a column vector. This is more efficient + /// than computing the inverse in one-shot cases. Solve only the upper + /// 2-by-2 matrix equation. + b2Vec2 Solve22(const b2Vec2& b) const; + + /// Get the inverse of this matrix as a 2-by-2. + /// Returns the zero matrix if singular. + void GetInverse22(b2Mat33* M) const; + + /// Get the symmetric inverse of this matrix as a 3-by-3. + /// Returns the zero matrix if singular. + void GetSymInverse33(b2Mat33* M) const; + + b2Vec3 ex, ey, ez; +}; + +/// Rotation +struct b2Rot +{ + b2Rot() {} + + /// Initialize from an angle in radians + explicit b2Rot(float32 angle) + { + /// TODO_ERIN optimize + s = sinf(angle); + c = cosf(angle); + } + + /// Set using an angle in radians. + void Set(float32 angle) + { + /// TODO_ERIN optimize + s = sinf(angle); + c = cosf(angle); + } + + /// Set to the identity rotation + void SetIdentity() + { + s = 0.0f; + c = 1.0f; + } + + /// Get the angle in radians + float32 GetAngle() const + { + return b2Atan2(s, c); + } + + /// Get the x-axis + b2Vec2 GetXAxis() const + { + return b2Vec2(c, s); + } + + /// Get the u-axis + b2Vec2 GetYAxis() const + { + return b2Vec2(-s, c); + } + + /// Sine and cosine + float32 s, c; +}; + +/// A transform contains translation and rotation. It is used to represent +/// the position and orientation of rigid frames. +struct b2Transform +{ + /// The default constructor does nothing. + b2Transform() {} + + /// Initialize using a position vector and a rotation. + b2Transform(const b2Vec2& position, const b2Rot& rotation) : p(position), q(rotation) {} + + /// Set this to the identity transform. + void SetIdentity() + { + p.SetZero(); + q.SetIdentity(); + } + + /// Set this based on the position and angle. + void Set(const b2Vec2& position, float32 angle) + { + p = position; + q.Set(angle); + } + + b2Vec2 p; + b2Rot q; +}; + +/// This describes the motion of a body/shape for TOI computation. +/// Shapes are defined with respect to the body origin, which may +/// no coincide with the center of mass. However, to support dynamics +/// we must interpolate the center of mass position. +struct b2Sweep +{ + /// Get the interpolated transform at a specific time. + /// @param beta is a factor in [0,1], where 0 indicates alpha0. + void GetTransform(b2Transform* xfb, float32 beta) const; + + /// Advance the sweep forward, yielding a new initial state. + /// @param alpha the new initial time. + void Advance(float32 alpha); + + /// Normalize the angles. + void Normalize(); + + b2Vec2 localCenter; ///< local center of mass position + b2Vec2 c0, c; ///< center world positions + float32 a0, a; ///< world angles + + /// Fraction of the current time step in the range [0,1] + /// c0 and a0 are the positions at alpha0. + float32 alpha0; +}; + +/// Useful constant +extern const b2Vec2 b2Vec2_zero; + +/// Perform the dot product on two vectors. +inline float32 b2Dot(const b2Vec2& a, const b2Vec2& b) +{ + return a.x * b.x + a.y * b.y; +} + +/// Perform the cross product on two vectors. In 2D this produces a scalar. +inline float32 b2Cross(const b2Vec2& a, const b2Vec2& b) +{ + return a.x * b.y - a.y * b.x; +} + +/// Perform the cross product on a vector and a scalar. In 2D this produces +/// a vector. +inline b2Vec2 b2Cross(const b2Vec2& a, float32 s) +{ + return b2Vec2(s * a.y, -s * a.x); +} + +/// Perform the cross product on a scalar and a vector. In 2D this produces +/// a vector. +inline b2Vec2 b2Cross(float32 s, const b2Vec2& a) +{ + return b2Vec2(-s * a.y, s * a.x); +} + +/// Multiply a matrix times a vector. If a rotation matrix is provided, +/// then this transforms the vector from one frame to another. +inline b2Vec2 b2Mul(const b2Mat22& A, const b2Vec2& v) +{ + return b2Vec2(A.ex.x * v.x + A.ey.x * v.y, A.ex.y * v.x + A.ey.y * v.y); +} + +/// Multiply a matrix transpose times a vector. If a rotation matrix is provided, +/// then this transforms the vector from one frame to another (inverse transform). +inline b2Vec2 b2MulT(const b2Mat22& A, const b2Vec2& v) +{ + return b2Vec2(b2Dot(v, A.ex), b2Dot(v, A.ey)); +} + +/// Add two vectors component-wise. +inline b2Vec2 operator + (const b2Vec2& a, const b2Vec2& b) +{ + return b2Vec2(a.x + b.x, a.y + b.y); +} + +/// Subtract two vectors component-wise. +inline b2Vec2 operator - (const b2Vec2& a, const b2Vec2& b) +{ + return b2Vec2(a.x - b.x, a.y - b.y); +} + +inline b2Vec2 operator * (float32 s, const b2Vec2& a) +{ + return b2Vec2(s * a.x, s * a.y); +} + +inline bool operator == (const b2Vec2& a, const b2Vec2& b) +{ + return a.x == b.x && a.y == b.y; +} + +inline float32 b2Distance(const b2Vec2& a, const b2Vec2& b) +{ + b2Vec2 c = a - b; + return c.Length(); +} + +inline float32 b2DistanceSquared(const b2Vec2& a, const b2Vec2& b) +{ + b2Vec2 c = a - b; + return b2Dot(c, c); +} + +inline b2Vec3 operator * (float32 s, const b2Vec3& a) +{ + return b2Vec3(s * a.x, s * a.y, s * a.z); +} + +/// Add two vectors component-wise. +inline b2Vec3 operator + (const b2Vec3& a, const b2Vec3& b) +{ + return b2Vec3(a.x + b.x, a.y + b.y, a.z + b.z); +} + +/// Subtract two vectors component-wise. +inline b2Vec3 operator - (const b2Vec3& a, const b2Vec3& b) +{ + return b2Vec3(a.x - b.x, a.y - b.y, a.z - b.z); +} + +/// Perform the dot product on two vectors. +inline float32 b2Dot(const b2Vec3& a, const b2Vec3& b) +{ + return a.x * b.x + a.y * b.y + a.z * b.z; +} + +/// Perform the cross product on two vectors. +inline b2Vec3 b2Cross(const b2Vec3& a, const b2Vec3& b) +{ + return b2Vec3(a.y * b.z - a.z * b.y, a.z * b.x - a.x * b.z, a.x * b.y - a.y * b.x); +} + +inline b2Mat22 operator + (const b2Mat22& A, const b2Mat22& B) +{ + return b2Mat22(A.ex + B.ex, A.ey + B.ey); +} + +// A * B +inline b2Mat22 b2Mul(const b2Mat22& A, const b2Mat22& B) +{ + return b2Mat22(b2Mul(A, B.ex), b2Mul(A, B.ey)); +} + +// A^T * B +inline b2Mat22 b2MulT(const b2Mat22& A, const b2Mat22& B) +{ + b2Vec2 c1(b2Dot(A.ex, B.ex), b2Dot(A.ey, B.ex)); + b2Vec2 c2(b2Dot(A.ex, B.ey), b2Dot(A.ey, B.ey)); + return b2Mat22(c1, c2); +} + +/// Multiply a matrix times a vector. +inline b2Vec3 b2Mul(const b2Mat33& A, const b2Vec3& v) +{ + return v.x * A.ex + v.y * A.ey + v.z * A.ez; +} + +/// Multiply a matrix times a vector. +inline b2Vec2 b2Mul22(const b2Mat33& A, const b2Vec2& v) +{ + return b2Vec2(A.ex.x * v.x + A.ey.x * v.y, A.ex.y * v.x + A.ey.y * v.y); +} + +/// Multiply two rotations: q * r +inline b2Rot b2Mul(const b2Rot& q, const b2Rot& r) +{ + // [qc -qs] * [rc -rs] = [qc*rc-qs*rs -qc*rs-qs*rc] + // [qs qc] [rs rc] [qs*rc+qc*rs -qs*rs+qc*rc] + // s = qs * rc + qc * rs + // c = qc * rc - qs * rs + b2Rot qr; + qr.s = q.s * r.c + q.c * r.s; + qr.c = q.c * r.c - q.s * r.s; + return qr; +} + +/// Transpose multiply two rotations: qT * r +inline b2Rot b2MulT(const b2Rot& q, const b2Rot& r) +{ + // [ qc qs] * [rc -rs] = [qc*rc+qs*rs -qc*rs+qs*rc] + // [-qs qc] [rs rc] [-qs*rc+qc*rs qs*rs+qc*rc] + // s = qc * rs - qs * rc + // c = qc * rc + qs * rs + b2Rot qr; + qr.s = q.c * r.s - q.s * r.c; + qr.c = q.c * r.c + q.s * r.s; + return qr; +} + +/// Rotate a vector +inline b2Vec2 b2Mul(const b2Rot& q, const b2Vec2& v) +{ + return b2Vec2(q.c * v.x - q.s * v.y, q.s * v.x + q.c * v.y); +} + +/// Inverse rotate a vector +inline b2Vec2 b2MulT(const b2Rot& q, const b2Vec2& v) +{ + return b2Vec2(q.c * v.x + q.s * v.y, -q.s * v.x + q.c * v.y); +} + +inline b2Vec2 b2Mul(const b2Transform& T, const b2Vec2& v) +{ + float32 x = (T.q.c * v.x - T.q.s * v.y) + T.p.x; + float32 y = (T.q.s * v.x + T.q.c * v.y) + T.p.y; + + return b2Vec2(x, y); +} + +inline b2Vec2 b2MulT(const b2Transform& T, const b2Vec2& v) +{ + float32 px = v.x - T.p.x; + float32 py = v.y - T.p.y; + float32 x = (T.q.c * px + T.q.s * py); + float32 y = (-T.q.s * px + T.q.c * py); + + return b2Vec2(x, y); +} + +// v2 = A.q.Rot(B.q.Rot(v1) + B.p) + A.p +// = (A.q * B.q).Rot(v1) + A.q.Rot(B.p) + A.p +inline b2Transform b2Mul(const b2Transform& A, const b2Transform& B) +{ + b2Transform C; + C.q = b2Mul(A.q, B.q); + C.p = b2Mul(A.q, B.p) + A.p; + return C; +} + +// v2 = A.q' * (B.q * v1 + B.p - A.p) +// = A.q' * B.q * v1 + A.q' * (B.p - A.p) +inline b2Transform b2MulT(const b2Transform& A, const b2Transform& B) +{ + b2Transform C; + C.q = b2MulT(A.q, B.q); + C.p = b2MulT(A.q, B.p - A.p); + return C; +} + +template +inline T b2Abs(T a) +{ + return a > T(0) ? a : -a; +} + +inline b2Vec2 b2Abs(const b2Vec2& a) +{ + return b2Vec2(b2Abs(a.x), b2Abs(a.y)); +} + +inline b2Mat22 b2Abs(const b2Mat22& A) +{ + return b2Mat22(b2Abs(A.ex), b2Abs(A.ey)); +} + +template +inline T b2Min(T a, T b) +{ + return a < b ? a : b; +} + +inline b2Vec2 b2Min(const b2Vec2& a, const b2Vec2& b) +{ + return b2Vec2(b2Min(a.x, b.x), b2Min(a.y, b.y)); +} + +template +inline T b2Max(T a, T b) +{ + return a > b ? a : b; +} + +inline b2Vec2 b2Max(const b2Vec2& a, const b2Vec2& b) +{ + return b2Vec2(b2Max(a.x, b.x), b2Max(a.y, b.y)); +} + +template +inline T b2Clamp(T a, T low, T high) +{ + return b2Max(low, b2Min(a, high)); +} + +inline b2Vec2 b2Clamp(const b2Vec2& a, const b2Vec2& low, const b2Vec2& high) +{ + return b2Max(low, b2Min(a, high)); +} + +template inline void b2Swap(T& a, T& b) +{ + T tmp = a; + a = b; + b = tmp; +} + +/// "Next Largest Power of 2 +/// Given a binary integer value x, the next largest power of 2 can be computed by a SWAR algorithm +/// that recursively "folds" the upper bits into the lower bits. This process yields a bit vector with +/// the same most significant 1 as x, but all 1's below it. Adding 1 to that value yields the next +/// largest power of 2. For a 32-bit value:" +inline uint32 b2NextPowerOfTwo(uint32 x) +{ + x |= (x >> 1); + x |= (x >> 2); + x |= (x >> 4); + x |= (x >> 8); + x |= (x >> 16); + return x + 1; +} + +inline bool b2IsPowerOfTwo(uint32 x) +{ + bool result = x > 0 && (x & (x - 1)) == 0; + return result; +} + +inline void b2Sweep::GetTransform(b2Transform* xf, float32 beta) const +{ + xf->p = (1.0f - beta) * c0 + beta * c; + float32 angle = (1.0f - beta) * a0 + beta * a; + xf->q.Set(angle); + + // Shift to origin + xf->p -= b2Mul(xf->q, localCenter); +} + +inline void b2Sweep::Advance(float32 alpha) +{ + b2Assert(alpha0 < 1.0f); + float32 beta = (alpha - alpha0) / (1.0f - alpha0); + c0 = (1.0f - beta) * c0 + beta * c; + a0 = (1.0f - beta) * a0 + beta * a; + alpha0 = alpha; +} + +/// Normalize an angle in radians to be between -pi and pi +inline void b2Sweep::Normalize() +{ + float32 twoPi = 2.0f * b2_pi; + float32 d = twoPi * floorf(a0 / twoPi); + a0 -= d; + a -= d; +} + +#endif diff --git a/external/box2d/Common/b2Settings.cpp b/external/box2d/Common/b2Settings.cpp new file mode 100644 index 0000000000..84d6f1d0e4 --- /dev/null +++ b/external/box2d/Common/b2Settings.cpp @@ -0,0 +1,61 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#ifdef SHP +#include +#include +#include +#include +#else +#include +#include +#include +#endif + + +using namespace std; + + +b2Version b2_version = {2, 2, 1}; + +// Memory allocators. Modify these to use your own allocator. +void* b2Alloc(int32 size) +{ + return malloc(size); +} + +void b2Free(void* mem) +{ + free(mem); +} + +// You can modify this to use your logging facility. +void b2Log(const char* string, ...) +{ +#if defined(SHP) + #ifdef _DEBUG + __App_info(__PRETTY_FUNCTION__ , __LINE__, string); + #endif +#else + va_list args; + va_start(args, string); + vprintf(string, args); + va_end(args); +#endif +} diff --git a/external/box2d/Common/b2Settings.h b/external/box2d/Common/b2Settings.h new file mode 100644 index 0000000000..aaf4b12ccf --- /dev/null +++ b/external/box2d/Common/b2Settings.h @@ -0,0 +1,150 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_SETTINGS_H +#define B2_SETTINGS_H + +#include +#include + +#define B2_NOT_USED(x) ((void)(x)) +#define b2Assert(A) assert(A) + +typedef signed char int8; +typedef signed short int16; +typedef signed int int32; +typedef unsigned char uint8; +typedef unsigned short uint16; +typedef unsigned int uint32; +typedef float float32; +typedef double float64; + +#define b2_maxFloat FLT_MAX +#define b2_epsilon FLT_EPSILON +#define b2_pi 3.14159265359f + +/// @file +/// Global tuning constants based on meters-kilograms-seconds (MKS) units. +/// + +// Collision + +/// The maximum number of contact points between two convex shapes. Do +/// not change this value. +#define b2_maxManifoldPoints 2 + +/// The maximum number of vertices on a convex polygon. You cannot increase +/// this too much because b2BlockAllocator has a maximum object size. +#define b2_maxPolygonVertices 8 + +/// This is used to fatten AABBs in the dynamic tree. This allows proxies +/// to move by a small amount without triggering a tree adjustment. +/// This is in meters. +#define b2_aabbExtension 0.1f + +/// This is used to fatten AABBs in the dynamic tree. This is used to predict +/// the future position based on the current displacement. +/// This is a dimensionless multiplier. +#define b2_aabbMultiplier 2.0f + +/// A small length used as a collision and constraint tolerance. Usually it is +/// chosen to be numerically significant, but visually insignificant. +#define b2_linearSlop 0.005f + +/// A small angle used as a collision and constraint tolerance. Usually it is +/// chosen to be numerically significant, but visually insignificant. +#define b2_angularSlop (2.0f / 180.0f * b2_pi) + +/// The radius of the polygon/edge shape skin. This should not be modified. Making +/// this smaller means polygons will have an insufficient buffer for continuous collision. +/// Making it larger may create artifacts for vertex collision. +#define b2_polygonRadius (2.0f * b2_linearSlop) + +/// Maximum number of sub-steps per contact in continuous physics simulation. +#define b2_maxSubSteps 8 + + +// Dynamics + +/// Maximum number of contacts to be handled to solve a TOI impact. +#define b2_maxTOIContacts 32 + +/// A velocity threshold for elastic collisions. Any collision with a relative linear +/// velocity below this threshold will be treated as inelastic. +#define b2_velocityThreshold 1.0f + +/// The maximum linear position correction used when solving constraints. This helps to +/// prevent overshoot. +#define b2_maxLinearCorrection 0.2f + +/// The maximum angular position correction used when solving constraints. This helps to +/// prevent overshoot. +#define b2_maxAngularCorrection (8.0f / 180.0f * b2_pi) + +/// The maximum linear velocity of a body. This limit is very large and is used +/// to prevent numerical problems. You shouldn't need to adjust this. +#define b2_maxTranslation 2.0f +#define b2_maxTranslationSquared (b2_maxTranslation * b2_maxTranslation) + +/// The maximum angular velocity of a body. This limit is very large and is used +/// to prevent numerical problems. You shouldn't need to adjust this. +#define b2_maxRotation (0.5f * b2_pi) +#define b2_maxRotationSquared (b2_maxRotation * b2_maxRotation) + +/// This scale factor controls how fast overlap is resolved. Ideally this would be 1 so +/// that overlap is removed in one time step. However using values close to 1 often lead +/// to overshoot. +#define b2_baumgarte 0.2f +#define b2_toiBaugarte 0.75f + + +// Sleep + +/// The time that a body must be still before it will go to sleep. +#define b2_timeToSleep 0.5f + +/// A body cannot sleep if its linear velocity is above this tolerance. +#define b2_linearSleepTolerance 0.01f + +/// A body cannot sleep if its angular velocity is above this tolerance. +#define b2_angularSleepTolerance (2.0f / 180.0f * b2_pi) + +// Memory Allocation + +/// Implement this function to use your own memory allocator. +void* b2Alloc(int32 size); + +/// If you implement b2Alloc, you should also implement this function. +void b2Free(void* mem); + +/// Logging function. +void b2Log(const char* string, ...); + +/// Version numbering scheme. +/// See http://en.wikipedia.org/wiki/Software_versioning +struct b2Version +{ + int32 major; ///< significant changes + int32 minor; ///< incremental changes + int32 revision; ///< bug fixes +}; + +/// Current version. +extern b2Version b2_version; + +#endif diff --git a/external/box2d/Common/b2StackAllocator.cpp b/external/box2d/Common/b2StackAllocator.cpp new file mode 100644 index 0000000000..3caa5d9127 --- /dev/null +++ b/external/box2d/Common/b2StackAllocator.cpp @@ -0,0 +1,83 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include + +b2StackAllocator::b2StackAllocator() +{ + m_index = 0; + m_allocation = 0; + m_maxAllocation = 0; + m_entryCount = 0; +} + +b2StackAllocator::~b2StackAllocator() +{ + b2Assert(m_index == 0); + b2Assert(m_entryCount == 0); +} + +void* b2StackAllocator::Allocate(int32 size) +{ + b2Assert(m_entryCount < b2_maxStackEntries); + + b2StackEntry* entry = m_entries + m_entryCount; + entry->size = size; + if (m_index + size > b2_stackSize) + { + entry->data = (char*)b2Alloc(size); + entry->usedMalloc = true; + } + else + { + entry->data = m_data + m_index; + entry->usedMalloc = false; + m_index += size; + } + + m_allocation += size; + m_maxAllocation = b2Max(m_maxAllocation, m_allocation); + ++m_entryCount; + + return entry->data; +} + +void b2StackAllocator::Free(void* p) +{ + b2Assert(m_entryCount > 0); + b2StackEntry* entry = m_entries + m_entryCount - 1; + b2Assert(p == entry->data); + if (entry->usedMalloc) + { + b2Free(p); + } + else + { + m_index -= entry->size; + } + m_allocation -= entry->size; + --m_entryCount; + + p = NULL; +} + +int32 b2StackAllocator::GetMaxAllocation() const +{ + return m_maxAllocation; +} diff --git a/external/box2d/Common/b2StackAllocator.h b/external/box2d/Common/b2StackAllocator.h new file mode 100644 index 0000000000..6140d0d802 --- /dev/null +++ b/external/box2d/Common/b2StackAllocator.h @@ -0,0 +1,60 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_STACK_ALLOCATOR_H +#define B2_STACK_ALLOCATOR_H + +#include + +const int32 b2_stackSize = 100 * 1024; // 100k +const int32 b2_maxStackEntries = 32; + +struct b2StackEntry +{ + char* data; + int32 size; + bool usedMalloc; +}; + +// This is a stack allocator used for fast per step allocations. +// You must nest allocate/free pairs. The code will assert +// if you try to interleave multiple allocate/free pairs. +class b2StackAllocator +{ +public: + b2StackAllocator(); + ~b2StackAllocator(); + + void* Allocate(int32 size); + void Free(void* p); + + int32 GetMaxAllocation() const; + +private: + + char m_data[b2_stackSize]; + int32 m_index; + + int32 m_allocation; + int32 m_maxAllocation; + + b2StackEntry m_entries[b2_maxStackEntries]; + int32 m_entryCount; +}; + +#endif diff --git a/external/box2d/Common/b2Timer.cpp b/external/box2d/Common/b2Timer.cpp new file mode 100644 index 0000000000..b2bee94513 --- /dev/null +++ b/external/box2d/Common/b2Timer.cpp @@ -0,0 +1,100 @@ +/* +* Copyright (c) 2011 Erin Catto http://box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include + +#if defined(_WIN32) && !defined(SHP) + +float64 b2Timer::s_invFrequency = 0.0f; + +#include + +b2Timer::b2Timer() +{ + LARGE_INTEGER largeInteger; + + if (s_invFrequency == 0.0f) + { + QueryPerformanceFrequency(&largeInteger); + s_invFrequency = float64(largeInteger.QuadPart); + if (s_invFrequency > 0.0f) + { + s_invFrequency = 1000.0f / s_invFrequency; + } + } + + QueryPerformanceCounter(&largeInteger); + m_start = float64(largeInteger.QuadPart); +} + +void b2Timer::Reset() +{ + LARGE_INTEGER largeInteger; + QueryPerformanceCounter(&largeInteger); + m_start = float64(largeInteger.QuadPart); +} + +float32 b2Timer::GetMilliseconds() const +{ + LARGE_INTEGER largeInteger; + QueryPerformanceCounter(&largeInteger); + float64 count = float64(largeInteger.QuadPart); + float32 ms = float32(s_invFrequency * (count - m_start)); + return ms; +} + +#elif defined(__linux__) || defined (__APPLE__) + +#include + +b2Timer::b2Timer() +{ + Reset(); +} + +void b2Timer::Reset() +{ + timeval t; + gettimeofday(&t, 0); + m_start_sec = t.tv_sec; + m_start_msec = t.tv_usec * 0.001f; +} + +float32 b2Timer::GetMilliseconds() const +{ + timeval t; + gettimeofday(&t, 0); + return (t.tv_sec - m_start_sec) * 1000 + t.tv_usec * 0.001f - m_start_msec; +} + +#else + +b2Timer::b2Timer() +{ +} + +void b2Timer::Reset() +{ +} + +float32 b2Timer::GetMilliseconds() const +{ + return 0.0f; +} + +#endif diff --git a/external/box2d/Common/b2Timer.h b/external/box2d/Common/b2Timer.h new file mode 100644 index 0000000000..053a107a56 --- /dev/null +++ b/external/box2d/Common/b2Timer.h @@ -0,0 +1,45 @@ +/* +* Copyright (c) 2011 Erin Catto http://box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include + +/// Timer for profiling. This has platform specific code and may +/// not work on every platform. +class b2Timer +{ +public: + + /// Constructor + b2Timer(); + + /// Reset the timer. + void Reset(); + + /// Get the time since construction or the last reset. + float32 GetMilliseconds() const; + +private: + +#if defined(_WIN32) + float64 m_start; + static float64 s_invFrequency; +#elif defined(__linux__) || defined (__APPLE__) + unsigned long m_start_sec; + unsigned long m_start_msec; +#endif +}; diff --git a/external/box2d/Dynamics/Contacts/b2ChainAndCircleContact.cpp b/external/box2d/Dynamics/Contacts/b2ChainAndCircleContact.cpp new file mode 100644 index 0000000000..4ae4c41cd3 --- /dev/null +++ b/external/box2d/Dynamics/Contacts/b2ChainAndCircleContact.cpp @@ -0,0 +1,54 @@ +/* +* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include +#include +#include + +#include +using namespace std; + +b2Contact* b2ChainAndCircleContact::Create(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator) +{ + void* mem = allocator->Allocate(sizeof(b2ChainAndCircleContact)); + return new (mem) b2ChainAndCircleContact(fixtureA, indexA, fixtureB, indexB); +} + +void b2ChainAndCircleContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) +{ + ((b2ChainAndCircleContact*)contact)->~b2ChainAndCircleContact(); + allocator->Free(contact, sizeof(b2ChainAndCircleContact)); +} + +b2ChainAndCircleContact::b2ChainAndCircleContact(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB) +: b2Contact(fixtureA, indexA, fixtureB, indexB) +{ + b2Assert(m_fixtureA->GetType() == b2Shape::e_chain); + b2Assert(m_fixtureB->GetType() == b2Shape::e_circle); +} + +void b2ChainAndCircleContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) +{ + b2ChainShape* chain = (b2ChainShape*)m_fixtureA->GetShape(); + b2EdgeShape edge; + chain->GetChildEdge(&edge, m_indexA); + b2CollideEdgeAndCircle( manifold, &edge, xfA, + (b2CircleShape*)m_fixtureB->GetShape(), xfB); +} diff --git a/external/box2d/Dynamics/Contacts/b2ChainAndCircleContact.h b/external/box2d/Dynamics/Contacts/b2ChainAndCircleContact.h new file mode 100644 index 0000000000..1cf601a61f --- /dev/null +++ b/external/box2d/Dynamics/Contacts/b2ChainAndCircleContact.h @@ -0,0 +1,39 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_CHAIN_AND_CIRCLE_CONTACT_H +#define B2_CHAIN_AND_CIRCLE_CONTACT_H + +#include + +class b2BlockAllocator; + +class b2ChainAndCircleContact : public b2Contact +{ +public: + static b2Contact* Create( b2Fixture* fixtureA, int32 indexA, + b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); + static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); + + b2ChainAndCircleContact(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB); + ~b2ChainAndCircleContact() {} + + void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB); +}; + +#endif diff --git a/external/box2d/Dynamics/Contacts/b2ChainAndPolygonContact.cpp b/external/box2d/Dynamics/Contacts/b2ChainAndPolygonContact.cpp new file mode 100644 index 0000000000..8116c34d1b --- /dev/null +++ b/external/box2d/Dynamics/Contacts/b2ChainAndPolygonContact.cpp @@ -0,0 +1,54 @@ +/* +* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include +#include +#include + +#include +using namespace std; + +b2Contact* b2ChainAndPolygonContact::Create(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator) +{ + void* mem = allocator->Allocate(sizeof(b2ChainAndPolygonContact)); + return new (mem) b2ChainAndPolygonContact(fixtureA, indexA, fixtureB, indexB); +} + +void b2ChainAndPolygonContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) +{ + ((b2ChainAndPolygonContact*)contact)->~b2ChainAndPolygonContact(); + allocator->Free(contact, sizeof(b2ChainAndPolygonContact)); +} + +b2ChainAndPolygonContact::b2ChainAndPolygonContact(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB) +: b2Contact(fixtureA, indexA, fixtureB, indexB) +{ + b2Assert(m_fixtureA->GetType() == b2Shape::e_chain); + b2Assert(m_fixtureB->GetType() == b2Shape::e_polygon); +} + +void b2ChainAndPolygonContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) +{ + b2ChainShape* chain = (b2ChainShape*)m_fixtureA->GetShape(); + b2EdgeShape edge; + chain->GetChildEdge(&edge, m_indexA); + b2CollideEdgeAndPolygon( manifold, &edge, xfA, + (b2PolygonShape*)m_fixtureB->GetShape(), xfB); +} diff --git a/external/box2d/Dynamics/Contacts/b2ChainAndPolygonContact.h b/external/box2d/Dynamics/Contacts/b2ChainAndPolygonContact.h new file mode 100644 index 0000000000..381c49b844 --- /dev/null +++ b/external/box2d/Dynamics/Contacts/b2ChainAndPolygonContact.h @@ -0,0 +1,39 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_CHAIN_AND_POLYGON_CONTACT_H +#define B2_CHAIN_AND_POLYGON_CONTACT_H + +#include + +class b2BlockAllocator; + +class b2ChainAndPolygonContact : public b2Contact +{ +public: + static b2Contact* Create( b2Fixture* fixtureA, int32 indexA, + b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); + static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); + + b2ChainAndPolygonContact(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB); + ~b2ChainAndPolygonContact() {} + + void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB); +}; + +#endif diff --git a/external/box2d/Dynamics/Contacts/b2CircleContact.cpp b/external/box2d/Dynamics/Contacts/b2CircleContact.cpp new file mode 100644 index 0000000000..2436da5132 --- /dev/null +++ b/external/box2d/Dynamics/Contacts/b2CircleContact.cpp @@ -0,0 +1,53 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include +#include +#include +#include + +#include +using namespace std; + +b2Contact* b2CircleContact::Create(b2Fixture* fixtureA, int32, b2Fixture* fixtureB, int32, b2BlockAllocator* allocator) +{ + void* mem = allocator->Allocate(sizeof(b2CircleContact)); + return new (mem) b2CircleContact(fixtureA, fixtureB); +} + +void b2CircleContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) +{ + ((b2CircleContact*)contact)->~b2CircleContact(); + allocator->Free(contact, sizeof(b2CircleContact)); +} + +b2CircleContact::b2CircleContact(b2Fixture* fixtureA, b2Fixture* fixtureB) + : b2Contact(fixtureA, 0, fixtureB, 0) +{ + b2Assert(m_fixtureA->GetType() == b2Shape::e_circle); + b2Assert(m_fixtureB->GetType() == b2Shape::e_circle); +} + +void b2CircleContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) +{ + b2CollideCircles(manifold, + (b2CircleShape*)m_fixtureA->GetShape(), xfA, + (b2CircleShape*)m_fixtureB->GetShape(), xfB); +} diff --git a/external/box2d/Dynamics/Contacts/b2CircleContact.h b/external/box2d/Dynamics/Contacts/b2CircleContact.h new file mode 100644 index 0000000000..6da056ae0d --- /dev/null +++ b/external/box2d/Dynamics/Contacts/b2CircleContact.h @@ -0,0 +1,39 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_CIRCLE_CONTACT_H +#define B2_CIRCLE_CONTACT_H + +#include + +class b2BlockAllocator; + +class b2CircleContact : public b2Contact +{ +public: + static b2Contact* Create( b2Fixture* fixtureA, int32 indexA, + b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); + static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); + + b2CircleContact(b2Fixture* fixtureA, b2Fixture* fixtureB); + ~b2CircleContact() {} + + void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB); +}; + +#endif diff --git a/external/box2d/Dynamics/Contacts/b2Contact.cpp b/external/box2d/Dynamics/Contacts/b2Contact.cpp new file mode 100644 index 0000000000..2389af6434 --- /dev/null +++ b/external/box2d/Dynamics/Contacts/b2Contact.cpp @@ -0,0 +1,240 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +b2ContactRegister b2Contact::s_registers[b2Shape::e_typeCount][b2Shape::e_typeCount]; +bool b2Contact::s_initialized = false; + +void b2Contact::InitializeRegisters() +{ + AddType(b2CircleContact::Create, b2CircleContact::Destroy, b2Shape::e_circle, b2Shape::e_circle); + AddType(b2PolygonAndCircleContact::Create, b2PolygonAndCircleContact::Destroy, b2Shape::e_polygon, b2Shape::e_circle); + AddType(b2PolygonContact::Create, b2PolygonContact::Destroy, b2Shape::e_polygon, b2Shape::e_polygon); + AddType(b2EdgeAndCircleContact::Create, b2EdgeAndCircleContact::Destroy, b2Shape::e_edge, b2Shape::e_circle); + AddType(b2EdgeAndPolygonContact::Create, b2EdgeAndPolygonContact::Destroy, b2Shape::e_edge, b2Shape::e_polygon); + AddType(b2ChainAndCircleContact::Create, b2ChainAndCircleContact::Destroy, b2Shape::e_chain, b2Shape::e_circle); + AddType(b2ChainAndPolygonContact::Create, b2ChainAndPolygonContact::Destroy, b2Shape::e_chain, b2Shape::e_polygon); +} + +void b2Contact::AddType(b2ContactCreateFcn* createFcn, b2ContactDestroyFcn* destoryFcn, + b2Shape::Type type1, b2Shape::Type type2) +{ + b2Assert(0 <= type1 && type1 < b2Shape::e_typeCount); + b2Assert(0 <= type2 && type2 < b2Shape::e_typeCount); + + s_registers[type1][type2].createFcn = createFcn; + s_registers[type1][type2].destroyFcn = destoryFcn; + s_registers[type1][type2].primary = true; + + if (type1 != type2) + { + s_registers[type2][type1].createFcn = createFcn; + s_registers[type2][type1].destroyFcn = destoryFcn; + s_registers[type2][type1].primary = false; + } +} + +b2Contact* b2Contact::Create(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator) +{ + if (s_initialized == false) + { + InitializeRegisters(); + s_initialized = true; + } + + b2Shape::Type type1 = fixtureA->GetType(); + b2Shape::Type type2 = fixtureB->GetType(); + + b2Assert(0 <= type1 && type1 < b2Shape::e_typeCount); + b2Assert(0 <= type2 && type2 < b2Shape::e_typeCount); + + b2ContactCreateFcn* createFcn = s_registers[type1][type2].createFcn; + if (createFcn) + { + if (s_registers[type1][type2].primary) + { + return createFcn(fixtureA, indexA, fixtureB, indexB, allocator); + } + else + { + return createFcn(fixtureB, indexB, fixtureA, indexA, allocator); + } + } + else + { + return NULL; + } +} + +void b2Contact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) +{ + b2Assert(s_initialized == true); + + if (contact->m_manifold.pointCount > 0) + { + contact->GetFixtureA()->GetBody()->SetAwake(true); + contact->GetFixtureB()->GetBody()->SetAwake(true); + } + + b2Shape::Type typeA = contact->GetFixtureA()->GetType(); + b2Shape::Type typeB = contact->GetFixtureB()->GetType(); + + b2Assert(0 <= typeA && typeB < b2Shape::e_typeCount); + b2Assert(0 <= typeA && typeB < b2Shape::e_typeCount); + + b2ContactDestroyFcn* destroyFcn = s_registers[typeA][typeB].destroyFcn; + destroyFcn(contact, allocator); +} + +b2Contact::b2Contact(b2Fixture* fA, int32 indexA, b2Fixture* fB, int32 indexB) +{ + m_flags = e_enabledFlag; + + m_fixtureA = fA; + m_fixtureB = fB; + + m_indexA = indexA; + m_indexB = indexB; + + m_manifold.pointCount = 0; + + m_prev = NULL; + m_next = NULL; + + m_nodeA.contact = NULL; + m_nodeA.prev = NULL; + m_nodeA.next = NULL; + m_nodeA.other = NULL; + + m_nodeB.contact = NULL; + m_nodeB.prev = NULL; + m_nodeB.next = NULL; + m_nodeB.other = NULL; + + m_toiCount = 0; + + m_friction = b2MixFriction(m_fixtureA->m_friction, m_fixtureB->m_friction); + m_restitution = b2MixRestitution(m_fixtureA->m_restitution, m_fixtureB->m_restitution); +} + +// Update the contact manifold and touching status. +// Note: do not assume the fixture AABBs are overlapping or are valid. +void b2Contact::Update(b2ContactListener* listener) +{ + b2Manifold oldManifold = m_manifold; + + // Re-enable this contact. + m_flags |= e_enabledFlag; + + bool touching = false; + bool wasTouching = (m_flags & e_touchingFlag) == e_touchingFlag; + + bool sensorA = m_fixtureA->IsSensor(); + bool sensorB = m_fixtureB->IsSensor(); + bool sensor = sensorA || sensorB; + + b2Body* bodyA = m_fixtureA->GetBody(); + b2Body* bodyB = m_fixtureB->GetBody(); + const b2Transform& xfA = bodyA->GetTransform(); + const b2Transform& xfB = bodyB->GetTransform(); + + // Is this contact a sensor? + if (sensor) + { + const b2Shape* shapeA = m_fixtureA->GetShape(); + const b2Shape* shapeB = m_fixtureB->GetShape(); + touching = b2TestOverlap(shapeA, m_indexA, shapeB, m_indexB, xfA, xfB); + + // Sensors don't generate manifolds. + m_manifold.pointCount = 0; + } + else + { + Evaluate(&m_manifold, xfA, xfB); + touching = m_manifold.pointCount > 0; + + // Match old contact ids to new contact ids and copy the + // stored impulses to warm start the solver. + for (int32 i = 0; i < m_manifold.pointCount; ++i) + { + b2ManifoldPoint* mp2 = m_manifold.points + i; + mp2->normalImpulse = 0.0f; + mp2->tangentImpulse = 0.0f; + b2ContactID id2 = mp2->id; + + for (int32 j = 0; j < oldManifold.pointCount; ++j) + { + b2ManifoldPoint* mp1 = oldManifold.points + j; + + if (mp1->id.key == id2.key) + { + mp2->normalImpulse = mp1->normalImpulse; + mp2->tangentImpulse = mp1->tangentImpulse; + break; + } + } + } + + if (touching != wasTouching) + { + bodyA->SetAwake(true); + bodyB->SetAwake(true); + } + } + + if (touching) + { + m_flags |= e_touchingFlag; + } + else + { + m_flags &= ~e_touchingFlag; + } + + if (wasTouching == false && touching == true && listener) + { + listener->BeginContact(this); + } + + if (wasTouching == true && touching == false && listener) + { + listener->EndContact(this); + } + + if (sensor == false && touching && listener) + { + listener->PreSolve(this, &oldManifold); + } +} diff --git a/external/box2d/Dynamics/Contacts/b2Contact.h b/external/box2d/Dynamics/Contacts/b2Contact.h new file mode 100644 index 0000000000..20d9403ce7 --- /dev/null +++ b/external/box2d/Dynamics/Contacts/b2Contact.h @@ -0,0 +1,331 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_CONTACT_H +#define B2_CONTACT_H + +#include +#include +#include +#include + +class b2Body; +class b2Contact; +class b2Fixture; +class b2World; +class b2BlockAllocator; +class b2StackAllocator; +class b2ContactListener; + +/// Friction mixing law. The idea is to allow either fixture to drive the restitution to zero. +/// For example, anything slides on ice. +inline float32 b2MixFriction(float32 friction1, float32 friction2) +{ + return std::sqrt(friction1 * friction2); +} + +/// Restitution mixing law. The idea is allow for anything to bounce off an inelastic surface. +/// For example, a superball bounces on anything. +inline float32 b2MixRestitution(float32 restitution1, float32 restitution2) +{ + return restitution1 > restitution2 ? restitution1 : restitution2; +} + +typedef b2Contact* b2ContactCreateFcn( b2Fixture* fixtureA, int32 indexA, + b2Fixture* fixtureB, int32 indexB, + b2BlockAllocator* allocator); +typedef void b2ContactDestroyFcn(b2Contact* contact, b2BlockAllocator* allocator); + +struct b2ContactRegister +{ + b2ContactCreateFcn* createFcn; + b2ContactDestroyFcn* destroyFcn; + bool primary; +}; + +/// A contact edge is used to connect bodies and contacts together +/// in a contact graph where each body is a node and each contact +/// is an edge. A contact edge belongs to a doubly linked list +/// maintained in each attached body. Each contact has two contact +/// nodes, one for each attached body. +struct b2ContactEdge +{ + b2Body* other; ///< provides quick access to the other body attached. + b2Contact* contact; ///< the contact + b2ContactEdge* prev; ///< the previous contact edge in the body's contact list + b2ContactEdge* next; ///< the next contact edge in the body's contact list +}; + +/// The class manages contact between two shapes. A contact exists for each overlapping +/// AABB in the broad-phase (except if filtered). Therefore a contact object may exist +/// that has no contact points. +class b2Contact +{ +public: + + /// Get the contact manifold. Do not modify the manifold unless you understand the + /// internals of Box2D. + b2Manifold* GetManifold(); + const b2Manifold* GetManifold() const; + + /// Get the world manifold. + void GetWorldManifold(b2WorldManifold* worldManifold) const; + + /// Is this contact touching? + bool IsTouching() const; + + /// Enable/disable this contact. This can be used inside the pre-solve + /// contact listener. The contact is only disabled for the current + /// time step (or sub-step in continuous collisions). + void SetEnabled(bool flag); + + /// Has this contact been disabled? + bool IsEnabled() const; + + /// Get the next contact in the world's contact list. + b2Contact* GetNext(); + const b2Contact* GetNext() const; + + /// Get fixture A in this contact. + b2Fixture* GetFixtureA(); + const b2Fixture* GetFixtureA() const; + + /// Get the child primitive index for fixture A. + int32 GetChildIndexA() const; + + /// Get fixture B in this contact. + b2Fixture* GetFixtureB(); + const b2Fixture* GetFixtureB() const; + + /// Get the child primitive index for fixture B. + int32 GetChildIndexB() const; + + /// Override the default friction mixture. You can call this in b2ContactListener::PreSolve. + /// This value persists until set or reset. + void SetFriction(float32 friction); + + /// Get the friction. + float32 GetFriction() const; + + /// Reset the friction mixture to the default value. + void ResetFriction(); + + /// Override the default restitution mixture. You can call this in b2ContactListener::PreSolve. + /// The value persists until you set or reset. + void SetRestitution(float32 restitution); + + /// Get the restitution. + float32 GetRestitution() const; + + /// Reset the restitution to the default value. + void ResetRestitution(); + + /// Evaluate this contact with your own manifold and transforms. + virtual void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) = 0; + +protected: + friend class b2ContactManager; + friend class b2World; + friend class b2ContactSolver; + friend class b2Body; + friend class b2Fixture; + + // Flags stored in m_flags + enum + { + // Used when crawling contact graph when forming islands. + e_islandFlag = 0x0001, + + // Set when the shapes are touching. + e_touchingFlag = 0x0002, + + // This contact can be disabled (by user) + e_enabledFlag = 0x0004, + + // This contact needs filtering because a fixture filter was changed. + e_filterFlag = 0x0008, + + // This bullet contact had a TOI event + e_bulletHitFlag = 0x0010, + + // This contact has a valid TOI in m_toi + e_toiFlag = 0x0020 + }; + + /// Flag this contact for filtering. Filtering will occur the next time step. + void FlagForFiltering(); + + static void AddType(b2ContactCreateFcn* createFcn, b2ContactDestroyFcn* destroyFcn, + b2Shape::Type typeA, b2Shape::Type typeB); + static void InitializeRegisters(); + static b2Contact* Create(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); + static void Destroy(b2Contact* contact, b2Shape::Type typeA, b2Shape::Type typeB, b2BlockAllocator* allocator); + static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); + + b2Contact() : m_fixtureA(NULL), m_fixtureB(NULL) {} + b2Contact(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB); + virtual ~b2Contact() {} + + void Update(b2ContactListener* listener); + + static b2ContactRegister s_registers[b2Shape::e_typeCount][b2Shape::e_typeCount]; + static bool s_initialized; + + uint32 m_flags; + + // World pool and list pointers. + b2Contact* m_prev; + b2Contact* m_next; + + // Nodes for connecting bodies. + b2ContactEdge m_nodeA; + b2ContactEdge m_nodeB; + + b2Fixture* m_fixtureA; + b2Fixture* m_fixtureB; + + int32 m_indexA; + int32 m_indexB; + + b2Manifold m_manifold; + + int32 m_toiCount; + float32 m_toi; + + float32 m_friction; + float32 m_restitution; +}; + +inline b2Manifold* b2Contact::GetManifold() +{ + return &m_manifold; +} + +inline const b2Manifold* b2Contact::GetManifold() const +{ + return &m_manifold; +} + +inline void b2Contact::GetWorldManifold(b2WorldManifold* worldManifold) const +{ + const b2Body* bodyA = m_fixtureA->GetBody(); + const b2Body* bodyB = m_fixtureB->GetBody(); + const b2Shape* shapeA = m_fixtureA->GetShape(); + const b2Shape* shapeB = m_fixtureB->GetShape(); + + worldManifold->Initialize(&m_manifold, bodyA->GetTransform(), shapeA->m_radius, bodyB->GetTransform(), shapeB->m_radius); +} + +inline void b2Contact::SetEnabled(bool flag) +{ + if (flag) + { + m_flags |= e_enabledFlag; + } + else + { + m_flags &= ~e_enabledFlag; + } +} + +inline bool b2Contact::IsEnabled() const +{ + return (m_flags & e_enabledFlag) == e_enabledFlag; +} + +inline bool b2Contact::IsTouching() const +{ + return (m_flags & e_touchingFlag) == e_touchingFlag; +} + +inline b2Contact* b2Contact::GetNext() +{ + return m_next; +} + +inline const b2Contact* b2Contact::GetNext() const +{ + return m_next; +} + +inline b2Fixture* b2Contact::GetFixtureA() +{ + return m_fixtureA; +} + +inline const b2Fixture* b2Contact::GetFixtureA() const +{ + return m_fixtureA; +} + +inline b2Fixture* b2Contact::GetFixtureB() +{ + return m_fixtureB; +} + +inline int32 b2Contact::GetChildIndexA() const +{ + return m_indexA; +} + +inline const b2Fixture* b2Contact::GetFixtureB() const +{ + return m_fixtureB; +} + +inline int32 b2Contact::GetChildIndexB() const +{ + return m_indexB; +} + +inline void b2Contact::FlagForFiltering() +{ + m_flags |= e_filterFlag; +} + +inline void b2Contact::SetFriction(float32 friction) +{ + m_friction = friction; +} + +inline float32 b2Contact::GetFriction() const +{ + return m_friction; +} + +inline void b2Contact::ResetFriction() +{ + m_friction = b2MixFriction(m_fixtureA->m_friction, m_fixtureB->m_friction); +} + +inline void b2Contact::SetRestitution(float32 restitution) +{ + m_restitution = restitution; +} + +inline float32 b2Contact::GetRestitution() const +{ + return m_restitution; +} + +inline void b2Contact::ResetRestitution() +{ + m_restitution = b2MixRestitution(m_fixtureA->m_restitution, m_fixtureB->m_restitution); +} + +#endif diff --git a/external/box2d/Dynamics/Contacts/b2ContactSolver.cpp b/external/box2d/Dynamics/Contacts/b2ContactSolver.cpp new file mode 100644 index 0000000000..0dc740342a --- /dev/null +++ b/external/box2d/Dynamics/Contacts/b2ContactSolver.cpp @@ -0,0 +1,832 @@ +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include + +#include +#include +#include +#include +#include + +#define B2_DEBUG_SOLVER 0 + +struct b2ContactPositionConstraint +{ + b2Vec2 localPoints[b2_maxManifoldPoints]; + b2Vec2 localNormal; + b2Vec2 localPoint; + int32 indexA; + int32 indexB; + float32 invMassA, invMassB; + b2Vec2 localCenterA, localCenterB; + float32 invIA, invIB; + b2Manifold::Type type; + float32 radiusA, radiusB; + int32 pointCount; +}; + +b2ContactSolver::b2ContactSolver(b2ContactSolverDef* def) +{ + m_step = def->step; + m_allocator = def->allocator; + m_count = def->count; + m_positionConstraints = (b2ContactPositionConstraint*)m_allocator->Allocate(m_count * sizeof(b2ContactPositionConstraint)); + m_velocityConstraints = (b2ContactVelocityConstraint*)m_allocator->Allocate(m_count * sizeof(b2ContactVelocityConstraint)); + m_positions = def->positions; + m_velocities = def->velocities; + m_contacts = def->contacts; + + // Initialize position independent portions of the constraints. + for (int32 i = 0; i < m_count; ++i) + { + b2Contact* contact = m_contacts[i]; + + b2Fixture* fixtureA = contact->m_fixtureA; + b2Fixture* fixtureB = contact->m_fixtureB; + b2Shape* shapeA = fixtureA->GetShape(); + b2Shape* shapeB = fixtureB->GetShape(); + float32 radiusA = shapeA->m_radius; + float32 radiusB = shapeB->m_radius; + b2Body* bodyA = fixtureA->GetBody(); + b2Body* bodyB = fixtureB->GetBody(); + b2Manifold* manifold = contact->GetManifold(); + + int32 pointCount = manifold->pointCount; + b2Assert(pointCount > 0); + + b2ContactVelocityConstraint* vc = m_velocityConstraints + i; + vc->friction = contact->m_friction; + vc->restitution = contact->m_restitution; + vc->indexA = bodyA->m_islandIndex; + vc->indexB = bodyB->m_islandIndex; + vc->invMassA = bodyA->m_invMass; + vc->invMassB = bodyB->m_invMass; + vc->invIA = bodyA->m_invI; + vc->invIB = bodyB->m_invI; + vc->contactIndex = i; + vc->pointCount = pointCount; + vc->K.SetZero(); + vc->normalMass.SetZero(); + + b2ContactPositionConstraint* pc = m_positionConstraints + i; + pc->indexA = bodyA->m_islandIndex; + pc->indexB = bodyB->m_islandIndex; + pc->invMassA = bodyA->m_invMass; + pc->invMassB = bodyB->m_invMass; + pc->localCenterA = bodyA->m_sweep.localCenter; + pc->localCenterB = bodyB->m_sweep.localCenter; + pc->invIA = bodyA->m_invI; + pc->invIB = bodyB->m_invI; + pc->localNormal = manifold->localNormal; + pc->localPoint = manifold->localPoint; + pc->pointCount = pointCount; + pc->radiusA = radiusA; + pc->radiusB = radiusB; + pc->type = manifold->type; + + for (int32 j = 0; j < pointCount; ++j) + { + b2ManifoldPoint* cp = manifold->points + j; + b2VelocityConstraintPoint* vcp = vc->points + j; + + if (m_step.warmStarting) + { + vcp->normalImpulse = m_step.dtRatio * cp->normalImpulse; + vcp->tangentImpulse = m_step.dtRatio * cp->tangentImpulse; + } + else + { + vcp->normalImpulse = 0.0f; + vcp->tangentImpulse = 0.0f; + } + + vcp->rA.SetZero(); + vcp->rB.SetZero(); + vcp->normalMass = 0.0f; + vcp->tangentMass = 0.0f; + vcp->velocityBias = 0.0f; + + pc->localPoints[j] = cp->localPoint; + } + } +} + +b2ContactSolver::~b2ContactSolver() +{ + m_allocator->Free(m_velocityConstraints); + m_allocator->Free(m_positionConstraints); +} + +// Initialize position dependent portions of the velocity constraints. +void b2ContactSolver::InitializeVelocityConstraints() +{ + for (int32 i = 0; i < m_count; ++i) + { + b2ContactVelocityConstraint* vc = m_velocityConstraints + i; + b2ContactPositionConstraint* pc = m_positionConstraints + i; + + float32 radiusA = pc->radiusA; + float32 radiusB = pc->radiusB; + b2Manifold* manifold = m_contacts[vc->contactIndex]->GetManifold(); + + int32 indexA = vc->indexA; + int32 indexB = vc->indexB; + + float32 mA = vc->invMassA; + float32 mB = vc->invMassB; + float32 iA = vc->invIA; + float32 iB = vc->invIB; + b2Vec2 localCenterA = pc->localCenterA; + b2Vec2 localCenterB = pc->localCenterB; + + b2Vec2 cA = m_positions[indexA].c; + float32 aA = m_positions[indexA].a; + b2Vec2 vA = m_velocities[indexA].v; + float32 wA = m_velocities[indexA].w; + + b2Vec2 cB = m_positions[indexB].c; + float32 aB = m_positions[indexB].a; + b2Vec2 vB = m_velocities[indexB].v; + float32 wB = m_velocities[indexB].w; + + b2Assert(manifold->pointCount > 0); + + b2Transform xfA, xfB; + xfA.q.Set(aA); + xfB.q.Set(aB); + xfA.p = cA - b2Mul(xfA.q, localCenterA); + xfB.p = cB - b2Mul(xfB.q, localCenterB); + + b2WorldManifold worldManifold; + worldManifold.Initialize(manifold, xfA, radiusA, xfB, radiusB); + + vc->normal = worldManifold.normal; + + int32 pointCount = vc->pointCount; + for (int32 j = 0; j < pointCount; ++j) + { + b2VelocityConstraintPoint* vcp = vc->points + j; + + vcp->rA = worldManifold.points[j] - cA; + vcp->rB = worldManifold.points[j] - cB; + + float32 rnA = b2Cross(vcp->rA, vc->normal); + float32 rnB = b2Cross(vcp->rB, vc->normal); + + float32 kNormal = mA + mB + iA * rnA * rnA + iB * rnB * rnB; + + vcp->normalMass = kNormal > 0.0f ? 1.0f / kNormal : 0.0f; + + b2Vec2 tangent = b2Cross(vc->normal, 1.0f); + + float32 rtA = b2Cross(vcp->rA, tangent); + float32 rtB = b2Cross(vcp->rB, tangent); + + float32 kTangent = mA + mB + iA * rtA * rtA + iB * rtB * rtB; + + vcp->tangentMass = kTangent > 0.0f ? 1.0f / kTangent : 0.0f; + + // Setup a velocity bias for restitution. + vcp->velocityBias = 0.0f; + float32 vRel = b2Dot(vc->normal, vB + b2Cross(wB, vcp->rB) - vA - b2Cross(wA, vcp->rA)); + if (vRel < -b2_velocityThreshold) + { + vcp->velocityBias = -vc->restitution * vRel; + } + } + + // If we have two points, then prepare the block solver. + if (vc->pointCount == 2) + { + b2VelocityConstraintPoint* vcp1 = vc->points + 0; + b2VelocityConstraintPoint* vcp2 = vc->points + 1; + + float32 rn1A = b2Cross(vcp1->rA, vc->normal); + float32 rn1B = b2Cross(vcp1->rB, vc->normal); + float32 rn2A = b2Cross(vcp2->rA, vc->normal); + float32 rn2B = b2Cross(vcp2->rB, vc->normal); + + float32 k11 = mA + mB + iA * rn1A * rn1A + iB * rn1B * rn1B; + float32 k22 = mA + mB + iA * rn2A * rn2A + iB * rn2B * rn2B; + float32 k12 = mA + mB + iA * rn1A * rn2A + iB * rn1B * rn2B; + + // Ensure a reasonable condition number. + const float32 k_maxConditionNumber = 1000.0f; + if (k11 * k11 < k_maxConditionNumber * (k11 * k22 - k12 * k12)) + { + // K is safe to invert. + vc->K.ex.Set(k11, k12); + vc->K.ey.Set(k12, k22); + vc->normalMass = vc->K.GetInverse(); + } + else + { + // The constraints are redundant, just use one. + // TODO_ERIN use deepest? + vc->pointCount = 1; + } + } + } +} + +void b2ContactSolver::WarmStart() +{ + // Warm start. + for (int32 i = 0; i < m_count; ++i) + { + b2ContactVelocityConstraint* vc = m_velocityConstraints + i; + + int32 indexA = vc->indexA; + int32 indexB = vc->indexB; + float32 mA = vc->invMassA; + float32 iA = vc->invIA; + float32 mB = vc->invMassB; + float32 iB = vc->invIB; + int32 pointCount = vc->pointCount; + + b2Vec2 vA = m_velocities[indexA].v; + float32 wA = m_velocities[indexA].w; + b2Vec2 vB = m_velocities[indexB].v; + float32 wB = m_velocities[indexB].w; + + b2Vec2 normal = vc->normal; + b2Vec2 tangent = b2Cross(normal, 1.0f); + + for (int32 j = 0; j < pointCount; ++j) + { + b2VelocityConstraintPoint* vcp = vc->points + j; + b2Vec2 P = vcp->normalImpulse * normal + vcp->tangentImpulse * tangent; + wA -= iA * b2Cross(vcp->rA, P); + vA -= mA * P; + wB += iB * b2Cross(vcp->rB, P); + vB += mB * P; + } + + m_velocities[indexA].v = vA; + m_velocities[indexA].w = wA; + m_velocities[indexB].v = vB; + m_velocities[indexB].w = wB; + } +} + +void b2ContactSolver::SolveVelocityConstraints() +{ + for (int32 i = 0; i < m_count; ++i) + { + b2ContactVelocityConstraint* vc = m_velocityConstraints + i; + + int32 indexA = vc->indexA; + int32 indexB = vc->indexB; + float32 mA = vc->invMassA; + float32 iA = vc->invIA; + float32 mB = vc->invMassB; + float32 iB = vc->invIB; + int32 pointCount = vc->pointCount; + + b2Vec2 vA = m_velocities[indexA].v; + float32 wA = m_velocities[indexA].w; + b2Vec2 vB = m_velocities[indexB].v; + float32 wB = m_velocities[indexB].w; + + b2Vec2 normal = vc->normal; + b2Vec2 tangent = b2Cross(normal, 1.0f); + float32 friction = vc->friction; + + b2Assert(pointCount == 1 || pointCount == 2); + + // Solve tangent constraints first because non-penetration is more important + // than friction. + for (int32 j = 0; j < pointCount; ++j) + { + b2VelocityConstraintPoint* vcp = vc->points + j; + + // Relative velocity at contact + b2Vec2 dv = vB + b2Cross(wB, vcp->rB) - vA - b2Cross(wA, vcp->rA); + + // Compute tangent force + float32 vt = b2Dot(dv, tangent); + float32 lambda = vcp->tangentMass * (-vt); + + // b2Clamp the accumulated force + float32 maxFriction = friction * vcp->normalImpulse; + float32 newImpulse = b2Clamp(vcp->tangentImpulse + lambda, -maxFriction, maxFriction); + lambda = newImpulse - vcp->tangentImpulse; + vcp->tangentImpulse = newImpulse; + + // Apply contact impulse + b2Vec2 P = lambda * tangent; + + vA -= mA * P; + wA -= iA * b2Cross(vcp->rA, P); + + vB += mB * P; + wB += iB * b2Cross(vcp->rB, P); + } + + // Solve normal constraints + if (vc->pointCount == 1) + { + b2VelocityConstraintPoint* vcp = vc->points + 0; + + // Relative velocity at contact + b2Vec2 dv = vB + b2Cross(wB, vcp->rB) - vA - b2Cross(wA, vcp->rA); + + // Compute normal impulse + float32 vn = b2Dot(dv, normal); + float32 lambda = -vcp->normalMass * (vn - vcp->velocityBias); + + // b2Clamp the accumulated impulse + float32 newImpulse = b2Max(vcp->normalImpulse + lambda, 0.0f); + lambda = newImpulse - vcp->normalImpulse; + vcp->normalImpulse = newImpulse; + + // Apply contact impulse + b2Vec2 P = lambda * normal; + vA -= mA * P; + wA -= iA * b2Cross(vcp->rA, P); + + vB += mB * P; + wB += iB * b2Cross(vcp->rB, P); + } + else + { + // Block solver developed in collaboration with Dirk Gregorius (back in 01/07 on Box2D_Lite). + // Build the mini LCP for this contact patch + // + // vn = A * x + b, vn >= 0, , vn >= 0, x >= 0 and vn_i * x_i = 0 with i = 1..2 + // + // A = J * W * JT and J = ( -n, -r1 x n, n, r2 x n ) + // b = vn0 - velocityBias + // + // The system is solved using the "Total enumeration method" (s. Murty). The complementary constraint vn_i * x_i + // implies that we must have in any solution either vn_i = 0 or x_i = 0. So for the 2D contact problem the cases + // vn1 = 0 and vn2 = 0, x1 = 0 and x2 = 0, x1 = 0 and vn2 = 0, x2 = 0 and vn1 = 0 need to be tested. The first valid + // solution that satisfies the problem is chosen. + // + // In order to account of the accumulated impulse 'a' (because of the iterative nature of the solver which only requires + // that the accumulated impulse is clamped and not the incremental impulse) we change the impulse variable (x_i). + // + // Substitute: + // + // x = a + d + // + // a := old total impulse + // x := new total impulse + // d := incremental impulse + // + // For the current iteration we extend the formula for the incremental impulse + // to compute the new total impulse: + // + // vn = A * d + b + // = A * (x - a) + b + // = A * x + b - A * a + // = A * x + b' + // b' = b - A * a; + + b2VelocityConstraintPoint* cp1 = vc->points + 0; + b2VelocityConstraintPoint* cp2 = vc->points + 1; + + b2Vec2 a(cp1->normalImpulse, cp2->normalImpulse); + b2Assert(a.x >= 0.0f && a.y >= 0.0f); + + // Relative velocity at contact + b2Vec2 dv1 = vB + b2Cross(wB, cp1->rB) - vA - b2Cross(wA, cp1->rA); + b2Vec2 dv2 = vB + b2Cross(wB, cp2->rB) - vA - b2Cross(wA, cp2->rA); + + // Compute normal velocity + float32 vn1 = b2Dot(dv1, normal); + float32 vn2 = b2Dot(dv2, normal); + + b2Vec2 b; + b.x = vn1 - cp1->velocityBias; + b.y = vn2 - cp2->velocityBias; + + // Compute b' + b -= b2Mul(vc->K, a); + + const float32 k_errorTol = 1e-3f; + B2_NOT_USED(k_errorTol); + + for (;;) + { + // + // Case 1: vn = 0 + // + // 0 = A * x + b' + // + // Solve for x: + // + // x = - inv(A) * b' + // + b2Vec2 x = - b2Mul(vc->normalMass, b); + + if (x.x >= 0.0f && x.y >= 0.0f) + { + // Get the incremental impulse + b2Vec2 d = x - a; + + // Apply incremental impulse + b2Vec2 P1 = d.x * normal; + b2Vec2 P2 = d.y * normal; + vA -= mA * (P1 + P2); + wA -= iA * (b2Cross(cp1->rA, P1) + b2Cross(cp2->rA, P2)); + + vB += mB * (P1 + P2); + wB += iB * (b2Cross(cp1->rB, P1) + b2Cross(cp2->rB, P2)); + + // Accumulate + cp1->normalImpulse = x.x; + cp2->normalImpulse = x.y; + +#if B2_DEBUG_SOLVER == 1 + // Postconditions + dv1 = vB + b2Cross(wB, cp1->rB) - vA - b2Cross(wA, cp1->rA); + dv2 = vB + b2Cross(wB, cp2->rB) - vA - b2Cross(wA, cp2->rA); + + // Compute normal velocity + vn1 = b2Dot(dv1, normal); + vn2 = b2Dot(dv2, normal); + + b2Assert(b2Abs(vn1 - cp1->velocityBias) < k_errorTol); + b2Assert(b2Abs(vn2 - cp2->velocityBias) < k_errorTol); +#endif + break; + } + + // + // Case 2: vn1 = 0 and x2 = 0 + // + // 0 = a11 * x1 + a12 * 0 + b1' + // vn2 = a21 * x1 + a22 * 0 + b2' + // + x.x = - cp1->normalMass * b.x; + x.y = 0.0f; + vn1 = 0.0f; + vn2 = vc->K.ex.y * x.x + b.y; + + if (x.x >= 0.0f && vn2 >= 0.0f) + { + // Get the incremental impulse + b2Vec2 d = x - a; + + // Apply incremental impulse + b2Vec2 P1 = d.x * normal; + b2Vec2 P2 = d.y * normal; + vA -= mA * (P1 + P2); + wA -= iA * (b2Cross(cp1->rA, P1) + b2Cross(cp2->rA, P2)); + + vB += mB * (P1 + P2); + wB += iB * (b2Cross(cp1->rB, P1) + b2Cross(cp2->rB, P2)); + + // Accumulate + cp1->normalImpulse = x.x; + cp2->normalImpulse = x.y; + +#if B2_DEBUG_SOLVER == 1 + // Postconditions + dv1 = vB + b2Cross(wB, cp1->rB) - vA - b2Cross(wA, cp1->rA); + + // Compute normal velocity + vn1 = b2Dot(dv1, normal); + + b2Assert(b2Abs(vn1 - cp1->velocityBias) < k_errorTol); +#endif + break; + } + + + // + // Case 3: vn2 = 0 and x1 = 0 + // + // vn1 = a11 * 0 + a12 * x2 + b1' + // 0 = a21 * 0 + a22 * x2 + b2' + // + x.x = 0.0f; + x.y = - cp2->normalMass * b.y; + vn1 = vc->K.ey.x * x.y + b.x; + vn2 = 0.0f; + + if (x.y >= 0.0f && vn1 >= 0.0f) + { + // Resubstitute for the incremental impulse + b2Vec2 d = x - a; + + // Apply incremental impulse + b2Vec2 P1 = d.x * normal; + b2Vec2 P2 = d.y * normal; + vA -= mA * (P1 + P2); + wA -= iA * (b2Cross(cp1->rA, P1) + b2Cross(cp2->rA, P2)); + + vB += mB * (P1 + P2); + wB += iB * (b2Cross(cp1->rB, P1) + b2Cross(cp2->rB, P2)); + + // Accumulate + cp1->normalImpulse = x.x; + cp2->normalImpulse = x.y; + +#if B2_DEBUG_SOLVER == 1 + // Postconditions + dv2 = vB + b2Cross(wB, cp2->rB) - vA - b2Cross(wA, cp2->rA); + + // Compute normal velocity + vn2 = b2Dot(dv2, normal); + + b2Assert(b2Abs(vn2 - cp2->velocityBias) < k_errorTol); +#endif + break; + } + + // + // Case 4: x1 = 0 and x2 = 0 + // + // vn1 = b1 + // vn2 = b2; + x.x = 0.0f; + x.y = 0.0f; + vn1 = b.x; + vn2 = b.y; + + if (vn1 >= 0.0f && vn2 >= 0.0f ) + { + // Resubstitute for the incremental impulse + b2Vec2 d = x - a; + + // Apply incremental impulse + b2Vec2 P1 = d.x * normal; + b2Vec2 P2 = d.y * normal; + vA -= mA * (P1 + P2); + wA -= iA * (b2Cross(cp1->rA, P1) + b2Cross(cp2->rA, P2)); + + vB += mB * (P1 + P2); + wB += iB * (b2Cross(cp1->rB, P1) + b2Cross(cp2->rB, P2)); + + // Accumulate + cp1->normalImpulse = x.x; + cp2->normalImpulse = x.y; + + break; + } + + // No solution, give up. This is hit sometimes, but it doesn't seem to matter. + break; + } + } + + m_velocities[indexA].v = vA; + m_velocities[indexA].w = wA; + m_velocities[indexB].v = vB; + m_velocities[indexB].w = wB; + } +} + +void b2ContactSolver::StoreImpulses() +{ + for (int32 i = 0; i < m_count; ++i) + { + b2ContactVelocityConstraint* vc = m_velocityConstraints + i; + b2Manifold* manifold = m_contacts[vc->contactIndex]->GetManifold(); + + for (int32 j = 0; j < vc->pointCount; ++j) + { + manifold->points[j].normalImpulse = vc->points[j].normalImpulse; + manifold->points[j].tangentImpulse = vc->points[j].tangentImpulse; + } + } +} + +struct b2PositionSolverManifold +{ + void Initialize(b2ContactPositionConstraint* pc, const b2Transform& xfA, const b2Transform& xfB, int32 index) + { + b2Assert(pc->pointCount > 0); + + switch (pc->type) + { + case b2Manifold::e_circles: + { + b2Vec2 pointA = b2Mul(xfA, pc->localPoint); + b2Vec2 pointB = b2Mul(xfB, pc->localPoints[0]); + normal = pointB - pointA; + normal.Normalize(); + point = 0.5f * (pointA + pointB); + separation = b2Dot(pointB - pointA, normal) - pc->radiusA - pc->radiusB; + } + break; + + case b2Manifold::e_faceA: + { + normal = b2Mul(xfA.q, pc->localNormal); + b2Vec2 planePoint = b2Mul(xfA, pc->localPoint); + + b2Vec2 clipPoint = b2Mul(xfB, pc->localPoints[index]); + separation = b2Dot(clipPoint - planePoint, normal) - pc->radiusA - pc->radiusB; + point = clipPoint; + } + break; + + case b2Manifold::e_faceB: + { + normal = b2Mul(xfB.q, pc->localNormal); + b2Vec2 planePoint = b2Mul(xfB, pc->localPoint); + + b2Vec2 clipPoint = b2Mul(xfA, pc->localPoints[index]); + separation = b2Dot(clipPoint - planePoint, normal) - pc->radiusA - pc->radiusB; + point = clipPoint; + + // Ensure normal points from A to B + normal = -normal; + } + break; + } + } + + b2Vec2 normal; + b2Vec2 point; + float32 separation; +}; + +// Sequential solver. +bool b2ContactSolver::SolvePositionConstraints() +{ + float32 minSeparation = 0.0f; + + for (int32 i = 0; i < m_count; ++i) + { + b2ContactPositionConstraint* pc = m_positionConstraints + i; + + int32 indexA = pc->indexA; + int32 indexB = pc->indexB; + b2Vec2 localCenterA = pc->localCenterA; + float32 mA = pc->invMassA; + float32 iA = pc->invIA; + b2Vec2 localCenterB = pc->localCenterB; + float32 mB = pc->invMassB; + float32 iB = pc->invIB; + int32 pointCount = pc->pointCount; + + b2Vec2 cA = m_positions[indexA].c; + float32 aA = m_positions[indexA].a; + + b2Vec2 cB = m_positions[indexB].c; + float32 aB = m_positions[indexB].a; + + // Solve normal constraints + for (int32 j = 0; j < pointCount; ++j) + { + b2Transform xfA, xfB; + xfA.q.Set(aA); + xfB.q.Set(aB); + xfA.p = cA - b2Mul(xfA.q, localCenterA); + xfB.p = cB - b2Mul(xfB.q, localCenterB); + + b2PositionSolverManifold psm; + psm.Initialize(pc, xfA, xfB, j); + b2Vec2 normal = psm.normal; + + b2Vec2 point = psm.point; + float32 separation = psm.separation; + + b2Vec2 rA = point - cA; + b2Vec2 rB = point - cB; + + // Track max constraint error. + minSeparation = b2Min(minSeparation, separation); + + // Prevent large corrections and allow slop. + float32 C = b2Clamp(b2_baumgarte * (separation + b2_linearSlop), -b2_maxLinearCorrection, 0.0f); + + // Compute the effective mass. + float32 rnA = b2Cross(rA, normal); + float32 rnB = b2Cross(rB, normal); + float32 K = mA + mB + iA * rnA * rnA + iB * rnB * rnB; + + // Compute normal impulse + float32 impulse = K > 0.0f ? - C / K : 0.0f; + + b2Vec2 P = impulse * normal; + + cA -= mA * P; + aA -= iA * b2Cross(rA, P); + + cB += mB * P; + aB += iB * b2Cross(rB, P); + } + + m_positions[indexA].c = cA; + m_positions[indexA].a = aA; + + m_positions[indexB].c = cB; + m_positions[indexB].a = aB; + } + + // We can't expect minSpeparation >= -b2_linearSlop because we don't + // push the separation above -b2_linearSlop. + return minSeparation >= -3.0f * b2_linearSlop; +} + +// Sequential position solver for position constraints. +bool b2ContactSolver::SolveTOIPositionConstraints(int32 toiIndexA, int32 toiIndexB) +{ + float32 minSeparation = 0.0f; + + for (int32 i = 0; i < m_count; ++i) + { + b2ContactPositionConstraint* pc = m_positionConstraints + i; + + int32 indexA = pc->indexA; + int32 indexB = pc->indexB; + b2Vec2 localCenterA = pc->localCenterA; + b2Vec2 localCenterB = pc->localCenterB; + int32 pointCount = pc->pointCount; + + float32 mA = 0.0f; + float32 iA = 0.0f; + if (indexA == toiIndexA || indexA == toiIndexB) + { + mA = pc->invMassA; + iA = pc->invIA; + } + + float32 mB = pc->invMassB; + float32 iB = pc->invIB; + if (indexB == toiIndexA || indexB == toiIndexB) + { + mB = pc->invMassB; + iB = pc->invIB; + } + + b2Vec2 cA = m_positions[indexA].c; + float32 aA = m_positions[indexA].a; + + b2Vec2 cB = m_positions[indexB].c; + float32 aB = m_positions[indexB].a; + + // Solve normal constraints + for (int32 j = 0; j < pointCount; ++j) + { + b2Transform xfA, xfB; + xfA.q.Set(aA); + xfB.q.Set(aB); + xfA.p = cA - b2Mul(xfA.q, localCenterA); + xfB.p = cB - b2Mul(xfB.q, localCenterB); + + b2PositionSolverManifold psm; + psm.Initialize(pc, xfA, xfB, j); + b2Vec2 normal = psm.normal; + + b2Vec2 point = psm.point; + float32 separation = psm.separation; + + b2Vec2 rA = point - cA; + b2Vec2 rB = point - cB; + + // Track max constraint error. + minSeparation = b2Min(minSeparation, separation); + + // Prevent large corrections and allow slop. + float32 C = b2Clamp(b2_toiBaugarte * (separation + b2_linearSlop), -b2_maxLinearCorrection, 0.0f); + + // Compute the effective mass. + float32 rnA = b2Cross(rA, normal); + float32 rnB = b2Cross(rB, normal); + float32 K = mA + mB + iA * rnA * rnA + iB * rnB * rnB; + + // Compute normal impulse + float32 impulse = K > 0.0f ? - C / K : 0.0f; + + b2Vec2 P = impulse * normal; + + cA -= mA * P; + aA -= iA * b2Cross(rA, P); + + cB += mB * P; + aB += iB * b2Cross(rB, P); + } + + m_positions[indexA].c = cA; + m_positions[indexA].a = aA; + + m_positions[indexB].c = cB; + m_positions[indexB].a = aB; + } + + // We can't expect minSpeparation >= -b2_linearSlop because we don't + // push the separation above -b2_linearSlop. + return minSeparation >= -1.5f * b2_linearSlop; +} diff --git a/external/box2d/Dynamics/Contacts/b2ContactSolver.h b/external/box2d/Dynamics/Contacts/b2ContactSolver.h new file mode 100644 index 0000000000..aef1987a9e --- /dev/null +++ b/external/box2d/Dynamics/Contacts/b2ContactSolver.h @@ -0,0 +1,94 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_CONTACT_SOLVER_H +#define B2_CONTACT_SOLVER_H + +#include +#include +#include + +class b2Contact; +class b2Body; +class b2StackAllocator; +struct b2ContactPositionConstraint; + +struct b2VelocityConstraintPoint +{ + b2Vec2 rA; + b2Vec2 rB; + float32 normalImpulse; + float32 tangentImpulse; + float32 normalMass; + float32 tangentMass; + float32 velocityBias; +}; + +struct b2ContactVelocityConstraint +{ + b2VelocityConstraintPoint points[b2_maxManifoldPoints]; + b2Vec2 normal; + b2Mat22 normalMass; + b2Mat22 K; + int32 indexA; + int32 indexB; + float32 invMassA, invMassB; + float32 invIA, invIB; + float32 friction; + float32 restitution; + int32 pointCount; + int32 contactIndex; +}; + +struct b2ContactSolverDef +{ + b2TimeStep step; + b2Contact** contacts; + int32 count; + b2Position* positions; + b2Velocity* velocities; + b2StackAllocator* allocator; +}; + +class b2ContactSolver +{ +public: + b2ContactSolver(b2ContactSolverDef* def); + ~b2ContactSolver(); + + void InitializeVelocityConstraints(); + + void WarmStart(); + void SolveVelocityConstraints(); + void StoreImpulses(); + + bool SolvePositionConstraints(); + bool SolveTOIPositionConstraints(int32 toiIndexA, int32 toiIndexB); + + b2TimeStep m_step; + b2Position* m_positions; + b2Velocity* m_velocities; + b2StackAllocator* m_allocator; + b2ContactPositionConstraint* m_positionConstraints; + b2ContactVelocityConstraint* m_velocityConstraints; + b2Contact** m_contacts; + int m_count; +}; + +#endif + diff --git a/external/box2d/Dynamics/Contacts/b2EdgeAndCircleContact.cpp b/external/box2d/Dynamics/Contacts/b2EdgeAndCircleContact.cpp new file mode 100644 index 0000000000..aade42880a --- /dev/null +++ b/external/box2d/Dynamics/Contacts/b2EdgeAndCircleContact.cpp @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include + +#include +using namespace std; + +b2Contact* b2EdgeAndCircleContact::Create(b2Fixture* fixtureA, int32, b2Fixture* fixtureB, int32, b2BlockAllocator* allocator) +{ + void* mem = allocator->Allocate(sizeof(b2EdgeAndCircleContact)); + return new (mem) b2EdgeAndCircleContact(fixtureA, fixtureB); +} + +void b2EdgeAndCircleContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) +{ + ((b2EdgeAndCircleContact*)contact)->~b2EdgeAndCircleContact(); + allocator->Free(contact, sizeof(b2EdgeAndCircleContact)); +} + +b2EdgeAndCircleContact::b2EdgeAndCircleContact(b2Fixture* fixtureA, b2Fixture* fixtureB) +: b2Contact(fixtureA, 0, fixtureB, 0) +{ + b2Assert(m_fixtureA->GetType() == b2Shape::e_edge); + b2Assert(m_fixtureB->GetType() == b2Shape::e_circle); +} + +void b2EdgeAndCircleContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) +{ + b2CollideEdgeAndCircle( manifold, + (b2EdgeShape*)m_fixtureA->GetShape(), xfA, + (b2CircleShape*)m_fixtureB->GetShape(), xfB); +} diff --git a/external/box2d/Dynamics/Contacts/b2EdgeAndCircleContact.h b/external/box2d/Dynamics/Contacts/b2EdgeAndCircleContact.h new file mode 100644 index 0000000000..70771ec536 --- /dev/null +++ b/external/box2d/Dynamics/Contacts/b2EdgeAndCircleContact.h @@ -0,0 +1,39 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_EDGE_AND_CIRCLE_CONTACT_H +#define B2_EDGE_AND_CIRCLE_CONTACT_H + +#include + +class b2BlockAllocator; + +class b2EdgeAndCircleContact : public b2Contact +{ +public: + static b2Contact* Create( b2Fixture* fixtureA, int32 indexA, + b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); + static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); + + b2EdgeAndCircleContact(b2Fixture* fixtureA, b2Fixture* fixtureB); + ~b2EdgeAndCircleContact() {} + + void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB); +}; + +#endif diff --git a/external/box2d/Dynamics/Contacts/b2EdgeAndPolygonContact.cpp b/external/box2d/Dynamics/Contacts/b2EdgeAndPolygonContact.cpp new file mode 100644 index 0000000000..04ce394107 --- /dev/null +++ b/external/box2d/Dynamics/Contacts/b2EdgeAndPolygonContact.cpp @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include + +#include +using namespace std; + +b2Contact* b2EdgeAndPolygonContact::Create(b2Fixture* fixtureA, int32, b2Fixture* fixtureB, int32, b2BlockAllocator* allocator) +{ + void* mem = allocator->Allocate(sizeof(b2EdgeAndPolygonContact)); + return new (mem) b2EdgeAndPolygonContact(fixtureA, fixtureB); +} + +void b2EdgeAndPolygonContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) +{ + ((b2EdgeAndPolygonContact*)contact)->~b2EdgeAndPolygonContact(); + allocator->Free(contact, sizeof(b2EdgeAndPolygonContact)); +} + +b2EdgeAndPolygonContact::b2EdgeAndPolygonContact(b2Fixture* fixtureA, b2Fixture* fixtureB) +: b2Contact(fixtureA, 0, fixtureB, 0) +{ + b2Assert(m_fixtureA->GetType() == b2Shape::e_edge); + b2Assert(m_fixtureB->GetType() == b2Shape::e_polygon); +} + +void b2EdgeAndPolygonContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) +{ + b2CollideEdgeAndPolygon( manifold, + (b2EdgeShape*)m_fixtureA->GetShape(), xfA, + (b2PolygonShape*)m_fixtureB->GetShape(), xfB); +} diff --git a/external/box2d/Dynamics/Contacts/b2EdgeAndPolygonContact.h b/external/box2d/Dynamics/Contacts/b2EdgeAndPolygonContact.h new file mode 100644 index 0000000000..f65f3acca9 --- /dev/null +++ b/external/box2d/Dynamics/Contacts/b2EdgeAndPolygonContact.h @@ -0,0 +1,39 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_EDGE_AND_POLYGON_CONTACT_H +#define B2_EDGE_AND_POLYGON_CONTACT_H + +#include + +class b2BlockAllocator; + +class b2EdgeAndPolygonContact : public b2Contact +{ +public: + static b2Contact* Create( b2Fixture* fixtureA, int32 indexA, + b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); + static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); + + b2EdgeAndPolygonContact(b2Fixture* fixtureA, b2Fixture* fixtureB); + ~b2EdgeAndPolygonContact() {} + + void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB); +}; + +#endif diff --git a/external/box2d/Dynamics/Contacts/b2PolygonAndCircleContact.cpp b/external/box2d/Dynamics/Contacts/b2PolygonAndCircleContact.cpp new file mode 100644 index 0000000000..961b26f38a --- /dev/null +++ b/external/box2d/Dynamics/Contacts/b2PolygonAndCircleContact.cpp @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include + +#include +using namespace std; + +b2Contact* b2PolygonAndCircleContact::Create(b2Fixture* fixtureA, int32, b2Fixture* fixtureB, int32, b2BlockAllocator* allocator) +{ + void* mem = allocator->Allocate(sizeof(b2PolygonAndCircleContact)); + return new (mem) b2PolygonAndCircleContact(fixtureA, fixtureB); +} + +void b2PolygonAndCircleContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) +{ + ((b2PolygonAndCircleContact*)contact)->~b2PolygonAndCircleContact(); + allocator->Free(contact, sizeof(b2PolygonAndCircleContact)); +} + +b2PolygonAndCircleContact::b2PolygonAndCircleContact(b2Fixture* fixtureA, b2Fixture* fixtureB) +: b2Contact(fixtureA, 0, fixtureB, 0) +{ + b2Assert(m_fixtureA->GetType() == b2Shape::e_polygon); + b2Assert(m_fixtureB->GetType() == b2Shape::e_circle); +} + +void b2PolygonAndCircleContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) +{ + b2CollidePolygonAndCircle( manifold, + (b2PolygonShape*)m_fixtureA->GetShape(), xfA, + (b2CircleShape*)m_fixtureB->GetShape(), xfB); +} diff --git a/external/box2d/Dynamics/Contacts/b2PolygonAndCircleContact.h b/external/box2d/Dynamics/Contacts/b2PolygonAndCircleContact.h new file mode 100644 index 0000000000..7b1a5288b4 --- /dev/null +++ b/external/box2d/Dynamics/Contacts/b2PolygonAndCircleContact.h @@ -0,0 +1,38 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_POLYGON_AND_CIRCLE_CONTACT_H +#define B2_POLYGON_AND_CIRCLE_CONTACT_H + +#include + +class b2BlockAllocator; + +class b2PolygonAndCircleContact : public b2Contact +{ +public: + static b2Contact* Create(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); + static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); + + b2PolygonAndCircleContact(b2Fixture* fixtureA, b2Fixture* fixtureB); + ~b2PolygonAndCircleContact() {} + + void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB); +}; + +#endif diff --git a/external/box2d/Dynamics/Contacts/b2PolygonContact.cpp b/external/box2d/Dynamics/Contacts/b2PolygonContact.cpp new file mode 100644 index 0000000000..a2884a440d --- /dev/null +++ b/external/box2d/Dynamics/Contacts/b2PolygonContact.cpp @@ -0,0 +1,53 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include +#include +#include +#include + +#include +using namespace std; + +b2Contact* b2PolygonContact::Create(b2Fixture* fixtureA, int32, b2Fixture* fixtureB, int32, b2BlockAllocator* allocator) +{ + void* mem = allocator->Allocate(sizeof(b2PolygonContact)); + return new (mem) b2PolygonContact(fixtureA, fixtureB); +} + +void b2PolygonContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) +{ + ((b2PolygonContact*)contact)->~b2PolygonContact(); + allocator->Free(contact, sizeof(b2PolygonContact)); +} + +b2PolygonContact::b2PolygonContact(b2Fixture* fixtureA, b2Fixture* fixtureB) + : b2Contact(fixtureA, 0, fixtureB, 0) +{ + b2Assert(m_fixtureA->GetType() == b2Shape::e_polygon); + b2Assert(m_fixtureB->GetType() == b2Shape::e_polygon); +} + +void b2PolygonContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) +{ + b2CollidePolygons( manifold, + (b2PolygonShape*)m_fixtureA->GetShape(), xfA, + (b2PolygonShape*)m_fixtureB->GetShape(), xfB); +} diff --git a/external/box2d/Dynamics/Contacts/b2PolygonContact.h b/external/box2d/Dynamics/Contacts/b2PolygonContact.h new file mode 100644 index 0000000000..302684232a --- /dev/null +++ b/external/box2d/Dynamics/Contacts/b2PolygonContact.h @@ -0,0 +1,39 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_POLYGON_CONTACT_H +#define B2_POLYGON_CONTACT_H + +#include + +class b2BlockAllocator; + +class b2PolygonContact : public b2Contact +{ +public: + static b2Contact* Create( b2Fixture* fixtureA, int32 indexA, + b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); + static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); + + b2PolygonContact(b2Fixture* fixtureA, b2Fixture* fixtureB); + ~b2PolygonContact() {} + + void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB); +}; + +#endif diff --git a/external/box2d/Dynamics/Joints/b2DistanceJoint.cpp b/external/box2d/Dynamics/Joints/b2DistanceJoint.cpp new file mode 100644 index 0000000000..b2d4bd006c --- /dev/null +++ b/external/box2d/Dynamics/Joints/b2DistanceJoint.cpp @@ -0,0 +1,260 @@ +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include + +// 1-D constrained system +// m (v2 - v1) = lambda +// v2 + (beta/h) * x1 + gamma * lambda = 0, gamma has units of inverse mass. +// x2 = x1 + h * v2 + +// 1-D mass-damper-spring system +// m (v2 - v1) + h * d * v2 + h * k * + +// C = norm(p2 - p1) - L +// u = (p2 - p1) / norm(p2 - p1) +// Cdot = dot(u, v2 + cross(w2, r2) - v1 - cross(w1, r1)) +// J = [-u -cross(r1, u) u cross(r2, u)] +// K = J * invM * JT +// = invMass1 + invI1 * cross(r1, u)^2 + invMass2 + invI2 * cross(r2, u)^2 + +void b2DistanceJointDef::Initialize(b2Body* b1, b2Body* b2, + const b2Vec2& anchor1, const b2Vec2& anchor2) +{ + bodyA = b1; + bodyB = b2; + localAnchorA = bodyA->GetLocalPoint(anchor1); + localAnchorB = bodyB->GetLocalPoint(anchor2); + b2Vec2 d = anchor2 - anchor1; + length = d.Length(); +} + +b2DistanceJoint::b2DistanceJoint(const b2DistanceJointDef* def) +: b2Joint(def) +{ + m_localAnchorA = def->localAnchorA; + m_localAnchorB = def->localAnchorB; + m_length = def->length; + m_frequencyHz = def->frequencyHz; + m_dampingRatio = def->dampingRatio; + m_impulse = 0.0f; + m_gamma = 0.0f; + m_bias = 0.0f; +} + +void b2DistanceJoint::InitVelocityConstraints(const b2SolverData& data) +{ + m_indexA = m_bodyA->m_islandIndex; + m_indexB = m_bodyB->m_islandIndex; + m_localCenterA = m_bodyA->m_sweep.localCenter; + m_localCenterB = m_bodyB->m_sweep.localCenter; + m_invMassA = m_bodyA->m_invMass; + m_invMassB = m_bodyB->m_invMass; + m_invIA = m_bodyA->m_invI; + m_invIB = m_bodyB->m_invI; + + b2Vec2 cA = data.positions[m_indexA].c; + float32 aA = data.positions[m_indexA].a; + b2Vec2 vA = data.velocities[m_indexA].v; + float32 wA = data.velocities[m_indexA].w; + + b2Vec2 cB = data.positions[m_indexB].c; + float32 aB = data.positions[m_indexB].a; + b2Vec2 vB = data.velocities[m_indexB].v; + float32 wB = data.velocities[m_indexB].w; + + b2Rot qA(aA), qB(aB); + + m_rA = b2Mul(qA, m_localAnchorA - m_localCenterA); + m_rB = b2Mul(qB, m_localAnchorB - m_localCenterB); + m_u = cB + m_rB - cA - m_rA; + + // Handle singularity. + float32 length = m_u.Length(); + if (length > b2_linearSlop) + { + m_u *= 1.0f / length; + } + else + { + m_u.Set(0.0f, 0.0f); + } + + float32 crAu = b2Cross(m_rA, m_u); + float32 crBu = b2Cross(m_rB, m_u); + float32 invMass = m_invMassA + m_invIA * crAu * crAu + m_invMassB + m_invIB * crBu * crBu; + + // Compute the effective mass matrix. + m_mass = invMass != 0.0f ? 1.0f / invMass : 0.0f; + + if (m_frequencyHz > 0.0f) + { + float32 C = length - m_length; + + // Frequency + float32 omega = 2.0f * b2_pi * m_frequencyHz; + + // Damping coefficient + float32 d = 2.0f * m_mass * m_dampingRatio * omega; + + // Spring stiffness + float32 k = m_mass * omega * omega; + + // magic formulas + float32 h = data.step.dt; + m_gamma = h * (d + h * k); + m_gamma = m_gamma != 0.0f ? 1.0f / m_gamma : 0.0f; + m_bias = C * h * k * m_gamma; + + invMass += m_gamma; + m_mass = invMass != 0.0f ? 1.0f / invMass : 0.0f; + } + else + { + m_gamma = 0.0f; + m_bias = 0.0f; + } + + if (data.step.warmStarting) + { + // Scale the impulse to support a variable time step. + m_impulse *= data.step.dtRatio; + + b2Vec2 P = m_impulse * m_u; + vA -= m_invMassA * P; + wA -= m_invIA * b2Cross(m_rA, P); + vB += m_invMassB * P; + wB += m_invIB * b2Cross(m_rB, P); + } + else + { + m_impulse = 0.0f; + } + + data.velocities[m_indexA].v = vA; + data.velocities[m_indexA].w = wA; + data.velocities[m_indexB].v = vB; + data.velocities[m_indexB].w = wB; +} + +void b2DistanceJoint::SolveVelocityConstraints(const b2SolverData& data) +{ + b2Vec2 vA = data.velocities[m_indexA].v; + float32 wA = data.velocities[m_indexA].w; + b2Vec2 vB = data.velocities[m_indexB].v; + float32 wB = data.velocities[m_indexB].w; + + // Cdot = dot(u, v + cross(w, r)) + b2Vec2 vpA = vA + b2Cross(wA, m_rA); + b2Vec2 vpB = vB + b2Cross(wB, m_rB); + float32 Cdot = b2Dot(m_u, vpB - vpA); + + float32 impulse = -m_mass * (Cdot + m_bias + m_gamma * m_impulse); + m_impulse += impulse; + + b2Vec2 P = impulse * m_u; + vA -= m_invMassA * P; + wA -= m_invIA * b2Cross(m_rA, P); + vB += m_invMassB * P; + wB += m_invIB * b2Cross(m_rB, P); + + data.velocities[m_indexA].v = vA; + data.velocities[m_indexA].w = wA; + data.velocities[m_indexB].v = vB; + data.velocities[m_indexB].w = wB; +} + +bool b2DistanceJoint::SolvePositionConstraints(const b2SolverData& data) +{ + if (m_frequencyHz > 0.0f) + { + // There is no position correction for soft distance constraints. + return true; + } + + b2Vec2 cA = data.positions[m_indexA].c; + float32 aA = data.positions[m_indexA].a; + b2Vec2 cB = data.positions[m_indexB].c; + float32 aB = data.positions[m_indexB].a; + + b2Rot qA(aA), qB(aB); + + b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA); + b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB); + b2Vec2 u = cB + rB - cA - rA; + + float32 length = u.Normalize(); + float32 C = length - m_length; + C = b2Clamp(C, -b2_maxLinearCorrection, b2_maxLinearCorrection); + + float32 impulse = -m_mass * C; + b2Vec2 P = impulse * u; + + cA -= m_invMassA * P; + aA -= m_invIA * b2Cross(rA, P); + cB += m_invMassB * P; + aB += m_invIB * b2Cross(rB, P); + + data.positions[m_indexA].c = cA; + data.positions[m_indexA].a = aA; + data.positions[m_indexB].c = cB; + data.positions[m_indexB].a = aB; + + return b2Abs(C) < b2_linearSlop; +} + +b2Vec2 b2DistanceJoint::GetAnchorA() const +{ + return m_bodyA->GetWorldPoint(m_localAnchorA); +} + +b2Vec2 b2DistanceJoint::GetAnchorB() const +{ + return m_bodyB->GetWorldPoint(m_localAnchorB); +} + +b2Vec2 b2DistanceJoint::GetReactionForce(float32 inv_dt) const +{ + b2Vec2 F = (inv_dt * m_impulse) * m_u; + return F; +} + +float32 b2DistanceJoint::GetReactionTorque(float32 inv_dt) const +{ + B2_NOT_USED(inv_dt); + return 0.0f; +} + +void b2DistanceJoint::Dump() +{ + int32 indexA = m_bodyA->m_islandIndex; + int32 indexB = m_bodyB->m_islandIndex; + + b2Log(" b2DistanceJointDef jd;\n"); + b2Log(" jd.bodyA = bodies[%d];\n", indexA); + b2Log(" jd.bodyB = bodies[%d];\n", indexB); + b2Log(" jd.collideConnected = bool(%d);\n", m_collideConnected); + b2Log(" jd.localAnchorA.Set(%.15lef, %.15lef);\n", m_localAnchorA.x, m_localAnchorA.y); + b2Log(" jd.localAnchorB.Set(%.15lef, %.15lef);\n", m_localAnchorB.x, m_localAnchorB.y); + b2Log(" jd.length = %.15lef;\n", m_length); + b2Log(" jd.frequencyHz = %.15lef;\n", m_frequencyHz); + b2Log(" jd.dampingRatio = %.15lef;\n", m_dampingRatio); + b2Log(" joints[%d] = m_world->CreateJoint(&jd);\n", m_index); +} diff --git a/external/box2d/Dynamics/Joints/b2DistanceJoint.h b/external/box2d/Dynamics/Joints/b2DistanceJoint.h new file mode 100644 index 0000000000..fc11476ff9 --- /dev/null +++ b/external/box2d/Dynamics/Joints/b2DistanceJoint.h @@ -0,0 +1,169 @@ +/* +* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_DISTANCE_JOINT_H +#define B2_DISTANCE_JOINT_H + +#include + +/// Distance joint definition. This requires defining an +/// anchor point on both bodies and the non-zero length of the +/// distance joint. The definition uses local anchor points +/// so that the initial configuration can violate the constraint +/// slightly. This helps when saving and loading a game. +/// @warning Do not use a zero or short length. +struct b2DistanceJointDef : public b2JointDef +{ + b2DistanceJointDef() + { + type = e_distanceJoint; + localAnchorA.Set(0.0f, 0.0f); + localAnchorB.Set(0.0f, 0.0f); + length = 1.0f; + frequencyHz = 0.0f; + dampingRatio = 0.0f; + } + + /// Initialize the bodies, anchors, and length using the world + /// anchors. + void Initialize(b2Body* bodyA, b2Body* bodyB, + const b2Vec2& anchorA, const b2Vec2& anchorB); + + /// The local anchor point relative to bodyA's origin. + b2Vec2 localAnchorA; + + /// The local anchor point relative to bodyB's origin. + b2Vec2 localAnchorB; + + /// The natural length between the anchor points. + float32 length; + + /// The mass-spring-damper frequency in Hertz. A value of 0 + /// disables softness. + float32 frequencyHz; + + /// The damping ratio. 0 = no damping, 1 = critical damping. + float32 dampingRatio; +}; + +/// A distance joint constrains two points on two bodies +/// to remain at a fixed distance from each other. You can view +/// this as a massless, rigid rod. +class b2DistanceJoint : public b2Joint +{ +public: + + b2Vec2 GetAnchorA() const; + b2Vec2 GetAnchorB() const; + + /// Get the reaction force given the inverse time step. + /// Unit is N. + b2Vec2 GetReactionForce(float32 inv_dt) const; + + /// Get the reaction torque given the inverse time step. + /// Unit is N*m. This is always zero for a distance joint. + float32 GetReactionTorque(float32 inv_dt) const; + + /// The local anchor point relative to bodyA's origin. + const b2Vec2& GetLocalAnchorA() const { return m_localAnchorA; } + + /// The local anchor point relative to bodyB's origin. + const b2Vec2& GetLocalAnchorB() const { return m_localAnchorB; } + + /// Set/get the natural length. + /// Manipulating the length can lead to non-physical behavior when the frequency is zero. + void SetLength(float32 length); + float32 GetLength() const; + + /// Set/get frequency in Hz. + void SetFrequency(float32 hz); + float32 GetFrequency() const; + + /// Set/get damping ratio. + void SetDampingRatio(float32 ratio); + float32 GetDampingRatio() const; + + /// Dump joint to dmLog + void Dump(); + +protected: + + friend class b2Joint; + b2DistanceJoint(const b2DistanceJointDef* data); + + void InitVelocityConstraints(const b2SolverData& data); + void SolveVelocityConstraints(const b2SolverData& data); + bool SolvePositionConstraints(const b2SolverData& data); + + float32 m_frequencyHz; + float32 m_dampingRatio; + float32 m_bias; + + // Solver shared + b2Vec2 m_localAnchorA; + b2Vec2 m_localAnchorB; + float32 m_gamma; + float32 m_impulse; + float32 m_length; + + // Solver temp + int32 m_indexA; + int32 m_indexB; + b2Vec2 m_u; + b2Vec2 m_rA; + b2Vec2 m_rB; + b2Vec2 m_localCenterA; + b2Vec2 m_localCenterB; + float32 m_invMassA; + float32 m_invMassB; + float32 m_invIA; + float32 m_invIB; + float32 m_mass; +}; + +inline void b2DistanceJoint::SetLength(float32 length) +{ + m_length = length; +} + +inline float32 b2DistanceJoint::GetLength() const +{ + return m_length; +} + +inline void b2DistanceJoint::SetFrequency(float32 hz) +{ + m_frequencyHz = hz; +} + +inline float32 b2DistanceJoint::GetFrequency() const +{ + return m_frequencyHz; +} + +inline void b2DistanceJoint::SetDampingRatio(float32 ratio) +{ + m_dampingRatio = ratio; +} + +inline float32 b2DistanceJoint::GetDampingRatio() const +{ + return m_dampingRatio; +} + +#endif diff --git a/external/box2d/Dynamics/Joints/b2FrictionJoint.cpp b/external/box2d/Dynamics/Joints/b2FrictionJoint.cpp new file mode 100644 index 0000000000..6e6018db10 --- /dev/null +++ b/external/box2d/Dynamics/Joints/b2FrictionJoint.cpp @@ -0,0 +1,251 @@ +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include + +// Point-to-point constraint +// Cdot = v2 - v1 +// = v2 + cross(w2, r2) - v1 - cross(w1, r1) +// J = [-I -r1_skew I r2_skew ] +// Identity used: +// w k % (rx i + ry j) = w * (-ry i + rx j) + +// Angle constraint +// Cdot = w2 - w1 +// J = [0 0 -1 0 0 1] +// K = invI1 + invI2 + +void b2FrictionJointDef::Initialize(b2Body* bA, b2Body* bB, const b2Vec2& anchor) +{ + bodyA = bA; + bodyB = bB; + localAnchorA = bodyA->GetLocalPoint(anchor); + localAnchorB = bodyB->GetLocalPoint(anchor); +} + +b2FrictionJoint::b2FrictionJoint(const b2FrictionJointDef* def) +: b2Joint(def) +{ + m_localAnchorA = def->localAnchorA; + m_localAnchorB = def->localAnchorB; + + m_linearImpulse.SetZero(); + m_angularImpulse = 0.0f; + + m_maxForce = def->maxForce; + m_maxTorque = def->maxTorque; +} + +void b2FrictionJoint::InitVelocityConstraints(const b2SolverData& data) +{ + m_indexA = m_bodyA->m_islandIndex; + m_indexB = m_bodyB->m_islandIndex; + m_localCenterA = m_bodyA->m_sweep.localCenter; + m_localCenterB = m_bodyB->m_sweep.localCenter; + m_invMassA = m_bodyA->m_invMass; + m_invMassB = m_bodyB->m_invMass; + m_invIA = m_bodyA->m_invI; + m_invIB = m_bodyB->m_invI; + + float32 aA = data.positions[m_indexA].a; + b2Vec2 vA = data.velocities[m_indexA].v; + float32 wA = data.velocities[m_indexA].w; + + float32 aB = data.positions[m_indexB].a; + b2Vec2 vB = data.velocities[m_indexB].v; + float32 wB = data.velocities[m_indexB].w; + + b2Rot qA(aA), qB(aB); + + // Compute the effective mass matrix. + m_rA = b2Mul(qA, m_localAnchorA - m_localCenterA); + m_rB = b2Mul(qB, m_localAnchorB - m_localCenterB); + + // J = [-I -r1_skew I r2_skew] + // [ 0 -1 0 1] + // r_skew = [-ry; rx] + + // Matlab + // K = [ mA+r1y^2*iA+mB+r2y^2*iB, -r1y*iA*r1x-r2y*iB*r2x, -r1y*iA-r2y*iB] + // [ -r1y*iA*r1x-r2y*iB*r2x, mA+r1x^2*iA+mB+r2x^2*iB, r1x*iA+r2x*iB] + // [ -r1y*iA-r2y*iB, r1x*iA+r2x*iB, iA+iB] + + float32 mA = m_invMassA, mB = m_invMassB; + float32 iA = m_invIA, iB = m_invIB; + + b2Mat22 K; + K.ex.x = mA + mB + iA * m_rA.y * m_rA.y + iB * m_rB.y * m_rB.y; + K.ex.y = -iA * m_rA.x * m_rA.y - iB * m_rB.x * m_rB.y; + K.ey.x = K.ex.y; + K.ey.y = mA + mB + iA * m_rA.x * m_rA.x + iB * m_rB.x * m_rB.x; + + m_linearMass = K.GetInverse(); + + m_angularMass = iA + iB; + if (m_angularMass > 0.0f) + { + m_angularMass = 1.0f / m_angularMass; + } + + if (data.step.warmStarting) + { + // Scale impulses to support a variable time step. + m_linearImpulse *= data.step.dtRatio; + m_angularImpulse *= data.step.dtRatio; + + b2Vec2 P(m_linearImpulse.x, m_linearImpulse.y); + vA -= mA * P; + wA -= iA * (b2Cross(m_rA, P) + m_angularImpulse); + vB += mB * P; + wB += iB * (b2Cross(m_rB, P) + m_angularImpulse); + } + else + { + m_linearImpulse.SetZero(); + m_angularImpulse = 0.0f; + } + + data.velocities[m_indexA].v = vA; + data.velocities[m_indexA].w = wA; + data.velocities[m_indexB].v = vB; + data.velocities[m_indexB].w = wB; +} + +void b2FrictionJoint::SolveVelocityConstraints(const b2SolverData& data) +{ + b2Vec2 vA = data.velocities[m_indexA].v; + float32 wA = data.velocities[m_indexA].w; + b2Vec2 vB = data.velocities[m_indexB].v; + float32 wB = data.velocities[m_indexB].w; + + float32 mA = m_invMassA, mB = m_invMassB; + float32 iA = m_invIA, iB = m_invIB; + + float32 h = data.step.dt; + + // Solve angular friction + { + float32 Cdot = wB - wA; + float32 impulse = -m_angularMass * Cdot; + + float32 oldImpulse = m_angularImpulse; + float32 maxImpulse = h * m_maxTorque; + m_angularImpulse = b2Clamp(m_angularImpulse + impulse, -maxImpulse, maxImpulse); + impulse = m_angularImpulse - oldImpulse; + + wA -= iA * impulse; + wB += iB * impulse; + } + + // Solve linear friction + { + b2Vec2 Cdot = vB + b2Cross(wB, m_rB) - vA - b2Cross(wA, m_rA); + + b2Vec2 impulse = -b2Mul(m_linearMass, Cdot); + b2Vec2 oldImpulse = m_linearImpulse; + m_linearImpulse += impulse; + + float32 maxImpulse = h * m_maxForce; + + if (m_linearImpulse.LengthSquared() > maxImpulse * maxImpulse) + { + m_linearImpulse.Normalize(); + m_linearImpulse *= maxImpulse; + } + + impulse = m_linearImpulse - oldImpulse; + + vA -= mA * impulse; + wA -= iA * b2Cross(m_rA, impulse); + + vB += mB * impulse; + wB += iB * b2Cross(m_rB, impulse); + } + + data.velocities[m_indexA].v = vA; + data.velocities[m_indexA].w = wA; + data.velocities[m_indexB].v = vB; + data.velocities[m_indexB].w = wB; +} + +bool b2FrictionJoint::SolvePositionConstraints(const b2SolverData& data) +{ + B2_NOT_USED(data); + + return true; +} + +b2Vec2 b2FrictionJoint::GetAnchorA() const +{ + return m_bodyA->GetWorldPoint(m_localAnchorA); +} + +b2Vec2 b2FrictionJoint::GetAnchorB() const +{ + return m_bodyB->GetWorldPoint(m_localAnchorB); +} + +b2Vec2 b2FrictionJoint::GetReactionForce(float32 inv_dt) const +{ + return inv_dt * m_linearImpulse; +} + +float32 b2FrictionJoint::GetReactionTorque(float32 inv_dt) const +{ + return inv_dt * m_angularImpulse; +} + +void b2FrictionJoint::SetMaxForce(float32 force) +{ + b2Assert(b2IsValid(force) && force >= 0.0f); + m_maxForce = force; +} + +float32 b2FrictionJoint::GetMaxForce() const +{ + return m_maxForce; +} + +void b2FrictionJoint::SetMaxTorque(float32 torque) +{ + b2Assert(b2IsValid(torque) && torque >= 0.0f); + m_maxTorque = torque; +} + +float32 b2FrictionJoint::GetMaxTorque() const +{ + return m_maxTorque; +} + +void b2FrictionJoint::Dump() +{ + int32 indexA = m_bodyA->m_islandIndex; + int32 indexB = m_bodyB->m_islandIndex; + + b2Log(" b2FrictionJointDef jd;\n"); + b2Log(" jd.bodyA = bodies[%d];\n", indexA); + b2Log(" jd.bodyB = bodies[%d];\n", indexB); + b2Log(" jd.collideConnected = bool(%d);\n", m_collideConnected); + b2Log(" jd.localAnchorA.Set(%.15lef, %.15lef);\n", m_localAnchorA.x, m_localAnchorA.y); + b2Log(" jd.localAnchorB.Set(%.15lef, %.15lef);\n", m_localAnchorB.x, m_localAnchorB.y); + b2Log(" jd.maxForce = %.15lef;\n", m_maxForce); + b2Log(" jd.maxTorque = %.15lef;\n", m_maxTorque); + b2Log(" joints[%d] = m_world->CreateJoint(&jd);\n", m_index); +} diff --git a/external/box2d/Dynamics/Joints/b2FrictionJoint.h b/external/box2d/Dynamics/Joints/b2FrictionJoint.h new file mode 100644 index 0000000000..3ee40c6298 --- /dev/null +++ b/external/box2d/Dynamics/Joints/b2FrictionJoint.h @@ -0,0 +1,119 @@ +/* +* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_FRICTION_JOINT_H +#define B2_FRICTION_JOINT_H + +#include + +/// Friction joint definition. +struct b2FrictionJointDef : public b2JointDef +{ + b2FrictionJointDef() + { + type = e_frictionJoint; + localAnchorA.SetZero(); + localAnchorB.SetZero(); + maxForce = 0.0f; + maxTorque = 0.0f; + } + + /// Initialize the bodies, anchors, axis, and reference angle using the world + /// anchor and world axis. + void Initialize(b2Body* bodyA, b2Body* bodyB, const b2Vec2& anchor); + + /// The local anchor point relative to bodyA's origin. + b2Vec2 localAnchorA; + + /// The local anchor point relative to bodyB's origin. + b2Vec2 localAnchorB; + + /// The maximum friction force in N. + float32 maxForce; + + /// The maximum friction torque in N-m. + float32 maxTorque; +}; + +/// Friction joint. This is used for top-down friction. +/// It provides 2D translational friction and angular friction. +class b2FrictionJoint : public b2Joint +{ +public: + b2Vec2 GetAnchorA() const; + b2Vec2 GetAnchorB() const; + + b2Vec2 GetReactionForce(float32 inv_dt) const; + float32 GetReactionTorque(float32 inv_dt) const; + + /// The local anchor point relative to bodyA's origin. + const b2Vec2& GetLocalAnchorA() const { return m_localAnchorA; } + + /// The local anchor point relative to bodyB's origin. + const b2Vec2& GetLocalAnchorB() const { return m_localAnchorB; } + + /// Set the maximum friction force in N. + void SetMaxForce(float32 force); + + /// Get the maximum friction force in N. + float32 GetMaxForce() const; + + /// Set the maximum friction torque in N*m. + void SetMaxTorque(float32 torque); + + /// Get the maximum friction torque in N*m. + float32 GetMaxTorque() const; + + /// Dump joint to dmLog + void Dump(); + +protected: + + friend class b2Joint; + + b2FrictionJoint(const b2FrictionJointDef* def); + + void InitVelocityConstraints(const b2SolverData& data); + void SolveVelocityConstraints(const b2SolverData& data); + bool SolvePositionConstraints(const b2SolverData& data); + + b2Vec2 m_localAnchorA; + b2Vec2 m_localAnchorB; + + // Solver shared + b2Vec2 m_linearImpulse; + float32 m_angularImpulse; + float32 m_maxForce; + float32 m_maxTorque; + + // Solver temp + int32 m_indexA; + int32 m_indexB; + b2Vec2 m_rA; + b2Vec2 m_rB; + b2Vec2 m_localCenterA; + b2Vec2 m_localCenterB; + float32 m_invMassA; + float32 m_invMassB; + float32 m_invIA; + float32 m_invIB; + b2Mat22 m_linearMass; + float32 m_angularMass; +}; + +#endif diff --git a/external/box2d/Dynamics/Joints/b2GearJoint.cpp b/external/box2d/Dynamics/Joints/b2GearJoint.cpp new file mode 100644 index 0000000000..9741cdd5a4 --- /dev/null +++ b/external/box2d/Dynamics/Joints/b2GearJoint.cpp @@ -0,0 +1,423 @@ +/* +* Copyright (c) 2007-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include +#include +#include + +// Gear Joint: +// C0 = (coordinate1 + ratio * coordinate2)_initial +// C = (coordinate1 + ratio * coordinate2) - C0 = 0 +// J = [J1 ratio * J2] +// K = J * invM * JT +// = J1 * invM1 * J1T + ratio * ratio * J2 * invM2 * J2T +// +// Revolute: +// coordinate = rotation +// Cdot = angularVelocity +// J = [0 0 1] +// K = J * invM * JT = invI +// +// Prismatic: +// coordinate = dot(p - pg, ug) +// Cdot = dot(v + cross(w, r), ug) +// J = [ug cross(r, ug)] +// K = J * invM * JT = invMass + invI * cross(r, ug)^2 + +b2GearJoint::b2GearJoint(const b2GearJointDef* def) +: b2Joint(def) +{ + m_joint1 = def->joint1; + m_joint2 = def->joint2; + + m_typeA = m_joint1->GetType(); + m_typeB = m_joint2->GetType(); + + b2Assert(m_typeA == e_revoluteJoint || m_typeA == e_prismaticJoint); + b2Assert(m_typeB == e_revoluteJoint || m_typeB == e_prismaticJoint); + + float32 coordinateA, coordinateB; + + // TODO_ERIN there might be some problem with the joint edges in b2Joint. + + m_bodyC = m_joint1->GetBodyA(); + m_bodyA = m_joint1->GetBodyB(); + + // Get geometry of joint1 + b2Transform xfA = m_bodyA->m_xf; + float32 aA = m_bodyA->m_sweep.a; + b2Transform xfC = m_bodyC->m_xf; + float32 aC = m_bodyC->m_sweep.a; + + if (m_typeA == e_revoluteJoint) + { + b2RevoluteJoint* revolute = (b2RevoluteJoint*)def->joint1; + m_localAnchorC = revolute->m_localAnchorA; + m_localAnchorA = revolute->m_localAnchorB; + m_referenceAngleA = revolute->m_referenceAngle; + m_localAxisC.SetZero(); + + coordinateA = aA - aC - m_referenceAngleA; + } + else + { + b2PrismaticJoint* prismatic = (b2PrismaticJoint*)def->joint1; + m_localAnchorC = prismatic->m_localAnchorA; + m_localAnchorA = prismatic->m_localAnchorB; + m_referenceAngleA = prismatic->m_referenceAngle; + m_localAxisC = prismatic->m_localXAxisA; + + b2Vec2 pC = m_localAnchorC; + b2Vec2 pA = b2MulT(xfC.q, b2Mul(xfA.q, m_localAnchorA) + (xfA.p - xfC.p)); + coordinateA = b2Dot(pA - pC, m_localAxisC); + } + + m_bodyD = m_joint2->GetBodyA(); + m_bodyB = m_joint2->GetBodyB(); + + // Get geometry of joint2 + b2Transform xfB = m_bodyB->m_xf; + float32 aB = m_bodyB->m_sweep.a; + b2Transform xfD = m_bodyD->m_xf; + float32 aD = m_bodyD->m_sweep.a; + + if (m_typeB == e_revoluteJoint) + { + b2RevoluteJoint* revolute = (b2RevoluteJoint*)def->joint2; + m_localAnchorD = revolute->m_localAnchorA; + m_localAnchorB = revolute->m_localAnchorB; + m_referenceAngleB = revolute->m_referenceAngle; + m_localAxisD.SetZero(); + + coordinateB = aB - aD - m_referenceAngleB; + } + else + { + b2PrismaticJoint* prismatic = (b2PrismaticJoint*)def->joint2; + m_localAnchorD = prismatic->m_localAnchorA; + m_localAnchorB = prismatic->m_localAnchorB; + m_referenceAngleB = prismatic->m_referenceAngle; + m_localAxisD = prismatic->m_localXAxisA; + + b2Vec2 pD = m_localAnchorD; + b2Vec2 pB = b2MulT(xfD.q, b2Mul(xfB.q, m_localAnchorB) + (xfB.p - xfD.p)); + coordinateB = b2Dot(pB - pD, m_localAxisD); + } + + m_ratio = def->ratio; + + m_constant = coordinateA + m_ratio * coordinateB; + + m_impulse = 0.0f; +} + +void b2GearJoint::InitVelocityConstraints(const b2SolverData& data) +{ + m_indexA = m_bodyA->m_islandIndex; + m_indexB = m_bodyB->m_islandIndex; + m_indexC = m_bodyC->m_islandIndex; + m_indexD = m_bodyD->m_islandIndex; + m_lcA = m_bodyA->m_sweep.localCenter; + m_lcB = m_bodyB->m_sweep.localCenter; + m_lcC = m_bodyC->m_sweep.localCenter; + m_lcD = m_bodyD->m_sweep.localCenter; + m_mA = m_bodyA->m_invMass; + m_mB = m_bodyB->m_invMass; + m_mC = m_bodyC->m_invMass; + m_mD = m_bodyD->m_invMass; + m_iA = m_bodyA->m_invI; + m_iB = m_bodyB->m_invI; + m_iC = m_bodyC->m_invI; + m_iD = m_bodyD->m_invI; + + b2Vec2 cA = data.positions[m_indexA].c; + float32 aA = data.positions[m_indexA].a; + b2Vec2 vA = data.velocities[m_indexA].v; + float32 wA = data.velocities[m_indexA].w; + + b2Vec2 cB = data.positions[m_indexB].c; + float32 aB = data.positions[m_indexB].a; + b2Vec2 vB = data.velocities[m_indexB].v; + float32 wB = data.velocities[m_indexB].w; + + b2Vec2 cC = data.positions[m_indexC].c; + float32 aC = data.positions[m_indexC].a; + b2Vec2 vC = data.velocities[m_indexC].v; + float32 wC = data.velocities[m_indexC].w; + + b2Vec2 cD = data.positions[m_indexD].c; + float32 aD = data.positions[m_indexD].a; + b2Vec2 vD = data.velocities[m_indexD].v; + float32 wD = data.velocities[m_indexD].w; + + b2Rot qA(aA), qB(aB), qC(aC), qD(aD); + + m_mass = 0.0f; + + if (m_typeA == e_revoluteJoint) + { + m_JvAC.SetZero(); + m_JwA = 1.0f; + m_JwC = 1.0f; + m_mass += m_iA + m_iC; + } + else + { + b2Vec2 u = b2Mul(qC, m_localAxisC); + b2Vec2 rC = b2Mul(qC, m_localAnchorC - m_lcC); + b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_lcA); + m_JvAC = u; + m_JwC = b2Cross(rC, u); + m_JwA = b2Cross(rA, u); + m_mass += m_mC + m_mA + m_iC * m_JwC * m_JwC + m_iA * m_JwA * m_JwA; + } + + if (m_typeB == e_revoluteJoint) + { + m_JvBD.SetZero(); + m_JwB = m_ratio; + m_JwD = m_ratio; + m_mass += m_ratio * m_ratio * (m_iB + m_iD); + } + else + { + b2Vec2 u = b2Mul(qD, m_localAxisD); + b2Vec2 rD = b2Mul(qD, m_localAnchorD - m_lcD); + b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_lcB); + m_JvBD = m_ratio * u; + m_JwD = m_ratio * b2Cross(rD, u); + m_JwB = m_ratio * b2Cross(rB, u); + m_mass += m_ratio * m_ratio * (m_mD + m_mB) + m_iD * m_JwD * m_JwD + m_iB * m_JwB * m_JwB; + } + + // Compute effective mass. + m_mass = m_mass > 0.0f ? 1.0f / m_mass : 0.0f; + + if (data.step.warmStarting) + { + vA += (m_mA * m_impulse) * m_JvAC; + wA += m_iA * m_impulse * m_JwA; + vB += (m_mB * m_impulse) * m_JvBD; + wB += m_iB * m_impulse * m_JwB; + vC -= (m_mC * m_impulse) * m_JvAC; + wC -= m_iC * m_impulse * m_JwC; + vD -= (m_mD * m_impulse) * m_JvBD; + wD -= m_iD * m_impulse * m_JwD; + } + else + { + m_impulse = 0.0f; + } + + data.velocities[m_indexA].v = vA; + data.velocities[m_indexA].w = wA; + data.velocities[m_indexB].v = vB; + data.velocities[m_indexB].w = wB; + data.velocities[m_indexC].v = vC; + data.velocities[m_indexC].w = wC; + data.velocities[m_indexD].v = vD; + data.velocities[m_indexD].w = wD; +} + +void b2GearJoint::SolveVelocityConstraints(const b2SolverData& data) +{ + b2Vec2 vA = data.velocities[m_indexA].v; + float32 wA = data.velocities[m_indexA].w; + b2Vec2 vB = data.velocities[m_indexB].v; + float32 wB = data.velocities[m_indexB].w; + b2Vec2 vC = data.velocities[m_indexC].v; + float32 wC = data.velocities[m_indexC].w; + b2Vec2 vD = data.velocities[m_indexD].v; + float32 wD = data.velocities[m_indexD].w; + + float32 Cdot = b2Dot(m_JvAC, vA - vC) + b2Dot(m_JvBD, vB - vD); + Cdot += (m_JwA * wA - m_JwC * wC) + (m_JwB * wB - m_JwD * wD); + + float32 impulse = -m_mass * Cdot; + m_impulse += impulse; + + vA += (m_mA * impulse) * m_JvAC; + wA += m_iA * impulse * m_JwA; + vB += (m_mB * impulse) * m_JvBD; + wB += m_iB * impulse * m_JwB; + vC -= (m_mC * impulse) * m_JvAC; + wC -= m_iC * impulse * m_JwC; + vD -= (m_mD * impulse) * m_JvBD; + wD -= m_iD * impulse * m_JwD; + + data.velocities[m_indexA].v = vA; + data.velocities[m_indexA].w = wA; + data.velocities[m_indexB].v = vB; + data.velocities[m_indexB].w = wB; + data.velocities[m_indexC].v = vC; + data.velocities[m_indexC].w = wC; + data.velocities[m_indexD].v = vD; + data.velocities[m_indexD].w = wD; +} + +bool b2GearJoint::SolvePositionConstraints(const b2SolverData& data) +{ + b2Vec2 cA = data.positions[m_indexA].c; + float32 aA = data.positions[m_indexA].a; + b2Vec2 cB = data.positions[m_indexB].c; + float32 aB = data.positions[m_indexB].a; + b2Vec2 cC = data.positions[m_indexC].c; + float32 aC = data.positions[m_indexC].a; + b2Vec2 cD = data.positions[m_indexD].c; + float32 aD = data.positions[m_indexD].a; + + b2Rot qA(aA), qB(aB), qC(aC), qD(aD); + + float32 linearError = 0.0f; + + float32 coordinateA, coordinateB; + + b2Vec2 JvAC, JvBD; + float32 JwA, JwB, JwC, JwD; + float32 mass = 0.0f; + + if (m_typeA == e_revoluteJoint) + { + JvAC.SetZero(); + JwA = 1.0f; + JwC = 1.0f; + mass += m_iA + m_iC; + + coordinateA = aA - aC - m_referenceAngleA; + } + else + { + b2Vec2 u = b2Mul(qC, m_localAxisC); + b2Vec2 rC = b2Mul(qC, m_localAnchorC - m_lcC); + b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_lcA); + JvAC = u; + JwC = b2Cross(rC, u); + JwA = b2Cross(rA, u); + mass += m_mC + m_mA + m_iC * JwC * JwC + m_iA * JwA * JwA; + + b2Vec2 pC = m_localAnchorC - m_lcC; + b2Vec2 pA = b2MulT(qC, rA + (cA - cC)); + coordinateA = b2Dot(pA - pC, m_localAxisC); + } + + if (m_typeB == e_revoluteJoint) + { + JvBD.SetZero(); + JwB = m_ratio; + JwD = m_ratio; + mass += m_ratio * m_ratio * (m_iB + m_iD); + + coordinateB = aB - aD - m_referenceAngleB; + } + else + { + b2Vec2 u = b2Mul(qD, m_localAxisD); + b2Vec2 rD = b2Mul(qD, m_localAnchorD - m_lcD); + b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_lcB); + JvBD = m_ratio * u; + JwD = m_ratio * b2Cross(rD, u); + JwB = m_ratio * b2Cross(rB, u); + mass += m_ratio * m_ratio * (m_mD + m_mB) + m_iD * JwD * JwD + m_iB * JwB * JwB; + + b2Vec2 pD = m_localAnchorD - m_lcD; + b2Vec2 pB = b2MulT(qD, rB + (cB - cD)); + coordinateB = b2Dot(pB - pD, m_localAxisD); + } + + float32 C = (coordinateA + m_ratio * coordinateB) - m_constant; + + float32 impulse = 0.0f; + if (mass > 0.0f) + { + impulse = -C / mass; + } + + cA += m_mA * impulse * JvAC; + aA += m_iA * impulse * JwA; + cB += m_mB * impulse * JvBD; + aB += m_iB * impulse * JwB; + cC -= m_mC * impulse * JvAC; + aC -= m_iC * impulse * JwC; + cD -= m_mD * impulse * JvBD; + aD -= m_iD * impulse * JwD; + + data.positions[m_indexA].c = cA; + data.positions[m_indexA].a = aA; + data.positions[m_indexB].c = cB; + data.positions[m_indexB].a = aB; + data.positions[m_indexC].c = cC; + data.positions[m_indexC].a = aC; + data.positions[m_indexD].c = cD; + data.positions[m_indexD].a = aD; + + // TODO_ERIN not implemented + return linearError < b2_linearSlop; +} + +b2Vec2 b2GearJoint::GetAnchorA() const +{ + return m_bodyA->GetWorldPoint(m_localAnchorA); +} + +b2Vec2 b2GearJoint::GetAnchorB() const +{ + return m_bodyB->GetWorldPoint(m_localAnchorB); +} + +b2Vec2 b2GearJoint::GetReactionForce(float32 inv_dt) const +{ + b2Vec2 P = m_impulse * m_JvAC; + return inv_dt * P; +} + +float32 b2GearJoint::GetReactionTorque(float32 inv_dt) const +{ + float32 L = m_impulse * m_JwA; + return inv_dt * L; +} + +void b2GearJoint::SetRatio(float32 ratio) +{ + b2Assert(b2IsValid(ratio)); + m_ratio = ratio; +} + +float32 b2GearJoint::GetRatio() const +{ + return m_ratio; +} + +void b2GearJoint::Dump() +{ + int32 indexA = m_bodyA->m_islandIndex; + int32 indexB = m_bodyB->m_islandIndex; + + int32 index1 = m_joint1->m_index; + int32 index2 = m_joint2->m_index; + + b2Log(" b2GearJointDef jd;\n"); + b2Log(" jd.bodyA = bodies[%d];\n", indexA); + b2Log(" jd.bodyB = bodies[%d];\n", indexB); + b2Log(" jd.collideConnected = bool(%d);\n", m_collideConnected); + b2Log(" jd.joint1 = joints[%d];\n", index1); + b2Log(" jd.joint2 = joints[%d];\n", index2); + b2Log(" jd.ratio = %.15lef;\n", m_ratio); + b2Log(" joints[%d] = m_world->CreateJoint(&jd);\n", m_index); +} diff --git a/external/box2d/Dynamics/Joints/b2GearJoint.h b/external/box2d/Dynamics/Joints/b2GearJoint.h new file mode 100644 index 0000000000..f926bf6ef1 --- /dev/null +++ b/external/box2d/Dynamics/Joints/b2GearJoint.h @@ -0,0 +1,125 @@ +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_GEAR_JOINT_H +#define B2_GEAR_JOINT_H + +#include + +/// Gear joint definition. This definition requires two existing +/// revolute or prismatic joints (any combination will work). +struct b2GearJointDef : public b2JointDef +{ + b2GearJointDef() + { + type = e_gearJoint; + joint1 = NULL; + joint2 = NULL; + ratio = 1.0f; + } + + /// The first revolute/prismatic joint attached to the gear joint. + b2Joint* joint1; + + /// The second revolute/prismatic joint attached to the gear joint. + b2Joint* joint2; + + /// The gear ratio. + /// @see b2GearJoint for explanation. + float32 ratio; +}; + +/// A gear joint is used to connect two joints together. Either joint +/// can be a revolute or prismatic joint. You specify a gear ratio +/// to bind the motions together: +/// coordinate1 + ratio * coordinate2 = constant +/// The ratio can be negative or positive. If one joint is a revolute joint +/// and the other joint is a prismatic joint, then the ratio will have units +/// of length or units of 1/length. +/// @warning You have to manually destroy the gear joint if joint1 or joint2 +/// is destroyed. +class b2GearJoint : public b2Joint +{ +public: + b2Vec2 GetAnchorA() const; + b2Vec2 GetAnchorB() const; + + b2Vec2 GetReactionForce(float32 inv_dt) const; + float32 GetReactionTorque(float32 inv_dt) const; + + /// Get the first joint. + b2Joint* GetJoint1() { return m_joint1; } + + /// Get the second joint. + b2Joint* GetJoint2() { return m_joint2; } + + /// Set/Get the gear ratio. + void SetRatio(float32 ratio); + float32 GetRatio() const; + + /// Dump joint to dmLog + void Dump(); + +protected: + + friend class b2Joint; + b2GearJoint(const b2GearJointDef* data); + + void InitVelocityConstraints(const b2SolverData& data); + void SolveVelocityConstraints(const b2SolverData& data); + bool SolvePositionConstraints(const b2SolverData& data); + + b2Joint* m_joint1; + b2Joint* m_joint2; + + b2JointType m_typeA; + b2JointType m_typeB; + + // Body A is connected to body C + // Body B is connected to body D + b2Body* m_bodyC; + b2Body* m_bodyD; + + // Solver shared + b2Vec2 m_localAnchorA; + b2Vec2 m_localAnchorB; + b2Vec2 m_localAnchorC; + b2Vec2 m_localAnchorD; + + b2Vec2 m_localAxisC; + b2Vec2 m_localAxisD; + + float32 m_referenceAngleA; + float32 m_referenceAngleB; + + float32 m_constant; + float32 m_ratio; + + float32 m_impulse; + + // Solver temp + int32 m_indexA, m_indexB, m_indexC, m_indexD; + b2Vec2 m_lcA, m_lcB, m_lcC, m_lcD; + float32 m_mA, m_mB, m_mC, m_mD; + float32 m_iA, m_iB, m_iC, m_iD; + b2Vec2 m_JvAC, m_JvBD; + float32 m_JwA, m_JwB, m_JwC, m_JwD; + float32 m_mass; +}; + +#endif diff --git a/external/box2d/Dynamics/Joints/b2Joint.cpp b/external/box2d/Dynamics/Joints/b2Joint.cpp new file mode 100644 index 0000000000..6853b09f0b --- /dev/null +++ b/external/box2d/Dynamics/Joints/b2Joint.cpp @@ -0,0 +1,199 @@ +/* +* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +b2Joint* b2Joint::Create(const b2JointDef* def, b2BlockAllocator* allocator) +{ + b2Joint* joint = NULL; + + switch (def->type) + { + case e_distanceJoint: + { + void* mem = allocator->Allocate(sizeof(b2DistanceJoint)); + joint = new (mem) b2DistanceJoint((b2DistanceJointDef*)def); + } + break; + + case e_mouseJoint: + { + void* mem = allocator->Allocate(sizeof(b2MouseJoint)); + joint = new (mem) b2MouseJoint((b2MouseJointDef*)def); + } + break; + + case e_prismaticJoint: + { + void* mem = allocator->Allocate(sizeof(b2PrismaticJoint)); + joint = new (mem) b2PrismaticJoint((b2PrismaticJointDef*)def); + } + break; + + case e_revoluteJoint: + { + void* mem = allocator->Allocate(sizeof(b2RevoluteJoint)); + joint = new (mem) b2RevoluteJoint((b2RevoluteJointDef*)def); + } + break; + + case e_pulleyJoint: + { + void* mem = allocator->Allocate(sizeof(b2PulleyJoint)); + joint = new (mem) b2PulleyJoint((b2PulleyJointDef*)def); + } + break; + + case e_gearJoint: + { + void* mem = allocator->Allocate(sizeof(b2GearJoint)); + joint = new (mem) b2GearJoint((b2GearJointDef*)def); + } + break; + + case e_wheelJoint: + { + void* mem = allocator->Allocate(sizeof(b2WheelJoint)); + joint = new (mem) b2WheelJoint((b2WheelJointDef*)def); + } + break; + + case e_weldJoint: + { + void* mem = allocator->Allocate(sizeof(b2WeldJoint)); + joint = new (mem) b2WeldJoint((b2WeldJointDef*)def); + } + break; + + case e_frictionJoint: + { + void* mem = allocator->Allocate(sizeof(b2FrictionJoint)); + joint = new (mem) b2FrictionJoint((b2FrictionJointDef*)def); + } + break; + + case e_ropeJoint: + { + void* mem = allocator->Allocate(sizeof(b2RopeJoint)); + joint = new (mem) b2RopeJoint((b2RopeJointDef*)def); + } + break; + + default: + b2Assert(false); + break; + } + + return joint; +} + +void b2Joint::Destroy(b2Joint* joint, b2BlockAllocator* allocator) +{ + joint->~b2Joint(); + switch (joint->m_type) + { + case e_distanceJoint: + allocator->Free(joint, sizeof(b2DistanceJoint)); + break; + + case e_mouseJoint: + allocator->Free(joint, sizeof(b2MouseJoint)); + break; + + case e_prismaticJoint: + allocator->Free(joint, sizeof(b2PrismaticJoint)); + break; + + case e_revoluteJoint: + allocator->Free(joint, sizeof(b2RevoluteJoint)); + break; + + case e_pulleyJoint: + allocator->Free(joint, sizeof(b2PulleyJoint)); + break; + + case e_gearJoint: + allocator->Free(joint, sizeof(b2GearJoint)); + break; + + case e_wheelJoint: + allocator->Free(joint, sizeof(b2WheelJoint)); + break; + + case e_weldJoint: + allocator->Free(joint, sizeof(b2WeldJoint)); + break; + + case e_frictionJoint: + allocator->Free(joint, sizeof(b2FrictionJoint)); + break; + + case e_ropeJoint: + allocator->Free(joint, sizeof(b2RopeJoint)); + break; + + default: + b2Assert(false); + break; + } +} + +b2Joint::b2Joint(const b2JointDef* def) +{ + b2Assert(def->bodyA != def->bodyB); + + m_type = def->type; + m_prev = NULL; + m_next = NULL; + m_bodyA = def->bodyA; + m_bodyB = def->bodyB; + m_index = 0; + m_collideConnected = def->collideConnected; + m_islandFlag = false; + m_userData = def->userData; + + m_edgeA.joint = NULL; + m_edgeA.other = NULL; + m_edgeA.prev = NULL; + m_edgeA.next = NULL; + + m_edgeB.joint = NULL; + m_edgeB.other = NULL; + m_edgeB.prev = NULL; + m_edgeB.next = NULL; +} + +bool b2Joint::IsActive() const +{ + return m_bodyA->IsActive() && m_bodyB->IsActive(); +} diff --git a/external/box2d/Dynamics/Joints/b2Joint.h b/external/box2d/Dynamics/Joints/b2Joint.h new file mode 100644 index 0000000000..b4ea576665 --- /dev/null +++ b/external/box2d/Dynamics/Joints/b2Joint.h @@ -0,0 +1,222 @@ +/* +* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_JOINT_H +#define B2_JOINT_H + +#include + +class b2Body; +class b2Joint; +struct b2SolverData; +class b2BlockAllocator; + +enum b2JointType +{ + e_unknownJoint, + e_revoluteJoint, + e_prismaticJoint, + e_distanceJoint, + e_pulleyJoint, + e_mouseJoint, + e_gearJoint, + e_wheelJoint, + e_weldJoint, + e_frictionJoint, + e_ropeJoint +}; + +enum b2LimitState +{ + e_inactiveLimit, + e_atLowerLimit, + e_atUpperLimit, + e_equalLimits +}; + +struct b2Jacobian +{ + b2Vec2 linear; + float32 angularA; + float32 angularB; +}; + +/// A joint edge is used to connect bodies and joints together +/// in a joint graph where each body is a node and each joint +/// is an edge. A joint edge belongs to a doubly linked list +/// maintained in each attached body. Each joint has two joint +/// nodes, one for each attached body. +struct b2JointEdge +{ + b2Body* other; ///< provides quick access to the other body attached. + b2Joint* joint; ///< the joint + b2JointEdge* prev; ///< the previous joint edge in the body's joint list + b2JointEdge* next; ///< the next joint edge in the body's joint list +}; + +/// Joint definitions are used to construct joints. +struct b2JointDef +{ + b2JointDef() + { + type = e_unknownJoint; + userData = NULL; + bodyA = NULL; + bodyB = NULL; + collideConnected = false; + } + + /// The joint type is set automatically for concrete joint types. + b2JointType type; + + /// Use this to attach application specific data to your joints. + void* userData; + + /// The first attached body. + b2Body* bodyA; + + /// The second attached body. + b2Body* bodyB; + + /// Set this flag to true if the attached bodies should collide. + bool collideConnected; +}; + +/// The base joint class. Joints are used to constraint two bodies together in +/// various fashions. Some joints also feature limits and motors. +class b2Joint +{ +public: + + /// Get the type of the concrete joint. + b2JointType GetType() const; + + /// Get the first body attached to this joint. + b2Body* GetBodyA(); + + /// Get the second body attached to this joint. + b2Body* GetBodyB(); + + /// Get the anchor point on bodyA in world coordinates. + virtual b2Vec2 GetAnchorA() const = 0; + + /// Get the anchor point on bodyB in world coordinates. + virtual b2Vec2 GetAnchorB() const = 0; + + /// Get the reaction force on bodyB at the joint anchor in Newtons. + virtual b2Vec2 GetReactionForce(float32 inv_dt) const = 0; + + /// Get the reaction torque on bodyB in N*m. + virtual float32 GetReactionTorque(float32 inv_dt) const = 0; + + /// Get the next joint the world joint list. + b2Joint* GetNext(); + const b2Joint* GetNext() const; + + /// Get the user data pointer. + void* GetUserData() const; + + /// Set the user data pointer. + void SetUserData(void* data); + + /// Short-cut function to determine if either body is inactive. + bool IsActive() const; + + /// Get collide connected. + /// Note: modifying the collide connect flag won't work correctly because + /// the flag is only checked when fixture AABBs begin to overlap. + bool GetCollideConnected() const; + + /// Dump this joint to the log file. + virtual void Dump() { b2Log("// Dump is not supported for this joint type.\n"); } + +protected: + friend class b2World; + friend class b2Body; + friend class b2Island; + friend class b2GearJoint; + + static b2Joint* Create(const b2JointDef* def, b2BlockAllocator* allocator); + static void Destroy(b2Joint* joint, b2BlockAllocator* allocator); + + b2Joint(const b2JointDef* def); + virtual ~b2Joint() {} + + virtual void InitVelocityConstraints(const b2SolverData& data) = 0; + virtual void SolveVelocityConstraints(const b2SolverData& data) = 0; + + // This returns true if the position errors are within tolerance. + virtual bool SolvePositionConstraints(const b2SolverData& data) = 0; + + b2JointType m_type; + b2Joint* m_prev; + b2Joint* m_next; + b2JointEdge m_edgeA; + b2JointEdge m_edgeB; + b2Body* m_bodyA; + b2Body* m_bodyB; + + int32 m_index; + + bool m_islandFlag; + bool m_collideConnected; + + void* m_userData; +}; + +inline b2JointType b2Joint::GetType() const +{ + return m_type; +} + +inline b2Body* b2Joint::GetBodyA() +{ + return m_bodyA; +} + +inline b2Body* b2Joint::GetBodyB() +{ + return m_bodyB; +} + +inline b2Joint* b2Joint::GetNext() +{ + return m_next; +} + +inline const b2Joint* b2Joint::GetNext() const +{ + return m_next; +} + +inline void* b2Joint::GetUserData() const +{ + return m_userData; +} + +inline void b2Joint::SetUserData(void* data) +{ + m_userData = data; +} + +inline bool b2Joint::GetCollideConnected() const +{ + return m_collideConnected; +} + +#endif diff --git a/external/box2d/Dynamics/Joints/b2MouseJoint.cpp b/external/box2d/Dynamics/Joints/b2MouseJoint.cpp new file mode 100644 index 0000000000..237d9d519a --- /dev/null +++ b/external/box2d/Dynamics/Joints/b2MouseJoint.cpp @@ -0,0 +1,217 @@ +/* +* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include + +// p = attached point, m = mouse point +// C = p - m +// Cdot = v +// = v + cross(w, r) +// J = [I r_skew] +// Identity used: +// w k % (rx i + ry j) = w * (-ry i + rx j) + +b2MouseJoint::b2MouseJoint(const b2MouseJointDef* def) +: b2Joint(def) +{ + b2Assert(def->target.IsValid()); + b2Assert(b2IsValid(def->maxForce) && def->maxForce >= 0.0f); + b2Assert(b2IsValid(def->frequencyHz) && def->frequencyHz >= 0.0f); + b2Assert(b2IsValid(def->dampingRatio) && def->dampingRatio >= 0.0f); + + m_targetA = def->target; + m_localAnchorB = b2MulT(m_bodyB->GetTransform(), m_targetA); + + m_maxForce = def->maxForce; + m_impulse.SetZero(); + + m_frequencyHz = def->frequencyHz; + m_dampingRatio = def->dampingRatio; + + m_beta = 0.0f; + m_gamma = 0.0f; +} + +void b2MouseJoint::SetTarget(const b2Vec2& target) +{ + if (m_bodyB->IsAwake() == false) + { + m_bodyB->SetAwake(true); + } + m_targetA = target; +} + +const b2Vec2& b2MouseJoint::GetTarget() const +{ + return m_targetA; +} + +void b2MouseJoint::SetMaxForce(float32 force) +{ + m_maxForce = force; +} + +float32 b2MouseJoint::GetMaxForce() const +{ + return m_maxForce; +} + +void b2MouseJoint::SetFrequency(float32 hz) +{ + m_frequencyHz = hz; +} + +float32 b2MouseJoint::GetFrequency() const +{ + return m_frequencyHz; +} + +void b2MouseJoint::SetDampingRatio(float32 ratio) +{ + m_dampingRatio = ratio; +} + +float32 b2MouseJoint::GetDampingRatio() const +{ + return m_dampingRatio; +} + +void b2MouseJoint::InitVelocityConstraints(const b2SolverData& data) +{ + m_indexB = m_bodyB->m_islandIndex; + m_localCenterB = m_bodyB->m_sweep.localCenter; + m_invMassB = m_bodyB->m_invMass; + m_invIB = m_bodyB->m_invI; + + b2Vec2 cB = data.positions[m_indexB].c; + float32 aB = data.positions[m_indexB].a; + b2Vec2 vB = data.velocities[m_indexB].v; + float32 wB = data.velocities[m_indexB].w; + + b2Rot qB(aB); + + float32 mass = m_bodyB->GetMass(); + + // Frequency + float32 omega = 2.0f * b2_pi * m_frequencyHz; + + // Damping coefficient + float32 d = 2.0f * mass * m_dampingRatio * omega; + + // Spring stiffness + float32 k = mass * (omega * omega); + + // magic formulas + // gamma has units of inverse mass. + // beta has units of inverse time. + float32 h = data.step.dt; + b2Assert(d + h * k > b2_epsilon); + m_gamma = h * (d + h * k); + if (m_gamma != 0.0f) + { + m_gamma = 1.0f / m_gamma; + } + m_beta = h * k * m_gamma; + + // Compute the effective mass matrix. + m_rB = b2Mul(qB, m_localAnchorB - m_localCenterB); + + // K = [(1/m1 + 1/m2) * eye(2) - skew(r1) * invI1 * skew(r1) - skew(r2) * invI2 * skew(r2)] + // = [1/m1+1/m2 0 ] + invI1 * [r1.y*r1.y -r1.x*r1.y] + invI2 * [r1.y*r1.y -r1.x*r1.y] + // [ 0 1/m1+1/m2] [-r1.x*r1.y r1.x*r1.x] [-r1.x*r1.y r1.x*r1.x] + b2Mat22 K; + K.ex.x = m_invMassB + m_invIB * m_rB.y * m_rB.y + m_gamma; + K.ex.y = -m_invIB * m_rB.x * m_rB.y; + K.ey.x = K.ex.y; + K.ey.y = m_invMassB + m_invIB * m_rB.x * m_rB.x + m_gamma; + + m_mass = K.GetInverse(); + + m_C = cB + m_rB - m_targetA; + m_C *= m_beta; + + // Cheat with some damping + wB *= 0.98f; + + if (data.step.warmStarting) + { + m_impulse *= data.step.dtRatio; + vB += m_invMassB * m_impulse; + wB += m_invIB * b2Cross(m_rB, m_impulse); + } + else + { + m_impulse.SetZero(); + } + + data.velocities[m_indexB].v = vB; + data.velocities[m_indexB].w = wB; +} + +void b2MouseJoint::SolveVelocityConstraints(const b2SolverData& data) +{ + b2Vec2 vB = data.velocities[m_indexB].v; + float32 wB = data.velocities[m_indexB].w; + + // Cdot = v + cross(w, r) + b2Vec2 Cdot = vB + b2Cross(wB, m_rB); + b2Vec2 impulse = b2Mul(m_mass, -(Cdot + m_C + m_gamma * m_impulse)); + + b2Vec2 oldImpulse = m_impulse; + m_impulse += impulse; + float32 maxImpulse = data.step.dt * m_maxForce; + if (m_impulse.LengthSquared() > maxImpulse * maxImpulse) + { + m_impulse *= maxImpulse / m_impulse.Length(); + } + impulse = m_impulse - oldImpulse; + + vB += m_invMassB * impulse; + wB += m_invIB * b2Cross(m_rB, impulse); + + data.velocities[m_indexB].v = vB; + data.velocities[m_indexB].w = wB; +} + +bool b2MouseJoint::SolvePositionConstraints(const b2SolverData& data) +{ + B2_NOT_USED(data); + return true; +} + +b2Vec2 b2MouseJoint::GetAnchorA() const +{ + return m_targetA; +} + +b2Vec2 b2MouseJoint::GetAnchorB() const +{ + return m_bodyB->GetWorldPoint(m_localAnchorB); +} + +b2Vec2 b2MouseJoint::GetReactionForce(float32 inv_dt) const +{ + return inv_dt * m_impulse; +} + +float32 b2MouseJoint::GetReactionTorque(float32 inv_dt) const +{ + return inv_dt * 0.0f; +} diff --git a/external/box2d/Dynamics/Joints/b2MouseJoint.h b/external/box2d/Dynamics/Joints/b2MouseJoint.h new file mode 100644 index 0000000000..1bbc194f4c --- /dev/null +++ b/external/box2d/Dynamics/Joints/b2MouseJoint.h @@ -0,0 +1,126 @@ +/* +* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_MOUSE_JOINT_H +#define B2_MOUSE_JOINT_H + +#include + +/// Mouse joint definition. This requires a world target point, +/// tuning parameters, and the time step. +struct b2MouseJointDef : public b2JointDef +{ + b2MouseJointDef() + { + type = e_mouseJoint; + target.Set(0.0f, 0.0f); + maxForce = 0.0f; + frequencyHz = 5.0f; + dampingRatio = 0.7f; + } + + /// The initial world target point. This is assumed + /// to coincide with the body anchor initially. + b2Vec2 target; + + /// The maximum constraint force that can be exerted + /// to move the candidate body. Usually you will express + /// as some multiple of the weight (multiplier * mass * gravity). + float32 maxForce; + + /// The response speed. + float32 frequencyHz; + + /// The damping ratio. 0 = no damping, 1 = critical damping. + float32 dampingRatio; +}; + +/// A mouse joint is used to make a point on a body track a +/// specified world point. This a soft constraint with a maximum +/// force. This allows the constraint to stretch and without +/// applying huge forces. +/// NOTE: this joint is not documented in the manual because it was +/// developed to be used in the testbed. If you want to learn how to +/// use the mouse joint, look at the testbed. +class b2MouseJoint : public b2Joint +{ +public: + + /// Implements b2Joint. + b2Vec2 GetAnchorA() const; + + /// Implements b2Joint. + b2Vec2 GetAnchorB() const; + + /// Implements b2Joint. + b2Vec2 GetReactionForce(float32 inv_dt) const; + + /// Implements b2Joint. + float32 GetReactionTorque(float32 inv_dt) const; + + /// Use this to update the target point. + void SetTarget(const b2Vec2& target); + const b2Vec2& GetTarget() const; + + /// Set/get the maximum force in Newtons. + void SetMaxForce(float32 force); + float32 GetMaxForce() const; + + /// Set/get the frequency in Hertz. + void SetFrequency(float32 hz); + float32 GetFrequency() const; + + /// Set/get the damping ratio (dimensionless). + void SetDampingRatio(float32 ratio); + float32 GetDampingRatio() const; + + /// The mouse joint does not support dumping. + void Dump() { b2Log("Mouse joint dumping is not supported.\n"); } + +protected: + friend class b2Joint; + + b2MouseJoint(const b2MouseJointDef* def); + + void InitVelocityConstraints(const b2SolverData& data); + void SolveVelocityConstraints(const b2SolverData& data); + bool SolvePositionConstraints(const b2SolverData& data); + + b2Vec2 m_localAnchorB; + b2Vec2 m_targetA; + float32 m_frequencyHz; + float32 m_dampingRatio; + float32 m_beta; + + // Solver shared + b2Vec2 m_impulse; + float32 m_maxForce; + float32 m_gamma; + + // Solver temp + int32 m_indexA; + int32 m_indexB; + b2Vec2 m_rB; + b2Vec2 m_localCenterB; + float32 m_invMassB; + float32 m_invIB; + b2Mat22 m_mass; + b2Vec2 m_C; +}; + +#endif diff --git a/external/box2d/Dynamics/Joints/b2PrismaticJoint.cpp b/external/box2d/Dynamics/Joints/b2PrismaticJoint.cpp new file mode 100644 index 0000000000..4849f729f5 --- /dev/null +++ b/external/box2d/Dynamics/Joints/b2PrismaticJoint.cpp @@ -0,0 +1,637 @@ +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include + +// Linear constraint (point-to-line) +// d = p2 - p1 = x2 + r2 - x1 - r1 +// C = dot(perp, d) +// Cdot = dot(d, cross(w1, perp)) + dot(perp, v2 + cross(w2, r2) - v1 - cross(w1, r1)) +// = -dot(perp, v1) - dot(cross(d + r1, perp), w1) + dot(perp, v2) + dot(cross(r2, perp), v2) +// J = [-perp, -cross(d + r1, perp), perp, cross(r2,perp)] +// +// Angular constraint +// C = a2 - a1 + a_initial +// Cdot = w2 - w1 +// J = [0 0 -1 0 0 1] +// +// K = J * invM * JT +// +// J = [-a -s1 a s2] +// [0 -1 0 1] +// a = perp +// s1 = cross(d + r1, a) = cross(p2 - x1, a) +// s2 = cross(r2, a) = cross(p2 - x2, a) + + +// Motor/Limit linear constraint +// C = dot(ax1, d) +// Cdot = = -dot(ax1, v1) - dot(cross(d + r1, ax1), w1) + dot(ax1, v2) + dot(cross(r2, ax1), v2) +// J = [-ax1 -cross(d+r1,ax1) ax1 cross(r2,ax1)] + +// Block Solver +// We develop a block solver that includes the joint limit. This makes the limit stiff (inelastic) even +// when the mass has poor distribution (leading to large torques about the joint anchor points). +// +// The Jacobian has 3 rows: +// J = [-uT -s1 uT s2] // linear +// [0 -1 0 1] // angular +// [-vT -a1 vT a2] // limit +// +// u = perp +// v = axis +// s1 = cross(d + r1, u), s2 = cross(r2, u) +// a1 = cross(d + r1, v), a2 = cross(r2, v) + +// M * (v2 - v1) = JT * df +// J * v2 = bias +// +// v2 = v1 + invM * JT * df +// J * (v1 + invM * JT * df) = bias +// K * df = bias - J * v1 = -Cdot +// K = J * invM * JT +// Cdot = J * v1 - bias +// +// Now solve for f2. +// df = f2 - f1 +// K * (f2 - f1) = -Cdot +// f2 = invK * (-Cdot) + f1 +// +// Clamp accumulated limit impulse. +// lower: f2(3) = max(f2(3), 0) +// upper: f2(3) = min(f2(3), 0) +// +// Solve for correct f2(1:2) +// K(1:2, 1:2) * f2(1:2) = -Cdot(1:2) - K(1:2,3) * f2(3) + K(1:2,1:3) * f1 +// = -Cdot(1:2) - K(1:2,3) * f2(3) + K(1:2,1:2) * f1(1:2) + K(1:2,3) * f1(3) +// K(1:2, 1:2) * f2(1:2) = -Cdot(1:2) - K(1:2,3) * (f2(3) - f1(3)) + K(1:2,1:2) * f1(1:2) +// f2(1:2) = invK(1:2,1:2) * (-Cdot(1:2) - K(1:2,3) * (f2(3) - f1(3))) + f1(1:2) +// +// Now compute impulse to be applied: +// df = f2 - f1 + +void b2PrismaticJointDef::Initialize(b2Body* bA, b2Body* bB, const b2Vec2& anchor, const b2Vec2& axis) +{ + bodyA = bA; + bodyB = bB; + localAnchorA = bodyA->GetLocalPoint(anchor); + localAnchorB = bodyB->GetLocalPoint(anchor); + localAxisA = bodyA->GetLocalVector(axis); + referenceAngle = bodyB->GetAngle() - bodyA->GetAngle(); +} + +b2PrismaticJoint::b2PrismaticJoint(const b2PrismaticJointDef* def) +: b2Joint(def) +{ + m_localAnchorA = def->localAnchorA; + m_localAnchorB = def->localAnchorB; + m_localXAxisA = def->localAxisA; + m_localXAxisA.Normalize(); + m_localYAxisA = b2Cross(1.0f, m_localXAxisA); + m_referenceAngle = def->referenceAngle; + + m_impulse.SetZero(); + m_motorMass = 0.0; + m_motorImpulse = 0.0f; + + m_lowerTranslation = def->lowerTranslation; + m_upperTranslation = def->upperTranslation; + m_maxMotorForce = def->maxMotorForce; + m_motorSpeed = def->motorSpeed; + m_enableLimit = def->enableLimit; + m_enableMotor = def->enableMotor; + m_limitState = e_inactiveLimit; + + m_axis.SetZero(); + m_perp.SetZero(); +} + +void b2PrismaticJoint::InitVelocityConstraints(const b2SolverData& data) +{ + m_indexA = m_bodyA->m_islandIndex; + m_indexB = m_bodyB->m_islandIndex; + m_localCenterA = m_bodyA->m_sweep.localCenter; + m_localCenterB = m_bodyB->m_sweep.localCenter; + m_invMassA = m_bodyA->m_invMass; + m_invMassB = m_bodyB->m_invMass; + m_invIA = m_bodyA->m_invI; + m_invIB = m_bodyB->m_invI; + + b2Vec2 cA = data.positions[m_indexA].c; + float32 aA = data.positions[m_indexA].a; + b2Vec2 vA = data.velocities[m_indexA].v; + float32 wA = data.velocities[m_indexA].w; + + b2Vec2 cB = data.positions[m_indexB].c; + float32 aB = data.positions[m_indexB].a; + b2Vec2 vB = data.velocities[m_indexB].v; + float32 wB = data.velocities[m_indexB].w; + + b2Rot qA(aA), qB(aB); + + // Compute the effective masses. + b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA); + b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB); + b2Vec2 d = (cB - cA) + rB - rA; + + float32 mA = m_invMassA, mB = m_invMassB; + float32 iA = m_invIA, iB = m_invIB; + + // Compute motor Jacobian and effective mass. + { + m_axis = b2Mul(qA, m_localXAxisA); + m_a1 = b2Cross(d + rA, m_axis); + m_a2 = b2Cross(rB, m_axis); + + m_motorMass = mA + mB + iA * m_a1 * m_a1 + iB * m_a2 * m_a2; + if (m_motorMass > 0.0f) + { + m_motorMass = 1.0f / m_motorMass; + } + } + + // Prismatic constraint. + { + m_perp = b2Mul(qA, m_localYAxisA); + + m_s1 = b2Cross(d + rA, m_perp); + m_s2 = b2Cross(rB, m_perp); + + float32 k11 = mA + mB + iA * m_s1 * m_s1 + iB * m_s2 * m_s2; + float32 k12 = iA * m_s1 + iB * m_s2; + float32 k13 = iA * m_s1 * m_a1 + iB * m_s2 * m_a2; + float32 k22 = iA + iB; + if (k22 == 0.0f) + { + // For bodies with fixed rotation. + k22 = 1.0f; + } + float32 k23 = iA * m_a1 + iB * m_a2; + float32 k33 = mA + mB + iA * m_a1 * m_a1 + iB * m_a2 * m_a2; + + m_K.ex.Set(k11, k12, k13); + m_K.ey.Set(k12, k22, k23); + m_K.ez.Set(k13, k23, k33); + } + + // Compute motor and limit terms. + if (m_enableLimit) + { + float32 jointTranslation = b2Dot(m_axis, d); + if (b2Abs(m_upperTranslation - m_lowerTranslation) < 2.0f * b2_linearSlop) + { + m_limitState = e_equalLimits; + } + else if (jointTranslation <= m_lowerTranslation) + { + if (m_limitState != e_atLowerLimit) + { + m_limitState = e_atLowerLimit; + m_impulse.z = 0.0f; + } + } + else if (jointTranslation >= m_upperTranslation) + { + if (m_limitState != e_atUpperLimit) + { + m_limitState = e_atUpperLimit; + m_impulse.z = 0.0f; + } + } + else + { + m_limitState = e_inactiveLimit; + m_impulse.z = 0.0f; + } + } + else + { + m_limitState = e_inactiveLimit; + m_impulse.z = 0.0f; + } + + if (m_enableMotor == false) + { + m_motorImpulse = 0.0f; + } + + if (data.step.warmStarting) + { + // Account for variable time step. + m_impulse *= data.step.dtRatio; + m_motorImpulse *= data.step.dtRatio; + + b2Vec2 P = m_impulse.x * m_perp + (m_motorImpulse + m_impulse.z) * m_axis; + float32 LA = m_impulse.x * m_s1 + m_impulse.y + (m_motorImpulse + m_impulse.z) * m_a1; + float32 LB = m_impulse.x * m_s2 + m_impulse.y + (m_motorImpulse + m_impulse.z) * m_a2; + + vA -= mA * P; + wA -= iA * LA; + + vB += mB * P; + wB += iB * LB; + } + else + { + m_impulse.SetZero(); + m_motorImpulse = 0.0f; + } + + data.velocities[m_indexA].v = vA; + data.velocities[m_indexA].w = wA; + data.velocities[m_indexB].v = vB; + data.velocities[m_indexB].w = wB; +} + +void b2PrismaticJoint::SolveVelocityConstraints(const b2SolverData& data) +{ + b2Vec2 vA = data.velocities[m_indexA].v; + float32 wA = data.velocities[m_indexA].w; + b2Vec2 vB = data.velocities[m_indexB].v; + float32 wB = data.velocities[m_indexB].w; + + float32 mA = m_invMassA, mB = m_invMassB; + float32 iA = m_invIA, iB = m_invIB; + + // Solve linear motor constraint. + if (m_enableMotor && m_limitState != e_equalLimits) + { + float32 Cdot = b2Dot(m_axis, vB - vA) + m_a2 * wB - m_a1 * wA; + float32 impulse = m_motorMass * (m_motorSpeed - Cdot); + float32 oldImpulse = m_motorImpulse; + float32 maxImpulse = data.step.dt * m_maxMotorForce; + m_motorImpulse = b2Clamp(m_motorImpulse + impulse, -maxImpulse, maxImpulse); + impulse = m_motorImpulse - oldImpulse; + + b2Vec2 P = impulse * m_axis; + float32 LA = impulse * m_a1; + float32 LB = impulse * m_a2; + + vA -= mA * P; + wA -= iA * LA; + + vB += mB * P; + wB += iB * LB; + } + + b2Vec2 Cdot1; + Cdot1.x = b2Dot(m_perp, vB - vA) + m_s2 * wB - m_s1 * wA; + Cdot1.y = wB - wA; + + if (m_enableLimit && m_limitState != e_inactiveLimit) + { + // Solve prismatic and limit constraint in block form. + float32 Cdot2; + Cdot2 = b2Dot(m_axis, vB - vA) + m_a2 * wB - m_a1 * wA; + b2Vec3 Cdot(Cdot1.x, Cdot1.y, Cdot2); + + b2Vec3 f1 = m_impulse; + b2Vec3 df = m_K.Solve33(-Cdot); + m_impulse += df; + + if (m_limitState == e_atLowerLimit) + { + m_impulse.z = b2Max(m_impulse.z, 0.0f); + } + else if (m_limitState == e_atUpperLimit) + { + m_impulse.z = b2Min(m_impulse.z, 0.0f); + } + + // f2(1:2) = invK(1:2,1:2) * (-Cdot(1:2) - K(1:2,3) * (f2(3) - f1(3))) + f1(1:2) + b2Vec2 b = -Cdot1 - (m_impulse.z - f1.z) * b2Vec2(m_K.ez.x, m_K.ez.y); + b2Vec2 f2r = m_K.Solve22(b) + b2Vec2(f1.x, f1.y); + m_impulse.x = f2r.x; + m_impulse.y = f2r.y; + + df = m_impulse - f1; + + b2Vec2 P = df.x * m_perp + df.z * m_axis; + float32 LA = df.x * m_s1 + df.y + df.z * m_a1; + float32 LB = df.x * m_s2 + df.y + df.z * m_a2; + + vA -= mA * P; + wA -= iA * LA; + + vB += mB * P; + wB += iB * LB; + } + else + { + // Limit is inactive, just solve the prismatic constraint in block form. + b2Vec2 df = m_K.Solve22(-Cdot1); + m_impulse.x += df.x; + m_impulse.y += df.y; + + b2Vec2 P = df.x * m_perp; + float32 LA = df.x * m_s1 + df.y; + float32 LB = df.x * m_s2 + df.y; + + vA -= mA * P; + wA -= iA * LA; + + vB += mB * P; + wB += iB * LB; + + b2Vec2 Cdot10 = Cdot1; + + Cdot1.x = b2Dot(m_perp, vB - vA) + m_s2 * wB - m_s1 * wA; + Cdot1.y = wB - wA; + + if (b2Abs(Cdot1.x) > 0.01f || b2Abs(Cdot1.y) > 0.01f) + { + b2Vec2 test = b2Mul22(m_K, df); + Cdot1.x += 0.0f; + } + } + + data.velocities[m_indexA].v = vA; + data.velocities[m_indexA].w = wA; + data.velocities[m_indexB].v = vB; + data.velocities[m_indexB].w = wB; +} + +bool b2PrismaticJoint::SolvePositionConstraints(const b2SolverData& data) +{ + b2Vec2 cA = data.positions[m_indexA].c; + float32 aA = data.positions[m_indexA].a; + b2Vec2 cB = data.positions[m_indexB].c; + float32 aB = data.positions[m_indexB].a; + + b2Rot qA(aA), qB(aB); + + float32 mA = m_invMassA, mB = m_invMassB; + float32 iA = m_invIA, iB = m_invIB; + + // Compute fresh Jacobians + b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA); + b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB); + b2Vec2 d = cB + rB - cA - rA; + + b2Vec2 axis = b2Mul(qA, m_localXAxisA); + float32 a1 = b2Cross(d + rA, axis); + float32 a2 = b2Cross(rB, axis); + b2Vec2 perp = b2Mul(qA, m_localYAxisA); + + float32 s1 = b2Cross(d + rA, perp); + float32 s2 = b2Cross(rB, perp); + + b2Vec3 impulse; + b2Vec2 C1; + C1.x = b2Dot(perp, d); + C1.y = aB - aA - m_referenceAngle; + + float32 linearError = b2Abs(C1.x); + float32 angularError = b2Abs(C1.y); + + bool active = false; + float32 C2 = 0.0f; + if (m_enableLimit) + { + float32 translation = b2Dot(axis, d); + if (b2Abs(m_upperTranslation - m_lowerTranslation) < 2.0f * b2_linearSlop) + { + // Prevent large angular corrections + C2 = b2Clamp(translation, -b2_maxLinearCorrection, b2_maxLinearCorrection); + linearError = b2Max(linearError, b2Abs(translation)); + active = true; + } + else if (translation <= m_lowerTranslation) + { + // Prevent large linear corrections and allow some slop. + C2 = b2Clamp(translation - m_lowerTranslation + b2_linearSlop, -b2_maxLinearCorrection, 0.0f); + linearError = b2Max(linearError, m_lowerTranslation - translation); + active = true; + } + else if (translation >= m_upperTranslation) + { + // Prevent large linear corrections and allow some slop. + C2 = b2Clamp(translation - m_upperTranslation - b2_linearSlop, 0.0f, b2_maxLinearCorrection); + linearError = b2Max(linearError, translation - m_upperTranslation); + active = true; + } + } + + if (active) + { + float32 k11 = mA + mB + iA * s1 * s1 + iB * s2 * s2; + float32 k12 = iA * s1 + iB * s2; + float32 k13 = iA * s1 * a1 + iB * s2 * a2; + float32 k22 = iA + iB; + if (k22 == 0.0f) + { + // For fixed rotation + k22 = 1.0f; + } + float32 k23 = iA * a1 + iB * a2; + float32 k33 = mA + mB + iA * a1 * a1 + iB * a2 * a2; + + b2Mat33 K; + K.ex.Set(k11, k12, k13); + K.ey.Set(k12, k22, k23); + K.ez.Set(k13, k23, k33); + + b2Vec3 C; + C.x = C1.x; + C.y = C1.y; + C.z = C2; + + impulse = K.Solve33(-C); + } + else + { + float32 k11 = mA + mB + iA * s1 * s1 + iB * s2 * s2; + float32 k12 = iA * s1 + iB * s2; + float32 k22 = iA + iB; + if (k22 == 0.0f) + { + k22 = 1.0f; + } + + b2Mat22 K; + K.ex.Set(k11, k12); + K.ey.Set(k12, k22); + + b2Vec2 impulse1 = K.Solve(-C1); + impulse.x = impulse1.x; + impulse.y = impulse1.y; + impulse.z = 0.0f; + } + + b2Vec2 P = impulse.x * perp + impulse.z * axis; + float32 LA = impulse.x * s1 + impulse.y + impulse.z * a1; + float32 LB = impulse.x * s2 + impulse.y + impulse.z * a2; + + cA -= mA * P; + aA -= iA * LA; + cB += mB * P; + aB += iB * LB; + + data.positions[m_indexA].c = cA; + data.positions[m_indexA].a = aA; + data.positions[m_indexB].c = cB; + data.positions[m_indexB].a = aB; + + return linearError <= b2_linearSlop && angularError <= b2_angularSlop; +} + +b2Vec2 b2PrismaticJoint::GetAnchorA() const +{ + return m_bodyA->GetWorldPoint(m_localAnchorA); +} + +b2Vec2 b2PrismaticJoint::GetAnchorB() const +{ + return m_bodyB->GetWorldPoint(m_localAnchorB); +} + +b2Vec2 b2PrismaticJoint::GetReactionForce(float32 inv_dt) const +{ + return inv_dt * (m_impulse.x * m_perp + (m_motorImpulse + m_impulse.z) * m_axis); +} + +float32 b2PrismaticJoint::GetReactionTorque(float32 inv_dt) const +{ + return inv_dt * m_impulse.y; +} + +float32 b2PrismaticJoint::GetJointTranslation() const +{ + b2Vec2 pA = m_bodyA->GetWorldPoint(m_localAnchorA); + b2Vec2 pB = m_bodyB->GetWorldPoint(m_localAnchorB); + b2Vec2 d = pB - pA; + b2Vec2 axis = m_bodyA->GetWorldVector(m_localXAxisA); + + float32 translation = b2Dot(d, axis); + return translation; +} + +float32 b2PrismaticJoint::GetJointSpeed() const +{ + b2Body* bA = m_bodyA; + b2Body* bB = m_bodyB; + + b2Vec2 rA = b2Mul(bA->m_xf.q, m_localAnchorA - bA->m_sweep.localCenter); + b2Vec2 rB = b2Mul(bB->m_xf.q, m_localAnchorB - bB->m_sweep.localCenter); + b2Vec2 p1 = bA->m_sweep.c + rA; + b2Vec2 p2 = bB->m_sweep.c + rB; + b2Vec2 d = p2 - p1; + b2Vec2 axis = b2Mul(bA->m_xf.q, m_localXAxisA); + + b2Vec2 vA = bA->m_linearVelocity; + b2Vec2 vB = bB->m_linearVelocity; + float32 wA = bA->m_angularVelocity; + float32 wB = bB->m_angularVelocity; + + float32 speed = b2Dot(d, b2Cross(wA, axis)) + b2Dot(axis, vB + b2Cross(wB, rB) - vA - b2Cross(wA, rA)); + return speed; +} + +bool b2PrismaticJoint::IsLimitEnabled() const +{ + return m_enableLimit; +} + +void b2PrismaticJoint::EnableLimit(bool flag) +{ + if (flag != m_enableLimit) + { + m_bodyA->SetAwake(true); + m_bodyB->SetAwake(true); + m_enableLimit = flag; + m_impulse.z = 0.0f; + } +} + +float32 b2PrismaticJoint::GetLowerLimit() const +{ + return m_lowerTranslation; +} + +float32 b2PrismaticJoint::GetUpperLimit() const +{ + return m_upperTranslation; +} + +void b2PrismaticJoint::SetLimits(float32 lower, float32 upper) +{ + b2Assert(lower <= upper); + if (lower != m_lowerTranslation || upper != m_upperTranslation) + { + m_bodyA->SetAwake(true); + m_bodyB->SetAwake(true); + m_lowerTranslation = lower; + m_upperTranslation = upper; + m_impulse.z = 0.0f; + } +} + +bool b2PrismaticJoint::IsMotorEnabled() const +{ + return m_enableMotor; +} + +void b2PrismaticJoint::EnableMotor(bool flag) +{ + m_bodyA->SetAwake(true); + m_bodyB->SetAwake(true); + m_enableMotor = flag; +} + +void b2PrismaticJoint::SetMotorSpeed(float32 speed) +{ + m_bodyA->SetAwake(true); + m_bodyB->SetAwake(true); + m_motorSpeed = speed; +} + +void b2PrismaticJoint::SetMaxMotorForce(float32 force) +{ + m_bodyA->SetAwake(true); + m_bodyB->SetAwake(true); + m_maxMotorForce = force; +} + +float32 b2PrismaticJoint::GetMotorForce(float32 inv_dt) const +{ + return inv_dt * m_motorImpulse; +} + +void b2PrismaticJoint::Dump() +{ + int32 indexA = m_bodyA->m_islandIndex; + int32 indexB = m_bodyB->m_islandIndex; + + b2Log(" b2PrismaticJointDef jd;\n"); + b2Log(" jd.bodyA = bodies[%d];\n", indexA); + b2Log(" jd.bodyB = bodies[%d];\n", indexB); + b2Log(" jd.collideConnected = bool(%d);\n", m_collideConnected); + b2Log(" jd.localAnchorA.Set(%.15lef, %.15lef);\n", m_localAnchorA.x, m_localAnchorA.y); + b2Log(" jd.localAnchorB.Set(%.15lef, %.15lef);\n", m_localAnchorB.x, m_localAnchorB.y); + b2Log(" jd.localAxisA.Set(%.15lef, %.15lef);\n", m_localXAxisA.x, m_localXAxisA.y); + b2Log(" jd.referenceAngle = %.15lef;\n", m_referenceAngle); + b2Log(" jd.enableLimit = bool(%d);\n", m_enableLimit); + b2Log(" jd.lowerTranslation = %.15lef;\n", m_lowerTranslation); + b2Log(" jd.upperTranslation = %.15lef;\n", m_upperTranslation); + b2Log(" jd.enableMotor = bool(%d);\n", m_enableMotor); + b2Log(" jd.motorSpeed = %.15lef;\n", m_motorSpeed); + b2Log(" jd.maxMotorForce = %.15lef;\n", m_maxMotorForce); + b2Log(" joints[%d] = m_world->CreateJoint(&jd);\n", m_index); +} diff --git a/external/box2d/Dynamics/Joints/b2PrismaticJoint.h b/external/box2d/Dynamics/Joints/b2PrismaticJoint.h new file mode 100644 index 0000000000..aca2859b45 --- /dev/null +++ b/external/box2d/Dynamics/Joints/b2PrismaticJoint.h @@ -0,0 +1,196 @@ +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_PRISMATIC_JOINT_H +#define B2_PRISMATIC_JOINT_H + +#include + +/// Prismatic joint definition. This requires defining a line of +/// motion using an axis and an anchor point. The definition uses local +/// anchor points and a local axis so that the initial configuration +/// can violate the constraint slightly. The joint translation is zero +/// when the local anchor points coincide in world space. Using local +/// anchors and a local axis helps when saving and loading a game. +struct b2PrismaticJointDef : public b2JointDef +{ + b2PrismaticJointDef() + { + type = e_prismaticJoint; + localAnchorA.SetZero(); + localAnchorB.SetZero(); + localAxisA.Set(1.0f, 0.0f); + referenceAngle = 0.0f; + enableLimit = false; + lowerTranslation = 0.0f; + upperTranslation = 0.0f; + enableMotor = false; + maxMotorForce = 0.0f; + motorSpeed = 0.0f; + } + + /// Initialize the bodies, anchors, axis, and reference angle using the world + /// anchor and unit world axis. + void Initialize(b2Body* bodyA, b2Body* bodyB, const b2Vec2& anchor, const b2Vec2& axis); + + /// The local anchor point relative to bodyA's origin. + b2Vec2 localAnchorA; + + /// The local anchor point relative to bodyB's origin. + b2Vec2 localAnchorB; + + /// The local translation unit axis in bodyA. + b2Vec2 localAxisA; + + /// The constrained angle between the bodies: bodyB_angle - bodyA_angle. + float32 referenceAngle; + + /// Enable/disable the joint limit. + bool enableLimit; + + /// The lower translation limit, usually in meters. + float32 lowerTranslation; + + /// The upper translation limit, usually in meters. + float32 upperTranslation; + + /// Enable/disable the joint motor. + bool enableMotor; + + /// The maximum motor torque, usually in N-m. + float32 maxMotorForce; + + /// The desired motor speed in radians per second. + float32 motorSpeed; +}; + +/// A prismatic joint. This joint provides one degree of freedom: translation +/// along an axis fixed in bodyA. Relative rotation is prevented. You can +/// use a joint limit to restrict the range of motion and a joint motor to +/// drive the motion or to model joint friction. +class b2PrismaticJoint : public b2Joint +{ +public: + b2Vec2 GetAnchorA() const; + b2Vec2 GetAnchorB() const; + + b2Vec2 GetReactionForce(float32 inv_dt) const; + float32 GetReactionTorque(float32 inv_dt) const; + + /// The local anchor point relative to bodyA's origin. + const b2Vec2& GetLocalAnchorA() const { return m_localAnchorA; } + + /// The local anchor point relative to bodyB's origin. + const b2Vec2& GetLocalAnchorB() const { return m_localAnchorB; } + + /// The local joint axis relative to bodyA. + const b2Vec2& GetLocalAxisA() const { return m_localXAxisA; } + + /// Get the reference angle. + float32 GetReferenceAngle() const { return m_referenceAngle; } + + /// Get the current joint translation, usually in meters. + float32 GetJointTranslation() const; + + /// Get the current joint translation speed, usually in meters per second. + float32 GetJointSpeed() const; + + /// Is the joint limit enabled? + bool IsLimitEnabled() const; + + /// Enable/disable the joint limit. + void EnableLimit(bool flag); + + /// Get the lower joint limit, usually in meters. + float32 GetLowerLimit() const; + + /// Get the upper joint limit, usually in meters. + float32 GetUpperLimit() const; + + /// Set the joint limits, usually in meters. + void SetLimits(float32 lower, float32 upper); + + /// Is the joint motor enabled? + bool IsMotorEnabled() const; + + /// Enable/disable the joint motor. + void EnableMotor(bool flag); + + /// Set the motor speed, usually in meters per second. + void SetMotorSpeed(float32 speed); + + /// Get the motor speed, usually in meters per second. + float32 GetMotorSpeed() const; + + /// Set the maximum motor force, usually in N. + void SetMaxMotorForce(float32 force); + float32 GetMaxMotorForce() const { return m_maxMotorForce; } + + /// Get the current motor force given the inverse time step, usually in N. + float32 GetMotorForce(float32 inv_dt) const; + + /// Dump to b2Log + void Dump(); + +protected: + friend class b2Joint; + friend class b2GearJoint; + b2PrismaticJoint(const b2PrismaticJointDef* def); + + void InitVelocityConstraints(const b2SolverData& data); + void SolveVelocityConstraints(const b2SolverData& data); + bool SolvePositionConstraints(const b2SolverData& data); + + // Solver shared + b2Vec2 m_localAnchorA; + b2Vec2 m_localAnchorB; + b2Vec2 m_localXAxisA; + b2Vec2 m_localYAxisA; + float32 m_referenceAngle; + b2Vec3 m_impulse; + float32 m_motorImpulse; + float32 m_lowerTranslation; + float32 m_upperTranslation; + float32 m_maxMotorForce; + float32 m_motorSpeed; + bool m_enableLimit; + bool m_enableMotor; + b2LimitState m_limitState; + + // Solver temp + int32 m_indexA; + int32 m_indexB; + b2Vec2 m_localCenterA; + b2Vec2 m_localCenterB; + float32 m_invMassA; + float32 m_invMassB; + float32 m_invIA; + float32 m_invIB; + b2Vec2 m_axis, m_perp; + float32 m_s1, m_s2; + float32 m_a1, m_a2; + b2Mat33 m_K; + float32 m_motorMass; +}; + +inline float32 b2PrismaticJoint::GetMotorSpeed() const +{ + return m_motorSpeed; +} + +#endif diff --git a/external/box2d/Dynamics/Joints/b2PulleyJoint.cpp b/external/box2d/Dynamics/Joints/b2PulleyJoint.cpp new file mode 100644 index 0000000000..da30fae222 --- /dev/null +++ b/external/box2d/Dynamics/Joints/b2PulleyJoint.cpp @@ -0,0 +1,332 @@ +/* +* Copyright (c) 2007 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include + +// Pulley: +// length1 = norm(p1 - s1) +// length2 = norm(p2 - s2) +// C0 = (length1 + ratio * length2)_initial +// C = C0 - (length1 + ratio * length2) +// u1 = (p1 - s1) / norm(p1 - s1) +// u2 = (p2 - s2) / norm(p2 - s2) +// Cdot = -dot(u1, v1 + cross(w1, r1)) - ratio * dot(u2, v2 + cross(w2, r2)) +// J = -[u1 cross(r1, u1) ratio * u2 ratio * cross(r2, u2)] +// K = J * invM * JT +// = invMass1 + invI1 * cross(r1, u1)^2 + ratio^2 * (invMass2 + invI2 * cross(r2, u2)^2) + +void b2PulleyJointDef::Initialize(b2Body* bA, b2Body* bB, + const b2Vec2& groundA, const b2Vec2& groundB, + const b2Vec2& anchorA, const b2Vec2& anchorB, + float32 r) +{ + bodyA = bA; + bodyB = bB; + groundAnchorA = groundA; + groundAnchorB = groundB; + localAnchorA = bodyA->GetLocalPoint(anchorA); + localAnchorB = bodyB->GetLocalPoint(anchorB); + b2Vec2 dA = anchorA - groundA; + lengthA = dA.Length(); + b2Vec2 dB = anchorB - groundB; + lengthB = dB.Length(); + ratio = r; + b2Assert(ratio > b2_epsilon); +} + +b2PulleyJoint::b2PulleyJoint(const b2PulleyJointDef* def) +: b2Joint(def) +{ + m_groundAnchorA = def->groundAnchorA; + m_groundAnchorB = def->groundAnchorB; + m_localAnchorA = def->localAnchorA; + m_localAnchorB = def->localAnchorB; + + m_lengthA = def->lengthA; + m_lengthB = def->lengthB; + + b2Assert(def->ratio != 0.0f); + m_ratio = def->ratio; + + m_constant = def->lengthA + m_ratio * def->lengthB; + + m_impulse = 0.0f; +} + +void b2PulleyJoint::InitVelocityConstraints(const b2SolverData& data) +{ + m_indexA = m_bodyA->m_islandIndex; + m_indexB = m_bodyB->m_islandIndex; + m_localCenterA = m_bodyA->m_sweep.localCenter; + m_localCenterB = m_bodyB->m_sweep.localCenter; + m_invMassA = m_bodyA->m_invMass; + m_invMassB = m_bodyB->m_invMass; + m_invIA = m_bodyA->m_invI; + m_invIB = m_bodyB->m_invI; + + b2Vec2 cA = data.positions[m_indexA].c; + float32 aA = data.positions[m_indexA].a; + b2Vec2 vA = data.velocities[m_indexA].v; + float32 wA = data.velocities[m_indexA].w; + + b2Vec2 cB = data.positions[m_indexB].c; + float32 aB = data.positions[m_indexB].a; + b2Vec2 vB = data.velocities[m_indexB].v; + float32 wB = data.velocities[m_indexB].w; + + b2Rot qA(aA), qB(aB); + + m_rA = b2Mul(qA, m_localAnchorA - m_localCenterA); + m_rB = b2Mul(qB, m_localAnchorB - m_localCenterB); + + // Get the pulley axes. + m_uA = cA + m_rA - m_groundAnchorA; + m_uB = cB + m_rB - m_groundAnchorB; + + float32 lengthA = m_uA.Length(); + float32 lengthB = m_uB.Length(); + + if (lengthA > 10.0f * b2_linearSlop) + { + m_uA *= 1.0f / lengthA; + } + else + { + m_uA.SetZero(); + } + + if (lengthB > 10.0f * b2_linearSlop) + { + m_uB *= 1.0f / lengthB; + } + else + { + m_uB.SetZero(); + } + + // Compute effective mass. + float32 ruA = b2Cross(m_rA, m_uA); + float32 ruB = b2Cross(m_rB, m_uB); + + float32 mA = m_invMassA + m_invIA * ruA * ruA; + float32 mB = m_invMassB + m_invIB * ruB * ruB; + + m_mass = mA + m_ratio * m_ratio * mB; + + if (m_mass > 0.0f) + { + m_mass = 1.0f / m_mass; + } + + if (data.step.warmStarting) + { + // Scale impulses to support variable time steps. + m_impulse *= data.step.dtRatio; + + // Warm starting. + b2Vec2 PA = -(m_impulse) * m_uA; + b2Vec2 PB = (-m_ratio * m_impulse) * m_uB; + + vA += m_invMassA * PA; + wA += m_invIA * b2Cross(m_rA, PA); + vB += m_invMassB * PB; + wB += m_invIB * b2Cross(m_rB, PB); + } + else + { + m_impulse = 0.0f; + } + + data.velocities[m_indexA].v = vA; + data.velocities[m_indexA].w = wA; + data.velocities[m_indexB].v = vB; + data.velocities[m_indexB].w = wB; +} + +void b2PulleyJoint::SolveVelocityConstraints(const b2SolverData& data) +{ + b2Vec2 vA = data.velocities[m_indexA].v; + float32 wA = data.velocities[m_indexA].w; + b2Vec2 vB = data.velocities[m_indexB].v; + float32 wB = data.velocities[m_indexB].w; + + b2Vec2 vpA = vA + b2Cross(wA, m_rA); + b2Vec2 vpB = vB + b2Cross(wB, m_rB); + + float32 Cdot = -b2Dot(m_uA, vpA) - m_ratio * b2Dot(m_uB, vpB); + float32 impulse = -m_mass * Cdot; + m_impulse += impulse; + + b2Vec2 PA = -impulse * m_uA; + b2Vec2 PB = -m_ratio * impulse * m_uB; + vA += m_invMassA * PA; + wA += m_invIA * b2Cross(m_rA, PA); + vB += m_invMassB * PB; + wB += m_invIB * b2Cross(m_rB, PB); + + data.velocities[m_indexA].v = vA; + data.velocities[m_indexA].w = wA; + data.velocities[m_indexB].v = vB; + data.velocities[m_indexB].w = wB; +} + +bool b2PulleyJoint::SolvePositionConstraints(const b2SolverData& data) +{ + b2Vec2 cA = data.positions[m_indexA].c; + float32 aA = data.positions[m_indexA].a; + b2Vec2 cB = data.positions[m_indexB].c; + float32 aB = data.positions[m_indexB].a; + + b2Rot qA(aA), qB(aB); + + b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA); + b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB); + + // Get the pulley axes. + b2Vec2 uA = cA + rA - m_groundAnchorA; + b2Vec2 uB = cB + rB - m_groundAnchorB; + + float32 lengthA = uA.Length(); + float32 lengthB = uB.Length(); + + if (lengthA > 10.0f * b2_linearSlop) + { + uA *= 1.0f / lengthA; + } + else + { + uA.SetZero(); + } + + if (lengthB > 10.0f * b2_linearSlop) + { + uB *= 1.0f / lengthB; + } + else + { + uB.SetZero(); + } + + // Compute effective mass. + float32 ruA = b2Cross(rA, uA); + float32 ruB = b2Cross(rB, uB); + + float32 mA = m_invMassA + m_invIA * ruA * ruA; + float32 mB = m_invMassB + m_invIB * ruB * ruB; + + float32 mass = mA + m_ratio * m_ratio * mB; + + if (mass > 0.0f) + { + mass = 1.0f / mass; + } + + float32 C = m_constant - lengthA - m_ratio * lengthB; + float32 linearError = b2Abs(C); + + float32 impulse = -mass * C; + + b2Vec2 PA = -impulse * uA; + b2Vec2 PB = -m_ratio * impulse * uB; + + cA += m_invMassA * PA; + aA += m_invIA * b2Cross(rA, PA); + cB += m_invMassB * PB; + aB += m_invIB * b2Cross(rB, PB); + + data.positions[m_indexA].c = cA; + data.positions[m_indexA].a = aA; + data.positions[m_indexB].c = cB; + data.positions[m_indexB].a = aB; + + return linearError < b2_linearSlop; +} + +b2Vec2 b2PulleyJoint::GetAnchorA() const +{ + return m_bodyA->GetWorldPoint(m_localAnchorA); +} + +b2Vec2 b2PulleyJoint::GetAnchorB() const +{ + return m_bodyB->GetWorldPoint(m_localAnchorB); +} + +b2Vec2 b2PulleyJoint::GetReactionForce(float32 inv_dt) const +{ + b2Vec2 P = m_impulse * m_uB; + return inv_dt * P; +} + +float32 b2PulleyJoint::GetReactionTorque(float32 inv_dt) const +{ + B2_NOT_USED(inv_dt); + return 0.0f; +} + +b2Vec2 b2PulleyJoint::GetGroundAnchorA() const +{ + return m_groundAnchorA; +} + +b2Vec2 b2PulleyJoint::GetGroundAnchorB() const +{ + return m_groundAnchorB; +} + +float32 b2PulleyJoint::GetLengthA() const +{ + b2Vec2 p = m_bodyA->GetWorldPoint(m_localAnchorA); + b2Vec2 s = m_groundAnchorA; + b2Vec2 d = p - s; + return d.Length(); +} + +float32 b2PulleyJoint::GetLengthB() const +{ + b2Vec2 p = m_bodyB->GetWorldPoint(m_localAnchorB); + b2Vec2 s = m_groundAnchorB; + b2Vec2 d = p - s; + return d.Length(); +} + +float32 b2PulleyJoint::GetRatio() const +{ + return m_ratio; +} + +void b2PulleyJoint::Dump() +{ + int32 indexA = m_bodyA->m_islandIndex; + int32 indexB = m_bodyB->m_islandIndex; + + b2Log(" b2PulleyJointDef jd;\n"); + b2Log(" jd.bodyA = bodies[%d];\n", indexA); + b2Log(" jd.bodyB = bodies[%d];\n", indexB); + b2Log(" jd.collideConnected = bool(%d);\n", m_collideConnected); + b2Log(" jd.groundAnchorA.Set(%.15lef, %.15lef);\n", m_groundAnchorA.x, m_groundAnchorA.y); + b2Log(" jd.groundAnchorB.Set(%.15lef, %.15lef);\n", m_groundAnchorB.x, m_groundAnchorB.y); + b2Log(" jd.localAnchorA.Set(%.15lef, %.15lef);\n", m_localAnchorA.x, m_localAnchorA.y); + b2Log(" jd.localAnchorB.Set(%.15lef, %.15lef);\n", m_localAnchorB.x, m_localAnchorB.y); + b2Log(" jd.lengthA = %.15lef;\n", m_lengthA); + b2Log(" jd.lengthB = %.15lef;\n", m_lengthB); + b2Log(" jd.ratio = %.15lef;\n", m_ratio); + b2Log(" joints[%d] = m_world->CreateJoint(&jd);\n", m_index); +} diff --git a/external/box2d/Dynamics/Joints/b2PulleyJoint.h b/external/box2d/Dynamics/Joints/b2PulleyJoint.h new file mode 100644 index 0000000000..2f6df4395c --- /dev/null +++ b/external/box2d/Dynamics/Joints/b2PulleyJoint.h @@ -0,0 +1,143 @@ +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_PULLEY_JOINT_H +#define B2_PULLEY_JOINT_H + +#include + +const float32 b2_minPulleyLength = 2.0f; + +/// Pulley joint definition. This requires two ground anchors, +/// two dynamic body anchor points, and a pulley ratio. +struct b2PulleyJointDef : public b2JointDef +{ + b2PulleyJointDef() + { + type = e_pulleyJoint; + groundAnchorA.Set(-1.0f, 1.0f); + groundAnchorB.Set(1.0f, 1.0f); + localAnchorA.Set(-1.0f, 0.0f); + localAnchorB.Set(1.0f, 0.0f); + lengthA = 0.0f; + lengthB = 0.0f; + ratio = 1.0f; + collideConnected = true; + } + + /// Initialize the bodies, anchors, lengths, max lengths, and ratio using the world anchors. + void Initialize(b2Body* bodyA, b2Body* bodyB, + const b2Vec2& groundAnchorA, const b2Vec2& groundAnchorB, + const b2Vec2& anchorA, const b2Vec2& anchorB, + float32 ratio); + + /// The first ground anchor in world coordinates. This point never moves. + b2Vec2 groundAnchorA; + + /// The second ground anchor in world coordinates. This point never moves. + b2Vec2 groundAnchorB; + + /// The local anchor point relative to bodyA's origin. + b2Vec2 localAnchorA; + + /// The local anchor point relative to bodyB's origin. + b2Vec2 localAnchorB; + + /// The a reference length for the segment attached to bodyA. + float32 lengthA; + + /// The a reference length for the segment attached to bodyB. + float32 lengthB; + + /// The pulley ratio, used to simulate a block-and-tackle. + float32 ratio; +}; + +/// The pulley joint is connected to two bodies and two fixed ground points. +/// The pulley supports a ratio such that: +/// length1 + ratio * length2 <= constant +/// Yes, the force transmitted is scaled by the ratio. +/// Warning: the pulley joint can get a bit squirrelly by itself. They often +/// work better when combined with prismatic joints. You should also cover the +/// the anchor points with static shapes to prevent one side from going to +/// zero length. +class b2PulleyJoint : public b2Joint +{ +public: + b2Vec2 GetAnchorA() const; + b2Vec2 GetAnchorB() const; + + b2Vec2 GetReactionForce(float32 inv_dt) const; + float32 GetReactionTorque(float32 inv_dt) const; + + /// Get the first ground anchor. + b2Vec2 GetGroundAnchorA() const; + + /// Get the second ground anchor. + b2Vec2 GetGroundAnchorB() const; + + /// Get the current length of the segment attached to bodyA. + float32 GetLengthA() const; + + /// Get the current length of the segment attached to bodyB. + float32 GetLengthB() const; + + /// Get the pulley ratio. + float32 GetRatio() const; + + /// Dump joint to dmLog + void Dump(); + +protected: + + friend class b2Joint; + b2PulleyJoint(const b2PulleyJointDef* data); + + void InitVelocityConstraints(const b2SolverData& data); + void SolveVelocityConstraints(const b2SolverData& data); + bool SolvePositionConstraints(const b2SolverData& data); + + b2Vec2 m_groundAnchorA; + b2Vec2 m_groundAnchorB; + float32 m_lengthA; + float32 m_lengthB; + + // Solver shared + b2Vec2 m_localAnchorA; + b2Vec2 m_localAnchorB; + float32 m_constant; + float32 m_ratio; + float32 m_impulse; + + // Solver temp + int32 m_indexA; + int32 m_indexB; + b2Vec2 m_uA; + b2Vec2 m_uB; + b2Vec2 m_rA; + b2Vec2 m_rB; + b2Vec2 m_localCenterA; + b2Vec2 m_localCenterB; + float32 m_invMassA; + float32 m_invMassB; + float32 m_invIA; + float32 m_invIB; + float32 m_mass; +}; + +#endif diff --git a/external/box2d/Dynamics/Joints/b2RevoluteJoint.cpp b/external/box2d/Dynamics/Joints/b2RevoluteJoint.cpp new file mode 100644 index 0000000000..e265d8192b --- /dev/null +++ b/external/box2d/Dynamics/Joints/b2RevoluteJoint.cpp @@ -0,0 +1,504 @@ +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include + +// Point-to-point constraint +// C = p2 - p1 +// Cdot = v2 - v1 +// = v2 + cross(w2, r2) - v1 - cross(w1, r1) +// J = [-I -r1_skew I r2_skew ] +// Identity used: +// w k % (rx i + ry j) = w * (-ry i + rx j) + +// Motor constraint +// Cdot = w2 - w1 +// J = [0 0 -1 0 0 1] +// K = invI1 + invI2 + +void b2RevoluteJointDef::Initialize(b2Body* bA, b2Body* bB, const b2Vec2& anchor) +{ + bodyA = bA; + bodyB = bB; + localAnchorA = bodyA->GetLocalPoint(anchor); + localAnchorB = bodyB->GetLocalPoint(anchor); + referenceAngle = bodyB->GetAngle() - bodyA->GetAngle(); +} + +b2RevoluteJoint::b2RevoluteJoint(const b2RevoluteJointDef* def) +: b2Joint(def) +{ + m_localAnchorA = def->localAnchorA; + m_localAnchorB = def->localAnchorB; + m_referenceAngle = def->referenceAngle; + + m_impulse.SetZero(); + m_motorImpulse = 0.0f; + + m_lowerAngle = def->lowerAngle; + m_upperAngle = def->upperAngle; + m_maxMotorTorque = def->maxMotorTorque; + m_motorSpeed = def->motorSpeed; + m_enableLimit = def->enableLimit; + m_enableMotor = def->enableMotor; + m_limitState = e_inactiveLimit; +} + +void b2RevoluteJoint::InitVelocityConstraints(const b2SolverData& data) +{ + m_indexA = m_bodyA->m_islandIndex; + m_indexB = m_bodyB->m_islandIndex; + m_localCenterA = m_bodyA->m_sweep.localCenter; + m_localCenterB = m_bodyB->m_sweep.localCenter; + m_invMassA = m_bodyA->m_invMass; + m_invMassB = m_bodyB->m_invMass; + m_invIA = m_bodyA->m_invI; + m_invIB = m_bodyB->m_invI; + + b2Vec2 cA = data.positions[m_indexA].c; + float32 aA = data.positions[m_indexA].a; + b2Vec2 vA = data.velocities[m_indexA].v; + float32 wA = data.velocities[m_indexA].w; + + b2Vec2 cB = data.positions[m_indexB].c; + float32 aB = data.positions[m_indexB].a; + b2Vec2 vB = data.velocities[m_indexB].v; + float32 wB = data.velocities[m_indexB].w; + + b2Rot qA(aA), qB(aB); + + m_rA = b2Mul(qA, m_localAnchorA - m_localCenterA); + m_rB = b2Mul(qB, m_localAnchorB - m_localCenterB); + + // J = [-I -r1_skew I r2_skew] + // [ 0 -1 0 1] + // r_skew = [-ry; rx] + + // Matlab + // K = [ mA+r1y^2*iA+mB+r2y^2*iB, -r1y*iA*r1x-r2y*iB*r2x, -r1y*iA-r2y*iB] + // [ -r1y*iA*r1x-r2y*iB*r2x, mA+r1x^2*iA+mB+r2x^2*iB, r1x*iA+r2x*iB] + // [ -r1y*iA-r2y*iB, r1x*iA+r2x*iB, iA+iB] + + float32 mA = m_invMassA, mB = m_invMassB; + float32 iA = m_invIA, iB = m_invIB; + + bool fixedRotation = (iA + iB == 0.0f); + + m_mass.ex.x = mA + mB + m_rA.y * m_rA.y * iA + m_rB.y * m_rB.y * iB; + m_mass.ey.x = -m_rA.y * m_rA.x * iA - m_rB.y * m_rB.x * iB; + m_mass.ez.x = -m_rA.y * iA - m_rB.y * iB; + m_mass.ex.y = m_mass.ey.x; + m_mass.ey.y = mA + mB + m_rA.x * m_rA.x * iA + m_rB.x * m_rB.x * iB; + m_mass.ez.y = m_rA.x * iA + m_rB.x * iB; + m_mass.ex.z = m_mass.ez.x; + m_mass.ey.z = m_mass.ez.y; + m_mass.ez.z = iA + iB; + + m_motorMass = iA + iB; + if (m_motorMass > 0.0f) + { + m_motorMass = 1.0f / m_motorMass; + } + + if (m_enableMotor == false || fixedRotation) + { + m_motorImpulse = 0.0f; + } + + if (m_enableLimit && fixedRotation == false) + { + float32 jointAngle = aB - aA - m_referenceAngle; + if (b2Abs(m_upperAngle - m_lowerAngle) < 2.0f * b2_angularSlop) + { + m_limitState = e_equalLimits; + } + else if (jointAngle <= m_lowerAngle) + { + if (m_limitState != e_atLowerLimit) + { + m_impulse.z = 0.0f; + } + m_limitState = e_atLowerLimit; + } + else if (jointAngle >= m_upperAngle) + { + if (m_limitState != e_atUpperLimit) + { + m_impulse.z = 0.0f; + } + m_limitState = e_atUpperLimit; + } + else + { + m_limitState = e_inactiveLimit; + m_impulse.z = 0.0f; + } + } + else + { + m_limitState = e_inactiveLimit; + } + + if (data.step.warmStarting) + { + // Scale impulses to support a variable time step. + m_impulse *= data.step.dtRatio; + m_motorImpulse *= data.step.dtRatio; + + b2Vec2 P(m_impulse.x, m_impulse.y); + + vA -= mA * P; + wA -= iA * (b2Cross(m_rA, P) + m_motorImpulse + m_impulse.z); + + vB += mB * P; + wB += iB * (b2Cross(m_rB, P) + m_motorImpulse + m_impulse.z); + } + else + { + m_impulse.SetZero(); + m_motorImpulse = 0.0f; + } + + data.velocities[m_indexA].v = vA; + data.velocities[m_indexA].w = wA; + data.velocities[m_indexB].v = vB; + data.velocities[m_indexB].w = wB; +} + +void b2RevoluteJoint::SolveVelocityConstraints(const b2SolverData& data) +{ + b2Vec2 vA = data.velocities[m_indexA].v; + float32 wA = data.velocities[m_indexA].w; + b2Vec2 vB = data.velocities[m_indexB].v; + float32 wB = data.velocities[m_indexB].w; + + float32 mA = m_invMassA, mB = m_invMassB; + float32 iA = m_invIA, iB = m_invIB; + + bool fixedRotation = (iA + iB == 0.0f); + + // Solve motor constraint. + if (m_enableMotor && m_limitState != e_equalLimits && fixedRotation == false) + { + float32 Cdot = wB - wA - m_motorSpeed; + float32 impulse = -m_motorMass * Cdot; + float32 oldImpulse = m_motorImpulse; + float32 maxImpulse = data.step.dt * m_maxMotorTorque; + m_motorImpulse = b2Clamp(m_motorImpulse + impulse, -maxImpulse, maxImpulse); + impulse = m_motorImpulse - oldImpulse; + + wA -= iA * impulse; + wB += iB * impulse; + } + + // Solve limit constraint. + if (m_enableLimit && m_limitState != e_inactiveLimit && fixedRotation == false) + { + b2Vec2 Cdot1 = vB + b2Cross(wB, m_rB) - vA - b2Cross(wA, m_rA); + float32 Cdot2 = wB - wA; + b2Vec3 Cdot(Cdot1.x, Cdot1.y, Cdot2); + + b2Vec3 impulse = -m_mass.Solve33(Cdot); + + if (m_limitState == e_equalLimits) + { + m_impulse += impulse; + } + else if (m_limitState == e_atLowerLimit) + { + float32 newImpulse = m_impulse.z + impulse.z; + if (newImpulse < 0.0f) + { + b2Vec2 rhs = -Cdot1 + m_impulse.z * b2Vec2(m_mass.ez.x, m_mass.ez.y); + b2Vec2 reduced = m_mass.Solve22(rhs); + impulse.x = reduced.x; + impulse.y = reduced.y; + impulse.z = -m_impulse.z; + m_impulse.x += reduced.x; + m_impulse.y += reduced.y; + m_impulse.z = 0.0f; + } + else + { + m_impulse += impulse; + } + } + else if (m_limitState == e_atUpperLimit) + { + float32 newImpulse = m_impulse.z + impulse.z; + if (newImpulse > 0.0f) + { + b2Vec2 rhs = -Cdot1 + m_impulse.z * b2Vec2(m_mass.ez.x, m_mass.ez.y); + b2Vec2 reduced = m_mass.Solve22(rhs); + impulse.x = reduced.x; + impulse.y = reduced.y; + impulse.z = -m_impulse.z; + m_impulse.x += reduced.x; + m_impulse.y += reduced.y; + m_impulse.z = 0.0f; + } + else + { + m_impulse += impulse; + } + } + + b2Vec2 P(impulse.x, impulse.y); + + vA -= mA * P; + wA -= iA * (b2Cross(m_rA, P) + impulse.z); + + vB += mB * P; + wB += iB * (b2Cross(m_rB, P) + impulse.z); + } + else + { + // Solve point-to-point constraint + b2Vec2 Cdot = vB + b2Cross(wB, m_rB) - vA - b2Cross(wA, m_rA); + b2Vec2 impulse = m_mass.Solve22(-Cdot); + + m_impulse.x += impulse.x; + m_impulse.y += impulse.y; + + vA -= mA * impulse; + wA -= iA * b2Cross(m_rA, impulse); + + vB += mB * impulse; + wB += iB * b2Cross(m_rB, impulse); + } + + data.velocities[m_indexA].v = vA; + data.velocities[m_indexA].w = wA; + data.velocities[m_indexB].v = vB; + data.velocities[m_indexB].w = wB; +} + +bool b2RevoluteJoint::SolvePositionConstraints(const b2SolverData& data) +{ + b2Vec2 cA = data.positions[m_indexA].c; + float32 aA = data.positions[m_indexA].a; + b2Vec2 cB = data.positions[m_indexB].c; + float32 aB = data.positions[m_indexB].a; + + b2Rot qA(aA), qB(aB); + + float32 angularError = 0.0f; + float32 positionError = 0.0f; + + bool fixedRotation = (m_invIA + m_invIB == 0.0f); + + // Solve angular limit constraint. + if (m_enableLimit && m_limitState != e_inactiveLimit && fixedRotation == false) + { + float32 angle = aB - aA - m_referenceAngle; + float32 limitImpulse = 0.0f; + + if (m_limitState == e_equalLimits) + { + // Prevent large angular corrections + float32 C = b2Clamp(angle - m_lowerAngle, -b2_maxAngularCorrection, b2_maxAngularCorrection); + limitImpulse = -m_motorMass * C; + angularError = b2Abs(C); + } + else if (m_limitState == e_atLowerLimit) + { + float32 C = angle - m_lowerAngle; + angularError = -C; + + // Prevent large angular corrections and allow some slop. + C = b2Clamp(C + b2_angularSlop, -b2_maxAngularCorrection, 0.0f); + limitImpulse = -m_motorMass * C; + } + else if (m_limitState == e_atUpperLimit) + { + float32 C = angle - m_upperAngle; + angularError = C; + + // Prevent large angular corrections and allow some slop. + C = b2Clamp(C - b2_angularSlop, 0.0f, b2_maxAngularCorrection); + limitImpulse = -m_motorMass * C; + } + + aA -= m_invIA * limitImpulse; + aB += m_invIB * limitImpulse; + } + + // Solve point-to-point constraint. + { + qA.Set(aA); + qB.Set(aB); + b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA); + b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB); + + b2Vec2 C = cB + rB - cA - rA; + positionError = C.Length(); + + float32 mA = m_invMassA, mB = m_invMassB; + float32 iA = m_invIA, iB = m_invIB; + + b2Mat22 K; + K.ex.x = mA + mB + iA * rA.y * rA.y + iB * rB.y * rB.y; + K.ex.y = -iA * rA.x * rA.y - iB * rB.x * rB.y; + K.ey.x = K.ex.y; + K.ey.y = mA + mB + iA * rA.x * rA.x + iB * rB.x * rB.x; + + b2Vec2 impulse = -K.Solve(C); + + cA -= mA * impulse; + aA -= iA * b2Cross(rA, impulse); + + cB += mB * impulse; + aB += iB * b2Cross(rB, impulse); + } + + data.positions[m_indexA].c = cA; + data.positions[m_indexA].a = aA; + data.positions[m_indexB].c = cB; + data.positions[m_indexB].a = aB; + + return positionError <= b2_linearSlop && angularError <= b2_angularSlop; +} + +b2Vec2 b2RevoluteJoint::GetAnchorA() const +{ + return m_bodyA->GetWorldPoint(m_localAnchorA); +} + +b2Vec2 b2RevoluteJoint::GetAnchorB() const +{ + return m_bodyB->GetWorldPoint(m_localAnchorB); +} + +b2Vec2 b2RevoluteJoint::GetReactionForce(float32 inv_dt) const +{ + b2Vec2 P(m_impulse.x, m_impulse.y); + return inv_dt * P; +} + +float32 b2RevoluteJoint::GetReactionTorque(float32 inv_dt) const +{ + return inv_dt * m_impulse.z; +} + +float32 b2RevoluteJoint::GetJointAngle() const +{ + b2Body* bA = m_bodyA; + b2Body* bB = m_bodyB; + return bB->m_sweep.a - bA->m_sweep.a - m_referenceAngle; +} + +float32 b2RevoluteJoint::GetJointSpeed() const +{ + b2Body* bA = m_bodyA; + b2Body* bB = m_bodyB; + return bB->m_angularVelocity - bA->m_angularVelocity; +} + +bool b2RevoluteJoint::IsMotorEnabled() const +{ + return m_enableMotor; +} + +void b2RevoluteJoint::EnableMotor(bool flag) +{ + m_bodyA->SetAwake(true); + m_bodyB->SetAwake(true); + m_enableMotor = flag; +} + +float32 b2RevoluteJoint::GetMotorTorque(float32 inv_dt) const +{ + return inv_dt * m_motorImpulse; +} + +void b2RevoluteJoint::SetMotorSpeed(float32 speed) +{ + m_bodyA->SetAwake(true); + m_bodyB->SetAwake(true); + m_motorSpeed = speed; +} + +void b2RevoluteJoint::SetMaxMotorTorque(float32 torque) +{ + m_bodyA->SetAwake(true); + m_bodyB->SetAwake(true); + m_maxMotorTorque = torque; +} + +bool b2RevoluteJoint::IsLimitEnabled() const +{ + return m_enableLimit; +} + +void b2RevoluteJoint::EnableLimit(bool flag) +{ + if (flag != m_enableLimit) + { + m_bodyA->SetAwake(true); + m_bodyB->SetAwake(true); + m_enableLimit = flag; + m_impulse.z = 0.0f; + } +} + +float32 b2RevoluteJoint::GetLowerLimit() const +{ + return m_lowerAngle; +} + +float32 b2RevoluteJoint::GetUpperLimit() const +{ + return m_upperAngle; +} + +void b2RevoluteJoint::SetLimits(float32 lower, float32 upper) +{ + b2Assert(lower <= upper); + + if (lower != m_lowerAngle || upper != m_upperAngle) + { + m_bodyA->SetAwake(true); + m_bodyB->SetAwake(true); + m_impulse.z = 0.0f; + m_lowerAngle = lower; + m_upperAngle = upper; + } +} + +void b2RevoluteJoint::Dump() +{ + int32 indexA = m_bodyA->m_islandIndex; + int32 indexB = m_bodyB->m_islandIndex; + + b2Log(" b2RevoluteJointDef jd;\n"); + b2Log(" jd.bodyA = bodies[%d];\n", indexA); + b2Log(" jd.bodyB = bodies[%d];\n", indexB); + b2Log(" jd.collideConnected = bool(%d);\n", m_collideConnected); + b2Log(" jd.localAnchorA.Set(%.15lef, %.15lef);\n", m_localAnchorA.x, m_localAnchorA.y); + b2Log(" jd.localAnchorB.Set(%.15lef, %.15lef);\n", m_localAnchorB.x, m_localAnchorB.y); + b2Log(" jd.referenceAngle = %.15lef;\n", m_referenceAngle); + b2Log(" jd.enableLimit = bool(%d);\n", m_enableLimit); + b2Log(" jd.lowerAngle = %.15lef;\n", m_lowerAngle); + b2Log(" jd.upperAngle = %.15lef;\n", m_upperAngle); + b2Log(" jd.enableMotor = bool(%d);\n", m_enableMotor); + b2Log(" jd.motorSpeed = %.15lef;\n", m_motorSpeed); + b2Log(" jd.maxMotorTorque = %.15lef;\n", m_maxMotorTorque); + b2Log(" joints[%d] = m_world->CreateJoint(&jd);\n", m_index); +} diff --git a/external/box2d/Dynamics/Joints/b2RevoluteJoint.h b/external/box2d/Dynamics/Joints/b2RevoluteJoint.h new file mode 100644 index 0000000000..978f16259a --- /dev/null +++ b/external/box2d/Dynamics/Joints/b2RevoluteJoint.h @@ -0,0 +1,204 @@ +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_REVOLUTE_JOINT_H +#define B2_REVOLUTE_JOINT_H + +#include + +/// Revolute joint definition. This requires defining an +/// anchor point where the bodies are joined. The definition +/// uses local anchor points so that the initial configuration +/// can violate the constraint slightly. You also need to +/// specify the initial relative angle for joint limits. This +/// helps when saving and loading a game. +/// The local anchor points are measured from the body's origin +/// rather than the center of mass because: +/// 1. you might not know where the center of mass will be. +/// 2. if you add/remove shapes from a body and recompute the mass, +/// the joints will be broken. +struct b2RevoluteJointDef : public b2JointDef +{ + b2RevoluteJointDef() + { + type = e_revoluteJoint; + localAnchorA.Set(0.0f, 0.0f); + localAnchorB.Set(0.0f, 0.0f); + referenceAngle = 0.0f; + lowerAngle = 0.0f; + upperAngle = 0.0f; + maxMotorTorque = 0.0f; + motorSpeed = 0.0f; + enableLimit = false; + enableMotor = false; + } + + /// Initialize the bodies, anchors, and reference angle using a world + /// anchor point. + void Initialize(b2Body* bodyA, b2Body* bodyB, const b2Vec2& anchor); + + /// The local anchor point relative to bodyA's origin. + b2Vec2 localAnchorA; + + /// The local anchor point relative to bodyB's origin. + b2Vec2 localAnchorB; + + /// The bodyB angle minus bodyA angle in the reference state (radians). + float32 referenceAngle; + + /// A flag to enable joint limits. + bool enableLimit; + + /// The lower angle for the joint limit (radians). + float32 lowerAngle; + + /// The upper angle for the joint limit (radians). + float32 upperAngle; + + /// A flag to enable the joint motor. + bool enableMotor; + + /// The desired motor speed. Usually in radians per second. + float32 motorSpeed; + + /// The maximum motor torque used to achieve the desired motor speed. + /// Usually in N-m. + float32 maxMotorTorque; +}; + +/// A revolute joint constrains two bodies to share a common point while they +/// are free to rotate about the point. The relative rotation about the shared +/// point is the joint angle. You can limit the relative rotation with +/// a joint limit that specifies a lower and upper angle. You can use a motor +/// to drive the relative rotation about the shared point. A maximum motor torque +/// is provided so that infinite forces are not generated. +class b2RevoluteJoint : public b2Joint +{ +public: + b2Vec2 GetAnchorA() const; + b2Vec2 GetAnchorB() const; + + /// The local anchor point relative to bodyA's origin. + const b2Vec2& GetLocalAnchorA() const { return m_localAnchorA; } + + /// The local anchor point relative to bodyB's origin. + const b2Vec2& GetLocalAnchorB() const { return m_localAnchorB; } + + /// Get the reference angle. + float32 GetReferenceAngle() const { return m_referenceAngle; } + + /// Get the current joint angle in radians. + float32 GetJointAngle() const; + + /// Get the current joint angle speed in radians per second. + float32 GetJointSpeed() const; + + /// Is the joint limit enabled? + bool IsLimitEnabled() const; + + /// Enable/disable the joint limit. + void EnableLimit(bool flag); + + /// Get the lower joint limit in radians. + float32 GetLowerLimit() const; + + /// Get the upper joint limit in radians. + float32 GetUpperLimit() const; + + /// Set the joint limits in radians. + void SetLimits(float32 lower, float32 upper); + + /// Is the joint motor enabled? + bool IsMotorEnabled() const; + + /// Enable/disable the joint motor. + void EnableMotor(bool flag); + + /// Set the motor speed in radians per second. + void SetMotorSpeed(float32 speed); + + /// Get the motor speed in radians per second. + float32 GetMotorSpeed() const; + + /// Set the maximum motor torque, usually in N-m. + void SetMaxMotorTorque(float32 torque); + float32 GetMaxMotorTorque() const { return m_maxMotorTorque; } + + /// Get the reaction force given the inverse time step. + /// Unit is N. + b2Vec2 GetReactionForce(float32 inv_dt) const; + + /// Get the reaction torque due to the joint limit given the inverse time step. + /// Unit is N*m. + float32 GetReactionTorque(float32 inv_dt) const; + + /// Get the current motor torque given the inverse time step. + /// Unit is N*m. + float32 GetMotorTorque(float32 inv_dt) const; + + /// Dump to b2Log. + void Dump(); + +protected: + + friend class b2Joint; + friend class b2GearJoint; + + b2RevoluteJoint(const b2RevoluteJointDef* def); + + void InitVelocityConstraints(const b2SolverData& data); + void SolveVelocityConstraints(const b2SolverData& data); + bool SolvePositionConstraints(const b2SolverData& data); + + // Solver shared + b2Vec2 m_localAnchorA; + b2Vec2 m_localAnchorB; + b2Vec3 m_impulse; + float32 m_motorImpulse; + + bool m_enableMotor; + float32 m_maxMotorTorque; + float32 m_motorSpeed; + + bool m_enableLimit; + float32 m_referenceAngle; + float32 m_lowerAngle; + float32 m_upperAngle; + + // Solver temp + int32 m_indexA; + int32 m_indexB; + b2Vec2 m_rA; + b2Vec2 m_rB; + b2Vec2 m_localCenterA; + b2Vec2 m_localCenterB; + float32 m_invMassA; + float32 m_invMassB; + float32 m_invIA; + float32 m_invIB; + b2Mat33 m_mass; // effective mass for point-to-point constraint. + float32 m_motorMass; // effective mass for motor/limit angular constraint. + b2LimitState m_limitState; +}; + +inline float32 b2RevoluteJoint::GetMotorSpeed() const +{ + return m_motorSpeed; +} + +#endif diff --git a/external/box2d/Dynamics/Joints/b2RopeJoint.cpp b/external/box2d/Dynamics/Joints/b2RopeJoint.cpp new file mode 100644 index 0000000000..17a70d9230 --- /dev/null +++ b/external/box2d/Dynamics/Joints/b2RopeJoint.cpp @@ -0,0 +1,241 @@ +/* +* Copyright (c) 2007-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include + + +// Limit: +// C = norm(pB - pA) - L +// u = (pB - pA) / norm(pB - pA) +// Cdot = dot(u, vB + cross(wB, rB) - vA - cross(wA, rA)) +// J = [-u -cross(rA, u) u cross(rB, u)] +// K = J * invM * JT +// = invMassA + invIA * cross(rA, u)^2 + invMassB + invIB * cross(rB, u)^2 + +b2RopeJoint::b2RopeJoint(const b2RopeJointDef* def) +: b2Joint(def) +{ + m_localAnchorA = def->localAnchorA; + m_localAnchorB = def->localAnchorB; + + m_maxLength = def->maxLength; + + m_mass = 0.0f; + m_impulse = 0.0f; + m_state = e_inactiveLimit; + m_length = 0.0f; +} + +void b2RopeJoint::InitVelocityConstraints(const b2SolverData& data) +{ + m_indexA = m_bodyA->m_islandIndex; + m_indexB = m_bodyB->m_islandIndex; + m_localCenterA = m_bodyA->m_sweep.localCenter; + m_localCenterB = m_bodyB->m_sweep.localCenter; + m_invMassA = m_bodyA->m_invMass; + m_invMassB = m_bodyB->m_invMass; + m_invIA = m_bodyA->m_invI; + m_invIB = m_bodyB->m_invI; + + b2Vec2 cA = data.positions[m_indexA].c; + float32 aA = data.positions[m_indexA].a; + b2Vec2 vA = data.velocities[m_indexA].v; + float32 wA = data.velocities[m_indexA].w; + + b2Vec2 cB = data.positions[m_indexB].c; + float32 aB = data.positions[m_indexB].a; + b2Vec2 vB = data.velocities[m_indexB].v; + float32 wB = data.velocities[m_indexB].w; + + b2Rot qA(aA), qB(aB); + + m_rA = b2Mul(qA, m_localAnchorA - m_localCenterA); + m_rB = b2Mul(qB, m_localAnchorB - m_localCenterB); + m_u = cB + m_rB - cA - m_rA; + + m_length = m_u.Length(); + + float32 C = m_length - m_maxLength; + if (C > 0.0f) + { + m_state = e_atUpperLimit; + } + else + { + m_state = e_inactiveLimit; + } + + if (m_length > b2_linearSlop) + { + m_u *= 1.0f / m_length; + } + else + { + m_u.SetZero(); + m_mass = 0.0f; + m_impulse = 0.0f; + return; + } + + // Compute effective mass. + float32 crA = b2Cross(m_rA, m_u); + float32 crB = b2Cross(m_rB, m_u); + float32 invMass = m_invMassA + m_invIA * crA * crA + m_invMassB + m_invIB * crB * crB; + + m_mass = invMass != 0.0f ? 1.0f / invMass : 0.0f; + + if (data.step.warmStarting) + { + // Scale the impulse to support a variable time step. + m_impulse *= data.step.dtRatio; + + b2Vec2 P = m_impulse * m_u; + vA -= m_invMassA * P; + wA -= m_invIA * b2Cross(m_rA, P); + vB += m_invMassB * P; + wB += m_invIB * b2Cross(m_rB, P); + } + else + { + m_impulse = 0.0f; + } + + data.velocities[m_indexA].v = vA; + data.velocities[m_indexA].w = wA; + data.velocities[m_indexB].v = vB; + data.velocities[m_indexB].w = wB; +} + +void b2RopeJoint::SolveVelocityConstraints(const b2SolverData& data) +{ + b2Vec2 vA = data.velocities[m_indexA].v; + float32 wA = data.velocities[m_indexA].w; + b2Vec2 vB = data.velocities[m_indexB].v; + float32 wB = data.velocities[m_indexB].w; + + // Cdot = dot(u, v + cross(w, r)) + b2Vec2 vpA = vA + b2Cross(wA, m_rA); + b2Vec2 vpB = vB + b2Cross(wB, m_rB); + float32 C = m_length - m_maxLength; + float32 Cdot = b2Dot(m_u, vpB - vpA); + + // Predictive constraint. + if (C < 0.0f) + { + Cdot += data.step.inv_dt * C; + } + + float32 impulse = -m_mass * Cdot; + float32 oldImpulse = m_impulse; + m_impulse = b2Min(0.0f, m_impulse + impulse); + impulse = m_impulse - oldImpulse; + + b2Vec2 P = impulse * m_u; + vA -= m_invMassA * P; + wA -= m_invIA * b2Cross(m_rA, P); + vB += m_invMassB * P; + wB += m_invIB * b2Cross(m_rB, P); + + data.velocities[m_indexA].v = vA; + data.velocities[m_indexA].w = wA; + data.velocities[m_indexB].v = vB; + data.velocities[m_indexB].w = wB; +} + +bool b2RopeJoint::SolvePositionConstraints(const b2SolverData& data) +{ + b2Vec2 cA = data.positions[m_indexA].c; + float32 aA = data.positions[m_indexA].a; + b2Vec2 cB = data.positions[m_indexB].c; + float32 aB = data.positions[m_indexB].a; + + b2Rot qA(aA), qB(aB); + + b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA); + b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB); + b2Vec2 u = cB + rB - cA - rA; + + float32 length = u.Normalize(); + float32 C = length - m_maxLength; + + C = b2Clamp(C, 0.0f, b2_maxLinearCorrection); + + float32 impulse = -m_mass * C; + b2Vec2 P = impulse * u; + + cA -= m_invMassA * P; + aA -= m_invIA * b2Cross(rA, P); + cB += m_invMassB * P; + aB += m_invIB * b2Cross(rB, P); + + data.positions[m_indexA].c = cA; + data.positions[m_indexA].a = aA; + data.positions[m_indexB].c = cB; + data.positions[m_indexB].a = aB; + + return length - m_maxLength < b2_linearSlop; +} + +b2Vec2 b2RopeJoint::GetAnchorA() const +{ + return m_bodyA->GetWorldPoint(m_localAnchorA); +} + +b2Vec2 b2RopeJoint::GetAnchorB() const +{ + return m_bodyB->GetWorldPoint(m_localAnchorB); +} + +b2Vec2 b2RopeJoint::GetReactionForce(float32 inv_dt) const +{ + b2Vec2 F = (inv_dt * m_impulse) * m_u; + return F; +} + +float32 b2RopeJoint::GetReactionTorque(float32 inv_dt) const +{ + B2_NOT_USED(inv_dt); + return 0.0f; +} + +float32 b2RopeJoint::GetMaxLength() const +{ + return m_maxLength; +} + +b2LimitState b2RopeJoint::GetLimitState() const +{ + return m_state; +} + +void b2RopeJoint::Dump() +{ + int32 indexA = m_bodyA->m_islandIndex; + int32 indexB = m_bodyB->m_islandIndex; + + b2Log(" b2RopeJointDef jd;\n"); + b2Log(" jd.bodyA = bodies[%d];\n", indexA); + b2Log(" jd.bodyB = bodies[%d];\n", indexB); + b2Log(" jd.collideConnected = bool(%d);\n", m_collideConnected); + b2Log(" jd.localAnchorA.Set(%.15lef, %.15lef);\n", m_localAnchorA.x, m_localAnchorA.y); + b2Log(" jd.localAnchorB.Set(%.15lef, %.15lef);\n", m_localAnchorB.x, m_localAnchorB.y); + b2Log(" jd.maxLength = %.15lef;\n", m_maxLength); + b2Log(" joints[%d] = m_world->CreateJoint(&jd);\n", m_index); +} diff --git a/external/box2d/Dynamics/Joints/b2RopeJoint.h b/external/box2d/Dynamics/Joints/b2RopeJoint.h new file mode 100644 index 0000000000..d7091b6650 --- /dev/null +++ b/external/box2d/Dynamics/Joints/b2RopeJoint.h @@ -0,0 +1,114 @@ +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_ROPE_JOINT_H +#define B2_ROPE_JOINT_H + +#include + +/// Rope joint definition. This requires two body anchor points and +/// a maximum lengths. +/// Note: by default the connected objects will not collide. +/// see collideConnected in b2JointDef. +struct b2RopeJointDef : public b2JointDef +{ + b2RopeJointDef() + { + type = e_ropeJoint; + localAnchorA.Set(-1.0f, 0.0f); + localAnchorB.Set(1.0f, 0.0f); + maxLength = 0.0f; + } + + /// The local anchor point relative to bodyA's origin. + b2Vec2 localAnchorA; + + /// The local anchor point relative to bodyB's origin. + b2Vec2 localAnchorB; + + /// The maximum length of the rope. + /// Warning: this must be larger than b2_linearSlop or + /// the joint will have no effect. + float32 maxLength; +}; + +/// A rope joint enforces a maximum distance between two points +/// on two bodies. It has no other effect. +/// Warning: if you attempt to change the maximum length during +/// the simulation you will get some non-physical behavior. +/// A model that would allow you to dynamically modify the length +/// would have some sponginess, so I chose not to implement it +/// that way. See b2DistanceJoint if you want to dynamically +/// control length. +class b2RopeJoint : public b2Joint +{ +public: + b2Vec2 GetAnchorA() const; + b2Vec2 GetAnchorB() const; + + b2Vec2 GetReactionForce(float32 inv_dt) const; + float32 GetReactionTorque(float32 inv_dt) const; + + /// The local anchor point relative to bodyA's origin. + const b2Vec2& GetLocalAnchorA() const { return m_localAnchorA; } + + /// The local anchor point relative to bodyB's origin. + const b2Vec2& GetLocalAnchorB() const { return m_localAnchorB; } + + /// Set/Get the maximum length of the rope. + void SetMaxLength(float32 length) { m_maxLength = length; } + float32 GetMaxLength() const; + + b2LimitState GetLimitState() const; + + /// Dump joint to dmLog + void Dump(); + +protected: + + friend class b2Joint; + b2RopeJoint(const b2RopeJointDef* data); + + void InitVelocityConstraints(const b2SolverData& data); + void SolveVelocityConstraints(const b2SolverData& data); + bool SolvePositionConstraints(const b2SolverData& data); + + // Solver shared + b2Vec2 m_localAnchorA; + b2Vec2 m_localAnchorB; + float32 m_maxLength; + float32 m_length; + float32 m_impulse; + + // Solver temp + int32 m_indexA; + int32 m_indexB; + b2Vec2 m_u; + b2Vec2 m_rA; + b2Vec2 m_rB; + b2Vec2 m_localCenterA; + b2Vec2 m_localCenterB; + float32 m_invMassA; + float32 m_invMassB; + float32 m_invIA; + float32 m_invIB; + float32 m_mass; + b2LimitState m_state; +}; + +#endif diff --git a/external/box2d/Dynamics/Joints/b2WeldJoint.cpp b/external/box2d/Dynamics/Joints/b2WeldJoint.cpp new file mode 100644 index 0000000000..f50bdd6587 --- /dev/null +++ b/external/box2d/Dynamics/Joints/b2WeldJoint.cpp @@ -0,0 +1,330 @@ +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include + +// Point-to-point constraint +// C = p2 - p1 +// Cdot = v2 - v1 +// = v2 + cross(w2, r2) - v1 - cross(w1, r1) +// J = [-I -r1_skew I r2_skew ] +// Identity used: +// w k % (rx i + ry j) = w * (-ry i + rx j) + +// Angle constraint +// C = angle2 - angle1 - referenceAngle +// Cdot = w2 - w1 +// J = [0 0 -1 0 0 1] +// K = invI1 + invI2 + +void b2WeldJointDef::Initialize(b2Body* bA, b2Body* bB, const b2Vec2& anchor) +{ + bodyA = bA; + bodyB = bB; + localAnchorA = bodyA->GetLocalPoint(anchor); + localAnchorB = bodyB->GetLocalPoint(anchor); + referenceAngle = bodyB->GetAngle() - bodyA->GetAngle(); +} + +b2WeldJoint::b2WeldJoint(const b2WeldJointDef* def) +: b2Joint(def) +{ + m_localAnchorA = def->localAnchorA; + m_localAnchorB = def->localAnchorB; + m_referenceAngle = def->referenceAngle; + m_frequencyHz = def->frequencyHz; + m_dampingRatio = def->dampingRatio; + + m_impulse.SetZero(); +} + +void b2WeldJoint::InitVelocityConstraints(const b2SolverData& data) +{ + m_indexA = m_bodyA->m_islandIndex; + m_indexB = m_bodyB->m_islandIndex; + m_localCenterA = m_bodyA->m_sweep.localCenter; + m_localCenterB = m_bodyB->m_sweep.localCenter; + m_invMassA = m_bodyA->m_invMass; + m_invMassB = m_bodyB->m_invMass; + m_invIA = m_bodyA->m_invI; + m_invIB = m_bodyB->m_invI; + + b2Vec2 cA = data.positions[m_indexA].c; + float32 aA = data.positions[m_indexA].a; + b2Vec2 vA = data.velocities[m_indexA].v; + float32 wA = data.velocities[m_indexA].w; + + b2Vec2 cB = data.positions[m_indexB].c; + float32 aB = data.positions[m_indexB].a; + b2Vec2 vB = data.velocities[m_indexB].v; + float32 wB = data.velocities[m_indexB].w; + + b2Rot qA(aA), qB(aB); + + m_rA = b2Mul(qA, m_localAnchorA - m_localCenterA); + m_rB = b2Mul(qB, m_localAnchorB - m_localCenterB); + + // J = [-I -r1_skew I r2_skew] + // [ 0 -1 0 1] + // r_skew = [-ry; rx] + + // Matlab + // K = [ mA+r1y^2*iA+mB+r2y^2*iB, -r1y*iA*r1x-r2y*iB*r2x, -r1y*iA-r2y*iB] + // [ -r1y*iA*r1x-r2y*iB*r2x, mA+r1x^2*iA+mB+r2x^2*iB, r1x*iA+r2x*iB] + // [ -r1y*iA-r2y*iB, r1x*iA+r2x*iB, iA+iB] + + float32 mA = m_invMassA, mB = m_invMassB; + float32 iA = m_invIA, iB = m_invIB; + + b2Mat33 K; + K.ex.x = mA + mB + m_rA.y * m_rA.y * iA + m_rB.y * m_rB.y * iB; + K.ey.x = -m_rA.y * m_rA.x * iA - m_rB.y * m_rB.x * iB; + K.ez.x = -m_rA.y * iA - m_rB.y * iB; + K.ex.y = K.ey.x; + K.ey.y = mA + mB + m_rA.x * m_rA.x * iA + m_rB.x * m_rB.x * iB; + K.ez.y = m_rA.x * iA + m_rB.x * iB; + K.ex.z = K.ez.x; + K.ey.z = K.ez.y; + K.ez.z = iA + iB; + + if (m_frequencyHz > 0.0f) + { + K.GetInverse22(&m_mass); + + float32 invM = iA + iB; + float32 m = invM > 0.0f ? 1.0f / invM : 0.0f; + + float32 C = aB - aA - m_referenceAngle; + + // Frequency + float32 omega = 2.0f * b2_pi * m_frequencyHz; + + // Damping coefficient + float32 d = 2.0f * m * m_dampingRatio * omega; + + // Spring stiffness + float32 k = m * omega * omega; + + // magic formulas + float32 h = data.step.dt; + m_gamma = h * (d + h * k); + m_gamma = m_gamma != 0.0f ? 1.0f / m_gamma : 0.0f; + m_bias = C * h * k * m_gamma; + + invM += m_gamma; + m_mass.ez.z = invM != 0.0f ? 1.0f / invM : 0.0f; + } + else + { + K.GetSymInverse33(&m_mass); + m_gamma = 0.0f; + m_bias = 0.0f; + } + + if (data.step.warmStarting) + { + // Scale impulses to support a variable time step. + m_impulse *= data.step.dtRatio; + + b2Vec2 P(m_impulse.x, m_impulse.y); + + vA -= mA * P; + wA -= iA * (b2Cross(m_rA, P) + m_impulse.z); + + vB += mB * P; + wB += iB * (b2Cross(m_rB, P) + m_impulse.z); + } + else + { + m_impulse.SetZero(); + } + + data.velocities[m_indexA].v = vA; + data.velocities[m_indexA].w = wA; + data.velocities[m_indexB].v = vB; + data.velocities[m_indexB].w = wB; +} + +void b2WeldJoint::SolveVelocityConstraints(const b2SolverData& data) +{ + b2Vec2 vA = data.velocities[m_indexA].v; + float32 wA = data.velocities[m_indexA].w; + b2Vec2 vB = data.velocities[m_indexB].v; + float32 wB = data.velocities[m_indexB].w; + + float32 mA = m_invMassA, mB = m_invMassB; + float32 iA = m_invIA, iB = m_invIB; + + if (m_frequencyHz > 0.0f) + { + float32 Cdot2 = wB - wA; + + float32 impulse2 = -m_mass.ez.z * (Cdot2 + m_bias + m_gamma * m_impulse.z); + m_impulse.z += impulse2; + + wA -= iA * impulse2; + wB += iB * impulse2; + + b2Vec2 Cdot1 = vB + b2Cross(wB, m_rB) - vA - b2Cross(wA, m_rA); + + b2Vec2 impulse1 = -b2Mul22(m_mass, Cdot1); + m_impulse.x += impulse1.x; + m_impulse.y += impulse1.y; + + b2Vec2 P = impulse1; + + vA -= mA * P; + wA -= iA * b2Cross(m_rA, P); + + vB += mB * P; + wB += iB * b2Cross(m_rB, P); + } + else + { + b2Vec2 Cdot1 = vB + b2Cross(wB, m_rB) - vA - b2Cross(wA, m_rA); + float32 Cdot2 = wB - wA; + b2Vec3 Cdot(Cdot1.x, Cdot1.y, Cdot2); + + b2Vec3 impulse = -b2Mul(m_mass, Cdot); + m_impulse += impulse; + + b2Vec2 P(impulse.x, impulse.y); + + vA -= mA * P; + wA -= iA * (b2Cross(m_rA, P) + impulse.z); + + vB += mB * P; + wB += iB * (b2Cross(m_rB, P) + impulse.z); + } + + data.velocities[m_indexA].v = vA; + data.velocities[m_indexA].w = wA; + data.velocities[m_indexB].v = vB; + data.velocities[m_indexB].w = wB; +} + +bool b2WeldJoint::SolvePositionConstraints(const b2SolverData& data) +{ + b2Vec2 cA = data.positions[m_indexA].c; + float32 aA = data.positions[m_indexA].a; + b2Vec2 cB = data.positions[m_indexB].c; + float32 aB = data.positions[m_indexB].a; + + b2Rot qA(aA), qB(aB); + + float32 mA = m_invMassA, mB = m_invMassB; + float32 iA = m_invIA, iB = m_invIB; + + b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA); + b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB); + + float32 positionError, angularError; + + b2Mat33 K; + K.ex.x = mA + mB + rA.y * rA.y * iA + rB.y * rB.y * iB; + K.ey.x = -rA.y * rA.x * iA - rB.y * rB.x * iB; + K.ez.x = -rA.y * iA - rB.y * iB; + K.ex.y = K.ey.x; + K.ey.y = mA + mB + rA.x * rA.x * iA + rB.x * rB.x * iB; + K.ez.y = rA.x * iA + rB.x * iB; + K.ex.z = K.ez.x; + K.ey.z = K.ez.y; + K.ez.z = iA + iB; + + if (m_frequencyHz > 0.0f) + { + b2Vec2 C1 = cB + rB - cA - rA; + + positionError = C1.Length(); + angularError = 0.0f; + + b2Vec2 P = -K.Solve22(C1); + + cA -= mA * P; + aA -= iA * b2Cross(rA, P); + + cB += mB * P; + aB += iB * b2Cross(rB, P); + } + else + { + b2Vec2 C1 = cB + rB - cA - rA; + float32 C2 = aB - aA - m_referenceAngle; + + positionError = C1.Length(); + angularError = b2Abs(C2); + + b2Vec3 C(C1.x, C1.y, C2); + + b2Vec3 impulse = -K.Solve33(C); + b2Vec2 P(impulse.x, impulse.y); + + cA -= mA * P; + aA -= iA * (b2Cross(rA, P) + impulse.z); + + cB += mB * P; + aB += iB * (b2Cross(rB, P) + impulse.z); + } + + data.positions[m_indexA].c = cA; + data.positions[m_indexA].a = aA; + data.positions[m_indexB].c = cB; + data.positions[m_indexB].a = aB; + + return positionError <= b2_linearSlop && angularError <= b2_angularSlop; +} + +b2Vec2 b2WeldJoint::GetAnchorA() const +{ + return m_bodyA->GetWorldPoint(m_localAnchorA); +} + +b2Vec2 b2WeldJoint::GetAnchorB() const +{ + return m_bodyB->GetWorldPoint(m_localAnchorB); +} + +b2Vec2 b2WeldJoint::GetReactionForce(float32 inv_dt) const +{ + b2Vec2 P(m_impulse.x, m_impulse.y); + return inv_dt * P; +} + +float32 b2WeldJoint::GetReactionTorque(float32 inv_dt) const +{ + return inv_dt * m_impulse.z; +} + +void b2WeldJoint::Dump() +{ + int32 indexA = m_bodyA->m_islandIndex; + int32 indexB = m_bodyB->m_islandIndex; + + b2Log(" b2WeldJointDef jd;\n"); + b2Log(" jd.bodyA = bodies[%d];\n", indexA); + b2Log(" jd.bodyB = bodies[%d];\n", indexB); + b2Log(" jd.collideConnected = bool(%d);\n", m_collideConnected); + b2Log(" jd.localAnchorA.Set(%.15lef, %.15lef);\n", m_localAnchorA.x, m_localAnchorA.y); + b2Log(" jd.localAnchorB.Set(%.15lef, %.15lef);\n", m_localAnchorB.x, m_localAnchorB.y); + b2Log(" jd.referenceAngle = %.15lef;\n", m_referenceAngle); + b2Log(" jd.frequencyHz = %.15lef;\n", m_frequencyHz); + b2Log(" jd.dampingRatio = %.15lef;\n", m_dampingRatio); + b2Log(" joints[%d] = m_world->CreateJoint(&jd);\n", m_index); +} diff --git a/external/box2d/Dynamics/Joints/b2WeldJoint.h b/external/box2d/Dynamics/Joints/b2WeldJoint.h new file mode 100644 index 0000000000..751c6a8770 --- /dev/null +++ b/external/box2d/Dynamics/Joints/b2WeldJoint.h @@ -0,0 +1,126 @@ +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_WELD_JOINT_H +#define B2_WELD_JOINT_H + +#include + +/// Weld joint definition. You need to specify local anchor points +/// where they are attached and the relative body angle. The position +/// of the anchor points is important for computing the reaction torque. +struct b2WeldJointDef : public b2JointDef +{ + b2WeldJointDef() + { + type = e_weldJoint; + localAnchorA.Set(0.0f, 0.0f); + localAnchorB.Set(0.0f, 0.0f); + referenceAngle = 0.0f; + frequencyHz = 0.0f; + dampingRatio = 0.0f; + } + + /// Initialize the bodies, anchors, and reference angle using a world + /// anchor point. + void Initialize(b2Body* bodyA, b2Body* bodyB, const b2Vec2& anchor); + + /// The local anchor point relative to bodyA's origin. + b2Vec2 localAnchorA; + + /// The local anchor point relative to bodyB's origin. + b2Vec2 localAnchorB; + + /// The bodyB angle minus bodyA angle in the reference state (radians). + float32 referenceAngle; + + /// The mass-spring-damper frequency in Hertz. Rotation only. + /// Disable softness with a value of 0. + float32 frequencyHz; + + /// The damping ratio. 0 = no damping, 1 = critical damping. + float32 dampingRatio; +}; + +/// A weld joint essentially glues two bodies together. A weld joint may +/// distort somewhat because the island constraint solver is approximate. +class b2WeldJoint : public b2Joint +{ +public: + b2Vec2 GetAnchorA() const; + b2Vec2 GetAnchorB() const; + + b2Vec2 GetReactionForce(float32 inv_dt) const; + float32 GetReactionTorque(float32 inv_dt) const; + + /// The local anchor point relative to bodyA's origin. + const b2Vec2& GetLocalAnchorA() const { return m_localAnchorA; } + + /// The local anchor point relative to bodyB's origin. + const b2Vec2& GetLocalAnchorB() const { return m_localAnchorB; } + + /// Get the reference angle. + float32 GetReferenceAngle() const { return m_referenceAngle; } + + /// Set/get frequency in Hz. + void SetFrequency(float32 hz) { m_frequencyHz = hz; } + float32 GetFrequency() const { return m_frequencyHz; } + + /// Set/get damping ratio. + void SetDampingRatio(float32 ratio) { m_dampingRatio = ratio; } + float32 GetDampingRatio() const { return m_dampingRatio; } + + /// Dump to b2Log + void Dump(); + +protected: + + friend class b2Joint; + + b2WeldJoint(const b2WeldJointDef* def); + + void InitVelocityConstraints(const b2SolverData& data); + void SolveVelocityConstraints(const b2SolverData& data); + bool SolvePositionConstraints(const b2SolverData& data); + + float32 m_frequencyHz; + float32 m_dampingRatio; + float32 m_bias; + + // Solver shared + b2Vec2 m_localAnchorA; + b2Vec2 m_localAnchorB; + float32 m_referenceAngle; + float32 m_gamma; + b2Vec3 m_impulse; + + // Solver temp + int32 m_indexA; + int32 m_indexB; + b2Vec2 m_rA; + b2Vec2 m_rB; + b2Vec2 m_localCenterA; + b2Vec2 m_localCenterB; + float32 m_invMassA; + float32 m_invMassB; + float32 m_invIA; + float32 m_invIB; + b2Mat33 m_mass; +}; + +#endif diff --git a/external/box2d/Dynamics/Joints/b2WheelJoint.cpp b/external/box2d/Dynamics/Joints/b2WheelJoint.cpp new file mode 100644 index 0000000000..6253437706 --- /dev/null +++ b/external/box2d/Dynamics/Joints/b2WheelJoint.cpp @@ -0,0 +1,419 @@ +/* +* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include + +// Linear constraint (point-to-line) +// d = pB - pA = xB + rB - xA - rA +// C = dot(ay, d) +// Cdot = dot(d, cross(wA, ay)) + dot(ay, vB + cross(wB, rB) - vA - cross(wA, rA)) +// = -dot(ay, vA) - dot(cross(d + rA, ay), wA) + dot(ay, vB) + dot(cross(rB, ay), vB) +// J = [-ay, -cross(d + rA, ay), ay, cross(rB, ay)] + +// Spring linear constraint +// C = dot(ax, d) +// Cdot = = -dot(ax, vA) - dot(cross(d + rA, ax), wA) + dot(ax, vB) + dot(cross(rB, ax), vB) +// J = [-ax -cross(d+rA, ax) ax cross(rB, ax)] + +// Motor rotational constraint +// Cdot = wB - wA +// J = [0 0 -1 0 0 1] + +void b2WheelJointDef::Initialize(b2Body* bA, b2Body* bB, const b2Vec2& anchor, const b2Vec2& axis) +{ + bodyA = bA; + bodyB = bB; + localAnchorA = bodyA->GetLocalPoint(anchor); + localAnchorB = bodyB->GetLocalPoint(anchor); + localAxisA = bodyA->GetLocalVector(axis); +} + +b2WheelJoint::b2WheelJoint(const b2WheelJointDef* def) +: b2Joint(def) +{ + m_localAnchorA = def->localAnchorA; + m_localAnchorB = def->localAnchorB; + m_localXAxisA = def->localAxisA; + m_localYAxisA = b2Cross(1.0f, m_localXAxisA); + + m_mass = 0.0f; + m_impulse = 0.0f; + m_motorMass = 0.0; + m_motorImpulse = 0.0f; + m_springMass = 0.0f; + m_springImpulse = 0.0f; + + m_maxMotorTorque = def->maxMotorTorque; + m_motorSpeed = def->motorSpeed; + m_enableMotor = def->enableMotor; + + m_frequencyHz = def->frequencyHz; + m_dampingRatio = def->dampingRatio; + + m_bias = 0.0f; + m_gamma = 0.0f; + + m_ax.SetZero(); + m_ay.SetZero(); +} + +void b2WheelJoint::InitVelocityConstraints(const b2SolverData& data) +{ + m_indexA = m_bodyA->m_islandIndex; + m_indexB = m_bodyB->m_islandIndex; + m_localCenterA = m_bodyA->m_sweep.localCenter; + m_localCenterB = m_bodyB->m_sweep.localCenter; + m_invMassA = m_bodyA->m_invMass; + m_invMassB = m_bodyB->m_invMass; + m_invIA = m_bodyA->m_invI; + m_invIB = m_bodyB->m_invI; + + float32 mA = m_invMassA, mB = m_invMassB; + float32 iA = m_invIA, iB = m_invIB; + + b2Vec2 cA = data.positions[m_indexA].c; + float32 aA = data.positions[m_indexA].a; + b2Vec2 vA = data.velocities[m_indexA].v; + float32 wA = data.velocities[m_indexA].w; + + b2Vec2 cB = data.positions[m_indexB].c; + float32 aB = data.positions[m_indexB].a; + b2Vec2 vB = data.velocities[m_indexB].v; + float32 wB = data.velocities[m_indexB].w; + + b2Rot qA(aA), qB(aB); + + // Compute the effective masses. + b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA); + b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB); + b2Vec2 d = cB + rB - cA - rA; + + // Point to line constraint + { + m_ay = b2Mul(qA, m_localYAxisA); + m_sAy = b2Cross(d + rA, m_ay); + m_sBy = b2Cross(rB, m_ay); + + m_mass = mA + mB + iA * m_sAy * m_sAy + iB * m_sBy * m_sBy; + + if (m_mass > 0.0f) + { + m_mass = 1.0f / m_mass; + } + } + + // Spring constraint + m_springMass = 0.0f; + m_bias = 0.0f; + m_gamma = 0.0f; + if (m_frequencyHz > 0.0f) + { + m_ax = b2Mul(qA, m_localXAxisA); + m_sAx = b2Cross(d + rA, m_ax); + m_sBx = b2Cross(rB, m_ax); + + float32 invMass = mA + mB + iA * m_sAx * m_sAx + iB * m_sBx * m_sBx; + + if (invMass > 0.0f) + { + m_springMass = 1.0f / invMass; + + float32 C = b2Dot(d, m_ax); + + // Frequency + float32 omega = 2.0f * b2_pi * m_frequencyHz; + + // Damping coefficient + float32 d = 2.0f * m_springMass * m_dampingRatio * omega; + + // Spring stiffness + float32 k = m_springMass * omega * omega; + + // magic formulas + float32 h = data.step.dt; + m_gamma = h * (d + h * k); + if (m_gamma > 0.0f) + { + m_gamma = 1.0f / m_gamma; + } + + m_bias = C * h * k * m_gamma; + + m_springMass = invMass + m_gamma; + if (m_springMass > 0.0f) + { + m_springMass = 1.0f / m_springMass; + } + } + } + else + { + m_springImpulse = 0.0f; + } + + // Rotational motor + if (m_enableMotor) + { + m_motorMass = iA + iB; + if (m_motorMass > 0.0f) + { + m_motorMass = 1.0f / m_motorMass; + } + } + else + { + m_motorMass = 0.0f; + m_motorImpulse = 0.0f; + } + + if (data.step.warmStarting) + { + // Account for variable time step. + m_impulse *= data.step.dtRatio; + m_springImpulse *= data.step.dtRatio; + m_motorImpulse *= data.step.dtRatio; + + b2Vec2 P = m_impulse * m_ay + m_springImpulse * m_ax; + float32 LA = m_impulse * m_sAy + m_springImpulse * m_sAx + m_motorImpulse; + float32 LB = m_impulse * m_sBy + m_springImpulse * m_sBx + m_motorImpulse; + + vA -= m_invMassA * P; + wA -= m_invIA * LA; + + vB += m_invMassB * P; + wB += m_invIB * LB; + } + else + { + m_impulse = 0.0f; + m_springImpulse = 0.0f; + m_motorImpulse = 0.0f; + } + + data.velocities[m_indexA].v = vA; + data.velocities[m_indexA].w = wA; + data.velocities[m_indexB].v = vB; + data.velocities[m_indexB].w = wB; +} + +void b2WheelJoint::SolveVelocityConstraints(const b2SolverData& data) +{ + float32 mA = m_invMassA, mB = m_invMassB; + float32 iA = m_invIA, iB = m_invIB; + + b2Vec2 vA = data.velocities[m_indexA].v; + float32 wA = data.velocities[m_indexA].w; + b2Vec2 vB = data.velocities[m_indexB].v; + float32 wB = data.velocities[m_indexB].w; + + // Solve spring constraint + { + float32 Cdot = b2Dot(m_ax, vB - vA) + m_sBx * wB - m_sAx * wA; + float32 impulse = -m_springMass * (Cdot + m_bias + m_gamma * m_springImpulse); + m_springImpulse += impulse; + + b2Vec2 P = impulse * m_ax; + float32 LA = impulse * m_sAx; + float32 LB = impulse * m_sBx; + + vA -= mA * P; + wA -= iA * LA; + + vB += mB * P; + wB += iB * LB; + } + + // Solve rotational motor constraint + { + float32 Cdot = wB - wA - m_motorSpeed; + float32 impulse = -m_motorMass * Cdot; + + float32 oldImpulse = m_motorImpulse; + float32 maxImpulse = data.step.dt * m_maxMotorTorque; + m_motorImpulse = b2Clamp(m_motorImpulse + impulse, -maxImpulse, maxImpulse); + impulse = m_motorImpulse - oldImpulse; + + wA -= iA * impulse; + wB += iB * impulse; + } + + // Solve point to line constraint + { + float32 Cdot = b2Dot(m_ay, vB - vA) + m_sBy * wB - m_sAy * wA; + float32 impulse = -m_mass * Cdot; + m_impulse += impulse; + + b2Vec2 P = impulse * m_ay; + float32 LA = impulse * m_sAy; + float32 LB = impulse * m_sBy; + + vA -= mA * P; + wA -= iA * LA; + + vB += mB * P; + wB += iB * LB; + } + + data.velocities[m_indexA].v = vA; + data.velocities[m_indexA].w = wA; + data.velocities[m_indexB].v = vB; + data.velocities[m_indexB].w = wB; +} + +bool b2WheelJoint::SolvePositionConstraints(const b2SolverData& data) +{ + b2Vec2 cA = data.positions[m_indexA].c; + float32 aA = data.positions[m_indexA].a; + b2Vec2 cB = data.positions[m_indexB].c; + float32 aB = data.positions[m_indexB].a; + + b2Rot qA(aA), qB(aB); + + b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA); + b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB); + b2Vec2 d = (cB - cA) + rB - rA; + + b2Vec2 ay = b2Mul(qA, m_localYAxisA); + + float32 sAy = b2Cross(d + rA, ay); + float32 sBy = b2Cross(rB, ay); + + float32 C = b2Dot(d, ay); + + float32 k = m_invMassA + m_invMassB + m_invIA * m_sAy * m_sAy + m_invIB * m_sBy * m_sBy; + + float32 impulse; + if (k != 0.0f) + { + impulse = - C / k; + } + else + { + impulse = 0.0f; + } + + b2Vec2 P = impulse * ay; + float32 LA = impulse * sAy; + float32 LB = impulse * sBy; + + cA -= m_invMassA * P; + aA -= m_invIA * LA; + cB += m_invMassB * P; + aB += m_invIB * LB; + + data.positions[m_indexA].c = cA; + data.positions[m_indexA].a = aA; + data.positions[m_indexB].c = cB; + data.positions[m_indexB].a = aB; + + return b2Abs(C) <= b2_linearSlop; +} + +b2Vec2 b2WheelJoint::GetAnchorA() const +{ + return m_bodyA->GetWorldPoint(m_localAnchorA); +} + +b2Vec2 b2WheelJoint::GetAnchorB() const +{ + return m_bodyB->GetWorldPoint(m_localAnchorB); +} + +b2Vec2 b2WheelJoint::GetReactionForce(float32 inv_dt) const +{ + return inv_dt * (m_impulse * m_ay + m_springImpulse * m_ax); +} + +float32 b2WheelJoint::GetReactionTorque(float32 inv_dt) const +{ + return inv_dt * m_motorImpulse; +} + +float32 b2WheelJoint::GetJointTranslation() const +{ + b2Body* bA = m_bodyA; + b2Body* bB = m_bodyB; + + b2Vec2 pA = bA->GetWorldPoint(m_localAnchorA); + b2Vec2 pB = bB->GetWorldPoint(m_localAnchorB); + b2Vec2 d = pB - pA; + b2Vec2 axis = bA->GetWorldVector(m_localXAxisA); + + float32 translation = b2Dot(d, axis); + return translation; +} + +float32 b2WheelJoint::GetJointSpeed() const +{ + float32 wA = m_bodyA->m_angularVelocity; + float32 wB = m_bodyB->m_angularVelocity; + return wB - wA; +} + +bool b2WheelJoint::IsMotorEnabled() const +{ + return m_enableMotor; +} + +void b2WheelJoint::EnableMotor(bool flag) +{ + m_bodyA->SetAwake(true); + m_bodyB->SetAwake(true); + m_enableMotor = flag; +} + +void b2WheelJoint::SetMotorSpeed(float32 speed) +{ + m_bodyA->SetAwake(true); + m_bodyB->SetAwake(true); + m_motorSpeed = speed; +} + +void b2WheelJoint::SetMaxMotorTorque(float32 torque) +{ + m_bodyA->SetAwake(true); + m_bodyB->SetAwake(true); + m_maxMotorTorque = torque; +} + +float32 b2WheelJoint::GetMotorTorque(float32 inv_dt) const +{ + return inv_dt * m_motorImpulse; +} + +void b2WheelJoint::Dump() +{ + int32 indexA = m_bodyA->m_islandIndex; + int32 indexB = m_bodyB->m_islandIndex; + + b2Log(" b2WheelJointDef jd;\n"); + b2Log(" jd.bodyA = bodies[%d];\n", indexA); + b2Log(" jd.bodyB = bodies[%d];\n", indexB); + b2Log(" jd.collideConnected = bool(%d);\n", m_collideConnected); + b2Log(" jd.localAnchorA.Set(%.15lef, %.15lef);\n", m_localAnchorA.x, m_localAnchorA.y); + b2Log(" jd.localAnchorB.Set(%.15lef, %.15lef);\n", m_localAnchorB.x, m_localAnchorB.y); + b2Log(" jd.localAxisA.Set(%.15lef, %.15lef);\n", m_localXAxisA.x, m_localXAxisA.y); + b2Log(" jd.enableMotor = bool(%d);\n", m_enableMotor); + b2Log(" jd.motorSpeed = %.15lef;\n", m_motorSpeed); + b2Log(" jd.maxMotorTorque = %.15lef;\n", m_maxMotorTorque); + b2Log(" jd.frequencyHz = %.15lef;\n", m_frequencyHz); + b2Log(" jd.dampingRatio = %.15lef;\n", m_dampingRatio); + b2Log(" joints[%d] = m_world->CreateJoint(&jd);\n", m_index); +} diff --git a/external/box2d/Dynamics/Joints/b2WheelJoint.h b/external/box2d/Dynamics/Joints/b2WheelJoint.h new file mode 100644 index 0000000000..ede1b08b7c --- /dev/null +++ b/external/box2d/Dynamics/Joints/b2WheelJoint.h @@ -0,0 +1,213 @@ +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_WHEEL_JOINT_H +#define B2_WHEEL_JOINT_H + +#include + +/// Wheel joint definition. This requires defining a line of +/// motion using an axis and an anchor point. The definition uses local +/// anchor points and a local axis so that the initial configuration +/// can violate the constraint slightly. The joint translation is zero +/// when the local anchor points coincide in world space. Using local +/// anchors and a local axis helps when saving and loading a game. +struct b2WheelJointDef : public b2JointDef +{ + b2WheelJointDef() + { + type = e_wheelJoint; + localAnchorA.SetZero(); + localAnchorB.SetZero(); + localAxisA.Set(1.0f, 0.0f); + enableMotor = false; + maxMotorTorque = 0.0f; + motorSpeed = 0.0f; + frequencyHz = 2.0f; + dampingRatio = 0.7f; + } + + /// Initialize the bodies, anchors, axis, and reference angle using the world + /// anchor and world axis. + void Initialize(b2Body* bodyA, b2Body* bodyB, const b2Vec2& anchor, const b2Vec2& axis); + + /// The local anchor point relative to bodyA's origin. + b2Vec2 localAnchorA; + + /// The local anchor point relative to bodyB's origin. + b2Vec2 localAnchorB; + + /// The local translation axis in bodyA. + b2Vec2 localAxisA; + + /// Enable/disable the joint motor. + bool enableMotor; + + /// The maximum motor torque, usually in N-m. + float32 maxMotorTorque; + + /// The desired motor speed in radians per second. + float32 motorSpeed; + + /// Suspension frequency, zero indicates no suspension + float32 frequencyHz; + + /// Suspension damping ratio, one indicates critical damping + float32 dampingRatio; +}; + +/// A wheel joint. This joint provides two degrees of freedom: translation +/// along an axis fixed in bodyA and rotation in the plane. You can use a +/// joint limit to restrict the range of motion and a joint motor to drive +/// the rotation or to model rotational friction. +/// This joint is designed for vehicle suspensions. +class b2WheelJoint : public b2Joint +{ +public: + void GetDefinition(b2WheelJointDef* def) const; + + b2Vec2 GetAnchorA() const; + b2Vec2 GetAnchorB() const; + + b2Vec2 GetReactionForce(float32 inv_dt) const; + float32 GetReactionTorque(float32 inv_dt) const; + + /// The local anchor point relative to bodyA's origin. + const b2Vec2& GetLocalAnchorA() const { return m_localAnchorA; } + + /// The local anchor point relative to bodyB's origin. + const b2Vec2& GetLocalAnchorB() const { return m_localAnchorB; } + + /// The local joint axis relative to bodyA. + const b2Vec2& GetLocalAxisA() const { return m_localXAxisA; } + + /// Get the current joint translation, usually in meters. + float32 GetJointTranslation() const; + + /// Get the current joint translation speed, usually in meters per second. + float32 GetJointSpeed() const; + + /// Is the joint motor enabled? + bool IsMotorEnabled() const; + + /// Enable/disable the joint motor. + void EnableMotor(bool flag); + + /// Set the motor speed, usually in radians per second. + void SetMotorSpeed(float32 speed); + + /// Get the motor speed, usually in radians per second. + float32 GetMotorSpeed() const; + + /// Set/Get the maximum motor force, usually in N-m. + void SetMaxMotorTorque(float32 torque); + float32 GetMaxMotorTorque() const; + + /// Get the current motor torque given the inverse time step, usually in N-m. + float32 GetMotorTorque(float32 inv_dt) const; + + /// Set/Get the spring frequency in hertz. Setting the frequency to zero disables the spring. + void SetSpringFrequencyHz(float32 hz); + float32 GetSpringFrequencyHz() const; + + /// Set/Get the spring damping ratio + void SetSpringDampingRatio(float32 ratio); + float32 GetSpringDampingRatio() const; + + /// Dump to b2Log + void Dump(); + +protected: + + friend class b2Joint; + b2WheelJoint(const b2WheelJointDef* def); + + void InitVelocityConstraints(const b2SolverData& data); + void SolveVelocityConstraints(const b2SolverData& data); + bool SolvePositionConstraints(const b2SolverData& data); + + float32 m_frequencyHz; + float32 m_dampingRatio; + + // Solver shared + b2Vec2 m_localAnchorA; + b2Vec2 m_localAnchorB; + b2Vec2 m_localXAxisA; + b2Vec2 m_localYAxisA; + + float32 m_impulse; + float32 m_motorImpulse; + float32 m_springImpulse; + + float32 m_maxMotorTorque; + float32 m_motorSpeed; + bool m_enableMotor; + + // Solver temp + int32 m_indexA; + int32 m_indexB; + b2Vec2 m_localCenterA; + b2Vec2 m_localCenterB; + float32 m_invMassA; + float32 m_invMassB; + float32 m_invIA; + float32 m_invIB; + + b2Vec2 m_ax, m_ay; + float32 m_sAx, m_sBx; + float32 m_sAy, m_sBy; + + float32 m_mass; + float32 m_motorMass; + float32 m_springMass; + + float32 m_bias; + float32 m_gamma; +}; + +inline float32 b2WheelJoint::GetMotorSpeed() const +{ + return m_motorSpeed; +} + +inline float32 b2WheelJoint::GetMaxMotorTorque() const +{ + return m_maxMotorTorque; +} + +inline void b2WheelJoint::SetSpringFrequencyHz(float32 hz) +{ + m_frequencyHz = hz; +} + +inline float32 b2WheelJoint::GetSpringFrequencyHz() const +{ + return m_frequencyHz; +} + +inline void b2WheelJoint::SetSpringDampingRatio(float32 ratio) +{ + m_dampingRatio = ratio; +} + +inline float32 b2WheelJoint::GetSpringDampingRatio() const +{ + return m_dampingRatio; +} + +#endif diff --git a/external/box2d/Dynamics/b2Body.cpp b/external/box2d/Dynamics/b2Body.cpp new file mode 100644 index 0000000000..b22b574023 --- /dev/null +++ b/external/box2d/Dynamics/b2Body.cpp @@ -0,0 +1,514 @@ +/* +* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include +#include +#include + +b2Body::b2Body(const b2BodyDef* bd, b2World* world) +{ + b2Assert(bd->position.IsValid()); + b2Assert(bd->linearVelocity.IsValid()); + b2Assert(b2IsValid(bd->angle)); + b2Assert(b2IsValid(bd->angularVelocity)); + b2Assert(b2IsValid(bd->angularDamping) && bd->angularDamping >= 0.0f); + b2Assert(b2IsValid(bd->linearDamping) && bd->linearDamping >= 0.0f); + + m_flags = 0; + + if (bd->bullet) + { + m_flags |= e_bulletFlag; + } + if (bd->fixedRotation) + { + m_flags |= e_fixedRotationFlag; + } + if (bd->allowSleep) + { + m_flags |= e_autoSleepFlag; + } + if (bd->awake) + { + m_flags |= e_awakeFlag; + } + if (bd->active) + { + m_flags |= e_activeFlag; + } + + m_world = world; + + m_xf.p = bd->position; + m_xf.q.Set(bd->angle); + + m_sweep.localCenter.SetZero(); + m_sweep.c0 = m_xf.p; + m_sweep.c = m_xf.p; + m_sweep.a0 = bd->angle; + m_sweep.a = bd->angle; + m_sweep.alpha0 = 0.0f; + + m_jointList = NULL; + m_contactList = NULL; + m_prev = NULL; + m_next = NULL; + + m_linearVelocity = bd->linearVelocity; + m_angularVelocity = bd->angularVelocity; + + m_linearDamping = bd->linearDamping; + m_angularDamping = bd->angularDamping; + m_gravityScale = bd->gravityScale; + + m_force.SetZero(); + m_torque = 0.0f; + + m_sleepTime = 0.0f; + + m_type = bd->type; + + if (m_type == b2_dynamicBody) + { + m_mass = 1.0f; + m_invMass = 1.0f; + } + else + { + m_mass = 0.0f; + m_invMass = 0.0f; + } + + m_I = 0.0f; + m_invI = 0.0f; + + m_userData = bd->userData; + + m_fixtureList = NULL; + m_fixtureCount = 0; +} + +b2Body::~b2Body() +{ + // shapes and joints are destroyed in b2World::Destroy +} + +void b2Body::SetType(b2BodyType type) +{ + b2Assert(m_world->IsLocked() == false); + if (m_world->IsLocked() == true) + { + return; + } + + if (m_type == type) + { + return; + } + + m_type = type; + + ResetMassData(); + + if (m_type == b2_staticBody) + { + m_linearVelocity.SetZero(); + m_angularVelocity = 0.0f; + m_sweep.a0 = m_sweep.a; + m_sweep.c0 = m_sweep.c; + SynchronizeFixtures(); + } + + SetAwake(true); + + m_force.SetZero(); + m_torque = 0.0f; + + // Since the body type changed, we need to flag contacts for filtering. + for (b2Fixture* f = m_fixtureList; f; f = f->m_next) + { + f->Refilter(); + } +} + +b2Fixture* b2Body::CreateFixture(const b2FixtureDef* def) +{ + b2Assert(m_world->IsLocked() == false); + if (m_world->IsLocked() == true) + { + return NULL; + } + + b2BlockAllocator* allocator = &m_world->m_blockAllocator; + + void* memory = allocator->Allocate(sizeof(b2Fixture)); + b2Fixture* fixture = new (memory) b2Fixture; + fixture->Create(allocator, this, def); + + if (m_flags & e_activeFlag) + { + b2BroadPhase* broadPhase = &m_world->m_contactManager.m_broadPhase; + fixture->CreateProxies(broadPhase, m_xf); + } + + fixture->m_next = m_fixtureList; + m_fixtureList = fixture; + ++m_fixtureCount; + + fixture->m_body = this; + + // Adjust mass properties if needed. + if (fixture->m_density > 0.0f) + { + ResetMassData(); + } + + // Let the world know we have a new fixture. This will cause new contacts + // to be created at the beginning of the next time step. + m_world->m_flags |= b2World::e_newFixture; + + return fixture; +} + +b2Fixture* b2Body::CreateFixture(const b2Shape* shape, float32 density) +{ + b2FixtureDef def; + def.shape = shape; + def.density = density; + + return CreateFixture(&def); +} + +void b2Body::DestroyFixture(b2Fixture* fixture) +{ + b2Assert(m_world->IsLocked() == false); + if (m_world->IsLocked() == true) + { + return; + } + + b2Assert(fixture->m_body == this); + + // Remove the fixture from this body's singly linked list. + b2Assert(m_fixtureCount > 0); + b2Fixture** node = &m_fixtureList; + bool found = false; + while (*node != NULL) + { + if (*node == fixture) + { + *node = fixture->m_next; + found = true; + break; + } + + node = &(*node)->m_next; + } + + // You tried to remove a shape that is not attached to this body. + b2Assert(found); + + // Destroy any contacts associated with the fixture. + b2ContactEdge* edge = m_contactList; + while (edge) + { + b2Contact* c = edge->contact; + edge = edge->next; + + b2Fixture* fixtureA = c->GetFixtureA(); + b2Fixture* fixtureB = c->GetFixtureB(); + + if (fixture == fixtureA || fixture == fixtureB) + { + // This destroys the contact and removes it from + // this body's contact list. + m_world->m_contactManager.Destroy(c); + } + } + + b2BlockAllocator* allocator = &m_world->m_blockAllocator; + + if (m_flags & e_activeFlag) + { + b2BroadPhase* broadPhase = &m_world->m_contactManager.m_broadPhase; + fixture->DestroyProxies(broadPhase); + } + + fixture->Destroy(allocator); + fixture->m_body = NULL; + fixture->m_next = NULL; + fixture->~b2Fixture(); + allocator->Free(fixture, sizeof(b2Fixture)); + + --m_fixtureCount; + + // Reset the mass data. + ResetMassData(); +} + +void b2Body::ResetMassData() +{ + // Compute mass data from shapes. Each shape has its own density. + m_mass = 0.0f; + m_invMass = 0.0f; + m_I = 0.0f; + m_invI = 0.0f; + m_sweep.localCenter.SetZero(); + + // Static and kinematic bodies have zero mass. + if (m_type == b2_staticBody || m_type == b2_kinematicBody) + { + m_sweep.c0 = m_xf.p; + m_sweep.c = m_xf.p; + m_sweep.a0 = m_sweep.a; + return; + } + + b2Assert(m_type == b2_dynamicBody); + + // Accumulate mass over all fixtures. + b2Vec2 localCenter = b2Vec2_zero; + for (b2Fixture* f = m_fixtureList; f; f = f->m_next) + { + if (f->m_density == 0.0f) + { + continue; + } + + b2MassData massData; + f->GetMassData(&massData); + m_mass += massData.mass; + localCenter += massData.mass * massData.center; + m_I += massData.I; + } + + // Compute center of mass. + if (m_mass > 0.0f) + { + m_invMass = 1.0f / m_mass; + localCenter *= m_invMass; + } + else + { + // Force all dynamic bodies to have a positive mass. + m_mass = 1.0f; + m_invMass = 1.0f; + } + + if (m_I > 0.0f && (m_flags & e_fixedRotationFlag) == 0) + { + // Center the inertia about the center of mass. + m_I -= m_mass * b2Dot(localCenter, localCenter); + b2Assert(m_I > 0.0f); + m_invI = 1.0f / m_I; + + } + else + { + m_I = 0.0f; + m_invI = 0.0f; + } + + // Move center of mass. + b2Vec2 oldCenter = m_sweep.c; + m_sweep.localCenter = localCenter; + m_sweep.c0 = m_sweep.c = b2Mul(m_xf, m_sweep.localCenter); + + // Update center of mass velocity. + m_linearVelocity += b2Cross(m_angularVelocity, m_sweep.c - oldCenter); +} + +void b2Body::SetMassData(const b2MassData* massData) +{ + b2Assert(m_world->IsLocked() == false); + if (m_world->IsLocked() == true) + { + return; + } + + if (m_type != b2_dynamicBody) + { + return; + } + + m_invMass = 0.0f; + m_I = 0.0f; + m_invI = 0.0f; + + m_mass = massData->mass; + if (m_mass <= 0.0f) + { + m_mass = 1.0f; + } + + m_invMass = 1.0f / m_mass; + + if (massData->I > 0.0f && (m_flags & b2Body::e_fixedRotationFlag) == 0) + { + m_I = massData->I - m_mass * b2Dot(massData->center, massData->center); + b2Assert(m_I > 0.0f); + m_invI = 1.0f / m_I; + } + + // Move center of mass. + b2Vec2 oldCenter = m_sweep.c; + m_sweep.localCenter = massData->center; + m_sweep.c0 = m_sweep.c = b2Mul(m_xf, m_sweep.localCenter); + + // Update center of mass velocity. + m_linearVelocity += b2Cross(m_angularVelocity, m_sweep.c - oldCenter); +} + +bool b2Body::ShouldCollide(const b2Body* other) const +{ + // At least one body should be dynamic. + if (m_type != b2_dynamicBody && other->m_type != b2_dynamicBody) + { + return false; + } + + // Does a joint prevent collision? + for (b2JointEdge* jn = m_jointList; jn; jn = jn->next) + { + if (jn->other == other) + { + if (jn->joint->m_collideConnected == false) + { + return false; + } + } + } + + return true; +} + +void b2Body::SetTransform(const b2Vec2& position, float32 angle) +{ + b2Assert(m_world->IsLocked() == false); + if (m_world->IsLocked() == true) + { + return; + } + + m_xf.q.Set(angle); + m_xf.p = position; + + m_sweep.c = b2Mul(m_xf, m_sweep.localCenter); + m_sweep.a = angle; + + m_sweep.c0 = m_sweep.c; + m_sweep.a0 = angle; + + b2BroadPhase* broadPhase = &m_world->m_contactManager.m_broadPhase; + for (b2Fixture* f = m_fixtureList; f; f = f->m_next) + { + f->Synchronize(broadPhase, m_xf, m_xf); + } + + m_world->m_contactManager.FindNewContacts(); +} + +void b2Body::SynchronizeFixtures() +{ + b2Transform xf1; + xf1.q.Set(m_sweep.a0); + xf1.p = m_sweep.c0 - b2Mul(xf1.q, m_sweep.localCenter); + + b2BroadPhase* broadPhase = &m_world->m_contactManager.m_broadPhase; + for (b2Fixture* f = m_fixtureList; f; f = f->m_next) + { + f->Synchronize(broadPhase, xf1, m_xf); + } +} + +void b2Body::SetActive(bool flag) +{ + b2Assert(m_world->IsLocked() == false); + + if (flag == IsActive()) + { + return; + } + + if (flag) + { + m_flags |= e_activeFlag; + + // Create all proxies. + b2BroadPhase* broadPhase = &m_world->m_contactManager.m_broadPhase; + for (b2Fixture* f = m_fixtureList; f; f = f->m_next) + { + f->CreateProxies(broadPhase, m_xf); + } + + // Contacts are created the next time step. + } + else + { + m_flags &= ~e_activeFlag; + + // Destroy all proxies. + b2BroadPhase* broadPhase = &m_world->m_contactManager.m_broadPhase; + for (b2Fixture* f = m_fixtureList; f; f = f->m_next) + { + f->DestroyProxies(broadPhase); + } + + // Destroy the attached contacts. + b2ContactEdge* ce = m_contactList; + while (ce) + { + b2ContactEdge* ce0 = ce; + ce = ce->next; + m_world->m_contactManager.Destroy(ce0->contact); + } + m_contactList = NULL; + } +} + +void b2Body::Dump() +{ + int32 bodyIndex = m_islandIndex; + + b2Log("{\n"); + b2Log(" b2BodyDef bd;\n"); + b2Log(" bd.type = b2BodyType(%d);\n", m_type); + b2Log(" bd.position.Set(%.15lef, %.15lef);\n", m_xf.p.x, m_xf.p.y); + b2Log(" bd.angle = %.15lef;\n", m_sweep.a); + b2Log(" bd.linearVelocity.Set(%.15lef, %.15lef);\n", m_linearVelocity.x, m_linearVelocity.y); + b2Log(" bd.angularVelocity = %.15lef;\n", m_angularVelocity); + b2Log(" bd.linearDamping = %.15lef;\n", m_linearDamping); + b2Log(" bd.angularDamping = %.15lef;\n", m_angularDamping); + b2Log(" bd.allowSleep = bool(%d);\n", m_flags & e_autoSleepFlag); + b2Log(" bd.awake = bool(%d);\n", m_flags & e_awakeFlag); + b2Log(" bd.fixedRotation = bool(%d);\n", m_flags & e_fixedRotationFlag); + b2Log(" bd.bullet = bool(%d);\n", m_flags & e_bulletFlag); + b2Log(" bd.active = bool(%d);\n", m_flags & e_activeFlag); + b2Log(" bd.gravityScale = %.15lef;\n", m_gravityScale); + b2Log(" bodies[%d] = m_world->CreateBody(&bd);\n", m_islandIndex); + b2Log("\n"); + for (b2Fixture* f = m_fixtureList; f; f = f->m_next) + { + b2Log(" {\n"); + f->Dump(bodyIndex); + b2Log(" }\n"); + } + b2Log("}\n"); +} \ No newline at end of file diff --git a/external/box2d/Dynamics/b2Body.h b/external/box2d/Dynamics/b2Body.h new file mode 100644 index 0000000000..e2d16bf630 --- /dev/null +++ b/external/box2d/Dynamics/b2Body.h @@ -0,0 +1,846 @@ +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_BODY_H +#define B2_BODY_H + +#include +#include +#include + +class b2Fixture; +class b2Joint; +class b2Contact; +class b2Controller; +class b2World; +struct b2FixtureDef; +struct b2JointEdge; +struct b2ContactEdge; + +/// The body type. +/// static: zero mass, zero velocity, may be manually moved +/// kinematic: zero mass, non-zero velocity set by user, moved by solver +/// dynamic: positive mass, non-zero velocity determined by forces, moved by solver +enum b2BodyType +{ + b2_staticBody = 0, + b2_kinematicBody, + b2_dynamicBody + + // TODO_ERIN + //b2_bulletBody, +}; + +/// A body definition holds all the data needed to construct a rigid body. +/// You can safely re-use body definitions. Shapes are added to a body after construction. +struct b2BodyDef +{ + /// This constructor sets the body definition default values. + b2BodyDef() + { + userData = NULL; + position.Set(0.0f, 0.0f); + angle = 0.0f; + linearVelocity.Set(0.0f, 0.0f); + angularVelocity = 0.0f; + linearDamping = 0.0f; + angularDamping = 0.0f; + allowSleep = true; + awake = true; + fixedRotation = false; + bullet = false; + type = b2_staticBody; + active = true; + gravityScale = 1.0f; + } + + /// The body type: static, kinematic, or dynamic. + /// Note: if a dynamic body would have zero mass, the mass is set to one. + b2BodyType type; + + /// The world position of the body. Avoid creating bodies at the origin + /// since this can lead to many overlapping shapes. + b2Vec2 position; + + /// The world angle of the body in radians. + float32 angle; + + /// The linear velocity of the body's origin in world co-ordinates. + b2Vec2 linearVelocity; + + /// The angular velocity of the body. + float32 angularVelocity; + + /// Linear damping is use to reduce the linear velocity. The damping parameter + /// can be larger than 1.0f but the damping effect becomes sensitive to the + /// time step when the damping parameter is large. + float32 linearDamping; + + /// Angular damping is use to reduce the angular velocity. The damping parameter + /// can be larger than 1.0f but the damping effect becomes sensitive to the + /// time step when the damping parameter is large. + float32 angularDamping; + + /// Set this flag to false if this body should never fall asleep. Note that + /// this increases CPU usage. + bool allowSleep; + + /// Is this body initially awake or sleeping? + bool awake; + + /// Should this body be prevented from rotating? Useful for characters. + bool fixedRotation; + + /// Is this a fast moving body that should be prevented from tunneling through + /// other moving bodies? Note that all bodies are prevented from tunneling through + /// kinematic and static bodies. This setting is only considered on dynamic bodies. + /// @warning You should use this flag sparingly since it increases processing time. + bool bullet; + + /// Does this body start out active? + bool active; + + /// Use this to store application specific body data. + void* userData; + + /// Scale the gravity applied to this body. + float32 gravityScale; +}; + +/// A rigid body. These are created via b2World::CreateBody. +class b2Body +{ +public: + /// Creates a fixture and attach it to this body. Use this function if you need + /// to set some fixture parameters, like friction. Otherwise you can create the + /// fixture directly from a shape. + /// If the density is non-zero, this function automatically updates the mass of the body. + /// Contacts are not created until the next time step. + /// @param def the fixture definition. + /// @warning This function is locked during callbacks. + b2Fixture* CreateFixture(const b2FixtureDef* def); + + /// Creates a fixture from a shape and attach it to this body. + /// This is a convenience function. Use b2FixtureDef if you need to set parameters + /// like friction, restitution, user data, or filtering. + /// If the density is non-zero, this function automatically updates the mass of the body. + /// @param shape the shape to be cloned. + /// @param density the shape density (set to zero for static bodies). + /// @warning This function is locked during callbacks. + b2Fixture* CreateFixture(const b2Shape* shape, float32 density); + + /// Destroy a fixture. This removes the fixture from the broad-phase and + /// destroys all contacts associated with this fixture. This will + /// automatically adjust the mass of the body if the body is dynamic and the + /// fixture has positive density. + /// All fixtures attached to a body are implicitly destroyed when the body is destroyed. + /// @param fixture the fixture to be removed. + /// @warning This function is locked during callbacks. + void DestroyFixture(b2Fixture* fixture); + + /// Set the position of the body's origin and rotation. + /// This breaks any contacts and wakes the other bodies. + /// Manipulating a body's transform may cause non-physical behavior. + /// @param position the world position of the body's local origin. + /// @param angle the world rotation in radians. + void SetTransform(const b2Vec2& position, float32 angle); + + /// Get the body transform for the body's origin. + /// @return the world transform of the body's origin. + const b2Transform& GetTransform() const; + + /// Get the world body origin position. + /// @return the world position of the body's origin. + const b2Vec2& GetPosition() const; + + /// Get the angle in radians. + /// @return the current world rotation angle in radians. + float32 GetAngle() const; + + /// Get the world position of the center of mass. + const b2Vec2& GetWorldCenter() const; + + /// Get the local position of the center of mass. + const b2Vec2& GetLocalCenter() const; + + /// Set the linear velocity of the center of mass. + /// @param v the new linear velocity of the center of mass. + void SetLinearVelocity(const b2Vec2& v); + + /// Get the linear velocity of the center of mass. + /// @return the linear velocity of the center of mass. + b2Vec2 GetLinearVelocity() const; + + /// Set the angular velocity. + /// @param omega the new angular velocity in radians/second. + void SetAngularVelocity(float32 omega); + + /// Get the angular velocity. + /// @return the angular velocity in radians/second. + float32 GetAngularVelocity() const; + + /// Apply a force at a world point. If the force is not + /// applied at the center of mass, it will generate a torque and + /// affect the angular velocity. This wakes up the body. + /// @param force the world force vector, usually in Newtons (N). + /// @param point the world position of the point of application. + void ApplyForce(const b2Vec2& force, const b2Vec2& point); + + /// Apply a force to the center of mass. This wakes up the body. + /// @param force the world force vector, usually in Newtons (N). + void ApplyForceToCenter(const b2Vec2& force); + + /// Apply a torque. This affects the angular velocity + /// without affecting the linear velocity of the center of mass. + /// This wakes up the body. + /// @param torque about the z-axis (out of the screen), usually in N-m. + void ApplyTorque(float32 torque); + + /// Apply an impulse at a point. This immediately modifies the velocity. + /// It also modifies the angular velocity if the point of application + /// is not at the center of mass. This wakes up the body. + /// @param impulse the world impulse vector, usually in N-seconds or kg-m/s. + /// @param point the world position of the point of application. + void ApplyLinearImpulse(const b2Vec2& impulse, const b2Vec2& point); + + /// Apply an angular impulse. + /// @param impulse the angular impulse in units of kg*m*m/s + void ApplyAngularImpulse(float32 impulse); + + /// Get the total mass of the body. + /// @return the mass, usually in kilograms (kg). + float32 GetMass() const; + + /// Get the rotational inertia of the body about the local origin. + /// @return the rotational inertia, usually in kg-m^2. + float32 GetInertia() const; + + /// Get the mass data of the body. + /// @return a struct containing the mass, inertia and center of the body. + void GetMassData(b2MassData* data) const; + + /// Set the mass properties to override the mass properties of the fixtures. + /// Note that this changes the center of mass position. + /// Note that creating or destroying fixtures can also alter the mass. + /// This function has no effect if the body isn't dynamic. + /// @param massData the mass properties. + void SetMassData(const b2MassData* data); + + /// This resets the mass properties to the sum of the mass properties of the fixtures. + /// This normally does not need to be called unless you called SetMassData to override + /// the mass and you later want to reset the mass. + void ResetMassData(); + + /// Get the world coordinates of a point given the local coordinates. + /// @param localPoint a point on the body measured relative the the body's origin. + /// @return the same point expressed in world coordinates. + b2Vec2 GetWorldPoint(const b2Vec2& localPoint) const; + + /// Get the world coordinates of a vector given the local coordinates. + /// @param localVector a vector fixed in the body. + /// @return the same vector expressed in world coordinates. + b2Vec2 GetWorldVector(const b2Vec2& localVector) const; + + /// Gets a local point relative to the body's origin given a world point. + /// @param a point in world coordinates. + /// @return the corresponding local point relative to the body's origin. + b2Vec2 GetLocalPoint(const b2Vec2& worldPoint) const; + + /// Gets a local vector given a world vector. + /// @param a vector in world coordinates. + /// @return the corresponding local vector. + b2Vec2 GetLocalVector(const b2Vec2& worldVector) const; + + /// Get the world linear velocity of a world point attached to this body. + /// @param a point in world coordinates. + /// @return the world velocity of a point. + b2Vec2 GetLinearVelocityFromWorldPoint(const b2Vec2& worldPoint) const; + + /// Get the world velocity of a local point. + /// @param a point in local coordinates. + /// @return the world velocity of a point. + b2Vec2 GetLinearVelocityFromLocalPoint(const b2Vec2& localPoint) const; + + /// Get the linear damping of the body. + float32 GetLinearDamping() const; + + /// Set the linear damping of the body. + void SetLinearDamping(float32 linearDamping); + + /// Get the angular damping of the body. + float32 GetAngularDamping() const; + + /// Set the angular damping of the body. + void SetAngularDamping(float32 angularDamping); + + /// Get the gravity scale of the body. + float32 GetGravityScale() const; + + /// Set the gravity scale of the body. + void SetGravityScale(float32 scale); + + /// Set the type of this body. This may alter the mass and velocity. + void SetType(b2BodyType type); + + /// Get the type of this body. + b2BodyType GetType() const; + + /// Should this body be treated like a bullet for continuous collision detection? + void SetBullet(bool flag); + + /// Is this body treated like a bullet for continuous collision detection? + bool IsBullet() const; + + /// You can disable sleeping on this body. If you disable sleeping, the + /// body will be woken. + void SetSleepingAllowed(bool flag); + + /// Is this body allowed to sleep + bool IsSleepingAllowed() const; + + /// Set the sleep state of the body. A sleeping body has very + /// low CPU cost. + /// @param flag set to true to put body to sleep, false to wake it. + void SetAwake(bool flag); + + /// Get the sleeping state of this body. + /// @return true if the body is sleeping. + bool IsAwake() const; + + /// Set the active state of the body. An inactive body is not + /// simulated and cannot be collided with or woken up. + /// If you pass a flag of true, all fixtures will be added to the + /// broad-phase. + /// If you pass a flag of false, all fixtures will be removed from + /// the broad-phase and all contacts will be destroyed. + /// Fixtures and joints are otherwise unaffected. You may continue + /// to create/destroy fixtures and joints on inactive bodies. + /// Fixtures on an inactive body are implicitly inactive and will + /// not participate in collisions, ray-casts, or queries. + /// Joints connected to an inactive body are implicitly inactive. + /// An inactive body is still owned by a b2World object and remains + /// in the body list. + void SetActive(bool flag); + + /// Get the active state of the body. + bool IsActive() const; + + /// Set this body to have fixed rotation. This causes the mass + /// to be reset. + void SetFixedRotation(bool flag); + + /// Does this body have fixed rotation? + bool IsFixedRotation() const; + + /// Get the list of all fixtures attached to this body. + b2Fixture* GetFixtureList(); + const b2Fixture* GetFixtureList() const; + + /// Get the list of all joints attached to this body. + b2JointEdge* GetJointList(); + const b2JointEdge* GetJointList() const; + + /// Get the list of all contacts attached to this body. + /// @warning this list changes during the time step and you may + /// miss some collisions if you don't use b2ContactListener. + b2ContactEdge* GetContactList(); + const b2ContactEdge* GetContactList() const; + + /// Get the next body in the world's body list. + b2Body* GetNext(); + const b2Body* GetNext() const; + + /// Get the user data pointer that was provided in the body definition. + void* GetUserData() const; + + /// Set the user data. Use this to store your application specific data. + void SetUserData(void* data); + + /// Get the parent world of this body. + b2World* GetWorld(); + const b2World* GetWorld() const; + + /// Dump this body to a log file + void Dump(); + +private: + + friend class b2World; + friend class b2Island; + friend class b2ContactManager; + friend class b2ContactSolver; + friend class b2Contact; + + friend class b2DistanceJoint; + friend class b2GearJoint; + friend class b2WheelJoint; + friend class b2MouseJoint; + friend class b2PrismaticJoint; + friend class b2PulleyJoint; + friend class b2RevoluteJoint; + friend class b2WeldJoint; + friend class b2FrictionJoint; + friend class b2RopeJoint; + + // m_flags + enum + { + e_islandFlag = 0x0001, + e_awakeFlag = 0x0002, + e_autoSleepFlag = 0x0004, + e_bulletFlag = 0x0008, + e_fixedRotationFlag = 0x0010, + e_activeFlag = 0x0020, + e_toiFlag = 0x0040 + }; + + b2Body(const b2BodyDef* bd, b2World* world); + ~b2Body(); + + void SynchronizeFixtures(); + void SynchronizeTransform(); + + // This is used to prevent connected bodies from colliding. + // It may lie, depending on the collideConnected flag. + bool ShouldCollide(const b2Body* other) const; + + void Advance(float32 t); + + b2BodyType m_type; + + uint16 m_flags; + + int32 m_islandIndex; + + b2Transform m_xf; // the body origin transform + b2Sweep m_sweep; // the swept motion for CCD + + b2Vec2 m_linearVelocity; + float32 m_angularVelocity; + + b2Vec2 m_force; + float32 m_torque; + + b2World* m_world; + b2Body* m_prev; + b2Body* m_next; + + b2Fixture* m_fixtureList; + int32 m_fixtureCount; + + b2JointEdge* m_jointList; + b2ContactEdge* m_contactList; + + float32 m_mass, m_invMass; + + // Rotational inertia about the center of mass. + float32 m_I, m_invI; + + float32 m_linearDamping; + float32 m_angularDamping; + float32 m_gravityScale; + + float32 m_sleepTime; + + void* m_userData; +}; + +inline b2BodyType b2Body::GetType() const +{ + return m_type; +} + +inline const b2Transform& b2Body::GetTransform() const +{ + return m_xf; +} + +inline const b2Vec2& b2Body::GetPosition() const +{ + return m_xf.p; +} + +inline float32 b2Body::GetAngle() const +{ + return m_sweep.a; +} + +inline const b2Vec2& b2Body::GetWorldCenter() const +{ + return m_sweep.c; +} + +inline const b2Vec2& b2Body::GetLocalCenter() const +{ + return m_sweep.localCenter; +} + +inline void b2Body::SetLinearVelocity(const b2Vec2& v) +{ + if (m_type == b2_staticBody) + { + return; + } + + if (b2Dot(v,v) > 0.0f) + { + SetAwake(true); + } + + m_linearVelocity = v; +} + +inline b2Vec2 b2Body::GetLinearVelocity() const +{ + return m_linearVelocity; +} + +inline void b2Body::SetAngularVelocity(float32 w) +{ + if (m_type == b2_staticBody) + { + return; + } + + if (w * w > 0.0f) + { + SetAwake(true); + } + + m_angularVelocity = w; +} + +inline float32 b2Body::GetAngularVelocity() const +{ + return m_angularVelocity; +} + +inline float32 b2Body::GetMass() const +{ + return m_mass; +} + +inline float32 b2Body::GetInertia() const +{ + return m_I + m_mass * b2Dot(m_sweep.localCenter, m_sweep.localCenter); +} + +inline void b2Body::GetMassData(b2MassData* data) const +{ + data->mass = m_mass; + data->I = m_I + m_mass * b2Dot(m_sweep.localCenter, m_sweep.localCenter); + data->center = m_sweep.localCenter; +} + +inline b2Vec2 b2Body::GetWorldPoint(const b2Vec2& localPoint) const +{ + return b2Mul(m_xf, localPoint); +} + +inline b2Vec2 b2Body::GetWorldVector(const b2Vec2& localVector) const +{ + return b2Mul(m_xf.q, localVector); +} + +inline b2Vec2 b2Body::GetLocalPoint(const b2Vec2& worldPoint) const +{ + return b2MulT(m_xf, worldPoint); +} + +inline b2Vec2 b2Body::GetLocalVector(const b2Vec2& worldVector) const +{ + return b2MulT(m_xf.q, worldVector); +} + +inline b2Vec2 b2Body::GetLinearVelocityFromWorldPoint(const b2Vec2& worldPoint) const +{ + return m_linearVelocity + b2Cross(m_angularVelocity, worldPoint - m_sweep.c); +} + +inline b2Vec2 b2Body::GetLinearVelocityFromLocalPoint(const b2Vec2& localPoint) const +{ + return GetLinearVelocityFromWorldPoint(GetWorldPoint(localPoint)); +} + +inline float32 b2Body::GetLinearDamping() const +{ + return m_linearDamping; +} + +inline void b2Body::SetLinearDamping(float32 linearDamping) +{ + m_linearDamping = linearDamping; +} + +inline float32 b2Body::GetAngularDamping() const +{ + return m_angularDamping; +} + +inline void b2Body::SetAngularDamping(float32 angularDamping) +{ + m_angularDamping = angularDamping; +} + +inline float32 b2Body::GetGravityScale() const +{ + return m_gravityScale; +} + +inline void b2Body::SetGravityScale(float32 scale) +{ + m_gravityScale = scale; +} + +inline void b2Body::SetBullet(bool flag) +{ + if (flag) + { + m_flags |= e_bulletFlag; + } + else + { + m_flags &= ~e_bulletFlag; + } +} + +inline bool b2Body::IsBullet() const +{ + return (m_flags & e_bulletFlag) == e_bulletFlag; +} + +inline void b2Body::SetAwake(bool flag) +{ + if (flag) + { + if ((m_flags & e_awakeFlag) == 0) + { + m_flags |= e_awakeFlag; + m_sleepTime = 0.0f; + } + } + else + { + m_flags &= ~e_awakeFlag; + m_sleepTime = 0.0f; + m_linearVelocity.SetZero(); + m_angularVelocity = 0.0f; + m_force.SetZero(); + m_torque = 0.0f; + } +} + +inline bool b2Body::IsAwake() const +{ + return (m_flags & e_awakeFlag) == e_awakeFlag; +} + +inline bool b2Body::IsActive() const +{ + return (m_flags & e_activeFlag) == e_activeFlag; +} + +inline void b2Body::SetFixedRotation(bool flag) +{ + if (flag) + { + m_flags |= e_fixedRotationFlag; + } + else + { + m_flags &= ~e_fixedRotationFlag; + } + + ResetMassData(); +} + +inline bool b2Body::IsFixedRotation() const +{ + return (m_flags & e_fixedRotationFlag) == e_fixedRotationFlag; +} + +inline void b2Body::SetSleepingAllowed(bool flag) +{ + if (flag) + { + m_flags |= e_autoSleepFlag; + } + else + { + m_flags &= ~e_autoSleepFlag; + SetAwake(true); + } +} + +inline bool b2Body::IsSleepingAllowed() const +{ + return (m_flags & e_autoSleepFlag) == e_autoSleepFlag; +} + +inline b2Fixture* b2Body::GetFixtureList() +{ + return m_fixtureList; +} + +inline const b2Fixture* b2Body::GetFixtureList() const +{ + return m_fixtureList; +} + +inline b2JointEdge* b2Body::GetJointList() +{ + return m_jointList; +} + +inline const b2JointEdge* b2Body::GetJointList() const +{ + return m_jointList; +} + +inline b2ContactEdge* b2Body::GetContactList() +{ + return m_contactList; +} + +inline const b2ContactEdge* b2Body::GetContactList() const +{ + return m_contactList; +} + +inline b2Body* b2Body::GetNext() +{ + return m_next; +} + +inline const b2Body* b2Body::GetNext() const +{ + return m_next; +} + +inline void b2Body::SetUserData(void* data) +{ + m_userData = data; +} + +inline void* b2Body::GetUserData() const +{ + return m_userData; +} + +inline void b2Body::ApplyForce(const b2Vec2& force, const b2Vec2& point) +{ + if (m_type != b2_dynamicBody) + { + return; + } + + if (IsAwake() == false) + { + SetAwake(true); + } + + m_force += force; + m_torque += b2Cross(point - m_sweep.c, force); +} + +inline void b2Body::ApplyForceToCenter(const b2Vec2& force) +{ + if (m_type != b2_dynamicBody) + { + return; + } + + if (IsAwake() == false) + { + SetAwake(true); + } + + m_force += force; +} + +inline void b2Body::ApplyTorque(float32 torque) +{ + if (m_type != b2_dynamicBody) + { + return; + } + + if (IsAwake() == false) + { + SetAwake(true); + } + + m_torque += torque; +} + +inline void b2Body::ApplyLinearImpulse(const b2Vec2& impulse, const b2Vec2& point) +{ + if (m_type != b2_dynamicBody) + { + return; + } + + if (IsAwake() == false) + { + SetAwake(true); + } + m_linearVelocity += m_invMass * impulse; + m_angularVelocity += m_invI * b2Cross(point - m_sweep.c, impulse); +} + +inline void b2Body::ApplyAngularImpulse(float32 impulse) +{ + if (m_type != b2_dynamicBody) + { + return; + } + + if (IsAwake() == false) + { + SetAwake(true); + } + m_angularVelocity += m_invI * impulse; +} + +inline void b2Body::SynchronizeTransform() +{ + m_xf.q.Set(m_sweep.a); + m_xf.p = m_sweep.c - b2Mul(m_xf.q, m_sweep.localCenter); +} + +inline void b2Body::Advance(float32 alpha) +{ + // Advance to the new safe time. This doesn't sync the broad-phase. + m_sweep.Advance(alpha); + m_sweep.c = m_sweep.c0; + m_sweep.a = m_sweep.a0; + m_xf.q.Set(m_sweep.a); + m_xf.p = m_sweep.c - b2Mul(m_xf.q, m_sweep.localCenter); +} + +inline b2World* b2Body::GetWorld() +{ + return m_world; +} + +inline const b2World* b2Body::GetWorld() const +{ + return m_world; +} + +#endif diff --git a/external/box2d/Dynamics/b2ContactManager.cpp b/external/box2d/Dynamics/b2ContactManager.cpp new file mode 100644 index 0000000000..c14cc4ce45 --- /dev/null +++ b/external/box2d/Dynamics/b2ContactManager.cpp @@ -0,0 +1,293 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include +#include +#include + +b2ContactFilter b2_defaultFilter; +b2ContactListener b2_defaultListener; + +b2ContactManager::b2ContactManager() +{ + m_contactList = NULL; + m_contactCount = 0; + m_contactFilter = &b2_defaultFilter; + m_contactListener = &b2_defaultListener; + m_allocator = NULL; +} + +void b2ContactManager::Destroy(b2Contact* c) +{ + b2Fixture* fixtureA = c->GetFixtureA(); + b2Fixture* fixtureB = c->GetFixtureB(); + b2Body* bodyA = fixtureA->GetBody(); + b2Body* bodyB = fixtureB->GetBody(); + + if (m_contactListener && c->IsTouching()) + { + m_contactListener->EndContact(c); + } + + // Remove from the world. + if (c->m_prev) + { + c->m_prev->m_next = c->m_next; + } + + if (c->m_next) + { + c->m_next->m_prev = c->m_prev; + } + + if (c == m_contactList) + { + m_contactList = c->m_next; + } + + // Remove from body 1 + if (c->m_nodeA.prev) + { + c->m_nodeA.prev->next = c->m_nodeA.next; + } + + if (c->m_nodeA.next) + { + c->m_nodeA.next->prev = c->m_nodeA.prev; + } + + if (&c->m_nodeA == bodyA->m_contactList) + { + bodyA->m_contactList = c->m_nodeA.next; + } + + // Remove from body 2 + if (c->m_nodeB.prev) + { + c->m_nodeB.prev->next = c->m_nodeB.next; + } + + if (c->m_nodeB.next) + { + c->m_nodeB.next->prev = c->m_nodeB.prev; + } + + if (&c->m_nodeB == bodyB->m_contactList) + { + bodyB->m_contactList = c->m_nodeB.next; + } + + // Call the factory. + b2Contact::Destroy(c, m_allocator); + --m_contactCount; +} + +// This is the top level collision call for the time step. Here +// all the narrow phase collision is processed for the world +// contact list. +void b2ContactManager::Collide() +{ + // Update awake contacts. + b2Contact* c = m_contactList; + while (c) + { + b2Fixture* fixtureA = c->GetFixtureA(); + b2Fixture* fixtureB = c->GetFixtureB(); + int32 indexA = c->GetChildIndexA(); + int32 indexB = c->GetChildIndexB(); + b2Body* bodyA = fixtureA->GetBody(); + b2Body* bodyB = fixtureB->GetBody(); + + // Is this contact flagged for filtering? + if (c->m_flags & b2Contact::e_filterFlag) + { + // Should these bodies collide? + if (bodyB->ShouldCollide(bodyA) == false) + { + b2Contact* cNuke = c; + c = cNuke->GetNext(); + Destroy(cNuke); + continue; + } + + // Check user filtering. + if (m_contactFilter && m_contactFilter->ShouldCollide(fixtureA, fixtureB) == false) + { + b2Contact* cNuke = c; + c = cNuke->GetNext(); + Destroy(cNuke); + continue; + } + + // Clear the filtering flag. + c->m_flags &= ~b2Contact::e_filterFlag; + } + + bool activeA = bodyA->IsAwake() && bodyA->m_type != b2_staticBody; + bool activeB = bodyB->IsAwake() && bodyB->m_type != b2_staticBody; + + // At least one body must be awake and it must be dynamic or kinematic. + if (activeA == false && activeB == false) + { + c = c->GetNext(); + continue; + } + + int32 proxyIdA = fixtureA->m_proxies[indexA].proxyId; + int32 proxyIdB = fixtureB->m_proxies[indexB].proxyId; + bool overlap = m_broadPhase.TestOverlap(proxyIdA, proxyIdB); + + // Here we destroy contacts that cease to overlap in the broad-phase. + if (overlap == false) + { + b2Contact* cNuke = c; + c = cNuke->GetNext(); + Destroy(cNuke); + continue; + } + + // The contact persists. + c->Update(m_contactListener); + c = c->GetNext(); + } +} + +void b2ContactManager::FindNewContacts() +{ + m_broadPhase.UpdatePairs(this); +} + +void b2ContactManager::AddPair(void* proxyUserDataA, void* proxyUserDataB) +{ + b2FixtureProxy* proxyA = (b2FixtureProxy*)proxyUserDataA; + b2FixtureProxy* proxyB = (b2FixtureProxy*)proxyUserDataB; + + b2Fixture* fixtureA = proxyA->fixture; + b2Fixture* fixtureB = proxyB->fixture; + + int32 indexA = proxyA->childIndex; + int32 indexB = proxyB->childIndex; + + b2Body* bodyA = fixtureA->GetBody(); + b2Body* bodyB = fixtureB->GetBody(); + + // Are the fixtures on the same body? + if (bodyA == bodyB) + { + return; + } + + // TODO_ERIN use a hash table to remove a potential bottleneck when both + // bodies have a lot of contacts. + // Does a contact already exist? + b2ContactEdge* edge = bodyB->GetContactList(); + while (edge) + { + if (edge->other == bodyA) + { + b2Fixture* fA = edge->contact->GetFixtureA(); + b2Fixture* fB = edge->contact->GetFixtureB(); + int32 iA = edge->contact->GetChildIndexA(); + int32 iB = edge->contact->GetChildIndexB(); + + if (fA == fixtureA && fB == fixtureB && iA == indexA && iB == indexB) + { + // A contact already exists. + return; + } + + if (fA == fixtureB && fB == fixtureA && iA == indexB && iB == indexA) + { + // A contact already exists. + return; + } + } + + edge = edge->next; + } + + // Does a joint override collision? Is at least one body dynamic? + if (bodyB->ShouldCollide(bodyA) == false) + { + return; + } + + // Check user filtering. + if (m_contactFilter && m_contactFilter->ShouldCollide(fixtureA, fixtureB) == false) + { + return; + } + + // Call the factory. + b2Contact* c = b2Contact::Create(fixtureA, indexA, fixtureB, indexB, m_allocator); + if (c == NULL) + { + return; + } + + // Contact creation may swap fixtures. + fixtureA = c->GetFixtureA(); + fixtureB = c->GetFixtureB(); + indexA = c->GetChildIndexA(); + indexB = c->GetChildIndexB(); + bodyA = fixtureA->GetBody(); + bodyB = fixtureB->GetBody(); + + // Insert into the world. + c->m_prev = NULL; + c->m_next = m_contactList; + if (m_contactList != NULL) + { + m_contactList->m_prev = c; + } + m_contactList = c; + + // Connect to island graph. + + // Connect to body A + c->m_nodeA.contact = c; + c->m_nodeA.other = bodyB; + + c->m_nodeA.prev = NULL; + c->m_nodeA.next = bodyA->m_contactList; + if (bodyA->m_contactList != NULL) + { + bodyA->m_contactList->prev = &c->m_nodeA; + } + bodyA->m_contactList = &c->m_nodeA; + + // Connect to body B + c->m_nodeB.contact = c; + c->m_nodeB.other = bodyA; + + c->m_nodeB.prev = NULL; + c->m_nodeB.next = bodyB->m_contactList; + if (bodyB->m_contactList != NULL) + { + bodyB->m_contactList->prev = &c->m_nodeB; + } + bodyB->m_contactList = &c->m_nodeB; + + // Wake up the bodies + bodyA->SetAwake(true); + bodyB->SetAwake(true); + + ++m_contactCount; +} diff --git a/external/box2d/Dynamics/b2ContactManager.h b/external/box2d/Dynamics/b2ContactManager.h new file mode 100644 index 0000000000..9cb5718145 --- /dev/null +++ b/external/box2d/Dynamics/b2ContactManager.h @@ -0,0 +1,52 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_CONTACT_MANAGER_H +#define B2_CONTACT_MANAGER_H + +#include + +class b2Contact; +class b2ContactFilter; +class b2ContactListener; +class b2BlockAllocator; + +// Delegate of b2World. +class b2ContactManager +{ +public: + b2ContactManager(); + + // Broad-phase callback. + void AddPair(void* proxyUserDataA, void* proxyUserDataB); + + void FindNewContacts(); + + void Destroy(b2Contact* c); + + void Collide(); + + b2BroadPhase m_broadPhase; + b2Contact* m_contactList; + int32 m_contactCount; + b2ContactFilter* m_contactFilter; + b2ContactListener* m_contactListener; + b2BlockAllocator* m_allocator; +}; + +#endif diff --git a/external/box2d/Dynamics/b2Fixture.cpp b/external/box2d/Dynamics/b2Fixture.cpp new file mode 100644 index 0000000000..774a78e5bb --- /dev/null +++ b/external/box2d/Dynamics/b2Fixture.cpp @@ -0,0 +1,303 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +b2Fixture::b2Fixture() +{ + m_userData = NULL; + m_body = NULL; + m_next = NULL; + m_proxies = NULL; + m_proxyCount = 0; + m_shape = NULL; + m_density = 0.0f; +} + +void b2Fixture::Create(b2BlockAllocator* allocator, b2Body* body, const b2FixtureDef* def) +{ + m_userData = def->userData; + m_friction = def->friction; + m_restitution = def->restitution; + + m_body = body; + m_next = NULL; + + m_filter = def->filter; + + m_isSensor = def->isSensor; + + m_shape = def->shape->Clone(allocator); + + // Reserve proxy space + int32 childCount = m_shape->GetChildCount(); + m_proxies = (b2FixtureProxy*)allocator->Allocate(childCount * sizeof(b2FixtureProxy)); + for (int32 i = 0; i < childCount; ++i) + { + m_proxies[i].fixture = NULL; + m_proxies[i].proxyId = b2BroadPhase::e_nullProxy; + } + m_proxyCount = 0; + + m_density = def->density; +} + +void b2Fixture::Destroy(b2BlockAllocator* allocator) +{ + // The proxies must be destroyed before calling this. + b2Assert(m_proxyCount == 0); + + // Free the proxy array. + int32 childCount = m_shape->GetChildCount(); + allocator->Free(m_proxies, childCount * sizeof(b2FixtureProxy)); + m_proxies = NULL; + + // Free the child shape. + switch (m_shape->m_type) + { + case b2Shape::e_circle: + { + b2CircleShape* s = (b2CircleShape*)m_shape; + s->~b2CircleShape(); + allocator->Free(s, sizeof(b2CircleShape)); + } + break; + + case b2Shape::e_edge: + { + b2EdgeShape* s = (b2EdgeShape*)m_shape; + s->~b2EdgeShape(); + allocator->Free(s, sizeof(b2EdgeShape)); + } + break; + + case b2Shape::e_polygon: + { + b2PolygonShape* s = (b2PolygonShape*)m_shape; + s->~b2PolygonShape(); + allocator->Free(s, sizeof(b2PolygonShape)); + } + break; + + case b2Shape::e_chain: + { + b2ChainShape* s = (b2ChainShape*)m_shape; + s->~b2ChainShape(); + allocator->Free(s, sizeof(b2ChainShape)); + } + break; + + default: + b2Assert(false); + break; + } + + m_shape = NULL; +} + +void b2Fixture::CreateProxies(b2BroadPhase* broadPhase, const b2Transform& xf) +{ + b2Assert(m_proxyCount == 0); + + // Create proxies in the broad-phase. + m_proxyCount = m_shape->GetChildCount(); + + for (int32 i = 0; i < m_proxyCount; ++i) + { + b2FixtureProxy* proxy = m_proxies + i; + m_shape->ComputeAABB(&proxy->aabb, xf, i); + proxy->proxyId = broadPhase->CreateProxy(proxy->aabb, proxy); + proxy->fixture = this; + proxy->childIndex = i; + } +} + +void b2Fixture::DestroyProxies(b2BroadPhase* broadPhase) +{ + // Destroy proxies in the broad-phase. + for (int32 i = 0; i < m_proxyCount; ++i) + { + b2FixtureProxy* proxy = m_proxies + i; + broadPhase->DestroyProxy(proxy->proxyId); + proxy->proxyId = b2BroadPhase::e_nullProxy; + } + + m_proxyCount = 0; +} + +void b2Fixture::Synchronize(b2BroadPhase* broadPhase, const b2Transform& transform1, const b2Transform& transform2) +{ + if (m_proxyCount == 0) + { + return; + } + + for (int32 i = 0; i < m_proxyCount; ++i) + { + b2FixtureProxy* proxy = m_proxies + i; + + // Compute an AABB that covers the swept shape (may miss some rotation effect). + b2AABB aabb1, aabb2; + m_shape->ComputeAABB(&aabb1, transform1, proxy->childIndex); + m_shape->ComputeAABB(&aabb2, transform2, proxy->childIndex); + + proxy->aabb.Combine(aabb1, aabb2); + + b2Vec2 displacement = transform2.p - transform1.p; + + broadPhase->MoveProxy(proxy->proxyId, proxy->aabb, displacement); + } +} + +void b2Fixture::SetFilterData(const b2Filter& filter) +{ + m_filter = filter; + + Refilter(); +} + +void b2Fixture::Refilter() +{ + if (m_body == NULL) + { + return; + } + + // Flag associated contacts for filtering. + b2ContactEdge* edge = m_body->GetContactList(); + while (edge) + { + b2Contact* contact = edge->contact; + b2Fixture* fixtureA = contact->GetFixtureA(); + b2Fixture* fixtureB = contact->GetFixtureB(); + if (fixtureA == this || fixtureB == this) + { + contact->FlagForFiltering(); + } + + edge = edge->next; + } + + b2World* world = m_body->GetWorld(); + + if (world == NULL) + { + return; + } + + // Touch each proxy so that new pairs may be created + b2BroadPhase* broadPhase = &world->m_contactManager.m_broadPhase; + for (int32 i = 0; i < m_proxyCount; ++i) + { + broadPhase->TouchProxy(m_proxies[i].proxyId); + } +} + +void b2Fixture::SetSensor(bool sensor) +{ + if (sensor != m_isSensor) + { + m_body->SetAwake(true); + m_isSensor = sensor; + } +} + +void b2Fixture::Dump(int32 bodyIndex) +{ + b2Log(" b2FixtureDef fd;\n"); + b2Log(" fd.friction = %.15lef;\n", m_friction); + b2Log(" fd.restitution = %.15lef;\n", m_restitution); + b2Log(" fd.density = %.15lef;\n", m_density); + b2Log(" fd.isSensor = bool(%d);\n", m_isSensor); + b2Log(" fd.filter.categoryBits = uint16(%d);\n", m_filter.categoryBits); + b2Log(" fd.filter.maskBits = uint16(%d);\n", m_filter.maskBits); + b2Log(" fd.filter.groupIndex = int16(%d);\n", m_filter.groupIndex); + + switch (m_shape->m_type) + { + case b2Shape::e_circle: + { + b2CircleShape* s = (b2CircleShape*)m_shape; + b2Log(" b2CircleShape shape;\n"); + b2Log(" shape.m_radius = %.15lef;\n", s->m_radius); + b2Log(" shape.m_p.Set(%.15lef, %.15lef);\n", s->m_p.x, s->m_p.y); + } + break; + + case b2Shape::e_edge: + { + b2EdgeShape* s = (b2EdgeShape*)m_shape; + b2Log(" b2EdgeShape shape;\n"); + b2Log(" shape.m_radius = %.15lef;\n", s->m_radius); + b2Log(" shape.m_vertex0.Set(%.15lef, %.15lef);\n", s->m_vertex0.x, s->m_vertex0.y); + b2Log(" shape.m_vertex1.Set(%.15lef, %.15lef);\n", s->m_vertex1.x, s->m_vertex1.y); + b2Log(" shape.m_vertex2.Set(%.15lef, %.15lef);\n", s->m_vertex2.x, s->m_vertex2.y); + b2Log(" shape.m_vertex3.Set(%.15lef, %.15lef);\n", s->m_vertex3.x, s->m_vertex3.y); + b2Log(" shape.m_hasVertex0 = bool(%d);\n", s->m_hasVertex0); + b2Log(" shape.m_hasVertex3 = bool(%d);\n", s->m_hasVertex3); + } + break; + + case b2Shape::e_polygon: + { + b2PolygonShape* s = (b2PolygonShape*)m_shape; + b2Log(" b2PolygonShape shape;\n"); + b2Log(" b2Vec2 vs[%d];\n", b2_maxPolygonVertices); + for (int32 i = 0; i < s->m_vertexCount; ++i) + { + b2Log(" vs[%d].Set(%.15lef, %.15lef);\n", i, s->m_vertices[i].x, s->m_vertices[i].y); + } + b2Log(" shape.Set(vs, %d);\n", s->m_vertexCount); + } + break; + + case b2Shape::e_chain: + { + b2ChainShape* s = (b2ChainShape*)m_shape; + b2Log(" b2ChainShape shape;\n"); + b2Log(" b2Vec2 vs[%d];\n", s->m_count); + for (int32 i = 0; i < s->m_count; ++i) + { + b2Log(" vs[%d].Set(%.15lef, %.15lef);\n", i, s->m_vertices[i].x, s->m_vertices[i].y); + } + b2Log(" shape.CreateChain(vs, %d);\n", s->m_count); + b2Log(" shape.m_prevVertex.Set(%.15lef, %.15lef);\n", s->m_prevVertex.x, s->m_prevVertex.y); + b2Log(" shape.m_nextVertex.Set(%.15lef, %.15lef);\n", s->m_nextVertex.x, s->m_nextVertex.y); + b2Log(" shape.m_hasPrevVertex = bool(%d);\n", s->m_hasPrevVertex); + b2Log(" shape.m_hasNextVertex = bool(%d);\n", s->m_hasNextVertex); + } + break; + + default: + return; + } + + b2Log("\n"); + b2Log(" fd.shape = &shape;\n"); + b2Log("\n"); + b2Log(" bodies[%d]->CreateFixture(&fd);\n", bodyIndex); +} diff --git a/external/box2d/Dynamics/b2Fixture.h b/external/box2d/Dynamics/b2Fixture.h new file mode 100644 index 0000000000..d390410b93 --- /dev/null +++ b/external/box2d/Dynamics/b2Fixture.h @@ -0,0 +1,345 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_FIXTURE_H +#define B2_FIXTURE_H + +#include +#include +#include + +class b2BlockAllocator; +class b2Body; +class b2BroadPhase; +class b2Fixture; + +/// This holds contact filtering data. +struct b2Filter +{ + b2Filter() + { + categoryBits = 0x0001; + maskBits = 0xFFFF; + groupIndex = 0; + } + + /// The collision category bits. Normally you would just set one bit. + uint16 categoryBits; + + /// The collision mask bits. This states the categories that this + /// shape would accept for collision. + uint16 maskBits; + + /// Collision groups allow a certain group of objects to never collide (negative) + /// or always collide (positive). Zero means no collision group. Non-zero group + /// filtering always wins against the mask bits. + int16 groupIndex; +}; + +/// A fixture definition is used to create a fixture. This class defines an +/// abstract fixture definition. You can reuse fixture definitions safely. +struct b2FixtureDef +{ + /// The constructor sets the default fixture definition values. + b2FixtureDef() + { + shape = NULL; + userData = NULL; + friction = 0.2f; + restitution = 0.0f; + density = 0.0f; + isSensor = false; + } + + /// The shape, this must be set. The shape will be cloned, so you + /// can create the shape on the stack. + const b2Shape* shape; + + /// Use this to store application specific fixture data. + void* userData; + + /// The friction coefficient, usually in the range [0,1]. + float32 friction; + + /// The restitution (elasticity) usually in the range [0,1]. + float32 restitution; + + /// The density, usually in kg/m^2. + float32 density; + + /// A sensor shape collects contact information but never generates a collision + /// response. + bool isSensor; + + /// Contact filtering data. + b2Filter filter; +}; + +/// This proxy is used internally to connect fixtures to the broad-phase. +struct b2FixtureProxy +{ + b2AABB aabb; + b2Fixture* fixture; + int32 childIndex; + int32 proxyId; +}; + +/// A fixture is used to attach a shape to a body for collision detection. A fixture +/// inherits its transform from its parent. Fixtures hold additional non-geometric data +/// such as friction, collision filters, etc. +/// Fixtures are created via b2Body::CreateFixture. +/// @warning you cannot reuse fixtures. +class b2Fixture +{ +public: + /// Get the type of the child shape. You can use this to down cast to the concrete shape. + /// @return the shape type. + b2Shape::Type GetType() const; + + /// Get the child shape. You can modify the child shape, however you should not change the + /// number of vertices because this will crash some collision caching mechanisms. + /// Manipulating the shape may lead to non-physical behavior. + b2Shape* GetShape(); + const b2Shape* GetShape() const; + + /// Set if this fixture is a sensor. + void SetSensor(bool sensor); + + /// Is this fixture a sensor (non-solid)? + /// @return the true if the shape is a sensor. + bool IsSensor() const; + + /// Set the contact filtering data. This will not update contacts until the next time + /// step when either parent body is active and awake. + /// This automatically calls Refilter. + void SetFilterData(const b2Filter& filter); + + /// Get the contact filtering data. + const b2Filter& GetFilterData() const; + + /// Call this if you want to establish collision that was previously disabled by b2ContactFilter::ShouldCollide. + void Refilter(); + + /// Get the parent body of this fixture. This is NULL if the fixture is not attached. + /// @return the parent body. + b2Body* GetBody(); + const b2Body* GetBody() const; + + /// Get the next fixture in the parent body's fixture list. + /// @return the next shape. + b2Fixture* GetNext(); + const b2Fixture* GetNext() const; + + /// Get the user data that was assigned in the fixture definition. Use this to + /// store your application specific data. + void* GetUserData() const; + + /// Set the user data. Use this to store your application specific data. + void SetUserData(void* data); + + /// Test a point for containment in this fixture. + /// @param p a point in world coordinates. + bool TestPoint(const b2Vec2& p) const; + + /// Cast a ray against this shape. + /// @param output the ray-cast results. + /// @param input the ray-cast input parameters. + bool RayCast(b2RayCastOutput* output, const b2RayCastInput& input, int32 childIndex) const; + + /// Get the mass data for this fixture. The mass data is based on the density and + /// the shape. The rotational inertia is about the shape's origin. This operation + /// may be expensive. + void GetMassData(b2MassData* massData) const; + + /// Set the density of this fixture. This will _not_ automatically adjust the mass + /// of the body. You must call b2Body::ResetMassData to update the body's mass. + void SetDensity(float32 density); + + /// Get the density of this fixture. + float32 GetDensity() const; + + /// Get the coefficient of friction. + float32 GetFriction() const; + + /// Set the coefficient of friction. This will _not_ change the friction of + /// existing contacts. + void SetFriction(float32 friction); + + /// Get the coefficient of restitution. + float32 GetRestitution() const; + + /// Set the coefficient of restitution. This will _not_ change the restitution of + /// existing contacts. + void SetRestitution(float32 restitution); + + /// Get the fixture's AABB. This AABB may be enlarge and/or stale. + /// If you need a more accurate AABB, compute it using the shape and + /// the body transform. + const b2AABB& GetAABB(int32 childIndex) const; + + /// Dump this fixture to the log file. + void Dump(int32 bodyIndex); + +protected: + + friend class b2Body; + friend class b2World; + friend class b2Contact; + friend class b2ContactManager; + + b2Fixture(); + + // We need separation create/destroy functions from the constructor/destructor because + // the destructor cannot access the allocator (no destructor arguments allowed by C++). + void Create(b2BlockAllocator* allocator, b2Body* body, const b2FixtureDef* def); + void Destroy(b2BlockAllocator* allocator); + + // These support body activation/deactivation. + void CreateProxies(b2BroadPhase* broadPhase, const b2Transform& xf); + void DestroyProxies(b2BroadPhase* broadPhase); + + void Synchronize(b2BroadPhase* broadPhase, const b2Transform& xf1, const b2Transform& xf2); + + float32 m_density; + + b2Fixture* m_next; + b2Body* m_body; + + b2Shape* m_shape; + + float32 m_friction; + float32 m_restitution; + + b2FixtureProxy* m_proxies; + int32 m_proxyCount; + + b2Filter m_filter; + + bool m_isSensor; + + void* m_userData; +}; + +inline b2Shape::Type b2Fixture::GetType() const +{ + return m_shape->GetType(); +} + +inline b2Shape* b2Fixture::GetShape() +{ + return m_shape; +} + +inline const b2Shape* b2Fixture::GetShape() const +{ + return m_shape; +} + +inline bool b2Fixture::IsSensor() const +{ + return m_isSensor; +} + +inline const b2Filter& b2Fixture::GetFilterData() const +{ + return m_filter; +} + +inline void* b2Fixture::GetUserData() const +{ + return m_userData; +} + +inline void b2Fixture::SetUserData(void* data) +{ + m_userData = data; +} + +inline b2Body* b2Fixture::GetBody() +{ + return m_body; +} + +inline const b2Body* b2Fixture::GetBody() const +{ + return m_body; +} + +inline b2Fixture* b2Fixture::GetNext() +{ + return m_next; +} + +inline const b2Fixture* b2Fixture::GetNext() const +{ + return m_next; +} + +inline void b2Fixture::SetDensity(float32 density) +{ + b2Assert(b2IsValid(density) && density >= 0.0f); + m_density = density; +} + +inline float32 b2Fixture::GetDensity() const +{ + return m_density; +} + +inline float32 b2Fixture::GetFriction() const +{ + return m_friction; +} + +inline void b2Fixture::SetFriction(float32 friction) +{ + m_friction = friction; +} + +inline float32 b2Fixture::GetRestitution() const +{ + return m_restitution; +} + +inline void b2Fixture::SetRestitution(float32 restitution) +{ + m_restitution = restitution; +} + +inline bool b2Fixture::TestPoint(const b2Vec2& p) const +{ + return m_shape->TestPoint(m_body->GetTransform(), p); +} + +inline bool b2Fixture::RayCast(b2RayCastOutput* output, const b2RayCastInput& input, int32 childIndex) const +{ + return m_shape->RayCast(output, input, m_body->GetTransform(), childIndex); +} + +inline void b2Fixture::GetMassData(b2MassData* massData) const +{ + m_shape->ComputeMass(massData, m_density); +} + +inline const b2AABB& b2Fixture::GetAABB(int32 childIndex) const +{ + b2Assert(0 <= childIndex && childIndex < m_proxyCount); + return m_proxies[childIndex].aabb; +} + +#endif diff --git a/external/box2d/Dynamics/b2Island.cpp b/external/box2d/Dynamics/b2Island.cpp new file mode 100644 index 0000000000..e767d383d5 --- /dev/null +++ b/external/box2d/Dynamics/b2Island.cpp @@ -0,0 +1,539 @@ +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* +Position Correction Notes +========================= +I tried the several algorithms for position correction of the 2D revolute joint. +I looked at these systems: +- simple pendulum (1m diameter sphere on massless 5m stick) with initial angular velocity of 100 rad/s. +- suspension bridge with 30 1m long planks of length 1m. +- multi-link chain with 30 1m long links. + +Here are the algorithms: + +Baumgarte - A fraction of the position error is added to the velocity error. There is no +separate position solver. + +Pseudo Velocities - After the velocity solver and position integration, +the position error, Jacobian, and effective mass are recomputed. Then +the velocity constraints are solved with pseudo velocities and a fraction +of the position error is added to the pseudo velocity error. The pseudo +velocities are initialized to zero and there is no warm-starting. After +the position solver, the pseudo velocities are added to the positions. +This is also called the First Order World method or the Position LCP method. + +Modified Nonlinear Gauss-Seidel (NGS) - Like Pseudo Velocities except the +position error is re-computed for each constraint and the positions are updated +after the constraint is solved. The radius vectors (aka Jacobians) are +re-computed too (otherwise the algorithm has horrible instability). The pseudo +velocity states are not needed because they are effectively zero at the beginning +of each iteration. Since we have the current position error, we allow the +iterations to terminate early if the error becomes smaller than b2_linearSlop. + +Full NGS or just NGS - Like Modified NGS except the effective mass are re-computed +each time a constraint is solved. + +Here are the results: +Baumgarte - this is the cheapest algorithm but it has some stability problems, +especially with the bridge. The chain links separate easily close to the root +and they jitter as they struggle to pull together. This is one of the most common +methods in the field. The big drawback is that the position correction artificially +affects the momentum, thus leading to instabilities and false bounce. I used a +bias factor of 0.2. A larger bias factor makes the bridge less stable, a smaller +factor makes joints and contacts more spongy. + +Pseudo Velocities - the is more stable than the Baumgarte method. The bridge is +stable. However, joints still separate with large angular velocities. Drag the +simple pendulum in a circle quickly and the joint will separate. The chain separates +easily and does not recover. I used a bias factor of 0.2. A larger value lead to +the bridge collapsing when a heavy cube drops on it. + +Modified NGS - this algorithm is better in some ways than Baumgarte and Pseudo +Velocities, but in other ways it is worse. The bridge and chain are much more +stable, but the simple pendulum goes unstable at high angular velocities. + +Full NGS - stable in all tests. The joints display good stiffness. The bridge +still sags, but this is better than infinite forces. + +Recommendations +Pseudo Velocities are not really worthwhile because the bridge and chain cannot +recover from joint separation. In other cases the benefit over Baumgarte is small. + +Modified NGS is not a robust method for the revolute joint due to the violent +instability seen in the simple pendulum. Perhaps it is viable with other constraint +types, especially scalar constraints where the effective mass is a scalar. + +This leaves Baumgarte and Full NGS. Baumgarte has small, but manageable instabilities +and is very fast. I don't think we can escape Baumgarte, especially in highly +demanding cases where high constraint fidelity is not needed. + +Full NGS is robust and easy on the eyes. I recommend this as an option for +higher fidelity simulation and certainly for suspension bridges and long chains. +Full NGS might be a good choice for ragdolls, especially motorized ragdolls where +joint separation can be problematic. The number of NGS iterations can be reduced +for better performance without harming robustness much. + +Each joint in a can be handled differently in the position solver. So I recommend +a system where the user can select the algorithm on a per joint basis. I would +probably default to the slower Full NGS and let the user select the faster +Baumgarte method in performance critical scenarios. +*/ + +/* +Cache Performance + +The Box2D solvers are dominated by cache misses. Data structures are designed +to increase the number of cache hits. Much of misses are due to random access +to body data. The constraint structures are iterated over linearly, which leads +to few cache misses. + +The bodies are not accessed during iteration. Instead read only data, such as +the mass values are stored with the constraints. The mutable data are the constraint +impulses and the bodies velocities/positions. The impulses are held inside the +constraint structures. The body velocities/positions are held in compact, temporary +arrays to increase the number of cache hits. Linear and angular velocity are +stored in a single array since multiple arrays lead to multiple misses. +*/ + +/* +2D Rotation + +R = [cos(theta) -sin(theta)] + [sin(theta) cos(theta) ] + +thetaDot = omega + +Let q1 = cos(theta), q2 = sin(theta). +R = [q1 -q2] + [q2 q1] + +q1Dot = -thetaDot * q2 +q2Dot = thetaDot * q1 + +q1_new = q1_old - dt * w * q2 +q2_new = q2_old + dt * w * q1 +then normalize. + +This might be faster than computing sin+cos. +However, we can compute sin+cos of the same angle fast. +*/ + +b2Island::b2Island( + int32 bodyCapacity, + int32 contactCapacity, + int32 jointCapacity, + b2StackAllocator* allocator, + b2ContactListener* listener) +{ + m_bodyCapacity = bodyCapacity; + m_contactCapacity = contactCapacity; + m_jointCapacity = jointCapacity; + m_bodyCount = 0; + m_contactCount = 0; + m_jointCount = 0; + + m_allocator = allocator; + m_listener = listener; + + m_bodies = (b2Body**)m_allocator->Allocate(bodyCapacity * sizeof(b2Body*)); + m_contacts = (b2Contact**)m_allocator->Allocate(contactCapacity * sizeof(b2Contact*)); + m_joints = (b2Joint**)m_allocator->Allocate(jointCapacity * sizeof(b2Joint*)); + + m_velocities = (b2Velocity*)m_allocator->Allocate(m_bodyCapacity * sizeof(b2Velocity)); + m_positions = (b2Position*)m_allocator->Allocate(m_bodyCapacity * sizeof(b2Position)); +} + +b2Island::~b2Island() +{ + // Warning: the order should reverse the constructor order. + m_allocator->Free(m_positions); + m_allocator->Free(m_velocities); + m_allocator->Free(m_joints); + m_allocator->Free(m_contacts); + m_allocator->Free(m_bodies); +} + +void b2Island::Solve(b2Profile* profile, const b2TimeStep& step, const b2Vec2& gravity, bool allowSleep) +{ + b2Timer timer; + + float32 h = step.dt; + + // Integrate velocities and apply damping. Initialize the body state. + for (int32 i = 0; i < m_bodyCount; ++i) + { + b2Body* b = m_bodies[i]; + + b2Vec2 c = b->m_sweep.c; + float32 a = b->m_sweep.a; + b2Vec2 v = b->m_linearVelocity; + float32 w = b->m_angularVelocity; + + // Store positions for continuous collision. + b->m_sweep.c0 = b->m_sweep.c; + b->m_sweep.a0 = b->m_sweep.a; + + if (b->m_type == b2_dynamicBody) + { + // Integrate velocities. + v += h * (b->m_gravityScale * gravity + b->m_invMass * b->m_force); + w += h * b->m_invI * b->m_torque; + + // Apply damping. + // ODE: dv/dt + c * v = 0 + // Solution: v(t) = v0 * exp(-c * t) + // Time step: v(t + dt) = v0 * exp(-c * (t + dt)) = v0 * exp(-c * t) * exp(-c * dt) = v * exp(-c * dt) + // v2 = exp(-c * dt) * v1 + // Taylor expansion: + // v2 = (1.0f - c * dt) * v1 + v *= b2Clamp(1.0f - h * b->m_linearDamping, 0.0f, 1.0f); + w *= b2Clamp(1.0f - h * b->m_angularDamping, 0.0f, 1.0f); + } + + m_positions[i].c = c; + m_positions[i].a = a; + m_velocities[i].v = v; + m_velocities[i].w = w; + } + + timer.Reset(); + + // Solver data + b2SolverData solverData; + solverData.step = step; + solverData.positions = m_positions; + solverData.velocities = m_velocities; + + // Initialize velocity constraints. + b2ContactSolverDef contactSolverDef; + contactSolverDef.step = step; + contactSolverDef.contacts = m_contacts; + contactSolverDef.count = m_contactCount; + contactSolverDef.positions = m_positions; + contactSolverDef.velocities = m_velocities; + contactSolverDef.allocator = m_allocator; + + b2ContactSolver contactSolver(&contactSolverDef); + contactSolver.InitializeVelocityConstraints(); + + if (step.warmStarting) + { + contactSolver.WarmStart(); + } + + for (int32 i = 0; i < m_jointCount; ++i) + { + m_joints[i]->InitVelocityConstraints(solverData); + } + + profile->solveInit = timer.GetMilliseconds(); + + // Solve velocity constraints + timer.Reset(); + for (int32 i = 0; i < step.velocityIterations; ++i) + { + for (int32 j = 0; j < m_jointCount; ++j) + { + m_joints[j]->SolveVelocityConstraints(solverData); + } + + contactSolver.SolveVelocityConstraints(); + } + + // Store impulses for warm starting + contactSolver.StoreImpulses(); + profile->solveVelocity = timer.GetMilliseconds(); + + // Integrate positions + for (int32 i = 0; i < m_bodyCount; ++i) + { + b2Vec2 c = m_positions[i].c; + float32 a = m_positions[i].a; + b2Vec2 v = m_velocities[i].v; + float32 w = m_velocities[i].w; + + // Check for large velocities + b2Vec2 translation = h * v; + if (b2Dot(translation, translation) > b2_maxTranslationSquared) + { + float32 ratio = b2_maxTranslation / translation.Length(); + v *= ratio; + } + + float32 rotation = h * w; + if (rotation * rotation > b2_maxRotationSquared) + { + float32 ratio = b2_maxRotation / b2Abs(rotation); + w *= ratio; + } + + // Integrate + c += h * v; + a += h * w; + + m_positions[i].c = c; + m_positions[i].a = a; + m_velocities[i].v = v; + m_velocities[i].w = w; + } + + // Solve position constraints + timer.Reset(); + bool positionSolved = false; + for (int32 i = 0; i < step.positionIterations; ++i) + { + bool contactsOkay = contactSolver.SolvePositionConstraints(); + + bool jointsOkay = true; + for (int32 i = 0; i < m_jointCount; ++i) + { + bool jointOkay = m_joints[i]->SolvePositionConstraints(solverData); + jointsOkay = jointsOkay && jointOkay; + } + + if (contactsOkay && jointsOkay) + { + // Exit early if the position errors are small. + positionSolved = true; + break; + } + } + + // Copy state buffers back to the bodies + for (int32 i = 0; i < m_bodyCount; ++i) + { + b2Body* body = m_bodies[i]; + body->m_sweep.c = m_positions[i].c; + body->m_sweep.a = m_positions[i].a; + body->m_linearVelocity = m_velocities[i].v; + body->m_angularVelocity = m_velocities[i].w; + body->SynchronizeTransform(); + } + + profile->solvePosition = timer.GetMilliseconds(); + + Report(contactSolver.m_velocityConstraints); + + if (allowSleep) + { + float32 minSleepTime = b2_maxFloat; + + const float32 linTolSqr = b2_linearSleepTolerance * b2_linearSleepTolerance; + const float32 angTolSqr = b2_angularSleepTolerance * b2_angularSleepTolerance; + + for (int32 i = 0; i < m_bodyCount; ++i) + { + b2Body* b = m_bodies[i]; + if (b->GetType() == b2_staticBody) + { + continue; + } + + if ((b->m_flags & b2Body::e_autoSleepFlag) == 0 || + b->m_angularVelocity * b->m_angularVelocity > angTolSqr || + b2Dot(b->m_linearVelocity, b->m_linearVelocity) > linTolSqr) + { + b->m_sleepTime = 0.0f; + minSleepTime = 0.0f; + } + else + { + b->m_sleepTime += h; + minSleepTime = b2Min(minSleepTime, b->m_sleepTime); + } + } + + if (minSleepTime >= b2_timeToSleep && positionSolved) + { + for (int32 i = 0; i < m_bodyCount; ++i) + { + b2Body* b = m_bodies[i]; + b->SetAwake(false); + } + } + } +} + +void b2Island::SolveTOI(const b2TimeStep& subStep, int32 toiIndexA, int32 toiIndexB) +{ + b2Assert(toiIndexA < m_bodyCount); + b2Assert(toiIndexB < m_bodyCount); + + // Initialize the body state. + for (int32 i = 0; i < m_bodyCount; ++i) + { + b2Body* b = m_bodies[i]; + m_positions[i].c = b->m_sweep.c; + m_positions[i].a = b->m_sweep.a; + m_velocities[i].v = b->m_linearVelocity; + m_velocities[i].w = b->m_angularVelocity; + } + + b2ContactSolverDef contactSolverDef; + contactSolverDef.contacts = m_contacts; + contactSolverDef.count = m_contactCount; + contactSolverDef.allocator = m_allocator; + contactSolverDef.step = subStep; + contactSolverDef.positions = m_positions; + contactSolverDef.velocities = m_velocities; + b2ContactSolver contactSolver(&contactSolverDef); + + // Solve position constraints. + for (int32 i = 0; i < subStep.positionIterations; ++i) + { + bool contactsOkay = contactSolver.SolveTOIPositionConstraints(toiIndexA, toiIndexB); + if (contactsOkay) + { + break; + } + } + +#if 0 + // Is the new position really safe? + for (int32 i = 0; i < m_contactCount; ++i) + { + b2Contact* c = m_contacts[i]; + b2Fixture* fA = c->GetFixtureA(); + b2Fixture* fB = c->GetFixtureB(); + + b2Body* bA = fA->GetBody(); + b2Body* bB = fB->GetBody(); + + int32 indexA = c->GetChildIndexA(); + int32 indexB = c->GetChildIndexB(); + + b2DistanceInput input; + input.proxyA.Set(fA->GetShape(), indexA); + input.proxyB.Set(fB->GetShape(), indexB); + input.transformA = bA->GetTransform(); + input.transformB = bB->GetTransform(); + input.useRadii = false; + + b2DistanceOutput output; + b2SimplexCache cache; + cache.count = 0; + b2Distance(&output, &cache, &input); + + if (output.distance == 0 || cache.count == 3) + { + cache.count += 0; + } + } +#endif + + // Leap of faith to new safe state. + m_bodies[toiIndexA]->m_sweep.c0 = m_positions[toiIndexA].c; + m_bodies[toiIndexA]->m_sweep.a0 = m_positions[toiIndexA].a; + m_bodies[toiIndexB]->m_sweep.c0 = m_positions[toiIndexB].c; + m_bodies[toiIndexB]->m_sweep.a0 = m_positions[toiIndexB].a; + + // No warm starting is needed for TOI events because warm + // starting impulses were applied in the discrete solver. + contactSolver.InitializeVelocityConstraints(); + + // Solve velocity constraints. + for (int32 i = 0; i < subStep.velocityIterations; ++i) + { + contactSolver.SolveVelocityConstraints(); + } + + // Don't store the TOI contact forces for warm starting + // because they can be quite large. + + float32 h = subStep.dt; + + // Integrate positions + for (int32 i = 0; i < m_bodyCount; ++i) + { + b2Vec2 c = m_positions[i].c; + float32 a = m_positions[i].a; + b2Vec2 v = m_velocities[i].v; + float32 w = m_velocities[i].w; + + // Check for large velocities + b2Vec2 translation = h * v; + if (b2Dot(translation, translation) > b2_maxTranslationSquared) + { + float32 ratio = b2_maxTranslation / translation.Length(); + v *= ratio; + } + + float32 rotation = h * w; + if (rotation * rotation > b2_maxRotationSquared) + { + float32 ratio = b2_maxRotation / b2Abs(rotation); + w *= ratio; + } + + // Integrate + c += h * v; + a += h * w; + + m_positions[i].c = c; + m_positions[i].a = a; + m_velocities[i].v = v; + m_velocities[i].w = w; + + // Sync bodies + b2Body* body = m_bodies[i]; + body->m_sweep.c = c; + body->m_sweep.a = a; + body->m_linearVelocity = v; + body->m_angularVelocity = w; + body->SynchronizeTransform(); + } + + Report(contactSolver.m_velocityConstraints); +} + +void b2Island::Report(const b2ContactVelocityConstraint* constraints) +{ + if (m_listener == NULL) + { + return; + } + + for (int32 i = 0; i < m_contactCount; ++i) + { + b2Contact* c = m_contacts[i]; + + const b2ContactVelocityConstraint* vc = constraints + i; + + b2ContactImpulse impulse; + impulse.count = vc->pointCount; + for (int32 j = 0; j < vc->pointCount; ++j) + { + impulse.normalImpulses[j] = vc->points[j].normalImpulse; + impulse.tangentImpulses[j] = vc->points[j].tangentImpulse; + } + + m_listener->PostSolve(c, &impulse); + } +} diff --git a/external/box2d/Dynamics/b2Island.h b/external/box2d/Dynamics/b2Island.h new file mode 100644 index 0000000000..e0a6e41fc3 --- /dev/null +++ b/external/box2d/Dynamics/b2Island.h @@ -0,0 +1,93 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_ISLAND_H +#define B2_ISLAND_H + +#include +#include +#include + +class b2Contact; +class b2Joint; +class b2StackAllocator; +class b2ContactListener; +struct b2ContactVelocityConstraint; +struct b2Profile; + +/// This is an internal class. +class b2Island +{ +public: + b2Island(int32 bodyCapacity, int32 contactCapacity, int32 jointCapacity, + b2StackAllocator* allocator, b2ContactListener* listener); + ~b2Island(); + + void Clear() + { + m_bodyCount = 0; + m_contactCount = 0; + m_jointCount = 0; + } + + void Solve(b2Profile* profile, const b2TimeStep& step, const b2Vec2& gravity, bool allowSleep); + + void SolveTOI(const b2TimeStep& subStep, int32 toiIndexA, int32 toiIndexB); + + void Add(b2Body* body) + { + b2Assert(m_bodyCount < m_bodyCapacity); + body->m_islandIndex = m_bodyCount; + m_bodies[m_bodyCount] = body; + ++m_bodyCount; + } + + void Add(b2Contact* contact) + { + b2Assert(m_contactCount < m_contactCapacity); + m_contacts[m_contactCount++] = contact; + } + + void Add(b2Joint* joint) + { + b2Assert(m_jointCount < m_jointCapacity); + m_joints[m_jointCount++] = joint; + } + + void Report(const b2ContactVelocityConstraint* constraints); + + b2StackAllocator* m_allocator; + b2ContactListener* m_listener; + + b2Body** m_bodies; + b2Contact** m_contacts; + b2Joint** m_joints; + + b2Position* m_positions; + b2Velocity* m_velocities; + + int32 m_bodyCount; + int32 m_jointCount; + int32 m_contactCount; + + int32 m_bodyCapacity; + int32 m_contactCapacity; + int32 m_jointCapacity; +}; + +#endif diff --git a/external/box2d/Dynamics/b2TimeStep.h b/external/box2d/Dynamics/b2TimeStep.h new file mode 100644 index 0000000000..30d723fcc3 --- /dev/null +++ b/external/box2d/Dynamics/b2TimeStep.h @@ -0,0 +1,70 @@ +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_TIME_STEP_H +#define B2_TIME_STEP_H + +#include + +/// Profiling data. Times are in milliseconds. +struct b2Profile +{ + float32 step; + float32 collide; + float32 solve; + float32 solveInit; + float32 solveVelocity; + float32 solvePosition; + float32 broadphase; + float32 solveTOI; +}; + +/// This is an internal structure. +struct b2TimeStep +{ + float32 dt; // time step + float32 inv_dt; // inverse time step (0 if dt == 0). + float32 dtRatio; // dt * inv_dt0 + int32 velocityIterations; + int32 positionIterations; + bool warmStarting; +}; + +/// This is an internal structure. +struct b2Position +{ + b2Vec2 c; + float32 a; +}; + +/// This is an internal structure. +struct b2Velocity +{ + b2Vec2 v; + float32 w; +}; + +/// Solver Data +struct b2SolverData +{ + b2TimeStep step; + b2Position* positions; + b2Velocity* velocities; +}; + +#endif diff --git a/external/box2d/Dynamics/b2World.cpp b/external/box2d/Dynamics/b2World.cpp new file mode 100644 index 0000000000..8a0aff5114 --- /dev/null +++ b/external/box2d/Dynamics/b2World.cpp @@ -0,0 +1,1316 @@ +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +b2World::b2World(const b2Vec2& gravity) +{ + m_destructionListener = NULL; + m_debugDraw = NULL; + + m_bodyList = NULL; + m_jointList = NULL; + + m_bodyCount = 0; + m_jointCount = 0; + + m_warmStarting = true; + m_continuousPhysics = true; + m_subStepping = false; + + m_stepComplete = true; + + m_allowSleep = true; + m_gravity = gravity; + + m_flags = e_clearForces; + + m_inv_dt0 = 0.0f; + + m_contactManager.m_allocator = &m_blockAllocator; + + memset(&m_profile, 0, sizeof(b2Profile)); +} + +b2World::~b2World() +{ + // Some shapes allocate using b2Alloc. + b2Body* b = m_bodyList; + while (b) + { + b2Body* bNext = b->m_next; + + b2Fixture* f = b->m_fixtureList; + while (f) + { + b2Fixture* fNext = f->m_next; + f->m_proxyCount = 0; + f->Destroy(&m_blockAllocator); + f = fNext; + } + + b = bNext; + } +} + +void b2World::SetDestructionListener(b2DestructionListener* listener) +{ + m_destructionListener = listener; +} + +void b2World::SetContactFilter(b2ContactFilter* filter) +{ + m_contactManager.m_contactFilter = filter; +} + +void b2World::SetContactListener(b2ContactListener* listener) +{ + m_contactManager.m_contactListener = listener; +} + +void b2World::SetDebugDraw(b2Draw* debugDraw) +{ + m_debugDraw = debugDraw; +} + +b2Body* b2World::CreateBody(const b2BodyDef* def) +{ + b2Assert(IsLocked() == false); + if (IsLocked()) + { + return NULL; + } + + void* mem = m_blockAllocator.Allocate(sizeof(b2Body)); + b2Body* b = new (mem) b2Body(def, this); + + // Add to world doubly linked list. + b->m_prev = NULL; + b->m_next = m_bodyList; + if (m_bodyList) + { + m_bodyList->m_prev = b; + } + m_bodyList = b; + ++m_bodyCount; + + return b; +} + +void b2World::DestroyBody(b2Body* b) +{ + b2Assert(m_bodyCount > 0); + b2Assert(IsLocked() == false); + if (IsLocked()) + { + return; + } + + // Delete the attached joints. + b2JointEdge* je = b->m_jointList; + while (je) + { + b2JointEdge* je0 = je; + je = je->next; + + if (m_destructionListener) + { + m_destructionListener->SayGoodbye(je0->joint); + } + + DestroyJoint(je0->joint); + + b->m_jointList = je; + } + b->m_jointList = NULL; + + // Delete the attached contacts. + b2ContactEdge* ce = b->m_contactList; + while (ce) + { + b2ContactEdge* ce0 = ce; + ce = ce->next; + m_contactManager.Destroy(ce0->contact); + } + b->m_contactList = NULL; + + // Delete the attached fixtures. This destroys broad-phase proxies. + b2Fixture* f = b->m_fixtureList; + while (f) + { + b2Fixture* f0 = f; + f = f->m_next; + + if (m_destructionListener) + { + m_destructionListener->SayGoodbye(f0); + } + + f0->DestroyProxies(&m_contactManager.m_broadPhase); + f0->Destroy(&m_blockAllocator); + f0->~b2Fixture(); + m_blockAllocator.Free(f0, sizeof(b2Fixture)); + + b->m_fixtureList = f; + b->m_fixtureCount -= 1; + } + b->m_fixtureList = NULL; + b->m_fixtureCount = 0; + + // Remove world body list. + if (b->m_prev) + { + b->m_prev->m_next = b->m_next; + } + + if (b->m_next) + { + b->m_next->m_prev = b->m_prev; + } + + if (b == m_bodyList) + { + m_bodyList = b->m_next; + } + + --m_bodyCount; + b->~b2Body(); + m_blockAllocator.Free(b, sizeof(b2Body)); +} + +b2Joint* b2World::CreateJoint(const b2JointDef* def) +{ + b2Assert(IsLocked() == false); + if (IsLocked()) + { + return NULL; + } + + b2Joint* j = b2Joint::Create(def, &m_blockAllocator); + + // Connect to the world list. + j->m_prev = NULL; + j->m_next = m_jointList; + if (m_jointList) + { + m_jointList->m_prev = j; + } + m_jointList = j; + ++m_jointCount; + + // Connect to the bodies' doubly linked lists. + j->m_edgeA.joint = j; + j->m_edgeA.other = j->m_bodyB; + j->m_edgeA.prev = NULL; + j->m_edgeA.next = j->m_bodyA->m_jointList; + if (j->m_bodyA->m_jointList) j->m_bodyA->m_jointList->prev = &j->m_edgeA; + j->m_bodyA->m_jointList = &j->m_edgeA; + + j->m_edgeB.joint = j; + j->m_edgeB.other = j->m_bodyA; + j->m_edgeB.prev = NULL; + j->m_edgeB.next = j->m_bodyB->m_jointList; + if (j->m_bodyB->m_jointList) j->m_bodyB->m_jointList->prev = &j->m_edgeB; + j->m_bodyB->m_jointList = &j->m_edgeB; + + b2Body* bodyA = def->bodyA; + b2Body* bodyB = def->bodyB; + + // If the joint prevents collisions, then flag any contacts for filtering. + if (def->collideConnected == false) + { + b2ContactEdge* edge = bodyB->GetContactList(); + while (edge) + { + if (edge->other == bodyA) + { + // Flag the contact for filtering at the next time step (where either + // body is awake). + edge->contact->FlagForFiltering(); + } + + edge = edge->next; + } + } + + // Note: creating a joint doesn't wake the bodies. + + return j; +} + +void b2World::DestroyJoint(b2Joint* j) +{ + b2Assert(IsLocked() == false); + if (IsLocked()) + { + return; + } + + bool collideConnected = j->m_collideConnected; + + // Remove from the doubly linked list. + if (j->m_prev) + { + j->m_prev->m_next = j->m_next; + } + + if (j->m_next) + { + j->m_next->m_prev = j->m_prev; + } + + if (j == m_jointList) + { + m_jointList = j->m_next; + } + + // Disconnect from island graph. + b2Body* bodyA = j->m_bodyA; + b2Body* bodyB = j->m_bodyB; + + // Wake up connected bodies. + bodyA->SetAwake(true); + bodyB->SetAwake(true); + + // Remove from body 1. + if (j->m_edgeA.prev) + { + j->m_edgeA.prev->next = j->m_edgeA.next; + } + + if (j->m_edgeA.next) + { + j->m_edgeA.next->prev = j->m_edgeA.prev; + } + + if (&j->m_edgeA == bodyA->m_jointList) + { + bodyA->m_jointList = j->m_edgeA.next; + } + + j->m_edgeA.prev = NULL; + j->m_edgeA.next = NULL; + + // Remove from body 2 + if (j->m_edgeB.prev) + { + j->m_edgeB.prev->next = j->m_edgeB.next; + } + + if (j->m_edgeB.next) + { + j->m_edgeB.next->prev = j->m_edgeB.prev; + } + + if (&j->m_edgeB == bodyB->m_jointList) + { + bodyB->m_jointList = j->m_edgeB.next; + } + + j->m_edgeB.prev = NULL; + j->m_edgeB.next = NULL; + + b2Joint::Destroy(j, &m_blockAllocator); + + b2Assert(m_jointCount > 0); + --m_jointCount; + + // If the joint prevents collisions, then flag any contacts for filtering. + if (collideConnected == false) + { + b2ContactEdge* edge = bodyB->GetContactList(); + while (edge) + { + if (edge->other == bodyA) + { + // Flag the contact for filtering at the next time step (where either + // body is awake). + edge->contact->FlagForFiltering(); + } + + edge = edge->next; + } + } +} + +// +void b2World::SetAllowSleeping(bool flag) +{ + if (flag == m_allowSleep) + { + return; + } + + m_allowSleep = flag; + if (m_allowSleep == false) + { + for (b2Body* b = m_bodyList; b; b = b->m_next) + { + b->SetAwake(true); + } + } +} + +// Find islands, integrate and solve constraints, solve position constraints +void b2World::Solve(const b2TimeStep& step) +{ + m_profile.solveInit = 0.0f; + m_profile.solveVelocity = 0.0f; + m_profile.solvePosition = 0.0f; + + // Size the island for the worst case. + b2Island island(m_bodyCount, + m_contactManager.m_contactCount, + m_jointCount, + &m_stackAllocator, + m_contactManager.m_contactListener); + + // Clear all the island flags. + for (b2Body* b = m_bodyList; b; b = b->m_next) + { + b->m_flags &= ~b2Body::e_islandFlag; + } + for (b2Contact* c = m_contactManager.m_contactList; c; c = c->m_next) + { + c->m_flags &= ~b2Contact::e_islandFlag; + } + for (b2Joint* j = m_jointList; j; j = j->m_next) + { + j->m_islandFlag = false; + } + + // Build and simulate all awake islands. + int32 stackSize = m_bodyCount; + b2Body** stack = (b2Body**)m_stackAllocator.Allocate(stackSize * sizeof(b2Body*)); + for (b2Body* seed = m_bodyList; seed; seed = seed->m_next) + { + if (seed->m_flags & b2Body::e_islandFlag) + { + continue; + } + + if (seed->IsAwake() == false || seed->IsActive() == false) + { + continue; + } + + // The seed can be dynamic or kinematic. + if (seed->GetType() == b2_staticBody) + { + continue; + } + + // Reset island and stack. + island.Clear(); + int32 stackCount = 0; + stack[stackCount++] = seed; + seed->m_flags |= b2Body::e_islandFlag; + + // Perform a depth first search (DFS) on the constraint graph. + while (stackCount > 0) + { + // Grab the next body off the stack and add it to the island. + b2Body* b = stack[--stackCount]; + b2Assert(b->IsActive() == true); + island.Add(b); + + // Make sure the body is awake. + b->SetAwake(true); + + // To keep islands as small as possible, we don't + // propagate islands across static bodies. + if (b->GetType() == b2_staticBody) + { + continue; + } + + // Search all contacts connected to this body. + for (b2ContactEdge* ce = b->m_contactList; ce; ce = ce->next) + { + b2Contact* contact = ce->contact; + + // Has this contact already been added to an island? + if (contact->m_flags & b2Contact::e_islandFlag) + { + continue; + } + + // Is this contact solid and touching? + if (contact->IsEnabled() == false || + contact->IsTouching() == false) + { + continue; + } + + // Skip sensors. + bool sensorA = contact->m_fixtureA->m_isSensor; + bool sensorB = contact->m_fixtureB->m_isSensor; + if (sensorA || sensorB) + { + continue; + } + + island.Add(contact); + contact->m_flags |= b2Contact::e_islandFlag; + + b2Body* other = ce->other; + + // Was the other body already added to this island? + if (other->m_flags & b2Body::e_islandFlag) + { + continue; + } + + b2Assert(stackCount < stackSize); + stack[stackCount++] = other; + other->m_flags |= b2Body::e_islandFlag; + } + + // Search all joints connect to this body. + for (b2JointEdge* je = b->m_jointList; je; je = je->next) + { + if (je->joint->m_islandFlag == true) + { + continue; + } + + b2Body* other = je->other; + + // Don't simulate joints connected to inactive bodies. + if (other->IsActive() == false) + { + continue; + } + + island.Add(je->joint); + je->joint->m_islandFlag = true; + + if (other->m_flags & b2Body::e_islandFlag) + { + continue; + } + + b2Assert(stackCount < stackSize); + stack[stackCount++] = other; + other->m_flags |= b2Body::e_islandFlag; + } + } + + b2Profile profile; + island.Solve(&profile, step, m_gravity, m_allowSleep); + m_profile.solveInit += profile.solveInit; + m_profile.solveVelocity += profile.solveVelocity; + m_profile.solvePosition += profile.solvePosition; + + // Post solve cleanup. + for (int32 i = 0; i < island.m_bodyCount; ++i) + { + // Allow static bodies to participate in other islands. + b2Body* b = island.m_bodies[i]; + if (b->GetType() == b2_staticBody) + { + b->m_flags &= ~b2Body::e_islandFlag; + } + } + } + + m_stackAllocator.Free(stack); + + { + b2Timer timer; + // Synchronize fixtures, check for out of range bodies. + for (b2Body* b = m_bodyList; b; b = b->GetNext()) + { + // If a body was not in an island then it did not move. + if ((b->m_flags & b2Body::e_islandFlag) == 0) + { + continue; + } + + if (b->GetType() == b2_staticBody) + { + continue; + } + + // Update fixtures (for broad-phase). + b->SynchronizeFixtures(); + } + + // Look for new contacts. + m_contactManager.FindNewContacts(); + m_profile.broadphase = timer.GetMilliseconds(); + } +} + +// Find TOI contacts and solve them. +void b2World::SolveTOI(const b2TimeStep& step) +{ + b2Island island(2 * b2_maxTOIContacts, b2_maxTOIContacts, 0, &m_stackAllocator, m_contactManager.m_contactListener); + + if (m_stepComplete) + { + for (b2Body* b = m_bodyList; b; b = b->m_next) + { + b->m_flags &= ~b2Body::e_islandFlag; + b->m_sweep.alpha0 = 0.0f; + } + + for (b2Contact* c = m_contactManager.m_contactList; c; c = c->m_next) + { + // Invalidate TOI + c->m_flags &= ~(b2Contact::e_toiFlag | b2Contact::e_islandFlag); + c->m_toiCount = 0; + c->m_toi = 1.0f; + } + } + + // Find TOI events and solve them. + for (;;) + { + // Find the first TOI. + b2Contact* minContact = NULL; + float32 minAlpha = 1.0f; + + for (b2Contact* c = m_contactManager.m_contactList; c; c = c->m_next) + { + // Is this contact disabled? + if (c->IsEnabled() == false) + { + continue; + } + + // Prevent excessive sub-stepping. + if (c->m_toiCount > b2_maxSubSteps) + { + continue; + } + + float32 alpha = 1.0f; + if (c->m_flags & b2Contact::e_toiFlag) + { + // This contact has a valid cached TOI. + alpha = c->m_toi; + } + else + { + b2Fixture* fA = c->GetFixtureA(); + b2Fixture* fB = c->GetFixtureB(); + + // Is there a sensor? + if (fA->IsSensor() || fB->IsSensor()) + { + continue; + } + + b2Body* bA = fA->GetBody(); + b2Body* bB = fB->GetBody(); + + b2BodyType typeA = bA->m_type; + b2BodyType typeB = bB->m_type; + b2Assert(typeA == b2_dynamicBody || typeB == b2_dynamicBody); + + bool activeA = bA->IsAwake() && typeA != b2_staticBody; + bool activeB = bB->IsAwake() && typeB != b2_staticBody; + + // Is at least one body active (awake and dynamic or kinematic)? + if (activeA == false && activeB == false) + { + continue; + } + + bool collideA = bA->IsBullet() || typeA != b2_dynamicBody; + bool collideB = bB->IsBullet() || typeB != b2_dynamicBody; + + // Are these two non-bullet dynamic bodies? + if (collideA == false && collideB == false) + { + continue; + } + + // Compute the TOI for this contact. + // Put the sweeps onto the same time interval. + float32 alpha0 = bA->m_sweep.alpha0; + + if (bA->m_sweep.alpha0 < bB->m_sweep.alpha0) + { + alpha0 = bB->m_sweep.alpha0; + bA->m_sweep.Advance(alpha0); + } + else if (bB->m_sweep.alpha0 < bA->m_sweep.alpha0) + { + alpha0 = bA->m_sweep.alpha0; + bB->m_sweep.Advance(alpha0); + } + + b2Assert(alpha0 < 1.0f); + + int32 indexA = c->GetChildIndexA(); + int32 indexB = c->GetChildIndexB(); + + // Compute the time of impact in interval [0, minTOI] + b2TOIInput input; + input.proxyA.Set(fA->GetShape(), indexA); + input.proxyB.Set(fB->GetShape(), indexB); + input.sweepA = bA->m_sweep; + input.sweepB = bB->m_sweep; + input.tMax = 1.0f; + + b2TOIOutput output; + b2TimeOfImpact(&output, &input); + + // Beta is the fraction of the remaining portion of the . + float32 beta = output.t; + if (output.state == b2TOIOutput::e_touching) + { + alpha = b2Min(alpha0 + (1.0f - alpha0) * beta, 1.0f); + } + else + { + alpha = 1.0f; + } + + c->m_toi = alpha; + c->m_flags |= b2Contact::e_toiFlag; + } + + if (alpha < minAlpha) + { + // This is the minimum TOI found so far. + minContact = c; + minAlpha = alpha; + } + } + + if (minContact == NULL || 1.0f - 10.0f * b2_epsilon < minAlpha) + { + // No more TOI events. Done! + m_stepComplete = true; + break; + } + + // Advance the bodies to the TOI. + b2Fixture* fA = minContact->GetFixtureA(); + b2Fixture* fB = minContact->GetFixtureB(); + b2Body* bA = fA->GetBody(); + b2Body* bB = fB->GetBody(); + + b2Sweep backup1 = bA->m_sweep; + b2Sweep backup2 = bB->m_sweep; + + bA->Advance(minAlpha); + bB->Advance(minAlpha); + + // The TOI contact likely has some new contact points. + minContact->Update(m_contactManager.m_contactListener); + minContact->m_flags &= ~b2Contact::e_toiFlag; + ++minContact->m_toiCount; + + // Is the contact solid? + if (minContact->IsEnabled() == false || minContact->IsTouching() == false) + { + // Restore the sweeps. + minContact->SetEnabled(false); + bA->m_sweep = backup1; + bB->m_sweep = backup2; + bA->SynchronizeTransform(); + bB->SynchronizeTransform(); + continue; + } + + bA->SetAwake(true); + bB->SetAwake(true); + + // Build the island + island.Clear(); + island.Add(bA); + island.Add(bB); + island.Add(minContact); + + bA->m_flags |= b2Body::e_islandFlag; + bB->m_flags |= b2Body::e_islandFlag; + minContact->m_flags |= b2Contact::e_islandFlag; + + // Get contacts on bodyA and bodyB. + b2Body* bodies[2] = {bA, bB}; + for (int32 i = 0; i < 2; ++i) + { + b2Body* body = bodies[i]; + if (body->m_type == b2_dynamicBody) + { + for (b2ContactEdge* ce = body->m_contactList; ce; ce = ce->next) + { + if (island.m_bodyCount == island.m_bodyCapacity) + { + break; + } + + if (island.m_contactCount == island.m_contactCapacity) + { + break; + } + + b2Contact* contact = ce->contact; + + // Has this contact already been added to the island? + if (contact->m_flags & b2Contact::e_islandFlag) + { + continue; + } + + // Only add static, kinematic, or bullet bodies. + b2Body* other = ce->other; + if (other->m_type == b2_dynamicBody && + body->IsBullet() == false && other->IsBullet() == false) + { + continue; + } + + // Skip sensors. + bool sensorA = contact->m_fixtureA->m_isSensor; + bool sensorB = contact->m_fixtureB->m_isSensor; + if (sensorA || sensorB) + { + continue; + } + + // Tentatively advance the body to the TOI. + b2Sweep backup = other->m_sweep; + if ((other->m_flags & b2Body::e_islandFlag) == 0) + { + other->Advance(minAlpha); + } + + // Update the contact points + contact->Update(m_contactManager.m_contactListener); + + // Was the contact disabled by the user? + if (contact->IsEnabled() == false) + { + other->m_sweep = backup; + other->SynchronizeTransform(); + continue; + } + + // Are there contact points? + if (contact->IsTouching() == false) + { + other->m_sweep = backup; + other->SynchronizeTransform(); + continue; + } + + // Add the contact to the island + contact->m_flags |= b2Contact::e_islandFlag; + island.Add(contact); + + // Has the other body already been added to the island? + if (other->m_flags & b2Body::e_islandFlag) + { + continue; + } + + // Add the other body to the island. + other->m_flags |= b2Body::e_islandFlag; + + if (other->m_type != b2_staticBody) + { + other->SetAwake(true); + } + + island.Add(other); + } + } + } + + b2TimeStep subStep; + subStep.dt = (1.0f - minAlpha) * step.dt; + subStep.inv_dt = 1.0f / subStep.dt; + subStep.dtRatio = 1.0f; + subStep.positionIterations = 20; + subStep.velocityIterations = step.velocityIterations; + subStep.warmStarting = false; + island.SolveTOI(subStep, bA->m_islandIndex, bB->m_islandIndex); + + // Reset island flags and synchronize broad-phase proxies. + for (int32 i = 0; i < island.m_bodyCount; ++i) + { + b2Body* body = island.m_bodies[i]; + body->m_flags &= ~b2Body::e_islandFlag; + + if (body->m_type != b2_dynamicBody) + { + continue; + } + + body->SynchronizeFixtures(); + + // Invalidate all contact TOIs on this displaced body. + for (b2ContactEdge* ce = body->m_contactList; ce; ce = ce->next) + { + ce->contact->m_flags &= ~(b2Contact::e_toiFlag | b2Contact::e_islandFlag); + } + } + + // Commit fixture proxy movements to the broad-phase so that new contacts are created. + // Also, some contacts can be destroyed. + m_contactManager.FindNewContacts(); + + if (m_subStepping) + { + m_stepComplete = false; + break; + } + } +} + +void b2World::Step(float32 dt, int32 velocityIterations, int32 positionIterations) +{ + b2Timer stepTimer; + + // If new fixtures were added, we need to find the new contacts. + if (m_flags & e_newFixture) + { + m_contactManager.FindNewContacts(); + m_flags &= ~e_newFixture; + } + + m_flags |= e_locked; + + b2TimeStep step; + step.dt = dt; + step.velocityIterations = velocityIterations; + step.positionIterations = positionIterations; + if (dt > 0.0f) + { + step.inv_dt = 1.0f / dt; + } + else + { + step.inv_dt = 0.0f; + } + + step.dtRatio = m_inv_dt0 * dt; + + step.warmStarting = m_warmStarting; + + // Update contacts. This is where some contacts are destroyed. + { + b2Timer timer; + m_contactManager.Collide(); + m_profile.collide = timer.GetMilliseconds(); + } + + // Integrate velocities, solve velocity constraints, and integrate positions. + if (m_stepComplete && step.dt > 0.0f) + { + b2Timer timer; + Solve(step); + m_profile.solve = timer.GetMilliseconds(); + } + + // Handle TOI events. + if (m_continuousPhysics && step.dt > 0.0f) + { + b2Timer timer; + SolveTOI(step); + m_profile.solveTOI = timer.GetMilliseconds(); + } + + if (step.dt > 0.0f) + { + m_inv_dt0 = step.inv_dt; + } + + if (m_flags & e_clearForces) + { + ClearForces(); + } + + m_flags &= ~e_locked; + + m_profile.step = stepTimer.GetMilliseconds(); +} + +void b2World::ClearForces() +{ + for (b2Body* body = m_bodyList; body; body = body->GetNext()) + { + body->m_force.SetZero(); + body->m_torque = 0.0f; + } +} + +struct b2WorldQueryWrapper +{ + bool QueryCallback(int32 proxyId) + { + b2FixtureProxy* proxy = (b2FixtureProxy*)broadPhase->GetUserData(proxyId); + return callback->ReportFixture(proxy->fixture); + } + + const b2BroadPhase* broadPhase; + b2QueryCallback* callback; +}; + +void b2World::QueryAABB(b2QueryCallback* callback, const b2AABB& aabb) const +{ + b2WorldQueryWrapper wrapper; + wrapper.broadPhase = &m_contactManager.m_broadPhase; + wrapper.callback = callback; + m_contactManager.m_broadPhase.Query(&wrapper, aabb); +} + +struct b2WorldRayCastWrapper +{ + float32 RayCastCallback(const b2RayCastInput& input, int32 proxyId) + { + void* userData = broadPhase->GetUserData(proxyId); + b2FixtureProxy* proxy = (b2FixtureProxy*)userData; + b2Fixture* fixture = proxy->fixture; + int32 index = proxy->childIndex; + b2RayCastOutput output; + bool hit = fixture->RayCast(&output, input, index); + + if (hit) + { + float32 fraction = output.fraction; + b2Vec2 point = (1.0f - fraction) * input.p1 + fraction * input.p2; + return callback->ReportFixture(fixture, point, output.normal, fraction); + } + + return input.maxFraction; + } + + const b2BroadPhase* broadPhase; + b2RayCastCallback* callback; +}; + +void b2World::RayCast(b2RayCastCallback* callback, const b2Vec2& point1, const b2Vec2& point2) const +{ + b2WorldRayCastWrapper wrapper; + wrapper.broadPhase = &m_contactManager.m_broadPhase; + wrapper.callback = callback; + b2RayCastInput input; + input.maxFraction = 1.0f; + input.p1 = point1; + input.p2 = point2; + m_contactManager.m_broadPhase.RayCast(&wrapper, input); +} + +void b2World::DrawShape(b2Fixture* fixture, const b2Transform& xf, const b2Color& color) +{ + switch (fixture->GetType()) + { + case b2Shape::e_circle: + { + b2CircleShape* circle = (b2CircleShape*)fixture->GetShape(); + + b2Vec2 center = b2Mul(xf, circle->m_p); + float32 radius = circle->m_radius; + b2Vec2 axis = b2Mul(xf.q, b2Vec2(1.0f, 0.0f)); + + m_debugDraw->DrawSolidCircle(center, radius, axis, color); + } + break; + + case b2Shape::e_edge: + { + b2EdgeShape* edge = (b2EdgeShape*)fixture->GetShape(); + b2Vec2 v1 = b2Mul(xf, edge->m_vertex1); + b2Vec2 v2 = b2Mul(xf, edge->m_vertex2); + m_debugDraw->DrawSegment(v1, v2, color); + } + break; + + case b2Shape::e_chain: + { + b2ChainShape* chain = (b2ChainShape*)fixture->GetShape(); + int32 count = chain->m_count; + const b2Vec2* vertices = chain->m_vertices; + + b2Vec2 v1 = b2Mul(xf, vertices[0]); + for (int32 i = 1; i < count; ++i) + { + b2Vec2 v2 = b2Mul(xf, vertices[i]); + m_debugDraw->DrawSegment(v1, v2, color); + m_debugDraw->DrawCircle(v1, 0.05f, color); + v1 = v2; + } + } + break; + + case b2Shape::e_polygon: + { + b2PolygonShape* poly = (b2PolygonShape*)fixture->GetShape(); + int32 vertexCount = poly->m_vertexCount; + b2Assert(vertexCount <= b2_maxPolygonVertices); + b2Vec2 vertices[b2_maxPolygonVertices]; + + for (int32 i = 0; i < vertexCount; ++i) + { + vertices[i] = b2Mul(xf, poly->m_vertices[i]); + } + + m_debugDraw->DrawSolidPolygon(vertices, vertexCount, color); + } + break; + + default: + break; + } +} + +void b2World::DrawJoint(b2Joint* joint) +{ + b2Body* bodyA = joint->GetBodyA(); + b2Body* bodyB = joint->GetBodyB(); + const b2Transform& xf1 = bodyA->GetTransform(); + const b2Transform& xf2 = bodyB->GetTransform(); + b2Vec2 x1 = xf1.p; + b2Vec2 x2 = xf2.p; + b2Vec2 p1 = joint->GetAnchorA(); + b2Vec2 p2 = joint->GetAnchorB(); + + b2Color color(0.5f, 0.8f, 0.8f); + + switch (joint->GetType()) + { + case e_distanceJoint: + m_debugDraw->DrawSegment(p1, p2, color); + break; + + case e_pulleyJoint: + { + b2PulleyJoint* pulley = (b2PulleyJoint*)joint; + b2Vec2 s1 = pulley->GetGroundAnchorA(); + b2Vec2 s2 = pulley->GetGroundAnchorB(); + m_debugDraw->DrawSegment(s1, p1, color); + m_debugDraw->DrawSegment(s2, p2, color); + m_debugDraw->DrawSegment(s1, s2, color); + } + break; + + case e_mouseJoint: + // don't draw this + break; + + default: + m_debugDraw->DrawSegment(x1, p1, color); + m_debugDraw->DrawSegment(p1, p2, color); + m_debugDraw->DrawSegment(x2, p2, color); + } +} + +void b2World::DrawDebugData() +{ + if (m_debugDraw == NULL) + { + return; + } + + uint32 flags = m_debugDraw->GetFlags(); + + if (flags & b2Draw::e_shapeBit) + { + for (b2Body* b = m_bodyList; b; b = b->GetNext()) + { + const b2Transform& xf = b->GetTransform(); + for (b2Fixture* f = b->GetFixtureList(); f; f = f->GetNext()) + { + if (b->IsActive() == false) + { + DrawShape(f, xf, b2Color(0.5f, 0.5f, 0.3f)); + } + else if (b->GetType() == b2_staticBody) + { + DrawShape(f, xf, b2Color(0.5f, 0.9f, 0.5f)); + } + else if (b->GetType() == b2_kinematicBody) + { + DrawShape(f, xf, b2Color(0.5f, 0.5f, 0.9f)); + } + else if (b->IsAwake() == false) + { + DrawShape(f, xf, b2Color(0.6f, 0.6f, 0.6f)); + } + else + { + DrawShape(f, xf, b2Color(0.9f, 0.7f, 0.7f)); + } + } + } + } + + if (flags & b2Draw::e_jointBit) + { + for (b2Joint* j = m_jointList; j; j = j->GetNext()) + { + DrawJoint(j); + } + } + + if (flags & b2Draw::e_pairBit) + { + b2Color color(0.3f, 0.9f, 0.9f); + for (b2Contact* c = m_contactManager.m_contactList; c; c = c->GetNext()) + { + //b2Fixture* fixtureA = c->GetFixtureA(); + //b2Fixture* fixtureB = c->GetFixtureB(); + + //b2Vec2 cA = fixtureA->GetAABB().GetCenter(); + //b2Vec2 cB = fixtureB->GetAABB().GetCenter(); + + //m_debugDraw->DrawSegment(cA, cB, color); + } + } + + if (flags & b2Draw::e_aabbBit) + { + b2Color color(0.9f, 0.3f, 0.9f); + b2BroadPhase* bp = &m_contactManager.m_broadPhase; + + for (b2Body* b = m_bodyList; b; b = b->GetNext()) + { + if (b->IsActive() == false) + { + continue; + } + + for (b2Fixture* f = b->GetFixtureList(); f; f = f->GetNext()) + { + for (int32 i = 0; i < f->m_proxyCount; ++i) + { + b2FixtureProxy* proxy = f->m_proxies + i; + b2AABB aabb = bp->GetFatAABB(proxy->proxyId); + b2Vec2 vs[4]; + vs[0].Set(aabb.lowerBound.x, aabb.lowerBound.y); + vs[1].Set(aabb.upperBound.x, aabb.lowerBound.y); + vs[2].Set(aabb.upperBound.x, aabb.upperBound.y); + vs[3].Set(aabb.lowerBound.x, aabb.upperBound.y); + + m_debugDraw->DrawPolygon(vs, 4, color); + } + } + } + } + + if (flags & b2Draw::e_centerOfMassBit) + { + for (b2Body* b = m_bodyList; b; b = b->GetNext()) + { + b2Transform xf = b->GetTransform(); + xf.p = b->GetWorldCenter(); + m_debugDraw->DrawTransform(xf); + } + } +} + +int32 b2World::GetProxyCount() const +{ + return m_contactManager.m_broadPhase.GetProxyCount(); +} + +int32 b2World::GetTreeHeight() const +{ + return m_contactManager.m_broadPhase.GetTreeHeight(); +} + +int32 b2World::GetTreeBalance() const +{ + return m_contactManager.m_broadPhase.GetTreeBalance(); +} + +float32 b2World::GetTreeQuality() const +{ + return m_contactManager.m_broadPhase.GetTreeQuality(); +} + +void b2World::Dump() +{ + if ((m_flags & e_locked) == e_locked) + { + return; + } + + b2Log("b2Vec2 g(%.15lef, %.15lef);\n", m_gravity.x, m_gravity.y); + b2Log("m_world->SetGravity(g);\n"); + + b2Log("b2Body** bodies = (b2Body**)b2Alloc(%d * sizeof(b2Body*));\n", m_bodyCount); + b2Log("b2Joint** joints = (b2Joint**)b2Alloc(%d * sizeof(b2Joint*));\n", m_jointCount); + int32 i = 0; + for (b2Body* b = m_bodyList; b; b = b->m_next) + { + b->m_islandIndex = i; + b->Dump(); + ++i; + } + + i = 0; + for (b2Joint* j = m_jointList; j; j = j->m_next) + { + j->m_index = i; + ++i; + } + + // First pass on joints, skip gear joints. + for (b2Joint* j = m_jointList; j; j = j->m_next) + { + if (j->m_type == e_gearJoint) + { + continue; + } + + b2Log("{\n"); + j->Dump(); + b2Log("}\n"); + } + + // Second pass on joints, only gear joints. + for (b2Joint* j = m_jointList; j; j = j->m_next) + { + if (j->m_type != e_gearJoint) + { + continue; + } + + b2Log("{\n"); + j->Dump(); + b2Log("}\n"); + } + + b2Log("b2Free(joints);\n"); + b2Log("b2Free(bodies);\n"); + b2Log("joints = NULL;\n"); + b2Log("bodies = NULL;\n"); +} diff --git a/external/box2d/Dynamics/b2World.h b/external/box2d/Dynamics/b2World.h new file mode 100644 index 0000000000..f207930511 --- /dev/null +++ b/external/box2d/Dynamics/b2World.h @@ -0,0 +1,349 @@ +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_WORLD_H +#define B2_WORLD_H + +#include +#include +#include +#include +#include +#include + +struct b2AABB; +struct b2BodyDef; +struct b2Color; +struct b2JointDef; +class b2Body; +class b2Draw; +class b2Fixture; +class b2Joint; + +/// The world class manages all physics entities, dynamic simulation, +/// and asynchronous queries. The world also contains efficient memory +/// management facilities. +class b2World +{ +public: + /// Construct a world object. + /// @param gravity the world gravity vector. + b2World(const b2Vec2& gravity); + + /// Destruct the world. All physics entities are destroyed and all heap memory is released. + ~b2World(); + + /// Register a destruction listener. The listener is owned by you and must + /// remain in scope. + void SetDestructionListener(b2DestructionListener* listener); + + /// Register a contact filter to provide specific control over collision. + /// Otherwise the default filter is used (b2_defaultFilter). The listener is + /// owned by you and must remain in scope. + void SetContactFilter(b2ContactFilter* filter); + + /// Register a contact event listener. The listener is owned by you and must + /// remain in scope. + void SetContactListener(b2ContactListener* listener); + + /// Register a routine for debug drawing. The debug draw functions are called + /// inside with b2World::DrawDebugData method. The debug draw object is owned + /// by you and must remain in scope. + void SetDebugDraw(b2Draw* debugDraw); + + /// Create a rigid body given a definition. No reference to the definition + /// is retained. + /// @warning This function is locked during callbacks. + b2Body* CreateBody(const b2BodyDef* def); + + /// Destroy a rigid body given a definition. No reference to the definition + /// is retained. This function is locked during callbacks. + /// @warning This automatically deletes all associated shapes and joints. + /// @warning This function is locked during callbacks. + void DestroyBody(b2Body* body); + + /// Create a joint to constrain bodies together. No reference to the definition + /// is retained. This may cause the connected bodies to cease colliding. + /// @warning This function is locked during callbacks. + b2Joint* CreateJoint(const b2JointDef* def); + + /// Destroy a joint. This may cause the connected bodies to begin colliding. + /// @warning This function is locked during callbacks. + void DestroyJoint(b2Joint* joint); + + /// Take a time step. This performs collision detection, integration, + /// and constraint solution. + /// @param timeStep the amount of time to simulate, this should not vary. + /// @param velocityIterations for the velocity constraint solver. + /// @param positionIterations for the position constraint solver. + void Step( float32 timeStep, + int32 velocityIterations, + int32 positionIterations); + + /// Manually clear the force buffer on all bodies. By default, forces are cleared automatically + /// after each call to Step. The default behavior is modified by calling SetAutoClearForces. + /// The purpose of this function is to support sub-stepping. Sub-stepping is often used to maintain + /// a fixed sized time step under a variable frame-rate. + /// When you perform sub-stepping you will disable auto clearing of forces and instead call + /// ClearForces after all sub-steps are complete in one pass of your game loop. + /// @see SetAutoClearForces + void ClearForces(); + + /// Call this to draw shapes and other debug draw data. + void DrawDebugData(); + + /// Query the world for all fixtures that potentially overlap the + /// provided AABB. + /// @param callback a user implemented callback class. + /// @param aabb the query box. + void QueryAABB(b2QueryCallback* callback, const b2AABB& aabb) const; + + /// Ray-cast the world for all fixtures in the path of the ray. Your callback + /// controls whether you get the closest point, any point, or n-points. + /// The ray-cast ignores shapes that contain the starting point. + /// @param callback a user implemented callback class. + /// @param point1 the ray starting point + /// @param point2 the ray ending point + void RayCast(b2RayCastCallback* callback, const b2Vec2& point1, const b2Vec2& point2) const; + + /// Get the world body list. With the returned body, use b2Body::GetNext to get + /// the next body in the world list. A NULL body indicates the end of the list. + /// @return the head of the world body list. + b2Body* GetBodyList(); + const b2Body* GetBodyList() const; + + /// Get the world joint list. With the returned joint, use b2Joint::GetNext to get + /// the next joint in the world list. A NULL joint indicates the end of the list. + /// @return the head of the world joint list. + b2Joint* GetJointList(); + const b2Joint* GetJointList() const; + + /// Get the world contact list. With the returned contact, use b2Contact::GetNext to get + /// the next contact in the world list. A NULL contact indicates the end of the list. + /// @return the head of the world contact list. + /// @warning contacts are created and destroyed in the middle of a time step. + /// Use b2ContactListener to avoid missing contacts. + b2Contact* GetContactList(); + const b2Contact* GetContactList() const; + + /// Enable/disable sleep. + void SetAllowSleeping(bool flag); + bool GetAllowSleeping() const { return m_allowSleep; } + + /// Enable/disable warm starting. For testing. + void SetWarmStarting(bool flag) { m_warmStarting = flag; } + bool GetWarmStarting() const { return m_warmStarting; } + + /// Enable/disable continuous physics. For testing. + void SetContinuousPhysics(bool flag) { m_continuousPhysics = flag; } + bool GetContinuousPhysics() const { return m_continuousPhysics; } + + /// Enable/disable single stepped continuous physics. For testing. + void SetSubStepping(bool flag) { m_subStepping = flag; } + bool GetSubStepping() const { return m_subStepping; } + + /// Get the number of broad-phase proxies. + int32 GetProxyCount() const; + + /// Get the number of bodies. + int32 GetBodyCount() const; + + /// Get the number of joints. + int32 GetJointCount() const; + + /// Get the number of contacts (each may have 0 or more contact points). + int32 GetContactCount() const; + + /// Get the height of the dynamic tree. + int32 GetTreeHeight() const; + + /// Get the balance of the dynamic tree. + int32 GetTreeBalance() const; + + /// Get the quality metric of the dynamic tree. The smaller the better. + /// The minimum is 1. + float32 GetTreeQuality() const; + + /// Change the global gravity vector. + void SetGravity(const b2Vec2& gravity); + + /// Get the global gravity vector. + b2Vec2 GetGravity() const; + + /// Is the world locked (in the middle of a time step). + bool IsLocked() const; + + /// Set flag to control automatic clearing of forces after each time step. + void SetAutoClearForces(bool flag); + + /// Get the flag that controls automatic clearing of forces after each time step. + bool GetAutoClearForces() const; + + /// Get the contact manager for testing. + const b2ContactManager& GetContactManager() const; + + /// Get the current profile. + const b2Profile& GetProfile() const; + + /// Dump the world into the log file. + /// @warning this should be called outside of a time step. + void Dump(); + +private: + + // m_flags + enum + { + e_newFixture = 0x0001, + e_locked = 0x0002, + e_clearForces = 0x0004 + }; + + friend class b2Body; + friend class b2Fixture; + friend class b2ContactManager; + friend class b2Controller; + + void Solve(const b2TimeStep& step); + void SolveTOI(const b2TimeStep& step); + + void DrawJoint(b2Joint* joint); + void DrawShape(b2Fixture* shape, const b2Transform& xf, const b2Color& color); + + b2BlockAllocator m_blockAllocator; + b2StackAllocator m_stackAllocator; + + int32 m_flags; + + b2ContactManager m_contactManager; + + b2Body* m_bodyList; + b2Joint* m_jointList; + + int32 m_bodyCount; + int32 m_jointCount; + + b2Vec2 m_gravity; + bool m_allowSleep; + + b2DestructionListener* m_destructionListener; + b2Draw* m_debugDraw; + + // This is used to compute the time step ratio to + // support a variable time step. + float32 m_inv_dt0; + + // These are for debugging the solver. + bool m_warmStarting; + bool m_continuousPhysics; + bool m_subStepping; + + bool m_stepComplete; + + b2Profile m_profile; +}; + +inline b2Body* b2World::GetBodyList() +{ + return m_bodyList; +} + +inline const b2Body* b2World::GetBodyList() const +{ + return m_bodyList; +} + +inline b2Joint* b2World::GetJointList() +{ + return m_jointList; +} + +inline const b2Joint* b2World::GetJointList() const +{ + return m_jointList; +} + +inline b2Contact* b2World::GetContactList() +{ + return m_contactManager.m_contactList; +} + +inline const b2Contact* b2World::GetContactList() const +{ + return m_contactManager.m_contactList; +} + +inline int32 b2World::GetBodyCount() const +{ + return m_bodyCount; +} + +inline int32 b2World::GetJointCount() const +{ + return m_jointCount; +} + +inline int32 b2World::GetContactCount() const +{ + return m_contactManager.m_contactCount; +} + +inline void b2World::SetGravity(const b2Vec2& gravity) +{ + m_gravity = gravity; +} + +inline b2Vec2 b2World::GetGravity() const +{ + return m_gravity; +} + +inline bool b2World::IsLocked() const +{ + return (m_flags & e_locked) == e_locked; +} + +inline void b2World::SetAutoClearForces(bool flag) +{ + if (flag) + { + m_flags |= e_clearForces; + } + else + { + m_flags &= ~e_clearForces; + } +} + +/// Get the flag that controls automatic clearing of forces after each time step. +inline bool b2World::GetAutoClearForces() const +{ + return (m_flags & e_clearForces) == e_clearForces; +} + +inline const b2ContactManager& b2World::GetContactManager() const +{ + return m_contactManager; +} + +inline const b2Profile& b2World::GetProfile() const +{ + return m_profile; +} + +#endif diff --git a/external/box2d/Dynamics/b2WorldCallbacks.cpp b/external/box2d/Dynamics/b2WorldCallbacks.cpp new file mode 100644 index 0000000000..48ad0cc46a --- /dev/null +++ b/external/box2d/Dynamics/b2WorldCallbacks.cpp @@ -0,0 +1,36 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include + +// Return true if contact calculations should be performed between these two shapes. +// If you implement your own collision filter you may want to build from this implementation. +bool b2ContactFilter::ShouldCollide(b2Fixture* fixtureA, b2Fixture* fixtureB) +{ + const b2Filter& filterA = fixtureA->GetFilterData(); + const b2Filter& filterB = fixtureB->GetFilterData(); + + if (filterA.groupIndex == filterB.groupIndex && filterA.groupIndex != 0) + { + return filterA.groupIndex > 0; + } + + bool collide = (filterA.maskBits & filterB.categoryBits) != 0 && (filterA.categoryBits & filterB.maskBits) != 0; + return collide; +} diff --git a/external/box2d/Dynamics/b2WorldCallbacks.h b/external/box2d/Dynamics/b2WorldCallbacks.h new file mode 100644 index 0000000000..86c04e3e32 --- /dev/null +++ b/external/box2d/Dynamics/b2WorldCallbacks.h @@ -0,0 +1,155 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_WORLD_CALLBACKS_H +#define B2_WORLD_CALLBACKS_H + +#include + +struct b2Vec2; +struct b2Transform; +class b2Fixture; +class b2Body; +class b2Joint; +class b2Contact; +struct b2ContactResult; +struct b2Manifold; + +/// Joints and fixtures are destroyed when their associated +/// body is destroyed. Implement this listener so that you +/// may nullify references to these joints and shapes. +class b2DestructionListener +{ +public: + virtual ~b2DestructionListener() {} + + /// Called when any joint is about to be destroyed due + /// to the destruction of one of its attached bodies. + virtual void SayGoodbye(b2Joint* joint) = 0; + + /// Called when any fixture is about to be destroyed due + /// to the destruction of its parent body. + virtual void SayGoodbye(b2Fixture* fixture) = 0; +}; + +/// Implement this class to provide collision filtering. In other words, you can implement +/// this class if you want finer control over contact creation. +class b2ContactFilter +{ +public: + virtual ~b2ContactFilter() {} + + /// Return true if contact calculations should be performed between these two shapes. + /// @warning for performance reasons this is only called when the AABBs begin to overlap. + virtual bool ShouldCollide(b2Fixture* fixtureA, b2Fixture* fixtureB); +}; + +/// Contact impulses for reporting. Impulses are used instead of forces because +/// sub-step forces may approach infinity for rigid body collisions. These +/// match up one-to-one with the contact points in b2Manifold. +struct b2ContactImpulse +{ + float32 normalImpulses[b2_maxManifoldPoints]; + float32 tangentImpulses[b2_maxManifoldPoints]; + int32 count; +}; + +/// Implement this class to get contact information. You can use these results for +/// things like sounds and game logic. You can also get contact results by +/// traversing the contact lists after the time step. However, you might miss +/// some contacts because continuous physics leads to sub-stepping. +/// Additionally you may receive multiple callbacks for the same contact in a +/// single time step. +/// You should strive to make your callbacks efficient because there may be +/// many callbacks per time step. +/// @warning You cannot create/destroy Box2D entities inside these callbacks. +class b2ContactListener +{ +public: + virtual ~b2ContactListener() {} + + /// Called when two fixtures begin to touch. + virtual void BeginContact(b2Contact* contact) { B2_NOT_USED(contact); } + + /// Called when two fixtures cease to touch. + virtual void EndContact(b2Contact* contact) { B2_NOT_USED(contact); } + + /// This is called after a contact is updated. This allows you to inspect a + /// contact before it goes to the solver. If you are careful, you can modify the + /// contact manifold (e.g. disable contact). + /// A copy of the old manifold is provided so that you can detect changes. + /// Note: this is called only for awake bodies. + /// Note: this is called even when the number of contact points is zero. + /// Note: this is not called for sensors. + /// Note: if you set the number of contact points to zero, you will not + /// get an EndContact callback. However, you may get a BeginContact callback + /// the next step. + virtual void PreSolve(b2Contact* contact, const b2Manifold* oldManifold) + { + B2_NOT_USED(contact); + B2_NOT_USED(oldManifold); + } + + /// This lets you inspect a contact after the solver is finished. This is useful + /// for inspecting impulses. + /// Note: the contact manifold does not include time of impact impulses, which can be + /// arbitrarily large if the sub-step is small. Hence the impulse is provided explicitly + /// in a separate data structure. + /// Note: this is only called for contacts that are touching, solid, and awake. + virtual void PostSolve(b2Contact* contact, const b2ContactImpulse* impulse) + { + B2_NOT_USED(contact); + B2_NOT_USED(impulse); + } +}; + +/// Callback class for AABB queries. +/// See b2World::Query +class b2QueryCallback +{ +public: + virtual ~b2QueryCallback() {} + + /// Called for each fixture found in the query AABB. + /// @return false to terminate the query. + virtual bool ReportFixture(b2Fixture* fixture) = 0; +}; + +/// Callback class for ray casts. +/// See b2World::RayCast +class b2RayCastCallback +{ +public: + virtual ~b2RayCastCallback() {} + + /// Called for each fixture found in the query. You control how the ray cast + /// proceeds by returning a float: + /// return -1: ignore this fixture and continue + /// return 0: terminate the ray cast + /// return fraction: clip the ray to this point + /// return 1: don't clip the ray and continue + /// @param fixture the fixture hit by the ray + /// @param point the point of initial intersection + /// @param normal the normal vector at the point of intersection + /// @return -1 to filter, 0 to terminate, fraction to clip the ray for + /// closest hit, 1 to continue + virtual float32 ReportFixture( b2Fixture* fixture, const b2Vec2& point, + const b2Vec2& normal, float32 fraction) = 0; +}; + +#endif diff --git a/external/box2d/Rope/b2Rope.cpp b/external/box2d/Rope/b2Rope.cpp new file mode 100644 index 0000000000..9bf671aec9 --- /dev/null +++ b/external/box2d/Rope/b2Rope.cpp @@ -0,0 +1,259 @@ +/* +* Copyright (c) 2011 Erin Catto http://box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include + +b2Rope::b2Rope() +{ + m_count = 0; + m_ps = NULL; + m_p0s = NULL; + m_vs = NULL; + m_ims = NULL; + m_Ls = NULL; + m_as = NULL; + m_gravity.SetZero(); + m_k2 = 1.0f; + m_k3 = 0.1f; +} + +b2Rope::~b2Rope() +{ + b2Free(m_ps); + b2Free(m_p0s); + b2Free(m_vs); + b2Free(m_ims); + b2Free(m_Ls); + b2Free(m_as); +} + +void b2Rope::Initialize(const b2RopeDef* def) +{ + b2Assert(def->count >= 3); + m_count = def->count; + m_ps = (b2Vec2*)b2Alloc(m_count * sizeof(b2Vec2)); + m_p0s = (b2Vec2*)b2Alloc(m_count * sizeof(b2Vec2)); + m_vs = (b2Vec2*)b2Alloc(m_count * sizeof(b2Vec2)); + m_ims = (float32*)b2Alloc(m_count * sizeof(float32)); + + for (int32 i = 0; i < m_count; ++i) + { + m_ps[i] = def->vertices[i]; + m_p0s[i] = def->vertices[i]; + m_vs[i].SetZero(); + + float32 m = def->masses[i]; + if (m > 0.0f) + { + m_ims[i] = 1.0f / m; + } + else + { + m_ims[i] = 0.0f; + } + } + + int32 count2 = m_count - 1; + int32 count3 = m_count - 2; + m_Ls = (float32*)b2Alloc(count2 * sizeof(float32)); + m_as = (float32*)b2Alloc(count3 * sizeof(float32)); + + for (int32 i = 0; i < count2; ++i) + { + b2Vec2 p1 = m_ps[i]; + b2Vec2 p2 = m_ps[i+1]; + m_Ls[i] = b2Distance(p1, p2); + } + + for (int32 i = 0; i < count3; ++i) + { + b2Vec2 p1 = m_ps[i]; + b2Vec2 p2 = m_ps[i + 1]; + b2Vec2 p3 = m_ps[i + 2]; + + b2Vec2 d1 = p2 - p1; + b2Vec2 d2 = p3 - p2; + + float32 a = b2Cross(d1, d2); + float32 b = b2Dot(d1, d2); + + m_as[i] = b2Atan2(a, b); + } + + m_gravity = def->gravity; + m_damping = def->damping; + m_k2 = def->k2; + m_k3 = def->k3; +} + +void b2Rope::Step(float32 h, int32 iterations) +{ + if (h == 0.0) + { + return; + } + + float32 d = expf(- h * m_damping); + + for (int32 i = 0; i < m_count; ++i) + { + m_p0s[i] = m_ps[i]; + if (m_ims[i] > 0.0f) + { + m_vs[i] += h * m_gravity; + } + m_vs[i] *= d; + m_ps[i] += h * m_vs[i]; + + } + + for (int32 i = 0; i < iterations; ++i) + { + SolveC2(); + SolveC3(); + SolveC2(); + } + + float32 inv_h = 1.0f / h; + for (int32 i = 0; i < m_count; ++i) + { + m_vs[i] = inv_h * (m_ps[i] - m_p0s[i]); + } +} + +void b2Rope::SolveC2() +{ + int32 count2 = m_count - 1; + + for (int32 i = 0; i < count2; ++i) + { + b2Vec2 p1 = m_ps[i]; + b2Vec2 p2 = m_ps[i + 1]; + + b2Vec2 d = p2 - p1; + float32 L = d.Normalize(); + + float32 im1 = m_ims[i]; + float32 im2 = m_ims[i + 1]; + + if (im1 + im2 == 0.0f) + { + continue; + } + + float32 s1 = im1 / (im1 + im2); + float32 s2 = im2 / (im1 + im2); + + p1 -= m_k2 * s1 * (m_Ls[i] - L) * d; + p2 += m_k2 * s2 * (m_Ls[i] - L) * d; + + m_ps[i] = p1; + m_ps[i + 1] = p2; + } +} + +void b2Rope::SetAngle(float32 angle) +{ + int32 count3 = m_count - 2; + for (int32 i = 0; i < count3; ++i) + { + m_as[i] = angle; + } +} + +void b2Rope::SolveC3() +{ + int32 count3 = m_count - 2; + + for (int32 i = 0; i < count3; ++i) + { + b2Vec2 p1 = m_ps[i]; + b2Vec2 p2 = m_ps[i + 1]; + b2Vec2 p3 = m_ps[i + 2]; + + float32 m1 = m_ims[i]; + float32 m2 = m_ims[i + 1]; + float32 m3 = m_ims[i + 2]; + + b2Vec2 d1 = p2 - p1; + b2Vec2 d2 = p3 - p2; + + float32 L1sqr = d1.LengthSquared(); + float32 L2sqr = d2.LengthSquared(); + + if (L1sqr * L2sqr == 0.0f) + { + continue; + } + + float32 a = b2Cross(d1, d2); + float32 b = b2Dot(d1, d2); + + float32 angle = b2Atan2(a, b); + + b2Vec2 Jd1 = (-1.0f / L1sqr) * d1.Skew(); + b2Vec2 Jd2 = (1.0f / L2sqr) * d2.Skew(); + + b2Vec2 J1 = -Jd1; + b2Vec2 J2 = Jd1 - Jd2; + b2Vec2 J3 = Jd2; + + float32 mass = m1 * b2Dot(J1, J1) + m2 * b2Dot(J2, J2) + m3 * b2Dot(J3, J3); + if (mass == 0.0f) + { + continue; + } + + mass = 1.0f / mass; + + float32 C = angle - m_as[i]; + + while (C > b2_pi) + { + angle -= 2 * b2_pi; + C = angle - m_as[i]; + } + + while (C < -b2_pi) + { + angle += 2.0f * b2_pi; + C = angle - m_as[i]; + } + + float32 impulse = - m_k3 * mass * C; + + p1 += (m1 * impulse) * J1; + p2 += (m2 * impulse) * J2; + p3 += (m3 * impulse) * J3; + + m_ps[i] = p1; + m_ps[i + 1] = p2; + m_ps[i + 2] = p3; + } +} + +void b2Rope::Draw(b2Draw* draw) const +{ + b2Color c(0.4f, 0.5f, 0.7f); + + for (int32 i = 0; i < m_count - 1; ++i) + { + draw->DrawSegment(m_ps[i], m_ps[i+1], c); + } +} diff --git a/external/box2d/Rope/b2Rope.h b/external/box2d/Rope/b2Rope.h new file mode 100644 index 0000000000..b981dfd6c5 --- /dev/null +++ b/external/box2d/Rope/b2Rope.h @@ -0,0 +1,115 @@ +/* +* Copyright (c) 2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_ROPE_H +#define B2_ROPE_H + +#include + +class b2Draw; + +/// +struct b2RopeDef +{ + b2RopeDef() + { + vertices = NULL; + count = 0; + masses = NULL; + gravity.SetZero(); + damping = 0.1f; + k2 = 0.9f; + k3 = 0.1f; + } + + /// + b2Vec2* vertices; + + /// + int32 count; + + /// + float32* masses; + + /// + b2Vec2 gravity; + + /// + float32 damping; + + /// Stretching stiffness + float32 k2; + + /// Bending stiffness. Values above 0.5 can make the simulation blow up. + float32 k3; +}; + +/// +class b2Rope +{ +public: + b2Rope(); + ~b2Rope(); + + /// + void Initialize(const b2RopeDef* def); + + /// + void Step(float32 timeStep, int32 iterations); + + /// + int32 GetVertexCount() const + { + return m_count; + } + + /// + const b2Vec2* GetVertices() const + { + return m_ps; + } + + /// + void Draw(b2Draw* draw) const; + + /// + void SetAngle(float32 angle); + +private: + + void SolveC2(); + void SolveC3(); + + int32 m_count; + b2Vec2* m_ps; + b2Vec2* m_p0s; + b2Vec2* m_vs; + + float32* m_ims; + + float32* m_Ls; + float32* m_as; + + b2Vec2 m_gravity; + float32 m_damping; + + float32 m_k2; + float32 m_k3; +}; + +#endif diff --git a/external/box2d/proj.linux/.cproject b/external/box2d/proj.linux/.cproject new file mode 100644 index 0000000000..5aa092cac3 --- /dev/null +++ b/external/box2d/proj.linux/.cproject @@ -0,0 +1,267 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/external/box2d/proj.linux/.project b/external/box2d/proj.linux/.project new file mode 100644 index 0000000000..164d50f52a --- /dev/null +++ b/external/box2d/proj.linux/.project @@ -0,0 +1,110 @@ + + + libBox2D + + + + + + org.eclipse.cdt.managedbuilder.core.genmakebuilder + clean,full,incremental, + + + ?name? + + + + org.eclipse.cdt.make.core.append_environment + true + + + org.eclipse.cdt.make.core.autoBuildTarget + all + + + org.eclipse.cdt.make.core.buildArguments + + + + org.eclipse.cdt.make.core.buildCommand + make + + + org.eclipse.cdt.make.core.buildLocation + ${workspace_loc:/libBox2D/Debug} + + + org.eclipse.cdt.make.core.cleanBuildTarget + clean + + + org.eclipse.cdt.make.core.contents + org.eclipse.cdt.make.core.activeConfigSettings + + + org.eclipse.cdt.make.core.enableAutoBuild + false + + + org.eclipse.cdt.make.core.enableCleanBuild + true + + + org.eclipse.cdt.make.core.enableFullBuild + true + + + org.eclipse.cdt.make.core.fullBuildTarget + all + + + org.eclipse.cdt.make.core.stopOnError + true + + + org.eclipse.cdt.make.core.useDefaultBuildCmd + true + + + + + org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder + full,incremental, + + + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.core.ccnature + org.eclipse.cdt.managedbuilder.core.managedBuildNature + org.eclipse.cdt.managedbuilder.core.ScannerConfigNature + + + + Box2D.h + 1 + PARENT-1-PROJECT_LOC/Box2D.h + + + Collision + 2 + PARENT-1-PROJECT_LOC/Collision + + + Common + 2 + PARENT-1-PROJECT_LOC/Common + + + Dynamics + 2 + PARENT-1-PROJECT_LOC/Dynamics + + + Rope + 2 + PARENT-1-PROJECT_LOC/Rope + + + diff --git a/external/box2d/proj.linux/Makefile b/external/box2d/proj.linux/Makefile new file mode 100644 index 0000000000..e430bc9883 --- /dev/null +++ b/external/box2d/proj.linux/Makefile @@ -0,0 +1,72 @@ +TARGET = libbox2d.a + +SOURCES = ../Collision/Shapes/b2ChainShape.cpp \ +../Collision/Shapes/b2CircleShape.cpp \ +../Collision/Shapes/b2EdgeShape.cpp \ +../Collision/Shapes/b2PolygonShape.cpp \ +../Collision/b2BroadPhase.cpp \ +../Collision/b2CollideCircle.cpp \ +../Collision/b2CollideEdge.cpp \ +../Collision/b2CollidePolygon.cpp \ +../Collision/b2Collision.cpp \ +../Collision/b2Distance.cpp \ +../Collision/b2DynamicTree.cpp \ +../Collision/b2TimeOfImpact.cpp \ +../Common/b2BlockAllocator.cpp \ +../Common/b2Draw.cpp \ +../Common/b2Math.cpp \ +../Common/b2Settings.cpp \ +../Common/b2StackAllocator.cpp \ +../Common/b2Timer.cpp \ +../Dynamics/Contacts/b2ChainAndCircleContact.cpp \ +../Dynamics/Contacts/b2ChainAndPolygonContact.cpp \ +../Dynamics/Contacts/b2CircleContact.cpp \ +../Dynamics/Contacts/b2Contact.cpp \ +../Dynamics/Contacts/b2ContactSolver.cpp \ +../Dynamics/Contacts/b2EdgeAndCircleContact.cpp \ +../Dynamics/Contacts/b2EdgeAndPolygonContact.cpp \ +../Dynamics/Contacts/b2PolygonAndCircleContact.cpp \ +../Dynamics/Contacts/b2PolygonContact.cpp \ +../Dynamics/Joints/b2DistanceJoint.cpp \ +../Dynamics/Joints/b2FrictionJoint.cpp \ +../Dynamics/Joints/b2GearJoint.cpp \ +../Dynamics/Joints/b2Joint.cpp \ +../Dynamics/Joints/b2MouseJoint.cpp \ +../Dynamics/Joints/b2PrismaticJoint.cpp \ +../Dynamics/Joints/b2PulleyJoint.cpp \ +../Dynamics/Joints/b2RevoluteJoint.cpp \ +../Dynamics/Joints/b2RopeJoint.cpp \ +../Dynamics/Joints/b2WeldJoint.cpp \ +../Dynamics/Joints/b2WheelJoint.cpp \ +../Dynamics/b2Body.cpp \ +../Dynamics/b2ContactManager.cpp \ +../Dynamics/b2Fixture.cpp \ +../Dynamics/b2Island.cpp \ +../Dynamics/b2World.cpp \ +../Dynamics/b2WorldCallbacks.cpp \ +../Rope/b2Rope.cpp + +include ../../../cocos2dx/proj.linux/cocos2dx.mk + +INCLUDES = -I../.. + +# Cocos2d is not responsible for warnings in external projects +CXXFLAGS += -w + +ifeq ($(DEBUG), 1) +DEFINES = -D_DEBUG +else +DEFINES = +endif + +TARGET := $(LIB_DIR)/$(TARGET) + +all: $(TARGET) + +$(TARGET): $(OBJECTS) $(CORE_MAKEFILE_LIST) + @mkdir -p $(@D) + $(LOG_AR)$(AR) $(ARFLAGS) $(TARGET) $(OBJECTS) + +$(OBJ_DIR)/%.o: ../%.cpp $(CORE_MAKEFILE_LIST) + @mkdir -p $(@D) + $(LOG_CXX)$(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@ diff --git a/external/box2d/proj.linux/box2d.prf b/external/box2d/proj.linux/box2d.prf new file mode 100644 index 0000000000..434ad88406 --- /dev/null +++ b/external/box2d/proj.linux/box2d.prf @@ -0,0 +1,19 @@ +################################################################################ +# Do not include this file in your project: see cocos2dx.pri. +################################################################################ + +linux { + # We will compile box2d on demand using Makefile. + build_box2d.name = Build box2d static library + build_box2d.input = $$PWD/Makefile + build_box2d.output = $$CC_LIBRARY_DIR/libbox2d.a + build_box2d.target = $$CC_LIBRARY_DIR/libbox2d.a + build_box2d.CONFIG = no_link target_predeps + build_box2d.commands = cd $$PWD && make $$CC_MAKE_FLAGS + + QMAKE_EXTRA_COMPILERS += build_box2d + QMAKE_EXTRA_TARGETS += build_box2d + + PRE_TARGETDEPS += $$CC_LIBRARY_DIR/libbox2d.a + LIBS += -Wl,-Bstatic -lbox2d -Wl,-Bdynamic +} diff --git a/external/box2d/proj.win32/Box2D.vcxproj b/external/box2d/proj.win32/Box2D.vcxproj new file mode 100644 index 0000000000..cd4bd2086c --- /dev/null +++ b/external/box2d/proj.win32/Box2D.vcxproj @@ -0,0 +1,194 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + libBox2D + {929480E7-23C0-4DF6-8456-096D71547116} + Box2D.win32 + Win32Proj + + + + StaticLibrary + Unicode + v100 + v110 + v110_xp + + + StaticLibrary + Unicode + v100 + v110 + v110_xp + + + + + + + + + + + + + <_ProjectFileVersion>10.0.40219.1 + $(SolutionDir)$(Configuration).win32\ + $(Configuration).win32\ + $(SolutionDir)$(Configuration).win32\ + $(Configuration).win32\ + AllRules.ruleset + + + AllRules.ruleset + + + + + $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\lib;$(LibraryPath) + + + $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\lib;$(LibraryPath) + + + + Disabled + $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\include;../../;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + false + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + true + + + $(OutDir)$(ProjectName).lib + + + + + $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\include;../../;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + true + + + $(OutDir)$(ProjectName).lib + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/external/box2d/proj.win32/Box2D.vcxproj.filters b/external/box2d/proj.win32/Box2D.vcxproj.filters new file mode 100644 index 0000000000..e810cbb0cf --- /dev/null +++ b/external/box2d/proj.win32/Box2D.vcxproj.filters @@ -0,0 +1,301 @@ + + + + + {bdf099c5-cc32-468b-b53f-ec010d7f823f} + + + {92792f88-4e5c-46ee-8d87-002f3b2297ae} + + + {f41a6fa6-5ac1-4514-9ac0-6f3a38f35b4d} + + + {0b56913a-34b7-410a-b386-869d6f7a20be} + + + {f0e7b230-79cc-49b8-9ed7-9dbfa062f2a4} + + + {932f2008-afbe-42f5-993d-a1df0ec67756} + + + {f8937e09-93a4-49fa-8f3e-dfc36da764df} + + + + + Collision + + + Collision + + + Collision + + + Collision + + + Collision + + + Collision + + + Collision + + + Collision + + + Collision\Shapes + + + Collision\Shapes + + + Collision\Shapes + + + Collision\Shapes + + + Common + + + Common + + + Common + + + Common + + + Common + + + Common + + + Dynamics + + + Dynamics + + + Dynamics + + + Dynamics + + + Dynamics + + + Dynamics + + + Dynamics\Contacts + + + Dynamics\Contacts + + + Dynamics\Contacts + + + Dynamics\Contacts + + + Dynamics\Contacts + + + Dynamics\Contacts + + + Dynamics\Contacts + + + Dynamics\Contacts + + + Dynamics\Contacts + + + Dynamics\Joints + + + Dynamics\Joints + + + Dynamics\Joints + + + Dynamics\Joints + + + Dynamics\Joints + + + Dynamics\Joints + + + Dynamics\Joints + + + Dynamics\Joints + + + Dynamics\Joints + + + Dynamics\Joints + + + Dynamics\Joints + + + Rope + + + + + Collision + + + Collision + + + Collision + + + Collision + + + Collision + + + Collision\Shapes + + + Collision\Shapes + + + Collision\Shapes + + + Collision\Shapes + + + Collision\Shapes + + + Common + + + Common + + + Common + + + Common + + + Common + + + Common + + + Common + + + Dynamics + + + Dynamics + + + Dynamics + + + Dynamics + + + Dynamics + + + Dynamics + + + Dynamics + + + Dynamics\Contacts + + + Dynamics\Contacts + + + Dynamics\Contacts + + + Dynamics\Contacts + + + Dynamics\Contacts + + + Dynamics\Contacts + + + Dynamics\Contacts + + + Dynamics\Contacts + + + Dynamics\Contacts + + + Dynamics\Joints + + + Dynamics\Joints + + + Dynamics\Joints + + + Dynamics\Joints + + + Dynamics\Joints + + + Dynamics\Joints + + + Dynamics\Joints + + + Dynamics\Joints + + + Dynamics\Joints + + + Dynamics\Joints + + + Dynamics\Joints + + + Rope + + + + \ No newline at end of file diff --git a/external/box2d/proj.win32/Box2D.vcxproj.user b/external/box2d/proj.win32/Box2D.vcxproj.user new file mode 100644 index 0000000000..ace9a86acb --- /dev/null +++ b/external/box2d/proj.win32/Box2D.vcxproj.user @@ -0,0 +1,3 @@ + + + \ No newline at end of file From 31b92aacc4e2ec24734417e465fc191828e5a5a0 Mon Sep 17 00:00:00 2001 From: minggo Date: Sat, 12 Oct 2013 14:10:18 +0800 Subject: [PATCH 17/64] issue #2905: remove rpm, don't support qt5 temporaly --- rpm/cocos2d-x.spec | 81 ---------------------------------------------- 1 file changed, 81 deletions(-) delete mode 100644 rpm/cocos2d-x.spec diff --git a/rpm/cocos2d-x.spec b/rpm/cocos2d-x.spec deleted file mode 100644 index c997278f21..0000000000 --- a/rpm/cocos2d-x.spec +++ /dev/null @@ -1,81 +0,0 @@ -Name: cocos2d-x -Version: 1.0.0 -Release: 2 -Summary: Cocos2D-X Cross-Platform 2D Games Framework - -Group: System/GUI/Other -License: MIT -URL: http://cocos2d-x.org -Source: %{name}-%{version}.tar.bz2 -BuildRequires: pkgconfig(egl) -BuildRequires: pkgconfig(glesv2) -BuildRequires: pkgconfig(Qt5Core) -BuildRequires: pkgconfig(Qt5Gui) -BuildRequires: pkgconfig(Qt5Multimedia) -BuildRequires: pkgconfig(Qt5Sensors) -BuildRequires: pkgconfig(zlib) -BuildRequires: pkgconfig(fontconfig) -BuildRequires: pkgconfig(freetype2) -BuildRequires: pkgconfig(libpng) -BuildRequires: pkgconfig(libtiff-4) -BuildRequires: libjpeg-turbo-devel -BuildRequires: pkgconfig(libcurl) - -%description -cocos2d-x is a multi-platform 2D game framework in C++, -branched on cocos2d-iphone and licensed under MIT. - -%package tests -Summary: Cocos2D-X Test Applications -Group: Development/Libraries -Requires: %{name} = %{version} - -%description tests -cocos2d-x is a multi-platform 2D game framework in C++, -branched on cocos2d-iphone and licensed under MIT. - -This package contains test applications for Cocos2D-X. - -%package devel -Summary: Cocos2D-X Development Libraries -Group: Development/Libraries -Requires: %{name} = %{version} - -%description devel -cocos2d-x is a multi-platform 2D game framework in C++, -branched on cocos2d-iphone and licensed under MIT. - -This package contains development libraries for Cocos2D-X. - -%prep -%setup -q - -%build -%qmake5 -make - -%install -make INSTALL_ROOT=%{buildroot} install - -%post -/sbin/ldconfig - -%postun -/sbin/ldconfig - -%files -%defattr(-,root,root,-) -%doc README.mdown licenses -%{_libdir}/lib*.so.* - -%files tests -%defattr(-,root,root,-) -%doc README.mdown -/opt/cocos2dx_TestCpp/* -/usr/share/applications/*.desktop - -%files devel -%defattr(-,root,root,-) -%doc README.mdown AUTHORS CHANGELOG -%{_libdir}/lib*.so -#%{_includedir}/*/*.h From dfe85aa125535fafd3a40221c863dd692086fa0f Mon Sep 17 00:00:00 2001 From: minggo Date: Sat, 12 Oct 2013 14:14:57 +0800 Subject: [PATCH 18/64] issue #2905:remove box2d --- external/box2d/Android.mk | 60 - external/box2d/Box2D.h | 67 - .../box2d/Collision/Shapes/b2ChainShape.cpp | 171 --- .../box2d/Collision/Shapes/b2ChainShape.h | 102 -- .../box2d/Collision/Shapes/b2CircleShape.cpp | 100 -- .../box2d/Collision/Shapes/b2CircleShape.h | 91 -- .../box2d/Collision/Shapes/b2EdgeShape.cpp | 139 -- external/box2d/Collision/Shapes/b2EdgeShape.h | 74 - .../box2d/Collision/Shapes/b2PolygonShape.cpp | 361 ----- .../box2d/Collision/Shapes/b2PolygonShape.h | 95 -- external/box2d/Collision/Shapes/b2Shape.h | 101 -- external/box2d/Collision/b2BroadPhase.cpp | 122 -- external/box2d/Collision/b2BroadPhase.h | 248 ---- external/box2d/Collision/b2CollideCircle.cpp | 154 -- external/box2d/Collision/b2CollideEdge.cpp | 698 --------- external/box2d/Collision/b2CollidePolygon.cpp | 317 ---- external/box2d/Collision/b2Collision.cpp | 249 ---- external/box2d/Collision/b2Collision.h | 276 ---- external/box2d/Collision/b2Distance.cpp | 603 -------- external/box2d/Collision/b2Distance.h | 141 -- external/box2d/Collision/b2DynamicTree.cpp | 775 ---------- external/box2d/Collision/b2DynamicTree.h | 284 ---- external/box2d/Collision/b2TimeOfImpact.cpp | 488 ------ external/box2d/Collision/b2TimeOfImpact.h | 58 - external/box2d/Common/b2BlockAllocator.cpp | 218 --- external/box2d/Common/b2BlockAllocator.h | 62 - external/box2d/Common/b2Draw.cpp | 44 - external/box2d/Common/b2Draw.h | 81 - external/box2d/Common/b2GrowableStack.h | 85 -- external/box2d/Common/b2Math.cpp | 94 -- external/box2d/Common/b2Math.h | 738 --------- external/box2d/Common/b2Settings.cpp | 61 - external/box2d/Common/b2Settings.h | 150 -- external/box2d/Common/b2StackAllocator.cpp | 83 -- external/box2d/Common/b2StackAllocator.h | 60 - external/box2d/Common/b2Timer.cpp | 100 -- external/box2d/Common/b2Timer.h | 45 - .../Contacts/b2ChainAndCircleContact.cpp | 54 - .../Contacts/b2ChainAndCircleContact.h | 39 - .../Contacts/b2ChainAndPolygonContact.cpp | 54 - .../Contacts/b2ChainAndPolygonContact.h | 39 - .../Dynamics/Contacts/b2CircleContact.cpp | 53 - .../box2d/Dynamics/Contacts/b2CircleContact.h | 39 - .../box2d/Dynamics/Contacts/b2Contact.cpp | 240 --- external/box2d/Dynamics/Contacts/b2Contact.h | 331 ----- .../Dynamics/Contacts/b2ContactSolver.cpp | 832 ----------- .../box2d/Dynamics/Contacts/b2ContactSolver.h | 94 -- .../Contacts/b2EdgeAndCircleContact.cpp | 50 - .../Contacts/b2EdgeAndCircleContact.h | 39 - .../Contacts/b2EdgeAndPolygonContact.cpp | 50 - .../Contacts/b2EdgeAndPolygonContact.h | 39 - .../Contacts/b2PolygonAndCircleContact.cpp | 50 - .../Contacts/b2PolygonAndCircleContact.h | 38 - .../Dynamics/Contacts/b2PolygonContact.cpp | 53 - .../Dynamics/Contacts/b2PolygonContact.h | 39 - .../box2d/Dynamics/Joints/b2DistanceJoint.cpp | 260 ---- .../box2d/Dynamics/Joints/b2DistanceJoint.h | 169 --- .../box2d/Dynamics/Joints/b2FrictionJoint.cpp | 251 ---- .../box2d/Dynamics/Joints/b2FrictionJoint.h | 119 -- .../box2d/Dynamics/Joints/b2GearJoint.cpp | 423 ------ external/box2d/Dynamics/Joints/b2GearJoint.h | 125 -- external/box2d/Dynamics/Joints/b2Joint.cpp | 199 --- external/box2d/Dynamics/Joints/b2Joint.h | 222 --- .../box2d/Dynamics/Joints/b2MouseJoint.cpp | 217 --- external/box2d/Dynamics/Joints/b2MouseJoint.h | 126 -- .../Dynamics/Joints/b2PrismaticJoint.cpp | 637 -------- .../box2d/Dynamics/Joints/b2PrismaticJoint.h | 196 --- .../box2d/Dynamics/Joints/b2PulleyJoint.cpp | 332 ----- .../box2d/Dynamics/Joints/b2PulleyJoint.h | 143 -- .../box2d/Dynamics/Joints/b2RevoluteJoint.cpp | 504 ------- .../box2d/Dynamics/Joints/b2RevoluteJoint.h | 204 --- .../box2d/Dynamics/Joints/b2RopeJoint.cpp | 241 --- external/box2d/Dynamics/Joints/b2RopeJoint.h | 114 -- .../box2d/Dynamics/Joints/b2WeldJoint.cpp | 330 ----- external/box2d/Dynamics/Joints/b2WeldJoint.h | 126 -- .../box2d/Dynamics/Joints/b2WheelJoint.cpp | 419 ------ external/box2d/Dynamics/Joints/b2WheelJoint.h | 213 --- external/box2d/Dynamics/b2Body.cpp | 514 ------- external/box2d/Dynamics/b2Body.h | 846 ----------- external/box2d/Dynamics/b2ContactManager.cpp | 293 ---- external/box2d/Dynamics/b2ContactManager.h | 52 - external/box2d/Dynamics/b2Fixture.cpp | 303 ---- external/box2d/Dynamics/b2Fixture.h | 345 ----- external/box2d/Dynamics/b2Island.cpp | 539 ------- external/box2d/Dynamics/b2Island.h | 93 -- external/box2d/Dynamics/b2TimeStep.h | 70 - external/box2d/Dynamics/b2World.cpp | 1316 ----------------- external/box2d/Dynamics/b2World.h | 349 ----- external/box2d/Dynamics/b2WorldCallbacks.cpp | 36 - external/box2d/Dynamics/b2WorldCallbacks.h | 155 -- external/box2d/Rope/b2Rope.cpp | 259 ---- external/box2d/Rope/b2Rope.h | 115 -- external/box2d/proj.linux/.cproject | 267 ---- external/box2d/proj.linux/.project | 110 -- external/box2d/proj.linux/Makefile | 72 - external/box2d/proj.linux/box2d.prf | 19 - external/box2d/proj.win32/Box2D.vcxproj | 194 --- .../box2d/proj.win32/Box2D.vcxproj.filters | 301 ---- external/box2d/proj.win32/Box2D.vcxproj.user | 3 - 99 files changed, 21549 deletions(-) delete mode 100644 external/box2d/Android.mk delete mode 100644 external/box2d/Box2D.h delete mode 100644 external/box2d/Collision/Shapes/b2ChainShape.cpp delete mode 100644 external/box2d/Collision/Shapes/b2ChainShape.h delete mode 100644 external/box2d/Collision/Shapes/b2CircleShape.cpp delete mode 100644 external/box2d/Collision/Shapes/b2CircleShape.h delete mode 100644 external/box2d/Collision/Shapes/b2EdgeShape.cpp delete mode 100644 external/box2d/Collision/Shapes/b2EdgeShape.h delete mode 100644 external/box2d/Collision/Shapes/b2PolygonShape.cpp delete mode 100644 external/box2d/Collision/Shapes/b2PolygonShape.h delete mode 100644 external/box2d/Collision/Shapes/b2Shape.h delete mode 100644 external/box2d/Collision/b2BroadPhase.cpp delete mode 100644 external/box2d/Collision/b2BroadPhase.h delete mode 100644 external/box2d/Collision/b2CollideCircle.cpp delete mode 100644 external/box2d/Collision/b2CollideEdge.cpp delete mode 100644 external/box2d/Collision/b2CollidePolygon.cpp delete mode 100644 external/box2d/Collision/b2Collision.cpp delete mode 100644 external/box2d/Collision/b2Collision.h delete mode 100644 external/box2d/Collision/b2Distance.cpp delete mode 100644 external/box2d/Collision/b2Distance.h delete mode 100644 external/box2d/Collision/b2DynamicTree.cpp delete mode 100644 external/box2d/Collision/b2DynamicTree.h delete mode 100644 external/box2d/Collision/b2TimeOfImpact.cpp delete mode 100644 external/box2d/Collision/b2TimeOfImpact.h delete mode 100644 external/box2d/Common/b2BlockAllocator.cpp delete mode 100644 external/box2d/Common/b2BlockAllocator.h delete mode 100644 external/box2d/Common/b2Draw.cpp delete mode 100644 external/box2d/Common/b2Draw.h delete mode 100644 external/box2d/Common/b2GrowableStack.h delete mode 100644 external/box2d/Common/b2Math.cpp delete mode 100644 external/box2d/Common/b2Math.h delete mode 100644 external/box2d/Common/b2Settings.cpp delete mode 100644 external/box2d/Common/b2Settings.h delete mode 100644 external/box2d/Common/b2StackAllocator.cpp delete mode 100644 external/box2d/Common/b2StackAllocator.h delete mode 100644 external/box2d/Common/b2Timer.cpp delete mode 100644 external/box2d/Common/b2Timer.h delete mode 100644 external/box2d/Dynamics/Contacts/b2ChainAndCircleContact.cpp delete mode 100644 external/box2d/Dynamics/Contacts/b2ChainAndCircleContact.h delete mode 100644 external/box2d/Dynamics/Contacts/b2ChainAndPolygonContact.cpp delete mode 100644 external/box2d/Dynamics/Contacts/b2ChainAndPolygonContact.h delete mode 100644 external/box2d/Dynamics/Contacts/b2CircleContact.cpp delete mode 100644 external/box2d/Dynamics/Contacts/b2CircleContact.h delete mode 100644 external/box2d/Dynamics/Contacts/b2Contact.cpp delete mode 100644 external/box2d/Dynamics/Contacts/b2Contact.h delete mode 100644 external/box2d/Dynamics/Contacts/b2ContactSolver.cpp delete mode 100644 external/box2d/Dynamics/Contacts/b2ContactSolver.h delete mode 100644 external/box2d/Dynamics/Contacts/b2EdgeAndCircleContact.cpp delete mode 100644 external/box2d/Dynamics/Contacts/b2EdgeAndCircleContact.h delete mode 100644 external/box2d/Dynamics/Contacts/b2EdgeAndPolygonContact.cpp delete mode 100644 external/box2d/Dynamics/Contacts/b2EdgeAndPolygonContact.h delete mode 100644 external/box2d/Dynamics/Contacts/b2PolygonAndCircleContact.cpp delete mode 100644 external/box2d/Dynamics/Contacts/b2PolygonAndCircleContact.h delete mode 100644 external/box2d/Dynamics/Contacts/b2PolygonContact.cpp delete mode 100644 external/box2d/Dynamics/Contacts/b2PolygonContact.h delete mode 100644 external/box2d/Dynamics/Joints/b2DistanceJoint.cpp delete mode 100644 external/box2d/Dynamics/Joints/b2DistanceJoint.h delete mode 100644 external/box2d/Dynamics/Joints/b2FrictionJoint.cpp delete mode 100644 external/box2d/Dynamics/Joints/b2FrictionJoint.h delete mode 100644 external/box2d/Dynamics/Joints/b2GearJoint.cpp delete mode 100644 external/box2d/Dynamics/Joints/b2GearJoint.h delete mode 100644 external/box2d/Dynamics/Joints/b2Joint.cpp delete mode 100644 external/box2d/Dynamics/Joints/b2Joint.h delete mode 100644 external/box2d/Dynamics/Joints/b2MouseJoint.cpp delete mode 100644 external/box2d/Dynamics/Joints/b2MouseJoint.h delete mode 100644 external/box2d/Dynamics/Joints/b2PrismaticJoint.cpp delete mode 100644 external/box2d/Dynamics/Joints/b2PrismaticJoint.h delete mode 100644 external/box2d/Dynamics/Joints/b2PulleyJoint.cpp delete mode 100644 external/box2d/Dynamics/Joints/b2PulleyJoint.h delete mode 100644 external/box2d/Dynamics/Joints/b2RevoluteJoint.cpp delete mode 100644 external/box2d/Dynamics/Joints/b2RevoluteJoint.h delete mode 100644 external/box2d/Dynamics/Joints/b2RopeJoint.cpp delete mode 100644 external/box2d/Dynamics/Joints/b2RopeJoint.h delete mode 100644 external/box2d/Dynamics/Joints/b2WeldJoint.cpp delete mode 100644 external/box2d/Dynamics/Joints/b2WeldJoint.h delete mode 100644 external/box2d/Dynamics/Joints/b2WheelJoint.cpp delete mode 100644 external/box2d/Dynamics/Joints/b2WheelJoint.h delete mode 100644 external/box2d/Dynamics/b2Body.cpp delete mode 100644 external/box2d/Dynamics/b2Body.h delete mode 100644 external/box2d/Dynamics/b2ContactManager.cpp delete mode 100644 external/box2d/Dynamics/b2ContactManager.h delete mode 100644 external/box2d/Dynamics/b2Fixture.cpp delete mode 100644 external/box2d/Dynamics/b2Fixture.h delete mode 100644 external/box2d/Dynamics/b2Island.cpp delete mode 100644 external/box2d/Dynamics/b2Island.h delete mode 100644 external/box2d/Dynamics/b2TimeStep.h delete mode 100644 external/box2d/Dynamics/b2World.cpp delete mode 100644 external/box2d/Dynamics/b2World.h delete mode 100644 external/box2d/Dynamics/b2WorldCallbacks.cpp delete mode 100644 external/box2d/Dynamics/b2WorldCallbacks.h delete mode 100644 external/box2d/Rope/b2Rope.cpp delete mode 100644 external/box2d/Rope/b2Rope.h delete mode 100644 external/box2d/proj.linux/.cproject delete mode 100644 external/box2d/proj.linux/.project delete mode 100644 external/box2d/proj.linux/Makefile delete mode 100644 external/box2d/proj.linux/box2d.prf delete mode 100644 external/box2d/proj.win32/Box2D.vcxproj delete mode 100644 external/box2d/proj.win32/Box2D.vcxproj.filters delete mode 100644 external/box2d/proj.win32/Box2D.vcxproj.user diff --git a/external/box2d/Android.mk b/external/box2d/Android.mk deleted file mode 100644 index c366750c01..0000000000 --- a/external/box2d/Android.mk +++ /dev/null @@ -1,60 +0,0 @@ -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) - -LOCAL_MODULE := box2d_static - -LOCAL_MODULE_FILENAME := libbox2d - -LOCAL_SRC_FILES := \ -Collision/b2BroadPhase.cpp \ -Collision/b2CollideCircle.cpp \ -Collision/b2CollideEdge.cpp \ -Collision/b2CollidePolygon.cpp \ -Collision/b2Collision.cpp \ -Collision/b2Distance.cpp \ -Collision/b2DynamicTree.cpp \ -Collision/b2TimeOfImpact.cpp \ -Collision/Shapes/b2ChainShape.cpp \ -Collision/Shapes/b2CircleShape.cpp \ -Collision/Shapes/b2EdgeShape.cpp \ -Collision/Shapes/b2PolygonShape.cpp \ -Common/b2BlockAllocator.cpp \ -Common/b2Draw.cpp \ -Common/b2Math.cpp \ -Common/b2Settings.cpp \ -Common/b2StackAllocator.cpp \ -Common/b2Timer.cpp \ -Dynamics/b2Body.cpp \ -Dynamics/b2ContactManager.cpp \ -Dynamics/b2Fixture.cpp \ -Dynamics/b2Island.cpp \ -Dynamics/b2World.cpp \ -Dynamics/b2WorldCallbacks.cpp \ -Dynamics/Contacts/b2ChainAndCircleContact.cpp \ -Dynamics/Contacts/b2ChainAndPolygonContact.cpp \ -Dynamics/Contacts/b2CircleContact.cpp \ -Dynamics/Contacts/b2Contact.cpp \ -Dynamics/Contacts/b2ContactSolver.cpp \ -Dynamics/Contacts/b2EdgeAndCircleContact.cpp \ -Dynamics/Contacts/b2EdgeAndPolygonContact.cpp \ -Dynamics/Contacts/b2PolygonAndCircleContact.cpp \ -Dynamics/Contacts/b2PolygonContact.cpp \ -Dynamics/Joints/b2DistanceJoint.cpp \ -Dynamics/Joints/b2FrictionJoint.cpp \ -Dynamics/Joints/b2GearJoint.cpp \ -Dynamics/Joints/b2Joint.cpp \ -Dynamics/Joints/b2MouseJoint.cpp \ -Dynamics/Joints/b2PrismaticJoint.cpp \ -Dynamics/Joints/b2PulleyJoint.cpp \ -Dynamics/Joints/b2RevoluteJoint.cpp \ -Dynamics/Joints/b2RopeJoint.cpp \ -Dynamics/Joints/b2WeldJoint.cpp \ -Dynamics/Joints/b2WheelJoint.cpp \ -Rope/b2Rope.cpp - -LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/.. - -LOCAL_C_INCLUDES := $(LOCAL_PATH)/.. - -include $(BUILD_STATIC_LIBRARY) diff --git a/external/box2d/Box2D.h b/external/box2d/Box2D.h deleted file mode 100644 index f674d82269..0000000000 --- a/external/box2d/Box2D.h +++ /dev/null @@ -1,67 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef BOX2D_H -#define BOX2D_H - -/** -\mainpage Box2D API Documentation - -\section intro_sec Getting Started - -For documentation please see http://box2d.org/documentation.html - -For discussion please visit http://box2d.org/forum -*/ - -// These include files constitute the main Box2D API - -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#endif diff --git a/external/box2d/Collision/Shapes/b2ChainShape.cpp b/external/box2d/Collision/Shapes/b2ChainShape.cpp deleted file mode 100644 index 79b4304b5b..0000000000 --- a/external/box2d/Collision/Shapes/b2ChainShape.cpp +++ /dev/null @@ -1,171 +0,0 @@ -/* -* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include -#include -using namespace std; - -b2ChainShape::~b2ChainShape() -{ - b2Free(m_vertices); - m_vertices = NULL; - m_count = 0; -} - -void b2ChainShape::CreateLoop(const b2Vec2* vertices, int32 count) -{ - b2Assert(m_vertices == NULL && m_count == 0); - b2Assert(count >= 3); - m_count = count + 1; - m_vertices = (b2Vec2*)b2Alloc(m_count * sizeof(b2Vec2)); - memcpy(m_vertices, vertices, count * sizeof(b2Vec2)); - m_vertices[count] = m_vertices[0]; - m_prevVertex = m_vertices[m_count - 2]; - m_nextVertex = m_vertices[1]; - m_hasPrevVertex = true; - m_hasNextVertex = true; -} - -void b2ChainShape::CreateChain(const b2Vec2* vertices, int32 count) -{ - b2Assert(m_vertices == NULL && m_count == 0); - b2Assert(count >= 2); - m_count = count; - m_vertices = (b2Vec2*)b2Alloc(count * sizeof(b2Vec2)); - memcpy(m_vertices, vertices, m_count * sizeof(b2Vec2)); - m_hasPrevVertex = false; - m_hasNextVertex = false; -} - -void b2ChainShape::SetPrevVertex(const b2Vec2& prevVertex) -{ - m_prevVertex = prevVertex; - m_hasPrevVertex = true; -} - -void b2ChainShape::SetNextVertex(const b2Vec2& nextVertex) -{ - m_nextVertex = nextVertex; - m_hasNextVertex = true; -} - -b2Shape* b2ChainShape::Clone(b2BlockAllocator* allocator) const -{ - void* mem = allocator->Allocate(sizeof(b2ChainShape)); - b2ChainShape* clone = new (mem) b2ChainShape; - clone->CreateChain(m_vertices, m_count); - clone->m_prevVertex = m_prevVertex; - clone->m_nextVertex = m_nextVertex; - clone->m_hasPrevVertex = m_hasPrevVertex; - clone->m_hasNextVertex = m_hasNextVertex; - return clone; -} - -int32 b2ChainShape::GetChildCount() const -{ - // edge count = vertex count - 1 - return m_count - 1; -} - -void b2ChainShape::GetChildEdge(b2EdgeShape* edge, int32 index) const -{ - b2Assert(0 <= index && index < m_count - 1); - edge->m_type = b2Shape::e_edge; - edge->m_radius = m_radius; - - edge->m_vertex1 = m_vertices[index + 0]; - edge->m_vertex2 = m_vertices[index + 1]; - - if (index > 0) - { - edge->m_vertex0 = m_vertices[index - 1]; - edge->m_hasVertex0 = true; - } - else - { - edge->m_vertex0 = m_prevVertex; - edge->m_hasVertex0 = m_hasPrevVertex; - } - - if (index < m_count - 2) - { - edge->m_vertex3 = m_vertices[index + 2]; - edge->m_hasVertex3 = true; - } - else - { - edge->m_vertex3 = m_nextVertex; - edge->m_hasVertex3 = m_hasNextVertex; - } -} - -bool b2ChainShape::TestPoint(const b2Transform& xf, const b2Vec2& p) const -{ - B2_NOT_USED(xf); - B2_NOT_USED(p); - return false; -} - -bool b2ChainShape::RayCast(b2RayCastOutput* output, const b2RayCastInput& input, - const b2Transform& xf, int32 childIndex) const -{ - b2Assert(childIndex < m_count); - - b2EdgeShape edgeShape; - - int32 i1 = childIndex; - int32 i2 = childIndex + 1; - if (i2 == m_count) - { - i2 = 0; - } - - edgeShape.m_vertex1 = m_vertices[i1]; - edgeShape.m_vertex2 = m_vertices[i2]; - - return edgeShape.RayCast(output, input, xf, 0); -} - -void b2ChainShape::ComputeAABB(b2AABB* aabb, const b2Transform& xf, int32 childIndex) const -{ - b2Assert(childIndex < m_count); - - int32 i1 = childIndex; - int32 i2 = childIndex + 1; - if (i2 == m_count) - { - i2 = 0; - } - - b2Vec2 v1 = b2Mul(xf, m_vertices[i1]); - b2Vec2 v2 = b2Mul(xf, m_vertices[i2]); - - aabb->lowerBound = b2Min(v1, v2); - aabb->upperBound = b2Max(v1, v2); -} - -void b2ChainShape::ComputeMass(b2MassData* massData, float32 density) const -{ - B2_NOT_USED(density); - - massData->mass = 0.0f; - massData->center.SetZero(); - massData->I = 0.0f; -} diff --git a/external/box2d/Collision/Shapes/b2ChainShape.h b/external/box2d/Collision/Shapes/b2ChainShape.h deleted file mode 100644 index 9c9a9eaa7d..0000000000 --- a/external/box2d/Collision/Shapes/b2ChainShape.h +++ /dev/null @@ -1,102 +0,0 @@ -/* -* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_CHAIN_SHAPE_H -#define B2_CHAIN_SHAPE_H - -#include - -class b2EdgeShape; - -/// A chain shape is a free form sequence of line segments. -/// The chain has two-sided collision, so you can use inside and outside collision. -/// Therefore, you may use any winding order. -/// Since there may be many vertices, they are allocated using b2Alloc. -/// Connectivity information is used to create smooth collisions. -/// WARNING: The chain will not collide properly if there are self-intersections. -class b2ChainShape : public b2Shape -{ -public: - b2ChainShape(); - - /// The destructor frees the vertices using b2Free. - ~b2ChainShape(); - - /// Create a loop. This automatically adjusts connectivity. - /// @param vertices an array of vertices, these are copied - /// @param count the vertex count - void CreateLoop(const b2Vec2* vertices, int32 count); - - /// Create a chain with isolated end vertices. - /// @param vertices an array of vertices, these are copied - /// @param count the vertex count - void CreateChain(const b2Vec2* vertices, int32 count); - - /// Establish connectivity to a vertex that precedes the first vertex. - /// Don't call this for loops. - void SetPrevVertex(const b2Vec2& prevVertex); - - /// Establish connectivity to a vertex that follows the last vertex. - /// Don't call this for loops. - void SetNextVertex(const b2Vec2& nextVertex); - - /// Implement b2Shape. Vertices are cloned using b2Alloc. - b2Shape* Clone(b2BlockAllocator* allocator) const; - - /// @see b2Shape::GetChildCount - int32 GetChildCount() const; - - /// Get a child edge. - void GetChildEdge(b2EdgeShape* edge, int32 index) const; - - /// This always return false. - /// @see b2Shape::TestPoint - bool TestPoint(const b2Transform& transform, const b2Vec2& p) const; - - /// Implement b2Shape. - bool RayCast(b2RayCastOutput* output, const b2RayCastInput& input, - const b2Transform& transform, int32 childIndex) const; - - /// @see b2Shape::ComputeAABB - void ComputeAABB(b2AABB* aabb, const b2Transform& transform, int32 childIndex) const; - - /// Chains have zero mass. - /// @see b2Shape::ComputeMass - void ComputeMass(b2MassData* massData, float32 density) const; - - /// The vertices. Owned by this class. - b2Vec2* m_vertices; - - /// The vertex count. - int32 m_count; - - b2Vec2 m_prevVertex, m_nextVertex; - bool m_hasPrevVertex, m_hasNextVertex; -}; - -inline b2ChainShape::b2ChainShape() -{ - m_type = e_chain; - m_radius = b2_polygonRadius; - m_vertices = NULL; - m_count = 0; - m_hasPrevVertex = false; - m_hasNextVertex = false; -} - -#endif diff --git a/external/box2d/Collision/Shapes/b2CircleShape.cpp b/external/box2d/Collision/Shapes/b2CircleShape.cpp deleted file mode 100644 index 587ca960b2..0000000000 --- a/external/box2d/Collision/Shapes/b2CircleShape.cpp +++ /dev/null @@ -1,100 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -using namespace std; - -b2Shape* b2CircleShape::Clone(b2BlockAllocator* allocator) const -{ - void* mem = allocator->Allocate(sizeof(b2CircleShape)); - b2CircleShape* clone = new (mem) b2CircleShape; - *clone = *this; - return clone; -} - -int32 b2CircleShape::GetChildCount() const -{ - return 1; -} - -bool b2CircleShape::TestPoint(const b2Transform& transform, const b2Vec2& p) const -{ - b2Vec2 center = transform.p + b2Mul(transform.q, m_p); - b2Vec2 d = p - center; - return b2Dot(d, d) <= m_radius * m_radius; -} - -// Collision Detection in Interactive 3D Environments by Gino van den Bergen -// From Section 3.1.2 -// x = s + a * r -// norm(x) = radius -bool b2CircleShape::RayCast(b2RayCastOutput* output, const b2RayCastInput& input, - const b2Transform& transform, int32 childIndex) const -{ - B2_NOT_USED(childIndex); - - b2Vec2 position = transform.p + b2Mul(transform.q, m_p); - b2Vec2 s = input.p1 - position; - float32 b = b2Dot(s, s) - m_radius * m_radius; - - // Solve quadratic equation. - b2Vec2 r = input.p2 - input.p1; - float32 c = b2Dot(s, r); - float32 rr = b2Dot(r, r); - float32 sigma = c * c - rr * b; - - // Check for negative discriminant and short segment. - if (sigma < 0.0f || rr < b2_epsilon) - { - return false; - } - - // Find the point of intersection of the line with the circle. - float32 a = -(c + b2Sqrt(sigma)); - - // Is the intersection point on the segment? - if (0.0f <= a && a <= input.maxFraction * rr) - { - a /= rr; - output->fraction = a; - output->normal = s + a * r; - output->normal.Normalize(); - return true; - } - - return false; -} - -void b2CircleShape::ComputeAABB(b2AABB* aabb, const b2Transform& transform, int32 childIndex) const -{ - B2_NOT_USED(childIndex); - - b2Vec2 p = transform.p + b2Mul(transform.q, m_p); - aabb->lowerBound.Set(p.x - m_radius, p.y - m_radius); - aabb->upperBound.Set(p.x + m_radius, p.y + m_radius); -} - -void b2CircleShape::ComputeMass(b2MassData* massData, float32 density) const -{ - massData->mass = density * b2_pi * m_radius * m_radius; - massData->center = m_p; - - // inertia about the local origin - massData->I = massData->mass * (0.5f * m_radius * m_radius + b2Dot(m_p, m_p)); -} diff --git a/external/box2d/Collision/Shapes/b2CircleShape.h b/external/box2d/Collision/Shapes/b2CircleShape.h deleted file mode 100644 index c4e23a475b..0000000000 --- a/external/box2d/Collision/Shapes/b2CircleShape.h +++ /dev/null @@ -1,91 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_CIRCLE_SHAPE_H -#define B2_CIRCLE_SHAPE_H - -#include - -/// A circle shape. -class b2CircleShape : public b2Shape -{ -public: - b2CircleShape(); - - /// Implement b2Shape. - b2Shape* Clone(b2BlockAllocator* allocator) const; - - /// @see b2Shape::GetChildCount - int32 GetChildCount() const; - - /// Implement b2Shape. - bool TestPoint(const b2Transform& transform, const b2Vec2& p) const; - - /// Implement b2Shape. - bool RayCast(b2RayCastOutput* output, const b2RayCastInput& input, - const b2Transform& transform, int32 childIndex) const; - - /// @see b2Shape::ComputeAABB - void ComputeAABB(b2AABB* aabb, const b2Transform& transform, int32 childIndex) const; - - /// @see b2Shape::ComputeMass - void ComputeMass(b2MassData* massData, float32 density) const; - - /// Get the supporting vertex index in the given direction. - int32 GetSupport(const b2Vec2& d) const; - - /// Get the supporting vertex in the given direction. - const b2Vec2& GetSupportVertex(const b2Vec2& d) const; - - /// Get the vertex count. - int32 GetVertexCount() const { return 1; } - - /// Get a vertex by index. Used by b2Distance. - const b2Vec2& GetVertex(int32 index) const; - - /// Position - b2Vec2 m_p; -}; - -inline b2CircleShape::b2CircleShape() -{ - m_type = e_circle; - m_radius = 0.0f; - m_p.SetZero(); -} - -inline int32 b2CircleShape::GetSupport(const b2Vec2 &d) const -{ - B2_NOT_USED(d); - return 0; -} - -inline const b2Vec2& b2CircleShape::GetSupportVertex(const b2Vec2 &d) const -{ - B2_NOT_USED(d); - return m_p; -} - -inline const b2Vec2& b2CircleShape::GetVertex(int32 index) const -{ - B2_NOT_USED(index); - b2Assert(index == 0); - return m_p; -} - -#endif diff --git a/external/box2d/Collision/Shapes/b2EdgeShape.cpp b/external/box2d/Collision/Shapes/b2EdgeShape.cpp deleted file mode 100644 index 7b09e55bf4..0000000000 --- a/external/box2d/Collision/Shapes/b2EdgeShape.cpp +++ /dev/null @@ -1,139 +0,0 @@ -/* -* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -using namespace std; - -void b2EdgeShape::Set(const b2Vec2& v1, const b2Vec2& v2) -{ - m_vertex1 = v1; - m_vertex2 = v2; - m_hasVertex0 = false; - m_hasVertex3 = false; -} - -b2Shape* b2EdgeShape::Clone(b2BlockAllocator* allocator) const -{ - void* mem = allocator->Allocate(sizeof(b2EdgeShape)); - b2EdgeShape* clone = new (mem) b2EdgeShape; - *clone = *this; - return clone; -} - -int32 b2EdgeShape::GetChildCount() const -{ - return 1; -} - -bool b2EdgeShape::TestPoint(const b2Transform& xf, const b2Vec2& p) const -{ - B2_NOT_USED(xf); - B2_NOT_USED(p); - return false; -} - -// p = p1 + t * d -// v = v1 + s * e -// p1 + t * d = v1 + s * e -// s * e - t * d = p1 - v1 -bool b2EdgeShape::RayCast(b2RayCastOutput* output, const b2RayCastInput& input, - const b2Transform& xf, int32 childIndex) const -{ - B2_NOT_USED(childIndex); - - // Put the ray into the edge's frame of reference. - b2Vec2 p1 = b2MulT(xf.q, input.p1 - xf.p); - b2Vec2 p2 = b2MulT(xf.q, input.p2 - xf.p); - b2Vec2 d = p2 - p1; - - b2Vec2 v1 = m_vertex1; - b2Vec2 v2 = m_vertex2; - b2Vec2 e = v2 - v1; - b2Vec2 normal(e.y, -e.x); - normal.Normalize(); - - // q = p1 + t * d - // dot(normal, q - v1) = 0 - // dot(normal, p1 - v1) + t * dot(normal, d) = 0 - float32 numerator = b2Dot(normal, v1 - p1); - float32 denominator = b2Dot(normal, d); - - if (denominator == 0.0f) - { - return false; - } - - float32 t = numerator / denominator; - if (t < 0.0f || input.maxFraction < t) - { - return false; - } - - b2Vec2 q = p1 + t * d; - - // q = v1 + s * r - // s = dot(q - v1, r) / dot(r, r) - b2Vec2 r = v2 - v1; - float32 rr = b2Dot(r, r); - if (rr == 0.0f) - { - return false; - } - - float32 s = b2Dot(q - v1, r) / rr; - if (s < 0.0f || 1.0f < s) - { - return false; - } - - output->fraction = t; - if (numerator > 0.0f) - { - output->normal = -normal; - } - else - { - output->normal = normal; - } - return true; -} - -void b2EdgeShape::ComputeAABB(b2AABB* aabb, const b2Transform& xf, int32 childIndex) const -{ - B2_NOT_USED(childIndex); - - b2Vec2 v1 = b2Mul(xf, m_vertex1); - b2Vec2 v2 = b2Mul(xf, m_vertex2); - - b2Vec2 lower = b2Min(v1, v2); - b2Vec2 upper = b2Max(v1, v2); - - b2Vec2 r(m_radius, m_radius); - aabb->lowerBound = lower - r; - aabb->upperBound = upper + r; -} - -void b2EdgeShape::ComputeMass(b2MassData* massData, float32 density) const -{ - B2_NOT_USED(density); - - massData->mass = 0.0f; - massData->center = 0.5f * (m_vertex1 + m_vertex2); - massData->I = 0.0f; -} diff --git a/external/box2d/Collision/Shapes/b2EdgeShape.h b/external/box2d/Collision/Shapes/b2EdgeShape.h deleted file mode 100644 index 6163bcbf1c..0000000000 --- a/external/box2d/Collision/Shapes/b2EdgeShape.h +++ /dev/null @@ -1,74 +0,0 @@ -/* -* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_EDGE_SHAPE_H -#define B2_EDGE_SHAPE_H - -#include - -/// A line segment (edge) shape. These can be connected in chains or loops -/// to other edge shapes. The connectivity information is used to ensure -/// correct contact normals. -class b2EdgeShape : public b2Shape -{ -public: - b2EdgeShape(); - - /// Set this as an isolated edge. - void Set(const b2Vec2& v1, const b2Vec2& v2); - - /// Implement b2Shape. - b2Shape* Clone(b2BlockAllocator* allocator) const; - - /// @see b2Shape::GetChildCount - int32 GetChildCount() const; - - /// @see b2Shape::TestPoint - bool TestPoint(const b2Transform& transform, const b2Vec2& p) const; - - /// Implement b2Shape. - bool RayCast(b2RayCastOutput* output, const b2RayCastInput& input, - const b2Transform& transform, int32 childIndex) const; - - /// @see b2Shape::ComputeAABB - void ComputeAABB(b2AABB* aabb, const b2Transform& transform, int32 childIndex) const; - - /// @see b2Shape::ComputeMass - void ComputeMass(b2MassData* massData, float32 density) const; - - /// These are the edge vertices - b2Vec2 m_vertex1, m_vertex2; - - /// Optional adjacent vertices. These are used for smooth collision. - b2Vec2 m_vertex0, m_vertex3; - bool m_hasVertex0, m_hasVertex3; -}; - -inline b2EdgeShape::b2EdgeShape() -{ - m_type = e_edge; - m_radius = b2_polygonRadius; - m_vertex0.x = 0.0f; - m_vertex0.y = 0.0f; - m_vertex3.x = 0.0f; - m_vertex3.y = 0.0f; - m_hasVertex0 = false; - m_hasVertex3 = false; -} - -#endif diff --git a/external/box2d/Collision/Shapes/b2PolygonShape.cpp b/external/box2d/Collision/Shapes/b2PolygonShape.cpp deleted file mode 100644 index c04c1dc49b..0000000000 --- a/external/box2d/Collision/Shapes/b2PolygonShape.cpp +++ /dev/null @@ -1,361 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include - -b2Shape* b2PolygonShape::Clone(b2BlockAllocator* allocator) const -{ - void* mem = allocator->Allocate(sizeof(b2PolygonShape)); - b2PolygonShape* clone = new (mem) b2PolygonShape; - *clone = *this; - return clone; -} - -void b2PolygonShape::SetAsBox(float32 hx, float32 hy) -{ - m_vertexCount = 4; - m_vertices[0].Set(-hx, -hy); - m_vertices[1].Set( hx, -hy); - m_vertices[2].Set( hx, hy); - m_vertices[3].Set(-hx, hy); - m_normals[0].Set(0.0f, -1.0f); - m_normals[1].Set(1.0f, 0.0f); - m_normals[2].Set(0.0f, 1.0f); - m_normals[3].Set(-1.0f, 0.0f); - m_centroid.SetZero(); -} - -void b2PolygonShape::SetAsBox(float32 hx, float32 hy, const b2Vec2& center, float32 angle) -{ - m_vertexCount = 4; - m_vertices[0].Set(-hx, -hy); - m_vertices[1].Set( hx, -hy); - m_vertices[2].Set( hx, hy); - m_vertices[3].Set(-hx, hy); - m_normals[0].Set(0.0f, -1.0f); - m_normals[1].Set(1.0f, 0.0f); - m_normals[2].Set(0.0f, 1.0f); - m_normals[3].Set(-1.0f, 0.0f); - m_centroid = center; - - b2Transform xf; - xf.p = center; - xf.q.Set(angle); - - // Transform vertices and normals. - for (int32 i = 0; i < m_vertexCount; ++i) - { - m_vertices[i] = b2Mul(xf, m_vertices[i]); - m_normals[i] = b2Mul(xf.q, m_normals[i]); - } -} - -int32 b2PolygonShape::GetChildCount() const -{ - return 1; -} - -static b2Vec2 ComputeCentroid(const b2Vec2* vs, int32 count) -{ - b2Assert(count >= 3); - - b2Vec2 c; c.Set(0.0f, 0.0f); - float32 area = 0.0f; - - // pRef is the reference point for forming triangles. - // It's location doesn't change the result (except for rounding error). - b2Vec2 pRef(0.0f, 0.0f); -#if 0 - // This code would put the reference point inside the polygon. - for (int32 i = 0; i < count; ++i) - { - pRef += vs[i]; - } - pRef *= 1.0f / count; -#endif - - const float32 inv3 = 1.0f / 3.0f; - - for (int32 i = 0; i < count; ++i) - { - // Triangle vertices. - b2Vec2 p1 = pRef; - b2Vec2 p2 = vs[i]; - b2Vec2 p3 = i + 1 < count ? vs[i+1] : vs[0]; - - b2Vec2 e1 = p2 - p1; - b2Vec2 e2 = p3 - p1; - - float32 D = b2Cross(e1, e2); - - float32 triangleArea = 0.5f * D; - area += triangleArea; - - // Area weighted centroid - c += triangleArea * inv3 * (p1 + p2 + p3); - } - - // Centroid - b2Assert(area > b2_epsilon); - c *= 1.0f / area; - return c; -} - -void b2PolygonShape::Set(const b2Vec2* vertices, int32 count) -{ - b2Assert(3 <= count && count <= b2_maxPolygonVertices); - m_vertexCount = count; - - // Copy vertices. - for (int32 i = 0; i < m_vertexCount; ++i) - { - m_vertices[i] = vertices[i]; - } - - // Compute normals. Ensure the edges have non-zero length. - for (int32 i = 0; i < m_vertexCount; ++i) - { - int32 i1 = i; - int32 i2 = i + 1 < m_vertexCount ? i + 1 : 0; - b2Vec2 edge = m_vertices[i2] - m_vertices[i1]; - b2Assert(edge.LengthSquared() > b2_epsilon * b2_epsilon); - m_normals[i] = b2Cross(edge, 1.0f); - m_normals[i].Normalize(); - } - -#ifdef _DEBUG - // Ensure the polygon is convex and the interior - // is to the left of each edge. - for (int32 i = 0; i < m_vertexCount; ++i) - { - int32 i1 = i; - int32 i2 = i + 1 < m_vertexCount ? i + 1 : 0; - b2Vec2 edge = m_vertices[i2] - m_vertices[i1]; - - for (int32 j = 0; j < m_vertexCount; ++j) - { - // Don't check vertices on the current edge. - if (j == i1 || j == i2) - { - continue; - } - - b2Vec2 r = m_vertices[j] - m_vertices[i1]; - - // If this crashes, your polygon is non-convex, has colinear edges, - // or the winding order is wrong. - float32 s = b2Cross(edge, r); - b2Assert(s > 0.0f && "ERROR: Please ensure your polygon is convex and has a CCW winding order"); - } - } -#endif - - // Compute the polygon centroid. - m_centroid = ComputeCentroid(m_vertices, m_vertexCount); -} - -bool b2PolygonShape::TestPoint(const b2Transform& xf, const b2Vec2& p) const -{ - b2Vec2 pLocal = b2MulT(xf.q, p - xf.p); - - for (int32 i = 0; i < m_vertexCount; ++i) - { - float32 dot = b2Dot(m_normals[i], pLocal - m_vertices[i]); - if (dot > 0.0f) - { - return false; - } - } - - return true; -} - -bool b2PolygonShape::RayCast(b2RayCastOutput* output, const b2RayCastInput& input, - const b2Transform& xf, int32 childIndex) const -{ - B2_NOT_USED(childIndex); - - // Put the ray into the polygon's frame of reference. - b2Vec2 p1 = b2MulT(xf.q, input.p1 - xf.p); - b2Vec2 p2 = b2MulT(xf.q, input.p2 - xf.p); - b2Vec2 d = p2 - p1; - - float32 lower = 0.0f, upper = input.maxFraction; - - int32 index = -1; - - for (int32 i = 0; i < m_vertexCount; ++i) - { - // p = p1 + a * d - // dot(normal, p - v) = 0 - // dot(normal, p1 - v) + a * dot(normal, d) = 0 - float32 numerator = b2Dot(m_normals[i], m_vertices[i] - p1); - float32 denominator = b2Dot(m_normals[i], d); - - if (denominator == 0.0f) - { - if (numerator < 0.0f) - { - return false; - } - } - else - { - // Note: we want this predicate without division: - // lower < numerator / denominator, where denominator < 0 - // Since denominator < 0, we have to flip the inequality: - // lower < numerator / denominator <==> denominator * lower > numerator. - if (denominator < 0.0f && numerator < lower * denominator) - { - // Increase lower. - // The segment enters this half-space. - lower = numerator / denominator; - index = i; - } - else if (denominator > 0.0f && numerator < upper * denominator) - { - // Decrease upper. - // The segment exits this half-space. - upper = numerator / denominator; - } - } - - // The use of epsilon here causes the assert on lower to trip - // in some cases. Apparently the use of epsilon was to make edge - // shapes work, but now those are handled separately. - //if (upper < lower - b2_epsilon) - if (upper < lower) - { - return false; - } - } - - b2Assert(0.0f <= lower && lower <= input.maxFraction); - - if (index >= 0) - { - output->fraction = lower; - output->normal = b2Mul(xf.q, m_normals[index]); - return true; - } - - return false; -} - -void b2PolygonShape::ComputeAABB(b2AABB* aabb, const b2Transform& xf, int32 childIndex) const -{ - B2_NOT_USED(childIndex); - - b2Vec2 lower = b2Mul(xf, m_vertices[0]); - b2Vec2 upper = lower; - - for (int32 i = 1; i < m_vertexCount; ++i) - { - b2Vec2 v = b2Mul(xf, m_vertices[i]); - lower = b2Min(lower, v); - upper = b2Max(upper, v); - } - - b2Vec2 r(m_radius, m_radius); - aabb->lowerBound = lower - r; - aabb->upperBound = upper + r; -} - -void b2PolygonShape::ComputeMass(b2MassData* massData, float32 density) const -{ - // Polygon mass, centroid, and inertia. - // Let rho be the polygon density in mass per unit area. - // Then: - // mass = rho * int(dA) - // centroid.x = (1/mass) * rho * int(x * dA) - // centroid.y = (1/mass) * rho * int(y * dA) - // I = rho * int((x*x + y*y) * dA) - // - // We can compute these integrals by summing all the integrals - // for each triangle of the polygon. To evaluate the integral - // for a single triangle, we make a change of variables to - // the (u,v) coordinates of the triangle: - // x = x0 + e1x * u + e2x * v - // y = y0 + e1y * u + e2y * v - // where 0 <= u && 0 <= v && u + v <= 1. - // - // We integrate u from [0,1-v] and then v from [0,1]. - // We also need to use the Jacobian of the transformation: - // D = cross(e1, e2) - // - // Simplification: triangle centroid = (1/3) * (p1 + p2 + p3) - // - // The rest of the derivation is handled by computer algebra. - - b2Assert(m_vertexCount >= 3); - - b2Vec2 center; center.Set(0.0f, 0.0f); - float32 area = 0.0f; - float32 I = 0.0f; - - // s is the reference point for forming triangles. - // It's location doesn't change the result (except for rounding error). - b2Vec2 s(0.0f, 0.0f); - - // This code would put the reference point inside the polygon. - for (int32 i = 0; i < m_vertexCount; ++i) - { - s += m_vertices[i]; - } - s *= 1.0f / m_vertexCount; - - const float32 k_inv3 = 1.0f / 3.0f; - - for (int32 i = 0; i < m_vertexCount; ++i) - { - // Triangle vertices. - b2Vec2 e1 = m_vertices[i] - s; - b2Vec2 e2 = i + 1 < m_vertexCount ? m_vertices[i+1] - s : m_vertices[0] - s; - - float32 D = b2Cross(e1, e2); - - float32 triangleArea = 0.5f * D; - area += triangleArea; - - // Area weighted centroid - center += triangleArea * k_inv3 * (e1 + e2); - - float32 ex1 = e1.x, ey1 = e1.y; - float32 ex2 = e2.x, ey2 = e2.y; - - float32 intx2 = ex1*ex1 + ex2*ex1 + ex2*ex2; - float32 inty2 = ey1*ey1 + ey2*ey1 + ey2*ey2; - - I += (0.25f * k_inv3 * D) * (intx2 + inty2); - } - - // Total mass - massData->mass = density * area; - - // Center of mass - b2Assert(area > b2_epsilon); - center *= 1.0f / area; - massData->center = center + s; - - // Inertia tensor relative to the local origin (point s). - massData->I = density * I; - - // Shift to center of mass then to original body origin. - massData->I += massData->mass * (b2Dot(massData->center, massData->center) - b2Dot(center, center)); -} diff --git a/external/box2d/Collision/Shapes/b2PolygonShape.h b/external/box2d/Collision/Shapes/b2PolygonShape.h deleted file mode 100644 index 70daccb2ff..0000000000 --- a/external/box2d/Collision/Shapes/b2PolygonShape.h +++ /dev/null @@ -1,95 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_POLYGON_SHAPE_H -#define B2_POLYGON_SHAPE_H - -#include - -/// A convex polygon. It is assumed that the interior of the polygon is to -/// the left of each edge. -/// Polygons have a maximum number of vertices equal to b2_maxPolygonVertices. -/// In most cases you should not need many vertices for a convex polygon. -class b2PolygonShape : public b2Shape -{ -public: - b2PolygonShape(); - - /// Implement b2Shape. - b2Shape* Clone(b2BlockAllocator* allocator) const; - - /// @see b2Shape::GetChildCount - int32 GetChildCount() const; - - /// Copy vertices. This assumes the vertices define a convex polygon. - /// It is assumed that the exterior is the the right of each edge. - /// The count must be in the range [3, b2_maxPolygonVertices]. - void Set(const b2Vec2* vertices, int32 vertexCount); - - /// Build vertices to represent an axis-aligned box. - /// @param hx the half-width. - /// @param hy the half-height. - void SetAsBox(float32 hx, float32 hy); - - /// Build vertices to represent an oriented box. - /// @param hx the half-width. - /// @param hy the half-height. - /// @param center the center of the box in local coordinates. - /// @param angle the rotation of the box in local coordinates. - void SetAsBox(float32 hx, float32 hy, const b2Vec2& center, float32 angle); - - /// @see b2Shape::TestPoint - bool TestPoint(const b2Transform& transform, const b2Vec2& p) const; - - /// Implement b2Shape. - bool RayCast(b2RayCastOutput* output, const b2RayCastInput& input, - const b2Transform& transform, int32 childIndex) const; - - /// @see b2Shape::ComputeAABB - void ComputeAABB(b2AABB* aabb, const b2Transform& transform, int32 childIndex) const; - - /// @see b2Shape::ComputeMass - void ComputeMass(b2MassData* massData, float32 density) const; - - /// Get the vertex count. - int32 GetVertexCount() const { return m_vertexCount; } - - /// Get a vertex by index. - const b2Vec2& GetVertex(int32 index) const; - - b2Vec2 m_centroid; - b2Vec2 m_vertices[b2_maxPolygonVertices]; - b2Vec2 m_normals[b2_maxPolygonVertices]; - int32 m_vertexCount; -}; - -inline b2PolygonShape::b2PolygonShape() -{ - m_type = e_polygon; - m_radius = b2_polygonRadius; - m_vertexCount = 0; - m_centroid.SetZero(); -} - -inline const b2Vec2& b2PolygonShape::GetVertex(int32 index) const -{ - b2Assert(0 <= index && index < m_vertexCount); - return m_vertices[index]; -} - -#endif diff --git a/external/box2d/Collision/Shapes/b2Shape.h b/external/box2d/Collision/Shapes/b2Shape.h deleted file mode 100644 index 2e2aedd14a..0000000000 --- a/external/box2d/Collision/Shapes/b2Shape.h +++ /dev/null @@ -1,101 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_SHAPE_H -#define B2_SHAPE_H - -#include -#include -#include - -/// This holds the mass data computed for a shape. -struct b2MassData -{ - /// The mass of the shape, usually in kilograms. - float32 mass; - - /// The position of the shape's centroid relative to the shape's origin. - b2Vec2 center; - - /// The rotational inertia of the shape about the local origin. - float32 I; -}; - -/// A shape is used for collision detection. You can create a shape however you like. -/// Shapes used for simulation in b2World are created automatically when a b2Fixture -/// is created. Shapes may encapsulate a one or more child shapes. -class b2Shape -{ -public: - - enum Type - { - e_circle = 0, - e_edge = 1, - e_polygon = 2, - e_chain = 3, - e_typeCount = 4 - }; - - virtual ~b2Shape() {} - - /// Clone the concrete shape using the provided allocator. - virtual b2Shape* Clone(b2BlockAllocator* allocator) const = 0; - - /// Get the type of this shape. You can use this to down cast to the concrete shape. - /// @return the shape type. - Type GetType() const; - - /// Get the number of child primitives. - virtual int32 GetChildCount() const = 0; - - /// Test a point for containment in this shape. This only works for convex shapes. - /// @param xf the shape world transform. - /// @param p a point in world coordinates. - virtual bool TestPoint(const b2Transform& xf, const b2Vec2& p) const = 0; - - /// Cast a ray against a child shape. - /// @param output the ray-cast results. - /// @param input the ray-cast input parameters. - /// @param transform the transform to be applied to the shape. - /// @param childIndex the child shape index - virtual bool RayCast(b2RayCastOutput* output, const b2RayCastInput& input, - const b2Transform& transform, int32 childIndex) const = 0; - - /// Given a transform, compute the associated axis aligned bounding box for a child shape. - /// @param aabb returns the axis aligned box. - /// @param xf the world transform of the shape. - /// @param childIndex the child shape - virtual void ComputeAABB(b2AABB* aabb, const b2Transform& xf, int32 childIndex) const = 0; - - /// Compute the mass properties of this shape using its dimensions and density. - /// The inertia tensor is computed about the local origin. - /// @param massData returns the mass data for this shape. - /// @param density the density in kilograms per meter squared. - virtual void ComputeMass(b2MassData* massData, float32 density) const = 0; - - Type m_type; - float32 m_radius; -}; - -inline b2Shape::Type b2Shape::GetType() const -{ - return m_type; -} - -#endif diff --git a/external/box2d/Collision/b2BroadPhase.cpp b/external/box2d/Collision/b2BroadPhase.cpp deleted file mode 100644 index 431f6de1ee..0000000000 --- a/external/box2d/Collision/b2BroadPhase.cpp +++ /dev/null @@ -1,122 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -using namespace std; - -b2BroadPhase::b2BroadPhase() -{ - m_proxyCount = 0; - - m_pairCapacity = 16; - m_pairCount = 0; - m_pairBuffer = (b2Pair*)b2Alloc(m_pairCapacity * sizeof(b2Pair)); - - m_moveCapacity = 16; - m_moveCount = 0; - m_moveBuffer = (int32*)b2Alloc(m_moveCapacity * sizeof(int32)); -} - -b2BroadPhase::~b2BroadPhase() -{ - b2Free(m_moveBuffer); - b2Free(m_pairBuffer); -} - -int32 b2BroadPhase::CreateProxy(const b2AABB& aabb, void* userData) -{ - int32 proxyId = m_tree.CreateProxy(aabb, userData); - ++m_proxyCount; - BufferMove(proxyId); - return proxyId; -} - -void b2BroadPhase::DestroyProxy(int32 proxyId) -{ - UnBufferMove(proxyId); - --m_proxyCount; - m_tree.DestroyProxy(proxyId); -} - -void b2BroadPhase::MoveProxy(int32 proxyId, const b2AABB& aabb, const b2Vec2& displacement) -{ - bool buffer = m_tree.MoveProxy(proxyId, aabb, displacement); - if (buffer) - { - BufferMove(proxyId); - } -} - -void b2BroadPhase::TouchProxy(int32 proxyId) -{ - BufferMove(proxyId); -} - -void b2BroadPhase::BufferMove(int32 proxyId) -{ - if (m_moveCount == m_moveCapacity) - { - int32* oldBuffer = m_moveBuffer; - m_moveCapacity *= 2; - m_moveBuffer = (int32*)b2Alloc(m_moveCapacity * sizeof(int32)); - memcpy(m_moveBuffer, oldBuffer, m_moveCount * sizeof(int32)); - b2Free(oldBuffer); - } - - m_moveBuffer[m_moveCount] = proxyId; - ++m_moveCount; -} - -void b2BroadPhase::UnBufferMove(int32 proxyId) -{ - for (int32 i = 0; i < m_moveCount; ++i) - { - if (m_moveBuffer[i] == proxyId) - { - m_moveBuffer[i] = e_nullProxy; - return; - } - } -} - -// This is called from b2DynamicTree::Query when we are gathering pairs. -bool b2BroadPhase::QueryCallback(int32 proxyId) -{ - // A proxy cannot form a pair with itself. - if (proxyId == m_queryProxyId) - { - return true; - } - - // Grow the pair buffer as needed. - if (m_pairCount == m_pairCapacity) - { - b2Pair* oldBuffer = m_pairBuffer; - m_pairCapacity *= 2; - m_pairBuffer = (b2Pair*)b2Alloc(m_pairCapacity * sizeof(b2Pair)); - memcpy(m_pairBuffer, oldBuffer, m_pairCount * sizeof(b2Pair)); - b2Free(oldBuffer); - } - - m_pairBuffer[m_pairCount].proxyIdA = b2Min(proxyId, m_queryProxyId); - m_pairBuffer[m_pairCount].proxyIdB = b2Max(proxyId, m_queryProxyId); - ++m_pairCount; - - return true; -} diff --git a/external/box2d/Collision/b2BroadPhase.h b/external/box2d/Collision/b2BroadPhase.h deleted file mode 100644 index cf2414730a..0000000000 --- a/external/box2d/Collision/b2BroadPhase.h +++ /dev/null @@ -1,248 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_BROAD_PHASE_H -#define B2_BROAD_PHASE_H - -#include -#include -#include -#include - -struct b2Pair -{ - int32 proxyIdA; - int32 proxyIdB; - int32 next; -}; - -/// The broad-phase is used for computing pairs and performing volume queries and ray casts. -/// This broad-phase does not persist pairs. Instead, this reports potentially new pairs. -/// It is up to the client to consume the new pairs and to track subsequent overlap. -class b2BroadPhase -{ -public: - - enum - { - e_nullProxy = -1 - }; - - b2BroadPhase(); - ~b2BroadPhase(); - - /// Create a proxy with an initial AABB. Pairs are not reported until - /// UpdatePairs is called. - int32 CreateProxy(const b2AABB& aabb, void* userData); - - /// Destroy a proxy. It is up to the client to remove any pairs. - void DestroyProxy(int32 proxyId); - - /// Call MoveProxy as many times as you like, then when you are done - /// call UpdatePairs to finalized the proxy pairs (for your time step). - void MoveProxy(int32 proxyId, const b2AABB& aabb, const b2Vec2& displacement); - - /// Call to trigger a re-processing of it's pairs on the next call to UpdatePairs. - void TouchProxy(int32 proxyId); - - /// Get the fat AABB for a proxy. - const b2AABB& GetFatAABB(int32 proxyId) const; - - /// Get user data from a proxy. Returns NULL if the id is invalid. - void* GetUserData(int32 proxyId) const; - - /// Test overlap of fat AABBs. - bool TestOverlap(int32 proxyIdA, int32 proxyIdB) const; - - /// Get the number of proxies. - int32 GetProxyCount() const; - - /// Update the pairs. This results in pair callbacks. This can only add pairs. - template - void UpdatePairs(T* callback); - - /// Query an AABB for overlapping proxies. The callback class - /// is called for each proxy that overlaps the supplied AABB. - template - void Query(T* callback, const b2AABB& aabb) const; - - /// Ray-cast against the proxies in the tree. This relies on the callback - /// to perform a exact ray-cast in the case were the proxy contains a shape. - /// The callback also performs the any collision filtering. This has performance - /// roughly equal to k * log(n), where k is the number of collisions and n is the - /// number of proxies in the tree. - /// @param input the ray-cast input data. The ray extends from p1 to p1 + maxFraction * (p2 - p1). - /// @param callback a callback class that is called for each proxy that is hit by the ray. - template - void RayCast(T* callback, const b2RayCastInput& input) const; - - /// Get the height of the embedded tree. - int32 GetTreeHeight() const; - - /// Get the balance of the embedded tree. - int32 GetTreeBalance() const; - - /// Get the quality metric of the embedded tree. - float32 GetTreeQuality() const; - -private: - - friend class b2DynamicTree; - - void BufferMove(int32 proxyId); - void UnBufferMove(int32 proxyId); - - bool QueryCallback(int32 proxyId); - - b2DynamicTree m_tree; - - int32 m_proxyCount; - - int32* m_moveBuffer; - int32 m_moveCapacity; - int32 m_moveCount; - - b2Pair* m_pairBuffer; - int32 m_pairCapacity; - int32 m_pairCount; - - int32 m_queryProxyId; -}; - -/// This is used to sort pairs. -inline bool b2PairLessThan(const b2Pair& pair1, const b2Pair& pair2) -{ - if (pair1.proxyIdA < pair2.proxyIdA) - { - return true; - } - - if (pair1.proxyIdA == pair2.proxyIdA) - { - return pair1.proxyIdB < pair2.proxyIdB; - } - - return false; -} - -inline void* b2BroadPhase::GetUserData(int32 proxyId) const -{ - return m_tree.GetUserData(proxyId); -} - -inline bool b2BroadPhase::TestOverlap(int32 proxyIdA, int32 proxyIdB) const -{ - const b2AABB& aabbA = m_tree.GetFatAABB(proxyIdA); - const b2AABB& aabbB = m_tree.GetFatAABB(proxyIdB); - return b2TestOverlap(aabbA, aabbB); -} - -inline const b2AABB& b2BroadPhase::GetFatAABB(int32 proxyId) const -{ - return m_tree.GetFatAABB(proxyId); -} - -inline int32 b2BroadPhase::GetProxyCount() const -{ - return m_proxyCount; -} - -inline int32 b2BroadPhase::GetTreeHeight() const -{ - return m_tree.GetHeight(); -} - -inline int32 b2BroadPhase::GetTreeBalance() const -{ - return m_tree.GetMaxBalance(); -} - -inline float32 b2BroadPhase::GetTreeQuality() const -{ - return m_tree.GetAreaRatio(); -} - -template -void b2BroadPhase::UpdatePairs(T* callback) -{ - // Reset pair buffer - m_pairCount = 0; - - // Perform tree queries for all moving proxies. - for (int32 i = 0; i < m_moveCount; ++i) - { - m_queryProxyId = m_moveBuffer[i]; - if (m_queryProxyId == e_nullProxy) - { - continue; - } - - // We have to query the tree with the fat AABB so that - // we don't fail to create a pair that may touch later. - const b2AABB& fatAABB = m_tree.GetFatAABB(m_queryProxyId); - - // Query tree, create pairs and add them pair buffer. - m_tree.Query(this, fatAABB); - } - - // Reset move buffer - m_moveCount = 0; - - // Sort the pair buffer to expose duplicates. - std::sort(m_pairBuffer, m_pairBuffer + m_pairCount, b2PairLessThan); - - // Send the pairs back to the client. - int32 i = 0; - while (i < m_pairCount) - { - b2Pair* primaryPair = m_pairBuffer + i; - void* userDataA = m_tree.GetUserData(primaryPair->proxyIdA); - void* userDataB = m_tree.GetUserData(primaryPair->proxyIdB); - - callback->AddPair(userDataA, userDataB); - ++i; - - // Skip any duplicate pairs. - while (i < m_pairCount) - { - b2Pair* pair = m_pairBuffer + i; - if (pair->proxyIdA != primaryPair->proxyIdA || pair->proxyIdB != primaryPair->proxyIdB) - { - break; - } - ++i; - } - } - - // Try to keep the tree balanced. - //m_tree.Rebalance(4); -} - -template -inline void b2BroadPhase::Query(T* callback, const b2AABB& aabb) const -{ - m_tree.Query(callback, aabb); -} - -template -inline void b2BroadPhase::RayCast(T* callback, const b2RayCastInput& input) const -{ - m_tree.RayCast(callback, input); -} - -#endif diff --git a/external/box2d/Collision/b2CollideCircle.cpp b/external/box2d/Collision/b2CollideCircle.cpp deleted file mode 100644 index ed561eb04b..0000000000 --- a/external/box2d/Collision/b2CollideCircle.cpp +++ /dev/null @@ -1,154 +0,0 @@ -/* -* Copyright (c) 2007-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include - -void b2CollideCircles( - b2Manifold* manifold, - const b2CircleShape* circleA, const b2Transform& xfA, - const b2CircleShape* circleB, const b2Transform& xfB) -{ - manifold->pointCount = 0; - - b2Vec2 pA = b2Mul(xfA, circleA->m_p); - b2Vec2 pB = b2Mul(xfB, circleB->m_p); - - b2Vec2 d = pB - pA; - float32 distSqr = b2Dot(d, d); - float32 rA = circleA->m_radius, rB = circleB->m_radius; - float32 radius = rA + rB; - if (distSqr > radius * radius) - { - return; - } - - manifold->type = b2Manifold::e_circles; - manifold->localPoint = circleA->m_p; - manifold->localNormal.SetZero(); - manifold->pointCount = 1; - - manifold->points[0].localPoint = circleB->m_p; - manifold->points[0].id.key = 0; -} - -void b2CollidePolygonAndCircle( - b2Manifold* manifold, - const b2PolygonShape* polygonA, const b2Transform& xfA, - const b2CircleShape* circleB, const b2Transform& xfB) -{ - manifold->pointCount = 0; - - // Compute circle position in the frame of the polygon. - b2Vec2 c = b2Mul(xfB, circleB->m_p); - b2Vec2 cLocal = b2MulT(xfA, c); - - // Find the min separating edge. - int32 normalIndex = 0; - float32 separation = -b2_maxFloat; - float32 radius = polygonA->m_radius + circleB->m_radius; - int32 vertexCount = polygonA->m_vertexCount; - const b2Vec2* vertices = polygonA->m_vertices; - const b2Vec2* normals = polygonA->m_normals; - - for (int32 i = 0; i < vertexCount; ++i) - { - float32 s = b2Dot(normals[i], cLocal - vertices[i]); - - if (s > radius) - { - // Early out. - return; - } - - if (s > separation) - { - separation = s; - normalIndex = i; - } - } - - // Vertices that subtend the incident face. - int32 vertIndex1 = normalIndex; - int32 vertIndex2 = vertIndex1 + 1 < vertexCount ? vertIndex1 + 1 : 0; - b2Vec2 v1 = vertices[vertIndex1]; - b2Vec2 v2 = vertices[vertIndex2]; - - // If the center is inside the polygon ... - if (separation < b2_epsilon) - { - manifold->pointCount = 1; - manifold->type = b2Manifold::e_faceA; - manifold->localNormal = normals[normalIndex]; - manifold->localPoint = 0.5f * (v1 + v2); - manifold->points[0].localPoint = circleB->m_p; - manifold->points[0].id.key = 0; - return; - } - - // Compute barycentric coordinates - float32 u1 = b2Dot(cLocal - v1, v2 - v1); - float32 u2 = b2Dot(cLocal - v2, v1 - v2); - if (u1 <= 0.0f) - { - if (b2DistanceSquared(cLocal, v1) > radius * radius) - { - return; - } - - manifold->pointCount = 1; - manifold->type = b2Manifold::e_faceA; - manifold->localNormal = cLocal - v1; - manifold->localNormal.Normalize(); - manifold->localPoint = v1; - manifold->points[0].localPoint = circleB->m_p; - manifold->points[0].id.key = 0; - } - else if (u2 <= 0.0f) - { - if (b2DistanceSquared(cLocal, v2) > radius * radius) - { - return; - } - - manifold->pointCount = 1; - manifold->type = b2Manifold::e_faceA; - manifold->localNormal = cLocal - v2; - manifold->localNormal.Normalize(); - manifold->localPoint = v2; - manifold->points[0].localPoint = circleB->m_p; - manifold->points[0].id.key = 0; - } - else - { - b2Vec2 faceCenter = 0.5f * (v1 + v2); - float32 separation = b2Dot(cLocal - faceCenter, normals[vertIndex1]); - if (separation > radius) - { - return; - } - - manifold->pointCount = 1; - manifold->type = b2Manifold::e_faceA; - manifold->localNormal = normals[vertIndex1]; - manifold->localPoint = faceCenter; - manifold->points[0].localPoint = circleB->m_p; - manifold->points[0].id.key = 0; - } -} diff --git a/external/box2d/Collision/b2CollideEdge.cpp b/external/box2d/Collision/b2CollideEdge.cpp deleted file mode 100644 index 96ca71dccc..0000000000 --- a/external/box2d/Collision/b2CollideEdge.cpp +++ /dev/null @@ -1,698 +0,0 @@ -/* - * Copyright (c) 2007-2009 Erin Catto http://www.box2d.org - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - */ - -#include -#include -#include -#include - - -// Compute contact points for edge versus circle. -// This accounts for edge connectivity. -void b2CollideEdgeAndCircle(b2Manifold* manifold, - const b2EdgeShape* edgeA, const b2Transform& xfA, - const b2CircleShape* circleB, const b2Transform& xfB) -{ - manifold->pointCount = 0; - - // Compute circle in frame of edge - b2Vec2 Q = b2MulT(xfA, b2Mul(xfB, circleB->m_p)); - - b2Vec2 A = edgeA->m_vertex1, B = edgeA->m_vertex2; - b2Vec2 e = B - A; - - // Barycentric coordinates - float32 u = b2Dot(e, B - Q); - float32 v = b2Dot(e, Q - A); - - float32 radius = edgeA->m_radius + circleB->m_radius; - - b2ContactFeature cf; - cf.indexB = 0; - cf.typeB = b2ContactFeature::e_vertex; - - // Region A - if (v <= 0.0f) - { - b2Vec2 P = A; - b2Vec2 d = Q - P; - float32 dd = b2Dot(d, d); - if (dd > radius * radius) - { - return; - } - - // Is there an edge connected to A? - if (edgeA->m_hasVertex0) - { - b2Vec2 A1 = edgeA->m_vertex0; - b2Vec2 B1 = A; - b2Vec2 e1 = B1 - A1; - float32 u1 = b2Dot(e1, B1 - Q); - - // Is the circle in Region AB of the previous edge? - if (u1 > 0.0f) - { - return; - } - } - - cf.indexA = 0; - cf.typeA = b2ContactFeature::e_vertex; - manifold->pointCount = 1; - manifold->type = b2Manifold::e_circles; - manifold->localNormal.SetZero(); - manifold->localPoint = P; - manifold->points[0].id.key = 0; - manifold->points[0].id.cf = cf; - manifold->points[0].localPoint = circleB->m_p; - return; - } - - // Region B - if (u <= 0.0f) - { - b2Vec2 P = B; - b2Vec2 d = Q - P; - float32 dd = b2Dot(d, d); - if (dd > radius * radius) - { - return; - } - - // Is there an edge connected to B? - if (edgeA->m_hasVertex3) - { - b2Vec2 B2 = edgeA->m_vertex3; - b2Vec2 A2 = B; - b2Vec2 e2 = B2 - A2; - float32 v2 = b2Dot(e2, Q - A2); - - // Is the circle in Region AB of the next edge? - if (v2 > 0.0f) - { - return; - } - } - - cf.indexA = 1; - cf.typeA = b2ContactFeature::e_vertex; - manifold->pointCount = 1; - manifold->type = b2Manifold::e_circles; - manifold->localNormal.SetZero(); - manifold->localPoint = P; - manifold->points[0].id.key = 0; - manifold->points[0].id.cf = cf; - manifold->points[0].localPoint = circleB->m_p; - return; - } - - // Region AB - float32 den = b2Dot(e, e); - b2Assert(den > 0.0f); - b2Vec2 P = (1.0f / den) * (u * A + v * B); - b2Vec2 d = Q - P; - float32 dd = b2Dot(d, d); - if (dd > radius * radius) - { - return; - } - - b2Vec2 n(-e.y, e.x); - if (b2Dot(n, Q - A) < 0.0f) - { - n.Set(-n.x, -n.y); - } - n.Normalize(); - - cf.indexA = 0; - cf.typeA = b2ContactFeature::e_face; - manifold->pointCount = 1; - manifold->type = b2Manifold::e_faceA; - manifold->localNormal = n; - manifold->localPoint = A; - manifold->points[0].id.key = 0; - manifold->points[0].id.cf = cf; - manifold->points[0].localPoint = circleB->m_p; -} - -// This structure is used to keep track of the best separating axis. -struct b2EPAxis -{ - enum Type - { - e_unknown, - e_edgeA, - e_edgeB - }; - - Type type; - int32 index; - float32 separation; -}; - -// This holds polygon B expressed in frame A. -struct b2TempPolygon -{ - b2Vec2 vertices[b2_maxPolygonVertices]; - b2Vec2 normals[b2_maxPolygonVertices]; - int32 count; -}; - -// Reference face used for clipping -struct b2ReferenceFace -{ - int32 i1, i2; - - b2Vec2 v1, v2; - - b2Vec2 normal; - - b2Vec2 sideNormal1; - float32 sideOffset1; - - b2Vec2 sideNormal2; - float32 sideOffset2; -}; - -// This class collides and edge and a polygon, taking into account edge adjacency. -struct b2EPCollider -{ - void Collide(b2Manifold* manifold, const b2EdgeShape* edgeA, const b2Transform& xfA, - const b2PolygonShape* polygonB, const b2Transform& xfB); - b2EPAxis ComputeEdgeSeparation(); - b2EPAxis ComputePolygonSeparation(); - - enum VertexType - { - e_isolated, - e_concave, - e_convex - }; - - b2TempPolygon m_polygonB; - - b2Transform m_xf; - b2Vec2 m_centroidB; - b2Vec2 m_v0, m_v1, m_v2, m_v3; - b2Vec2 m_normal0, m_normal1, m_normal2; - b2Vec2 m_normal; - VertexType m_type1, m_type2; - b2Vec2 m_lowerLimit, m_upperLimit; - float32 m_radius; - bool m_front; -}; - -// Algorithm: -// 1. Classify v1 and v2 -// 2. Classify polygon centroid as front or back -// 3. Flip normal if necessary -// 4. Initialize normal range to [-pi, pi] about face normal -// 5. Adjust normal range according to adjacent edges -// 6. Visit each separating axes, only accept axes within the range -// 7. Return if _any_ axis indicates separation -// 8. Clip -void b2EPCollider::Collide(b2Manifold* manifold, const b2EdgeShape* edgeA, const b2Transform& xfA, - const b2PolygonShape* polygonB, const b2Transform& xfB) -{ - m_xf = b2MulT(xfA, xfB); - - m_centroidB = b2Mul(m_xf, polygonB->m_centroid); - - m_v0 = edgeA->m_vertex0; - m_v1 = edgeA->m_vertex1; - m_v2 = edgeA->m_vertex2; - m_v3 = edgeA->m_vertex3; - - bool hasVertex0 = edgeA->m_hasVertex0; - bool hasVertex3F = edgeA->m_hasVertex3; - - b2Vec2 edge1 = m_v2 - m_v1; - edge1.Normalize(); - m_normal1.Set(edge1.y, -edge1.x); - float32 offset1 = b2Dot(m_normal1, m_centroidB - m_v1); - float32 offset0 = 0.0f, offset2 = 0.0f; - bool convex1 = false, convex2 = false; - - // Is there a preceding edge? - if (hasVertex0) - { - b2Vec2 edge0 = m_v1 - m_v0; - edge0.Normalize(); - m_normal0.Set(edge0.y, -edge0.x); - convex1 = b2Cross(edge0, edge1) >= 0.0f; - offset0 = b2Dot(m_normal0, m_centroidB - m_v0); - } - - // Is there a following edge? - if (hasVertex3F) - { - b2Vec2 edge2 = m_v3 - m_v2; - edge2.Normalize(); - m_normal2.Set(edge2.y, -edge2.x); - convex2 = b2Cross(edge1, edge2) > 0.0f; - offset2 = b2Dot(m_normal2, m_centroidB - m_v2); - } - - // Determine front or back collision. Determine collision normal limits. - if (hasVertex0 && hasVertex3F) - { - if (convex1 && convex2) - { - m_front = offset0 >= 0.0f || offset1 >= 0.0f || offset2 >= 0.0f; - if (m_front) - { - m_normal = m_normal1; - m_lowerLimit = m_normal0; - m_upperLimit = m_normal2; - } - else - { - m_normal = -m_normal1; - m_lowerLimit = -m_normal1; - m_upperLimit = -m_normal1; - } - } - else if (convex1) - { - m_front = offset0 >= 0.0f || (offset1 >= 0.0f && offset2 >= 0.0f); - if (m_front) - { - m_normal = m_normal1; - m_lowerLimit = m_normal0; - m_upperLimit = m_normal1; - } - else - { - m_normal = -m_normal1; - m_lowerLimit = -m_normal2; - m_upperLimit = -m_normal1; - } - } - else if (convex2) - { - m_front = offset2 >= 0.0f || (offset0 >= 0.0f && offset1 >= 0.0f); - if (m_front) - { - m_normal = m_normal1; - m_lowerLimit = m_normal1; - m_upperLimit = m_normal2; - } - else - { - m_normal = -m_normal1; - m_lowerLimit = -m_normal1; - m_upperLimit = -m_normal0; - } - } - else - { - m_front = offset0 >= 0.0f && offset1 >= 0.0f && offset2 >= 0.0f; - if (m_front) - { - m_normal = m_normal1; - m_lowerLimit = m_normal1; - m_upperLimit = m_normal1; - } - else - { - m_normal = -m_normal1; - m_lowerLimit = -m_normal2; - m_upperLimit = -m_normal0; - } - } - } - else if (hasVertex0) - { - if (convex1) - { - m_front = offset0 >= 0.0f || offset1 >= 0.0f; - if (m_front) - { - m_normal = m_normal1; - m_lowerLimit = m_normal0; - m_upperLimit = -m_normal1; - } - else - { - m_normal = -m_normal1; - m_lowerLimit = m_normal1; - m_upperLimit = -m_normal1; - } - } - else - { - m_front = offset0 >= 0.0f && offset1 >= 0.0f; - if (m_front) - { - m_normal = m_normal1; - m_lowerLimit = m_normal1; - m_upperLimit = -m_normal1; - } - else - { - m_normal = -m_normal1; - m_lowerLimit = m_normal1; - m_upperLimit = -m_normal0; - } - } - } - else if (hasVertex3F) - { - if (convex2) - { - m_front = offset1 >= 0.0f || offset2 >= 0.0f; - if (m_front) - { - m_normal = m_normal1; - m_lowerLimit = -m_normal1; - m_upperLimit = m_normal2; - } - else - { - m_normal = -m_normal1; - m_lowerLimit = -m_normal1; - m_upperLimit = m_normal1; - } - } - else - { - m_front = offset1 >= 0.0f && offset2 >= 0.0f; - if (m_front) - { - m_normal = m_normal1; - m_lowerLimit = -m_normal1; - m_upperLimit = m_normal1; - } - else - { - m_normal = -m_normal1; - m_lowerLimit = -m_normal2; - m_upperLimit = m_normal1; - } - } - } - else - { - m_front = offset1 >= 0.0f; - if (m_front) - { - m_normal = m_normal1; - m_lowerLimit = -m_normal1; - m_upperLimit = -m_normal1; - } - else - { - m_normal = -m_normal1; - m_lowerLimit = m_normal1; - m_upperLimit = m_normal1; - } - } - - // Get polygonB in frameA - m_polygonB.count = polygonB->m_vertexCount; - for (int32 i = 0; i < polygonB->m_vertexCount; ++i) - { - m_polygonB.vertices[i] = b2Mul(m_xf, polygonB->m_vertices[i]); - m_polygonB.normals[i] = b2Mul(m_xf.q, polygonB->m_normals[i]); - } - - m_radius = 2.0f * b2_polygonRadius; - - manifold->pointCount = 0; - - b2EPAxis edgeAxis = ComputeEdgeSeparation(); - - // If no valid normal can be found than this edge should not collide. - if (edgeAxis.type == b2EPAxis::e_unknown) - { - return; - } - - if (edgeAxis.separation > m_radius) - { - return; - } - - b2EPAxis polygonAxis = ComputePolygonSeparation(); - if (polygonAxis.type != b2EPAxis::e_unknown && polygonAxis.separation > m_radius) - { - return; - } - - // Use hysteresis for jitter reduction. - const float32 k_relativeTol = 0.98f; - const float32 k_absoluteTol = 0.001f; - - b2EPAxis primaryAxis; - if (polygonAxis.type == b2EPAxis::e_unknown) - { - primaryAxis = edgeAxis; - } - else if (polygonAxis.separation > k_relativeTol * edgeAxis.separation + k_absoluteTol) - { - primaryAxis = polygonAxis; - } - else - { - primaryAxis = edgeAxis; - } - - b2ClipVertex ie[2]; - b2ReferenceFace rf; - if (primaryAxis.type == b2EPAxis::e_edgeA) - { - manifold->type = b2Manifold::e_faceA; - - // Search for the polygon normal that is most anti-parallel to the edge normal. - int32 bestIndex = 0; - float32 bestValue = b2Dot(m_normal, m_polygonB.normals[0]); - for (int32 i = 1; i < m_polygonB.count; ++i) - { - float32 value = b2Dot(m_normal, m_polygonB.normals[i]); - if (value < bestValue) - { - bestValue = value; - bestIndex = i; - } - } - - int32 i1 = bestIndex; - int32 i2 = i1 + 1 < m_polygonB.count ? i1 + 1 : 0; - - ie[0].v = m_polygonB.vertices[i1]; - ie[0].id.cf.indexA = 0; - ie[0].id.cf.indexB = i1; - ie[0].id.cf.typeA = b2ContactFeature::e_face; - ie[0].id.cf.typeB = b2ContactFeature::e_vertex; - - ie[1].v = m_polygonB.vertices[i2]; - ie[1].id.cf.indexA = 0; - ie[1].id.cf.indexB = i2; - ie[1].id.cf.typeA = b2ContactFeature::e_face; - ie[1].id.cf.typeB = b2ContactFeature::e_vertex; - - if (m_front) - { - rf.i1 = 0; - rf.i2 = 1; - rf.v1 = m_v1; - rf.v2 = m_v2; - rf.normal = m_normal1; - } - else - { - rf.i1 = 1; - rf.i2 = 0; - rf.v1 = m_v2; - rf.v2 = m_v1; - rf.normal = -m_normal1; - } - } - else - { - manifold->type = b2Manifold::e_faceB; - - ie[0].v = m_v1; - ie[0].id.cf.indexA = 0; - ie[0].id.cf.indexB = primaryAxis.index; - ie[0].id.cf.typeA = b2ContactFeature::e_vertex; - ie[0].id.cf.typeB = b2ContactFeature::e_face; - - ie[1].v = m_v2; - ie[1].id.cf.indexA = 0; - ie[1].id.cf.indexB = primaryAxis.index; - ie[1].id.cf.typeA = b2ContactFeature::e_vertex; - ie[1].id.cf.typeB = b2ContactFeature::e_face; - - rf.i1 = primaryAxis.index; - rf.i2 = rf.i1 + 1 < m_polygonB.count ? rf.i1 + 1 : 0; - rf.v1 = m_polygonB.vertices[rf.i1]; - rf.v2 = m_polygonB.vertices[rf.i2]; - rf.normal = m_polygonB.normals[rf.i1]; - } - - rf.sideNormal1.Set(rf.normal.y, -rf.normal.x); - rf.sideNormal2 = -rf.sideNormal1; - rf.sideOffset1 = b2Dot(rf.sideNormal1, rf.v1); - rf.sideOffset2 = b2Dot(rf.sideNormal2, rf.v2); - - // Clip incident edge against extruded edge1 side edges. - b2ClipVertex clipPoints1[2]; - b2ClipVertex clipPoints2[2]; - int32 np; - - // Clip to box side 1 - np = b2ClipSegmentToLine(clipPoints1, ie, rf.sideNormal1, rf.sideOffset1, rf.i1); - - if (np < b2_maxManifoldPoints) - { - return; - } - - // Clip to negative box side 1 - np = b2ClipSegmentToLine(clipPoints2, clipPoints1, rf.sideNormal2, rf.sideOffset2, rf.i2); - - if (np < b2_maxManifoldPoints) - { - return; - } - - // Now clipPoints2 contains the clipped points. - if (primaryAxis.type == b2EPAxis::e_edgeA) - { - manifold->localNormal = rf.normal; - manifold->localPoint = rf.v1; - } - else - { - manifold->localNormal = polygonB->m_normals[rf.i1]; - manifold->localPoint = polygonB->m_vertices[rf.i1]; - } - - int32 pointCount = 0; - for (int32 i = 0; i < b2_maxManifoldPoints; ++i) - { - float32 separation; - - separation = b2Dot(rf.normal, clipPoints2[i].v - rf.v1); - - if (separation <= m_radius) - { - b2ManifoldPoint* cp = manifold->points + pointCount; - - if (primaryAxis.type == b2EPAxis::e_edgeA) - { - cp->localPoint = b2MulT(m_xf, clipPoints2[i].v); - cp->id = clipPoints2[i].id; - } - else - { - cp->localPoint = clipPoints2[i].v; - cp->id.cf.typeA = clipPoints2[i].id.cf.typeB; - cp->id.cf.typeB = clipPoints2[i].id.cf.typeA; - cp->id.cf.indexA = clipPoints2[i].id.cf.indexB; - cp->id.cf.indexB = clipPoints2[i].id.cf.indexA; - } - - ++pointCount; - } - } - - manifold->pointCount = pointCount; -} - -b2EPAxis b2EPCollider::ComputeEdgeSeparation() -{ - b2EPAxis axis; - axis.type = b2EPAxis::e_edgeA; - axis.index = m_front ? 0 : 1; - axis.separation = FLT_MAX; - - for (int32 i = 0; i < m_polygonB.count; ++i) - { - float32 s = b2Dot(m_normal, m_polygonB.vertices[i] - m_v1); - if (s < axis.separation) - { - axis.separation = s; - } - } - - return axis; -} - -b2EPAxis b2EPCollider::ComputePolygonSeparation() -{ - b2EPAxis axis; - axis.type = b2EPAxis::e_unknown; - axis.index = -1; - axis.separation = -FLT_MAX; - - b2Vec2 perp(-m_normal.y, m_normal.x); - - for (int32 i = 0; i < m_polygonB.count; ++i) - { - b2Vec2 n = -m_polygonB.normals[i]; - - float32 s1 = b2Dot(n, m_polygonB.vertices[i] - m_v1); - float32 s2 = b2Dot(n, m_polygonB.vertices[i] - m_v2); - float32 s = b2Min(s1, s2); - - if (s > m_radius) - { - // No collision - axis.type = b2EPAxis::e_edgeB; - axis.index = i; - axis.separation = s; - return axis; - } - - // Adjacency - if (b2Dot(n, perp) >= 0.0f) - { - if (b2Dot(n - m_upperLimit, m_normal) < -b2_angularSlop) - { - continue; - } - } - else - { - if (b2Dot(n - m_lowerLimit, m_normal) < -b2_angularSlop) - { - continue; - } - } - - if (s > axis.separation) - { - axis.type = b2EPAxis::e_edgeB; - axis.index = i; - axis.separation = s; - } - } - - return axis; -} - -void b2CollideEdgeAndPolygon( b2Manifold* manifold, - const b2EdgeShape* edgeA, const b2Transform& xfA, - const b2PolygonShape* polygonB, const b2Transform& xfB) -{ - b2EPCollider collider; - collider.Collide(manifold, edgeA, xfA, polygonB, xfB); -} diff --git a/external/box2d/Collision/b2CollidePolygon.cpp b/external/box2d/Collision/b2CollidePolygon.cpp deleted file mode 100644 index be2518d966..0000000000 --- a/external/box2d/Collision/b2CollidePolygon.cpp +++ /dev/null @@ -1,317 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include - -// Find the separation between poly1 and poly2 for a give edge normal on poly1. -static float32 b2EdgeSeparation(const b2PolygonShape* poly1, const b2Transform& xf1, int32 edge1, - const b2PolygonShape* poly2, const b2Transform& xf2) -{ - const b2Vec2* vertices1 = poly1->m_vertices; - const b2Vec2* normals1 = poly1->m_normals; - - int32 count2 = poly2->m_vertexCount; - const b2Vec2* vertices2 = poly2->m_vertices; - - b2Assert(0 <= edge1 && edge1 < poly1->m_vertexCount); - - // Convert normal from poly1's frame into poly2's frame. - b2Vec2 normal1World = b2Mul(xf1.q, normals1[edge1]); - b2Vec2 normal1 = b2MulT(xf2.q, normal1World); - - // Find support vertex on poly2 for -normal. - int32 index = 0; - float32 minDot = b2_maxFloat; - - for (int32 i = 0; i < count2; ++i) - { - float32 dot = b2Dot(vertices2[i], normal1); - if (dot < minDot) - { - minDot = dot; - index = i; - } - } - - b2Vec2 v1 = b2Mul(xf1, vertices1[edge1]); - b2Vec2 v2 = b2Mul(xf2, vertices2[index]); - float32 separation = b2Dot(v2 - v1, normal1World); - return separation; -} - -// Find the max separation between poly1 and poly2 using edge normals from poly1. -static float32 b2FindMaxSeparation(int32* edgeIndex, - const b2PolygonShape* poly1, const b2Transform& xf1, - const b2PolygonShape* poly2, const b2Transform& xf2) -{ - int32 count1 = poly1->m_vertexCount; - const b2Vec2* normals1 = poly1->m_normals; - - // Vector pointing from the centroid of poly1 to the centroid of poly2. - b2Vec2 d = b2Mul(xf2, poly2->m_centroid) - b2Mul(xf1, poly1->m_centroid); - b2Vec2 dLocal1 = b2MulT(xf1.q, d); - - // Find edge normal on poly1 that has the largest projection onto d. - int32 edge = 0; - float32 maxDot = -b2_maxFloat; - for (int32 i = 0; i < count1; ++i) - { - float32 dot = b2Dot(normals1[i], dLocal1); - if (dot > maxDot) - { - maxDot = dot; - edge = i; - } - } - - // Get the separation for the edge normal. - float32 s = b2EdgeSeparation(poly1, xf1, edge, poly2, xf2); - - // Check the separation for the previous edge normal. - int32 prevEdge = edge - 1 >= 0 ? edge - 1 : count1 - 1; - float32 sPrev = b2EdgeSeparation(poly1, xf1, prevEdge, poly2, xf2); - - // Check the separation for the next edge normal. - int32 nextEdge = edge + 1 < count1 ? edge + 1 : 0; - float32 sNext = b2EdgeSeparation(poly1, xf1, nextEdge, poly2, xf2); - - // Find the best edge and the search direction. - int32 bestEdge; - float32 bestSeparation; - int32 increment; - if (sPrev > s && sPrev > sNext) - { - increment = -1; - bestEdge = prevEdge; - bestSeparation = sPrev; - } - else if (sNext > s) - { - increment = 1; - bestEdge = nextEdge; - bestSeparation = sNext; - } - else - { - *edgeIndex = edge; - return s; - } - - // Perform a local search for the best edge normal. - for ( ; ; ) - { - if (increment == -1) - edge = bestEdge - 1 >= 0 ? bestEdge - 1 : count1 - 1; - else - edge = bestEdge + 1 < count1 ? bestEdge + 1 : 0; - - s = b2EdgeSeparation(poly1, xf1, edge, poly2, xf2); - - if (s > bestSeparation) - { - bestEdge = edge; - bestSeparation = s; - } - else - { - break; - } - } - - *edgeIndex = bestEdge; - return bestSeparation; -} - -static void b2FindIncidentEdge(b2ClipVertex c[2], - const b2PolygonShape* poly1, const b2Transform& xf1, int32 edge1, - const b2PolygonShape* poly2, const b2Transform& xf2) -{ - const b2Vec2* normals1 = poly1->m_normals; - - int32 count2 = poly2->m_vertexCount; - const b2Vec2* vertices2 = poly2->m_vertices; - const b2Vec2* normals2 = poly2->m_normals; - - b2Assert(0 <= edge1 && edge1 < poly1->m_vertexCount); - - // Get the normal of the reference edge in poly2's frame. - b2Vec2 normal1 = b2MulT(xf2.q, b2Mul(xf1.q, normals1[edge1])); - - // Find the incident edge on poly2. - int32 index = 0; - float32 minDot = b2_maxFloat; - for (int32 i = 0; i < count2; ++i) - { - float32 dot = b2Dot(normal1, normals2[i]); - if (dot < minDot) - { - minDot = dot; - index = i; - } - } - - // Build the clip vertices for the incident edge. - int32 i1 = index; - int32 i2 = i1 + 1 < count2 ? i1 + 1 : 0; - - c[0].v = b2Mul(xf2, vertices2[i1]); - c[0].id.cf.indexA = (uint8)edge1; - c[0].id.cf.indexB = (uint8)i1; - c[0].id.cf.typeA = b2ContactFeature::e_face; - c[0].id.cf.typeB = b2ContactFeature::e_vertex; - - c[1].v = b2Mul(xf2, vertices2[i2]); - c[1].id.cf.indexA = (uint8)edge1; - c[1].id.cf.indexB = (uint8)i2; - c[1].id.cf.typeA = b2ContactFeature::e_face; - c[1].id.cf.typeB = b2ContactFeature::e_vertex; -} - -// Find edge normal of max separation on A - return if separating axis is found -// Find edge normal of max separation on B - return if separation axis is found -// Choose reference edge as min(minA, minB) -// Find incident edge -// Clip - -// The normal points from 1 to 2 -void b2CollidePolygons(b2Manifold* manifold, - const b2PolygonShape* polyA, const b2Transform& xfA, - const b2PolygonShape* polyB, const b2Transform& xfB) -{ - manifold->pointCount = 0; - float32 totalRadius = polyA->m_radius + polyB->m_radius; - - int32 edgeA = 0; - float32 separationA = b2FindMaxSeparation(&edgeA, polyA, xfA, polyB, xfB); - if (separationA > totalRadius) - return; - - int32 edgeB = 0; - float32 separationB = b2FindMaxSeparation(&edgeB, polyB, xfB, polyA, xfA); - if (separationB > totalRadius) - return; - - const b2PolygonShape* poly1; // reference polygon - const b2PolygonShape* poly2; // incident polygon - b2Transform xf1, xf2; - int32 edge1; // reference edge - uint8 flip; - const float32 k_relativeTol = 0.98f; - const float32 k_absoluteTol = 0.001f; - - if (separationB > k_relativeTol * separationA + k_absoluteTol) - { - poly1 = polyB; - poly2 = polyA; - xf1 = xfB; - xf2 = xfA; - edge1 = edgeB; - manifold->type = b2Manifold::e_faceB; - flip = 1; - } - else - { - poly1 = polyA; - poly2 = polyB; - xf1 = xfA; - xf2 = xfB; - edge1 = edgeA; - manifold->type = b2Manifold::e_faceA; - flip = 0; - } - - b2ClipVertex incidentEdge[2]; - b2FindIncidentEdge(incidentEdge, poly1, xf1, edge1, poly2, xf2); - - int32 count1 = poly1->m_vertexCount; - const b2Vec2* vertices1 = poly1->m_vertices; - - int32 iv1 = edge1; - int32 iv2 = edge1 + 1 < count1 ? edge1 + 1 : 0; - - b2Vec2 v11 = vertices1[iv1]; - b2Vec2 v12 = vertices1[iv2]; - - b2Vec2 localTangent = v12 - v11; - localTangent.Normalize(); - - b2Vec2 localNormal = b2Cross(localTangent, 1.0f); - b2Vec2 planePoint = 0.5f * (v11 + v12); - - b2Vec2 tangent = b2Mul(xf1.q, localTangent); - b2Vec2 normal = b2Cross(tangent, 1.0f); - - v11 = b2Mul(xf1, v11); - v12 = b2Mul(xf1, v12); - - // Face offset. - float32 frontOffset = b2Dot(normal, v11); - - // Side offsets, extended by polytope skin thickness. - float32 sideOffset1 = -b2Dot(tangent, v11) + totalRadius; - float32 sideOffset2 = b2Dot(tangent, v12) + totalRadius; - - // Clip incident edge against extruded edge1 side edges. - b2ClipVertex clipPoints1[2]; - b2ClipVertex clipPoints2[2]; - int np; - - // Clip to box side 1 - np = b2ClipSegmentToLine(clipPoints1, incidentEdge, -tangent, sideOffset1, iv1); - - if (np < 2) - return; - - // Clip to negative box side 1 - np = b2ClipSegmentToLine(clipPoints2, clipPoints1, tangent, sideOffset2, iv2); - - if (np < 2) - { - return; - } - - // Now clipPoints2 contains the clipped points. - manifold->localNormal = localNormal; - manifold->localPoint = planePoint; - - int32 pointCount = 0; - for (int32 i = 0; i < b2_maxManifoldPoints; ++i) - { - float32 separation = b2Dot(normal, clipPoints2[i].v) - frontOffset; - - if (separation <= totalRadius) - { - b2ManifoldPoint* cp = manifold->points + pointCount; - cp->localPoint = b2MulT(xf2, clipPoints2[i].v); - cp->id = clipPoints2[i].id; - if (flip) - { - // Swap features - b2ContactFeature cf = cp->id.cf; - cp->id.cf.indexA = cf.indexB; - cp->id.cf.indexB = cf.indexA; - cp->id.cf.typeA = cf.typeB; - cp->id.cf.typeB = cf.typeA; - } - ++pointCount; - } - } - - manifold->pointCount = pointCount; -} diff --git a/external/box2d/Collision/b2Collision.cpp b/external/box2d/Collision/b2Collision.cpp deleted file mode 100644 index 2dd5ff0ab6..0000000000 --- a/external/box2d/Collision/b2Collision.cpp +++ /dev/null @@ -1,249 +0,0 @@ -/* -* Copyright (c) 2007-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include - -void b2WorldManifold::Initialize(const b2Manifold* manifold, - const b2Transform& xfA, float32 radiusA, - const b2Transform& xfB, float32 radiusB) -{ - if (manifold->pointCount == 0) - { - return; - } - - switch (manifold->type) - { - case b2Manifold::e_circles: - { - normal.Set(1.0f, 0.0f); - b2Vec2 pointA = b2Mul(xfA, manifold->localPoint); - b2Vec2 pointB = b2Mul(xfB, manifold->points[0].localPoint); - if (b2DistanceSquared(pointA, pointB) > b2_epsilon * b2_epsilon) - { - normal = pointB - pointA; - normal.Normalize(); - } - - b2Vec2 cA = pointA + radiusA * normal; - b2Vec2 cB = pointB - radiusB * normal; - points[0] = 0.5f * (cA + cB); - } - break; - - case b2Manifold::e_faceA: - { - normal = b2Mul(xfA.q, manifold->localNormal); - b2Vec2 planePoint = b2Mul(xfA, manifold->localPoint); - - for (int32 i = 0; i < manifold->pointCount; ++i) - { - b2Vec2 clipPoint = b2Mul(xfB, manifold->points[i].localPoint); - b2Vec2 cA = clipPoint + (radiusA - b2Dot(clipPoint - planePoint, normal)) * normal; - b2Vec2 cB = clipPoint - radiusB * normal; - points[i] = 0.5f * (cA + cB); - } - } - break; - - case b2Manifold::e_faceB: - { - normal = b2Mul(xfB.q, manifold->localNormal); - b2Vec2 planePoint = b2Mul(xfB, manifold->localPoint); - - for (int32 i = 0; i < manifold->pointCount; ++i) - { - b2Vec2 clipPoint = b2Mul(xfA, manifold->points[i].localPoint); - b2Vec2 cB = clipPoint + (radiusB - b2Dot(clipPoint - planePoint, normal)) * normal; - b2Vec2 cA = clipPoint - radiusA * normal; - points[i] = 0.5f * (cA + cB); - } - - // Ensure normal points from A to B. - normal = -normal; - } - break; - } -} - -void b2GetPointStates(b2PointState state1[b2_maxManifoldPoints], b2PointState state2[b2_maxManifoldPoints], - const b2Manifold* manifold1, const b2Manifold* manifold2) -{ - for (int32 i = 0; i < b2_maxManifoldPoints; ++i) - { - state1[i] = b2_nullState; - state2[i] = b2_nullState; - } - - // Detect persists and removes. - for (int32 i = 0; i < manifold1->pointCount; ++i) - { - b2ContactID id = manifold1->points[i].id; - - state1[i] = b2_removeState; - - for (int32 j = 0; j < manifold2->pointCount; ++j) - { - if (manifold2->points[j].id.key == id.key) - { - state1[i] = b2_persistState; - break; - } - } - } - - // Detect persists and adds. - for (int32 i = 0; i < manifold2->pointCount; ++i) - { - b2ContactID id = manifold2->points[i].id; - - state2[i] = b2_addState; - - for (int32 j = 0; j < manifold1->pointCount; ++j) - { - if (manifold1->points[j].id.key == id.key) - { - state2[i] = b2_persistState; - break; - } - } - } -} - -// From Real-time Collision Detection, p179. -bool b2AABB::RayCast(b2RayCastOutput* output, const b2RayCastInput& input) const -{ - float32 tmin = -b2_maxFloat; - float32 tmax = b2_maxFloat; - - b2Vec2 p = input.p1; - b2Vec2 d = input.p2 - input.p1; - b2Vec2 absD = b2Abs(d); - - b2Vec2 normal; - - for (int32 i = 0; i < 2; ++i) - { - if (absD(i) < b2_epsilon) - { - // Parallel. - if (p(i) < lowerBound(i) || upperBound(i) < p(i)) - { - return false; - } - } - else - { - float32 inv_d = 1.0f / d(i); - float32 t1 = (lowerBound(i) - p(i)) * inv_d; - float32 t2 = (upperBound(i) - p(i)) * inv_d; - - // Sign of the normal vector. - float32 s = -1.0f; - - if (t1 > t2) - { - b2Swap(t1, t2); - s = 1.0f; - } - - // Push the min up - if (t1 > tmin) - { - normal.SetZero(); - normal(i) = s; - tmin = t1; - } - - // Pull the max down - tmax = b2Min(tmax, t2); - - if (tmin > tmax) - { - return false; - } - } - } - - // Does the ray start inside the box? - // Does the ray intersect beyond the max fraction? - if (tmin < 0.0f || input.maxFraction < tmin) - { - return false; - } - - // Intersection. - output->fraction = tmin; - output->normal = normal; - return true; -} - -// Sutherland-Hodgman clipping. -int32 b2ClipSegmentToLine(b2ClipVertex vOut[2], const b2ClipVertex vIn[2], - const b2Vec2& normal, float32 offset, int32 vertexIndexA) -{ - // Start with no output points - int32 numOut = 0; - - // Calculate the distance of end points to the line - float32 distance0 = b2Dot(normal, vIn[0].v) - offset; - float32 distance1 = b2Dot(normal, vIn[1].v) - offset; - - // If the points are behind the plane - if (distance0 <= 0.0f) vOut[numOut++] = vIn[0]; - if (distance1 <= 0.0f) vOut[numOut++] = vIn[1]; - - // If the points are on different sides of the plane - if (distance0 * distance1 < 0.0f) - { - // Find intersection point of edge and plane - float32 interp = distance0 / (distance0 - distance1); - vOut[numOut].v = vIn[0].v + interp * (vIn[1].v - vIn[0].v); - - // VertexA is hitting edgeB. - vOut[numOut].id.cf.indexA = vertexIndexA; - vOut[numOut].id.cf.indexB = vIn[0].id.cf.indexB; - vOut[numOut].id.cf.typeA = b2ContactFeature::e_vertex; - vOut[numOut].id.cf.typeB = b2ContactFeature::e_face; - ++numOut; - } - - return numOut; -} - -bool b2TestOverlap( const b2Shape* shapeA, int32 indexA, - const b2Shape* shapeB, int32 indexB, - const b2Transform& xfA, const b2Transform& xfB) -{ - b2DistanceInput input; - input.proxyA.Set(shapeA, indexA); - input.proxyB.Set(shapeB, indexB); - input.transformA = xfA; - input.transformB = xfB; - input.useRadii = true; - - b2SimplexCache cache; - cache.count = 0; - - b2DistanceOutput output; - - b2Distance(&output, &cache, &input); - - return output.distance < 10.0f * b2_epsilon; -} diff --git a/external/box2d/Collision/b2Collision.h b/external/box2d/Collision/b2Collision.h deleted file mode 100644 index 2e7386232b..0000000000 --- a/external/box2d/Collision/b2Collision.h +++ /dev/null @@ -1,276 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_COLLISION_H -#define B2_COLLISION_H - -#include -#include - -/// @file -/// Structures and functions used for computing contact points, distance -/// queries, and TOI queries. - -class b2Shape; -class b2CircleShape; -class b2EdgeShape; -class b2PolygonShape; - -const uint8 b2_nullFeature = UCHAR_MAX; - -/// The features that intersect to form the contact point -/// This must be 4 bytes or less. -struct b2ContactFeature -{ - enum Type - { - e_vertex = 0, - e_face = 1 - }; - - uint8 indexA; ///< Feature index on shapeA - uint8 indexB; ///< Feature index on shapeB - uint8 typeA; ///< The feature type on shapeA - uint8 typeB; ///< The feature type on shapeB -}; - -/// Contact ids to facilitate warm starting. -union b2ContactID -{ - b2ContactFeature cf; - uint32 key; ///< Used to quickly compare contact ids. -}; - -/// A manifold point is a contact point belonging to a contact -/// manifold. It holds details related to the geometry and dynamics -/// of the contact points. -/// The local point usage depends on the manifold type: -/// -e_circles: the local center of circleB -/// -e_faceA: the local center of cirlceB or the clip point of polygonB -/// -e_faceB: the clip point of polygonA -/// This structure is stored across time steps, so we keep it small. -/// Note: the impulses are used for internal caching and may not -/// provide reliable contact forces, especially for high speed collisions. -struct b2ManifoldPoint -{ - b2Vec2 localPoint; ///< usage depends on manifold type - float32 normalImpulse; ///< the non-penetration impulse - float32 tangentImpulse; ///< the friction impulse - b2ContactID id; ///< uniquely identifies a contact point between two shapes -}; - -/// A manifold for two touching convex shapes. -/// Box2D supports multiple types of contact: -/// - clip point versus plane with radius -/// - point versus point with radius (circles) -/// The local point usage depends on the manifold type: -/// -e_circles: the local center of circleA -/// -e_faceA: the center of faceA -/// -e_faceB: the center of faceB -/// Similarly the local normal usage: -/// -e_circles: not used -/// -e_faceA: the normal on polygonA -/// -e_faceB: the normal on polygonB -/// We store contacts in this way so that position correction can -/// account for movement, which is critical for continuous physics. -/// All contact scenarios must be expressed in one of these types. -/// This structure is stored across time steps, so we keep it small. -struct b2Manifold -{ - enum Type - { - e_circles, - e_faceA, - e_faceB - }; - - b2ManifoldPoint points[b2_maxManifoldPoints]; ///< the points of contact - b2Vec2 localNormal; ///< not use for Type::e_points - b2Vec2 localPoint; ///< usage depends on manifold type - Type type; - int32 pointCount; ///< the number of manifold points -}; - -/// This is used to compute the current state of a contact manifold. -struct b2WorldManifold -{ - /// Evaluate the manifold with supplied transforms. This assumes - /// modest motion from the original state. This does not change the - /// point count, impulses, etc. The radii must come from the shapes - /// that generated the manifold. - void Initialize(const b2Manifold* manifold, - const b2Transform& xfA, float32 radiusA, - const b2Transform& xfB, float32 radiusB); - - b2Vec2 normal; ///< world vector pointing from A to B - b2Vec2 points[b2_maxManifoldPoints]; ///< world contact point (point of intersection) -}; - -/// This is used for determining the state of contact points. -enum b2PointState -{ - b2_nullState, ///< point does not exist - b2_addState, ///< point was added in the update - b2_persistState, ///< point persisted across the update - b2_removeState ///< point was removed in the update -}; - -/// Compute the point states given two manifolds. The states pertain to the transition from manifold1 -/// to manifold2. So state1 is either persist or remove while state2 is either add or persist. -void b2GetPointStates(b2PointState state1[b2_maxManifoldPoints], b2PointState state2[b2_maxManifoldPoints], - const b2Manifold* manifold1, const b2Manifold* manifold2); - -/// Used for computing contact manifolds. -struct b2ClipVertex -{ - b2Vec2 v; - b2ContactID id; -}; - -/// Ray-cast input data. The ray extends from p1 to p1 + maxFraction * (p2 - p1). -struct b2RayCastInput -{ - b2Vec2 p1, p2; - float32 maxFraction; -}; - -/// Ray-cast output data. The ray hits at p1 + fraction * (p2 - p1), where p1 and p2 -/// come from b2RayCastInput. -struct b2RayCastOutput -{ - b2Vec2 normal; - float32 fraction; -}; - -/// An axis aligned bounding box. -struct b2AABB -{ - /// Verify that the bounds are sorted. - bool IsValid() const; - - /// Get the center of the AABB. - b2Vec2 GetCenter() const - { - return 0.5f * (lowerBound + upperBound); - } - - /// Get the extents of the AABB (half-widths). - b2Vec2 GetExtents() const - { - return 0.5f * (upperBound - lowerBound); - } - - /// Get the perimeter length - float32 GetPerimeter() const - { - float32 wx = upperBound.x - lowerBound.x; - float32 wy = upperBound.y - lowerBound.y; - return 2.0f * (wx + wy); - } - - /// Combine an AABB into this one. - void Combine(const b2AABB& aabb) - { - lowerBound = b2Min(lowerBound, aabb.lowerBound); - upperBound = b2Max(upperBound, aabb.upperBound); - } - - /// Combine two AABBs into this one. - void Combine(const b2AABB& aabb1, const b2AABB& aabb2) - { - lowerBound = b2Min(aabb1.lowerBound, aabb2.lowerBound); - upperBound = b2Max(aabb1.upperBound, aabb2.upperBound); - } - - /// Does this aabb contain the provided AABB. - bool Contains(const b2AABB& aabb) const - { - bool result = true; - result = result && lowerBound.x <= aabb.lowerBound.x; - result = result && lowerBound.y <= aabb.lowerBound.y; - result = result && aabb.upperBound.x <= upperBound.x; - result = result && aabb.upperBound.y <= upperBound.y; - return result; - } - - bool RayCast(b2RayCastOutput* output, const b2RayCastInput& input) const; - - b2Vec2 lowerBound; ///< the lower vertex - b2Vec2 upperBound; ///< the upper vertex -}; - -/// Compute the collision manifold between two circles. -void b2CollideCircles(b2Manifold* manifold, - const b2CircleShape* circleA, const b2Transform& xfA, - const b2CircleShape* circleB, const b2Transform& xfB); - -/// Compute the collision manifold between a polygon and a circle. -void b2CollidePolygonAndCircle(b2Manifold* manifold, - const b2PolygonShape* polygonA, const b2Transform& xfA, - const b2CircleShape* circleB, const b2Transform& xfB); - -/// Compute the collision manifold between two polygons. -void b2CollidePolygons(b2Manifold* manifold, - const b2PolygonShape* polygonA, const b2Transform& xfA, - const b2PolygonShape* polygonB, const b2Transform& xfB); - -/// Compute the collision manifold between an edge and a circle. -void b2CollideEdgeAndCircle(b2Manifold* manifold, - const b2EdgeShape* polygonA, const b2Transform& xfA, - const b2CircleShape* circleB, const b2Transform& xfB); - -/// Compute the collision manifold between an edge and a circle. -void b2CollideEdgeAndPolygon(b2Manifold* manifold, - const b2EdgeShape* edgeA, const b2Transform& xfA, - const b2PolygonShape* circleB, const b2Transform& xfB); - -/// Clipping for contact manifolds. -int32 b2ClipSegmentToLine(b2ClipVertex vOut[2], const b2ClipVertex vIn[2], - const b2Vec2& normal, float32 offset, int32 vertexIndexA); - -/// Determine if two generic shapes overlap. -bool b2TestOverlap( const b2Shape* shapeA, int32 indexA, - const b2Shape* shapeB, int32 indexB, - const b2Transform& xfA, const b2Transform& xfB); - -// ---------------- Inline Functions ------------------------------------------ - -inline bool b2AABB::IsValid() const -{ - b2Vec2 d = upperBound - lowerBound; - bool valid = d.x >= 0.0f && d.y >= 0.0f; - valid = valid && lowerBound.IsValid() && upperBound.IsValid(); - return valid; -} - -inline bool b2TestOverlap(const b2AABB& a, const b2AABB& b) -{ - b2Vec2 d1, d2; - d1 = b.lowerBound - a.upperBound; - d2 = a.lowerBound - b.upperBound; - - if (d1.x > 0.0f || d1.y > 0.0f) - return false; - - if (d2.x > 0.0f || d2.y > 0.0f) - return false; - - return true; -} - -#endif diff --git a/external/box2d/Collision/b2Distance.cpp b/external/box2d/Collision/b2Distance.cpp deleted file mode 100644 index ac67d3be43..0000000000 --- a/external/box2d/Collision/b2Distance.cpp +++ /dev/null @@ -1,603 +0,0 @@ -/* -* Copyright (c) 2007-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include -#include -#include - -// GJK using Voronoi regions (Christer Ericson) and Barycentric coordinates. -int32 b2_gjkCalls, b2_gjkIters, b2_gjkMaxIters; - -void b2DistanceProxy::Set(const b2Shape* shape, int32 index) -{ - switch (shape->GetType()) - { - case b2Shape::e_circle: - { - const b2CircleShape* circle = (b2CircleShape*)shape; - m_vertices = &circle->m_p; - m_count = 1; - m_radius = circle->m_radius; - } - break; - - case b2Shape::e_polygon: - { - const b2PolygonShape* polygon = (b2PolygonShape*)shape; - m_vertices = polygon->m_vertices; - m_count = polygon->m_vertexCount; - m_radius = polygon->m_radius; - } - break; - - case b2Shape::e_chain: - { - const b2ChainShape* chain = (b2ChainShape*)shape; - b2Assert(0 <= index && index < chain->m_count); - - m_buffer[0] = chain->m_vertices[index]; - if (index + 1 < chain->m_count) - { - m_buffer[1] = chain->m_vertices[index + 1]; - } - else - { - m_buffer[1] = chain->m_vertices[0]; - } - - m_vertices = m_buffer; - m_count = 2; - m_radius = chain->m_radius; - } - break; - - case b2Shape::e_edge: - { - const b2EdgeShape* edge = (b2EdgeShape*)shape; - m_vertices = &edge->m_vertex1; - m_count = 2; - m_radius = edge->m_radius; - } - break; - - default: - b2Assert(false); - } -} - - -struct b2SimplexVertex -{ - b2Vec2 wA; // support point in proxyA - b2Vec2 wB; // support point in proxyB - b2Vec2 w; // wB - wA - float32 a; // barycentric coordinate for closest point - int32 indexA; // wA index - int32 indexB; // wB index -}; - -struct b2Simplex -{ - void ReadCache( const b2SimplexCache* cache, - const b2DistanceProxy* proxyA, const b2Transform& transformA, - const b2DistanceProxy* proxyB, const b2Transform& transformB) - { - b2Assert(cache->count <= 3); - - // Copy data from cache. - m_count = cache->count; - b2SimplexVertex* vertices = &m_v1; - for (int32 i = 0; i < m_count; ++i) - { - b2SimplexVertex* v = vertices + i; - v->indexA = cache->indexA[i]; - v->indexB = cache->indexB[i]; - b2Vec2 wALocal = proxyA->GetVertex(v->indexA); - b2Vec2 wBLocal = proxyB->GetVertex(v->indexB); - v->wA = b2Mul(transformA, wALocal); - v->wB = b2Mul(transformB, wBLocal); - v->w = v->wB - v->wA; - v->a = 0.0f; - } - - // Compute the new simplex metric, if it is substantially different than - // old metric then flush the simplex. - if (m_count > 1) - { - float32 metric1 = cache->metric; - float32 metric2 = GetMetric(); - if (metric2 < 0.5f * metric1 || 2.0f * metric1 < metric2 || metric2 < b2_epsilon) - { - // Reset the simplex. - m_count = 0; - } - } - - // If the cache is empty or invalid ... - if (m_count == 0) - { - b2SimplexVertex* v = vertices + 0; - v->indexA = 0; - v->indexB = 0; - b2Vec2 wALocal = proxyA->GetVertex(0); - b2Vec2 wBLocal = proxyB->GetVertex(0); - v->wA = b2Mul(transformA, wALocal); - v->wB = b2Mul(transformB, wBLocal); - v->w = v->wB - v->wA; - m_count = 1; - } - } - - void WriteCache(b2SimplexCache* cache) const - { - cache->metric = GetMetric(); - cache->count = uint16(m_count); - const b2SimplexVertex* vertices = &m_v1; - for (int32 i = 0; i < m_count; ++i) - { - cache->indexA[i] = uint8(vertices[i].indexA); - cache->indexB[i] = uint8(vertices[i].indexB); - } - } - - b2Vec2 GetSearchDirection() const - { - switch (m_count) - { - case 1: - return -m_v1.w; - - case 2: - { - b2Vec2 e12 = m_v2.w - m_v1.w; - float32 sgn = b2Cross(e12, -m_v1.w); - if (sgn > 0.0f) - { - // Origin is left of e12. - return b2Cross(1.0f, e12); - } - else - { - // Origin is right of e12. - return b2Cross(e12, 1.0f); - } - } - - default: - b2Assert(false); - return b2Vec2_zero; - } - } - - b2Vec2 GetClosestPoint() const - { - switch (m_count) - { - case 0: - b2Assert(false); - return b2Vec2_zero; - - case 1: - return m_v1.w; - - case 2: - return m_v1.a * m_v1.w + m_v2.a * m_v2.w; - - case 3: - return b2Vec2_zero; - - default: - b2Assert(false); - return b2Vec2_zero; - } - } - - void GetWitnessPoints(b2Vec2* pA, b2Vec2* pB) const - { - switch (m_count) - { - case 0: - b2Assert(false); - break; - - case 1: - *pA = m_v1.wA; - *pB = m_v1.wB; - break; - - case 2: - *pA = m_v1.a * m_v1.wA + m_v2.a * m_v2.wA; - *pB = m_v1.a * m_v1.wB + m_v2.a * m_v2.wB; - break; - - case 3: - *pA = m_v1.a * m_v1.wA + m_v2.a * m_v2.wA + m_v3.a * m_v3.wA; - *pB = *pA; - break; - - default: - b2Assert(false); - break; - } - } - - float32 GetMetric() const - { - switch (m_count) - { - case 0: - b2Assert(false); - return 0.0; - - case 1: - return 0.0f; - - case 2: - return b2Distance(m_v1.w, m_v2.w); - - case 3: - return b2Cross(m_v2.w - m_v1.w, m_v3.w - m_v1.w); - - default: - b2Assert(false); - return 0.0f; - } - } - - void Solve2(); - void Solve3(); - - b2SimplexVertex m_v1, m_v2, m_v3; - int32 m_count; -}; - - -// Solve a line segment using barycentric coordinates. -// -// p = a1 * w1 + a2 * w2 -// a1 + a2 = 1 -// -// The vector from the origin to the closest point on the line is -// perpendicular to the line. -// e12 = w2 - w1 -// dot(p, e) = 0 -// a1 * dot(w1, e) + a2 * dot(w2, e) = 0 -// -// 2-by-2 linear system -// [1 1 ][a1] = [1] -// [w1.e12 w2.e12][a2] = [0] -// -// Define -// d12_1 = dot(w2, e12) -// d12_2 = -dot(w1, e12) -// d12 = d12_1 + d12_2 -// -// Solution -// a1 = d12_1 / d12 -// a2 = d12_2 / d12 -void b2Simplex::Solve2() -{ - b2Vec2 w1 = m_v1.w; - b2Vec2 w2 = m_v2.w; - b2Vec2 e12 = w2 - w1; - - // w1 region - float32 d12_2 = -b2Dot(w1, e12); - if (d12_2 <= 0.0f) - { - // a2 <= 0, so we clamp it to 0 - m_v1.a = 1.0f; - m_count = 1; - return; - } - - // w2 region - float32 d12_1 = b2Dot(w2, e12); - if (d12_1 <= 0.0f) - { - // a1 <= 0, so we clamp it to 0 - m_v2.a = 1.0f; - m_count = 1; - m_v1 = m_v2; - return; - } - - // Must be in e12 region. - float32 inv_d12 = 1.0f / (d12_1 + d12_2); - m_v1.a = d12_1 * inv_d12; - m_v2.a = d12_2 * inv_d12; - m_count = 2; -} - -// Possible regions: -// - points[2] -// - edge points[0]-points[2] -// - edge points[1]-points[2] -// - inside the triangle -void b2Simplex::Solve3() -{ - b2Vec2 w1 = m_v1.w; - b2Vec2 w2 = m_v2.w; - b2Vec2 w3 = m_v3.w; - - // Edge12 - // [1 1 ][a1] = [1] - // [w1.e12 w2.e12][a2] = [0] - // a3 = 0 - b2Vec2 e12 = w2 - w1; - float32 w1e12 = b2Dot(w1, e12); - float32 w2e12 = b2Dot(w2, e12); - float32 d12_1 = w2e12; - float32 d12_2 = -w1e12; - - // Edge13 - // [1 1 ][a1] = [1] - // [w1.e13 w3.e13][a3] = [0] - // a2 = 0 - b2Vec2 e13 = w3 - w1; - float32 w1e13 = b2Dot(w1, e13); - float32 w3e13 = b2Dot(w3, e13); - float32 d13_1 = w3e13; - float32 d13_2 = -w1e13; - - // Edge23 - // [1 1 ][a2] = [1] - // [w2.e23 w3.e23][a3] = [0] - // a1 = 0 - b2Vec2 e23 = w3 - w2; - float32 w2e23 = b2Dot(w2, e23); - float32 w3e23 = b2Dot(w3, e23); - float32 d23_1 = w3e23; - float32 d23_2 = -w2e23; - - // Triangle123 - float32 n123 = b2Cross(e12, e13); - - float32 d123_1 = n123 * b2Cross(w2, w3); - float32 d123_2 = n123 * b2Cross(w3, w1); - float32 d123_3 = n123 * b2Cross(w1, w2); - - // w1 region - if (d12_2 <= 0.0f && d13_2 <= 0.0f) - { - m_v1.a = 1.0f; - m_count = 1; - return; - } - - // e12 - if (d12_1 > 0.0f && d12_2 > 0.0f && d123_3 <= 0.0f) - { - float32 inv_d12 = 1.0f / (d12_1 + d12_2); - m_v1.a = d12_1 * inv_d12; - m_v2.a = d12_2 * inv_d12; - m_count = 2; - return; - } - - // e13 - if (d13_1 > 0.0f && d13_2 > 0.0f && d123_2 <= 0.0f) - { - float32 inv_d13 = 1.0f / (d13_1 + d13_2); - m_v1.a = d13_1 * inv_d13; - m_v3.a = d13_2 * inv_d13; - m_count = 2; - m_v2 = m_v3; - return; - } - - // w2 region - if (d12_1 <= 0.0f && d23_2 <= 0.0f) - { - m_v2.a = 1.0f; - m_count = 1; - m_v1 = m_v2; - return; - } - - // w3 region - if (d13_1 <= 0.0f && d23_1 <= 0.0f) - { - m_v3.a = 1.0f; - m_count = 1; - m_v1 = m_v3; - return; - } - - // e23 - if (d23_1 > 0.0f && d23_2 > 0.0f && d123_1 <= 0.0f) - { - float32 inv_d23 = 1.0f / (d23_1 + d23_2); - m_v2.a = d23_1 * inv_d23; - m_v3.a = d23_2 * inv_d23; - m_count = 2; - m_v1 = m_v3; - return; - } - - // Must be in triangle123 - float32 inv_d123 = 1.0f / (d123_1 + d123_2 + d123_3); - m_v1.a = d123_1 * inv_d123; - m_v2.a = d123_2 * inv_d123; - m_v3.a = d123_3 * inv_d123; - m_count = 3; -} - -void b2Distance(b2DistanceOutput* output, - b2SimplexCache* cache, - const b2DistanceInput* input) -{ - ++b2_gjkCalls; - - const b2DistanceProxy* proxyA = &input->proxyA; - const b2DistanceProxy* proxyB = &input->proxyB; - - b2Transform transformA = input->transformA; - b2Transform transformB = input->transformB; - - // Initialize the simplex. - b2Simplex simplex; - simplex.ReadCache(cache, proxyA, transformA, proxyB, transformB); - - // Get simplex vertices as an array. - b2SimplexVertex* vertices = &simplex.m_v1; - const int32 k_maxIters = 20; - - // These store the vertices of the last simplex so that we - // can check for duplicates and prevent cycling. - int32 saveA[3], saveB[3]; - int32 saveCount = 0; - - b2Vec2 closestPoint = simplex.GetClosestPoint(); - float32 distanceSqr1 = closestPoint.LengthSquared(); - float32 distanceSqr2 = distanceSqr1; - - // Main iteration loop. - int32 iter = 0; - while (iter < k_maxIters) - { - // Copy simplex so we can identify duplicates. - saveCount = simplex.m_count; - for (int32 i = 0; i < saveCount; ++i) - { - saveA[i] = vertices[i].indexA; - saveB[i] = vertices[i].indexB; - } - - switch (simplex.m_count) - { - case 1: - break; - - case 2: - simplex.Solve2(); - break; - - case 3: - simplex.Solve3(); - break; - - default: - b2Assert(false); - } - - // If we have 3 points, then the origin is in the corresponding triangle. - if (simplex.m_count == 3) - { - break; - } - - // Compute closest point. - b2Vec2 p = simplex.GetClosestPoint(); - distanceSqr2 = p.LengthSquared(); - - // Ensure progress - if (distanceSqr2 >= distanceSqr1) - { - //break; - } - distanceSqr1 = distanceSqr2; - - // Get search direction. - b2Vec2 d = simplex.GetSearchDirection(); - - // Ensure the search direction is numerically fit. - if (d.LengthSquared() < b2_epsilon * b2_epsilon) - { - // The origin is probably contained by a line segment - // or triangle. Thus the shapes are overlapped. - - // We can't return zero here even though there may be overlap. - // In case the simplex is a point, segment, or triangle it is difficult - // to determine if the origin is contained in the CSO or very close to it. - break; - } - - // Compute a tentative new simplex vertex using support points. - b2SimplexVertex* vertex = vertices + simplex.m_count; - vertex->indexA = proxyA->GetSupport(b2MulT(transformA.q, -d)); - vertex->wA = b2Mul(transformA, proxyA->GetVertex(vertex->indexA)); - b2Vec2 wBLocal; - vertex->indexB = proxyB->GetSupport(b2MulT(transformB.q, d)); - vertex->wB = b2Mul(transformB, proxyB->GetVertex(vertex->indexB)); - vertex->w = vertex->wB - vertex->wA; - - // Iteration count is equated to the number of support point calls. - ++iter; - ++b2_gjkIters; - - // Check for duplicate support points. This is the main termination criteria. - bool duplicate = false; - for (int32 i = 0; i < saveCount; ++i) - { - if (vertex->indexA == saveA[i] && vertex->indexB == saveB[i]) - { - duplicate = true; - break; - } - } - - // If we found a duplicate support point we must exit to avoid cycling. - if (duplicate) - { - break; - } - - // New vertex is ok and needed. - ++simplex.m_count; - } - - b2_gjkMaxIters = b2Max(b2_gjkMaxIters, iter); - - // Prepare output. - simplex.GetWitnessPoints(&output->pointA, &output->pointB); - output->distance = b2Distance(output->pointA, output->pointB); - output->iterations = iter; - - // Cache the simplex. - simplex.WriteCache(cache); - - // Apply radii if requested. - if (input->useRadii) - { - float32 rA = proxyA->m_radius; - float32 rB = proxyB->m_radius; - - if (output->distance > rA + rB && output->distance > b2_epsilon) - { - // Shapes are still no overlapped. - // Move the witness points to the outer surface. - output->distance -= rA + rB; - b2Vec2 normal = output->pointB - output->pointA; - normal.Normalize(); - output->pointA += rA * normal; - output->pointB -= rB * normal; - } - else - { - // Shapes are overlapped when radii are considered. - // Move the witness points to the middle. - b2Vec2 p = 0.5f * (output->pointA + output->pointB); - output->pointA = p; - output->pointB = p; - output->distance = 0.0f; - } - } -} diff --git a/external/box2d/Collision/b2Distance.h b/external/box2d/Collision/b2Distance.h deleted file mode 100644 index d598b7339d..0000000000 --- a/external/box2d/Collision/b2Distance.h +++ /dev/null @@ -1,141 +0,0 @@ - -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_DISTANCE_H -#define B2_DISTANCE_H - -#include - -class b2Shape; - -/// A distance proxy is used by the GJK algorithm. -/// It encapsulates any shape. -struct b2DistanceProxy -{ - b2DistanceProxy() : m_vertices(NULL), m_count(0), m_radius(0.0f) {} - - /// Initialize the proxy using the given shape. The shape - /// must remain in scope while the proxy is in use. - void Set(const b2Shape* shape, int32 index); - - /// Get the supporting vertex index in the given direction. - int32 GetSupport(const b2Vec2& d) const; - - /// Get the supporting vertex in the given direction. - const b2Vec2& GetSupportVertex(const b2Vec2& d) const; - - /// Get the vertex count. - int32 GetVertexCount() const; - - /// Get a vertex by index. Used by b2Distance. - const b2Vec2& GetVertex(int32 index) const; - - b2Vec2 m_buffer[2]; - const b2Vec2* m_vertices; - int32 m_count; - float32 m_radius; -}; - -/// Used to warm start b2Distance. -/// Set count to zero on first call. -struct b2SimplexCache -{ - float32 metric; ///< length or area - uint16 count; - uint8 indexA[3]; ///< vertices on shape A - uint8 indexB[3]; ///< vertices on shape B -}; - -/// Input for b2Distance. -/// You have to option to use the shape radii -/// in the computation. Even -struct b2DistanceInput -{ - b2DistanceProxy proxyA; - b2DistanceProxy proxyB; - b2Transform transformA; - b2Transform transformB; - bool useRadii; -}; - -/// Output for b2Distance. -struct b2DistanceOutput -{ - b2Vec2 pointA; ///< closest point on shapeA - b2Vec2 pointB; ///< closest point on shapeB - float32 distance; - int32 iterations; ///< number of GJK iterations used -}; - -/// Compute the closest points between two shapes. Supports any combination of: -/// b2CircleShape, b2PolygonShape, b2EdgeShape. The simplex cache is input/output. -/// On the first call set b2SimplexCache.count to zero. -void b2Distance(b2DistanceOutput* output, - b2SimplexCache* cache, - const b2DistanceInput* input); - - -////////////////////////////////////////////////////////////////////////// - -inline int32 b2DistanceProxy::GetVertexCount() const -{ - return m_count; -} - -inline const b2Vec2& b2DistanceProxy::GetVertex(int32 index) const -{ - b2Assert(0 <= index && index < m_count); - return m_vertices[index]; -} - -inline int32 b2DistanceProxy::GetSupport(const b2Vec2& d) const -{ - int32 bestIndex = 0; - float32 bestValue = b2Dot(m_vertices[0], d); - for (int32 i = 1; i < m_count; ++i) - { - float32 value = b2Dot(m_vertices[i], d); - if (value > bestValue) - { - bestIndex = i; - bestValue = value; - } - } - - return bestIndex; -} - -inline const b2Vec2& b2DistanceProxy::GetSupportVertex(const b2Vec2& d) const -{ - int32 bestIndex = 0; - float32 bestValue = b2Dot(m_vertices[0], d); - for (int32 i = 1; i < m_count; ++i) - { - float32 value = b2Dot(m_vertices[i], d); - if (value > bestValue) - { - bestIndex = i; - bestValue = value; - } - } - - return m_vertices[bestIndex]; -} - -#endif diff --git a/external/box2d/Collision/b2DynamicTree.cpp b/external/box2d/Collision/b2DynamicTree.cpp deleted file mode 100644 index d1d53297e2..0000000000 --- a/external/box2d/Collision/b2DynamicTree.cpp +++ /dev/null @@ -1,775 +0,0 @@ -/* -* Copyright (c) 2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#ifndef SHP -#include -#else -#include -#endif -using namespace std; - - -b2DynamicTree::b2DynamicTree() -{ - m_root = b2_nullNode; - - m_nodeCapacity = 16; - m_nodeCount = 0; - m_nodes = (b2TreeNode*)b2Alloc(m_nodeCapacity * sizeof(b2TreeNode)); - memset(m_nodes, 0, m_nodeCapacity * sizeof(b2TreeNode)); - - // Build a linked list for the free list. - for (int32 i = 0; i < m_nodeCapacity - 1; ++i) - { - m_nodes[i].next = i + 1; - m_nodes[i].height = -1; - } - m_nodes[m_nodeCapacity-1].next = b2_nullNode; - m_nodes[m_nodeCapacity-1].height = -1; - m_freeList = 0; - - m_path = 0; - - m_insertionCount = 0; -} - -b2DynamicTree::~b2DynamicTree() -{ - // This frees the entire tree in one shot. - b2Free(m_nodes); -} - -// Allocate a node from the pool. Grow the pool if necessary. -int32 b2DynamicTree::AllocateNode() -{ - // Expand the node pool as needed. - if (m_freeList == b2_nullNode) - { - b2Assert(m_nodeCount == m_nodeCapacity); - - // The free list is empty. Rebuild a bigger pool. - b2TreeNode* oldNodes = m_nodes; - m_nodeCapacity *= 2; - m_nodes = (b2TreeNode*)b2Alloc(m_nodeCapacity * sizeof(b2TreeNode)); - memcpy(m_nodes, oldNodes, m_nodeCount * sizeof(b2TreeNode)); - b2Free(oldNodes); - - // Build a linked list for the free list. The parent - // pointer becomes the "next" pointer. - for (int32 i = m_nodeCount; i < m_nodeCapacity - 1; ++i) - { - m_nodes[i].next = i + 1; - m_nodes[i].height = -1; - } - m_nodes[m_nodeCapacity-1].next = b2_nullNode; - m_nodes[m_nodeCapacity-1].height = -1; - m_freeList = m_nodeCount; - } - - // Peel a node off the free list. - int32 nodeId = m_freeList; - m_freeList = m_nodes[nodeId].next; - m_nodes[nodeId].parent = b2_nullNode; - m_nodes[nodeId].child1 = b2_nullNode; - m_nodes[nodeId].child2 = b2_nullNode; - m_nodes[nodeId].height = 0; - m_nodes[nodeId].userData = NULL; - ++m_nodeCount; - return nodeId; -} - -// Return a node to the pool. -void b2DynamicTree::FreeNode(int32 nodeId) -{ - b2Assert(0 <= nodeId && nodeId < m_nodeCapacity); - b2Assert(0 < m_nodeCount); - m_nodes[nodeId].next = m_freeList; - m_nodes[nodeId].height = -1; - m_freeList = nodeId; - --m_nodeCount; -} - -// Create a proxy in the tree as a leaf node. We return the index -// of the node instead of a pointer so that we can grow -// the node pool. -int32 b2DynamicTree::CreateProxy(const b2AABB& aabb, void* userData) -{ - int32 proxyId = AllocateNode(); - - // Fatten the aabb. - b2Vec2 r(b2_aabbExtension, b2_aabbExtension); - m_nodes[proxyId].aabb.lowerBound = aabb.lowerBound - r; - m_nodes[proxyId].aabb.upperBound = aabb.upperBound + r; - m_nodes[proxyId].userData = userData; - m_nodes[proxyId].height = 0; - - InsertLeaf(proxyId); - - return proxyId; -} - -void b2DynamicTree::DestroyProxy(int32 proxyId) -{ - b2Assert(0 <= proxyId && proxyId < m_nodeCapacity); - b2Assert(m_nodes[proxyId].IsLeaf()); - - RemoveLeaf(proxyId); - FreeNode(proxyId); -} - -bool b2DynamicTree::MoveProxy(int32 proxyId, const b2AABB& aabb, const b2Vec2& displacement) -{ - b2Assert(0 <= proxyId && proxyId < m_nodeCapacity); - - b2Assert(m_nodes[proxyId].IsLeaf()); - - if (m_nodes[proxyId].aabb.Contains(aabb)) - { - return false; - } - - RemoveLeaf(proxyId); - - // Extend AABB. - b2AABB b = aabb; - b2Vec2 r(b2_aabbExtension, b2_aabbExtension); - b.lowerBound = b.lowerBound - r; - b.upperBound = b.upperBound + r; - - // Predict AABB displacement. - b2Vec2 d = b2_aabbMultiplier * displacement; - - if (d.x < 0.0f) - { - b.lowerBound.x += d.x; - } - else - { - b.upperBound.x += d.x; - } - - if (d.y < 0.0f) - { - b.lowerBound.y += d.y; - } - else - { - b.upperBound.y += d.y; - } - - m_nodes[proxyId].aabb = b; - - InsertLeaf(proxyId); - return true; -} - -void b2DynamicTree::InsertLeaf(int32 leaf) -{ - ++m_insertionCount; - - if (m_root == b2_nullNode) - { - m_root = leaf; - m_nodes[m_root].parent = b2_nullNode; - return; - } - - // Find the best sibling for this node - b2AABB leafAABB = m_nodes[leaf].aabb; - int32 index = m_root; - while (m_nodes[index].IsLeaf() == false) - { - int32 child1 = m_nodes[index].child1; - int32 child2 = m_nodes[index].child2; - - float32 area = m_nodes[index].aabb.GetPerimeter(); - - b2AABB combinedAABB; - combinedAABB.Combine(m_nodes[index].aabb, leafAABB); - float32 combinedArea = combinedAABB.GetPerimeter(); - - // Cost of creating a new parent for this node and the new leaf - float32 cost = 2.0f * combinedArea; - - // Minimum cost of pushing the leaf further down the tree - float32 inheritanceCost = 2.0f * (combinedArea - area); - - // Cost of descending into child1 - float32 cost1; - if (m_nodes[child1].IsLeaf()) - { - b2AABB aabb; - aabb.Combine(leafAABB, m_nodes[child1].aabb); - cost1 = aabb.GetPerimeter() + inheritanceCost; - } - else - { - b2AABB aabb; - aabb.Combine(leafAABB, m_nodes[child1].aabb); - float32 oldArea = m_nodes[child1].aabb.GetPerimeter(); - float32 newArea = aabb.GetPerimeter(); - cost1 = (newArea - oldArea) + inheritanceCost; - } - - // Cost of descending into child2 - float32 cost2; - if (m_nodes[child2].IsLeaf()) - { - b2AABB aabb; - aabb.Combine(leafAABB, m_nodes[child2].aabb); - cost2 = aabb.GetPerimeter() + inheritanceCost; - } - else - { - b2AABB aabb; - aabb.Combine(leafAABB, m_nodes[child2].aabb); - float32 oldArea = m_nodes[child2].aabb.GetPerimeter(); - float32 newArea = aabb.GetPerimeter(); - cost2 = newArea - oldArea + inheritanceCost; - } - - // Descend according to the minimum cost. - if (cost < cost1 && cost < cost2) - { - break; - } - - // Descend - if (cost1 < cost2) - { - index = child1; - } - else - { - index = child2; - } - } - - int32 sibling = index; - - // Create a new parent. - int32 oldParent = m_nodes[sibling].parent; - int32 newParent = AllocateNode(); - m_nodes[newParent].parent = oldParent; - m_nodes[newParent].userData = NULL; - m_nodes[newParent].aabb.Combine(leafAABB, m_nodes[sibling].aabb); - m_nodes[newParent].height = m_nodes[sibling].height + 1; - - if (oldParent != b2_nullNode) - { - // The sibling was not the root. - if (m_nodes[oldParent].child1 == sibling) - { - m_nodes[oldParent].child1 = newParent; - } - else - { - m_nodes[oldParent].child2 = newParent; - } - - m_nodes[newParent].child1 = sibling; - m_nodes[newParent].child2 = leaf; - m_nodes[sibling].parent = newParent; - m_nodes[leaf].parent = newParent; - } - else - { - // The sibling was the root. - m_nodes[newParent].child1 = sibling; - m_nodes[newParent].child2 = leaf; - m_nodes[sibling].parent = newParent; - m_nodes[leaf].parent = newParent; - m_root = newParent; - } - - // Walk back up the tree fixing heights and AABBs - index = m_nodes[leaf].parent; - while (index != b2_nullNode) - { - index = Balance(index); - - int32 child1 = m_nodes[index].child1; - int32 child2 = m_nodes[index].child2; - - b2Assert(child1 != b2_nullNode); - b2Assert(child2 != b2_nullNode); - - m_nodes[index].height = 1 + b2Max(m_nodes[child1].height, m_nodes[child2].height); - m_nodes[index].aabb.Combine(m_nodes[child1].aabb, m_nodes[child2].aabb); - - index = m_nodes[index].parent; - } - - //Validate(); -} - -void b2DynamicTree::RemoveLeaf(int32 leaf) -{ - if (leaf == m_root) - { - m_root = b2_nullNode; - return; - } - - int32 parent = m_nodes[leaf].parent; - int32 grandParent = m_nodes[parent].parent; - int32 sibling; - if (m_nodes[parent].child1 == leaf) - { - sibling = m_nodes[parent].child2; - } - else - { - sibling = m_nodes[parent].child1; - } - - if (grandParent != b2_nullNode) - { - // Destroy parent and connect sibling to grandParent. - if (m_nodes[grandParent].child1 == parent) - { - m_nodes[grandParent].child1 = sibling; - } - else - { - m_nodes[grandParent].child2 = sibling; - } - m_nodes[sibling].parent = grandParent; - FreeNode(parent); - - // Adjust ancestor bounds. - int32 index = grandParent; - while (index != b2_nullNode) - { - index = Balance(index); - - int32 child1 = m_nodes[index].child1; - int32 child2 = m_nodes[index].child2; - - m_nodes[index].aabb.Combine(m_nodes[child1].aabb, m_nodes[child2].aabb); - m_nodes[index].height = 1 + b2Max(m_nodes[child1].height, m_nodes[child2].height); - - index = m_nodes[index].parent; - } - } - else - { - m_root = sibling; - m_nodes[sibling].parent = b2_nullNode; - FreeNode(parent); - } - - //Validate(); -} - -// Perform a left or right rotation if node A is imbalanced. -// Returns the new root index. -int32 b2DynamicTree::Balance(int32 iA) -{ - b2Assert(iA != b2_nullNode); - - b2TreeNode* A = m_nodes + iA; - if (A->IsLeaf() || A->height < 2) - { - return iA; - } - - int32 iB = A->child1; - int32 iC = A->child2; - b2Assert(0 <= iB && iB < m_nodeCapacity); - b2Assert(0 <= iC && iC < m_nodeCapacity); - - b2TreeNode* B = m_nodes + iB; - b2TreeNode* C = m_nodes + iC; - - int32 balance = C->height - B->height; - - // Rotate C up - if (balance > 1) - { - int32 iF = C->child1; - int32 iG = C->child2; - b2TreeNode* F = m_nodes + iF; - b2TreeNode* G = m_nodes + iG; - b2Assert(0 <= iF && iF < m_nodeCapacity); - b2Assert(0 <= iG && iG < m_nodeCapacity); - - // Swap A and C - C->child1 = iA; - C->parent = A->parent; - A->parent = iC; - - // A's old parent should point to C - if (C->parent != b2_nullNode) - { - if (m_nodes[C->parent].child1 == iA) - { - m_nodes[C->parent].child1 = iC; - } - else - { - b2Assert(m_nodes[C->parent].child2 == iA); - m_nodes[C->parent].child2 = iC; - } - } - else - { - m_root = iC; - } - - // Rotate - if (F->height > G->height) - { - C->child2 = iF; - A->child2 = iG; - G->parent = iA; - A->aabb.Combine(B->aabb, G->aabb); - C->aabb.Combine(A->aabb, F->aabb); - - A->height = 1 + b2Max(B->height, G->height); - C->height = 1 + b2Max(A->height, F->height); - } - else - { - C->child2 = iG; - A->child2 = iF; - F->parent = iA; - A->aabb.Combine(B->aabb, F->aabb); - C->aabb.Combine(A->aabb, G->aabb); - - A->height = 1 + b2Max(B->height, F->height); - C->height = 1 + b2Max(A->height, G->height); - } - - return iC; - } - - // Rotate B up - if (balance < -1) - { - int32 iD = B->child1; - int32 iE = B->child2; - b2TreeNode* D = m_nodes + iD; - b2TreeNode* E = m_nodes + iE; - b2Assert(0 <= iD && iD < m_nodeCapacity); - b2Assert(0 <= iE && iE < m_nodeCapacity); - - // Swap A and B - B->child1 = iA; - B->parent = A->parent; - A->parent = iB; - - // A's old parent should point to B - if (B->parent != b2_nullNode) - { - if (m_nodes[B->parent].child1 == iA) - { - m_nodes[B->parent].child1 = iB; - } - else - { - b2Assert(m_nodes[B->parent].child2 == iA); - m_nodes[B->parent].child2 = iB; - } - } - else - { - m_root = iB; - } - - // Rotate - if (D->height > E->height) - { - B->child2 = iD; - A->child1 = iE; - E->parent = iA; - A->aabb.Combine(C->aabb, E->aabb); - B->aabb.Combine(A->aabb, D->aabb); - - A->height = 1 + b2Max(C->height, E->height); - B->height = 1 + b2Max(A->height, D->height); - } - else - { - B->child2 = iE; - A->child1 = iD; - D->parent = iA; - A->aabb.Combine(C->aabb, D->aabb); - B->aabb.Combine(A->aabb, E->aabb); - - A->height = 1 + b2Max(C->height, D->height); - B->height = 1 + b2Max(A->height, E->height); - } - - return iB; - } - - return iA; -} - -int32 b2DynamicTree::GetHeight() const -{ - if (m_root == b2_nullNode) - { - return 0; - } - - return m_nodes[m_root].height; -} - -// -float32 b2DynamicTree::GetAreaRatio() const -{ - if (m_root == b2_nullNode) - { - return 0.0f; - } - - const b2TreeNode* root = m_nodes + m_root; - float32 rootArea = root->aabb.GetPerimeter(); - - float32 totalArea = 0.0f; - for (int32 i = 0; i < m_nodeCapacity; ++i) - { - const b2TreeNode* node = m_nodes + i; - if (node->height < 0) - { - // Free node in pool - continue; - } - - totalArea += node->aabb.GetPerimeter(); - } - - return totalArea / rootArea; -} - -// Compute the height of a sub-tree. -int32 b2DynamicTree::ComputeHeight(int32 nodeId) const -{ - b2Assert(0 <= nodeId && nodeId < m_nodeCapacity); - b2TreeNode* node = m_nodes + nodeId; - - if (node->IsLeaf()) - { - return 0; - } - - int32 height1 = ComputeHeight(node->child1); - int32 height2 = ComputeHeight(node->child2); - return 1 + b2Max(height1, height2); -} - -int32 b2DynamicTree::ComputeHeight() const -{ - int32 height = ComputeHeight(m_root); - return height; -} - -void b2DynamicTree::ValidateStructure(int32 index) const -{ - if (index == b2_nullNode) - { - return; - } - - if (index == m_root) - { - b2Assert(m_nodes[index].parent == b2_nullNode); - } - - const b2TreeNode* node = m_nodes + index; - - int32 child1 = node->child1; - int32 child2 = node->child2; - - if (node->IsLeaf()) - { - b2Assert(child1 == b2_nullNode); - b2Assert(child2 == b2_nullNode); - b2Assert(node->height == 0); - return; - } - - b2Assert(0 <= child1 && child1 < m_nodeCapacity); - b2Assert(0 <= child2 && child2 < m_nodeCapacity); - - b2Assert(m_nodes[child1].parent == index); - b2Assert(m_nodes[child2].parent == index); - - ValidateStructure(child1); - ValidateStructure(child2); -} - -void b2DynamicTree::ValidateMetrics(int32 index) const -{ - if (index == b2_nullNode) - { - return; - } - - const b2TreeNode* node = m_nodes + index; - - int32 child1 = node->child1; - int32 child2 = node->child2; - - if (node->IsLeaf()) - { - b2Assert(child1 == b2_nullNode); - b2Assert(child2 == b2_nullNode); - b2Assert(node->height == 0); - return; - } - - b2Assert(0 <= child1 && child1 < m_nodeCapacity); - b2Assert(0 <= child2 && child2 < m_nodeCapacity); - - int32 height1 = m_nodes[child1].height; - int32 height2 = m_nodes[child2].height; - int32 height; - height = 1 + b2Max(height1, height2); - b2Assert(node->height == height); - - b2AABB aabb; - aabb.Combine(m_nodes[child1].aabb, m_nodes[child2].aabb); - - b2Assert(aabb.lowerBound == node->aabb.lowerBound); - b2Assert(aabb.upperBound == node->aabb.upperBound); - - ValidateMetrics(child1); - ValidateMetrics(child2); -} - -void b2DynamicTree::Validate() const -{ - ValidateStructure(m_root); - ValidateMetrics(m_root); - - int32 freeCount = 0; - int32 freeIndex = m_freeList; - while (freeIndex != b2_nullNode) - { - b2Assert(0 <= freeIndex && freeIndex < m_nodeCapacity); - freeIndex = m_nodes[freeIndex].next; - ++freeCount; - } - - b2Assert(GetHeight() == ComputeHeight()); - - b2Assert(m_nodeCount + freeCount == m_nodeCapacity); -} - -int32 b2DynamicTree::GetMaxBalance() const -{ - int32 maxBalance = 0; - for (int32 i = 0; i < m_nodeCapacity; ++i) - { - const b2TreeNode* node = m_nodes + i; - if (node->height <= 1) - { - continue; - } - - b2Assert(node->IsLeaf() == false); - - int32 child1 = node->child1; - int32 child2 = node->child2; - int32 balance = b2Abs(m_nodes[child2].height - m_nodes[child1].height); - maxBalance = b2Max(maxBalance, balance); - } - - return maxBalance; -} - -void b2DynamicTree::RebuildBottomUp() -{ - int32* nodes = (int32*)b2Alloc(m_nodeCount * sizeof(int32)); - int32 count = 0; - - // Build array of leaves. Free the rest. - for (int32 i = 0; i < m_nodeCapacity; ++i) - { - if (m_nodes[i].height < 0) - { - // free node in pool - continue; - } - - if (m_nodes[i].IsLeaf()) - { - m_nodes[i].parent = b2_nullNode; - nodes[count] = i; - ++count; - } - else - { - FreeNode(i); - } - } - - while (count > 1) - { - float32 minCost = b2_maxFloat; - int32 iMin = -1, jMin = -1; - for (int32 i = 0; i < count; ++i) - { - b2AABB aabbi = m_nodes[nodes[i]].aabb; - - for (int32 j = i + 1; j < count; ++j) - { - b2AABB aabbj = m_nodes[nodes[j]].aabb; - b2AABB b; - b.Combine(aabbi, aabbj); - float32 cost = b.GetPerimeter(); - if (cost < minCost) - { - iMin = i; - jMin = j; - minCost = cost; - } - } - } - - int32 index1 = nodes[iMin]; - int32 index2 = nodes[jMin]; - b2TreeNode* child1 = m_nodes + index1; - b2TreeNode* child2 = m_nodes + index2; - - int32 parentIndex = AllocateNode(); - b2TreeNode* parent = m_nodes + parentIndex; - parent->child1 = index1; - parent->child2 = index2; - parent->height = 1 + b2Max(child1->height, child2->height); - parent->aabb.Combine(child1->aabb, child2->aabb); - parent->parent = b2_nullNode; - - child1->parent = parentIndex; - child2->parent = parentIndex; - - nodes[jMin] = nodes[count-1]; - nodes[iMin] = parentIndex; - --count; - } - - m_root = nodes[0]; - b2Free(nodes); - - Validate(); -} diff --git a/external/box2d/Collision/b2DynamicTree.h b/external/box2d/Collision/b2DynamicTree.h deleted file mode 100644 index 33f16b0f32..0000000000 --- a/external/box2d/Collision/b2DynamicTree.h +++ /dev/null @@ -1,284 +0,0 @@ -/* -* Copyright (c) 2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_DYNAMIC_TREE_H -#define B2_DYNAMIC_TREE_H - -#include -#include - -#define b2_nullNode (-1) - -/// A node in the dynamic tree. The client does not interact with this directly. -struct b2TreeNode -{ - bool IsLeaf() const - { - return child1 == b2_nullNode; - } - - /// Enlarged AABB - b2AABB aabb; - - void* userData; - - union - { - int32 parent; - int32 next; - }; - - int32 child1; - int32 child2; - - // leaf = 0, free node = -1 - int32 height; -}; - -/// A dynamic AABB tree broad-phase, inspired by Nathanael Presson's btDbvt. -/// A dynamic tree arranges data in a binary tree to accelerate -/// queries such as volume queries and ray casts. Leafs are proxies -/// with an AABB. In the tree we expand the proxy AABB by b2_fatAABBFactor -/// so that the proxy AABB is bigger than the client object. This allows the client -/// object to move by small amounts without triggering a tree update. -/// -/// Nodes are pooled and relocatable, so we use node indices rather than pointers. -class b2DynamicTree -{ -public: - /// Constructing the tree initializes the node pool. - b2DynamicTree(); - - /// Destroy the tree, freeing the node pool. - ~b2DynamicTree(); - - /// Create a proxy. Provide a tight fitting AABB and a userData pointer. - int32 CreateProxy(const b2AABB& aabb, void* userData); - - /// Destroy a proxy. This asserts if the id is invalid. - void DestroyProxy(int32 proxyId); - - /// Move a proxy with a swepted AABB. If the proxy has moved outside of its fattened AABB, - /// then the proxy is removed from the tree and re-inserted. Otherwise - /// the function returns immediately. - /// @return true if the proxy was re-inserted. - bool MoveProxy(int32 proxyId, const b2AABB& aabb1, const b2Vec2& displacement); - - /// Get proxy user data. - /// @return the proxy user data or 0 if the id is invalid. - void* GetUserData(int32 proxyId) const; - - /// Get the fat AABB for a proxy. - const b2AABB& GetFatAABB(int32 proxyId) const; - - /// Query an AABB for overlapping proxies. The callback class - /// is called for each proxy that overlaps the supplied AABB. - template - void Query(T* callback, const b2AABB& aabb) const; - - /// Ray-cast against the proxies in the tree. This relies on the callback - /// to perform a exact ray-cast in the case were the proxy contains a shape. - /// The callback also performs the any collision filtering. This has performance - /// roughly equal to k * log(n), where k is the number of collisions and n is the - /// number of proxies in the tree. - /// @param input the ray-cast input data. The ray extends from p1 to p1 + maxFraction * (p2 - p1). - /// @param callback a callback class that is called for each proxy that is hit by the ray. - template - void RayCast(T* callback, const b2RayCastInput& input) const; - - /// Validate this tree. For testing. - void Validate() const; - - /// Compute the height of the binary tree in O(N) time. Should not be - /// called often. - int32 GetHeight() const; - - /// Get the maximum balance of an node in the tree. The balance is the difference - /// in height of the two children of a node. - int32 GetMaxBalance() const; - - /// Get the ratio of the sum of the node areas to the root area. - float32 GetAreaRatio() const; - - /// Build an optimal tree. Very expensive. For testing. - void RebuildBottomUp(); - -private: - - int32 AllocateNode(); - void FreeNode(int32 node); - - void InsertLeaf(int32 node); - void RemoveLeaf(int32 node); - - int32 Balance(int32 index); - - int32 ComputeHeight() const; - int32 ComputeHeight(int32 nodeId) const; - - void ValidateStructure(int32 index) const; - void ValidateMetrics(int32 index) const; - - int32 m_root; - - b2TreeNode* m_nodes; - int32 m_nodeCount; - int32 m_nodeCapacity; - - int32 m_freeList; - - /// This is used to incrementally traverse the tree for re-balancing. - uint32 m_path; - - int32 m_insertionCount; -}; - -inline void* b2DynamicTree::GetUserData(int32 proxyId) const -{ - b2Assert(0 <= proxyId && proxyId < m_nodeCapacity); - return m_nodes[proxyId].userData; -} - -inline const b2AABB& b2DynamicTree::GetFatAABB(int32 proxyId) const -{ - b2Assert(0 <= proxyId && proxyId < m_nodeCapacity); - return m_nodes[proxyId].aabb; -} - -template -inline void b2DynamicTree::Query(T* callback, const b2AABB& aabb) const -{ - b2GrowableStack stack; - stack.Push(m_root); - - while (stack.GetCount() > 0) - { - int32 nodeId = stack.Pop(); - if (nodeId == b2_nullNode) - { - continue; - } - - const b2TreeNode* node = m_nodes + nodeId; - - if (b2TestOverlap(node->aabb, aabb)) - { - if (node->IsLeaf()) - { - bool proceed = callback->QueryCallback(nodeId); - if (proceed == false) - { - return; - } - } - else - { - stack.Push(node->child1); - stack.Push(node->child2); - } - } - } -} - -template -inline void b2DynamicTree::RayCast(T* callback, const b2RayCastInput& input) const -{ - b2Vec2 p1 = input.p1; - b2Vec2 p2 = input.p2; - b2Vec2 r = p2 - p1; - b2Assert(r.LengthSquared() > 0.0f); - r.Normalize(); - - // v is perpendicular to the segment. - b2Vec2 v = b2Cross(1.0f, r); - b2Vec2 abs_v = b2Abs(v); - - // Separating axis for segment (Gino, p80). - // |dot(v, p1 - c)| > dot(|v|, h) - - float32 maxFraction = input.maxFraction; - - // Build a bounding box for the segment. - b2AABB segmentAABB; - { - b2Vec2 t = p1 + maxFraction * (p2 - p1); - segmentAABB.lowerBound = b2Min(p1, t); - segmentAABB.upperBound = b2Max(p1, t); - } - - b2GrowableStack stack; - stack.Push(m_root); - - while (stack.GetCount() > 0) - { - int32 nodeId = stack.Pop(); - if (nodeId == b2_nullNode) - { - continue; - } - - const b2TreeNode* node = m_nodes + nodeId; - - if (b2TestOverlap(node->aabb, segmentAABB) == false) - { - continue; - } - - // Separating axis for segment (Gino, p80). - // |dot(v, p1 - c)| > dot(|v|, h) - b2Vec2 c = node->aabb.GetCenter(); - b2Vec2 h = node->aabb.GetExtents(); - float32 separation = b2Abs(b2Dot(v, p1 - c)) - b2Dot(abs_v, h); - if (separation > 0.0f) - { - continue; - } - - if (node->IsLeaf()) - { - b2RayCastInput subInput; - subInput.p1 = input.p1; - subInput.p2 = input.p2; - subInput.maxFraction = maxFraction; - - float32 value = callback->RayCastCallback(subInput, nodeId); - - if (value == 0.0f) - { - // The client has terminated the ray cast. - return; - } - - if (value > 0.0f) - { - // Update segment bounding box. - maxFraction = value; - b2Vec2 t = p1 + maxFraction * (p2 - p1); - segmentAABB.lowerBound = b2Min(p1, t); - segmentAABB.upperBound = b2Max(p1, t); - } - } - else - { - stack.Push(node->child1); - stack.Push(node->child2); - } - } -} - -#endif diff --git a/external/box2d/Collision/b2TimeOfImpact.cpp b/external/box2d/Collision/b2TimeOfImpact.cpp deleted file mode 100644 index 1d643addd8..0000000000 --- a/external/box2d/Collision/b2TimeOfImpact.cpp +++ /dev/null @@ -1,488 +0,0 @@ -/* -* Copyright (c) 2007-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include -#include -#include - -#ifdef SHP -#include -#else -#include -#endif - -using namespace std; - -int32 b2_toiCalls, b2_toiIters, b2_toiMaxIters; -int32 b2_toiRootIters, b2_toiMaxRootIters; - -struct b2SeparationFunction -{ - enum Type - { - e_points, - e_faceA, - e_faceB - }; - - // TODO_ERIN might not need to return the separation - - float32 Initialize(const b2SimplexCache* cache, - const b2DistanceProxy* proxyA, const b2Sweep& sweepA, - const b2DistanceProxy* proxyB, const b2Sweep& sweepB, - float32 t1) - { - m_proxyA = proxyA; - m_proxyB = proxyB; - int32 count = cache->count; - b2Assert(0 < count && count < 3); - - m_sweepA = sweepA; - m_sweepB = sweepB; - - b2Transform xfA, xfB; - m_sweepA.GetTransform(&xfA, t1); - m_sweepB.GetTransform(&xfB, t1); - - if (count == 1) - { - m_type = e_points; - b2Vec2 localPointA = m_proxyA->GetVertex(cache->indexA[0]); - b2Vec2 localPointB = m_proxyB->GetVertex(cache->indexB[0]); - b2Vec2 pointA = b2Mul(xfA, localPointA); - b2Vec2 pointB = b2Mul(xfB, localPointB); - m_axis = pointB - pointA; - float32 s = m_axis.Normalize(); - return s; - } - else if (cache->indexA[0] == cache->indexA[1]) - { - // Two points on B and one on A. - m_type = e_faceB; - b2Vec2 localPointB1 = proxyB->GetVertex(cache->indexB[0]); - b2Vec2 localPointB2 = proxyB->GetVertex(cache->indexB[1]); - - m_axis = b2Cross(localPointB2 - localPointB1, 1.0f); - m_axis.Normalize(); - b2Vec2 normal = b2Mul(xfB.q, m_axis); - - m_localPoint = 0.5f * (localPointB1 + localPointB2); - b2Vec2 pointB = b2Mul(xfB, m_localPoint); - - b2Vec2 localPointA = proxyA->GetVertex(cache->indexA[0]); - b2Vec2 pointA = b2Mul(xfA, localPointA); - - float32 s = b2Dot(pointA - pointB, normal); - if (s < 0.0f) - { - m_axis = -m_axis; - s = -s; - } - return s; - } - else - { - // Two points on A and one or two points on B. - m_type = e_faceA; - b2Vec2 localPointA1 = m_proxyA->GetVertex(cache->indexA[0]); - b2Vec2 localPointA2 = m_proxyA->GetVertex(cache->indexA[1]); - - m_axis = b2Cross(localPointA2 - localPointA1, 1.0f); - m_axis.Normalize(); - b2Vec2 normal = b2Mul(xfA.q, m_axis); - - m_localPoint = 0.5f * (localPointA1 + localPointA2); - b2Vec2 pointA = b2Mul(xfA, m_localPoint); - - b2Vec2 localPointB = m_proxyB->GetVertex(cache->indexB[0]); - b2Vec2 pointB = b2Mul(xfB, localPointB); - - float32 s = b2Dot(pointB - pointA, normal); - if (s < 0.0f) - { - m_axis = -m_axis; - s = -s; - } - return s; - } - } - - float32 FindMinSeparation(int32* indexA, int32* indexB, float32 t) const - { - b2Transform xfA, xfB; - m_sweepA.GetTransform(&xfA, t); - m_sweepB.GetTransform(&xfB, t); - - switch (m_type) - { - case e_points: - { - b2Vec2 axisA = b2MulT(xfA.q, m_axis); - b2Vec2 axisB = b2MulT(xfB.q, -m_axis); - - *indexA = m_proxyA->GetSupport(axisA); - *indexB = m_proxyB->GetSupport(axisB); - - b2Vec2 localPointA = m_proxyA->GetVertex(*indexA); - b2Vec2 localPointB = m_proxyB->GetVertex(*indexB); - - b2Vec2 pointA = b2Mul(xfA, localPointA); - b2Vec2 pointB = b2Mul(xfB, localPointB); - - float32 separation = b2Dot(pointB - pointA, m_axis); - return separation; - } - - case e_faceA: - { - b2Vec2 normal = b2Mul(xfA.q, m_axis); - b2Vec2 pointA = b2Mul(xfA, m_localPoint); - - b2Vec2 axisB = b2MulT(xfB.q, -normal); - - *indexA = -1; - *indexB = m_proxyB->GetSupport(axisB); - - b2Vec2 localPointB = m_proxyB->GetVertex(*indexB); - b2Vec2 pointB = b2Mul(xfB, localPointB); - - float32 separation = b2Dot(pointB - pointA, normal); - return separation; - } - - case e_faceB: - { - b2Vec2 normal = b2Mul(xfB.q, m_axis); - b2Vec2 pointB = b2Mul(xfB, m_localPoint); - - b2Vec2 axisA = b2MulT(xfA.q, -normal); - - *indexB = -1; - *indexA = m_proxyA->GetSupport(axisA); - - b2Vec2 localPointA = m_proxyA->GetVertex(*indexA); - b2Vec2 pointA = b2Mul(xfA, localPointA); - - float32 separation = b2Dot(pointA - pointB, normal); - return separation; - } - - default: - b2Assert(false); - *indexA = -1; - *indexB = -1; - return 0.0f; - } - } - - float32 Evaluate(int32 indexA, int32 indexB, float32 t) const - { - b2Transform xfA, xfB; - m_sweepA.GetTransform(&xfA, t); - m_sweepB.GetTransform(&xfB, t); - - switch (m_type) - { - case e_points: - { - b2Vec2 axisA = b2MulT(xfA.q, m_axis); - b2Vec2 axisB = b2MulT(xfB.q, -m_axis); - - b2Vec2 localPointA = m_proxyA->GetVertex(indexA); - b2Vec2 localPointB = m_proxyB->GetVertex(indexB); - - b2Vec2 pointA = b2Mul(xfA, localPointA); - b2Vec2 pointB = b2Mul(xfB, localPointB); - float32 separation = b2Dot(pointB - pointA, m_axis); - - return separation; - } - - case e_faceA: - { - b2Vec2 normal = b2Mul(xfA.q, m_axis); - b2Vec2 pointA = b2Mul(xfA, m_localPoint); - - b2Vec2 axisB = b2MulT(xfB.q, -normal); - - b2Vec2 localPointB = m_proxyB->GetVertex(indexB); - b2Vec2 pointB = b2Mul(xfB, localPointB); - - float32 separation = b2Dot(pointB - pointA, normal); - return separation; - } - - case e_faceB: - { - b2Vec2 normal = b2Mul(xfB.q, m_axis); - b2Vec2 pointB = b2Mul(xfB, m_localPoint); - - b2Vec2 axisA = b2MulT(xfA.q, -normal); - - b2Vec2 localPointA = m_proxyA->GetVertex(indexA); - b2Vec2 pointA = b2Mul(xfA, localPointA); - - float32 separation = b2Dot(pointA - pointB, normal); - return separation; - } - - default: - b2Assert(false); - return 0.0f; - } - } - - const b2DistanceProxy* m_proxyA; - const b2DistanceProxy* m_proxyB; - b2Sweep m_sweepA, m_sweepB; - Type m_type; - b2Vec2 m_localPoint; - b2Vec2 m_axis; -}; - -// CCD via the local separating axis method. This seeks progression -// by computing the largest time at which separation is maintained. -void b2TimeOfImpact(b2TOIOutput* output, const b2TOIInput* input) -{ - ++b2_toiCalls; - - output->state = b2TOIOutput::e_unknown; - output->t = input->tMax; - - const b2DistanceProxy* proxyA = &input->proxyA; - const b2DistanceProxy* proxyB = &input->proxyB; - - b2Sweep sweepA = input->sweepA; - b2Sweep sweepB = input->sweepB; - - // Large rotations can make the root finder fail, so we normalize the - // sweep angles. - sweepA.Normalize(); - sweepB.Normalize(); - - float32 tMax = input->tMax; - - float32 totalRadius = proxyA->m_radius + proxyB->m_radius; - float32 target = b2Max(b2_linearSlop, totalRadius - 3.0f * b2_linearSlop); - float32 tolerance = 0.25f * b2_linearSlop; - b2Assert(target > tolerance); - - float32 t1 = 0.0f; - const int32 k_maxIterations = 20; // TODO_ERIN b2Settings - int32 iter = 0; - - // Prepare input for distance query. - b2SimplexCache cache; - cache.count = 0; - b2DistanceInput distanceInput; - distanceInput.proxyA = input->proxyA; - distanceInput.proxyB = input->proxyB; - distanceInput.useRadii = false; - - // The outer loop progressively attempts to compute new separating axes. - // This loop terminates when an axis is repeated (no progress is made). - for(;;) - { - b2Transform xfA, xfB; - sweepA.GetTransform(&xfA, t1); - sweepB.GetTransform(&xfB, t1); - - // Get the distance between shapes. We can also use the results - // to get a separating axis. - distanceInput.transformA = xfA; - distanceInput.transformB = xfB; - b2DistanceOutput distanceOutput; - b2Distance(&distanceOutput, &cache, &distanceInput); - - // If the shapes are overlapped, we give up on continuous collision. - if (distanceOutput.distance <= 0.0f) - { - // Failure! - output->state = b2TOIOutput::e_overlapped; - output->t = 0.0f; - break; - } - - if (distanceOutput.distance < target + tolerance) - { - // Victory! - output->state = b2TOIOutput::e_touching; - output->t = t1; - break; - } - - // Initialize the separating axis. - b2SeparationFunction fcn; - fcn.Initialize(&cache, proxyA, sweepA, proxyB, sweepB, t1); -#if 0 - // Dump the curve seen by the root finder - { - const int32 N = 100; - float32 dx = 1.0f / N; - float32 xs[N+1]; - float32 fs[N+1]; - - float32 x = 0.0f; - - for (int32 i = 0; i <= N; ++i) - { - sweepA.GetTransform(&xfA, x); - sweepB.GetTransform(&xfB, x); - float32 f = fcn.Evaluate(xfA, xfB) - target; - - printf("%g %g\n", x, f); - - xs[i] = x; - fs[i] = f; - - x += dx; - } - } -#endif - - // Compute the TOI on the separating axis. We do this by successively - // resolving the deepest point. This loop is bounded by the number of vertices. - bool done = false; - float32 t2 = tMax; - int32 pushBackIter = 0; - for (;;) - { - // Find the deepest point at t2. Store the witness point indices. - int32 indexA, indexB; - float32 s2 = fcn.FindMinSeparation(&indexA, &indexB, t2); - - // Is the final configuration separated? - if (s2 > target + tolerance) - { - // Victory! - output->state = b2TOIOutput::e_separated; - output->t = tMax; - done = true; - break; - } - - // Has the separation reached tolerance? - if (s2 > target - tolerance) - { - // Advance the sweeps - t1 = t2; - break; - } - - // Compute the initial separation of the witness points. - float32 s1 = fcn.Evaluate(indexA, indexB, t1); - - // Check for initial overlap. This might happen if the root finder - // runs out of iterations. - if (s1 < target - tolerance) - { - output->state = b2TOIOutput::e_failed; - output->t = t1; - done = true; - break; - } - - // Check for touching - if (s1 <= target + tolerance) - { - // Victory! t1 should hold the TOI (could be 0.0). - output->state = b2TOIOutput::e_touching; - output->t = t1; - done = true; - break; - } - - // Compute 1D root of: f(x) - target = 0 - int32 rootIterCount = 0; - float32 a1 = t1, a2 = t2; - for (;;) - { - // Use a mix of the secant rule and bisection. - float32 t; - if (rootIterCount & 1) - { - // Secant rule to improve convergence. - t = a1 + (target - s1) * (a2 - a1) / (s2 - s1); - } - else - { - // Bisection to guarantee progress. - t = 0.5f * (a1 + a2); - } - - float32 s = fcn.Evaluate(indexA, indexB, t); - - if (b2Abs(s - target) < tolerance) - { - // t2 holds a tentative value for t1 - t2 = t; - break; - } - - // Ensure we continue to bracket the root. - if (s > target) - { - a1 = t; - s1 = s; - } - else - { - a2 = t; - s2 = s; - } - - ++rootIterCount; - ++b2_toiRootIters; - - if (rootIterCount == 50) - { - break; - } - } - - b2_toiMaxRootIters = b2Max(b2_toiMaxRootIters, rootIterCount); - - ++pushBackIter; - - if (pushBackIter == b2_maxPolygonVertices) - { - break; - } - } - - ++iter; - ++b2_toiIters; - - if (done) - { - break; - } - - if (iter == k_maxIterations) - { - // Root finder got stuck. Semi-victory. - output->state = b2TOIOutput::e_failed; - output->t = t1; - break; - } - } - - b2_toiMaxIters = b2Max(b2_toiMaxIters, iter); -} diff --git a/external/box2d/Collision/b2TimeOfImpact.h b/external/box2d/Collision/b2TimeOfImpact.h deleted file mode 100644 index 2e4f8228ff..0000000000 --- a/external/box2d/Collision/b2TimeOfImpact.h +++ /dev/null @@ -1,58 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_TIME_OF_IMPACT_H -#define B2_TIME_OF_IMPACT_H - -#include -#include - -/// Input parameters for b2TimeOfImpact -struct b2TOIInput -{ - b2DistanceProxy proxyA; - b2DistanceProxy proxyB; - b2Sweep sweepA; - b2Sweep sweepB; - float32 tMax; // defines sweep interval [0, tMax] -}; - -// Output parameters for b2TimeOfImpact. -struct b2TOIOutput -{ - enum State - { - e_unknown, - e_failed, - e_overlapped, - e_touching, - e_separated - }; - - State state; - float32 t; -}; - -/// Compute the upper bound on time before two shapes penetrate. Time is represented as -/// a fraction between [0,tMax]. This uses a swept separating axis and may miss some intermediate, -/// non-tunneling collision. If you change the time interval, you should call this function -/// again. -/// Note: use b2Distance to compute the contact point and normal at the time of impact. -void b2TimeOfImpact(b2TOIOutput* output, const b2TOIInput* input); - -#endif diff --git a/external/box2d/Common/b2BlockAllocator.cpp b/external/box2d/Common/b2BlockAllocator.cpp deleted file mode 100644 index 2e862091f9..0000000000 --- a/external/box2d/Common/b2BlockAllocator.cpp +++ /dev/null @@ -1,218 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include -#include -#include - -using namespace std; - -int32 b2BlockAllocator::s_blockSizes[b2_blockSizes] = -{ - 16, // 0 - 32, // 1 - 64, // 2 - 96, // 3 - 128, // 4 - 160, // 5 - 192, // 6 - 224, // 7 - 256, // 8 - 320, // 9 - 384, // 10 - 448, // 11 - 512, // 12 - 640, // 13 -}; -uint8 b2BlockAllocator::s_blockSizeLookup[b2_maxBlockSize + 1]; -bool b2BlockAllocator::s_blockSizeLookupInitialized; - -struct b2Chunk -{ - int32 blockSize; - b2Block* blocks; -}; - -struct b2Block -{ - b2Block* next; -}; - -b2BlockAllocator::b2BlockAllocator() -{ - b2Assert(b2_blockSizes < UCHAR_MAX); - - m_chunkSpace = b2_chunkArrayIncrement; - m_chunkCount = 0; - m_chunks = (b2Chunk*)b2Alloc(m_chunkSpace * sizeof(b2Chunk)); - - memset(m_chunks, 0, m_chunkSpace * sizeof(b2Chunk)); - memset(m_freeLists, 0, sizeof(m_freeLists)); - - if (s_blockSizeLookupInitialized == false) - { - int32 j = 0; - for (int32 i = 1; i <= b2_maxBlockSize; ++i) - { - b2Assert(j < b2_blockSizes); - if (i <= s_blockSizes[j]) - { - s_blockSizeLookup[i] = (uint8)j; - } - else - { - ++j; - s_blockSizeLookup[i] = (uint8)j; - } - } - - s_blockSizeLookupInitialized = true; - } -} - -b2BlockAllocator::~b2BlockAllocator() -{ - for (int32 i = 0; i < m_chunkCount; ++i) - { - b2Free(m_chunks[i].blocks); - } - - b2Free(m_chunks); -} - -void* b2BlockAllocator::Allocate(int32 size) -{ - if (size == 0) - return NULL; - - b2Assert(0 < size); - - if (size > b2_maxBlockSize) - { - return b2Alloc(size); - } - - int32 index = s_blockSizeLookup[size]; - b2Assert(0 <= index && index < b2_blockSizes); - - if (m_freeLists[index]) - { - b2Block* block = m_freeLists[index]; - m_freeLists[index] = block->next; - return block; - } - else - { - if (m_chunkCount == m_chunkSpace) - { - b2Chunk* oldChunks = m_chunks; - m_chunkSpace += b2_chunkArrayIncrement; - m_chunks = (b2Chunk*)b2Alloc(m_chunkSpace * sizeof(b2Chunk)); - memcpy(m_chunks, oldChunks, m_chunkCount * sizeof(b2Chunk)); - memset(m_chunks + m_chunkCount, 0, b2_chunkArrayIncrement * sizeof(b2Chunk)); - b2Free(oldChunks); - } - - b2Chunk* chunk = m_chunks + m_chunkCount; - chunk->blocks = (b2Block*)b2Alloc(b2_chunkSize); -#if defined(_DEBUG) - memset(chunk->blocks, 0xcd, b2_chunkSize); -#endif - int32 blockSize = s_blockSizes[index]; - chunk->blockSize = blockSize; - int32 blockCount = b2_chunkSize / blockSize; - b2Assert(blockCount * blockSize <= b2_chunkSize); - for (int32 i = 0; i < blockCount - 1; ++i) - { - b2Block* block = (b2Block*)((int8*)chunk->blocks + blockSize * i); - b2Block* next = (b2Block*)((int8*)chunk->blocks + blockSize * (i + 1)); - block->next = next; - } - b2Block* last = (b2Block*)((int8*)chunk->blocks + blockSize * (blockCount - 1)); - last->next = NULL; - - m_freeLists[index] = chunk->blocks->next; - ++m_chunkCount; - - return chunk->blocks; - } -} - -void b2BlockAllocator::Free(void* p, int32 size) -{ - if (size == 0) - { - return; - } - - b2Assert(0 < size); - - if (size > b2_maxBlockSize) - { - b2Free(p); - return; - } - - int32 index = s_blockSizeLookup[size]; - b2Assert(0 <= index && index < b2_blockSizes); - -#ifdef _DEBUG - // Verify the memory address and size is valid. - int32 blockSize = s_blockSizes[index]; - bool found = false; - for (int32 i = 0; i < m_chunkCount; ++i) - { - b2Chunk* chunk = m_chunks + i; - if (chunk->blockSize != blockSize) - { - b2Assert( (int8*)p + blockSize <= (int8*)chunk->blocks || - (int8*)chunk->blocks + b2_chunkSize <= (int8*)p); - } - else - { - if ((int8*)chunk->blocks <= (int8*)p && (int8*)p + blockSize <= (int8*)chunk->blocks + b2_chunkSize) - { - found = true; - } - } - } - - b2Assert(found); - - memset(p, 0xfd, blockSize); -#endif - - b2Block* block = (b2Block*)p; - block->next = m_freeLists[index]; - m_freeLists[index] = block; -} - -void b2BlockAllocator::Clear() -{ - for (int32 i = 0; i < m_chunkCount; ++i) - { - b2Free(m_chunks[i].blocks); - } - - m_chunkCount = 0; - memset(m_chunks, 0, m_chunkSpace * sizeof(b2Chunk)); - - memset(m_freeLists, 0, sizeof(m_freeLists)); -} diff --git a/external/box2d/Common/b2BlockAllocator.h b/external/box2d/Common/b2BlockAllocator.h deleted file mode 100644 index ec221fdf61..0000000000 --- a/external/box2d/Common/b2BlockAllocator.h +++ /dev/null @@ -1,62 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_BLOCK_ALLOCATOR_H -#define B2_BLOCK_ALLOCATOR_H - -#include - -const int32 b2_chunkSize = 16 * 1024; -const int32 b2_maxBlockSize = 640; -const int32 b2_blockSizes = 14; -const int32 b2_chunkArrayIncrement = 128; - -struct b2Block; -struct b2Chunk; - -/// This is a small object allocator used for allocating small -/// objects that persist for more than one time step. -/// See: http://www.codeproject.com/useritems/Small_Block_Allocator.asp -class b2BlockAllocator -{ -public: - b2BlockAllocator(); - ~b2BlockAllocator(); - - /// Allocate memory. This will use b2Alloc if the size is larger than b2_maxBlockSize. - void* Allocate(int32 size); - - /// Free memory. This will use b2Free if the size is larger than b2_maxBlockSize. - void Free(void* p, int32 size); - - void Clear(); - -private: - - b2Chunk* m_chunks; - int32 m_chunkCount; - int32 m_chunkSpace; - - b2Block* m_freeLists[b2_blockSizes]; - - static int32 s_blockSizes[b2_blockSizes]; - static uint8 s_blockSizeLookup[b2_maxBlockSize + 1]; - static bool s_blockSizeLookupInitialized; -}; - -#endif diff --git a/external/box2d/Common/b2Draw.cpp b/external/box2d/Common/b2Draw.cpp deleted file mode 100644 index cb760025e9..0000000000 --- a/external/box2d/Common/b2Draw.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/* -* Copyright (c) 2011 Erin Catto http://box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include - -b2Draw::b2Draw() -{ - m_drawFlags = 0; -} - -void b2Draw::SetFlags(uint32 flags) -{ - m_drawFlags = flags; -} - -uint32 b2Draw::GetFlags() const -{ - return m_drawFlags; -} - -void b2Draw::AppendFlags(uint32 flags) -{ - m_drawFlags |= flags; -} - -void b2Draw::ClearFlags(uint32 flags) -{ - m_drawFlags &= ~flags; -} diff --git a/external/box2d/Common/b2Draw.h b/external/box2d/Common/b2Draw.h deleted file mode 100644 index b33cd8d38f..0000000000 --- a/external/box2d/Common/b2Draw.h +++ /dev/null @@ -1,81 +0,0 @@ -/* -* Copyright (c) 2011 Erin Catto http://box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include - -/// Color for debug drawing. Each value has the range [0,1]. -struct b2Color -{ - b2Color() {} - b2Color(float32 r, float32 g, float32 b) : r(r), g(g), b(b) {} - void Set(float32 ri, float32 gi, float32 bi) { r = ri; g = gi; b = bi; } - float32 r, g, b; -}; - -/// Implement and register this class with a b2World to provide debug drawing of physics -/// entities in your game. -class b2Draw -{ -public: - b2Draw(); - - virtual ~b2Draw() {} - - enum - { - e_shapeBit = 0x0001, ///< draw shapes - e_jointBit = 0x0002, ///< draw joint connections - e_aabbBit = 0x0004, ///< draw axis aligned bounding boxes - e_pairBit = 0x0008, ///< draw broad-phase pairs - e_centerOfMassBit = 0x0010 ///< draw center of mass frame - }; - - /// Set the drawing flags. - void SetFlags(uint32 flags); - - /// Get the drawing flags. - uint32 GetFlags() const; - - /// Append flags to the current flags. - void AppendFlags(uint32 flags); - - /// Clear flags from the current flags. - void ClearFlags(uint32 flags); - - /// Draw a closed polygon provided in CCW order. - virtual void DrawPolygon(const b2Vec2* vertices, int32 vertexCount, const b2Color& color) = 0; - - /// Draw a solid closed polygon provided in CCW order. - virtual void DrawSolidPolygon(const b2Vec2* vertices, int32 vertexCount, const b2Color& color) = 0; - - /// Draw a circle. - virtual void DrawCircle(const b2Vec2& center, float32 radius, const b2Color& color) = 0; - - /// Draw a solid circle. - virtual void DrawSolidCircle(const b2Vec2& center, float32 radius, const b2Vec2& axis, const b2Color& color) = 0; - - /// Draw a line segment. - virtual void DrawSegment(const b2Vec2& p1, const b2Vec2& p2, const b2Color& color) = 0; - - /// Draw a transform. Choose your own length scale. - /// @param xf a transform. - virtual void DrawTransform(const b2Transform& xf) = 0; - -protected: - uint32 m_drawFlags; -}; diff --git a/external/box2d/Common/b2GrowableStack.h b/external/box2d/Common/b2GrowableStack.h deleted file mode 100644 index 68809521f4..0000000000 --- a/external/box2d/Common/b2GrowableStack.h +++ /dev/null @@ -1,85 +0,0 @@ -/* -* Copyright (c) 2010 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_GROWABLE_STACK_H -#define B2_GROWABLE_STACK_H -#include -#include - -/// This is a growable LIFO stack with an initial capacity of N. -/// If the stack size exceeds the initial capacity, the heap is used -/// to increase the size of the stack. -template -class b2GrowableStack -{ -public: - b2GrowableStack() - { - m_stack = m_array; - m_count = 0; - m_capacity = N; - } - - ~b2GrowableStack() - { - if (m_stack != m_array) - { - b2Free(m_stack); - m_stack = NULL; - } - } - - void Push(const T& element) - { - if (m_count == m_capacity) - { - T* old = m_stack; - m_capacity *= 2; - m_stack = (T*)b2Alloc(m_capacity * sizeof(T)); - std::memcpy(m_stack, old, m_count * sizeof(T)); - if (old != m_array) - { - b2Free(old); - } - } - - m_stack[m_count] = element; - ++m_count; - } - - T Pop() - { - b2Assert(m_count > 0); - --m_count; - return m_stack[m_count]; - } - - int32 GetCount() - { - return m_count; - } - -private: - T* m_stack; - T m_array[N]; - int32 m_count; - int32 m_capacity; -}; - - -#endif diff --git a/external/box2d/Common/b2Math.cpp b/external/box2d/Common/b2Math.cpp deleted file mode 100644 index 15d68fce96..0000000000 --- a/external/box2d/Common/b2Math.cpp +++ /dev/null @@ -1,94 +0,0 @@ -/* -* Copyright (c) 2007-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include - -const b2Vec2 b2Vec2_zero(0.0f, 0.0f); - -/// Solve A * x = b, where b is a column vector. This is more efficient -/// than computing the inverse in one-shot cases. -b2Vec3 b2Mat33::Solve33(const b2Vec3& b) const -{ - float32 det = b2Dot(ex, b2Cross(ey, ez)); - if (det != 0.0f) - { - det = 1.0f / det; - } - b2Vec3 x; - x.x = det * b2Dot(b, b2Cross(ey, ez)); - x.y = det * b2Dot(ex, b2Cross(b, ez)); - x.z = det * b2Dot(ex, b2Cross(ey, b)); - return x; -} - -/// Solve A * x = b, where b is a column vector. This is more efficient -/// than computing the inverse in one-shot cases. -b2Vec2 b2Mat33::Solve22(const b2Vec2& b) const -{ - float32 a11 = ex.x, a12 = ey.x, a21 = ex.y, a22 = ey.y; - float32 det = a11 * a22 - a12 * a21; - if (det != 0.0f) - { - det = 1.0f / det; - } - b2Vec2 x; - x.x = det * (a22 * b.x - a12 * b.y); - x.y = det * (a11 * b.y - a21 * b.x); - return x; -} - -/// -void b2Mat33::GetInverse22(b2Mat33* M) const -{ - float32 a = ex.x, b = ey.x, c = ex.y, d = ey.y; - float32 det = a * d - b * c; - if (det != 0.0f) - { - det = 1.0f / det; - } - - M->ex.x = det * d; M->ey.x = -det * b; M->ex.z = 0.0f; - M->ex.y = -det * c; M->ey.y = det * a; M->ey.z = 0.0f; - M->ez.x = 0.0f; M->ez.y = 0.0f; M->ez.z = 0.0f; -} - -/// Returns the zero matrix if singular. -void b2Mat33::GetSymInverse33(b2Mat33* M) const -{ - float32 det = b2Dot(ex, b2Cross(ey, ez)); - if (det != 0.0f) - { - det = 1.0f / det; - } - - float32 a11 = ex.x, a12 = ey.x, a13 = ez.x; - float32 a22 = ey.y, a23 = ez.y; - float32 a33 = ez.z; - - M->ex.x = det * (a22 * a33 - a23 * a23); - M->ex.y = det * (a13 * a23 - a12 * a33); - M->ex.z = det * (a12 * a23 - a13 * a22); - - M->ey.x = M->ex.y; - M->ey.y = det * (a11 * a33 - a13 * a13); - M->ey.z = det * (a13 * a12 - a11 * a23); - - M->ez.x = M->ex.z; - M->ez.y = M->ey.z; - M->ez.z = det * (a11 * a22 - a12 * a12); -} diff --git a/external/box2d/Common/b2Math.h b/external/box2d/Common/b2Math.h deleted file mode 100644 index a6be671139..0000000000 --- a/external/box2d/Common/b2Math.h +++ /dev/null @@ -1,738 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_MATH_H -#define B2_MATH_H - -#include - -#include -#ifndef SHP -#include -#else -#include -#endif -#include -#include - -using namespace std; - - -/// This function is used to ensure that a floating point number is -/// not a NaN or infinity. -inline bool b2IsValid(float32 x) -{ - if (x != x) - { - // NaN. - return false; - } - - float32 infinity = std::numeric_limits::infinity(); - return -infinity < x && x < infinity; -} - -/// This is a approximate yet fast inverse square-root. -inline float32 b2InvSqrt(float32 x) -{ - union - { - float32 x; - int32 i; - } convert; - - convert.x = x; - float32 xhalf = 0.5f * x; - convert.i = 0x5f3759df - (convert.i >> 1); - x = convert.x; - x = x * (1.5f - xhalf * x * x); - return x; -} - -#define b2Sqrt(x) std::sqrt(x) -#define b2Atan2(y, x) std::atan2(y, x) - -/// A 2D column vector. -struct b2Vec2 -{ - /// Default constructor does nothing (for performance). - b2Vec2() {} - - /// Construct using coordinates. - b2Vec2(float32 x, float32 y) : x(x), y(y) {} - - /// Set this vector to all zeros. - void SetZero() { x = 0.0f; y = 0.0f; } - - /// Set this vector to some specified coordinates. - void Set(float32 x_, float32 y_) { x = x_; y = y_; } - - /// Negate this vector. - b2Vec2 operator -() const { b2Vec2 v; v.Set(-x, -y); return v; } - - /// Read from and indexed element. - float32 operator () (int32 i) const - { - return (&x)[i]; - } - - /// Write to an indexed element. - float32& operator () (int32 i) - { - return (&x)[i]; - } - - /// Add a vector to this vector. - void operator += (const b2Vec2& v) - { - x += v.x; y += v.y; - } - - /// Subtract a vector from this vector. - void operator -= (const b2Vec2& v) - { - x -= v.x; y -= v.y; - } - - /// Multiply this vector by a scalar. - void operator *= (float32 a) - { - x *= a; y *= a; - } - - /// Get the length of this vector (the norm). - float32 Length() const - { - return b2Sqrt(x * x + y * y); - } - - /// Get the length squared. For performance, use this instead of - /// b2Vec2::Length (if possible). - float32 LengthSquared() const - { - return x * x + y * y; - } - - /// Convert this vector into a unit vector. Returns the length. - float32 Normalize() - { - float32 length = Length(); - if (length < b2_epsilon) - { - return 0.0f; - } - float32 invLength = 1.0f / length; - x *= invLength; - y *= invLength; - - return length; - } - - /// Does this vector contain finite coordinates? - bool IsValid() const - { - return b2IsValid(x) && b2IsValid(y); - } - - /// Get the skew vector such that dot(skew_vec, other) == cross(vec, other) - b2Vec2 Skew() const - { - return b2Vec2(-y, x); - } - - float32 x, y; -}; - -/// A 2D column vector with 3 elements. -struct b2Vec3 -{ - /// Default constructor does nothing (for performance). - b2Vec3() {} - - /// Construct using coordinates. - b2Vec3(float32 x, float32 y, float32 z) : x(x), y(y), z(z) {} - - /// Set this vector to all zeros. - void SetZero() { x = 0.0f; y = 0.0f; z = 0.0f; } - - /// Set this vector to some specified coordinates. - void Set(float32 x_, float32 y_, float32 z_) { x = x_; y = y_; z = z_; } - - /// Negate this vector. - b2Vec3 operator -() const { b2Vec3 v; v.Set(-x, -y, -z); return v; } - - /// Add a vector to this vector. - void operator += (const b2Vec3& v) - { - x += v.x; y += v.y; z += v.z; - } - - /// Subtract a vector from this vector. - void operator -= (const b2Vec3& v) - { - x -= v.x; y -= v.y; z -= v.z; - } - - /// Multiply this vector by a scalar. - void operator *= (float32 s) - { - x *= s; y *= s; z *= s; - } - - float32 x, y, z; -}; - -/// A 2-by-2 matrix. Stored in column-major order. -struct b2Mat22 -{ - /// The default constructor does nothing (for performance). - b2Mat22() {} - - /// Construct this matrix using columns. - b2Mat22(const b2Vec2& c1, const b2Vec2& c2) - { - ex = c1; - ey = c2; - } - - /// Construct this matrix using scalars. - b2Mat22(float32 a11, float32 a12, float32 a21, float32 a22) - { - ex.x = a11; ex.y = a21; - ey.x = a12; ey.y = a22; - } - - /// Initialize this matrix using columns. - void Set(const b2Vec2& c1, const b2Vec2& c2) - { - ex = c1; - ey = c2; - } - - /// Set this to the identity matrix. - void SetIdentity() - { - ex.x = 1.0f; ey.x = 0.0f; - ex.y = 0.0f; ey.y = 1.0f; - } - - /// Set this matrix to all zeros. - void SetZero() - { - ex.x = 0.0f; ey.x = 0.0f; - ex.y = 0.0f; ey.y = 0.0f; - } - - b2Mat22 GetInverse() const - { - float32 a = ex.x, b = ey.x, c = ex.y, d = ey.y; - b2Mat22 B; - float32 det = a * d - b * c; - if (det != 0.0f) - { - det = 1.0f / det; - } - B.ex.x = det * d; B.ey.x = -det * b; - B.ex.y = -det * c; B.ey.y = det * a; - return B; - } - - /// Solve A * x = b, where b is a column vector. This is more efficient - /// than computing the inverse in one-shot cases. - b2Vec2 Solve(const b2Vec2& b) const - { - float32 a11 = ex.x, a12 = ey.x, a21 = ex.y, a22 = ey.y; - float32 det = a11 * a22 - a12 * a21; - if (det != 0.0f) - { - det = 1.0f / det; - } - b2Vec2 x; - x.x = det * (a22 * b.x - a12 * b.y); - x.y = det * (a11 * b.y - a21 * b.x); - return x; - } - - b2Vec2 ex, ey; -}; - -/// A 3-by-3 matrix. Stored in column-major order. -struct b2Mat33 -{ - /// The default constructor does nothing (for performance). - b2Mat33() {} - - /// Construct this matrix using columns. - b2Mat33(const b2Vec3& c1, const b2Vec3& c2, const b2Vec3& c3) - { - ex = c1; - ey = c2; - ez = c3; - } - - /// Set this matrix to all zeros. - void SetZero() - { - ex.SetZero(); - ey.SetZero(); - ez.SetZero(); - } - - /// Solve A * x = b, where b is a column vector. This is more efficient - /// than computing the inverse in one-shot cases. - b2Vec3 Solve33(const b2Vec3& b) const; - - /// Solve A * x = b, where b is a column vector. This is more efficient - /// than computing the inverse in one-shot cases. Solve only the upper - /// 2-by-2 matrix equation. - b2Vec2 Solve22(const b2Vec2& b) const; - - /// Get the inverse of this matrix as a 2-by-2. - /// Returns the zero matrix if singular. - void GetInverse22(b2Mat33* M) const; - - /// Get the symmetric inverse of this matrix as a 3-by-3. - /// Returns the zero matrix if singular. - void GetSymInverse33(b2Mat33* M) const; - - b2Vec3 ex, ey, ez; -}; - -/// Rotation -struct b2Rot -{ - b2Rot() {} - - /// Initialize from an angle in radians - explicit b2Rot(float32 angle) - { - /// TODO_ERIN optimize - s = sinf(angle); - c = cosf(angle); - } - - /// Set using an angle in radians. - void Set(float32 angle) - { - /// TODO_ERIN optimize - s = sinf(angle); - c = cosf(angle); - } - - /// Set to the identity rotation - void SetIdentity() - { - s = 0.0f; - c = 1.0f; - } - - /// Get the angle in radians - float32 GetAngle() const - { - return b2Atan2(s, c); - } - - /// Get the x-axis - b2Vec2 GetXAxis() const - { - return b2Vec2(c, s); - } - - /// Get the u-axis - b2Vec2 GetYAxis() const - { - return b2Vec2(-s, c); - } - - /// Sine and cosine - float32 s, c; -}; - -/// A transform contains translation and rotation. It is used to represent -/// the position and orientation of rigid frames. -struct b2Transform -{ - /// The default constructor does nothing. - b2Transform() {} - - /// Initialize using a position vector and a rotation. - b2Transform(const b2Vec2& position, const b2Rot& rotation) : p(position), q(rotation) {} - - /// Set this to the identity transform. - void SetIdentity() - { - p.SetZero(); - q.SetIdentity(); - } - - /// Set this based on the position and angle. - void Set(const b2Vec2& position, float32 angle) - { - p = position; - q.Set(angle); - } - - b2Vec2 p; - b2Rot q; -}; - -/// This describes the motion of a body/shape for TOI computation. -/// Shapes are defined with respect to the body origin, which may -/// no coincide with the center of mass. However, to support dynamics -/// we must interpolate the center of mass position. -struct b2Sweep -{ - /// Get the interpolated transform at a specific time. - /// @param beta is a factor in [0,1], where 0 indicates alpha0. - void GetTransform(b2Transform* xfb, float32 beta) const; - - /// Advance the sweep forward, yielding a new initial state. - /// @param alpha the new initial time. - void Advance(float32 alpha); - - /// Normalize the angles. - void Normalize(); - - b2Vec2 localCenter; ///< local center of mass position - b2Vec2 c0, c; ///< center world positions - float32 a0, a; ///< world angles - - /// Fraction of the current time step in the range [0,1] - /// c0 and a0 are the positions at alpha0. - float32 alpha0; -}; - -/// Useful constant -extern const b2Vec2 b2Vec2_zero; - -/// Perform the dot product on two vectors. -inline float32 b2Dot(const b2Vec2& a, const b2Vec2& b) -{ - return a.x * b.x + a.y * b.y; -} - -/// Perform the cross product on two vectors. In 2D this produces a scalar. -inline float32 b2Cross(const b2Vec2& a, const b2Vec2& b) -{ - return a.x * b.y - a.y * b.x; -} - -/// Perform the cross product on a vector and a scalar. In 2D this produces -/// a vector. -inline b2Vec2 b2Cross(const b2Vec2& a, float32 s) -{ - return b2Vec2(s * a.y, -s * a.x); -} - -/// Perform the cross product on a scalar and a vector. In 2D this produces -/// a vector. -inline b2Vec2 b2Cross(float32 s, const b2Vec2& a) -{ - return b2Vec2(-s * a.y, s * a.x); -} - -/// Multiply a matrix times a vector. If a rotation matrix is provided, -/// then this transforms the vector from one frame to another. -inline b2Vec2 b2Mul(const b2Mat22& A, const b2Vec2& v) -{ - return b2Vec2(A.ex.x * v.x + A.ey.x * v.y, A.ex.y * v.x + A.ey.y * v.y); -} - -/// Multiply a matrix transpose times a vector. If a rotation matrix is provided, -/// then this transforms the vector from one frame to another (inverse transform). -inline b2Vec2 b2MulT(const b2Mat22& A, const b2Vec2& v) -{ - return b2Vec2(b2Dot(v, A.ex), b2Dot(v, A.ey)); -} - -/// Add two vectors component-wise. -inline b2Vec2 operator + (const b2Vec2& a, const b2Vec2& b) -{ - return b2Vec2(a.x + b.x, a.y + b.y); -} - -/// Subtract two vectors component-wise. -inline b2Vec2 operator - (const b2Vec2& a, const b2Vec2& b) -{ - return b2Vec2(a.x - b.x, a.y - b.y); -} - -inline b2Vec2 operator * (float32 s, const b2Vec2& a) -{ - return b2Vec2(s * a.x, s * a.y); -} - -inline bool operator == (const b2Vec2& a, const b2Vec2& b) -{ - return a.x == b.x && a.y == b.y; -} - -inline float32 b2Distance(const b2Vec2& a, const b2Vec2& b) -{ - b2Vec2 c = a - b; - return c.Length(); -} - -inline float32 b2DistanceSquared(const b2Vec2& a, const b2Vec2& b) -{ - b2Vec2 c = a - b; - return b2Dot(c, c); -} - -inline b2Vec3 operator * (float32 s, const b2Vec3& a) -{ - return b2Vec3(s * a.x, s * a.y, s * a.z); -} - -/// Add two vectors component-wise. -inline b2Vec3 operator + (const b2Vec3& a, const b2Vec3& b) -{ - return b2Vec3(a.x + b.x, a.y + b.y, a.z + b.z); -} - -/// Subtract two vectors component-wise. -inline b2Vec3 operator - (const b2Vec3& a, const b2Vec3& b) -{ - return b2Vec3(a.x - b.x, a.y - b.y, a.z - b.z); -} - -/// Perform the dot product on two vectors. -inline float32 b2Dot(const b2Vec3& a, const b2Vec3& b) -{ - return a.x * b.x + a.y * b.y + a.z * b.z; -} - -/// Perform the cross product on two vectors. -inline b2Vec3 b2Cross(const b2Vec3& a, const b2Vec3& b) -{ - return b2Vec3(a.y * b.z - a.z * b.y, a.z * b.x - a.x * b.z, a.x * b.y - a.y * b.x); -} - -inline b2Mat22 operator + (const b2Mat22& A, const b2Mat22& B) -{ - return b2Mat22(A.ex + B.ex, A.ey + B.ey); -} - -// A * B -inline b2Mat22 b2Mul(const b2Mat22& A, const b2Mat22& B) -{ - return b2Mat22(b2Mul(A, B.ex), b2Mul(A, B.ey)); -} - -// A^T * B -inline b2Mat22 b2MulT(const b2Mat22& A, const b2Mat22& B) -{ - b2Vec2 c1(b2Dot(A.ex, B.ex), b2Dot(A.ey, B.ex)); - b2Vec2 c2(b2Dot(A.ex, B.ey), b2Dot(A.ey, B.ey)); - return b2Mat22(c1, c2); -} - -/// Multiply a matrix times a vector. -inline b2Vec3 b2Mul(const b2Mat33& A, const b2Vec3& v) -{ - return v.x * A.ex + v.y * A.ey + v.z * A.ez; -} - -/// Multiply a matrix times a vector. -inline b2Vec2 b2Mul22(const b2Mat33& A, const b2Vec2& v) -{ - return b2Vec2(A.ex.x * v.x + A.ey.x * v.y, A.ex.y * v.x + A.ey.y * v.y); -} - -/// Multiply two rotations: q * r -inline b2Rot b2Mul(const b2Rot& q, const b2Rot& r) -{ - // [qc -qs] * [rc -rs] = [qc*rc-qs*rs -qc*rs-qs*rc] - // [qs qc] [rs rc] [qs*rc+qc*rs -qs*rs+qc*rc] - // s = qs * rc + qc * rs - // c = qc * rc - qs * rs - b2Rot qr; - qr.s = q.s * r.c + q.c * r.s; - qr.c = q.c * r.c - q.s * r.s; - return qr; -} - -/// Transpose multiply two rotations: qT * r -inline b2Rot b2MulT(const b2Rot& q, const b2Rot& r) -{ - // [ qc qs] * [rc -rs] = [qc*rc+qs*rs -qc*rs+qs*rc] - // [-qs qc] [rs rc] [-qs*rc+qc*rs qs*rs+qc*rc] - // s = qc * rs - qs * rc - // c = qc * rc + qs * rs - b2Rot qr; - qr.s = q.c * r.s - q.s * r.c; - qr.c = q.c * r.c + q.s * r.s; - return qr; -} - -/// Rotate a vector -inline b2Vec2 b2Mul(const b2Rot& q, const b2Vec2& v) -{ - return b2Vec2(q.c * v.x - q.s * v.y, q.s * v.x + q.c * v.y); -} - -/// Inverse rotate a vector -inline b2Vec2 b2MulT(const b2Rot& q, const b2Vec2& v) -{ - return b2Vec2(q.c * v.x + q.s * v.y, -q.s * v.x + q.c * v.y); -} - -inline b2Vec2 b2Mul(const b2Transform& T, const b2Vec2& v) -{ - float32 x = (T.q.c * v.x - T.q.s * v.y) + T.p.x; - float32 y = (T.q.s * v.x + T.q.c * v.y) + T.p.y; - - return b2Vec2(x, y); -} - -inline b2Vec2 b2MulT(const b2Transform& T, const b2Vec2& v) -{ - float32 px = v.x - T.p.x; - float32 py = v.y - T.p.y; - float32 x = (T.q.c * px + T.q.s * py); - float32 y = (-T.q.s * px + T.q.c * py); - - return b2Vec2(x, y); -} - -// v2 = A.q.Rot(B.q.Rot(v1) + B.p) + A.p -// = (A.q * B.q).Rot(v1) + A.q.Rot(B.p) + A.p -inline b2Transform b2Mul(const b2Transform& A, const b2Transform& B) -{ - b2Transform C; - C.q = b2Mul(A.q, B.q); - C.p = b2Mul(A.q, B.p) + A.p; - return C; -} - -// v2 = A.q' * (B.q * v1 + B.p - A.p) -// = A.q' * B.q * v1 + A.q' * (B.p - A.p) -inline b2Transform b2MulT(const b2Transform& A, const b2Transform& B) -{ - b2Transform C; - C.q = b2MulT(A.q, B.q); - C.p = b2MulT(A.q, B.p - A.p); - return C; -} - -template -inline T b2Abs(T a) -{ - return a > T(0) ? a : -a; -} - -inline b2Vec2 b2Abs(const b2Vec2& a) -{ - return b2Vec2(b2Abs(a.x), b2Abs(a.y)); -} - -inline b2Mat22 b2Abs(const b2Mat22& A) -{ - return b2Mat22(b2Abs(A.ex), b2Abs(A.ey)); -} - -template -inline T b2Min(T a, T b) -{ - return a < b ? a : b; -} - -inline b2Vec2 b2Min(const b2Vec2& a, const b2Vec2& b) -{ - return b2Vec2(b2Min(a.x, b.x), b2Min(a.y, b.y)); -} - -template -inline T b2Max(T a, T b) -{ - return a > b ? a : b; -} - -inline b2Vec2 b2Max(const b2Vec2& a, const b2Vec2& b) -{ - return b2Vec2(b2Max(a.x, b.x), b2Max(a.y, b.y)); -} - -template -inline T b2Clamp(T a, T low, T high) -{ - return b2Max(low, b2Min(a, high)); -} - -inline b2Vec2 b2Clamp(const b2Vec2& a, const b2Vec2& low, const b2Vec2& high) -{ - return b2Max(low, b2Min(a, high)); -} - -template inline void b2Swap(T& a, T& b) -{ - T tmp = a; - a = b; - b = tmp; -} - -/// "Next Largest Power of 2 -/// Given a binary integer value x, the next largest power of 2 can be computed by a SWAR algorithm -/// that recursively "folds" the upper bits into the lower bits. This process yields a bit vector with -/// the same most significant 1 as x, but all 1's below it. Adding 1 to that value yields the next -/// largest power of 2. For a 32-bit value:" -inline uint32 b2NextPowerOfTwo(uint32 x) -{ - x |= (x >> 1); - x |= (x >> 2); - x |= (x >> 4); - x |= (x >> 8); - x |= (x >> 16); - return x + 1; -} - -inline bool b2IsPowerOfTwo(uint32 x) -{ - bool result = x > 0 && (x & (x - 1)) == 0; - return result; -} - -inline void b2Sweep::GetTransform(b2Transform* xf, float32 beta) const -{ - xf->p = (1.0f - beta) * c0 + beta * c; - float32 angle = (1.0f - beta) * a0 + beta * a; - xf->q.Set(angle); - - // Shift to origin - xf->p -= b2Mul(xf->q, localCenter); -} - -inline void b2Sweep::Advance(float32 alpha) -{ - b2Assert(alpha0 < 1.0f); - float32 beta = (alpha - alpha0) / (1.0f - alpha0); - c0 = (1.0f - beta) * c0 + beta * c; - a0 = (1.0f - beta) * a0 + beta * a; - alpha0 = alpha; -} - -/// Normalize an angle in radians to be between -pi and pi -inline void b2Sweep::Normalize() -{ - float32 twoPi = 2.0f * b2_pi; - float32 d = twoPi * floorf(a0 / twoPi); - a0 -= d; - a -= d; -} - -#endif diff --git a/external/box2d/Common/b2Settings.cpp b/external/box2d/Common/b2Settings.cpp deleted file mode 100644 index 84d6f1d0e4..0000000000 --- a/external/box2d/Common/b2Settings.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#ifdef SHP -#include -#include -#include -#include -#else -#include -#include -#include -#endif - - -using namespace std; - - -b2Version b2_version = {2, 2, 1}; - -// Memory allocators. Modify these to use your own allocator. -void* b2Alloc(int32 size) -{ - return malloc(size); -} - -void b2Free(void* mem) -{ - free(mem); -} - -// You can modify this to use your logging facility. -void b2Log(const char* string, ...) -{ -#if defined(SHP) - #ifdef _DEBUG - __App_info(__PRETTY_FUNCTION__ , __LINE__, string); - #endif -#else - va_list args; - va_start(args, string); - vprintf(string, args); - va_end(args); -#endif -} diff --git a/external/box2d/Common/b2Settings.h b/external/box2d/Common/b2Settings.h deleted file mode 100644 index aaf4b12ccf..0000000000 --- a/external/box2d/Common/b2Settings.h +++ /dev/null @@ -1,150 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_SETTINGS_H -#define B2_SETTINGS_H - -#include -#include - -#define B2_NOT_USED(x) ((void)(x)) -#define b2Assert(A) assert(A) - -typedef signed char int8; -typedef signed short int16; -typedef signed int int32; -typedef unsigned char uint8; -typedef unsigned short uint16; -typedef unsigned int uint32; -typedef float float32; -typedef double float64; - -#define b2_maxFloat FLT_MAX -#define b2_epsilon FLT_EPSILON -#define b2_pi 3.14159265359f - -/// @file -/// Global tuning constants based on meters-kilograms-seconds (MKS) units. -/// - -// Collision - -/// The maximum number of contact points between two convex shapes. Do -/// not change this value. -#define b2_maxManifoldPoints 2 - -/// The maximum number of vertices on a convex polygon. You cannot increase -/// this too much because b2BlockAllocator has a maximum object size. -#define b2_maxPolygonVertices 8 - -/// This is used to fatten AABBs in the dynamic tree. This allows proxies -/// to move by a small amount without triggering a tree adjustment. -/// This is in meters. -#define b2_aabbExtension 0.1f - -/// This is used to fatten AABBs in the dynamic tree. This is used to predict -/// the future position based on the current displacement. -/// This is a dimensionless multiplier. -#define b2_aabbMultiplier 2.0f - -/// A small length used as a collision and constraint tolerance. Usually it is -/// chosen to be numerically significant, but visually insignificant. -#define b2_linearSlop 0.005f - -/// A small angle used as a collision and constraint tolerance. Usually it is -/// chosen to be numerically significant, but visually insignificant. -#define b2_angularSlop (2.0f / 180.0f * b2_pi) - -/// The radius of the polygon/edge shape skin. This should not be modified. Making -/// this smaller means polygons will have an insufficient buffer for continuous collision. -/// Making it larger may create artifacts for vertex collision. -#define b2_polygonRadius (2.0f * b2_linearSlop) - -/// Maximum number of sub-steps per contact in continuous physics simulation. -#define b2_maxSubSteps 8 - - -// Dynamics - -/// Maximum number of contacts to be handled to solve a TOI impact. -#define b2_maxTOIContacts 32 - -/// A velocity threshold for elastic collisions. Any collision with a relative linear -/// velocity below this threshold will be treated as inelastic. -#define b2_velocityThreshold 1.0f - -/// The maximum linear position correction used when solving constraints. This helps to -/// prevent overshoot. -#define b2_maxLinearCorrection 0.2f - -/// The maximum angular position correction used when solving constraints. This helps to -/// prevent overshoot. -#define b2_maxAngularCorrection (8.0f / 180.0f * b2_pi) - -/// The maximum linear velocity of a body. This limit is very large and is used -/// to prevent numerical problems. You shouldn't need to adjust this. -#define b2_maxTranslation 2.0f -#define b2_maxTranslationSquared (b2_maxTranslation * b2_maxTranslation) - -/// The maximum angular velocity of a body. This limit is very large and is used -/// to prevent numerical problems. You shouldn't need to adjust this. -#define b2_maxRotation (0.5f * b2_pi) -#define b2_maxRotationSquared (b2_maxRotation * b2_maxRotation) - -/// This scale factor controls how fast overlap is resolved. Ideally this would be 1 so -/// that overlap is removed in one time step. However using values close to 1 often lead -/// to overshoot. -#define b2_baumgarte 0.2f -#define b2_toiBaugarte 0.75f - - -// Sleep - -/// The time that a body must be still before it will go to sleep. -#define b2_timeToSleep 0.5f - -/// A body cannot sleep if its linear velocity is above this tolerance. -#define b2_linearSleepTolerance 0.01f - -/// A body cannot sleep if its angular velocity is above this tolerance. -#define b2_angularSleepTolerance (2.0f / 180.0f * b2_pi) - -// Memory Allocation - -/// Implement this function to use your own memory allocator. -void* b2Alloc(int32 size); - -/// If you implement b2Alloc, you should also implement this function. -void b2Free(void* mem); - -/// Logging function. -void b2Log(const char* string, ...); - -/// Version numbering scheme. -/// See http://en.wikipedia.org/wiki/Software_versioning -struct b2Version -{ - int32 major; ///< significant changes - int32 minor; ///< incremental changes - int32 revision; ///< bug fixes -}; - -/// Current version. -extern b2Version b2_version; - -#endif diff --git a/external/box2d/Common/b2StackAllocator.cpp b/external/box2d/Common/b2StackAllocator.cpp deleted file mode 100644 index 3caa5d9127..0000000000 --- a/external/box2d/Common/b2StackAllocator.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include - -b2StackAllocator::b2StackAllocator() -{ - m_index = 0; - m_allocation = 0; - m_maxAllocation = 0; - m_entryCount = 0; -} - -b2StackAllocator::~b2StackAllocator() -{ - b2Assert(m_index == 0); - b2Assert(m_entryCount == 0); -} - -void* b2StackAllocator::Allocate(int32 size) -{ - b2Assert(m_entryCount < b2_maxStackEntries); - - b2StackEntry* entry = m_entries + m_entryCount; - entry->size = size; - if (m_index + size > b2_stackSize) - { - entry->data = (char*)b2Alloc(size); - entry->usedMalloc = true; - } - else - { - entry->data = m_data + m_index; - entry->usedMalloc = false; - m_index += size; - } - - m_allocation += size; - m_maxAllocation = b2Max(m_maxAllocation, m_allocation); - ++m_entryCount; - - return entry->data; -} - -void b2StackAllocator::Free(void* p) -{ - b2Assert(m_entryCount > 0); - b2StackEntry* entry = m_entries + m_entryCount - 1; - b2Assert(p == entry->data); - if (entry->usedMalloc) - { - b2Free(p); - } - else - { - m_index -= entry->size; - } - m_allocation -= entry->size; - --m_entryCount; - - p = NULL; -} - -int32 b2StackAllocator::GetMaxAllocation() const -{ - return m_maxAllocation; -} diff --git a/external/box2d/Common/b2StackAllocator.h b/external/box2d/Common/b2StackAllocator.h deleted file mode 100644 index 6140d0d802..0000000000 --- a/external/box2d/Common/b2StackAllocator.h +++ /dev/null @@ -1,60 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_STACK_ALLOCATOR_H -#define B2_STACK_ALLOCATOR_H - -#include - -const int32 b2_stackSize = 100 * 1024; // 100k -const int32 b2_maxStackEntries = 32; - -struct b2StackEntry -{ - char* data; - int32 size; - bool usedMalloc; -}; - -// This is a stack allocator used for fast per step allocations. -// You must nest allocate/free pairs. The code will assert -// if you try to interleave multiple allocate/free pairs. -class b2StackAllocator -{ -public: - b2StackAllocator(); - ~b2StackAllocator(); - - void* Allocate(int32 size); - void Free(void* p); - - int32 GetMaxAllocation() const; - -private: - - char m_data[b2_stackSize]; - int32 m_index; - - int32 m_allocation; - int32 m_maxAllocation; - - b2StackEntry m_entries[b2_maxStackEntries]; - int32 m_entryCount; -}; - -#endif diff --git a/external/box2d/Common/b2Timer.cpp b/external/box2d/Common/b2Timer.cpp deleted file mode 100644 index b2bee94513..0000000000 --- a/external/box2d/Common/b2Timer.cpp +++ /dev/null @@ -1,100 +0,0 @@ -/* -* Copyright (c) 2011 Erin Catto http://box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include - -#if defined(_WIN32) && !defined(SHP) - -float64 b2Timer::s_invFrequency = 0.0f; - -#include - -b2Timer::b2Timer() -{ - LARGE_INTEGER largeInteger; - - if (s_invFrequency == 0.0f) - { - QueryPerformanceFrequency(&largeInteger); - s_invFrequency = float64(largeInteger.QuadPart); - if (s_invFrequency > 0.0f) - { - s_invFrequency = 1000.0f / s_invFrequency; - } - } - - QueryPerformanceCounter(&largeInteger); - m_start = float64(largeInteger.QuadPart); -} - -void b2Timer::Reset() -{ - LARGE_INTEGER largeInteger; - QueryPerformanceCounter(&largeInteger); - m_start = float64(largeInteger.QuadPart); -} - -float32 b2Timer::GetMilliseconds() const -{ - LARGE_INTEGER largeInteger; - QueryPerformanceCounter(&largeInteger); - float64 count = float64(largeInteger.QuadPart); - float32 ms = float32(s_invFrequency * (count - m_start)); - return ms; -} - -#elif defined(__linux__) || defined (__APPLE__) - -#include - -b2Timer::b2Timer() -{ - Reset(); -} - -void b2Timer::Reset() -{ - timeval t; - gettimeofday(&t, 0); - m_start_sec = t.tv_sec; - m_start_msec = t.tv_usec * 0.001f; -} - -float32 b2Timer::GetMilliseconds() const -{ - timeval t; - gettimeofday(&t, 0); - return (t.tv_sec - m_start_sec) * 1000 + t.tv_usec * 0.001f - m_start_msec; -} - -#else - -b2Timer::b2Timer() -{ -} - -void b2Timer::Reset() -{ -} - -float32 b2Timer::GetMilliseconds() const -{ - return 0.0f; -} - -#endif diff --git a/external/box2d/Common/b2Timer.h b/external/box2d/Common/b2Timer.h deleted file mode 100644 index 053a107a56..0000000000 --- a/external/box2d/Common/b2Timer.h +++ /dev/null @@ -1,45 +0,0 @@ -/* -* Copyright (c) 2011 Erin Catto http://box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include - -/// Timer for profiling. This has platform specific code and may -/// not work on every platform. -class b2Timer -{ -public: - - /// Constructor - b2Timer(); - - /// Reset the timer. - void Reset(); - - /// Get the time since construction or the last reset. - float32 GetMilliseconds() const; - -private: - -#if defined(_WIN32) - float64 m_start; - static float64 s_invFrequency; -#elif defined(__linux__) || defined (__APPLE__) - unsigned long m_start_sec; - unsigned long m_start_msec; -#endif -}; diff --git a/external/box2d/Dynamics/Contacts/b2ChainAndCircleContact.cpp b/external/box2d/Dynamics/Contacts/b2ChainAndCircleContact.cpp deleted file mode 100644 index 4ae4c41cd3..0000000000 --- a/external/box2d/Dynamics/Contacts/b2ChainAndCircleContact.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/* -* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include -#include -#include - -#include -using namespace std; - -b2Contact* b2ChainAndCircleContact::Create(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator) -{ - void* mem = allocator->Allocate(sizeof(b2ChainAndCircleContact)); - return new (mem) b2ChainAndCircleContact(fixtureA, indexA, fixtureB, indexB); -} - -void b2ChainAndCircleContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) -{ - ((b2ChainAndCircleContact*)contact)->~b2ChainAndCircleContact(); - allocator->Free(contact, sizeof(b2ChainAndCircleContact)); -} - -b2ChainAndCircleContact::b2ChainAndCircleContact(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB) -: b2Contact(fixtureA, indexA, fixtureB, indexB) -{ - b2Assert(m_fixtureA->GetType() == b2Shape::e_chain); - b2Assert(m_fixtureB->GetType() == b2Shape::e_circle); -} - -void b2ChainAndCircleContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) -{ - b2ChainShape* chain = (b2ChainShape*)m_fixtureA->GetShape(); - b2EdgeShape edge; - chain->GetChildEdge(&edge, m_indexA); - b2CollideEdgeAndCircle( manifold, &edge, xfA, - (b2CircleShape*)m_fixtureB->GetShape(), xfB); -} diff --git a/external/box2d/Dynamics/Contacts/b2ChainAndCircleContact.h b/external/box2d/Dynamics/Contacts/b2ChainAndCircleContact.h deleted file mode 100644 index 1cf601a61f..0000000000 --- a/external/box2d/Dynamics/Contacts/b2ChainAndCircleContact.h +++ /dev/null @@ -1,39 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_CHAIN_AND_CIRCLE_CONTACT_H -#define B2_CHAIN_AND_CIRCLE_CONTACT_H - -#include - -class b2BlockAllocator; - -class b2ChainAndCircleContact : public b2Contact -{ -public: - static b2Contact* Create( b2Fixture* fixtureA, int32 indexA, - b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); - static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); - - b2ChainAndCircleContact(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB); - ~b2ChainAndCircleContact() {} - - void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB); -}; - -#endif diff --git a/external/box2d/Dynamics/Contacts/b2ChainAndPolygonContact.cpp b/external/box2d/Dynamics/Contacts/b2ChainAndPolygonContact.cpp deleted file mode 100644 index 8116c34d1b..0000000000 --- a/external/box2d/Dynamics/Contacts/b2ChainAndPolygonContact.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/* -* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include -#include -#include - -#include -using namespace std; - -b2Contact* b2ChainAndPolygonContact::Create(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator) -{ - void* mem = allocator->Allocate(sizeof(b2ChainAndPolygonContact)); - return new (mem) b2ChainAndPolygonContact(fixtureA, indexA, fixtureB, indexB); -} - -void b2ChainAndPolygonContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) -{ - ((b2ChainAndPolygonContact*)contact)->~b2ChainAndPolygonContact(); - allocator->Free(contact, sizeof(b2ChainAndPolygonContact)); -} - -b2ChainAndPolygonContact::b2ChainAndPolygonContact(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB) -: b2Contact(fixtureA, indexA, fixtureB, indexB) -{ - b2Assert(m_fixtureA->GetType() == b2Shape::e_chain); - b2Assert(m_fixtureB->GetType() == b2Shape::e_polygon); -} - -void b2ChainAndPolygonContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) -{ - b2ChainShape* chain = (b2ChainShape*)m_fixtureA->GetShape(); - b2EdgeShape edge; - chain->GetChildEdge(&edge, m_indexA); - b2CollideEdgeAndPolygon( manifold, &edge, xfA, - (b2PolygonShape*)m_fixtureB->GetShape(), xfB); -} diff --git a/external/box2d/Dynamics/Contacts/b2ChainAndPolygonContact.h b/external/box2d/Dynamics/Contacts/b2ChainAndPolygonContact.h deleted file mode 100644 index 381c49b844..0000000000 --- a/external/box2d/Dynamics/Contacts/b2ChainAndPolygonContact.h +++ /dev/null @@ -1,39 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_CHAIN_AND_POLYGON_CONTACT_H -#define B2_CHAIN_AND_POLYGON_CONTACT_H - -#include - -class b2BlockAllocator; - -class b2ChainAndPolygonContact : public b2Contact -{ -public: - static b2Contact* Create( b2Fixture* fixtureA, int32 indexA, - b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); - static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); - - b2ChainAndPolygonContact(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB); - ~b2ChainAndPolygonContact() {} - - void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB); -}; - -#endif diff --git a/external/box2d/Dynamics/Contacts/b2CircleContact.cpp b/external/box2d/Dynamics/Contacts/b2CircleContact.cpp deleted file mode 100644 index 2436da5132..0000000000 --- a/external/box2d/Dynamics/Contacts/b2CircleContact.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include -#include -#include -#include - -#include -using namespace std; - -b2Contact* b2CircleContact::Create(b2Fixture* fixtureA, int32, b2Fixture* fixtureB, int32, b2BlockAllocator* allocator) -{ - void* mem = allocator->Allocate(sizeof(b2CircleContact)); - return new (mem) b2CircleContact(fixtureA, fixtureB); -} - -void b2CircleContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) -{ - ((b2CircleContact*)contact)->~b2CircleContact(); - allocator->Free(contact, sizeof(b2CircleContact)); -} - -b2CircleContact::b2CircleContact(b2Fixture* fixtureA, b2Fixture* fixtureB) - : b2Contact(fixtureA, 0, fixtureB, 0) -{ - b2Assert(m_fixtureA->GetType() == b2Shape::e_circle); - b2Assert(m_fixtureB->GetType() == b2Shape::e_circle); -} - -void b2CircleContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) -{ - b2CollideCircles(manifold, - (b2CircleShape*)m_fixtureA->GetShape(), xfA, - (b2CircleShape*)m_fixtureB->GetShape(), xfB); -} diff --git a/external/box2d/Dynamics/Contacts/b2CircleContact.h b/external/box2d/Dynamics/Contacts/b2CircleContact.h deleted file mode 100644 index 6da056ae0d..0000000000 --- a/external/box2d/Dynamics/Contacts/b2CircleContact.h +++ /dev/null @@ -1,39 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_CIRCLE_CONTACT_H -#define B2_CIRCLE_CONTACT_H - -#include - -class b2BlockAllocator; - -class b2CircleContact : public b2Contact -{ -public: - static b2Contact* Create( b2Fixture* fixtureA, int32 indexA, - b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); - static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); - - b2CircleContact(b2Fixture* fixtureA, b2Fixture* fixtureB); - ~b2CircleContact() {} - - void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB); -}; - -#endif diff --git a/external/box2d/Dynamics/Contacts/b2Contact.cpp b/external/box2d/Dynamics/Contacts/b2Contact.cpp deleted file mode 100644 index 2389af6434..0000000000 --- a/external/box2d/Dynamics/Contacts/b2Contact.cpp +++ /dev/null @@ -1,240 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -b2ContactRegister b2Contact::s_registers[b2Shape::e_typeCount][b2Shape::e_typeCount]; -bool b2Contact::s_initialized = false; - -void b2Contact::InitializeRegisters() -{ - AddType(b2CircleContact::Create, b2CircleContact::Destroy, b2Shape::e_circle, b2Shape::e_circle); - AddType(b2PolygonAndCircleContact::Create, b2PolygonAndCircleContact::Destroy, b2Shape::e_polygon, b2Shape::e_circle); - AddType(b2PolygonContact::Create, b2PolygonContact::Destroy, b2Shape::e_polygon, b2Shape::e_polygon); - AddType(b2EdgeAndCircleContact::Create, b2EdgeAndCircleContact::Destroy, b2Shape::e_edge, b2Shape::e_circle); - AddType(b2EdgeAndPolygonContact::Create, b2EdgeAndPolygonContact::Destroy, b2Shape::e_edge, b2Shape::e_polygon); - AddType(b2ChainAndCircleContact::Create, b2ChainAndCircleContact::Destroy, b2Shape::e_chain, b2Shape::e_circle); - AddType(b2ChainAndPolygonContact::Create, b2ChainAndPolygonContact::Destroy, b2Shape::e_chain, b2Shape::e_polygon); -} - -void b2Contact::AddType(b2ContactCreateFcn* createFcn, b2ContactDestroyFcn* destoryFcn, - b2Shape::Type type1, b2Shape::Type type2) -{ - b2Assert(0 <= type1 && type1 < b2Shape::e_typeCount); - b2Assert(0 <= type2 && type2 < b2Shape::e_typeCount); - - s_registers[type1][type2].createFcn = createFcn; - s_registers[type1][type2].destroyFcn = destoryFcn; - s_registers[type1][type2].primary = true; - - if (type1 != type2) - { - s_registers[type2][type1].createFcn = createFcn; - s_registers[type2][type1].destroyFcn = destoryFcn; - s_registers[type2][type1].primary = false; - } -} - -b2Contact* b2Contact::Create(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator) -{ - if (s_initialized == false) - { - InitializeRegisters(); - s_initialized = true; - } - - b2Shape::Type type1 = fixtureA->GetType(); - b2Shape::Type type2 = fixtureB->GetType(); - - b2Assert(0 <= type1 && type1 < b2Shape::e_typeCount); - b2Assert(0 <= type2 && type2 < b2Shape::e_typeCount); - - b2ContactCreateFcn* createFcn = s_registers[type1][type2].createFcn; - if (createFcn) - { - if (s_registers[type1][type2].primary) - { - return createFcn(fixtureA, indexA, fixtureB, indexB, allocator); - } - else - { - return createFcn(fixtureB, indexB, fixtureA, indexA, allocator); - } - } - else - { - return NULL; - } -} - -void b2Contact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) -{ - b2Assert(s_initialized == true); - - if (contact->m_manifold.pointCount > 0) - { - contact->GetFixtureA()->GetBody()->SetAwake(true); - contact->GetFixtureB()->GetBody()->SetAwake(true); - } - - b2Shape::Type typeA = contact->GetFixtureA()->GetType(); - b2Shape::Type typeB = contact->GetFixtureB()->GetType(); - - b2Assert(0 <= typeA && typeB < b2Shape::e_typeCount); - b2Assert(0 <= typeA && typeB < b2Shape::e_typeCount); - - b2ContactDestroyFcn* destroyFcn = s_registers[typeA][typeB].destroyFcn; - destroyFcn(contact, allocator); -} - -b2Contact::b2Contact(b2Fixture* fA, int32 indexA, b2Fixture* fB, int32 indexB) -{ - m_flags = e_enabledFlag; - - m_fixtureA = fA; - m_fixtureB = fB; - - m_indexA = indexA; - m_indexB = indexB; - - m_manifold.pointCount = 0; - - m_prev = NULL; - m_next = NULL; - - m_nodeA.contact = NULL; - m_nodeA.prev = NULL; - m_nodeA.next = NULL; - m_nodeA.other = NULL; - - m_nodeB.contact = NULL; - m_nodeB.prev = NULL; - m_nodeB.next = NULL; - m_nodeB.other = NULL; - - m_toiCount = 0; - - m_friction = b2MixFriction(m_fixtureA->m_friction, m_fixtureB->m_friction); - m_restitution = b2MixRestitution(m_fixtureA->m_restitution, m_fixtureB->m_restitution); -} - -// Update the contact manifold and touching status. -// Note: do not assume the fixture AABBs are overlapping or are valid. -void b2Contact::Update(b2ContactListener* listener) -{ - b2Manifold oldManifold = m_manifold; - - // Re-enable this contact. - m_flags |= e_enabledFlag; - - bool touching = false; - bool wasTouching = (m_flags & e_touchingFlag) == e_touchingFlag; - - bool sensorA = m_fixtureA->IsSensor(); - bool sensorB = m_fixtureB->IsSensor(); - bool sensor = sensorA || sensorB; - - b2Body* bodyA = m_fixtureA->GetBody(); - b2Body* bodyB = m_fixtureB->GetBody(); - const b2Transform& xfA = bodyA->GetTransform(); - const b2Transform& xfB = bodyB->GetTransform(); - - // Is this contact a sensor? - if (sensor) - { - const b2Shape* shapeA = m_fixtureA->GetShape(); - const b2Shape* shapeB = m_fixtureB->GetShape(); - touching = b2TestOverlap(shapeA, m_indexA, shapeB, m_indexB, xfA, xfB); - - // Sensors don't generate manifolds. - m_manifold.pointCount = 0; - } - else - { - Evaluate(&m_manifold, xfA, xfB); - touching = m_manifold.pointCount > 0; - - // Match old contact ids to new contact ids and copy the - // stored impulses to warm start the solver. - for (int32 i = 0; i < m_manifold.pointCount; ++i) - { - b2ManifoldPoint* mp2 = m_manifold.points + i; - mp2->normalImpulse = 0.0f; - mp2->tangentImpulse = 0.0f; - b2ContactID id2 = mp2->id; - - for (int32 j = 0; j < oldManifold.pointCount; ++j) - { - b2ManifoldPoint* mp1 = oldManifold.points + j; - - if (mp1->id.key == id2.key) - { - mp2->normalImpulse = mp1->normalImpulse; - mp2->tangentImpulse = mp1->tangentImpulse; - break; - } - } - } - - if (touching != wasTouching) - { - bodyA->SetAwake(true); - bodyB->SetAwake(true); - } - } - - if (touching) - { - m_flags |= e_touchingFlag; - } - else - { - m_flags &= ~e_touchingFlag; - } - - if (wasTouching == false && touching == true && listener) - { - listener->BeginContact(this); - } - - if (wasTouching == true && touching == false && listener) - { - listener->EndContact(this); - } - - if (sensor == false && touching && listener) - { - listener->PreSolve(this, &oldManifold); - } -} diff --git a/external/box2d/Dynamics/Contacts/b2Contact.h b/external/box2d/Dynamics/Contacts/b2Contact.h deleted file mode 100644 index 20d9403ce7..0000000000 --- a/external/box2d/Dynamics/Contacts/b2Contact.h +++ /dev/null @@ -1,331 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_CONTACT_H -#define B2_CONTACT_H - -#include -#include -#include -#include - -class b2Body; -class b2Contact; -class b2Fixture; -class b2World; -class b2BlockAllocator; -class b2StackAllocator; -class b2ContactListener; - -/// Friction mixing law. The idea is to allow either fixture to drive the restitution to zero. -/// For example, anything slides on ice. -inline float32 b2MixFriction(float32 friction1, float32 friction2) -{ - return std::sqrt(friction1 * friction2); -} - -/// Restitution mixing law. The idea is allow for anything to bounce off an inelastic surface. -/// For example, a superball bounces on anything. -inline float32 b2MixRestitution(float32 restitution1, float32 restitution2) -{ - return restitution1 > restitution2 ? restitution1 : restitution2; -} - -typedef b2Contact* b2ContactCreateFcn( b2Fixture* fixtureA, int32 indexA, - b2Fixture* fixtureB, int32 indexB, - b2BlockAllocator* allocator); -typedef void b2ContactDestroyFcn(b2Contact* contact, b2BlockAllocator* allocator); - -struct b2ContactRegister -{ - b2ContactCreateFcn* createFcn; - b2ContactDestroyFcn* destroyFcn; - bool primary; -}; - -/// A contact edge is used to connect bodies and contacts together -/// in a contact graph where each body is a node and each contact -/// is an edge. A contact edge belongs to a doubly linked list -/// maintained in each attached body. Each contact has two contact -/// nodes, one for each attached body. -struct b2ContactEdge -{ - b2Body* other; ///< provides quick access to the other body attached. - b2Contact* contact; ///< the contact - b2ContactEdge* prev; ///< the previous contact edge in the body's contact list - b2ContactEdge* next; ///< the next contact edge in the body's contact list -}; - -/// The class manages contact between two shapes. A contact exists for each overlapping -/// AABB in the broad-phase (except if filtered). Therefore a contact object may exist -/// that has no contact points. -class b2Contact -{ -public: - - /// Get the contact manifold. Do not modify the manifold unless you understand the - /// internals of Box2D. - b2Manifold* GetManifold(); - const b2Manifold* GetManifold() const; - - /// Get the world manifold. - void GetWorldManifold(b2WorldManifold* worldManifold) const; - - /// Is this contact touching? - bool IsTouching() const; - - /// Enable/disable this contact. This can be used inside the pre-solve - /// contact listener. The contact is only disabled for the current - /// time step (or sub-step in continuous collisions). - void SetEnabled(bool flag); - - /// Has this contact been disabled? - bool IsEnabled() const; - - /// Get the next contact in the world's contact list. - b2Contact* GetNext(); - const b2Contact* GetNext() const; - - /// Get fixture A in this contact. - b2Fixture* GetFixtureA(); - const b2Fixture* GetFixtureA() const; - - /// Get the child primitive index for fixture A. - int32 GetChildIndexA() const; - - /// Get fixture B in this contact. - b2Fixture* GetFixtureB(); - const b2Fixture* GetFixtureB() const; - - /// Get the child primitive index for fixture B. - int32 GetChildIndexB() const; - - /// Override the default friction mixture. You can call this in b2ContactListener::PreSolve. - /// This value persists until set or reset. - void SetFriction(float32 friction); - - /// Get the friction. - float32 GetFriction() const; - - /// Reset the friction mixture to the default value. - void ResetFriction(); - - /// Override the default restitution mixture. You can call this in b2ContactListener::PreSolve. - /// The value persists until you set or reset. - void SetRestitution(float32 restitution); - - /// Get the restitution. - float32 GetRestitution() const; - - /// Reset the restitution to the default value. - void ResetRestitution(); - - /// Evaluate this contact with your own manifold and transforms. - virtual void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) = 0; - -protected: - friend class b2ContactManager; - friend class b2World; - friend class b2ContactSolver; - friend class b2Body; - friend class b2Fixture; - - // Flags stored in m_flags - enum - { - // Used when crawling contact graph when forming islands. - e_islandFlag = 0x0001, - - // Set when the shapes are touching. - e_touchingFlag = 0x0002, - - // This contact can be disabled (by user) - e_enabledFlag = 0x0004, - - // This contact needs filtering because a fixture filter was changed. - e_filterFlag = 0x0008, - - // This bullet contact had a TOI event - e_bulletHitFlag = 0x0010, - - // This contact has a valid TOI in m_toi - e_toiFlag = 0x0020 - }; - - /// Flag this contact for filtering. Filtering will occur the next time step. - void FlagForFiltering(); - - static void AddType(b2ContactCreateFcn* createFcn, b2ContactDestroyFcn* destroyFcn, - b2Shape::Type typeA, b2Shape::Type typeB); - static void InitializeRegisters(); - static b2Contact* Create(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); - static void Destroy(b2Contact* contact, b2Shape::Type typeA, b2Shape::Type typeB, b2BlockAllocator* allocator); - static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); - - b2Contact() : m_fixtureA(NULL), m_fixtureB(NULL) {} - b2Contact(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB); - virtual ~b2Contact() {} - - void Update(b2ContactListener* listener); - - static b2ContactRegister s_registers[b2Shape::e_typeCount][b2Shape::e_typeCount]; - static bool s_initialized; - - uint32 m_flags; - - // World pool and list pointers. - b2Contact* m_prev; - b2Contact* m_next; - - // Nodes for connecting bodies. - b2ContactEdge m_nodeA; - b2ContactEdge m_nodeB; - - b2Fixture* m_fixtureA; - b2Fixture* m_fixtureB; - - int32 m_indexA; - int32 m_indexB; - - b2Manifold m_manifold; - - int32 m_toiCount; - float32 m_toi; - - float32 m_friction; - float32 m_restitution; -}; - -inline b2Manifold* b2Contact::GetManifold() -{ - return &m_manifold; -} - -inline const b2Manifold* b2Contact::GetManifold() const -{ - return &m_manifold; -} - -inline void b2Contact::GetWorldManifold(b2WorldManifold* worldManifold) const -{ - const b2Body* bodyA = m_fixtureA->GetBody(); - const b2Body* bodyB = m_fixtureB->GetBody(); - const b2Shape* shapeA = m_fixtureA->GetShape(); - const b2Shape* shapeB = m_fixtureB->GetShape(); - - worldManifold->Initialize(&m_manifold, bodyA->GetTransform(), shapeA->m_radius, bodyB->GetTransform(), shapeB->m_radius); -} - -inline void b2Contact::SetEnabled(bool flag) -{ - if (flag) - { - m_flags |= e_enabledFlag; - } - else - { - m_flags &= ~e_enabledFlag; - } -} - -inline bool b2Contact::IsEnabled() const -{ - return (m_flags & e_enabledFlag) == e_enabledFlag; -} - -inline bool b2Contact::IsTouching() const -{ - return (m_flags & e_touchingFlag) == e_touchingFlag; -} - -inline b2Contact* b2Contact::GetNext() -{ - return m_next; -} - -inline const b2Contact* b2Contact::GetNext() const -{ - return m_next; -} - -inline b2Fixture* b2Contact::GetFixtureA() -{ - return m_fixtureA; -} - -inline const b2Fixture* b2Contact::GetFixtureA() const -{ - return m_fixtureA; -} - -inline b2Fixture* b2Contact::GetFixtureB() -{ - return m_fixtureB; -} - -inline int32 b2Contact::GetChildIndexA() const -{ - return m_indexA; -} - -inline const b2Fixture* b2Contact::GetFixtureB() const -{ - return m_fixtureB; -} - -inline int32 b2Contact::GetChildIndexB() const -{ - return m_indexB; -} - -inline void b2Contact::FlagForFiltering() -{ - m_flags |= e_filterFlag; -} - -inline void b2Contact::SetFriction(float32 friction) -{ - m_friction = friction; -} - -inline float32 b2Contact::GetFriction() const -{ - return m_friction; -} - -inline void b2Contact::ResetFriction() -{ - m_friction = b2MixFriction(m_fixtureA->m_friction, m_fixtureB->m_friction); -} - -inline void b2Contact::SetRestitution(float32 restitution) -{ - m_restitution = restitution; -} - -inline float32 b2Contact::GetRestitution() const -{ - return m_restitution; -} - -inline void b2Contact::ResetRestitution() -{ - m_restitution = b2MixRestitution(m_fixtureA->m_restitution, m_fixtureB->m_restitution); -} - -#endif diff --git a/external/box2d/Dynamics/Contacts/b2ContactSolver.cpp b/external/box2d/Dynamics/Contacts/b2ContactSolver.cpp deleted file mode 100644 index 0dc740342a..0000000000 --- a/external/box2d/Dynamics/Contacts/b2ContactSolver.cpp +++ /dev/null @@ -1,832 +0,0 @@ -/* -* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include - -#include -#include -#include -#include -#include - -#define B2_DEBUG_SOLVER 0 - -struct b2ContactPositionConstraint -{ - b2Vec2 localPoints[b2_maxManifoldPoints]; - b2Vec2 localNormal; - b2Vec2 localPoint; - int32 indexA; - int32 indexB; - float32 invMassA, invMassB; - b2Vec2 localCenterA, localCenterB; - float32 invIA, invIB; - b2Manifold::Type type; - float32 radiusA, radiusB; - int32 pointCount; -}; - -b2ContactSolver::b2ContactSolver(b2ContactSolverDef* def) -{ - m_step = def->step; - m_allocator = def->allocator; - m_count = def->count; - m_positionConstraints = (b2ContactPositionConstraint*)m_allocator->Allocate(m_count * sizeof(b2ContactPositionConstraint)); - m_velocityConstraints = (b2ContactVelocityConstraint*)m_allocator->Allocate(m_count * sizeof(b2ContactVelocityConstraint)); - m_positions = def->positions; - m_velocities = def->velocities; - m_contacts = def->contacts; - - // Initialize position independent portions of the constraints. - for (int32 i = 0; i < m_count; ++i) - { - b2Contact* contact = m_contacts[i]; - - b2Fixture* fixtureA = contact->m_fixtureA; - b2Fixture* fixtureB = contact->m_fixtureB; - b2Shape* shapeA = fixtureA->GetShape(); - b2Shape* shapeB = fixtureB->GetShape(); - float32 radiusA = shapeA->m_radius; - float32 radiusB = shapeB->m_radius; - b2Body* bodyA = fixtureA->GetBody(); - b2Body* bodyB = fixtureB->GetBody(); - b2Manifold* manifold = contact->GetManifold(); - - int32 pointCount = manifold->pointCount; - b2Assert(pointCount > 0); - - b2ContactVelocityConstraint* vc = m_velocityConstraints + i; - vc->friction = contact->m_friction; - vc->restitution = contact->m_restitution; - vc->indexA = bodyA->m_islandIndex; - vc->indexB = bodyB->m_islandIndex; - vc->invMassA = bodyA->m_invMass; - vc->invMassB = bodyB->m_invMass; - vc->invIA = bodyA->m_invI; - vc->invIB = bodyB->m_invI; - vc->contactIndex = i; - vc->pointCount = pointCount; - vc->K.SetZero(); - vc->normalMass.SetZero(); - - b2ContactPositionConstraint* pc = m_positionConstraints + i; - pc->indexA = bodyA->m_islandIndex; - pc->indexB = bodyB->m_islandIndex; - pc->invMassA = bodyA->m_invMass; - pc->invMassB = bodyB->m_invMass; - pc->localCenterA = bodyA->m_sweep.localCenter; - pc->localCenterB = bodyB->m_sweep.localCenter; - pc->invIA = bodyA->m_invI; - pc->invIB = bodyB->m_invI; - pc->localNormal = manifold->localNormal; - pc->localPoint = manifold->localPoint; - pc->pointCount = pointCount; - pc->radiusA = radiusA; - pc->radiusB = radiusB; - pc->type = manifold->type; - - for (int32 j = 0; j < pointCount; ++j) - { - b2ManifoldPoint* cp = manifold->points + j; - b2VelocityConstraintPoint* vcp = vc->points + j; - - if (m_step.warmStarting) - { - vcp->normalImpulse = m_step.dtRatio * cp->normalImpulse; - vcp->tangentImpulse = m_step.dtRatio * cp->tangentImpulse; - } - else - { - vcp->normalImpulse = 0.0f; - vcp->tangentImpulse = 0.0f; - } - - vcp->rA.SetZero(); - vcp->rB.SetZero(); - vcp->normalMass = 0.0f; - vcp->tangentMass = 0.0f; - vcp->velocityBias = 0.0f; - - pc->localPoints[j] = cp->localPoint; - } - } -} - -b2ContactSolver::~b2ContactSolver() -{ - m_allocator->Free(m_velocityConstraints); - m_allocator->Free(m_positionConstraints); -} - -// Initialize position dependent portions of the velocity constraints. -void b2ContactSolver::InitializeVelocityConstraints() -{ - for (int32 i = 0; i < m_count; ++i) - { - b2ContactVelocityConstraint* vc = m_velocityConstraints + i; - b2ContactPositionConstraint* pc = m_positionConstraints + i; - - float32 radiusA = pc->radiusA; - float32 radiusB = pc->radiusB; - b2Manifold* manifold = m_contacts[vc->contactIndex]->GetManifold(); - - int32 indexA = vc->indexA; - int32 indexB = vc->indexB; - - float32 mA = vc->invMassA; - float32 mB = vc->invMassB; - float32 iA = vc->invIA; - float32 iB = vc->invIB; - b2Vec2 localCenterA = pc->localCenterA; - b2Vec2 localCenterB = pc->localCenterB; - - b2Vec2 cA = m_positions[indexA].c; - float32 aA = m_positions[indexA].a; - b2Vec2 vA = m_velocities[indexA].v; - float32 wA = m_velocities[indexA].w; - - b2Vec2 cB = m_positions[indexB].c; - float32 aB = m_positions[indexB].a; - b2Vec2 vB = m_velocities[indexB].v; - float32 wB = m_velocities[indexB].w; - - b2Assert(manifold->pointCount > 0); - - b2Transform xfA, xfB; - xfA.q.Set(aA); - xfB.q.Set(aB); - xfA.p = cA - b2Mul(xfA.q, localCenterA); - xfB.p = cB - b2Mul(xfB.q, localCenterB); - - b2WorldManifold worldManifold; - worldManifold.Initialize(manifold, xfA, radiusA, xfB, radiusB); - - vc->normal = worldManifold.normal; - - int32 pointCount = vc->pointCount; - for (int32 j = 0; j < pointCount; ++j) - { - b2VelocityConstraintPoint* vcp = vc->points + j; - - vcp->rA = worldManifold.points[j] - cA; - vcp->rB = worldManifold.points[j] - cB; - - float32 rnA = b2Cross(vcp->rA, vc->normal); - float32 rnB = b2Cross(vcp->rB, vc->normal); - - float32 kNormal = mA + mB + iA * rnA * rnA + iB * rnB * rnB; - - vcp->normalMass = kNormal > 0.0f ? 1.0f / kNormal : 0.0f; - - b2Vec2 tangent = b2Cross(vc->normal, 1.0f); - - float32 rtA = b2Cross(vcp->rA, tangent); - float32 rtB = b2Cross(vcp->rB, tangent); - - float32 kTangent = mA + mB + iA * rtA * rtA + iB * rtB * rtB; - - vcp->tangentMass = kTangent > 0.0f ? 1.0f / kTangent : 0.0f; - - // Setup a velocity bias for restitution. - vcp->velocityBias = 0.0f; - float32 vRel = b2Dot(vc->normal, vB + b2Cross(wB, vcp->rB) - vA - b2Cross(wA, vcp->rA)); - if (vRel < -b2_velocityThreshold) - { - vcp->velocityBias = -vc->restitution * vRel; - } - } - - // If we have two points, then prepare the block solver. - if (vc->pointCount == 2) - { - b2VelocityConstraintPoint* vcp1 = vc->points + 0; - b2VelocityConstraintPoint* vcp2 = vc->points + 1; - - float32 rn1A = b2Cross(vcp1->rA, vc->normal); - float32 rn1B = b2Cross(vcp1->rB, vc->normal); - float32 rn2A = b2Cross(vcp2->rA, vc->normal); - float32 rn2B = b2Cross(vcp2->rB, vc->normal); - - float32 k11 = mA + mB + iA * rn1A * rn1A + iB * rn1B * rn1B; - float32 k22 = mA + mB + iA * rn2A * rn2A + iB * rn2B * rn2B; - float32 k12 = mA + mB + iA * rn1A * rn2A + iB * rn1B * rn2B; - - // Ensure a reasonable condition number. - const float32 k_maxConditionNumber = 1000.0f; - if (k11 * k11 < k_maxConditionNumber * (k11 * k22 - k12 * k12)) - { - // K is safe to invert. - vc->K.ex.Set(k11, k12); - vc->K.ey.Set(k12, k22); - vc->normalMass = vc->K.GetInverse(); - } - else - { - // The constraints are redundant, just use one. - // TODO_ERIN use deepest? - vc->pointCount = 1; - } - } - } -} - -void b2ContactSolver::WarmStart() -{ - // Warm start. - for (int32 i = 0; i < m_count; ++i) - { - b2ContactVelocityConstraint* vc = m_velocityConstraints + i; - - int32 indexA = vc->indexA; - int32 indexB = vc->indexB; - float32 mA = vc->invMassA; - float32 iA = vc->invIA; - float32 mB = vc->invMassB; - float32 iB = vc->invIB; - int32 pointCount = vc->pointCount; - - b2Vec2 vA = m_velocities[indexA].v; - float32 wA = m_velocities[indexA].w; - b2Vec2 vB = m_velocities[indexB].v; - float32 wB = m_velocities[indexB].w; - - b2Vec2 normal = vc->normal; - b2Vec2 tangent = b2Cross(normal, 1.0f); - - for (int32 j = 0; j < pointCount; ++j) - { - b2VelocityConstraintPoint* vcp = vc->points + j; - b2Vec2 P = vcp->normalImpulse * normal + vcp->tangentImpulse * tangent; - wA -= iA * b2Cross(vcp->rA, P); - vA -= mA * P; - wB += iB * b2Cross(vcp->rB, P); - vB += mB * P; - } - - m_velocities[indexA].v = vA; - m_velocities[indexA].w = wA; - m_velocities[indexB].v = vB; - m_velocities[indexB].w = wB; - } -} - -void b2ContactSolver::SolveVelocityConstraints() -{ - for (int32 i = 0; i < m_count; ++i) - { - b2ContactVelocityConstraint* vc = m_velocityConstraints + i; - - int32 indexA = vc->indexA; - int32 indexB = vc->indexB; - float32 mA = vc->invMassA; - float32 iA = vc->invIA; - float32 mB = vc->invMassB; - float32 iB = vc->invIB; - int32 pointCount = vc->pointCount; - - b2Vec2 vA = m_velocities[indexA].v; - float32 wA = m_velocities[indexA].w; - b2Vec2 vB = m_velocities[indexB].v; - float32 wB = m_velocities[indexB].w; - - b2Vec2 normal = vc->normal; - b2Vec2 tangent = b2Cross(normal, 1.0f); - float32 friction = vc->friction; - - b2Assert(pointCount == 1 || pointCount == 2); - - // Solve tangent constraints first because non-penetration is more important - // than friction. - for (int32 j = 0; j < pointCount; ++j) - { - b2VelocityConstraintPoint* vcp = vc->points + j; - - // Relative velocity at contact - b2Vec2 dv = vB + b2Cross(wB, vcp->rB) - vA - b2Cross(wA, vcp->rA); - - // Compute tangent force - float32 vt = b2Dot(dv, tangent); - float32 lambda = vcp->tangentMass * (-vt); - - // b2Clamp the accumulated force - float32 maxFriction = friction * vcp->normalImpulse; - float32 newImpulse = b2Clamp(vcp->tangentImpulse + lambda, -maxFriction, maxFriction); - lambda = newImpulse - vcp->tangentImpulse; - vcp->tangentImpulse = newImpulse; - - // Apply contact impulse - b2Vec2 P = lambda * tangent; - - vA -= mA * P; - wA -= iA * b2Cross(vcp->rA, P); - - vB += mB * P; - wB += iB * b2Cross(vcp->rB, P); - } - - // Solve normal constraints - if (vc->pointCount == 1) - { - b2VelocityConstraintPoint* vcp = vc->points + 0; - - // Relative velocity at contact - b2Vec2 dv = vB + b2Cross(wB, vcp->rB) - vA - b2Cross(wA, vcp->rA); - - // Compute normal impulse - float32 vn = b2Dot(dv, normal); - float32 lambda = -vcp->normalMass * (vn - vcp->velocityBias); - - // b2Clamp the accumulated impulse - float32 newImpulse = b2Max(vcp->normalImpulse + lambda, 0.0f); - lambda = newImpulse - vcp->normalImpulse; - vcp->normalImpulse = newImpulse; - - // Apply contact impulse - b2Vec2 P = lambda * normal; - vA -= mA * P; - wA -= iA * b2Cross(vcp->rA, P); - - vB += mB * P; - wB += iB * b2Cross(vcp->rB, P); - } - else - { - // Block solver developed in collaboration with Dirk Gregorius (back in 01/07 on Box2D_Lite). - // Build the mini LCP for this contact patch - // - // vn = A * x + b, vn >= 0, , vn >= 0, x >= 0 and vn_i * x_i = 0 with i = 1..2 - // - // A = J * W * JT and J = ( -n, -r1 x n, n, r2 x n ) - // b = vn0 - velocityBias - // - // The system is solved using the "Total enumeration method" (s. Murty). The complementary constraint vn_i * x_i - // implies that we must have in any solution either vn_i = 0 or x_i = 0. So for the 2D contact problem the cases - // vn1 = 0 and vn2 = 0, x1 = 0 and x2 = 0, x1 = 0 and vn2 = 0, x2 = 0 and vn1 = 0 need to be tested. The first valid - // solution that satisfies the problem is chosen. - // - // In order to account of the accumulated impulse 'a' (because of the iterative nature of the solver which only requires - // that the accumulated impulse is clamped and not the incremental impulse) we change the impulse variable (x_i). - // - // Substitute: - // - // x = a + d - // - // a := old total impulse - // x := new total impulse - // d := incremental impulse - // - // For the current iteration we extend the formula for the incremental impulse - // to compute the new total impulse: - // - // vn = A * d + b - // = A * (x - a) + b - // = A * x + b - A * a - // = A * x + b' - // b' = b - A * a; - - b2VelocityConstraintPoint* cp1 = vc->points + 0; - b2VelocityConstraintPoint* cp2 = vc->points + 1; - - b2Vec2 a(cp1->normalImpulse, cp2->normalImpulse); - b2Assert(a.x >= 0.0f && a.y >= 0.0f); - - // Relative velocity at contact - b2Vec2 dv1 = vB + b2Cross(wB, cp1->rB) - vA - b2Cross(wA, cp1->rA); - b2Vec2 dv2 = vB + b2Cross(wB, cp2->rB) - vA - b2Cross(wA, cp2->rA); - - // Compute normal velocity - float32 vn1 = b2Dot(dv1, normal); - float32 vn2 = b2Dot(dv2, normal); - - b2Vec2 b; - b.x = vn1 - cp1->velocityBias; - b.y = vn2 - cp2->velocityBias; - - // Compute b' - b -= b2Mul(vc->K, a); - - const float32 k_errorTol = 1e-3f; - B2_NOT_USED(k_errorTol); - - for (;;) - { - // - // Case 1: vn = 0 - // - // 0 = A * x + b' - // - // Solve for x: - // - // x = - inv(A) * b' - // - b2Vec2 x = - b2Mul(vc->normalMass, b); - - if (x.x >= 0.0f && x.y >= 0.0f) - { - // Get the incremental impulse - b2Vec2 d = x - a; - - // Apply incremental impulse - b2Vec2 P1 = d.x * normal; - b2Vec2 P2 = d.y * normal; - vA -= mA * (P1 + P2); - wA -= iA * (b2Cross(cp1->rA, P1) + b2Cross(cp2->rA, P2)); - - vB += mB * (P1 + P2); - wB += iB * (b2Cross(cp1->rB, P1) + b2Cross(cp2->rB, P2)); - - // Accumulate - cp1->normalImpulse = x.x; - cp2->normalImpulse = x.y; - -#if B2_DEBUG_SOLVER == 1 - // Postconditions - dv1 = vB + b2Cross(wB, cp1->rB) - vA - b2Cross(wA, cp1->rA); - dv2 = vB + b2Cross(wB, cp2->rB) - vA - b2Cross(wA, cp2->rA); - - // Compute normal velocity - vn1 = b2Dot(dv1, normal); - vn2 = b2Dot(dv2, normal); - - b2Assert(b2Abs(vn1 - cp1->velocityBias) < k_errorTol); - b2Assert(b2Abs(vn2 - cp2->velocityBias) < k_errorTol); -#endif - break; - } - - // - // Case 2: vn1 = 0 and x2 = 0 - // - // 0 = a11 * x1 + a12 * 0 + b1' - // vn2 = a21 * x1 + a22 * 0 + b2' - // - x.x = - cp1->normalMass * b.x; - x.y = 0.0f; - vn1 = 0.0f; - vn2 = vc->K.ex.y * x.x + b.y; - - if (x.x >= 0.0f && vn2 >= 0.0f) - { - // Get the incremental impulse - b2Vec2 d = x - a; - - // Apply incremental impulse - b2Vec2 P1 = d.x * normal; - b2Vec2 P2 = d.y * normal; - vA -= mA * (P1 + P2); - wA -= iA * (b2Cross(cp1->rA, P1) + b2Cross(cp2->rA, P2)); - - vB += mB * (P1 + P2); - wB += iB * (b2Cross(cp1->rB, P1) + b2Cross(cp2->rB, P2)); - - // Accumulate - cp1->normalImpulse = x.x; - cp2->normalImpulse = x.y; - -#if B2_DEBUG_SOLVER == 1 - // Postconditions - dv1 = vB + b2Cross(wB, cp1->rB) - vA - b2Cross(wA, cp1->rA); - - // Compute normal velocity - vn1 = b2Dot(dv1, normal); - - b2Assert(b2Abs(vn1 - cp1->velocityBias) < k_errorTol); -#endif - break; - } - - - // - // Case 3: vn2 = 0 and x1 = 0 - // - // vn1 = a11 * 0 + a12 * x2 + b1' - // 0 = a21 * 0 + a22 * x2 + b2' - // - x.x = 0.0f; - x.y = - cp2->normalMass * b.y; - vn1 = vc->K.ey.x * x.y + b.x; - vn2 = 0.0f; - - if (x.y >= 0.0f && vn1 >= 0.0f) - { - // Resubstitute for the incremental impulse - b2Vec2 d = x - a; - - // Apply incremental impulse - b2Vec2 P1 = d.x * normal; - b2Vec2 P2 = d.y * normal; - vA -= mA * (P1 + P2); - wA -= iA * (b2Cross(cp1->rA, P1) + b2Cross(cp2->rA, P2)); - - vB += mB * (P1 + P2); - wB += iB * (b2Cross(cp1->rB, P1) + b2Cross(cp2->rB, P2)); - - // Accumulate - cp1->normalImpulse = x.x; - cp2->normalImpulse = x.y; - -#if B2_DEBUG_SOLVER == 1 - // Postconditions - dv2 = vB + b2Cross(wB, cp2->rB) - vA - b2Cross(wA, cp2->rA); - - // Compute normal velocity - vn2 = b2Dot(dv2, normal); - - b2Assert(b2Abs(vn2 - cp2->velocityBias) < k_errorTol); -#endif - break; - } - - // - // Case 4: x1 = 0 and x2 = 0 - // - // vn1 = b1 - // vn2 = b2; - x.x = 0.0f; - x.y = 0.0f; - vn1 = b.x; - vn2 = b.y; - - if (vn1 >= 0.0f && vn2 >= 0.0f ) - { - // Resubstitute for the incremental impulse - b2Vec2 d = x - a; - - // Apply incremental impulse - b2Vec2 P1 = d.x * normal; - b2Vec2 P2 = d.y * normal; - vA -= mA * (P1 + P2); - wA -= iA * (b2Cross(cp1->rA, P1) + b2Cross(cp2->rA, P2)); - - vB += mB * (P1 + P2); - wB += iB * (b2Cross(cp1->rB, P1) + b2Cross(cp2->rB, P2)); - - // Accumulate - cp1->normalImpulse = x.x; - cp2->normalImpulse = x.y; - - break; - } - - // No solution, give up. This is hit sometimes, but it doesn't seem to matter. - break; - } - } - - m_velocities[indexA].v = vA; - m_velocities[indexA].w = wA; - m_velocities[indexB].v = vB; - m_velocities[indexB].w = wB; - } -} - -void b2ContactSolver::StoreImpulses() -{ - for (int32 i = 0; i < m_count; ++i) - { - b2ContactVelocityConstraint* vc = m_velocityConstraints + i; - b2Manifold* manifold = m_contacts[vc->contactIndex]->GetManifold(); - - for (int32 j = 0; j < vc->pointCount; ++j) - { - manifold->points[j].normalImpulse = vc->points[j].normalImpulse; - manifold->points[j].tangentImpulse = vc->points[j].tangentImpulse; - } - } -} - -struct b2PositionSolverManifold -{ - void Initialize(b2ContactPositionConstraint* pc, const b2Transform& xfA, const b2Transform& xfB, int32 index) - { - b2Assert(pc->pointCount > 0); - - switch (pc->type) - { - case b2Manifold::e_circles: - { - b2Vec2 pointA = b2Mul(xfA, pc->localPoint); - b2Vec2 pointB = b2Mul(xfB, pc->localPoints[0]); - normal = pointB - pointA; - normal.Normalize(); - point = 0.5f * (pointA + pointB); - separation = b2Dot(pointB - pointA, normal) - pc->radiusA - pc->radiusB; - } - break; - - case b2Manifold::e_faceA: - { - normal = b2Mul(xfA.q, pc->localNormal); - b2Vec2 planePoint = b2Mul(xfA, pc->localPoint); - - b2Vec2 clipPoint = b2Mul(xfB, pc->localPoints[index]); - separation = b2Dot(clipPoint - planePoint, normal) - pc->radiusA - pc->radiusB; - point = clipPoint; - } - break; - - case b2Manifold::e_faceB: - { - normal = b2Mul(xfB.q, pc->localNormal); - b2Vec2 planePoint = b2Mul(xfB, pc->localPoint); - - b2Vec2 clipPoint = b2Mul(xfA, pc->localPoints[index]); - separation = b2Dot(clipPoint - planePoint, normal) - pc->radiusA - pc->radiusB; - point = clipPoint; - - // Ensure normal points from A to B - normal = -normal; - } - break; - } - } - - b2Vec2 normal; - b2Vec2 point; - float32 separation; -}; - -// Sequential solver. -bool b2ContactSolver::SolvePositionConstraints() -{ - float32 minSeparation = 0.0f; - - for (int32 i = 0; i < m_count; ++i) - { - b2ContactPositionConstraint* pc = m_positionConstraints + i; - - int32 indexA = pc->indexA; - int32 indexB = pc->indexB; - b2Vec2 localCenterA = pc->localCenterA; - float32 mA = pc->invMassA; - float32 iA = pc->invIA; - b2Vec2 localCenterB = pc->localCenterB; - float32 mB = pc->invMassB; - float32 iB = pc->invIB; - int32 pointCount = pc->pointCount; - - b2Vec2 cA = m_positions[indexA].c; - float32 aA = m_positions[indexA].a; - - b2Vec2 cB = m_positions[indexB].c; - float32 aB = m_positions[indexB].a; - - // Solve normal constraints - for (int32 j = 0; j < pointCount; ++j) - { - b2Transform xfA, xfB; - xfA.q.Set(aA); - xfB.q.Set(aB); - xfA.p = cA - b2Mul(xfA.q, localCenterA); - xfB.p = cB - b2Mul(xfB.q, localCenterB); - - b2PositionSolverManifold psm; - psm.Initialize(pc, xfA, xfB, j); - b2Vec2 normal = psm.normal; - - b2Vec2 point = psm.point; - float32 separation = psm.separation; - - b2Vec2 rA = point - cA; - b2Vec2 rB = point - cB; - - // Track max constraint error. - minSeparation = b2Min(minSeparation, separation); - - // Prevent large corrections and allow slop. - float32 C = b2Clamp(b2_baumgarte * (separation + b2_linearSlop), -b2_maxLinearCorrection, 0.0f); - - // Compute the effective mass. - float32 rnA = b2Cross(rA, normal); - float32 rnB = b2Cross(rB, normal); - float32 K = mA + mB + iA * rnA * rnA + iB * rnB * rnB; - - // Compute normal impulse - float32 impulse = K > 0.0f ? - C / K : 0.0f; - - b2Vec2 P = impulse * normal; - - cA -= mA * P; - aA -= iA * b2Cross(rA, P); - - cB += mB * P; - aB += iB * b2Cross(rB, P); - } - - m_positions[indexA].c = cA; - m_positions[indexA].a = aA; - - m_positions[indexB].c = cB; - m_positions[indexB].a = aB; - } - - // We can't expect minSpeparation >= -b2_linearSlop because we don't - // push the separation above -b2_linearSlop. - return minSeparation >= -3.0f * b2_linearSlop; -} - -// Sequential position solver for position constraints. -bool b2ContactSolver::SolveTOIPositionConstraints(int32 toiIndexA, int32 toiIndexB) -{ - float32 minSeparation = 0.0f; - - for (int32 i = 0; i < m_count; ++i) - { - b2ContactPositionConstraint* pc = m_positionConstraints + i; - - int32 indexA = pc->indexA; - int32 indexB = pc->indexB; - b2Vec2 localCenterA = pc->localCenterA; - b2Vec2 localCenterB = pc->localCenterB; - int32 pointCount = pc->pointCount; - - float32 mA = 0.0f; - float32 iA = 0.0f; - if (indexA == toiIndexA || indexA == toiIndexB) - { - mA = pc->invMassA; - iA = pc->invIA; - } - - float32 mB = pc->invMassB; - float32 iB = pc->invIB; - if (indexB == toiIndexA || indexB == toiIndexB) - { - mB = pc->invMassB; - iB = pc->invIB; - } - - b2Vec2 cA = m_positions[indexA].c; - float32 aA = m_positions[indexA].a; - - b2Vec2 cB = m_positions[indexB].c; - float32 aB = m_positions[indexB].a; - - // Solve normal constraints - for (int32 j = 0; j < pointCount; ++j) - { - b2Transform xfA, xfB; - xfA.q.Set(aA); - xfB.q.Set(aB); - xfA.p = cA - b2Mul(xfA.q, localCenterA); - xfB.p = cB - b2Mul(xfB.q, localCenterB); - - b2PositionSolverManifold psm; - psm.Initialize(pc, xfA, xfB, j); - b2Vec2 normal = psm.normal; - - b2Vec2 point = psm.point; - float32 separation = psm.separation; - - b2Vec2 rA = point - cA; - b2Vec2 rB = point - cB; - - // Track max constraint error. - minSeparation = b2Min(minSeparation, separation); - - // Prevent large corrections and allow slop. - float32 C = b2Clamp(b2_toiBaugarte * (separation + b2_linearSlop), -b2_maxLinearCorrection, 0.0f); - - // Compute the effective mass. - float32 rnA = b2Cross(rA, normal); - float32 rnB = b2Cross(rB, normal); - float32 K = mA + mB + iA * rnA * rnA + iB * rnB * rnB; - - // Compute normal impulse - float32 impulse = K > 0.0f ? - C / K : 0.0f; - - b2Vec2 P = impulse * normal; - - cA -= mA * P; - aA -= iA * b2Cross(rA, P); - - cB += mB * P; - aB += iB * b2Cross(rB, P); - } - - m_positions[indexA].c = cA; - m_positions[indexA].a = aA; - - m_positions[indexB].c = cB; - m_positions[indexB].a = aB; - } - - // We can't expect minSpeparation >= -b2_linearSlop because we don't - // push the separation above -b2_linearSlop. - return minSeparation >= -1.5f * b2_linearSlop; -} diff --git a/external/box2d/Dynamics/Contacts/b2ContactSolver.h b/external/box2d/Dynamics/Contacts/b2ContactSolver.h deleted file mode 100644 index aef1987a9e..0000000000 --- a/external/box2d/Dynamics/Contacts/b2ContactSolver.h +++ /dev/null @@ -1,94 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_CONTACT_SOLVER_H -#define B2_CONTACT_SOLVER_H - -#include -#include -#include - -class b2Contact; -class b2Body; -class b2StackAllocator; -struct b2ContactPositionConstraint; - -struct b2VelocityConstraintPoint -{ - b2Vec2 rA; - b2Vec2 rB; - float32 normalImpulse; - float32 tangentImpulse; - float32 normalMass; - float32 tangentMass; - float32 velocityBias; -}; - -struct b2ContactVelocityConstraint -{ - b2VelocityConstraintPoint points[b2_maxManifoldPoints]; - b2Vec2 normal; - b2Mat22 normalMass; - b2Mat22 K; - int32 indexA; - int32 indexB; - float32 invMassA, invMassB; - float32 invIA, invIB; - float32 friction; - float32 restitution; - int32 pointCount; - int32 contactIndex; -}; - -struct b2ContactSolverDef -{ - b2TimeStep step; - b2Contact** contacts; - int32 count; - b2Position* positions; - b2Velocity* velocities; - b2StackAllocator* allocator; -}; - -class b2ContactSolver -{ -public: - b2ContactSolver(b2ContactSolverDef* def); - ~b2ContactSolver(); - - void InitializeVelocityConstraints(); - - void WarmStart(); - void SolveVelocityConstraints(); - void StoreImpulses(); - - bool SolvePositionConstraints(); - bool SolveTOIPositionConstraints(int32 toiIndexA, int32 toiIndexB); - - b2TimeStep m_step; - b2Position* m_positions; - b2Velocity* m_velocities; - b2StackAllocator* m_allocator; - b2ContactPositionConstraint* m_positionConstraints; - b2ContactVelocityConstraint* m_velocityConstraints; - b2Contact** m_contacts; - int m_count; -}; - -#endif - diff --git a/external/box2d/Dynamics/Contacts/b2EdgeAndCircleContact.cpp b/external/box2d/Dynamics/Contacts/b2EdgeAndCircleContact.cpp deleted file mode 100644 index aade42880a..0000000000 --- a/external/box2d/Dynamics/Contacts/b2EdgeAndCircleContact.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/* -* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include - -#include -using namespace std; - -b2Contact* b2EdgeAndCircleContact::Create(b2Fixture* fixtureA, int32, b2Fixture* fixtureB, int32, b2BlockAllocator* allocator) -{ - void* mem = allocator->Allocate(sizeof(b2EdgeAndCircleContact)); - return new (mem) b2EdgeAndCircleContact(fixtureA, fixtureB); -} - -void b2EdgeAndCircleContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) -{ - ((b2EdgeAndCircleContact*)contact)->~b2EdgeAndCircleContact(); - allocator->Free(contact, sizeof(b2EdgeAndCircleContact)); -} - -b2EdgeAndCircleContact::b2EdgeAndCircleContact(b2Fixture* fixtureA, b2Fixture* fixtureB) -: b2Contact(fixtureA, 0, fixtureB, 0) -{ - b2Assert(m_fixtureA->GetType() == b2Shape::e_edge); - b2Assert(m_fixtureB->GetType() == b2Shape::e_circle); -} - -void b2EdgeAndCircleContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) -{ - b2CollideEdgeAndCircle( manifold, - (b2EdgeShape*)m_fixtureA->GetShape(), xfA, - (b2CircleShape*)m_fixtureB->GetShape(), xfB); -} diff --git a/external/box2d/Dynamics/Contacts/b2EdgeAndCircleContact.h b/external/box2d/Dynamics/Contacts/b2EdgeAndCircleContact.h deleted file mode 100644 index 70771ec536..0000000000 --- a/external/box2d/Dynamics/Contacts/b2EdgeAndCircleContact.h +++ /dev/null @@ -1,39 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_EDGE_AND_CIRCLE_CONTACT_H -#define B2_EDGE_AND_CIRCLE_CONTACT_H - -#include - -class b2BlockAllocator; - -class b2EdgeAndCircleContact : public b2Contact -{ -public: - static b2Contact* Create( b2Fixture* fixtureA, int32 indexA, - b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); - static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); - - b2EdgeAndCircleContact(b2Fixture* fixtureA, b2Fixture* fixtureB); - ~b2EdgeAndCircleContact() {} - - void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB); -}; - -#endif diff --git a/external/box2d/Dynamics/Contacts/b2EdgeAndPolygonContact.cpp b/external/box2d/Dynamics/Contacts/b2EdgeAndPolygonContact.cpp deleted file mode 100644 index 04ce394107..0000000000 --- a/external/box2d/Dynamics/Contacts/b2EdgeAndPolygonContact.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/* -* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include - -#include -using namespace std; - -b2Contact* b2EdgeAndPolygonContact::Create(b2Fixture* fixtureA, int32, b2Fixture* fixtureB, int32, b2BlockAllocator* allocator) -{ - void* mem = allocator->Allocate(sizeof(b2EdgeAndPolygonContact)); - return new (mem) b2EdgeAndPolygonContact(fixtureA, fixtureB); -} - -void b2EdgeAndPolygonContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) -{ - ((b2EdgeAndPolygonContact*)contact)->~b2EdgeAndPolygonContact(); - allocator->Free(contact, sizeof(b2EdgeAndPolygonContact)); -} - -b2EdgeAndPolygonContact::b2EdgeAndPolygonContact(b2Fixture* fixtureA, b2Fixture* fixtureB) -: b2Contact(fixtureA, 0, fixtureB, 0) -{ - b2Assert(m_fixtureA->GetType() == b2Shape::e_edge); - b2Assert(m_fixtureB->GetType() == b2Shape::e_polygon); -} - -void b2EdgeAndPolygonContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) -{ - b2CollideEdgeAndPolygon( manifold, - (b2EdgeShape*)m_fixtureA->GetShape(), xfA, - (b2PolygonShape*)m_fixtureB->GetShape(), xfB); -} diff --git a/external/box2d/Dynamics/Contacts/b2EdgeAndPolygonContact.h b/external/box2d/Dynamics/Contacts/b2EdgeAndPolygonContact.h deleted file mode 100644 index f65f3acca9..0000000000 --- a/external/box2d/Dynamics/Contacts/b2EdgeAndPolygonContact.h +++ /dev/null @@ -1,39 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_EDGE_AND_POLYGON_CONTACT_H -#define B2_EDGE_AND_POLYGON_CONTACT_H - -#include - -class b2BlockAllocator; - -class b2EdgeAndPolygonContact : public b2Contact -{ -public: - static b2Contact* Create( b2Fixture* fixtureA, int32 indexA, - b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); - static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); - - b2EdgeAndPolygonContact(b2Fixture* fixtureA, b2Fixture* fixtureB); - ~b2EdgeAndPolygonContact() {} - - void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB); -}; - -#endif diff --git a/external/box2d/Dynamics/Contacts/b2PolygonAndCircleContact.cpp b/external/box2d/Dynamics/Contacts/b2PolygonAndCircleContact.cpp deleted file mode 100644 index 961b26f38a..0000000000 --- a/external/box2d/Dynamics/Contacts/b2PolygonAndCircleContact.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include - -#include -using namespace std; - -b2Contact* b2PolygonAndCircleContact::Create(b2Fixture* fixtureA, int32, b2Fixture* fixtureB, int32, b2BlockAllocator* allocator) -{ - void* mem = allocator->Allocate(sizeof(b2PolygonAndCircleContact)); - return new (mem) b2PolygonAndCircleContact(fixtureA, fixtureB); -} - -void b2PolygonAndCircleContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) -{ - ((b2PolygonAndCircleContact*)contact)->~b2PolygonAndCircleContact(); - allocator->Free(contact, sizeof(b2PolygonAndCircleContact)); -} - -b2PolygonAndCircleContact::b2PolygonAndCircleContact(b2Fixture* fixtureA, b2Fixture* fixtureB) -: b2Contact(fixtureA, 0, fixtureB, 0) -{ - b2Assert(m_fixtureA->GetType() == b2Shape::e_polygon); - b2Assert(m_fixtureB->GetType() == b2Shape::e_circle); -} - -void b2PolygonAndCircleContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) -{ - b2CollidePolygonAndCircle( manifold, - (b2PolygonShape*)m_fixtureA->GetShape(), xfA, - (b2CircleShape*)m_fixtureB->GetShape(), xfB); -} diff --git a/external/box2d/Dynamics/Contacts/b2PolygonAndCircleContact.h b/external/box2d/Dynamics/Contacts/b2PolygonAndCircleContact.h deleted file mode 100644 index 7b1a5288b4..0000000000 --- a/external/box2d/Dynamics/Contacts/b2PolygonAndCircleContact.h +++ /dev/null @@ -1,38 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_POLYGON_AND_CIRCLE_CONTACT_H -#define B2_POLYGON_AND_CIRCLE_CONTACT_H - -#include - -class b2BlockAllocator; - -class b2PolygonAndCircleContact : public b2Contact -{ -public: - static b2Contact* Create(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); - static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); - - b2PolygonAndCircleContact(b2Fixture* fixtureA, b2Fixture* fixtureB); - ~b2PolygonAndCircleContact() {} - - void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB); -}; - -#endif diff --git a/external/box2d/Dynamics/Contacts/b2PolygonContact.cpp b/external/box2d/Dynamics/Contacts/b2PolygonContact.cpp deleted file mode 100644 index a2884a440d..0000000000 --- a/external/box2d/Dynamics/Contacts/b2PolygonContact.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include -#include -#include -#include - -#include -using namespace std; - -b2Contact* b2PolygonContact::Create(b2Fixture* fixtureA, int32, b2Fixture* fixtureB, int32, b2BlockAllocator* allocator) -{ - void* mem = allocator->Allocate(sizeof(b2PolygonContact)); - return new (mem) b2PolygonContact(fixtureA, fixtureB); -} - -void b2PolygonContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) -{ - ((b2PolygonContact*)contact)->~b2PolygonContact(); - allocator->Free(contact, sizeof(b2PolygonContact)); -} - -b2PolygonContact::b2PolygonContact(b2Fixture* fixtureA, b2Fixture* fixtureB) - : b2Contact(fixtureA, 0, fixtureB, 0) -{ - b2Assert(m_fixtureA->GetType() == b2Shape::e_polygon); - b2Assert(m_fixtureB->GetType() == b2Shape::e_polygon); -} - -void b2PolygonContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) -{ - b2CollidePolygons( manifold, - (b2PolygonShape*)m_fixtureA->GetShape(), xfA, - (b2PolygonShape*)m_fixtureB->GetShape(), xfB); -} diff --git a/external/box2d/Dynamics/Contacts/b2PolygonContact.h b/external/box2d/Dynamics/Contacts/b2PolygonContact.h deleted file mode 100644 index 302684232a..0000000000 --- a/external/box2d/Dynamics/Contacts/b2PolygonContact.h +++ /dev/null @@ -1,39 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_POLYGON_CONTACT_H -#define B2_POLYGON_CONTACT_H - -#include - -class b2BlockAllocator; - -class b2PolygonContact : public b2Contact -{ -public: - static b2Contact* Create( b2Fixture* fixtureA, int32 indexA, - b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); - static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); - - b2PolygonContact(b2Fixture* fixtureA, b2Fixture* fixtureB); - ~b2PolygonContact() {} - - void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB); -}; - -#endif diff --git a/external/box2d/Dynamics/Joints/b2DistanceJoint.cpp b/external/box2d/Dynamics/Joints/b2DistanceJoint.cpp deleted file mode 100644 index b2d4bd006c..0000000000 --- a/external/box2d/Dynamics/Joints/b2DistanceJoint.cpp +++ /dev/null @@ -1,260 +0,0 @@ -/* -* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include - -// 1-D constrained system -// m (v2 - v1) = lambda -// v2 + (beta/h) * x1 + gamma * lambda = 0, gamma has units of inverse mass. -// x2 = x1 + h * v2 - -// 1-D mass-damper-spring system -// m (v2 - v1) + h * d * v2 + h * k * - -// C = norm(p2 - p1) - L -// u = (p2 - p1) / norm(p2 - p1) -// Cdot = dot(u, v2 + cross(w2, r2) - v1 - cross(w1, r1)) -// J = [-u -cross(r1, u) u cross(r2, u)] -// K = J * invM * JT -// = invMass1 + invI1 * cross(r1, u)^2 + invMass2 + invI2 * cross(r2, u)^2 - -void b2DistanceJointDef::Initialize(b2Body* b1, b2Body* b2, - const b2Vec2& anchor1, const b2Vec2& anchor2) -{ - bodyA = b1; - bodyB = b2; - localAnchorA = bodyA->GetLocalPoint(anchor1); - localAnchorB = bodyB->GetLocalPoint(anchor2); - b2Vec2 d = anchor2 - anchor1; - length = d.Length(); -} - -b2DistanceJoint::b2DistanceJoint(const b2DistanceJointDef* def) -: b2Joint(def) -{ - m_localAnchorA = def->localAnchorA; - m_localAnchorB = def->localAnchorB; - m_length = def->length; - m_frequencyHz = def->frequencyHz; - m_dampingRatio = def->dampingRatio; - m_impulse = 0.0f; - m_gamma = 0.0f; - m_bias = 0.0f; -} - -void b2DistanceJoint::InitVelocityConstraints(const b2SolverData& data) -{ - m_indexA = m_bodyA->m_islandIndex; - m_indexB = m_bodyB->m_islandIndex; - m_localCenterA = m_bodyA->m_sweep.localCenter; - m_localCenterB = m_bodyB->m_sweep.localCenter; - m_invMassA = m_bodyA->m_invMass; - m_invMassB = m_bodyB->m_invMass; - m_invIA = m_bodyA->m_invI; - m_invIB = m_bodyB->m_invI; - - b2Vec2 cA = data.positions[m_indexA].c; - float32 aA = data.positions[m_indexA].a; - b2Vec2 vA = data.velocities[m_indexA].v; - float32 wA = data.velocities[m_indexA].w; - - b2Vec2 cB = data.positions[m_indexB].c; - float32 aB = data.positions[m_indexB].a; - b2Vec2 vB = data.velocities[m_indexB].v; - float32 wB = data.velocities[m_indexB].w; - - b2Rot qA(aA), qB(aB); - - m_rA = b2Mul(qA, m_localAnchorA - m_localCenterA); - m_rB = b2Mul(qB, m_localAnchorB - m_localCenterB); - m_u = cB + m_rB - cA - m_rA; - - // Handle singularity. - float32 length = m_u.Length(); - if (length > b2_linearSlop) - { - m_u *= 1.0f / length; - } - else - { - m_u.Set(0.0f, 0.0f); - } - - float32 crAu = b2Cross(m_rA, m_u); - float32 crBu = b2Cross(m_rB, m_u); - float32 invMass = m_invMassA + m_invIA * crAu * crAu + m_invMassB + m_invIB * crBu * crBu; - - // Compute the effective mass matrix. - m_mass = invMass != 0.0f ? 1.0f / invMass : 0.0f; - - if (m_frequencyHz > 0.0f) - { - float32 C = length - m_length; - - // Frequency - float32 omega = 2.0f * b2_pi * m_frequencyHz; - - // Damping coefficient - float32 d = 2.0f * m_mass * m_dampingRatio * omega; - - // Spring stiffness - float32 k = m_mass * omega * omega; - - // magic formulas - float32 h = data.step.dt; - m_gamma = h * (d + h * k); - m_gamma = m_gamma != 0.0f ? 1.0f / m_gamma : 0.0f; - m_bias = C * h * k * m_gamma; - - invMass += m_gamma; - m_mass = invMass != 0.0f ? 1.0f / invMass : 0.0f; - } - else - { - m_gamma = 0.0f; - m_bias = 0.0f; - } - - if (data.step.warmStarting) - { - // Scale the impulse to support a variable time step. - m_impulse *= data.step.dtRatio; - - b2Vec2 P = m_impulse * m_u; - vA -= m_invMassA * P; - wA -= m_invIA * b2Cross(m_rA, P); - vB += m_invMassB * P; - wB += m_invIB * b2Cross(m_rB, P); - } - else - { - m_impulse = 0.0f; - } - - data.velocities[m_indexA].v = vA; - data.velocities[m_indexA].w = wA; - data.velocities[m_indexB].v = vB; - data.velocities[m_indexB].w = wB; -} - -void b2DistanceJoint::SolveVelocityConstraints(const b2SolverData& data) -{ - b2Vec2 vA = data.velocities[m_indexA].v; - float32 wA = data.velocities[m_indexA].w; - b2Vec2 vB = data.velocities[m_indexB].v; - float32 wB = data.velocities[m_indexB].w; - - // Cdot = dot(u, v + cross(w, r)) - b2Vec2 vpA = vA + b2Cross(wA, m_rA); - b2Vec2 vpB = vB + b2Cross(wB, m_rB); - float32 Cdot = b2Dot(m_u, vpB - vpA); - - float32 impulse = -m_mass * (Cdot + m_bias + m_gamma * m_impulse); - m_impulse += impulse; - - b2Vec2 P = impulse * m_u; - vA -= m_invMassA * P; - wA -= m_invIA * b2Cross(m_rA, P); - vB += m_invMassB * P; - wB += m_invIB * b2Cross(m_rB, P); - - data.velocities[m_indexA].v = vA; - data.velocities[m_indexA].w = wA; - data.velocities[m_indexB].v = vB; - data.velocities[m_indexB].w = wB; -} - -bool b2DistanceJoint::SolvePositionConstraints(const b2SolverData& data) -{ - if (m_frequencyHz > 0.0f) - { - // There is no position correction for soft distance constraints. - return true; - } - - b2Vec2 cA = data.positions[m_indexA].c; - float32 aA = data.positions[m_indexA].a; - b2Vec2 cB = data.positions[m_indexB].c; - float32 aB = data.positions[m_indexB].a; - - b2Rot qA(aA), qB(aB); - - b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA); - b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB); - b2Vec2 u = cB + rB - cA - rA; - - float32 length = u.Normalize(); - float32 C = length - m_length; - C = b2Clamp(C, -b2_maxLinearCorrection, b2_maxLinearCorrection); - - float32 impulse = -m_mass * C; - b2Vec2 P = impulse * u; - - cA -= m_invMassA * P; - aA -= m_invIA * b2Cross(rA, P); - cB += m_invMassB * P; - aB += m_invIB * b2Cross(rB, P); - - data.positions[m_indexA].c = cA; - data.positions[m_indexA].a = aA; - data.positions[m_indexB].c = cB; - data.positions[m_indexB].a = aB; - - return b2Abs(C) < b2_linearSlop; -} - -b2Vec2 b2DistanceJoint::GetAnchorA() const -{ - return m_bodyA->GetWorldPoint(m_localAnchorA); -} - -b2Vec2 b2DistanceJoint::GetAnchorB() const -{ - return m_bodyB->GetWorldPoint(m_localAnchorB); -} - -b2Vec2 b2DistanceJoint::GetReactionForce(float32 inv_dt) const -{ - b2Vec2 F = (inv_dt * m_impulse) * m_u; - return F; -} - -float32 b2DistanceJoint::GetReactionTorque(float32 inv_dt) const -{ - B2_NOT_USED(inv_dt); - return 0.0f; -} - -void b2DistanceJoint::Dump() -{ - int32 indexA = m_bodyA->m_islandIndex; - int32 indexB = m_bodyB->m_islandIndex; - - b2Log(" b2DistanceJointDef jd;\n"); - b2Log(" jd.bodyA = bodies[%d];\n", indexA); - b2Log(" jd.bodyB = bodies[%d];\n", indexB); - b2Log(" jd.collideConnected = bool(%d);\n", m_collideConnected); - b2Log(" jd.localAnchorA.Set(%.15lef, %.15lef);\n", m_localAnchorA.x, m_localAnchorA.y); - b2Log(" jd.localAnchorB.Set(%.15lef, %.15lef);\n", m_localAnchorB.x, m_localAnchorB.y); - b2Log(" jd.length = %.15lef;\n", m_length); - b2Log(" jd.frequencyHz = %.15lef;\n", m_frequencyHz); - b2Log(" jd.dampingRatio = %.15lef;\n", m_dampingRatio); - b2Log(" joints[%d] = m_world->CreateJoint(&jd);\n", m_index); -} diff --git a/external/box2d/Dynamics/Joints/b2DistanceJoint.h b/external/box2d/Dynamics/Joints/b2DistanceJoint.h deleted file mode 100644 index fc11476ff9..0000000000 --- a/external/box2d/Dynamics/Joints/b2DistanceJoint.h +++ /dev/null @@ -1,169 +0,0 @@ -/* -* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_DISTANCE_JOINT_H -#define B2_DISTANCE_JOINT_H - -#include - -/// Distance joint definition. This requires defining an -/// anchor point on both bodies and the non-zero length of the -/// distance joint. The definition uses local anchor points -/// so that the initial configuration can violate the constraint -/// slightly. This helps when saving and loading a game. -/// @warning Do not use a zero or short length. -struct b2DistanceJointDef : public b2JointDef -{ - b2DistanceJointDef() - { - type = e_distanceJoint; - localAnchorA.Set(0.0f, 0.0f); - localAnchorB.Set(0.0f, 0.0f); - length = 1.0f; - frequencyHz = 0.0f; - dampingRatio = 0.0f; - } - - /// Initialize the bodies, anchors, and length using the world - /// anchors. - void Initialize(b2Body* bodyA, b2Body* bodyB, - const b2Vec2& anchorA, const b2Vec2& anchorB); - - /// The local anchor point relative to bodyA's origin. - b2Vec2 localAnchorA; - - /// The local anchor point relative to bodyB's origin. - b2Vec2 localAnchorB; - - /// The natural length between the anchor points. - float32 length; - - /// The mass-spring-damper frequency in Hertz. A value of 0 - /// disables softness. - float32 frequencyHz; - - /// The damping ratio. 0 = no damping, 1 = critical damping. - float32 dampingRatio; -}; - -/// A distance joint constrains two points on two bodies -/// to remain at a fixed distance from each other. You can view -/// this as a massless, rigid rod. -class b2DistanceJoint : public b2Joint -{ -public: - - b2Vec2 GetAnchorA() const; - b2Vec2 GetAnchorB() const; - - /// Get the reaction force given the inverse time step. - /// Unit is N. - b2Vec2 GetReactionForce(float32 inv_dt) const; - - /// Get the reaction torque given the inverse time step. - /// Unit is N*m. This is always zero for a distance joint. - float32 GetReactionTorque(float32 inv_dt) const; - - /// The local anchor point relative to bodyA's origin. - const b2Vec2& GetLocalAnchorA() const { return m_localAnchorA; } - - /// The local anchor point relative to bodyB's origin. - const b2Vec2& GetLocalAnchorB() const { return m_localAnchorB; } - - /// Set/get the natural length. - /// Manipulating the length can lead to non-physical behavior when the frequency is zero. - void SetLength(float32 length); - float32 GetLength() const; - - /// Set/get frequency in Hz. - void SetFrequency(float32 hz); - float32 GetFrequency() const; - - /// Set/get damping ratio. - void SetDampingRatio(float32 ratio); - float32 GetDampingRatio() const; - - /// Dump joint to dmLog - void Dump(); - -protected: - - friend class b2Joint; - b2DistanceJoint(const b2DistanceJointDef* data); - - void InitVelocityConstraints(const b2SolverData& data); - void SolveVelocityConstraints(const b2SolverData& data); - bool SolvePositionConstraints(const b2SolverData& data); - - float32 m_frequencyHz; - float32 m_dampingRatio; - float32 m_bias; - - // Solver shared - b2Vec2 m_localAnchorA; - b2Vec2 m_localAnchorB; - float32 m_gamma; - float32 m_impulse; - float32 m_length; - - // Solver temp - int32 m_indexA; - int32 m_indexB; - b2Vec2 m_u; - b2Vec2 m_rA; - b2Vec2 m_rB; - b2Vec2 m_localCenterA; - b2Vec2 m_localCenterB; - float32 m_invMassA; - float32 m_invMassB; - float32 m_invIA; - float32 m_invIB; - float32 m_mass; -}; - -inline void b2DistanceJoint::SetLength(float32 length) -{ - m_length = length; -} - -inline float32 b2DistanceJoint::GetLength() const -{ - return m_length; -} - -inline void b2DistanceJoint::SetFrequency(float32 hz) -{ - m_frequencyHz = hz; -} - -inline float32 b2DistanceJoint::GetFrequency() const -{ - return m_frequencyHz; -} - -inline void b2DistanceJoint::SetDampingRatio(float32 ratio) -{ - m_dampingRatio = ratio; -} - -inline float32 b2DistanceJoint::GetDampingRatio() const -{ - return m_dampingRatio; -} - -#endif diff --git a/external/box2d/Dynamics/Joints/b2FrictionJoint.cpp b/external/box2d/Dynamics/Joints/b2FrictionJoint.cpp deleted file mode 100644 index 6e6018db10..0000000000 --- a/external/box2d/Dynamics/Joints/b2FrictionJoint.cpp +++ /dev/null @@ -1,251 +0,0 @@ -/* -* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include - -// Point-to-point constraint -// Cdot = v2 - v1 -// = v2 + cross(w2, r2) - v1 - cross(w1, r1) -// J = [-I -r1_skew I r2_skew ] -// Identity used: -// w k % (rx i + ry j) = w * (-ry i + rx j) - -// Angle constraint -// Cdot = w2 - w1 -// J = [0 0 -1 0 0 1] -// K = invI1 + invI2 - -void b2FrictionJointDef::Initialize(b2Body* bA, b2Body* bB, const b2Vec2& anchor) -{ - bodyA = bA; - bodyB = bB; - localAnchorA = bodyA->GetLocalPoint(anchor); - localAnchorB = bodyB->GetLocalPoint(anchor); -} - -b2FrictionJoint::b2FrictionJoint(const b2FrictionJointDef* def) -: b2Joint(def) -{ - m_localAnchorA = def->localAnchorA; - m_localAnchorB = def->localAnchorB; - - m_linearImpulse.SetZero(); - m_angularImpulse = 0.0f; - - m_maxForce = def->maxForce; - m_maxTorque = def->maxTorque; -} - -void b2FrictionJoint::InitVelocityConstraints(const b2SolverData& data) -{ - m_indexA = m_bodyA->m_islandIndex; - m_indexB = m_bodyB->m_islandIndex; - m_localCenterA = m_bodyA->m_sweep.localCenter; - m_localCenterB = m_bodyB->m_sweep.localCenter; - m_invMassA = m_bodyA->m_invMass; - m_invMassB = m_bodyB->m_invMass; - m_invIA = m_bodyA->m_invI; - m_invIB = m_bodyB->m_invI; - - float32 aA = data.positions[m_indexA].a; - b2Vec2 vA = data.velocities[m_indexA].v; - float32 wA = data.velocities[m_indexA].w; - - float32 aB = data.positions[m_indexB].a; - b2Vec2 vB = data.velocities[m_indexB].v; - float32 wB = data.velocities[m_indexB].w; - - b2Rot qA(aA), qB(aB); - - // Compute the effective mass matrix. - m_rA = b2Mul(qA, m_localAnchorA - m_localCenterA); - m_rB = b2Mul(qB, m_localAnchorB - m_localCenterB); - - // J = [-I -r1_skew I r2_skew] - // [ 0 -1 0 1] - // r_skew = [-ry; rx] - - // Matlab - // K = [ mA+r1y^2*iA+mB+r2y^2*iB, -r1y*iA*r1x-r2y*iB*r2x, -r1y*iA-r2y*iB] - // [ -r1y*iA*r1x-r2y*iB*r2x, mA+r1x^2*iA+mB+r2x^2*iB, r1x*iA+r2x*iB] - // [ -r1y*iA-r2y*iB, r1x*iA+r2x*iB, iA+iB] - - float32 mA = m_invMassA, mB = m_invMassB; - float32 iA = m_invIA, iB = m_invIB; - - b2Mat22 K; - K.ex.x = mA + mB + iA * m_rA.y * m_rA.y + iB * m_rB.y * m_rB.y; - K.ex.y = -iA * m_rA.x * m_rA.y - iB * m_rB.x * m_rB.y; - K.ey.x = K.ex.y; - K.ey.y = mA + mB + iA * m_rA.x * m_rA.x + iB * m_rB.x * m_rB.x; - - m_linearMass = K.GetInverse(); - - m_angularMass = iA + iB; - if (m_angularMass > 0.0f) - { - m_angularMass = 1.0f / m_angularMass; - } - - if (data.step.warmStarting) - { - // Scale impulses to support a variable time step. - m_linearImpulse *= data.step.dtRatio; - m_angularImpulse *= data.step.dtRatio; - - b2Vec2 P(m_linearImpulse.x, m_linearImpulse.y); - vA -= mA * P; - wA -= iA * (b2Cross(m_rA, P) + m_angularImpulse); - vB += mB * P; - wB += iB * (b2Cross(m_rB, P) + m_angularImpulse); - } - else - { - m_linearImpulse.SetZero(); - m_angularImpulse = 0.0f; - } - - data.velocities[m_indexA].v = vA; - data.velocities[m_indexA].w = wA; - data.velocities[m_indexB].v = vB; - data.velocities[m_indexB].w = wB; -} - -void b2FrictionJoint::SolveVelocityConstraints(const b2SolverData& data) -{ - b2Vec2 vA = data.velocities[m_indexA].v; - float32 wA = data.velocities[m_indexA].w; - b2Vec2 vB = data.velocities[m_indexB].v; - float32 wB = data.velocities[m_indexB].w; - - float32 mA = m_invMassA, mB = m_invMassB; - float32 iA = m_invIA, iB = m_invIB; - - float32 h = data.step.dt; - - // Solve angular friction - { - float32 Cdot = wB - wA; - float32 impulse = -m_angularMass * Cdot; - - float32 oldImpulse = m_angularImpulse; - float32 maxImpulse = h * m_maxTorque; - m_angularImpulse = b2Clamp(m_angularImpulse + impulse, -maxImpulse, maxImpulse); - impulse = m_angularImpulse - oldImpulse; - - wA -= iA * impulse; - wB += iB * impulse; - } - - // Solve linear friction - { - b2Vec2 Cdot = vB + b2Cross(wB, m_rB) - vA - b2Cross(wA, m_rA); - - b2Vec2 impulse = -b2Mul(m_linearMass, Cdot); - b2Vec2 oldImpulse = m_linearImpulse; - m_linearImpulse += impulse; - - float32 maxImpulse = h * m_maxForce; - - if (m_linearImpulse.LengthSquared() > maxImpulse * maxImpulse) - { - m_linearImpulse.Normalize(); - m_linearImpulse *= maxImpulse; - } - - impulse = m_linearImpulse - oldImpulse; - - vA -= mA * impulse; - wA -= iA * b2Cross(m_rA, impulse); - - vB += mB * impulse; - wB += iB * b2Cross(m_rB, impulse); - } - - data.velocities[m_indexA].v = vA; - data.velocities[m_indexA].w = wA; - data.velocities[m_indexB].v = vB; - data.velocities[m_indexB].w = wB; -} - -bool b2FrictionJoint::SolvePositionConstraints(const b2SolverData& data) -{ - B2_NOT_USED(data); - - return true; -} - -b2Vec2 b2FrictionJoint::GetAnchorA() const -{ - return m_bodyA->GetWorldPoint(m_localAnchorA); -} - -b2Vec2 b2FrictionJoint::GetAnchorB() const -{ - return m_bodyB->GetWorldPoint(m_localAnchorB); -} - -b2Vec2 b2FrictionJoint::GetReactionForce(float32 inv_dt) const -{ - return inv_dt * m_linearImpulse; -} - -float32 b2FrictionJoint::GetReactionTorque(float32 inv_dt) const -{ - return inv_dt * m_angularImpulse; -} - -void b2FrictionJoint::SetMaxForce(float32 force) -{ - b2Assert(b2IsValid(force) && force >= 0.0f); - m_maxForce = force; -} - -float32 b2FrictionJoint::GetMaxForce() const -{ - return m_maxForce; -} - -void b2FrictionJoint::SetMaxTorque(float32 torque) -{ - b2Assert(b2IsValid(torque) && torque >= 0.0f); - m_maxTorque = torque; -} - -float32 b2FrictionJoint::GetMaxTorque() const -{ - return m_maxTorque; -} - -void b2FrictionJoint::Dump() -{ - int32 indexA = m_bodyA->m_islandIndex; - int32 indexB = m_bodyB->m_islandIndex; - - b2Log(" b2FrictionJointDef jd;\n"); - b2Log(" jd.bodyA = bodies[%d];\n", indexA); - b2Log(" jd.bodyB = bodies[%d];\n", indexB); - b2Log(" jd.collideConnected = bool(%d);\n", m_collideConnected); - b2Log(" jd.localAnchorA.Set(%.15lef, %.15lef);\n", m_localAnchorA.x, m_localAnchorA.y); - b2Log(" jd.localAnchorB.Set(%.15lef, %.15lef);\n", m_localAnchorB.x, m_localAnchorB.y); - b2Log(" jd.maxForce = %.15lef;\n", m_maxForce); - b2Log(" jd.maxTorque = %.15lef;\n", m_maxTorque); - b2Log(" joints[%d] = m_world->CreateJoint(&jd);\n", m_index); -} diff --git a/external/box2d/Dynamics/Joints/b2FrictionJoint.h b/external/box2d/Dynamics/Joints/b2FrictionJoint.h deleted file mode 100644 index 3ee40c6298..0000000000 --- a/external/box2d/Dynamics/Joints/b2FrictionJoint.h +++ /dev/null @@ -1,119 +0,0 @@ -/* -* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_FRICTION_JOINT_H -#define B2_FRICTION_JOINT_H - -#include - -/// Friction joint definition. -struct b2FrictionJointDef : public b2JointDef -{ - b2FrictionJointDef() - { - type = e_frictionJoint; - localAnchorA.SetZero(); - localAnchorB.SetZero(); - maxForce = 0.0f; - maxTorque = 0.0f; - } - - /// Initialize the bodies, anchors, axis, and reference angle using the world - /// anchor and world axis. - void Initialize(b2Body* bodyA, b2Body* bodyB, const b2Vec2& anchor); - - /// The local anchor point relative to bodyA's origin. - b2Vec2 localAnchorA; - - /// The local anchor point relative to bodyB's origin. - b2Vec2 localAnchorB; - - /// The maximum friction force in N. - float32 maxForce; - - /// The maximum friction torque in N-m. - float32 maxTorque; -}; - -/// Friction joint. This is used for top-down friction. -/// It provides 2D translational friction and angular friction. -class b2FrictionJoint : public b2Joint -{ -public: - b2Vec2 GetAnchorA() const; - b2Vec2 GetAnchorB() const; - - b2Vec2 GetReactionForce(float32 inv_dt) const; - float32 GetReactionTorque(float32 inv_dt) const; - - /// The local anchor point relative to bodyA's origin. - const b2Vec2& GetLocalAnchorA() const { return m_localAnchorA; } - - /// The local anchor point relative to bodyB's origin. - const b2Vec2& GetLocalAnchorB() const { return m_localAnchorB; } - - /// Set the maximum friction force in N. - void SetMaxForce(float32 force); - - /// Get the maximum friction force in N. - float32 GetMaxForce() const; - - /// Set the maximum friction torque in N*m. - void SetMaxTorque(float32 torque); - - /// Get the maximum friction torque in N*m. - float32 GetMaxTorque() const; - - /// Dump joint to dmLog - void Dump(); - -protected: - - friend class b2Joint; - - b2FrictionJoint(const b2FrictionJointDef* def); - - void InitVelocityConstraints(const b2SolverData& data); - void SolveVelocityConstraints(const b2SolverData& data); - bool SolvePositionConstraints(const b2SolverData& data); - - b2Vec2 m_localAnchorA; - b2Vec2 m_localAnchorB; - - // Solver shared - b2Vec2 m_linearImpulse; - float32 m_angularImpulse; - float32 m_maxForce; - float32 m_maxTorque; - - // Solver temp - int32 m_indexA; - int32 m_indexB; - b2Vec2 m_rA; - b2Vec2 m_rB; - b2Vec2 m_localCenterA; - b2Vec2 m_localCenterB; - float32 m_invMassA; - float32 m_invMassB; - float32 m_invIA; - float32 m_invIB; - b2Mat22 m_linearMass; - float32 m_angularMass; -}; - -#endif diff --git a/external/box2d/Dynamics/Joints/b2GearJoint.cpp b/external/box2d/Dynamics/Joints/b2GearJoint.cpp deleted file mode 100644 index 9741cdd5a4..0000000000 --- a/external/box2d/Dynamics/Joints/b2GearJoint.cpp +++ /dev/null @@ -1,423 +0,0 @@ -/* -* Copyright (c) 2007-2011 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include -#include -#include - -// Gear Joint: -// C0 = (coordinate1 + ratio * coordinate2)_initial -// C = (coordinate1 + ratio * coordinate2) - C0 = 0 -// J = [J1 ratio * J2] -// K = J * invM * JT -// = J1 * invM1 * J1T + ratio * ratio * J2 * invM2 * J2T -// -// Revolute: -// coordinate = rotation -// Cdot = angularVelocity -// J = [0 0 1] -// K = J * invM * JT = invI -// -// Prismatic: -// coordinate = dot(p - pg, ug) -// Cdot = dot(v + cross(w, r), ug) -// J = [ug cross(r, ug)] -// K = J * invM * JT = invMass + invI * cross(r, ug)^2 - -b2GearJoint::b2GearJoint(const b2GearJointDef* def) -: b2Joint(def) -{ - m_joint1 = def->joint1; - m_joint2 = def->joint2; - - m_typeA = m_joint1->GetType(); - m_typeB = m_joint2->GetType(); - - b2Assert(m_typeA == e_revoluteJoint || m_typeA == e_prismaticJoint); - b2Assert(m_typeB == e_revoluteJoint || m_typeB == e_prismaticJoint); - - float32 coordinateA, coordinateB; - - // TODO_ERIN there might be some problem with the joint edges in b2Joint. - - m_bodyC = m_joint1->GetBodyA(); - m_bodyA = m_joint1->GetBodyB(); - - // Get geometry of joint1 - b2Transform xfA = m_bodyA->m_xf; - float32 aA = m_bodyA->m_sweep.a; - b2Transform xfC = m_bodyC->m_xf; - float32 aC = m_bodyC->m_sweep.a; - - if (m_typeA == e_revoluteJoint) - { - b2RevoluteJoint* revolute = (b2RevoluteJoint*)def->joint1; - m_localAnchorC = revolute->m_localAnchorA; - m_localAnchorA = revolute->m_localAnchorB; - m_referenceAngleA = revolute->m_referenceAngle; - m_localAxisC.SetZero(); - - coordinateA = aA - aC - m_referenceAngleA; - } - else - { - b2PrismaticJoint* prismatic = (b2PrismaticJoint*)def->joint1; - m_localAnchorC = prismatic->m_localAnchorA; - m_localAnchorA = prismatic->m_localAnchorB; - m_referenceAngleA = prismatic->m_referenceAngle; - m_localAxisC = prismatic->m_localXAxisA; - - b2Vec2 pC = m_localAnchorC; - b2Vec2 pA = b2MulT(xfC.q, b2Mul(xfA.q, m_localAnchorA) + (xfA.p - xfC.p)); - coordinateA = b2Dot(pA - pC, m_localAxisC); - } - - m_bodyD = m_joint2->GetBodyA(); - m_bodyB = m_joint2->GetBodyB(); - - // Get geometry of joint2 - b2Transform xfB = m_bodyB->m_xf; - float32 aB = m_bodyB->m_sweep.a; - b2Transform xfD = m_bodyD->m_xf; - float32 aD = m_bodyD->m_sweep.a; - - if (m_typeB == e_revoluteJoint) - { - b2RevoluteJoint* revolute = (b2RevoluteJoint*)def->joint2; - m_localAnchorD = revolute->m_localAnchorA; - m_localAnchorB = revolute->m_localAnchorB; - m_referenceAngleB = revolute->m_referenceAngle; - m_localAxisD.SetZero(); - - coordinateB = aB - aD - m_referenceAngleB; - } - else - { - b2PrismaticJoint* prismatic = (b2PrismaticJoint*)def->joint2; - m_localAnchorD = prismatic->m_localAnchorA; - m_localAnchorB = prismatic->m_localAnchorB; - m_referenceAngleB = prismatic->m_referenceAngle; - m_localAxisD = prismatic->m_localXAxisA; - - b2Vec2 pD = m_localAnchorD; - b2Vec2 pB = b2MulT(xfD.q, b2Mul(xfB.q, m_localAnchorB) + (xfB.p - xfD.p)); - coordinateB = b2Dot(pB - pD, m_localAxisD); - } - - m_ratio = def->ratio; - - m_constant = coordinateA + m_ratio * coordinateB; - - m_impulse = 0.0f; -} - -void b2GearJoint::InitVelocityConstraints(const b2SolverData& data) -{ - m_indexA = m_bodyA->m_islandIndex; - m_indexB = m_bodyB->m_islandIndex; - m_indexC = m_bodyC->m_islandIndex; - m_indexD = m_bodyD->m_islandIndex; - m_lcA = m_bodyA->m_sweep.localCenter; - m_lcB = m_bodyB->m_sweep.localCenter; - m_lcC = m_bodyC->m_sweep.localCenter; - m_lcD = m_bodyD->m_sweep.localCenter; - m_mA = m_bodyA->m_invMass; - m_mB = m_bodyB->m_invMass; - m_mC = m_bodyC->m_invMass; - m_mD = m_bodyD->m_invMass; - m_iA = m_bodyA->m_invI; - m_iB = m_bodyB->m_invI; - m_iC = m_bodyC->m_invI; - m_iD = m_bodyD->m_invI; - - b2Vec2 cA = data.positions[m_indexA].c; - float32 aA = data.positions[m_indexA].a; - b2Vec2 vA = data.velocities[m_indexA].v; - float32 wA = data.velocities[m_indexA].w; - - b2Vec2 cB = data.positions[m_indexB].c; - float32 aB = data.positions[m_indexB].a; - b2Vec2 vB = data.velocities[m_indexB].v; - float32 wB = data.velocities[m_indexB].w; - - b2Vec2 cC = data.positions[m_indexC].c; - float32 aC = data.positions[m_indexC].a; - b2Vec2 vC = data.velocities[m_indexC].v; - float32 wC = data.velocities[m_indexC].w; - - b2Vec2 cD = data.positions[m_indexD].c; - float32 aD = data.positions[m_indexD].a; - b2Vec2 vD = data.velocities[m_indexD].v; - float32 wD = data.velocities[m_indexD].w; - - b2Rot qA(aA), qB(aB), qC(aC), qD(aD); - - m_mass = 0.0f; - - if (m_typeA == e_revoluteJoint) - { - m_JvAC.SetZero(); - m_JwA = 1.0f; - m_JwC = 1.0f; - m_mass += m_iA + m_iC; - } - else - { - b2Vec2 u = b2Mul(qC, m_localAxisC); - b2Vec2 rC = b2Mul(qC, m_localAnchorC - m_lcC); - b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_lcA); - m_JvAC = u; - m_JwC = b2Cross(rC, u); - m_JwA = b2Cross(rA, u); - m_mass += m_mC + m_mA + m_iC * m_JwC * m_JwC + m_iA * m_JwA * m_JwA; - } - - if (m_typeB == e_revoluteJoint) - { - m_JvBD.SetZero(); - m_JwB = m_ratio; - m_JwD = m_ratio; - m_mass += m_ratio * m_ratio * (m_iB + m_iD); - } - else - { - b2Vec2 u = b2Mul(qD, m_localAxisD); - b2Vec2 rD = b2Mul(qD, m_localAnchorD - m_lcD); - b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_lcB); - m_JvBD = m_ratio * u; - m_JwD = m_ratio * b2Cross(rD, u); - m_JwB = m_ratio * b2Cross(rB, u); - m_mass += m_ratio * m_ratio * (m_mD + m_mB) + m_iD * m_JwD * m_JwD + m_iB * m_JwB * m_JwB; - } - - // Compute effective mass. - m_mass = m_mass > 0.0f ? 1.0f / m_mass : 0.0f; - - if (data.step.warmStarting) - { - vA += (m_mA * m_impulse) * m_JvAC; - wA += m_iA * m_impulse * m_JwA; - vB += (m_mB * m_impulse) * m_JvBD; - wB += m_iB * m_impulse * m_JwB; - vC -= (m_mC * m_impulse) * m_JvAC; - wC -= m_iC * m_impulse * m_JwC; - vD -= (m_mD * m_impulse) * m_JvBD; - wD -= m_iD * m_impulse * m_JwD; - } - else - { - m_impulse = 0.0f; - } - - data.velocities[m_indexA].v = vA; - data.velocities[m_indexA].w = wA; - data.velocities[m_indexB].v = vB; - data.velocities[m_indexB].w = wB; - data.velocities[m_indexC].v = vC; - data.velocities[m_indexC].w = wC; - data.velocities[m_indexD].v = vD; - data.velocities[m_indexD].w = wD; -} - -void b2GearJoint::SolveVelocityConstraints(const b2SolverData& data) -{ - b2Vec2 vA = data.velocities[m_indexA].v; - float32 wA = data.velocities[m_indexA].w; - b2Vec2 vB = data.velocities[m_indexB].v; - float32 wB = data.velocities[m_indexB].w; - b2Vec2 vC = data.velocities[m_indexC].v; - float32 wC = data.velocities[m_indexC].w; - b2Vec2 vD = data.velocities[m_indexD].v; - float32 wD = data.velocities[m_indexD].w; - - float32 Cdot = b2Dot(m_JvAC, vA - vC) + b2Dot(m_JvBD, vB - vD); - Cdot += (m_JwA * wA - m_JwC * wC) + (m_JwB * wB - m_JwD * wD); - - float32 impulse = -m_mass * Cdot; - m_impulse += impulse; - - vA += (m_mA * impulse) * m_JvAC; - wA += m_iA * impulse * m_JwA; - vB += (m_mB * impulse) * m_JvBD; - wB += m_iB * impulse * m_JwB; - vC -= (m_mC * impulse) * m_JvAC; - wC -= m_iC * impulse * m_JwC; - vD -= (m_mD * impulse) * m_JvBD; - wD -= m_iD * impulse * m_JwD; - - data.velocities[m_indexA].v = vA; - data.velocities[m_indexA].w = wA; - data.velocities[m_indexB].v = vB; - data.velocities[m_indexB].w = wB; - data.velocities[m_indexC].v = vC; - data.velocities[m_indexC].w = wC; - data.velocities[m_indexD].v = vD; - data.velocities[m_indexD].w = wD; -} - -bool b2GearJoint::SolvePositionConstraints(const b2SolverData& data) -{ - b2Vec2 cA = data.positions[m_indexA].c; - float32 aA = data.positions[m_indexA].a; - b2Vec2 cB = data.positions[m_indexB].c; - float32 aB = data.positions[m_indexB].a; - b2Vec2 cC = data.positions[m_indexC].c; - float32 aC = data.positions[m_indexC].a; - b2Vec2 cD = data.positions[m_indexD].c; - float32 aD = data.positions[m_indexD].a; - - b2Rot qA(aA), qB(aB), qC(aC), qD(aD); - - float32 linearError = 0.0f; - - float32 coordinateA, coordinateB; - - b2Vec2 JvAC, JvBD; - float32 JwA, JwB, JwC, JwD; - float32 mass = 0.0f; - - if (m_typeA == e_revoluteJoint) - { - JvAC.SetZero(); - JwA = 1.0f; - JwC = 1.0f; - mass += m_iA + m_iC; - - coordinateA = aA - aC - m_referenceAngleA; - } - else - { - b2Vec2 u = b2Mul(qC, m_localAxisC); - b2Vec2 rC = b2Mul(qC, m_localAnchorC - m_lcC); - b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_lcA); - JvAC = u; - JwC = b2Cross(rC, u); - JwA = b2Cross(rA, u); - mass += m_mC + m_mA + m_iC * JwC * JwC + m_iA * JwA * JwA; - - b2Vec2 pC = m_localAnchorC - m_lcC; - b2Vec2 pA = b2MulT(qC, rA + (cA - cC)); - coordinateA = b2Dot(pA - pC, m_localAxisC); - } - - if (m_typeB == e_revoluteJoint) - { - JvBD.SetZero(); - JwB = m_ratio; - JwD = m_ratio; - mass += m_ratio * m_ratio * (m_iB + m_iD); - - coordinateB = aB - aD - m_referenceAngleB; - } - else - { - b2Vec2 u = b2Mul(qD, m_localAxisD); - b2Vec2 rD = b2Mul(qD, m_localAnchorD - m_lcD); - b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_lcB); - JvBD = m_ratio * u; - JwD = m_ratio * b2Cross(rD, u); - JwB = m_ratio * b2Cross(rB, u); - mass += m_ratio * m_ratio * (m_mD + m_mB) + m_iD * JwD * JwD + m_iB * JwB * JwB; - - b2Vec2 pD = m_localAnchorD - m_lcD; - b2Vec2 pB = b2MulT(qD, rB + (cB - cD)); - coordinateB = b2Dot(pB - pD, m_localAxisD); - } - - float32 C = (coordinateA + m_ratio * coordinateB) - m_constant; - - float32 impulse = 0.0f; - if (mass > 0.0f) - { - impulse = -C / mass; - } - - cA += m_mA * impulse * JvAC; - aA += m_iA * impulse * JwA; - cB += m_mB * impulse * JvBD; - aB += m_iB * impulse * JwB; - cC -= m_mC * impulse * JvAC; - aC -= m_iC * impulse * JwC; - cD -= m_mD * impulse * JvBD; - aD -= m_iD * impulse * JwD; - - data.positions[m_indexA].c = cA; - data.positions[m_indexA].a = aA; - data.positions[m_indexB].c = cB; - data.positions[m_indexB].a = aB; - data.positions[m_indexC].c = cC; - data.positions[m_indexC].a = aC; - data.positions[m_indexD].c = cD; - data.positions[m_indexD].a = aD; - - // TODO_ERIN not implemented - return linearError < b2_linearSlop; -} - -b2Vec2 b2GearJoint::GetAnchorA() const -{ - return m_bodyA->GetWorldPoint(m_localAnchorA); -} - -b2Vec2 b2GearJoint::GetAnchorB() const -{ - return m_bodyB->GetWorldPoint(m_localAnchorB); -} - -b2Vec2 b2GearJoint::GetReactionForce(float32 inv_dt) const -{ - b2Vec2 P = m_impulse * m_JvAC; - return inv_dt * P; -} - -float32 b2GearJoint::GetReactionTorque(float32 inv_dt) const -{ - float32 L = m_impulse * m_JwA; - return inv_dt * L; -} - -void b2GearJoint::SetRatio(float32 ratio) -{ - b2Assert(b2IsValid(ratio)); - m_ratio = ratio; -} - -float32 b2GearJoint::GetRatio() const -{ - return m_ratio; -} - -void b2GearJoint::Dump() -{ - int32 indexA = m_bodyA->m_islandIndex; - int32 indexB = m_bodyB->m_islandIndex; - - int32 index1 = m_joint1->m_index; - int32 index2 = m_joint2->m_index; - - b2Log(" b2GearJointDef jd;\n"); - b2Log(" jd.bodyA = bodies[%d];\n", indexA); - b2Log(" jd.bodyB = bodies[%d];\n", indexB); - b2Log(" jd.collideConnected = bool(%d);\n", m_collideConnected); - b2Log(" jd.joint1 = joints[%d];\n", index1); - b2Log(" jd.joint2 = joints[%d];\n", index2); - b2Log(" jd.ratio = %.15lef;\n", m_ratio); - b2Log(" joints[%d] = m_world->CreateJoint(&jd);\n", m_index); -} diff --git a/external/box2d/Dynamics/Joints/b2GearJoint.h b/external/box2d/Dynamics/Joints/b2GearJoint.h deleted file mode 100644 index f926bf6ef1..0000000000 --- a/external/box2d/Dynamics/Joints/b2GearJoint.h +++ /dev/null @@ -1,125 +0,0 @@ -/* -* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_GEAR_JOINT_H -#define B2_GEAR_JOINT_H - -#include - -/// Gear joint definition. This definition requires two existing -/// revolute or prismatic joints (any combination will work). -struct b2GearJointDef : public b2JointDef -{ - b2GearJointDef() - { - type = e_gearJoint; - joint1 = NULL; - joint2 = NULL; - ratio = 1.0f; - } - - /// The first revolute/prismatic joint attached to the gear joint. - b2Joint* joint1; - - /// The second revolute/prismatic joint attached to the gear joint. - b2Joint* joint2; - - /// The gear ratio. - /// @see b2GearJoint for explanation. - float32 ratio; -}; - -/// A gear joint is used to connect two joints together. Either joint -/// can be a revolute or prismatic joint. You specify a gear ratio -/// to bind the motions together: -/// coordinate1 + ratio * coordinate2 = constant -/// The ratio can be negative or positive. If one joint is a revolute joint -/// and the other joint is a prismatic joint, then the ratio will have units -/// of length or units of 1/length. -/// @warning You have to manually destroy the gear joint if joint1 or joint2 -/// is destroyed. -class b2GearJoint : public b2Joint -{ -public: - b2Vec2 GetAnchorA() const; - b2Vec2 GetAnchorB() const; - - b2Vec2 GetReactionForce(float32 inv_dt) const; - float32 GetReactionTorque(float32 inv_dt) const; - - /// Get the first joint. - b2Joint* GetJoint1() { return m_joint1; } - - /// Get the second joint. - b2Joint* GetJoint2() { return m_joint2; } - - /// Set/Get the gear ratio. - void SetRatio(float32 ratio); - float32 GetRatio() const; - - /// Dump joint to dmLog - void Dump(); - -protected: - - friend class b2Joint; - b2GearJoint(const b2GearJointDef* data); - - void InitVelocityConstraints(const b2SolverData& data); - void SolveVelocityConstraints(const b2SolverData& data); - bool SolvePositionConstraints(const b2SolverData& data); - - b2Joint* m_joint1; - b2Joint* m_joint2; - - b2JointType m_typeA; - b2JointType m_typeB; - - // Body A is connected to body C - // Body B is connected to body D - b2Body* m_bodyC; - b2Body* m_bodyD; - - // Solver shared - b2Vec2 m_localAnchorA; - b2Vec2 m_localAnchorB; - b2Vec2 m_localAnchorC; - b2Vec2 m_localAnchorD; - - b2Vec2 m_localAxisC; - b2Vec2 m_localAxisD; - - float32 m_referenceAngleA; - float32 m_referenceAngleB; - - float32 m_constant; - float32 m_ratio; - - float32 m_impulse; - - // Solver temp - int32 m_indexA, m_indexB, m_indexC, m_indexD; - b2Vec2 m_lcA, m_lcB, m_lcC, m_lcD; - float32 m_mA, m_mB, m_mC, m_mD; - float32 m_iA, m_iB, m_iC, m_iD; - b2Vec2 m_JvAC, m_JvBD; - float32 m_JwA, m_JwB, m_JwC, m_JwD; - float32 m_mass; -}; - -#endif diff --git a/external/box2d/Dynamics/Joints/b2Joint.cpp b/external/box2d/Dynamics/Joints/b2Joint.cpp deleted file mode 100644 index 6853b09f0b..0000000000 --- a/external/box2d/Dynamics/Joints/b2Joint.cpp +++ /dev/null @@ -1,199 +0,0 @@ -/* -* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -b2Joint* b2Joint::Create(const b2JointDef* def, b2BlockAllocator* allocator) -{ - b2Joint* joint = NULL; - - switch (def->type) - { - case e_distanceJoint: - { - void* mem = allocator->Allocate(sizeof(b2DistanceJoint)); - joint = new (mem) b2DistanceJoint((b2DistanceJointDef*)def); - } - break; - - case e_mouseJoint: - { - void* mem = allocator->Allocate(sizeof(b2MouseJoint)); - joint = new (mem) b2MouseJoint((b2MouseJointDef*)def); - } - break; - - case e_prismaticJoint: - { - void* mem = allocator->Allocate(sizeof(b2PrismaticJoint)); - joint = new (mem) b2PrismaticJoint((b2PrismaticJointDef*)def); - } - break; - - case e_revoluteJoint: - { - void* mem = allocator->Allocate(sizeof(b2RevoluteJoint)); - joint = new (mem) b2RevoluteJoint((b2RevoluteJointDef*)def); - } - break; - - case e_pulleyJoint: - { - void* mem = allocator->Allocate(sizeof(b2PulleyJoint)); - joint = new (mem) b2PulleyJoint((b2PulleyJointDef*)def); - } - break; - - case e_gearJoint: - { - void* mem = allocator->Allocate(sizeof(b2GearJoint)); - joint = new (mem) b2GearJoint((b2GearJointDef*)def); - } - break; - - case e_wheelJoint: - { - void* mem = allocator->Allocate(sizeof(b2WheelJoint)); - joint = new (mem) b2WheelJoint((b2WheelJointDef*)def); - } - break; - - case e_weldJoint: - { - void* mem = allocator->Allocate(sizeof(b2WeldJoint)); - joint = new (mem) b2WeldJoint((b2WeldJointDef*)def); - } - break; - - case e_frictionJoint: - { - void* mem = allocator->Allocate(sizeof(b2FrictionJoint)); - joint = new (mem) b2FrictionJoint((b2FrictionJointDef*)def); - } - break; - - case e_ropeJoint: - { - void* mem = allocator->Allocate(sizeof(b2RopeJoint)); - joint = new (mem) b2RopeJoint((b2RopeJointDef*)def); - } - break; - - default: - b2Assert(false); - break; - } - - return joint; -} - -void b2Joint::Destroy(b2Joint* joint, b2BlockAllocator* allocator) -{ - joint->~b2Joint(); - switch (joint->m_type) - { - case e_distanceJoint: - allocator->Free(joint, sizeof(b2DistanceJoint)); - break; - - case e_mouseJoint: - allocator->Free(joint, sizeof(b2MouseJoint)); - break; - - case e_prismaticJoint: - allocator->Free(joint, sizeof(b2PrismaticJoint)); - break; - - case e_revoluteJoint: - allocator->Free(joint, sizeof(b2RevoluteJoint)); - break; - - case e_pulleyJoint: - allocator->Free(joint, sizeof(b2PulleyJoint)); - break; - - case e_gearJoint: - allocator->Free(joint, sizeof(b2GearJoint)); - break; - - case e_wheelJoint: - allocator->Free(joint, sizeof(b2WheelJoint)); - break; - - case e_weldJoint: - allocator->Free(joint, sizeof(b2WeldJoint)); - break; - - case e_frictionJoint: - allocator->Free(joint, sizeof(b2FrictionJoint)); - break; - - case e_ropeJoint: - allocator->Free(joint, sizeof(b2RopeJoint)); - break; - - default: - b2Assert(false); - break; - } -} - -b2Joint::b2Joint(const b2JointDef* def) -{ - b2Assert(def->bodyA != def->bodyB); - - m_type = def->type; - m_prev = NULL; - m_next = NULL; - m_bodyA = def->bodyA; - m_bodyB = def->bodyB; - m_index = 0; - m_collideConnected = def->collideConnected; - m_islandFlag = false; - m_userData = def->userData; - - m_edgeA.joint = NULL; - m_edgeA.other = NULL; - m_edgeA.prev = NULL; - m_edgeA.next = NULL; - - m_edgeB.joint = NULL; - m_edgeB.other = NULL; - m_edgeB.prev = NULL; - m_edgeB.next = NULL; -} - -bool b2Joint::IsActive() const -{ - return m_bodyA->IsActive() && m_bodyB->IsActive(); -} diff --git a/external/box2d/Dynamics/Joints/b2Joint.h b/external/box2d/Dynamics/Joints/b2Joint.h deleted file mode 100644 index b4ea576665..0000000000 --- a/external/box2d/Dynamics/Joints/b2Joint.h +++ /dev/null @@ -1,222 +0,0 @@ -/* -* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_JOINT_H -#define B2_JOINT_H - -#include - -class b2Body; -class b2Joint; -struct b2SolverData; -class b2BlockAllocator; - -enum b2JointType -{ - e_unknownJoint, - e_revoluteJoint, - e_prismaticJoint, - e_distanceJoint, - e_pulleyJoint, - e_mouseJoint, - e_gearJoint, - e_wheelJoint, - e_weldJoint, - e_frictionJoint, - e_ropeJoint -}; - -enum b2LimitState -{ - e_inactiveLimit, - e_atLowerLimit, - e_atUpperLimit, - e_equalLimits -}; - -struct b2Jacobian -{ - b2Vec2 linear; - float32 angularA; - float32 angularB; -}; - -/// A joint edge is used to connect bodies and joints together -/// in a joint graph where each body is a node and each joint -/// is an edge. A joint edge belongs to a doubly linked list -/// maintained in each attached body. Each joint has two joint -/// nodes, one for each attached body. -struct b2JointEdge -{ - b2Body* other; ///< provides quick access to the other body attached. - b2Joint* joint; ///< the joint - b2JointEdge* prev; ///< the previous joint edge in the body's joint list - b2JointEdge* next; ///< the next joint edge in the body's joint list -}; - -/// Joint definitions are used to construct joints. -struct b2JointDef -{ - b2JointDef() - { - type = e_unknownJoint; - userData = NULL; - bodyA = NULL; - bodyB = NULL; - collideConnected = false; - } - - /// The joint type is set automatically for concrete joint types. - b2JointType type; - - /// Use this to attach application specific data to your joints. - void* userData; - - /// The first attached body. - b2Body* bodyA; - - /// The second attached body. - b2Body* bodyB; - - /// Set this flag to true if the attached bodies should collide. - bool collideConnected; -}; - -/// The base joint class. Joints are used to constraint two bodies together in -/// various fashions. Some joints also feature limits and motors. -class b2Joint -{ -public: - - /// Get the type of the concrete joint. - b2JointType GetType() const; - - /// Get the first body attached to this joint. - b2Body* GetBodyA(); - - /// Get the second body attached to this joint. - b2Body* GetBodyB(); - - /// Get the anchor point on bodyA in world coordinates. - virtual b2Vec2 GetAnchorA() const = 0; - - /// Get the anchor point on bodyB in world coordinates. - virtual b2Vec2 GetAnchorB() const = 0; - - /// Get the reaction force on bodyB at the joint anchor in Newtons. - virtual b2Vec2 GetReactionForce(float32 inv_dt) const = 0; - - /// Get the reaction torque on bodyB in N*m. - virtual float32 GetReactionTorque(float32 inv_dt) const = 0; - - /// Get the next joint the world joint list. - b2Joint* GetNext(); - const b2Joint* GetNext() const; - - /// Get the user data pointer. - void* GetUserData() const; - - /// Set the user data pointer. - void SetUserData(void* data); - - /// Short-cut function to determine if either body is inactive. - bool IsActive() const; - - /// Get collide connected. - /// Note: modifying the collide connect flag won't work correctly because - /// the flag is only checked when fixture AABBs begin to overlap. - bool GetCollideConnected() const; - - /// Dump this joint to the log file. - virtual void Dump() { b2Log("// Dump is not supported for this joint type.\n"); } - -protected: - friend class b2World; - friend class b2Body; - friend class b2Island; - friend class b2GearJoint; - - static b2Joint* Create(const b2JointDef* def, b2BlockAllocator* allocator); - static void Destroy(b2Joint* joint, b2BlockAllocator* allocator); - - b2Joint(const b2JointDef* def); - virtual ~b2Joint() {} - - virtual void InitVelocityConstraints(const b2SolverData& data) = 0; - virtual void SolveVelocityConstraints(const b2SolverData& data) = 0; - - // This returns true if the position errors are within tolerance. - virtual bool SolvePositionConstraints(const b2SolverData& data) = 0; - - b2JointType m_type; - b2Joint* m_prev; - b2Joint* m_next; - b2JointEdge m_edgeA; - b2JointEdge m_edgeB; - b2Body* m_bodyA; - b2Body* m_bodyB; - - int32 m_index; - - bool m_islandFlag; - bool m_collideConnected; - - void* m_userData; -}; - -inline b2JointType b2Joint::GetType() const -{ - return m_type; -} - -inline b2Body* b2Joint::GetBodyA() -{ - return m_bodyA; -} - -inline b2Body* b2Joint::GetBodyB() -{ - return m_bodyB; -} - -inline b2Joint* b2Joint::GetNext() -{ - return m_next; -} - -inline const b2Joint* b2Joint::GetNext() const -{ - return m_next; -} - -inline void* b2Joint::GetUserData() const -{ - return m_userData; -} - -inline void b2Joint::SetUserData(void* data) -{ - m_userData = data; -} - -inline bool b2Joint::GetCollideConnected() const -{ - return m_collideConnected; -} - -#endif diff --git a/external/box2d/Dynamics/Joints/b2MouseJoint.cpp b/external/box2d/Dynamics/Joints/b2MouseJoint.cpp deleted file mode 100644 index 237d9d519a..0000000000 --- a/external/box2d/Dynamics/Joints/b2MouseJoint.cpp +++ /dev/null @@ -1,217 +0,0 @@ -/* -* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include - -// p = attached point, m = mouse point -// C = p - m -// Cdot = v -// = v + cross(w, r) -// J = [I r_skew] -// Identity used: -// w k % (rx i + ry j) = w * (-ry i + rx j) - -b2MouseJoint::b2MouseJoint(const b2MouseJointDef* def) -: b2Joint(def) -{ - b2Assert(def->target.IsValid()); - b2Assert(b2IsValid(def->maxForce) && def->maxForce >= 0.0f); - b2Assert(b2IsValid(def->frequencyHz) && def->frequencyHz >= 0.0f); - b2Assert(b2IsValid(def->dampingRatio) && def->dampingRatio >= 0.0f); - - m_targetA = def->target; - m_localAnchorB = b2MulT(m_bodyB->GetTransform(), m_targetA); - - m_maxForce = def->maxForce; - m_impulse.SetZero(); - - m_frequencyHz = def->frequencyHz; - m_dampingRatio = def->dampingRatio; - - m_beta = 0.0f; - m_gamma = 0.0f; -} - -void b2MouseJoint::SetTarget(const b2Vec2& target) -{ - if (m_bodyB->IsAwake() == false) - { - m_bodyB->SetAwake(true); - } - m_targetA = target; -} - -const b2Vec2& b2MouseJoint::GetTarget() const -{ - return m_targetA; -} - -void b2MouseJoint::SetMaxForce(float32 force) -{ - m_maxForce = force; -} - -float32 b2MouseJoint::GetMaxForce() const -{ - return m_maxForce; -} - -void b2MouseJoint::SetFrequency(float32 hz) -{ - m_frequencyHz = hz; -} - -float32 b2MouseJoint::GetFrequency() const -{ - return m_frequencyHz; -} - -void b2MouseJoint::SetDampingRatio(float32 ratio) -{ - m_dampingRatio = ratio; -} - -float32 b2MouseJoint::GetDampingRatio() const -{ - return m_dampingRatio; -} - -void b2MouseJoint::InitVelocityConstraints(const b2SolverData& data) -{ - m_indexB = m_bodyB->m_islandIndex; - m_localCenterB = m_bodyB->m_sweep.localCenter; - m_invMassB = m_bodyB->m_invMass; - m_invIB = m_bodyB->m_invI; - - b2Vec2 cB = data.positions[m_indexB].c; - float32 aB = data.positions[m_indexB].a; - b2Vec2 vB = data.velocities[m_indexB].v; - float32 wB = data.velocities[m_indexB].w; - - b2Rot qB(aB); - - float32 mass = m_bodyB->GetMass(); - - // Frequency - float32 omega = 2.0f * b2_pi * m_frequencyHz; - - // Damping coefficient - float32 d = 2.0f * mass * m_dampingRatio * omega; - - // Spring stiffness - float32 k = mass * (omega * omega); - - // magic formulas - // gamma has units of inverse mass. - // beta has units of inverse time. - float32 h = data.step.dt; - b2Assert(d + h * k > b2_epsilon); - m_gamma = h * (d + h * k); - if (m_gamma != 0.0f) - { - m_gamma = 1.0f / m_gamma; - } - m_beta = h * k * m_gamma; - - // Compute the effective mass matrix. - m_rB = b2Mul(qB, m_localAnchorB - m_localCenterB); - - // K = [(1/m1 + 1/m2) * eye(2) - skew(r1) * invI1 * skew(r1) - skew(r2) * invI2 * skew(r2)] - // = [1/m1+1/m2 0 ] + invI1 * [r1.y*r1.y -r1.x*r1.y] + invI2 * [r1.y*r1.y -r1.x*r1.y] - // [ 0 1/m1+1/m2] [-r1.x*r1.y r1.x*r1.x] [-r1.x*r1.y r1.x*r1.x] - b2Mat22 K; - K.ex.x = m_invMassB + m_invIB * m_rB.y * m_rB.y + m_gamma; - K.ex.y = -m_invIB * m_rB.x * m_rB.y; - K.ey.x = K.ex.y; - K.ey.y = m_invMassB + m_invIB * m_rB.x * m_rB.x + m_gamma; - - m_mass = K.GetInverse(); - - m_C = cB + m_rB - m_targetA; - m_C *= m_beta; - - // Cheat with some damping - wB *= 0.98f; - - if (data.step.warmStarting) - { - m_impulse *= data.step.dtRatio; - vB += m_invMassB * m_impulse; - wB += m_invIB * b2Cross(m_rB, m_impulse); - } - else - { - m_impulse.SetZero(); - } - - data.velocities[m_indexB].v = vB; - data.velocities[m_indexB].w = wB; -} - -void b2MouseJoint::SolveVelocityConstraints(const b2SolverData& data) -{ - b2Vec2 vB = data.velocities[m_indexB].v; - float32 wB = data.velocities[m_indexB].w; - - // Cdot = v + cross(w, r) - b2Vec2 Cdot = vB + b2Cross(wB, m_rB); - b2Vec2 impulse = b2Mul(m_mass, -(Cdot + m_C + m_gamma * m_impulse)); - - b2Vec2 oldImpulse = m_impulse; - m_impulse += impulse; - float32 maxImpulse = data.step.dt * m_maxForce; - if (m_impulse.LengthSquared() > maxImpulse * maxImpulse) - { - m_impulse *= maxImpulse / m_impulse.Length(); - } - impulse = m_impulse - oldImpulse; - - vB += m_invMassB * impulse; - wB += m_invIB * b2Cross(m_rB, impulse); - - data.velocities[m_indexB].v = vB; - data.velocities[m_indexB].w = wB; -} - -bool b2MouseJoint::SolvePositionConstraints(const b2SolverData& data) -{ - B2_NOT_USED(data); - return true; -} - -b2Vec2 b2MouseJoint::GetAnchorA() const -{ - return m_targetA; -} - -b2Vec2 b2MouseJoint::GetAnchorB() const -{ - return m_bodyB->GetWorldPoint(m_localAnchorB); -} - -b2Vec2 b2MouseJoint::GetReactionForce(float32 inv_dt) const -{ - return inv_dt * m_impulse; -} - -float32 b2MouseJoint::GetReactionTorque(float32 inv_dt) const -{ - return inv_dt * 0.0f; -} diff --git a/external/box2d/Dynamics/Joints/b2MouseJoint.h b/external/box2d/Dynamics/Joints/b2MouseJoint.h deleted file mode 100644 index 1bbc194f4c..0000000000 --- a/external/box2d/Dynamics/Joints/b2MouseJoint.h +++ /dev/null @@ -1,126 +0,0 @@ -/* -* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_MOUSE_JOINT_H -#define B2_MOUSE_JOINT_H - -#include - -/// Mouse joint definition. This requires a world target point, -/// tuning parameters, and the time step. -struct b2MouseJointDef : public b2JointDef -{ - b2MouseJointDef() - { - type = e_mouseJoint; - target.Set(0.0f, 0.0f); - maxForce = 0.0f; - frequencyHz = 5.0f; - dampingRatio = 0.7f; - } - - /// The initial world target point. This is assumed - /// to coincide with the body anchor initially. - b2Vec2 target; - - /// The maximum constraint force that can be exerted - /// to move the candidate body. Usually you will express - /// as some multiple of the weight (multiplier * mass * gravity). - float32 maxForce; - - /// The response speed. - float32 frequencyHz; - - /// The damping ratio. 0 = no damping, 1 = critical damping. - float32 dampingRatio; -}; - -/// A mouse joint is used to make a point on a body track a -/// specified world point. This a soft constraint with a maximum -/// force. This allows the constraint to stretch and without -/// applying huge forces. -/// NOTE: this joint is not documented in the manual because it was -/// developed to be used in the testbed. If you want to learn how to -/// use the mouse joint, look at the testbed. -class b2MouseJoint : public b2Joint -{ -public: - - /// Implements b2Joint. - b2Vec2 GetAnchorA() const; - - /// Implements b2Joint. - b2Vec2 GetAnchorB() const; - - /// Implements b2Joint. - b2Vec2 GetReactionForce(float32 inv_dt) const; - - /// Implements b2Joint. - float32 GetReactionTorque(float32 inv_dt) const; - - /// Use this to update the target point. - void SetTarget(const b2Vec2& target); - const b2Vec2& GetTarget() const; - - /// Set/get the maximum force in Newtons. - void SetMaxForce(float32 force); - float32 GetMaxForce() const; - - /// Set/get the frequency in Hertz. - void SetFrequency(float32 hz); - float32 GetFrequency() const; - - /// Set/get the damping ratio (dimensionless). - void SetDampingRatio(float32 ratio); - float32 GetDampingRatio() const; - - /// The mouse joint does not support dumping. - void Dump() { b2Log("Mouse joint dumping is not supported.\n"); } - -protected: - friend class b2Joint; - - b2MouseJoint(const b2MouseJointDef* def); - - void InitVelocityConstraints(const b2SolverData& data); - void SolveVelocityConstraints(const b2SolverData& data); - bool SolvePositionConstraints(const b2SolverData& data); - - b2Vec2 m_localAnchorB; - b2Vec2 m_targetA; - float32 m_frequencyHz; - float32 m_dampingRatio; - float32 m_beta; - - // Solver shared - b2Vec2 m_impulse; - float32 m_maxForce; - float32 m_gamma; - - // Solver temp - int32 m_indexA; - int32 m_indexB; - b2Vec2 m_rB; - b2Vec2 m_localCenterB; - float32 m_invMassB; - float32 m_invIB; - b2Mat22 m_mass; - b2Vec2 m_C; -}; - -#endif diff --git a/external/box2d/Dynamics/Joints/b2PrismaticJoint.cpp b/external/box2d/Dynamics/Joints/b2PrismaticJoint.cpp deleted file mode 100644 index 4849f729f5..0000000000 --- a/external/box2d/Dynamics/Joints/b2PrismaticJoint.cpp +++ /dev/null @@ -1,637 +0,0 @@ -/* -* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include - -// Linear constraint (point-to-line) -// d = p2 - p1 = x2 + r2 - x1 - r1 -// C = dot(perp, d) -// Cdot = dot(d, cross(w1, perp)) + dot(perp, v2 + cross(w2, r2) - v1 - cross(w1, r1)) -// = -dot(perp, v1) - dot(cross(d + r1, perp), w1) + dot(perp, v2) + dot(cross(r2, perp), v2) -// J = [-perp, -cross(d + r1, perp), perp, cross(r2,perp)] -// -// Angular constraint -// C = a2 - a1 + a_initial -// Cdot = w2 - w1 -// J = [0 0 -1 0 0 1] -// -// K = J * invM * JT -// -// J = [-a -s1 a s2] -// [0 -1 0 1] -// a = perp -// s1 = cross(d + r1, a) = cross(p2 - x1, a) -// s2 = cross(r2, a) = cross(p2 - x2, a) - - -// Motor/Limit linear constraint -// C = dot(ax1, d) -// Cdot = = -dot(ax1, v1) - dot(cross(d + r1, ax1), w1) + dot(ax1, v2) + dot(cross(r2, ax1), v2) -// J = [-ax1 -cross(d+r1,ax1) ax1 cross(r2,ax1)] - -// Block Solver -// We develop a block solver that includes the joint limit. This makes the limit stiff (inelastic) even -// when the mass has poor distribution (leading to large torques about the joint anchor points). -// -// The Jacobian has 3 rows: -// J = [-uT -s1 uT s2] // linear -// [0 -1 0 1] // angular -// [-vT -a1 vT a2] // limit -// -// u = perp -// v = axis -// s1 = cross(d + r1, u), s2 = cross(r2, u) -// a1 = cross(d + r1, v), a2 = cross(r2, v) - -// M * (v2 - v1) = JT * df -// J * v2 = bias -// -// v2 = v1 + invM * JT * df -// J * (v1 + invM * JT * df) = bias -// K * df = bias - J * v1 = -Cdot -// K = J * invM * JT -// Cdot = J * v1 - bias -// -// Now solve for f2. -// df = f2 - f1 -// K * (f2 - f1) = -Cdot -// f2 = invK * (-Cdot) + f1 -// -// Clamp accumulated limit impulse. -// lower: f2(3) = max(f2(3), 0) -// upper: f2(3) = min(f2(3), 0) -// -// Solve for correct f2(1:2) -// K(1:2, 1:2) * f2(1:2) = -Cdot(1:2) - K(1:2,3) * f2(3) + K(1:2,1:3) * f1 -// = -Cdot(1:2) - K(1:2,3) * f2(3) + K(1:2,1:2) * f1(1:2) + K(1:2,3) * f1(3) -// K(1:2, 1:2) * f2(1:2) = -Cdot(1:2) - K(1:2,3) * (f2(3) - f1(3)) + K(1:2,1:2) * f1(1:2) -// f2(1:2) = invK(1:2,1:2) * (-Cdot(1:2) - K(1:2,3) * (f2(3) - f1(3))) + f1(1:2) -// -// Now compute impulse to be applied: -// df = f2 - f1 - -void b2PrismaticJointDef::Initialize(b2Body* bA, b2Body* bB, const b2Vec2& anchor, const b2Vec2& axis) -{ - bodyA = bA; - bodyB = bB; - localAnchorA = bodyA->GetLocalPoint(anchor); - localAnchorB = bodyB->GetLocalPoint(anchor); - localAxisA = bodyA->GetLocalVector(axis); - referenceAngle = bodyB->GetAngle() - bodyA->GetAngle(); -} - -b2PrismaticJoint::b2PrismaticJoint(const b2PrismaticJointDef* def) -: b2Joint(def) -{ - m_localAnchorA = def->localAnchorA; - m_localAnchorB = def->localAnchorB; - m_localXAxisA = def->localAxisA; - m_localXAxisA.Normalize(); - m_localYAxisA = b2Cross(1.0f, m_localXAxisA); - m_referenceAngle = def->referenceAngle; - - m_impulse.SetZero(); - m_motorMass = 0.0; - m_motorImpulse = 0.0f; - - m_lowerTranslation = def->lowerTranslation; - m_upperTranslation = def->upperTranslation; - m_maxMotorForce = def->maxMotorForce; - m_motorSpeed = def->motorSpeed; - m_enableLimit = def->enableLimit; - m_enableMotor = def->enableMotor; - m_limitState = e_inactiveLimit; - - m_axis.SetZero(); - m_perp.SetZero(); -} - -void b2PrismaticJoint::InitVelocityConstraints(const b2SolverData& data) -{ - m_indexA = m_bodyA->m_islandIndex; - m_indexB = m_bodyB->m_islandIndex; - m_localCenterA = m_bodyA->m_sweep.localCenter; - m_localCenterB = m_bodyB->m_sweep.localCenter; - m_invMassA = m_bodyA->m_invMass; - m_invMassB = m_bodyB->m_invMass; - m_invIA = m_bodyA->m_invI; - m_invIB = m_bodyB->m_invI; - - b2Vec2 cA = data.positions[m_indexA].c; - float32 aA = data.positions[m_indexA].a; - b2Vec2 vA = data.velocities[m_indexA].v; - float32 wA = data.velocities[m_indexA].w; - - b2Vec2 cB = data.positions[m_indexB].c; - float32 aB = data.positions[m_indexB].a; - b2Vec2 vB = data.velocities[m_indexB].v; - float32 wB = data.velocities[m_indexB].w; - - b2Rot qA(aA), qB(aB); - - // Compute the effective masses. - b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA); - b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB); - b2Vec2 d = (cB - cA) + rB - rA; - - float32 mA = m_invMassA, mB = m_invMassB; - float32 iA = m_invIA, iB = m_invIB; - - // Compute motor Jacobian and effective mass. - { - m_axis = b2Mul(qA, m_localXAxisA); - m_a1 = b2Cross(d + rA, m_axis); - m_a2 = b2Cross(rB, m_axis); - - m_motorMass = mA + mB + iA * m_a1 * m_a1 + iB * m_a2 * m_a2; - if (m_motorMass > 0.0f) - { - m_motorMass = 1.0f / m_motorMass; - } - } - - // Prismatic constraint. - { - m_perp = b2Mul(qA, m_localYAxisA); - - m_s1 = b2Cross(d + rA, m_perp); - m_s2 = b2Cross(rB, m_perp); - - float32 k11 = mA + mB + iA * m_s1 * m_s1 + iB * m_s2 * m_s2; - float32 k12 = iA * m_s1 + iB * m_s2; - float32 k13 = iA * m_s1 * m_a1 + iB * m_s2 * m_a2; - float32 k22 = iA + iB; - if (k22 == 0.0f) - { - // For bodies with fixed rotation. - k22 = 1.0f; - } - float32 k23 = iA * m_a1 + iB * m_a2; - float32 k33 = mA + mB + iA * m_a1 * m_a1 + iB * m_a2 * m_a2; - - m_K.ex.Set(k11, k12, k13); - m_K.ey.Set(k12, k22, k23); - m_K.ez.Set(k13, k23, k33); - } - - // Compute motor and limit terms. - if (m_enableLimit) - { - float32 jointTranslation = b2Dot(m_axis, d); - if (b2Abs(m_upperTranslation - m_lowerTranslation) < 2.0f * b2_linearSlop) - { - m_limitState = e_equalLimits; - } - else if (jointTranslation <= m_lowerTranslation) - { - if (m_limitState != e_atLowerLimit) - { - m_limitState = e_atLowerLimit; - m_impulse.z = 0.0f; - } - } - else if (jointTranslation >= m_upperTranslation) - { - if (m_limitState != e_atUpperLimit) - { - m_limitState = e_atUpperLimit; - m_impulse.z = 0.0f; - } - } - else - { - m_limitState = e_inactiveLimit; - m_impulse.z = 0.0f; - } - } - else - { - m_limitState = e_inactiveLimit; - m_impulse.z = 0.0f; - } - - if (m_enableMotor == false) - { - m_motorImpulse = 0.0f; - } - - if (data.step.warmStarting) - { - // Account for variable time step. - m_impulse *= data.step.dtRatio; - m_motorImpulse *= data.step.dtRatio; - - b2Vec2 P = m_impulse.x * m_perp + (m_motorImpulse + m_impulse.z) * m_axis; - float32 LA = m_impulse.x * m_s1 + m_impulse.y + (m_motorImpulse + m_impulse.z) * m_a1; - float32 LB = m_impulse.x * m_s2 + m_impulse.y + (m_motorImpulse + m_impulse.z) * m_a2; - - vA -= mA * P; - wA -= iA * LA; - - vB += mB * P; - wB += iB * LB; - } - else - { - m_impulse.SetZero(); - m_motorImpulse = 0.0f; - } - - data.velocities[m_indexA].v = vA; - data.velocities[m_indexA].w = wA; - data.velocities[m_indexB].v = vB; - data.velocities[m_indexB].w = wB; -} - -void b2PrismaticJoint::SolveVelocityConstraints(const b2SolverData& data) -{ - b2Vec2 vA = data.velocities[m_indexA].v; - float32 wA = data.velocities[m_indexA].w; - b2Vec2 vB = data.velocities[m_indexB].v; - float32 wB = data.velocities[m_indexB].w; - - float32 mA = m_invMassA, mB = m_invMassB; - float32 iA = m_invIA, iB = m_invIB; - - // Solve linear motor constraint. - if (m_enableMotor && m_limitState != e_equalLimits) - { - float32 Cdot = b2Dot(m_axis, vB - vA) + m_a2 * wB - m_a1 * wA; - float32 impulse = m_motorMass * (m_motorSpeed - Cdot); - float32 oldImpulse = m_motorImpulse; - float32 maxImpulse = data.step.dt * m_maxMotorForce; - m_motorImpulse = b2Clamp(m_motorImpulse + impulse, -maxImpulse, maxImpulse); - impulse = m_motorImpulse - oldImpulse; - - b2Vec2 P = impulse * m_axis; - float32 LA = impulse * m_a1; - float32 LB = impulse * m_a2; - - vA -= mA * P; - wA -= iA * LA; - - vB += mB * P; - wB += iB * LB; - } - - b2Vec2 Cdot1; - Cdot1.x = b2Dot(m_perp, vB - vA) + m_s2 * wB - m_s1 * wA; - Cdot1.y = wB - wA; - - if (m_enableLimit && m_limitState != e_inactiveLimit) - { - // Solve prismatic and limit constraint in block form. - float32 Cdot2; - Cdot2 = b2Dot(m_axis, vB - vA) + m_a2 * wB - m_a1 * wA; - b2Vec3 Cdot(Cdot1.x, Cdot1.y, Cdot2); - - b2Vec3 f1 = m_impulse; - b2Vec3 df = m_K.Solve33(-Cdot); - m_impulse += df; - - if (m_limitState == e_atLowerLimit) - { - m_impulse.z = b2Max(m_impulse.z, 0.0f); - } - else if (m_limitState == e_atUpperLimit) - { - m_impulse.z = b2Min(m_impulse.z, 0.0f); - } - - // f2(1:2) = invK(1:2,1:2) * (-Cdot(1:2) - K(1:2,3) * (f2(3) - f1(3))) + f1(1:2) - b2Vec2 b = -Cdot1 - (m_impulse.z - f1.z) * b2Vec2(m_K.ez.x, m_K.ez.y); - b2Vec2 f2r = m_K.Solve22(b) + b2Vec2(f1.x, f1.y); - m_impulse.x = f2r.x; - m_impulse.y = f2r.y; - - df = m_impulse - f1; - - b2Vec2 P = df.x * m_perp + df.z * m_axis; - float32 LA = df.x * m_s1 + df.y + df.z * m_a1; - float32 LB = df.x * m_s2 + df.y + df.z * m_a2; - - vA -= mA * P; - wA -= iA * LA; - - vB += mB * P; - wB += iB * LB; - } - else - { - // Limit is inactive, just solve the prismatic constraint in block form. - b2Vec2 df = m_K.Solve22(-Cdot1); - m_impulse.x += df.x; - m_impulse.y += df.y; - - b2Vec2 P = df.x * m_perp; - float32 LA = df.x * m_s1 + df.y; - float32 LB = df.x * m_s2 + df.y; - - vA -= mA * P; - wA -= iA * LA; - - vB += mB * P; - wB += iB * LB; - - b2Vec2 Cdot10 = Cdot1; - - Cdot1.x = b2Dot(m_perp, vB - vA) + m_s2 * wB - m_s1 * wA; - Cdot1.y = wB - wA; - - if (b2Abs(Cdot1.x) > 0.01f || b2Abs(Cdot1.y) > 0.01f) - { - b2Vec2 test = b2Mul22(m_K, df); - Cdot1.x += 0.0f; - } - } - - data.velocities[m_indexA].v = vA; - data.velocities[m_indexA].w = wA; - data.velocities[m_indexB].v = vB; - data.velocities[m_indexB].w = wB; -} - -bool b2PrismaticJoint::SolvePositionConstraints(const b2SolverData& data) -{ - b2Vec2 cA = data.positions[m_indexA].c; - float32 aA = data.positions[m_indexA].a; - b2Vec2 cB = data.positions[m_indexB].c; - float32 aB = data.positions[m_indexB].a; - - b2Rot qA(aA), qB(aB); - - float32 mA = m_invMassA, mB = m_invMassB; - float32 iA = m_invIA, iB = m_invIB; - - // Compute fresh Jacobians - b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA); - b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB); - b2Vec2 d = cB + rB - cA - rA; - - b2Vec2 axis = b2Mul(qA, m_localXAxisA); - float32 a1 = b2Cross(d + rA, axis); - float32 a2 = b2Cross(rB, axis); - b2Vec2 perp = b2Mul(qA, m_localYAxisA); - - float32 s1 = b2Cross(d + rA, perp); - float32 s2 = b2Cross(rB, perp); - - b2Vec3 impulse; - b2Vec2 C1; - C1.x = b2Dot(perp, d); - C1.y = aB - aA - m_referenceAngle; - - float32 linearError = b2Abs(C1.x); - float32 angularError = b2Abs(C1.y); - - bool active = false; - float32 C2 = 0.0f; - if (m_enableLimit) - { - float32 translation = b2Dot(axis, d); - if (b2Abs(m_upperTranslation - m_lowerTranslation) < 2.0f * b2_linearSlop) - { - // Prevent large angular corrections - C2 = b2Clamp(translation, -b2_maxLinearCorrection, b2_maxLinearCorrection); - linearError = b2Max(linearError, b2Abs(translation)); - active = true; - } - else if (translation <= m_lowerTranslation) - { - // Prevent large linear corrections and allow some slop. - C2 = b2Clamp(translation - m_lowerTranslation + b2_linearSlop, -b2_maxLinearCorrection, 0.0f); - linearError = b2Max(linearError, m_lowerTranslation - translation); - active = true; - } - else if (translation >= m_upperTranslation) - { - // Prevent large linear corrections and allow some slop. - C2 = b2Clamp(translation - m_upperTranslation - b2_linearSlop, 0.0f, b2_maxLinearCorrection); - linearError = b2Max(linearError, translation - m_upperTranslation); - active = true; - } - } - - if (active) - { - float32 k11 = mA + mB + iA * s1 * s1 + iB * s2 * s2; - float32 k12 = iA * s1 + iB * s2; - float32 k13 = iA * s1 * a1 + iB * s2 * a2; - float32 k22 = iA + iB; - if (k22 == 0.0f) - { - // For fixed rotation - k22 = 1.0f; - } - float32 k23 = iA * a1 + iB * a2; - float32 k33 = mA + mB + iA * a1 * a1 + iB * a2 * a2; - - b2Mat33 K; - K.ex.Set(k11, k12, k13); - K.ey.Set(k12, k22, k23); - K.ez.Set(k13, k23, k33); - - b2Vec3 C; - C.x = C1.x; - C.y = C1.y; - C.z = C2; - - impulse = K.Solve33(-C); - } - else - { - float32 k11 = mA + mB + iA * s1 * s1 + iB * s2 * s2; - float32 k12 = iA * s1 + iB * s2; - float32 k22 = iA + iB; - if (k22 == 0.0f) - { - k22 = 1.0f; - } - - b2Mat22 K; - K.ex.Set(k11, k12); - K.ey.Set(k12, k22); - - b2Vec2 impulse1 = K.Solve(-C1); - impulse.x = impulse1.x; - impulse.y = impulse1.y; - impulse.z = 0.0f; - } - - b2Vec2 P = impulse.x * perp + impulse.z * axis; - float32 LA = impulse.x * s1 + impulse.y + impulse.z * a1; - float32 LB = impulse.x * s2 + impulse.y + impulse.z * a2; - - cA -= mA * P; - aA -= iA * LA; - cB += mB * P; - aB += iB * LB; - - data.positions[m_indexA].c = cA; - data.positions[m_indexA].a = aA; - data.positions[m_indexB].c = cB; - data.positions[m_indexB].a = aB; - - return linearError <= b2_linearSlop && angularError <= b2_angularSlop; -} - -b2Vec2 b2PrismaticJoint::GetAnchorA() const -{ - return m_bodyA->GetWorldPoint(m_localAnchorA); -} - -b2Vec2 b2PrismaticJoint::GetAnchorB() const -{ - return m_bodyB->GetWorldPoint(m_localAnchorB); -} - -b2Vec2 b2PrismaticJoint::GetReactionForce(float32 inv_dt) const -{ - return inv_dt * (m_impulse.x * m_perp + (m_motorImpulse + m_impulse.z) * m_axis); -} - -float32 b2PrismaticJoint::GetReactionTorque(float32 inv_dt) const -{ - return inv_dt * m_impulse.y; -} - -float32 b2PrismaticJoint::GetJointTranslation() const -{ - b2Vec2 pA = m_bodyA->GetWorldPoint(m_localAnchorA); - b2Vec2 pB = m_bodyB->GetWorldPoint(m_localAnchorB); - b2Vec2 d = pB - pA; - b2Vec2 axis = m_bodyA->GetWorldVector(m_localXAxisA); - - float32 translation = b2Dot(d, axis); - return translation; -} - -float32 b2PrismaticJoint::GetJointSpeed() const -{ - b2Body* bA = m_bodyA; - b2Body* bB = m_bodyB; - - b2Vec2 rA = b2Mul(bA->m_xf.q, m_localAnchorA - bA->m_sweep.localCenter); - b2Vec2 rB = b2Mul(bB->m_xf.q, m_localAnchorB - bB->m_sweep.localCenter); - b2Vec2 p1 = bA->m_sweep.c + rA; - b2Vec2 p2 = bB->m_sweep.c + rB; - b2Vec2 d = p2 - p1; - b2Vec2 axis = b2Mul(bA->m_xf.q, m_localXAxisA); - - b2Vec2 vA = bA->m_linearVelocity; - b2Vec2 vB = bB->m_linearVelocity; - float32 wA = bA->m_angularVelocity; - float32 wB = bB->m_angularVelocity; - - float32 speed = b2Dot(d, b2Cross(wA, axis)) + b2Dot(axis, vB + b2Cross(wB, rB) - vA - b2Cross(wA, rA)); - return speed; -} - -bool b2PrismaticJoint::IsLimitEnabled() const -{ - return m_enableLimit; -} - -void b2PrismaticJoint::EnableLimit(bool flag) -{ - if (flag != m_enableLimit) - { - m_bodyA->SetAwake(true); - m_bodyB->SetAwake(true); - m_enableLimit = flag; - m_impulse.z = 0.0f; - } -} - -float32 b2PrismaticJoint::GetLowerLimit() const -{ - return m_lowerTranslation; -} - -float32 b2PrismaticJoint::GetUpperLimit() const -{ - return m_upperTranslation; -} - -void b2PrismaticJoint::SetLimits(float32 lower, float32 upper) -{ - b2Assert(lower <= upper); - if (lower != m_lowerTranslation || upper != m_upperTranslation) - { - m_bodyA->SetAwake(true); - m_bodyB->SetAwake(true); - m_lowerTranslation = lower; - m_upperTranslation = upper; - m_impulse.z = 0.0f; - } -} - -bool b2PrismaticJoint::IsMotorEnabled() const -{ - return m_enableMotor; -} - -void b2PrismaticJoint::EnableMotor(bool flag) -{ - m_bodyA->SetAwake(true); - m_bodyB->SetAwake(true); - m_enableMotor = flag; -} - -void b2PrismaticJoint::SetMotorSpeed(float32 speed) -{ - m_bodyA->SetAwake(true); - m_bodyB->SetAwake(true); - m_motorSpeed = speed; -} - -void b2PrismaticJoint::SetMaxMotorForce(float32 force) -{ - m_bodyA->SetAwake(true); - m_bodyB->SetAwake(true); - m_maxMotorForce = force; -} - -float32 b2PrismaticJoint::GetMotorForce(float32 inv_dt) const -{ - return inv_dt * m_motorImpulse; -} - -void b2PrismaticJoint::Dump() -{ - int32 indexA = m_bodyA->m_islandIndex; - int32 indexB = m_bodyB->m_islandIndex; - - b2Log(" b2PrismaticJointDef jd;\n"); - b2Log(" jd.bodyA = bodies[%d];\n", indexA); - b2Log(" jd.bodyB = bodies[%d];\n", indexB); - b2Log(" jd.collideConnected = bool(%d);\n", m_collideConnected); - b2Log(" jd.localAnchorA.Set(%.15lef, %.15lef);\n", m_localAnchorA.x, m_localAnchorA.y); - b2Log(" jd.localAnchorB.Set(%.15lef, %.15lef);\n", m_localAnchorB.x, m_localAnchorB.y); - b2Log(" jd.localAxisA.Set(%.15lef, %.15lef);\n", m_localXAxisA.x, m_localXAxisA.y); - b2Log(" jd.referenceAngle = %.15lef;\n", m_referenceAngle); - b2Log(" jd.enableLimit = bool(%d);\n", m_enableLimit); - b2Log(" jd.lowerTranslation = %.15lef;\n", m_lowerTranslation); - b2Log(" jd.upperTranslation = %.15lef;\n", m_upperTranslation); - b2Log(" jd.enableMotor = bool(%d);\n", m_enableMotor); - b2Log(" jd.motorSpeed = %.15lef;\n", m_motorSpeed); - b2Log(" jd.maxMotorForce = %.15lef;\n", m_maxMotorForce); - b2Log(" joints[%d] = m_world->CreateJoint(&jd);\n", m_index); -} diff --git a/external/box2d/Dynamics/Joints/b2PrismaticJoint.h b/external/box2d/Dynamics/Joints/b2PrismaticJoint.h deleted file mode 100644 index aca2859b45..0000000000 --- a/external/box2d/Dynamics/Joints/b2PrismaticJoint.h +++ /dev/null @@ -1,196 +0,0 @@ -/* -* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_PRISMATIC_JOINT_H -#define B2_PRISMATIC_JOINT_H - -#include - -/// Prismatic joint definition. This requires defining a line of -/// motion using an axis and an anchor point. The definition uses local -/// anchor points and a local axis so that the initial configuration -/// can violate the constraint slightly. The joint translation is zero -/// when the local anchor points coincide in world space. Using local -/// anchors and a local axis helps when saving and loading a game. -struct b2PrismaticJointDef : public b2JointDef -{ - b2PrismaticJointDef() - { - type = e_prismaticJoint; - localAnchorA.SetZero(); - localAnchorB.SetZero(); - localAxisA.Set(1.0f, 0.0f); - referenceAngle = 0.0f; - enableLimit = false; - lowerTranslation = 0.0f; - upperTranslation = 0.0f; - enableMotor = false; - maxMotorForce = 0.0f; - motorSpeed = 0.0f; - } - - /// Initialize the bodies, anchors, axis, and reference angle using the world - /// anchor and unit world axis. - void Initialize(b2Body* bodyA, b2Body* bodyB, const b2Vec2& anchor, const b2Vec2& axis); - - /// The local anchor point relative to bodyA's origin. - b2Vec2 localAnchorA; - - /// The local anchor point relative to bodyB's origin. - b2Vec2 localAnchorB; - - /// The local translation unit axis in bodyA. - b2Vec2 localAxisA; - - /// The constrained angle between the bodies: bodyB_angle - bodyA_angle. - float32 referenceAngle; - - /// Enable/disable the joint limit. - bool enableLimit; - - /// The lower translation limit, usually in meters. - float32 lowerTranslation; - - /// The upper translation limit, usually in meters. - float32 upperTranslation; - - /// Enable/disable the joint motor. - bool enableMotor; - - /// The maximum motor torque, usually in N-m. - float32 maxMotorForce; - - /// The desired motor speed in radians per second. - float32 motorSpeed; -}; - -/// A prismatic joint. This joint provides one degree of freedom: translation -/// along an axis fixed in bodyA. Relative rotation is prevented. You can -/// use a joint limit to restrict the range of motion and a joint motor to -/// drive the motion or to model joint friction. -class b2PrismaticJoint : public b2Joint -{ -public: - b2Vec2 GetAnchorA() const; - b2Vec2 GetAnchorB() const; - - b2Vec2 GetReactionForce(float32 inv_dt) const; - float32 GetReactionTorque(float32 inv_dt) const; - - /// The local anchor point relative to bodyA's origin. - const b2Vec2& GetLocalAnchorA() const { return m_localAnchorA; } - - /// The local anchor point relative to bodyB's origin. - const b2Vec2& GetLocalAnchorB() const { return m_localAnchorB; } - - /// The local joint axis relative to bodyA. - const b2Vec2& GetLocalAxisA() const { return m_localXAxisA; } - - /// Get the reference angle. - float32 GetReferenceAngle() const { return m_referenceAngle; } - - /// Get the current joint translation, usually in meters. - float32 GetJointTranslation() const; - - /// Get the current joint translation speed, usually in meters per second. - float32 GetJointSpeed() const; - - /// Is the joint limit enabled? - bool IsLimitEnabled() const; - - /// Enable/disable the joint limit. - void EnableLimit(bool flag); - - /// Get the lower joint limit, usually in meters. - float32 GetLowerLimit() const; - - /// Get the upper joint limit, usually in meters. - float32 GetUpperLimit() const; - - /// Set the joint limits, usually in meters. - void SetLimits(float32 lower, float32 upper); - - /// Is the joint motor enabled? - bool IsMotorEnabled() const; - - /// Enable/disable the joint motor. - void EnableMotor(bool flag); - - /// Set the motor speed, usually in meters per second. - void SetMotorSpeed(float32 speed); - - /// Get the motor speed, usually in meters per second. - float32 GetMotorSpeed() const; - - /// Set the maximum motor force, usually in N. - void SetMaxMotorForce(float32 force); - float32 GetMaxMotorForce() const { return m_maxMotorForce; } - - /// Get the current motor force given the inverse time step, usually in N. - float32 GetMotorForce(float32 inv_dt) const; - - /// Dump to b2Log - void Dump(); - -protected: - friend class b2Joint; - friend class b2GearJoint; - b2PrismaticJoint(const b2PrismaticJointDef* def); - - void InitVelocityConstraints(const b2SolverData& data); - void SolveVelocityConstraints(const b2SolverData& data); - bool SolvePositionConstraints(const b2SolverData& data); - - // Solver shared - b2Vec2 m_localAnchorA; - b2Vec2 m_localAnchorB; - b2Vec2 m_localXAxisA; - b2Vec2 m_localYAxisA; - float32 m_referenceAngle; - b2Vec3 m_impulse; - float32 m_motorImpulse; - float32 m_lowerTranslation; - float32 m_upperTranslation; - float32 m_maxMotorForce; - float32 m_motorSpeed; - bool m_enableLimit; - bool m_enableMotor; - b2LimitState m_limitState; - - // Solver temp - int32 m_indexA; - int32 m_indexB; - b2Vec2 m_localCenterA; - b2Vec2 m_localCenterB; - float32 m_invMassA; - float32 m_invMassB; - float32 m_invIA; - float32 m_invIB; - b2Vec2 m_axis, m_perp; - float32 m_s1, m_s2; - float32 m_a1, m_a2; - b2Mat33 m_K; - float32 m_motorMass; -}; - -inline float32 b2PrismaticJoint::GetMotorSpeed() const -{ - return m_motorSpeed; -} - -#endif diff --git a/external/box2d/Dynamics/Joints/b2PulleyJoint.cpp b/external/box2d/Dynamics/Joints/b2PulleyJoint.cpp deleted file mode 100644 index da30fae222..0000000000 --- a/external/box2d/Dynamics/Joints/b2PulleyJoint.cpp +++ /dev/null @@ -1,332 +0,0 @@ -/* -* Copyright (c) 2007 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include - -// Pulley: -// length1 = norm(p1 - s1) -// length2 = norm(p2 - s2) -// C0 = (length1 + ratio * length2)_initial -// C = C0 - (length1 + ratio * length2) -// u1 = (p1 - s1) / norm(p1 - s1) -// u2 = (p2 - s2) / norm(p2 - s2) -// Cdot = -dot(u1, v1 + cross(w1, r1)) - ratio * dot(u2, v2 + cross(w2, r2)) -// J = -[u1 cross(r1, u1) ratio * u2 ratio * cross(r2, u2)] -// K = J * invM * JT -// = invMass1 + invI1 * cross(r1, u1)^2 + ratio^2 * (invMass2 + invI2 * cross(r2, u2)^2) - -void b2PulleyJointDef::Initialize(b2Body* bA, b2Body* bB, - const b2Vec2& groundA, const b2Vec2& groundB, - const b2Vec2& anchorA, const b2Vec2& anchorB, - float32 r) -{ - bodyA = bA; - bodyB = bB; - groundAnchorA = groundA; - groundAnchorB = groundB; - localAnchorA = bodyA->GetLocalPoint(anchorA); - localAnchorB = bodyB->GetLocalPoint(anchorB); - b2Vec2 dA = anchorA - groundA; - lengthA = dA.Length(); - b2Vec2 dB = anchorB - groundB; - lengthB = dB.Length(); - ratio = r; - b2Assert(ratio > b2_epsilon); -} - -b2PulleyJoint::b2PulleyJoint(const b2PulleyJointDef* def) -: b2Joint(def) -{ - m_groundAnchorA = def->groundAnchorA; - m_groundAnchorB = def->groundAnchorB; - m_localAnchorA = def->localAnchorA; - m_localAnchorB = def->localAnchorB; - - m_lengthA = def->lengthA; - m_lengthB = def->lengthB; - - b2Assert(def->ratio != 0.0f); - m_ratio = def->ratio; - - m_constant = def->lengthA + m_ratio * def->lengthB; - - m_impulse = 0.0f; -} - -void b2PulleyJoint::InitVelocityConstraints(const b2SolverData& data) -{ - m_indexA = m_bodyA->m_islandIndex; - m_indexB = m_bodyB->m_islandIndex; - m_localCenterA = m_bodyA->m_sweep.localCenter; - m_localCenterB = m_bodyB->m_sweep.localCenter; - m_invMassA = m_bodyA->m_invMass; - m_invMassB = m_bodyB->m_invMass; - m_invIA = m_bodyA->m_invI; - m_invIB = m_bodyB->m_invI; - - b2Vec2 cA = data.positions[m_indexA].c; - float32 aA = data.positions[m_indexA].a; - b2Vec2 vA = data.velocities[m_indexA].v; - float32 wA = data.velocities[m_indexA].w; - - b2Vec2 cB = data.positions[m_indexB].c; - float32 aB = data.positions[m_indexB].a; - b2Vec2 vB = data.velocities[m_indexB].v; - float32 wB = data.velocities[m_indexB].w; - - b2Rot qA(aA), qB(aB); - - m_rA = b2Mul(qA, m_localAnchorA - m_localCenterA); - m_rB = b2Mul(qB, m_localAnchorB - m_localCenterB); - - // Get the pulley axes. - m_uA = cA + m_rA - m_groundAnchorA; - m_uB = cB + m_rB - m_groundAnchorB; - - float32 lengthA = m_uA.Length(); - float32 lengthB = m_uB.Length(); - - if (lengthA > 10.0f * b2_linearSlop) - { - m_uA *= 1.0f / lengthA; - } - else - { - m_uA.SetZero(); - } - - if (lengthB > 10.0f * b2_linearSlop) - { - m_uB *= 1.0f / lengthB; - } - else - { - m_uB.SetZero(); - } - - // Compute effective mass. - float32 ruA = b2Cross(m_rA, m_uA); - float32 ruB = b2Cross(m_rB, m_uB); - - float32 mA = m_invMassA + m_invIA * ruA * ruA; - float32 mB = m_invMassB + m_invIB * ruB * ruB; - - m_mass = mA + m_ratio * m_ratio * mB; - - if (m_mass > 0.0f) - { - m_mass = 1.0f / m_mass; - } - - if (data.step.warmStarting) - { - // Scale impulses to support variable time steps. - m_impulse *= data.step.dtRatio; - - // Warm starting. - b2Vec2 PA = -(m_impulse) * m_uA; - b2Vec2 PB = (-m_ratio * m_impulse) * m_uB; - - vA += m_invMassA * PA; - wA += m_invIA * b2Cross(m_rA, PA); - vB += m_invMassB * PB; - wB += m_invIB * b2Cross(m_rB, PB); - } - else - { - m_impulse = 0.0f; - } - - data.velocities[m_indexA].v = vA; - data.velocities[m_indexA].w = wA; - data.velocities[m_indexB].v = vB; - data.velocities[m_indexB].w = wB; -} - -void b2PulleyJoint::SolveVelocityConstraints(const b2SolverData& data) -{ - b2Vec2 vA = data.velocities[m_indexA].v; - float32 wA = data.velocities[m_indexA].w; - b2Vec2 vB = data.velocities[m_indexB].v; - float32 wB = data.velocities[m_indexB].w; - - b2Vec2 vpA = vA + b2Cross(wA, m_rA); - b2Vec2 vpB = vB + b2Cross(wB, m_rB); - - float32 Cdot = -b2Dot(m_uA, vpA) - m_ratio * b2Dot(m_uB, vpB); - float32 impulse = -m_mass * Cdot; - m_impulse += impulse; - - b2Vec2 PA = -impulse * m_uA; - b2Vec2 PB = -m_ratio * impulse * m_uB; - vA += m_invMassA * PA; - wA += m_invIA * b2Cross(m_rA, PA); - vB += m_invMassB * PB; - wB += m_invIB * b2Cross(m_rB, PB); - - data.velocities[m_indexA].v = vA; - data.velocities[m_indexA].w = wA; - data.velocities[m_indexB].v = vB; - data.velocities[m_indexB].w = wB; -} - -bool b2PulleyJoint::SolvePositionConstraints(const b2SolverData& data) -{ - b2Vec2 cA = data.positions[m_indexA].c; - float32 aA = data.positions[m_indexA].a; - b2Vec2 cB = data.positions[m_indexB].c; - float32 aB = data.positions[m_indexB].a; - - b2Rot qA(aA), qB(aB); - - b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA); - b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB); - - // Get the pulley axes. - b2Vec2 uA = cA + rA - m_groundAnchorA; - b2Vec2 uB = cB + rB - m_groundAnchorB; - - float32 lengthA = uA.Length(); - float32 lengthB = uB.Length(); - - if (lengthA > 10.0f * b2_linearSlop) - { - uA *= 1.0f / lengthA; - } - else - { - uA.SetZero(); - } - - if (lengthB > 10.0f * b2_linearSlop) - { - uB *= 1.0f / lengthB; - } - else - { - uB.SetZero(); - } - - // Compute effective mass. - float32 ruA = b2Cross(rA, uA); - float32 ruB = b2Cross(rB, uB); - - float32 mA = m_invMassA + m_invIA * ruA * ruA; - float32 mB = m_invMassB + m_invIB * ruB * ruB; - - float32 mass = mA + m_ratio * m_ratio * mB; - - if (mass > 0.0f) - { - mass = 1.0f / mass; - } - - float32 C = m_constant - lengthA - m_ratio * lengthB; - float32 linearError = b2Abs(C); - - float32 impulse = -mass * C; - - b2Vec2 PA = -impulse * uA; - b2Vec2 PB = -m_ratio * impulse * uB; - - cA += m_invMassA * PA; - aA += m_invIA * b2Cross(rA, PA); - cB += m_invMassB * PB; - aB += m_invIB * b2Cross(rB, PB); - - data.positions[m_indexA].c = cA; - data.positions[m_indexA].a = aA; - data.positions[m_indexB].c = cB; - data.positions[m_indexB].a = aB; - - return linearError < b2_linearSlop; -} - -b2Vec2 b2PulleyJoint::GetAnchorA() const -{ - return m_bodyA->GetWorldPoint(m_localAnchorA); -} - -b2Vec2 b2PulleyJoint::GetAnchorB() const -{ - return m_bodyB->GetWorldPoint(m_localAnchorB); -} - -b2Vec2 b2PulleyJoint::GetReactionForce(float32 inv_dt) const -{ - b2Vec2 P = m_impulse * m_uB; - return inv_dt * P; -} - -float32 b2PulleyJoint::GetReactionTorque(float32 inv_dt) const -{ - B2_NOT_USED(inv_dt); - return 0.0f; -} - -b2Vec2 b2PulleyJoint::GetGroundAnchorA() const -{ - return m_groundAnchorA; -} - -b2Vec2 b2PulleyJoint::GetGroundAnchorB() const -{ - return m_groundAnchorB; -} - -float32 b2PulleyJoint::GetLengthA() const -{ - b2Vec2 p = m_bodyA->GetWorldPoint(m_localAnchorA); - b2Vec2 s = m_groundAnchorA; - b2Vec2 d = p - s; - return d.Length(); -} - -float32 b2PulleyJoint::GetLengthB() const -{ - b2Vec2 p = m_bodyB->GetWorldPoint(m_localAnchorB); - b2Vec2 s = m_groundAnchorB; - b2Vec2 d = p - s; - return d.Length(); -} - -float32 b2PulleyJoint::GetRatio() const -{ - return m_ratio; -} - -void b2PulleyJoint::Dump() -{ - int32 indexA = m_bodyA->m_islandIndex; - int32 indexB = m_bodyB->m_islandIndex; - - b2Log(" b2PulleyJointDef jd;\n"); - b2Log(" jd.bodyA = bodies[%d];\n", indexA); - b2Log(" jd.bodyB = bodies[%d];\n", indexB); - b2Log(" jd.collideConnected = bool(%d);\n", m_collideConnected); - b2Log(" jd.groundAnchorA.Set(%.15lef, %.15lef);\n", m_groundAnchorA.x, m_groundAnchorA.y); - b2Log(" jd.groundAnchorB.Set(%.15lef, %.15lef);\n", m_groundAnchorB.x, m_groundAnchorB.y); - b2Log(" jd.localAnchorA.Set(%.15lef, %.15lef);\n", m_localAnchorA.x, m_localAnchorA.y); - b2Log(" jd.localAnchorB.Set(%.15lef, %.15lef);\n", m_localAnchorB.x, m_localAnchorB.y); - b2Log(" jd.lengthA = %.15lef;\n", m_lengthA); - b2Log(" jd.lengthB = %.15lef;\n", m_lengthB); - b2Log(" jd.ratio = %.15lef;\n", m_ratio); - b2Log(" joints[%d] = m_world->CreateJoint(&jd);\n", m_index); -} diff --git a/external/box2d/Dynamics/Joints/b2PulleyJoint.h b/external/box2d/Dynamics/Joints/b2PulleyJoint.h deleted file mode 100644 index 2f6df4395c..0000000000 --- a/external/box2d/Dynamics/Joints/b2PulleyJoint.h +++ /dev/null @@ -1,143 +0,0 @@ -/* -* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_PULLEY_JOINT_H -#define B2_PULLEY_JOINT_H - -#include - -const float32 b2_minPulleyLength = 2.0f; - -/// Pulley joint definition. This requires two ground anchors, -/// two dynamic body anchor points, and a pulley ratio. -struct b2PulleyJointDef : public b2JointDef -{ - b2PulleyJointDef() - { - type = e_pulleyJoint; - groundAnchorA.Set(-1.0f, 1.0f); - groundAnchorB.Set(1.0f, 1.0f); - localAnchorA.Set(-1.0f, 0.0f); - localAnchorB.Set(1.0f, 0.0f); - lengthA = 0.0f; - lengthB = 0.0f; - ratio = 1.0f; - collideConnected = true; - } - - /// Initialize the bodies, anchors, lengths, max lengths, and ratio using the world anchors. - void Initialize(b2Body* bodyA, b2Body* bodyB, - const b2Vec2& groundAnchorA, const b2Vec2& groundAnchorB, - const b2Vec2& anchorA, const b2Vec2& anchorB, - float32 ratio); - - /// The first ground anchor in world coordinates. This point never moves. - b2Vec2 groundAnchorA; - - /// The second ground anchor in world coordinates. This point never moves. - b2Vec2 groundAnchorB; - - /// The local anchor point relative to bodyA's origin. - b2Vec2 localAnchorA; - - /// The local anchor point relative to bodyB's origin. - b2Vec2 localAnchorB; - - /// The a reference length for the segment attached to bodyA. - float32 lengthA; - - /// The a reference length for the segment attached to bodyB. - float32 lengthB; - - /// The pulley ratio, used to simulate a block-and-tackle. - float32 ratio; -}; - -/// The pulley joint is connected to two bodies and two fixed ground points. -/// The pulley supports a ratio such that: -/// length1 + ratio * length2 <= constant -/// Yes, the force transmitted is scaled by the ratio. -/// Warning: the pulley joint can get a bit squirrelly by itself. They often -/// work better when combined with prismatic joints. You should also cover the -/// the anchor points with static shapes to prevent one side from going to -/// zero length. -class b2PulleyJoint : public b2Joint -{ -public: - b2Vec2 GetAnchorA() const; - b2Vec2 GetAnchorB() const; - - b2Vec2 GetReactionForce(float32 inv_dt) const; - float32 GetReactionTorque(float32 inv_dt) const; - - /// Get the first ground anchor. - b2Vec2 GetGroundAnchorA() const; - - /// Get the second ground anchor. - b2Vec2 GetGroundAnchorB() const; - - /// Get the current length of the segment attached to bodyA. - float32 GetLengthA() const; - - /// Get the current length of the segment attached to bodyB. - float32 GetLengthB() const; - - /// Get the pulley ratio. - float32 GetRatio() const; - - /// Dump joint to dmLog - void Dump(); - -protected: - - friend class b2Joint; - b2PulleyJoint(const b2PulleyJointDef* data); - - void InitVelocityConstraints(const b2SolverData& data); - void SolveVelocityConstraints(const b2SolverData& data); - bool SolvePositionConstraints(const b2SolverData& data); - - b2Vec2 m_groundAnchorA; - b2Vec2 m_groundAnchorB; - float32 m_lengthA; - float32 m_lengthB; - - // Solver shared - b2Vec2 m_localAnchorA; - b2Vec2 m_localAnchorB; - float32 m_constant; - float32 m_ratio; - float32 m_impulse; - - // Solver temp - int32 m_indexA; - int32 m_indexB; - b2Vec2 m_uA; - b2Vec2 m_uB; - b2Vec2 m_rA; - b2Vec2 m_rB; - b2Vec2 m_localCenterA; - b2Vec2 m_localCenterB; - float32 m_invMassA; - float32 m_invMassB; - float32 m_invIA; - float32 m_invIB; - float32 m_mass; -}; - -#endif diff --git a/external/box2d/Dynamics/Joints/b2RevoluteJoint.cpp b/external/box2d/Dynamics/Joints/b2RevoluteJoint.cpp deleted file mode 100644 index e265d8192b..0000000000 --- a/external/box2d/Dynamics/Joints/b2RevoluteJoint.cpp +++ /dev/null @@ -1,504 +0,0 @@ -/* -* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include - -// Point-to-point constraint -// C = p2 - p1 -// Cdot = v2 - v1 -// = v2 + cross(w2, r2) - v1 - cross(w1, r1) -// J = [-I -r1_skew I r2_skew ] -// Identity used: -// w k % (rx i + ry j) = w * (-ry i + rx j) - -// Motor constraint -// Cdot = w2 - w1 -// J = [0 0 -1 0 0 1] -// K = invI1 + invI2 - -void b2RevoluteJointDef::Initialize(b2Body* bA, b2Body* bB, const b2Vec2& anchor) -{ - bodyA = bA; - bodyB = bB; - localAnchorA = bodyA->GetLocalPoint(anchor); - localAnchorB = bodyB->GetLocalPoint(anchor); - referenceAngle = bodyB->GetAngle() - bodyA->GetAngle(); -} - -b2RevoluteJoint::b2RevoluteJoint(const b2RevoluteJointDef* def) -: b2Joint(def) -{ - m_localAnchorA = def->localAnchorA; - m_localAnchorB = def->localAnchorB; - m_referenceAngle = def->referenceAngle; - - m_impulse.SetZero(); - m_motorImpulse = 0.0f; - - m_lowerAngle = def->lowerAngle; - m_upperAngle = def->upperAngle; - m_maxMotorTorque = def->maxMotorTorque; - m_motorSpeed = def->motorSpeed; - m_enableLimit = def->enableLimit; - m_enableMotor = def->enableMotor; - m_limitState = e_inactiveLimit; -} - -void b2RevoluteJoint::InitVelocityConstraints(const b2SolverData& data) -{ - m_indexA = m_bodyA->m_islandIndex; - m_indexB = m_bodyB->m_islandIndex; - m_localCenterA = m_bodyA->m_sweep.localCenter; - m_localCenterB = m_bodyB->m_sweep.localCenter; - m_invMassA = m_bodyA->m_invMass; - m_invMassB = m_bodyB->m_invMass; - m_invIA = m_bodyA->m_invI; - m_invIB = m_bodyB->m_invI; - - b2Vec2 cA = data.positions[m_indexA].c; - float32 aA = data.positions[m_indexA].a; - b2Vec2 vA = data.velocities[m_indexA].v; - float32 wA = data.velocities[m_indexA].w; - - b2Vec2 cB = data.positions[m_indexB].c; - float32 aB = data.positions[m_indexB].a; - b2Vec2 vB = data.velocities[m_indexB].v; - float32 wB = data.velocities[m_indexB].w; - - b2Rot qA(aA), qB(aB); - - m_rA = b2Mul(qA, m_localAnchorA - m_localCenterA); - m_rB = b2Mul(qB, m_localAnchorB - m_localCenterB); - - // J = [-I -r1_skew I r2_skew] - // [ 0 -1 0 1] - // r_skew = [-ry; rx] - - // Matlab - // K = [ mA+r1y^2*iA+mB+r2y^2*iB, -r1y*iA*r1x-r2y*iB*r2x, -r1y*iA-r2y*iB] - // [ -r1y*iA*r1x-r2y*iB*r2x, mA+r1x^2*iA+mB+r2x^2*iB, r1x*iA+r2x*iB] - // [ -r1y*iA-r2y*iB, r1x*iA+r2x*iB, iA+iB] - - float32 mA = m_invMassA, mB = m_invMassB; - float32 iA = m_invIA, iB = m_invIB; - - bool fixedRotation = (iA + iB == 0.0f); - - m_mass.ex.x = mA + mB + m_rA.y * m_rA.y * iA + m_rB.y * m_rB.y * iB; - m_mass.ey.x = -m_rA.y * m_rA.x * iA - m_rB.y * m_rB.x * iB; - m_mass.ez.x = -m_rA.y * iA - m_rB.y * iB; - m_mass.ex.y = m_mass.ey.x; - m_mass.ey.y = mA + mB + m_rA.x * m_rA.x * iA + m_rB.x * m_rB.x * iB; - m_mass.ez.y = m_rA.x * iA + m_rB.x * iB; - m_mass.ex.z = m_mass.ez.x; - m_mass.ey.z = m_mass.ez.y; - m_mass.ez.z = iA + iB; - - m_motorMass = iA + iB; - if (m_motorMass > 0.0f) - { - m_motorMass = 1.0f / m_motorMass; - } - - if (m_enableMotor == false || fixedRotation) - { - m_motorImpulse = 0.0f; - } - - if (m_enableLimit && fixedRotation == false) - { - float32 jointAngle = aB - aA - m_referenceAngle; - if (b2Abs(m_upperAngle - m_lowerAngle) < 2.0f * b2_angularSlop) - { - m_limitState = e_equalLimits; - } - else if (jointAngle <= m_lowerAngle) - { - if (m_limitState != e_atLowerLimit) - { - m_impulse.z = 0.0f; - } - m_limitState = e_atLowerLimit; - } - else if (jointAngle >= m_upperAngle) - { - if (m_limitState != e_atUpperLimit) - { - m_impulse.z = 0.0f; - } - m_limitState = e_atUpperLimit; - } - else - { - m_limitState = e_inactiveLimit; - m_impulse.z = 0.0f; - } - } - else - { - m_limitState = e_inactiveLimit; - } - - if (data.step.warmStarting) - { - // Scale impulses to support a variable time step. - m_impulse *= data.step.dtRatio; - m_motorImpulse *= data.step.dtRatio; - - b2Vec2 P(m_impulse.x, m_impulse.y); - - vA -= mA * P; - wA -= iA * (b2Cross(m_rA, P) + m_motorImpulse + m_impulse.z); - - vB += mB * P; - wB += iB * (b2Cross(m_rB, P) + m_motorImpulse + m_impulse.z); - } - else - { - m_impulse.SetZero(); - m_motorImpulse = 0.0f; - } - - data.velocities[m_indexA].v = vA; - data.velocities[m_indexA].w = wA; - data.velocities[m_indexB].v = vB; - data.velocities[m_indexB].w = wB; -} - -void b2RevoluteJoint::SolveVelocityConstraints(const b2SolverData& data) -{ - b2Vec2 vA = data.velocities[m_indexA].v; - float32 wA = data.velocities[m_indexA].w; - b2Vec2 vB = data.velocities[m_indexB].v; - float32 wB = data.velocities[m_indexB].w; - - float32 mA = m_invMassA, mB = m_invMassB; - float32 iA = m_invIA, iB = m_invIB; - - bool fixedRotation = (iA + iB == 0.0f); - - // Solve motor constraint. - if (m_enableMotor && m_limitState != e_equalLimits && fixedRotation == false) - { - float32 Cdot = wB - wA - m_motorSpeed; - float32 impulse = -m_motorMass * Cdot; - float32 oldImpulse = m_motorImpulse; - float32 maxImpulse = data.step.dt * m_maxMotorTorque; - m_motorImpulse = b2Clamp(m_motorImpulse + impulse, -maxImpulse, maxImpulse); - impulse = m_motorImpulse - oldImpulse; - - wA -= iA * impulse; - wB += iB * impulse; - } - - // Solve limit constraint. - if (m_enableLimit && m_limitState != e_inactiveLimit && fixedRotation == false) - { - b2Vec2 Cdot1 = vB + b2Cross(wB, m_rB) - vA - b2Cross(wA, m_rA); - float32 Cdot2 = wB - wA; - b2Vec3 Cdot(Cdot1.x, Cdot1.y, Cdot2); - - b2Vec3 impulse = -m_mass.Solve33(Cdot); - - if (m_limitState == e_equalLimits) - { - m_impulse += impulse; - } - else if (m_limitState == e_atLowerLimit) - { - float32 newImpulse = m_impulse.z + impulse.z; - if (newImpulse < 0.0f) - { - b2Vec2 rhs = -Cdot1 + m_impulse.z * b2Vec2(m_mass.ez.x, m_mass.ez.y); - b2Vec2 reduced = m_mass.Solve22(rhs); - impulse.x = reduced.x; - impulse.y = reduced.y; - impulse.z = -m_impulse.z; - m_impulse.x += reduced.x; - m_impulse.y += reduced.y; - m_impulse.z = 0.0f; - } - else - { - m_impulse += impulse; - } - } - else if (m_limitState == e_atUpperLimit) - { - float32 newImpulse = m_impulse.z + impulse.z; - if (newImpulse > 0.0f) - { - b2Vec2 rhs = -Cdot1 + m_impulse.z * b2Vec2(m_mass.ez.x, m_mass.ez.y); - b2Vec2 reduced = m_mass.Solve22(rhs); - impulse.x = reduced.x; - impulse.y = reduced.y; - impulse.z = -m_impulse.z; - m_impulse.x += reduced.x; - m_impulse.y += reduced.y; - m_impulse.z = 0.0f; - } - else - { - m_impulse += impulse; - } - } - - b2Vec2 P(impulse.x, impulse.y); - - vA -= mA * P; - wA -= iA * (b2Cross(m_rA, P) + impulse.z); - - vB += mB * P; - wB += iB * (b2Cross(m_rB, P) + impulse.z); - } - else - { - // Solve point-to-point constraint - b2Vec2 Cdot = vB + b2Cross(wB, m_rB) - vA - b2Cross(wA, m_rA); - b2Vec2 impulse = m_mass.Solve22(-Cdot); - - m_impulse.x += impulse.x; - m_impulse.y += impulse.y; - - vA -= mA * impulse; - wA -= iA * b2Cross(m_rA, impulse); - - vB += mB * impulse; - wB += iB * b2Cross(m_rB, impulse); - } - - data.velocities[m_indexA].v = vA; - data.velocities[m_indexA].w = wA; - data.velocities[m_indexB].v = vB; - data.velocities[m_indexB].w = wB; -} - -bool b2RevoluteJoint::SolvePositionConstraints(const b2SolverData& data) -{ - b2Vec2 cA = data.positions[m_indexA].c; - float32 aA = data.positions[m_indexA].a; - b2Vec2 cB = data.positions[m_indexB].c; - float32 aB = data.positions[m_indexB].a; - - b2Rot qA(aA), qB(aB); - - float32 angularError = 0.0f; - float32 positionError = 0.0f; - - bool fixedRotation = (m_invIA + m_invIB == 0.0f); - - // Solve angular limit constraint. - if (m_enableLimit && m_limitState != e_inactiveLimit && fixedRotation == false) - { - float32 angle = aB - aA - m_referenceAngle; - float32 limitImpulse = 0.0f; - - if (m_limitState == e_equalLimits) - { - // Prevent large angular corrections - float32 C = b2Clamp(angle - m_lowerAngle, -b2_maxAngularCorrection, b2_maxAngularCorrection); - limitImpulse = -m_motorMass * C; - angularError = b2Abs(C); - } - else if (m_limitState == e_atLowerLimit) - { - float32 C = angle - m_lowerAngle; - angularError = -C; - - // Prevent large angular corrections and allow some slop. - C = b2Clamp(C + b2_angularSlop, -b2_maxAngularCorrection, 0.0f); - limitImpulse = -m_motorMass * C; - } - else if (m_limitState == e_atUpperLimit) - { - float32 C = angle - m_upperAngle; - angularError = C; - - // Prevent large angular corrections and allow some slop. - C = b2Clamp(C - b2_angularSlop, 0.0f, b2_maxAngularCorrection); - limitImpulse = -m_motorMass * C; - } - - aA -= m_invIA * limitImpulse; - aB += m_invIB * limitImpulse; - } - - // Solve point-to-point constraint. - { - qA.Set(aA); - qB.Set(aB); - b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA); - b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB); - - b2Vec2 C = cB + rB - cA - rA; - positionError = C.Length(); - - float32 mA = m_invMassA, mB = m_invMassB; - float32 iA = m_invIA, iB = m_invIB; - - b2Mat22 K; - K.ex.x = mA + mB + iA * rA.y * rA.y + iB * rB.y * rB.y; - K.ex.y = -iA * rA.x * rA.y - iB * rB.x * rB.y; - K.ey.x = K.ex.y; - K.ey.y = mA + mB + iA * rA.x * rA.x + iB * rB.x * rB.x; - - b2Vec2 impulse = -K.Solve(C); - - cA -= mA * impulse; - aA -= iA * b2Cross(rA, impulse); - - cB += mB * impulse; - aB += iB * b2Cross(rB, impulse); - } - - data.positions[m_indexA].c = cA; - data.positions[m_indexA].a = aA; - data.positions[m_indexB].c = cB; - data.positions[m_indexB].a = aB; - - return positionError <= b2_linearSlop && angularError <= b2_angularSlop; -} - -b2Vec2 b2RevoluteJoint::GetAnchorA() const -{ - return m_bodyA->GetWorldPoint(m_localAnchorA); -} - -b2Vec2 b2RevoluteJoint::GetAnchorB() const -{ - return m_bodyB->GetWorldPoint(m_localAnchorB); -} - -b2Vec2 b2RevoluteJoint::GetReactionForce(float32 inv_dt) const -{ - b2Vec2 P(m_impulse.x, m_impulse.y); - return inv_dt * P; -} - -float32 b2RevoluteJoint::GetReactionTorque(float32 inv_dt) const -{ - return inv_dt * m_impulse.z; -} - -float32 b2RevoluteJoint::GetJointAngle() const -{ - b2Body* bA = m_bodyA; - b2Body* bB = m_bodyB; - return bB->m_sweep.a - bA->m_sweep.a - m_referenceAngle; -} - -float32 b2RevoluteJoint::GetJointSpeed() const -{ - b2Body* bA = m_bodyA; - b2Body* bB = m_bodyB; - return bB->m_angularVelocity - bA->m_angularVelocity; -} - -bool b2RevoluteJoint::IsMotorEnabled() const -{ - return m_enableMotor; -} - -void b2RevoluteJoint::EnableMotor(bool flag) -{ - m_bodyA->SetAwake(true); - m_bodyB->SetAwake(true); - m_enableMotor = flag; -} - -float32 b2RevoluteJoint::GetMotorTorque(float32 inv_dt) const -{ - return inv_dt * m_motorImpulse; -} - -void b2RevoluteJoint::SetMotorSpeed(float32 speed) -{ - m_bodyA->SetAwake(true); - m_bodyB->SetAwake(true); - m_motorSpeed = speed; -} - -void b2RevoluteJoint::SetMaxMotorTorque(float32 torque) -{ - m_bodyA->SetAwake(true); - m_bodyB->SetAwake(true); - m_maxMotorTorque = torque; -} - -bool b2RevoluteJoint::IsLimitEnabled() const -{ - return m_enableLimit; -} - -void b2RevoluteJoint::EnableLimit(bool flag) -{ - if (flag != m_enableLimit) - { - m_bodyA->SetAwake(true); - m_bodyB->SetAwake(true); - m_enableLimit = flag; - m_impulse.z = 0.0f; - } -} - -float32 b2RevoluteJoint::GetLowerLimit() const -{ - return m_lowerAngle; -} - -float32 b2RevoluteJoint::GetUpperLimit() const -{ - return m_upperAngle; -} - -void b2RevoluteJoint::SetLimits(float32 lower, float32 upper) -{ - b2Assert(lower <= upper); - - if (lower != m_lowerAngle || upper != m_upperAngle) - { - m_bodyA->SetAwake(true); - m_bodyB->SetAwake(true); - m_impulse.z = 0.0f; - m_lowerAngle = lower; - m_upperAngle = upper; - } -} - -void b2RevoluteJoint::Dump() -{ - int32 indexA = m_bodyA->m_islandIndex; - int32 indexB = m_bodyB->m_islandIndex; - - b2Log(" b2RevoluteJointDef jd;\n"); - b2Log(" jd.bodyA = bodies[%d];\n", indexA); - b2Log(" jd.bodyB = bodies[%d];\n", indexB); - b2Log(" jd.collideConnected = bool(%d);\n", m_collideConnected); - b2Log(" jd.localAnchorA.Set(%.15lef, %.15lef);\n", m_localAnchorA.x, m_localAnchorA.y); - b2Log(" jd.localAnchorB.Set(%.15lef, %.15lef);\n", m_localAnchorB.x, m_localAnchorB.y); - b2Log(" jd.referenceAngle = %.15lef;\n", m_referenceAngle); - b2Log(" jd.enableLimit = bool(%d);\n", m_enableLimit); - b2Log(" jd.lowerAngle = %.15lef;\n", m_lowerAngle); - b2Log(" jd.upperAngle = %.15lef;\n", m_upperAngle); - b2Log(" jd.enableMotor = bool(%d);\n", m_enableMotor); - b2Log(" jd.motorSpeed = %.15lef;\n", m_motorSpeed); - b2Log(" jd.maxMotorTorque = %.15lef;\n", m_maxMotorTorque); - b2Log(" joints[%d] = m_world->CreateJoint(&jd);\n", m_index); -} diff --git a/external/box2d/Dynamics/Joints/b2RevoluteJoint.h b/external/box2d/Dynamics/Joints/b2RevoluteJoint.h deleted file mode 100644 index 978f16259a..0000000000 --- a/external/box2d/Dynamics/Joints/b2RevoluteJoint.h +++ /dev/null @@ -1,204 +0,0 @@ -/* -* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_REVOLUTE_JOINT_H -#define B2_REVOLUTE_JOINT_H - -#include - -/// Revolute joint definition. This requires defining an -/// anchor point where the bodies are joined. The definition -/// uses local anchor points so that the initial configuration -/// can violate the constraint slightly. You also need to -/// specify the initial relative angle for joint limits. This -/// helps when saving and loading a game. -/// The local anchor points are measured from the body's origin -/// rather than the center of mass because: -/// 1. you might not know where the center of mass will be. -/// 2. if you add/remove shapes from a body and recompute the mass, -/// the joints will be broken. -struct b2RevoluteJointDef : public b2JointDef -{ - b2RevoluteJointDef() - { - type = e_revoluteJoint; - localAnchorA.Set(0.0f, 0.0f); - localAnchorB.Set(0.0f, 0.0f); - referenceAngle = 0.0f; - lowerAngle = 0.0f; - upperAngle = 0.0f; - maxMotorTorque = 0.0f; - motorSpeed = 0.0f; - enableLimit = false; - enableMotor = false; - } - - /// Initialize the bodies, anchors, and reference angle using a world - /// anchor point. - void Initialize(b2Body* bodyA, b2Body* bodyB, const b2Vec2& anchor); - - /// The local anchor point relative to bodyA's origin. - b2Vec2 localAnchorA; - - /// The local anchor point relative to bodyB's origin. - b2Vec2 localAnchorB; - - /// The bodyB angle minus bodyA angle in the reference state (radians). - float32 referenceAngle; - - /// A flag to enable joint limits. - bool enableLimit; - - /// The lower angle for the joint limit (radians). - float32 lowerAngle; - - /// The upper angle for the joint limit (radians). - float32 upperAngle; - - /// A flag to enable the joint motor. - bool enableMotor; - - /// The desired motor speed. Usually in radians per second. - float32 motorSpeed; - - /// The maximum motor torque used to achieve the desired motor speed. - /// Usually in N-m. - float32 maxMotorTorque; -}; - -/// A revolute joint constrains two bodies to share a common point while they -/// are free to rotate about the point. The relative rotation about the shared -/// point is the joint angle. You can limit the relative rotation with -/// a joint limit that specifies a lower and upper angle. You can use a motor -/// to drive the relative rotation about the shared point. A maximum motor torque -/// is provided so that infinite forces are not generated. -class b2RevoluteJoint : public b2Joint -{ -public: - b2Vec2 GetAnchorA() const; - b2Vec2 GetAnchorB() const; - - /// The local anchor point relative to bodyA's origin. - const b2Vec2& GetLocalAnchorA() const { return m_localAnchorA; } - - /// The local anchor point relative to bodyB's origin. - const b2Vec2& GetLocalAnchorB() const { return m_localAnchorB; } - - /// Get the reference angle. - float32 GetReferenceAngle() const { return m_referenceAngle; } - - /// Get the current joint angle in radians. - float32 GetJointAngle() const; - - /// Get the current joint angle speed in radians per second. - float32 GetJointSpeed() const; - - /// Is the joint limit enabled? - bool IsLimitEnabled() const; - - /// Enable/disable the joint limit. - void EnableLimit(bool flag); - - /// Get the lower joint limit in radians. - float32 GetLowerLimit() const; - - /// Get the upper joint limit in radians. - float32 GetUpperLimit() const; - - /// Set the joint limits in radians. - void SetLimits(float32 lower, float32 upper); - - /// Is the joint motor enabled? - bool IsMotorEnabled() const; - - /// Enable/disable the joint motor. - void EnableMotor(bool flag); - - /// Set the motor speed in radians per second. - void SetMotorSpeed(float32 speed); - - /// Get the motor speed in radians per second. - float32 GetMotorSpeed() const; - - /// Set the maximum motor torque, usually in N-m. - void SetMaxMotorTorque(float32 torque); - float32 GetMaxMotorTorque() const { return m_maxMotorTorque; } - - /// Get the reaction force given the inverse time step. - /// Unit is N. - b2Vec2 GetReactionForce(float32 inv_dt) const; - - /// Get the reaction torque due to the joint limit given the inverse time step. - /// Unit is N*m. - float32 GetReactionTorque(float32 inv_dt) const; - - /// Get the current motor torque given the inverse time step. - /// Unit is N*m. - float32 GetMotorTorque(float32 inv_dt) const; - - /// Dump to b2Log. - void Dump(); - -protected: - - friend class b2Joint; - friend class b2GearJoint; - - b2RevoluteJoint(const b2RevoluteJointDef* def); - - void InitVelocityConstraints(const b2SolverData& data); - void SolveVelocityConstraints(const b2SolverData& data); - bool SolvePositionConstraints(const b2SolverData& data); - - // Solver shared - b2Vec2 m_localAnchorA; - b2Vec2 m_localAnchorB; - b2Vec3 m_impulse; - float32 m_motorImpulse; - - bool m_enableMotor; - float32 m_maxMotorTorque; - float32 m_motorSpeed; - - bool m_enableLimit; - float32 m_referenceAngle; - float32 m_lowerAngle; - float32 m_upperAngle; - - // Solver temp - int32 m_indexA; - int32 m_indexB; - b2Vec2 m_rA; - b2Vec2 m_rB; - b2Vec2 m_localCenterA; - b2Vec2 m_localCenterB; - float32 m_invMassA; - float32 m_invMassB; - float32 m_invIA; - float32 m_invIB; - b2Mat33 m_mass; // effective mass for point-to-point constraint. - float32 m_motorMass; // effective mass for motor/limit angular constraint. - b2LimitState m_limitState; -}; - -inline float32 b2RevoluteJoint::GetMotorSpeed() const -{ - return m_motorSpeed; -} - -#endif diff --git a/external/box2d/Dynamics/Joints/b2RopeJoint.cpp b/external/box2d/Dynamics/Joints/b2RopeJoint.cpp deleted file mode 100644 index 17a70d9230..0000000000 --- a/external/box2d/Dynamics/Joints/b2RopeJoint.cpp +++ /dev/null @@ -1,241 +0,0 @@ -/* -* Copyright (c) 2007-2011 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include - - -// Limit: -// C = norm(pB - pA) - L -// u = (pB - pA) / norm(pB - pA) -// Cdot = dot(u, vB + cross(wB, rB) - vA - cross(wA, rA)) -// J = [-u -cross(rA, u) u cross(rB, u)] -// K = J * invM * JT -// = invMassA + invIA * cross(rA, u)^2 + invMassB + invIB * cross(rB, u)^2 - -b2RopeJoint::b2RopeJoint(const b2RopeJointDef* def) -: b2Joint(def) -{ - m_localAnchorA = def->localAnchorA; - m_localAnchorB = def->localAnchorB; - - m_maxLength = def->maxLength; - - m_mass = 0.0f; - m_impulse = 0.0f; - m_state = e_inactiveLimit; - m_length = 0.0f; -} - -void b2RopeJoint::InitVelocityConstraints(const b2SolverData& data) -{ - m_indexA = m_bodyA->m_islandIndex; - m_indexB = m_bodyB->m_islandIndex; - m_localCenterA = m_bodyA->m_sweep.localCenter; - m_localCenterB = m_bodyB->m_sweep.localCenter; - m_invMassA = m_bodyA->m_invMass; - m_invMassB = m_bodyB->m_invMass; - m_invIA = m_bodyA->m_invI; - m_invIB = m_bodyB->m_invI; - - b2Vec2 cA = data.positions[m_indexA].c; - float32 aA = data.positions[m_indexA].a; - b2Vec2 vA = data.velocities[m_indexA].v; - float32 wA = data.velocities[m_indexA].w; - - b2Vec2 cB = data.positions[m_indexB].c; - float32 aB = data.positions[m_indexB].a; - b2Vec2 vB = data.velocities[m_indexB].v; - float32 wB = data.velocities[m_indexB].w; - - b2Rot qA(aA), qB(aB); - - m_rA = b2Mul(qA, m_localAnchorA - m_localCenterA); - m_rB = b2Mul(qB, m_localAnchorB - m_localCenterB); - m_u = cB + m_rB - cA - m_rA; - - m_length = m_u.Length(); - - float32 C = m_length - m_maxLength; - if (C > 0.0f) - { - m_state = e_atUpperLimit; - } - else - { - m_state = e_inactiveLimit; - } - - if (m_length > b2_linearSlop) - { - m_u *= 1.0f / m_length; - } - else - { - m_u.SetZero(); - m_mass = 0.0f; - m_impulse = 0.0f; - return; - } - - // Compute effective mass. - float32 crA = b2Cross(m_rA, m_u); - float32 crB = b2Cross(m_rB, m_u); - float32 invMass = m_invMassA + m_invIA * crA * crA + m_invMassB + m_invIB * crB * crB; - - m_mass = invMass != 0.0f ? 1.0f / invMass : 0.0f; - - if (data.step.warmStarting) - { - // Scale the impulse to support a variable time step. - m_impulse *= data.step.dtRatio; - - b2Vec2 P = m_impulse * m_u; - vA -= m_invMassA * P; - wA -= m_invIA * b2Cross(m_rA, P); - vB += m_invMassB * P; - wB += m_invIB * b2Cross(m_rB, P); - } - else - { - m_impulse = 0.0f; - } - - data.velocities[m_indexA].v = vA; - data.velocities[m_indexA].w = wA; - data.velocities[m_indexB].v = vB; - data.velocities[m_indexB].w = wB; -} - -void b2RopeJoint::SolveVelocityConstraints(const b2SolverData& data) -{ - b2Vec2 vA = data.velocities[m_indexA].v; - float32 wA = data.velocities[m_indexA].w; - b2Vec2 vB = data.velocities[m_indexB].v; - float32 wB = data.velocities[m_indexB].w; - - // Cdot = dot(u, v + cross(w, r)) - b2Vec2 vpA = vA + b2Cross(wA, m_rA); - b2Vec2 vpB = vB + b2Cross(wB, m_rB); - float32 C = m_length - m_maxLength; - float32 Cdot = b2Dot(m_u, vpB - vpA); - - // Predictive constraint. - if (C < 0.0f) - { - Cdot += data.step.inv_dt * C; - } - - float32 impulse = -m_mass * Cdot; - float32 oldImpulse = m_impulse; - m_impulse = b2Min(0.0f, m_impulse + impulse); - impulse = m_impulse - oldImpulse; - - b2Vec2 P = impulse * m_u; - vA -= m_invMassA * P; - wA -= m_invIA * b2Cross(m_rA, P); - vB += m_invMassB * P; - wB += m_invIB * b2Cross(m_rB, P); - - data.velocities[m_indexA].v = vA; - data.velocities[m_indexA].w = wA; - data.velocities[m_indexB].v = vB; - data.velocities[m_indexB].w = wB; -} - -bool b2RopeJoint::SolvePositionConstraints(const b2SolverData& data) -{ - b2Vec2 cA = data.positions[m_indexA].c; - float32 aA = data.positions[m_indexA].a; - b2Vec2 cB = data.positions[m_indexB].c; - float32 aB = data.positions[m_indexB].a; - - b2Rot qA(aA), qB(aB); - - b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA); - b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB); - b2Vec2 u = cB + rB - cA - rA; - - float32 length = u.Normalize(); - float32 C = length - m_maxLength; - - C = b2Clamp(C, 0.0f, b2_maxLinearCorrection); - - float32 impulse = -m_mass * C; - b2Vec2 P = impulse * u; - - cA -= m_invMassA * P; - aA -= m_invIA * b2Cross(rA, P); - cB += m_invMassB * P; - aB += m_invIB * b2Cross(rB, P); - - data.positions[m_indexA].c = cA; - data.positions[m_indexA].a = aA; - data.positions[m_indexB].c = cB; - data.positions[m_indexB].a = aB; - - return length - m_maxLength < b2_linearSlop; -} - -b2Vec2 b2RopeJoint::GetAnchorA() const -{ - return m_bodyA->GetWorldPoint(m_localAnchorA); -} - -b2Vec2 b2RopeJoint::GetAnchorB() const -{ - return m_bodyB->GetWorldPoint(m_localAnchorB); -} - -b2Vec2 b2RopeJoint::GetReactionForce(float32 inv_dt) const -{ - b2Vec2 F = (inv_dt * m_impulse) * m_u; - return F; -} - -float32 b2RopeJoint::GetReactionTorque(float32 inv_dt) const -{ - B2_NOT_USED(inv_dt); - return 0.0f; -} - -float32 b2RopeJoint::GetMaxLength() const -{ - return m_maxLength; -} - -b2LimitState b2RopeJoint::GetLimitState() const -{ - return m_state; -} - -void b2RopeJoint::Dump() -{ - int32 indexA = m_bodyA->m_islandIndex; - int32 indexB = m_bodyB->m_islandIndex; - - b2Log(" b2RopeJointDef jd;\n"); - b2Log(" jd.bodyA = bodies[%d];\n", indexA); - b2Log(" jd.bodyB = bodies[%d];\n", indexB); - b2Log(" jd.collideConnected = bool(%d);\n", m_collideConnected); - b2Log(" jd.localAnchorA.Set(%.15lef, %.15lef);\n", m_localAnchorA.x, m_localAnchorA.y); - b2Log(" jd.localAnchorB.Set(%.15lef, %.15lef);\n", m_localAnchorB.x, m_localAnchorB.y); - b2Log(" jd.maxLength = %.15lef;\n", m_maxLength); - b2Log(" joints[%d] = m_world->CreateJoint(&jd);\n", m_index); -} diff --git a/external/box2d/Dynamics/Joints/b2RopeJoint.h b/external/box2d/Dynamics/Joints/b2RopeJoint.h deleted file mode 100644 index d7091b6650..0000000000 --- a/external/box2d/Dynamics/Joints/b2RopeJoint.h +++ /dev/null @@ -1,114 +0,0 @@ -/* -* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_ROPE_JOINT_H -#define B2_ROPE_JOINT_H - -#include - -/// Rope joint definition. This requires two body anchor points and -/// a maximum lengths. -/// Note: by default the connected objects will not collide. -/// see collideConnected in b2JointDef. -struct b2RopeJointDef : public b2JointDef -{ - b2RopeJointDef() - { - type = e_ropeJoint; - localAnchorA.Set(-1.0f, 0.0f); - localAnchorB.Set(1.0f, 0.0f); - maxLength = 0.0f; - } - - /// The local anchor point relative to bodyA's origin. - b2Vec2 localAnchorA; - - /// The local anchor point relative to bodyB's origin. - b2Vec2 localAnchorB; - - /// The maximum length of the rope. - /// Warning: this must be larger than b2_linearSlop or - /// the joint will have no effect. - float32 maxLength; -}; - -/// A rope joint enforces a maximum distance between two points -/// on two bodies. It has no other effect. -/// Warning: if you attempt to change the maximum length during -/// the simulation you will get some non-physical behavior. -/// A model that would allow you to dynamically modify the length -/// would have some sponginess, so I chose not to implement it -/// that way. See b2DistanceJoint if you want to dynamically -/// control length. -class b2RopeJoint : public b2Joint -{ -public: - b2Vec2 GetAnchorA() const; - b2Vec2 GetAnchorB() const; - - b2Vec2 GetReactionForce(float32 inv_dt) const; - float32 GetReactionTorque(float32 inv_dt) const; - - /// The local anchor point relative to bodyA's origin. - const b2Vec2& GetLocalAnchorA() const { return m_localAnchorA; } - - /// The local anchor point relative to bodyB's origin. - const b2Vec2& GetLocalAnchorB() const { return m_localAnchorB; } - - /// Set/Get the maximum length of the rope. - void SetMaxLength(float32 length) { m_maxLength = length; } - float32 GetMaxLength() const; - - b2LimitState GetLimitState() const; - - /// Dump joint to dmLog - void Dump(); - -protected: - - friend class b2Joint; - b2RopeJoint(const b2RopeJointDef* data); - - void InitVelocityConstraints(const b2SolverData& data); - void SolveVelocityConstraints(const b2SolverData& data); - bool SolvePositionConstraints(const b2SolverData& data); - - // Solver shared - b2Vec2 m_localAnchorA; - b2Vec2 m_localAnchorB; - float32 m_maxLength; - float32 m_length; - float32 m_impulse; - - // Solver temp - int32 m_indexA; - int32 m_indexB; - b2Vec2 m_u; - b2Vec2 m_rA; - b2Vec2 m_rB; - b2Vec2 m_localCenterA; - b2Vec2 m_localCenterB; - float32 m_invMassA; - float32 m_invMassB; - float32 m_invIA; - float32 m_invIB; - float32 m_mass; - b2LimitState m_state; -}; - -#endif diff --git a/external/box2d/Dynamics/Joints/b2WeldJoint.cpp b/external/box2d/Dynamics/Joints/b2WeldJoint.cpp deleted file mode 100644 index f50bdd6587..0000000000 --- a/external/box2d/Dynamics/Joints/b2WeldJoint.cpp +++ /dev/null @@ -1,330 +0,0 @@ -/* -* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include - -// Point-to-point constraint -// C = p2 - p1 -// Cdot = v2 - v1 -// = v2 + cross(w2, r2) - v1 - cross(w1, r1) -// J = [-I -r1_skew I r2_skew ] -// Identity used: -// w k % (rx i + ry j) = w * (-ry i + rx j) - -// Angle constraint -// C = angle2 - angle1 - referenceAngle -// Cdot = w2 - w1 -// J = [0 0 -1 0 0 1] -// K = invI1 + invI2 - -void b2WeldJointDef::Initialize(b2Body* bA, b2Body* bB, const b2Vec2& anchor) -{ - bodyA = bA; - bodyB = bB; - localAnchorA = bodyA->GetLocalPoint(anchor); - localAnchorB = bodyB->GetLocalPoint(anchor); - referenceAngle = bodyB->GetAngle() - bodyA->GetAngle(); -} - -b2WeldJoint::b2WeldJoint(const b2WeldJointDef* def) -: b2Joint(def) -{ - m_localAnchorA = def->localAnchorA; - m_localAnchorB = def->localAnchorB; - m_referenceAngle = def->referenceAngle; - m_frequencyHz = def->frequencyHz; - m_dampingRatio = def->dampingRatio; - - m_impulse.SetZero(); -} - -void b2WeldJoint::InitVelocityConstraints(const b2SolverData& data) -{ - m_indexA = m_bodyA->m_islandIndex; - m_indexB = m_bodyB->m_islandIndex; - m_localCenterA = m_bodyA->m_sweep.localCenter; - m_localCenterB = m_bodyB->m_sweep.localCenter; - m_invMassA = m_bodyA->m_invMass; - m_invMassB = m_bodyB->m_invMass; - m_invIA = m_bodyA->m_invI; - m_invIB = m_bodyB->m_invI; - - b2Vec2 cA = data.positions[m_indexA].c; - float32 aA = data.positions[m_indexA].a; - b2Vec2 vA = data.velocities[m_indexA].v; - float32 wA = data.velocities[m_indexA].w; - - b2Vec2 cB = data.positions[m_indexB].c; - float32 aB = data.positions[m_indexB].a; - b2Vec2 vB = data.velocities[m_indexB].v; - float32 wB = data.velocities[m_indexB].w; - - b2Rot qA(aA), qB(aB); - - m_rA = b2Mul(qA, m_localAnchorA - m_localCenterA); - m_rB = b2Mul(qB, m_localAnchorB - m_localCenterB); - - // J = [-I -r1_skew I r2_skew] - // [ 0 -1 0 1] - // r_skew = [-ry; rx] - - // Matlab - // K = [ mA+r1y^2*iA+mB+r2y^2*iB, -r1y*iA*r1x-r2y*iB*r2x, -r1y*iA-r2y*iB] - // [ -r1y*iA*r1x-r2y*iB*r2x, mA+r1x^2*iA+mB+r2x^2*iB, r1x*iA+r2x*iB] - // [ -r1y*iA-r2y*iB, r1x*iA+r2x*iB, iA+iB] - - float32 mA = m_invMassA, mB = m_invMassB; - float32 iA = m_invIA, iB = m_invIB; - - b2Mat33 K; - K.ex.x = mA + mB + m_rA.y * m_rA.y * iA + m_rB.y * m_rB.y * iB; - K.ey.x = -m_rA.y * m_rA.x * iA - m_rB.y * m_rB.x * iB; - K.ez.x = -m_rA.y * iA - m_rB.y * iB; - K.ex.y = K.ey.x; - K.ey.y = mA + mB + m_rA.x * m_rA.x * iA + m_rB.x * m_rB.x * iB; - K.ez.y = m_rA.x * iA + m_rB.x * iB; - K.ex.z = K.ez.x; - K.ey.z = K.ez.y; - K.ez.z = iA + iB; - - if (m_frequencyHz > 0.0f) - { - K.GetInverse22(&m_mass); - - float32 invM = iA + iB; - float32 m = invM > 0.0f ? 1.0f / invM : 0.0f; - - float32 C = aB - aA - m_referenceAngle; - - // Frequency - float32 omega = 2.0f * b2_pi * m_frequencyHz; - - // Damping coefficient - float32 d = 2.0f * m * m_dampingRatio * omega; - - // Spring stiffness - float32 k = m * omega * omega; - - // magic formulas - float32 h = data.step.dt; - m_gamma = h * (d + h * k); - m_gamma = m_gamma != 0.0f ? 1.0f / m_gamma : 0.0f; - m_bias = C * h * k * m_gamma; - - invM += m_gamma; - m_mass.ez.z = invM != 0.0f ? 1.0f / invM : 0.0f; - } - else - { - K.GetSymInverse33(&m_mass); - m_gamma = 0.0f; - m_bias = 0.0f; - } - - if (data.step.warmStarting) - { - // Scale impulses to support a variable time step. - m_impulse *= data.step.dtRatio; - - b2Vec2 P(m_impulse.x, m_impulse.y); - - vA -= mA * P; - wA -= iA * (b2Cross(m_rA, P) + m_impulse.z); - - vB += mB * P; - wB += iB * (b2Cross(m_rB, P) + m_impulse.z); - } - else - { - m_impulse.SetZero(); - } - - data.velocities[m_indexA].v = vA; - data.velocities[m_indexA].w = wA; - data.velocities[m_indexB].v = vB; - data.velocities[m_indexB].w = wB; -} - -void b2WeldJoint::SolveVelocityConstraints(const b2SolverData& data) -{ - b2Vec2 vA = data.velocities[m_indexA].v; - float32 wA = data.velocities[m_indexA].w; - b2Vec2 vB = data.velocities[m_indexB].v; - float32 wB = data.velocities[m_indexB].w; - - float32 mA = m_invMassA, mB = m_invMassB; - float32 iA = m_invIA, iB = m_invIB; - - if (m_frequencyHz > 0.0f) - { - float32 Cdot2 = wB - wA; - - float32 impulse2 = -m_mass.ez.z * (Cdot2 + m_bias + m_gamma * m_impulse.z); - m_impulse.z += impulse2; - - wA -= iA * impulse2; - wB += iB * impulse2; - - b2Vec2 Cdot1 = vB + b2Cross(wB, m_rB) - vA - b2Cross(wA, m_rA); - - b2Vec2 impulse1 = -b2Mul22(m_mass, Cdot1); - m_impulse.x += impulse1.x; - m_impulse.y += impulse1.y; - - b2Vec2 P = impulse1; - - vA -= mA * P; - wA -= iA * b2Cross(m_rA, P); - - vB += mB * P; - wB += iB * b2Cross(m_rB, P); - } - else - { - b2Vec2 Cdot1 = vB + b2Cross(wB, m_rB) - vA - b2Cross(wA, m_rA); - float32 Cdot2 = wB - wA; - b2Vec3 Cdot(Cdot1.x, Cdot1.y, Cdot2); - - b2Vec3 impulse = -b2Mul(m_mass, Cdot); - m_impulse += impulse; - - b2Vec2 P(impulse.x, impulse.y); - - vA -= mA * P; - wA -= iA * (b2Cross(m_rA, P) + impulse.z); - - vB += mB * P; - wB += iB * (b2Cross(m_rB, P) + impulse.z); - } - - data.velocities[m_indexA].v = vA; - data.velocities[m_indexA].w = wA; - data.velocities[m_indexB].v = vB; - data.velocities[m_indexB].w = wB; -} - -bool b2WeldJoint::SolvePositionConstraints(const b2SolverData& data) -{ - b2Vec2 cA = data.positions[m_indexA].c; - float32 aA = data.positions[m_indexA].a; - b2Vec2 cB = data.positions[m_indexB].c; - float32 aB = data.positions[m_indexB].a; - - b2Rot qA(aA), qB(aB); - - float32 mA = m_invMassA, mB = m_invMassB; - float32 iA = m_invIA, iB = m_invIB; - - b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA); - b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB); - - float32 positionError, angularError; - - b2Mat33 K; - K.ex.x = mA + mB + rA.y * rA.y * iA + rB.y * rB.y * iB; - K.ey.x = -rA.y * rA.x * iA - rB.y * rB.x * iB; - K.ez.x = -rA.y * iA - rB.y * iB; - K.ex.y = K.ey.x; - K.ey.y = mA + mB + rA.x * rA.x * iA + rB.x * rB.x * iB; - K.ez.y = rA.x * iA + rB.x * iB; - K.ex.z = K.ez.x; - K.ey.z = K.ez.y; - K.ez.z = iA + iB; - - if (m_frequencyHz > 0.0f) - { - b2Vec2 C1 = cB + rB - cA - rA; - - positionError = C1.Length(); - angularError = 0.0f; - - b2Vec2 P = -K.Solve22(C1); - - cA -= mA * P; - aA -= iA * b2Cross(rA, P); - - cB += mB * P; - aB += iB * b2Cross(rB, P); - } - else - { - b2Vec2 C1 = cB + rB - cA - rA; - float32 C2 = aB - aA - m_referenceAngle; - - positionError = C1.Length(); - angularError = b2Abs(C2); - - b2Vec3 C(C1.x, C1.y, C2); - - b2Vec3 impulse = -K.Solve33(C); - b2Vec2 P(impulse.x, impulse.y); - - cA -= mA * P; - aA -= iA * (b2Cross(rA, P) + impulse.z); - - cB += mB * P; - aB += iB * (b2Cross(rB, P) + impulse.z); - } - - data.positions[m_indexA].c = cA; - data.positions[m_indexA].a = aA; - data.positions[m_indexB].c = cB; - data.positions[m_indexB].a = aB; - - return positionError <= b2_linearSlop && angularError <= b2_angularSlop; -} - -b2Vec2 b2WeldJoint::GetAnchorA() const -{ - return m_bodyA->GetWorldPoint(m_localAnchorA); -} - -b2Vec2 b2WeldJoint::GetAnchorB() const -{ - return m_bodyB->GetWorldPoint(m_localAnchorB); -} - -b2Vec2 b2WeldJoint::GetReactionForce(float32 inv_dt) const -{ - b2Vec2 P(m_impulse.x, m_impulse.y); - return inv_dt * P; -} - -float32 b2WeldJoint::GetReactionTorque(float32 inv_dt) const -{ - return inv_dt * m_impulse.z; -} - -void b2WeldJoint::Dump() -{ - int32 indexA = m_bodyA->m_islandIndex; - int32 indexB = m_bodyB->m_islandIndex; - - b2Log(" b2WeldJointDef jd;\n"); - b2Log(" jd.bodyA = bodies[%d];\n", indexA); - b2Log(" jd.bodyB = bodies[%d];\n", indexB); - b2Log(" jd.collideConnected = bool(%d);\n", m_collideConnected); - b2Log(" jd.localAnchorA.Set(%.15lef, %.15lef);\n", m_localAnchorA.x, m_localAnchorA.y); - b2Log(" jd.localAnchorB.Set(%.15lef, %.15lef);\n", m_localAnchorB.x, m_localAnchorB.y); - b2Log(" jd.referenceAngle = %.15lef;\n", m_referenceAngle); - b2Log(" jd.frequencyHz = %.15lef;\n", m_frequencyHz); - b2Log(" jd.dampingRatio = %.15lef;\n", m_dampingRatio); - b2Log(" joints[%d] = m_world->CreateJoint(&jd);\n", m_index); -} diff --git a/external/box2d/Dynamics/Joints/b2WeldJoint.h b/external/box2d/Dynamics/Joints/b2WeldJoint.h deleted file mode 100644 index 751c6a8770..0000000000 --- a/external/box2d/Dynamics/Joints/b2WeldJoint.h +++ /dev/null @@ -1,126 +0,0 @@ -/* -* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_WELD_JOINT_H -#define B2_WELD_JOINT_H - -#include - -/// Weld joint definition. You need to specify local anchor points -/// where they are attached and the relative body angle. The position -/// of the anchor points is important for computing the reaction torque. -struct b2WeldJointDef : public b2JointDef -{ - b2WeldJointDef() - { - type = e_weldJoint; - localAnchorA.Set(0.0f, 0.0f); - localAnchorB.Set(0.0f, 0.0f); - referenceAngle = 0.0f; - frequencyHz = 0.0f; - dampingRatio = 0.0f; - } - - /// Initialize the bodies, anchors, and reference angle using a world - /// anchor point. - void Initialize(b2Body* bodyA, b2Body* bodyB, const b2Vec2& anchor); - - /// The local anchor point relative to bodyA's origin. - b2Vec2 localAnchorA; - - /// The local anchor point relative to bodyB's origin. - b2Vec2 localAnchorB; - - /// The bodyB angle minus bodyA angle in the reference state (radians). - float32 referenceAngle; - - /// The mass-spring-damper frequency in Hertz. Rotation only. - /// Disable softness with a value of 0. - float32 frequencyHz; - - /// The damping ratio. 0 = no damping, 1 = critical damping. - float32 dampingRatio; -}; - -/// A weld joint essentially glues two bodies together. A weld joint may -/// distort somewhat because the island constraint solver is approximate. -class b2WeldJoint : public b2Joint -{ -public: - b2Vec2 GetAnchorA() const; - b2Vec2 GetAnchorB() const; - - b2Vec2 GetReactionForce(float32 inv_dt) const; - float32 GetReactionTorque(float32 inv_dt) const; - - /// The local anchor point relative to bodyA's origin. - const b2Vec2& GetLocalAnchorA() const { return m_localAnchorA; } - - /// The local anchor point relative to bodyB's origin. - const b2Vec2& GetLocalAnchorB() const { return m_localAnchorB; } - - /// Get the reference angle. - float32 GetReferenceAngle() const { return m_referenceAngle; } - - /// Set/get frequency in Hz. - void SetFrequency(float32 hz) { m_frequencyHz = hz; } - float32 GetFrequency() const { return m_frequencyHz; } - - /// Set/get damping ratio. - void SetDampingRatio(float32 ratio) { m_dampingRatio = ratio; } - float32 GetDampingRatio() const { return m_dampingRatio; } - - /// Dump to b2Log - void Dump(); - -protected: - - friend class b2Joint; - - b2WeldJoint(const b2WeldJointDef* def); - - void InitVelocityConstraints(const b2SolverData& data); - void SolveVelocityConstraints(const b2SolverData& data); - bool SolvePositionConstraints(const b2SolverData& data); - - float32 m_frequencyHz; - float32 m_dampingRatio; - float32 m_bias; - - // Solver shared - b2Vec2 m_localAnchorA; - b2Vec2 m_localAnchorB; - float32 m_referenceAngle; - float32 m_gamma; - b2Vec3 m_impulse; - - // Solver temp - int32 m_indexA; - int32 m_indexB; - b2Vec2 m_rA; - b2Vec2 m_rB; - b2Vec2 m_localCenterA; - b2Vec2 m_localCenterB; - float32 m_invMassA; - float32 m_invMassB; - float32 m_invIA; - float32 m_invIB; - b2Mat33 m_mass; -}; - -#endif diff --git a/external/box2d/Dynamics/Joints/b2WheelJoint.cpp b/external/box2d/Dynamics/Joints/b2WheelJoint.cpp deleted file mode 100644 index 6253437706..0000000000 --- a/external/box2d/Dynamics/Joints/b2WheelJoint.cpp +++ /dev/null @@ -1,419 +0,0 @@ -/* -* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include - -// Linear constraint (point-to-line) -// d = pB - pA = xB + rB - xA - rA -// C = dot(ay, d) -// Cdot = dot(d, cross(wA, ay)) + dot(ay, vB + cross(wB, rB) - vA - cross(wA, rA)) -// = -dot(ay, vA) - dot(cross(d + rA, ay), wA) + dot(ay, vB) + dot(cross(rB, ay), vB) -// J = [-ay, -cross(d + rA, ay), ay, cross(rB, ay)] - -// Spring linear constraint -// C = dot(ax, d) -// Cdot = = -dot(ax, vA) - dot(cross(d + rA, ax), wA) + dot(ax, vB) + dot(cross(rB, ax), vB) -// J = [-ax -cross(d+rA, ax) ax cross(rB, ax)] - -// Motor rotational constraint -// Cdot = wB - wA -// J = [0 0 -1 0 0 1] - -void b2WheelJointDef::Initialize(b2Body* bA, b2Body* bB, const b2Vec2& anchor, const b2Vec2& axis) -{ - bodyA = bA; - bodyB = bB; - localAnchorA = bodyA->GetLocalPoint(anchor); - localAnchorB = bodyB->GetLocalPoint(anchor); - localAxisA = bodyA->GetLocalVector(axis); -} - -b2WheelJoint::b2WheelJoint(const b2WheelJointDef* def) -: b2Joint(def) -{ - m_localAnchorA = def->localAnchorA; - m_localAnchorB = def->localAnchorB; - m_localXAxisA = def->localAxisA; - m_localYAxisA = b2Cross(1.0f, m_localXAxisA); - - m_mass = 0.0f; - m_impulse = 0.0f; - m_motorMass = 0.0; - m_motorImpulse = 0.0f; - m_springMass = 0.0f; - m_springImpulse = 0.0f; - - m_maxMotorTorque = def->maxMotorTorque; - m_motorSpeed = def->motorSpeed; - m_enableMotor = def->enableMotor; - - m_frequencyHz = def->frequencyHz; - m_dampingRatio = def->dampingRatio; - - m_bias = 0.0f; - m_gamma = 0.0f; - - m_ax.SetZero(); - m_ay.SetZero(); -} - -void b2WheelJoint::InitVelocityConstraints(const b2SolverData& data) -{ - m_indexA = m_bodyA->m_islandIndex; - m_indexB = m_bodyB->m_islandIndex; - m_localCenterA = m_bodyA->m_sweep.localCenter; - m_localCenterB = m_bodyB->m_sweep.localCenter; - m_invMassA = m_bodyA->m_invMass; - m_invMassB = m_bodyB->m_invMass; - m_invIA = m_bodyA->m_invI; - m_invIB = m_bodyB->m_invI; - - float32 mA = m_invMassA, mB = m_invMassB; - float32 iA = m_invIA, iB = m_invIB; - - b2Vec2 cA = data.positions[m_indexA].c; - float32 aA = data.positions[m_indexA].a; - b2Vec2 vA = data.velocities[m_indexA].v; - float32 wA = data.velocities[m_indexA].w; - - b2Vec2 cB = data.positions[m_indexB].c; - float32 aB = data.positions[m_indexB].a; - b2Vec2 vB = data.velocities[m_indexB].v; - float32 wB = data.velocities[m_indexB].w; - - b2Rot qA(aA), qB(aB); - - // Compute the effective masses. - b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA); - b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB); - b2Vec2 d = cB + rB - cA - rA; - - // Point to line constraint - { - m_ay = b2Mul(qA, m_localYAxisA); - m_sAy = b2Cross(d + rA, m_ay); - m_sBy = b2Cross(rB, m_ay); - - m_mass = mA + mB + iA * m_sAy * m_sAy + iB * m_sBy * m_sBy; - - if (m_mass > 0.0f) - { - m_mass = 1.0f / m_mass; - } - } - - // Spring constraint - m_springMass = 0.0f; - m_bias = 0.0f; - m_gamma = 0.0f; - if (m_frequencyHz > 0.0f) - { - m_ax = b2Mul(qA, m_localXAxisA); - m_sAx = b2Cross(d + rA, m_ax); - m_sBx = b2Cross(rB, m_ax); - - float32 invMass = mA + mB + iA * m_sAx * m_sAx + iB * m_sBx * m_sBx; - - if (invMass > 0.0f) - { - m_springMass = 1.0f / invMass; - - float32 C = b2Dot(d, m_ax); - - // Frequency - float32 omega = 2.0f * b2_pi * m_frequencyHz; - - // Damping coefficient - float32 d = 2.0f * m_springMass * m_dampingRatio * omega; - - // Spring stiffness - float32 k = m_springMass * omega * omega; - - // magic formulas - float32 h = data.step.dt; - m_gamma = h * (d + h * k); - if (m_gamma > 0.0f) - { - m_gamma = 1.0f / m_gamma; - } - - m_bias = C * h * k * m_gamma; - - m_springMass = invMass + m_gamma; - if (m_springMass > 0.0f) - { - m_springMass = 1.0f / m_springMass; - } - } - } - else - { - m_springImpulse = 0.0f; - } - - // Rotational motor - if (m_enableMotor) - { - m_motorMass = iA + iB; - if (m_motorMass > 0.0f) - { - m_motorMass = 1.0f / m_motorMass; - } - } - else - { - m_motorMass = 0.0f; - m_motorImpulse = 0.0f; - } - - if (data.step.warmStarting) - { - // Account for variable time step. - m_impulse *= data.step.dtRatio; - m_springImpulse *= data.step.dtRatio; - m_motorImpulse *= data.step.dtRatio; - - b2Vec2 P = m_impulse * m_ay + m_springImpulse * m_ax; - float32 LA = m_impulse * m_sAy + m_springImpulse * m_sAx + m_motorImpulse; - float32 LB = m_impulse * m_sBy + m_springImpulse * m_sBx + m_motorImpulse; - - vA -= m_invMassA * P; - wA -= m_invIA * LA; - - vB += m_invMassB * P; - wB += m_invIB * LB; - } - else - { - m_impulse = 0.0f; - m_springImpulse = 0.0f; - m_motorImpulse = 0.0f; - } - - data.velocities[m_indexA].v = vA; - data.velocities[m_indexA].w = wA; - data.velocities[m_indexB].v = vB; - data.velocities[m_indexB].w = wB; -} - -void b2WheelJoint::SolveVelocityConstraints(const b2SolverData& data) -{ - float32 mA = m_invMassA, mB = m_invMassB; - float32 iA = m_invIA, iB = m_invIB; - - b2Vec2 vA = data.velocities[m_indexA].v; - float32 wA = data.velocities[m_indexA].w; - b2Vec2 vB = data.velocities[m_indexB].v; - float32 wB = data.velocities[m_indexB].w; - - // Solve spring constraint - { - float32 Cdot = b2Dot(m_ax, vB - vA) + m_sBx * wB - m_sAx * wA; - float32 impulse = -m_springMass * (Cdot + m_bias + m_gamma * m_springImpulse); - m_springImpulse += impulse; - - b2Vec2 P = impulse * m_ax; - float32 LA = impulse * m_sAx; - float32 LB = impulse * m_sBx; - - vA -= mA * P; - wA -= iA * LA; - - vB += mB * P; - wB += iB * LB; - } - - // Solve rotational motor constraint - { - float32 Cdot = wB - wA - m_motorSpeed; - float32 impulse = -m_motorMass * Cdot; - - float32 oldImpulse = m_motorImpulse; - float32 maxImpulse = data.step.dt * m_maxMotorTorque; - m_motorImpulse = b2Clamp(m_motorImpulse + impulse, -maxImpulse, maxImpulse); - impulse = m_motorImpulse - oldImpulse; - - wA -= iA * impulse; - wB += iB * impulse; - } - - // Solve point to line constraint - { - float32 Cdot = b2Dot(m_ay, vB - vA) + m_sBy * wB - m_sAy * wA; - float32 impulse = -m_mass * Cdot; - m_impulse += impulse; - - b2Vec2 P = impulse * m_ay; - float32 LA = impulse * m_sAy; - float32 LB = impulse * m_sBy; - - vA -= mA * P; - wA -= iA * LA; - - vB += mB * P; - wB += iB * LB; - } - - data.velocities[m_indexA].v = vA; - data.velocities[m_indexA].w = wA; - data.velocities[m_indexB].v = vB; - data.velocities[m_indexB].w = wB; -} - -bool b2WheelJoint::SolvePositionConstraints(const b2SolverData& data) -{ - b2Vec2 cA = data.positions[m_indexA].c; - float32 aA = data.positions[m_indexA].a; - b2Vec2 cB = data.positions[m_indexB].c; - float32 aB = data.positions[m_indexB].a; - - b2Rot qA(aA), qB(aB); - - b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA); - b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB); - b2Vec2 d = (cB - cA) + rB - rA; - - b2Vec2 ay = b2Mul(qA, m_localYAxisA); - - float32 sAy = b2Cross(d + rA, ay); - float32 sBy = b2Cross(rB, ay); - - float32 C = b2Dot(d, ay); - - float32 k = m_invMassA + m_invMassB + m_invIA * m_sAy * m_sAy + m_invIB * m_sBy * m_sBy; - - float32 impulse; - if (k != 0.0f) - { - impulse = - C / k; - } - else - { - impulse = 0.0f; - } - - b2Vec2 P = impulse * ay; - float32 LA = impulse * sAy; - float32 LB = impulse * sBy; - - cA -= m_invMassA * P; - aA -= m_invIA * LA; - cB += m_invMassB * P; - aB += m_invIB * LB; - - data.positions[m_indexA].c = cA; - data.positions[m_indexA].a = aA; - data.positions[m_indexB].c = cB; - data.positions[m_indexB].a = aB; - - return b2Abs(C) <= b2_linearSlop; -} - -b2Vec2 b2WheelJoint::GetAnchorA() const -{ - return m_bodyA->GetWorldPoint(m_localAnchorA); -} - -b2Vec2 b2WheelJoint::GetAnchorB() const -{ - return m_bodyB->GetWorldPoint(m_localAnchorB); -} - -b2Vec2 b2WheelJoint::GetReactionForce(float32 inv_dt) const -{ - return inv_dt * (m_impulse * m_ay + m_springImpulse * m_ax); -} - -float32 b2WheelJoint::GetReactionTorque(float32 inv_dt) const -{ - return inv_dt * m_motorImpulse; -} - -float32 b2WheelJoint::GetJointTranslation() const -{ - b2Body* bA = m_bodyA; - b2Body* bB = m_bodyB; - - b2Vec2 pA = bA->GetWorldPoint(m_localAnchorA); - b2Vec2 pB = bB->GetWorldPoint(m_localAnchorB); - b2Vec2 d = pB - pA; - b2Vec2 axis = bA->GetWorldVector(m_localXAxisA); - - float32 translation = b2Dot(d, axis); - return translation; -} - -float32 b2WheelJoint::GetJointSpeed() const -{ - float32 wA = m_bodyA->m_angularVelocity; - float32 wB = m_bodyB->m_angularVelocity; - return wB - wA; -} - -bool b2WheelJoint::IsMotorEnabled() const -{ - return m_enableMotor; -} - -void b2WheelJoint::EnableMotor(bool flag) -{ - m_bodyA->SetAwake(true); - m_bodyB->SetAwake(true); - m_enableMotor = flag; -} - -void b2WheelJoint::SetMotorSpeed(float32 speed) -{ - m_bodyA->SetAwake(true); - m_bodyB->SetAwake(true); - m_motorSpeed = speed; -} - -void b2WheelJoint::SetMaxMotorTorque(float32 torque) -{ - m_bodyA->SetAwake(true); - m_bodyB->SetAwake(true); - m_maxMotorTorque = torque; -} - -float32 b2WheelJoint::GetMotorTorque(float32 inv_dt) const -{ - return inv_dt * m_motorImpulse; -} - -void b2WheelJoint::Dump() -{ - int32 indexA = m_bodyA->m_islandIndex; - int32 indexB = m_bodyB->m_islandIndex; - - b2Log(" b2WheelJointDef jd;\n"); - b2Log(" jd.bodyA = bodies[%d];\n", indexA); - b2Log(" jd.bodyB = bodies[%d];\n", indexB); - b2Log(" jd.collideConnected = bool(%d);\n", m_collideConnected); - b2Log(" jd.localAnchorA.Set(%.15lef, %.15lef);\n", m_localAnchorA.x, m_localAnchorA.y); - b2Log(" jd.localAnchorB.Set(%.15lef, %.15lef);\n", m_localAnchorB.x, m_localAnchorB.y); - b2Log(" jd.localAxisA.Set(%.15lef, %.15lef);\n", m_localXAxisA.x, m_localXAxisA.y); - b2Log(" jd.enableMotor = bool(%d);\n", m_enableMotor); - b2Log(" jd.motorSpeed = %.15lef;\n", m_motorSpeed); - b2Log(" jd.maxMotorTorque = %.15lef;\n", m_maxMotorTorque); - b2Log(" jd.frequencyHz = %.15lef;\n", m_frequencyHz); - b2Log(" jd.dampingRatio = %.15lef;\n", m_dampingRatio); - b2Log(" joints[%d] = m_world->CreateJoint(&jd);\n", m_index); -} diff --git a/external/box2d/Dynamics/Joints/b2WheelJoint.h b/external/box2d/Dynamics/Joints/b2WheelJoint.h deleted file mode 100644 index ede1b08b7c..0000000000 --- a/external/box2d/Dynamics/Joints/b2WheelJoint.h +++ /dev/null @@ -1,213 +0,0 @@ -/* -* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_WHEEL_JOINT_H -#define B2_WHEEL_JOINT_H - -#include - -/// Wheel joint definition. This requires defining a line of -/// motion using an axis and an anchor point. The definition uses local -/// anchor points and a local axis so that the initial configuration -/// can violate the constraint slightly. The joint translation is zero -/// when the local anchor points coincide in world space. Using local -/// anchors and a local axis helps when saving and loading a game. -struct b2WheelJointDef : public b2JointDef -{ - b2WheelJointDef() - { - type = e_wheelJoint; - localAnchorA.SetZero(); - localAnchorB.SetZero(); - localAxisA.Set(1.0f, 0.0f); - enableMotor = false; - maxMotorTorque = 0.0f; - motorSpeed = 0.0f; - frequencyHz = 2.0f; - dampingRatio = 0.7f; - } - - /// Initialize the bodies, anchors, axis, and reference angle using the world - /// anchor and world axis. - void Initialize(b2Body* bodyA, b2Body* bodyB, const b2Vec2& anchor, const b2Vec2& axis); - - /// The local anchor point relative to bodyA's origin. - b2Vec2 localAnchorA; - - /// The local anchor point relative to bodyB's origin. - b2Vec2 localAnchorB; - - /// The local translation axis in bodyA. - b2Vec2 localAxisA; - - /// Enable/disable the joint motor. - bool enableMotor; - - /// The maximum motor torque, usually in N-m. - float32 maxMotorTorque; - - /// The desired motor speed in radians per second. - float32 motorSpeed; - - /// Suspension frequency, zero indicates no suspension - float32 frequencyHz; - - /// Suspension damping ratio, one indicates critical damping - float32 dampingRatio; -}; - -/// A wheel joint. This joint provides two degrees of freedom: translation -/// along an axis fixed in bodyA and rotation in the plane. You can use a -/// joint limit to restrict the range of motion and a joint motor to drive -/// the rotation or to model rotational friction. -/// This joint is designed for vehicle suspensions. -class b2WheelJoint : public b2Joint -{ -public: - void GetDefinition(b2WheelJointDef* def) const; - - b2Vec2 GetAnchorA() const; - b2Vec2 GetAnchorB() const; - - b2Vec2 GetReactionForce(float32 inv_dt) const; - float32 GetReactionTorque(float32 inv_dt) const; - - /// The local anchor point relative to bodyA's origin. - const b2Vec2& GetLocalAnchorA() const { return m_localAnchorA; } - - /// The local anchor point relative to bodyB's origin. - const b2Vec2& GetLocalAnchorB() const { return m_localAnchorB; } - - /// The local joint axis relative to bodyA. - const b2Vec2& GetLocalAxisA() const { return m_localXAxisA; } - - /// Get the current joint translation, usually in meters. - float32 GetJointTranslation() const; - - /// Get the current joint translation speed, usually in meters per second. - float32 GetJointSpeed() const; - - /// Is the joint motor enabled? - bool IsMotorEnabled() const; - - /// Enable/disable the joint motor. - void EnableMotor(bool flag); - - /// Set the motor speed, usually in radians per second. - void SetMotorSpeed(float32 speed); - - /// Get the motor speed, usually in radians per second. - float32 GetMotorSpeed() const; - - /// Set/Get the maximum motor force, usually in N-m. - void SetMaxMotorTorque(float32 torque); - float32 GetMaxMotorTorque() const; - - /// Get the current motor torque given the inverse time step, usually in N-m. - float32 GetMotorTorque(float32 inv_dt) const; - - /// Set/Get the spring frequency in hertz. Setting the frequency to zero disables the spring. - void SetSpringFrequencyHz(float32 hz); - float32 GetSpringFrequencyHz() const; - - /// Set/Get the spring damping ratio - void SetSpringDampingRatio(float32 ratio); - float32 GetSpringDampingRatio() const; - - /// Dump to b2Log - void Dump(); - -protected: - - friend class b2Joint; - b2WheelJoint(const b2WheelJointDef* def); - - void InitVelocityConstraints(const b2SolverData& data); - void SolveVelocityConstraints(const b2SolverData& data); - bool SolvePositionConstraints(const b2SolverData& data); - - float32 m_frequencyHz; - float32 m_dampingRatio; - - // Solver shared - b2Vec2 m_localAnchorA; - b2Vec2 m_localAnchorB; - b2Vec2 m_localXAxisA; - b2Vec2 m_localYAxisA; - - float32 m_impulse; - float32 m_motorImpulse; - float32 m_springImpulse; - - float32 m_maxMotorTorque; - float32 m_motorSpeed; - bool m_enableMotor; - - // Solver temp - int32 m_indexA; - int32 m_indexB; - b2Vec2 m_localCenterA; - b2Vec2 m_localCenterB; - float32 m_invMassA; - float32 m_invMassB; - float32 m_invIA; - float32 m_invIB; - - b2Vec2 m_ax, m_ay; - float32 m_sAx, m_sBx; - float32 m_sAy, m_sBy; - - float32 m_mass; - float32 m_motorMass; - float32 m_springMass; - - float32 m_bias; - float32 m_gamma; -}; - -inline float32 b2WheelJoint::GetMotorSpeed() const -{ - return m_motorSpeed; -} - -inline float32 b2WheelJoint::GetMaxMotorTorque() const -{ - return m_maxMotorTorque; -} - -inline void b2WheelJoint::SetSpringFrequencyHz(float32 hz) -{ - m_frequencyHz = hz; -} - -inline float32 b2WheelJoint::GetSpringFrequencyHz() const -{ - return m_frequencyHz; -} - -inline void b2WheelJoint::SetSpringDampingRatio(float32 ratio) -{ - m_dampingRatio = ratio; -} - -inline float32 b2WheelJoint::GetSpringDampingRatio() const -{ - return m_dampingRatio; -} - -#endif diff --git a/external/box2d/Dynamics/b2Body.cpp b/external/box2d/Dynamics/b2Body.cpp deleted file mode 100644 index b22b574023..0000000000 --- a/external/box2d/Dynamics/b2Body.cpp +++ /dev/null @@ -1,514 +0,0 @@ -/* -* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include -#include -#include - -b2Body::b2Body(const b2BodyDef* bd, b2World* world) -{ - b2Assert(bd->position.IsValid()); - b2Assert(bd->linearVelocity.IsValid()); - b2Assert(b2IsValid(bd->angle)); - b2Assert(b2IsValid(bd->angularVelocity)); - b2Assert(b2IsValid(bd->angularDamping) && bd->angularDamping >= 0.0f); - b2Assert(b2IsValid(bd->linearDamping) && bd->linearDamping >= 0.0f); - - m_flags = 0; - - if (bd->bullet) - { - m_flags |= e_bulletFlag; - } - if (bd->fixedRotation) - { - m_flags |= e_fixedRotationFlag; - } - if (bd->allowSleep) - { - m_flags |= e_autoSleepFlag; - } - if (bd->awake) - { - m_flags |= e_awakeFlag; - } - if (bd->active) - { - m_flags |= e_activeFlag; - } - - m_world = world; - - m_xf.p = bd->position; - m_xf.q.Set(bd->angle); - - m_sweep.localCenter.SetZero(); - m_sweep.c0 = m_xf.p; - m_sweep.c = m_xf.p; - m_sweep.a0 = bd->angle; - m_sweep.a = bd->angle; - m_sweep.alpha0 = 0.0f; - - m_jointList = NULL; - m_contactList = NULL; - m_prev = NULL; - m_next = NULL; - - m_linearVelocity = bd->linearVelocity; - m_angularVelocity = bd->angularVelocity; - - m_linearDamping = bd->linearDamping; - m_angularDamping = bd->angularDamping; - m_gravityScale = bd->gravityScale; - - m_force.SetZero(); - m_torque = 0.0f; - - m_sleepTime = 0.0f; - - m_type = bd->type; - - if (m_type == b2_dynamicBody) - { - m_mass = 1.0f; - m_invMass = 1.0f; - } - else - { - m_mass = 0.0f; - m_invMass = 0.0f; - } - - m_I = 0.0f; - m_invI = 0.0f; - - m_userData = bd->userData; - - m_fixtureList = NULL; - m_fixtureCount = 0; -} - -b2Body::~b2Body() -{ - // shapes and joints are destroyed in b2World::Destroy -} - -void b2Body::SetType(b2BodyType type) -{ - b2Assert(m_world->IsLocked() == false); - if (m_world->IsLocked() == true) - { - return; - } - - if (m_type == type) - { - return; - } - - m_type = type; - - ResetMassData(); - - if (m_type == b2_staticBody) - { - m_linearVelocity.SetZero(); - m_angularVelocity = 0.0f; - m_sweep.a0 = m_sweep.a; - m_sweep.c0 = m_sweep.c; - SynchronizeFixtures(); - } - - SetAwake(true); - - m_force.SetZero(); - m_torque = 0.0f; - - // Since the body type changed, we need to flag contacts for filtering. - for (b2Fixture* f = m_fixtureList; f; f = f->m_next) - { - f->Refilter(); - } -} - -b2Fixture* b2Body::CreateFixture(const b2FixtureDef* def) -{ - b2Assert(m_world->IsLocked() == false); - if (m_world->IsLocked() == true) - { - return NULL; - } - - b2BlockAllocator* allocator = &m_world->m_blockAllocator; - - void* memory = allocator->Allocate(sizeof(b2Fixture)); - b2Fixture* fixture = new (memory) b2Fixture; - fixture->Create(allocator, this, def); - - if (m_flags & e_activeFlag) - { - b2BroadPhase* broadPhase = &m_world->m_contactManager.m_broadPhase; - fixture->CreateProxies(broadPhase, m_xf); - } - - fixture->m_next = m_fixtureList; - m_fixtureList = fixture; - ++m_fixtureCount; - - fixture->m_body = this; - - // Adjust mass properties if needed. - if (fixture->m_density > 0.0f) - { - ResetMassData(); - } - - // Let the world know we have a new fixture. This will cause new contacts - // to be created at the beginning of the next time step. - m_world->m_flags |= b2World::e_newFixture; - - return fixture; -} - -b2Fixture* b2Body::CreateFixture(const b2Shape* shape, float32 density) -{ - b2FixtureDef def; - def.shape = shape; - def.density = density; - - return CreateFixture(&def); -} - -void b2Body::DestroyFixture(b2Fixture* fixture) -{ - b2Assert(m_world->IsLocked() == false); - if (m_world->IsLocked() == true) - { - return; - } - - b2Assert(fixture->m_body == this); - - // Remove the fixture from this body's singly linked list. - b2Assert(m_fixtureCount > 0); - b2Fixture** node = &m_fixtureList; - bool found = false; - while (*node != NULL) - { - if (*node == fixture) - { - *node = fixture->m_next; - found = true; - break; - } - - node = &(*node)->m_next; - } - - // You tried to remove a shape that is not attached to this body. - b2Assert(found); - - // Destroy any contacts associated with the fixture. - b2ContactEdge* edge = m_contactList; - while (edge) - { - b2Contact* c = edge->contact; - edge = edge->next; - - b2Fixture* fixtureA = c->GetFixtureA(); - b2Fixture* fixtureB = c->GetFixtureB(); - - if (fixture == fixtureA || fixture == fixtureB) - { - // This destroys the contact and removes it from - // this body's contact list. - m_world->m_contactManager.Destroy(c); - } - } - - b2BlockAllocator* allocator = &m_world->m_blockAllocator; - - if (m_flags & e_activeFlag) - { - b2BroadPhase* broadPhase = &m_world->m_contactManager.m_broadPhase; - fixture->DestroyProxies(broadPhase); - } - - fixture->Destroy(allocator); - fixture->m_body = NULL; - fixture->m_next = NULL; - fixture->~b2Fixture(); - allocator->Free(fixture, sizeof(b2Fixture)); - - --m_fixtureCount; - - // Reset the mass data. - ResetMassData(); -} - -void b2Body::ResetMassData() -{ - // Compute mass data from shapes. Each shape has its own density. - m_mass = 0.0f; - m_invMass = 0.0f; - m_I = 0.0f; - m_invI = 0.0f; - m_sweep.localCenter.SetZero(); - - // Static and kinematic bodies have zero mass. - if (m_type == b2_staticBody || m_type == b2_kinematicBody) - { - m_sweep.c0 = m_xf.p; - m_sweep.c = m_xf.p; - m_sweep.a0 = m_sweep.a; - return; - } - - b2Assert(m_type == b2_dynamicBody); - - // Accumulate mass over all fixtures. - b2Vec2 localCenter = b2Vec2_zero; - for (b2Fixture* f = m_fixtureList; f; f = f->m_next) - { - if (f->m_density == 0.0f) - { - continue; - } - - b2MassData massData; - f->GetMassData(&massData); - m_mass += massData.mass; - localCenter += massData.mass * massData.center; - m_I += massData.I; - } - - // Compute center of mass. - if (m_mass > 0.0f) - { - m_invMass = 1.0f / m_mass; - localCenter *= m_invMass; - } - else - { - // Force all dynamic bodies to have a positive mass. - m_mass = 1.0f; - m_invMass = 1.0f; - } - - if (m_I > 0.0f && (m_flags & e_fixedRotationFlag) == 0) - { - // Center the inertia about the center of mass. - m_I -= m_mass * b2Dot(localCenter, localCenter); - b2Assert(m_I > 0.0f); - m_invI = 1.0f / m_I; - - } - else - { - m_I = 0.0f; - m_invI = 0.0f; - } - - // Move center of mass. - b2Vec2 oldCenter = m_sweep.c; - m_sweep.localCenter = localCenter; - m_sweep.c0 = m_sweep.c = b2Mul(m_xf, m_sweep.localCenter); - - // Update center of mass velocity. - m_linearVelocity += b2Cross(m_angularVelocity, m_sweep.c - oldCenter); -} - -void b2Body::SetMassData(const b2MassData* massData) -{ - b2Assert(m_world->IsLocked() == false); - if (m_world->IsLocked() == true) - { - return; - } - - if (m_type != b2_dynamicBody) - { - return; - } - - m_invMass = 0.0f; - m_I = 0.0f; - m_invI = 0.0f; - - m_mass = massData->mass; - if (m_mass <= 0.0f) - { - m_mass = 1.0f; - } - - m_invMass = 1.0f / m_mass; - - if (massData->I > 0.0f && (m_flags & b2Body::e_fixedRotationFlag) == 0) - { - m_I = massData->I - m_mass * b2Dot(massData->center, massData->center); - b2Assert(m_I > 0.0f); - m_invI = 1.0f / m_I; - } - - // Move center of mass. - b2Vec2 oldCenter = m_sweep.c; - m_sweep.localCenter = massData->center; - m_sweep.c0 = m_sweep.c = b2Mul(m_xf, m_sweep.localCenter); - - // Update center of mass velocity. - m_linearVelocity += b2Cross(m_angularVelocity, m_sweep.c - oldCenter); -} - -bool b2Body::ShouldCollide(const b2Body* other) const -{ - // At least one body should be dynamic. - if (m_type != b2_dynamicBody && other->m_type != b2_dynamicBody) - { - return false; - } - - // Does a joint prevent collision? - for (b2JointEdge* jn = m_jointList; jn; jn = jn->next) - { - if (jn->other == other) - { - if (jn->joint->m_collideConnected == false) - { - return false; - } - } - } - - return true; -} - -void b2Body::SetTransform(const b2Vec2& position, float32 angle) -{ - b2Assert(m_world->IsLocked() == false); - if (m_world->IsLocked() == true) - { - return; - } - - m_xf.q.Set(angle); - m_xf.p = position; - - m_sweep.c = b2Mul(m_xf, m_sweep.localCenter); - m_sweep.a = angle; - - m_sweep.c0 = m_sweep.c; - m_sweep.a0 = angle; - - b2BroadPhase* broadPhase = &m_world->m_contactManager.m_broadPhase; - for (b2Fixture* f = m_fixtureList; f; f = f->m_next) - { - f->Synchronize(broadPhase, m_xf, m_xf); - } - - m_world->m_contactManager.FindNewContacts(); -} - -void b2Body::SynchronizeFixtures() -{ - b2Transform xf1; - xf1.q.Set(m_sweep.a0); - xf1.p = m_sweep.c0 - b2Mul(xf1.q, m_sweep.localCenter); - - b2BroadPhase* broadPhase = &m_world->m_contactManager.m_broadPhase; - for (b2Fixture* f = m_fixtureList; f; f = f->m_next) - { - f->Synchronize(broadPhase, xf1, m_xf); - } -} - -void b2Body::SetActive(bool flag) -{ - b2Assert(m_world->IsLocked() == false); - - if (flag == IsActive()) - { - return; - } - - if (flag) - { - m_flags |= e_activeFlag; - - // Create all proxies. - b2BroadPhase* broadPhase = &m_world->m_contactManager.m_broadPhase; - for (b2Fixture* f = m_fixtureList; f; f = f->m_next) - { - f->CreateProxies(broadPhase, m_xf); - } - - // Contacts are created the next time step. - } - else - { - m_flags &= ~e_activeFlag; - - // Destroy all proxies. - b2BroadPhase* broadPhase = &m_world->m_contactManager.m_broadPhase; - for (b2Fixture* f = m_fixtureList; f; f = f->m_next) - { - f->DestroyProxies(broadPhase); - } - - // Destroy the attached contacts. - b2ContactEdge* ce = m_contactList; - while (ce) - { - b2ContactEdge* ce0 = ce; - ce = ce->next; - m_world->m_contactManager.Destroy(ce0->contact); - } - m_contactList = NULL; - } -} - -void b2Body::Dump() -{ - int32 bodyIndex = m_islandIndex; - - b2Log("{\n"); - b2Log(" b2BodyDef bd;\n"); - b2Log(" bd.type = b2BodyType(%d);\n", m_type); - b2Log(" bd.position.Set(%.15lef, %.15lef);\n", m_xf.p.x, m_xf.p.y); - b2Log(" bd.angle = %.15lef;\n", m_sweep.a); - b2Log(" bd.linearVelocity.Set(%.15lef, %.15lef);\n", m_linearVelocity.x, m_linearVelocity.y); - b2Log(" bd.angularVelocity = %.15lef;\n", m_angularVelocity); - b2Log(" bd.linearDamping = %.15lef;\n", m_linearDamping); - b2Log(" bd.angularDamping = %.15lef;\n", m_angularDamping); - b2Log(" bd.allowSleep = bool(%d);\n", m_flags & e_autoSleepFlag); - b2Log(" bd.awake = bool(%d);\n", m_flags & e_awakeFlag); - b2Log(" bd.fixedRotation = bool(%d);\n", m_flags & e_fixedRotationFlag); - b2Log(" bd.bullet = bool(%d);\n", m_flags & e_bulletFlag); - b2Log(" bd.active = bool(%d);\n", m_flags & e_activeFlag); - b2Log(" bd.gravityScale = %.15lef;\n", m_gravityScale); - b2Log(" bodies[%d] = m_world->CreateBody(&bd);\n", m_islandIndex); - b2Log("\n"); - for (b2Fixture* f = m_fixtureList; f; f = f->m_next) - { - b2Log(" {\n"); - f->Dump(bodyIndex); - b2Log(" }\n"); - } - b2Log("}\n"); -} \ No newline at end of file diff --git a/external/box2d/Dynamics/b2Body.h b/external/box2d/Dynamics/b2Body.h deleted file mode 100644 index e2d16bf630..0000000000 --- a/external/box2d/Dynamics/b2Body.h +++ /dev/null @@ -1,846 +0,0 @@ -/* -* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_BODY_H -#define B2_BODY_H - -#include -#include -#include - -class b2Fixture; -class b2Joint; -class b2Contact; -class b2Controller; -class b2World; -struct b2FixtureDef; -struct b2JointEdge; -struct b2ContactEdge; - -/// The body type. -/// static: zero mass, zero velocity, may be manually moved -/// kinematic: zero mass, non-zero velocity set by user, moved by solver -/// dynamic: positive mass, non-zero velocity determined by forces, moved by solver -enum b2BodyType -{ - b2_staticBody = 0, - b2_kinematicBody, - b2_dynamicBody - - // TODO_ERIN - //b2_bulletBody, -}; - -/// A body definition holds all the data needed to construct a rigid body. -/// You can safely re-use body definitions. Shapes are added to a body after construction. -struct b2BodyDef -{ - /// This constructor sets the body definition default values. - b2BodyDef() - { - userData = NULL; - position.Set(0.0f, 0.0f); - angle = 0.0f; - linearVelocity.Set(0.0f, 0.0f); - angularVelocity = 0.0f; - linearDamping = 0.0f; - angularDamping = 0.0f; - allowSleep = true; - awake = true; - fixedRotation = false; - bullet = false; - type = b2_staticBody; - active = true; - gravityScale = 1.0f; - } - - /// The body type: static, kinematic, or dynamic. - /// Note: if a dynamic body would have zero mass, the mass is set to one. - b2BodyType type; - - /// The world position of the body. Avoid creating bodies at the origin - /// since this can lead to many overlapping shapes. - b2Vec2 position; - - /// The world angle of the body in radians. - float32 angle; - - /// The linear velocity of the body's origin in world co-ordinates. - b2Vec2 linearVelocity; - - /// The angular velocity of the body. - float32 angularVelocity; - - /// Linear damping is use to reduce the linear velocity. The damping parameter - /// can be larger than 1.0f but the damping effect becomes sensitive to the - /// time step when the damping parameter is large. - float32 linearDamping; - - /// Angular damping is use to reduce the angular velocity. The damping parameter - /// can be larger than 1.0f but the damping effect becomes sensitive to the - /// time step when the damping parameter is large. - float32 angularDamping; - - /// Set this flag to false if this body should never fall asleep. Note that - /// this increases CPU usage. - bool allowSleep; - - /// Is this body initially awake or sleeping? - bool awake; - - /// Should this body be prevented from rotating? Useful for characters. - bool fixedRotation; - - /// Is this a fast moving body that should be prevented from tunneling through - /// other moving bodies? Note that all bodies are prevented from tunneling through - /// kinematic and static bodies. This setting is only considered on dynamic bodies. - /// @warning You should use this flag sparingly since it increases processing time. - bool bullet; - - /// Does this body start out active? - bool active; - - /// Use this to store application specific body data. - void* userData; - - /// Scale the gravity applied to this body. - float32 gravityScale; -}; - -/// A rigid body. These are created via b2World::CreateBody. -class b2Body -{ -public: - /// Creates a fixture and attach it to this body. Use this function if you need - /// to set some fixture parameters, like friction. Otherwise you can create the - /// fixture directly from a shape. - /// If the density is non-zero, this function automatically updates the mass of the body. - /// Contacts are not created until the next time step. - /// @param def the fixture definition. - /// @warning This function is locked during callbacks. - b2Fixture* CreateFixture(const b2FixtureDef* def); - - /// Creates a fixture from a shape and attach it to this body. - /// This is a convenience function. Use b2FixtureDef if you need to set parameters - /// like friction, restitution, user data, or filtering. - /// If the density is non-zero, this function automatically updates the mass of the body. - /// @param shape the shape to be cloned. - /// @param density the shape density (set to zero for static bodies). - /// @warning This function is locked during callbacks. - b2Fixture* CreateFixture(const b2Shape* shape, float32 density); - - /// Destroy a fixture. This removes the fixture from the broad-phase and - /// destroys all contacts associated with this fixture. This will - /// automatically adjust the mass of the body if the body is dynamic and the - /// fixture has positive density. - /// All fixtures attached to a body are implicitly destroyed when the body is destroyed. - /// @param fixture the fixture to be removed. - /// @warning This function is locked during callbacks. - void DestroyFixture(b2Fixture* fixture); - - /// Set the position of the body's origin and rotation. - /// This breaks any contacts and wakes the other bodies. - /// Manipulating a body's transform may cause non-physical behavior. - /// @param position the world position of the body's local origin. - /// @param angle the world rotation in radians. - void SetTransform(const b2Vec2& position, float32 angle); - - /// Get the body transform for the body's origin. - /// @return the world transform of the body's origin. - const b2Transform& GetTransform() const; - - /// Get the world body origin position. - /// @return the world position of the body's origin. - const b2Vec2& GetPosition() const; - - /// Get the angle in radians. - /// @return the current world rotation angle in radians. - float32 GetAngle() const; - - /// Get the world position of the center of mass. - const b2Vec2& GetWorldCenter() const; - - /// Get the local position of the center of mass. - const b2Vec2& GetLocalCenter() const; - - /// Set the linear velocity of the center of mass. - /// @param v the new linear velocity of the center of mass. - void SetLinearVelocity(const b2Vec2& v); - - /// Get the linear velocity of the center of mass. - /// @return the linear velocity of the center of mass. - b2Vec2 GetLinearVelocity() const; - - /// Set the angular velocity. - /// @param omega the new angular velocity in radians/second. - void SetAngularVelocity(float32 omega); - - /// Get the angular velocity. - /// @return the angular velocity in radians/second. - float32 GetAngularVelocity() const; - - /// Apply a force at a world point. If the force is not - /// applied at the center of mass, it will generate a torque and - /// affect the angular velocity. This wakes up the body. - /// @param force the world force vector, usually in Newtons (N). - /// @param point the world position of the point of application. - void ApplyForce(const b2Vec2& force, const b2Vec2& point); - - /// Apply a force to the center of mass. This wakes up the body. - /// @param force the world force vector, usually in Newtons (N). - void ApplyForceToCenter(const b2Vec2& force); - - /// Apply a torque. This affects the angular velocity - /// without affecting the linear velocity of the center of mass. - /// This wakes up the body. - /// @param torque about the z-axis (out of the screen), usually in N-m. - void ApplyTorque(float32 torque); - - /// Apply an impulse at a point. This immediately modifies the velocity. - /// It also modifies the angular velocity if the point of application - /// is not at the center of mass. This wakes up the body. - /// @param impulse the world impulse vector, usually in N-seconds or kg-m/s. - /// @param point the world position of the point of application. - void ApplyLinearImpulse(const b2Vec2& impulse, const b2Vec2& point); - - /// Apply an angular impulse. - /// @param impulse the angular impulse in units of kg*m*m/s - void ApplyAngularImpulse(float32 impulse); - - /// Get the total mass of the body. - /// @return the mass, usually in kilograms (kg). - float32 GetMass() const; - - /// Get the rotational inertia of the body about the local origin. - /// @return the rotational inertia, usually in kg-m^2. - float32 GetInertia() const; - - /// Get the mass data of the body. - /// @return a struct containing the mass, inertia and center of the body. - void GetMassData(b2MassData* data) const; - - /// Set the mass properties to override the mass properties of the fixtures. - /// Note that this changes the center of mass position. - /// Note that creating or destroying fixtures can also alter the mass. - /// This function has no effect if the body isn't dynamic. - /// @param massData the mass properties. - void SetMassData(const b2MassData* data); - - /// This resets the mass properties to the sum of the mass properties of the fixtures. - /// This normally does not need to be called unless you called SetMassData to override - /// the mass and you later want to reset the mass. - void ResetMassData(); - - /// Get the world coordinates of a point given the local coordinates. - /// @param localPoint a point on the body measured relative the the body's origin. - /// @return the same point expressed in world coordinates. - b2Vec2 GetWorldPoint(const b2Vec2& localPoint) const; - - /// Get the world coordinates of a vector given the local coordinates. - /// @param localVector a vector fixed in the body. - /// @return the same vector expressed in world coordinates. - b2Vec2 GetWorldVector(const b2Vec2& localVector) const; - - /// Gets a local point relative to the body's origin given a world point. - /// @param a point in world coordinates. - /// @return the corresponding local point relative to the body's origin. - b2Vec2 GetLocalPoint(const b2Vec2& worldPoint) const; - - /// Gets a local vector given a world vector. - /// @param a vector in world coordinates. - /// @return the corresponding local vector. - b2Vec2 GetLocalVector(const b2Vec2& worldVector) const; - - /// Get the world linear velocity of a world point attached to this body. - /// @param a point in world coordinates. - /// @return the world velocity of a point. - b2Vec2 GetLinearVelocityFromWorldPoint(const b2Vec2& worldPoint) const; - - /// Get the world velocity of a local point. - /// @param a point in local coordinates. - /// @return the world velocity of a point. - b2Vec2 GetLinearVelocityFromLocalPoint(const b2Vec2& localPoint) const; - - /// Get the linear damping of the body. - float32 GetLinearDamping() const; - - /// Set the linear damping of the body. - void SetLinearDamping(float32 linearDamping); - - /// Get the angular damping of the body. - float32 GetAngularDamping() const; - - /// Set the angular damping of the body. - void SetAngularDamping(float32 angularDamping); - - /// Get the gravity scale of the body. - float32 GetGravityScale() const; - - /// Set the gravity scale of the body. - void SetGravityScale(float32 scale); - - /// Set the type of this body. This may alter the mass and velocity. - void SetType(b2BodyType type); - - /// Get the type of this body. - b2BodyType GetType() const; - - /// Should this body be treated like a bullet for continuous collision detection? - void SetBullet(bool flag); - - /// Is this body treated like a bullet for continuous collision detection? - bool IsBullet() const; - - /// You can disable sleeping on this body. If you disable sleeping, the - /// body will be woken. - void SetSleepingAllowed(bool flag); - - /// Is this body allowed to sleep - bool IsSleepingAllowed() const; - - /// Set the sleep state of the body. A sleeping body has very - /// low CPU cost. - /// @param flag set to true to put body to sleep, false to wake it. - void SetAwake(bool flag); - - /// Get the sleeping state of this body. - /// @return true if the body is sleeping. - bool IsAwake() const; - - /// Set the active state of the body. An inactive body is not - /// simulated and cannot be collided with or woken up. - /// If you pass a flag of true, all fixtures will be added to the - /// broad-phase. - /// If you pass a flag of false, all fixtures will be removed from - /// the broad-phase and all contacts will be destroyed. - /// Fixtures and joints are otherwise unaffected. You may continue - /// to create/destroy fixtures and joints on inactive bodies. - /// Fixtures on an inactive body are implicitly inactive and will - /// not participate in collisions, ray-casts, or queries. - /// Joints connected to an inactive body are implicitly inactive. - /// An inactive body is still owned by a b2World object and remains - /// in the body list. - void SetActive(bool flag); - - /// Get the active state of the body. - bool IsActive() const; - - /// Set this body to have fixed rotation. This causes the mass - /// to be reset. - void SetFixedRotation(bool flag); - - /// Does this body have fixed rotation? - bool IsFixedRotation() const; - - /// Get the list of all fixtures attached to this body. - b2Fixture* GetFixtureList(); - const b2Fixture* GetFixtureList() const; - - /// Get the list of all joints attached to this body. - b2JointEdge* GetJointList(); - const b2JointEdge* GetJointList() const; - - /// Get the list of all contacts attached to this body. - /// @warning this list changes during the time step and you may - /// miss some collisions if you don't use b2ContactListener. - b2ContactEdge* GetContactList(); - const b2ContactEdge* GetContactList() const; - - /// Get the next body in the world's body list. - b2Body* GetNext(); - const b2Body* GetNext() const; - - /// Get the user data pointer that was provided in the body definition. - void* GetUserData() const; - - /// Set the user data. Use this to store your application specific data. - void SetUserData(void* data); - - /// Get the parent world of this body. - b2World* GetWorld(); - const b2World* GetWorld() const; - - /// Dump this body to a log file - void Dump(); - -private: - - friend class b2World; - friend class b2Island; - friend class b2ContactManager; - friend class b2ContactSolver; - friend class b2Contact; - - friend class b2DistanceJoint; - friend class b2GearJoint; - friend class b2WheelJoint; - friend class b2MouseJoint; - friend class b2PrismaticJoint; - friend class b2PulleyJoint; - friend class b2RevoluteJoint; - friend class b2WeldJoint; - friend class b2FrictionJoint; - friend class b2RopeJoint; - - // m_flags - enum - { - e_islandFlag = 0x0001, - e_awakeFlag = 0x0002, - e_autoSleepFlag = 0x0004, - e_bulletFlag = 0x0008, - e_fixedRotationFlag = 0x0010, - e_activeFlag = 0x0020, - e_toiFlag = 0x0040 - }; - - b2Body(const b2BodyDef* bd, b2World* world); - ~b2Body(); - - void SynchronizeFixtures(); - void SynchronizeTransform(); - - // This is used to prevent connected bodies from colliding. - // It may lie, depending on the collideConnected flag. - bool ShouldCollide(const b2Body* other) const; - - void Advance(float32 t); - - b2BodyType m_type; - - uint16 m_flags; - - int32 m_islandIndex; - - b2Transform m_xf; // the body origin transform - b2Sweep m_sweep; // the swept motion for CCD - - b2Vec2 m_linearVelocity; - float32 m_angularVelocity; - - b2Vec2 m_force; - float32 m_torque; - - b2World* m_world; - b2Body* m_prev; - b2Body* m_next; - - b2Fixture* m_fixtureList; - int32 m_fixtureCount; - - b2JointEdge* m_jointList; - b2ContactEdge* m_contactList; - - float32 m_mass, m_invMass; - - // Rotational inertia about the center of mass. - float32 m_I, m_invI; - - float32 m_linearDamping; - float32 m_angularDamping; - float32 m_gravityScale; - - float32 m_sleepTime; - - void* m_userData; -}; - -inline b2BodyType b2Body::GetType() const -{ - return m_type; -} - -inline const b2Transform& b2Body::GetTransform() const -{ - return m_xf; -} - -inline const b2Vec2& b2Body::GetPosition() const -{ - return m_xf.p; -} - -inline float32 b2Body::GetAngle() const -{ - return m_sweep.a; -} - -inline const b2Vec2& b2Body::GetWorldCenter() const -{ - return m_sweep.c; -} - -inline const b2Vec2& b2Body::GetLocalCenter() const -{ - return m_sweep.localCenter; -} - -inline void b2Body::SetLinearVelocity(const b2Vec2& v) -{ - if (m_type == b2_staticBody) - { - return; - } - - if (b2Dot(v,v) > 0.0f) - { - SetAwake(true); - } - - m_linearVelocity = v; -} - -inline b2Vec2 b2Body::GetLinearVelocity() const -{ - return m_linearVelocity; -} - -inline void b2Body::SetAngularVelocity(float32 w) -{ - if (m_type == b2_staticBody) - { - return; - } - - if (w * w > 0.0f) - { - SetAwake(true); - } - - m_angularVelocity = w; -} - -inline float32 b2Body::GetAngularVelocity() const -{ - return m_angularVelocity; -} - -inline float32 b2Body::GetMass() const -{ - return m_mass; -} - -inline float32 b2Body::GetInertia() const -{ - return m_I + m_mass * b2Dot(m_sweep.localCenter, m_sweep.localCenter); -} - -inline void b2Body::GetMassData(b2MassData* data) const -{ - data->mass = m_mass; - data->I = m_I + m_mass * b2Dot(m_sweep.localCenter, m_sweep.localCenter); - data->center = m_sweep.localCenter; -} - -inline b2Vec2 b2Body::GetWorldPoint(const b2Vec2& localPoint) const -{ - return b2Mul(m_xf, localPoint); -} - -inline b2Vec2 b2Body::GetWorldVector(const b2Vec2& localVector) const -{ - return b2Mul(m_xf.q, localVector); -} - -inline b2Vec2 b2Body::GetLocalPoint(const b2Vec2& worldPoint) const -{ - return b2MulT(m_xf, worldPoint); -} - -inline b2Vec2 b2Body::GetLocalVector(const b2Vec2& worldVector) const -{ - return b2MulT(m_xf.q, worldVector); -} - -inline b2Vec2 b2Body::GetLinearVelocityFromWorldPoint(const b2Vec2& worldPoint) const -{ - return m_linearVelocity + b2Cross(m_angularVelocity, worldPoint - m_sweep.c); -} - -inline b2Vec2 b2Body::GetLinearVelocityFromLocalPoint(const b2Vec2& localPoint) const -{ - return GetLinearVelocityFromWorldPoint(GetWorldPoint(localPoint)); -} - -inline float32 b2Body::GetLinearDamping() const -{ - return m_linearDamping; -} - -inline void b2Body::SetLinearDamping(float32 linearDamping) -{ - m_linearDamping = linearDamping; -} - -inline float32 b2Body::GetAngularDamping() const -{ - return m_angularDamping; -} - -inline void b2Body::SetAngularDamping(float32 angularDamping) -{ - m_angularDamping = angularDamping; -} - -inline float32 b2Body::GetGravityScale() const -{ - return m_gravityScale; -} - -inline void b2Body::SetGravityScale(float32 scale) -{ - m_gravityScale = scale; -} - -inline void b2Body::SetBullet(bool flag) -{ - if (flag) - { - m_flags |= e_bulletFlag; - } - else - { - m_flags &= ~e_bulletFlag; - } -} - -inline bool b2Body::IsBullet() const -{ - return (m_flags & e_bulletFlag) == e_bulletFlag; -} - -inline void b2Body::SetAwake(bool flag) -{ - if (flag) - { - if ((m_flags & e_awakeFlag) == 0) - { - m_flags |= e_awakeFlag; - m_sleepTime = 0.0f; - } - } - else - { - m_flags &= ~e_awakeFlag; - m_sleepTime = 0.0f; - m_linearVelocity.SetZero(); - m_angularVelocity = 0.0f; - m_force.SetZero(); - m_torque = 0.0f; - } -} - -inline bool b2Body::IsAwake() const -{ - return (m_flags & e_awakeFlag) == e_awakeFlag; -} - -inline bool b2Body::IsActive() const -{ - return (m_flags & e_activeFlag) == e_activeFlag; -} - -inline void b2Body::SetFixedRotation(bool flag) -{ - if (flag) - { - m_flags |= e_fixedRotationFlag; - } - else - { - m_flags &= ~e_fixedRotationFlag; - } - - ResetMassData(); -} - -inline bool b2Body::IsFixedRotation() const -{ - return (m_flags & e_fixedRotationFlag) == e_fixedRotationFlag; -} - -inline void b2Body::SetSleepingAllowed(bool flag) -{ - if (flag) - { - m_flags |= e_autoSleepFlag; - } - else - { - m_flags &= ~e_autoSleepFlag; - SetAwake(true); - } -} - -inline bool b2Body::IsSleepingAllowed() const -{ - return (m_flags & e_autoSleepFlag) == e_autoSleepFlag; -} - -inline b2Fixture* b2Body::GetFixtureList() -{ - return m_fixtureList; -} - -inline const b2Fixture* b2Body::GetFixtureList() const -{ - return m_fixtureList; -} - -inline b2JointEdge* b2Body::GetJointList() -{ - return m_jointList; -} - -inline const b2JointEdge* b2Body::GetJointList() const -{ - return m_jointList; -} - -inline b2ContactEdge* b2Body::GetContactList() -{ - return m_contactList; -} - -inline const b2ContactEdge* b2Body::GetContactList() const -{ - return m_contactList; -} - -inline b2Body* b2Body::GetNext() -{ - return m_next; -} - -inline const b2Body* b2Body::GetNext() const -{ - return m_next; -} - -inline void b2Body::SetUserData(void* data) -{ - m_userData = data; -} - -inline void* b2Body::GetUserData() const -{ - return m_userData; -} - -inline void b2Body::ApplyForce(const b2Vec2& force, const b2Vec2& point) -{ - if (m_type != b2_dynamicBody) - { - return; - } - - if (IsAwake() == false) - { - SetAwake(true); - } - - m_force += force; - m_torque += b2Cross(point - m_sweep.c, force); -} - -inline void b2Body::ApplyForceToCenter(const b2Vec2& force) -{ - if (m_type != b2_dynamicBody) - { - return; - } - - if (IsAwake() == false) - { - SetAwake(true); - } - - m_force += force; -} - -inline void b2Body::ApplyTorque(float32 torque) -{ - if (m_type != b2_dynamicBody) - { - return; - } - - if (IsAwake() == false) - { - SetAwake(true); - } - - m_torque += torque; -} - -inline void b2Body::ApplyLinearImpulse(const b2Vec2& impulse, const b2Vec2& point) -{ - if (m_type != b2_dynamicBody) - { - return; - } - - if (IsAwake() == false) - { - SetAwake(true); - } - m_linearVelocity += m_invMass * impulse; - m_angularVelocity += m_invI * b2Cross(point - m_sweep.c, impulse); -} - -inline void b2Body::ApplyAngularImpulse(float32 impulse) -{ - if (m_type != b2_dynamicBody) - { - return; - } - - if (IsAwake() == false) - { - SetAwake(true); - } - m_angularVelocity += m_invI * impulse; -} - -inline void b2Body::SynchronizeTransform() -{ - m_xf.q.Set(m_sweep.a); - m_xf.p = m_sweep.c - b2Mul(m_xf.q, m_sweep.localCenter); -} - -inline void b2Body::Advance(float32 alpha) -{ - // Advance to the new safe time. This doesn't sync the broad-phase. - m_sweep.Advance(alpha); - m_sweep.c = m_sweep.c0; - m_sweep.a = m_sweep.a0; - m_xf.q.Set(m_sweep.a); - m_xf.p = m_sweep.c - b2Mul(m_xf.q, m_sweep.localCenter); -} - -inline b2World* b2Body::GetWorld() -{ - return m_world; -} - -inline const b2World* b2Body::GetWorld() const -{ - return m_world; -} - -#endif diff --git a/external/box2d/Dynamics/b2ContactManager.cpp b/external/box2d/Dynamics/b2ContactManager.cpp deleted file mode 100644 index c14cc4ce45..0000000000 --- a/external/box2d/Dynamics/b2ContactManager.cpp +++ /dev/null @@ -1,293 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include -#include -#include - -b2ContactFilter b2_defaultFilter; -b2ContactListener b2_defaultListener; - -b2ContactManager::b2ContactManager() -{ - m_contactList = NULL; - m_contactCount = 0; - m_contactFilter = &b2_defaultFilter; - m_contactListener = &b2_defaultListener; - m_allocator = NULL; -} - -void b2ContactManager::Destroy(b2Contact* c) -{ - b2Fixture* fixtureA = c->GetFixtureA(); - b2Fixture* fixtureB = c->GetFixtureB(); - b2Body* bodyA = fixtureA->GetBody(); - b2Body* bodyB = fixtureB->GetBody(); - - if (m_contactListener && c->IsTouching()) - { - m_contactListener->EndContact(c); - } - - // Remove from the world. - if (c->m_prev) - { - c->m_prev->m_next = c->m_next; - } - - if (c->m_next) - { - c->m_next->m_prev = c->m_prev; - } - - if (c == m_contactList) - { - m_contactList = c->m_next; - } - - // Remove from body 1 - if (c->m_nodeA.prev) - { - c->m_nodeA.prev->next = c->m_nodeA.next; - } - - if (c->m_nodeA.next) - { - c->m_nodeA.next->prev = c->m_nodeA.prev; - } - - if (&c->m_nodeA == bodyA->m_contactList) - { - bodyA->m_contactList = c->m_nodeA.next; - } - - // Remove from body 2 - if (c->m_nodeB.prev) - { - c->m_nodeB.prev->next = c->m_nodeB.next; - } - - if (c->m_nodeB.next) - { - c->m_nodeB.next->prev = c->m_nodeB.prev; - } - - if (&c->m_nodeB == bodyB->m_contactList) - { - bodyB->m_contactList = c->m_nodeB.next; - } - - // Call the factory. - b2Contact::Destroy(c, m_allocator); - --m_contactCount; -} - -// This is the top level collision call for the time step. Here -// all the narrow phase collision is processed for the world -// contact list. -void b2ContactManager::Collide() -{ - // Update awake contacts. - b2Contact* c = m_contactList; - while (c) - { - b2Fixture* fixtureA = c->GetFixtureA(); - b2Fixture* fixtureB = c->GetFixtureB(); - int32 indexA = c->GetChildIndexA(); - int32 indexB = c->GetChildIndexB(); - b2Body* bodyA = fixtureA->GetBody(); - b2Body* bodyB = fixtureB->GetBody(); - - // Is this contact flagged for filtering? - if (c->m_flags & b2Contact::e_filterFlag) - { - // Should these bodies collide? - if (bodyB->ShouldCollide(bodyA) == false) - { - b2Contact* cNuke = c; - c = cNuke->GetNext(); - Destroy(cNuke); - continue; - } - - // Check user filtering. - if (m_contactFilter && m_contactFilter->ShouldCollide(fixtureA, fixtureB) == false) - { - b2Contact* cNuke = c; - c = cNuke->GetNext(); - Destroy(cNuke); - continue; - } - - // Clear the filtering flag. - c->m_flags &= ~b2Contact::e_filterFlag; - } - - bool activeA = bodyA->IsAwake() && bodyA->m_type != b2_staticBody; - bool activeB = bodyB->IsAwake() && bodyB->m_type != b2_staticBody; - - // At least one body must be awake and it must be dynamic or kinematic. - if (activeA == false && activeB == false) - { - c = c->GetNext(); - continue; - } - - int32 proxyIdA = fixtureA->m_proxies[indexA].proxyId; - int32 proxyIdB = fixtureB->m_proxies[indexB].proxyId; - bool overlap = m_broadPhase.TestOverlap(proxyIdA, proxyIdB); - - // Here we destroy contacts that cease to overlap in the broad-phase. - if (overlap == false) - { - b2Contact* cNuke = c; - c = cNuke->GetNext(); - Destroy(cNuke); - continue; - } - - // The contact persists. - c->Update(m_contactListener); - c = c->GetNext(); - } -} - -void b2ContactManager::FindNewContacts() -{ - m_broadPhase.UpdatePairs(this); -} - -void b2ContactManager::AddPair(void* proxyUserDataA, void* proxyUserDataB) -{ - b2FixtureProxy* proxyA = (b2FixtureProxy*)proxyUserDataA; - b2FixtureProxy* proxyB = (b2FixtureProxy*)proxyUserDataB; - - b2Fixture* fixtureA = proxyA->fixture; - b2Fixture* fixtureB = proxyB->fixture; - - int32 indexA = proxyA->childIndex; - int32 indexB = proxyB->childIndex; - - b2Body* bodyA = fixtureA->GetBody(); - b2Body* bodyB = fixtureB->GetBody(); - - // Are the fixtures on the same body? - if (bodyA == bodyB) - { - return; - } - - // TODO_ERIN use a hash table to remove a potential bottleneck when both - // bodies have a lot of contacts. - // Does a contact already exist? - b2ContactEdge* edge = bodyB->GetContactList(); - while (edge) - { - if (edge->other == bodyA) - { - b2Fixture* fA = edge->contact->GetFixtureA(); - b2Fixture* fB = edge->contact->GetFixtureB(); - int32 iA = edge->contact->GetChildIndexA(); - int32 iB = edge->contact->GetChildIndexB(); - - if (fA == fixtureA && fB == fixtureB && iA == indexA && iB == indexB) - { - // A contact already exists. - return; - } - - if (fA == fixtureB && fB == fixtureA && iA == indexB && iB == indexA) - { - // A contact already exists. - return; - } - } - - edge = edge->next; - } - - // Does a joint override collision? Is at least one body dynamic? - if (bodyB->ShouldCollide(bodyA) == false) - { - return; - } - - // Check user filtering. - if (m_contactFilter && m_contactFilter->ShouldCollide(fixtureA, fixtureB) == false) - { - return; - } - - // Call the factory. - b2Contact* c = b2Contact::Create(fixtureA, indexA, fixtureB, indexB, m_allocator); - if (c == NULL) - { - return; - } - - // Contact creation may swap fixtures. - fixtureA = c->GetFixtureA(); - fixtureB = c->GetFixtureB(); - indexA = c->GetChildIndexA(); - indexB = c->GetChildIndexB(); - bodyA = fixtureA->GetBody(); - bodyB = fixtureB->GetBody(); - - // Insert into the world. - c->m_prev = NULL; - c->m_next = m_contactList; - if (m_contactList != NULL) - { - m_contactList->m_prev = c; - } - m_contactList = c; - - // Connect to island graph. - - // Connect to body A - c->m_nodeA.contact = c; - c->m_nodeA.other = bodyB; - - c->m_nodeA.prev = NULL; - c->m_nodeA.next = bodyA->m_contactList; - if (bodyA->m_contactList != NULL) - { - bodyA->m_contactList->prev = &c->m_nodeA; - } - bodyA->m_contactList = &c->m_nodeA; - - // Connect to body B - c->m_nodeB.contact = c; - c->m_nodeB.other = bodyA; - - c->m_nodeB.prev = NULL; - c->m_nodeB.next = bodyB->m_contactList; - if (bodyB->m_contactList != NULL) - { - bodyB->m_contactList->prev = &c->m_nodeB; - } - bodyB->m_contactList = &c->m_nodeB; - - // Wake up the bodies - bodyA->SetAwake(true); - bodyB->SetAwake(true); - - ++m_contactCount; -} diff --git a/external/box2d/Dynamics/b2ContactManager.h b/external/box2d/Dynamics/b2ContactManager.h deleted file mode 100644 index 9cb5718145..0000000000 --- a/external/box2d/Dynamics/b2ContactManager.h +++ /dev/null @@ -1,52 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_CONTACT_MANAGER_H -#define B2_CONTACT_MANAGER_H - -#include - -class b2Contact; -class b2ContactFilter; -class b2ContactListener; -class b2BlockAllocator; - -// Delegate of b2World. -class b2ContactManager -{ -public: - b2ContactManager(); - - // Broad-phase callback. - void AddPair(void* proxyUserDataA, void* proxyUserDataB); - - void FindNewContacts(); - - void Destroy(b2Contact* c); - - void Collide(); - - b2BroadPhase m_broadPhase; - b2Contact* m_contactList; - int32 m_contactCount; - b2ContactFilter* m_contactFilter; - b2ContactListener* m_contactListener; - b2BlockAllocator* m_allocator; -}; - -#endif diff --git a/external/box2d/Dynamics/b2Fixture.cpp b/external/box2d/Dynamics/b2Fixture.cpp deleted file mode 100644 index 774a78e5bb..0000000000 --- a/external/box2d/Dynamics/b2Fixture.cpp +++ /dev/null @@ -1,303 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -b2Fixture::b2Fixture() -{ - m_userData = NULL; - m_body = NULL; - m_next = NULL; - m_proxies = NULL; - m_proxyCount = 0; - m_shape = NULL; - m_density = 0.0f; -} - -void b2Fixture::Create(b2BlockAllocator* allocator, b2Body* body, const b2FixtureDef* def) -{ - m_userData = def->userData; - m_friction = def->friction; - m_restitution = def->restitution; - - m_body = body; - m_next = NULL; - - m_filter = def->filter; - - m_isSensor = def->isSensor; - - m_shape = def->shape->Clone(allocator); - - // Reserve proxy space - int32 childCount = m_shape->GetChildCount(); - m_proxies = (b2FixtureProxy*)allocator->Allocate(childCount * sizeof(b2FixtureProxy)); - for (int32 i = 0; i < childCount; ++i) - { - m_proxies[i].fixture = NULL; - m_proxies[i].proxyId = b2BroadPhase::e_nullProxy; - } - m_proxyCount = 0; - - m_density = def->density; -} - -void b2Fixture::Destroy(b2BlockAllocator* allocator) -{ - // The proxies must be destroyed before calling this. - b2Assert(m_proxyCount == 0); - - // Free the proxy array. - int32 childCount = m_shape->GetChildCount(); - allocator->Free(m_proxies, childCount * sizeof(b2FixtureProxy)); - m_proxies = NULL; - - // Free the child shape. - switch (m_shape->m_type) - { - case b2Shape::e_circle: - { - b2CircleShape* s = (b2CircleShape*)m_shape; - s->~b2CircleShape(); - allocator->Free(s, sizeof(b2CircleShape)); - } - break; - - case b2Shape::e_edge: - { - b2EdgeShape* s = (b2EdgeShape*)m_shape; - s->~b2EdgeShape(); - allocator->Free(s, sizeof(b2EdgeShape)); - } - break; - - case b2Shape::e_polygon: - { - b2PolygonShape* s = (b2PolygonShape*)m_shape; - s->~b2PolygonShape(); - allocator->Free(s, sizeof(b2PolygonShape)); - } - break; - - case b2Shape::e_chain: - { - b2ChainShape* s = (b2ChainShape*)m_shape; - s->~b2ChainShape(); - allocator->Free(s, sizeof(b2ChainShape)); - } - break; - - default: - b2Assert(false); - break; - } - - m_shape = NULL; -} - -void b2Fixture::CreateProxies(b2BroadPhase* broadPhase, const b2Transform& xf) -{ - b2Assert(m_proxyCount == 0); - - // Create proxies in the broad-phase. - m_proxyCount = m_shape->GetChildCount(); - - for (int32 i = 0; i < m_proxyCount; ++i) - { - b2FixtureProxy* proxy = m_proxies + i; - m_shape->ComputeAABB(&proxy->aabb, xf, i); - proxy->proxyId = broadPhase->CreateProxy(proxy->aabb, proxy); - proxy->fixture = this; - proxy->childIndex = i; - } -} - -void b2Fixture::DestroyProxies(b2BroadPhase* broadPhase) -{ - // Destroy proxies in the broad-phase. - for (int32 i = 0; i < m_proxyCount; ++i) - { - b2FixtureProxy* proxy = m_proxies + i; - broadPhase->DestroyProxy(proxy->proxyId); - proxy->proxyId = b2BroadPhase::e_nullProxy; - } - - m_proxyCount = 0; -} - -void b2Fixture::Synchronize(b2BroadPhase* broadPhase, const b2Transform& transform1, const b2Transform& transform2) -{ - if (m_proxyCount == 0) - { - return; - } - - for (int32 i = 0; i < m_proxyCount; ++i) - { - b2FixtureProxy* proxy = m_proxies + i; - - // Compute an AABB that covers the swept shape (may miss some rotation effect). - b2AABB aabb1, aabb2; - m_shape->ComputeAABB(&aabb1, transform1, proxy->childIndex); - m_shape->ComputeAABB(&aabb2, transform2, proxy->childIndex); - - proxy->aabb.Combine(aabb1, aabb2); - - b2Vec2 displacement = transform2.p - transform1.p; - - broadPhase->MoveProxy(proxy->proxyId, proxy->aabb, displacement); - } -} - -void b2Fixture::SetFilterData(const b2Filter& filter) -{ - m_filter = filter; - - Refilter(); -} - -void b2Fixture::Refilter() -{ - if (m_body == NULL) - { - return; - } - - // Flag associated contacts for filtering. - b2ContactEdge* edge = m_body->GetContactList(); - while (edge) - { - b2Contact* contact = edge->contact; - b2Fixture* fixtureA = contact->GetFixtureA(); - b2Fixture* fixtureB = contact->GetFixtureB(); - if (fixtureA == this || fixtureB == this) - { - contact->FlagForFiltering(); - } - - edge = edge->next; - } - - b2World* world = m_body->GetWorld(); - - if (world == NULL) - { - return; - } - - // Touch each proxy so that new pairs may be created - b2BroadPhase* broadPhase = &world->m_contactManager.m_broadPhase; - for (int32 i = 0; i < m_proxyCount; ++i) - { - broadPhase->TouchProxy(m_proxies[i].proxyId); - } -} - -void b2Fixture::SetSensor(bool sensor) -{ - if (sensor != m_isSensor) - { - m_body->SetAwake(true); - m_isSensor = sensor; - } -} - -void b2Fixture::Dump(int32 bodyIndex) -{ - b2Log(" b2FixtureDef fd;\n"); - b2Log(" fd.friction = %.15lef;\n", m_friction); - b2Log(" fd.restitution = %.15lef;\n", m_restitution); - b2Log(" fd.density = %.15lef;\n", m_density); - b2Log(" fd.isSensor = bool(%d);\n", m_isSensor); - b2Log(" fd.filter.categoryBits = uint16(%d);\n", m_filter.categoryBits); - b2Log(" fd.filter.maskBits = uint16(%d);\n", m_filter.maskBits); - b2Log(" fd.filter.groupIndex = int16(%d);\n", m_filter.groupIndex); - - switch (m_shape->m_type) - { - case b2Shape::e_circle: - { - b2CircleShape* s = (b2CircleShape*)m_shape; - b2Log(" b2CircleShape shape;\n"); - b2Log(" shape.m_radius = %.15lef;\n", s->m_radius); - b2Log(" shape.m_p.Set(%.15lef, %.15lef);\n", s->m_p.x, s->m_p.y); - } - break; - - case b2Shape::e_edge: - { - b2EdgeShape* s = (b2EdgeShape*)m_shape; - b2Log(" b2EdgeShape shape;\n"); - b2Log(" shape.m_radius = %.15lef;\n", s->m_radius); - b2Log(" shape.m_vertex0.Set(%.15lef, %.15lef);\n", s->m_vertex0.x, s->m_vertex0.y); - b2Log(" shape.m_vertex1.Set(%.15lef, %.15lef);\n", s->m_vertex1.x, s->m_vertex1.y); - b2Log(" shape.m_vertex2.Set(%.15lef, %.15lef);\n", s->m_vertex2.x, s->m_vertex2.y); - b2Log(" shape.m_vertex3.Set(%.15lef, %.15lef);\n", s->m_vertex3.x, s->m_vertex3.y); - b2Log(" shape.m_hasVertex0 = bool(%d);\n", s->m_hasVertex0); - b2Log(" shape.m_hasVertex3 = bool(%d);\n", s->m_hasVertex3); - } - break; - - case b2Shape::e_polygon: - { - b2PolygonShape* s = (b2PolygonShape*)m_shape; - b2Log(" b2PolygonShape shape;\n"); - b2Log(" b2Vec2 vs[%d];\n", b2_maxPolygonVertices); - for (int32 i = 0; i < s->m_vertexCount; ++i) - { - b2Log(" vs[%d].Set(%.15lef, %.15lef);\n", i, s->m_vertices[i].x, s->m_vertices[i].y); - } - b2Log(" shape.Set(vs, %d);\n", s->m_vertexCount); - } - break; - - case b2Shape::e_chain: - { - b2ChainShape* s = (b2ChainShape*)m_shape; - b2Log(" b2ChainShape shape;\n"); - b2Log(" b2Vec2 vs[%d];\n", s->m_count); - for (int32 i = 0; i < s->m_count; ++i) - { - b2Log(" vs[%d].Set(%.15lef, %.15lef);\n", i, s->m_vertices[i].x, s->m_vertices[i].y); - } - b2Log(" shape.CreateChain(vs, %d);\n", s->m_count); - b2Log(" shape.m_prevVertex.Set(%.15lef, %.15lef);\n", s->m_prevVertex.x, s->m_prevVertex.y); - b2Log(" shape.m_nextVertex.Set(%.15lef, %.15lef);\n", s->m_nextVertex.x, s->m_nextVertex.y); - b2Log(" shape.m_hasPrevVertex = bool(%d);\n", s->m_hasPrevVertex); - b2Log(" shape.m_hasNextVertex = bool(%d);\n", s->m_hasNextVertex); - } - break; - - default: - return; - } - - b2Log("\n"); - b2Log(" fd.shape = &shape;\n"); - b2Log("\n"); - b2Log(" bodies[%d]->CreateFixture(&fd);\n", bodyIndex); -} diff --git a/external/box2d/Dynamics/b2Fixture.h b/external/box2d/Dynamics/b2Fixture.h deleted file mode 100644 index d390410b93..0000000000 --- a/external/box2d/Dynamics/b2Fixture.h +++ /dev/null @@ -1,345 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_FIXTURE_H -#define B2_FIXTURE_H - -#include -#include -#include - -class b2BlockAllocator; -class b2Body; -class b2BroadPhase; -class b2Fixture; - -/// This holds contact filtering data. -struct b2Filter -{ - b2Filter() - { - categoryBits = 0x0001; - maskBits = 0xFFFF; - groupIndex = 0; - } - - /// The collision category bits. Normally you would just set one bit. - uint16 categoryBits; - - /// The collision mask bits. This states the categories that this - /// shape would accept for collision. - uint16 maskBits; - - /// Collision groups allow a certain group of objects to never collide (negative) - /// or always collide (positive). Zero means no collision group. Non-zero group - /// filtering always wins against the mask bits. - int16 groupIndex; -}; - -/// A fixture definition is used to create a fixture. This class defines an -/// abstract fixture definition. You can reuse fixture definitions safely. -struct b2FixtureDef -{ - /// The constructor sets the default fixture definition values. - b2FixtureDef() - { - shape = NULL; - userData = NULL; - friction = 0.2f; - restitution = 0.0f; - density = 0.0f; - isSensor = false; - } - - /// The shape, this must be set. The shape will be cloned, so you - /// can create the shape on the stack. - const b2Shape* shape; - - /// Use this to store application specific fixture data. - void* userData; - - /// The friction coefficient, usually in the range [0,1]. - float32 friction; - - /// The restitution (elasticity) usually in the range [0,1]. - float32 restitution; - - /// The density, usually in kg/m^2. - float32 density; - - /// A sensor shape collects contact information but never generates a collision - /// response. - bool isSensor; - - /// Contact filtering data. - b2Filter filter; -}; - -/// This proxy is used internally to connect fixtures to the broad-phase. -struct b2FixtureProxy -{ - b2AABB aabb; - b2Fixture* fixture; - int32 childIndex; - int32 proxyId; -}; - -/// A fixture is used to attach a shape to a body for collision detection. A fixture -/// inherits its transform from its parent. Fixtures hold additional non-geometric data -/// such as friction, collision filters, etc. -/// Fixtures are created via b2Body::CreateFixture. -/// @warning you cannot reuse fixtures. -class b2Fixture -{ -public: - /// Get the type of the child shape. You can use this to down cast to the concrete shape. - /// @return the shape type. - b2Shape::Type GetType() const; - - /// Get the child shape. You can modify the child shape, however you should not change the - /// number of vertices because this will crash some collision caching mechanisms. - /// Manipulating the shape may lead to non-physical behavior. - b2Shape* GetShape(); - const b2Shape* GetShape() const; - - /// Set if this fixture is a sensor. - void SetSensor(bool sensor); - - /// Is this fixture a sensor (non-solid)? - /// @return the true if the shape is a sensor. - bool IsSensor() const; - - /// Set the contact filtering data. This will not update contacts until the next time - /// step when either parent body is active and awake. - /// This automatically calls Refilter. - void SetFilterData(const b2Filter& filter); - - /// Get the contact filtering data. - const b2Filter& GetFilterData() const; - - /// Call this if you want to establish collision that was previously disabled by b2ContactFilter::ShouldCollide. - void Refilter(); - - /// Get the parent body of this fixture. This is NULL if the fixture is not attached. - /// @return the parent body. - b2Body* GetBody(); - const b2Body* GetBody() const; - - /// Get the next fixture in the parent body's fixture list. - /// @return the next shape. - b2Fixture* GetNext(); - const b2Fixture* GetNext() const; - - /// Get the user data that was assigned in the fixture definition. Use this to - /// store your application specific data. - void* GetUserData() const; - - /// Set the user data. Use this to store your application specific data. - void SetUserData(void* data); - - /// Test a point for containment in this fixture. - /// @param p a point in world coordinates. - bool TestPoint(const b2Vec2& p) const; - - /// Cast a ray against this shape. - /// @param output the ray-cast results. - /// @param input the ray-cast input parameters. - bool RayCast(b2RayCastOutput* output, const b2RayCastInput& input, int32 childIndex) const; - - /// Get the mass data for this fixture. The mass data is based on the density and - /// the shape. The rotational inertia is about the shape's origin. This operation - /// may be expensive. - void GetMassData(b2MassData* massData) const; - - /// Set the density of this fixture. This will _not_ automatically adjust the mass - /// of the body. You must call b2Body::ResetMassData to update the body's mass. - void SetDensity(float32 density); - - /// Get the density of this fixture. - float32 GetDensity() const; - - /// Get the coefficient of friction. - float32 GetFriction() const; - - /// Set the coefficient of friction. This will _not_ change the friction of - /// existing contacts. - void SetFriction(float32 friction); - - /// Get the coefficient of restitution. - float32 GetRestitution() const; - - /// Set the coefficient of restitution. This will _not_ change the restitution of - /// existing contacts. - void SetRestitution(float32 restitution); - - /// Get the fixture's AABB. This AABB may be enlarge and/or stale. - /// If you need a more accurate AABB, compute it using the shape and - /// the body transform. - const b2AABB& GetAABB(int32 childIndex) const; - - /// Dump this fixture to the log file. - void Dump(int32 bodyIndex); - -protected: - - friend class b2Body; - friend class b2World; - friend class b2Contact; - friend class b2ContactManager; - - b2Fixture(); - - // We need separation create/destroy functions from the constructor/destructor because - // the destructor cannot access the allocator (no destructor arguments allowed by C++). - void Create(b2BlockAllocator* allocator, b2Body* body, const b2FixtureDef* def); - void Destroy(b2BlockAllocator* allocator); - - // These support body activation/deactivation. - void CreateProxies(b2BroadPhase* broadPhase, const b2Transform& xf); - void DestroyProxies(b2BroadPhase* broadPhase); - - void Synchronize(b2BroadPhase* broadPhase, const b2Transform& xf1, const b2Transform& xf2); - - float32 m_density; - - b2Fixture* m_next; - b2Body* m_body; - - b2Shape* m_shape; - - float32 m_friction; - float32 m_restitution; - - b2FixtureProxy* m_proxies; - int32 m_proxyCount; - - b2Filter m_filter; - - bool m_isSensor; - - void* m_userData; -}; - -inline b2Shape::Type b2Fixture::GetType() const -{ - return m_shape->GetType(); -} - -inline b2Shape* b2Fixture::GetShape() -{ - return m_shape; -} - -inline const b2Shape* b2Fixture::GetShape() const -{ - return m_shape; -} - -inline bool b2Fixture::IsSensor() const -{ - return m_isSensor; -} - -inline const b2Filter& b2Fixture::GetFilterData() const -{ - return m_filter; -} - -inline void* b2Fixture::GetUserData() const -{ - return m_userData; -} - -inline void b2Fixture::SetUserData(void* data) -{ - m_userData = data; -} - -inline b2Body* b2Fixture::GetBody() -{ - return m_body; -} - -inline const b2Body* b2Fixture::GetBody() const -{ - return m_body; -} - -inline b2Fixture* b2Fixture::GetNext() -{ - return m_next; -} - -inline const b2Fixture* b2Fixture::GetNext() const -{ - return m_next; -} - -inline void b2Fixture::SetDensity(float32 density) -{ - b2Assert(b2IsValid(density) && density >= 0.0f); - m_density = density; -} - -inline float32 b2Fixture::GetDensity() const -{ - return m_density; -} - -inline float32 b2Fixture::GetFriction() const -{ - return m_friction; -} - -inline void b2Fixture::SetFriction(float32 friction) -{ - m_friction = friction; -} - -inline float32 b2Fixture::GetRestitution() const -{ - return m_restitution; -} - -inline void b2Fixture::SetRestitution(float32 restitution) -{ - m_restitution = restitution; -} - -inline bool b2Fixture::TestPoint(const b2Vec2& p) const -{ - return m_shape->TestPoint(m_body->GetTransform(), p); -} - -inline bool b2Fixture::RayCast(b2RayCastOutput* output, const b2RayCastInput& input, int32 childIndex) const -{ - return m_shape->RayCast(output, input, m_body->GetTransform(), childIndex); -} - -inline void b2Fixture::GetMassData(b2MassData* massData) const -{ - m_shape->ComputeMass(massData, m_density); -} - -inline const b2AABB& b2Fixture::GetAABB(int32 childIndex) const -{ - b2Assert(0 <= childIndex && childIndex < m_proxyCount); - return m_proxies[childIndex].aabb; -} - -#endif diff --git a/external/box2d/Dynamics/b2Island.cpp b/external/box2d/Dynamics/b2Island.cpp deleted file mode 100644 index e767d383d5..0000000000 --- a/external/box2d/Dynamics/b2Island.cpp +++ /dev/null @@ -1,539 +0,0 @@ -/* -* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* -Position Correction Notes -========================= -I tried the several algorithms for position correction of the 2D revolute joint. -I looked at these systems: -- simple pendulum (1m diameter sphere on massless 5m stick) with initial angular velocity of 100 rad/s. -- suspension bridge with 30 1m long planks of length 1m. -- multi-link chain with 30 1m long links. - -Here are the algorithms: - -Baumgarte - A fraction of the position error is added to the velocity error. There is no -separate position solver. - -Pseudo Velocities - After the velocity solver and position integration, -the position error, Jacobian, and effective mass are recomputed. Then -the velocity constraints are solved with pseudo velocities and a fraction -of the position error is added to the pseudo velocity error. The pseudo -velocities are initialized to zero and there is no warm-starting. After -the position solver, the pseudo velocities are added to the positions. -This is also called the First Order World method or the Position LCP method. - -Modified Nonlinear Gauss-Seidel (NGS) - Like Pseudo Velocities except the -position error is re-computed for each constraint and the positions are updated -after the constraint is solved. The radius vectors (aka Jacobians) are -re-computed too (otherwise the algorithm has horrible instability). The pseudo -velocity states are not needed because they are effectively zero at the beginning -of each iteration. Since we have the current position error, we allow the -iterations to terminate early if the error becomes smaller than b2_linearSlop. - -Full NGS or just NGS - Like Modified NGS except the effective mass are re-computed -each time a constraint is solved. - -Here are the results: -Baumgarte - this is the cheapest algorithm but it has some stability problems, -especially with the bridge. The chain links separate easily close to the root -and they jitter as they struggle to pull together. This is one of the most common -methods in the field. The big drawback is that the position correction artificially -affects the momentum, thus leading to instabilities and false bounce. I used a -bias factor of 0.2. A larger bias factor makes the bridge less stable, a smaller -factor makes joints and contacts more spongy. - -Pseudo Velocities - the is more stable than the Baumgarte method. The bridge is -stable. However, joints still separate with large angular velocities. Drag the -simple pendulum in a circle quickly and the joint will separate. The chain separates -easily and does not recover. I used a bias factor of 0.2. A larger value lead to -the bridge collapsing when a heavy cube drops on it. - -Modified NGS - this algorithm is better in some ways than Baumgarte and Pseudo -Velocities, but in other ways it is worse. The bridge and chain are much more -stable, but the simple pendulum goes unstable at high angular velocities. - -Full NGS - stable in all tests. The joints display good stiffness. The bridge -still sags, but this is better than infinite forces. - -Recommendations -Pseudo Velocities are not really worthwhile because the bridge and chain cannot -recover from joint separation. In other cases the benefit over Baumgarte is small. - -Modified NGS is not a robust method for the revolute joint due to the violent -instability seen in the simple pendulum. Perhaps it is viable with other constraint -types, especially scalar constraints where the effective mass is a scalar. - -This leaves Baumgarte and Full NGS. Baumgarte has small, but manageable instabilities -and is very fast. I don't think we can escape Baumgarte, especially in highly -demanding cases where high constraint fidelity is not needed. - -Full NGS is robust and easy on the eyes. I recommend this as an option for -higher fidelity simulation and certainly for suspension bridges and long chains. -Full NGS might be a good choice for ragdolls, especially motorized ragdolls where -joint separation can be problematic. The number of NGS iterations can be reduced -for better performance without harming robustness much. - -Each joint in a can be handled differently in the position solver. So I recommend -a system where the user can select the algorithm on a per joint basis. I would -probably default to the slower Full NGS and let the user select the faster -Baumgarte method in performance critical scenarios. -*/ - -/* -Cache Performance - -The Box2D solvers are dominated by cache misses. Data structures are designed -to increase the number of cache hits. Much of misses are due to random access -to body data. The constraint structures are iterated over linearly, which leads -to few cache misses. - -The bodies are not accessed during iteration. Instead read only data, such as -the mass values are stored with the constraints. The mutable data are the constraint -impulses and the bodies velocities/positions. The impulses are held inside the -constraint structures. The body velocities/positions are held in compact, temporary -arrays to increase the number of cache hits. Linear and angular velocity are -stored in a single array since multiple arrays lead to multiple misses. -*/ - -/* -2D Rotation - -R = [cos(theta) -sin(theta)] - [sin(theta) cos(theta) ] - -thetaDot = omega - -Let q1 = cos(theta), q2 = sin(theta). -R = [q1 -q2] - [q2 q1] - -q1Dot = -thetaDot * q2 -q2Dot = thetaDot * q1 - -q1_new = q1_old - dt * w * q2 -q2_new = q2_old + dt * w * q1 -then normalize. - -This might be faster than computing sin+cos. -However, we can compute sin+cos of the same angle fast. -*/ - -b2Island::b2Island( - int32 bodyCapacity, - int32 contactCapacity, - int32 jointCapacity, - b2StackAllocator* allocator, - b2ContactListener* listener) -{ - m_bodyCapacity = bodyCapacity; - m_contactCapacity = contactCapacity; - m_jointCapacity = jointCapacity; - m_bodyCount = 0; - m_contactCount = 0; - m_jointCount = 0; - - m_allocator = allocator; - m_listener = listener; - - m_bodies = (b2Body**)m_allocator->Allocate(bodyCapacity * sizeof(b2Body*)); - m_contacts = (b2Contact**)m_allocator->Allocate(contactCapacity * sizeof(b2Contact*)); - m_joints = (b2Joint**)m_allocator->Allocate(jointCapacity * sizeof(b2Joint*)); - - m_velocities = (b2Velocity*)m_allocator->Allocate(m_bodyCapacity * sizeof(b2Velocity)); - m_positions = (b2Position*)m_allocator->Allocate(m_bodyCapacity * sizeof(b2Position)); -} - -b2Island::~b2Island() -{ - // Warning: the order should reverse the constructor order. - m_allocator->Free(m_positions); - m_allocator->Free(m_velocities); - m_allocator->Free(m_joints); - m_allocator->Free(m_contacts); - m_allocator->Free(m_bodies); -} - -void b2Island::Solve(b2Profile* profile, const b2TimeStep& step, const b2Vec2& gravity, bool allowSleep) -{ - b2Timer timer; - - float32 h = step.dt; - - // Integrate velocities and apply damping. Initialize the body state. - for (int32 i = 0; i < m_bodyCount; ++i) - { - b2Body* b = m_bodies[i]; - - b2Vec2 c = b->m_sweep.c; - float32 a = b->m_sweep.a; - b2Vec2 v = b->m_linearVelocity; - float32 w = b->m_angularVelocity; - - // Store positions for continuous collision. - b->m_sweep.c0 = b->m_sweep.c; - b->m_sweep.a0 = b->m_sweep.a; - - if (b->m_type == b2_dynamicBody) - { - // Integrate velocities. - v += h * (b->m_gravityScale * gravity + b->m_invMass * b->m_force); - w += h * b->m_invI * b->m_torque; - - // Apply damping. - // ODE: dv/dt + c * v = 0 - // Solution: v(t) = v0 * exp(-c * t) - // Time step: v(t + dt) = v0 * exp(-c * (t + dt)) = v0 * exp(-c * t) * exp(-c * dt) = v * exp(-c * dt) - // v2 = exp(-c * dt) * v1 - // Taylor expansion: - // v2 = (1.0f - c * dt) * v1 - v *= b2Clamp(1.0f - h * b->m_linearDamping, 0.0f, 1.0f); - w *= b2Clamp(1.0f - h * b->m_angularDamping, 0.0f, 1.0f); - } - - m_positions[i].c = c; - m_positions[i].a = a; - m_velocities[i].v = v; - m_velocities[i].w = w; - } - - timer.Reset(); - - // Solver data - b2SolverData solverData; - solverData.step = step; - solverData.positions = m_positions; - solverData.velocities = m_velocities; - - // Initialize velocity constraints. - b2ContactSolverDef contactSolverDef; - contactSolverDef.step = step; - contactSolverDef.contacts = m_contacts; - contactSolverDef.count = m_contactCount; - contactSolverDef.positions = m_positions; - contactSolverDef.velocities = m_velocities; - contactSolverDef.allocator = m_allocator; - - b2ContactSolver contactSolver(&contactSolverDef); - contactSolver.InitializeVelocityConstraints(); - - if (step.warmStarting) - { - contactSolver.WarmStart(); - } - - for (int32 i = 0; i < m_jointCount; ++i) - { - m_joints[i]->InitVelocityConstraints(solverData); - } - - profile->solveInit = timer.GetMilliseconds(); - - // Solve velocity constraints - timer.Reset(); - for (int32 i = 0; i < step.velocityIterations; ++i) - { - for (int32 j = 0; j < m_jointCount; ++j) - { - m_joints[j]->SolveVelocityConstraints(solverData); - } - - contactSolver.SolveVelocityConstraints(); - } - - // Store impulses for warm starting - contactSolver.StoreImpulses(); - profile->solveVelocity = timer.GetMilliseconds(); - - // Integrate positions - for (int32 i = 0; i < m_bodyCount; ++i) - { - b2Vec2 c = m_positions[i].c; - float32 a = m_positions[i].a; - b2Vec2 v = m_velocities[i].v; - float32 w = m_velocities[i].w; - - // Check for large velocities - b2Vec2 translation = h * v; - if (b2Dot(translation, translation) > b2_maxTranslationSquared) - { - float32 ratio = b2_maxTranslation / translation.Length(); - v *= ratio; - } - - float32 rotation = h * w; - if (rotation * rotation > b2_maxRotationSquared) - { - float32 ratio = b2_maxRotation / b2Abs(rotation); - w *= ratio; - } - - // Integrate - c += h * v; - a += h * w; - - m_positions[i].c = c; - m_positions[i].a = a; - m_velocities[i].v = v; - m_velocities[i].w = w; - } - - // Solve position constraints - timer.Reset(); - bool positionSolved = false; - for (int32 i = 0; i < step.positionIterations; ++i) - { - bool contactsOkay = contactSolver.SolvePositionConstraints(); - - bool jointsOkay = true; - for (int32 i = 0; i < m_jointCount; ++i) - { - bool jointOkay = m_joints[i]->SolvePositionConstraints(solverData); - jointsOkay = jointsOkay && jointOkay; - } - - if (contactsOkay && jointsOkay) - { - // Exit early if the position errors are small. - positionSolved = true; - break; - } - } - - // Copy state buffers back to the bodies - for (int32 i = 0; i < m_bodyCount; ++i) - { - b2Body* body = m_bodies[i]; - body->m_sweep.c = m_positions[i].c; - body->m_sweep.a = m_positions[i].a; - body->m_linearVelocity = m_velocities[i].v; - body->m_angularVelocity = m_velocities[i].w; - body->SynchronizeTransform(); - } - - profile->solvePosition = timer.GetMilliseconds(); - - Report(contactSolver.m_velocityConstraints); - - if (allowSleep) - { - float32 minSleepTime = b2_maxFloat; - - const float32 linTolSqr = b2_linearSleepTolerance * b2_linearSleepTolerance; - const float32 angTolSqr = b2_angularSleepTolerance * b2_angularSleepTolerance; - - for (int32 i = 0; i < m_bodyCount; ++i) - { - b2Body* b = m_bodies[i]; - if (b->GetType() == b2_staticBody) - { - continue; - } - - if ((b->m_flags & b2Body::e_autoSleepFlag) == 0 || - b->m_angularVelocity * b->m_angularVelocity > angTolSqr || - b2Dot(b->m_linearVelocity, b->m_linearVelocity) > linTolSqr) - { - b->m_sleepTime = 0.0f; - minSleepTime = 0.0f; - } - else - { - b->m_sleepTime += h; - minSleepTime = b2Min(minSleepTime, b->m_sleepTime); - } - } - - if (minSleepTime >= b2_timeToSleep && positionSolved) - { - for (int32 i = 0; i < m_bodyCount; ++i) - { - b2Body* b = m_bodies[i]; - b->SetAwake(false); - } - } - } -} - -void b2Island::SolveTOI(const b2TimeStep& subStep, int32 toiIndexA, int32 toiIndexB) -{ - b2Assert(toiIndexA < m_bodyCount); - b2Assert(toiIndexB < m_bodyCount); - - // Initialize the body state. - for (int32 i = 0; i < m_bodyCount; ++i) - { - b2Body* b = m_bodies[i]; - m_positions[i].c = b->m_sweep.c; - m_positions[i].a = b->m_sweep.a; - m_velocities[i].v = b->m_linearVelocity; - m_velocities[i].w = b->m_angularVelocity; - } - - b2ContactSolverDef contactSolverDef; - contactSolverDef.contacts = m_contacts; - contactSolverDef.count = m_contactCount; - contactSolverDef.allocator = m_allocator; - contactSolverDef.step = subStep; - contactSolverDef.positions = m_positions; - contactSolverDef.velocities = m_velocities; - b2ContactSolver contactSolver(&contactSolverDef); - - // Solve position constraints. - for (int32 i = 0; i < subStep.positionIterations; ++i) - { - bool contactsOkay = contactSolver.SolveTOIPositionConstraints(toiIndexA, toiIndexB); - if (contactsOkay) - { - break; - } - } - -#if 0 - // Is the new position really safe? - for (int32 i = 0; i < m_contactCount; ++i) - { - b2Contact* c = m_contacts[i]; - b2Fixture* fA = c->GetFixtureA(); - b2Fixture* fB = c->GetFixtureB(); - - b2Body* bA = fA->GetBody(); - b2Body* bB = fB->GetBody(); - - int32 indexA = c->GetChildIndexA(); - int32 indexB = c->GetChildIndexB(); - - b2DistanceInput input; - input.proxyA.Set(fA->GetShape(), indexA); - input.proxyB.Set(fB->GetShape(), indexB); - input.transformA = bA->GetTransform(); - input.transformB = bB->GetTransform(); - input.useRadii = false; - - b2DistanceOutput output; - b2SimplexCache cache; - cache.count = 0; - b2Distance(&output, &cache, &input); - - if (output.distance == 0 || cache.count == 3) - { - cache.count += 0; - } - } -#endif - - // Leap of faith to new safe state. - m_bodies[toiIndexA]->m_sweep.c0 = m_positions[toiIndexA].c; - m_bodies[toiIndexA]->m_sweep.a0 = m_positions[toiIndexA].a; - m_bodies[toiIndexB]->m_sweep.c0 = m_positions[toiIndexB].c; - m_bodies[toiIndexB]->m_sweep.a0 = m_positions[toiIndexB].a; - - // No warm starting is needed for TOI events because warm - // starting impulses were applied in the discrete solver. - contactSolver.InitializeVelocityConstraints(); - - // Solve velocity constraints. - for (int32 i = 0; i < subStep.velocityIterations; ++i) - { - contactSolver.SolveVelocityConstraints(); - } - - // Don't store the TOI contact forces for warm starting - // because they can be quite large. - - float32 h = subStep.dt; - - // Integrate positions - for (int32 i = 0; i < m_bodyCount; ++i) - { - b2Vec2 c = m_positions[i].c; - float32 a = m_positions[i].a; - b2Vec2 v = m_velocities[i].v; - float32 w = m_velocities[i].w; - - // Check for large velocities - b2Vec2 translation = h * v; - if (b2Dot(translation, translation) > b2_maxTranslationSquared) - { - float32 ratio = b2_maxTranslation / translation.Length(); - v *= ratio; - } - - float32 rotation = h * w; - if (rotation * rotation > b2_maxRotationSquared) - { - float32 ratio = b2_maxRotation / b2Abs(rotation); - w *= ratio; - } - - // Integrate - c += h * v; - a += h * w; - - m_positions[i].c = c; - m_positions[i].a = a; - m_velocities[i].v = v; - m_velocities[i].w = w; - - // Sync bodies - b2Body* body = m_bodies[i]; - body->m_sweep.c = c; - body->m_sweep.a = a; - body->m_linearVelocity = v; - body->m_angularVelocity = w; - body->SynchronizeTransform(); - } - - Report(contactSolver.m_velocityConstraints); -} - -void b2Island::Report(const b2ContactVelocityConstraint* constraints) -{ - if (m_listener == NULL) - { - return; - } - - for (int32 i = 0; i < m_contactCount; ++i) - { - b2Contact* c = m_contacts[i]; - - const b2ContactVelocityConstraint* vc = constraints + i; - - b2ContactImpulse impulse; - impulse.count = vc->pointCount; - for (int32 j = 0; j < vc->pointCount; ++j) - { - impulse.normalImpulses[j] = vc->points[j].normalImpulse; - impulse.tangentImpulses[j] = vc->points[j].tangentImpulse; - } - - m_listener->PostSolve(c, &impulse); - } -} diff --git a/external/box2d/Dynamics/b2Island.h b/external/box2d/Dynamics/b2Island.h deleted file mode 100644 index e0a6e41fc3..0000000000 --- a/external/box2d/Dynamics/b2Island.h +++ /dev/null @@ -1,93 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_ISLAND_H -#define B2_ISLAND_H - -#include -#include -#include - -class b2Contact; -class b2Joint; -class b2StackAllocator; -class b2ContactListener; -struct b2ContactVelocityConstraint; -struct b2Profile; - -/// This is an internal class. -class b2Island -{ -public: - b2Island(int32 bodyCapacity, int32 contactCapacity, int32 jointCapacity, - b2StackAllocator* allocator, b2ContactListener* listener); - ~b2Island(); - - void Clear() - { - m_bodyCount = 0; - m_contactCount = 0; - m_jointCount = 0; - } - - void Solve(b2Profile* profile, const b2TimeStep& step, const b2Vec2& gravity, bool allowSleep); - - void SolveTOI(const b2TimeStep& subStep, int32 toiIndexA, int32 toiIndexB); - - void Add(b2Body* body) - { - b2Assert(m_bodyCount < m_bodyCapacity); - body->m_islandIndex = m_bodyCount; - m_bodies[m_bodyCount] = body; - ++m_bodyCount; - } - - void Add(b2Contact* contact) - { - b2Assert(m_contactCount < m_contactCapacity); - m_contacts[m_contactCount++] = contact; - } - - void Add(b2Joint* joint) - { - b2Assert(m_jointCount < m_jointCapacity); - m_joints[m_jointCount++] = joint; - } - - void Report(const b2ContactVelocityConstraint* constraints); - - b2StackAllocator* m_allocator; - b2ContactListener* m_listener; - - b2Body** m_bodies; - b2Contact** m_contacts; - b2Joint** m_joints; - - b2Position* m_positions; - b2Velocity* m_velocities; - - int32 m_bodyCount; - int32 m_jointCount; - int32 m_contactCount; - - int32 m_bodyCapacity; - int32 m_contactCapacity; - int32 m_jointCapacity; -}; - -#endif diff --git a/external/box2d/Dynamics/b2TimeStep.h b/external/box2d/Dynamics/b2TimeStep.h deleted file mode 100644 index 30d723fcc3..0000000000 --- a/external/box2d/Dynamics/b2TimeStep.h +++ /dev/null @@ -1,70 +0,0 @@ -/* -* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_TIME_STEP_H -#define B2_TIME_STEP_H - -#include - -/// Profiling data. Times are in milliseconds. -struct b2Profile -{ - float32 step; - float32 collide; - float32 solve; - float32 solveInit; - float32 solveVelocity; - float32 solvePosition; - float32 broadphase; - float32 solveTOI; -}; - -/// This is an internal structure. -struct b2TimeStep -{ - float32 dt; // time step - float32 inv_dt; // inverse time step (0 if dt == 0). - float32 dtRatio; // dt * inv_dt0 - int32 velocityIterations; - int32 positionIterations; - bool warmStarting; -}; - -/// This is an internal structure. -struct b2Position -{ - b2Vec2 c; - float32 a; -}; - -/// This is an internal structure. -struct b2Velocity -{ - b2Vec2 v; - float32 w; -}; - -/// Solver Data -struct b2SolverData -{ - b2TimeStep step; - b2Position* positions; - b2Velocity* velocities; -}; - -#endif diff --git a/external/box2d/Dynamics/b2World.cpp b/external/box2d/Dynamics/b2World.cpp deleted file mode 100644 index 8a0aff5114..0000000000 --- a/external/box2d/Dynamics/b2World.cpp +++ /dev/null @@ -1,1316 +0,0 @@ -/* -* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -b2World::b2World(const b2Vec2& gravity) -{ - m_destructionListener = NULL; - m_debugDraw = NULL; - - m_bodyList = NULL; - m_jointList = NULL; - - m_bodyCount = 0; - m_jointCount = 0; - - m_warmStarting = true; - m_continuousPhysics = true; - m_subStepping = false; - - m_stepComplete = true; - - m_allowSleep = true; - m_gravity = gravity; - - m_flags = e_clearForces; - - m_inv_dt0 = 0.0f; - - m_contactManager.m_allocator = &m_blockAllocator; - - memset(&m_profile, 0, sizeof(b2Profile)); -} - -b2World::~b2World() -{ - // Some shapes allocate using b2Alloc. - b2Body* b = m_bodyList; - while (b) - { - b2Body* bNext = b->m_next; - - b2Fixture* f = b->m_fixtureList; - while (f) - { - b2Fixture* fNext = f->m_next; - f->m_proxyCount = 0; - f->Destroy(&m_blockAllocator); - f = fNext; - } - - b = bNext; - } -} - -void b2World::SetDestructionListener(b2DestructionListener* listener) -{ - m_destructionListener = listener; -} - -void b2World::SetContactFilter(b2ContactFilter* filter) -{ - m_contactManager.m_contactFilter = filter; -} - -void b2World::SetContactListener(b2ContactListener* listener) -{ - m_contactManager.m_contactListener = listener; -} - -void b2World::SetDebugDraw(b2Draw* debugDraw) -{ - m_debugDraw = debugDraw; -} - -b2Body* b2World::CreateBody(const b2BodyDef* def) -{ - b2Assert(IsLocked() == false); - if (IsLocked()) - { - return NULL; - } - - void* mem = m_blockAllocator.Allocate(sizeof(b2Body)); - b2Body* b = new (mem) b2Body(def, this); - - // Add to world doubly linked list. - b->m_prev = NULL; - b->m_next = m_bodyList; - if (m_bodyList) - { - m_bodyList->m_prev = b; - } - m_bodyList = b; - ++m_bodyCount; - - return b; -} - -void b2World::DestroyBody(b2Body* b) -{ - b2Assert(m_bodyCount > 0); - b2Assert(IsLocked() == false); - if (IsLocked()) - { - return; - } - - // Delete the attached joints. - b2JointEdge* je = b->m_jointList; - while (je) - { - b2JointEdge* je0 = je; - je = je->next; - - if (m_destructionListener) - { - m_destructionListener->SayGoodbye(je0->joint); - } - - DestroyJoint(je0->joint); - - b->m_jointList = je; - } - b->m_jointList = NULL; - - // Delete the attached contacts. - b2ContactEdge* ce = b->m_contactList; - while (ce) - { - b2ContactEdge* ce0 = ce; - ce = ce->next; - m_contactManager.Destroy(ce0->contact); - } - b->m_contactList = NULL; - - // Delete the attached fixtures. This destroys broad-phase proxies. - b2Fixture* f = b->m_fixtureList; - while (f) - { - b2Fixture* f0 = f; - f = f->m_next; - - if (m_destructionListener) - { - m_destructionListener->SayGoodbye(f0); - } - - f0->DestroyProxies(&m_contactManager.m_broadPhase); - f0->Destroy(&m_blockAllocator); - f0->~b2Fixture(); - m_blockAllocator.Free(f0, sizeof(b2Fixture)); - - b->m_fixtureList = f; - b->m_fixtureCount -= 1; - } - b->m_fixtureList = NULL; - b->m_fixtureCount = 0; - - // Remove world body list. - if (b->m_prev) - { - b->m_prev->m_next = b->m_next; - } - - if (b->m_next) - { - b->m_next->m_prev = b->m_prev; - } - - if (b == m_bodyList) - { - m_bodyList = b->m_next; - } - - --m_bodyCount; - b->~b2Body(); - m_blockAllocator.Free(b, sizeof(b2Body)); -} - -b2Joint* b2World::CreateJoint(const b2JointDef* def) -{ - b2Assert(IsLocked() == false); - if (IsLocked()) - { - return NULL; - } - - b2Joint* j = b2Joint::Create(def, &m_blockAllocator); - - // Connect to the world list. - j->m_prev = NULL; - j->m_next = m_jointList; - if (m_jointList) - { - m_jointList->m_prev = j; - } - m_jointList = j; - ++m_jointCount; - - // Connect to the bodies' doubly linked lists. - j->m_edgeA.joint = j; - j->m_edgeA.other = j->m_bodyB; - j->m_edgeA.prev = NULL; - j->m_edgeA.next = j->m_bodyA->m_jointList; - if (j->m_bodyA->m_jointList) j->m_bodyA->m_jointList->prev = &j->m_edgeA; - j->m_bodyA->m_jointList = &j->m_edgeA; - - j->m_edgeB.joint = j; - j->m_edgeB.other = j->m_bodyA; - j->m_edgeB.prev = NULL; - j->m_edgeB.next = j->m_bodyB->m_jointList; - if (j->m_bodyB->m_jointList) j->m_bodyB->m_jointList->prev = &j->m_edgeB; - j->m_bodyB->m_jointList = &j->m_edgeB; - - b2Body* bodyA = def->bodyA; - b2Body* bodyB = def->bodyB; - - // If the joint prevents collisions, then flag any contacts for filtering. - if (def->collideConnected == false) - { - b2ContactEdge* edge = bodyB->GetContactList(); - while (edge) - { - if (edge->other == bodyA) - { - // Flag the contact for filtering at the next time step (where either - // body is awake). - edge->contact->FlagForFiltering(); - } - - edge = edge->next; - } - } - - // Note: creating a joint doesn't wake the bodies. - - return j; -} - -void b2World::DestroyJoint(b2Joint* j) -{ - b2Assert(IsLocked() == false); - if (IsLocked()) - { - return; - } - - bool collideConnected = j->m_collideConnected; - - // Remove from the doubly linked list. - if (j->m_prev) - { - j->m_prev->m_next = j->m_next; - } - - if (j->m_next) - { - j->m_next->m_prev = j->m_prev; - } - - if (j == m_jointList) - { - m_jointList = j->m_next; - } - - // Disconnect from island graph. - b2Body* bodyA = j->m_bodyA; - b2Body* bodyB = j->m_bodyB; - - // Wake up connected bodies. - bodyA->SetAwake(true); - bodyB->SetAwake(true); - - // Remove from body 1. - if (j->m_edgeA.prev) - { - j->m_edgeA.prev->next = j->m_edgeA.next; - } - - if (j->m_edgeA.next) - { - j->m_edgeA.next->prev = j->m_edgeA.prev; - } - - if (&j->m_edgeA == bodyA->m_jointList) - { - bodyA->m_jointList = j->m_edgeA.next; - } - - j->m_edgeA.prev = NULL; - j->m_edgeA.next = NULL; - - // Remove from body 2 - if (j->m_edgeB.prev) - { - j->m_edgeB.prev->next = j->m_edgeB.next; - } - - if (j->m_edgeB.next) - { - j->m_edgeB.next->prev = j->m_edgeB.prev; - } - - if (&j->m_edgeB == bodyB->m_jointList) - { - bodyB->m_jointList = j->m_edgeB.next; - } - - j->m_edgeB.prev = NULL; - j->m_edgeB.next = NULL; - - b2Joint::Destroy(j, &m_blockAllocator); - - b2Assert(m_jointCount > 0); - --m_jointCount; - - // If the joint prevents collisions, then flag any contacts for filtering. - if (collideConnected == false) - { - b2ContactEdge* edge = bodyB->GetContactList(); - while (edge) - { - if (edge->other == bodyA) - { - // Flag the contact for filtering at the next time step (where either - // body is awake). - edge->contact->FlagForFiltering(); - } - - edge = edge->next; - } - } -} - -// -void b2World::SetAllowSleeping(bool flag) -{ - if (flag == m_allowSleep) - { - return; - } - - m_allowSleep = flag; - if (m_allowSleep == false) - { - for (b2Body* b = m_bodyList; b; b = b->m_next) - { - b->SetAwake(true); - } - } -} - -// Find islands, integrate and solve constraints, solve position constraints -void b2World::Solve(const b2TimeStep& step) -{ - m_profile.solveInit = 0.0f; - m_profile.solveVelocity = 0.0f; - m_profile.solvePosition = 0.0f; - - // Size the island for the worst case. - b2Island island(m_bodyCount, - m_contactManager.m_contactCount, - m_jointCount, - &m_stackAllocator, - m_contactManager.m_contactListener); - - // Clear all the island flags. - for (b2Body* b = m_bodyList; b; b = b->m_next) - { - b->m_flags &= ~b2Body::e_islandFlag; - } - for (b2Contact* c = m_contactManager.m_contactList; c; c = c->m_next) - { - c->m_flags &= ~b2Contact::e_islandFlag; - } - for (b2Joint* j = m_jointList; j; j = j->m_next) - { - j->m_islandFlag = false; - } - - // Build and simulate all awake islands. - int32 stackSize = m_bodyCount; - b2Body** stack = (b2Body**)m_stackAllocator.Allocate(stackSize * sizeof(b2Body*)); - for (b2Body* seed = m_bodyList; seed; seed = seed->m_next) - { - if (seed->m_flags & b2Body::e_islandFlag) - { - continue; - } - - if (seed->IsAwake() == false || seed->IsActive() == false) - { - continue; - } - - // The seed can be dynamic or kinematic. - if (seed->GetType() == b2_staticBody) - { - continue; - } - - // Reset island and stack. - island.Clear(); - int32 stackCount = 0; - stack[stackCount++] = seed; - seed->m_flags |= b2Body::e_islandFlag; - - // Perform a depth first search (DFS) on the constraint graph. - while (stackCount > 0) - { - // Grab the next body off the stack and add it to the island. - b2Body* b = stack[--stackCount]; - b2Assert(b->IsActive() == true); - island.Add(b); - - // Make sure the body is awake. - b->SetAwake(true); - - // To keep islands as small as possible, we don't - // propagate islands across static bodies. - if (b->GetType() == b2_staticBody) - { - continue; - } - - // Search all contacts connected to this body. - for (b2ContactEdge* ce = b->m_contactList; ce; ce = ce->next) - { - b2Contact* contact = ce->contact; - - // Has this contact already been added to an island? - if (contact->m_flags & b2Contact::e_islandFlag) - { - continue; - } - - // Is this contact solid and touching? - if (contact->IsEnabled() == false || - contact->IsTouching() == false) - { - continue; - } - - // Skip sensors. - bool sensorA = contact->m_fixtureA->m_isSensor; - bool sensorB = contact->m_fixtureB->m_isSensor; - if (sensorA || sensorB) - { - continue; - } - - island.Add(contact); - contact->m_flags |= b2Contact::e_islandFlag; - - b2Body* other = ce->other; - - // Was the other body already added to this island? - if (other->m_flags & b2Body::e_islandFlag) - { - continue; - } - - b2Assert(stackCount < stackSize); - stack[stackCount++] = other; - other->m_flags |= b2Body::e_islandFlag; - } - - // Search all joints connect to this body. - for (b2JointEdge* je = b->m_jointList; je; je = je->next) - { - if (je->joint->m_islandFlag == true) - { - continue; - } - - b2Body* other = je->other; - - // Don't simulate joints connected to inactive bodies. - if (other->IsActive() == false) - { - continue; - } - - island.Add(je->joint); - je->joint->m_islandFlag = true; - - if (other->m_flags & b2Body::e_islandFlag) - { - continue; - } - - b2Assert(stackCount < stackSize); - stack[stackCount++] = other; - other->m_flags |= b2Body::e_islandFlag; - } - } - - b2Profile profile; - island.Solve(&profile, step, m_gravity, m_allowSleep); - m_profile.solveInit += profile.solveInit; - m_profile.solveVelocity += profile.solveVelocity; - m_profile.solvePosition += profile.solvePosition; - - // Post solve cleanup. - for (int32 i = 0; i < island.m_bodyCount; ++i) - { - // Allow static bodies to participate in other islands. - b2Body* b = island.m_bodies[i]; - if (b->GetType() == b2_staticBody) - { - b->m_flags &= ~b2Body::e_islandFlag; - } - } - } - - m_stackAllocator.Free(stack); - - { - b2Timer timer; - // Synchronize fixtures, check for out of range bodies. - for (b2Body* b = m_bodyList; b; b = b->GetNext()) - { - // If a body was not in an island then it did not move. - if ((b->m_flags & b2Body::e_islandFlag) == 0) - { - continue; - } - - if (b->GetType() == b2_staticBody) - { - continue; - } - - // Update fixtures (for broad-phase). - b->SynchronizeFixtures(); - } - - // Look for new contacts. - m_contactManager.FindNewContacts(); - m_profile.broadphase = timer.GetMilliseconds(); - } -} - -// Find TOI contacts and solve them. -void b2World::SolveTOI(const b2TimeStep& step) -{ - b2Island island(2 * b2_maxTOIContacts, b2_maxTOIContacts, 0, &m_stackAllocator, m_contactManager.m_contactListener); - - if (m_stepComplete) - { - for (b2Body* b = m_bodyList; b; b = b->m_next) - { - b->m_flags &= ~b2Body::e_islandFlag; - b->m_sweep.alpha0 = 0.0f; - } - - for (b2Contact* c = m_contactManager.m_contactList; c; c = c->m_next) - { - // Invalidate TOI - c->m_flags &= ~(b2Contact::e_toiFlag | b2Contact::e_islandFlag); - c->m_toiCount = 0; - c->m_toi = 1.0f; - } - } - - // Find TOI events and solve them. - for (;;) - { - // Find the first TOI. - b2Contact* minContact = NULL; - float32 minAlpha = 1.0f; - - for (b2Contact* c = m_contactManager.m_contactList; c; c = c->m_next) - { - // Is this contact disabled? - if (c->IsEnabled() == false) - { - continue; - } - - // Prevent excessive sub-stepping. - if (c->m_toiCount > b2_maxSubSteps) - { - continue; - } - - float32 alpha = 1.0f; - if (c->m_flags & b2Contact::e_toiFlag) - { - // This contact has a valid cached TOI. - alpha = c->m_toi; - } - else - { - b2Fixture* fA = c->GetFixtureA(); - b2Fixture* fB = c->GetFixtureB(); - - // Is there a sensor? - if (fA->IsSensor() || fB->IsSensor()) - { - continue; - } - - b2Body* bA = fA->GetBody(); - b2Body* bB = fB->GetBody(); - - b2BodyType typeA = bA->m_type; - b2BodyType typeB = bB->m_type; - b2Assert(typeA == b2_dynamicBody || typeB == b2_dynamicBody); - - bool activeA = bA->IsAwake() && typeA != b2_staticBody; - bool activeB = bB->IsAwake() && typeB != b2_staticBody; - - // Is at least one body active (awake and dynamic or kinematic)? - if (activeA == false && activeB == false) - { - continue; - } - - bool collideA = bA->IsBullet() || typeA != b2_dynamicBody; - bool collideB = bB->IsBullet() || typeB != b2_dynamicBody; - - // Are these two non-bullet dynamic bodies? - if (collideA == false && collideB == false) - { - continue; - } - - // Compute the TOI for this contact. - // Put the sweeps onto the same time interval. - float32 alpha0 = bA->m_sweep.alpha0; - - if (bA->m_sweep.alpha0 < bB->m_sweep.alpha0) - { - alpha0 = bB->m_sweep.alpha0; - bA->m_sweep.Advance(alpha0); - } - else if (bB->m_sweep.alpha0 < bA->m_sweep.alpha0) - { - alpha0 = bA->m_sweep.alpha0; - bB->m_sweep.Advance(alpha0); - } - - b2Assert(alpha0 < 1.0f); - - int32 indexA = c->GetChildIndexA(); - int32 indexB = c->GetChildIndexB(); - - // Compute the time of impact in interval [0, minTOI] - b2TOIInput input; - input.proxyA.Set(fA->GetShape(), indexA); - input.proxyB.Set(fB->GetShape(), indexB); - input.sweepA = bA->m_sweep; - input.sweepB = bB->m_sweep; - input.tMax = 1.0f; - - b2TOIOutput output; - b2TimeOfImpact(&output, &input); - - // Beta is the fraction of the remaining portion of the . - float32 beta = output.t; - if (output.state == b2TOIOutput::e_touching) - { - alpha = b2Min(alpha0 + (1.0f - alpha0) * beta, 1.0f); - } - else - { - alpha = 1.0f; - } - - c->m_toi = alpha; - c->m_flags |= b2Contact::e_toiFlag; - } - - if (alpha < minAlpha) - { - // This is the minimum TOI found so far. - minContact = c; - minAlpha = alpha; - } - } - - if (minContact == NULL || 1.0f - 10.0f * b2_epsilon < minAlpha) - { - // No more TOI events. Done! - m_stepComplete = true; - break; - } - - // Advance the bodies to the TOI. - b2Fixture* fA = minContact->GetFixtureA(); - b2Fixture* fB = minContact->GetFixtureB(); - b2Body* bA = fA->GetBody(); - b2Body* bB = fB->GetBody(); - - b2Sweep backup1 = bA->m_sweep; - b2Sweep backup2 = bB->m_sweep; - - bA->Advance(minAlpha); - bB->Advance(minAlpha); - - // The TOI contact likely has some new contact points. - minContact->Update(m_contactManager.m_contactListener); - minContact->m_flags &= ~b2Contact::e_toiFlag; - ++minContact->m_toiCount; - - // Is the contact solid? - if (minContact->IsEnabled() == false || minContact->IsTouching() == false) - { - // Restore the sweeps. - minContact->SetEnabled(false); - bA->m_sweep = backup1; - bB->m_sweep = backup2; - bA->SynchronizeTransform(); - bB->SynchronizeTransform(); - continue; - } - - bA->SetAwake(true); - bB->SetAwake(true); - - // Build the island - island.Clear(); - island.Add(bA); - island.Add(bB); - island.Add(minContact); - - bA->m_flags |= b2Body::e_islandFlag; - bB->m_flags |= b2Body::e_islandFlag; - minContact->m_flags |= b2Contact::e_islandFlag; - - // Get contacts on bodyA and bodyB. - b2Body* bodies[2] = {bA, bB}; - for (int32 i = 0; i < 2; ++i) - { - b2Body* body = bodies[i]; - if (body->m_type == b2_dynamicBody) - { - for (b2ContactEdge* ce = body->m_contactList; ce; ce = ce->next) - { - if (island.m_bodyCount == island.m_bodyCapacity) - { - break; - } - - if (island.m_contactCount == island.m_contactCapacity) - { - break; - } - - b2Contact* contact = ce->contact; - - // Has this contact already been added to the island? - if (contact->m_flags & b2Contact::e_islandFlag) - { - continue; - } - - // Only add static, kinematic, or bullet bodies. - b2Body* other = ce->other; - if (other->m_type == b2_dynamicBody && - body->IsBullet() == false && other->IsBullet() == false) - { - continue; - } - - // Skip sensors. - bool sensorA = contact->m_fixtureA->m_isSensor; - bool sensorB = contact->m_fixtureB->m_isSensor; - if (sensorA || sensorB) - { - continue; - } - - // Tentatively advance the body to the TOI. - b2Sweep backup = other->m_sweep; - if ((other->m_flags & b2Body::e_islandFlag) == 0) - { - other->Advance(minAlpha); - } - - // Update the contact points - contact->Update(m_contactManager.m_contactListener); - - // Was the contact disabled by the user? - if (contact->IsEnabled() == false) - { - other->m_sweep = backup; - other->SynchronizeTransform(); - continue; - } - - // Are there contact points? - if (contact->IsTouching() == false) - { - other->m_sweep = backup; - other->SynchronizeTransform(); - continue; - } - - // Add the contact to the island - contact->m_flags |= b2Contact::e_islandFlag; - island.Add(contact); - - // Has the other body already been added to the island? - if (other->m_flags & b2Body::e_islandFlag) - { - continue; - } - - // Add the other body to the island. - other->m_flags |= b2Body::e_islandFlag; - - if (other->m_type != b2_staticBody) - { - other->SetAwake(true); - } - - island.Add(other); - } - } - } - - b2TimeStep subStep; - subStep.dt = (1.0f - minAlpha) * step.dt; - subStep.inv_dt = 1.0f / subStep.dt; - subStep.dtRatio = 1.0f; - subStep.positionIterations = 20; - subStep.velocityIterations = step.velocityIterations; - subStep.warmStarting = false; - island.SolveTOI(subStep, bA->m_islandIndex, bB->m_islandIndex); - - // Reset island flags and synchronize broad-phase proxies. - for (int32 i = 0; i < island.m_bodyCount; ++i) - { - b2Body* body = island.m_bodies[i]; - body->m_flags &= ~b2Body::e_islandFlag; - - if (body->m_type != b2_dynamicBody) - { - continue; - } - - body->SynchronizeFixtures(); - - // Invalidate all contact TOIs on this displaced body. - for (b2ContactEdge* ce = body->m_contactList; ce; ce = ce->next) - { - ce->contact->m_flags &= ~(b2Contact::e_toiFlag | b2Contact::e_islandFlag); - } - } - - // Commit fixture proxy movements to the broad-phase so that new contacts are created. - // Also, some contacts can be destroyed. - m_contactManager.FindNewContacts(); - - if (m_subStepping) - { - m_stepComplete = false; - break; - } - } -} - -void b2World::Step(float32 dt, int32 velocityIterations, int32 positionIterations) -{ - b2Timer stepTimer; - - // If new fixtures were added, we need to find the new contacts. - if (m_flags & e_newFixture) - { - m_contactManager.FindNewContacts(); - m_flags &= ~e_newFixture; - } - - m_flags |= e_locked; - - b2TimeStep step; - step.dt = dt; - step.velocityIterations = velocityIterations; - step.positionIterations = positionIterations; - if (dt > 0.0f) - { - step.inv_dt = 1.0f / dt; - } - else - { - step.inv_dt = 0.0f; - } - - step.dtRatio = m_inv_dt0 * dt; - - step.warmStarting = m_warmStarting; - - // Update contacts. This is where some contacts are destroyed. - { - b2Timer timer; - m_contactManager.Collide(); - m_profile.collide = timer.GetMilliseconds(); - } - - // Integrate velocities, solve velocity constraints, and integrate positions. - if (m_stepComplete && step.dt > 0.0f) - { - b2Timer timer; - Solve(step); - m_profile.solve = timer.GetMilliseconds(); - } - - // Handle TOI events. - if (m_continuousPhysics && step.dt > 0.0f) - { - b2Timer timer; - SolveTOI(step); - m_profile.solveTOI = timer.GetMilliseconds(); - } - - if (step.dt > 0.0f) - { - m_inv_dt0 = step.inv_dt; - } - - if (m_flags & e_clearForces) - { - ClearForces(); - } - - m_flags &= ~e_locked; - - m_profile.step = stepTimer.GetMilliseconds(); -} - -void b2World::ClearForces() -{ - for (b2Body* body = m_bodyList; body; body = body->GetNext()) - { - body->m_force.SetZero(); - body->m_torque = 0.0f; - } -} - -struct b2WorldQueryWrapper -{ - bool QueryCallback(int32 proxyId) - { - b2FixtureProxy* proxy = (b2FixtureProxy*)broadPhase->GetUserData(proxyId); - return callback->ReportFixture(proxy->fixture); - } - - const b2BroadPhase* broadPhase; - b2QueryCallback* callback; -}; - -void b2World::QueryAABB(b2QueryCallback* callback, const b2AABB& aabb) const -{ - b2WorldQueryWrapper wrapper; - wrapper.broadPhase = &m_contactManager.m_broadPhase; - wrapper.callback = callback; - m_contactManager.m_broadPhase.Query(&wrapper, aabb); -} - -struct b2WorldRayCastWrapper -{ - float32 RayCastCallback(const b2RayCastInput& input, int32 proxyId) - { - void* userData = broadPhase->GetUserData(proxyId); - b2FixtureProxy* proxy = (b2FixtureProxy*)userData; - b2Fixture* fixture = proxy->fixture; - int32 index = proxy->childIndex; - b2RayCastOutput output; - bool hit = fixture->RayCast(&output, input, index); - - if (hit) - { - float32 fraction = output.fraction; - b2Vec2 point = (1.0f - fraction) * input.p1 + fraction * input.p2; - return callback->ReportFixture(fixture, point, output.normal, fraction); - } - - return input.maxFraction; - } - - const b2BroadPhase* broadPhase; - b2RayCastCallback* callback; -}; - -void b2World::RayCast(b2RayCastCallback* callback, const b2Vec2& point1, const b2Vec2& point2) const -{ - b2WorldRayCastWrapper wrapper; - wrapper.broadPhase = &m_contactManager.m_broadPhase; - wrapper.callback = callback; - b2RayCastInput input; - input.maxFraction = 1.0f; - input.p1 = point1; - input.p2 = point2; - m_contactManager.m_broadPhase.RayCast(&wrapper, input); -} - -void b2World::DrawShape(b2Fixture* fixture, const b2Transform& xf, const b2Color& color) -{ - switch (fixture->GetType()) - { - case b2Shape::e_circle: - { - b2CircleShape* circle = (b2CircleShape*)fixture->GetShape(); - - b2Vec2 center = b2Mul(xf, circle->m_p); - float32 radius = circle->m_radius; - b2Vec2 axis = b2Mul(xf.q, b2Vec2(1.0f, 0.0f)); - - m_debugDraw->DrawSolidCircle(center, radius, axis, color); - } - break; - - case b2Shape::e_edge: - { - b2EdgeShape* edge = (b2EdgeShape*)fixture->GetShape(); - b2Vec2 v1 = b2Mul(xf, edge->m_vertex1); - b2Vec2 v2 = b2Mul(xf, edge->m_vertex2); - m_debugDraw->DrawSegment(v1, v2, color); - } - break; - - case b2Shape::e_chain: - { - b2ChainShape* chain = (b2ChainShape*)fixture->GetShape(); - int32 count = chain->m_count; - const b2Vec2* vertices = chain->m_vertices; - - b2Vec2 v1 = b2Mul(xf, vertices[0]); - for (int32 i = 1; i < count; ++i) - { - b2Vec2 v2 = b2Mul(xf, vertices[i]); - m_debugDraw->DrawSegment(v1, v2, color); - m_debugDraw->DrawCircle(v1, 0.05f, color); - v1 = v2; - } - } - break; - - case b2Shape::e_polygon: - { - b2PolygonShape* poly = (b2PolygonShape*)fixture->GetShape(); - int32 vertexCount = poly->m_vertexCount; - b2Assert(vertexCount <= b2_maxPolygonVertices); - b2Vec2 vertices[b2_maxPolygonVertices]; - - for (int32 i = 0; i < vertexCount; ++i) - { - vertices[i] = b2Mul(xf, poly->m_vertices[i]); - } - - m_debugDraw->DrawSolidPolygon(vertices, vertexCount, color); - } - break; - - default: - break; - } -} - -void b2World::DrawJoint(b2Joint* joint) -{ - b2Body* bodyA = joint->GetBodyA(); - b2Body* bodyB = joint->GetBodyB(); - const b2Transform& xf1 = bodyA->GetTransform(); - const b2Transform& xf2 = bodyB->GetTransform(); - b2Vec2 x1 = xf1.p; - b2Vec2 x2 = xf2.p; - b2Vec2 p1 = joint->GetAnchorA(); - b2Vec2 p2 = joint->GetAnchorB(); - - b2Color color(0.5f, 0.8f, 0.8f); - - switch (joint->GetType()) - { - case e_distanceJoint: - m_debugDraw->DrawSegment(p1, p2, color); - break; - - case e_pulleyJoint: - { - b2PulleyJoint* pulley = (b2PulleyJoint*)joint; - b2Vec2 s1 = pulley->GetGroundAnchorA(); - b2Vec2 s2 = pulley->GetGroundAnchorB(); - m_debugDraw->DrawSegment(s1, p1, color); - m_debugDraw->DrawSegment(s2, p2, color); - m_debugDraw->DrawSegment(s1, s2, color); - } - break; - - case e_mouseJoint: - // don't draw this - break; - - default: - m_debugDraw->DrawSegment(x1, p1, color); - m_debugDraw->DrawSegment(p1, p2, color); - m_debugDraw->DrawSegment(x2, p2, color); - } -} - -void b2World::DrawDebugData() -{ - if (m_debugDraw == NULL) - { - return; - } - - uint32 flags = m_debugDraw->GetFlags(); - - if (flags & b2Draw::e_shapeBit) - { - for (b2Body* b = m_bodyList; b; b = b->GetNext()) - { - const b2Transform& xf = b->GetTransform(); - for (b2Fixture* f = b->GetFixtureList(); f; f = f->GetNext()) - { - if (b->IsActive() == false) - { - DrawShape(f, xf, b2Color(0.5f, 0.5f, 0.3f)); - } - else if (b->GetType() == b2_staticBody) - { - DrawShape(f, xf, b2Color(0.5f, 0.9f, 0.5f)); - } - else if (b->GetType() == b2_kinematicBody) - { - DrawShape(f, xf, b2Color(0.5f, 0.5f, 0.9f)); - } - else if (b->IsAwake() == false) - { - DrawShape(f, xf, b2Color(0.6f, 0.6f, 0.6f)); - } - else - { - DrawShape(f, xf, b2Color(0.9f, 0.7f, 0.7f)); - } - } - } - } - - if (flags & b2Draw::e_jointBit) - { - for (b2Joint* j = m_jointList; j; j = j->GetNext()) - { - DrawJoint(j); - } - } - - if (flags & b2Draw::e_pairBit) - { - b2Color color(0.3f, 0.9f, 0.9f); - for (b2Contact* c = m_contactManager.m_contactList; c; c = c->GetNext()) - { - //b2Fixture* fixtureA = c->GetFixtureA(); - //b2Fixture* fixtureB = c->GetFixtureB(); - - //b2Vec2 cA = fixtureA->GetAABB().GetCenter(); - //b2Vec2 cB = fixtureB->GetAABB().GetCenter(); - - //m_debugDraw->DrawSegment(cA, cB, color); - } - } - - if (flags & b2Draw::e_aabbBit) - { - b2Color color(0.9f, 0.3f, 0.9f); - b2BroadPhase* bp = &m_contactManager.m_broadPhase; - - for (b2Body* b = m_bodyList; b; b = b->GetNext()) - { - if (b->IsActive() == false) - { - continue; - } - - for (b2Fixture* f = b->GetFixtureList(); f; f = f->GetNext()) - { - for (int32 i = 0; i < f->m_proxyCount; ++i) - { - b2FixtureProxy* proxy = f->m_proxies + i; - b2AABB aabb = bp->GetFatAABB(proxy->proxyId); - b2Vec2 vs[4]; - vs[0].Set(aabb.lowerBound.x, aabb.lowerBound.y); - vs[1].Set(aabb.upperBound.x, aabb.lowerBound.y); - vs[2].Set(aabb.upperBound.x, aabb.upperBound.y); - vs[3].Set(aabb.lowerBound.x, aabb.upperBound.y); - - m_debugDraw->DrawPolygon(vs, 4, color); - } - } - } - } - - if (flags & b2Draw::e_centerOfMassBit) - { - for (b2Body* b = m_bodyList; b; b = b->GetNext()) - { - b2Transform xf = b->GetTransform(); - xf.p = b->GetWorldCenter(); - m_debugDraw->DrawTransform(xf); - } - } -} - -int32 b2World::GetProxyCount() const -{ - return m_contactManager.m_broadPhase.GetProxyCount(); -} - -int32 b2World::GetTreeHeight() const -{ - return m_contactManager.m_broadPhase.GetTreeHeight(); -} - -int32 b2World::GetTreeBalance() const -{ - return m_contactManager.m_broadPhase.GetTreeBalance(); -} - -float32 b2World::GetTreeQuality() const -{ - return m_contactManager.m_broadPhase.GetTreeQuality(); -} - -void b2World::Dump() -{ - if ((m_flags & e_locked) == e_locked) - { - return; - } - - b2Log("b2Vec2 g(%.15lef, %.15lef);\n", m_gravity.x, m_gravity.y); - b2Log("m_world->SetGravity(g);\n"); - - b2Log("b2Body** bodies = (b2Body**)b2Alloc(%d * sizeof(b2Body*));\n", m_bodyCount); - b2Log("b2Joint** joints = (b2Joint**)b2Alloc(%d * sizeof(b2Joint*));\n", m_jointCount); - int32 i = 0; - for (b2Body* b = m_bodyList; b; b = b->m_next) - { - b->m_islandIndex = i; - b->Dump(); - ++i; - } - - i = 0; - for (b2Joint* j = m_jointList; j; j = j->m_next) - { - j->m_index = i; - ++i; - } - - // First pass on joints, skip gear joints. - for (b2Joint* j = m_jointList; j; j = j->m_next) - { - if (j->m_type == e_gearJoint) - { - continue; - } - - b2Log("{\n"); - j->Dump(); - b2Log("}\n"); - } - - // Second pass on joints, only gear joints. - for (b2Joint* j = m_jointList; j; j = j->m_next) - { - if (j->m_type != e_gearJoint) - { - continue; - } - - b2Log("{\n"); - j->Dump(); - b2Log("}\n"); - } - - b2Log("b2Free(joints);\n"); - b2Log("b2Free(bodies);\n"); - b2Log("joints = NULL;\n"); - b2Log("bodies = NULL;\n"); -} diff --git a/external/box2d/Dynamics/b2World.h b/external/box2d/Dynamics/b2World.h deleted file mode 100644 index f207930511..0000000000 --- a/external/box2d/Dynamics/b2World.h +++ /dev/null @@ -1,349 +0,0 @@ -/* -* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_WORLD_H -#define B2_WORLD_H - -#include -#include -#include -#include -#include -#include - -struct b2AABB; -struct b2BodyDef; -struct b2Color; -struct b2JointDef; -class b2Body; -class b2Draw; -class b2Fixture; -class b2Joint; - -/// The world class manages all physics entities, dynamic simulation, -/// and asynchronous queries. The world also contains efficient memory -/// management facilities. -class b2World -{ -public: - /// Construct a world object. - /// @param gravity the world gravity vector. - b2World(const b2Vec2& gravity); - - /// Destruct the world. All physics entities are destroyed and all heap memory is released. - ~b2World(); - - /// Register a destruction listener. The listener is owned by you and must - /// remain in scope. - void SetDestructionListener(b2DestructionListener* listener); - - /// Register a contact filter to provide specific control over collision. - /// Otherwise the default filter is used (b2_defaultFilter). The listener is - /// owned by you and must remain in scope. - void SetContactFilter(b2ContactFilter* filter); - - /// Register a contact event listener. The listener is owned by you and must - /// remain in scope. - void SetContactListener(b2ContactListener* listener); - - /// Register a routine for debug drawing. The debug draw functions are called - /// inside with b2World::DrawDebugData method. The debug draw object is owned - /// by you and must remain in scope. - void SetDebugDraw(b2Draw* debugDraw); - - /// Create a rigid body given a definition. No reference to the definition - /// is retained. - /// @warning This function is locked during callbacks. - b2Body* CreateBody(const b2BodyDef* def); - - /// Destroy a rigid body given a definition. No reference to the definition - /// is retained. This function is locked during callbacks. - /// @warning This automatically deletes all associated shapes and joints. - /// @warning This function is locked during callbacks. - void DestroyBody(b2Body* body); - - /// Create a joint to constrain bodies together. No reference to the definition - /// is retained. This may cause the connected bodies to cease colliding. - /// @warning This function is locked during callbacks. - b2Joint* CreateJoint(const b2JointDef* def); - - /// Destroy a joint. This may cause the connected bodies to begin colliding. - /// @warning This function is locked during callbacks. - void DestroyJoint(b2Joint* joint); - - /// Take a time step. This performs collision detection, integration, - /// and constraint solution. - /// @param timeStep the amount of time to simulate, this should not vary. - /// @param velocityIterations for the velocity constraint solver. - /// @param positionIterations for the position constraint solver. - void Step( float32 timeStep, - int32 velocityIterations, - int32 positionIterations); - - /// Manually clear the force buffer on all bodies. By default, forces are cleared automatically - /// after each call to Step. The default behavior is modified by calling SetAutoClearForces. - /// The purpose of this function is to support sub-stepping. Sub-stepping is often used to maintain - /// a fixed sized time step under a variable frame-rate. - /// When you perform sub-stepping you will disable auto clearing of forces and instead call - /// ClearForces after all sub-steps are complete in one pass of your game loop. - /// @see SetAutoClearForces - void ClearForces(); - - /// Call this to draw shapes and other debug draw data. - void DrawDebugData(); - - /// Query the world for all fixtures that potentially overlap the - /// provided AABB. - /// @param callback a user implemented callback class. - /// @param aabb the query box. - void QueryAABB(b2QueryCallback* callback, const b2AABB& aabb) const; - - /// Ray-cast the world for all fixtures in the path of the ray. Your callback - /// controls whether you get the closest point, any point, or n-points. - /// The ray-cast ignores shapes that contain the starting point. - /// @param callback a user implemented callback class. - /// @param point1 the ray starting point - /// @param point2 the ray ending point - void RayCast(b2RayCastCallback* callback, const b2Vec2& point1, const b2Vec2& point2) const; - - /// Get the world body list. With the returned body, use b2Body::GetNext to get - /// the next body in the world list. A NULL body indicates the end of the list. - /// @return the head of the world body list. - b2Body* GetBodyList(); - const b2Body* GetBodyList() const; - - /// Get the world joint list. With the returned joint, use b2Joint::GetNext to get - /// the next joint in the world list. A NULL joint indicates the end of the list. - /// @return the head of the world joint list. - b2Joint* GetJointList(); - const b2Joint* GetJointList() const; - - /// Get the world contact list. With the returned contact, use b2Contact::GetNext to get - /// the next contact in the world list. A NULL contact indicates the end of the list. - /// @return the head of the world contact list. - /// @warning contacts are created and destroyed in the middle of a time step. - /// Use b2ContactListener to avoid missing contacts. - b2Contact* GetContactList(); - const b2Contact* GetContactList() const; - - /// Enable/disable sleep. - void SetAllowSleeping(bool flag); - bool GetAllowSleeping() const { return m_allowSleep; } - - /// Enable/disable warm starting. For testing. - void SetWarmStarting(bool flag) { m_warmStarting = flag; } - bool GetWarmStarting() const { return m_warmStarting; } - - /// Enable/disable continuous physics. For testing. - void SetContinuousPhysics(bool flag) { m_continuousPhysics = flag; } - bool GetContinuousPhysics() const { return m_continuousPhysics; } - - /// Enable/disable single stepped continuous physics. For testing. - void SetSubStepping(bool flag) { m_subStepping = flag; } - bool GetSubStepping() const { return m_subStepping; } - - /// Get the number of broad-phase proxies. - int32 GetProxyCount() const; - - /// Get the number of bodies. - int32 GetBodyCount() const; - - /// Get the number of joints. - int32 GetJointCount() const; - - /// Get the number of contacts (each may have 0 or more contact points). - int32 GetContactCount() const; - - /// Get the height of the dynamic tree. - int32 GetTreeHeight() const; - - /// Get the balance of the dynamic tree. - int32 GetTreeBalance() const; - - /// Get the quality metric of the dynamic tree. The smaller the better. - /// The minimum is 1. - float32 GetTreeQuality() const; - - /// Change the global gravity vector. - void SetGravity(const b2Vec2& gravity); - - /// Get the global gravity vector. - b2Vec2 GetGravity() const; - - /// Is the world locked (in the middle of a time step). - bool IsLocked() const; - - /// Set flag to control automatic clearing of forces after each time step. - void SetAutoClearForces(bool flag); - - /// Get the flag that controls automatic clearing of forces after each time step. - bool GetAutoClearForces() const; - - /// Get the contact manager for testing. - const b2ContactManager& GetContactManager() const; - - /// Get the current profile. - const b2Profile& GetProfile() const; - - /// Dump the world into the log file. - /// @warning this should be called outside of a time step. - void Dump(); - -private: - - // m_flags - enum - { - e_newFixture = 0x0001, - e_locked = 0x0002, - e_clearForces = 0x0004 - }; - - friend class b2Body; - friend class b2Fixture; - friend class b2ContactManager; - friend class b2Controller; - - void Solve(const b2TimeStep& step); - void SolveTOI(const b2TimeStep& step); - - void DrawJoint(b2Joint* joint); - void DrawShape(b2Fixture* shape, const b2Transform& xf, const b2Color& color); - - b2BlockAllocator m_blockAllocator; - b2StackAllocator m_stackAllocator; - - int32 m_flags; - - b2ContactManager m_contactManager; - - b2Body* m_bodyList; - b2Joint* m_jointList; - - int32 m_bodyCount; - int32 m_jointCount; - - b2Vec2 m_gravity; - bool m_allowSleep; - - b2DestructionListener* m_destructionListener; - b2Draw* m_debugDraw; - - // This is used to compute the time step ratio to - // support a variable time step. - float32 m_inv_dt0; - - // These are for debugging the solver. - bool m_warmStarting; - bool m_continuousPhysics; - bool m_subStepping; - - bool m_stepComplete; - - b2Profile m_profile; -}; - -inline b2Body* b2World::GetBodyList() -{ - return m_bodyList; -} - -inline const b2Body* b2World::GetBodyList() const -{ - return m_bodyList; -} - -inline b2Joint* b2World::GetJointList() -{ - return m_jointList; -} - -inline const b2Joint* b2World::GetJointList() const -{ - return m_jointList; -} - -inline b2Contact* b2World::GetContactList() -{ - return m_contactManager.m_contactList; -} - -inline const b2Contact* b2World::GetContactList() const -{ - return m_contactManager.m_contactList; -} - -inline int32 b2World::GetBodyCount() const -{ - return m_bodyCount; -} - -inline int32 b2World::GetJointCount() const -{ - return m_jointCount; -} - -inline int32 b2World::GetContactCount() const -{ - return m_contactManager.m_contactCount; -} - -inline void b2World::SetGravity(const b2Vec2& gravity) -{ - m_gravity = gravity; -} - -inline b2Vec2 b2World::GetGravity() const -{ - return m_gravity; -} - -inline bool b2World::IsLocked() const -{ - return (m_flags & e_locked) == e_locked; -} - -inline void b2World::SetAutoClearForces(bool flag) -{ - if (flag) - { - m_flags |= e_clearForces; - } - else - { - m_flags &= ~e_clearForces; - } -} - -/// Get the flag that controls automatic clearing of forces after each time step. -inline bool b2World::GetAutoClearForces() const -{ - return (m_flags & e_clearForces) == e_clearForces; -} - -inline const b2ContactManager& b2World::GetContactManager() const -{ - return m_contactManager; -} - -inline const b2Profile& b2World::GetProfile() const -{ - return m_profile; -} - -#endif diff --git a/external/box2d/Dynamics/b2WorldCallbacks.cpp b/external/box2d/Dynamics/b2WorldCallbacks.cpp deleted file mode 100644 index 48ad0cc46a..0000000000 --- a/external/box2d/Dynamics/b2WorldCallbacks.cpp +++ /dev/null @@ -1,36 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include - -// Return true if contact calculations should be performed between these two shapes. -// If you implement your own collision filter you may want to build from this implementation. -bool b2ContactFilter::ShouldCollide(b2Fixture* fixtureA, b2Fixture* fixtureB) -{ - const b2Filter& filterA = fixtureA->GetFilterData(); - const b2Filter& filterB = fixtureB->GetFilterData(); - - if (filterA.groupIndex == filterB.groupIndex && filterA.groupIndex != 0) - { - return filterA.groupIndex > 0; - } - - bool collide = (filterA.maskBits & filterB.categoryBits) != 0 && (filterA.categoryBits & filterB.maskBits) != 0; - return collide; -} diff --git a/external/box2d/Dynamics/b2WorldCallbacks.h b/external/box2d/Dynamics/b2WorldCallbacks.h deleted file mode 100644 index 86c04e3e32..0000000000 --- a/external/box2d/Dynamics/b2WorldCallbacks.h +++ /dev/null @@ -1,155 +0,0 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_WORLD_CALLBACKS_H -#define B2_WORLD_CALLBACKS_H - -#include - -struct b2Vec2; -struct b2Transform; -class b2Fixture; -class b2Body; -class b2Joint; -class b2Contact; -struct b2ContactResult; -struct b2Manifold; - -/// Joints and fixtures are destroyed when their associated -/// body is destroyed. Implement this listener so that you -/// may nullify references to these joints and shapes. -class b2DestructionListener -{ -public: - virtual ~b2DestructionListener() {} - - /// Called when any joint is about to be destroyed due - /// to the destruction of one of its attached bodies. - virtual void SayGoodbye(b2Joint* joint) = 0; - - /// Called when any fixture is about to be destroyed due - /// to the destruction of its parent body. - virtual void SayGoodbye(b2Fixture* fixture) = 0; -}; - -/// Implement this class to provide collision filtering. In other words, you can implement -/// this class if you want finer control over contact creation. -class b2ContactFilter -{ -public: - virtual ~b2ContactFilter() {} - - /// Return true if contact calculations should be performed between these two shapes. - /// @warning for performance reasons this is only called when the AABBs begin to overlap. - virtual bool ShouldCollide(b2Fixture* fixtureA, b2Fixture* fixtureB); -}; - -/// Contact impulses for reporting. Impulses are used instead of forces because -/// sub-step forces may approach infinity for rigid body collisions. These -/// match up one-to-one with the contact points in b2Manifold. -struct b2ContactImpulse -{ - float32 normalImpulses[b2_maxManifoldPoints]; - float32 tangentImpulses[b2_maxManifoldPoints]; - int32 count; -}; - -/// Implement this class to get contact information. You can use these results for -/// things like sounds and game logic. You can also get contact results by -/// traversing the contact lists after the time step. However, you might miss -/// some contacts because continuous physics leads to sub-stepping. -/// Additionally you may receive multiple callbacks for the same contact in a -/// single time step. -/// You should strive to make your callbacks efficient because there may be -/// many callbacks per time step. -/// @warning You cannot create/destroy Box2D entities inside these callbacks. -class b2ContactListener -{ -public: - virtual ~b2ContactListener() {} - - /// Called when two fixtures begin to touch. - virtual void BeginContact(b2Contact* contact) { B2_NOT_USED(contact); } - - /// Called when two fixtures cease to touch. - virtual void EndContact(b2Contact* contact) { B2_NOT_USED(contact); } - - /// This is called after a contact is updated. This allows you to inspect a - /// contact before it goes to the solver. If you are careful, you can modify the - /// contact manifold (e.g. disable contact). - /// A copy of the old manifold is provided so that you can detect changes. - /// Note: this is called only for awake bodies. - /// Note: this is called even when the number of contact points is zero. - /// Note: this is not called for sensors. - /// Note: if you set the number of contact points to zero, you will not - /// get an EndContact callback. However, you may get a BeginContact callback - /// the next step. - virtual void PreSolve(b2Contact* contact, const b2Manifold* oldManifold) - { - B2_NOT_USED(contact); - B2_NOT_USED(oldManifold); - } - - /// This lets you inspect a contact after the solver is finished. This is useful - /// for inspecting impulses. - /// Note: the contact manifold does not include time of impact impulses, which can be - /// arbitrarily large if the sub-step is small. Hence the impulse is provided explicitly - /// in a separate data structure. - /// Note: this is only called for contacts that are touching, solid, and awake. - virtual void PostSolve(b2Contact* contact, const b2ContactImpulse* impulse) - { - B2_NOT_USED(contact); - B2_NOT_USED(impulse); - } -}; - -/// Callback class for AABB queries. -/// See b2World::Query -class b2QueryCallback -{ -public: - virtual ~b2QueryCallback() {} - - /// Called for each fixture found in the query AABB. - /// @return false to terminate the query. - virtual bool ReportFixture(b2Fixture* fixture) = 0; -}; - -/// Callback class for ray casts. -/// See b2World::RayCast -class b2RayCastCallback -{ -public: - virtual ~b2RayCastCallback() {} - - /// Called for each fixture found in the query. You control how the ray cast - /// proceeds by returning a float: - /// return -1: ignore this fixture and continue - /// return 0: terminate the ray cast - /// return fraction: clip the ray to this point - /// return 1: don't clip the ray and continue - /// @param fixture the fixture hit by the ray - /// @param point the point of initial intersection - /// @param normal the normal vector at the point of intersection - /// @return -1 to filter, 0 to terminate, fraction to clip the ray for - /// closest hit, 1 to continue - virtual float32 ReportFixture( b2Fixture* fixture, const b2Vec2& point, - const b2Vec2& normal, float32 fraction) = 0; -}; - -#endif diff --git a/external/box2d/Rope/b2Rope.cpp b/external/box2d/Rope/b2Rope.cpp deleted file mode 100644 index 9bf671aec9..0000000000 --- a/external/box2d/Rope/b2Rope.cpp +++ /dev/null @@ -1,259 +0,0 @@ -/* -* Copyright (c) 2011 Erin Catto http://box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include - -b2Rope::b2Rope() -{ - m_count = 0; - m_ps = NULL; - m_p0s = NULL; - m_vs = NULL; - m_ims = NULL; - m_Ls = NULL; - m_as = NULL; - m_gravity.SetZero(); - m_k2 = 1.0f; - m_k3 = 0.1f; -} - -b2Rope::~b2Rope() -{ - b2Free(m_ps); - b2Free(m_p0s); - b2Free(m_vs); - b2Free(m_ims); - b2Free(m_Ls); - b2Free(m_as); -} - -void b2Rope::Initialize(const b2RopeDef* def) -{ - b2Assert(def->count >= 3); - m_count = def->count; - m_ps = (b2Vec2*)b2Alloc(m_count * sizeof(b2Vec2)); - m_p0s = (b2Vec2*)b2Alloc(m_count * sizeof(b2Vec2)); - m_vs = (b2Vec2*)b2Alloc(m_count * sizeof(b2Vec2)); - m_ims = (float32*)b2Alloc(m_count * sizeof(float32)); - - for (int32 i = 0; i < m_count; ++i) - { - m_ps[i] = def->vertices[i]; - m_p0s[i] = def->vertices[i]; - m_vs[i].SetZero(); - - float32 m = def->masses[i]; - if (m > 0.0f) - { - m_ims[i] = 1.0f / m; - } - else - { - m_ims[i] = 0.0f; - } - } - - int32 count2 = m_count - 1; - int32 count3 = m_count - 2; - m_Ls = (float32*)b2Alloc(count2 * sizeof(float32)); - m_as = (float32*)b2Alloc(count3 * sizeof(float32)); - - for (int32 i = 0; i < count2; ++i) - { - b2Vec2 p1 = m_ps[i]; - b2Vec2 p2 = m_ps[i+1]; - m_Ls[i] = b2Distance(p1, p2); - } - - for (int32 i = 0; i < count3; ++i) - { - b2Vec2 p1 = m_ps[i]; - b2Vec2 p2 = m_ps[i + 1]; - b2Vec2 p3 = m_ps[i + 2]; - - b2Vec2 d1 = p2 - p1; - b2Vec2 d2 = p3 - p2; - - float32 a = b2Cross(d1, d2); - float32 b = b2Dot(d1, d2); - - m_as[i] = b2Atan2(a, b); - } - - m_gravity = def->gravity; - m_damping = def->damping; - m_k2 = def->k2; - m_k3 = def->k3; -} - -void b2Rope::Step(float32 h, int32 iterations) -{ - if (h == 0.0) - { - return; - } - - float32 d = expf(- h * m_damping); - - for (int32 i = 0; i < m_count; ++i) - { - m_p0s[i] = m_ps[i]; - if (m_ims[i] > 0.0f) - { - m_vs[i] += h * m_gravity; - } - m_vs[i] *= d; - m_ps[i] += h * m_vs[i]; - - } - - for (int32 i = 0; i < iterations; ++i) - { - SolveC2(); - SolveC3(); - SolveC2(); - } - - float32 inv_h = 1.0f / h; - for (int32 i = 0; i < m_count; ++i) - { - m_vs[i] = inv_h * (m_ps[i] - m_p0s[i]); - } -} - -void b2Rope::SolveC2() -{ - int32 count2 = m_count - 1; - - for (int32 i = 0; i < count2; ++i) - { - b2Vec2 p1 = m_ps[i]; - b2Vec2 p2 = m_ps[i + 1]; - - b2Vec2 d = p2 - p1; - float32 L = d.Normalize(); - - float32 im1 = m_ims[i]; - float32 im2 = m_ims[i + 1]; - - if (im1 + im2 == 0.0f) - { - continue; - } - - float32 s1 = im1 / (im1 + im2); - float32 s2 = im2 / (im1 + im2); - - p1 -= m_k2 * s1 * (m_Ls[i] - L) * d; - p2 += m_k2 * s2 * (m_Ls[i] - L) * d; - - m_ps[i] = p1; - m_ps[i + 1] = p2; - } -} - -void b2Rope::SetAngle(float32 angle) -{ - int32 count3 = m_count - 2; - for (int32 i = 0; i < count3; ++i) - { - m_as[i] = angle; - } -} - -void b2Rope::SolveC3() -{ - int32 count3 = m_count - 2; - - for (int32 i = 0; i < count3; ++i) - { - b2Vec2 p1 = m_ps[i]; - b2Vec2 p2 = m_ps[i + 1]; - b2Vec2 p3 = m_ps[i + 2]; - - float32 m1 = m_ims[i]; - float32 m2 = m_ims[i + 1]; - float32 m3 = m_ims[i + 2]; - - b2Vec2 d1 = p2 - p1; - b2Vec2 d2 = p3 - p2; - - float32 L1sqr = d1.LengthSquared(); - float32 L2sqr = d2.LengthSquared(); - - if (L1sqr * L2sqr == 0.0f) - { - continue; - } - - float32 a = b2Cross(d1, d2); - float32 b = b2Dot(d1, d2); - - float32 angle = b2Atan2(a, b); - - b2Vec2 Jd1 = (-1.0f / L1sqr) * d1.Skew(); - b2Vec2 Jd2 = (1.0f / L2sqr) * d2.Skew(); - - b2Vec2 J1 = -Jd1; - b2Vec2 J2 = Jd1 - Jd2; - b2Vec2 J3 = Jd2; - - float32 mass = m1 * b2Dot(J1, J1) + m2 * b2Dot(J2, J2) + m3 * b2Dot(J3, J3); - if (mass == 0.0f) - { - continue; - } - - mass = 1.0f / mass; - - float32 C = angle - m_as[i]; - - while (C > b2_pi) - { - angle -= 2 * b2_pi; - C = angle - m_as[i]; - } - - while (C < -b2_pi) - { - angle += 2.0f * b2_pi; - C = angle - m_as[i]; - } - - float32 impulse = - m_k3 * mass * C; - - p1 += (m1 * impulse) * J1; - p2 += (m2 * impulse) * J2; - p3 += (m3 * impulse) * J3; - - m_ps[i] = p1; - m_ps[i + 1] = p2; - m_ps[i + 2] = p3; - } -} - -void b2Rope::Draw(b2Draw* draw) const -{ - b2Color c(0.4f, 0.5f, 0.7f); - - for (int32 i = 0; i < m_count - 1; ++i) - { - draw->DrawSegment(m_ps[i], m_ps[i+1], c); - } -} diff --git a/external/box2d/Rope/b2Rope.h b/external/box2d/Rope/b2Rope.h deleted file mode 100644 index b981dfd6c5..0000000000 --- a/external/box2d/Rope/b2Rope.h +++ /dev/null @@ -1,115 +0,0 @@ -/* -* Copyright (c) 2011 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_ROPE_H -#define B2_ROPE_H - -#include - -class b2Draw; - -/// -struct b2RopeDef -{ - b2RopeDef() - { - vertices = NULL; - count = 0; - masses = NULL; - gravity.SetZero(); - damping = 0.1f; - k2 = 0.9f; - k3 = 0.1f; - } - - /// - b2Vec2* vertices; - - /// - int32 count; - - /// - float32* masses; - - /// - b2Vec2 gravity; - - /// - float32 damping; - - /// Stretching stiffness - float32 k2; - - /// Bending stiffness. Values above 0.5 can make the simulation blow up. - float32 k3; -}; - -/// -class b2Rope -{ -public: - b2Rope(); - ~b2Rope(); - - /// - void Initialize(const b2RopeDef* def); - - /// - void Step(float32 timeStep, int32 iterations); - - /// - int32 GetVertexCount() const - { - return m_count; - } - - /// - const b2Vec2* GetVertices() const - { - return m_ps; - } - - /// - void Draw(b2Draw* draw) const; - - /// - void SetAngle(float32 angle); - -private: - - void SolveC2(); - void SolveC3(); - - int32 m_count; - b2Vec2* m_ps; - b2Vec2* m_p0s; - b2Vec2* m_vs; - - float32* m_ims; - - float32* m_Ls; - float32* m_as; - - b2Vec2 m_gravity; - float32 m_damping; - - float32 m_k2; - float32 m_k3; -}; - -#endif diff --git a/external/box2d/proj.linux/.cproject b/external/box2d/proj.linux/.cproject deleted file mode 100644 index 5aa092cac3..0000000000 --- a/external/box2d/proj.linux/.cproject +++ /dev/null @@ -1,267 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/external/box2d/proj.linux/.project b/external/box2d/proj.linux/.project deleted file mode 100644 index 164d50f52a..0000000000 --- a/external/box2d/proj.linux/.project +++ /dev/null @@ -1,110 +0,0 @@ - - - libBox2D - - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.autoBuildTarget - all - - - org.eclipse.cdt.make.core.buildArguments - - - - org.eclipse.cdt.make.core.buildCommand - make - - - org.eclipse.cdt.make.core.buildLocation - ${workspace_loc:/libBox2D/Debug} - - - org.eclipse.cdt.make.core.cleanBuildTarget - clean - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - false - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.fullBuildTarget - all - - - org.eclipse.cdt.make.core.stopOnError - true - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - true - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.core.ccnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - - - - Box2D.h - 1 - PARENT-1-PROJECT_LOC/Box2D.h - - - Collision - 2 - PARENT-1-PROJECT_LOC/Collision - - - Common - 2 - PARENT-1-PROJECT_LOC/Common - - - Dynamics - 2 - PARENT-1-PROJECT_LOC/Dynamics - - - Rope - 2 - PARENT-1-PROJECT_LOC/Rope - - - diff --git a/external/box2d/proj.linux/Makefile b/external/box2d/proj.linux/Makefile deleted file mode 100644 index e430bc9883..0000000000 --- a/external/box2d/proj.linux/Makefile +++ /dev/null @@ -1,72 +0,0 @@ -TARGET = libbox2d.a - -SOURCES = ../Collision/Shapes/b2ChainShape.cpp \ -../Collision/Shapes/b2CircleShape.cpp \ -../Collision/Shapes/b2EdgeShape.cpp \ -../Collision/Shapes/b2PolygonShape.cpp \ -../Collision/b2BroadPhase.cpp \ -../Collision/b2CollideCircle.cpp \ -../Collision/b2CollideEdge.cpp \ -../Collision/b2CollidePolygon.cpp \ -../Collision/b2Collision.cpp \ -../Collision/b2Distance.cpp \ -../Collision/b2DynamicTree.cpp \ -../Collision/b2TimeOfImpact.cpp \ -../Common/b2BlockAllocator.cpp \ -../Common/b2Draw.cpp \ -../Common/b2Math.cpp \ -../Common/b2Settings.cpp \ -../Common/b2StackAllocator.cpp \ -../Common/b2Timer.cpp \ -../Dynamics/Contacts/b2ChainAndCircleContact.cpp \ -../Dynamics/Contacts/b2ChainAndPolygonContact.cpp \ -../Dynamics/Contacts/b2CircleContact.cpp \ -../Dynamics/Contacts/b2Contact.cpp \ -../Dynamics/Contacts/b2ContactSolver.cpp \ -../Dynamics/Contacts/b2EdgeAndCircleContact.cpp \ -../Dynamics/Contacts/b2EdgeAndPolygonContact.cpp \ -../Dynamics/Contacts/b2PolygonAndCircleContact.cpp \ -../Dynamics/Contacts/b2PolygonContact.cpp \ -../Dynamics/Joints/b2DistanceJoint.cpp \ -../Dynamics/Joints/b2FrictionJoint.cpp \ -../Dynamics/Joints/b2GearJoint.cpp \ -../Dynamics/Joints/b2Joint.cpp \ -../Dynamics/Joints/b2MouseJoint.cpp \ -../Dynamics/Joints/b2PrismaticJoint.cpp \ -../Dynamics/Joints/b2PulleyJoint.cpp \ -../Dynamics/Joints/b2RevoluteJoint.cpp \ -../Dynamics/Joints/b2RopeJoint.cpp \ -../Dynamics/Joints/b2WeldJoint.cpp \ -../Dynamics/Joints/b2WheelJoint.cpp \ -../Dynamics/b2Body.cpp \ -../Dynamics/b2ContactManager.cpp \ -../Dynamics/b2Fixture.cpp \ -../Dynamics/b2Island.cpp \ -../Dynamics/b2World.cpp \ -../Dynamics/b2WorldCallbacks.cpp \ -../Rope/b2Rope.cpp - -include ../../../cocos2dx/proj.linux/cocos2dx.mk - -INCLUDES = -I../.. - -# Cocos2d is not responsible for warnings in external projects -CXXFLAGS += -w - -ifeq ($(DEBUG), 1) -DEFINES = -D_DEBUG -else -DEFINES = -endif - -TARGET := $(LIB_DIR)/$(TARGET) - -all: $(TARGET) - -$(TARGET): $(OBJECTS) $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(LOG_AR)$(AR) $(ARFLAGS) $(TARGET) $(OBJECTS) - -$(OBJ_DIR)/%.o: ../%.cpp $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(LOG_CXX)$(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@ diff --git a/external/box2d/proj.linux/box2d.prf b/external/box2d/proj.linux/box2d.prf deleted file mode 100644 index 434ad88406..0000000000 --- a/external/box2d/proj.linux/box2d.prf +++ /dev/null @@ -1,19 +0,0 @@ -################################################################################ -# Do not include this file in your project: see cocos2dx.pri. -################################################################################ - -linux { - # We will compile box2d on demand using Makefile. - build_box2d.name = Build box2d static library - build_box2d.input = $$PWD/Makefile - build_box2d.output = $$CC_LIBRARY_DIR/libbox2d.a - build_box2d.target = $$CC_LIBRARY_DIR/libbox2d.a - build_box2d.CONFIG = no_link target_predeps - build_box2d.commands = cd $$PWD && make $$CC_MAKE_FLAGS - - QMAKE_EXTRA_COMPILERS += build_box2d - QMAKE_EXTRA_TARGETS += build_box2d - - PRE_TARGETDEPS += $$CC_LIBRARY_DIR/libbox2d.a - LIBS += -Wl,-Bstatic -lbox2d -Wl,-Bdynamic -} diff --git a/external/box2d/proj.win32/Box2D.vcxproj b/external/box2d/proj.win32/Box2D.vcxproj deleted file mode 100644 index cd4bd2086c..0000000000 --- a/external/box2d/proj.win32/Box2D.vcxproj +++ /dev/null @@ -1,194 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - libBox2D - {929480E7-23C0-4DF6-8456-096D71547116} - Box2D.win32 - Win32Proj - - - - StaticLibrary - Unicode - v100 - v110 - v110_xp - - - StaticLibrary - Unicode - v100 - v110 - v110_xp - - - - - - - - - - - - - <_ProjectFileVersion>10.0.40219.1 - $(SolutionDir)$(Configuration).win32\ - $(Configuration).win32\ - $(SolutionDir)$(Configuration).win32\ - $(Configuration).win32\ - AllRules.ruleset - - - AllRules.ruleset - - - - - $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\lib;$(LibraryPath) - - - $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\lib;$(LibraryPath) - - - - Disabled - $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\include;../../;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) - false - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - EditAndContinue - true - - - $(OutDir)$(ProjectName).lib - - - - - $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\include;../../;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) - MultiThreadedDLL - - - Level3 - ProgramDatabase - true - - - $(OutDir)$(ProjectName).lib - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/external/box2d/proj.win32/Box2D.vcxproj.filters b/external/box2d/proj.win32/Box2D.vcxproj.filters deleted file mode 100644 index e810cbb0cf..0000000000 --- a/external/box2d/proj.win32/Box2D.vcxproj.filters +++ /dev/null @@ -1,301 +0,0 @@ - - - - - {bdf099c5-cc32-468b-b53f-ec010d7f823f} - - - {92792f88-4e5c-46ee-8d87-002f3b2297ae} - - - {f41a6fa6-5ac1-4514-9ac0-6f3a38f35b4d} - - - {0b56913a-34b7-410a-b386-869d6f7a20be} - - - {f0e7b230-79cc-49b8-9ed7-9dbfa062f2a4} - - - {932f2008-afbe-42f5-993d-a1df0ec67756} - - - {f8937e09-93a4-49fa-8f3e-dfc36da764df} - - - - - Collision - - - Collision - - - Collision - - - Collision - - - Collision - - - Collision - - - Collision - - - Collision - - - Collision\Shapes - - - Collision\Shapes - - - Collision\Shapes - - - Collision\Shapes - - - Common - - - Common - - - Common - - - Common - - - Common - - - Common - - - Dynamics - - - Dynamics - - - Dynamics - - - Dynamics - - - Dynamics - - - Dynamics - - - Dynamics\Contacts - - - Dynamics\Contacts - - - Dynamics\Contacts - - - Dynamics\Contacts - - - Dynamics\Contacts - - - Dynamics\Contacts - - - Dynamics\Contacts - - - Dynamics\Contacts - - - Dynamics\Contacts - - - Dynamics\Joints - - - Dynamics\Joints - - - Dynamics\Joints - - - Dynamics\Joints - - - Dynamics\Joints - - - Dynamics\Joints - - - Dynamics\Joints - - - Dynamics\Joints - - - Dynamics\Joints - - - Dynamics\Joints - - - Dynamics\Joints - - - Rope - - - - - Collision - - - Collision - - - Collision - - - Collision - - - Collision - - - Collision\Shapes - - - Collision\Shapes - - - Collision\Shapes - - - Collision\Shapes - - - Collision\Shapes - - - Common - - - Common - - - Common - - - Common - - - Common - - - Common - - - Common - - - Dynamics - - - Dynamics - - - Dynamics - - - Dynamics - - - Dynamics - - - Dynamics - - - Dynamics - - - Dynamics\Contacts - - - Dynamics\Contacts - - - Dynamics\Contacts - - - Dynamics\Contacts - - - Dynamics\Contacts - - - Dynamics\Contacts - - - Dynamics\Contacts - - - Dynamics\Contacts - - - Dynamics\Contacts - - - Dynamics\Joints - - - Dynamics\Joints - - - Dynamics\Joints - - - Dynamics\Joints - - - Dynamics\Joints - - - Dynamics\Joints - - - Dynamics\Joints - - - Dynamics\Joints - - - Dynamics\Joints - - - Dynamics\Joints - - - Dynamics\Joints - - - Rope - - - - \ No newline at end of file diff --git a/external/box2d/proj.win32/Box2D.vcxproj.user b/external/box2d/proj.win32/Box2D.vcxproj.user deleted file mode 100644 index ace9a86acb..0000000000 --- a/external/box2d/proj.win32/Box2D.vcxproj.user +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file From a96fc9dc16a84baca679449ab70b2ccb80c94742 Mon Sep 17 00:00:00 2001 From: minggo Date: Sat, 12 Oct 2013 14:15:32 +0800 Subject: [PATCH 19/64] issue #2905:add Box2D --- external/Box2D/Android.mk | 60 + external/Box2D/Box2D.h | 67 + .../Box2D/Collision/Shapes/b2ChainShape.cpp | 171 +++ .../Box2D/Collision/Shapes/b2ChainShape.h | 102 ++ .../Box2D/Collision/Shapes/b2CircleShape.cpp | 100 ++ .../Box2D/Collision/Shapes/b2CircleShape.h | 91 ++ .../Box2D/Collision/Shapes/b2EdgeShape.cpp | 139 ++ external/Box2D/Collision/Shapes/b2EdgeShape.h | 74 + .../Box2D/Collision/Shapes/b2PolygonShape.cpp | 361 +++++ .../Box2D/Collision/Shapes/b2PolygonShape.h | 95 ++ external/Box2D/Collision/Shapes/b2Shape.h | 101 ++ external/Box2D/Collision/b2BroadPhase.cpp | 122 ++ external/Box2D/Collision/b2BroadPhase.h | 248 ++++ external/Box2D/Collision/b2CollideCircle.cpp | 154 ++ external/Box2D/Collision/b2CollideEdge.cpp | 698 +++++++++ external/Box2D/Collision/b2CollidePolygon.cpp | 317 ++++ external/Box2D/Collision/b2Collision.cpp | 249 ++++ external/Box2D/Collision/b2Collision.h | 276 ++++ external/Box2D/Collision/b2Distance.cpp | 603 ++++++++ external/Box2D/Collision/b2Distance.h | 141 ++ external/Box2D/Collision/b2DynamicTree.cpp | 775 ++++++++++ external/Box2D/Collision/b2DynamicTree.h | 284 ++++ external/Box2D/Collision/b2TimeOfImpact.cpp | 488 ++++++ external/Box2D/Collision/b2TimeOfImpact.h | 58 + external/Box2D/Common/b2BlockAllocator.cpp | 218 +++ external/Box2D/Common/b2BlockAllocator.h | 62 + external/Box2D/Common/b2Draw.cpp | 44 + external/Box2D/Common/b2Draw.h | 81 + external/Box2D/Common/b2GrowableStack.h | 85 ++ external/Box2D/Common/b2Math.cpp | 94 ++ external/Box2D/Common/b2Math.h | 738 +++++++++ external/Box2D/Common/b2Settings.cpp | 61 + external/Box2D/Common/b2Settings.h | 150 ++ external/Box2D/Common/b2StackAllocator.cpp | 83 ++ external/Box2D/Common/b2StackAllocator.h | 60 + external/Box2D/Common/b2Timer.cpp | 100 ++ external/Box2D/Common/b2Timer.h | 45 + .../Contacts/b2ChainAndCircleContact.cpp | 54 + .../Contacts/b2ChainAndCircleContact.h | 39 + .../Contacts/b2ChainAndPolygonContact.cpp | 54 + .../Contacts/b2ChainAndPolygonContact.h | 39 + .../Dynamics/Contacts/b2CircleContact.cpp | 53 + .../Box2D/Dynamics/Contacts/b2CircleContact.h | 39 + .../Box2D/Dynamics/Contacts/b2Contact.cpp | 240 +++ external/Box2D/Dynamics/Contacts/b2Contact.h | 331 +++++ .../Dynamics/Contacts/b2ContactSolver.cpp | 832 +++++++++++ .../Box2D/Dynamics/Contacts/b2ContactSolver.h | 94 ++ .../Contacts/b2EdgeAndCircleContact.cpp | 50 + .../Contacts/b2EdgeAndCircleContact.h | 39 + .../Contacts/b2EdgeAndPolygonContact.cpp | 50 + .../Contacts/b2EdgeAndPolygonContact.h | 39 + .../Contacts/b2PolygonAndCircleContact.cpp | 50 + .../Contacts/b2PolygonAndCircleContact.h | 38 + .../Dynamics/Contacts/b2PolygonContact.cpp | 53 + .../Dynamics/Contacts/b2PolygonContact.h | 39 + .../Box2D/Dynamics/Joints/b2DistanceJoint.cpp | 260 ++++ .../Box2D/Dynamics/Joints/b2DistanceJoint.h | 169 +++ .../Box2D/Dynamics/Joints/b2FrictionJoint.cpp | 251 ++++ .../Box2D/Dynamics/Joints/b2FrictionJoint.h | 119 ++ .../Box2D/Dynamics/Joints/b2GearJoint.cpp | 423 ++++++ external/Box2D/Dynamics/Joints/b2GearJoint.h | 125 ++ external/Box2D/Dynamics/Joints/b2Joint.cpp | 199 +++ external/Box2D/Dynamics/Joints/b2Joint.h | 222 +++ .../Box2D/Dynamics/Joints/b2MouseJoint.cpp | 217 +++ external/Box2D/Dynamics/Joints/b2MouseJoint.h | 126 ++ .../Dynamics/Joints/b2PrismaticJoint.cpp | 637 ++++++++ .../Box2D/Dynamics/Joints/b2PrismaticJoint.h | 196 +++ .../Box2D/Dynamics/Joints/b2PulleyJoint.cpp | 332 +++++ .../Box2D/Dynamics/Joints/b2PulleyJoint.h | 143 ++ .../Box2D/Dynamics/Joints/b2RevoluteJoint.cpp | 504 +++++++ .../Box2D/Dynamics/Joints/b2RevoluteJoint.h | 204 +++ .../Box2D/Dynamics/Joints/b2RopeJoint.cpp | 241 +++ external/Box2D/Dynamics/Joints/b2RopeJoint.h | 114 ++ .../Box2D/Dynamics/Joints/b2WeldJoint.cpp | 330 +++++ external/Box2D/Dynamics/Joints/b2WeldJoint.h | 126 ++ .../Box2D/Dynamics/Joints/b2WheelJoint.cpp | 419 ++++++ external/Box2D/Dynamics/Joints/b2WheelJoint.h | 213 +++ external/Box2D/Dynamics/b2Body.cpp | 514 +++++++ external/Box2D/Dynamics/b2Body.h | 846 +++++++++++ external/Box2D/Dynamics/b2ContactManager.cpp | 293 ++++ external/Box2D/Dynamics/b2ContactManager.h | 52 + external/Box2D/Dynamics/b2Fixture.cpp | 303 ++++ external/Box2D/Dynamics/b2Fixture.h | 345 +++++ external/Box2D/Dynamics/b2Island.cpp | 539 +++++++ external/Box2D/Dynamics/b2Island.h | 93 ++ external/Box2D/Dynamics/b2TimeStep.h | 70 + external/Box2D/Dynamics/b2World.cpp | 1316 +++++++++++++++++ external/Box2D/Dynamics/b2World.h | 349 +++++ external/Box2D/Dynamics/b2WorldCallbacks.cpp | 36 + external/Box2D/Dynamics/b2WorldCallbacks.h | 155 ++ external/Box2D/Rope/b2Rope.cpp | 259 ++++ external/Box2D/Rope/b2Rope.h | 115 ++ external/Box2D/proj.linux/.cproject | 267 ++++ external/Box2D/proj.linux/.project | 110 ++ external/Box2D/proj.linux/Makefile | 72 + external/Box2D/proj.linux/box2d.prf | 19 + external/Box2D/proj.win32/Box2D.vcxproj | 194 +++ .../Box2D/proj.win32/Box2D.vcxproj.filters | 301 ++++ external/Box2D/proj.win32/Box2D.vcxproj.user | 3 + 99 files changed, 21549 insertions(+) create mode 100644 external/Box2D/Android.mk create mode 100644 external/Box2D/Box2D.h create mode 100644 external/Box2D/Collision/Shapes/b2ChainShape.cpp create mode 100644 external/Box2D/Collision/Shapes/b2ChainShape.h create mode 100644 external/Box2D/Collision/Shapes/b2CircleShape.cpp create mode 100644 external/Box2D/Collision/Shapes/b2CircleShape.h create mode 100644 external/Box2D/Collision/Shapes/b2EdgeShape.cpp create mode 100644 external/Box2D/Collision/Shapes/b2EdgeShape.h create mode 100644 external/Box2D/Collision/Shapes/b2PolygonShape.cpp create mode 100644 external/Box2D/Collision/Shapes/b2PolygonShape.h create mode 100644 external/Box2D/Collision/Shapes/b2Shape.h create mode 100644 external/Box2D/Collision/b2BroadPhase.cpp create mode 100644 external/Box2D/Collision/b2BroadPhase.h create mode 100644 external/Box2D/Collision/b2CollideCircle.cpp create mode 100644 external/Box2D/Collision/b2CollideEdge.cpp create mode 100644 external/Box2D/Collision/b2CollidePolygon.cpp create mode 100644 external/Box2D/Collision/b2Collision.cpp create mode 100644 external/Box2D/Collision/b2Collision.h create mode 100644 external/Box2D/Collision/b2Distance.cpp create mode 100644 external/Box2D/Collision/b2Distance.h create mode 100644 external/Box2D/Collision/b2DynamicTree.cpp create mode 100644 external/Box2D/Collision/b2DynamicTree.h create mode 100644 external/Box2D/Collision/b2TimeOfImpact.cpp create mode 100644 external/Box2D/Collision/b2TimeOfImpact.h create mode 100644 external/Box2D/Common/b2BlockAllocator.cpp create mode 100644 external/Box2D/Common/b2BlockAllocator.h create mode 100644 external/Box2D/Common/b2Draw.cpp create mode 100644 external/Box2D/Common/b2Draw.h create mode 100644 external/Box2D/Common/b2GrowableStack.h create mode 100644 external/Box2D/Common/b2Math.cpp create mode 100644 external/Box2D/Common/b2Math.h create mode 100644 external/Box2D/Common/b2Settings.cpp create mode 100644 external/Box2D/Common/b2Settings.h create mode 100644 external/Box2D/Common/b2StackAllocator.cpp create mode 100644 external/Box2D/Common/b2StackAllocator.h create mode 100644 external/Box2D/Common/b2Timer.cpp create mode 100644 external/Box2D/Common/b2Timer.h create mode 100644 external/Box2D/Dynamics/Contacts/b2ChainAndCircleContact.cpp create mode 100644 external/Box2D/Dynamics/Contacts/b2ChainAndCircleContact.h create mode 100644 external/Box2D/Dynamics/Contacts/b2ChainAndPolygonContact.cpp create mode 100644 external/Box2D/Dynamics/Contacts/b2ChainAndPolygonContact.h create mode 100644 external/Box2D/Dynamics/Contacts/b2CircleContact.cpp create mode 100644 external/Box2D/Dynamics/Contacts/b2CircleContact.h create mode 100644 external/Box2D/Dynamics/Contacts/b2Contact.cpp create mode 100644 external/Box2D/Dynamics/Contacts/b2Contact.h create mode 100644 external/Box2D/Dynamics/Contacts/b2ContactSolver.cpp create mode 100644 external/Box2D/Dynamics/Contacts/b2ContactSolver.h create mode 100644 external/Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.cpp create mode 100644 external/Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.h create mode 100644 external/Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.cpp create mode 100644 external/Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.h create mode 100644 external/Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.cpp create mode 100644 external/Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.h create mode 100644 external/Box2D/Dynamics/Contacts/b2PolygonContact.cpp create mode 100644 external/Box2D/Dynamics/Contacts/b2PolygonContact.h create mode 100644 external/Box2D/Dynamics/Joints/b2DistanceJoint.cpp create mode 100644 external/Box2D/Dynamics/Joints/b2DistanceJoint.h create mode 100644 external/Box2D/Dynamics/Joints/b2FrictionJoint.cpp create mode 100644 external/Box2D/Dynamics/Joints/b2FrictionJoint.h create mode 100644 external/Box2D/Dynamics/Joints/b2GearJoint.cpp create mode 100644 external/Box2D/Dynamics/Joints/b2GearJoint.h create mode 100644 external/Box2D/Dynamics/Joints/b2Joint.cpp create mode 100644 external/Box2D/Dynamics/Joints/b2Joint.h create mode 100644 external/Box2D/Dynamics/Joints/b2MouseJoint.cpp create mode 100644 external/Box2D/Dynamics/Joints/b2MouseJoint.h create mode 100644 external/Box2D/Dynamics/Joints/b2PrismaticJoint.cpp create mode 100644 external/Box2D/Dynamics/Joints/b2PrismaticJoint.h create mode 100644 external/Box2D/Dynamics/Joints/b2PulleyJoint.cpp create mode 100644 external/Box2D/Dynamics/Joints/b2PulleyJoint.h create mode 100644 external/Box2D/Dynamics/Joints/b2RevoluteJoint.cpp create mode 100644 external/Box2D/Dynamics/Joints/b2RevoluteJoint.h create mode 100644 external/Box2D/Dynamics/Joints/b2RopeJoint.cpp create mode 100644 external/Box2D/Dynamics/Joints/b2RopeJoint.h create mode 100644 external/Box2D/Dynamics/Joints/b2WeldJoint.cpp create mode 100644 external/Box2D/Dynamics/Joints/b2WeldJoint.h create mode 100644 external/Box2D/Dynamics/Joints/b2WheelJoint.cpp create mode 100644 external/Box2D/Dynamics/Joints/b2WheelJoint.h create mode 100644 external/Box2D/Dynamics/b2Body.cpp create mode 100644 external/Box2D/Dynamics/b2Body.h create mode 100644 external/Box2D/Dynamics/b2ContactManager.cpp create mode 100644 external/Box2D/Dynamics/b2ContactManager.h create mode 100644 external/Box2D/Dynamics/b2Fixture.cpp create mode 100644 external/Box2D/Dynamics/b2Fixture.h create mode 100644 external/Box2D/Dynamics/b2Island.cpp create mode 100644 external/Box2D/Dynamics/b2Island.h create mode 100644 external/Box2D/Dynamics/b2TimeStep.h create mode 100644 external/Box2D/Dynamics/b2World.cpp create mode 100644 external/Box2D/Dynamics/b2World.h create mode 100644 external/Box2D/Dynamics/b2WorldCallbacks.cpp create mode 100644 external/Box2D/Dynamics/b2WorldCallbacks.h create mode 100644 external/Box2D/Rope/b2Rope.cpp create mode 100644 external/Box2D/Rope/b2Rope.h create mode 100644 external/Box2D/proj.linux/.cproject create mode 100644 external/Box2D/proj.linux/.project create mode 100644 external/Box2D/proj.linux/Makefile create mode 100644 external/Box2D/proj.linux/box2d.prf create mode 100644 external/Box2D/proj.win32/Box2D.vcxproj create mode 100644 external/Box2D/proj.win32/Box2D.vcxproj.filters create mode 100644 external/Box2D/proj.win32/Box2D.vcxproj.user diff --git a/external/Box2D/Android.mk b/external/Box2D/Android.mk new file mode 100644 index 0000000000..c366750c01 --- /dev/null +++ b/external/Box2D/Android.mk @@ -0,0 +1,60 @@ +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := box2d_static + +LOCAL_MODULE_FILENAME := libbox2d + +LOCAL_SRC_FILES := \ +Collision/b2BroadPhase.cpp \ +Collision/b2CollideCircle.cpp \ +Collision/b2CollideEdge.cpp \ +Collision/b2CollidePolygon.cpp \ +Collision/b2Collision.cpp \ +Collision/b2Distance.cpp \ +Collision/b2DynamicTree.cpp \ +Collision/b2TimeOfImpact.cpp \ +Collision/Shapes/b2ChainShape.cpp \ +Collision/Shapes/b2CircleShape.cpp \ +Collision/Shapes/b2EdgeShape.cpp \ +Collision/Shapes/b2PolygonShape.cpp \ +Common/b2BlockAllocator.cpp \ +Common/b2Draw.cpp \ +Common/b2Math.cpp \ +Common/b2Settings.cpp \ +Common/b2StackAllocator.cpp \ +Common/b2Timer.cpp \ +Dynamics/b2Body.cpp \ +Dynamics/b2ContactManager.cpp \ +Dynamics/b2Fixture.cpp \ +Dynamics/b2Island.cpp \ +Dynamics/b2World.cpp \ +Dynamics/b2WorldCallbacks.cpp \ +Dynamics/Contacts/b2ChainAndCircleContact.cpp \ +Dynamics/Contacts/b2ChainAndPolygonContact.cpp \ +Dynamics/Contacts/b2CircleContact.cpp \ +Dynamics/Contacts/b2Contact.cpp \ +Dynamics/Contacts/b2ContactSolver.cpp \ +Dynamics/Contacts/b2EdgeAndCircleContact.cpp \ +Dynamics/Contacts/b2EdgeAndPolygonContact.cpp \ +Dynamics/Contacts/b2PolygonAndCircleContact.cpp \ +Dynamics/Contacts/b2PolygonContact.cpp \ +Dynamics/Joints/b2DistanceJoint.cpp \ +Dynamics/Joints/b2FrictionJoint.cpp \ +Dynamics/Joints/b2GearJoint.cpp \ +Dynamics/Joints/b2Joint.cpp \ +Dynamics/Joints/b2MouseJoint.cpp \ +Dynamics/Joints/b2PrismaticJoint.cpp \ +Dynamics/Joints/b2PulleyJoint.cpp \ +Dynamics/Joints/b2RevoluteJoint.cpp \ +Dynamics/Joints/b2RopeJoint.cpp \ +Dynamics/Joints/b2WeldJoint.cpp \ +Dynamics/Joints/b2WheelJoint.cpp \ +Rope/b2Rope.cpp + +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/.. + +LOCAL_C_INCLUDES := $(LOCAL_PATH)/.. + +include $(BUILD_STATIC_LIBRARY) diff --git a/external/Box2D/Box2D.h b/external/Box2D/Box2D.h new file mode 100644 index 0000000000..f674d82269 --- /dev/null +++ b/external/Box2D/Box2D.h @@ -0,0 +1,67 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef BOX2D_H +#define BOX2D_H + +/** +\mainpage Box2D API Documentation + +\section intro_sec Getting Started + +For documentation please see http://box2d.org/documentation.html + +For discussion please visit http://box2d.org/forum +*/ + +// These include files constitute the main Box2D API + +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif diff --git a/external/Box2D/Collision/Shapes/b2ChainShape.cpp b/external/Box2D/Collision/Shapes/b2ChainShape.cpp new file mode 100644 index 0000000000..79b4304b5b --- /dev/null +++ b/external/Box2D/Collision/Shapes/b2ChainShape.cpp @@ -0,0 +1,171 @@ +/* +* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include +#include +using namespace std; + +b2ChainShape::~b2ChainShape() +{ + b2Free(m_vertices); + m_vertices = NULL; + m_count = 0; +} + +void b2ChainShape::CreateLoop(const b2Vec2* vertices, int32 count) +{ + b2Assert(m_vertices == NULL && m_count == 0); + b2Assert(count >= 3); + m_count = count + 1; + m_vertices = (b2Vec2*)b2Alloc(m_count * sizeof(b2Vec2)); + memcpy(m_vertices, vertices, count * sizeof(b2Vec2)); + m_vertices[count] = m_vertices[0]; + m_prevVertex = m_vertices[m_count - 2]; + m_nextVertex = m_vertices[1]; + m_hasPrevVertex = true; + m_hasNextVertex = true; +} + +void b2ChainShape::CreateChain(const b2Vec2* vertices, int32 count) +{ + b2Assert(m_vertices == NULL && m_count == 0); + b2Assert(count >= 2); + m_count = count; + m_vertices = (b2Vec2*)b2Alloc(count * sizeof(b2Vec2)); + memcpy(m_vertices, vertices, m_count * sizeof(b2Vec2)); + m_hasPrevVertex = false; + m_hasNextVertex = false; +} + +void b2ChainShape::SetPrevVertex(const b2Vec2& prevVertex) +{ + m_prevVertex = prevVertex; + m_hasPrevVertex = true; +} + +void b2ChainShape::SetNextVertex(const b2Vec2& nextVertex) +{ + m_nextVertex = nextVertex; + m_hasNextVertex = true; +} + +b2Shape* b2ChainShape::Clone(b2BlockAllocator* allocator) const +{ + void* mem = allocator->Allocate(sizeof(b2ChainShape)); + b2ChainShape* clone = new (mem) b2ChainShape; + clone->CreateChain(m_vertices, m_count); + clone->m_prevVertex = m_prevVertex; + clone->m_nextVertex = m_nextVertex; + clone->m_hasPrevVertex = m_hasPrevVertex; + clone->m_hasNextVertex = m_hasNextVertex; + return clone; +} + +int32 b2ChainShape::GetChildCount() const +{ + // edge count = vertex count - 1 + return m_count - 1; +} + +void b2ChainShape::GetChildEdge(b2EdgeShape* edge, int32 index) const +{ + b2Assert(0 <= index && index < m_count - 1); + edge->m_type = b2Shape::e_edge; + edge->m_radius = m_radius; + + edge->m_vertex1 = m_vertices[index + 0]; + edge->m_vertex2 = m_vertices[index + 1]; + + if (index > 0) + { + edge->m_vertex0 = m_vertices[index - 1]; + edge->m_hasVertex0 = true; + } + else + { + edge->m_vertex0 = m_prevVertex; + edge->m_hasVertex0 = m_hasPrevVertex; + } + + if (index < m_count - 2) + { + edge->m_vertex3 = m_vertices[index + 2]; + edge->m_hasVertex3 = true; + } + else + { + edge->m_vertex3 = m_nextVertex; + edge->m_hasVertex3 = m_hasNextVertex; + } +} + +bool b2ChainShape::TestPoint(const b2Transform& xf, const b2Vec2& p) const +{ + B2_NOT_USED(xf); + B2_NOT_USED(p); + return false; +} + +bool b2ChainShape::RayCast(b2RayCastOutput* output, const b2RayCastInput& input, + const b2Transform& xf, int32 childIndex) const +{ + b2Assert(childIndex < m_count); + + b2EdgeShape edgeShape; + + int32 i1 = childIndex; + int32 i2 = childIndex + 1; + if (i2 == m_count) + { + i2 = 0; + } + + edgeShape.m_vertex1 = m_vertices[i1]; + edgeShape.m_vertex2 = m_vertices[i2]; + + return edgeShape.RayCast(output, input, xf, 0); +} + +void b2ChainShape::ComputeAABB(b2AABB* aabb, const b2Transform& xf, int32 childIndex) const +{ + b2Assert(childIndex < m_count); + + int32 i1 = childIndex; + int32 i2 = childIndex + 1; + if (i2 == m_count) + { + i2 = 0; + } + + b2Vec2 v1 = b2Mul(xf, m_vertices[i1]); + b2Vec2 v2 = b2Mul(xf, m_vertices[i2]); + + aabb->lowerBound = b2Min(v1, v2); + aabb->upperBound = b2Max(v1, v2); +} + +void b2ChainShape::ComputeMass(b2MassData* massData, float32 density) const +{ + B2_NOT_USED(density); + + massData->mass = 0.0f; + massData->center.SetZero(); + massData->I = 0.0f; +} diff --git a/external/Box2D/Collision/Shapes/b2ChainShape.h b/external/Box2D/Collision/Shapes/b2ChainShape.h new file mode 100644 index 0000000000..9c9a9eaa7d --- /dev/null +++ b/external/Box2D/Collision/Shapes/b2ChainShape.h @@ -0,0 +1,102 @@ +/* +* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_CHAIN_SHAPE_H +#define B2_CHAIN_SHAPE_H + +#include + +class b2EdgeShape; + +/// A chain shape is a free form sequence of line segments. +/// The chain has two-sided collision, so you can use inside and outside collision. +/// Therefore, you may use any winding order. +/// Since there may be many vertices, they are allocated using b2Alloc. +/// Connectivity information is used to create smooth collisions. +/// WARNING: The chain will not collide properly if there are self-intersections. +class b2ChainShape : public b2Shape +{ +public: + b2ChainShape(); + + /// The destructor frees the vertices using b2Free. + ~b2ChainShape(); + + /// Create a loop. This automatically adjusts connectivity. + /// @param vertices an array of vertices, these are copied + /// @param count the vertex count + void CreateLoop(const b2Vec2* vertices, int32 count); + + /// Create a chain with isolated end vertices. + /// @param vertices an array of vertices, these are copied + /// @param count the vertex count + void CreateChain(const b2Vec2* vertices, int32 count); + + /// Establish connectivity to a vertex that precedes the first vertex. + /// Don't call this for loops. + void SetPrevVertex(const b2Vec2& prevVertex); + + /// Establish connectivity to a vertex that follows the last vertex. + /// Don't call this for loops. + void SetNextVertex(const b2Vec2& nextVertex); + + /// Implement b2Shape. Vertices are cloned using b2Alloc. + b2Shape* Clone(b2BlockAllocator* allocator) const; + + /// @see b2Shape::GetChildCount + int32 GetChildCount() const; + + /// Get a child edge. + void GetChildEdge(b2EdgeShape* edge, int32 index) const; + + /// This always return false. + /// @see b2Shape::TestPoint + bool TestPoint(const b2Transform& transform, const b2Vec2& p) const; + + /// Implement b2Shape. + bool RayCast(b2RayCastOutput* output, const b2RayCastInput& input, + const b2Transform& transform, int32 childIndex) const; + + /// @see b2Shape::ComputeAABB + void ComputeAABB(b2AABB* aabb, const b2Transform& transform, int32 childIndex) const; + + /// Chains have zero mass. + /// @see b2Shape::ComputeMass + void ComputeMass(b2MassData* massData, float32 density) const; + + /// The vertices. Owned by this class. + b2Vec2* m_vertices; + + /// The vertex count. + int32 m_count; + + b2Vec2 m_prevVertex, m_nextVertex; + bool m_hasPrevVertex, m_hasNextVertex; +}; + +inline b2ChainShape::b2ChainShape() +{ + m_type = e_chain; + m_radius = b2_polygonRadius; + m_vertices = NULL; + m_count = 0; + m_hasPrevVertex = false; + m_hasNextVertex = false; +} + +#endif diff --git a/external/Box2D/Collision/Shapes/b2CircleShape.cpp b/external/Box2D/Collision/Shapes/b2CircleShape.cpp new file mode 100644 index 0000000000..587ca960b2 --- /dev/null +++ b/external/Box2D/Collision/Shapes/b2CircleShape.cpp @@ -0,0 +1,100 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +using namespace std; + +b2Shape* b2CircleShape::Clone(b2BlockAllocator* allocator) const +{ + void* mem = allocator->Allocate(sizeof(b2CircleShape)); + b2CircleShape* clone = new (mem) b2CircleShape; + *clone = *this; + return clone; +} + +int32 b2CircleShape::GetChildCount() const +{ + return 1; +} + +bool b2CircleShape::TestPoint(const b2Transform& transform, const b2Vec2& p) const +{ + b2Vec2 center = transform.p + b2Mul(transform.q, m_p); + b2Vec2 d = p - center; + return b2Dot(d, d) <= m_radius * m_radius; +} + +// Collision Detection in Interactive 3D Environments by Gino van den Bergen +// From Section 3.1.2 +// x = s + a * r +// norm(x) = radius +bool b2CircleShape::RayCast(b2RayCastOutput* output, const b2RayCastInput& input, + const b2Transform& transform, int32 childIndex) const +{ + B2_NOT_USED(childIndex); + + b2Vec2 position = transform.p + b2Mul(transform.q, m_p); + b2Vec2 s = input.p1 - position; + float32 b = b2Dot(s, s) - m_radius * m_radius; + + // Solve quadratic equation. + b2Vec2 r = input.p2 - input.p1; + float32 c = b2Dot(s, r); + float32 rr = b2Dot(r, r); + float32 sigma = c * c - rr * b; + + // Check for negative discriminant and short segment. + if (sigma < 0.0f || rr < b2_epsilon) + { + return false; + } + + // Find the point of intersection of the line with the circle. + float32 a = -(c + b2Sqrt(sigma)); + + // Is the intersection point on the segment? + if (0.0f <= a && a <= input.maxFraction * rr) + { + a /= rr; + output->fraction = a; + output->normal = s + a * r; + output->normal.Normalize(); + return true; + } + + return false; +} + +void b2CircleShape::ComputeAABB(b2AABB* aabb, const b2Transform& transform, int32 childIndex) const +{ + B2_NOT_USED(childIndex); + + b2Vec2 p = transform.p + b2Mul(transform.q, m_p); + aabb->lowerBound.Set(p.x - m_radius, p.y - m_radius); + aabb->upperBound.Set(p.x + m_radius, p.y + m_radius); +} + +void b2CircleShape::ComputeMass(b2MassData* massData, float32 density) const +{ + massData->mass = density * b2_pi * m_radius * m_radius; + massData->center = m_p; + + // inertia about the local origin + massData->I = massData->mass * (0.5f * m_radius * m_radius + b2Dot(m_p, m_p)); +} diff --git a/external/Box2D/Collision/Shapes/b2CircleShape.h b/external/Box2D/Collision/Shapes/b2CircleShape.h new file mode 100644 index 0000000000..c4e23a475b --- /dev/null +++ b/external/Box2D/Collision/Shapes/b2CircleShape.h @@ -0,0 +1,91 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_CIRCLE_SHAPE_H +#define B2_CIRCLE_SHAPE_H + +#include + +/// A circle shape. +class b2CircleShape : public b2Shape +{ +public: + b2CircleShape(); + + /// Implement b2Shape. + b2Shape* Clone(b2BlockAllocator* allocator) const; + + /// @see b2Shape::GetChildCount + int32 GetChildCount() const; + + /// Implement b2Shape. + bool TestPoint(const b2Transform& transform, const b2Vec2& p) const; + + /// Implement b2Shape. + bool RayCast(b2RayCastOutput* output, const b2RayCastInput& input, + const b2Transform& transform, int32 childIndex) const; + + /// @see b2Shape::ComputeAABB + void ComputeAABB(b2AABB* aabb, const b2Transform& transform, int32 childIndex) const; + + /// @see b2Shape::ComputeMass + void ComputeMass(b2MassData* massData, float32 density) const; + + /// Get the supporting vertex index in the given direction. + int32 GetSupport(const b2Vec2& d) const; + + /// Get the supporting vertex in the given direction. + const b2Vec2& GetSupportVertex(const b2Vec2& d) const; + + /// Get the vertex count. + int32 GetVertexCount() const { return 1; } + + /// Get a vertex by index. Used by b2Distance. + const b2Vec2& GetVertex(int32 index) const; + + /// Position + b2Vec2 m_p; +}; + +inline b2CircleShape::b2CircleShape() +{ + m_type = e_circle; + m_radius = 0.0f; + m_p.SetZero(); +} + +inline int32 b2CircleShape::GetSupport(const b2Vec2 &d) const +{ + B2_NOT_USED(d); + return 0; +} + +inline const b2Vec2& b2CircleShape::GetSupportVertex(const b2Vec2 &d) const +{ + B2_NOT_USED(d); + return m_p; +} + +inline const b2Vec2& b2CircleShape::GetVertex(int32 index) const +{ + B2_NOT_USED(index); + b2Assert(index == 0); + return m_p; +} + +#endif diff --git a/external/Box2D/Collision/Shapes/b2EdgeShape.cpp b/external/Box2D/Collision/Shapes/b2EdgeShape.cpp new file mode 100644 index 0000000000..7b09e55bf4 --- /dev/null +++ b/external/Box2D/Collision/Shapes/b2EdgeShape.cpp @@ -0,0 +1,139 @@ +/* +* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +using namespace std; + +void b2EdgeShape::Set(const b2Vec2& v1, const b2Vec2& v2) +{ + m_vertex1 = v1; + m_vertex2 = v2; + m_hasVertex0 = false; + m_hasVertex3 = false; +} + +b2Shape* b2EdgeShape::Clone(b2BlockAllocator* allocator) const +{ + void* mem = allocator->Allocate(sizeof(b2EdgeShape)); + b2EdgeShape* clone = new (mem) b2EdgeShape; + *clone = *this; + return clone; +} + +int32 b2EdgeShape::GetChildCount() const +{ + return 1; +} + +bool b2EdgeShape::TestPoint(const b2Transform& xf, const b2Vec2& p) const +{ + B2_NOT_USED(xf); + B2_NOT_USED(p); + return false; +} + +// p = p1 + t * d +// v = v1 + s * e +// p1 + t * d = v1 + s * e +// s * e - t * d = p1 - v1 +bool b2EdgeShape::RayCast(b2RayCastOutput* output, const b2RayCastInput& input, + const b2Transform& xf, int32 childIndex) const +{ + B2_NOT_USED(childIndex); + + // Put the ray into the edge's frame of reference. + b2Vec2 p1 = b2MulT(xf.q, input.p1 - xf.p); + b2Vec2 p2 = b2MulT(xf.q, input.p2 - xf.p); + b2Vec2 d = p2 - p1; + + b2Vec2 v1 = m_vertex1; + b2Vec2 v2 = m_vertex2; + b2Vec2 e = v2 - v1; + b2Vec2 normal(e.y, -e.x); + normal.Normalize(); + + // q = p1 + t * d + // dot(normal, q - v1) = 0 + // dot(normal, p1 - v1) + t * dot(normal, d) = 0 + float32 numerator = b2Dot(normal, v1 - p1); + float32 denominator = b2Dot(normal, d); + + if (denominator == 0.0f) + { + return false; + } + + float32 t = numerator / denominator; + if (t < 0.0f || input.maxFraction < t) + { + return false; + } + + b2Vec2 q = p1 + t * d; + + // q = v1 + s * r + // s = dot(q - v1, r) / dot(r, r) + b2Vec2 r = v2 - v1; + float32 rr = b2Dot(r, r); + if (rr == 0.0f) + { + return false; + } + + float32 s = b2Dot(q - v1, r) / rr; + if (s < 0.0f || 1.0f < s) + { + return false; + } + + output->fraction = t; + if (numerator > 0.0f) + { + output->normal = -normal; + } + else + { + output->normal = normal; + } + return true; +} + +void b2EdgeShape::ComputeAABB(b2AABB* aabb, const b2Transform& xf, int32 childIndex) const +{ + B2_NOT_USED(childIndex); + + b2Vec2 v1 = b2Mul(xf, m_vertex1); + b2Vec2 v2 = b2Mul(xf, m_vertex2); + + b2Vec2 lower = b2Min(v1, v2); + b2Vec2 upper = b2Max(v1, v2); + + b2Vec2 r(m_radius, m_radius); + aabb->lowerBound = lower - r; + aabb->upperBound = upper + r; +} + +void b2EdgeShape::ComputeMass(b2MassData* massData, float32 density) const +{ + B2_NOT_USED(density); + + massData->mass = 0.0f; + massData->center = 0.5f * (m_vertex1 + m_vertex2); + massData->I = 0.0f; +} diff --git a/external/Box2D/Collision/Shapes/b2EdgeShape.h b/external/Box2D/Collision/Shapes/b2EdgeShape.h new file mode 100644 index 0000000000..6163bcbf1c --- /dev/null +++ b/external/Box2D/Collision/Shapes/b2EdgeShape.h @@ -0,0 +1,74 @@ +/* +* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_EDGE_SHAPE_H +#define B2_EDGE_SHAPE_H + +#include + +/// A line segment (edge) shape. These can be connected in chains or loops +/// to other edge shapes. The connectivity information is used to ensure +/// correct contact normals. +class b2EdgeShape : public b2Shape +{ +public: + b2EdgeShape(); + + /// Set this as an isolated edge. + void Set(const b2Vec2& v1, const b2Vec2& v2); + + /// Implement b2Shape. + b2Shape* Clone(b2BlockAllocator* allocator) const; + + /// @see b2Shape::GetChildCount + int32 GetChildCount() const; + + /// @see b2Shape::TestPoint + bool TestPoint(const b2Transform& transform, const b2Vec2& p) const; + + /// Implement b2Shape. + bool RayCast(b2RayCastOutput* output, const b2RayCastInput& input, + const b2Transform& transform, int32 childIndex) const; + + /// @see b2Shape::ComputeAABB + void ComputeAABB(b2AABB* aabb, const b2Transform& transform, int32 childIndex) const; + + /// @see b2Shape::ComputeMass + void ComputeMass(b2MassData* massData, float32 density) const; + + /// These are the edge vertices + b2Vec2 m_vertex1, m_vertex2; + + /// Optional adjacent vertices. These are used for smooth collision. + b2Vec2 m_vertex0, m_vertex3; + bool m_hasVertex0, m_hasVertex3; +}; + +inline b2EdgeShape::b2EdgeShape() +{ + m_type = e_edge; + m_radius = b2_polygonRadius; + m_vertex0.x = 0.0f; + m_vertex0.y = 0.0f; + m_vertex3.x = 0.0f; + m_vertex3.y = 0.0f; + m_hasVertex0 = false; + m_hasVertex3 = false; +} + +#endif diff --git a/external/Box2D/Collision/Shapes/b2PolygonShape.cpp b/external/Box2D/Collision/Shapes/b2PolygonShape.cpp new file mode 100644 index 0000000000..c04c1dc49b --- /dev/null +++ b/external/Box2D/Collision/Shapes/b2PolygonShape.cpp @@ -0,0 +1,361 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include + +b2Shape* b2PolygonShape::Clone(b2BlockAllocator* allocator) const +{ + void* mem = allocator->Allocate(sizeof(b2PolygonShape)); + b2PolygonShape* clone = new (mem) b2PolygonShape; + *clone = *this; + return clone; +} + +void b2PolygonShape::SetAsBox(float32 hx, float32 hy) +{ + m_vertexCount = 4; + m_vertices[0].Set(-hx, -hy); + m_vertices[1].Set( hx, -hy); + m_vertices[2].Set( hx, hy); + m_vertices[3].Set(-hx, hy); + m_normals[0].Set(0.0f, -1.0f); + m_normals[1].Set(1.0f, 0.0f); + m_normals[2].Set(0.0f, 1.0f); + m_normals[3].Set(-1.0f, 0.0f); + m_centroid.SetZero(); +} + +void b2PolygonShape::SetAsBox(float32 hx, float32 hy, const b2Vec2& center, float32 angle) +{ + m_vertexCount = 4; + m_vertices[0].Set(-hx, -hy); + m_vertices[1].Set( hx, -hy); + m_vertices[2].Set( hx, hy); + m_vertices[3].Set(-hx, hy); + m_normals[0].Set(0.0f, -1.0f); + m_normals[1].Set(1.0f, 0.0f); + m_normals[2].Set(0.0f, 1.0f); + m_normals[3].Set(-1.0f, 0.0f); + m_centroid = center; + + b2Transform xf; + xf.p = center; + xf.q.Set(angle); + + // Transform vertices and normals. + for (int32 i = 0; i < m_vertexCount; ++i) + { + m_vertices[i] = b2Mul(xf, m_vertices[i]); + m_normals[i] = b2Mul(xf.q, m_normals[i]); + } +} + +int32 b2PolygonShape::GetChildCount() const +{ + return 1; +} + +static b2Vec2 ComputeCentroid(const b2Vec2* vs, int32 count) +{ + b2Assert(count >= 3); + + b2Vec2 c; c.Set(0.0f, 0.0f); + float32 area = 0.0f; + + // pRef is the reference point for forming triangles. + // It's location doesn't change the result (except for rounding error). + b2Vec2 pRef(0.0f, 0.0f); +#if 0 + // This code would put the reference point inside the polygon. + for (int32 i = 0; i < count; ++i) + { + pRef += vs[i]; + } + pRef *= 1.0f / count; +#endif + + const float32 inv3 = 1.0f / 3.0f; + + for (int32 i = 0; i < count; ++i) + { + // Triangle vertices. + b2Vec2 p1 = pRef; + b2Vec2 p2 = vs[i]; + b2Vec2 p3 = i + 1 < count ? vs[i+1] : vs[0]; + + b2Vec2 e1 = p2 - p1; + b2Vec2 e2 = p3 - p1; + + float32 D = b2Cross(e1, e2); + + float32 triangleArea = 0.5f * D; + area += triangleArea; + + // Area weighted centroid + c += triangleArea * inv3 * (p1 + p2 + p3); + } + + // Centroid + b2Assert(area > b2_epsilon); + c *= 1.0f / area; + return c; +} + +void b2PolygonShape::Set(const b2Vec2* vertices, int32 count) +{ + b2Assert(3 <= count && count <= b2_maxPolygonVertices); + m_vertexCount = count; + + // Copy vertices. + for (int32 i = 0; i < m_vertexCount; ++i) + { + m_vertices[i] = vertices[i]; + } + + // Compute normals. Ensure the edges have non-zero length. + for (int32 i = 0; i < m_vertexCount; ++i) + { + int32 i1 = i; + int32 i2 = i + 1 < m_vertexCount ? i + 1 : 0; + b2Vec2 edge = m_vertices[i2] - m_vertices[i1]; + b2Assert(edge.LengthSquared() > b2_epsilon * b2_epsilon); + m_normals[i] = b2Cross(edge, 1.0f); + m_normals[i].Normalize(); + } + +#ifdef _DEBUG + // Ensure the polygon is convex and the interior + // is to the left of each edge. + for (int32 i = 0; i < m_vertexCount; ++i) + { + int32 i1 = i; + int32 i2 = i + 1 < m_vertexCount ? i + 1 : 0; + b2Vec2 edge = m_vertices[i2] - m_vertices[i1]; + + for (int32 j = 0; j < m_vertexCount; ++j) + { + // Don't check vertices on the current edge. + if (j == i1 || j == i2) + { + continue; + } + + b2Vec2 r = m_vertices[j] - m_vertices[i1]; + + // If this crashes, your polygon is non-convex, has colinear edges, + // or the winding order is wrong. + float32 s = b2Cross(edge, r); + b2Assert(s > 0.0f && "ERROR: Please ensure your polygon is convex and has a CCW winding order"); + } + } +#endif + + // Compute the polygon centroid. + m_centroid = ComputeCentroid(m_vertices, m_vertexCount); +} + +bool b2PolygonShape::TestPoint(const b2Transform& xf, const b2Vec2& p) const +{ + b2Vec2 pLocal = b2MulT(xf.q, p - xf.p); + + for (int32 i = 0; i < m_vertexCount; ++i) + { + float32 dot = b2Dot(m_normals[i], pLocal - m_vertices[i]); + if (dot > 0.0f) + { + return false; + } + } + + return true; +} + +bool b2PolygonShape::RayCast(b2RayCastOutput* output, const b2RayCastInput& input, + const b2Transform& xf, int32 childIndex) const +{ + B2_NOT_USED(childIndex); + + // Put the ray into the polygon's frame of reference. + b2Vec2 p1 = b2MulT(xf.q, input.p1 - xf.p); + b2Vec2 p2 = b2MulT(xf.q, input.p2 - xf.p); + b2Vec2 d = p2 - p1; + + float32 lower = 0.0f, upper = input.maxFraction; + + int32 index = -1; + + for (int32 i = 0; i < m_vertexCount; ++i) + { + // p = p1 + a * d + // dot(normal, p - v) = 0 + // dot(normal, p1 - v) + a * dot(normal, d) = 0 + float32 numerator = b2Dot(m_normals[i], m_vertices[i] - p1); + float32 denominator = b2Dot(m_normals[i], d); + + if (denominator == 0.0f) + { + if (numerator < 0.0f) + { + return false; + } + } + else + { + // Note: we want this predicate without division: + // lower < numerator / denominator, where denominator < 0 + // Since denominator < 0, we have to flip the inequality: + // lower < numerator / denominator <==> denominator * lower > numerator. + if (denominator < 0.0f && numerator < lower * denominator) + { + // Increase lower. + // The segment enters this half-space. + lower = numerator / denominator; + index = i; + } + else if (denominator > 0.0f && numerator < upper * denominator) + { + // Decrease upper. + // The segment exits this half-space. + upper = numerator / denominator; + } + } + + // The use of epsilon here causes the assert on lower to trip + // in some cases. Apparently the use of epsilon was to make edge + // shapes work, but now those are handled separately. + //if (upper < lower - b2_epsilon) + if (upper < lower) + { + return false; + } + } + + b2Assert(0.0f <= lower && lower <= input.maxFraction); + + if (index >= 0) + { + output->fraction = lower; + output->normal = b2Mul(xf.q, m_normals[index]); + return true; + } + + return false; +} + +void b2PolygonShape::ComputeAABB(b2AABB* aabb, const b2Transform& xf, int32 childIndex) const +{ + B2_NOT_USED(childIndex); + + b2Vec2 lower = b2Mul(xf, m_vertices[0]); + b2Vec2 upper = lower; + + for (int32 i = 1; i < m_vertexCount; ++i) + { + b2Vec2 v = b2Mul(xf, m_vertices[i]); + lower = b2Min(lower, v); + upper = b2Max(upper, v); + } + + b2Vec2 r(m_radius, m_radius); + aabb->lowerBound = lower - r; + aabb->upperBound = upper + r; +} + +void b2PolygonShape::ComputeMass(b2MassData* massData, float32 density) const +{ + // Polygon mass, centroid, and inertia. + // Let rho be the polygon density in mass per unit area. + // Then: + // mass = rho * int(dA) + // centroid.x = (1/mass) * rho * int(x * dA) + // centroid.y = (1/mass) * rho * int(y * dA) + // I = rho * int((x*x + y*y) * dA) + // + // We can compute these integrals by summing all the integrals + // for each triangle of the polygon. To evaluate the integral + // for a single triangle, we make a change of variables to + // the (u,v) coordinates of the triangle: + // x = x0 + e1x * u + e2x * v + // y = y0 + e1y * u + e2y * v + // where 0 <= u && 0 <= v && u + v <= 1. + // + // We integrate u from [0,1-v] and then v from [0,1]. + // We also need to use the Jacobian of the transformation: + // D = cross(e1, e2) + // + // Simplification: triangle centroid = (1/3) * (p1 + p2 + p3) + // + // The rest of the derivation is handled by computer algebra. + + b2Assert(m_vertexCount >= 3); + + b2Vec2 center; center.Set(0.0f, 0.0f); + float32 area = 0.0f; + float32 I = 0.0f; + + // s is the reference point for forming triangles. + // It's location doesn't change the result (except for rounding error). + b2Vec2 s(0.0f, 0.0f); + + // This code would put the reference point inside the polygon. + for (int32 i = 0; i < m_vertexCount; ++i) + { + s += m_vertices[i]; + } + s *= 1.0f / m_vertexCount; + + const float32 k_inv3 = 1.0f / 3.0f; + + for (int32 i = 0; i < m_vertexCount; ++i) + { + // Triangle vertices. + b2Vec2 e1 = m_vertices[i] - s; + b2Vec2 e2 = i + 1 < m_vertexCount ? m_vertices[i+1] - s : m_vertices[0] - s; + + float32 D = b2Cross(e1, e2); + + float32 triangleArea = 0.5f * D; + area += triangleArea; + + // Area weighted centroid + center += triangleArea * k_inv3 * (e1 + e2); + + float32 ex1 = e1.x, ey1 = e1.y; + float32 ex2 = e2.x, ey2 = e2.y; + + float32 intx2 = ex1*ex1 + ex2*ex1 + ex2*ex2; + float32 inty2 = ey1*ey1 + ey2*ey1 + ey2*ey2; + + I += (0.25f * k_inv3 * D) * (intx2 + inty2); + } + + // Total mass + massData->mass = density * area; + + // Center of mass + b2Assert(area > b2_epsilon); + center *= 1.0f / area; + massData->center = center + s; + + // Inertia tensor relative to the local origin (point s). + massData->I = density * I; + + // Shift to center of mass then to original body origin. + massData->I += massData->mass * (b2Dot(massData->center, massData->center) - b2Dot(center, center)); +} diff --git a/external/Box2D/Collision/Shapes/b2PolygonShape.h b/external/Box2D/Collision/Shapes/b2PolygonShape.h new file mode 100644 index 0000000000..70daccb2ff --- /dev/null +++ b/external/Box2D/Collision/Shapes/b2PolygonShape.h @@ -0,0 +1,95 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_POLYGON_SHAPE_H +#define B2_POLYGON_SHAPE_H + +#include + +/// A convex polygon. It is assumed that the interior of the polygon is to +/// the left of each edge. +/// Polygons have a maximum number of vertices equal to b2_maxPolygonVertices. +/// In most cases you should not need many vertices for a convex polygon. +class b2PolygonShape : public b2Shape +{ +public: + b2PolygonShape(); + + /// Implement b2Shape. + b2Shape* Clone(b2BlockAllocator* allocator) const; + + /// @see b2Shape::GetChildCount + int32 GetChildCount() const; + + /// Copy vertices. This assumes the vertices define a convex polygon. + /// It is assumed that the exterior is the the right of each edge. + /// The count must be in the range [3, b2_maxPolygonVertices]. + void Set(const b2Vec2* vertices, int32 vertexCount); + + /// Build vertices to represent an axis-aligned box. + /// @param hx the half-width. + /// @param hy the half-height. + void SetAsBox(float32 hx, float32 hy); + + /// Build vertices to represent an oriented box. + /// @param hx the half-width. + /// @param hy the half-height. + /// @param center the center of the box in local coordinates. + /// @param angle the rotation of the box in local coordinates. + void SetAsBox(float32 hx, float32 hy, const b2Vec2& center, float32 angle); + + /// @see b2Shape::TestPoint + bool TestPoint(const b2Transform& transform, const b2Vec2& p) const; + + /// Implement b2Shape. + bool RayCast(b2RayCastOutput* output, const b2RayCastInput& input, + const b2Transform& transform, int32 childIndex) const; + + /// @see b2Shape::ComputeAABB + void ComputeAABB(b2AABB* aabb, const b2Transform& transform, int32 childIndex) const; + + /// @see b2Shape::ComputeMass + void ComputeMass(b2MassData* massData, float32 density) const; + + /// Get the vertex count. + int32 GetVertexCount() const { return m_vertexCount; } + + /// Get a vertex by index. + const b2Vec2& GetVertex(int32 index) const; + + b2Vec2 m_centroid; + b2Vec2 m_vertices[b2_maxPolygonVertices]; + b2Vec2 m_normals[b2_maxPolygonVertices]; + int32 m_vertexCount; +}; + +inline b2PolygonShape::b2PolygonShape() +{ + m_type = e_polygon; + m_radius = b2_polygonRadius; + m_vertexCount = 0; + m_centroid.SetZero(); +} + +inline const b2Vec2& b2PolygonShape::GetVertex(int32 index) const +{ + b2Assert(0 <= index && index < m_vertexCount); + return m_vertices[index]; +} + +#endif diff --git a/external/Box2D/Collision/Shapes/b2Shape.h b/external/Box2D/Collision/Shapes/b2Shape.h new file mode 100644 index 0000000000..2e2aedd14a --- /dev/null +++ b/external/Box2D/Collision/Shapes/b2Shape.h @@ -0,0 +1,101 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_SHAPE_H +#define B2_SHAPE_H + +#include +#include +#include + +/// This holds the mass data computed for a shape. +struct b2MassData +{ + /// The mass of the shape, usually in kilograms. + float32 mass; + + /// The position of the shape's centroid relative to the shape's origin. + b2Vec2 center; + + /// The rotational inertia of the shape about the local origin. + float32 I; +}; + +/// A shape is used for collision detection. You can create a shape however you like. +/// Shapes used for simulation in b2World are created automatically when a b2Fixture +/// is created. Shapes may encapsulate a one or more child shapes. +class b2Shape +{ +public: + + enum Type + { + e_circle = 0, + e_edge = 1, + e_polygon = 2, + e_chain = 3, + e_typeCount = 4 + }; + + virtual ~b2Shape() {} + + /// Clone the concrete shape using the provided allocator. + virtual b2Shape* Clone(b2BlockAllocator* allocator) const = 0; + + /// Get the type of this shape. You can use this to down cast to the concrete shape. + /// @return the shape type. + Type GetType() const; + + /// Get the number of child primitives. + virtual int32 GetChildCount() const = 0; + + /// Test a point for containment in this shape. This only works for convex shapes. + /// @param xf the shape world transform. + /// @param p a point in world coordinates. + virtual bool TestPoint(const b2Transform& xf, const b2Vec2& p) const = 0; + + /// Cast a ray against a child shape. + /// @param output the ray-cast results. + /// @param input the ray-cast input parameters. + /// @param transform the transform to be applied to the shape. + /// @param childIndex the child shape index + virtual bool RayCast(b2RayCastOutput* output, const b2RayCastInput& input, + const b2Transform& transform, int32 childIndex) const = 0; + + /// Given a transform, compute the associated axis aligned bounding box for a child shape. + /// @param aabb returns the axis aligned box. + /// @param xf the world transform of the shape. + /// @param childIndex the child shape + virtual void ComputeAABB(b2AABB* aabb, const b2Transform& xf, int32 childIndex) const = 0; + + /// Compute the mass properties of this shape using its dimensions and density. + /// The inertia tensor is computed about the local origin. + /// @param massData returns the mass data for this shape. + /// @param density the density in kilograms per meter squared. + virtual void ComputeMass(b2MassData* massData, float32 density) const = 0; + + Type m_type; + float32 m_radius; +}; + +inline b2Shape::Type b2Shape::GetType() const +{ + return m_type; +} + +#endif diff --git a/external/Box2D/Collision/b2BroadPhase.cpp b/external/Box2D/Collision/b2BroadPhase.cpp new file mode 100644 index 0000000000..431f6de1ee --- /dev/null +++ b/external/Box2D/Collision/b2BroadPhase.cpp @@ -0,0 +1,122 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +using namespace std; + +b2BroadPhase::b2BroadPhase() +{ + m_proxyCount = 0; + + m_pairCapacity = 16; + m_pairCount = 0; + m_pairBuffer = (b2Pair*)b2Alloc(m_pairCapacity * sizeof(b2Pair)); + + m_moveCapacity = 16; + m_moveCount = 0; + m_moveBuffer = (int32*)b2Alloc(m_moveCapacity * sizeof(int32)); +} + +b2BroadPhase::~b2BroadPhase() +{ + b2Free(m_moveBuffer); + b2Free(m_pairBuffer); +} + +int32 b2BroadPhase::CreateProxy(const b2AABB& aabb, void* userData) +{ + int32 proxyId = m_tree.CreateProxy(aabb, userData); + ++m_proxyCount; + BufferMove(proxyId); + return proxyId; +} + +void b2BroadPhase::DestroyProxy(int32 proxyId) +{ + UnBufferMove(proxyId); + --m_proxyCount; + m_tree.DestroyProxy(proxyId); +} + +void b2BroadPhase::MoveProxy(int32 proxyId, const b2AABB& aabb, const b2Vec2& displacement) +{ + bool buffer = m_tree.MoveProxy(proxyId, aabb, displacement); + if (buffer) + { + BufferMove(proxyId); + } +} + +void b2BroadPhase::TouchProxy(int32 proxyId) +{ + BufferMove(proxyId); +} + +void b2BroadPhase::BufferMove(int32 proxyId) +{ + if (m_moveCount == m_moveCapacity) + { + int32* oldBuffer = m_moveBuffer; + m_moveCapacity *= 2; + m_moveBuffer = (int32*)b2Alloc(m_moveCapacity * sizeof(int32)); + memcpy(m_moveBuffer, oldBuffer, m_moveCount * sizeof(int32)); + b2Free(oldBuffer); + } + + m_moveBuffer[m_moveCount] = proxyId; + ++m_moveCount; +} + +void b2BroadPhase::UnBufferMove(int32 proxyId) +{ + for (int32 i = 0; i < m_moveCount; ++i) + { + if (m_moveBuffer[i] == proxyId) + { + m_moveBuffer[i] = e_nullProxy; + return; + } + } +} + +// This is called from b2DynamicTree::Query when we are gathering pairs. +bool b2BroadPhase::QueryCallback(int32 proxyId) +{ + // A proxy cannot form a pair with itself. + if (proxyId == m_queryProxyId) + { + return true; + } + + // Grow the pair buffer as needed. + if (m_pairCount == m_pairCapacity) + { + b2Pair* oldBuffer = m_pairBuffer; + m_pairCapacity *= 2; + m_pairBuffer = (b2Pair*)b2Alloc(m_pairCapacity * sizeof(b2Pair)); + memcpy(m_pairBuffer, oldBuffer, m_pairCount * sizeof(b2Pair)); + b2Free(oldBuffer); + } + + m_pairBuffer[m_pairCount].proxyIdA = b2Min(proxyId, m_queryProxyId); + m_pairBuffer[m_pairCount].proxyIdB = b2Max(proxyId, m_queryProxyId); + ++m_pairCount; + + return true; +} diff --git a/external/Box2D/Collision/b2BroadPhase.h b/external/Box2D/Collision/b2BroadPhase.h new file mode 100644 index 0000000000..cf2414730a --- /dev/null +++ b/external/Box2D/Collision/b2BroadPhase.h @@ -0,0 +1,248 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_BROAD_PHASE_H +#define B2_BROAD_PHASE_H + +#include +#include +#include +#include + +struct b2Pair +{ + int32 proxyIdA; + int32 proxyIdB; + int32 next; +}; + +/// The broad-phase is used for computing pairs and performing volume queries and ray casts. +/// This broad-phase does not persist pairs. Instead, this reports potentially new pairs. +/// It is up to the client to consume the new pairs and to track subsequent overlap. +class b2BroadPhase +{ +public: + + enum + { + e_nullProxy = -1 + }; + + b2BroadPhase(); + ~b2BroadPhase(); + + /// Create a proxy with an initial AABB. Pairs are not reported until + /// UpdatePairs is called. + int32 CreateProxy(const b2AABB& aabb, void* userData); + + /// Destroy a proxy. It is up to the client to remove any pairs. + void DestroyProxy(int32 proxyId); + + /// Call MoveProxy as many times as you like, then when you are done + /// call UpdatePairs to finalized the proxy pairs (for your time step). + void MoveProxy(int32 proxyId, const b2AABB& aabb, const b2Vec2& displacement); + + /// Call to trigger a re-processing of it's pairs on the next call to UpdatePairs. + void TouchProxy(int32 proxyId); + + /// Get the fat AABB for a proxy. + const b2AABB& GetFatAABB(int32 proxyId) const; + + /// Get user data from a proxy. Returns NULL if the id is invalid. + void* GetUserData(int32 proxyId) const; + + /// Test overlap of fat AABBs. + bool TestOverlap(int32 proxyIdA, int32 proxyIdB) const; + + /// Get the number of proxies. + int32 GetProxyCount() const; + + /// Update the pairs. This results in pair callbacks. This can only add pairs. + template + void UpdatePairs(T* callback); + + /// Query an AABB for overlapping proxies. The callback class + /// is called for each proxy that overlaps the supplied AABB. + template + void Query(T* callback, const b2AABB& aabb) const; + + /// Ray-cast against the proxies in the tree. This relies on the callback + /// to perform a exact ray-cast in the case were the proxy contains a shape. + /// The callback also performs the any collision filtering. This has performance + /// roughly equal to k * log(n), where k is the number of collisions and n is the + /// number of proxies in the tree. + /// @param input the ray-cast input data. The ray extends from p1 to p1 + maxFraction * (p2 - p1). + /// @param callback a callback class that is called for each proxy that is hit by the ray. + template + void RayCast(T* callback, const b2RayCastInput& input) const; + + /// Get the height of the embedded tree. + int32 GetTreeHeight() const; + + /// Get the balance of the embedded tree. + int32 GetTreeBalance() const; + + /// Get the quality metric of the embedded tree. + float32 GetTreeQuality() const; + +private: + + friend class b2DynamicTree; + + void BufferMove(int32 proxyId); + void UnBufferMove(int32 proxyId); + + bool QueryCallback(int32 proxyId); + + b2DynamicTree m_tree; + + int32 m_proxyCount; + + int32* m_moveBuffer; + int32 m_moveCapacity; + int32 m_moveCount; + + b2Pair* m_pairBuffer; + int32 m_pairCapacity; + int32 m_pairCount; + + int32 m_queryProxyId; +}; + +/// This is used to sort pairs. +inline bool b2PairLessThan(const b2Pair& pair1, const b2Pair& pair2) +{ + if (pair1.proxyIdA < pair2.proxyIdA) + { + return true; + } + + if (pair1.proxyIdA == pair2.proxyIdA) + { + return pair1.proxyIdB < pair2.proxyIdB; + } + + return false; +} + +inline void* b2BroadPhase::GetUserData(int32 proxyId) const +{ + return m_tree.GetUserData(proxyId); +} + +inline bool b2BroadPhase::TestOverlap(int32 proxyIdA, int32 proxyIdB) const +{ + const b2AABB& aabbA = m_tree.GetFatAABB(proxyIdA); + const b2AABB& aabbB = m_tree.GetFatAABB(proxyIdB); + return b2TestOverlap(aabbA, aabbB); +} + +inline const b2AABB& b2BroadPhase::GetFatAABB(int32 proxyId) const +{ + return m_tree.GetFatAABB(proxyId); +} + +inline int32 b2BroadPhase::GetProxyCount() const +{ + return m_proxyCount; +} + +inline int32 b2BroadPhase::GetTreeHeight() const +{ + return m_tree.GetHeight(); +} + +inline int32 b2BroadPhase::GetTreeBalance() const +{ + return m_tree.GetMaxBalance(); +} + +inline float32 b2BroadPhase::GetTreeQuality() const +{ + return m_tree.GetAreaRatio(); +} + +template +void b2BroadPhase::UpdatePairs(T* callback) +{ + // Reset pair buffer + m_pairCount = 0; + + // Perform tree queries for all moving proxies. + for (int32 i = 0; i < m_moveCount; ++i) + { + m_queryProxyId = m_moveBuffer[i]; + if (m_queryProxyId == e_nullProxy) + { + continue; + } + + // We have to query the tree with the fat AABB so that + // we don't fail to create a pair that may touch later. + const b2AABB& fatAABB = m_tree.GetFatAABB(m_queryProxyId); + + // Query tree, create pairs and add them pair buffer. + m_tree.Query(this, fatAABB); + } + + // Reset move buffer + m_moveCount = 0; + + // Sort the pair buffer to expose duplicates. + std::sort(m_pairBuffer, m_pairBuffer + m_pairCount, b2PairLessThan); + + // Send the pairs back to the client. + int32 i = 0; + while (i < m_pairCount) + { + b2Pair* primaryPair = m_pairBuffer + i; + void* userDataA = m_tree.GetUserData(primaryPair->proxyIdA); + void* userDataB = m_tree.GetUserData(primaryPair->proxyIdB); + + callback->AddPair(userDataA, userDataB); + ++i; + + // Skip any duplicate pairs. + while (i < m_pairCount) + { + b2Pair* pair = m_pairBuffer + i; + if (pair->proxyIdA != primaryPair->proxyIdA || pair->proxyIdB != primaryPair->proxyIdB) + { + break; + } + ++i; + } + } + + // Try to keep the tree balanced. + //m_tree.Rebalance(4); +} + +template +inline void b2BroadPhase::Query(T* callback, const b2AABB& aabb) const +{ + m_tree.Query(callback, aabb); +} + +template +inline void b2BroadPhase::RayCast(T* callback, const b2RayCastInput& input) const +{ + m_tree.RayCast(callback, input); +} + +#endif diff --git a/external/Box2D/Collision/b2CollideCircle.cpp b/external/Box2D/Collision/b2CollideCircle.cpp new file mode 100644 index 0000000000..ed561eb04b --- /dev/null +++ b/external/Box2D/Collision/b2CollideCircle.cpp @@ -0,0 +1,154 @@ +/* +* Copyright (c) 2007-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include + +void b2CollideCircles( + b2Manifold* manifold, + const b2CircleShape* circleA, const b2Transform& xfA, + const b2CircleShape* circleB, const b2Transform& xfB) +{ + manifold->pointCount = 0; + + b2Vec2 pA = b2Mul(xfA, circleA->m_p); + b2Vec2 pB = b2Mul(xfB, circleB->m_p); + + b2Vec2 d = pB - pA; + float32 distSqr = b2Dot(d, d); + float32 rA = circleA->m_radius, rB = circleB->m_radius; + float32 radius = rA + rB; + if (distSqr > radius * radius) + { + return; + } + + manifold->type = b2Manifold::e_circles; + manifold->localPoint = circleA->m_p; + manifold->localNormal.SetZero(); + manifold->pointCount = 1; + + manifold->points[0].localPoint = circleB->m_p; + manifold->points[0].id.key = 0; +} + +void b2CollidePolygonAndCircle( + b2Manifold* manifold, + const b2PolygonShape* polygonA, const b2Transform& xfA, + const b2CircleShape* circleB, const b2Transform& xfB) +{ + manifold->pointCount = 0; + + // Compute circle position in the frame of the polygon. + b2Vec2 c = b2Mul(xfB, circleB->m_p); + b2Vec2 cLocal = b2MulT(xfA, c); + + // Find the min separating edge. + int32 normalIndex = 0; + float32 separation = -b2_maxFloat; + float32 radius = polygonA->m_radius + circleB->m_radius; + int32 vertexCount = polygonA->m_vertexCount; + const b2Vec2* vertices = polygonA->m_vertices; + const b2Vec2* normals = polygonA->m_normals; + + for (int32 i = 0; i < vertexCount; ++i) + { + float32 s = b2Dot(normals[i], cLocal - vertices[i]); + + if (s > radius) + { + // Early out. + return; + } + + if (s > separation) + { + separation = s; + normalIndex = i; + } + } + + // Vertices that subtend the incident face. + int32 vertIndex1 = normalIndex; + int32 vertIndex2 = vertIndex1 + 1 < vertexCount ? vertIndex1 + 1 : 0; + b2Vec2 v1 = vertices[vertIndex1]; + b2Vec2 v2 = vertices[vertIndex2]; + + // If the center is inside the polygon ... + if (separation < b2_epsilon) + { + manifold->pointCount = 1; + manifold->type = b2Manifold::e_faceA; + manifold->localNormal = normals[normalIndex]; + manifold->localPoint = 0.5f * (v1 + v2); + manifold->points[0].localPoint = circleB->m_p; + manifold->points[0].id.key = 0; + return; + } + + // Compute barycentric coordinates + float32 u1 = b2Dot(cLocal - v1, v2 - v1); + float32 u2 = b2Dot(cLocal - v2, v1 - v2); + if (u1 <= 0.0f) + { + if (b2DistanceSquared(cLocal, v1) > radius * radius) + { + return; + } + + manifold->pointCount = 1; + manifold->type = b2Manifold::e_faceA; + manifold->localNormal = cLocal - v1; + manifold->localNormal.Normalize(); + manifold->localPoint = v1; + manifold->points[0].localPoint = circleB->m_p; + manifold->points[0].id.key = 0; + } + else if (u2 <= 0.0f) + { + if (b2DistanceSquared(cLocal, v2) > radius * radius) + { + return; + } + + manifold->pointCount = 1; + manifold->type = b2Manifold::e_faceA; + manifold->localNormal = cLocal - v2; + manifold->localNormal.Normalize(); + manifold->localPoint = v2; + manifold->points[0].localPoint = circleB->m_p; + manifold->points[0].id.key = 0; + } + else + { + b2Vec2 faceCenter = 0.5f * (v1 + v2); + float32 separation = b2Dot(cLocal - faceCenter, normals[vertIndex1]); + if (separation > radius) + { + return; + } + + manifold->pointCount = 1; + manifold->type = b2Manifold::e_faceA; + manifold->localNormal = normals[vertIndex1]; + manifold->localPoint = faceCenter; + manifold->points[0].localPoint = circleB->m_p; + manifold->points[0].id.key = 0; + } +} diff --git a/external/Box2D/Collision/b2CollideEdge.cpp b/external/Box2D/Collision/b2CollideEdge.cpp new file mode 100644 index 0000000000..96ca71dccc --- /dev/null +++ b/external/Box2D/Collision/b2CollideEdge.cpp @@ -0,0 +1,698 @@ +/* + * Copyright (c) 2007-2009 Erin Catto http://www.box2d.org + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + */ + +#include +#include +#include +#include + + +// Compute contact points for edge versus circle. +// This accounts for edge connectivity. +void b2CollideEdgeAndCircle(b2Manifold* manifold, + const b2EdgeShape* edgeA, const b2Transform& xfA, + const b2CircleShape* circleB, const b2Transform& xfB) +{ + manifold->pointCount = 0; + + // Compute circle in frame of edge + b2Vec2 Q = b2MulT(xfA, b2Mul(xfB, circleB->m_p)); + + b2Vec2 A = edgeA->m_vertex1, B = edgeA->m_vertex2; + b2Vec2 e = B - A; + + // Barycentric coordinates + float32 u = b2Dot(e, B - Q); + float32 v = b2Dot(e, Q - A); + + float32 radius = edgeA->m_radius + circleB->m_radius; + + b2ContactFeature cf; + cf.indexB = 0; + cf.typeB = b2ContactFeature::e_vertex; + + // Region A + if (v <= 0.0f) + { + b2Vec2 P = A; + b2Vec2 d = Q - P; + float32 dd = b2Dot(d, d); + if (dd > radius * radius) + { + return; + } + + // Is there an edge connected to A? + if (edgeA->m_hasVertex0) + { + b2Vec2 A1 = edgeA->m_vertex0; + b2Vec2 B1 = A; + b2Vec2 e1 = B1 - A1; + float32 u1 = b2Dot(e1, B1 - Q); + + // Is the circle in Region AB of the previous edge? + if (u1 > 0.0f) + { + return; + } + } + + cf.indexA = 0; + cf.typeA = b2ContactFeature::e_vertex; + manifold->pointCount = 1; + manifold->type = b2Manifold::e_circles; + manifold->localNormal.SetZero(); + manifold->localPoint = P; + manifold->points[0].id.key = 0; + manifold->points[0].id.cf = cf; + manifold->points[0].localPoint = circleB->m_p; + return; + } + + // Region B + if (u <= 0.0f) + { + b2Vec2 P = B; + b2Vec2 d = Q - P; + float32 dd = b2Dot(d, d); + if (dd > radius * radius) + { + return; + } + + // Is there an edge connected to B? + if (edgeA->m_hasVertex3) + { + b2Vec2 B2 = edgeA->m_vertex3; + b2Vec2 A2 = B; + b2Vec2 e2 = B2 - A2; + float32 v2 = b2Dot(e2, Q - A2); + + // Is the circle in Region AB of the next edge? + if (v2 > 0.0f) + { + return; + } + } + + cf.indexA = 1; + cf.typeA = b2ContactFeature::e_vertex; + manifold->pointCount = 1; + manifold->type = b2Manifold::e_circles; + manifold->localNormal.SetZero(); + manifold->localPoint = P; + manifold->points[0].id.key = 0; + manifold->points[0].id.cf = cf; + manifold->points[0].localPoint = circleB->m_p; + return; + } + + // Region AB + float32 den = b2Dot(e, e); + b2Assert(den > 0.0f); + b2Vec2 P = (1.0f / den) * (u * A + v * B); + b2Vec2 d = Q - P; + float32 dd = b2Dot(d, d); + if (dd > radius * radius) + { + return; + } + + b2Vec2 n(-e.y, e.x); + if (b2Dot(n, Q - A) < 0.0f) + { + n.Set(-n.x, -n.y); + } + n.Normalize(); + + cf.indexA = 0; + cf.typeA = b2ContactFeature::e_face; + manifold->pointCount = 1; + manifold->type = b2Manifold::e_faceA; + manifold->localNormal = n; + manifold->localPoint = A; + manifold->points[0].id.key = 0; + manifold->points[0].id.cf = cf; + manifold->points[0].localPoint = circleB->m_p; +} + +// This structure is used to keep track of the best separating axis. +struct b2EPAxis +{ + enum Type + { + e_unknown, + e_edgeA, + e_edgeB + }; + + Type type; + int32 index; + float32 separation; +}; + +// This holds polygon B expressed in frame A. +struct b2TempPolygon +{ + b2Vec2 vertices[b2_maxPolygonVertices]; + b2Vec2 normals[b2_maxPolygonVertices]; + int32 count; +}; + +// Reference face used for clipping +struct b2ReferenceFace +{ + int32 i1, i2; + + b2Vec2 v1, v2; + + b2Vec2 normal; + + b2Vec2 sideNormal1; + float32 sideOffset1; + + b2Vec2 sideNormal2; + float32 sideOffset2; +}; + +// This class collides and edge and a polygon, taking into account edge adjacency. +struct b2EPCollider +{ + void Collide(b2Manifold* manifold, const b2EdgeShape* edgeA, const b2Transform& xfA, + const b2PolygonShape* polygonB, const b2Transform& xfB); + b2EPAxis ComputeEdgeSeparation(); + b2EPAxis ComputePolygonSeparation(); + + enum VertexType + { + e_isolated, + e_concave, + e_convex + }; + + b2TempPolygon m_polygonB; + + b2Transform m_xf; + b2Vec2 m_centroidB; + b2Vec2 m_v0, m_v1, m_v2, m_v3; + b2Vec2 m_normal0, m_normal1, m_normal2; + b2Vec2 m_normal; + VertexType m_type1, m_type2; + b2Vec2 m_lowerLimit, m_upperLimit; + float32 m_radius; + bool m_front; +}; + +// Algorithm: +// 1. Classify v1 and v2 +// 2. Classify polygon centroid as front or back +// 3. Flip normal if necessary +// 4. Initialize normal range to [-pi, pi] about face normal +// 5. Adjust normal range according to adjacent edges +// 6. Visit each separating axes, only accept axes within the range +// 7. Return if _any_ axis indicates separation +// 8. Clip +void b2EPCollider::Collide(b2Manifold* manifold, const b2EdgeShape* edgeA, const b2Transform& xfA, + const b2PolygonShape* polygonB, const b2Transform& xfB) +{ + m_xf = b2MulT(xfA, xfB); + + m_centroidB = b2Mul(m_xf, polygonB->m_centroid); + + m_v0 = edgeA->m_vertex0; + m_v1 = edgeA->m_vertex1; + m_v2 = edgeA->m_vertex2; + m_v3 = edgeA->m_vertex3; + + bool hasVertex0 = edgeA->m_hasVertex0; + bool hasVertex3F = edgeA->m_hasVertex3; + + b2Vec2 edge1 = m_v2 - m_v1; + edge1.Normalize(); + m_normal1.Set(edge1.y, -edge1.x); + float32 offset1 = b2Dot(m_normal1, m_centroidB - m_v1); + float32 offset0 = 0.0f, offset2 = 0.0f; + bool convex1 = false, convex2 = false; + + // Is there a preceding edge? + if (hasVertex0) + { + b2Vec2 edge0 = m_v1 - m_v0; + edge0.Normalize(); + m_normal0.Set(edge0.y, -edge0.x); + convex1 = b2Cross(edge0, edge1) >= 0.0f; + offset0 = b2Dot(m_normal0, m_centroidB - m_v0); + } + + // Is there a following edge? + if (hasVertex3F) + { + b2Vec2 edge2 = m_v3 - m_v2; + edge2.Normalize(); + m_normal2.Set(edge2.y, -edge2.x); + convex2 = b2Cross(edge1, edge2) > 0.0f; + offset2 = b2Dot(m_normal2, m_centroidB - m_v2); + } + + // Determine front or back collision. Determine collision normal limits. + if (hasVertex0 && hasVertex3F) + { + if (convex1 && convex2) + { + m_front = offset0 >= 0.0f || offset1 >= 0.0f || offset2 >= 0.0f; + if (m_front) + { + m_normal = m_normal1; + m_lowerLimit = m_normal0; + m_upperLimit = m_normal2; + } + else + { + m_normal = -m_normal1; + m_lowerLimit = -m_normal1; + m_upperLimit = -m_normal1; + } + } + else if (convex1) + { + m_front = offset0 >= 0.0f || (offset1 >= 0.0f && offset2 >= 0.0f); + if (m_front) + { + m_normal = m_normal1; + m_lowerLimit = m_normal0; + m_upperLimit = m_normal1; + } + else + { + m_normal = -m_normal1; + m_lowerLimit = -m_normal2; + m_upperLimit = -m_normal1; + } + } + else if (convex2) + { + m_front = offset2 >= 0.0f || (offset0 >= 0.0f && offset1 >= 0.0f); + if (m_front) + { + m_normal = m_normal1; + m_lowerLimit = m_normal1; + m_upperLimit = m_normal2; + } + else + { + m_normal = -m_normal1; + m_lowerLimit = -m_normal1; + m_upperLimit = -m_normal0; + } + } + else + { + m_front = offset0 >= 0.0f && offset1 >= 0.0f && offset2 >= 0.0f; + if (m_front) + { + m_normal = m_normal1; + m_lowerLimit = m_normal1; + m_upperLimit = m_normal1; + } + else + { + m_normal = -m_normal1; + m_lowerLimit = -m_normal2; + m_upperLimit = -m_normal0; + } + } + } + else if (hasVertex0) + { + if (convex1) + { + m_front = offset0 >= 0.0f || offset1 >= 0.0f; + if (m_front) + { + m_normal = m_normal1; + m_lowerLimit = m_normal0; + m_upperLimit = -m_normal1; + } + else + { + m_normal = -m_normal1; + m_lowerLimit = m_normal1; + m_upperLimit = -m_normal1; + } + } + else + { + m_front = offset0 >= 0.0f && offset1 >= 0.0f; + if (m_front) + { + m_normal = m_normal1; + m_lowerLimit = m_normal1; + m_upperLimit = -m_normal1; + } + else + { + m_normal = -m_normal1; + m_lowerLimit = m_normal1; + m_upperLimit = -m_normal0; + } + } + } + else if (hasVertex3F) + { + if (convex2) + { + m_front = offset1 >= 0.0f || offset2 >= 0.0f; + if (m_front) + { + m_normal = m_normal1; + m_lowerLimit = -m_normal1; + m_upperLimit = m_normal2; + } + else + { + m_normal = -m_normal1; + m_lowerLimit = -m_normal1; + m_upperLimit = m_normal1; + } + } + else + { + m_front = offset1 >= 0.0f && offset2 >= 0.0f; + if (m_front) + { + m_normal = m_normal1; + m_lowerLimit = -m_normal1; + m_upperLimit = m_normal1; + } + else + { + m_normal = -m_normal1; + m_lowerLimit = -m_normal2; + m_upperLimit = m_normal1; + } + } + } + else + { + m_front = offset1 >= 0.0f; + if (m_front) + { + m_normal = m_normal1; + m_lowerLimit = -m_normal1; + m_upperLimit = -m_normal1; + } + else + { + m_normal = -m_normal1; + m_lowerLimit = m_normal1; + m_upperLimit = m_normal1; + } + } + + // Get polygonB in frameA + m_polygonB.count = polygonB->m_vertexCount; + for (int32 i = 0; i < polygonB->m_vertexCount; ++i) + { + m_polygonB.vertices[i] = b2Mul(m_xf, polygonB->m_vertices[i]); + m_polygonB.normals[i] = b2Mul(m_xf.q, polygonB->m_normals[i]); + } + + m_radius = 2.0f * b2_polygonRadius; + + manifold->pointCount = 0; + + b2EPAxis edgeAxis = ComputeEdgeSeparation(); + + // If no valid normal can be found than this edge should not collide. + if (edgeAxis.type == b2EPAxis::e_unknown) + { + return; + } + + if (edgeAxis.separation > m_radius) + { + return; + } + + b2EPAxis polygonAxis = ComputePolygonSeparation(); + if (polygonAxis.type != b2EPAxis::e_unknown && polygonAxis.separation > m_radius) + { + return; + } + + // Use hysteresis for jitter reduction. + const float32 k_relativeTol = 0.98f; + const float32 k_absoluteTol = 0.001f; + + b2EPAxis primaryAxis; + if (polygonAxis.type == b2EPAxis::e_unknown) + { + primaryAxis = edgeAxis; + } + else if (polygonAxis.separation > k_relativeTol * edgeAxis.separation + k_absoluteTol) + { + primaryAxis = polygonAxis; + } + else + { + primaryAxis = edgeAxis; + } + + b2ClipVertex ie[2]; + b2ReferenceFace rf; + if (primaryAxis.type == b2EPAxis::e_edgeA) + { + manifold->type = b2Manifold::e_faceA; + + // Search for the polygon normal that is most anti-parallel to the edge normal. + int32 bestIndex = 0; + float32 bestValue = b2Dot(m_normal, m_polygonB.normals[0]); + for (int32 i = 1; i < m_polygonB.count; ++i) + { + float32 value = b2Dot(m_normal, m_polygonB.normals[i]); + if (value < bestValue) + { + bestValue = value; + bestIndex = i; + } + } + + int32 i1 = bestIndex; + int32 i2 = i1 + 1 < m_polygonB.count ? i1 + 1 : 0; + + ie[0].v = m_polygonB.vertices[i1]; + ie[0].id.cf.indexA = 0; + ie[0].id.cf.indexB = i1; + ie[0].id.cf.typeA = b2ContactFeature::e_face; + ie[0].id.cf.typeB = b2ContactFeature::e_vertex; + + ie[1].v = m_polygonB.vertices[i2]; + ie[1].id.cf.indexA = 0; + ie[1].id.cf.indexB = i2; + ie[1].id.cf.typeA = b2ContactFeature::e_face; + ie[1].id.cf.typeB = b2ContactFeature::e_vertex; + + if (m_front) + { + rf.i1 = 0; + rf.i2 = 1; + rf.v1 = m_v1; + rf.v2 = m_v2; + rf.normal = m_normal1; + } + else + { + rf.i1 = 1; + rf.i2 = 0; + rf.v1 = m_v2; + rf.v2 = m_v1; + rf.normal = -m_normal1; + } + } + else + { + manifold->type = b2Manifold::e_faceB; + + ie[0].v = m_v1; + ie[0].id.cf.indexA = 0; + ie[0].id.cf.indexB = primaryAxis.index; + ie[0].id.cf.typeA = b2ContactFeature::e_vertex; + ie[0].id.cf.typeB = b2ContactFeature::e_face; + + ie[1].v = m_v2; + ie[1].id.cf.indexA = 0; + ie[1].id.cf.indexB = primaryAxis.index; + ie[1].id.cf.typeA = b2ContactFeature::e_vertex; + ie[1].id.cf.typeB = b2ContactFeature::e_face; + + rf.i1 = primaryAxis.index; + rf.i2 = rf.i1 + 1 < m_polygonB.count ? rf.i1 + 1 : 0; + rf.v1 = m_polygonB.vertices[rf.i1]; + rf.v2 = m_polygonB.vertices[rf.i2]; + rf.normal = m_polygonB.normals[rf.i1]; + } + + rf.sideNormal1.Set(rf.normal.y, -rf.normal.x); + rf.sideNormal2 = -rf.sideNormal1; + rf.sideOffset1 = b2Dot(rf.sideNormal1, rf.v1); + rf.sideOffset2 = b2Dot(rf.sideNormal2, rf.v2); + + // Clip incident edge against extruded edge1 side edges. + b2ClipVertex clipPoints1[2]; + b2ClipVertex clipPoints2[2]; + int32 np; + + // Clip to box side 1 + np = b2ClipSegmentToLine(clipPoints1, ie, rf.sideNormal1, rf.sideOffset1, rf.i1); + + if (np < b2_maxManifoldPoints) + { + return; + } + + // Clip to negative box side 1 + np = b2ClipSegmentToLine(clipPoints2, clipPoints1, rf.sideNormal2, rf.sideOffset2, rf.i2); + + if (np < b2_maxManifoldPoints) + { + return; + } + + // Now clipPoints2 contains the clipped points. + if (primaryAxis.type == b2EPAxis::e_edgeA) + { + manifold->localNormal = rf.normal; + manifold->localPoint = rf.v1; + } + else + { + manifold->localNormal = polygonB->m_normals[rf.i1]; + manifold->localPoint = polygonB->m_vertices[rf.i1]; + } + + int32 pointCount = 0; + for (int32 i = 0; i < b2_maxManifoldPoints; ++i) + { + float32 separation; + + separation = b2Dot(rf.normal, clipPoints2[i].v - rf.v1); + + if (separation <= m_radius) + { + b2ManifoldPoint* cp = manifold->points + pointCount; + + if (primaryAxis.type == b2EPAxis::e_edgeA) + { + cp->localPoint = b2MulT(m_xf, clipPoints2[i].v); + cp->id = clipPoints2[i].id; + } + else + { + cp->localPoint = clipPoints2[i].v; + cp->id.cf.typeA = clipPoints2[i].id.cf.typeB; + cp->id.cf.typeB = clipPoints2[i].id.cf.typeA; + cp->id.cf.indexA = clipPoints2[i].id.cf.indexB; + cp->id.cf.indexB = clipPoints2[i].id.cf.indexA; + } + + ++pointCount; + } + } + + manifold->pointCount = pointCount; +} + +b2EPAxis b2EPCollider::ComputeEdgeSeparation() +{ + b2EPAxis axis; + axis.type = b2EPAxis::e_edgeA; + axis.index = m_front ? 0 : 1; + axis.separation = FLT_MAX; + + for (int32 i = 0; i < m_polygonB.count; ++i) + { + float32 s = b2Dot(m_normal, m_polygonB.vertices[i] - m_v1); + if (s < axis.separation) + { + axis.separation = s; + } + } + + return axis; +} + +b2EPAxis b2EPCollider::ComputePolygonSeparation() +{ + b2EPAxis axis; + axis.type = b2EPAxis::e_unknown; + axis.index = -1; + axis.separation = -FLT_MAX; + + b2Vec2 perp(-m_normal.y, m_normal.x); + + for (int32 i = 0; i < m_polygonB.count; ++i) + { + b2Vec2 n = -m_polygonB.normals[i]; + + float32 s1 = b2Dot(n, m_polygonB.vertices[i] - m_v1); + float32 s2 = b2Dot(n, m_polygonB.vertices[i] - m_v2); + float32 s = b2Min(s1, s2); + + if (s > m_radius) + { + // No collision + axis.type = b2EPAxis::e_edgeB; + axis.index = i; + axis.separation = s; + return axis; + } + + // Adjacency + if (b2Dot(n, perp) >= 0.0f) + { + if (b2Dot(n - m_upperLimit, m_normal) < -b2_angularSlop) + { + continue; + } + } + else + { + if (b2Dot(n - m_lowerLimit, m_normal) < -b2_angularSlop) + { + continue; + } + } + + if (s > axis.separation) + { + axis.type = b2EPAxis::e_edgeB; + axis.index = i; + axis.separation = s; + } + } + + return axis; +} + +void b2CollideEdgeAndPolygon( b2Manifold* manifold, + const b2EdgeShape* edgeA, const b2Transform& xfA, + const b2PolygonShape* polygonB, const b2Transform& xfB) +{ + b2EPCollider collider; + collider.Collide(manifold, edgeA, xfA, polygonB, xfB); +} diff --git a/external/Box2D/Collision/b2CollidePolygon.cpp b/external/Box2D/Collision/b2CollidePolygon.cpp new file mode 100644 index 0000000000..be2518d966 --- /dev/null +++ b/external/Box2D/Collision/b2CollidePolygon.cpp @@ -0,0 +1,317 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include + +// Find the separation between poly1 and poly2 for a give edge normal on poly1. +static float32 b2EdgeSeparation(const b2PolygonShape* poly1, const b2Transform& xf1, int32 edge1, + const b2PolygonShape* poly2, const b2Transform& xf2) +{ + const b2Vec2* vertices1 = poly1->m_vertices; + const b2Vec2* normals1 = poly1->m_normals; + + int32 count2 = poly2->m_vertexCount; + const b2Vec2* vertices2 = poly2->m_vertices; + + b2Assert(0 <= edge1 && edge1 < poly1->m_vertexCount); + + // Convert normal from poly1's frame into poly2's frame. + b2Vec2 normal1World = b2Mul(xf1.q, normals1[edge1]); + b2Vec2 normal1 = b2MulT(xf2.q, normal1World); + + // Find support vertex on poly2 for -normal. + int32 index = 0; + float32 minDot = b2_maxFloat; + + for (int32 i = 0; i < count2; ++i) + { + float32 dot = b2Dot(vertices2[i], normal1); + if (dot < minDot) + { + minDot = dot; + index = i; + } + } + + b2Vec2 v1 = b2Mul(xf1, vertices1[edge1]); + b2Vec2 v2 = b2Mul(xf2, vertices2[index]); + float32 separation = b2Dot(v2 - v1, normal1World); + return separation; +} + +// Find the max separation between poly1 and poly2 using edge normals from poly1. +static float32 b2FindMaxSeparation(int32* edgeIndex, + const b2PolygonShape* poly1, const b2Transform& xf1, + const b2PolygonShape* poly2, const b2Transform& xf2) +{ + int32 count1 = poly1->m_vertexCount; + const b2Vec2* normals1 = poly1->m_normals; + + // Vector pointing from the centroid of poly1 to the centroid of poly2. + b2Vec2 d = b2Mul(xf2, poly2->m_centroid) - b2Mul(xf1, poly1->m_centroid); + b2Vec2 dLocal1 = b2MulT(xf1.q, d); + + // Find edge normal on poly1 that has the largest projection onto d. + int32 edge = 0; + float32 maxDot = -b2_maxFloat; + for (int32 i = 0; i < count1; ++i) + { + float32 dot = b2Dot(normals1[i], dLocal1); + if (dot > maxDot) + { + maxDot = dot; + edge = i; + } + } + + // Get the separation for the edge normal. + float32 s = b2EdgeSeparation(poly1, xf1, edge, poly2, xf2); + + // Check the separation for the previous edge normal. + int32 prevEdge = edge - 1 >= 0 ? edge - 1 : count1 - 1; + float32 sPrev = b2EdgeSeparation(poly1, xf1, prevEdge, poly2, xf2); + + // Check the separation for the next edge normal. + int32 nextEdge = edge + 1 < count1 ? edge + 1 : 0; + float32 sNext = b2EdgeSeparation(poly1, xf1, nextEdge, poly2, xf2); + + // Find the best edge and the search direction. + int32 bestEdge; + float32 bestSeparation; + int32 increment; + if (sPrev > s && sPrev > sNext) + { + increment = -1; + bestEdge = prevEdge; + bestSeparation = sPrev; + } + else if (sNext > s) + { + increment = 1; + bestEdge = nextEdge; + bestSeparation = sNext; + } + else + { + *edgeIndex = edge; + return s; + } + + // Perform a local search for the best edge normal. + for ( ; ; ) + { + if (increment == -1) + edge = bestEdge - 1 >= 0 ? bestEdge - 1 : count1 - 1; + else + edge = bestEdge + 1 < count1 ? bestEdge + 1 : 0; + + s = b2EdgeSeparation(poly1, xf1, edge, poly2, xf2); + + if (s > bestSeparation) + { + bestEdge = edge; + bestSeparation = s; + } + else + { + break; + } + } + + *edgeIndex = bestEdge; + return bestSeparation; +} + +static void b2FindIncidentEdge(b2ClipVertex c[2], + const b2PolygonShape* poly1, const b2Transform& xf1, int32 edge1, + const b2PolygonShape* poly2, const b2Transform& xf2) +{ + const b2Vec2* normals1 = poly1->m_normals; + + int32 count2 = poly2->m_vertexCount; + const b2Vec2* vertices2 = poly2->m_vertices; + const b2Vec2* normals2 = poly2->m_normals; + + b2Assert(0 <= edge1 && edge1 < poly1->m_vertexCount); + + // Get the normal of the reference edge in poly2's frame. + b2Vec2 normal1 = b2MulT(xf2.q, b2Mul(xf1.q, normals1[edge1])); + + // Find the incident edge on poly2. + int32 index = 0; + float32 minDot = b2_maxFloat; + for (int32 i = 0; i < count2; ++i) + { + float32 dot = b2Dot(normal1, normals2[i]); + if (dot < minDot) + { + minDot = dot; + index = i; + } + } + + // Build the clip vertices for the incident edge. + int32 i1 = index; + int32 i2 = i1 + 1 < count2 ? i1 + 1 : 0; + + c[0].v = b2Mul(xf2, vertices2[i1]); + c[0].id.cf.indexA = (uint8)edge1; + c[0].id.cf.indexB = (uint8)i1; + c[0].id.cf.typeA = b2ContactFeature::e_face; + c[0].id.cf.typeB = b2ContactFeature::e_vertex; + + c[1].v = b2Mul(xf2, vertices2[i2]); + c[1].id.cf.indexA = (uint8)edge1; + c[1].id.cf.indexB = (uint8)i2; + c[1].id.cf.typeA = b2ContactFeature::e_face; + c[1].id.cf.typeB = b2ContactFeature::e_vertex; +} + +// Find edge normal of max separation on A - return if separating axis is found +// Find edge normal of max separation on B - return if separation axis is found +// Choose reference edge as min(minA, minB) +// Find incident edge +// Clip + +// The normal points from 1 to 2 +void b2CollidePolygons(b2Manifold* manifold, + const b2PolygonShape* polyA, const b2Transform& xfA, + const b2PolygonShape* polyB, const b2Transform& xfB) +{ + manifold->pointCount = 0; + float32 totalRadius = polyA->m_radius + polyB->m_radius; + + int32 edgeA = 0; + float32 separationA = b2FindMaxSeparation(&edgeA, polyA, xfA, polyB, xfB); + if (separationA > totalRadius) + return; + + int32 edgeB = 0; + float32 separationB = b2FindMaxSeparation(&edgeB, polyB, xfB, polyA, xfA); + if (separationB > totalRadius) + return; + + const b2PolygonShape* poly1; // reference polygon + const b2PolygonShape* poly2; // incident polygon + b2Transform xf1, xf2; + int32 edge1; // reference edge + uint8 flip; + const float32 k_relativeTol = 0.98f; + const float32 k_absoluteTol = 0.001f; + + if (separationB > k_relativeTol * separationA + k_absoluteTol) + { + poly1 = polyB; + poly2 = polyA; + xf1 = xfB; + xf2 = xfA; + edge1 = edgeB; + manifold->type = b2Manifold::e_faceB; + flip = 1; + } + else + { + poly1 = polyA; + poly2 = polyB; + xf1 = xfA; + xf2 = xfB; + edge1 = edgeA; + manifold->type = b2Manifold::e_faceA; + flip = 0; + } + + b2ClipVertex incidentEdge[2]; + b2FindIncidentEdge(incidentEdge, poly1, xf1, edge1, poly2, xf2); + + int32 count1 = poly1->m_vertexCount; + const b2Vec2* vertices1 = poly1->m_vertices; + + int32 iv1 = edge1; + int32 iv2 = edge1 + 1 < count1 ? edge1 + 1 : 0; + + b2Vec2 v11 = vertices1[iv1]; + b2Vec2 v12 = vertices1[iv2]; + + b2Vec2 localTangent = v12 - v11; + localTangent.Normalize(); + + b2Vec2 localNormal = b2Cross(localTangent, 1.0f); + b2Vec2 planePoint = 0.5f * (v11 + v12); + + b2Vec2 tangent = b2Mul(xf1.q, localTangent); + b2Vec2 normal = b2Cross(tangent, 1.0f); + + v11 = b2Mul(xf1, v11); + v12 = b2Mul(xf1, v12); + + // Face offset. + float32 frontOffset = b2Dot(normal, v11); + + // Side offsets, extended by polytope skin thickness. + float32 sideOffset1 = -b2Dot(tangent, v11) + totalRadius; + float32 sideOffset2 = b2Dot(tangent, v12) + totalRadius; + + // Clip incident edge against extruded edge1 side edges. + b2ClipVertex clipPoints1[2]; + b2ClipVertex clipPoints2[2]; + int np; + + // Clip to box side 1 + np = b2ClipSegmentToLine(clipPoints1, incidentEdge, -tangent, sideOffset1, iv1); + + if (np < 2) + return; + + // Clip to negative box side 1 + np = b2ClipSegmentToLine(clipPoints2, clipPoints1, tangent, sideOffset2, iv2); + + if (np < 2) + { + return; + } + + // Now clipPoints2 contains the clipped points. + manifold->localNormal = localNormal; + manifold->localPoint = planePoint; + + int32 pointCount = 0; + for (int32 i = 0; i < b2_maxManifoldPoints; ++i) + { + float32 separation = b2Dot(normal, clipPoints2[i].v) - frontOffset; + + if (separation <= totalRadius) + { + b2ManifoldPoint* cp = manifold->points + pointCount; + cp->localPoint = b2MulT(xf2, clipPoints2[i].v); + cp->id = clipPoints2[i].id; + if (flip) + { + // Swap features + b2ContactFeature cf = cp->id.cf; + cp->id.cf.indexA = cf.indexB; + cp->id.cf.indexB = cf.indexA; + cp->id.cf.typeA = cf.typeB; + cp->id.cf.typeB = cf.typeA; + } + ++pointCount; + } + } + + manifold->pointCount = pointCount; +} diff --git a/external/Box2D/Collision/b2Collision.cpp b/external/Box2D/Collision/b2Collision.cpp new file mode 100644 index 0000000000..2dd5ff0ab6 --- /dev/null +++ b/external/Box2D/Collision/b2Collision.cpp @@ -0,0 +1,249 @@ +/* +* Copyright (c) 2007-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include + +void b2WorldManifold::Initialize(const b2Manifold* manifold, + const b2Transform& xfA, float32 radiusA, + const b2Transform& xfB, float32 radiusB) +{ + if (manifold->pointCount == 0) + { + return; + } + + switch (manifold->type) + { + case b2Manifold::e_circles: + { + normal.Set(1.0f, 0.0f); + b2Vec2 pointA = b2Mul(xfA, manifold->localPoint); + b2Vec2 pointB = b2Mul(xfB, manifold->points[0].localPoint); + if (b2DistanceSquared(pointA, pointB) > b2_epsilon * b2_epsilon) + { + normal = pointB - pointA; + normal.Normalize(); + } + + b2Vec2 cA = pointA + radiusA * normal; + b2Vec2 cB = pointB - radiusB * normal; + points[0] = 0.5f * (cA + cB); + } + break; + + case b2Manifold::e_faceA: + { + normal = b2Mul(xfA.q, manifold->localNormal); + b2Vec2 planePoint = b2Mul(xfA, manifold->localPoint); + + for (int32 i = 0; i < manifold->pointCount; ++i) + { + b2Vec2 clipPoint = b2Mul(xfB, manifold->points[i].localPoint); + b2Vec2 cA = clipPoint + (radiusA - b2Dot(clipPoint - planePoint, normal)) * normal; + b2Vec2 cB = clipPoint - radiusB * normal; + points[i] = 0.5f * (cA + cB); + } + } + break; + + case b2Manifold::e_faceB: + { + normal = b2Mul(xfB.q, manifold->localNormal); + b2Vec2 planePoint = b2Mul(xfB, manifold->localPoint); + + for (int32 i = 0; i < manifold->pointCount; ++i) + { + b2Vec2 clipPoint = b2Mul(xfA, manifold->points[i].localPoint); + b2Vec2 cB = clipPoint + (radiusB - b2Dot(clipPoint - planePoint, normal)) * normal; + b2Vec2 cA = clipPoint - radiusA * normal; + points[i] = 0.5f * (cA + cB); + } + + // Ensure normal points from A to B. + normal = -normal; + } + break; + } +} + +void b2GetPointStates(b2PointState state1[b2_maxManifoldPoints], b2PointState state2[b2_maxManifoldPoints], + const b2Manifold* manifold1, const b2Manifold* manifold2) +{ + for (int32 i = 0; i < b2_maxManifoldPoints; ++i) + { + state1[i] = b2_nullState; + state2[i] = b2_nullState; + } + + // Detect persists and removes. + for (int32 i = 0; i < manifold1->pointCount; ++i) + { + b2ContactID id = manifold1->points[i].id; + + state1[i] = b2_removeState; + + for (int32 j = 0; j < manifold2->pointCount; ++j) + { + if (manifold2->points[j].id.key == id.key) + { + state1[i] = b2_persistState; + break; + } + } + } + + // Detect persists and adds. + for (int32 i = 0; i < manifold2->pointCount; ++i) + { + b2ContactID id = manifold2->points[i].id; + + state2[i] = b2_addState; + + for (int32 j = 0; j < manifold1->pointCount; ++j) + { + if (manifold1->points[j].id.key == id.key) + { + state2[i] = b2_persistState; + break; + } + } + } +} + +// From Real-time Collision Detection, p179. +bool b2AABB::RayCast(b2RayCastOutput* output, const b2RayCastInput& input) const +{ + float32 tmin = -b2_maxFloat; + float32 tmax = b2_maxFloat; + + b2Vec2 p = input.p1; + b2Vec2 d = input.p2 - input.p1; + b2Vec2 absD = b2Abs(d); + + b2Vec2 normal; + + for (int32 i = 0; i < 2; ++i) + { + if (absD(i) < b2_epsilon) + { + // Parallel. + if (p(i) < lowerBound(i) || upperBound(i) < p(i)) + { + return false; + } + } + else + { + float32 inv_d = 1.0f / d(i); + float32 t1 = (lowerBound(i) - p(i)) * inv_d; + float32 t2 = (upperBound(i) - p(i)) * inv_d; + + // Sign of the normal vector. + float32 s = -1.0f; + + if (t1 > t2) + { + b2Swap(t1, t2); + s = 1.0f; + } + + // Push the min up + if (t1 > tmin) + { + normal.SetZero(); + normal(i) = s; + tmin = t1; + } + + // Pull the max down + tmax = b2Min(tmax, t2); + + if (tmin > tmax) + { + return false; + } + } + } + + // Does the ray start inside the box? + // Does the ray intersect beyond the max fraction? + if (tmin < 0.0f || input.maxFraction < tmin) + { + return false; + } + + // Intersection. + output->fraction = tmin; + output->normal = normal; + return true; +} + +// Sutherland-Hodgman clipping. +int32 b2ClipSegmentToLine(b2ClipVertex vOut[2], const b2ClipVertex vIn[2], + const b2Vec2& normal, float32 offset, int32 vertexIndexA) +{ + // Start with no output points + int32 numOut = 0; + + // Calculate the distance of end points to the line + float32 distance0 = b2Dot(normal, vIn[0].v) - offset; + float32 distance1 = b2Dot(normal, vIn[1].v) - offset; + + // If the points are behind the plane + if (distance0 <= 0.0f) vOut[numOut++] = vIn[0]; + if (distance1 <= 0.0f) vOut[numOut++] = vIn[1]; + + // If the points are on different sides of the plane + if (distance0 * distance1 < 0.0f) + { + // Find intersection point of edge and plane + float32 interp = distance0 / (distance0 - distance1); + vOut[numOut].v = vIn[0].v + interp * (vIn[1].v - vIn[0].v); + + // VertexA is hitting edgeB. + vOut[numOut].id.cf.indexA = vertexIndexA; + vOut[numOut].id.cf.indexB = vIn[0].id.cf.indexB; + vOut[numOut].id.cf.typeA = b2ContactFeature::e_vertex; + vOut[numOut].id.cf.typeB = b2ContactFeature::e_face; + ++numOut; + } + + return numOut; +} + +bool b2TestOverlap( const b2Shape* shapeA, int32 indexA, + const b2Shape* shapeB, int32 indexB, + const b2Transform& xfA, const b2Transform& xfB) +{ + b2DistanceInput input; + input.proxyA.Set(shapeA, indexA); + input.proxyB.Set(shapeB, indexB); + input.transformA = xfA; + input.transformB = xfB; + input.useRadii = true; + + b2SimplexCache cache; + cache.count = 0; + + b2DistanceOutput output; + + b2Distance(&output, &cache, &input); + + return output.distance < 10.0f * b2_epsilon; +} diff --git a/external/Box2D/Collision/b2Collision.h b/external/Box2D/Collision/b2Collision.h new file mode 100644 index 0000000000..2e7386232b --- /dev/null +++ b/external/Box2D/Collision/b2Collision.h @@ -0,0 +1,276 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_COLLISION_H +#define B2_COLLISION_H + +#include +#include + +/// @file +/// Structures and functions used for computing contact points, distance +/// queries, and TOI queries. + +class b2Shape; +class b2CircleShape; +class b2EdgeShape; +class b2PolygonShape; + +const uint8 b2_nullFeature = UCHAR_MAX; + +/// The features that intersect to form the contact point +/// This must be 4 bytes or less. +struct b2ContactFeature +{ + enum Type + { + e_vertex = 0, + e_face = 1 + }; + + uint8 indexA; ///< Feature index on shapeA + uint8 indexB; ///< Feature index on shapeB + uint8 typeA; ///< The feature type on shapeA + uint8 typeB; ///< The feature type on shapeB +}; + +/// Contact ids to facilitate warm starting. +union b2ContactID +{ + b2ContactFeature cf; + uint32 key; ///< Used to quickly compare contact ids. +}; + +/// A manifold point is a contact point belonging to a contact +/// manifold. It holds details related to the geometry and dynamics +/// of the contact points. +/// The local point usage depends on the manifold type: +/// -e_circles: the local center of circleB +/// -e_faceA: the local center of cirlceB or the clip point of polygonB +/// -e_faceB: the clip point of polygonA +/// This structure is stored across time steps, so we keep it small. +/// Note: the impulses are used for internal caching and may not +/// provide reliable contact forces, especially for high speed collisions. +struct b2ManifoldPoint +{ + b2Vec2 localPoint; ///< usage depends on manifold type + float32 normalImpulse; ///< the non-penetration impulse + float32 tangentImpulse; ///< the friction impulse + b2ContactID id; ///< uniquely identifies a contact point between two shapes +}; + +/// A manifold for two touching convex shapes. +/// Box2D supports multiple types of contact: +/// - clip point versus plane with radius +/// - point versus point with radius (circles) +/// The local point usage depends on the manifold type: +/// -e_circles: the local center of circleA +/// -e_faceA: the center of faceA +/// -e_faceB: the center of faceB +/// Similarly the local normal usage: +/// -e_circles: not used +/// -e_faceA: the normal on polygonA +/// -e_faceB: the normal on polygonB +/// We store contacts in this way so that position correction can +/// account for movement, which is critical for continuous physics. +/// All contact scenarios must be expressed in one of these types. +/// This structure is stored across time steps, so we keep it small. +struct b2Manifold +{ + enum Type + { + e_circles, + e_faceA, + e_faceB + }; + + b2ManifoldPoint points[b2_maxManifoldPoints]; ///< the points of contact + b2Vec2 localNormal; ///< not use for Type::e_points + b2Vec2 localPoint; ///< usage depends on manifold type + Type type; + int32 pointCount; ///< the number of manifold points +}; + +/// This is used to compute the current state of a contact manifold. +struct b2WorldManifold +{ + /// Evaluate the manifold with supplied transforms. This assumes + /// modest motion from the original state. This does not change the + /// point count, impulses, etc. The radii must come from the shapes + /// that generated the manifold. + void Initialize(const b2Manifold* manifold, + const b2Transform& xfA, float32 radiusA, + const b2Transform& xfB, float32 radiusB); + + b2Vec2 normal; ///< world vector pointing from A to B + b2Vec2 points[b2_maxManifoldPoints]; ///< world contact point (point of intersection) +}; + +/// This is used for determining the state of contact points. +enum b2PointState +{ + b2_nullState, ///< point does not exist + b2_addState, ///< point was added in the update + b2_persistState, ///< point persisted across the update + b2_removeState ///< point was removed in the update +}; + +/// Compute the point states given two manifolds. The states pertain to the transition from manifold1 +/// to manifold2. So state1 is either persist or remove while state2 is either add or persist. +void b2GetPointStates(b2PointState state1[b2_maxManifoldPoints], b2PointState state2[b2_maxManifoldPoints], + const b2Manifold* manifold1, const b2Manifold* manifold2); + +/// Used for computing contact manifolds. +struct b2ClipVertex +{ + b2Vec2 v; + b2ContactID id; +}; + +/// Ray-cast input data. The ray extends from p1 to p1 + maxFraction * (p2 - p1). +struct b2RayCastInput +{ + b2Vec2 p1, p2; + float32 maxFraction; +}; + +/// Ray-cast output data. The ray hits at p1 + fraction * (p2 - p1), where p1 and p2 +/// come from b2RayCastInput. +struct b2RayCastOutput +{ + b2Vec2 normal; + float32 fraction; +}; + +/// An axis aligned bounding box. +struct b2AABB +{ + /// Verify that the bounds are sorted. + bool IsValid() const; + + /// Get the center of the AABB. + b2Vec2 GetCenter() const + { + return 0.5f * (lowerBound + upperBound); + } + + /// Get the extents of the AABB (half-widths). + b2Vec2 GetExtents() const + { + return 0.5f * (upperBound - lowerBound); + } + + /// Get the perimeter length + float32 GetPerimeter() const + { + float32 wx = upperBound.x - lowerBound.x; + float32 wy = upperBound.y - lowerBound.y; + return 2.0f * (wx + wy); + } + + /// Combine an AABB into this one. + void Combine(const b2AABB& aabb) + { + lowerBound = b2Min(lowerBound, aabb.lowerBound); + upperBound = b2Max(upperBound, aabb.upperBound); + } + + /// Combine two AABBs into this one. + void Combine(const b2AABB& aabb1, const b2AABB& aabb2) + { + lowerBound = b2Min(aabb1.lowerBound, aabb2.lowerBound); + upperBound = b2Max(aabb1.upperBound, aabb2.upperBound); + } + + /// Does this aabb contain the provided AABB. + bool Contains(const b2AABB& aabb) const + { + bool result = true; + result = result && lowerBound.x <= aabb.lowerBound.x; + result = result && lowerBound.y <= aabb.lowerBound.y; + result = result && aabb.upperBound.x <= upperBound.x; + result = result && aabb.upperBound.y <= upperBound.y; + return result; + } + + bool RayCast(b2RayCastOutput* output, const b2RayCastInput& input) const; + + b2Vec2 lowerBound; ///< the lower vertex + b2Vec2 upperBound; ///< the upper vertex +}; + +/// Compute the collision manifold between two circles. +void b2CollideCircles(b2Manifold* manifold, + const b2CircleShape* circleA, const b2Transform& xfA, + const b2CircleShape* circleB, const b2Transform& xfB); + +/// Compute the collision manifold between a polygon and a circle. +void b2CollidePolygonAndCircle(b2Manifold* manifold, + const b2PolygonShape* polygonA, const b2Transform& xfA, + const b2CircleShape* circleB, const b2Transform& xfB); + +/// Compute the collision manifold between two polygons. +void b2CollidePolygons(b2Manifold* manifold, + const b2PolygonShape* polygonA, const b2Transform& xfA, + const b2PolygonShape* polygonB, const b2Transform& xfB); + +/// Compute the collision manifold between an edge and a circle. +void b2CollideEdgeAndCircle(b2Manifold* manifold, + const b2EdgeShape* polygonA, const b2Transform& xfA, + const b2CircleShape* circleB, const b2Transform& xfB); + +/// Compute the collision manifold between an edge and a circle. +void b2CollideEdgeAndPolygon(b2Manifold* manifold, + const b2EdgeShape* edgeA, const b2Transform& xfA, + const b2PolygonShape* circleB, const b2Transform& xfB); + +/// Clipping for contact manifolds. +int32 b2ClipSegmentToLine(b2ClipVertex vOut[2], const b2ClipVertex vIn[2], + const b2Vec2& normal, float32 offset, int32 vertexIndexA); + +/// Determine if two generic shapes overlap. +bool b2TestOverlap( const b2Shape* shapeA, int32 indexA, + const b2Shape* shapeB, int32 indexB, + const b2Transform& xfA, const b2Transform& xfB); + +// ---------------- Inline Functions ------------------------------------------ + +inline bool b2AABB::IsValid() const +{ + b2Vec2 d = upperBound - lowerBound; + bool valid = d.x >= 0.0f && d.y >= 0.0f; + valid = valid && lowerBound.IsValid() && upperBound.IsValid(); + return valid; +} + +inline bool b2TestOverlap(const b2AABB& a, const b2AABB& b) +{ + b2Vec2 d1, d2; + d1 = b.lowerBound - a.upperBound; + d2 = a.lowerBound - b.upperBound; + + if (d1.x > 0.0f || d1.y > 0.0f) + return false; + + if (d2.x > 0.0f || d2.y > 0.0f) + return false; + + return true; +} + +#endif diff --git a/external/Box2D/Collision/b2Distance.cpp b/external/Box2D/Collision/b2Distance.cpp new file mode 100644 index 0000000000..ac67d3be43 --- /dev/null +++ b/external/Box2D/Collision/b2Distance.cpp @@ -0,0 +1,603 @@ +/* +* Copyright (c) 2007-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include +#include +#include + +// GJK using Voronoi regions (Christer Ericson) and Barycentric coordinates. +int32 b2_gjkCalls, b2_gjkIters, b2_gjkMaxIters; + +void b2DistanceProxy::Set(const b2Shape* shape, int32 index) +{ + switch (shape->GetType()) + { + case b2Shape::e_circle: + { + const b2CircleShape* circle = (b2CircleShape*)shape; + m_vertices = &circle->m_p; + m_count = 1; + m_radius = circle->m_radius; + } + break; + + case b2Shape::e_polygon: + { + const b2PolygonShape* polygon = (b2PolygonShape*)shape; + m_vertices = polygon->m_vertices; + m_count = polygon->m_vertexCount; + m_radius = polygon->m_radius; + } + break; + + case b2Shape::e_chain: + { + const b2ChainShape* chain = (b2ChainShape*)shape; + b2Assert(0 <= index && index < chain->m_count); + + m_buffer[0] = chain->m_vertices[index]; + if (index + 1 < chain->m_count) + { + m_buffer[1] = chain->m_vertices[index + 1]; + } + else + { + m_buffer[1] = chain->m_vertices[0]; + } + + m_vertices = m_buffer; + m_count = 2; + m_radius = chain->m_radius; + } + break; + + case b2Shape::e_edge: + { + const b2EdgeShape* edge = (b2EdgeShape*)shape; + m_vertices = &edge->m_vertex1; + m_count = 2; + m_radius = edge->m_radius; + } + break; + + default: + b2Assert(false); + } +} + + +struct b2SimplexVertex +{ + b2Vec2 wA; // support point in proxyA + b2Vec2 wB; // support point in proxyB + b2Vec2 w; // wB - wA + float32 a; // barycentric coordinate for closest point + int32 indexA; // wA index + int32 indexB; // wB index +}; + +struct b2Simplex +{ + void ReadCache( const b2SimplexCache* cache, + const b2DistanceProxy* proxyA, const b2Transform& transformA, + const b2DistanceProxy* proxyB, const b2Transform& transformB) + { + b2Assert(cache->count <= 3); + + // Copy data from cache. + m_count = cache->count; + b2SimplexVertex* vertices = &m_v1; + for (int32 i = 0; i < m_count; ++i) + { + b2SimplexVertex* v = vertices + i; + v->indexA = cache->indexA[i]; + v->indexB = cache->indexB[i]; + b2Vec2 wALocal = proxyA->GetVertex(v->indexA); + b2Vec2 wBLocal = proxyB->GetVertex(v->indexB); + v->wA = b2Mul(transformA, wALocal); + v->wB = b2Mul(transformB, wBLocal); + v->w = v->wB - v->wA; + v->a = 0.0f; + } + + // Compute the new simplex metric, if it is substantially different than + // old metric then flush the simplex. + if (m_count > 1) + { + float32 metric1 = cache->metric; + float32 metric2 = GetMetric(); + if (metric2 < 0.5f * metric1 || 2.0f * metric1 < metric2 || metric2 < b2_epsilon) + { + // Reset the simplex. + m_count = 0; + } + } + + // If the cache is empty or invalid ... + if (m_count == 0) + { + b2SimplexVertex* v = vertices + 0; + v->indexA = 0; + v->indexB = 0; + b2Vec2 wALocal = proxyA->GetVertex(0); + b2Vec2 wBLocal = proxyB->GetVertex(0); + v->wA = b2Mul(transformA, wALocal); + v->wB = b2Mul(transformB, wBLocal); + v->w = v->wB - v->wA; + m_count = 1; + } + } + + void WriteCache(b2SimplexCache* cache) const + { + cache->metric = GetMetric(); + cache->count = uint16(m_count); + const b2SimplexVertex* vertices = &m_v1; + for (int32 i = 0; i < m_count; ++i) + { + cache->indexA[i] = uint8(vertices[i].indexA); + cache->indexB[i] = uint8(vertices[i].indexB); + } + } + + b2Vec2 GetSearchDirection() const + { + switch (m_count) + { + case 1: + return -m_v1.w; + + case 2: + { + b2Vec2 e12 = m_v2.w - m_v1.w; + float32 sgn = b2Cross(e12, -m_v1.w); + if (sgn > 0.0f) + { + // Origin is left of e12. + return b2Cross(1.0f, e12); + } + else + { + // Origin is right of e12. + return b2Cross(e12, 1.0f); + } + } + + default: + b2Assert(false); + return b2Vec2_zero; + } + } + + b2Vec2 GetClosestPoint() const + { + switch (m_count) + { + case 0: + b2Assert(false); + return b2Vec2_zero; + + case 1: + return m_v1.w; + + case 2: + return m_v1.a * m_v1.w + m_v2.a * m_v2.w; + + case 3: + return b2Vec2_zero; + + default: + b2Assert(false); + return b2Vec2_zero; + } + } + + void GetWitnessPoints(b2Vec2* pA, b2Vec2* pB) const + { + switch (m_count) + { + case 0: + b2Assert(false); + break; + + case 1: + *pA = m_v1.wA; + *pB = m_v1.wB; + break; + + case 2: + *pA = m_v1.a * m_v1.wA + m_v2.a * m_v2.wA; + *pB = m_v1.a * m_v1.wB + m_v2.a * m_v2.wB; + break; + + case 3: + *pA = m_v1.a * m_v1.wA + m_v2.a * m_v2.wA + m_v3.a * m_v3.wA; + *pB = *pA; + break; + + default: + b2Assert(false); + break; + } + } + + float32 GetMetric() const + { + switch (m_count) + { + case 0: + b2Assert(false); + return 0.0; + + case 1: + return 0.0f; + + case 2: + return b2Distance(m_v1.w, m_v2.w); + + case 3: + return b2Cross(m_v2.w - m_v1.w, m_v3.w - m_v1.w); + + default: + b2Assert(false); + return 0.0f; + } + } + + void Solve2(); + void Solve3(); + + b2SimplexVertex m_v1, m_v2, m_v3; + int32 m_count; +}; + + +// Solve a line segment using barycentric coordinates. +// +// p = a1 * w1 + a2 * w2 +// a1 + a2 = 1 +// +// The vector from the origin to the closest point on the line is +// perpendicular to the line. +// e12 = w2 - w1 +// dot(p, e) = 0 +// a1 * dot(w1, e) + a2 * dot(w2, e) = 0 +// +// 2-by-2 linear system +// [1 1 ][a1] = [1] +// [w1.e12 w2.e12][a2] = [0] +// +// Define +// d12_1 = dot(w2, e12) +// d12_2 = -dot(w1, e12) +// d12 = d12_1 + d12_2 +// +// Solution +// a1 = d12_1 / d12 +// a2 = d12_2 / d12 +void b2Simplex::Solve2() +{ + b2Vec2 w1 = m_v1.w; + b2Vec2 w2 = m_v2.w; + b2Vec2 e12 = w2 - w1; + + // w1 region + float32 d12_2 = -b2Dot(w1, e12); + if (d12_2 <= 0.0f) + { + // a2 <= 0, so we clamp it to 0 + m_v1.a = 1.0f; + m_count = 1; + return; + } + + // w2 region + float32 d12_1 = b2Dot(w2, e12); + if (d12_1 <= 0.0f) + { + // a1 <= 0, so we clamp it to 0 + m_v2.a = 1.0f; + m_count = 1; + m_v1 = m_v2; + return; + } + + // Must be in e12 region. + float32 inv_d12 = 1.0f / (d12_1 + d12_2); + m_v1.a = d12_1 * inv_d12; + m_v2.a = d12_2 * inv_d12; + m_count = 2; +} + +// Possible regions: +// - points[2] +// - edge points[0]-points[2] +// - edge points[1]-points[2] +// - inside the triangle +void b2Simplex::Solve3() +{ + b2Vec2 w1 = m_v1.w; + b2Vec2 w2 = m_v2.w; + b2Vec2 w3 = m_v3.w; + + // Edge12 + // [1 1 ][a1] = [1] + // [w1.e12 w2.e12][a2] = [0] + // a3 = 0 + b2Vec2 e12 = w2 - w1; + float32 w1e12 = b2Dot(w1, e12); + float32 w2e12 = b2Dot(w2, e12); + float32 d12_1 = w2e12; + float32 d12_2 = -w1e12; + + // Edge13 + // [1 1 ][a1] = [1] + // [w1.e13 w3.e13][a3] = [0] + // a2 = 0 + b2Vec2 e13 = w3 - w1; + float32 w1e13 = b2Dot(w1, e13); + float32 w3e13 = b2Dot(w3, e13); + float32 d13_1 = w3e13; + float32 d13_2 = -w1e13; + + // Edge23 + // [1 1 ][a2] = [1] + // [w2.e23 w3.e23][a3] = [0] + // a1 = 0 + b2Vec2 e23 = w3 - w2; + float32 w2e23 = b2Dot(w2, e23); + float32 w3e23 = b2Dot(w3, e23); + float32 d23_1 = w3e23; + float32 d23_2 = -w2e23; + + // Triangle123 + float32 n123 = b2Cross(e12, e13); + + float32 d123_1 = n123 * b2Cross(w2, w3); + float32 d123_2 = n123 * b2Cross(w3, w1); + float32 d123_3 = n123 * b2Cross(w1, w2); + + // w1 region + if (d12_2 <= 0.0f && d13_2 <= 0.0f) + { + m_v1.a = 1.0f; + m_count = 1; + return; + } + + // e12 + if (d12_1 > 0.0f && d12_2 > 0.0f && d123_3 <= 0.0f) + { + float32 inv_d12 = 1.0f / (d12_1 + d12_2); + m_v1.a = d12_1 * inv_d12; + m_v2.a = d12_2 * inv_d12; + m_count = 2; + return; + } + + // e13 + if (d13_1 > 0.0f && d13_2 > 0.0f && d123_2 <= 0.0f) + { + float32 inv_d13 = 1.0f / (d13_1 + d13_2); + m_v1.a = d13_1 * inv_d13; + m_v3.a = d13_2 * inv_d13; + m_count = 2; + m_v2 = m_v3; + return; + } + + // w2 region + if (d12_1 <= 0.0f && d23_2 <= 0.0f) + { + m_v2.a = 1.0f; + m_count = 1; + m_v1 = m_v2; + return; + } + + // w3 region + if (d13_1 <= 0.0f && d23_1 <= 0.0f) + { + m_v3.a = 1.0f; + m_count = 1; + m_v1 = m_v3; + return; + } + + // e23 + if (d23_1 > 0.0f && d23_2 > 0.0f && d123_1 <= 0.0f) + { + float32 inv_d23 = 1.0f / (d23_1 + d23_2); + m_v2.a = d23_1 * inv_d23; + m_v3.a = d23_2 * inv_d23; + m_count = 2; + m_v1 = m_v3; + return; + } + + // Must be in triangle123 + float32 inv_d123 = 1.0f / (d123_1 + d123_2 + d123_3); + m_v1.a = d123_1 * inv_d123; + m_v2.a = d123_2 * inv_d123; + m_v3.a = d123_3 * inv_d123; + m_count = 3; +} + +void b2Distance(b2DistanceOutput* output, + b2SimplexCache* cache, + const b2DistanceInput* input) +{ + ++b2_gjkCalls; + + const b2DistanceProxy* proxyA = &input->proxyA; + const b2DistanceProxy* proxyB = &input->proxyB; + + b2Transform transformA = input->transformA; + b2Transform transformB = input->transformB; + + // Initialize the simplex. + b2Simplex simplex; + simplex.ReadCache(cache, proxyA, transformA, proxyB, transformB); + + // Get simplex vertices as an array. + b2SimplexVertex* vertices = &simplex.m_v1; + const int32 k_maxIters = 20; + + // These store the vertices of the last simplex so that we + // can check for duplicates and prevent cycling. + int32 saveA[3], saveB[3]; + int32 saveCount = 0; + + b2Vec2 closestPoint = simplex.GetClosestPoint(); + float32 distanceSqr1 = closestPoint.LengthSquared(); + float32 distanceSqr2 = distanceSqr1; + + // Main iteration loop. + int32 iter = 0; + while (iter < k_maxIters) + { + // Copy simplex so we can identify duplicates. + saveCount = simplex.m_count; + for (int32 i = 0; i < saveCount; ++i) + { + saveA[i] = vertices[i].indexA; + saveB[i] = vertices[i].indexB; + } + + switch (simplex.m_count) + { + case 1: + break; + + case 2: + simplex.Solve2(); + break; + + case 3: + simplex.Solve3(); + break; + + default: + b2Assert(false); + } + + // If we have 3 points, then the origin is in the corresponding triangle. + if (simplex.m_count == 3) + { + break; + } + + // Compute closest point. + b2Vec2 p = simplex.GetClosestPoint(); + distanceSqr2 = p.LengthSquared(); + + // Ensure progress + if (distanceSqr2 >= distanceSqr1) + { + //break; + } + distanceSqr1 = distanceSqr2; + + // Get search direction. + b2Vec2 d = simplex.GetSearchDirection(); + + // Ensure the search direction is numerically fit. + if (d.LengthSquared() < b2_epsilon * b2_epsilon) + { + // The origin is probably contained by a line segment + // or triangle. Thus the shapes are overlapped. + + // We can't return zero here even though there may be overlap. + // In case the simplex is a point, segment, or triangle it is difficult + // to determine if the origin is contained in the CSO or very close to it. + break; + } + + // Compute a tentative new simplex vertex using support points. + b2SimplexVertex* vertex = vertices + simplex.m_count; + vertex->indexA = proxyA->GetSupport(b2MulT(transformA.q, -d)); + vertex->wA = b2Mul(transformA, proxyA->GetVertex(vertex->indexA)); + b2Vec2 wBLocal; + vertex->indexB = proxyB->GetSupport(b2MulT(transformB.q, d)); + vertex->wB = b2Mul(transformB, proxyB->GetVertex(vertex->indexB)); + vertex->w = vertex->wB - vertex->wA; + + // Iteration count is equated to the number of support point calls. + ++iter; + ++b2_gjkIters; + + // Check for duplicate support points. This is the main termination criteria. + bool duplicate = false; + for (int32 i = 0; i < saveCount; ++i) + { + if (vertex->indexA == saveA[i] && vertex->indexB == saveB[i]) + { + duplicate = true; + break; + } + } + + // If we found a duplicate support point we must exit to avoid cycling. + if (duplicate) + { + break; + } + + // New vertex is ok and needed. + ++simplex.m_count; + } + + b2_gjkMaxIters = b2Max(b2_gjkMaxIters, iter); + + // Prepare output. + simplex.GetWitnessPoints(&output->pointA, &output->pointB); + output->distance = b2Distance(output->pointA, output->pointB); + output->iterations = iter; + + // Cache the simplex. + simplex.WriteCache(cache); + + // Apply radii if requested. + if (input->useRadii) + { + float32 rA = proxyA->m_radius; + float32 rB = proxyB->m_radius; + + if (output->distance > rA + rB && output->distance > b2_epsilon) + { + // Shapes are still no overlapped. + // Move the witness points to the outer surface. + output->distance -= rA + rB; + b2Vec2 normal = output->pointB - output->pointA; + normal.Normalize(); + output->pointA += rA * normal; + output->pointB -= rB * normal; + } + else + { + // Shapes are overlapped when radii are considered. + // Move the witness points to the middle. + b2Vec2 p = 0.5f * (output->pointA + output->pointB); + output->pointA = p; + output->pointB = p; + output->distance = 0.0f; + } + } +} diff --git a/external/Box2D/Collision/b2Distance.h b/external/Box2D/Collision/b2Distance.h new file mode 100644 index 0000000000..d598b7339d --- /dev/null +++ b/external/Box2D/Collision/b2Distance.h @@ -0,0 +1,141 @@ + +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_DISTANCE_H +#define B2_DISTANCE_H + +#include + +class b2Shape; + +/// A distance proxy is used by the GJK algorithm. +/// It encapsulates any shape. +struct b2DistanceProxy +{ + b2DistanceProxy() : m_vertices(NULL), m_count(0), m_radius(0.0f) {} + + /// Initialize the proxy using the given shape. The shape + /// must remain in scope while the proxy is in use. + void Set(const b2Shape* shape, int32 index); + + /// Get the supporting vertex index in the given direction. + int32 GetSupport(const b2Vec2& d) const; + + /// Get the supporting vertex in the given direction. + const b2Vec2& GetSupportVertex(const b2Vec2& d) const; + + /// Get the vertex count. + int32 GetVertexCount() const; + + /// Get a vertex by index. Used by b2Distance. + const b2Vec2& GetVertex(int32 index) const; + + b2Vec2 m_buffer[2]; + const b2Vec2* m_vertices; + int32 m_count; + float32 m_radius; +}; + +/// Used to warm start b2Distance. +/// Set count to zero on first call. +struct b2SimplexCache +{ + float32 metric; ///< length or area + uint16 count; + uint8 indexA[3]; ///< vertices on shape A + uint8 indexB[3]; ///< vertices on shape B +}; + +/// Input for b2Distance. +/// You have to option to use the shape radii +/// in the computation. Even +struct b2DistanceInput +{ + b2DistanceProxy proxyA; + b2DistanceProxy proxyB; + b2Transform transformA; + b2Transform transformB; + bool useRadii; +}; + +/// Output for b2Distance. +struct b2DistanceOutput +{ + b2Vec2 pointA; ///< closest point on shapeA + b2Vec2 pointB; ///< closest point on shapeB + float32 distance; + int32 iterations; ///< number of GJK iterations used +}; + +/// Compute the closest points between two shapes. Supports any combination of: +/// b2CircleShape, b2PolygonShape, b2EdgeShape. The simplex cache is input/output. +/// On the first call set b2SimplexCache.count to zero. +void b2Distance(b2DistanceOutput* output, + b2SimplexCache* cache, + const b2DistanceInput* input); + + +////////////////////////////////////////////////////////////////////////// + +inline int32 b2DistanceProxy::GetVertexCount() const +{ + return m_count; +} + +inline const b2Vec2& b2DistanceProxy::GetVertex(int32 index) const +{ + b2Assert(0 <= index && index < m_count); + return m_vertices[index]; +} + +inline int32 b2DistanceProxy::GetSupport(const b2Vec2& d) const +{ + int32 bestIndex = 0; + float32 bestValue = b2Dot(m_vertices[0], d); + for (int32 i = 1; i < m_count; ++i) + { + float32 value = b2Dot(m_vertices[i], d); + if (value > bestValue) + { + bestIndex = i; + bestValue = value; + } + } + + return bestIndex; +} + +inline const b2Vec2& b2DistanceProxy::GetSupportVertex(const b2Vec2& d) const +{ + int32 bestIndex = 0; + float32 bestValue = b2Dot(m_vertices[0], d); + for (int32 i = 1; i < m_count; ++i) + { + float32 value = b2Dot(m_vertices[i], d); + if (value > bestValue) + { + bestIndex = i; + bestValue = value; + } + } + + return m_vertices[bestIndex]; +} + +#endif diff --git a/external/Box2D/Collision/b2DynamicTree.cpp b/external/Box2D/Collision/b2DynamicTree.cpp new file mode 100644 index 0000000000..d1d53297e2 --- /dev/null +++ b/external/Box2D/Collision/b2DynamicTree.cpp @@ -0,0 +1,775 @@ +/* +* Copyright (c) 2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#ifndef SHP +#include +#else +#include +#endif +using namespace std; + + +b2DynamicTree::b2DynamicTree() +{ + m_root = b2_nullNode; + + m_nodeCapacity = 16; + m_nodeCount = 0; + m_nodes = (b2TreeNode*)b2Alloc(m_nodeCapacity * sizeof(b2TreeNode)); + memset(m_nodes, 0, m_nodeCapacity * sizeof(b2TreeNode)); + + // Build a linked list for the free list. + for (int32 i = 0; i < m_nodeCapacity - 1; ++i) + { + m_nodes[i].next = i + 1; + m_nodes[i].height = -1; + } + m_nodes[m_nodeCapacity-1].next = b2_nullNode; + m_nodes[m_nodeCapacity-1].height = -1; + m_freeList = 0; + + m_path = 0; + + m_insertionCount = 0; +} + +b2DynamicTree::~b2DynamicTree() +{ + // This frees the entire tree in one shot. + b2Free(m_nodes); +} + +// Allocate a node from the pool. Grow the pool if necessary. +int32 b2DynamicTree::AllocateNode() +{ + // Expand the node pool as needed. + if (m_freeList == b2_nullNode) + { + b2Assert(m_nodeCount == m_nodeCapacity); + + // The free list is empty. Rebuild a bigger pool. + b2TreeNode* oldNodes = m_nodes; + m_nodeCapacity *= 2; + m_nodes = (b2TreeNode*)b2Alloc(m_nodeCapacity * sizeof(b2TreeNode)); + memcpy(m_nodes, oldNodes, m_nodeCount * sizeof(b2TreeNode)); + b2Free(oldNodes); + + // Build a linked list for the free list. The parent + // pointer becomes the "next" pointer. + for (int32 i = m_nodeCount; i < m_nodeCapacity - 1; ++i) + { + m_nodes[i].next = i + 1; + m_nodes[i].height = -1; + } + m_nodes[m_nodeCapacity-1].next = b2_nullNode; + m_nodes[m_nodeCapacity-1].height = -1; + m_freeList = m_nodeCount; + } + + // Peel a node off the free list. + int32 nodeId = m_freeList; + m_freeList = m_nodes[nodeId].next; + m_nodes[nodeId].parent = b2_nullNode; + m_nodes[nodeId].child1 = b2_nullNode; + m_nodes[nodeId].child2 = b2_nullNode; + m_nodes[nodeId].height = 0; + m_nodes[nodeId].userData = NULL; + ++m_nodeCount; + return nodeId; +} + +// Return a node to the pool. +void b2DynamicTree::FreeNode(int32 nodeId) +{ + b2Assert(0 <= nodeId && nodeId < m_nodeCapacity); + b2Assert(0 < m_nodeCount); + m_nodes[nodeId].next = m_freeList; + m_nodes[nodeId].height = -1; + m_freeList = nodeId; + --m_nodeCount; +} + +// Create a proxy in the tree as a leaf node. We return the index +// of the node instead of a pointer so that we can grow +// the node pool. +int32 b2DynamicTree::CreateProxy(const b2AABB& aabb, void* userData) +{ + int32 proxyId = AllocateNode(); + + // Fatten the aabb. + b2Vec2 r(b2_aabbExtension, b2_aabbExtension); + m_nodes[proxyId].aabb.lowerBound = aabb.lowerBound - r; + m_nodes[proxyId].aabb.upperBound = aabb.upperBound + r; + m_nodes[proxyId].userData = userData; + m_nodes[proxyId].height = 0; + + InsertLeaf(proxyId); + + return proxyId; +} + +void b2DynamicTree::DestroyProxy(int32 proxyId) +{ + b2Assert(0 <= proxyId && proxyId < m_nodeCapacity); + b2Assert(m_nodes[proxyId].IsLeaf()); + + RemoveLeaf(proxyId); + FreeNode(proxyId); +} + +bool b2DynamicTree::MoveProxy(int32 proxyId, const b2AABB& aabb, const b2Vec2& displacement) +{ + b2Assert(0 <= proxyId && proxyId < m_nodeCapacity); + + b2Assert(m_nodes[proxyId].IsLeaf()); + + if (m_nodes[proxyId].aabb.Contains(aabb)) + { + return false; + } + + RemoveLeaf(proxyId); + + // Extend AABB. + b2AABB b = aabb; + b2Vec2 r(b2_aabbExtension, b2_aabbExtension); + b.lowerBound = b.lowerBound - r; + b.upperBound = b.upperBound + r; + + // Predict AABB displacement. + b2Vec2 d = b2_aabbMultiplier * displacement; + + if (d.x < 0.0f) + { + b.lowerBound.x += d.x; + } + else + { + b.upperBound.x += d.x; + } + + if (d.y < 0.0f) + { + b.lowerBound.y += d.y; + } + else + { + b.upperBound.y += d.y; + } + + m_nodes[proxyId].aabb = b; + + InsertLeaf(proxyId); + return true; +} + +void b2DynamicTree::InsertLeaf(int32 leaf) +{ + ++m_insertionCount; + + if (m_root == b2_nullNode) + { + m_root = leaf; + m_nodes[m_root].parent = b2_nullNode; + return; + } + + // Find the best sibling for this node + b2AABB leafAABB = m_nodes[leaf].aabb; + int32 index = m_root; + while (m_nodes[index].IsLeaf() == false) + { + int32 child1 = m_nodes[index].child1; + int32 child2 = m_nodes[index].child2; + + float32 area = m_nodes[index].aabb.GetPerimeter(); + + b2AABB combinedAABB; + combinedAABB.Combine(m_nodes[index].aabb, leafAABB); + float32 combinedArea = combinedAABB.GetPerimeter(); + + // Cost of creating a new parent for this node and the new leaf + float32 cost = 2.0f * combinedArea; + + // Minimum cost of pushing the leaf further down the tree + float32 inheritanceCost = 2.0f * (combinedArea - area); + + // Cost of descending into child1 + float32 cost1; + if (m_nodes[child1].IsLeaf()) + { + b2AABB aabb; + aabb.Combine(leafAABB, m_nodes[child1].aabb); + cost1 = aabb.GetPerimeter() + inheritanceCost; + } + else + { + b2AABB aabb; + aabb.Combine(leafAABB, m_nodes[child1].aabb); + float32 oldArea = m_nodes[child1].aabb.GetPerimeter(); + float32 newArea = aabb.GetPerimeter(); + cost1 = (newArea - oldArea) + inheritanceCost; + } + + // Cost of descending into child2 + float32 cost2; + if (m_nodes[child2].IsLeaf()) + { + b2AABB aabb; + aabb.Combine(leafAABB, m_nodes[child2].aabb); + cost2 = aabb.GetPerimeter() + inheritanceCost; + } + else + { + b2AABB aabb; + aabb.Combine(leafAABB, m_nodes[child2].aabb); + float32 oldArea = m_nodes[child2].aabb.GetPerimeter(); + float32 newArea = aabb.GetPerimeter(); + cost2 = newArea - oldArea + inheritanceCost; + } + + // Descend according to the minimum cost. + if (cost < cost1 && cost < cost2) + { + break; + } + + // Descend + if (cost1 < cost2) + { + index = child1; + } + else + { + index = child2; + } + } + + int32 sibling = index; + + // Create a new parent. + int32 oldParent = m_nodes[sibling].parent; + int32 newParent = AllocateNode(); + m_nodes[newParent].parent = oldParent; + m_nodes[newParent].userData = NULL; + m_nodes[newParent].aabb.Combine(leafAABB, m_nodes[sibling].aabb); + m_nodes[newParent].height = m_nodes[sibling].height + 1; + + if (oldParent != b2_nullNode) + { + // The sibling was not the root. + if (m_nodes[oldParent].child1 == sibling) + { + m_nodes[oldParent].child1 = newParent; + } + else + { + m_nodes[oldParent].child2 = newParent; + } + + m_nodes[newParent].child1 = sibling; + m_nodes[newParent].child2 = leaf; + m_nodes[sibling].parent = newParent; + m_nodes[leaf].parent = newParent; + } + else + { + // The sibling was the root. + m_nodes[newParent].child1 = sibling; + m_nodes[newParent].child2 = leaf; + m_nodes[sibling].parent = newParent; + m_nodes[leaf].parent = newParent; + m_root = newParent; + } + + // Walk back up the tree fixing heights and AABBs + index = m_nodes[leaf].parent; + while (index != b2_nullNode) + { + index = Balance(index); + + int32 child1 = m_nodes[index].child1; + int32 child2 = m_nodes[index].child2; + + b2Assert(child1 != b2_nullNode); + b2Assert(child2 != b2_nullNode); + + m_nodes[index].height = 1 + b2Max(m_nodes[child1].height, m_nodes[child2].height); + m_nodes[index].aabb.Combine(m_nodes[child1].aabb, m_nodes[child2].aabb); + + index = m_nodes[index].parent; + } + + //Validate(); +} + +void b2DynamicTree::RemoveLeaf(int32 leaf) +{ + if (leaf == m_root) + { + m_root = b2_nullNode; + return; + } + + int32 parent = m_nodes[leaf].parent; + int32 grandParent = m_nodes[parent].parent; + int32 sibling; + if (m_nodes[parent].child1 == leaf) + { + sibling = m_nodes[parent].child2; + } + else + { + sibling = m_nodes[parent].child1; + } + + if (grandParent != b2_nullNode) + { + // Destroy parent and connect sibling to grandParent. + if (m_nodes[grandParent].child1 == parent) + { + m_nodes[grandParent].child1 = sibling; + } + else + { + m_nodes[grandParent].child2 = sibling; + } + m_nodes[sibling].parent = grandParent; + FreeNode(parent); + + // Adjust ancestor bounds. + int32 index = grandParent; + while (index != b2_nullNode) + { + index = Balance(index); + + int32 child1 = m_nodes[index].child1; + int32 child2 = m_nodes[index].child2; + + m_nodes[index].aabb.Combine(m_nodes[child1].aabb, m_nodes[child2].aabb); + m_nodes[index].height = 1 + b2Max(m_nodes[child1].height, m_nodes[child2].height); + + index = m_nodes[index].parent; + } + } + else + { + m_root = sibling; + m_nodes[sibling].parent = b2_nullNode; + FreeNode(parent); + } + + //Validate(); +} + +// Perform a left or right rotation if node A is imbalanced. +// Returns the new root index. +int32 b2DynamicTree::Balance(int32 iA) +{ + b2Assert(iA != b2_nullNode); + + b2TreeNode* A = m_nodes + iA; + if (A->IsLeaf() || A->height < 2) + { + return iA; + } + + int32 iB = A->child1; + int32 iC = A->child2; + b2Assert(0 <= iB && iB < m_nodeCapacity); + b2Assert(0 <= iC && iC < m_nodeCapacity); + + b2TreeNode* B = m_nodes + iB; + b2TreeNode* C = m_nodes + iC; + + int32 balance = C->height - B->height; + + // Rotate C up + if (balance > 1) + { + int32 iF = C->child1; + int32 iG = C->child2; + b2TreeNode* F = m_nodes + iF; + b2TreeNode* G = m_nodes + iG; + b2Assert(0 <= iF && iF < m_nodeCapacity); + b2Assert(0 <= iG && iG < m_nodeCapacity); + + // Swap A and C + C->child1 = iA; + C->parent = A->parent; + A->parent = iC; + + // A's old parent should point to C + if (C->parent != b2_nullNode) + { + if (m_nodes[C->parent].child1 == iA) + { + m_nodes[C->parent].child1 = iC; + } + else + { + b2Assert(m_nodes[C->parent].child2 == iA); + m_nodes[C->parent].child2 = iC; + } + } + else + { + m_root = iC; + } + + // Rotate + if (F->height > G->height) + { + C->child2 = iF; + A->child2 = iG; + G->parent = iA; + A->aabb.Combine(B->aabb, G->aabb); + C->aabb.Combine(A->aabb, F->aabb); + + A->height = 1 + b2Max(B->height, G->height); + C->height = 1 + b2Max(A->height, F->height); + } + else + { + C->child2 = iG; + A->child2 = iF; + F->parent = iA; + A->aabb.Combine(B->aabb, F->aabb); + C->aabb.Combine(A->aabb, G->aabb); + + A->height = 1 + b2Max(B->height, F->height); + C->height = 1 + b2Max(A->height, G->height); + } + + return iC; + } + + // Rotate B up + if (balance < -1) + { + int32 iD = B->child1; + int32 iE = B->child2; + b2TreeNode* D = m_nodes + iD; + b2TreeNode* E = m_nodes + iE; + b2Assert(0 <= iD && iD < m_nodeCapacity); + b2Assert(0 <= iE && iE < m_nodeCapacity); + + // Swap A and B + B->child1 = iA; + B->parent = A->parent; + A->parent = iB; + + // A's old parent should point to B + if (B->parent != b2_nullNode) + { + if (m_nodes[B->parent].child1 == iA) + { + m_nodes[B->parent].child1 = iB; + } + else + { + b2Assert(m_nodes[B->parent].child2 == iA); + m_nodes[B->parent].child2 = iB; + } + } + else + { + m_root = iB; + } + + // Rotate + if (D->height > E->height) + { + B->child2 = iD; + A->child1 = iE; + E->parent = iA; + A->aabb.Combine(C->aabb, E->aabb); + B->aabb.Combine(A->aabb, D->aabb); + + A->height = 1 + b2Max(C->height, E->height); + B->height = 1 + b2Max(A->height, D->height); + } + else + { + B->child2 = iE; + A->child1 = iD; + D->parent = iA; + A->aabb.Combine(C->aabb, D->aabb); + B->aabb.Combine(A->aabb, E->aabb); + + A->height = 1 + b2Max(C->height, D->height); + B->height = 1 + b2Max(A->height, E->height); + } + + return iB; + } + + return iA; +} + +int32 b2DynamicTree::GetHeight() const +{ + if (m_root == b2_nullNode) + { + return 0; + } + + return m_nodes[m_root].height; +} + +// +float32 b2DynamicTree::GetAreaRatio() const +{ + if (m_root == b2_nullNode) + { + return 0.0f; + } + + const b2TreeNode* root = m_nodes + m_root; + float32 rootArea = root->aabb.GetPerimeter(); + + float32 totalArea = 0.0f; + for (int32 i = 0; i < m_nodeCapacity; ++i) + { + const b2TreeNode* node = m_nodes + i; + if (node->height < 0) + { + // Free node in pool + continue; + } + + totalArea += node->aabb.GetPerimeter(); + } + + return totalArea / rootArea; +} + +// Compute the height of a sub-tree. +int32 b2DynamicTree::ComputeHeight(int32 nodeId) const +{ + b2Assert(0 <= nodeId && nodeId < m_nodeCapacity); + b2TreeNode* node = m_nodes + nodeId; + + if (node->IsLeaf()) + { + return 0; + } + + int32 height1 = ComputeHeight(node->child1); + int32 height2 = ComputeHeight(node->child2); + return 1 + b2Max(height1, height2); +} + +int32 b2DynamicTree::ComputeHeight() const +{ + int32 height = ComputeHeight(m_root); + return height; +} + +void b2DynamicTree::ValidateStructure(int32 index) const +{ + if (index == b2_nullNode) + { + return; + } + + if (index == m_root) + { + b2Assert(m_nodes[index].parent == b2_nullNode); + } + + const b2TreeNode* node = m_nodes + index; + + int32 child1 = node->child1; + int32 child2 = node->child2; + + if (node->IsLeaf()) + { + b2Assert(child1 == b2_nullNode); + b2Assert(child2 == b2_nullNode); + b2Assert(node->height == 0); + return; + } + + b2Assert(0 <= child1 && child1 < m_nodeCapacity); + b2Assert(0 <= child2 && child2 < m_nodeCapacity); + + b2Assert(m_nodes[child1].parent == index); + b2Assert(m_nodes[child2].parent == index); + + ValidateStructure(child1); + ValidateStructure(child2); +} + +void b2DynamicTree::ValidateMetrics(int32 index) const +{ + if (index == b2_nullNode) + { + return; + } + + const b2TreeNode* node = m_nodes + index; + + int32 child1 = node->child1; + int32 child2 = node->child2; + + if (node->IsLeaf()) + { + b2Assert(child1 == b2_nullNode); + b2Assert(child2 == b2_nullNode); + b2Assert(node->height == 0); + return; + } + + b2Assert(0 <= child1 && child1 < m_nodeCapacity); + b2Assert(0 <= child2 && child2 < m_nodeCapacity); + + int32 height1 = m_nodes[child1].height; + int32 height2 = m_nodes[child2].height; + int32 height; + height = 1 + b2Max(height1, height2); + b2Assert(node->height == height); + + b2AABB aabb; + aabb.Combine(m_nodes[child1].aabb, m_nodes[child2].aabb); + + b2Assert(aabb.lowerBound == node->aabb.lowerBound); + b2Assert(aabb.upperBound == node->aabb.upperBound); + + ValidateMetrics(child1); + ValidateMetrics(child2); +} + +void b2DynamicTree::Validate() const +{ + ValidateStructure(m_root); + ValidateMetrics(m_root); + + int32 freeCount = 0; + int32 freeIndex = m_freeList; + while (freeIndex != b2_nullNode) + { + b2Assert(0 <= freeIndex && freeIndex < m_nodeCapacity); + freeIndex = m_nodes[freeIndex].next; + ++freeCount; + } + + b2Assert(GetHeight() == ComputeHeight()); + + b2Assert(m_nodeCount + freeCount == m_nodeCapacity); +} + +int32 b2DynamicTree::GetMaxBalance() const +{ + int32 maxBalance = 0; + for (int32 i = 0; i < m_nodeCapacity; ++i) + { + const b2TreeNode* node = m_nodes + i; + if (node->height <= 1) + { + continue; + } + + b2Assert(node->IsLeaf() == false); + + int32 child1 = node->child1; + int32 child2 = node->child2; + int32 balance = b2Abs(m_nodes[child2].height - m_nodes[child1].height); + maxBalance = b2Max(maxBalance, balance); + } + + return maxBalance; +} + +void b2DynamicTree::RebuildBottomUp() +{ + int32* nodes = (int32*)b2Alloc(m_nodeCount * sizeof(int32)); + int32 count = 0; + + // Build array of leaves. Free the rest. + for (int32 i = 0; i < m_nodeCapacity; ++i) + { + if (m_nodes[i].height < 0) + { + // free node in pool + continue; + } + + if (m_nodes[i].IsLeaf()) + { + m_nodes[i].parent = b2_nullNode; + nodes[count] = i; + ++count; + } + else + { + FreeNode(i); + } + } + + while (count > 1) + { + float32 minCost = b2_maxFloat; + int32 iMin = -1, jMin = -1; + for (int32 i = 0; i < count; ++i) + { + b2AABB aabbi = m_nodes[nodes[i]].aabb; + + for (int32 j = i + 1; j < count; ++j) + { + b2AABB aabbj = m_nodes[nodes[j]].aabb; + b2AABB b; + b.Combine(aabbi, aabbj); + float32 cost = b.GetPerimeter(); + if (cost < minCost) + { + iMin = i; + jMin = j; + minCost = cost; + } + } + } + + int32 index1 = nodes[iMin]; + int32 index2 = nodes[jMin]; + b2TreeNode* child1 = m_nodes + index1; + b2TreeNode* child2 = m_nodes + index2; + + int32 parentIndex = AllocateNode(); + b2TreeNode* parent = m_nodes + parentIndex; + parent->child1 = index1; + parent->child2 = index2; + parent->height = 1 + b2Max(child1->height, child2->height); + parent->aabb.Combine(child1->aabb, child2->aabb); + parent->parent = b2_nullNode; + + child1->parent = parentIndex; + child2->parent = parentIndex; + + nodes[jMin] = nodes[count-1]; + nodes[iMin] = parentIndex; + --count; + } + + m_root = nodes[0]; + b2Free(nodes); + + Validate(); +} diff --git a/external/Box2D/Collision/b2DynamicTree.h b/external/Box2D/Collision/b2DynamicTree.h new file mode 100644 index 0000000000..33f16b0f32 --- /dev/null +++ b/external/Box2D/Collision/b2DynamicTree.h @@ -0,0 +1,284 @@ +/* +* Copyright (c) 2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_DYNAMIC_TREE_H +#define B2_DYNAMIC_TREE_H + +#include +#include + +#define b2_nullNode (-1) + +/// A node in the dynamic tree. The client does not interact with this directly. +struct b2TreeNode +{ + bool IsLeaf() const + { + return child1 == b2_nullNode; + } + + /// Enlarged AABB + b2AABB aabb; + + void* userData; + + union + { + int32 parent; + int32 next; + }; + + int32 child1; + int32 child2; + + // leaf = 0, free node = -1 + int32 height; +}; + +/// A dynamic AABB tree broad-phase, inspired by Nathanael Presson's btDbvt. +/// A dynamic tree arranges data in a binary tree to accelerate +/// queries such as volume queries and ray casts. Leafs are proxies +/// with an AABB. In the tree we expand the proxy AABB by b2_fatAABBFactor +/// so that the proxy AABB is bigger than the client object. This allows the client +/// object to move by small amounts without triggering a tree update. +/// +/// Nodes are pooled and relocatable, so we use node indices rather than pointers. +class b2DynamicTree +{ +public: + /// Constructing the tree initializes the node pool. + b2DynamicTree(); + + /// Destroy the tree, freeing the node pool. + ~b2DynamicTree(); + + /// Create a proxy. Provide a tight fitting AABB and a userData pointer. + int32 CreateProxy(const b2AABB& aabb, void* userData); + + /// Destroy a proxy. This asserts if the id is invalid. + void DestroyProxy(int32 proxyId); + + /// Move a proxy with a swepted AABB. If the proxy has moved outside of its fattened AABB, + /// then the proxy is removed from the tree and re-inserted. Otherwise + /// the function returns immediately. + /// @return true if the proxy was re-inserted. + bool MoveProxy(int32 proxyId, const b2AABB& aabb1, const b2Vec2& displacement); + + /// Get proxy user data. + /// @return the proxy user data or 0 if the id is invalid. + void* GetUserData(int32 proxyId) const; + + /// Get the fat AABB for a proxy. + const b2AABB& GetFatAABB(int32 proxyId) const; + + /// Query an AABB for overlapping proxies. The callback class + /// is called for each proxy that overlaps the supplied AABB. + template + void Query(T* callback, const b2AABB& aabb) const; + + /// Ray-cast against the proxies in the tree. This relies on the callback + /// to perform a exact ray-cast in the case were the proxy contains a shape. + /// The callback also performs the any collision filtering. This has performance + /// roughly equal to k * log(n), where k is the number of collisions and n is the + /// number of proxies in the tree. + /// @param input the ray-cast input data. The ray extends from p1 to p1 + maxFraction * (p2 - p1). + /// @param callback a callback class that is called for each proxy that is hit by the ray. + template + void RayCast(T* callback, const b2RayCastInput& input) const; + + /// Validate this tree. For testing. + void Validate() const; + + /// Compute the height of the binary tree in O(N) time. Should not be + /// called often. + int32 GetHeight() const; + + /// Get the maximum balance of an node in the tree. The balance is the difference + /// in height of the two children of a node. + int32 GetMaxBalance() const; + + /// Get the ratio of the sum of the node areas to the root area. + float32 GetAreaRatio() const; + + /// Build an optimal tree. Very expensive. For testing. + void RebuildBottomUp(); + +private: + + int32 AllocateNode(); + void FreeNode(int32 node); + + void InsertLeaf(int32 node); + void RemoveLeaf(int32 node); + + int32 Balance(int32 index); + + int32 ComputeHeight() const; + int32 ComputeHeight(int32 nodeId) const; + + void ValidateStructure(int32 index) const; + void ValidateMetrics(int32 index) const; + + int32 m_root; + + b2TreeNode* m_nodes; + int32 m_nodeCount; + int32 m_nodeCapacity; + + int32 m_freeList; + + /// This is used to incrementally traverse the tree for re-balancing. + uint32 m_path; + + int32 m_insertionCount; +}; + +inline void* b2DynamicTree::GetUserData(int32 proxyId) const +{ + b2Assert(0 <= proxyId && proxyId < m_nodeCapacity); + return m_nodes[proxyId].userData; +} + +inline const b2AABB& b2DynamicTree::GetFatAABB(int32 proxyId) const +{ + b2Assert(0 <= proxyId && proxyId < m_nodeCapacity); + return m_nodes[proxyId].aabb; +} + +template +inline void b2DynamicTree::Query(T* callback, const b2AABB& aabb) const +{ + b2GrowableStack stack; + stack.Push(m_root); + + while (stack.GetCount() > 0) + { + int32 nodeId = stack.Pop(); + if (nodeId == b2_nullNode) + { + continue; + } + + const b2TreeNode* node = m_nodes + nodeId; + + if (b2TestOverlap(node->aabb, aabb)) + { + if (node->IsLeaf()) + { + bool proceed = callback->QueryCallback(nodeId); + if (proceed == false) + { + return; + } + } + else + { + stack.Push(node->child1); + stack.Push(node->child2); + } + } + } +} + +template +inline void b2DynamicTree::RayCast(T* callback, const b2RayCastInput& input) const +{ + b2Vec2 p1 = input.p1; + b2Vec2 p2 = input.p2; + b2Vec2 r = p2 - p1; + b2Assert(r.LengthSquared() > 0.0f); + r.Normalize(); + + // v is perpendicular to the segment. + b2Vec2 v = b2Cross(1.0f, r); + b2Vec2 abs_v = b2Abs(v); + + // Separating axis for segment (Gino, p80). + // |dot(v, p1 - c)| > dot(|v|, h) + + float32 maxFraction = input.maxFraction; + + // Build a bounding box for the segment. + b2AABB segmentAABB; + { + b2Vec2 t = p1 + maxFraction * (p2 - p1); + segmentAABB.lowerBound = b2Min(p1, t); + segmentAABB.upperBound = b2Max(p1, t); + } + + b2GrowableStack stack; + stack.Push(m_root); + + while (stack.GetCount() > 0) + { + int32 nodeId = stack.Pop(); + if (nodeId == b2_nullNode) + { + continue; + } + + const b2TreeNode* node = m_nodes + nodeId; + + if (b2TestOverlap(node->aabb, segmentAABB) == false) + { + continue; + } + + // Separating axis for segment (Gino, p80). + // |dot(v, p1 - c)| > dot(|v|, h) + b2Vec2 c = node->aabb.GetCenter(); + b2Vec2 h = node->aabb.GetExtents(); + float32 separation = b2Abs(b2Dot(v, p1 - c)) - b2Dot(abs_v, h); + if (separation > 0.0f) + { + continue; + } + + if (node->IsLeaf()) + { + b2RayCastInput subInput; + subInput.p1 = input.p1; + subInput.p2 = input.p2; + subInput.maxFraction = maxFraction; + + float32 value = callback->RayCastCallback(subInput, nodeId); + + if (value == 0.0f) + { + // The client has terminated the ray cast. + return; + } + + if (value > 0.0f) + { + // Update segment bounding box. + maxFraction = value; + b2Vec2 t = p1 + maxFraction * (p2 - p1); + segmentAABB.lowerBound = b2Min(p1, t); + segmentAABB.upperBound = b2Max(p1, t); + } + } + else + { + stack.Push(node->child1); + stack.Push(node->child2); + } + } +} + +#endif diff --git a/external/Box2D/Collision/b2TimeOfImpact.cpp b/external/Box2D/Collision/b2TimeOfImpact.cpp new file mode 100644 index 0000000000..1d643addd8 --- /dev/null +++ b/external/Box2D/Collision/b2TimeOfImpact.cpp @@ -0,0 +1,488 @@ +/* +* Copyright (c) 2007-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include +#include +#include + +#ifdef SHP +#include +#else +#include +#endif + +using namespace std; + +int32 b2_toiCalls, b2_toiIters, b2_toiMaxIters; +int32 b2_toiRootIters, b2_toiMaxRootIters; + +struct b2SeparationFunction +{ + enum Type + { + e_points, + e_faceA, + e_faceB + }; + + // TODO_ERIN might not need to return the separation + + float32 Initialize(const b2SimplexCache* cache, + const b2DistanceProxy* proxyA, const b2Sweep& sweepA, + const b2DistanceProxy* proxyB, const b2Sweep& sweepB, + float32 t1) + { + m_proxyA = proxyA; + m_proxyB = proxyB; + int32 count = cache->count; + b2Assert(0 < count && count < 3); + + m_sweepA = sweepA; + m_sweepB = sweepB; + + b2Transform xfA, xfB; + m_sweepA.GetTransform(&xfA, t1); + m_sweepB.GetTransform(&xfB, t1); + + if (count == 1) + { + m_type = e_points; + b2Vec2 localPointA = m_proxyA->GetVertex(cache->indexA[0]); + b2Vec2 localPointB = m_proxyB->GetVertex(cache->indexB[0]); + b2Vec2 pointA = b2Mul(xfA, localPointA); + b2Vec2 pointB = b2Mul(xfB, localPointB); + m_axis = pointB - pointA; + float32 s = m_axis.Normalize(); + return s; + } + else if (cache->indexA[0] == cache->indexA[1]) + { + // Two points on B and one on A. + m_type = e_faceB; + b2Vec2 localPointB1 = proxyB->GetVertex(cache->indexB[0]); + b2Vec2 localPointB2 = proxyB->GetVertex(cache->indexB[1]); + + m_axis = b2Cross(localPointB2 - localPointB1, 1.0f); + m_axis.Normalize(); + b2Vec2 normal = b2Mul(xfB.q, m_axis); + + m_localPoint = 0.5f * (localPointB1 + localPointB2); + b2Vec2 pointB = b2Mul(xfB, m_localPoint); + + b2Vec2 localPointA = proxyA->GetVertex(cache->indexA[0]); + b2Vec2 pointA = b2Mul(xfA, localPointA); + + float32 s = b2Dot(pointA - pointB, normal); + if (s < 0.0f) + { + m_axis = -m_axis; + s = -s; + } + return s; + } + else + { + // Two points on A and one or two points on B. + m_type = e_faceA; + b2Vec2 localPointA1 = m_proxyA->GetVertex(cache->indexA[0]); + b2Vec2 localPointA2 = m_proxyA->GetVertex(cache->indexA[1]); + + m_axis = b2Cross(localPointA2 - localPointA1, 1.0f); + m_axis.Normalize(); + b2Vec2 normal = b2Mul(xfA.q, m_axis); + + m_localPoint = 0.5f * (localPointA1 + localPointA2); + b2Vec2 pointA = b2Mul(xfA, m_localPoint); + + b2Vec2 localPointB = m_proxyB->GetVertex(cache->indexB[0]); + b2Vec2 pointB = b2Mul(xfB, localPointB); + + float32 s = b2Dot(pointB - pointA, normal); + if (s < 0.0f) + { + m_axis = -m_axis; + s = -s; + } + return s; + } + } + + float32 FindMinSeparation(int32* indexA, int32* indexB, float32 t) const + { + b2Transform xfA, xfB; + m_sweepA.GetTransform(&xfA, t); + m_sweepB.GetTransform(&xfB, t); + + switch (m_type) + { + case e_points: + { + b2Vec2 axisA = b2MulT(xfA.q, m_axis); + b2Vec2 axisB = b2MulT(xfB.q, -m_axis); + + *indexA = m_proxyA->GetSupport(axisA); + *indexB = m_proxyB->GetSupport(axisB); + + b2Vec2 localPointA = m_proxyA->GetVertex(*indexA); + b2Vec2 localPointB = m_proxyB->GetVertex(*indexB); + + b2Vec2 pointA = b2Mul(xfA, localPointA); + b2Vec2 pointB = b2Mul(xfB, localPointB); + + float32 separation = b2Dot(pointB - pointA, m_axis); + return separation; + } + + case e_faceA: + { + b2Vec2 normal = b2Mul(xfA.q, m_axis); + b2Vec2 pointA = b2Mul(xfA, m_localPoint); + + b2Vec2 axisB = b2MulT(xfB.q, -normal); + + *indexA = -1; + *indexB = m_proxyB->GetSupport(axisB); + + b2Vec2 localPointB = m_proxyB->GetVertex(*indexB); + b2Vec2 pointB = b2Mul(xfB, localPointB); + + float32 separation = b2Dot(pointB - pointA, normal); + return separation; + } + + case e_faceB: + { + b2Vec2 normal = b2Mul(xfB.q, m_axis); + b2Vec2 pointB = b2Mul(xfB, m_localPoint); + + b2Vec2 axisA = b2MulT(xfA.q, -normal); + + *indexB = -1; + *indexA = m_proxyA->GetSupport(axisA); + + b2Vec2 localPointA = m_proxyA->GetVertex(*indexA); + b2Vec2 pointA = b2Mul(xfA, localPointA); + + float32 separation = b2Dot(pointA - pointB, normal); + return separation; + } + + default: + b2Assert(false); + *indexA = -1; + *indexB = -1; + return 0.0f; + } + } + + float32 Evaluate(int32 indexA, int32 indexB, float32 t) const + { + b2Transform xfA, xfB; + m_sweepA.GetTransform(&xfA, t); + m_sweepB.GetTransform(&xfB, t); + + switch (m_type) + { + case e_points: + { + b2Vec2 axisA = b2MulT(xfA.q, m_axis); + b2Vec2 axisB = b2MulT(xfB.q, -m_axis); + + b2Vec2 localPointA = m_proxyA->GetVertex(indexA); + b2Vec2 localPointB = m_proxyB->GetVertex(indexB); + + b2Vec2 pointA = b2Mul(xfA, localPointA); + b2Vec2 pointB = b2Mul(xfB, localPointB); + float32 separation = b2Dot(pointB - pointA, m_axis); + + return separation; + } + + case e_faceA: + { + b2Vec2 normal = b2Mul(xfA.q, m_axis); + b2Vec2 pointA = b2Mul(xfA, m_localPoint); + + b2Vec2 axisB = b2MulT(xfB.q, -normal); + + b2Vec2 localPointB = m_proxyB->GetVertex(indexB); + b2Vec2 pointB = b2Mul(xfB, localPointB); + + float32 separation = b2Dot(pointB - pointA, normal); + return separation; + } + + case e_faceB: + { + b2Vec2 normal = b2Mul(xfB.q, m_axis); + b2Vec2 pointB = b2Mul(xfB, m_localPoint); + + b2Vec2 axisA = b2MulT(xfA.q, -normal); + + b2Vec2 localPointA = m_proxyA->GetVertex(indexA); + b2Vec2 pointA = b2Mul(xfA, localPointA); + + float32 separation = b2Dot(pointA - pointB, normal); + return separation; + } + + default: + b2Assert(false); + return 0.0f; + } + } + + const b2DistanceProxy* m_proxyA; + const b2DistanceProxy* m_proxyB; + b2Sweep m_sweepA, m_sweepB; + Type m_type; + b2Vec2 m_localPoint; + b2Vec2 m_axis; +}; + +// CCD via the local separating axis method. This seeks progression +// by computing the largest time at which separation is maintained. +void b2TimeOfImpact(b2TOIOutput* output, const b2TOIInput* input) +{ + ++b2_toiCalls; + + output->state = b2TOIOutput::e_unknown; + output->t = input->tMax; + + const b2DistanceProxy* proxyA = &input->proxyA; + const b2DistanceProxy* proxyB = &input->proxyB; + + b2Sweep sweepA = input->sweepA; + b2Sweep sweepB = input->sweepB; + + // Large rotations can make the root finder fail, so we normalize the + // sweep angles. + sweepA.Normalize(); + sweepB.Normalize(); + + float32 tMax = input->tMax; + + float32 totalRadius = proxyA->m_radius + proxyB->m_radius; + float32 target = b2Max(b2_linearSlop, totalRadius - 3.0f * b2_linearSlop); + float32 tolerance = 0.25f * b2_linearSlop; + b2Assert(target > tolerance); + + float32 t1 = 0.0f; + const int32 k_maxIterations = 20; // TODO_ERIN b2Settings + int32 iter = 0; + + // Prepare input for distance query. + b2SimplexCache cache; + cache.count = 0; + b2DistanceInput distanceInput; + distanceInput.proxyA = input->proxyA; + distanceInput.proxyB = input->proxyB; + distanceInput.useRadii = false; + + // The outer loop progressively attempts to compute new separating axes. + // This loop terminates when an axis is repeated (no progress is made). + for(;;) + { + b2Transform xfA, xfB; + sweepA.GetTransform(&xfA, t1); + sweepB.GetTransform(&xfB, t1); + + // Get the distance between shapes. We can also use the results + // to get a separating axis. + distanceInput.transformA = xfA; + distanceInput.transformB = xfB; + b2DistanceOutput distanceOutput; + b2Distance(&distanceOutput, &cache, &distanceInput); + + // If the shapes are overlapped, we give up on continuous collision. + if (distanceOutput.distance <= 0.0f) + { + // Failure! + output->state = b2TOIOutput::e_overlapped; + output->t = 0.0f; + break; + } + + if (distanceOutput.distance < target + tolerance) + { + // Victory! + output->state = b2TOIOutput::e_touching; + output->t = t1; + break; + } + + // Initialize the separating axis. + b2SeparationFunction fcn; + fcn.Initialize(&cache, proxyA, sweepA, proxyB, sweepB, t1); +#if 0 + // Dump the curve seen by the root finder + { + const int32 N = 100; + float32 dx = 1.0f / N; + float32 xs[N+1]; + float32 fs[N+1]; + + float32 x = 0.0f; + + for (int32 i = 0; i <= N; ++i) + { + sweepA.GetTransform(&xfA, x); + sweepB.GetTransform(&xfB, x); + float32 f = fcn.Evaluate(xfA, xfB) - target; + + printf("%g %g\n", x, f); + + xs[i] = x; + fs[i] = f; + + x += dx; + } + } +#endif + + // Compute the TOI on the separating axis. We do this by successively + // resolving the deepest point. This loop is bounded by the number of vertices. + bool done = false; + float32 t2 = tMax; + int32 pushBackIter = 0; + for (;;) + { + // Find the deepest point at t2. Store the witness point indices. + int32 indexA, indexB; + float32 s2 = fcn.FindMinSeparation(&indexA, &indexB, t2); + + // Is the final configuration separated? + if (s2 > target + tolerance) + { + // Victory! + output->state = b2TOIOutput::e_separated; + output->t = tMax; + done = true; + break; + } + + // Has the separation reached tolerance? + if (s2 > target - tolerance) + { + // Advance the sweeps + t1 = t2; + break; + } + + // Compute the initial separation of the witness points. + float32 s1 = fcn.Evaluate(indexA, indexB, t1); + + // Check for initial overlap. This might happen if the root finder + // runs out of iterations. + if (s1 < target - tolerance) + { + output->state = b2TOIOutput::e_failed; + output->t = t1; + done = true; + break; + } + + // Check for touching + if (s1 <= target + tolerance) + { + // Victory! t1 should hold the TOI (could be 0.0). + output->state = b2TOIOutput::e_touching; + output->t = t1; + done = true; + break; + } + + // Compute 1D root of: f(x) - target = 0 + int32 rootIterCount = 0; + float32 a1 = t1, a2 = t2; + for (;;) + { + // Use a mix of the secant rule and bisection. + float32 t; + if (rootIterCount & 1) + { + // Secant rule to improve convergence. + t = a1 + (target - s1) * (a2 - a1) / (s2 - s1); + } + else + { + // Bisection to guarantee progress. + t = 0.5f * (a1 + a2); + } + + float32 s = fcn.Evaluate(indexA, indexB, t); + + if (b2Abs(s - target) < tolerance) + { + // t2 holds a tentative value for t1 + t2 = t; + break; + } + + // Ensure we continue to bracket the root. + if (s > target) + { + a1 = t; + s1 = s; + } + else + { + a2 = t; + s2 = s; + } + + ++rootIterCount; + ++b2_toiRootIters; + + if (rootIterCount == 50) + { + break; + } + } + + b2_toiMaxRootIters = b2Max(b2_toiMaxRootIters, rootIterCount); + + ++pushBackIter; + + if (pushBackIter == b2_maxPolygonVertices) + { + break; + } + } + + ++iter; + ++b2_toiIters; + + if (done) + { + break; + } + + if (iter == k_maxIterations) + { + // Root finder got stuck. Semi-victory. + output->state = b2TOIOutput::e_failed; + output->t = t1; + break; + } + } + + b2_toiMaxIters = b2Max(b2_toiMaxIters, iter); +} diff --git a/external/Box2D/Collision/b2TimeOfImpact.h b/external/Box2D/Collision/b2TimeOfImpact.h new file mode 100644 index 0000000000..2e4f8228ff --- /dev/null +++ b/external/Box2D/Collision/b2TimeOfImpact.h @@ -0,0 +1,58 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_TIME_OF_IMPACT_H +#define B2_TIME_OF_IMPACT_H + +#include +#include + +/// Input parameters for b2TimeOfImpact +struct b2TOIInput +{ + b2DistanceProxy proxyA; + b2DistanceProxy proxyB; + b2Sweep sweepA; + b2Sweep sweepB; + float32 tMax; // defines sweep interval [0, tMax] +}; + +// Output parameters for b2TimeOfImpact. +struct b2TOIOutput +{ + enum State + { + e_unknown, + e_failed, + e_overlapped, + e_touching, + e_separated + }; + + State state; + float32 t; +}; + +/// Compute the upper bound on time before two shapes penetrate. Time is represented as +/// a fraction between [0,tMax]. This uses a swept separating axis and may miss some intermediate, +/// non-tunneling collision. If you change the time interval, you should call this function +/// again. +/// Note: use b2Distance to compute the contact point and normal at the time of impact. +void b2TimeOfImpact(b2TOIOutput* output, const b2TOIInput* input); + +#endif diff --git a/external/Box2D/Common/b2BlockAllocator.cpp b/external/Box2D/Common/b2BlockAllocator.cpp new file mode 100644 index 0000000000..2e862091f9 --- /dev/null +++ b/external/Box2D/Common/b2BlockAllocator.cpp @@ -0,0 +1,218 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include +#include +#include + +using namespace std; + +int32 b2BlockAllocator::s_blockSizes[b2_blockSizes] = +{ + 16, // 0 + 32, // 1 + 64, // 2 + 96, // 3 + 128, // 4 + 160, // 5 + 192, // 6 + 224, // 7 + 256, // 8 + 320, // 9 + 384, // 10 + 448, // 11 + 512, // 12 + 640, // 13 +}; +uint8 b2BlockAllocator::s_blockSizeLookup[b2_maxBlockSize + 1]; +bool b2BlockAllocator::s_blockSizeLookupInitialized; + +struct b2Chunk +{ + int32 blockSize; + b2Block* blocks; +}; + +struct b2Block +{ + b2Block* next; +}; + +b2BlockAllocator::b2BlockAllocator() +{ + b2Assert(b2_blockSizes < UCHAR_MAX); + + m_chunkSpace = b2_chunkArrayIncrement; + m_chunkCount = 0; + m_chunks = (b2Chunk*)b2Alloc(m_chunkSpace * sizeof(b2Chunk)); + + memset(m_chunks, 0, m_chunkSpace * sizeof(b2Chunk)); + memset(m_freeLists, 0, sizeof(m_freeLists)); + + if (s_blockSizeLookupInitialized == false) + { + int32 j = 0; + for (int32 i = 1; i <= b2_maxBlockSize; ++i) + { + b2Assert(j < b2_blockSizes); + if (i <= s_blockSizes[j]) + { + s_blockSizeLookup[i] = (uint8)j; + } + else + { + ++j; + s_blockSizeLookup[i] = (uint8)j; + } + } + + s_blockSizeLookupInitialized = true; + } +} + +b2BlockAllocator::~b2BlockAllocator() +{ + for (int32 i = 0; i < m_chunkCount; ++i) + { + b2Free(m_chunks[i].blocks); + } + + b2Free(m_chunks); +} + +void* b2BlockAllocator::Allocate(int32 size) +{ + if (size == 0) + return NULL; + + b2Assert(0 < size); + + if (size > b2_maxBlockSize) + { + return b2Alloc(size); + } + + int32 index = s_blockSizeLookup[size]; + b2Assert(0 <= index && index < b2_blockSizes); + + if (m_freeLists[index]) + { + b2Block* block = m_freeLists[index]; + m_freeLists[index] = block->next; + return block; + } + else + { + if (m_chunkCount == m_chunkSpace) + { + b2Chunk* oldChunks = m_chunks; + m_chunkSpace += b2_chunkArrayIncrement; + m_chunks = (b2Chunk*)b2Alloc(m_chunkSpace * sizeof(b2Chunk)); + memcpy(m_chunks, oldChunks, m_chunkCount * sizeof(b2Chunk)); + memset(m_chunks + m_chunkCount, 0, b2_chunkArrayIncrement * sizeof(b2Chunk)); + b2Free(oldChunks); + } + + b2Chunk* chunk = m_chunks + m_chunkCount; + chunk->blocks = (b2Block*)b2Alloc(b2_chunkSize); +#if defined(_DEBUG) + memset(chunk->blocks, 0xcd, b2_chunkSize); +#endif + int32 blockSize = s_blockSizes[index]; + chunk->blockSize = blockSize; + int32 blockCount = b2_chunkSize / blockSize; + b2Assert(blockCount * blockSize <= b2_chunkSize); + for (int32 i = 0; i < blockCount - 1; ++i) + { + b2Block* block = (b2Block*)((int8*)chunk->blocks + blockSize * i); + b2Block* next = (b2Block*)((int8*)chunk->blocks + blockSize * (i + 1)); + block->next = next; + } + b2Block* last = (b2Block*)((int8*)chunk->blocks + blockSize * (blockCount - 1)); + last->next = NULL; + + m_freeLists[index] = chunk->blocks->next; + ++m_chunkCount; + + return chunk->blocks; + } +} + +void b2BlockAllocator::Free(void* p, int32 size) +{ + if (size == 0) + { + return; + } + + b2Assert(0 < size); + + if (size > b2_maxBlockSize) + { + b2Free(p); + return; + } + + int32 index = s_blockSizeLookup[size]; + b2Assert(0 <= index && index < b2_blockSizes); + +#ifdef _DEBUG + // Verify the memory address and size is valid. + int32 blockSize = s_blockSizes[index]; + bool found = false; + for (int32 i = 0; i < m_chunkCount; ++i) + { + b2Chunk* chunk = m_chunks + i; + if (chunk->blockSize != blockSize) + { + b2Assert( (int8*)p + blockSize <= (int8*)chunk->blocks || + (int8*)chunk->blocks + b2_chunkSize <= (int8*)p); + } + else + { + if ((int8*)chunk->blocks <= (int8*)p && (int8*)p + blockSize <= (int8*)chunk->blocks + b2_chunkSize) + { + found = true; + } + } + } + + b2Assert(found); + + memset(p, 0xfd, blockSize); +#endif + + b2Block* block = (b2Block*)p; + block->next = m_freeLists[index]; + m_freeLists[index] = block; +} + +void b2BlockAllocator::Clear() +{ + for (int32 i = 0; i < m_chunkCount; ++i) + { + b2Free(m_chunks[i].blocks); + } + + m_chunkCount = 0; + memset(m_chunks, 0, m_chunkSpace * sizeof(b2Chunk)); + + memset(m_freeLists, 0, sizeof(m_freeLists)); +} diff --git a/external/Box2D/Common/b2BlockAllocator.h b/external/Box2D/Common/b2BlockAllocator.h new file mode 100644 index 0000000000..ec221fdf61 --- /dev/null +++ b/external/Box2D/Common/b2BlockAllocator.h @@ -0,0 +1,62 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_BLOCK_ALLOCATOR_H +#define B2_BLOCK_ALLOCATOR_H + +#include + +const int32 b2_chunkSize = 16 * 1024; +const int32 b2_maxBlockSize = 640; +const int32 b2_blockSizes = 14; +const int32 b2_chunkArrayIncrement = 128; + +struct b2Block; +struct b2Chunk; + +/// This is a small object allocator used for allocating small +/// objects that persist for more than one time step. +/// See: http://www.codeproject.com/useritems/Small_Block_Allocator.asp +class b2BlockAllocator +{ +public: + b2BlockAllocator(); + ~b2BlockAllocator(); + + /// Allocate memory. This will use b2Alloc if the size is larger than b2_maxBlockSize. + void* Allocate(int32 size); + + /// Free memory. This will use b2Free if the size is larger than b2_maxBlockSize. + void Free(void* p, int32 size); + + void Clear(); + +private: + + b2Chunk* m_chunks; + int32 m_chunkCount; + int32 m_chunkSpace; + + b2Block* m_freeLists[b2_blockSizes]; + + static int32 s_blockSizes[b2_blockSizes]; + static uint8 s_blockSizeLookup[b2_maxBlockSize + 1]; + static bool s_blockSizeLookupInitialized; +}; + +#endif diff --git a/external/Box2D/Common/b2Draw.cpp b/external/Box2D/Common/b2Draw.cpp new file mode 100644 index 0000000000..cb760025e9 --- /dev/null +++ b/external/Box2D/Common/b2Draw.cpp @@ -0,0 +1,44 @@ +/* +* Copyright (c) 2011 Erin Catto http://box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include + +b2Draw::b2Draw() +{ + m_drawFlags = 0; +} + +void b2Draw::SetFlags(uint32 flags) +{ + m_drawFlags = flags; +} + +uint32 b2Draw::GetFlags() const +{ + return m_drawFlags; +} + +void b2Draw::AppendFlags(uint32 flags) +{ + m_drawFlags |= flags; +} + +void b2Draw::ClearFlags(uint32 flags) +{ + m_drawFlags &= ~flags; +} diff --git a/external/Box2D/Common/b2Draw.h b/external/Box2D/Common/b2Draw.h new file mode 100644 index 0000000000..b33cd8d38f --- /dev/null +++ b/external/Box2D/Common/b2Draw.h @@ -0,0 +1,81 @@ +/* +* Copyright (c) 2011 Erin Catto http://box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include + +/// Color for debug drawing. Each value has the range [0,1]. +struct b2Color +{ + b2Color() {} + b2Color(float32 r, float32 g, float32 b) : r(r), g(g), b(b) {} + void Set(float32 ri, float32 gi, float32 bi) { r = ri; g = gi; b = bi; } + float32 r, g, b; +}; + +/// Implement and register this class with a b2World to provide debug drawing of physics +/// entities in your game. +class b2Draw +{ +public: + b2Draw(); + + virtual ~b2Draw() {} + + enum + { + e_shapeBit = 0x0001, ///< draw shapes + e_jointBit = 0x0002, ///< draw joint connections + e_aabbBit = 0x0004, ///< draw axis aligned bounding boxes + e_pairBit = 0x0008, ///< draw broad-phase pairs + e_centerOfMassBit = 0x0010 ///< draw center of mass frame + }; + + /// Set the drawing flags. + void SetFlags(uint32 flags); + + /// Get the drawing flags. + uint32 GetFlags() const; + + /// Append flags to the current flags. + void AppendFlags(uint32 flags); + + /// Clear flags from the current flags. + void ClearFlags(uint32 flags); + + /// Draw a closed polygon provided in CCW order. + virtual void DrawPolygon(const b2Vec2* vertices, int32 vertexCount, const b2Color& color) = 0; + + /// Draw a solid closed polygon provided in CCW order. + virtual void DrawSolidPolygon(const b2Vec2* vertices, int32 vertexCount, const b2Color& color) = 0; + + /// Draw a circle. + virtual void DrawCircle(const b2Vec2& center, float32 radius, const b2Color& color) = 0; + + /// Draw a solid circle. + virtual void DrawSolidCircle(const b2Vec2& center, float32 radius, const b2Vec2& axis, const b2Color& color) = 0; + + /// Draw a line segment. + virtual void DrawSegment(const b2Vec2& p1, const b2Vec2& p2, const b2Color& color) = 0; + + /// Draw a transform. Choose your own length scale. + /// @param xf a transform. + virtual void DrawTransform(const b2Transform& xf) = 0; + +protected: + uint32 m_drawFlags; +}; diff --git a/external/Box2D/Common/b2GrowableStack.h b/external/Box2D/Common/b2GrowableStack.h new file mode 100644 index 0000000000..68809521f4 --- /dev/null +++ b/external/Box2D/Common/b2GrowableStack.h @@ -0,0 +1,85 @@ +/* +* Copyright (c) 2010 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_GROWABLE_STACK_H +#define B2_GROWABLE_STACK_H +#include +#include + +/// This is a growable LIFO stack with an initial capacity of N. +/// If the stack size exceeds the initial capacity, the heap is used +/// to increase the size of the stack. +template +class b2GrowableStack +{ +public: + b2GrowableStack() + { + m_stack = m_array; + m_count = 0; + m_capacity = N; + } + + ~b2GrowableStack() + { + if (m_stack != m_array) + { + b2Free(m_stack); + m_stack = NULL; + } + } + + void Push(const T& element) + { + if (m_count == m_capacity) + { + T* old = m_stack; + m_capacity *= 2; + m_stack = (T*)b2Alloc(m_capacity * sizeof(T)); + std::memcpy(m_stack, old, m_count * sizeof(T)); + if (old != m_array) + { + b2Free(old); + } + } + + m_stack[m_count] = element; + ++m_count; + } + + T Pop() + { + b2Assert(m_count > 0); + --m_count; + return m_stack[m_count]; + } + + int32 GetCount() + { + return m_count; + } + +private: + T* m_stack; + T m_array[N]; + int32 m_count; + int32 m_capacity; +}; + + +#endif diff --git a/external/Box2D/Common/b2Math.cpp b/external/Box2D/Common/b2Math.cpp new file mode 100644 index 0000000000..15d68fce96 --- /dev/null +++ b/external/Box2D/Common/b2Math.cpp @@ -0,0 +1,94 @@ +/* +* Copyright (c) 2007-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include + +const b2Vec2 b2Vec2_zero(0.0f, 0.0f); + +/// Solve A * x = b, where b is a column vector. This is more efficient +/// than computing the inverse in one-shot cases. +b2Vec3 b2Mat33::Solve33(const b2Vec3& b) const +{ + float32 det = b2Dot(ex, b2Cross(ey, ez)); + if (det != 0.0f) + { + det = 1.0f / det; + } + b2Vec3 x; + x.x = det * b2Dot(b, b2Cross(ey, ez)); + x.y = det * b2Dot(ex, b2Cross(b, ez)); + x.z = det * b2Dot(ex, b2Cross(ey, b)); + return x; +} + +/// Solve A * x = b, where b is a column vector. This is more efficient +/// than computing the inverse in one-shot cases. +b2Vec2 b2Mat33::Solve22(const b2Vec2& b) const +{ + float32 a11 = ex.x, a12 = ey.x, a21 = ex.y, a22 = ey.y; + float32 det = a11 * a22 - a12 * a21; + if (det != 0.0f) + { + det = 1.0f / det; + } + b2Vec2 x; + x.x = det * (a22 * b.x - a12 * b.y); + x.y = det * (a11 * b.y - a21 * b.x); + return x; +} + +/// +void b2Mat33::GetInverse22(b2Mat33* M) const +{ + float32 a = ex.x, b = ey.x, c = ex.y, d = ey.y; + float32 det = a * d - b * c; + if (det != 0.0f) + { + det = 1.0f / det; + } + + M->ex.x = det * d; M->ey.x = -det * b; M->ex.z = 0.0f; + M->ex.y = -det * c; M->ey.y = det * a; M->ey.z = 0.0f; + M->ez.x = 0.0f; M->ez.y = 0.0f; M->ez.z = 0.0f; +} + +/// Returns the zero matrix if singular. +void b2Mat33::GetSymInverse33(b2Mat33* M) const +{ + float32 det = b2Dot(ex, b2Cross(ey, ez)); + if (det != 0.0f) + { + det = 1.0f / det; + } + + float32 a11 = ex.x, a12 = ey.x, a13 = ez.x; + float32 a22 = ey.y, a23 = ez.y; + float32 a33 = ez.z; + + M->ex.x = det * (a22 * a33 - a23 * a23); + M->ex.y = det * (a13 * a23 - a12 * a33); + M->ex.z = det * (a12 * a23 - a13 * a22); + + M->ey.x = M->ex.y; + M->ey.y = det * (a11 * a33 - a13 * a13); + M->ey.z = det * (a13 * a12 - a11 * a23); + + M->ez.x = M->ex.z; + M->ez.y = M->ey.z; + M->ez.z = det * (a11 * a22 - a12 * a12); +} diff --git a/external/Box2D/Common/b2Math.h b/external/Box2D/Common/b2Math.h new file mode 100644 index 0000000000..a6be671139 --- /dev/null +++ b/external/Box2D/Common/b2Math.h @@ -0,0 +1,738 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_MATH_H +#define B2_MATH_H + +#include + +#include +#ifndef SHP +#include +#else +#include +#endif +#include +#include + +using namespace std; + + +/// This function is used to ensure that a floating point number is +/// not a NaN or infinity. +inline bool b2IsValid(float32 x) +{ + if (x != x) + { + // NaN. + return false; + } + + float32 infinity = std::numeric_limits::infinity(); + return -infinity < x && x < infinity; +} + +/// This is a approximate yet fast inverse square-root. +inline float32 b2InvSqrt(float32 x) +{ + union + { + float32 x; + int32 i; + } convert; + + convert.x = x; + float32 xhalf = 0.5f * x; + convert.i = 0x5f3759df - (convert.i >> 1); + x = convert.x; + x = x * (1.5f - xhalf * x * x); + return x; +} + +#define b2Sqrt(x) std::sqrt(x) +#define b2Atan2(y, x) std::atan2(y, x) + +/// A 2D column vector. +struct b2Vec2 +{ + /// Default constructor does nothing (for performance). + b2Vec2() {} + + /// Construct using coordinates. + b2Vec2(float32 x, float32 y) : x(x), y(y) {} + + /// Set this vector to all zeros. + void SetZero() { x = 0.0f; y = 0.0f; } + + /// Set this vector to some specified coordinates. + void Set(float32 x_, float32 y_) { x = x_; y = y_; } + + /// Negate this vector. + b2Vec2 operator -() const { b2Vec2 v; v.Set(-x, -y); return v; } + + /// Read from and indexed element. + float32 operator () (int32 i) const + { + return (&x)[i]; + } + + /// Write to an indexed element. + float32& operator () (int32 i) + { + return (&x)[i]; + } + + /// Add a vector to this vector. + void operator += (const b2Vec2& v) + { + x += v.x; y += v.y; + } + + /// Subtract a vector from this vector. + void operator -= (const b2Vec2& v) + { + x -= v.x; y -= v.y; + } + + /// Multiply this vector by a scalar. + void operator *= (float32 a) + { + x *= a; y *= a; + } + + /// Get the length of this vector (the norm). + float32 Length() const + { + return b2Sqrt(x * x + y * y); + } + + /// Get the length squared. For performance, use this instead of + /// b2Vec2::Length (if possible). + float32 LengthSquared() const + { + return x * x + y * y; + } + + /// Convert this vector into a unit vector. Returns the length. + float32 Normalize() + { + float32 length = Length(); + if (length < b2_epsilon) + { + return 0.0f; + } + float32 invLength = 1.0f / length; + x *= invLength; + y *= invLength; + + return length; + } + + /// Does this vector contain finite coordinates? + bool IsValid() const + { + return b2IsValid(x) && b2IsValid(y); + } + + /// Get the skew vector such that dot(skew_vec, other) == cross(vec, other) + b2Vec2 Skew() const + { + return b2Vec2(-y, x); + } + + float32 x, y; +}; + +/// A 2D column vector with 3 elements. +struct b2Vec3 +{ + /// Default constructor does nothing (for performance). + b2Vec3() {} + + /// Construct using coordinates. + b2Vec3(float32 x, float32 y, float32 z) : x(x), y(y), z(z) {} + + /// Set this vector to all zeros. + void SetZero() { x = 0.0f; y = 0.0f; z = 0.0f; } + + /// Set this vector to some specified coordinates. + void Set(float32 x_, float32 y_, float32 z_) { x = x_; y = y_; z = z_; } + + /// Negate this vector. + b2Vec3 operator -() const { b2Vec3 v; v.Set(-x, -y, -z); return v; } + + /// Add a vector to this vector. + void operator += (const b2Vec3& v) + { + x += v.x; y += v.y; z += v.z; + } + + /// Subtract a vector from this vector. + void operator -= (const b2Vec3& v) + { + x -= v.x; y -= v.y; z -= v.z; + } + + /// Multiply this vector by a scalar. + void operator *= (float32 s) + { + x *= s; y *= s; z *= s; + } + + float32 x, y, z; +}; + +/// A 2-by-2 matrix. Stored in column-major order. +struct b2Mat22 +{ + /// The default constructor does nothing (for performance). + b2Mat22() {} + + /// Construct this matrix using columns. + b2Mat22(const b2Vec2& c1, const b2Vec2& c2) + { + ex = c1; + ey = c2; + } + + /// Construct this matrix using scalars. + b2Mat22(float32 a11, float32 a12, float32 a21, float32 a22) + { + ex.x = a11; ex.y = a21; + ey.x = a12; ey.y = a22; + } + + /// Initialize this matrix using columns. + void Set(const b2Vec2& c1, const b2Vec2& c2) + { + ex = c1; + ey = c2; + } + + /// Set this to the identity matrix. + void SetIdentity() + { + ex.x = 1.0f; ey.x = 0.0f; + ex.y = 0.0f; ey.y = 1.0f; + } + + /// Set this matrix to all zeros. + void SetZero() + { + ex.x = 0.0f; ey.x = 0.0f; + ex.y = 0.0f; ey.y = 0.0f; + } + + b2Mat22 GetInverse() const + { + float32 a = ex.x, b = ey.x, c = ex.y, d = ey.y; + b2Mat22 B; + float32 det = a * d - b * c; + if (det != 0.0f) + { + det = 1.0f / det; + } + B.ex.x = det * d; B.ey.x = -det * b; + B.ex.y = -det * c; B.ey.y = det * a; + return B; + } + + /// Solve A * x = b, where b is a column vector. This is more efficient + /// than computing the inverse in one-shot cases. + b2Vec2 Solve(const b2Vec2& b) const + { + float32 a11 = ex.x, a12 = ey.x, a21 = ex.y, a22 = ey.y; + float32 det = a11 * a22 - a12 * a21; + if (det != 0.0f) + { + det = 1.0f / det; + } + b2Vec2 x; + x.x = det * (a22 * b.x - a12 * b.y); + x.y = det * (a11 * b.y - a21 * b.x); + return x; + } + + b2Vec2 ex, ey; +}; + +/// A 3-by-3 matrix. Stored in column-major order. +struct b2Mat33 +{ + /// The default constructor does nothing (for performance). + b2Mat33() {} + + /// Construct this matrix using columns. + b2Mat33(const b2Vec3& c1, const b2Vec3& c2, const b2Vec3& c3) + { + ex = c1; + ey = c2; + ez = c3; + } + + /// Set this matrix to all zeros. + void SetZero() + { + ex.SetZero(); + ey.SetZero(); + ez.SetZero(); + } + + /// Solve A * x = b, where b is a column vector. This is more efficient + /// than computing the inverse in one-shot cases. + b2Vec3 Solve33(const b2Vec3& b) const; + + /// Solve A * x = b, where b is a column vector. This is more efficient + /// than computing the inverse in one-shot cases. Solve only the upper + /// 2-by-2 matrix equation. + b2Vec2 Solve22(const b2Vec2& b) const; + + /// Get the inverse of this matrix as a 2-by-2. + /// Returns the zero matrix if singular. + void GetInverse22(b2Mat33* M) const; + + /// Get the symmetric inverse of this matrix as a 3-by-3. + /// Returns the zero matrix if singular. + void GetSymInverse33(b2Mat33* M) const; + + b2Vec3 ex, ey, ez; +}; + +/// Rotation +struct b2Rot +{ + b2Rot() {} + + /// Initialize from an angle in radians + explicit b2Rot(float32 angle) + { + /// TODO_ERIN optimize + s = sinf(angle); + c = cosf(angle); + } + + /// Set using an angle in radians. + void Set(float32 angle) + { + /// TODO_ERIN optimize + s = sinf(angle); + c = cosf(angle); + } + + /// Set to the identity rotation + void SetIdentity() + { + s = 0.0f; + c = 1.0f; + } + + /// Get the angle in radians + float32 GetAngle() const + { + return b2Atan2(s, c); + } + + /// Get the x-axis + b2Vec2 GetXAxis() const + { + return b2Vec2(c, s); + } + + /// Get the u-axis + b2Vec2 GetYAxis() const + { + return b2Vec2(-s, c); + } + + /// Sine and cosine + float32 s, c; +}; + +/// A transform contains translation and rotation. It is used to represent +/// the position and orientation of rigid frames. +struct b2Transform +{ + /// The default constructor does nothing. + b2Transform() {} + + /// Initialize using a position vector and a rotation. + b2Transform(const b2Vec2& position, const b2Rot& rotation) : p(position), q(rotation) {} + + /// Set this to the identity transform. + void SetIdentity() + { + p.SetZero(); + q.SetIdentity(); + } + + /// Set this based on the position and angle. + void Set(const b2Vec2& position, float32 angle) + { + p = position; + q.Set(angle); + } + + b2Vec2 p; + b2Rot q; +}; + +/// This describes the motion of a body/shape for TOI computation. +/// Shapes are defined with respect to the body origin, which may +/// no coincide with the center of mass. However, to support dynamics +/// we must interpolate the center of mass position. +struct b2Sweep +{ + /// Get the interpolated transform at a specific time. + /// @param beta is a factor in [0,1], where 0 indicates alpha0. + void GetTransform(b2Transform* xfb, float32 beta) const; + + /// Advance the sweep forward, yielding a new initial state. + /// @param alpha the new initial time. + void Advance(float32 alpha); + + /// Normalize the angles. + void Normalize(); + + b2Vec2 localCenter; ///< local center of mass position + b2Vec2 c0, c; ///< center world positions + float32 a0, a; ///< world angles + + /// Fraction of the current time step in the range [0,1] + /// c0 and a0 are the positions at alpha0. + float32 alpha0; +}; + +/// Useful constant +extern const b2Vec2 b2Vec2_zero; + +/// Perform the dot product on two vectors. +inline float32 b2Dot(const b2Vec2& a, const b2Vec2& b) +{ + return a.x * b.x + a.y * b.y; +} + +/// Perform the cross product on two vectors. In 2D this produces a scalar. +inline float32 b2Cross(const b2Vec2& a, const b2Vec2& b) +{ + return a.x * b.y - a.y * b.x; +} + +/// Perform the cross product on a vector and a scalar. In 2D this produces +/// a vector. +inline b2Vec2 b2Cross(const b2Vec2& a, float32 s) +{ + return b2Vec2(s * a.y, -s * a.x); +} + +/// Perform the cross product on a scalar and a vector. In 2D this produces +/// a vector. +inline b2Vec2 b2Cross(float32 s, const b2Vec2& a) +{ + return b2Vec2(-s * a.y, s * a.x); +} + +/// Multiply a matrix times a vector. If a rotation matrix is provided, +/// then this transforms the vector from one frame to another. +inline b2Vec2 b2Mul(const b2Mat22& A, const b2Vec2& v) +{ + return b2Vec2(A.ex.x * v.x + A.ey.x * v.y, A.ex.y * v.x + A.ey.y * v.y); +} + +/// Multiply a matrix transpose times a vector. If a rotation matrix is provided, +/// then this transforms the vector from one frame to another (inverse transform). +inline b2Vec2 b2MulT(const b2Mat22& A, const b2Vec2& v) +{ + return b2Vec2(b2Dot(v, A.ex), b2Dot(v, A.ey)); +} + +/// Add two vectors component-wise. +inline b2Vec2 operator + (const b2Vec2& a, const b2Vec2& b) +{ + return b2Vec2(a.x + b.x, a.y + b.y); +} + +/// Subtract two vectors component-wise. +inline b2Vec2 operator - (const b2Vec2& a, const b2Vec2& b) +{ + return b2Vec2(a.x - b.x, a.y - b.y); +} + +inline b2Vec2 operator * (float32 s, const b2Vec2& a) +{ + return b2Vec2(s * a.x, s * a.y); +} + +inline bool operator == (const b2Vec2& a, const b2Vec2& b) +{ + return a.x == b.x && a.y == b.y; +} + +inline float32 b2Distance(const b2Vec2& a, const b2Vec2& b) +{ + b2Vec2 c = a - b; + return c.Length(); +} + +inline float32 b2DistanceSquared(const b2Vec2& a, const b2Vec2& b) +{ + b2Vec2 c = a - b; + return b2Dot(c, c); +} + +inline b2Vec3 operator * (float32 s, const b2Vec3& a) +{ + return b2Vec3(s * a.x, s * a.y, s * a.z); +} + +/// Add two vectors component-wise. +inline b2Vec3 operator + (const b2Vec3& a, const b2Vec3& b) +{ + return b2Vec3(a.x + b.x, a.y + b.y, a.z + b.z); +} + +/// Subtract two vectors component-wise. +inline b2Vec3 operator - (const b2Vec3& a, const b2Vec3& b) +{ + return b2Vec3(a.x - b.x, a.y - b.y, a.z - b.z); +} + +/// Perform the dot product on two vectors. +inline float32 b2Dot(const b2Vec3& a, const b2Vec3& b) +{ + return a.x * b.x + a.y * b.y + a.z * b.z; +} + +/// Perform the cross product on two vectors. +inline b2Vec3 b2Cross(const b2Vec3& a, const b2Vec3& b) +{ + return b2Vec3(a.y * b.z - a.z * b.y, a.z * b.x - a.x * b.z, a.x * b.y - a.y * b.x); +} + +inline b2Mat22 operator + (const b2Mat22& A, const b2Mat22& B) +{ + return b2Mat22(A.ex + B.ex, A.ey + B.ey); +} + +// A * B +inline b2Mat22 b2Mul(const b2Mat22& A, const b2Mat22& B) +{ + return b2Mat22(b2Mul(A, B.ex), b2Mul(A, B.ey)); +} + +// A^T * B +inline b2Mat22 b2MulT(const b2Mat22& A, const b2Mat22& B) +{ + b2Vec2 c1(b2Dot(A.ex, B.ex), b2Dot(A.ey, B.ex)); + b2Vec2 c2(b2Dot(A.ex, B.ey), b2Dot(A.ey, B.ey)); + return b2Mat22(c1, c2); +} + +/// Multiply a matrix times a vector. +inline b2Vec3 b2Mul(const b2Mat33& A, const b2Vec3& v) +{ + return v.x * A.ex + v.y * A.ey + v.z * A.ez; +} + +/// Multiply a matrix times a vector. +inline b2Vec2 b2Mul22(const b2Mat33& A, const b2Vec2& v) +{ + return b2Vec2(A.ex.x * v.x + A.ey.x * v.y, A.ex.y * v.x + A.ey.y * v.y); +} + +/// Multiply two rotations: q * r +inline b2Rot b2Mul(const b2Rot& q, const b2Rot& r) +{ + // [qc -qs] * [rc -rs] = [qc*rc-qs*rs -qc*rs-qs*rc] + // [qs qc] [rs rc] [qs*rc+qc*rs -qs*rs+qc*rc] + // s = qs * rc + qc * rs + // c = qc * rc - qs * rs + b2Rot qr; + qr.s = q.s * r.c + q.c * r.s; + qr.c = q.c * r.c - q.s * r.s; + return qr; +} + +/// Transpose multiply two rotations: qT * r +inline b2Rot b2MulT(const b2Rot& q, const b2Rot& r) +{ + // [ qc qs] * [rc -rs] = [qc*rc+qs*rs -qc*rs+qs*rc] + // [-qs qc] [rs rc] [-qs*rc+qc*rs qs*rs+qc*rc] + // s = qc * rs - qs * rc + // c = qc * rc + qs * rs + b2Rot qr; + qr.s = q.c * r.s - q.s * r.c; + qr.c = q.c * r.c + q.s * r.s; + return qr; +} + +/// Rotate a vector +inline b2Vec2 b2Mul(const b2Rot& q, const b2Vec2& v) +{ + return b2Vec2(q.c * v.x - q.s * v.y, q.s * v.x + q.c * v.y); +} + +/// Inverse rotate a vector +inline b2Vec2 b2MulT(const b2Rot& q, const b2Vec2& v) +{ + return b2Vec2(q.c * v.x + q.s * v.y, -q.s * v.x + q.c * v.y); +} + +inline b2Vec2 b2Mul(const b2Transform& T, const b2Vec2& v) +{ + float32 x = (T.q.c * v.x - T.q.s * v.y) + T.p.x; + float32 y = (T.q.s * v.x + T.q.c * v.y) + T.p.y; + + return b2Vec2(x, y); +} + +inline b2Vec2 b2MulT(const b2Transform& T, const b2Vec2& v) +{ + float32 px = v.x - T.p.x; + float32 py = v.y - T.p.y; + float32 x = (T.q.c * px + T.q.s * py); + float32 y = (-T.q.s * px + T.q.c * py); + + return b2Vec2(x, y); +} + +// v2 = A.q.Rot(B.q.Rot(v1) + B.p) + A.p +// = (A.q * B.q).Rot(v1) + A.q.Rot(B.p) + A.p +inline b2Transform b2Mul(const b2Transform& A, const b2Transform& B) +{ + b2Transform C; + C.q = b2Mul(A.q, B.q); + C.p = b2Mul(A.q, B.p) + A.p; + return C; +} + +// v2 = A.q' * (B.q * v1 + B.p - A.p) +// = A.q' * B.q * v1 + A.q' * (B.p - A.p) +inline b2Transform b2MulT(const b2Transform& A, const b2Transform& B) +{ + b2Transform C; + C.q = b2MulT(A.q, B.q); + C.p = b2MulT(A.q, B.p - A.p); + return C; +} + +template +inline T b2Abs(T a) +{ + return a > T(0) ? a : -a; +} + +inline b2Vec2 b2Abs(const b2Vec2& a) +{ + return b2Vec2(b2Abs(a.x), b2Abs(a.y)); +} + +inline b2Mat22 b2Abs(const b2Mat22& A) +{ + return b2Mat22(b2Abs(A.ex), b2Abs(A.ey)); +} + +template +inline T b2Min(T a, T b) +{ + return a < b ? a : b; +} + +inline b2Vec2 b2Min(const b2Vec2& a, const b2Vec2& b) +{ + return b2Vec2(b2Min(a.x, b.x), b2Min(a.y, b.y)); +} + +template +inline T b2Max(T a, T b) +{ + return a > b ? a : b; +} + +inline b2Vec2 b2Max(const b2Vec2& a, const b2Vec2& b) +{ + return b2Vec2(b2Max(a.x, b.x), b2Max(a.y, b.y)); +} + +template +inline T b2Clamp(T a, T low, T high) +{ + return b2Max(low, b2Min(a, high)); +} + +inline b2Vec2 b2Clamp(const b2Vec2& a, const b2Vec2& low, const b2Vec2& high) +{ + return b2Max(low, b2Min(a, high)); +} + +template inline void b2Swap(T& a, T& b) +{ + T tmp = a; + a = b; + b = tmp; +} + +/// "Next Largest Power of 2 +/// Given a binary integer value x, the next largest power of 2 can be computed by a SWAR algorithm +/// that recursively "folds" the upper bits into the lower bits. This process yields a bit vector with +/// the same most significant 1 as x, but all 1's below it. Adding 1 to that value yields the next +/// largest power of 2. For a 32-bit value:" +inline uint32 b2NextPowerOfTwo(uint32 x) +{ + x |= (x >> 1); + x |= (x >> 2); + x |= (x >> 4); + x |= (x >> 8); + x |= (x >> 16); + return x + 1; +} + +inline bool b2IsPowerOfTwo(uint32 x) +{ + bool result = x > 0 && (x & (x - 1)) == 0; + return result; +} + +inline void b2Sweep::GetTransform(b2Transform* xf, float32 beta) const +{ + xf->p = (1.0f - beta) * c0 + beta * c; + float32 angle = (1.0f - beta) * a0 + beta * a; + xf->q.Set(angle); + + // Shift to origin + xf->p -= b2Mul(xf->q, localCenter); +} + +inline void b2Sweep::Advance(float32 alpha) +{ + b2Assert(alpha0 < 1.0f); + float32 beta = (alpha - alpha0) / (1.0f - alpha0); + c0 = (1.0f - beta) * c0 + beta * c; + a0 = (1.0f - beta) * a0 + beta * a; + alpha0 = alpha; +} + +/// Normalize an angle in radians to be between -pi and pi +inline void b2Sweep::Normalize() +{ + float32 twoPi = 2.0f * b2_pi; + float32 d = twoPi * floorf(a0 / twoPi); + a0 -= d; + a -= d; +} + +#endif diff --git a/external/Box2D/Common/b2Settings.cpp b/external/Box2D/Common/b2Settings.cpp new file mode 100644 index 0000000000..84d6f1d0e4 --- /dev/null +++ b/external/Box2D/Common/b2Settings.cpp @@ -0,0 +1,61 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#ifdef SHP +#include +#include +#include +#include +#else +#include +#include +#include +#endif + + +using namespace std; + + +b2Version b2_version = {2, 2, 1}; + +// Memory allocators. Modify these to use your own allocator. +void* b2Alloc(int32 size) +{ + return malloc(size); +} + +void b2Free(void* mem) +{ + free(mem); +} + +// You can modify this to use your logging facility. +void b2Log(const char* string, ...) +{ +#if defined(SHP) + #ifdef _DEBUG + __App_info(__PRETTY_FUNCTION__ , __LINE__, string); + #endif +#else + va_list args; + va_start(args, string); + vprintf(string, args); + va_end(args); +#endif +} diff --git a/external/Box2D/Common/b2Settings.h b/external/Box2D/Common/b2Settings.h new file mode 100644 index 0000000000..aaf4b12ccf --- /dev/null +++ b/external/Box2D/Common/b2Settings.h @@ -0,0 +1,150 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_SETTINGS_H +#define B2_SETTINGS_H + +#include +#include + +#define B2_NOT_USED(x) ((void)(x)) +#define b2Assert(A) assert(A) + +typedef signed char int8; +typedef signed short int16; +typedef signed int int32; +typedef unsigned char uint8; +typedef unsigned short uint16; +typedef unsigned int uint32; +typedef float float32; +typedef double float64; + +#define b2_maxFloat FLT_MAX +#define b2_epsilon FLT_EPSILON +#define b2_pi 3.14159265359f + +/// @file +/// Global tuning constants based on meters-kilograms-seconds (MKS) units. +/// + +// Collision + +/// The maximum number of contact points between two convex shapes. Do +/// not change this value. +#define b2_maxManifoldPoints 2 + +/// The maximum number of vertices on a convex polygon. You cannot increase +/// this too much because b2BlockAllocator has a maximum object size. +#define b2_maxPolygonVertices 8 + +/// This is used to fatten AABBs in the dynamic tree. This allows proxies +/// to move by a small amount without triggering a tree adjustment. +/// This is in meters. +#define b2_aabbExtension 0.1f + +/// This is used to fatten AABBs in the dynamic tree. This is used to predict +/// the future position based on the current displacement. +/// This is a dimensionless multiplier. +#define b2_aabbMultiplier 2.0f + +/// A small length used as a collision and constraint tolerance. Usually it is +/// chosen to be numerically significant, but visually insignificant. +#define b2_linearSlop 0.005f + +/// A small angle used as a collision and constraint tolerance. Usually it is +/// chosen to be numerically significant, but visually insignificant. +#define b2_angularSlop (2.0f / 180.0f * b2_pi) + +/// The radius of the polygon/edge shape skin. This should not be modified. Making +/// this smaller means polygons will have an insufficient buffer for continuous collision. +/// Making it larger may create artifacts for vertex collision. +#define b2_polygonRadius (2.0f * b2_linearSlop) + +/// Maximum number of sub-steps per contact in continuous physics simulation. +#define b2_maxSubSteps 8 + + +// Dynamics + +/// Maximum number of contacts to be handled to solve a TOI impact. +#define b2_maxTOIContacts 32 + +/// A velocity threshold for elastic collisions. Any collision with a relative linear +/// velocity below this threshold will be treated as inelastic. +#define b2_velocityThreshold 1.0f + +/// The maximum linear position correction used when solving constraints. This helps to +/// prevent overshoot. +#define b2_maxLinearCorrection 0.2f + +/// The maximum angular position correction used when solving constraints. This helps to +/// prevent overshoot. +#define b2_maxAngularCorrection (8.0f / 180.0f * b2_pi) + +/// The maximum linear velocity of a body. This limit is very large and is used +/// to prevent numerical problems. You shouldn't need to adjust this. +#define b2_maxTranslation 2.0f +#define b2_maxTranslationSquared (b2_maxTranslation * b2_maxTranslation) + +/// The maximum angular velocity of a body. This limit is very large and is used +/// to prevent numerical problems. You shouldn't need to adjust this. +#define b2_maxRotation (0.5f * b2_pi) +#define b2_maxRotationSquared (b2_maxRotation * b2_maxRotation) + +/// This scale factor controls how fast overlap is resolved. Ideally this would be 1 so +/// that overlap is removed in one time step. However using values close to 1 often lead +/// to overshoot. +#define b2_baumgarte 0.2f +#define b2_toiBaugarte 0.75f + + +// Sleep + +/// The time that a body must be still before it will go to sleep. +#define b2_timeToSleep 0.5f + +/// A body cannot sleep if its linear velocity is above this tolerance. +#define b2_linearSleepTolerance 0.01f + +/// A body cannot sleep if its angular velocity is above this tolerance. +#define b2_angularSleepTolerance (2.0f / 180.0f * b2_pi) + +// Memory Allocation + +/// Implement this function to use your own memory allocator. +void* b2Alloc(int32 size); + +/// If you implement b2Alloc, you should also implement this function. +void b2Free(void* mem); + +/// Logging function. +void b2Log(const char* string, ...); + +/// Version numbering scheme. +/// See http://en.wikipedia.org/wiki/Software_versioning +struct b2Version +{ + int32 major; ///< significant changes + int32 minor; ///< incremental changes + int32 revision; ///< bug fixes +}; + +/// Current version. +extern b2Version b2_version; + +#endif diff --git a/external/Box2D/Common/b2StackAllocator.cpp b/external/Box2D/Common/b2StackAllocator.cpp new file mode 100644 index 0000000000..3caa5d9127 --- /dev/null +++ b/external/Box2D/Common/b2StackAllocator.cpp @@ -0,0 +1,83 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include + +b2StackAllocator::b2StackAllocator() +{ + m_index = 0; + m_allocation = 0; + m_maxAllocation = 0; + m_entryCount = 0; +} + +b2StackAllocator::~b2StackAllocator() +{ + b2Assert(m_index == 0); + b2Assert(m_entryCount == 0); +} + +void* b2StackAllocator::Allocate(int32 size) +{ + b2Assert(m_entryCount < b2_maxStackEntries); + + b2StackEntry* entry = m_entries + m_entryCount; + entry->size = size; + if (m_index + size > b2_stackSize) + { + entry->data = (char*)b2Alloc(size); + entry->usedMalloc = true; + } + else + { + entry->data = m_data + m_index; + entry->usedMalloc = false; + m_index += size; + } + + m_allocation += size; + m_maxAllocation = b2Max(m_maxAllocation, m_allocation); + ++m_entryCount; + + return entry->data; +} + +void b2StackAllocator::Free(void* p) +{ + b2Assert(m_entryCount > 0); + b2StackEntry* entry = m_entries + m_entryCount - 1; + b2Assert(p == entry->data); + if (entry->usedMalloc) + { + b2Free(p); + } + else + { + m_index -= entry->size; + } + m_allocation -= entry->size; + --m_entryCount; + + p = NULL; +} + +int32 b2StackAllocator::GetMaxAllocation() const +{ + return m_maxAllocation; +} diff --git a/external/Box2D/Common/b2StackAllocator.h b/external/Box2D/Common/b2StackAllocator.h new file mode 100644 index 0000000000..6140d0d802 --- /dev/null +++ b/external/Box2D/Common/b2StackAllocator.h @@ -0,0 +1,60 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_STACK_ALLOCATOR_H +#define B2_STACK_ALLOCATOR_H + +#include + +const int32 b2_stackSize = 100 * 1024; // 100k +const int32 b2_maxStackEntries = 32; + +struct b2StackEntry +{ + char* data; + int32 size; + bool usedMalloc; +}; + +// This is a stack allocator used for fast per step allocations. +// You must nest allocate/free pairs. The code will assert +// if you try to interleave multiple allocate/free pairs. +class b2StackAllocator +{ +public: + b2StackAllocator(); + ~b2StackAllocator(); + + void* Allocate(int32 size); + void Free(void* p); + + int32 GetMaxAllocation() const; + +private: + + char m_data[b2_stackSize]; + int32 m_index; + + int32 m_allocation; + int32 m_maxAllocation; + + b2StackEntry m_entries[b2_maxStackEntries]; + int32 m_entryCount; +}; + +#endif diff --git a/external/Box2D/Common/b2Timer.cpp b/external/Box2D/Common/b2Timer.cpp new file mode 100644 index 0000000000..b2bee94513 --- /dev/null +++ b/external/Box2D/Common/b2Timer.cpp @@ -0,0 +1,100 @@ +/* +* Copyright (c) 2011 Erin Catto http://box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include + +#if defined(_WIN32) && !defined(SHP) + +float64 b2Timer::s_invFrequency = 0.0f; + +#include + +b2Timer::b2Timer() +{ + LARGE_INTEGER largeInteger; + + if (s_invFrequency == 0.0f) + { + QueryPerformanceFrequency(&largeInteger); + s_invFrequency = float64(largeInteger.QuadPart); + if (s_invFrequency > 0.0f) + { + s_invFrequency = 1000.0f / s_invFrequency; + } + } + + QueryPerformanceCounter(&largeInteger); + m_start = float64(largeInteger.QuadPart); +} + +void b2Timer::Reset() +{ + LARGE_INTEGER largeInteger; + QueryPerformanceCounter(&largeInteger); + m_start = float64(largeInteger.QuadPart); +} + +float32 b2Timer::GetMilliseconds() const +{ + LARGE_INTEGER largeInteger; + QueryPerformanceCounter(&largeInteger); + float64 count = float64(largeInteger.QuadPart); + float32 ms = float32(s_invFrequency * (count - m_start)); + return ms; +} + +#elif defined(__linux__) || defined (__APPLE__) + +#include + +b2Timer::b2Timer() +{ + Reset(); +} + +void b2Timer::Reset() +{ + timeval t; + gettimeofday(&t, 0); + m_start_sec = t.tv_sec; + m_start_msec = t.tv_usec * 0.001f; +} + +float32 b2Timer::GetMilliseconds() const +{ + timeval t; + gettimeofday(&t, 0); + return (t.tv_sec - m_start_sec) * 1000 + t.tv_usec * 0.001f - m_start_msec; +} + +#else + +b2Timer::b2Timer() +{ +} + +void b2Timer::Reset() +{ +} + +float32 b2Timer::GetMilliseconds() const +{ + return 0.0f; +} + +#endif diff --git a/external/Box2D/Common/b2Timer.h b/external/Box2D/Common/b2Timer.h new file mode 100644 index 0000000000..053a107a56 --- /dev/null +++ b/external/Box2D/Common/b2Timer.h @@ -0,0 +1,45 @@ +/* +* Copyright (c) 2011 Erin Catto http://box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include + +/// Timer for profiling. This has platform specific code and may +/// not work on every platform. +class b2Timer +{ +public: + + /// Constructor + b2Timer(); + + /// Reset the timer. + void Reset(); + + /// Get the time since construction or the last reset. + float32 GetMilliseconds() const; + +private: + +#if defined(_WIN32) + float64 m_start; + static float64 s_invFrequency; +#elif defined(__linux__) || defined (__APPLE__) + unsigned long m_start_sec; + unsigned long m_start_msec; +#endif +}; diff --git a/external/Box2D/Dynamics/Contacts/b2ChainAndCircleContact.cpp b/external/Box2D/Dynamics/Contacts/b2ChainAndCircleContact.cpp new file mode 100644 index 0000000000..4ae4c41cd3 --- /dev/null +++ b/external/Box2D/Dynamics/Contacts/b2ChainAndCircleContact.cpp @@ -0,0 +1,54 @@ +/* +* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include +#include +#include + +#include +using namespace std; + +b2Contact* b2ChainAndCircleContact::Create(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator) +{ + void* mem = allocator->Allocate(sizeof(b2ChainAndCircleContact)); + return new (mem) b2ChainAndCircleContact(fixtureA, indexA, fixtureB, indexB); +} + +void b2ChainAndCircleContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) +{ + ((b2ChainAndCircleContact*)contact)->~b2ChainAndCircleContact(); + allocator->Free(contact, sizeof(b2ChainAndCircleContact)); +} + +b2ChainAndCircleContact::b2ChainAndCircleContact(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB) +: b2Contact(fixtureA, indexA, fixtureB, indexB) +{ + b2Assert(m_fixtureA->GetType() == b2Shape::e_chain); + b2Assert(m_fixtureB->GetType() == b2Shape::e_circle); +} + +void b2ChainAndCircleContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) +{ + b2ChainShape* chain = (b2ChainShape*)m_fixtureA->GetShape(); + b2EdgeShape edge; + chain->GetChildEdge(&edge, m_indexA); + b2CollideEdgeAndCircle( manifold, &edge, xfA, + (b2CircleShape*)m_fixtureB->GetShape(), xfB); +} diff --git a/external/Box2D/Dynamics/Contacts/b2ChainAndCircleContact.h b/external/Box2D/Dynamics/Contacts/b2ChainAndCircleContact.h new file mode 100644 index 0000000000..1cf601a61f --- /dev/null +++ b/external/Box2D/Dynamics/Contacts/b2ChainAndCircleContact.h @@ -0,0 +1,39 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_CHAIN_AND_CIRCLE_CONTACT_H +#define B2_CHAIN_AND_CIRCLE_CONTACT_H + +#include + +class b2BlockAllocator; + +class b2ChainAndCircleContact : public b2Contact +{ +public: + static b2Contact* Create( b2Fixture* fixtureA, int32 indexA, + b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); + static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); + + b2ChainAndCircleContact(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB); + ~b2ChainAndCircleContact() {} + + void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB); +}; + +#endif diff --git a/external/Box2D/Dynamics/Contacts/b2ChainAndPolygonContact.cpp b/external/Box2D/Dynamics/Contacts/b2ChainAndPolygonContact.cpp new file mode 100644 index 0000000000..8116c34d1b --- /dev/null +++ b/external/Box2D/Dynamics/Contacts/b2ChainAndPolygonContact.cpp @@ -0,0 +1,54 @@ +/* +* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include +#include +#include + +#include +using namespace std; + +b2Contact* b2ChainAndPolygonContact::Create(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator) +{ + void* mem = allocator->Allocate(sizeof(b2ChainAndPolygonContact)); + return new (mem) b2ChainAndPolygonContact(fixtureA, indexA, fixtureB, indexB); +} + +void b2ChainAndPolygonContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) +{ + ((b2ChainAndPolygonContact*)contact)->~b2ChainAndPolygonContact(); + allocator->Free(contact, sizeof(b2ChainAndPolygonContact)); +} + +b2ChainAndPolygonContact::b2ChainAndPolygonContact(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB) +: b2Contact(fixtureA, indexA, fixtureB, indexB) +{ + b2Assert(m_fixtureA->GetType() == b2Shape::e_chain); + b2Assert(m_fixtureB->GetType() == b2Shape::e_polygon); +} + +void b2ChainAndPolygonContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) +{ + b2ChainShape* chain = (b2ChainShape*)m_fixtureA->GetShape(); + b2EdgeShape edge; + chain->GetChildEdge(&edge, m_indexA); + b2CollideEdgeAndPolygon( manifold, &edge, xfA, + (b2PolygonShape*)m_fixtureB->GetShape(), xfB); +} diff --git a/external/Box2D/Dynamics/Contacts/b2ChainAndPolygonContact.h b/external/Box2D/Dynamics/Contacts/b2ChainAndPolygonContact.h new file mode 100644 index 0000000000..381c49b844 --- /dev/null +++ b/external/Box2D/Dynamics/Contacts/b2ChainAndPolygonContact.h @@ -0,0 +1,39 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_CHAIN_AND_POLYGON_CONTACT_H +#define B2_CHAIN_AND_POLYGON_CONTACT_H + +#include + +class b2BlockAllocator; + +class b2ChainAndPolygonContact : public b2Contact +{ +public: + static b2Contact* Create( b2Fixture* fixtureA, int32 indexA, + b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); + static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); + + b2ChainAndPolygonContact(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB); + ~b2ChainAndPolygonContact() {} + + void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB); +}; + +#endif diff --git a/external/Box2D/Dynamics/Contacts/b2CircleContact.cpp b/external/Box2D/Dynamics/Contacts/b2CircleContact.cpp new file mode 100644 index 0000000000..2436da5132 --- /dev/null +++ b/external/Box2D/Dynamics/Contacts/b2CircleContact.cpp @@ -0,0 +1,53 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include +#include +#include +#include + +#include +using namespace std; + +b2Contact* b2CircleContact::Create(b2Fixture* fixtureA, int32, b2Fixture* fixtureB, int32, b2BlockAllocator* allocator) +{ + void* mem = allocator->Allocate(sizeof(b2CircleContact)); + return new (mem) b2CircleContact(fixtureA, fixtureB); +} + +void b2CircleContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) +{ + ((b2CircleContact*)contact)->~b2CircleContact(); + allocator->Free(contact, sizeof(b2CircleContact)); +} + +b2CircleContact::b2CircleContact(b2Fixture* fixtureA, b2Fixture* fixtureB) + : b2Contact(fixtureA, 0, fixtureB, 0) +{ + b2Assert(m_fixtureA->GetType() == b2Shape::e_circle); + b2Assert(m_fixtureB->GetType() == b2Shape::e_circle); +} + +void b2CircleContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) +{ + b2CollideCircles(manifold, + (b2CircleShape*)m_fixtureA->GetShape(), xfA, + (b2CircleShape*)m_fixtureB->GetShape(), xfB); +} diff --git a/external/Box2D/Dynamics/Contacts/b2CircleContact.h b/external/Box2D/Dynamics/Contacts/b2CircleContact.h new file mode 100644 index 0000000000..6da056ae0d --- /dev/null +++ b/external/Box2D/Dynamics/Contacts/b2CircleContact.h @@ -0,0 +1,39 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_CIRCLE_CONTACT_H +#define B2_CIRCLE_CONTACT_H + +#include + +class b2BlockAllocator; + +class b2CircleContact : public b2Contact +{ +public: + static b2Contact* Create( b2Fixture* fixtureA, int32 indexA, + b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); + static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); + + b2CircleContact(b2Fixture* fixtureA, b2Fixture* fixtureB); + ~b2CircleContact() {} + + void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB); +}; + +#endif diff --git a/external/Box2D/Dynamics/Contacts/b2Contact.cpp b/external/Box2D/Dynamics/Contacts/b2Contact.cpp new file mode 100644 index 0000000000..2389af6434 --- /dev/null +++ b/external/Box2D/Dynamics/Contacts/b2Contact.cpp @@ -0,0 +1,240 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +b2ContactRegister b2Contact::s_registers[b2Shape::e_typeCount][b2Shape::e_typeCount]; +bool b2Contact::s_initialized = false; + +void b2Contact::InitializeRegisters() +{ + AddType(b2CircleContact::Create, b2CircleContact::Destroy, b2Shape::e_circle, b2Shape::e_circle); + AddType(b2PolygonAndCircleContact::Create, b2PolygonAndCircleContact::Destroy, b2Shape::e_polygon, b2Shape::e_circle); + AddType(b2PolygonContact::Create, b2PolygonContact::Destroy, b2Shape::e_polygon, b2Shape::e_polygon); + AddType(b2EdgeAndCircleContact::Create, b2EdgeAndCircleContact::Destroy, b2Shape::e_edge, b2Shape::e_circle); + AddType(b2EdgeAndPolygonContact::Create, b2EdgeAndPolygonContact::Destroy, b2Shape::e_edge, b2Shape::e_polygon); + AddType(b2ChainAndCircleContact::Create, b2ChainAndCircleContact::Destroy, b2Shape::e_chain, b2Shape::e_circle); + AddType(b2ChainAndPolygonContact::Create, b2ChainAndPolygonContact::Destroy, b2Shape::e_chain, b2Shape::e_polygon); +} + +void b2Contact::AddType(b2ContactCreateFcn* createFcn, b2ContactDestroyFcn* destoryFcn, + b2Shape::Type type1, b2Shape::Type type2) +{ + b2Assert(0 <= type1 && type1 < b2Shape::e_typeCount); + b2Assert(0 <= type2 && type2 < b2Shape::e_typeCount); + + s_registers[type1][type2].createFcn = createFcn; + s_registers[type1][type2].destroyFcn = destoryFcn; + s_registers[type1][type2].primary = true; + + if (type1 != type2) + { + s_registers[type2][type1].createFcn = createFcn; + s_registers[type2][type1].destroyFcn = destoryFcn; + s_registers[type2][type1].primary = false; + } +} + +b2Contact* b2Contact::Create(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator) +{ + if (s_initialized == false) + { + InitializeRegisters(); + s_initialized = true; + } + + b2Shape::Type type1 = fixtureA->GetType(); + b2Shape::Type type2 = fixtureB->GetType(); + + b2Assert(0 <= type1 && type1 < b2Shape::e_typeCount); + b2Assert(0 <= type2 && type2 < b2Shape::e_typeCount); + + b2ContactCreateFcn* createFcn = s_registers[type1][type2].createFcn; + if (createFcn) + { + if (s_registers[type1][type2].primary) + { + return createFcn(fixtureA, indexA, fixtureB, indexB, allocator); + } + else + { + return createFcn(fixtureB, indexB, fixtureA, indexA, allocator); + } + } + else + { + return NULL; + } +} + +void b2Contact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) +{ + b2Assert(s_initialized == true); + + if (contact->m_manifold.pointCount > 0) + { + contact->GetFixtureA()->GetBody()->SetAwake(true); + contact->GetFixtureB()->GetBody()->SetAwake(true); + } + + b2Shape::Type typeA = contact->GetFixtureA()->GetType(); + b2Shape::Type typeB = contact->GetFixtureB()->GetType(); + + b2Assert(0 <= typeA && typeB < b2Shape::e_typeCount); + b2Assert(0 <= typeA && typeB < b2Shape::e_typeCount); + + b2ContactDestroyFcn* destroyFcn = s_registers[typeA][typeB].destroyFcn; + destroyFcn(contact, allocator); +} + +b2Contact::b2Contact(b2Fixture* fA, int32 indexA, b2Fixture* fB, int32 indexB) +{ + m_flags = e_enabledFlag; + + m_fixtureA = fA; + m_fixtureB = fB; + + m_indexA = indexA; + m_indexB = indexB; + + m_manifold.pointCount = 0; + + m_prev = NULL; + m_next = NULL; + + m_nodeA.contact = NULL; + m_nodeA.prev = NULL; + m_nodeA.next = NULL; + m_nodeA.other = NULL; + + m_nodeB.contact = NULL; + m_nodeB.prev = NULL; + m_nodeB.next = NULL; + m_nodeB.other = NULL; + + m_toiCount = 0; + + m_friction = b2MixFriction(m_fixtureA->m_friction, m_fixtureB->m_friction); + m_restitution = b2MixRestitution(m_fixtureA->m_restitution, m_fixtureB->m_restitution); +} + +// Update the contact manifold and touching status. +// Note: do not assume the fixture AABBs are overlapping or are valid. +void b2Contact::Update(b2ContactListener* listener) +{ + b2Manifold oldManifold = m_manifold; + + // Re-enable this contact. + m_flags |= e_enabledFlag; + + bool touching = false; + bool wasTouching = (m_flags & e_touchingFlag) == e_touchingFlag; + + bool sensorA = m_fixtureA->IsSensor(); + bool sensorB = m_fixtureB->IsSensor(); + bool sensor = sensorA || sensorB; + + b2Body* bodyA = m_fixtureA->GetBody(); + b2Body* bodyB = m_fixtureB->GetBody(); + const b2Transform& xfA = bodyA->GetTransform(); + const b2Transform& xfB = bodyB->GetTransform(); + + // Is this contact a sensor? + if (sensor) + { + const b2Shape* shapeA = m_fixtureA->GetShape(); + const b2Shape* shapeB = m_fixtureB->GetShape(); + touching = b2TestOverlap(shapeA, m_indexA, shapeB, m_indexB, xfA, xfB); + + // Sensors don't generate manifolds. + m_manifold.pointCount = 0; + } + else + { + Evaluate(&m_manifold, xfA, xfB); + touching = m_manifold.pointCount > 0; + + // Match old contact ids to new contact ids and copy the + // stored impulses to warm start the solver. + for (int32 i = 0; i < m_manifold.pointCount; ++i) + { + b2ManifoldPoint* mp2 = m_manifold.points + i; + mp2->normalImpulse = 0.0f; + mp2->tangentImpulse = 0.0f; + b2ContactID id2 = mp2->id; + + for (int32 j = 0; j < oldManifold.pointCount; ++j) + { + b2ManifoldPoint* mp1 = oldManifold.points + j; + + if (mp1->id.key == id2.key) + { + mp2->normalImpulse = mp1->normalImpulse; + mp2->tangentImpulse = mp1->tangentImpulse; + break; + } + } + } + + if (touching != wasTouching) + { + bodyA->SetAwake(true); + bodyB->SetAwake(true); + } + } + + if (touching) + { + m_flags |= e_touchingFlag; + } + else + { + m_flags &= ~e_touchingFlag; + } + + if (wasTouching == false && touching == true && listener) + { + listener->BeginContact(this); + } + + if (wasTouching == true && touching == false && listener) + { + listener->EndContact(this); + } + + if (sensor == false && touching && listener) + { + listener->PreSolve(this, &oldManifold); + } +} diff --git a/external/Box2D/Dynamics/Contacts/b2Contact.h b/external/Box2D/Dynamics/Contacts/b2Contact.h new file mode 100644 index 0000000000..20d9403ce7 --- /dev/null +++ b/external/Box2D/Dynamics/Contacts/b2Contact.h @@ -0,0 +1,331 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_CONTACT_H +#define B2_CONTACT_H + +#include +#include +#include +#include + +class b2Body; +class b2Contact; +class b2Fixture; +class b2World; +class b2BlockAllocator; +class b2StackAllocator; +class b2ContactListener; + +/// Friction mixing law. The idea is to allow either fixture to drive the restitution to zero. +/// For example, anything slides on ice. +inline float32 b2MixFriction(float32 friction1, float32 friction2) +{ + return std::sqrt(friction1 * friction2); +} + +/// Restitution mixing law. The idea is allow for anything to bounce off an inelastic surface. +/// For example, a superball bounces on anything. +inline float32 b2MixRestitution(float32 restitution1, float32 restitution2) +{ + return restitution1 > restitution2 ? restitution1 : restitution2; +} + +typedef b2Contact* b2ContactCreateFcn( b2Fixture* fixtureA, int32 indexA, + b2Fixture* fixtureB, int32 indexB, + b2BlockAllocator* allocator); +typedef void b2ContactDestroyFcn(b2Contact* contact, b2BlockAllocator* allocator); + +struct b2ContactRegister +{ + b2ContactCreateFcn* createFcn; + b2ContactDestroyFcn* destroyFcn; + bool primary; +}; + +/// A contact edge is used to connect bodies and contacts together +/// in a contact graph where each body is a node and each contact +/// is an edge. A contact edge belongs to a doubly linked list +/// maintained in each attached body. Each contact has two contact +/// nodes, one for each attached body. +struct b2ContactEdge +{ + b2Body* other; ///< provides quick access to the other body attached. + b2Contact* contact; ///< the contact + b2ContactEdge* prev; ///< the previous contact edge in the body's contact list + b2ContactEdge* next; ///< the next contact edge in the body's contact list +}; + +/// The class manages contact between two shapes. A contact exists for each overlapping +/// AABB in the broad-phase (except if filtered). Therefore a contact object may exist +/// that has no contact points. +class b2Contact +{ +public: + + /// Get the contact manifold. Do not modify the manifold unless you understand the + /// internals of Box2D. + b2Manifold* GetManifold(); + const b2Manifold* GetManifold() const; + + /// Get the world manifold. + void GetWorldManifold(b2WorldManifold* worldManifold) const; + + /// Is this contact touching? + bool IsTouching() const; + + /// Enable/disable this contact. This can be used inside the pre-solve + /// contact listener. The contact is only disabled for the current + /// time step (or sub-step in continuous collisions). + void SetEnabled(bool flag); + + /// Has this contact been disabled? + bool IsEnabled() const; + + /// Get the next contact in the world's contact list. + b2Contact* GetNext(); + const b2Contact* GetNext() const; + + /// Get fixture A in this contact. + b2Fixture* GetFixtureA(); + const b2Fixture* GetFixtureA() const; + + /// Get the child primitive index for fixture A. + int32 GetChildIndexA() const; + + /// Get fixture B in this contact. + b2Fixture* GetFixtureB(); + const b2Fixture* GetFixtureB() const; + + /// Get the child primitive index for fixture B. + int32 GetChildIndexB() const; + + /// Override the default friction mixture. You can call this in b2ContactListener::PreSolve. + /// This value persists until set or reset. + void SetFriction(float32 friction); + + /// Get the friction. + float32 GetFriction() const; + + /// Reset the friction mixture to the default value. + void ResetFriction(); + + /// Override the default restitution mixture. You can call this in b2ContactListener::PreSolve. + /// The value persists until you set or reset. + void SetRestitution(float32 restitution); + + /// Get the restitution. + float32 GetRestitution() const; + + /// Reset the restitution to the default value. + void ResetRestitution(); + + /// Evaluate this contact with your own manifold and transforms. + virtual void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) = 0; + +protected: + friend class b2ContactManager; + friend class b2World; + friend class b2ContactSolver; + friend class b2Body; + friend class b2Fixture; + + // Flags stored in m_flags + enum + { + // Used when crawling contact graph when forming islands. + e_islandFlag = 0x0001, + + // Set when the shapes are touching. + e_touchingFlag = 0x0002, + + // This contact can be disabled (by user) + e_enabledFlag = 0x0004, + + // This contact needs filtering because a fixture filter was changed. + e_filterFlag = 0x0008, + + // This bullet contact had a TOI event + e_bulletHitFlag = 0x0010, + + // This contact has a valid TOI in m_toi + e_toiFlag = 0x0020 + }; + + /// Flag this contact for filtering. Filtering will occur the next time step. + void FlagForFiltering(); + + static void AddType(b2ContactCreateFcn* createFcn, b2ContactDestroyFcn* destroyFcn, + b2Shape::Type typeA, b2Shape::Type typeB); + static void InitializeRegisters(); + static b2Contact* Create(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); + static void Destroy(b2Contact* contact, b2Shape::Type typeA, b2Shape::Type typeB, b2BlockAllocator* allocator); + static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); + + b2Contact() : m_fixtureA(NULL), m_fixtureB(NULL) {} + b2Contact(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB); + virtual ~b2Contact() {} + + void Update(b2ContactListener* listener); + + static b2ContactRegister s_registers[b2Shape::e_typeCount][b2Shape::e_typeCount]; + static bool s_initialized; + + uint32 m_flags; + + // World pool and list pointers. + b2Contact* m_prev; + b2Contact* m_next; + + // Nodes for connecting bodies. + b2ContactEdge m_nodeA; + b2ContactEdge m_nodeB; + + b2Fixture* m_fixtureA; + b2Fixture* m_fixtureB; + + int32 m_indexA; + int32 m_indexB; + + b2Manifold m_manifold; + + int32 m_toiCount; + float32 m_toi; + + float32 m_friction; + float32 m_restitution; +}; + +inline b2Manifold* b2Contact::GetManifold() +{ + return &m_manifold; +} + +inline const b2Manifold* b2Contact::GetManifold() const +{ + return &m_manifold; +} + +inline void b2Contact::GetWorldManifold(b2WorldManifold* worldManifold) const +{ + const b2Body* bodyA = m_fixtureA->GetBody(); + const b2Body* bodyB = m_fixtureB->GetBody(); + const b2Shape* shapeA = m_fixtureA->GetShape(); + const b2Shape* shapeB = m_fixtureB->GetShape(); + + worldManifold->Initialize(&m_manifold, bodyA->GetTransform(), shapeA->m_radius, bodyB->GetTransform(), shapeB->m_radius); +} + +inline void b2Contact::SetEnabled(bool flag) +{ + if (flag) + { + m_flags |= e_enabledFlag; + } + else + { + m_flags &= ~e_enabledFlag; + } +} + +inline bool b2Contact::IsEnabled() const +{ + return (m_flags & e_enabledFlag) == e_enabledFlag; +} + +inline bool b2Contact::IsTouching() const +{ + return (m_flags & e_touchingFlag) == e_touchingFlag; +} + +inline b2Contact* b2Contact::GetNext() +{ + return m_next; +} + +inline const b2Contact* b2Contact::GetNext() const +{ + return m_next; +} + +inline b2Fixture* b2Contact::GetFixtureA() +{ + return m_fixtureA; +} + +inline const b2Fixture* b2Contact::GetFixtureA() const +{ + return m_fixtureA; +} + +inline b2Fixture* b2Contact::GetFixtureB() +{ + return m_fixtureB; +} + +inline int32 b2Contact::GetChildIndexA() const +{ + return m_indexA; +} + +inline const b2Fixture* b2Contact::GetFixtureB() const +{ + return m_fixtureB; +} + +inline int32 b2Contact::GetChildIndexB() const +{ + return m_indexB; +} + +inline void b2Contact::FlagForFiltering() +{ + m_flags |= e_filterFlag; +} + +inline void b2Contact::SetFriction(float32 friction) +{ + m_friction = friction; +} + +inline float32 b2Contact::GetFriction() const +{ + return m_friction; +} + +inline void b2Contact::ResetFriction() +{ + m_friction = b2MixFriction(m_fixtureA->m_friction, m_fixtureB->m_friction); +} + +inline void b2Contact::SetRestitution(float32 restitution) +{ + m_restitution = restitution; +} + +inline float32 b2Contact::GetRestitution() const +{ + return m_restitution; +} + +inline void b2Contact::ResetRestitution() +{ + m_restitution = b2MixRestitution(m_fixtureA->m_restitution, m_fixtureB->m_restitution); +} + +#endif diff --git a/external/Box2D/Dynamics/Contacts/b2ContactSolver.cpp b/external/Box2D/Dynamics/Contacts/b2ContactSolver.cpp new file mode 100644 index 0000000000..0dc740342a --- /dev/null +++ b/external/Box2D/Dynamics/Contacts/b2ContactSolver.cpp @@ -0,0 +1,832 @@ +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include + +#include +#include +#include +#include +#include + +#define B2_DEBUG_SOLVER 0 + +struct b2ContactPositionConstraint +{ + b2Vec2 localPoints[b2_maxManifoldPoints]; + b2Vec2 localNormal; + b2Vec2 localPoint; + int32 indexA; + int32 indexB; + float32 invMassA, invMassB; + b2Vec2 localCenterA, localCenterB; + float32 invIA, invIB; + b2Manifold::Type type; + float32 radiusA, radiusB; + int32 pointCount; +}; + +b2ContactSolver::b2ContactSolver(b2ContactSolverDef* def) +{ + m_step = def->step; + m_allocator = def->allocator; + m_count = def->count; + m_positionConstraints = (b2ContactPositionConstraint*)m_allocator->Allocate(m_count * sizeof(b2ContactPositionConstraint)); + m_velocityConstraints = (b2ContactVelocityConstraint*)m_allocator->Allocate(m_count * sizeof(b2ContactVelocityConstraint)); + m_positions = def->positions; + m_velocities = def->velocities; + m_contacts = def->contacts; + + // Initialize position independent portions of the constraints. + for (int32 i = 0; i < m_count; ++i) + { + b2Contact* contact = m_contacts[i]; + + b2Fixture* fixtureA = contact->m_fixtureA; + b2Fixture* fixtureB = contact->m_fixtureB; + b2Shape* shapeA = fixtureA->GetShape(); + b2Shape* shapeB = fixtureB->GetShape(); + float32 radiusA = shapeA->m_radius; + float32 radiusB = shapeB->m_radius; + b2Body* bodyA = fixtureA->GetBody(); + b2Body* bodyB = fixtureB->GetBody(); + b2Manifold* manifold = contact->GetManifold(); + + int32 pointCount = manifold->pointCount; + b2Assert(pointCount > 0); + + b2ContactVelocityConstraint* vc = m_velocityConstraints + i; + vc->friction = contact->m_friction; + vc->restitution = contact->m_restitution; + vc->indexA = bodyA->m_islandIndex; + vc->indexB = bodyB->m_islandIndex; + vc->invMassA = bodyA->m_invMass; + vc->invMassB = bodyB->m_invMass; + vc->invIA = bodyA->m_invI; + vc->invIB = bodyB->m_invI; + vc->contactIndex = i; + vc->pointCount = pointCount; + vc->K.SetZero(); + vc->normalMass.SetZero(); + + b2ContactPositionConstraint* pc = m_positionConstraints + i; + pc->indexA = bodyA->m_islandIndex; + pc->indexB = bodyB->m_islandIndex; + pc->invMassA = bodyA->m_invMass; + pc->invMassB = bodyB->m_invMass; + pc->localCenterA = bodyA->m_sweep.localCenter; + pc->localCenterB = bodyB->m_sweep.localCenter; + pc->invIA = bodyA->m_invI; + pc->invIB = bodyB->m_invI; + pc->localNormal = manifold->localNormal; + pc->localPoint = manifold->localPoint; + pc->pointCount = pointCount; + pc->radiusA = radiusA; + pc->radiusB = radiusB; + pc->type = manifold->type; + + for (int32 j = 0; j < pointCount; ++j) + { + b2ManifoldPoint* cp = manifold->points + j; + b2VelocityConstraintPoint* vcp = vc->points + j; + + if (m_step.warmStarting) + { + vcp->normalImpulse = m_step.dtRatio * cp->normalImpulse; + vcp->tangentImpulse = m_step.dtRatio * cp->tangentImpulse; + } + else + { + vcp->normalImpulse = 0.0f; + vcp->tangentImpulse = 0.0f; + } + + vcp->rA.SetZero(); + vcp->rB.SetZero(); + vcp->normalMass = 0.0f; + vcp->tangentMass = 0.0f; + vcp->velocityBias = 0.0f; + + pc->localPoints[j] = cp->localPoint; + } + } +} + +b2ContactSolver::~b2ContactSolver() +{ + m_allocator->Free(m_velocityConstraints); + m_allocator->Free(m_positionConstraints); +} + +// Initialize position dependent portions of the velocity constraints. +void b2ContactSolver::InitializeVelocityConstraints() +{ + for (int32 i = 0; i < m_count; ++i) + { + b2ContactVelocityConstraint* vc = m_velocityConstraints + i; + b2ContactPositionConstraint* pc = m_positionConstraints + i; + + float32 radiusA = pc->radiusA; + float32 radiusB = pc->radiusB; + b2Manifold* manifold = m_contacts[vc->contactIndex]->GetManifold(); + + int32 indexA = vc->indexA; + int32 indexB = vc->indexB; + + float32 mA = vc->invMassA; + float32 mB = vc->invMassB; + float32 iA = vc->invIA; + float32 iB = vc->invIB; + b2Vec2 localCenterA = pc->localCenterA; + b2Vec2 localCenterB = pc->localCenterB; + + b2Vec2 cA = m_positions[indexA].c; + float32 aA = m_positions[indexA].a; + b2Vec2 vA = m_velocities[indexA].v; + float32 wA = m_velocities[indexA].w; + + b2Vec2 cB = m_positions[indexB].c; + float32 aB = m_positions[indexB].a; + b2Vec2 vB = m_velocities[indexB].v; + float32 wB = m_velocities[indexB].w; + + b2Assert(manifold->pointCount > 0); + + b2Transform xfA, xfB; + xfA.q.Set(aA); + xfB.q.Set(aB); + xfA.p = cA - b2Mul(xfA.q, localCenterA); + xfB.p = cB - b2Mul(xfB.q, localCenterB); + + b2WorldManifold worldManifold; + worldManifold.Initialize(manifold, xfA, radiusA, xfB, radiusB); + + vc->normal = worldManifold.normal; + + int32 pointCount = vc->pointCount; + for (int32 j = 0; j < pointCount; ++j) + { + b2VelocityConstraintPoint* vcp = vc->points + j; + + vcp->rA = worldManifold.points[j] - cA; + vcp->rB = worldManifold.points[j] - cB; + + float32 rnA = b2Cross(vcp->rA, vc->normal); + float32 rnB = b2Cross(vcp->rB, vc->normal); + + float32 kNormal = mA + mB + iA * rnA * rnA + iB * rnB * rnB; + + vcp->normalMass = kNormal > 0.0f ? 1.0f / kNormal : 0.0f; + + b2Vec2 tangent = b2Cross(vc->normal, 1.0f); + + float32 rtA = b2Cross(vcp->rA, tangent); + float32 rtB = b2Cross(vcp->rB, tangent); + + float32 kTangent = mA + mB + iA * rtA * rtA + iB * rtB * rtB; + + vcp->tangentMass = kTangent > 0.0f ? 1.0f / kTangent : 0.0f; + + // Setup a velocity bias for restitution. + vcp->velocityBias = 0.0f; + float32 vRel = b2Dot(vc->normal, vB + b2Cross(wB, vcp->rB) - vA - b2Cross(wA, vcp->rA)); + if (vRel < -b2_velocityThreshold) + { + vcp->velocityBias = -vc->restitution * vRel; + } + } + + // If we have two points, then prepare the block solver. + if (vc->pointCount == 2) + { + b2VelocityConstraintPoint* vcp1 = vc->points + 0; + b2VelocityConstraintPoint* vcp2 = vc->points + 1; + + float32 rn1A = b2Cross(vcp1->rA, vc->normal); + float32 rn1B = b2Cross(vcp1->rB, vc->normal); + float32 rn2A = b2Cross(vcp2->rA, vc->normal); + float32 rn2B = b2Cross(vcp2->rB, vc->normal); + + float32 k11 = mA + mB + iA * rn1A * rn1A + iB * rn1B * rn1B; + float32 k22 = mA + mB + iA * rn2A * rn2A + iB * rn2B * rn2B; + float32 k12 = mA + mB + iA * rn1A * rn2A + iB * rn1B * rn2B; + + // Ensure a reasonable condition number. + const float32 k_maxConditionNumber = 1000.0f; + if (k11 * k11 < k_maxConditionNumber * (k11 * k22 - k12 * k12)) + { + // K is safe to invert. + vc->K.ex.Set(k11, k12); + vc->K.ey.Set(k12, k22); + vc->normalMass = vc->K.GetInverse(); + } + else + { + // The constraints are redundant, just use one. + // TODO_ERIN use deepest? + vc->pointCount = 1; + } + } + } +} + +void b2ContactSolver::WarmStart() +{ + // Warm start. + for (int32 i = 0; i < m_count; ++i) + { + b2ContactVelocityConstraint* vc = m_velocityConstraints + i; + + int32 indexA = vc->indexA; + int32 indexB = vc->indexB; + float32 mA = vc->invMassA; + float32 iA = vc->invIA; + float32 mB = vc->invMassB; + float32 iB = vc->invIB; + int32 pointCount = vc->pointCount; + + b2Vec2 vA = m_velocities[indexA].v; + float32 wA = m_velocities[indexA].w; + b2Vec2 vB = m_velocities[indexB].v; + float32 wB = m_velocities[indexB].w; + + b2Vec2 normal = vc->normal; + b2Vec2 tangent = b2Cross(normal, 1.0f); + + for (int32 j = 0; j < pointCount; ++j) + { + b2VelocityConstraintPoint* vcp = vc->points + j; + b2Vec2 P = vcp->normalImpulse * normal + vcp->tangentImpulse * tangent; + wA -= iA * b2Cross(vcp->rA, P); + vA -= mA * P; + wB += iB * b2Cross(vcp->rB, P); + vB += mB * P; + } + + m_velocities[indexA].v = vA; + m_velocities[indexA].w = wA; + m_velocities[indexB].v = vB; + m_velocities[indexB].w = wB; + } +} + +void b2ContactSolver::SolveVelocityConstraints() +{ + for (int32 i = 0; i < m_count; ++i) + { + b2ContactVelocityConstraint* vc = m_velocityConstraints + i; + + int32 indexA = vc->indexA; + int32 indexB = vc->indexB; + float32 mA = vc->invMassA; + float32 iA = vc->invIA; + float32 mB = vc->invMassB; + float32 iB = vc->invIB; + int32 pointCount = vc->pointCount; + + b2Vec2 vA = m_velocities[indexA].v; + float32 wA = m_velocities[indexA].w; + b2Vec2 vB = m_velocities[indexB].v; + float32 wB = m_velocities[indexB].w; + + b2Vec2 normal = vc->normal; + b2Vec2 tangent = b2Cross(normal, 1.0f); + float32 friction = vc->friction; + + b2Assert(pointCount == 1 || pointCount == 2); + + // Solve tangent constraints first because non-penetration is more important + // than friction. + for (int32 j = 0; j < pointCount; ++j) + { + b2VelocityConstraintPoint* vcp = vc->points + j; + + // Relative velocity at contact + b2Vec2 dv = vB + b2Cross(wB, vcp->rB) - vA - b2Cross(wA, vcp->rA); + + // Compute tangent force + float32 vt = b2Dot(dv, tangent); + float32 lambda = vcp->tangentMass * (-vt); + + // b2Clamp the accumulated force + float32 maxFriction = friction * vcp->normalImpulse; + float32 newImpulse = b2Clamp(vcp->tangentImpulse + lambda, -maxFriction, maxFriction); + lambda = newImpulse - vcp->tangentImpulse; + vcp->tangentImpulse = newImpulse; + + // Apply contact impulse + b2Vec2 P = lambda * tangent; + + vA -= mA * P; + wA -= iA * b2Cross(vcp->rA, P); + + vB += mB * P; + wB += iB * b2Cross(vcp->rB, P); + } + + // Solve normal constraints + if (vc->pointCount == 1) + { + b2VelocityConstraintPoint* vcp = vc->points + 0; + + // Relative velocity at contact + b2Vec2 dv = vB + b2Cross(wB, vcp->rB) - vA - b2Cross(wA, vcp->rA); + + // Compute normal impulse + float32 vn = b2Dot(dv, normal); + float32 lambda = -vcp->normalMass * (vn - vcp->velocityBias); + + // b2Clamp the accumulated impulse + float32 newImpulse = b2Max(vcp->normalImpulse + lambda, 0.0f); + lambda = newImpulse - vcp->normalImpulse; + vcp->normalImpulse = newImpulse; + + // Apply contact impulse + b2Vec2 P = lambda * normal; + vA -= mA * P; + wA -= iA * b2Cross(vcp->rA, P); + + vB += mB * P; + wB += iB * b2Cross(vcp->rB, P); + } + else + { + // Block solver developed in collaboration with Dirk Gregorius (back in 01/07 on Box2D_Lite). + // Build the mini LCP for this contact patch + // + // vn = A * x + b, vn >= 0, , vn >= 0, x >= 0 and vn_i * x_i = 0 with i = 1..2 + // + // A = J * W * JT and J = ( -n, -r1 x n, n, r2 x n ) + // b = vn0 - velocityBias + // + // The system is solved using the "Total enumeration method" (s. Murty). The complementary constraint vn_i * x_i + // implies that we must have in any solution either vn_i = 0 or x_i = 0. So for the 2D contact problem the cases + // vn1 = 0 and vn2 = 0, x1 = 0 and x2 = 0, x1 = 0 and vn2 = 0, x2 = 0 and vn1 = 0 need to be tested. The first valid + // solution that satisfies the problem is chosen. + // + // In order to account of the accumulated impulse 'a' (because of the iterative nature of the solver which only requires + // that the accumulated impulse is clamped and not the incremental impulse) we change the impulse variable (x_i). + // + // Substitute: + // + // x = a + d + // + // a := old total impulse + // x := new total impulse + // d := incremental impulse + // + // For the current iteration we extend the formula for the incremental impulse + // to compute the new total impulse: + // + // vn = A * d + b + // = A * (x - a) + b + // = A * x + b - A * a + // = A * x + b' + // b' = b - A * a; + + b2VelocityConstraintPoint* cp1 = vc->points + 0; + b2VelocityConstraintPoint* cp2 = vc->points + 1; + + b2Vec2 a(cp1->normalImpulse, cp2->normalImpulse); + b2Assert(a.x >= 0.0f && a.y >= 0.0f); + + // Relative velocity at contact + b2Vec2 dv1 = vB + b2Cross(wB, cp1->rB) - vA - b2Cross(wA, cp1->rA); + b2Vec2 dv2 = vB + b2Cross(wB, cp2->rB) - vA - b2Cross(wA, cp2->rA); + + // Compute normal velocity + float32 vn1 = b2Dot(dv1, normal); + float32 vn2 = b2Dot(dv2, normal); + + b2Vec2 b; + b.x = vn1 - cp1->velocityBias; + b.y = vn2 - cp2->velocityBias; + + // Compute b' + b -= b2Mul(vc->K, a); + + const float32 k_errorTol = 1e-3f; + B2_NOT_USED(k_errorTol); + + for (;;) + { + // + // Case 1: vn = 0 + // + // 0 = A * x + b' + // + // Solve for x: + // + // x = - inv(A) * b' + // + b2Vec2 x = - b2Mul(vc->normalMass, b); + + if (x.x >= 0.0f && x.y >= 0.0f) + { + // Get the incremental impulse + b2Vec2 d = x - a; + + // Apply incremental impulse + b2Vec2 P1 = d.x * normal; + b2Vec2 P2 = d.y * normal; + vA -= mA * (P1 + P2); + wA -= iA * (b2Cross(cp1->rA, P1) + b2Cross(cp2->rA, P2)); + + vB += mB * (P1 + P2); + wB += iB * (b2Cross(cp1->rB, P1) + b2Cross(cp2->rB, P2)); + + // Accumulate + cp1->normalImpulse = x.x; + cp2->normalImpulse = x.y; + +#if B2_DEBUG_SOLVER == 1 + // Postconditions + dv1 = vB + b2Cross(wB, cp1->rB) - vA - b2Cross(wA, cp1->rA); + dv2 = vB + b2Cross(wB, cp2->rB) - vA - b2Cross(wA, cp2->rA); + + // Compute normal velocity + vn1 = b2Dot(dv1, normal); + vn2 = b2Dot(dv2, normal); + + b2Assert(b2Abs(vn1 - cp1->velocityBias) < k_errorTol); + b2Assert(b2Abs(vn2 - cp2->velocityBias) < k_errorTol); +#endif + break; + } + + // + // Case 2: vn1 = 0 and x2 = 0 + // + // 0 = a11 * x1 + a12 * 0 + b1' + // vn2 = a21 * x1 + a22 * 0 + b2' + // + x.x = - cp1->normalMass * b.x; + x.y = 0.0f; + vn1 = 0.0f; + vn2 = vc->K.ex.y * x.x + b.y; + + if (x.x >= 0.0f && vn2 >= 0.0f) + { + // Get the incremental impulse + b2Vec2 d = x - a; + + // Apply incremental impulse + b2Vec2 P1 = d.x * normal; + b2Vec2 P2 = d.y * normal; + vA -= mA * (P1 + P2); + wA -= iA * (b2Cross(cp1->rA, P1) + b2Cross(cp2->rA, P2)); + + vB += mB * (P1 + P2); + wB += iB * (b2Cross(cp1->rB, P1) + b2Cross(cp2->rB, P2)); + + // Accumulate + cp1->normalImpulse = x.x; + cp2->normalImpulse = x.y; + +#if B2_DEBUG_SOLVER == 1 + // Postconditions + dv1 = vB + b2Cross(wB, cp1->rB) - vA - b2Cross(wA, cp1->rA); + + // Compute normal velocity + vn1 = b2Dot(dv1, normal); + + b2Assert(b2Abs(vn1 - cp1->velocityBias) < k_errorTol); +#endif + break; + } + + + // + // Case 3: vn2 = 0 and x1 = 0 + // + // vn1 = a11 * 0 + a12 * x2 + b1' + // 0 = a21 * 0 + a22 * x2 + b2' + // + x.x = 0.0f; + x.y = - cp2->normalMass * b.y; + vn1 = vc->K.ey.x * x.y + b.x; + vn2 = 0.0f; + + if (x.y >= 0.0f && vn1 >= 0.0f) + { + // Resubstitute for the incremental impulse + b2Vec2 d = x - a; + + // Apply incremental impulse + b2Vec2 P1 = d.x * normal; + b2Vec2 P2 = d.y * normal; + vA -= mA * (P1 + P2); + wA -= iA * (b2Cross(cp1->rA, P1) + b2Cross(cp2->rA, P2)); + + vB += mB * (P1 + P2); + wB += iB * (b2Cross(cp1->rB, P1) + b2Cross(cp2->rB, P2)); + + // Accumulate + cp1->normalImpulse = x.x; + cp2->normalImpulse = x.y; + +#if B2_DEBUG_SOLVER == 1 + // Postconditions + dv2 = vB + b2Cross(wB, cp2->rB) - vA - b2Cross(wA, cp2->rA); + + // Compute normal velocity + vn2 = b2Dot(dv2, normal); + + b2Assert(b2Abs(vn2 - cp2->velocityBias) < k_errorTol); +#endif + break; + } + + // + // Case 4: x1 = 0 and x2 = 0 + // + // vn1 = b1 + // vn2 = b2; + x.x = 0.0f; + x.y = 0.0f; + vn1 = b.x; + vn2 = b.y; + + if (vn1 >= 0.0f && vn2 >= 0.0f ) + { + // Resubstitute for the incremental impulse + b2Vec2 d = x - a; + + // Apply incremental impulse + b2Vec2 P1 = d.x * normal; + b2Vec2 P2 = d.y * normal; + vA -= mA * (P1 + P2); + wA -= iA * (b2Cross(cp1->rA, P1) + b2Cross(cp2->rA, P2)); + + vB += mB * (P1 + P2); + wB += iB * (b2Cross(cp1->rB, P1) + b2Cross(cp2->rB, P2)); + + // Accumulate + cp1->normalImpulse = x.x; + cp2->normalImpulse = x.y; + + break; + } + + // No solution, give up. This is hit sometimes, but it doesn't seem to matter. + break; + } + } + + m_velocities[indexA].v = vA; + m_velocities[indexA].w = wA; + m_velocities[indexB].v = vB; + m_velocities[indexB].w = wB; + } +} + +void b2ContactSolver::StoreImpulses() +{ + for (int32 i = 0; i < m_count; ++i) + { + b2ContactVelocityConstraint* vc = m_velocityConstraints + i; + b2Manifold* manifold = m_contacts[vc->contactIndex]->GetManifold(); + + for (int32 j = 0; j < vc->pointCount; ++j) + { + manifold->points[j].normalImpulse = vc->points[j].normalImpulse; + manifold->points[j].tangentImpulse = vc->points[j].tangentImpulse; + } + } +} + +struct b2PositionSolverManifold +{ + void Initialize(b2ContactPositionConstraint* pc, const b2Transform& xfA, const b2Transform& xfB, int32 index) + { + b2Assert(pc->pointCount > 0); + + switch (pc->type) + { + case b2Manifold::e_circles: + { + b2Vec2 pointA = b2Mul(xfA, pc->localPoint); + b2Vec2 pointB = b2Mul(xfB, pc->localPoints[0]); + normal = pointB - pointA; + normal.Normalize(); + point = 0.5f * (pointA + pointB); + separation = b2Dot(pointB - pointA, normal) - pc->radiusA - pc->radiusB; + } + break; + + case b2Manifold::e_faceA: + { + normal = b2Mul(xfA.q, pc->localNormal); + b2Vec2 planePoint = b2Mul(xfA, pc->localPoint); + + b2Vec2 clipPoint = b2Mul(xfB, pc->localPoints[index]); + separation = b2Dot(clipPoint - planePoint, normal) - pc->radiusA - pc->radiusB; + point = clipPoint; + } + break; + + case b2Manifold::e_faceB: + { + normal = b2Mul(xfB.q, pc->localNormal); + b2Vec2 planePoint = b2Mul(xfB, pc->localPoint); + + b2Vec2 clipPoint = b2Mul(xfA, pc->localPoints[index]); + separation = b2Dot(clipPoint - planePoint, normal) - pc->radiusA - pc->radiusB; + point = clipPoint; + + // Ensure normal points from A to B + normal = -normal; + } + break; + } + } + + b2Vec2 normal; + b2Vec2 point; + float32 separation; +}; + +// Sequential solver. +bool b2ContactSolver::SolvePositionConstraints() +{ + float32 minSeparation = 0.0f; + + for (int32 i = 0; i < m_count; ++i) + { + b2ContactPositionConstraint* pc = m_positionConstraints + i; + + int32 indexA = pc->indexA; + int32 indexB = pc->indexB; + b2Vec2 localCenterA = pc->localCenterA; + float32 mA = pc->invMassA; + float32 iA = pc->invIA; + b2Vec2 localCenterB = pc->localCenterB; + float32 mB = pc->invMassB; + float32 iB = pc->invIB; + int32 pointCount = pc->pointCount; + + b2Vec2 cA = m_positions[indexA].c; + float32 aA = m_positions[indexA].a; + + b2Vec2 cB = m_positions[indexB].c; + float32 aB = m_positions[indexB].a; + + // Solve normal constraints + for (int32 j = 0; j < pointCount; ++j) + { + b2Transform xfA, xfB; + xfA.q.Set(aA); + xfB.q.Set(aB); + xfA.p = cA - b2Mul(xfA.q, localCenterA); + xfB.p = cB - b2Mul(xfB.q, localCenterB); + + b2PositionSolverManifold psm; + psm.Initialize(pc, xfA, xfB, j); + b2Vec2 normal = psm.normal; + + b2Vec2 point = psm.point; + float32 separation = psm.separation; + + b2Vec2 rA = point - cA; + b2Vec2 rB = point - cB; + + // Track max constraint error. + minSeparation = b2Min(minSeparation, separation); + + // Prevent large corrections and allow slop. + float32 C = b2Clamp(b2_baumgarte * (separation + b2_linearSlop), -b2_maxLinearCorrection, 0.0f); + + // Compute the effective mass. + float32 rnA = b2Cross(rA, normal); + float32 rnB = b2Cross(rB, normal); + float32 K = mA + mB + iA * rnA * rnA + iB * rnB * rnB; + + // Compute normal impulse + float32 impulse = K > 0.0f ? - C / K : 0.0f; + + b2Vec2 P = impulse * normal; + + cA -= mA * P; + aA -= iA * b2Cross(rA, P); + + cB += mB * P; + aB += iB * b2Cross(rB, P); + } + + m_positions[indexA].c = cA; + m_positions[indexA].a = aA; + + m_positions[indexB].c = cB; + m_positions[indexB].a = aB; + } + + // We can't expect minSpeparation >= -b2_linearSlop because we don't + // push the separation above -b2_linearSlop. + return minSeparation >= -3.0f * b2_linearSlop; +} + +// Sequential position solver for position constraints. +bool b2ContactSolver::SolveTOIPositionConstraints(int32 toiIndexA, int32 toiIndexB) +{ + float32 minSeparation = 0.0f; + + for (int32 i = 0; i < m_count; ++i) + { + b2ContactPositionConstraint* pc = m_positionConstraints + i; + + int32 indexA = pc->indexA; + int32 indexB = pc->indexB; + b2Vec2 localCenterA = pc->localCenterA; + b2Vec2 localCenterB = pc->localCenterB; + int32 pointCount = pc->pointCount; + + float32 mA = 0.0f; + float32 iA = 0.0f; + if (indexA == toiIndexA || indexA == toiIndexB) + { + mA = pc->invMassA; + iA = pc->invIA; + } + + float32 mB = pc->invMassB; + float32 iB = pc->invIB; + if (indexB == toiIndexA || indexB == toiIndexB) + { + mB = pc->invMassB; + iB = pc->invIB; + } + + b2Vec2 cA = m_positions[indexA].c; + float32 aA = m_positions[indexA].a; + + b2Vec2 cB = m_positions[indexB].c; + float32 aB = m_positions[indexB].a; + + // Solve normal constraints + for (int32 j = 0; j < pointCount; ++j) + { + b2Transform xfA, xfB; + xfA.q.Set(aA); + xfB.q.Set(aB); + xfA.p = cA - b2Mul(xfA.q, localCenterA); + xfB.p = cB - b2Mul(xfB.q, localCenterB); + + b2PositionSolverManifold psm; + psm.Initialize(pc, xfA, xfB, j); + b2Vec2 normal = psm.normal; + + b2Vec2 point = psm.point; + float32 separation = psm.separation; + + b2Vec2 rA = point - cA; + b2Vec2 rB = point - cB; + + // Track max constraint error. + minSeparation = b2Min(minSeparation, separation); + + // Prevent large corrections and allow slop. + float32 C = b2Clamp(b2_toiBaugarte * (separation + b2_linearSlop), -b2_maxLinearCorrection, 0.0f); + + // Compute the effective mass. + float32 rnA = b2Cross(rA, normal); + float32 rnB = b2Cross(rB, normal); + float32 K = mA + mB + iA * rnA * rnA + iB * rnB * rnB; + + // Compute normal impulse + float32 impulse = K > 0.0f ? - C / K : 0.0f; + + b2Vec2 P = impulse * normal; + + cA -= mA * P; + aA -= iA * b2Cross(rA, P); + + cB += mB * P; + aB += iB * b2Cross(rB, P); + } + + m_positions[indexA].c = cA; + m_positions[indexA].a = aA; + + m_positions[indexB].c = cB; + m_positions[indexB].a = aB; + } + + // We can't expect minSpeparation >= -b2_linearSlop because we don't + // push the separation above -b2_linearSlop. + return minSeparation >= -1.5f * b2_linearSlop; +} diff --git a/external/Box2D/Dynamics/Contacts/b2ContactSolver.h b/external/Box2D/Dynamics/Contacts/b2ContactSolver.h new file mode 100644 index 0000000000..aef1987a9e --- /dev/null +++ b/external/Box2D/Dynamics/Contacts/b2ContactSolver.h @@ -0,0 +1,94 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_CONTACT_SOLVER_H +#define B2_CONTACT_SOLVER_H + +#include +#include +#include + +class b2Contact; +class b2Body; +class b2StackAllocator; +struct b2ContactPositionConstraint; + +struct b2VelocityConstraintPoint +{ + b2Vec2 rA; + b2Vec2 rB; + float32 normalImpulse; + float32 tangentImpulse; + float32 normalMass; + float32 tangentMass; + float32 velocityBias; +}; + +struct b2ContactVelocityConstraint +{ + b2VelocityConstraintPoint points[b2_maxManifoldPoints]; + b2Vec2 normal; + b2Mat22 normalMass; + b2Mat22 K; + int32 indexA; + int32 indexB; + float32 invMassA, invMassB; + float32 invIA, invIB; + float32 friction; + float32 restitution; + int32 pointCount; + int32 contactIndex; +}; + +struct b2ContactSolverDef +{ + b2TimeStep step; + b2Contact** contacts; + int32 count; + b2Position* positions; + b2Velocity* velocities; + b2StackAllocator* allocator; +}; + +class b2ContactSolver +{ +public: + b2ContactSolver(b2ContactSolverDef* def); + ~b2ContactSolver(); + + void InitializeVelocityConstraints(); + + void WarmStart(); + void SolveVelocityConstraints(); + void StoreImpulses(); + + bool SolvePositionConstraints(); + bool SolveTOIPositionConstraints(int32 toiIndexA, int32 toiIndexB); + + b2TimeStep m_step; + b2Position* m_positions; + b2Velocity* m_velocities; + b2StackAllocator* m_allocator; + b2ContactPositionConstraint* m_positionConstraints; + b2ContactVelocityConstraint* m_velocityConstraints; + b2Contact** m_contacts; + int m_count; +}; + +#endif + diff --git a/external/Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.cpp b/external/Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.cpp new file mode 100644 index 0000000000..aade42880a --- /dev/null +++ b/external/Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.cpp @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include + +#include +using namespace std; + +b2Contact* b2EdgeAndCircleContact::Create(b2Fixture* fixtureA, int32, b2Fixture* fixtureB, int32, b2BlockAllocator* allocator) +{ + void* mem = allocator->Allocate(sizeof(b2EdgeAndCircleContact)); + return new (mem) b2EdgeAndCircleContact(fixtureA, fixtureB); +} + +void b2EdgeAndCircleContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) +{ + ((b2EdgeAndCircleContact*)contact)->~b2EdgeAndCircleContact(); + allocator->Free(contact, sizeof(b2EdgeAndCircleContact)); +} + +b2EdgeAndCircleContact::b2EdgeAndCircleContact(b2Fixture* fixtureA, b2Fixture* fixtureB) +: b2Contact(fixtureA, 0, fixtureB, 0) +{ + b2Assert(m_fixtureA->GetType() == b2Shape::e_edge); + b2Assert(m_fixtureB->GetType() == b2Shape::e_circle); +} + +void b2EdgeAndCircleContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) +{ + b2CollideEdgeAndCircle( manifold, + (b2EdgeShape*)m_fixtureA->GetShape(), xfA, + (b2CircleShape*)m_fixtureB->GetShape(), xfB); +} diff --git a/external/Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.h b/external/Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.h new file mode 100644 index 0000000000..70771ec536 --- /dev/null +++ b/external/Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.h @@ -0,0 +1,39 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_EDGE_AND_CIRCLE_CONTACT_H +#define B2_EDGE_AND_CIRCLE_CONTACT_H + +#include + +class b2BlockAllocator; + +class b2EdgeAndCircleContact : public b2Contact +{ +public: + static b2Contact* Create( b2Fixture* fixtureA, int32 indexA, + b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); + static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); + + b2EdgeAndCircleContact(b2Fixture* fixtureA, b2Fixture* fixtureB); + ~b2EdgeAndCircleContact() {} + + void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB); +}; + +#endif diff --git a/external/Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.cpp b/external/Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.cpp new file mode 100644 index 0000000000..04ce394107 --- /dev/null +++ b/external/Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.cpp @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include + +#include +using namespace std; + +b2Contact* b2EdgeAndPolygonContact::Create(b2Fixture* fixtureA, int32, b2Fixture* fixtureB, int32, b2BlockAllocator* allocator) +{ + void* mem = allocator->Allocate(sizeof(b2EdgeAndPolygonContact)); + return new (mem) b2EdgeAndPolygonContact(fixtureA, fixtureB); +} + +void b2EdgeAndPolygonContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) +{ + ((b2EdgeAndPolygonContact*)contact)->~b2EdgeAndPolygonContact(); + allocator->Free(contact, sizeof(b2EdgeAndPolygonContact)); +} + +b2EdgeAndPolygonContact::b2EdgeAndPolygonContact(b2Fixture* fixtureA, b2Fixture* fixtureB) +: b2Contact(fixtureA, 0, fixtureB, 0) +{ + b2Assert(m_fixtureA->GetType() == b2Shape::e_edge); + b2Assert(m_fixtureB->GetType() == b2Shape::e_polygon); +} + +void b2EdgeAndPolygonContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) +{ + b2CollideEdgeAndPolygon( manifold, + (b2EdgeShape*)m_fixtureA->GetShape(), xfA, + (b2PolygonShape*)m_fixtureB->GetShape(), xfB); +} diff --git a/external/Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.h b/external/Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.h new file mode 100644 index 0000000000..f65f3acca9 --- /dev/null +++ b/external/Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.h @@ -0,0 +1,39 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_EDGE_AND_POLYGON_CONTACT_H +#define B2_EDGE_AND_POLYGON_CONTACT_H + +#include + +class b2BlockAllocator; + +class b2EdgeAndPolygonContact : public b2Contact +{ +public: + static b2Contact* Create( b2Fixture* fixtureA, int32 indexA, + b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); + static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); + + b2EdgeAndPolygonContact(b2Fixture* fixtureA, b2Fixture* fixtureB); + ~b2EdgeAndPolygonContact() {} + + void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB); +}; + +#endif diff --git a/external/Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.cpp b/external/Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.cpp new file mode 100644 index 0000000000..961b26f38a --- /dev/null +++ b/external/Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.cpp @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include + +#include +using namespace std; + +b2Contact* b2PolygonAndCircleContact::Create(b2Fixture* fixtureA, int32, b2Fixture* fixtureB, int32, b2BlockAllocator* allocator) +{ + void* mem = allocator->Allocate(sizeof(b2PolygonAndCircleContact)); + return new (mem) b2PolygonAndCircleContact(fixtureA, fixtureB); +} + +void b2PolygonAndCircleContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) +{ + ((b2PolygonAndCircleContact*)contact)->~b2PolygonAndCircleContact(); + allocator->Free(contact, sizeof(b2PolygonAndCircleContact)); +} + +b2PolygonAndCircleContact::b2PolygonAndCircleContact(b2Fixture* fixtureA, b2Fixture* fixtureB) +: b2Contact(fixtureA, 0, fixtureB, 0) +{ + b2Assert(m_fixtureA->GetType() == b2Shape::e_polygon); + b2Assert(m_fixtureB->GetType() == b2Shape::e_circle); +} + +void b2PolygonAndCircleContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) +{ + b2CollidePolygonAndCircle( manifold, + (b2PolygonShape*)m_fixtureA->GetShape(), xfA, + (b2CircleShape*)m_fixtureB->GetShape(), xfB); +} diff --git a/external/Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.h b/external/Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.h new file mode 100644 index 0000000000..7b1a5288b4 --- /dev/null +++ b/external/Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.h @@ -0,0 +1,38 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_POLYGON_AND_CIRCLE_CONTACT_H +#define B2_POLYGON_AND_CIRCLE_CONTACT_H + +#include + +class b2BlockAllocator; + +class b2PolygonAndCircleContact : public b2Contact +{ +public: + static b2Contact* Create(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); + static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); + + b2PolygonAndCircleContact(b2Fixture* fixtureA, b2Fixture* fixtureB); + ~b2PolygonAndCircleContact() {} + + void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB); +}; + +#endif diff --git a/external/Box2D/Dynamics/Contacts/b2PolygonContact.cpp b/external/Box2D/Dynamics/Contacts/b2PolygonContact.cpp new file mode 100644 index 0000000000..a2884a440d --- /dev/null +++ b/external/Box2D/Dynamics/Contacts/b2PolygonContact.cpp @@ -0,0 +1,53 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include +#include +#include +#include + +#include +using namespace std; + +b2Contact* b2PolygonContact::Create(b2Fixture* fixtureA, int32, b2Fixture* fixtureB, int32, b2BlockAllocator* allocator) +{ + void* mem = allocator->Allocate(sizeof(b2PolygonContact)); + return new (mem) b2PolygonContact(fixtureA, fixtureB); +} + +void b2PolygonContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) +{ + ((b2PolygonContact*)contact)->~b2PolygonContact(); + allocator->Free(contact, sizeof(b2PolygonContact)); +} + +b2PolygonContact::b2PolygonContact(b2Fixture* fixtureA, b2Fixture* fixtureB) + : b2Contact(fixtureA, 0, fixtureB, 0) +{ + b2Assert(m_fixtureA->GetType() == b2Shape::e_polygon); + b2Assert(m_fixtureB->GetType() == b2Shape::e_polygon); +} + +void b2PolygonContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) +{ + b2CollidePolygons( manifold, + (b2PolygonShape*)m_fixtureA->GetShape(), xfA, + (b2PolygonShape*)m_fixtureB->GetShape(), xfB); +} diff --git a/external/Box2D/Dynamics/Contacts/b2PolygonContact.h b/external/Box2D/Dynamics/Contacts/b2PolygonContact.h new file mode 100644 index 0000000000..302684232a --- /dev/null +++ b/external/Box2D/Dynamics/Contacts/b2PolygonContact.h @@ -0,0 +1,39 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_POLYGON_CONTACT_H +#define B2_POLYGON_CONTACT_H + +#include + +class b2BlockAllocator; + +class b2PolygonContact : public b2Contact +{ +public: + static b2Contact* Create( b2Fixture* fixtureA, int32 indexA, + b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); + static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); + + b2PolygonContact(b2Fixture* fixtureA, b2Fixture* fixtureB); + ~b2PolygonContact() {} + + void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB); +}; + +#endif diff --git a/external/Box2D/Dynamics/Joints/b2DistanceJoint.cpp b/external/Box2D/Dynamics/Joints/b2DistanceJoint.cpp new file mode 100644 index 0000000000..b2d4bd006c --- /dev/null +++ b/external/Box2D/Dynamics/Joints/b2DistanceJoint.cpp @@ -0,0 +1,260 @@ +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include + +// 1-D constrained system +// m (v2 - v1) = lambda +// v2 + (beta/h) * x1 + gamma * lambda = 0, gamma has units of inverse mass. +// x2 = x1 + h * v2 + +// 1-D mass-damper-spring system +// m (v2 - v1) + h * d * v2 + h * k * + +// C = norm(p2 - p1) - L +// u = (p2 - p1) / norm(p2 - p1) +// Cdot = dot(u, v2 + cross(w2, r2) - v1 - cross(w1, r1)) +// J = [-u -cross(r1, u) u cross(r2, u)] +// K = J * invM * JT +// = invMass1 + invI1 * cross(r1, u)^2 + invMass2 + invI2 * cross(r2, u)^2 + +void b2DistanceJointDef::Initialize(b2Body* b1, b2Body* b2, + const b2Vec2& anchor1, const b2Vec2& anchor2) +{ + bodyA = b1; + bodyB = b2; + localAnchorA = bodyA->GetLocalPoint(anchor1); + localAnchorB = bodyB->GetLocalPoint(anchor2); + b2Vec2 d = anchor2 - anchor1; + length = d.Length(); +} + +b2DistanceJoint::b2DistanceJoint(const b2DistanceJointDef* def) +: b2Joint(def) +{ + m_localAnchorA = def->localAnchorA; + m_localAnchorB = def->localAnchorB; + m_length = def->length; + m_frequencyHz = def->frequencyHz; + m_dampingRatio = def->dampingRatio; + m_impulse = 0.0f; + m_gamma = 0.0f; + m_bias = 0.0f; +} + +void b2DistanceJoint::InitVelocityConstraints(const b2SolverData& data) +{ + m_indexA = m_bodyA->m_islandIndex; + m_indexB = m_bodyB->m_islandIndex; + m_localCenterA = m_bodyA->m_sweep.localCenter; + m_localCenterB = m_bodyB->m_sweep.localCenter; + m_invMassA = m_bodyA->m_invMass; + m_invMassB = m_bodyB->m_invMass; + m_invIA = m_bodyA->m_invI; + m_invIB = m_bodyB->m_invI; + + b2Vec2 cA = data.positions[m_indexA].c; + float32 aA = data.positions[m_indexA].a; + b2Vec2 vA = data.velocities[m_indexA].v; + float32 wA = data.velocities[m_indexA].w; + + b2Vec2 cB = data.positions[m_indexB].c; + float32 aB = data.positions[m_indexB].a; + b2Vec2 vB = data.velocities[m_indexB].v; + float32 wB = data.velocities[m_indexB].w; + + b2Rot qA(aA), qB(aB); + + m_rA = b2Mul(qA, m_localAnchorA - m_localCenterA); + m_rB = b2Mul(qB, m_localAnchorB - m_localCenterB); + m_u = cB + m_rB - cA - m_rA; + + // Handle singularity. + float32 length = m_u.Length(); + if (length > b2_linearSlop) + { + m_u *= 1.0f / length; + } + else + { + m_u.Set(0.0f, 0.0f); + } + + float32 crAu = b2Cross(m_rA, m_u); + float32 crBu = b2Cross(m_rB, m_u); + float32 invMass = m_invMassA + m_invIA * crAu * crAu + m_invMassB + m_invIB * crBu * crBu; + + // Compute the effective mass matrix. + m_mass = invMass != 0.0f ? 1.0f / invMass : 0.0f; + + if (m_frequencyHz > 0.0f) + { + float32 C = length - m_length; + + // Frequency + float32 omega = 2.0f * b2_pi * m_frequencyHz; + + // Damping coefficient + float32 d = 2.0f * m_mass * m_dampingRatio * omega; + + // Spring stiffness + float32 k = m_mass * omega * omega; + + // magic formulas + float32 h = data.step.dt; + m_gamma = h * (d + h * k); + m_gamma = m_gamma != 0.0f ? 1.0f / m_gamma : 0.0f; + m_bias = C * h * k * m_gamma; + + invMass += m_gamma; + m_mass = invMass != 0.0f ? 1.0f / invMass : 0.0f; + } + else + { + m_gamma = 0.0f; + m_bias = 0.0f; + } + + if (data.step.warmStarting) + { + // Scale the impulse to support a variable time step. + m_impulse *= data.step.dtRatio; + + b2Vec2 P = m_impulse * m_u; + vA -= m_invMassA * P; + wA -= m_invIA * b2Cross(m_rA, P); + vB += m_invMassB * P; + wB += m_invIB * b2Cross(m_rB, P); + } + else + { + m_impulse = 0.0f; + } + + data.velocities[m_indexA].v = vA; + data.velocities[m_indexA].w = wA; + data.velocities[m_indexB].v = vB; + data.velocities[m_indexB].w = wB; +} + +void b2DistanceJoint::SolveVelocityConstraints(const b2SolverData& data) +{ + b2Vec2 vA = data.velocities[m_indexA].v; + float32 wA = data.velocities[m_indexA].w; + b2Vec2 vB = data.velocities[m_indexB].v; + float32 wB = data.velocities[m_indexB].w; + + // Cdot = dot(u, v + cross(w, r)) + b2Vec2 vpA = vA + b2Cross(wA, m_rA); + b2Vec2 vpB = vB + b2Cross(wB, m_rB); + float32 Cdot = b2Dot(m_u, vpB - vpA); + + float32 impulse = -m_mass * (Cdot + m_bias + m_gamma * m_impulse); + m_impulse += impulse; + + b2Vec2 P = impulse * m_u; + vA -= m_invMassA * P; + wA -= m_invIA * b2Cross(m_rA, P); + vB += m_invMassB * P; + wB += m_invIB * b2Cross(m_rB, P); + + data.velocities[m_indexA].v = vA; + data.velocities[m_indexA].w = wA; + data.velocities[m_indexB].v = vB; + data.velocities[m_indexB].w = wB; +} + +bool b2DistanceJoint::SolvePositionConstraints(const b2SolverData& data) +{ + if (m_frequencyHz > 0.0f) + { + // There is no position correction for soft distance constraints. + return true; + } + + b2Vec2 cA = data.positions[m_indexA].c; + float32 aA = data.positions[m_indexA].a; + b2Vec2 cB = data.positions[m_indexB].c; + float32 aB = data.positions[m_indexB].a; + + b2Rot qA(aA), qB(aB); + + b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA); + b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB); + b2Vec2 u = cB + rB - cA - rA; + + float32 length = u.Normalize(); + float32 C = length - m_length; + C = b2Clamp(C, -b2_maxLinearCorrection, b2_maxLinearCorrection); + + float32 impulse = -m_mass * C; + b2Vec2 P = impulse * u; + + cA -= m_invMassA * P; + aA -= m_invIA * b2Cross(rA, P); + cB += m_invMassB * P; + aB += m_invIB * b2Cross(rB, P); + + data.positions[m_indexA].c = cA; + data.positions[m_indexA].a = aA; + data.positions[m_indexB].c = cB; + data.positions[m_indexB].a = aB; + + return b2Abs(C) < b2_linearSlop; +} + +b2Vec2 b2DistanceJoint::GetAnchorA() const +{ + return m_bodyA->GetWorldPoint(m_localAnchorA); +} + +b2Vec2 b2DistanceJoint::GetAnchorB() const +{ + return m_bodyB->GetWorldPoint(m_localAnchorB); +} + +b2Vec2 b2DistanceJoint::GetReactionForce(float32 inv_dt) const +{ + b2Vec2 F = (inv_dt * m_impulse) * m_u; + return F; +} + +float32 b2DistanceJoint::GetReactionTorque(float32 inv_dt) const +{ + B2_NOT_USED(inv_dt); + return 0.0f; +} + +void b2DistanceJoint::Dump() +{ + int32 indexA = m_bodyA->m_islandIndex; + int32 indexB = m_bodyB->m_islandIndex; + + b2Log(" b2DistanceJointDef jd;\n"); + b2Log(" jd.bodyA = bodies[%d];\n", indexA); + b2Log(" jd.bodyB = bodies[%d];\n", indexB); + b2Log(" jd.collideConnected = bool(%d);\n", m_collideConnected); + b2Log(" jd.localAnchorA.Set(%.15lef, %.15lef);\n", m_localAnchorA.x, m_localAnchorA.y); + b2Log(" jd.localAnchorB.Set(%.15lef, %.15lef);\n", m_localAnchorB.x, m_localAnchorB.y); + b2Log(" jd.length = %.15lef;\n", m_length); + b2Log(" jd.frequencyHz = %.15lef;\n", m_frequencyHz); + b2Log(" jd.dampingRatio = %.15lef;\n", m_dampingRatio); + b2Log(" joints[%d] = m_world->CreateJoint(&jd);\n", m_index); +} diff --git a/external/Box2D/Dynamics/Joints/b2DistanceJoint.h b/external/Box2D/Dynamics/Joints/b2DistanceJoint.h new file mode 100644 index 0000000000..fc11476ff9 --- /dev/null +++ b/external/Box2D/Dynamics/Joints/b2DistanceJoint.h @@ -0,0 +1,169 @@ +/* +* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_DISTANCE_JOINT_H +#define B2_DISTANCE_JOINT_H + +#include + +/// Distance joint definition. This requires defining an +/// anchor point on both bodies and the non-zero length of the +/// distance joint. The definition uses local anchor points +/// so that the initial configuration can violate the constraint +/// slightly. This helps when saving and loading a game. +/// @warning Do not use a zero or short length. +struct b2DistanceJointDef : public b2JointDef +{ + b2DistanceJointDef() + { + type = e_distanceJoint; + localAnchorA.Set(0.0f, 0.0f); + localAnchorB.Set(0.0f, 0.0f); + length = 1.0f; + frequencyHz = 0.0f; + dampingRatio = 0.0f; + } + + /// Initialize the bodies, anchors, and length using the world + /// anchors. + void Initialize(b2Body* bodyA, b2Body* bodyB, + const b2Vec2& anchorA, const b2Vec2& anchorB); + + /// The local anchor point relative to bodyA's origin. + b2Vec2 localAnchorA; + + /// The local anchor point relative to bodyB's origin. + b2Vec2 localAnchorB; + + /// The natural length between the anchor points. + float32 length; + + /// The mass-spring-damper frequency in Hertz. A value of 0 + /// disables softness. + float32 frequencyHz; + + /// The damping ratio. 0 = no damping, 1 = critical damping. + float32 dampingRatio; +}; + +/// A distance joint constrains two points on two bodies +/// to remain at a fixed distance from each other. You can view +/// this as a massless, rigid rod. +class b2DistanceJoint : public b2Joint +{ +public: + + b2Vec2 GetAnchorA() const; + b2Vec2 GetAnchorB() const; + + /// Get the reaction force given the inverse time step. + /// Unit is N. + b2Vec2 GetReactionForce(float32 inv_dt) const; + + /// Get the reaction torque given the inverse time step. + /// Unit is N*m. This is always zero for a distance joint. + float32 GetReactionTorque(float32 inv_dt) const; + + /// The local anchor point relative to bodyA's origin. + const b2Vec2& GetLocalAnchorA() const { return m_localAnchorA; } + + /// The local anchor point relative to bodyB's origin. + const b2Vec2& GetLocalAnchorB() const { return m_localAnchorB; } + + /// Set/get the natural length. + /// Manipulating the length can lead to non-physical behavior when the frequency is zero. + void SetLength(float32 length); + float32 GetLength() const; + + /// Set/get frequency in Hz. + void SetFrequency(float32 hz); + float32 GetFrequency() const; + + /// Set/get damping ratio. + void SetDampingRatio(float32 ratio); + float32 GetDampingRatio() const; + + /// Dump joint to dmLog + void Dump(); + +protected: + + friend class b2Joint; + b2DistanceJoint(const b2DistanceJointDef* data); + + void InitVelocityConstraints(const b2SolverData& data); + void SolveVelocityConstraints(const b2SolverData& data); + bool SolvePositionConstraints(const b2SolverData& data); + + float32 m_frequencyHz; + float32 m_dampingRatio; + float32 m_bias; + + // Solver shared + b2Vec2 m_localAnchorA; + b2Vec2 m_localAnchorB; + float32 m_gamma; + float32 m_impulse; + float32 m_length; + + // Solver temp + int32 m_indexA; + int32 m_indexB; + b2Vec2 m_u; + b2Vec2 m_rA; + b2Vec2 m_rB; + b2Vec2 m_localCenterA; + b2Vec2 m_localCenterB; + float32 m_invMassA; + float32 m_invMassB; + float32 m_invIA; + float32 m_invIB; + float32 m_mass; +}; + +inline void b2DistanceJoint::SetLength(float32 length) +{ + m_length = length; +} + +inline float32 b2DistanceJoint::GetLength() const +{ + return m_length; +} + +inline void b2DistanceJoint::SetFrequency(float32 hz) +{ + m_frequencyHz = hz; +} + +inline float32 b2DistanceJoint::GetFrequency() const +{ + return m_frequencyHz; +} + +inline void b2DistanceJoint::SetDampingRatio(float32 ratio) +{ + m_dampingRatio = ratio; +} + +inline float32 b2DistanceJoint::GetDampingRatio() const +{ + return m_dampingRatio; +} + +#endif diff --git a/external/Box2D/Dynamics/Joints/b2FrictionJoint.cpp b/external/Box2D/Dynamics/Joints/b2FrictionJoint.cpp new file mode 100644 index 0000000000..6e6018db10 --- /dev/null +++ b/external/Box2D/Dynamics/Joints/b2FrictionJoint.cpp @@ -0,0 +1,251 @@ +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include + +// Point-to-point constraint +// Cdot = v2 - v1 +// = v2 + cross(w2, r2) - v1 - cross(w1, r1) +// J = [-I -r1_skew I r2_skew ] +// Identity used: +// w k % (rx i + ry j) = w * (-ry i + rx j) + +// Angle constraint +// Cdot = w2 - w1 +// J = [0 0 -1 0 0 1] +// K = invI1 + invI2 + +void b2FrictionJointDef::Initialize(b2Body* bA, b2Body* bB, const b2Vec2& anchor) +{ + bodyA = bA; + bodyB = bB; + localAnchorA = bodyA->GetLocalPoint(anchor); + localAnchorB = bodyB->GetLocalPoint(anchor); +} + +b2FrictionJoint::b2FrictionJoint(const b2FrictionJointDef* def) +: b2Joint(def) +{ + m_localAnchorA = def->localAnchorA; + m_localAnchorB = def->localAnchorB; + + m_linearImpulse.SetZero(); + m_angularImpulse = 0.0f; + + m_maxForce = def->maxForce; + m_maxTorque = def->maxTorque; +} + +void b2FrictionJoint::InitVelocityConstraints(const b2SolverData& data) +{ + m_indexA = m_bodyA->m_islandIndex; + m_indexB = m_bodyB->m_islandIndex; + m_localCenterA = m_bodyA->m_sweep.localCenter; + m_localCenterB = m_bodyB->m_sweep.localCenter; + m_invMassA = m_bodyA->m_invMass; + m_invMassB = m_bodyB->m_invMass; + m_invIA = m_bodyA->m_invI; + m_invIB = m_bodyB->m_invI; + + float32 aA = data.positions[m_indexA].a; + b2Vec2 vA = data.velocities[m_indexA].v; + float32 wA = data.velocities[m_indexA].w; + + float32 aB = data.positions[m_indexB].a; + b2Vec2 vB = data.velocities[m_indexB].v; + float32 wB = data.velocities[m_indexB].w; + + b2Rot qA(aA), qB(aB); + + // Compute the effective mass matrix. + m_rA = b2Mul(qA, m_localAnchorA - m_localCenterA); + m_rB = b2Mul(qB, m_localAnchorB - m_localCenterB); + + // J = [-I -r1_skew I r2_skew] + // [ 0 -1 0 1] + // r_skew = [-ry; rx] + + // Matlab + // K = [ mA+r1y^2*iA+mB+r2y^2*iB, -r1y*iA*r1x-r2y*iB*r2x, -r1y*iA-r2y*iB] + // [ -r1y*iA*r1x-r2y*iB*r2x, mA+r1x^2*iA+mB+r2x^2*iB, r1x*iA+r2x*iB] + // [ -r1y*iA-r2y*iB, r1x*iA+r2x*iB, iA+iB] + + float32 mA = m_invMassA, mB = m_invMassB; + float32 iA = m_invIA, iB = m_invIB; + + b2Mat22 K; + K.ex.x = mA + mB + iA * m_rA.y * m_rA.y + iB * m_rB.y * m_rB.y; + K.ex.y = -iA * m_rA.x * m_rA.y - iB * m_rB.x * m_rB.y; + K.ey.x = K.ex.y; + K.ey.y = mA + mB + iA * m_rA.x * m_rA.x + iB * m_rB.x * m_rB.x; + + m_linearMass = K.GetInverse(); + + m_angularMass = iA + iB; + if (m_angularMass > 0.0f) + { + m_angularMass = 1.0f / m_angularMass; + } + + if (data.step.warmStarting) + { + // Scale impulses to support a variable time step. + m_linearImpulse *= data.step.dtRatio; + m_angularImpulse *= data.step.dtRatio; + + b2Vec2 P(m_linearImpulse.x, m_linearImpulse.y); + vA -= mA * P; + wA -= iA * (b2Cross(m_rA, P) + m_angularImpulse); + vB += mB * P; + wB += iB * (b2Cross(m_rB, P) + m_angularImpulse); + } + else + { + m_linearImpulse.SetZero(); + m_angularImpulse = 0.0f; + } + + data.velocities[m_indexA].v = vA; + data.velocities[m_indexA].w = wA; + data.velocities[m_indexB].v = vB; + data.velocities[m_indexB].w = wB; +} + +void b2FrictionJoint::SolveVelocityConstraints(const b2SolverData& data) +{ + b2Vec2 vA = data.velocities[m_indexA].v; + float32 wA = data.velocities[m_indexA].w; + b2Vec2 vB = data.velocities[m_indexB].v; + float32 wB = data.velocities[m_indexB].w; + + float32 mA = m_invMassA, mB = m_invMassB; + float32 iA = m_invIA, iB = m_invIB; + + float32 h = data.step.dt; + + // Solve angular friction + { + float32 Cdot = wB - wA; + float32 impulse = -m_angularMass * Cdot; + + float32 oldImpulse = m_angularImpulse; + float32 maxImpulse = h * m_maxTorque; + m_angularImpulse = b2Clamp(m_angularImpulse + impulse, -maxImpulse, maxImpulse); + impulse = m_angularImpulse - oldImpulse; + + wA -= iA * impulse; + wB += iB * impulse; + } + + // Solve linear friction + { + b2Vec2 Cdot = vB + b2Cross(wB, m_rB) - vA - b2Cross(wA, m_rA); + + b2Vec2 impulse = -b2Mul(m_linearMass, Cdot); + b2Vec2 oldImpulse = m_linearImpulse; + m_linearImpulse += impulse; + + float32 maxImpulse = h * m_maxForce; + + if (m_linearImpulse.LengthSquared() > maxImpulse * maxImpulse) + { + m_linearImpulse.Normalize(); + m_linearImpulse *= maxImpulse; + } + + impulse = m_linearImpulse - oldImpulse; + + vA -= mA * impulse; + wA -= iA * b2Cross(m_rA, impulse); + + vB += mB * impulse; + wB += iB * b2Cross(m_rB, impulse); + } + + data.velocities[m_indexA].v = vA; + data.velocities[m_indexA].w = wA; + data.velocities[m_indexB].v = vB; + data.velocities[m_indexB].w = wB; +} + +bool b2FrictionJoint::SolvePositionConstraints(const b2SolverData& data) +{ + B2_NOT_USED(data); + + return true; +} + +b2Vec2 b2FrictionJoint::GetAnchorA() const +{ + return m_bodyA->GetWorldPoint(m_localAnchorA); +} + +b2Vec2 b2FrictionJoint::GetAnchorB() const +{ + return m_bodyB->GetWorldPoint(m_localAnchorB); +} + +b2Vec2 b2FrictionJoint::GetReactionForce(float32 inv_dt) const +{ + return inv_dt * m_linearImpulse; +} + +float32 b2FrictionJoint::GetReactionTorque(float32 inv_dt) const +{ + return inv_dt * m_angularImpulse; +} + +void b2FrictionJoint::SetMaxForce(float32 force) +{ + b2Assert(b2IsValid(force) && force >= 0.0f); + m_maxForce = force; +} + +float32 b2FrictionJoint::GetMaxForce() const +{ + return m_maxForce; +} + +void b2FrictionJoint::SetMaxTorque(float32 torque) +{ + b2Assert(b2IsValid(torque) && torque >= 0.0f); + m_maxTorque = torque; +} + +float32 b2FrictionJoint::GetMaxTorque() const +{ + return m_maxTorque; +} + +void b2FrictionJoint::Dump() +{ + int32 indexA = m_bodyA->m_islandIndex; + int32 indexB = m_bodyB->m_islandIndex; + + b2Log(" b2FrictionJointDef jd;\n"); + b2Log(" jd.bodyA = bodies[%d];\n", indexA); + b2Log(" jd.bodyB = bodies[%d];\n", indexB); + b2Log(" jd.collideConnected = bool(%d);\n", m_collideConnected); + b2Log(" jd.localAnchorA.Set(%.15lef, %.15lef);\n", m_localAnchorA.x, m_localAnchorA.y); + b2Log(" jd.localAnchorB.Set(%.15lef, %.15lef);\n", m_localAnchorB.x, m_localAnchorB.y); + b2Log(" jd.maxForce = %.15lef;\n", m_maxForce); + b2Log(" jd.maxTorque = %.15lef;\n", m_maxTorque); + b2Log(" joints[%d] = m_world->CreateJoint(&jd);\n", m_index); +} diff --git a/external/Box2D/Dynamics/Joints/b2FrictionJoint.h b/external/Box2D/Dynamics/Joints/b2FrictionJoint.h new file mode 100644 index 0000000000..3ee40c6298 --- /dev/null +++ b/external/Box2D/Dynamics/Joints/b2FrictionJoint.h @@ -0,0 +1,119 @@ +/* +* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_FRICTION_JOINT_H +#define B2_FRICTION_JOINT_H + +#include + +/// Friction joint definition. +struct b2FrictionJointDef : public b2JointDef +{ + b2FrictionJointDef() + { + type = e_frictionJoint; + localAnchorA.SetZero(); + localAnchorB.SetZero(); + maxForce = 0.0f; + maxTorque = 0.0f; + } + + /// Initialize the bodies, anchors, axis, and reference angle using the world + /// anchor and world axis. + void Initialize(b2Body* bodyA, b2Body* bodyB, const b2Vec2& anchor); + + /// The local anchor point relative to bodyA's origin. + b2Vec2 localAnchorA; + + /// The local anchor point relative to bodyB's origin. + b2Vec2 localAnchorB; + + /// The maximum friction force in N. + float32 maxForce; + + /// The maximum friction torque in N-m. + float32 maxTorque; +}; + +/// Friction joint. This is used for top-down friction. +/// It provides 2D translational friction and angular friction. +class b2FrictionJoint : public b2Joint +{ +public: + b2Vec2 GetAnchorA() const; + b2Vec2 GetAnchorB() const; + + b2Vec2 GetReactionForce(float32 inv_dt) const; + float32 GetReactionTorque(float32 inv_dt) const; + + /// The local anchor point relative to bodyA's origin. + const b2Vec2& GetLocalAnchorA() const { return m_localAnchorA; } + + /// The local anchor point relative to bodyB's origin. + const b2Vec2& GetLocalAnchorB() const { return m_localAnchorB; } + + /// Set the maximum friction force in N. + void SetMaxForce(float32 force); + + /// Get the maximum friction force in N. + float32 GetMaxForce() const; + + /// Set the maximum friction torque in N*m. + void SetMaxTorque(float32 torque); + + /// Get the maximum friction torque in N*m. + float32 GetMaxTorque() const; + + /// Dump joint to dmLog + void Dump(); + +protected: + + friend class b2Joint; + + b2FrictionJoint(const b2FrictionJointDef* def); + + void InitVelocityConstraints(const b2SolverData& data); + void SolveVelocityConstraints(const b2SolverData& data); + bool SolvePositionConstraints(const b2SolverData& data); + + b2Vec2 m_localAnchorA; + b2Vec2 m_localAnchorB; + + // Solver shared + b2Vec2 m_linearImpulse; + float32 m_angularImpulse; + float32 m_maxForce; + float32 m_maxTorque; + + // Solver temp + int32 m_indexA; + int32 m_indexB; + b2Vec2 m_rA; + b2Vec2 m_rB; + b2Vec2 m_localCenterA; + b2Vec2 m_localCenterB; + float32 m_invMassA; + float32 m_invMassB; + float32 m_invIA; + float32 m_invIB; + b2Mat22 m_linearMass; + float32 m_angularMass; +}; + +#endif diff --git a/external/Box2D/Dynamics/Joints/b2GearJoint.cpp b/external/Box2D/Dynamics/Joints/b2GearJoint.cpp new file mode 100644 index 0000000000..9741cdd5a4 --- /dev/null +++ b/external/Box2D/Dynamics/Joints/b2GearJoint.cpp @@ -0,0 +1,423 @@ +/* +* Copyright (c) 2007-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include +#include +#include + +// Gear Joint: +// C0 = (coordinate1 + ratio * coordinate2)_initial +// C = (coordinate1 + ratio * coordinate2) - C0 = 0 +// J = [J1 ratio * J2] +// K = J * invM * JT +// = J1 * invM1 * J1T + ratio * ratio * J2 * invM2 * J2T +// +// Revolute: +// coordinate = rotation +// Cdot = angularVelocity +// J = [0 0 1] +// K = J * invM * JT = invI +// +// Prismatic: +// coordinate = dot(p - pg, ug) +// Cdot = dot(v + cross(w, r), ug) +// J = [ug cross(r, ug)] +// K = J * invM * JT = invMass + invI * cross(r, ug)^2 + +b2GearJoint::b2GearJoint(const b2GearJointDef* def) +: b2Joint(def) +{ + m_joint1 = def->joint1; + m_joint2 = def->joint2; + + m_typeA = m_joint1->GetType(); + m_typeB = m_joint2->GetType(); + + b2Assert(m_typeA == e_revoluteJoint || m_typeA == e_prismaticJoint); + b2Assert(m_typeB == e_revoluteJoint || m_typeB == e_prismaticJoint); + + float32 coordinateA, coordinateB; + + // TODO_ERIN there might be some problem with the joint edges in b2Joint. + + m_bodyC = m_joint1->GetBodyA(); + m_bodyA = m_joint1->GetBodyB(); + + // Get geometry of joint1 + b2Transform xfA = m_bodyA->m_xf; + float32 aA = m_bodyA->m_sweep.a; + b2Transform xfC = m_bodyC->m_xf; + float32 aC = m_bodyC->m_sweep.a; + + if (m_typeA == e_revoluteJoint) + { + b2RevoluteJoint* revolute = (b2RevoluteJoint*)def->joint1; + m_localAnchorC = revolute->m_localAnchorA; + m_localAnchorA = revolute->m_localAnchorB; + m_referenceAngleA = revolute->m_referenceAngle; + m_localAxisC.SetZero(); + + coordinateA = aA - aC - m_referenceAngleA; + } + else + { + b2PrismaticJoint* prismatic = (b2PrismaticJoint*)def->joint1; + m_localAnchorC = prismatic->m_localAnchorA; + m_localAnchorA = prismatic->m_localAnchorB; + m_referenceAngleA = prismatic->m_referenceAngle; + m_localAxisC = prismatic->m_localXAxisA; + + b2Vec2 pC = m_localAnchorC; + b2Vec2 pA = b2MulT(xfC.q, b2Mul(xfA.q, m_localAnchorA) + (xfA.p - xfC.p)); + coordinateA = b2Dot(pA - pC, m_localAxisC); + } + + m_bodyD = m_joint2->GetBodyA(); + m_bodyB = m_joint2->GetBodyB(); + + // Get geometry of joint2 + b2Transform xfB = m_bodyB->m_xf; + float32 aB = m_bodyB->m_sweep.a; + b2Transform xfD = m_bodyD->m_xf; + float32 aD = m_bodyD->m_sweep.a; + + if (m_typeB == e_revoluteJoint) + { + b2RevoluteJoint* revolute = (b2RevoluteJoint*)def->joint2; + m_localAnchorD = revolute->m_localAnchorA; + m_localAnchorB = revolute->m_localAnchorB; + m_referenceAngleB = revolute->m_referenceAngle; + m_localAxisD.SetZero(); + + coordinateB = aB - aD - m_referenceAngleB; + } + else + { + b2PrismaticJoint* prismatic = (b2PrismaticJoint*)def->joint2; + m_localAnchorD = prismatic->m_localAnchorA; + m_localAnchorB = prismatic->m_localAnchorB; + m_referenceAngleB = prismatic->m_referenceAngle; + m_localAxisD = prismatic->m_localXAxisA; + + b2Vec2 pD = m_localAnchorD; + b2Vec2 pB = b2MulT(xfD.q, b2Mul(xfB.q, m_localAnchorB) + (xfB.p - xfD.p)); + coordinateB = b2Dot(pB - pD, m_localAxisD); + } + + m_ratio = def->ratio; + + m_constant = coordinateA + m_ratio * coordinateB; + + m_impulse = 0.0f; +} + +void b2GearJoint::InitVelocityConstraints(const b2SolverData& data) +{ + m_indexA = m_bodyA->m_islandIndex; + m_indexB = m_bodyB->m_islandIndex; + m_indexC = m_bodyC->m_islandIndex; + m_indexD = m_bodyD->m_islandIndex; + m_lcA = m_bodyA->m_sweep.localCenter; + m_lcB = m_bodyB->m_sweep.localCenter; + m_lcC = m_bodyC->m_sweep.localCenter; + m_lcD = m_bodyD->m_sweep.localCenter; + m_mA = m_bodyA->m_invMass; + m_mB = m_bodyB->m_invMass; + m_mC = m_bodyC->m_invMass; + m_mD = m_bodyD->m_invMass; + m_iA = m_bodyA->m_invI; + m_iB = m_bodyB->m_invI; + m_iC = m_bodyC->m_invI; + m_iD = m_bodyD->m_invI; + + b2Vec2 cA = data.positions[m_indexA].c; + float32 aA = data.positions[m_indexA].a; + b2Vec2 vA = data.velocities[m_indexA].v; + float32 wA = data.velocities[m_indexA].w; + + b2Vec2 cB = data.positions[m_indexB].c; + float32 aB = data.positions[m_indexB].a; + b2Vec2 vB = data.velocities[m_indexB].v; + float32 wB = data.velocities[m_indexB].w; + + b2Vec2 cC = data.positions[m_indexC].c; + float32 aC = data.positions[m_indexC].a; + b2Vec2 vC = data.velocities[m_indexC].v; + float32 wC = data.velocities[m_indexC].w; + + b2Vec2 cD = data.positions[m_indexD].c; + float32 aD = data.positions[m_indexD].a; + b2Vec2 vD = data.velocities[m_indexD].v; + float32 wD = data.velocities[m_indexD].w; + + b2Rot qA(aA), qB(aB), qC(aC), qD(aD); + + m_mass = 0.0f; + + if (m_typeA == e_revoluteJoint) + { + m_JvAC.SetZero(); + m_JwA = 1.0f; + m_JwC = 1.0f; + m_mass += m_iA + m_iC; + } + else + { + b2Vec2 u = b2Mul(qC, m_localAxisC); + b2Vec2 rC = b2Mul(qC, m_localAnchorC - m_lcC); + b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_lcA); + m_JvAC = u; + m_JwC = b2Cross(rC, u); + m_JwA = b2Cross(rA, u); + m_mass += m_mC + m_mA + m_iC * m_JwC * m_JwC + m_iA * m_JwA * m_JwA; + } + + if (m_typeB == e_revoluteJoint) + { + m_JvBD.SetZero(); + m_JwB = m_ratio; + m_JwD = m_ratio; + m_mass += m_ratio * m_ratio * (m_iB + m_iD); + } + else + { + b2Vec2 u = b2Mul(qD, m_localAxisD); + b2Vec2 rD = b2Mul(qD, m_localAnchorD - m_lcD); + b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_lcB); + m_JvBD = m_ratio * u; + m_JwD = m_ratio * b2Cross(rD, u); + m_JwB = m_ratio * b2Cross(rB, u); + m_mass += m_ratio * m_ratio * (m_mD + m_mB) + m_iD * m_JwD * m_JwD + m_iB * m_JwB * m_JwB; + } + + // Compute effective mass. + m_mass = m_mass > 0.0f ? 1.0f / m_mass : 0.0f; + + if (data.step.warmStarting) + { + vA += (m_mA * m_impulse) * m_JvAC; + wA += m_iA * m_impulse * m_JwA; + vB += (m_mB * m_impulse) * m_JvBD; + wB += m_iB * m_impulse * m_JwB; + vC -= (m_mC * m_impulse) * m_JvAC; + wC -= m_iC * m_impulse * m_JwC; + vD -= (m_mD * m_impulse) * m_JvBD; + wD -= m_iD * m_impulse * m_JwD; + } + else + { + m_impulse = 0.0f; + } + + data.velocities[m_indexA].v = vA; + data.velocities[m_indexA].w = wA; + data.velocities[m_indexB].v = vB; + data.velocities[m_indexB].w = wB; + data.velocities[m_indexC].v = vC; + data.velocities[m_indexC].w = wC; + data.velocities[m_indexD].v = vD; + data.velocities[m_indexD].w = wD; +} + +void b2GearJoint::SolveVelocityConstraints(const b2SolverData& data) +{ + b2Vec2 vA = data.velocities[m_indexA].v; + float32 wA = data.velocities[m_indexA].w; + b2Vec2 vB = data.velocities[m_indexB].v; + float32 wB = data.velocities[m_indexB].w; + b2Vec2 vC = data.velocities[m_indexC].v; + float32 wC = data.velocities[m_indexC].w; + b2Vec2 vD = data.velocities[m_indexD].v; + float32 wD = data.velocities[m_indexD].w; + + float32 Cdot = b2Dot(m_JvAC, vA - vC) + b2Dot(m_JvBD, vB - vD); + Cdot += (m_JwA * wA - m_JwC * wC) + (m_JwB * wB - m_JwD * wD); + + float32 impulse = -m_mass * Cdot; + m_impulse += impulse; + + vA += (m_mA * impulse) * m_JvAC; + wA += m_iA * impulse * m_JwA; + vB += (m_mB * impulse) * m_JvBD; + wB += m_iB * impulse * m_JwB; + vC -= (m_mC * impulse) * m_JvAC; + wC -= m_iC * impulse * m_JwC; + vD -= (m_mD * impulse) * m_JvBD; + wD -= m_iD * impulse * m_JwD; + + data.velocities[m_indexA].v = vA; + data.velocities[m_indexA].w = wA; + data.velocities[m_indexB].v = vB; + data.velocities[m_indexB].w = wB; + data.velocities[m_indexC].v = vC; + data.velocities[m_indexC].w = wC; + data.velocities[m_indexD].v = vD; + data.velocities[m_indexD].w = wD; +} + +bool b2GearJoint::SolvePositionConstraints(const b2SolverData& data) +{ + b2Vec2 cA = data.positions[m_indexA].c; + float32 aA = data.positions[m_indexA].a; + b2Vec2 cB = data.positions[m_indexB].c; + float32 aB = data.positions[m_indexB].a; + b2Vec2 cC = data.positions[m_indexC].c; + float32 aC = data.positions[m_indexC].a; + b2Vec2 cD = data.positions[m_indexD].c; + float32 aD = data.positions[m_indexD].a; + + b2Rot qA(aA), qB(aB), qC(aC), qD(aD); + + float32 linearError = 0.0f; + + float32 coordinateA, coordinateB; + + b2Vec2 JvAC, JvBD; + float32 JwA, JwB, JwC, JwD; + float32 mass = 0.0f; + + if (m_typeA == e_revoluteJoint) + { + JvAC.SetZero(); + JwA = 1.0f; + JwC = 1.0f; + mass += m_iA + m_iC; + + coordinateA = aA - aC - m_referenceAngleA; + } + else + { + b2Vec2 u = b2Mul(qC, m_localAxisC); + b2Vec2 rC = b2Mul(qC, m_localAnchorC - m_lcC); + b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_lcA); + JvAC = u; + JwC = b2Cross(rC, u); + JwA = b2Cross(rA, u); + mass += m_mC + m_mA + m_iC * JwC * JwC + m_iA * JwA * JwA; + + b2Vec2 pC = m_localAnchorC - m_lcC; + b2Vec2 pA = b2MulT(qC, rA + (cA - cC)); + coordinateA = b2Dot(pA - pC, m_localAxisC); + } + + if (m_typeB == e_revoluteJoint) + { + JvBD.SetZero(); + JwB = m_ratio; + JwD = m_ratio; + mass += m_ratio * m_ratio * (m_iB + m_iD); + + coordinateB = aB - aD - m_referenceAngleB; + } + else + { + b2Vec2 u = b2Mul(qD, m_localAxisD); + b2Vec2 rD = b2Mul(qD, m_localAnchorD - m_lcD); + b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_lcB); + JvBD = m_ratio * u; + JwD = m_ratio * b2Cross(rD, u); + JwB = m_ratio * b2Cross(rB, u); + mass += m_ratio * m_ratio * (m_mD + m_mB) + m_iD * JwD * JwD + m_iB * JwB * JwB; + + b2Vec2 pD = m_localAnchorD - m_lcD; + b2Vec2 pB = b2MulT(qD, rB + (cB - cD)); + coordinateB = b2Dot(pB - pD, m_localAxisD); + } + + float32 C = (coordinateA + m_ratio * coordinateB) - m_constant; + + float32 impulse = 0.0f; + if (mass > 0.0f) + { + impulse = -C / mass; + } + + cA += m_mA * impulse * JvAC; + aA += m_iA * impulse * JwA; + cB += m_mB * impulse * JvBD; + aB += m_iB * impulse * JwB; + cC -= m_mC * impulse * JvAC; + aC -= m_iC * impulse * JwC; + cD -= m_mD * impulse * JvBD; + aD -= m_iD * impulse * JwD; + + data.positions[m_indexA].c = cA; + data.positions[m_indexA].a = aA; + data.positions[m_indexB].c = cB; + data.positions[m_indexB].a = aB; + data.positions[m_indexC].c = cC; + data.positions[m_indexC].a = aC; + data.positions[m_indexD].c = cD; + data.positions[m_indexD].a = aD; + + // TODO_ERIN not implemented + return linearError < b2_linearSlop; +} + +b2Vec2 b2GearJoint::GetAnchorA() const +{ + return m_bodyA->GetWorldPoint(m_localAnchorA); +} + +b2Vec2 b2GearJoint::GetAnchorB() const +{ + return m_bodyB->GetWorldPoint(m_localAnchorB); +} + +b2Vec2 b2GearJoint::GetReactionForce(float32 inv_dt) const +{ + b2Vec2 P = m_impulse * m_JvAC; + return inv_dt * P; +} + +float32 b2GearJoint::GetReactionTorque(float32 inv_dt) const +{ + float32 L = m_impulse * m_JwA; + return inv_dt * L; +} + +void b2GearJoint::SetRatio(float32 ratio) +{ + b2Assert(b2IsValid(ratio)); + m_ratio = ratio; +} + +float32 b2GearJoint::GetRatio() const +{ + return m_ratio; +} + +void b2GearJoint::Dump() +{ + int32 indexA = m_bodyA->m_islandIndex; + int32 indexB = m_bodyB->m_islandIndex; + + int32 index1 = m_joint1->m_index; + int32 index2 = m_joint2->m_index; + + b2Log(" b2GearJointDef jd;\n"); + b2Log(" jd.bodyA = bodies[%d];\n", indexA); + b2Log(" jd.bodyB = bodies[%d];\n", indexB); + b2Log(" jd.collideConnected = bool(%d);\n", m_collideConnected); + b2Log(" jd.joint1 = joints[%d];\n", index1); + b2Log(" jd.joint2 = joints[%d];\n", index2); + b2Log(" jd.ratio = %.15lef;\n", m_ratio); + b2Log(" joints[%d] = m_world->CreateJoint(&jd);\n", m_index); +} diff --git a/external/Box2D/Dynamics/Joints/b2GearJoint.h b/external/Box2D/Dynamics/Joints/b2GearJoint.h new file mode 100644 index 0000000000..f926bf6ef1 --- /dev/null +++ b/external/Box2D/Dynamics/Joints/b2GearJoint.h @@ -0,0 +1,125 @@ +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_GEAR_JOINT_H +#define B2_GEAR_JOINT_H + +#include + +/// Gear joint definition. This definition requires two existing +/// revolute or prismatic joints (any combination will work). +struct b2GearJointDef : public b2JointDef +{ + b2GearJointDef() + { + type = e_gearJoint; + joint1 = NULL; + joint2 = NULL; + ratio = 1.0f; + } + + /// The first revolute/prismatic joint attached to the gear joint. + b2Joint* joint1; + + /// The second revolute/prismatic joint attached to the gear joint. + b2Joint* joint2; + + /// The gear ratio. + /// @see b2GearJoint for explanation. + float32 ratio; +}; + +/// A gear joint is used to connect two joints together. Either joint +/// can be a revolute or prismatic joint. You specify a gear ratio +/// to bind the motions together: +/// coordinate1 + ratio * coordinate2 = constant +/// The ratio can be negative or positive. If one joint is a revolute joint +/// and the other joint is a prismatic joint, then the ratio will have units +/// of length or units of 1/length. +/// @warning You have to manually destroy the gear joint if joint1 or joint2 +/// is destroyed. +class b2GearJoint : public b2Joint +{ +public: + b2Vec2 GetAnchorA() const; + b2Vec2 GetAnchorB() const; + + b2Vec2 GetReactionForce(float32 inv_dt) const; + float32 GetReactionTorque(float32 inv_dt) const; + + /// Get the first joint. + b2Joint* GetJoint1() { return m_joint1; } + + /// Get the second joint. + b2Joint* GetJoint2() { return m_joint2; } + + /// Set/Get the gear ratio. + void SetRatio(float32 ratio); + float32 GetRatio() const; + + /// Dump joint to dmLog + void Dump(); + +protected: + + friend class b2Joint; + b2GearJoint(const b2GearJointDef* data); + + void InitVelocityConstraints(const b2SolverData& data); + void SolveVelocityConstraints(const b2SolverData& data); + bool SolvePositionConstraints(const b2SolverData& data); + + b2Joint* m_joint1; + b2Joint* m_joint2; + + b2JointType m_typeA; + b2JointType m_typeB; + + // Body A is connected to body C + // Body B is connected to body D + b2Body* m_bodyC; + b2Body* m_bodyD; + + // Solver shared + b2Vec2 m_localAnchorA; + b2Vec2 m_localAnchorB; + b2Vec2 m_localAnchorC; + b2Vec2 m_localAnchorD; + + b2Vec2 m_localAxisC; + b2Vec2 m_localAxisD; + + float32 m_referenceAngleA; + float32 m_referenceAngleB; + + float32 m_constant; + float32 m_ratio; + + float32 m_impulse; + + // Solver temp + int32 m_indexA, m_indexB, m_indexC, m_indexD; + b2Vec2 m_lcA, m_lcB, m_lcC, m_lcD; + float32 m_mA, m_mB, m_mC, m_mD; + float32 m_iA, m_iB, m_iC, m_iD; + b2Vec2 m_JvAC, m_JvBD; + float32 m_JwA, m_JwB, m_JwC, m_JwD; + float32 m_mass; +}; + +#endif diff --git a/external/Box2D/Dynamics/Joints/b2Joint.cpp b/external/Box2D/Dynamics/Joints/b2Joint.cpp new file mode 100644 index 0000000000..6853b09f0b --- /dev/null +++ b/external/Box2D/Dynamics/Joints/b2Joint.cpp @@ -0,0 +1,199 @@ +/* +* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +b2Joint* b2Joint::Create(const b2JointDef* def, b2BlockAllocator* allocator) +{ + b2Joint* joint = NULL; + + switch (def->type) + { + case e_distanceJoint: + { + void* mem = allocator->Allocate(sizeof(b2DistanceJoint)); + joint = new (mem) b2DistanceJoint((b2DistanceJointDef*)def); + } + break; + + case e_mouseJoint: + { + void* mem = allocator->Allocate(sizeof(b2MouseJoint)); + joint = new (mem) b2MouseJoint((b2MouseJointDef*)def); + } + break; + + case e_prismaticJoint: + { + void* mem = allocator->Allocate(sizeof(b2PrismaticJoint)); + joint = new (mem) b2PrismaticJoint((b2PrismaticJointDef*)def); + } + break; + + case e_revoluteJoint: + { + void* mem = allocator->Allocate(sizeof(b2RevoluteJoint)); + joint = new (mem) b2RevoluteJoint((b2RevoluteJointDef*)def); + } + break; + + case e_pulleyJoint: + { + void* mem = allocator->Allocate(sizeof(b2PulleyJoint)); + joint = new (mem) b2PulleyJoint((b2PulleyJointDef*)def); + } + break; + + case e_gearJoint: + { + void* mem = allocator->Allocate(sizeof(b2GearJoint)); + joint = new (mem) b2GearJoint((b2GearJointDef*)def); + } + break; + + case e_wheelJoint: + { + void* mem = allocator->Allocate(sizeof(b2WheelJoint)); + joint = new (mem) b2WheelJoint((b2WheelJointDef*)def); + } + break; + + case e_weldJoint: + { + void* mem = allocator->Allocate(sizeof(b2WeldJoint)); + joint = new (mem) b2WeldJoint((b2WeldJointDef*)def); + } + break; + + case e_frictionJoint: + { + void* mem = allocator->Allocate(sizeof(b2FrictionJoint)); + joint = new (mem) b2FrictionJoint((b2FrictionJointDef*)def); + } + break; + + case e_ropeJoint: + { + void* mem = allocator->Allocate(sizeof(b2RopeJoint)); + joint = new (mem) b2RopeJoint((b2RopeJointDef*)def); + } + break; + + default: + b2Assert(false); + break; + } + + return joint; +} + +void b2Joint::Destroy(b2Joint* joint, b2BlockAllocator* allocator) +{ + joint->~b2Joint(); + switch (joint->m_type) + { + case e_distanceJoint: + allocator->Free(joint, sizeof(b2DistanceJoint)); + break; + + case e_mouseJoint: + allocator->Free(joint, sizeof(b2MouseJoint)); + break; + + case e_prismaticJoint: + allocator->Free(joint, sizeof(b2PrismaticJoint)); + break; + + case e_revoluteJoint: + allocator->Free(joint, sizeof(b2RevoluteJoint)); + break; + + case e_pulleyJoint: + allocator->Free(joint, sizeof(b2PulleyJoint)); + break; + + case e_gearJoint: + allocator->Free(joint, sizeof(b2GearJoint)); + break; + + case e_wheelJoint: + allocator->Free(joint, sizeof(b2WheelJoint)); + break; + + case e_weldJoint: + allocator->Free(joint, sizeof(b2WeldJoint)); + break; + + case e_frictionJoint: + allocator->Free(joint, sizeof(b2FrictionJoint)); + break; + + case e_ropeJoint: + allocator->Free(joint, sizeof(b2RopeJoint)); + break; + + default: + b2Assert(false); + break; + } +} + +b2Joint::b2Joint(const b2JointDef* def) +{ + b2Assert(def->bodyA != def->bodyB); + + m_type = def->type; + m_prev = NULL; + m_next = NULL; + m_bodyA = def->bodyA; + m_bodyB = def->bodyB; + m_index = 0; + m_collideConnected = def->collideConnected; + m_islandFlag = false; + m_userData = def->userData; + + m_edgeA.joint = NULL; + m_edgeA.other = NULL; + m_edgeA.prev = NULL; + m_edgeA.next = NULL; + + m_edgeB.joint = NULL; + m_edgeB.other = NULL; + m_edgeB.prev = NULL; + m_edgeB.next = NULL; +} + +bool b2Joint::IsActive() const +{ + return m_bodyA->IsActive() && m_bodyB->IsActive(); +} diff --git a/external/Box2D/Dynamics/Joints/b2Joint.h b/external/Box2D/Dynamics/Joints/b2Joint.h new file mode 100644 index 0000000000..b4ea576665 --- /dev/null +++ b/external/Box2D/Dynamics/Joints/b2Joint.h @@ -0,0 +1,222 @@ +/* +* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_JOINT_H +#define B2_JOINT_H + +#include + +class b2Body; +class b2Joint; +struct b2SolverData; +class b2BlockAllocator; + +enum b2JointType +{ + e_unknownJoint, + e_revoluteJoint, + e_prismaticJoint, + e_distanceJoint, + e_pulleyJoint, + e_mouseJoint, + e_gearJoint, + e_wheelJoint, + e_weldJoint, + e_frictionJoint, + e_ropeJoint +}; + +enum b2LimitState +{ + e_inactiveLimit, + e_atLowerLimit, + e_atUpperLimit, + e_equalLimits +}; + +struct b2Jacobian +{ + b2Vec2 linear; + float32 angularA; + float32 angularB; +}; + +/// A joint edge is used to connect bodies and joints together +/// in a joint graph where each body is a node and each joint +/// is an edge. A joint edge belongs to a doubly linked list +/// maintained in each attached body. Each joint has two joint +/// nodes, one for each attached body. +struct b2JointEdge +{ + b2Body* other; ///< provides quick access to the other body attached. + b2Joint* joint; ///< the joint + b2JointEdge* prev; ///< the previous joint edge in the body's joint list + b2JointEdge* next; ///< the next joint edge in the body's joint list +}; + +/// Joint definitions are used to construct joints. +struct b2JointDef +{ + b2JointDef() + { + type = e_unknownJoint; + userData = NULL; + bodyA = NULL; + bodyB = NULL; + collideConnected = false; + } + + /// The joint type is set automatically for concrete joint types. + b2JointType type; + + /// Use this to attach application specific data to your joints. + void* userData; + + /// The first attached body. + b2Body* bodyA; + + /// The second attached body. + b2Body* bodyB; + + /// Set this flag to true if the attached bodies should collide. + bool collideConnected; +}; + +/// The base joint class. Joints are used to constraint two bodies together in +/// various fashions. Some joints also feature limits and motors. +class b2Joint +{ +public: + + /// Get the type of the concrete joint. + b2JointType GetType() const; + + /// Get the first body attached to this joint. + b2Body* GetBodyA(); + + /// Get the second body attached to this joint. + b2Body* GetBodyB(); + + /// Get the anchor point on bodyA in world coordinates. + virtual b2Vec2 GetAnchorA() const = 0; + + /// Get the anchor point on bodyB in world coordinates. + virtual b2Vec2 GetAnchorB() const = 0; + + /// Get the reaction force on bodyB at the joint anchor in Newtons. + virtual b2Vec2 GetReactionForce(float32 inv_dt) const = 0; + + /// Get the reaction torque on bodyB in N*m. + virtual float32 GetReactionTorque(float32 inv_dt) const = 0; + + /// Get the next joint the world joint list. + b2Joint* GetNext(); + const b2Joint* GetNext() const; + + /// Get the user data pointer. + void* GetUserData() const; + + /// Set the user data pointer. + void SetUserData(void* data); + + /// Short-cut function to determine if either body is inactive. + bool IsActive() const; + + /// Get collide connected. + /// Note: modifying the collide connect flag won't work correctly because + /// the flag is only checked when fixture AABBs begin to overlap. + bool GetCollideConnected() const; + + /// Dump this joint to the log file. + virtual void Dump() { b2Log("// Dump is not supported for this joint type.\n"); } + +protected: + friend class b2World; + friend class b2Body; + friend class b2Island; + friend class b2GearJoint; + + static b2Joint* Create(const b2JointDef* def, b2BlockAllocator* allocator); + static void Destroy(b2Joint* joint, b2BlockAllocator* allocator); + + b2Joint(const b2JointDef* def); + virtual ~b2Joint() {} + + virtual void InitVelocityConstraints(const b2SolverData& data) = 0; + virtual void SolveVelocityConstraints(const b2SolverData& data) = 0; + + // This returns true if the position errors are within tolerance. + virtual bool SolvePositionConstraints(const b2SolverData& data) = 0; + + b2JointType m_type; + b2Joint* m_prev; + b2Joint* m_next; + b2JointEdge m_edgeA; + b2JointEdge m_edgeB; + b2Body* m_bodyA; + b2Body* m_bodyB; + + int32 m_index; + + bool m_islandFlag; + bool m_collideConnected; + + void* m_userData; +}; + +inline b2JointType b2Joint::GetType() const +{ + return m_type; +} + +inline b2Body* b2Joint::GetBodyA() +{ + return m_bodyA; +} + +inline b2Body* b2Joint::GetBodyB() +{ + return m_bodyB; +} + +inline b2Joint* b2Joint::GetNext() +{ + return m_next; +} + +inline const b2Joint* b2Joint::GetNext() const +{ + return m_next; +} + +inline void* b2Joint::GetUserData() const +{ + return m_userData; +} + +inline void b2Joint::SetUserData(void* data) +{ + m_userData = data; +} + +inline bool b2Joint::GetCollideConnected() const +{ + return m_collideConnected; +} + +#endif diff --git a/external/Box2D/Dynamics/Joints/b2MouseJoint.cpp b/external/Box2D/Dynamics/Joints/b2MouseJoint.cpp new file mode 100644 index 0000000000..237d9d519a --- /dev/null +++ b/external/Box2D/Dynamics/Joints/b2MouseJoint.cpp @@ -0,0 +1,217 @@ +/* +* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include + +// p = attached point, m = mouse point +// C = p - m +// Cdot = v +// = v + cross(w, r) +// J = [I r_skew] +// Identity used: +// w k % (rx i + ry j) = w * (-ry i + rx j) + +b2MouseJoint::b2MouseJoint(const b2MouseJointDef* def) +: b2Joint(def) +{ + b2Assert(def->target.IsValid()); + b2Assert(b2IsValid(def->maxForce) && def->maxForce >= 0.0f); + b2Assert(b2IsValid(def->frequencyHz) && def->frequencyHz >= 0.0f); + b2Assert(b2IsValid(def->dampingRatio) && def->dampingRatio >= 0.0f); + + m_targetA = def->target; + m_localAnchorB = b2MulT(m_bodyB->GetTransform(), m_targetA); + + m_maxForce = def->maxForce; + m_impulse.SetZero(); + + m_frequencyHz = def->frequencyHz; + m_dampingRatio = def->dampingRatio; + + m_beta = 0.0f; + m_gamma = 0.0f; +} + +void b2MouseJoint::SetTarget(const b2Vec2& target) +{ + if (m_bodyB->IsAwake() == false) + { + m_bodyB->SetAwake(true); + } + m_targetA = target; +} + +const b2Vec2& b2MouseJoint::GetTarget() const +{ + return m_targetA; +} + +void b2MouseJoint::SetMaxForce(float32 force) +{ + m_maxForce = force; +} + +float32 b2MouseJoint::GetMaxForce() const +{ + return m_maxForce; +} + +void b2MouseJoint::SetFrequency(float32 hz) +{ + m_frequencyHz = hz; +} + +float32 b2MouseJoint::GetFrequency() const +{ + return m_frequencyHz; +} + +void b2MouseJoint::SetDampingRatio(float32 ratio) +{ + m_dampingRatio = ratio; +} + +float32 b2MouseJoint::GetDampingRatio() const +{ + return m_dampingRatio; +} + +void b2MouseJoint::InitVelocityConstraints(const b2SolverData& data) +{ + m_indexB = m_bodyB->m_islandIndex; + m_localCenterB = m_bodyB->m_sweep.localCenter; + m_invMassB = m_bodyB->m_invMass; + m_invIB = m_bodyB->m_invI; + + b2Vec2 cB = data.positions[m_indexB].c; + float32 aB = data.positions[m_indexB].a; + b2Vec2 vB = data.velocities[m_indexB].v; + float32 wB = data.velocities[m_indexB].w; + + b2Rot qB(aB); + + float32 mass = m_bodyB->GetMass(); + + // Frequency + float32 omega = 2.0f * b2_pi * m_frequencyHz; + + // Damping coefficient + float32 d = 2.0f * mass * m_dampingRatio * omega; + + // Spring stiffness + float32 k = mass * (omega * omega); + + // magic formulas + // gamma has units of inverse mass. + // beta has units of inverse time. + float32 h = data.step.dt; + b2Assert(d + h * k > b2_epsilon); + m_gamma = h * (d + h * k); + if (m_gamma != 0.0f) + { + m_gamma = 1.0f / m_gamma; + } + m_beta = h * k * m_gamma; + + // Compute the effective mass matrix. + m_rB = b2Mul(qB, m_localAnchorB - m_localCenterB); + + // K = [(1/m1 + 1/m2) * eye(2) - skew(r1) * invI1 * skew(r1) - skew(r2) * invI2 * skew(r2)] + // = [1/m1+1/m2 0 ] + invI1 * [r1.y*r1.y -r1.x*r1.y] + invI2 * [r1.y*r1.y -r1.x*r1.y] + // [ 0 1/m1+1/m2] [-r1.x*r1.y r1.x*r1.x] [-r1.x*r1.y r1.x*r1.x] + b2Mat22 K; + K.ex.x = m_invMassB + m_invIB * m_rB.y * m_rB.y + m_gamma; + K.ex.y = -m_invIB * m_rB.x * m_rB.y; + K.ey.x = K.ex.y; + K.ey.y = m_invMassB + m_invIB * m_rB.x * m_rB.x + m_gamma; + + m_mass = K.GetInverse(); + + m_C = cB + m_rB - m_targetA; + m_C *= m_beta; + + // Cheat with some damping + wB *= 0.98f; + + if (data.step.warmStarting) + { + m_impulse *= data.step.dtRatio; + vB += m_invMassB * m_impulse; + wB += m_invIB * b2Cross(m_rB, m_impulse); + } + else + { + m_impulse.SetZero(); + } + + data.velocities[m_indexB].v = vB; + data.velocities[m_indexB].w = wB; +} + +void b2MouseJoint::SolveVelocityConstraints(const b2SolverData& data) +{ + b2Vec2 vB = data.velocities[m_indexB].v; + float32 wB = data.velocities[m_indexB].w; + + // Cdot = v + cross(w, r) + b2Vec2 Cdot = vB + b2Cross(wB, m_rB); + b2Vec2 impulse = b2Mul(m_mass, -(Cdot + m_C + m_gamma * m_impulse)); + + b2Vec2 oldImpulse = m_impulse; + m_impulse += impulse; + float32 maxImpulse = data.step.dt * m_maxForce; + if (m_impulse.LengthSquared() > maxImpulse * maxImpulse) + { + m_impulse *= maxImpulse / m_impulse.Length(); + } + impulse = m_impulse - oldImpulse; + + vB += m_invMassB * impulse; + wB += m_invIB * b2Cross(m_rB, impulse); + + data.velocities[m_indexB].v = vB; + data.velocities[m_indexB].w = wB; +} + +bool b2MouseJoint::SolvePositionConstraints(const b2SolverData& data) +{ + B2_NOT_USED(data); + return true; +} + +b2Vec2 b2MouseJoint::GetAnchorA() const +{ + return m_targetA; +} + +b2Vec2 b2MouseJoint::GetAnchorB() const +{ + return m_bodyB->GetWorldPoint(m_localAnchorB); +} + +b2Vec2 b2MouseJoint::GetReactionForce(float32 inv_dt) const +{ + return inv_dt * m_impulse; +} + +float32 b2MouseJoint::GetReactionTorque(float32 inv_dt) const +{ + return inv_dt * 0.0f; +} diff --git a/external/Box2D/Dynamics/Joints/b2MouseJoint.h b/external/Box2D/Dynamics/Joints/b2MouseJoint.h new file mode 100644 index 0000000000..1bbc194f4c --- /dev/null +++ b/external/Box2D/Dynamics/Joints/b2MouseJoint.h @@ -0,0 +1,126 @@ +/* +* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_MOUSE_JOINT_H +#define B2_MOUSE_JOINT_H + +#include + +/// Mouse joint definition. This requires a world target point, +/// tuning parameters, and the time step. +struct b2MouseJointDef : public b2JointDef +{ + b2MouseJointDef() + { + type = e_mouseJoint; + target.Set(0.0f, 0.0f); + maxForce = 0.0f; + frequencyHz = 5.0f; + dampingRatio = 0.7f; + } + + /// The initial world target point. This is assumed + /// to coincide with the body anchor initially. + b2Vec2 target; + + /// The maximum constraint force that can be exerted + /// to move the candidate body. Usually you will express + /// as some multiple of the weight (multiplier * mass * gravity). + float32 maxForce; + + /// The response speed. + float32 frequencyHz; + + /// The damping ratio. 0 = no damping, 1 = critical damping. + float32 dampingRatio; +}; + +/// A mouse joint is used to make a point on a body track a +/// specified world point. This a soft constraint with a maximum +/// force. This allows the constraint to stretch and without +/// applying huge forces. +/// NOTE: this joint is not documented in the manual because it was +/// developed to be used in the testbed. If you want to learn how to +/// use the mouse joint, look at the testbed. +class b2MouseJoint : public b2Joint +{ +public: + + /// Implements b2Joint. + b2Vec2 GetAnchorA() const; + + /// Implements b2Joint. + b2Vec2 GetAnchorB() const; + + /// Implements b2Joint. + b2Vec2 GetReactionForce(float32 inv_dt) const; + + /// Implements b2Joint. + float32 GetReactionTorque(float32 inv_dt) const; + + /// Use this to update the target point. + void SetTarget(const b2Vec2& target); + const b2Vec2& GetTarget() const; + + /// Set/get the maximum force in Newtons. + void SetMaxForce(float32 force); + float32 GetMaxForce() const; + + /// Set/get the frequency in Hertz. + void SetFrequency(float32 hz); + float32 GetFrequency() const; + + /// Set/get the damping ratio (dimensionless). + void SetDampingRatio(float32 ratio); + float32 GetDampingRatio() const; + + /// The mouse joint does not support dumping. + void Dump() { b2Log("Mouse joint dumping is not supported.\n"); } + +protected: + friend class b2Joint; + + b2MouseJoint(const b2MouseJointDef* def); + + void InitVelocityConstraints(const b2SolverData& data); + void SolveVelocityConstraints(const b2SolverData& data); + bool SolvePositionConstraints(const b2SolverData& data); + + b2Vec2 m_localAnchorB; + b2Vec2 m_targetA; + float32 m_frequencyHz; + float32 m_dampingRatio; + float32 m_beta; + + // Solver shared + b2Vec2 m_impulse; + float32 m_maxForce; + float32 m_gamma; + + // Solver temp + int32 m_indexA; + int32 m_indexB; + b2Vec2 m_rB; + b2Vec2 m_localCenterB; + float32 m_invMassB; + float32 m_invIB; + b2Mat22 m_mass; + b2Vec2 m_C; +}; + +#endif diff --git a/external/Box2D/Dynamics/Joints/b2PrismaticJoint.cpp b/external/Box2D/Dynamics/Joints/b2PrismaticJoint.cpp new file mode 100644 index 0000000000..4849f729f5 --- /dev/null +++ b/external/Box2D/Dynamics/Joints/b2PrismaticJoint.cpp @@ -0,0 +1,637 @@ +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include + +// Linear constraint (point-to-line) +// d = p2 - p1 = x2 + r2 - x1 - r1 +// C = dot(perp, d) +// Cdot = dot(d, cross(w1, perp)) + dot(perp, v2 + cross(w2, r2) - v1 - cross(w1, r1)) +// = -dot(perp, v1) - dot(cross(d + r1, perp), w1) + dot(perp, v2) + dot(cross(r2, perp), v2) +// J = [-perp, -cross(d + r1, perp), perp, cross(r2,perp)] +// +// Angular constraint +// C = a2 - a1 + a_initial +// Cdot = w2 - w1 +// J = [0 0 -1 0 0 1] +// +// K = J * invM * JT +// +// J = [-a -s1 a s2] +// [0 -1 0 1] +// a = perp +// s1 = cross(d + r1, a) = cross(p2 - x1, a) +// s2 = cross(r2, a) = cross(p2 - x2, a) + + +// Motor/Limit linear constraint +// C = dot(ax1, d) +// Cdot = = -dot(ax1, v1) - dot(cross(d + r1, ax1), w1) + dot(ax1, v2) + dot(cross(r2, ax1), v2) +// J = [-ax1 -cross(d+r1,ax1) ax1 cross(r2,ax1)] + +// Block Solver +// We develop a block solver that includes the joint limit. This makes the limit stiff (inelastic) even +// when the mass has poor distribution (leading to large torques about the joint anchor points). +// +// The Jacobian has 3 rows: +// J = [-uT -s1 uT s2] // linear +// [0 -1 0 1] // angular +// [-vT -a1 vT a2] // limit +// +// u = perp +// v = axis +// s1 = cross(d + r1, u), s2 = cross(r2, u) +// a1 = cross(d + r1, v), a2 = cross(r2, v) + +// M * (v2 - v1) = JT * df +// J * v2 = bias +// +// v2 = v1 + invM * JT * df +// J * (v1 + invM * JT * df) = bias +// K * df = bias - J * v1 = -Cdot +// K = J * invM * JT +// Cdot = J * v1 - bias +// +// Now solve for f2. +// df = f2 - f1 +// K * (f2 - f1) = -Cdot +// f2 = invK * (-Cdot) + f1 +// +// Clamp accumulated limit impulse. +// lower: f2(3) = max(f2(3), 0) +// upper: f2(3) = min(f2(3), 0) +// +// Solve for correct f2(1:2) +// K(1:2, 1:2) * f2(1:2) = -Cdot(1:2) - K(1:2,3) * f2(3) + K(1:2,1:3) * f1 +// = -Cdot(1:2) - K(1:2,3) * f2(3) + K(1:2,1:2) * f1(1:2) + K(1:2,3) * f1(3) +// K(1:2, 1:2) * f2(1:2) = -Cdot(1:2) - K(1:2,3) * (f2(3) - f1(3)) + K(1:2,1:2) * f1(1:2) +// f2(1:2) = invK(1:2,1:2) * (-Cdot(1:2) - K(1:2,3) * (f2(3) - f1(3))) + f1(1:2) +// +// Now compute impulse to be applied: +// df = f2 - f1 + +void b2PrismaticJointDef::Initialize(b2Body* bA, b2Body* bB, const b2Vec2& anchor, const b2Vec2& axis) +{ + bodyA = bA; + bodyB = bB; + localAnchorA = bodyA->GetLocalPoint(anchor); + localAnchorB = bodyB->GetLocalPoint(anchor); + localAxisA = bodyA->GetLocalVector(axis); + referenceAngle = bodyB->GetAngle() - bodyA->GetAngle(); +} + +b2PrismaticJoint::b2PrismaticJoint(const b2PrismaticJointDef* def) +: b2Joint(def) +{ + m_localAnchorA = def->localAnchorA; + m_localAnchorB = def->localAnchorB; + m_localXAxisA = def->localAxisA; + m_localXAxisA.Normalize(); + m_localYAxisA = b2Cross(1.0f, m_localXAxisA); + m_referenceAngle = def->referenceAngle; + + m_impulse.SetZero(); + m_motorMass = 0.0; + m_motorImpulse = 0.0f; + + m_lowerTranslation = def->lowerTranslation; + m_upperTranslation = def->upperTranslation; + m_maxMotorForce = def->maxMotorForce; + m_motorSpeed = def->motorSpeed; + m_enableLimit = def->enableLimit; + m_enableMotor = def->enableMotor; + m_limitState = e_inactiveLimit; + + m_axis.SetZero(); + m_perp.SetZero(); +} + +void b2PrismaticJoint::InitVelocityConstraints(const b2SolverData& data) +{ + m_indexA = m_bodyA->m_islandIndex; + m_indexB = m_bodyB->m_islandIndex; + m_localCenterA = m_bodyA->m_sweep.localCenter; + m_localCenterB = m_bodyB->m_sweep.localCenter; + m_invMassA = m_bodyA->m_invMass; + m_invMassB = m_bodyB->m_invMass; + m_invIA = m_bodyA->m_invI; + m_invIB = m_bodyB->m_invI; + + b2Vec2 cA = data.positions[m_indexA].c; + float32 aA = data.positions[m_indexA].a; + b2Vec2 vA = data.velocities[m_indexA].v; + float32 wA = data.velocities[m_indexA].w; + + b2Vec2 cB = data.positions[m_indexB].c; + float32 aB = data.positions[m_indexB].a; + b2Vec2 vB = data.velocities[m_indexB].v; + float32 wB = data.velocities[m_indexB].w; + + b2Rot qA(aA), qB(aB); + + // Compute the effective masses. + b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA); + b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB); + b2Vec2 d = (cB - cA) + rB - rA; + + float32 mA = m_invMassA, mB = m_invMassB; + float32 iA = m_invIA, iB = m_invIB; + + // Compute motor Jacobian and effective mass. + { + m_axis = b2Mul(qA, m_localXAxisA); + m_a1 = b2Cross(d + rA, m_axis); + m_a2 = b2Cross(rB, m_axis); + + m_motorMass = mA + mB + iA * m_a1 * m_a1 + iB * m_a2 * m_a2; + if (m_motorMass > 0.0f) + { + m_motorMass = 1.0f / m_motorMass; + } + } + + // Prismatic constraint. + { + m_perp = b2Mul(qA, m_localYAxisA); + + m_s1 = b2Cross(d + rA, m_perp); + m_s2 = b2Cross(rB, m_perp); + + float32 k11 = mA + mB + iA * m_s1 * m_s1 + iB * m_s2 * m_s2; + float32 k12 = iA * m_s1 + iB * m_s2; + float32 k13 = iA * m_s1 * m_a1 + iB * m_s2 * m_a2; + float32 k22 = iA + iB; + if (k22 == 0.0f) + { + // For bodies with fixed rotation. + k22 = 1.0f; + } + float32 k23 = iA * m_a1 + iB * m_a2; + float32 k33 = mA + mB + iA * m_a1 * m_a1 + iB * m_a2 * m_a2; + + m_K.ex.Set(k11, k12, k13); + m_K.ey.Set(k12, k22, k23); + m_K.ez.Set(k13, k23, k33); + } + + // Compute motor and limit terms. + if (m_enableLimit) + { + float32 jointTranslation = b2Dot(m_axis, d); + if (b2Abs(m_upperTranslation - m_lowerTranslation) < 2.0f * b2_linearSlop) + { + m_limitState = e_equalLimits; + } + else if (jointTranslation <= m_lowerTranslation) + { + if (m_limitState != e_atLowerLimit) + { + m_limitState = e_atLowerLimit; + m_impulse.z = 0.0f; + } + } + else if (jointTranslation >= m_upperTranslation) + { + if (m_limitState != e_atUpperLimit) + { + m_limitState = e_atUpperLimit; + m_impulse.z = 0.0f; + } + } + else + { + m_limitState = e_inactiveLimit; + m_impulse.z = 0.0f; + } + } + else + { + m_limitState = e_inactiveLimit; + m_impulse.z = 0.0f; + } + + if (m_enableMotor == false) + { + m_motorImpulse = 0.0f; + } + + if (data.step.warmStarting) + { + // Account for variable time step. + m_impulse *= data.step.dtRatio; + m_motorImpulse *= data.step.dtRatio; + + b2Vec2 P = m_impulse.x * m_perp + (m_motorImpulse + m_impulse.z) * m_axis; + float32 LA = m_impulse.x * m_s1 + m_impulse.y + (m_motorImpulse + m_impulse.z) * m_a1; + float32 LB = m_impulse.x * m_s2 + m_impulse.y + (m_motorImpulse + m_impulse.z) * m_a2; + + vA -= mA * P; + wA -= iA * LA; + + vB += mB * P; + wB += iB * LB; + } + else + { + m_impulse.SetZero(); + m_motorImpulse = 0.0f; + } + + data.velocities[m_indexA].v = vA; + data.velocities[m_indexA].w = wA; + data.velocities[m_indexB].v = vB; + data.velocities[m_indexB].w = wB; +} + +void b2PrismaticJoint::SolveVelocityConstraints(const b2SolverData& data) +{ + b2Vec2 vA = data.velocities[m_indexA].v; + float32 wA = data.velocities[m_indexA].w; + b2Vec2 vB = data.velocities[m_indexB].v; + float32 wB = data.velocities[m_indexB].w; + + float32 mA = m_invMassA, mB = m_invMassB; + float32 iA = m_invIA, iB = m_invIB; + + // Solve linear motor constraint. + if (m_enableMotor && m_limitState != e_equalLimits) + { + float32 Cdot = b2Dot(m_axis, vB - vA) + m_a2 * wB - m_a1 * wA; + float32 impulse = m_motorMass * (m_motorSpeed - Cdot); + float32 oldImpulse = m_motorImpulse; + float32 maxImpulse = data.step.dt * m_maxMotorForce; + m_motorImpulse = b2Clamp(m_motorImpulse + impulse, -maxImpulse, maxImpulse); + impulse = m_motorImpulse - oldImpulse; + + b2Vec2 P = impulse * m_axis; + float32 LA = impulse * m_a1; + float32 LB = impulse * m_a2; + + vA -= mA * P; + wA -= iA * LA; + + vB += mB * P; + wB += iB * LB; + } + + b2Vec2 Cdot1; + Cdot1.x = b2Dot(m_perp, vB - vA) + m_s2 * wB - m_s1 * wA; + Cdot1.y = wB - wA; + + if (m_enableLimit && m_limitState != e_inactiveLimit) + { + // Solve prismatic and limit constraint in block form. + float32 Cdot2; + Cdot2 = b2Dot(m_axis, vB - vA) + m_a2 * wB - m_a1 * wA; + b2Vec3 Cdot(Cdot1.x, Cdot1.y, Cdot2); + + b2Vec3 f1 = m_impulse; + b2Vec3 df = m_K.Solve33(-Cdot); + m_impulse += df; + + if (m_limitState == e_atLowerLimit) + { + m_impulse.z = b2Max(m_impulse.z, 0.0f); + } + else if (m_limitState == e_atUpperLimit) + { + m_impulse.z = b2Min(m_impulse.z, 0.0f); + } + + // f2(1:2) = invK(1:2,1:2) * (-Cdot(1:2) - K(1:2,3) * (f2(3) - f1(3))) + f1(1:2) + b2Vec2 b = -Cdot1 - (m_impulse.z - f1.z) * b2Vec2(m_K.ez.x, m_K.ez.y); + b2Vec2 f2r = m_K.Solve22(b) + b2Vec2(f1.x, f1.y); + m_impulse.x = f2r.x; + m_impulse.y = f2r.y; + + df = m_impulse - f1; + + b2Vec2 P = df.x * m_perp + df.z * m_axis; + float32 LA = df.x * m_s1 + df.y + df.z * m_a1; + float32 LB = df.x * m_s2 + df.y + df.z * m_a2; + + vA -= mA * P; + wA -= iA * LA; + + vB += mB * P; + wB += iB * LB; + } + else + { + // Limit is inactive, just solve the prismatic constraint in block form. + b2Vec2 df = m_K.Solve22(-Cdot1); + m_impulse.x += df.x; + m_impulse.y += df.y; + + b2Vec2 P = df.x * m_perp; + float32 LA = df.x * m_s1 + df.y; + float32 LB = df.x * m_s2 + df.y; + + vA -= mA * P; + wA -= iA * LA; + + vB += mB * P; + wB += iB * LB; + + b2Vec2 Cdot10 = Cdot1; + + Cdot1.x = b2Dot(m_perp, vB - vA) + m_s2 * wB - m_s1 * wA; + Cdot1.y = wB - wA; + + if (b2Abs(Cdot1.x) > 0.01f || b2Abs(Cdot1.y) > 0.01f) + { + b2Vec2 test = b2Mul22(m_K, df); + Cdot1.x += 0.0f; + } + } + + data.velocities[m_indexA].v = vA; + data.velocities[m_indexA].w = wA; + data.velocities[m_indexB].v = vB; + data.velocities[m_indexB].w = wB; +} + +bool b2PrismaticJoint::SolvePositionConstraints(const b2SolverData& data) +{ + b2Vec2 cA = data.positions[m_indexA].c; + float32 aA = data.positions[m_indexA].a; + b2Vec2 cB = data.positions[m_indexB].c; + float32 aB = data.positions[m_indexB].a; + + b2Rot qA(aA), qB(aB); + + float32 mA = m_invMassA, mB = m_invMassB; + float32 iA = m_invIA, iB = m_invIB; + + // Compute fresh Jacobians + b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA); + b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB); + b2Vec2 d = cB + rB - cA - rA; + + b2Vec2 axis = b2Mul(qA, m_localXAxisA); + float32 a1 = b2Cross(d + rA, axis); + float32 a2 = b2Cross(rB, axis); + b2Vec2 perp = b2Mul(qA, m_localYAxisA); + + float32 s1 = b2Cross(d + rA, perp); + float32 s2 = b2Cross(rB, perp); + + b2Vec3 impulse; + b2Vec2 C1; + C1.x = b2Dot(perp, d); + C1.y = aB - aA - m_referenceAngle; + + float32 linearError = b2Abs(C1.x); + float32 angularError = b2Abs(C1.y); + + bool active = false; + float32 C2 = 0.0f; + if (m_enableLimit) + { + float32 translation = b2Dot(axis, d); + if (b2Abs(m_upperTranslation - m_lowerTranslation) < 2.0f * b2_linearSlop) + { + // Prevent large angular corrections + C2 = b2Clamp(translation, -b2_maxLinearCorrection, b2_maxLinearCorrection); + linearError = b2Max(linearError, b2Abs(translation)); + active = true; + } + else if (translation <= m_lowerTranslation) + { + // Prevent large linear corrections and allow some slop. + C2 = b2Clamp(translation - m_lowerTranslation + b2_linearSlop, -b2_maxLinearCorrection, 0.0f); + linearError = b2Max(linearError, m_lowerTranslation - translation); + active = true; + } + else if (translation >= m_upperTranslation) + { + // Prevent large linear corrections and allow some slop. + C2 = b2Clamp(translation - m_upperTranslation - b2_linearSlop, 0.0f, b2_maxLinearCorrection); + linearError = b2Max(linearError, translation - m_upperTranslation); + active = true; + } + } + + if (active) + { + float32 k11 = mA + mB + iA * s1 * s1 + iB * s2 * s2; + float32 k12 = iA * s1 + iB * s2; + float32 k13 = iA * s1 * a1 + iB * s2 * a2; + float32 k22 = iA + iB; + if (k22 == 0.0f) + { + // For fixed rotation + k22 = 1.0f; + } + float32 k23 = iA * a1 + iB * a2; + float32 k33 = mA + mB + iA * a1 * a1 + iB * a2 * a2; + + b2Mat33 K; + K.ex.Set(k11, k12, k13); + K.ey.Set(k12, k22, k23); + K.ez.Set(k13, k23, k33); + + b2Vec3 C; + C.x = C1.x; + C.y = C1.y; + C.z = C2; + + impulse = K.Solve33(-C); + } + else + { + float32 k11 = mA + mB + iA * s1 * s1 + iB * s2 * s2; + float32 k12 = iA * s1 + iB * s2; + float32 k22 = iA + iB; + if (k22 == 0.0f) + { + k22 = 1.0f; + } + + b2Mat22 K; + K.ex.Set(k11, k12); + K.ey.Set(k12, k22); + + b2Vec2 impulse1 = K.Solve(-C1); + impulse.x = impulse1.x; + impulse.y = impulse1.y; + impulse.z = 0.0f; + } + + b2Vec2 P = impulse.x * perp + impulse.z * axis; + float32 LA = impulse.x * s1 + impulse.y + impulse.z * a1; + float32 LB = impulse.x * s2 + impulse.y + impulse.z * a2; + + cA -= mA * P; + aA -= iA * LA; + cB += mB * P; + aB += iB * LB; + + data.positions[m_indexA].c = cA; + data.positions[m_indexA].a = aA; + data.positions[m_indexB].c = cB; + data.positions[m_indexB].a = aB; + + return linearError <= b2_linearSlop && angularError <= b2_angularSlop; +} + +b2Vec2 b2PrismaticJoint::GetAnchorA() const +{ + return m_bodyA->GetWorldPoint(m_localAnchorA); +} + +b2Vec2 b2PrismaticJoint::GetAnchorB() const +{ + return m_bodyB->GetWorldPoint(m_localAnchorB); +} + +b2Vec2 b2PrismaticJoint::GetReactionForce(float32 inv_dt) const +{ + return inv_dt * (m_impulse.x * m_perp + (m_motorImpulse + m_impulse.z) * m_axis); +} + +float32 b2PrismaticJoint::GetReactionTorque(float32 inv_dt) const +{ + return inv_dt * m_impulse.y; +} + +float32 b2PrismaticJoint::GetJointTranslation() const +{ + b2Vec2 pA = m_bodyA->GetWorldPoint(m_localAnchorA); + b2Vec2 pB = m_bodyB->GetWorldPoint(m_localAnchorB); + b2Vec2 d = pB - pA; + b2Vec2 axis = m_bodyA->GetWorldVector(m_localXAxisA); + + float32 translation = b2Dot(d, axis); + return translation; +} + +float32 b2PrismaticJoint::GetJointSpeed() const +{ + b2Body* bA = m_bodyA; + b2Body* bB = m_bodyB; + + b2Vec2 rA = b2Mul(bA->m_xf.q, m_localAnchorA - bA->m_sweep.localCenter); + b2Vec2 rB = b2Mul(bB->m_xf.q, m_localAnchorB - bB->m_sweep.localCenter); + b2Vec2 p1 = bA->m_sweep.c + rA; + b2Vec2 p2 = bB->m_sweep.c + rB; + b2Vec2 d = p2 - p1; + b2Vec2 axis = b2Mul(bA->m_xf.q, m_localXAxisA); + + b2Vec2 vA = bA->m_linearVelocity; + b2Vec2 vB = bB->m_linearVelocity; + float32 wA = bA->m_angularVelocity; + float32 wB = bB->m_angularVelocity; + + float32 speed = b2Dot(d, b2Cross(wA, axis)) + b2Dot(axis, vB + b2Cross(wB, rB) - vA - b2Cross(wA, rA)); + return speed; +} + +bool b2PrismaticJoint::IsLimitEnabled() const +{ + return m_enableLimit; +} + +void b2PrismaticJoint::EnableLimit(bool flag) +{ + if (flag != m_enableLimit) + { + m_bodyA->SetAwake(true); + m_bodyB->SetAwake(true); + m_enableLimit = flag; + m_impulse.z = 0.0f; + } +} + +float32 b2PrismaticJoint::GetLowerLimit() const +{ + return m_lowerTranslation; +} + +float32 b2PrismaticJoint::GetUpperLimit() const +{ + return m_upperTranslation; +} + +void b2PrismaticJoint::SetLimits(float32 lower, float32 upper) +{ + b2Assert(lower <= upper); + if (lower != m_lowerTranslation || upper != m_upperTranslation) + { + m_bodyA->SetAwake(true); + m_bodyB->SetAwake(true); + m_lowerTranslation = lower; + m_upperTranslation = upper; + m_impulse.z = 0.0f; + } +} + +bool b2PrismaticJoint::IsMotorEnabled() const +{ + return m_enableMotor; +} + +void b2PrismaticJoint::EnableMotor(bool flag) +{ + m_bodyA->SetAwake(true); + m_bodyB->SetAwake(true); + m_enableMotor = flag; +} + +void b2PrismaticJoint::SetMotorSpeed(float32 speed) +{ + m_bodyA->SetAwake(true); + m_bodyB->SetAwake(true); + m_motorSpeed = speed; +} + +void b2PrismaticJoint::SetMaxMotorForce(float32 force) +{ + m_bodyA->SetAwake(true); + m_bodyB->SetAwake(true); + m_maxMotorForce = force; +} + +float32 b2PrismaticJoint::GetMotorForce(float32 inv_dt) const +{ + return inv_dt * m_motorImpulse; +} + +void b2PrismaticJoint::Dump() +{ + int32 indexA = m_bodyA->m_islandIndex; + int32 indexB = m_bodyB->m_islandIndex; + + b2Log(" b2PrismaticJointDef jd;\n"); + b2Log(" jd.bodyA = bodies[%d];\n", indexA); + b2Log(" jd.bodyB = bodies[%d];\n", indexB); + b2Log(" jd.collideConnected = bool(%d);\n", m_collideConnected); + b2Log(" jd.localAnchorA.Set(%.15lef, %.15lef);\n", m_localAnchorA.x, m_localAnchorA.y); + b2Log(" jd.localAnchorB.Set(%.15lef, %.15lef);\n", m_localAnchorB.x, m_localAnchorB.y); + b2Log(" jd.localAxisA.Set(%.15lef, %.15lef);\n", m_localXAxisA.x, m_localXAxisA.y); + b2Log(" jd.referenceAngle = %.15lef;\n", m_referenceAngle); + b2Log(" jd.enableLimit = bool(%d);\n", m_enableLimit); + b2Log(" jd.lowerTranslation = %.15lef;\n", m_lowerTranslation); + b2Log(" jd.upperTranslation = %.15lef;\n", m_upperTranslation); + b2Log(" jd.enableMotor = bool(%d);\n", m_enableMotor); + b2Log(" jd.motorSpeed = %.15lef;\n", m_motorSpeed); + b2Log(" jd.maxMotorForce = %.15lef;\n", m_maxMotorForce); + b2Log(" joints[%d] = m_world->CreateJoint(&jd);\n", m_index); +} diff --git a/external/Box2D/Dynamics/Joints/b2PrismaticJoint.h b/external/Box2D/Dynamics/Joints/b2PrismaticJoint.h new file mode 100644 index 0000000000..aca2859b45 --- /dev/null +++ b/external/Box2D/Dynamics/Joints/b2PrismaticJoint.h @@ -0,0 +1,196 @@ +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_PRISMATIC_JOINT_H +#define B2_PRISMATIC_JOINT_H + +#include + +/// Prismatic joint definition. This requires defining a line of +/// motion using an axis and an anchor point. The definition uses local +/// anchor points and a local axis so that the initial configuration +/// can violate the constraint slightly. The joint translation is zero +/// when the local anchor points coincide in world space. Using local +/// anchors and a local axis helps when saving and loading a game. +struct b2PrismaticJointDef : public b2JointDef +{ + b2PrismaticJointDef() + { + type = e_prismaticJoint; + localAnchorA.SetZero(); + localAnchorB.SetZero(); + localAxisA.Set(1.0f, 0.0f); + referenceAngle = 0.0f; + enableLimit = false; + lowerTranslation = 0.0f; + upperTranslation = 0.0f; + enableMotor = false; + maxMotorForce = 0.0f; + motorSpeed = 0.0f; + } + + /// Initialize the bodies, anchors, axis, and reference angle using the world + /// anchor and unit world axis. + void Initialize(b2Body* bodyA, b2Body* bodyB, const b2Vec2& anchor, const b2Vec2& axis); + + /// The local anchor point relative to bodyA's origin. + b2Vec2 localAnchorA; + + /// The local anchor point relative to bodyB's origin. + b2Vec2 localAnchorB; + + /// The local translation unit axis in bodyA. + b2Vec2 localAxisA; + + /// The constrained angle between the bodies: bodyB_angle - bodyA_angle. + float32 referenceAngle; + + /// Enable/disable the joint limit. + bool enableLimit; + + /// The lower translation limit, usually in meters. + float32 lowerTranslation; + + /// The upper translation limit, usually in meters. + float32 upperTranslation; + + /// Enable/disable the joint motor. + bool enableMotor; + + /// The maximum motor torque, usually in N-m. + float32 maxMotorForce; + + /// The desired motor speed in radians per second. + float32 motorSpeed; +}; + +/// A prismatic joint. This joint provides one degree of freedom: translation +/// along an axis fixed in bodyA. Relative rotation is prevented. You can +/// use a joint limit to restrict the range of motion and a joint motor to +/// drive the motion or to model joint friction. +class b2PrismaticJoint : public b2Joint +{ +public: + b2Vec2 GetAnchorA() const; + b2Vec2 GetAnchorB() const; + + b2Vec2 GetReactionForce(float32 inv_dt) const; + float32 GetReactionTorque(float32 inv_dt) const; + + /// The local anchor point relative to bodyA's origin. + const b2Vec2& GetLocalAnchorA() const { return m_localAnchorA; } + + /// The local anchor point relative to bodyB's origin. + const b2Vec2& GetLocalAnchorB() const { return m_localAnchorB; } + + /// The local joint axis relative to bodyA. + const b2Vec2& GetLocalAxisA() const { return m_localXAxisA; } + + /// Get the reference angle. + float32 GetReferenceAngle() const { return m_referenceAngle; } + + /// Get the current joint translation, usually in meters. + float32 GetJointTranslation() const; + + /// Get the current joint translation speed, usually in meters per second. + float32 GetJointSpeed() const; + + /// Is the joint limit enabled? + bool IsLimitEnabled() const; + + /// Enable/disable the joint limit. + void EnableLimit(bool flag); + + /// Get the lower joint limit, usually in meters. + float32 GetLowerLimit() const; + + /// Get the upper joint limit, usually in meters. + float32 GetUpperLimit() const; + + /// Set the joint limits, usually in meters. + void SetLimits(float32 lower, float32 upper); + + /// Is the joint motor enabled? + bool IsMotorEnabled() const; + + /// Enable/disable the joint motor. + void EnableMotor(bool flag); + + /// Set the motor speed, usually in meters per second. + void SetMotorSpeed(float32 speed); + + /// Get the motor speed, usually in meters per second. + float32 GetMotorSpeed() const; + + /// Set the maximum motor force, usually in N. + void SetMaxMotorForce(float32 force); + float32 GetMaxMotorForce() const { return m_maxMotorForce; } + + /// Get the current motor force given the inverse time step, usually in N. + float32 GetMotorForce(float32 inv_dt) const; + + /// Dump to b2Log + void Dump(); + +protected: + friend class b2Joint; + friend class b2GearJoint; + b2PrismaticJoint(const b2PrismaticJointDef* def); + + void InitVelocityConstraints(const b2SolverData& data); + void SolveVelocityConstraints(const b2SolverData& data); + bool SolvePositionConstraints(const b2SolverData& data); + + // Solver shared + b2Vec2 m_localAnchorA; + b2Vec2 m_localAnchorB; + b2Vec2 m_localXAxisA; + b2Vec2 m_localYAxisA; + float32 m_referenceAngle; + b2Vec3 m_impulse; + float32 m_motorImpulse; + float32 m_lowerTranslation; + float32 m_upperTranslation; + float32 m_maxMotorForce; + float32 m_motorSpeed; + bool m_enableLimit; + bool m_enableMotor; + b2LimitState m_limitState; + + // Solver temp + int32 m_indexA; + int32 m_indexB; + b2Vec2 m_localCenterA; + b2Vec2 m_localCenterB; + float32 m_invMassA; + float32 m_invMassB; + float32 m_invIA; + float32 m_invIB; + b2Vec2 m_axis, m_perp; + float32 m_s1, m_s2; + float32 m_a1, m_a2; + b2Mat33 m_K; + float32 m_motorMass; +}; + +inline float32 b2PrismaticJoint::GetMotorSpeed() const +{ + return m_motorSpeed; +} + +#endif diff --git a/external/Box2D/Dynamics/Joints/b2PulleyJoint.cpp b/external/Box2D/Dynamics/Joints/b2PulleyJoint.cpp new file mode 100644 index 0000000000..da30fae222 --- /dev/null +++ b/external/Box2D/Dynamics/Joints/b2PulleyJoint.cpp @@ -0,0 +1,332 @@ +/* +* Copyright (c) 2007 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include + +// Pulley: +// length1 = norm(p1 - s1) +// length2 = norm(p2 - s2) +// C0 = (length1 + ratio * length2)_initial +// C = C0 - (length1 + ratio * length2) +// u1 = (p1 - s1) / norm(p1 - s1) +// u2 = (p2 - s2) / norm(p2 - s2) +// Cdot = -dot(u1, v1 + cross(w1, r1)) - ratio * dot(u2, v2 + cross(w2, r2)) +// J = -[u1 cross(r1, u1) ratio * u2 ratio * cross(r2, u2)] +// K = J * invM * JT +// = invMass1 + invI1 * cross(r1, u1)^2 + ratio^2 * (invMass2 + invI2 * cross(r2, u2)^2) + +void b2PulleyJointDef::Initialize(b2Body* bA, b2Body* bB, + const b2Vec2& groundA, const b2Vec2& groundB, + const b2Vec2& anchorA, const b2Vec2& anchorB, + float32 r) +{ + bodyA = bA; + bodyB = bB; + groundAnchorA = groundA; + groundAnchorB = groundB; + localAnchorA = bodyA->GetLocalPoint(anchorA); + localAnchorB = bodyB->GetLocalPoint(anchorB); + b2Vec2 dA = anchorA - groundA; + lengthA = dA.Length(); + b2Vec2 dB = anchorB - groundB; + lengthB = dB.Length(); + ratio = r; + b2Assert(ratio > b2_epsilon); +} + +b2PulleyJoint::b2PulleyJoint(const b2PulleyJointDef* def) +: b2Joint(def) +{ + m_groundAnchorA = def->groundAnchorA; + m_groundAnchorB = def->groundAnchorB; + m_localAnchorA = def->localAnchorA; + m_localAnchorB = def->localAnchorB; + + m_lengthA = def->lengthA; + m_lengthB = def->lengthB; + + b2Assert(def->ratio != 0.0f); + m_ratio = def->ratio; + + m_constant = def->lengthA + m_ratio * def->lengthB; + + m_impulse = 0.0f; +} + +void b2PulleyJoint::InitVelocityConstraints(const b2SolverData& data) +{ + m_indexA = m_bodyA->m_islandIndex; + m_indexB = m_bodyB->m_islandIndex; + m_localCenterA = m_bodyA->m_sweep.localCenter; + m_localCenterB = m_bodyB->m_sweep.localCenter; + m_invMassA = m_bodyA->m_invMass; + m_invMassB = m_bodyB->m_invMass; + m_invIA = m_bodyA->m_invI; + m_invIB = m_bodyB->m_invI; + + b2Vec2 cA = data.positions[m_indexA].c; + float32 aA = data.positions[m_indexA].a; + b2Vec2 vA = data.velocities[m_indexA].v; + float32 wA = data.velocities[m_indexA].w; + + b2Vec2 cB = data.positions[m_indexB].c; + float32 aB = data.positions[m_indexB].a; + b2Vec2 vB = data.velocities[m_indexB].v; + float32 wB = data.velocities[m_indexB].w; + + b2Rot qA(aA), qB(aB); + + m_rA = b2Mul(qA, m_localAnchorA - m_localCenterA); + m_rB = b2Mul(qB, m_localAnchorB - m_localCenterB); + + // Get the pulley axes. + m_uA = cA + m_rA - m_groundAnchorA; + m_uB = cB + m_rB - m_groundAnchorB; + + float32 lengthA = m_uA.Length(); + float32 lengthB = m_uB.Length(); + + if (lengthA > 10.0f * b2_linearSlop) + { + m_uA *= 1.0f / lengthA; + } + else + { + m_uA.SetZero(); + } + + if (lengthB > 10.0f * b2_linearSlop) + { + m_uB *= 1.0f / lengthB; + } + else + { + m_uB.SetZero(); + } + + // Compute effective mass. + float32 ruA = b2Cross(m_rA, m_uA); + float32 ruB = b2Cross(m_rB, m_uB); + + float32 mA = m_invMassA + m_invIA * ruA * ruA; + float32 mB = m_invMassB + m_invIB * ruB * ruB; + + m_mass = mA + m_ratio * m_ratio * mB; + + if (m_mass > 0.0f) + { + m_mass = 1.0f / m_mass; + } + + if (data.step.warmStarting) + { + // Scale impulses to support variable time steps. + m_impulse *= data.step.dtRatio; + + // Warm starting. + b2Vec2 PA = -(m_impulse) * m_uA; + b2Vec2 PB = (-m_ratio * m_impulse) * m_uB; + + vA += m_invMassA * PA; + wA += m_invIA * b2Cross(m_rA, PA); + vB += m_invMassB * PB; + wB += m_invIB * b2Cross(m_rB, PB); + } + else + { + m_impulse = 0.0f; + } + + data.velocities[m_indexA].v = vA; + data.velocities[m_indexA].w = wA; + data.velocities[m_indexB].v = vB; + data.velocities[m_indexB].w = wB; +} + +void b2PulleyJoint::SolveVelocityConstraints(const b2SolverData& data) +{ + b2Vec2 vA = data.velocities[m_indexA].v; + float32 wA = data.velocities[m_indexA].w; + b2Vec2 vB = data.velocities[m_indexB].v; + float32 wB = data.velocities[m_indexB].w; + + b2Vec2 vpA = vA + b2Cross(wA, m_rA); + b2Vec2 vpB = vB + b2Cross(wB, m_rB); + + float32 Cdot = -b2Dot(m_uA, vpA) - m_ratio * b2Dot(m_uB, vpB); + float32 impulse = -m_mass * Cdot; + m_impulse += impulse; + + b2Vec2 PA = -impulse * m_uA; + b2Vec2 PB = -m_ratio * impulse * m_uB; + vA += m_invMassA * PA; + wA += m_invIA * b2Cross(m_rA, PA); + vB += m_invMassB * PB; + wB += m_invIB * b2Cross(m_rB, PB); + + data.velocities[m_indexA].v = vA; + data.velocities[m_indexA].w = wA; + data.velocities[m_indexB].v = vB; + data.velocities[m_indexB].w = wB; +} + +bool b2PulleyJoint::SolvePositionConstraints(const b2SolverData& data) +{ + b2Vec2 cA = data.positions[m_indexA].c; + float32 aA = data.positions[m_indexA].a; + b2Vec2 cB = data.positions[m_indexB].c; + float32 aB = data.positions[m_indexB].a; + + b2Rot qA(aA), qB(aB); + + b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA); + b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB); + + // Get the pulley axes. + b2Vec2 uA = cA + rA - m_groundAnchorA; + b2Vec2 uB = cB + rB - m_groundAnchorB; + + float32 lengthA = uA.Length(); + float32 lengthB = uB.Length(); + + if (lengthA > 10.0f * b2_linearSlop) + { + uA *= 1.0f / lengthA; + } + else + { + uA.SetZero(); + } + + if (lengthB > 10.0f * b2_linearSlop) + { + uB *= 1.0f / lengthB; + } + else + { + uB.SetZero(); + } + + // Compute effective mass. + float32 ruA = b2Cross(rA, uA); + float32 ruB = b2Cross(rB, uB); + + float32 mA = m_invMassA + m_invIA * ruA * ruA; + float32 mB = m_invMassB + m_invIB * ruB * ruB; + + float32 mass = mA + m_ratio * m_ratio * mB; + + if (mass > 0.0f) + { + mass = 1.0f / mass; + } + + float32 C = m_constant - lengthA - m_ratio * lengthB; + float32 linearError = b2Abs(C); + + float32 impulse = -mass * C; + + b2Vec2 PA = -impulse * uA; + b2Vec2 PB = -m_ratio * impulse * uB; + + cA += m_invMassA * PA; + aA += m_invIA * b2Cross(rA, PA); + cB += m_invMassB * PB; + aB += m_invIB * b2Cross(rB, PB); + + data.positions[m_indexA].c = cA; + data.positions[m_indexA].a = aA; + data.positions[m_indexB].c = cB; + data.positions[m_indexB].a = aB; + + return linearError < b2_linearSlop; +} + +b2Vec2 b2PulleyJoint::GetAnchorA() const +{ + return m_bodyA->GetWorldPoint(m_localAnchorA); +} + +b2Vec2 b2PulleyJoint::GetAnchorB() const +{ + return m_bodyB->GetWorldPoint(m_localAnchorB); +} + +b2Vec2 b2PulleyJoint::GetReactionForce(float32 inv_dt) const +{ + b2Vec2 P = m_impulse * m_uB; + return inv_dt * P; +} + +float32 b2PulleyJoint::GetReactionTorque(float32 inv_dt) const +{ + B2_NOT_USED(inv_dt); + return 0.0f; +} + +b2Vec2 b2PulleyJoint::GetGroundAnchorA() const +{ + return m_groundAnchorA; +} + +b2Vec2 b2PulleyJoint::GetGroundAnchorB() const +{ + return m_groundAnchorB; +} + +float32 b2PulleyJoint::GetLengthA() const +{ + b2Vec2 p = m_bodyA->GetWorldPoint(m_localAnchorA); + b2Vec2 s = m_groundAnchorA; + b2Vec2 d = p - s; + return d.Length(); +} + +float32 b2PulleyJoint::GetLengthB() const +{ + b2Vec2 p = m_bodyB->GetWorldPoint(m_localAnchorB); + b2Vec2 s = m_groundAnchorB; + b2Vec2 d = p - s; + return d.Length(); +} + +float32 b2PulleyJoint::GetRatio() const +{ + return m_ratio; +} + +void b2PulleyJoint::Dump() +{ + int32 indexA = m_bodyA->m_islandIndex; + int32 indexB = m_bodyB->m_islandIndex; + + b2Log(" b2PulleyJointDef jd;\n"); + b2Log(" jd.bodyA = bodies[%d];\n", indexA); + b2Log(" jd.bodyB = bodies[%d];\n", indexB); + b2Log(" jd.collideConnected = bool(%d);\n", m_collideConnected); + b2Log(" jd.groundAnchorA.Set(%.15lef, %.15lef);\n", m_groundAnchorA.x, m_groundAnchorA.y); + b2Log(" jd.groundAnchorB.Set(%.15lef, %.15lef);\n", m_groundAnchorB.x, m_groundAnchorB.y); + b2Log(" jd.localAnchorA.Set(%.15lef, %.15lef);\n", m_localAnchorA.x, m_localAnchorA.y); + b2Log(" jd.localAnchorB.Set(%.15lef, %.15lef);\n", m_localAnchorB.x, m_localAnchorB.y); + b2Log(" jd.lengthA = %.15lef;\n", m_lengthA); + b2Log(" jd.lengthB = %.15lef;\n", m_lengthB); + b2Log(" jd.ratio = %.15lef;\n", m_ratio); + b2Log(" joints[%d] = m_world->CreateJoint(&jd);\n", m_index); +} diff --git a/external/Box2D/Dynamics/Joints/b2PulleyJoint.h b/external/Box2D/Dynamics/Joints/b2PulleyJoint.h new file mode 100644 index 0000000000..2f6df4395c --- /dev/null +++ b/external/Box2D/Dynamics/Joints/b2PulleyJoint.h @@ -0,0 +1,143 @@ +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_PULLEY_JOINT_H +#define B2_PULLEY_JOINT_H + +#include + +const float32 b2_minPulleyLength = 2.0f; + +/// Pulley joint definition. This requires two ground anchors, +/// two dynamic body anchor points, and a pulley ratio. +struct b2PulleyJointDef : public b2JointDef +{ + b2PulleyJointDef() + { + type = e_pulleyJoint; + groundAnchorA.Set(-1.0f, 1.0f); + groundAnchorB.Set(1.0f, 1.0f); + localAnchorA.Set(-1.0f, 0.0f); + localAnchorB.Set(1.0f, 0.0f); + lengthA = 0.0f; + lengthB = 0.0f; + ratio = 1.0f; + collideConnected = true; + } + + /// Initialize the bodies, anchors, lengths, max lengths, and ratio using the world anchors. + void Initialize(b2Body* bodyA, b2Body* bodyB, + const b2Vec2& groundAnchorA, const b2Vec2& groundAnchorB, + const b2Vec2& anchorA, const b2Vec2& anchorB, + float32 ratio); + + /// The first ground anchor in world coordinates. This point never moves. + b2Vec2 groundAnchorA; + + /// The second ground anchor in world coordinates. This point never moves. + b2Vec2 groundAnchorB; + + /// The local anchor point relative to bodyA's origin. + b2Vec2 localAnchorA; + + /// The local anchor point relative to bodyB's origin. + b2Vec2 localAnchorB; + + /// The a reference length for the segment attached to bodyA. + float32 lengthA; + + /// The a reference length for the segment attached to bodyB. + float32 lengthB; + + /// The pulley ratio, used to simulate a block-and-tackle. + float32 ratio; +}; + +/// The pulley joint is connected to two bodies and two fixed ground points. +/// The pulley supports a ratio such that: +/// length1 + ratio * length2 <= constant +/// Yes, the force transmitted is scaled by the ratio. +/// Warning: the pulley joint can get a bit squirrelly by itself. They often +/// work better when combined with prismatic joints. You should also cover the +/// the anchor points with static shapes to prevent one side from going to +/// zero length. +class b2PulleyJoint : public b2Joint +{ +public: + b2Vec2 GetAnchorA() const; + b2Vec2 GetAnchorB() const; + + b2Vec2 GetReactionForce(float32 inv_dt) const; + float32 GetReactionTorque(float32 inv_dt) const; + + /// Get the first ground anchor. + b2Vec2 GetGroundAnchorA() const; + + /// Get the second ground anchor. + b2Vec2 GetGroundAnchorB() const; + + /// Get the current length of the segment attached to bodyA. + float32 GetLengthA() const; + + /// Get the current length of the segment attached to bodyB. + float32 GetLengthB() const; + + /// Get the pulley ratio. + float32 GetRatio() const; + + /// Dump joint to dmLog + void Dump(); + +protected: + + friend class b2Joint; + b2PulleyJoint(const b2PulleyJointDef* data); + + void InitVelocityConstraints(const b2SolverData& data); + void SolveVelocityConstraints(const b2SolverData& data); + bool SolvePositionConstraints(const b2SolverData& data); + + b2Vec2 m_groundAnchorA; + b2Vec2 m_groundAnchorB; + float32 m_lengthA; + float32 m_lengthB; + + // Solver shared + b2Vec2 m_localAnchorA; + b2Vec2 m_localAnchorB; + float32 m_constant; + float32 m_ratio; + float32 m_impulse; + + // Solver temp + int32 m_indexA; + int32 m_indexB; + b2Vec2 m_uA; + b2Vec2 m_uB; + b2Vec2 m_rA; + b2Vec2 m_rB; + b2Vec2 m_localCenterA; + b2Vec2 m_localCenterB; + float32 m_invMassA; + float32 m_invMassB; + float32 m_invIA; + float32 m_invIB; + float32 m_mass; +}; + +#endif diff --git a/external/Box2D/Dynamics/Joints/b2RevoluteJoint.cpp b/external/Box2D/Dynamics/Joints/b2RevoluteJoint.cpp new file mode 100644 index 0000000000..e265d8192b --- /dev/null +++ b/external/Box2D/Dynamics/Joints/b2RevoluteJoint.cpp @@ -0,0 +1,504 @@ +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include + +// Point-to-point constraint +// C = p2 - p1 +// Cdot = v2 - v1 +// = v2 + cross(w2, r2) - v1 - cross(w1, r1) +// J = [-I -r1_skew I r2_skew ] +// Identity used: +// w k % (rx i + ry j) = w * (-ry i + rx j) + +// Motor constraint +// Cdot = w2 - w1 +// J = [0 0 -1 0 0 1] +// K = invI1 + invI2 + +void b2RevoluteJointDef::Initialize(b2Body* bA, b2Body* bB, const b2Vec2& anchor) +{ + bodyA = bA; + bodyB = bB; + localAnchorA = bodyA->GetLocalPoint(anchor); + localAnchorB = bodyB->GetLocalPoint(anchor); + referenceAngle = bodyB->GetAngle() - bodyA->GetAngle(); +} + +b2RevoluteJoint::b2RevoluteJoint(const b2RevoluteJointDef* def) +: b2Joint(def) +{ + m_localAnchorA = def->localAnchorA; + m_localAnchorB = def->localAnchorB; + m_referenceAngle = def->referenceAngle; + + m_impulse.SetZero(); + m_motorImpulse = 0.0f; + + m_lowerAngle = def->lowerAngle; + m_upperAngle = def->upperAngle; + m_maxMotorTorque = def->maxMotorTorque; + m_motorSpeed = def->motorSpeed; + m_enableLimit = def->enableLimit; + m_enableMotor = def->enableMotor; + m_limitState = e_inactiveLimit; +} + +void b2RevoluteJoint::InitVelocityConstraints(const b2SolverData& data) +{ + m_indexA = m_bodyA->m_islandIndex; + m_indexB = m_bodyB->m_islandIndex; + m_localCenterA = m_bodyA->m_sweep.localCenter; + m_localCenterB = m_bodyB->m_sweep.localCenter; + m_invMassA = m_bodyA->m_invMass; + m_invMassB = m_bodyB->m_invMass; + m_invIA = m_bodyA->m_invI; + m_invIB = m_bodyB->m_invI; + + b2Vec2 cA = data.positions[m_indexA].c; + float32 aA = data.positions[m_indexA].a; + b2Vec2 vA = data.velocities[m_indexA].v; + float32 wA = data.velocities[m_indexA].w; + + b2Vec2 cB = data.positions[m_indexB].c; + float32 aB = data.positions[m_indexB].a; + b2Vec2 vB = data.velocities[m_indexB].v; + float32 wB = data.velocities[m_indexB].w; + + b2Rot qA(aA), qB(aB); + + m_rA = b2Mul(qA, m_localAnchorA - m_localCenterA); + m_rB = b2Mul(qB, m_localAnchorB - m_localCenterB); + + // J = [-I -r1_skew I r2_skew] + // [ 0 -1 0 1] + // r_skew = [-ry; rx] + + // Matlab + // K = [ mA+r1y^2*iA+mB+r2y^2*iB, -r1y*iA*r1x-r2y*iB*r2x, -r1y*iA-r2y*iB] + // [ -r1y*iA*r1x-r2y*iB*r2x, mA+r1x^2*iA+mB+r2x^2*iB, r1x*iA+r2x*iB] + // [ -r1y*iA-r2y*iB, r1x*iA+r2x*iB, iA+iB] + + float32 mA = m_invMassA, mB = m_invMassB; + float32 iA = m_invIA, iB = m_invIB; + + bool fixedRotation = (iA + iB == 0.0f); + + m_mass.ex.x = mA + mB + m_rA.y * m_rA.y * iA + m_rB.y * m_rB.y * iB; + m_mass.ey.x = -m_rA.y * m_rA.x * iA - m_rB.y * m_rB.x * iB; + m_mass.ez.x = -m_rA.y * iA - m_rB.y * iB; + m_mass.ex.y = m_mass.ey.x; + m_mass.ey.y = mA + mB + m_rA.x * m_rA.x * iA + m_rB.x * m_rB.x * iB; + m_mass.ez.y = m_rA.x * iA + m_rB.x * iB; + m_mass.ex.z = m_mass.ez.x; + m_mass.ey.z = m_mass.ez.y; + m_mass.ez.z = iA + iB; + + m_motorMass = iA + iB; + if (m_motorMass > 0.0f) + { + m_motorMass = 1.0f / m_motorMass; + } + + if (m_enableMotor == false || fixedRotation) + { + m_motorImpulse = 0.0f; + } + + if (m_enableLimit && fixedRotation == false) + { + float32 jointAngle = aB - aA - m_referenceAngle; + if (b2Abs(m_upperAngle - m_lowerAngle) < 2.0f * b2_angularSlop) + { + m_limitState = e_equalLimits; + } + else if (jointAngle <= m_lowerAngle) + { + if (m_limitState != e_atLowerLimit) + { + m_impulse.z = 0.0f; + } + m_limitState = e_atLowerLimit; + } + else if (jointAngle >= m_upperAngle) + { + if (m_limitState != e_atUpperLimit) + { + m_impulse.z = 0.0f; + } + m_limitState = e_atUpperLimit; + } + else + { + m_limitState = e_inactiveLimit; + m_impulse.z = 0.0f; + } + } + else + { + m_limitState = e_inactiveLimit; + } + + if (data.step.warmStarting) + { + // Scale impulses to support a variable time step. + m_impulse *= data.step.dtRatio; + m_motorImpulse *= data.step.dtRatio; + + b2Vec2 P(m_impulse.x, m_impulse.y); + + vA -= mA * P; + wA -= iA * (b2Cross(m_rA, P) + m_motorImpulse + m_impulse.z); + + vB += mB * P; + wB += iB * (b2Cross(m_rB, P) + m_motorImpulse + m_impulse.z); + } + else + { + m_impulse.SetZero(); + m_motorImpulse = 0.0f; + } + + data.velocities[m_indexA].v = vA; + data.velocities[m_indexA].w = wA; + data.velocities[m_indexB].v = vB; + data.velocities[m_indexB].w = wB; +} + +void b2RevoluteJoint::SolveVelocityConstraints(const b2SolverData& data) +{ + b2Vec2 vA = data.velocities[m_indexA].v; + float32 wA = data.velocities[m_indexA].w; + b2Vec2 vB = data.velocities[m_indexB].v; + float32 wB = data.velocities[m_indexB].w; + + float32 mA = m_invMassA, mB = m_invMassB; + float32 iA = m_invIA, iB = m_invIB; + + bool fixedRotation = (iA + iB == 0.0f); + + // Solve motor constraint. + if (m_enableMotor && m_limitState != e_equalLimits && fixedRotation == false) + { + float32 Cdot = wB - wA - m_motorSpeed; + float32 impulse = -m_motorMass * Cdot; + float32 oldImpulse = m_motorImpulse; + float32 maxImpulse = data.step.dt * m_maxMotorTorque; + m_motorImpulse = b2Clamp(m_motorImpulse + impulse, -maxImpulse, maxImpulse); + impulse = m_motorImpulse - oldImpulse; + + wA -= iA * impulse; + wB += iB * impulse; + } + + // Solve limit constraint. + if (m_enableLimit && m_limitState != e_inactiveLimit && fixedRotation == false) + { + b2Vec2 Cdot1 = vB + b2Cross(wB, m_rB) - vA - b2Cross(wA, m_rA); + float32 Cdot2 = wB - wA; + b2Vec3 Cdot(Cdot1.x, Cdot1.y, Cdot2); + + b2Vec3 impulse = -m_mass.Solve33(Cdot); + + if (m_limitState == e_equalLimits) + { + m_impulse += impulse; + } + else if (m_limitState == e_atLowerLimit) + { + float32 newImpulse = m_impulse.z + impulse.z; + if (newImpulse < 0.0f) + { + b2Vec2 rhs = -Cdot1 + m_impulse.z * b2Vec2(m_mass.ez.x, m_mass.ez.y); + b2Vec2 reduced = m_mass.Solve22(rhs); + impulse.x = reduced.x; + impulse.y = reduced.y; + impulse.z = -m_impulse.z; + m_impulse.x += reduced.x; + m_impulse.y += reduced.y; + m_impulse.z = 0.0f; + } + else + { + m_impulse += impulse; + } + } + else if (m_limitState == e_atUpperLimit) + { + float32 newImpulse = m_impulse.z + impulse.z; + if (newImpulse > 0.0f) + { + b2Vec2 rhs = -Cdot1 + m_impulse.z * b2Vec2(m_mass.ez.x, m_mass.ez.y); + b2Vec2 reduced = m_mass.Solve22(rhs); + impulse.x = reduced.x; + impulse.y = reduced.y; + impulse.z = -m_impulse.z; + m_impulse.x += reduced.x; + m_impulse.y += reduced.y; + m_impulse.z = 0.0f; + } + else + { + m_impulse += impulse; + } + } + + b2Vec2 P(impulse.x, impulse.y); + + vA -= mA * P; + wA -= iA * (b2Cross(m_rA, P) + impulse.z); + + vB += mB * P; + wB += iB * (b2Cross(m_rB, P) + impulse.z); + } + else + { + // Solve point-to-point constraint + b2Vec2 Cdot = vB + b2Cross(wB, m_rB) - vA - b2Cross(wA, m_rA); + b2Vec2 impulse = m_mass.Solve22(-Cdot); + + m_impulse.x += impulse.x; + m_impulse.y += impulse.y; + + vA -= mA * impulse; + wA -= iA * b2Cross(m_rA, impulse); + + vB += mB * impulse; + wB += iB * b2Cross(m_rB, impulse); + } + + data.velocities[m_indexA].v = vA; + data.velocities[m_indexA].w = wA; + data.velocities[m_indexB].v = vB; + data.velocities[m_indexB].w = wB; +} + +bool b2RevoluteJoint::SolvePositionConstraints(const b2SolverData& data) +{ + b2Vec2 cA = data.positions[m_indexA].c; + float32 aA = data.positions[m_indexA].a; + b2Vec2 cB = data.positions[m_indexB].c; + float32 aB = data.positions[m_indexB].a; + + b2Rot qA(aA), qB(aB); + + float32 angularError = 0.0f; + float32 positionError = 0.0f; + + bool fixedRotation = (m_invIA + m_invIB == 0.0f); + + // Solve angular limit constraint. + if (m_enableLimit && m_limitState != e_inactiveLimit && fixedRotation == false) + { + float32 angle = aB - aA - m_referenceAngle; + float32 limitImpulse = 0.0f; + + if (m_limitState == e_equalLimits) + { + // Prevent large angular corrections + float32 C = b2Clamp(angle - m_lowerAngle, -b2_maxAngularCorrection, b2_maxAngularCorrection); + limitImpulse = -m_motorMass * C; + angularError = b2Abs(C); + } + else if (m_limitState == e_atLowerLimit) + { + float32 C = angle - m_lowerAngle; + angularError = -C; + + // Prevent large angular corrections and allow some slop. + C = b2Clamp(C + b2_angularSlop, -b2_maxAngularCorrection, 0.0f); + limitImpulse = -m_motorMass * C; + } + else if (m_limitState == e_atUpperLimit) + { + float32 C = angle - m_upperAngle; + angularError = C; + + // Prevent large angular corrections and allow some slop. + C = b2Clamp(C - b2_angularSlop, 0.0f, b2_maxAngularCorrection); + limitImpulse = -m_motorMass * C; + } + + aA -= m_invIA * limitImpulse; + aB += m_invIB * limitImpulse; + } + + // Solve point-to-point constraint. + { + qA.Set(aA); + qB.Set(aB); + b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA); + b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB); + + b2Vec2 C = cB + rB - cA - rA; + positionError = C.Length(); + + float32 mA = m_invMassA, mB = m_invMassB; + float32 iA = m_invIA, iB = m_invIB; + + b2Mat22 K; + K.ex.x = mA + mB + iA * rA.y * rA.y + iB * rB.y * rB.y; + K.ex.y = -iA * rA.x * rA.y - iB * rB.x * rB.y; + K.ey.x = K.ex.y; + K.ey.y = mA + mB + iA * rA.x * rA.x + iB * rB.x * rB.x; + + b2Vec2 impulse = -K.Solve(C); + + cA -= mA * impulse; + aA -= iA * b2Cross(rA, impulse); + + cB += mB * impulse; + aB += iB * b2Cross(rB, impulse); + } + + data.positions[m_indexA].c = cA; + data.positions[m_indexA].a = aA; + data.positions[m_indexB].c = cB; + data.positions[m_indexB].a = aB; + + return positionError <= b2_linearSlop && angularError <= b2_angularSlop; +} + +b2Vec2 b2RevoluteJoint::GetAnchorA() const +{ + return m_bodyA->GetWorldPoint(m_localAnchorA); +} + +b2Vec2 b2RevoluteJoint::GetAnchorB() const +{ + return m_bodyB->GetWorldPoint(m_localAnchorB); +} + +b2Vec2 b2RevoluteJoint::GetReactionForce(float32 inv_dt) const +{ + b2Vec2 P(m_impulse.x, m_impulse.y); + return inv_dt * P; +} + +float32 b2RevoluteJoint::GetReactionTorque(float32 inv_dt) const +{ + return inv_dt * m_impulse.z; +} + +float32 b2RevoluteJoint::GetJointAngle() const +{ + b2Body* bA = m_bodyA; + b2Body* bB = m_bodyB; + return bB->m_sweep.a - bA->m_sweep.a - m_referenceAngle; +} + +float32 b2RevoluteJoint::GetJointSpeed() const +{ + b2Body* bA = m_bodyA; + b2Body* bB = m_bodyB; + return bB->m_angularVelocity - bA->m_angularVelocity; +} + +bool b2RevoluteJoint::IsMotorEnabled() const +{ + return m_enableMotor; +} + +void b2RevoluteJoint::EnableMotor(bool flag) +{ + m_bodyA->SetAwake(true); + m_bodyB->SetAwake(true); + m_enableMotor = flag; +} + +float32 b2RevoluteJoint::GetMotorTorque(float32 inv_dt) const +{ + return inv_dt * m_motorImpulse; +} + +void b2RevoluteJoint::SetMotorSpeed(float32 speed) +{ + m_bodyA->SetAwake(true); + m_bodyB->SetAwake(true); + m_motorSpeed = speed; +} + +void b2RevoluteJoint::SetMaxMotorTorque(float32 torque) +{ + m_bodyA->SetAwake(true); + m_bodyB->SetAwake(true); + m_maxMotorTorque = torque; +} + +bool b2RevoluteJoint::IsLimitEnabled() const +{ + return m_enableLimit; +} + +void b2RevoluteJoint::EnableLimit(bool flag) +{ + if (flag != m_enableLimit) + { + m_bodyA->SetAwake(true); + m_bodyB->SetAwake(true); + m_enableLimit = flag; + m_impulse.z = 0.0f; + } +} + +float32 b2RevoluteJoint::GetLowerLimit() const +{ + return m_lowerAngle; +} + +float32 b2RevoluteJoint::GetUpperLimit() const +{ + return m_upperAngle; +} + +void b2RevoluteJoint::SetLimits(float32 lower, float32 upper) +{ + b2Assert(lower <= upper); + + if (lower != m_lowerAngle || upper != m_upperAngle) + { + m_bodyA->SetAwake(true); + m_bodyB->SetAwake(true); + m_impulse.z = 0.0f; + m_lowerAngle = lower; + m_upperAngle = upper; + } +} + +void b2RevoluteJoint::Dump() +{ + int32 indexA = m_bodyA->m_islandIndex; + int32 indexB = m_bodyB->m_islandIndex; + + b2Log(" b2RevoluteJointDef jd;\n"); + b2Log(" jd.bodyA = bodies[%d];\n", indexA); + b2Log(" jd.bodyB = bodies[%d];\n", indexB); + b2Log(" jd.collideConnected = bool(%d);\n", m_collideConnected); + b2Log(" jd.localAnchorA.Set(%.15lef, %.15lef);\n", m_localAnchorA.x, m_localAnchorA.y); + b2Log(" jd.localAnchorB.Set(%.15lef, %.15lef);\n", m_localAnchorB.x, m_localAnchorB.y); + b2Log(" jd.referenceAngle = %.15lef;\n", m_referenceAngle); + b2Log(" jd.enableLimit = bool(%d);\n", m_enableLimit); + b2Log(" jd.lowerAngle = %.15lef;\n", m_lowerAngle); + b2Log(" jd.upperAngle = %.15lef;\n", m_upperAngle); + b2Log(" jd.enableMotor = bool(%d);\n", m_enableMotor); + b2Log(" jd.motorSpeed = %.15lef;\n", m_motorSpeed); + b2Log(" jd.maxMotorTorque = %.15lef;\n", m_maxMotorTorque); + b2Log(" joints[%d] = m_world->CreateJoint(&jd);\n", m_index); +} diff --git a/external/Box2D/Dynamics/Joints/b2RevoluteJoint.h b/external/Box2D/Dynamics/Joints/b2RevoluteJoint.h new file mode 100644 index 0000000000..978f16259a --- /dev/null +++ b/external/Box2D/Dynamics/Joints/b2RevoluteJoint.h @@ -0,0 +1,204 @@ +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_REVOLUTE_JOINT_H +#define B2_REVOLUTE_JOINT_H + +#include + +/// Revolute joint definition. This requires defining an +/// anchor point where the bodies are joined. The definition +/// uses local anchor points so that the initial configuration +/// can violate the constraint slightly. You also need to +/// specify the initial relative angle for joint limits. This +/// helps when saving and loading a game. +/// The local anchor points are measured from the body's origin +/// rather than the center of mass because: +/// 1. you might not know where the center of mass will be. +/// 2. if you add/remove shapes from a body and recompute the mass, +/// the joints will be broken. +struct b2RevoluteJointDef : public b2JointDef +{ + b2RevoluteJointDef() + { + type = e_revoluteJoint; + localAnchorA.Set(0.0f, 0.0f); + localAnchorB.Set(0.0f, 0.0f); + referenceAngle = 0.0f; + lowerAngle = 0.0f; + upperAngle = 0.0f; + maxMotorTorque = 0.0f; + motorSpeed = 0.0f; + enableLimit = false; + enableMotor = false; + } + + /// Initialize the bodies, anchors, and reference angle using a world + /// anchor point. + void Initialize(b2Body* bodyA, b2Body* bodyB, const b2Vec2& anchor); + + /// The local anchor point relative to bodyA's origin. + b2Vec2 localAnchorA; + + /// The local anchor point relative to bodyB's origin. + b2Vec2 localAnchorB; + + /// The bodyB angle minus bodyA angle in the reference state (radians). + float32 referenceAngle; + + /// A flag to enable joint limits. + bool enableLimit; + + /// The lower angle for the joint limit (radians). + float32 lowerAngle; + + /// The upper angle for the joint limit (radians). + float32 upperAngle; + + /// A flag to enable the joint motor. + bool enableMotor; + + /// The desired motor speed. Usually in radians per second. + float32 motorSpeed; + + /// The maximum motor torque used to achieve the desired motor speed. + /// Usually in N-m. + float32 maxMotorTorque; +}; + +/// A revolute joint constrains two bodies to share a common point while they +/// are free to rotate about the point. The relative rotation about the shared +/// point is the joint angle. You can limit the relative rotation with +/// a joint limit that specifies a lower and upper angle. You can use a motor +/// to drive the relative rotation about the shared point. A maximum motor torque +/// is provided so that infinite forces are not generated. +class b2RevoluteJoint : public b2Joint +{ +public: + b2Vec2 GetAnchorA() const; + b2Vec2 GetAnchorB() const; + + /// The local anchor point relative to bodyA's origin. + const b2Vec2& GetLocalAnchorA() const { return m_localAnchorA; } + + /// The local anchor point relative to bodyB's origin. + const b2Vec2& GetLocalAnchorB() const { return m_localAnchorB; } + + /// Get the reference angle. + float32 GetReferenceAngle() const { return m_referenceAngle; } + + /// Get the current joint angle in radians. + float32 GetJointAngle() const; + + /// Get the current joint angle speed in radians per second. + float32 GetJointSpeed() const; + + /// Is the joint limit enabled? + bool IsLimitEnabled() const; + + /// Enable/disable the joint limit. + void EnableLimit(bool flag); + + /// Get the lower joint limit in radians. + float32 GetLowerLimit() const; + + /// Get the upper joint limit in radians. + float32 GetUpperLimit() const; + + /// Set the joint limits in radians. + void SetLimits(float32 lower, float32 upper); + + /// Is the joint motor enabled? + bool IsMotorEnabled() const; + + /// Enable/disable the joint motor. + void EnableMotor(bool flag); + + /// Set the motor speed in radians per second. + void SetMotorSpeed(float32 speed); + + /// Get the motor speed in radians per second. + float32 GetMotorSpeed() const; + + /// Set the maximum motor torque, usually in N-m. + void SetMaxMotorTorque(float32 torque); + float32 GetMaxMotorTorque() const { return m_maxMotorTorque; } + + /// Get the reaction force given the inverse time step. + /// Unit is N. + b2Vec2 GetReactionForce(float32 inv_dt) const; + + /// Get the reaction torque due to the joint limit given the inverse time step. + /// Unit is N*m. + float32 GetReactionTorque(float32 inv_dt) const; + + /// Get the current motor torque given the inverse time step. + /// Unit is N*m. + float32 GetMotorTorque(float32 inv_dt) const; + + /// Dump to b2Log. + void Dump(); + +protected: + + friend class b2Joint; + friend class b2GearJoint; + + b2RevoluteJoint(const b2RevoluteJointDef* def); + + void InitVelocityConstraints(const b2SolverData& data); + void SolveVelocityConstraints(const b2SolverData& data); + bool SolvePositionConstraints(const b2SolverData& data); + + // Solver shared + b2Vec2 m_localAnchorA; + b2Vec2 m_localAnchorB; + b2Vec3 m_impulse; + float32 m_motorImpulse; + + bool m_enableMotor; + float32 m_maxMotorTorque; + float32 m_motorSpeed; + + bool m_enableLimit; + float32 m_referenceAngle; + float32 m_lowerAngle; + float32 m_upperAngle; + + // Solver temp + int32 m_indexA; + int32 m_indexB; + b2Vec2 m_rA; + b2Vec2 m_rB; + b2Vec2 m_localCenterA; + b2Vec2 m_localCenterB; + float32 m_invMassA; + float32 m_invMassB; + float32 m_invIA; + float32 m_invIB; + b2Mat33 m_mass; // effective mass for point-to-point constraint. + float32 m_motorMass; // effective mass for motor/limit angular constraint. + b2LimitState m_limitState; +}; + +inline float32 b2RevoluteJoint::GetMotorSpeed() const +{ + return m_motorSpeed; +} + +#endif diff --git a/external/Box2D/Dynamics/Joints/b2RopeJoint.cpp b/external/Box2D/Dynamics/Joints/b2RopeJoint.cpp new file mode 100644 index 0000000000..17a70d9230 --- /dev/null +++ b/external/Box2D/Dynamics/Joints/b2RopeJoint.cpp @@ -0,0 +1,241 @@ +/* +* Copyright (c) 2007-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include + + +// Limit: +// C = norm(pB - pA) - L +// u = (pB - pA) / norm(pB - pA) +// Cdot = dot(u, vB + cross(wB, rB) - vA - cross(wA, rA)) +// J = [-u -cross(rA, u) u cross(rB, u)] +// K = J * invM * JT +// = invMassA + invIA * cross(rA, u)^2 + invMassB + invIB * cross(rB, u)^2 + +b2RopeJoint::b2RopeJoint(const b2RopeJointDef* def) +: b2Joint(def) +{ + m_localAnchorA = def->localAnchorA; + m_localAnchorB = def->localAnchorB; + + m_maxLength = def->maxLength; + + m_mass = 0.0f; + m_impulse = 0.0f; + m_state = e_inactiveLimit; + m_length = 0.0f; +} + +void b2RopeJoint::InitVelocityConstraints(const b2SolverData& data) +{ + m_indexA = m_bodyA->m_islandIndex; + m_indexB = m_bodyB->m_islandIndex; + m_localCenterA = m_bodyA->m_sweep.localCenter; + m_localCenterB = m_bodyB->m_sweep.localCenter; + m_invMassA = m_bodyA->m_invMass; + m_invMassB = m_bodyB->m_invMass; + m_invIA = m_bodyA->m_invI; + m_invIB = m_bodyB->m_invI; + + b2Vec2 cA = data.positions[m_indexA].c; + float32 aA = data.positions[m_indexA].a; + b2Vec2 vA = data.velocities[m_indexA].v; + float32 wA = data.velocities[m_indexA].w; + + b2Vec2 cB = data.positions[m_indexB].c; + float32 aB = data.positions[m_indexB].a; + b2Vec2 vB = data.velocities[m_indexB].v; + float32 wB = data.velocities[m_indexB].w; + + b2Rot qA(aA), qB(aB); + + m_rA = b2Mul(qA, m_localAnchorA - m_localCenterA); + m_rB = b2Mul(qB, m_localAnchorB - m_localCenterB); + m_u = cB + m_rB - cA - m_rA; + + m_length = m_u.Length(); + + float32 C = m_length - m_maxLength; + if (C > 0.0f) + { + m_state = e_atUpperLimit; + } + else + { + m_state = e_inactiveLimit; + } + + if (m_length > b2_linearSlop) + { + m_u *= 1.0f / m_length; + } + else + { + m_u.SetZero(); + m_mass = 0.0f; + m_impulse = 0.0f; + return; + } + + // Compute effective mass. + float32 crA = b2Cross(m_rA, m_u); + float32 crB = b2Cross(m_rB, m_u); + float32 invMass = m_invMassA + m_invIA * crA * crA + m_invMassB + m_invIB * crB * crB; + + m_mass = invMass != 0.0f ? 1.0f / invMass : 0.0f; + + if (data.step.warmStarting) + { + // Scale the impulse to support a variable time step. + m_impulse *= data.step.dtRatio; + + b2Vec2 P = m_impulse * m_u; + vA -= m_invMassA * P; + wA -= m_invIA * b2Cross(m_rA, P); + vB += m_invMassB * P; + wB += m_invIB * b2Cross(m_rB, P); + } + else + { + m_impulse = 0.0f; + } + + data.velocities[m_indexA].v = vA; + data.velocities[m_indexA].w = wA; + data.velocities[m_indexB].v = vB; + data.velocities[m_indexB].w = wB; +} + +void b2RopeJoint::SolveVelocityConstraints(const b2SolverData& data) +{ + b2Vec2 vA = data.velocities[m_indexA].v; + float32 wA = data.velocities[m_indexA].w; + b2Vec2 vB = data.velocities[m_indexB].v; + float32 wB = data.velocities[m_indexB].w; + + // Cdot = dot(u, v + cross(w, r)) + b2Vec2 vpA = vA + b2Cross(wA, m_rA); + b2Vec2 vpB = vB + b2Cross(wB, m_rB); + float32 C = m_length - m_maxLength; + float32 Cdot = b2Dot(m_u, vpB - vpA); + + // Predictive constraint. + if (C < 0.0f) + { + Cdot += data.step.inv_dt * C; + } + + float32 impulse = -m_mass * Cdot; + float32 oldImpulse = m_impulse; + m_impulse = b2Min(0.0f, m_impulse + impulse); + impulse = m_impulse - oldImpulse; + + b2Vec2 P = impulse * m_u; + vA -= m_invMassA * P; + wA -= m_invIA * b2Cross(m_rA, P); + vB += m_invMassB * P; + wB += m_invIB * b2Cross(m_rB, P); + + data.velocities[m_indexA].v = vA; + data.velocities[m_indexA].w = wA; + data.velocities[m_indexB].v = vB; + data.velocities[m_indexB].w = wB; +} + +bool b2RopeJoint::SolvePositionConstraints(const b2SolverData& data) +{ + b2Vec2 cA = data.positions[m_indexA].c; + float32 aA = data.positions[m_indexA].a; + b2Vec2 cB = data.positions[m_indexB].c; + float32 aB = data.positions[m_indexB].a; + + b2Rot qA(aA), qB(aB); + + b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA); + b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB); + b2Vec2 u = cB + rB - cA - rA; + + float32 length = u.Normalize(); + float32 C = length - m_maxLength; + + C = b2Clamp(C, 0.0f, b2_maxLinearCorrection); + + float32 impulse = -m_mass * C; + b2Vec2 P = impulse * u; + + cA -= m_invMassA * P; + aA -= m_invIA * b2Cross(rA, P); + cB += m_invMassB * P; + aB += m_invIB * b2Cross(rB, P); + + data.positions[m_indexA].c = cA; + data.positions[m_indexA].a = aA; + data.positions[m_indexB].c = cB; + data.positions[m_indexB].a = aB; + + return length - m_maxLength < b2_linearSlop; +} + +b2Vec2 b2RopeJoint::GetAnchorA() const +{ + return m_bodyA->GetWorldPoint(m_localAnchorA); +} + +b2Vec2 b2RopeJoint::GetAnchorB() const +{ + return m_bodyB->GetWorldPoint(m_localAnchorB); +} + +b2Vec2 b2RopeJoint::GetReactionForce(float32 inv_dt) const +{ + b2Vec2 F = (inv_dt * m_impulse) * m_u; + return F; +} + +float32 b2RopeJoint::GetReactionTorque(float32 inv_dt) const +{ + B2_NOT_USED(inv_dt); + return 0.0f; +} + +float32 b2RopeJoint::GetMaxLength() const +{ + return m_maxLength; +} + +b2LimitState b2RopeJoint::GetLimitState() const +{ + return m_state; +} + +void b2RopeJoint::Dump() +{ + int32 indexA = m_bodyA->m_islandIndex; + int32 indexB = m_bodyB->m_islandIndex; + + b2Log(" b2RopeJointDef jd;\n"); + b2Log(" jd.bodyA = bodies[%d];\n", indexA); + b2Log(" jd.bodyB = bodies[%d];\n", indexB); + b2Log(" jd.collideConnected = bool(%d);\n", m_collideConnected); + b2Log(" jd.localAnchorA.Set(%.15lef, %.15lef);\n", m_localAnchorA.x, m_localAnchorA.y); + b2Log(" jd.localAnchorB.Set(%.15lef, %.15lef);\n", m_localAnchorB.x, m_localAnchorB.y); + b2Log(" jd.maxLength = %.15lef;\n", m_maxLength); + b2Log(" joints[%d] = m_world->CreateJoint(&jd);\n", m_index); +} diff --git a/external/Box2D/Dynamics/Joints/b2RopeJoint.h b/external/Box2D/Dynamics/Joints/b2RopeJoint.h new file mode 100644 index 0000000000..d7091b6650 --- /dev/null +++ b/external/Box2D/Dynamics/Joints/b2RopeJoint.h @@ -0,0 +1,114 @@ +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_ROPE_JOINT_H +#define B2_ROPE_JOINT_H + +#include + +/// Rope joint definition. This requires two body anchor points and +/// a maximum lengths. +/// Note: by default the connected objects will not collide. +/// see collideConnected in b2JointDef. +struct b2RopeJointDef : public b2JointDef +{ + b2RopeJointDef() + { + type = e_ropeJoint; + localAnchorA.Set(-1.0f, 0.0f); + localAnchorB.Set(1.0f, 0.0f); + maxLength = 0.0f; + } + + /// The local anchor point relative to bodyA's origin. + b2Vec2 localAnchorA; + + /// The local anchor point relative to bodyB's origin. + b2Vec2 localAnchorB; + + /// The maximum length of the rope. + /// Warning: this must be larger than b2_linearSlop or + /// the joint will have no effect. + float32 maxLength; +}; + +/// A rope joint enforces a maximum distance between two points +/// on two bodies. It has no other effect. +/// Warning: if you attempt to change the maximum length during +/// the simulation you will get some non-physical behavior. +/// A model that would allow you to dynamically modify the length +/// would have some sponginess, so I chose not to implement it +/// that way. See b2DistanceJoint if you want to dynamically +/// control length. +class b2RopeJoint : public b2Joint +{ +public: + b2Vec2 GetAnchorA() const; + b2Vec2 GetAnchorB() const; + + b2Vec2 GetReactionForce(float32 inv_dt) const; + float32 GetReactionTorque(float32 inv_dt) const; + + /// The local anchor point relative to bodyA's origin. + const b2Vec2& GetLocalAnchorA() const { return m_localAnchorA; } + + /// The local anchor point relative to bodyB's origin. + const b2Vec2& GetLocalAnchorB() const { return m_localAnchorB; } + + /// Set/Get the maximum length of the rope. + void SetMaxLength(float32 length) { m_maxLength = length; } + float32 GetMaxLength() const; + + b2LimitState GetLimitState() const; + + /// Dump joint to dmLog + void Dump(); + +protected: + + friend class b2Joint; + b2RopeJoint(const b2RopeJointDef* data); + + void InitVelocityConstraints(const b2SolverData& data); + void SolveVelocityConstraints(const b2SolverData& data); + bool SolvePositionConstraints(const b2SolverData& data); + + // Solver shared + b2Vec2 m_localAnchorA; + b2Vec2 m_localAnchorB; + float32 m_maxLength; + float32 m_length; + float32 m_impulse; + + // Solver temp + int32 m_indexA; + int32 m_indexB; + b2Vec2 m_u; + b2Vec2 m_rA; + b2Vec2 m_rB; + b2Vec2 m_localCenterA; + b2Vec2 m_localCenterB; + float32 m_invMassA; + float32 m_invMassB; + float32 m_invIA; + float32 m_invIB; + float32 m_mass; + b2LimitState m_state; +}; + +#endif diff --git a/external/Box2D/Dynamics/Joints/b2WeldJoint.cpp b/external/Box2D/Dynamics/Joints/b2WeldJoint.cpp new file mode 100644 index 0000000000..f50bdd6587 --- /dev/null +++ b/external/Box2D/Dynamics/Joints/b2WeldJoint.cpp @@ -0,0 +1,330 @@ +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include + +// Point-to-point constraint +// C = p2 - p1 +// Cdot = v2 - v1 +// = v2 + cross(w2, r2) - v1 - cross(w1, r1) +// J = [-I -r1_skew I r2_skew ] +// Identity used: +// w k % (rx i + ry j) = w * (-ry i + rx j) + +// Angle constraint +// C = angle2 - angle1 - referenceAngle +// Cdot = w2 - w1 +// J = [0 0 -1 0 0 1] +// K = invI1 + invI2 + +void b2WeldJointDef::Initialize(b2Body* bA, b2Body* bB, const b2Vec2& anchor) +{ + bodyA = bA; + bodyB = bB; + localAnchorA = bodyA->GetLocalPoint(anchor); + localAnchorB = bodyB->GetLocalPoint(anchor); + referenceAngle = bodyB->GetAngle() - bodyA->GetAngle(); +} + +b2WeldJoint::b2WeldJoint(const b2WeldJointDef* def) +: b2Joint(def) +{ + m_localAnchorA = def->localAnchorA; + m_localAnchorB = def->localAnchorB; + m_referenceAngle = def->referenceAngle; + m_frequencyHz = def->frequencyHz; + m_dampingRatio = def->dampingRatio; + + m_impulse.SetZero(); +} + +void b2WeldJoint::InitVelocityConstraints(const b2SolverData& data) +{ + m_indexA = m_bodyA->m_islandIndex; + m_indexB = m_bodyB->m_islandIndex; + m_localCenterA = m_bodyA->m_sweep.localCenter; + m_localCenterB = m_bodyB->m_sweep.localCenter; + m_invMassA = m_bodyA->m_invMass; + m_invMassB = m_bodyB->m_invMass; + m_invIA = m_bodyA->m_invI; + m_invIB = m_bodyB->m_invI; + + b2Vec2 cA = data.positions[m_indexA].c; + float32 aA = data.positions[m_indexA].a; + b2Vec2 vA = data.velocities[m_indexA].v; + float32 wA = data.velocities[m_indexA].w; + + b2Vec2 cB = data.positions[m_indexB].c; + float32 aB = data.positions[m_indexB].a; + b2Vec2 vB = data.velocities[m_indexB].v; + float32 wB = data.velocities[m_indexB].w; + + b2Rot qA(aA), qB(aB); + + m_rA = b2Mul(qA, m_localAnchorA - m_localCenterA); + m_rB = b2Mul(qB, m_localAnchorB - m_localCenterB); + + // J = [-I -r1_skew I r2_skew] + // [ 0 -1 0 1] + // r_skew = [-ry; rx] + + // Matlab + // K = [ mA+r1y^2*iA+mB+r2y^2*iB, -r1y*iA*r1x-r2y*iB*r2x, -r1y*iA-r2y*iB] + // [ -r1y*iA*r1x-r2y*iB*r2x, mA+r1x^2*iA+mB+r2x^2*iB, r1x*iA+r2x*iB] + // [ -r1y*iA-r2y*iB, r1x*iA+r2x*iB, iA+iB] + + float32 mA = m_invMassA, mB = m_invMassB; + float32 iA = m_invIA, iB = m_invIB; + + b2Mat33 K; + K.ex.x = mA + mB + m_rA.y * m_rA.y * iA + m_rB.y * m_rB.y * iB; + K.ey.x = -m_rA.y * m_rA.x * iA - m_rB.y * m_rB.x * iB; + K.ez.x = -m_rA.y * iA - m_rB.y * iB; + K.ex.y = K.ey.x; + K.ey.y = mA + mB + m_rA.x * m_rA.x * iA + m_rB.x * m_rB.x * iB; + K.ez.y = m_rA.x * iA + m_rB.x * iB; + K.ex.z = K.ez.x; + K.ey.z = K.ez.y; + K.ez.z = iA + iB; + + if (m_frequencyHz > 0.0f) + { + K.GetInverse22(&m_mass); + + float32 invM = iA + iB; + float32 m = invM > 0.0f ? 1.0f / invM : 0.0f; + + float32 C = aB - aA - m_referenceAngle; + + // Frequency + float32 omega = 2.0f * b2_pi * m_frequencyHz; + + // Damping coefficient + float32 d = 2.0f * m * m_dampingRatio * omega; + + // Spring stiffness + float32 k = m * omega * omega; + + // magic formulas + float32 h = data.step.dt; + m_gamma = h * (d + h * k); + m_gamma = m_gamma != 0.0f ? 1.0f / m_gamma : 0.0f; + m_bias = C * h * k * m_gamma; + + invM += m_gamma; + m_mass.ez.z = invM != 0.0f ? 1.0f / invM : 0.0f; + } + else + { + K.GetSymInverse33(&m_mass); + m_gamma = 0.0f; + m_bias = 0.0f; + } + + if (data.step.warmStarting) + { + // Scale impulses to support a variable time step. + m_impulse *= data.step.dtRatio; + + b2Vec2 P(m_impulse.x, m_impulse.y); + + vA -= mA * P; + wA -= iA * (b2Cross(m_rA, P) + m_impulse.z); + + vB += mB * P; + wB += iB * (b2Cross(m_rB, P) + m_impulse.z); + } + else + { + m_impulse.SetZero(); + } + + data.velocities[m_indexA].v = vA; + data.velocities[m_indexA].w = wA; + data.velocities[m_indexB].v = vB; + data.velocities[m_indexB].w = wB; +} + +void b2WeldJoint::SolveVelocityConstraints(const b2SolverData& data) +{ + b2Vec2 vA = data.velocities[m_indexA].v; + float32 wA = data.velocities[m_indexA].w; + b2Vec2 vB = data.velocities[m_indexB].v; + float32 wB = data.velocities[m_indexB].w; + + float32 mA = m_invMassA, mB = m_invMassB; + float32 iA = m_invIA, iB = m_invIB; + + if (m_frequencyHz > 0.0f) + { + float32 Cdot2 = wB - wA; + + float32 impulse2 = -m_mass.ez.z * (Cdot2 + m_bias + m_gamma * m_impulse.z); + m_impulse.z += impulse2; + + wA -= iA * impulse2; + wB += iB * impulse2; + + b2Vec2 Cdot1 = vB + b2Cross(wB, m_rB) - vA - b2Cross(wA, m_rA); + + b2Vec2 impulse1 = -b2Mul22(m_mass, Cdot1); + m_impulse.x += impulse1.x; + m_impulse.y += impulse1.y; + + b2Vec2 P = impulse1; + + vA -= mA * P; + wA -= iA * b2Cross(m_rA, P); + + vB += mB * P; + wB += iB * b2Cross(m_rB, P); + } + else + { + b2Vec2 Cdot1 = vB + b2Cross(wB, m_rB) - vA - b2Cross(wA, m_rA); + float32 Cdot2 = wB - wA; + b2Vec3 Cdot(Cdot1.x, Cdot1.y, Cdot2); + + b2Vec3 impulse = -b2Mul(m_mass, Cdot); + m_impulse += impulse; + + b2Vec2 P(impulse.x, impulse.y); + + vA -= mA * P; + wA -= iA * (b2Cross(m_rA, P) + impulse.z); + + vB += mB * P; + wB += iB * (b2Cross(m_rB, P) + impulse.z); + } + + data.velocities[m_indexA].v = vA; + data.velocities[m_indexA].w = wA; + data.velocities[m_indexB].v = vB; + data.velocities[m_indexB].w = wB; +} + +bool b2WeldJoint::SolvePositionConstraints(const b2SolverData& data) +{ + b2Vec2 cA = data.positions[m_indexA].c; + float32 aA = data.positions[m_indexA].a; + b2Vec2 cB = data.positions[m_indexB].c; + float32 aB = data.positions[m_indexB].a; + + b2Rot qA(aA), qB(aB); + + float32 mA = m_invMassA, mB = m_invMassB; + float32 iA = m_invIA, iB = m_invIB; + + b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA); + b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB); + + float32 positionError, angularError; + + b2Mat33 K; + K.ex.x = mA + mB + rA.y * rA.y * iA + rB.y * rB.y * iB; + K.ey.x = -rA.y * rA.x * iA - rB.y * rB.x * iB; + K.ez.x = -rA.y * iA - rB.y * iB; + K.ex.y = K.ey.x; + K.ey.y = mA + mB + rA.x * rA.x * iA + rB.x * rB.x * iB; + K.ez.y = rA.x * iA + rB.x * iB; + K.ex.z = K.ez.x; + K.ey.z = K.ez.y; + K.ez.z = iA + iB; + + if (m_frequencyHz > 0.0f) + { + b2Vec2 C1 = cB + rB - cA - rA; + + positionError = C1.Length(); + angularError = 0.0f; + + b2Vec2 P = -K.Solve22(C1); + + cA -= mA * P; + aA -= iA * b2Cross(rA, P); + + cB += mB * P; + aB += iB * b2Cross(rB, P); + } + else + { + b2Vec2 C1 = cB + rB - cA - rA; + float32 C2 = aB - aA - m_referenceAngle; + + positionError = C1.Length(); + angularError = b2Abs(C2); + + b2Vec3 C(C1.x, C1.y, C2); + + b2Vec3 impulse = -K.Solve33(C); + b2Vec2 P(impulse.x, impulse.y); + + cA -= mA * P; + aA -= iA * (b2Cross(rA, P) + impulse.z); + + cB += mB * P; + aB += iB * (b2Cross(rB, P) + impulse.z); + } + + data.positions[m_indexA].c = cA; + data.positions[m_indexA].a = aA; + data.positions[m_indexB].c = cB; + data.positions[m_indexB].a = aB; + + return positionError <= b2_linearSlop && angularError <= b2_angularSlop; +} + +b2Vec2 b2WeldJoint::GetAnchorA() const +{ + return m_bodyA->GetWorldPoint(m_localAnchorA); +} + +b2Vec2 b2WeldJoint::GetAnchorB() const +{ + return m_bodyB->GetWorldPoint(m_localAnchorB); +} + +b2Vec2 b2WeldJoint::GetReactionForce(float32 inv_dt) const +{ + b2Vec2 P(m_impulse.x, m_impulse.y); + return inv_dt * P; +} + +float32 b2WeldJoint::GetReactionTorque(float32 inv_dt) const +{ + return inv_dt * m_impulse.z; +} + +void b2WeldJoint::Dump() +{ + int32 indexA = m_bodyA->m_islandIndex; + int32 indexB = m_bodyB->m_islandIndex; + + b2Log(" b2WeldJointDef jd;\n"); + b2Log(" jd.bodyA = bodies[%d];\n", indexA); + b2Log(" jd.bodyB = bodies[%d];\n", indexB); + b2Log(" jd.collideConnected = bool(%d);\n", m_collideConnected); + b2Log(" jd.localAnchorA.Set(%.15lef, %.15lef);\n", m_localAnchorA.x, m_localAnchorA.y); + b2Log(" jd.localAnchorB.Set(%.15lef, %.15lef);\n", m_localAnchorB.x, m_localAnchorB.y); + b2Log(" jd.referenceAngle = %.15lef;\n", m_referenceAngle); + b2Log(" jd.frequencyHz = %.15lef;\n", m_frequencyHz); + b2Log(" jd.dampingRatio = %.15lef;\n", m_dampingRatio); + b2Log(" joints[%d] = m_world->CreateJoint(&jd);\n", m_index); +} diff --git a/external/Box2D/Dynamics/Joints/b2WeldJoint.h b/external/Box2D/Dynamics/Joints/b2WeldJoint.h new file mode 100644 index 0000000000..751c6a8770 --- /dev/null +++ b/external/Box2D/Dynamics/Joints/b2WeldJoint.h @@ -0,0 +1,126 @@ +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_WELD_JOINT_H +#define B2_WELD_JOINT_H + +#include + +/// Weld joint definition. You need to specify local anchor points +/// where they are attached and the relative body angle. The position +/// of the anchor points is important for computing the reaction torque. +struct b2WeldJointDef : public b2JointDef +{ + b2WeldJointDef() + { + type = e_weldJoint; + localAnchorA.Set(0.0f, 0.0f); + localAnchorB.Set(0.0f, 0.0f); + referenceAngle = 0.0f; + frequencyHz = 0.0f; + dampingRatio = 0.0f; + } + + /// Initialize the bodies, anchors, and reference angle using a world + /// anchor point. + void Initialize(b2Body* bodyA, b2Body* bodyB, const b2Vec2& anchor); + + /// The local anchor point relative to bodyA's origin. + b2Vec2 localAnchorA; + + /// The local anchor point relative to bodyB's origin. + b2Vec2 localAnchorB; + + /// The bodyB angle minus bodyA angle in the reference state (radians). + float32 referenceAngle; + + /// The mass-spring-damper frequency in Hertz. Rotation only. + /// Disable softness with a value of 0. + float32 frequencyHz; + + /// The damping ratio. 0 = no damping, 1 = critical damping. + float32 dampingRatio; +}; + +/// A weld joint essentially glues two bodies together. A weld joint may +/// distort somewhat because the island constraint solver is approximate. +class b2WeldJoint : public b2Joint +{ +public: + b2Vec2 GetAnchorA() const; + b2Vec2 GetAnchorB() const; + + b2Vec2 GetReactionForce(float32 inv_dt) const; + float32 GetReactionTorque(float32 inv_dt) const; + + /// The local anchor point relative to bodyA's origin. + const b2Vec2& GetLocalAnchorA() const { return m_localAnchorA; } + + /// The local anchor point relative to bodyB's origin. + const b2Vec2& GetLocalAnchorB() const { return m_localAnchorB; } + + /// Get the reference angle. + float32 GetReferenceAngle() const { return m_referenceAngle; } + + /// Set/get frequency in Hz. + void SetFrequency(float32 hz) { m_frequencyHz = hz; } + float32 GetFrequency() const { return m_frequencyHz; } + + /// Set/get damping ratio. + void SetDampingRatio(float32 ratio) { m_dampingRatio = ratio; } + float32 GetDampingRatio() const { return m_dampingRatio; } + + /// Dump to b2Log + void Dump(); + +protected: + + friend class b2Joint; + + b2WeldJoint(const b2WeldJointDef* def); + + void InitVelocityConstraints(const b2SolverData& data); + void SolveVelocityConstraints(const b2SolverData& data); + bool SolvePositionConstraints(const b2SolverData& data); + + float32 m_frequencyHz; + float32 m_dampingRatio; + float32 m_bias; + + // Solver shared + b2Vec2 m_localAnchorA; + b2Vec2 m_localAnchorB; + float32 m_referenceAngle; + float32 m_gamma; + b2Vec3 m_impulse; + + // Solver temp + int32 m_indexA; + int32 m_indexB; + b2Vec2 m_rA; + b2Vec2 m_rB; + b2Vec2 m_localCenterA; + b2Vec2 m_localCenterB; + float32 m_invMassA; + float32 m_invMassB; + float32 m_invIA; + float32 m_invIB; + b2Mat33 m_mass; +}; + +#endif diff --git a/external/Box2D/Dynamics/Joints/b2WheelJoint.cpp b/external/Box2D/Dynamics/Joints/b2WheelJoint.cpp new file mode 100644 index 0000000000..6253437706 --- /dev/null +++ b/external/Box2D/Dynamics/Joints/b2WheelJoint.cpp @@ -0,0 +1,419 @@ +/* +* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include + +// Linear constraint (point-to-line) +// d = pB - pA = xB + rB - xA - rA +// C = dot(ay, d) +// Cdot = dot(d, cross(wA, ay)) + dot(ay, vB + cross(wB, rB) - vA - cross(wA, rA)) +// = -dot(ay, vA) - dot(cross(d + rA, ay), wA) + dot(ay, vB) + dot(cross(rB, ay), vB) +// J = [-ay, -cross(d + rA, ay), ay, cross(rB, ay)] + +// Spring linear constraint +// C = dot(ax, d) +// Cdot = = -dot(ax, vA) - dot(cross(d + rA, ax), wA) + dot(ax, vB) + dot(cross(rB, ax), vB) +// J = [-ax -cross(d+rA, ax) ax cross(rB, ax)] + +// Motor rotational constraint +// Cdot = wB - wA +// J = [0 0 -1 0 0 1] + +void b2WheelJointDef::Initialize(b2Body* bA, b2Body* bB, const b2Vec2& anchor, const b2Vec2& axis) +{ + bodyA = bA; + bodyB = bB; + localAnchorA = bodyA->GetLocalPoint(anchor); + localAnchorB = bodyB->GetLocalPoint(anchor); + localAxisA = bodyA->GetLocalVector(axis); +} + +b2WheelJoint::b2WheelJoint(const b2WheelJointDef* def) +: b2Joint(def) +{ + m_localAnchorA = def->localAnchorA; + m_localAnchorB = def->localAnchorB; + m_localXAxisA = def->localAxisA; + m_localYAxisA = b2Cross(1.0f, m_localXAxisA); + + m_mass = 0.0f; + m_impulse = 0.0f; + m_motorMass = 0.0; + m_motorImpulse = 0.0f; + m_springMass = 0.0f; + m_springImpulse = 0.0f; + + m_maxMotorTorque = def->maxMotorTorque; + m_motorSpeed = def->motorSpeed; + m_enableMotor = def->enableMotor; + + m_frequencyHz = def->frequencyHz; + m_dampingRatio = def->dampingRatio; + + m_bias = 0.0f; + m_gamma = 0.0f; + + m_ax.SetZero(); + m_ay.SetZero(); +} + +void b2WheelJoint::InitVelocityConstraints(const b2SolverData& data) +{ + m_indexA = m_bodyA->m_islandIndex; + m_indexB = m_bodyB->m_islandIndex; + m_localCenterA = m_bodyA->m_sweep.localCenter; + m_localCenterB = m_bodyB->m_sweep.localCenter; + m_invMassA = m_bodyA->m_invMass; + m_invMassB = m_bodyB->m_invMass; + m_invIA = m_bodyA->m_invI; + m_invIB = m_bodyB->m_invI; + + float32 mA = m_invMassA, mB = m_invMassB; + float32 iA = m_invIA, iB = m_invIB; + + b2Vec2 cA = data.positions[m_indexA].c; + float32 aA = data.positions[m_indexA].a; + b2Vec2 vA = data.velocities[m_indexA].v; + float32 wA = data.velocities[m_indexA].w; + + b2Vec2 cB = data.positions[m_indexB].c; + float32 aB = data.positions[m_indexB].a; + b2Vec2 vB = data.velocities[m_indexB].v; + float32 wB = data.velocities[m_indexB].w; + + b2Rot qA(aA), qB(aB); + + // Compute the effective masses. + b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA); + b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB); + b2Vec2 d = cB + rB - cA - rA; + + // Point to line constraint + { + m_ay = b2Mul(qA, m_localYAxisA); + m_sAy = b2Cross(d + rA, m_ay); + m_sBy = b2Cross(rB, m_ay); + + m_mass = mA + mB + iA * m_sAy * m_sAy + iB * m_sBy * m_sBy; + + if (m_mass > 0.0f) + { + m_mass = 1.0f / m_mass; + } + } + + // Spring constraint + m_springMass = 0.0f; + m_bias = 0.0f; + m_gamma = 0.0f; + if (m_frequencyHz > 0.0f) + { + m_ax = b2Mul(qA, m_localXAxisA); + m_sAx = b2Cross(d + rA, m_ax); + m_sBx = b2Cross(rB, m_ax); + + float32 invMass = mA + mB + iA * m_sAx * m_sAx + iB * m_sBx * m_sBx; + + if (invMass > 0.0f) + { + m_springMass = 1.0f / invMass; + + float32 C = b2Dot(d, m_ax); + + // Frequency + float32 omega = 2.0f * b2_pi * m_frequencyHz; + + // Damping coefficient + float32 d = 2.0f * m_springMass * m_dampingRatio * omega; + + // Spring stiffness + float32 k = m_springMass * omega * omega; + + // magic formulas + float32 h = data.step.dt; + m_gamma = h * (d + h * k); + if (m_gamma > 0.0f) + { + m_gamma = 1.0f / m_gamma; + } + + m_bias = C * h * k * m_gamma; + + m_springMass = invMass + m_gamma; + if (m_springMass > 0.0f) + { + m_springMass = 1.0f / m_springMass; + } + } + } + else + { + m_springImpulse = 0.0f; + } + + // Rotational motor + if (m_enableMotor) + { + m_motorMass = iA + iB; + if (m_motorMass > 0.0f) + { + m_motorMass = 1.0f / m_motorMass; + } + } + else + { + m_motorMass = 0.0f; + m_motorImpulse = 0.0f; + } + + if (data.step.warmStarting) + { + // Account for variable time step. + m_impulse *= data.step.dtRatio; + m_springImpulse *= data.step.dtRatio; + m_motorImpulse *= data.step.dtRatio; + + b2Vec2 P = m_impulse * m_ay + m_springImpulse * m_ax; + float32 LA = m_impulse * m_sAy + m_springImpulse * m_sAx + m_motorImpulse; + float32 LB = m_impulse * m_sBy + m_springImpulse * m_sBx + m_motorImpulse; + + vA -= m_invMassA * P; + wA -= m_invIA * LA; + + vB += m_invMassB * P; + wB += m_invIB * LB; + } + else + { + m_impulse = 0.0f; + m_springImpulse = 0.0f; + m_motorImpulse = 0.0f; + } + + data.velocities[m_indexA].v = vA; + data.velocities[m_indexA].w = wA; + data.velocities[m_indexB].v = vB; + data.velocities[m_indexB].w = wB; +} + +void b2WheelJoint::SolveVelocityConstraints(const b2SolverData& data) +{ + float32 mA = m_invMassA, mB = m_invMassB; + float32 iA = m_invIA, iB = m_invIB; + + b2Vec2 vA = data.velocities[m_indexA].v; + float32 wA = data.velocities[m_indexA].w; + b2Vec2 vB = data.velocities[m_indexB].v; + float32 wB = data.velocities[m_indexB].w; + + // Solve spring constraint + { + float32 Cdot = b2Dot(m_ax, vB - vA) + m_sBx * wB - m_sAx * wA; + float32 impulse = -m_springMass * (Cdot + m_bias + m_gamma * m_springImpulse); + m_springImpulse += impulse; + + b2Vec2 P = impulse * m_ax; + float32 LA = impulse * m_sAx; + float32 LB = impulse * m_sBx; + + vA -= mA * P; + wA -= iA * LA; + + vB += mB * P; + wB += iB * LB; + } + + // Solve rotational motor constraint + { + float32 Cdot = wB - wA - m_motorSpeed; + float32 impulse = -m_motorMass * Cdot; + + float32 oldImpulse = m_motorImpulse; + float32 maxImpulse = data.step.dt * m_maxMotorTorque; + m_motorImpulse = b2Clamp(m_motorImpulse + impulse, -maxImpulse, maxImpulse); + impulse = m_motorImpulse - oldImpulse; + + wA -= iA * impulse; + wB += iB * impulse; + } + + // Solve point to line constraint + { + float32 Cdot = b2Dot(m_ay, vB - vA) + m_sBy * wB - m_sAy * wA; + float32 impulse = -m_mass * Cdot; + m_impulse += impulse; + + b2Vec2 P = impulse * m_ay; + float32 LA = impulse * m_sAy; + float32 LB = impulse * m_sBy; + + vA -= mA * P; + wA -= iA * LA; + + vB += mB * P; + wB += iB * LB; + } + + data.velocities[m_indexA].v = vA; + data.velocities[m_indexA].w = wA; + data.velocities[m_indexB].v = vB; + data.velocities[m_indexB].w = wB; +} + +bool b2WheelJoint::SolvePositionConstraints(const b2SolverData& data) +{ + b2Vec2 cA = data.positions[m_indexA].c; + float32 aA = data.positions[m_indexA].a; + b2Vec2 cB = data.positions[m_indexB].c; + float32 aB = data.positions[m_indexB].a; + + b2Rot qA(aA), qB(aB); + + b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA); + b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB); + b2Vec2 d = (cB - cA) + rB - rA; + + b2Vec2 ay = b2Mul(qA, m_localYAxisA); + + float32 sAy = b2Cross(d + rA, ay); + float32 sBy = b2Cross(rB, ay); + + float32 C = b2Dot(d, ay); + + float32 k = m_invMassA + m_invMassB + m_invIA * m_sAy * m_sAy + m_invIB * m_sBy * m_sBy; + + float32 impulse; + if (k != 0.0f) + { + impulse = - C / k; + } + else + { + impulse = 0.0f; + } + + b2Vec2 P = impulse * ay; + float32 LA = impulse * sAy; + float32 LB = impulse * sBy; + + cA -= m_invMassA * P; + aA -= m_invIA * LA; + cB += m_invMassB * P; + aB += m_invIB * LB; + + data.positions[m_indexA].c = cA; + data.positions[m_indexA].a = aA; + data.positions[m_indexB].c = cB; + data.positions[m_indexB].a = aB; + + return b2Abs(C) <= b2_linearSlop; +} + +b2Vec2 b2WheelJoint::GetAnchorA() const +{ + return m_bodyA->GetWorldPoint(m_localAnchorA); +} + +b2Vec2 b2WheelJoint::GetAnchorB() const +{ + return m_bodyB->GetWorldPoint(m_localAnchorB); +} + +b2Vec2 b2WheelJoint::GetReactionForce(float32 inv_dt) const +{ + return inv_dt * (m_impulse * m_ay + m_springImpulse * m_ax); +} + +float32 b2WheelJoint::GetReactionTorque(float32 inv_dt) const +{ + return inv_dt * m_motorImpulse; +} + +float32 b2WheelJoint::GetJointTranslation() const +{ + b2Body* bA = m_bodyA; + b2Body* bB = m_bodyB; + + b2Vec2 pA = bA->GetWorldPoint(m_localAnchorA); + b2Vec2 pB = bB->GetWorldPoint(m_localAnchorB); + b2Vec2 d = pB - pA; + b2Vec2 axis = bA->GetWorldVector(m_localXAxisA); + + float32 translation = b2Dot(d, axis); + return translation; +} + +float32 b2WheelJoint::GetJointSpeed() const +{ + float32 wA = m_bodyA->m_angularVelocity; + float32 wB = m_bodyB->m_angularVelocity; + return wB - wA; +} + +bool b2WheelJoint::IsMotorEnabled() const +{ + return m_enableMotor; +} + +void b2WheelJoint::EnableMotor(bool flag) +{ + m_bodyA->SetAwake(true); + m_bodyB->SetAwake(true); + m_enableMotor = flag; +} + +void b2WheelJoint::SetMotorSpeed(float32 speed) +{ + m_bodyA->SetAwake(true); + m_bodyB->SetAwake(true); + m_motorSpeed = speed; +} + +void b2WheelJoint::SetMaxMotorTorque(float32 torque) +{ + m_bodyA->SetAwake(true); + m_bodyB->SetAwake(true); + m_maxMotorTorque = torque; +} + +float32 b2WheelJoint::GetMotorTorque(float32 inv_dt) const +{ + return inv_dt * m_motorImpulse; +} + +void b2WheelJoint::Dump() +{ + int32 indexA = m_bodyA->m_islandIndex; + int32 indexB = m_bodyB->m_islandIndex; + + b2Log(" b2WheelJointDef jd;\n"); + b2Log(" jd.bodyA = bodies[%d];\n", indexA); + b2Log(" jd.bodyB = bodies[%d];\n", indexB); + b2Log(" jd.collideConnected = bool(%d);\n", m_collideConnected); + b2Log(" jd.localAnchorA.Set(%.15lef, %.15lef);\n", m_localAnchorA.x, m_localAnchorA.y); + b2Log(" jd.localAnchorB.Set(%.15lef, %.15lef);\n", m_localAnchorB.x, m_localAnchorB.y); + b2Log(" jd.localAxisA.Set(%.15lef, %.15lef);\n", m_localXAxisA.x, m_localXAxisA.y); + b2Log(" jd.enableMotor = bool(%d);\n", m_enableMotor); + b2Log(" jd.motorSpeed = %.15lef;\n", m_motorSpeed); + b2Log(" jd.maxMotorTorque = %.15lef;\n", m_maxMotorTorque); + b2Log(" jd.frequencyHz = %.15lef;\n", m_frequencyHz); + b2Log(" jd.dampingRatio = %.15lef;\n", m_dampingRatio); + b2Log(" joints[%d] = m_world->CreateJoint(&jd);\n", m_index); +} diff --git a/external/Box2D/Dynamics/Joints/b2WheelJoint.h b/external/Box2D/Dynamics/Joints/b2WheelJoint.h new file mode 100644 index 0000000000..ede1b08b7c --- /dev/null +++ b/external/Box2D/Dynamics/Joints/b2WheelJoint.h @@ -0,0 +1,213 @@ +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_WHEEL_JOINT_H +#define B2_WHEEL_JOINT_H + +#include + +/// Wheel joint definition. This requires defining a line of +/// motion using an axis and an anchor point. The definition uses local +/// anchor points and a local axis so that the initial configuration +/// can violate the constraint slightly. The joint translation is zero +/// when the local anchor points coincide in world space. Using local +/// anchors and a local axis helps when saving and loading a game. +struct b2WheelJointDef : public b2JointDef +{ + b2WheelJointDef() + { + type = e_wheelJoint; + localAnchorA.SetZero(); + localAnchorB.SetZero(); + localAxisA.Set(1.0f, 0.0f); + enableMotor = false; + maxMotorTorque = 0.0f; + motorSpeed = 0.0f; + frequencyHz = 2.0f; + dampingRatio = 0.7f; + } + + /// Initialize the bodies, anchors, axis, and reference angle using the world + /// anchor and world axis. + void Initialize(b2Body* bodyA, b2Body* bodyB, const b2Vec2& anchor, const b2Vec2& axis); + + /// The local anchor point relative to bodyA's origin. + b2Vec2 localAnchorA; + + /// The local anchor point relative to bodyB's origin. + b2Vec2 localAnchorB; + + /// The local translation axis in bodyA. + b2Vec2 localAxisA; + + /// Enable/disable the joint motor. + bool enableMotor; + + /// The maximum motor torque, usually in N-m. + float32 maxMotorTorque; + + /// The desired motor speed in radians per second. + float32 motorSpeed; + + /// Suspension frequency, zero indicates no suspension + float32 frequencyHz; + + /// Suspension damping ratio, one indicates critical damping + float32 dampingRatio; +}; + +/// A wheel joint. This joint provides two degrees of freedom: translation +/// along an axis fixed in bodyA and rotation in the plane. You can use a +/// joint limit to restrict the range of motion and a joint motor to drive +/// the rotation or to model rotational friction. +/// This joint is designed for vehicle suspensions. +class b2WheelJoint : public b2Joint +{ +public: + void GetDefinition(b2WheelJointDef* def) const; + + b2Vec2 GetAnchorA() const; + b2Vec2 GetAnchorB() const; + + b2Vec2 GetReactionForce(float32 inv_dt) const; + float32 GetReactionTorque(float32 inv_dt) const; + + /// The local anchor point relative to bodyA's origin. + const b2Vec2& GetLocalAnchorA() const { return m_localAnchorA; } + + /// The local anchor point relative to bodyB's origin. + const b2Vec2& GetLocalAnchorB() const { return m_localAnchorB; } + + /// The local joint axis relative to bodyA. + const b2Vec2& GetLocalAxisA() const { return m_localXAxisA; } + + /// Get the current joint translation, usually in meters. + float32 GetJointTranslation() const; + + /// Get the current joint translation speed, usually in meters per second. + float32 GetJointSpeed() const; + + /// Is the joint motor enabled? + bool IsMotorEnabled() const; + + /// Enable/disable the joint motor. + void EnableMotor(bool flag); + + /// Set the motor speed, usually in radians per second. + void SetMotorSpeed(float32 speed); + + /// Get the motor speed, usually in radians per second. + float32 GetMotorSpeed() const; + + /// Set/Get the maximum motor force, usually in N-m. + void SetMaxMotorTorque(float32 torque); + float32 GetMaxMotorTorque() const; + + /// Get the current motor torque given the inverse time step, usually in N-m. + float32 GetMotorTorque(float32 inv_dt) const; + + /// Set/Get the spring frequency in hertz. Setting the frequency to zero disables the spring. + void SetSpringFrequencyHz(float32 hz); + float32 GetSpringFrequencyHz() const; + + /// Set/Get the spring damping ratio + void SetSpringDampingRatio(float32 ratio); + float32 GetSpringDampingRatio() const; + + /// Dump to b2Log + void Dump(); + +protected: + + friend class b2Joint; + b2WheelJoint(const b2WheelJointDef* def); + + void InitVelocityConstraints(const b2SolverData& data); + void SolveVelocityConstraints(const b2SolverData& data); + bool SolvePositionConstraints(const b2SolverData& data); + + float32 m_frequencyHz; + float32 m_dampingRatio; + + // Solver shared + b2Vec2 m_localAnchorA; + b2Vec2 m_localAnchorB; + b2Vec2 m_localXAxisA; + b2Vec2 m_localYAxisA; + + float32 m_impulse; + float32 m_motorImpulse; + float32 m_springImpulse; + + float32 m_maxMotorTorque; + float32 m_motorSpeed; + bool m_enableMotor; + + // Solver temp + int32 m_indexA; + int32 m_indexB; + b2Vec2 m_localCenterA; + b2Vec2 m_localCenterB; + float32 m_invMassA; + float32 m_invMassB; + float32 m_invIA; + float32 m_invIB; + + b2Vec2 m_ax, m_ay; + float32 m_sAx, m_sBx; + float32 m_sAy, m_sBy; + + float32 m_mass; + float32 m_motorMass; + float32 m_springMass; + + float32 m_bias; + float32 m_gamma; +}; + +inline float32 b2WheelJoint::GetMotorSpeed() const +{ + return m_motorSpeed; +} + +inline float32 b2WheelJoint::GetMaxMotorTorque() const +{ + return m_maxMotorTorque; +} + +inline void b2WheelJoint::SetSpringFrequencyHz(float32 hz) +{ + m_frequencyHz = hz; +} + +inline float32 b2WheelJoint::GetSpringFrequencyHz() const +{ + return m_frequencyHz; +} + +inline void b2WheelJoint::SetSpringDampingRatio(float32 ratio) +{ + m_dampingRatio = ratio; +} + +inline float32 b2WheelJoint::GetSpringDampingRatio() const +{ + return m_dampingRatio; +} + +#endif diff --git a/external/Box2D/Dynamics/b2Body.cpp b/external/Box2D/Dynamics/b2Body.cpp new file mode 100644 index 0000000000..b22b574023 --- /dev/null +++ b/external/Box2D/Dynamics/b2Body.cpp @@ -0,0 +1,514 @@ +/* +* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include +#include +#include + +b2Body::b2Body(const b2BodyDef* bd, b2World* world) +{ + b2Assert(bd->position.IsValid()); + b2Assert(bd->linearVelocity.IsValid()); + b2Assert(b2IsValid(bd->angle)); + b2Assert(b2IsValid(bd->angularVelocity)); + b2Assert(b2IsValid(bd->angularDamping) && bd->angularDamping >= 0.0f); + b2Assert(b2IsValid(bd->linearDamping) && bd->linearDamping >= 0.0f); + + m_flags = 0; + + if (bd->bullet) + { + m_flags |= e_bulletFlag; + } + if (bd->fixedRotation) + { + m_flags |= e_fixedRotationFlag; + } + if (bd->allowSleep) + { + m_flags |= e_autoSleepFlag; + } + if (bd->awake) + { + m_flags |= e_awakeFlag; + } + if (bd->active) + { + m_flags |= e_activeFlag; + } + + m_world = world; + + m_xf.p = bd->position; + m_xf.q.Set(bd->angle); + + m_sweep.localCenter.SetZero(); + m_sweep.c0 = m_xf.p; + m_sweep.c = m_xf.p; + m_sweep.a0 = bd->angle; + m_sweep.a = bd->angle; + m_sweep.alpha0 = 0.0f; + + m_jointList = NULL; + m_contactList = NULL; + m_prev = NULL; + m_next = NULL; + + m_linearVelocity = bd->linearVelocity; + m_angularVelocity = bd->angularVelocity; + + m_linearDamping = bd->linearDamping; + m_angularDamping = bd->angularDamping; + m_gravityScale = bd->gravityScale; + + m_force.SetZero(); + m_torque = 0.0f; + + m_sleepTime = 0.0f; + + m_type = bd->type; + + if (m_type == b2_dynamicBody) + { + m_mass = 1.0f; + m_invMass = 1.0f; + } + else + { + m_mass = 0.0f; + m_invMass = 0.0f; + } + + m_I = 0.0f; + m_invI = 0.0f; + + m_userData = bd->userData; + + m_fixtureList = NULL; + m_fixtureCount = 0; +} + +b2Body::~b2Body() +{ + // shapes and joints are destroyed in b2World::Destroy +} + +void b2Body::SetType(b2BodyType type) +{ + b2Assert(m_world->IsLocked() == false); + if (m_world->IsLocked() == true) + { + return; + } + + if (m_type == type) + { + return; + } + + m_type = type; + + ResetMassData(); + + if (m_type == b2_staticBody) + { + m_linearVelocity.SetZero(); + m_angularVelocity = 0.0f; + m_sweep.a0 = m_sweep.a; + m_sweep.c0 = m_sweep.c; + SynchronizeFixtures(); + } + + SetAwake(true); + + m_force.SetZero(); + m_torque = 0.0f; + + // Since the body type changed, we need to flag contacts for filtering. + for (b2Fixture* f = m_fixtureList; f; f = f->m_next) + { + f->Refilter(); + } +} + +b2Fixture* b2Body::CreateFixture(const b2FixtureDef* def) +{ + b2Assert(m_world->IsLocked() == false); + if (m_world->IsLocked() == true) + { + return NULL; + } + + b2BlockAllocator* allocator = &m_world->m_blockAllocator; + + void* memory = allocator->Allocate(sizeof(b2Fixture)); + b2Fixture* fixture = new (memory) b2Fixture; + fixture->Create(allocator, this, def); + + if (m_flags & e_activeFlag) + { + b2BroadPhase* broadPhase = &m_world->m_contactManager.m_broadPhase; + fixture->CreateProxies(broadPhase, m_xf); + } + + fixture->m_next = m_fixtureList; + m_fixtureList = fixture; + ++m_fixtureCount; + + fixture->m_body = this; + + // Adjust mass properties if needed. + if (fixture->m_density > 0.0f) + { + ResetMassData(); + } + + // Let the world know we have a new fixture. This will cause new contacts + // to be created at the beginning of the next time step. + m_world->m_flags |= b2World::e_newFixture; + + return fixture; +} + +b2Fixture* b2Body::CreateFixture(const b2Shape* shape, float32 density) +{ + b2FixtureDef def; + def.shape = shape; + def.density = density; + + return CreateFixture(&def); +} + +void b2Body::DestroyFixture(b2Fixture* fixture) +{ + b2Assert(m_world->IsLocked() == false); + if (m_world->IsLocked() == true) + { + return; + } + + b2Assert(fixture->m_body == this); + + // Remove the fixture from this body's singly linked list. + b2Assert(m_fixtureCount > 0); + b2Fixture** node = &m_fixtureList; + bool found = false; + while (*node != NULL) + { + if (*node == fixture) + { + *node = fixture->m_next; + found = true; + break; + } + + node = &(*node)->m_next; + } + + // You tried to remove a shape that is not attached to this body. + b2Assert(found); + + // Destroy any contacts associated with the fixture. + b2ContactEdge* edge = m_contactList; + while (edge) + { + b2Contact* c = edge->contact; + edge = edge->next; + + b2Fixture* fixtureA = c->GetFixtureA(); + b2Fixture* fixtureB = c->GetFixtureB(); + + if (fixture == fixtureA || fixture == fixtureB) + { + // This destroys the contact and removes it from + // this body's contact list. + m_world->m_contactManager.Destroy(c); + } + } + + b2BlockAllocator* allocator = &m_world->m_blockAllocator; + + if (m_flags & e_activeFlag) + { + b2BroadPhase* broadPhase = &m_world->m_contactManager.m_broadPhase; + fixture->DestroyProxies(broadPhase); + } + + fixture->Destroy(allocator); + fixture->m_body = NULL; + fixture->m_next = NULL; + fixture->~b2Fixture(); + allocator->Free(fixture, sizeof(b2Fixture)); + + --m_fixtureCount; + + // Reset the mass data. + ResetMassData(); +} + +void b2Body::ResetMassData() +{ + // Compute mass data from shapes. Each shape has its own density. + m_mass = 0.0f; + m_invMass = 0.0f; + m_I = 0.0f; + m_invI = 0.0f; + m_sweep.localCenter.SetZero(); + + // Static and kinematic bodies have zero mass. + if (m_type == b2_staticBody || m_type == b2_kinematicBody) + { + m_sweep.c0 = m_xf.p; + m_sweep.c = m_xf.p; + m_sweep.a0 = m_sweep.a; + return; + } + + b2Assert(m_type == b2_dynamicBody); + + // Accumulate mass over all fixtures. + b2Vec2 localCenter = b2Vec2_zero; + for (b2Fixture* f = m_fixtureList; f; f = f->m_next) + { + if (f->m_density == 0.0f) + { + continue; + } + + b2MassData massData; + f->GetMassData(&massData); + m_mass += massData.mass; + localCenter += massData.mass * massData.center; + m_I += massData.I; + } + + // Compute center of mass. + if (m_mass > 0.0f) + { + m_invMass = 1.0f / m_mass; + localCenter *= m_invMass; + } + else + { + // Force all dynamic bodies to have a positive mass. + m_mass = 1.0f; + m_invMass = 1.0f; + } + + if (m_I > 0.0f && (m_flags & e_fixedRotationFlag) == 0) + { + // Center the inertia about the center of mass. + m_I -= m_mass * b2Dot(localCenter, localCenter); + b2Assert(m_I > 0.0f); + m_invI = 1.0f / m_I; + + } + else + { + m_I = 0.0f; + m_invI = 0.0f; + } + + // Move center of mass. + b2Vec2 oldCenter = m_sweep.c; + m_sweep.localCenter = localCenter; + m_sweep.c0 = m_sweep.c = b2Mul(m_xf, m_sweep.localCenter); + + // Update center of mass velocity. + m_linearVelocity += b2Cross(m_angularVelocity, m_sweep.c - oldCenter); +} + +void b2Body::SetMassData(const b2MassData* massData) +{ + b2Assert(m_world->IsLocked() == false); + if (m_world->IsLocked() == true) + { + return; + } + + if (m_type != b2_dynamicBody) + { + return; + } + + m_invMass = 0.0f; + m_I = 0.0f; + m_invI = 0.0f; + + m_mass = massData->mass; + if (m_mass <= 0.0f) + { + m_mass = 1.0f; + } + + m_invMass = 1.0f / m_mass; + + if (massData->I > 0.0f && (m_flags & b2Body::e_fixedRotationFlag) == 0) + { + m_I = massData->I - m_mass * b2Dot(massData->center, massData->center); + b2Assert(m_I > 0.0f); + m_invI = 1.0f / m_I; + } + + // Move center of mass. + b2Vec2 oldCenter = m_sweep.c; + m_sweep.localCenter = massData->center; + m_sweep.c0 = m_sweep.c = b2Mul(m_xf, m_sweep.localCenter); + + // Update center of mass velocity. + m_linearVelocity += b2Cross(m_angularVelocity, m_sweep.c - oldCenter); +} + +bool b2Body::ShouldCollide(const b2Body* other) const +{ + // At least one body should be dynamic. + if (m_type != b2_dynamicBody && other->m_type != b2_dynamicBody) + { + return false; + } + + // Does a joint prevent collision? + for (b2JointEdge* jn = m_jointList; jn; jn = jn->next) + { + if (jn->other == other) + { + if (jn->joint->m_collideConnected == false) + { + return false; + } + } + } + + return true; +} + +void b2Body::SetTransform(const b2Vec2& position, float32 angle) +{ + b2Assert(m_world->IsLocked() == false); + if (m_world->IsLocked() == true) + { + return; + } + + m_xf.q.Set(angle); + m_xf.p = position; + + m_sweep.c = b2Mul(m_xf, m_sweep.localCenter); + m_sweep.a = angle; + + m_sweep.c0 = m_sweep.c; + m_sweep.a0 = angle; + + b2BroadPhase* broadPhase = &m_world->m_contactManager.m_broadPhase; + for (b2Fixture* f = m_fixtureList; f; f = f->m_next) + { + f->Synchronize(broadPhase, m_xf, m_xf); + } + + m_world->m_contactManager.FindNewContacts(); +} + +void b2Body::SynchronizeFixtures() +{ + b2Transform xf1; + xf1.q.Set(m_sweep.a0); + xf1.p = m_sweep.c0 - b2Mul(xf1.q, m_sweep.localCenter); + + b2BroadPhase* broadPhase = &m_world->m_contactManager.m_broadPhase; + for (b2Fixture* f = m_fixtureList; f; f = f->m_next) + { + f->Synchronize(broadPhase, xf1, m_xf); + } +} + +void b2Body::SetActive(bool flag) +{ + b2Assert(m_world->IsLocked() == false); + + if (flag == IsActive()) + { + return; + } + + if (flag) + { + m_flags |= e_activeFlag; + + // Create all proxies. + b2BroadPhase* broadPhase = &m_world->m_contactManager.m_broadPhase; + for (b2Fixture* f = m_fixtureList; f; f = f->m_next) + { + f->CreateProxies(broadPhase, m_xf); + } + + // Contacts are created the next time step. + } + else + { + m_flags &= ~e_activeFlag; + + // Destroy all proxies. + b2BroadPhase* broadPhase = &m_world->m_contactManager.m_broadPhase; + for (b2Fixture* f = m_fixtureList; f; f = f->m_next) + { + f->DestroyProxies(broadPhase); + } + + // Destroy the attached contacts. + b2ContactEdge* ce = m_contactList; + while (ce) + { + b2ContactEdge* ce0 = ce; + ce = ce->next; + m_world->m_contactManager.Destroy(ce0->contact); + } + m_contactList = NULL; + } +} + +void b2Body::Dump() +{ + int32 bodyIndex = m_islandIndex; + + b2Log("{\n"); + b2Log(" b2BodyDef bd;\n"); + b2Log(" bd.type = b2BodyType(%d);\n", m_type); + b2Log(" bd.position.Set(%.15lef, %.15lef);\n", m_xf.p.x, m_xf.p.y); + b2Log(" bd.angle = %.15lef;\n", m_sweep.a); + b2Log(" bd.linearVelocity.Set(%.15lef, %.15lef);\n", m_linearVelocity.x, m_linearVelocity.y); + b2Log(" bd.angularVelocity = %.15lef;\n", m_angularVelocity); + b2Log(" bd.linearDamping = %.15lef;\n", m_linearDamping); + b2Log(" bd.angularDamping = %.15lef;\n", m_angularDamping); + b2Log(" bd.allowSleep = bool(%d);\n", m_flags & e_autoSleepFlag); + b2Log(" bd.awake = bool(%d);\n", m_flags & e_awakeFlag); + b2Log(" bd.fixedRotation = bool(%d);\n", m_flags & e_fixedRotationFlag); + b2Log(" bd.bullet = bool(%d);\n", m_flags & e_bulletFlag); + b2Log(" bd.active = bool(%d);\n", m_flags & e_activeFlag); + b2Log(" bd.gravityScale = %.15lef;\n", m_gravityScale); + b2Log(" bodies[%d] = m_world->CreateBody(&bd);\n", m_islandIndex); + b2Log("\n"); + for (b2Fixture* f = m_fixtureList; f; f = f->m_next) + { + b2Log(" {\n"); + f->Dump(bodyIndex); + b2Log(" }\n"); + } + b2Log("}\n"); +} \ No newline at end of file diff --git a/external/Box2D/Dynamics/b2Body.h b/external/Box2D/Dynamics/b2Body.h new file mode 100644 index 0000000000..e2d16bf630 --- /dev/null +++ b/external/Box2D/Dynamics/b2Body.h @@ -0,0 +1,846 @@ +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_BODY_H +#define B2_BODY_H + +#include +#include +#include + +class b2Fixture; +class b2Joint; +class b2Contact; +class b2Controller; +class b2World; +struct b2FixtureDef; +struct b2JointEdge; +struct b2ContactEdge; + +/// The body type. +/// static: zero mass, zero velocity, may be manually moved +/// kinematic: zero mass, non-zero velocity set by user, moved by solver +/// dynamic: positive mass, non-zero velocity determined by forces, moved by solver +enum b2BodyType +{ + b2_staticBody = 0, + b2_kinematicBody, + b2_dynamicBody + + // TODO_ERIN + //b2_bulletBody, +}; + +/// A body definition holds all the data needed to construct a rigid body. +/// You can safely re-use body definitions. Shapes are added to a body after construction. +struct b2BodyDef +{ + /// This constructor sets the body definition default values. + b2BodyDef() + { + userData = NULL; + position.Set(0.0f, 0.0f); + angle = 0.0f; + linearVelocity.Set(0.0f, 0.0f); + angularVelocity = 0.0f; + linearDamping = 0.0f; + angularDamping = 0.0f; + allowSleep = true; + awake = true; + fixedRotation = false; + bullet = false; + type = b2_staticBody; + active = true; + gravityScale = 1.0f; + } + + /// The body type: static, kinematic, or dynamic. + /// Note: if a dynamic body would have zero mass, the mass is set to one. + b2BodyType type; + + /// The world position of the body. Avoid creating bodies at the origin + /// since this can lead to many overlapping shapes. + b2Vec2 position; + + /// The world angle of the body in radians. + float32 angle; + + /// The linear velocity of the body's origin in world co-ordinates. + b2Vec2 linearVelocity; + + /// The angular velocity of the body. + float32 angularVelocity; + + /// Linear damping is use to reduce the linear velocity. The damping parameter + /// can be larger than 1.0f but the damping effect becomes sensitive to the + /// time step when the damping parameter is large. + float32 linearDamping; + + /// Angular damping is use to reduce the angular velocity. The damping parameter + /// can be larger than 1.0f but the damping effect becomes sensitive to the + /// time step when the damping parameter is large. + float32 angularDamping; + + /// Set this flag to false if this body should never fall asleep. Note that + /// this increases CPU usage. + bool allowSleep; + + /// Is this body initially awake or sleeping? + bool awake; + + /// Should this body be prevented from rotating? Useful for characters. + bool fixedRotation; + + /// Is this a fast moving body that should be prevented from tunneling through + /// other moving bodies? Note that all bodies are prevented from tunneling through + /// kinematic and static bodies. This setting is only considered on dynamic bodies. + /// @warning You should use this flag sparingly since it increases processing time. + bool bullet; + + /// Does this body start out active? + bool active; + + /// Use this to store application specific body data. + void* userData; + + /// Scale the gravity applied to this body. + float32 gravityScale; +}; + +/// A rigid body. These are created via b2World::CreateBody. +class b2Body +{ +public: + /// Creates a fixture and attach it to this body. Use this function if you need + /// to set some fixture parameters, like friction. Otherwise you can create the + /// fixture directly from a shape. + /// If the density is non-zero, this function automatically updates the mass of the body. + /// Contacts are not created until the next time step. + /// @param def the fixture definition. + /// @warning This function is locked during callbacks. + b2Fixture* CreateFixture(const b2FixtureDef* def); + + /// Creates a fixture from a shape and attach it to this body. + /// This is a convenience function. Use b2FixtureDef if you need to set parameters + /// like friction, restitution, user data, or filtering. + /// If the density is non-zero, this function automatically updates the mass of the body. + /// @param shape the shape to be cloned. + /// @param density the shape density (set to zero for static bodies). + /// @warning This function is locked during callbacks. + b2Fixture* CreateFixture(const b2Shape* shape, float32 density); + + /// Destroy a fixture. This removes the fixture from the broad-phase and + /// destroys all contacts associated with this fixture. This will + /// automatically adjust the mass of the body if the body is dynamic and the + /// fixture has positive density. + /// All fixtures attached to a body are implicitly destroyed when the body is destroyed. + /// @param fixture the fixture to be removed. + /// @warning This function is locked during callbacks. + void DestroyFixture(b2Fixture* fixture); + + /// Set the position of the body's origin and rotation. + /// This breaks any contacts and wakes the other bodies. + /// Manipulating a body's transform may cause non-physical behavior. + /// @param position the world position of the body's local origin. + /// @param angle the world rotation in radians. + void SetTransform(const b2Vec2& position, float32 angle); + + /// Get the body transform for the body's origin. + /// @return the world transform of the body's origin. + const b2Transform& GetTransform() const; + + /// Get the world body origin position. + /// @return the world position of the body's origin. + const b2Vec2& GetPosition() const; + + /// Get the angle in radians. + /// @return the current world rotation angle in radians. + float32 GetAngle() const; + + /// Get the world position of the center of mass. + const b2Vec2& GetWorldCenter() const; + + /// Get the local position of the center of mass. + const b2Vec2& GetLocalCenter() const; + + /// Set the linear velocity of the center of mass. + /// @param v the new linear velocity of the center of mass. + void SetLinearVelocity(const b2Vec2& v); + + /// Get the linear velocity of the center of mass. + /// @return the linear velocity of the center of mass. + b2Vec2 GetLinearVelocity() const; + + /// Set the angular velocity. + /// @param omega the new angular velocity in radians/second. + void SetAngularVelocity(float32 omega); + + /// Get the angular velocity. + /// @return the angular velocity in radians/second. + float32 GetAngularVelocity() const; + + /// Apply a force at a world point. If the force is not + /// applied at the center of mass, it will generate a torque and + /// affect the angular velocity. This wakes up the body. + /// @param force the world force vector, usually in Newtons (N). + /// @param point the world position of the point of application. + void ApplyForce(const b2Vec2& force, const b2Vec2& point); + + /// Apply a force to the center of mass. This wakes up the body. + /// @param force the world force vector, usually in Newtons (N). + void ApplyForceToCenter(const b2Vec2& force); + + /// Apply a torque. This affects the angular velocity + /// without affecting the linear velocity of the center of mass. + /// This wakes up the body. + /// @param torque about the z-axis (out of the screen), usually in N-m. + void ApplyTorque(float32 torque); + + /// Apply an impulse at a point. This immediately modifies the velocity. + /// It also modifies the angular velocity if the point of application + /// is not at the center of mass. This wakes up the body. + /// @param impulse the world impulse vector, usually in N-seconds or kg-m/s. + /// @param point the world position of the point of application. + void ApplyLinearImpulse(const b2Vec2& impulse, const b2Vec2& point); + + /// Apply an angular impulse. + /// @param impulse the angular impulse in units of kg*m*m/s + void ApplyAngularImpulse(float32 impulse); + + /// Get the total mass of the body. + /// @return the mass, usually in kilograms (kg). + float32 GetMass() const; + + /// Get the rotational inertia of the body about the local origin. + /// @return the rotational inertia, usually in kg-m^2. + float32 GetInertia() const; + + /// Get the mass data of the body. + /// @return a struct containing the mass, inertia and center of the body. + void GetMassData(b2MassData* data) const; + + /// Set the mass properties to override the mass properties of the fixtures. + /// Note that this changes the center of mass position. + /// Note that creating or destroying fixtures can also alter the mass. + /// This function has no effect if the body isn't dynamic. + /// @param massData the mass properties. + void SetMassData(const b2MassData* data); + + /// This resets the mass properties to the sum of the mass properties of the fixtures. + /// This normally does not need to be called unless you called SetMassData to override + /// the mass and you later want to reset the mass. + void ResetMassData(); + + /// Get the world coordinates of a point given the local coordinates. + /// @param localPoint a point on the body measured relative the the body's origin. + /// @return the same point expressed in world coordinates. + b2Vec2 GetWorldPoint(const b2Vec2& localPoint) const; + + /// Get the world coordinates of a vector given the local coordinates. + /// @param localVector a vector fixed in the body. + /// @return the same vector expressed in world coordinates. + b2Vec2 GetWorldVector(const b2Vec2& localVector) const; + + /// Gets a local point relative to the body's origin given a world point. + /// @param a point in world coordinates. + /// @return the corresponding local point relative to the body's origin. + b2Vec2 GetLocalPoint(const b2Vec2& worldPoint) const; + + /// Gets a local vector given a world vector. + /// @param a vector in world coordinates. + /// @return the corresponding local vector. + b2Vec2 GetLocalVector(const b2Vec2& worldVector) const; + + /// Get the world linear velocity of a world point attached to this body. + /// @param a point in world coordinates. + /// @return the world velocity of a point. + b2Vec2 GetLinearVelocityFromWorldPoint(const b2Vec2& worldPoint) const; + + /// Get the world velocity of a local point. + /// @param a point in local coordinates. + /// @return the world velocity of a point. + b2Vec2 GetLinearVelocityFromLocalPoint(const b2Vec2& localPoint) const; + + /// Get the linear damping of the body. + float32 GetLinearDamping() const; + + /// Set the linear damping of the body. + void SetLinearDamping(float32 linearDamping); + + /// Get the angular damping of the body. + float32 GetAngularDamping() const; + + /// Set the angular damping of the body. + void SetAngularDamping(float32 angularDamping); + + /// Get the gravity scale of the body. + float32 GetGravityScale() const; + + /// Set the gravity scale of the body. + void SetGravityScale(float32 scale); + + /// Set the type of this body. This may alter the mass and velocity. + void SetType(b2BodyType type); + + /// Get the type of this body. + b2BodyType GetType() const; + + /// Should this body be treated like a bullet for continuous collision detection? + void SetBullet(bool flag); + + /// Is this body treated like a bullet for continuous collision detection? + bool IsBullet() const; + + /// You can disable sleeping on this body. If you disable sleeping, the + /// body will be woken. + void SetSleepingAllowed(bool flag); + + /// Is this body allowed to sleep + bool IsSleepingAllowed() const; + + /// Set the sleep state of the body. A sleeping body has very + /// low CPU cost. + /// @param flag set to true to put body to sleep, false to wake it. + void SetAwake(bool flag); + + /// Get the sleeping state of this body. + /// @return true if the body is sleeping. + bool IsAwake() const; + + /// Set the active state of the body. An inactive body is not + /// simulated and cannot be collided with or woken up. + /// If you pass a flag of true, all fixtures will be added to the + /// broad-phase. + /// If you pass a flag of false, all fixtures will be removed from + /// the broad-phase and all contacts will be destroyed. + /// Fixtures and joints are otherwise unaffected. You may continue + /// to create/destroy fixtures and joints on inactive bodies. + /// Fixtures on an inactive body are implicitly inactive and will + /// not participate in collisions, ray-casts, or queries. + /// Joints connected to an inactive body are implicitly inactive. + /// An inactive body is still owned by a b2World object and remains + /// in the body list. + void SetActive(bool flag); + + /// Get the active state of the body. + bool IsActive() const; + + /// Set this body to have fixed rotation. This causes the mass + /// to be reset. + void SetFixedRotation(bool flag); + + /// Does this body have fixed rotation? + bool IsFixedRotation() const; + + /// Get the list of all fixtures attached to this body. + b2Fixture* GetFixtureList(); + const b2Fixture* GetFixtureList() const; + + /// Get the list of all joints attached to this body. + b2JointEdge* GetJointList(); + const b2JointEdge* GetJointList() const; + + /// Get the list of all contacts attached to this body. + /// @warning this list changes during the time step and you may + /// miss some collisions if you don't use b2ContactListener. + b2ContactEdge* GetContactList(); + const b2ContactEdge* GetContactList() const; + + /// Get the next body in the world's body list. + b2Body* GetNext(); + const b2Body* GetNext() const; + + /// Get the user data pointer that was provided in the body definition. + void* GetUserData() const; + + /// Set the user data. Use this to store your application specific data. + void SetUserData(void* data); + + /// Get the parent world of this body. + b2World* GetWorld(); + const b2World* GetWorld() const; + + /// Dump this body to a log file + void Dump(); + +private: + + friend class b2World; + friend class b2Island; + friend class b2ContactManager; + friend class b2ContactSolver; + friend class b2Contact; + + friend class b2DistanceJoint; + friend class b2GearJoint; + friend class b2WheelJoint; + friend class b2MouseJoint; + friend class b2PrismaticJoint; + friend class b2PulleyJoint; + friend class b2RevoluteJoint; + friend class b2WeldJoint; + friend class b2FrictionJoint; + friend class b2RopeJoint; + + // m_flags + enum + { + e_islandFlag = 0x0001, + e_awakeFlag = 0x0002, + e_autoSleepFlag = 0x0004, + e_bulletFlag = 0x0008, + e_fixedRotationFlag = 0x0010, + e_activeFlag = 0x0020, + e_toiFlag = 0x0040 + }; + + b2Body(const b2BodyDef* bd, b2World* world); + ~b2Body(); + + void SynchronizeFixtures(); + void SynchronizeTransform(); + + // This is used to prevent connected bodies from colliding. + // It may lie, depending on the collideConnected flag. + bool ShouldCollide(const b2Body* other) const; + + void Advance(float32 t); + + b2BodyType m_type; + + uint16 m_flags; + + int32 m_islandIndex; + + b2Transform m_xf; // the body origin transform + b2Sweep m_sweep; // the swept motion for CCD + + b2Vec2 m_linearVelocity; + float32 m_angularVelocity; + + b2Vec2 m_force; + float32 m_torque; + + b2World* m_world; + b2Body* m_prev; + b2Body* m_next; + + b2Fixture* m_fixtureList; + int32 m_fixtureCount; + + b2JointEdge* m_jointList; + b2ContactEdge* m_contactList; + + float32 m_mass, m_invMass; + + // Rotational inertia about the center of mass. + float32 m_I, m_invI; + + float32 m_linearDamping; + float32 m_angularDamping; + float32 m_gravityScale; + + float32 m_sleepTime; + + void* m_userData; +}; + +inline b2BodyType b2Body::GetType() const +{ + return m_type; +} + +inline const b2Transform& b2Body::GetTransform() const +{ + return m_xf; +} + +inline const b2Vec2& b2Body::GetPosition() const +{ + return m_xf.p; +} + +inline float32 b2Body::GetAngle() const +{ + return m_sweep.a; +} + +inline const b2Vec2& b2Body::GetWorldCenter() const +{ + return m_sweep.c; +} + +inline const b2Vec2& b2Body::GetLocalCenter() const +{ + return m_sweep.localCenter; +} + +inline void b2Body::SetLinearVelocity(const b2Vec2& v) +{ + if (m_type == b2_staticBody) + { + return; + } + + if (b2Dot(v,v) > 0.0f) + { + SetAwake(true); + } + + m_linearVelocity = v; +} + +inline b2Vec2 b2Body::GetLinearVelocity() const +{ + return m_linearVelocity; +} + +inline void b2Body::SetAngularVelocity(float32 w) +{ + if (m_type == b2_staticBody) + { + return; + } + + if (w * w > 0.0f) + { + SetAwake(true); + } + + m_angularVelocity = w; +} + +inline float32 b2Body::GetAngularVelocity() const +{ + return m_angularVelocity; +} + +inline float32 b2Body::GetMass() const +{ + return m_mass; +} + +inline float32 b2Body::GetInertia() const +{ + return m_I + m_mass * b2Dot(m_sweep.localCenter, m_sweep.localCenter); +} + +inline void b2Body::GetMassData(b2MassData* data) const +{ + data->mass = m_mass; + data->I = m_I + m_mass * b2Dot(m_sweep.localCenter, m_sweep.localCenter); + data->center = m_sweep.localCenter; +} + +inline b2Vec2 b2Body::GetWorldPoint(const b2Vec2& localPoint) const +{ + return b2Mul(m_xf, localPoint); +} + +inline b2Vec2 b2Body::GetWorldVector(const b2Vec2& localVector) const +{ + return b2Mul(m_xf.q, localVector); +} + +inline b2Vec2 b2Body::GetLocalPoint(const b2Vec2& worldPoint) const +{ + return b2MulT(m_xf, worldPoint); +} + +inline b2Vec2 b2Body::GetLocalVector(const b2Vec2& worldVector) const +{ + return b2MulT(m_xf.q, worldVector); +} + +inline b2Vec2 b2Body::GetLinearVelocityFromWorldPoint(const b2Vec2& worldPoint) const +{ + return m_linearVelocity + b2Cross(m_angularVelocity, worldPoint - m_sweep.c); +} + +inline b2Vec2 b2Body::GetLinearVelocityFromLocalPoint(const b2Vec2& localPoint) const +{ + return GetLinearVelocityFromWorldPoint(GetWorldPoint(localPoint)); +} + +inline float32 b2Body::GetLinearDamping() const +{ + return m_linearDamping; +} + +inline void b2Body::SetLinearDamping(float32 linearDamping) +{ + m_linearDamping = linearDamping; +} + +inline float32 b2Body::GetAngularDamping() const +{ + return m_angularDamping; +} + +inline void b2Body::SetAngularDamping(float32 angularDamping) +{ + m_angularDamping = angularDamping; +} + +inline float32 b2Body::GetGravityScale() const +{ + return m_gravityScale; +} + +inline void b2Body::SetGravityScale(float32 scale) +{ + m_gravityScale = scale; +} + +inline void b2Body::SetBullet(bool flag) +{ + if (flag) + { + m_flags |= e_bulletFlag; + } + else + { + m_flags &= ~e_bulletFlag; + } +} + +inline bool b2Body::IsBullet() const +{ + return (m_flags & e_bulletFlag) == e_bulletFlag; +} + +inline void b2Body::SetAwake(bool flag) +{ + if (flag) + { + if ((m_flags & e_awakeFlag) == 0) + { + m_flags |= e_awakeFlag; + m_sleepTime = 0.0f; + } + } + else + { + m_flags &= ~e_awakeFlag; + m_sleepTime = 0.0f; + m_linearVelocity.SetZero(); + m_angularVelocity = 0.0f; + m_force.SetZero(); + m_torque = 0.0f; + } +} + +inline bool b2Body::IsAwake() const +{ + return (m_flags & e_awakeFlag) == e_awakeFlag; +} + +inline bool b2Body::IsActive() const +{ + return (m_flags & e_activeFlag) == e_activeFlag; +} + +inline void b2Body::SetFixedRotation(bool flag) +{ + if (flag) + { + m_flags |= e_fixedRotationFlag; + } + else + { + m_flags &= ~e_fixedRotationFlag; + } + + ResetMassData(); +} + +inline bool b2Body::IsFixedRotation() const +{ + return (m_flags & e_fixedRotationFlag) == e_fixedRotationFlag; +} + +inline void b2Body::SetSleepingAllowed(bool flag) +{ + if (flag) + { + m_flags |= e_autoSleepFlag; + } + else + { + m_flags &= ~e_autoSleepFlag; + SetAwake(true); + } +} + +inline bool b2Body::IsSleepingAllowed() const +{ + return (m_flags & e_autoSleepFlag) == e_autoSleepFlag; +} + +inline b2Fixture* b2Body::GetFixtureList() +{ + return m_fixtureList; +} + +inline const b2Fixture* b2Body::GetFixtureList() const +{ + return m_fixtureList; +} + +inline b2JointEdge* b2Body::GetJointList() +{ + return m_jointList; +} + +inline const b2JointEdge* b2Body::GetJointList() const +{ + return m_jointList; +} + +inline b2ContactEdge* b2Body::GetContactList() +{ + return m_contactList; +} + +inline const b2ContactEdge* b2Body::GetContactList() const +{ + return m_contactList; +} + +inline b2Body* b2Body::GetNext() +{ + return m_next; +} + +inline const b2Body* b2Body::GetNext() const +{ + return m_next; +} + +inline void b2Body::SetUserData(void* data) +{ + m_userData = data; +} + +inline void* b2Body::GetUserData() const +{ + return m_userData; +} + +inline void b2Body::ApplyForce(const b2Vec2& force, const b2Vec2& point) +{ + if (m_type != b2_dynamicBody) + { + return; + } + + if (IsAwake() == false) + { + SetAwake(true); + } + + m_force += force; + m_torque += b2Cross(point - m_sweep.c, force); +} + +inline void b2Body::ApplyForceToCenter(const b2Vec2& force) +{ + if (m_type != b2_dynamicBody) + { + return; + } + + if (IsAwake() == false) + { + SetAwake(true); + } + + m_force += force; +} + +inline void b2Body::ApplyTorque(float32 torque) +{ + if (m_type != b2_dynamicBody) + { + return; + } + + if (IsAwake() == false) + { + SetAwake(true); + } + + m_torque += torque; +} + +inline void b2Body::ApplyLinearImpulse(const b2Vec2& impulse, const b2Vec2& point) +{ + if (m_type != b2_dynamicBody) + { + return; + } + + if (IsAwake() == false) + { + SetAwake(true); + } + m_linearVelocity += m_invMass * impulse; + m_angularVelocity += m_invI * b2Cross(point - m_sweep.c, impulse); +} + +inline void b2Body::ApplyAngularImpulse(float32 impulse) +{ + if (m_type != b2_dynamicBody) + { + return; + } + + if (IsAwake() == false) + { + SetAwake(true); + } + m_angularVelocity += m_invI * impulse; +} + +inline void b2Body::SynchronizeTransform() +{ + m_xf.q.Set(m_sweep.a); + m_xf.p = m_sweep.c - b2Mul(m_xf.q, m_sweep.localCenter); +} + +inline void b2Body::Advance(float32 alpha) +{ + // Advance to the new safe time. This doesn't sync the broad-phase. + m_sweep.Advance(alpha); + m_sweep.c = m_sweep.c0; + m_sweep.a = m_sweep.a0; + m_xf.q.Set(m_sweep.a); + m_xf.p = m_sweep.c - b2Mul(m_xf.q, m_sweep.localCenter); +} + +inline b2World* b2Body::GetWorld() +{ + return m_world; +} + +inline const b2World* b2Body::GetWorld() const +{ + return m_world; +} + +#endif diff --git a/external/Box2D/Dynamics/b2ContactManager.cpp b/external/Box2D/Dynamics/b2ContactManager.cpp new file mode 100644 index 0000000000..c14cc4ce45 --- /dev/null +++ b/external/Box2D/Dynamics/b2ContactManager.cpp @@ -0,0 +1,293 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include +#include +#include + +b2ContactFilter b2_defaultFilter; +b2ContactListener b2_defaultListener; + +b2ContactManager::b2ContactManager() +{ + m_contactList = NULL; + m_contactCount = 0; + m_contactFilter = &b2_defaultFilter; + m_contactListener = &b2_defaultListener; + m_allocator = NULL; +} + +void b2ContactManager::Destroy(b2Contact* c) +{ + b2Fixture* fixtureA = c->GetFixtureA(); + b2Fixture* fixtureB = c->GetFixtureB(); + b2Body* bodyA = fixtureA->GetBody(); + b2Body* bodyB = fixtureB->GetBody(); + + if (m_contactListener && c->IsTouching()) + { + m_contactListener->EndContact(c); + } + + // Remove from the world. + if (c->m_prev) + { + c->m_prev->m_next = c->m_next; + } + + if (c->m_next) + { + c->m_next->m_prev = c->m_prev; + } + + if (c == m_contactList) + { + m_contactList = c->m_next; + } + + // Remove from body 1 + if (c->m_nodeA.prev) + { + c->m_nodeA.prev->next = c->m_nodeA.next; + } + + if (c->m_nodeA.next) + { + c->m_nodeA.next->prev = c->m_nodeA.prev; + } + + if (&c->m_nodeA == bodyA->m_contactList) + { + bodyA->m_contactList = c->m_nodeA.next; + } + + // Remove from body 2 + if (c->m_nodeB.prev) + { + c->m_nodeB.prev->next = c->m_nodeB.next; + } + + if (c->m_nodeB.next) + { + c->m_nodeB.next->prev = c->m_nodeB.prev; + } + + if (&c->m_nodeB == bodyB->m_contactList) + { + bodyB->m_contactList = c->m_nodeB.next; + } + + // Call the factory. + b2Contact::Destroy(c, m_allocator); + --m_contactCount; +} + +// This is the top level collision call for the time step. Here +// all the narrow phase collision is processed for the world +// contact list. +void b2ContactManager::Collide() +{ + // Update awake contacts. + b2Contact* c = m_contactList; + while (c) + { + b2Fixture* fixtureA = c->GetFixtureA(); + b2Fixture* fixtureB = c->GetFixtureB(); + int32 indexA = c->GetChildIndexA(); + int32 indexB = c->GetChildIndexB(); + b2Body* bodyA = fixtureA->GetBody(); + b2Body* bodyB = fixtureB->GetBody(); + + // Is this contact flagged for filtering? + if (c->m_flags & b2Contact::e_filterFlag) + { + // Should these bodies collide? + if (bodyB->ShouldCollide(bodyA) == false) + { + b2Contact* cNuke = c; + c = cNuke->GetNext(); + Destroy(cNuke); + continue; + } + + // Check user filtering. + if (m_contactFilter && m_contactFilter->ShouldCollide(fixtureA, fixtureB) == false) + { + b2Contact* cNuke = c; + c = cNuke->GetNext(); + Destroy(cNuke); + continue; + } + + // Clear the filtering flag. + c->m_flags &= ~b2Contact::e_filterFlag; + } + + bool activeA = bodyA->IsAwake() && bodyA->m_type != b2_staticBody; + bool activeB = bodyB->IsAwake() && bodyB->m_type != b2_staticBody; + + // At least one body must be awake and it must be dynamic or kinematic. + if (activeA == false && activeB == false) + { + c = c->GetNext(); + continue; + } + + int32 proxyIdA = fixtureA->m_proxies[indexA].proxyId; + int32 proxyIdB = fixtureB->m_proxies[indexB].proxyId; + bool overlap = m_broadPhase.TestOverlap(proxyIdA, proxyIdB); + + // Here we destroy contacts that cease to overlap in the broad-phase. + if (overlap == false) + { + b2Contact* cNuke = c; + c = cNuke->GetNext(); + Destroy(cNuke); + continue; + } + + // The contact persists. + c->Update(m_contactListener); + c = c->GetNext(); + } +} + +void b2ContactManager::FindNewContacts() +{ + m_broadPhase.UpdatePairs(this); +} + +void b2ContactManager::AddPair(void* proxyUserDataA, void* proxyUserDataB) +{ + b2FixtureProxy* proxyA = (b2FixtureProxy*)proxyUserDataA; + b2FixtureProxy* proxyB = (b2FixtureProxy*)proxyUserDataB; + + b2Fixture* fixtureA = proxyA->fixture; + b2Fixture* fixtureB = proxyB->fixture; + + int32 indexA = proxyA->childIndex; + int32 indexB = proxyB->childIndex; + + b2Body* bodyA = fixtureA->GetBody(); + b2Body* bodyB = fixtureB->GetBody(); + + // Are the fixtures on the same body? + if (bodyA == bodyB) + { + return; + } + + // TODO_ERIN use a hash table to remove a potential bottleneck when both + // bodies have a lot of contacts. + // Does a contact already exist? + b2ContactEdge* edge = bodyB->GetContactList(); + while (edge) + { + if (edge->other == bodyA) + { + b2Fixture* fA = edge->contact->GetFixtureA(); + b2Fixture* fB = edge->contact->GetFixtureB(); + int32 iA = edge->contact->GetChildIndexA(); + int32 iB = edge->contact->GetChildIndexB(); + + if (fA == fixtureA && fB == fixtureB && iA == indexA && iB == indexB) + { + // A contact already exists. + return; + } + + if (fA == fixtureB && fB == fixtureA && iA == indexB && iB == indexA) + { + // A contact already exists. + return; + } + } + + edge = edge->next; + } + + // Does a joint override collision? Is at least one body dynamic? + if (bodyB->ShouldCollide(bodyA) == false) + { + return; + } + + // Check user filtering. + if (m_contactFilter && m_contactFilter->ShouldCollide(fixtureA, fixtureB) == false) + { + return; + } + + // Call the factory. + b2Contact* c = b2Contact::Create(fixtureA, indexA, fixtureB, indexB, m_allocator); + if (c == NULL) + { + return; + } + + // Contact creation may swap fixtures. + fixtureA = c->GetFixtureA(); + fixtureB = c->GetFixtureB(); + indexA = c->GetChildIndexA(); + indexB = c->GetChildIndexB(); + bodyA = fixtureA->GetBody(); + bodyB = fixtureB->GetBody(); + + // Insert into the world. + c->m_prev = NULL; + c->m_next = m_contactList; + if (m_contactList != NULL) + { + m_contactList->m_prev = c; + } + m_contactList = c; + + // Connect to island graph. + + // Connect to body A + c->m_nodeA.contact = c; + c->m_nodeA.other = bodyB; + + c->m_nodeA.prev = NULL; + c->m_nodeA.next = bodyA->m_contactList; + if (bodyA->m_contactList != NULL) + { + bodyA->m_contactList->prev = &c->m_nodeA; + } + bodyA->m_contactList = &c->m_nodeA; + + // Connect to body B + c->m_nodeB.contact = c; + c->m_nodeB.other = bodyA; + + c->m_nodeB.prev = NULL; + c->m_nodeB.next = bodyB->m_contactList; + if (bodyB->m_contactList != NULL) + { + bodyB->m_contactList->prev = &c->m_nodeB; + } + bodyB->m_contactList = &c->m_nodeB; + + // Wake up the bodies + bodyA->SetAwake(true); + bodyB->SetAwake(true); + + ++m_contactCount; +} diff --git a/external/Box2D/Dynamics/b2ContactManager.h b/external/Box2D/Dynamics/b2ContactManager.h new file mode 100644 index 0000000000..9cb5718145 --- /dev/null +++ b/external/Box2D/Dynamics/b2ContactManager.h @@ -0,0 +1,52 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_CONTACT_MANAGER_H +#define B2_CONTACT_MANAGER_H + +#include + +class b2Contact; +class b2ContactFilter; +class b2ContactListener; +class b2BlockAllocator; + +// Delegate of b2World. +class b2ContactManager +{ +public: + b2ContactManager(); + + // Broad-phase callback. + void AddPair(void* proxyUserDataA, void* proxyUserDataB); + + void FindNewContacts(); + + void Destroy(b2Contact* c); + + void Collide(); + + b2BroadPhase m_broadPhase; + b2Contact* m_contactList; + int32 m_contactCount; + b2ContactFilter* m_contactFilter; + b2ContactListener* m_contactListener; + b2BlockAllocator* m_allocator; +}; + +#endif diff --git a/external/Box2D/Dynamics/b2Fixture.cpp b/external/Box2D/Dynamics/b2Fixture.cpp new file mode 100644 index 0000000000..774a78e5bb --- /dev/null +++ b/external/Box2D/Dynamics/b2Fixture.cpp @@ -0,0 +1,303 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +b2Fixture::b2Fixture() +{ + m_userData = NULL; + m_body = NULL; + m_next = NULL; + m_proxies = NULL; + m_proxyCount = 0; + m_shape = NULL; + m_density = 0.0f; +} + +void b2Fixture::Create(b2BlockAllocator* allocator, b2Body* body, const b2FixtureDef* def) +{ + m_userData = def->userData; + m_friction = def->friction; + m_restitution = def->restitution; + + m_body = body; + m_next = NULL; + + m_filter = def->filter; + + m_isSensor = def->isSensor; + + m_shape = def->shape->Clone(allocator); + + // Reserve proxy space + int32 childCount = m_shape->GetChildCount(); + m_proxies = (b2FixtureProxy*)allocator->Allocate(childCount * sizeof(b2FixtureProxy)); + for (int32 i = 0; i < childCount; ++i) + { + m_proxies[i].fixture = NULL; + m_proxies[i].proxyId = b2BroadPhase::e_nullProxy; + } + m_proxyCount = 0; + + m_density = def->density; +} + +void b2Fixture::Destroy(b2BlockAllocator* allocator) +{ + // The proxies must be destroyed before calling this. + b2Assert(m_proxyCount == 0); + + // Free the proxy array. + int32 childCount = m_shape->GetChildCount(); + allocator->Free(m_proxies, childCount * sizeof(b2FixtureProxy)); + m_proxies = NULL; + + // Free the child shape. + switch (m_shape->m_type) + { + case b2Shape::e_circle: + { + b2CircleShape* s = (b2CircleShape*)m_shape; + s->~b2CircleShape(); + allocator->Free(s, sizeof(b2CircleShape)); + } + break; + + case b2Shape::e_edge: + { + b2EdgeShape* s = (b2EdgeShape*)m_shape; + s->~b2EdgeShape(); + allocator->Free(s, sizeof(b2EdgeShape)); + } + break; + + case b2Shape::e_polygon: + { + b2PolygonShape* s = (b2PolygonShape*)m_shape; + s->~b2PolygonShape(); + allocator->Free(s, sizeof(b2PolygonShape)); + } + break; + + case b2Shape::e_chain: + { + b2ChainShape* s = (b2ChainShape*)m_shape; + s->~b2ChainShape(); + allocator->Free(s, sizeof(b2ChainShape)); + } + break; + + default: + b2Assert(false); + break; + } + + m_shape = NULL; +} + +void b2Fixture::CreateProxies(b2BroadPhase* broadPhase, const b2Transform& xf) +{ + b2Assert(m_proxyCount == 0); + + // Create proxies in the broad-phase. + m_proxyCount = m_shape->GetChildCount(); + + for (int32 i = 0; i < m_proxyCount; ++i) + { + b2FixtureProxy* proxy = m_proxies + i; + m_shape->ComputeAABB(&proxy->aabb, xf, i); + proxy->proxyId = broadPhase->CreateProxy(proxy->aabb, proxy); + proxy->fixture = this; + proxy->childIndex = i; + } +} + +void b2Fixture::DestroyProxies(b2BroadPhase* broadPhase) +{ + // Destroy proxies in the broad-phase. + for (int32 i = 0; i < m_proxyCount; ++i) + { + b2FixtureProxy* proxy = m_proxies + i; + broadPhase->DestroyProxy(proxy->proxyId); + proxy->proxyId = b2BroadPhase::e_nullProxy; + } + + m_proxyCount = 0; +} + +void b2Fixture::Synchronize(b2BroadPhase* broadPhase, const b2Transform& transform1, const b2Transform& transform2) +{ + if (m_proxyCount == 0) + { + return; + } + + for (int32 i = 0; i < m_proxyCount; ++i) + { + b2FixtureProxy* proxy = m_proxies + i; + + // Compute an AABB that covers the swept shape (may miss some rotation effect). + b2AABB aabb1, aabb2; + m_shape->ComputeAABB(&aabb1, transform1, proxy->childIndex); + m_shape->ComputeAABB(&aabb2, transform2, proxy->childIndex); + + proxy->aabb.Combine(aabb1, aabb2); + + b2Vec2 displacement = transform2.p - transform1.p; + + broadPhase->MoveProxy(proxy->proxyId, proxy->aabb, displacement); + } +} + +void b2Fixture::SetFilterData(const b2Filter& filter) +{ + m_filter = filter; + + Refilter(); +} + +void b2Fixture::Refilter() +{ + if (m_body == NULL) + { + return; + } + + // Flag associated contacts for filtering. + b2ContactEdge* edge = m_body->GetContactList(); + while (edge) + { + b2Contact* contact = edge->contact; + b2Fixture* fixtureA = contact->GetFixtureA(); + b2Fixture* fixtureB = contact->GetFixtureB(); + if (fixtureA == this || fixtureB == this) + { + contact->FlagForFiltering(); + } + + edge = edge->next; + } + + b2World* world = m_body->GetWorld(); + + if (world == NULL) + { + return; + } + + // Touch each proxy so that new pairs may be created + b2BroadPhase* broadPhase = &world->m_contactManager.m_broadPhase; + for (int32 i = 0; i < m_proxyCount; ++i) + { + broadPhase->TouchProxy(m_proxies[i].proxyId); + } +} + +void b2Fixture::SetSensor(bool sensor) +{ + if (sensor != m_isSensor) + { + m_body->SetAwake(true); + m_isSensor = sensor; + } +} + +void b2Fixture::Dump(int32 bodyIndex) +{ + b2Log(" b2FixtureDef fd;\n"); + b2Log(" fd.friction = %.15lef;\n", m_friction); + b2Log(" fd.restitution = %.15lef;\n", m_restitution); + b2Log(" fd.density = %.15lef;\n", m_density); + b2Log(" fd.isSensor = bool(%d);\n", m_isSensor); + b2Log(" fd.filter.categoryBits = uint16(%d);\n", m_filter.categoryBits); + b2Log(" fd.filter.maskBits = uint16(%d);\n", m_filter.maskBits); + b2Log(" fd.filter.groupIndex = int16(%d);\n", m_filter.groupIndex); + + switch (m_shape->m_type) + { + case b2Shape::e_circle: + { + b2CircleShape* s = (b2CircleShape*)m_shape; + b2Log(" b2CircleShape shape;\n"); + b2Log(" shape.m_radius = %.15lef;\n", s->m_radius); + b2Log(" shape.m_p.Set(%.15lef, %.15lef);\n", s->m_p.x, s->m_p.y); + } + break; + + case b2Shape::e_edge: + { + b2EdgeShape* s = (b2EdgeShape*)m_shape; + b2Log(" b2EdgeShape shape;\n"); + b2Log(" shape.m_radius = %.15lef;\n", s->m_radius); + b2Log(" shape.m_vertex0.Set(%.15lef, %.15lef);\n", s->m_vertex0.x, s->m_vertex0.y); + b2Log(" shape.m_vertex1.Set(%.15lef, %.15lef);\n", s->m_vertex1.x, s->m_vertex1.y); + b2Log(" shape.m_vertex2.Set(%.15lef, %.15lef);\n", s->m_vertex2.x, s->m_vertex2.y); + b2Log(" shape.m_vertex3.Set(%.15lef, %.15lef);\n", s->m_vertex3.x, s->m_vertex3.y); + b2Log(" shape.m_hasVertex0 = bool(%d);\n", s->m_hasVertex0); + b2Log(" shape.m_hasVertex3 = bool(%d);\n", s->m_hasVertex3); + } + break; + + case b2Shape::e_polygon: + { + b2PolygonShape* s = (b2PolygonShape*)m_shape; + b2Log(" b2PolygonShape shape;\n"); + b2Log(" b2Vec2 vs[%d];\n", b2_maxPolygonVertices); + for (int32 i = 0; i < s->m_vertexCount; ++i) + { + b2Log(" vs[%d].Set(%.15lef, %.15lef);\n", i, s->m_vertices[i].x, s->m_vertices[i].y); + } + b2Log(" shape.Set(vs, %d);\n", s->m_vertexCount); + } + break; + + case b2Shape::e_chain: + { + b2ChainShape* s = (b2ChainShape*)m_shape; + b2Log(" b2ChainShape shape;\n"); + b2Log(" b2Vec2 vs[%d];\n", s->m_count); + for (int32 i = 0; i < s->m_count; ++i) + { + b2Log(" vs[%d].Set(%.15lef, %.15lef);\n", i, s->m_vertices[i].x, s->m_vertices[i].y); + } + b2Log(" shape.CreateChain(vs, %d);\n", s->m_count); + b2Log(" shape.m_prevVertex.Set(%.15lef, %.15lef);\n", s->m_prevVertex.x, s->m_prevVertex.y); + b2Log(" shape.m_nextVertex.Set(%.15lef, %.15lef);\n", s->m_nextVertex.x, s->m_nextVertex.y); + b2Log(" shape.m_hasPrevVertex = bool(%d);\n", s->m_hasPrevVertex); + b2Log(" shape.m_hasNextVertex = bool(%d);\n", s->m_hasNextVertex); + } + break; + + default: + return; + } + + b2Log("\n"); + b2Log(" fd.shape = &shape;\n"); + b2Log("\n"); + b2Log(" bodies[%d]->CreateFixture(&fd);\n", bodyIndex); +} diff --git a/external/Box2D/Dynamics/b2Fixture.h b/external/Box2D/Dynamics/b2Fixture.h new file mode 100644 index 0000000000..d390410b93 --- /dev/null +++ b/external/Box2D/Dynamics/b2Fixture.h @@ -0,0 +1,345 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_FIXTURE_H +#define B2_FIXTURE_H + +#include +#include +#include + +class b2BlockAllocator; +class b2Body; +class b2BroadPhase; +class b2Fixture; + +/// This holds contact filtering data. +struct b2Filter +{ + b2Filter() + { + categoryBits = 0x0001; + maskBits = 0xFFFF; + groupIndex = 0; + } + + /// The collision category bits. Normally you would just set one bit. + uint16 categoryBits; + + /// The collision mask bits. This states the categories that this + /// shape would accept for collision. + uint16 maskBits; + + /// Collision groups allow a certain group of objects to never collide (negative) + /// or always collide (positive). Zero means no collision group. Non-zero group + /// filtering always wins against the mask bits. + int16 groupIndex; +}; + +/// A fixture definition is used to create a fixture. This class defines an +/// abstract fixture definition. You can reuse fixture definitions safely. +struct b2FixtureDef +{ + /// The constructor sets the default fixture definition values. + b2FixtureDef() + { + shape = NULL; + userData = NULL; + friction = 0.2f; + restitution = 0.0f; + density = 0.0f; + isSensor = false; + } + + /// The shape, this must be set. The shape will be cloned, so you + /// can create the shape on the stack. + const b2Shape* shape; + + /// Use this to store application specific fixture data. + void* userData; + + /// The friction coefficient, usually in the range [0,1]. + float32 friction; + + /// The restitution (elasticity) usually in the range [0,1]. + float32 restitution; + + /// The density, usually in kg/m^2. + float32 density; + + /// A sensor shape collects contact information but never generates a collision + /// response. + bool isSensor; + + /// Contact filtering data. + b2Filter filter; +}; + +/// This proxy is used internally to connect fixtures to the broad-phase. +struct b2FixtureProxy +{ + b2AABB aabb; + b2Fixture* fixture; + int32 childIndex; + int32 proxyId; +}; + +/// A fixture is used to attach a shape to a body for collision detection. A fixture +/// inherits its transform from its parent. Fixtures hold additional non-geometric data +/// such as friction, collision filters, etc. +/// Fixtures are created via b2Body::CreateFixture. +/// @warning you cannot reuse fixtures. +class b2Fixture +{ +public: + /// Get the type of the child shape. You can use this to down cast to the concrete shape. + /// @return the shape type. + b2Shape::Type GetType() const; + + /// Get the child shape. You can modify the child shape, however you should not change the + /// number of vertices because this will crash some collision caching mechanisms. + /// Manipulating the shape may lead to non-physical behavior. + b2Shape* GetShape(); + const b2Shape* GetShape() const; + + /// Set if this fixture is a sensor. + void SetSensor(bool sensor); + + /// Is this fixture a sensor (non-solid)? + /// @return the true if the shape is a sensor. + bool IsSensor() const; + + /// Set the contact filtering data. This will not update contacts until the next time + /// step when either parent body is active and awake. + /// This automatically calls Refilter. + void SetFilterData(const b2Filter& filter); + + /// Get the contact filtering data. + const b2Filter& GetFilterData() const; + + /// Call this if you want to establish collision that was previously disabled by b2ContactFilter::ShouldCollide. + void Refilter(); + + /// Get the parent body of this fixture. This is NULL if the fixture is not attached. + /// @return the parent body. + b2Body* GetBody(); + const b2Body* GetBody() const; + + /// Get the next fixture in the parent body's fixture list. + /// @return the next shape. + b2Fixture* GetNext(); + const b2Fixture* GetNext() const; + + /// Get the user data that was assigned in the fixture definition. Use this to + /// store your application specific data. + void* GetUserData() const; + + /// Set the user data. Use this to store your application specific data. + void SetUserData(void* data); + + /// Test a point for containment in this fixture. + /// @param p a point in world coordinates. + bool TestPoint(const b2Vec2& p) const; + + /// Cast a ray against this shape. + /// @param output the ray-cast results. + /// @param input the ray-cast input parameters. + bool RayCast(b2RayCastOutput* output, const b2RayCastInput& input, int32 childIndex) const; + + /// Get the mass data for this fixture. The mass data is based on the density and + /// the shape. The rotational inertia is about the shape's origin. This operation + /// may be expensive. + void GetMassData(b2MassData* massData) const; + + /// Set the density of this fixture. This will _not_ automatically adjust the mass + /// of the body. You must call b2Body::ResetMassData to update the body's mass. + void SetDensity(float32 density); + + /// Get the density of this fixture. + float32 GetDensity() const; + + /// Get the coefficient of friction. + float32 GetFriction() const; + + /// Set the coefficient of friction. This will _not_ change the friction of + /// existing contacts. + void SetFriction(float32 friction); + + /// Get the coefficient of restitution. + float32 GetRestitution() const; + + /// Set the coefficient of restitution. This will _not_ change the restitution of + /// existing contacts. + void SetRestitution(float32 restitution); + + /// Get the fixture's AABB. This AABB may be enlarge and/or stale. + /// If you need a more accurate AABB, compute it using the shape and + /// the body transform. + const b2AABB& GetAABB(int32 childIndex) const; + + /// Dump this fixture to the log file. + void Dump(int32 bodyIndex); + +protected: + + friend class b2Body; + friend class b2World; + friend class b2Contact; + friend class b2ContactManager; + + b2Fixture(); + + // We need separation create/destroy functions from the constructor/destructor because + // the destructor cannot access the allocator (no destructor arguments allowed by C++). + void Create(b2BlockAllocator* allocator, b2Body* body, const b2FixtureDef* def); + void Destroy(b2BlockAllocator* allocator); + + // These support body activation/deactivation. + void CreateProxies(b2BroadPhase* broadPhase, const b2Transform& xf); + void DestroyProxies(b2BroadPhase* broadPhase); + + void Synchronize(b2BroadPhase* broadPhase, const b2Transform& xf1, const b2Transform& xf2); + + float32 m_density; + + b2Fixture* m_next; + b2Body* m_body; + + b2Shape* m_shape; + + float32 m_friction; + float32 m_restitution; + + b2FixtureProxy* m_proxies; + int32 m_proxyCount; + + b2Filter m_filter; + + bool m_isSensor; + + void* m_userData; +}; + +inline b2Shape::Type b2Fixture::GetType() const +{ + return m_shape->GetType(); +} + +inline b2Shape* b2Fixture::GetShape() +{ + return m_shape; +} + +inline const b2Shape* b2Fixture::GetShape() const +{ + return m_shape; +} + +inline bool b2Fixture::IsSensor() const +{ + return m_isSensor; +} + +inline const b2Filter& b2Fixture::GetFilterData() const +{ + return m_filter; +} + +inline void* b2Fixture::GetUserData() const +{ + return m_userData; +} + +inline void b2Fixture::SetUserData(void* data) +{ + m_userData = data; +} + +inline b2Body* b2Fixture::GetBody() +{ + return m_body; +} + +inline const b2Body* b2Fixture::GetBody() const +{ + return m_body; +} + +inline b2Fixture* b2Fixture::GetNext() +{ + return m_next; +} + +inline const b2Fixture* b2Fixture::GetNext() const +{ + return m_next; +} + +inline void b2Fixture::SetDensity(float32 density) +{ + b2Assert(b2IsValid(density) && density >= 0.0f); + m_density = density; +} + +inline float32 b2Fixture::GetDensity() const +{ + return m_density; +} + +inline float32 b2Fixture::GetFriction() const +{ + return m_friction; +} + +inline void b2Fixture::SetFriction(float32 friction) +{ + m_friction = friction; +} + +inline float32 b2Fixture::GetRestitution() const +{ + return m_restitution; +} + +inline void b2Fixture::SetRestitution(float32 restitution) +{ + m_restitution = restitution; +} + +inline bool b2Fixture::TestPoint(const b2Vec2& p) const +{ + return m_shape->TestPoint(m_body->GetTransform(), p); +} + +inline bool b2Fixture::RayCast(b2RayCastOutput* output, const b2RayCastInput& input, int32 childIndex) const +{ + return m_shape->RayCast(output, input, m_body->GetTransform(), childIndex); +} + +inline void b2Fixture::GetMassData(b2MassData* massData) const +{ + m_shape->ComputeMass(massData, m_density); +} + +inline const b2AABB& b2Fixture::GetAABB(int32 childIndex) const +{ + b2Assert(0 <= childIndex && childIndex < m_proxyCount); + return m_proxies[childIndex].aabb; +} + +#endif diff --git a/external/Box2D/Dynamics/b2Island.cpp b/external/Box2D/Dynamics/b2Island.cpp new file mode 100644 index 0000000000..e767d383d5 --- /dev/null +++ b/external/Box2D/Dynamics/b2Island.cpp @@ -0,0 +1,539 @@ +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* +Position Correction Notes +========================= +I tried the several algorithms for position correction of the 2D revolute joint. +I looked at these systems: +- simple pendulum (1m diameter sphere on massless 5m stick) with initial angular velocity of 100 rad/s. +- suspension bridge with 30 1m long planks of length 1m. +- multi-link chain with 30 1m long links. + +Here are the algorithms: + +Baumgarte - A fraction of the position error is added to the velocity error. There is no +separate position solver. + +Pseudo Velocities - After the velocity solver and position integration, +the position error, Jacobian, and effective mass are recomputed. Then +the velocity constraints are solved with pseudo velocities and a fraction +of the position error is added to the pseudo velocity error. The pseudo +velocities are initialized to zero and there is no warm-starting. After +the position solver, the pseudo velocities are added to the positions. +This is also called the First Order World method or the Position LCP method. + +Modified Nonlinear Gauss-Seidel (NGS) - Like Pseudo Velocities except the +position error is re-computed for each constraint and the positions are updated +after the constraint is solved. The radius vectors (aka Jacobians) are +re-computed too (otherwise the algorithm has horrible instability). The pseudo +velocity states are not needed because they are effectively zero at the beginning +of each iteration. Since we have the current position error, we allow the +iterations to terminate early if the error becomes smaller than b2_linearSlop. + +Full NGS or just NGS - Like Modified NGS except the effective mass are re-computed +each time a constraint is solved. + +Here are the results: +Baumgarte - this is the cheapest algorithm but it has some stability problems, +especially with the bridge. The chain links separate easily close to the root +and they jitter as they struggle to pull together. This is one of the most common +methods in the field. The big drawback is that the position correction artificially +affects the momentum, thus leading to instabilities and false bounce. I used a +bias factor of 0.2. A larger bias factor makes the bridge less stable, a smaller +factor makes joints and contacts more spongy. + +Pseudo Velocities - the is more stable than the Baumgarte method. The bridge is +stable. However, joints still separate with large angular velocities. Drag the +simple pendulum in a circle quickly and the joint will separate. The chain separates +easily and does not recover. I used a bias factor of 0.2. A larger value lead to +the bridge collapsing when a heavy cube drops on it. + +Modified NGS - this algorithm is better in some ways than Baumgarte and Pseudo +Velocities, but in other ways it is worse. The bridge and chain are much more +stable, but the simple pendulum goes unstable at high angular velocities. + +Full NGS - stable in all tests. The joints display good stiffness. The bridge +still sags, but this is better than infinite forces. + +Recommendations +Pseudo Velocities are not really worthwhile because the bridge and chain cannot +recover from joint separation. In other cases the benefit over Baumgarte is small. + +Modified NGS is not a robust method for the revolute joint due to the violent +instability seen in the simple pendulum. Perhaps it is viable with other constraint +types, especially scalar constraints where the effective mass is a scalar. + +This leaves Baumgarte and Full NGS. Baumgarte has small, but manageable instabilities +and is very fast. I don't think we can escape Baumgarte, especially in highly +demanding cases where high constraint fidelity is not needed. + +Full NGS is robust and easy on the eyes. I recommend this as an option for +higher fidelity simulation and certainly for suspension bridges and long chains. +Full NGS might be a good choice for ragdolls, especially motorized ragdolls where +joint separation can be problematic. The number of NGS iterations can be reduced +for better performance without harming robustness much. + +Each joint in a can be handled differently in the position solver. So I recommend +a system where the user can select the algorithm on a per joint basis. I would +probably default to the slower Full NGS and let the user select the faster +Baumgarte method in performance critical scenarios. +*/ + +/* +Cache Performance + +The Box2D solvers are dominated by cache misses. Data structures are designed +to increase the number of cache hits. Much of misses are due to random access +to body data. The constraint structures are iterated over linearly, which leads +to few cache misses. + +The bodies are not accessed during iteration. Instead read only data, such as +the mass values are stored with the constraints. The mutable data are the constraint +impulses and the bodies velocities/positions. The impulses are held inside the +constraint structures. The body velocities/positions are held in compact, temporary +arrays to increase the number of cache hits. Linear and angular velocity are +stored in a single array since multiple arrays lead to multiple misses. +*/ + +/* +2D Rotation + +R = [cos(theta) -sin(theta)] + [sin(theta) cos(theta) ] + +thetaDot = omega + +Let q1 = cos(theta), q2 = sin(theta). +R = [q1 -q2] + [q2 q1] + +q1Dot = -thetaDot * q2 +q2Dot = thetaDot * q1 + +q1_new = q1_old - dt * w * q2 +q2_new = q2_old + dt * w * q1 +then normalize. + +This might be faster than computing sin+cos. +However, we can compute sin+cos of the same angle fast. +*/ + +b2Island::b2Island( + int32 bodyCapacity, + int32 contactCapacity, + int32 jointCapacity, + b2StackAllocator* allocator, + b2ContactListener* listener) +{ + m_bodyCapacity = bodyCapacity; + m_contactCapacity = contactCapacity; + m_jointCapacity = jointCapacity; + m_bodyCount = 0; + m_contactCount = 0; + m_jointCount = 0; + + m_allocator = allocator; + m_listener = listener; + + m_bodies = (b2Body**)m_allocator->Allocate(bodyCapacity * sizeof(b2Body*)); + m_contacts = (b2Contact**)m_allocator->Allocate(contactCapacity * sizeof(b2Contact*)); + m_joints = (b2Joint**)m_allocator->Allocate(jointCapacity * sizeof(b2Joint*)); + + m_velocities = (b2Velocity*)m_allocator->Allocate(m_bodyCapacity * sizeof(b2Velocity)); + m_positions = (b2Position*)m_allocator->Allocate(m_bodyCapacity * sizeof(b2Position)); +} + +b2Island::~b2Island() +{ + // Warning: the order should reverse the constructor order. + m_allocator->Free(m_positions); + m_allocator->Free(m_velocities); + m_allocator->Free(m_joints); + m_allocator->Free(m_contacts); + m_allocator->Free(m_bodies); +} + +void b2Island::Solve(b2Profile* profile, const b2TimeStep& step, const b2Vec2& gravity, bool allowSleep) +{ + b2Timer timer; + + float32 h = step.dt; + + // Integrate velocities and apply damping. Initialize the body state. + for (int32 i = 0; i < m_bodyCount; ++i) + { + b2Body* b = m_bodies[i]; + + b2Vec2 c = b->m_sweep.c; + float32 a = b->m_sweep.a; + b2Vec2 v = b->m_linearVelocity; + float32 w = b->m_angularVelocity; + + // Store positions for continuous collision. + b->m_sweep.c0 = b->m_sweep.c; + b->m_sweep.a0 = b->m_sweep.a; + + if (b->m_type == b2_dynamicBody) + { + // Integrate velocities. + v += h * (b->m_gravityScale * gravity + b->m_invMass * b->m_force); + w += h * b->m_invI * b->m_torque; + + // Apply damping. + // ODE: dv/dt + c * v = 0 + // Solution: v(t) = v0 * exp(-c * t) + // Time step: v(t + dt) = v0 * exp(-c * (t + dt)) = v0 * exp(-c * t) * exp(-c * dt) = v * exp(-c * dt) + // v2 = exp(-c * dt) * v1 + // Taylor expansion: + // v2 = (1.0f - c * dt) * v1 + v *= b2Clamp(1.0f - h * b->m_linearDamping, 0.0f, 1.0f); + w *= b2Clamp(1.0f - h * b->m_angularDamping, 0.0f, 1.0f); + } + + m_positions[i].c = c; + m_positions[i].a = a; + m_velocities[i].v = v; + m_velocities[i].w = w; + } + + timer.Reset(); + + // Solver data + b2SolverData solverData; + solverData.step = step; + solverData.positions = m_positions; + solverData.velocities = m_velocities; + + // Initialize velocity constraints. + b2ContactSolverDef contactSolverDef; + contactSolverDef.step = step; + contactSolverDef.contacts = m_contacts; + contactSolverDef.count = m_contactCount; + contactSolverDef.positions = m_positions; + contactSolverDef.velocities = m_velocities; + contactSolverDef.allocator = m_allocator; + + b2ContactSolver contactSolver(&contactSolverDef); + contactSolver.InitializeVelocityConstraints(); + + if (step.warmStarting) + { + contactSolver.WarmStart(); + } + + for (int32 i = 0; i < m_jointCount; ++i) + { + m_joints[i]->InitVelocityConstraints(solverData); + } + + profile->solveInit = timer.GetMilliseconds(); + + // Solve velocity constraints + timer.Reset(); + for (int32 i = 0; i < step.velocityIterations; ++i) + { + for (int32 j = 0; j < m_jointCount; ++j) + { + m_joints[j]->SolveVelocityConstraints(solverData); + } + + contactSolver.SolveVelocityConstraints(); + } + + // Store impulses for warm starting + contactSolver.StoreImpulses(); + profile->solveVelocity = timer.GetMilliseconds(); + + // Integrate positions + for (int32 i = 0; i < m_bodyCount; ++i) + { + b2Vec2 c = m_positions[i].c; + float32 a = m_positions[i].a; + b2Vec2 v = m_velocities[i].v; + float32 w = m_velocities[i].w; + + // Check for large velocities + b2Vec2 translation = h * v; + if (b2Dot(translation, translation) > b2_maxTranslationSquared) + { + float32 ratio = b2_maxTranslation / translation.Length(); + v *= ratio; + } + + float32 rotation = h * w; + if (rotation * rotation > b2_maxRotationSquared) + { + float32 ratio = b2_maxRotation / b2Abs(rotation); + w *= ratio; + } + + // Integrate + c += h * v; + a += h * w; + + m_positions[i].c = c; + m_positions[i].a = a; + m_velocities[i].v = v; + m_velocities[i].w = w; + } + + // Solve position constraints + timer.Reset(); + bool positionSolved = false; + for (int32 i = 0; i < step.positionIterations; ++i) + { + bool contactsOkay = contactSolver.SolvePositionConstraints(); + + bool jointsOkay = true; + for (int32 i = 0; i < m_jointCount; ++i) + { + bool jointOkay = m_joints[i]->SolvePositionConstraints(solverData); + jointsOkay = jointsOkay && jointOkay; + } + + if (contactsOkay && jointsOkay) + { + // Exit early if the position errors are small. + positionSolved = true; + break; + } + } + + // Copy state buffers back to the bodies + for (int32 i = 0; i < m_bodyCount; ++i) + { + b2Body* body = m_bodies[i]; + body->m_sweep.c = m_positions[i].c; + body->m_sweep.a = m_positions[i].a; + body->m_linearVelocity = m_velocities[i].v; + body->m_angularVelocity = m_velocities[i].w; + body->SynchronizeTransform(); + } + + profile->solvePosition = timer.GetMilliseconds(); + + Report(contactSolver.m_velocityConstraints); + + if (allowSleep) + { + float32 minSleepTime = b2_maxFloat; + + const float32 linTolSqr = b2_linearSleepTolerance * b2_linearSleepTolerance; + const float32 angTolSqr = b2_angularSleepTolerance * b2_angularSleepTolerance; + + for (int32 i = 0; i < m_bodyCount; ++i) + { + b2Body* b = m_bodies[i]; + if (b->GetType() == b2_staticBody) + { + continue; + } + + if ((b->m_flags & b2Body::e_autoSleepFlag) == 0 || + b->m_angularVelocity * b->m_angularVelocity > angTolSqr || + b2Dot(b->m_linearVelocity, b->m_linearVelocity) > linTolSqr) + { + b->m_sleepTime = 0.0f; + minSleepTime = 0.0f; + } + else + { + b->m_sleepTime += h; + minSleepTime = b2Min(minSleepTime, b->m_sleepTime); + } + } + + if (minSleepTime >= b2_timeToSleep && positionSolved) + { + for (int32 i = 0; i < m_bodyCount; ++i) + { + b2Body* b = m_bodies[i]; + b->SetAwake(false); + } + } + } +} + +void b2Island::SolveTOI(const b2TimeStep& subStep, int32 toiIndexA, int32 toiIndexB) +{ + b2Assert(toiIndexA < m_bodyCount); + b2Assert(toiIndexB < m_bodyCount); + + // Initialize the body state. + for (int32 i = 0; i < m_bodyCount; ++i) + { + b2Body* b = m_bodies[i]; + m_positions[i].c = b->m_sweep.c; + m_positions[i].a = b->m_sweep.a; + m_velocities[i].v = b->m_linearVelocity; + m_velocities[i].w = b->m_angularVelocity; + } + + b2ContactSolverDef contactSolverDef; + contactSolverDef.contacts = m_contacts; + contactSolverDef.count = m_contactCount; + contactSolverDef.allocator = m_allocator; + contactSolverDef.step = subStep; + contactSolverDef.positions = m_positions; + contactSolverDef.velocities = m_velocities; + b2ContactSolver contactSolver(&contactSolverDef); + + // Solve position constraints. + for (int32 i = 0; i < subStep.positionIterations; ++i) + { + bool contactsOkay = contactSolver.SolveTOIPositionConstraints(toiIndexA, toiIndexB); + if (contactsOkay) + { + break; + } + } + +#if 0 + // Is the new position really safe? + for (int32 i = 0; i < m_contactCount; ++i) + { + b2Contact* c = m_contacts[i]; + b2Fixture* fA = c->GetFixtureA(); + b2Fixture* fB = c->GetFixtureB(); + + b2Body* bA = fA->GetBody(); + b2Body* bB = fB->GetBody(); + + int32 indexA = c->GetChildIndexA(); + int32 indexB = c->GetChildIndexB(); + + b2DistanceInput input; + input.proxyA.Set(fA->GetShape(), indexA); + input.proxyB.Set(fB->GetShape(), indexB); + input.transformA = bA->GetTransform(); + input.transformB = bB->GetTransform(); + input.useRadii = false; + + b2DistanceOutput output; + b2SimplexCache cache; + cache.count = 0; + b2Distance(&output, &cache, &input); + + if (output.distance == 0 || cache.count == 3) + { + cache.count += 0; + } + } +#endif + + // Leap of faith to new safe state. + m_bodies[toiIndexA]->m_sweep.c0 = m_positions[toiIndexA].c; + m_bodies[toiIndexA]->m_sweep.a0 = m_positions[toiIndexA].a; + m_bodies[toiIndexB]->m_sweep.c0 = m_positions[toiIndexB].c; + m_bodies[toiIndexB]->m_sweep.a0 = m_positions[toiIndexB].a; + + // No warm starting is needed for TOI events because warm + // starting impulses were applied in the discrete solver. + contactSolver.InitializeVelocityConstraints(); + + // Solve velocity constraints. + for (int32 i = 0; i < subStep.velocityIterations; ++i) + { + contactSolver.SolveVelocityConstraints(); + } + + // Don't store the TOI contact forces for warm starting + // because they can be quite large. + + float32 h = subStep.dt; + + // Integrate positions + for (int32 i = 0; i < m_bodyCount; ++i) + { + b2Vec2 c = m_positions[i].c; + float32 a = m_positions[i].a; + b2Vec2 v = m_velocities[i].v; + float32 w = m_velocities[i].w; + + // Check for large velocities + b2Vec2 translation = h * v; + if (b2Dot(translation, translation) > b2_maxTranslationSquared) + { + float32 ratio = b2_maxTranslation / translation.Length(); + v *= ratio; + } + + float32 rotation = h * w; + if (rotation * rotation > b2_maxRotationSquared) + { + float32 ratio = b2_maxRotation / b2Abs(rotation); + w *= ratio; + } + + // Integrate + c += h * v; + a += h * w; + + m_positions[i].c = c; + m_positions[i].a = a; + m_velocities[i].v = v; + m_velocities[i].w = w; + + // Sync bodies + b2Body* body = m_bodies[i]; + body->m_sweep.c = c; + body->m_sweep.a = a; + body->m_linearVelocity = v; + body->m_angularVelocity = w; + body->SynchronizeTransform(); + } + + Report(contactSolver.m_velocityConstraints); +} + +void b2Island::Report(const b2ContactVelocityConstraint* constraints) +{ + if (m_listener == NULL) + { + return; + } + + for (int32 i = 0; i < m_contactCount; ++i) + { + b2Contact* c = m_contacts[i]; + + const b2ContactVelocityConstraint* vc = constraints + i; + + b2ContactImpulse impulse; + impulse.count = vc->pointCount; + for (int32 j = 0; j < vc->pointCount; ++j) + { + impulse.normalImpulses[j] = vc->points[j].normalImpulse; + impulse.tangentImpulses[j] = vc->points[j].tangentImpulse; + } + + m_listener->PostSolve(c, &impulse); + } +} diff --git a/external/Box2D/Dynamics/b2Island.h b/external/Box2D/Dynamics/b2Island.h new file mode 100644 index 0000000000..e0a6e41fc3 --- /dev/null +++ b/external/Box2D/Dynamics/b2Island.h @@ -0,0 +1,93 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_ISLAND_H +#define B2_ISLAND_H + +#include +#include +#include + +class b2Contact; +class b2Joint; +class b2StackAllocator; +class b2ContactListener; +struct b2ContactVelocityConstraint; +struct b2Profile; + +/// This is an internal class. +class b2Island +{ +public: + b2Island(int32 bodyCapacity, int32 contactCapacity, int32 jointCapacity, + b2StackAllocator* allocator, b2ContactListener* listener); + ~b2Island(); + + void Clear() + { + m_bodyCount = 0; + m_contactCount = 0; + m_jointCount = 0; + } + + void Solve(b2Profile* profile, const b2TimeStep& step, const b2Vec2& gravity, bool allowSleep); + + void SolveTOI(const b2TimeStep& subStep, int32 toiIndexA, int32 toiIndexB); + + void Add(b2Body* body) + { + b2Assert(m_bodyCount < m_bodyCapacity); + body->m_islandIndex = m_bodyCount; + m_bodies[m_bodyCount] = body; + ++m_bodyCount; + } + + void Add(b2Contact* contact) + { + b2Assert(m_contactCount < m_contactCapacity); + m_contacts[m_contactCount++] = contact; + } + + void Add(b2Joint* joint) + { + b2Assert(m_jointCount < m_jointCapacity); + m_joints[m_jointCount++] = joint; + } + + void Report(const b2ContactVelocityConstraint* constraints); + + b2StackAllocator* m_allocator; + b2ContactListener* m_listener; + + b2Body** m_bodies; + b2Contact** m_contacts; + b2Joint** m_joints; + + b2Position* m_positions; + b2Velocity* m_velocities; + + int32 m_bodyCount; + int32 m_jointCount; + int32 m_contactCount; + + int32 m_bodyCapacity; + int32 m_contactCapacity; + int32 m_jointCapacity; +}; + +#endif diff --git a/external/Box2D/Dynamics/b2TimeStep.h b/external/Box2D/Dynamics/b2TimeStep.h new file mode 100644 index 0000000000..30d723fcc3 --- /dev/null +++ b/external/Box2D/Dynamics/b2TimeStep.h @@ -0,0 +1,70 @@ +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_TIME_STEP_H +#define B2_TIME_STEP_H + +#include + +/// Profiling data. Times are in milliseconds. +struct b2Profile +{ + float32 step; + float32 collide; + float32 solve; + float32 solveInit; + float32 solveVelocity; + float32 solvePosition; + float32 broadphase; + float32 solveTOI; +}; + +/// This is an internal structure. +struct b2TimeStep +{ + float32 dt; // time step + float32 inv_dt; // inverse time step (0 if dt == 0). + float32 dtRatio; // dt * inv_dt0 + int32 velocityIterations; + int32 positionIterations; + bool warmStarting; +}; + +/// This is an internal structure. +struct b2Position +{ + b2Vec2 c; + float32 a; +}; + +/// This is an internal structure. +struct b2Velocity +{ + b2Vec2 v; + float32 w; +}; + +/// Solver Data +struct b2SolverData +{ + b2TimeStep step; + b2Position* positions; + b2Velocity* velocities; +}; + +#endif diff --git a/external/Box2D/Dynamics/b2World.cpp b/external/Box2D/Dynamics/b2World.cpp new file mode 100644 index 0000000000..8a0aff5114 --- /dev/null +++ b/external/Box2D/Dynamics/b2World.cpp @@ -0,0 +1,1316 @@ +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +b2World::b2World(const b2Vec2& gravity) +{ + m_destructionListener = NULL; + m_debugDraw = NULL; + + m_bodyList = NULL; + m_jointList = NULL; + + m_bodyCount = 0; + m_jointCount = 0; + + m_warmStarting = true; + m_continuousPhysics = true; + m_subStepping = false; + + m_stepComplete = true; + + m_allowSleep = true; + m_gravity = gravity; + + m_flags = e_clearForces; + + m_inv_dt0 = 0.0f; + + m_contactManager.m_allocator = &m_blockAllocator; + + memset(&m_profile, 0, sizeof(b2Profile)); +} + +b2World::~b2World() +{ + // Some shapes allocate using b2Alloc. + b2Body* b = m_bodyList; + while (b) + { + b2Body* bNext = b->m_next; + + b2Fixture* f = b->m_fixtureList; + while (f) + { + b2Fixture* fNext = f->m_next; + f->m_proxyCount = 0; + f->Destroy(&m_blockAllocator); + f = fNext; + } + + b = bNext; + } +} + +void b2World::SetDestructionListener(b2DestructionListener* listener) +{ + m_destructionListener = listener; +} + +void b2World::SetContactFilter(b2ContactFilter* filter) +{ + m_contactManager.m_contactFilter = filter; +} + +void b2World::SetContactListener(b2ContactListener* listener) +{ + m_contactManager.m_contactListener = listener; +} + +void b2World::SetDebugDraw(b2Draw* debugDraw) +{ + m_debugDraw = debugDraw; +} + +b2Body* b2World::CreateBody(const b2BodyDef* def) +{ + b2Assert(IsLocked() == false); + if (IsLocked()) + { + return NULL; + } + + void* mem = m_blockAllocator.Allocate(sizeof(b2Body)); + b2Body* b = new (mem) b2Body(def, this); + + // Add to world doubly linked list. + b->m_prev = NULL; + b->m_next = m_bodyList; + if (m_bodyList) + { + m_bodyList->m_prev = b; + } + m_bodyList = b; + ++m_bodyCount; + + return b; +} + +void b2World::DestroyBody(b2Body* b) +{ + b2Assert(m_bodyCount > 0); + b2Assert(IsLocked() == false); + if (IsLocked()) + { + return; + } + + // Delete the attached joints. + b2JointEdge* je = b->m_jointList; + while (je) + { + b2JointEdge* je0 = je; + je = je->next; + + if (m_destructionListener) + { + m_destructionListener->SayGoodbye(je0->joint); + } + + DestroyJoint(je0->joint); + + b->m_jointList = je; + } + b->m_jointList = NULL; + + // Delete the attached contacts. + b2ContactEdge* ce = b->m_contactList; + while (ce) + { + b2ContactEdge* ce0 = ce; + ce = ce->next; + m_contactManager.Destroy(ce0->contact); + } + b->m_contactList = NULL; + + // Delete the attached fixtures. This destroys broad-phase proxies. + b2Fixture* f = b->m_fixtureList; + while (f) + { + b2Fixture* f0 = f; + f = f->m_next; + + if (m_destructionListener) + { + m_destructionListener->SayGoodbye(f0); + } + + f0->DestroyProxies(&m_contactManager.m_broadPhase); + f0->Destroy(&m_blockAllocator); + f0->~b2Fixture(); + m_blockAllocator.Free(f0, sizeof(b2Fixture)); + + b->m_fixtureList = f; + b->m_fixtureCount -= 1; + } + b->m_fixtureList = NULL; + b->m_fixtureCount = 0; + + // Remove world body list. + if (b->m_prev) + { + b->m_prev->m_next = b->m_next; + } + + if (b->m_next) + { + b->m_next->m_prev = b->m_prev; + } + + if (b == m_bodyList) + { + m_bodyList = b->m_next; + } + + --m_bodyCount; + b->~b2Body(); + m_blockAllocator.Free(b, sizeof(b2Body)); +} + +b2Joint* b2World::CreateJoint(const b2JointDef* def) +{ + b2Assert(IsLocked() == false); + if (IsLocked()) + { + return NULL; + } + + b2Joint* j = b2Joint::Create(def, &m_blockAllocator); + + // Connect to the world list. + j->m_prev = NULL; + j->m_next = m_jointList; + if (m_jointList) + { + m_jointList->m_prev = j; + } + m_jointList = j; + ++m_jointCount; + + // Connect to the bodies' doubly linked lists. + j->m_edgeA.joint = j; + j->m_edgeA.other = j->m_bodyB; + j->m_edgeA.prev = NULL; + j->m_edgeA.next = j->m_bodyA->m_jointList; + if (j->m_bodyA->m_jointList) j->m_bodyA->m_jointList->prev = &j->m_edgeA; + j->m_bodyA->m_jointList = &j->m_edgeA; + + j->m_edgeB.joint = j; + j->m_edgeB.other = j->m_bodyA; + j->m_edgeB.prev = NULL; + j->m_edgeB.next = j->m_bodyB->m_jointList; + if (j->m_bodyB->m_jointList) j->m_bodyB->m_jointList->prev = &j->m_edgeB; + j->m_bodyB->m_jointList = &j->m_edgeB; + + b2Body* bodyA = def->bodyA; + b2Body* bodyB = def->bodyB; + + // If the joint prevents collisions, then flag any contacts for filtering. + if (def->collideConnected == false) + { + b2ContactEdge* edge = bodyB->GetContactList(); + while (edge) + { + if (edge->other == bodyA) + { + // Flag the contact for filtering at the next time step (where either + // body is awake). + edge->contact->FlagForFiltering(); + } + + edge = edge->next; + } + } + + // Note: creating a joint doesn't wake the bodies. + + return j; +} + +void b2World::DestroyJoint(b2Joint* j) +{ + b2Assert(IsLocked() == false); + if (IsLocked()) + { + return; + } + + bool collideConnected = j->m_collideConnected; + + // Remove from the doubly linked list. + if (j->m_prev) + { + j->m_prev->m_next = j->m_next; + } + + if (j->m_next) + { + j->m_next->m_prev = j->m_prev; + } + + if (j == m_jointList) + { + m_jointList = j->m_next; + } + + // Disconnect from island graph. + b2Body* bodyA = j->m_bodyA; + b2Body* bodyB = j->m_bodyB; + + // Wake up connected bodies. + bodyA->SetAwake(true); + bodyB->SetAwake(true); + + // Remove from body 1. + if (j->m_edgeA.prev) + { + j->m_edgeA.prev->next = j->m_edgeA.next; + } + + if (j->m_edgeA.next) + { + j->m_edgeA.next->prev = j->m_edgeA.prev; + } + + if (&j->m_edgeA == bodyA->m_jointList) + { + bodyA->m_jointList = j->m_edgeA.next; + } + + j->m_edgeA.prev = NULL; + j->m_edgeA.next = NULL; + + // Remove from body 2 + if (j->m_edgeB.prev) + { + j->m_edgeB.prev->next = j->m_edgeB.next; + } + + if (j->m_edgeB.next) + { + j->m_edgeB.next->prev = j->m_edgeB.prev; + } + + if (&j->m_edgeB == bodyB->m_jointList) + { + bodyB->m_jointList = j->m_edgeB.next; + } + + j->m_edgeB.prev = NULL; + j->m_edgeB.next = NULL; + + b2Joint::Destroy(j, &m_blockAllocator); + + b2Assert(m_jointCount > 0); + --m_jointCount; + + // If the joint prevents collisions, then flag any contacts for filtering. + if (collideConnected == false) + { + b2ContactEdge* edge = bodyB->GetContactList(); + while (edge) + { + if (edge->other == bodyA) + { + // Flag the contact for filtering at the next time step (where either + // body is awake). + edge->contact->FlagForFiltering(); + } + + edge = edge->next; + } + } +} + +// +void b2World::SetAllowSleeping(bool flag) +{ + if (flag == m_allowSleep) + { + return; + } + + m_allowSleep = flag; + if (m_allowSleep == false) + { + for (b2Body* b = m_bodyList; b; b = b->m_next) + { + b->SetAwake(true); + } + } +} + +// Find islands, integrate and solve constraints, solve position constraints +void b2World::Solve(const b2TimeStep& step) +{ + m_profile.solveInit = 0.0f; + m_profile.solveVelocity = 0.0f; + m_profile.solvePosition = 0.0f; + + // Size the island for the worst case. + b2Island island(m_bodyCount, + m_contactManager.m_contactCount, + m_jointCount, + &m_stackAllocator, + m_contactManager.m_contactListener); + + // Clear all the island flags. + for (b2Body* b = m_bodyList; b; b = b->m_next) + { + b->m_flags &= ~b2Body::e_islandFlag; + } + for (b2Contact* c = m_contactManager.m_contactList; c; c = c->m_next) + { + c->m_flags &= ~b2Contact::e_islandFlag; + } + for (b2Joint* j = m_jointList; j; j = j->m_next) + { + j->m_islandFlag = false; + } + + // Build and simulate all awake islands. + int32 stackSize = m_bodyCount; + b2Body** stack = (b2Body**)m_stackAllocator.Allocate(stackSize * sizeof(b2Body*)); + for (b2Body* seed = m_bodyList; seed; seed = seed->m_next) + { + if (seed->m_flags & b2Body::e_islandFlag) + { + continue; + } + + if (seed->IsAwake() == false || seed->IsActive() == false) + { + continue; + } + + // The seed can be dynamic or kinematic. + if (seed->GetType() == b2_staticBody) + { + continue; + } + + // Reset island and stack. + island.Clear(); + int32 stackCount = 0; + stack[stackCount++] = seed; + seed->m_flags |= b2Body::e_islandFlag; + + // Perform a depth first search (DFS) on the constraint graph. + while (stackCount > 0) + { + // Grab the next body off the stack and add it to the island. + b2Body* b = stack[--stackCount]; + b2Assert(b->IsActive() == true); + island.Add(b); + + // Make sure the body is awake. + b->SetAwake(true); + + // To keep islands as small as possible, we don't + // propagate islands across static bodies. + if (b->GetType() == b2_staticBody) + { + continue; + } + + // Search all contacts connected to this body. + for (b2ContactEdge* ce = b->m_contactList; ce; ce = ce->next) + { + b2Contact* contact = ce->contact; + + // Has this contact already been added to an island? + if (contact->m_flags & b2Contact::e_islandFlag) + { + continue; + } + + // Is this contact solid and touching? + if (contact->IsEnabled() == false || + contact->IsTouching() == false) + { + continue; + } + + // Skip sensors. + bool sensorA = contact->m_fixtureA->m_isSensor; + bool sensorB = contact->m_fixtureB->m_isSensor; + if (sensorA || sensorB) + { + continue; + } + + island.Add(contact); + contact->m_flags |= b2Contact::e_islandFlag; + + b2Body* other = ce->other; + + // Was the other body already added to this island? + if (other->m_flags & b2Body::e_islandFlag) + { + continue; + } + + b2Assert(stackCount < stackSize); + stack[stackCount++] = other; + other->m_flags |= b2Body::e_islandFlag; + } + + // Search all joints connect to this body. + for (b2JointEdge* je = b->m_jointList; je; je = je->next) + { + if (je->joint->m_islandFlag == true) + { + continue; + } + + b2Body* other = je->other; + + // Don't simulate joints connected to inactive bodies. + if (other->IsActive() == false) + { + continue; + } + + island.Add(je->joint); + je->joint->m_islandFlag = true; + + if (other->m_flags & b2Body::e_islandFlag) + { + continue; + } + + b2Assert(stackCount < stackSize); + stack[stackCount++] = other; + other->m_flags |= b2Body::e_islandFlag; + } + } + + b2Profile profile; + island.Solve(&profile, step, m_gravity, m_allowSleep); + m_profile.solveInit += profile.solveInit; + m_profile.solveVelocity += profile.solveVelocity; + m_profile.solvePosition += profile.solvePosition; + + // Post solve cleanup. + for (int32 i = 0; i < island.m_bodyCount; ++i) + { + // Allow static bodies to participate in other islands. + b2Body* b = island.m_bodies[i]; + if (b->GetType() == b2_staticBody) + { + b->m_flags &= ~b2Body::e_islandFlag; + } + } + } + + m_stackAllocator.Free(stack); + + { + b2Timer timer; + // Synchronize fixtures, check for out of range bodies. + for (b2Body* b = m_bodyList; b; b = b->GetNext()) + { + // If a body was not in an island then it did not move. + if ((b->m_flags & b2Body::e_islandFlag) == 0) + { + continue; + } + + if (b->GetType() == b2_staticBody) + { + continue; + } + + // Update fixtures (for broad-phase). + b->SynchronizeFixtures(); + } + + // Look for new contacts. + m_contactManager.FindNewContacts(); + m_profile.broadphase = timer.GetMilliseconds(); + } +} + +// Find TOI contacts and solve them. +void b2World::SolveTOI(const b2TimeStep& step) +{ + b2Island island(2 * b2_maxTOIContacts, b2_maxTOIContacts, 0, &m_stackAllocator, m_contactManager.m_contactListener); + + if (m_stepComplete) + { + for (b2Body* b = m_bodyList; b; b = b->m_next) + { + b->m_flags &= ~b2Body::e_islandFlag; + b->m_sweep.alpha0 = 0.0f; + } + + for (b2Contact* c = m_contactManager.m_contactList; c; c = c->m_next) + { + // Invalidate TOI + c->m_flags &= ~(b2Contact::e_toiFlag | b2Contact::e_islandFlag); + c->m_toiCount = 0; + c->m_toi = 1.0f; + } + } + + // Find TOI events and solve them. + for (;;) + { + // Find the first TOI. + b2Contact* minContact = NULL; + float32 minAlpha = 1.0f; + + for (b2Contact* c = m_contactManager.m_contactList; c; c = c->m_next) + { + // Is this contact disabled? + if (c->IsEnabled() == false) + { + continue; + } + + // Prevent excessive sub-stepping. + if (c->m_toiCount > b2_maxSubSteps) + { + continue; + } + + float32 alpha = 1.0f; + if (c->m_flags & b2Contact::e_toiFlag) + { + // This contact has a valid cached TOI. + alpha = c->m_toi; + } + else + { + b2Fixture* fA = c->GetFixtureA(); + b2Fixture* fB = c->GetFixtureB(); + + // Is there a sensor? + if (fA->IsSensor() || fB->IsSensor()) + { + continue; + } + + b2Body* bA = fA->GetBody(); + b2Body* bB = fB->GetBody(); + + b2BodyType typeA = bA->m_type; + b2BodyType typeB = bB->m_type; + b2Assert(typeA == b2_dynamicBody || typeB == b2_dynamicBody); + + bool activeA = bA->IsAwake() && typeA != b2_staticBody; + bool activeB = bB->IsAwake() && typeB != b2_staticBody; + + // Is at least one body active (awake and dynamic or kinematic)? + if (activeA == false && activeB == false) + { + continue; + } + + bool collideA = bA->IsBullet() || typeA != b2_dynamicBody; + bool collideB = bB->IsBullet() || typeB != b2_dynamicBody; + + // Are these two non-bullet dynamic bodies? + if (collideA == false && collideB == false) + { + continue; + } + + // Compute the TOI for this contact. + // Put the sweeps onto the same time interval. + float32 alpha0 = bA->m_sweep.alpha0; + + if (bA->m_sweep.alpha0 < bB->m_sweep.alpha0) + { + alpha0 = bB->m_sweep.alpha0; + bA->m_sweep.Advance(alpha0); + } + else if (bB->m_sweep.alpha0 < bA->m_sweep.alpha0) + { + alpha0 = bA->m_sweep.alpha0; + bB->m_sweep.Advance(alpha0); + } + + b2Assert(alpha0 < 1.0f); + + int32 indexA = c->GetChildIndexA(); + int32 indexB = c->GetChildIndexB(); + + // Compute the time of impact in interval [0, minTOI] + b2TOIInput input; + input.proxyA.Set(fA->GetShape(), indexA); + input.proxyB.Set(fB->GetShape(), indexB); + input.sweepA = bA->m_sweep; + input.sweepB = bB->m_sweep; + input.tMax = 1.0f; + + b2TOIOutput output; + b2TimeOfImpact(&output, &input); + + // Beta is the fraction of the remaining portion of the . + float32 beta = output.t; + if (output.state == b2TOIOutput::e_touching) + { + alpha = b2Min(alpha0 + (1.0f - alpha0) * beta, 1.0f); + } + else + { + alpha = 1.0f; + } + + c->m_toi = alpha; + c->m_flags |= b2Contact::e_toiFlag; + } + + if (alpha < minAlpha) + { + // This is the minimum TOI found so far. + minContact = c; + minAlpha = alpha; + } + } + + if (minContact == NULL || 1.0f - 10.0f * b2_epsilon < minAlpha) + { + // No more TOI events. Done! + m_stepComplete = true; + break; + } + + // Advance the bodies to the TOI. + b2Fixture* fA = minContact->GetFixtureA(); + b2Fixture* fB = minContact->GetFixtureB(); + b2Body* bA = fA->GetBody(); + b2Body* bB = fB->GetBody(); + + b2Sweep backup1 = bA->m_sweep; + b2Sweep backup2 = bB->m_sweep; + + bA->Advance(minAlpha); + bB->Advance(minAlpha); + + // The TOI contact likely has some new contact points. + minContact->Update(m_contactManager.m_contactListener); + minContact->m_flags &= ~b2Contact::e_toiFlag; + ++minContact->m_toiCount; + + // Is the contact solid? + if (minContact->IsEnabled() == false || minContact->IsTouching() == false) + { + // Restore the sweeps. + minContact->SetEnabled(false); + bA->m_sweep = backup1; + bB->m_sweep = backup2; + bA->SynchronizeTransform(); + bB->SynchronizeTransform(); + continue; + } + + bA->SetAwake(true); + bB->SetAwake(true); + + // Build the island + island.Clear(); + island.Add(bA); + island.Add(bB); + island.Add(minContact); + + bA->m_flags |= b2Body::e_islandFlag; + bB->m_flags |= b2Body::e_islandFlag; + minContact->m_flags |= b2Contact::e_islandFlag; + + // Get contacts on bodyA and bodyB. + b2Body* bodies[2] = {bA, bB}; + for (int32 i = 0; i < 2; ++i) + { + b2Body* body = bodies[i]; + if (body->m_type == b2_dynamicBody) + { + for (b2ContactEdge* ce = body->m_contactList; ce; ce = ce->next) + { + if (island.m_bodyCount == island.m_bodyCapacity) + { + break; + } + + if (island.m_contactCount == island.m_contactCapacity) + { + break; + } + + b2Contact* contact = ce->contact; + + // Has this contact already been added to the island? + if (contact->m_flags & b2Contact::e_islandFlag) + { + continue; + } + + // Only add static, kinematic, or bullet bodies. + b2Body* other = ce->other; + if (other->m_type == b2_dynamicBody && + body->IsBullet() == false && other->IsBullet() == false) + { + continue; + } + + // Skip sensors. + bool sensorA = contact->m_fixtureA->m_isSensor; + bool sensorB = contact->m_fixtureB->m_isSensor; + if (sensorA || sensorB) + { + continue; + } + + // Tentatively advance the body to the TOI. + b2Sweep backup = other->m_sweep; + if ((other->m_flags & b2Body::e_islandFlag) == 0) + { + other->Advance(minAlpha); + } + + // Update the contact points + contact->Update(m_contactManager.m_contactListener); + + // Was the contact disabled by the user? + if (contact->IsEnabled() == false) + { + other->m_sweep = backup; + other->SynchronizeTransform(); + continue; + } + + // Are there contact points? + if (contact->IsTouching() == false) + { + other->m_sweep = backup; + other->SynchronizeTransform(); + continue; + } + + // Add the contact to the island + contact->m_flags |= b2Contact::e_islandFlag; + island.Add(contact); + + // Has the other body already been added to the island? + if (other->m_flags & b2Body::e_islandFlag) + { + continue; + } + + // Add the other body to the island. + other->m_flags |= b2Body::e_islandFlag; + + if (other->m_type != b2_staticBody) + { + other->SetAwake(true); + } + + island.Add(other); + } + } + } + + b2TimeStep subStep; + subStep.dt = (1.0f - minAlpha) * step.dt; + subStep.inv_dt = 1.0f / subStep.dt; + subStep.dtRatio = 1.0f; + subStep.positionIterations = 20; + subStep.velocityIterations = step.velocityIterations; + subStep.warmStarting = false; + island.SolveTOI(subStep, bA->m_islandIndex, bB->m_islandIndex); + + // Reset island flags and synchronize broad-phase proxies. + for (int32 i = 0; i < island.m_bodyCount; ++i) + { + b2Body* body = island.m_bodies[i]; + body->m_flags &= ~b2Body::e_islandFlag; + + if (body->m_type != b2_dynamicBody) + { + continue; + } + + body->SynchronizeFixtures(); + + // Invalidate all contact TOIs on this displaced body. + for (b2ContactEdge* ce = body->m_contactList; ce; ce = ce->next) + { + ce->contact->m_flags &= ~(b2Contact::e_toiFlag | b2Contact::e_islandFlag); + } + } + + // Commit fixture proxy movements to the broad-phase so that new contacts are created. + // Also, some contacts can be destroyed. + m_contactManager.FindNewContacts(); + + if (m_subStepping) + { + m_stepComplete = false; + break; + } + } +} + +void b2World::Step(float32 dt, int32 velocityIterations, int32 positionIterations) +{ + b2Timer stepTimer; + + // If new fixtures were added, we need to find the new contacts. + if (m_flags & e_newFixture) + { + m_contactManager.FindNewContacts(); + m_flags &= ~e_newFixture; + } + + m_flags |= e_locked; + + b2TimeStep step; + step.dt = dt; + step.velocityIterations = velocityIterations; + step.positionIterations = positionIterations; + if (dt > 0.0f) + { + step.inv_dt = 1.0f / dt; + } + else + { + step.inv_dt = 0.0f; + } + + step.dtRatio = m_inv_dt0 * dt; + + step.warmStarting = m_warmStarting; + + // Update contacts. This is where some contacts are destroyed. + { + b2Timer timer; + m_contactManager.Collide(); + m_profile.collide = timer.GetMilliseconds(); + } + + // Integrate velocities, solve velocity constraints, and integrate positions. + if (m_stepComplete && step.dt > 0.0f) + { + b2Timer timer; + Solve(step); + m_profile.solve = timer.GetMilliseconds(); + } + + // Handle TOI events. + if (m_continuousPhysics && step.dt > 0.0f) + { + b2Timer timer; + SolveTOI(step); + m_profile.solveTOI = timer.GetMilliseconds(); + } + + if (step.dt > 0.0f) + { + m_inv_dt0 = step.inv_dt; + } + + if (m_flags & e_clearForces) + { + ClearForces(); + } + + m_flags &= ~e_locked; + + m_profile.step = stepTimer.GetMilliseconds(); +} + +void b2World::ClearForces() +{ + for (b2Body* body = m_bodyList; body; body = body->GetNext()) + { + body->m_force.SetZero(); + body->m_torque = 0.0f; + } +} + +struct b2WorldQueryWrapper +{ + bool QueryCallback(int32 proxyId) + { + b2FixtureProxy* proxy = (b2FixtureProxy*)broadPhase->GetUserData(proxyId); + return callback->ReportFixture(proxy->fixture); + } + + const b2BroadPhase* broadPhase; + b2QueryCallback* callback; +}; + +void b2World::QueryAABB(b2QueryCallback* callback, const b2AABB& aabb) const +{ + b2WorldQueryWrapper wrapper; + wrapper.broadPhase = &m_contactManager.m_broadPhase; + wrapper.callback = callback; + m_contactManager.m_broadPhase.Query(&wrapper, aabb); +} + +struct b2WorldRayCastWrapper +{ + float32 RayCastCallback(const b2RayCastInput& input, int32 proxyId) + { + void* userData = broadPhase->GetUserData(proxyId); + b2FixtureProxy* proxy = (b2FixtureProxy*)userData; + b2Fixture* fixture = proxy->fixture; + int32 index = proxy->childIndex; + b2RayCastOutput output; + bool hit = fixture->RayCast(&output, input, index); + + if (hit) + { + float32 fraction = output.fraction; + b2Vec2 point = (1.0f - fraction) * input.p1 + fraction * input.p2; + return callback->ReportFixture(fixture, point, output.normal, fraction); + } + + return input.maxFraction; + } + + const b2BroadPhase* broadPhase; + b2RayCastCallback* callback; +}; + +void b2World::RayCast(b2RayCastCallback* callback, const b2Vec2& point1, const b2Vec2& point2) const +{ + b2WorldRayCastWrapper wrapper; + wrapper.broadPhase = &m_contactManager.m_broadPhase; + wrapper.callback = callback; + b2RayCastInput input; + input.maxFraction = 1.0f; + input.p1 = point1; + input.p2 = point2; + m_contactManager.m_broadPhase.RayCast(&wrapper, input); +} + +void b2World::DrawShape(b2Fixture* fixture, const b2Transform& xf, const b2Color& color) +{ + switch (fixture->GetType()) + { + case b2Shape::e_circle: + { + b2CircleShape* circle = (b2CircleShape*)fixture->GetShape(); + + b2Vec2 center = b2Mul(xf, circle->m_p); + float32 radius = circle->m_radius; + b2Vec2 axis = b2Mul(xf.q, b2Vec2(1.0f, 0.0f)); + + m_debugDraw->DrawSolidCircle(center, radius, axis, color); + } + break; + + case b2Shape::e_edge: + { + b2EdgeShape* edge = (b2EdgeShape*)fixture->GetShape(); + b2Vec2 v1 = b2Mul(xf, edge->m_vertex1); + b2Vec2 v2 = b2Mul(xf, edge->m_vertex2); + m_debugDraw->DrawSegment(v1, v2, color); + } + break; + + case b2Shape::e_chain: + { + b2ChainShape* chain = (b2ChainShape*)fixture->GetShape(); + int32 count = chain->m_count; + const b2Vec2* vertices = chain->m_vertices; + + b2Vec2 v1 = b2Mul(xf, vertices[0]); + for (int32 i = 1; i < count; ++i) + { + b2Vec2 v2 = b2Mul(xf, vertices[i]); + m_debugDraw->DrawSegment(v1, v2, color); + m_debugDraw->DrawCircle(v1, 0.05f, color); + v1 = v2; + } + } + break; + + case b2Shape::e_polygon: + { + b2PolygonShape* poly = (b2PolygonShape*)fixture->GetShape(); + int32 vertexCount = poly->m_vertexCount; + b2Assert(vertexCount <= b2_maxPolygonVertices); + b2Vec2 vertices[b2_maxPolygonVertices]; + + for (int32 i = 0; i < vertexCount; ++i) + { + vertices[i] = b2Mul(xf, poly->m_vertices[i]); + } + + m_debugDraw->DrawSolidPolygon(vertices, vertexCount, color); + } + break; + + default: + break; + } +} + +void b2World::DrawJoint(b2Joint* joint) +{ + b2Body* bodyA = joint->GetBodyA(); + b2Body* bodyB = joint->GetBodyB(); + const b2Transform& xf1 = bodyA->GetTransform(); + const b2Transform& xf2 = bodyB->GetTransform(); + b2Vec2 x1 = xf1.p; + b2Vec2 x2 = xf2.p; + b2Vec2 p1 = joint->GetAnchorA(); + b2Vec2 p2 = joint->GetAnchorB(); + + b2Color color(0.5f, 0.8f, 0.8f); + + switch (joint->GetType()) + { + case e_distanceJoint: + m_debugDraw->DrawSegment(p1, p2, color); + break; + + case e_pulleyJoint: + { + b2PulleyJoint* pulley = (b2PulleyJoint*)joint; + b2Vec2 s1 = pulley->GetGroundAnchorA(); + b2Vec2 s2 = pulley->GetGroundAnchorB(); + m_debugDraw->DrawSegment(s1, p1, color); + m_debugDraw->DrawSegment(s2, p2, color); + m_debugDraw->DrawSegment(s1, s2, color); + } + break; + + case e_mouseJoint: + // don't draw this + break; + + default: + m_debugDraw->DrawSegment(x1, p1, color); + m_debugDraw->DrawSegment(p1, p2, color); + m_debugDraw->DrawSegment(x2, p2, color); + } +} + +void b2World::DrawDebugData() +{ + if (m_debugDraw == NULL) + { + return; + } + + uint32 flags = m_debugDraw->GetFlags(); + + if (flags & b2Draw::e_shapeBit) + { + for (b2Body* b = m_bodyList; b; b = b->GetNext()) + { + const b2Transform& xf = b->GetTransform(); + for (b2Fixture* f = b->GetFixtureList(); f; f = f->GetNext()) + { + if (b->IsActive() == false) + { + DrawShape(f, xf, b2Color(0.5f, 0.5f, 0.3f)); + } + else if (b->GetType() == b2_staticBody) + { + DrawShape(f, xf, b2Color(0.5f, 0.9f, 0.5f)); + } + else if (b->GetType() == b2_kinematicBody) + { + DrawShape(f, xf, b2Color(0.5f, 0.5f, 0.9f)); + } + else if (b->IsAwake() == false) + { + DrawShape(f, xf, b2Color(0.6f, 0.6f, 0.6f)); + } + else + { + DrawShape(f, xf, b2Color(0.9f, 0.7f, 0.7f)); + } + } + } + } + + if (flags & b2Draw::e_jointBit) + { + for (b2Joint* j = m_jointList; j; j = j->GetNext()) + { + DrawJoint(j); + } + } + + if (flags & b2Draw::e_pairBit) + { + b2Color color(0.3f, 0.9f, 0.9f); + for (b2Contact* c = m_contactManager.m_contactList; c; c = c->GetNext()) + { + //b2Fixture* fixtureA = c->GetFixtureA(); + //b2Fixture* fixtureB = c->GetFixtureB(); + + //b2Vec2 cA = fixtureA->GetAABB().GetCenter(); + //b2Vec2 cB = fixtureB->GetAABB().GetCenter(); + + //m_debugDraw->DrawSegment(cA, cB, color); + } + } + + if (flags & b2Draw::e_aabbBit) + { + b2Color color(0.9f, 0.3f, 0.9f); + b2BroadPhase* bp = &m_contactManager.m_broadPhase; + + for (b2Body* b = m_bodyList; b; b = b->GetNext()) + { + if (b->IsActive() == false) + { + continue; + } + + for (b2Fixture* f = b->GetFixtureList(); f; f = f->GetNext()) + { + for (int32 i = 0; i < f->m_proxyCount; ++i) + { + b2FixtureProxy* proxy = f->m_proxies + i; + b2AABB aabb = bp->GetFatAABB(proxy->proxyId); + b2Vec2 vs[4]; + vs[0].Set(aabb.lowerBound.x, aabb.lowerBound.y); + vs[1].Set(aabb.upperBound.x, aabb.lowerBound.y); + vs[2].Set(aabb.upperBound.x, aabb.upperBound.y); + vs[3].Set(aabb.lowerBound.x, aabb.upperBound.y); + + m_debugDraw->DrawPolygon(vs, 4, color); + } + } + } + } + + if (flags & b2Draw::e_centerOfMassBit) + { + for (b2Body* b = m_bodyList; b; b = b->GetNext()) + { + b2Transform xf = b->GetTransform(); + xf.p = b->GetWorldCenter(); + m_debugDraw->DrawTransform(xf); + } + } +} + +int32 b2World::GetProxyCount() const +{ + return m_contactManager.m_broadPhase.GetProxyCount(); +} + +int32 b2World::GetTreeHeight() const +{ + return m_contactManager.m_broadPhase.GetTreeHeight(); +} + +int32 b2World::GetTreeBalance() const +{ + return m_contactManager.m_broadPhase.GetTreeBalance(); +} + +float32 b2World::GetTreeQuality() const +{ + return m_contactManager.m_broadPhase.GetTreeQuality(); +} + +void b2World::Dump() +{ + if ((m_flags & e_locked) == e_locked) + { + return; + } + + b2Log("b2Vec2 g(%.15lef, %.15lef);\n", m_gravity.x, m_gravity.y); + b2Log("m_world->SetGravity(g);\n"); + + b2Log("b2Body** bodies = (b2Body**)b2Alloc(%d * sizeof(b2Body*));\n", m_bodyCount); + b2Log("b2Joint** joints = (b2Joint**)b2Alloc(%d * sizeof(b2Joint*));\n", m_jointCount); + int32 i = 0; + for (b2Body* b = m_bodyList; b; b = b->m_next) + { + b->m_islandIndex = i; + b->Dump(); + ++i; + } + + i = 0; + for (b2Joint* j = m_jointList; j; j = j->m_next) + { + j->m_index = i; + ++i; + } + + // First pass on joints, skip gear joints. + for (b2Joint* j = m_jointList; j; j = j->m_next) + { + if (j->m_type == e_gearJoint) + { + continue; + } + + b2Log("{\n"); + j->Dump(); + b2Log("}\n"); + } + + // Second pass on joints, only gear joints. + for (b2Joint* j = m_jointList; j; j = j->m_next) + { + if (j->m_type != e_gearJoint) + { + continue; + } + + b2Log("{\n"); + j->Dump(); + b2Log("}\n"); + } + + b2Log("b2Free(joints);\n"); + b2Log("b2Free(bodies);\n"); + b2Log("joints = NULL;\n"); + b2Log("bodies = NULL;\n"); +} diff --git a/external/Box2D/Dynamics/b2World.h b/external/Box2D/Dynamics/b2World.h new file mode 100644 index 0000000000..f207930511 --- /dev/null +++ b/external/Box2D/Dynamics/b2World.h @@ -0,0 +1,349 @@ +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_WORLD_H +#define B2_WORLD_H + +#include +#include +#include +#include +#include +#include + +struct b2AABB; +struct b2BodyDef; +struct b2Color; +struct b2JointDef; +class b2Body; +class b2Draw; +class b2Fixture; +class b2Joint; + +/// The world class manages all physics entities, dynamic simulation, +/// and asynchronous queries. The world also contains efficient memory +/// management facilities. +class b2World +{ +public: + /// Construct a world object. + /// @param gravity the world gravity vector. + b2World(const b2Vec2& gravity); + + /// Destruct the world. All physics entities are destroyed and all heap memory is released. + ~b2World(); + + /// Register a destruction listener. The listener is owned by you and must + /// remain in scope. + void SetDestructionListener(b2DestructionListener* listener); + + /// Register a contact filter to provide specific control over collision. + /// Otherwise the default filter is used (b2_defaultFilter). The listener is + /// owned by you and must remain in scope. + void SetContactFilter(b2ContactFilter* filter); + + /// Register a contact event listener. The listener is owned by you and must + /// remain in scope. + void SetContactListener(b2ContactListener* listener); + + /// Register a routine for debug drawing. The debug draw functions are called + /// inside with b2World::DrawDebugData method. The debug draw object is owned + /// by you and must remain in scope. + void SetDebugDraw(b2Draw* debugDraw); + + /// Create a rigid body given a definition. No reference to the definition + /// is retained. + /// @warning This function is locked during callbacks. + b2Body* CreateBody(const b2BodyDef* def); + + /// Destroy a rigid body given a definition. No reference to the definition + /// is retained. This function is locked during callbacks. + /// @warning This automatically deletes all associated shapes and joints. + /// @warning This function is locked during callbacks. + void DestroyBody(b2Body* body); + + /// Create a joint to constrain bodies together. No reference to the definition + /// is retained. This may cause the connected bodies to cease colliding. + /// @warning This function is locked during callbacks. + b2Joint* CreateJoint(const b2JointDef* def); + + /// Destroy a joint. This may cause the connected bodies to begin colliding. + /// @warning This function is locked during callbacks. + void DestroyJoint(b2Joint* joint); + + /// Take a time step. This performs collision detection, integration, + /// and constraint solution. + /// @param timeStep the amount of time to simulate, this should not vary. + /// @param velocityIterations for the velocity constraint solver. + /// @param positionIterations for the position constraint solver. + void Step( float32 timeStep, + int32 velocityIterations, + int32 positionIterations); + + /// Manually clear the force buffer on all bodies. By default, forces are cleared automatically + /// after each call to Step. The default behavior is modified by calling SetAutoClearForces. + /// The purpose of this function is to support sub-stepping. Sub-stepping is often used to maintain + /// a fixed sized time step under a variable frame-rate. + /// When you perform sub-stepping you will disable auto clearing of forces and instead call + /// ClearForces after all sub-steps are complete in one pass of your game loop. + /// @see SetAutoClearForces + void ClearForces(); + + /// Call this to draw shapes and other debug draw data. + void DrawDebugData(); + + /// Query the world for all fixtures that potentially overlap the + /// provided AABB. + /// @param callback a user implemented callback class. + /// @param aabb the query box. + void QueryAABB(b2QueryCallback* callback, const b2AABB& aabb) const; + + /// Ray-cast the world for all fixtures in the path of the ray. Your callback + /// controls whether you get the closest point, any point, or n-points. + /// The ray-cast ignores shapes that contain the starting point. + /// @param callback a user implemented callback class. + /// @param point1 the ray starting point + /// @param point2 the ray ending point + void RayCast(b2RayCastCallback* callback, const b2Vec2& point1, const b2Vec2& point2) const; + + /// Get the world body list. With the returned body, use b2Body::GetNext to get + /// the next body in the world list. A NULL body indicates the end of the list. + /// @return the head of the world body list. + b2Body* GetBodyList(); + const b2Body* GetBodyList() const; + + /// Get the world joint list. With the returned joint, use b2Joint::GetNext to get + /// the next joint in the world list. A NULL joint indicates the end of the list. + /// @return the head of the world joint list. + b2Joint* GetJointList(); + const b2Joint* GetJointList() const; + + /// Get the world contact list. With the returned contact, use b2Contact::GetNext to get + /// the next contact in the world list. A NULL contact indicates the end of the list. + /// @return the head of the world contact list. + /// @warning contacts are created and destroyed in the middle of a time step. + /// Use b2ContactListener to avoid missing contacts. + b2Contact* GetContactList(); + const b2Contact* GetContactList() const; + + /// Enable/disable sleep. + void SetAllowSleeping(bool flag); + bool GetAllowSleeping() const { return m_allowSleep; } + + /// Enable/disable warm starting. For testing. + void SetWarmStarting(bool flag) { m_warmStarting = flag; } + bool GetWarmStarting() const { return m_warmStarting; } + + /// Enable/disable continuous physics. For testing. + void SetContinuousPhysics(bool flag) { m_continuousPhysics = flag; } + bool GetContinuousPhysics() const { return m_continuousPhysics; } + + /// Enable/disable single stepped continuous physics. For testing. + void SetSubStepping(bool flag) { m_subStepping = flag; } + bool GetSubStepping() const { return m_subStepping; } + + /// Get the number of broad-phase proxies. + int32 GetProxyCount() const; + + /// Get the number of bodies. + int32 GetBodyCount() const; + + /// Get the number of joints. + int32 GetJointCount() const; + + /// Get the number of contacts (each may have 0 or more contact points). + int32 GetContactCount() const; + + /// Get the height of the dynamic tree. + int32 GetTreeHeight() const; + + /// Get the balance of the dynamic tree. + int32 GetTreeBalance() const; + + /// Get the quality metric of the dynamic tree. The smaller the better. + /// The minimum is 1. + float32 GetTreeQuality() const; + + /// Change the global gravity vector. + void SetGravity(const b2Vec2& gravity); + + /// Get the global gravity vector. + b2Vec2 GetGravity() const; + + /// Is the world locked (in the middle of a time step). + bool IsLocked() const; + + /// Set flag to control automatic clearing of forces after each time step. + void SetAutoClearForces(bool flag); + + /// Get the flag that controls automatic clearing of forces after each time step. + bool GetAutoClearForces() const; + + /// Get the contact manager for testing. + const b2ContactManager& GetContactManager() const; + + /// Get the current profile. + const b2Profile& GetProfile() const; + + /// Dump the world into the log file. + /// @warning this should be called outside of a time step. + void Dump(); + +private: + + // m_flags + enum + { + e_newFixture = 0x0001, + e_locked = 0x0002, + e_clearForces = 0x0004 + }; + + friend class b2Body; + friend class b2Fixture; + friend class b2ContactManager; + friend class b2Controller; + + void Solve(const b2TimeStep& step); + void SolveTOI(const b2TimeStep& step); + + void DrawJoint(b2Joint* joint); + void DrawShape(b2Fixture* shape, const b2Transform& xf, const b2Color& color); + + b2BlockAllocator m_blockAllocator; + b2StackAllocator m_stackAllocator; + + int32 m_flags; + + b2ContactManager m_contactManager; + + b2Body* m_bodyList; + b2Joint* m_jointList; + + int32 m_bodyCount; + int32 m_jointCount; + + b2Vec2 m_gravity; + bool m_allowSleep; + + b2DestructionListener* m_destructionListener; + b2Draw* m_debugDraw; + + // This is used to compute the time step ratio to + // support a variable time step. + float32 m_inv_dt0; + + // These are for debugging the solver. + bool m_warmStarting; + bool m_continuousPhysics; + bool m_subStepping; + + bool m_stepComplete; + + b2Profile m_profile; +}; + +inline b2Body* b2World::GetBodyList() +{ + return m_bodyList; +} + +inline const b2Body* b2World::GetBodyList() const +{ + return m_bodyList; +} + +inline b2Joint* b2World::GetJointList() +{ + return m_jointList; +} + +inline const b2Joint* b2World::GetJointList() const +{ + return m_jointList; +} + +inline b2Contact* b2World::GetContactList() +{ + return m_contactManager.m_contactList; +} + +inline const b2Contact* b2World::GetContactList() const +{ + return m_contactManager.m_contactList; +} + +inline int32 b2World::GetBodyCount() const +{ + return m_bodyCount; +} + +inline int32 b2World::GetJointCount() const +{ + return m_jointCount; +} + +inline int32 b2World::GetContactCount() const +{ + return m_contactManager.m_contactCount; +} + +inline void b2World::SetGravity(const b2Vec2& gravity) +{ + m_gravity = gravity; +} + +inline b2Vec2 b2World::GetGravity() const +{ + return m_gravity; +} + +inline bool b2World::IsLocked() const +{ + return (m_flags & e_locked) == e_locked; +} + +inline void b2World::SetAutoClearForces(bool flag) +{ + if (flag) + { + m_flags |= e_clearForces; + } + else + { + m_flags &= ~e_clearForces; + } +} + +/// Get the flag that controls automatic clearing of forces after each time step. +inline bool b2World::GetAutoClearForces() const +{ + return (m_flags & e_clearForces) == e_clearForces; +} + +inline const b2ContactManager& b2World::GetContactManager() const +{ + return m_contactManager; +} + +inline const b2Profile& b2World::GetProfile() const +{ + return m_profile; +} + +#endif diff --git a/external/Box2D/Dynamics/b2WorldCallbacks.cpp b/external/Box2D/Dynamics/b2WorldCallbacks.cpp new file mode 100644 index 0000000000..48ad0cc46a --- /dev/null +++ b/external/Box2D/Dynamics/b2WorldCallbacks.cpp @@ -0,0 +1,36 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include + +// Return true if contact calculations should be performed between these two shapes. +// If you implement your own collision filter you may want to build from this implementation. +bool b2ContactFilter::ShouldCollide(b2Fixture* fixtureA, b2Fixture* fixtureB) +{ + const b2Filter& filterA = fixtureA->GetFilterData(); + const b2Filter& filterB = fixtureB->GetFilterData(); + + if (filterA.groupIndex == filterB.groupIndex && filterA.groupIndex != 0) + { + return filterA.groupIndex > 0; + } + + bool collide = (filterA.maskBits & filterB.categoryBits) != 0 && (filterA.categoryBits & filterB.maskBits) != 0; + return collide; +} diff --git a/external/Box2D/Dynamics/b2WorldCallbacks.h b/external/Box2D/Dynamics/b2WorldCallbacks.h new file mode 100644 index 0000000000..86c04e3e32 --- /dev/null +++ b/external/Box2D/Dynamics/b2WorldCallbacks.h @@ -0,0 +1,155 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_WORLD_CALLBACKS_H +#define B2_WORLD_CALLBACKS_H + +#include + +struct b2Vec2; +struct b2Transform; +class b2Fixture; +class b2Body; +class b2Joint; +class b2Contact; +struct b2ContactResult; +struct b2Manifold; + +/// Joints and fixtures are destroyed when their associated +/// body is destroyed. Implement this listener so that you +/// may nullify references to these joints and shapes. +class b2DestructionListener +{ +public: + virtual ~b2DestructionListener() {} + + /// Called when any joint is about to be destroyed due + /// to the destruction of one of its attached bodies. + virtual void SayGoodbye(b2Joint* joint) = 0; + + /// Called when any fixture is about to be destroyed due + /// to the destruction of its parent body. + virtual void SayGoodbye(b2Fixture* fixture) = 0; +}; + +/// Implement this class to provide collision filtering. In other words, you can implement +/// this class if you want finer control over contact creation. +class b2ContactFilter +{ +public: + virtual ~b2ContactFilter() {} + + /// Return true if contact calculations should be performed between these two shapes. + /// @warning for performance reasons this is only called when the AABBs begin to overlap. + virtual bool ShouldCollide(b2Fixture* fixtureA, b2Fixture* fixtureB); +}; + +/// Contact impulses for reporting. Impulses are used instead of forces because +/// sub-step forces may approach infinity for rigid body collisions. These +/// match up one-to-one with the contact points in b2Manifold. +struct b2ContactImpulse +{ + float32 normalImpulses[b2_maxManifoldPoints]; + float32 tangentImpulses[b2_maxManifoldPoints]; + int32 count; +}; + +/// Implement this class to get contact information. You can use these results for +/// things like sounds and game logic. You can also get contact results by +/// traversing the contact lists after the time step. However, you might miss +/// some contacts because continuous physics leads to sub-stepping. +/// Additionally you may receive multiple callbacks for the same contact in a +/// single time step. +/// You should strive to make your callbacks efficient because there may be +/// many callbacks per time step. +/// @warning You cannot create/destroy Box2D entities inside these callbacks. +class b2ContactListener +{ +public: + virtual ~b2ContactListener() {} + + /// Called when two fixtures begin to touch. + virtual void BeginContact(b2Contact* contact) { B2_NOT_USED(contact); } + + /// Called when two fixtures cease to touch. + virtual void EndContact(b2Contact* contact) { B2_NOT_USED(contact); } + + /// This is called after a contact is updated. This allows you to inspect a + /// contact before it goes to the solver. If you are careful, you can modify the + /// contact manifold (e.g. disable contact). + /// A copy of the old manifold is provided so that you can detect changes. + /// Note: this is called only for awake bodies. + /// Note: this is called even when the number of contact points is zero. + /// Note: this is not called for sensors. + /// Note: if you set the number of contact points to zero, you will not + /// get an EndContact callback. However, you may get a BeginContact callback + /// the next step. + virtual void PreSolve(b2Contact* contact, const b2Manifold* oldManifold) + { + B2_NOT_USED(contact); + B2_NOT_USED(oldManifold); + } + + /// This lets you inspect a contact after the solver is finished. This is useful + /// for inspecting impulses. + /// Note: the contact manifold does not include time of impact impulses, which can be + /// arbitrarily large if the sub-step is small. Hence the impulse is provided explicitly + /// in a separate data structure. + /// Note: this is only called for contacts that are touching, solid, and awake. + virtual void PostSolve(b2Contact* contact, const b2ContactImpulse* impulse) + { + B2_NOT_USED(contact); + B2_NOT_USED(impulse); + } +}; + +/// Callback class for AABB queries. +/// See b2World::Query +class b2QueryCallback +{ +public: + virtual ~b2QueryCallback() {} + + /// Called for each fixture found in the query AABB. + /// @return false to terminate the query. + virtual bool ReportFixture(b2Fixture* fixture) = 0; +}; + +/// Callback class for ray casts. +/// See b2World::RayCast +class b2RayCastCallback +{ +public: + virtual ~b2RayCastCallback() {} + + /// Called for each fixture found in the query. You control how the ray cast + /// proceeds by returning a float: + /// return -1: ignore this fixture and continue + /// return 0: terminate the ray cast + /// return fraction: clip the ray to this point + /// return 1: don't clip the ray and continue + /// @param fixture the fixture hit by the ray + /// @param point the point of initial intersection + /// @param normal the normal vector at the point of intersection + /// @return -1 to filter, 0 to terminate, fraction to clip the ray for + /// closest hit, 1 to continue + virtual float32 ReportFixture( b2Fixture* fixture, const b2Vec2& point, + const b2Vec2& normal, float32 fraction) = 0; +}; + +#endif diff --git a/external/Box2D/Rope/b2Rope.cpp b/external/Box2D/Rope/b2Rope.cpp new file mode 100644 index 0000000000..9bf671aec9 --- /dev/null +++ b/external/Box2D/Rope/b2Rope.cpp @@ -0,0 +1,259 @@ +/* +* Copyright (c) 2011 Erin Catto http://box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include + +b2Rope::b2Rope() +{ + m_count = 0; + m_ps = NULL; + m_p0s = NULL; + m_vs = NULL; + m_ims = NULL; + m_Ls = NULL; + m_as = NULL; + m_gravity.SetZero(); + m_k2 = 1.0f; + m_k3 = 0.1f; +} + +b2Rope::~b2Rope() +{ + b2Free(m_ps); + b2Free(m_p0s); + b2Free(m_vs); + b2Free(m_ims); + b2Free(m_Ls); + b2Free(m_as); +} + +void b2Rope::Initialize(const b2RopeDef* def) +{ + b2Assert(def->count >= 3); + m_count = def->count; + m_ps = (b2Vec2*)b2Alloc(m_count * sizeof(b2Vec2)); + m_p0s = (b2Vec2*)b2Alloc(m_count * sizeof(b2Vec2)); + m_vs = (b2Vec2*)b2Alloc(m_count * sizeof(b2Vec2)); + m_ims = (float32*)b2Alloc(m_count * sizeof(float32)); + + for (int32 i = 0; i < m_count; ++i) + { + m_ps[i] = def->vertices[i]; + m_p0s[i] = def->vertices[i]; + m_vs[i].SetZero(); + + float32 m = def->masses[i]; + if (m > 0.0f) + { + m_ims[i] = 1.0f / m; + } + else + { + m_ims[i] = 0.0f; + } + } + + int32 count2 = m_count - 1; + int32 count3 = m_count - 2; + m_Ls = (float32*)b2Alloc(count2 * sizeof(float32)); + m_as = (float32*)b2Alloc(count3 * sizeof(float32)); + + for (int32 i = 0; i < count2; ++i) + { + b2Vec2 p1 = m_ps[i]; + b2Vec2 p2 = m_ps[i+1]; + m_Ls[i] = b2Distance(p1, p2); + } + + for (int32 i = 0; i < count3; ++i) + { + b2Vec2 p1 = m_ps[i]; + b2Vec2 p2 = m_ps[i + 1]; + b2Vec2 p3 = m_ps[i + 2]; + + b2Vec2 d1 = p2 - p1; + b2Vec2 d2 = p3 - p2; + + float32 a = b2Cross(d1, d2); + float32 b = b2Dot(d1, d2); + + m_as[i] = b2Atan2(a, b); + } + + m_gravity = def->gravity; + m_damping = def->damping; + m_k2 = def->k2; + m_k3 = def->k3; +} + +void b2Rope::Step(float32 h, int32 iterations) +{ + if (h == 0.0) + { + return; + } + + float32 d = expf(- h * m_damping); + + for (int32 i = 0; i < m_count; ++i) + { + m_p0s[i] = m_ps[i]; + if (m_ims[i] > 0.0f) + { + m_vs[i] += h * m_gravity; + } + m_vs[i] *= d; + m_ps[i] += h * m_vs[i]; + + } + + for (int32 i = 0; i < iterations; ++i) + { + SolveC2(); + SolveC3(); + SolveC2(); + } + + float32 inv_h = 1.0f / h; + for (int32 i = 0; i < m_count; ++i) + { + m_vs[i] = inv_h * (m_ps[i] - m_p0s[i]); + } +} + +void b2Rope::SolveC2() +{ + int32 count2 = m_count - 1; + + for (int32 i = 0; i < count2; ++i) + { + b2Vec2 p1 = m_ps[i]; + b2Vec2 p2 = m_ps[i + 1]; + + b2Vec2 d = p2 - p1; + float32 L = d.Normalize(); + + float32 im1 = m_ims[i]; + float32 im2 = m_ims[i + 1]; + + if (im1 + im2 == 0.0f) + { + continue; + } + + float32 s1 = im1 / (im1 + im2); + float32 s2 = im2 / (im1 + im2); + + p1 -= m_k2 * s1 * (m_Ls[i] - L) * d; + p2 += m_k2 * s2 * (m_Ls[i] - L) * d; + + m_ps[i] = p1; + m_ps[i + 1] = p2; + } +} + +void b2Rope::SetAngle(float32 angle) +{ + int32 count3 = m_count - 2; + for (int32 i = 0; i < count3; ++i) + { + m_as[i] = angle; + } +} + +void b2Rope::SolveC3() +{ + int32 count3 = m_count - 2; + + for (int32 i = 0; i < count3; ++i) + { + b2Vec2 p1 = m_ps[i]; + b2Vec2 p2 = m_ps[i + 1]; + b2Vec2 p3 = m_ps[i + 2]; + + float32 m1 = m_ims[i]; + float32 m2 = m_ims[i + 1]; + float32 m3 = m_ims[i + 2]; + + b2Vec2 d1 = p2 - p1; + b2Vec2 d2 = p3 - p2; + + float32 L1sqr = d1.LengthSquared(); + float32 L2sqr = d2.LengthSquared(); + + if (L1sqr * L2sqr == 0.0f) + { + continue; + } + + float32 a = b2Cross(d1, d2); + float32 b = b2Dot(d1, d2); + + float32 angle = b2Atan2(a, b); + + b2Vec2 Jd1 = (-1.0f / L1sqr) * d1.Skew(); + b2Vec2 Jd2 = (1.0f / L2sqr) * d2.Skew(); + + b2Vec2 J1 = -Jd1; + b2Vec2 J2 = Jd1 - Jd2; + b2Vec2 J3 = Jd2; + + float32 mass = m1 * b2Dot(J1, J1) + m2 * b2Dot(J2, J2) + m3 * b2Dot(J3, J3); + if (mass == 0.0f) + { + continue; + } + + mass = 1.0f / mass; + + float32 C = angle - m_as[i]; + + while (C > b2_pi) + { + angle -= 2 * b2_pi; + C = angle - m_as[i]; + } + + while (C < -b2_pi) + { + angle += 2.0f * b2_pi; + C = angle - m_as[i]; + } + + float32 impulse = - m_k3 * mass * C; + + p1 += (m1 * impulse) * J1; + p2 += (m2 * impulse) * J2; + p3 += (m3 * impulse) * J3; + + m_ps[i] = p1; + m_ps[i + 1] = p2; + m_ps[i + 2] = p3; + } +} + +void b2Rope::Draw(b2Draw* draw) const +{ + b2Color c(0.4f, 0.5f, 0.7f); + + for (int32 i = 0; i < m_count - 1; ++i) + { + draw->DrawSegment(m_ps[i], m_ps[i+1], c); + } +} diff --git a/external/Box2D/Rope/b2Rope.h b/external/Box2D/Rope/b2Rope.h new file mode 100644 index 0000000000..b981dfd6c5 --- /dev/null +++ b/external/Box2D/Rope/b2Rope.h @@ -0,0 +1,115 @@ +/* +* Copyright (c) 2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_ROPE_H +#define B2_ROPE_H + +#include + +class b2Draw; + +/// +struct b2RopeDef +{ + b2RopeDef() + { + vertices = NULL; + count = 0; + masses = NULL; + gravity.SetZero(); + damping = 0.1f; + k2 = 0.9f; + k3 = 0.1f; + } + + /// + b2Vec2* vertices; + + /// + int32 count; + + /// + float32* masses; + + /// + b2Vec2 gravity; + + /// + float32 damping; + + /// Stretching stiffness + float32 k2; + + /// Bending stiffness. Values above 0.5 can make the simulation blow up. + float32 k3; +}; + +/// +class b2Rope +{ +public: + b2Rope(); + ~b2Rope(); + + /// + void Initialize(const b2RopeDef* def); + + /// + void Step(float32 timeStep, int32 iterations); + + /// + int32 GetVertexCount() const + { + return m_count; + } + + /// + const b2Vec2* GetVertices() const + { + return m_ps; + } + + /// + void Draw(b2Draw* draw) const; + + /// + void SetAngle(float32 angle); + +private: + + void SolveC2(); + void SolveC3(); + + int32 m_count; + b2Vec2* m_ps; + b2Vec2* m_p0s; + b2Vec2* m_vs; + + float32* m_ims; + + float32* m_Ls; + float32* m_as; + + b2Vec2 m_gravity; + float32 m_damping; + + float32 m_k2; + float32 m_k3; +}; + +#endif diff --git a/external/Box2D/proj.linux/.cproject b/external/Box2D/proj.linux/.cproject new file mode 100644 index 0000000000..5aa092cac3 --- /dev/null +++ b/external/Box2D/proj.linux/.cproject @@ -0,0 +1,267 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/external/Box2D/proj.linux/.project b/external/Box2D/proj.linux/.project new file mode 100644 index 0000000000..164d50f52a --- /dev/null +++ b/external/Box2D/proj.linux/.project @@ -0,0 +1,110 @@ + + + libBox2D + + + + + + org.eclipse.cdt.managedbuilder.core.genmakebuilder + clean,full,incremental, + + + ?name? + + + + org.eclipse.cdt.make.core.append_environment + true + + + org.eclipse.cdt.make.core.autoBuildTarget + all + + + org.eclipse.cdt.make.core.buildArguments + + + + org.eclipse.cdt.make.core.buildCommand + make + + + org.eclipse.cdt.make.core.buildLocation + ${workspace_loc:/libBox2D/Debug} + + + org.eclipse.cdt.make.core.cleanBuildTarget + clean + + + org.eclipse.cdt.make.core.contents + org.eclipse.cdt.make.core.activeConfigSettings + + + org.eclipse.cdt.make.core.enableAutoBuild + false + + + org.eclipse.cdt.make.core.enableCleanBuild + true + + + org.eclipse.cdt.make.core.enableFullBuild + true + + + org.eclipse.cdt.make.core.fullBuildTarget + all + + + org.eclipse.cdt.make.core.stopOnError + true + + + org.eclipse.cdt.make.core.useDefaultBuildCmd + true + + + + + org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder + full,incremental, + + + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.core.ccnature + org.eclipse.cdt.managedbuilder.core.managedBuildNature + org.eclipse.cdt.managedbuilder.core.ScannerConfigNature + + + + Box2D.h + 1 + PARENT-1-PROJECT_LOC/Box2D.h + + + Collision + 2 + PARENT-1-PROJECT_LOC/Collision + + + Common + 2 + PARENT-1-PROJECT_LOC/Common + + + Dynamics + 2 + PARENT-1-PROJECT_LOC/Dynamics + + + Rope + 2 + PARENT-1-PROJECT_LOC/Rope + + + diff --git a/external/Box2D/proj.linux/Makefile b/external/Box2D/proj.linux/Makefile new file mode 100644 index 0000000000..e430bc9883 --- /dev/null +++ b/external/Box2D/proj.linux/Makefile @@ -0,0 +1,72 @@ +TARGET = libbox2d.a + +SOURCES = ../Collision/Shapes/b2ChainShape.cpp \ +../Collision/Shapes/b2CircleShape.cpp \ +../Collision/Shapes/b2EdgeShape.cpp \ +../Collision/Shapes/b2PolygonShape.cpp \ +../Collision/b2BroadPhase.cpp \ +../Collision/b2CollideCircle.cpp \ +../Collision/b2CollideEdge.cpp \ +../Collision/b2CollidePolygon.cpp \ +../Collision/b2Collision.cpp \ +../Collision/b2Distance.cpp \ +../Collision/b2DynamicTree.cpp \ +../Collision/b2TimeOfImpact.cpp \ +../Common/b2BlockAllocator.cpp \ +../Common/b2Draw.cpp \ +../Common/b2Math.cpp \ +../Common/b2Settings.cpp \ +../Common/b2StackAllocator.cpp \ +../Common/b2Timer.cpp \ +../Dynamics/Contacts/b2ChainAndCircleContact.cpp \ +../Dynamics/Contacts/b2ChainAndPolygonContact.cpp \ +../Dynamics/Contacts/b2CircleContact.cpp \ +../Dynamics/Contacts/b2Contact.cpp \ +../Dynamics/Contacts/b2ContactSolver.cpp \ +../Dynamics/Contacts/b2EdgeAndCircleContact.cpp \ +../Dynamics/Contacts/b2EdgeAndPolygonContact.cpp \ +../Dynamics/Contacts/b2PolygonAndCircleContact.cpp \ +../Dynamics/Contacts/b2PolygonContact.cpp \ +../Dynamics/Joints/b2DistanceJoint.cpp \ +../Dynamics/Joints/b2FrictionJoint.cpp \ +../Dynamics/Joints/b2GearJoint.cpp \ +../Dynamics/Joints/b2Joint.cpp \ +../Dynamics/Joints/b2MouseJoint.cpp \ +../Dynamics/Joints/b2PrismaticJoint.cpp \ +../Dynamics/Joints/b2PulleyJoint.cpp \ +../Dynamics/Joints/b2RevoluteJoint.cpp \ +../Dynamics/Joints/b2RopeJoint.cpp \ +../Dynamics/Joints/b2WeldJoint.cpp \ +../Dynamics/Joints/b2WheelJoint.cpp \ +../Dynamics/b2Body.cpp \ +../Dynamics/b2ContactManager.cpp \ +../Dynamics/b2Fixture.cpp \ +../Dynamics/b2Island.cpp \ +../Dynamics/b2World.cpp \ +../Dynamics/b2WorldCallbacks.cpp \ +../Rope/b2Rope.cpp + +include ../../../cocos2dx/proj.linux/cocos2dx.mk + +INCLUDES = -I../.. + +# Cocos2d is not responsible for warnings in external projects +CXXFLAGS += -w + +ifeq ($(DEBUG), 1) +DEFINES = -D_DEBUG +else +DEFINES = +endif + +TARGET := $(LIB_DIR)/$(TARGET) + +all: $(TARGET) + +$(TARGET): $(OBJECTS) $(CORE_MAKEFILE_LIST) + @mkdir -p $(@D) + $(LOG_AR)$(AR) $(ARFLAGS) $(TARGET) $(OBJECTS) + +$(OBJ_DIR)/%.o: ../%.cpp $(CORE_MAKEFILE_LIST) + @mkdir -p $(@D) + $(LOG_CXX)$(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@ diff --git a/external/Box2D/proj.linux/box2d.prf b/external/Box2D/proj.linux/box2d.prf new file mode 100644 index 0000000000..434ad88406 --- /dev/null +++ b/external/Box2D/proj.linux/box2d.prf @@ -0,0 +1,19 @@ +################################################################################ +# Do not include this file in your project: see cocos2dx.pri. +################################################################################ + +linux { + # We will compile box2d on demand using Makefile. + build_box2d.name = Build box2d static library + build_box2d.input = $$PWD/Makefile + build_box2d.output = $$CC_LIBRARY_DIR/libbox2d.a + build_box2d.target = $$CC_LIBRARY_DIR/libbox2d.a + build_box2d.CONFIG = no_link target_predeps + build_box2d.commands = cd $$PWD && make $$CC_MAKE_FLAGS + + QMAKE_EXTRA_COMPILERS += build_box2d + QMAKE_EXTRA_TARGETS += build_box2d + + PRE_TARGETDEPS += $$CC_LIBRARY_DIR/libbox2d.a + LIBS += -Wl,-Bstatic -lbox2d -Wl,-Bdynamic +} diff --git a/external/Box2D/proj.win32/Box2D.vcxproj b/external/Box2D/proj.win32/Box2D.vcxproj new file mode 100644 index 0000000000..cd4bd2086c --- /dev/null +++ b/external/Box2D/proj.win32/Box2D.vcxproj @@ -0,0 +1,194 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + libBox2D + {929480E7-23C0-4DF6-8456-096D71547116} + Box2D.win32 + Win32Proj + + + + StaticLibrary + Unicode + v100 + v110 + v110_xp + + + StaticLibrary + Unicode + v100 + v110 + v110_xp + + + + + + + + + + + + + <_ProjectFileVersion>10.0.40219.1 + $(SolutionDir)$(Configuration).win32\ + $(Configuration).win32\ + $(SolutionDir)$(Configuration).win32\ + $(Configuration).win32\ + AllRules.ruleset + + + AllRules.ruleset + + + + + $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\lib;$(LibraryPath) + + + $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\lib;$(LibraryPath) + + + + Disabled + $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\include;../../;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + false + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + true + + + $(OutDir)$(ProjectName).lib + + + + + $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\include;../../;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + true + + + $(OutDir)$(ProjectName).lib + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/external/Box2D/proj.win32/Box2D.vcxproj.filters b/external/Box2D/proj.win32/Box2D.vcxproj.filters new file mode 100644 index 0000000000..e810cbb0cf --- /dev/null +++ b/external/Box2D/proj.win32/Box2D.vcxproj.filters @@ -0,0 +1,301 @@ + + + + + {bdf099c5-cc32-468b-b53f-ec010d7f823f} + + + {92792f88-4e5c-46ee-8d87-002f3b2297ae} + + + {f41a6fa6-5ac1-4514-9ac0-6f3a38f35b4d} + + + {0b56913a-34b7-410a-b386-869d6f7a20be} + + + {f0e7b230-79cc-49b8-9ed7-9dbfa062f2a4} + + + {932f2008-afbe-42f5-993d-a1df0ec67756} + + + {f8937e09-93a4-49fa-8f3e-dfc36da764df} + + + + + Collision + + + Collision + + + Collision + + + Collision + + + Collision + + + Collision + + + Collision + + + Collision + + + Collision\Shapes + + + Collision\Shapes + + + Collision\Shapes + + + Collision\Shapes + + + Common + + + Common + + + Common + + + Common + + + Common + + + Common + + + Dynamics + + + Dynamics + + + Dynamics + + + Dynamics + + + Dynamics + + + Dynamics + + + Dynamics\Contacts + + + Dynamics\Contacts + + + Dynamics\Contacts + + + Dynamics\Contacts + + + Dynamics\Contacts + + + Dynamics\Contacts + + + Dynamics\Contacts + + + Dynamics\Contacts + + + Dynamics\Contacts + + + Dynamics\Joints + + + Dynamics\Joints + + + Dynamics\Joints + + + Dynamics\Joints + + + Dynamics\Joints + + + Dynamics\Joints + + + Dynamics\Joints + + + Dynamics\Joints + + + Dynamics\Joints + + + Dynamics\Joints + + + Dynamics\Joints + + + Rope + + + + + Collision + + + Collision + + + Collision + + + Collision + + + Collision + + + Collision\Shapes + + + Collision\Shapes + + + Collision\Shapes + + + Collision\Shapes + + + Collision\Shapes + + + Common + + + Common + + + Common + + + Common + + + Common + + + Common + + + Common + + + Dynamics + + + Dynamics + + + Dynamics + + + Dynamics + + + Dynamics + + + Dynamics + + + Dynamics + + + Dynamics\Contacts + + + Dynamics\Contacts + + + Dynamics\Contacts + + + Dynamics\Contacts + + + Dynamics\Contacts + + + Dynamics\Contacts + + + Dynamics\Contacts + + + Dynamics\Contacts + + + Dynamics\Contacts + + + Dynamics\Joints + + + Dynamics\Joints + + + Dynamics\Joints + + + Dynamics\Joints + + + Dynamics\Joints + + + Dynamics\Joints + + + Dynamics\Joints + + + Dynamics\Joints + + + Dynamics\Joints + + + Dynamics\Joints + + + Dynamics\Joints + + + Rope + + + + \ No newline at end of file diff --git a/external/Box2D/proj.win32/Box2D.vcxproj.user b/external/Box2D/proj.win32/Box2D.vcxproj.user new file mode 100644 index 0000000000..ace9a86acb --- /dev/null +++ b/external/Box2D/proj.win32/Box2D.vcxproj.user @@ -0,0 +1,3 @@ + + + \ No newline at end of file From 7de6646213901c3d887923e1969cb0630f4e028e Mon Sep 17 00:00:00 2001 From: James Chen Date: Sat, 12 Oct 2013 14:56:40 +0800 Subject: [PATCH 20/64] Don't ignore (D|d)ebugXXX folders or files. And move scripting/javascript/bindings/js to 'scripting/javascript/script/' folder. --- .gitignore | 4 ++-- .../{bindings/js => script}/debugger/DevToolsUtils.js | 0 .../javascript/{bindings/js => script}/debugger/README.md | 0 .../{bindings/js => script}/debugger/actors/root.js | 0 .../{bindings/js => script}/debugger/actors/script.js | 0 .../{bindings/js => script}/debugger/core/promise.js | 0 .../javascript/{bindings/js => script}/debugger/main.js | 0 .../javascript/{bindings/js => script}/debugger/transport.js | 0 cocos/scripting/javascript/{bindings/js => script}/jsb.js | 0 .../javascript/{bindings/js => script}/jsb_chipmunk.js | 0 .../{bindings/js => script}/jsb_chipmunk_constants.js | 0 .../javascript/{bindings/js => script}/jsb_cocos2d.js | 0 .../{bindings/js => script}/jsb_cocos2d_constants.js | 0 .../{bindings/js => script}/jsb_cocos2d_extension.js | 0 .../javascript/{bindings/js => script}/jsb_cocosbuilder.js | 0 .../javascript/{bindings/js => script}/jsb_debugger.js | 0 .../javascript/{bindings/js => script}/jsb_deprecated.js | 0 .../javascript/{bindings/js => script}/jsb_opengl.js | 0 .../{bindings/js => script}/jsb_opengl_constants.js | 0 cocos/scripting/javascript/{bindings/js => script}/jsb_sys.js | 0 20 files changed, 2 insertions(+), 2 deletions(-) rename cocos/scripting/javascript/{bindings/js => script}/debugger/DevToolsUtils.js (100%) rename cocos/scripting/javascript/{bindings/js => script}/debugger/README.md (100%) rename cocos/scripting/javascript/{bindings/js => script}/debugger/actors/root.js (100%) rename cocos/scripting/javascript/{bindings/js => script}/debugger/actors/script.js (100%) rename cocos/scripting/javascript/{bindings/js => script}/debugger/core/promise.js (100%) rename cocos/scripting/javascript/{bindings/js => script}/debugger/main.js (100%) rename cocos/scripting/javascript/{bindings/js => script}/debugger/transport.js (100%) rename cocos/scripting/javascript/{bindings/js => script}/jsb.js (100%) rename cocos/scripting/javascript/{bindings/js => script}/jsb_chipmunk.js (100%) rename cocos/scripting/javascript/{bindings/js => script}/jsb_chipmunk_constants.js (100%) rename cocos/scripting/javascript/{bindings/js => script}/jsb_cocos2d.js (100%) rename cocos/scripting/javascript/{bindings/js => script}/jsb_cocos2d_constants.js (100%) rename cocos/scripting/javascript/{bindings/js => script}/jsb_cocos2d_extension.js (100%) rename cocos/scripting/javascript/{bindings/js => script}/jsb_cocosbuilder.js (100%) rename cocos/scripting/javascript/{bindings/js => script}/jsb_debugger.js (100%) rename cocos/scripting/javascript/{bindings/js => script}/jsb_deprecated.js (100%) rename cocos/scripting/javascript/{bindings/js => script}/jsb_opengl.js (100%) rename cocos/scripting/javascript/{bindings/js => script}/jsb_opengl_constants.js (100%) rename cocos/scripting/javascript/{bindings/js => script}/jsb_sys.js (100%) diff --git a/.gitignore b/.gitignore index 14845a8164..d6bae12eb7 100644 --- a/.gitignore +++ b/.gitignore @@ -21,11 +21,11 @@ Thumbs.db *.ilk *.log [Bb]in -[Dd]ebug*/ +[Dd]ebug/ *.sbr *.sdf obj/ -[Rr]elease*/ +[Rr]elease/ _ReSharper*/ [Tt]est[Rr]esult* ipch/ diff --git a/cocos/scripting/javascript/bindings/js/debugger/DevToolsUtils.js b/cocos/scripting/javascript/script/debugger/DevToolsUtils.js similarity index 100% rename from cocos/scripting/javascript/bindings/js/debugger/DevToolsUtils.js rename to cocos/scripting/javascript/script/debugger/DevToolsUtils.js diff --git a/cocos/scripting/javascript/bindings/js/debugger/README.md b/cocos/scripting/javascript/script/debugger/README.md similarity index 100% rename from cocos/scripting/javascript/bindings/js/debugger/README.md rename to cocos/scripting/javascript/script/debugger/README.md diff --git a/cocos/scripting/javascript/bindings/js/debugger/actors/root.js b/cocos/scripting/javascript/script/debugger/actors/root.js similarity index 100% rename from cocos/scripting/javascript/bindings/js/debugger/actors/root.js rename to cocos/scripting/javascript/script/debugger/actors/root.js diff --git a/cocos/scripting/javascript/bindings/js/debugger/actors/script.js b/cocos/scripting/javascript/script/debugger/actors/script.js similarity index 100% rename from cocos/scripting/javascript/bindings/js/debugger/actors/script.js rename to cocos/scripting/javascript/script/debugger/actors/script.js diff --git a/cocos/scripting/javascript/bindings/js/debugger/core/promise.js b/cocos/scripting/javascript/script/debugger/core/promise.js similarity index 100% rename from cocos/scripting/javascript/bindings/js/debugger/core/promise.js rename to cocos/scripting/javascript/script/debugger/core/promise.js diff --git a/cocos/scripting/javascript/bindings/js/debugger/main.js b/cocos/scripting/javascript/script/debugger/main.js similarity index 100% rename from cocos/scripting/javascript/bindings/js/debugger/main.js rename to cocos/scripting/javascript/script/debugger/main.js diff --git a/cocos/scripting/javascript/bindings/js/debugger/transport.js b/cocos/scripting/javascript/script/debugger/transport.js similarity index 100% rename from cocos/scripting/javascript/bindings/js/debugger/transport.js rename to cocos/scripting/javascript/script/debugger/transport.js diff --git a/cocos/scripting/javascript/bindings/js/jsb.js b/cocos/scripting/javascript/script/jsb.js similarity index 100% rename from cocos/scripting/javascript/bindings/js/jsb.js rename to cocos/scripting/javascript/script/jsb.js diff --git a/cocos/scripting/javascript/bindings/js/jsb_chipmunk.js b/cocos/scripting/javascript/script/jsb_chipmunk.js similarity index 100% rename from cocos/scripting/javascript/bindings/js/jsb_chipmunk.js rename to cocos/scripting/javascript/script/jsb_chipmunk.js diff --git a/cocos/scripting/javascript/bindings/js/jsb_chipmunk_constants.js b/cocos/scripting/javascript/script/jsb_chipmunk_constants.js similarity index 100% rename from cocos/scripting/javascript/bindings/js/jsb_chipmunk_constants.js rename to cocos/scripting/javascript/script/jsb_chipmunk_constants.js diff --git a/cocos/scripting/javascript/bindings/js/jsb_cocos2d.js b/cocos/scripting/javascript/script/jsb_cocos2d.js similarity index 100% rename from cocos/scripting/javascript/bindings/js/jsb_cocos2d.js rename to cocos/scripting/javascript/script/jsb_cocos2d.js diff --git a/cocos/scripting/javascript/bindings/js/jsb_cocos2d_constants.js b/cocos/scripting/javascript/script/jsb_cocos2d_constants.js similarity index 100% rename from cocos/scripting/javascript/bindings/js/jsb_cocos2d_constants.js rename to cocos/scripting/javascript/script/jsb_cocos2d_constants.js diff --git a/cocos/scripting/javascript/bindings/js/jsb_cocos2d_extension.js b/cocos/scripting/javascript/script/jsb_cocos2d_extension.js similarity index 100% rename from cocos/scripting/javascript/bindings/js/jsb_cocos2d_extension.js rename to cocos/scripting/javascript/script/jsb_cocos2d_extension.js diff --git a/cocos/scripting/javascript/bindings/js/jsb_cocosbuilder.js b/cocos/scripting/javascript/script/jsb_cocosbuilder.js similarity index 100% rename from cocos/scripting/javascript/bindings/js/jsb_cocosbuilder.js rename to cocos/scripting/javascript/script/jsb_cocosbuilder.js diff --git a/cocos/scripting/javascript/bindings/js/jsb_debugger.js b/cocos/scripting/javascript/script/jsb_debugger.js similarity index 100% rename from cocos/scripting/javascript/bindings/js/jsb_debugger.js rename to cocos/scripting/javascript/script/jsb_debugger.js diff --git a/cocos/scripting/javascript/bindings/js/jsb_deprecated.js b/cocos/scripting/javascript/script/jsb_deprecated.js similarity index 100% rename from cocos/scripting/javascript/bindings/js/jsb_deprecated.js rename to cocos/scripting/javascript/script/jsb_deprecated.js diff --git a/cocos/scripting/javascript/bindings/js/jsb_opengl.js b/cocos/scripting/javascript/script/jsb_opengl.js similarity index 100% rename from cocos/scripting/javascript/bindings/js/jsb_opengl.js rename to cocos/scripting/javascript/script/jsb_opengl.js diff --git a/cocos/scripting/javascript/bindings/js/jsb_opengl_constants.js b/cocos/scripting/javascript/script/jsb_opengl_constants.js similarity index 100% rename from cocos/scripting/javascript/bindings/js/jsb_opengl_constants.js rename to cocos/scripting/javascript/script/jsb_opengl_constants.js diff --git a/cocos/scripting/javascript/bindings/js/jsb_sys.js b/cocos/scripting/javascript/script/jsb_sys.js similarity index 100% rename from cocos/scripting/javascript/bindings/js/jsb_sys.js rename to cocos/scripting/javascript/script/jsb_sys.js From f6275667bfbb3990f8728a6d6113ad60b9d1a220 Mon Sep 17 00:00:00 2001 From: James Chen Date: Sat, 12 Oct 2013 15:02:28 +0800 Subject: [PATCH 21/64] Removing unused ios projects. --- .../bindings/proj.ios/jsbindings-Prefix.pch | 7 - .../jsbindings.xcodeproj/project.pbxproj | 673 ------------------ .../bindings/proj.mac/jsbindings-Prefix.pch | 7 - .../jsbindings.xcodeproj/project.pbxproj | 651 ----------------- .../luabindings.xcodeproj/project.pbxproj | 453 ------------ .../HelloLua.xcodeproj/project.pbxproj | 491 ------------- .../TestLua.xcodeproj/project.pbxproj | 573 --------------- 7 files changed, 2855 deletions(-) delete mode 100644 cocos/scripting/javascript/bindings/proj.ios/jsbindings-Prefix.pch delete mode 100644 cocos/scripting/javascript/bindings/proj.ios/jsbindings.xcodeproj/project.pbxproj delete mode 100644 cocos/scripting/javascript/bindings/proj.mac/jsbindings-Prefix.pch delete mode 100644 cocos/scripting/javascript/bindings/proj.mac/jsbindings.xcodeproj/project.pbxproj delete mode 100644 cocos/scripting/lua/proj.ios/luabindings.xcodeproj/project.pbxproj delete mode 100644 samples/Lua/HelloLua/proj.ios/HelloLua.xcodeproj/project.pbxproj delete mode 100644 samples/Lua/TestLua/proj.ios/TestLua.xcodeproj/project.pbxproj diff --git a/cocos/scripting/javascript/bindings/proj.ios/jsbindings-Prefix.pch b/cocos/scripting/javascript/bindings/proj.ios/jsbindings-Prefix.pch deleted file mode 100644 index af8c4a19d5..0000000000 --- a/cocos/scripting/javascript/bindings/proj.ios/jsbindings-Prefix.pch +++ /dev/null @@ -1,7 +0,0 @@ -// -// Prefix header for all source files of the 'jsbindings' target in the 'jsbindings' project -// - -#ifdef __OBJC__ - #import -#endif diff --git a/cocos/scripting/javascript/bindings/proj.ios/jsbindings.xcodeproj/project.pbxproj b/cocos/scripting/javascript/bindings/proj.ios/jsbindings.xcodeproj/project.pbxproj deleted file mode 100644 index cb9d02ae01..0000000000 --- a/cocos/scripting/javascript/bindings/proj.ios/jsbindings.xcodeproj/project.pbxproj +++ /dev/null @@ -1,673 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 1A0C0E8B1778088700838530 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A0C0E8A1778088700838530 /* Foundation.framework */; }; - 1A0C0EDA1778095000838530 /* cocos2d_specifics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E991778095000838530 /* cocos2d_specifics.cpp */; }; - 1A0C0EDB1778095000838530 /* cocosjs_manual_conversions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E9B1778095000838530 /* cocosjs_manual_conversions.cpp */; }; - 1A0C0EDC1778095000838530 /* jsb_cocos2dx_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E9E1778095000838530 /* jsb_cocos2dx_auto.cpp */; }; - 1A0C0EEC1778095000838530 /* js_bindings_ccbreader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0EB21778095000838530 /* js_bindings_ccbreader.cpp */; }; - 1A0C0EED1778095000838530 /* js_bindings_chipmunk_auto_classes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0EB51778095000838530 /* js_bindings_chipmunk_auto_classes.cpp */; }; - 1A0C0EEE1778095000838530 /* js_bindings_chipmunk_functions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0EB81778095000838530 /* js_bindings_chipmunk_functions.cpp */; }; - 1A0C0EEF1778095000838530 /* js_bindings_chipmunk_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0EBA1778095000838530 /* js_bindings_chipmunk_manual.cpp */; }; - 1A0C0EF01778095000838530 /* js_bindings_chipmunk_registration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0EBC1778095000838530 /* js_bindings_chipmunk_registration.cpp */; }; - 1A0C0EF11778095000838530 /* js_bindings_core.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0EBF1778095000838530 /* js_bindings_core.cpp */; }; - 1A0C0EF21778095000838530 /* js_bindings_opengl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0EC11778095000838530 /* js_bindings_opengl.cpp */; }; - 1A0C0EF31778095000838530 /* js_bindings_system_functions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0EC41778095000838530 /* js_bindings_system_functions.cpp */; }; - 1A0C0EF41778095000838530 /* js_bindings_system_registration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0EC61778095000838530 /* js_bindings_system_registration.cpp */; }; - 1A0C0EF51778095000838530 /* js_manual_conversions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0EC81778095000838530 /* js_manual_conversions.cpp */; }; - 1A0C0EF61778095000838530 /* jsb_cocos2dx_extension_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0ECA1778095000838530 /* jsb_cocos2dx_extension_manual.cpp */; }; - 1A0C0EF71778095000838530 /* jsb_opengl_functions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0ECD1778095000838530 /* jsb_opengl_functions.cpp */; }; - 1A0C0EF81778095000838530 /* jsb_opengl_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0ECF1778095000838530 /* jsb_opengl_manual.cpp */; }; - 1A0C0EF91778095000838530 /* jsb_opengl_registration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0ED11778095000838530 /* jsb_opengl_registration.cpp */; }; - 1A0C0EFA1778095000838530 /* jsb_websocket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0ED31778095000838530 /* jsb_websocket.cpp */; }; - 1A0C0EFB1778095000838530 /* ScriptingCore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0ED51778095000838530 /* ScriptingCore.cpp */; }; - 1A0C0EFC1778095000838530 /* XMLHTTPRequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0ED81778095000838530 /* XMLHTTPRequest.cpp */; }; - 1A0C0F4917780A9700838530 /* libjs_static.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A0C0F4817780A9700838530 /* libjs_static.a */; }; - 1A6E46D51778162E0055514D /* jsb_cocos2dx_extension_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0EA11778095000838530 /* jsb_cocos2dx_extension_auto.cpp */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 1A0C0E851778088700838530 /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 16; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 1A0C0E871778088700838530 /* libjsbindings.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libjsbindings.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 1A0C0E8A1778088700838530 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; - 1A0C0E991778095000838530 /* cocos2d_specifics.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = cocos2d_specifics.cpp; path = ../cocos2d_specifics.cpp; sourceTree = ""; }; - 1A0C0E9A1778095000838530 /* cocos2d_specifics.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = cocos2d_specifics.hpp; path = ../cocos2d_specifics.hpp; sourceTree = ""; }; - 1A0C0E9B1778095000838530 /* cocosjs_manual_conversions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = cocosjs_manual_conversions.cpp; path = ../cocosjs_manual_conversions.cpp; sourceTree = ""; }; - 1A0C0E9C1778095000838530 /* cocosjs_manual_conversions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = cocosjs_manual_conversions.h; path = ../cocosjs_manual_conversions.h; sourceTree = ""; }; - 1A0C0E9E1778095000838530 /* jsb_cocos2dx_auto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = jsb_cocos2dx_auto.cpp; sourceTree = ""; }; - 1A0C0E9F1778095000838530 /* jsb_cocos2dx_auto.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = jsb_cocos2dx_auto.hpp; sourceTree = ""; }; - 1A0C0EA01778095000838530 /* jsb_cocos2dx_auto_api.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jsb_cocos2dx_auto_api.js; sourceTree = ""; }; - 1A0C0EA11778095000838530 /* jsb_cocos2dx_extension_auto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = jsb_cocos2dx_extension_auto.cpp; sourceTree = ""; }; - 1A0C0EA21778095000838530 /* jsb_cocos2dx_extension_auto.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = jsb_cocos2dx_extension_auto.hpp; sourceTree = ""; }; - 1A0C0EA31778095000838530 /* jsb_cocos2dx_extension_auto_api.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jsb_cocos2dx_extension_auto_api.js; sourceTree = ""; }; - 1A0C0EA41778095000838530 /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = ""; }; - 1A0C0EA61778095000838530 /* jsb.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jsb.js; sourceTree = ""; }; - 1A0C0EA71778095000838530 /* jsb_chipmunk.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jsb_chipmunk.js; sourceTree = ""; }; - 1A0C0EA81778095000838530 /* jsb_chipmunk_constants.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jsb_chipmunk_constants.js; sourceTree = ""; }; - 1A0C0EA91778095000838530 /* jsb_cocos2d.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jsb_cocos2d.js; sourceTree = ""; }; - 1A0C0EAA1778095000838530 /* jsb_cocos2d_constants.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jsb_cocos2d_constants.js; sourceTree = ""; }; - 1A0C0EAB1778095000838530 /* jsb_cocos2d_extension.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jsb_cocos2d_extension.js; sourceTree = ""; }; - 1A0C0EAC1778095000838530 /* jsb_cocosbuilder.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jsb_cocosbuilder.js; sourceTree = ""; }; - 1A0C0EAD1778095000838530 /* jsb_debugger.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jsb_debugger.js; sourceTree = ""; }; - 1A0C0EAE1778095000838530 /* jsb_opengl.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jsb_opengl.js; sourceTree = ""; }; - 1A0C0EAF1778095000838530 /* jsb_opengl_constants.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jsb_opengl_constants.js; sourceTree = ""; }; - 1A0C0EB01778095000838530 /* jsb_sys.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jsb_sys.js; sourceTree = ""; }; - 1A0C0EB11778095000838530 /* main.debug.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = main.debug.js; sourceTree = ""; }; - 1A0C0EB21778095000838530 /* js_bindings_ccbreader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = js_bindings_ccbreader.cpp; path = ../js_bindings_ccbreader.cpp; sourceTree = ""; }; - 1A0C0EB31778095000838530 /* js_bindings_ccbreader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = js_bindings_ccbreader.h; path = ../js_bindings_ccbreader.h; sourceTree = ""; }; - 1A0C0EB41778095000838530 /* js_bindings_chipmunk_auto_classes_registration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = js_bindings_chipmunk_auto_classes_registration.h; path = ../js_bindings_chipmunk_auto_classes_registration.h; sourceTree = ""; }; - 1A0C0EB51778095000838530 /* js_bindings_chipmunk_auto_classes.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = js_bindings_chipmunk_auto_classes.cpp; path = ../js_bindings_chipmunk_auto_classes.cpp; sourceTree = ""; }; - 1A0C0EB61778095000838530 /* js_bindings_chipmunk_auto_classes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = js_bindings_chipmunk_auto_classes.h; path = ../js_bindings_chipmunk_auto_classes.h; sourceTree = ""; }; - 1A0C0EB71778095000838530 /* js_bindings_chipmunk_functions_registration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = js_bindings_chipmunk_functions_registration.h; path = ../js_bindings_chipmunk_functions_registration.h; sourceTree = ""; }; - 1A0C0EB81778095000838530 /* js_bindings_chipmunk_functions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = js_bindings_chipmunk_functions.cpp; path = ../js_bindings_chipmunk_functions.cpp; sourceTree = ""; }; - 1A0C0EB91778095000838530 /* js_bindings_chipmunk_functions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = js_bindings_chipmunk_functions.h; path = ../js_bindings_chipmunk_functions.h; sourceTree = ""; }; - 1A0C0EBA1778095000838530 /* js_bindings_chipmunk_manual.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = js_bindings_chipmunk_manual.cpp; path = ../js_bindings_chipmunk_manual.cpp; sourceTree = ""; }; - 1A0C0EBB1778095000838530 /* js_bindings_chipmunk_manual.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = js_bindings_chipmunk_manual.h; path = ../js_bindings_chipmunk_manual.h; sourceTree = ""; }; - 1A0C0EBC1778095000838530 /* js_bindings_chipmunk_registration.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = js_bindings_chipmunk_registration.cpp; path = ../js_bindings_chipmunk_registration.cpp; sourceTree = ""; }; - 1A0C0EBD1778095000838530 /* js_bindings_chipmunk_registration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = js_bindings_chipmunk_registration.h; path = ../js_bindings_chipmunk_registration.h; sourceTree = ""; }; - 1A0C0EBE1778095000838530 /* js_bindings_config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = js_bindings_config.h; path = ../js_bindings_config.h; sourceTree = ""; }; - 1A0C0EBF1778095000838530 /* js_bindings_core.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = js_bindings_core.cpp; path = ../js_bindings_core.cpp; sourceTree = ""; }; - 1A0C0EC01778095000838530 /* js_bindings_core.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = js_bindings_core.h; path = ../js_bindings_core.h; sourceTree = ""; }; - 1A0C0EC11778095000838530 /* js_bindings_opengl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = js_bindings_opengl.cpp; path = ../js_bindings_opengl.cpp; sourceTree = ""; }; - 1A0C0EC21778095000838530 /* js_bindings_opengl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = js_bindings_opengl.h; path = ../js_bindings_opengl.h; sourceTree = ""; }; - 1A0C0EC31778095000838530 /* js_bindings_system_functions_registration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = js_bindings_system_functions_registration.h; path = ../js_bindings_system_functions_registration.h; sourceTree = ""; }; - 1A0C0EC41778095000838530 /* js_bindings_system_functions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = js_bindings_system_functions.cpp; path = ../js_bindings_system_functions.cpp; sourceTree = ""; }; - 1A0C0EC51778095000838530 /* js_bindings_system_functions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = js_bindings_system_functions.h; path = ../js_bindings_system_functions.h; sourceTree = ""; }; - 1A0C0EC61778095000838530 /* js_bindings_system_registration.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = js_bindings_system_registration.cpp; path = ../js_bindings_system_registration.cpp; sourceTree = ""; }; - 1A0C0EC71778095000838530 /* js_bindings_system_registration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = js_bindings_system_registration.h; path = ../js_bindings_system_registration.h; sourceTree = ""; }; - 1A0C0EC81778095000838530 /* js_manual_conversions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = js_manual_conversions.cpp; path = ../js_manual_conversions.cpp; sourceTree = ""; }; - 1A0C0EC91778095000838530 /* js_manual_conversions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = js_manual_conversions.h; path = ../js_manual_conversions.h; sourceTree = ""; }; - 1A0C0ECA1778095000838530 /* jsb_cocos2dx_extension_manual.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = jsb_cocos2dx_extension_manual.cpp; path = ../jsb_cocos2dx_extension_manual.cpp; sourceTree = ""; }; - 1A0C0ECB1778095000838530 /* jsb_cocos2dx_extension_manual.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = jsb_cocos2dx_extension_manual.h; path = ../jsb_cocos2dx_extension_manual.h; sourceTree = ""; }; - 1A0C0ECC1778095000838530 /* jsb_helper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = jsb_helper.h; path = ../jsb_helper.h; sourceTree = ""; }; - 1A0C0ECD1778095000838530 /* jsb_opengl_functions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = jsb_opengl_functions.cpp; path = ../jsb_opengl_functions.cpp; sourceTree = ""; }; - 1A0C0ECE1778095000838530 /* jsb_opengl_functions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = jsb_opengl_functions.h; path = ../jsb_opengl_functions.h; sourceTree = ""; }; - 1A0C0ECF1778095000838530 /* jsb_opengl_manual.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = jsb_opengl_manual.cpp; path = ../jsb_opengl_manual.cpp; sourceTree = ""; }; - 1A0C0ED01778095000838530 /* jsb_opengl_manual.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = jsb_opengl_manual.h; path = ../jsb_opengl_manual.h; sourceTree = ""; }; - 1A0C0ED11778095000838530 /* jsb_opengl_registration.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = jsb_opengl_registration.cpp; path = ../jsb_opengl_registration.cpp; sourceTree = ""; }; - 1A0C0ED21778095000838530 /* jsb_opengl_registration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = jsb_opengl_registration.h; path = ../jsb_opengl_registration.h; sourceTree = ""; }; - 1A0C0ED31778095000838530 /* jsb_websocket.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = jsb_websocket.cpp; path = ../jsb_websocket.cpp; sourceTree = ""; }; - 1A0C0ED41778095000838530 /* jsb_websocket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = jsb_websocket.h; path = ../jsb_websocket.h; sourceTree = ""; }; - 1A0C0ED51778095000838530 /* ScriptingCore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScriptingCore.cpp; path = ../ScriptingCore.cpp; sourceTree = ""; }; - 1A0C0ED61778095000838530 /* ScriptingCore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ScriptingCore.h; path = ../ScriptingCore.h; sourceTree = ""; }; - 1A0C0ED71778095000838530 /* spidermonkey_specifics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = spidermonkey_specifics.h; path = ../spidermonkey_specifics.h; sourceTree = ""; }; - 1A0C0ED81778095000838530 /* XMLHTTPRequest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = XMLHTTPRequest.cpp; path = ../XMLHTTPRequest.cpp; sourceTree = ""; }; - 1A0C0ED91778095000838530 /* XMLHTTPRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = XMLHTTPRequest.h; path = ../XMLHTTPRequest.h; sourceTree = ""; }; - 1A0C0F0017780A9700838530 /* BitArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BitArray.h; sourceTree = ""; }; - 1A0C0F0217780A9700838530 /* Root.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Root.h; sourceTree = ""; }; - 1A0C0F0417780A9700838530 /* Anchor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Anchor.h; sourceTree = ""; }; - 1A0C0F0517780A9700838530 /* CharacterEncoding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CharacterEncoding.h; sourceTree = ""; }; - 1A0C0F0617780A9700838530 /* GCAPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GCAPI.h; sourceTree = ""; }; - 1A0C0F0717780A9700838530 /* HashTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HashTable.h; sourceTree = ""; }; - 1A0C0F0817780A9700838530 /* HeapAPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HeapAPI.h; sourceTree = ""; }; - 1A0C0F0917780A9700838530 /* LegacyIntTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LegacyIntTypes.h; sourceTree = ""; }; - 1A0C0F0A17780A9700838530 /* MemoryMetrics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemoryMetrics.h; sourceTree = ""; }; - 1A0C0F0B17780A9700838530 /* PropertyKey.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PropertyKey.h; sourceTree = ""; }; - 1A0C0F0C17780A9700838530 /* RequiredDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RequiredDefines.h; sourceTree = ""; }; - 1A0C0F0D17780A9700838530 /* TemplateLib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TemplateLib.h; sourceTree = ""; }; - 1A0C0F0E17780A9700838530 /* Utility.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Utility.h; sourceTree = ""; }; - 1A0C0F0F17780A9700838530 /* Value.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Value.h; sourceTree = ""; }; - 1A0C0F1017780A9700838530 /* Vector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Vector.h; sourceTree = ""; }; - 1A0C0F1117780A9700838530 /* js-config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "js-config.h"; sourceTree = ""; }; - 1A0C0F1217780A9700838530 /* js.msg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = js.msg; sourceTree = ""; }; - 1A0C0F1317780A9700838530 /* jsalloc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsalloc.h; sourceTree = ""; }; - 1A0C0F1417780A9700838530 /* jsapi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsapi.h; sourceTree = ""; }; - 1A0C0F1517780A9700838530 /* jsclass.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsclass.h; sourceTree = ""; }; - 1A0C0F1617780A9700838530 /* jsclist.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsclist.h; sourceTree = ""; }; - 1A0C0F1717780A9700838530 /* jscpucfg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jscpucfg.h; sourceTree = ""; }; - 1A0C0F1817780A9700838530 /* jsdbgapi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsdbgapi.h; sourceTree = ""; }; - 1A0C0F1917780A9700838530 /* jsdhash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsdhash.h; sourceTree = ""; }; - 1A0C0F1A17780A9700838530 /* jsfriendapi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsfriendapi.h; sourceTree = ""; }; - 1A0C0F1B17780A9700838530 /* jslock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jslock.h; sourceTree = ""; }; - 1A0C0F1C17780A9700838530 /* json.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = json.h; sourceTree = ""; }; - 1A0C0F1D17780A9700838530 /* jsperf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsperf.h; sourceTree = ""; }; - 1A0C0F1E17780A9700838530 /* jsprf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsprf.h; sourceTree = ""; }; - 1A0C0F1F17780A9700838530 /* jsprototypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsprototypes.h; sourceTree = ""; }; - 1A0C0F2017780A9700838530 /* jsproxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsproxy.h; sourceTree = ""; }; - 1A0C0F2117780A9700838530 /* jsprvtd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsprvtd.h; sourceTree = ""; }; - 1A0C0F2217780A9700838530 /* jspubtd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jspubtd.h; sourceTree = ""; }; - 1A0C0F2317780A9700838530 /* jstypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jstypes.h; sourceTree = ""; }; - 1A0C0F2417780A9700838530 /* jsutil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsutil.h; sourceTree = ""; }; - 1A0C0F2517780A9700838530 /* jsversion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsversion.h; sourceTree = ""; }; - 1A0C0F2617780A9700838530 /* jswrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jswrapper.h; sourceTree = ""; }; - 1A0C0F2817780A9700838530 /* Assertions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Assertions.h; sourceTree = ""; }; - 1A0C0F2917780A9700838530 /* Attributes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Attributes.h; sourceTree = ""; }; - 1A0C0F2A17780A9700838530 /* BloomFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BloomFilter.h; sourceTree = ""; }; - 1A0C0F2B17780A9700838530 /* Char16.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Char16.h; sourceTree = ""; }; - 1A0C0F2C17780A9700838530 /* CheckedInt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CheckedInt.h; sourceTree = ""; }; - 1A0C0F2D17780A9700838530 /* Compiler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Compiler.h; sourceTree = ""; }; - 1A0C0F2E17780A9700838530 /* Constants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Constants.h; sourceTree = ""; }; - 1A0C0F2F17780A9700838530 /* DebugOnly.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DebugOnly.h; sourceTree = ""; }; - 1A0C0F3017780A9700838530 /* EnumSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EnumSet.h; sourceTree = ""; }; - 1A0C0F3117780A9700838530 /* FloatingPoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FloatingPoint.h; sourceTree = ""; }; - 1A0C0F3217780A9700838530 /* GuardObjects.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GuardObjects.h; sourceTree = ""; }; - 1A0C0F3317780A9700838530 /* HashFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HashFunctions.h; sourceTree = ""; }; - 1A0C0F3417780A9700838530 /* Likely.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Likely.h; sourceTree = ""; }; - 1A0C0F3517780A9700838530 /* LinkedList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LinkedList.h; sourceTree = ""; }; - 1A0C0F3617780A9700838530 /* MathAlgorithms.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MathAlgorithms.h; sourceTree = ""; }; - 1A0C0F3717780A9700838530 /* MemoryChecking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemoryChecking.h; sourceTree = ""; }; - 1A0C0F3817780A9700838530 /* MSStdInt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MSStdInt.h; sourceTree = ""; }; - 1A0C0F3917780A9700838530 /* NullPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NullPtr.h; sourceTree = ""; }; - 1A0C0F3A17780A9700838530 /* Range.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Range.h; sourceTree = ""; }; - 1A0C0F3B17780A9700838530 /* RangedPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RangedPtr.h; sourceTree = ""; }; - 1A0C0F3C17780A9700838530 /* RefPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RefPtr.h; sourceTree = ""; }; - 1A0C0F3D17780A9700838530 /* Scoped.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Scoped.h; sourceTree = ""; }; - 1A0C0F3E17780A9700838530 /* SHA1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SHA1.h; sourceTree = ""; }; - 1A0C0F3F17780A9700838530 /* SplayTree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SplayTree.h; sourceTree = ""; }; - 1A0C0F4017780A9700838530 /* StandardInteger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StandardInteger.h; sourceTree = ""; }; - 1A0C0F4117780A9700838530 /* ThreadLocal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThreadLocal.h; sourceTree = ""; }; - 1A0C0F4217780A9700838530 /* TypedEnum.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TypedEnum.h; sourceTree = ""; }; - 1A0C0F4317780A9700838530 /* Types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Types.h; sourceTree = ""; }; - 1A0C0F4417780A9700838530 /* TypeTraits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TypeTraits.h; sourceTree = ""; }; - 1A0C0F4517780A9700838530 /* Util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Util.h; sourceTree = ""; }; - 1A0C0F4617780A9700838530 /* WeakPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WeakPtr.h; sourceTree = ""; }; - 1A0C0F4817780A9700838530 /* libjs_static.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libjs_static.a; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 1A0C0E841778088700838530 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 1A0C0E8B1778088700838530 /* Foundation.framework in Frameworks */, - 1A0C0F4917780A9700838530 /* libjs_static.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 1A0C0E7E1778088700838530 = { - isa = PBXGroup; - children = ( - 1A0C0E981778093E00838530 /* bindings */, - 1A0C0E891778088700838530 /* Frameworks */, - 1A0C0E881778088700838530 /* Products */, - ); - sourceTree = ""; - }; - 1A0C0E881778088700838530 /* Products */ = { - isa = PBXGroup; - children = ( - 1A0C0E871778088700838530 /* libjsbindings.a */, - ); - name = Products; - sourceTree = ""; - }; - 1A0C0E891778088700838530 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 1A0C0EFD17780A9700838530 /* spidermonkey-ios */, - 1A0C0E8A1778088700838530 /* Foundation.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - 1A0C0E981778093E00838530 /* bindings */ = { - isa = PBXGroup; - children = ( - 1A0C0E991778095000838530 /* cocos2d_specifics.cpp */, - 1A0C0E9A1778095000838530 /* cocos2d_specifics.hpp */, - 1A0C0E9B1778095000838530 /* cocosjs_manual_conversions.cpp */, - 1A0C0E9C1778095000838530 /* cocosjs_manual_conversions.h */, - 1A0C0E9D1778095000838530 /* generated */, - 1A0C0EA51778095000838530 /* js */, - 1A0C0EB21778095000838530 /* js_bindings_ccbreader.cpp */, - 1A0C0EB31778095000838530 /* js_bindings_ccbreader.h */, - 1A0C0EB41778095000838530 /* js_bindings_chipmunk_auto_classes_registration.h */, - 1A0C0EB51778095000838530 /* js_bindings_chipmunk_auto_classes.cpp */, - 1A0C0EB61778095000838530 /* js_bindings_chipmunk_auto_classes.h */, - 1A0C0EB71778095000838530 /* js_bindings_chipmunk_functions_registration.h */, - 1A0C0EB81778095000838530 /* js_bindings_chipmunk_functions.cpp */, - 1A0C0EB91778095000838530 /* js_bindings_chipmunk_functions.h */, - 1A0C0EBA1778095000838530 /* js_bindings_chipmunk_manual.cpp */, - 1A0C0EBB1778095000838530 /* js_bindings_chipmunk_manual.h */, - 1A0C0EBC1778095000838530 /* js_bindings_chipmunk_registration.cpp */, - 1A0C0EBD1778095000838530 /* js_bindings_chipmunk_registration.h */, - 1A0C0EBE1778095000838530 /* js_bindings_config.h */, - 1A0C0EBF1778095000838530 /* js_bindings_core.cpp */, - 1A0C0EC01778095000838530 /* js_bindings_core.h */, - 1A0C0EC11778095000838530 /* js_bindings_opengl.cpp */, - 1A0C0EC21778095000838530 /* js_bindings_opengl.h */, - 1A0C0EC31778095000838530 /* js_bindings_system_functions_registration.h */, - 1A0C0EC41778095000838530 /* js_bindings_system_functions.cpp */, - 1A0C0EC51778095000838530 /* js_bindings_system_functions.h */, - 1A0C0EC61778095000838530 /* js_bindings_system_registration.cpp */, - 1A0C0EC71778095000838530 /* js_bindings_system_registration.h */, - 1A0C0EC81778095000838530 /* js_manual_conversions.cpp */, - 1A0C0EC91778095000838530 /* js_manual_conversions.h */, - 1A0C0ECA1778095000838530 /* jsb_cocos2dx_extension_manual.cpp */, - 1A0C0ECB1778095000838530 /* jsb_cocos2dx_extension_manual.h */, - 1A0C0ECC1778095000838530 /* jsb_helper.h */, - 1A0C0ECD1778095000838530 /* jsb_opengl_functions.cpp */, - 1A0C0ECE1778095000838530 /* jsb_opengl_functions.h */, - 1A0C0ECF1778095000838530 /* jsb_opengl_manual.cpp */, - 1A0C0ED01778095000838530 /* jsb_opengl_manual.h */, - 1A0C0ED11778095000838530 /* jsb_opengl_registration.cpp */, - 1A0C0ED21778095000838530 /* jsb_opengl_registration.h */, - 1A0C0ED31778095000838530 /* jsb_websocket.cpp */, - 1A0C0ED41778095000838530 /* jsb_websocket.h */, - 1A0C0ED51778095000838530 /* ScriptingCore.cpp */, - 1A0C0ED61778095000838530 /* ScriptingCore.h */, - 1A0C0ED71778095000838530 /* spidermonkey_specifics.h */, - 1A0C0ED81778095000838530 /* XMLHTTPRequest.cpp */, - 1A0C0ED91778095000838530 /* XMLHTTPRequest.h */, - ); - name = bindings; - sourceTree = ""; - }; - 1A0C0E9D1778095000838530 /* generated */ = { - isa = PBXGroup; - children = ( - 1A0C0E9E1778095000838530 /* jsb_cocos2dx_auto.cpp */, - 1A0C0E9F1778095000838530 /* jsb_cocos2dx_auto.hpp */, - 1A0C0EA01778095000838530 /* jsb_cocos2dx_auto_api.js */, - 1A0C0EA11778095000838530 /* jsb_cocos2dx_extension_auto.cpp */, - 1A0C0EA21778095000838530 /* jsb_cocos2dx_extension_auto.hpp */, - 1A0C0EA31778095000838530 /* jsb_cocos2dx_extension_auto_api.js */, - 1A0C0EA41778095000838530 /* README */, - ); - name = generated; - path = ../generated; - sourceTree = ""; - }; - 1A0C0EA51778095000838530 /* js */ = { - isa = PBXGroup; - children = ( - 1A0C0EA61778095000838530 /* jsb.js */, - 1A0C0EA71778095000838530 /* jsb_chipmunk.js */, - 1A0C0EA81778095000838530 /* jsb_chipmunk_constants.js */, - 1A0C0EA91778095000838530 /* jsb_cocos2d.js */, - 1A0C0EAA1778095000838530 /* jsb_cocos2d_constants.js */, - 1A0C0EAB1778095000838530 /* jsb_cocos2d_extension.js */, - 1A0C0EAC1778095000838530 /* jsb_cocosbuilder.js */, - 1A0C0EAD1778095000838530 /* jsb_debugger.js */, - 1A0C0EAE1778095000838530 /* jsb_opengl.js */, - 1A0C0EAF1778095000838530 /* jsb_opengl_constants.js */, - 1A0C0EB01778095000838530 /* jsb_sys.js */, - 1A0C0EB11778095000838530 /* main.debug.js */, - ); - name = js; - path = ../js; - sourceTree = ""; - }; - 1A0C0EFD17780A9700838530 /* spidermonkey-ios */ = { - isa = PBXGroup; - children = ( - 1A0C0EFE17780A9700838530 /* include */, - 1A0C0F4717780A9700838530 /* lib */, - ); - name = "spidermonkey-ios"; - path = "../../spidermonkey-ios"; - sourceTree = ""; - }; - 1A0C0EFE17780A9700838530 /* include */ = { - isa = PBXGroup; - children = ( - 1A0C0EFF17780A9700838530 /* ds */, - 1A0C0F0117780A9700838530 /* gc */, - 1A0C0F0317780A9700838530 /* js */, - 1A0C0F1117780A9700838530 /* js-config.h */, - 1A0C0F1217780A9700838530 /* js.msg */, - 1A0C0F1317780A9700838530 /* jsalloc.h */, - 1A0C0F1417780A9700838530 /* jsapi.h */, - 1A0C0F1517780A9700838530 /* jsclass.h */, - 1A0C0F1617780A9700838530 /* jsclist.h */, - 1A0C0F1717780A9700838530 /* jscpucfg.h */, - 1A0C0F1817780A9700838530 /* jsdbgapi.h */, - 1A0C0F1917780A9700838530 /* jsdhash.h */, - 1A0C0F1A17780A9700838530 /* jsfriendapi.h */, - 1A0C0F1B17780A9700838530 /* jslock.h */, - 1A0C0F1C17780A9700838530 /* json.h */, - 1A0C0F1D17780A9700838530 /* jsperf.h */, - 1A0C0F1E17780A9700838530 /* jsprf.h */, - 1A0C0F1F17780A9700838530 /* jsprototypes.h */, - 1A0C0F2017780A9700838530 /* jsproxy.h */, - 1A0C0F2117780A9700838530 /* jsprvtd.h */, - 1A0C0F2217780A9700838530 /* jspubtd.h */, - 1A0C0F2317780A9700838530 /* jstypes.h */, - 1A0C0F2417780A9700838530 /* jsutil.h */, - 1A0C0F2517780A9700838530 /* jsversion.h */, - 1A0C0F2617780A9700838530 /* jswrapper.h */, - 1A0C0F2717780A9700838530 /* mozilla */, - ); - path = include; - sourceTree = ""; - }; - 1A0C0EFF17780A9700838530 /* ds */ = { - isa = PBXGroup; - children = ( - 1A0C0F0017780A9700838530 /* BitArray.h */, - ); - path = ds; - sourceTree = ""; - }; - 1A0C0F0117780A9700838530 /* gc */ = { - isa = PBXGroup; - children = ( - 1A0C0F0217780A9700838530 /* Root.h */, - ); - path = gc; - sourceTree = ""; - }; - 1A0C0F0317780A9700838530 /* js */ = { - isa = PBXGroup; - children = ( - 1A0C0F0417780A9700838530 /* Anchor.h */, - 1A0C0F0517780A9700838530 /* CharacterEncoding.h */, - 1A0C0F0617780A9700838530 /* GCAPI.h */, - 1A0C0F0717780A9700838530 /* HashTable.h */, - 1A0C0F0817780A9700838530 /* HeapAPI.h */, - 1A0C0F0917780A9700838530 /* LegacyIntTypes.h */, - 1A0C0F0A17780A9700838530 /* MemoryMetrics.h */, - 1A0C0F0B17780A9700838530 /* PropertyKey.h */, - 1A0C0F0C17780A9700838530 /* RequiredDefines.h */, - 1A0C0F0D17780A9700838530 /* TemplateLib.h */, - 1A0C0F0E17780A9700838530 /* Utility.h */, - 1A0C0F0F17780A9700838530 /* Value.h */, - 1A0C0F1017780A9700838530 /* Vector.h */, - ); - path = js; - sourceTree = ""; - }; - 1A0C0F2717780A9700838530 /* mozilla */ = { - isa = PBXGroup; - children = ( - 1A0C0F2817780A9700838530 /* Assertions.h */, - 1A0C0F2917780A9700838530 /* Attributes.h */, - 1A0C0F2A17780A9700838530 /* BloomFilter.h */, - 1A0C0F2B17780A9700838530 /* Char16.h */, - 1A0C0F2C17780A9700838530 /* CheckedInt.h */, - 1A0C0F2D17780A9700838530 /* Compiler.h */, - 1A0C0F2E17780A9700838530 /* Constants.h */, - 1A0C0F2F17780A9700838530 /* DebugOnly.h */, - 1A0C0F3017780A9700838530 /* EnumSet.h */, - 1A0C0F3117780A9700838530 /* FloatingPoint.h */, - 1A0C0F3217780A9700838530 /* GuardObjects.h */, - 1A0C0F3317780A9700838530 /* HashFunctions.h */, - 1A0C0F3417780A9700838530 /* Likely.h */, - 1A0C0F3517780A9700838530 /* LinkedList.h */, - 1A0C0F3617780A9700838530 /* MathAlgorithms.h */, - 1A0C0F3717780A9700838530 /* MemoryChecking.h */, - 1A0C0F3817780A9700838530 /* MSStdInt.h */, - 1A0C0F3917780A9700838530 /* NullPtr.h */, - 1A0C0F3A17780A9700838530 /* Range.h */, - 1A0C0F3B17780A9700838530 /* RangedPtr.h */, - 1A0C0F3C17780A9700838530 /* RefPtr.h */, - 1A0C0F3D17780A9700838530 /* Scoped.h */, - 1A0C0F3E17780A9700838530 /* SHA1.h */, - 1A0C0F3F17780A9700838530 /* SplayTree.h */, - 1A0C0F4017780A9700838530 /* StandardInteger.h */, - 1A0C0F4117780A9700838530 /* ThreadLocal.h */, - 1A0C0F4217780A9700838530 /* TypedEnum.h */, - 1A0C0F4317780A9700838530 /* Types.h */, - 1A0C0F4417780A9700838530 /* TypeTraits.h */, - 1A0C0F4517780A9700838530 /* Util.h */, - 1A0C0F4617780A9700838530 /* WeakPtr.h */, - ); - path = mozilla; - sourceTree = ""; - }; - 1A0C0F4717780A9700838530 /* lib */ = { - isa = PBXGroup; - children = ( - 1A0C0F4817780A9700838530 /* libjs_static.a */, - ); - path = lib; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 1A0C0E861778088700838530 /* jsbindings */ = { - isa = PBXNativeTarget; - buildConfigurationList = 1A0C0E951778088700838530 /* Build configuration list for PBXNativeTarget "jsbindings" */; - buildPhases = ( - 1A0C0E831778088700838530 /* Sources */, - 1A0C0E841778088700838530 /* Frameworks */, - 1A0C0E851778088700838530 /* CopyFiles */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = jsbindings; - productName = jsbindings; - productReference = 1A0C0E871778088700838530 /* libjsbindings.a */; - productType = "com.apple.product-type.library.static"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 1A0C0E7F1778088700838530 /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0460; - }; - buildConfigurationList = 1A0C0E821778088700838530 /* Build configuration list for PBXProject "jsbindings" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - ); - mainGroup = 1A0C0E7E1778088700838530; - productRefGroup = 1A0C0E881778088700838530 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 1A0C0E861778088700838530 /* jsbindings */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXSourcesBuildPhase section */ - 1A0C0E831778088700838530 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 1A6E46D51778162E0055514D /* jsb_cocos2dx_extension_auto.cpp in Sources */, - 1A0C0EDA1778095000838530 /* cocos2d_specifics.cpp in Sources */, - 1A0C0EDB1778095000838530 /* cocosjs_manual_conversions.cpp in Sources */, - 1A0C0EDC1778095000838530 /* jsb_cocos2dx_auto.cpp in Sources */, - 1A0C0EEC1778095000838530 /* js_bindings_ccbreader.cpp in Sources */, - 1A0C0EED1778095000838530 /* js_bindings_chipmunk_auto_classes.cpp in Sources */, - 1A0C0EEE1778095000838530 /* js_bindings_chipmunk_functions.cpp in Sources */, - 1A0C0EEF1778095000838530 /* js_bindings_chipmunk_manual.cpp in Sources */, - 1A0C0EF01778095000838530 /* js_bindings_chipmunk_registration.cpp in Sources */, - 1A0C0EF11778095000838530 /* js_bindings_core.cpp in Sources */, - 1A0C0EF21778095000838530 /* js_bindings_opengl.cpp in Sources */, - 1A0C0EF31778095000838530 /* js_bindings_system_functions.cpp in Sources */, - 1A0C0EF41778095000838530 /* js_bindings_system_registration.cpp in Sources */, - 1A0C0EF51778095000838530 /* js_manual_conversions.cpp in Sources */, - 1A0C0EF61778095000838530 /* jsb_cocos2dx_extension_manual.cpp in Sources */, - 1A0C0EF71778095000838530 /* jsb_opengl_functions.cpp in Sources */, - 1A0C0EF81778095000838530 /* jsb_opengl_manual.cpp in Sources */, - 1A0C0EF91778095000838530 /* jsb_opengl_registration.cpp in Sources */, - 1A0C0EFA1778095000838530 /* jsb_websocket.cpp in Sources */, - 1A0C0EFB1778095000838530 /* ScriptingCore.cpp in Sources */, - 1A0C0EFC1778095000838530 /* XMLHTTPRequest.cpp in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 1A0C0E931778088700838530 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 6.1; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - }; - name = Debug; - }; - 1A0C0E941778088700838530 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 6.1; - SDKROOT = iphoneos; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 1A0C0E961778088700838530 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; - DSTROOT = /tmp/jsbindings.dst; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "jsbindings-Prefix.pch"; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - CC_TARGET_OS_IPHONE, - "COCOS2D_DEBUG=1", - "CC_ENABLE_CHIPMUNK_INTEGRATION=1", - "$(inherited)", - ); - HEADER_SEARCH_PATHS = ( - "$(SRCROOT)/../../../../CocosDenshion/include", - "\"$(SRCROOT)/../../../../external/chipmunk/include/chipmunk\"", - "\"$(SRCROOT)/../../../../external/libwebsockets/ios/include\"", - "\"$(SRCROOT)/../../../../cocos2dx/kazmath/include\"", - "\"$(SRCROOT)/../../../../external\"", - "\"$(SRCROOT)/../../../../extensions\"", - "\"$(SRCROOT)/../../../../extensions/LocalStorage\"", - "\"$(SRCROOT)/../../../../extensions/network\"", - "\"$(SRCROOT)/../../../../cocos2dx\"", - "\"$(SRCROOT)/../../../../cocos2dx/include\"", - "\"$(SRCROOT)/../../../../cocos2dx/platform/third_party/ios\"", - "\"$(SRCROOT)/../../../../cocos2dx/platform/ios\"", - "\"$(SRCROOT)/../../../../cocos2dx/platform/ios/Simulation\"", - "\"$(SRCROOT)/../../spidermonkey-ios/include\"", - ); - IPHONEOS_DEPLOYMENT_TARGET = 5.0; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "\"$(SRCROOT)/../../spidermonkey-ios/lib\"", - ); - ONLY_ACTIVE_ARCH = YES; - OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 1A0C0E971778088700838530 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; - DSTROOT = /tmp/jsbindings.dst; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "jsbindings-Prefix.pch"; - GCC_PREPROCESSOR_DEFINITIONS = ( - CC_TARGET_OS_IPHONE, - "CC_ENABLE_CHIPMUNK_INTEGRATION=1", - ); - HEADER_SEARCH_PATHS = ( - "$(SRCROOT)/../../../../CocosDenshion/include", - "\"$(SRCROOT)/../../../../external/chipmunk/include/chipmunk\"", - "\"$(SRCROOT)/../../../../external/libwebsockets/ios/include\"", - "\"$(SRCROOT)/../../../../cocos2dx/kazmath/include\"", - "\"$(SRCROOT)/../../../../external\"", - "\"$(SRCROOT)/../../../../extensions\"", - "\"$(SRCROOT)/../../../../extensions/LocalStorage\"", - "\"$(SRCROOT)/../../../../extensions/network\"", - "\"$(SRCROOT)/../../../../cocos2dx\"", - "\"$(SRCROOT)/../../../../cocos2dx/include\"", - "\"$(SRCROOT)/../../../../cocos2dx/platform/third_party/ios\"", - "\"$(SRCROOT)/../../../../cocos2dx/platform/ios\"", - "\"$(SRCROOT)/../../../../cocos2dx/platform/ios/Simulation\"", - "\"$(SRCROOT)/../../spidermonkey-ios/include\"", - ); - IPHONEOS_DEPLOYMENT_TARGET = 5.0; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "\"$(SRCROOT)/../../spidermonkey-ios/lib\"", - ); - ONLY_ACTIVE_ARCH = YES; - OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 1A0C0E821778088700838530 /* Build configuration list for PBXProject "jsbindings" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1A0C0E931778088700838530 /* Debug */, - 1A0C0E941778088700838530 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 1A0C0E951778088700838530 /* Build configuration list for PBXNativeTarget "jsbindings" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1A0C0E961778088700838530 /* Debug */, - 1A0C0E971778088700838530 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 1A0C0E7F1778088700838530 /* Project object */; -} diff --git a/cocos/scripting/javascript/bindings/proj.mac/jsbindings-Prefix.pch b/cocos/scripting/javascript/bindings/proj.mac/jsbindings-Prefix.pch deleted file mode 100644 index af8c4a19d5..0000000000 --- a/cocos/scripting/javascript/bindings/proj.mac/jsbindings-Prefix.pch +++ /dev/null @@ -1,7 +0,0 @@ -// -// Prefix header for all source files of the 'jsbindings' target in the 'jsbindings' project -// - -#ifdef __OBJC__ - #import -#endif diff --git a/cocos/scripting/javascript/bindings/proj.mac/jsbindings.xcodeproj/project.pbxproj b/cocos/scripting/javascript/bindings/proj.mac/jsbindings.xcodeproj/project.pbxproj deleted file mode 100644 index fd51d91ed6..0000000000 --- a/cocos/scripting/javascript/bindings/proj.mac/jsbindings.xcodeproj/project.pbxproj +++ /dev/null @@ -1,651 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 1A0C0E8B1778088700838530 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A0C0E8A1778088700838530 /* Foundation.framework */; }; - 1A0C0EDA1778095000838530 /* cocos2d_specifics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E991778095000838530 /* cocos2d_specifics.cpp */; }; - 1A0C0EDB1778095000838530 /* cocosjs_manual_conversions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E9B1778095000838530 /* cocosjs_manual_conversions.cpp */; }; - 1A0C0EDC1778095000838530 /* jsb_cocos2dx_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E9E1778095000838530 /* jsb_cocos2dx_auto.cpp */; }; - 1A0C0EEC1778095000838530 /* js_bindings_ccbreader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0EB21778095000838530 /* js_bindings_ccbreader.cpp */; }; - 1A0C0EED1778095000838530 /* js_bindings_chipmunk_auto_classes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0EB51778095000838530 /* js_bindings_chipmunk_auto_classes.cpp */; }; - 1A0C0EEE1778095000838530 /* js_bindings_chipmunk_functions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0EB81778095000838530 /* js_bindings_chipmunk_functions.cpp */; }; - 1A0C0EEF1778095000838530 /* js_bindings_chipmunk_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0EBA1778095000838530 /* js_bindings_chipmunk_manual.cpp */; }; - 1A0C0EF01778095000838530 /* js_bindings_chipmunk_registration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0EBC1778095000838530 /* js_bindings_chipmunk_registration.cpp */; }; - 1A0C0EF11778095000838530 /* js_bindings_core.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0EBF1778095000838530 /* js_bindings_core.cpp */; }; - 1A0C0EF21778095000838530 /* js_bindings_opengl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0EC11778095000838530 /* js_bindings_opengl.cpp */; }; - 1A0C0EF31778095000838530 /* js_bindings_system_functions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0EC41778095000838530 /* js_bindings_system_functions.cpp */; }; - 1A0C0EF41778095000838530 /* js_bindings_system_registration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0EC61778095000838530 /* js_bindings_system_registration.cpp */; }; - 1A0C0EF51778095000838530 /* js_manual_conversions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0EC81778095000838530 /* js_manual_conversions.cpp */; }; - 1A0C0EF61778095000838530 /* jsb_cocos2dx_extension_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0ECA1778095000838530 /* jsb_cocos2dx_extension_manual.cpp */; }; - 1A0C0EF71778095000838530 /* jsb_opengl_functions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0ECD1778095000838530 /* jsb_opengl_functions.cpp */; }; - 1A0C0EF81778095000838530 /* jsb_opengl_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0ECF1778095000838530 /* jsb_opengl_manual.cpp */; }; - 1A0C0EF91778095000838530 /* jsb_opengl_registration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0ED11778095000838530 /* jsb_opengl_registration.cpp */; }; - 1A0C0EFA1778095000838530 /* jsb_websocket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0ED31778095000838530 /* jsb_websocket.cpp */; }; - 1A0C0EFB1778095000838530 /* ScriptingCore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0ED51778095000838530 /* ScriptingCore.cpp */; }; - 1A0C0EFC1778095000838530 /* XMLHTTPRequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0ED81778095000838530 /* XMLHTTPRequest.cpp */; }; - 1A6E46D51778162E0055514D /* jsb_cocos2dx_extension_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0EA11778095000838530 /* jsb_cocos2dx_extension_auto.cpp */; }; - A00B437317795C5C00480238 /* libjs_static.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A00B437217795C5C00480238 /* libjs_static.a */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 1A0C0E851778088700838530 /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 16; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 1A0C0E871778088700838530 /* libjsbindings.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libjsbindings.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 1A0C0E8A1778088700838530 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; - 1A0C0E991778095000838530 /* cocos2d_specifics.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = cocos2d_specifics.cpp; path = ../cocos2d_specifics.cpp; sourceTree = ""; }; - 1A0C0E9A1778095000838530 /* cocos2d_specifics.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = cocos2d_specifics.hpp; path = ../cocos2d_specifics.hpp; sourceTree = ""; }; - 1A0C0E9B1778095000838530 /* cocosjs_manual_conversions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = cocosjs_manual_conversions.cpp; path = ../cocosjs_manual_conversions.cpp; sourceTree = ""; }; - 1A0C0E9C1778095000838530 /* cocosjs_manual_conversions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = cocosjs_manual_conversions.h; path = ../cocosjs_manual_conversions.h; sourceTree = ""; }; - 1A0C0E9E1778095000838530 /* jsb_cocos2dx_auto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = jsb_cocos2dx_auto.cpp; sourceTree = ""; }; - 1A0C0E9F1778095000838530 /* jsb_cocos2dx_auto.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = jsb_cocos2dx_auto.hpp; sourceTree = ""; }; - 1A0C0EA01778095000838530 /* jsb_cocos2dx_auto_api.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jsb_cocos2dx_auto_api.js; sourceTree = ""; }; - 1A0C0EA11778095000838530 /* jsb_cocos2dx_extension_auto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = jsb_cocos2dx_extension_auto.cpp; sourceTree = ""; }; - 1A0C0EA21778095000838530 /* jsb_cocos2dx_extension_auto.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = jsb_cocos2dx_extension_auto.hpp; sourceTree = ""; }; - 1A0C0EA31778095000838530 /* jsb_cocos2dx_extension_auto_api.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jsb_cocos2dx_extension_auto_api.js; sourceTree = ""; }; - 1A0C0EA41778095000838530 /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = ""; }; - 1A0C0EA61778095000838530 /* jsb.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jsb.js; sourceTree = ""; }; - 1A0C0EA71778095000838530 /* jsb_chipmunk.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jsb_chipmunk.js; sourceTree = ""; }; - 1A0C0EA81778095000838530 /* jsb_chipmunk_constants.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jsb_chipmunk_constants.js; sourceTree = ""; }; - 1A0C0EA91778095000838530 /* jsb_cocos2d.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jsb_cocos2d.js; sourceTree = ""; }; - 1A0C0EAA1778095000838530 /* jsb_cocos2d_constants.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jsb_cocos2d_constants.js; sourceTree = ""; }; - 1A0C0EAB1778095000838530 /* jsb_cocos2d_extension.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jsb_cocos2d_extension.js; sourceTree = ""; }; - 1A0C0EAC1778095000838530 /* jsb_cocosbuilder.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jsb_cocosbuilder.js; sourceTree = ""; }; - 1A0C0EAD1778095000838530 /* jsb_debugger.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jsb_debugger.js; sourceTree = ""; }; - 1A0C0EAE1778095000838530 /* jsb_opengl.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jsb_opengl.js; sourceTree = ""; }; - 1A0C0EAF1778095000838530 /* jsb_opengl_constants.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jsb_opengl_constants.js; sourceTree = ""; }; - 1A0C0EB01778095000838530 /* jsb_sys.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jsb_sys.js; sourceTree = ""; }; - 1A0C0EB11778095000838530 /* main.debug.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = main.debug.js; sourceTree = ""; }; - 1A0C0EB21778095000838530 /* js_bindings_ccbreader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = js_bindings_ccbreader.cpp; path = ../js_bindings_ccbreader.cpp; sourceTree = ""; }; - 1A0C0EB31778095000838530 /* js_bindings_ccbreader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = js_bindings_ccbreader.h; path = ../js_bindings_ccbreader.h; sourceTree = ""; }; - 1A0C0EB41778095000838530 /* js_bindings_chipmunk_auto_classes_registration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = js_bindings_chipmunk_auto_classes_registration.h; path = ../js_bindings_chipmunk_auto_classes_registration.h; sourceTree = ""; }; - 1A0C0EB51778095000838530 /* js_bindings_chipmunk_auto_classes.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = js_bindings_chipmunk_auto_classes.cpp; path = ../js_bindings_chipmunk_auto_classes.cpp; sourceTree = ""; }; - 1A0C0EB61778095000838530 /* js_bindings_chipmunk_auto_classes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = js_bindings_chipmunk_auto_classes.h; path = ../js_bindings_chipmunk_auto_classes.h; sourceTree = ""; }; - 1A0C0EB71778095000838530 /* js_bindings_chipmunk_functions_registration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = js_bindings_chipmunk_functions_registration.h; path = ../js_bindings_chipmunk_functions_registration.h; sourceTree = ""; }; - 1A0C0EB81778095000838530 /* js_bindings_chipmunk_functions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = js_bindings_chipmunk_functions.cpp; path = ../js_bindings_chipmunk_functions.cpp; sourceTree = ""; }; - 1A0C0EB91778095000838530 /* js_bindings_chipmunk_functions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = js_bindings_chipmunk_functions.h; path = ../js_bindings_chipmunk_functions.h; sourceTree = ""; }; - 1A0C0EBA1778095000838530 /* js_bindings_chipmunk_manual.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = js_bindings_chipmunk_manual.cpp; path = ../js_bindings_chipmunk_manual.cpp; sourceTree = ""; }; - 1A0C0EBB1778095000838530 /* js_bindings_chipmunk_manual.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = js_bindings_chipmunk_manual.h; path = ../js_bindings_chipmunk_manual.h; sourceTree = ""; }; - 1A0C0EBC1778095000838530 /* js_bindings_chipmunk_registration.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = js_bindings_chipmunk_registration.cpp; path = ../js_bindings_chipmunk_registration.cpp; sourceTree = ""; }; - 1A0C0EBD1778095000838530 /* js_bindings_chipmunk_registration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = js_bindings_chipmunk_registration.h; path = ../js_bindings_chipmunk_registration.h; sourceTree = ""; }; - 1A0C0EBE1778095000838530 /* js_bindings_config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = js_bindings_config.h; path = ../js_bindings_config.h; sourceTree = ""; }; - 1A0C0EBF1778095000838530 /* js_bindings_core.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = js_bindings_core.cpp; path = ../js_bindings_core.cpp; sourceTree = ""; }; - 1A0C0EC01778095000838530 /* js_bindings_core.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = js_bindings_core.h; path = ../js_bindings_core.h; sourceTree = ""; }; - 1A0C0EC11778095000838530 /* js_bindings_opengl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = js_bindings_opengl.cpp; path = ../js_bindings_opengl.cpp; sourceTree = ""; }; - 1A0C0EC21778095000838530 /* js_bindings_opengl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = js_bindings_opengl.h; path = ../js_bindings_opengl.h; sourceTree = ""; }; - 1A0C0EC31778095000838530 /* js_bindings_system_functions_registration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = js_bindings_system_functions_registration.h; path = ../js_bindings_system_functions_registration.h; sourceTree = ""; }; - 1A0C0EC41778095000838530 /* js_bindings_system_functions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = js_bindings_system_functions.cpp; path = ../js_bindings_system_functions.cpp; sourceTree = ""; }; - 1A0C0EC51778095000838530 /* js_bindings_system_functions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = js_bindings_system_functions.h; path = ../js_bindings_system_functions.h; sourceTree = ""; }; - 1A0C0EC61778095000838530 /* js_bindings_system_registration.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = js_bindings_system_registration.cpp; path = ../js_bindings_system_registration.cpp; sourceTree = ""; }; - 1A0C0EC71778095000838530 /* js_bindings_system_registration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = js_bindings_system_registration.h; path = ../js_bindings_system_registration.h; sourceTree = ""; }; - 1A0C0EC81778095000838530 /* js_manual_conversions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = js_manual_conversions.cpp; path = ../js_manual_conversions.cpp; sourceTree = ""; }; - 1A0C0EC91778095000838530 /* js_manual_conversions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = js_manual_conversions.h; path = ../js_manual_conversions.h; sourceTree = ""; }; - 1A0C0ECA1778095000838530 /* jsb_cocos2dx_extension_manual.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = jsb_cocos2dx_extension_manual.cpp; path = ../jsb_cocos2dx_extension_manual.cpp; sourceTree = ""; }; - 1A0C0ECB1778095000838530 /* jsb_cocos2dx_extension_manual.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = jsb_cocos2dx_extension_manual.h; path = ../jsb_cocos2dx_extension_manual.h; sourceTree = ""; }; - 1A0C0ECC1778095000838530 /* jsb_helper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = jsb_helper.h; path = ../jsb_helper.h; sourceTree = ""; }; - 1A0C0ECD1778095000838530 /* jsb_opengl_functions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = jsb_opengl_functions.cpp; path = ../jsb_opengl_functions.cpp; sourceTree = ""; }; - 1A0C0ECE1778095000838530 /* jsb_opengl_functions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = jsb_opengl_functions.h; path = ../jsb_opengl_functions.h; sourceTree = ""; }; - 1A0C0ECF1778095000838530 /* jsb_opengl_manual.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = jsb_opengl_manual.cpp; path = ../jsb_opengl_manual.cpp; sourceTree = ""; }; - 1A0C0ED01778095000838530 /* jsb_opengl_manual.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = jsb_opengl_manual.h; path = ../jsb_opengl_manual.h; sourceTree = ""; }; - 1A0C0ED11778095000838530 /* jsb_opengl_registration.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = jsb_opengl_registration.cpp; path = ../jsb_opengl_registration.cpp; sourceTree = ""; }; - 1A0C0ED21778095000838530 /* jsb_opengl_registration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = jsb_opengl_registration.h; path = ../jsb_opengl_registration.h; sourceTree = ""; }; - 1A0C0ED31778095000838530 /* jsb_websocket.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = jsb_websocket.cpp; path = ../jsb_websocket.cpp; sourceTree = ""; }; - 1A0C0ED41778095000838530 /* jsb_websocket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = jsb_websocket.h; path = ../jsb_websocket.h; sourceTree = ""; }; - 1A0C0ED51778095000838530 /* ScriptingCore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScriptingCore.cpp; path = ../ScriptingCore.cpp; sourceTree = ""; }; - 1A0C0ED61778095000838530 /* ScriptingCore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ScriptingCore.h; path = ../ScriptingCore.h; sourceTree = ""; }; - 1A0C0ED71778095000838530 /* spidermonkey_specifics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = spidermonkey_specifics.h; path = ../spidermonkey_specifics.h; sourceTree = ""; }; - 1A0C0ED81778095000838530 /* XMLHTTPRequest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = XMLHTTPRequest.cpp; path = ../XMLHTTPRequest.cpp; sourceTree = ""; }; - 1A0C0ED91778095000838530 /* XMLHTTPRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = XMLHTTPRequest.h; path = ../XMLHTTPRequest.h; sourceTree = ""; }; - A00B437217795C5C00480238 /* libjs_static.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libjs_static.a; sourceTree = ""; }; - A05FCAF5177D12D900BE600E /* Anchor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Anchor.h; sourceTree = ""; }; - A05FCAF6177D12D900BE600E /* CallArgs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CallArgs.h; sourceTree = ""; }; - A05FCAF7177D12D900BE600E /* CharacterEncoding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CharacterEncoding.h; sourceTree = ""; }; - A05FCAF8177D12D900BE600E /* GCAPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GCAPI.h; sourceTree = ""; }; - A05FCAF9177D12D900BE600E /* HashTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HashTable.h; sourceTree = ""; }; - A05FCAFA177D12D900BE600E /* HeapAPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HeapAPI.h; sourceTree = ""; }; - A05FCAFB177D12D900BE600E /* LegacyIntTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LegacyIntTypes.h; sourceTree = ""; }; - A05FCAFC177D12D900BE600E /* MemoryMetrics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemoryMetrics.h; sourceTree = ""; }; - A05FCAFD177D12D900BE600E /* PropertyKey.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PropertyKey.h; sourceTree = ""; }; - A05FCAFE177D12D900BE600E /* RequiredDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RequiredDefines.h; sourceTree = ""; }; - A05FCAFF177D12D900BE600E /* RootingAPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RootingAPI.h; sourceTree = ""; }; - A05FCB00177D12D900BE600E /* TemplateLib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TemplateLib.h; sourceTree = ""; }; - A05FCB01177D12D900BE600E /* Utility.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Utility.h; sourceTree = ""; }; - A05FCB02177D12D900BE600E /* Value.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Value.h; sourceTree = ""; }; - A05FCB03177D12D900BE600E /* Vector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Vector.h; sourceTree = ""; }; - A05FCB04177D12D900BE600E /* js-config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "js-config.h"; sourceTree = ""; }; - A05FCB05177D12D900BE600E /* js.msg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = js.msg; sourceTree = ""; }; - A05FCB06177D12D900BE600E /* jsalloc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsalloc.h; sourceTree = ""; }; - A05FCB07177D12D900BE600E /* jsapi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsapi.h; sourceTree = ""; }; - A05FCB08177D12D900BE600E /* jsclass.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsclass.h; sourceTree = ""; }; - A05FCB09177D12D900BE600E /* jsclist.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsclist.h; sourceTree = ""; }; - A05FCB0A177D12D900BE600E /* jscpucfg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jscpucfg.h; sourceTree = ""; }; - A05FCB0B177D12D900BE600E /* jsdbgapi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsdbgapi.h; sourceTree = ""; }; - A05FCB0C177D12D900BE600E /* jsdhash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsdhash.h; sourceTree = ""; }; - A05FCB0D177D12D900BE600E /* jsfriendapi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsfriendapi.h; sourceTree = ""; }; - A05FCB0E177D12D900BE600E /* jslock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jslock.h; sourceTree = ""; }; - A05FCB0F177D12D900BE600E /* json.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = json.h; sourceTree = ""; }; - A05FCB10177D12D900BE600E /* jsperf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsperf.h; sourceTree = ""; }; - A05FCB11177D12D900BE600E /* jsprf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsprf.h; sourceTree = ""; }; - A05FCB12177D12D900BE600E /* jsprototypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsprototypes.h; sourceTree = ""; }; - A05FCB13177D12D900BE600E /* jsproxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsproxy.h; sourceTree = ""; }; - A05FCB14177D12D900BE600E /* jsprvtd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsprvtd.h; sourceTree = ""; }; - A05FCB15177D12D900BE600E /* jspubtd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jspubtd.h; sourceTree = ""; }; - A05FCB16177D12D900BE600E /* jstypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jstypes.h; sourceTree = ""; }; - A05FCB17177D12D900BE600E /* jsutil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsutil.h; sourceTree = ""; }; - A05FCB18177D12D900BE600E /* jsversion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsversion.h; sourceTree = ""; }; - A05FCB19177D12D900BE600E /* jswrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jswrapper.h; sourceTree = ""; }; - A05FCB1B177D12D900BE600E /* Assertions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Assertions.h; sourceTree = ""; }; - A05FCB1C177D12D900BE600E /* Attributes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Attributes.h; sourceTree = ""; }; - A05FCB1D177D12D900BE600E /* BloomFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BloomFilter.h; sourceTree = ""; }; - A05FCB1E177D12D900BE600E /* Char16.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Char16.h; sourceTree = ""; }; - A05FCB1F177D12D900BE600E /* CheckedInt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CheckedInt.h; sourceTree = ""; }; - A05FCB20177D12D900BE600E /* Compiler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Compiler.h; sourceTree = ""; }; - A05FCB21177D12D900BE600E /* Constants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Constants.h; sourceTree = ""; }; - A05FCB22177D12D900BE600E /* DebugOnly.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DebugOnly.h; sourceTree = ""; }; - A05FCB23177D12D900BE600E /* EnumSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EnumSet.h; sourceTree = ""; }; - A05FCB24177D12D900BE600E /* FloatingPoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FloatingPoint.h; sourceTree = ""; }; - A05FCB25177D12D900BE600E /* GuardObjects.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GuardObjects.h; sourceTree = ""; }; - A05FCB26177D12D900BE600E /* HashFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HashFunctions.h; sourceTree = ""; }; - A05FCB27177D12D900BE600E /* Likely.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Likely.h; sourceTree = ""; }; - A05FCB28177D12D900BE600E /* LinkedList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LinkedList.h; sourceTree = ""; }; - A05FCB29177D12D900BE600E /* MathAlgorithms.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MathAlgorithms.h; sourceTree = ""; }; - A05FCB2A177D12D900BE600E /* MemoryChecking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemoryChecking.h; sourceTree = ""; }; - A05FCB2B177D12D900BE600E /* MSStdInt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MSStdInt.h; sourceTree = ""; }; - A05FCB2C177D12D900BE600E /* NullPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NullPtr.h; sourceTree = ""; }; - A05FCB2D177D12D900BE600E /* Range.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Range.h; sourceTree = ""; }; - A05FCB2E177D12D900BE600E /* RangedPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RangedPtr.h; sourceTree = ""; }; - A05FCB2F177D12D900BE600E /* RefPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RefPtr.h; sourceTree = ""; }; - A05FCB30177D12D900BE600E /* Scoped.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Scoped.h; sourceTree = ""; }; - A05FCB31177D12D900BE600E /* SHA1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SHA1.h; sourceTree = ""; }; - A05FCB32177D12D900BE600E /* SplayTree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SplayTree.h; sourceTree = ""; }; - A05FCB33177D12D900BE600E /* StandardInteger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StandardInteger.h; sourceTree = ""; }; - A05FCB34177D12D900BE600E /* ThreadLocal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThreadLocal.h; sourceTree = ""; }; - A05FCB35177D12D900BE600E /* TypedEnum.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TypedEnum.h; sourceTree = ""; }; - A05FCB36177D12D900BE600E /* Types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Types.h; sourceTree = ""; }; - A05FCB37177D12D900BE600E /* TypeTraits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TypeTraits.h; sourceTree = ""; }; - A05FCB38177D12D900BE600E /* Util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Util.h; sourceTree = ""; }; - A05FCB39177D12D900BE600E /* WeakPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WeakPtr.h; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 1A0C0E841778088700838530 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 1A0C0E8B1778088700838530 /* Foundation.framework in Frameworks */, - A00B437317795C5C00480238 /* libjs_static.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 1A0C0E7E1778088700838530 = { - isa = PBXGroup; - children = ( - 1A0C0E981778093E00838530 /* bindings */, - 1A0C0E891778088700838530 /* Frameworks */, - 1A0C0E881778088700838530 /* Products */, - ); - sourceTree = ""; - }; - 1A0C0E881778088700838530 /* Products */ = { - isa = PBXGroup; - children = ( - 1A0C0E871778088700838530 /* libjsbindings.a */, - ); - name = Products; - sourceTree = ""; - }; - 1A0C0E891778088700838530 /* Frameworks */ = { - isa = PBXGroup; - children = ( - A00B432717795C5C00480238 /* spidermonkey-mac */, - 1A0C0E8A1778088700838530 /* Foundation.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - 1A0C0E981778093E00838530 /* bindings */ = { - isa = PBXGroup; - children = ( - 1A0C0E991778095000838530 /* cocos2d_specifics.cpp */, - 1A0C0E9A1778095000838530 /* cocos2d_specifics.hpp */, - 1A0C0E9B1778095000838530 /* cocosjs_manual_conversions.cpp */, - 1A0C0E9C1778095000838530 /* cocosjs_manual_conversions.h */, - 1A0C0E9D1778095000838530 /* generated */, - 1A0C0EA51778095000838530 /* js */, - 1A0C0EB21778095000838530 /* js_bindings_ccbreader.cpp */, - 1A0C0EB31778095000838530 /* js_bindings_ccbreader.h */, - 1A0C0EB41778095000838530 /* js_bindings_chipmunk_auto_classes_registration.h */, - 1A0C0EB51778095000838530 /* js_bindings_chipmunk_auto_classes.cpp */, - 1A0C0EB61778095000838530 /* js_bindings_chipmunk_auto_classes.h */, - 1A0C0EB71778095000838530 /* js_bindings_chipmunk_functions_registration.h */, - 1A0C0EB81778095000838530 /* js_bindings_chipmunk_functions.cpp */, - 1A0C0EB91778095000838530 /* js_bindings_chipmunk_functions.h */, - 1A0C0EBA1778095000838530 /* js_bindings_chipmunk_manual.cpp */, - 1A0C0EBB1778095000838530 /* js_bindings_chipmunk_manual.h */, - 1A0C0EBC1778095000838530 /* js_bindings_chipmunk_registration.cpp */, - 1A0C0EBD1778095000838530 /* js_bindings_chipmunk_registration.h */, - 1A0C0EBE1778095000838530 /* js_bindings_config.h */, - 1A0C0EBF1778095000838530 /* js_bindings_core.cpp */, - 1A0C0EC01778095000838530 /* js_bindings_core.h */, - 1A0C0EC11778095000838530 /* js_bindings_opengl.cpp */, - 1A0C0EC21778095000838530 /* js_bindings_opengl.h */, - 1A0C0EC31778095000838530 /* js_bindings_system_functions_registration.h */, - 1A0C0EC41778095000838530 /* js_bindings_system_functions.cpp */, - 1A0C0EC51778095000838530 /* js_bindings_system_functions.h */, - 1A0C0EC61778095000838530 /* js_bindings_system_registration.cpp */, - 1A0C0EC71778095000838530 /* js_bindings_system_registration.h */, - 1A0C0EC81778095000838530 /* js_manual_conversions.cpp */, - 1A0C0EC91778095000838530 /* js_manual_conversions.h */, - 1A0C0ECA1778095000838530 /* jsb_cocos2dx_extension_manual.cpp */, - 1A0C0ECB1778095000838530 /* jsb_cocos2dx_extension_manual.h */, - 1A0C0ECC1778095000838530 /* jsb_helper.h */, - 1A0C0ECD1778095000838530 /* jsb_opengl_functions.cpp */, - 1A0C0ECE1778095000838530 /* jsb_opengl_functions.h */, - 1A0C0ECF1778095000838530 /* jsb_opengl_manual.cpp */, - 1A0C0ED01778095000838530 /* jsb_opengl_manual.h */, - 1A0C0ED11778095000838530 /* jsb_opengl_registration.cpp */, - 1A0C0ED21778095000838530 /* jsb_opengl_registration.h */, - 1A0C0ED31778095000838530 /* jsb_websocket.cpp */, - 1A0C0ED41778095000838530 /* jsb_websocket.h */, - 1A0C0ED51778095000838530 /* ScriptingCore.cpp */, - 1A0C0ED61778095000838530 /* ScriptingCore.h */, - 1A0C0ED71778095000838530 /* spidermonkey_specifics.h */, - 1A0C0ED81778095000838530 /* XMLHTTPRequest.cpp */, - 1A0C0ED91778095000838530 /* XMLHTTPRequest.h */, - ); - name = bindings; - sourceTree = ""; - }; - 1A0C0E9D1778095000838530 /* generated */ = { - isa = PBXGroup; - children = ( - 1A0C0E9E1778095000838530 /* jsb_cocos2dx_auto.cpp */, - 1A0C0E9F1778095000838530 /* jsb_cocos2dx_auto.hpp */, - 1A0C0EA01778095000838530 /* jsb_cocos2dx_auto_api.js */, - 1A0C0EA11778095000838530 /* jsb_cocos2dx_extension_auto.cpp */, - 1A0C0EA21778095000838530 /* jsb_cocos2dx_extension_auto.hpp */, - 1A0C0EA31778095000838530 /* jsb_cocos2dx_extension_auto_api.js */, - 1A0C0EA41778095000838530 /* README */, - ); - name = generated; - path = ../generated; - sourceTree = ""; - }; - 1A0C0EA51778095000838530 /* js */ = { - isa = PBXGroup; - children = ( - 1A0C0EA61778095000838530 /* jsb.js */, - 1A0C0EA71778095000838530 /* jsb_chipmunk.js */, - 1A0C0EA81778095000838530 /* jsb_chipmunk_constants.js */, - 1A0C0EA91778095000838530 /* jsb_cocos2d.js */, - 1A0C0EAA1778095000838530 /* jsb_cocos2d_constants.js */, - 1A0C0EAB1778095000838530 /* jsb_cocos2d_extension.js */, - 1A0C0EAC1778095000838530 /* jsb_cocosbuilder.js */, - 1A0C0EAD1778095000838530 /* jsb_debugger.js */, - 1A0C0EAE1778095000838530 /* jsb_opengl.js */, - 1A0C0EAF1778095000838530 /* jsb_opengl_constants.js */, - 1A0C0EB01778095000838530 /* jsb_sys.js */, - 1A0C0EB11778095000838530 /* main.debug.js */, - ); - name = js; - path = ../js; - sourceTree = ""; - }; - A00B432717795C5C00480238 /* spidermonkey-mac */ = { - isa = PBXGroup; - children = ( - A00B432817795C5C00480238 /* include */, - A00B437117795C5C00480238 /* lib */, - ); - name = "spidermonkey-mac"; - path = "../../spidermonkey-mac"; - sourceTree = ""; - }; - A00B432817795C5C00480238 /* include */ = { - isa = PBXGroup; - children = ( - A05FCAF4177D12D900BE600E /* js */, - A05FCB04177D12D900BE600E /* js-config.h */, - A05FCB05177D12D900BE600E /* js.msg */, - A05FCB06177D12D900BE600E /* jsalloc.h */, - A05FCB07177D12D900BE600E /* jsapi.h */, - A05FCB08177D12D900BE600E /* jsclass.h */, - A05FCB09177D12D900BE600E /* jsclist.h */, - A05FCB0A177D12D900BE600E /* jscpucfg.h */, - A05FCB0B177D12D900BE600E /* jsdbgapi.h */, - A05FCB0C177D12D900BE600E /* jsdhash.h */, - A05FCB0D177D12D900BE600E /* jsfriendapi.h */, - A05FCB0E177D12D900BE600E /* jslock.h */, - A05FCB0F177D12D900BE600E /* json.h */, - A05FCB10177D12D900BE600E /* jsperf.h */, - A05FCB11177D12D900BE600E /* jsprf.h */, - A05FCB12177D12D900BE600E /* jsprototypes.h */, - A05FCB13177D12D900BE600E /* jsproxy.h */, - A05FCB14177D12D900BE600E /* jsprvtd.h */, - A05FCB15177D12D900BE600E /* jspubtd.h */, - A05FCB16177D12D900BE600E /* jstypes.h */, - A05FCB17177D12D900BE600E /* jsutil.h */, - A05FCB18177D12D900BE600E /* jsversion.h */, - A05FCB19177D12D900BE600E /* jswrapper.h */, - A05FCB1A177D12D900BE600E /* mozilla */, - ); - path = include; - sourceTree = ""; - }; - A00B437117795C5C00480238 /* lib */ = { - isa = PBXGroup; - children = ( - A00B437217795C5C00480238 /* libjs_static.a */, - ); - path = lib; - sourceTree = ""; - }; - A05FCAF4177D12D900BE600E /* js */ = { - isa = PBXGroup; - children = ( - A05FCAF5177D12D900BE600E /* Anchor.h */, - A05FCAF6177D12D900BE600E /* CallArgs.h */, - A05FCAF7177D12D900BE600E /* CharacterEncoding.h */, - A05FCAF8177D12D900BE600E /* GCAPI.h */, - A05FCAF9177D12D900BE600E /* HashTable.h */, - A05FCAFA177D12D900BE600E /* HeapAPI.h */, - A05FCAFB177D12D900BE600E /* LegacyIntTypes.h */, - A05FCAFC177D12D900BE600E /* MemoryMetrics.h */, - A05FCAFD177D12D900BE600E /* PropertyKey.h */, - A05FCAFE177D12D900BE600E /* RequiredDefines.h */, - A05FCAFF177D12D900BE600E /* RootingAPI.h */, - A05FCB00177D12D900BE600E /* TemplateLib.h */, - A05FCB01177D12D900BE600E /* Utility.h */, - A05FCB02177D12D900BE600E /* Value.h */, - A05FCB03177D12D900BE600E /* Vector.h */, - ); - path = js; - sourceTree = ""; - }; - A05FCB1A177D12D900BE600E /* mozilla */ = { - isa = PBXGroup; - children = ( - A05FCB1B177D12D900BE600E /* Assertions.h */, - A05FCB1C177D12D900BE600E /* Attributes.h */, - A05FCB1D177D12D900BE600E /* BloomFilter.h */, - A05FCB1E177D12D900BE600E /* Char16.h */, - A05FCB1F177D12D900BE600E /* CheckedInt.h */, - A05FCB20177D12D900BE600E /* Compiler.h */, - A05FCB21177D12D900BE600E /* Constants.h */, - A05FCB22177D12D900BE600E /* DebugOnly.h */, - A05FCB23177D12D900BE600E /* EnumSet.h */, - A05FCB24177D12D900BE600E /* FloatingPoint.h */, - A05FCB25177D12D900BE600E /* GuardObjects.h */, - A05FCB26177D12D900BE600E /* HashFunctions.h */, - A05FCB27177D12D900BE600E /* Likely.h */, - A05FCB28177D12D900BE600E /* LinkedList.h */, - A05FCB29177D12D900BE600E /* MathAlgorithms.h */, - A05FCB2A177D12D900BE600E /* MemoryChecking.h */, - A05FCB2B177D12D900BE600E /* MSStdInt.h */, - A05FCB2C177D12D900BE600E /* NullPtr.h */, - A05FCB2D177D12D900BE600E /* Range.h */, - A05FCB2E177D12D900BE600E /* RangedPtr.h */, - A05FCB2F177D12D900BE600E /* RefPtr.h */, - A05FCB30177D12D900BE600E /* Scoped.h */, - A05FCB31177D12D900BE600E /* SHA1.h */, - A05FCB32177D12D900BE600E /* SplayTree.h */, - A05FCB33177D12D900BE600E /* StandardInteger.h */, - A05FCB34177D12D900BE600E /* ThreadLocal.h */, - A05FCB35177D12D900BE600E /* TypedEnum.h */, - A05FCB36177D12D900BE600E /* Types.h */, - A05FCB37177D12D900BE600E /* TypeTraits.h */, - A05FCB38177D12D900BE600E /* Util.h */, - A05FCB39177D12D900BE600E /* WeakPtr.h */, - ); - path = mozilla; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 1A0C0E861778088700838530 /* jsbindings */ = { - isa = PBXNativeTarget; - buildConfigurationList = 1A0C0E951778088700838530 /* Build configuration list for PBXNativeTarget "jsbindings" */; - buildPhases = ( - 1A0C0E831778088700838530 /* Sources */, - 1A0C0E841778088700838530 /* Frameworks */, - 1A0C0E851778088700838530 /* CopyFiles */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = jsbindings; - productName = jsbindings; - productReference = 1A0C0E871778088700838530 /* libjsbindings.a */; - productType = "com.apple.product-type.library.static"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 1A0C0E7F1778088700838530 /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0460; - }; - buildConfigurationList = 1A0C0E821778088700838530 /* Build configuration list for PBXProject "jsbindings" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - ); - mainGroup = 1A0C0E7E1778088700838530; - productRefGroup = 1A0C0E881778088700838530 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 1A0C0E861778088700838530 /* jsbindings */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXSourcesBuildPhase section */ - 1A0C0E831778088700838530 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 1A6E46D51778162E0055514D /* jsb_cocos2dx_extension_auto.cpp in Sources */, - 1A0C0EDA1778095000838530 /* cocos2d_specifics.cpp in Sources */, - 1A0C0EDB1778095000838530 /* cocosjs_manual_conversions.cpp in Sources */, - 1A0C0EDC1778095000838530 /* jsb_cocos2dx_auto.cpp in Sources */, - 1A0C0EEC1778095000838530 /* js_bindings_ccbreader.cpp in Sources */, - 1A0C0EED1778095000838530 /* js_bindings_chipmunk_auto_classes.cpp in Sources */, - 1A0C0EEE1778095000838530 /* js_bindings_chipmunk_functions.cpp in Sources */, - 1A0C0EEF1778095000838530 /* js_bindings_chipmunk_manual.cpp in Sources */, - 1A0C0EF01778095000838530 /* js_bindings_chipmunk_registration.cpp in Sources */, - 1A0C0EF11778095000838530 /* js_bindings_core.cpp in Sources */, - 1A0C0EF21778095000838530 /* js_bindings_opengl.cpp in Sources */, - 1A0C0EF31778095000838530 /* js_bindings_system_functions.cpp in Sources */, - 1A0C0EF41778095000838530 /* js_bindings_system_registration.cpp in Sources */, - 1A0C0EF51778095000838530 /* js_manual_conversions.cpp in Sources */, - 1A0C0EF61778095000838530 /* jsb_cocos2dx_extension_manual.cpp in Sources */, - 1A0C0EF71778095000838530 /* jsb_opengl_functions.cpp in Sources */, - 1A0C0EF81778095000838530 /* jsb_opengl_manual.cpp in Sources */, - 1A0C0EF91778095000838530 /* jsb_opengl_registration.cpp in Sources */, - 1A0C0EFA1778095000838530 /* jsb_websocket.cpp in Sources */, - 1A0C0EFB1778095000838530 /* ScriptingCore.cpp in Sources */, - 1A0C0EFC1778095000838530 /* XMLHTTPRequest.cpp in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 1A0C0E931778088700838530 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; - CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - CC_TARGET_OS_MAC, - CC_KEYBOARD_SUPPORT, - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = macosx; - }; - name = Debug; - }; - 1A0C0E941778088700838530 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; - CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = YES; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_PREPROCESSOR_DEFINITIONS = ( - NDEBUG, - CC_TARGET_OS_MAC, - CC_KEYBOARD_SUPPORT, - ); - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - SDKROOT = macosx; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 1A0C0E961778088700838530 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - DSTROOT = /tmp/jsbindings.dst; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "jsbindings-Prefix.pch"; - GCC_PREPROCESSOR_DEFINITIONS = ( - "$(inherited)", - "COCOS2D_DEBUG=1", - "CC_ENABLE_CHIPMUNK_INTEGRATION=1", - ); - HEADER_SEARCH_PATHS = ( - "$(SRCROOT)/../../../../CocosDenshion/include", - "\"$(SRCROOT)/../../../../external/chipmunk/include/chipmunk\"", - "\"$(SRCROOT)/../../../../external/libwebsockets/mac/include\"", - "\"$(SRCROOT)/../../../../cocos2dx/kazmath/include\"", - "\"$(SRCROOT)/../../../../external\"", - "\"$(SRCROOT)/../../../../extensions\"", - "\"$(SRCROOT)/../../../../extensions/LocalStorage\"", - "\"$(SRCROOT)/../../../../extensions/network\"", - "\"$(SRCROOT)/../../../../cocos2dx\"", - "\"$(SRCROOT)/../../../../cocos2dx/include\"", - "\"$(SRCROOT)/../../../../cocos2dx/platform/third_party/mac\"", - "\"$(SRCROOT)/../../../../cocos2dx/platform/mac\"", - "\"$(SRCROOT)/../../../../cocos2dx/platform/mac/Simulation\"", - "\"$(SRCROOT)/../../spidermonkey-mac/include\"", - ); - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "\"$(SRCROOT)/../../spidermonkey-mac/lib\"", - ); - OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SKIP_INSTALL = YES; - }; - name = Debug; - }; - 1A0C0E971778088700838530 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - DSTROOT = /tmp/jsbindings.dst; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "jsbindings-Prefix.pch"; - GCC_PREPROCESSOR_DEFINITIONS = ( - "$(inherited)", - "CC_ENABLE_CHIPMUNK_INTEGRATION=1", - ); - HEADER_SEARCH_PATHS = ( - "$(SRCROOT)/../../../../CocosDenshion/include", - "\"$(SRCROOT)/../../../../external/chipmunk/include/chipmunk\"", - "\"$(SRCROOT)/../../../../external/libwebsockets/mac/include\"", - "\"$(SRCROOT)/../../../../cocos2dx/kazmath/include\"", - "\"$(SRCROOT)/../../../../external\"", - "\"$(SRCROOT)/../../../../extensions\"", - "\"$(SRCROOT)/../../../../extensions/LocalStorage\"", - "\"$(SRCROOT)/../../../../extensions/network\"", - "\"$(SRCROOT)/../../../../cocos2dx\"", - "\"$(SRCROOT)/../../../../cocos2dx/include\"", - "\"$(SRCROOT)/../../../../cocos2dx/platform/third_party/mac\"", - "\"$(SRCROOT)/../../../../cocos2dx/platform/mac\"", - "\"$(SRCROOT)/../../../../cocos2dx/platform/mac/Simulation\"", - "\"$(SRCROOT)/../../spidermonkey-mac/include\"", - ); - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "\"$(SRCROOT)/../../spidermonkey-mac/lib\"", - ); - OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SKIP_INSTALL = YES; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 1A0C0E821778088700838530 /* Build configuration list for PBXProject "jsbindings" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1A0C0E931778088700838530 /* Debug */, - 1A0C0E941778088700838530 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 1A0C0E951778088700838530 /* Build configuration list for PBXNativeTarget "jsbindings" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1A0C0E961778088700838530 /* Debug */, - 1A0C0E971778088700838530 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 1A0C0E7F1778088700838530 /* Project object */; -} diff --git a/cocos/scripting/lua/proj.ios/luabindings.xcodeproj/project.pbxproj b/cocos/scripting/lua/proj.ios/luabindings.xcodeproj/project.pbxproj deleted file mode 100644 index 0bc70a8e36..0000000000 --- a/cocos/scripting/lua/proj.ios/luabindings.xcodeproj/project.pbxproj +++ /dev/null @@ -1,453 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 1A6E476E17781A660055514D /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A6E476D17781A660055514D /* Foundation.framework */; }; - 1A6E487E17781AB00055514D /* CCBProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6E477C17781AB00055514D /* CCBProxy.cpp */; }; - 1A6E487F17781AB00055514D /* CCLuaBridge.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6E477E17781AB00055514D /* CCLuaBridge.cpp */; }; - 1A6E488017781AB00055514D /* CCLuaEngine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6E478017781AB00055514D /* CCLuaEngine.cpp */; }; - 1A6E488117781AB00055514D /* CCLuaStack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6E478217781AB00055514D /* CCLuaStack.cpp */; }; - 1A6E488217781AB00055514D /* CCLuaValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6E478417781AB00055514D /* CCLuaValue.cpp */; }; - 1A6E488317781AB00055514D /* Cocos2dxLuaLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6E478617781AB00055514D /* Cocos2dxLuaLoader.cpp */; }; - 1A6E488417781AB00055514D /* Lua_extensions_CCB.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6E478817781AB00055514D /* Lua_extensions_CCB.cpp */; }; - 1A6E488517781AB00055514D /* Lua_web_socket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6E478A17781AB00055514D /* Lua_web_socket.cpp */; }; - 1A6E488617781AB00055514D /* LuaCocos2d.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6E478C17781AB00055514D /* LuaCocos2d.cpp */; }; - 1A6E488717781AB00055514D /* LuaOpengl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6E478E17781AB00055514D /* LuaOpengl.cpp */; }; - 1A6E488817781AB00055514D /* LuaScrollView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6E479017781AB00055514D /* LuaScrollView.cpp */; }; - 1A6E488917781AB00055514D /* CCLuaObjcBridge.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A6E479517781AB00055514D /* CCLuaObjcBridge.mm */; }; - 1A6E488A17781AB00055514D /* tolua_fix.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A6E479617781AB00055514D /* tolua_fix.c */; }; - 1A6E488E17781AB00055514D /* libluajit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A6E47AA17781AB00055514D /* libluajit.a */; }; - 1A6E48D717781AB00055514D /* tolua_event.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A6E487817781AB00055514D /* tolua_event.c */; }; - 1A6E48D817781AB00055514D /* tolua_is.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A6E487A17781AB00055514D /* tolua_is.c */; }; - 1A6E48D917781AB00055514D /* tolua_map.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A6E487B17781AB00055514D /* tolua_map.c */; }; - 1A6E48DA17781AB00055514D /* tolua_push.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A6E487C17781AB00055514D /* tolua_push.c */; }; - 1A6E48DB17781AB00055514D /* tolua_to.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A6E487D17781AB00055514D /* tolua_to.c */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 1A6E476817781A660055514D /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = "include/${PRODUCT_NAME}"; - dstSubfolderSpec = 16; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 1A6E476A17781A660055514D /* libluabindings.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libluabindings.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 1A6E476D17781A660055514D /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; - 1A6E477C17781AB00055514D /* CCBProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCBProxy.cpp; sourceTree = ""; }; - 1A6E477D17781AB00055514D /* CCBProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCBProxy.h; sourceTree = ""; }; - 1A6E477E17781AB00055514D /* CCLuaBridge.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCLuaBridge.cpp; sourceTree = ""; }; - 1A6E477F17781AB00055514D /* CCLuaBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCLuaBridge.h; sourceTree = ""; }; - 1A6E478017781AB00055514D /* CCLuaEngine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCLuaEngine.cpp; sourceTree = ""; }; - 1A6E478117781AB00055514D /* CCLuaEngine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCLuaEngine.h; sourceTree = ""; }; - 1A6E478217781AB00055514D /* CCLuaStack.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCLuaStack.cpp; sourceTree = ""; }; - 1A6E478317781AB00055514D /* CCLuaStack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCLuaStack.h; sourceTree = ""; }; - 1A6E478417781AB00055514D /* CCLuaValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCLuaValue.cpp; sourceTree = ""; }; - 1A6E478517781AB00055514D /* CCLuaValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCLuaValue.h; sourceTree = ""; }; - 1A6E478617781AB00055514D /* Cocos2dxLuaLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Cocos2dxLuaLoader.cpp; sourceTree = ""; }; - 1A6E478717781AB00055514D /* Cocos2dxLuaLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Cocos2dxLuaLoader.h; sourceTree = ""; }; - 1A6E478817781AB00055514D /* Lua_extensions_CCB.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Lua_extensions_CCB.cpp; sourceTree = ""; }; - 1A6E478917781AB00055514D /* Lua_extensions_CCB.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Lua_extensions_CCB.h; sourceTree = ""; }; - 1A6E478A17781AB00055514D /* Lua_web_socket.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Lua_web_socket.cpp; sourceTree = ""; }; - 1A6E478B17781AB00055514D /* Lua_web_socket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Lua_web_socket.h; sourceTree = ""; }; - 1A6E478C17781AB00055514D /* LuaCocos2d.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LuaCocos2d.cpp; sourceTree = ""; }; - 1A6E478D17781AB00055514D /* LuaCocos2d.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LuaCocos2d.h; sourceTree = ""; }; - 1A6E478E17781AB00055514D /* LuaOpengl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LuaOpengl.cpp; sourceTree = ""; }; - 1A6E478F17781AB00055514D /* LuaOpengl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LuaOpengl.h; sourceTree = ""; }; - 1A6E479017781AB00055514D /* LuaScrollView.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LuaScrollView.cpp; sourceTree = ""; }; - 1A6E479117781AB00055514D /* LuaScrollView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LuaScrollView.h; sourceTree = ""; }; - 1A6E479417781AB00055514D /* CCLuaObjcBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCLuaObjcBridge.h; sourceTree = ""; }; - 1A6E479517781AB00055514D /* CCLuaObjcBridge.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CCLuaObjcBridge.mm; sourceTree = ""; }; - 1A6E479617781AB00055514D /* tolua_fix.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tolua_fix.c; sourceTree = ""; }; - 1A6E479717781AB00055514D /* tolua_fix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tolua_fix.h; sourceTree = ""; }; - 1A6E47A517781AB00055514D /* lauxlib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lauxlib.h; sourceTree = ""; }; - 1A6E47A617781AB00055514D /* lua.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua.h; sourceTree = ""; }; - 1A6E47A717781AB00055514D /* luaconf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = luaconf.h; sourceTree = ""; }; - 1A6E47A817781AB00055514D /* lualib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lualib.h; sourceTree = ""; }; - 1A6E47AA17781AB00055514D /* libluajit.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libluajit.a; sourceTree = ""; }; - 1A6E487717781AB00055514D /* tolua++.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "tolua++.h"; sourceTree = ""; }; - 1A6E487817781AB00055514D /* tolua_event.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tolua_event.c; sourceTree = ""; }; - 1A6E487917781AB00055514D /* tolua_event.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tolua_event.h; sourceTree = ""; }; - 1A6E487A17781AB00055514D /* tolua_is.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tolua_is.c; sourceTree = ""; }; - 1A6E487B17781AB00055514D /* tolua_map.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tolua_map.c; sourceTree = ""; }; - 1A6E487C17781AB00055514D /* tolua_push.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tolua_push.c; sourceTree = ""; }; - 1A6E487D17781AB00055514D /* tolua_to.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tolua_to.c; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 1A6E476717781A660055514D /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 1A6E476E17781A660055514D /* Foundation.framework in Frameworks */, - 1A6E488E17781AB00055514D /* libluajit.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 1A6E476117781A660055514D = { - isa = PBXGroup; - children = ( - 1A6E477B17781AB00055514D /* cocos2dx_support */, - 1A6E479817781AB00055514D /* luajit */, - 1A6E487617781AB00055514D /* tolua */, - 1A6E476C17781A660055514D /* Frameworks */, - 1A6E476B17781A660055514D /* Products */, - ); - sourceTree = ""; - }; - 1A6E476B17781A660055514D /* Products */ = { - isa = PBXGroup; - children = ( - 1A6E476A17781A660055514D /* libluabindings.a */, - ); - name = Products; - sourceTree = ""; - }; - 1A6E476C17781A660055514D /* Frameworks */ = { - isa = PBXGroup; - children = ( - 1A6E476D17781A660055514D /* Foundation.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - 1A6E477B17781AB00055514D /* cocos2dx_support */ = { - isa = PBXGroup; - children = ( - 1A6E477C17781AB00055514D /* CCBProxy.cpp */, - 1A6E477D17781AB00055514D /* CCBProxy.h */, - 1A6E477E17781AB00055514D /* CCLuaBridge.cpp */, - 1A6E477F17781AB00055514D /* CCLuaBridge.h */, - 1A6E478017781AB00055514D /* CCLuaEngine.cpp */, - 1A6E478117781AB00055514D /* CCLuaEngine.h */, - 1A6E478217781AB00055514D /* CCLuaStack.cpp */, - 1A6E478317781AB00055514D /* CCLuaStack.h */, - 1A6E478417781AB00055514D /* CCLuaValue.cpp */, - 1A6E478517781AB00055514D /* CCLuaValue.h */, - 1A6E478617781AB00055514D /* Cocos2dxLuaLoader.cpp */, - 1A6E478717781AB00055514D /* Cocos2dxLuaLoader.h */, - 1A6E478817781AB00055514D /* Lua_extensions_CCB.cpp */, - 1A6E478917781AB00055514D /* Lua_extensions_CCB.h */, - 1A6E478A17781AB00055514D /* Lua_web_socket.cpp */, - 1A6E478B17781AB00055514D /* Lua_web_socket.h */, - 1A6E478C17781AB00055514D /* LuaCocos2d.cpp */, - 1A6E478D17781AB00055514D /* LuaCocos2d.h */, - 1A6E478E17781AB00055514D /* LuaOpengl.cpp */, - 1A6E478F17781AB00055514D /* LuaOpengl.h */, - 1A6E479017781AB00055514D /* LuaScrollView.cpp */, - 1A6E479117781AB00055514D /* LuaScrollView.h */, - 1A6E479217781AB00055514D /* platform */, - 1A6E479617781AB00055514D /* tolua_fix.c */, - 1A6E479717781AB00055514D /* tolua_fix.h */, - ); - name = cocos2dx_support; - path = ../cocos2dx_support; - sourceTree = ""; - }; - 1A6E479217781AB00055514D /* platform */ = { - isa = PBXGroup; - children = ( - 1A6E479317781AB00055514D /* ios */, - ); - path = platform; - sourceTree = ""; - }; - 1A6E479317781AB00055514D /* ios */ = { - isa = PBXGroup; - children = ( - 1A6E479417781AB00055514D /* CCLuaObjcBridge.h */, - 1A6E479517781AB00055514D /* CCLuaObjcBridge.mm */, - ); - path = ios; - sourceTree = ""; - }; - 1A6E479817781AB00055514D /* luajit */ = { - isa = PBXGroup; - children = ( - 1A6E47A417781AB00055514D /* include */, - 1A6E47A917781AB00055514D /* ios */, - ); - name = luajit; - path = ../luajit; - sourceTree = ""; - }; - 1A6E47A417781AB00055514D /* include */ = { - isa = PBXGroup; - children = ( - 1A6E47A517781AB00055514D /* lauxlib.h */, - 1A6E47A617781AB00055514D /* lua.h */, - 1A6E47A717781AB00055514D /* luaconf.h */, - 1A6E47A817781AB00055514D /* lualib.h */, - ); - path = include; - sourceTree = ""; - }; - 1A6E47A917781AB00055514D /* ios */ = { - isa = PBXGroup; - children = ( - 1A6E47AA17781AB00055514D /* libluajit.a */, - ); - path = ios; - sourceTree = ""; - }; - 1A6E487617781AB00055514D /* tolua */ = { - isa = PBXGroup; - children = ( - 1A6E487717781AB00055514D /* tolua++.h */, - 1A6E487817781AB00055514D /* tolua_event.c */, - 1A6E487917781AB00055514D /* tolua_event.h */, - 1A6E487A17781AB00055514D /* tolua_is.c */, - 1A6E487B17781AB00055514D /* tolua_map.c */, - 1A6E487C17781AB00055514D /* tolua_push.c */, - 1A6E487D17781AB00055514D /* tolua_to.c */, - ); - name = tolua; - path = ../tolua; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 1A6E476917781A660055514D /* luabindings */ = { - isa = PBXNativeTarget; - buildConfigurationList = 1A6E477817781A660055514D /* Build configuration list for PBXNativeTarget "luabindings" */; - buildPhases = ( - 1A6E476617781A660055514D /* Sources */, - 1A6E476717781A660055514D /* Frameworks */, - 1A6E476817781A660055514D /* CopyFiles */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = luabindings; - productName = luabindings; - productReference = 1A6E476A17781A660055514D /* libluabindings.a */; - productType = "com.apple.product-type.library.static"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 1A6E476217781A660055514D /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0460; - }; - buildConfigurationList = 1A6E476517781A660055514D /* Build configuration list for PBXProject "luabindings" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - ); - mainGroup = 1A6E476117781A660055514D; - productRefGroup = 1A6E476B17781A660055514D /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 1A6E476917781A660055514D /* luabindings */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXSourcesBuildPhase section */ - 1A6E476617781A660055514D /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 1A6E487E17781AB00055514D /* CCBProxy.cpp in Sources */, - 1A6E487F17781AB00055514D /* CCLuaBridge.cpp in Sources */, - 1A6E488017781AB00055514D /* CCLuaEngine.cpp in Sources */, - 1A6E488117781AB00055514D /* CCLuaStack.cpp in Sources */, - 1A6E488217781AB00055514D /* CCLuaValue.cpp in Sources */, - 1A6E488317781AB00055514D /* Cocos2dxLuaLoader.cpp in Sources */, - 1A6E488417781AB00055514D /* Lua_extensions_CCB.cpp in Sources */, - 1A6E488517781AB00055514D /* Lua_web_socket.cpp in Sources */, - 1A6E488617781AB00055514D /* LuaCocos2d.cpp in Sources */, - 1A6E488717781AB00055514D /* LuaOpengl.cpp in Sources */, - 1A6E488817781AB00055514D /* LuaScrollView.cpp in Sources */, - 1A6E488917781AB00055514D /* CCLuaObjcBridge.mm in Sources */, - 1A6E488A17781AB00055514D /* tolua_fix.c in Sources */, - 1A6E48D717781AB00055514D /* tolua_event.c in Sources */, - 1A6E48D817781AB00055514D /* tolua_is.c in Sources */, - 1A6E48D917781AB00055514D /* tolua_map.c in Sources */, - 1A6E48DA17781AB00055514D /* tolua_push.c in Sources */, - 1A6E48DB17781AB00055514D /* tolua_to.c in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 1A6E477617781A660055514D /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 6.1; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - }; - name = Debug; - }; - 1A6E477717781A660055514D /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 6.1; - SDKROOT = iphoneos; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 1A6E477917781A660055514D /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; - DSTROOT = /tmp/luabindings.dst; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "luabindings-Prefix.pch"; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - CC_TARGET_OS_IPHONE, - "COCOS2D_DEBUG=1", - "CC_ENABLE_CHIPMUNK_INTEGRATION=1", - "$(inherited)", - ); - HEADER_SEARCH_PATHS = ( - "$(SRCROOT)/../../../CocosDenshion/include", - "\"$(SRCROOT)/../../../external/chipmunk/include/chipmunk\"", - "\"$(SRCROOT)/../../../external/libwebsockets/ios/include\"", - "\"$(SRCROOT)/../../../cocos2dx/kazmath/include\"", - "\"$(SRCROOT)/../../../external\"", - "\"$(SRCROOT)/../../../extensions\"", - "\"$(SRCROOT)/../../../extensions/LocalStorage\"", - "\"$(SRCROOT)/../../../extensions/network\"", - "\"$(SRCROOT)/../../../cocos2dx\"", - "\"$(SRCROOT)/../../../cocos2dx/include\"", - "\"$(SRCROOT)/../../../cocos2dx/platform/third_party/ios\"", - "\"$(SRCROOT)/../../../cocos2dx/platform/ios\"", - "\"$(SRCROOT)/../../../cocos2dx/platform/ios/Simulation\"", - ); - IPHONEOS_DEPLOYMENT_TARGET = 5.0; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "\"$(SRCROOT)/../luajit/ios\"", - ); - ONLY_ACTIVE_ARCH = YES; - OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 1A6E477A17781A660055514D /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; - DSTROOT = /tmp/luabindings.dst; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "luabindings-Prefix.pch"; - GCC_PREPROCESSOR_DEFINITIONS = ( - CC_TARGET_OS_IPHONE, - "CC_ENABLE_CHIPMUNK_INTEGRATION=1", - ); - HEADER_SEARCH_PATHS = ( - "$(SRCROOT)/../../../CocosDenshion/include", - "\"$(SRCROOT)/../../../external/chipmunk/include/chipmunk\"", - "\"$(SRCROOT)/../../../external/libwebsockets/ios/include\"", - "\"$(SRCROOT)/../../../cocos2dx/kazmath/include\"", - "\"$(SRCROOT)/../../../external\"", - "\"$(SRCROOT)/../../../extensions\"", - "\"$(SRCROOT)/../../../extensions/LocalStorage\"", - "\"$(SRCROOT)/../../../extensions/network\"", - "\"$(SRCROOT)/../../../cocos2dx\"", - "\"$(SRCROOT)/../../../cocos2dx/include\"", - "\"$(SRCROOT)/../../../cocos2dx/platform/third_party/ios\"", - "\"$(SRCROOT)/../../../cocos2dx/platform/ios\"", - "\"$(SRCROOT)/../../../cocos2dx/platform/ios/Simulation\"", - ); - IPHONEOS_DEPLOYMENT_TARGET = 5.0; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "\"$(SRCROOT)/../luajit/ios\"", - ); - ONLY_ACTIVE_ARCH = YES; - OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 1A6E476517781A660055514D /* Build configuration list for PBXProject "luabindings" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1A6E477617781A660055514D /* Debug */, - 1A6E477717781A660055514D /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 1A6E477817781A660055514D /* Build configuration list for PBXNativeTarget "luabindings" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1A6E477917781A660055514D /* Debug */, - 1A6E477A17781A660055514D /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 1A6E476217781A660055514D /* Project object */; -} diff --git a/samples/Lua/HelloLua/proj.ios/HelloLua.xcodeproj/project.pbxproj b/samples/Lua/HelloLua/proj.ios/HelloLua.xcodeproj/project.pbxproj deleted file mode 100644 index 1531215d78..0000000000 --- a/samples/Lua/HelloLua/proj.ios/HelloLua.xcodeproj/project.pbxproj +++ /dev/null @@ -1,491 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 1A6E48DF17781C0F0055514D /* libcocos2dx.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A6E48DC17781C0F0055514D /* libcocos2dx.a */; }; - 1A6E48E017781C0F0055514D /* libCocosDenshion.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A6E48DD17781C0F0055514D /* libCocosDenshion.a */; }; - 1A6E48E117781C0F0055514D /* libluabindings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A6E48DE17781C0F0055514D /* libluabindings.a */; }; - 1A6E48F017781D600055514D /* libchipmunk.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A6E48EE17781D600055514D /* libchipmunk.a */; }; - 1A6E48F317781D920055514D /* libBox2D.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A6E48F217781D920055514D /* libBox2D.a */; }; - 1A6E4902177821FB0055514D /* libextensions.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A6E4901177821FB0055514D /* libextensions.a */; }; - 1A6E49081778251B0055514D /* AudioEngine.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A6E49041778251B0055514D /* AudioEngine.lua */; }; - 1A6E49091778251B0055514D /* CCBReaderLoad.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A6E49051778251B0055514D /* CCBReaderLoad.lua */; }; - 1A6E490A1778251B0055514D /* Cocos2dConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A6E49061778251B0055514D /* Cocos2dConstants.lua */; }; - 1A6E490B1778251B0055514D /* OpenglConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A6E49071778251B0055514D /* OpenglConstants.lua */; }; - 506EDBA5102F4C9F00A389B3 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 506EDBA4102F4C9F00A389B3 /* AVFoundation.framework */; }; - 78947C6D14EBB9B100DBD5A6 /* background.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 78947C5E14EBB9B000DBD5A6 /* background.mp3 */; }; - 78947C6E14EBB9B100DBD5A6 /* crop.png in Resources */ = {isa = PBXBuildFile; fileRef = 78947C5F14EBB9B000DBD5A6 /* crop.png */; }; - 78947C7014EBB9B100DBD5A6 /* dog.png in Resources */ = {isa = PBXBuildFile; fileRef = 78947C6114EBB9B000DBD5A6 /* dog.png */; }; - 78947C7114EBB9B100DBD5A6 /* effect1.wav in Resources */ = {isa = PBXBuildFile; fileRef = 78947C6214EBB9B000DBD5A6 /* effect1.wav */; }; - 78947C7214EBB9B100DBD5A6 /* farm.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 78947C6314EBB9B000DBD5A6 /* farm.jpg */; }; - 78947C7414EBB9B100DBD5A6 /* hello.lua in Resources */ = {isa = PBXBuildFile; fileRef = 78947C6614EBB9B000DBD5A6 /* hello.lua */; }; - 78947C7514EBB9B100DBD5A6 /* hello2.lua in Resources */ = {isa = PBXBuildFile; fileRef = 78947C6714EBB9B000DBD5A6 /* hello2.lua */; }; - 78947C7714EBB9B100DBD5A6 /* land.png in Resources */ = {isa = PBXBuildFile; fileRef = 78947C6914EBB9B000DBD5A6 /* land.png */; }; - 78947C7814EBB9B100DBD5A6 /* menu1.png in Resources */ = {isa = PBXBuildFile; fileRef = 78947C6A14EBB9B000DBD5A6 /* menu1.png */; }; - 78947C7914EBB9B100DBD5A6 /* menu2.png in Resources */ = {isa = PBXBuildFile; fileRef = 78947C6B14EBB9B000DBD5A6 /* menu2.png */; }; - 78DC4C9A15490B9500317402 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 78DC4C9815490B9500317402 /* Default.png */; }; - BF82F41713A864D700616D55 /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BF82F41513A864D700616D55 /* AppDelegate.cpp */; }; - BF82F42113A8652A00616D55 /* AppController.mm in Sources */ = {isa = PBXBuildFile; fileRef = BF82F41F13A8652A00616D55 /* AppController.mm */; }; - BF82F42213A8652A00616D55 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = BF82F42013A8652A00616D55 /* main.m */; }; - D41A0AA2160F13F8004552AE /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = D41A0AA1160F13F8004552AE /* Default-568h@2x.png */; }; - D446FD3B16102085000ADA7B /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = D446FD3A16102085000ADA7B /* Default@2x.png */; }; - D4CEAD7913B4634300780515 /* RootViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = D4CEAD7713B4634300780515 /* RootViewController.mm */; }; - D4EF94D715BD311700D803EB /* Icon-57.png in Resources */ = {isa = PBXBuildFile; fileRef = D4EF94D615BD311700D803EB /* Icon-57.png */; }; - D4EF94D915BD311A00D803EB /* Icon-114.png in Resources */ = {isa = PBXBuildFile; fileRef = D4EF94D815BD311A00D803EB /* Icon-114.png */; }; - D4EF94DB15BD311E00D803EB /* Icon-72.png in Resources */ = {isa = PBXBuildFile; fileRef = D4EF94DA15BD311E00D803EB /* Icon-72.png */; }; - D4EF94DD15BD312100D803EB /* Icon-144.png in Resources */ = {isa = PBXBuildFile; fileRef = D4EF94DC15BD312100D803EB /* Icon-144.png */; }; - DC6640030F83B3EA000B3E49 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DC6640020F83B3EA000B3E49 /* AudioToolbox.framework */; }; - DC6640050F83B3EA000B3E49 /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DC6640040F83B3EA000B3E49 /* OpenAL.framework */; }; - DCCBF1B70F6022AE0040855A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DCCBF1B60F6022AE0040855A /* CoreGraphics.framework */; }; - DCCBF1B90F6022AE0040855A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DCCBF1B80F6022AE0040855A /* Foundation.framework */; }; - DCCBF1BB0F6022AE0040855A /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DCCBF1BA0F6022AE0040855A /* OpenGLES.framework */; }; - DCCBF1BD0F6022AE0040855A /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DCCBF1BC0F6022AE0040855A /* QuartzCore.framework */; }; - DCCBF1BF0F6022AE0040855A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DCCBF1BE0F6022AE0040855A /* UIKit.framework */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - 1A6E48DC17781C0F0055514D /* libcocos2dx.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; name = libcocos2dx.a; path = "libcocos2dx.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 1A6E48DD17781C0F0055514D /* libCocosDenshion.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; name = libCocosDenshion.a; path = "libCocosDenshion.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 1A6E48DE17781C0F0055514D /* libluabindings.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; name = libluabindings.a; path = "libluabindings.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 1A6E48EE17781D600055514D /* libchipmunk.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; name = libchipmunk.a; path = "libchipmunk.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 1A6E48F217781D920055514D /* libBox2D.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; name = libBox2D.a; path = "libBox2D.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 1A6E4901177821FB0055514D /* libextensions.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; name = libextensions.a; path = "libextensions.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 1A6E49041778251B0055514D /* AudioEngine.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = AudioEngine.lua; sourceTree = ""; }; - 1A6E49051778251B0055514D /* CCBReaderLoad.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CCBReaderLoad.lua; sourceTree = ""; }; - 1A6E49061778251B0055514D /* Cocos2dConstants.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Cocos2dConstants.lua; sourceTree = ""; }; - 1A6E49071778251B0055514D /* OpenglConstants.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = OpenglConstants.lua; sourceTree = ""; }; - 1D6058910D05DD3D006BFB54 /* HelloLua.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HelloLua.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 506EDBA4102F4C9F00A389B3 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; - 78947C5E14EBB9B000DBD5A6 /* background.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = background.mp3; sourceTree = ""; }; - 78947C5F14EBB9B000DBD5A6 /* crop.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = crop.png; sourceTree = ""; }; - 78947C6114EBB9B000DBD5A6 /* dog.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = dog.png; sourceTree = ""; }; - 78947C6214EBB9B000DBD5A6 /* effect1.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = effect1.wav; sourceTree = ""; }; - 78947C6314EBB9B000DBD5A6 /* farm.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = farm.jpg; sourceTree = ""; }; - 78947C6614EBB9B000DBD5A6 /* hello.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = hello.lua; sourceTree = ""; }; - 78947C6714EBB9B000DBD5A6 /* hello2.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = hello2.lua; sourceTree = ""; }; - 78947C6914EBB9B000DBD5A6 /* land.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = land.png; sourceTree = ""; }; - 78947C6A14EBB9B000DBD5A6 /* menu1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu1.png; sourceTree = ""; }; - 78947C6B14EBB9B000DBD5A6 /* menu2.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu2.png; sourceTree = ""; }; - 78DC4C9815490B9500317402 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = SOURCE_ROOT; }; - BF82F41513A864D700616D55 /* AppDelegate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AppDelegate.cpp; path = ../Classes/AppDelegate.cpp; sourceTree = SOURCE_ROOT; }; - BF82F41613A864D700616D55 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = ../Classes/AppDelegate.h; sourceTree = SOURCE_ROOT; }; - BF82F41E13A8652A00616D55 /* AppController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppController.h; sourceTree = ""; }; - BF82F41F13A8652A00616D55 /* AppController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AppController.mm; sourceTree = ""; }; - BF82F42013A8652A00616D55 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - BF82F42313A8654600616D55 /* HelloLua_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HelloLua_Prefix.pch; sourceTree = ""; }; - D41A0AA1160F13F8004552AE /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-568h@2x.png"; path = "../proj.ios/Default-568h@2x.png"; sourceTree = ""; }; - D446FD3A16102085000ADA7B /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default@2x.png"; path = "../proj.ios/Default@2x.png"; sourceTree = ""; }; - D4CEAD7713B4634300780515 /* RootViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RootViewController.mm; sourceTree = ""; }; - D4CEAD7813B4634300780515 /* RootViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RootViewController.h; sourceTree = ""; }; - D4EF94D615BD311700D803EB /* Icon-57.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-57.png"; path = "../proj.ios/Icon-57.png"; sourceTree = ""; }; - D4EF94D815BD311A00D803EB /* Icon-114.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-114.png"; path = "../proj.ios/Icon-114.png"; sourceTree = ""; }; - D4EF94DA15BD311E00D803EB /* Icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-72.png"; path = "../proj.ios/Icon-72.png"; sourceTree = ""; }; - D4EF94DC15BD312100D803EB /* Icon-144.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-144.png"; path = "../proj.ios/Icon-144.png"; sourceTree = ""; }; - DC6640020F83B3EA000B3E49 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; }; - DC6640040F83B3EA000B3E49 /* OpenAL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenAL.framework; path = System/Library/Frameworks/OpenAL.framework; sourceTree = SDKROOT; }; - DCCBF1B60F6022AE0040855A /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; - DCCBF1B80F6022AE0040855A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; - DCCBF1BA0F6022AE0040855A /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; - DCCBF1BC0F6022AE0040855A /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; - DCCBF1BE0F6022AE0040855A /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 1D60588F0D05DD3D006BFB54 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 1A6E4902177821FB0055514D /* libextensions.a in Frameworks */, - 1A6E48F317781D920055514D /* libBox2D.a in Frameworks */, - 1A6E48F017781D600055514D /* libchipmunk.a in Frameworks */, - 1A6E48DF17781C0F0055514D /* libcocos2dx.a in Frameworks */, - 1A6E48E017781C0F0055514D /* libCocosDenshion.a in Frameworks */, - 1A6E48E117781C0F0055514D /* libluabindings.a in Frameworks */, - DCCBF1B70F6022AE0040855A /* CoreGraphics.framework in Frameworks */, - DCCBF1B90F6022AE0040855A /* Foundation.framework in Frameworks */, - DCCBF1BB0F6022AE0040855A /* OpenGLES.framework in Frameworks */, - DCCBF1BD0F6022AE0040855A /* QuartzCore.framework in Frameworks */, - DCCBF1BF0F6022AE0040855A /* UIKit.framework in Frameworks */, - DC6640030F83B3EA000B3E49 /* AudioToolbox.framework in Frameworks */, - DC6640050F83B3EA000B3E49 /* OpenAL.framework in Frameworks */, - 506EDBA5102F4C9F00A389B3 /* AVFoundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 19C28FACFE9D520D11CA2CBB /* Products */ = { - isa = PBXGroup; - children = ( - 1D6058910D05DD3D006BFB54 /* HelloLua.app */, - ); - name = Products; - sourceTree = ""; - }; - 1A6E49031778251B0055514D /* script */ = { - isa = PBXGroup; - children = ( - 1A6E49041778251B0055514D /* AudioEngine.lua */, - 1A6E49051778251B0055514D /* CCBReaderLoad.lua */, - 1A6E49061778251B0055514D /* Cocos2dConstants.lua */, - 1A6E49071778251B0055514D /* OpenglConstants.lua */, - ); - name = script; - path = ../../../../scripting/lua/script; - sourceTree = ""; - }; - 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { - isa = PBXGroup; - children = ( - BF82F41413A864B000616D55 /* Classes */, - 29B97323FDCFA39411CA2CEA /* Frameworks */, - 29B97315FDCFA39411CA2CEA /* Other Sources */, - 19C28FACFE9D520D11CA2CBB /* Products */, - 78947C5C14EBB9B000DBD5A6 /* Resources */, - ); - name = CustomTemplate; - sourceTree = ""; - }; - 29B97315FDCFA39411CA2CEA /* Other Sources */ = { - isa = PBXGroup; - children = ( - D4CEAD7713B4634300780515 /* RootViewController.mm */, - D4CEAD7813B4634300780515 /* RootViewController.h */, - BF82F42313A8654600616D55 /* HelloLua_Prefix.pch */, - BF82F41E13A8652A00616D55 /* AppController.h */, - BF82F41F13A8652A00616D55 /* AppController.mm */, - BF82F42013A8652A00616D55 /* main.m */, - ); - name = "Other Sources"; - sourceTree = ""; - }; - 29B97323FDCFA39411CA2CEA /* Frameworks */ = { - isa = PBXGroup; - children = ( - 1A6E48F217781D920055514D /* libBox2D.a */, - 1A6E48EE17781D600055514D /* libchipmunk.a */, - 1A6E48DC17781C0F0055514D /* libcocos2dx.a */, - 1A6E48DD17781C0F0055514D /* libCocosDenshion.a */, - 1A6E4901177821FB0055514D /* libextensions.a */, - 1A6E48DE17781C0F0055514D /* libluabindings.a */, - DCCBF1B60F6022AE0040855A /* CoreGraphics.framework */, - DCCBF1B80F6022AE0040855A /* Foundation.framework */, - DCCBF1BA0F6022AE0040855A /* OpenGLES.framework */, - DCCBF1BC0F6022AE0040855A /* QuartzCore.framework */, - DCCBF1BE0F6022AE0040855A /* UIKit.framework */, - DC6640040F83B3EA000B3E49 /* OpenAL.framework */, - DC6640020F83B3EA000B3E49 /* AudioToolbox.framework */, - 506EDBA4102F4C9F00A389B3 /* AVFoundation.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - 78947C5C14EBB9B000DBD5A6 /* Resources */ = { - isa = PBXGroup; - children = ( - 1A6E49031778251B0055514D /* script */, - D4EF94DC15BD312100D803EB /* Icon-144.png */, - D4EF94DA15BD311E00D803EB /* Icon-72.png */, - D4EF94D815BD311A00D803EB /* Icon-114.png */, - D4EF94D615BD311700D803EB /* Icon-57.png */, - 78947C5E14EBB9B000DBD5A6 /* background.mp3 */, - 78947C5F14EBB9B000DBD5A6 /* crop.png */, - 78947C6114EBB9B000DBD5A6 /* dog.png */, - 78947C6214EBB9B000DBD5A6 /* effect1.wav */, - 78947C6314EBB9B000DBD5A6 /* farm.jpg */, - 78947C6614EBB9B000DBD5A6 /* hello.lua */, - 78947C6714EBB9B000DBD5A6 /* hello2.lua */, - 78947C6914EBB9B000DBD5A6 /* land.png */, - 78947C6A14EBB9B000DBD5A6 /* menu1.png */, - 78947C6B14EBB9B000DBD5A6 /* menu2.png */, - 78DC4C9815490B9500317402 /* Default.png */, - D446FD3A16102085000ADA7B /* Default@2x.png */, - D41A0AA1160F13F8004552AE /* Default-568h@2x.png */, - ); - name = Resources; - path = ../Resources; - sourceTree = ""; - }; - BF82F41413A864B000616D55 /* Classes */ = { - isa = PBXGroup; - children = ( - BF82F41513A864D700616D55 /* AppDelegate.cpp */, - BF82F41613A864D700616D55 /* AppDelegate.h */, - ); - name = Classes; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 1D6058900D05DD3D006BFB54 /* HelloLua */ = { - isa = PBXNativeTarget; - buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "HelloLua" */; - buildPhases = ( - 1D60588D0D05DD3D006BFB54 /* Resources */, - 1D60588E0D05DD3D006BFB54 /* Sources */, - 1D60588F0D05DD3D006BFB54 /* Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = HelloLua; - productName = HelloLua; - productReference = 1D6058910D05DD3D006BFB54 /* HelloLua.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 29B97313FDCFA39411CA2CEA /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0430; - }; - buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "HelloLua" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 1; - knownRegions = ( - English, - Japanese, - French, - German, - ); - mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 1D6058900D05DD3D006BFB54 /* HelloLua */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 1D60588D0D05DD3D006BFB54 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 78947C6D14EBB9B100DBD5A6 /* background.mp3 in Resources */, - 78947C6E14EBB9B100DBD5A6 /* crop.png in Resources */, - 78947C7014EBB9B100DBD5A6 /* dog.png in Resources */, - 78947C7114EBB9B100DBD5A6 /* effect1.wav in Resources */, - 78947C7214EBB9B100DBD5A6 /* farm.jpg in Resources */, - 78947C7414EBB9B100DBD5A6 /* hello.lua in Resources */, - 78947C7514EBB9B100DBD5A6 /* hello2.lua in Resources */, - 78947C7714EBB9B100DBD5A6 /* land.png in Resources */, - 78947C7814EBB9B100DBD5A6 /* menu1.png in Resources */, - 78947C7914EBB9B100DBD5A6 /* menu2.png in Resources */, - 78DC4C9A15490B9500317402 /* Default.png in Resources */, - D4EF94D715BD311700D803EB /* Icon-57.png in Resources */, - D4EF94D915BD311A00D803EB /* Icon-114.png in Resources */, - D4EF94DB15BD311E00D803EB /* Icon-72.png in Resources */, - D4EF94DD15BD312100D803EB /* Icon-144.png in Resources */, - D41A0AA2160F13F8004552AE /* Default-568h@2x.png in Resources */, - D446FD3B16102085000ADA7B /* Default@2x.png in Resources */, - 1A6E49081778251B0055514D /* AudioEngine.lua in Resources */, - 1A6E49091778251B0055514D /* CCBReaderLoad.lua in Resources */, - 1A6E490A1778251B0055514D /* Cocos2dConstants.lua in Resources */, - 1A6E490B1778251B0055514D /* OpenglConstants.lua in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 1D60588E0D05DD3D006BFB54 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - BF82F41713A864D700616D55 /* AppDelegate.cpp in Sources */, - BF82F42113A8652A00616D55 /* AppController.mm in Sources */, - BF82F42213A8652A00616D55 /* main.m in Sources */, - D4CEAD7913B4634300780515 /* RootViewController.mm in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 1D6058940D05DD3E006BFB54 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; - CLANG_CXX_LIBRARY = "libc++"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_DYNAMIC_NO_PIC = NO; - GCC_FAST_OBJC_DISPATCH = YES; - GCC_INLINES_ARE_PRIVATE_EXTERN = NO; - GCC_OBJC_CALL_CXX_CDTORS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = HelloLua_Prefix.pch; - GCC_PREPROCESSOR_DEFINITIONS = ( - USE_FILE32API, - CC_TARGET_OS_IPHONE, - "COCOS2D_DEBUG=1", - "CC_ENABLE_CHIPMUNK_INTEGRATION=1", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_TREAT_WARNINGS_AS_ERRORS = NO; - GCC_VERSION = ""; - GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = NO; - HEADER_SEARCH_PATHS = ( - "\"$(SRCROOT)/../../../../cocos2dx/\"", - "\"$(SRCROOT)/../../../../cocos2dx/include\"", - "\"$(SRCROOT)/../../../../cocos2dx/kazmath/include\"", - "\"$(SRCROOT)/../../../../cocos2dx/platform/ios\"", - "\"$(SRCROOT)/../../../../cocos2dx/platform/third_party/ios\"", - "\"$(SRCROOT)/../../../../CocosDenshion/include\"", - "\"$(SRCROOT)/../../../../scripting/lua/cocos2dx_support\"", - "\"$(SRCROOT)/../../../../scripting/lua/luajit/include\"", - "\"$(SRCROOT)/../../../../scripting/lua/tolua\"", - ); - INFOPLIST_FILE = Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 5.0; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "\"$(SRCROOT)/../../../../cocos2dx/platform/third_party/ios/libraries\"", - ); - ONLY_ACTIVE_ARCH = YES; - OTHER_LDFLAGS = "-lz"; - PRODUCT_NAME = HelloLua; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = NO; - VALID_ARCHS = "armv7 armv7s"; - WARNING_CFLAGS = ""; - }; - name = Debug; - }; - 1D6058950D05DD3E006BFB54 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; - CLANG_CXX_LIBRARY = "libc++"; - COPY_PHASE_STRIP = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_FAST_OBJC_DISPATCH = YES; - GCC_INLINES_ARE_PRIVATE_EXTERN = NO; - GCC_OBJC_CALL_CXX_CDTORS = YES; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = HelloLua_Prefix.pch; - GCC_PREPROCESSOR_DEFINITIONS = ( - USE_FILE32API, - CC_TARGET_OS_IPHONE, - "CC_ENABLE_CHIPMUNK_INTEGRATION=1", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_TREAT_WARNINGS_AS_ERRORS = NO; - GCC_VERSION = ""; - GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = NO; - HEADER_SEARCH_PATHS = ( - "\"$(SRCROOT)/../../../../cocos2dx/\"", - "\"$(SRCROOT)/../../../../cocos2dx/include\"", - "\"$(SRCROOT)/../../../../cocos2dx/kazmath/include\"", - "\"$(SRCROOT)/../../../../cocos2dx/platform/ios\"", - "\"$(SRCROOT)/../../../../cocos2dx/platform/third_party/ios\"", - "\"$(SRCROOT)/../../../../CocosDenshion/include\"", - "\"$(SRCROOT)/../../../../scripting/lua/cocos2dx_support\"", - "\"$(SRCROOT)/../../../../scripting/lua/luajit/include\"", - "\"$(SRCROOT)/../../../../scripting/lua/tolua\"", - ); - INFOPLIST_FILE = Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 5.0; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "\"$(SRCROOT)/../../../../cocos2dx/platform/third_party/ios/libraries\"", - ); - ONLY_ACTIVE_ARCH = YES; - OTHER_LDFLAGS = "-lz"; - PRODUCT_NAME = HelloLua; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = NO; - VALID_ARCHS = "armv7 armv7s"; - WARNING_CFLAGS = ""; - }; - name = Release; - }; - C01FCF4F08A954540054247B /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_PREPROCESSOR_DEFINITIONS = ( - DEBUG, - "COCOS2D_DEBUG=1", - "CD_DEBUG=1", - ); - "GCC_THUMB_SUPPORT[arch=armv6]" = NO; - "GCC_THUMB_SUPPORT[arch=armv7]" = YES; - GCC_VERSION = ""; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 4.0; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALID_ARCHS = "armv6 armv7 i386"; - }; - name = Debug; - }; - C01FCF5008A954540054247B /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - GCC_C_LANGUAGE_STANDARD = c99; - "GCC_THUMB_SUPPORT[arch=armv6]" = NO; - "GCC_THUMB_SUPPORT[arch=armv7]" = YES; - GCC_UNROLL_LOOPS = YES; - GCC_VERSION = ""; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 4.0; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALID_ARCHS = "armv6 armv7 i386"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "HelloLua" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1D6058940D05DD3E006BFB54 /* Debug */, - 1D6058950D05DD3E006BFB54 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - C01FCF4E08A954540054247B /* Build configuration list for PBXProject "HelloLua" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C01FCF4F08A954540054247B /* Debug */, - C01FCF5008A954540054247B /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; -} diff --git a/samples/Lua/TestLua/proj.ios/TestLua.xcodeproj/project.pbxproj b/samples/Lua/TestLua/proj.ios/TestLua.xcodeproj/project.pbxproj deleted file mode 100644 index 7d60946d93..0000000000 --- a/samples/Lua/TestLua/proj.ios/TestLua.xcodeproj/project.pbxproj +++ /dev/null @@ -1,573 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 159B8A28175D9A930005B47D /* cocosbuilderRes in Resources */ = {isa = PBXBuildFile; fileRef = 159B8A27175D9A930005B47D /* cocosbuilderRes */; }; - 15C156981683138E00D239F2 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 15C156911683138E00D239F2 /* Default-568h@2x.png */; }; - 15C156991683138E00D239F2 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 15C156921683138E00D239F2 /* Default.png */; }; - 15C1569A1683138E00D239F2 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 15C156931683138E00D239F2 /* Default@2x.png */; }; - 15C1569B1683138E00D239F2 /* Icon-57.png in Resources */ = {isa = PBXBuildFile; fileRef = 15C156941683138E00D239F2 /* Icon-57.png */; }; - 15C1569C1683138E00D239F2 /* Icon-72.png in Resources */ = {isa = PBXBuildFile; fileRef = 15C156951683138E00D239F2 /* Icon-72.png */; }; - 15C1569D1683138E00D239F2 /* Icon-114.png in Resources */ = {isa = PBXBuildFile; fileRef = 15C156961683138E00D239F2 /* Icon-114.png */; }; - 15C1569E1683138E00D239F2 /* Icon-144.png in Resources */ = {isa = PBXBuildFile; fileRef = 15C156971683138E00D239F2 /* Icon-144.png */; }; - 1A6E48E817781C2B0055514D /* libBox2D.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A6E48E217781C2B0055514D /* libBox2D.a */; }; - 1A6E48E917781C2B0055514D /* libchipmunk.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A6E48E317781C2B0055514D /* libchipmunk.a */; }; - 1A6E48EA17781C2B0055514D /* libcocos2dx.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A6E48E417781C2B0055514D /* libcocos2dx.a */; }; - 1A6E48EB17781C2B0055514D /* libCocosDenshion.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A6E48E517781C2B0055514D /* libCocosDenshion.a */; }; - 1A6E48ED17781C2B0055514D /* libluabindings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A6E48E717781C2B0055514D /* libluabindings.a */; }; - 1A6E48FB17781F9F0055514D /* AudioEngine.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A6E48F717781F9F0055514D /* AudioEngine.lua */; }; - 1A6E48FC17781F9F0055514D /* CCBReaderLoad.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A6E48F817781F9F0055514D /* CCBReaderLoad.lua */; }; - 1A6E48FD17781F9F0055514D /* Cocos2dConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A6E48F917781F9F0055514D /* Cocos2dConstants.lua */; }; - 1A6E48FE17781F9F0055514D /* OpenglConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A6E48FA17781F9F0055514D /* OpenglConstants.lua */; }; - 1A6E4900177821AF0055514D /* libextensions.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A6E48FF177821AF0055514D /* libextensions.a */; }; - 1AD263A2168350490089000C /* luaScript in Resources */ = {isa = PBXBuildFile; fileRef = 1AD263A1168350490089000C /* luaScript */; }; - 1AD263BB1683506D0089000C /* animations in Resources */ = {isa = PBXBuildFile; fileRef = 1AD263A31683506C0089000C /* animations */; }; - 1AD263BC1683506D0089000C /* app.icf in Resources */ = {isa = PBXBuildFile; fileRef = 1AD263A41683506C0089000C /* app.icf */; }; - 1AD263BD1683506D0089000C /* background.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 1AD263A51683506C0089000C /* background.mp3 */; }; - 1AD263BE1683506D0089000C /* background.ogg in Resources */ = {isa = PBXBuildFile; fileRef = 1AD263A61683506C0089000C /* background.ogg */; }; - 1AD263BF1683506D0089000C /* ccb in Resources */ = {isa = PBXBuildFile; fileRef = 1AD263A71683506C0089000C /* ccb */; }; - 1AD263C01683506D0089000C /* CocosBuilderExample.ccbproj in Resources */ = {isa = PBXBuildFile; fileRef = 1AD263A81683506C0089000C /* CocosBuilderExample.ccbproj */; }; - 1AD263C11683506D0089000C /* CocosBuilderExample.ccbresourcelog in Resources */ = {isa = PBXBuildFile; fileRef = 1AD263A91683506C0089000C /* CocosBuilderExample.ccbresourcelog */; }; - 1AD263C21683506D0089000C /* development.icf in Resources */ = {isa = PBXBuildFile; fileRef = 1AD263AA1683506C0089000C /* development.icf */; }; - 1AD263C31683506D0089000C /* effect1.raw in Resources */ = {isa = PBXBuildFile; fileRef = 1AD263AB1683506C0089000C /* effect1.raw */; }; - 1AD263C41683506D0089000C /* effect1.wav in Resources */ = {isa = PBXBuildFile; fileRef = 1AD263AC1683506C0089000C /* effect1.wav */; }; - 1AD263C51683506D0089000C /* effect2.ogg in Resources */ = {isa = PBXBuildFile; fileRef = 1AD263AD1683506C0089000C /* effect2.ogg */; }; - 1AD263C61683506D0089000C /* extensions in Resources */ = {isa = PBXBuildFile; fileRef = 1AD263AE1683506C0089000C /* extensions */; }; - 1AD263C71683506D0089000C /* fonts in Resources */ = {isa = PBXBuildFile; fileRef = 1AD263AF1683506C0089000C /* fonts */; }; - 1AD263C81683506D0089000C /* fps_images.png in Resources */ = {isa = PBXBuildFile; fileRef = 1AD263B01683506C0089000C /* fps_images.png */; }; - 1AD263C91683506D0089000C /* hd in Resources */ = {isa = PBXBuildFile; fileRef = 1AD263B11683506C0089000C /* hd */; }; - 1AD263CA1683506D0089000C /* Hello.png in Resources */ = {isa = PBXBuildFile; fileRef = 1AD263B21683506C0089000C /* Hello.png */; }; - 1AD263CB1683506D0089000C /* Images in Resources */ = {isa = PBXBuildFile; fileRef = 1AD263B31683506C0089000C /* Images */; }; - 1AD263CC1683506D0089000C /* ipad in Resources */ = {isa = PBXBuildFile; fileRef = 1AD263B41683506C0089000C /* ipad */; }; - 1AD263CD1683506D0089000C /* ipadhd in Resources */ = {isa = PBXBuildFile; fileRef = 1AD263B51683506C0089000C /* ipadhd */; }; - 1AD263CE1683506D0089000C /* music.mid in Resources */ = {isa = PBXBuildFile; fileRef = 1AD263B61683506C0089000C /* music.mid */; }; - 1AD263CF1683506D0089000C /* Particles in Resources */ = {isa = PBXBuildFile; fileRef = 1AD263B71683506C0089000C /* Particles */; }; - 1AD263D01683506D0089000C /* Shaders in Resources */ = {isa = PBXBuildFile; fileRef = 1AD263B81683506C0089000C /* Shaders */; }; - 1AD263D11683506D0089000C /* TileMaps in Resources */ = {isa = PBXBuildFile; fileRef = 1AD263B91683506C0089000C /* TileMaps */; }; - 1AD263D21683506D0089000C /* zwoptex in Resources */ = {isa = PBXBuildFile; fileRef = 1AD263BA1683506C0089000C /* zwoptex */; }; - F293B3CD15EB7BE500256477 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F293B3CC15EB7BE500256477 /* QuartzCore.framework */; }; - F293B3CF15EB7BE500256477 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F293B3CE15EB7BE500256477 /* OpenGLES.framework */; }; - F293B3D115EB7BE500256477 /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F293B3D015EB7BE500256477 /* OpenAL.framework */; }; - F293B3D315EB7BE500256477 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F293B3D215EB7BE500256477 /* AudioToolbox.framework */; }; - F293B3D515EB7BE500256477 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F293B3D415EB7BE500256477 /* AVFoundation.framework */; }; - F293B3D715EB7BE500256477 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F293B3D615EB7BE500256477 /* UIKit.framework */; }; - F293B3D915EB7BE500256477 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F293B3D815EB7BE500256477 /* Foundation.framework */; }; - F293B3DB15EB7BE500256477 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F293B3DA15EB7BE500256477 /* CoreGraphics.framework */; }; - F293B6FC15EB823D00256477 /* AppController.mm in Sources */ = {isa = PBXBuildFile; fileRef = F293B6F715EB823D00256477 /* AppController.mm */; }; - F293B6FD15EB823D00256477 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = F293B6F815EB823D00256477 /* main.m */; }; - F293B6FE15EB823D00256477 /* RootViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = F293B6FA15EB823D00256477 /* RootViewController.mm */; }; - F293BB9C15EB831F00256477 /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F293BB7E15EB831F00256477 /* AppDelegate.cpp */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - 159B8A27175D9A930005B47D /* cocosbuilderRes */ = {isa = PBXFileReference; lastKnownFileType = folder; name = cocosbuilderRes; path = ../../../Lua/TestLua/Resources/cocosbuilderRes; sourceTree = ""; }; - 15C156911683138E00D239F2 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = SOURCE_ROOT; }; - 15C156921683138E00D239F2 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = SOURCE_ROOT; }; - 15C156931683138E00D239F2 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = SOURCE_ROOT; }; - 15C156941683138E00D239F2 /* Icon-57.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-57.png"; sourceTree = SOURCE_ROOT; }; - 15C156951683138E00D239F2 /* Icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-72.png"; sourceTree = SOURCE_ROOT; }; - 15C156961683138E00D239F2 /* Icon-114.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-114.png"; sourceTree = SOURCE_ROOT; }; - 15C156971683138E00D239F2 /* Icon-144.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-144.png"; sourceTree = SOURCE_ROOT; }; - 1A6E48E217781C2B0055514D /* libBox2D.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; name = libBox2D.a; path = "libBox2D.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 1A6E48E317781C2B0055514D /* libchipmunk.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; name = libchipmunk.a; path = "libchipmunk.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 1A6E48E417781C2B0055514D /* libcocos2dx.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; name = libcocos2dx.a; path = "libcocos2dx.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 1A6E48E517781C2B0055514D /* libCocosDenshion.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; name = libCocosDenshion.a; path = "libCocosDenshion.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 1A6E48E717781C2B0055514D /* libluabindings.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; name = libluabindings.a; path = "libluabindings.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 1A6E48F717781F9F0055514D /* AudioEngine.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = AudioEngine.lua; sourceTree = ""; }; - 1A6E48F817781F9F0055514D /* CCBReaderLoad.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CCBReaderLoad.lua; sourceTree = ""; }; - 1A6E48F917781F9F0055514D /* Cocos2dConstants.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Cocos2dConstants.lua; sourceTree = ""; }; - 1A6E48FA17781F9F0055514D /* OpenglConstants.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = OpenglConstants.lua; sourceTree = ""; }; - 1A6E48FF177821AF0055514D /* libextensions.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; name = libextensions.a; path = "libextensions.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AD263A1168350490089000C /* luaScript */ = {isa = PBXFileReference; lastKnownFileType = folder; name = luaScript; path = ../../../Lua/TestLua/Resources/luaScript; sourceTree = ""; }; - 1AD263A31683506C0089000C /* animations */ = {isa = PBXFileReference; lastKnownFileType = folder; path = animations; sourceTree = ""; }; - 1AD263A41683506C0089000C /* app.icf */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = app.icf; sourceTree = ""; }; - 1AD263A51683506C0089000C /* background.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = background.mp3; sourceTree = ""; }; - 1AD263A61683506C0089000C /* background.ogg */ = {isa = PBXFileReference; lastKnownFileType = file; path = background.ogg; sourceTree = ""; }; - 1AD263A71683506C0089000C /* ccb */ = {isa = PBXFileReference; lastKnownFileType = folder; path = ccb; sourceTree = ""; }; - 1AD263A81683506C0089000C /* CocosBuilderExample.ccbproj */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = CocosBuilderExample.ccbproj; sourceTree = ""; }; - 1AD263A91683506C0089000C /* CocosBuilderExample.ccbresourcelog */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CocosBuilderExample.ccbresourcelog; sourceTree = ""; }; - 1AD263AA1683506C0089000C /* development.icf */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = development.icf; sourceTree = ""; }; - 1AD263AB1683506C0089000C /* effect1.raw */ = {isa = PBXFileReference; lastKnownFileType = file; path = effect1.raw; sourceTree = ""; }; - 1AD263AC1683506C0089000C /* effect1.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = effect1.wav; sourceTree = ""; }; - 1AD263AD1683506C0089000C /* effect2.ogg */ = {isa = PBXFileReference; lastKnownFileType = file; path = effect2.ogg; sourceTree = ""; }; - 1AD263AE1683506C0089000C /* extensions */ = {isa = PBXFileReference; lastKnownFileType = folder; path = extensions; sourceTree = ""; }; - 1AD263AF1683506C0089000C /* fonts */ = {isa = PBXFileReference; lastKnownFileType = folder; path = fonts; sourceTree = ""; }; - 1AD263B01683506C0089000C /* fps_images.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = fps_images.png; sourceTree = ""; }; - 1AD263B11683506C0089000C /* hd */ = {isa = PBXFileReference; lastKnownFileType = folder; path = hd; sourceTree = ""; }; - 1AD263B21683506C0089000C /* Hello.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Hello.png; sourceTree = ""; }; - 1AD263B31683506C0089000C /* Images */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Images; sourceTree = ""; }; - 1AD263B41683506C0089000C /* ipad */ = {isa = PBXFileReference; lastKnownFileType = folder; path = ipad; sourceTree = ""; }; - 1AD263B51683506C0089000C /* ipadhd */ = {isa = PBXFileReference; lastKnownFileType = folder; path = ipadhd; sourceTree = ""; }; - 1AD263B61683506C0089000C /* music.mid */ = {isa = PBXFileReference; lastKnownFileType = audio.midi; path = music.mid; sourceTree = ""; }; - 1AD263B71683506C0089000C /* Particles */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Particles; sourceTree = ""; }; - 1AD263B81683506C0089000C /* Shaders */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Shaders; sourceTree = ""; }; - 1AD263B91683506C0089000C /* TileMaps */ = {isa = PBXFileReference; lastKnownFileType = folder; path = TileMaps; sourceTree = ""; }; - 1AD263BA1683506C0089000C /* zwoptex */ = {isa = PBXFileReference; lastKnownFileType = folder; path = zwoptex; sourceTree = ""; }; - F293B3C815EB7BE500256477 /* TestLua.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TestLua.app; sourceTree = BUILT_PRODUCTS_DIR; }; - F293B3CC15EB7BE500256477 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; - F293B3CE15EB7BE500256477 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; - F293B3D015EB7BE500256477 /* OpenAL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenAL.framework; path = System/Library/Frameworks/OpenAL.framework; sourceTree = SDKROOT; }; - F293B3D215EB7BE500256477 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; }; - F293B3D415EB7BE500256477 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; - F293B3D615EB7BE500256477 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; - F293B3D815EB7BE500256477 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; - F293B3DA15EB7BE500256477 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; - F293B6F615EB823D00256477 /* AppController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppController.h; sourceTree = ""; }; - F293B6F715EB823D00256477 /* AppController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AppController.mm; sourceTree = ""; }; - F293B6F815EB823D00256477 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - F293B6F915EB823D00256477 /* RootViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RootViewController.h; sourceTree = ""; }; - F293B6FA15EB823D00256477 /* RootViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RootViewController.mm; sourceTree = ""; }; - F293B6FB15EB823D00256477 /* TestLua_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestLua_Prefix.pch; sourceTree = ""; }; - F293BB7E15EB831F00256477 /* AppDelegate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AppDelegate.cpp; path = ../Classes/AppDelegate.cpp; sourceTree = ""; }; - F293BB7F15EB831F00256477 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = ../Classes/AppDelegate.h; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - F293B3C515EB7BE500256477 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 1A6E48E817781C2B0055514D /* libBox2D.a in Frameworks */, - 1A6E48E917781C2B0055514D /* libchipmunk.a in Frameworks */, - 1A6E48EA17781C2B0055514D /* libcocos2dx.a in Frameworks */, - 1A6E48EB17781C2B0055514D /* libCocosDenshion.a in Frameworks */, - 1A6E4900177821AF0055514D /* libextensions.a in Frameworks */, - 1A6E48ED17781C2B0055514D /* libluabindings.a in Frameworks */, - F293B3CD15EB7BE500256477 /* QuartzCore.framework in Frameworks */, - F293B3CF15EB7BE500256477 /* OpenGLES.framework in Frameworks */, - F293B3D115EB7BE500256477 /* OpenAL.framework in Frameworks */, - F293B3D315EB7BE500256477 /* AudioToolbox.framework in Frameworks */, - F293B3D515EB7BE500256477 /* AVFoundation.framework in Frameworks */, - F293B3D715EB7BE500256477 /* UIKit.framework in Frameworks */, - F293B3D915EB7BE500256477 /* Foundation.framework in Frameworks */, - F293B3DB15EB7BE500256477 /* CoreGraphics.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 1A6E48F617781F9F0055514D /* script */ = { - isa = PBXGroup; - children = ( - 1A6E48F717781F9F0055514D /* AudioEngine.lua */, - 1A6E48F817781F9F0055514D /* CCBReaderLoad.lua */, - 1A6E48F917781F9F0055514D /* Cocos2dConstants.lua */, - 1A6E48FA17781F9F0055514D /* OpenglConstants.lua */, - ); - name = script; - path = ../../../../scripting/lua/script; - sourceTree = ""; - }; - F293B3BD15EB7BE500256477 = { - isa = PBXGroup; - children = ( - F293BB7C15EB830F00256477 /* Classes */, - F293B3CB15EB7BE500256477 /* Frameworks */, - F293B6E815EB807E00256477 /* Other Sources */, - F293B3C915EB7BE500256477 /* Products */, - F293BC4615EB859D00256477 /* Resources */, - ); - sourceTree = ""; - }; - F293B3C915EB7BE500256477 /* Products */ = { - isa = PBXGroup; - children = ( - F293B3C815EB7BE500256477 /* TestLua.app */, - ); - name = Products; - sourceTree = ""; - }; - F293B3CB15EB7BE500256477 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 1A6E48E217781C2B0055514D /* libBox2D.a */, - 1A6E48E317781C2B0055514D /* libchipmunk.a */, - 1A6E48E417781C2B0055514D /* libcocos2dx.a */, - 1A6E48E517781C2B0055514D /* libCocosDenshion.a */, - 1A6E48FF177821AF0055514D /* libextensions.a */, - 1A6E48E717781C2B0055514D /* libluabindings.a */, - F293B3CC15EB7BE500256477 /* QuartzCore.framework */, - F293B3CE15EB7BE500256477 /* OpenGLES.framework */, - F293B3D015EB7BE500256477 /* OpenAL.framework */, - F293B3D215EB7BE500256477 /* AudioToolbox.framework */, - F293B3D415EB7BE500256477 /* AVFoundation.framework */, - F293B3D615EB7BE500256477 /* UIKit.framework */, - F293B3D815EB7BE500256477 /* Foundation.framework */, - F293B3DA15EB7BE500256477 /* CoreGraphics.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - F293B6E815EB807E00256477 /* Other Sources */ = { - isa = PBXGroup; - children = ( - F293B6F615EB823D00256477 /* AppController.h */, - F293B6F715EB823D00256477 /* AppController.mm */, - F293B6F815EB823D00256477 /* main.m */, - F293B6F915EB823D00256477 /* RootViewController.h */, - F293B6FA15EB823D00256477 /* RootViewController.mm */, - F293B6FB15EB823D00256477 /* TestLua_Prefix.pch */, - ); - name = "Other Sources"; - sourceTree = ""; - }; - F293BB7C15EB830F00256477 /* Classes */ = { - isa = PBXGroup; - children = ( - F293BB7E15EB831F00256477 /* AppDelegate.cpp */, - F293BB7F15EB831F00256477 /* AppDelegate.h */, - ); - name = Classes; - sourceTree = ""; - }; - F293BC4615EB859D00256477 /* Resources */ = { - isa = PBXGroup; - children = ( - 1A6E48F617781F9F0055514D /* script */, - 159B8A27175D9A930005B47D /* cocosbuilderRes */, - 1AD263A31683506C0089000C /* animations */, - 1AD263A41683506C0089000C /* app.icf */, - 1AD263A51683506C0089000C /* background.mp3 */, - 1AD263A61683506C0089000C /* background.ogg */, - 1AD263A71683506C0089000C /* ccb */, - 1AD263A81683506C0089000C /* CocosBuilderExample.ccbproj */, - 1AD263A91683506C0089000C /* CocosBuilderExample.ccbresourcelog */, - 1AD263AA1683506C0089000C /* development.icf */, - 1AD263AB1683506C0089000C /* effect1.raw */, - 1AD263AC1683506C0089000C /* effect1.wav */, - 1AD263AD1683506C0089000C /* effect2.ogg */, - 1AD263AE1683506C0089000C /* extensions */, - 1AD263AF1683506C0089000C /* fonts */, - 1AD263B01683506C0089000C /* fps_images.png */, - 1AD263B11683506C0089000C /* hd */, - 1AD263B21683506C0089000C /* Hello.png */, - 1AD263B31683506C0089000C /* Images */, - 1AD263B41683506C0089000C /* ipad */, - 1AD263B51683506C0089000C /* ipadhd */, - 1AD263B61683506C0089000C /* music.mid */, - 1AD263B71683506C0089000C /* Particles */, - 1AD263B81683506C0089000C /* Shaders */, - 1AD263B91683506C0089000C /* TileMaps */, - 1AD263BA1683506C0089000C /* zwoptex */, - 1AD263A1168350490089000C /* luaScript */, - 15C156911683138E00D239F2 /* Default-568h@2x.png */, - 15C156921683138E00D239F2 /* Default.png */, - 15C156931683138E00D239F2 /* Default@2x.png */, - 15C156941683138E00D239F2 /* Icon-57.png */, - 15C156951683138E00D239F2 /* Icon-72.png */, - 15C156961683138E00D239F2 /* Icon-114.png */, - 15C156971683138E00D239F2 /* Icon-144.png */, - ); - name = Resources; - path = ../../../Cpp/TestCpp/Resources; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - F293B3C715EB7BE500256477 /* TestLua */ = { - isa = PBXNativeTarget; - buildConfigurationList = F293B6C415EB7BEA00256477 /* Build configuration list for PBXNativeTarget "TestLua" */; - buildPhases = ( - F293B3C415EB7BE500256477 /* Sources */, - F293B3C515EB7BE500256477 /* Frameworks */, - F293B3C615EB7BE500256477 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = TestLua; - productName = TestLua; - productReference = F293B3C815EB7BE500256477 /* TestLua.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - F293B3BF15EB7BE500256477 /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0430; - }; - buildConfigurationList = F293B3C215EB7BE500256477 /* Build configuration list for PBXProject "TestLua" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - ); - mainGroup = F293B3BD15EB7BE500256477; - productRefGroup = F293B3C915EB7BE500256477 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - F293B3C715EB7BE500256477 /* TestLua */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - F293B3C615EB7BE500256477 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 15C156981683138E00D239F2 /* Default-568h@2x.png in Resources */, - 15C156991683138E00D239F2 /* Default.png in Resources */, - 15C1569A1683138E00D239F2 /* Default@2x.png in Resources */, - 15C1569B1683138E00D239F2 /* Icon-57.png in Resources */, - 15C1569C1683138E00D239F2 /* Icon-72.png in Resources */, - 15C1569D1683138E00D239F2 /* Icon-114.png in Resources */, - 15C1569E1683138E00D239F2 /* Icon-144.png in Resources */, - 1AD263A2168350490089000C /* luaScript in Resources */, - 1AD263BB1683506D0089000C /* animations in Resources */, - 1AD263BC1683506D0089000C /* app.icf in Resources */, - 1AD263BD1683506D0089000C /* background.mp3 in Resources */, - 1AD263BE1683506D0089000C /* background.ogg in Resources */, - 1AD263BF1683506D0089000C /* ccb in Resources */, - 1AD263C01683506D0089000C /* CocosBuilderExample.ccbproj in Resources */, - 1AD263C11683506D0089000C /* CocosBuilderExample.ccbresourcelog in Resources */, - 1AD263C21683506D0089000C /* development.icf in Resources */, - 1AD263C31683506D0089000C /* effect1.raw in Resources */, - 1AD263C41683506D0089000C /* effect1.wav in Resources */, - 1AD263C51683506D0089000C /* effect2.ogg in Resources */, - 1AD263C61683506D0089000C /* extensions in Resources */, - 1AD263C71683506D0089000C /* fonts in Resources */, - 1AD263C81683506D0089000C /* fps_images.png in Resources */, - 1AD263C91683506D0089000C /* hd in Resources */, - 1AD263CA1683506D0089000C /* Hello.png in Resources */, - 1AD263CB1683506D0089000C /* Images in Resources */, - 1AD263CC1683506D0089000C /* ipad in Resources */, - 1AD263CD1683506D0089000C /* ipadhd in Resources */, - 1AD263CE1683506D0089000C /* music.mid in Resources */, - 1AD263CF1683506D0089000C /* Particles in Resources */, - 1AD263D01683506D0089000C /* Shaders in Resources */, - 1AD263D11683506D0089000C /* TileMaps in Resources */, - 1AD263D21683506D0089000C /* zwoptex in Resources */, - 159B8A28175D9A930005B47D /* cocosbuilderRes in Resources */, - 1A6E48FB17781F9F0055514D /* AudioEngine.lua in Resources */, - 1A6E48FC17781F9F0055514D /* CCBReaderLoad.lua in Resources */, - 1A6E48FD17781F9F0055514D /* Cocos2dConstants.lua in Resources */, - 1A6E48FE17781F9F0055514D /* OpenglConstants.lua in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - F293B3C415EB7BE500256477 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - F293B6FC15EB823D00256477 /* AppController.mm in Sources */, - F293B6FD15EB823D00256477 /* main.m in Sources */, - F293B6FE15EB823D00256477 /* RootViewController.mm in Sources */, - F293BB9C15EB831F00256477 /* AppDelegate.cpp in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - F293B6C215EB7BEA00256477 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - DEBUG, - "COCOS2D_DEBUG=1", - USE_FILE32API, - TARGET_OS_IPHONE, - "CC_LUA_ENGINE_ENABLED=1", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ( - "\"$(PROJECT_NAME)/libs/cocos2dx/kazmath/include\"", - "\"$(PROJECT_NAME)/libs/cocos2dx\"", - "\"$(PROJECT_NAME)/libs/CocosDenshion/include\"", - "\"$(SDKROOT)/usr/include/libxml2\"", - "\"$(SRCROOT)/../../../cocos2dx/\"", - "\"$(SRCROOT)/../../../cocos2dx/kazmath/include\"", - "\"$(SRCROOT)/../../../external/lua/tolua\"", - "\"$(SRCROOT)/../../../external/lua/src\"", - "$(SRCROOT)/../../../external/lua/cocos2dx_support", - "$(SRCROOT)/../../../cocos2dx/platform/ios", - "$(SRCROOT)/../../../cocos2dx/include", - ); - IPHONEOS_DEPLOYMENT_TARGET = 5.1; - PROVISIONING_PROFILE = ""; - "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; - SDKROOT = iphoneos; - }; - name = Debug; - }; - F293B6C315EB7BEA00256477 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_PREPROCESSOR_DEFINITIONS = ( - NDEBUG, - USE_FILE32API, - TARGET_OS_IPHONE, - "CC_LUA_ENGINE_ENABLED=1", - ); - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ( - "\"$(PROJECT_NAME)/libs/cocos2dx/kazmath/include\"", - "\"$(PROJECT_NAME)/libs/cocos2dx\"", - "\"$(PROJECT_NAME)/libs/CocosDenshion/include\"", - "\"$(SDKROOT)/usr/include/libxml2\"", - "\"$(SRCROOT)/../../../cocos2dx/\"", - "\"$(SRCROOT)/../../../cocos2dx/kazmath/include\"", - "\"$(SRCROOT)/../../../external/lua/tolua\"", - "\"$(SRCROOT)/../../../external/lua/src\"", - "$(SRCROOT)/../../../external/lua/cocos2dx_support", - "$(SRCROOT)/../../../cocos2dx/platform/ios", - "$(SRCROOT)/../../../cocos2dx/include", - ); - IPHONEOS_DEPLOYMENT_TARGET = 5.1; - OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; - PROVISIONING_PROFILE = ""; - "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; - SDKROOT = iphoneos; - }; - name = Release; - }; - F293B6C515EB7BEA00256477 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = TestLua_Prefix.pch; - GCC_PREPROCESSOR_DEFINITIONS = ( - DEBUG, - "COCOS2D_DEBUG=1", - USE_FILE32API, - CC_TARGET_OS_IPHONE, - "CC_LUA_ENGINE_ENABLED=1", - "CC_ENABLE_BOX2D_INTEGRATION=1", - ); - "GCC_THUMB_SUPPORT[arch=armv6]" = ""; - HEADER_SEARCH_PATHS = ( - "\"$(SRCROOT)/../../../../cocos2dx/\"", - "\"$(SRCROOT)/../../../../cocos2dx/include\"", - "\"$(SRCROOT)/../../../../cocos2dx/kazmath/include\"", - "\"$(SRCROOT)/../../../../cocos2dx/platform/ios\"", - "\"$(SRCROOT)/../../../../cocos2dx/platform/third_party/ios\"", - "\"$(SRCROOT)/../../../../CocosDenshion/include\"", - "\"$(SRCROOT)/../../../../scripting/lua/cocos2dx_support\"", - "\"$(SRCROOT)/../../../../scripting/lua/luajit/include\"", - "\"$(SRCROOT)/../../../../scripting/lua/tolua\"", - ); - INFOPLIST_FILE = Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 5.0; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(SRCROOT)/../../../../cocos2dx/platform/third_party/ios/libraries", - ); - ONLY_ACTIVE_ARCH = YES; - OTHER_LDFLAGS = "-lz"; - PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE = ""; - "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; - TARGETED_DEVICE_FAMILY = "1,2"; - WRAPPER_EXTENSION = app; - }; - name = Debug; - }; - F293B6C615EB7BEA00256477 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = YES; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = TestLua_Prefix.pch; - GCC_PREPROCESSOR_DEFINITIONS = ( - NDEBUG, - USE_FILE32API, - CC_TARGET_OS_IPHONE, - "CC_LUA_ENGINE_ENABLED=1", - "CC_ENABLE_BOX2D_INTEGRATION=1", - ); - "GCC_THUMB_SUPPORT[arch=armv6]" = ""; - HEADER_SEARCH_PATHS = ( - "\"$(SRCROOT)/../../../../cocos2dx/\"", - "\"$(SRCROOT)/../../../../cocos2dx/include\"", - "\"$(SRCROOT)/../../../../cocos2dx/kazmath/include\"", - "\"$(SRCROOT)/../../../../cocos2dx/platform/ios\"", - "\"$(SRCROOT)/../../../../cocos2dx/platform/third_party/ios\"", - "\"$(SRCROOT)/../../../../CocosDenshion/include\"", - "\"$(SRCROOT)/../../../../scripting/lua/cocos2dx_support\"", - "\"$(SRCROOT)/../../../../scripting/lua/luajit/include\"", - "\"$(SRCROOT)/../../../../scripting/lua/tolua\"", - ); - INFOPLIST_FILE = Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 5.0; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(SRCROOT)/../../../../cocos2dx/platform/third_party/ios/libraries", - ); - ONLY_ACTIVE_ARCH = YES; - OTHER_LDFLAGS = "-lz"; - PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE = ""; - "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - WRAPPER_EXTENSION = app; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - F293B3C215EB7BE500256477 /* Build configuration list for PBXProject "TestLua" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - F293B6C215EB7BEA00256477 /* Debug */, - F293B6C315EB7BEA00256477 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - F293B6C415EB7BEA00256477 /* Build configuration list for PBXNativeTarget "TestLua" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - F293B6C515EB7BEA00256477 /* Debug */, - F293B6C615EB7BEA00256477 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = F293B3BF15EB7BE500256477 /* Project object */; -} From 8eeb911e8f4df475d041341f35d94c30204751fe Mon Sep 17 00:00:00 2001 From: minggo Date: Sat, 12 Oct 2013 15:25:45 +0800 Subject: [PATCH 22/64] issue #2905: adjust folder structure --- cocos/base/CCPlatformConfig.h | 140 ++ cocos/base/CCPlatformMacros.h | 301 ++++ cocos/base/atitc/atitc.cpp | 195 +++ cocos/base/atitc/atitc.h | 48 + cocos/base/cocoa/CCAffineTransform.cpp | 132 ++ cocos/base/cocoa/CCAffineTransform.h | 63 + cocos/base/cocoa/CCArray.cpp | 754 +++++++++ cocos/base/cocoa/CCArray.h | 557 ++++++ cocos/base/cocoa/CCAutoreleasePool.cpp | 204 +++ cocos/base/cocoa/CCAutoreleasePool.h | 181 ++ cocos/base/cocoa/CCBool.h | 70 + cocos/base/cocoa/CCData.cpp | 61 + cocos/base/cocoa/CCData.h | 88 + cocos/base/cocoa/CCDataVisitor.cpp | 240 +++ cocos/base/cocoa/CCDataVisitor.h | 117 ++ cocos/base/cocoa/CCDictionary.cpp | 454 +++++ cocos/base/cocoa/CCDictionary.h | 458 +++++ cocos/base/cocoa/CCDouble.h | 70 + cocos/base/cocoa/CCFloat.h | 71 + cocos/base/cocoa/CCGeometry.cpp | 463 +++++ cocos/base/cocoa/CCGeometry.h | 564 +++++++ cocos/base/cocoa/CCInteger.h | 79 + cocos/base/cocoa/CCNS.cpp | 185 ++ cocos/base/cocoa/CCNS.h | 80 + cocos/base/cocoa/CCObject.cpp | 93 + cocos/base/cocoa/CCObject.h | 216 +++ cocos/base/cocoa/CCSet.cpp | 166 ++ cocos/base/cocoa/CCSet.h | 119 ++ cocos/base/cocoa/CCString.cpp | 277 +++ cocos/base/cocoa/CCString.h | 210 +++ cocos/base/etc1/etc1.cpp | 670 ++++++++ cocos/base/etc1/etc1.h | 106 ++ cocos/base/s3tc/s3tc.cpp | 182 ++ cocos/base/s3tc/s3tc.h | 48 + external/tinyxml2/tinyxml2.cpp | 2101 +++++++++++++++++++++++ external/tinyxml2/tinyxml2.h | 1914 +++++++++++++++++++++ external/unzip/ioapi.cpp | 245 +++ external/unzip/ioapi.h | 201 +++ external/unzip/unzip.cpp | 2161 ++++++++++++++++++++++++ external/unzip/unzip.h | 455 +++++ 40 files changed, 14739 insertions(+) create mode 100644 cocos/base/CCPlatformConfig.h create mode 100644 cocos/base/CCPlatformMacros.h create mode 100644 cocos/base/atitc/atitc.cpp create mode 100644 cocos/base/atitc/atitc.h create mode 100644 cocos/base/cocoa/CCAffineTransform.cpp create mode 100644 cocos/base/cocoa/CCAffineTransform.h create mode 100644 cocos/base/cocoa/CCArray.cpp create mode 100644 cocos/base/cocoa/CCArray.h create mode 100644 cocos/base/cocoa/CCAutoreleasePool.cpp create mode 100644 cocos/base/cocoa/CCAutoreleasePool.h create mode 100644 cocos/base/cocoa/CCBool.h create mode 100644 cocos/base/cocoa/CCData.cpp create mode 100644 cocos/base/cocoa/CCData.h create mode 100644 cocos/base/cocoa/CCDataVisitor.cpp create mode 100644 cocos/base/cocoa/CCDataVisitor.h create mode 100644 cocos/base/cocoa/CCDictionary.cpp create mode 100644 cocos/base/cocoa/CCDictionary.h create mode 100644 cocos/base/cocoa/CCDouble.h create mode 100644 cocos/base/cocoa/CCFloat.h create mode 100644 cocos/base/cocoa/CCGeometry.cpp create mode 100644 cocos/base/cocoa/CCGeometry.h create mode 100644 cocos/base/cocoa/CCInteger.h create mode 100644 cocos/base/cocoa/CCNS.cpp create mode 100644 cocos/base/cocoa/CCNS.h create mode 100644 cocos/base/cocoa/CCObject.cpp create mode 100644 cocos/base/cocoa/CCObject.h create mode 100644 cocos/base/cocoa/CCSet.cpp create mode 100644 cocos/base/cocoa/CCSet.h create mode 100644 cocos/base/cocoa/CCString.cpp create mode 100644 cocos/base/cocoa/CCString.h create mode 100644 cocos/base/etc1/etc1.cpp create mode 100644 cocos/base/etc1/etc1.h create mode 100644 cocos/base/s3tc/s3tc.cpp create mode 100644 cocos/base/s3tc/s3tc.h create mode 100644 external/tinyxml2/tinyxml2.cpp create mode 100644 external/tinyxml2/tinyxml2.h create mode 100644 external/unzip/ioapi.cpp create mode 100644 external/unzip/ioapi.h create mode 100644 external/unzip/unzip.cpp create mode 100644 external/unzip/unzip.h diff --git a/cocos/base/CCPlatformConfig.h b/cocos/base/CCPlatformConfig.h new file mode 100644 index 0000000000..5ba0757dac --- /dev/null +++ b/cocos/base/CCPlatformConfig.h @@ -0,0 +1,140 @@ +/**************************************************************************** +Copyright (c) 2010 cocos2d-x.org + +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 __CC_PLATFORM_CONFIG_H__ +#define __CC_PLATFORM_CONFIG_H__ + +/** +Config of cocos2d-x project, per target platform. +*/ + +////////////////////////////////////////////////////////////////////////// +// pre configure +////////////////////////////////////////////////////////////////////////// + +// define supported target platform macro which CC uses. +#define CC_PLATFORM_UNKNOWN 0 +#define CC_PLATFORM_IOS 1 +#define CC_PLATFORM_ANDROID 2 +#define CC_PLATFORM_WIN32 3 +#define CC_PLATFORM_MARMALADE 4 +#define CC_PLATFORM_LINUX 5 +#define CC_PLATFORM_BADA 6 +#define CC_PLATFORM_BLACKBERRY 7 +#define CC_PLATFORM_MAC 8 +#define CC_PLATFORM_NACL 9 +#define CC_PLATFORM_EMSCRIPTEN 10 +#define CC_PLATFORM_TIZEN 11 +#define CC_PLATFORM_QT5 12 + +// Determine target platform by compile environment macro. +#define CC_TARGET_PLATFORM CC_PLATFORM_UNKNOWN + +// mac +#if defined(CC_TARGET_OS_MAC) +#undef CC_TARGET_PLATFORM +#define CC_TARGET_PLATFORM CC_PLATFORM_MAC +#endif + +// iphone +#if defined(CC_TARGET_OS_IPHONE) + #undef CC_TARGET_PLATFORM + #define CC_TARGET_PLATFORM CC_PLATFORM_IOS +#endif + +// android +#if defined(ANDROID) + #undef CC_TARGET_PLATFORM + #define CC_TARGET_PLATFORM CC_PLATFORM_ANDROID +#endif + +// win32 +#if defined(WIN32) && defined(_WINDOWS) + #undef CC_TARGET_PLATFORM + #define CC_TARGET_PLATFORM CC_PLATFORM_WIN32 +#endif + +// linux +#if defined(LINUX) + #undef CC_TARGET_PLATFORM + #define CC_TARGET_PLATFORM CC_PLATFORM_LINUX +#endif + +// marmalade +#if defined(MARMALADE) +#undef CC_TARGET_PLATFORM +#define CC_TARGET_PLATFORM CC_PLATFORM_MARMALADE +#endif + +// bada +#if defined(SHP) +#undef CC_TARGET_PLATFORM +#define CC_TARGET_PLATFORM CC_PLATFORM_BADA +#endif + +// qnx +#if defined(__QNX__) + #undef CC_TARGET_PLATFORM + #define CC_TARGET_PLATFORM CC_PLATFORM_BLACKBERRY +#endif + +// native client +#if defined(__native_client__) + #undef CC_TARGET_PLATFORM + #define CC_TARGET_PLATFORM CC_PLATFORM_NACL +#endif + +// Emscripten +#if defined(EMSCRIPTEN) + #undef CC_TARGET_PLATFORM + #define CC_TARGET_PLATFORM CC_PLATFORM_EMSCRIPTEN +#endif + +// tizen +#if defined(TIZEN) + #undef CC_TARGET_PLATFORM + #define CC_TARGET_PLATFORM CC_PLATFORM_TIZEN +#endif + +// qt5 +#if defined(CC_TARGET_QT5) + #undef CC_TARGET_PLATFORM + #define CC_TARGET_PLATFORM CC_PLATFORM_QT5 +#endif + +////////////////////////////////////////////////////////////////////////// +// post configure +////////////////////////////////////////////////////////////////////////// + +// check user set platform +#if ! CC_TARGET_PLATFORM + #error "Cannot recognize the target platform; are you targeting an unsupported platform?" +#endif + +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#pragma warning (disable:4127) +#endif // CC_PLATFORM_WIN32 + +#endif // __CC_PLATFORM_CONFIG_H__ + diff --git a/cocos/base/CCPlatformMacros.h b/cocos/base/CCPlatformMacros.h new file mode 100644 index 0000000000..fca1255c0d --- /dev/null +++ b/cocos/base/CCPlatformMacros.h @@ -0,0 +1,301 @@ +/**************************************************************************** + Copyright (c) 2010 cocos2d-x.org + + 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 __CC_PLATFORM_MACROS_H__ +#define __CC_PLATFORM_MACROS_H__ + +/** + * define some platform specific macros + */ +#include "ccConfig.h" +#include "CCPlatformConfig.h" +#include "CCPlatformDefine.h" + +/** + * define a create function for a specific type, such as Layer + * @param \__TYPE__ class type to add create(), such as Layer + */ +#define CREATE_FUNC(__TYPE__) \ +static __TYPE__* create() \ +{ \ + __TYPE__ *pRet = new __TYPE__(); \ + if (pRet && pRet->init()) \ + { \ + pRet->autorelease(); \ + return pRet; \ + } \ + else \ + { \ + delete pRet; \ + pRet = NULL; \ + return NULL; \ + } \ +} + +/** + * define a node function for a specific type, such as Layer + * @param \__TYPE__ class type to add node(), such as Layer + * @deprecated This interface will be deprecated sooner or later. + */ +#define NODE_FUNC(__TYPE__) \ +CC_DEPRECATED_ATTRIBUTE static __TYPE__* node() \ +{ \ + __TYPE__ *pRet = new __TYPE__(); \ + if (pRet && pRet->init()) \ + { \ + pRet->autorelease(); \ + return pRet; \ + } \ + else \ + { \ + delete pRet; \ + pRet = NULL; \ + return NULL; \ + } \ +} + +/** @def CC_ENABLE_CACHE_TEXTURE_DATA +Enable it if you want to cache the texture data. +Not enabling for Emscripten any more -- doesn't seem necessary and don't want +to be different from other platforms unless there's a good reason. + +It's new in cocos2d-x since v0.99.5 +*/ +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) + #define CC_ENABLE_CACHE_TEXTURE_DATA 1 +#else + #define CC_ENABLE_CACHE_TEXTURE_DATA 0 +#endif + +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_EMSCRIPTEN) + /* Application will crash in glDrawElements function on some win32 computers and some android devices. + Indices should be bound again while drawing to avoid this bug. + */ + #define CC_REBIND_INDICES_BUFFER 1 +#else + #define CC_REBIND_INDICES_BUFFER 0 +#endif + +// generic macros + +// namespace cocos2d {} +#ifdef __cplusplus + #define NS_CC_BEGIN namespace cocos2d { + #define NS_CC_END } + #define USING_NS_CC using namespace cocos2d +#else + #define NS_CC_BEGIN + #define NS_CC_END + #define USING_NS_CC +#endif + +/** CC_PROPERTY_READONLY is used to declare a protected variable. + We can use getter to read the variable. + @param varType the type of variable. + @param varName variable name. + @param funName "get + funName" will be the name of the getter. + @warning The getter is a public virtual function, you should rewrite it first. + The variables and methods declared after CC_PROPERTY_READONLY are all public. + If you need protected or private, please declare. + */ +#define CC_PROPERTY_READONLY(varType, varName, funName)\ +protected: varType varName;\ +public: virtual varType get##funName(void) const; + +#define CC_PROPERTY_READONLY_PASS_BY_REF(varType, varName, funName)\ +protected: varType varName;\ +public: virtual const varType& get##funName(void) const; + +/** CC_PROPERTY is used to declare a protected variable. + We can use getter to read the variable, and use the setter to change the variable. + @param varType the type of variable. + @param varName variable name. + @param funName "get + funName" will be the name of the getter. + "set + funName" will be the name of the setter. + @warning The getter and setter are public virtual functions, you should rewrite them first. + The variables and methods declared after CC_PROPERTY are all public. + If you need protected or private, please declare. + */ +#define CC_PROPERTY(varType, varName, funName)\ +protected: varType varName;\ +public: virtual varType get##funName(void);\ +public: virtual void set##funName(varType var); + +#define CC_PROPERTY_PASS_BY_REF(varType, varName, funName)\ +protected: varType varName;\ +public: virtual const varType& get##funName(void) const;\ +public: virtual void set##funName(const varType& var); + +/** CC_SYNTHESIZE_READONLY is used to declare a protected variable. + We can use getter to read the variable. + @param varType the type of variable. + @param varName variable name. + @param funName "get + funName" will be the name of the getter. + @warning The getter is a public inline function. + The variables and methods declared after CC_SYNTHESIZE_READONLY are all public. + If you need protected or private, please declare. + */ +#define CC_SYNTHESIZE_READONLY(varType, varName, funName)\ +protected: varType varName;\ +public: virtual varType get##funName(void) const { return varName; } + +#define CC_SYNTHESIZE_READONLY_PASS_BY_REF(varType, varName, funName)\ +protected: varType varName;\ +public: virtual const varType& get##funName(void) const { return varName; } + +/** CC_SYNTHESIZE is used to declare a protected variable. + We can use getter to read the variable, and use the setter to change the variable. + @param varType the type of variable. + @param varName variable name. + @param funName "get + funName" will be the name of the getter. + "set + funName" will be the name of the setter. + @warning The getter and setter are public inline functions. + The variables and methods declared after CC_SYNTHESIZE are all public. + If you need protected or private, please declare. + */ +#define CC_SYNTHESIZE(varType, varName, funName)\ +protected: varType varName;\ +public: virtual varType get##funName(void) const { return varName; }\ +public: virtual void set##funName(varType var){ varName = var; } + +#define CC_SYNTHESIZE_PASS_BY_REF(varType, varName, funName)\ +protected: varType varName;\ +public: virtual const varType& get##funName(void) const { return varName; }\ +public: virtual void set##funName(const varType& var){ varName = var; } + +#define CC_SYNTHESIZE_RETAIN(varType, varName, funName) \ +private: varType varName; \ +public: virtual varType get##funName(void) const { return varName; } \ +public: virtual void set##funName(varType var) \ +{ \ + if (varName != var) \ + { \ + CC_SAFE_RETAIN(var); \ + CC_SAFE_RELEASE(varName); \ + varName = var; \ + } \ +} + +#define CC_SAFE_DELETE(p) do { delete (p); (p) = nullptr; } while(0) +#define CC_SAFE_DELETE_ARRAY(p) do { if(p) { delete[] (p); (p) = nullptr; } } while(0) +#define CC_SAFE_FREE(p) do { if(p) { free(p); (p) = nullptr; } } while(0) +#define CC_SAFE_RELEASE(p) do { if(p) { (p)->release(); } } while(0) +#define CC_SAFE_RELEASE_NULL(p) do { if(p) { (p)->release(); (p) = nullptr; } } while(0) +#define CC_SAFE_RETAIN(p) do { if(p) { (p)->retain(); } } while(0) +#define CC_BREAK_IF(cond) if(cond) break + +#define __CCLOGWITHFUNCTION(s, ...) \ + log("%s : %s",__FUNCTION__, String::createWithFormat(s, ##__VA_ARGS__)->getCString()) + +// cocos2d debug +#if !defined(COCOS2D_DEBUG) || COCOS2D_DEBUG == 0 +#define CCLOG(...) do {} while (0) +#define CCLOGINFO(...) do {} while (0) +#define CCLOGERROR(...) do {} while (0) +#define CCLOGWARN(...) do {} while (0) + +#elif COCOS2D_DEBUG == 1 +#define CCLOG(format, ...) cocos2d::log(format, ##__VA_ARGS__) +#define CCLOGERROR(format,...) cocos2d::log(format, ##__VA_ARGS__) +#define CCLOGINFO(format,...) do {} while (0) +#define CCLOGWARN(...) __CCLOGWITHFUNCTION(__VA_ARGS__) + +#elif COCOS2D_DEBUG > 1 +#define CCLOG(format, ...) cocos2d::log(format, ##__VA_ARGS__) +#define CCLOGERROR(format,...) cocos2d::log(format, ##__VA_ARGS__) +#define CCLOGINFO(format,...) cocos2d::log(format, ##__VA_ARGS__) +#define CCLOGWARN(...) __CCLOGWITHFUNCTION(__VA_ARGS__) +#endif // COCOS2D_DEBUG + +// Lua engine debug +#if !defined(COCOS2D_DEBUG) || COCOS2D_DEBUG == 0 || CC_LUA_ENGINE_DEBUG == 0 +#define LUALOG(...) +#else +#define LUALOG(format, ...) cocos2d::log(format, ##__VA_ARGS__) +#endif // Lua engine debug + +#if defined(__GNUC__) && ((__GNUC__ >= 5) || ((__GNUG__ == 4) && (__GNUC_MINOR__ >= 4))) \ + || (defined(__clang__) && (__clang_major__ >= 3)) +#define CC_DISABLE_COPY(Class) \ +private: \ + Class(const Class &) = delete; \ + Class &operator =(const Class &) = delete; +#else +#define CC_DISABLE_COPY(Class) \ +private: \ + Class(const Class &); \ + Class &operator =(const Class &); +#endif + +/* + * only certain compilers support __attribute__((deprecated)) + */ +#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1))) + #define CC_DEPRECATED_ATTRIBUTE __attribute__((deprecated)) +#elif _MSC_VER >= 1400 //vs 2005 or higher + #define CC_DEPRECATED_ATTRIBUTE __declspec(deprecated) +#else + #define CC_DEPRECATED_ATTRIBUTE +#endif + +/* + * only certain compiler support __attribute__((format)) + * formatPos - 1-based position of format string argument + * argPos - 1-based position of first format-dependent argument + */ +#if defined(__GNUC__) && (__GNUC__ >= 4) +#define CC_FORMAT_PRINTF(formatPos, argPos) __attribute__((__format__(printf, formatPos, argPos))) +#elif defined(__has_attribute) + #if __has_attribute(format) + #define CC_FORMAT_PRINTF(formatPos, argPos) __attribute__((__format__(printf, formatPos, argPos))) + #endif // __has_attribute(format) +#else +#define CC_FORMAT_PRINTF(formatPos, argPos) +#endif + +#if defined(_MSC_VER) +#define CC_FORMAT_PRINTF_SIZE_T "%08lX" +#else +#define CC_FORMAT_PRINTF_SIZE_T "%08zX" +#endif + +#ifdef __GNUC__ +#define CC_UNUSED __attribute__ ((unused)) +#else +#define CC_UNUSED +#endif + +// +// CC_REQUIRES_NULL_TERMINATION +// +#if !defined(CC_REQUIRES_NULL_TERMINATION) + #if defined(__APPLE_CC__) && (__APPLE_CC__ >= 5549) + #define CC_REQUIRES_NULL_TERMINATION __attribute__((sentinel(0,1))) + #elif defined(__GNUC__) + #define CC_REQUIRES_NULL_TERMINATION __attribute__((sentinel)) + #else + #define CC_REQUIRES_NULL_TERMINATION + #endif +#endif + +#endif // __CC_PLATFORM_MACROS_H__ diff --git a/cocos/base/atitc/atitc.cpp b/cocos/base/atitc/atitc.cpp new file mode 100644 index 0000000000..3a60d6d2f7 --- /dev/null +++ b/cocos/base/atitc/atitc.cpp @@ -0,0 +1,195 @@ +/**************************************************************************** + Copyright (c) 2013 cocos2d-x.org + + 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 "atitc.h" + +//Decode ATITC encode block to 4x4 RGB32 pixels +static void atitc_decode_block(uint8_t **blockData, + uint32_t *decodeBlockData, + unsigned int stride, + bool oneBitAlphaFlag, + uint64_t alpha, + ATITCDecodeFlag decodeFlag) +{ + unsigned int colorValue0 = 0 , colorValue1 = 0, initAlpha = (!oneBitAlphaFlag * 255u) << 24; + unsigned int rb0 = 0, rb1 = 0, rb2 = 0, rb3 = 0, g0 = 0, g1 = 0, g2 = 0, g3 = 0; + bool msb = 0; + + uint32_t colors[4], pixelsIndex = 0; + + /* load the two color values*/ + memcpy((void *)&colorValue0, *blockData, 2); + (*blockData) += 2; + + memcpy((void *)&colorValue1, *blockData, 2); + (*blockData) += 2; + + //extract the msb flag + msb = (colorValue0 & 0x8000) != 0; + + /* the channel is r5g6b5 , 16 bits */ + rb0 = (colorValue0 << 3 | colorValue0 << 9) & 0xf800f8; + rb1 = (colorValue1 << 3 | colorValue1 << 8) & 0xf800f8; + g0 = (colorValue0 << 6) & 0x00fc00; + g1 = (colorValue1 << 5) & 0x00fc00; + g0 += (g0 >> 6) & 0x000300; + g1 += (g1 >> 6) & 0x000300; + + /* interpolate the other two color values */ + if (!msb) + { + colors[0] = rb0 + g0 + initAlpha; + colors[3] = rb1 + g1 + initAlpha; + + rb2 = (((2*rb0 + rb1) * 21) >> 6) & 0xff00ff; + rb3 = (((2*rb1 + rb0) * 21) >> 6) & 0xff00ff; + g2 = (((2*g0 + g1 ) * 21) >> 6) & 0x00ff00; + g3 = (((2*g1 + g0 ) * 21) >> 6) & 0x00ff00; + + colors[2] = rb3 + g3 + initAlpha; + colors[1] = rb2 + g2 + initAlpha; + } + else + { + colors[2] = rb0 + g0 + initAlpha; + colors[3] = rb1 + g1 + initAlpha; + + rb2 = (rb0 - (rb1 >> 2)) & 0xff00ff; + g2 = (g0 - (g1 >> 2)) & 0x00ff00; + colors[0] = 0 ; + + colors[1] = rb2 + g2 + initAlpha; + } + + /*read the pixelsIndex , 2bits per pixel, 4 bytes */ + memcpy((void*)&pixelsIndex, *blockData, 4); + (*blockData) += 4; + + if (ATITCDecodeFlag::ATC_INTERPOLATED_ALPHA == decodeFlag) + { + // atitc_interpolated_alpha use interpolate alpha + // 8-Alpha block: derive the other six alphas. + // Bit code 000 = alpha0, 001 = alpha1, other are interpolated. + + unsigned int alphaArray[8]; + + alphaArray[0] = (alpha ) & 0xff ; + alphaArray[1] = (alpha >> 8) & 0xff ; + + if (alphaArray[0] >= alphaArray[1]) + { + alphaArray[2] = (alphaArray[0]*6 + alphaArray[1]*1) / 7; + alphaArray[3] = (alphaArray[0]*5 + alphaArray[1]*2) / 7; + alphaArray[4] = (alphaArray[0]*4 + alphaArray[1]*3) / 7; + alphaArray[5] = (alphaArray[0]*3 + alphaArray[1]*4) / 7; + alphaArray[6] = (alphaArray[0]*2 + alphaArray[1]*5) / 7; + alphaArray[7] = (alphaArray[0]*1 + alphaArray[1]*6) / 7; + } + else if (alphaArray[0] < alphaArray[1]) + { + alphaArray[2] = (alphaArray[0]*4 + alphaArray[1]*1) / 5; + alphaArray[3] = (alphaArray[0]*3 + alphaArray[1]*2) / 5; + alphaArray[4] = (alphaArray[0]*2 + alphaArray[1]*3) / 5; + alphaArray[5] = (alphaArray[0]*1 + alphaArray[1]*4) / 5; + alphaArray[6] = 0; + alphaArray[7] = 255; + } + + // read the flowing 48bit indices (16*3) + alpha >>= 16; + + for (int y = 0; y < 4; ++y) + { + for (int x = 0; x < 4; ++x) + { + decodeBlockData[x] = (alphaArray[alpha & 5] << 24) + colors[pixelsIndex & 3]; + pixelsIndex >>= 2; + alpha >>= 3; + } + decodeBlockData += stride; + } + } //if (atc_interpolated_alpha == comFlag) + else + { + /* atc_rgb atc_explicit_alpha use explicit alpha */ + + for (int y = 0; y < 4; ++y) + { + for (int x = 0; x < 4; ++x) + { + initAlpha = (alpha & 0x0f) << 28; + initAlpha += initAlpha >> 4; + decodeBlockData[x] = initAlpha + colors[pixelsIndex & 3]; + pixelsIndex >>= 2; + alpha >>= 4; + } + decodeBlockData += stride; + } + } +} + +//Decode ATITC encode data to RGB32 +void atitc_decode(uint8_t *encodeData, //in_data + uint8_t *decodeData, //out_data + const int pixelsWidth, + const int pixelsHeight, + ATITCDecodeFlag decodeFlag) +{ + uint32_t *decodeBlockData = (uint32_t *)decodeData; + + for (int block_y = 0; block_y < pixelsHeight / 4; ++block_y, decodeBlockData += 3 * pixelsWidth) //stride = 3*width + { + for (int block_x = 0; block_x < pixelsWidth / 4; ++block_x, decodeBlockData += 4) //skip 4 pixels + { + uint64_t blockAlpha = 0; + + switch (decodeFlag) + { + case ATITCDecodeFlag::ATC_RGB: + { + atitc_decode_block(&encodeData, decodeBlockData, pixelsWidth, 0, 0LL, ATITCDecodeFlag::ATC_RGB); + } + break; + case ATITCDecodeFlag::ATC_EXPLICIT_ALPHA: + { + memcpy((void *)&blockAlpha, encodeData, 8); + encodeData += 8; + atitc_decode_block(&encodeData, decodeBlockData, pixelsWidth, 1, blockAlpha, ATITCDecodeFlag::ATC_EXPLICIT_ALPHA); + } + break; + case ATITCDecodeFlag::ATC_INTERPOLATED_ALPHA: + { + memcpy((void *)&blockAlpha, encodeData, 8); + encodeData += 8; + atitc_decode_block(&encodeData, decodeBlockData, pixelsWidth, 1, blockAlpha, ATITCDecodeFlag::ATC_INTERPOLATED_ALPHA); + } + break; + default: + break; + }//switch + }//for block_x + }//for block_y +} + + diff --git a/cocos/base/atitc/atitc.h b/cocos/base/atitc/atitc.h new file mode 100644 index 0000000000..72bfd32a8c --- /dev/null +++ b/cocos/base/atitc/atitc.h @@ -0,0 +1,48 @@ +/**************************************************************************** + Copyright (c) 2013 cocos2d-x.org + + 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 COCOS2DX_PLATFORM_THIRDPARTY_ATITC_ +#define COCOS2DX_PLATFORM_THIRDPARTY_ATITC_ + +#include "CCStdC.h" + +enum class ATITCDecodeFlag +{ + ATC_RGB = 1, + ATC_EXPLICIT_ALPHA = 3, + ATC_INTERPOLATED_ALPHA = 5, +}; + +//Decode ATITC encode data to RGB32 +void atitc_decode(uint8_t *encode_data, + uint8_t *decode_data, + const int pixelsWidth, + const int pixelsHeight, + ATITCDecodeFlag decodeFlag + ); + + +#endif /* defined(COCOS2DX_PLATFORM_THIRDPARTY_ATITC_) */ + diff --git a/cocos/base/cocoa/CCAffineTransform.cpp b/cocos/base/cocoa/CCAffineTransform.cpp new file mode 100644 index 0000000000..2e39f344cc --- /dev/null +++ b/cocos/base/cocoa/CCAffineTransform.cpp @@ -0,0 +1,132 @@ +/**************************************************************************** +Copyright (c) 2010 cocos2d-x.org + +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 "CCAffineTransform.h" +#include +#include + +using namespace std; + + +NS_CC_BEGIN + +AffineTransform __CCAffineTransformMake(float a, float b, float c, float d, float tx, float ty) +{ + AffineTransform t; + t.a = a; t.b = b; t.c = c; t.d = d; t.tx = tx; t.ty = ty; + return t; +} + +Point __CCPointApplyAffineTransform(const Point& point, const AffineTransform& t) +{ + Point p; + p.x = (float)((double)t.a * point.x + (double)t.c * point.y + t.tx); + p.y = (float)((double)t.b * point.x + (double)t.d * point.y + t.ty); + return p; +} + +Size __CCSizeApplyAffineTransform(const Size& size, const AffineTransform& t) +{ + Size s; + s.width = (float)((double)t.a * size.width + (double)t.c * size.height); + s.height = (float)((double)t.b * size.width + (double)t.d * size.height); + return s; +} + + +AffineTransform AffineTransformMakeIdentity() +{ + return __CCAffineTransformMake(1.0, 0.0, 0.0, 1.0, 0.0, 0.0); +} + +extern const AffineTransform AffineTransformIdentity = AffineTransformMakeIdentity(); +const AffineTransform AffineTransform::IDENTITY = AffineTransformMakeIdentity(); + +Rect RectApplyAffineTransform(const Rect& rect, const AffineTransform& anAffineTransform) +{ + float top = rect.getMinY(); + float left = rect.getMinX(); + float right = rect.getMaxX(); + float bottom = rect.getMaxY(); + + Point topLeft = PointApplyAffineTransform(Point(left, top), anAffineTransform); + Point topRight = PointApplyAffineTransform(Point(right, top), anAffineTransform); + Point bottomLeft = PointApplyAffineTransform(Point(left, bottom), anAffineTransform); + Point bottomRight = PointApplyAffineTransform(Point(right, bottom), anAffineTransform); + + float minX = min(min(topLeft.x, topRight.x), min(bottomLeft.x, bottomRight.x)); + float maxX = max(max(topLeft.x, topRight.x), max(bottomLeft.x, bottomRight.x)); + float minY = min(min(topLeft.y, topRight.y), min(bottomLeft.y, bottomRight.y)); + float maxY = max(max(topLeft.y, topRight.y), max(bottomLeft.y, bottomRight.y)); + + return Rect(minX, minY, (maxX - minX), (maxY - minY)); +} + +AffineTransform AffineTransformTranslate(const AffineTransform& t, float tx, float ty) +{ + return __CCAffineTransformMake(t.a, t.b, t.c, t.d, t.tx + t.a * tx + t.c * ty, t.ty + t.b * tx + t.d * ty); +} + +AffineTransform AffineTransformScale(const AffineTransform& t, float sx, float sy) +{ + return __CCAffineTransformMake(t.a * sx, t.b * sx, t.c * sy, t.d * sy, t.tx, t.ty); +} + +AffineTransform AffineTransformRotate(const AffineTransform& t, float anAngle) +{ + float sine = sinf(anAngle); + float cosine = cosf(anAngle); + + return __CCAffineTransformMake( t.a * cosine + t.c * sine, + t.b * cosine + t.d * sine, + t.c * cosine - t.a * sine, + t.d * cosine - t.b * sine, + t.tx, + t.ty); +} + +/* Concatenate `t2' to `t1' and return the result: + t' = t1 * t2 */ +AffineTransform AffineTransformConcat(const AffineTransform& t1, const AffineTransform& t2) +{ + return __CCAffineTransformMake( t1.a * t2.a + t1.b * t2.c, t1.a * t2.b + t1.b * t2.d, //a,b + t1.c * t2.a + t1.d * t2.c, t1.c * t2.b + t1.d * t2.d, //c,d + t1.tx * t2.a + t1.ty * t2.c + t2.tx, //tx + t1.tx * t2.b + t1.ty * t2.d + t2.ty); //ty +} + +/* Return true if `t1' and `t2' are equal, false otherwise. */ +bool AffineTransformEqualToTransform(const AffineTransform& t1, const AffineTransform& t2) +{ + return (t1.a == t2.a && t1.b == t2.b && t1.c == t2.c && t1.d == t2.d && t1.tx == t2.tx && t1.ty == t2.ty); +} + +AffineTransform AffineTransformInvert(const AffineTransform& t) +{ + float determinant = 1 / (t.a * t.d - t.b * t.c); + + return __CCAffineTransformMake(determinant * t.d, -determinant * t.b, -determinant * t.c, determinant * t.a, + determinant * (t.c * t.ty - t.d * t.tx), determinant * (t.b * t.tx - t.a * t.ty) ); +} + +NS_CC_END diff --git a/cocos/base/cocoa/CCAffineTransform.h b/cocos/base/cocoa/CCAffineTransform.h new file mode 100644 index 0000000000..667b5d9b46 --- /dev/null +++ b/cocos/base/cocoa/CCAffineTransform.h @@ -0,0 +1,63 @@ +/**************************************************************************** +Copyright (c) 2010 cocos2d-x.org + +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 __COCOA_CGAFFINETRANSFORM_H__ +#define __COCOA_CGAFFINETRANSFORM_H__ + +#include "CCGeometry.h" +#include "platform/CCPlatformMacros.h" + +NS_CC_BEGIN + +struct AffineTransform { + float a, b, c, d; + float tx, ty; + + static const AffineTransform IDENTITY; +}; + +CC_DLL AffineTransform __CCAffineTransformMake(float a, float b, float c, float d, float tx, float ty); +#define AffineTransformMake __CCAffineTransformMake + +CC_DLL Point __CCPointApplyAffineTransform(const Point& point, const AffineTransform& t); +#define PointApplyAffineTransform __CCPointApplyAffineTransform + +CC_DLL Size __CCSizeApplyAffineTransform(const Size& size, const AffineTransform& t); +#define SizeApplyAffineTransform __CCSizeApplyAffineTransform + +CC_DLL AffineTransform AffineTransformMakeIdentity(); +CC_DLL Rect RectApplyAffineTransform(const Rect& rect, const AffineTransform& anAffineTransform); + +CC_DLL AffineTransform AffineTransformTranslate(const AffineTransform& t, float tx, float ty); +CC_DLL AffineTransform AffineTransformRotate(const AffineTransform& aTransform, float anAngle); +CC_DLL AffineTransform AffineTransformScale(const AffineTransform& t, float sx, float sy); +CC_DLL AffineTransform AffineTransformConcat(const AffineTransform& t1, const AffineTransform& t2); +CC_DLL bool AffineTransformEqualToTransform(const AffineTransform& t1, const AffineTransform& t2); +CC_DLL AffineTransform AffineTransformInvert(const AffineTransform& t); + +extern CC_DLL const AffineTransform AffineTransformIdentity; + +NS_CC_END + +#endif // __COCOA_CGAFFINETRANSFORM_H__ diff --git a/cocos/base/cocoa/CCArray.cpp b/cocos/base/cocoa/CCArray.cpp new file mode 100644 index 0000000000..3a55d6050d --- /dev/null +++ b/cocos/base/cocoa/CCArray.cpp @@ -0,0 +1,754 @@ +/**************************************************************************** +Copyright (c) 2010 ForzeField Studios S.L. http://forzefield.com +Copyright (c) 2010 cocos2d-x.org + +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 "CCArray.h" +#include "CCString.h" +#include "platform/CCFileUtils.h" + +NS_CC_BEGIN + + +#if CC_USE_ARRAY_VECTOR + +// ---------------------------------------------------------------------------------- +// std::vector implementation +// ---------------------------------------------------------------------------------- + +Array::Array() +: data(NULL) +{ + init(); +} + +Array* Array::create() +{ + Array* array = new Array(); + + if (array && array->initWithCapacity(7)) + { + array->autorelease(); + } + else + { + CC_SAFE_DELETE(array); + } + + return array; +} + +Array* Array::createWithObject(Object* object) +{ + Array* array = new Array(); + + if (array && array->initWithObject(object)) + { + array->autorelease(); + } + else + { + CC_SAFE_DELETE(array); + } + + return array; +} + +Array* Array::create(Object* object, ...) +{ + va_list args; + va_start(args,object); + + Array* array = create(); + if (array && object) + { + array->addObject(object); + Object *i = va_arg(args, Object*); + while (i) + { + array->addObject(i); + i = va_arg(args, Object*); + } + } + else + { + CC_SAFE_DELETE(array); + } + + va_end(args); + + return array; +} + +Array* Array::createWithArray(Array* otherArray) +{ + return otherArray->clone(); +} + +Array* Array::createWithCapacity(int capacity) +{ + CCASSERT(capacity>=0, "Invalid capacity"); + + Array* array = new Array(); + + if (array && array->initWithCapacity(capacity)) + { + array->autorelease(); + } + else + { + CC_SAFE_DELETE(array); + } + + return array; +} + +Array* Array::createWithContentsOfFile(const char* fileName) +{ + Array* ret = Array::createWithContentsOfFileThreadSafe(fileName); + if (ret != nullptr) + { + ret->autorelease(); + } + return ret; +} + +Array* Array::createWithContentsOfFileThreadSafe(const char* fileName) +{ + return FileUtils::getInstance()->createArrayWithContentsOfFile(fileName); +} + +bool Array::init() +{ + return initWithCapacity(7); +} + +bool Array::initWithObject(Object* object) +{ + bool ret = initWithCapacity(7); + if (ret) + { + addObject(object); + } + return ret; +} + +/** Initializes an array with some objects */ +bool Array::initWithObjects(Object* object, ...) +{ + bool ret = false; + do + { + CC_BREAK_IF(object == nullptr); + + va_list args; + va_start(args, object); + + if (object) + { + this->addObject(object); + Object* i = va_arg(args, Object*); + while (i) + { + this->addObject(i); + i = va_arg(args, Object*); + } + ret = true; + } + va_end(args); + + } while (false); + + return ret; +} + +bool Array::initWithCapacity(int capacity) +{ + CCASSERT(capacity>=0, "Invalid capacity"); + + data.reserve(capacity); + return true; +} + +bool Array::initWithArray(Array* otherArray) +{ + data = otherArray->data; + return true; +} + +int Array::getIndexOfObject(Object* object) const +{ + auto it = data.begin(); + + for (int i = 0; it != data.end(); ++it, ++i) + { + if (it->get() == object) + { + return i; + } + } + + return -1; +} + +Object* Array::getRandomObject() +{ + if (data.size()==0) + { + return nullptr; + } + + float r = CCRANDOM_0_1(); + + if (r == 1) // to prevent from accessing data-arr[data->num], out of range. + { + r = 0; + } + + r *= data.size(); + + return data[r].get(); +} + +bool Array::containsObject(Object* object) const +{ + int i = this->getIndexOfObject(object); + return (i >=0); +} + +bool Array::isEqualToArray(Array* otherArray) +{ + for (int i = 0; i< this->count(); i++) + { + if (!this->getObjectAtIndex(i)->isEqual(otherArray->getObjectAtIndex(i))) + { + return false; + } + } + return true; +} + +void Array::addObject(Object* object) +{ + data.push_back( RCPtr(object) ); +} + +void Array::addObjectsFromArray(Array* otherArray) +{ + data.insert(data.end(), otherArray->data.begin(), otherArray->data.end()); +} + +void Array::insertObject(Object* object, int index) +{ + data.insert( std::begin(data) + index, RCPtr(object) ); +} + +void Array::setObject(Object* object, int index) +{ + data[index] = RCPtr(object); +} + +void Array::removeLastObject(bool releaseObj) +{ + CCASSERT(data.size(), "no objects added"); + data.pop_back(); +} + +void Array::removeObject(Object* object, bool releaseObj /* ignored */) +{ + data.erase( std::remove( data.begin(), data.end(), object ) ); +} + +void Array::removeObjectAtIndex(int index, bool releaseObj /* ignored */) +{ + auto obj = data[index]; + data.erase( data.begin() + index ); +} + +void Array::removeObjectsInArray(Array* otherArray) +{ + CCASSERT(false, "not implemented"); +} + +void Array::removeAllObjects() +{ + data.erase(std::begin(data), std::end(data)); +} + +void Array::fastRemoveObjectAtIndex(int index) +{ + removeObjectAtIndex(index); +} + +void Array::fastRemoveObject(Object* object) +{ + removeObject(object); +} + +void Array::exchangeObject(Object* object1, Object* object2) +{ + int idx1 = getIndexOfObject(object1); + int idx2 = getIndexOfObject(object2); + + CCASSERT(idx1>=0 && idx2>=2, "invalid object index"); + + std::swap( data[idx1], data[idx2] ); +} + +void Array::exchangeObjectAtIndex(int index1, int index2) +{ + std::swap( data[index1], data[index2] ); +} + +void Array::replaceObjectAtIndex(int index, Object* object, bool releaseObject /* ignored */) +{ + data[index] = object; +} + +void Array::reverseObjects() +{ + std::reverse( std::begin(data), std::end(data) ); +} + +void Array::reduceMemoryFootprint() +{ + // N/A +} + +Array::~Array() +{ + CCLOGINFO("deallocing Array: %p - len: %d", this, count() ); +} + +Array* Array::clone() const +{ + Array* ret = new Array(); + ret->autorelease(); + ret->initWithCapacity(this->data.size() > 0 ? this->data.size() : 1); + + Object* obj = nullptr; + Object* tmpObj = nullptr; + Clonable* clonable = nullptr; + CCARRAY_FOREACH(this, obj) + { + clonable = dynamic_cast(obj); + if (clonable) + { + tmpObj = dynamic_cast(clonable->clone()); + if (tmpObj) + { + ret->addObject(tmpObj); + } + } + else + { + CCLOGWARN("%s isn't clonable.", typeid(*obj).name()); + } + } + return ret; +} + +void Array::acceptVisitor(DataVisitor &visitor) +{ + visitor.visit(this); +} + +// ---------------------------------------------------------------------------------- +// ccArray implementation +// ---------------------------------------------------------------------------------- + +#else + +Array::Array() +: data(nullptr) +{ +// init(); +} + +Array* Array::create() +{ + Array* array = new Array(); + + if (array && array->initWithCapacity(7)) + { + array->autorelease(); + } + else + { + CC_SAFE_DELETE(array); + } + + return array; +} + +Array* Array::createWithObject(Object* object) +{ + Array* array = new Array(); + + if (array && array->initWithObject(object)) + { + array->autorelease(); + } + else + { + CC_SAFE_DELETE(array); + } + + return array; +} + +Array* Array::create(Object* object, ...) +{ + va_list args; + va_start(args,object); + + Array* array = create(); + if (array && object) + { + array->addObject(object); + Object *i = va_arg(args, Object*); + while (i) + { + array->addObject(i); + i = va_arg(args, Object*); + } + } + else + { + CC_SAFE_DELETE(array); + } + + va_end(args); + + return array; +} + +Array* Array::createWithArray(Array* otherArray) +{ + return otherArray->clone(); +} + +Array* Array::createWithCapacity(int capacity) +{ + CCASSERT(capacity>=0, "Invalid capacity"); + + Array* array = new Array(); + + if (array && array->initWithCapacity(capacity)) + { + array->autorelease(); + } + else + { + CC_SAFE_DELETE(array); + } + + return array; +} + +Array* Array::createWithContentsOfFile(const char* fileName) +{ + Array* ret = Array::createWithContentsOfFileThreadSafe(fileName); + if (ret != nullptr) + { + ret->autorelease(); + } + return ret; +} + +Array* Array::createWithContentsOfFileThreadSafe(const char* fileName) +{ + return FileUtils::getInstance()->createArrayWithContentsOfFile(fileName); +} + +bool Array::init() +{ + CCASSERT(!data, "Array cannot be re-initialized"); + + return initWithCapacity(7); +} + +bool Array::initWithObject(Object* object) +{ + CCASSERT(!data, "Array cannot be re-initialized"); + + bool ret = initWithCapacity(7); + if (ret) + { + addObject(object); + } + return ret; +} + +/** Initializes an array with some objects */ +bool Array::initWithObjects(Object* object, ...) +{ + CCASSERT(!data, "Array cannot be re-initialized"); + + bool ret = false; + do + { + CC_BREAK_IF(object == nullptr); + + va_list args; + va_start(args, object); + + if (object) + { + this->addObject(object); + Object* i = va_arg(args, Object*); + while (i) + { + this->addObject(i); + i = va_arg(args, Object*); + } + ret = true; + } + va_end(args); + + } while (false); + + return ret; +} + +bool Array::initWithCapacity(int capacity) +{ + CCASSERT(capacity>=0 && !data, "Array cannot be re-initialized"); + + data = ccArrayNew(capacity); + return true; +} + +bool Array::initWithArray(Array* otherArray) +{ + CCASSERT(!data, "Array cannot be re-initialized"); + + bool ret = false; + do + { + CC_BREAK_IF(! initWithCapacity(otherArray->data->num)); + + addObjectsFromArray(otherArray); + ret = true; + } while (0); + + return ret; +} + +int Array::getIndexOfObject(Object* object) const +{ + return ccArrayGetIndexOfObject(data, object); +} + +Object* Array::getRandomObject() +{ + if (data->num == 0) + { + return nullptr; + } + + float r = CCRANDOM_0_1(); + + if (r == 1) // to prevent from accessing data-arr[data->num], out of range. + { + r = 0; + } + + return data->arr[(int)(data->num * r)]; +} + +bool Array::containsObject(Object* object) const +{ + return ccArrayContainsObject(data, object); +} + +bool Array::isEqualToArray(Array* otherArray) +{ + for (int i = 0; i< this->count(); i++) + { + if (!this->getObjectAtIndex(i)->isEqual(otherArray->getObjectAtIndex(i))) + { + return false; + } + } + return true; +} + +void Array::addObject(Object* object) +{ + CCASSERT(data, "Array not initialized"); + ccArrayAppendObjectWithResize(data, object); +} + +void Array::addObjectsFromArray(Array* otherArray) +{ + CCASSERT(data, "Array not initialized"); + ccArrayAppendArrayWithResize(data, otherArray->data); +} + +void Array::insertObject(Object* object, int index) +{ + CCASSERT(data, "Array not initialized"); + ccArrayInsertObjectAtIndex(data, object, index); +} + +void Array::setObject(Object* object, int index) +{ + CCASSERT(index>=0 && index < count(), "Invalid index"); + + if (object != data->arr[index]) + { + data->arr[index]->release(); + data->arr[index] = object; + object->retain(); + } +} + +void Array::removeLastObject(bool releaseObj) +{ + CCASSERT(data->num, "no objects added"); + ccArrayRemoveObjectAtIndex(data, data->num-1, releaseObj); +} + +void Array::removeObject(Object* object, bool releaseObj/* = true*/) +{ + ccArrayRemoveObject(data, object, releaseObj); +} + +void Array::removeObjectAtIndex(int index, bool releaseObj) +{ + ccArrayRemoveObjectAtIndex(data, index, releaseObj); +} + +void Array::removeObjectsInArray(Array* otherArray) +{ + ccArrayRemoveArray(data, otherArray->data); +} + +void Array::removeAllObjects() +{ + ccArrayRemoveAllObjects(data); +} + +void Array::fastRemoveObjectAtIndex(int index) +{ + ccArrayFastRemoveObjectAtIndex(data, index); +} + +void Array::fastRemoveObject(Object* object) +{ + ccArrayFastRemoveObject(data, object); +} + +void Array::exchangeObject(Object* object1, Object* object2) +{ + int index1 = ccArrayGetIndexOfObject(data, object1); + if (index1 == UINT_MAX) + { + return; + } + + int index2 = ccArrayGetIndexOfObject(data, object2); + if (index2 == UINT_MAX) + { + return; + } + + ccArraySwapObjectsAtIndexes(data, index1, index2); +} + +void Array::exchangeObjectAtIndex(int index1, int index2) +{ + ccArraySwapObjectsAtIndexes(data, index1, index2); +} + +void Array::replaceObjectAtIndex(int index, Object* object, bool releaseObject/* = true*/) +{ + ccArrayInsertObjectAtIndex(data, object, index); + ccArrayRemoveObjectAtIndex(data, index+1); +} + +void Array::reverseObjects() +{ + if (data->num > 1) + { + // floorf(), since in the case of an even number, the number of swaps stays the same + int count = (int) floorf(data->num/2.f); + int maxIndex = data->num - 1; + + for (int i = 0; i < count ; i++) + { + ccArraySwapObjectsAtIndexes(data, i, maxIndex); + --maxIndex; + } + } +} + +void Array::reduceMemoryFootprint() +{ + ccArrayShrink(data); +} + +Array::~Array() +{ + CCLOGINFO("deallocing Array: %p - len: %d", this, count() ); + + ccArrayFree(data); +} + +Array* Array::clone() const +{ + Array* ret = new Array(); + ret->autorelease(); + ret->initWithCapacity(this->data->num > 0 ? this->data->num : 1); + + Object* obj = nullptr; + Object* tmpObj = nullptr; + Clonable* clonable = nullptr; + CCARRAY_FOREACH(this, obj) + { + clonable = dynamic_cast(obj); + if (clonable) + { + tmpObj = dynamic_cast(clonable->clone()); + if (tmpObj) + { + ret->addObject(tmpObj); + } + } + else + { + CCLOGWARN("%s isn't clonable.", typeid(*obj).name()); + } + } + return ret; +} + +void Array::acceptVisitor(DataVisitor &visitor) +{ + visitor.visit(this); +} + +#endif // uses ccArray + +NS_CC_END diff --git a/cocos/base/cocoa/CCArray.h b/cocos/base/cocoa/CCArray.h new file mode 100644 index 0000000000..4f5beea501 --- /dev/null +++ b/cocos/base/cocoa/CCArray.h @@ -0,0 +1,557 @@ +/**************************************************************************** +Copyright (c) 2010 ForzeField Studios S.L. http://forzefield.com +Copyright (c) 2010 cocos2d-x.org + +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 __CCARRAY_H__ +#define __CCARRAY_H__ + +#define CC_USE_ARRAY_VECTOR 0 + +#if CC_USE_ARRAY_VECTOR +#include +#include +#include "cocoa/CCObject.h" +#include "ccMacros.h" +#else +#include "support/data_support/ccCArray.h" +#endif + + +#if CC_USE_ARRAY_VECTOR +/** + * A reference counting-managed pointer for classes derived from RCBase which can + * be used as C pointer + * Original code: http://www.codeproject.com/Articles/64111/Building-a-Quick-and-Handy-Reference-Counting-Clas + * License: http://www.codeproject.com/info/cpol10.aspx + */ +template < class T > +class RCPtr +{ +public: + //Construct using a C pointer + //e.g. RCPtr< T > x = new T(); + RCPtr(T* ptr = nullptr) + : _ptr(ptr) + { + if(ptr != nullptr) {ptr->retain();} + } + + //Copy constructor + RCPtr(const RCPtr &ptr) + : _ptr(ptr._ptr) + { +// printf("Array: copy constructor: %p\n", this); + if(_ptr != NULL) {_ptr->retain();} + } + + //Move constructor + RCPtr(RCPtr &&ptr) + : _ptr(ptr._ptr) + { +// printf("Array: Move Constructor: %p\n", this); + ptr._ptr = nullptr; + } + + ~RCPtr() + { +// printf("Array: Destructor: %p\n", this); + if(_ptr != nullptr) {_ptr->release();} + } + + //Assign a pointer + //e.g. x = new T(); + RCPtr &operator=(T* ptr) + { +// printf("Array: operator= T*: %p\n", this); + + //The following grab and release operations have to be performed + //in that order to handle the case where ptr == _ptr + //(See comment below by David Garlisch) + if(ptr != nullptr) {ptr->retain();} + if(_ptr != nullptr) {_ptr->release();} + _ptr = ptr; + return (*this); + } + + //Assign another RCPtr + RCPtr &operator=(const RCPtr &ptr) + { +// printf("Array: operator= const&: %p\n", this); + return (*this) = ptr._ptr; + } + + //Retrieve actual pointer + T* get() const + { + return _ptr; + } + + //Some overloaded operators to facilitate dealing with an RCPtr + //as a conventional C pointer. + //Without these operators, one can still use the less transparent + //get() method to access the pointer. + T* operator->() const {return _ptr;} //x->member + T &operator*() const {return *_ptr;} //*x, (*x).member + explicit operator T*() const {return _ptr;} //T* y = x; + explicit operator bool() const {return _ptr != nullptr;} //if(x) {/*x is not NULL*/} + bool operator==(const RCPtr &ptr) {return _ptr == ptr._ptr;} + bool operator==(const T *ptr) {return _ptr == ptr;} + +private: + T *_ptr; //Actual pointer +}; +#endif // CC_USE_ARRAY_VECTOR + + +/** + * @addtogroup data_structures + * @{ + */ + +/** @def CCARRAY_FOREACH +A convenience macro to iterate over a Array using. It is faster than the "fast enumeration" interface. +@since v0.99.4 +*/ + +/* +In cocos2d-iphone 1.0.0, This macro have been update to like this: + +#define CCARRAY_FOREACH(__array__, __object__) \ +if (__array__ && __array__->data->num > 0) \ +for(id *__arr__ = __array__->data->arr, *end = __array__->data->arr + __array__->data->num-1; \ +__arr__ <= end && ((__object__ = *__arr__) != nil || true); \ +__arr__++) + +I found that it's not work in C++. So it keep what it's look like in version 1.0.0-rc3. ---By Bin +*/ + +#if CC_USE_ARRAY_VECTOR +#define CCARRAY_FOREACH(__array__, __object__) \ + if (__array__) \ + for( auto __it__ = (__array__)->data.begin(); \ + __it__ != (__array__)->data.end() && ((__object__) = __it__->get()) != nullptr; \ + ++__it__) + + +#define CCARRAY_FOREACH_REVERSE(__array__, __object__) \ + if (__array__) \ + for( auto __it__ = (__array__)->data.rbegin(); \ + __it__ != (__array__)->data.rend() && ((__object__) = __it__->get()) != nullptr; \ + ++__it__ ) + + +#define CCARRAY_VERIFY_TYPE(__array__, __type__) void(0) + +#else // ! CC_USE_ARRAY_VECTOR -------------------------- + +#define CCARRAY_FOREACH(__array__, __object__) \ + if ((__array__) && (__array__)->data->num > 0) \ + for(Object** __arr__ = (__array__)->data->arr, **__end__ = (__array__)->data->arr + (__array__)->data->num-1; \ + __arr__ <= __end__ && (((__object__) = *__arr__) != NULL/* || true*/); \ + __arr__++) + +#define CCARRAY_FOREACH_REVERSE(__array__, __object__) \ + if ((__array__) && (__array__)->data->num > 0) \ + for(Object** __arr__ = (__array__)->data->arr + (__array__)->data->num-1, **__end__ = (__array__)->data->arr; \ + __arr__ >= __end__ && (((__object__) = *__arr__) != NULL/* || true*/); \ + __arr__--) + +#if defined(COCOS2D_DEBUG) && (COCOS2D_DEBUG > 0) +#define CCARRAY_VERIFY_TYPE(__array__, __type__) \ + do { \ + if ((__array__) && (__array__)->data->num > 0) \ + for(Object** __arr__ = (__array__)->data->arr, \ + **__end__ = (__array__)->data->arr + (__array__)->data->num-1; __arr__ <= __end__; __arr__++) \ + CCASSERT(dynamic_cast<__type__>(*__arr__), "element type is wrong!"); \ + } while(false) +#else +#define CCARRAY_VERIFY_TYPE(__array__, __type__) void(0) +#endif + +#endif // ! CC_USE_ARRAY_VECTOR + + +// Common defines ----------------------------------------------------------------------------------------------- + +#define arrayMakeObjectsPerformSelector(pArray, func, elementType) \ +do { \ + if(pArray && pArray->count() > 0) \ + { \ + Object* child; \ + CCARRAY_FOREACH(pArray, child) \ + { \ + elementType pNode = static_cast(child); \ + if(pNode) \ + { \ + pNode->func(); \ + } \ + } \ + } \ +} \ +while(false) + +#define arrayMakeObjectsPerformSelectorWithObject(pArray, func, object, elementType) \ +do { \ + if(pArray && pArray->count() > 0) \ + { \ + Object* child; \ + CCARRAY_FOREACH(pArray, child) \ + { \ + elementType pNode = static_cast(child); \ + if(pNode) \ + { \ + pNode->func(object); \ + } \ + } \ + } \ +} \ +while(false) + + +NS_CC_BEGIN + +class CC_DLL Array : public Object, public Clonable +{ +public: + + /** Creates an empty array. Default capacity is 10 + * @js NA + * @lua NA + */ + static Array* create(); + /** Create an array with objects + * @js NA + */ + static Array* create(Object* object, ...) CC_REQUIRES_NULL_TERMINATION; + /** Create an array with one object + * @js NA + */ + static Array* createWithObject(Object* object); + /** Create an array with a default capacity + * @js NA + */ + static Array* createWithCapacity(int capacity); + /** Create an array with from an existing array + * @js NA + */ + static Array* createWithArray(Array* otherArray); + /** + @brief Generate a Array pointer by file + @param pFileName The file name of *.plist file + @return The Array pointer generated from the file + * @js NA + */ + static Array* createWithContentsOfFile(const char* pFileName); + + /* + @brief The same meaning as arrayWithContentsOfFile(), but it doesn't call autorelease, so the + invoker should call release(). + * @js NA + * @lua NA + */ + static Array* createWithContentsOfFileThreadSafe(const char* pFileName); + /** + * @js NA + * @lua NA + */ + ~Array(); + + /** Initializes an array + * @js NA + * @lua NA + */ + bool init(); + /** Initializes an array with one object + * @js NA + * @lua NA + */ + bool initWithObject(Object* object); + /** Initializes an array with some objects + * @js NA + * @lua NA + */ + bool initWithObjects(Object* object, ...) CC_REQUIRES_NULL_TERMINATION; + /** Initializes an array with capacity + * @js NA + * @lua NA + */ + bool initWithCapacity(int capacity); + /** Initializes an array with an existing array + * @js NA + * @lua NA + */ + bool initWithArray(Array* otherArray); + + // Querying an Array + + /** Returns element count of the array + * @js NA + */ + int count() const + { +#if CC_USE_ARRAY_VECTOR + return data.size(); +#else + return data->num; +#endif + } + /** Returns capacity of the array + * @js NA + */ + int capacity() const + { +#if CC_USE_ARRAY_VECTOR + return data.capacity(); +#else + return data->max; +#endif + } + /** Returns index of a certain object, return UINT_MAX if doesn't contain the object + * @js NA + * @lua NA + */ + int getIndexOfObject(Object* object) const; + /** + * @js NA + */ + CC_DEPRECATED_ATTRIBUTE int indexOfObject(Object* object) const { return getIndexOfObject(object); } + + /** Returns an element with a certain index + * @js NA + * @lua NA + */ + Object* getObjectAtIndex(int index) + { + CCASSERT(index>=0 && index < count(), "index out of range in getObjectAtIndex()"); +#if CC_USE_ARRAY_VECTOR + return data[index].get(); +#else + return data->arr[index]; +#endif + } + CC_DEPRECATED_ATTRIBUTE Object* objectAtIndex(int index) { return getObjectAtIndex(index); } + /** Returns the last element of the array + * @js NA + */ + Object* getLastObject() + { +#if CC_USE_ARRAY_VECTOR + return data.back().get(); +#else + if(data->num > 0) + return data->arr[data->num-1]; + + return nullptr; +#endif + } + /** + * @js NA + */ + CC_DEPRECATED_ATTRIBUTE Object* lastObject() { return getLastObject(); } + /** Returns a random element + * @js NA + * @lua NA + */ + Object* getRandomObject(); + /** + * @js NA + */ + CC_DEPRECATED_ATTRIBUTE Object* randomObject() { return getRandomObject(); } + /** Returns a Boolean value that indicates whether object is present in array. + * @js NA + */ + bool containsObject(Object* object) const; + /** @since 1.1 + * @js NA + */ + bool isEqualToArray(Array* otherArray); + // Adding Objects + + /** Add a certain object + * @js NA + */ + void addObject(Object* object); + /** + * @js NA + */ + /** Add all elements of an existing array + * @js NA + */ + void addObjectsFromArray(Array* otherArray); + /** Insert a certain object at a certain index + * @js NA + */ + void insertObject(Object* object, int index); + /** sets a certain object at a certain index + * @js NA + * @lua NA + */ + void setObject(Object* object, int index); + /** sets a certain object at a certain index without retaining. Use it with caution + * @js NA + * @lua NA + */ + void fastSetObject(Object* object, int index) + { +#if CC_USE_ARRAY_VECTOR + setObject(object, index); +#else + // no retain + data->arr[index] = object; +#endif + } + /** + * @js NA + * @lua NA + */ + void swap( int indexOne, int indexTwo ) + { + CCASSERT(indexOne >=0 && indexOne < count() && indexTwo >= 0 && indexTwo < count(), "Invalid indices"); +#if CC_USE_ARRAY_VECTOR + std::swap(data[indexOne], data[indexTwo]); +#else + std::swap(data->arr[indexOne], data->arr[indexTwo]); +#endif + } + + // Removing Objects + + /** Remove last object + * @js NA + */ + void removeLastObject(bool releaseObj = true); + /** Remove a certain object + * @js NA + */ + void removeObject(Object* object, bool releaseObj = true); + /** Remove an element with a certain index + * @js NA + */ + void removeObjectAtIndex(int index, bool releaseObj = true); + /** Remove all elements + * @js NA + */ + void removeObjectsInArray(Array* otherArray); + /** Remove all objects + * @js NA + */ + void removeAllObjects(); + /** Fast way to remove a certain object + * @js NA + */ + void fastRemoveObject(Object* object); + /** Fast way to remove an element with a certain index + * @js NA + */ + void fastRemoveObjectAtIndex(int index); + + // Rearranging Content + + /** Swap two elements + * @js NA + */ + void exchangeObject(Object* object1, Object* object2); + /** Swap two elements with certain indexes + * @js NA + */ + void exchangeObjectAtIndex(int index1, int index2); + + /** Replace object at index with another object. + * @js NA + */ + void replaceObjectAtIndex(int index, Object* object, bool releaseObject = true); + + /** Revers the array + * @js NA + */ + void reverseObjects(); + /* Shrinks the array so the memory footprint corresponds with the number of items + * @js NA + */ + void reduceMemoryFootprint(); + + /* override functions + * @js NA + */ + virtual void acceptVisitor(DataVisitor &visitor); + /** + * @js NA + * @lua NA + */ + virtual Array* clone() const; + + // ------------------------------------------ + // Iterators + // ------------------------------------------ +#if CC_USE_ARRAY_VECTOR + typedef std::vector>::iterator iterator; + typedef std::vector>::const_iterator const_iterator; + /** + * @js NA + * @lua NA + */ + iterator begin() { return data.begin(); } + /** + * @js NA + * @lua NA + */ + iterator end() { return data.end(); } + const_iterator cbegin() { return data.cbegin(); } + /** + * @js NA + * @lua NA + */ + const_iterator cend() { return data.cend(); } + + std::vector> data; + +#else + /** + * @js NA + * @lua NA + */ + Object** begin() { return &data->arr[0]; } + /** + * @js NA + * @lua NA + */ + Object** end() { return &data->arr[data->num]; } + + ccArray* data; + +#endif + +//protected: + /** + * @js NA + * @lua NA + */ + Array(); +}; + +// end of data_structure group +/// @} + +NS_CC_END + +#endif // __CCARRAY_H__ diff --git a/cocos/base/cocoa/CCAutoreleasePool.cpp b/cocos/base/cocoa/CCAutoreleasePool.cpp new file mode 100644 index 0000000000..89a3528f73 --- /dev/null +++ b/cocos/base/cocoa/CCAutoreleasePool.cpp @@ -0,0 +1,204 @@ +/**************************************************************************** +Copyright (c) 2010 cocos2d-x.org + +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 "CCAutoreleasePool.h" +#include "ccMacros.h" + +NS_CC_BEGIN + +static PoolManager* s_pPoolManager = NULL; + +AutoreleasePool::AutoreleasePool() +{ + _managedObjectArray = new Array(); + _managedObjectArray->initWithCapacity(150); +} + +AutoreleasePool::~AutoreleasePool() +{ + CCLOGINFO("deallocing AutoreleasePool: %p", this); + CC_SAFE_DELETE(_managedObjectArray); +} + +void AutoreleasePool::addObject(Object* object) +{ + _managedObjectArray->addObject(object); + + CCASSERT(object->_reference > 1, "reference count should be greater than 1"); + ++(object->_autoReleaseCount); + object->release(); // no ref count, in this case autorelease pool added. +} + +void AutoreleasePool::removeObject(Object* object) +{ + for (unsigned int i = 0; i < object->_autoReleaseCount; ++i) + { + _managedObjectArray->removeObject(object, false); + } +} + +void AutoreleasePool::clear() +{ + if(_managedObjectArray->count() > 0) + { + //CCAutoreleasePool* pReleasePool; +#ifdef _DEBUG + int nIndex = _managedObjectArray->count() - 1; +#endif + + Object* pObj = NULL; + CCARRAY_FOREACH_REVERSE(_managedObjectArray, pObj) + { + if(!pObj) + break; + + --(pObj->_autoReleaseCount); + //(*it)->release(); + //delete (*it); +#ifdef _DEBUG + nIndex--; +#endif + } + + _managedObjectArray->removeAllObjects(); + } +} + + +//-------------------------------------------------------------------- +// +// PoolManager +// +//-------------------------------------------------------------------- + +PoolManager* PoolManager::sharedPoolManager() +{ + if (s_pPoolManager == NULL) + { + s_pPoolManager = new PoolManager(); + } + return s_pPoolManager; +} + +void PoolManager::purgePoolManager() +{ + CC_SAFE_DELETE(s_pPoolManager); +} + +PoolManager::PoolManager() +{ + _releasePoolStack = new Array(); + _releasePoolStack->initWithCapacity(150); + _curReleasePool = 0; +} + +PoolManager::~PoolManager() +{ + CCLOGINFO("deallocing PoolManager: %p", this); + finalize(); + + // we only release the last autorelease pool here + _curReleasePool = 0; + _releasePoolStack->removeObjectAtIndex(0); + + CC_SAFE_DELETE(_releasePoolStack); +} + +void PoolManager::finalize() +{ + if(_releasePoolStack->count() > 0) + { + //CCAutoreleasePool* pReleasePool; + Object* pObj = NULL; + CCARRAY_FOREACH(_releasePoolStack, pObj) + { + if(!pObj) + break; + AutoreleasePool* pPool = static_cast(pObj); + pPool->clear(); + } + } +} + +void PoolManager::push() +{ + AutoreleasePool* pPool = new AutoreleasePool(); //ref = 1 + _curReleasePool = pPool; + + _releasePoolStack->addObject(pPool); //ref = 2 + + pPool->release(); //ref = 1 +} + +void PoolManager::pop() +{ + if (! _curReleasePool) + { + return; + } + + int nCount = _releasePoolStack->count(); + + _curReleasePool->clear(); + + if (nCount > 1) + { + _releasePoolStack->removeObjectAtIndex(nCount-1); + +// if(nCount > 1) +// { +// _curReleasePool = _releasePoolStack->getObjectAtIndex(nCount - 2); +// return; +// } + _curReleasePool = (AutoreleasePool*)_releasePoolStack->getObjectAtIndex(nCount - 2); + } + + /*_curReleasePool = NULL;*/ +} + +void PoolManager::removeObject(Object* object) +{ + CCASSERT(_curReleasePool, "current auto release pool should not be null"); + + _curReleasePool->removeObject(object); +} + +void PoolManager::addObject(Object* object) +{ + getCurReleasePool()->addObject(object); +} + + +AutoreleasePool* PoolManager::getCurReleasePool() +{ + if(!_curReleasePool) + { + push(); + } + + CCASSERT(_curReleasePool, "current auto release pool should not be null"); + + return _curReleasePool; +} + +NS_CC_END diff --git a/cocos/base/cocoa/CCAutoreleasePool.h b/cocos/base/cocoa/CCAutoreleasePool.h new file mode 100644 index 0000000000..e446ceb402 --- /dev/null +++ b/cocos/base/cocoa/CCAutoreleasePool.h @@ -0,0 +1,181 @@ +/**************************************************************************** +Copyright (c) 2010 cocos2d-x.org + +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 __AUTORELEASEPOOL_H__ +#define __AUTORELEASEPOOL_H__ + +#include "CCObject.h" +#include "CCArray.h" + +NS_CC_BEGIN + +/** + * @addtogroup base_nodes + * @{ + */ + +class CC_DLL AutoreleasePool : public Object +{ + /** + * The underlying array of object managed by the pool. + * + * Although Array retains the object once when an object is added, proper + * Object::release() is called outside the array to make sure that the pool + * does not affect the managed object's reference count. So an object can + * be destructed properly by calling Object::release() even if the object + * is in the pool. + */ + Array *_managedObjectArray; +public: + /** + * @js NA + * @lua NA + */ + AutoreleasePool(); + /** + * @js NA + * @lua NA + */ + ~AutoreleasePool(); + + /** + * Add a given object to this pool. + * + * The same object may be added several times to the same pool; When the + * pool is destructed, the object's Object::release() method will be called + * for each time it was added. + * + * @param object The object to add to the pool. + * @js NA + * @lua NA + */ + void addObject(Object *object); + + /** + * Remove a given object from this pool. + * + * @param object The object to be removed from the pool. + * @js NA + * @lua NA + */ + void removeObject(Object *object); + + /** + * Clear the autorelease pool. + * + * Object::release() will be called for each time the managed object is + * added to the pool. + * @js NA + * @lua NA + */ + void clear(); +}; + +class CC_DLL PoolManager +{ + Array *_releasePoolStack; + AutoreleasePool *_curReleasePool; + + AutoreleasePool *getCurReleasePool(); +public: + /** + * @js NA + * @lua NA + */ + static PoolManager* sharedPoolManager(); + /** + * @js NA + * @lua NA + */ + static void purgePoolManager(); + /** + * @js NA + * @lua NA + */ + PoolManager(); + /** + * @js NA + * @lua NA + */ + ~PoolManager(); + + /** + * Clear all the AutoreleasePool on the pool stack. + * @js NA + * @lua NA + */ + void finalize(); + + /** + * Push a new AutoreleasePool to the pool stack. + * @js NA + * @lua NA + */ + void push(); + + /** + * Pop one AutoreleasePool from the pool stack. + * + * This method will ensure that there is at least one AutoreleasePool on + * the stack. + * + * The AutoreleasePool being poped is destructed. + * @js NA + * @lua NA + */ + void pop(); + + /** + * Remove a given object from the current autorelease pool. + * + * @param object The object to be removed. + * + * @see AutoreleasePool::removeObject + * @js NA + * @lua NA + */ + void removeObject(Object *object); + + /** + * Add a given object to the current autorelease pool. + * + * @param object The object to add. + * + * @see AutoreleasePool::addObject + * @js NA + * @lua NA + */ + void addObject(Object *object); + /** + * @js NA + * @lua NA + */ + friend class AutoreleasePool; +}; + +// end of base_nodes group +/// @} + +NS_CC_END + +#endif //__AUTORELEASEPOOL_H__ diff --git a/cocos/base/cocoa/CCBool.h b/cocos/base/cocoa/CCBool.h new file mode 100644 index 0000000000..32b7b276ee --- /dev/null +++ b/cocos/base/cocoa/CCBool.h @@ -0,0 +1,70 @@ +/**************************************************************************** + Copyright (c) 2010-2012 cocos2d-x.org + + 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 __CCBOOL_H__ +#define __CCBOOL_H__ + +#include "CCObject.h" + +NS_CC_BEGIN + +/** + * @addtogroup data_structures + * @{ + */ + +class CC_DLL Bool : public Object, public Clonable +{ +public: + Bool(bool v) + : _value(v) {} + bool getValue() const {return _value;} + + static Bool* create(bool v) + { + Bool* pRet = new Bool(v); + if (pRet) + { + pRet->autorelease(); + } + return pRet; + } + + /* override functions */ + virtual void acceptVisitor(DataVisitor &visitor) { visitor.visit(this); } + + Bool* clone() const + { + return Bool::create(_value); + } +private: + bool _value; +}; + +// end of data_structure group +/// @} + +NS_CC_END + +#endif /* __CCBOOL_H__ */ diff --git a/cocos/base/cocoa/CCData.cpp b/cocos/base/cocoa/CCData.cpp new file mode 100644 index 0000000000..1c42a12ee5 --- /dev/null +++ b/cocos/base/cocoa/CCData.cpp @@ -0,0 +1,61 @@ +/**************************************************************************** + Copyright (c) 2010-2012 cocos2d-x.org + + 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 +#include "CCData.h" +#include "platform/CCCommon.h" + +NS_CC_BEGIN + +Data::Data(unsigned char *pBytes, const unsigned long nSize) +{ + _size = nSize; + _bytes = new unsigned char[_size]; + memcpy(_bytes, pBytes, _size); +} + +Data::Data(Data *pData) +{ + _size = pData->_size; + _bytes = new unsigned char[_size]; + memcpy(_bytes, pData->_bytes, _size); +} + +Data::~Data() +{ + CCLOGINFO("deallocing Data: %p", this); + CC_SAFE_DELETE_ARRAY(_bytes); +} + +unsigned char* Data::getBytes() const +{ + return _bytes; +} + +unsigned long Data::getSize() const +{ + return _size; +} + +NS_CC_END diff --git a/cocos/base/cocoa/CCData.h b/cocos/base/cocoa/CCData.h new file mode 100644 index 0000000000..889a2d557b --- /dev/null +++ b/cocos/base/cocoa/CCData.h @@ -0,0 +1,88 @@ +/**************************************************************************** + Copyright (c) 2010-2012 cocos2d-x.org + + 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 __CCDATA_H__ +#define __CCDATA_H__ + +#include "platform/CCPlatformMacros.h" +#include "CCObject.h" + +NS_CC_BEGIN + +class CC_DLL Data : public Object +{ +public: + /** + * @js NA + * @lua NA + */ + Data(unsigned char *pBytes, const unsigned long nSize); + /** + * @js NA + * @lua NA + */ + Data(Data *pData); + /** + * @js NA + * @lua NA + */ + ~Data(); + /** + * @js NA + * @lua NA + */ + static Data* create(unsigned char *pBytes, const unsigned long nSize) + { + Data* pRet = new Data(pBytes, nSize); + if (pRet) + { + pRet->autorelease(); + } + return pRet; + } + /** + * @js NA + * @lua NA + */ + unsigned char* getBytes() const; + /** + * @js NA + * @lua NA + */ + unsigned long getSize() const; + + /** override functions + * @js NA + * @lua NA + */ + virtual void acceptVisitor(DataVisitor &visitor) { visitor.visit(this); } + +private: + unsigned char* _bytes; + unsigned long _size; +}; + +NS_CC_END + +#endif // __CCDATA_H__ diff --git a/cocos/base/cocoa/CCDataVisitor.cpp b/cocos/base/cocoa/CCDataVisitor.cpp new file mode 100644 index 0000000000..2d2a1f8121 --- /dev/null +++ b/cocos/base/cocoa/CCDataVisitor.cpp @@ -0,0 +1,240 @@ +/**************************************************************************** + Copyright (c) 2013 cocos2d-x.org + + 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 "CCObject.h" +#include "CCBool.h" +#include "CCInteger.h" +#include "CCFloat.h" +#include "CCDouble.h" +#include "CCString.h" +#include "CCArray.h" +#include "CCDictionary.h" +#include "CCSet.h" +#include "CCData.h" + +NS_CC_BEGIN + +void DataVisitor::visit(const Bool *value) +{ + visitObject(value); +} + +void DataVisitor::visit(const Integer *value) +{ + visitObject(value); +} + +void DataVisitor::visit(const Float *value) +{ + visitObject(value); +} + +void DataVisitor::visit(const Double *value) +{ + visitObject(value); +} + +void DataVisitor::visit(const String *value) +{ + visitObject(value); +} + +void DataVisitor::visit(const Array *value) +{ + visitObject(value); +} + +void DataVisitor::visit(const Dictionary *value) +{ + visitObject(value); +} + +void DataVisitor::visit(const Set *value) +{ + visitObject(value); +} + +void DataVisitor::visit(const Data *value) +{ + visitObject(value); +} + +// PrettyPrinter +PrettyPrinter::PrettyPrinter(int indentLevel/* = 0 */) +{ + setIndentLevel(indentLevel); +} + +void PrettyPrinter::clear() +{ + _result.clear(); +} + +std::string PrettyPrinter::getResult() +{ + return _result; +} + +void PrettyPrinter::visitObject(const Object *p) +{ + char buf[50] = {0}; + sprintf(buf, "%p", p); + _result += buf; +} + +void PrettyPrinter::visit(const Bool * p) +{ + char buf[50] = {0}; + sprintf(buf, "%s", p->getValue() ? "true" : "false"); + _result += buf; +} + +void PrettyPrinter::visit(const Integer *p) +{ + char buf[50] = {0}; + sprintf(buf, "%d", p->getValue()); + _result += buf; +} + +void PrettyPrinter::visit(const Float *p) +{ + char buf[50] = {0}; + sprintf(buf, "%f", p->getValue()); + _result += buf; +} + +void PrettyPrinter::visit(const Double *p) +{ + char buf[50] = {0}; + sprintf(buf, "%lf", p->getValue()); + _result += buf; +} + +void PrettyPrinter::visit(const String *p) +{ + _result += p->getCString(); +} + +void PrettyPrinter::visit(const Array *p) +{ + _result += "\n"; + _result += _indentStr; + _result += "\n"; + + setIndentLevel(_indentLevel+1); + Object* obj; + int i = 0; + char buf[50] = {0}; + CCARRAY_FOREACH(p, obj) + { + if (i > 0) { + _result += "\n"; + } + sprintf(buf, "%s%02d: ", _indentStr.c_str(), i); + _result += buf; + PrettyPrinter v(_indentLevel); + obj->acceptVisitor(v); + _result += v.getResult(); + i++; + } + setIndentLevel(_indentLevel-1); + + _result += "\n"; + _result += _indentStr; + _result += ""; +} + +void PrettyPrinter::visit(const Dictionary *p) +{ + _result += "\n"; + _result += _indentStr; + _result += "\n"; + + setIndentLevel(_indentLevel+1); + DictElement* element; + bool bFirstElement = true; + char buf[1000] = {0}; + CCDICT_FOREACH(p, element) + { + if (!bFirstElement) { + _result += "\n"; + } + sprintf(buf, "%s%s: ", _indentStr.c_str(),element->getStrKey()); + _result += buf; + PrettyPrinter v(_indentLevel); + element->getObject()->acceptVisitor(v); + _result += v.getResult(); + bFirstElement = false; + } + setIndentLevel(_indentLevel-1); + + _result += "\n"; + _result += _indentStr; + _result += ""; +} + +void PrettyPrinter::visit(const Set *p) +{ + _result += "\n"; + _result += _indentStr; + _result += "\n"; + + setIndentLevel(_indentLevel+1); + + int i = 0; + Set* tmp = const_cast(p); + SetIterator it = tmp->begin(); + + for (; it != tmp->end(); ++it, ++i) { + if (i > 0) { + _result += "\n"; + } + _result += _indentStr.c_str(); + PrettyPrinter v(_indentLevel); + (*it)->acceptVisitor(v); + _result += v.getResult(); + } + setIndentLevel(_indentLevel-1); + + _result += "\n"; + _result += _indentStr; + _result += "\n"; +} + +void PrettyPrinter::visit(const Data *p) +{ + //TODO Implement + DataVisitor::visit(p); +} + +void PrettyPrinter::setIndentLevel(int indentLevel) +{ + _indentLevel = indentLevel; + _indentStr.clear(); + for (int i = 0; i < _indentLevel; ++i) { + _indentStr += "\t"; + } +} + +NS_CC_END diff --git a/cocos/base/cocoa/CCDataVisitor.h b/cocos/base/cocoa/CCDataVisitor.h new file mode 100644 index 0000000000..3395b43dea --- /dev/null +++ b/cocos/base/cocoa/CCDataVisitor.h @@ -0,0 +1,117 @@ +/**************************************************************************** + Copyright (c) 2013 cocos2d-x.org + + 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 __CCDATAVISITOR_H__ +#define __CCDATAVISITOR_H__ + +#include "platform/CCPlatformMacros.h" +#include + +NS_CC_BEGIN + +class Object; +class Bool; +class Integer; +class Float; +class Double; +class String; +class Array; +class Dictionary; +class Set; +class Data; + +/** + * @addtogroup data_structures + * @{ + */ + +/** + * Visitor that helps to perform action that depends on polymorphic object type + * + * Use cases: + * - data serialization, + * - pretty printing of Object * + * - safe value reading from Array, Dictionary, Set + * + * Usage: + * 1. subclass DataVisitor + * 2. overload visit() methods for object that you need to handle + * 3. handle other objects in visitObject() + * 4. pass your visitor to Object::acceptVisitor() + */ +class CC_DLL DataVisitor +{ +public: + /** + * @js NA + * @lua NA + */ + virtual ~DataVisitor() {} + + /** default method, called from non-overloaded methods and for unrecognized objects */ + virtual void visitObject(const Object *p) = 0; + + virtual void visit(const Bool *p); + virtual void visit(const Integer *p); + virtual void visit(const Float *p); + virtual void visit(const Double *p); + virtual void visit(const String *p); + virtual void visit(const Array *p); + virtual void visit(const Dictionary *p); + virtual void visit(const Set *p); + virtual void visit(const Data *p); +}; + + +class CC_DLL PrettyPrinter : public DataVisitor +{ +public: + PrettyPrinter(int indentLevel = 0); + + virtual void clear(); + virtual std::string getResult(); + + virtual void visitObject(const Object *p); + virtual void visit(const Bool * p); + virtual void visit(const Integer *p); + virtual void visit(const Float *p); + virtual void visit(const Double *p); + virtual void visit(const String *p); + virtual void visit(const Array *p); + virtual void visit(const Dictionary *p); + virtual void visit(const Set *p); + virtual void visit(const Data *p); +private: + void setIndentLevel(int indentLevel); + int _indentLevel; + std::string _indentStr; + std::string _result; +}; + +// end of data_structure group +/// @} + +NS_CC_END + +#endif // __CCDATAVISITOR_H__ diff --git a/cocos/base/cocoa/CCDictionary.cpp b/cocos/base/cocoa/CCDictionary.cpp new file mode 100644 index 0000000000..6b8df0febf --- /dev/null +++ b/cocos/base/cocoa/CCDictionary.cpp @@ -0,0 +1,454 @@ +/**************************************************************************** + Copyright (c) 2012 - 2013 cocos2d-x.org + + 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 "CCDictionary.h" +#include "CCString.h" +#include "CCInteger.h" +#include "platform/CCFileUtils.h" + +using namespace std; + +NS_CC_BEGIN + +// ----------------------------------------------------------------------- +// DictElement + +DictElement::DictElement(const char* pszKey, Object* pObject) +{ + CCASSERT(pszKey && strlen(pszKey) > 0, "Invalid key value."); + _intKey = 0; + const char* pStart = pszKey; + + size_t len = strlen(pszKey); + if (len > MAX_KEY_LEN ) + { + char* pEnd = (char*)&pszKey[len-1]; + pStart = pEnd - (MAX_KEY_LEN-1); + } + + strcpy(_strKey, pStart); + + _object = pObject; + memset(&hh, 0, sizeof(hh)); +} + +DictElement::DictElement(intptr_t iKey, Object* pObject) +{ + _strKey[0] = '\0'; + _intKey = iKey; + _object = pObject; + memset(&hh, 0, sizeof(hh)); +} + +DictElement::~DictElement() +{ + CCLOGINFO("deallocing DictElement: %p", this); +} + +// ----------------------------------------------------------------------- +// Dictionary + +Dictionary::Dictionary() +: _elements(NULL) +, _dictType(kDictUnknown) +{ + +} + +Dictionary::~Dictionary() +{ + CCLOGINFO("deallocing Dictionary: %p", this); + removeAllObjects(); +} + +unsigned int Dictionary::count() +{ + return HASH_COUNT(_elements); +} + +Array* Dictionary::allKeys() +{ + int iKeyCount = this->count(); + if (iKeyCount <= 0) return NULL; + + Array* pArray = Array::createWithCapacity(iKeyCount); + + DictElement *pElement, *tmp; + if (_dictType == kDictStr) + { + HASH_ITER(hh, _elements, pElement, tmp) + { + String* pOneKey = new String(pElement->_strKey); + pArray->addObject(pOneKey); + CC_SAFE_RELEASE(pOneKey); + } + } + else if (_dictType == kDictInt) + { + HASH_ITER(hh, _elements, pElement, tmp) + { + Integer* pOneKey = new Integer(pElement->_intKey); + pArray->addObject(pOneKey); + CC_SAFE_RELEASE(pOneKey); + } + } + + return pArray; +} + +Array* Dictionary::allKeysForObject(Object* object) +{ + int iKeyCount = this->count(); + if (iKeyCount <= 0) return NULL; + Array* pArray = Array::create(); + + DictElement *pElement, *tmp; + + if (_dictType == kDictStr) + { + HASH_ITER(hh, _elements, pElement, tmp) + { + if (object == pElement->_object) + { + String* pOneKey = new String(pElement->_strKey); + pArray->addObject(pOneKey); + CC_SAFE_RELEASE(pOneKey); + } + } + } + else if (_dictType == kDictInt) + { + HASH_ITER(hh, _elements, pElement, tmp) + { + if (object == pElement->_object) + { + Integer* pOneKey = new Integer(pElement->_intKey); + pArray->addObject(pOneKey); + CC_SAFE_RELEASE(pOneKey); + } + } + } + return pArray; +} + +Object* Dictionary::objectForKey(const std::string& key) +{ + // if dictionary wasn't initialized, return NULL directly. + if (_dictType == kDictUnknown) return NULL; + // Dictionary only supports one kind of key, string or integer. + // This method uses string as key, therefore we should make sure that the key type of this Dictionary is string. + CCASSERT(_dictType == kDictStr, "this dictionary does not use string as key."); + + Object* pRetObject = NULL; + DictElement *pElement = NULL; + HASH_FIND_STR(_elements, key.c_str(), pElement); + if (pElement != NULL) + { + pRetObject = pElement->_object; + } + return pRetObject; +} + +Object* Dictionary::objectForKey(intptr_t key) +{ + // if dictionary wasn't initialized, return NULL directly. + if (_dictType == kDictUnknown) return NULL; + // Dictionary only supports one kind of key, string or integer. + // This method uses integer as key, therefore we should make sure that the key type of this Dictionary is integer. + CCASSERT(_dictType == kDictInt, "this dictionary does not use integer as key."); + + Object* pRetObject = NULL; + DictElement *pElement = NULL; + HASH_FIND_PTR(_elements, &key, pElement); + if (pElement != NULL) + { + pRetObject = pElement->_object; + } + return pRetObject; +} + +const String* Dictionary::valueForKey(const std::string& key) +{ + String* pStr = dynamic_cast(objectForKey(key)); + if (pStr == NULL) + { + pStr = String::create(""); + } + return pStr; +} + +const String* Dictionary::valueForKey(intptr_t key) +{ + String* pStr = dynamic_cast(objectForKey(key)); + if (pStr == NULL) + { + pStr = String::create(""); + } + return pStr; +} + +void Dictionary::setObject(Object* pObject, const std::string& key) +{ + CCASSERT(key.length() > 0 && pObject != NULL, "Invalid Argument!"); + if (_dictType == kDictUnknown) + { + _dictType = kDictStr; + } + + CCASSERT(_dictType == kDictStr, "this dictionary doesn't use string as key."); + + DictElement *pElement = NULL; + HASH_FIND_STR(_elements, key.c_str(), pElement); + if (pElement == NULL) + { + setObjectUnSafe(pObject, key); + } + else if (pElement->_object != pObject) + { + Object* pTmpObj = pElement->_object; + pTmpObj->retain(); + removeObjectForElememt(pElement); + setObjectUnSafe(pObject, key); + pTmpObj->release(); + } +} + +void Dictionary::setObject(Object* pObject, intptr_t key) +{ + CCASSERT(pObject != NULL, "Invalid Argument!"); + if (_dictType == kDictUnknown) + { + _dictType = kDictInt; + } + + CCASSERT(_dictType == kDictInt, "this dictionary doesn't use integer as key."); + + DictElement *pElement = NULL; + HASH_FIND_PTR(_elements, &key, pElement); + if (pElement == NULL) + { + setObjectUnSafe(pObject, key); + } + else if (pElement->_object != pObject) + { + Object* pTmpObj = pElement->_object; + pTmpObj->retain(); + removeObjectForElememt(pElement); + setObjectUnSafe(pObject, key); + pTmpObj->release(); + } + +} + +void Dictionary::removeObjectForKey(const std::string& key) +{ + if (_dictType == kDictUnknown) + { + return; + } + + CCASSERT(_dictType == kDictStr, "this dictionary doesn't use string as its key"); + CCASSERT(key.length() > 0, "Invalid Argument!"); + DictElement *pElement = NULL; + HASH_FIND_STR(_elements, key.c_str(), pElement); + removeObjectForElememt(pElement); +} + +void Dictionary::removeObjectForKey(intptr_t key) +{ + if (_dictType == kDictUnknown) + { + return; + } + + CCASSERT(_dictType == kDictInt, "this dictionary doesn't use integer as its key"); + DictElement *pElement = NULL; + HASH_FIND_PTR(_elements, &key, pElement); + removeObjectForElememt(pElement); +} + +void Dictionary::setObjectUnSafe(Object* pObject, const std::string& key) +{ + pObject->retain(); + DictElement* pElement = new DictElement(key.c_str(), pObject); + HASH_ADD_STR(_elements, _strKey, pElement); +} + +void Dictionary::setObjectUnSafe(Object* pObject, const intptr_t key) +{ + pObject->retain(); + DictElement* pElement = new DictElement(key, pObject); + HASH_ADD_PTR(_elements, _intKey, pElement); +} + +void Dictionary::removeObjectsForKeys(Array* pKeyArray) +{ + Object* pObj = NULL; + CCARRAY_FOREACH(pKeyArray, pObj) + { + String* pStr = static_cast(pObj); + removeObjectForKey(pStr->getCString()); + } +} + +void Dictionary::removeObjectForElememt(DictElement* pElement) +{ + if (pElement != NULL) + { + HASH_DEL(_elements, pElement); + pElement->_object->release(); + CC_SAFE_DELETE(pElement); + } +} + +void Dictionary::removeAllObjects() +{ + DictElement *pElement, *tmp; + HASH_ITER(hh, _elements, pElement, tmp) + { + HASH_DEL(_elements, pElement); + pElement->_object->release(); + CC_SAFE_DELETE(pElement); + + } +} + +Object* Dictionary::randomObject() +{ + if (_dictType == kDictUnknown) + { + return NULL; + } + + Object* key = allKeys()->getRandomObject(); + + if (_dictType == kDictInt) + { + return objectForKey( static_cast(key)->getValue()); + } + else if (_dictType == kDictStr) + { + return objectForKey( static_cast(key)->getCString()); + } + else + { + return NULL; + } +} + +Dictionary* Dictionary::create() +{ + Dictionary* ret = new Dictionary(); + if (ret && ret->init() ) + { + ret->autorelease(); + } + return ret; +} + +bool Dictionary::init() +{ + return true; +} + +Dictionary* Dictionary::createWithDictionary(Dictionary* srcDict) +{ + return srcDict->clone(); +} + +Dictionary* Dictionary::createWithContentsOfFileThreadSafe(const char *pFileName) +{ + return FileUtils::getInstance()->createDictionaryWithContentsOfFile(pFileName); +} + +void Dictionary::acceptVisitor(DataVisitor &visitor) +{ + return visitor.visit(this); +} + +Dictionary* Dictionary::createWithContentsOfFile(const char *pFileName) +{ + auto ret = createWithContentsOfFileThreadSafe(pFileName); + if (ret != nullptr) + { + ret->autorelease(); + } + return ret; +} + +bool Dictionary::writeToFile(const char *fullPath) +{ + return FileUtils::getInstance()->writeToFile(this, fullPath); +} + +Dictionary* Dictionary::clone() const +{ + Dictionary* newDict = Dictionary::create(); + + DictElement* element = NULL; + Object* tmpObj = NULL; + Clonable* obj = NULL; + if (_dictType == kDictInt) + { + CCDICT_FOREACH(this, element) + { + obj = dynamic_cast(element->getObject()); + if (obj) + { + tmpObj = dynamic_cast(obj->clone()); + if (tmpObj) + { + newDict->setObject(tmpObj, element->getIntKey()); + } + } + else + { + CCLOGWARN("%s isn't clonable.", typeid(*element->getObject()).name()); + } + } + } + else if (_dictType == kDictStr) + { + CCDICT_FOREACH(this, element) + { + obj = dynamic_cast(element->getObject()); + if (obj) + { + tmpObj = dynamic_cast(obj->clone()); + if (tmpObj) + { + newDict->setObject(tmpObj, element->getStrKey()); + } + } + else + { + CCLOGWARN("%s isn't clonable.", typeid(*element->getObject()).name()); + } + } + } + + return newDict; +} + +NS_CC_END diff --git a/cocos/base/cocoa/CCDictionary.h b/cocos/base/cocoa/CCDictionary.h new file mode 100644 index 0000000000..b0f1c98a9c --- /dev/null +++ b/cocos/base/cocoa/CCDictionary.h @@ -0,0 +1,458 @@ +/**************************************************************************** +Copyright (c) 2012 - 2013 cocos2d-x.org + +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 __CCDICTIONARY_H__ +#define __CCDICTIONARY_H__ + +#include "support/data_support/uthash.h" +#include "CCObject.h" +#include "CCArray.h" +#include "CCString.h" + +NS_CC_BEGIN + +class Dictionary; + +/** + * @addtogroup data_structures + * @{ + */ + + +/** + * DictElement is used for traversing Dictionary. + * + * A DictElement is one element of Dictionary, it contains two properties, key and object. + * Its key has two different type (integer and string). + * + * @note The key type is unique, all the elements in Dictionary has the same key type(integer or string). + * @code + * DictElement* pElement; + * CCDICT_FOREACH(dict, pElement) + * { + * const char*key = pElement->getStrKey(); + * // You certainly know the type of value, so we assume that it's a Sprite. + * Sprite* pSprite = static_cast(pElement->getObject()); + * // ...... + * } + * @endcode + * + */ +class CC_DLL DictElement +{ +private: + /** + * Constructor of DictElement. It's only for internal usage. Dictionary is its friend class. + * + * @param pszKey The string key of this element. + * @param pObject The object of this element. + */ + DictElement(const char* pszKey, Object* pObject); + + /** + * Constructor of DictElement. It's only for internal usage. Dictionary is its friend class. + * + * @param iKey The integer key of this element. + * @param pObject The object of this element. + */ + DictElement(intptr_t iKey, Object* pObject); + +public: + /** + * The destructor of DictElement. + * @js NA + * @lua NA + */ + ~DictElement(); + + // Inline functions need to be implemented in header file on Android. + + /** + * Get the string key of this element. + * @note This method assumes you know the key type in the element. + * If the element's key type is integer, invoking this method will cause an assert. + * + * @return The string key of this element. + */ + inline const char* getStrKey() const + { + CCASSERT(_strKey[0] != '\0', "Should not call this function for integer dictionary"); + return _strKey; + } + + /** + * Get the integer key of this element. + * @note This method assumes you know the key type in the element. + * If the element's key type is string, invoking this method will cause an assert. + * + * @return The integer key of this element. + */ + inline intptr_t getIntKey() const + { + CCASSERT(_strKey[0] == '\0', "Should not call this function for string dictionary"); + return _intKey; + } + + /** + * Get the object of this element. + * + * @return The object of this element. + */ + inline Object* getObject() const { return _object; } + +private: + // The max length of string key. + #define MAX_KEY_LEN 256 + // char array is needed for HASH_ADD_STR in UT_HASH. + // So it's a pain that all elements will allocate 256 bytes for this array. + char _strKey[MAX_KEY_LEN]; // hash key of string type + intptr_t _intKey; // hash key of integer type + Object* _object; // hash value +public: + UT_hash_handle hh; // makes this class hashable + friend class Dictionary; // declare Dictionary as friend class +}; + +/** The macro for traversing dictionary + * + * @note It's faster than getting all keys and traversing keys to get objects by objectForKey. + * It's also safe to remove elements while traversing. + */ +#define CCDICT_FOREACH(__dict__, __el__) \ + DictElement* pTmp##__dict__##__el__ = nullptr; \ + if (__dict__) \ + HASH_ITER(hh, (__dict__)->_elements, __el__, pTmp##__dict__##__el__) + + + +/** + * Dictionary is a class like NSDictionary in Obj-C . + * + * @note Only the pointer of Object or its subclass can be inserted to Dictionary. + * @code + * // Create a dictionary, return an autorelease object. + * Dictionary* pDict = Dictionary::create(); + * + * // Insert objects to dictionary + * String* pValue1 = String::create("100"); + * String* pValue2 = String::create("120"); + * Integer* pValue3 = Integer::create(200); + * pDict->setObject(pValue1, "key1"); + * pDict->setObject(pValue2, "key2"); + * pDict->setObject(pValue3, "key3"); + * + * // Get the object for key + * String* pStr1 = (String*)pDict->objectForKey("key1"); + * log("{ key1: %s }", pStr1->getCString()); + * Integer* pInteger = (Integer*)pDict->objectForKey("key3"); + * log("{ key3: %d }", pInteger->getValue()); + * @endcode + * + */ + +class CC_DLL Dictionary : public Object, public Clonable +{ +public: + /** + * The constructor of Dictionary. + * @js NA + * @lua NA + */ + Dictionary(); + + /** + * The destructor of Dictionary + * @js NA + * @lua NA + */ + ~Dictionary(); + + /** Initializes the dictionary. It returns true if the initializations was successful. + * @js NA + * @lua NA + */ + bool init(); + /** + * Get the count of elements in Dictionary. + * + * @return The count of elements. + * @js NA + */ + unsigned int count(); + + /** + * Return all keys of elements. + * + * @return The array contains all keys of elements. It's an autorelease object yet. + * @js NA + */ + Array* allKeys(); + + /** + * Get all keys according to the specified object. + * @warning We use '==' to compare two objects + * @return The array contains all keys for the specified object. It's an autorelease object yet. + * @js NA + */ + Array* allKeysForObject(Object* object); + + /** + * Get the object according to the specified string key. + * + * @note The dictionary needs to use string as key. If integer is passed, an assert will appear. + * @param key The string key for searching. + * @return The object matches the key. You need to force convert it to the type you know. + * @code + * // Assume that the elements are String* pointers. Convert it by following code. + * String* pStr = (String*)pDict->objectForKey("key1"); + * // Do something about pStr. + * // If you don't know the object type, properly you need to use dynamic_cast to check it. + * String* pStr2 = dynamic_cast(pDict->objectForKey("key1")); + * if (pStr2 != NULL) { + * // Do something about pStr2 + * } + * @endcode + * @see objectForKey(intptr_t) + * @js NA + */ + Object* objectForKey(const std::string& key); + + /** + * Get the object according to the specified integer key. + * + * @note The dictionary needs to use integer as key. If string is passed, an assert will appear. + * @param key The integer key for searching. + * @return The object matches the key. + * @see objectForKey(const std::string&) + * @js NA + */ + Object* objectForKey(intptr_t key); + + /** Get the value according to the specified string key. + * + * @note Be careful to use this function since it assumes the objects in the dictionary are String pointer. + * @param key The string key for searching + * @return An instance of String. + * It will return an empty string if the objects aren't String pointer or the key wasn't found. + * @see valueForKey(intptr_t) + * @js NA + */ + const String* valueForKey(const std::string& key); + + /** Get the value according to the specified integer key. + * + * @note Be careful to use this function since it assumes the objects in the dictionary are String pointer. + * @param key The string key for searching. + * @return An instance of String. + * It will return an empty string if the objects aren't String pointer or the key wasn't found. + * @see valueForKey(intptr_t) + * @js NA + */ + const String* valueForKey(intptr_t key); + + /** Insert an object to dictionary, and match it with the specified string key. + * + * @note Whe the first time this method is invoked, the key type will be set to string. + * After that you can't setObject with an integer key. + * If the dictionary contains the key you passed, the object matching the key will be released and removed from dictionary. + * Then the new object will be inserted after that. + * + * @param pObject The Object to be inserted. + * @param key The string key for searching. + * @see setObject(Object*, intptr_t) + * @js NA + */ + void setObject(Object* pObject, const std::string& key); + + /** Insert an object to dictionary, and match it with the specified string key. + * + * @note Then the first time this method is invoked, the key type will be set to string. + * After that you can't setObject with an integer key. + * If the dictionary contains the key you passed, the object matching the key will be released and removed from dictionary. + * Then the new object will be inserted after that. + * @param pObject The Object to be inserted. + * @param key The string key for searching. + * @see setObject(Object*, const std::string&) + * @js NA + */ + void setObject(Object* pObject, intptr_t key); + + /** + * Remove an object by the specified string key. + * + * @param key The string key for searching. + * @see removeObjectForKey(intptr_t), removeObjectsForKeys(Array*), + * removeObjectForElememt(DictElement*), removeAllObjects(). + * @js NA + */ + void removeObjectForKey(const std::string& key); + + /** + * Remove an object by the specified integer key. + * + * @param key The integer key for searching. + * @see removeObjectForKey(const std::string&), removeObjectsForKeys(Array*), + * removeObjectForElememt(DictElement*), removeAllObjects(). + * @js NA + */ + void removeObjectForKey(intptr_t key); + + /** + * Remove objects by an array of keys. + * + * @param pKeyArray The array contains keys to be removed. + * @see removeObjectForKey(const std::string&), removeObjectForKey(intptr_t), + * removeObjectForElememt(DictElement*), removeAllObjects(). + * @js NA + */ + void removeObjectsForKeys(Array* pKeyArray); + + /** + * Remove an object by an element. + * + * @param pElement The element need to be removed. + * @see removeObjectForKey(const std::string&), removeObjectForKey(intptr_t), + * removeObjectsForKeys(Array*), removeAllObjects(). + * @js NA + * @lua NA + */ + void removeObjectForElememt(DictElement* pElement); + + /** + * Remove all objects in the dictionary. + * + * @see removeObjectForKey(const std::string&), removeObjectForKey(intptr_t), + * removeObjectsForKeys(Array*), removeObjectForElememt(DictElement*). + * @js NA + */ + void removeAllObjects(); + + /** + * Return a random object in the dictionary. + * + * @return The random object. + * @see objectForKey(intptr_t), objectForKey(const std::string&) + * @js NA + * @lua NA + */ + Object* randomObject(); + + /** + * Create a dictionary. + * @return A dictionary which is an autorelease object. + * @see createWithDictionary(Dictionary*), createWithContentsOfFile(const char*), createWithContentsOfFileThreadSafe(const char*). + * @js NA + */ + static Dictionary* create(); + + /** + * Create a dictionary with an existing dictionary. + * + * @param srcDict The exist dictionary. + * @return A dictionary which is an autorelease object. + * @see create(), createWithContentsOfFile(const char*), createWithContentsOfFileThreadSafe(const char*). + * @js NA + */ + static Dictionary* createWithDictionary(Dictionary* srcDict); + + /** + * Create a dictionary with a plist file. + * @param pFileName The name of the plist file. + * @return A dictionary which is an autorelease object. + * @see create(), createWithDictionary(Dictionary*), createWithContentsOfFileThreadSafe(const char*). + * @js NA + */ + static Dictionary* createWithContentsOfFile(const char *pFileName); + + /** + * Write a dictionary to a plist file. + * @param fullPath The full path of the plist file. You can get writeable path by getWritablePath() + * @return true if successed, false if failed + * @js NA + * @lua NA + */ + bool writeToFile(const char *fullPath); + + /** + * Create a dictionary with a plist file. + * + * @note the return object isn't an autorelease object. + * This can make sure not using autorelease pool in a new thread. + * Therefore, you need to manage the lifecycle of the return object. + * It means that when you don't need it, CC_SAFE_RELEASE needs to be invoked. + * + * @param pFileName The name of the plist file. + * @return A dictionary which isn't an autorelease object. + * @js NA + * @lua NA + */ + static Dictionary* createWithContentsOfFileThreadSafe(const char *pFileName); + + /* override functions + * @js NA + * @lua NA + */ + virtual void acceptVisitor(DataVisitor &visitor); + /** + * @js NA + * @lua NA + */ + virtual Dictionary* clone() const; + +private: + /** + * For internal usage, invoked by setObject. + */ + void setObjectUnSafe(Object* pObject, const std::string& key); + void setObjectUnSafe(Object* pObject, const intptr_t key); + +public: + /** + * All the elements in dictionary. + * + * @note For internal usage, we need to declare this member variable as public since it's used in UT_HASH. + */ + DictElement* _elements; +private: + + /** The support type of dictionary, it's confirmed when setObject is invoked. */ + enum DictType + { + kDictUnknown = 0, + kDictStr, + kDictInt + }; + + /** + * The type of dictionary, it's assigned to kDictUnknown by default. + */ + DictType _dictType; +}; + +// end of data_structure group +/// @} + +NS_CC_END + +#endif /* __CCDICTIONARY_H__ */ diff --git a/cocos/base/cocoa/CCDouble.h b/cocos/base/cocoa/CCDouble.h new file mode 100644 index 0000000000..5b45b1d6cf --- /dev/null +++ b/cocos/base/cocoa/CCDouble.h @@ -0,0 +1,70 @@ +/**************************************************************************** + Copyright (c) 2010-2012 cocos2d-x.org + + 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 __CCDOUBLE_H__ +#define __CCDOUBLE_H__ + +#include "CCObject.h" + +NS_CC_BEGIN + +/** + * @addtogroup data_structures + * @{ + */ + +class CC_DLL Double : public Object, public Clonable +{ +public: + Double(double v) + : _value(v) {} + double getValue() const {return _value;} + + static Double* create(double v) + { + Double* pRet = new Double(v); + if (pRet) + { + pRet->autorelease(); + } + return pRet; + } + + /* override functions */ + virtual void acceptVisitor(DataVisitor &visitor) { visitor.visit(this); } + + Double* clone() const + { + return Double::create(_value); + } +private: + double _value; +}; + +// end of data_structure group +/// @} + +NS_CC_END + +#endif /* __CCDOUBLE_H__ */ diff --git a/cocos/base/cocoa/CCFloat.h b/cocos/base/cocoa/CCFloat.h new file mode 100644 index 0000000000..c85a2e1e70 --- /dev/null +++ b/cocos/base/cocoa/CCFloat.h @@ -0,0 +1,71 @@ +/**************************************************************************** + Copyright (c) 2010-2012 cocos2d-x.org + + 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 __CCFLOAT_H__ +#define __CCFLOAT_H__ + +#include "CCObject.h" + +NS_CC_BEGIN + +/** + * @addtogroup data_structures + * @{ + */ + +class CC_DLL Float : public Object, public Clonable +{ +public: + Float(float v) + : _value(v) {} + float getValue() const {return _value;} + + static Float* create(float v) + { + Float* pRet = new Float(v); + if (pRet) + { + pRet->autorelease(); + } + return pRet; + } + + /* override functions */ + virtual void acceptVisitor(DataVisitor &visitor) { visitor.visit(this); } + + Float* clone() const + { + return Float::create(_value); + } + +private: + float _value; +}; + +// end of data_structure group +/// @} + +NS_CC_END + +#endif /* __CCFLOAT_H__ */ diff --git a/cocos/base/cocoa/CCGeometry.cpp b/cocos/base/cocoa/CCGeometry.cpp new file mode 100644 index 0000000000..cfce9d3fa7 --- /dev/null +++ b/cocos/base/cocoa/CCGeometry.cpp @@ -0,0 +1,463 @@ +/**************************************************************************** +Copyright (c) 2010 cocos2d-x.org + +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 "CCGeometry.h" +#include "ccMacros.h" +#include + +// implementation of Point +NS_CC_BEGIN + +Point::Point(void) : x(0), y(0) +{ +} + +Point::Point(float xx, float yy) : x(xx), y(yy) +{ +} + +Point::Point(const Point& other) : x(other.x), y(other.y) +{ +} + +Point::Point(const Size& size) : x(size.width), y(size.height) +{ +} + +Point& Point::operator= (const Point& other) +{ + setPoint(other.x, other.y); + return *this; +} + +Point& Point::operator= (const Size& size) +{ + setPoint(size.width, size.height); + return *this; +} + +Point Point::operator+(const Point& right) const +{ + return Point(this->x + right.x, this->y + right.y); +} + +Point Point::operator-(const Point& right) const +{ + return Point(this->x - right.x, this->y - right.y); +} + +Point Point::operator-() const +{ + return Point(-x, -y); +} + +Point Point::operator*(float a) const +{ + return Point(this->x * a, this->y * a); +} + +Point Point::operator/(float a) const +{ + CCASSERT(a!=0, "CCPoint division by 0."); + return Point(this->x / a, this->y / a); +} + +void Point::setPoint(float xx, float yy) +{ + this->x = xx; + this->y = yy; +} + +bool Point::equals(const Point& target) const +{ + return (fabs(this->x - target.x) < FLT_EPSILON) + && (fabs(this->y - target.y) < FLT_EPSILON); +} + +bool Point::fuzzyEquals(const Point& b, float var) const +{ + if(x - var <= b.x && b.x <= x + var) + if(y - var <= b.y && b.y <= y + var) + return true; + return false; +} + +float Point::getAngle(const Point& other) const +{ + Point a2 = normalize(); + Point b2 = other.normalize(); + float angle = atan2f(a2.cross(b2), a2.dot(b2)); + if( fabs(angle) < FLT_EPSILON ) return 0.f; + return angle; +} + +Point Point::rotateByAngle(const Point& pivot, float angle) const +{ + return pivot + (*this - pivot).rotate(Point::forAngle(angle)); +} + +bool Point::isOneDemensionSegmentOverlap(float A, float B, float C, float D, float *S, float *E) +{ + float ABmin = MIN(A, B); + float ABmax = MAX(A, B); + float CDmin = MIN(C, D); + float CDmax = MAX(C, D); + + if (ABmax < CDmin || CDmax < ABmin) + { + // ABmin->ABmax->CDmin->CDmax or CDmin->CDmax->ABmin->ABmax + return false; + } + else + { + if (ABmin >= CDmin && ABmin <= CDmax) + { + // CDmin->ABmin->CDmax->ABmax or CDmin->ABmin->ABmax->CDmax + if (S != nullptr) *S = ABmin; + if (E != nullptr) *E = CDmax < ABmax ? CDmax : ABmax; + } + else if (ABmax >= CDmin && ABmax <= CDmax) + { + // ABmin->CDmin->ABmax->CDmax + if (S != nullptr) *S = CDmin; + if (E != nullptr) *E = ABmax; + } + else + { + // ABmin->CDmin->CDmax->ABmax + if (S != nullptr) *S = CDmin; + if (E != nullptr) *E = CDmax; + } + return true; + } +} + +bool Point::isLineIntersect(const Point& A, const Point& B, + const Point& C, const Point& D, + float *S, float *T) +{ + // FAIL: Line undefined + if ( (A.x==B.x && A.y==B.y) || (C.x==D.x && C.y==D.y) ) + { + return false; + } + + const float denom = crossProduct2Vector(A, B, C, D); + + if (denom == 0) + { + // Lines parallel or overlap + return false; + } + + if (S != nullptr) *S = crossProduct2Vector(C, D, C, A) / denom; + if (T != nullptr) *T = crossProduct2Vector(A, B, C, A) / denom; + + return true; +} + +bool Point::isLineParallel(const Point& A, const Point& B, + const Point& C, const Point& D) +{ + // FAIL: Line undefined + if ( (A.x==B.x && A.y==B.y) || (C.x==D.x && C.y==D.y) ) + { + return false; + } + + if (crossProduct2Vector(A, B, C, D) == 0) + { + // line overlap + if (crossProduct2Vector(C, D, C, A) == 0 || crossProduct2Vector(A, B, C, A) == 0) + { + return false; + } + + return true; + } + + return false; +} + +bool Point::isLineOverlap(const Point& A, const Point& B, + const Point& C, const Point& D) +{ + // FAIL: Line undefined + if ( (A.x==B.x && A.y==B.y) || (C.x==D.x && C.y==D.y) ) + { + return false; + } + + if (crossProduct2Vector(A, B, C, D) == 0 && + (crossProduct2Vector(C, D, C, A) == 0 || crossProduct2Vector(A, B, C, A) == 0)) + { + return true; + } + + return false; +} + +bool Point::isSegmentOverlap(const Point& A, const Point& B, const Point& C, const Point& D, Point* S, Point* E) +{ + + if (isLineOverlap(A, B, C, D)) + { + return isOneDemensionSegmentOverlap(A.x, B.x, C.x, D.x, &S->x, &E->x) && + isOneDemensionSegmentOverlap(A.y, B.y, C.y, D.y, &S->y, &E->y); + } + + return false; +} + +bool Point::isSegmentIntersect(const Point& A, const Point& B, const Point& C, const Point& D) +{ + float S, T; + + if (isLineIntersect(A, B, C, D, &S, &T )&& + (S >= 0.0f && S <= 1.0f && T >= 0.0f && T <= 1.0f)) + { + return true; + } + + return false; +} + +Point Point::getIntersectPoint(const Point& A, const Point& B, const Point& C, const Point& D) +{ + float S, T; + + if (isLineIntersect(A, B, C, D, &S, &T)) + { + // Point of intersection + Point P; + P.x = A.x + S * (B.x - A.x); + P.y = A.y + S * (B.y - A.y); + return P; + } + + return Point::ZERO; +} + +const Point Point::ZERO = Point(0, 0); + +// implementation of Size + +Size::Size(void) : width(0), height(0) +{ +} + +Size::Size(float w, float h) : width(w), height(h) +{ +} + +Size::Size(const Size& other) : width(other.width), height(other.height) +{ +} + +Size::Size(const Point& point) : width(point.x), height(point.y) +{ +} + +Size& Size::operator= (const Size& other) +{ + setSize(other.width, other.height); + return *this; +} + +Size& Size::operator= (const Point& point) +{ + setSize(point.x, point.y); + return *this; +} + +Size Size::operator+(const Size& right) const +{ + return Size(this->width + right.width, this->height + right.height); +} + +Size Size::operator-(const Size& right) const +{ + return Size(this->width - right.width, this->height - right.height); +} + +Size Size::operator*(float a) const +{ + return Size(this->width * a, this->height * a); +} + +Size Size::operator/(float a) const +{ + CCASSERT(a!=0, "CCSize division by 0."); + return Size(this->width / a, this->height / a); +} + +void Size::setSize(float w, float h) +{ + this->width = w; + this->height = h; +} + +bool Size::equals(const Size& target) const +{ + return (fabs(this->width - target.width) < FLT_EPSILON) + && (fabs(this->height - target.height) < FLT_EPSILON); +} + +const Size Size::ZERO = Size(0, 0); + +// implementation of Rect + +Rect::Rect(void) +{ + setRect(0.0f, 0.0f, 0.0f, 0.0f); +} + +Rect::Rect(float x, float y, float width, float height) +{ + setRect(x, y, width, height); +} + +Rect::Rect(const Rect& other) +{ + setRect(other.origin.x, other.origin.y, other.size.width, other.size.height); +} + +Rect& Rect::operator= (const Rect& other) +{ + setRect(other.origin.x, other.origin.y, other.size.width, other.size.height); + return *this; +} + +void Rect::setRect(float x, float y, float width, float height) +{ + // CGRect can support width<0 or height<0 + // CCASSERT(width >= 0.0f && height >= 0.0f, "width and height of Rect must not less than 0."); + + origin.x = x; + origin.y = y; + + size.width = width; + size.height = height; +} + +bool Rect::equals(const Rect& rect) const +{ + return (origin.equals(rect.origin) && + size.equals(rect.size)); +} + +float Rect::getMaxX() const +{ + return origin.x + size.width; +} + +float Rect::getMidX() const +{ + return origin.x + size.width / 2.0f; +} + +float Rect::getMinX() const +{ + return origin.x; +} + +float Rect::getMaxY() const +{ + return origin.y + size.height; +} + +float Rect::getMidY() const +{ + return origin.y + size.height / 2.0f; +} + +float Rect::getMinY() const +{ + return origin.y; +} + +bool Rect::containsPoint(const Point& point) const +{ + bool bRet = false; + + if (point.x >= getMinX() && point.x <= getMaxX() + && point.y >= getMinY() && point.y <= getMaxY()) + { + bRet = true; + } + + return bRet; +} + +bool Rect::intersectsRect(const Rect& rect) const +{ + return !( getMaxX() < rect.getMinX() || + rect.getMaxX() < getMinX() || + getMaxY() < rect.getMinY() || + rect.getMaxY() < getMinY()); +} + +Rect Rect::unionWithRect(const Rect & rect) const +{ + float thisLeftX = origin.x; + float thisRightX = origin.x + size.width; + float thisTopY = origin.y + size.height; + float thisBottomY = origin.y; + + if (thisRightX < thisLeftX) + { + std::swap(thisRightX, thisLeftX); // This rect has negative width + } + + if (thisTopY < thisBottomY) + { + std::swap(thisTopY, thisBottomY); // This rect has negative height + } + + float otherLeftX = rect.origin.x; + float otherRightX = rect.origin.x + rect.size.width; + float otherTopY = rect.origin.y + rect.size.height; + float otherBottomY = rect.origin.y; + + if (otherRightX < otherLeftX) + { + std::swap(otherRightX, otherLeftX); // Other rect has negative width + } + + if (otherTopY < otherBottomY) + { + std::swap(otherTopY, otherBottomY); // Other rect has negative height + } + + float combinedLeftX = std::min(thisLeftX, otherLeftX); + float combinedRightX = std::max(thisRightX, otherRightX); + float combinedTopY = std::max(thisTopY, otherTopY); + float combinedBottomY = std::min(thisBottomY, otherBottomY); + + return Rect(combinedLeftX, combinedBottomY, combinedRightX - combinedLeftX, combinedTopY - combinedBottomY); +} + +const Rect Rect::ZERO = Rect(0, 0, 0, 0); + +NS_CC_END diff --git a/cocos/base/cocoa/CCGeometry.h b/cocos/base/cocoa/CCGeometry.h new file mode 100644 index 0000000000..47e2fdf9ac --- /dev/null +++ b/cocos/base/cocoa/CCGeometry.h @@ -0,0 +1,564 @@ +/**************************************************************************** +Copyright (c) 2010 cocos2d-x.org + +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 __CCGEMETRY_H__ +#define __CCGEMETRY_H__ + +#include +#include + +#include "platform/CCPlatformMacros.h" +#include "CCObject.h" +#include "ccMacros.h" + +NS_CC_BEGIN + +/** Clamp a value between from and to. + @since v0.99.1 + */ +inline float clampf(float value, float min_inclusive, float max_inclusive) +{ + if (min_inclusive > max_inclusive) { + CC_SWAP(min_inclusive, max_inclusive, float); + } + return value < min_inclusive ? min_inclusive : value < max_inclusive? value : max_inclusive; +} + +/** + * @addtogroup data_structures + * @{ + */ + +// for Point assignement operator and copy constructor +class CC_DLL Size; + +class CC_DLL Point +{ +public: + float x; + float y; + +public: + /** + * @js NA + */ + Point(); + /** + * @js NA + */ + Point(float x, float y); + /** + * @js NA + * @lua NA + */ + Point(const Point& other); + /** + * @js NA + * @lua NA + */ + explicit Point(const Size& size); + /** + * @js NA + * @lua NA + */ + Point& operator= (const Point& other); + /** + * @js NA + * @lua NA + */ + Point& operator= (const Size& size); + /** + * @js NA + * @lua NA + */ + Point operator+(const Point& right) const; + /** + * @js NA + * @lua NA + */ + Point operator-(const Point& right) const; + /** + * @js NA + * @lua NA + */ + Point operator-() const; + /** + * @js NA + * @lua NA + */ + Point operator*(float a) const; + /** + * @js NA + * @lua NA + */ + Point operator/(float a) const; + /** + * @js NA + * @lua NA + */ + void setPoint(float x, float y); + /** + * @js NA + */ + bool equals(const Point& target) const; + + /** @returns if points have fuzzy equality which means equal with some degree of variance. + @since v2.1.4 + * @js NA + * @lua NA + */ + bool fuzzyEquals(const Point& target, float variance) const; + + /** Calculates distance between point an origin + @return float + @since v2.1.4 + * @js NA + * @lua NA + */ + inline float getLength() const { + return sqrtf(x*x + y*y); + }; + + /** Calculates the square length of a Point (not calling sqrt() ) + @return float + @since v2.1.4 + * @js NA + * @lua NA + */ + inline float getLengthSq() const { + return dot(*this); //x*x + y*y; + }; + + /** Calculates the square distance between two points (not calling sqrt() ) + @return float + @since v2.1.4 + * @js NA + * @lua NA + */ + inline float getDistanceSq(const Point& other) const { + return (*this - other).getLengthSq(); + }; + + /** Calculates the distance between two points + @return float + @since v2.1.4 + * @js NA + * @lua NA + */ + inline float getDistance(const Point& other) const { + return (*this - other).getLength(); + }; + + /** @returns the angle in radians between this vector and the x axis + @since v2.1.4 + * @js NA + * @lua NA + */ + inline float getAngle() const { + return atan2f(y, x); + }; + + /** @returns the angle in radians between two vector directions + @since v2.1.4 + * @js NA + * @lua NA + */ + float getAngle(const Point& other) const; + + /** Calculates dot product of two points. + @return float + @since v2.1.4 + * @js NA + * @lua NA + */ + inline float dot(const Point& other) const { + return x*other.x + y*other.y; + }; + + /** Calculates cross product of two points. + @return float + @since v2.1.4 + * @js NA + * @lua NA + */ + inline float cross(const Point& other) const { + return x*other.y - y*other.x; + }; + + /** Calculates perpendicular of v, rotated 90 degrees counter-clockwise -- cross(v, perp(v)) >= 0 + @return Point + @since v2.1.4 + * @js NA + * @lua NA + */ + inline Point getPerp() const { + return Point(-y, x); + }; + + /** Calculates midpoint between two points. + @return Point + @since v3.0 + * @js NA + * @lua NA + */ + inline Point getMidpoint(const Point& other) const + { + return Point((x + other.x) / 2.0f, (y + other.y) / 2.0f); + } + + /** Clamp a point between from and to. + @since v3.0 + * @js NA + * @lua NA + */ + inline Point getClampPoint(const Point& min_inclusive, const Point& max_inclusive) const + { + return Point(clampf(x,min_inclusive.x,max_inclusive.x), clampf(y, min_inclusive.y, max_inclusive.y)); + } + + /** Run a math operation function on each point component + * absf, fllorf, ceilf, roundf + * any function that has the signature: float func(float); + * For example: let's try to take the floor of x,y + * p.compOp(floorf); + @since v3.0 + * @js NA + * @lua NA + */ + inline Point compOp(std::function function) const + { + return Point(function(x), function(y)); + } + + /** Calculates perpendicular of v, rotated 90 degrees clockwise -- cross(v, rperp(v)) <= 0 + @return Point + @since v2.1.4 + * @js NA + * @lua NA + */ + inline Point getRPerp() const { + return Point(y, -x); + }; + + /** Calculates the projection of this over other. + @return Point + @since v2.1.4 + * @js NA + * @lua NA + */ + inline Point project(const Point& other) const { + return other * (dot(other)/other.dot(other)); + }; + + /** Complex multiplication of two points ("rotates" two points). + @return Point vector with an angle of this.getAngle() + other.getAngle(), + and a length of this.getLength() * other.getLength(). + @since v2.1.4 + * @js NA + * @lua NA + */ + inline Point rotate(const Point& other) const { + return Point(x*other.x - y*other.y, x*other.y + y*other.x); + }; + + /** Unrotates two points. + @return Point vector with an angle of this.getAngle() - other.getAngle(), + and a length of this.getLength() * other.getLength(). + @since v2.1.4 + * @js NA + * @lua NA + */ + inline Point unrotate(const Point& other) const { + return Point(x*other.x + y*other.y, y*other.x - x*other.y); + }; + + /** Returns point multiplied to a length of 1. + * If the point is 0, it returns (1, 0) + @return Point + @since v2.1.4 + * @js NA + * @lua NA + */ + inline Point normalize() const { + float length = getLength(); + if(length == 0.) return Point(1.f, 0); + return *this / getLength(); + }; + + /** Linear Interpolation between two points a and b + @returns + alpha == 0 ? a + alpha == 1 ? b + otherwise a value between a..b + @since v2.1.4 + * @js NA + * @lua NA + */ + inline Point lerp(const Point& other, float alpha) const { + return *this * (1.f - alpha) + other * alpha; + }; + + /** Rotates a point counter clockwise by the angle around a pivot + @param pivot is the pivot, naturally + @param angle is the angle of rotation ccw in radians + @returns the rotated point + @since v2.1.4 + * @js NA + * @lua NA + */ + Point rotateByAngle(const Point& pivot, float angle) const; + + /** + * @js NA + * @lua NA + */ + static inline Point forAngle(const float a) + { + return Point(cosf(a), sinf(a)); + } + + /** A general line-line intersection test + @param A the startpoint for the first line L1 = (A - B) + @param B the endpoint for the first line L1 = (A - B) + @param C the startpoint for the second line L2 = (C - D) + @param D the endpoint for the second line L2 = (C - D) + @param S the range for a hitpoint in L1 (p = A + S*(B - A)) + @param T the range for a hitpoint in L2 (p = C + T*(D - C)) + @returns whether these two lines interects. + + Note that to truly test intersection for segments we have to make + sure that S & T lie within [0..1] and for rays, make sure S & T > 0 + the hit point is C + T * (D - C); + the hit point also is A + S * (B - A); + @since 3.0 + * @js NA + * @lua NA + */ + static bool isLineIntersect(const Point& A, const Point& B, + const Point& C, const Point& D, + float *S = nullptr, float *T = nullptr); + + /** + returns true if Line A-B overlap with segment C-D + @since v3.0 + * @js NA + * @lua NA + */ + static bool isLineOverlap(const Point& A, const Point& B, + const Point& C, const Point& D); + + /** + returns true if Line A-B parallel with segment C-D + @since v3.0 + * @js NA + * @lua NA + */ + static bool isLineParallel(const Point& A, const Point& B, + const Point& C, const Point& D); + + /** + returns true if Segment A-B overlap with segment C-D + @since v3.0 + * @js NA + * @lua NA + */ + static bool isSegmentOverlap(const Point& A, const Point& B, + const Point& C, const Point& D, + Point* S = nullptr, Point* E = nullptr); + + /** + returns true if Segment A-B intersects with segment C-D + @since v3.0 + * @js NA + * @lua NA + */ + static bool isSegmentIntersect(const Point& A, const Point& B, const Point& C, const Point& D); + + /** + returns the intersection point of line A-B, C-D + @since v3.0 + * @js NA + * @lua NA + */ + static Point getIntersectPoint(const Point& A, const Point& B, const Point& C, const Point& D); + + static const Point ZERO; + +private: + // returns true if segment A-B intersects with segment C-D. S->E is the ovderlap part + static bool isOneDemensionSegmentOverlap(float A, float B, float C, float D, float *S, float * E); + + // cross procuct of 2 vector. A->B X C->D + static float crossProduct2Vector(const Point& A, const Point& B, const Point& C, const Point& D) { return (D.y - C.y) * (B.x - A.x) - (D.x - C.x) * (B.y - A.y); } +}; + +class CC_DLL Size +{ +public: + float width; + float height; + +public: + /** + * @js NA + */ + Size(); + /** + * @js NA + */ + Size(float width, float height); + /** + * @js NA + * @lua NA + */ + Size(const Size& other); + /** + * @js NA + * @lua NA + */ + explicit Size(const Point& point); + /** + * @js NA + * @lua NA + */ + Size& operator= (const Size& other); + /** + * @js NA + * @lua NA + */ + Size& operator= (const Point& point); + /** + * @js NA + * @lua NA + */ + Size operator+(const Size& right) const; + /** + * @js NA + * @lua NA + */ + Size operator-(const Size& right) const; + /** + * @js NA + * @lua NA + */ + Size operator*(float a) const; + /** + * @js NA + * @lua NA + */ + Size operator/(float a) const; + /** + * @js NA + * @lua NA + */ + void setSize(float width, float height); + /** + * @js NA + */ + bool equals(const Size& target) const; + + static const Size ZERO; +}; + +class CC_DLL Rect +{ +public: + Point origin; + Size size; + +public: + /** + * @js NA + */ + Rect(); + /** + * @js NA + */ + Rect(float x, float y, float width, float height); + /** + * @js NA + * @lua NA + */ + Rect(const Rect& other); + /** + * @js NA + * @lua NA + */ + Rect& operator= (const Rect& other); + /** + * @js NA + * @lua NA + */ + void setRect(float x, float y, float width, float height); + /** + * @js NA + */ + float getMinX() const; /// return the leftmost x-value of current rect + /** + * @js NA + */ + float getMidX() const; /// return the midpoint x-value of current rect + /** + * @js NA + */ + float getMaxX() const; /// return the rightmost x-value of current rect + /** + * @js NA + */ + float getMinY() const; /// return the bottommost y-value of current rect + /** + * @js NA + */ + float getMidY() const; /// return the midpoint y-value of current rect + /** + * @js NA + */ + float getMaxY() const; /// return the topmost y-value of current rect + /** + * @js NA + */ + bool equals(const Rect& rect) const; + /** + * @js NA + */ + bool containsPoint(const Point& point) const; + /** + * @js NA + */ + bool intersectsRect(const Rect& rect) const; + /** + * @js NA + * @lua NA + */ + Rect unionWithRect(const Rect & rect) const; + + static const Rect ZERO; +}; + +// end of data_structure group +/// @} + +NS_CC_END + +#endif // __CCGEMETRY_H__ diff --git a/cocos/base/cocoa/CCInteger.h b/cocos/base/cocoa/CCInteger.h new file mode 100644 index 0000000000..23735627dd --- /dev/null +++ b/cocos/base/cocoa/CCInteger.h @@ -0,0 +1,79 @@ +/**************************************************************************** + Copyright (c) 2010-2012 cocos2d-x.org + + 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 __CCINTEGER_H__ +#define __CCINTEGER_H__ + +#include "CCObject.h" +#include "platform/CCCommon.h" + +NS_CC_BEGIN + +/** + * @addtogroup data_structures + * @{ + */ + +class CC_DLL Integer : public Object, public Clonable +{ +public: + static Integer* create(int v) + { + Integer* pRet = new Integer(v); + pRet->autorelease(); + return pRet; + } + /** + * @js NA + */ + Integer(int v) + : _value(v) {} + int getValue() const {return _value;} + /** + * @js NA + * @lua NA + */ + virtual ~Integer() { + CCLOGINFO("deallocing ~Integer: %p", this); + } + + /* override functions */ + virtual void acceptVisitor(DataVisitor &visitor) { visitor.visit(this); } + + // overrides + virtual Integer* clone() const override + { + return Integer::create(_value); + } + +private: + int _value; +}; + +// end of data_structure group +/// @} + +NS_CC_END + +#endif /* __CCINTEGER_H__ */ diff --git a/cocos/base/cocoa/CCNS.cpp b/cocos/base/cocoa/CCNS.cpp new file mode 100644 index 0000000000..8cf496c0b1 --- /dev/null +++ b/cocos/base/cocoa/CCNS.cpp @@ -0,0 +1,185 @@ +/**************************************************************************** +Copyright (c) 2010 cocos2d-x.org + +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 "CCNS.h" +#include +#include +#include +#include + +using namespace std; + +NS_CC_BEGIN + +typedef std::vector strArray; + +// string toolkit +static inline void split(std::string src, const char* token, strArray& vect) +{ + int nend=0; + int nbegin=0; + while(nend != -1) + { + nend = src.find(token, nbegin); + if(nend == -1) + vect.push_back(src.substr(nbegin, src.length()-nbegin)); + else + vect.push_back(src.substr(nbegin, nend-nbegin)); + nbegin = nend + strlen(token); + } +} + +// first, judge whether the form of the string like this: {x,y} +// if the form is right,the string will be split into the parameter strs; +// or the parameter strs will be empty. +// if the form is right return true,else return false. +static bool splitWithForm(const char* pStr, strArray& strs) +{ + bool bRet = false; + + do + { + CC_BREAK_IF(!pStr); + + // string is empty + std::string content = pStr; + CC_BREAK_IF(content.length() == 0); + + int nPosLeft = content.find('{'); + int nPosRight = content.find('}'); + + // don't have '{' and '}' + CC_BREAK_IF(nPosLeft == (int)std::string::npos || nPosRight == (int)std::string::npos); + // '}' is before '{' + CC_BREAK_IF(nPosLeft > nPosRight); + + std::string pointStr = content.substr(nPosLeft + 1, nPosRight - nPosLeft - 1); + // nothing between '{' and '}' + CC_BREAK_IF(pointStr.length() == 0); + + int nPos1 = pointStr.find('{'); + int nPos2 = pointStr.find('}'); + // contain '{' or '}' + CC_BREAK_IF(nPos1 != (int)std::string::npos || nPos2 != (int)std::string::npos); + + split(pointStr, ",", strs); + if (strs.size() != 2 || strs[0].length() == 0 || strs[1].length() == 0) + { + strs.clear(); + break; + } + + bRet = true; + } while (0); + + return bRet; +} + +// implement the functions + +Rect RectFromString(const char* pszContent) +{ + Rect result = Rect::ZERO; + + do + { + CC_BREAK_IF(!pszContent); + std::string content = pszContent; + + // find the first '{' and the third '}' + int nPosLeft = content.find('{'); + int nPosRight = content.find('}'); + for (int i = 1; i < 3; ++i) + { + if (nPosRight == (int)std::string::npos) + { + break; + } + nPosRight = content.find('}', nPosRight + 1); + } + CC_BREAK_IF(nPosLeft == (int)std::string::npos || nPosRight == (int)std::string::npos); + + content = content.substr(nPosLeft + 1, nPosRight - nPosLeft - 1); + int nPointEnd = content.find('}'); + CC_BREAK_IF(nPointEnd == (int)std::string::npos); + nPointEnd = content.find(',', nPointEnd); + CC_BREAK_IF(nPointEnd == (int)std::string::npos); + + // get the point string and size string + std::string pointStr = content.substr(0, nPointEnd); + std::string sizeStr = content.substr(nPointEnd + 1, content.length() - nPointEnd); + + // split the string with ',' + strArray pointInfo; + CC_BREAK_IF(!splitWithForm(pointStr.c_str(), pointInfo)); + strArray sizeInfo; + CC_BREAK_IF(!splitWithForm(sizeStr.c_str(), sizeInfo)); + + float x = (float) atof(pointInfo[0].c_str()); + float y = (float) atof(pointInfo[1].c_str()); + float width = (float) atof(sizeInfo[0].c_str()); + float height = (float) atof(sizeInfo[1].c_str()); + + result = Rect(x, y, width, height); + } while (0); + + return result; +} + +Point PointFromString(const char* pszContent) +{ + Point ret = Point::ZERO; + + do + { + strArray strs; + CC_BREAK_IF(!splitWithForm(pszContent, strs)); + + float x = (float) atof(strs[0].c_str()); + float y = (float) atof(strs[1].c_str()); + + ret = Point(x, y); + } while (0); + + return ret; +} + +Size SizeFromString(const char* pszContent) +{ + Size ret = Size::ZERO; + + do + { + strArray strs; + CC_BREAK_IF(!splitWithForm(pszContent, strs)); + + float width = (float) atof(strs[0].c_str()); + float height = (float) atof(strs[1].c_str()); + + ret = Size(width, height); + } while (0); + + return ret; +} + +NS_CC_END diff --git a/cocos/base/cocoa/CCNS.h b/cocos/base/cocoa/CCNS.h new file mode 100644 index 0000000000..8ce8e1dde6 --- /dev/null +++ b/cocos/base/cocoa/CCNS.h @@ -0,0 +1,80 @@ +/**************************************************************************** +Copyright (c) 2010 cocos2d-x.org + +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 __PLATFOMR_CCNS_H__ +#define __PLATFOMR_CCNS_H__ + +#include "CCGeometry.h" + +NS_CC_BEGIN + +/** + * @addtogroup data_structures + * @{ + */ + +/** +@brief Returns a Core Graphics rectangle structure corresponding to the data in a given string. +@param pszContent A string object whose contents are of the form "{{x,y},{w, h}}", + where x is the x coordinate, y is the y coordinate, w is the width, and h is the height. + These components can represent integer or float values. + An example of a valid string is "{{3,2},{4,5}}". + The string is not localized, so items are always separated with a comma. +@return A Core Graphics structure that represents a rectangle. + If the string is not well-formed, the function returns Rect::ZERO. +*/ +Rect CC_DLL RectFromString(const char* pszContent); + +/** +@brief Returns a Core Graphics point structure corresponding to the data in a given string. +@param pszContent A string object whose contents are of the form "{x,y}", + where x is the x coordinate and y is the y coordinate. + The x and y values can represent integer or float values. + An example of a valid string is "{3.0,2.5}". + The string is not localized, so items are always separated with a comma. +@return A Core Graphics structure that represents a point. + If the string is not well-formed, the function returns Point::ZERO. +*/ +Point CC_DLL PointFromString(const char* pszContent); + +/** +@brief Returns a Core Graphics size structure corresponding to the data in a given string. +@param pszContent A string object whose contents are of the form "{w, h}", + where w is the width and h is the height. + The w and h values can be integer or float values. + An example of a valid string is "{3.0,2.5}". + The string is not localized, so items are always separated with a comma. +@return A Core Graphics structure that represents a size. + If the string is not well-formed, the function returns Size::ZERO. +*/ +Size CC_DLL SizeFromString(const char* pszContent); + +// end of data_structure group +/// @} + +NS_CC_END + +#endif // __PLATFOMR_CCNS_H__ + + diff --git a/cocos/base/cocoa/CCObject.cpp b/cocos/base/cocoa/CCObject.cpp new file mode 100644 index 0000000000..13fa0e3236 --- /dev/null +++ b/cocos/base/cocoa/CCObject.cpp @@ -0,0 +1,93 @@ +/**************************************************************************** +Copyright (c) 2010 cocos2d-x.org + +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 "CCObject.h" +#include "CCAutoreleasePool.h" +#include "ccMacros.h" +#include "script_support/CCScriptSupport.h" + +NS_CC_BEGIN + +Object::Object() +: _luaID(0) +, _reference(1) // when the object is created, the reference count of it is 1 +, _autoReleaseCount(0) +{ + static unsigned int uObjectCount = 0; + + _ID = ++uObjectCount; +} + +Object::~Object() +{ + // if the object is managed, we should remove it + // from pool manager + if (_autoReleaseCount > 0) + { + PoolManager::sharedPoolManager()->removeObject(this); + } + + // if the object is referenced by Lua engine, remove it + if (_luaID) + { + ScriptEngineManager::getInstance()->getScriptEngine()->removeScriptObjectByObject(this); + } + else + { + ScriptEngineProtocol* pEngine = ScriptEngineManager::getInstance()->getScriptEngine(); + if (pEngine != NULL && pEngine->getScriptType() == kScriptTypeJavascript) + { + pEngine->removeScriptObjectByObject(this); + } + } +} + +Object* Object::autorelease() +{ + PoolManager::sharedPoolManager()->addObject(this); + return this; +} + +bool Object::isSingleReference() const +{ + return _reference == 1; +} + +unsigned int Object::retainCount() const +{ + return _reference; +} + +bool Object::isEqual(const Object *object) +{ + return this == object; +} + +void Object::acceptVisitor(DataVisitor &visitor) +{ + visitor.visitObject(this); +} + +NS_CC_END diff --git a/cocos/base/cocoa/CCObject.h b/cocos/base/cocoa/CCObject.h new file mode 100644 index 0000000000..8de1ff9d8b --- /dev/null +++ b/cocos/base/cocoa/CCObject.h @@ -0,0 +1,216 @@ +/**************************************************************************** +Copyright (c) 2010 cocos2d-x.org + +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 __CCOBJECT_H__ +#define __CCOBJECT_H__ + +#include "cocoa/CCDataVisitor.h" +#include "ccMacros.h" + +#ifdef EMSCRIPTEN +#include +#endif // EMSCRIPTEN + +NS_CC_BEGIN + +/** + * @addtogroup base_nodes + * @{ + */ + +class Object; +class Node; + +/** Interface that defines how to clone an object */ +class CC_DLL Clonable +{ +public: + /** returns a copy of the object */ + virtual Clonable* clone() const = 0; + /** + * @js NA + * @lua NA + */ + virtual ~Clonable() {}; + + /** returns a copy of the object. + @deprecated Use clone() instead + */ + CC_DEPRECATED_ATTRIBUTE Object* copy() const + { + // use "clone" instead + CC_ASSERT(false); + return nullptr; + } +}; + +class CC_DLL Object +{ +public: + /// object id, ScriptSupport need public _ID + unsigned int _ID; + /// Lua reference id + int _luaID; +protected: + /// count of references + unsigned int _reference; + /// count of autorelease + unsigned int _autoReleaseCount; +public: + /** + * Constructor + * + * The object's reference count is 1 after construction. + * @js NA + */ + Object(); + + /** + * @js NA + * @lua NA + */ + virtual ~Object(); + + /** + * Release the ownership immediately. + * + * This decrements the object's reference count. + * + * If the reference count reaches 0 after the descrement, this object is + * destructed. + * + * @see retain, autorelease + * @js NA + */ + inline void release() + { + CCASSERT(_reference > 0, "reference count should greater than 0"); + --_reference; + + if (_reference == 0) + delete this; + } + + /** + * Retains the ownership. + * + * This increases the object's reference count. + * + * @see release, autorelease + * @js NA + */ + inline void retain() + { + CCASSERT(_reference > 0, "reference count should greater than 0"); + ++_reference; + } + + /** + * Release the ownership sometime soon automatically. + * + * This descrements the object's reference count at the end of current + * autorelease pool block. + * + * If the reference count reaches 0 after the descrement, this object is + * destructed. + * + * @returns The object itself. + * + * @see AutoreleasePool, retain, release + * @js NA + * @lua NA + */ + Object* autorelease(); + + /** + * Returns a boolean value that indicates whether there is only one + * reference to the object. That is, whether the reference count is 1. + * + * @returns Whether the object's reference count is 1. + * @js NA + */ + bool isSingleReference() const; + + /** + * Returns the object's current reference count. + * + * @returns The object's reference count. + * @js NA + */ + unsigned int retainCount() const; + + /** + * Returns a boolean value that indicates whether this object and a given + * object are equal. + * + * @param object The object to be compared to this object. + * + * @returns True if this object and @p object are equal, otherwise false. + * @js NA + * @lua NA + */ + virtual bool isEqual(const Object* object); + /** + * @js NA + * @lua NA + */ + virtual void acceptVisitor(DataVisitor &visitor); + /** + * @js NA + * @lua NA + */ + virtual void update(float dt) {CC_UNUSED_PARAM(dt);}; + + friend class AutoreleasePool; +}; + + +typedef void (Object::*SEL_SCHEDULE)(float); +typedef void (Object::*SEL_CallFunc)(); +typedef void (Object::*SEL_CallFuncN)(Node*); +typedef void (Object::*SEL_CallFuncND)(Node*, void*); +typedef void (Object::*SEL_CallFuncO)(Object*); +typedef void (Object::*SEL_MenuHandler)(Object*); +typedef int (Object::*SEL_Compare)(Object*); + +#define schedule_selector(_SELECTOR) static_cast(&_SELECTOR) +#define callfunc_selector(_SELECTOR) static_cast(&_SELECTOR) +#define callfuncN_selector(_SELECTOR) static_cast(&_SELECTOR) +#define callfuncND_selector(_SELECTOR) static_cast(&_SELECTOR) +#define callfuncO_selector(_SELECTOR) static_cast(&_SELECTOR) +#define menu_selector(_SELECTOR) static_cast(&_SELECTOR) +#define event_selector(_SELECTOR) static_cast(&_SELECTOR) +#define compare_selector(_SELECTOR) static_cast(&_SELECTOR) + +// new callbacks based on C++11 +#define CC_CALLBACK_0(__selector__,__target__, ...) std::bind(&__selector__,__target__, ##__VA_ARGS__) +#define CC_CALLBACK_1(__selector__,__target__, ...) std::bind(&__selector__,__target__, std::placeholders::_1, ##__VA_ARGS__) +#define CC_CALLBACK_2(__selector__,__target__, ...) std::bind(&__selector__,__target__, std::placeholders::_1, std::placeholders::_2, ##__VA_ARGS__) + +// end of base_nodes group +/// @} + +NS_CC_END + +#endif // __CCOBJECT_H__ diff --git a/cocos/base/cocoa/CCSet.cpp b/cocos/base/cocoa/CCSet.cpp new file mode 100644 index 0000000000..c3c24e0e5e --- /dev/null +++ b/cocos/base/cocoa/CCSet.cpp @@ -0,0 +1,166 @@ +/**************************************************************************** +Copyright (c) 2010 cocos2d-x.org + +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 "CCSet.h" + +using namespace std; + +NS_CC_BEGIN + +Set::Set(void) +{ + _set = new set; +} + +Set::Set(const Set &rSetObject) +{ + _set = new set(*rSetObject._set); + + // call retain of members + SetIterator iter; + for (iter = _set->begin(); iter != _set->end(); ++iter) + { + if (! (*iter)) + { + break; + } + + (*iter)->retain(); + } +} + +Set::~Set(void) +{ + removeAllObjects(); + CC_SAFE_DELETE(_set); +} + +void Set::acceptVisitor(DataVisitor &visitor) +{ + visitor.visit(this); +} + +Set * Set::create() +{ + Set * pRet = new Set(); + + if (pRet != NULL) + { + pRet->autorelease(); + } + + return pRet; +} + +Set* Set::copy(void) +{ + Set *pSet = new Set(*this); + + return pSet; +} + +Set* Set::mutableCopy(void) +{ + return copy(); +} + +int Set::count(void) +{ + return (int)_set->size(); +} + +void Set::addObject(Object *pObject) +{ + if (_set->count(pObject) == 0) + { + CC_SAFE_RETAIN(pObject); + _set->insert(pObject); + } +} + +void Set::removeObject(Object *pObject) +{ + if (_set->erase(pObject) > 0) + { + CC_SAFE_RELEASE(pObject); + } +} + +void Set::removeAllObjects() +{ + SetIterator it = _set->begin(); + SetIterator tmp; + + while (it != _set->end()) + { + if (!(*it)) + { + break; + } + + tmp = it; + ++tmp; + Object * obj = *it; + _set->erase(it); + CC_SAFE_RELEASE(obj); + it = tmp; + } +} + +bool Set::containsObject(Object *pObject) +{ + return _set->find(pObject) != _set->end(); +} + +SetIterator Set::begin(void) +{ + return _set->begin(); +} + +SetIterator Set::end(void) +{ + return _set->end(); +} + +Object* Set::anyObject() +{ + if (!_set || _set->empty()) + { + return 0; + } + + SetIterator it; + + for( it = _set->begin(); it != _set->end(); ++it) + { + if (*it) + { + return (*it); + } + } + + return 0; +} + +NS_CC_END diff --git a/cocos/base/cocoa/CCSet.h b/cocos/base/cocoa/CCSet.h new file mode 100644 index 0000000000..c748f0ada5 --- /dev/null +++ b/cocos/base/cocoa/CCSet.h @@ -0,0 +1,119 @@ +/**************************************************************************** +Copyright (c) 2010-2012 cocos2d-x.org + +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 __CC_SET_H__ +#define __CC_SET_H__ + +#include +#include "CCObject.h" + +NS_CC_BEGIN + +/** + * @addtogroup data_structures + * @{ + */ + +typedef std::set::iterator SetIterator; + +class CC_DLL Set : public Object +{ +public: + /** + * @js ctor + */ + Set(void); + Set(const Set &rSetObject); + /** + * @js NA + * @lua NA + */ + virtual ~Set(void); + + /** + * @brief Create and return a new empty set. + */ + static Set * create(); + + /** + *@brief Return a copy of the Set, it will copy all the elements. + */ + Set* copy(); + /** + *@brief It is the same as copy(). + */ + Set* mutableCopy(); + /** + *@brief Return the number of elements the Set contains. + */ + int count(); + /** + *@brief Add a element into Set, it will retain the element. + */ + void addObject(Object *pObject); + /** + *@brief Remove the given element, nothing todo if no element equals pObject. + */ + void removeObject(Object *pObject); + /** + *@brief Remove all elements of the set + */ + void removeAllObjects(); + /** + *@brief Check if Set contains a element equals pObject. + */ + bool containsObject(Object *pObject); + /** + *@brief Return the iterator that points to the first element. + * @js NA + * @lua NA + */ + SetIterator begin(); + /** + *@brief Return the iterator that points to the position after the last element. + * @js NA + * @lua NA + */ + SetIterator end(); + /** + *@brief Return the first element if it contains elements, or null if it doesn't contain any element. + */ + Object* anyObject(); + /** + * @js NA + * @lua NA + */ + virtual void acceptVisitor(DataVisitor &visitor); + +private: + std::set *_set; +}; + +// end of data_structure group +/// @} + +NS_CC_END + +#endif // __CC_SET_H__ + diff --git a/cocos/base/cocoa/CCString.cpp b/cocos/base/cocoa/CCString.cpp new file mode 100644 index 0000000000..f9962b1ba4 --- /dev/null +++ b/cocos/base/cocoa/CCString.cpp @@ -0,0 +1,277 @@ +/**************************************************************************** + Copyright (c) 2010-2012 cocos2d-x.org + + 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 "CCString.h" +#include "platform/CCFileUtils.h" +#include "ccMacros.h" +#include +#include +#include "CCArray.h" + +NS_CC_BEGIN + +#define kMaxStringLen (1024*100) + +String::String() + :_string("") +{} + +String::String(const char * str) + :_string(str) +{} + +String::String(const std::string& str) + :_string(str) +{} + +String::String(const String& str) + :_string(str.getCString()) +{} + +String::~String() +{ + CCLOGINFO("deallocing String: %p", this); + + _string.clear(); +} + +String& String::operator= (const String& other) +{ + _string = other._string; + return *this; +} + +bool String::initWithFormatAndValist(const char* format, va_list ap) +{ + bool bRet = false; + char* pBuf = (char*)malloc(kMaxStringLen); + if (pBuf != NULL) + { + vsnprintf(pBuf, kMaxStringLen, format, ap); + _string = pBuf; + free(pBuf); + bRet = true; + } + return bRet; +} + +bool String::initWithFormat(const char* format, ...) +{ + bool bRet = false; + _string.clear(); + + va_list ap; + va_start(ap, format); + + bRet = initWithFormatAndValist(format, ap); + + va_end(ap); + + return bRet; +} + +int String::intValue() const +{ + if (length() == 0) + { + return 0; + } + return atoi(_string.c_str()); +} + +unsigned int String::uintValue() const +{ + if (length() == 0) + { + return 0; + } + return (unsigned int)atoi(_string.c_str()); +} + +float String::floatValue() const +{ + if (length() == 0) + { + return 0.0f; + } + return (float)atof(_string.c_str()); +} + +double String::doubleValue() const +{ + if (length() == 0) + { + return 0.0; + } + return atof(_string.c_str()); +} + +bool String::boolValue() const +{ + if (length() == 0) + { + return false; + } + + if (0 == strcmp(_string.c_str(), "0") || 0 == strcmp(_string.c_str(), "false")) + { + return false; + } + return true; +} + +const char* String::getCString() const +{ + return _string.c_str(); +} + +unsigned int String::length() const +{ + return _string.length(); +} + +int String::compare(const char * pStr) const +{ + return strcmp(getCString(), pStr); +} + +void String::append(const std::string& str) +{ + _string.append(str); +} + +void String::appendWithFormat(const char* format, ...) +{ + va_list ap; + va_start(ap, format); + + char* pBuf = (char*)malloc(kMaxStringLen); + if (pBuf != NULL) + { + vsnprintf(pBuf, kMaxStringLen, format, ap); + _string.append(pBuf); + free(pBuf); + } + + va_end(ap); + +} + +Array* String::componentsSeparatedByString(const char *delimiter) +{ + Array* result = Array::create(); + + int cutAt; + while( (cutAt = _string.find_first_of(delimiter)) != _string.npos ) + { + if(cutAt > 0) + { + result->addObject(String::create(_string.substr(0, cutAt))); + } + _string = _string.substr(cutAt + 1); + } + + if(_string.length() > 0) + { + result->addObject(String::create(_string)); + } + + return result; +} + +bool String::isEqual(const Object* pObject) +{ + bool bRet = false; + const String* pStr = dynamic_cast(pObject); + if (pStr != NULL) + { + if (0 == _string.compare(pStr->_string)) + { + bRet = true; + } + } + return bRet; +} + +String* String::create(const std::string& str) +{ + String* pRet = new String(str); + pRet->autorelease(); + return pRet; +} + +String* String::createWithData(const unsigned char* pData, unsigned long nLen) +{ + String* pRet = NULL; + if (pData != NULL) + { + char* pStr = (char*)malloc(nLen+1); + if (pStr != NULL) + { + pStr[nLen] = '\0'; + if (nLen > 0) + { + memcpy(pStr, pData, nLen); + } + + pRet = String::create(pStr); + free(pStr); + } + } + return pRet; +} + +String* String::createWithFormat(const char* format, ...) +{ + String* pRet = String::create(""); + va_list ap; + va_start(ap, format); + pRet->initWithFormatAndValist(format, ap); + va_end(ap); + + return pRet; +} + +String* String::createWithContentsOfFile(const char* filename) +{ + unsigned long size = 0; + unsigned char* pData = 0; + String* pRet = NULL; + pData = FileUtils::getInstance()->getFileData(filename, "rb", &size); + pRet = String::createWithData(pData, size); + CC_SAFE_DELETE_ARRAY(pData); + return pRet; +} + +void String::acceptVisitor(DataVisitor &visitor) +{ + visitor.visit(this); +} + +String* String::clone() const +{ + return String::create(_string); +} + +NS_CC_END diff --git a/cocos/base/cocoa/CCString.h b/cocos/base/cocoa/CCString.h new file mode 100644 index 0000000000..a6f237a476 --- /dev/null +++ b/cocos/base/cocoa/CCString.h @@ -0,0 +1,210 @@ +/**************************************************************************** +Copyright (c) 2010 cocos2d-x.org + +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 __CCSTRING_H__ +#define __CCSTRING_H__ + +#if (CC_TARGET_PLATFORM == CC_PLATFORM_BLACKBERRY) +#include +#endif + +#include +#include +#include +#include "CCObject.h" + +NS_CC_BEGIN + +/** + * @addtogroup data_structures + * @{ + */ + +class CC_DLL String : public Object, public Clonable +{ +public: + /** + * @js NA + * @lua NA + */ + String(); + /** + * @js NA + * @lua NA + */ + String(const char* str); + /** + * @js NA + * @lua NA + */ + String(const std::string& str); + /** + * @js NA + * @lua NA + */ + String(const String& str); + /** + * @js NA + * @lua NA + */ + virtual ~String(); + + /* override assignment operator + * @js NA + * @lua NA + */ + String& operator= (const String& other); + + /** init a string with format, it's similar with the c function 'sprintf' + * @js NA + * @lua NA + */ + bool initWithFormat(const char* format, ...) CC_FORMAT_PRINTF(2, 3); + + /** convert to int value + * @js NA + */ + int intValue() const; + + /** convert to unsigned int value + * @js NA + */ + unsigned int uintValue() const; + + /** convert to float value + * @js NA + */ + float floatValue() const; + + /** convert to double value + * @js NA + */ + double doubleValue() const; + + /** convert to bool value + * @js NA + */ + bool boolValue() const; + + /** get the C string + * @js NA + */ + const char* getCString() const; + + /** get the length of string + * @js NA + */ + unsigned int length() const; + + /** compare to a c string + * @js NA + */ + int compare(const char *) const; + + /** append additional characters at the end of its current value + * @js NA + * @lua NA + */ + void append(const std::string& str); + + /** append(w/ format) additional characters at the end of its current value + * @js NA + * @lua NA + */ + void appendWithFormat(const char* format, ...); + + /** split a string + * @js NA + * @lua NA + */ + Array* componentsSeparatedByString(const char *delimiter); + + /* override functions + * @js NA + */ + virtual bool isEqual(const Object* pObject); + + /** create a string with std string, you can also pass a c string pointer because the default constructor of std::string can access a c string pointer. + * @return A String pointer which is an autorelease object pointer, + * it means that you needn't do a release operation unless you retain it. + * @js NA + */ + static String* create(const std::string& str); + + /** create a string with format, it's similar with the c function 'sprintf', the default buffer size is (1024*100) bytes, + * if you want to change it, you should modify the kMaxStringLen macro in String.cpp file. + * @return A String pointer which is an autorelease object pointer, + * it means that you needn't do a release operation unless you retain it. + * @js NA + */ + static String* createWithFormat(const char* format, ...) CC_FORMAT_PRINTF(1, 2); + + /** create a string with binary data + * @return A String pointer which is an autorelease object pointer, + * it means that you needn't do a release operation unless you retain it. + * @js NA + */ + static String* createWithData(const unsigned char* pData, unsigned long nLen); + + /** create a string with a file, + * @return A String pointer which is an autorelease object pointer, + * it means that you needn't do a release operation unless you retain it. + * @js NA + */ + static String* createWithContentsOfFile(const char* filename); + /** + * @js NA + * @lua NA + */ + virtual void acceptVisitor(DataVisitor &visitor); + /** + * @js NA + * @lua NA + */ + virtual String* clone() const; + +private: + + /** only for internal use */ + bool initWithFormatAndValist(const char* format, va_list ap); + +public: + std::string _string; +}; + +struct StringCompare : public std::binary_function { + public: + bool operator() (String * a, String * b) const { + return strcmp(a->getCString(), b->getCString()) < 0; + } +}; + +#define StringMake(str) String::create(str) +#define ccs StringMake + +// end of data_structure group +/// @} + +NS_CC_END + +#endif //__CCSTRING_H__ diff --git a/cocos/base/etc1/etc1.cpp b/cocos/base/etc1/etc1.cpp new file mode 100644 index 0000000000..9c1cd43e83 --- /dev/null +++ b/cocos/base/etc1/etc1.cpp @@ -0,0 +1,670 @@ +// Copyright 2009 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "etc1.h" + +#include + +/* From http://www.khronos.org/registry/gles/extensions/OES/OES_compressed_ETC1_RGB8_texture.txt + + The number of bits that represent a 4x4 texel block is 64 bits if + is given by ETC1_RGB8_OES. + + The data for a block is a number of bytes, + + {q0, q1, q2, q3, q4, q5, q6, q7} + + where byte q0 is located at the lowest memory address and q7 at + the highest. The 64 bits specifying the block is then represented + by the following 64 bit integer: + + int64bit = 256*(256*(256*(256*(256*(256*(256*q0+q1)+q2)+q3)+q4)+q5)+q6)+q7; + + ETC1_RGB8_OES: + + a) bit layout in bits 63 through 32 if diffbit = 0 + + 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 + ----------------------------------------------- + | base col1 | base col2 | base col1 | base col2 | + | R1 (4bits)| R2 (4bits)| G1 (4bits)| G2 (4bits)| + ----------------------------------------------- + + 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 + --------------------------------------------------- + | base col1 | base col2 | table | table |diff|flip| + | B1 (4bits)| B2 (4bits)| cw 1 | cw 2 |bit |bit | + --------------------------------------------------- + + + b) bit layout in bits 63 through 32 if diffbit = 1 + + 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 + ----------------------------------------------- + | base col1 | dcol 2 | base col1 | dcol 2 | + | R1' (5 bits) | dR2 | G1' (5 bits) | dG2 | + ----------------------------------------------- + + 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 + --------------------------------------------------- + | base col 1 | dcol 2 | table | table |diff|flip| + | B1' (5 bits) | dB2 | cw 1 | cw 2 |bit |bit | + --------------------------------------------------- + + + c) bit layout in bits 31 through 0 (in both cases) + + 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 + ----------------------------------------------- + | most significant pixel index bits | + | p| o| n| m| l| k| j| i| h| g| f| e| d| c| b| a| + ----------------------------------------------- + + 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 + -------------------------------------------------- + | least significant pixel index bits | + | p| o| n| m| l| k| j| i| h| g| f| e| d| c | b | a | + -------------------------------------------------- + + + Add table 3.17.2: Intensity modifier sets for ETC1 compressed textures: + + table codeword modifier table + ------------------ ---------------------- + 0 -8 -2 2 8 + 1 -17 -5 5 17 + 2 -29 -9 9 29 + 3 -42 -13 13 42 + 4 -60 -18 18 60 + 5 -80 -24 24 80 + 6 -106 -33 33 106 + 7 -183 -47 47 183 + + + Add table 3.17.3 Mapping from pixel index values to modifier values for + ETC1 compressed textures: + + pixel index value + --------------- + msb lsb resulting modifier value + ----- ----- ------------------------- + 1 1 -b (large negative value) + 1 0 -a (small negative value) + 0 0 a (small positive value) + 0 1 b (large positive value) + + + */ + +static const int kModifierTable[] = { +/* 0 */2, 8, -2, -8, +/* 1 */5, 17, -5, -17, +/* 2 */9, 29, -9, -29, +/* 3 */13, 42, -13, -42, +/* 4 */18, 60, -18, -60, +/* 5 */24, 80, -24, -80, +/* 6 */33, 106, -33, -106, +/* 7 */47, 183, -47, -183 }; + +static const int kLookup[8] = { 0, 1, 2, 3, -4, -3, -2, -1 }; + +static inline etc1_byte clamp(int x) { + return (etc1_byte) (x >= 0 ? (x < 255 ? x : 255) : 0); +} + +static +inline int convert4To8(int b) { + int c = b & 0xf; + return (c << 4) | c; +} + +static +inline int convert5To8(int b) { + int c = b & 0x1f; + return (c << 3) | (c >> 2); +} + +static +inline int convert6To8(int b) { + int c = b & 0x3f; + return (c << 2) | (c >> 4); +} + +static +inline int divideBy255(int d) { + return (d + 128 + (d >> 8)) >> 8; +} + +static +inline int convert8To4(int b) { + int c = b & 0xff; + return divideBy255(c * 15); +} + +static +inline int convert8To5(int b) { + int c = b & 0xff; + return divideBy255(c * 31); +} + +static +inline int convertDiff(int base, int diff) { + return convert5To8((0x1f & base) + kLookup[0x7 & diff]); +} + +static +void decode_subblock(etc1_byte* pOut, int r, int g, int b, const int* table, + etc1_uint32 low, bool second, bool flipped) { + int baseX = 0; + int baseY = 0; + if (second) { + if (flipped) { + baseY = 2; + } else { + baseX = 2; + } + } + for (int i = 0; i < 8; i++) { + int x, y; + if (flipped) { + x = baseX + (i >> 1); + y = baseY + (i & 1); + } else { + x = baseX + (i >> 2); + y = baseY + (i & 3); + } + int k = y + (x * 4); + int offset = ((low >> k) & 1) | ((low >> (k + 15)) & 2); + int delta = table[offset]; + etc1_byte* q = pOut + 3 * (x + 4 * y); + *q++ = clamp(r + delta); + *q++ = clamp(g + delta); + *q++ = clamp(b + delta); + } +} + +// Input is an ETC1 compressed version of the data. +// Output is a 4 x 4 square of 3-byte pixels in form R, G, B + +void etc1_decode_block(const etc1_byte* pIn, etc1_byte* pOut) { + etc1_uint32 high = (pIn[0] << 24) | (pIn[1] << 16) | (pIn[2] << 8) | pIn[3]; + etc1_uint32 low = (pIn[4] << 24) | (pIn[5] << 16) | (pIn[6] << 8) | pIn[7]; + int r1, r2, g1, g2, b1, b2; + if (high & 2) { + // differential + int rBase = high >> 27; + int gBase = high >> 19; + int bBase = high >> 11; + r1 = convert5To8(rBase); + r2 = convertDiff(rBase, high >> 24); + g1 = convert5To8(gBase); + g2 = convertDiff(gBase, high >> 16); + b1 = convert5To8(bBase); + b2 = convertDiff(bBase, high >> 8); + } else { + // not differential + r1 = convert4To8(high >> 28); + r2 = convert4To8(high >> 24); + g1 = convert4To8(high >> 20); + g2 = convert4To8(high >> 16); + b1 = convert4To8(high >> 12); + b2 = convert4To8(high >> 8); + } + int tableIndexA = 7 & (high >> 5); + int tableIndexB = 7 & (high >> 2); + const int* tableA = kModifierTable + tableIndexA * 4; + const int* tableB = kModifierTable + tableIndexB * 4; + bool flipped = (high & 1) != 0; + decode_subblock(pOut, r1, g1, b1, tableA, low, false, flipped); + decode_subblock(pOut, r2, g2, b2, tableB, low, true, flipped); +} + +typedef struct { + etc1_uint32 high; + etc1_uint32 low; + etc1_uint32 score; // Lower is more accurate +} etc_compressed; + +static +inline void take_best(etc_compressed* a, const etc_compressed* b) { + if (a->score > b->score) { + *a = *b; + } +} + +static +void etc_average_colors_subblock(const etc1_byte* pIn, etc1_uint32 inMask, + etc1_byte* pColors, bool flipped, bool second) { + int r = 0; + int g = 0; + int b = 0; + + if (flipped) { + int by = 0; + if (second) { + by = 2; + } + for (int y = 0; y < 2; y++) { + int yy = by + y; + for (int x = 0; x < 4; x++) { + int i = x + 4 * yy; + if (inMask & (1 << i)) { + const etc1_byte* p = pIn + i * 3; + r += *(p++); + g += *(p++); + b += *(p++); + } + } + } + } else { + int bx = 0; + if (second) { + bx = 2; + } + for (int y = 0; y < 4; y++) { + for (int x = 0; x < 2; x++) { + int xx = bx + x; + int i = xx + 4 * y; + if (inMask & (1 << i)) { + const etc1_byte* p = pIn + i * 3; + r += *(p++); + g += *(p++); + b += *(p++); + } + } + } + } + pColors[0] = (etc1_byte)((r + 4) >> 3); + pColors[1] = (etc1_byte)((g + 4) >> 3); + pColors[2] = (etc1_byte)((b + 4) >> 3); +} + +static +inline int square(int x) { + return x * x; +} + +static etc1_uint32 chooseModifier(const etc1_byte* pBaseColors, + const etc1_byte* pIn, etc1_uint32 *pLow, int bitIndex, + const int* pModifierTable) { + etc1_uint32 bestScore = ~0; + int bestIndex = 0; + int pixelR = pIn[0]; + int pixelG = pIn[1]; + int pixelB = pIn[2]; + int r = pBaseColors[0]; + int g = pBaseColors[1]; + int b = pBaseColors[2]; + for (int i = 0; i < 4; i++) { + int modifier = pModifierTable[i]; + int decodedG = clamp(g + modifier); + etc1_uint32 score = (etc1_uint32) (6 * square(decodedG - pixelG)); + if (score >= bestScore) { + continue; + } + int decodedR = clamp(r + modifier); + score += (etc1_uint32) (3 * square(decodedR - pixelR)); + if (score >= bestScore) { + continue; + } + int decodedB = clamp(b + modifier); + score += (etc1_uint32) square(decodedB - pixelB); + if (score < bestScore) { + bestScore = score; + bestIndex = i; + } + } + etc1_uint32 lowMask = (((bestIndex >> 1) << 16) | (bestIndex & 1)) + << bitIndex; + *pLow |= lowMask; + return bestScore; +} + +static +void etc_encode_subblock_helper(const etc1_byte* pIn, etc1_uint32 inMask, + etc_compressed* pCompressed, bool flipped, bool second, + const etc1_byte* pBaseColors, const int* pModifierTable) { + int score = pCompressed->score; + if (flipped) { + int by = 0; + if (second) { + by = 2; + } + for (int y = 0; y < 2; y++) { + int yy = by + y; + for (int x = 0; x < 4; x++) { + int i = x + 4 * yy; + if (inMask & (1 << i)) { + score += chooseModifier(pBaseColors, pIn + i * 3, + &pCompressed->low, yy + x * 4, pModifierTable); + } + } + } + } else { + int bx = 0; + if (second) { + bx = 2; + } + for (int y = 0; y < 4; y++) { + for (int x = 0; x < 2; x++) { + int xx = bx + x; + int i = xx + 4 * y; + if (inMask & (1 << i)) { + score += chooseModifier(pBaseColors, pIn + i * 3, + &pCompressed->low, y + xx * 4, pModifierTable); + } + } + } + } + pCompressed->score = score; +} + +static bool inRange4bitSigned(int color) { + return color >= -4 && color <= 3; +} + +static void etc_encodeBaseColors(etc1_byte* pBaseColors, + const etc1_byte* pColors, etc_compressed* pCompressed) { + int r1, g1, b1, r2, g2, b2; // 8 bit base colors for sub-blocks + bool differential; + { + int r51 = convert8To5(pColors[0]); + int g51 = convert8To5(pColors[1]); + int b51 = convert8To5(pColors[2]); + int r52 = convert8To5(pColors[3]); + int g52 = convert8To5(pColors[4]); + int b52 = convert8To5(pColors[5]); + + r1 = convert5To8(r51); + g1 = convert5To8(g51); + b1 = convert5To8(b51); + + int dr = r52 - r51; + int dg = g52 - g51; + int db = b52 - b51; + + differential = inRange4bitSigned(dr) && inRange4bitSigned(dg) + && inRange4bitSigned(db); + if (differential) { + r2 = convert5To8(r51 + dr); + g2 = convert5To8(g51 + dg); + b2 = convert5To8(b51 + db); + pCompressed->high |= (r51 << 27) | ((7 & dr) << 24) | (g51 << 19) + | ((7 & dg) << 16) | (b51 << 11) | ((7 & db) << 8) | 2; + } + } + + if (!differential) { + int r41 = convert8To4(pColors[0]); + int g41 = convert8To4(pColors[1]); + int b41 = convert8To4(pColors[2]); + int r42 = convert8To4(pColors[3]); + int g42 = convert8To4(pColors[4]); + int b42 = convert8To4(pColors[5]); + r1 = convert4To8(r41); + g1 = convert4To8(g41); + b1 = convert4To8(b41); + r2 = convert4To8(r42); + g2 = convert4To8(g42); + b2 = convert4To8(b42); + pCompressed->high |= (r41 << 28) | (r42 << 24) | (g41 << 20) | (g42 + << 16) | (b41 << 12) | (b42 << 8); + } + pBaseColors[0] = r1; + pBaseColors[1] = g1; + pBaseColors[2] = b1; + pBaseColors[3] = r2; + pBaseColors[4] = g2; + pBaseColors[5] = b2; +} + +static +void etc_encode_block_helper(const etc1_byte* pIn, etc1_uint32 inMask, + const etc1_byte* pColors, etc_compressed* pCompressed, bool flipped) { + pCompressed->score = ~0; + pCompressed->high = (flipped ? 1 : 0); + pCompressed->low = 0; + + etc1_byte pBaseColors[6]; + + etc_encodeBaseColors(pBaseColors, pColors, pCompressed); + + int originalHigh = pCompressed->high; + + const int* pModifierTable = kModifierTable; + for (int i = 0; i < 8; i++, pModifierTable += 4) { + etc_compressed temp; + temp.score = 0; + temp.high = originalHigh | (i << 5); + temp.low = 0; + etc_encode_subblock_helper(pIn, inMask, &temp, flipped, false, + pBaseColors, pModifierTable); + take_best(pCompressed, &temp); + } + pModifierTable = kModifierTable; + etc_compressed firstHalf = *pCompressed; + for (int i = 0; i < 8; i++, pModifierTable += 4) { + etc_compressed temp; + temp.score = firstHalf.score; + temp.high = firstHalf.high | (i << 2); + temp.low = firstHalf.low; + etc_encode_subblock_helper(pIn, inMask, &temp, flipped, true, + pBaseColors + 3, pModifierTable); + if (i == 0) { + *pCompressed = temp; + } else { + take_best(pCompressed, &temp); + } + } +} + +static void writeBigEndian(etc1_byte* pOut, etc1_uint32 d) { + pOut[0] = (etc1_byte)(d >> 24); + pOut[1] = (etc1_byte)(d >> 16); + pOut[2] = (etc1_byte)(d >> 8); + pOut[3] = (etc1_byte) d; +} + +// Input is a 4 x 4 square of 3-byte pixels in form R, G, B +// inmask is a 16-bit mask where bit (1 << (x + y * 4)) tells whether the corresponding (x,y) +// pixel is valid or not. Invalid pixel color values are ignored when compressing. +// Output is an ETC1 compressed version of the data. + +void etc1_encode_block(const etc1_byte* pIn, etc1_uint32 inMask, + etc1_byte* pOut) { + etc1_byte colors[6]; + etc1_byte flippedColors[6]; + etc_average_colors_subblock(pIn, inMask, colors, false, false); + etc_average_colors_subblock(pIn, inMask, colors + 3, false, true); + etc_average_colors_subblock(pIn, inMask, flippedColors, true, false); + etc_average_colors_subblock(pIn, inMask, flippedColors + 3, true, true); + + etc_compressed a, b; + etc_encode_block_helper(pIn, inMask, colors, &a, false); + etc_encode_block_helper(pIn, inMask, flippedColors, &b, true); + take_best(&a, &b); + writeBigEndian(pOut, a.high); + writeBigEndian(pOut + 4, a.low); +} + +// Return the size of the encoded image data (does not include size of PKM header). + +etc1_uint32 etc1_get_encoded_data_size(etc1_uint32 width, etc1_uint32 height) { + return (((width + 3) & ~3) * ((height + 3) & ~3)) >> 1; +} + +// Encode an entire image. +// pIn - pointer to the image data. Formatted such that the Red component of +// pixel (x,y) is at pIn + pixelSize * x + stride * y + redOffset; +// pOut - pointer to encoded data. Must be large enough to store entire encoded image. + +int etc1_encode_image(const etc1_byte* pIn, etc1_uint32 width, etc1_uint32 height, + etc1_uint32 pixelSize, etc1_uint32 stride, etc1_byte* pOut) { + if (pixelSize < 2 || pixelSize > 3) { + return -1; + } + static const unsigned short kYMask[] = { 0x0, 0xf, 0xff, 0xfff, 0xffff }; + static const unsigned short kXMask[] = { 0x0, 0x1111, 0x3333, 0x7777, + 0xffff }; + etc1_byte block[ETC1_DECODED_BLOCK_SIZE]; + etc1_byte encoded[ETC1_ENCODED_BLOCK_SIZE]; + + etc1_uint32 encodedWidth = (width + 3) & ~3; + etc1_uint32 encodedHeight = (height + 3) & ~3; + + for (etc1_uint32 y = 0; y < encodedHeight; y += 4) { + etc1_uint32 yEnd = height - y; + if (yEnd > 4) { + yEnd = 4; + } + int ymask = kYMask[yEnd]; + for (etc1_uint32 x = 0; x < encodedWidth; x += 4) { + etc1_uint32 xEnd = width - x; + if (xEnd > 4) { + xEnd = 4; + } + int mask = ymask & kXMask[xEnd]; + for (etc1_uint32 cy = 0; cy < yEnd; cy++) { + etc1_byte* q = block + (cy * 4) * 3; + const etc1_byte* p = pIn + pixelSize * x + stride * (y + cy); + if (pixelSize == 3) { + memcpy(q, p, xEnd * 3); + } else { + for (etc1_uint32 cx = 0; cx < xEnd; cx++) { + int pixel = (p[1] << 8) | p[0]; + *q++ = convert5To8(pixel >> 11); + *q++ = convert6To8(pixel >> 5); + *q++ = convert5To8(pixel); + p += pixelSize; + } + } + } + etc1_encode_block(block, mask, encoded); + memcpy(pOut, encoded, sizeof(encoded)); + pOut += sizeof(encoded); + } + } + return 0; +} + +// Decode an entire image. +// pIn - pointer to encoded data. +// pOut - pointer to the image data. Will be written such that the Red component of +// pixel (x,y) is at pIn + pixelSize * x + stride * y + redOffset. Must be +// large enough to store entire image. + + +int etc1_decode_image(const etc1_byte* pIn, etc1_byte* pOut, + etc1_uint32 width, etc1_uint32 height, + etc1_uint32 pixelSize, etc1_uint32 stride) { + if (pixelSize < 2 || pixelSize > 3) { + return -1; + } + etc1_byte block[ETC1_DECODED_BLOCK_SIZE]; + + etc1_uint32 encodedWidth = (width + 3) & ~3; + etc1_uint32 encodedHeight = (height + 3) & ~3; + + for (etc1_uint32 y = 0; y < encodedHeight; y += 4) { + etc1_uint32 yEnd = height - y; + if (yEnd > 4) { + yEnd = 4; + } + for (etc1_uint32 x = 0; x < encodedWidth; x += 4) { + etc1_uint32 xEnd = width - x; + if (xEnd > 4) { + xEnd = 4; + } + etc1_decode_block(pIn, block); + pIn += ETC1_ENCODED_BLOCK_SIZE; + for (etc1_uint32 cy = 0; cy < yEnd; cy++) { + const etc1_byte* q = block + (cy * 4) * 3; + etc1_byte* p = pOut + pixelSize * x + stride * (y + cy); + if (pixelSize == 3) { + memcpy(p, q, xEnd * 3); + } else { + for (etc1_uint32 cx = 0; cx < xEnd; cx++) { + etc1_byte r = *q++; + etc1_byte g = *q++; + etc1_byte b = *q++; + etc1_uint32 pixel = ((r >> 3) << 11) | ((g >> 2) << 5) | (b >> 3); + *p++ = (etc1_byte) pixel; + *p++ = (etc1_byte) (pixel >> 8); + } + } + } + } + } + return 0; +} + +static const char kMagic[] = { 'P', 'K', 'M', ' ', '1', '0' }; + +static const etc1_uint32 ETC1_PKM_FORMAT_OFFSET = 6; +static const etc1_uint32 ETC1_PKM_ENCODED_WIDTH_OFFSET = 8; +static const etc1_uint32 ETC1_PKM_ENCODED_HEIGHT_OFFSET = 10; +static const etc1_uint32 ETC1_PKM_WIDTH_OFFSET = 12; +static const etc1_uint32 ETC1_PKM_HEIGHT_OFFSET = 14; + +static const etc1_uint32 ETC1_RGB_NO_MIPMAPS = 0; + +static void writeBEUint16(etc1_byte* pOut, etc1_uint32 data) { + pOut[0] = (etc1_byte) (data >> 8); + pOut[1] = (etc1_byte) data; +} + +static etc1_uint32 readBEUint16(const etc1_byte* pIn) { + return (pIn[0] << 8) | pIn[1]; +} + +// Format a PKM header + +void etc1_pkm_format_header(etc1_byte* pHeader, etc1_uint32 width, etc1_uint32 height) { + memcpy(pHeader, kMagic, sizeof(kMagic)); + etc1_uint32 encodedWidth = (width + 3) & ~3; + etc1_uint32 encodedHeight = (height + 3) & ~3; + writeBEUint16(pHeader + ETC1_PKM_FORMAT_OFFSET, ETC1_RGB_NO_MIPMAPS); + writeBEUint16(pHeader + ETC1_PKM_ENCODED_WIDTH_OFFSET, encodedWidth); + writeBEUint16(pHeader + ETC1_PKM_ENCODED_HEIGHT_OFFSET, encodedHeight); + writeBEUint16(pHeader + ETC1_PKM_WIDTH_OFFSET, width); + writeBEUint16(pHeader + ETC1_PKM_HEIGHT_OFFSET, height); +} + +// Check if a PKM header is correctly formatted. + +etc1_bool etc1_pkm_is_valid(const etc1_byte* pHeader) { + if (memcmp(pHeader, kMagic, sizeof(kMagic))) { + return false; + } + etc1_uint32 format = readBEUint16(pHeader + ETC1_PKM_FORMAT_OFFSET); + etc1_uint32 encodedWidth = readBEUint16(pHeader + ETC1_PKM_ENCODED_WIDTH_OFFSET); + etc1_uint32 encodedHeight = readBEUint16(pHeader + ETC1_PKM_ENCODED_HEIGHT_OFFSET); + etc1_uint32 width = readBEUint16(pHeader + ETC1_PKM_WIDTH_OFFSET); + etc1_uint32 height = readBEUint16(pHeader + ETC1_PKM_HEIGHT_OFFSET); + return format == ETC1_RGB_NO_MIPMAPS && + encodedWidth >= width && encodedWidth - width < 4 && + encodedHeight >= height && encodedHeight - height < 4; +} + +// Read the image width from a PKM header + +etc1_uint32 etc1_pkm_get_width(const etc1_byte* pHeader) { + return readBEUint16(pHeader + ETC1_PKM_WIDTH_OFFSET); +} + +// Read the image height from a PKM header + +etc1_uint32 etc1_pkm_get_height(const etc1_byte* pHeader){ + return readBEUint16(pHeader + ETC1_PKM_HEIGHT_OFFSET); +} diff --git a/cocos/base/etc1/etc1.h b/cocos/base/etc1/etc1.h new file mode 100644 index 0000000000..0d389052b7 --- /dev/null +++ b/cocos/base/etc1/etc1.h @@ -0,0 +1,106 @@ +// Copyright 2009 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef __etc1_h__ +#define __etc1_h__ + +#define ETC1_ENCODED_BLOCK_SIZE 8 +#define ETC1_DECODED_BLOCK_SIZE 48 + +#ifndef ETC1_RGB8_OES +#define ETC1_RGB8_OES 0x8D64 +#endif + +typedef unsigned char etc1_byte; +typedef int etc1_bool; +typedef unsigned int etc1_uint32; + +#ifdef __cplusplus +extern "C" { +#endif + +// Encode a block of pixels. +// +// pIn is a pointer to a ETC_DECODED_BLOCK_SIZE array of bytes that represent a +// 4 x 4 square of 3-byte pixels in form R, G, B. Byte (3 * (x + 4 * y) is the R +// value of pixel (x, y). +// +// validPixelMask is a 16-bit mask where bit (1 << (x + y * 4)) indicates whether +// the corresponding (x,y) pixel is valid. Invalid pixel color values are ignored when compressing. +// +// pOut is an ETC1 compressed version of the data. + +void etc1_encode_block(const etc1_byte* pIn, etc1_uint32 validPixelMask, etc1_byte* pOut); + +// Decode a block of pixels. +// +// pIn is an ETC1 compressed version of the data. +// +// pOut is a pointer to a ETC_DECODED_BLOCK_SIZE array of bytes that represent a +// 4 x 4 square of 3-byte pixels in form R, G, B. Byte (3 * (x + 4 * y) is the R +// value of pixel (x, y). + +void etc1_decode_block(const etc1_byte* pIn, etc1_byte* pOut); + +// Return the size of the encoded image data (does not include size of PKM header). + +etc1_uint32 etc1_get_encoded_data_size(etc1_uint32 width, etc1_uint32 height); + +// Encode an entire image. +// pIn - pointer to the image data. Formatted such that +// pixel (x,y) is at pIn + pixelSize * x + stride * y; +// pOut - pointer to encoded data. Must be large enough to store entire encoded image. +// pixelSize can be 2 or 3. 2 is an GL_UNSIGNED_SHORT_5_6_5 image, 3 is a GL_BYTE RGB image. +// returns non-zero if there is an error. + +int etc1_encode_image(const etc1_byte* pIn, etc1_uint32 width, etc1_uint32 height, + etc1_uint32 pixelSize, etc1_uint32 stride, etc1_byte* pOut); + +// Decode an entire image. +// pIn - pointer to encoded data. +// pOut - pointer to the image data. Will be written such that +// pixel (x,y) is at pIn + pixelSize * x + stride * y. Must be +// large enough to store entire image. +// pixelSize can be 2 or 3. 2 is an GL_UNSIGNED_SHORT_5_6_5 image, 3 is a GL_BYTE RGB image. +// returns non-zero if there is an error. + +int etc1_decode_image(const etc1_byte* pIn, etc1_byte* pOut, + etc1_uint32 width, etc1_uint32 height, + etc1_uint32 pixelSize, etc1_uint32 stride); + +// Size of a PKM header, in bytes. + +#define ETC_PKM_HEADER_SIZE 16 + +// Format a PKM header + +void etc1_pkm_format_header(etc1_byte* pHeader, etc1_uint32 width, etc1_uint32 height); + +// Check if a PKM header is correctly formatted. + +etc1_bool etc1_pkm_is_valid(const etc1_byte* pHeader); + +// Read the image width from a PKM header + +etc1_uint32 etc1_pkm_get_width(const etc1_byte* pHeader); + +// Read the image height from a PKM header + +etc1_uint32 etc1_pkm_get_height(const etc1_byte* pHeader); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/cocos/base/s3tc/s3tc.cpp b/cocos/base/s3tc/s3tc.cpp new file mode 100644 index 0000000000..e7869df631 --- /dev/null +++ b/cocos/base/s3tc/s3tc.cpp @@ -0,0 +1,182 @@ +/**************************************************************************** + Copyright (c) 2013 cocos2d-x.org + + 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 "s3tc.h" + +//Decode S3TC encode block to 4x4 RGB32 pixels +static void s3tc_decode_block(uint8_t **blockData, + uint32_t *decodeBlockData, + unsigned int stride, + bool oneBitAlphaFlag, + uint64_t alpha, + S3TCDecodeFlag decodeFlag) +{ + unsigned int colorValue0 = 0 , colorValue1 = 0, initAlpha = (!oneBitAlphaFlag * 255u) << 24; + unsigned int rb0 = 0, rb1 = 0, rb2 = 0, rb3 = 0, g0 = 0, g1 = 0, g2 = 0, g3 = 0; + + uint32_t colors[4], pixelsIndex = 0; + + /* load the two color values*/ + memcpy((void *)&colorValue0, *blockData, 2); + (*blockData) += 2; + + memcpy((void *)&colorValue1, *blockData, 2); + (*blockData) += 2; + + /* the channel is r5g6b5 , 16 bits */ + rb0 = (colorValue0 << 19 | colorValue0 >> 8) & 0xf800f8; + rb1 = (colorValue1 << 19 | colorValue1 >> 8) & 0xf800f8; + g0 = (colorValue0 << 5) & 0x00fc00; + g1 = (colorValue1 << 5) & 0x00fc00; + g0 += (g0 >> 6) & 0x000300; + g1 += (g1 >> 6) & 0x000300; + + colors[0] = rb0 + g0 + initAlpha; + colors[1] = rb1 + g1 + initAlpha; + + /* interpolate the other two color values */ + if (colorValue0 > colorValue1 || oneBitAlphaFlag) + { + rb2 = (((2*rb0 + rb1) * 21) >> 6) & 0xff00ff; + rb3 = (((2*rb1 + rb0) * 21) >> 6) & 0xff00ff; + g2 = (((2*g0 + g1 ) * 21) >> 6) & 0x00ff00; + g3 = (((2*g1 + g0 ) * 21) >> 6) & 0x00ff00; + colors[3] = rb3 + g3 + initAlpha; + } + else + { + rb2 = ((rb0+rb1) >> 1) & 0xff00ff; + g2 = ((g0 +g1 ) >> 1) & 0x00ff00; + colors[3] = 0 ; + } + colors[2] = rb2 + g2 + initAlpha; + + /*read the pixelsIndex , 2bits per pixel, 4 bytes */ + memcpy((void*)&pixelsIndex, *blockData, 4); + (*blockData) += 4; + + if (S3TCDecodeFlag::DXT5 == decodeFlag) + { + //dxt5 use interpolate alpha + // 8-Alpha block: derive the other six alphas. + // Bit code 000 = alpha0, 001 = alpha1, other are interpolated. + + unsigned int alphaArray[8]; + + alphaArray[0] = (alpha ) & 0xff ; + alphaArray[1] = (alpha >> 8) & 0xff ; + + if (alphaArray[0] >= alphaArray[1]) + { + alphaArray[2] = (alphaArray[0]*6 + alphaArray[1]*1) / 7; + alphaArray[3] = (alphaArray[0]*5 + alphaArray[1]*2) / 7; + alphaArray[4] = (alphaArray[0]*4 + alphaArray[1]*3) / 7; + alphaArray[5] = (alphaArray[0]*3 + alphaArray[1]*4) / 7; + alphaArray[6] = (alphaArray[0]*2 + alphaArray[1]*5) / 7; + alphaArray[7] = (alphaArray[0]*1 + alphaArray[1]*6) / 7; + } + else if (alphaArray[0] < alphaArray[1]) + { + alphaArray[2] = (alphaArray[0]*4 + alphaArray[1]*1) / 5; + alphaArray[3] = (alphaArray[0]*3 + alphaArray[1]*2) / 5; + alphaArray[4] = (alphaArray[0]*2 + alphaArray[1]*3) / 5; + alphaArray[5] = (alphaArray[0]*1 + alphaArray[1]*4) / 5; + alphaArray[6] = 0; + alphaArray[7] = 255; + } + + // read the flowing 48bit indices (16*3) + alpha >>= 16; + + for (int y = 0; y < 4; ++y) + { + for (int x = 0; x < 4; ++x) + { + decodeBlockData[x] = (alphaArray[alpha & 5] << 24) + colors[pixelsIndex & 3]; + pixelsIndex >>= 2; + alpha >>= 3; + } + decodeBlockData += stride; + } + } //if (dxt5 == comFlag) + else + { //dxt1 dxt3 use explicit alpha + for (int y = 0; y < 4; ++y) + { + for (int x = 0; x < 4; ++x) + { + initAlpha = (alpha & 0x0f) << 28; + initAlpha += initAlpha >> 4; + decodeBlockData[x] = initAlpha + colors[pixelsIndex & 3]; + pixelsIndex >>= 2; + alpha >>= 4; + } + decodeBlockData += stride; + } + } +} + +//Decode S3TC encode data to RGB32 +void s3tc_decode(uint8_t *encodeData, //in_data + uint8_t *decodeData, //out_data + const int pixelsWidth, + const int pixelsHeight, + S3TCDecodeFlag decodeFlag) +{ + uint32_t *decodeBlockData = (uint32_t *)decodeData; + for (int block_y = 0; block_y < pixelsHeight / 4; ++block_y, decodeBlockData += 3 * pixelsWidth) //stride = 3*width + { + for(int block_x = 0; block_x < pixelsWidth / 4; ++block_x, decodeBlockData += 4) //skip 4 pixels + { + uint64_t blockAlpha = 0; + + switch (decodeFlag) + { + case S3TCDecodeFlag::DXT1: + { + s3tc_decode_block(&encodeData, decodeBlockData, pixelsWidth, 0, 0LL, S3TCDecodeFlag::DXT1); + } + break; + case S3TCDecodeFlag::DXT3: + { + memcpy((void *)&blockAlpha, encodeData, 8); + encodeData += 8; + s3tc_decode_block(&encodeData, decodeBlockData, pixelsWidth, 1, blockAlpha, S3TCDecodeFlag::DXT3); + } + break; + case S3TCDecodeFlag::DXT5: + { + memcpy((void *)&blockAlpha, encodeData, 8); + encodeData += 8; + s3tc_decode_block(&encodeData, decodeBlockData, pixelsWidth, 1, blockAlpha, S3TCDecodeFlag::DXT5); + } + break; + default: + break; + }//switch + }//for block_x + }//for block_y +} + + diff --git a/cocos/base/s3tc/s3tc.h b/cocos/base/s3tc/s3tc.h new file mode 100644 index 0000000000..a3cf233257 --- /dev/null +++ b/cocos/base/s3tc/s3tc.h @@ -0,0 +1,48 @@ +/**************************************************************************** + Copyright (c) 2013 cocos2d-x.org + + 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 COCOS2DX_PLATFORM_THIRDPARTY_S3TC_ +#define COCOS2DX_PLATFORM_THIRDPARTY_S3TC_ + +#include "CCStdC.h" + +enum class S3TCDecodeFlag +{ + DXT1 = 1, + DXT3 = 3, + DXT5 = 5, +}; + +//Decode S3TC encode data to RGB32 + void s3tc_decode(uint8_t *encode_data, + uint8_t *decode_data, + const int pixelsWidth, + const int pixelsHeight, + S3TCDecodeFlag decodeFlag + ); + + +#endif /* defined(COCOS2DX_PLATFORM_THIRDPARTY_S3TC_) */ + diff --git a/external/tinyxml2/tinyxml2.cpp b/external/tinyxml2/tinyxml2.cpp new file mode 100644 index 0000000000..f181b9050c --- /dev/null +++ b/external/tinyxml2/tinyxml2.cpp @@ -0,0 +1,2101 @@ +/* +Original code by Lee Thomason (www.grinninglizard.com) + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any +damages arising from the use of this software. + +Permission is granted to anyone to use this software for any +purpose, including commercial applications, and to alter it and +redistribute it freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must +not claim that you wrote the original software. If you use this +software in a product, an acknowledgment in the product documentation +would be appreciated but is not required. + +2. Altered source versions must be plainly marked as such, and +must not be misrepresented as being the original software. + +3. This notice may not be removed or altered from any source +distribution. +*/ + +#include "tinyxml2.h" + +#include // yes, this one new style header, is in the Android SDK. +# if defined(ANDROID_NDK) || (CC_TARGET_PLATFORM == CC_PLATFORM_BLACKBERRY) +# include +#else +# include +#endif + +static const char LINE_FEED = (char)0x0a; // all line endings are normalized to LF +static const char LF = LINE_FEED; +static const char CARRIAGE_RETURN = (char)0x0d; // CR gets filtered out +static const char CR = CARRIAGE_RETURN; +static const char SINGLE_QUOTE = '\''; +static const char DOUBLE_QUOTE = '\"'; + +// Bunch of unicode info at: +// http://www.unicode.org/faq/utf_bom.html +// ef bb bf (Microsoft "lead bytes") - designates UTF-8 + +static const unsigned char TIXML_UTF_LEAD_0 = 0xefU; +static const unsigned char TIXML_UTF_LEAD_1 = 0xbbU; +static const unsigned char TIXML_UTF_LEAD_2 = 0xbfU; + + +#define DELETE_NODE( node ) { \ + if ( node ) { \ + MemPool* pool = node->_memPool; \ + node->~XMLNode(); \ + pool->Free( node ); \ + } \ + } +#define DELETE_ATTRIBUTE( attrib ) { \ + if ( attrib ) { \ + MemPool* pool = attrib->_memPool; \ + attrib->~XMLAttribute(); \ + pool->Free( attrib ); \ + } \ + } + +namespace tinyxml2 +{ + +struct Entity { + const char* pattern; + int length; + char value; +}; + +static const int NUM_ENTITIES = 5; +static const Entity entities[NUM_ENTITIES] = { + { "quot", 4, DOUBLE_QUOTE }, + { "amp", 3, '&' }, + { "apos", 4, SINGLE_QUOTE }, + { "lt", 2, '<' }, + { "gt", 2, '>' } +}; + + +StrPair::~StrPair() +{ + Reset(); +} + + +void StrPair::Reset() +{ + if ( _flags & NEEDS_DELETE ) { + delete [] _start; + } + _flags = 0; + _start = 0; + _end = 0; +} + + +void StrPair::SetStr( const char* str, int flags ) +{ + Reset(); + size_t len = strlen( str ); + _start = new char[ len+1 ]; + memcpy( _start, str, len+1 ); + _end = _start + len; + _flags = flags | NEEDS_DELETE; +} + + +char* StrPair::ParseText( char* p, const char* endTag, int strFlags ) +{ + TIXMLASSERT( endTag && *endTag ); + + char* start = p; // fixme: hides a member + char endChar = *endTag; + size_t length = strlen( endTag ); + + // Inner loop of text parsing. + while ( *p ) { + if ( *p == endChar && strncmp( p, endTag, length ) == 0 ) { + Set( start, p, strFlags ); + return p + length; + } + ++p; + } + return 0; +} + + +char* StrPair::ParseName( char* p ) +{ + char* start = p; + + if ( !start || !(*start) ) { + return 0; + } + + while( *p && ( + XMLUtil::IsAlphaNum( (unsigned char) *p ) + || *p == '_' + || *p == ':' + || (*p == '-' && p>start ) // can be in a name, but not lead it. + || (*p == '.' && p>start ) )) { // can be in a name, but not lead it. + ++p; + } + + if ( p > start ) { + Set( start, p, 0 ); + return p; + } + return 0; +} + + +void StrPair::CollapseWhitespace() +{ + // Trim leading space. + _start = XMLUtil::SkipWhiteSpace( _start ); + + if ( _start && *_start ) { + char* p = _start; // the read pointer + char* q = _start; // the write pointer + + while( *p ) { + if ( XMLUtil::IsWhiteSpace( *p )) { + p = XMLUtil::SkipWhiteSpace( p ); + if ( *p == 0 ) { + break; // don't write to q; this trims the trailing space. + } + *q = ' '; + ++q; + } + *q = *p; + ++q; + ++p; + } + *q = 0; + } +} + + +const char* StrPair::GetStr() +{ + if ( _flags & NEEDS_FLUSH ) { + *_end = 0; + _flags ^= NEEDS_FLUSH; + + if ( _flags ) { + char* p = _start; // the read pointer + char* q = _start; // the write pointer + + while( p < _end ) { + if ( (_flags & NEEDS_NEWLINE_NORMALIZATION) && *p == CR ) { + // CR-LF pair becomes LF + // CR alone becomes LF + // LF-CR becomes LF + if ( *(p+1) == LF ) { + p += 2; + } + else { + ++p; + } + *q++ = LF; + } + else if ( (_flags & NEEDS_NEWLINE_NORMALIZATION) && *p == LF ) { + if ( *(p+1) == CR ) { + p += 2; + } + else { + ++p; + } + *q++ = LF; + } + else if ( (_flags & NEEDS_ENTITY_PROCESSING) && *p == '&' ) { + // Entities handled by tinyXML2: + // - special entities in the entity table [in/out] + // - numeric character reference [in] + // 中 or 中 + + if ( *(p+1) == '#' ) { + char buf[10] = { 0 }; + int len; + p = const_cast( XMLUtil::GetCharacterRef( p, buf, &len ) ); + for( int i=0; i(p); + // Check for BOM: + if ( *(pu+0) == TIXML_UTF_LEAD_0 + && *(pu+1) == TIXML_UTF_LEAD_1 + && *(pu+2) == TIXML_UTF_LEAD_2 ) { + *bom = true; + p += 3; + } + return p; +} + + +void XMLUtil::ConvertUTF32ToUTF8( unsigned long input, char* output, int* length ) +{ + const unsigned long BYTE_MASK = 0xBF; + const unsigned long BYTE_MARK = 0x80; + const unsigned long FIRST_BYTE_MARK[7] = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC }; + + if (input < 0x80) { + *length = 1; + } + else if ( input < 0x800 ) { + *length = 2; + } + else if ( input < 0x10000 ) { + *length = 3; + } + else if ( input < 0x200000 ) { + *length = 4; + } + else { + *length = 0; // This code won't covert this correctly anyway. + return; + } + + output += *length; + + // Scary scary fall throughs. + switch (*length) { + case 4: + --output; + *output = (char)((input | BYTE_MARK) & BYTE_MASK); + input >>= 6; + case 3: + --output; + *output = (char)((input | BYTE_MARK) & BYTE_MASK); + input >>= 6; + case 2: + --output; + *output = (char)((input | BYTE_MARK) & BYTE_MASK); + input >>= 6; + case 1: + --output; + *output = (char)(input | FIRST_BYTE_MARK[*length]); + default: + break; + } +} + + +const char* XMLUtil::GetCharacterRef( const char* p, char* value, int* length ) +{ + // Presume an entity, and pull it out. + *length = 0; + + if ( *(p+1) == '#' && *(p+2) ) { + unsigned long ucs = 0; + ptrdiff_t delta = 0; + unsigned mult = 1; + + if ( *(p+2) == 'x' ) { + // Hexadecimal. + if ( !*(p+3) ) { + return 0; + } + + const char* q = p+3; + q = strchr( q, ';' ); + + if ( !q || !*q ) { + return 0; + } + + delta = q-p; + --q; + + while ( *q != 'x' ) { + if ( *q >= '0' && *q <= '9' ) { + ucs += mult * (*q - '0'); + } + else if ( *q >= 'a' && *q <= 'f' ) { + ucs += mult * (*q - 'a' + 10); + } + else if ( *q >= 'A' && *q <= 'F' ) { + ucs += mult * (*q - 'A' + 10 ); + } + else { + return 0; + } + mult *= 16; + --q; + } + } + else { + // Decimal. + if ( !*(p+2) ) { + return 0; + } + + const char* q = p+2; + q = strchr( q, ';' ); + + if ( !q || !*q ) { + return 0; + } + + delta = q-p; + --q; + + while ( *q != '#' ) { + if ( *q >= '0' && *q <= '9' ) { + ucs += mult * (*q - '0'); + } + else { + return 0; + } + mult *= 10; + --q; + } + } + // convert the UCS to UTF-8 + ConvertUTF32ToUTF8( ucs, value, length ); + return p + delta + 1; + } + return p+1; +} + + +void XMLUtil::ToStr( int v, char* buffer, int bufferSize ) +{ + TIXML_SNPRINTF( buffer, bufferSize, "%d", v ); +} + + +void XMLUtil::ToStr( unsigned v, char* buffer, int bufferSize ) +{ + TIXML_SNPRINTF( buffer, bufferSize, "%u", v ); +} + + +void XMLUtil::ToStr( bool v, char* buffer, int bufferSize ) +{ + TIXML_SNPRINTF( buffer, bufferSize, "%d", v ? 1 : 0 ); +} + + +void XMLUtil::ToStr( float v, char* buffer, int bufferSize ) +{ + TIXML_SNPRINTF( buffer, bufferSize, "%g", v ); +} + + +void XMLUtil::ToStr( double v, char* buffer, int bufferSize ) +{ + TIXML_SNPRINTF( buffer, bufferSize, "%g", v ); +} + + +bool XMLUtil::ToInt( const char* str, int* value ) +{ + if ( TIXML_SSCANF( str, "%d", value ) == 1 ) { + return true; + } + return false; +} + +bool XMLUtil::ToUnsigned( const char* str, unsigned *value ) +{ + if ( TIXML_SSCANF( str, "%u", value ) == 1 ) { + return true; + } + return false; +} + +bool XMLUtil::ToBool( const char* str, bool* value ) +{ + int ival = 0; + if ( ToInt( str, &ival )) { + *value = (ival==0) ? false : true; + return true; + } + if ( StringEqual( str, "true" ) ) { + *value = true; + return true; + } + else if ( StringEqual( str, "false" ) ) { + *value = false; + return true; + } + return false; +} + + +bool XMLUtil::ToFloat( const char* str, float* value ) +{ + if ( TIXML_SSCANF( str, "%f", value ) == 1 ) { + return true; + } + return false; +} + +bool XMLUtil::ToDouble( const char* str, double* value ) +{ + if ( TIXML_SSCANF( str, "%lf", value ) == 1 ) { + return true; + } + return false; +} + + +char* XMLDocument::Identify( char* p, XMLNode** node ) +{ + XMLNode* returnNode = 0; + char* start = p; + p = XMLUtil::SkipWhiteSpace( p ); + if( !p || !*p ) { + return p; + } + + // What is this thing? + // - Elements start with a letter or underscore, but xml is reserved. + // - Comments: + // + // With a special case: + // + // + // + // + // Where the closing element (/foo) *must* be the next thing after the opening + // element, and the names must match. BUT the tricky bit is that the closing + // element will be read by the child. + // + // 'endTag' is the end tag for this node, it is returned by a call to a child. + // 'parentEnd' is the end tag for the parent, which is filled in and returned. + + while( p && *p ) { + XMLNode* node = 0; + + p = _document->Identify( p, &node ); + if ( p == 0 || node == 0 ) { + break; + } + + StrPair endTag; + p = node->ParseDeep( p, &endTag ); + if ( !p ) { + DELETE_NODE( node ); + node = 0; + if ( !_document->Error() ) { + _document->SetError( XML_ERROR_PARSING, 0, 0 ); + } + break; + } + + // We read the end tag. Return it to the parent. + if ( node->ToElement() && node->ToElement()->ClosingType() == XMLElement::CLOSING ) { + if ( parentEnd ) { + *parentEnd = static_cast(node)->_value; + } + node->_memPool->SetTracked(); // created and then immediately deleted. + DELETE_NODE( node ); + return p; + } + + // Handle an end tag returned to this level. + // And handle a bunch of annoying errors. + XMLElement* ele = node->ToElement(); + if ( ele ) { + if ( endTag.Empty() && ele->ClosingType() == XMLElement::OPEN ) { + _document->SetError( XML_ERROR_MISMATCHED_ELEMENT, node->Value(), 0 ); + p = 0; + } + else if ( !endTag.Empty() && ele->ClosingType() != XMLElement::OPEN ) { + _document->SetError( XML_ERROR_MISMATCHED_ELEMENT, node->Value(), 0 ); + p = 0; + } + else if ( !endTag.Empty() ) { + if ( !XMLUtil::StringEqual( endTag.GetStr(), node->Value() )) { + _document->SetError( XML_ERROR_MISMATCHED_ELEMENT, node->Value(), 0 ); + p = 0; + } + } + } + if ( p == 0 ) { + DELETE_NODE( node ); + node = 0; + } + if ( node ) { + this->InsertEndChild( node ); + } + } + return 0; +} + +// --------- XMLText ---------- // +char* XMLText::ParseDeep( char* p, StrPair* ) +{ + const char* start = p; + if ( this->CData() ) { + p = _value.ParseText( p, "]]>", StrPair::NEEDS_NEWLINE_NORMALIZATION ); + if ( !p ) { + _document->SetError( XML_ERROR_PARSING_CDATA, start, 0 ); + } + return p; + } + else { + int flags = _document->ProcessEntities() ? StrPair::TEXT_ELEMENT : StrPair::TEXT_ELEMENT_LEAVE_ENTITIES; + if ( _document->WhitespaceMode() == COLLAPSE_WHITESPACE ) { + flags |= StrPair::COLLAPSE_WHITESPACE; + } + + p = _value.ParseText( p, "<", flags ); + if ( !p ) { + _document->SetError( XML_ERROR_PARSING_TEXT, start, 0 ); + } + if ( p && *p ) { + return p-1; + } + } + return 0; +} + + +XMLNode* XMLText::ShallowClone( XMLDocument* doc ) const +{ + if ( !doc ) { + doc = _document; + } + XMLText* text = doc->NewText( Value() ); // fixme: this will always allocate memory. Intern? + text->SetCData( this->CData() ); + return text; +} + + +bool XMLText::ShallowEqual( const XMLNode* compare ) const +{ + return ( compare->ToText() && XMLUtil::StringEqual( compare->ToText()->Value(), Value() )); +} + + +bool XMLText::Accept( XMLVisitor* visitor ) const +{ + return visitor->Visit( *this ); +} + + +// --------- XMLComment ---------- // + +XMLComment::XMLComment( XMLDocument* doc ) : XMLNode( doc ) +{ +} + + +XMLComment::~XMLComment() +{ +} + + +char* XMLComment::ParseDeep( char* p, StrPair* ) +{ + // Comment parses as text. + const char* start = p; + p = _value.ParseText( p, "-->", StrPair::COMMENT ); + if ( p == 0 ) { + _document->SetError( XML_ERROR_PARSING_COMMENT, start, 0 ); + } + return p; +} + + +XMLNode* XMLComment::ShallowClone( XMLDocument* doc ) const +{ + if ( !doc ) { + doc = _document; + } + XMLComment* comment = doc->NewComment( Value() ); // fixme: this will always allocate memory. Intern? + return comment; +} + + +bool XMLComment::ShallowEqual( const XMLNode* compare ) const +{ + return ( compare->ToComment() && XMLUtil::StringEqual( compare->ToComment()->Value(), Value() )); +} + + +bool XMLComment::Accept( XMLVisitor* visitor ) const +{ + return visitor->Visit( *this ); +} + + +// --------- XMLDeclaration ---------- // + +XMLDeclaration::XMLDeclaration( XMLDocument* doc ) : XMLNode( doc ) +{ +} + + +XMLDeclaration::~XMLDeclaration() +{ + //printf( "~XMLDeclaration\n" ); +} + + +char* XMLDeclaration::ParseDeep( char* p, StrPair* ) +{ + // Declaration parses as text. + const char* start = p; + p = _value.ParseText( p, "?>", StrPair::NEEDS_NEWLINE_NORMALIZATION ); + if ( p == 0 ) { + _document->SetError( XML_ERROR_PARSING_DECLARATION, start, 0 ); + } + return p; +} + + +XMLNode* XMLDeclaration::ShallowClone( XMLDocument* doc ) const +{ + if ( !doc ) { + doc = _document; + } + XMLDeclaration* dec = doc->NewDeclaration( Value() ); // fixme: this will always allocate memory. Intern? + return dec; +} + + +bool XMLDeclaration::ShallowEqual( const XMLNode* compare ) const +{ + return ( compare->ToDeclaration() && XMLUtil::StringEqual( compare->ToDeclaration()->Value(), Value() )); +} + + + +bool XMLDeclaration::Accept( XMLVisitor* visitor ) const +{ + return visitor->Visit( *this ); +} + +// --------- XMLUnknown ---------- // + +XMLUnknown::XMLUnknown( XMLDocument* doc ) : XMLNode( doc ) +{ +} + + +XMLUnknown::~XMLUnknown() +{ +} + + +char* XMLUnknown::ParseDeep( char* p, StrPair* ) +{ + // Unknown parses as text. + const char* start = p; + + p = _value.ParseText( p, ">", StrPair::NEEDS_NEWLINE_NORMALIZATION ); + if ( !p ) { + _document->SetError( XML_ERROR_PARSING_UNKNOWN, start, 0 ); + } + return p; +} + + +XMLNode* XMLUnknown::ShallowClone( XMLDocument* doc ) const +{ + if ( !doc ) { + doc = _document; + } + XMLUnknown* text = doc->NewUnknown( Value() ); // fixme: this will always allocate memory. Intern? + return text; +} + + +bool XMLUnknown::ShallowEqual( const XMLNode* compare ) const +{ + return ( compare->ToUnknown() && XMLUtil::StringEqual( compare->ToUnknown()->Value(), Value() )); +} + + +bool XMLUnknown::Accept( XMLVisitor* visitor ) const +{ + return visitor->Visit( *this ); +} + +// --------- XMLAttribute ---------- // +char* XMLAttribute::ParseDeep( char* p, bool processEntities ) +{ + // Parse using the name rules: bug fix, was using ParseText before + p = _name.ParseName( p ); + if ( !p || !*p ) { + return 0; + } + + // Skip white space before = + p = XMLUtil::SkipWhiteSpace( p ); + if ( !p || *p != '=' ) { + return 0; + } + + ++p; // move up to opening quote + p = XMLUtil::SkipWhiteSpace( p ); + if ( *p != '\"' && *p != '\'' ) { + return 0; + } + + char endTag[2] = { *p, 0 }; + ++p; // move past opening quote + + p = _value.ParseText( p, endTag, processEntities ? StrPair::ATTRIBUTE_VALUE : StrPair::ATTRIBUTE_VALUE_LEAVE_ENTITIES ); + return p; +} + + +void XMLAttribute::SetName( const char* n ) +{ + _name.SetStr( n ); +} + + +XMLError XMLAttribute::QueryIntValue( int* value ) const +{ + if ( XMLUtil::ToInt( Value(), value )) { + return XML_NO_ERROR; + } + return XML_WRONG_ATTRIBUTE_TYPE; +} + + +XMLError XMLAttribute::QueryUnsignedValue( unsigned int* value ) const +{ + if ( XMLUtil::ToUnsigned( Value(), value )) { + return XML_NO_ERROR; + } + return XML_WRONG_ATTRIBUTE_TYPE; +} + + +XMLError XMLAttribute::QueryBoolValue( bool* value ) const +{ + if ( XMLUtil::ToBool( Value(), value )) { + return XML_NO_ERROR; + } + return XML_WRONG_ATTRIBUTE_TYPE; +} + + +XMLError XMLAttribute::QueryFloatValue( float* value ) const +{ + if ( XMLUtil::ToFloat( Value(), value )) { + return XML_NO_ERROR; + } + return XML_WRONG_ATTRIBUTE_TYPE; +} + + +XMLError XMLAttribute::QueryDoubleValue( double* value ) const +{ + if ( XMLUtil::ToDouble( Value(), value )) { + return XML_NO_ERROR; + } + return XML_WRONG_ATTRIBUTE_TYPE; +} + + +void XMLAttribute::SetAttribute( const char* v ) +{ + _value.SetStr( v ); +} + + +void XMLAttribute::SetAttribute( int v ) +{ + char buf[BUF_SIZE]; + XMLUtil::ToStr( v, buf, BUF_SIZE ); + _value.SetStr( buf ); +} + + +void XMLAttribute::SetAttribute( unsigned v ) +{ + char buf[BUF_SIZE]; + XMLUtil::ToStr( v, buf, BUF_SIZE ); + _value.SetStr( buf ); +} + + +void XMLAttribute::SetAttribute( bool v ) +{ + char buf[BUF_SIZE]; + XMLUtil::ToStr( v, buf, BUF_SIZE ); + _value.SetStr( buf ); +} + +void XMLAttribute::SetAttribute( double v ) +{ + char buf[BUF_SIZE]; + XMLUtil::ToStr( v, buf, BUF_SIZE ); + _value.SetStr( buf ); +} + +void XMLAttribute::SetAttribute( float v ) +{ + char buf[BUF_SIZE]; + XMLUtil::ToStr( v, buf, BUF_SIZE ); + _value.SetStr( buf ); +} + + +// --------- XMLElement ---------- // +XMLElement::XMLElement( XMLDocument* doc ) : XMLNode( doc ), + _closingType( 0 ), + _rootAttribute( 0 ) +{ +} + + +XMLElement::~XMLElement() +{ + while( _rootAttribute ) { + XMLAttribute* next = _rootAttribute->_next; + DELETE_ATTRIBUTE( _rootAttribute ); + _rootAttribute = next; + } +} + + +XMLAttribute* XMLElement::FindAttribute( const char* name ) +{ + XMLAttribute* a = 0; + for( a=_rootAttribute; a; a = a->_next ) { + if ( XMLUtil::StringEqual( a->Name(), name ) ) { + return a; + } + } + return 0; +} + + +const XMLAttribute* XMLElement::FindAttribute( const char* name ) const +{ + XMLAttribute* a = 0; + for( a=_rootAttribute; a; a = a->_next ) { + if ( XMLUtil::StringEqual( a->Name(), name ) ) { + return a; + } + } + return 0; +} + + +const char* XMLElement::Attribute( const char* name, const char* value ) const +{ + const XMLAttribute* a = FindAttribute( name ); + if ( !a ) { + return 0; + } + if ( !value || XMLUtil::StringEqual( a->Value(), value )) { + return a->Value(); + } + return 0; +} + + +const char* XMLElement::GetText() const +{ + if ( FirstChild() && FirstChild()->ToText() ) { + return FirstChild()->ToText()->Value(); + } + return 0; +} + + +XMLError XMLElement::QueryIntText( int* ival ) const +{ + if ( FirstChild() && FirstChild()->ToText() ) { + const char* t = FirstChild()->ToText()->Value(); + if ( XMLUtil::ToInt( t, ival ) ) { + return XML_SUCCESS; + } + return XML_CAN_NOT_CONVERT_TEXT; + } + return XML_NO_TEXT_NODE; +} + + +XMLError XMLElement::QueryUnsignedText( unsigned* uval ) const +{ + if ( FirstChild() && FirstChild()->ToText() ) { + const char* t = FirstChild()->ToText()->Value(); + if ( XMLUtil::ToUnsigned( t, uval ) ) { + return XML_SUCCESS; + } + return XML_CAN_NOT_CONVERT_TEXT; + } + return XML_NO_TEXT_NODE; +} + + +XMLError XMLElement::QueryBoolText( bool* bval ) const +{ + if ( FirstChild() && FirstChild()->ToText() ) { + const char* t = FirstChild()->ToText()->Value(); + if ( XMLUtil::ToBool( t, bval ) ) { + return XML_SUCCESS; + } + return XML_CAN_NOT_CONVERT_TEXT; + } + return XML_NO_TEXT_NODE; +} + + +XMLError XMLElement::QueryDoubleText( double* dval ) const +{ + if ( FirstChild() && FirstChild()->ToText() ) { + const char* t = FirstChild()->ToText()->Value(); + if ( XMLUtil::ToDouble( t, dval ) ) { + return XML_SUCCESS; + } + return XML_CAN_NOT_CONVERT_TEXT; + } + return XML_NO_TEXT_NODE; +} + + +XMLError XMLElement::QueryFloatText( float* fval ) const +{ + if ( FirstChild() && FirstChild()->ToText() ) { + const char* t = FirstChild()->ToText()->Value(); + if ( XMLUtil::ToFloat( t, fval ) ) { + return XML_SUCCESS; + } + return XML_CAN_NOT_CONVERT_TEXT; + } + return XML_NO_TEXT_NODE; +} + + + +XMLAttribute* XMLElement::FindOrCreateAttribute( const char* name ) +{ + XMLAttribute* last = 0; + XMLAttribute* attrib = 0; + for( attrib = _rootAttribute; + attrib; + last = attrib, attrib = attrib->_next ) { + if ( XMLUtil::StringEqual( attrib->Name(), name ) ) { + break; + } + } + if ( !attrib ) { + attrib = new (_document->_attributePool.Alloc() ) XMLAttribute(); + attrib->_memPool = &_document->_attributePool; + if ( last ) { + last->_next = attrib; + } + else { + _rootAttribute = attrib; + } + attrib->SetName( name ); + attrib->_memPool->SetTracked(); // always created and linked. + } + return attrib; +} + + +void XMLElement::DeleteAttribute( const char* name ) +{ + XMLAttribute* prev = 0; + for( XMLAttribute* a=_rootAttribute; a; a=a->_next ) { + if ( XMLUtil::StringEqual( name, a->Name() ) ) { + if ( prev ) { + prev->_next = a->_next; + } + else { + _rootAttribute = a->_next; + } + DELETE_ATTRIBUTE( a ); + break; + } + prev = a; + } +} + + +char* XMLElement::ParseAttributes( char* p ) +{ + const char* start = p; + XMLAttribute* prevAttribute = 0; + + // Read the attributes. + while( p ) { + p = XMLUtil::SkipWhiteSpace( p ); + if ( !p || !(*p) ) { + _document->SetError( XML_ERROR_PARSING_ELEMENT, start, Name() ); + return 0; + } + + // attribute. + if ( XMLUtil::IsAlpha( *p ) ) { + XMLAttribute* attrib = new (_document->_attributePool.Alloc() ) XMLAttribute(); + attrib->_memPool = &_document->_attributePool; + attrib->_memPool->SetTracked(); + + p = attrib->ParseDeep( p, _document->ProcessEntities() ); + if ( !p || Attribute( attrib->Name() ) ) { + DELETE_ATTRIBUTE( attrib ); + _document->SetError( XML_ERROR_PARSING_ATTRIBUTE, start, p ); + return 0; + } + // There is a minor bug here: if the attribute in the source xml + // document is duplicated, it will not be detected and the + // attribute will be doubly added. However, tracking the 'prevAttribute' + // avoids re-scanning the attribute list. Preferring performance for + // now, may reconsider in the future. + if ( prevAttribute ) { + prevAttribute->_next = attrib; + } + else { + _rootAttribute = attrib; + } + prevAttribute = attrib; + } + // end of the tag + else if ( *p == '/' && *(p+1) == '>' ) { + _closingType = CLOSED; + return p+2; // done; sealed element. + } + // end of the tag + else if ( *p == '>' ) { + ++p; + break; + } + else { + _document->SetError( XML_ERROR_PARSING_ELEMENT, start, p ); + return 0; + } + } + return p; +} + + +// +// +// foobar +// +char* XMLElement::ParseDeep( char* p, StrPair* strPair ) +{ + // Read the element name. + p = XMLUtil::SkipWhiteSpace( p ); + if ( !p ) { + return 0; + } + + // The closing element is the form. It is + // parsed just like a regular element then deleted from + // the DOM. + if ( *p == '/' ) { + _closingType = CLOSING; + ++p; + } + + p = _value.ParseName( p ); + if ( _value.Empty() ) { + return 0; + } + + p = ParseAttributes( p ); + if ( !p || !*p || _closingType ) { + return p; + } + + p = XMLNode::ParseDeep( p, strPair ); + return p; +} + + + +XMLNode* XMLElement::ShallowClone( XMLDocument* doc ) const +{ + if ( !doc ) { + doc = _document; + } + XMLElement* element = doc->NewElement( Value() ); // fixme: this will always allocate memory. Intern? + for( const XMLAttribute* a=FirstAttribute(); a; a=a->Next() ) { + element->SetAttribute( a->Name(), a->Value() ); // fixme: this will always allocate memory. Intern? + } + return element; +} + + +bool XMLElement::ShallowEqual( const XMLNode* compare ) const +{ + const XMLElement* other = compare->ToElement(); + if ( other && XMLUtil::StringEqual( other->Value(), Value() )) { + + const XMLAttribute* a=FirstAttribute(); + const XMLAttribute* b=other->FirstAttribute(); + + while ( a && b ) { + if ( !XMLUtil::StringEqual( a->Value(), b->Value() ) ) { + return false; + } + a = a->Next(); + b = b->Next(); + } + if ( a || b ) { + // different count + return false; + } + return true; + } + return false; +} + + +bool XMLElement::Accept( XMLVisitor* visitor ) const +{ + if ( visitor->VisitEnter( *this, _rootAttribute ) ) { + for ( const XMLNode* node=FirstChild(); node; node=node->NextSibling() ) { + if ( !node->Accept( visitor ) ) { + break; + } + } + } + return visitor->VisitExit( *this ); +} + + +// --------- XMLDocument ----------- // +XMLDocument::XMLDocument( bool processEntities, Whitespace whitespace ) : + XMLNode( 0 ), + _writeBOM( false ), + _processEntities( processEntities ), + _errorID( XML_NO_ERROR ), + _whitespace( whitespace ), + _errorStr1( 0 ), + _errorStr2( 0 ), + _charBuffer( 0 ) +{ + _document = this; // avoid warning about 'this' in initializer list +} + + +XMLDocument::~XMLDocument() +{ + DeleteChildren(); + delete [] _charBuffer; + +#if 0 + textPool.Trace( "text" ); + elementPool.Trace( "element" ); + commentPool.Trace( "comment" ); + attributePool.Trace( "attribute" ); +#endif + +#ifdef DEBUG + if ( Error() == false ) { + TIXMLASSERT( _elementPool.CurrentAllocs() == _elementPool.Untracked() ); + TIXMLASSERT( _attributePool.CurrentAllocs() == _attributePool.Untracked() ); + TIXMLASSERT( _textPool.CurrentAllocs() == _textPool.Untracked() ); + TIXMLASSERT( _commentPool.CurrentAllocs() == _commentPool.Untracked() ); + } +#endif +} + + +void XMLDocument::InitDocument() +{ + _errorID = XML_NO_ERROR; + _errorStr1 = 0; + _errorStr2 = 0; + + delete [] _charBuffer; + _charBuffer = 0; +} + + +XMLElement* XMLDocument::NewElement( const char* name ) +{ + XMLElement* ele = new (_elementPool.Alloc()) XMLElement( this ); + ele->_memPool = &_elementPool; + ele->SetName( name ); + return ele; +} + + +XMLComment* XMLDocument::NewComment( const char* str ) +{ + XMLComment* comment = new (_commentPool.Alloc()) XMLComment( this ); + comment->_memPool = &_commentPool; + comment->SetValue( str ); + return comment; +} + + +XMLText* XMLDocument::NewText( const char* str ) +{ + XMLText* text = new (_textPool.Alloc()) XMLText( this ); + text->_memPool = &_textPool; + text->SetValue( str ); + return text; +} + + +XMLDeclaration* XMLDocument::NewDeclaration( const char* str ) +{ + XMLDeclaration* dec = new (_commentPool.Alloc()) XMLDeclaration( this ); + dec->_memPool = &_commentPool; + dec->SetValue( str ? str : "xml version=\"1.0\" encoding=\"UTF-8\"" ); + return dec; +} + + +XMLUnknown* XMLDocument::NewUnknown( const char* str ) +{ + XMLUnknown* unk = new (_commentPool.Alloc()) XMLUnknown( this ); + unk->_memPool = &_commentPool; + unk->SetValue( str ); + return unk; +} + + +XMLError XMLDocument::LoadFile( const char* filename ) +{ + DeleteChildren(); + InitDocument(); + FILE* fp = 0; + +#if defined(_MSC_VER) && (_MSC_VER >= 1400 ) && (CC_TARGET_PLATFORM != CC_PLATFORM_MARMALADE) + errno_t err = fopen_s(&fp, filename, "rb" ); + if ( !fp || err) { +#else + fp = fopen( filename, "rb" ); + if ( !fp) { +#endif + SetError( XML_ERROR_FILE_NOT_FOUND, filename, 0 ); + return _errorID; + } + LoadFile( fp ); + fclose( fp ); + return _errorID; +} + + +XMLError XMLDocument::LoadFile( FILE* fp ) +{ + DeleteChildren(); + InitDocument(); + + fseek( fp, 0, SEEK_END ); + size_t size = ftell( fp ); + fseek( fp, 0, SEEK_SET ); + + if ( size == 0 ) { + return _errorID; + } + + _charBuffer = new char[size+1]; + size_t read = fread( _charBuffer, 1, size, fp ); + if ( read != size ) { + SetError( XML_ERROR_FILE_READ_ERROR, 0, 0 ); + return _errorID; + } + + _charBuffer[size] = 0; + + const char* p = _charBuffer; + p = XMLUtil::SkipWhiteSpace( p ); + p = XMLUtil::ReadBOM( p, &_writeBOM ); + if ( !p || !*p ) { + SetError( XML_ERROR_EMPTY_DOCUMENT, 0, 0 ); + return _errorID; + } + + ParseDeep( _charBuffer + (p-_charBuffer), 0 ); + return _errorID; +} + + +XMLError XMLDocument::SaveFile( const char* filename, bool compact ) +{ + FILE* fp = 0; +#if defined(_MSC_VER) && (_MSC_VER >= 1400 ) && (CC_TARGET_PLATFORM != CC_PLATFORM_MARMALADE) + errno_t err = fopen_s(&fp, filename, "w" ); + if ( !fp || err) { +#else + fp = fopen( filename, "w" ); + if ( !fp) { +#endif + SetError( XML_ERROR_FILE_COULD_NOT_BE_OPENED, filename, 0 ); + return _errorID; + } + SaveFile(fp, compact); + fclose( fp ); + return _errorID; +} + + +XMLError XMLDocument::SaveFile( FILE* fp, bool compact ) +{ + XMLPrinter stream( fp, compact ); + Print( &stream ); + return _errorID; +} + + +XMLError XMLDocument::Parse( const char* p, size_t len ) +{ + DeleteChildren(); + InitDocument(); + + if ( !p || !*p ) { + SetError( XML_ERROR_EMPTY_DOCUMENT, 0, 0 ); + return _errorID; + } + if ( len == (size_t)(-1) ) { + len = strlen( p ); + } + _charBuffer = new char[ len+1 ]; + memcpy( _charBuffer, p, len ); + _charBuffer[len] = 0; + + p = XMLUtil::SkipWhiteSpace( p ); + p = XMLUtil::ReadBOM( p, &_writeBOM ); + if ( !p || !*p ) { + SetError( XML_ERROR_EMPTY_DOCUMENT, 0, 0 ); + return _errorID; + } + + ParseDeep( _charBuffer, 0 ); + return _errorID; +} + + +void XMLDocument::Print( XMLPrinter* streamer ) +{ + XMLPrinter stdStreamer( stdout ); + if ( !streamer ) { + streamer = &stdStreamer; + } + Accept( streamer ); +} + + +void XMLDocument::SetError( XMLError error, const char* str1, const char* str2 ) +{ + _errorID = error; + _errorStr1 = str1; + _errorStr2 = str2; +} + + +void XMLDocument::PrintError() const +{ + if ( _errorID ) { + static const int LEN = 20; + char buf1[LEN] = { 0 }; + char buf2[LEN] = { 0 }; + + if ( _errorStr1 ) { + TIXML_SNPRINTF( buf1, LEN, "%s", _errorStr1 ); + } + if ( _errorStr2 ) { + TIXML_SNPRINTF( buf2, LEN, "%s", _errorStr2 ); + } + + printf( "XMLDocument error id=%d str1=%s str2=%s\n", + _errorID, buf1, buf2 ); + } +} + + +XMLPrinter::XMLPrinter( FILE* file, bool compact ) : + _elementJustOpened( false ), + _firstElement( true ), + _fp( file ), + _depth( 0 ), + _textDepth( -1 ), + _processEntities( true ), + _compactMode( compact ) +{ + for( int i=0; i'] = true; // not required, but consistency is nice + _buffer.Push( 0 ); +} + + +void XMLPrinter::Print( const char* format, ... ) +{ + va_list va; + va_start( va, format ); + + if ( _fp ) { + vfprintf( _fp, format, va ); + } + else { + // This seems brutally complex. Haven't figured out a better + // way on windows. +#if defined _MSC_VER && (CC_TARGET_PLATFORM != CC_PLATFORM_MARMALADE) + int len = -1; + int expand = 1000; + while ( len < 0 ) { + len = vsnprintf_s( _accumulator.Mem(), _accumulator.Capacity(), _TRUNCATE, format, va ); + if ( len < 0 ) { + expand *= 3/2; + _accumulator.PushArr( expand ); + } + } + char* p = _buffer.PushArr( len ) - 1; + memcpy( p, _accumulator.Mem(), len+1 ); +#else + int len = vsnprintf( 0, 0, format, va ); + // Close out and re-start the va-args + va_end( va ); + va_start( va, format ); + char* p = _buffer.PushArr( len ) - 1; + vsnprintf( p, len+1, format, va ); +#endif + } + va_end( va ); +} + + +void XMLPrinter::PrintSpace( int depth ) +{ + for( int i=0; i 0 && *q < ENTITY_RANGE ) { + // Check for entities. If one is found, flush + // the stream up until the entity, write the + // entity, and keep looking. + if ( flag[(unsigned)(*q)] ) { + while ( p < q ) { + Print( "%c", *p ); + ++p; + } + for( int i=0; i 0) ) { + Print( "%s", p ); + } +} + + +void XMLPrinter::PushHeader( bool writeBOM, bool writeDec ) +{ + static const unsigned char bom[] = { TIXML_UTF_LEAD_0, TIXML_UTF_LEAD_1, TIXML_UTF_LEAD_2, 0 }; + if ( writeBOM ) { + Print( "%s", bom ); + } + if ( writeDec ) { + PushDeclaration( "xml version=\"1.0\"" ); + } +} + + +void XMLPrinter::OpenElement( const char* name ) +{ + if ( _elementJustOpened ) { + SealElement(); + } + _stack.Push( name ); + + if ( _textDepth < 0 && !_firstElement && !_compactMode ) { + Print( "\n" ); + PrintSpace( _depth ); + } + + Print( "<%s", name ); + _elementJustOpened = true; + _firstElement = false; + ++_depth; +} + + +void XMLPrinter::PushAttribute( const char* name, const char* value ) +{ + TIXMLASSERT( _elementJustOpened ); + Print( " %s=\"", name ); + PrintString( value, false ); + Print( "\"" ); +} + + +void XMLPrinter::PushAttribute( const char* name, int v ) +{ + char buf[BUF_SIZE]; + XMLUtil::ToStr( v, buf, BUF_SIZE ); + PushAttribute( name, buf ); +} + + +void XMLPrinter::PushAttribute( const char* name, unsigned v ) +{ + char buf[BUF_SIZE]; + XMLUtil::ToStr( v, buf, BUF_SIZE ); + PushAttribute( name, buf ); +} + + +void XMLPrinter::PushAttribute( const char* name, bool v ) +{ + char buf[BUF_SIZE]; + XMLUtil::ToStr( v, buf, BUF_SIZE ); + PushAttribute( name, buf ); +} + + +void XMLPrinter::PushAttribute( const char* name, double v ) +{ + char buf[BUF_SIZE]; + XMLUtil::ToStr( v, buf, BUF_SIZE ); + PushAttribute( name, buf ); +} + + +void XMLPrinter::CloseElement() +{ + --_depth; + const char* name = _stack.Pop(); + + if ( _elementJustOpened ) { + Print( "/>" ); + } + else { + if ( _textDepth < 0 && !_compactMode) { + Print( "\n" ); + PrintSpace( _depth ); + } + Print( "", name ); + } + + if ( _textDepth == _depth ) { + _textDepth = -1; + } + if ( _depth == 0 && !_compactMode) { + Print( "\n" ); + } + _elementJustOpened = false; +} + + +void XMLPrinter::SealElement() +{ + _elementJustOpened = false; + Print( ">" ); +} + + +void XMLPrinter::PushText( const char* text, bool cdata ) +{ + _textDepth = _depth-1; + + if ( _elementJustOpened ) { + SealElement(); + } + if ( cdata ) { + Print( "" ); + } + else { + PrintString( text, true ); + } +} + +void XMLPrinter::PushText( int value ) +{ + char buf[BUF_SIZE]; + XMLUtil::ToStr( value, buf, BUF_SIZE ); + PushText( buf, false ); +} + + +void XMLPrinter::PushText( unsigned value ) +{ + char buf[BUF_SIZE]; + XMLUtil::ToStr( value, buf, BUF_SIZE ); + PushText( buf, false ); +} + + +void XMLPrinter::PushText( bool value ) +{ + char buf[BUF_SIZE]; + XMLUtil::ToStr( value, buf, BUF_SIZE ); + PushText( buf, false ); +} + + +void XMLPrinter::PushText( float value ) +{ + char buf[BUF_SIZE]; + XMLUtil::ToStr( value, buf, BUF_SIZE ); + PushText( buf, false ); +} + + +void XMLPrinter::PushText( double value ) +{ + char buf[BUF_SIZE]; + XMLUtil::ToStr( value, buf, BUF_SIZE ); + PushText( buf, false ); +} + + +void XMLPrinter::PushComment( const char* comment ) +{ + if ( _elementJustOpened ) { + SealElement(); + } + if ( _textDepth < 0 && !_firstElement && !_compactMode) { + Print( "\n" ); + PrintSpace( _depth ); + } + _firstElement = false; + Print( "", comment ); +} + + +void XMLPrinter::PushDeclaration( const char* value ) +{ + if ( _elementJustOpened ) { + SealElement(); + } + if ( _textDepth < 0 && !_firstElement && !_compactMode) { + Print( "\n" ); + PrintSpace( _depth ); + } + _firstElement = false; + Print( "", value ); +} + + +void XMLPrinter::PushUnknown( const char* value ) +{ + if ( _elementJustOpened ) { + SealElement(); + } + if ( _textDepth < 0 && !_firstElement && !_compactMode) { + Print( "\n" ); + PrintSpace( _depth ); + } + _firstElement = false; + Print( "", value ); +} + + +bool XMLPrinter::VisitEnter( const XMLDocument& doc ) +{ + _processEntities = doc.ProcessEntities(); + if ( doc.HasBOM() ) { + PushHeader( true, false ); + } + return true; +} + + +bool XMLPrinter::VisitEnter( const XMLElement& element, const XMLAttribute* attribute ) +{ + OpenElement( element.Name() ); + while ( attribute ) { + PushAttribute( attribute->Name(), attribute->Value() ); + attribute = attribute->Next(); + } + return true; +} + + +bool XMLPrinter::VisitExit( const XMLElement& ) +{ + CloseElement(); + return true; +} + + +bool XMLPrinter::Visit( const XMLText& text ) +{ + PushText( text.Value(), text.CData() ); + return true; +} + + +bool XMLPrinter::Visit( const XMLComment& comment ) +{ + PushComment( comment.Value() ); + return true; +} + +bool XMLPrinter::Visit( const XMLDeclaration& declaration ) +{ + PushDeclaration( declaration.Value() ); + return true; +} + + +bool XMLPrinter::Visit( const XMLUnknown& unknown ) +{ + PushUnknown( unknown.Value() ); + return true; +} + +} // namespace tinyxml2 + diff --git a/external/tinyxml2/tinyxml2.h b/external/tinyxml2/tinyxml2.h new file mode 100644 index 0000000000..eeffa1096f --- /dev/null +++ b/external/tinyxml2/tinyxml2.h @@ -0,0 +1,1914 @@ +/* +Original code by Lee Thomason (www.grinninglizard.com) + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any +damages arising from the use of this software. + +Permission is granted to anyone to use this software for any +purpose, including commercial applications, and to alter it and +redistribute it freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must +not claim that you wrote the original software. If you use this +software in a product, an acknowledgment in the product documentation +would be appreciated but is not required. + +2. Altered source versions must be plainly marked as such, and +must not be misrepresented as being the original software. + +3. This notice may not be removed or altered from any source +distribution. +*/ + +#ifndef TINYXML2_INCLUDED +#define TINYXML2_INCLUDED + +#include "platform/CCPlatformConfig.h" +#include "platform/CCPlatformMacros.h" + +#if defined(ANDROID_NDK) || defined(__BORLANDC__) || (CC_TARGET_PLATFORM == CC_PLATFORM_BLACKBERRY) +# include +# include +# include +# include +# include +# include +#else +# include +# include +# include +# include +# include +# include +#endif + +/* + TODO: intern strings instead of allocation. +*/ +/* + gcc: + g++ -Wall -DDEBUG tinyxml2.cpp xmltest.cpp -o gccxmltest.exe + + Formatting, Artistic Style: + AStyle.exe --style=1tbs --indent-switches --break-closing-brackets --indent-preprocessor tinyxml2.cpp tinyxml2.h +*/ + +#if defined( _DEBUG ) || defined( DEBUG ) || defined (__DEBUG__) +# ifndef DEBUG +# define DEBUG +# endif +#endif + + +#if defined(DEBUG) +# if defined(_MSC_VER) +# define TIXMLASSERT( x ) if ( !(x)) { __debugbreak(); } //if ( !(x)) WinDebugBreak() +# elif defined (ANDROID_NDK) +# include +# define TIXMLASSERT( x ) if ( !(x)) { __android_log_assert( "assert", "grinliz", "ASSERT in '%s' at %d.", __FILE__, __LINE__ ); } +# else +# include +# define TIXMLASSERT assert +# endif +# else +# define TIXMLASSERT( x ) {} +#endif + + +#if (defined(_MSC_VER) && (_MSC_VER >= 1400 ) && (CC_TARGET_PLATFORM != CC_PLATFORM_MARMALADE)) +// Microsoft visual studio, version 2005 and higher. +/*int _snprintf_s( + char *buffer, + size_t sizeOfBuffer, + size_t count, + const char *format [, + argument] ... +);*/ +inline int TIXML_SNPRINTF( char* buffer, size_t size, const char* format, ... ) +{ + va_list va; + va_start( va, format ); + int result = vsnprintf_s( buffer, size, _TRUNCATE, format, va ); + va_end( va ); + return result; +} +#define TIXML_SSCANF sscanf_s +#else +// GCC version 3 and higher +//#warning( "Using sn* functions." ) +#define TIXML_SNPRINTF snprintf +#define TIXML_SSCANF sscanf +#endif + +static const int TIXML2_MAJOR_VERSION = 1; +static const int TIXML2_MINOR_VERSION = 0; +static const int TIXML2_PATCH_VERSION = 9; + +namespace tinyxml2 +{ +class XMLDocument; +class XMLElement; +class XMLAttribute; +class XMLComment; +class XMLNode; +class XMLText; +class XMLDeclaration; +class XMLUnknown; + +class XMLPrinter; + +/* + A class that wraps strings. Normally stores the start and end + pointers into the XML file itself, and will apply normalization + and entity translation if actually read. Can also store (and memory + manage) a traditional char[] +*/ +class CC_DLL StrPair +{ +public: + enum { + NEEDS_ENTITY_PROCESSING = 0x01, + NEEDS_NEWLINE_NORMALIZATION = 0x02, + COLLAPSE_WHITESPACE = 0x04, + + TEXT_ELEMENT = NEEDS_ENTITY_PROCESSING | NEEDS_NEWLINE_NORMALIZATION, + TEXT_ELEMENT_LEAVE_ENTITIES = NEEDS_NEWLINE_NORMALIZATION, + ATTRIBUTE_NAME = 0, + ATTRIBUTE_VALUE = NEEDS_ENTITY_PROCESSING | NEEDS_NEWLINE_NORMALIZATION, + ATTRIBUTE_VALUE_LEAVE_ENTITIES = NEEDS_NEWLINE_NORMALIZATION, + COMMENT = NEEDS_NEWLINE_NORMALIZATION + }; + + StrPair() : _flags( 0 ), _start( 0 ), _end( 0 ) {} + ~StrPair(); + + void Set( char* start, char* end, int flags ) { + Reset(); + _start = start; + _end = end; + _flags = flags | NEEDS_FLUSH; + } + + const char* GetStr(); + + bool Empty() const { + return _start == _end; + } + + void SetInternedStr( const char* str ) { + Reset(); + _start = const_cast(str); + } + + void SetStr( const char* str, int flags=0 ); + + char* ParseText( char* in, const char* endTag, int strFlags ); + char* ParseName( char* in ); + +private: + void Reset(); + void CollapseWhitespace(); + + enum { + NEEDS_FLUSH = 0x100, + NEEDS_DELETE = 0x200 + }; + + // After parsing, if *end != 0, it can be set to zero. + int _flags; + char* _start; + char* _end; +}; + + +/* + A dynamic array of Plain Old Data. Doesn't support constructors, etc. + Has a small initial memory pool, so that low or no usage will not + cause a call to new/delete +*/ +template +class CC_DLL DynArray +{ +public: + DynArray< T, INIT >() { + _mem = _pool; + _allocated = INIT; + _size = 0; + } + + ~DynArray() { + if ( _mem != _pool ) { + delete [] _mem; + } + } + + void Push( T t ) { + EnsureCapacity( _size+1 ); + _mem[_size++] = t; + } + + T* PushArr( int count ) { + EnsureCapacity( _size+count ); + T* ret = &_mem[_size]; + _size += count; + return ret; + } + + T Pop() { + return _mem[--_size]; + } + + void PopArr( int count ) { + TIXMLASSERT( _size >= count ); + _size -= count; + } + + bool Empty() const { + return _size == 0; + } + + T& operator[](int i) { + TIXMLASSERT( i>= 0 && i < _size ); + return _mem[i]; + } + + const T& operator[](int i) const { + TIXMLASSERT( i>= 0 && i < _size ); + return _mem[i]; + } + + int Size() const { + return _size; + } + + int Capacity() const { + return _allocated; + } + + const T* Mem() const { + return _mem; + } + + T* Mem() { + return _mem; + } + +private: + void EnsureCapacity( int cap ) { + if ( cap > _allocated ) { + int newAllocated = cap * 2; + T* newMem = new T[newAllocated]; + memcpy( newMem, _mem, sizeof(T)*_size ); // warning: not using constructors, only works for PODs + if ( _mem != _pool ) { + delete [] _mem; + } + _mem = newMem; + _allocated = newAllocated; + } + } + + T* _mem; + T _pool[INIT]; + int _allocated; // objects allocated + int _size; // number objects in use +}; + + +/* + Parent virtual class of a pool for fast allocation + and deallocation of objects. +*/ +class CC_DLL MemPool +{ +public: + MemPool() {} + virtual ~MemPool() {} + + virtual int ItemSize() const = 0; + virtual void* Alloc() = 0; + virtual void Free( void* ) = 0; + virtual void SetTracked() = 0; +}; + + +/* + Template child class to create pools of the correct type. +*/ +template< int SIZE > +class CC_DLL MemPoolT : public MemPool +{ +public: + MemPoolT() : _root(0), _currentAllocs(0), _nAllocs(0), _maxAllocs(0), _nUntracked(0) {} + ~MemPoolT() { + // Delete the blocks. + for( int i=0; i<_blockPtrs.Size(); ++i ) { + delete _blockPtrs[i]; + } + } + + virtual int ItemSize() const { + return SIZE; + } + int CurrentAllocs() const { + return _currentAllocs; + } + + virtual void* Alloc() { + if ( !_root ) { + // Need a new block. + Block* block = new Block(); + _blockPtrs.Push( block ); + + for( int i=0; ichunk[i].next = &block->chunk[i+1]; + } + block->chunk[COUNT-1].next = 0; + _root = block->chunk; + } + void* result = _root; + _root = _root->next; + + ++_currentAllocs; + if ( _currentAllocs > _maxAllocs ) { + _maxAllocs = _currentAllocs; + } + _nAllocs++; + _nUntracked++; + return result; + } + virtual void Free( void* mem ) { + if ( !mem ) { + return; + } + --_currentAllocs; + Chunk* chunk = (Chunk*)mem; +#ifdef DEBUG + memset( chunk, 0xfe, sizeof(Chunk) ); +#endif + chunk->next = _root; + _root = chunk; + } + void Trace( const char* name ) { + printf( "Mempool %s watermark=%d [%dk] current=%d size=%d nAlloc=%d blocks=%d\n", + name, _maxAllocs, _maxAllocs*SIZE/1024, _currentAllocs, SIZE, _nAllocs, _blockPtrs.Size() ); + } + + void SetTracked() { + _nUntracked--; + } + + int Untracked() const { + return _nUntracked; + } + + enum { COUNT = 1024/SIZE }; // Some compilers do not accept to use COUNT in private part if COUNT is private + +private: + union Chunk { + Chunk* next; + char mem[SIZE]; + }; + struct Block { + Chunk chunk[COUNT]; + }; + DynArray< Block*, 10 > _blockPtrs; + Chunk* _root; + + int _currentAllocs; + int _nAllocs; + int _maxAllocs; + int _nUntracked; +}; + + + +/** + Implements the interface to the "Visitor pattern" (see the Accept() method.) + If you call the Accept() method, it requires being passed a XMLVisitor + class to handle callbacks. For nodes that contain other nodes (Document, Element) + you will get called with a VisitEnter/VisitExit pair. Nodes that are always leafs + are simply called with Visit(). + + If you return 'true' from a Visit method, recursive parsing will continue. If you return + false, no children of this node or its sibilings will be visited. + + All flavors of Visit methods have a default implementation that returns 'true' (continue + visiting). You need to only override methods that are interesting to you. + + Generally Accept() is called on the TiXmlDocument, although all nodes support visiting. + + You should never change the document from a callback. + + @sa XMLNode::Accept() +*/ +class CC_DLL XMLVisitor +{ +public: + virtual ~XMLVisitor() {} + + /// Visit a document. + virtual bool VisitEnter( const XMLDocument& /*doc*/ ) { + return true; + } + /// Visit a document. + virtual bool VisitExit( const XMLDocument& /*doc*/ ) { + return true; + } + + /// Visit an element. + virtual bool VisitEnter( const XMLElement& /*element*/, const XMLAttribute* /*firstAttribute*/ ) { + return true; + } + /// Visit an element. + virtual bool VisitExit( const XMLElement& /*element*/ ) { + return true; + } + + /// Visit a declaration. + virtual bool Visit( const XMLDeclaration& /*declaration*/ ) { + return true; + } + /// Visit a text node. + virtual bool Visit( const XMLText& /*text*/ ) { + return true; + } + /// Visit a comment node. + virtual bool Visit( const XMLComment& /*comment*/ ) { + return true; + } + /// Visit an unknown node. + virtual bool Visit( const XMLUnknown& /*unknown*/ ) { + return true; + } +}; + + +/* + Utility functionality. +*/ +class CC_DLL XMLUtil +{ +public: + // Anything in the high order range of UTF-8 is assumed to not be whitespace. This isn't + // correct, but simple, and usually works. + static const char* SkipWhiteSpace( const char* p ) { + while( !IsUTF8Continuation(*p) && isspace( *reinterpret_cast(p) ) ) { + ++p; + } + return p; + } + static char* SkipWhiteSpace( char* p ) { + while( !IsUTF8Continuation(*p) && isspace( *reinterpret_cast(p) ) ) { + ++p; + } + return p; + } + static bool IsWhiteSpace( char p ) { + return !IsUTF8Continuation(p) && isspace( static_cast(p) ); + } + + inline static bool StringEqual( const char* p, const char* q, int nChar=INT_MAX ) { + int n = 0; + if ( p == q ) { + return true; + } + while( *p && *q && *p == *q && n(const_cast(this)->FirstChildElement( value )); + } + + /// Get the last child node, or null if none exists. + const XMLNode* LastChild() const { + return _lastChild; + } + + XMLNode* LastChild() { + return const_cast(const_cast(this)->LastChild() ); + } + + /** Get the last child element or optionally the last child + element with the specified name. + */ + const XMLElement* LastChildElement( const char* value=0 ) const; + + XMLElement* LastChildElement( const char* value=0 ) { + return const_cast(const_cast(this)->LastChildElement(value) ); + } + + /// Get the previous (left) sibling node of this node. + const XMLNode* PreviousSibling() const { + return _prev; + } + + XMLNode* PreviousSibling() { + return _prev; + } + + /// Get the previous (left) sibling element of this node, with an opitionally supplied name. + const XMLElement* PreviousSiblingElement( const char* value=0 ) const ; + + XMLElement* PreviousSiblingElement( const char* value=0 ) { + return const_cast(const_cast(this)->PreviousSiblingElement( value ) ); + } + + /// Get the next (right) sibling node of this node. + const XMLNode* NextSibling() const { + return _next; + } + + XMLNode* NextSibling() { + return _next; + } + + /// Get the next (right) sibling element of this node, with an opitionally supplied name. + const XMLElement* NextSiblingElement( const char* value=0 ) const; + + XMLElement* NextSiblingElement( const char* value=0 ) { + return const_cast(const_cast(this)->NextSiblingElement( value ) ); + } + + /** + Add a child node as the last (right) child. + */ + XMLNode* InsertEndChild( XMLNode* addThis ); + + XMLNode* LinkEndChild( XMLNode* addThis ) { + return InsertEndChild( addThis ); + } + /** + Add a child node as the first (left) child. + */ + XMLNode* InsertFirstChild( XMLNode* addThis ); + /** + Add a node after the specified child node. + */ + XMLNode* InsertAfterChild( XMLNode* afterThis, XMLNode* addThis ); + + /** + Delete all the children of this node. + */ + void DeleteChildren(); + + /** + Delete a child of this node. + */ + void DeleteChild( XMLNode* node ); + + /** + Make a copy of this node, but not its children. + You may pass in a Document pointer that will be + the owner of the new Node. If the 'document' is + null, then the node returned will be allocated + from the current Document. (this->GetDocument()) + + Note: if called on a XMLDocument, this will return null. + */ + virtual XMLNode* ShallowClone( XMLDocument* document ) const = 0; + + /** + Test if 2 nodes are the same, but don't test children. + The 2 nodes do not need to be in the same Document. + + Note: if called on a XMLDocument, this will return false. + */ + virtual bool ShallowEqual( const XMLNode* compare ) const = 0; + + /** Accept a hierarchical visit of the nodes in the TinyXML DOM. Every node in the + XML tree will be conditionally visited and the host will be called back + via the TiXmlVisitor interface. + + This is essentially a SAX interface for TinyXML. (Note however it doesn't re-parse + the XML for the callbacks, so the performance of TinyXML is unchanged by using this + interface versus any other.) + + The interface has been based on ideas from: + + - http://www.saxproject.org/ + - http://c2.com/cgi/wiki?HierarchicalVisitorPattern + + Which are both good references for "visiting". + + An example of using Accept(): + @verbatim + TiXmlPrinter printer; + tinyxmlDoc.Accept( &printer ); + const char* xmlcstr = printer.CStr(); + @endverbatim + */ + virtual bool Accept( XMLVisitor* visitor ) const = 0; + + // internal + virtual char* ParseDeep( char*, StrPair* ); + +protected: + XMLNode( XMLDocument* ); + virtual ~XMLNode(); + XMLNode( const XMLNode& ); // not supported + XMLNode& operator=( const XMLNode& ); // not supported + + XMLDocument* _document; + XMLNode* _parent; + mutable StrPair _value; + + XMLNode* _firstChild; + XMLNode* _lastChild; + + XMLNode* _prev; + XMLNode* _next; + +private: + MemPool* _memPool; + void Unlink( XMLNode* child ); +}; + + +/** XML text. + + Note that a text node can have child element nodes, for example: + @verbatim + This is bold + @endverbatim + + A text node can have 2 ways to output the next. "normal" output + and CDATA. It will default to the mode it was parsed from the XML file and + you generally want to leave it alone, but you can change the output mode with + SetCDATA() and query it with CDATA(). +*/ +class CC_DLL XMLText : public XMLNode +{ + friend class XMLBase; + friend class XMLDocument; +public: + virtual bool Accept( XMLVisitor* visitor ) const; + + virtual XMLText* ToText() { + return this; + } + virtual const XMLText* ToText() const { + return this; + } + + /// Declare whether this should be CDATA or standard text. + void SetCData( bool isCData ) { + _isCData = isCData; + } + /// Returns true if this is a CDATA text element. + bool CData() const { + return _isCData; + } + + char* ParseDeep( char*, StrPair* endTag ); + virtual XMLNode* ShallowClone( XMLDocument* document ) const; + virtual bool ShallowEqual( const XMLNode* compare ) const; + +protected: + XMLText( XMLDocument* doc ) : XMLNode( doc ), _isCData( false ) {} + virtual ~XMLText() {} + XMLText( const XMLText& ); // not supported + XMLText& operator=( const XMLText& ); // not supported + +private: + bool _isCData; +}; + + +/** An XML Comment. */ +class CC_DLL XMLComment : public XMLNode +{ + friend class XMLDocument; +public: + virtual XMLComment* ToComment() { + return this; + } + virtual const XMLComment* ToComment() const { + return this; + } + + virtual bool Accept( XMLVisitor* visitor ) const; + + char* ParseDeep( char*, StrPair* endTag ); + virtual XMLNode* ShallowClone( XMLDocument* document ) const; + virtual bool ShallowEqual( const XMLNode* compare ) const; + +protected: + XMLComment( XMLDocument* doc ); + virtual ~XMLComment(); + XMLComment( const XMLComment& ); // not supported + XMLComment& operator=( const XMLComment& ); // not supported + +private: +}; + + +/** In correct XML the declaration is the first entry in the file. + @verbatim + + @endverbatim + + TinyXML2 will happily read or write files without a declaration, + however. + + The text of the declaration isn't interpreted. It is parsed + and written as a string. +*/ +class CC_DLL XMLDeclaration : public XMLNode +{ + friend class XMLDocument; +public: + virtual XMLDeclaration* ToDeclaration() { + return this; + } + virtual const XMLDeclaration* ToDeclaration() const { + return this; + } + + virtual bool Accept( XMLVisitor* visitor ) const; + + char* ParseDeep( char*, StrPair* endTag ); + virtual XMLNode* ShallowClone( XMLDocument* document ) const; + virtual bool ShallowEqual( const XMLNode* compare ) const; + +protected: + XMLDeclaration( XMLDocument* doc ); + virtual ~XMLDeclaration(); + XMLDeclaration( const XMLDeclaration& ); // not supported + XMLDeclaration& operator=( const XMLDeclaration& ); // not supported +}; + + +/** Any tag that tinyXml doesn't recognize is saved as an + unknown. It is a tag of text, but should not be modified. + It will be written back to the XML, unchanged, when the file + is saved. + + DTD tags get thrown into TiXmlUnknowns. +*/ +class CC_DLL XMLUnknown : public XMLNode +{ + friend class XMLDocument; +public: + virtual XMLUnknown* ToUnknown() { + return this; + } + virtual const XMLUnknown* ToUnknown() const { + return this; + } + + virtual bool Accept( XMLVisitor* visitor ) const; + + char* ParseDeep( char*, StrPair* endTag ); + virtual XMLNode* ShallowClone( XMLDocument* document ) const; + virtual bool ShallowEqual( const XMLNode* compare ) const; + +protected: + XMLUnknown( XMLDocument* doc ); + virtual ~XMLUnknown(); + XMLUnknown( const XMLUnknown& ); // not supported + XMLUnknown& operator=( const XMLUnknown& ); // not supported +}; + + +enum XMLError { + XML_NO_ERROR = 0, + XML_SUCCESS = 0, + + XML_NO_ATTRIBUTE, + XML_WRONG_ATTRIBUTE_TYPE, + + XML_ERROR_FILE_NOT_FOUND, + XML_ERROR_FILE_COULD_NOT_BE_OPENED, + XML_ERROR_FILE_READ_ERROR, + XML_ERROR_ELEMENT_MISMATCH, + XML_ERROR_PARSING_ELEMENT, + XML_ERROR_PARSING_ATTRIBUTE, + XML_ERROR_IDENTIFYING_TAG, + XML_ERROR_PARSING_TEXT, + XML_ERROR_PARSING_CDATA, + XML_ERROR_PARSING_COMMENT, + XML_ERROR_PARSING_DECLARATION, + XML_ERROR_PARSING_UNKNOWN, + XML_ERROR_EMPTY_DOCUMENT, + XML_ERROR_MISMATCHED_ELEMENT, + XML_ERROR_PARSING, + + XML_CAN_NOT_CONVERT_TEXT, + XML_NO_TEXT_NODE +}; + + +/** An attribute is a name-value pair. Elements have an arbitrary + number of attributes, each with a unique name. + + @note The attributes are not XMLNodes. You may only query the + Next() attribute in a list. +*/ +class CC_DLL XMLAttribute +{ + friend class XMLElement; +public: + /// The name of the attribute. + const char* Name() const { + return _name.GetStr(); + } + /// The value of the attribute. + const char* Value() const { + return _value.GetStr(); + } + /// The next attribute in the list. + const XMLAttribute* Next() const { + return _next; + } + + /** IntAttribute interprets the attribute as an integer, and returns the value. + If the value isn't an integer, 0 will be returned. There is no error checking; + use QueryIntAttribute() if you need error checking. + */ + int IntValue() const { + int i=0; + QueryIntValue( &i ); + return i; + } + /// Query as an unsigned integer. See IntAttribute() + unsigned UnsignedValue() const { + unsigned i=0; + QueryUnsignedValue( &i ); + return i; + } + /// Query as a boolean. See IntAttribute() + bool BoolValue() const { + bool b=false; + QueryBoolValue( &b ); + return b; + } + /// Query as a double. See IntAttribute() + double DoubleValue() const { + double d=0; + QueryDoubleValue( &d ); + return d; + } + /// Query as a float. See IntAttribute() + float FloatValue() const { + float f=0; + QueryFloatValue( &f ); + return f; + } + + /** QueryIntAttribute interprets the attribute as an integer, and returns the value + in the provided paremeter. The function will return XML_NO_ERROR on success, + and XML_WRONG_ATTRIBUTE_TYPE if the conversion is not successful. + */ + XMLError QueryIntValue( int* value ) const; + /// See QueryIntAttribute + XMLError QueryUnsignedValue( unsigned int* value ) const; + /// See QueryIntAttribute + XMLError QueryBoolValue( bool* value ) const; + /// See QueryIntAttribute + XMLError QueryDoubleValue( double* value ) const; + /// See QueryIntAttribute + XMLError QueryFloatValue( float* value ) const; + + /// Set the attribute to a string value. + void SetAttribute( const char* value ); + /// Set the attribute to value. + void SetAttribute( int value ); + /// Set the attribute to value. + void SetAttribute( unsigned value ); + /// Set the attribute to value. + void SetAttribute( bool value ); + /// Set the attribute to value. + void SetAttribute( double value ); + /// Set the attribute to value. + void SetAttribute( float value ); + +private: + enum { BUF_SIZE = 200 }; + + XMLAttribute() : _next( 0 ) {} + virtual ~XMLAttribute() {} + + XMLAttribute( const XMLAttribute& ); // not supported + void operator=( const XMLAttribute& ); // not supported + void SetName( const char* name ); + + char* ParseDeep( char* p, bool processEntities ); + + mutable StrPair _name; + mutable StrPair _value; + XMLAttribute* _next; + MemPool* _memPool; +}; + + +/** The element is a container class. It has a value, the element name, + and can contain other elements, text, comments, and unknowns. + Elements also contain an arbitrary number of attributes. +*/ +class CC_DLL XMLElement : public XMLNode +{ + friend class XMLBase; + friend class XMLDocument; +public: + /// Get the name of an element (which is the Value() of the node.) + const char* Name() const { + return Value(); + } + /// Set the name of the element. + void SetName( const char* str, bool staticMem=false ) { + SetValue( str, staticMem ); + } + + virtual XMLElement* ToElement() { + return this; + } + virtual const XMLElement* ToElement() const { + return this; + } + virtual bool Accept( XMLVisitor* visitor ) const; + + /** Given an attribute name, Attribute() returns the value + for the attribute of that name, or null if none + exists. For example: + + @verbatim + const char* value = ele->Attribute( "foo" ); + @endverbatim + + The 'value' parameter is normally null. However, if specified, + the attribute will only be returned if the 'name' and 'value' + match. This allow you to write code: + + @verbatim + if ( ele->Attribute( "foo", "bar" ) ) callFooIsBar(); + @endverbatim + + rather than: + @verbatim + if ( ele->Attribute( "foo" ) ) { + if ( strcmp( ele->Attribute( "foo" ), "bar" ) == 0 ) callFooIsBar(); + } + @endverbatim + */ + const char* Attribute( const char* name, const char* value=0 ) const; + + /** Given an attribute name, IntAttribute() returns the value + of the attribute interpreted as an integer. 0 will be + returned if there is an error. For a method with error + checking, see QueryIntAttribute() + */ + int IntAttribute( const char* name ) const { + int i=0; + QueryIntAttribute( name, &i ); + return i; + } + /// See IntAttribute() + unsigned UnsignedAttribute( const char* name ) const { + unsigned i=0; + QueryUnsignedAttribute( name, &i ); + return i; + } + /// See IntAttribute() + bool BoolAttribute( const char* name ) const { + bool b=false; + QueryBoolAttribute( name, &b ); + return b; + } + /// See IntAttribute() + double DoubleAttribute( const char* name ) const { + double d=0; + QueryDoubleAttribute( name, &d ); + return d; + } + /// See IntAttribute() + float FloatAttribute( const char* name ) const { + float f=0; + QueryFloatAttribute( name, &f ); + return f; + } + + /** Given an attribute name, QueryIntAttribute() returns + XML_NO_ERROR, XML_WRONG_ATTRIBUTE_TYPE if the conversion + can't be performed, or XML_NO_ATTRIBUTE if the attribute + doesn't exist. If successful, the result of the conversion + will be written to 'value'. If not successful, nothing will + be written to 'value'. This allows you to provide default + value: + + @verbatim + int value = 10; + QueryIntAttribute( "foo", &value ); // if "foo" isn't found, value will still be 10 + @endverbatim + */ + XMLError QueryIntAttribute( const char* name, int* value ) const { + const XMLAttribute* a = FindAttribute( name ); + if ( !a ) { + return XML_NO_ATTRIBUTE; + } + return a->QueryIntValue( value ); + } + /// See QueryIntAttribute() + XMLError QueryUnsignedAttribute( const char* name, unsigned int* value ) const { + const XMLAttribute* a = FindAttribute( name ); + if ( !a ) { + return XML_NO_ATTRIBUTE; + } + return a->QueryUnsignedValue( value ); + } + /// See QueryIntAttribute() + XMLError QueryBoolAttribute( const char* name, bool* value ) const { + const XMLAttribute* a = FindAttribute( name ); + if ( !a ) { + return XML_NO_ATTRIBUTE; + } + return a->QueryBoolValue( value ); + } + /// See QueryIntAttribute() + XMLError QueryDoubleAttribute( const char* name, double* value ) const { + const XMLAttribute* a = FindAttribute( name ); + if ( !a ) { + return XML_NO_ATTRIBUTE; + } + return a->QueryDoubleValue( value ); + } + /// See QueryIntAttribute() + XMLError QueryFloatAttribute( const char* name, float* value ) const { + const XMLAttribute* a = FindAttribute( name ); + if ( !a ) { + return XML_NO_ATTRIBUTE; + } + return a->QueryFloatValue( value ); + } + + /// Sets the named attribute to value. + void SetAttribute( const char* name, const char* value ) { + XMLAttribute* a = FindOrCreateAttribute( name ); + a->SetAttribute( value ); + } + /// Sets the named attribute to value. + void SetAttribute( const char* name, int value ) { + XMLAttribute* a = FindOrCreateAttribute( name ); + a->SetAttribute( value ); + } + /// Sets the named attribute to value. + void SetAttribute( const char* name, unsigned value ) { + XMLAttribute* a = FindOrCreateAttribute( name ); + a->SetAttribute( value ); + } + /// Sets the named attribute to value. + void SetAttribute( const char* name, bool value ) { + XMLAttribute* a = FindOrCreateAttribute( name ); + a->SetAttribute( value ); + } + /// Sets the named attribute to value. + void SetAttribute( const char* name, double value ) { + XMLAttribute* a = FindOrCreateAttribute( name ); + a->SetAttribute( value ); + } + + /** + Delete an attribute. + */ + void DeleteAttribute( const char* name ); + + /// Return the first attribute in the list. + const XMLAttribute* FirstAttribute() const { + return _rootAttribute; + } + /// Query a specific attribute in the list. + const XMLAttribute* FindAttribute( const char* name ) const; + + /** Convenience function for easy access to the text inside an element. Although easy + and concise, GetText() is limited compared to getting the TiXmlText child + and accessing it directly. + + If the first child of 'this' is a TiXmlText, the GetText() + returns the character string of the Text node, else null is returned. + + This is a convenient method for getting the text of simple contained text: + @verbatim + This is text + const char* str = fooElement->GetText(); + @endverbatim + + 'str' will be a pointer to "This is text". + + Note that this function can be misleading. If the element foo was created from + this XML: + @verbatim + This is text + @endverbatim + + then the value of str would be null. The first child node isn't a text node, it is + another element. From this XML: + @verbatim + This is text + @endverbatim + GetText() will return "This is ". + */ + const char* GetText() const; + + /** + Convenience method to query the value of a child text node. This is probably best + shown by example. Given you have a document is this form: + @verbatim + + 1 + 1.4 + + @endverbatim + + The QueryIntText() and similar functions provide a safe and easier way to get to the + "value" of x and y. + + @verbatim + int x = 0; + float y = 0; // types of x and y are contrived for example + const XMLElement* xElement = pointElement->FirstChildElement( "x" ); + const XMLElement* yElement = pointElement->FirstChildElement( "y" ); + xElement->QueryIntText( &x ); + yElement->QueryFloatText( &y ); + @endverbatim + + @returns XML_SUCCESS (0) on success, XML_CAN_NOT_CONVERT_TEXT if the text cannot be converted + to the requested type, and XML_NO_TEXT_NODE if there is no child text to query. + + */ + XMLError QueryIntText( int* ival ) const; + /// See QueryIntText() + XMLError QueryUnsignedText( unsigned* uval ) const; + /// See QueryIntText() + XMLError QueryBoolText( bool* bval ) const; + /// See QueryIntText() + XMLError QueryDoubleText( double* dval ) const; + /// See QueryIntText() + XMLError QueryFloatText( float* fval ) const; + + // internal: + enum { + OPEN, // + CLOSED, // + CLOSING // + }; + int ClosingType() const { + return _closingType; + } + char* ParseDeep( char* p, StrPair* endTag ); + virtual XMLNode* ShallowClone( XMLDocument* document ) const; + virtual bool ShallowEqual( const XMLNode* compare ) const; + +private: + XMLElement( XMLDocument* doc ); + virtual ~XMLElement(); + XMLElement( const XMLElement& ); // not supported + void operator=( const XMLElement& ); // not supported + + XMLAttribute* FindAttribute( const char* name ); + XMLAttribute* FindOrCreateAttribute( const char* name ); + //void LinkAttribute( XMLAttribute* attrib ); + char* ParseAttributes( char* p ); + + int _closingType; + // The attribute list is ordered; there is no 'lastAttribute' + // because the list needs to be scanned for dupes before adding + // a new attribute. + XMLAttribute* _rootAttribute; +}; + + +enum Whitespace { + PRESERVE_WHITESPACE, + COLLAPSE_WHITESPACE +}; + + +/** A Document binds together all the functionality. + It can be saved, loaded, and printed to the screen. + All Nodes are connected and allocated to a Document. + If the Document is deleted, all its Nodes are also deleted. +*/ +class CC_DLL XMLDocument : public XMLNode +{ + friend class XMLElement; +public: + /// constructor + XMLDocument( bool processEntities = true, Whitespace = PRESERVE_WHITESPACE ); + ~XMLDocument(); + + virtual XMLDocument* ToDocument() { + return this; + } + virtual const XMLDocument* ToDocument() const { + return this; + } + + /** + Parse an XML file from a character string. + Returns XML_NO_ERROR (0) on success, or + an errorID. + + You may optionally pass in the 'nBytes', which is + the number of bytes which will be parsed. If not + specified, TinyXML will assume 'xml' points to a + null terminated string. + */ + XMLError Parse( const char* xml, size_t nBytes=(size_t)(-1) ); + + /** + Load an XML file from disk. + Returns XML_NO_ERROR (0) on success, or + an errorID. + */ + XMLError LoadFile( const char* filename ); + + /** + Load an XML file from disk. You are responsible + for providing and closing the FILE*. + + Returns XML_NO_ERROR (0) on success, or + an errorID. + */ + XMLError LoadFile( FILE* ); + + /** + Save the XML file to disk. + Returns XML_NO_ERROR (0) on success, or + an errorID. + */ + XMLError SaveFile( const char* filename, bool compact = false ); + + /** + Save the XML file to disk. You are responsible + for providing and closing the FILE*. + + Returns XML_NO_ERROR (0) on success, or + an errorID. + */ + XMLError SaveFile( FILE* fp, bool compact = false ); + + bool ProcessEntities() const { + return _processEntities; + } + Whitespace WhitespaceMode() const { + return _whitespace; + } + + /** + Returns true if this document has a leading Byte Order Mark of UTF8. + */ + bool HasBOM() const { + return _writeBOM; + } + /** Sets whether to write the BOM when writing the file. + */ + void SetBOM( bool useBOM ) { + _writeBOM = useBOM; + } + + /** Return the root element of DOM. Equivalent to FirstChildElement(). + To get the first node, use FirstChild(). + */ + XMLElement* RootElement() { + return FirstChildElement(); + } + const XMLElement* RootElement() const { + return FirstChildElement(); + } + + /** Print the Document. If the Printer is not provided, it will + print to stdout. If you provide Printer, this can print to a file: + @verbatim + XMLPrinter printer( fp ); + doc.Print( &printer ); + @endverbatim + + Or you can use a printer to print to memory: + @verbatim + XMLPrinter printer; + doc->Print( &printer ); + // printer.CStr() has a const char* to the XML + @endverbatim + */ + void Print( XMLPrinter* streamer=0 ); + virtual bool Accept( XMLVisitor* visitor ) const; + + /** + Create a new Element associated with + this Document. The memory for the Element + is managed by the Document. + */ + XMLElement* NewElement( const char* name ); + /** + Create a new Comment associated with + this Document. The memory for the Comment + is managed by the Document. + */ + XMLComment* NewComment( const char* comment ); + /** + Create a new Text associated with + this Document. The memory for the Text + is managed by the Document. + */ + XMLText* NewText( const char* text ); + /** + Create a new Declaration associated with + this Document. The memory for the object + is managed by the Document. + + If the 'text' param is null, the standard + declaration is used.: + @verbatim + + @endverbatim + */ + XMLDeclaration* NewDeclaration( const char* text=0 ); + /** + Create a new Unknown associated with + this Document. The memory forthe object + is managed by the Document. + */ + XMLUnknown* NewUnknown( const char* text ); + + /** + Delete a node associated with this document. + It will be unlinked from the DOM. + */ + void DeleteNode( XMLNode* node ) { + node->_parent->DeleteChild( node ); + } + + void SetError( XMLError error, const char* str1, const char* str2 ); + + /// Return true if there was an error parsing the document. + bool Error() const { + return _errorID != XML_NO_ERROR; + } + /// Return the errorID. + XMLError ErrorID() const { + return _errorID; + } + /// Return a possibly helpful diagnostic location or string. + const char* GetErrorStr1() const { + return _errorStr1; + } + /// Return a possibly helpful secondary diagnostic location or string. + const char* GetErrorStr2() const { + return _errorStr2; + } + /// If there is an error, print it to stdout. + void PrintError() const; + + // internal + char* Identify( char* p, XMLNode** node ); + + virtual XMLNode* ShallowClone( XMLDocument* /*document*/ ) const { + return 0; + } + virtual bool ShallowEqual( const XMLNode* /*compare*/ ) const { + return false; + } + +private: + XMLDocument( const XMLDocument& ); // not supported + void operator=( const XMLDocument& ); // not supported + void InitDocument(); + + bool _writeBOM; + bool _processEntities; + XMLError _errorID; + Whitespace _whitespace; + const char* _errorStr1; + const char* _errorStr2; + char* _charBuffer; + + MemPoolT< sizeof(XMLElement) > _elementPool; + MemPoolT< sizeof(XMLAttribute) > _attributePool; + MemPoolT< sizeof(XMLText) > _textPool; + MemPoolT< sizeof(XMLComment) > _commentPool; +}; + + +/** + A XMLHandle is a class that wraps a node pointer with null checks; this is + an incredibly useful thing. Note that XMLHandle is not part of the TinyXML + DOM structure. It is a separate utility class. + + Take an example: + @verbatim + + + + + + + @endverbatim + + Assuming you want the value of "attributeB" in the 2nd "Child" element, it's very + easy to write a *lot* of code that looks like: + + @verbatim + XMLElement* root = document.FirstChildElement( "Document" ); + if ( root ) + { + XMLElement* element = root->FirstChildElement( "Element" ); + if ( element ) + { + XMLElement* child = element->FirstChildElement( "Child" ); + if ( child ) + { + XMLElement* child2 = child->NextSiblingElement( "Child" ); + if ( child2 ) + { + // Finally do something useful. + @endverbatim + + And that doesn't even cover "else" cases. XMLHandle addresses the verbosity + of such code. A XMLHandle checks for null pointers so it is perfectly safe + and correct to use: + + @verbatim + XMLHandle docHandle( &document ); + XMLElement* child2 = docHandle.FirstChild( "Document" ).FirstChild( "Element" ).FirstChild().NextSibling().ToElement(); + if ( child2 ) + { + // do something useful + @endverbatim + + Which is MUCH more concise and useful. + + It is also safe to copy handles - internally they are nothing more than node pointers. + @verbatim + XMLHandle handleCopy = handle; + @endverbatim + + See also XMLConstHandle, which is the same as XMLHandle, but operates on const objects. +*/ +class CC_DLL XMLHandle +{ +public: + /// Create a handle from any node (at any depth of the tree.) This can be a null pointer. + XMLHandle( XMLNode* node ) { + _node = node; + } + /// Create a handle from a node. + XMLHandle( XMLNode& node ) { + _node = &node; + } + /// Copy constructor + XMLHandle( const XMLHandle& ref ) { + _node = ref._node; + } + /// Assignment + XMLHandle& operator=( const XMLHandle& ref ) { + _node = ref._node; + return *this; + } + + /// Get the first child of this handle. + XMLHandle FirstChild() { + return XMLHandle( _node ? _node->FirstChild() : 0 ); + } + /// Get the first child element of this handle. + XMLHandle FirstChildElement( const char* value=0 ) { + return XMLHandle( _node ? _node->FirstChildElement( value ) : 0 ); + } + /// Get the last child of this handle. + XMLHandle LastChild() { + return XMLHandle( _node ? _node->LastChild() : 0 ); + } + /// Get the last child element of this handle. + XMLHandle LastChildElement( const char* _value=0 ) { + return XMLHandle( _node ? _node->LastChildElement( _value ) : 0 ); + } + /// Get the previous sibling of this handle. + XMLHandle PreviousSibling() { + return XMLHandle( _node ? _node->PreviousSibling() : 0 ); + } + /// Get the previous sibling element of this handle. + XMLHandle PreviousSiblingElement( const char* _value=0 ) { + return XMLHandle( _node ? _node->PreviousSiblingElement( _value ) : 0 ); + } + /// Get the next sibling of this handle. + XMLHandle NextSibling() { + return XMLHandle( _node ? _node->NextSibling() : 0 ); + } + /// Get the next sibling element of this handle. + XMLHandle NextSiblingElement( const char* _value=0 ) { + return XMLHandle( _node ? _node->NextSiblingElement( _value ) : 0 ); + } + + /// Safe cast to XMLNode. This can return null. + XMLNode* ToNode() { + return _node; + } + /// Safe cast to XMLElement. This can return null. + XMLElement* ToElement() { + return ( ( _node && _node->ToElement() ) ? _node->ToElement() : 0 ); + } + /// Safe cast to XMLText. This can return null. + XMLText* ToText() { + return ( ( _node && _node->ToText() ) ? _node->ToText() : 0 ); + } + /// Safe cast to XMLUnknown. This can return null. + XMLUnknown* ToUnknown() { + return ( ( _node && _node->ToUnknown() ) ? _node->ToUnknown() : 0 ); + } + /// Safe cast to XMLDeclaration. This can return null. + XMLDeclaration* ToDeclaration() { + return ( ( _node && _node->ToDeclaration() ) ? _node->ToDeclaration() : 0 ); + } + +private: + XMLNode* _node; +}; + + +/** + A variant of the XMLHandle class for working with const XMLNodes and Documents. It is the + same in all regards, except for the 'const' qualifiers. See XMLHandle for API. +*/ +class CC_DLL XMLConstHandle +{ +public: + XMLConstHandle( const XMLNode* node ) { + _node = node; + } + XMLConstHandle( const XMLNode& node ) { + _node = &node; + } + XMLConstHandle( const XMLConstHandle& ref ) { + _node = ref._node; + } + + XMLConstHandle& operator=( const XMLConstHandle& ref ) { + _node = ref._node; + return *this; + } + + const XMLConstHandle FirstChild() const { + return XMLConstHandle( _node ? _node->FirstChild() : 0 ); + } + const XMLConstHandle FirstChildElement( const char* value=0 ) const { + return XMLConstHandle( _node ? _node->FirstChildElement( value ) : 0 ); + } + const XMLConstHandle LastChild() const { + return XMLConstHandle( _node ? _node->LastChild() : 0 ); + } + const XMLConstHandle LastChildElement( const char* _value=0 ) const { + return XMLConstHandle( _node ? _node->LastChildElement( _value ) : 0 ); + } + const XMLConstHandle PreviousSibling() const { + return XMLConstHandle( _node ? _node->PreviousSibling() : 0 ); + } + const XMLConstHandle PreviousSiblingElement( const char* _value=0 ) const { + return XMLConstHandle( _node ? _node->PreviousSiblingElement( _value ) : 0 ); + } + const XMLConstHandle NextSibling() const { + return XMLConstHandle( _node ? _node->NextSibling() : 0 ); + } + const XMLConstHandle NextSiblingElement( const char* _value=0 ) const { + return XMLConstHandle( _node ? _node->NextSiblingElement( _value ) : 0 ); + } + + + const XMLNode* ToNode() const { + return _node; + } + const XMLElement* ToElement() const { + return ( ( _node && _node->ToElement() ) ? _node->ToElement() : 0 ); + } + const XMLText* ToText() const { + return ( ( _node && _node->ToText() ) ? _node->ToText() : 0 ); + } + const XMLUnknown* ToUnknown() const { + return ( ( _node && _node->ToUnknown() ) ? _node->ToUnknown() : 0 ); + } + const XMLDeclaration* ToDeclaration() const { + return ( ( _node && _node->ToDeclaration() ) ? _node->ToDeclaration() : 0 ); + } + +private: + const XMLNode* _node; +}; + + +/** + Printing functionality. The XMLPrinter gives you more + options than the XMLDocument::Print() method. + + It can: + -# Print to memory. + -# Print to a file you provide. + -# Print XML without a XMLDocument. + + Print to Memory + + @verbatim + XMLPrinter printer; + doc->Print( &printer ); + SomeFunction( printer.CStr() ); + @endverbatim + + Print to a File + + You provide the file pointer. + @verbatim + XMLPrinter printer( fp ); + doc.Print( &printer ); + @endverbatim + + Print without a XMLDocument + + When loading, an XML parser is very useful. However, sometimes + when saving, it just gets in the way. The code is often set up + for streaming, and constructing the DOM is just overhead. + + The Printer supports the streaming case. The following code + prints out a trivially simple XML file without ever creating + an XML document. + + @verbatim + XMLPrinter printer( fp ); + printer.OpenElement( "foo" ); + printer.PushAttribute( "foo", "bar" ); + printer.CloseElement(); + @endverbatim +*/ +class CC_DLL XMLPrinter : public XMLVisitor +{ +public: + /** Construct the printer. If the FILE* is specified, + this will print to the FILE. Else it will print + to memory, and the result is available in CStr(). + If 'compact' is set to true, then output is created + with only required whitespace and newlines. + */ + XMLPrinter( FILE* file=0, bool compact = false ); + ~XMLPrinter() {} + + /** If streaming, write the BOM and declaration. */ + void PushHeader( bool writeBOM, bool writeDeclaration ); + /** If streaming, start writing an element. + The element must be closed with CloseElement() + */ + void OpenElement( const char* name ); + /// If streaming, add an attribute to an open element. + void PushAttribute( const char* name, const char* value ); + void PushAttribute( const char* name, int value ); + void PushAttribute( const char* name, unsigned value ); + void PushAttribute( const char* name, bool value ); + void PushAttribute( const char* name, double value ); + /// If streaming, close the Element. + void CloseElement(); + + /// Add a text node. + void PushText( const char* text, bool cdata=false ); + /// Add a text node from an integer. + void PushText( int value ); + /// Add a text node from an unsigned. + void PushText( unsigned value ); + /// Add a text node from a bool. + void PushText( bool value ); + /// Add a text node from a float. + void PushText( float value ); + /// Add a text node from a double. + void PushText( double value ); + + /// Add a comment + void PushComment( const char* comment ); + + void PushDeclaration( const char* value ); + void PushUnknown( const char* value ); + + virtual bool VisitEnter( const XMLDocument& /*doc*/ ); + virtual bool VisitExit( const XMLDocument& /*doc*/ ) { + return true; + } + + virtual bool VisitEnter( const XMLElement& element, const XMLAttribute* attribute ); + virtual bool VisitExit( const XMLElement& element ); + + virtual bool Visit( const XMLText& text ); + virtual bool Visit( const XMLComment& comment ); + virtual bool Visit( const XMLDeclaration& declaration ); + virtual bool Visit( const XMLUnknown& unknown ); + + /** + If in print to memory mode, return a pointer to + the XML file in memory. + */ + const char* CStr() const { + return _buffer.Mem(); + } + /** + If in print to memory mode, return the size + of the XML file in memory. (Note the size returned + includes the terminating null.) + */ + int CStrSize() const { + return _buffer.Size(); + } + +private: + void SealElement(); + void PrintSpace( int depth ); + void PrintString( const char*, bool restrictedEntitySet ); // prints out, after detecting entities. + void Print( const char* format, ... ); + + bool _elementJustOpened; + bool _firstElement; + FILE* _fp; + int _depth; + int _textDepth; + bool _processEntities; + bool _compactMode; + + enum { + ENTITY_RANGE = 64, + BUF_SIZE = 200 + }; + bool _entityFlag[ENTITY_RANGE]; + bool _restrictedEntityFlag[ENTITY_RANGE]; + + DynArray< const char*, 10 > _stack; + DynArray< char, 20 > _buffer; +#ifdef _MSC_VER + DynArray< char, 20 > _accumulator; +#endif +}; + + +} // tinyxml2 + + +#endif // TINYXML2_INCLUDED diff --git a/external/unzip/ioapi.cpp b/external/unzip/ioapi.cpp new file mode 100644 index 0000000000..669ea36927 --- /dev/null +++ b/external/unzip/ioapi.cpp @@ -0,0 +1,245 @@ +/* ioapi.h -- IO base function header for compress/uncompress .zip + part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) + + Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) + + Modifications for Zip64 support + Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) + + For more info read MiniZip_info.txt + +*/ + +#include "ioapi.h" + +namespace cocos2d { + +voidpf call_zopen64 (const zlib_filefunc64_32_def* pfilefunc,const void*filename,int mode) +{ + if (pfilefunc->zfile_func64.zopen64_file != NULL) + return (*(pfilefunc->zfile_func64.zopen64_file)) (pfilefunc->zfile_func64.opaque,filename,mode); + else + { + return (*(pfilefunc->zopen32_file))(pfilefunc->zfile_func64.opaque,(const char*)filename,mode); + } +} + +long call_zseek64 (const zlib_filefunc64_32_def* pfilefunc,voidpf filestream, ZPOS64_T offset, int origin) +{ + if (pfilefunc->zfile_func64.zseek64_file != NULL) + return (*(pfilefunc->zfile_func64.zseek64_file)) (pfilefunc->zfile_func64.opaque,filestream,offset,origin); + else + { + uLong offsetTruncated = (uLong)offset; + if (offsetTruncated != offset) + return -1; + else + return (*(pfilefunc->zseek32_file))(pfilefunc->zfile_func64.opaque,filestream,offsetTruncated,origin); + } +} + +ZPOS64_T call_ztell64 (const zlib_filefunc64_32_def* pfilefunc,voidpf filestream) +{ + if (pfilefunc->zfile_func64.zseek64_file != NULL) + return (*(pfilefunc->zfile_func64.ztell64_file)) (pfilefunc->zfile_func64.opaque,filestream); + else + { + uLong tell_uLong = (*(pfilefunc->ztell32_file))(pfilefunc->zfile_func64.opaque,filestream); + if ((tell_uLong) == ((uLong)-1)) + return (ZPOS64_T)-1; + else + return tell_uLong; + } +} + +void fill_zlib_filefunc64_32_def_from_filefunc32(zlib_filefunc64_32_def* p_filefunc64_32,const zlib_filefunc_def* p_filefunc32) +{ + p_filefunc64_32->zfile_func64.zopen64_file = NULL; + p_filefunc64_32->zopen32_file = p_filefunc32->zopen_file; + p_filefunc64_32->zfile_func64.zerror_file = p_filefunc32->zerror_file; + p_filefunc64_32->zfile_func64.zread_file = p_filefunc32->zread_file; + p_filefunc64_32->zfile_func64.zwrite_file = p_filefunc32->zwrite_file; + p_filefunc64_32->zfile_func64.ztell64_file = NULL; + p_filefunc64_32->zfile_func64.zseek64_file = NULL; + p_filefunc64_32->zfile_func64.zclose_file = p_filefunc32->zclose_file; + p_filefunc64_32->zfile_func64.zerror_file = p_filefunc32->zerror_file; + p_filefunc64_32->zfile_func64.opaque = p_filefunc32->opaque; + p_filefunc64_32->zseek32_file = p_filefunc32->zseek_file; + p_filefunc64_32->ztell32_file = p_filefunc32->ztell_file; +} + + + +static voidpf ZCALLBACK fopen_file_func OF((voidpf opaque, const char* filename, int mode)); +static uLong ZCALLBACK fread_file_func OF((voidpf opaque, voidpf stream, void* buf, uLong size)); +static uLong ZCALLBACK fwrite_file_func OF((voidpf opaque, voidpf stream, const void* buf,uLong size)); +static ZPOS64_T ZCALLBACK ftell64_file_func OF((voidpf opaque, voidpf stream)); +static long ZCALLBACK fseek64_file_func OF((voidpf opaque, voidpf stream, ZPOS64_T offset, int origin)); +static int ZCALLBACK fclose_file_func OF((voidpf opaque, voidpf stream)); +static int ZCALLBACK ferror_file_func OF((voidpf opaque, voidpf stream)); + +static voidpf ZCALLBACK fopen_file_func (voidpf opaque, const char* filename, int mode) +{ + FILE* file = NULL; + const char* mode_fopen = NULL; + if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ) + mode_fopen = "rb"; + else + if (mode & ZLIB_FILEFUNC_MODE_EXISTING) + mode_fopen = "r+b"; + else + if (mode & ZLIB_FILEFUNC_MODE_CREATE) + mode_fopen = "wb"; + + if ((filename!=NULL) && (mode_fopen != NULL)) + file = fopen(filename, mode_fopen); + return file; +} + +static voidpf ZCALLBACK fopen64_file_func (voidpf opaque, const void* filename, int mode) +{ + FILE* file = NULL; + const char* mode_fopen = NULL; + if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ) + mode_fopen = "rb"; + else + if (mode & ZLIB_FILEFUNC_MODE_EXISTING) + mode_fopen = "r+b"; + else + if (mode & ZLIB_FILEFUNC_MODE_CREATE) + mode_fopen = "wb"; + + if ((filename!=NULL) && (mode_fopen != NULL)) + { +#if (CC_TARGET_PLATFORM == CC_PLATFORM_MARMALADE || CC_TARGET_PLATFORM == CC_PLATFORM_BADA || CC_TARGET_PLATFORM == CC_PLATFORM_BLACKBERRY || CC_TARGET_PLATFORM == CC_PLATFORM_NACL || CC_TARGET_PLATFORM == CC_PLATFORM_EMSCRIPTEN) + file = NULL; +#else + file = fopen64((const char*)filename, mode_fopen); +#endif + } + + return file; +} + + +static uLong ZCALLBACK fread_file_func (voidpf opaque, voidpf stream, void* buf, uLong size) +{ + uLong ret; + ret = (uLong)fread(buf, 1, (size_t)size, (FILE *)stream); + return ret; +} + +static uLong ZCALLBACK fwrite_file_func (voidpf opaque, voidpf stream, const void* buf, uLong size) +{ + uLong ret; + ret = (uLong)fwrite(buf, 1, (size_t)size, (FILE *)stream); + return ret; +} + +static long ZCALLBACK ftell_file_func (voidpf opaque, voidpf stream) +{ + long ret; + ret = ftell((FILE *)stream); + return ret; +} + + +static ZPOS64_T ZCALLBACK ftell64_file_func (voidpf opaque, voidpf stream) +{ + ZPOS64_T ret; +#if (CC_TARGET_PLATFORM == CC_PLATFORM_MARMALADE || CC_TARGET_PLATFORM == CC_PLATFORM_BADA || CC_TARGET_PLATFORM == CC_PLATFORM_BLACKBERRY || CC_TARGET_PLATFORM == CC_PLATFORM_NACL || CC_TARGET_PLATFORM == CC_PLATFORM_EMSCRIPTEN) + ret = 0; +#else + ret = ftello64((FILE *)stream); +#endif + return ret; +} + +static long ZCALLBACK fseek_file_func (voidpf opaque, voidpf stream, uLong offset, int origin) +{ + int fseek_origin=0; + long ret; + switch (origin) + { + case ZLIB_FILEFUNC_SEEK_CUR : + fseek_origin = SEEK_CUR; + break; + case ZLIB_FILEFUNC_SEEK_END : + fseek_origin = SEEK_END; + break; + case ZLIB_FILEFUNC_SEEK_SET : + fseek_origin = SEEK_SET; + break; + default: return -1; + } + ret = 0; + if (fseek((FILE *)stream, offset, fseek_origin) != 0) + ret = -1; + return ret; +} + +static long ZCALLBACK fseek64_file_func (voidpf opaque, voidpf stream, ZPOS64_T offset, int origin) +{ +#if (CC_TARGET_PLATFORM == CC_PLATFORM_MARMALADE || CC_TARGET_PLATFORM == CC_PLATFORM_BADA || CC_TARGET_PLATFORM == CC_PLATFORM_BLACKBERRY || CC_TARGET_PLATFORM == CC_PLATFORM_NACL || CC_TARGET_PLATFORM == CC_PLATFORM_EMSCRIPTEN) + return -1; +#else + int fseek_origin=0; + switch (origin) + { + case ZLIB_FILEFUNC_SEEK_CUR : + fseek_origin = SEEK_CUR; + break; + case ZLIB_FILEFUNC_SEEK_END : + fseek_origin = SEEK_END; + break; + case ZLIB_FILEFUNC_SEEK_SET : + fseek_origin = SEEK_SET; + break; + default: return -1; + } + if(fseeko64((FILE *)stream, offset, fseek_origin) != 0) + return -1; + return 0; +#endif +} + + +static int ZCALLBACK fclose_file_func (voidpf opaque, voidpf stream) +{ + int ret; + ret = fclose((FILE *)stream); + return ret; +} + +static int ZCALLBACK ferror_file_func (voidpf opaque, voidpf stream) +{ + int ret; + ret = ferror((FILE *)stream); + return ret; +} + +void fill_fopen_filefunc (zlib_filefunc_def* pzlib_filefunc_def) +{ + pzlib_filefunc_def->zopen_file = fopen_file_func; + pzlib_filefunc_def->zread_file = fread_file_func; + pzlib_filefunc_def->zwrite_file = fwrite_file_func; + pzlib_filefunc_def->ztell_file = ftell_file_func; + pzlib_filefunc_def->zseek_file = fseek_file_func; + pzlib_filefunc_def->zclose_file = fclose_file_func; + pzlib_filefunc_def->zerror_file = ferror_file_func; + pzlib_filefunc_def->opaque = NULL; +} + +void fill_fopen64_filefunc (zlib_filefunc64_def* pzlib_filefunc_def) +{ + pzlib_filefunc_def->zopen64_file = fopen64_file_func; + pzlib_filefunc_def->zread_file = fread_file_func; + pzlib_filefunc_def->zwrite_file = fwrite_file_func; + pzlib_filefunc_def->ztell64_file = ftell64_file_func; + pzlib_filefunc_def->zseek64_file = fseek64_file_func; + pzlib_filefunc_def->zclose_file = fclose_file_func; + pzlib_filefunc_def->zerror_file = ferror_file_func; + pzlib_filefunc_def->opaque = NULL; +} + +} // end of namespace cocos2d diff --git a/external/unzip/ioapi.h b/external/unzip/ioapi.h new file mode 100644 index 0000000000..575f44ece4 --- /dev/null +++ b/external/unzip/ioapi.h @@ -0,0 +1,201 @@ +/* ioapi.h -- IO base function header for compress/uncompress .zip + part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) + + Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) + + Modifications for Zip64 support + Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) + + For more info read MiniZip_info.txt + + Changes + + Oct-2009 - Defined ZPOS64_T to fpos_t on windows and u_int64_t on linux. (might need to find a better why for this) + Oct-2009 - Change to fseeko64, ftello64 and fopen64 so large files would work on linux. + More if/def section may be needed to support other platforms + Oct-2009 - Defined fxxxx64 calls to normal fopen/ftell/fseek so they would compile on windows. + (but you should use iowin32.c for windows instead) + +*/ + +#ifndef _ZLIBIOAPI64_H +#define _ZLIBIOAPI64_H + +#include "platform/CCPlatformConfig.h" + +#if (!defined(_WIN32)) && (!defined(WIN32)) + + // Linux needs this to support file operation on files larger then 4+GB + // But might need better if/def to select just the platforms that needs them. + + #ifndef __USE_FILE_OFFSET64 + #define __USE_FILE_OFFSET64 + #endif + #ifndef __USE_LARGEFILE64 + #define __USE_LARGEFILE64 + #endif + #ifndef _LARGEFILE64_SOURCE + #define _LARGEFILE64_SOURCE + #endif + #ifndef _FILE_OFFSET_BIT + #define _FILE_OFFSET_BIT 64 + #endif +#endif + +#include +#include +#include "zlib.h" + +namespace cocos2d { + +#ifndef OF +#define OF _Z_OF +#endif + +#if defined(USE_FILE32API) +#define fopen64 fopen +#define ftello64 ftell +#define fseeko64 fseek +#else +#ifdef _MSC_VER + #define fopen64 fopen + #if (_MSC_VER >= 1400) && (!(defined(NO_MSCVER_FILE64_FUNC))) + #define ftello64 _ftelli64 + #define fseeko64 _fseeki64 + #else // old MSC + #define ftello64 ftell + #define fseeko64 fseek + #endif +#endif +#endif + +/* +#ifndef ZPOS64_T + #ifdef _WIN32 + #define ZPOS64_T fpos_t + #else + #include + #define ZPOS64_T uint64_t + #endif +#endif +*/ + +#ifdef HAVE_MINIZIP64_CONF_H +#include "mz64conf.h" +#endif + +/* a type chosen by DEFINE */ +#ifdef HAVE_64BIT_INT_CUSTOM +typedef 64BIT_INT_CUSTOM_TYPE ZPOS64_T; +#else +#ifdef HAS_STDINT_H +#include "stdint.h" +typedef uint64_t ZPOS64_T; +#else + + +#if defined(_MSC_VER) || defined(__BORLANDC__) +typedef unsigned __int64 ZPOS64_T; +#else +typedef unsigned long long int ZPOS64_T; +#endif +#endif +#endif + + + +#define ZLIB_FILEFUNC_SEEK_CUR (1) +#define ZLIB_FILEFUNC_SEEK_END (2) +#define ZLIB_FILEFUNC_SEEK_SET (0) + +#define ZLIB_FILEFUNC_MODE_READ (1) +#define ZLIB_FILEFUNC_MODE_WRITE (2) +#define ZLIB_FILEFUNC_MODE_READWRITEFILTER (3) + +#define ZLIB_FILEFUNC_MODE_EXISTING (4) +#define ZLIB_FILEFUNC_MODE_CREATE (8) + + +#ifndef ZCALLBACK + #if (defined(WIN32) || defined(_WIN32) || defined (WINDOWS) || defined (_WINDOWS)) && defined(CALLBACK) && defined (USEWINDOWS_CALLBACK) + #define ZCALLBACK CALLBACK + #else + #define ZCALLBACK + #endif +#endif + + + + +typedef voidpf (ZCALLBACK *open_file_func) OF((voidpf opaque, const char* filename, int mode)); +typedef uLong (ZCALLBACK *read_file_func) OF((voidpf opaque, voidpf stream, void* buf, uLong size)); +typedef uLong (ZCALLBACK *write_file_func) OF((voidpf opaque, voidpf stream, const void* buf, uLong size)); +typedef int (ZCALLBACK *close_file_func) OF((voidpf opaque, voidpf stream)); +typedef int (ZCALLBACK *testerror_file_func) OF((voidpf opaque, voidpf stream)); + +typedef long (ZCALLBACK *tell_file_func) OF((voidpf opaque, voidpf stream)); +typedef long (ZCALLBACK *seek_file_func) OF((voidpf opaque, voidpf stream, uLong offset, int origin)); + + +/* here is the "old" 32 bits structure structure */ +typedef struct zlib_filefunc_def_s +{ + open_file_func zopen_file; + read_file_func zread_file; + write_file_func zwrite_file; + tell_file_func ztell_file; + seek_file_func zseek_file; + close_file_func zclose_file; + testerror_file_func zerror_file; + voidpf opaque; +} zlib_filefunc_def; + +typedef ZPOS64_T (ZCALLBACK *tell64_file_func) OF((voidpf opaque, voidpf stream)); +typedef long (ZCALLBACK *seek64_file_func) OF((voidpf opaque, voidpf stream, ZPOS64_T offset, int origin)); +typedef voidpf (ZCALLBACK *open64_file_func) OF((voidpf opaque, const void* filename, int mode)); + +typedef struct zlib_filefunc64_def_s +{ + open64_file_func zopen64_file; + read_file_func zread_file; + write_file_func zwrite_file; + tell64_file_func ztell64_file; + seek64_file_func zseek64_file; + close_file_func zclose_file; + testerror_file_func zerror_file; + voidpf opaque; +} zlib_filefunc64_def; + +void fill_fopen64_filefunc OF((zlib_filefunc64_def* pzlib_filefunc_def)); +void fill_fopen_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def)); + +/* now internal definition, only for zip.c and unzip.h */ +typedef struct zlib_filefunc64_32_def_s +{ + zlib_filefunc64_def zfile_func64; + open_file_func zopen32_file; + tell_file_func ztell32_file; + seek_file_func zseek32_file; +} zlib_filefunc64_32_def; + + +#define ZREAD64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zread_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size)) +#define ZWRITE64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zwrite_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size)) +//#define ZTELL64(filefunc,filestream) ((*((filefunc).ztell64_file)) ((filefunc).opaque,filestream)) +//#define ZSEEK64(filefunc,filestream,pos,mode) ((*((filefunc).zseek64_file)) ((filefunc).opaque,filestream,pos,mode)) +#define ZCLOSE64(filefunc,filestream) ((*((filefunc).zfile_func64.zclose_file)) ((filefunc).zfile_func64.opaque,filestream)) +#define ZERROR64(filefunc,filestream) ((*((filefunc).zfile_func64.zerror_file)) ((filefunc).zfile_func64.opaque,filestream)) + +voidpf call_zopen64 OF((const zlib_filefunc64_32_def* pfilefunc,const void*filename,int mode)); +long call_zseek64 OF((const zlib_filefunc64_32_def* pfilefunc,voidpf filestream, ZPOS64_T offset, int origin)); +ZPOS64_T call_ztell64 OF((const zlib_filefunc64_32_def* pfilefunc,voidpf filestream)); + +void fill_zlib_filefunc64_32_def_from_filefunc32(zlib_filefunc64_32_def* p_filefunc64_32,const zlib_filefunc_def* p_filefunc32); + +#define ZOPEN64(filefunc,filename,mode) (call_zopen64((&(filefunc)),(filename),(mode))) +#define ZTELL64(filefunc,filestream) (call_ztell64((&(filefunc)),(filestream))) +#define ZSEEK64(filefunc,filestream,pos,mode) (call_zseek64((&(filefunc)),(filestream),(pos),(mode))) + +} // end of namespace cocos2d + +#endif diff --git a/external/unzip/unzip.cpp b/external/unzip/unzip.cpp new file mode 100644 index 0000000000..66cfeff16a --- /dev/null +++ b/external/unzip/unzip.cpp @@ -0,0 +1,2161 @@ +/* unzip.c -- IO for uncompress .zip files using zlib + Version 1.1, February 14h, 2010 + part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) + + Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) + + Modifications of Unzip for Zip64 + Copyright (C) 2007-2008 Even Rouault + + Modifications for Zip64 support on both zip and unzip + Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) + + For more info read MiniZip_info.txt + + + ------------------------------------------------------------------------------------ + Decryption code comes from crypt.c by Info-ZIP but has been greatly reduced in terms of + compatibility with older software. The following is from the original crypt.c. + Code woven in by Terry Thorsen 1/2003. + + Copyright (c) 1990-2000 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html + + crypt.c (full version) by Info-ZIP. Last revised: [see crypt.h] + + The encryption/decryption parts of this source code (as opposed to the + non-echoing password parts) were originally written in Europe. The + whole source package can be freely distributed, including from the USA. + (Prior to January 2000, re-export from the US was a violation of US law.) + + This encryption code is a direct transcription of the algorithm from + Roger Schlafly, described by Phil Katz in the file appnote.txt. This + file (appnote.txt) is distributed with the PKZIP program (even in the + version without encryption capabilities). + + ------------------------------------------------------------------------------------ + + Changes in unzip.c + + 2007-2008 - Even Rouault - Addition of cpl_unzGetCurrentFileZStreamPos + 2007-2008 - Even Rouault - Decoration of symbol names unz* -> cpl_unz* + 2007-2008 - Even Rouault - Remove old C style function prototypes + 2007-2008 - Even Rouault - Add unzip support for ZIP64 + + Copyright (C) 2007-2008 Even Rouault + + + Oct-2009 - Mathias Svensson - Removed cpl_* from symbol names (Even Rouault added them but since this is now moved to a new project (minizip64) I renamed them again). + Oct-2009 - Mathias Svensson - Fixed problem if uncompressed size was > 4G and compressed size was <4G + should only read the compressed/uncompressed size from the Zip64 format if + the size from normal header was 0xFFFFFFFF + Oct-2009 - Mathias Svensson - Applied some bug fixes from patches received from Gilles Vollant + Oct-2009 - Mathias Svensson - Applied support to unzip files with compression method BZIP2 (bzip2 lib is required) + Patch created by Daniel Borca + + Jan-2010 - back to unzip and minizip 1.0 name scheme, with compatibility layer + + Copyright (C) 1998 - 2010 Gilles Vollant, Even Rouault, Mathias Svensson + +*/ + + +#include +#include +#include + +#ifndef NOUNCRYPT + #define NOUNCRYPT +#endif + +#include "zlib.h" +#include "unzip.h" + +#ifdef STDC +# include +# include +# include +#endif +#ifdef NO_ERRNO_H + extern int errno; +#else +# include +#endif + +namespace cocos2d { + +#ifndef local +# define local static +#endif +/* compile with -Dlocal if your debugger can't find static symbols */ + + +#ifndef CASESENSITIVITYDEFAULT_NO +# if !defined(unix) && !defined(CASESENSITIVITYDEFAULT_YES) +# define CASESENSITIVITYDEFAULT_NO +# endif +#endif + + +#ifndef UNZ_BUFSIZE +#define UNZ_BUFSIZE (16384) +#endif + +#ifndef UNZ_MAXFILENAMEINZIP +#define UNZ_MAXFILENAMEINZIP (256) +#endif + +#ifndef ALLOC +# define ALLOC(size) (malloc(size)) +#endif +#ifndef TRYFREE +# define TRYFREE(p) {if (p) free(p);} +#endif + +#define SIZECENTRALDIRITEM (0x2e) +#define SIZEZIPLOCALHEADER (0x1e) + + +const char unz_copyright[] = + " unzip 1.01 Copyright 1998-2004 Gilles Vollant - http://www.winimage.com/zLibDll"; + +/* unz_file_info_interntal contain internal info about a file in zipfile*/ +typedef struct unz_file_info64_internal_s +{ + ZPOS64_T offset_curfile;/* relative offset of local header 8 bytes */ +} unz_file_info64_internal; + + +/* file_in_zip_read_info_s contain internal information about a file in zipfile, + when reading and decompress it */ +typedef struct +{ + char *read_buffer; /* internal buffer for compressed data */ + z_stream stream; /* zLib stream structure for inflate */ + +#ifdef HAVE_BZIP2 + bz_stream bstream; /* bzLib stream structure for bziped */ +#endif + + ZPOS64_T pos_in_zipfile; /* position in byte on the zipfile, for fseek*/ + uLong stream_initialised; /* flag set if stream structure is initialized*/ + + ZPOS64_T offset_local_extrafield;/* offset of the local extra field */ + uInt size_local_extrafield;/* size of the local extra field */ + ZPOS64_T pos_local_extrafield; /* position in the local extra field in read*/ + ZPOS64_T total_out_64; + + uLong crc32; /* crc32 of all data uncompressed */ + uLong crc32_wait; /* crc32 we must obtain after decompress all */ + ZPOS64_T rest_read_compressed; /* number of byte to be decompressed */ + ZPOS64_T rest_read_uncompressed;/*number of byte to be obtained after decomp*/ + zlib_filefunc64_32_def z_filefunc; + voidpf filestream; /* io structure of the zipfile */ + uLong compression_method; /* compression method (0==store) */ + ZPOS64_T byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/ + int raw; +} file_in_zip64_read_info_s; + + +/* unz64_s contain internal information about the zipfile +*/ +typedef struct +{ + zlib_filefunc64_32_def z_filefunc; + int is64bitOpenFunction; + voidpf filestream; /* io structure of the zipfile */ + unz_global_info64 gi; /* public global information */ + ZPOS64_T byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/ + ZPOS64_T num_file; /* number of the current file in the zipfile*/ + ZPOS64_T pos_in_central_dir; /* pos of the current file in the central dir*/ + ZPOS64_T current_file_ok; /* flag about the usability of the current file*/ + ZPOS64_T central_pos; /* position of the beginning of the central dir*/ + + ZPOS64_T size_central_dir; /* size of the central directory */ + ZPOS64_T offset_central_dir; /* offset of start of central directory with + respect to the starting disk number */ + + unz_file_info64 cur_file_info; /* public info about the current file in zip*/ + unz_file_info64_internal cur_file_info_internal; /* private info about it*/ + file_in_zip64_read_info_s* pfile_in_zip_read; /* structure about the current + file if we are decompressing it */ + int encrypted; + + int isZip64; + +# ifndef NOUNCRYPT + unsigned long keys[3]; /* keys defining the pseudo-random sequence */ + const unsigned long* pcrc_32_tab; +# endif +} unz64_s; + + +#ifndef NOUNCRYPT +#include "crypt.h" +#endif + +/* =========================================================================== + Read a byte from a gz_stream; update next_in and avail_in. Return EOF + for end of file. + IN assertion: the stream s has been successfully opened for reading. +*/ + + +local int unz64local_getByte OF(( + const zlib_filefunc64_32_def* pzlib_filefunc_def, + voidpf filestream, + int *pi)); + +local int unz64local_getByte(const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, int *pi) +{ + unsigned char c; + int err = (int)ZREAD64(*pzlib_filefunc_def,filestream,&c,1); + if (err==1) + { + *pi = (int)c; + return UNZ_OK; + } + else + { + if (ZERROR64(*pzlib_filefunc_def,filestream)) + return UNZ_ERRNO; + else + return UNZ_EOF; + } +} + + +/* =========================================================================== + Reads a long in LSB order from the given gz_stream. Sets +*/ +local int unz64local_getShort OF(( + const zlib_filefunc64_32_def* pzlib_filefunc_def, + voidpf filestream, + uLong *pX)); + +local int unz64local_getShort (const zlib_filefunc64_32_def* pzlib_filefunc_def, + voidpf filestream, + uLong *pX) +{ + uLong x ; + int i = 0; + int err; + + err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); + x = (uLong)i; + + if (err==UNZ_OK) + err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); + x |= ((uLong)i)<<8; + + if (err==UNZ_OK) + *pX = x; + else + *pX = 0; + return err; +} + +local int unz64local_getLong OF(( + const zlib_filefunc64_32_def* pzlib_filefunc_def, + voidpf filestream, + uLong *pX)); + +local int unz64local_getLong (const zlib_filefunc64_32_def* pzlib_filefunc_def, + voidpf filestream, + uLong *pX) +{ + uLong x ; + int i = 0; + int err; + + err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); + x = (uLong)i; + + if (err==UNZ_OK) + err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); + x |= ((uLong)i)<<8; + + if (err==UNZ_OK) + err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); + x |= ((uLong)i)<<16; + + if (err==UNZ_OK) + err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); + x += ((uLong)i)<<24; + + if (err==UNZ_OK) + *pX = x; + else + *pX = 0; + return err; +} + +local int unz64local_getLong64 OF(( + const zlib_filefunc64_32_def* pzlib_filefunc_def, + voidpf filestream, + ZPOS64_T *pX)); + + +local int unz64local_getLong64 (const zlib_filefunc64_32_def* pzlib_filefunc_def, + voidpf filestream, + ZPOS64_T *pX) +{ + ZPOS64_T x ; + int i = 0; + int err; + + err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); + x = (ZPOS64_T)i; + + if (err==UNZ_OK) + err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); + x |= ((ZPOS64_T)i)<<8; + + if (err==UNZ_OK) + err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); + x |= ((ZPOS64_T)i)<<16; + + if (err==UNZ_OK) + err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); + x |= ((ZPOS64_T)i)<<24; + + if (err==UNZ_OK) + err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); + x |= ((ZPOS64_T)i)<<32; + + if (err==UNZ_OK) + err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); + x |= ((ZPOS64_T)i)<<40; + + if (err==UNZ_OK) + err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); + x |= ((ZPOS64_T)i)<<48; + + if (err==UNZ_OK) + err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); + x |= ((ZPOS64_T)i)<<56; + + if (err==UNZ_OK) + *pX = x; + else + *pX = 0; + return err; +} + +/* My own strcmpi / strcasecmp */ +local int strcmpcasenosensitive_internal (const char* fileName1, const char* fileName2) +{ + for (;;) + { + char c1=*(fileName1++); + char c2=*(fileName2++); + if ((c1>='a') && (c1<='z')) + c1 -= 0x20; + if ((c2>='a') && (c2<='z')) + c2 -= 0x20; + if (c1=='\0') + return ((c2=='\0') ? 0 : -1); + if (c2=='\0') + return 1; + if (c1c2) + return 1; + } +} + + +#ifdef CASESENSITIVITYDEFAULT_NO +#define CASESENSITIVITYDEFAULTVALUE 2 +#else +#define CASESENSITIVITYDEFAULTVALUE 1 +#endif + +#ifndef STRCMPCASENOSENTIVEFUNCTION +#define STRCMPCASENOSENTIVEFUNCTION strcmpcasenosensitive_internal +#endif + +/* + Compare two filename (fileName1,fileName2). + If iCaseSenisivity = 1, comparison is case sensitivity (like strcmp) + If iCaseSenisivity = 2, comparison is not case sensitivity (like strcmpi + or strcasecmp) + If iCaseSenisivity = 0, case sensitivity is default of your operating system + (like 1 on Unix, 2 on Windows) + +*/ +int ZEXPORT unzStringFileNameCompare (const char* fileName1, + const char* fileName2, + int iCaseSensitivity) + +{ + if (iCaseSensitivity==0) + iCaseSensitivity=CASESENSITIVITYDEFAULTVALUE; + + if (iCaseSensitivity==1) + return strcmp(fileName1,fileName2); + + return STRCMPCASENOSENTIVEFUNCTION(fileName1,fileName2); +} + +#ifndef BUFREADCOMMENT +#define BUFREADCOMMENT (0x400) +#endif + +/* + Locate the Central directory of a zipfile (at the end, just before + the global comment) +*/ +local ZPOS64_T unz64local_SearchCentralDir OF((const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream)); +local ZPOS64_T unz64local_SearchCentralDir(const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream) +{ + unsigned char* buf; + ZPOS64_T uSizeFile; + ZPOS64_T uBackRead; + ZPOS64_T uMaxBack=0xffff; /* maximum size of global comment */ + ZPOS64_T uPosFound=0; + + if (ZSEEK64(*pzlib_filefunc_def,filestream,0,ZLIB_FILEFUNC_SEEK_END) != 0) + return 0; + + + uSizeFile = ZTELL64(*pzlib_filefunc_def,filestream); + + if (uMaxBack>uSizeFile) + uMaxBack = uSizeFile; + + buf = (unsigned char*)ALLOC(BUFREADCOMMENT+4); + if (buf==NULL) + return 0; + + uBackRead = 4; + while (uBackReaduMaxBack) + uBackRead = uMaxBack; + else + uBackRead+=BUFREADCOMMENT; + uReadPos = uSizeFile-uBackRead ; + + uReadSize = ((BUFREADCOMMENT+4) < (uSizeFile-uReadPos)) ? + (BUFREADCOMMENT+4) : (uLong)(uSizeFile-uReadPos); + if (ZSEEK64(*pzlib_filefunc_def,filestream,uReadPos,ZLIB_FILEFUNC_SEEK_SET)!=0) + break; + + if (ZREAD64(*pzlib_filefunc_def,filestream,buf,uReadSize)!=uReadSize) + break; + + for (i=(int)uReadSize-3; (i--)>0;) + if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) && + ((*(buf+i+2))==0x05) && ((*(buf+i+3))==0x06)) + { + uPosFound = uReadPos+i; + break; + } + + if (uPosFound!=0) + break; + } + TRYFREE(buf); + return uPosFound; +} + + +/* + Locate the Central directory 64 of a zipfile (at the end, just before + the global comment) +*/ +local ZPOS64_T unz64local_SearchCentralDir64 OF(( + const zlib_filefunc64_32_def* pzlib_filefunc_def, + voidpf filestream)); + +local ZPOS64_T unz64local_SearchCentralDir64(const zlib_filefunc64_32_def* pzlib_filefunc_def, + voidpf filestream) +{ + unsigned char* buf; + ZPOS64_T uSizeFile; + ZPOS64_T uBackRead; + ZPOS64_T uMaxBack=0xffff; /* maximum size of global comment */ + ZPOS64_T uPosFound=0; + uLong uL; + ZPOS64_T relativeOffset; + + if (ZSEEK64(*pzlib_filefunc_def,filestream,0,ZLIB_FILEFUNC_SEEK_END) != 0) + return 0; + + + uSizeFile = ZTELL64(*pzlib_filefunc_def,filestream); + + if (uMaxBack>uSizeFile) + uMaxBack = uSizeFile; + + buf = (unsigned char*)ALLOC(BUFREADCOMMENT+4); + if (buf==NULL) + return 0; + + uBackRead = 4; + while (uBackReaduMaxBack) + uBackRead = uMaxBack; + else + uBackRead+=BUFREADCOMMENT; + uReadPos = uSizeFile-uBackRead ; + + uReadSize = ((BUFREADCOMMENT+4) < (uSizeFile-uReadPos)) ? + (BUFREADCOMMENT+4) : (uLong)(uSizeFile-uReadPos); + if (ZSEEK64(*pzlib_filefunc_def,filestream,uReadPos,ZLIB_FILEFUNC_SEEK_SET)!=0) + break; + + if (ZREAD64(*pzlib_filefunc_def,filestream,buf,uReadSize)!=uReadSize) + break; + + for (i=(int)uReadSize-3; (i--)>0;) + if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) && + ((*(buf+i+2))==0x06) && ((*(buf+i+3))==0x07)) + { + uPosFound = uReadPos+i; + break; + } + + if (uPosFound!=0) + break; + } + TRYFREE(buf); + if (uPosFound == 0) + return 0; + + /* Zip64 end of central directory locator */ + if (ZSEEK64(*pzlib_filefunc_def,filestream, uPosFound,ZLIB_FILEFUNC_SEEK_SET)!=0) + return 0; + + /* the signature, already checked */ + if (unz64local_getLong(pzlib_filefunc_def,filestream,&uL)!=UNZ_OK) + return 0; + + /* number of the disk with the start of the zip64 end of central directory */ + if (unz64local_getLong(pzlib_filefunc_def,filestream,&uL)!=UNZ_OK) + return 0; + if (uL != 0) + return 0; + + /* relative offset of the zip64 end of central directory record */ + if (unz64local_getLong64(pzlib_filefunc_def,filestream,&relativeOffset)!=UNZ_OK) + return 0; + + /* total number of disks */ + if (unz64local_getLong(pzlib_filefunc_def,filestream,&uL)!=UNZ_OK) + return 0; + if (uL != 1) + return 0; + + /* Goto end of central directory record */ + if (ZSEEK64(*pzlib_filefunc_def,filestream, relativeOffset,ZLIB_FILEFUNC_SEEK_SET)!=0) + return 0; + + /* the signature */ + if (unz64local_getLong(pzlib_filefunc_def,filestream,&uL)!=UNZ_OK) + return 0; + + if (uL != 0x06064b50) + return 0; + + return relativeOffset; +} + +/* + Open a Zip file. path contain the full pathname (by example, + on a Windows NT computer "c:\\test\\zlib114.zip" or on an Unix computer + "zlib/zlib114.zip". + If the zipfile cannot be opened (file doesn't exist or in not valid), the + return value is NULL. + Else, the return value is a unzFile Handle, usable with other function + of this unzip package. +*/ +local unzFile unzOpenInternal (const void *path, + zlib_filefunc64_32_def* pzlib_filefunc64_32_def, + int is64bitOpenFunction) +{ + unz64_s us; + unz64_s *s; + ZPOS64_T central_pos; + uLong uL; + + uLong number_disk; /* number of the current dist, used for + spanning ZIP, unsupported, always 0*/ + uLong number_disk_with_CD; /* number the the disk with central dir, used + for spanning ZIP, unsupported, always 0*/ + ZPOS64_T number_entry_CD; /* total number of entries in + the central dir + (same than number_entry on nospan) */ + + int err=UNZ_OK; + + if (unz_copyright[0]!=' ') + return NULL; + + us.z_filefunc.zseek32_file = NULL; + us.z_filefunc.ztell32_file = NULL; + if (pzlib_filefunc64_32_def==NULL) + fill_fopen64_filefunc(&us.z_filefunc.zfile_func64); + else + us.z_filefunc = *pzlib_filefunc64_32_def; + us.is64bitOpenFunction = is64bitOpenFunction; + + + + us.filestream = ZOPEN64(us.z_filefunc, + path, + ZLIB_FILEFUNC_MODE_READ | + ZLIB_FILEFUNC_MODE_EXISTING); + if (us.filestream==NULL) + return NULL; + + central_pos = unz64local_SearchCentralDir64(&us.z_filefunc,us.filestream); + if (central_pos) + { + uLong uS; + ZPOS64_T uL64; + + us.isZip64 = 1; + + if (ZSEEK64(us.z_filefunc, us.filestream, + central_pos,ZLIB_FILEFUNC_SEEK_SET)!=0) + err=UNZ_ERRNO; + + /* the signature, already checked */ + if (unz64local_getLong(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK) + err=UNZ_ERRNO; + + /* size of zip64 end of central directory record */ + if (unz64local_getLong64(&us.z_filefunc, us.filestream,&uL64)!=UNZ_OK) + err=UNZ_ERRNO; + + /* version made by */ + if (unz64local_getShort(&us.z_filefunc, us.filestream,&uS)!=UNZ_OK) + err=UNZ_ERRNO; + + /* version needed to extract */ + if (unz64local_getShort(&us.z_filefunc, us.filestream,&uS)!=UNZ_OK) + err=UNZ_ERRNO; + + /* number of this disk */ + if (unz64local_getLong(&us.z_filefunc, us.filestream,&number_disk)!=UNZ_OK) + err=UNZ_ERRNO; + + /* number of the disk with the start of the central directory */ + if (unz64local_getLong(&us.z_filefunc, us.filestream,&number_disk_with_CD)!=UNZ_OK) + err=UNZ_ERRNO; + + /* total number of entries in the central directory on this disk */ + if (unz64local_getLong64(&us.z_filefunc, us.filestream,&us.gi.number_entry)!=UNZ_OK) + err=UNZ_ERRNO; + + /* total number of entries in the central directory */ + if (unz64local_getLong64(&us.z_filefunc, us.filestream,&number_entry_CD)!=UNZ_OK) + err=UNZ_ERRNO; + + if ((number_entry_CD!=us.gi.number_entry) || + (number_disk_with_CD!=0) || + (number_disk!=0)) + err=UNZ_BADZIPFILE; + + /* size of the central directory */ + if (unz64local_getLong64(&us.z_filefunc, us.filestream,&us.size_central_dir)!=UNZ_OK) + err=UNZ_ERRNO; + + /* offset of start of central directory with respect to the + starting disk number */ + if (unz64local_getLong64(&us.z_filefunc, us.filestream,&us.offset_central_dir)!=UNZ_OK) + err=UNZ_ERRNO; + + us.gi.size_comment = 0; + } + else + { + central_pos = unz64local_SearchCentralDir(&us.z_filefunc,us.filestream); + if (central_pos==0) + err=UNZ_ERRNO; + + us.isZip64 = 0; + + if (ZSEEK64(us.z_filefunc, us.filestream, + central_pos,ZLIB_FILEFUNC_SEEK_SET)!=0) + err=UNZ_ERRNO; + + /* the signature, already checked */ + if (unz64local_getLong(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK) + err=UNZ_ERRNO; + + /* number of this disk */ + if (unz64local_getShort(&us.z_filefunc, us.filestream,&number_disk)!=UNZ_OK) + err=UNZ_ERRNO; + + /* number of the disk with the start of the central directory */ + if (unz64local_getShort(&us.z_filefunc, us.filestream,&number_disk_with_CD)!=UNZ_OK) + err=UNZ_ERRNO; + + /* total number of entries in the central dir on this disk */ + if (unz64local_getShort(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK) + err=UNZ_ERRNO; + us.gi.number_entry = uL; + + /* total number of entries in the central dir */ + if (unz64local_getShort(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK) + err=UNZ_ERRNO; + number_entry_CD = uL; + + if ((number_entry_CD!=us.gi.number_entry) || + (number_disk_with_CD!=0) || + (number_disk!=0)) + err=UNZ_BADZIPFILE; + + /* size of the central directory */ + if (unz64local_getLong(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK) + err=UNZ_ERRNO; + us.size_central_dir = uL; + + /* offset of start of central directory with respect to the + starting disk number */ + if (unz64local_getLong(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK) + err=UNZ_ERRNO; + us.offset_central_dir = uL; + + /* zipfile comment length */ + if (unz64local_getShort(&us.z_filefunc, us.filestream,&us.gi.size_comment)!=UNZ_OK) + err=UNZ_ERRNO; + } + + if ((central_pospfile_in_zip_read!=NULL) + unzCloseCurrentFile(file); + + ZCLOSE64(s->z_filefunc, s->filestream); + TRYFREE(s); + return UNZ_OK; +} + + +/* + Write info about the ZipFile in the *pglobal_info structure. + No preparation of the structure is needed + return UNZ_OK if there is no problem. */ +int ZEXPORT unzGetGlobalInfo64 (unzFile file, unz_global_info64* pglobal_info) +{ + unz64_s* s; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz64_s*)file; + *pglobal_info=s->gi; + return UNZ_OK; +} + +int ZEXPORT unzGetGlobalInfo (unzFile file, unz_global_info* pglobal_info32) +{ + unz64_s* s; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz64_s*)file; + /* to do : check if number_entry is not truncated */ + pglobal_info32->number_entry = (uLong)s->gi.number_entry; + pglobal_info32->size_comment = s->gi.size_comment; + return UNZ_OK; +} +/* + Translate date/time from Dos format to tm_unz (readable more easily) +*/ +local void unz64local_DosDateToTmuDate (ZPOS64_T ulDosDate, tm_unz* ptm) +{ + ZPOS64_T uDate; + uDate = (ZPOS64_T)(ulDosDate>>16); + ptm->tm_mday = (uInt)(uDate&0x1f) ; + ptm->tm_mon = (uInt)((((uDate)&0x1E0)/0x20)-1) ; + ptm->tm_year = (uInt)(((uDate&0x0FE00)/0x0200)+1980) ; + + ptm->tm_hour = (uInt) ((ulDosDate &0xF800)/0x800); + ptm->tm_min = (uInt) ((ulDosDate&0x7E0)/0x20) ; + ptm->tm_sec = (uInt) (2*(ulDosDate&0x1f)) ; +} + +/* + Get Info about the current file in the zipfile, with internal only info +*/ +local int unz64local_GetCurrentFileInfoInternal OF((unzFile file, + unz_file_info64 *pfile_info, + unz_file_info64_internal + *pfile_info_internal, + char *szFileName, + uLong fileNameBufferSize, + void *extraField, + uLong extraFieldBufferSize, + char *szComment, + uLong commentBufferSize)); + +local int unz64local_GetCurrentFileInfoInternal (unzFile file, + unz_file_info64 *pfile_info, + unz_file_info64_internal + *pfile_info_internal, + char *szFileName, + uLong fileNameBufferSize, + void *extraField, + uLong extraFieldBufferSize, + char *szComment, + uLong commentBufferSize) +{ + unz64_s* s; + unz_file_info64 file_info; + unz_file_info64_internal file_info_internal; + int err=UNZ_OK; + uLong uMagic; + long lSeek=0; + uLong uL; + + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz64_s*)file; + if (ZSEEK64(s->z_filefunc, s->filestream, + s->pos_in_central_dir+s->byte_before_the_zipfile, + ZLIB_FILEFUNC_SEEK_SET)!=0) + err=UNZ_ERRNO; + + + /* we check the magic */ + if (err==UNZ_OK) + { + if (unz64local_getLong(&s->z_filefunc, s->filestream,&uMagic) != UNZ_OK) + err=UNZ_ERRNO; + else if (uMagic!=0x02014b50) + err=UNZ_BADZIPFILE; + } + + if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.version) != UNZ_OK) + err=UNZ_ERRNO; + + if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.version_needed) != UNZ_OK) + err=UNZ_ERRNO; + + if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.flag) != UNZ_OK) + err=UNZ_ERRNO; + + if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.compression_method) != UNZ_OK) + err=UNZ_ERRNO; + + if (unz64local_getLong(&s->z_filefunc, s->filestream,&file_info.dosDate) != UNZ_OK) + err=UNZ_ERRNO; + + unz64local_DosDateToTmuDate(file_info.dosDate,&file_info.tmu_date); + + if (unz64local_getLong(&s->z_filefunc, s->filestream,&file_info.crc) != UNZ_OK) + err=UNZ_ERRNO; + + if (unz64local_getLong(&s->z_filefunc, s->filestream,&uL) != UNZ_OK) + err=UNZ_ERRNO; + file_info.compressed_size = uL; + + if (unz64local_getLong(&s->z_filefunc, s->filestream,&uL) != UNZ_OK) + err=UNZ_ERRNO; + file_info.uncompressed_size = uL; + + if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.size_filename) != UNZ_OK) + err=UNZ_ERRNO; + + if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.size_file_extra) != UNZ_OK) + err=UNZ_ERRNO; + + if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.size_file_comment) != UNZ_OK) + err=UNZ_ERRNO; + + if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.disk_num_start) != UNZ_OK) + err=UNZ_ERRNO; + + if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.internal_fa) != UNZ_OK) + err=UNZ_ERRNO; + + if (unz64local_getLong(&s->z_filefunc, s->filestream,&file_info.external_fa) != UNZ_OK) + err=UNZ_ERRNO; + + // relative offset of local header + if (unz64local_getLong(&s->z_filefunc, s->filestream,&uL) != UNZ_OK) + err=UNZ_ERRNO; + file_info_internal.offset_curfile = uL; + + lSeek+=file_info.size_filename; + if ((err==UNZ_OK) && (szFileName!=NULL)) + { + uLong uSizeRead ; + if (file_info.size_filename0) && (fileNameBufferSize>0)) + if (ZREAD64(s->z_filefunc, s->filestream,szFileName,uSizeRead)!=uSizeRead) + err=UNZ_ERRNO; + lSeek -= uSizeRead; + } + + // Read extrafield + if ((err==UNZ_OK) && (extraField!=NULL)) + { + ZPOS64_T uSizeRead ; + if (file_info.size_file_extraz_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0) + lSeek=0; + else + err=UNZ_ERRNO; + } + + if ((file_info.size_file_extra>0) && (extraFieldBufferSize>0)) + if (ZREAD64(s->z_filefunc, s->filestream,extraField,(uLong)uSizeRead)!=uSizeRead) + err=UNZ_ERRNO; + + lSeek += file_info.size_file_extra - (uLong)uSizeRead; + } + else + lSeek += file_info.size_file_extra; + + + if ((err==UNZ_OK) && (file_info.size_file_extra != 0)) + { + uLong acc = 0; + + // since lSeek now points to after the extra field we need to move back + lSeek -= file_info.size_file_extra; + + if (lSeek!=0) + { + if (ZSEEK64(s->z_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0) + lSeek=0; + else + err=UNZ_ERRNO; + } + + while(acc < file_info.size_file_extra) + { + uLong headerId; + uLong dataSize; + + if (unz64local_getShort(&s->z_filefunc, s->filestream,&headerId) != UNZ_OK) + err=UNZ_ERRNO; + + if (unz64local_getShort(&s->z_filefunc, s->filestream,&dataSize) != UNZ_OK) + err=UNZ_ERRNO; + + /* ZIP64 extra fields */ + if (headerId == 0x0001) + { + uLong uL; + + if(file_info.uncompressed_size == (ZPOS64_T)(unsigned long)-1) + { + if (unz64local_getLong64(&s->z_filefunc, s->filestream,&file_info.uncompressed_size) != UNZ_OK) + err=UNZ_ERRNO; + } + + if(file_info.compressed_size == (ZPOS64_T)(unsigned long)-1) + { + if (unz64local_getLong64(&s->z_filefunc, s->filestream,&file_info.compressed_size) != UNZ_OK) + err=UNZ_ERRNO; + } + + if(file_info_internal.offset_curfile == (ZPOS64_T)(unsigned long)-1) + { + /* Relative Header offset */ + if (unz64local_getLong64(&s->z_filefunc, s->filestream,&file_info_internal.offset_curfile) != UNZ_OK) + err=UNZ_ERRNO; + } + + if(file_info.disk_num_start == (unsigned long)-1) + { + /* Disk Start Number */ + if (unz64local_getLong(&s->z_filefunc, s->filestream,&uL) != UNZ_OK) + err=UNZ_ERRNO; + } + + } + else + { + if (ZSEEK64(s->z_filefunc, s->filestream,dataSize,ZLIB_FILEFUNC_SEEK_CUR)!=0) + err=UNZ_ERRNO; + } + + acc += 2 + 2 + dataSize; + } + } + + if ((err==UNZ_OK) && (szComment!=NULL)) + { + uLong uSizeRead ; + if (file_info.size_file_commentz_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0) { + //lSeek=0; + } + else + err=UNZ_ERRNO; + } + + if ((file_info.size_file_comment>0) && (commentBufferSize>0)) + if (ZREAD64(s->z_filefunc, s->filestream,szComment,uSizeRead)!=uSizeRead) + err=UNZ_ERRNO; + //lSeek+=file_info.size_file_comment - uSizeRead; + } + //else + // lSeek+=file_info.size_file_comment; + + + if ((err==UNZ_OK) && (pfile_info!=NULL)) + *pfile_info=file_info; + + if ((err==UNZ_OK) && (pfile_info_internal!=NULL)) + *pfile_info_internal=file_info_internal; + + return err; +} + + + +/* + Write info about the ZipFile in the *pglobal_info structure. + No preparation of the structure is needed + return UNZ_OK if there is no problem. +*/ +int ZEXPORT unzGetCurrentFileInfo64 (unzFile file, + unz_file_info64 * pfile_info, + char * szFileName, uLong fileNameBufferSize, + void *extraField, uLong extraFieldBufferSize, + char* szComment, uLong commentBufferSize) +{ + return unz64local_GetCurrentFileInfoInternal(file,pfile_info,NULL, + szFileName,fileNameBufferSize, + extraField,extraFieldBufferSize, + szComment,commentBufferSize); +} + +int ZEXPORT unzGetCurrentFileInfo (unzFile file, + unz_file_info * pfile_info, + char * szFileName, uLong fileNameBufferSize, + void *extraField, uLong extraFieldBufferSize, + char* szComment, uLong commentBufferSize) +{ + int err; + unz_file_info64 file_info64; + err = unz64local_GetCurrentFileInfoInternal(file,&file_info64,NULL, + szFileName,fileNameBufferSize, + extraField,extraFieldBufferSize, + szComment,commentBufferSize); + if (err==UNZ_OK) + { + pfile_info->version = file_info64.version; + pfile_info->version_needed = file_info64.version_needed; + pfile_info->flag = file_info64.flag; + pfile_info->compression_method = file_info64.compression_method; + pfile_info->dosDate = file_info64.dosDate; + pfile_info->crc = file_info64.crc; + + pfile_info->size_filename = file_info64.size_filename; + pfile_info->size_file_extra = file_info64.size_file_extra; + pfile_info->size_file_comment = file_info64.size_file_comment; + + pfile_info->disk_num_start = file_info64.disk_num_start; + pfile_info->internal_fa = file_info64.internal_fa; + pfile_info->external_fa = file_info64.external_fa; + + pfile_info->tmu_date = file_info64.tmu_date, + + + pfile_info->compressed_size = (uLong)file_info64.compressed_size; + pfile_info->uncompressed_size = (uLong)file_info64.uncompressed_size; + + } + return err; +} + +/* + Set the current file of the zipfile to the first file + with retrieving an information about the file. + return UNZ_OK if there is no problem +*/ +int ZEXPORT unzGoToFirstFile64 (unzFile file, + unz_file_info64 *pfile_info, + char *szFileName, + uLong fileNameBufferSize) +{ + int err=UNZ_OK; + unz64_s* s; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz64_s*)file; + s->pos_in_central_dir=s->offset_central_dir; + s->num_file=0; + err=unz64local_GetCurrentFileInfoInternal(file,&s->cur_file_info, + &s->cur_file_info_internal, + szFileName,fileNameBufferSize,NULL,0,NULL,0); + s->current_file_ok = (err == UNZ_OK); + if (pfile_info) + *pfile_info = s->cur_file_info; + return err; +} + +/* + Set the current file of the zipfile to the first file. + return UNZ_OK if there is no problem +*/ +int ZEXPORT unzGoToFirstFile (unzFile file) +{ + return unzGoToFirstFile64(file, NULL, NULL, 0); +} + +/* + Set the current file of the zipfile to the next file + with retrieving an information about the file. + return UNZ_OK if there is no problem + return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest. +*/ +int ZEXPORT unzGoToNextFile64 (unzFile file, + unz_file_info64 *pfile_info, + char *szFileName, + uLong fileNameBufferSize) +{ + unz64_s* s; + int err; + + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz64_s*)file; + if (!s->current_file_ok) + return UNZ_END_OF_LIST_OF_FILE; + if (s->gi.number_entry != 0xffff) /* 2^16 files overflow hack */ + if (s->num_file+1==s->gi.number_entry) + return UNZ_END_OF_LIST_OF_FILE; + + s->pos_in_central_dir += SIZECENTRALDIRITEM + s->cur_file_info.size_filename + + s->cur_file_info.size_file_extra + s->cur_file_info.size_file_comment ; + s->num_file++; + err = unz64local_GetCurrentFileInfoInternal(file,&s->cur_file_info, + &s->cur_file_info_internal, + szFileName,fileNameBufferSize,NULL,0,NULL,0); + s->current_file_ok = (err == UNZ_OK); + if (pfile_info) + *pfile_info = s->cur_file_info; + return err; +} + +/* + Set the current file of the zipfile to the next file. + return UNZ_OK if there is no problem + return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest. +*/ +int ZEXPORT unzGoToNextFile (unzFile file) +{ + return unzGoToNextFile64(file, NULL, NULL, 0); +} + + +/* + Try locate the file szFileName in the zipfile. + For the iCaseSensitivity signification, see unzipStringFileNameCompare + + return value : + UNZ_OK if the file is found. It becomes the current file. + UNZ_END_OF_LIST_OF_FILE if the file is not found +*/ +int ZEXPORT unzLocateFile (unzFile file, const char *szFileName, int iCaseSensitivity) +{ + unz64_s* s; + int err; + + /* We remember the 'current' position in the file so that we can jump + * back there if we fail. + */ + unz_file_info64 cur_file_infoSaved; + unz_file_info64_internal cur_file_info_internalSaved; + ZPOS64_T num_fileSaved; + ZPOS64_T pos_in_central_dirSaved; + + + if (file==NULL) + return UNZ_PARAMERROR; + + if (strlen(szFileName)>=UNZ_MAXFILENAMEINZIP) + return UNZ_PARAMERROR; + + s=(unz64_s*)file; + if (!s->current_file_ok) + return UNZ_END_OF_LIST_OF_FILE; + + /* Save the current state */ + num_fileSaved = s->num_file; + pos_in_central_dirSaved = s->pos_in_central_dir; + cur_file_infoSaved = s->cur_file_info; + cur_file_info_internalSaved = s->cur_file_info_internal; + + err = unzGoToFirstFile(file); + + while (err == UNZ_OK) + { + char szCurrentFileName[UNZ_MAXFILENAMEINZIP+1]; + err = unzGetCurrentFileInfo64(file,NULL, + szCurrentFileName,sizeof(szCurrentFileName)-1, + NULL,0,NULL,0); + if (err == UNZ_OK) + { + if (unzStringFileNameCompare(szCurrentFileName, + szFileName,iCaseSensitivity)==0) + return UNZ_OK; + err = unzGoToNextFile(file); + } + } + + /* We failed, so restore the state of the 'current file' to where we + * were. + */ + s->num_file = num_fileSaved ; + s->pos_in_central_dir = pos_in_central_dirSaved ; + s->cur_file_info = cur_file_infoSaved; + s->cur_file_info_internal = cur_file_info_internalSaved; + return err; +} + + +/* +/////////////////////////////////////////// +// Contributed by Ryan Haksi (mailto://cryogen@infoserve.net) +// I need random access +// +// Further optimization could be realized by adding an ability +// to cache the directory in memory. The goal being a single +// comprehensive file read to put the file I need in a memory. +*/ + +/* +typedef struct unz_file_pos_s +{ + ZPOS64_T pos_in_zip_directory; // offset in file + ZPOS64_T num_of_file; // # of file +} unz_file_pos; +*/ + +int ZEXPORT unzGetFilePos64(unzFile file, unz64_file_pos* file_pos) +{ + unz64_s* s; + + if (file==NULL || file_pos==NULL) + return UNZ_PARAMERROR; + s=(unz64_s*)file; + if (!s->current_file_ok) + return UNZ_END_OF_LIST_OF_FILE; + + file_pos->pos_in_zip_directory = s->pos_in_central_dir; + file_pos->num_of_file = s->num_file; + + return UNZ_OK; +} + +int ZEXPORT unzGetFilePos( + unzFile file, + unz_file_pos* file_pos) +{ + unz64_file_pos file_pos64; + int err = unzGetFilePos64(file,&file_pos64); + if (err==UNZ_OK) + { + file_pos->pos_in_zip_directory = (uLong)file_pos64.pos_in_zip_directory; + file_pos->num_of_file = (uLong)file_pos64.num_of_file; + } + return err; +} + +int ZEXPORT unzGoToFilePos64(unzFile file, const unz64_file_pos* file_pos) +{ + unz64_s* s; + int err; + + if (file==NULL || file_pos==NULL) + return UNZ_PARAMERROR; + s=(unz64_s*)file; + + /* jump to the right spot */ + s->pos_in_central_dir = file_pos->pos_in_zip_directory; + s->num_file = file_pos->num_of_file; + + /* set the current file */ + err = unz64local_GetCurrentFileInfoInternal(file,&s->cur_file_info, + &s->cur_file_info_internal, + NULL,0,NULL,0,NULL,0); + /* return results */ + s->current_file_ok = (err == UNZ_OK); + return err; +} + +int ZEXPORT unzGoToFilePos( + unzFile file, + unz_file_pos* file_pos) +{ + unz64_file_pos file_pos64; + if (file_pos == NULL) + return UNZ_PARAMERROR; + + file_pos64.pos_in_zip_directory = file_pos->pos_in_zip_directory; + file_pos64.num_of_file = file_pos->num_of_file; + return unzGoToFilePos64(file,&file_pos64); +} + +/* +// Unzip Helper Functions - should be here? +/////////////////////////////////////////// +*/ + +/* + Read the local header of the current zipfile + Check the coherency of the local header and info in the end of central + directory about this file + store in *piSizeVar the size of extra info in local header + (filename and size of extra field data) +*/ +local int unz64local_CheckCurrentFileCoherencyHeader (unz64_s* s, uInt* piSizeVar, + ZPOS64_T * poffset_local_extrafield, + uInt * psize_local_extrafield) +{ + uLong uMagic,uData,uFlags; + uLong size_filename; + uLong size_extra_field; + int err=UNZ_OK; + + *piSizeVar = 0; + *poffset_local_extrafield = 0; + *psize_local_extrafield = 0; + + if (ZSEEK64(s->z_filefunc, s->filestream,s->cur_file_info_internal.offset_curfile + + s->byte_before_the_zipfile,ZLIB_FILEFUNC_SEEK_SET)!=0) + return UNZ_ERRNO; + + + if (err==UNZ_OK) + { + if (unz64local_getLong(&s->z_filefunc, s->filestream,&uMagic) != UNZ_OK) + err=UNZ_ERRNO; + else if (uMagic!=0x04034b50) + err=UNZ_BADZIPFILE; + } + + if (unz64local_getShort(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) + err=UNZ_ERRNO; +/* + else if ((err==UNZ_OK) && (uData!=s->cur_file_info.wVersion)) + err=UNZ_BADZIPFILE; +*/ + if (unz64local_getShort(&s->z_filefunc, s->filestream,&uFlags) != UNZ_OK) + err=UNZ_ERRNO; + + if (unz64local_getShort(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) + err=UNZ_ERRNO; + else if ((err==UNZ_OK) && (uData!=s->cur_file_info.compression_method)) + err=UNZ_BADZIPFILE; + + if ((err==UNZ_OK) && (s->cur_file_info.compression_method!=0) && +/* #ifdef HAVE_BZIP2 */ + (s->cur_file_info.compression_method!=Z_BZIP2ED) && +/* #endif */ + (s->cur_file_info.compression_method!=Z_DEFLATED)) + err=UNZ_BADZIPFILE; + + if (unz64local_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* date/time */ + err=UNZ_ERRNO; + + if (unz64local_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* crc */ + err=UNZ_ERRNO; + else if ((err==UNZ_OK) && (uData!=s->cur_file_info.crc) && ((uFlags & 8)==0)) + err=UNZ_BADZIPFILE; + + if (unz64local_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* size compr */ + err=UNZ_ERRNO; + else if (uData != 0xFFFFFFFF && (err==UNZ_OK) && (uData!=s->cur_file_info.compressed_size) && ((uFlags & 8)==0)) + err=UNZ_BADZIPFILE; + + if (unz64local_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* size uncompr */ + err=UNZ_ERRNO; + else if (uData != 0xFFFFFFFF && (err==UNZ_OK) && (uData!=s->cur_file_info.uncompressed_size) && ((uFlags & 8)==0)) + err=UNZ_BADZIPFILE; + + if (unz64local_getShort(&s->z_filefunc, s->filestream,&size_filename) != UNZ_OK) + err=UNZ_ERRNO; + else if ((err==UNZ_OK) && (size_filename!=s->cur_file_info.size_filename)) + err=UNZ_BADZIPFILE; + + *piSizeVar += (uInt)size_filename; + + if (unz64local_getShort(&s->z_filefunc, s->filestream,&size_extra_field) != UNZ_OK) + err=UNZ_ERRNO; + *poffset_local_extrafield= s->cur_file_info_internal.offset_curfile + + SIZEZIPLOCALHEADER + size_filename; + *psize_local_extrafield = (uInt)size_extra_field; + + *piSizeVar += (uInt)size_extra_field; + + return err; +} + +/* + Open for reading data the current file in the zipfile. + If there is no error and the file is opened, the return value is UNZ_OK. +*/ +int ZEXPORT unzOpenCurrentFile3 (unzFile file, int* method, + int* level, int raw, const char* password) +{ + int err=UNZ_OK; + uInt iSizeVar; + unz64_s* s; + file_in_zip64_read_info_s* pfile_in_zip_read_info; + ZPOS64_T offset_local_extrafield; /* offset of the local extra field */ + uInt size_local_extrafield; /* size of the local extra field */ +# ifndef NOUNCRYPT + char source[12]; +# else + if (password != NULL) + return UNZ_PARAMERROR; +# endif + + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz64_s*)file; + if (!s->current_file_ok) + return UNZ_PARAMERROR; + + if (s->pfile_in_zip_read != NULL) + unzCloseCurrentFile(file); + + if (unz64local_CheckCurrentFileCoherencyHeader(s,&iSizeVar, &offset_local_extrafield,&size_local_extrafield)!=UNZ_OK) + return UNZ_BADZIPFILE; + + pfile_in_zip_read_info = (file_in_zip64_read_info_s*)ALLOC(sizeof(file_in_zip64_read_info_s)); + if (pfile_in_zip_read_info==NULL) + return UNZ_INTERNALERROR; + + pfile_in_zip_read_info->read_buffer=(char*)ALLOC(UNZ_BUFSIZE); + pfile_in_zip_read_info->offset_local_extrafield = offset_local_extrafield; + pfile_in_zip_read_info->size_local_extrafield = size_local_extrafield; + pfile_in_zip_read_info->pos_local_extrafield=0; + pfile_in_zip_read_info->raw=raw; + + if (pfile_in_zip_read_info->read_buffer==NULL) + { + TRYFREE(pfile_in_zip_read_info); + return UNZ_INTERNALERROR; + } + + pfile_in_zip_read_info->stream_initialised=0; + + if (method!=NULL) + *method = (int)s->cur_file_info.compression_method; + + if (level!=NULL) + { + *level = 6; + switch (s->cur_file_info.flag & 0x06) + { + case 6 : *level = 1; break; + case 4 : *level = 2; break; + case 2 : *level = 9; break; + } + } + + if ((s->cur_file_info.compression_method!=0) && +/* #ifdef HAVE_BZIP2 */ + (s->cur_file_info.compression_method!=Z_BZIP2ED) && +/* #endif */ + (s->cur_file_info.compression_method!=Z_DEFLATED)) { + + //err=UNZ_BADZIPFILE; + } + pfile_in_zip_read_info->crc32_wait=s->cur_file_info.crc; + pfile_in_zip_read_info->crc32=0; + pfile_in_zip_read_info->total_out_64=0; + pfile_in_zip_read_info->compression_method = s->cur_file_info.compression_method; + pfile_in_zip_read_info->filestream=s->filestream; + pfile_in_zip_read_info->z_filefunc=s->z_filefunc; + pfile_in_zip_read_info->byte_before_the_zipfile=s->byte_before_the_zipfile; + + pfile_in_zip_read_info->stream.total_out = 0; + + if ((s->cur_file_info.compression_method==Z_BZIP2ED) && (!raw)) + { +#ifdef HAVE_BZIP2 + pfile_in_zip_read_info->bstream.bzalloc = (void *(*) (void *, int, int))0; + pfile_in_zip_read_info->bstream.bzfree = (free_func)0; + pfile_in_zip_read_info->bstream.opaque = (voidpf)0; + pfile_in_zip_read_info->bstream.state = (voidpf)0; + + pfile_in_zip_read_info->stream.zalloc = (alloc_func)0; + pfile_in_zip_read_info->stream.zfree = (free_func)0; + pfile_in_zip_read_info->stream.opaque = (voidpf)0; + pfile_in_zip_read_info->stream.next_in = (voidpf)0; + pfile_in_zip_read_info->stream.avail_in = 0; + + err=BZ2_bzDecompressInit(&pfile_in_zip_read_info->bstream, 0, 0); + if (err == Z_OK) + pfile_in_zip_read_info->stream_initialised=Z_BZIP2ED; + else + { + TRYFREE(pfile_in_zip_read_info); + return err; + } +#else + pfile_in_zip_read_info->raw=1; +#endif + } + else if ((s->cur_file_info.compression_method==Z_DEFLATED) && (!raw)) + { + pfile_in_zip_read_info->stream.zalloc = (alloc_func)0; + pfile_in_zip_read_info->stream.zfree = (free_func)0; + pfile_in_zip_read_info->stream.opaque = (voidpf)0; + pfile_in_zip_read_info->stream.next_in = 0; + pfile_in_zip_read_info->stream.avail_in = 0; + + err=inflateInit2(&pfile_in_zip_read_info->stream, -MAX_WBITS); + if (err == Z_OK) + pfile_in_zip_read_info->stream_initialised=Z_DEFLATED; + else + { + TRYFREE(pfile_in_zip_read_info); + return err; + } + /* windowBits is passed < 0 to tell that there is no zlib header. + * Note that in this case inflate *requires* an extra "dummy" byte + * after the compressed stream in order to complete decompression and + * return Z_STREAM_END. + * In unzip, i don't wait absolutely Z_STREAM_END because I known the + * size of both compressed and uncompressed data + */ + } + pfile_in_zip_read_info->rest_read_compressed = + s->cur_file_info.compressed_size ; + pfile_in_zip_read_info->rest_read_uncompressed = + s->cur_file_info.uncompressed_size ; + + + pfile_in_zip_read_info->pos_in_zipfile = + s->cur_file_info_internal.offset_curfile + SIZEZIPLOCALHEADER + + iSizeVar; + + pfile_in_zip_read_info->stream.avail_in = (uInt)0; + + s->pfile_in_zip_read = pfile_in_zip_read_info; + s->encrypted = 0; + +# ifndef NOUNCRYPT + if (password != NULL) + { + int i; + s->pcrc_32_tab = get_crc_table(); + init_keys(password,s->keys,s->pcrc_32_tab); + if (ZSEEK64(s->z_filefunc, s->filestream, + s->pfile_in_zip_read->pos_in_zipfile + + s->pfile_in_zip_read->byte_before_the_zipfile, + SEEK_SET)!=0) + return UNZ_INTERNALERROR; + if(ZREAD64(s->z_filefunc, s->filestream,source, 12)<12) + return UNZ_INTERNALERROR; + + for (i = 0; i<12; i++) + zdecode(s->keys,s->pcrc_32_tab,source[i]); + + s->pfile_in_zip_read->pos_in_zipfile+=12; + s->encrypted=1; + } +# endif + + + return UNZ_OK; +} + +int ZEXPORT unzOpenCurrentFile (unzFile file) +{ + return unzOpenCurrentFile3(file, NULL, NULL, 0, NULL); +} + +int ZEXPORT unzOpenCurrentFilePassword (unzFile file, const char* password) +{ + return unzOpenCurrentFile3(file, NULL, NULL, 0, password); +} + +int ZEXPORT unzOpenCurrentFile2 (unzFile file, int* method, int* level, int raw) +{ + return unzOpenCurrentFile3(file, method, level, raw, NULL); +} + +/** Addition for GDAL : START */ + +ZPOS64_T ZEXPORT unzGetCurrentFileZStreamPos64( unzFile file) +{ + unz64_s* s; + file_in_zip64_read_info_s* pfile_in_zip_read_info; + s=(unz64_s*)file; + if (file==NULL) + return 0; //UNZ_PARAMERROR; + pfile_in_zip_read_info=s->pfile_in_zip_read; + if (pfile_in_zip_read_info==NULL) + return 0; //UNZ_PARAMERROR; + return pfile_in_zip_read_info->pos_in_zipfile + + pfile_in_zip_read_info->byte_before_the_zipfile; +} + +/** Addition for GDAL : END */ + +/* + Read bytes from the current file. + buf contain buffer where data must be copied + len the size of buf. + + return the number of byte copied if some bytes are copied + return 0 if the end of file was reached + return <0 with error code if there is an error + (UNZ_ERRNO for IO error, or zLib error for uncompress error) +*/ +int ZEXPORT unzReadCurrentFile (unzFile file, voidp buf, unsigned len) +{ + int err=UNZ_OK; + uInt iRead = 0; + unz64_s* s; + file_in_zip64_read_info_s* pfile_in_zip_read_info; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz64_s*)file; + pfile_in_zip_read_info=s->pfile_in_zip_read; + + if (pfile_in_zip_read_info==NULL) + return UNZ_PARAMERROR; + + + if (pfile_in_zip_read_info->read_buffer == NULL) + return UNZ_END_OF_LIST_OF_FILE; + if (len==0) + return 0; + + pfile_in_zip_read_info->stream.next_out = (Bytef*)buf; + + pfile_in_zip_read_info->stream.avail_out = (uInt)len; + + if ((len>pfile_in_zip_read_info->rest_read_uncompressed) && + (!(pfile_in_zip_read_info->raw))) + pfile_in_zip_read_info->stream.avail_out = + (uInt)pfile_in_zip_read_info->rest_read_uncompressed; + + if ((len>pfile_in_zip_read_info->rest_read_compressed+ + pfile_in_zip_read_info->stream.avail_in) && + (pfile_in_zip_read_info->raw)) + pfile_in_zip_read_info->stream.avail_out = + (uInt)pfile_in_zip_read_info->rest_read_compressed+ + pfile_in_zip_read_info->stream.avail_in; + + while (pfile_in_zip_read_info->stream.avail_out>0) + { + if ((pfile_in_zip_read_info->stream.avail_in==0) && + (pfile_in_zip_read_info->rest_read_compressed>0)) + { + uInt uReadThis = UNZ_BUFSIZE; + if (pfile_in_zip_read_info->rest_read_compressedrest_read_compressed; + if (uReadThis == 0) + return UNZ_EOF; + if (ZSEEK64(pfile_in_zip_read_info->z_filefunc, + pfile_in_zip_read_info->filestream, + pfile_in_zip_read_info->pos_in_zipfile + + pfile_in_zip_read_info->byte_before_the_zipfile, + ZLIB_FILEFUNC_SEEK_SET)!=0) + return UNZ_ERRNO; + if (ZREAD64(pfile_in_zip_read_info->z_filefunc, + pfile_in_zip_read_info->filestream, + pfile_in_zip_read_info->read_buffer, + uReadThis)!=uReadThis) + return UNZ_ERRNO; + + +# ifndef NOUNCRYPT + if(s->encrypted) + { + uInt i; + for(i=0;iread_buffer[i] = + zdecode(s->keys,s->pcrc_32_tab, + pfile_in_zip_read_info->read_buffer[i]); + } +# endif + + + pfile_in_zip_read_info->pos_in_zipfile += uReadThis; + + pfile_in_zip_read_info->rest_read_compressed-=uReadThis; + + pfile_in_zip_read_info->stream.next_in = + (Bytef*)pfile_in_zip_read_info->read_buffer; + pfile_in_zip_read_info->stream.avail_in = (uInt)uReadThis; + } + + if ((pfile_in_zip_read_info->compression_method==0) || (pfile_in_zip_read_info->raw)) + { + uInt uDoCopy,i ; + + if ((pfile_in_zip_read_info->stream.avail_in == 0) && + (pfile_in_zip_read_info->rest_read_compressed == 0)) + return (iRead==0) ? UNZ_EOF : iRead; + + if (pfile_in_zip_read_info->stream.avail_out < + pfile_in_zip_read_info->stream.avail_in) + uDoCopy = pfile_in_zip_read_info->stream.avail_out ; + else + uDoCopy = pfile_in_zip_read_info->stream.avail_in ; + + for (i=0;istream.next_out+i) = + *(pfile_in_zip_read_info->stream.next_in+i); + + pfile_in_zip_read_info->total_out_64 = pfile_in_zip_read_info->total_out_64 + uDoCopy; + + pfile_in_zip_read_info->crc32 = crc32(pfile_in_zip_read_info->crc32, + pfile_in_zip_read_info->stream.next_out, + uDoCopy); + pfile_in_zip_read_info->rest_read_uncompressed-=uDoCopy; + pfile_in_zip_read_info->stream.avail_in -= uDoCopy; + pfile_in_zip_read_info->stream.avail_out -= uDoCopy; + pfile_in_zip_read_info->stream.next_out += uDoCopy; + pfile_in_zip_read_info->stream.next_in += uDoCopy; + pfile_in_zip_read_info->stream.total_out += uDoCopy; + iRead += uDoCopy; + } + else if (pfile_in_zip_read_info->compression_method==Z_BZIP2ED) + { +#ifdef HAVE_BZIP2 + uLong uTotalOutBefore,uTotalOutAfter; + const Bytef *bufBefore; + uLong uOutThis; + + pfile_in_zip_read_info->bstream.next_in = (char*)pfile_in_zip_read_info->stream.next_in; + pfile_in_zip_read_info->bstream.avail_in = pfile_in_zip_read_info->stream.avail_in; + pfile_in_zip_read_info->bstream.total_in_lo32 = pfile_in_zip_read_info->stream.total_in; + pfile_in_zip_read_info->bstream.total_in_hi32 = 0; + pfile_in_zip_read_info->bstream.next_out = (char*)pfile_in_zip_read_info->stream.next_out; + pfile_in_zip_read_info->bstream.avail_out = pfile_in_zip_read_info->stream.avail_out; + pfile_in_zip_read_info->bstream.total_out_lo32 = pfile_in_zip_read_info->stream.total_out; + pfile_in_zip_read_info->bstream.total_out_hi32 = 0; + + uTotalOutBefore = pfile_in_zip_read_info->bstream.total_out_lo32; + bufBefore = (const Bytef *)pfile_in_zip_read_info->bstream.next_out; + + err=BZ2_bzDecompress(&pfile_in_zip_read_info->bstream); + + uTotalOutAfter = pfile_in_zip_read_info->bstream.total_out_lo32; + uOutThis = uTotalOutAfter-uTotalOutBefore; + + pfile_in_zip_read_info->total_out_64 = pfile_in_zip_read_info->total_out_64 + uOutThis; + + pfile_in_zip_read_info->crc32 = crc32(pfile_in_zip_read_info->crc32,bufBefore, (uInt)(uOutThis)); + pfile_in_zip_read_info->rest_read_uncompressed -= uOutThis; + iRead += (uInt)(uTotalOutAfter - uTotalOutBefore); + + pfile_in_zip_read_info->stream.next_in = (Bytef*)pfile_in_zip_read_info->bstream.next_in; + pfile_in_zip_read_info->stream.avail_in = pfile_in_zip_read_info->bstream.avail_in; + pfile_in_zip_read_info->stream.total_in = pfile_in_zip_read_info->bstream.total_in_lo32; + pfile_in_zip_read_info->stream.next_out = (Bytef*)pfile_in_zip_read_info->bstream.next_out; + pfile_in_zip_read_info->stream.avail_out = pfile_in_zip_read_info->bstream.avail_out; + pfile_in_zip_read_info->stream.total_out = pfile_in_zip_read_info->bstream.total_out_lo32; + + if (err==BZ_STREAM_END) + return (iRead==0) ? UNZ_EOF : iRead; + if (err!=BZ_OK) + break; +#endif + } // end Z_BZIP2ED + else + { + ZPOS64_T uTotalOutBefore,uTotalOutAfter; + const Bytef *bufBefore; + ZPOS64_T uOutThis; + int flush=Z_SYNC_FLUSH; + + uTotalOutBefore = pfile_in_zip_read_info->stream.total_out; + bufBefore = pfile_in_zip_read_info->stream.next_out; + + /* + if ((pfile_in_zip_read_info->rest_read_uncompressed == + pfile_in_zip_read_info->stream.avail_out) && + (pfile_in_zip_read_info->rest_read_compressed == 0)) + flush = Z_FINISH; + */ + err=inflate(&pfile_in_zip_read_info->stream,flush); + + if ((err>=0) && (pfile_in_zip_read_info->stream.msg!=NULL)) + err = Z_DATA_ERROR; + + uTotalOutAfter = pfile_in_zip_read_info->stream.total_out; + uOutThis = uTotalOutAfter-uTotalOutBefore; + + pfile_in_zip_read_info->total_out_64 = pfile_in_zip_read_info->total_out_64 + uOutThis; + + pfile_in_zip_read_info->crc32 = + crc32(pfile_in_zip_read_info->crc32,bufBefore, + (uInt)(uOutThis)); + + pfile_in_zip_read_info->rest_read_uncompressed -= + uOutThis; + + iRead += (uInt)(uTotalOutAfter - uTotalOutBefore); + + if (err==Z_STREAM_END) + return (iRead==0) ? UNZ_EOF : iRead; + if (err!=Z_OK) + break; + } + } + + if (err==Z_OK) + return iRead; + return err; +} + + +/* + Give the current position in uncompressed data +*/ +z_off_t ZEXPORT unztell (unzFile file) +{ + unz64_s* s; + file_in_zip64_read_info_s* pfile_in_zip_read_info; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz64_s*)file; + pfile_in_zip_read_info=s->pfile_in_zip_read; + + if (pfile_in_zip_read_info==NULL) + return UNZ_PARAMERROR; + + return (z_off_t)pfile_in_zip_read_info->stream.total_out; +} + +ZPOS64_T ZEXPORT unztell64 (unzFile file) +{ + + unz64_s* s; + file_in_zip64_read_info_s* pfile_in_zip_read_info; + if (file==NULL) + return (ZPOS64_T)-1; + s=(unz64_s*)file; + pfile_in_zip_read_info=s->pfile_in_zip_read; + + if (pfile_in_zip_read_info==NULL) + return (ZPOS64_T)-1; + + return pfile_in_zip_read_info->total_out_64; +} + + +/* + return 1 if the end of file was reached, 0 elsewhere +*/ +int ZEXPORT unzeof (unzFile file) +{ + unz64_s* s; + file_in_zip64_read_info_s* pfile_in_zip_read_info; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz64_s*)file; + pfile_in_zip_read_info=s->pfile_in_zip_read; + + if (pfile_in_zip_read_info==NULL) + return UNZ_PARAMERROR; + + if (pfile_in_zip_read_info->rest_read_uncompressed == 0) + return 1; + else + return 0; +} + + + +/* +Read extra field from the current file (opened by unzOpenCurrentFile) +This is the local-header version of the extra field (sometimes, there is +more info in the local-header version than in the central-header) + + if buf==NULL, it return the size of the local extra field that can be read + + if buf!=NULL, len is the size of the buffer, the extra header is copied in + buf. + the return value is the number of bytes copied in buf, or (if <0) + the error code +*/ +int ZEXPORT unzGetLocalExtrafield (unzFile file, voidp buf, unsigned len) +{ + unz64_s* s; + file_in_zip64_read_info_s* pfile_in_zip_read_info; + uInt read_now; + ZPOS64_T size_to_read; + + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz64_s*)file; + pfile_in_zip_read_info=s->pfile_in_zip_read; + + if (pfile_in_zip_read_info==NULL) + return UNZ_PARAMERROR; + + size_to_read = (pfile_in_zip_read_info->size_local_extrafield - + pfile_in_zip_read_info->pos_local_extrafield); + + if (buf==NULL) + return (int)size_to_read; + + if (len>size_to_read) + read_now = (uInt)size_to_read; + else + read_now = (uInt)len ; + + if (read_now==0) + return 0; + + if (ZSEEK64(pfile_in_zip_read_info->z_filefunc, + pfile_in_zip_read_info->filestream, + pfile_in_zip_read_info->offset_local_extrafield + + pfile_in_zip_read_info->pos_local_extrafield, + ZLIB_FILEFUNC_SEEK_SET)!=0) + return UNZ_ERRNO; + + if (ZREAD64(pfile_in_zip_read_info->z_filefunc, + pfile_in_zip_read_info->filestream, + buf,read_now)!=read_now) + return UNZ_ERRNO; + + return (int)read_now; +} + +/* + Close the file in zip opened with unzipOpenCurrentFile + Return UNZ_CRCERROR if all the file was read but the CRC is not good +*/ +int ZEXPORT unzCloseCurrentFile (unzFile file) +{ + int err=UNZ_OK; + + unz64_s* s; + file_in_zip64_read_info_s* pfile_in_zip_read_info; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz64_s*)file; + pfile_in_zip_read_info=s->pfile_in_zip_read; + + if (pfile_in_zip_read_info==NULL) + return UNZ_PARAMERROR; + + + if ((pfile_in_zip_read_info->rest_read_uncompressed == 0) && + (!pfile_in_zip_read_info->raw)) + { + if (pfile_in_zip_read_info->crc32 != pfile_in_zip_read_info->crc32_wait) + err=UNZ_CRCERROR; + } + + + TRYFREE(pfile_in_zip_read_info->read_buffer); + pfile_in_zip_read_info->read_buffer = NULL; + if (pfile_in_zip_read_info->stream_initialised == Z_DEFLATED) + inflateEnd(&pfile_in_zip_read_info->stream); +#ifdef HAVE_BZIP2 + else if (pfile_in_zip_read_info->stream_initialised == Z_BZIP2ED) + BZ2_bzDecompressEnd(&pfile_in_zip_read_info->bstream); +#endif + + + pfile_in_zip_read_info->stream_initialised = 0; + TRYFREE(pfile_in_zip_read_info); + + s->pfile_in_zip_read=NULL; + + return err; +} + + +/* + Get the global comment string of the ZipFile, in the szComment buffer. + uSizeBuf is the size of the szComment buffer. + return the number of byte copied or an error code <0 +*/ +int ZEXPORT unzGetGlobalComment (unzFile file, char * szComment, uLong uSizeBuf) +{ + unz64_s* s; + uLong uReadThis ; + if (file==NULL) + return (int)UNZ_PARAMERROR; + s=(unz64_s*)file; + + uReadThis = uSizeBuf; + if (uReadThis>s->gi.size_comment) + uReadThis = s->gi.size_comment; + + if (ZSEEK64(s->z_filefunc,s->filestream,s->central_pos+22,ZLIB_FILEFUNC_SEEK_SET)!=0) + return UNZ_ERRNO; + + if (uReadThis>0) + { + *szComment='\0'; + if (ZREAD64(s->z_filefunc,s->filestream,szComment,uReadThis)!=uReadThis) + return UNZ_ERRNO; + } + + if ((szComment != NULL) && (uSizeBuf > s->gi.size_comment)) + *(szComment+s->gi.size_comment)='\0'; + return (int)uReadThis; +} + +/* Additions by RX '2004 */ +ZPOS64_T ZEXPORT unzGetOffset64(unzFile file) +{ + unz64_s* s; + + if (file==NULL) + return 0; //UNZ_PARAMERROR; + s=(unz64_s*)file; + if (!s->current_file_ok) + return 0; + if (s->gi.number_entry != 0 && s->gi.number_entry != 0xffff) + if (s->num_file==s->gi.number_entry) + return 0; + return s->pos_in_central_dir; +} + +uLong ZEXPORT unzGetOffset (unzFile file) +{ + ZPOS64_T offset64; + + if (file==NULL) + return 0; //UNZ_PARAMERROR; + offset64 = unzGetOffset64(file); + return (uLong)offset64; +} + +int ZEXPORT unzSetOffset64(unzFile file, ZPOS64_T pos) +{ + unz64_s* s; + int err; + + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz64_s*)file; + + s->pos_in_central_dir = pos; + s->num_file = s->gi.number_entry; /* hack */ + err = unz64local_GetCurrentFileInfoInternal(file,&s->cur_file_info, + &s->cur_file_info_internal, + NULL,0,NULL,0,NULL,0); + s->current_file_ok = (err == UNZ_OK); + return err; +} + +int ZEXPORT unzSetOffset (unzFile file, uLong pos) +{ + return unzSetOffset64(file,pos); +} + +} // end of namespace cocos2d diff --git a/external/unzip/unzip.h b/external/unzip/unzip.h new file mode 100644 index 0000000000..54e73a55ea --- /dev/null +++ b/external/unzip/unzip.h @@ -0,0 +1,455 @@ +/* unzip.h -- IO for uncompress .zip files using zlib + Version 1.1, February 14h, 2010 + part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) + + Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) + + Modifications of Unzip for Zip64 + Copyright (C) 2007-2008 Even Rouault + + Modifications for Zip64 support on both zip and unzip + Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) + + For more info read MiniZip_info.txt + + --------------------------------------------------------------------------------- + + Condition of use and distribution are the same than zlib : + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + --------------------------------------------------------------------------------- + + Changes + + See header of unzip64.c + +*/ + +#ifndef _unz64_H +#define _unz64_H + +#include "CCPlatformDefine.h" + +#ifndef _ZLIB_H +#include "zlib.h" +#endif + +#ifndef _ZLIBIOAPI_H +#include "ioapi.h" +#endif + +#ifdef HAVE_BZIP2 +#include "bzlib.h" +#endif + +#define Z_BZIP2ED 12 + +#if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP) +/* like the STRICT of WIN32, we define a pointer that cannot be converted + from (void*) without cast */ +typedef struct TagunzFile__ { int unused; } unzFile__; +typedef unzFile__ *unzFile; +#else +typedef voidp unzFile; +#endif + + +#define UNZ_OK (0) +#define UNZ_END_OF_LIST_OF_FILE (-100) +#define UNZ_ERRNO (Z_ERRNO) +#define UNZ_EOF (0) +#define UNZ_PARAMERROR (-102) +#define UNZ_BADZIPFILE (-103) +#define UNZ_INTERNALERROR (-104) +#define UNZ_CRCERROR (-105) + +namespace cocos2d { + +/* tm_unz contain date/time info */ +typedef struct tm_unz_s +{ + uInt tm_sec; /* seconds after the minute - [0,59] */ + uInt tm_min; /* minutes after the hour - [0,59] */ + uInt tm_hour; /* hours since midnight - [0,23] */ + uInt tm_mday; /* day of the month - [1,31] */ + uInt tm_mon; /* months since January - [0,11] */ + uInt tm_year; /* years - [1980..2044] */ +} tm_unz; + +/* unz_global_info structure contain global data about the ZIPfile + These data comes from the end of central dir */ +typedef struct unz_global_info64_s +{ + ZPOS64_T number_entry; /* total number of entries in + the central dir on this disk */ + uLong size_comment; /* size of the global comment of the zipfile */ +} unz_global_info64; + +typedef struct unz_global_info_s +{ + uLong number_entry; /* total number of entries in + the central dir on this disk */ + uLong size_comment; /* size of the global comment of the zipfile */ +} unz_global_info; + +/* unz_file_info contain information about a file in the zipfile */ +typedef struct unz_file_info64_s +{ + uLong version; /* version made by 2 bytes */ + uLong version_needed; /* version needed to extract 2 bytes */ + uLong flag; /* general purpose bit flag 2 bytes */ + uLong compression_method; /* compression method 2 bytes */ + uLong dosDate; /* last mod file date in Dos fmt 4 bytes */ + uLong crc; /* crc-32 4 bytes */ + ZPOS64_T compressed_size; /* compressed size 8 bytes */ + ZPOS64_T uncompressed_size; /* uncompressed size 8 bytes */ + uLong size_filename; /* filename length 2 bytes */ + uLong size_file_extra; /* extra field length 2 bytes */ + uLong size_file_comment; /* file comment length 2 bytes */ + + uLong disk_num_start; /* disk number start 2 bytes */ + uLong internal_fa; /* internal file attributes 2 bytes */ + uLong external_fa; /* external file attributes 4 bytes */ + + tm_unz tmu_date; +} unz_file_info64; + +typedef struct unz_file_info_s +{ + uLong version; /* version made by 2 bytes */ + uLong version_needed; /* version needed to extract 2 bytes */ + uLong flag; /* general purpose bit flag 2 bytes */ + uLong compression_method; /* compression method 2 bytes */ + uLong dosDate; /* last mod file date in Dos fmt 4 bytes */ + uLong crc; /* crc-32 4 bytes */ + uLong compressed_size; /* compressed size 4 bytes */ + uLong uncompressed_size; /* uncompressed size 4 bytes */ + uLong size_filename; /* filename length 2 bytes */ + uLong size_file_extra; /* extra field length 2 bytes */ + uLong size_file_comment; /* file comment length 2 bytes */ + + uLong disk_num_start; /* disk number start 2 bytes */ + uLong internal_fa; /* internal file attributes 2 bytes */ + uLong external_fa; /* external file attributes 4 bytes */ + + tm_unz tmu_date; +} unz_file_info; + +int CC_DLL unzStringFileNameCompare OF ((const char* fileName1, + const char* fileName2, + int iCaseSensitivity)); +/* + Compare two filename (fileName1,fileName2). + If iCaseSenisivity = 1, comparison is case sensitivity (like strcmp) + If iCaseSenisivity = 2, comparison is not case sensitivity (like strcmpi + or strcasecmp) + If iCaseSenisivity = 0, case sensitivity is default of your operating system + (like 1 on Unix, 2 on Windows) +*/ + + +unzFile CC_DLL unzOpen OF((const char *path)); +unzFile CC_DLL unzOpen64 OF((const void *path)); +/* + Open a Zip file. path contain the full pathname (by example, + on a Windows XP computer "c:\\zlib\\zlib113.zip" or on an Unix computer + "zlib/zlib113.zip". + If the zipfile cannot be opened (file don't exist or in not valid), the + return value is NULL. + Else, the return value is a unzFile Handle, usable with other function + of this unzip package. + the "64" function take a const void* pointer, because the path is just the + value passed to the open64_file_func callback. + Under Windows, if UNICODE is defined, using fill_fopen64_filefunc, the path + is a pointer to a wide unicode string (LPCTSTR is LPCWSTR), so const char* + does not describe the reality +*/ + + +unzFile CC_DLL unzOpen2 OF((const char *path, + zlib_filefunc_def* pzlib_filefunc_def)); +/* + Open a Zip file, like unzOpen, but provide a set of file low level API + for read/write the zip file (see ioapi.h) +*/ + +unzFile CC_DLL unzOpen2_64 OF((const void *path, + zlib_filefunc64_def* pzlib_filefunc_def)); +/* + Open a Zip file, like unz64Open, but provide a set of file low level API + for read/write the zip file (see ioapi.h) +*/ + +int CC_DLL unzClose OF((unzFile file)); +/* + Close a ZipFile opened with unzipOpen. + If there is files inside the .Zip opened with unzOpenCurrentFile (see later), + these files MUST be closed with unzipCloseCurrentFile before call unzipClose. + return UNZ_OK if there is no problem. */ + +int CC_DLL unzGetGlobalInfo OF((unzFile file, + unz_global_info *pglobal_info)); + +int CC_DLL unzGetGlobalInfo64 OF((unzFile file, + unz_global_info64 *pglobal_info)); +/* + Write info about the ZipFile in the *pglobal_info structure. + No preparation of the structure is needed + return UNZ_OK if there is no problem. */ + + +int CC_DLL unzGetGlobalComment OF((unzFile file, + char *szComment, + uLong uSizeBuf)); +/* + Get the global comment string of the ZipFile, in the szComment buffer. + uSizeBuf is the size of the szComment buffer. + return the number of byte copied or an error code <0 +*/ + + +/***************************************************************************/ +/* Unzip package allow you browse the directory of the zipfile */ + +int CC_DLL unzGoToFirstFile OF((unzFile file)); + +/* + Set the current file of the zipfile to the first file. + return UNZ_OK if there is no problem +*/ + +int CC_DLL unzGoToFirstFile64 OF((unzFile file, + unz_file_info64 *pfile_info, + char *szFileName, + uLong fileNameBufferSize)); +/* + Set the current file of the zipfile to the first file + with retrieving an information about the file. + return UNZ_OK if there is no problem +*/ + +int CC_DLL unzGoToNextFile OF((unzFile file)); +/* + Set the current file of the zipfile to the next file. + return UNZ_OK if there is no problem + return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest. +*/ + +int CC_DLL unzGoToNextFile64 OF((unzFile file, + unz_file_info64 *pfile_info, + char *szFileName, + uLong fileNameBufferSize)); +/* + Set the current file of the zipfile to the next file + with retrieving an information about the file. + return UNZ_OK if there is no problem + return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest. +*/ + +int CC_DLL unzLocateFile OF((unzFile file, + const char *szFileName, + int iCaseSensitivity)); +/* + Try locate the file szFileName in the zipfile. + For the iCaseSensitivity signification, see unzStringFileNameCompare + + return value : + UNZ_OK if the file is found. It becomes the current file. + UNZ_END_OF_LIST_OF_FILE if the file is not found +*/ + + +/* ****************************************** */ +/* Ryan supplied functions */ +/* unz_file_info contain information about a file in the zipfile */ +typedef struct unz_file_pos_s +{ + uLong pos_in_zip_directory; /* offset in zip file directory */ + uLong num_of_file; /* # of file */ +} unz_file_pos; + +int CC_DLL unzGetFilePos( + unzFile file, + unz_file_pos* file_pos); + +int CC_DLL unzGoToFilePos( + unzFile file, + unz_file_pos* file_pos); + +typedef struct unz64_file_pos_s +{ + ZPOS64_T pos_in_zip_directory; /* offset in zip file directory */ + ZPOS64_T num_of_file; /* # of file */ +} unz64_file_pos; + +int CC_DLL unzGetFilePos64( + unzFile file, + unz64_file_pos* file_pos); + +int CC_DLL unzGoToFilePos64( + unzFile file, + const unz64_file_pos* file_pos); + +/* ****************************************** */ + +int CC_DLL unzGetCurrentFileInfo64 OF((unzFile file, + unz_file_info64 *pfile_info, + char *szFileName, + uLong fileNameBufferSize, + void *extraField, + uLong extraFieldBufferSize, + char *szComment, + uLong commentBufferSize)); + +int CC_DLL unzGetCurrentFileInfo OF((unzFile file, + unz_file_info *pfile_info, + char *szFileName, + uLong fileNameBufferSize, + void *extraField, + uLong extraFieldBufferSize, + char *szComment, + uLong commentBufferSize)); +/* + Get Info about the current file + if pfile_info!=NULL, the *pfile_info structure will contain some info about + the current file + if szFileName!=NULL, the filename string will be copied in szFileName + (fileNameBufferSize is the size of the buffer) + if extraField!=NULL, the extra field information will be copied in extraField + (extraFieldBufferSize is the size of the buffer). + This is the Central-header version of the extra field + if szComment!=NULL, the comment string of the file will be copied in szComment + (commentBufferSize is the size of the buffer) +*/ + + +/** Addition for GDAL : START */ + +ZPOS64_T CC_DLL unzGetCurrentFileZStreamPos64 OF((unzFile file)); + +/** Addition for GDAL : END */ + + +/***************************************************************************/ +/* for reading the content of the current zipfile, you can open it, read data + from it, and close it (you can close it before reading all the file) + */ + +int CC_DLL unzOpenCurrentFile OF((unzFile file)); +/* + Open for reading data the current file in the zipfile. + If there is no error, the return value is UNZ_OK. +*/ + +int CC_DLL unzOpenCurrentFilePassword OF((unzFile file, + const char* password)); +/* + Open for reading data the current file in the zipfile. + password is a crypting password + If there is no error, the return value is UNZ_OK. +*/ + +int CC_DLL unzOpenCurrentFile2 OF((unzFile file, + int* method, + int* level, + int raw)); +/* + Same than unzOpenCurrentFile, but open for read raw the file (not uncompress) + if raw==1 + *method will receive method of compression, *level will receive level of + compression + note : you can set level parameter as NULL (if you did not want known level, + but you CANNOT set method parameter as NULL +*/ + +int CC_DLL unzOpenCurrentFile3 OF((unzFile file, + int* method, + int* level, + int raw, + const char* password)); +/* + Same than unzOpenCurrentFile, but open for read raw the file (not uncompress) + if raw==1 + *method will receive method of compression, *level will receive level of + compression + note : you can set level parameter as NULL (if you did not want known level, + but you CANNOT set method parameter as NULL +*/ + + +int CC_DLL unzCloseCurrentFile OF((unzFile file)); +/* + Close the file in zip opened with unzOpenCurrentFile + Return UNZ_CRCERROR if all the file was read but the CRC is not good +*/ + +int CC_DLL unzReadCurrentFile OF((unzFile file, + voidp buf, + unsigned len)); +/* + Read bytes from the current file (opened by unzOpenCurrentFile) + buf contain buffer where data must be copied + len the size of buf. + + return the number of byte copied if some bytes are copied + return 0 if the end of file was reached + return <0 with error code if there is an error + (UNZ_ERRNO for IO error, or zLib error for uncompress error) +*/ + +z_off_t CC_DLL unztell OF((unzFile file)); + +ZPOS64_T CC_DLL unztell64 OF((unzFile file)); +/* + Give the current position in uncompressed data +*/ + +int CC_DLL unzeof OF((unzFile file)); +/* + return 1 if the end of file was reached, 0 elsewhere +*/ + +int CC_DLL unzGetLocalExtrafield OF((unzFile file, + voidp buf, + unsigned len)); +/* + Read extra field from the current file (opened by unzOpenCurrentFile) + This is the local-header version of the extra field (sometimes, there is + more info in the local-header version than in the central-header) + + if buf==NULL, it return the size of the local extra field + + if buf!=NULL, len is the size of the buffer, the extra header is copied in + buf. + the return value is the number of bytes copied in buf, or (if <0) + the error code +*/ + +/***************************************************************************/ + +/* Get the current file offset */ +ZPOS64_T CC_DLL unzGetOffset64 (unzFile file); +uLong CC_DLL unzGetOffset (unzFile file); + +/* Set the current file offset */ +int CC_DLL unzSetOffset64 (unzFile file, ZPOS64_T pos); +int CC_DLL unzSetOffset (unzFile file, uLong pos); + +} // end of namespace cocos2d + +#endif /* _unz64_H */ From bb6208eec1f339d5511cac3b4f5dc17c788e320a Mon Sep 17 00:00:00 2001 From: minggo Date: Sat, 12 Oct 2013 15:31:05 +0800 Subject: [PATCH 23/64] issue #2905: remove redundant codes --- external/atitc/atitc.cpp | 195 ------------ external/atitc/atitc.h | 48 --- external/etc1/etc1.cpp | 670 --------------------------------------- external/etc1/etc1.h | 106 ------- external/s3tc/s3tc.cpp | 182 ----------- external/s3tc/s3tc.h | 48 --- 6 files changed, 1249 deletions(-) delete mode 100644 external/atitc/atitc.cpp delete mode 100644 external/atitc/atitc.h delete mode 100644 external/etc1/etc1.cpp delete mode 100644 external/etc1/etc1.h delete mode 100644 external/s3tc/s3tc.cpp delete mode 100644 external/s3tc/s3tc.h diff --git a/external/atitc/atitc.cpp b/external/atitc/atitc.cpp deleted file mode 100644 index 3a60d6d2f7..0000000000 --- a/external/atitc/atitc.cpp +++ /dev/null @@ -1,195 +0,0 @@ -/**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - 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 "atitc.h" - -//Decode ATITC encode block to 4x4 RGB32 pixels -static void atitc_decode_block(uint8_t **blockData, - uint32_t *decodeBlockData, - unsigned int stride, - bool oneBitAlphaFlag, - uint64_t alpha, - ATITCDecodeFlag decodeFlag) -{ - unsigned int colorValue0 = 0 , colorValue1 = 0, initAlpha = (!oneBitAlphaFlag * 255u) << 24; - unsigned int rb0 = 0, rb1 = 0, rb2 = 0, rb3 = 0, g0 = 0, g1 = 0, g2 = 0, g3 = 0; - bool msb = 0; - - uint32_t colors[4], pixelsIndex = 0; - - /* load the two color values*/ - memcpy((void *)&colorValue0, *blockData, 2); - (*blockData) += 2; - - memcpy((void *)&colorValue1, *blockData, 2); - (*blockData) += 2; - - //extract the msb flag - msb = (colorValue0 & 0x8000) != 0; - - /* the channel is r5g6b5 , 16 bits */ - rb0 = (colorValue0 << 3 | colorValue0 << 9) & 0xf800f8; - rb1 = (colorValue1 << 3 | colorValue1 << 8) & 0xf800f8; - g0 = (colorValue0 << 6) & 0x00fc00; - g1 = (colorValue1 << 5) & 0x00fc00; - g0 += (g0 >> 6) & 0x000300; - g1 += (g1 >> 6) & 0x000300; - - /* interpolate the other two color values */ - if (!msb) - { - colors[0] = rb0 + g0 + initAlpha; - colors[3] = rb1 + g1 + initAlpha; - - rb2 = (((2*rb0 + rb1) * 21) >> 6) & 0xff00ff; - rb3 = (((2*rb1 + rb0) * 21) >> 6) & 0xff00ff; - g2 = (((2*g0 + g1 ) * 21) >> 6) & 0x00ff00; - g3 = (((2*g1 + g0 ) * 21) >> 6) & 0x00ff00; - - colors[2] = rb3 + g3 + initAlpha; - colors[1] = rb2 + g2 + initAlpha; - } - else - { - colors[2] = rb0 + g0 + initAlpha; - colors[3] = rb1 + g1 + initAlpha; - - rb2 = (rb0 - (rb1 >> 2)) & 0xff00ff; - g2 = (g0 - (g1 >> 2)) & 0x00ff00; - colors[0] = 0 ; - - colors[1] = rb2 + g2 + initAlpha; - } - - /*read the pixelsIndex , 2bits per pixel, 4 bytes */ - memcpy((void*)&pixelsIndex, *blockData, 4); - (*blockData) += 4; - - if (ATITCDecodeFlag::ATC_INTERPOLATED_ALPHA == decodeFlag) - { - // atitc_interpolated_alpha use interpolate alpha - // 8-Alpha block: derive the other six alphas. - // Bit code 000 = alpha0, 001 = alpha1, other are interpolated. - - unsigned int alphaArray[8]; - - alphaArray[0] = (alpha ) & 0xff ; - alphaArray[1] = (alpha >> 8) & 0xff ; - - if (alphaArray[0] >= alphaArray[1]) - { - alphaArray[2] = (alphaArray[0]*6 + alphaArray[1]*1) / 7; - alphaArray[3] = (alphaArray[0]*5 + alphaArray[1]*2) / 7; - alphaArray[4] = (alphaArray[0]*4 + alphaArray[1]*3) / 7; - alphaArray[5] = (alphaArray[0]*3 + alphaArray[1]*4) / 7; - alphaArray[6] = (alphaArray[0]*2 + alphaArray[1]*5) / 7; - alphaArray[7] = (alphaArray[0]*1 + alphaArray[1]*6) / 7; - } - else if (alphaArray[0] < alphaArray[1]) - { - alphaArray[2] = (alphaArray[0]*4 + alphaArray[1]*1) / 5; - alphaArray[3] = (alphaArray[0]*3 + alphaArray[1]*2) / 5; - alphaArray[4] = (alphaArray[0]*2 + alphaArray[1]*3) / 5; - alphaArray[5] = (alphaArray[0]*1 + alphaArray[1]*4) / 5; - alphaArray[6] = 0; - alphaArray[7] = 255; - } - - // read the flowing 48bit indices (16*3) - alpha >>= 16; - - for (int y = 0; y < 4; ++y) - { - for (int x = 0; x < 4; ++x) - { - decodeBlockData[x] = (alphaArray[alpha & 5] << 24) + colors[pixelsIndex & 3]; - pixelsIndex >>= 2; - alpha >>= 3; - } - decodeBlockData += stride; - } - } //if (atc_interpolated_alpha == comFlag) - else - { - /* atc_rgb atc_explicit_alpha use explicit alpha */ - - for (int y = 0; y < 4; ++y) - { - for (int x = 0; x < 4; ++x) - { - initAlpha = (alpha & 0x0f) << 28; - initAlpha += initAlpha >> 4; - decodeBlockData[x] = initAlpha + colors[pixelsIndex & 3]; - pixelsIndex >>= 2; - alpha >>= 4; - } - decodeBlockData += stride; - } - } -} - -//Decode ATITC encode data to RGB32 -void atitc_decode(uint8_t *encodeData, //in_data - uint8_t *decodeData, //out_data - const int pixelsWidth, - const int pixelsHeight, - ATITCDecodeFlag decodeFlag) -{ - uint32_t *decodeBlockData = (uint32_t *)decodeData; - - for (int block_y = 0; block_y < pixelsHeight / 4; ++block_y, decodeBlockData += 3 * pixelsWidth) //stride = 3*width - { - for (int block_x = 0; block_x < pixelsWidth / 4; ++block_x, decodeBlockData += 4) //skip 4 pixels - { - uint64_t blockAlpha = 0; - - switch (decodeFlag) - { - case ATITCDecodeFlag::ATC_RGB: - { - atitc_decode_block(&encodeData, decodeBlockData, pixelsWidth, 0, 0LL, ATITCDecodeFlag::ATC_RGB); - } - break; - case ATITCDecodeFlag::ATC_EXPLICIT_ALPHA: - { - memcpy((void *)&blockAlpha, encodeData, 8); - encodeData += 8; - atitc_decode_block(&encodeData, decodeBlockData, pixelsWidth, 1, blockAlpha, ATITCDecodeFlag::ATC_EXPLICIT_ALPHA); - } - break; - case ATITCDecodeFlag::ATC_INTERPOLATED_ALPHA: - { - memcpy((void *)&blockAlpha, encodeData, 8); - encodeData += 8; - atitc_decode_block(&encodeData, decodeBlockData, pixelsWidth, 1, blockAlpha, ATITCDecodeFlag::ATC_INTERPOLATED_ALPHA); - } - break; - default: - break; - }//switch - }//for block_x - }//for block_y -} - - diff --git a/external/atitc/atitc.h b/external/atitc/atitc.h deleted file mode 100644 index 72bfd32a8c..0000000000 --- a/external/atitc/atitc.h +++ /dev/null @@ -1,48 +0,0 @@ -/**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - 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 COCOS2DX_PLATFORM_THIRDPARTY_ATITC_ -#define COCOS2DX_PLATFORM_THIRDPARTY_ATITC_ - -#include "CCStdC.h" - -enum class ATITCDecodeFlag -{ - ATC_RGB = 1, - ATC_EXPLICIT_ALPHA = 3, - ATC_INTERPOLATED_ALPHA = 5, -}; - -//Decode ATITC encode data to RGB32 -void atitc_decode(uint8_t *encode_data, - uint8_t *decode_data, - const int pixelsWidth, - const int pixelsHeight, - ATITCDecodeFlag decodeFlag - ); - - -#endif /* defined(COCOS2DX_PLATFORM_THIRDPARTY_ATITC_) */ - diff --git a/external/etc1/etc1.cpp b/external/etc1/etc1.cpp deleted file mode 100644 index 9c1cd43e83..0000000000 --- a/external/etc1/etc1.cpp +++ /dev/null @@ -1,670 +0,0 @@ -// Copyright 2009 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "etc1.h" - -#include - -/* From http://www.khronos.org/registry/gles/extensions/OES/OES_compressed_ETC1_RGB8_texture.txt - - The number of bits that represent a 4x4 texel block is 64 bits if - is given by ETC1_RGB8_OES. - - The data for a block is a number of bytes, - - {q0, q1, q2, q3, q4, q5, q6, q7} - - where byte q0 is located at the lowest memory address and q7 at - the highest. The 64 bits specifying the block is then represented - by the following 64 bit integer: - - int64bit = 256*(256*(256*(256*(256*(256*(256*q0+q1)+q2)+q3)+q4)+q5)+q6)+q7; - - ETC1_RGB8_OES: - - a) bit layout in bits 63 through 32 if diffbit = 0 - - 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 - ----------------------------------------------- - | base col1 | base col2 | base col1 | base col2 | - | R1 (4bits)| R2 (4bits)| G1 (4bits)| G2 (4bits)| - ----------------------------------------------- - - 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 - --------------------------------------------------- - | base col1 | base col2 | table | table |diff|flip| - | B1 (4bits)| B2 (4bits)| cw 1 | cw 2 |bit |bit | - --------------------------------------------------- - - - b) bit layout in bits 63 through 32 if diffbit = 1 - - 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 - ----------------------------------------------- - | base col1 | dcol 2 | base col1 | dcol 2 | - | R1' (5 bits) | dR2 | G1' (5 bits) | dG2 | - ----------------------------------------------- - - 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 - --------------------------------------------------- - | base col 1 | dcol 2 | table | table |diff|flip| - | B1' (5 bits) | dB2 | cw 1 | cw 2 |bit |bit | - --------------------------------------------------- - - - c) bit layout in bits 31 through 0 (in both cases) - - 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 - ----------------------------------------------- - | most significant pixel index bits | - | p| o| n| m| l| k| j| i| h| g| f| e| d| c| b| a| - ----------------------------------------------- - - 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 - -------------------------------------------------- - | least significant pixel index bits | - | p| o| n| m| l| k| j| i| h| g| f| e| d| c | b | a | - -------------------------------------------------- - - - Add table 3.17.2: Intensity modifier sets for ETC1 compressed textures: - - table codeword modifier table - ------------------ ---------------------- - 0 -8 -2 2 8 - 1 -17 -5 5 17 - 2 -29 -9 9 29 - 3 -42 -13 13 42 - 4 -60 -18 18 60 - 5 -80 -24 24 80 - 6 -106 -33 33 106 - 7 -183 -47 47 183 - - - Add table 3.17.3 Mapping from pixel index values to modifier values for - ETC1 compressed textures: - - pixel index value - --------------- - msb lsb resulting modifier value - ----- ----- ------------------------- - 1 1 -b (large negative value) - 1 0 -a (small negative value) - 0 0 a (small positive value) - 0 1 b (large positive value) - - - */ - -static const int kModifierTable[] = { -/* 0 */2, 8, -2, -8, -/* 1 */5, 17, -5, -17, -/* 2 */9, 29, -9, -29, -/* 3 */13, 42, -13, -42, -/* 4 */18, 60, -18, -60, -/* 5 */24, 80, -24, -80, -/* 6 */33, 106, -33, -106, -/* 7 */47, 183, -47, -183 }; - -static const int kLookup[8] = { 0, 1, 2, 3, -4, -3, -2, -1 }; - -static inline etc1_byte clamp(int x) { - return (etc1_byte) (x >= 0 ? (x < 255 ? x : 255) : 0); -} - -static -inline int convert4To8(int b) { - int c = b & 0xf; - return (c << 4) | c; -} - -static -inline int convert5To8(int b) { - int c = b & 0x1f; - return (c << 3) | (c >> 2); -} - -static -inline int convert6To8(int b) { - int c = b & 0x3f; - return (c << 2) | (c >> 4); -} - -static -inline int divideBy255(int d) { - return (d + 128 + (d >> 8)) >> 8; -} - -static -inline int convert8To4(int b) { - int c = b & 0xff; - return divideBy255(c * 15); -} - -static -inline int convert8To5(int b) { - int c = b & 0xff; - return divideBy255(c * 31); -} - -static -inline int convertDiff(int base, int diff) { - return convert5To8((0x1f & base) + kLookup[0x7 & diff]); -} - -static -void decode_subblock(etc1_byte* pOut, int r, int g, int b, const int* table, - etc1_uint32 low, bool second, bool flipped) { - int baseX = 0; - int baseY = 0; - if (second) { - if (flipped) { - baseY = 2; - } else { - baseX = 2; - } - } - for (int i = 0; i < 8; i++) { - int x, y; - if (flipped) { - x = baseX + (i >> 1); - y = baseY + (i & 1); - } else { - x = baseX + (i >> 2); - y = baseY + (i & 3); - } - int k = y + (x * 4); - int offset = ((low >> k) & 1) | ((low >> (k + 15)) & 2); - int delta = table[offset]; - etc1_byte* q = pOut + 3 * (x + 4 * y); - *q++ = clamp(r + delta); - *q++ = clamp(g + delta); - *q++ = clamp(b + delta); - } -} - -// Input is an ETC1 compressed version of the data. -// Output is a 4 x 4 square of 3-byte pixels in form R, G, B - -void etc1_decode_block(const etc1_byte* pIn, etc1_byte* pOut) { - etc1_uint32 high = (pIn[0] << 24) | (pIn[1] << 16) | (pIn[2] << 8) | pIn[3]; - etc1_uint32 low = (pIn[4] << 24) | (pIn[5] << 16) | (pIn[6] << 8) | pIn[7]; - int r1, r2, g1, g2, b1, b2; - if (high & 2) { - // differential - int rBase = high >> 27; - int gBase = high >> 19; - int bBase = high >> 11; - r1 = convert5To8(rBase); - r2 = convertDiff(rBase, high >> 24); - g1 = convert5To8(gBase); - g2 = convertDiff(gBase, high >> 16); - b1 = convert5To8(bBase); - b2 = convertDiff(bBase, high >> 8); - } else { - // not differential - r1 = convert4To8(high >> 28); - r2 = convert4To8(high >> 24); - g1 = convert4To8(high >> 20); - g2 = convert4To8(high >> 16); - b1 = convert4To8(high >> 12); - b2 = convert4To8(high >> 8); - } - int tableIndexA = 7 & (high >> 5); - int tableIndexB = 7 & (high >> 2); - const int* tableA = kModifierTable + tableIndexA * 4; - const int* tableB = kModifierTable + tableIndexB * 4; - bool flipped = (high & 1) != 0; - decode_subblock(pOut, r1, g1, b1, tableA, low, false, flipped); - decode_subblock(pOut, r2, g2, b2, tableB, low, true, flipped); -} - -typedef struct { - etc1_uint32 high; - etc1_uint32 low; - etc1_uint32 score; // Lower is more accurate -} etc_compressed; - -static -inline void take_best(etc_compressed* a, const etc_compressed* b) { - if (a->score > b->score) { - *a = *b; - } -} - -static -void etc_average_colors_subblock(const etc1_byte* pIn, etc1_uint32 inMask, - etc1_byte* pColors, bool flipped, bool second) { - int r = 0; - int g = 0; - int b = 0; - - if (flipped) { - int by = 0; - if (second) { - by = 2; - } - for (int y = 0; y < 2; y++) { - int yy = by + y; - for (int x = 0; x < 4; x++) { - int i = x + 4 * yy; - if (inMask & (1 << i)) { - const etc1_byte* p = pIn + i * 3; - r += *(p++); - g += *(p++); - b += *(p++); - } - } - } - } else { - int bx = 0; - if (second) { - bx = 2; - } - for (int y = 0; y < 4; y++) { - for (int x = 0; x < 2; x++) { - int xx = bx + x; - int i = xx + 4 * y; - if (inMask & (1 << i)) { - const etc1_byte* p = pIn + i * 3; - r += *(p++); - g += *(p++); - b += *(p++); - } - } - } - } - pColors[0] = (etc1_byte)((r + 4) >> 3); - pColors[1] = (etc1_byte)((g + 4) >> 3); - pColors[2] = (etc1_byte)((b + 4) >> 3); -} - -static -inline int square(int x) { - return x * x; -} - -static etc1_uint32 chooseModifier(const etc1_byte* pBaseColors, - const etc1_byte* pIn, etc1_uint32 *pLow, int bitIndex, - const int* pModifierTable) { - etc1_uint32 bestScore = ~0; - int bestIndex = 0; - int pixelR = pIn[0]; - int pixelG = pIn[1]; - int pixelB = pIn[2]; - int r = pBaseColors[0]; - int g = pBaseColors[1]; - int b = pBaseColors[2]; - for (int i = 0; i < 4; i++) { - int modifier = pModifierTable[i]; - int decodedG = clamp(g + modifier); - etc1_uint32 score = (etc1_uint32) (6 * square(decodedG - pixelG)); - if (score >= bestScore) { - continue; - } - int decodedR = clamp(r + modifier); - score += (etc1_uint32) (3 * square(decodedR - pixelR)); - if (score >= bestScore) { - continue; - } - int decodedB = clamp(b + modifier); - score += (etc1_uint32) square(decodedB - pixelB); - if (score < bestScore) { - bestScore = score; - bestIndex = i; - } - } - etc1_uint32 lowMask = (((bestIndex >> 1) << 16) | (bestIndex & 1)) - << bitIndex; - *pLow |= lowMask; - return bestScore; -} - -static -void etc_encode_subblock_helper(const etc1_byte* pIn, etc1_uint32 inMask, - etc_compressed* pCompressed, bool flipped, bool second, - const etc1_byte* pBaseColors, const int* pModifierTable) { - int score = pCompressed->score; - if (flipped) { - int by = 0; - if (second) { - by = 2; - } - for (int y = 0; y < 2; y++) { - int yy = by + y; - for (int x = 0; x < 4; x++) { - int i = x + 4 * yy; - if (inMask & (1 << i)) { - score += chooseModifier(pBaseColors, pIn + i * 3, - &pCompressed->low, yy + x * 4, pModifierTable); - } - } - } - } else { - int bx = 0; - if (second) { - bx = 2; - } - for (int y = 0; y < 4; y++) { - for (int x = 0; x < 2; x++) { - int xx = bx + x; - int i = xx + 4 * y; - if (inMask & (1 << i)) { - score += chooseModifier(pBaseColors, pIn + i * 3, - &pCompressed->low, y + xx * 4, pModifierTable); - } - } - } - } - pCompressed->score = score; -} - -static bool inRange4bitSigned(int color) { - return color >= -4 && color <= 3; -} - -static void etc_encodeBaseColors(etc1_byte* pBaseColors, - const etc1_byte* pColors, etc_compressed* pCompressed) { - int r1, g1, b1, r2, g2, b2; // 8 bit base colors for sub-blocks - bool differential; - { - int r51 = convert8To5(pColors[0]); - int g51 = convert8To5(pColors[1]); - int b51 = convert8To5(pColors[2]); - int r52 = convert8To5(pColors[3]); - int g52 = convert8To5(pColors[4]); - int b52 = convert8To5(pColors[5]); - - r1 = convert5To8(r51); - g1 = convert5To8(g51); - b1 = convert5To8(b51); - - int dr = r52 - r51; - int dg = g52 - g51; - int db = b52 - b51; - - differential = inRange4bitSigned(dr) && inRange4bitSigned(dg) - && inRange4bitSigned(db); - if (differential) { - r2 = convert5To8(r51 + dr); - g2 = convert5To8(g51 + dg); - b2 = convert5To8(b51 + db); - pCompressed->high |= (r51 << 27) | ((7 & dr) << 24) | (g51 << 19) - | ((7 & dg) << 16) | (b51 << 11) | ((7 & db) << 8) | 2; - } - } - - if (!differential) { - int r41 = convert8To4(pColors[0]); - int g41 = convert8To4(pColors[1]); - int b41 = convert8To4(pColors[2]); - int r42 = convert8To4(pColors[3]); - int g42 = convert8To4(pColors[4]); - int b42 = convert8To4(pColors[5]); - r1 = convert4To8(r41); - g1 = convert4To8(g41); - b1 = convert4To8(b41); - r2 = convert4To8(r42); - g2 = convert4To8(g42); - b2 = convert4To8(b42); - pCompressed->high |= (r41 << 28) | (r42 << 24) | (g41 << 20) | (g42 - << 16) | (b41 << 12) | (b42 << 8); - } - pBaseColors[0] = r1; - pBaseColors[1] = g1; - pBaseColors[2] = b1; - pBaseColors[3] = r2; - pBaseColors[4] = g2; - pBaseColors[5] = b2; -} - -static -void etc_encode_block_helper(const etc1_byte* pIn, etc1_uint32 inMask, - const etc1_byte* pColors, etc_compressed* pCompressed, bool flipped) { - pCompressed->score = ~0; - pCompressed->high = (flipped ? 1 : 0); - pCompressed->low = 0; - - etc1_byte pBaseColors[6]; - - etc_encodeBaseColors(pBaseColors, pColors, pCompressed); - - int originalHigh = pCompressed->high; - - const int* pModifierTable = kModifierTable; - for (int i = 0; i < 8; i++, pModifierTable += 4) { - etc_compressed temp; - temp.score = 0; - temp.high = originalHigh | (i << 5); - temp.low = 0; - etc_encode_subblock_helper(pIn, inMask, &temp, flipped, false, - pBaseColors, pModifierTable); - take_best(pCompressed, &temp); - } - pModifierTable = kModifierTable; - etc_compressed firstHalf = *pCompressed; - for (int i = 0; i < 8; i++, pModifierTable += 4) { - etc_compressed temp; - temp.score = firstHalf.score; - temp.high = firstHalf.high | (i << 2); - temp.low = firstHalf.low; - etc_encode_subblock_helper(pIn, inMask, &temp, flipped, true, - pBaseColors + 3, pModifierTable); - if (i == 0) { - *pCompressed = temp; - } else { - take_best(pCompressed, &temp); - } - } -} - -static void writeBigEndian(etc1_byte* pOut, etc1_uint32 d) { - pOut[0] = (etc1_byte)(d >> 24); - pOut[1] = (etc1_byte)(d >> 16); - pOut[2] = (etc1_byte)(d >> 8); - pOut[3] = (etc1_byte) d; -} - -// Input is a 4 x 4 square of 3-byte pixels in form R, G, B -// inmask is a 16-bit mask where bit (1 << (x + y * 4)) tells whether the corresponding (x,y) -// pixel is valid or not. Invalid pixel color values are ignored when compressing. -// Output is an ETC1 compressed version of the data. - -void etc1_encode_block(const etc1_byte* pIn, etc1_uint32 inMask, - etc1_byte* pOut) { - etc1_byte colors[6]; - etc1_byte flippedColors[6]; - etc_average_colors_subblock(pIn, inMask, colors, false, false); - etc_average_colors_subblock(pIn, inMask, colors + 3, false, true); - etc_average_colors_subblock(pIn, inMask, flippedColors, true, false); - etc_average_colors_subblock(pIn, inMask, flippedColors + 3, true, true); - - etc_compressed a, b; - etc_encode_block_helper(pIn, inMask, colors, &a, false); - etc_encode_block_helper(pIn, inMask, flippedColors, &b, true); - take_best(&a, &b); - writeBigEndian(pOut, a.high); - writeBigEndian(pOut + 4, a.low); -} - -// Return the size of the encoded image data (does not include size of PKM header). - -etc1_uint32 etc1_get_encoded_data_size(etc1_uint32 width, etc1_uint32 height) { - return (((width + 3) & ~3) * ((height + 3) & ~3)) >> 1; -} - -// Encode an entire image. -// pIn - pointer to the image data. Formatted such that the Red component of -// pixel (x,y) is at pIn + pixelSize * x + stride * y + redOffset; -// pOut - pointer to encoded data. Must be large enough to store entire encoded image. - -int etc1_encode_image(const etc1_byte* pIn, etc1_uint32 width, etc1_uint32 height, - etc1_uint32 pixelSize, etc1_uint32 stride, etc1_byte* pOut) { - if (pixelSize < 2 || pixelSize > 3) { - return -1; - } - static const unsigned short kYMask[] = { 0x0, 0xf, 0xff, 0xfff, 0xffff }; - static const unsigned short kXMask[] = { 0x0, 0x1111, 0x3333, 0x7777, - 0xffff }; - etc1_byte block[ETC1_DECODED_BLOCK_SIZE]; - etc1_byte encoded[ETC1_ENCODED_BLOCK_SIZE]; - - etc1_uint32 encodedWidth = (width + 3) & ~3; - etc1_uint32 encodedHeight = (height + 3) & ~3; - - for (etc1_uint32 y = 0; y < encodedHeight; y += 4) { - etc1_uint32 yEnd = height - y; - if (yEnd > 4) { - yEnd = 4; - } - int ymask = kYMask[yEnd]; - for (etc1_uint32 x = 0; x < encodedWidth; x += 4) { - etc1_uint32 xEnd = width - x; - if (xEnd > 4) { - xEnd = 4; - } - int mask = ymask & kXMask[xEnd]; - for (etc1_uint32 cy = 0; cy < yEnd; cy++) { - etc1_byte* q = block + (cy * 4) * 3; - const etc1_byte* p = pIn + pixelSize * x + stride * (y + cy); - if (pixelSize == 3) { - memcpy(q, p, xEnd * 3); - } else { - for (etc1_uint32 cx = 0; cx < xEnd; cx++) { - int pixel = (p[1] << 8) | p[0]; - *q++ = convert5To8(pixel >> 11); - *q++ = convert6To8(pixel >> 5); - *q++ = convert5To8(pixel); - p += pixelSize; - } - } - } - etc1_encode_block(block, mask, encoded); - memcpy(pOut, encoded, sizeof(encoded)); - pOut += sizeof(encoded); - } - } - return 0; -} - -// Decode an entire image. -// pIn - pointer to encoded data. -// pOut - pointer to the image data. Will be written such that the Red component of -// pixel (x,y) is at pIn + pixelSize * x + stride * y + redOffset. Must be -// large enough to store entire image. - - -int etc1_decode_image(const etc1_byte* pIn, etc1_byte* pOut, - etc1_uint32 width, etc1_uint32 height, - etc1_uint32 pixelSize, etc1_uint32 stride) { - if (pixelSize < 2 || pixelSize > 3) { - return -1; - } - etc1_byte block[ETC1_DECODED_BLOCK_SIZE]; - - etc1_uint32 encodedWidth = (width + 3) & ~3; - etc1_uint32 encodedHeight = (height + 3) & ~3; - - for (etc1_uint32 y = 0; y < encodedHeight; y += 4) { - etc1_uint32 yEnd = height - y; - if (yEnd > 4) { - yEnd = 4; - } - for (etc1_uint32 x = 0; x < encodedWidth; x += 4) { - etc1_uint32 xEnd = width - x; - if (xEnd > 4) { - xEnd = 4; - } - etc1_decode_block(pIn, block); - pIn += ETC1_ENCODED_BLOCK_SIZE; - for (etc1_uint32 cy = 0; cy < yEnd; cy++) { - const etc1_byte* q = block + (cy * 4) * 3; - etc1_byte* p = pOut + pixelSize * x + stride * (y + cy); - if (pixelSize == 3) { - memcpy(p, q, xEnd * 3); - } else { - for (etc1_uint32 cx = 0; cx < xEnd; cx++) { - etc1_byte r = *q++; - etc1_byte g = *q++; - etc1_byte b = *q++; - etc1_uint32 pixel = ((r >> 3) << 11) | ((g >> 2) << 5) | (b >> 3); - *p++ = (etc1_byte) pixel; - *p++ = (etc1_byte) (pixel >> 8); - } - } - } - } - } - return 0; -} - -static const char kMagic[] = { 'P', 'K', 'M', ' ', '1', '0' }; - -static const etc1_uint32 ETC1_PKM_FORMAT_OFFSET = 6; -static const etc1_uint32 ETC1_PKM_ENCODED_WIDTH_OFFSET = 8; -static const etc1_uint32 ETC1_PKM_ENCODED_HEIGHT_OFFSET = 10; -static const etc1_uint32 ETC1_PKM_WIDTH_OFFSET = 12; -static const etc1_uint32 ETC1_PKM_HEIGHT_OFFSET = 14; - -static const etc1_uint32 ETC1_RGB_NO_MIPMAPS = 0; - -static void writeBEUint16(etc1_byte* pOut, etc1_uint32 data) { - pOut[0] = (etc1_byte) (data >> 8); - pOut[1] = (etc1_byte) data; -} - -static etc1_uint32 readBEUint16(const etc1_byte* pIn) { - return (pIn[0] << 8) | pIn[1]; -} - -// Format a PKM header - -void etc1_pkm_format_header(etc1_byte* pHeader, etc1_uint32 width, etc1_uint32 height) { - memcpy(pHeader, kMagic, sizeof(kMagic)); - etc1_uint32 encodedWidth = (width + 3) & ~3; - etc1_uint32 encodedHeight = (height + 3) & ~3; - writeBEUint16(pHeader + ETC1_PKM_FORMAT_OFFSET, ETC1_RGB_NO_MIPMAPS); - writeBEUint16(pHeader + ETC1_PKM_ENCODED_WIDTH_OFFSET, encodedWidth); - writeBEUint16(pHeader + ETC1_PKM_ENCODED_HEIGHT_OFFSET, encodedHeight); - writeBEUint16(pHeader + ETC1_PKM_WIDTH_OFFSET, width); - writeBEUint16(pHeader + ETC1_PKM_HEIGHT_OFFSET, height); -} - -// Check if a PKM header is correctly formatted. - -etc1_bool etc1_pkm_is_valid(const etc1_byte* pHeader) { - if (memcmp(pHeader, kMagic, sizeof(kMagic))) { - return false; - } - etc1_uint32 format = readBEUint16(pHeader + ETC1_PKM_FORMAT_OFFSET); - etc1_uint32 encodedWidth = readBEUint16(pHeader + ETC1_PKM_ENCODED_WIDTH_OFFSET); - etc1_uint32 encodedHeight = readBEUint16(pHeader + ETC1_PKM_ENCODED_HEIGHT_OFFSET); - etc1_uint32 width = readBEUint16(pHeader + ETC1_PKM_WIDTH_OFFSET); - etc1_uint32 height = readBEUint16(pHeader + ETC1_PKM_HEIGHT_OFFSET); - return format == ETC1_RGB_NO_MIPMAPS && - encodedWidth >= width && encodedWidth - width < 4 && - encodedHeight >= height && encodedHeight - height < 4; -} - -// Read the image width from a PKM header - -etc1_uint32 etc1_pkm_get_width(const etc1_byte* pHeader) { - return readBEUint16(pHeader + ETC1_PKM_WIDTH_OFFSET); -} - -// Read the image height from a PKM header - -etc1_uint32 etc1_pkm_get_height(const etc1_byte* pHeader){ - return readBEUint16(pHeader + ETC1_PKM_HEIGHT_OFFSET); -} diff --git a/external/etc1/etc1.h b/external/etc1/etc1.h deleted file mode 100644 index 0d389052b7..0000000000 --- a/external/etc1/etc1.h +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright 2009 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef __etc1_h__ -#define __etc1_h__ - -#define ETC1_ENCODED_BLOCK_SIZE 8 -#define ETC1_DECODED_BLOCK_SIZE 48 - -#ifndef ETC1_RGB8_OES -#define ETC1_RGB8_OES 0x8D64 -#endif - -typedef unsigned char etc1_byte; -typedef int etc1_bool; -typedef unsigned int etc1_uint32; - -#ifdef __cplusplus -extern "C" { -#endif - -// Encode a block of pixels. -// -// pIn is a pointer to a ETC_DECODED_BLOCK_SIZE array of bytes that represent a -// 4 x 4 square of 3-byte pixels in form R, G, B. Byte (3 * (x + 4 * y) is the R -// value of pixel (x, y). -// -// validPixelMask is a 16-bit mask where bit (1 << (x + y * 4)) indicates whether -// the corresponding (x,y) pixel is valid. Invalid pixel color values are ignored when compressing. -// -// pOut is an ETC1 compressed version of the data. - -void etc1_encode_block(const etc1_byte* pIn, etc1_uint32 validPixelMask, etc1_byte* pOut); - -// Decode a block of pixels. -// -// pIn is an ETC1 compressed version of the data. -// -// pOut is a pointer to a ETC_DECODED_BLOCK_SIZE array of bytes that represent a -// 4 x 4 square of 3-byte pixels in form R, G, B. Byte (3 * (x + 4 * y) is the R -// value of pixel (x, y). - -void etc1_decode_block(const etc1_byte* pIn, etc1_byte* pOut); - -// Return the size of the encoded image data (does not include size of PKM header). - -etc1_uint32 etc1_get_encoded_data_size(etc1_uint32 width, etc1_uint32 height); - -// Encode an entire image. -// pIn - pointer to the image data. Formatted such that -// pixel (x,y) is at pIn + pixelSize * x + stride * y; -// pOut - pointer to encoded data. Must be large enough to store entire encoded image. -// pixelSize can be 2 or 3. 2 is an GL_UNSIGNED_SHORT_5_6_5 image, 3 is a GL_BYTE RGB image. -// returns non-zero if there is an error. - -int etc1_encode_image(const etc1_byte* pIn, etc1_uint32 width, etc1_uint32 height, - etc1_uint32 pixelSize, etc1_uint32 stride, etc1_byte* pOut); - -// Decode an entire image. -// pIn - pointer to encoded data. -// pOut - pointer to the image data. Will be written such that -// pixel (x,y) is at pIn + pixelSize * x + stride * y. Must be -// large enough to store entire image. -// pixelSize can be 2 or 3. 2 is an GL_UNSIGNED_SHORT_5_6_5 image, 3 is a GL_BYTE RGB image. -// returns non-zero if there is an error. - -int etc1_decode_image(const etc1_byte* pIn, etc1_byte* pOut, - etc1_uint32 width, etc1_uint32 height, - etc1_uint32 pixelSize, etc1_uint32 stride); - -// Size of a PKM header, in bytes. - -#define ETC_PKM_HEADER_SIZE 16 - -// Format a PKM header - -void etc1_pkm_format_header(etc1_byte* pHeader, etc1_uint32 width, etc1_uint32 height); - -// Check if a PKM header is correctly formatted. - -etc1_bool etc1_pkm_is_valid(const etc1_byte* pHeader); - -// Read the image width from a PKM header - -etc1_uint32 etc1_pkm_get_width(const etc1_byte* pHeader); - -// Read the image height from a PKM header - -etc1_uint32 etc1_pkm_get_height(const etc1_byte* pHeader); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/external/s3tc/s3tc.cpp b/external/s3tc/s3tc.cpp deleted file mode 100644 index e7869df631..0000000000 --- a/external/s3tc/s3tc.cpp +++ /dev/null @@ -1,182 +0,0 @@ -/**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - 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 "s3tc.h" - -//Decode S3TC encode block to 4x4 RGB32 pixels -static void s3tc_decode_block(uint8_t **blockData, - uint32_t *decodeBlockData, - unsigned int stride, - bool oneBitAlphaFlag, - uint64_t alpha, - S3TCDecodeFlag decodeFlag) -{ - unsigned int colorValue0 = 0 , colorValue1 = 0, initAlpha = (!oneBitAlphaFlag * 255u) << 24; - unsigned int rb0 = 0, rb1 = 0, rb2 = 0, rb3 = 0, g0 = 0, g1 = 0, g2 = 0, g3 = 0; - - uint32_t colors[4], pixelsIndex = 0; - - /* load the two color values*/ - memcpy((void *)&colorValue0, *blockData, 2); - (*blockData) += 2; - - memcpy((void *)&colorValue1, *blockData, 2); - (*blockData) += 2; - - /* the channel is r5g6b5 , 16 bits */ - rb0 = (colorValue0 << 19 | colorValue0 >> 8) & 0xf800f8; - rb1 = (colorValue1 << 19 | colorValue1 >> 8) & 0xf800f8; - g0 = (colorValue0 << 5) & 0x00fc00; - g1 = (colorValue1 << 5) & 0x00fc00; - g0 += (g0 >> 6) & 0x000300; - g1 += (g1 >> 6) & 0x000300; - - colors[0] = rb0 + g0 + initAlpha; - colors[1] = rb1 + g1 + initAlpha; - - /* interpolate the other two color values */ - if (colorValue0 > colorValue1 || oneBitAlphaFlag) - { - rb2 = (((2*rb0 + rb1) * 21) >> 6) & 0xff00ff; - rb3 = (((2*rb1 + rb0) * 21) >> 6) & 0xff00ff; - g2 = (((2*g0 + g1 ) * 21) >> 6) & 0x00ff00; - g3 = (((2*g1 + g0 ) * 21) >> 6) & 0x00ff00; - colors[3] = rb3 + g3 + initAlpha; - } - else - { - rb2 = ((rb0+rb1) >> 1) & 0xff00ff; - g2 = ((g0 +g1 ) >> 1) & 0x00ff00; - colors[3] = 0 ; - } - colors[2] = rb2 + g2 + initAlpha; - - /*read the pixelsIndex , 2bits per pixel, 4 bytes */ - memcpy((void*)&pixelsIndex, *blockData, 4); - (*blockData) += 4; - - if (S3TCDecodeFlag::DXT5 == decodeFlag) - { - //dxt5 use interpolate alpha - // 8-Alpha block: derive the other six alphas. - // Bit code 000 = alpha0, 001 = alpha1, other are interpolated. - - unsigned int alphaArray[8]; - - alphaArray[0] = (alpha ) & 0xff ; - alphaArray[1] = (alpha >> 8) & 0xff ; - - if (alphaArray[0] >= alphaArray[1]) - { - alphaArray[2] = (alphaArray[0]*6 + alphaArray[1]*1) / 7; - alphaArray[3] = (alphaArray[0]*5 + alphaArray[1]*2) / 7; - alphaArray[4] = (alphaArray[0]*4 + alphaArray[1]*3) / 7; - alphaArray[5] = (alphaArray[0]*3 + alphaArray[1]*4) / 7; - alphaArray[6] = (alphaArray[0]*2 + alphaArray[1]*5) / 7; - alphaArray[7] = (alphaArray[0]*1 + alphaArray[1]*6) / 7; - } - else if (alphaArray[0] < alphaArray[1]) - { - alphaArray[2] = (alphaArray[0]*4 + alphaArray[1]*1) / 5; - alphaArray[3] = (alphaArray[0]*3 + alphaArray[1]*2) / 5; - alphaArray[4] = (alphaArray[0]*2 + alphaArray[1]*3) / 5; - alphaArray[5] = (alphaArray[0]*1 + alphaArray[1]*4) / 5; - alphaArray[6] = 0; - alphaArray[7] = 255; - } - - // read the flowing 48bit indices (16*3) - alpha >>= 16; - - for (int y = 0; y < 4; ++y) - { - for (int x = 0; x < 4; ++x) - { - decodeBlockData[x] = (alphaArray[alpha & 5] << 24) + colors[pixelsIndex & 3]; - pixelsIndex >>= 2; - alpha >>= 3; - } - decodeBlockData += stride; - } - } //if (dxt5 == comFlag) - else - { //dxt1 dxt3 use explicit alpha - for (int y = 0; y < 4; ++y) - { - for (int x = 0; x < 4; ++x) - { - initAlpha = (alpha & 0x0f) << 28; - initAlpha += initAlpha >> 4; - decodeBlockData[x] = initAlpha + colors[pixelsIndex & 3]; - pixelsIndex >>= 2; - alpha >>= 4; - } - decodeBlockData += stride; - } - } -} - -//Decode S3TC encode data to RGB32 -void s3tc_decode(uint8_t *encodeData, //in_data - uint8_t *decodeData, //out_data - const int pixelsWidth, - const int pixelsHeight, - S3TCDecodeFlag decodeFlag) -{ - uint32_t *decodeBlockData = (uint32_t *)decodeData; - for (int block_y = 0; block_y < pixelsHeight / 4; ++block_y, decodeBlockData += 3 * pixelsWidth) //stride = 3*width - { - for(int block_x = 0; block_x < pixelsWidth / 4; ++block_x, decodeBlockData += 4) //skip 4 pixels - { - uint64_t blockAlpha = 0; - - switch (decodeFlag) - { - case S3TCDecodeFlag::DXT1: - { - s3tc_decode_block(&encodeData, decodeBlockData, pixelsWidth, 0, 0LL, S3TCDecodeFlag::DXT1); - } - break; - case S3TCDecodeFlag::DXT3: - { - memcpy((void *)&blockAlpha, encodeData, 8); - encodeData += 8; - s3tc_decode_block(&encodeData, decodeBlockData, pixelsWidth, 1, blockAlpha, S3TCDecodeFlag::DXT3); - } - break; - case S3TCDecodeFlag::DXT5: - { - memcpy((void *)&blockAlpha, encodeData, 8); - encodeData += 8; - s3tc_decode_block(&encodeData, decodeBlockData, pixelsWidth, 1, blockAlpha, S3TCDecodeFlag::DXT5); - } - break; - default: - break; - }//switch - }//for block_x - }//for block_y -} - - diff --git a/external/s3tc/s3tc.h b/external/s3tc/s3tc.h deleted file mode 100644 index a3cf233257..0000000000 --- a/external/s3tc/s3tc.h +++ /dev/null @@ -1,48 +0,0 @@ -/**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - 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 COCOS2DX_PLATFORM_THIRDPARTY_S3TC_ -#define COCOS2DX_PLATFORM_THIRDPARTY_S3TC_ - -#include "CCStdC.h" - -enum class S3TCDecodeFlag -{ - DXT1 = 1, - DXT3 = 3, - DXT5 = 5, -}; - -//Decode S3TC encode data to RGB32 - void s3tc_decode(uint8_t *encode_data, - uint8_t *decode_data, - const int pixelsWidth, - const int pixelsHeight, - S3TCDecodeFlag decodeFlag - ); - - -#endif /* defined(COCOS2DX_PLATFORM_THIRDPARTY_S3TC_) */ - From 49d7bbd6009d28b9e5c4519a7a53e89c7b982a04 Mon Sep 17 00:00:00 2001 From: minggo Date: Sat, 12 Oct 2013 15:41:45 +0800 Subject: [PATCH 24/64] issue #2905: remove sub folders except platform --- cocos/2d/{actions => }/CCAction.cpp | 0 cocos/2d/{actions => }/CCAction.h | 0 cocos/2d/{actions => }/CCActionCamera.cpp | 0 cocos/2d/{actions => }/CCActionCamera.h | 0 cocos/2d/{actions => }/CCActionCatmullRom.cpp | 0 cocos/2d/{actions => }/CCActionCatmullRom.h | 0 cocos/2d/{actions => }/CCActionEase.cpp | 0 cocos/2d/{actions => }/CCActionEase.h | 0 cocos/2d/{actions => }/CCActionGrid.cpp | 0 cocos/2d/{actions => }/CCActionGrid.h | 0 cocos/2d/{actions => }/CCActionGrid3D.cpp | 0 cocos/2d/{actions => }/CCActionGrid3D.h | 0 cocos/2d/{actions => }/CCActionInstant.cpp | 0 cocos/2d/{actions => }/CCActionInstant.h | 0 cocos/2d/{actions => }/CCActionInterval.cpp | 0 cocos/2d/{actions => }/CCActionInterval.h | 0 cocos/2d/{actions => }/CCActionManager.cpp | 0 cocos/2d/{actions => }/CCActionManager.h | 0 cocos/2d/{actions => }/CCActionPageTurn3D.cpp | 0 cocos/2d/{actions => }/CCActionPageTurn3D.h | 0 .../{actions => }/CCActionProgressTimer.cpp | 0 .../2d/{actions => }/CCActionProgressTimer.h | 0 cocos/2d/{actions => }/CCActionTiledGrid.cpp | 0 cocos/2d/{actions => }/CCActionTiledGrid.h | 0 cocos/2d/{actions => }/CCActionTween.cpp | 0 cocos/2d/{actions => }/CCActionTween.h | 0 cocos/2d/{sprite-nodes => }/CCAnimation.cpp | 0 cocos/2d/{sprite-nodes => }/CCAnimation.h | 0 .../{sprite-nodes => }/CCAnimationCache.cpp | 0 .../2d/{sprite-nodes => }/CCAnimationCache.h | 0 cocos/2d/{base-nodes => }/CCAtlasNode.cpp | 0 cocos/2d/{base-nodes => }/CCAtlasNode.h | 0 cocos/2d/{misc-nodes => }/CCClippingNode.cpp | 0 cocos/2d/{misc-nodes => }/CCClippingNode.h | 0 .../{support/component => }/CCComponent.cpp | 0 .../2d/{support/component => }/CCComponent.h | 0 .../component => }/CCComponentContainer.cpp | 0 .../component => }/CCComponentContainer.h | 0 cocos/2d/{include => }/CCDeprecated.h | 0 cocos/2d/{draw-nodes => }/CCDrawNode.cpp | 0 cocos/2d/{draw-nodes => }/CCDrawNode.h | 0 .../{draw-nodes => }/CCDrawingPrimitives.cpp | 0 .../2d/{draw-nodes => }/CCDrawingPrimitives.h | 0 cocos/2d/{event-dispatcher => }/CCEvent.cpp | 0 cocos/2d/{event-dispatcher => }/CCEvent.h | 0 .../CCEventAcceleration.cpp | 0 .../CCEventAcceleration.h | 0 .../{event-dispatcher => }/CCEventCustom.cpp | 0 .../2d/{event-dispatcher => }/CCEventCustom.h | 0 .../CCEventDispatcher.cpp | 0 .../CCEventDispatcher.h | 0 .../CCEventKeyboard.cpp | 0 .../{event-dispatcher => }/CCEventKeyboard.h | 0 .../CCEventListener.cpp | 0 .../{event-dispatcher => }/CCEventListener.h | 0 .../CCEventListenerAcceleration.cpp | 0 .../CCEventListenerAcceleration.h | 0 .../CCEventListenerCustom.cpp | 0 .../CCEventListenerCustom.h | 0 .../CCEventListenerKeyboard.cpp | 0 .../CCEventListenerKeyboard.h | 0 .../CCEventListenerTouch.cpp | 0 .../CCEventListenerTouch.h | 0 .../{event-dispatcher => }/CCEventTouch.cpp | 0 .../2d/{event-dispatcher => }/CCEventTouch.h | 0 cocos/2d/{include => }/CCEventType.h | 0 cocos/2d/{label-nodes => }/CCFont.cpp | 0 cocos/2d/{label-nodes => }/CCFont.h | 0 cocos/2d/{label-nodes => }/CCFontAtlas.cpp | 0 cocos/2d/{label-nodes => }/CCFontAtlas.h | 0 .../2d/{label-nodes => }/CCFontAtlasCache.cpp | 0 cocos/2d/{label-nodes => }/CCFontAtlasCache.h | 0 .../{label-nodes => }/CCFontAtlasFactory.cpp | 0 .../2d/{label-nodes => }/CCFontAtlasFactory.h | 0 .../2d/{label-nodes => }/CCFontDefinition.cpp | 0 cocos/2d/{label-nodes => }/CCFontDefinition.h | 0 cocos/2d/{label-nodes => }/CCFontFNT.cpp | 0 cocos/2d/{label-nodes => }/CCFontFNT.h | 0 cocos/2d/{label-nodes => }/CCFontFreeType.cpp | 0 cocos/2d/{label-nodes => }/CCFontFreeType.h | 0 .../2d/{base-nodes => }/CCGLBufferedNode.cpp | 0 cocos/2d/{base-nodes => }/CCGLBufferedNode.h | 0 cocos/2d/{shaders => }/CCGLProgram.cpp | 0 cocos/2d/{shaders => }/CCGLProgram.h | 0 cocos/2d/{effects => }/CCGrabber.cpp | 0 cocos/2d/{effects => }/CCGrabber.h | 0 cocos/2d/{effects => }/CCGrid.cpp | 0 cocos/2d/{effects => }/CCGrid.h | 0 .../2d/{text-input-node => }/CCIMEDelegate.h | 0 .../{text-input-node => }/CCIMEDispatcher.cpp | 0 .../{text-input-node => }/CCIMEDispatcher.h | 0 cocos/2d/{label-nodes => }/CCLabel.cpp | 0 cocos/2d/{label-nodes => }/CCLabel.h | 0 cocos/2d/{label-nodes => }/CCLabelAtlas.cpp | 0 cocos/2d/{label-nodes => }/CCLabelAtlas.h | 0 cocos/2d/{label-nodes => }/CCLabelBMFont.cpp | 0 cocos/2d/{label-nodes => }/CCLabelBMFont.h | 0 cocos/2d/{label-nodes => }/CCLabelTTF.cpp | 0 cocos/2d/{label-nodes => }/CCLabelTTF.h | 0 .../CCLabelTextFormatProtocol.h | 0 .../CCLabelTextFormatter.cpp | 0 .../{label-nodes => }/CCLabelTextFormatter.h | 0 .../CCLayer.cpp | 0 .../CCLayer.h | 0 cocos/2d/{menu-nodes => }/CCMenu.cpp | 0 cocos/2d/{menu-nodes => }/CCMenu.h | 0 cocos/2d/{menu-nodes => }/CCMenuItem.cpp | 0 cocos/2d/{menu-nodes => }/CCMenuItem.h | 0 cocos/2d/{misc-nodes => }/CCMotionStreak.cpp | 0 cocos/2d/{misc-nodes => }/CCMotionStreak.h | 0 cocos/2d/{base-nodes => }/CCNode.cpp | 0 cocos/2d/{base-nodes => }/CCNode.h | 0 .../2d/{support => }/CCNotificationCenter.cpp | 0 cocos/2d/{support => }/CCNotificationCenter.h | 0 .../CCParallaxNode.cpp | 0 .../CCParallaxNode.h | 0 .../CCParticleBatchNode.cpp | 0 .../CCParticleBatchNode.h | 0 .../CCParticleExamples.cpp | 0 .../{particle-nodes => }/CCParticleExamples.h | 0 .../{particle-nodes => }/CCParticleSystem.cpp | 0 .../{particle-nodes => }/CCParticleSystem.h | 0 .../CCParticleSystemQuad.cpp | 0 .../CCParticleSystemQuad.h | 0 cocos/2d/{support => }/CCProfiling.cpp | 0 cocos/2d/{support => }/CCProfiling.h | 0 cocos/2d/{misc-nodes => }/CCProgressTimer.cpp | 0 cocos/2d/{misc-nodes => }/CCProgressTimer.h | 0 cocos/2d/{include => }/CCProtocols.h | 0 cocos/2d/{misc-nodes => }/CCRenderTexture.cpp | 0 cocos/2d/{misc-nodes => }/CCRenderTexture.h | 0 .../CCScene.cpp | 0 .../CCScene.h | 0 .../{script-support => }/CCScriptSupport.cpp | 0 .../2d/{script-support => }/CCScriptSupport.h | 0 cocos/2d/{shaders => }/CCShaderCache.cpp | 0 cocos/2d/{shaders => }/CCShaderCache.h | 0 cocos/2d/{sprite-nodes => }/CCSprite.cpp | 0 cocos/2d/{sprite-nodes => }/CCSprite.h | 0 .../{sprite-nodes => }/CCSpriteBatchNode.cpp | 0 .../2d/{sprite-nodes => }/CCSpriteBatchNode.h | 0 cocos/2d/{sprite-nodes => }/CCSpriteFrame.cpp | 0 cocos/2d/{sprite-nodes => }/CCSpriteFrame.h | 0 .../{sprite-nodes => }/CCSpriteFrameCache.cpp | 0 .../{sprite-nodes => }/CCSpriteFrameCache.h | 0 .../CCTMXLayer.cpp | 0 .../{tilemap-parallax-nodes => }/CCTMXLayer.h | 0 .../CCTMXObjectGroup.cpp | 0 .../CCTMXObjectGroup.h | 0 .../CCTMXTiledMap.cpp | 0 .../CCTMXTiledMap.h | 0 .../CCTMXXMLParser.cpp | 0 .../CCTMXXMLParser.h | 0 .../{text-input-node => }/CCTextFieldTTF.cpp | 0 .../2d/{text-input-node => }/CCTextFieldTTF.h | 0 cocos/2d/{label-nodes => }/CCTextImage.cpp | 0 cocos/2d/{label-nodes => }/CCTextImage.h | 0 cocos/2d/{textures => }/CCTexture2D.cpp | 0 cocos/2d/{textures => }/CCTexture2D.h | 0 cocos/2d/{textures => }/CCTextureAtlas.cpp | 0 cocos/2d/{textures => }/CCTextureAtlas.h | 0 cocos/2d/{textures => }/CCTextureCache.cpp | 0 cocos/2d/{textures => }/CCTextureCache.h | 0 .../CCTileMapAtlas.cpp | 0 .../CCTileMapAtlas.h | 0 cocos/2d/{event-dispatcher => }/CCTouch.cpp | 0 cocos/2d/{event-dispatcher => }/CCTouch.h | 0 .../CCTransition.cpp | 0 .../CCTransition.h | 0 .../CCTransitionPageTurn.cpp | 0 .../CCTransitionPageTurn.h | 0 .../CCTransitionProgress.cpp | 0 .../CCTransitionProgress.h | 0 .../user_default => }/CCUserDefault.cpp | 0 .../user_default => }/CCUserDefault.h | 0 .../user_default => }/CCUserDefault.mm | 0 .../CCUserDefaultAndroid.cpp | 0 cocos/2d/{support => }/CCVertex.cpp | 0 cocos/2d/{support => }/CCVertex.h | 0 cocos/2d/{proj.linux => }/Makefile | 0 .../2d/{support/image_support => }/TGAlib.cpp | 0 cocos/2d/{support/image_support => }/TGAlib.h | 0 cocos/2d/{support => }/TransformUtils.cpp | 0 cocos/2d/{support => }/TransformUtils.h | 0 .../2d/{support/zip_support => }/ZipUtils.cpp | 0 cocos/2d/{support/zip_support => }/ZipUtils.h | 0 cocos/2d/{support => }/base64.cpp | 0 cocos/2d/{support => }/base64.h | 0 .../{support/data_support => }/ccCArray.cpp | 0 .../2d/{support/data_support => }/ccCArray.h | 0 cocos/2d/{include => }/ccConfig.h | 0 cocos/2d/{shaders => }/ccGLStateCache.cpp | 0 cocos/2d/{shaders => }/ccGLStateCache.h | 0 cocos/2d/{include => }/ccMacros.h | 0 .../ccShaderEx_SwitchMask_frag.h | 0 ...ccShader_PositionColorLengthTexture_frag.h | 0 ...ccShader_PositionColorLengthTexture_vert.h | 0 .../ccShader_PositionColor_frag.h | 0 .../ccShader_PositionColor_vert.h | 0 .../ccShader_PositionTextureA8Color_frag.h | 0 .../ccShader_PositionTextureA8Color_vert.h | 0 ...hader_PositionTextureColorAlphaTest_frag.h | 0 .../ccShader_PositionTextureColor_frag.h | 0 .../ccShader_PositionTextureColor_vert.h | 0 .../ccShader_PositionTexture_frag.h | 0 .../ccShader_PositionTexture_uColor_frag.h | 0 .../ccShader_PositionTexture_uColor_vert.h | 0 .../ccShader_PositionTexture_vert.h | 0 .../ccShader_Position_uColor_frag.h | 0 .../ccShader_Position_uColor_vert.h | 0 cocos/2d/{shaders => }/ccShaders.cpp | 0 cocos/2d/{shaders => }/ccShaders.h | 0 cocos/2d/{include => }/ccTypes.h | 0 cocos/2d/{support => }/ccUTF8.cpp | 0 cocos/2d/{support => }/ccUTF8.h | 0 cocos/2d/{support => }/ccUtils.h | 0 cocos/2d/{include => }/cocos2d.h | 0 cocos/2d/{proj.win32 => }/cocos2d.vcxproj | 0 .../{proj.win32 => }/cocos2d.vcxproj.filters | 0 .../2d/{proj.win32 => }/cocos2d.vcxproj.user | 0 cocos/2d/{proj.linux => }/cocos2dx.mk | 0 cocos/2d/{proj.win32 => }/cocos2dx.props | 0 cocos/2d/{particle-nodes => }/firePngData.h | 0 cocos/2d/proj.linux/.cproject | 602 ----- cocos/2d/proj.linux/.project | 256 -- cocos/2d/proj.linux/cocos2dx.prf | 37 - cocos/2d/proj.linux/cocos2dx.pri | 70 - cocos/2d/support/ccUtils.cpp | 39 - cocos/2d/support/tinyxml2/tinyxml2.cpp | 2101 ---------------- cocos/2d/support/tinyxml2/tinyxml2.h | 1914 --------------- cocos/2d/support/zip_support/ioapi.cpp | 245 -- cocos/2d/support/zip_support/ioapi.h | 201 -- cocos/2d/support/zip_support/unzip.cpp | 2161 ----------------- cocos/2d/support/zip_support/unzip.h | 455 ---- cocos/2d/{support/data_support => }/uthash.h | 0 cocos/2d/{support/data_support => }/utlist.h | 0 cocos/platform/CCPlatformConfig.h | 140 -- cocos/platform/CCPlatformMacros.h | 301 --- cocos/platform/cocoa/CCAffineTransform.cpp | 132 - cocos/platform/cocoa/CCAffineTransform.h | 63 - cocos/platform/cocoa/CCArray.cpp | 754 ------ cocos/platform/cocoa/CCArray.h | 557 ----- cocos/platform/cocoa/CCAutoreleasePool.cpp | 204 -- cocos/platform/cocoa/CCAutoreleasePool.h | 181 -- cocos/platform/cocoa/CCBool.h | 70 - cocos/platform/cocoa/CCData.cpp | 61 - cocos/platform/cocoa/CCData.h | 88 - cocos/platform/cocoa/CCDataVisitor.cpp | 240 -- cocos/platform/cocoa/CCDataVisitor.h | 117 - cocos/platform/cocoa/CCDictionary.cpp | 454 ---- cocos/platform/cocoa/CCDictionary.h | 458 ---- cocos/platform/cocoa/CCDouble.h | 70 - cocos/platform/cocoa/CCFloat.h | 71 - cocos/platform/cocoa/CCGeometry.cpp | 463 ---- cocos/platform/cocoa/CCGeometry.h | 564 ----- cocos/platform/cocoa/CCInteger.h | 79 - cocos/platform/cocoa/CCNS.cpp | 185 -- cocos/platform/cocoa/CCNS.h | 80 - cocos/platform/cocoa/CCObject.cpp | 93 - cocos/platform/cocoa/CCObject.h | 216 -- cocos/platform/cocoa/CCSet.cpp | 166 -- cocos/platform/cocoa/CCSet.h | 119 - cocos/platform/cocoa/CCString.cpp | 277 --- cocos/platform/cocoa/CCString.h | 210 -- 264 files changed, 14494 deletions(-) rename cocos/2d/{actions => }/CCAction.cpp (100%) rename cocos/2d/{actions => }/CCAction.h (100%) rename cocos/2d/{actions => }/CCActionCamera.cpp (100%) rename cocos/2d/{actions => }/CCActionCamera.h (100%) rename cocos/2d/{actions => }/CCActionCatmullRom.cpp (100%) rename cocos/2d/{actions => }/CCActionCatmullRom.h (100%) rename cocos/2d/{actions => }/CCActionEase.cpp (100%) rename cocos/2d/{actions => }/CCActionEase.h (100%) rename cocos/2d/{actions => }/CCActionGrid.cpp (100%) rename cocos/2d/{actions => }/CCActionGrid.h (100%) rename cocos/2d/{actions => }/CCActionGrid3D.cpp (100%) rename cocos/2d/{actions => }/CCActionGrid3D.h (100%) rename cocos/2d/{actions => }/CCActionInstant.cpp (100%) rename cocos/2d/{actions => }/CCActionInstant.h (100%) rename cocos/2d/{actions => }/CCActionInterval.cpp (100%) rename cocos/2d/{actions => }/CCActionInterval.h (100%) rename cocos/2d/{actions => }/CCActionManager.cpp (100%) rename cocos/2d/{actions => }/CCActionManager.h (100%) rename cocos/2d/{actions => }/CCActionPageTurn3D.cpp (100%) rename cocos/2d/{actions => }/CCActionPageTurn3D.h (100%) rename cocos/2d/{actions => }/CCActionProgressTimer.cpp (100%) rename cocos/2d/{actions => }/CCActionProgressTimer.h (100%) rename cocos/2d/{actions => }/CCActionTiledGrid.cpp (100%) rename cocos/2d/{actions => }/CCActionTiledGrid.h (100%) rename cocos/2d/{actions => }/CCActionTween.cpp (100%) rename cocos/2d/{actions => }/CCActionTween.h (100%) rename cocos/2d/{sprite-nodes => }/CCAnimation.cpp (100%) rename cocos/2d/{sprite-nodes => }/CCAnimation.h (100%) rename cocos/2d/{sprite-nodes => }/CCAnimationCache.cpp (100%) rename cocos/2d/{sprite-nodes => }/CCAnimationCache.h (100%) rename cocos/2d/{base-nodes => }/CCAtlasNode.cpp (100%) rename cocos/2d/{base-nodes => }/CCAtlasNode.h (100%) rename cocos/2d/{misc-nodes => }/CCClippingNode.cpp (100%) rename cocos/2d/{misc-nodes => }/CCClippingNode.h (100%) rename cocos/2d/{support/component => }/CCComponent.cpp (100%) rename cocos/2d/{support/component => }/CCComponent.h (100%) rename cocos/2d/{support/component => }/CCComponentContainer.cpp (100%) rename cocos/2d/{support/component => }/CCComponentContainer.h (100%) rename cocos/2d/{include => }/CCDeprecated.h (100%) rename cocos/2d/{draw-nodes => }/CCDrawNode.cpp (100%) rename cocos/2d/{draw-nodes => }/CCDrawNode.h (100%) rename cocos/2d/{draw-nodes => }/CCDrawingPrimitives.cpp (100%) rename cocos/2d/{draw-nodes => }/CCDrawingPrimitives.h (100%) rename cocos/2d/{event-dispatcher => }/CCEvent.cpp (100%) rename cocos/2d/{event-dispatcher => }/CCEvent.h (100%) rename cocos/2d/{event-dispatcher => }/CCEventAcceleration.cpp (100%) rename cocos/2d/{event-dispatcher => }/CCEventAcceleration.h (100%) rename cocos/2d/{event-dispatcher => }/CCEventCustom.cpp (100%) rename cocos/2d/{event-dispatcher => }/CCEventCustom.h (100%) rename cocos/2d/{event-dispatcher => }/CCEventDispatcher.cpp (100%) rename cocos/2d/{event-dispatcher => }/CCEventDispatcher.h (100%) rename cocos/2d/{event-dispatcher => }/CCEventKeyboard.cpp (100%) rename cocos/2d/{event-dispatcher => }/CCEventKeyboard.h (100%) rename cocos/2d/{event-dispatcher => }/CCEventListener.cpp (100%) rename cocos/2d/{event-dispatcher => }/CCEventListener.h (100%) rename cocos/2d/{event-dispatcher => }/CCEventListenerAcceleration.cpp (100%) rename cocos/2d/{event-dispatcher => }/CCEventListenerAcceleration.h (100%) rename cocos/2d/{event-dispatcher => }/CCEventListenerCustom.cpp (100%) rename cocos/2d/{event-dispatcher => }/CCEventListenerCustom.h (100%) rename cocos/2d/{event-dispatcher => }/CCEventListenerKeyboard.cpp (100%) rename cocos/2d/{event-dispatcher => }/CCEventListenerKeyboard.h (100%) rename cocos/2d/{event-dispatcher => }/CCEventListenerTouch.cpp (100%) rename cocos/2d/{event-dispatcher => }/CCEventListenerTouch.h (100%) rename cocos/2d/{event-dispatcher => }/CCEventTouch.cpp (100%) rename cocos/2d/{event-dispatcher => }/CCEventTouch.h (100%) rename cocos/2d/{include => }/CCEventType.h (100%) rename cocos/2d/{label-nodes => }/CCFont.cpp (100%) rename cocos/2d/{label-nodes => }/CCFont.h (100%) rename cocos/2d/{label-nodes => }/CCFontAtlas.cpp (100%) rename cocos/2d/{label-nodes => }/CCFontAtlas.h (100%) rename cocos/2d/{label-nodes => }/CCFontAtlasCache.cpp (100%) rename cocos/2d/{label-nodes => }/CCFontAtlasCache.h (100%) rename cocos/2d/{label-nodes => }/CCFontAtlasFactory.cpp (100%) rename cocos/2d/{label-nodes => }/CCFontAtlasFactory.h (100%) rename cocos/2d/{label-nodes => }/CCFontDefinition.cpp (100%) rename cocos/2d/{label-nodes => }/CCFontDefinition.h (100%) rename cocos/2d/{label-nodes => }/CCFontFNT.cpp (100%) rename cocos/2d/{label-nodes => }/CCFontFNT.h (100%) rename cocos/2d/{label-nodes => }/CCFontFreeType.cpp (100%) rename cocos/2d/{label-nodes => }/CCFontFreeType.h (100%) rename cocos/2d/{base-nodes => }/CCGLBufferedNode.cpp (100%) rename cocos/2d/{base-nodes => }/CCGLBufferedNode.h (100%) rename cocos/2d/{shaders => }/CCGLProgram.cpp (100%) rename cocos/2d/{shaders => }/CCGLProgram.h (100%) rename cocos/2d/{effects => }/CCGrabber.cpp (100%) rename cocos/2d/{effects => }/CCGrabber.h (100%) rename cocos/2d/{effects => }/CCGrid.cpp (100%) rename cocos/2d/{effects => }/CCGrid.h (100%) rename cocos/2d/{text-input-node => }/CCIMEDelegate.h (100%) rename cocos/2d/{text-input-node => }/CCIMEDispatcher.cpp (100%) rename cocos/2d/{text-input-node => }/CCIMEDispatcher.h (100%) rename cocos/2d/{label-nodes => }/CCLabel.cpp (100%) rename cocos/2d/{label-nodes => }/CCLabel.h (100%) rename cocos/2d/{label-nodes => }/CCLabelAtlas.cpp (100%) rename cocos/2d/{label-nodes => }/CCLabelAtlas.h (100%) rename cocos/2d/{label-nodes => }/CCLabelBMFont.cpp (100%) rename cocos/2d/{label-nodes => }/CCLabelBMFont.h (100%) rename cocos/2d/{label-nodes => }/CCLabelTTF.cpp (100%) rename cocos/2d/{label-nodes => }/CCLabelTTF.h (100%) rename cocos/2d/{label-nodes => }/CCLabelTextFormatProtocol.h (100%) rename cocos/2d/{label-nodes => }/CCLabelTextFormatter.cpp (100%) rename cocos/2d/{label-nodes => }/CCLabelTextFormatter.h (100%) rename cocos/2d/{layers-scenes-transitions-nodes => }/CCLayer.cpp (100%) rename cocos/2d/{layers-scenes-transitions-nodes => }/CCLayer.h (100%) rename cocos/2d/{menu-nodes => }/CCMenu.cpp (100%) rename cocos/2d/{menu-nodes => }/CCMenu.h (100%) rename cocos/2d/{menu-nodes => }/CCMenuItem.cpp (100%) rename cocos/2d/{menu-nodes => }/CCMenuItem.h (100%) rename cocos/2d/{misc-nodes => }/CCMotionStreak.cpp (100%) rename cocos/2d/{misc-nodes => }/CCMotionStreak.h (100%) rename cocos/2d/{base-nodes => }/CCNode.cpp (100%) rename cocos/2d/{base-nodes => }/CCNode.h (100%) rename cocos/2d/{support => }/CCNotificationCenter.cpp (100%) rename cocos/2d/{support => }/CCNotificationCenter.h (100%) rename cocos/2d/{tilemap-parallax-nodes => }/CCParallaxNode.cpp (100%) rename cocos/2d/{tilemap-parallax-nodes => }/CCParallaxNode.h (100%) rename cocos/2d/{particle-nodes => }/CCParticleBatchNode.cpp (100%) rename cocos/2d/{particle-nodes => }/CCParticleBatchNode.h (100%) rename cocos/2d/{particle-nodes => }/CCParticleExamples.cpp (100%) rename cocos/2d/{particle-nodes => }/CCParticleExamples.h (100%) rename cocos/2d/{particle-nodes => }/CCParticleSystem.cpp (100%) rename cocos/2d/{particle-nodes => }/CCParticleSystem.h (100%) rename cocos/2d/{particle-nodes => }/CCParticleSystemQuad.cpp (100%) rename cocos/2d/{particle-nodes => }/CCParticleSystemQuad.h (100%) rename cocos/2d/{support => }/CCProfiling.cpp (100%) rename cocos/2d/{support => }/CCProfiling.h (100%) rename cocos/2d/{misc-nodes => }/CCProgressTimer.cpp (100%) rename cocos/2d/{misc-nodes => }/CCProgressTimer.h (100%) rename cocos/2d/{include => }/CCProtocols.h (100%) rename cocos/2d/{misc-nodes => }/CCRenderTexture.cpp (100%) rename cocos/2d/{misc-nodes => }/CCRenderTexture.h (100%) rename cocos/2d/{layers-scenes-transitions-nodes => }/CCScene.cpp (100%) rename cocos/2d/{layers-scenes-transitions-nodes => }/CCScene.h (100%) rename cocos/2d/{script-support => }/CCScriptSupport.cpp (100%) rename cocos/2d/{script-support => }/CCScriptSupport.h (100%) rename cocos/2d/{shaders => }/CCShaderCache.cpp (100%) rename cocos/2d/{shaders => }/CCShaderCache.h (100%) rename cocos/2d/{sprite-nodes => }/CCSprite.cpp (100%) rename cocos/2d/{sprite-nodes => }/CCSprite.h (100%) rename cocos/2d/{sprite-nodes => }/CCSpriteBatchNode.cpp (100%) rename cocos/2d/{sprite-nodes => }/CCSpriteBatchNode.h (100%) rename cocos/2d/{sprite-nodes => }/CCSpriteFrame.cpp (100%) rename cocos/2d/{sprite-nodes => }/CCSpriteFrame.h (100%) rename cocos/2d/{sprite-nodes => }/CCSpriteFrameCache.cpp (100%) rename cocos/2d/{sprite-nodes => }/CCSpriteFrameCache.h (100%) rename cocos/2d/{tilemap-parallax-nodes => }/CCTMXLayer.cpp (100%) rename cocos/2d/{tilemap-parallax-nodes => }/CCTMXLayer.h (100%) rename cocos/2d/{tilemap-parallax-nodes => }/CCTMXObjectGroup.cpp (100%) rename cocos/2d/{tilemap-parallax-nodes => }/CCTMXObjectGroup.h (100%) rename cocos/2d/{tilemap-parallax-nodes => }/CCTMXTiledMap.cpp (100%) rename cocos/2d/{tilemap-parallax-nodes => }/CCTMXTiledMap.h (100%) rename cocos/2d/{tilemap-parallax-nodes => }/CCTMXXMLParser.cpp (100%) rename cocos/2d/{tilemap-parallax-nodes => }/CCTMXXMLParser.h (100%) rename cocos/2d/{text-input-node => }/CCTextFieldTTF.cpp (100%) rename cocos/2d/{text-input-node => }/CCTextFieldTTF.h (100%) rename cocos/2d/{label-nodes => }/CCTextImage.cpp (100%) rename cocos/2d/{label-nodes => }/CCTextImage.h (100%) rename cocos/2d/{textures => }/CCTexture2D.cpp (100%) rename cocos/2d/{textures => }/CCTexture2D.h (100%) rename cocos/2d/{textures => }/CCTextureAtlas.cpp (100%) rename cocos/2d/{textures => }/CCTextureAtlas.h (100%) rename cocos/2d/{textures => }/CCTextureCache.cpp (100%) rename cocos/2d/{textures => }/CCTextureCache.h (100%) rename cocos/2d/{tilemap-parallax-nodes => }/CCTileMapAtlas.cpp (100%) rename cocos/2d/{tilemap-parallax-nodes => }/CCTileMapAtlas.h (100%) rename cocos/2d/{event-dispatcher => }/CCTouch.cpp (100%) rename cocos/2d/{event-dispatcher => }/CCTouch.h (100%) rename cocos/2d/{layers-scenes-transitions-nodes => }/CCTransition.cpp (100%) rename cocos/2d/{layers-scenes-transitions-nodes => }/CCTransition.h (100%) rename cocos/2d/{layers-scenes-transitions-nodes => }/CCTransitionPageTurn.cpp (100%) rename cocos/2d/{layers-scenes-transitions-nodes => }/CCTransitionPageTurn.h (100%) rename cocos/2d/{layers-scenes-transitions-nodes => }/CCTransitionProgress.cpp (100%) rename cocos/2d/{layers-scenes-transitions-nodes => }/CCTransitionProgress.h (100%) rename cocos/2d/{support/user_default => }/CCUserDefault.cpp (100%) rename cocos/2d/{support/user_default => }/CCUserDefault.h (100%) rename cocos/2d/{support/user_default => }/CCUserDefault.mm (100%) rename cocos/2d/{support/user_default => }/CCUserDefaultAndroid.cpp (100%) rename cocos/2d/{support => }/CCVertex.cpp (100%) rename cocos/2d/{support => }/CCVertex.h (100%) rename cocos/2d/{proj.linux => }/Makefile (100%) rename cocos/2d/{support/image_support => }/TGAlib.cpp (100%) rename cocos/2d/{support/image_support => }/TGAlib.h (100%) rename cocos/2d/{support => }/TransformUtils.cpp (100%) rename cocos/2d/{support => }/TransformUtils.h (100%) rename cocos/2d/{support/zip_support => }/ZipUtils.cpp (100%) rename cocos/2d/{support/zip_support => }/ZipUtils.h (100%) rename cocos/2d/{support => }/base64.cpp (100%) rename cocos/2d/{support => }/base64.h (100%) rename cocos/2d/{support/data_support => }/ccCArray.cpp (100%) rename cocos/2d/{support/data_support => }/ccCArray.h (100%) rename cocos/2d/{include => }/ccConfig.h (100%) rename cocos/2d/{shaders => }/ccGLStateCache.cpp (100%) rename cocos/2d/{shaders => }/ccGLStateCache.h (100%) rename cocos/2d/{include => }/ccMacros.h (100%) rename cocos/2d/{shaders => }/ccShaderEx_SwitchMask_frag.h (100%) rename cocos/2d/{shaders => }/ccShader_PositionColorLengthTexture_frag.h (100%) rename cocos/2d/{shaders => }/ccShader_PositionColorLengthTexture_vert.h (100%) rename cocos/2d/{shaders => }/ccShader_PositionColor_frag.h (100%) rename cocos/2d/{shaders => }/ccShader_PositionColor_vert.h (100%) rename cocos/2d/{shaders => }/ccShader_PositionTextureA8Color_frag.h (100%) rename cocos/2d/{shaders => }/ccShader_PositionTextureA8Color_vert.h (100%) rename cocos/2d/{shaders => }/ccShader_PositionTextureColorAlphaTest_frag.h (100%) rename cocos/2d/{shaders => }/ccShader_PositionTextureColor_frag.h (100%) rename cocos/2d/{shaders => }/ccShader_PositionTextureColor_vert.h (100%) rename cocos/2d/{shaders => }/ccShader_PositionTexture_frag.h (100%) rename cocos/2d/{shaders => }/ccShader_PositionTexture_uColor_frag.h (100%) rename cocos/2d/{shaders => }/ccShader_PositionTexture_uColor_vert.h (100%) rename cocos/2d/{shaders => }/ccShader_PositionTexture_vert.h (100%) rename cocos/2d/{shaders => }/ccShader_Position_uColor_frag.h (100%) rename cocos/2d/{shaders => }/ccShader_Position_uColor_vert.h (100%) rename cocos/2d/{shaders => }/ccShaders.cpp (100%) rename cocos/2d/{shaders => }/ccShaders.h (100%) rename cocos/2d/{include => }/ccTypes.h (100%) rename cocos/2d/{support => }/ccUTF8.cpp (100%) rename cocos/2d/{support => }/ccUTF8.h (100%) rename cocos/2d/{support => }/ccUtils.h (100%) rename cocos/2d/{include => }/cocos2d.h (100%) rename cocos/2d/{proj.win32 => }/cocos2d.vcxproj (100%) rename cocos/2d/{proj.win32 => }/cocos2d.vcxproj.filters (100%) rename cocos/2d/{proj.win32 => }/cocos2d.vcxproj.user (100%) rename cocos/2d/{proj.linux => }/cocos2dx.mk (100%) rename cocos/2d/{proj.win32 => }/cocos2dx.props (100%) rename cocos/2d/{particle-nodes => }/firePngData.h (100%) delete mode 100755 cocos/2d/proj.linux/.cproject delete mode 100755 cocos/2d/proj.linux/.project delete mode 100644 cocos/2d/proj.linux/cocos2dx.prf delete mode 100644 cocos/2d/proj.linux/cocos2dx.pri delete mode 100644 cocos/2d/support/ccUtils.cpp delete mode 100644 cocos/2d/support/tinyxml2/tinyxml2.cpp delete mode 100644 cocos/2d/support/tinyxml2/tinyxml2.h delete mode 100644 cocos/2d/support/zip_support/ioapi.cpp delete mode 100644 cocos/2d/support/zip_support/ioapi.h delete mode 100644 cocos/2d/support/zip_support/unzip.cpp delete mode 100644 cocos/2d/support/zip_support/unzip.h rename cocos/2d/{support/data_support => }/uthash.h (100%) rename cocos/2d/{support/data_support => }/utlist.h (100%) delete mode 100644 cocos/platform/CCPlatformConfig.h delete mode 100644 cocos/platform/CCPlatformMacros.h delete mode 100644 cocos/platform/cocoa/CCAffineTransform.cpp delete mode 100644 cocos/platform/cocoa/CCAffineTransform.h delete mode 100644 cocos/platform/cocoa/CCArray.cpp delete mode 100644 cocos/platform/cocoa/CCArray.h delete mode 100644 cocos/platform/cocoa/CCAutoreleasePool.cpp delete mode 100644 cocos/platform/cocoa/CCAutoreleasePool.h delete mode 100644 cocos/platform/cocoa/CCBool.h delete mode 100644 cocos/platform/cocoa/CCData.cpp delete mode 100644 cocos/platform/cocoa/CCData.h delete mode 100644 cocos/platform/cocoa/CCDataVisitor.cpp delete mode 100644 cocos/platform/cocoa/CCDataVisitor.h delete mode 100644 cocos/platform/cocoa/CCDictionary.cpp delete mode 100644 cocos/platform/cocoa/CCDictionary.h delete mode 100644 cocos/platform/cocoa/CCDouble.h delete mode 100644 cocos/platform/cocoa/CCFloat.h delete mode 100644 cocos/platform/cocoa/CCGeometry.cpp delete mode 100644 cocos/platform/cocoa/CCGeometry.h delete mode 100644 cocos/platform/cocoa/CCInteger.h delete mode 100644 cocos/platform/cocoa/CCNS.cpp delete mode 100644 cocos/platform/cocoa/CCNS.h delete mode 100644 cocos/platform/cocoa/CCObject.cpp delete mode 100644 cocos/platform/cocoa/CCObject.h delete mode 100644 cocos/platform/cocoa/CCSet.cpp delete mode 100644 cocos/platform/cocoa/CCSet.h delete mode 100644 cocos/platform/cocoa/CCString.cpp delete mode 100644 cocos/platform/cocoa/CCString.h diff --git a/cocos/2d/actions/CCAction.cpp b/cocos/2d/CCAction.cpp similarity index 100% rename from cocos/2d/actions/CCAction.cpp rename to cocos/2d/CCAction.cpp diff --git a/cocos/2d/actions/CCAction.h b/cocos/2d/CCAction.h similarity index 100% rename from cocos/2d/actions/CCAction.h rename to cocos/2d/CCAction.h diff --git a/cocos/2d/actions/CCActionCamera.cpp b/cocos/2d/CCActionCamera.cpp similarity index 100% rename from cocos/2d/actions/CCActionCamera.cpp rename to cocos/2d/CCActionCamera.cpp diff --git a/cocos/2d/actions/CCActionCamera.h b/cocos/2d/CCActionCamera.h similarity index 100% rename from cocos/2d/actions/CCActionCamera.h rename to cocos/2d/CCActionCamera.h diff --git a/cocos/2d/actions/CCActionCatmullRom.cpp b/cocos/2d/CCActionCatmullRom.cpp similarity index 100% rename from cocos/2d/actions/CCActionCatmullRom.cpp rename to cocos/2d/CCActionCatmullRom.cpp diff --git a/cocos/2d/actions/CCActionCatmullRom.h b/cocos/2d/CCActionCatmullRom.h similarity index 100% rename from cocos/2d/actions/CCActionCatmullRom.h rename to cocos/2d/CCActionCatmullRom.h diff --git a/cocos/2d/actions/CCActionEase.cpp b/cocos/2d/CCActionEase.cpp similarity index 100% rename from cocos/2d/actions/CCActionEase.cpp rename to cocos/2d/CCActionEase.cpp diff --git a/cocos/2d/actions/CCActionEase.h b/cocos/2d/CCActionEase.h similarity index 100% rename from cocos/2d/actions/CCActionEase.h rename to cocos/2d/CCActionEase.h diff --git a/cocos/2d/actions/CCActionGrid.cpp b/cocos/2d/CCActionGrid.cpp similarity index 100% rename from cocos/2d/actions/CCActionGrid.cpp rename to cocos/2d/CCActionGrid.cpp diff --git a/cocos/2d/actions/CCActionGrid.h b/cocos/2d/CCActionGrid.h similarity index 100% rename from cocos/2d/actions/CCActionGrid.h rename to cocos/2d/CCActionGrid.h diff --git a/cocos/2d/actions/CCActionGrid3D.cpp b/cocos/2d/CCActionGrid3D.cpp similarity index 100% rename from cocos/2d/actions/CCActionGrid3D.cpp rename to cocos/2d/CCActionGrid3D.cpp diff --git a/cocos/2d/actions/CCActionGrid3D.h b/cocos/2d/CCActionGrid3D.h similarity index 100% rename from cocos/2d/actions/CCActionGrid3D.h rename to cocos/2d/CCActionGrid3D.h diff --git a/cocos/2d/actions/CCActionInstant.cpp b/cocos/2d/CCActionInstant.cpp similarity index 100% rename from cocos/2d/actions/CCActionInstant.cpp rename to cocos/2d/CCActionInstant.cpp diff --git a/cocos/2d/actions/CCActionInstant.h b/cocos/2d/CCActionInstant.h similarity index 100% rename from cocos/2d/actions/CCActionInstant.h rename to cocos/2d/CCActionInstant.h diff --git a/cocos/2d/actions/CCActionInterval.cpp b/cocos/2d/CCActionInterval.cpp similarity index 100% rename from cocos/2d/actions/CCActionInterval.cpp rename to cocos/2d/CCActionInterval.cpp diff --git a/cocos/2d/actions/CCActionInterval.h b/cocos/2d/CCActionInterval.h similarity index 100% rename from cocos/2d/actions/CCActionInterval.h rename to cocos/2d/CCActionInterval.h diff --git a/cocos/2d/actions/CCActionManager.cpp b/cocos/2d/CCActionManager.cpp similarity index 100% rename from cocos/2d/actions/CCActionManager.cpp rename to cocos/2d/CCActionManager.cpp diff --git a/cocos/2d/actions/CCActionManager.h b/cocos/2d/CCActionManager.h similarity index 100% rename from cocos/2d/actions/CCActionManager.h rename to cocos/2d/CCActionManager.h diff --git a/cocos/2d/actions/CCActionPageTurn3D.cpp b/cocos/2d/CCActionPageTurn3D.cpp similarity index 100% rename from cocos/2d/actions/CCActionPageTurn3D.cpp rename to cocos/2d/CCActionPageTurn3D.cpp diff --git a/cocos/2d/actions/CCActionPageTurn3D.h b/cocos/2d/CCActionPageTurn3D.h similarity index 100% rename from cocos/2d/actions/CCActionPageTurn3D.h rename to cocos/2d/CCActionPageTurn3D.h diff --git a/cocos/2d/actions/CCActionProgressTimer.cpp b/cocos/2d/CCActionProgressTimer.cpp similarity index 100% rename from cocos/2d/actions/CCActionProgressTimer.cpp rename to cocos/2d/CCActionProgressTimer.cpp diff --git a/cocos/2d/actions/CCActionProgressTimer.h b/cocos/2d/CCActionProgressTimer.h similarity index 100% rename from cocos/2d/actions/CCActionProgressTimer.h rename to cocos/2d/CCActionProgressTimer.h diff --git a/cocos/2d/actions/CCActionTiledGrid.cpp b/cocos/2d/CCActionTiledGrid.cpp similarity index 100% rename from cocos/2d/actions/CCActionTiledGrid.cpp rename to cocos/2d/CCActionTiledGrid.cpp diff --git a/cocos/2d/actions/CCActionTiledGrid.h b/cocos/2d/CCActionTiledGrid.h similarity index 100% rename from cocos/2d/actions/CCActionTiledGrid.h rename to cocos/2d/CCActionTiledGrid.h diff --git a/cocos/2d/actions/CCActionTween.cpp b/cocos/2d/CCActionTween.cpp similarity index 100% rename from cocos/2d/actions/CCActionTween.cpp rename to cocos/2d/CCActionTween.cpp diff --git a/cocos/2d/actions/CCActionTween.h b/cocos/2d/CCActionTween.h similarity index 100% rename from cocos/2d/actions/CCActionTween.h rename to cocos/2d/CCActionTween.h diff --git a/cocos/2d/sprite-nodes/CCAnimation.cpp b/cocos/2d/CCAnimation.cpp similarity index 100% rename from cocos/2d/sprite-nodes/CCAnimation.cpp rename to cocos/2d/CCAnimation.cpp diff --git a/cocos/2d/sprite-nodes/CCAnimation.h b/cocos/2d/CCAnimation.h similarity index 100% rename from cocos/2d/sprite-nodes/CCAnimation.h rename to cocos/2d/CCAnimation.h diff --git a/cocos/2d/sprite-nodes/CCAnimationCache.cpp b/cocos/2d/CCAnimationCache.cpp similarity index 100% rename from cocos/2d/sprite-nodes/CCAnimationCache.cpp rename to cocos/2d/CCAnimationCache.cpp diff --git a/cocos/2d/sprite-nodes/CCAnimationCache.h b/cocos/2d/CCAnimationCache.h similarity index 100% rename from cocos/2d/sprite-nodes/CCAnimationCache.h rename to cocos/2d/CCAnimationCache.h diff --git a/cocos/2d/base-nodes/CCAtlasNode.cpp b/cocos/2d/CCAtlasNode.cpp similarity index 100% rename from cocos/2d/base-nodes/CCAtlasNode.cpp rename to cocos/2d/CCAtlasNode.cpp diff --git a/cocos/2d/base-nodes/CCAtlasNode.h b/cocos/2d/CCAtlasNode.h similarity index 100% rename from cocos/2d/base-nodes/CCAtlasNode.h rename to cocos/2d/CCAtlasNode.h diff --git a/cocos/2d/misc-nodes/CCClippingNode.cpp b/cocos/2d/CCClippingNode.cpp similarity index 100% rename from cocos/2d/misc-nodes/CCClippingNode.cpp rename to cocos/2d/CCClippingNode.cpp diff --git a/cocos/2d/misc-nodes/CCClippingNode.h b/cocos/2d/CCClippingNode.h similarity index 100% rename from cocos/2d/misc-nodes/CCClippingNode.h rename to cocos/2d/CCClippingNode.h diff --git a/cocos/2d/support/component/CCComponent.cpp b/cocos/2d/CCComponent.cpp similarity index 100% rename from cocos/2d/support/component/CCComponent.cpp rename to cocos/2d/CCComponent.cpp diff --git a/cocos/2d/support/component/CCComponent.h b/cocos/2d/CCComponent.h similarity index 100% rename from cocos/2d/support/component/CCComponent.h rename to cocos/2d/CCComponent.h diff --git a/cocos/2d/support/component/CCComponentContainer.cpp b/cocos/2d/CCComponentContainer.cpp similarity index 100% rename from cocos/2d/support/component/CCComponentContainer.cpp rename to cocos/2d/CCComponentContainer.cpp diff --git a/cocos/2d/support/component/CCComponentContainer.h b/cocos/2d/CCComponentContainer.h similarity index 100% rename from cocos/2d/support/component/CCComponentContainer.h rename to cocos/2d/CCComponentContainer.h diff --git a/cocos/2d/include/CCDeprecated.h b/cocos/2d/CCDeprecated.h similarity index 100% rename from cocos/2d/include/CCDeprecated.h rename to cocos/2d/CCDeprecated.h diff --git a/cocos/2d/draw-nodes/CCDrawNode.cpp b/cocos/2d/CCDrawNode.cpp similarity index 100% rename from cocos/2d/draw-nodes/CCDrawNode.cpp rename to cocos/2d/CCDrawNode.cpp diff --git a/cocos/2d/draw-nodes/CCDrawNode.h b/cocos/2d/CCDrawNode.h similarity index 100% rename from cocos/2d/draw-nodes/CCDrawNode.h rename to cocos/2d/CCDrawNode.h diff --git a/cocos/2d/draw-nodes/CCDrawingPrimitives.cpp b/cocos/2d/CCDrawingPrimitives.cpp similarity index 100% rename from cocos/2d/draw-nodes/CCDrawingPrimitives.cpp rename to cocos/2d/CCDrawingPrimitives.cpp diff --git a/cocos/2d/draw-nodes/CCDrawingPrimitives.h b/cocos/2d/CCDrawingPrimitives.h similarity index 100% rename from cocos/2d/draw-nodes/CCDrawingPrimitives.h rename to cocos/2d/CCDrawingPrimitives.h diff --git a/cocos/2d/event-dispatcher/CCEvent.cpp b/cocos/2d/CCEvent.cpp similarity index 100% rename from cocos/2d/event-dispatcher/CCEvent.cpp rename to cocos/2d/CCEvent.cpp diff --git a/cocos/2d/event-dispatcher/CCEvent.h b/cocos/2d/CCEvent.h similarity index 100% rename from cocos/2d/event-dispatcher/CCEvent.h rename to cocos/2d/CCEvent.h diff --git a/cocos/2d/event-dispatcher/CCEventAcceleration.cpp b/cocos/2d/CCEventAcceleration.cpp similarity index 100% rename from cocos/2d/event-dispatcher/CCEventAcceleration.cpp rename to cocos/2d/CCEventAcceleration.cpp diff --git a/cocos/2d/event-dispatcher/CCEventAcceleration.h b/cocos/2d/CCEventAcceleration.h similarity index 100% rename from cocos/2d/event-dispatcher/CCEventAcceleration.h rename to cocos/2d/CCEventAcceleration.h diff --git a/cocos/2d/event-dispatcher/CCEventCustom.cpp b/cocos/2d/CCEventCustom.cpp similarity index 100% rename from cocos/2d/event-dispatcher/CCEventCustom.cpp rename to cocos/2d/CCEventCustom.cpp diff --git a/cocos/2d/event-dispatcher/CCEventCustom.h b/cocos/2d/CCEventCustom.h similarity index 100% rename from cocos/2d/event-dispatcher/CCEventCustom.h rename to cocos/2d/CCEventCustom.h diff --git a/cocos/2d/event-dispatcher/CCEventDispatcher.cpp b/cocos/2d/CCEventDispatcher.cpp similarity index 100% rename from cocos/2d/event-dispatcher/CCEventDispatcher.cpp rename to cocos/2d/CCEventDispatcher.cpp diff --git a/cocos/2d/event-dispatcher/CCEventDispatcher.h b/cocos/2d/CCEventDispatcher.h similarity index 100% rename from cocos/2d/event-dispatcher/CCEventDispatcher.h rename to cocos/2d/CCEventDispatcher.h diff --git a/cocos/2d/event-dispatcher/CCEventKeyboard.cpp b/cocos/2d/CCEventKeyboard.cpp similarity index 100% rename from cocos/2d/event-dispatcher/CCEventKeyboard.cpp rename to cocos/2d/CCEventKeyboard.cpp diff --git a/cocos/2d/event-dispatcher/CCEventKeyboard.h b/cocos/2d/CCEventKeyboard.h similarity index 100% rename from cocos/2d/event-dispatcher/CCEventKeyboard.h rename to cocos/2d/CCEventKeyboard.h diff --git a/cocos/2d/event-dispatcher/CCEventListener.cpp b/cocos/2d/CCEventListener.cpp similarity index 100% rename from cocos/2d/event-dispatcher/CCEventListener.cpp rename to cocos/2d/CCEventListener.cpp diff --git a/cocos/2d/event-dispatcher/CCEventListener.h b/cocos/2d/CCEventListener.h similarity index 100% rename from cocos/2d/event-dispatcher/CCEventListener.h rename to cocos/2d/CCEventListener.h diff --git a/cocos/2d/event-dispatcher/CCEventListenerAcceleration.cpp b/cocos/2d/CCEventListenerAcceleration.cpp similarity index 100% rename from cocos/2d/event-dispatcher/CCEventListenerAcceleration.cpp rename to cocos/2d/CCEventListenerAcceleration.cpp diff --git a/cocos/2d/event-dispatcher/CCEventListenerAcceleration.h b/cocos/2d/CCEventListenerAcceleration.h similarity index 100% rename from cocos/2d/event-dispatcher/CCEventListenerAcceleration.h rename to cocos/2d/CCEventListenerAcceleration.h diff --git a/cocos/2d/event-dispatcher/CCEventListenerCustom.cpp b/cocos/2d/CCEventListenerCustom.cpp similarity index 100% rename from cocos/2d/event-dispatcher/CCEventListenerCustom.cpp rename to cocos/2d/CCEventListenerCustom.cpp diff --git a/cocos/2d/event-dispatcher/CCEventListenerCustom.h b/cocos/2d/CCEventListenerCustom.h similarity index 100% rename from cocos/2d/event-dispatcher/CCEventListenerCustom.h rename to cocos/2d/CCEventListenerCustom.h diff --git a/cocos/2d/event-dispatcher/CCEventListenerKeyboard.cpp b/cocos/2d/CCEventListenerKeyboard.cpp similarity index 100% rename from cocos/2d/event-dispatcher/CCEventListenerKeyboard.cpp rename to cocos/2d/CCEventListenerKeyboard.cpp diff --git a/cocos/2d/event-dispatcher/CCEventListenerKeyboard.h b/cocos/2d/CCEventListenerKeyboard.h similarity index 100% rename from cocos/2d/event-dispatcher/CCEventListenerKeyboard.h rename to cocos/2d/CCEventListenerKeyboard.h diff --git a/cocos/2d/event-dispatcher/CCEventListenerTouch.cpp b/cocos/2d/CCEventListenerTouch.cpp similarity index 100% rename from cocos/2d/event-dispatcher/CCEventListenerTouch.cpp rename to cocos/2d/CCEventListenerTouch.cpp diff --git a/cocos/2d/event-dispatcher/CCEventListenerTouch.h b/cocos/2d/CCEventListenerTouch.h similarity index 100% rename from cocos/2d/event-dispatcher/CCEventListenerTouch.h rename to cocos/2d/CCEventListenerTouch.h diff --git a/cocos/2d/event-dispatcher/CCEventTouch.cpp b/cocos/2d/CCEventTouch.cpp similarity index 100% rename from cocos/2d/event-dispatcher/CCEventTouch.cpp rename to cocos/2d/CCEventTouch.cpp diff --git a/cocos/2d/event-dispatcher/CCEventTouch.h b/cocos/2d/CCEventTouch.h similarity index 100% rename from cocos/2d/event-dispatcher/CCEventTouch.h rename to cocos/2d/CCEventTouch.h diff --git a/cocos/2d/include/CCEventType.h b/cocos/2d/CCEventType.h similarity index 100% rename from cocos/2d/include/CCEventType.h rename to cocos/2d/CCEventType.h diff --git a/cocos/2d/label-nodes/CCFont.cpp b/cocos/2d/CCFont.cpp similarity index 100% rename from cocos/2d/label-nodes/CCFont.cpp rename to cocos/2d/CCFont.cpp diff --git a/cocos/2d/label-nodes/CCFont.h b/cocos/2d/CCFont.h similarity index 100% rename from cocos/2d/label-nodes/CCFont.h rename to cocos/2d/CCFont.h diff --git a/cocos/2d/label-nodes/CCFontAtlas.cpp b/cocos/2d/CCFontAtlas.cpp similarity index 100% rename from cocos/2d/label-nodes/CCFontAtlas.cpp rename to cocos/2d/CCFontAtlas.cpp diff --git a/cocos/2d/label-nodes/CCFontAtlas.h b/cocos/2d/CCFontAtlas.h similarity index 100% rename from cocos/2d/label-nodes/CCFontAtlas.h rename to cocos/2d/CCFontAtlas.h diff --git a/cocos/2d/label-nodes/CCFontAtlasCache.cpp b/cocos/2d/CCFontAtlasCache.cpp similarity index 100% rename from cocos/2d/label-nodes/CCFontAtlasCache.cpp rename to cocos/2d/CCFontAtlasCache.cpp diff --git a/cocos/2d/label-nodes/CCFontAtlasCache.h b/cocos/2d/CCFontAtlasCache.h similarity index 100% rename from cocos/2d/label-nodes/CCFontAtlasCache.h rename to cocos/2d/CCFontAtlasCache.h diff --git a/cocos/2d/label-nodes/CCFontAtlasFactory.cpp b/cocos/2d/CCFontAtlasFactory.cpp similarity index 100% rename from cocos/2d/label-nodes/CCFontAtlasFactory.cpp rename to cocos/2d/CCFontAtlasFactory.cpp diff --git a/cocos/2d/label-nodes/CCFontAtlasFactory.h b/cocos/2d/CCFontAtlasFactory.h similarity index 100% rename from cocos/2d/label-nodes/CCFontAtlasFactory.h rename to cocos/2d/CCFontAtlasFactory.h diff --git a/cocos/2d/label-nodes/CCFontDefinition.cpp b/cocos/2d/CCFontDefinition.cpp similarity index 100% rename from cocos/2d/label-nodes/CCFontDefinition.cpp rename to cocos/2d/CCFontDefinition.cpp diff --git a/cocos/2d/label-nodes/CCFontDefinition.h b/cocos/2d/CCFontDefinition.h similarity index 100% rename from cocos/2d/label-nodes/CCFontDefinition.h rename to cocos/2d/CCFontDefinition.h diff --git a/cocos/2d/label-nodes/CCFontFNT.cpp b/cocos/2d/CCFontFNT.cpp similarity index 100% rename from cocos/2d/label-nodes/CCFontFNT.cpp rename to cocos/2d/CCFontFNT.cpp diff --git a/cocos/2d/label-nodes/CCFontFNT.h b/cocos/2d/CCFontFNT.h similarity index 100% rename from cocos/2d/label-nodes/CCFontFNT.h rename to cocos/2d/CCFontFNT.h diff --git a/cocos/2d/label-nodes/CCFontFreeType.cpp b/cocos/2d/CCFontFreeType.cpp similarity index 100% rename from cocos/2d/label-nodes/CCFontFreeType.cpp rename to cocos/2d/CCFontFreeType.cpp diff --git a/cocos/2d/label-nodes/CCFontFreeType.h b/cocos/2d/CCFontFreeType.h similarity index 100% rename from cocos/2d/label-nodes/CCFontFreeType.h rename to cocos/2d/CCFontFreeType.h diff --git a/cocos/2d/base-nodes/CCGLBufferedNode.cpp b/cocos/2d/CCGLBufferedNode.cpp similarity index 100% rename from cocos/2d/base-nodes/CCGLBufferedNode.cpp rename to cocos/2d/CCGLBufferedNode.cpp diff --git a/cocos/2d/base-nodes/CCGLBufferedNode.h b/cocos/2d/CCGLBufferedNode.h similarity index 100% rename from cocos/2d/base-nodes/CCGLBufferedNode.h rename to cocos/2d/CCGLBufferedNode.h diff --git a/cocos/2d/shaders/CCGLProgram.cpp b/cocos/2d/CCGLProgram.cpp similarity index 100% rename from cocos/2d/shaders/CCGLProgram.cpp rename to cocos/2d/CCGLProgram.cpp diff --git a/cocos/2d/shaders/CCGLProgram.h b/cocos/2d/CCGLProgram.h similarity index 100% rename from cocos/2d/shaders/CCGLProgram.h rename to cocos/2d/CCGLProgram.h diff --git a/cocos/2d/effects/CCGrabber.cpp b/cocos/2d/CCGrabber.cpp similarity index 100% rename from cocos/2d/effects/CCGrabber.cpp rename to cocos/2d/CCGrabber.cpp diff --git a/cocos/2d/effects/CCGrabber.h b/cocos/2d/CCGrabber.h similarity index 100% rename from cocos/2d/effects/CCGrabber.h rename to cocos/2d/CCGrabber.h diff --git a/cocos/2d/effects/CCGrid.cpp b/cocos/2d/CCGrid.cpp similarity index 100% rename from cocos/2d/effects/CCGrid.cpp rename to cocos/2d/CCGrid.cpp diff --git a/cocos/2d/effects/CCGrid.h b/cocos/2d/CCGrid.h similarity index 100% rename from cocos/2d/effects/CCGrid.h rename to cocos/2d/CCGrid.h diff --git a/cocos/2d/text-input-node/CCIMEDelegate.h b/cocos/2d/CCIMEDelegate.h similarity index 100% rename from cocos/2d/text-input-node/CCIMEDelegate.h rename to cocos/2d/CCIMEDelegate.h diff --git a/cocos/2d/text-input-node/CCIMEDispatcher.cpp b/cocos/2d/CCIMEDispatcher.cpp similarity index 100% rename from cocos/2d/text-input-node/CCIMEDispatcher.cpp rename to cocos/2d/CCIMEDispatcher.cpp diff --git a/cocos/2d/text-input-node/CCIMEDispatcher.h b/cocos/2d/CCIMEDispatcher.h similarity index 100% rename from cocos/2d/text-input-node/CCIMEDispatcher.h rename to cocos/2d/CCIMEDispatcher.h diff --git a/cocos/2d/label-nodes/CCLabel.cpp b/cocos/2d/CCLabel.cpp similarity index 100% rename from cocos/2d/label-nodes/CCLabel.cpp rename to cocos/2d/CCLabel.cpp diff --git a/cocos/2d/label-nodes/CCLabel.h b/cocos/2d/CCLabel.h similarity index 100% rename from cocos/2d/label-nodes/CCLabel.h rename to cocos/2d/CCLabel.h diff --git a/cocos/2d/label-nodes/CCLabelAtlas.cpp b/cocos/2d/CCLabelAtlas.cpp similarity index 100% rename from cocos/2d/label-nodes/CCLabelAtlas.cpp rename to cocos/2d/CCLabelAtlas.cpp diff --git a/cocos/2d/label-nodes/CCLabelAtlas.h b/cocos/2d/CCLabelAtlas.h similarity index 100% rename from cocos/2d/label-nodes/CCLabelAtlas.h rename to cocos/2d/CCLabelAtlas.h diff --git a/cocos/2d/label-nodes/CCLabelBMFont.cpp b/cocos/2d/CCLabelBMFont.cpp similarity index 100% rename from cocos/2d/label-nodes/CCLabelBMFont.cpp rename to cocos/2d/CCLabelBMFont.cpp diff --git a/cocos/2d/label-nodes/CCLabelBMFont.h b/cocos/2d/CCLabelBMFont.h similarity index 100% rename from cocos/2d/label-nodes/CCLabelBMFont.h rename to cocos/2d/CCLabelBMFont.h diff --git a/cocos/2d/label-nodes/CCLabelTTF.cpp b/cocos/2d/CCLabelTTF.cpp similarity index 100% rename from cocos/2d/label-nodes/CCLabelTTF.cpp rename to cocos/2d/CCLabelTTF.cpp diff --git a/cocos/2d/label-nodes/CCLabelTTF.h b/cocos/2d/CCLabelTTF.h similarity index 100% rename from cocos/2d/label-nodes/CCLabelTTF.h rename to cocos/2d/CCLabelTTF.h diff --git a/cocos/2d/label-nodes/CCLabelTextFormatProtocol.h b/cocos/2d/CCLabelTextFormatProtocol.h similarity index 100% rename from cocos/2d/label-nodes/CCLabelTextFormatProtocol.h rename to cocos/2d/CCLabelTextFormatProtocol.h diff --git a/cocos/2d/label-nodes/CCLabelTextFormatter.cpp b/cocos/2d/CCLabelTextFormatter.cpp similarity index 100% rename from cocos/2d/label-nodes/CCLabelTextFormatter.cpp rename to cocos/2d/CCLabelTextFormatter.cpp diff --git a/cocos/2d/label-nodes/CCLabelTextFormatter.h b/cocos/2d/CCLabelTextFormatter.h similarity index 100% rename from cocos/2d/label-nodes/CCLabelTextFormatter.h rename to cocos/2d/CCLabelTextFormatter.h diff --git a/cocos/2d/layers-scenes-transitions-nodes/CCLayer.cpp b/cocos/2d/CCLayer.cpp similarity index 100% rename from cocos/2d/layers-scenes-transitions-nodes/CCLayer.cpp rename to cocos/2d/CCLayer.cpp diff --git a/cocos/2d/layers-scenes-transitions-nodes/CCLayer.h b/cocos/2d/CCLayer.h similarity index 100% rename from cocos/2d/layers-scenes-transitions-nodes/CCLayer.h rename to cocos/2d/CCLayer.h diff --git a/cocos/2d/menu-nodes/CCMenu.cpp b/cocos/2d/CCMenu.cpp similarity index 100% rename from cocos/2d/menu-nodes/CCMenu.cpp rename to cocos/2d/CCMenu.cpp diff --git a/cocos/2d/menu-nodes/CCMenu.h b/cocos/2d/CCMenu.h similarity index 100% rename from cocos/2d/menu-nodes/CCMenu.h rename to cocos/2d/CCMenu.h diff --git a/cocos/2d/menu-nodes/CCMenuItem.cpp b/cocos/2d/CCMenuItem.cpp similarity index 100% rename from cocos/2d/menu-nodes/CCMenuItem.cpp rename to cocos/2d/CCMenuItem.cpp diff --git a/cocos/2d/menu-nodes/CCMenuItem.h b/cocos/2d/CCMenuItem.h similarity index 100% rename from cocos/2d/menu-nodes/CCMenuItem.h rename to cocos/2d/CCMenuItem.h diff --git a/cocos/2d/misc-nodes/CCMotionStreak.cpp b/cocos/2d/CCMotionStreak.cpp similarity index 100% rename from cocos/2d/misc-nodes/CCMotionStreak.cpp rename to cocos/2d/CCMotionStreak.cpp diff --git a/cocos/2d/misc-nodes/CCMotionStreak.h b/cocos/2d/CCMotionStreak.h similarity index 100% rename from cocos/2d/misc-nodes/CCMotionStreak.h rename to cocos/2d/CCMotionStreak.h diff --git a/cocos/2d/base-nodes/CCNode.cpp b/cocos/2d/CCNode.cpp similarity index 100% rename from cocos/2d/base-nodes/CCNode.cpp rename to cocos/2d/CCNode.cpp diff --git a/cocos/2d/base-nodes/CCNode.h b/cocos/2d/CCNode.h similarity index 100% rename from cocos/2d/base-nodes/CCNode.h rename to cocos/2d/CCNode.h diff --git a/cocos/2d/support/CCNotificationCenter.cpp b/cocos/2d/CCNotificationCenter.cpp similarity index 100% rename from cocos/2d/support/CCNotificationCenter.cpp rename to cocos/2d/CCNotificationCenter.cpp diff --git a/cocos/2d/support/CCNotificationCenter.h b/cocos/2d/CCNotificationCenter.h similarity index 100% rename from cocos/2d/support/CCNotificationCenter.h rename to cocos/2d/CCNotificationCenter.h diff --git a/cocos/2d/tilemap-parallax-nodes/CCParallaxNode.cpp b/cocos/2d/CCParallaxNode.cpp similarity index 100% rename from cocos/2d/tilemap-parallax-nodes/CCParallaxNode.cpp rename to cocos/2d/CCParallaxNode.cpp diff --git a/cocos/2d/tilemap-parallax-nodes/CCParallaxNode.h b/cocos/2d/CCParallaxNode.h similarity index 100% rename from cocos/2d/tilemap-parallax-nodes/CCParallaxNode.h rename to cocos/2d/CCParallaxNode.h diff --git a/cocos/2d/particle-nodes/CCParticleBatchNode.cpp b/cocos/2d/CCParticleBatchNode.cpp similarity index 100% rename from cocos/2d/particle-nodes/CCParticleBatchNode.cpp rename to cocos/2d/CCParticleBatchNode.cpp diff --git a/cocos/2d/particle-nodes/CCParticleBatchNode.h b/cocos/2d/CCParticleBatchNode.h similarity index 100% rename from cocos/2d/particle-nodes/CCParticleBatchNode.h rename to cocos/2d/CCParticleBatchNode.h diff --git a/cocos/2d/particle-nodes/CCParticleExamples.cpp b/cocos/2d/CCParticleExamples.cpp similarity index 100% rename from cocos/2d/particle-nodes/CCParticleExamples.cpp rename to cocos/2d/CCParticleExamples.cpp diff --git a/cocos/2d/particle-nodes/CCParticleExamples.h b/cocos/2d/CCParticleExamples.h similarity index 100% rename from cocos/2d/particle-nodes/CCParticleExamples.h rename to cocos/2d/CCParticleExamples.h diff --git a/cocos/2d/particle-nodes/CCParticleSystem.cpp b/cocos/2d/CCParticleSystem.cpp similarity index 100% rename from cocos/2d/particle-nodes/CCParticleSystem.cpp rename to cocos/2d/CCParticleSystem.cpp diff --git a/cocos/2d/particle-nodes/CCParticleSystem.h b/cocos/2d/CCParticleSystem.h similarity index 100% rename from cocos/2d/particle-nodes/CCParticleSystem.h rename to cocos/2d/CCParticleSystem.h diff --git a/cocos/2d/particle-nodes/CCParticleSystemQuad.cpp b/cocos/2d/CCParticleSystemQuad.cpp similarity index 100% rename from cocos/2d/particle-nodes/CCParticleSystemQuad.cpp rename to cocos/2d/CCParticleSystemQuad.cpp diff --git a/cocos/2d/particle-nodes/CCParticleSystemQuad.h b/cocos/2d/CCParticleSystemQuad.h similarity index 100% rename from cocos/2d/particle-nodes/CCParticleSystemQuad.h rename to cocos/2d/CCParticleSystemQuad.h diff --git a/cocos/2d/support/CCProfiling.cpp b/cocos/2d/CCProfiling.cpp similarity index 100% rename from cocos/2d/support/CCProfiling.cpp rename to cocos/2d/CCProfiling.cpp diff --git a/cocos/2d/support/CCProfiling.h b/cocos/2d/CCProfiling.h similarity index 100% rename from cocos/2d/support/CCProfiling.h rename to cocos/2d/CCProfiling.h diff --git a/cocos/2d/misc-nodes/CCProgressTimer.cpp b/cocos/2d/CCProgressTimer.cpp similarity index 100% rename from cocos/2d/misc-nodes/CCProgressTimer.cpp rename to cocos/2d/CCProgressTimer.cpp diff --git a/cocos/2d/misc-nodes/CCProgressTimer.h b/cocos/2d/CCProgressTimer.h similarity index 100% rename from cocos/2d/misc-nodes/CCProgressTimer.h rename to cocos/2d/CCProgressTimer.h diff --git a/cocos/2d/include/CCProtocols.h b/cocos/2d/CCProtocols.h similarity index 100% rename from cocos/2d/include/CCProtocols.h rename to cocos/2d/CCProtocols.h diff --git a/cocos/2d/misc-nodes/CCRenderTexture.cpp b/cocos/2d/CCRenderTexture.cpp similarity index 100% rename from cocos/2d/misc-nodes/CCRenderTexture.cpp rename to cocos/2d/CCRenderTexture.cpp diff --git a/cocos/2d/misc-nodes/CCRenderTexture.h b/cocos/2d/CCRenderTexture.h similarity index 100% rename from cocos/2d/misc-nodes/CCRenderTexture.h rename to cocos/2d/CCRenderTexture.h diff --git a/cocos/2d/layers-scenes-transitions-nodes/CCScene.cpp b/cocos/2d/CCScene.cpp similarity index 100% rename from cocos/2d/layers-scenes-transitions-nodes/CCScene.cpp rename to cocos/2d/CCScene.cpp diff --git a/cocos/2d/layers-scenes-transitions-nodes/CCScene.h b/cocos/2d/CCScene.h similarity index 100% rename from cocos/2d/layers-scenes-transitions-nodes/CCScene.h rename to cocos/2d/CCScene.h diff --git a/cocos/2d/script-support/CCScriptSupport.cpp b/cocos/2d/CCScriptSupport.cpp similarity index 100% rename from cocos/2d/script-support/CCScriptSupport.cpp rename to cocos/2d/CCScriptSupport.cpp diff --git a/cocos/2d/script-support/CCScriptSupport.h b/cocos/2d/CCScriptSupport.h similarity index 100% rename from cocos/2d/script-support/CCScriptSupport.h rename to cocos/2d/CCScriptSupport.h diff --git a/cocos/2d/shaders/CCShaderCache.cpp b/cocos/2d/CCShaderCache.cpp similarity index 100% rename from cocos/2d/shaders/CCShaderCache.cpp rename to cocos/2d/CCShaderCache.cpp diff --git a/cocos/2d/shaders/CCShaderCache.h b/cocos/2d/CCShaderCache.h similarity index 100% rename from cocos/2d/shaders/CCShaderCache.h rename to cocos/2d/CCShaderCache.h diff --git a/cocos/2d/sprite-nodes/CCSprite.cpp b/cocos/2d/CCSprite.cpp similarity index 100% rename from cocos/2d/sprite-nodes/CCSprite.cpp rename to cocos/2d/CCSprite.cpp diff --git a/cocos/2d/sprite-nodes/CCSprite.h b/cocos/2d/CCSprite.h similarity index 100% rename from cocos/2d/sprite-nodes/CCSprite.h rename to cocos/2d/CCSprite.h diff --git a/cocos/2d/sprite-nodes/CCSpriteBatchNode.cpp b/cocos/2d/CCSpriteBatchNode.cpp similarity index 100% rename from cocos/2d/sprite-nodes/CCSpriteBatchNode.cpp rename to cocos/2d/CCSpriteBatchNode.cpp diff --git a/cocos/2d/sprite-nodes/CCSpriteBatchNode.h b/cocos/2d/CCSpriteBatchNode.h similarity index 100% rename from cocos/2d/sprite-nodes/CCSpriteBatchNode.h rename to cocos/2d/CCSpriteBatchNode.h diff --git a/cocos/2d/sprite-nodes/CCSpriteFrame.cpp b/cocos/2d/CCSpriteFrame.cpp similarity index 100% rename from cocos/2d/sprite-nodes/CCSpriteFrame.cpp rename to cocos/2d/CCSpriteFrame.cpp diff --git a/cocos/2d/sprite-nodes/CCSpriteFrame.h b/cocos/2d/CCSpriteFrame.h similarity index 100% rename from cocos/2d/sprite-nodes/CCSpriteFrame.h rename to cocos/2d/CCSpriteFrame.h diff --git a/cocos/2d/sprite-nodes/CCSpriteFrameCache.cpp b/cocos/2d/CCSpriteFrameCache.cpp similarity index 100% rename from cocos/2d/sprite-nodes/CCSpriteFrameCache.cpp rename to cocos/2d/CCSpriteFrameCache.cpp diff --git a/cocos/2d/sprite-nodes/CCSpriteFrameCache.h b/cocos/2d/CCSpriteFrameCache.h similarity index 100% rename from cocos/2d/sprite-nodes/CCSpriteFrameCache.h rename to cocos/2d/CCSpriteFrameCache.h diff --git a/cocos/2d/tilemap-parallax-nodes/CCTMXLayer.cpp b/cocos/2d/CCTMXLayer.cpp similarity index 100% rename from cocos/2d/tilemap-parallax-nodes/CCTMXLayer.cpp rename to cocos/2d/CCTMXLayer.cpp diff --git a/cocos/2d/tilemap-parallax-nodes/CCTMXLayer.h b/cocos/2d/CCTMXLayer.h similarity index 100% rename from cocos/2d/tilemap-parallax-nodes/CCTMXLayer.h rename to cocos/2d/CCTMXLayer.h diff --git a/cocos/2d/tilemap-parallax-nodes/CCTMXObjectGroup.cpp b/cocos/2d/CCTMXObjectGroup.cpp similarity index 100% rename from cocos/2d/tilemap-parallax-nodes/CCTMXObjectGroup.cpp rename to cocos/2d/CCTMXObjectGroup.cpp diff --git a/cocos/2d/tilemap-parallax-nodes/CCTMXObjectGroup.h b/cocos/2d/CCTMXObjectGroup.h similarity index 100% rename from cocos/2d/tilemap-parallax-nodes/CCTMXObjectGroup.h rename to cocos/2d/CCTMXObjectGroup.h diff --git a/cocos/2d/tilemap-parallax-nodes/CCTMXTiledMap.cpp b/cocos/2d/CCTMXTiledMap.cpp similarity index 100% rename from cocos/2d/tilemap-parallax-nodes/CCTMXTiledMap.cpp rename to cocos/2d/CCTMXTiledMap.cpp diff --git a/cocos/2d/tilemap-parallax-nodes/CCTMXTiledMap.h b/cocos/2d/CCTMXTiledMap.h similarity index 100% rename from cocos/2d/tilemap-parallax-nodes/CCTMXTiledMap.h rename to cocos/2d/CCTMXTiledMap.h diff --git a/cocos/2d/tilemap-parallax-nodes/CCTMXXMLParser.cpp b/cocos/2d/CCTMXXMLParser.cpp similarity index 100% rename from cocos/2d/tilemap-parallax-nodes/CCTMXXMLParser.cpp rename to cocos/2d/CCTMXXMLParser.cpp diff --git a/cocos/2d/tilemap-parallax-nodes/CCTMXXMLParser.h b/cocos/2d/CCTMXXMLParser.h similarity index 100% rename from cocos/2d/tilemap-parallax-nodes/CCTMXXMLParser.h rename to cocos/2d/CCTMXXMLParser.h diff --git a/cocos/2d/text-input-node/CCTextFieldTTF.cpp b/cocos/2d/CCTextFieldTTF.cpp similarity index 100% rename from cocos/2d/text-input-node/CCTextFieldTTF.cpp rename to cocos/2d/CCTextFieldTTF.cpp diff --git a/cocos/2d/text-input-node/CCTextFieldTTF.h b/cocos/2d/CCTextFieldTTF.h similarity index 100% rename from cocos/2d/text-input-node/CCTextFieldTTF.h rename to cocos/2d/CCTextFieldTTF.h diff --git a/cocos/2d/label-nodes/CCTextImage.cpp b/cocos/2d/CCTextImage.cpp similarity index 100% rename from cocos/2d/label-nodes/CCTextImage.cpp rename to cocos/2d/CCTextImage.cpp diff --git a/cocos/2d/label-nodes/CCTextImage.h b/cocos/2d/CCTextImage.h similarity index 100% rename from cocos/2d/label-nodes/CCTextImage.h rename to cocos/2d/CCTextImage.h diff --git a/cocos/2d/textures/CCTexture2D.cpp b/cocos/2d/CCTexture2D.cpp similarity index 100% rename from cocos/2d/textures/CCTexture2D.cpp rename to cocos/2d/CCTexture2D.cpp diff --git a/cocos/2d/textures/CCTexture2D.h b/cocos/2d/CCTexture2D.h similarity index 100% rename from cocos/2d/textures/CCTexture2D.h rename to cocos/2d/CCTexture2D.h diff --git a/cocos/2d/textures/CCTextureAtlas.cpp b/cocos/2d/CCTextureAtlas.cpp similarity index 100% rename from cocos/2d/textures/CCTextureAtlas.cpp rename to cocos/2d/CCTextureAtlas.cpp diff --git a/cocos/2d/textures/CCTextureAtlas.h b/cocos/2d/CCTextureAtlas.h similarity index 100% rename from cocos/2d/textures/CCTextureAtlas.h rename to cocos/2d/CCTextureAtlas.h diff --git a/cocos/2d/textures/CCTextureCache.cpp b/cocos/2d/CCTextureCache.cpp similarity index 100% rename from cocos/2d/textures/CCTextureCache.cpp rename to cocos/2d/CCTextureCache.cpp diff --git a/cocos/2d/textures/CCTextureCache.h b/cocos/2d/CCTextureCache.h similarity index 100% rename from cocos/2d/textures/CCTextureCache.h rename to cocos/2d/CCTextureCache.h diff --git a/cocos/2d/tilemap-parallax-nodes/CCTileMapAtlas.cpp b/cocos/2d/CCTileMapAtlas.cpp similarity index 100% rename from cocos/2d/tilemap-parallax-nodes/CCTileMapAtlas.cpp rename to cocos/2d/CCTileMapAtlas.cpp diff --git a/cocos/2d/tilemap-parallax-nodes/CCTileMapAtlas.h b/cocos/2d/CCTileMapAtlas.h similarity index 100% rename from cocos/2d/tilemap-parallax-nodes/CCTileMapAtlas.h rename to cocos/2d/CCTileMapAtlas.h diff --git a/cocos/2d/event-dispatcher/CCTouch.cpp b/cocos/2d/CCTouch.cpp similarity index 100% rename from cocos/2d/event-dispatcher/CCTouch.cpp rename to cocos/2d/CCTouch.cpp diff --git a/cocos/2d/event-dispatcher/CCTouch.h b/cocos/2d/CCTouch.h similarity index 100% rename from cocos/2d/event-dispatcher/CCTouch.h rename to cocos/2d/CCTouch.h diff --git a/cocos/2d/layers-scenes-transitions-nodes/CCTransition.cpp b/cocos/2d/CCTransition.cpp similarity index 100% rename from cocos/2d/layers-scenes-transitions-nodes/CCTransition.cpp rename to cocos/2d/CCTransition.cpp diff --git a/cocos/2d/layers-scenes-transitions-nodes/CCTransition.h b/cocos/2d/CCTransition.h similarity index 100% rename from cocos/2d/layers-scenes-transitions-nodes/CCTransition.h rename to cocos/2d/CCTransition.h diff --git a/cocos/2d/layers-scenes-transitions-nodes/CCTransitionPageTurn.cpp b/cocos/2d/CCTransitionPageTurn.cpp similarity index 100% rename from cocos/2d/layers-scenes-transitions-nodes/CCTransitionPageTurn.cpp rename to cocos/2d/CCTransitionPageTurn.cpp diff --git a/cocos/2d/layers-scenes-transitions-nodes/CCTransitionPageTurn.h b/cocos/2d/CCTransitionPageTurn.h similarity index 100% rename from cocos/2d/layers-scenes-transitions-nodes/CCTransitionPageTurn.h rename to cocos/2d/CCTransitionPageTurn.h diff --git a/cocos/2d/layers-scenes-transitions-nodes/CCTransitionProgress.cpp b/cocos/2d/CCTransitionProgress.cpp similarity index 100% rename from cocos/2d/layers-scenes-transitions-nodes/CCTransitionProgress.cpp rename to cocos/2d/CCTransitionProgress.cpp diff --git a/cocos/2d/layers-scenes-transitions-nodes/CCTransitionProgress.h b/cocos/2d/CCTransitionProgress.h similarity index 100% rename from cocos/2d/layers-scenes-transitions-nodes/CCTransitionProgress.h rename to cocos/2d/CCTransitionProgress.h diff --git a/cocos/2d/support/user_default/CCUserDefault.cpp b/cocos/2d/CCUserDefault.cpp similarity index 100% rename from cocos/2d/support/user_default/CCUserDefault.cpp rename to cocos/2d/CCUserDefault.cpp diff --git a/cocos/2d/support/user_default/CCUserDefault.h b/cocos/2d/CCUserDefault.h similarity index 100% rename from cocos/2d/support/user_default/CCUserDefault.h rename to cocos/2d/CCUserDefault.h diff --git a/cocos/2d/support/user_default/CCUserDefault.mm b/cocos/2d/CCUserDefault.mm similarity index 100% rename from cocos/2d/support/user_default/CCUserDefault.mm rename to cocos/2d/CCUserDefault.mm diff --git a/cocos/2d/support/user_default/CCUserDefaultAndroid.cpp b/cocos/2d/CCUserDefaultAndroid.cpp similarity index 100% rename from cocos/2d/support/user_default/CCUserDefaultAndroid.cpp rename to cocos/2d/CCUserDefaultAndroid.cpp diff --git a/cocos/2d/support/CCVertex.cpp b/cocos/2d/CCVertex.cpp similarity index 100% rename from cocos/2d/support/CCVertex.cpp rename to cocos/2d/CCVertex.cpp diff --git a/cocos/2d/support/CCVertex.h b/cocos/2d/CCVertex.h similarity index 100% rename from cocos/2d/support/CCVertex.h rename to cocos/2d/CCVertex.h diff --git a/cocos/2d/proj.linux/Makefile b/cocos/2d/Makefile similarity index 100% rename from cocos/2d/proj.linux/Makefile rename to cocos/2d/Makefile diff --git a/cocos/2d/support/image_support/TGAlib.cpp b/cocos/2d/TGAlib.cpp similarity index 100% rename from cocos/2d/support/image_support/TGAlib.cpp rename to cocos/2d/TGAlib.cpp diff --git a/cocos/2d/support/image_support/TGAlib.h b/cocos/2d/TGAlib.h similarity index 100% rename from cocos/2d/support/image_support/TGAlib.h rename to cocos/2d/TGAlib.h diff --git a/cocos/2d/support/TransformUtils.cpp b/cocos/2d/TransformUtils.cpp similarity index 100% rename from cocos/2d/support/TransformUtils.cpp rename to cocos/2d/TransformUtils.cpp diff --git a/cocos/2d/support/TransformUtils.h b/cocos/2d/TransformUtils.h similarity index 100% rename from cocos/2d/support/TransformUtils.h rename to cocos/2d/TransformUtils.h diff --git a/cocos/2d/support/zip_support/ZipUtils.cpp b/cocos/2d/ZipUtils.cpp similarity index 100% rename from cocos/2d/support/zip_support/ZipUtils.cpp rename to cocos/2d/ZipUtils.cpp diff --git a/cocos/2d/support/zip_support/ZipUtils.h b/cocos/2d/ZipUtils.h similarity index 100% rename from cocos/2d/support/zip_support/ZipUtils.h rename to cocos/2d/ZipUtils.h diff --git a/cocos/2d/support/base64.cpp b/cocos/2d/base64.cpp similarity index 100% rename from cocos/2d/support/base64.cpp rename to cocos/2d/base64.cpp diff --git a/cocos/2d/support/base64.h b/cocos/2d/base64.h similarity index 100% rename from cocos/2d/support/base64.h rename to cocos/2d/base64.h diff --git a/cocos/2d/support/data_support/ccCArray.cpp b/cocos/2d/ccCArray.cpp similarity index 100% rename from cocos/2d/support/data_support/ccCArray.cpp rename to cocos/2d/ccCArray.cpp diff --git a/cocos/2d/support/data_support/ccCArray.h b/cocos/2d/ccCArray.h similarity index 100% rename from cocos/2d/support/data_support/ccCArray.h rename to cocos/2d/ccCArray.h diff --git a/cocos/2d/include/ccConfig.h b/cocos/2d/ccConfig.h similarity index 100% rename from cocos/2d/include/ccConfig.h rename to cocos/2d/ccConfig.h diff --git a/cocos/2d/shaders/ccGLStateCache.cpp b/cocos/2d/ccGLStateCache.cpp similarity index 100% rename from cocos/2d/shaders/ccGLStateCache.cpp rename to cocos/2d/ccGLStateCache.cpp diff --git a/cocos/2d/shaders/ccGLStateCache.h b/cocos/2d/ccGLStateCache.h similarity index 100% rename from cocos/2d/shaders/ccGLStateCache.h rename to cocos/2d/ccGLStateCache.h diff --git a/cocos/2d/include/ccMacros.h b/cocos/2d/ccMacros.h similarity index 100% rename from cocos/2d/include/ccMacros.h rename to cocos/2d/ccMacros.h diff --git a/cocos/2d/shaders/ccShaderEx_SwitchMask_frag.h b/cocos/2d/ccShaderEx_SwitchMask_frag.h similarity index 100% rename from cocos/2d/shaders/ccShaderEx_SwitchMask_frag.h rename to cocos/2d/ccShaderEx_SwitchMask_frag.h diff --git a/cocos/2d/shaders/ccShader_PositionColorLengthTexture_frag.h b/cocos/2d/ccShader_PositionColorLengthTexture_frag.h similarity index 100% rename from cocos/2d/shaders/ccShader_PositionColorLengthTexture_frag.h rename to cocos/2d/ccShader_PositionColorLengthTexture_frag.h diff --git a/cocos/2d/shaders/ccShader_PositionColorLengthTexture_vert.h b/cocos/2d/ccShader_PositionColorLengthTexture_vert.h similarity index 100% rename from cocos/2d/shaders/ccShader_PositionColorLengthTexture_vert.h rename to cocos/2d/ccShader_PositionColorLengthTexture_vert.h diff --git a/cocos/2d/shaders/ccShader_PositionColor_frag.h b/cocos/2d/ccShader_PositionColor_frag.h similarity index 100% rename from cocos/2d/shaders/ccShader_PositionColor_frag.h rename to cocos/2d/ccShader_PositionColor_frag.h diff --git a/cocos/2d/shaders/ccShader_PositionColor_vert.h b/cocos/2d/ccShader_PositionColor_vert.h similarity index 100% rename from cocos/2d/shaders/ccShader_PositionColor_vert.h rename to cocos/2d/ccShader_PositionColor_vert.h diff --git a/cocos/2d/shaders/ccShader_PositionTextureA8Color_frag.h b/cocos/2d/ccShader_PositionTextureA8Color_frag.h similarity index 100% rename from cocos/2d/shaders/ccShader_PositionTextureA8Color_frag.h rename to cocos/2d/ccShader_PositionTextureA8Color_frag.h diff --git a/cocos/2d/shaders/ccShader_PositionTextureA8Color_vert.h b/cocos/2d/ccShader_PositionTextureA8Color_vert.h similarity index 100% rename from cocos/2d/shaders/ccShader_PositionTextureA8Color_vert.h rename to cocos/2d/ccShader_PositionTextureA8Color_vert.h diff --git a/cocos/2d/shaders/ccShader_PositionTextureColorAlphaTest_frag.h b/cocos/2d/ccShader_PositionTextureColorAlphaTest_frag.h similarity index 100% rename from cocos/2d/shaders/ccShader_PositionTextureColorAlphaTest_frag.h rename to cocos/2d/ccShader_PositionTextureColorAlphaTest_frag.h diff --git a/cocos/2d/shaders/ccShader_PositionTextureColor_frag.h b/cocos/2d/ccShader_PositionTextureColor_frag.h similarity index 100% rename from cocos/2d/shaders/ccShader_PositionTextureColor_frag.h rename to cocos/2d/ccShader_PositionTextureColor_frag.h diff --git a/cocos/2d/shaders/ccShader_PositionTextureColor_vert.h b/cocos/2d/ccShader_PositionTextureColor_vert.h similarity index 100% rename from cocos/2d/shaders/ccShader_PositionTextureColor_vert.h rename to cocos/2d/ccShader_PositionTextureColor_vert.h diff --git a/cocos/2d/shaders/ccShader_PositionTexture_frag.h b/cocos/2d/ccShader_PositionTexture_frag.h similarity index 100% rename from cocos/2d/shaders/ccShader_PositionTexture_frag.h rename to cocos/2d/ccShader_PositionTexture_frag.h diff --git a/cocos/2d/shaders/ccShader_PositionTexture_uColor_frag.h b/cocos/2d/ccShader_PositionTexture_uColor_frag.h similarity index 100% rename from cocos/2d/shaders/ccShader_PositionTexture_uColor_frag.h rename to cocos/2d/ccShader_PositionTexture_uColor_frag.h diff --git a/cocos/2d/shaders/ccShader_PositionTexture_uColor_vert.h b/cocos/2d/ccShader_PositionTexture_uColor_vert.h similarity index 100% rename from cocos/2d/shaders/ccShader_PositionTexture_uColor_vert.h rename to cocos/2d/ccShader_PositionTexture_uColor_vert.h diff --git a/cocos/2d/shaders/ccShader_PositionTexture_vert.h b/cocos/2d/ccShader_PositionTexture_vert.h similarity index 100% rename from cocos/2d/shaders/ccShader_PositionTexture_vert.h rename to cocos/2d/ccShader_PositionTexture_vert.h diff --git a/cocos/2d/shaders/ccShader_Position_uColor_frag.h b/cocos/2d/ccShader_Position_uColor_frag.h similarity index 100% rename from cocos/2d/shaders/ccShader_Position_uColor_frag.h rename to cocos/2d/ccShader_Position_uColor_frag.h diff --git a/cocos/2d/shaders/ccShader_Position_uColor_vert.h b/cocos/2d/ccShader_Position_uColor_vert.h similarity index 100% rename from cocos/2d/shaders/ccShader_Position_uColor_vert.h rename to cocos/2d/ccShader_Position_uColor_vert.h diff --git a/cocos/2d/shaders/ccShaders.cpp b/cocos/2d/ccShaders.cpp similarity index 100% rename from cocos/2d/shaders/ccShaders.cpp rename to cocos/2d/ccShaders.cpp diff --git a/cocos/2d/shaders/ccShaders.h b/cocos/2d/ccShaders.h similarity index 100% rename from cocos/2d/shaders/ccShaders.h rename to cocos/2d/ccShaders.h diff --git a/cocos/2d/include/ccTypes.h b/cocos/2d/ccTypes.h similarity index 100% rename from cocos/2d/include/ccTypes.h rename to cocos/2d/ccTypes.h diff --git a/cocos/2d/support/ccUTF8.cpp b/cocos/2d/ccUTF8.cpp similarity index 100% rename from cocos/2d/support/ccUTF8.cpp rename to cocos/2d/ccUTF8.cpp diff --git a/cocos/2d/support/ccUTF8.h b/cocos/2d/ccUTF8.h similarity index 100% rename from cocos/2d/support/ccUTF8.h rename to cocos/2d/ccUTF8.h diff --git a/cocos/2d/support/ccUtils.h b/cocos/2d/ccUtils.h similarity index 100% rename from cocos/2d/support/ccUtils.h rename to cocos/2d/ccUtils.h diff --git a/cocos/2d/include/cocos2d.h b/cocos/2d/cocos2d.h similarity index 100% rename from cocos/2d/include/cocos2d.h rename to cocos/2d/cocos2d.h diff --git a/cocos/2d/proj.win32/cocos2d.vcxproj b/cocos/2d/cocos2d.vcxproj similarity index 100% rename from cocos/2d/proj.win32/cocos2d.vcxproj rename to cocos/2d/cocos2d.vcxproj diff --git a/cocos/2d/proj.win32/cocos2d.vcxproj.filters b/cocos/2d/cocos2d.vcxproj.filters similarity index 100% rename from cocos/2d/proj.win32/cocos2d.vcxproj.filters rename to cocos/2d/cocos2d.vcxproj.filters diff --git a/cocos/2d/proj.win32/cocos2d.vcxproj.user b/cocos/2d/cocos2d.vcxproj.user similarity index 100% rename from cocos/2d/proj.win32/cocos2d.vcxproj.user rename to cocos/2d/cocos2d.vcxproj.user diff --git a/cocos/2d/proj.linux/cocos2dx.mk b/cocos/2d/cocos2dx.mk similarity index 100% rename from cocos/2d/proj.linux/cocos2dx.mk rename to cocos/2d/cocos2dx.mk diff --git a/cocos/2d/proj.win32/cocos2dx.props b/cocos/2d/cocos2dx.props similarity index 100% rename from cocos/2d/proj.win32/cocos2dx.props rename to cocos/2d/cocos2dx.props diff --git a/cocos/2d/particle-nodes/firePngData.h b/cocos/2d/firePngData.h similarity index 100% rename from cocos/2d/particle-nodes/firePngData.h rename to cocos/2d/firePngData.h diff --git a/cocos/2d/proj.linux/.cproject b/cocos/2d/proj.linux/.cproject deleted file mode 100755 index aaae232fb4..0000000000 --- a/cocos/2d/proj.linux/.cproject +++ /dev/null @@ -1,602 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/cocos/2d/proj.linux/.project b/cocos/2d/proj.linux/.project deleted file mode 100755 index 8811b56dd0..0000000000 --- a/cocos/2d/proj.linux/.project +++ /dev/null @@ -1,256 +0,0 @@ - - - libcocos2d - - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.autoBuildTarget - all - - - org.eclipse.cdt.make.core.buildArguments - - - - org.eclipse.cdt.make.core.buildCommand - make - - - org.eclipse.cdt.make.core.buildLocation - ${workspace_loc:/cocos2dx-base/Debug} - - - org.eclipse.cdt.make.core.cleanBuildTarget - clean - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - false - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.fullBuildTarget - all - - - org.eclipse.cdt.make.core.stopOnError - true - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - true - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.core.ccnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - - - - CCCamera.cpp - 1 - PARENT-1-PROJECT_LOC/CCCamera.cpp - - - CCConfiguration.cpp - 1 - PARENT-1-PROJECT_LOC/CCConfiguration.cpp - - - CCConfiguration.h - 1 - PARENT-1-PROJECT_LOC/CCConfiguration.h - - - ccFPSImages.c - 1 - PARENT-1-PROJECT_LOC/ccFPSImages.c - - - ccFPSImages.h - 1 - PARENT-1-PROJECT_LOC/ccFPSImages.h - - - ccTypes.cpp - 1 - PARENT-1-PROJECT_LOC/ccTypes.cpp - - - CCDirector.cpp - 1 - PARENT-1-PROJECT_LOC/CCDirector.cpp - - - CCScheduler.cpp - 1 - PARENT-1-PROJECT_LOC/CCScheduler.cpp - - - actions - 2 - PARENT-1-PROJECT_LOC/actions - - - base_nodes - 2 - PARENT-1-PROJECT_LOC/base_nodes - - - cocoa - 2 - PARENT-1-PROJECT_LOC/cocoa - - - cocos2d.cpp - 1 - PARENT-1-PROJECT_LOC/cocos2d.cpp - - - draw_nodes - 2 - PARENT-1-PROJECT_LOC/draw_nodes - - - effects - 2 - PARENT-1-PROJECT_LOC/effects - - - include - 2 - PARENT-1-PROJECT_LOC/include - - - kazmath - 2 - PARENT-1-PROJECT_LOC/kazmath - - - keypad_dispatcher - 2 - PARENT-1-PROJECT_LOC/keypad_dispatcher - - - keyboard_dispatcher - 2 - PARENT-1-PROJECT_LOC/keyboard_dispatcher - - - label_nodes - 2 - PARENT-1-PROJECT_LOC/label_nodes - - - layers_scenes_transitions_nodes - 2 - PARENT-1-PROJECT_LOC/layers_scenes_transitions_nodes - - - menu_nodes - 2 - PARENT-1-PROJECT_LOC/menu_nodes - - - misc_nodes - 2 - PARENT-1-PROJECT_LOC/misc_nodes - - - particle_nodes - 2 - PARENT-1-PROJECT_LOC/particle_nodes - - - platform - 2 - PARENT-1-PROJECT_LOC/platform - - - script_support - 2 - PARENT-1-PROJECT_LOC/script_support - - - shaders - 2 - PARENT-1-PROJECT_LOC/shaders - - - sprite_nodes - 2 - PARENT-1-PROJECT_LOC/sprite_nodes - - - support - 2 - PARENT-1-PROJECT_LOC/support - - - text_input_node - 2 - PARENT-1-PROJECT_LOC/text_input_node - - - textures - 2 - PARENT-1-PROJECT_LOC/textures - - - tilemap_parallax_nodes - 2 - PARENT-1-PROJECT_LOC/tilemap_parallax_nodes - - - touch_dispatcher - 2 - PARENT-1-PROJECT_LOC/touch_dispatcher - - - - - 1360135975775 - platform - 9 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-true-false-linux - - - - diff --git a/cocos/2d/proj.linux/cocos2dx.prf b/cocos/2d/proj.linux/cocos2dx.prf deleted file mode 100644 index 1122180b53..0000000000 --- a/cocos/2d/proj.linux/cocos2dx.prf +++ /dev/null @@ -1,37 +0,0 @@ -################################################################################ -# Do not include this file in your project: see cocos2dx.pri. -################################################################################ - -linux { - # Use OpenAL in default QtCreator project. - isEmpty(COCOS2D_USE_FMOD):COCOS2D_USE_FMOD=0 - - # Variables used when building libraries. - CC_LIBRARY_DIR = $$PWD/../../lib/linux/release - CC_MAKE_FLAGS = -s - CONFIG(debug, debug|release) { - # Override in debug build. - CC_MAKE_FLAGS += DEBUG=1 - CC_LIBRARY_DIR = $$PWD/../../lib/linux/debug - } - contains(COCOS2D_MODULES,box2d) { - CC_MAKE_FLAGS += USE_BOX2D=1 - } - !equals(COCOS2D_USE_FMOD, 1) { - CC_MAKE_FLAGS += OPENAL=1 - } - - # We will compile cocos2d shared library on demand using Makefile. - build_cocos2d.name = Build cocos2d shared library - build_cocos2d.input = $$PWD/Makefile - build_cocos2d.output = $$CC_LIBRARY_DIR/libcocos2d.so - build_cocos2d.target = $$CC_LIBRARY_DIR/libcocos2d.so - build_cocos2d.CONFIG = no_link target_predeps - build_cocos2d.commands = cd $$PWD && make $$CC_MAKE_FLAGS ${QMAKE_FILE_IN} - - QMAKE_EXTRA_COMPILERS += build_cocos2d - QMAKE_EXTRA_TARGETS += build_cocos2d - - PRE_TARGETDEPS += $$CC_LIBRARY_DIR/libcocos2d.so - LIBS += -L$$CC_LIBRARY_DIR -lcocos2d -Wl,-rpath,\'$$CC_LIBRARY_DIR\' -} diff --git a/cocos/2d/proj.linux/cocos2dx.pri b/cocos/2d/proj.linux/cocos2dx.pri deleted file mode 100644 index 84bbb6d987..0000000000 --- a/cocos/2d/proj.linux/cocos2dx.pri +++ /dev/null @@ -1,70 +0,0 @@ - -################################################################################ -# -# If you want enable extra modules, set COCOS2D_MODULES variable before include -# this file, example: -# COCOS2D_MODULES += CocosDenshion -# COCOS2D_MODULES += extensions -# COCOS2D_MODULES += box2d -# or -# COCOS2D_MODULES += chipmunk -# note: you cannot include both box2d and chipmunk. -# -# By default, QtCreator project will use OpenAL audio backend (because FMOD is -# free only for non-commercial use). If you are legal FMOD user, set variable -# COCOS2D_USE_FMOD to use FMOD audio backend: -# COCOS2D_USE_FMOD = 1 -# -################################################################################ - -INCLUDEPATH += $$PWD/../ -INCLUDEPATH += $$PWD/../cocoa/ -INCLUDEPATH += $$PWD/../include/ -INCLUDEPATH += $$PWD/../platform/ -INCLUDEPATH += $$PWD/../kazmath/include - -*-msvc* { - # Use equivalents of -Wno-overloaded-virtual -Wno-unused-parameter. - QMAKE_CXXFLAGS_WARN_ON += /wd4263 /wd4100 -} else { - QMAKE_CXXFLAGS_WARN_ON += -Wno-ignored-qualifiers -Wno-overloaded-virtual -Wno-unused-parameter -Wno-unused-function - QMAKE_CXXFLAGS += -std=c++0x -} - -include($$PWD/cocos2dx.prf) - -linux { - DEFINES += LINUX - INCLUDEPATH += $$PWD/../platform/linux - LIBS += -lpthread -} - -contains(COCOS2D_MODULES,CocosDenshion) { - INCLUDEPATH += $$PWD/../../CocosDenshion/include - include($$PWD/../../CocosDenshion/proj.linux/CocosDenshion.prf) -} - -contains(COCOS2D_MODULES,extensions) { - INCLUDEPATH += $$PWD/../../extensions - LIBS += -lcurl - include($$PWD/../../extensions/proj.linux/extensions.prf) -} - -contains(COCOS2D_MODULES,box2d) { - INCLUDEPATH += $$PWD/../../external - include($$PWD/../../external/Box2D/proj.linux/box2d.prf) -} - -contains(COCOS2D_MODULES,chipmunk) { - contains(COCOS2D_MODULES,box2d):error("COCOS2D_MODULES cannot contain both box2d and chipmunk: choose one and remove another.") - - INCLUDEPATH += $$PWD/../../external/chipmunk/include/chipmunk - include($$PWD/../../external/chipmunk/proj.linux/chipmunk.prf) -} - -CONFIG(debug, debug|release) { - DEFINES += COCOS2D_DEBUG=1 -} -else { - DEFINES += COCOS2D_DEBUG=0 -} diff --git a/cocos/2d/support/ccUtils.cpp b/cocos/2d/support/ccUtils.cpp deleted file mode 100644 index d78324565b..0000000000 --- a/cocos/2d/support/ccUtils.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010 cocos2d-x.org - -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 "ccUtils.h" - -namespace cocos2d { - -unsigned long ccNextPOT(unsigned long x) -{ - x = x - 1; - x = x | (x >> 1); - x = x | (x >> 2); - x = x | (x >> 4); - x = x | (x >> 8); - x = x | (x >>16); - return x + 1; -} - -} \ No newline at end of file diff --git a/cocos/2d/support/tinyxml2/tinyxml2.cpp b/cocos/2d/support/tinyxml2/tinyxml2.cpp deleted file mode 100644 index f181b9050c..0000000000 --- a/cocos/2d/support/tinyxml2/tinyxml2.cpp +++ /dev/null @@ -1,2101 +0,0 @@ -/* -Original code by Lee Thomason (www.grinninglizard.com) - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any -damages arising from the use of this software. - -Permission is granted to anyone to use this software for any -purpose, including commercial applications, and to alter it and -redistribute it freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must -not claim that you wrote the original software. If you use this -software in a product, an acknowledgment in the product documentation -would be appreciated but is not required. - -2. Altered source versions must be plainly marked as such, and -must not be misrepresented as being the original software. - -3. This notice may not be removed or altered from any source -distribution. -*/ - -#include "tinyxml2.h" - -#include // yes, this one new style header, is in the Android SDK. -# if defined(ANDROID_NDK) || (CC_TARGET_PLATFORM == CC_PLATFORM_BLACKBERRY) -# include -#else -# include -#endif - -static const char LINE_FEED = (char)0x0a; // all line endings are normalized to LF -static const char LF = LINE_FEED; -static const char CARRIAGE_RETURN = (char)0x0d; // CR gets filtered out -static const char CR = CARRIAGE_RETURN; -static const char SINGLE_QUOTE = '\''; -static const char DOUBLE_QUOTE = '\"'; - -// Bunch of unicode info at: -// http://www.unicode.org/faq/utf_bom.html -// ef bb bf (Microsoft "lead bytes") - designates UTF-8 - -static const unsigned char TIXML_UTF_LEAD_0 = 0xefU; -static const unsigned char TIXML_UTF_LEAD_1 = 0xbbU; -static const unsigned char TIXML_UTF_LEAD_2 = 0xbfU; - - -#define DELETE_NODE( node ) { \ - if ( node ) { \ - MemPool* pool = node->_memPool; \ - node->~XMLNode(); \ - pool->Free( node ); \ - } \ - } -#define DELETE_ATTRIBUTE( attrib ) { \ - if ( attrib ) { \ - MemPool* pool = attrib->_memPool; \ - attrib->~XMLAttribute(); \ - pool->Free( attrib ); \ - } \ - } - -namespace tinyxml2 -{ - -struct Entity { - const char* pattern; - int length; - char value; -}; - -static const int NUM_ENTITIES = 5; -static const Entity entities[NUM_ENTITIES] = { - { "quot", 4, DOUBLE_QUOTE }, - { "amp", 3, '&' }, - { "apos", 4, SINGLE_QUOTE }, - { "lt", 2, '<' }, - { "gt", 2, '>' } -}; - - -StrPair::~StrPair() -{ - Reset(); -} - - -void StrPair::Reset() -{ - if ( _flags & NEEDS_DELETE ) { - delete [] _start; - } - _flags = 0; - _start = 0; - _end = 0; -} - - -void StrPair::SetStr( const char* str, int flags ) -{ - Reset(); - size_t len = strlen( str ); - _start = new char[ len+1 ]; - memcpy( _start, str, len+1 ); - _end = _start + len; - _flags = flags | NEEDS_DELETE; -} - - -char* StrPair::ParseText( char* p, const char* endTag, int strFlags ) -{ - TIXMLASSERT( endTag && *endTag ); - - char* start = p; // fixme: hides a member - char endChar = *endTag; - size_t length = strlen( endTag ); - - // Inner loop of text parsing. - while ( *p ) { - if ( *p == endChar && strncmp( p, endTag, length ) == 0 ) { - Set( start, p, strFlags ); - return p + length; - } - ++p; - } - return 0; -} - - -char* StrPair::ParseName( char* p ) -{ - char* start = p; - - if ( !start || !(*start) ) { - return 0; - } - - while( *p && ( - XMLUtil::IsAlphaNum( (unsigned char) *p ) - || *p == '_' - || *p == ':' - || (*p == '-' && p>start ) // can be in a name, but not lead it. - || (*p == '.' && p>start ) )) { // can be in a name, but not lead it. - ++p; - } - - if ( p > start ) { - Set( start, p, 0 ); - return p; - } - return 0; -} - - -void StrPair::CollapseWhitespace() -{ - // Trim leading space. - _start = XMLUtil::SkipWhiteSpace( _start ); - - if ( _start && *_start ) { - char* p = _start; // the read pointer - char* q = _start; // the write pointer - - while( *p ) { - if ( XMLUtil::IsWhiteSpace( *p )) { - p = XMLUtil::SkipWhiteSpace( p ); - if ( *p == 0 ) { - break; // don't write to q; this trims the trailing space. - } - *q = ' '; - ++q; - } - *q = *p; - ++q; - ++p; - } - *q = 0; - } -} - - -const char* StrPair::GetStr() -{ - if ( _flags & NEEDS_FLUSH ) { - *_end = 0; - _flags ^= NEEDS_FLUSH; - - if ( _flags ) { - char* p = _start; // the read pointer - char* q = _start; // the write pointer - - while( p < _end ) { - if ( (_flags & NEEDS_NEWLINE_NORMALIZATION) && *p == CR ) { - // CR-LF pair becomes LF - // CR alone becomes LF - // LF-CR becomes LF - if ( *(p+1) == LF ) { - p += 2; - } - else { - ++p; - } - *q++ = LF; - } - else if ( (_flags & NEEDS_NEWLINE_NORMALIZATION) && *p == LF ) { - if ( *(p+1) == CR ) { - p += 2; - } - else { - ++p; - } - *q++ = LF; - } - else if ( (_flags & NEEDS_ENTITY_PROCESSING) && *p == '&' ) { - // Entities handled by tinyXML2: - // - special entities in the entity table [in/out] - // - numeric character reference [in] - // 中 or 中 - - if ( *(p+1) == '#' ) { - char buf[10] = { 0 }; - int len; - p = const_cast( XMLUtil::GetCharacterRef( p, buf, &len ) ); - for( int i=0; i(p); - // Check for BOM: - if ( *(pu+0) == TIXML_UTF_LEAD_0 - && *(pu+1) == TIXML_UTF_LEAD_1 - && *(pu+2) == TIXML_UTF_LEAD_2 ) { - *bom = true; - p += 3; - } - return p; -} - - -void XMLUtil::ConvertUTF32ToUTF8( unsigned long input, char* output, int* length ) -{ - const unsigned long BYTE_MASK = 0xBF; - const unsigned long BYTE_MARK = 0x80; - const unsigned long FIRST_BYTE_MARK[7] = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC }; - - if (input < 0x80) { - *length = 1; - } - else if ( input < 0x800 ) { - *length = 2; - } - else if ( input < 0x10000 ) { - *length = 3; - } - else if ( input < 0x200000 ) { - *length = 4; - } - else { - *length = 0; // This code won't covert this correctly anyway. - return; - } - - output += *length; - - // Scary scary fall throughs. - switch (*length) { - case 4: - --output; - *output = (char)((input | BYTE_MARK) & BYTE_MASK); - input >>= 6; - case 3: - --output; - *output = (char)((input | BYTE_MARK) & BYTE_MASK); - input >>= 6; - case 2: - --output; - *output = (char)((input | BYTE_MARK) & BYTE_MASK); - input >>= 6; - case 1: - --output; - *output = (char)(input | FIRST_BYTE_MARK[*length]); - default: - break; - } -} - - -const char* XMLUtil::GetCharacterRef( const char* p, char* value, int* length ) -{ - // Presume an entity, and pull it out. - *length = 0; - - if ( *(p+1) == '#' && *(p+2) ) { - unsigned long ucs = 0; - ptrdiff_t delta = 0; - unsigned mult = 1; - - if ( *(p+2) == 'x' ) { - // Hexadecimal. - if ( !*(p+3) ) { - return 0; - } - - const char* q = p+3; - q = strchr( q, ';' ); - - if ( !q || !*q ) { - return 0; - } - - delta = q-p; - --q; - - while ( *q != 'x' ) { - if ( *q >= '0' && *q <= '9' ) { - ucs += mult * (*q - '0'); - } - else if ( *q >= 'a' && *q <= 'f' ) { - ucs += mult * (*q - 'a' + 10); - } - else if ( *q >= 'A' && *q <= 'F' ) { - ucs += mult * (*q - 'A' + 10 ); - } - else { - return 0; - } - mult *= 16; - --q; - } - } - else { - // Decimal. - if ( !*(p+2) ) { - return 0; - } - - const char* q = p+2; - q = strchr( q, ';' ); - - if ( !q || !*q ) { - return 0; - } - - delta = q-p; - --q; - - while ( *q != '#' ) { - if ( *q >= '0' && *q <= '9' ) { - ucs += mult * (*q - '0'); - } - else { - return 0; - } - mult *= 10; - --q; - } - } - // convert the UCS to UTF-8 - ConvertUTF32ToUTF8( ucs, value, length ); - return p + delta + 1; - } - return p+1; -} - - -void XMLUtil::ToStr( int v, char* buffer, int bufferSize ) -{ - TIXML_SNPRINTF( buffer, bufferSize, "%d", v ); -} - - -void XMLUtil::ToStr( unsigned v, char* buffer, int bufferSize ) -{ - TIXML_SNPRINTF( buffer, bufferSize, "%u", v ); -} - - -void XMLUtil::ToStr( bool v, char* buffer, int bufferSize ) -{ - TIXML_SNPRINTF( buffer, bufferSize, "%d", v ? 1 : 0 ); -} - - -void XMLUtil::ToStr( float v, char* buffer, int bufferSize ) -{ - TIXML_SNPRINTF( buffer, bufferSize, "%g", v ); -} - - -void XMLUtil::ToStr( double v, char* buffer, int bufferSize ) -{ - TIXML_SNPRINTF( buffer, bufferSize, "%g", v ); -} - - -bool XMLUtil::ToInt( const char* str, int* value ) -{ - if ( TIXML_SSCANF( str, "%d", value ) == 1 ) { - return true; - } - return false; -} - -bool XMLUtil::ToUnsigned( const char* str, unsigned *value ) -{ - if ( TIXML_SSCANF( str, "%u", value ) == 1 ) { - return true; - } - return false; -} - -bool XMLUtil::ToBool( const char* str, bool* value ) -{ - int ival = 0; - if ( ToInt( str, &ival )) { - *value = (ival==0) ? false : true; - return true; - } - if ( StringEqual( str, "true" ) ) { - *value = true; - return true; - } - else if ( StringEqual( str, "false" ) ) { - *value = false; - return true; - } - return false; -} - - -bool XMLUtil::ToFloat( const char* str, float* value ) -{ - if ( TIXML_SSCANF( str, "%f", value ) == 1 ) { - return true; - } - return false; -} - -bool XMLUtil::ToDouble( const char* str, double* value ) -{ - if ( TIXML_SSCANF( str, "%lf", value ) == 1 ) { - return true; - } - return false; -} - - -char* XMLDocument::Identify( char* p, XMLNode** node ) -{ - XMLNode* returnNode = 0; - char* start = p; - p = XMLUtil::SkipWhiteSpace( p ); - if( !p || !*p ) { - return p; - } - - // What is this thing? - // - Elements start with a letter or underscore, but xml is reserved. - // - Comments: - // - // With a special case: - // - // - // - // - // Where the closing element (/foo) *must* be the next thing after the opening - // element, and the names must match. BUT the tricky bit is that the closing - // element will be read by the child. - // - // 'endTag' is the end tag for this node, it is returned by a call to a child. - // 'parentEnd' is the end tag for the parent, which is filled in and returned. - - while( p && *p ) { - XMLNode* node = 0; - - p = _document->Identify( p, &node ); - if ( p == 0 || node == 0 ) { - break; - } - - StrPair endTag; - p = node->ParseDeep( p, &endTag ); - if ( !p ) { - DELETE_NODE( node ); - node = 0; - if ( !_document->Error() ) { - _document->SetError( XML_ERROR_PARSING, 0, 0 ); - } - break; - } - - // We read the end tag. Return it to the parent. - if ( node->ToElement() && node->ToElement()->ClosingType() == XMLElement::CLOSING ) { - if ( parentEnd ) { - *parentEnd = static_cast(node)->_value; - } - node->_memPool->SetTracked(); // created and then immediately deleted. - DELETE_NODE( node ); - return p; - } - - // Handle an end tag returned to this level. - // And handle a bunch of annoying errors. - XMLElement* ele = node->ToElement(); - if ( ele ) { - if ( endTag.Empty() && ele->ClosingType() == XMLElement::OPEN ) { - _document->SetError( XML_ERROR_MISMATCHED_ELEMENT, node->Value(), 0 ); - p = 0; - } - else if ( !endTag.Empty() && ele->ClosingType() != XMLElement::OPEN ) { - _document->SetError( XML_ERROR_MISMATCHED_ELEMENT, node->Value(), 0 ); - p = 0; - } - else if ( !endTag.Empty() ) { - if ( !XMLUtil::StringEqual( endTag.GetStr(), node->Value() )) { - _document->SetError( XML_ERROR_MISMATCHED_ELEMENT, node->Value(), 0 ); - p = 0; - } - } - } - if ( p == 0 ) { - DELETE_NODE( node ); - node = 0; - } - if ( node ) { - this->InsertEndChild( node ); - } - } - return 0; -} - -// --------- XMLText ---------- // -char* XMLText::ParseDeep( char* p, StrPair* ) -{ - const char* start = p; - if ( this->CData() ) { - p = _value.ParseText( p, "]]>", StrPair::NEEDS_NEWLINE_NORMALIZATION ); - if ( !p ) { - _document->SetError( XML_ERROR_PARSING_CDATA, start, 0 ); - } - return p; - } - else { - int flags = _document->ProcessEntities() ? StrPair::TEXT_ELEMENT : StrPair::TEXT_ELEMENT_LEAVE_ENTITIES; - if ( _document->WhitespaceMode() == COLLAPSE_WHITESPACE ) { - flags |= StrPair::COLLAPSE_WHITESPACE; - } - - p = _value.ParseText( p, "<", flags ); - if ( !p ) { - _document->SetError( XML_ERROR_PARSING_TEXT, start, 0 ); - } - if ( p && *p ) { - return p-1; - } - } - return 0; -} - - -XMLNode* XMLText::ShallowClone( XMLDocument* doc ) const -{ - if ( !doc ) { - doc = _document; - } - XMLText* text = doc->NewText( Value() ); // fixme: this will always allocate memory. Intern? - text->SetCData( this->CData() ); - return text; -} - - -bool XMLText::ShallowEqual( const XMLNode* compare ) const -{ - return ( compare->ToText() && XMLUtil::StringEqual( compare->ToText()->Value(), Value() )); -} - - -bool XMLText::Accept( XMLVisitor* visitor ) const -{ - return visitor->Visit( *this ); -} - - -// --------- XMLComment ---------- // - -XMLComment::XMLComment( XMLDocument* doc ) : XMLNode( doc ) -{ -} - - -XMLComment::~XMLComment() -{ -} - - -char* XMLComment::ParseDeep( char* p, StrPair* ) -{ - // Comment parses as text. - const char* start = p; - p = _value.ParseText( p, "-->", StrPair::COMMENT ); - if ( p == 0 ) { - _document->SetError( XML_ERROR_PARSING_COMMENT, start, 0 ); - } - return p; -} - - -XMLNode* XMLComment::ShallowClone( XMLDocument* doc ) const -{ - if ( !doc ) { - doc = _document; - } - XMLComment* comment = doc->NewComment( Value() ); // fixme: this will always allocate memory. Intern? - return comment; -} - - -bool XMLComment::ShallowEqual( const XMLNode* compare ) const -{ - return ( compare->ToComment() && XMLUtil::StringEqual( compare->ToComment()->Value(), Value() )); -} - - -bool XMLComment::Accept( XMLVisitor* visitor ) const -{ - return visitor->Visit( *this ); -} - - -// --------- XMLDeclaration ---------- // - -XMLDeclaration::XMLDeclaration( XMLDocument* doc ) : XMLNode( doc ) -{ -} - - -XMLDeclaration::~XMLDeclaration() -{ - //printf( "~XMLDeclaration\n" ); -} - - -char* XMLDeclaration::ParseDeep( char* p, StrPair* ) -{ - // Declaration parses as text. - const char* start = p; - p = _value.ParseText( p, "?>", StrPair::NEEDS_NEWLINE_NORMALIZATION ); - if ( p == 0 ) { - _document->SetError( XML_ERROR_PARSING_DECLARATION, start, 0 ); - } - return p; -} - - -XMLNode* XMLDeclaration::ShallowClone( XMLDocument* doc ) const -{ - if ( !doc ) { - doc = _document; - } - XMLDeclaration* dec = doc->NewDeclaration( Value() ); // fixme: this will always allocate memory. Intern? - return dec; -} - - -bool XMLDeclaration::ShallowEqual( const XMLNode* compare ) const -{ - return ( compare->ToDeclaration() && XMLUtil::StringEqual( compare->ToDeclaration()->Value(), Value() )); -} - - - -bool XMLDeclaration::Accept( XMLVisitor* visitor ) const -{ - return visitor->Visit( *this ); -} - -// --------- XMLUnknown ---------- // - -XMLUnknown::XMLUnknown( XMLDocument* doc ) : XMLNode( doc ) -{ -} - - -XMLUnknown::~XMLUnknown() -{ -} - - -char* XMLUnknown::ParseDeep( char* p, StrPair* ) -{ - // Unknown parses as text. - const char* start = p; - - p = _value.ParseText( p, ">", StrPair::NEEDS_NEWLINE_NORMALIZATION ); - if ( !p ) { - _document->SetError( XML_ERROR_PARSING_UNKNOWN, start, 0 ); - } - return p; -} - - -XMLNode* XMLUnknown::ShallowClone( XMLDocument* doc ) const -{ - if ( !doc ) { - doc = _document; - } - XMLUnknown* text = doc->NewUnknown( Value() ); // fixme: this will always allocate memory. Intern? - return text; -} - - -bool XMLUnknown::ShallowEqual( const XMLNode* compare ) const -{ - return ( compare->ToUnknown() && XMLUtil::StringEqual( compare->ToUnknown()->Value(), Value() )); -} - - -bool XMLUnknown::Accept( XMLVisitor* visitor ) const -{ - return visitor->Visit( *this ); -} - -// --------- XMLAttribute ---------- // -char* XMLAttribute::ParseDeep( char* p, bool processEntities ) -{ - // Parse using the name rules: bug fix, was using ParseText before - p = _name.ParseName( p ); - if ( !p || !*p ) { - return 0; - } - - // Skip white space before = - p = XMLUtil::SkipWhiteSpace( p ); - if ( !p || *p != '=' ) { - return 0; - } - - ++p; // move up to opening quote - p = XMLUtil::SkipWhiteSpace( p ); - if ( *p != '\"' && *p != '\'' ) { - return 0; - } - - char endTag[2] = { *p, 0 }; - ++p; // move past opening quote - - p = _value.ParseText( p, endTag, processEntities ? StrPair::ATTRIBUTE_VALUE : StrPair::ATTRIBUTE_VALUE_LEAVE_ENTITIES ); - return p; -} - - -void XMLAttribute::SetName( const char* n ) -{ - _name.SetStr( n ); -} - - -XMLError XMLAttribute::QueryIntValue( int* value ) const -{ - if ( XMLUtil::ToInt( Value(), value )) { - return XML_NO_ERROR; - } - return XML_WRONG_ATTRIBUTE_TYPE; -} - - -XMLError XMLAttribute::QueryUnsignedValue( unsigned int* value ) const -{ - if ( XMLUtil::ToUnsigned( Value(), value )) { - return XML_NO_ERROR; - } - return XML_WRONG_ATTRIBUTE_TYPE; -} - - -XMLError XMLAttribute::QueryBoolValue( bool* value ) const -{ - if ( XMLUtil::ToBool( Value(), value )) { - return XML_NO_ERROR; - } - return XML_WRONG_ATTRIBUTE_TYPE; -} - - -XMLError XMLAttribute::QueryFloatValue( float* value ) const -{ - if ( XMLUtil::ToFloat( Value(), value )) { - return XML_NO_ERROR; - } - return XML_WRONG_ATTRIBUTE_TYPE; -} - - -XMLError XMLAttribute::QueryDoubleValue( double* value ) const -{ - if ( XMLUtil::ToDouble( Value(), value )) { - return XML_NO_ERROR; - } - return XML_WRONG_ATTRIBUTE_TYPE; -} - - -void XMLAttribute::SetAttribute( const char* v ) -{ - _value.SetStr( v ); -} - - -void XMLAttribute::SetAttribute( int v ) -{ - char buf[BUF_SIZE]; - XMLUtil::ToStr( v, buf, BUF_SIZE ); - _value.SetStr( buf ); -} - - -void XMLAttribute::SetAttribute( unsigned v ) -{ - char buf[BUF_SIZE]; - XMLUtil::ToStr( v, buf, BUF_SIZE ); - _value.SetStr( buf ); -} - - -void XMLAttribute::SetAttribute( bool v ) -{ - char buf[BUF_SIZE]; - XMLUtil::ToStr( v, buf, BUF_SIZE ); - _value.SetStr( buf ); -} - -void XMLAttribute::SetAttribute( double v ) -{ - char buf[BUF_SIZE]; - XMLUtil::ToStr( v, buf, BUF_SIZE ); - _value.SetStr( buf ); -} - -void XMLAttribute::SetAttribute( float v ) -{ - char buf[BUF_SIZE]; - XMLUtil::ToStr( v, buf, BUF_SIZE ); - _value.SetStr( buf ); -} - - -// --------- XMLElement ---------- // -XMLElement::XMLElement( XMLDocument* doc ) : XMLNode( doc ), - _closingType( 0 ), - _rootAttribute( 0 ) -{ -} - - -XMLElement::~XMLElement() -{ - while( _rootAttribute ) { - XMLAttribute* next = _rootAttribute->_next; - DELETE_ATTRIBUTE( _rootAttribute ); - _rootAttribute = next; - } -} - - -XMLAttribute* XMLElement::FindAttribute( const char* name ) -{ - XMLAttribute* a = 0; - for( a=_rootAttribute; a; a = a->_next ) { - if ( XMLUtil::StringEqual( a->Name(), name ) ) { - return a; - } - } - return 0; -} - - -const XMLAttribute* XMLElement::FindAttribute( const char* name ) const -{ - XMLAttribute* a = 0; - for( a=_rootAttribute; a; a = a->_next ) { - if ( XMLUtil::StringEqual( a->Name(), name ) ) { - return a; - } - } - return 0; -} - - -const char* XMLElement::Attribute( const char* name, const char* value ) const -{ - const XMLAttribute* a = FindAttribute( name ); - if ( !a ) { - return 0; - } - if ( !value || XMLUtil::StringEqual( a->Value(), value )) { - return a->Value(); - } - return 0; -} - - -const char* XMLElement::GetText() const -{ - if ( FirstChild() && FirstChild()->ToText() ) { - return FirstChild()->ToText()->Value(); - } - return 0; -} - - -XMLError XMLElement::QueryIntText( int* ival ) const -{ - if ( FirstChild() && FirstChild()->ToText() ) { - const char* t = FirstChild()->ToText()->Value(); - if ( XMLUtil::ToInt( t, ival ) ) { - return XML_SUCCESS; - } - return XML_CAN_NOT_CONVERT_TEXT; - } - return XML_NO_TEXT_NODE; -} - - -XMLError XMLElement::QueryUnsignedText( unsigned* uval ) const -{ - if ( FirstChild() && FirstChild()->ToText() ) { - const char* t = FirstChild()->ToText()->Value(); - if ( XMLUtil::ToUnsigned( t, uval ) ) { - return XML_SUCCESS; - } - return XML_CAN_NOT_CONVERT_TEXT; - } - return XML_NO_TEXT_NODE; -} - - -XMLError XMLElement::QueryBoolText( bool* bval ) const -{ - if ( FirstChild() && FirstChild()->ToText() ) { - const char* t = FirstChild()->ToText()->Value(); - if ( XMLUtil::ToBool( t, bval ) ) { - return XML_SUCCESS; - } - return XML_CAN_NOT_CONVERT_TEXT; - } - return XML_NO_TEXT_NODE; -} - - -XMLError XMLElement::QueryDoubleText( double* dval ) const -{ - if ( FirstChild() && FirstChild()->ToText() ) { - const char* t = FirstChild()->ToText()->Value(); - if ( XMLUtil::ToDouble( t, dval ) ) { - return XML_SUCCESS; - } - return XML_CAN_NOT_CONVERT_TEXT; - } - return XML_NO_TEXT_NODE; -} - - -XMLError XMLElement::QueryFloatText( float* fval ) const -{ - if ( FirstChild() && FirstChild()->ToText() ) { - const char* t = FirstChild()->ToText()->Value(); - if ( XMLUtil::ToFloat( t, fval ) ) { - return XML_SUCCESS; - } - return XML_CAN_NOT_CONVERT_TEXT; - } - return XML_NO_TEXT_NODE; -} - - - -XMLAttribute* XMLElement::FindOrCreateAttribute( const char* name ) -{ - XMLAttribute* last = 0; - XMLAttribute* attrib = 0; - for( attrib = _rootAttribute; - attrib; - last = attrib, attrib = attrib->_next ) { - if ( XMLUtil::StringEqual( attrib->Name(), name ) ) { - break; - } - } - if ( !attrib ) { - attrib = new (_document->_attributePool.Alloc() ) XMLAttribute(); - attrib->_memPool = &_document->_attributePool; - if ( last ) { - last->_next = attrib; - } - else { - _rootAttribute = attrib; - } - attrib->SetName( name ); - attrib->_memPool->SetTracked(); // always created and linked. - } - return attrib; -} - - -void XMLElement::DeleteAttribute( const char* name ) -{ - XMLAttribute* prev = 0; - for( XMLAttribute* a=_rootAttribute; a; a=a->_next ) { - if ( XMLUtil::StringEqual( name, a->Name() ) ) { - if ( prev ) { - prev->_next = a->_next; - } - else { - _rootAttribute = a->_next; - } - DELETE_ATTRIBUTE( a ); - break; - } - prev = a; - } -} - - -char* XMLElement::ParseAttributes( char* p ) -{ - const char* start = p; - XMLAttribute* prevAttribute = 0; - - // Read the attributes. - while( p ) { - p = XMLUtil::SkipWhiteSpace( p ); - if ( !p || !(*p) ) { - _document->SetError( XML_ERROR_PARSING_ELEMENT, start, Name() ); - return 0; - } - - // attribute. - if ( XMLUtil::IsAlpha( *p ) ) { - XMLAttribute* attrib = new (_document->_attributePool.Alloc() ) XMLAttribute(); - attrib->_memPool = &_document->_attributePool; - attrib->_memPool->SetTracked(); - - p = attrib->ParseDeep( p, _document->ProcessEntities() ); - if ( !p || Attribute( attrib->Name() ) ) { - DELETE_ATTRIBUTE( attrib ); - _document->SetError( XML_ERROR_PARSING_ATTRIBUTE, start, p ); - return 0; - } - // There is a minor bug here: if the attribute in the source xml - // document is duplicated, it will not be detected and the - // attribute will be doubly added. However, tracking the 'prevAttribute' - // avoids re-scanning the attribute list. Preferring performance for - // now, may reconsider in the future. - if ( prevAttribute ) { - prevAttribute->_next = attrib; - } - else { - _rootAttribute = attrib; - } - prevAttribute = attrib; - } - // end of the tag - else if ( *p == '/' && *(p+1) == '>' ) { - _closingType = CLOSED; - return p+2; // done; sealed element. - } - // end of the tag - else if ( *p == '>' ) { - ++p; - break; - } - else { - _document->SetError( XML_ERROR_PARSING_ELEMENT, start, p ); - return 0; - } - } - return p; -} - - -// -// -// foobar -// -char* XMLElement::ParseDeep( char* p, StrPair* strPair ) -{ - // Read the element name. - p = XMLUtil::SkipWhiteSpace( p ); - if ( !p ) { - return 0; - } - - // The closing element is the form. It is - // parsed just like a regular element then deleted from - // the DOM. - if ( *p == '/' ) { - _closingType = CLOSING; - ++p; - } - - p = _value.ParseName( p ); - if ( _value.Empty() ) { - return 0; - } - - p = ParseAttributes( p ); - if ( !p || !*p || _closingType ) { - return p; - } - - p = XMLNode::ParseDeep( p, strPair ); - return p; -} - - - -XMLNode* XMLElement::ShallowClone( XMLDocument* doc ) const -{ - if ( !doc ) { - doc = _document; - } - XMLElement* element = doc->NewElement( Value() ); // fixme: this will always allocate memory. Intern? - for( const XMLAttribute* a=FirstAttribute(); a; a=a->Next() ) { - element->SetAttribute( a->Name(), a->Value() ); // fixme: this will always allocate memory. Intern? - } - return element; -} - - -bool XMLElement::ShallowEqual( const XMLNode* compare ) const -{ - const XMLElement* other = compare->ToElement(); - if ( other && XMLUtil::StringEqual( other->Value(), Value() )) { - - const XMLAttribute* a=FirstAttribute(); - const XMLAttribute* b=other->FirstAttribute(); - - while ( a && b ) { - if ( !XMLUtil::StringEqual( a->Value(), b->Value() ) ) { - return false; - } - a = a->Next(); - b = b->Next(); - } - if ( a || b ) { - // different count - return false; - } - return true; - } - return false; -} - - -bool XMLElement::Accept( XMLVisitor* visitor ) const -{ - if ( visitor->VisitEnter( *this, _rootAttribute ) ) { - for ( const XMLNode* node=FirstChild(); node; node=node->NextSibling() ) { - if ( !node->Accept( visitor ) ) { - break; - } - } - } - return visitor->VisitExit( *this ); -} - - -// --------- XMLDocument ----------- // -XMLDocument::XMLDocument( bool processEntities, Whitespace whitespace ) : - XMLNode( 0 ), - _writeBOM( false ), - _processEntities( processEntities ), - _errorID( XML_NO_ERROR ), - _whitespace( whitespace ), - _errorStr1( 0 ), - _errorStr2( 0 ), - _charBuffer( 0 ) -{ - _document = this; // avoid warning about 'this' in initializer list -} - - -XMLDocument::~XMLDocument() -{ - DeleteChildren(); - delete [] _charBuffer; - -#if 0 - textPool.Trace( "text" ); - elementPool.Trace( "element" ); - commentPool.Trace( "comment" ); - attributePool.Trace( "attribute" ); -#endif - -#ifdef DEBUG - if ( Error() == false ) { - TIXMLASSERT( _elementPool.CurrentAllocs() == _elementPool.Untracked() ); - TIXMLASSERT( _attributePool.CurrentAllocs() == _attributePool.Untracked() ); - TIXMLASSERT( _textPool.CurrentAllocs() == _textPool.Untracked() ); - TIXMLASSERT( _commentPool.CurrentAllocs() == _commentPool.Untracked() ); - } -#endif -} - - -void XMLDocument::InitDocument() -{ - _errorID = XML_NO_ERROR; - _errorStr1 = 0; - _errorStr2 = 0; - - delete [] _charBuffer; - _charBuffer = 0; -} - - -XMLElement* XMLDocument::NewElement( const char* name ) -{ - XMLElement* ele = new (_elementPool.Alloc()) XMLElement( this ); - ele->_memPool = &_elementPool; - ele->SetName( name ); - return ele; -} - - -XMLComment* XMLDocument::NewComment( const char* str ) -{ - XMLComment* comment = new (_commentPool.Alloc()) XMLComment( this ); - comment->_memPool = &_commentPool; - comment->SetValue( str ); - return comment; -} - - -XMLText* XMLDocument::NewText( const char* str ) -{ - XMLText* text = new (_textPool.Alloc()) XMLText( this ); - text->_memPool = &_textPool; - text->SetValue( str ); - return text; -} - - -XMLDeclaration* XMLDocument::NewDeclaration( const char* str ) -{ - XMLDeclaration* dec = new (_commentPool.Alloc()) XMLDeclaration( this ); - dec->_memPool = &_commentPool; - dec->SetValue( str ? str : "xml version=\"1.0\" encoding=\"UTF-8\"" ); - return dec; -} - - -XMLUnknown* XMLDocument::NewUnknown( const char* str ) -{ - XMLUnknown* unk = new (_commentPool.Alloc()) XMLUnknown( this ); - unk->_memPool = &_commentPool; - unk->SetValue( str ); - return unk; -} - - -XMLError XMLDocument::LoadFile( const char* filename ) -{ - DeleteChildren(); - InitDocument(); - FILE* fp = 0; - -#if defined(_MSC_VER) && (_MSC_VER >= 1400 ) && (CC_TARGET_PLATFORM != CC_PLATFORM_MARMALADE) - errno_t err = fopen_s(&fp, filename, "rb" ); - if ( !fp || err) { -#else - fp = fopen( filename, "rb" ); - if ( !fp) { -#endif - SetError( XML_ERROR_FILE_NOT_FOUND, filename, 0 ); - return _errorID; - } - LoadFile( fp ); - fclose( fp ); - return _errorID; -} - - -XMLError XMLDocument::LoadFile( FILE* fp ) -{ - DeleteChildren(); - InitDocument(); - - fseek( fp, 0, SEEK_END ); - size_t size = ftell( fp ); - fseek( fp, 0, SEEK_SET ); - - if ( size == 0 ) { - return _errorID; - } - - _charBuffer = new char[size+1]; - size_t read = fread( _charBuffer, 1, size, fp ); - if ( read != size ) { - SetError( XML_ERROR_FILE_READ_ERROR, 0, 0 ); - return _errorID; - } - - _charBuffer[size] = 0; - - const char* p = _charBuffer; - p = XMLUtil::SkipWhiteSpace( p ); - p = XMLUtil::ReadBOM( p, &_writeBOM ); - if ( !p || !*p ) { - SetError( XML_ERROR_EMPTY_DOCUMENT, 0, 0 ); - return _errorID; - } - - ParseDeep( _charBuffer + (p-_charBuffer), 0 ); - return _errorID; -} - - -XMLError XMLDocument::SaveFile( const char* filename, bool compact ) -{ - FILE* fp = 0; -#if defined(_MSC_VER) && (_MSC_VER >= 1400 ) && (CC_TARGET_PLATFORM != CC_PLATFORM_MARMALADE) - errno_t err = fopen_s(&fp, filename, "w" ); - if ( !fp || err) { -#else - fp = fopen( filename, "w" ); - if ( !fp) { -#endif - SetError( XML_ERROR_FILE_COULD_NOT_BE_OPENED, filename, 0 ); - return _errorID; - } - SaveFile(fp, compact); - fclose( fp ); - return _errorID; -} - - -XMLError XMLDocument::SaveFile( FILE* fp, bool compact ) -{ - XMLPrinter stream( fp, compact ); - Print( &stream ); - return _errorID; -} - - -XMLError XMLDocument::Parse( const char* p, size_t len ) -{ - DeleteChildren(); - InitDocument(); - - if ( !p || !*p ) { - SetError( XML_ERROR_EMPTY_DOCUMENT, 0, 0 ); - return _errorID; - } - if ( len == (size_t)(-1) ) { - len = strlen( p ); - } - _charBuffer = new char[ len+1 ]; - memcpy( _charBuffer, p, len ); - _charBuffer[len] = 0; - - p = XMLUtil::SkipWhiteSpace( p ); - p = XMLUtil::ReadBOM( p, &_writeBOM ); - if ( !p || !*p ) { - SetError( XML_ERROR_EMPTY_DOCUMENT, 0, 0 ); - return _errorID; - } - - ParseDeep( _charBuffer, 0 ); - return _errorID; -} - - -void XMLDocument::Print( XMLPrinter* streamer ) -{ - XMLPrinter stdStreamer( stdout ); - if ( !streamer ) { - streamer = &stdStreamer; - } - Accept( streamer ); -} - - -void XMLDocument::SetError( XMLError error, const char* str1, const char* str2 ) -{ - _errorID = error; - _errorStr1 = str1; - _errorStr2 = str2; -} - - -void XMLDocument::PrintError() const -{ - if ( _errorID ) { - static const int LEN = 20; - char buf1[LEN] = { 0 }; - char buf2[LEN] = { 0 }; - - if ( _errorStr1 ) { - TIXML_SNPRINTF( buf1, LEN, "%s", _errorStr1 ); - } - if ( _errorStr2 ) { - TIXML_SNPRINTF( buf2, LEN, "%s", _errorStr2 ); - } - - printf( "XMLDocument error id=%d str1=%s str2=%s\n", - _errorID, buf1, buf2 ); - } -} - - -XMLPrinter::XMLPrinter( FILE* file, bool compact ) : - _elementJustOpened( false ), - _firstElement( true ), - _fp( file ), - _depth( 0 ), - _textDepth( -1 ), - _processEntities( true ), - _compactMode( compact ) -{ - for( int i=0; i'] = true; // not required, but consistency is nice - _buffer.Push( 0 ); -} - - -void XMLPrinter::Print( const char* format, ... ) -{ - va_list va; - va_start( va, format ); - - if ( _fp ) { - vfprintf( _fp, format, va ); - } - else { - // This seems brutally complex. Haven't figured out a better - // way on windows. -#if defined _MSC_VER && (CC_TARGET_PLATFORM != CC_PLATFORM_MARMALADE) - int len = -1; - int expand = 1000; - while ( len < 0 ) { - len = vsnprintf_s( _accumulator.Mem(), _accumulator.Capacity(), _TRUNCATE, format, va ); - if ( len < 0 ) { - expand *= 3/2; - _accumulator.PushArr( expand ); - } - } - char* p = _buffer.PushArr( len ) - 1; - memcpy( p, _accumulator.Mem(), len+1 ); -#else - int len = vsnprintf( 0, 0, format, va ); - // Close out and re-start the va-args - va_end( va ); - va_start( va, format ); - char* p = _buffer.PushArr( len ) - 1; - vsnprintf( p, len+1, format, va ); -#endif - } - va_end( va ); -} - - -void XMLPrinter::PrintSpace( int depth ) -{ - for( int i=0; i 0 && *q < ENTITY_RANGE ) { - // Check for entities. If one is found, flush - // the stream up until the entity, write the - // entity, and keep looking. - if ( flag[(unsigned)(*q)] ) { - while ( p < q ) { - Print( "%c", *p ); - ++p; - } - for( int i=0; i 0) ) { - Print( "%s", p ); - } -} - - -void XMLPrinter::PushHeader( bool writeBOM, bool writeDec ) -{ - static const unsigned char bom[] = { TIXML_UTF_LEAD_0, TIXML_UTF_LEAD_1, TIXML_UTF_LEAD_2, 0 }; - if ( writeBOM ) { - Print( "%s", bom ); - } - if ( writeDec ) { - PushDeclaration( "xml version=\"1.0\"" ); - } -} - - -void XMLPrinter::OpenElement( const char* name ) -{ - if ( _elementJustOpened ) { - SealElement(); - } - _stack.Push( name ); - - if ( _textDepth < 0 && !_firstElement && !_compactMode ) { - Print( "\n" ); - PrintSpace( _depth ); - } - - Print( "<%s", name ); - _elementJustOpened = true; - _firstElement = false; - ++_depth; -} - - -void XMLPrinter::PushAttribute( const char* name, const char* value ) -{ - TIXMLASSERT( _elementJustOpened ); - Print( " %s=\"", name ); - PrintString( value, false ); - Print( "\"" ); -} - - -void XMLPrinter::PushAttribute( const char* name, int v ) -{ - char buf[BUF_SIZE]; - XMLUtil::ToStr( v, buf, BUF_SIZE ); - PushAttribute( name, buf ); -} - - -void XMLPrinter::PushAttribute( const char* name, unsigned v ) -{ - char buf[BUF_SIZE]; - XMLUtil::ToStr( v, buf, BUF_SIZE ); - PushAttribute( name, buf ); -} - - -void XMLPrinter::PushAttribute( const char* name, bool v ) -{ - char buf[BUF_SIZE]; - XMLUtil::ToStr( v, buf, BUF_SIZE ); - PushAttribute( name, buf ); -} - - -void XMLPrinter::PushAttribute( const char* name, double v ) -{ - char buf[BUF_SIZE]; - XMLUtil::ToStr( v, buf, BUF_SIZE ); - PushAttribute( name, buf ); -} - - -void XMLPrinter::CloseElement() -{ - --_depth; - const char* name = _stack.Pop(); - - if ( _elementJustOpened ) { - Print( "/>" ); - } - else { - if ( _textDepth < 0 && !_compactMode) { - Print( "\n" ); - PrintSpace( _depth ); - } - Print( "", name ); - } - - if ( _textDepth == _depth ) { - _textDepth = -1; - } - if ( _depth == 0 && !_compactMode) { - Print( "\n" ); - } - _elementJustOpened = false; -} - - -void XMLPrinter::SealElement() -{ - _elementJustOpened = false; - Print( ">" ); -} - - -void XMLPrinter::PushText( const char* text, bool cdata ) -{ - _textDepth = _depth-1; - - if ( _elementJustOpened ) { - SealElement(); - } - if ( cdata ) { - Print( "" ); - } - else { - PrintString( text, true ); - } -} - -void XMLPrinter::PushText( int value ) -{ - char buf[BUF_SIZE]; - XMLUtil::ToStr( value, buf, BUF_SIZE ); - PushText( buf, false ); -} - - -void XMLPrinter::PushText( unsigned value ) -{ - char buf[BUF_SIZE]; - XMLUtil::ToStr( value, buf, BUF_SIZE ); - PushText( buf, false ); -} - - -void XMLPrinter::PushText( bool value ) -{ - char buf[BUF_SIZE]; - XMLUtil::ToStr( value, buf, BUF_SIZE ); - PushText( buf, false ); -} - - -void XMLPrinter::PushText( float value ) -{ - char buf[BUF_SIZE]; - XMLUtil::ToStr( value, buf, BUF_SIZE ); - PushText( buf, false ); -} - - -void XMLPrinter::PushText( double value ) -{ - char buf[BUF_SIZE]; - XMLUtil::ToStr( value, buf, BUF_SIZE ); - PushText( buf, false ); -} - - -void XMLPrinter::PushComment( const char* comment ) -{ - if ( _elementJustOpened ) { - SealElement(); - } - if ( _textDepth < 0 && !_firstElement && !_compactMode) { - Print( "\n" ); - PrintSpace( _depth ); - } - _firstElement = false; - Print( "", comment ); -} - - -void XMLPrinter::PushDeclaration( const char* value ) -{ - if ( _elementJustOpened ) { - SealElement(); - } - if ( _textDepth < 0 && !_firstElement && !_compactMode) { - Print( "\n" ); - PrintSpace( _depth ); - } - _firstElement = false; - Print( "", value ); -} - - -void XMLPrinter::PushUnknown( const char* value ) -{ - if ( _elementJustOpened ) { - SealElement(); - } - if ( _textDepth < 0 && !_firstElement && !_compactMode) { - Print( "\n" ); - PrintSpace( _depth ); - } - _firstElement = false; - Print( "", value ); -} - - -bool XMLPrinter::VisitEnter( const XMLDocument& doc ) -{ - _processEntities = doc.ProcessEntities(); - if ( doc.HasBOM() ) { - PushHeader( true, false ); - } - return true; -} - - -bool XMLPrinter::VisitEnter( const XMLElement& element, const XMLAttribute* attribute ) -{ - OpenElement( element.Name() ); - while ( attribute ) { - PushAttribute( attribute->Name(), attribute->Value() ); - attribute = attribute->Next(); - } - return true; -} - - -bool XMLPrinter::VisitExit( const XMLElement& ) -{ - CloseElement(); - return true; -} - - -bool XMLPrinter::Visit( const XMLText& text ) -{ - PushText( text.Value(), text.CData() ); - return true; -} - - -bool XMLPrinter::Visit( const XMLComment& comment ) -{ - PushComment( comment.Value() ); - return true; -} - -bool XMLPrinter::Visit( const XMLDeclaration& declaration ) -{ - PushDeclaration( declaration.Value() ); - return true; -} - - -bool XMLPrinter::Visit( const XMLUnknown& unknown ) -{ - PushUnknown( unknown.Value() ); - return true; -} - -} // namespace tinyxml2 - diff --git a/cocos/2d/support/tinyxml2/tinyxml2.h b/cocos/2d/support/tinyxml2/tinyxml2.h deleted file mode 100644 index eeffa1096f..0000000000 --- a/cocos/2d/support/tinyxml2/tinyxml2.h +++ /dev/null @@ -1,1914 +0,0 @@ -/* -Original code by Lee Thomason (www.grinninglizard.com) - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any -damages arising from the use of this software. - -Permission is granted to anyone to use this software for any -purpose, including commercial applications, and to alter it and -redistribute it freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must -not claim that you wrote the original software. If you use this -software in a product, an acknowledgment in the product documentation -would be appreciated but is not required. - -2. Altered source versions must be plainly marked as such, and -must not be misrepresented as being the original software. - -3. This notice may not be removed or altered from any source -distribution. -*/ - -#ifndef TINYXML2_INCLUDED -#define TINYXML2_INCLUDED - -#include "platform/CCPlatformConfig.h" -#include "platform/CCPlatformMacros.h" - -#if defined(ANDROID_NDK) || defined(__BORLANDC__) || (CC_TARGET_PLATFORM == CC_PLATFORM_BLACKBERRY) -# include -# include -# include -# include -# include -# include -#else -# include -# include -# include -# include -# include -# include -#endif - -/* - TODO: intern strings instead of allocation. -*/ -/* - gcc: - g++ -Wall -DDEBUG tinyxml2.cpp xmltest.cpp -o gccxmltest.exe - - Formatting, Artistic Style: - AStyle.exe --style=1tbs --indent-switches --break-closing-brackets --indent-preprocessor tinyxml2.cpp tinyxml2.h -*/ - -#if defined( _DEBUG ) || defined( DEBUG ) || defined (__DEBUG__) -# ifndef DEBUG -# define DEBUG -# endif -#endif - - -#if defined(DEBUG) -# if defined(_MSC_VER) -# define TIXMLASSERT( x ) if ( !(x)) { __debugbreak(); } //if ( !(x)) WinDebugBreak() -# elif defined (ANDROID_NDK) -# include -# define TIXMLASSERT( x ) if ( !(x)) { __android_log_assert( "assert", "grinliz", "ASSERT in '%s' at %d.", __FILE__, __LINE__ ); } -# else -# include -# define TIXMLASSERT assert -# endif -# else -# define TIXMLASSERT( x ) {} -#endif - - -#if (defined(_MSC_VER) && (_MSC_VER >= 1400 ) && (CC_TARGET_PLATFORM != CC_PLATFORM_MARMALADE)) -// Microsoft visual studio, version 2005 and higher. -/*int _snprintf_s( - char *buffer, - size_t sizeOfBuffer, - size_t count, - const char *format [, - argument] ... -);*/ -inline int TIXML_SNPRINTF( char* buffer, size_t size, const char* format, ... ) -{ - va_list va; - va_start( va, format ); - int result = vsnprintf_s( buffer, size, _TRUNCATE, format, va ); - va_end( va ); - return result; -} -#define TIXML_SSCANF sscanf_s -#else -// GCC version 3 and higher -//#warning( "Using sn* functions." ) -#define TIXML_SNPRINTF snprintf -#define TIXML_SSCANF sscanf -#endif - -static const int TIXML2_MAJOR_VERSION = 1; -static const int TIXML2_MINOR_VERSION = 0; -static const int TIXML2_PATCH_VERSION = 9; - -namespace tinyxml2 -{ -class XMLDocument; -class XMLElement; -class XMLAttribute; -class XMLComment; -class XMLNode; -class XMLText; -class XMLDeclaration; -class XMLUnknown; - -class XMLPrinter; - -/* - A class that wraps strings. Normally stores the start and end - pointers into the XML file itself, and will apply normalization - and entity translation if actually read. Can also store (and memory - manage) a traditional char[] -*/ -class CC_DLL StrPair -{ -public: - enum { - NEEDS_ENTITY_PROCESSING = 0x01, - NEEDS_NEWLINE_NORMALIZATION = 0x02, - COLLAPSE_WHITESPACE = 0x04, - - TEXT_ELEMENT = NEEDS_ENTITY_PROCESSING | NEEDS_NEWLINE_NORMALIZATION, - TEXT_ELEMENT_LEAVE_ENTITIES = NEEDS_NEWLINE_NORMALIZATION, - ATTRIBUTE_NAME = 0, - ATTRIBUTE_VALUE = NEEDS_ENTITY_PROCESSING | NEEDS_NEWLINE_NORMALIZATION, - ATTRIBUTE_VALUE_LEAVE_ENTITIES = NEEDS_NEWLINE_NORMALIZATION, - COMMENT = NEEDS_NEWLINE_NORMALIZATION - }; - - StrPair() : _flags( 0 ), _start( 0 ), _end( 0 ) {} - ~StrPair(); - - void Set( char* start, char* end, int flags ) { - Reset(); - _start = start; - _end = end; - _flags = flags | NEEDS_FLUSH; - } - - const char* GetStr(); - - bool Empty() const { - return _start == _end; - } - - void SetInternedStr( const char* str ) { - Reset(); - _start = const_cast(str); - } - - void SetStr( const char* str, int flags=0 ); - - char* ParseText( char* in, const char* endTag, int strFlags ); - char* ParseName( char* in ); - -private: - void Reset(); - void CollapseWhitespace(); - - enum { - NEEDS_FLUSH = 0x100, - NEEDS_DELETE = 0x200 - }; - - // After parsing, if *end != 0, it can be set to zero. - int _flags; - char* _start; - char* _end; -}; - - -/* - A dynamic array of Plain Old Data. Doesn't support constructors, etc. - Has a small initial memory pool, so that low or no usage will not - cause a call to new/delete -*/ -template -class CC_DLL DynArray -{ -public: - DynArray< T, INIT >() { - _mem = _pool; - _allocated = INIT; - _size = 0; - } - - ~DynArray() { - if ( _mem != _pool ) { - delete [] _mem; - } - } - - void Push( T t ) { - EnsureCapacity( _size+1 ); - _mem[_size++] = t; - } - - T* PushArr( int count ) { - EnsureCapacity( _size+count ); - T* ret = &_mem[_size]; - _size += count; - return ret; - } - - T Pop() { - return _mem[--_size]; - } - - void PopArr( int count ) { - TIXMLASSERT( _size >= count ); - _size -= count; - } - - bool Empty() const { - return _size == 0; - } - - T& operator[](int i) { - TIXMLASSERT( i>= 0 && i < _size ); - return _mem[i]; - } - - const T& operator[](int i) const { - TIXMLASSERT( i>= 0 && i < _size ); - return _mem[i]; - } - - int Size() const { - return _size; - } - - int Capacity() const { - return _allocated; - } - - const T* Mem() const { - return _mem; - } - - T* Mem() { - return _mem; - } - -private: - void EnsureCapacity( int cap ) { - if ( cap > _allocated ) { - int newAllocated = cap * 2; - T* newMem = new T[newAllocated]; - memcpy( newMem, _mem, sizeof(T)*_size ); // warning: not using constructors, only works for PODs - if ( _mem != _pool ) { - delete [] _mem; - } - _mem = newMem; - _allocated = newAllocated; - } - } - - T* _mem; - T _pool[INIT]; - int _allocated; // objects allocated - int _size; // number objects in use -}; - - -/* - Parent virtual class of a pool for fast allocation - and deallocation of objects. -*/ -class CC_DLL MemPool -{ -public: - MemPool() {} - virtual ~MemPool() {} - - virtual int ItemSize() const = 0; - virtual void* Alloc() = 0; - virtual void Free( void* ) = 0; - virtual void SetTracked() = 0; -}; - - -/* - Template child class to create pools of the correct type. -*/ -template< int SIZE > -class CC_DLL MemPoolT : public MemPool -{ -public: - MemPoolT() : _root(0), _currentAllocs(0), _nAllocs(0), _maxAllocs(0), _nUntracked(0) {} - ~MemPoolT() { - // Delete the blocks. - for( int i=0; i<_blockPtrs.Size(); ++i ) { - delete _blockPtrs[i]; - } - } - - virtual int ItemSize() const { - return SIZE; - } - int CurrentAllocs() const { - return _currentAllocs; - } - - virtual void* Alloc() { - if ( !_root ) { - // Need a new block. - Block* block = new Block(); - _blockPtrs.Push( block ); - - for( int i=0; ichunk[i].next = &block->chunk[i+1]; - } - block->chunk[COUNT-1].next = 0; - _root = block->chunk; - } - void* result = _root; - _root = _root->next; - - ++_currentAllocs; - if ( _currentAllocs > _maxAllocs ) { - _maxAllocs = _currentAllocs; - } - _nAllocs++; - _nUntracked++; - return result; - } - virtual void Free( void* mem ) { - if ( !mem ) { - return; - } - --_currentAllocs; - Chunk* chunk = (Chunk*)mem; -#ifdef DEBUG - memset( chunk, 0xfe, sizeof(Chunk) ); -#endif - chunk->next = _root; - _root = chunk; - } - void Trace( const char* name ) { - printf( "Mempool %s watermark=%d [%dk] current=%d size=%d nAlloc=%d blocks=%d\n", - name, _maxAllocs, _maxAllocs*SIZE/1024, _currentAllocs, SIZE, _nAllocs, _blockPtrs.Size() ); - } - - void SetTracked() { - _nUntracked--; - } - - int Untracked() const { - return _nUntracked; - } - - enum { COUNT = 1024/SIZE }; // Some compilers do not accept to use COUNT in private part if COUNT is private - -private: - union Chunk { - Chunk* next; - char mem[SIZE]; - }; - struct Block { - Chunk chunk[COUNT]; - }; - DynArray< Block*, 10 > _blockPtrs; - Chunk* _root; - - int _currentAllocs; - int _nAllocs; - int _maxAllocs; - int _nUntracked; -}; - - - -/** - Implements the interface to the "Visitor pattern" (see the Accept() method.) - If you call the Accept() method, it requires being passed a XMLVisitor - class to handle callbacks. For nodes that contain other nodes (Document, Element) - you will get called with a VisitEnter/VisitExit pair. Nodes that are always leafs - are simply called with Visit(). - - If you return 'true' from a Visit method, recursive parsing will continue. If you return - false, no children of this node or its sibilings will be visited. - - All flavors of Visit methods have a default implementation that returns 'true' (continue - visiting). You need to only override methods that are interesting to you. - - Generally Accept() is called on the TiXmlDocument, although all nodes support visiting. - - You should never change the document from a callback. - - @sa XMLNode::Accept() -*/ -class CC_DLL XMLVisitor -{ -public: - virtual ~XMLVisitor() {} - - /// Visit a document. - virtual bool VisitEnter( const XMLDocument& /*doc*/ ) { - return true; - } - /// Visit a document. - virtual bool VisitExit( const XMLDocument& /*doc*/ ) { - return true; - } - - /// Visit an element. - virtual bool VisitEnter( const XMLElement& /*element*/, const XMLAttribute* /*firstAttribute*/ ) { - return true; - } - /// Visit an element. - virtual bool VisitExit( const XMLElement& /*element*/ ) { - return true; - } - - /// Visit a declaration. - virtual bool Visit( const XMLDeclaration& /*declaration*/ ) { - return true; - } - /// Visit a text node. - virtual bool Visit( const XMLText& /*text*/ ) { - return true; - } - /// Visit a comment node. - virtual bool Visit( const XMLComment& /*comment*/ ) { - return true; - } - /// Visit an unknown node. - virtual bool Visit( const XMLUnknown& /*unknown*/ ) { - return true; - } -}; - - -/* - Utility functionality. -*/ -class CC_DLL XMLUtil -{ -public: - // Anything in the high order range of UTF-8 is assumed to not be whitespace. This isn't - // correct, but simple, and usually works. - static const char* SkipWhiteSpace( const char* p ) { - while( !IsUTF8Continuation(*p) && isspace( *reinterpret_cast(p) ) ) { - ++p; - } - return p; - } - static char* SkipWhiteSpace( char* p ) { - while( !IsUTF8Continuation(*p) && isspace( *reinterpret_cast(p) ) ) { - ++p; - } - return p; - } - static bool IsWhiteSpace( char p ) { - return !IsUTF8Continuation(p) && isspace( static_cast(p) ); - } - - inline static bool StringEqual( const char* p, const char* q, int nChar=INT_MAX ) { - int n = 0; - if ( p == q ) { - return true; - } - while( *p && *q && *p == *q && n(const_cast(this)->FirstChildElement( value )); - } - - /// Get the last child node, or null if none exists. - const XMLNode* LastChild() const { - return _lastChild; - } - - XMLNode* LastChild() { - return const_cast(const_cast(this)->LastChild() ); - } - - /** Get the last child element or optionally the last child - element with the specified name. - */ - const XMLElement* LastChildElement( const char* value=0 ) const; - - XMLElement* LastChildElement( const char* value=0 ) { - return const_cast(const_cast(this)->LastChildElement(value) ); - } - - /// Get the previous (left) sibling node of this node. - const XMLNode* PreviousSibling() const { - return _prev; - } - - XMLNode* PreviousSibling() { - return _prev; - } - - /// Get the previous (left) sibling element of this node, with an opitionally supplied name. - const XMLElement* PreviousSiblingElement( const char* value=0 ) const ; - - XMLElement* PreviousSiblingElement( const char* value=0 ) { - return const_cast(const_cast(this)->PreviousSiblingElement( value ) ); - } - - /// Get the next (right) sibling node of this node. - const XMLNode* NextSibling() const { - return _next; - } - - XMLNode* NextSibling() { - return _next; - } - - /// Get the next (right) sibling element of this node, with an opitionally supplied name. - const XMLElement* NextSiblingElement( const char* value=0 ) const; - - XMLElement* NextSiblingElement( const char* value=0 ) { - return const_cast(const_cast(this)->NextSiblingElement( value ) ); - } - - /** - Add a child node as the last (right) child. - */ - XMLNode* InsertEndChild( XMLNode* addThis ); - - XMLNode* LinkEndChild( XMLNode* addThis ) { - return InsertEndChild( addThis ); - } - /** - Add a child node as the first (left) child. - */ - XMLNode* InsertFirstChild( XMLNode* addThis ); - /** - Add a node after the specified child node. - */ - XMLNode* InsertAfterChild( XMLNode* afterThis, XMLNode* addThis ); - - /** - Delete all the children of this node. - */ - void DeleteChildren(); - - /** - Delete a child of this node. - */ - void DeleteChild( XMLNode* node ); - - /** - Make a copy of this node, but not its children. - You may pass in a Document pointer that will be - the owner of the new Node. If the 'document' is - null, then the node returned will be allocated - from the current Document. (this->GetDocument()) - - Note: if called on a XMLDocument, this will return null. - */ - virtual XMLNode* ShallowClone( XMLDocument* document ) const = 0; - - /** - Test if 2 nodes are the same, but don't test children. - The 2 nodes do not need to be in the same Document. - - Note: if called on a XMLDocument, this will return false. - */ - virtual bool ShallowEqual( const XMLNode* compare ) const = 0; - - /** Accept a hierarchical visit of the nodes in the TinyXML DOM. Every node in the - XML tree will be conditionally visited and the host will be called back - via the TiXmlVisitor interface. - - This is essentially a SAX interface for TinyXML. (Note however it doesn't re-parse - the XML for the callbacks, so the performance of TinyXML is unchanged by using this - interface versus any other.) - - The interface has been based on ideas from: - - - http://www.saxproject.org/ - - http://c2.com/cgi/wiki?HierarchicalVisitorPattern - - Which are both good references for "visiting". - - An example of using Accept(): - @verbatim - TiXmlPrinter printer; - tinyxmlDoc.Accept( &printer ); - const char* xmlcstr = printer.CStr(); - @endverbatim - */ - virtual bool Accept( XMLVisitor* visitor ) const = 0; - - // internal - virtual char* ParseDeep( char*, StrPair* ); - -protected: - XMLNode( XMLDocument* ); - virtual ~XMLNode(); - XMLNode( const XMLNode& ); // not supported - XMLNode& operator=( const XMLNode& ); // not supported - - XMLDocument* _document; - XMLNode* _parent; - mutable StrPair _value; - - XMLNode* _firstChild; - XMLNode* _lastChild; - - XMLNode* _prev; - XMLNode* _next; - -private: - MemPool* _memPool; - void Unlink( XMLNode* child ); -}; - - -/** XML text. - - Note that a text node can have child element nodes, for example: - @verbatim - This is bold - @endverbatim - - A text node can have 2 ways to output the next. "normal" output - and CDATA. It will default to the mode it was parsed from the XML file and - you generally want to leave it alone, but you can change the output mode with - SetCDATA() and query it with CDATA(). -*/ -class CC_DLL XMLText : public XMLNode -{ - friend class XMLBase; - friend class XMLDocument; -public: - virtual bool Accept( XMLVisitor* visitor ) const; - - virtual XMLText* ToText() { - return this; - } - virtual const XMLText* ToText() const { - return this; - } - - /// Declare whether this should be CDATA or standard text. - void SetCData( bool isCData ) { - _isCData = isCData; - } - /// Returns true if this is a CDATA text element. - bool CData() const { - return _isCData; - } - - char* ParseDeep( char*, StrPair* endTag ); - virtual XMLNode* ShallowClone( XMLDocument* document ) const; - virtual bool ShallowEqual( const XMLNode* compare ) const; - -protected: - XMLText( XMLDocument* doc ) : XMLNode( doc ), _isCData( false ) {} - virtual ~XMLText() {} - XMLText( const XMLText& ); // not supported - XMLText& operator=( const XMLText& ); // not supported - -private: - bool _isCData; -}; - - -/** An XML Comment. */ -class CC_DLL XMLComment : public XMLNode -{ - friend class XMLDocument; -public: - virtual XMLComment* ToComment() { - return this; - } - virtual const XMLComment* ToComment() const { - return this; - } - - virtual bool Accept( XMLVisitor* visitor ) const; - - char* ParseDeep( char*, StrPair* endTag ); - virtual XMLNode* ShallowClone( XMLDocument* document ) const; - virtual bool ShallowEqual( const XMLNode* compare ) const; - -protected: - XMLComment( XMLDocument* doc ); - virtual ~XMLComment(); - XMLComment( const XMLComment& ); // not supported - XMLComment& operator=( const XMLComment& ); // not supported - -private: -}; - - -/** In correct XML the declaration is the first entry in the file. - @verbatim - - @endverbatim - - TinyXML2 will happily read or write files without a declaration, - however. - - The text of the declaration isn't interpreted. It is parsed - and written as a string. -*/ -class CC_DLL XMLDeclaration : public XMLNode -{ - friend class XMLDocument; -public: - virtual XMLDeclaration* ToDeclaration() { - return this; - } - virtual const XMLDeclaration* ToDeclaration() const { - return this; - } - - virtual bool Accept( XMLVisitor* visitor ) const; - - char* ParseDeep( char*, StrPair* endTag ); - virtual XMLNode* ShallowClone( XMLDocument* document ) const; - virtual bool ShallowEqual( const XMLNode* compare ) const; - -protected: - XMLDeclaration( XMLDocument* doc ); - virtual ~XMLDeclaration(); - XMLDeclaration( const XMLDeclaration& ); // not supported - XMLDeclaration& operator=( const XMLDeclaration& ); // not supported -}; - - -/** Any tag that tinyXml doesn't recognize is saved as an - unknown. It is a tag of text, but should not be modified. - It will be written back to the XML, unchanged, when the file - is saved. - - DTD tags get thrown into TiXmlUnknowns. -*/ -class CC_DLL XMLUnknown : public XMLNode -{ - friend class XMLDocument; -public: - virtual XMLUnknown* ToUnknown() { - return this; - } - virtual const XMLUnknown* ToUnknown() const { - return this; - } - - virtual bool Accept( XMLVisitor* visitor ) const; - - char* ParseDeep( char*, StrPair* endTag ); - virtual XMLNode* ShallowClone( XMLDocument* document ) const; - virtual bool ShallowEqual( const XMLNode* compare ) const; - -protected: - XMLUnknown( XMLDocument* doc ); - virtual ~XMLUnknown(); - XMLUnknown( const XMLUnknown& ); // not supported - XMLUnknown& operator=( const XMLUnknown& ); // not supported -}; - - -enum XMLError { - XML_NO_ERROR = 0, - XML_SUCCESS = 0, - - XML_NO_ATTRIBUTE, - XML_WRONG_ATTRIBUTE_TYPE, - - XML_ERROR_FILE_NOT_FOUND, - XML_ERROR_FILE_COULD_NOT_BE_OPENED, - XML_ERROR_FILE_READ_ERROR, - XML_ERROR_ELEMENT_MISMATCH, - XML_ERROR_PARSING_ELEMENT, - XML_ERROR_PARSING_ATTRIBUTE, - XML_ERROR_IDENTIFYING_TAG, - XML_ERROR_PARSING_TEXT, - XML_ERROR_PARSING_CDATA, - XML_ERROR_PARSING_COMMENT, - XML_ERROR_PARSING_DECLARATION, - XML_ERROR_PARSING_UNKNOWN, - XML_ERROR_EMPTY_DOCUMENT, - XML_ERROR_MISMATCHED_ELEMENT, - XML_ERROR_PARSING, - - XML_CAN_NOT_CONVERT_TEXT, - XML_NO_TEXT_NODE -}; - - -/** An attribute is a name-value pair. Elements have an arbitrary - number of attributes, each with a unique name. - - @note The attributes are not XMLNodes. You may only query the - Next() attribute in a list. -*/ -class CC_DLL XMLAttribute -{ - friend class XMLElement; -public: - /// The name of the attribute. - const char* Name() const { - return _name.GetStr(); - } - /// The value of the attribute. - const char* Value() const { - return _value.GetStr(); - } - /// The next attribute in the list. - const XMLAttribute* Next() const { - return _next; - } - - /** IntAttribute interprets the attribute as an integer, and returns the value. - If the value isn't an integer, 0 will be returned. There is no error checking; - use QueryIntAttribute() if you need error checking. - */ - int IntValue() const { - int i=0; - QueryIntValue( &i ); - return i; - } - /// Query as an unsigned integer. See IntAttribute() - unsigned UnsignedValue() const { - unsigned i=0; - QueryUnsignedValue( &i ); - return i; - } - /// Query as a boolean. See IntAttribute() - bool BoolValue() const { - bool b=false; - QueryBoolValue( &b ); - return b; - } - /// Query as a double. See IntAttribute() - double DoubleValue() const { - double d=0; - QueryDoubleValue( &d ); - return d; - } - /// Query as a float. See IntAttribute() - float FloatValue() const { - float f=0; - QueryFloatValue( &f ); - return f; - } - - /** QueryIntAttribute interprets the attribute as an integer, and returns the value - in the provided paremeter. The function will return XML_NO_ERROR on success, - and XML_WRONG_ATTRIBUTE_TYPE if the conversion is not successful. - */ - XMLError QueryIntValue( int* value ) const; - /// See QueryIntAttribute - XMLError QueryUnsignedValue( unsigned int* value ) const; - /// See QueryIntAttribute - XMLError QueryBoolValue( bool* value ) const; - /// See QueryIntAttribute - XMLError QueryDoubleValue( double* value ) const; - /// See QueryIntAttribute - XMLError QueryFloatValue( float* value ) const; - - /// Set the attribute to a string value. - void SetAttribute( const char* value ); - /// Set the attribute to value. - void SetAttribute( int value ); - /// Set the attribute to value. - void SetAttribute( unsigned value ); - /// Set the attribute to value. - void SetAttribute( bool value ); - /// Set the attribute to value. - void SetAttribute( double value ); - /// Set the attribute to value. - void SetAttribute( float value ); - -private: - enum { BUF_SIZE = 200 }; - - XMLAttribute() : _next( 0 ) {} - virtual ~XMLAttribute() {} - - XMLAttribute( const XMLAttribute& ); // not supported - void operator=( const XMLAttribute& ); // not supported - void SetName( const char* name ); - - char* ParseDeep( char* p, bool processEntities ); - - mutable StrPair _name; - mutable StrPair _value; - XMLAttribute* _next; - MemPool* _memPool; -}; - - -/** The element is a container class. It has a value, the element name, - and can contain other elements, text, comments, and unknowns. - Elements also contain an arbitrary number of attributes. -*/ -class CC_DLL XMLElement : public XMLNode -{ - friend class XMLBase; - friend class XMLDocument; -public: - /// Get the name of an element (which is the Value() of the node.) - const char* Name() const { - return Value(); - } - /// Set the name of the element. - void SetName( const char* str, bool staticMem=false ) { - SetValue( str, staticMem ); - } - - virtual XMLElement* ToElement() { - return this; - } - virtual const XMLElement* ToElement() const { - return this; - } - virtual bool Accept( XMLVisitor* visitor ) const; - - /** Given an attribute name, Attribute() returns the value - for the attribute of that name, or null if none - exists. For example: - - @verbatim - const char* value = ele->Attribute( "foo" ); - @endverbatim - - The 'value' parameter is normally null. However, if specified, - the attribute will only be returned if the 'name' and 'value' - match. This allow you to write code: - - @verbatim - if ( ele->Attribute( "foo", "bar" ) ) callFooIsBar(); - @endverbatim - - rather than: - @verbatim - if ( ele->Attribute( "foo" ) ) { - if ( strcmp( ele->Attribute( "foo" ), "bar" ) == 0 ) callFooIsBar(); - } - @endverbatim - */ - const char* Attribute( const char* name, const char* value=0 ) const; - - /** Given an attribute name, IntAttribute() returns the value - of the attribute interpreted as an integer. 0 will be - returned if there is an error. For a method with error - checking, see QueryIntAttribute() - */ - int IntAttribute( const char* name ) const { - int i=0; - QueryIntAttribute( name, &i ); - return i; - } - /// See IntAttribute() - unsigned UnsignedAttribute( const char* name ) const { - unsigned i=0; - QueryUnsignedAttribute( name, &i ); - return i; - } - /// See IntAttribute() - bool BoolAttribute( const char* name ) const { - bool b=false; - QueryBoolAttribute( name, &b ); - return b; - } - /// See IntAttribute() - double DoubleAttribute( const char* name ) const { - double d=0; - QueryDoubleAttribute( name, &d ); - return d; - } - /// See IntAttribute() - float FloatAttribute( const char* name ) const { - float f=0; - QueryFloatAttribute( name, &f ); - return f; - } - - /** Given an attribute name, QueryIntAttribute() returns - XML_NO_ERROR, XML_WRONG_ATTRIBUTE_TYPE if the conversion - can't be performed, or XML_NO_ATTRIBUTE if the attribute - doesn't exist. If successful, the result of the conversion - will be written to 'value'. If not successful, nothing will - be written to 'value'. This allows you to provide default - value: - - @verbatim - int value = 10; - QueryIntAttribute( "foo", &value ); // if "foo" isn't found, value will still be 10 - @endverbatim - */ - XMLError QueryIntAttribute( const char* name, int* value ) const { - const XMLAttribute* a = FindAttribute( name ); - if ( !a ) { - return XML_NO_ATTRIBUTE; - } - return a->QueryIntValue( value ); - } - /// See QueryIntAttribute() - XMLError QueryUnsignedAttribute( const char* name, unsigned int* value ) const { - const XMLAttribute* a = FindAttribute( name ); - if ( !a ) { - return XML_NO_ATTRIBUTE; - } - return a->QueryUnsignedValue( value ); - } - /// See QueryIntAttribute() - XMLError QueryBoolAttribute( const char* name, bool* value ) const { - const XMLAttribute* a = FindAttribute( name ); - if ( !a ) { - return XML_NO_ATTRIBUTE; - } - return a->QueryBoolValue( value ); - } - /// See QueryIntAttribute() - XMLError QueryDoubleAttribute( const char* name, double* value ) const { - const XMLAttribute* a = FindAttribute( name ); - if ( !a ) { - return XML_NO_ATTRIBUTE; - } - return a->QueryDoubleValue( value ); - } - /// See QueryIntAttribute() - XMLError QueryFloatAttribute( const char* name, float* value ) const { - const XMLAttribute* a = FindAttribute( name ); - if ( !a ) { - return XML_NO_ATTRIBUTE; - } - return a->QueryFloatValue( value ); - } - - /// Sets the named attribute to value. - void SetAttribute( const char* name, const char* value ) { - XMLAttribute* a = FindOrCreateAttribute( name ); - a->SetAttribute( value ); - } - /// Sets the named attribute to value. - void SetAttribute( const char* name, int value ) { - XMLAttribute* a = FindOrCreateAttribute( name ); - a->SetAttribute( value ); - } - /// Sets the named attribute to value. - void SetAttribute( const char* name, unsigned value ) { - XMLAttribute* a = FindOrCreateAttribute( name ); - a->SetAttribute( value ); - } - /// Sets the named attribute to value. - void SetAttribute( const char* name, bool value ) { - XMLAttribute* a = FindOrCreateAttribute( name ); - a->SetAttribute( value ); - } - /// Sets the named attribute to value. - void SetAttribute( const char* name, double value ) { - XMLAttribute* a = FindOrCreateAttribute( name ); - a->SetAttribute( value ); - } - - /** - Delete an attribute. - */ - void DeleteAttribute( const char* name ); - - /// Return the first attribute in the list. - const XMLAttribute* FirstAttribute() const { - return _rootAttribute; - } - /// Query a specific attribute in the list. - const XMLAttribute* FindAttribute( const char* name ) const; - - /** Convenience function for easy access to the text inside an element. Although easy - and concise, GetText() is limited compared to getting the TiXmlText child - and accessing it directly. - - If the first child of 'this' is a TiXmlText, the GetText() - returns the character string of the Text node, else null is returned. - - This is a convenient method for getting the text of simple contained text: - @verbatim - This is text - const char* str = fooElement->GetText(); - @endverbatim - - 'str' will be a pointer to "This is text". - - Note that this function can be misleading. If the element foo was created from - this XML: - @verbatim - This is text - @endverbatim - - then the value of str would be null. The first child node isn't a text node, it is - another element. From this XML: - @verbatim - This is text - @endverbatim - GetText() will return "This is ". - */ - const char* GetText() const; - - /** - Convenience method to query the value of a child text node. This is probably best - shown by example. Given you have a document is this form: - @verbatim - - 1 - 1.4 - - @endverbatim - - The QueryIntText() and similar functions provide a safe and easier way to get to the - "value" of x and y. - - @verbatim - int x = 0; - float y = 0; // types of x and y are contrived for example - const XMLElement* xElement = pointElement->FirstChildElement( "x" ); - const XMLElement* yElement = pointElement->FirstChildElement( "y" ); - xElement->QueryIntText( &x ); - yElement->QueryFloatText( &y ); - @endverbatim - - @returns XML_SUCCESS (0) on success, XML_CAN_NOT_CONVERT_TEXT if the text cannot be converted - to the requested type, and XML_NO_TEXT_NODE if there is no child text to query. - - */ - XMLError QueryIntText( int* ival ) const; - /// See QueryIntText() - XMLError QueryUnsignedText( unsigned* uval ) const; - /// See QueryIntText() - XMLError QueryBoolText( bool* bval ) const; - /// See QueryIntText() - XMLError QueryDoubleText( double* dval ) const; - /// See QueryIntText() - XMLError QueryFloatText( float* fval ) const; - - // internal: - enum { - OPEN, // - CLOSED, // - CLOSING // - }; - int ClosingType() const { - return _closingType; - } - char* ParseDeep( char* p, StrPair* endTag ); - virtual XMLNode* ShallowClone( XMLDocument* document ) const; - virtual bool ShallowEqual( const XMLNode* compare ) const; - -private: - XMLElement( XMLDocument* doc ); - virtual ~XMLElement(); - XMLElement( const XMLElement& ); // not supported - void operator=( const XMLElement& ); // not supported - - XMLAttribute* FindAttribute( const char* name ); - XMLAttribute* FindOrCreateAttribute( const char* name ); - //void LinkAttribute( XMLAttribute* attrib ); - char* ParseAttributes( char* p ); - - int _closingType; - // The attribute list is ordered; there is no 'lastAttribute' - // because the list needs to be scanned for dupes before adding - // a new attribute. - XMLAttribute* _rootAttribute; -}; - - -enum Whitespace { - PRESERVE_WHITESPACE, - COLLAPSE_WHITESPACE -}; - - -/** A Document binds together all the functionality. - It can be saved, loaded, and printed to the screen. - All Nodes are connected and allocated to a Document. - If the Document is deleted, all its Nodes are also deleted. -*/ -class CC_DLL XMLDocument : public XMLNode -{ - friend class XMLElement; -public: - /// constructor - XMLDocument( bool processEntities = true, Whitespace = PRESERVE_WHITESPACE ); - ~XMLDocument(); - - virtual XMLDocument* ToDocument() { - return this; - } - virtual const XMLDocument* ToDocument() const { - return this; - } - - /** - Parse an XML file from a character string. - Returns XML_NO_ERROR (0) on success, or - an errorID. - - You may optionally pass in the 'nBytes', which is - the number of bytes which will be parsed. If not - specified, TinyXML will assume 'xml' points to a - null terminated string. - */ - XMLError Parse( const char* xml, size_t nBytes=(size_t)(-1) ); - - /** - Load an XML file from disk. - Returns XML_NO_ERROR (0) on success, or - an errorID. - */ - XMLError LoadFile( const char* filename ); - - /** - Load an XML file from disk. You are responsible - for providing and closing the FILE*. - - Returns XML_NO_ERROR (0) on success, or - an errorID. - */ - XMLError LoadFile( FILE* ); - - /** - Save the XML file to disk. - Returns XML_NO_ERROR (0) on success, or - an errorID. - */ - XMLError SaveFile( const char* filename, bool compact = false ); - - /** - Save the XML file to disk. You are responsible - for providing and closing the FILE*. - - Returns XML_NO_ERROR (0) on success, or - an errorID. - */ - XMLError SaveFile( FILE* fp, bool compact = false ); - - bool ProcessEntities() const { - return _processEntities; - } - Whitespace WhitespaceMode() const { - return _whitespace; - } - - /** - Returns true if this document has a leading Byte Order Mark of UTF8. - */ - bool HasBOM() const { - return _writeBOM; - } - /** Sets whether to write the BOM when writing the file. - */ - void SetBOM( bool useBOM ) { - _writeBOM = useBOM; - } - - /** Return the root element of DOM. Equivalent to FirstChildElement(). - To get the first node, use FirstChild(). - */ - XMLElement* RootElement() { - return FirstChildElement(); - } - const XMLElement* RootElement() const { - return FirstChildElement(); - } - - /** Print the Document. If the Printer is not provided, it will - print to stdout. If you provide Printer, this can print to a file: - @verbatim - XMLPrinter printer( fp ); - doc.Print( &printer ); - @endverbatim - - Or you can use a printer to print to memory: - @verbatim - XMLPrinter printer; - doc->Print( &printer ); - // printer.CStr() has a const char* to the XML - @endverbatim - */ - void Print( XMLPrinter* streamer=0 ); - virtual bool Accept( XMLVisitor* visitor ) const; - - /** - Create a new Element associated with - this Document. The memory for the Element - is managed by the Document. - */ - XMLElement* NewElement( const char* name ); - /** - Create a new Comment associated with - this Document. The memory for the Comment - is managed by the Document. - */ - XMLComment* NewComment( const char* comment ); - /** - Create a new Text associated with - this Document. The memory for the Text - is managed by the Document. - */ - XMLText* NewText( const char* text ); - /** - Create a new Declaration associated with - this Document. The memory for the object - is managed by the Document. - - If the 'text' param is null, the standard - declaration is used.: - @verbatim - - @endverbatim - */ - XMLDeclaration* NewDeclaration( const char* text=0 ); - /** - Create a new Unknown associated with - this Document. The memory forthe object - is managed by the Document. - */ - XMLUnknown* NewUnknown( const char* text ); - - /** - Delete a node associated with this document. - It will be unlinked from the DOM. - */ - void DeleteNode( XMLNode* node ) { - node->_parent->DeleteChild( node ); - } - - void SetError( XMLError error, const char* str1, const char* str2 ); - - /// Return true if there was an error parsing the document. - bool Error() const { - return _errorID != XML_NO_ERROR; - } - /// Return the errorID. - XMLError ErrorID() const { - return _errorID; - } - /// Return a possibly helpful diagnostic location or string. - const char* GetErrorStr1() const { - return _errorStr1; - } - /// Return a possibly helpful secondary diagnostic location or string. - const char* GetErrorStr2() const { - return _errorStr2; - } - /// If there is an error, print it to stdout. - void PrintError() const; - - // internal - char* Identify( char* p, XMLNode** node ); - - virtual XMLNode* ShallowClone( XMLDocument* /*document*/ ) const { - return 0; - } - virtual bool ShallowEqual( const XMLNode* /*compare*/ ) const { - return false; - } - -private: - XMLDocument( const XMLDocument& ); // not supported - void operator=( const XMLDocument& ); // not supported - void InitDocument(); - - bool _writeBOM; - bool _processEntities; - XMLError _errorID; - Whitespace _whitespace; - const char* _errorStr1; - const char* _errorStr2; - char* _charBuffer; - - MemPoolT< sizeof(XMLElement) > _elementPool; - MemPoolT< sizeof(XMLAttribute) > _attributePool; - MemPoolT< sizeof(XMLText) > _textPool; - MemPoolT< sizeof(XMLComment) > _commentPool; -}; - - -/** - A XMLHandle is a class that wraps a node pointer with null checks; this is - an incredibly useful thing. Note that XMLHandle is not part of the TinyXML - DOM structure. It is a separate utility class. - - Take an example: - @verbatim - - - - - - - @endverbatim - - Assuming you want the value of "attributeB" in the 2nd "Child" element, it's very - easy to write a *lot* of code that looks like: - - @verbatim - XMLElement* root = document.FirstChildElement( "Document" ); - if ( root ) - { - XMLElement* element = root->FirstChildElement( "Element" ); - if ( element ) - { - XMLElement* child = element->FirstChildElement( "Child" ); - if ( child ) - { - XMLElement* child2 = child->NextSiblingElement( "Child" ); - if ( child2 ) - { - // Finally do something useful. - @endverbatim - - And that doesn't even cover "else" cases. XMLHandle addresses the verbosity - of such code. A XMLHandle checks for null pointers so it is perfectly safe - and correct to use: - - @verbatim - XMLHandle docHandle( &document ); - XMLElement* child2 = docHandle.FirstChild( "Document" ).FirstChild( "Element" ).FirstChild().NextSibling().ToElement(); - if ( child2 ) - { - // do something useful - @endverbatim - - Which is MUCH more concise and useful. - - It is also safe to copy handles - internally they are nothing more than node pointers. - @verbatim - XMLHandle handleCopy = handle; - @endverbatim - - See also XMLConstHandle, which is the same as XMLHandle, but operates on const objects. -*/ -class CC_DLL XMLHandle -{ -public: - /// Create a handle from any node (at any depth of the tree.) This can be a null pointer. - XMLHandle( XMLNode* node ) { - _node = node; - } - /// Create a handle from a node. - XMLHandle( XMLNode& node ) { - _node = &node; - } - /// Copy constructor - XMLHandle( const XMLHandle& ref ) { - _node = ref._node; - } - /// Assignment - XMLHandle& operator=( const XMLHandle& ref ) { - _node = ref._node; - return *this; - } - - /// Get the first child of this handle. - XMLHandle FirstChild() { - return XMLHandle( _node ? _node->FirstChild() : 0 ); - } - /// Get the first child element of this handle. - XMLHandle FirstChildElement( const char* value=0 ) { - return XMLHandle( _node ? _node->FirstChildElement( value ) : 0 ); - } - /// Get the last child of this handle. - XMLHandle LastChild() { - return XMLHandle( _node ? _node->LastChild() : 0 ); - } - /// Get the last child element of this handle. - XMLHandle LastChildElement( const char* _value=0 ) { - return XMLHandle( _node ? _node->LastChildElement( _value ) : 0 ); - } - /// Get the previous sibling of this handle. - XMLHandle PreviousSibling() { - return XMLHandle( _node ? _node->PreviousSibling() : 0 ); - } - /// Get the previous sibling element of this handle. - XMLHandle PreviousSiblingElement( const char* _value=0 ) { - return XMLHandle( _node ? _node->PreviousSiblingElement( _value ) : 0 ); - } - /// Get the next sibling of this handle. - XMLHandle NextSibling() { - return XMLHandle( _node ? _node->NextSibling() : 0 ); - } - /// Get the next sibling element of this handle. - XMLHandle NextSiblingElement( const char* _value=0 ) { - return XMLHandle( _node ? _node->NextSiblingElement( _value ) : 0 ); - } - - /// Safe cast to XMLNode. This can return null. - XMLNode* ToNode() { - return _node; - } - /// Safe cast to XMLElement. This can return null. - XMLElement* ToElement() { - return ( ( _node && _node->ToElement() ) ? _node->ToElement() : 0 ); - } - /// Safe cast to XMLText. This can return null. - XMLText* ToText() { - return ( ( _node && _node->ToText() ) ? _node->ToText() : 0 ); - } - /// Safe cast to XMLUnknown. This can return null. - XMLUnknown* ToUnknown() { - return ( ( _node && _node->ToUnknown() ) ? _node->ToUnknown() : 0 ); - } - /// Safe cast to XMLDeclaration. This can return null. - XMLDeclaration* ToDeclaration() { - return ( ( _node && _node->ToDeclaration() ) ? _node->ToDeclaration() : 0 ); - } - -private: - XMLNode* _node; -}; - - -/** - A variant of the XMLHandle class for working with const XMLNodes and Documents. It is the - same in all regards, except for the 'const' qualifiers. See XMLHandle for API. -*/ -class CC_DLL XMLConstHandle -{ -public: - XMLConstHandle( const XMLNode* node ) { - _node = node; - } - XMLConstHandle( const XMLNode& node ) { - _node = &node; - } - XMLConstHandle( const XMLConstHandle& ref ) { - _node = ref._node; - } - - XMLConstHandle& operator=( const XMLConstHandle& ref ) { - _node = ref._node; - return *this; - } - - const XMLConstHandle FirstChild() const { - return XMLConstHandle( _node ? _node->FirstChild() : 0 ); - } - const XMLConstHandle FirstChildElement( const char* value=0 ) const { - return XMLConstHandle( _node ? _node->FirstChildElement( value ) : 0 ); - } - const XMLConstHandle LastChild() const { - return XMLConstHandle( _node ? _node->LastChild() : 0 ); - } - const XMLConstHandle LastChildElement( const char* _value=0 ) const { - return XMLConstHandle( _node ? _node->LastChildElement( _value ) : 0 ); - } - const XMLConstHandle PreviousSibling() const { - return XMLConstHandle( _node ? _node->PreviousSibling() : 0 ); - } - const XMLConstHandle PreviousSiblingElement( const char* _value=0 ) const { - return XMLConstHandle( _node ? _node->PreviousSiblingElement( _value ) : 0 ); - } - const XMLConstHandle NextSibling() const { - return XMLConstHandle( _node ? _node->NextSibling() : 0 ); - } - const XMLConstHandle NextSiblingElement( const char* _value=0 ) const { - return XMLConstHandle( _node ? _node->NextSiblingElement( _value ) : 0 ); - } - - - const XMLNode* ToNode() const { - return _node; - } - const XMLElement* ToElement() const { - return ( ( _node && _node->ToElement() ) ? _node->ToElement() : 0 ); - } - const XMLText* ToText() const { - return ( ( _node && _node->ToText() ) ? _node->ToText() : 0 ); - } - const XMLUnknown* ToUnknown() const { - return ( ( _node && _node->ToUnknown() ) ? _node->ToUnknown() : 0 ); - } - const XMLDeclaration* ToDeclaration() const { - return ( ( _node && _node->ToDeclaration() ) ? _node->ToDeclaration() : 0 ); - } - -private: - const XMLNode* _node; -}; - - -/** - Printing functionality. The XMLPrinter gives you more - options than the XMLDocument::Print() method. - - It can: - -# Print to memory. - -# Print to a file you provide. - -# Print XML without a XMLDocument. - - Print to Memory - - @verbatim - XMLPrinter printer; - doc->Print( &printer ); - SomeFunction( printer.CStr() ); - @endverbatim - - Print to a File - - You provide the file pointer. - @verbatim - XMLPrinter printer( fp ); - doc.Print( &printer ); - @endverbatim - - Print without a XMLDocument - - When loading, an XML parser is very useful. However, sometimes - when saving, it just gets in the way. The code is often set up - for streaming, and constructing the DOM is just overhead. - - The Printer supports the streaming case. The following code - prints out a trivially simple XML file without ever creating - an XML document. - - @verbatim - XMLPrinter printer( fp ); - printer.OpenElement( "foo" ); - printer.PushAttribute( "foo", "bar" ); - printer.CloseElement(); - @endverbatim -*/ -class CC_DLL XMLPrinter : public XMLVisitor -{ -public: - /** Construct the printer. If the FILE* is specified, - this will print to the FILE. Else it will print - to memory, and the result is available in CStr(). - If 'compact' is set to true, then output is created - with only required whitespace and newlines. - */ - XMLPrinter( FILE* file=0, bool compact = false ); - ~XMLPrinter() {} - - /** If streaming, write the BOM and declaration. */ - void PushHeader( bool writeBOM, bool writeDeclaration ); - /** If streaming, start writing an element. - The element must be closed with CloseElement() - */ - void OpenElement( const char* name ); - /// If streaming, add an attribute to an open element. - void PushAttribute( const char* name, const char* value ); - void PushAttribute( const char* name, int value ); - void PushAttribute( const char* name, unsigned value ); - void PushAttribute( const char* name, bool value ); - void PushAttribute( const char* name, double value ); - /// If streaming, close the Element. - void CloseElement(); - - /// Add a text node. - void PushText( const char* text, bool cdata=false ); - /// Add a text node from an integer. - void PushText( int value ); - /// Add a text node from an unsigned. - void PushText( unsigned value ); - /// Add a text node from a bool. - void PushText( bool value ); - /// Add a text node from a float. - void PushText( float value ); - /// Add a text node from a double. - void PushText( double value ); - - /// Add a comment - void PushComment( const char* comment ); - - void PushDeclaration( const char* value ); - void PushUnknown( const char* value ); - - virtual bool VisitEnter( const XMLDocument& /*doc*/ ); - virtual bool VisitExit( const XMLDocument& /*doc*/ ) { - return true; - } - - virtual bool VisitEnter( const XMLElement& element, const XMLAttribute* attribute ); - virtual bool VisitExit( const XMLElement& element ); - - virtual bool Visit( const XMLText& text ); - virtual bool Visit( const XMLComment& comment ); - virtual bool Visit( const XMLDeclaration& declaration ); - virtual bool Visit( const XMLUnknown& unknown ); - - /** - If in print to memory mode, return a pointer to - the XML file in memory. - */ - const char* CStr() const { - return _buffer.Mem(); - } - /** - If in print to memory mode, return the size - of the XML file in memory. (Note the size returned - includes the terminating null.) - */ - int CStrSize() const { - return _buffer.Size(); - } - -private: - void SealElement(); - void PrintSpace( int depth ); - void PrintString( const char*, bool restrictedEntitySet ); // prints out, after detecting entities. - void Print( const char* format, ... ); - - bool _elementJustOpened; - bool _firstElement; - FILE* _fp; - int _depth; - int _textDepth; - bool _processEntities; - bool _compactMode; - - enum { - ENTITY_RANGE = 64, - BUF_SIZE = 200 - }; - bool _entityFlag[ENTITY_RANGE]; - bool _restrictedEntityFlag[ENTITY_RANGE]; - - DynArray< const char*, 10 > _stack; - DynArray< char, 20 > _buffer; -#ifdef _MSC_VER - DynArray< char, 20 > _accumulator; -#endif -}; - - -} // tinyxml2 - - -#endif // TINYXML2_INCLUDED diff --git a/cocos/2d/support/zip_support/ioapi.cpp b/cocos/2d/support/zip_support/ioapi.cpp deleted file mode 100644 index 669ea36927..0000000000 --- a/cocos/2d/support/zip_support/ioapi.cpp +++ /dev/null @@ -1,245 +0,0 @@ -/* ioapi.h -- IO base function header for compress/uncompress .zip - part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) - - Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) - - Modifications for Zip64 support - Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) - - For more info read MiniZip_info.txt - -*/ - -#include "ioapi.h" - -namespace cocos2d { - -voidpf call_zopen64 (const zlib_filefunc64_32_def* pfilefunc,const void*filename,int mode) -{ - if (pfilefunc->zfile_func64.zopen64_file != NULL) - return (*(pfilefunc->zfile_func64.zopen64_file)) (pfilefunc->zfile_func64.opaque,filename,mode); - else - { - return (*(pfilefunc->zopen32_file))(pfilefunc->zfile_func64.opaque,(const char*)filename,mode); - } -} - -long call_zseek64 (const zlib_filefunc64_32_def* pfilefunc,voidpf filestream, ZPOS64_T offset, int origin) -{ - if (pfilefunc->zfile_func64.zseek64_file != NULL) - return (*(pfilefunc->zfile_func64.zseek64_file)) (pfilefunc->zfile_func64.opaque,filestream,offset,origin); - else - { - uLong offsetTruncated = (uLong)offset; - if (offsetTruncated != offset) - return -1; - else - return (*(pfilefunc->zseek32_file))(pfilefunc->zfile_func64.opaque,filestream,offsetTruncated,origin); - } -} - -ZPOS64_T call_ztell64 (const zlib_filefunc64_32_def* pfilefunc,voidpf filestream) -{ - if (pfilefunc->zfile_func64.zseek64_file != NULL) - return (*(pfilefunc->zfile_func64.ztell64_file)) (pfilefunc->zfile_func64.opaque,filestream); - else - { - uLong tell_uLong = (*(pfilefunc->ztell32_file))(pfilefunc->zfile_func64.opaque,filestream); - if ((tell_uLong) == ((uLong)-1)) - return (ZPOS64_T)-1; - else - return tell_uLong; - } -} - -void fill_zlib_filefunc64_32_def_from_filefunc32(zlib_filefunc64_32_def* p_filefunc64_32,const zlib_filefunc_def* p_filefunc32) -{ - p_filefunc64_32->zfile_func64.zopen64_file = NULL; - p_filefunc64_32->zopen32_file = p_filefunc32->zopen_file; - p_filefunc64_32->zfile_func64.zerror_file = p_filefunc32->zerror_file; - p_filefunc64_32->zfile_func64.zread_file = p_filefunc32->zread_file; - p_filefunc64_32->zfile_func64.zwrite_file = p_filefunc32->zwrite_file; - p_filefunc64_32->zfile_func64.ztell64_file = NULL; - p_filefunc64_32->zfile_func64.zseek64_file = NULL; - p_filefunc64_32->zfile_func64.zclose_file = p_filefunc32->zclose_file; - p_filefunc64_32->zfile_func64.zerror_file = p_filefunc32->zerror_file; - p_filefunc64_32->zfile_func64.opaque = p_filefunc32->opaque; - p_filefunc64_32->zseek32_file = p_filefunc32->zseek_file; - p_filefunc64_32->ztell32_file = p_filefunc32->ztell_file; -} - - - -static voidpf ZCALLBACK fopen_file_func OF((voidpf opaque, const char* filename, int mode)); -static uLong ZCALLBACK fread_file_func OF((voidpf opaque, voidpf stream, void* buf, uLong size)); -static uLong ZCALLBACK fwrite_file_func OF((voidpf opaque, voidpf stream, const void* buf,uLong size)); -static ZPOS64_T ZCALLBACK ftell64_file_func OF((voidpf opaque, voidpf stream)); -static long ZCALLBACK fseek64_file_func OF((voidpf opaque, voidpf stream, ZPOS64_T offset, int origin)); -static int ZCALLBACK fclose_file_func OF((voidpf opaque, voidpf stream)); -static int ZCALLBACK ferror_file_func OF((voidpf opaque, voidpf stream)); - -static voidpf ZCALLBACK fopen_file_func (voidpf opaque, const char* filename, int mode) -{ - FILE* file = NULL; - const char* mode_fopen = NULL; - if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ) - mode_fopen = "rb"; - else - if (mode & ZLIB_FILEFUNC_MODE_EXISTING) - mode_fopen = "r+b"; - else - if (mode & ZLIB_FILEFUNC_MODE_CREATE) - mode_fopen = "wb"; - - if ((filename!=NULL) && (mode_fopen != NULL)) - file = fopen(filename, mode_fopen); - return file; -} - -static voidpf ZCALLBACK fopen64_file_func (voidpf opaque, const void* filename, int mode) -{ - FILE* file = NULL; - const char* mode_fopen = NULL; - if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ) - mode_fopen = "rb"; - else - if (mode & ZLIB_FILEFUNC_MODE_EXISTING) - mode_fopen = "r+b"; - else - if (mode & ZLIB_FILEFUNC_MODE_CREATE) - mode_fopen = "wb"; - - if ((filename!=NULL) && (mode_fopen != NULL)) - { -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MARMALADE || CC_TARGET_PLATFORM == CC_PLATFORM_BADA || CC_TARGET_PLATFORM == CC_PLATFORM_BLACKBERRY || CC_TARGET_PLATFORM == CC_PLATFORM_NACL || CC_TARGET_PLATFORM == CC_PLATFORM_EMSCRIPTEN) - file = NULL; -#else - file = fopen64((const char*)filename, mode_fopen); -#endif - } - - return file; -} - - -static uLong ZCALLBACK fread_file_func (voidpf opaque, voidpf stream, void* buf, uLong size) -{ - uLong ret; - ret = (uLong)fread(buf, 1, (size_t)size, (FILE *)stream); - return ret; -} - -static uLong ZCALLBACK fwrite_file_func (voidpf opaque, voidpf stream, const void* buf, uLong size) -{ - uLong ret; - ret = (uLong)fwrite(buf, 1, (size_t)size, (FILE *)stream); - return ret; -} - -static long ZCALLBACK ftell_file_func (voidpf opaque, voidpf stream) -{ - long ret; - ret = ftell((FILE *)stream); - return ret; -} - - -static ZPOS64_T ZCALLBACK ftell64_file_func (voidpf opaque, voidpf stream) -{ - ZPOS64_T ret; -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MARMALADE || CC_TARGET_PLATFORM == CC_PLATFORM_BADA || CC_TARGET_PLATFORM == CC_PLATFORM_BLACKBERRY || CC_TARGET_PLATFORM == CC_PLATFORM_NACL || CC_TARGET_PLATFORM == CC_PLATFORM_EMSCRIPTEN) - ret = 0; -#else - ret = ftello64((FILE *)stream); -#endif - return ret; -} - -static long ZCALLBACK fseek_file_func (voidpf opaque, voidpf stream, uLong offset, int origin) -{ - int fseek_origin=0; - long ret; - switch (origin) - { - case ZLIB_FILEFUNC_SEEK_CUR : - fseek_origin = SEEK_CUR; - break; - case ZLIB_FILEFUNC_SEEK_END : - fseek_origin = SEEK_END; - break; - case ZLIB_FILEFUNC_SEEK_SET : - fseek_origin = SEEK_SET; - break; - default: return -1; - } - ret = 0; - if (fseek((FILE *)stream, offset, fseek_origin) != 0) - ret = -1; - return ret; -} - -static long ZCALLBACK fseek64_file_func (voidpf opaque, voidpf stream, ZPOS64_T offset, int origin) -{ -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MARMALADE || CC_TARGET_PLATFORM == CC_PLATFORM_BADA || CC_TARGET_PLATFORM == CC_PLATFORM_BLACKBERRY || CC_TARGET_PLATFORM == CC_PLATFORM_NACL || CC_TARGET_PLATFORM == CC_PLATFORM_EMSCRIPTEN) - return -1; -#else - int fseek_origin=0; - switch (origin) - { - case ZLIB_FILEFUNC_SEEK_CUR : - fseek_origin = SEEK_CUR; - break; - case ZLIB_FILEFUNC_SEEK_END : - fseek_origin = SEEK_END; - break; - case ZLIB_FILEFUNC_SEEK_SET : - fseek_origin = SEEK_SET; - break; - default: return -1; - } - if(fseeko64((FILE *)stream, offset, fseek_origin) != 0) - return -1; - return 0; -#endif -} - - -static int ZCALLBACK fclose_file_func (voidpf opaque, voidpf stream) -{ - int ret; - ret = fclose((FILE *)stream); - return ret; -} - -static int ZCALLBACK ferror_file_func (voidpf opaque, voidpf stream) -{ - int ret; - ret = ferror((FILE *)stream); - return ret; -} - -void fill_fopen_filefunc (zlib_filefunc_def* pzlib_filefunc_def) -{ - pzlib_filefunc_def->zopen_file = fopen_file_func; - pzlib_filefunc_def->zread_file = fread_file_func; - pzlib_filefunc_def->zwrite_file = fwrite_file_func; - pzlib_filefunc_def->ztell_file = ftell_file_func; - pzlib_filefunc_def->zseek_file = fseek_file_func; - pzlib_filefunc_def->zclose_file = fclose_file_func; - pzlib_filefunc_def->zerror_file = ferror_file_func; - pzlib_filefunc_def->opaque = NULL; -} - -void fill_fopen64_filefunc (zlib_filefunc64_def* pzlib_filefunc_def) -{ - pzlib_filefunc_def->zopen64_file = fopen64_file_func; - pzlib_filefunc_def->zread_file = fread_file_func; - pzlib_filefunc_def->zwrite_file = fwrite_file_func; - pzlib_filefunc_def->ztell64_file = ftell64_file_func; - pzlib_filefunc_def->zseek64_file = fseek64_file_func; - pzlib_filefunc_def->zclose_file = fclose_file_func; - pzlib_filefunc_def->zerror_file = ferror_file_func; - pzlib_filefunc_def->opaque = NULL; -} - -} // end of namespace cocos2d diff --git a/cocos/2d/support/zip_support/ioapi.h b/cocos/2d/support/zip_support/ioapi.h deleted file mode 100644 index 575f44ece4..0000000000 --- a/cocos/2d/support/zip_support/ioapi.h +++ /dev/null @@ -1,201 +0,0 @@ -/* ioapi.h -- IO base function header for compress/uncompress .zip - part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) - - Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) - - Modifications for Zip64 support - Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) - - For more info read MiniZip_info.txt - - Changes - - Oct-2009 - Defined ZPOS64_T to fpos_t on windows and u_int64_t on linux. (might need to find a better why for this) - Oct-2009 - Change to fseeko64, ftello64 and fopen64 so large files would work on linux. - More if/def section may be needed to support other platforms - Oct-2009 - Defined fxxxx64 calls to normal fopen/ftell/fseek so they would compile on windows. - (but you should use iowin32.c for windows instead) - -*/ - -#ifndef _ZLIBIOAPI64_H -#define _ZLIBIOAPI64_H - -#include "platform/CCPlatformConfig.h" - -#if (!defined(_WIN32)) && (!defined(WIN32)) - - // Linux needs this to support file operation on files larger then 4+GB - // But might need better if/def to select just the platforms that needs them. - - #ifndef __USE_FILE_OFFSET64 - #define __USE_FILE_OFFSET64 - #endif - #ifndef __USE_LARGEFILE64 - #define __USE_LARGEFILE64 - #endif - #ifndef _LARGEFILE64_SOURCE - #define _LARGEFILE64_SOURCE - #endif - #ifndef _FILE_OFFSET_BIT - #define _FILE_OFFSET_BIT 64 - #endif -#endif - -#include -#include -#include "zlib.h" - -namespace cocos2d { - -#ifndef OF -#define OF _Z_OF -#endif - -#if defined(USE_FILE32API) -#define fopen64 fopen -#define ftello64 ftell -#define fseeko64 fseek -#else -#ifdef _MSC_VER - #define fopen64 fopen - #if (_MSC_VER >= 1400) && (!(defined(NO_MSCVER_FILE64_FUNC))) - #define ftello64 _ftelli64 - #define fseeko64 _fseeki64 - #else // old MSC - #define ftello64 ftell - #define fseeko64 fseek - #endif -#endif -#endif - -/* -#ifndef ZPOS64_T - #ifdef _WIN32 - #define ZPOS64_T fpos_t - #else - #include - #define ZPOS64_T uint64_t - #endif -#endif -*/ - -#ifdef HAVE_MINIZIP64_CONF_H -#include "mz64conf.h" -#endif - -/* a type chosen by DEFINE */ -#ifdef HAVE_64BIT_INT_CUSTOM -typedef 64BIT_INT_CUSTOM_TYPE ZPOS64_T; -#else -#ifdef HAS_STDINT_H -#include "stdint.h" -typedef uint64_t ZPOS64_T; -#else - - -#if defined(_MSC_VER) || defined(__BORLANDC__) -typedef unsigned __int64 ZPOS64_T; -#else -typedef unsigned long long int ZPOS64_T; -#endif -#endif -#endif - - - -#define ZLIB_FILEFUNC_SEEK_CUR (1) -#define ZLIB_FILEFUNC_SEEK_END (2) -#define ZLIB_FILEFUNC_SEEK_SET (0) - -#define ZLIB_FILEFUNC_MODE_READ (1) -#define ZLIB_FILEFUNC_MODE_WRITE (2) -#define ZLIB_FILEFUNC_MODE_READWRITEFILTER (3) - -#define ZLIB_FILEFUNC_MODE_EXISTING (4) -#define ZLIB_FILEFUNC_MODE_CREATE (8) - - -#ifndef ZCALLBACK - #if (defined(WIN32) || defined(_WIN32) || defined (WINDOWS) || defined (_WINDOWS)) && defined(CALLBACK) && defined (USEWINDOWS_CALLBACK) - #define ZCALLBACK CALLBACK - #else - #define ZCALLBACK - #endif -#endif - - - - -typedef voidpf (ZCALLBACK *open_file_func) OF((voidpf opaque, const char* filename, int mode)); -typedef uLong (ZCALLBACK *read_file_func) OF((voidpf opaque, voidpf stream, void* buf, uLong size)); -typedef uLong (ZCALLBACK *write_file_func) OF((voidpf opaque, voidpf stream, const void* buf, uLong size)); -typedef int (ZCALLBACK *close_file_func) OF((voidpf opaque, voidpf stream)); -typedef int (ZCALLBACK *testerror_file_func) OF((voidpf opaque, voidpf stream)); - -typedef long (ZCALLBACK *tell_file_func) OF((voidpf opaque, voidpf stream)); -typedef long (ZCALLBACK *seek_file_func) OF((voidpf opaque, voidpf stream, uLong offset, int origin)); - - -/* here is the "old" 32 bits structure structure */ -typedef struct zlib_filefunc_def_s -{ - open_file_func zopen_file; - read_file_func zread_file; - write_file_func zwrite_file; - tell_file_func ztell_file; - seek_file_func zseek_file; - close_file_func zclose_file; - testerror_file_func zerror_file; - voidpf opaque; -} zlib_filefunc_def; - -typedef ZPOS64_T (ZCALLBACK *tell64_file_func) OF((voidpf opaque, voidpf stream)); -typedef long (ZCALLBACK *seek64_file_func) OF((voidpf opaque, voidpf stream, ZPOS64_T offset, int origin)); -typedef voidpf (ZCALLBACK *open64_file_func) OF((voidpf opaque, const void* filename, int mode)); - -typedef struct zlib_filefunc64_def_s -{ - open64_file_func zopen64_file; - read_file_func zread_file; - write_file_func zwrite_file; - tell64_file_func ztell64_file; - seek64_file_func zseek64_file; - close_file_func zclose_file; - testerror_file_func zerror_file; - voidpf opaque; -} zlib_filefunc64_def; - -void fill_fopen64_filefunc OF((zlib_filefunc64_def* pzlib_filefunc_def)); -void fill_fopen_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def)); - -/* now internal definition, only for zip.c and unzip.h */ -typedef struct zlib_filefunc64_32_def_s -{ - zlib_filefunc64_def zfile_func64; - open_file_func zopen32_file; - tell_file_func ztell32_file; - seek_file_func zseek32_file; -} zlib_filefunc64_32_def; - - -#define ZREAD64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zread_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size)) -#define ZWRITE64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zwrite_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size)) -//#define ZTELL64(filefunc,filestream) ((*((filefunc).ztell64_file)) ((filefunc).opaque,filestream)) -//#define ZSEEK64(filefunc,filestream,pos,mode) ((*((filefunc).zseek64_file)) ((filefunc).opaque,filestream,pos,mode)) -#define ZCLOSE64(filefunc,filestream) ((*((filefunc).zfile_func64.zclose_file)) ((filefunc).zfile_func64.opaque,filestream)) -#define ZERROR64(filefunc,filestream) ((*((filefunc).zfile_func64.zerror_file)) ((filefunc).zfile_func64.opaque,filestream)) - -voidpf call_zopen64 OF((const zlib_filefunc64_32_def* pfilefunc,const void*filename,int mode)); -long call_zseek64 OF((const zlib_filefunc64_32_def* pfilefunc,voidpf filestream, ZPOS64_T offset, int origin)); -ZPOS64_T call_ztell64 OF((const zlib_filefunc64_32_def* pfilefunc,voidpf filestream)); - -void fill_zlib_filefunc64_32_def_from_filefunc32(zlib_filefunc64_32_def* p_filefunc64_32,const zlib_filefunc_def* p_filefunc32); - -#define ZOPEN64(filefunc,filename,mode) (call_zopen64((&(filefunc)),(filename),(mode))) -#define ZTELL64(filefunc,filestream) (call_ztell64((&(filefunc)),(filestream))) -#define ZSEEK64(filefunc,filestream,pos,mode) (call_zseek64((&(filefunc)),(filestream),(pos),(mode))) - -} // end of namespace cocos2d - -#endif diff --git a/cocos/2d/support/zip_support/unzip.cpp b/cocos/2d/support/zip_support/unzip.cpp deleted file mode 100644 index 66cfeff16a..0000000000 --- a/cocos/2d/support/zip_support/unzip.cpp +++ /dev/null @@ -1,2161 +0,0 @@ -/* unzip.c -- IO for uncompress .zip files using zlib - Version 1.1, February 14h, 2010 - part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) - - Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) - - Modifications of Unzip for Zip64 - Copyright (C) 2007-2008 Even Rouault - - Modifications for Zip64 support on both zip and unzip - Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) - - For more info read MiniZip_info.txt - - - ------------------------------------------------------------------------------------ - Decryption code comes from crypt.c by Info-ZIP but has been greatly reduced in terms of - compatibility with older software. The following is from the original crypt.c. - Code woven in by Terry Thorsen 1/2003. - - Copyright (c) 1990-2000 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2000-Apr-09 or later - (the contents of which are also included in zip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html - - crypt.c (full version) by Info-ZIP. Last revised: [see crypt.h] - - The encryption/decryption parts of this source code (as opposed to the - non-echoing password parts) were originally written in Europe. The - whole source package can be freely distributed, including from the USA. - (Prior to January 2000, re-export from the US was a violation of US law.) - - This encryption code is a direct transcription of the algorithm from - Roger Schlafly, described by Phil Katz in the file appnote.txt. This - file (appnote.txt) is distributed with the PKZIP program (even in the - version without encryption capabilities). - - ------------------------------------------------------------------------------------ - - Changes in unzip.c - - 2007-2008 - Even Rouault - Addition of cpl_unzGetCurrentFileZStreamPos - 2007-2008 - Even Rouault - Decoration of symbol names unz* -> cpl_unz* - 2007-2008 - Even Rouault - Remove old C style function prototypes - 2007-2008 - Even Rouault - Add unzip support for ZIP64 - - Copyright (C) 2007-2008 Even Rouault - - - Oct-2009 - Mathias Svensson - Removed cpl_* from symbol names (Even Rouault added them but since this is now moved to a new project (minizip64) I renamed them again). - Oct-2009 - Mathias Svensson - Fixed problem if uncompressed size was > 4G and compressed size was <4G - should only read the compressed/uncompressed size from the Zip64 format if - the size from normal header was 0xFFFFFFFF - Oct-2009 - Mathias Svensson - Applied some bug fixes from patches received from Gilles Vollant - Oct-2009 - Mathias Svensson - Applied support to unzip files with compression method BZIP2 (bzip2 lib is required) - Patch created by Daniel Borca - - Jan-2010 - back to unzip and minizip 1.0 name scheme, with compatibility layer - - Copyright (C) 1998 - 2010 Gilles Vollant, Even Rouault, Mathias Svensson - -*/ - - -#include -#include -#include - -#ifndef NOUNCRYPT - #define NOUNCRYPT -#endif - -#include "zlib.h" -#include "unzip.h" - -#ifdef STDC -# include -# include -# include -#endif -#ifdef NO_ERRNO_H - extern int errno; -#else -# include -#endif - -namespace cocos2d { - -#ifndef local -# define local static -#endif -/* compile with -Dlocal if your debugger can't find static symbols */ - - -#ifndef CASESENSITIVITYDEFAULT_NO -# if !defined(unix) && !defined(CASESENSITIVITYDEFAULT_YES) -# define CASESENSITIVITYDEFAULT_NO -# endif -#endif - - -#ifndef UNZ_BUFSIZE -#define UNZ_BUFSIZE (16384) -#endif - -#ifndef UNZ_MAXFILENAMEINZIP -#define UNZ_MAXFILENAMEINZIP (256) -#endif - -#ifndef ALLOC -# define ALLOC(size) (malloc(size)) -#endif -#ifndef TRYFREE -# define TRYFREE(p) {if (p) free(p);} -#endif - -#define SIZECENTRALDIRITEM (0x2e) -#define SIZEZIPLOCALHEADER (0x1e) - - -const char unz_copyright[] = - " unzip 1.01 Copyright 1998-2004 Gilles Vollant - http://www.winimage.com/zLibDll"; - -/* unz_file_info_interntal contain internal info about a file in zipfile*/ -typedef struct unz_file_info64_internal_s -{ - ZPOS64_T offset_curfile;/* relative offset of local header 8 bytes */ -} unz_file_info64_internal; - - -/* file_in_zip_read_info_s contain internal information about a file in zipfile, - when reading and decompress it */ -typedef struct -{ - char *read_buffer; /* internal buffer for compressed data */ - z_stream stream; /* zLib stream structure for inflate */ - -#ifdef HAVE_BZIP2 - bz_stream bstream; /* bzLib stream structure for bziped */ -#endif - - ZPOS64_T pos_in_zipfile; /* position in byte on the zipfile, for fseek*/ - uLong stream_initialised; /* flag set if stream structure is initialized*/ - - ZPOS64_T offset_local_extrafield;/* offset of the local extra field */ - uInt size_local_extrafield;/* size of the local extra field */ - ZPOS64_T pos_local_extrafield; /* position in the local extra field in read*/ - ZPOS64_T total_out_64; - - uLong crc32; /* crc32 of all data uncompressed */ - uLong crc32_wait; /* crc32 we must obtain after decompress all */ - ZPOS64_T rest_read_compressed; /* number of byte to be decompressed */ - ZPOS64_T rest_read_uncompressed;/*number of byte to be obtained after decomp*/ - zlib_filefunc64_32_def z_filefunc; - voidpf filestream; /* io structure of the zipfile */ - uLong compression_method; /* compression method (0==store) */ - ZPOS64_T byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/ - int raw; -} file_in_zip64_read_info_s; - - -/* unz64_s contain internal information about the zipfile -*/ -typedef struct -{ - zlib_filefunc64_32_def z_filefunc; - int is64bitOpenFunction; - voidpf filestream; /* io structure of the zipfile */ - unz_global_info64 gi; /* public global information */ - ZPOS64_T byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/ - ZPOS64_T num_file; /* number of the current file in the zipfile*/ - ZPOS64_T pos_in_central_dir; /* pos of the current file in the central dir*/ - ZPOS64_T current_file_ok; /* flag about the usability of the current file*/ - ZPOS64_T central_pos; /* position of the beginning of the central dir*/ - - ZPOS64_T size_central_dir; /* size of the central directory */ - ZPOS64_T offset_central_dir; /* offset of start of central directory with - respect to the starting disk number */ - - unz_file_info64 cur_file_info; /* public info about the current file in zip*/ - unz_file_info64_internal cur_file_info_internal; /* private info about it*/ - file_in_zip64_read_info_s* pfile_in_zip_read; /* structure about the current - file if we are decompressing it */ - int encrypted; - - int isZip64; - -# ifndef NOUNCRYPT - unsigned long keys[3]; /* keys defining the pseudo-random sequence */ - const unsigned long* pcrc_32_tab; -# endif -} unz64_s; - - -#ifndef NOUNCRYPT -#include "crypt.h" -#endif - -/* =========================================================================== - Read a byte from a gz_stream; update next_in and avail_in. Return EOF - for end of file. - IN assertion: the stream s has been successfully opened for reading. -*/ - - -local int unz64local_getByte OF(( - const zlib_filefunc64_32_def* pzlib_filefunc_def, - voidpf filestream, - int *pi)); - -local int unz64local_getByte(const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, int *pi) -{ - unsigned char c; - int err = (int)ZREAD64(*pzlib_filefunc_def,filestream,&c,1); - if (err==1) - { - *pi = (int)c; - return UNZ_OK; - } - else - { - if (ZERROR64(*pzlib_filefunc_def,filestream)) - return UNZ_ERRNO; - else - return UNZ_EOF; - } -} - - -/* =========================================================================== - Reads a long in LSB order from the given gz_stream. Sets -*/ -local int unz64local_getShort OF(( - const zlib_filefunc64_32_def* pzlib_filefunc_def, - voidpf filestream, - uLong *pX)); - -local int unz64local_getShort (const zlib_filefunc64_32_def* pzlib_filefunc_def, - voidpf filestream, - uLong *pX) -{ - uLong x ; - int i = 0; - int err; - - err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); - x = (uLong)i; - - if (err==UNZ_OK) - err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); - x |= ((uLong)i)<<8; - - if (err==UNZ_OK) - *pX = x; - else - *pX = 0; - return err; -} - -local int unz64local_getLong OF(( - const zlib_filefunc64_32_def* pzlib_filefunc_def, - voidpf filestream, - uLong *pX)); - -local int unz64local_getLong (const zlib_filefunc64_32_def* pzlib_filefunc_def, - voidpf filestream, - uLong *pX) -{ - uLong x ; - int i = 0; - int err; - - err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); - x = (uLong)i; - - if (err==UNZ_OK) - err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); - x |= ((uLong)i)<<8; - - if (err==UNZ_OK) - err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); - x |= ((uLong)i)<<16; - - if (err==UNZ_OK) - err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); - x += ((uLong)i)<<24; - - if (err==UNZ_OK) - *pX = x; - else - *pX = 0; - return err; -} - -local int unz64local_getLong64 OF(( - const zlib_filefunc64_32_def* pzlib_filefunc_def, - voidpf filestream, - ZPOS64_T *pX)); - - -local int unz64local_getLong64 (const zlib_filefunc64_32_def* pzlib_filefunc_def, - voidpf filestream, - ZPOS64_T *pX) -{ - ZPOS64_T x ; - int i = 0; - int err; - - err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); - x = (ZPOS64_T)i; - - if (err==UNZ_OK) - err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); - x |= ((ZPOS64_T)i)<<8; - - if (err==UNZ_OK) - err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); - x |= ((ZPOS64_T)i)<<16; - - if (err==UNZ_OK) - err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); - x |= ((ZPOS64_T)i)<<24; - - if (err==UNZ_OK) - err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); - x |= ((ZPOS64_T)i)<<32; - - if (err==UNZ_OK) - err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); - x |= ((ZPOS64_T)i)<<40; - - if (err==UNZ_OK) - err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); - x |= ((ZPOS64_T)i)<<48; - - if (err==UNZ_OK) - err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); - x |= ((ZPOS64_T)i)<<56; - - if (err==UNZ_OK) - *pX = x; - else - *pX = 0; - return err; -} - -/* My own strcmpi / strcasecmp */ -local int strcmpcasenosensitive_internal (const char* fileName1, const char* fileName2) -{ - for (;;) - { - char c1=*(fileName1++); - char c2=*(fileName2++); - if ((c1>='a') && (c1<='z')) - c1 -= 0x20; - if ((c2>='a') && (c2<='z')) - c2 -= 0x20; - if (c1=='\0') - return ((c2=='\0') ? 0 : -1); - if (c2=='\0') - return 1; - if (c1c2) - return 1; - } -} - - -#ifdef CASESENSITIVITYDEFAULT_NO -#define CASESENSITIVITYDEFAULTVALUE 2 -#else -#define CASESENSITIVITYDEFAULTVALUE 1 -#endif - -#ifndef STRCMPCASENOSENTIVEFUNCTION -#define STRCMPCASENOSENTIVEFUNCTION strcmpcasenosensitive_internal -#endif - -/* - Compare two filename (fileName1,fileName2). - If iCaseSenisivity = 1, comparison is case sensitivity (like strcmp) - If iCaseSenisivity = 2, comparison is not case sensitivity (like strcmpi - or strcasecmp) - If iCaseSenisivity = 0, case sensitivity is default of your operating system - (like 1 on Unix, 2 on Windows) - -*/ -int ZEXPORT unzStringFileNameCompare (const char* fileName1, - const char* fileName2, - int iCaseSensitivity) - -{ - if (iCaseSensitivity==0) - iCaseSensitivity=CASESENSITIVITYDEFAULTVALUE; - - if (iCaseSensitivity==1) - return strcmp(fileName1,fileName2); - - return STRCMPCASENOSENTIVEFUNCTION(fileName1,fileName2); -} - -#ifndef BUFREADCOMMENT -#define BUFREADCOMMENT (0x400) -#endif - -/* - Locate the Central directory of a zipfile (at the end, just before - the global comment) -*/ -local ZPOS64_T unz64local_SearchCentralDir OF((const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream)); -local ZPOS64_T unz64local_SearchCentralDir(const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream) -{ - unsigned char* buf; - ZPOS64_T uSizeFile; - ZPOS64_T uBackRead; - ZPOS64_T uMaxBack=0xffff; /* maximum size of global comment */ - ZPOS64_T uPosFound=0; - - if (ZSEEK64(*pzlib_filefunc_def,filestream,0,ZLIB_FILEFUNC_SEEK_END) != 0) - return 0; - - - uSizeFile = ZTELL64(*pzlib_filefunc_def,filestream); - - if (uMaxBack>uSizeFile) - uMaxBack = uSizeFile; - - buf = (unsigned char*)ALLOC(BUFREADCOMMENT+4); - if (buf==NULL) - return 0; - - uBackRead = 4; - while (uBackReaduMaxBack) - uBackRead = uMaxBack; - else - uBackRead+=BUFREADCOMMENT; - uReadPos = uSizeFile-uBackRead ; - - uReadSize = ((BUFREADCOMMENT+4) < (uSizeFile-uReadPos)) ? - (BUFREADCOMMENT+4) : (uLong)(uSizeFile-uReadPos); - if (ZSEEK64(*pzlib_filefunc_def,filestream,uReadPos,ZLIB_FILEFUNC_SEEK_SET)!=0) - break; - - if (ZREAD64(*pzlib_filefunc_def,filestream,buf,uReadSize)!=uReadSize) - break; - - for (i=(int)uReadSize-3; (i--)>0;) - if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) && - ((*(buf+i+2))==0x05) && ((*(buf+i+3))==0x06)) - { - uPosFound = uReadPos+i; - break; - } - - if (uPosFound!=0) - break; - } - TRYFREE(buf); - return uPosFound; -} - - -/* - Locate the Central directory 64 of a zipfile (at the end, just before - the global comment) -*/ -local ZPOS64_T unz64local_SearchCentralDir64 OF(( - const zlib_filefunc64_32_def* pzlib_filefunc_def, - voidpf filestream)); - -local ZPOS64_T unz64local_SearchCentralDir64(const zlib_filefunc64_32_def* pzlib_filefunc_def, - voidpf filestream) -{ - unsigned char* buf; - ZPOS64_T uSizeFile; - ZPOS64_T uBackRead; - ZPOS64_T uMaxBack=0xffff; /* maximum size of global comment */ - ZPOS64_T uPosFound=0; - uLong uL; - ZPOS64_T relativeOffset; - - if (ZSEEK64(*pzlib_filefunc_def,filestream,0,ZLIB_FILEFUNC_SEEK_END) != 0) - return 0; - - - uSizeFile = ZTELL64(*pzlib_filefunc_def,filestream); - - if (uMaxBack>uSizeFile) - uMaxBack = uSizeFile; - - buf = (unsigned char*)ALLOC(BUFREADCOMMENT+4); - if (buf==NULL) - return 0; - - uBackRead = 4; - while (uBackReaduMaxBack) - uBackRead = uMaxBack; - else - uBackRead+=BUFREADCOMMENT; - uReadPos = uSizeFile-uBackRead ; - - uReadSize = ((BUFREADCOMMENT+4) < (uSizeFile-uReadPos)) ? - (BUFREADCOMMENT+4) : (uLong)(uSizeFile-uReadPos); - if (ZSEEK64(*pzlib_filefunc_def,filestream,uReadPos,ZLIB_FILEFUNC_SEEK_SET)!=0) - break; - - if (ZREAD64(*pzlib_filefunc_def,filestream,buf,uReadSize)!=uReadSize) - break; - - for (i=(int)uReadSize-3; (i--)>0;) - if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) && - ((*(buf+i+2))==0x06) && ((*(buf+i+3))==0x07)) - { - uPosFound = uReadPos+i; - break; - } - - if (uPosFound!=0) - break; - } - TRYFREE(buf); - if (uPosFound == 0) - return 0; - - /* Zip64 end of central directory locator */ - if (ZSEEK64(*pzlib_filefunc_def,filestream, uPosFound,ZLIB_FILEFUNC_SEEK_SET)!=0) - return 0; - - /* the signature, already checked */ - if (unz64local_getLong(pzlib_filefunc_def,filestream,&uL)!=UNZ_OK) - return 0; - - /* number of the disk with the start of the zip64 end of central directory */ - if (unz64local_getLong(pzlib_filefunc_def,filestream,&uL)!=UNZ_OK) - return 0; - if (uL != 0) - return 0; - - /* relative offset of the zip64 end of central directory record */ - if (unz64local_getLong64(pzlib_filefunc_def,filestream,&relativeOffset)!=UNZ_OK) - return 0; - - /* total number of disks */ - if (unz64local_getLong(pzlib_filefunc_def,filestream,&uL)!=UNZ_OK) - return 0; - if (uL != 1) - return 0; - - /* Goto end of central directory record */ - if (ZSEEK64(*pzlib_filefunc_def,filestream, relativeOffset,ZLIB_FILEFUNC_SEEK_SET)!=0) - return 0; - - /* the signature */ - if (unz64local_getLong(pzlib_filefunc_def,filestream,&uL)!=UNZ_OK) - return 0; - - if (uL != 0x06064b50) - return 0; - - return relativeOffset; -} - -/* - Open a Zip file. path contain the full pathname (by example, - on a Windows NT computer "c:\\test\\zlib114.zip" or on an Unix computer - "zlib/zlib114.zip". - If the zipfile cannot be opened (file doesn't exist or in not valid), the - return value is NULL. - Else, the return value is a unzFile Handle, usable with other function - of this unzip package. -*/ -local unzFile unzOpenInternal (const void *path, - zlib_filefunc64_32_def* pzlib_filefunc64_32_def, - int is64bitOpenFunction) -{ - unz64_s us; - unz64_s *s; - ZPOS64_T central_pos; - uLong uL; - - uLong number_disk; /* number of the current dist, used for - spanning ZIP, unsupported, always 0*/ - uLong number_disk_with_CD; /* number the the disk with central dir, used - for spanning ZIP, unsupported, always 0*/ - ZPOS64_T number_entry_CD; /* total number of entries in - the central dir - (same than number_entry on nospan) */ - - int err=UNZ_OK; - - if (unz_copyright[0]!=' ') - return NULL; - - us.z_filefunc.zseek32_file = NULL; - us.z_filefunc.ztell32_file = NULL; - if (pzlib_filefunc64_32_def==NULL) - fill_fopen64_filefunc(&us.z_filefunc.zfile_func64); - else - us.z_filefunc = *pzlib_filefunc64_32_def; - us.is64bitOpenFunction = is64bitOpenFunction; - - - - us.filestream = ZOPEN64(us.z_filefunc, - path, - ZLIB_FILEFUNC_MODE_READ | - ZLIB_FILEFUNC_MODE_EXISTING); - if (us.filestream==NULL) - return NULL; - - central_pos = unz64local_SearchCentralDir64(&us.z_filefunc,us.filestream); - if (central_pos) - { - uLong uS; - ZPOS64_T uL64; - - us.isZip64 = 1; - - if (ZSEEK64(us.z_filefunc, us.filestream, - central_pos,ZLIB_FILEFUNC_SEEK_SET)!=0) - err=UNZ_ERRNO; - - /* the signature, already checked */ - if (unz64local_getLong(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK) - err=UNZ_ERRNO; - - /* size of zip64 end of central directory record */ - if (unz64local_getLong64(&us.z_filefunc, us.filestream,&uL64)!=UNZ_OK) - err=UNZ_ERRNO; - - /* version made by */ - if (unz64local_getShort(&us.z_filefunc, us.filestream,&uS)!=UNZ_OK) - err=UNZ_ERRNO; - - /* version needed to extract */ - if (unz64local_getShort(&us.z_filefunc, us.filestream,&uS)!=UNZ_OK) - err=UNZ_ERRNO; - - /* number of this disk */ - if (unz64local_getLong(&us.z_filefunc, us.filestream,&number_disk)!=UNZ_OK) - err=UNZ_ERRNO; - - /* number of the disk with the start of the central directory */ - if (unz64local_getLong(&us.z_filefunc, us.filestream,&number_disk_with_CD)!=UNZ_OK) - err=UNZ_ERRNO; - - /* total number of entries in the central directory on this disk */ - if (unz64local_getLong64(&us.z_filefunc, us.filestream,&us.gi.number_entry)!=UNZ_OK) - err=UNZ_ERRNO; - - /* total number of entries in the central directory */ - if (unz64local_getLong64(&us.z_filefunc, us.filestream,&number_entry_CD)!=UNZ_OK) - err=UNZ_ERRNO; - - if ((number_entry_CD!=us.gi.number_entry) || - (number_disk_with_CD!=0) || - (number_disk!=0)) - err=UNZ_BADZIPFILE; - - /* size of the central directory */ - if (unz64local_getLong64(&us.z_filefunc, us.filestream,&us.size_central_dir)!=UNZ_OK) - err=UNZ_ERRNO; - - /* offset of start of central directory with respect to the - starting disk number */ - if (unz64local_getLong64(&us.z_filefunc, us.filestream,&us.offset_central_dir)!=UNZ_OK) - err=UNZ_ERRNO; - - us.gi.size_comment = 0; - } - else - { - central_pos = unz64local_SearchCentralDir(&us.z_filefunc,us.filestream); - if (central_pos==0) - err=UNZ_ERRNO; - - us.isZip64 = 0; - - if (ZSEEK64(us.z_filefunc, us.filestream, - central_pos,ZLIB_FILEFUNC_SEEK_SET)!=0) - err=UNZ_ERRNO; - - /* the signature, already checked */ - if (unz64local_getLong(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK) - err=UNZ_ERRNO; - - /* number of this disk */ - if (unz64local_getShort(&us.z_filefunc, us.filestream,&number_disk)!=UNZ_OK) - err=UNZ_ERRNO; - - /* number of the disk with the start of the central directory */ - if (unz64local_getShort(&us.z_filefunc, us.filestream,&number_disk_with_CD)!=UNZ_OK) - err=UNZ_ERRNO; - - /* total number of entries in the central dir on this disk */ - if (unz64local_getShort(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK) - err=UNZ_ERRNO; - us.gi.number_entry = uL; - - /* total number of entries in the central dir */ - if (unz64local_getShort(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK) - err=UNZ_ERRNO; - number_entry_CD = uL; - - if ((number_entry_CD!=us.gi.number_entry) || - (number_disk_with_CD!=0) || - (number_disk!=0)) - err=UNZ_BADZIPFILE; - - /* size of the central directory */ - if (unz64local_getLong(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK) - err=UNZ_ERRNO; - us.size_central_dir = uL; - - /* offset of start of central directory with respect to the - starting disk number */ - if (unz64local_getLong(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK) - err=UNZ_ERRNO; - us.offset_central_dir = uL; - - /* zipfile comment length */ - if (unz64local_getShort(&us.z_filefunc, us.filestream,&us.gi.size_comment)!=UNZ_OK) - err=UNZ_ERRNO; - } - - if ((central_pospfile_in_zip_read!=NULL) - unzCloseCurrentFile(file); - - ZCLOSE64(s->z_filefunc, s->filestream); - TRYFREE(s); - return UNZ_OK; -} - - -/* - Write info about the ZipFile in the *pglobal_info structure. - No preparation of the structure is needed - return UNZ_OK if there is no problem. */ -int ZEXPORT unzGetGlobalInfo64 (unzFile file, unz_global_info64* pglobal_info) -{ - unz64_s* s; - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz64_s*)file; - *pglobal_info=s->gi; - return UNZ_OK; -} - -int ZEXPORT unzGetGlobalInfo (unzFile file, unz_global_info* pglobal_info32) -{ - unz64_s* s; - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz64_s*)file; - /* to do : check if number_entry is not truncated */ - pglobal_info32->number_entry = (uLong)s->gi.number_entry; - pglobal_info32->size_comment = s->gi.size_comment; - return UNZ_OK; -} -/* - Translate date/time from Dos format to tm_unz (readable more easily) -*/ -local void unz64local_DosDateToTmuDate (ZPOS64_T ulDosDate, tm_unz* ptm) -{ - ZPOS64_T uDate; - uDate = (ZPOS64_T)(ulDosDate>>16); - ptm->tm_mday = (uInt)(uDate&0x1f) ; - ptm->tm_mon = (uInt)((((uDate)&0x1E0)/0x20)-1) ; - ptm->tm_year = (uInt)(((uDate&0x0FE00)/0x0200)+1980) ; - - ptm->tm_hour = (uInt) ((ulDosDate &0xF800)/0x800); - ptm->tm_min = (uInt) ((ulDosDate&0x7E0)/0x20) ; - ptm->tm_sec = (uInt) (2*(ulDosDate&0x1f)) ; -} - -/* - Get Info about the current file in the zipfile, with internal only info -*/ -local int unz64local_GetCurrentFileInfoInternal OF((unzFile file, - unz_file_info64 *pfile_info, - unz_file_info64_internal - *pfile_info_internal, - char *szFileName, - uLong fileNameBufferSize, - void *extraField, - uLong extraFieldBufferSize, - char *szComment, - uLong commentBufferSize)); - -local int unz64local_GetCurrentFileInfoInternal (unzFile file, - unz_file_info64 *pfile_info, - unz_file_info64_internal - *pfile_info_internal, - char *szFileName, - uLong fileNameBufferSize, - void *extraField, - uLong extraFieldBufferSize, - char *szComment, - uLong commentBufferSize) -{ - unz64_s* s; - unz_file_info64 file_info; - unz_file_info64_internal file_info_internal; - int err=UNZ_OK; - uLong uMagic; - long lSeek=0; - uLong uL; - - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz64_s*)file; - if (ZSEEK64(s->z_filefunc, s->filestream, - s->pos_in_central_dir+s->byte_before_the_zipfile, - ZLIB_FILEFUNC_SEEK_SET)!=0) - err=UNZ_ERRNO; - - - /* we check the magic */ - if (err==UNZ_OK) - { - if (unz64local_getLong(&s->z_filefunc, s->filestream,&uMagic) != UNZ_OK) - err=UNZ_ERRNO; - else if (uMagic!=0x02014b50) - err=UNZ_BADZIPFILE; - } - - if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.version) != UNZ_OK) - err=UNZ_ERRNO; - - if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.version_needed) != UNZ_OK) - err=UNZ_ERRNO; - - if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.flag) != UNZ_OK) - err=UNZ_ERRNO; - - if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.compression_method) != UNZ_OK) - err=UNZ_ERRNO; - - if (unz64local_getLong(&s->z_filefunc, s->filestream,&file_info.dosDate) != UNZ_OK) - err=UNZ_ERRNO; - - unz64local_DosDateToTmuDate(file_info.dosDate,&file_info.tmu_date); - - if (unz64local_getLong(&s->z_filefunc, s->filestream,&file_info.crc) != UNZ_OK) - err=UNZ_ERRNO; - - if (unz64local_getLong(&s->z_filefunc, s->filestream,&uL) != UNZ_OK) - err=UNZ_ERRNO; - file_info.compressed_size = uL; - - if (unz64local_getLong(&s->z_filefunc, s->filestream,&uL) != UNZ_OK) - err=UNZ_ERRNO; - file_info.uncompressed_size = uL; - - if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.size_filename) != UNZ_OK) - err=UNZ_ERRNO; - - if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.size_file_extra) != UNZ_OK) - err=UNZ_ERRNO; - - if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.size_file_comment) != UNZ_OK) - err=UNZ_ERRNO; - - if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.disk_num_start) != UNZ_OK) - err=UNZ_ERRNO; - - if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.internal_fa) != UNZ_OK) - err=UNZ_ERRNO; - - if (unz64local_getLong(&s->z_filefunc, s->filestream,&file_info.external_fa) != UNZ_OK) - err=UNZ_ERRNO; - - // relative offset of local header - if (unz64local_getLong(&s->z_filefunc, s->filestream,&uL) != UNZ_OK) - err=UNZ_ERRNO; - file_info_internal.offset_curfile = uL; - - lSeek+=file_info.size_filename; - if ((err==UNZ_OK) && (szFileName!=NULL)) - { - uLong uSizeRead ; - if (file_info.size_filename0) && (fileNameBufferSize>0)) - if (ZREAD64(s->z_filefunc, s->filestream,szFileName,uSizeRead)!=uSizeRead) - err=UNZ_ERRNO; - lSeek -= uSizeRead; - } - - // Read extrafield - if ((err==UNZ_OK) && (extraField!=NULL)) - { - ZPOS64_T uSizeRead ; - if (file_info.size_file_extraz_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0) - lSeek=0; - else - err=UNZ_ERRNO; - } - - if ((file_info.size_file_extra>0) && (extraFieldBufferSize>0)) - if (ZREAD64(s->z_filefunc, s->filestream,extraField,(uLong)uSizeRead)!=uSizeRead) - err=UNZ_ERRNO; - - lSeek += file_info.size_file_extra - (uLong)uSizeRead; - } - else - lSeek += file_info.size_file_extra; - - - if ((err==UNZ_OK) && (file_info.size_file_extra != 0)) - { - uLong acc = 0; - - // since lSeek now points to after the extra field we need to move back - lSeek -= file_info.size_file_extra; - - if (lSeek!=0) - { - if (ZSEEK64(s->z_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0) - lSeek=0; - else - err=UNZ_ERRNO; - } - - while(acc < file_info.size_file_extra) - { - uLong headerId; - uLong dataSize; - - if (unz64local_getShort(&s->z_filefunc, s->filestream,&headerId) != UNZ_OK) - err=UNZ_ERRNO; - - if (unz64local_getShort(&s->z_filefunc, s->filestream,&dataSize) != UNZ_OK) - err=UNZ_ERRNO; - - /* ZIP64 extra fields */ - if (headerId == 0x0001) - { - uLong uL; - - if(file_info.uncompressed_size == (ZPOS64_T)(unsigned long)-1) - { - if (unz64local_getLong64(&s->z_filefunc, s->filestream,&file_info.uncompressed_size) != UNZ_OK) - err=UNZ_ERRNO; - } - - if(file_info.compressed_size == (ZPOS64_T)(unsigned long)-1) - { - if (unz64local_getLong64(&s->z_filefunc, s->filestream,&file_info.compressed_size) != UNZ_OK) - err=UNZ_ERRNO; - } - - if(file_info_internal.offset_curfile == (ZPOS64_T)(unsigned long)-1) - { - /* Relative Header offset */ - if (unz64local_getLong64(&s->z_filefunc, s->filestream,&file_info_internal.offset_curfile) != UNZ_OK) - err=UNZ_ERRNO; - } - - if(file_info.disk_num_start == (unsigned long)-1) - { - /* Disk Start Number */ - if (unz64local_getLong(&s->z_filefunc, s->filestream,&uL) != UNZ_OK) - err=UNZ_ERRNO; - } - - } - else - { - if (ZSEEK64(s->z_filefunc, s->filestream,dataSize,ZLIB_FILEFUNC_SEEK_CUR)!=0) - err=UNZ_ERRNO; - } - - acc += 2 + 2 + dataSize; - } - } - - if ((err==UNZ_OK) && (szComment!=NULL)) - { - uLong uSizeRead ; - if (file_info.size_file_commentz_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0) { - //lSeek=0; - } - else - err=UNZ_ERRNO; - } - - if ((file_info.size_file_comment>0) && (commentBufferSize>0)) - if (ZREAD64(s->z_filefunc, s->filestream,szComment,uSizeRead)!=uSizeRead) - err=UNZ_ERRNO; - //lSeek+=file_info.size_file_comment - uSizeRead; - } - //else - // lSeek+=file_info.size_file_comment; - - - if ((err==UNZ_OK) && (pfile_info!=NULL)) - *pfile_info=file_info; - - if ((err==UNZ_OK) && (pfile_info_internal!=NULL)) - *pfile_info_internal=file_info_internal; - - return err; -} - - - -/* - Write info about the ZipFile in the *pglobal_info structure. - No preparation of the structure is needed - return UNZ_OK if there is no problem. -*/ -int ZEXPORT unzGetCurrentFileInfo64 (unzFile file, - unz_file_info64 * pfile_info, - char * szFileName, uLong fileNameBufferSize, - void *extraField, uLong extraFieldBufferSize, - char* szComment, uLong commentBufferSize) -{ - return unz64local_GetCurrentFileInfoInternal(file,pfile_info,NULL, - szFileName,fileNameBufferSize, - extraField,extraFieldBufferSize, - szComment,commentBufferSize); -} - -int ZEXPORT unzGetCurrentFileInfo (unzFile file, - unz_file_info * pfile_info, - char * szFileName, uLong fileNameBufferSize, - void *extraField, uLong extraFieldBufferSize, - char* szComment, uLong commentBufferSize) -{ - int err; - unz_file_info64 file_info64; - err = unz64local_GetCurrentFileInfoInternal(file,&file_info64,NULL, - szFileName,fileNameBufferSize, - extraField,extraFieldBufferSize, - szComment,commentBufferSize); - if (err==UNZ_OK) - { - pfile_info->version = file_info64.version; - pfile_info->version_needed = file_info64.version_needed; - pfile_info->flag = file_info64.flag; - pfile_info->compression_method = file_info64.compression_method; - pfile_info->dosDate = file_info64.dosDate; - pfile_info->crc = file_info64.crc; - - pfile_info->size_filename = file_info64.size_filename; - pfile_info->size_file_extra = file_info64.size_file_extra; - pfile_info->size_file_comment = file_info64.size_file_comment; - - pfile_info->disk_num_start = file_info64.disk_num_start; - pfile_info->internal_fa = file_info64.internal_fa; - pfile_info->external_fa = file_info64.external_fa; - - pfile_info->tmu_date = file_info64.tmu_date, - - - pfile_info->compressed_size = (uLong)file_info64.compressed_size; - pfile_info->uncompressed_size = (uLong)file_info64.uncompressed_size; - - } - return err; -} - -/* - Set the current file of the zipfile to the first file - with retrieving an information about the file. - return UNZ_OK if there is no problem -*/ -int ZEXPORT unzGoToFirstFile64 (unzFile file, - unz_file_info64 *pfile_info, - char *szFileName, - uLong fileNameBufferSize) -{ - int err=UNZ_OK; - unz64_s* s; - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz64_s*)file; - s->pos_in_central_dir=s->offset_central_dir; - s->num_file=0; - err=unz64local_GetCurrentFileInfoInternal(file,&s->cur_file_info, - &s->cur_file_info_internal, - szFileName,fileNameBufferSize,NULL,0,NULL,0); - s->current_file_ok = (err == UNZ_OK); - if (pfile_info) - *pfile_info = s->cur_file_info; - return err; -} - -/* - Set the current file of the zipfile to the first file. - return UNZ_OK if there is no problem -*/ -int ZEXPORT unzGoToFirstFile (unzFile file) -{ - return unzGoToFirstFile64(file, NULL, NULL, 0); -} - -/* - Set the current file of the zipfile to the next file - with retrieving an information about the file. - return UNZ_OK if there is no problem - return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest. -*/ -int ZEXPORT unzGoToNextFile64 (unzFile file, - unz_file_info64 *pfile_info, - char *szFileName, - uLong fileNameBufferSize) -{ - unz64_s* s; - int err; - - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz64_s*)file; - if (!s->current_file_ok) - return UNZ_END_OF_LIST_OF_FILE; - if (s->gi.number_entry != 0xffff) /* 2^16 files overflow hack */ - if (s->num_file+1==s->gi.number_entry) - return UNZ_END_OF_LIST_OF_FILE; - - s->pos_in_central_dir += SIZECENTRALDIRITEM + s->cur_file_info.size_filename + - s->cur_file_info.size_file_extra + s->cur_file_info.size_file_comment ; - s->num_file++; - err = unz64local_GetCurrentFileInfoInternal(file,&s->cur_file_info, - &s->cur_file_info_internal, - szFileName,fileNameBufferSize,NULL,0,NULL,0); - s->current_file_ok = (err == UNZ_OK); - if (pfile_info) - *pfile_info = s->cur_file_info; - return err; -} - -/* - Set the current file of the zipfile to the next file. - return UNZ_OK if there is no problem - return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest. -*/ -int ZEXPORT unzGoToNextFile (unzFile file) -{ - return unzGoToNextFile64(file, NULL, NULL, 0); -} - - -/* - Try locate the file szFileName in the zipfile. - For the iCaseSensitivity signification, see unzipStringFileNameCompare - - return value : - UNZ_OK if the file is found. It becomes the current file. - UNZ_END_OF_LIST_OF_FILE if the file is not found -*/ -int ZEXPORT unzLocateFile (unzFile file, const char *szFileName, int iCaseSensitivity) -{ - unz64_s* s; - int err; - - /* We remember the 'current' position in the file so that we can jump - * back there if we fail. - */ - unz_file_info64 cur_file_infoSaved; - unz_file_info64_internal cur_file_info_internalSaved; - ZPOS64_T num_fileSaved; - ZPOS64_T pos_in_central_dirSaved; - - - if (file==NULL) - return UNZ_PARAMERROR; - - if (strlen(szFileName)>=UNZ_MAXFILENAMEINZIP) - return UNZ_PARAMERROR; - - s=(unz64_s*)file; - if (!s->current_file_ok) - return UNZ_END_OF_LIST_OF_FILE; - - /* Save the current state */ - num_fileSaved = s->num_file; - pos_in_central_dirSaved = s->pos_in_central_dir; - cur_file_infoSaved = s->cur_file_info; - cur_file_info_internalSaved = s->cur_file_info_internal; - - err = unzGoToFirstFile(file); - - while (err == UNZ_OK) - { - char szCurrentFileName[UNZ_MAXFILENAMEINZIP+1]; - err = unzGetCurrentFileInfo64(file,NULL, - szCurrentFileName,sizeof(szCurrentFileName)-1, - NULL,0,NULL,0); - if (err == UNZ_OK) - { - if (unzStringFileNameCompare(szCurrentFileName, - szFileName,iCaseSensitivity)==0) - return UNZ_OK; - err = unzGoToNextFile(file); - } - } - - /* We failed, so restore the state of the 'current file' to where we - * were. - */ - s->num_file = num_fileSaved ; - s->pos_in_central_dir = pos_in_central_dirSaved ; - s->cur_file_info = cur_file_infoSaved; - s->cur_file_info_internal = cur_file_info_internalSaved; - return err; -} - - -/* -/////////////////////////////////////////// -// Contributed by Ryan Haksi (mailto://cryogen@infoserve.net) -// I need random access -// -// Further optimization could be realized by adding an ability -// to cache the directory in memory. The goal being a single -// comprehensive file read to put the file I need in a memory. -*/ - -/* -typedef struct unz_file_pos_s -{ - ZPOS64_T pos_in_zip_directory; // offset in file - ZPOS64_T num_of_file; // # of file -} unz_file_pos; -*/ - -int ZEXPORT unzGetFilePos64(unzFile file, unz64_file_pos* file_pos) -{ - unz64_s* s; - - if (file==NULL || file_pos==NULL) - return UNZ_PARAMERROR; - s=(unz64_s*)file; - if (!s->current_file_ok) - return UNZ_END_OF_LIST_OF_FILE; - - file_pos->pos_in_zip_directory = s->pos_in_central_dir; - file_pos->num_of_file = s->num_file; - - return UNZ_OK; -} - -int ZEXPORT unzGetFilePos( - unzFile file, - unz_file_pos* file_pos) -{ - unz64_file_pos file_pos64; - int err = unzGetFilePos64(file,&file_pos64); - if (err==UNZ_OK) - { - file_pos->pos_in_zip_directory = (uLong)file_pos64.pos_in_zip_directory; - file_pos->num_of_file = (uLong)file_pos64.num_of_file; - } - return err; -} - -int ZEXPORT unzGoToFilePos64(unzFile file, const unz64_file_pos* file_pos) -{ - unz64_s* s; - int err; - - if (file==NULL || file_pos==NULL) - return UNZ_PARAMERROR; - s=(unz64_s*)file; - - /* jump to the right spot */ - s->pos_in_central_dir = file_pos->pos_in_zip_directory; - s->num_file = file_pos->num_of_file; - - /* set the current file */ - err = unz64local_GetCurrentFileInfoInternal(file,&s->cur_file_info, - &s->cur_file_info_internal, - NULL,0,NULL,0,NULL,0); - /* return results */ - s->current_file_ok = (err == UNZ_OK); - return err; -} - -int ZEXPORT unzGoToFilePos( - unzFile file, - unz_file_pos* file_pos) -{ - unz64_file_pos file_pos64; - if (file_pos == NULL) - return UNZ_PARAMERROR; - - file_pos64.pos_in_zip_directory = file_pos->pos_in_zip_directory; - file_pos64.num_of_file = file_pos->num_of_file; - return unzGoToFilePos64(file,&file_pos64); -} - -/* -// Unzip Helper Functions - should be here? -/////////////////////////////////////////// -*/ - -/* - Read the local header of the current zipfile - Check the coherency of the local header and info in the end of central - directory about this file - store in *piSizeVar the size of extra info in local header - (filename and size of extra field data) -*/ -local int unz64local_CheckCurrentFileCoherencyHeader (unz64_s* s, uInt* piSizeVar, - ZPOS64_T * poffset_local_extrafield, - uInt * psize_local_extrafield) -{ - uLong uMagic,uData,uFlags; - uLong size_filename; - uLong size_extra_field; - int err=UNZ_OK; - - *piSizeVar = 0; - *poffset_local_extrafield = 0; - *psize_local_extrafield = 0; - - if (ZSEEK64(s->z_filefunc, s->filestream,s->cur_file_info_internal.offset_curfile + - s->byte_before_the_zipfile,ZLIB_FILEFUNC_SEEK_SET)!=0) - return UNZ_ERRNO; - - - if (err==UNZ_OK) - { - if (unz64local_getLong(&s->z_filefunc, s->filestream,&uMagic) != UNZ_OK) - err=UNZ_ERRNO; - else if (uMagic!=0x04034b50) - err=UNZ_BADZIPFILE; - } - - if (unz64local_getShort(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) - err=UNZ_ERRNO; -/* - else if ((err==UNZ_OK) && (uData!=s->cur_file_info.wVersion)) - err=UNZ_BADZIPFILE; -*/ - if (unz64local_getShort(&s->z_filefunc, s->filestream,&uFlags) != UNZ_OK) - err=UNZ_ERRNO; - - if (unz64local_getShort(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) - err=UNZ_ERRNO; - else if ((err==UNZ_OK) && (uData!=s->cur_file_info.compression_method)) - err=UNZ_BADZIPFILE; - - if ((err==UNZ_OK) && (s->cur_file_info.compression_method!=0) && -/* #ifdef HAVE_BZIP2 */ - (s->cur_file_info.compression_method!=Z_BZIP2ED) && -/* #endif */ - (s->cur_file_info.compression_method!=Z_DEFLATED)) - err=UNZ_BADZIPFILE; - - if (unz64local_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* date/time */ - err=UNZ_ERRNO; - - if (unz64local_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* crc */ - err=UNZ_ERRNO; - else if ((err==UNZ_OK) && (uData!=s->cur_file_info.crc) && ((uFlags & 8)==0)) - err=UNZ_BADZIPFILE; - - if (unz64local_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* size compr */ - err=UNZ_ERRNO; - else if (uData != 0xFFFFFFFF && (err==UNZ_OK) && (uData!=s->cur_file_info.compressed_size) && ((uFlags & 8)==0)) - err=UNZ_BADZIPFILE; - - if (unz64local_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* size uncompr */ - err=UNZ_ERRNO; - else if (uData != 0xFFFFFFFF && (err==UNZ_OK) && (uData!=s->cur_file_info.uncompressed_size) && ((uFlags & 8)==0)) - err=UNZ_BADZIPFILE; - - if (unz64local_getShort(&s->z_filefunc, s->filestream,&size_filename) != UNZ_OK) - err=UNZ_ERRNO; - else if ((err==UNZ_OK) && (size_filename!=s->cur_file_info.size_filename)) - err=UNZ_BADZIPFILE; - - *piSizeVar += (uInt)size_filename; - - if (unz64local_getShort(&s->z_filefunc, s->filestream,&size_extra_field) != UNZ_OK) - err=UNZ_ERRNO; - *poffset_local_extrafield= s->cur_file_info_internal.offset_curfile + - SIZEZIPLOCALHEADER + size_filename; - *psize_local_extrafield = (uInt)size_extra_field; - - *piSizeVar += (uInt)size_extra_field; - - return err; -} - -/* - Open for reading data the current file in the zipfile. - If there is no error and the file is opened, the return value is UNZ_OK. -*/ -int ZEXPORT unzOpenCurrentFile3 (unzFile file, int* method, - int* level, int raw, const char* password) -{ - int err=UNZ_OK; - uInt iSizeVar; - unz64_s* s; - file_in_zip64_read_info_s* pfile_in_zip_read_info; - ZPOS64_T offset_local_extrafield; /* offset of the local extra field */ - uInt size_local_extrafield; /* size of the local extra field */ -# ifndef NOUNCRYPT - char source[12]; -# else - if (password != NULL) - return UNZ_PARAMERROR; -# endif - - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz64_s*)file; - if (!s->current_file_ok) - return UNZ_PARAMERROR; - - if (s->pfile_in_zip_read != NULL) - unzCloseCurrentFile(file); - - if (unz64local_CheckCurrentFileCoherencyHeader(s,&iSizeVar, &offset_local_extrafield,&size_local_extrafield)!=UNZ_OK) - return UNZ_BADZIPFILE; - - pfile_in_zip_read_info = (file_in_zip64_read_info_s*)ALLOC(sizeof(file_in_zip64_read_info_s)); - if (pfile_in_zip_read_info==NULL) - return UNZ_INTERNALERROR; - - pfile_in_zip_read_info->read_buffer=(char*)ALLOC(UNZ_BUFSIZE); - pfile_in_zip_read_info->offset_local_extrafield = offset_local_extrafield; - pfile_in_zip_read_info->size_local_extrafield = size_local_extrafield; - pfile_in_zip_read_info->pos_local_extrafield=0; - pfile_in_zip_read_info->raw=raw; - - if (pfile_in_zip_read_info->read_buffer==NULL) - { - TRYFREE(pfile_in_zip_read_info); - return UNZ_INTERNALERROR; - } - - pfile_in_zip_read_info->stream_initialised=0; - - if (method!=NULL) - *method = (int)s->cur_file_info.compression_method; - - if (level!=NULL) - { - *level = 6; - switch (s->cur_file_info.flag & 0x06) - { - case 6 : *level = 1; break; - case 4 : *level = 2; break; - case 2 : *level = 9; break; - } - } - - if ((s->cur_file_info.compression_method!=0) && -/* #ifdef HAVE_BZIP2 */ - (s->cur_file_info.compression_method!=Z_BZIP2ED) && -/* #endif */ - (s->cur_file_info.compression_method!=Z_DEFLATED)) { - - //err=UNZ_BADZIPFILE; - } - pfile_in_zip_read_info->crc32_wait=s->cur_file_info.crc; - pfile_in_zip_read_info->crc32=0; - pfile_in_zip_read_info->total_out_64=0; - pfile_in_zip_read_info->compression_method = s->cur_file_info.compression_method; - pfile_in_zip_read_info->filestream=s->filestream; - pfile_in_zip_read_info->z_filefunc=s->z_filefunc; - pfile_in_zip_read_info->byte_before_the_zipfile=s->byte_before_the_zipfile; - - pfile_in_zip_read_info->stream.total_out = 0; - - if ((s->cur_file_info.compression_method==Z_BZIP2ED) && (!raw)) - { -#ifdef HAVE_BZIP2 - pfile_in_zip_read_info->bstream.bzalloc = (void *(*) (void *, int, int))0; - pfile_in_zip_read_info->bstream.bzfree = (free_func)0; - pfile_in_zip_read_info->bstream.opaque = (voidpf)0; - pfile_in_zip_read_info->bstream.state = (voidpf)0; - - pfile_in_zip_read_info->stream.zalloc = (alloc_func)0; - pfile_in_zip_read_info->stream.zfree = (free_func)0; - pfile_in_zip_read_info->stream.opaque = (voidpf)0; - pfile_in_zip_read_info->stream.next_in = (voidpf)0; - pfile_in_zip_read_info->stream.avail_in = 0; - - err=BZ2_bzDecompressInit(&pfile_in_zip_read_info->bstream, 0, 0); - if (err == Z_OK) - pfile_in_zip_read_info->stream_initialised=Z_BZIP2ED; - else - { - TRYFREE(pfile_in_zip_read_info); - return err; - } -#else - pfile_in_zip_read_info->raw=1; -#endif - } - else if ((s->cur_file_info.compression_method==Z_DEFLATED) && (!raw)) - { - pfile_in_zip_read_info->stream.zalloc = (alloc_func)0; - pfile_in_zip_read_info->stream.zfree = (free_func)0; - pfile_in_zip_read_info->stream.opaque = (voidpf)0; - pfile_in_zip_read_info->stream.next_in = 0; - pfile_in_zip_read_info->stream.avail_in = 0; - - err=inflateInit2(&pfile_in_zip_read_info->stream, -MAX_WBITS); - if (err == Z_OK) - pfile_in_zip_read_info->stream_initialised=Z_DEFLATED; - else - { - TRYFREE(pfile_in_zip_read_info); - return err; - } - /* windowBits is passed < 0 to tell that there is no zlib header. - * Note that in this case inflate *requires* an extra "dummy" byte - * after the compressed stream in order to complete decompression and - * return Z_STREAM_END. - * In unzip, i don't wait absolutely Z_STREAM_END because I known the - * size of both compressed and uncompressed data - */ - } - pfile_in_zip_read_info->rest_read_compressed = - s->cur_file_info.compressed_size ; - pfile_in_zip_read_info->rest_read_uncompressed = - s->cur_file_info.uncompressed_size ; - - - pfile_in_zip_read_info->pos_in_zipfile = - s->cur_file_info_internal.offset_curfile + SIZEZIPLOCALHEADER + - iSizeVar; - - pfile_in_zip_read_info->stream.avail_in = (uInt)0; - - s->pfile_in_zip_read = pfile_in_zip_read_info; - s->encrypted = 0; - -# ifndef NOUNCRYPT - if (password != NULL) - { - int i; - s->pcrc_32_tab = get_crc_table(); - init_keys(password,s->keys,s->pcrc_32_tab); - if (ZSEEK64(s->z_filefunc, s->filestream, - s->pfile_in_zip_read->pos_in_zipfile + - s->pfile_in_zip_read->byte_before_the_zipfile, - SEEK_SET)!=0) - return UNZ_INTERNALERROR; - if(ZREAD64(s->z_filefunc, s->filestream,source, 12)<12) - return UNZ_INTERNALERROR; - - for (i = 0; i<12; i++) - zdecode(s->keys,s->pcrc_32_tab,source[i]); - - s->pfile_in_zip_read->pos_in_zipfile+=12; - s->encrypted=1; - } -# endif - - - return UNZ_OK; -} - -int ZEXPORT unzOpenCurrentFile (unzFile file) -{ - return unzOpenCurrentFile3(file, NULL, NULL, 0, NULL); -} - -int ZEXPORT unzOpenCurrentFilePassword (unzFile file, const char* password) -{ - return unzOpenCurrentFile3(file, NULL, NULL, 0, password); -} - -int ZEXPORT unzOpenCurrentFile2 (unzFile file, int* method, int* level, int raw) -{ - return unzOpenCurrentFile3(file, method, level, raw, NULL); -} - -/** Addition for GDAL : START */ - -ZPOS64_T ZEXPORT unzGetCurrentFileZStreamPos64( unzFile file) -{ - unz64_s* s; - file_in_zip64_read_info_s* pfile_in_zip_read_info; - s=(unz64_s*)file; - if (file==NULL) - return 0; //UNZ_PARAMERROR; - pfile_in_zip_read_info=s->pfile_in_zip_read; - if (pfile_in_zip_read_info==NULL) - return 0; //UNZ_PARAMERROR; - return pfile_in_zip_read_info->pos_in_zipfile + - pfile_in_zip_read_info->byte_before_the_zipfile; -} - -/** Addition for GDAL : END */ - -/* - Read bytes from the current file. - buf contain buffer where data must be copied - len the size of buf. - - return the number of byte copied if some bytes are copied - return 0 if the end of file was reached - return <0 with error code if there is an error - (UNZ_ERRNO for IO error, or zLib error for uncompress error) -*/ -int ZEXPORT unzReadCurrentFile (unzFile file, voidp buf, unsigned len) -{ - int err=UNZ_OK; - uInt iRead = 0; - unz64_s* s; - file_in_zip64_read_info_s* pfile_in_zip_read_info; - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz64_s*)file; - pfile_in_zip_read_info=s->pfile_in_zip_read; - - if (pfile_in_zip_read_info==NULL) - return UNZ_PARAMERROR; - - - if (pfile_in_zip_read_info->read_buffer == NULL) - return UNZ_END_OF_LIST_OF_FILE; - if (len==0) - return 0; - - pfile_in_zip_read_info->stream.next_out = (Bytef*)buf; - - pfile_in_zip_read_info->stream.avail_out = (uInt)len; - - if ((len>pfile_in_zip_read_info->rest_read_uncompressed) && - (!(pfile_in_zip_read_info->raw))) - pfile_in_zip_read_info->stream.avail_out = - (uInt)pfile_in_zip_read_info->rest_read_uncompressed; - - if ((len>pfile_in_zip_read_info->rest_read_compressed+ - pfile_in_zip_read_info->stream.avail_in) && - (pfile_in_zip_read_info->raw)) - pfile_in_zip_read_info->stream.avail_out = - (uInt)pfile_in_zip_read_info->rest_read_compressed+ - pfile_in_zip_read_info->stream.avail_in; - - while (pfile_in_zip_read_info->stream.avail_out>0) - { - if ((pfile_in_zip_read_info->stream.avail_in==0) && - (pfile_in_zip_read_info->rest_read_compressed>0)) - { - uInt uReadThis = UNZ_BUFSIZE; - if (pfile_in_zip_read_info->rest_read_compressedrest_read_compressed; - if (uReadThis == 0) - return UNZ_EOF; - if (ZSEEK64(pfile_in_zip_read_info->z_filefunc, - pfile_in_zip_read_info->filestream, - pfile_in_zip_read_info->pos_in_zipfile + - pfile_in_zip_read_info->byte_before_the_zipfile, - ZLIB_FILEFUNC_SEEK_SET)!=0) - return UNZ_ERRNO; - if (ZREAD64(pfile_in_zip_read_info->z_filefunc, - pfile_in_zip_read_info->filestream, - pfile_in_zip_read_info->read_buffer, - uReadThis)!=uReadThis) - return UNZ_ERRNO; - - -# ifndef NOUNCRYPT - if(s->encrypted) - { - uInt i; - for(i=0;iread_buffer[i] = - zdecode(s->keys,s->pcrc_32_tab, - pfile_in_zip_read_info->read_buffer[i]); - } -# endif - - - pfile_in_zip_read_info->pos_in_zipfile += uReadThis; - - pfile_in_zip_read_info->rest_read_compressed-=uReadThis; - - pfile_in_zip_read_info->stream.next_in = - (Bytef*)pfile_in_zip_read_info->read_buffer; - pfile_in_zip_read_info->stream.avail_in = (uInt)uReadThis; - } - - if ((pfile_in_zip_read_info->compression_method==0) || (pfile_in_zip_read_info->raw)) - { - uInt uDoCopy,i ; - - if ((pfile_in_zip_read_info->stream.avail_in == 0) && - (pfile_in_zip_read_info->rest_read_compressed == 0)) - return (iRead==0) ? UNZ_EOF : iRead; - - if (pfile_in_zip_read_info->stream.avail_out < - pfile_in_zip_read_info->stream.avail_in) - uDoCopy = pfile_in_zip_read_info->stream.avail_out ; - else - uDoCopy = pfile_in_zip_read_info->stream.avail_in ; - - for (i=0;istream.next_out+i) = - *(pfile_in_zip_read_info->stream.next_in+i); - - pfile_in_zip_read_info->total_out_64 = pfile_in_zip_read_info->total_out_64 + uDoCopy; - - pfile_in_zip_read_info->crc32 = crc32(pfile_in_zip_read_info->crc32, - pfile_in_zip_read_info->stream.next_out, - uDoCopy); - pfile_in_zip_read_info->rest_read_uncompressed-=uDoCopy; - pfile_in_zip_read_info->stream.avail_in -= uDoCopy; - pfile_in_zip_read_info->stream.avail_out -= uDoCopy; - pfile_in_zip_read_info->stream.next_out += uDoCopy; - pfile_in_zip_read_info->stream.next_in += uDoCopy; - pfile_in_zip_read_info->stream.total_out += uDoCopy; - iRead += uDoCopy; - } - else if (pfile_in_zip_read_info->compression_method==Z_BZIP2ED) - { -#ifdef HAVE_BZIP2 - uLong uTotalOutBefore,uTotalOutAfter; - const Bytef *bufBefore; - uLong uOutThis; - - pfile_in_zip_read_info->bstream.next_in = (char*)pfile_in_zip_read_info->stream.next_in; - pfile_in_zip_read_info->bstream.avail_in = pfile_in_zip_read_info->stream.avail_in; - pfile_in_zip_read_info->bstream.total_in_lo32 = pfile_in_zip_read_info->stream.total_in; - pfile_in_zip_read_info->bstream.total_in_hi32 = 0; - pfile_in_zip_read_info->bstream.next_out = (char*)pfile_in_zip_read_info->stream.next_out; - pfile_in_zip_read_info->bstream.avail_out = pfile_in_zip_read_info->stream.avail_out; - pfile_in_zip_read_info->bstream.total_out_lo32 = pfile_in_zip_read_info->stream.total_out; - pfile_in_zip_read_info->bstream.total_out_hi32 = 0; - - uTotalOutBefore = pfile_in_zip_read_info->bstream.total_out_lo32; - bufBefore = (const Bytef *)pfile_in_zip_read_info->bstream.next_out; - - err=BZ2_bzDecompress(&pfile_in_zip_read_info->bstream); - - uTotalOutAfter = pfile_in_zip_read_info->bstream.total_out_lo32; - uOutThis = uTotalOutAfter-uTotalOutBefore; - - pfile_in_zip_read_info->total_out_64 = pfile_in_zip_read_info->total_out_64 + uOutThis; - - pfile_in_zip_read_info->crc32 = crc32(pfile_in_zip_read_info->crc32,bufBefore, (uInt)(uOutThis)); - pfile_in_zip_read_info->rest_read_uncompressed -= uOutThis; - iRead += (uInt)(uTotalOutAfter - uTotalOutBefore); - - pfile_in_zip_read_info->stream.next_in = (Bytef*)pfile_in_zip_read_info->bstream.next_in; - pfile_in_zip_read_info->stream.avail_in = pfile_in_zip_read_info->bstream.avail_in; - pfile_in_zip_read_info->stream.total_in = pfile_in_zip_read_info->bstream.total_in_lo32; - pfile_in_zip_read_info->stream.next_out = (Bytef*)pfile_in_zip_read_info->bstream.next_out; - pfile_in_zip_read_info->stream.avail_out = pfile_in_zip_read_info->bstream.avail_out; - pfile_in_zip_read_info->stream.total_out = pfile_in_zip_read_info->bstream.total_out_lo32; - - if (err==BZ_STREAM_END) - return (iRead==0) ? UNZ_EOF : iRead; - if (err!=BZ_OK) - break; -#endif - } // end Z_BZIP2ED - else - { - ZPOS64_T uTotalOutBefore,uTotalOutAfter; - const Bytef *bufBefore; - ZPOS64_T uOutThis; - int flush=Z_SYNC_FLUSH; - - uTotalOutBefore = pfile_in_zip_read_info->stream.total_out; - bufBefore = pfile_in_zip_read_info->stream.next_out; - - /* - if ((pfile_in_zip_read_info->rest_read_uncompressed == - pfile_in_zip_read_info->stream.avail_out) && - (pfile_in_zip_read_info->rest_read_compressed == 0)) - flush = Z_FINISH; - */ - err=inflate(&pfile_in_zip_read_info->stream,flush); - - if ((err>=0) && (pfile_in_zip_read_info->stream.msg!=NULL)) - err = Z_DATA_ERROR; - - uTotalOutAfter = pfile_in_zip_read_info->stream.total_out; - uOutThis = uTotalOutAfter-uTotalOutBefore; - - pfile_in_zip_read_info->total_out_64 = pfile_in_zip_read_info->total_out_64 + uOutThis; - - pfile_in_zip_read_info->crc32 = - crc32(pfile_in_zip_read_info->crc32,bufBefore, - (uInt)(uOutThis)); - - pfile_in_zip_read_info->rest_read_uncompressed -= - uOutThis; - - iRead += (uInt)(uTotalOutAfter - uTotalOutBefore); - - if (err==Z_STREAM_END) - return (iRead==0) ? UNZ_EOF : iRead; - if (err!=Z_OK) - break; - } - } - - if (err==Z_OK) - return iRead; - return err; -} - - -/* - Give the current position in uncompressed data -*/ -z_off_t ZEXPORT unztell (unzFile file) -{ - unz64_s* s; - file_in_zip64_read_info_s* pfile_in_zip_read_info; - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz64_s*)file; - pfile_in_zip_read_info=s->pfile_in_zip_read; - - if (pfile_in_zip_read_info==NULL) - return UNZ_PARAMERROR; - - return (z_off_t)pfile_in_zip_read_info->stream.total_out; -} - -ZPOS64_T ZEXPORT unztell64 (unzFile file) -{ - - unz64_s* s; - file_in_zip64_read_info_s* pfile_in_zip_read_info; - if (file==NULL) - return (ZPOS64_T)-1; - s=(unz64_s*)file; - pfile_in_zip_read_info=s->pfile_in_zip_read; - - if (pfile_in_zip_read_info==NULL) - return (ZPOS64_T)-1; - - return pfile_in_zip_read_info->total_out_64; -} - - -/* - return 1 if the end of file was reached, 0 elsewhere -*/ -int ZEXPORT unzeof (unzFile file) -{ - unz64_s* s; - file_in_zip64_read_info_s* pfile_in_zip_read_info; - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz64_s*)file; - pfile_in_zip_read_info=s->pfile_in_zip_read; - - if (pfile_in_zip_read_info==NULL) - return UNZ_PARAMERROR; - - if (pfile_in_zip_read_info->rest_read_uncompressed == 0) - return 1; - else - return 0; -} - - - -/* -Read extra field from the current file (opened by unzOpenCurrentFile) -This is the local-header version of the extra field (sometimes, there is -more info in the local-header version than in the central-header) - - if buf==NULL, it return the size of the local extra field that can be read - - if buf!=NULL, len is the size of the buffer, the extra header is copied in - buf. - the return value is the number of bytes copied in buf, or (if <0) - the error code -*/ -int ZEXPORT unzGetLocalExtrafield (unzFile file, voidp buf, unsigned len) -{ - unz64_s* s; - file_in_zip64_read_info_s* pfile_in_zip_read_info; - uInt read_now; - ZPOS64_T size_to_read; - - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz64_s*)file; - pfile_in_zip_read_info=s->pfile_in_zip_read; - - if (pfile_in_zip_read_info==NULL) - return UNZ_PARAMERROR; - - size_to_read = (pfile_in_zip_read_info->size_local_extrafield - - pfile_in_zip_read_info->pos_local_extrafield); - - if (buf==NULL) - return (int)size_to_read; - - if (len>size_to_read) - read_now = (uInt)size_to_read; - else - read_now = (uInt)len ; - - if (read_now==0) - return 0; - - if (ZSEEK64(pfile_in_zip_read_info->z_filefunc, - pfile_in_zip_read_info->filestream, - pfile_in_zip_read_info->offset_local_extrafield + - pfile_in_zip_read_info->pos_local_extrafield, - ZLIB_FILEFUNC_SEEK_SET)!=0) - return UNZ_ERRNO; - - if (ZREAD64(pfile_in_zip_read_info->z_filefunc, - pfile_in_zip_read_info->filestream, - buf,read_now)!=read_now) - return UNZ_ERRNO; - - return (int)read_now; -} - -/* - Close the file in zip opened with unzipOpenCurrentFile - Return UNZ_CRCERROR if all the file was read but the CRC is not good -*/ -int ZEXPORT unzCloseCurrentFile (unzFile file) -{ - int err=UNZ_OK; - - unz64_s* s; - file_in_zip64_read_info_s* pfile_in_zip_read_info; - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz64_s*)file; - pfile_in_zip_read_info=s->pfile_in_zip_read; - - if (pfile_in_zip_read_info==NULL) - return UNZ_PARAMERROR; - - - if ((pfile_in_zip_read_info->rest_read_uncompressed == 0) && - (!pfile_in_zip_read_info->raw)) - { - if (pfile_in_zip_read_info->crc32 != pfile_in_zip_read_info->crc32_wait) - err=UNZ_CRCERROR; - } - - - TRYFREE(pfile_in_zip_read_info->read_buffer); - pfile_in_zip_read_info->read_buffer = NULL; - if (pfile_in_zip_read_info->stream_initialised == Z_DEFLATED) - inflateEnd(&pfile_in_zip_read_info->stream); -#ifdef HAVE_BZIP2 - else if (pfile_in_zip_read_info->stream_initialised == Z_BZIP2ED) - BZ2_bzDecompressEnd(&pfile_in_zip_read_info->bstream); -#endif - - - pfile_in_zip_read_info->stream_initialised = 0; - TRYFREE(pfile_in_zip_read_info); - - s->pfile_in_zip_read=NULL; - - return err; -} - - -/* - Get the global comment string of the ZipFile, in the szComment buffer. - uSizeBuf is the size of the szComment buffer. - return the number of byte copied or an error code <0 -*/ -int ZEXPORT unzGetGlobalComment (unzFile file, char * szComment, uLong uSizeBuf) -{ - unz64_s* s; - uLong uReadThis ; - if (file==NULL) - return (int)UNZ_PARAMERROR; - s=(unz64_s*)file; - - uReadThis = uSizeBuf; - if (uReadThis>s->gi.size_comment) - uReadThis = s->gi.size_comment; - - if (ZSEEK64(s->z_filefunc,s->filestream,s->central_pos+22,ZLIB_FILEFUNC_SEEK_SET)!=0) - return UNZ_ERRNO; - - if (uReadThis>0) - { - *szComment='\0'; - if (ZREAD64(s->z_filefunc,s->filestream,szComment,uReadThis)!=uReadThis) - return UNZ_ERRNO; - } - - if ((szComment != NULL) && (uSizeBuf > s->gi.size_comment)) - *(szComment+s->gi.size_comment)='\0'; - return (int)uReadThis; -} - -/* Additions by RX '2004 */ -ZPOS64_T ZEXPORT unzGetOffset64(unzFile file) -{ - unz64_s* s; - - if (file==NULL) - return 0; //UNZ_PARAMERROR; - s=(unz64_s*)file; - if (!s->current_file_ok) - return 0; - if (s->gi.number_entry != 0 && s->gi.number_entry != 0xffff) - if (s->num_file==s->gi.number_entry) - return 0; - return s->pos_in_central_dir; -} - -uLong ZEXPORT unzGetOffset (unzFile file) -{ - ZPOS64_T offset64; - - if (file==NULL) - return 0; //UNZ_PARAMERROR; - offset64 = unzGetOffset64(file); - return (uLong)offset64; -} - -int ZEXPORT unzSetOffset64(unzFile file, ZPOS64_T pos) -{ - unz64_s* s; - int err; - - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz64_s*)file; - - s->pos_in_central_dir = pos; - s->num_file = s->gi.number_entry; /* hack */ - err = unz64local_GetCurrentFileInfoInternal(file,&s->cur_file_info, - &s->cur_file_info_internal, - NULL,0,NULL,0,NULL,0); - s->current_file_ok = (err == UNZ_OK); - return err; -} - -int ZEXPORT unzSetOffset (unzFile file, uLong pos) -{ - return unzSetOffset64(file,pos); -} - -} // end of namespace cocos2d diff --git a/cocos/2d/support/zip_support/unzip.h b/cocos/2d/support/zip_support/unzip.h deleted file mode 100644 index 54e73a55ea..0000000000 --- a/cocos/2d/support/zip_support/unzip.h +++ /dev/null @@ -1,455 +0,0 @@ -/* unzip.h -- IO for uncompress .zip files using zlib - Version 1.1, February 14h, 2010 - part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) - - Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) - - Modifications of Unzip for Zip64 - Copyright (C) 2007-2008 Even Rouault - - Modifications for Zip64 support on both zip and unzip - Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) - - For more info read MiniZip_info.txt - - --------------------------------------------------------------------------------- - - Condition of use and distribution are the same than zlib : - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - --------------------------------------------------------------------------------- - - Changes - - See header of unzip64.c - -*/ - -#ifndef _unz64_H -#define _unz64_H - -#include "CCPlatformDefine.h" - -#ifndef _ZLIB_H -#include "zlib.h" -#endif - -#ifndef _ZLIBIOAPI_H -#include "ioapi.h" -#endif - -#ifdef HAVE_BZIP2 -#include "bzlib.h" -#endif - -#define Z_BZIP2ED 12 - -#if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP) -/* like the STRICT of WIN32, we define a pointer that cannot be converted - from (void*) without cast */ -typedef struct TagunzFile__ { int unused; } unzFile__; -typedef unzFile__ *unzFile; -#else -typedef voidp unzFile; -#endif - - -#define UNZ_OK (0) -#define UNZ_END_OF_LIST_OF_FILE (-100) -#define UNZ_ERRNO (Z_ERRNO) -#define UNZ_EOF (0) -#define UNZ_PARAMERROR (-102) -#define UNZ_BADZIPFILE (-103) -#define UNZ_INTERNALERROR (-104) -#define UNZ_CRCERROR (-105) - -namespace cocos2d { - -/* tm_unz contain date/time info */ -typedef struct tm_unz_s -{ - uInt tm_sec; /* seconds after the minute - [0,59] */ - uInt tm_min; /* minutes after the hour - [0,59] */ - uInt tm_hour; /* hours since midnight - [0,23] */ - uInt tm_mday; /* day of the month - [1,31] */ - uInt tm_mon; /* months since January - [0,11] */ - uInt tm_year; /* years - [1980..2044] */ -} tm_unz; - -/* unz_global_info structure contain global data about the ZIPfile - These data comes from the end of central dir */ -typedef struct unz_global_info64_s -{ - ZPOS64_T number_entry; /* total number of entries in - the central dir on this disk */ - uLong size_comment; /* size of the global comment of the zipfile */ -} unz_global_info64; - -typedef struct unz_global_info_s -{ - uLong number_entry; /* total number of entries in - the central dir on this disk */ - uLong size_comment; /* size of the global comment of the zipfile */ -} unz_global_info; - -/* unz_file_info contain information about a file in the zipfile */ -typedef struct unz_file_info64_s -{ - uLong version; /* version made by 2 bytes */ - uLong version_needed; /* version needed to extract 2 bytes */ - uLong flag; /* general purpose bit flag 2 bytes */ - uLong compression_method; /* compression method 2 bytes */ - uLong dosDate; /* last mod file date in Dos fmt 4 bytes */ - uLong crc; /* crc-32 4 bytes */ - ZPOS64_T compressed_size; /* compressed size 8 bytes */ - ZPOS64_T uncompressed_size; /* uncompressed size 8 bytes */ - uLong size_filename; /* filename length 2 bytes */ - uLong size_file_extra; /* extra field length 2 bytes */ - uLong size_file_comment; /* file comment length 2 bytes */ - - uLong disk_num_start; /* disk number start 2 bytes */ - uLong internal_fa; /* internal file attributes 2 bytes */ - uLong external_fa; /* external file attributes 4 bytes */ - - tm_unz tmu_date; -} unz_file_info64; - -typedef struct unz_file_info_s -{ - uLong version; /* version made by 2 bytes */ - uLong version_needed; /* version needed to extract 2 bytes */ - uLong flag; /* general purpose bit flag 2 bytes */ - uLong compression_method; /* compression method 2 bytes */ - uLong dosDate; /* last mod file date in Dos fmt 4 bytes */ - uLong crc; /* crc-32 4 bytes */ - uLong compressed_size; /* compressed size 4 bytes */ - uLong uncompressed_size; /* uncompressed size 4 bytes */ - uLong size_filename; /* filename length 2 bytes */ - uLong size_file_extra; /* extra field length 2 bytes */ - uLong size_file_comment; /* file comment length 2 bytes */ - - uLong disk_num_start; /* disk number start 2 bytes */ - uLong internal_fa; /* internal file attributes 2 bytes */ - uLong external_fa; /* external file attributes 4 bytes */ - - tm_unz tmu_date; -} unz_file_info; - -int CC_DLL unzStringFileNameCompare OF ((const char* fileName1, - const char* fileName2, - int iCaseSensitivity)); -/* - Compare two filename (fileName1,fileName2). - If iCaseSenisivity = 1, comparison is case sensitivity (like strcmp) - If iCaseSenisivity = 2, comparison is not case sensitivity (like strcmpi - or strcasecmp) - If iCaseSenisivity = 0, case sensitivity is default of your operating system - (like 1 on Unix, 2 on Windows) -*/ - - -unzFile CC_DLL unzOpen OF((const char *path)); -unzFile CC_DLL unzOpen64 OF((const void *path)); -/* - Open a Zip file. path contain the full pathname (by example, - on a Windows XP computer "c:\\zlib\\zlib113.zip" or on an Unix computer - "zlib/zlib113.zip". - If the zipfile cannot be opened (file don't exist or in not valid), the - return value is NULL. - Else, the return value is a unzFile Handle, usable with other function - of this unzip package. - the "64" function take a const void* pointer, because the path is just the - value passed to the open64_file_func callback. - Under Windows, if UNICODE is defined, using fill_fopen64_filefunc, the path - is a pointer to a wide unicode string (LPCTSTR is LPCWSTR), so const char* - does not describe the reality -*/ - - -unzFile CC_DLL unzOpen2 OF((const char *path, - zlib_filefunc_def* pzlib_filefunc_def)); -/* - Open a Zip file, like unzOpen, but provide a set of file low level API - for read/write the zip file (see ioapi.h) -*/ - -unzFile CC_DLL unzOpen2_64 OF((const void *path, - zlib_filefunc64_def* pzlib_filefunc_def)); -/* - Open a Zip file, like unz64Open, but provide a set of file low level API - for read/write the zip file (see ioapi.h) -*/ - -int CC_DLL unzClose OF((unzFile file)); -/* - Close a ZipFile opened with unzipOpen. - If there is files inside the .Zip opened with unzOpenCurrentFile (see later), - these files MUST be closed with unzipCloseCurrentFile before call unzipClose. - return UNZ_OK if there is no problem. */ - -int CC_DLL unzGetGlobalInfo OF((unzFile file, - unz_global_info *pglobal_info)); - -int CC_DLL unzGetGlobalInfo64 OF((unzFile file, - unz_global_info64 *pglobal_info)); -/* - Write info about the ZipFile in the *pglobal_info structure. - No preparation of the structure is needed - return UNZ_OK if there is no problem. */ - - -int CC_DLL unzGetGlobalComment OF((unzFile file, - char *szComment, - uLong uSizeBuf)); -/* - Get the global comment string of the ZipFile, in the szComment buffer. - uSizeBuf is the size of the szComment buffer. - return the number of byte copied or an error code <0 -*/ - - -/***************************************************************************/ -/* Unzip package allow you browse the directory of the zipfile */ - -int CC_DLL unzGoToFirstFile OF((unzFile file)); - -/* - Set the current file of the zipfile to the first file. - return UNZ_OK if there is no problem -*/ - -int CC_DLL unzGoToFirstFile64 OF((unzFile file, - unz_file_info64 *pfile_info, - char *szFileName, - uLong fileNameBufferSize)); -/* - Set the current file of the zipfile to the first file - with retrieving an information about the file. - return UNZ_OK if there is no problem -*/ - -int CC_DLL unzGoToNextFile OF((unzFile file)); -/* - Set the current file of the zipfile to the next file. - return UNZ_OK if there is no problem - return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest. -*/ - -int CC_DLL unzGoToNextFile64 OF((unzFile file, - unz_file_info64 *pfile_info, - char *szFileName, - uLong fileNameBufferSize)); -/* - Set the current file of the zipfile to the next file - with retrieving an information about the file. - return UNZ_OK if there is no problem - return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest. -*/ - -int CC_DLL unzLocateFile OF((unzFile file, - const char *szFileName, - int iCaseSensitivity)); -/* - Try locate the file szFileName in the zipfile. - For the iCaseSensitivity signification, see unzStringFileNameCompare - - return value : - UNZ_OK if the file is found. It becomes the current file. - UNZ_END_OF_LIST_OF_FILE if the file is not found -*/ - - -/* ****************************************** */ -/* Ryan supplied functions */ -/* unz_file_info contain information about a file in the zipfile */ -typedef struct unz_file_pos_s -{ - uLong pos_in_zip_directory; /* offset in zip file directory */ - uLong num_of_file; /* # of file */ -} unz_file_pos; - -int CC_DLL unzGetFilePos( - unzFile file, - unz_file_pos* file_pos); - -int CC_DLL unzGoToFilePos( - unzFile file, - unz_file_pos* file_pos); - -typedef struct unz64_file_pos_s -{ - ZPOS64_T pos_in_zip_directory; /* offset in zip file directory */ - ZPOS64_T num_of_file; /* # of file */ -} unz64_file_pos; - -int CC_DLL unzGetFilePos64( - unzFile file, - unz64_file_pos* file_pos); - -int CC_DLL unzGoToFilePos64( - unzFile file, - const unz64_file_pos* file_pos); - -/* ****************************************** */ - -int CC_DLL unzGetCurrentFileInfo64 OF((unzFile file, - unz_file_info64 *pfile_info, - char *szFileName, - uLong fileNameBufferSize, - void *extraField, - uLong extraFieldBufferSize, - char *szComment, - uLong commentBufferSize)); - -int CC_DLL unzGetCurrentFileInfo OF((unzFile file, - unz_file_info *pfile_info, - char *szFileName, - uLong fileNameBufferSize, - void *extraField, - uLong extraFieldBufferSize, - char *szComment, - uLong commentBufferSize)); -/* - Get Info about the current file - if pfile_info!=NULL, the *pfile_info structure will contain some info about - the current file - if szFileName!=NULL, the filename string will be copied in szFileName - (fileNameBufferSize is the size of the buffer) - if extraField!=NULL, the extra field information will be copied in extraField - (extraFieldBufferSize is the size of the buffer). - This is the Central-header version of the extra field - if szComment!=NULL, the comment string of the file will be copied in szComment - (commentBufferSize is the size of the buffer) -*/ - - -/** Addition for GDAL : START */ - -ZPOS64_T CC_DLL unzGetCurrentFileZStreamPos64 OF((unzFile file)); - -/** Addition for GDAL : END */ - - -/***************************************************************************/ -/* for reading the content of the current zipfile, you can open it, read data - from it, and close it (you can close it before reading all the file) - */ - -int CC_DLL unzOpenCurrentFile OF((unzFile file)); -/* - Open for reading data the current file in the zipfile. - If there is no error, the return value is UNZ_OK. -*/ - -int CC_DLL unzOpenCurrentFilePassword OF((unzFile file, - const char* password)); -/* - Open for reading data the current file in the zipfile. - password is a crypting password - If there is no error, the return value is UNZ_OK. -*/ - -int CC_DLL unzOpenCurrentFile2 OF((unzFile file, - int* method, - int* level, - int raw)); -/* - Same than unzOpenCurrentFile, but open for read raw the file (not uncompress) - if raw==1 - *method will receive method of compression, *level will receive level of - compression - note : you can set level parameter as NULL (if you did not want known level, - but you CANNOT set method parameter as NULL -*/ - -int CC_DLL unzOpenCurrentFile3 OF((unzFile file, - int* method, - int* level, - int raw, - const char* password)); -/* - Same than unzOpenCurrentFile, but open for read raw the file (not uncompress) - if raw==1 - *method will receive method of compression, *level will receive level of - compression - note : you can set level parameter as NULL (if you did not want known level, - but you CANNOT set method parameter as NULL -*/ - - -int CC_DLL unzCloseCurrentFile OF((unzFile file)); -/* - Close the file in zip opened with unzOpenCurrentFile - Return UNZ_CRCERROR if all the file was read but the CRC is not good -*/ - -int CC_DLL unzReadCurrentFile OF((unzFile file, - voidp buf, - unsigned len)); -/* - Read bytes from the current file (opened by unzOpenCurrentFile) - buf contain buffer where data must be copied - len the size of buf. - - return the number of byte copied if some bytes are copied - return 0 if the end of file was reached - return <0 with error code if there is an error - (UNZ_ERRNO for IO error, or zLib error for uncompress error) -*/ - -z_off_t CC_DLL unztell OF((unzFile file)); - -ZPOS64_T CC_DLL unztell64 OF((unzFile file)); -/* - Give the current position in uncompressed data -*/ - -int CC_DLL unzeof OF((unzFile file)); -/* - return 1 if the end of file was reached, 0 elsewhere -*/ - -int CC_DLL unzGetLocalExtrafield OF((unzFile file, - voidp buf, - unsigned len)); -/* - Read extra field from the current file (opened by unzOpenCurrentFile) - This is the local-header version of the extra field (sometimes, there is - more info in the local-header version than in the central-header) - - if buf==NULL, it return the size of the local extra field - - if buf!=NULL, len is the size of the buffer, the extra header is copied in - buf. - the return value is the number of bytes copied in buf, or (if <0) - the error code -*/ - -/***************************************************************************/ - -/* Get the current file offset */ -ZPOS64_T CC_DLL unzGetOffset64 (unzFile file); -uLong CC_DLL unzGetOffset (unzFile file); - -/* Set the current file offset */ -int CC_DLL unzSetOffset64 (unzFile file, ZPOS64_T pos); -int CC_DLL unzSetOffset (unzFile file, uLong pos); - -} // end of namespace cocos2d - -#endif /* _unz64_H */ diff --git a/cocos/2d/support/data_support/uthash.h b/cocos/2d/uthash.h similarity index 100% rename from cocos/2d/support/data_support/uthash.h rename to cocos/2d/uthash.h diff --git a/cocos/2d/support/data_support/utlist.h b/cocos/2d/utlist.h similarity index 100% rename from cocos/2d/support/data_support/utlist.h rename to cocos/2d/utlist.h diff --git a/cocos/platform/CCPlatformConfig.h b/cocos/platform/CCPlatformConfig.h deleted file mode 100644 index 5ba0757dac..0000000000 --- a/cocos/platform/CCPlatformConfig.h +++ /dev/null @@ -1,140 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010 cocos2d-x.org - -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 __CC_PLATFORM_CONFIG_H__ -#define __CC_PLATFORM_CONFIG_H__ - -/** -Config of cocos2d-x project, per target platform. -*/ - -////////////////////////////////////////////////////////////////////////// -// pre configure -////////////////////////////////////////////////////////////////////////// - -// define supported target platform macro which CC uses. -#define CC_PLATFORM_UNKNOWN 0 -#define CC_PLATFORM_IOS 1 -#define CC_PLATFORM_ANDROID 2 -#define CC_PLATFORM_WIN32 3 -#define CC_PLATFORM_MARMALADE 4 -#define CC_PLATFORM_LINUX 5 -#define CC_PLATFORM_BADA 6 -#define CC_PLATFORM_BLACKBERRY 7 -#define CC_PLATFORM_MAC 8 -#define CC_PLATFORM_NACL 9 -#define CC_PLATFORM_EMSCRIPTEN 10 -#define CC_PLATFORM_TIZEN 11 -#define CC_PLATFORM_QT5 12 - -// Determine target platform by compile environment macro. -#define CC_TARGET_PLATFORM CC_PLATFORM_UNKNOWN - -// mac -#if defined(CC_TARGET_OS_MAC) -#undef CC_TARGET_PLATFORM -#define CC_TARGET_PLATFORM CC_PLATFORM_MAC -#endif - -// iphone -#if defined(CC_TARGET_OS_IPHONE) - #undef CC_TARGET_PLATFORM - #define CC_TARGET_PLATFORM CC_PLATFORM_IOS -#endif - -// android -#if defined(ANDROID) - #undef CC_TARGET_PLATFORM - #define CC_TARGET_PLATFORM CC_PLATFORM_ANDROID -#endif - -// win32 -#if defined(WIN32) && defined(_WINDOWS) - #undef CC_TARGET_PLATFORM - #define CC_TARGET_PLATFORM CC_PLATFORM_WIN32 -#endif - -// linux -#if defined(LINUX) - #undef CC_TARGET_PLATFORM - #define CC_TARGET_PLATFORM CC_PLATFORM_LINUX -#endif - -// marmalade -#if defined(MARMALADE) -#undef CC_TARGET_PLATFORM -#define CC_TARGET_PLATFORM CC_PLATFORM_MARMALADE -#endif - -// bada -#if defined(SHP) -#undef CC_TARGET_PLATFORM -#define CC_TARGET_PLATFORM CC_PLATFORM_BADA -#endif - -// qnx -#if defined(__QNX__) - #undef CC_TARGET_PLATFORM - #define CC_TARGET_PLATFORM CC_PLATFORM_BLACKBERRY -#endif - -// native client -#if defined(__native_client__) - #undef CC_TARGET_PLATFORM - #define CC_TARGET_PLATFORM CC_PLATFORM_NACL -#endif - -// Emscripten -#if defined(EMSCRIPTEN) - #undef CC_TARGET_PLATFORM - #define CC_TARGET_PLATFORM CC_PLATFORM_EMSCRIPTEN -#endif - -// tizen -#if defined(TIZEN) - #undef CC_TARGET_PLATFORM - #define CC_TARGET_PLATFORM CC_PLATFORM_TIZEN -#endif - -// qt5 -#if defined(CC_TARGET_QT5) - #undef CC_TARGET_PLATFORM - #define CC_TARGET_PLATFORM CC_PLATFORM_QT5 -#endif - -////////////////////////////////////////////////////////////////////////// -// post configure -////////////////////////////////////////////////////////////////////////// - -// check user set platform -#if ! CC_TARGET_PLATFORM - #error "Cannot recognize the target platform; are you targeting an unsupported platform?" -#endif - -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) -#pragma warning (disable:4127) -#endif // CC_PLATFORM_WIN32 - -#endif // __CC_PLATFORM_CONFIG_H__ - diff --git a/cocos/platform/CCPlatformMacros.h b/cocos/platform/CCPlatformMacros.h deleted file mode 100644 index fca1255c0d..0000000000 --- a/cocos/platform/CCPlatformMacros.h +++ /dev/null @@ -1,301 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010 cocos2d-x.org - - 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 __CC_PLATFORM_MACROS_H__ -#define __CC_PLATFORM_MACROS_H__ - -/** - * define some platform specific macros - */ -#include "ccConfig.h" -#include "CCPlatformConfig.h" -#include "CCPlatformDefine.h" - -/** - * define a create function for a specific type, such as Layer - * @param \__TYPE__ class type to add create(), such as Layer - */ -#define CREATE_FUNC(__TYPE__) \ -static __TYPE__* create() \ -{ \ - __TYPE__ *pRet = new __TYPE__(); \ - if (pRet && pRet->init()) \ - { \ - pRet->autorelease(); \ - return pRet; \ - } \ - else \ - { \ - delete pRet; \ - pRet = NULL; \ - return NULL; \ - } \ -} - -/** - * define a node function for a specific type, such as Layer - * @param \__TYPE__ class type to add node(), such as Layer - * @deprecated This interface will be deprecated sooner or later. - */ -#define NODE_FUNC(__TYPE__) \ -CC_DEPRECATED_ATTRIBUTE static __TYPE__* node() \ -{ \ - __TYPE__ *pRet = new __TYPE__(); \ - if (pRet && pRet->init()) \ - { \ - pRet->autorelease(); \ - return pRet; \ - } \ - else \ - { \ - delete pRet; \ - pRet = NULL; \ - return NULL; \ - } \ -} - -/** @def CC_ENABLE_CACHE_TEXTURE_DATA -Enable it if you want to cache the texture data. -Not enabling for Emscripten any more -- doesn't seem necessary and don't want -to be different from other platforms unless there's a good reason. - -It's new in cocos2d-x since v0.99.5 -*/ -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) - #define CC_ENABLE_CACHE_TEXTURE_DATA 1 -#else - #define CC_ENABLE_CACHE_TEXTURE_DATA 0 -#endif - -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_EMSCRIPTEN) - /* Application will crash in glDrawElements function on some win32 computers and some android devices. - Indices should be bound again while drawing to avoid this bug. - */ - #define CC_REBIND_INDICES_BUFFER 1 -#else - #define CC_REBIND_INDICES_BUFFER 0 -#endif - -// generic macros - -// namespace cocos2d {} -#ifdef __cplusplus - #define NS_CC_BEGIN namespace cocos2d { - #define NS_CC_END } - #define USING_NS_CC using namespace cocos2d -#else - #define NS_CC_BEGIN - #define NS_CC_END - #define USING_NS_CC -#endif - -/** CC_PROPERTY_READONLY is used to declare a protected variable. - We can use getter to read the variable. - @param varType the type of variable. - @param varName variable name. - @param funName "get + funName" will be the name of the getter. - @warning The getter is a public virtual function, you should rewrite it first. - The variables and methods declared after CC_PROPERTY_READONLY are all public. - If you need protected or private, please declare. - */ -#define CC_PROPERTY_READONLY(varType, varName, funName)\ -protected: varType varName;\ -public: virtual varType get##funName(void) const; - -#define CC_PROPERTY_READONLY_PASS_BY_REF(varType, varName, funName)\ -protected: varType varName;\ -public: virtual const varType& get##funName(void) const; - -/** CC_PROPERTY is used to declare a protected variable. - We can use getter to read the variable, and use the setter to change the variable. - @param varType the type of variable. - @param varName variable name. - @param funName "get + funName" will be the name of the getter. - "set + funName" will be the name of the setter. - @warning The getter and setter are public virtual functions, you should rewrite them first. - The variables and methods declared after CC_PROPERTY are all public. - If you need protected or private, please declare. - */ -#define CC_PROPERTY(varType, varName, funName)\ -protected: varType varName;\ -public: virtual varType get##funName(void);\ -public: virtual void set##funName(varType var); - -#define CC_PROPERTY_PASS_BY_REF(varType, varName, funName)\ -protected: varType varName;\ -public: virtual const varType& get##funName(void) const;\ -public: virtual void set##funName(const varType& var); - -/** CC_SYNTHESIZE_READONLY is used to declare a protected variable. - We can use getter to read the variable. - @param varType the type of variable. - @param varName variable name. - @param funName "get + funName" will be the name of the getter. - @warning The getter is a public inline function. - The variables and methods declared after CC_SYNTHESIZE_READONLY are all public. - If you need protected or private, please declare. - */ -#define CC_SYNTHESIZE_READONLY(varType, varName, funName)\ -protected: varType varName;\ -public: virtual varType get##funName(void) const { return varName; } - -#define CC_SYNTHESIZE_READONLY_PASS_BY_REF(varType, varName, funName)\ -protected: varType varName;\ -public: virtual const varType& get##funName(void) const { return varName; } - -/** CC_SYNTHESIZE is used to declare a protected variable. - We can use getter to read the variable, and use the setter to change the variable. - @param varType the type of variable. - @param varName variable name. - @param funName "get + funName" will be the name of the getter. - "set + funName" will be the name of the setter. - @warning The getter and setter are public inline functions. - The variables and methods declared after CC_SYNTHESIZE are all public. - If you need protected or private, please declare. - */ -#define CC_SYNTHESIZE(varType, varName, funName)\ -protected: varType varName;\ -public: virtual varType get##funName(void) const { return varName; }\ -public: virtual void set##funName(varType var){ varName = var; } - -#define CC_SYNTHESIZE_PASS_BY_REF(varType, varName, funName)\ -protected: varType varName;\ -public: virtual const varType& get##funName(void) const { return varName; }\ -public: virtual void set##funName(const varType& var){ varName = var; } - -#define CC_SYNTHESIZE_RETAIN(varType, varName, funName) \ -private: varType varName; \ -public: virtual varType get##funName(void) const { return varName; } \ -public: virtual void set##funName(varType var) \ -{ \ - if (varName != var) \ - { \ - CC_SAFE_RETAIN(var); \ - CC_SAFE_RELEASE(varName); \ - varName = var; \ - } \ -} - -#define CC_SAFE_DELETE(p) do { delete (p); (p) = nullptr; } while(0) -#define CC_SAFE_DELETE_ARRAY(p) do { if(p) { delete[] (p); (p) = nullptr; } } while(0) -#define CC_SAFE_FREE(p) do { if(p) { free(p); (p) = nullptr; } } while(0) -#define CC_SAFE_RELEASE(p) do { if(p) { (p)->release(); } } while(0) -#define CC_SAFE_RELEASE_NULL(p) do { if(p) { (p)->release(); (p) = nullptr; } } while(0) -#define CC_SAFE_RETAIN(p) do { if(p) { (p)->retain(); } } while(0) -#define CC_BREAK_IF(cond) if(cond) break - -#define __CCLOGWITHFUNCTION(s, ...) \ - log("%s : %s",__FUNCTION__, String::createWithFormat(s, ##__VA_ARGS__)->getCString()) - -// cocos2d debug -#if !defined(COCOS2D_DEBUG) || COCOS2D_DEBUG == 0 -#define CCLOG(...) do {} while (0) -#define CCLOGINFO(...) do {} while (0) -#define CCLOGERROR(...) do {} while (0) -#define CCLOGWARN(...) do {} while (0) - -#elif COCOS2D_DEBUG == 1 -#define CCLOG(format, ...) cocos2d::log(format, ##__VA_ARGS__) -#define CCLOGERROR(format,...) cocos2d::log(format, ##__VA_ARGS__) -#define CCLOGINFO(format,...) do {} while (0) -#define CCLOGWARN(...) __CCLOGWITHFUNCTION(__VA_ARGS__) - -#elif COCOS2D_DEBUG > 1 -#define CCLOG(format, ...) cocos2d::log(format, ##__VA_ARGS__) -#define CCLOGERROR(format,...) cocos2d::log(format, ##__VA_ARGS__) -#define CCLOGINFO(format,...) cocos2d::log(format, ##__VA_ARGS__) -#define CCLOGWARN(...) __CCLOGWITHFUNCTION(__VA_ARGS__) -#endif // COCOS2D_DEBUG - -// Lua engine debug -#if !defined(COCOS2D_DEBUG) || COCOS2D_DEBUG == 0 || CC_LUA_ENGINE_DEBUG == 0 -#define LUALOG(...) -#else -#define LUALOG(format, ...) cocos2d::log(format, ##__VA_ARGS__) -#endif // Lua engine debug - -#if defined(__GNUC__) && ((__GNUC__ >= 5) || ((__GNUG__ == 4) && (__GNUC_MINOR__ >= 4))) \ - || (defined(__clang__) && (__clang_major__ >= 3)) -#define CC_DISABLE_COPY(Class) \ -private: \ - Class(const Class &) = delete; \ - Class &operator =(const Class &) = delete; -#else -#define CC_DISABLE_COPY(Class) \ -private: \ - Class(const Class &); \ - Class &operator =(const Class &); -#endif - -/* - * only certain compilers support __attribute__((deprecated)) - */ -#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1))) - #define CC_DEPRECATED_ATTRIBUTE __attribute__((deprecated)) -#elif _MSC_VER >= 1400 //vs 2005 or higher - #define CC_DEPRECATED_ATTRIBUTE __declspec(deprecated) -#else - #define CC_DEPRECATED_ATTRIBUTE -#endif - -/* - * only certain compiler support __attribute__((format)) - * formatPos - 1-based position of format string argument - * argPos - 1-based position of first format-dependent argument - */ -#if defined(__GNUC__) && (__GNUC__ >= 4) -#define CC_FORMAT_PRINTF(formatPos, argPos) __attribute__((__format__(printf, formatPos, argPos))) -#elif defined(__has_attribute) - #if __has_attribute(format) - #define CC_FORMAT_PRINTF(formatPos, argPos) __attribute__((__format__(printf, formatPos, argPos))) - #endif // __has_attribute(format) -#else -#define CC_FORMAT_PRINTF(formatPos, argPos) -#endif - -#if defined(_MSC_VER) -#define CC_FORMAT_PRINTF_SIZE_T "%08lX" -#else -#define CC_FORMAT_PRINTF_SIZE_T "%08zX" -#endif - -#ifdef __GNUC__ -#define CC_UNUSED __attribute__ ((unused)) -#else -#define CC_UNUSED -#endif - -// -// CC_REQUIRES_NULL_TERMINATION -// -#if !defined(CC_REQUIRES_NULL_TERMINATION) - #if defined(__APPLE_CC__) && (__APPLE_CC__ >= 5549) - #define CC_REQUIRES_NULL_TERMINATION __attribute__((sentinel(0,1))) - #elif defined(__GNUC__) - #define CC_REQUIRES_NULL_TERMINATION __attribute__((sentinel)) - #else - #define CC_REQUIRES_NULL_TERMINATION - #endif -#endif - -#endif // __CC_PLATFORM_MACROS_H__ diff --git a/cocos/platform/cocoa/CCAffineTransform.cpp b/cocos/platform/cocoa/CCAffineTransform.cpp deleted file mode 100644 index 2e39f344cc..0000000000 --- a/cocos/platform/cocoa/CCAffineTransform.cpp +++ /dev/null @@ -1,132 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010 cocos2d-x.org - -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 "CCAffineTransform.h" -#include -#include - -using namespace std; - - -NS_CC_BEGIN - -AffineTransform __CCAffineTransformMake(float a, float b, float c, float d, float tx, float ty) -{ - AffineTransform t; - t.a = a; t.b = b; t.c = c; t.d = d; t.tx = tx; t.ty = ty; - return t; -} - -Point __CCPointApplyAffineTransform(const Point& point, const AffineTransform& t) -{ - Point p; - p.x = (float)((double)t.a * point.x + (double)t.c * point.y + t.tx); - p.y = (float)((double)t.b * point.x + (double)t.d * point.y + t.ty); - return p; -} - -Size __CCSizeApplyAffineTransform(const Size& size, const AffineTransform& t) -{ - Size s; - s.width = (float)((double)t.a * size.width + (double)t.c * size.height); - s.height = (float)((double)t.b * size.width + (double)t.d * size.height); - return s; -} - - -AffineTransform AffineTransformMakeIdentity() -{ - return __CCAffineTransformMake(1.0, 0.0, 0.0, 1.0, 0.0, 0.0); -} - -extern const AffineTransform AffineTransformIdentity = AffineTransformMakeIdentity(); -const AffineTransform AffineTransform::IDENTITY = AffineTransformMakeIdentity(); - -Rect RectApplyAffineTransform(const Rect& rect, const AffineTransform& anAffineTransform) -{ - float top = rect.getMinY(); - float left = rect.getMinX(); - float right = rect.getMaxX(); - float bottom = rect.getMaxY(); - - Point topLeft = PointApplyAffineTransform(Point(left, top), anAffineTransform); - Point topRight = PointApplyAffineTransform(Point(right, top), anAffineTransform); - Point bottomLeft = PointApplyAffineTransform(Point(left, bottom), anAffineTransform); - Point bottomRight = PointApplyAffineTransform(Point(right, bottom), anAffineTransform); - - float minX = min(min(topLeft.x, topRight.x), min(bottomLeft.x, bottomRight.x)); - float maxX = max(max(topLeft.x, topRight.x), max(bottomLeft.x, bottomRight.x)); - float minY = min(min(topLeft.y, topRight.y), min(bottomLeft.y, bottomRight.y)); - float maxY = max(max(topLeft.y, topRight.y), max(bottomLeft.y, bottomRight.y)); - - return Rect(minX, minY, (maxX - minX), (maxY - minY)); -} - -AffineTransform AffineTransformTranslate(const AffineTransform& t, float tx, float ty) -{ - return __CCAffineTransformMake(t.a, t.b, t.c, t.d, t.tx + t.a * tx + t.c * ty, t.ty + t.b * tx + t.d * ty); -} - -AffineTransform AffineTransformScale(const AffineTransform& t, float sx, float sy) -{ - return __CCAffineTransformMake(t.a * sx, t.b * sx, t.c * sy, t.d * sy, t.tx, t.ty); -} - -AffineTransform AffineTransformRotate(const AffineTransform& t, float anAngle) -{ - float sine = sinf(anAngle); - float cosine = cosf(anAngle); - - return __CCAffineTransformMake( t.a * cosine + t.c * sine, - t.b * cosine + t.d * sine, - t.c * cosine - t.a * sine, - t.d * cosine - t.b * sine, - t.tx, - t.ty); -} - -/* Concatenate `t2' to `t1' and return the result: - t' = t1 * t2 */ -AffineTransform AffineTransformConcat(const AffineTransform& t1, const AffineTransform& t2) -{ - return __CCAffineTransformMake( t1.a * t2.a + t1.b * t2.c, t1.a * t2.b + t1.b * t2.d, //a,b - t1.c * t2.a + t1.d * t2.c, t1.c * t2.b + t1.d * t2.d, //c,d - t1.tx * t2.a + t1.ty * t2.c + t2.tx, //tx - t1.tx * t2.b + t1.ty * t2.d + t2.ty); //ty -} - -/* Return true if `t1' and `t2' are equal, false otherwise. */ -bool AffineTransformEqualToTransform(const AffineTransform& t1, const AffineTransform& t2) -{ - return (t1.a == t2.a && t1.b == t2.b && t1.c == t2.c && t1.d == t2.d && t1.tx == t2.tx && t1.ty == t2.ty); -} - -AffineTransform AffineTransformInvert(const AffineTransform& t) -{ - float determinant = 1 / (t.a * t.d - t.b * t.c); - - return __CCAffineTransformMake(determinant * t.d, -determinant * t.b, -determinant * t.c, determinant * t.a, - determinant * (t.c * t.ty - t.d * t.tx), determinant * (t.b * t.tx - t.a * t.ty) ); -} - -NS_CC_END diff --git a/cocos/platform/cocoa/CCAffineTransform.h b/cocos/platform/cocoa/CCAffineTransform.h deleted file mode 100644 index 667b5d9b46..0000000000 --- a/cocos/platform/cocoa/CCAffineTransform.h +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010 cocos2d-x.org - -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 __COCOA_CGAFFINETRANSFORM_H__ -#define __COCOA_CGAFFINETRANSFORM_H__ - -#include "CCGeometry.h" -#include "platform/CCPlatformMacros.h" - -NS_CC_BEGIN - -struct AffineTransform { - float a, b, c, d; - float tx, ty; - - static const AffineTransform IDENTITY; -}; - -CC_DLL AffineTransform __CCAffineTransformMake(float a, float b, float c, float d, float tx, float ty); -#define AffineTransformMake __CCAffineTransformMake - -CC_DLL Point __CCPointApplyAffineTransform(const Point& point, const AffineTransform& t); -#define PointApplyAffineTransform __CCPointApplyAffineTransform - -CC_DLL Size __CCSizeApplyAffineTransform(const Size& size, const AffineTransform& t); -#define SizeApplyAffineTransform __CCSizeApplyAffineTransform - -CC_DLL AffineTransform AffineTransformMakeIdentity(); -CC_DLL Rect RectApplyAffineTransform(const Rect& rect, const AffineTransform& anAffineTransform); - -CC_DLL AffineTransform AffineTransformTranslate(const AffineTransform& t, float tx, float ty); -CC_DLL AffineTransform AffineTransformRotate(const AffineTransform& aTransform, float anAngle); -CC_DLL AffineTransform AffineTransformScale(const AffineTransform& t, float sx, float sy); -CC_DLL AffineTransform AffineTransformConcat(const AffineTransform& t1, const AffineTransform& t2); -CC_DLL bool AffineTransformEqualToTransform(const AffineTransform& t1, const AffineTransform& t2); -CC_DLL AffineTransform AffineTransformInvert(const AffineTransform& t); - -extern CC_DLL const AffineTransform AffineTransformIdentity; - -NS_CC_END - -#endif // __COCOA_CGAFFINETRANSFORM_H__ diff --git a/cocos/platform/cocoa/CCArray.cpp b/cocos/platform/cocoa/CCArray.cpp deleted file mode 100644 index 3a55d6050d..0000000000 --- a/cocos/platform/cocoa/CCArray.cpp +++ /dev/null @@ -1,754 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010 ForzeField Studios S.L. http://forzefield.com -Copyright (c) 2010 cocos2d-x.org - -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 "CCArray.h" -#include "CCString.h" -#include "platform/CCFileUtils.h" - -NS_CC_BEGIN - - -#if CC_USE_ARRAY_VECTOR - -// ---------------------------------------------------------------------------------- -// std::vector implementation -// ---------------------------------------------------------------------------------- - -Array::Array() -: data(NULL) -{ - init(); -} - -Array* Array::create() -{ - Array* array = new Array(); - - if (array && array->initWithCapacity(7)) - { - array->autorelease(); - } - else - { - CC_SAFE_DELETE(array); - } - - return array; -} - -Array* Array::createWithObject(Object* object) -{ - Array* array = new Array(); - - if (array && array->initWithObject(object)) - { - array->autorelease(); - } - else - { - CC_SAFE_DELETE(array); - } - - return array; -} - -Array* Array::create(Object* object, ...) -{ - va_list args; - va_start(args,object); - - Array* array = create(); - if (array && object) - { - array->addObject(object); - Object *i = va_arg(args, Object*); - while (i) - { - array->addObject(i); - i = va_arg(args, Object*); - } - } - else - { - CC_SAFE_DELETE(array); - } - - va_end(args); - - return array; -} - -Array* Array::createWithArray(Array* otherArray) -{ - return otherArray->clone(); -} - -Array* Array::createWithCapacity(int capacity) -{ - CCASSERT(capacity>=0, "Invalid capacity"); - - Array* array = new Array(); - - if (array && array->initWithCapacity(capacity)) - { - array->autorelease(); - } - else - { - CC_SAFE_DELETE(array); - } - - return array; -} - -Array* Array::createWithContentsOfFile(const char* fileName) -{ - Array* ret = Array::createWithContentsOfFileThreadSafe(fileName); - if (ret != nullptr) - { - ret->autorelease(); - } - return ret; -} - -Array* Array::createWithContentsOfFileThreadSafe(const char* fileName) -{ - return FileUtils::getInstance()->createArrayWithContentsOfFile(fileName); -} - -bool Array::init() -{ - return initWithCapacity(7); -} - -bool Array::initWithObject(Object* object) -{ - bool ret = initWithCapacity(7); - if (ret) - { - addObject(object); - } - return ret; -} - -/** Initializes an array with some objects */ -bool Array::initWithObjects(Object* object, ...) -{ - bool ret = false; - do - { - CC_BREAK_IF(object == nullptr); - - va_list args; - va_start(args, object); - - if (object) - { - this->addObject(object); - Object* i = va_arg(args, Object*); - while (i) - { - this->addObject(i); - i = va_arg(args, Object*); - } - ret = true; - } - va_end(args); - - } while (false); - - return ret; -} - -bool Array::initWithCapacity(int capacity) -{ - CCASSERT(capacity>=0, "Invalid capacity"); - - data.reserve(capacity); - return true; -} - -bool Array::initWithArray(Array* otherArray) -{ - data = otherArray->data; - return true; -} - -int Array::getIndexOfObject(Object* object) const -{ - auto it = data.begin(); - - for (int i = 0; it != data.end(); ++it, ++i) - { - if (it->get() == object) - { - return i; - } - } - - return -1; -} - -Object* Array::getRandomObject() -{ - if (data.size()==0) - { - return nullptr; - } - - float r = CCRANDOM_0_1(); - - if (r == 1) // to prevent from accessing data-arr[data->num], out of range. - { - r = 0; - } - - r *= data.size(); - - return data[r].get(); -} - -bool Array::containsObject(Object* object) const -{ - int i = this->getIndexOfObject(object); - return (i >=0); -} - -bool Array::isEqualToArray(Array* otherArray) -{ - for (int i = 0; i< this->count(); i++) - { - if (!this->getObjectAtIndex(i)->isEqual(otherArray->getObjectAtIndex(i))) - { - return false; - } - } - return true; -} - -void Array::addObject(Object* object) -{ - data.push_back( RCPtr(object) ); -} - -void Array::addObjectsFromArray(Array* otherArray) -{ - data.insert(data.end(), otherArray->data.begin(), otherArray->data.end()); -} - -void Array::insertObject(Object* object, int index) -{ - data.insert( std::begin(data) + index, RCPtr(object) ); -} - -void Array::setObject(Object* object, int index) -{ - data[index] = RCPtr(object); -} - -void Array::removeLastObject(bool releaseObj) -{ - CCASSERT(data.size(), "no objects added"); - data.pop_back(); -} - -void Array::removeObject(Object* object, bool releaseObj /* ignored */) -{ - data.erase( std::remove( data.begin(), data.end(), object ) ); -} - -void Array::removeObjectAtIndex(int index, bool releaseObj /* ignored */) -{ - auto obj = data[index]; - data.erase( data.begin() + index ); -} - -void Array::removeObjectsInArray(Array* otherArray) -{ - CCASSERT(false, "not implemented"); -} - -void Array::removeAllObjects() -{ - data.erase(std::begin(data), std::end(data)); -} - -void Array::fastRemoveObjectAtIndex(int index) -{ - removeObjectAtIndex(index); -} - -void Array::fastRemoveObject(Object* object) -{ - removeObject(object); -} - -void Array::exchangeObject(Object* object1, Object* object2) -{ - int idx1 = getIndexOfObject(object1); - int idx2 = getIndexOfObject(object2); - - CCASSERT(idx1>=0 && idx2>=2, "invalid object index"); - - std::swap( data[idx1], data[idx2] ); -} - -void Array::exchangeObjectAtIndex(int index1, int index2) -{ - std::swap( data[index1], data[index2] ); -} - -void Array::replaceObjectAtIndex(int index, Object* object, bool releaseObject /* ignored */) -{ - data[index] = object; -} - -void Array::reverseObjects() -{ - std::reverse( std::begin(data), std::end(data) ); -} - -void Array::reduceMemoryFootprint() -{ - // N/A -} - -Array::~Array() -{ - CCLOGINFO("deallocing Array: %p - len: %d", this, count() ); -} - -Array* Array::clone() const -{ - Array* ret = new Array(); - ret->autorelease(); - ret->initWithCapacity(this->data.size() > 0 ? this->data.size() : 1); - - Object* obj = nullptr; - Object* tmpObj = nullptr; - Clonable* clonable = nullptr; - CCARRAY_FOREACH(this, obj) - { - clonable = dynamic_cast(obj); - if (clonable) - { - tmpObj = dynamic_cast(clonable->clone()); - if (tmpObj) - { - ret->addObject(tmpObj); - } - } - else - { - CCLOGWARN("%s isn't clonable.", typeid(*obj).name()); - } - } - return ret; -} - -void Array::acceptVisitor(DataVisitor &visitor) -{ - visitor.visit(this); -} - -// ---------------------------------------------------------------------------------- -// ccArray implementation -// ---------------------------------------------------------------------------------- - -#else - -Array::Array() -: data(nullptr) -{ -// init(); -} - -Array* Array::create() -{ - Array* array = new Array(); - - if (array && array->initWithCapacity(7)) - { - array->autorelease(); - } - else - { - CC_SAFE_DELETE(array); - } - - return array; -} - -Array* Array::createWithObject(Object* object) -{ - Array* array = new Array(); - - if (array && array->initWithObject(object)) - { - array->autorelease(); - } - else - { - CC_SAFE_DELETE(array); - } - - return array; -} - -Array* Array::create(Object* object, ...) -{ - va_list args; - va_start(args,object); - - Array* array = create(); - if (array && object) - { - array->addObject(object); - Object *i = va_arg(args, Object*); - while (i) - { - array->addObject(i); - i = va_arg(args, Object*); - } - } - else - { - CC_SAFE_DELETE(array); - } - - va_end(args); - - return array; -} - -Array* Array::createWithArray(Array* otherArray) -{ - return otherArray->clone(); -} - -Array* Array::createWithCapacity(int capacity) -{ - CCASSERT(capacity>=0, "Invalid capacity"); - - Array* array = new Array(); - - if (array && array->initWithCapacity(capacity)) - { - array->autorelease(); - } - else - { - CC_SAFE_DELETE(array); - } - - return array; -} - -Array* Array::createWithContentsOfFile(const char* fileName) -{ - Array* ret = Array::createWithContentsOfFileThreadSafe(fileName); - if (ret != nullptr) - { - ret->autorelease(); - } - return ret; -} - -Array* Array::createWithContentsOfFileThreadSafe(const char* fileName) -{ - return FileUtils::getInstance()->createArrayWithContentsOfFile(fileName); -} - -bool Array::init() -{ - CCASSERT(!data, "Array cannot be re-initialized"); - - return initWithCapacity(7); -} - -bool Array::initWithObject(Object* object) -{ - CCASSERT(!data, "Array cannot be re-initialized"); - - bool ret = initWithCapacity(7); - if (ret) - { - addObject(object); - } - return ret; -} - -/** Initializes an array with some objects */ -bool Array::initWithObjects(Object* object, ...) -{ - CCASSERT(!data, "Array cannot be re-initialized"); - - bool ret = false; - do - { - CC_BREAK_IF(object == nullptr); - - va_list args; - va_start(args, object); - - if (object) - { - this->addObject(object); - Object* i = va_arg(args, Object*); - while (i) - { - this->addObject(i); - i = va_arg(args, Object*); - } - ret = true; - } - va_end(args); - - } while (false); - - return ret; -} - -bool Array::initWithCapacity(int capacity) -{ - CCASSERT(capacity>=0 && !data, "Array cannot be re-initialized"); - - data = ccArrayNew(capacity); - return true; -} - -bool Array::initWithArray(Array* otherArray) -{ - CCASSERT(!data, "Array cannot be re-initialized"); - - bool ret = false; - do - { - CC_BREAK_IF(! initWithCapacity(otherArray->data->num)); - - addObjectsFromArray(otherArray); - ret = true; - } while (0); - - return ret; -} - -int Array::getIndexOfObject(Object* object) const -{ - return ccArrayGetIndexOfObject(data, object); -} - -Object* Array::getRandomObject() -{ - if (data->num == 0) - { - return nullptr; - } - - float r = CCRANDOM_0_1(); - - if (r == 1) // to prevent from accessing data-arr[data->num], out of range. - { - r = 0; - } - - return data->arr[(int)(data->num * r)]; -} - -bool Array::containsObject(Object* object) const -{ - return ccArrayContainsObject(data, object); -} - -bool Array::isEqualToArray(Array* otherArray) -{ - for (int i = 0; i< this->count(); i++) - { - if (!this->getObjectAtIndex(i)->isEqual(otherArray->getObjectAtIndex(i))) - { - return false; - } - } - return true; -} - -void Array::addObject(Object* object) -{ - CCASSERT(data, "Array not initialized"); - ccArrayAppendObjectWithResize(data, object); -} - -void Array::addObjectsFromArray(Array* otherArray) -{ - CCASSERT(data, "Array not initialized"); - ccArrayAppendArrayWithResize(data, otherArray->data); -} - -void Array::insertObject(Object* object, int index) -{ - CCASSERT(data, "Array not initialized"); - ccArrayInsertObjectAtIndex(data, object, index); -} - -void Array::setObject(Object* object, int index) -{ - CCASSERT(index>=0 && index < count(), "Invalid index"); - - if (object != data->arr[index]) - { - data->arr[index]->release(); - data->arr[index] = object; - object->retain(); - } -} - -void Array::removeLastObject(bool releaseObj) -{ - CCASSERT(data->num, "no objects added"); - ccArrayRemoveObjectAtIndex(data, data->num-1, releaseObj); -} - -void Array::removeObject(Object* object, bool releaseObj/* = true*/) -{ - ccArrayRemoveObject(data, object, releaseObj); -} - -void Array::removeObjectAtIndex(int index, bool releaseObj) -{ - ccArrayRemoveObjectAtIndex(data, index, releaseObj); -} - -void Array::removeObjectsInArray(Array* otherArray) -{ - ccArrayRemoveArray(data, otherArray->data); -} - -void Array::removeAllObjects() -{ - ccArrayRemoveAllObjects(data); -} - -void Array::fastRemoveObjectAtIndex(int index) -{ - ccArrayFastRemoveObjectAtIndex(data, index); -} - -void Array::fastRemoveObject(Object* object) -{ - ccArrayFastRemoveObject(data, object); -} - -void Array::exchangeObject(Object* object1, Object* object2) -{ - int index1 = ccArrayGetIndexOfObject(data, object1); - if (index1 == UINT_MAX) - { - return; - } - - int index2 = ccArrayGetIndexOfObject(data, object2); - if (index2 == UINT_MAX) - { - return; - } - - ccArraySwapObjectsAtIndexes(data, index1, index2); -} - -void Array::exchangeObjectAtIndex(int index1, int index2) -{ - ccArraySwapObjectsAtIndexes(data, index1, index2); -} - -void Array::replaceObjectAtIndex(int index, Object* object, bool releaseObject/* = true*/) -{ - ccArrayInsertObjectAtIndex(data, object, index); - ccArrayRemoveObjectAtIndex(data, index+1); -} - -void Array::reverseObjects() -{ - if (data->num > 1) - { - // floorf(), since in the case of an even number, the number of swaps stays the same - int count = (int) floorf(data->num/2.f); - int maxIndex = data->num - 1; - - for (int i = 0; i < count ; i++) - { - ccArraySwapObjectsAtIndexes(data, i, maxIndex); - --maxIndex; - } - } -} - -void Array::reduceMemoryFootprint() -{ - ccArrayShrink(data); -} - -Array::~Array() -{ - CCLOGINFO("deallocing Array: %p - len: %d", this, count() ); - - ccArrayFree(data); -} - -Array* Array::clone() const -{ - Array* ret = new Array(); - ret->autorelease(); - ret->initWithCapacity(this->data->num > 0 ? this->data->num : 1); - - Object* obj = nullptr; - Object* tmpObj = nullptr; - Clonable* clonable = nullptr; - CCARRAY_FOREACH(this, obj) - { - clonable = dynamic_cast(obj); - if (clonable) - { - tmpObj = dynamic_cast(clonable->clone()); - if (tmpObj) - { - ret->addObject(tmpObj); - } - } - else - { - CCLOGWARN("%s isn't clonable.", typeid(*obj).name()); - } - } - return ret; -} - -void Array::acceptVisitor(DataVisitor &visitor) -{ - visitor.visit(this); -} - -#endif // uses ccArray - -NS_CC_END diff --git a/cocos/platform/cocoa/CCArray.h b/cocos/platform/cocoa/CCArray.h deleted file mode 100644 index 4f5beea501..0000000000 --- a/cocos/platform/cocoa/CCArray.h +++ /dev/null @@ -1,557 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010 ForzeField Studios S.L. http://forzefield.com -Copyright (c) 2010 cocos2d-x.org - -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 __CCARRAY_H__ -#define __CCARRAY_H__ - -#define CC_USE_ARRAY_VECTOR 0 - -#if CC_USE_ARRAY_VECTOR -#include -#include -#include "cocoa/CCObject.h" -#include "ccMacros.h" -#else -#include "support/data_support/ccCArray.h" -#endif - - -#if CC_USE_ARRAY_VECTOR -/** - * A reference counting-managed pointer for classes derived from RCBase which can - * be used as C pointer - * Original code: http://www.codeproject.com/Articles/64111/Building-a-Quick-and-Handy-Reference-Counting-Clas - * License: http://www.codeproject.com/info/cpol10.aspx - */ -template < class T > -class RCPtr -{ -public: - //Construct using a C pointer - //e.g. RCPtr< T > x = new T(); - RCPtr(T* ptr = nullptr) - : _ptr(ptr) - { - if(ptr != nullptr) {ptr->retain();} - } - - //Copy constructor - RCPtr(const RCPtr &ptr) - : _ptr(ptr._ptr) - { -// printf("Array: copy constructor: %p\n", this); - if(_ptr != NULL) {_ptr->retain();} - } - - //Move constructor - RCPtr(RCPtr &&ptr) - : _ptr(ptr._ptr) - { -// printf("Array: Move Constructor: %p\n", this); - ptr._ptr = nullptr; - } - - ~RCPtr() - { -// printf("Array: Destructor: %p\n", this); - if(_ptr != nullptr) {_ptr->release();} - } - - //Assign a pointer - //e.g. x = new T(); - RCPtr &operator=(T* ptr) - { -// printf("Array: operator= T*: %p\n", this); - - //The following grab and release operations have to be performed - //in that order to handle the case where ptr == _ptr - //(See comment below by David Garlisch) - if(ptr != nullptr) {ptr->retain();} - if(_ptr != nullptr) {_ptr->release();} - _ptr = ptr; - return (*this); - } - - //Assign another RCPtr - RCPtr &operator=(const RCPtr &ptr) - { -// printf("Array: operator= const&: %p\n", this); - return (*this) = ptr._ptr; - } - - //Retrieve actual pointer - T* get() const - { - return _ptr; - } - - //Some overloaded operators to facilitate dealing with an RCPtr - //as a conventional C pointer. - //Without these operators, one can still use the less transparent - //get() method to access the pointer. - T* operator->() const {return _ptr;} //x->member - T &operator*() const {return *_ptr;} //*x, (*x).member - explicit operator T*() const {return _ptr;} //T* y = x; - explicit operator bool() const {return _ptr != nullptr;} //if(x) {/*x is not NULL*/} - bool operator==(const RCPtr &ptr) {return _ptr == ptr._ptr;} - bool operator==(const T *ptr) {return _ptr == ptr;} - -private: - T *_ptr; //Actual pointer -}; -#endif // CC_USE_ARRAY_VECTOR - - -/** - * @addtogroup data_structures - * @{ - */ - -/** @def CCARRAY_FOREACH -A convenience macro to iterate over a Array using. It is faster than the "fast enumeration" interface. -@since v0.99.4 -*/ - -/* -In cocos2d-iphone 1.0.0, This macro have been update to like this: - -#define CCARRAY_FOREACH(__array__, __object__) \ -if (__array__ && __array__->data->num > 0) \ -for(id *__arr__ = __array__->data->arr, *end = __array__->data->arr + __array__->data->num-1; \ -__arr__ <= end && ((__object__ = *__arr__) != nil || true); \ -__arr__++) - -I found that it's not work in C++. So it keep what it's look like in version 1.0.0-rc3. ---By Bin -*/ - -#if CC_USE_ARRAY_VECTOR -#define CCARRAY_FOREACH(__array__, __object__) \ - if (__array__) \ - for( auto __it__ = (__array__)->data.begin(); \ - __it__ != (__array__)->data.end() && ((__object__) = __it__->get()) != nullptr; \ - ++__it__) - - -#define CCARRAY_FOREACH_REVERSE(__array__, __object__) \ - if (__array__) \ - for( auto __it__ = (__array__)->data.rbegin(); \ - __it__ != (__array__)->data.rend() && ((__object__) = __it__->get()) != nullptr; \ - ++__it__ ) - - -#define CCARRAY_VERIFY_TYPE(__array__, __type__) void(0) - -#else // ! CC_USE_ARRAY_VECTOR -------------------------- - -#define CCARRAY_FOREACH(__array__, __object__) \ - if ((__array__) && (__array__)->data->num > 0) \ - for(Object** __arr__ = (__array__)->data->arr, **__end__ = (__array__)->data->arr + (__array__)->data->num-1; \ - __arr__ <= __end__ && (((__object__) = *__arr__) != NULL/* || true*/); \ - __arr__++) - -#define CCARRAY_FOREACH_REVERSE(__array__, __object__) \ - if ((__array__) && (__array__)->data->num > 0) \ - for(Object** __arr__ = (__array__)->data->arr + (__array__)->data->num-1, **__end__ = (__array__)->data->arr; \ - __arr__ >= __end__ && (((__object__) = *__arr__) != NULL/* || true*/); \ - __arr__--) - -#if defined(COCOS2D_DEBUG) && (COCOS2D_DEBUG > 0) -#define CCARRAY_VERIFY_TYPE(__array__, __type__) \ - do { \ - if ((__array__) && (__array__)->data->num > 0) \ - for(Object** __arr__ = (__array__)->data->arr, \ - **__end__ = (__array__)->data->arr + (__array__)->data->num-1; __arr__ <= __end__; __arr__++) \ - CCASSERT(dynamic_cast<__type__>(*__arr__), "element type is wrong!"); \ - } while(false) -#else -#define CCARRAY_VERIFY_TYPE(__array__, __type__) void(0) -#endif - -#endif // ! CC_USE_ARRAY_VECTOR - - -// Common defines ----------------------------------------------------------------------------------------------- - -#define arrayMakeObjectsPerformSelector(pArray, func, elementType) \ -do { \ - if(pArray && pArray->count() > 0) \ - { \ - Object* child; \ - CCARRAY_FOREACH(pArray, child) \ - { \ - elementType pNode = static_cast(child); \ - if(pNode) \ - { \ - pNode->func(); \ - } \ - } \ - } \ -} \ -while(false) - -#define arrayMakeObjectsPerformSelectorWithObject(pArray, func, object, elementType) \ -do { \ - if(pArray && pArray->count() > 0) \ - { \ - Object* child; \ - CCARRAY_FOREACH(pArray, child) \ - { \ - elementType pNode = static_cast(child); \ - if(pNode) \ - { \ - pNode->func(object); \ - } \ - } \ - } \ -} \ -while(false) - - -NS_CC_BEGIN - -class CC_DLL Array : public Object, public Clonable -{ -public: - - /** Creates an empty array. Default capacity is 10 - * @js NA - * @lua NA - */ - static Array* create(); - /** Create an array with objects - * @js NA - */ - static Array* create(Object* object, ...) CC_REQUIRES_NULL_TERMINATION; - /** Create an array with one object - * @js NA - */ - static Array* createWithObject(Object* object); - /** Create an array with a default capacity - * @js NA - */ - static Array* createWithCapacity(int capacity); - /** Create an array with from an existing array - * @js NA - */ - static Array* createWithArray(Array* otherArray); - /** - @brief Generate a Array pointer by file - @param pFileName The file name of *.plist file - @return The Array pointer generated from the file - * @js NA - */ - static Array* createWithContentsOfFile(const char* pFileName); - - /* - @brief The same meaning as arrayWithContentsOfFile(), but it doesn't call autorelease, so the - invoker should call release(). - * @js NA - * @lua NA - */ - static Array* createWithContentsOfFileThreadSafe(const char* pFileName); - /** - * @js NA - * @lua NA - */ - ~Array(); - - /** Initializes an array - * @js NA - * @lua NA - */ - bool init(); - /** Initializes an array with one object - * @js NA - * @lua NA - */ - bool initWithObject(Object* object); - /** Initializes an array with some objects - * @js NA - * @lua NA - */ - bool initWithObjects(Object* object, ...) CC_REQUIRES_NULL_TERMINATION; - /** Initializes an array with capacity - * @js NA - * @lua NA - */ - bool initWithCapacity(int capacity); - /** Initializes an array with an existing array - * @js NA - * @lua NA - */ - bool initWithArray(Array* otherArray); - - // Querying an Array - - /** Returns element count of the array - * @js NA - */ - int count() const - { -#if CC_USE_ARRAY_VECTOR - return data.size(); -#else - return data->num; -#endif - } - /** Returns capacity of the array - * @js NA - */ - int capacity() const - { -#if CC_USE_ARRAY_VECTOR - return data.capacity(); -#else - return data->max; -#endif - } - /** Returns index of a certain object, return UINT_MAX if doesn't contain the object - * @js NA - * @lua NA - */ - int getIndexOfObject(Object* object) const; - /** - * @js NA - */ - CC_DEPRECATED_ATTRIBUTE int indexOfObject(Object* object) const { return getIndexOfObject(object); } - - /** Returns an element with a certain index - * @js NA - * @lua NA - */ - Object* getObjectAtIndex(int index) - { - CCASSERT(index>=0 && index < count(), "index out of range in getObjectAtIndex()"); -#if CC_USE_ARRAY_VECTOR - return data[index].get(); -#else - return data->arr[index]; -#endif - } - CC_DEPRECATED_ATTRIBUTE Object* objectAtIndex(int index) { return getObjectAtIndex(index); } - /** Returns the last element of the array - * @js NA - */ - Object* getLastObject() - { -#if CC_USE_ARRAY_VECTOR - return data.back().get(); -#else - if(data->num > 0) - return data->arr[data->num-1]; - - return nullptr; -#endif - } - /** - * @js NA - */ - CC_DEPRECATED_ATTRIBUTE Object* lastObject() { return getLastObject(); } - /** Returns a random element - * @js NA - * @lua NA - */ - Object* getRandomObject(); - /** - * @js NA - */ - CC_DEPRECATED_ATTRIBUTE Object* randomObject() { return getRandomObject(); } - /** Returns a Boolean value that indicates whether object is present in array. - * @js NA - */ - bool containsObject(Object* object) const; - /** @since 1.1 - * @js NA - */ - bool isEqualToArray(Array* otherArray); - // Adding Objects - - /** Add a certain object - * @js NA - */ - void addObject(Object* object); - /** - * @js NA - */ - /** Add all elements of an existing array - * @js NA - */ - void addObjectsFromArray(Array* otherArray); - /** Insert a certain object at a certain index - * @js NA - */ - void insertObject(Object* object, int index); - /** sets a certain object at a certain index - * @js NA - * @lua NA - */ - void setObject(Object* object, int index); - /** sets a certain object at a certain index without retaining. Use it with caution - * @js NA - * @lua NA - */ - void fastSetObject(Object* object, int index) - { -#if CC_USE_ARRAY_VECTOR - setObject(object, index); -#else - // no retain - data->arr[index] = object; -#endif - } - /** - * @js NA - * @lua NA - */ - void swap( int indexOne, int indexTwo ) - { - CCASSERT(indexOne >=0 && indexOne < count() && indexTwo >= 0 && indexTwo < count(), "Invalid indices"); -#if CC_USE_ARRAY_VECTOR - std::swap(data[indexOne], data[indexTwo]); -#else - std::swap(data->arr[indexOne], data->arr[indexTwo]); -#endif - } - - // Removing Objects - - /** Remove last object - * @js NA - */ - void removeLastObject(bool releaseObj = true); - /** Remove a certain object - * @js NA - */ - void removeObject(Object* object, bool releaseObj = true); - /** Remove an element with a certain index - * @js NA - */ - void removeObjectAtIndex(int index, bool releaseObj = true); - /** Remove all elements - * @js NA - */ - void removeObjectsInArray(Array* otherArray); - /** Remove all objects - * @js NA - */ - void removeAllObjects(); - /** Fast way to remove a certain object - * @js NA - */ - void fastRemoveObject(Object* object); - /** Fast way to remove an element with a certain index - * @js NA - */ - void fastRemoveObjectAtIndex(int index); - - // Rearranging Content - - /** Swap two elements - * @js NA - */ - void exchangeObject(Object* object1, Object* object2); - /** Swap two elements with certain indexes - * @js NA - */ - void exchangeObjectAtIndex(int index1, int index2); - - /** Replace object at index with another object. - * @js NA - */ - void replaceObjectAtIndex(int index, Object* object, bool releaseObject = true); - - /** Revers the array - * @js NA - */ - void reverseObjects(); - /* Shrinks the array so the memory footprint corresponds with the number of items - * @js NA - */ - void reduceMemoryFootprint(); - - /* override functions - * @js NA - */ - virtual void acceptVisitor(DataVisitor &visitor); - /** - * @js NA - * @lua NA - */ - virtual Array* clone() const; - - // ------------------------------------------ - // Iterators - // ------------------------------------------ -#if CC_USE_ARRAY_VECTOR - typedef std::vector>::iterator iterator; - typedef std::vector>::const_iterator const_iterator; - /** - * @js NA - * @lua NA - */ - iterator begin() { return data.begin(); } - /** - * @js NA - * @lua NA - */ - iterator end() { return data.end(); } - const_iterator cbegin() { return data.cbegin(); } - /** - * @js NA - * @lua NA - */ - const_iterator cend() { return data.cend(); } - - std::vector> data; - -#else - /** - * @js NA - * @lua NA - */ - Object** begin() { return &data->arr[0]; } - /** - * @js NA - * @lua NA - */ - Object** end() { return &data->arr[data->num]; } - - ccArray* data; - -#endif - -//protected: - /** - * @js NA - * @lua NA - */ - Array(); -}; - -// end of data_structure group -/// @} - -NS_CC_END - -#endif // __CCARRAY_H__ diff --git a/cocos/platform/cocoa/CCAutoreleasePool.cpp b/cocos/platform/cocoa/CCAutoreleasePool.cpp deleted file mode 100644 index 89a3528f73..0000000000 --- a/cocos/platform/cocoa/CCAutoreleasePool.cpp +++ /dev/null @@ -1,204 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010 cocos2d-x.org - -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 "CCAutoreleasePool.h" -#include "ccMacros.h" - -NS_CC_BEGIN - -static PoolManager* s_pPoolManager = NULL; - -AutoreleasePool::AutoreleasePool() -{ - _managedObjectArray = new Array(); - _managedObjectArray->initWithCapacity(150); -} - -AutoreleasePool::~AutoreleasePool() -{ - CCLOGINFO("deallocing AutoreleasePool: %p", this); - CC_SAFE_DELETE(_managedObjectArray); -} - -void AutoreleasePool::addObject(Object* object) -{ - _managedObjectArray->addObject(object); - - CCASSERT(object->_reference > 1, "reference count should be greater than 1"); - ++(object->_autoReleaseCount); - object->release(); // no ref count, in this case autorelease pool added. -} - -void AutoreleasePool::removeObject(Object* object) -{ - for (unsigned int i = 0; i < object->_autoReleaseCount; ++i) - { - _managedObjectArray->removeObject(object, false); - } -} - -void AutoreleasePool::clear() -{ - if(_managedObjectArray->count() > 0) - { - //CCAutoreleasePool* pReleasePool; -#ifdef _DEBUG - int nIndex = _managedObjectArray->count() - 1; -#endif - - Object* pObj = NULL; - CCARRAY_FOREACH_REVERSE(_managedObjectArray, pObj) - { - if(!pObj) - break; - - --(pObj->_autoReleaseCount); - //(*it)->release(); - //delete (*it); -#ifdef _DEBUG - nIndex--; -#endif - } - - _managedObjectArray->removeAllObjects(); - } -} - - -//-------------------------------------------------------------------- -// -// PoolManager -// -//-------------------------------------------------------------------- - -PoolManager* PoolManager::sharedPoolManager() -{ - if (s_pPoolManager == NULL) - { - s_pPoolManager = new PoolManager(); - } - return s_pPoolManager; -} - -void PoolManager::purgePoolManager() -{ - CC_SAFE_DELETE(s_pPoolManager); -} - -PoolManager::PoolManager() -{ - _releasePoolStack = new Array(); - _releasePoolStack->initWithCapacity(150); - _curReleasePool = 0; -} - -PoolManager::~PoolManager() -{ - CCLOGINFO("deallocing PoolManager: %p", this); - finalize(); - - // we only release the last autorelease pool here - _curReleasePool = 0; - _releasePoolStack->removeObjectAtIndex(0); - - CC_SAFE_DELETE(_releasePoolStack); -} - -void PoolManager::finalize() -{ - if(_releasePoolStack->count() > 0) - { - //CCAutoreleasePool* pReleasePool; - Object* pObj = NULL; - CCARRAY_FOREACH(_releasePoolStack, pObj) - { - if(!pObj) - break; - AutoreleasePool* pPool = static_cast(pObj); - pPool->clear(); - } - } -} - -void PoolManager::push() -{ - AutoreleasePool* pPool = new AutoreleasePool(); //ref = 1 - _curReleasePool = pPool; - - _releasePoolStack->addObject(pPool); //ref = 2 - - pPool->release(); //ref = 1 -} - -void PoolManager::pop() -{ - if (! _curReleasePool) - { - return; - } - - int nCount = _releasePoolStack->count(); - - _curReleasePool->clear(); - - if (nCount > 1) - { - _releasePoolStack->removeObjectAtIndex(nCount-1); - -// if(nCount > 1) -// { -// _curReleasePool = _releasePoolStack->getObjectAtIndex(nCount - 2); -// return; -// } - _curReleasePool = (AutoreleasePool*)_releasePoolStack->getObjectAtIndex(nCount - 2); - } - - /*_curReleasePool = NULL;*/ -} - -void PoolManager::removeObject(Object* object) -{ - CCASSERT(_curReleasePool, "current auto release pool should not be null"); - - _curReleasePool->removeObject(object); -} - -void PoolManager::addObject(Object* object) -{ - getCurReleasePool()->addObject(object); -} - - -AutoreleasePool* PoolManager::getCurReleasePool() -{ - if(!_curReleasePool) - { - push(); - } - - CCASSERT(_curReleasePool, "current auto release pool should not be null"); - - return _curReleasePool; -} - -NS_CC_END diff --git a/cocos/platform/cocoa/CCAutoreleasePool.h b/cocos/platform/cocoa/CCAutoreleasePool.h deleted file mode 100644 index e446ceb402..0000000000 --- a/cocos/platform/cocoa/CCAutoreleasePool.h +++ /dev/null @@ -1,181 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010 cocos2d-x.org - -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 __AUTORELEASEPOOL_H__ -#define __AUTORELEASEPOOL_H__ - -#include "CCObject.h" -#include "CCArray.h" - -NS_CC_BEGIN - -/** - * @addtogroup base_nodes - * @{ - */ - -class CC_DLL AutoreleasePool : public Object -{ - /** - * The underlying array of object managed by the pool. - * - * Although Array retains the object once when an object is added, proper - * Object::release() is called outside the array to make sure that the pool - * does not affect the managed object's reference count. So an object can - * be destructed properly by calling Object::release() even if the object - * is in the pool. - */ - Array *_managedObjectArray; -public: - /** - * @js NA - * @lua NA - */ - AutoreleasePool(); - /** - * @js NA - * @lua NA - */ - ~AutoreleasePool(); - - /** - * Add a given object to this pool. - * - * The same object may be added several times to the same pool; When the - * pool is destructed, the object's Object::release() method will be called - * for each time it was added. - * - * @param object The object to add to the pool. - * @js NA - * @lua NA - */ - void addObject(Object *object); - - /** - * Remove a given object from this pool. - * - * @param object The object to be removed from the pool. - * @js NA - * @lua NA - */ - void removeObject(Object *object); - - /** - * Clear the autorelease pool. - * - * Object::release() will be called for each time the managed object is - * added to the pool. - * @js NA - * @lua NA - */ - void clear(); -}; - -class CC_DLL PoolManager -{ - Array *_releasePoolStack; - AutoreleasePool *_curReleasePool; - - AutoreleasePool *getCurReleasePool(); -public: - /** - * @js NA - * @lua NA - */ - static PoolManager* sharedPoolManager(); - /** - * @js NA - * @lua NA - */ - static void purgePoolManager(); - /** - * @js NA - * @lua NA - */ - PoolManager(); - /** - * @js NA - * @lua NA - */ - ~PoolManager(); - - /** - * Clear all the AutoreleasePool on the pool stack. - * @js NA - * @lua NA - */ - void finalize(); - - /** - * Push a new AutoreleasePool to the pool stack. - * @js NA - * @lua NA - */ - void push(); - - /** - * Pop one AutoreleasePool from the pool stack. - * - * This method will ensure that there is at least one AutoreleasePool on - * the stack. - * - * The AutoreleasePool being poped is destructed. - * @js NA - * @lua NA - */ - void pop(); - - /** - * Remove a given object from the current autorelease pool. - * - * @param object The object to be removed. - * - * @see AutoreleasePool::removeObject - * @js NA - * @lua NA - */ - void removeObject(Object *object); - - /** - * Add a given object to the current autorelease pool. - * - * @param object The object to add. - * - * @see AutoreleasePool::addObject - * @js NA - * @lua NA - */ - void addObject(Object *object); - /** - * @js NA - * @lua NA - */ - friend class AutoreleasePool; -}; - -// end of base_nodes group -/// @} - -NS_CC_END - -#endif //__AUTORELEASEPOOL_H__ diff --git a/cocos/platform/cocoa/CCBool.h b/cocos/platform/cocoa/CCBool.h deleted file mode 100644 index 32b7b276ee..0000000000 --- a/cocos/platform/cocoa/CCBool.h +++ /dev/null @@ -1,70 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010-2012 cocos2d-x.org - - 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 __CCBOOL_H__ -#define __CCBOOL_H__ - -#include "CCObject.h" - -NS_CC_BEGIN - -/** - * @addtogroup data_structures - * @{ - */ - -class CC_DLL Bool : public Object, public Clonable -{ -public: - Bool(bool v) - : _value(v) {} - bool getValue() const {return _value;} - - static Bool* create(bool v) - { - Bool* pRet = new Bool(v); - if (pRet) - { - pRet->autorelease(); - } - return pRet; - } - - /* override functions */ - virtual void acceptVisitor(DataVisitor &visitor) { visitor.visit(this); } - - Bool* clone() const - { - return Bool::create(_value); - } -private: - bool _value; -}; - -// end of data_structure group -/// @} - -NS_CC_END - -#endif /* __CCBOOL_H__ */ diff --git a/cocos/platform/cocoa/CCData.cpp b/cocos/platform/cocoa/CCData.cpp deleted file mode 100644 index 1c42a12ee5..0000000000 --- a/cocos/platform/cocoa/CCData.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010-2012 cocos2d-x.org - - 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 -#include "CCData.h" -#include "platform/CCCommon.h" - -NS_CC_BEGIN - -Data::Data(unsigned char *pBytes, const unsigned long nSize) -{ - _size = nSize; - _bytes = new unsigned char[_size]; - memcpy(_bytes, pBytes, _size); -} - -Data::Data(Data *pData) -{ - _size = pData->_size; - _bytes = new unsigned char[_size]; - memcpy(_bytes, pData->_bytes, _size); -} - -Data::~Data() -{ - CCLOGINFO("deallocing Data: %p", this); - CC_SAFE_DELETE_ARRAY(_bytes); -} - -unsigned char* Data::getBytes() const -{ - return _bytes; -} - -unsigned long Data::getSize() const -{ - return _size; -} - -NS_CC_END diff --git a/cocos/platform/cocoa/CCData.h b/cocos/platform/cocoa/CCData.h deleted file mode 100644 index 889a2d557b..0000000000 --- a/cocos/platform/cocoa/CCData.h +++ /dev/null @@ -1,88 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010-2012 cocos2d-x.org - - 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 __CCDATA_H__ -#define __CCDATA_H__ - -#include "platform/CCPlatformMacros.h" -#include "CCObject.h" - -NS_CC_BEGIN - -class CC_DLL Data : public Object -{ -public: - /** - * @js NA - * @lua NA - */ - Data(unsigned char *pBytes, const unsigned long nSize); - /** - * @js NA - * @lua NA - */ - Data(Data *pData); - /** - * @js NA - * @lua NA - */ - ~Data(); - /** - * @js NA - * @lua NA - */ - static Data* create(unsigned char *pBytes, const unsigned long nSize) - { - Data* pRet = new Data(pBytes, nSize); - if (pRet) - { - pRet->autorelease(); - } - return pRet; - } - /** - * @js NA - * @lua NA - */ - unsigned char* getBytes() const; - /** - * @js NA - * @lua NA - */ - unsigned long getSize() const; - - /** override functions - * @js NA - * @lua NA - */ - virtual void acceptVisitor(DataVisitor &visitor) { visitor.visit(this); } - -private: - unsigned char* _bytes; - unsigned long _size; -}; - -NS_CC_END - -#endif // __CCDATA_H__ diff --git a/cocos/platform/cocoa/CCDataVisitor.cpp b/cocos/platform/cocoa/CCDataVisitor.cpp deleted file mode 100644 index 2d2a1f8121..0000000000 --- a/cocos/platform/cocoa/CCDataVisitor.cpp +++ /dev/null @@ -1,240 +0,0 @@ -/**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - 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 "CCObject.h" -#include "CCBool.h" -#include "CCInteger.h" -#include "CCFloat.h" -#include "CCDouble.h" -#include "CCString.h" -#include "CCArray.h" -#include "CCDictionary.h" -#include "CCSet.h" -#include "CCData.h" - -NS_CC_BEGIN - -void DataVisitor::visit(const Bool *value) -{ - visitObject(value); -} - -void DataVisitor::visit(const Integer *value) -{ - visitObject(value); -} - -void DataVisitor::visit(const Float *value) -{ - visitObject(value); -} - -void DataVisitor::visit(const Double *value) -{ - visitObject(value); -} - -void DataVisitor::visit(const String *value) -{ - visitObject(value); -} - -void DataVisitor::visit(const Array *value) -{ - visitObject(value); -} - -void DataVisitor::visit(const Dictionary *value) -{ - visitObject(value); -} - -void DataVisitor::visit(const Set *value) -{ - visitObject(value); -} - -void DataVisitor::visit(const Data *value) -{ - visitObject(value); -} - -// PrettyPrinter -PrettyPrinter::PrettyPrinter(int indentLevel/* = 0 */) -{ - setIndentLevel(indentLevel); -} - -void PrettyPrinter::clear() -{ - _result.clear(); -} - -std::string PrettyPrinter::getResult() -{ - return _result; -} - -void PrettyPrinter::visitObject(const Object *p) -{ - char buf[50] = {0}; - sprintf(buf, "%p", p); - _result += buf; -} - -void PrettyPrinter::visit(const Bool * p) -{ - char buf[50] = {0}; - sprintf(buf, "%s", p->getValue() ? "true" : "false"); - _result += buf; -} - -void PrettyPrinter::visit(const Integer *p) -{ - char buf[50] = {0}; - sprintf(buf, "%d", p->getValue()); - _result += buf; -} - -void PrettyPrinter::visit(const Float *p) -{ - char buf[50] = {0}; - sprintf(buf, "%f", p->getValue()); - _result += buf; -} - -void PrettyPrinter::visit(const Double *p) -{ - char buf[50] = {0}; - sprintf(buf, "%lf", p->getValue()); - _result += buf; -} - -void PrettyPrinter::visit(const String *p) -{ - _result += p->getCString(); -} - -void PrettyPrinter::visit(const Array *p) -{ - _result += "\n"; - _result += _indentStr; - _result += "\n"; - - setIndentLevel(_indentLevel+1); - Object* obj; - int i = 0; - char buf[50] = {0}; - CCARRAY_FOREACH(p, obj) - { - if (i > 0) { - _result += "\n"; - } - sprintf(buf, "%s%02d: ", _indentStr.c_str(), i); - _result += buf; - PrettyPrinter v(_indentLevel); - obj->acceptVisitor(v); - _result += v.getResult(); - i++; - } - setIndentLevel(_indentLevel-1); - - _result += "\n"; - _result += _indentStr; - _result += ""; -} - -void PrettyPrinter::visit(const Dictionary *p) -{ - _result += "\n"; - _result += _indentStr; - _result += "\n"; - - setIndentLevel(_indentLevel+1); - DictElement* element; - bool bFirstElement = true; - char buf[1000] = {0}; - CCDICT_FOREACH(p, element) - { - if (!bFirstElement) { - _result += "\n"; - } - sprintf(buf, "%s%s: ", _indentStr.c_str(),element->getStrKey()); - _result += buf; - PrettyPrinter v(_indentLevel); - element->getObject()->acceptVisitor(v); - _result += v.getResult(); - bFirstElement = false; - } - setIndentLevel(_indentLevel-1); - - _result += "\n"; - _result += _indentStr; - _result += ""; -} - -void PrettyPrinter::visit(const Set *p) -{ - _result += "\n"; - _result += _indentStr; - _result += "\n"; - - setIndentLevel(_indentLevel+1); - - int i = 0; - Set* tmp = const_cast(p); - SetIterator it = tmp->begin(); - - for (; it != tmp->end(); ++it, ++i) { - if (i > 0) { - _result += "\n"; - } - _result += _indentStr.c_str(); - PrettyPrinter v(_indentLevel); - (*it)->acceptVisitor(v); - _result += v.getResult(); - } - setIndentLevel(_indentLevel-1); - - _result += "\n"; - _result += _indentStr; - _result += "\n"; -} - -void PrettyPrinter::visit(const Data *p) -{ - //TODO Implement - DataVisitor::visit(p); -} - -void PrettyPrinter::setIndentLevel(int indentLevel) -{ - _indentLevel = indentLevel; - _indentStr.clear(); - for (int i = 0; i < _indentLevel; ++i) { - _indentStr += "\t"; - } -} - -NS_CC_END diff --git a/cocos/platform/cocoa/CCDataVisitor.h b/cocos/platform/cocoa/CCDataVisitor.h deleted file mode 100644 index 3395b43dea..0000000000 --- a/cocos/platform/cocoa/CCDataVisitor.h +++ /dev/null @@ -1,117 +0,0 @@ -/**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - 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 __CCDATAVISITOR_H__ -#define __CCDATAVISITOR_H__ - -#include "platform/CCPlatformMacros.h" -#include - -NS_CC_BEGIN - -class Object; -class Bool; -class Integer; -class Float; -class Double; -class String; -class Array; -class Dictionary; -class Set; -class Data; - -/** - * @addtogroup data_structures - * @{ - */ - -/** - * Visitor that helps to perform action that depends on polymorphic object type - * - * Use cases: - * - data serialization, - * - pretty printing of Object * - * - safe value reading from Array, Dictionary, Set - * - * Usage: - * 1. subclass DataVisitor - * 2. overload visit() methods for object that you need to handle - * 3. handle other objects in visitObject() - * 4. pass your visitor to Object::acceptVisitor() - */ -class CC_DLL DataVisitor -{ -public: - /** - * @js NA - * @lua NA - */ - virtual ~DataVisitor() {} - - /** default method, called from non-overloaded methods and for unrecognized objects */ - virtual void visitObject(const Object *p) = 0; - - virtual void visit(const Bool *p); - virtual void visit(const Integer *p); - virtual void visit(const Float *p); - virtual void visit(const Double *p); - virtual void visit(const String *p); - virtual void visit(const Array *p); - virtual void visit(const Dictionary *p); - virtual void visit(const Set *p); - virtual void visit(const Data *p); -}; - - -class CC_DLL PrettyPrinter : public DataVisitor -{ -public: - PrettyPrinter(int indentLevel = 0); - - virtual void clear(); - virtual std::string getResult(); - - virtual void visitObject(const Object *p); - virtual void visit(const Bool * p); - virtual void visit(const Integer *p); - virtual void visit(const Float *p); - virtual void visit(const Double *p); - virtual void visit(const String *p); - virtual void visit(const Array *p); - virtual void visit(const Dictionary *p); - virtual void visit(const Set *p); - virtual void visit(const Data *p); -private: - void setIndentLevel(int indentLevel); - int _indentLevel; - std::string _indentStr; - std::string _result; -}; - -// end of data_structure group -/// @} - -NS_CC_END - -#endif // __CCDATAVISITOR_H__ diff --git a/cocos/platform/cocoa/CCDictionary.cpp b/cocos/platform/cocoa/CCDictionary.cpp deleted file mode 100644 index 6b8df0febf..0000000000 --- a/cocos/platform/cocoa/CCDictionary.cpp +++ /dev/null @@ -1,454 +0,0 @@ -/**************************************************************************** - Copyright (c) 2012 - 2013 cocos2d-x.org - - 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 "CCDictionary.h" -#include "CCString.h" -#include "CCInteger.h" -#include "platform/CCFileUtils.h" - -using namespace std; - -NS_CC_BEGIN - -// ----------------------------------------------------------------------- -// DictElement - -DictElement::DictElement(const char* pszKey, Object* pObject) -{ - CCASSERT(pszKey && strlen(pszKey) > 0, "Invalid key value."); - _intKey = 0; - const char* pStart = pszKey; - - size_t len = strlen(pszKey); - if (len > MAX_KEY_LEN ) - { - char* pEnd = (char*)&pszKey[len-1]; - pStart = pEnd - (MAX_KEY_LEN-1); - } - - strcpy(_strKey, pStart); - - _object = pObject; - memset(&hh, 0, sizeof(hh)); -} - -DictElement::DictElement(intptr_t iKey, Object* pObject) -{ - _strKey[0] = '\0'; - _intKey = iKey; - _object = pObject; - memset(&hh, 0, sizeof(hh)); -} - -DictElement::~DictElement() -{ - CCLOGINFO("deallocing DictElement: %p", this); -} - -// ----------------------------------------------------------------------- -// Dictionary - -Dictionary::Dictionary() -: _elements(NULL) -, _dictType(kDictUnknown) -{ - -} - -Dictionary::~Dictionary() -{ - CCLOGINFO("deallocing Dictionary: %p", this); - removeAllObjects(); -} - -unsigned int Dictionary::count() -{ - return HASH_COUNT(_elements); -} - -Array* Dictionary::allKeys() -{ - int iKeyCount = this->count(); - if (iKeyCount <= 0) return NULL; - - Array* pArray = Array::createWithCapacity(iKeyCount); - - DictElement *pElement, *tmp; - if (_dictType == kDictStr) - { - HASH_ITER(hh, _elements, pElement, tmp) - { - String* pOneKey = new String(pElement->_strKey); - pArray->addObject(pOneKey); - CC_SAFE_RELEASE(pOneKey); - } - } - else if (_dictType == kDictInt) - { - HASH_ITER(hh, _elements, pElement, tmp) - { - Integer* pOneKey = new Integer(pElement->_intKey); - pArray->addObject(pOneKey); - CC_SAFE_RELEASE(pOneKey); - } - } - - return pArray; -} - -Array* Dictionary::allKeysForObject(Object* object) -{ - int iKeyCount = this->count(); - if (iKeyCount <= 0) return NULL; - Array* pArray = Array::create(); - - DictElement *pElement, *tmp; - - if (_dictType == kDictStr) - { - HASH_ITER(hh, _elements, pElement, tmp) - { - if (object == pElement->_object) - { - String* pOneKey = new String(pElement->_strKey); - pArray->addObject(pOneKey); - CC_SAFE_RELEASE(pOneKey); - } - } - } - else if (_dictType == kDictInt) - { - HASH_ITER(hh, _elements, pElement, tmp) - { - if (object == pElement->_object) - { - Integer* pOneKey = new Integer(pElement->_intKey); - pArray->addObject(pOneKey); - CC_SAFE_RELEASE(pOneKey); - } - } - } - return pArray; -} - -Object* Dictionary::objectForKey(const std::string& key) -{ - // if dictionary wasn't initialized, return NULL directly. - if (_dictType == kDictUnknown) return NULL; - // Dictionary only supports one kind of key, string or integer. - // This method uses string as key, therefore we should make sure that the key type of this Dictionary is string. - CCASSERT(_dictType == kDictStr, "this dictionary does not use string as key."); - - Object* pRetObject = NULL; - DictElement *pElement = NULL; - HASH_FIND_STR(_elements, key.c_str(), pElement); - if (pElement != NULL) - { - pRetObject = pElement->_object; - } - return pRetObject; -} - -Object* Dictionary::objectForKey(intptr_t key) -{ - // if dictionary wasn't initialized, return NULL directly. - if (_dictType == kDictUnknown) return NULL; - // Dictionary only supports one kind of key, string or integer. - // This method uses integer as key, therefore we should make sure that the key type of this Dictionary is integer. - CCASSERT(_dictType == kDictInt, "this dictionary does not use integer as key."); - - Object* pRetObject = NULL; - DictElement *pElement = NULL; - HASH_FIND_PTR(_elements, &key, pElement); - if (pElement != NULL) - { - pRetObject = pElement->_object; - } - return pRetObject; -} - -const String* Dictionary::valueForKey(const std::string& key) -{ - String* pStr = dynamic_cast(objectForKey(key)); - if (pStr == NULL) - { - pStr = String::create(""); - } - return pStr; -} - -const String* Dictionary::valueForKey(intptr_t key) -{ - String* pStr = dynamic_cast(objectForKey(key)); - if (pStr == NULL) - { - pStr = String::create(""); - } - return pStr; -} - -void Dictionary::setObject(Object* pObject, const std::string& key) -{ - CCASSERT(key.length() > 0 && pObject != NULL, "Invalid Argument!"); - if (_dictType == kDictUnknown) - { - _dictType = kDictStr; - } - - CCASSERT(_dictType == kDictStr, "this dictionary doesn't use string as key."); - - DictElement *pElement = NULL; - HASH_FIND_STR(_elements, key.c_str(), pElement); - if (pElement == NULL) - { - setObjectUnSafe(pObject, key); - } - else if (pElement->_object != pObject) - { - Object* pTmpObj = pElement->_object; - pTmpObj->retain(); - removeObjectForElememt(pElement); - setObjectUnSafe(pObject, key); - pTmpObj->release(); - } -} - -void Dictionary::setObject(Object* pObject, intptr_t key) -{ - CCASSERT(pObject != NULL, "Invalid Argument!"); - if (_dictType == kDictUnknown) - { - _dictType = kDictInt; - } - - CCASSERT(_dictType == kDictInt, "this dictionary doesn't use integer as key."); - - DictElement *pElement = NULL; - HASH_FIND_PTR(_elements, &key, pElement); - if (pElement == NULL) - { - setObjectUnSafe(pObject, key); - } - else if (pElement->_object != pObject) - { - Object* pTmpObj = pElement->_object; - pTmpObj->retain(); - removeObjectForElememt(pElement); - setObjectUnSafe(pObject, key); - pTmpObj->release(); - } - -} - -void Dictionary::removeObjectForKey(const std::string& key) -{ - if (_dictType == kDictUnknown) - { - return; - } - - CCASSERT(_dictType == kDictStr, "this dictionary doesn't use string as its key"); - CCASSERT(key.length() > 0, "Invalid Argument!"); - DictElement *pElement = NULL; - HASH_FIND_STR(_elements, key.c_str(), pElement); - removeObjectForElememt(pElement); -} - -void Dictionary::removeObjectForKey(intptr_t key) -{ - if (_dictType == kDictUnknown) - { - return; - } - - CCASSERT(_dictType == kDictInt, "this dictionary doesn't use integer as its key"); - DictElement *pElement = NULL; - HASH_FIND_PTR(_elements, &key, pElement); - removeObjectForElememt(pElement); -} - -void Dictionary::setObjectUnSafe(Object* pObject, const std::string& key) -{ - pObject->retain(); - DictElement* pElement = new DictElement(key.c_str(), pObject); - HASH_ADD_STR(_elements, _strKey, pElement); -} - -void Dictionary::setObjectUnSafe(Object* pObject, const intptr_t key) -{ - pObject->retain(); - DictElement* pElement = new DictElement(key, pObject); - HASH_ADD_PTR(_elements, _intKey, pElement); -} - -void Dictionary::removeObjectsForKeys(Array* pKeyArray) -{ - Object* pObj = NULL; - CCARRAY_FOREACH(pKeyArray, pObj) - { - String* pStr = static_cast(pObj); - removeObjectForKey(pStr->getCString()); - } -} - -void Dictionary::removeObjectForElememt(DictElement* pElement) -{ - if (pElement != NULL) - { - HASH_DEL(_elements, pElement); - pElement->_object->release(); - CC_SAFE_DELETE(pElement); - } -} - -void Dictionary::removeAllObjects() -{ - DictElement *pElement, *tmp; - HASH_ITER(hh, _elements, pElement, tmp) - { - HASH_DEL(_elements, pElement); - pElement->_object->release(); - CC_SAFE_DELETE(pElement); - - } -} - -Object* Dictionary::randomObject() -{ - if (_dictType == kDictUnknown) - { - return NULL; - } - - Object* key = allKeys()->getRandomObject(); - - if (_dictType == kDictInt) - { - return objectForKey( static_cast(key)->getValue()); - } - else if (_dictType == kDictStr) - { - return objectForKey( static_cast(key)->getCString()); - } - else - { - return NULL; - } -} - -Dictionary* Dictionary::create() -{ - Dictionary* ret = new Dictionary(); - if (ret && ret->init() ) - { - ret->autorelease(); - } - return ret; -} - -bool Dictionary::init() -{ - return true; -} - -Dictionary* Dictionary::createWithDictionary(Dictionary* srcDict) -{ - return srcDict->clone(); -} - -Dictionary* Dictionary::createWithContentsOfFileThreadSafe(const char *pFileName) -{ - return FileUtils::getInstance()->createDictionaryWithContentsOfFile(pFileName); -} - -void Dictionary::acceptVisitor(DataVisitor &visitor) -{ - return visitor.visit(this); -} - -Dictionary* Dictionary::createWithContentsOfFile(const char *pFileName) -{ - auto ret = createWithContentsOfFileThreadSafe(pFileName); - if (ret != nullptr) - { - ret->autorelease(); - } - return ret; -} - -bool Dictionary::writeToFile(const char *fullPath) -{ - return FileUtils::getInstance()->writeToFile(this, fullPath); -} - -Dictionary* Dictionary::clone() const -{ - Dictionary* newDict = Dictionary::create(); - - DictElement* element = NULL; - Object* tmpObj = NULL; - Clonable* obj = NULL; - if (_dictType == kDictInt) - { - CCDICT_FOREACH(this, element) - { - obj = dynamic_cast(element->getObject()); - if (obj) - { - tmpObj = dynamic_cast(obj->clone()); - if (tmpObj) - { - newDict->setObject(tmpObj, element->getIntKey()); - } - } - else - { - CCLOGWARN("%s isn't clonable.", typeid(*element->getObject()).name()); - } - } - } - else if (_dictType == kDictStr) - { - CCDICT_FOREACH(this, element) - { - obj = dynamic_cast(element->getObject()); - if (obj) - { - tmpObj = dynamic_cast(obj->clone()); - if (tmpObj) - { - newDict->setObject(tmpObj, element->getStrKey()); - } - } - else - { - CCLOGWARN("%s isn't clonable.", typeid(*element->getObject()).name()); - } - } - } - - return newDict; -} - -NS_CC_END diff --git a/cocos/platform/cocoa/CCDictionary.h b/cocos/platform/cocoa/CCDictionary.h deleted file mode 100644 index b0f1c98a9c..0000000000 --- a/cocos/platform/cocoa/CCDictionary.h +++ /dev/null @@ -1,458 +0,0 @@ -/**************************************************************************** -Copyright (c) 2012 - 2013 cocos2d-x.org - -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 __CCDICTIONARY_H__ -#define __CCDICTIONARY_H__ - -#include "support/data_support/uthash.h" -#include "CCObject.h" -#include "CCArray.h" -#include "CCString.h" - -NS_CC_BEGIN - -class Dictionary; - -/** - * @addtogroup data_structures - * @{ - */ - - -/** - * DictElement is used for traversing Dictionary. - * - * A DictElement is one element of Dictionary, it contains two properties, key and object. - * Its key has two different type (integer and string). - * - * @note The key type is unique, all the elements in Dictionary has the same key type(integer or string). - * @code - * DictElement* pElement; - * CCDICT_FOREACH(dict, pElement) - * { - * const char*key = pElement->getStrKey(); - * // You certainly know the type of value, so we assume that it's a Sprite. - * Sprite* pSprite = static_cast(pElement->getObject()); - * // ...... - * } - * @endcode - * - */ -class CC_DLL DictElement -{ -private: - /** - * Constructor of DictElement. It's only for internal usage. Dictionary is its friend class. - * - * @param pszKey The string key of this element. - * @param pObject The object of this element. - */ - DictElement(const char* pszKey, Object* pObject); - - /** - * Constructor of DictElement. It's only for internal usage. Dictionary is its friend class. - * - * @param iKey The integer key of this element. - * @param pObject The object of this element. - */ - DictElement(intptr_t iKey, Object* pObject); - -public: - /** - * The destructor of DictElement. - * @js NA - * @lua NA - */ - ~DictElement(); - - // Inline functions need to be implemented in header file on Android. - - /** - * Get the string key of this element. - * @note This method assumes you know the key type in the element. - * If the element's key type is integer, invoking this method will cause an assert. - * - * @return The string key of this element. - */ - inline const char* getStrKey() const - { - CCASSERT(_strKey[0] != '\0', "Should not call this function for integer dictionary"); - return _strKey; - } - - /** - * Get the integer key of this element. - * @note This method assumes you know the key type in the element. - * If the element's key type is string, invoking this method will cause an assert. - * - * @return The integer key of this element. - */ - inline intptr_t getIntKey() const - { - CCASSERT(_strKey[0] == '\0', "Should not call this function for string dictionary"); - return _intKey; - } - - /** - * Get the object of this element. - * - * @return The object of this element. - */ - inline Object* getObject() const { return _object; } - -private: - // The max length of string key. - #define MAX_KEY_LEN 256 - // char array is needed for HASH_ADD_STR in UT_HASH. - // So it's a pain that all elements will allocate 256 bytes for this array. - char _strKey[MAX_KEY_LEN]; // hash key of string type - intptr_t _intKey; // hash key of integer type - Object* _object; // hash value -public: - UT_hash_handle hh; // makes this class hashable - friend class Dictionary; // declare Dictionary as friend class -}; - -/** The macro for traversing dictionary - * - * @note It's faster than getting all keys and traversing keys to get objects by objectForKey. - * It's also safe to remove elements while traversing. - */ -#define CCDICT_FOREACH(__dict__, __el__) \ - DictElement* pTmp##__dict__##__el__ = nullptr; \ - if (__dict__) \ - HASH_ITER(hh, (__dict__)->_elements, __el__, pTmp##__dict__##__el__) - - - -/** - * Dictionary is a class like NSDictionary in Obj-C . - * - * @note Only the pointer of Object or its subclass can be inserted to Dictionary. - * @code - * // Create a dictionary, return an autorelease object. - * Dictionary* pDict = Dictionary::create(); - * - * // Insert objects to dictionary - * String* pValue1 = String::create("100"); - * String* pValue2 = String::create("120"); - * Integer* pValue3 = Integer::create(200); - * pDict->setObject(pValue1, "key1"); - * pDict->setObject(pValue2, "key2"); - * pDict->setObject(pValue3, "key3"); - * - * // Get the object for key - * String* pStr1 = (String*)pDict->objectForKey("key1"); - * log("{ key1: %s }", pStr1->getCString()); - * Integer* pInteger = (Integer*)pDict->objectForKey("key3"); - * log("{ key3: %d }", pInteger->getValue()); - * @endcode - * - */ - -class CC_DLL Dictionary : public Object, public Clonable -{ -public: - /** - * The constructor of Dictionary. - * @js NA - * @lua NA - */ - Dictionary(); - - /** - * The destructor of Dictionary - * @js NA - * @lua NA - */ - ~Dictionary(); - - /** Initializes the dictionary. It returns true if the initializations was successful. - * @js NA - * @lua NA - */ - bool init(); - /** - * Get the count of elements in Dictionary. - * - * @return The count of elements. - * @js NA - */ - unsigned int count(); - - /** - * Return all keys of elements. - * - * @return The array contains all keys of elements. It's an autorelease object yet. - * @js NA - */ - Array* allKeys(); - - /** - * Get all keys according to the specified object. - * @warning We use '==' to compare two objects - * @return The array contains all keys for the specified object. It's an autorelease object yet. - * @js NA - */ - Array* allKeysForObject(Object* object); - - /** - * Get the object according to the specified string key. - * - * @note The dictionary needs to use string as key. If integer is passed, an assert will appear. - * @param key The string key for searching. - * @return The object matches the key. You need to force convert it to the type you know. - * @code - * // Assume that the elements are String* pointers. Convert it by following code. - * String* pStr = (String*)pDict->objectForKey("key1"); - * // Do something about pStr. - * // If you don't know the object type, properly you need to use dynamic_cast to check it. - * String* pStr2 = dynamic_cast(pDict->objectForKey("key1")); - * if (pStr2 != NULL) { - * // Do something about pStr2 - * } - * @endcode - * @see objectForKey(intptr_t) - * @js NA - */ - Object* objectForKey(const std::string& key); - - /** - * Get the object according to the specified integer key. - * - * @note The dictionary needs to use integer as key. If string is passed, an assert will appear. - * @param key The integer key for searching. - * @return The object matches the key. - * @see objectForKey(const std::string&) - * @js NA - */ - Object* objectForKey(intptr_t key); - - /** Get the value according to the specified string key. - * - * @note Be careful to use this function since it assumes the objects in the dictionary are String pointer. - * @param key The string key for searching - * @return An instance of String. - * It will return an empty string if the objects aren't String pointer or the key wasn't found. - * @see valueForKey(intptr_t) - * @js NA - */ - const String* valueForKey(const std::string& key); - - /** Get the value according to the specified integer key. - * - * @note Be careful to use this function since it assumes the objects in the dictionary are String pointer. - * @param key The string key for searching. - * @return An instance of String. - * It will return an empty string if the objects aren't String pointer or the key wasn't found. - * @see valueForKey(intptr_t) - * @js NA - */ - const String* valueForKey(intptr_t key); - - /** Insert an object to dictionary, and match it with the specified string key. - * - * @note Whe the first time this method is invoked, the key type will be set to string. - * After that you can't setObject with an integer key. - * If the dictionary contains the key you passed, the object matching the key will be released and removed from dictionary. - * Then the new object will be inserted after that. - * - * @param pObject The Object to be inserted. - * @param key The string key for searching. - * @see setObject(Object*, intptr_t) - * @js NA - */ - void setObject(Object* pObject, const std::string& key); - - /** Insert an object to dictionary, and match it with the specified string key. - * - * @note Then the first time this method is invoked, the key type will be set to string. - * After that you can't setObject with an integer key. - * If the dictionary contains the key you passed, the object matching the key will be released and removed from dictionary. - * Then the new object will be inserted after that. - * @param pObject The Object to be inserted. - * @param key The string key for searching. - * @see setObject(Object*, const std::string&) - * @js NA - */ - void setObject(Object* pObject, intptr_t key); - - /** - * Remove an object by the specified string key. - * - * @param key The string key for searching. - * @see removeObjectForKey(intptr_t), removeObjectsForKeys(Array*), - * removeObjectForElememt(DictElement*), removeAllObjects(). - * @js NA - */ - void removeObjectForKey(const std::string& key); - - /** - * Remove an object by the specified integer key. - * - * @param key The integer key for searching. - * @see removeObjectForKey(const std::string&), removeObjectsForKeys(Array*), - * removeObjectForElememt(DictElement*), removeAllObjects(). - * @js NA - */ - void removeObjectForKey(intptr_t key); - - /** - * Remove objects by an array of keys. - * - * @param pKeyArray The array contains keys to be removed. - * @see removeObjectForKey(const std::string&), removeObjectForKey(intptr_t), - * removeObjectForElememt(DictElement*), removeAllObjects(). - * @js NA - */ - void removeObjectsForKeys(Array* pKeyArray); - - /** - * Remove an object by an element. - * - * @param pElement The element need to be removed. - * @see removeObjectForKey(const std::string&), removeObjectForKey(intptr_t), - * removeObjectsForKeys(Array*), removeAllObjects(). - * @js NA - * @lua NA - */ - void removeObjectForElememt(DictElement* pElement); - - /** - * Remove all objects in the dictionary. - * - * @see removeObjectForKey(const std::string&), removeObjectForKey(intptr_t), - * removeObjectsForKeys(Array*), removeObjectForElememt(DictElement*). - * @js NA - */ - void removeAllObjects(); - - /** - * Return a random object in the dictionary. - * - * @return The random object. - * @see objectForKey(intptr_t), objectForKey(const std::string&) - * @js NA - * @lua NA - */ - Object* randomObject(); - - /** - * Create a dictionary. - * @return A dictionary which is an autorelease object. - * @see createWithDictionary(Dictionary*), createWithContentsOfFile(const char*), createWithContentsOfFileThreadSafe(const char*). - * @js NA - */ - static Dictionary* create(); - - /** - * Create a dictionary with an existing dictionary. - * - * @param srcDict The exist dictionary. - * @return A dictionary which is an autorelease object. - * @see create(), createWithContentsOfFile(const char*), createWithContentsOfFileThreadSafe(const char*). - * @js NA - */ - static Dictionary* createWithDictionary(Dictionary* srcDict); - - /** - * Create a dictionary with a plist file. - * @param pFileName The name of the plist file. - * @return A dictionary which is an autorelease object. - * @see create(), createWithDictionary(Dictionary*), createWithContentsOfFileThreadSafe(const char*). - * @js NA - */ - static Dictionary* createWithContentsOfFile(const char *pFileName); - - /** - * Write a dictionary to a plist file. - * @param fullPath The full path of the plist file. You can get writeable path by getWritablePath() - * @return true if successed, false if failed - * @js NA - * @lua NA - */ - bool writeToFile(const char *fullPath); - - /** - * Create a dictionary with a plist file. - * - * @note the return object isn't an autorelease object. - * This can make sure not using autorelease pool in a new thread. - * Therefore, you need to manage the lifecycle of the return object. - * It means that when you don't need it, CC_SAFE_RELEASE needs to be invoked. - * - * @param pFileName The name of the plist file. - * @return A dictionary which isn't an autorelease object. - * @js NA - * @lua NA - */ - static Dictionary* createWithContentsOfFileThreadSafe(const char *pFileName); - - /* override functions - * @js NA - * @lua NA - */ - virtual void acceptVisitor(DataVisitor &visitor); - /** - * @js NA - * @lua NA - */ - virtual Dictionary* clone() const; - -private: - /** - * For internal usage, invoked by setObject. - */ - void setObjectUnSafe(Object* pObject, const std::string& key); - void setObjectUnSafe(Object* pObject, const intptr_t key); - -public: - /** - * All the elements in dictionary. - * - * @note For internal usage, we need to declare this member variable as public since it's used in UT_HASH. - */ - DictElement* _elements; -private: - - /** The support type of dictionary, it's confirmed when setObject is invoked. */ - enum DictType - { - kDictUnknown = 0, - kDictStr, - kDictInt - }; - - /** - * The type of dictionary, it's assigned to kDictUnknown by default. - */ - DictType _dictType; -}; - -// end of data_structure group -/// @} - -NS_CC_END - -#endif /* __CCDICTIONARY_H__ */ diff --git a/cocos/platform/cocoa/CCDouble.h b/cocos/platform/cocoa/CCDouble.h deleted file mode 100644 index 5b45b1d6cf..0000000000 --- a/cocos/platform/cocoa/CCDouble.h +++ /dev/null @@ -1,70 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010-2012 cocos2d-x.org - - 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 __CCDOUBLE_H__ -#define __CCDOUBLE_H__ - -#include "CCObject.h" - -NS_CC_BEGIN - -/** - * @addtogroup data_structures - * @{ - */ - -class CC_DLL Double : public Object, public Clonable -{ -public: - Double(double v) - : _value(v) {} - double getValue() const {return _value;} - - static Double* create(double v) - { - Double* pRet = new Double(v); - if (pRet) - { - pRet->autorelease(); - } - return pRet; - } - - /* override functions */ - virtual void acceptVisitor(DataVisitor &visitor) { visitor.visit(this); } - - Double* clone() const - { - return Double::create(_value); - } -private: - double _value; -}; - -// end of data_structure group -/// @} - -NS_CC_END - -#endif /* __CCDOUBLE_H__ */ diff --git a/cocos/platform/cocoa/CCFloat.h b/cocos/platform/cocoa/CCFloat.h deleted file mode 100644 index c85a2e1e70..0000000000 --- a/cocos/platform/cocoa/CCFloat.h +++ /dev/null @@ -1,71 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010-2012 cocos2d-x.org - - 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 __CCFLOAT_H__ -#define __CCFLOAT_H__ - -#include "CCObject.h" - -NS_CC_BEGIN - -/** - * @addtogroup data_structures - * @{ - */ - -class CC_DLL Float : public Object, public Clonable -{ -public: - Float(float v) - : _value(v) {} - float getValue() const {return _value;} - - static Float* create(float v) - { - Float* pRet = new Float(v); - if (pRet) - { - pRet->autorelease(); - } - return pRet; - } - - /* override functions */ - virtual void acceptVisitor(DataVisitor &visitor) { visitor.visit(this); } - - Float* clone() const - { - return Float::create(_value); - } - -private: - float _value; -}; - -// end of data_structure group -/// @} - -NS_CC_END - -#endif /* __CCFLOAT_H__ */ diff --git a/cocos/platform/cocoa/CCGeometry.cpp b/cocos/platform/cocoa/CCGeometry.cpp deleted file mode 100644 index cfce9d3fa7..0000000000 --- a/cocos/platform/cocoa/CCGeometry.cpp +++ /dev/null @@ -1,463 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010 cocos2d-x.org - -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 "CCGeometry.h" -#include "ccMacros.h" -#include - -// implementation of Point -NS_CC_BEGIN - -Point::Point(void) : x(0), y(0) -{ -} - -Point::Point(float xx, float yy) : x(xx), y(yy) -{ -} - -Point::Point(const Point& other) : x(other.x), y(other.y) -{ -} - -Point::Point(const Size& size) : x(size.width), y(size.height) -{ -} - -Point& Point::operator= (const Point& other) -{ - setPoint(other.x, other.y); - return *this; -} - -Point& Point::operator= (const Size& size) -{ - setPoint(size.width, size.height); - return *this; -} - -Point Point::operator+(const Point& right) const -{ - return Point(this->x + right.x, this->y + right.y); -} - -Point Point::operator-(const Point& right) const -{ - return Point(this->x - right.x, this->y - right.y); -} - -Point Point::operator-() const -{ - return Point(-x, -y); -} - -Point Point::operator*(float a) const -{ - return Point(this->x * a, this->y * a); -} - -Point Point::operator/(float a) const -{ - CCASSERT(a!=0, "CCPoint division by 0."); - return Point(this->x / a, this->y / a); -} - -void Point::setPoint(float xx, float yy) -{ - this->x = xx; - this->y = yy; -} - -bool Point::equals(const Point& target) const -{ - return (fabs(this->x - target.x) < FLT_EPSILON) - && (fabs(this->y - target.y) < FLT_EPSILON); -} - -bool Point::fuzzyEquals(const Point& b, float var) const -{ - if(x - var <= b.x && b.x <= x + var) - if(y - var <= b.y && b.y <= y + var) - return true; - return false; -} - -float Point::getAngle(const Point& other) const -{ - Point a2 = normalize(); - Point b2 = other.normalize(); - float angle = atan2f(a2.cross(b2), a2.dot(b2)); - if( fabs(angle) < FLT_EPSILON ) return 0.f; - return angle; -} - -Point Point::rotateByAngle(const Point& pivot, float angle) const -{ - return pivot + (*this - pivot).rotate(Point::forAngle(angle)); -} - -bool Point::isOneDemensionSegmentOverlap(float A, float B, float C, float D, float *S, float *E) -{ - float ABmin = MIN(A, B); - float ABmax = MAX(A, B); - float CDmin = MIN(C, D); - float CDmax = MAX(C, D); - - if (ABmax < CDmin || CDmax < ABmin) - { - // ABmin->ABmax->CDmin->CDmax or CDmin->CDmax->ABmin->ABmax - return false; - } - else - { - if (ABmin >= CDmin && ABmin <= CDmax) - { - // CDmin->ABmin->CDmax->ABmax or CDmin->ABmin->ABmax->CDmax - if (S != nullptr) *S = ABmin; - if (E != nullptr) *E = CDmax < ABmax ? CDmax : ABmax; - } - else if (ABmax >= CDmin && ABmax <= CDmax) - { - // ABmin->CDmin->ABmax->CDmax - if (S != nullptr) *S = CDmin; - if (E != nullptr) *E = ABmax; - } - else - { - // ABmin->CDmin->CDmax->ABmax - if (S != nullptr) *S = CDmin; - if (E != nullptr) *E = CDmax; - } - return true; - } -} - -bool Point::isLineIntersect(const Point& A, const Point& B, - const Point& C, const Point& D, - float *S, float *T) -{ - // FAIL: Line undefined - if ( (A.x==B.x && A.y==B.y) || (C.x==D.x && C.y==D.y) ) - { - return false; - } - - const float denom = crossProduct2Vector(A, B, C, D); - - if (denom == 0) - { - // Lines parallel or overlap - return false; - } - - if (S != nullptr) *S = crossProduct2Vector(C, D, C, A) / denom; - if (T != nullptr) *T = crossProduct2Vector(A, B, C, A) / denom; - - return true; -} - -bool Point::isLineParallel(const Point& A, const Point& B, - const Point& C, const Point& D) -{ - // FAIL: Line undefined - if ( (A.x==B.x && A.y==B.y) || (C.x==D.x && C.y==D.y) ) - { - return false; - } - - if (crossProduct2Vector(A, B, C, D) == 0) - { - // line overlap - if (crossProduct2Vector(C, D, C, A) == 0 || crossProduct2Vector(A, B, C, A) == 0) - { - return false; - } - - return true; - } - - return false; -} - -bool Point::isLineOverlap(const Point& A, const Point& B, - const Point& C, const Point& D) -{ - // FAIL: Line undefined - if ( (A.x==B.x && A.y==B.y) || (C.x==D.x && C.y==D.y) ) - { - return false; - } - - if (crossProduct2Vector(A, B, C, D) == 0 && - (crossProduct2Vector(C, D, C, A) == 0 || crossProduct2Vector(A, B, C, A) == 0)) - { - return true; - } - - return false; -} - -bool Point::isSegmentOverlap(const Point& A, const Point& B, const Point& C, const Point& D, Point* S, Point* E) -{ - - if (isLineOverlap(A, B, C, D)) - { - return isOneDemensionSegmentOverlap(A.x, B.x, C.x, D.x, &S->x, &E->x) && - isOneDemensionSegmentOverlap(A.y, B.y, C.y, D.y, &S->y, &E->y); - } - - return false; -} - -bool Point::isSegmentIntersect(const Point& A, const Point& B, const Point& C, const Point& D) -{ - float S, T; - - if (isLineIntersect(A, B, C, D, &S, &T )&& - (S >= 0.0f && S <= 1.0f && T >= 0.0f && T <= 1.0f)) - { - return true; - } - - return false; -} - -Point Point::getIntersectPoint(const Point& A, const Point& B, const Point& C, const Point& D) -{ - float S, T; - - if (isLineIntersect(A, B, C, D, &S, &T)) - { - // Point of intersection - Point P; - P.x = A.x + S * (B.x - A.x); - P.y = A.y + S * (B.y - A.y); - return P; - } - - return Point::ZERO; -} - -const Point Point::ZERO = Point(0, 0); - -// implementation of Size - -Size::Size(void) : width(0), height(0) -{ -} - -Size::Size(float w, float h) : width(w), height(h) -{ -} - -Size::Size(const Size& other) : width(other.width), height(other.height) -{ -} - -Size::Size(const Point& point) : width(point.x), height(point.y) -{ -} - -Size& Size::operator= (const Size& other) -{ - setSize(other.width, other.height); - return *this; -} - -Size& Size::operator= (const Point& point) -{ - setSize(point.x, point.y); - return *this; -} - -Size Size::operator+(const Size& right) const -{ - return Size(this->width + right.width, this->height + right.height); -} - -Size Size::operator-(const Size& right) const -{ - return Size(this->width - right.width, this->height - right.height); -} - -Size Size::operator*(float a) const -{ - return Size(this->width * a, this->height * a); -} - -Size Size::operator/(float a) const -{ - CCASSERT(a!=0, "CCSize division by 0."); - return Size(this->width / a, this->height / a); -} - -void Size::setSize(float w, float h) -{ - this->width = w; - this->height = h; -} - -bool Size::equals(const Size& target) const -{ - return (fabs(this->width - target.width) < FLT_EPSILON) - && (fabs(this->height - target.height) < FLT_EPSILON); -} - -const Size Size::ZERO = Size(0, 0); - -// implementation of Rect - -Rect::Rect(void) -{ - setRect(0.0f, 0.0f, 0.0f, 0.0f); -} - -Rect::Rect(float x, float y, float width, float height) -{ - setRect(x, y, width, height); -} - -Rect::Rect(const Rect& other) -{ - setRect(other.origin.x, other.origin.y, other.size.width, other.size.height); -} - -Rect& Rect::operator= (const Rect& other) -{ - setRect(other.origin.x, other.origin.y, other.size.width, other.size.height); - return *this; -} - -void Rect::setRect(float x, float y, float width, float height) -{ - // CGRect can support width<0 or height<0 - // CCASSERT(width >= 0.0f && height >= 0.0f, "width and height of Rect must not less than 0."); - - origin.x = x; - origin.y = y; - - size.width = width; - size.height = height; -} - -bool Rect::equals(const Rect& rect) const -{ - return (origin.equals(rect.origin) && - size.equals(rect.size)); -} - -float Rect::getMaxX() const -{ - return origin.x + size.width; -} - -float Rect::getMidX() const -{ - return origin.x + size.width / 2.0f; -} - -float Rect::getMinX() const -{ - return origin.x; -} - -float Rect::getMaxY() const -{ - return origin.y + size.height; -} - -float Rect::getMidY() const -{ - return origin.y + size.height / 2.0f; -} - -float Rect::getMinY() const -{ - return origin.y; -} - -bool Rect::containsPoint(const Point& point) const -{ - bool bRet = false; - - if (point.x >= getMinX() && point.x <= getMaxX() - && point.y >= getMinY() && point.y <= getMaxY()) - { - bRet = true; - } - - return bRet; -} - -bool Rect::intersectsRect(const Rect& rect) const -{ - return !( getMaxX() < rect.getMinX() || - rect.getMaxX() < getMinX() || - getMaxY() < rect.getMinY() || - rect.getMaxY() < getMinY()); -} - -Rect Rect::unionWithRect(const Rect & rect) const -{ - float thisLeftX = origin.x; - float thisRightX = origin.x + size.width; - float thisTopY = origin.y + size.height; - float thisBottomY = origin.y; - - if (thisRightX < thisLeftX) - { - std::swap(thisRightX, thisLeftX); // This rect has negative width - } - - if (thisTopY < thisBottomY) - { - std::swap(thisTopY, thisBottomY); // This rect has negative height - } - - float otherLeftX = rect.origin.x; - float otherRightX = rect.origin.x + rect.size.width; - float otherTopY = rect.origin.y + rect.size.height; - float otherBottomY = rect.origin.y; - - if (otherRightX < otherLeftX) - { - std::swap(otherRightX, otherLeftX); // Other rect has negative width - } - - if (otherTopY < otherBottomY) - { - std::swap(otherTopY, otherBottomY); // Other rect has negative height - } - - float combinedLeftX = std::min(thisLeftX, otherLeftX); - float combinedRightX = std::max(thisRightX, otherRightX); - float combinedTopY = std::max(thisTopY, otherTopY); - float combinedBottomY = std::min(thisBottomY, otherBottomY); - - return Rect(combinedLeftX, combinedBottomY, combinedRightX - combinedLeftX, combinedTopY - combinedBottomY); -} - -const Rect Rect::ZERO = Rect(0, 0, 0, 0); - -NS_CC_END diff --git a/cocos/platform/cocoa/CCGeometry.h b/cocos/platform/cocoa/CCGeometry.h deleted file mode 100644 index 47e2fdf9ac..0000000000 --- a/cocos/platform/cocoa/CCGeometry.h +++ /dev/null @@ -1,564 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010 cocos2d-x.org - -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 __CCGEMETRY_H__ -#define __CCGEMETRY_H__ - -#include -#include - -#include "platform/CCPlatformMacros.h" -#include "CCObject.h" -#include "ccMacros.h" - -NS_CC_BEGIN - -/** Clamp a value between from and to. - @since v0.99.1 - */ -inline float clampf(float value, float min_inclusive, float max_inclusive) -{ - if (min_inclusive > max_inclusive) { - CC_SWAP(min_inclusive, max_inclusive, float); - } - return value < min_inclusive ? min_inclusive : value < max_inclusive? value : max_inclusive; -} - -/** - * @addtogroup data_structures - * @{ - */ - -// for Point assignement operator and copy constructor -class CC_DLL Size; - -class CC_DLL Point -{ -public: - float x; - float y; - -public: - /** - * @js NA - */ - Point(); - /** - * @js NA - */ - Point(float x, float y); - /** - * @js NA - * @lua NA - */ - Point(const Point& other); - /** - * @js NA - * @lua NA - */ - explicit Point(const Size& size); - /** - * @js NA - * @lua NA - */ - Point& operator= (const Point& other); - /** - * @js NA - * @lua NA - */ - Point& operator= (const Size& size); - /** - * @js NA - * @lua NA - */ - Point operator+(const Point& right) const; - /** - * @js NA - * @lua NA - */ - Point operator-(const Point& right) const; - /** - * @js NA - * @lua NA - */ - Point operator-() const; - /** - * @js NA - * @lua NA - */ - Point operator*(float a) const; - /** - * @js NA - * @lua NA - */ - Point operator/(float a) const; - /** - * @js NA - * @lua NA - */ - void setPoint(float x, float y); - /** - * @js NA - */ - bool equals(const Point& target) const; - - /** @returns if points have fuzzy equality which means equal with some degree of variance. - @since v2.1.4 - * @js NA - * @lua NA - */ - bool fuzzyEquals(const Point& target, float variance) const; - - /** Calculates distance between point an origin - @return float - @since v2.1.4 - * @js NA - * @lua NA - */ - inline float getLength() const { - return sqrtf(x*x + y*y); - }; - - /** Calculates the square length of a Point (not calling sqrt() ) - @return float - @since v2.1.4 - * @js NA - * @lua NA - */ - inline float getLengthSq() const { - return dot(*this); //x*x + y*y; - }; - - /** Calculates the square distance between two points (not calling sqrt() ) - @return float - @since v2.1.4 - * @js NA - * @lua NA - */ - inline float getDistanceSq(const Point& other) const { - return (*this - other).getLengthSq(); - }; - - /** Calculates the distance between two points - @return float - @since v2.1.4 - * @js NA - * @lua NA - */ - inline float getDistance(const Point& other) const { - return (*this - other).getLength(); - }; - - /** @returns the angle in radians between this vector and the x axis - @since v2.1.4 - * @js NA - * @lua NA - */ - inline float getAngle() const { - return atan2f(y, x); - }; - - /** @returns the angle in radians between two vector directions - @since v2.1.4 - * @js NA - * @lua NA - */ - float getAngle(const Point& other) const; - - /** Calculates dot product of two points. - @return float - @since v2.1.4 - * @js NA - * @lua NA - */ - inline float dot(const Point& other) const { - return x*other.x + y*other.y; - }; - - /** Calculates cross product of two points. - @return float - @since v2.1.4 - * @js NA - * @lua NA - */ - inline float cross(const Point& other) const { - return x*other.y - y*other.x; - }; - - /** Calculates perpendicular of v, rotated 90 degrees counter-clockwise -- cross(v, perp(v)) >= 0 - @return Point - @since v2.1.4 - * @js NA - * @lua NA - */ - inline Point getPerp() const { - return Point(-y, x); - }; - - /** Calculates midpoint between two points. - @return Point - @since v3.0 - * @js NA - * @lua NA - */ - inline Point getMidpoint(const Point& other) const - { - return Point((x + other.x) / 2.0f, (y + other.y) / 2.0f); - } - - /** Clamp a point between from and to. - @since v3.0 - * @js NA - * @lua NA - */ - inline Point getClampPoint(const Point& min_inclusive, const Point& max_inclusive) const - { - return Point(clampf(x,min_inclusive.x,max_inclusive.x), clampf(y, min_inclusive.y, max_inclusive.y)); - } - - /** Run a math operation function on each point component - * absf, fllorf, ceilf, roundf - * any function that has the signature: float func(float); - * For example: let's try to take the floor of x,y - * p.compOp(floorf); - @since v3.0 - * @js NA - * @lua NA - */ - inline Point compOp(std::function function) const - { - return Point(function(x), function(y)); - } - - /** Calculates perpendicular of v, rotated 90 degrees clockwise -- cross(v, rperp(v)) <= 0 - @return Point - @since v2.1.4 - * @js NA - * @lua NA - */ - inline Point getRPerp() const { - return Point(y, -x); - }; - - /** Calculates the projection of this over other. - @return Point - @since v2.1.4 - * @js NA - * @lua NA - */ - inline Point project(const Point& other) const { - return other * (dot(other)/other.dot(other)); - }; - - /** Complex multiplication of two points ("rotates" two points). - @return Point vector with an angle of this.getAngle() + other.getAngle(), - and a length of this.getLength() * other.getLength(). - @since v2.1.4 - * @js NA - * @lua NA - */ - inline Point rotate(const Point& other) const { - return Point(x*other.x - y*other.y, x*other.y + y*other.x); - }; - - /** Unrotates two points. - @return Point vector with an angle of this.getAngle() - other.getAngle(), - and a length of this.getLength() * other.getLength(). - @since v2.1.4 - * @js NA - * @lua NA - */ - inline Point unrotate(const Point& other) const { - return Point(x*other.x + y*other.y, y*other.x - x*other.y); - }; - - /** Returns point multiplied to a length of 1. - * If the point is 0, it returns (1, 0) - @return Point - @since v2.1.4 - * @js NA - * @lua NA - */ - inline Point normalize() const { - float length = getLength(); - if(length == 0.) return Point(1.f, 0); - return *this / getLength(); - }; - - /** Linear Interpolation between two points a and b - @returns - alpha == 0 ? a - alpha == 1 ? b - otherwise a value between a..b - @since v2.1.4 - * @js NA - * @lua NA - */ - inline Point lerp(const Point& other, float alpha) const { - return *this * (1.f - alpha) + other * alpha; - }; - - /** Rotates a point counter clockwise by the angle around a pivot - @param pivot is the pivot, naturally - @param angle is the angle of rotation ccw in radians - @returns the rotated point - @since v2.1.4 - * @js NA - * @lua NA - */ - Point rotateByAngle(const Point& pivot, float angle) const; - - /** - * @js NA - * @lua NA - */ - static inline Point forAngle(const float a) - { - return Point(cosf(a), sinf(a)); - } - - /** A general line-line intersection test - @param A the startpoint for the first line L1 = (A - B) - @param B the endpoint for the first line L1 = (A - B) - @param C the startpoint for the second line L2 = (C - D) - @param D the endpoint for the second line L2 = (C - D) - @param S the range for a hitpoint in L1 (p = A + S*(B - A)) - @param T the range for a hitpoint in L2 (p = C + T*(D - C)) - @returns whether these two lines interects. - - Note that to truly test intersection for segments we have to make - sure that S & T lie within [0..1] and for rays, make sure S & T > 0 - the hit point is C + T * (D - C); - the hit point also is A + S * (B - A); - @since 3.0 - * @js NA - * @lua NA - */ - static bool isLineIntersect(const Point& A, const Point& B, - const Point& C, const Point& D, - float *S = nullptr, float *T = nullptr); - - /** - returns true if Line A-B overlap with segment C-D - @since v3.0 - * @js NA - * @lua NA - */ - static bool isLineOverlap(const Point& A, const Point& B, - const Point& C, const Point& D); - - /** - returns true if Line A-B parallel with segment C-D - @since v3.0 - * @js NA - * @lua NA - */ - static bool isLineParallel(const Point& A, const Point& B, - const Point& C, const Point& D); - - /** - returns true if Segment A-B overlap with segment C-D - @since v3.0 - * @js NA - * @lua NA - */ - static bool isSegmentOverlap(const Point& A, const Point& B, - const Point& C, const Point& D, - Point* S = nullptr, Point* E = nullptr); - - /** - returns true if Segment A-B intersects with segment C-D - @since v3.0 - * @js NA - * @lua NA - */ - static bool isSegmentIntersect(const Point& A, const Point& B, const Point& C, const Point& D); - - /** - returns the intersection point of line A-B, C-D - @since v3.0 - * @js NA - * @lua NA - */ - static Point getIntersectPoint(const Point& A, const Point& B, const Point& C, const Point& D); - - static const Point ZERO; - -private: - // returns true if segment A-B intersects with segment C-D. S->E is the ovderlap part - static bool isOneDemensionSegmentOverlap(float A, float B, float C, float D, float *S, float * E); - - // cross procuct of 2 vector. A->B X C->D - static float crossProduct2Vector(const Point& A, const Point& B, const Point& C, const Point& D) { return (D.y - C.y) * (B.x - A.x) - (D.x - C.x) * (B.y - A.y); } -}; - -class CC_DLL Size -{ -public: - float width; - float height; - -public: - /** - * @js NA - */ - Size(); - /** - * @js NA - */ - Size(float width, float height); - /** - * @js NA - * @lua NA - */ - Size(const Size& other); - /** - * @js NA - * @lua NA - */ - explicit Size(const Point& point); - /** - * @js NA - * @lua NA - */ - Size& operator= (const Size& other); - /** - * @js NA - * @lua NA - */ - Size& operator= (const Point& point); - /** - * @js NA - * @lua NA - */ - Size operator+(const Size& right) const; - /** - * @js NA - * @lua NA - */ - Size operator-(const Size& right) const; - /** - * @js NA - * @lua NA - */ - Size operator*(float a) const; - /** - * @js NA - * @lua NA - */ - Size operator/(float a) const; - /** - * @js NA - * @lua NA - */ - void setSize(float width, float height); - /** - * @js NA - */ - bool equals(const Size& target) const; - - static const Size ZERO; -}; - -class CC_DLL Rect -{ -public: - Point origin; - Size size; - -public: - /** - * @js NA - */ - Rect(); - /** - * @js NA - */ - Rect(float x, float y, float width, float height); - /** - * @js NA - * @lua NA - */ - Rect(const Rect& other); - /** - * @js NA - * @lua NA - */ - Rect& operator= (const Rect& other); - /** - * @js NA - * @lua NA - */ - void setRect(float x, float y, float width, float height); - /** - * @js NA - */ - float getMinX() const; /// return the leftmost x-value of current rect - /** - * @js NA - */ - float getMidX() const; /// return the midpoint x-value of current rect - /** - * @js NA - */ - float getMaxX() const; /// return the rightmost x-value of current rect - /** - * @js NA - */ - float getMinY() const; /// return the bottommost y-value of current rect - /** - * @js NA - */ - float getMidY() const; /// return the midpoint y-value of current rect - /** - * @js NA - */ - float getMaxY() const; /// return the topmost y-value of current rect - /** - * @js NA - */ - bool equals(const Rect& rect) const; - /** - * @js NA - */ - bool containsPoint(const Point& point) const; - /** - * @js NA - */ - bool intersectsRect(const Rect& rect) const; - /** - * @js NA - * @lua NA - */ - Rect unionWithRect(const Rect & rect) const; - - static const Rect ZERO; -}; - -// end of data_structure group -/// @} - -NS_CC_END - -#endif // __CCGEMETRY_H__ diff --git a/cocos/platform/cocoa/CCInteger.h b/cocos/platform/cocoa/CCInteger.h deleted file mode 100644 index 23735627dd..0000000000 --- a/cocos/platform/cocoa/CCInteger.h +++ /dev/null @@ -1,79 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010-2012 cocos2d-x.org - - 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 __CCINTEGER_H__ -#define __CCINTEGER_H__ - -#include "CCObject.h" -#include "platform/CCCommon.h" - -NS_CC_BEGIN - -/** - * @addtogroup data_structures - * @{ - */ - -class CC_DLL Integer : public Object, public Clonable -{ -public: - static Integer* create(int v) - { - Integer* pRet = new Integer(v); - pRet->autorelease(); - return pRet; - } - /** - * @js NA - */ - Integer(int v) - : _value(v) {} - int getValue() const {return _value;} - /** - * @js NA - * @lua NA - */ - virtual ~Integer() { - CCLOGINFO("deallocing ~Integer: %p", this); - } - - /* override functions */ - virtual void acceptVisitor(DataVisitor &visitor) { visitor.visit(this); } - - // overrides - virtual Integer* clone() const override - { - return Integer::create(_value); - } - -private: - int _value; -}; - -// end of data_structure group -/// @} - -NS_CC_END - -#endif /* __CCINTEGER_H__ */ diff --git a/cocos/platform/cocoa/CCNS.cpp b/cocos/platform/cocoa/CCNS.cpp deleted file mode 100644 index 8cf496c0b1..0000000000 --- a/cocos/platform/cocoa/CCNS.cpp +++ /dev/null @@ -1,185 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010 cocos2d-x.org - -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 "CCNS.h" -#include -#include -#include -#include - -using namespace std; - -NS_CC_BEGIN - -typedef std::vector strArray; - -// string toolkit -static inline void split(std::string src, const char* token, strArray& vect) -{ - int nend=0; - int nbegin=0; - while(nend != -1) - { - nend = src.find(token, nbegin); - if(nend == -1) - vect.push_back(src.substr(nbegin, src.length()-nbegin)); - else - vect.push_back(src.substr(nbegin, nend-nbegin)); - nbegin = nend + strlen(token); - } -} - -// first, judge whether the form of the string like this: {x,y} -// if the form is right,the string will be split into the parameter strs; -// or the parameter strs will be empty. -// if the form is right return true,else return false. -static bool splitWithForm(const char* pStr, strArray& strs) -{ - bool bRet = false; - - do - { - CC_BREAK_IF(!pStr); - - // string is empty - std::string content = pStr; - CC_BREAK_IF(content.length() == 0); - - int nPosLeft = content.find('{'); - int nPosRight = content.find('}'); - - // don't have '{' and '}' - CC_BREAK_IF(nPosLeft == (int)std::string::npos || nPosRight == (int)std::string::npos); - // '}' is before '{' - CC_BREAK_IF(nPosLeft > nPosRight); - - std::string pointStr = content.substr(nPosLeft + 1, nPosRight - nPosLeft - 1); - // nothing between '{' and '}' - CC_BREAK_IF(pointStr.length() == 0); - - int nPos1 = pointStr.find('{'); - int nPos2 = pointStr.find('}'); - // contain '{' or '}' - CC_BREAK_IF(nPos1 != (int)std::string::npos || nPos2 != (int)std::string::npos); - - split(pointStr, ",", strs); - if (strs.size() != 2 || strs[0].length() == 0 || strs[1].length() == 0) - { - strs.clear(); - break; - } - - bRet = true; - } while (0); - - return bRet; -} - -// implement the functions - -Rect RectFromString(const char* pszContent) -{ - Rect result = Rect::ZERO; - - do - { - CC_BREAK_IF(!pszContent); - std::string content = pszContent; - - // find the first '{' and the third '}' - int nPosLeft = content.find('{'); - int nPosRight = content.find('}'); - for (int i = 1; i < 3; ++i) - { - if (nPosRight == (int)std::string::npos) - { - break; - } - nPosRight = content.find('}', nPosRight + 1); - } - CC_BREAK_IF(nPosLeft == (int)std::string::npos || nPosRight == (int)std::string::npos); - - content = content.substr(nPosLeft + 1, nPosRight - nPosLeft - 1); - int nPointEnd = content.find('}'); - CC_BREAK_IF(nPointEnd == (int)std::string::npos); - nPointEnd = content.find(',', nPointEnd); - CC_BREAK_IF(nPointEnd == (int)std::string::npos); - - // get the point string and size string - std::string pointStr = content.substr(0, nPointEnd); - std::string sizeStr = content.substr(nPointEnd + 1, content.length() - nPointEnd); - - // split the string with ',' - strArray pointInfo; - CC_BREAK_IF(!splitWithForm(pointStr.c_str(), pointInfo)); - strArray sizeInfo; - CC_BREAK_IF(!splitWithForm(sizeStr.c_str(), sizeInfo)); - - float x = (float) atof(pointInfo[0].c_str()); - float y = (float) atof(pointInfo[1].c_str()); - float width = (float) atof(sizeInfo[0].c_str()); - float height = (float) atof(sizeInfo[1].c_str()); - - result = Rect(x, y, width, height); - } while (0); - - return result; -} - -Point PointFromString(const char* pszContent) -{ - Point ret = Point::ZERO; - - do - { - strArray strs; - CC_BREAK_IF(!splitWithForm(pszContent, strs)); - - float x = (float) atof(strs[0].c_str()); - float y = (float) atof(strs[1].c_str()); - - ret = Point(x, y); - } while (0); - - return ret; -} - -Size SizeFromString(const char* pszContent) -{ - Size ret = Size::ZERO; - - do - { - strArray strs; - CC_BREAK_IF(!splitWithForm(pszContent, strs)); - - float width = (float) atof(strs[0].c_str()); - float height = (float) atof(strs[1].c_str()); - - ret = Size(width, height); - } while (0); - - return ret; -} - -NS_CC_END diff --git a/cocos/platform/cocoa/CCNS.h b/cocos/platform/cocoa/CCNS.h deleted file mode 100644 index 8ce8e1dde6..0000000000 --- a/cocos/platform/cocoa/CCNS.h +++ /dev/null @@ -1,80 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010 cocos2d-x.org - -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 __PLATFOMR_CCNS_H__ -#define __PLATFOMR_CCNS_H__ - -#include "CCGeometry.h" - -NS_CC_BEGIN - -/** - * @addtogroup data_structures - * @{ - */ - -/** -@brief Returns a Core Graphics rectangle structure corresponding to the data in a given string. -@param pszContent A string object whose contents are of the form "{{x,y},{w, h}}", - where x is the x coordinate, y is the y coordinate, w is the width, and h is the height. - These components can represent integer or float values. - An example of a valid string is "{{3,2},{4,5}}". - The string is not localized, so items are always separated with a comma. -@return A Core Graphics structure that represents a rectangle. - If the string is not well-formed, the function returns Rect::ZERO. -*/ -Rect CC_DLL RectFromString(const char* pszContent); - -/** -@brief Returns a Core Graphics point structure corresponding to the data in a given string. -@param pszContent A string object whose contents are of the form "{x,y}", - where x is the x coordinate and y is the y coordinate. - The x and y values can represent integer or float values. - An example of a valid string is "{3.0,2.5}". - The string is not localized, so items are always separated with a comma. -@return A Core Graphics structure that represents a point. - If the string is not well-formed, the function returns Point::ZERO. -*/ -Point CC_DLL PointFromString(const char* pszContent); - -/** -@brief Returns a Core Graphics size structure corresponding to the data in a given string. -@param pszContent A string object whose contents are of the form "{w, h}", - where w is the width and h is the height. - The w and h values can be integer or float values. - An example of a valid string is "{3.0,2.5}". - The string is not localized, so items are always separated with a comma. -@return A Core Graphics structure that represents a size. - If the string is not well-formed, the function returns Size::ZERO. -*/ -Size CC_DLL SizeFromString(const char* pszContent); - -// end of data_structure group -/// @} - -NS_CC_END - -#endif // __PLATFOMR_CCNS_H__ - - diff --git a/cocos/platform/cocoa/CCObject.cpp b/cocos/platform/cocoa/CCObject.cpp deleted file mode 100644 index 13fa0e3236..0000000000 --- a/cocos/platform/cocoa/CCObject.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010 cocos2d-x.org - -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 "CCObject.h" -#include "CCAutoreleasePool.h" -#include "ccMacros.h" -#include "script_support/CCScriptSupport.h" - -NS_CC_BEGIN - -Object::Object() -: _luaID(0) -, _reference(1) // when the object is created, the reference count of it is 1 -, _autoReleaseCount(0) -{ - static unsigned int uObjectCount = 0; - - _ID = ++uObjectCount; -} - -Object::~Object() -{ - // if the object is managed, we should remove it - // from pool manager - if (_autoReleaseCount > 0) - { - PoolManager::sharedPoolManager()->removeObject(this); - } - - // if the object is referenced by Lua engine, remove it - if (_luaID) - { - ScriptEngineManager::getInstance()->getScriptEngine()->removeScriptObjectByObject(this); - } - else - { - ScriptEngineProtocol* pEngine = ScriptEngineManager::getInstance()->getScriptEngine(); - if (pEngine != NULL && pEngine->getScriptType() == kScriptTypeJavascript) - { - pEngine->removeScriptObjectByObject(this); - } - } -} - -Object* Object::autorelease() -{ - PoolManager::sharedPoolManager()->addObject(this); - return this; -} - -bool Object::isSingleReference() const -{ - return _reference == 1; -} - -unsigned int Object::retainCount() const -{ - return _reference; -} - -bool Object::isEqual(const Object *object) -{ - return this == object; -} - -void Object::acceptVisitor(DataVisitor &visitor) -{ - visitor.visitObject(this); -} - -NS_CC_END diff --git a/cocos/platform/cocoa/CCObject.h b/cocos/platform/cocoa/CCObject.h deleted file mode 100644 index 8de1ff9d8b..0000000000 --- a/cocos/platform/cocoa/CCObject.h +++ /dev/null @@ -1,216 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010 cocos2d-x.org - -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 __CCOBJECT_H__ -#define __CCOBJECT_H__ - -#include "cocoa/CCDataVisitor.h" -#include "ccMacros.h" - -#ifdef EMSCRIPTEN -#include -#endif // EMSCRIPTEN - -NS_CC_BEGIN - -/** - * @addtogroup base_nodes - * @{ - */ - -class Object; -class Node; - -/** Interface that defines how to clone an object */ -class CC_DLL Clonable -{ -public: - /** returns a copy of the object */ - virtual Clonable* clone() const = 0; - /** - * @js NA - * @lua NA - */ - virtual ~Clonable() {}; - - /** returns a copy of the object. - @deprecated Use clone() instead - */ - CC_DEPRECATED_ATTRIBUTE Object* copy() const - { - // use "clone" instead - CC_ASSERT(false); - return nullptr; - } -}; - -class CC_DLL Object -{ -public: - /// object id, ScriptSupport need public _ID - unsigned int _ID; - /// Lua reference id - int _luaID; -protected: - /// count of references - unsigned int _reference; - /// count of autorelease - unsigned int _autoReleaseCount; -public: - /** - * Constructor - * - * The object's reference count is 1 after construction. - * @js NA - */ - Object(); - - /** - * @js NA - * @lua NA - */ - virtual ~Object(); - - /** - * Release the ownership immediately. - * - * This decrements the object's reference count. - * - * If the reference count reaches 0 after the descrement, this object is - * destructed. - * - * @see retain, autorelease - * @js NA - */ - inline void release() - { - CCASSERT(_reference > 0, "reference count should greater than 0"); - --_reference; - - if (_reference == 0) - delete this; - } - - /** - * Retains the ownership. - * - * This increases the object's reference count. - * - * @see release, autorelease - * @js NA - */ - inline void retain() - { - CCASSERT(_reference > 0, "reference count should greater than 0"); - ++_reference; - } - - /** - * Release the ownership sometime soon automatically. - * - * This descrements the object's reference count at the end of current - * autorelease pool block. - * - * If the reference count reaches 0 after the descrement, this object is - * destructed. - * - * @returns The object itself. - * - * @see AutoreleasePool, retain, release - * @js NA - * @lua NA - */ - Object* autorelease(); - - /** - * Returns a boolean value that indicates whether there is only one - * reference to the object. That is, whether the reference count is 1. - * - * @returns Whether the object's reference count is 1. - * @js NA - */ - bool isSingleReference() const; - - /** - * Returns the object's current reference count. - * - * @returns The object's reference count. - * @js NA - */ - unsigned int retainCount() const; - - /** - * Returns a boolean value that indicates whether this object and a given - * object are equal. - * - * @param object The object to be compared to this object. - * - * @returns True if this object and @p object are equal, otherwise false. - * @js NA - * @lua NA - */ - virtual bool isEqual(const Object* object); - /** - * @js NA - * @lua NA - */ - virtual void acceptVisitor(DataVisitor &visitor); - /** - * @js NA - * @lua NA - */ - virtual void update(float dt) {CC_UNUSED_PARAM(dt);}; - - friend class AutoreleasePool; -}; - - -typedef void (Object::*SEL_SCHEDULE)(float); -typedef void (Object::*SEL_CallFunc)(); -typedef void (Object::*SEL_CallFuncN)(Node*); -typedef void (Object::*SEL_CallFuncND)(Node*, void*); -typedef void (Object::*SEL_CallFuncO)(Object*); -typedef void (Object::*SEL_MenuHandler)(Object*); -typedef int (Object::*SEL_Compare)(Object*); - -#define schedule_selector(_SELECTOR) static_cast(&_SELECTOR) -#define callfunc_selector(_SELECTOR) static_cast(&_SELECTOR) -#define callfuncN_selector(_SELECTOR) static_cast(&_SELECTOR) -#define callfuncND_selector(_SELECTOR) static_cast(&_SELECTOR) -#define callfuncO_selector(_SELECTOR) static_cast(&_SELECTOR) -#define menu_selector(_SELECTOR) static_cast(&_SELECTOR) -#define event_selector(_SELECTOR) static_cast(&_SELECTOR) -#define compare_selector(_SELECTOR) static_cast(&_SELECTOR) - -// new callbacks based on C++11 -#define CC_CALLBACK_0(__selector__,__target__, ...) std::bind(&__selector__,__target__, ##__VA_ARGS__) -#define CC_CALLBACK_1(__selector__,__target__, ...) std::bind(&__selector__,__target__, std::placeholders::_1, ##__VA_ARGS__) -#define CC_CALLBACK_2(__selector__,__target__, ...) std::bind(&__selector__,__target__, std::placeholders::_1, std::placeholders::_2, ##__VA_ARGS__) - -// end of base_nodes group -/// @} - -NS_CC_END - -#endif // __CCOBJECT_H__ diff --git a/cocos/platform/cocoa/CCSet.cpp b/cocos/platform/cocoa/CCSet.cpp deleted file mode 100644 index c3c24e0e5e..0000000000 --- a/cocos/platform/cocoa/CCSet.cpp +++ /dev/null @@ -1,166 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010 cocos2d-x.org - -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 "CCSet.h" - -using namespace std; - -NS_CC_BEGIN - -Set::Set(void) -{ - _set = new set; -} - -Set::Set(const Set &rSetObject) -{ - _set = new set(*rSetObject._set); - - // call retain of members - SetIterator iter; - for (iter = _set->begin(); iter != _set->end(); ++iter) - { - if (! (*iter)) - { - break; - } - - (*iter)->retain(); - } -} - -Set::~Set(void) -{ - removeAllObjects(); - CC_SAFE_DELETE(_set); -} - -void Set::acceptVisitor(DataVisitor &visitor) -{ - visitor.visit(this); -} - -Set * Set::create() -{ - Set * pRet = new Set(); - - if (pRet != NULL) - { - pRet->autorelease(); - } - - return pRet; -} - -Set* Set::copy(void) -{ - Set *pSet = new Set(*this); - - return pSet; -} - -Set* Set::mutableCopy(void) -{ - return copy(); -} - -int Set::count(void) -{ - return (int)_set->size(); -} - -void Set::addObject(Object *pObject) -{ - if (_set->count(pObject) == 0) - { - CC_SAFE_RETAIN(pObject); - _set->insert(pObject); - } -} - -void Set::removeObject(Object *pObject) -{ - if (_set->erase(pObject) > 0) - { - CC_SAFE_RELEASE(pObject); - } -} - -void Set::removeAllObjects() -{ - SetIterator it = _set->begin(); - SetIterator tmp; - - while (it != _set->end()) - { - if (!(*it)) - { - break; - } - - tmp = it; - ++tmp; - Object * obj = *it; - _set->erase(it); - CC_SAFE_RELEASE(obj); - it = tmp; - } -} - -bool Set::containsObject(Object *pObject) -{ - return _set->find(pObject) != _set->end(); -} - -SetIterator Set::begin(void) -{ - return _set->begin(); -} - -SetIterator Set::end(void) -{ - return _set->end(); -} - -Object* Set::anyObject() -{ - if (!_set || _set->empty()) - { - return 0; - } - - SetIterator it; - - for( it = _set->begin(); it != _set->end(); ++it) - { - if (*it) - { - return (*it); - } - } - - return 0; -} - -NS_CC_END diff --git a/cocos/platform/cocoa/CCSet.h b/cocos/platform/cocoa/CCSet.h deleted file mode 100644 index c748f0ada5..0000000000 --- a/cocos/platform/cocoa/CCSet.h +++ /dev/null @@ -1,119 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org - -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 __CC_SET_H__ -#define __CC_SET_H__ - -#include -#include "CCObject.h" - -NS_CC_BEGIN - -/** - * @addtogroup data_structures - * @{ - */ - -typedef std::set::iterator SetIterator; - -class CC_DLL Set : public Object -{ -public: - /** - * @js ctor - */ - Set(void); - Set(const Set &rSetObject); - /** - * @js NA - * @lua NA - */ - virtual ~Set(void); - - /** - * @brief Create and return a new empty set. - */ - static Set * create(); - - /** - *@brief Return a copy of the Set, it will copy all the elements. - */ - Set* copy(); - /** - *@brief It is the same as copy(). - */ - Set* mutableCopy(); - /** - *@brief Return the number of elements the Set contains. - */ - int count(); - /** - *@brief Add a element into Set, it will retain the element. - */ - void addObject(Object *pObject); - /** - *@brief Remove the given element, nothing todo if no element equals pObject. - */ - void removeObject(Object *pObject); - /** - *@brief Remove all elements of the set - */ - void removeAllObjects(); - /** - *@brief Check if Set contains a element equals pObject. - */ - bool containsObject(Object *pObject); - /** - *@brief Return the iterator that points to the first element. - * @js NA - * @lua NA - */ - SetIterator begin(); - /** - *@brief Return the iterator that points to the position after the last element. - * @js NA - * @lua NA - */ - SetIterator end(); - /** - *@brief Return the first element if it contains elements, or null if it doesn't contain any element. - */ - Object* anyObject(); - /** - * @js NA - * @lua NA - */ - virtual void acceptVisitor(DataVisitor &visitor); - -private: - std::set *_set; -}; - -// end of data_structure group -/// @} - -NS_CC_END - -#endif // __CC_SET_H__ - diff --git a/cocos/platform/cocoa/CCString.cpp b/cocos/platform/cocoa/CCString.cpp deleted file mode 100644 index f9962b1ba4..0000000000 --- a/cocos/platform/cocoa/CCString.cpp +++ /dev/null @@ -1,277 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010-2012 cocos2d-x.org - - 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 "CCString.h" -#include "platform/CCFileUtils.h" -#include "ccMacros.h" -#include -#include -#include "CCArray.h" - -NS_CC_BEGIN - -#define kMaxStringLen (1024*100) - -String::String() - :_string("") -{} - -String::String(const char * str) - :_string(str) -{} - -String::String(const std::string& str) - :_string(str) -{} - -String::String(const String& str) - :_string(str.getCString()) -{} - -String::~String() -{ - CCLOGINFO("deallocing String: %p", this); - - _string.clear(); -} - -String& String::operator= (const String& other) -{ - _string = other._string; - return *this; -} - -bool String::initWithFormatAndValist(const char* format, va_list ap) -{ - bool bRet = false; - char* pBuf = (char*)malloc(kMaxStringLen); - if (pBuf != NULL) - { - vsnprintf(pBuf, kMaxStringLen, format, ap); - _string = pBuf; - free(pBuf); - bRet = true; - } - return bRet; -} - -bool String::initWithFormat(const char* format, ...) -{ - bool bRet = false; - _string.clear(); - - va_list ap; - va_start(ap, format); - - bRet = initWithFormatAndValist(format, ap); - - va_end(ap); - - return bRet; -} - -int String::intValue() const -{ - if (length() == 0) - { - return 0; - } - return atoi(_string.c_str()); -} - -unsigned int String::uintValue() const -{ - if (length() == 0) - { - return 0; - } - return (unsigned int)atoi(_string.c_str()); -} - -float String::floatValue() const -{ - if (length() == 0) - { - return 0.0f; - } - return (float)atof(_string.c_str()); -} - -double String::doubleValue() const -{ - if (length() == 0) - { - return 0.0; - } - return atof(_string.c_str()); -} - -bool String::boolValue() const -{ - if (length() == 0) - { - return false; - } - - if (0 == strcmp(_string.c_str(), "0") || 0 == strcmp(_string.c_str(), "false")) - { - return false; - } - return true; -} - -const char* String::getCString() const -{ - return _string.c_str(); -} - -unsigned int String::length() const -{ - return _string.length(); -} - -int String::compare(const char * pStr) const -{ - return strcmp(getCString(), pStr); -} - -void String::append(const std::string& str) -{ - _string.append(str); -} - -void String::appendWithFormat(const char* format, ...) -{ - va_list ap; - va_start(ap, format); - - char* pBuf = (char*)malloc(kMaxStringLen); - if (pBuf != NULL) - { - vsnprintf(pBuf, kMaxStringLen, format, ap); - _string.append(pBuf); - free(pBuf); - } - - va_end(ap); - -} - -Array* String::componentsSeparatedByString(const char *delimiter) -{ - Array* result = Array::create(); - - int cutAt; - while( (cutAt = _string.find_first_of(delimiter)) != _string.npos ) - { - if(cutAt > 0) - { - result->addObject(String::create(_string.substr(0, cutAt))); - } - _string = _string.substr(cutAt + 1); - } - - if(_string.length() > 0) - { - result->addObject(String::create(_string)); - } - - return result; -} - -bool String::isEqual(const Object* pObject) -{ - bool bRet = false; - const String* pStr = dynamic_cast(pObject); - if (pStr != NULL) - { - if (0 == _string.compare(pStr->_string)) - { - bRet = true; - } - } - return bRet; -} - -String* String::create(const std::string& str) -{ - String* pRet = new String(str); - pRet->autorelease(); - return pRet; -} - -String* String::createWithData(const unsigned char* pData, unsigned long nLen) -{ - String* pRet = NULL; - if (pData != NULL) - { - char* pStr = (char*)malloc(nLen+1); - if (pStr != NULL) - { - pStr[nLen] = '\0'; - if (nLen > 0) - { - memcpy(pStr, pData, nLen); - } - - pRet = String::create(pStr); - free(pStr); - } - } - return pRet; -} - -String* String::createWithFormat(const char* format, ...) -{ - String* pRet = String::create(""); - va_list ap; - va_start(ap, format); - pRet->initWithFormatAndValist(format, ap); - va_end(ap); - - return pRet; -} - -String* String::createWithContentsOfFile(const char* filename) -{ - unsigned long size = 0; - unsigned char* pData = 0; - String* pRet = NULL; - pData = FileUtils::getInstance()->getFileData(filename, "rb", &size); - pRet = String::createWithData(pData, size); - CC_SAFE_DELETE_ARRAY(pData); - return pRet; -} - -void String::acceptVisitor(DataVisitor &visitor) -{ - visitor.visit(this); -} - -String* String::clone() const -{ - return String::create(_string); -} - -NS_CC_END diff --git a/cocos/platform/cocoa/CCString.h b/cocos/platform/cocoa/CCString.h deleted file mode 100644 index a6f237a476..0000000000 --- a/cocos/platform/cocoa/CCString.h +++ /dev/null @@ -1,210 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010 cocos2d-x.org - -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 __CCSTRING_H__ -#define __CCSTRING_H__ - -#if (CC_TARGET_PLATFORM == CC_PLATFORM_BLACKBERRY) -#include -#endif - -#include -#include -#include -#include "CCObject.h" - -NS_CC_BEGIN - -/** - * @addtogroup data_structures - * @{ - */ - -class CC_DLL String : public Object, public Clonable -{ -public: - /** - * @js NA - * @lua NA - */ - String(); - /** - * @js NA - * @lua NA - */ - String(const char* str); - /** - * @js NA - * @lua NA - */ - String(const std::string& str); - /** - * @js NA - * @lua NA - */ - String(const String& str); - /** - * @js NA - * @lua NA - */ - virtual ~String(); - - /* override assignment operator - * @js NA - * @lua NA - */ - String& operator= (const String& other); - - /** init a string with format, it's similar with the c function 'sprintf' - * @js NA - * @lua NA - */ - bool initWithFormat(const char* format, ...) CC_FORMAT_PRINTF(2, 3); - - /** convert to int value - * @js NA - */ - int intValue() const; - - /** convert to unsigned int value - * @js NA - */ - unsigned int uintValue() const; - - /** convert to float value - * @js NA - */ - float floatValue() const; - - /** convert to double value - * @js NA - */ - double doubleValue() const; - - /** convert to bool value - * @js NA - */ - bool boolValue() const; - - /** get the C string - * @js NA - */ - const char* getCString() const; - - /** get the length of string - * @js NA - */ - unsigned int length() const; - - /** compare to a c string - * @js NA - */ - int compare(const char *) const; - - /** append additional characters at the end of its current value - * @js NA - * @lua NA - */ - void append(const std::string& str); - - /** append(w/ format) additional characters at the end of its current value - * @js NA - * @lua NA - */ - void appendWithFormat(const char* format, ...); - - /** split a string - * @js NA - * @lua NA - */ - Array* componentsSeparatedByString(const char *delimiter); - - /* override functions - * @js NA - */ - virtual bool isEqual(const Object* pObject); - - /** create a string with std string, you can also pass a c string pointer because the default constructor of std::string can access a c string pointer. - * @return A String pointer which is an autorelease object pointer, - * it means that you needn't do a release operation unless you retain it. - * @js NA - */ - static String* create(const std::string& str); - - /** create a string with format, it's similar with the c function 'sprintf', the default buffer size is (1024*100) bytes, - * if you want to change it, you should modify the kMaxStringLen macro in String.cpp file. - * @return A String pointer which is an autorelease object pointer, - * it means that you needn't do a release operation unless you retain it. - * @js NA - */ - static String* createWithFormat(const char* format, ...) CC_FORMAT_PRINTF(1, 2); - - /** create a string with binary data - * @return A String pointer which is an autorelease object pointer, - * it means that you needn't do a release operation unless you retain it. - * @js NA - */ - static String* createWithData(const unsigned char* pData, unsigned long nLen); - - /** create a string with a file, - * @return A String pointer which is an autorelease object pointer, - * it means that you needn't do a release operation unless you retain it. - * @js NA - */ - static String* createWithContentsOfFile(const char* filename); - /** - * @js NA - * @lua NA - */ - virtual void acceptVisitor(DataVisitor &visitor); - /** - * @js NA - * @lua NA - */ - virtual String* clone() const; - -private: - - /** only for internal use */ - bool initWithFormatAndValist(const char* format, va_list ap); - -public: - std::string _string; -}; - -struct StringCompare : public std::binary_function { - public: - bool operator() (String * a, String * b) const { - return strcmp(a->getCString(), b->getCString()) < 0; - } -}; - -#define StringMake(str) String::create(str) -#define ccs StringMake - -// end of data_structure group -/// @} - -NS_CC_END - -#endif //__CCSTRING_H__ From 95acb1b9e37b55214ed30a0586c47cd18e31f3d3 Mon Sep 17 00:00:00 2001 From: minggo Date: Mon, 14 Oct 2013 14:01:00 +0800 Subject: [PATCH 25/64] issue #2905: helloworld build ok on android --- cocos/2d/Android.mk | 340 +++++++++--------- cocos/2d/CCAction.cpp | 2 +- cocos/2d/CCAction.h | 6 +- cocos/2d/CCActionCamera.cpp | 2 +- cocos/2d/CCActionCatmullRom.h | 4 +- cocos/2d/CCActionGrid.cpp | 2 +- cocos/2d/CCActionInstant.cpp | 6 +- cocos/2d/CCActionInterval.cpp | 4 +- cocos/2d/CCActionInterval.h | 6 +- cocos/2d/CCActionManager.cpp | 8 +- cocos/2d/CCActionManager.h | 4 +- cocos/2d/CCActionProgressTimer.cpp | 2 +- cocos/2d/CCActionTiledGrid.cpp | 2 +- cocos/2d/CCAnimation.cpp | 6 +- cocos/2d/CCAnimation.h | 10 +- cocos/2d/CCAnimationCache.cpp | 2 +- cocos/2d/CCAnimationCache.h | 4 +- cocos/2d/CCAtlasNode.cpp | 12 +- cocos/2d/CCCamera.cpp | 4 +- cocos/2d/CCCamera.h | 2 +- cocos/2d/CCClippingNode.cpp | 6 +- cocos/2d/CCClippingNode.h | 2 +- cocos/2d/CCComponent.cpp | 2 +- cocos/2d/CCComponent.h | 2 +- cocos/2d/CCComponentContainer.cpp | 4 +- cocos/2d/CCComponentContainer.h | 2 +- cocos/2d/CCConfiguration.cpp | 6 +- cocos/2d/CCConfiguration.h | 4 +- cocos/2d/CCDeprecated.h | 2 +- cocos/2d/CCDirector.cpp | 38 +- cocos/2d/CCDirector.h | 10 +- cocos/2d/CCDrawNode.cpp | 4 +- cocos/2d/CCDrawNode.h | 2 +- cocos/2d/CCDrawingPrimitives.cpp | 8 +- cocos/2d/CCDrawingPrimitives.h | 2 +- cocos/2d/CCEvent.h | 2 +- cocos/2d/CCEventDispatcher.cpp | 2 +- cocos/2d/CCEventDispatcher.h | 2 +- cocos/2d/CCEventListener.h | 4 +- cocos/2d/CCEventListenerTouch.h | 2 +- cocos/2d/CCEventTouch.h | 2 +- cocos/2d/CCFont.cpp | 2 +- cocos/2d/CCFontFreeType.cpp | 2 +- cocos/2d/CCGLProgram.cpp | 4 +- cocos/2d/CCGLProgram.h | 2 +- cocos/2d/CCGrabber.cpp | 2 +- cocos/2d/CCGrabber.h | 2 +- cocos/2d/CCGrid.cpp | 14 +- cocos/2d/CCGrid.h | 8 +- cocos/2d/CCIMEDelegate.h | 2 +- cocos/2d/CCLabel.h | 2 +- cocos/2d/CCLabelAtlas.cpp | 16 +- cocos/2d/CCLabelAtlas.h | 2 +- cocos/2d/CCLabelBMFont.cpp | 12 +- cocos/2d/CCLabelBMFont.h | 4 +- cocos/2d/CCLabelTTF.cpp | 4 +- cocos/2d/CCLabelTTF.h | 4 +- cocos/2d/CCLabelTextFormatter.cpp | 2 +- cocos/2d/CCLayer.cpp | 24 +- cocos/2d/CCLayer.h | 10 +- cocos/2d/CCMenu.cpp | 6 +- cocos/2d/CCMenu.h | 4 +- cocos/2d/CCMenuItem.cpp | 10 +- cocos/2d/CCMenuItem.h | 4 +- cocos/2d/CCMotionStreak.cpp | 10 +- cocos/2d/CCMotionStreak.h | 6 +- cocos/2d/CCNode.cpp | 28 +- cocos/2d/CCNode.h | 14 +- cocos/2d/CCNotificationCenter.cpp | 4 +- cocos/2d/CCNotificationCenter.h | 4 +- cocos/2d/CCParallaxNode.cpp | 2 +- cocos/2d/CCParallaxNode.h | 4 +- cocos/2d/CCParticleBatchNode.cpp | 18 +- cocos/2d/CCParticleBatchNode.h | 2 +- cocos/2d/CCParticleExamples.cpp | 2 +- cocos/2d/CCParticleSystem.cpp | 10 +- cocos/2d/CCParticleSystem.h | 6 +- cocos/2d/CCParticleSystemQuad.cpp | 14 +- cocos/2d/CCProfiling.h | 4 +- cocos/2d/CCProgressTimer.cpp | 12 +- cocos/2d/CCProgressTimer.h | 4 +- cocos/2d/CCProtocols.h | 2 +- cocos/2d/CCRenderTexture.cpp | 14 +- cocos/2d/CCRenderTexture.h | 4 +- cocos/2d/CCScene.cpp | 6 +- cocos/2d/CCScene.h | 4 +- cocos/2d/CCScheduler.cpp | 8 +- cocos/2d/CCScheduler.h | 4 +- cocos/2d/CCScriptSupport.h | 8 +- cocos/2d/CCShaderCache.h | 2 +- cocos/2d/CCSprite.cpp | 20 +- cocos/2d/CCSprite.h | 10 +- cocos/2d/CCSpriteBatchNode.cpp | 20 +- cocos/2d/CCSpriteBatchNode.h | 4 +- cocos/2d/CCSpriteFrame.cpp | 2 +- cocos/2d/CCSpriteFrame.h | 6 +- cocos/2d/CCSpriteFrameCache.cpp | 12 +- cocos/2d/CCSpriteFrameCache.h | 6 +- cocos/2d/CCTMXLayer.cpp | 10 +- cocos/2d/CCTMXLayer.h | 6 +- cocos/2d/CCTMXObjectGroup.h | 8 +- cocos/2d/CCTMXTiledMap.cpp | 2 +- cocos/2d/CCTMXTiledMap.h | 2 +- cocos/2d/CCTMXXMLParser.cpp | 4 +- cocos/2d/CCTMXXMLParser.h | 6 +- cocos/2d/CCTextFieldTTF.h | 4 +- cocos/2d/CCTexture2D.cpp | 10 +- cocos/2d/CCTexture2D.h | 6 +- cocos/2d/CCTextureAtlas.cpp | 8 +- cocos/2d/CCTextureAtlas.h | 2 +- cocos/2d/CCTextureCache.cpp | 4 +- cocos/2d/CCTextureCache.h | 4 +- cocos/2d/CCTileMapAtlas.cpp | 8 +- cocos/2d/CCTileMapAtlas.h | 2 +- cocos/2d/CCTouch.h | 4 +- cocos/2d/CCTransition.cpp | 14 +- cocos/2d/CCTransitionPageTurn.cpp | 8 +- cocos/2d/CCTransitionProgress.cpp | 8 +- cocos/2d/CCUserDefault.cpp | 4 +- cocos/2d/CCUserDefault.h | 4 +- cocos/2d/CCUserDefault.mm | 6 +- cocos/2d/CCUserDefaultAndroid.cpp | 4 +- cocos/2d/TransformUtils.cpp | 2 +- cocos/2d/ZipUtils.h | 2 +- cocos/2d/base64.cpp | 2 +- cocos/2d/ccCArray.cpp | 2 +- cocos/2d/ccCArray.h | 2 +- cocos/2d/ccConfig.h | 2 +- cocos/2d/ccGLStateCache.h | 2 +- cocos/2d/ccShaders.h | 2 +- cocos/2d/ccTypes.cpp | 2 +- cocos/2d/ccTypes.h | 2 +- cocos/2d/ccUTF8.h | 2 +- cocos/2d/cocos2d.h | 197 +++++----- cocos/2d/platform/CCEGLViewProtocol.cpp | 6 +- cocos/2d/platform/CCEGLViewProtocol.h | 2 +- cocos/2d/platform/CCFileUtils.cpp | 8 +- cocos/2d/platform/CCImage.h | 4 +- cocos/2d/platform/CCImageCommon_cpp.h | 19 +- cocos/2d/platform/CCSAXParser.cpp | 4 +- cocos/2d/platform/android/Android.mk | 14 +- cocos/2d/platform/android/CCEGLView.cpp | 2 +- cocos/2d/platform/android/CCEGLView.h | 2 +- .../2d/platform/android/CCFileUtilsAndroid.h | 2 +- cocos/2d/platform/android/CCImage.cpp | 2 +- cocos/2d/platform/android/CCStdC.h | 2 +- cocos/2d/platform/android/jni/IMEJni.cpp | 2 +- .../Java_org_cocos2dx_lib_Cocos2dxBitmap.cpp | 2 +- .../Java_org_cocos2dx_lib_Cocos2dxHelper.cpp | 2 +- cocos/2d/platform/android/jni/JniHelper.h | 2 +- cocos/2d/platform/android/nativeactivity.cpp | 14 +- cocos/2d/platform/apple/CCFileUtilsApple.mm | 4 +- cocos/2d/platform/ios/CCDevice.mm | 4 +- cocos/2d/platform/ios/CCStdC.h | 2 +- cocos/2d/platform/linux/CCEGLView.cpp | 8 +- cocos/2d/platform/linux/CCEGLView.h | 2 +- cocos/2d/platform/linux/CCFileUtilsLinux.cpp | 2 +- cocos/2d/platform/linux/CCFileUtilsLinux.h | 2 +- cocos/2d/platform/linux/CCImage.cpp | 2 +- cocos/2d/platform/linux/CCStdC.h | 2 +- cocos/2d/platform/mac/CCEGLView.mm | 6 +- cocos/2d/platform/mac/CCEventDispatcher.mm | 2 +- cocos/2d/platform/mac/CCStdC.h | 2 +- cocos/2d/platform/win32/CCEGLView.cpp | 10 +- cocos/2d/platform/win32/CCEGLView.h | 2 +- cocos/2d/platform/win32/CCFileUtilsWin32.h | 2 +- cocos/2d/platform/win32/CCStdC.h | 2 +- cocos/audio/android/Android.mk | 9 +- cocos/base/{cocoa => }/CCAffineTransform.cpp | 0 cocos/base/{cocoa => }/CCAffineTransform.h | 2 +- cocos/base/{cocoa => }/CCArray.cpp | 0 cocos/base/{cocoa => }/CCArray.h | 4 +- cocos/base/{cocoa => }/CCAutoreleasePool.cpp | 0 cocos/base/{cocoa => }/CCAutoreleasePool.h | 0 cocos/base/{cocoa => }/CCBool.h | 0 cocos/base/{cocoa => }/CCData.cpp | 0 cocos/base/{cocoa => }/CCData.h | 2 +- cocos/base/{cocoa => }/CCDataVisitor.cpp | 0 cocos/base/{cocoa => }/CCDataVisitor.h | 2 +- cocos/base/{cocoa => }/CCDictionary.cpp | 0 cocos/base/{cocoa => }/CCDictionary.h | 2 +- cocos/base/{cocoa => }/CCDouble.h | 0 cocos/base/{cocoa => }/CCFloat.h | 0 cocos/base/{cocoa => }/CCGeometry.cpp | 0 cocos/base/{cocoa => }/CCGeometry.h | 2 +- cocos/base/{cocoa => }/CCInteger.h | 0 cocos/base/{cocoa => }/CCNS.cpp | 0 cocos/base/{cocoa => }/CCNS.h | 0 cocos/base/{cocoa => }/CCObject.cpp | 2 +- cocos/base/{cocoa => }/CCObject.h | 2 +- cocos/base/{cocoa => }/CCSet.cpp | 0 cocos/base/{cocoa => }/CCSet.h | 0 cocos/base/{cocoa => }/CCString.cpp | 0 cocos/base/{cocoa => }/CCString.h | 0 cocos/base/{atitc => }/atitc.cpp | 0 cocos/base/{atitc => }/atitc.h | 0 cocos/base/{etc1 => }/etc1.cpp | 0 cocos/base/{etc1 => }/etc1.h | 0 cocos/base/{s3tc => }/s3tc.cpp | 0 cocos/base/{s3tc => }/s3tc.h | 0 .../math/kazmath/include/kazmath/GL/matrix.h | 2 +- cocos/math/kazmath/include/kazmath/aabb.h | 2 +- cocos/math/kazmath/include/kazmath/mat3.h | 2 +- cocos/math/kazmath/include/kazmath/mat4.h | 2 +- cocos/math/kazmath/include/kazmath/plane.h | 2 +- .../math/kazmath/include/kazmath/quaternion.h | 2 +- cocos/math/kazmath/include/kazmath/ray2.h | 2 +- cocos/math/kazmath/include/kazmath/utility.h | 2 +- cocos/math/kazmath/include/kazmath/vec2.h | 2 +- cocos/math/kazmath/include/kazmath/vec3.h | 2 +- cocos/math/kazmath/include/kazmath/vec4.h | 2 +- cocos/physics/CCPhysicsBody.h | 4 +- cocos/physics/CCPhysicsContact.h | 4 +- cocos/physics/CCPhysicsJoint.h | 4 +- cocos/physics/CCPhysicsShape.h | 4 +- cocos/physics/CCPhysicsWorld.cpp | 6 +- cocos/physics/CCPhysicsWorld.h | 4 +- cocos/physics/box2d/CCPhysicsBodyInfo.h | 2 +- cocos/physics/box2d/CCPhysicsContactInfo.h | 2 +- cocos/physics/box2d/CCPhysicsHelper.h | 4 +- cocos/physics/box2d/CCPhysicsJointInfo.h | 2 +- cocos/physics/box2d/CCPhysicsShapeInfo.h | 2 +- cocos/physics/box2d/CCPhysicsWorldInfo.h | 2 +- cocos/physics/chipmunk/CCPhysicsBodyInfo.h | 4 +- cocos/physics/chipmunk/CCPhysicsContactInfo.h | 2 +- cocos/physics/chipmunk/CCPhysicsHelper.h | 4 +- cocos/physics/chipmunk/CCPhysicsJointInfo.h | 2 +- cocos/physics/chipmunk/CCPhysicsShapeInfo.h | 2 +- cocos/physics/chipmunk/CCPhysicsWorldInfo.h | 2 +- extensions/Android.mk | 157 ++------ external/Box2D/Android.mk | 90 ++--- external/chipmunk/Android.mk | 58 +-- .../curl/include/{andorid => android}/curl.h | 0 .../include/{andorid => android}/curlbuild.h | 0 .../include/{andorid => android}/curlrules.h | 0 .../include/{andorid => android}/curlver.h | 0 .../curl/include/{andorid => android}/easy.h | 0 .../include/{andorid => android}/mprintf.h | 0 .../curl/include/{andorid => android}/multi.h | 0 .../{andorid => android}/stdcheaders.h | 0 .../{andorid => android}/typecheck-gcc.h | 0 .../curl/include/{andorid => android}/types.h | 0 .../prebuilt/{andorid => android}/Android.mk | 4 +- .../armeabi-v7a/libcurl.a.REMOVED.git-id | 0 .../armeabi/libcurl.a.REMOVED.git-id | 0 .../x86/libcurl.a.REMOVED.git-id | 0 .../freetype2/freetype/config/ftconfig.h | 0 .../freetype2/freetype/config/ftheader.h | 0 .../freetype2/freetype/config/ftmodule.h | 0 .../freetype2/freetype/config/ftoption.h | 0 .../freetype2/freetype/config/ftstdlib.h | 0 .../freetype/freetype.h.REMOVED.git-id | 0 .../freetype2/freetype/ftadvanc.h | 0 .../freetype2/freetype/ftautoh.h | 0 .../freetype2/freetype/ftbbox.h | 0 .../freetype2/freetype/ftbdf.h | 0 .../freetype2/freetype/ftbitmap.h | 0 .../freetype2/freetype/ftbzip2.h | 0 .../freetype2/freetype/ftcache.h | 0 .../freetype2/freetype/ftcffdrv.h | 0 .../freetype2/freetype/ftchapters.h | 0 .../freetype2/freetype/ftcid.h | 0 .../freetype2/freetype/fterrdef.h | 0 .../freetype2/freetype/fterrors.h | 0 .../freetype2/freetype/ftgasp.h | 0 .../freetype2/freetype/ftglyph.h | 0 .../freetype2/freetype/ftgxval.h | 0 .../freetype2/freetype/ftgzip.h | 0 .../freetype2/freetype/ftimage.h | 0 .../freetype2/freetype/ftincrem.h | 0 .../freetype2/freetype/ftlcdfil.h | 0 .../freetype2/freetype/ftlist.h | 0 .../freetype2/freetype/ftlzw.h | 0 .../freetype2/freetype/ftmac.h | 0 .../freetype2/freetype/ftmm.h | 0 .../freetype2/freetype/ftmodapi.h | 0 .../freetype2/freetype/ftmoderr.h | 0 .../freetype2/freetype/ftotval.h | 0 .../freetype2/freetype/ftoutln.h | 0 .../freetype2/freetype/ftpfr.h | 0 .../freetype2/freetype/ftrender.h | 0 .../freetype2/freetype/ftsizes.h | 0 .../freetype2/freetype/ftsnames.h | 0 .../freetype2/freetype/ftstroke.h | 0 .../freetype2/freetype/ftsynth.h | 0 .../freetype2/freetype/ftsystem.h | 0 .../freetype2/freetype/fttrigon.h | 0 .../freetype2/freetype/ftttdrv.h | 0 .../freetype2/freetype/fttypes.h | 0 .../freetype2/freetype/ftwinfnt.h | 0 .../freetype2/freetype/ftxf86.h | 0 .../freetype2/freetype/t1tables.h | 0 .../freetype2/freetype/ttnameid.h | 0 .../freetype2/freetype/tttables.h | 0 .../freetype2/freetype/tttags.h | 0 .../freetype2/freetype/ttunpat.h | 0 .../include/{andorid => android}/ft2build.h | 0 .../prebuilt/{andorid => android}/Android.mk | 4 +- .../armeabi-v7a/libfreetype.a.REMOVED.git-id | 0 .../armeabi/libfreetype.a.REMOVED.git-id | 0 .../x86/libfreetype.a.REMOVED.git-id | 0 .../include/{andorid => android}/jconfig.h | 0 .../include/{andorid => android}/jerror.h | 0 .../include/{andorid => android}/jmorecfg.h | 0 .../include/{andorid => android}/jpeglib.h | 0 .../prebuilt/{andorid => android}/Android.mk | 4 +- .../armeabi-v7a/libjpeg.a.REMOVED.git-id | 0 .../armeabi/libjpeg.a.REMOVED.git-id | 0 .../x86/libjpeg.a.REMOVED.git-id | 0 .../{andorid => android}/png.h.REMOVED.git-id | 0 .../include/{andorid => android}/pngconf.h | 0 .../include/{andorid => android}/pnglibconf.h | 0 .../prebuilt/{andorid => android}/Android.mk | 4 +- .../armeabi-v7a/libpng.a.REMOVED.git-id | 0 .../armeabi/libpng.a.REMOVED.git-id | 0 .../x86/libpng.a.REMOVED.git-id | 0 .../include/{andorid => android}/js-config.h | 0 .../include/{andorid => android}/js.msg | 0 .../include/{andorid => android}/js/Anchor.h | 0 .../{andorid => android}/js/CallArgs.h | 0 .../js/CharacterEncoding.h | 0 .../include/{andorid => android}/js/Date.h | 0 .../include/{andorid => android}/js/GCAPI.h | 0 .../{andorid => android}/js/HashTable.h | 0 .../include/{andorid => android}/js/HeapAPI.h | 0 .../{andorid => android}/js/LegacyIntTypes.h | 0 .../{andorid => android}/js/MemoryMetrics.h | 0 .../{andorid => android}/js/PropertyKey.h | 0 .../{andorid => android}/js/RequiredDefines.h | 0 .../{andorid => android}/js/RootingAPI.h | 0 .../{andorid => android}/js/TemplateLib.h | 0 .../include/{andorid => android}/js/Utility.h | 0 .../include/{andorid => android}/js/Value.h | 0 .../include/{andorid => android}/js/Vector.h | 0 .../include/{andorid => android}/jsalloc.h | 0 .../jsapi.h.REMOVED.git-id | 0 .../include/{andorid => android}/jsclass.h | 0 .../include/{andorid => android}/jsclist.h | 0 .../include/{andorid => android}/jscpucfg.h | 0 .../include/{andorid => android}/jsdbgapi.h | 0 .../include/{andorid => android}/jsdhash.h | 0 .../{andorid => android}/jsfriendapi.h | 0 .../include/{andorid => android}/jslock.h | 0 .../include/{andorid => android}/json.h | 0 .../include/{andorid => android}/jsperf.h | 0 .../include/{andorid => android}/jsprf.h | 0 .../{andorid => android}/jsprototypes.h | 0 .../include/{andorid => android}/jsproxy.h | 0 .../include/{andorid => android}/jsprvtd.h | 0 .../include/{andorid => android}/jspubtd.h | 0 .../include/{andorid => android}/jstypes.h | 0 .../include/{andorid => android}/jsutil.h | 0 .../include/{andorid => android}/jsversion.h | 0 .../include/{andorid => android}/jswrapper.h | 0 .../{andorid => android}/mozilla/Assertions.h | 0 .../{andorid => android}/mozilla/Attributes.h | 0 .../mozilla/BloomFilter.h | 0 .../{andorid => android}/mozilla/Casting.h | 0 .../{andorid => android}/mozilla/Char16.h | 0 .../{andorid => android}/mozilla/CheckedInt.h | 0 .../{andorid => android}/mozilla/Compiler.h | 0 .../{andorid => android}/mozilla/Constants.h | 0 .../{andorid => android}/mozilla/DebugOnly.h | 0 .../{andorid => android}/mozilla/Decimal.h | 0 .../{andorid => android}/mozilla/Endian.h | 0 .../{andorid => android}/mozilla/EnumSet.h | 0 .../mozilla/FloatingPoint.h | 0 .../mozilla/GuardObjects.h | 0 .../mozilla/HashFunctions.h | 0 .../{andorid => android}/mozilla/Likely.h | 0 .../{andorid => android}/mozilla/LinkedList.h | 0 .../{andorid => android}/mozilla/MSStdInt.h | 0 .../mozilla/MathAlgorithms.h | 0 .../mozilla/MemoryChecking.h | 0 .../{andorid => android}/mozilla/NullPtr.h | 0 .../mozilla/PodOperations.h | 0 .../{andorid => android}/mozilla/Poison.h | 0 .../{andorid => android}/mozilla/Range.h | 0 .../{andorid => android}/mozilla/RangedPtr.h | 0 .../{andorid => android}/mozilla/RefPtr.h | 0 .../{andorid => android}/mozilla/SHA1.h | 0 .../{andorid => android}/mozilla/Scoped.h | 0 .../{andorid => android}/mozilla/SplayTree.h | 0 .../mozilla/StandardInteger.h | 0 .../mozilla/ThreadLocal.h | 0 .../{andorid => android}/mozilla/TypeTraits.h | 0 .../{andorid => android}/mozilla/TypedEnum.h | 0 .../{andorid => android}/mozilla/Types.h | 0 .../{andorid => android}/mozilla/Util.h | 0 .../{andorid => android}/mozilla/WeakPtr.h | 0 .../prebuilt/{andorid => android}/Android.mk | 0 .../armeabi-v7a/libjs_static.a.REMOVED.git-id | 0 .../armeabi/libjs_static.a.REMOVED.git-id | 0 .../x86/libjs_static.a.REMOVED.git-id | 0 .../tiff/include/{andorid => android}/tiff.h | 0 .../include/{andorid => android}/tiffconf.h | 0 .../include/{andorid => android}/tiffio.h | 0 .../include/{andorid => android}/tiffvers.h | 0 .../prebuilt/{andorid => android}/Android.mk | 4 +- .../armeabi-v7a/libtiff.a.REMOVED.git-id | 0 .../armeabi/libtiff.a.REMOVED.git-id | 0 .../x86/libtiff.a.REMOVED.git-id | 0 external/tinyxml2/tinyxml2.h | 4 +- external/unzip/ioapi.h | 2 +- .../include/{andorid => android}/decode.h | 0 .../include/{andorid => android}/encode.h | 0 .../webp/include/{andorid => android}/types.h | 0 .../prebuilt/{andorid => android}/Android.mk | 4 +- .../armeabi-v7a/libwebp.a.REMOVED.git-id | 0 .../armeabi/libwebp.a.REMOVED.git-id | 0 .../x86/libwebp.a.REMOVED.git-id | 0 .../Cpp/HelloCpp/Classes/HelloWorldScene.cpp | 2 +- .../Cpp/HelloCpp/proj.android/build_native.sh | 5 +- .../Cpp/HelloCpp/proj.android/jni/Android.mk | 5 +- samples/Cpp/TestCpp/Android.mk | 262 +++++++------- .../android_mk_generator.py | 2 +- tools/android-mk-generator/config.py | 6 +- 417 files changed, 1035 insertions(+), 1141 deletions(-) rename cocos/base/{cocoa => }/CCAffineTransform.cpp (100%) rename cocos/base/{cocoa => }/CCAffineTransform.h (98%) rename cocos/base/{cocoa => }/CCArray.cpp (100%) rename cocos/base/{cocoa => }/CCArray.h (99%) rename cocos/base/{cocoa => }/CCAutoreleasePool.cpp (100%) rename cocos/base/{cocoa => }/CCAutoreleasePool.h (100%) rename cocos/base/{cocoa => }/CCBool.h (100%) rename cocos/base/{cocoa => }/CCData.cpp (100%) rename cocos/base/{cocoa => }/CCData.h (98%) rename cocos/base/{cocoa => }/CCDataVisitor.cpp (100%) rename cocos/base/{cocoa => }/CCDataVisitor.h (98%) rename cocos/base/{cocoa => }/CCDictionary.cpp (100%) rename cocos/base/{cocoa => }/CCDictionary.h (99%) rename cocos/base/{cocoa => }/CCDouble.h (100%) rename cocos/base/{cocoa => }/CCFloat.h (100%) rename cocos/base/{cocoa => }/CCGeometry.cpp (100%) rename cocos/base/{cocoa => }/CCGeometry.h (99%) rename cocos/base/{cocoa => }/CCInteger.h (100%) rename cocos/base/{cocoa => }/CCNS.cpp (100%) rename cocos/base/{cocoa => }/CCNS.h (100%) rename cocos/base/{cocoa => }/CCObject.cpp (98%) rename cocos/base/{cocoa => }/CCObject.h (99%) rename cocos/base/{cocoa => }/CCSet.cpp (100%) rename cocos/base/{cocoa => }/CCSet.h (100%) rename cocos/base/{cocoa => }/CCString.cpp (100%) rename cocos/base/{cocoa => }/CCString.h (100%) rename cocos/base/{atitc => }/atitc.cpp (100%) rename cocos/base/{atitc => }/atitc.h (100%) rename cocos/base/{etc1 => }/etc1.cpp (100%) rename cocos/base/{etc1 => }/etc1.h (100%) rename cocos/base/{s3tc => }/s3tc.cpp (100%) rename cocos/base/{s3tc => }/s3tc.h (100%) rename external/curl/include/{andorid => android}/curl.h (100%) rename external/curl/include/{andorid => android}/curlbuild.h (100%) rename external/curl/include/{andorid => android}/curlrules.h (100%) rename external/curl/include/{andorid => android}/curlver.h (100%) rename external/curl/include/{andorid => android}/easy.h (100%) rename external/curl/include/{andorid => android}/mprintf.h (100%) rename external/curl/include/{andorid => android}/multi.h (100%) rename external/curl/include/{andorid => android}/stdcheaders.h (100%) rename external/curl/include/{andorid => android}/typecheck-gcc.h (100%) rename external/curl/include/{andorid => android}/types.h (100%) rename external/curl/prebuilt/{andorid => android}/Android.mk (57%) rename external/curl/prebuilt/{andorid => android}/armeabi-v7a/libcurl.a.REMOVED.git-id (100%) rename external/curl/prebuilt/{andorid => android}/armeabi/libcurl.a.REMOVED.git-id (100%) rename external/curl/prebuilt/{andorid => android}/x86/libcurl.a.REMOVED.git-id (100%) rename external/freetype2/include/{andorid => android}/freetype2/freetype/config/ftconfig.h (100%) rename external/freetype2/include/{andorid => android}/freetype2/freetype/config/ftheader.h (100%) rename external/freetype2/include/{andorid => android}/freetype2/freetype/config/ftmodule.h (100%) rename external/freetype2/include/{andorid => android}/freetype2/freetype/config/ftoption.h (100%) rename external/freetype2/include/{andorid => android}/freetype2/freetype/config/ftstdlib.h (100%) rename external/freetype2/include/{andorid => android}/freetype2/freetype/freetype.h.REMOVED.git-id (100%) rename external/freetype2/include/{andorid => android}/freetype2/freetype/ftadvanc.h (100%) rename external/freetype2/include/{andorid => android}/freetype2/freetype/ftautoh.h (100%) rename external/freetype2/include/{andorid => android}/freetype2/freetype/ftbbox.h (100%) rename external/freetype2/include/{andorid => android}/freetype2/freetype/ftbdf.h (100%) rename external/freetype2/include/{andorid => android}/freetype2/freetype/ftbitmap.h (100%) rename external/freetype2/include/{andorid => android}/freetype2/freetype/ftbzip2.h (100%) rename external/freetype2/include/{andorid => android}/freetype2/freetype/ftcache.h (100%) rename external/freetype2/include/{andorid => android}/freetype2/freetype/ftcffdrv.h (100%) rename external/freetype2/include/{andorid => android}/freetype2/freetype/ftchapters.h (100%) rename external/freetype2/include/{andorid => android}/freetype2/freetype/ftcid.h (100%) rename external/freetype2/include/{andorid => android}/freetype2/freetype/fterrdef.h (100%) rename external/freetype2/include/{andorid => android}/freetype2/freetype/fterrors.h (100%) rename external/freetype2/include/{andorid => android}/freetype2/freetype/ftgasp.h (100%) rename external/freetype2/include/{andorid => android}/freetype2/freetype/ftglyph.h (100%) rename external/freetype2/include/{andorid => android}/freetype2/freetype/ftgxval.h (100%) rename external/freetype2/include/{andorid => android}/freetype2/freetype/ftgzip.h (100%) rename external/freetype2/include/{andorid => android}/freetype2/freetype/ftimage.h (100%) rename external/freetype2/include/{andorid => android}/freetype2/freetype/ftincrem.h (100%) rename external/freetype2/include/{andorid => android}/freetype2/freetype/ftlcdfil.h (100%) rename external/freetype2/include/{andorid => android}/freetype2/freetype/ftlist.h (100%) rename external/freetype2/include/{andorid => android}/freetype2/freetype/ftlzw.h (100%) rename external/freetype2/include/{andorid => android}/freetype2/freetype/ftmac.h (100%) rename external/freetype2/include/{andorid => android}/freetype2/freetype/ftmm.h (100%) rename external/freetype2/include/{andorid => android}/freetype2/freetype/ftmodapi.h (100%) rename external/freetype2/include/{andorid => android}/freetype2/freetype/ftmoderr.h (100%) rename external/freetype2/include/{andorid => android}/freetype2/freetype/ftotval.h (100%) rename external/freetype2/include/{andorid => android}/freetype2/freetype/ftoutln.h (100%) rename external/freetype2/include/{andorid => android}/freetype2/freetype/ftpfr.h (100%) rename external/freetype2/include/{andorid => android}/freetype2/freetype/ftrender.h (100%) rename external/freetype2/include/{andorid => android}/freetype2/freetype/ftsizes.h (100%) rename external/freetype2/include/{andorid => android}/freetype2/freetype/ftsnames.h (100%) rename external/freetype2/include/{andorid => android}/freetype2/freetype/ftstroke.h (100%) rename external/freetype2/include/{andorid => android}/freetype2/freetype/ftsynth.h (100%) rename external/freetype2/include/{andorid => android}/freetype2/freetype/ftsystem.h (100%) rename external/freetype2/include/{andorid => android}/freetype2/freetype/fttrigon.h (100%) rename external/freetype2/include/{andorid => android}/freetype2/freetype/ftttdrv.h (100%) rename external/freetype2/include/{andorid => android}/freetype2/freetype/fttypes.h (100%) rename external/freetype2/include/{andorid => android}/freetype2/freetype/ftwinfnt.h (100%) rename external/freetype2/include/{andorid => android}/freetype2/freetype/ftxf86.h (100%) rename external/freetype2/include/{andorid => android}/freetype2/freetype/t1tables.h (100%) rename external/freetype2/include/{andorid => android}/freetype2/freetype/ttnameid.h (100%) rename external/freetype2/include/{andorid => android}/freetype2/freetype/tttables.h (100%) rename external/freetype2/include/{andorid => android}/freetype2/freetype/tttags.h (100%) rename external/freetype2/include/{andorid => android}/freetype2/freetype/ttunpat.h (100%) rename external/freetype2/include/{andorid => android}/ft2build.h (100%) rename external/freetype2/prebuilt/{andorid => android}/Android.mk (50%) rename external/freetype2/prebuilt/{andorid => android}/armeabi-v7a/libfreetype.a.REMOVED.git-id (100%) rename external/freetype2/prebuilt/{andorid => android}/armeabi/libfreetype.a.REMOVED.git-id (100%) rename external/freetype2/prebuilt/{andorid => android}/x86/libfreetype.a.REMOVED.git-id (100%) rename external/jpeg/include/{andorid => android}/jconfig.h (100%) rename external/jpeg/include/{andorid => android}/jerror.h (100%) rename external/jpeg/include/{andorid => android}/jmorecfg.h (100%) rename external/jpeg/include/{andorid => android}/jpeglib.h (100%) rename external/jpeg/prebuilt/{andorid => android}/Android.mk (57%) rename external/jpeg/prebuilt/{andorid => android}/armeabi-v7a/libjpeg.a.REMOVED.git-id (100%) rename external/jpeg/prebuilt/{andorid => android}/armeabi/libjpeg.a.REMOVED.git-id (100%) rename external/jpeg/prebuilt/{andorid => android}/x86/libjpeg.a.REMOVED.git-id (100%) rename external/png/include/{andorid => android}/png.h.REMOVED.git-id (100%) rename external/png/include/{andorid => android}/pngconf.h (100%) rename external/png/include/{andorid => android}/pnglibconf.h (100%) rename external/png/prebuilt/{andorid => android}/Android.mk (58%) rename external/png/prebuilt/{andorid => android}/armeabi-v7a/libpng.a.REMOVED.git-id (100%) rename external/png/prebuilt/{andorid => android}/armeabi/libpng.a.REMOVED.git-id (100%) rename external/png/prebuilt/{andorid => android}/x86/libpng.a.REMOVED.git-id (100%) rename external/spidermonkey/include/{andorid => android}/js-config.h (100%) rename external/spidermonkey/include/{andorid => android}/js.msg (100%) rename external/spidermonkey/include/{andorid => android}/js/Anchor.h (100%) rename external/spidermonkey/include/{andorid => android}/js/CallArgs.h (100%) rename external/spidermonkey/include/{andorid => android}/js/CharacterEncoding.h (100%) rename external/spidermonkey/include/{andorid => android}/js/Date.h (100%) rename external/spidermonkey/include/{andorid => android}/js/GCAPI.h (100%) rename external/spidermonkey/include/{andorid => android}/js/HashTable.h (100%) rename external/spidermonkey/include/{andorid => android}/js/HeapAPI.h (100%) rename external/spidermonkey/include/{andorid => android}/js/LegacyIntTypes.h (100%) rename external/spidermonkey/include/{andorid => android}/js/MemoryMetrics.h (100%) rename external/spidermonkey/include/{andorid => android}/js/PropertyKey.h (100%) rename external/spidermonkey/include/{andorid => android}/js/RequiredDefines.h (100%) rename external/spidermonkey/include/{andorid => android}/js/RootingAPI.h (100%) rename external/spidermonkey/include/{andorid => android}/js/TemplateLib.h (100%) rename external/spidermonkey/include/{andorid => android}/js/Utility.h (100%) rename external/spidermonkey/include/{andorid => android}/js/Value.h (100%) rename external/spidermonkey/include/{andorid => android}/js/Vector.h (100%) rename external/spidermonkey/include/{andorid => android}/jsalloc.h (100%) rename external/spidermonkey/include/{andorid => android}/jsapi.h.REMOVED.git-id (100%) rename external/spidermonkey/include/{andorid => android}/jsclass.h (100%) rename external/spidermonkey/include/{andorid => android}/jsclist.h (100%) rename external/spidermonkey/include/{andorid => android}/jscpucfg.h (100%) rename external/spidermonkey/include/{andorid => android}/jsdbgapi.h (100%) rename external/spidermonkey/include/{andorid => android}/jsdhash.h (100%) rename external/spidermonkey/include/{andorid => android}/jsfriendapi.h (100%) rename external/spidermonkey/include/{andorid => android}/jslock.h (100%) rename external/spidermonkey/include/{andorid => android}/json.h (100%) rename external/spidermonkey/include/{andorid => android}/jsperf.h (100%) rename external/spidermonkey/include/{andorid => android}/jsprf.h (100%) rename external/spidermonkey/include/{andorid => android}/jsprototypes.h (100%) rename external/spidermonkey/include/{andorid => android}/jsproxy.h (100%) rename external/spidermonkey/include/{andorid => android}/jsprvtd.h (100%) rename external/spidermonkey/include/{andorid => android}/jspubtd.h (100%) rename external/spidermonkey/include/{andorid => android}/jstypes.h (100%) rename external/spidermonkey/include/{andorid => android}/jsutil.h (100%) rename external/spidermonkey/include/{andorid => android}/jsversion.h (100%) rename external/spidermonkey/include/{andorid => android}/jswrapper.h (100%) rename external/spidermonkey/include/{andorid => android}/mozilla/Assertions.h (100%) rename external/spidermonkey/include/{andorid => android}/mozilla/Attributes.h (100%) rename external/spidermonkey/include/{andorid => android}/mozilla/BloomFilter.h (100%) rename external/spidermonkey/include/{andorid => android}/mozilla/Casting.h (100%) rename external/spidermonkey/include/{andorid => android}/mozilla/Char16.h (100%) rename external/spidermonkey/include/{andorid => android}/mozilla/CheckedInt.h (100%) rename external/spidermonkey/include/{andorid => android}/mozilla/Compiler.h (100%) rename external/spidermonkey/include/{andorid => android}/mozilla/Constants.h (100%) rename external/spidermonkey/include/{andorid => android}/mozilla/DebugOnly.h (100%) rename external/spidermonkey/include/{andorid => android}/mozilla/Decimal.h (100%) rename external/spidermonkey/include/{andorid => android}/mozilla/Endian.h (100%) rename external/spidermonkey/include/{andorid => android}/mozilla/EnumSet.h (100%) rename external/spidermonkey/include/{andorid => android}/mozilla/FloatingPoint.h (100%) rename external/spidermonkey/include/{andorid => android}/mozilla/GuardObjects.h (100%) rename external/spidermonkey/include/{andorid => android}/mozilla/HashFunctions.h (100%) rename external/spidermonkey/include/{andorid => android}/mozilla/Likely.h (100%) rename external/spidermonkey/include/{andorid => android}/mozilla/LinkedList.h (100%) rename external/spidermonkey/include/{andorid => android}/mozilla/MSStdInt.h (100%) rename external/spidermonkey/include/{andorid => android}/mozilla/MathAlgorithms.h (100%) rename external/spidermonkey/include/{andorid => android}/mozilla/MemoryChecking.h (100%) rename external/spidermonkey/include/{andorid => android}/mozilla/NullPtr.h (100%) rename external/spidermonkey/include/{andorid => android}/mozilla/PodOperations.h (100%) rename external/spidermonkey/include/{andorid => android}/mozilla/Poison.h (100%) rename external/spidermonkey/include/{andorid => android}/mozilla/Range.h (100%) rename external/spidermonkey/include/{andorid => android}/mozilla/RangedPtr.h (100%) rename external/spidermonkey/include/{andorid => android}/mozilla/RefPtr.h (100%) rename external/spidermonkey/include/{andorid => android}/mozilla/SHA1.h (100%) rename external/spidermonkey/include/{andorid => android}/mozilla/Scoped.h (100%) rename external/spidermonkey/include/{andorid => android}/mozilla/SplayTree.h (100%) rename external/spidermonkey/include/{andorid => android}/mozilla/StandardInteger.h (100%) rename external/spidermonkey/include/{andorid => android}/mozilla/ThreadLocal.h (100%) rename external/spidermonkey/include/{andorid => android}/mozilla/TypeTraits.h (100%) rename external/spidermonkey/include/{andorid => android}/mozilla/TypedEnum.h (100%) rename external/spidermonkey/include/{andorid => android}/mozilla/Types.h (100%) rename external/spidermonkey/include/{andorid => android}/mozilla/Util.h (100%) rename external/spidermonkey/include/{andorid => android}/mozilla/WeakPtr.h (100%) rename external/spidermonkey/prebuilt/{andorid => android}/Android.mk (100%) rename external/spidermonkey/prebuilt/{andorid => android}/armeabi-v7a/libjs_static.a.REMOVED.git-id (100%) rename external/spidermonkey/prebuilt/{andorid => android}/armeabi/libjs_static.a.REMOVED.git-id (100%) rename external/spidermonkey/prebuilt/{andorid => android}/x86/libjs_static.a.REMOVED.git-id (100%) rename external/tiff/include/{andorid => android}/tiff.h (100%) rename external/tiff/include/{andorid => android}/tiffconf.h (100%) rename external/tiff/include/{andorid => android}/tiffio.h (100%) rename external/tiff/include/{andorid => android}/tiffvers.h (100%) rename external/tiff/prebuilt/{andorid => android}/Android.mk (58%) rename external/tiff/prebuilt/{andorid => android}/armeabi-v7a/libtiff.a.REMOVED.git-id (100%) rename external/tiff/prebuilt/{andorid => android}/armeabi/libtiff.a.REMOVED.git-id (100%) rename external/tiff/prebuilt/{andorid => android}/x86/libtiff.a.REMOVED.git-id (100%) rename external/webp/include/{andorid => android}/decode.h (100%) rename external/webp/include/{andorid => android}/encode.h (100%) rename external/webp/include/{andorid => android}/types.h (100%) rename external/webp/prebuilt/{andorid => android}/Android.mk (74%) rename external/webp/prebuilt/{andorid => android}/armeabi-v7a/libwebp.a.REMOVED.git-id (100%) rename external/webp/prebuilt/{andorid => android}/armeabi/libwebp.a.REMOVED.git-id (100%) rename external/webp/prebuilt/{andorid => android}/x86/libwebp.a.REMOVED.git-id (100%) diff --git a/cocos/2d/Android.mk b/cocos/2d/Android.mk index 6caa61be36..74c8b0313f 100644 --- a/cocos/2d/Android.mk +++ b/cocos/2d/Android.mk @@ -7,176 +7,180 @@ LOCAL_MODULE := cocos2dx_static LOCAL_MODULE_FILENAME := libcocos2d LOCAL_SRC_FILES := \ -CCCamera.cpp \ -CCConfiguration.cpp \ -CCDeprecated.cpp \ -CCDirector.cpp \ -ccFPSImages.c \ -CCScheduler.cpp \ -ccTypes.cpp \ -cocos2d.cpp \ -actions/CCAction.cpp \ -actions/CCActionCamera.cpp \ -actions/CCActionCatmullRom.cpp \ -actions/CCActionEase.cpp \ -actions/CCActionGrid.cpp \ -actions/CCActionGrid3D.cpp \ -actions/CCActionInstant.cpp \ -actions/CCActionInterval.cpp \ -actions/CCActionManager.cpp \ -actions/CCActionPageTurn3D.cpp \ -actions/CCActionProgressTimer.cpp \ -actions/CCActionTiledGrid.cpp \ -actions/CCActionTween.cpp \ -base_nodes/CCAtlasNode.cpp \ -base_nodes/CCNode.cpp \ -cocoa/CCAffineTransform.cpp \ -cocoa/CCArray.cpp \ -cocoa/CCAutoreleasePool.cpp \ -cocoa/CCData.cpp \ -cocoa/CCDataVisitor.cpp \ -cocoa/CCDictionary.cpp \ -cocoa/CCGeometry.cpp \ -cocoa/CCNS.cpp \ -cocoa/CCObject.cpp \ -cocoa/CCSet.cpp \ -cocoa/CCString.cpp \ -draw_nodes/CCDrawingPrimitives.cpp \ -draw_nodes/CCDrawNode.cpp \ -effects/CCGrabber.cpp \ -effects/CCGrid.cpp \ -event_dispatcher/CCEventAcceleration.cpp \ -event_dispatcher/CCEventListenerAcceleration.cpp \ -event_dispatcher/CCEventCustom.cpp \ -event_dispatcher/CCEventListenerCustom.cpp \ -event_dispatcher/CCEvent.cpp \ -event_dispatcher/CCEventDispatcher.cpp \ -event_dispatcher/CCEventListener.cpp \ -event_dispatcher/CCEventKeyboard.cpp \ -event_dispatcher/CCEventListenerKeyboard.cpp \ -event_dispatcher/CCTouch.cpp \ -event_dispatcher/CCEventTouch.cpp \ -event_dispatcher/CCEventListenerTouch.cpp \ -kazmath/src/aabb.c \ -kazmath/src/mat3.c \ -kazmath/src/mat4.c \ -kazmath/src/neon_matrix_impl.c \ -kazmath/src/plane.c \ -kazmath/src/quaternion.c \ -kazmath/src/ray2.c \ -kazmath/src/utility.c \ -kazmath/src/vec2.c \ -kazmath/src/vec3.c \ -kazmath/src/vec4.c \ -kazmath/src/GL/mat4stack.c \ -kazmath/src/GL/matrix.c \ -label_nodes/CCFont.cpp \ -label_nodes/CCFontAtlas.cpp \ -label_nodes/CCFontAtlasCache.cpp \ -label_nodes/CCFontAtlasFactory.cpp \ -label_nodes/CCFontDefinition.cpp \ -label_nodes/CCFontFNT.cpp \ -label_nodes/CCFontFreeType.cpp \ -label_nodes/CCLabel.cpp \ -label_nodes/CCLabelAtlas.cpp \ -label_nodes/CCLabelBMFont.cpp \ -label_nodes/CCLabelTextFormatter.cpp \ -label_nodes/CCLabelTTF.cpp \ -label_nodes/CCTextImage.cpp \ -layers_scenes_transitions_nodes/CCLayer.cpp \ -layers_scenes_transitions_nodes/CCScene.cpp \ -layers_scenes_transitions_nodes/CCTransition.cpp \ -layers_scenes_transitions_nodes/CCTransitionPageTurn.cpp \ -layers_scenes_transitions_nodes/CCTransitionProgress.cpp \ -menu_nodes/CCMenu.cpp \ -menu_nodes/CCMenuItem.cpp \ -misc_nodes/CCClippingNode.cpp \ -misc_nodes/CCMotionStreak.cpp \ -misc_nodes/CCProgressTimer.cpp \ -misc_nodes/CCRenderTexture.cpp \ -particle_nodes/CCParticleBatchNode.cpp \ -particle_nodes/CCParticleExamples.cpp \ -particle_nodes/CCParticleSystem.cpp \ -particle_nodes/CCParticleSystemQuad.cpp \ -physics/CCPhysicsBody.cpp \ -physics/CCPhysicsContact.cpp \ -physics/CCPhysicsJoint.cpp \ -physics/CCPhysicsShape.cpp \ -physics/CCPhysicsWorld.cpp \ -physics/Box2D/CCPhysicsBodyInfo.cpp \ -physics/Box2D/CCPhysicsContactInfo.cpp \ -physics/Box2D/CCPhysicsJointInfo.cpp \ -physics/Box2D/CCPhysicsShapeInfo.cpp \ -physics/Box2D/CCPhysicsWorldInfo.cpp \ -physics/chipmunk/CCPhysicsBodyInfo.cpp \ -physics/chipmunk/CCPhysicsContactInfo.cpp \ -physics/chipmunk/CCPhysicsJointInfo.cpp \ -physics/chipmunk/CCPhysicsShapeInfo.cpp \ -physics/chipmunk/CCPhysicsWorldInfo.cpp \ -platform/CCEGLViewProtocol.cpp \ -platform/CCFileUtils.cpp \ -platform/CCSAXParser.cpp \ -platform/CCThread.cpp \ -platform/third_party/common/atitc/atitc.cpp \ -platform/third_party/common/etc/etc1.cpp \ -platform/third_party/common/s3tc/s3tc.cpp \ -script_support/CCScriptSupport.cpp \ -shaders/CCGLProgram.cpp \ -shaders/ccGLStateCache.cpp \ -shaders/CCShaderCache.cpp \ -shaders/ccShaders.cpp \ -sprite_nodes/CCAnimation.cpp \ -sprite_nodes/CCAnimationCache.cpp \ -sprite_nodes/CCSprite.cpp \ -sprite_nodes/CCSpriteBatchNode.cpp \ -sprite_nodes/CCSpriteFrame.cpp \ -sprite_nodes/CCSpriteFrameCache.cpp \ -support/base64.cpp \ -support/CCNotificationCenter.cpp \ -support/CCProfiling.cpp \ -support/ccUTF8.cpp \ -support/ccUtils.cpp \ -support/CCVertex.cpp \ -support/TransformUtils.cpp \ -support/component/CCComponent.cpp \ -support/component/CCComponentContainer.cpp \ -support/data_support/ccCArray.cpp \ -support/image_support/TGAlib.cpp \ -support/tinyxml2/tinyxml2.cpp \ -support/user_default/CCUserDefaultAndroid.cpp \ -support/zip_support/ioapi.cpp \ -support/zip_support/unzip.cpp \ -support/zip_support/ZipUtils.cpp \ -text_input_node/CCIMEDispatcher.cpp \ -text_input_node/CCTextFieldTTF.cpp \ -textures/CCTexture2D.cpp \ -textures/CCTextureAtlas.cpp \ -textures/CCTextureCache.cpp \ -tilemap_parallax_nodes/CCParallaxNode.cpp \ -tilemap_parallax_nodes/CCTileMapAtlas.cpp \ -tilemap_parallax_nodes/CCTMXLayer.cpp \ -tilemap_parallax_nodes/CCTMXObjectGroup.cpp \ -tilemap_parallax_nodes/CCTMXTiledMap.cpp \ -tilemap_parallax_nodes/CCTMXXMLParser.cpp +$(LOCAL_PATH)/base64.cpp \ +$(LOCAL_PATH)/CCAction.cpp \ +$(LOCAL_PATH)/CCActionCamera.cpp \ +$(LOCAL_PATH)/CCActionCatmullRom.cpp \ +$(LOCAL_PATH)/CCActionEase.cpp \ +$(LOCAL_PATH)/CCActionGrid.cpp \ +$(LOCAL_PATH)/CCActionGrid3D.cpp \ +$(LOCAL_PATH)/CCActionInstant.cpp \ +$(LOCAL_PATH)/CCActionInterval.cpp \ +$(LOCAL_PATH)/CCActionManager.cpp \ +$(LOCAL_PATH)/CCActionPageTurn3D.cpp \ +$(LOCAL_PATH)/CCActionProgressTimer.cpp \ +$(LOCAL_PATH)/CCActionTiledGrid.cpp \ +$(LOCAL_PATH)/CCActionTween.cpp \ +$(LOCAL_PATH)/CCAnimation.cpp \ +$(LOCAL_PATH)/CCAnimationCache.cpp \ +$(LOCAL_PATH)/CCAtlasNode.cpp \ +$(LOCAL_PATH)/CCCamera.cpp \ +$(LOCAL_PATH)/ccCArray.cpp \ +$(LOCAL_PATH)/CCClippingNode.cpp \ +$(LOCAL_PATH)/CCComponent.cpp \ +$(LOCAL_PATH)/CCComponentContainer.cpp \ +$(LOCAL_PATH)/CCConfiguration.cpp \ +$(LOCAL_PATH)/CCDeprecated.cpp \ +$(LOCAL_PATH)/CCDirector.cpp \ +$(LOCAL_PATH)/CCDrawingPrimitives.cpp \ +$(LOCAL_PATH)/CCDrawNode.cpp \ +$(LOCAL_PATH)/CCEvent.cpp \ +$(LOCAL_PATH)/CCEventAcceleration.cpp \ +$(LOCAL_PATH)/CCEventCustom.cpp \ +$(LOCAL_PATH)/CCEventDispatcher.cpp \ +$(LOCAL_PATH)/CCEventKeyboard.cpp \ +$(LOCAL_PATH)/CCEventListener.cpp \ +$(LOCAL_PATH)/CCEventListenerAcceleration.cpp \ +$(LOCAL_PATH)/CCEventListenerCustom.cpp \ +$(LOCAL_PATH)/CCEventListenerKeyboard.cpp \ +$(LOCAL_PATH)/CCEventListenerTouch.cpp \ +$(LOCAL_PATH)/CCEventTouch.cpp \ +$(LOCAL_PATH)/CCFont.cpp \ +$(LOCAL_PATH)/CCFontAtlas.cpp \ +$(LOCAL_PATH)/CCFontAtlasCache.cpp \ +$(LOCAL_PATH)/CCFontAtlasFactory.cpp \ +$(LOCAL_PATH)/CCFontDefinition.cpp \ +$(LOCAL_PATH)/CCFontFNT.cpp \ +$(LOCAL_PATH)/CCFontFreeType.cpp \ +$(LOCAL_PATH)/ccFPSImages.c \ +$(LOCAL_PATH)/CCGLBufferedNode.cpp \ +$(LOCAL_PATH)/CCGLProgram.cpp \ +$(LOCAL_PATH)/ccGLStateCache.cpp \ +$(LOCAL_PATH)/CCGrabber.cpp \ +$(LOCAL_PATH)/CCGrid.cpp \ +$(LOCAL_PATH)/CCIMEDispatcher.cpp \ +$(LOCAL_PATH)/CCLabel.cpp \ +$(LOCAL_PATH)/CCLabelAtlas.cpp \ +$(LOCAL_PATH)/CCLabelBMFont.cpp \ +$(LOCAL_PATH)/CCLabelTextFormatter.cpp \ +$(LOCAL_PATH)/CCLabelTTF.cpp \ +$(LOCAL_PATH)/CCLayer.cpp \ +$(LOCAL_PATH)/CCMenu.cpp \ +$(LOCAL_PATH)/CCMenuItem.cpp \ +$(LOCAL_PATH)/CCMotionStreak.cpp \ +$(LOCAL_PATH)/CCNode.cpp \ +$(LOCAL_PATH)/CCNotificationCenter.cpp \ +$(LOCAL_PATH)/CCParallaxNode.cpp \ +$(LOCAL_PATH)/CCParticleBatchNode.cpp \ +$(LOCAL_PATH)/CCParticleExamples.cpp \ +$(LOCAL_PATH)/CCParticleSystem.cpp \ +$(LOCAL_PATH)/CCParticleSystemQuad.cpp \ +$(LOCAL_PATH)/CCProfiling.cpp \ +$(LOCAL_PATH)/CCProgressTimer.cpp \ +$(LOCAL_PATH)/CCRenderTexture.cpp \ +$(LOCAL_PATH)/CCScene.cpp \ +$(LOCAL_PATH)/CCScheduler.cpp \ +$(LOCAL_PATH)/CCScriptSupport.cpp \ +$(LOCAL_PATH)/CCShaderCache.cpp \ +$(LOCAL_PATH)/ccShaders.cpp \ +$(LOCAL_PATH)/CCSprite.cpp \ +$(LOCAL_PATH)/CCSpriteBatchNode.cpp \ +$(LOCAL_PATH)/CCSpriteFrame.cpp \ +$(LOCAL_PATH)/CCSpriteFrameCache.cpp \ +$(LOCAL_PATH)/CCTextFieldTTF.cpp \ +$(LOCAL_PATH)/CCTextImage.cpp \ +$(LOCAL_PATH)/CCTexture2D.cpp \ +$(LOCAL_PATH)/CCTextureAtlas.cpp \ +$(LOCAL_PATH)/CCTextureCache.cpp \ +$(LOCAL_PATH)/CCTileMapAtlas.cpp \ +$(LOCAL_PATH)/CCTMXLayer.cpp \ +$(LOCAL_PATH)/CCTMXObjectGroup.cpp \ +$(LOCAL_PATH)/CCTMXTiledMap.cpp \ +$(LOCAL_PATH)/CCTMXXMLParser.cpp \ +$(LOCAL_PATH)/CCTouch.cpp \ +$(LOCAL_PATH)/CCTransition.cpp \ +$(LOCAL_PATH)/CCTransitionPageTurn.cpp \ +$(LOCAL_PATH)/CCTransitionProgress.cpp \ +$(LOCAL_PATH)/ccTypes.cpp \ +$(LOCAL_PATH)/CCUserDefault.cpp \ +$(LOCAL_PATH)/CCUserDefaultAndroid.cpp \ +$(LOCAL_PATH)/ccUTF8.cpp \ +$(LOCAL_PATH)/ccUtils.cpp \ +$(LOCAL_PATH)/CCVertex.cpp \ +$(LOCAL_PATH)/cocos2d.cpp \ +$(LOCAL_PATH)/TGAlib.cpp \ +$(LOCAL_PATH)/TransformUtils.cpp \ +$(LOCAL_PATH)/ZipUtils.cpp \ +$(LOCAL_PATH)/platform/CCEGLViewProtocol.cpp \ +$(LOCAL_PATH)/platform/CCFileUtils.cpp \ +$(LOCAL_PATH)/platform/CCSAXParser.cpp \ +$(LOCAL_PATH)/platform/CCThread.cpp \ +$(LOCAL_PATH)/../base/atitc.cpp \ +$(LOCAL_PATH)/../base/CCAffineTransform.cpp \ +$(LOCAL_PATH)/../base/CCArray.cpp \ +$(LOCAL_PATH)/../base/CCAutoreleasePool.cpp \ +$(LOCAL_PATH)/../base/CCData.cpp \ +$(LOCAL_PATH)/../base/CCDataVisitor.cpp \ +$(LOCAL_PATH)/../base/CCDictionary.cpp \ +$(LOCAL_PATH)/../base/CCGeometry.cpp \ +$(LOCAL_PATH)/../base/CCNS.cpp \ +$(LOCAL_PATH)/../base/CCObject.cpp \ +$(LOCAL_PATH)/../base/CCSet.cpp \ +$(LOCAL_PATH)/../base/CCString.cpp \ +$(LOCAL_PATH)/../base/etc1.cpp \ +$(LOCAL_PATH)/../base/s3tc.cpp \ +$(LOCAL_PATH)/../math/kazmath/src/aabb.c \ +$(LOCAL_PATH)/../math/kazmath/src/mat3.c \ +$(LOCAL_PATH)/../math/kazmath/src/mat4.c \ +$(LOCAL_PATH)/../math/kazmath/src/neon_matrix_impl.c \ +$(LOCAL_PATH)/../math/kazmath/src/plane.c \ +$(LOCAL_PATH)/../math/kazmath/src/quaternion.c \ +$(LOCAL_PATH)/../math/kazmath/src/ray2.c \ +$(LOCAL_PATH)/../math/kazmath/src/utility.c \ +$(LOCAL_PATH)/../math/kazmath/src/vec2.c \ +$(LOCAL_PATH)/../math/kazmath/src/vec3.c \ +$(LOCAL_PATH)/../math/kazmath/src/vec4.c \ +$(LOCAL_PATH)/../math/kazmath/src/GL/mat4stack.c \ +$(LOCAL_PATH)/../math/kazmath/src/GL/matrix.c \ +$(LOCAL_PATH)/../physics/CCPhysicsBody.cpp \ +$(LOCAL_PATH)/../physics/CCPhysicsContact.cpp \ +$(LOCAL_PATH)/../physics/CCPhysicsJoint.cpp \ +$(LOCAL_PATH)/../physics/CCPhysicsShape.cpp \ +$(LOCAL_PATH)/../physics/CCPhysicsWorld.cpp \ +$(LOCAL_PATH)/../physics/box2d/CCPhysicsBodyInfo.cpp \ +$(LOCAL_PATH)/../physics/box2d/CCPhysicsContactInfo.cpp \ +$(LOCAL_PATH)/../physics/box2d/CCPhysicsJointInfo.cpp \ +$(LOCAL_PATH)/../physics/box2d/CCPhysicsShapeInfo.cpp \ +$(LOCAL_PATH)/../physics/box2d/CCPhysicsWorldInfo.cpp \ +$(LOCAL_PATH)/../physics/chipmunk/CCPhysicsBodyInfo.cpp \ +$(LOCAL_PATH)/../physics/chipmunk/CCPhysicsContactInfo.cpp \ +$(LOCAL_PATH)/../physics/chipmunk/CCPhysicsJointInfo.cpp \ +$(LOCAL_PATH)/../physics/chipmunk/CCPhysicsShapeInfo.cpp \ +$(LOCAL_PATH)/../physics/chipmunk/CCPhysicsWorldInfo.cpp \ +$(LOCAL_PATH)/../../external/tinyxml2/tinyxml2.cpp \ +$(LOCAL_PATH)/../../external/unzip/ioapi.cpp \ +$(LOCAL_PATH)/../../external/unzip/unzip.cpp LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) \ $(LOCAL_PATH)/include \ - $(LOCAL_PATH)/kazmath/include \ + $(LOCAL_PATH)/../math/kazmath/include \ $(LOCAL_PATH)/platform/android \ - $(LOCAL_PATH)/platform/third_party/common/etc \ - $(LOCAL_PATH)/platform/third_party/common/s3tc \ - $(LOCAL_PATH)/platform/third_party/common/atitc \ - $(LOCAL_PATH)/../external/chipmunk/include/chipmunk + $(LOCAL_PATH)/../physics \ + $(LOCAL_PATH)/../base \ + $(LOCAL_PATH)/../../external/tinyxml2 \ + $(LOCAL_PATH)/../../external/unzip \ + $(LOCAL_PATH)/../../external/chipmunk/include/chipmunk LOCAL_C_INCLUDES := $(LOCAL_PATH) \ $(LOCAL_PATH)/include \ - $(LOCAL_PATH)/kazmath/include \ + $(LOCAL_PATH)/../math/kazmath/include \ $(LOCAL_PATH)/platform/android \ - $(LOCAL_PATH)/platform/third_party/common/etc \ - $(LOCAL_PATH)/platform/third_party/common/s3tc \ - $(LOCAL_PATH)/platform/third_party/common/atitc \ - $(LOCAL_PATH)/../external/chipmunk/include/chipmunk + $(LOCAL_PATH)/../physics \ + $(LOCAL_PATH)/../base \ + $(LOCAL_PATH)/../../external/tinyxml2 \ + $(LOCAL_PATH)/../../external/unzip \ + $(LOCAL_PATH)/../../external/chipmunk/include/chipmunk LOCAL_LDLIBS := -lGLESv2 \ @@ -196,6 +200,7 @@ LOCAL_WHOLE_STATIC_LIBRARIES += cocos_libtiff_static LOCAL_WHOLE_STATIC_LIBRARIES += cocos_libwebp_static LOCAL_WHOLE_STATIC_LIBRARIES += cocos_freetype2_static LOCAL_WHOLE_STATIC_LIBRARIES += chipmunk_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocos2dxandroid_static # define the macro to compile through support/zip_support/ioapi.c LOCAL_CFLAGS := -Wno-psabi -DUSE_FILE32API @@ -203,9 +208,10 @@ LOCAL_EXPORT_CFLAGS := -Wno-psabi -DUSE_FILE32API include $(BUILD_STATIC_LIBRARY) -$(call import-module,libjpeg) -$(call import-module,libpng) -$(call import-module,libtiff) -$(call import-module,libwebp) -$(call import-module,libfreetype2) -$(call import-module,external/chipmunk) +$(call import-module,jpeg/prebuilt/android) +$(call import-module,png/prebuilt/android) +$(call import-module,tiff/prebuilt/android) +$(call import-module,webp/prebuilt/android) +$(call import-module,freetype2/prebuilt/android) +$(call import-module,chipmunk) +$(call import-module,2d/platform/android) diff --git a/cocos/2d/CCAction.cpp b/cocos/2d/CCAction.cpp index 515aa53f14..3a6f66953c 100644 --- a/cocos/2d/CCAction.cpp +++ b/cocos/2d/CCAction.cpp @@ -26,7 +26,7 @@ THE SOFTWARE. #include "CCAction.h" #include "CCActionInterval.h" -#include "base_nodes/CCNode.h" +#include "CCNode.h" #include "CCDirector.h" NS_CC_BEGIN diff --git a/cocos/2d/CCAction.h b/cocos/2d/CCAction.h index ccb787fcda..2ead2ad96e 100644 --- a/cocos/2d/CCAction.h +++ b/cocos/2d/CCAction.h @@ -27,9 +27,9 @@ THE SOFTWARE. #ifndef __ACTIONS_CCACTION_H__ #define __ACTIONS_CCACTION_H__ -#include "cocoa/CCObject.h" -#include "cocoa/CCGeometry.h" -#include "platform/CCPlatformMacros.h" +#include "CCObject.h" +#include "CCGeometry.h" +#include "CCPlatformMacros.h" NS_CC_BEGIN diff --git a/cocos/2d/CCActionCamera.cpp b/cocos/2d/CCActionCamera.cpp index 395d5277c7..8b9673914a 100644 --- a/cocos/2d/CCActionCamera.cpp +++ b/cocos/2d/CCActionCamera.cpp @@ -25,7 +25,7 @@ THE SOFTWARE. ****************************************************************************/ #include "CCActionCamera.h" -#include "base_nodes/CCNode.h" +#include "CCNode.h" #include "CCCamera.h" #include "CCStdC.h" diff --git a/cocos/2d/CCActionCatmullRom.h b/cocos/2d/CCActionCatmullRom.h index ca864ea820..7b4452d1bc 100644 --- a/cocos/2d/CCActionCatmullRom.h +++ b/cocos/2d/CCActionCatmullRom.h @@ -40,8 +40,8 @@ #include #include "CCActionInterval.h" -#include "base_nodes/CCNode.h" -#include "cocoa/CCGeometry.h" +#include "CCNode.h" +#include "CCGeometry.h" NS_CC_BEGIN; diff --git a/cocos/2d/CCActionGrid.cpp b/cocos/2d/CCActionGrid.cpp index 57f61a384f..c174f3cf0f 100644 --- a/cocos/2d/CCActionGrid.cpp +++ b/cocos/2d/CCActionGrid.cpp @@ -24,7 +24,7 @@ THE SOFTWARE. ****************************************************************************/ #include "CCActionGrid.h" #include "CCDirector.h" -#include "effects/CCGrid.h" +#include "CCGrid.h" NS_CC_BEGIN // implementation of GridAction diff --git a/cocos/2d/CCActionInstant.cpp b/cocos/2d/CCActionInstant.cpp index 21e1a1c745..f71a361a02 100644 --- a/cocos/2d/CCActionInstant.cpp +++ b/cocos/2d/CCActionInstant.cpp @@ -25,9 +25,9 @@ ****************************************************************************/ #include "CCActionInstant.h" -#include "base_nodes/CCNode.h" -#include "sprite_nodes/CCSprite.h" -#include "script_support/CCScriptSupport.h" +#include "CCNode.h" +#include "CCSprite.h" +#include "CCScriptSupport.h" #if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1))) #pragma GCC diagnostic ignored "-Wdeprecated-declarations" diff --git a/cocos/2d/CCActionInterval.cpp b/cocos/2d/CCActionInterval.cpp index d5a9d88704..0fe7e055b9 100644 --- a/cocos/2d/CCActionInterval.cpp +++ b/cocos/2d/CCActionInterval.cpp @@ -25,8 +25,8 @@ THE SOFTWARE. ****************************************************************************/ #include "CCActionInterval.h" -#include "sprite_nodes/CCSprite.h" -#include "base_nodes/CCNode.h" +#include "CCSprite.h" +#include "CCNode.h" #include "CCStdC.h" #include "CCActionInstant.h" #include diff --git a/cocos/2d/CCActionInterval.h b/cocos/2d/CCActionInterval.h index 6e3a5371e0..270dca3414 100644 --- a/cocos/2d/CCActionInterval.h +++ b/cocos/2d/CCActionInterval.h @@ -27,11 +27,11 @@ THE SOFTWARE. #ifndef __ACTION_CCINTERVAL_ACTION_H__ #define __ACTION_CCINTERVAL_ACTION_H__ -#include "base_nodes/CCNode.h" +#include "CCNode.h" #include "CCAction.h" #include "CCProtocols.h" -#include "sprite_nodes/CCSpriteFrame.h" -#include "sprite_nodes/CCAnimation.h" +#include "CCSpriteFrame.h" +#include "CCAnimation.h" #include NS_CC_BEGIN diff --git a/cocos/2d/CCActionManager.cpp b/cocos/2d/CCActionManager.cpp index ba964f73a2..9d1fb1ee93 100644 --- a/cocos/2d/CCActionManager.cpp +++ b/cocos/2d/CCActionManager.cpp @@ -26,12 +26,12 @@ THE SOFTWARE. ****************************************************************************/ #include "CCActionManager.h" -#include "base_nodes/CCNode.h" +#include "CCNode.h" #include "CCScheduler.h" #include "ccMacros.h" -#include "support/data_support/ccCArray.h" -#include "support/data_support/uthash.h" -#include "cocoa/CCSet.h" +#include "ccCArray.h" +#include "uthash.h" +#include "CCSet.h" NS_CC_BEGIN // diff --git a/cocos/2d/CCActionManager.h b/cocos/2d/CCActionManager.h index 6b20f0e806..72427a5648 100644 --- a/cocos/2d/CCActionManager.h +++ b/cocos/2d/CCActionManager.h @@ -29,8 +29,8 @@ THE SOFTWARE. #define __ACTION_CCACTION_MANAGER_H__ #include "CCAction.h" -#include "cocoa/CCArray.h" -#include "cocoa/CCObject.h" +#include "CCArray.h" +#include "CCObject.h" NS_CC_BEGIN diff --git a/cocos/2d/CCActionProgressTimer.cpp b/cocos/2d/CCActionProgressTimer.cpp index 4fa9de2f31..cf9e11f436 100644 --- a/cocos/2d/CCActionProgressTimer.cpp +++ b/cocos/2d/CCActionProgressTimer.cpp @@ -23,7 +23,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ #include "CCActionProgressTimer.h" -#include "misc_nodes/CCProgressTimer.h" +#include "CCProgressTimer.h" NS_CC_BEGIN diff --git a/cocos/2d/CCActionTiledGrid.cpp b/cocos/2d/CCActionTiledGrid.cpp index 63ccb223f4..269a798b1d 100644 --- a/cocos/2d/CCActionTiledGrid.cpp +++ b/cocos/2d/CCActionTiledGrid.cpp @@ -25,7 +25,7 @@ THE SOFTWARE. #include "CCActionTiledGrid.h" #include "CCDirector.h" #include "ccMacros.h" -#include "effects/CCGrid.h" +#include "CCGrid.h" #include NS_CC_BEGIN diff --git a/cocos/2d/CCAnimation.cpp b/cocos/2d/CCAnimation.cpp index 65f88953aa..5fa37cd85c 100644 --- a/cocos/2d/CCAnimation.cpp +++ b/cocos/2d/CCAnimation.cpp @@ -24,10 +24,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ #include "CCAnimation.h" -#include "textures/CCTextureCache.h" -#include "textures/CCTexture2D.h" +#include "CCTextureCache.h" +#include "CCTexture2D.h" #include "ccMacros.h" -#include "sprite_nodes/CCSpriteFrame.h" +#include "CCSpriteFrame.h" NS_CC_BEGIN diff --git a/cocos/2d/CCAnimation.h b/cocos/2d/CCAnimation.h index 24799355c4..cc38ca6d84 100644 --- a/cocos/2d/CCAnimation.h +++ b/cocos/2d/CCAnimation.h @@ -26,11 +26,11 @@ THE SOFTWARE. #ifndef __CC_ANIMATION_H__ #define __CC_ANIMATION_H__ -#include "platform/CCPlatformConfig.h" -#include "cocoa/CCObject.h" -#include "cocoa/CCArray.h" -#include "cocoa/CCDictionary.h" -#include "cocoa/CCGeometry.h" +#include "CCPlatformConfig.h" +#include "CCObject.h" +#include "CCArray.h" +#include "CCDictionary.h" +#include "CCGeometry.h" #include "CCSpriteFrame.h" #include diff --git a/cocos/2d/CCAnimationCache.cpp b/cocos/2d/CCAnimationCache.cpp index 4c36fa0231..37f516347a 100644 --- a/cocos/2d/CCAnimationCache.cpp +++ b/cocos/2d/CCAnimationCache.cpp @@ -28,7 +28,7 @@ THE SOFTWARE. #include "CCAnimation.h" #include "CCSpriteFrame.h" #include "CCSpriteFrameCache.h" -#include "cocoa/CCString.h" +#include "CCString.h" #include "platform/CCFileUtils.h" using namespace std; diff --git a/cocos/2d/CCAnimationCache.h b/cocos/2d/CCAnimationCache.h index 8fc0b62f6a..f30d6ee94f 100644 --- a/cocos/2d/CCAnimationCache.h +++ b/cocos/2d/CCAnimationCache.h @@ -26,8 +26,8 @@ THE SOFTWARE. #ifndef __CC_ANIMATION_CACHE_H__ #define __CC_ANIMATION_CACHE_H__ -#include "cocoa/CCObject.h" -#include "cocoa/CCDictionary.h" +#include "CCObject.h" +#include "CCDictionary.h" #include diff --git a/cocos/2d/CCAtlasNode.cpp b/cocos/2d/CCAtlasNode.cpp index 02338220f8..7d5a64dba7 100644 --- a/cocos/2d/CCAtlasNode.cpp +++ b/cocos/2d/CCAtlasNode.cpp @@ -25,14 +25,14 @@ THE SOFTWARE. ****************************************************************************/ #include "CCAtlasNode.h" -#include "textures/CCTextureAtlas.h" -#include "textures/CCTextureCache.h" +#include "CCTextureAtlas.h" +#include "CCTextureCache.h" #include "CCDirector.h" -#include "shaders/CCGLProgram.h" -#include "shaders/CCShaderCache.h" -#include "shaders/ccGLStateCache.h" +#include "CCGLProgram.h" +#include "CCShaderCache.h" +#include "ccGLStateCache.h" #include "CCDirector.h" -#include "support/TransformUtils.h" +#include "TransformUtils.h" // external #include "kazmath/GL/matrix.h" diff --git a/cocos/2d/CCCamera.cpp b/cocos/2d/CCCamera.cpp index 2d97fe2678..36487c88fc 100644 --- a/cocos/2d/CCCamera.cpp +++ b/cocos/2d/CCCamera.cpp @@ -24,10 +24,10 @@ THE SOFTWARE. ****************************************************************************/ #include "CCCamera.h" -#include "cocoa/CCString.h" +#include "CCString.h" #include "CCGL.h" -#include "draw_nodes/CCDrawingPrimitives.h" +#include "CCDrawingPrimitives.h" #include "CCDirector.h" #include "kazmath/GL/matrix.h" diff --git a/cocos/2d/CCCamera.h b/cocos/2d/CCCamera.h index 9e8f0d1d49..cb99787855 100644 --- a/cocos/2d/CCCamera.h +++ b/cocos/2d/CCCamera.h @@ -29,7 +29,7 @@ THE SOFTWARE. #include -#include "cocoa/CCObject.h" +#include "CCObject.h" #include "ccMacros.h" #include "kazmath/mat4.h" diff --git a/cocos/2d/CCClippingNode.cpp b/cocos/2d/CCClippingNode.cpp index 7b797617cb..d51fcc5002 100644 --- a/cocos/2d/CCClippingNode.cpp +++ b/cocos/2d/CCClippingNode.cpp @@ -27,10 +27,10 @@ #include "CCClippingNode.h" #include "kazmath/GL/matrix.h" -#include "shaders/CCGLProgram.h" -#include "shaders/CCShaderCache.h" +#include "CCGLProgram.h" +#include "CCShaderCache.h" #include "CCDirector.h" -#include "draw_nodes/CCDrawingPrimitives.h" +#include "CCDrawingPrimitives.h" NS_CC_BEGIN diff --git a/cocos/2d/CCClippingNode.h b/cocos/2d/CCClippingNode.h index 3ad7f1f944..ca2a17b8d7 100644 --- a/cocos/2d/CCClippingNode.h +++ b/cocos/2d/CCClippingNode.h @@ -28,7 +28,7 @@ #ifndef __MISCNODE_CCCLIPPING_NODE_H__ #define __MISCNODE_CCCLIPPING_NODE_H__ -#include "base_nodes/CCNode.h" +#include "CCNode.h" #include "CCGL.h" NS_CC_BEGIN diff --git a/cocos/2d/CCComponent.cpp b/cocos/2d/CCComponent.cpp index e0bfd75031..b073051e06 100644 --- a/cocos/2d/CCComponent.cpp +++ b/cocos/2d/CCComponent.cpp @@ -22,7 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "support/component/CCComponent.h" +#include "CCComponent.h" NS_CC_BEGIN diff --git a/cocos/2d/CCComponent.h b/cocos/2d/CCComponent.h index e658d10eee..58023fe9fb 100644 --- a/cocos/2d/CCComponent.h +++ b/cocos/2d/CCComponent.h @@ -25,7 +25,7 @@ THE SOFTWARE. #ifndef __CC_FRAMEWORK_COMPONENT_H__ #define __CC_FRAMEWORK_COMPONENT_H__ -#include "cocoa/CCObject.h" +#include "CCObject.h" #include NS_CC_BEGIN diff --git a/cocos/2d/CCComponentContainer.cpp b/cocos/2d/CCComponentContainer.cpp index ea0fc99d3b..b0f5bc3fd9 100644 --- a/cocos/2d/CCComponentContainer.cpp +++ b/cocos/2d/CCComponentContainer.cpp @@ -23,8 +23,8 @@ THE SOFTWARE. ****************************************************************************/ -#include "support/component/CCComponentContainer.h" -#include "support/component/CCComponent.h" +#include "CCComponentContainer.h" +#include "CCComponent.h" #include "CCDirector.h" NS_CC_BEGIN diff --git a/cocos/2d/CCComponentContainer.h b/cocos/2d/CCComponentContainer.h index 2125e2d28a..57622a7d1b 100644 --- a/cocos/2d/CCComponentContainer.h +++ b/cocos/2d/CCComponentContainer.h @@ -25,7 +25,7 @@ THE SOFTWARE. #ifndef __CC_FRAMEWORK_COMCONTAINER_H__ #define __CC_FRAMEWORK_COMCONTAINER_H__ -#include "cocoa/CCDictionary.h" +#include "CCDictionary.h" NS_CC_BEGIN diff --git a/cocos/2d/CCConfiguration.cpp b/cocos/2d/CCConfiguration.cpp index cf88679366..6e5b5cf966 100644 --- a/cocos/2d/CCConfiguration.cpp +++ b/cocos/2d/CCConfiguration.cpp @@ -27,9 +27,9 @@ THE SOFTWARE. #include #include "ccMacros.h" #include "ccConfig.h" -#include "cocoa/CCDictionary.h" -#include "cocoa/CCInteger.h" -#include "cocoa/CCBool.h" +#include "CCDictionary.h" +#include "CCInteger.h" +#include "CCBool.h" #include "cocos2d.h" #include "platform/CCFileUtils.h" diff --git a/cocos/2d/CCConfiguration.h b/cocos/2d/CCConfiguration.h index 2b2a4f98ee..eb78275ef9 100644 --- a/cocos/2d/CCConfiguration.h +++ b/cocos/2d/CCConfiguration.h @@ -26,9 +26,9 @@ THE SOFTWARE. #ifndef __CCCONFIGURATION_H__ #define __CCCONFIGURATION_H__ -#include "cocoa/CCObject.h" +#include "CCObject.h" #include "CCGL.h" -#include "cocoa/CCString.h" +#include "CCString.h" #include diff --git a/cocos/2d/CCDeprecated.h b/cocos/2d/CCDeprecated.h index 0e201a9668..323be9f642 100644 --- a/cocos/2d/CCDeprecated.h +++ b/cocos/2d/CCDeprecated.h @@ -29,7 +29,7 @@ #define __COCOS2D_CCDEPRECATED_H__ #include -#include "cocoa/CCGeometry.h" +#include "CCGeometry.h" #include "ccTypes.h" NS_CC_BEGIN diff --git a/cocos/2d/CCDirector.cpp b/cocos/2d/CCDirector.cpp index 3046957708..8d1d8cb5df 100644 --- a/cocos/2d/CCDirector.cpp +++ b/cocos/2d/CCDirector.cpp @@ -31,31 +31,31 @@ THE SOFTWARE. #include #include "ccFPSImages.h" -#include "draw_nodes/CCDrawingPrimitives.h" -#include "cocoa/CCNS.h" -#include "layers_scenes_transitions_nodes/CCScene.h" -#include "cocoa/CCArray.h" +#include "CCDrawingPrimitives.h" +#include "CCNS.h" +#include "CCScene.h" +#include "CCArray.h" #include "CCScheduler.h" #include "ccMacros.h" -#include "support/CCNotificationCenter.h" -#include "layers_scenes_transitions_nodes/CCTransition.h" -#include "textures/CCTextureCache.h" -#include "sprite_nodes/CCSpriteFrameCache.h" -#include "cocoa/CCAutoreleasePool.h" +#include "CCNotificationCenter.h" +#include "CCTransition.h" +#include "CCTextureCache.h" +#include "CCSpriteFrameCache.h" +#include "CCAutoreleasePool.h" #include "platform/CCFileUtils.h" #include "CCApplication.h" -#include "label_nodes/CCLabelBMFont.h" -#include "label_nodes/CCLabelAtlas.h" -#include "actions/CCActionManager.h" -#include "sprite_nodes/CCAnimationCache.h" -#include "event_dispatcher/CCTouch.h" -#include "event_dispatcher/CCEventDispatcher.h" -#include "support/user_default/CCUserDefault.h" -#include "shaders/ccGLStateCache.h" -#include "shaders/CCShaderCache.h" +#include "CCLabelBMFont.h" +#include "CCLabelAtlas.h" +#include "CCActionManager.h" +#include "CCAnimationCache.h" +#include "CCTouch.h" +#include "CCEventDispatcher.h" +#include "CCUserDefault.h" +#include "ccGLStateCache.h" +#include "CCShaderCache.h" #include "kazmath/kazmath.h" #include "kazmath/GL/matrix.h" -#include "support/CCProfiling.h" +#include "CCProfiling.h" #include "platform/CCImage.h" #include "CCEGLView.h" #include "CCConfiguration.h" diff --git a/cocos/2d/CCDirector.h b/cocos/2d/CCDirector.h index 9cc20393ea..4da35a96a8 100644 --- a/cocos/2d/CCDirector.h +++ b/cocos/2d/CCDirector.h @@ -27,15 +27,15 @@ THE SOFTWARE. #ifndef __CCDIRECTOR_H__ #define __CCDIRECTOR_H__ -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" -#include "cocoa/CCObject.h" +#include "CCObject.h" #include "ccTypes.h" -#include "cocoa/CCGeometry.h" -#include "cocoa/CCArray.h" +#include "CCGeometry.h" +#include "CCArray.h" #include "CCGL.h" #include "kazmath/mat4.h" -#include "label_nodes/CCLabelAtlas.h" +#include "CCLabelAtlas.h" NS_CC_BEGIN diff --git a/cocos/2d/CCDrawNode.cpp b/cocos/2d/CCDrawNode.cpp index 541bd8974c..3623266864 100644 --- a/cocos/2d/CCDrawNode.cpp +++ b/cocos/2d/CCDrawNode.cpp @@ -21,9 +21,9 @@ */ #include "CCDrawNode.h" -#include "shaders/CCShaderCache.h" +#include "CCShaderCache.h" #include "CCGL.h" -#include "support/CCNotificationCenter.h" +#include "CCNotificationCenter.h" #include "CCEventType.h" NS_CC_BEGIN diff --git a/cocos/2d/CCDrawNode.h b/cocos/2d/CCDrawNode.h index 9349430880..3e128d26ea 100644 --- a/cocos/2d/CCDrawNode.h +++ b/cocos/2d/CCDrawNode.h @@ -30,7 +30,7 @@ #ifndef __CCDRAWNODES_CCDRAW_NODE_H__ #define __CCDRAWNODES_CCDRAW_NODE_H__ -#include "base_nodes/CCNode.h" +#include "CCNode.h" #include "ccTypes.h" NS_CC_BEGIN diff --git a/cocos/2d/CCDrawingPrimitives.cpp b/cocos/2d/CCDrawingPrimitives.cpp index 632ca57ea8..4e22032e21 100644 --- a/cocos/2d/CCDrawingPrimitives.cpp +++ b/cocos/2d/CCDrawingPrimitives.cpp @@ -40,10 +40,10 @@ THE SOFTWARE. #include "ccMacros.h" #include "CCGL.h" #include "CCDirector.h" -#include "shaders/ccGLStateCache.h" -#include "shaders/CCShaderCache.h" -#include "shaders/CCGLProgram.h" -#include "actions/CCActionCatmullRom.h" +#include "ccGLStateCache.h" +#include "CCShaderCache.h" +#include "CCGLProgram.h" +#include "CCActionCatmullRom.h" #include #include diff --git a/cocos/2d/CCDrawingPrimitives.h b/cocos/2d/CCDrawingPrimitives.h index ba4f2c1955..c46c88a0ad 100644 --- a/cocos/2d/CCDrawingPrimitives.h +++ b/cocos/2d/CCDrawingPrimitives.h @@ -42,7 +42,7 @@ THE SOFTWARE. #include "ccTypes.h" #include "ccMacros.h" -#include "cocoa/CCGeometry.h" // for Point +#include "CCGeometry.h" // for Point /** @file diff --git a/cocos/2d/CCEvent.h b/cocos/2d/CCEvent.h index dd7e36a47a..1652066fd3 100644 --- a/cocos/2d/CCEvent.h +++ b/cocos/2d/CCEvent.h @@ -29,7 +29,7 @@ #include #include -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" NS_CC_BEGIN diff --git a/cocos/2d/CCEventDispatcher.cpp b/cocos/2d/CCEventDispatcher.cpp index 468db2f39b..14be190f68 100644 --- a/cocos/2d/CCEventDispatcher.cpp +++ b/cocos/2d/CCEventDispatcher.cpp @@ -25,7 +25,7 @@ #include "CCEvent.h" #include "CCEventTouch.h" #include "CCEventListenerTouch.h" -#include "base_nodes/CCNode.h" +#include "CCNode.h" #include "CCDirector.h" #include diff --git a/cocos/2d/CCEventDispatcher.h b/cocos/2d/CCEventDispatcher.h index 2fdd0ae24e..06b6e430c7 100644 --- a/cocos/2d/CCEventDispatcher.h +++ b/cocos/2d/CCEventDispatcher.h @@ -25,7 +25,7 @@ #ifndef __CC_EVENT_DISPATCHER_H__ #define __CC_EVENT_DISPATCHER_H__ -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" #include "CCEventListener.h" #include diff --git a/cocos/2d/CCEventListener.h b/cocos/2d/CCEventListener.h index 156d644f17..82c47445e0 100644 --- a/cocos/2d/CCEventListener.h +++ b/cocos/2d/CCEventListener.h @@ -25,8 +25,8 @@ #ifndef cocos2d_libs_EventListener_h #define cocos2d_libs_EventListener_h -#include "platform/CCPlatformMacros.h" -#include "cocoa/CCObject.h" +#include "CCPlatformMacros.h" +#include "CCObject.h" #include #include diff --git a/cocos/2d/CCEventListenerTouch.h b/cocos/2d/CCEventListenerTouch.h index 62cd4c3e6d..3002676bda 100644 --- a/cocos/2d/CCEventListenerTouch.h +++ b/cocos/2d/CCEventListenerTouch.h @@ -27,7 +27,7 @@ #define __cocos2d_libs__CCTouchEventListener__ #include "CCEventListener.h" -#include "event_dispatcher/CCTouch.h" +#include "CCTouch.h" #include diff --git a/cocos/2d/CCEventTouch.h b/cocos/2d/CCEventTouch.h index a005073173..3d54cecea7 100644 --- a/cocos/2d/CCEventTouch.h +++ b/cocos/2d/CCEventTouch.h @@ -26,7 +26,7 @@ #define __cocos2d_libs__TouchEvent__ #include "CCEvent.h" -#include "event_dispatcher/CCTouch.h" +#include "CCTouch.h" #include NS_CC_BEGIN diff --git a/cocos/2d/CCFont.cpp b/cocos/2d/CCFont.cpp index 7274ddcaf9..63fe7af7d1 100644 --- a/cocos/2d/CCFont.cpp +++ b/cocos/2d/CCFont.cpp @@ -23,7 +23,7 @@ ****************************************************************************/ #include "CCFont.h" -#include "support/ccUTF8.h" +#include "ccUTF8.h" #include "CCFontFNT.h" #include "CCFontFreeType.h" diff --git a/cocos/2d/CCFontFreeType.cpp b/cocos/2d/CCFontFreeType.cpp index 33157aab88..c0522f522b 100644 --- a/cocos/2d/CCFontFreeType.cpp +++ b/cocos/2d/CCFontFreeType.cpp @@ -24,7 +24,7 @@ #include -#include "support/ccUTF8.h" +#include "ccUTF8.h" #include "CCFontFreeType.h" #include "CCTextImage.h" #include "CCFont.h" diff --git a/cocos/2d/CCGLProgram.cpp b/cocos/2d/CCGLProgram.cpp index 85fdbfe029..83da8f9bdc 100644 --- a/cocos/2d/CCGLProgram.cpp +++ b/cocos/2d/CCGLProgram.cpp @@ -30,8 +30,8 @@ THE SOFTWARE. #include "ccGLStateCache.h" #include "ccMacros.h" #include "platform/CCFileUtils.h" -#include "support/data_support/uthash.h" -#include "cocoa/CCString.h" +#include "uthash.h" +#include "CCString.h" // extern #include "kazmath/GL/matrix.h" #include "kazmath/kazmath.h" diff --git a/cocos/2d/CCGLProgram.h b/cocos/2d/CCGLProgram.h index 8174f7632a..cea1add0b2 100644 --- a/cocos/2d/CCGLProgram.h +++ b/cocos/2d/CCGLProgram.h @@ -29,7 +29,7 @@ THE SOFTWARE. #define __CCGLPROGRAM_H__ #include "ccMacros.h" -#include "cocoa/CCObject.h" +#include "CCObject.h" #include "CCGL.h" diff --git a/cocos/2d/CCGrabber.cpp b/cocos/2d/CCGrabber.cpp index ad07a7e99e..4486e58712 100644 --- a/cocos/2d/CCGrabber.cpp +++ b/cocos/2d/CCGrabber.cpp @@ -24,7 +24,7 @@ THE SOFTWARE. ****************************************************************************/ #include "CCGrabber.h" #include "ccMacros.h" -#include "textures/CCTexture2D.h" +#include "CCTexture2D.h" NS_CC_BEGIN diff --git a/cocos/2d/CCGrabber.h b/cocos/2d/CCGrabber.h index 8556101703..9fef542459 100644 --- a/cocos/2d/CCGrabber.h +++ b/cocos/2d/CCGrabber.h @@ -26,7 +26,7 @@ THE SOFTWARE. #define __EFFECTS_CCGRABBER_H__ #include "CCConfiguration.h" -#include "cocoa/CCObject.h" +#include "CCObject.h" #include "CCGL.h" NS_CC_BEGIN diff --git a/cocos/2d/CCGrid.cpp b/cocos/2d/CCGrid.cpp index 04da5fa6b7..fc2152ab13 100644 --- a/cocos/2d/CCGrid.cpp +++ b/cocos/2d/CCGrid.cpp @@ -23,15 +23,15 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ #include "ccMacros.h" -#include "effects/CCGrid.h" +#include "CCGrid.h" #include "CCDirector.h" -#include "effects/CCGrabber.h" -#include "support/ccUtils.h" -#include "shaders/CCGLProgram.h" -#include "shaders/CCShaderCache.h" -#include "shaders/ccGLStateCache.h" +#include "CCGrabber.h" +#include "ccUtils.h" +#include "CCGLProgram.h" +#include "CCShaderCache.h" +#include "ccGLStateCache.h" #include "CCGL.h" -#include "support/TransformUtils.h" +#include "TransformUtils.h" #include "kazmath/kazmath.h" #include "kazmath/GL/matrix.h" diff --git a/cocos/2d/CCGrid.h b/cocos/2d/CCGrid.h index 7d91fbf620..97904cdf3e 100644 --- a/cocos/2d/CCGrid.h +++ b/cocos/2d/CCGrid.h @@ -25,15 +25,15 @@ THE SOFTWARE. #ifndef __EFFECTS_CCGRID_H__ #define __EFFECTS_CCGRID_H__ -#include "cocoa/CCObject.h" -#include "base_nodes/CCNode.h" +#include "CCObject.h" +#include "CCNode.h" #include "CCCamera.h" #include "ccTypes.h" -#include "textures/CCTexture2D.h" +#include "CCTexture2D.h" #include "CCDirector.h" #include "kazmath/mat4.h" #ifdef EMSCRIPTEN -#include "base_nodes/CCGLBufferedNode.h" +#include "CCGLBufferedNode.h" #endif // EMSCRIPTEN NS_CC_BEGIN diff --git a/cocos/2d/CCIMEDelegate.h b/cocos/2d/CCIMEDelegate.h index 3ab7387af5..d7fee2e59b 100644 --- a/cocos/2d/CCIMEDelegate.h +++ b/cocos/2d/CCIMEDelegate.h @@ -25,7 +25,7 @@ THE SOFTWARE. #ifndef __CC_IME_DELEGATE_H__ #define __CC_IME_DELEGATE_H__ -#include "cocoa/CCGeometry.h" +#include "CCGeometry.h" NS_CC_BEGIN diff --git a/cocos/2d/CCLabel.h b/cocos/2d/CCLabel.h index 65688258db..e65c27eb7b 100644 --- a/cocos/2d/CCLabel.h +++ b/cocos/2d/CCLabel.h @@ -26,7 +26,7 @@ #ifndef _COCOS2D_CCLABEL_H_ #define _COCOS2D_CCLABEL_H_ -#include "sprite_nodes/CCSpriteBatchNode.h" +#include "CCSpriteBatchNode.h" #include "CCLabelTextFormatProtocol.h" #include "ccTypes.h" diff --git a/cocos/2d/CCLabelAtlas.cpp b/cocos/2d/CCLabelAtlas.cpp index 9c659d91cc..e96df277b5 100644 --- a/cocos/2d/CCLabelAtlas.cpp +++ b/cocos/2d/CCLabelAtlas.cpp @@ -24,16 +24,16 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ #include "CCLabelAtlas.h" -#include "textures/CCTextureAtlas.h" -#include "textures/CCTextureCache.h" -#include "draw_nodes/CCDrawingPrimitives.h" +#include "CCTextureAtlas.h" +#include "CCTextureCache.h" +#include "CCDrawingPrimitives.h" #include "ccConfig.h" -#include "shaders/CCShaderCache.h" -#include "shaders/CCGLProgram.h" -#include "shaders/ccGLStateCache.h" +#include "CCShaderCache.h" +#include "CCGLProgram.h" +#include "ccGLStateCache.h" #include "CCDirector.h" -#include "support/TransformUtils.h" -#include "cocoa/CCInteger.h" +#include "TransformUtils.h" +#include "CCInteger.h" #include "platform/CCFileUtils.h" // external #include "kazmath/GL/matrix.h" diff --git a/cocos/2d/CCLabelAtlas.h b/cocos/2d/CCLabelAtlas.h index 4ec488203a..2c7d98ea5b 100644 --- a/cocos/2d/CCLabelAtlas.h +++ b/cocos/2d/CCLabelAtlas.h @@ -26,7 +26,7 @@ THE SOFTWARE. #ifndef __CCLABEL_ATLAS_H__ #define __CCLABEL_ATLAS_H__ -#include "base_nodes/CCAtlasNode.h" +#include "CCAtlasNode.h" NS_CC_BEGIN diff --git a/cocos/2d/CCLabelBMFont.cpp b/cocos/2d/CCLabelBMFont.cpp index 863f6d947e..601187d619 100644 --- a/cocos/2d/CCLabelBMFont.cpp +++ b/cocos/2d/CCLabelBMFont.cpp @@ -31,15 +31,15 @@ http://www.angelcode.com/products/bmfont/ (Free, Windows only) ****************************************************************************/ #include "CCLabelBMFont.h" -#include "cocoa/CCString.h" -#include "cocoa/CCDictionary.h" +#include "CCString.h" +#include "CCDictionary.h" #include "CCConfiguration.h" -#include "draw_nodes/CCDrawingPrimitives.h" -#include "sprite_nodes/CCSprite.h" +#include "CCDrawingPrimitives.h" +#include "CCSprite.h" #include "platform/CCFileUtils.h" #include "CCDirector.h" -#include "textures/CCTextureCache.h" -#include "support/ccUTF8.h" +#include "CCTextureCache.h" +#include "ccUTF8.h" using namespace std; diff --git a/cocos/2d/CCLabelBMFont.h b/cocos/2d/CCLabelBMFont.h index bd218b65a2..11ff078ac5 100644 --- a/cocos/2d/CCLabelBMFont.h +++ b/cocos/2d/CCLabelBMFont.h @@ -33,8 +33,8 @@ Use any of these editors to generate BMFonts: #ifndef __CCBITMAP_FONT_ATLAS_H__ #define __CCBITMAP_FONT_ATLAS_H__ -#include "sprite_nodes/CCSpriteBatchNode.h" -#include "support/data_support/uthash.h" +#include "CCSpriteBatchNode.h" +#include "uthash.h" #include #include #include diff --git a/cocos/2d/CCLabelTTF.cpp b/cocos/2d/CCLabelTTF.cpp index 91dba16fe6..bead3ea020 100644 --- a/cocos/2d/CCLabelTTF.cpp +++ b/cocos/2d/CCLabelTTF.cpp @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ #include "CCLabelTTF.h" #include "CCDirector.h" -#include "shaders/CCGLProgram.h" -#include "shaders/CCShaderCache.h" +#include "CCGLProgram.h" +#include "CCShaderCache.h" #include "CCApplication.h" NS_CC_BEGIN diff --git a/cocos/2d/CCLabelTTF.h b/cocos/2d/CCLabelTTF.h index acdd67017c..9243a50e1c 100644 --- a/cocos/2d/CCLabelTTF.h +++ b/cocos/2d/CCLabelTTF.h @@ -25,8 +25,8 @@ THE SOFTWARE. #ifndef __CCLABELTTF_H__ #define __CCLABELTTF_H__ -#include "sprite_nodes/CCSprite.h" -#include "textures/CCTexture2D.h" +#include "CCSprite.h" +#include "CCTexture2D.h" NS_CC_BEGIN diff --git a/cocos/2d/CCLabelTextFormatter.cpp b/cocos/2d/CCLabelTextFormatter.cpp index 2a3853740a..0c674a5345 100644 --- a/cocos/2d/CCLabelTextFormatter.cpp +++ b/cocos/2d/CCLabelTextFormatter.cpp @@ -25,7 +25,7 @@ #include #include "cocos2d.h" -#include "support/ccUTF8.h" +#include "ccUTF8.h" #include "CCLabelTextFormatter.h" using namespace std; diff --git a/cocos/2d/CCLayer.cpp b/cocos/2d/CCLayer.cpp index 37037b456a..19346ea844 100644 --- a/cocos/2d/CCLayer.cpp +++ b/cocos/2d/CCLayer.cpp @@ -27,20 +27,20 @@ THE SOFTWARE. #include #include "CCLayer.h" #include "CCDirector.h" -#include "script_support/CCScriptSupport.h" -#include "shaders/CCShaderCache.h" -#include "shaders/CCGLProgram.h" -#include "shaders/ccGLStateCache.h" -#include "support/TransformUtils.h" +#include "CCScriptSupport.h" +#include "CCShaderCache.h" +#include "CCGLProgram.h" +#include "ccGLStateCache.h" +#include "TransformUtils.h" // extern #include "kazmath/GL/matrix.h" -#include "event_dispatcher/CCEventDispatcher.h" -#include "event_dispatcher/CCEventListenerTouch.h" -#include "event_dispatcher/CCEventTouch.h" -#include "event_dispatcher/CCEventKeyboard.h" -#include "event_dispatcher/CCEventListenerKeyboard.h" -#include "event_dispatcher/CCEventAcceleration.h" -#include "event_dispatcher/CCEventListenerAcceleration.h" +#include "CCEventDispatcher.h" +#include "CCEventListenerTouch.h" +#include "CCEventTouch.h" +#include "CCEventKeyboard.h" +#include "CCEventListenerKeyboard.h" +#include "CCEventAcceleration.h" +#include "CCEventListenerAcceleration.h" #include "platform/CCDevice.h" #include "CCScene.h" diff --git a/cocos/2d/CCLayer.h b/cocos/2d/CCLayer.h index 1d8f143b51..0dad16ff21 100644 --- a/cocos/2d/CCLayer.h +++ b/cocos/2d/CCLayer.h @@ -27,15 +27,15 @@ THE SOFTWARE. #ifndef __CCLAYER_H__ #define __CCLAYER_H__ -#include "base_nodes/CCNode.h" +#include "CCNode.h" #include "CCProtocols.h" -#include "cocoa/CCArray.h" +#include "CCArray.h" #ifdef EMSCRIPTEN -#include "base_nodes/CCGLBufferedNode.h" +#include "CCGLBufferedNode.h" #endif // EMSCRIPTEN -#include "physics/CCPhysicsSetting.h" +#include "CCPhysicsSetting.h" -#include "event_dispatcher/CCEventKeyboard.h" +#include "CCEventKeyboard.h" NS_CC_BEGIN diff --git a/cocos/2d/CCMenu.cpp b/cocos/2d/CCMenu.cpp index 48613dfb00..c0c10e9cdb 100644 --- a/cocos/2d/CCMenu.cpp +++ b/cocos/2d/CCMenu.cpp @@ -25,10 +25,10 @@ THE SOFTWARE. #include "CCMenu.h" #include "CCDirector.h" #include "CCApplication.h" -#include "event_dispatcher/CCTouch.h" +#include "CCTouch.h" #include "CCStdC.h" -#include "cocoa/CCInteger.h" -#include "event_dispatcher/CCEventListenerTouch.h" +#include "CCInteger.h" +#include "CCEventListenerTouch.h" #include diff --git a/cocos/2d/CCMenu.h b/cocos/2d/CCMenu.h index 92dd66f788..bd685786c4 100644 --- a/cocos/2d/CCMenu.h +++ b/cocos/2d/CCMenu.h @@ -26,9 +26,9 @@ THE SOFTWARE. #define __CCMENU_H_ #include "CCMenuItem.h" -#include "layers_scenes_transitions_nodes/CCLayer.h" +#include "CCLayer.h" -#include "event_dispatcher/CCEventTouch.h" +#include "CCEventTouch.h" NS_CC_BEGIN diff --git a/cocos/2d/CCMenuItem.cpp b/cocos/2d/CCMenuItem.cpp index 1df5075647..c735677e9f 100644 --- a/cocos/2d/CCMenuItem.cpp +++ b/cocos/2d/CCMenuItem.cpp @@ -25,11 +25,11 @@ THE SOFTWARE. ****************************************************************************/ #include "CCMenuItem.h" -#include "actions/CCActionInterval.h" -#include "sprite_nodes/CCSprite.h" -#include "label_nodes/CCLabelAtlas.h" -#include "label_nodes/CCLabelTTF.h" -#include "script_support/CCScriptSupport.h" +#include "CCActionInterval.h" +#include "CCSprite.h" +#include "CCLabelAtlas.h" +#include "CCLabelTTF.h" +#include "CCScriptSupport.h" #include #include diff --git a/cocos/2d/CCMenuItem.h b/cocos/2d/CCMenuItem.h index 65e75ae28a..021832df30 100644 --- a/cocos/2d/CCMenuItem.h +++ b/cocos/2d/CCMenuItem.h @@ -31,9 +31,9 @@ THE SOFTWARE. #include // cocos2d includes -#include "base_nodes/CCNode.h" +#include "CCNode.h" #include "CCProtocols.h" -#include "cocoa/CCArray.h" +#include "CCArray.h" NS_CC_BEGIN diff --git a/cocos/2d/CCMotionStreak.cpp b/cocos/2d/CCMotionStreak.cpp index 8ef2a4124e..47cb43a207 100644 --- a/cocos/2d/CCMotionStreak.cpp +++ b/cocos/2d/CCMotionStreak.cpp @@ -23,13 +23,13 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ #include "CCMotionStreak.h" -#include "textures/CCTextureCache.h" -#include "shaders/ccGLStateCache.h" -#include "shaders/CCGLProgram.h" -#include "shaders/CCShaderCache.h" +#include "CCTextureCache.h" +#include "ccGLStateCache.h" +#include "CCGLProgram.h" +#include "CCShaderCache.h" #include "ccMacros.h" -#include "support/CCVertex.h" +#include "CCVertex.h" NS_CC_BEGIN diff --git a/cocos/2d/CCMotionStreak.h b/cocos/2d/CCMotionStreak.h index 6b6535f371..c0fc986c73 100644 --- a/cocos/2d/CCMotionStreak.h +++ b/cocos/2d/CCMotionStreak.h @@ -26,11 +26,11 @@ THE SOFTWARE. #define __CCMOTION_STREAK_H__ #include "CCProtocols.h" -#include "textures/CCTexture2D.h" +#include "CCTexture2D.h" #include "ccTypes.h" -#include "base_nodes/CCNode.h" +#include "CCNode.h" #ifdef EMSCRIPTEN -#include "base_nodes/CCGLBufferedNode.h" +#include "CCGLBufferedNode.h" #endif // EMSCRIPTEN NS_CC_BEGIN diff --git a/cocos/2d/CCNode.cpp b/cocos/2d/CCNode.cpp index 4db892fdd6..5c6a47e822 100644 --- a/cocos/2d/CCNode.cpp +++ b/cocos/2d/CCNode.cpp @@ -29,29 +29,29 @@ THE SOFTWARE. #include -#include "cocoa/CCString.h" -#include "support/data_support/ccCArray.h" -#include "support/TransformUtils.h" +#include "CCString.h" +#include "ccCArray.h" +#include "TransformUtils.h" #include "CCCamera.h" -#include "effects/CCGrid.h" +#include "CCGrid.h" #include "CCDirector.h" #include "CCScheduler.h" -#include "event_dispatcher/CCTouch.h" -#include "actions/CCActionManager.h" -#include "script_support/CCScriptSupport.h" -#include "shaders/CCGLProgram.h" -#include "event_dispatcher/CCEventDispatcher.h" -#include "event_dispatcher/CCEvent.h" -#include "event_dispatcher/CCEventTouch.h" +#include "CCTouch.h" +#include "CCActionManager.h" +#include "CCScriptSupport.h" +#include "CCGLProgram.h" +#include "CCEventDispatcher.h" +#include "CCEvent.h" +#include "CCEventTouch.h" #ifdef CC_USE_PHYSICS -#include "physics/CCPhysicsBody.h" +#include "CCPhysicsBody.h" #endif // externals #include "kazmath/GL/matrix.h" -#include "support/component/CCComponent.h" -#include "support/component/CCComponentContainer.h" +#include "CCComponent.h" +#include "CCComponentContainer.h" diff --git a/cocos/2d/CCNode.h b/cocos/2d/CCNode.h index 605b178bbf..133968d19b 100644 --- a/cocos/2d/CCNode.h +++ b/cocos/2d/CCNode.h @@ -29,16 +29,16 @@ #define __PLATFORM_CCNODE_H__ #include "ccMacros.h" -#include "cocoa/CCAffineTransform.h" -#include "cocoa/CCArray.h" +#include "CCAffineTransform.h" +#include "CCArray.h" #include "CCGL.h" -#include "shaders/ccGLStateCache.h" -#include "shaders/CCGLProgram.h" +#include "ccGLStateCache.h" +#include "CCGLProgram.h" #include "kazmath/kazmath.h" -#include "script_support/CCScriptSupport.h" +#include "CCScriptSupport.h" #include "CCProtocols.h" -#include "event_dispatcher/CCEventDispatcher.h" -#include "physics/CCPhysicsSetting.h" +#include "CCEventDispatcher.h" +#include "CCPhysicsSetting.h" #include diff --git a/cocos/2d/CCNotificationCenter.cpp b/cocos/2d/CCNotificationCenter.cpp index a7f19d5ff0..8b109daacc 100644 --- a/cocos/2d/CCNotificationCenter.cpp +++ b/cocos/2d/CCNotificationCenter.cpp @@ -23,8 +23,8 @@ THE SOFTWARE. ****************************************************************************/ #include "CCNotificationCenter.h" -#include "cocoa/CCArray.h" -#include "script_support/CCScriptSupport.h" +#include "CCArray.h" +#include "CCScriptSupport.h" #include using namespace std; diff --git a/cocos/2d/CCNotificationCenter.h b/cocos/2d/CCNotificationCenter.h index 62587a02f7..41025bdf87 100644 --- a/cocos/2d/CCNotificationCenter.h +++ b/cocos/2d/CCNotificationCenter.h @@ -25,8 +25,8 @@ THE SOFTWARE. #ifndef __CCNOTIFICATIONCENTER_H__ #define __CCNOTIFICATIONCENTER_H__ -#include "cocoa/CCObject.h" -#include "cocoa/CCArray.h" +#include "CCObject.h" +#include "CCArray.h" NS_CC_BEGIN diff --git a/cocos/2d/CCParallaxNode.cpp b/cocos/2d/CCParallaxNode.cpp index 29f16ea2a4..781147b457 100644 --- a/cocos/2d/CCParallaxNode.cpp +++ b/cocos/2d/CCParallaxNode.cpp @@ -24,7 +24,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ #include "CCParallaxNode.h" -#include "support/data_support/ccCArray.h" +#include "ccCArray.h" NS_CC_BEGIN diff --git a/cocos/2d/CCParallaxNode.h b/cocos/2d/CCParallaxNode.h index eeaa2be707..36c3a192a9 100644 --- a/cocos/2d/CCParallaxNode.h +++ b/cocos/2d/CCParallaxNode.h @@ -26,8 +26,8 @@ THE SOFTWARE. #ifndef __CCPARALLAX_NODE_H__ #define __CCPARALLAX_NODE_H__ -#include "base_nodes/CCNode.h" -/*#include "support/data_support/ccArray.h"*/ +#include "CCNode.h" +/*#include "ccArray.h"*/ NS_CC_BEGIN diff --git a/cocos/2d/CCParticleBatchNode.cpp b/cocos/2d/CCParticleBatchNode.cpp index f0f82c8f98..a7dbdc14d1 100644 --- a/cocos/2d/CCParticleBatchNode.cpp +++ b/cocos/2d/CCParticleBatchNode.cpp @@ -28,20 +28,20 @@ */ #include "CCParticleBatchNode.h" -#include "textures/CCTextureCache.h" -#include "textures/CCTextureAtlas.h" +#include "CCTextureCache.h" +#include "CCTextureAtlas.h" #include "ccConfig.h" #include "ccMacros.h" -#include "effects/CCGrid.h" +#include "CCGrid.h" #include "CCParticleSystem.h" -#include "shaders/CCShaderCache.h" -#include "shaders/CCGLProgram.h" -#include "shaders/ccGLStateCache.h" -#include "support/base64.h" -#include "support/zip_support/ZipUtils.h" +#include "CCShaderCache.h" +#include "CCGLProgram.h" +#include "ccGLStateCache.h" +#include "base64.h" +#include "ZipUtils.h" #include "platform/CCFileUtils.h" #include "kazmath/GL/matrix.h" -#include "support/CCProfiling.h" +#include "CCProfiling.h" NS_CC_BEGIN diff --git a/cocos/2d/CCParticleBatchNode.h b/cocos/2d/CCParticleBatchNode.h index b63e72c1c6..9b5808be45 100644 --- a/cocos/2d/CCParticleBatchNode.h +++ b/cocos/2d/CCParticleBatchNode.h @@ -29,7 +29,7 @@ #ifndef __CCPARTICLEBATCHNODE_H__ #define __CCPARTICLEBATCHNODE_H__ -#include "base_nodes/CCNode.h" +#include "CCNode.h" #include "CCProtocols.h" NS_CC_BEGIN diff --git a/cocos/2d/CCParticleExamples.cpp b/cocos/2d/CCParticleExamples.cpp index 465e4af325..c7e2946172 100644 --- a/cocos/2d/CCParticleExamples.cpp +++ b/cocos/2d/CCParticleExamples.cpp @@ -25,7 +25,7 @@ THE SOFTWARE. ****************************************************************************/ #include "CCParticleExamples.h" #include "CCDirector.h" -#include "textures/CCTextureCache.h" +#include "CCTextureCache.h" #include "firePngData.h" #include "platform/CCImage.h" diff --git a/cocos/2d/CCParticleSystem.cpp b/cocos/2d/CCParticleSystem.cpp index 04f2bf3c5c..a42ac234cb 100644 --- a/cocos/2d/CCParticleSystem.cpp +++ b/cocos/2d/CCParticleSystem.cpp @@ -47,14 +47,14 @@ THE SOFTWARE. #include "CCParticleBatchNode.h" #include "ccTypes.h" -#include "textures/CCTextureCache.h" -#include "textures/CCTextureAtlas.h" -#include "support/base64.h" +#include "CCTextureCache.h" +#include "CCTextureAtlas.h" +#include "base64.h" #include "platform/CCFileUtils.h" #include "platform/CCImage.h" -#include "support/zip_support/ZipUtils.h" +#include "ZipUtils.h" #include "CCDirector.h" -#include "support/CCProfiling.h" +#include "CCProfiling.h" // opengl #include "CCGL.h" diff --git a/cocos/2d/CCParticleSystem.h b/cocos/2d/CCParticleSystem.h index c26d12840c..ae22671c4c 100644 --- a/cocos/2d/CCParticleSystem.h +++ b/cocos/2d/CCParticleSystem.h @@ -27,9 +27,9 @@ THE SOFTWARE. #define __CCPARTICLE_SYSTEM_H__ #include "CCProtocols.h" -#include "base_nodes/CCNode.h" -#include "cocoa/CCDictionary.h" -#include "cocoa/CCString.h" +#include "CCNode.h" +#include "CCDictionary.h" +#include "CCString.h" NS_CC_BEGIN diff --git a/cocos/2d/CCParticleSystemQuad.cpp b/cocos/2d/CCParticleSystemQuad.cpp index 5a8912b203..3cf7d9e1d4 100644 --- a/cocos/2d/CCParticleSystemQuad.cpp +++ b/cocos/2d/CCParticleSystemQuad.cpp @@ -27,15 +27,15 @@ THE SOFTWARE. #include "CCGL.h" #include "CCParticleSystemQuad.h" -#include "sprite_nodes/CCSpriteFrame.h" +#include "CCSpriteFrame.h" #include "CCDirector.h" #include "CCParticleBatchNode.h" -#include "textures/CCTextureAtlas.h" -#include "shaders/CCShaderCache.h" -#include "shaders/ccGLStateCache.h" -#include "shaders/CCGLProgram.h" -#include "support/TransformUtils.h" -#include "support/CCNotificationCenter.h" +#include "CCTextureAtlas.h" +#include "CCShaderCache.h" +#include "ccGLStateCache.h" +#include "CCGLProgram.h" +#include "TransformUtils.h" +#include "CCNotificationCenter.h" #include "CCEventType.h" // extern diff --git a/cocos/2d/CCProfiling.h b/cocos/2d/CCProfiling.h index 9b02b490e5..d68dc6f918 100644 --- a/cocos/2d/CCProfiling.h +++ b/cocos/2d/CCProfiling.h @@ -28,8 +28,8 @@ THE SOFTWARE. #include #include #include "ccConfig.h" -#include "cocoa/CCObject.h" -#include "cocoa/CCDictionary.h" +#include "CCObject.h" +#include "CCDictionary.h" NS_CC_BEGIN diff --git a/cocos/2d/CCProgressTimer.cpp b/cocos/2d/CCProgressTimer.cpp index 01f9ae107c..d370866d1b 100644 --- a/cocos/2d/CCProgressTimer.cpp +++ b/cocos/2d/CCProgressTimer.cpp @@ -25,13 +25,13 @@ THE SOFTWARE. #include "CCProgressTimer.h" #include "ccMacros.h" -#include "textures/CCTextureCache.h" -#include "shaders/CCGLProgram.h" -#include "shaders/CCShaderCache.h" -#include "shaders/ccGLStateCache.h" +#include "CCTextureCache.h" +#include "CCGLProgram.h" +#include "CCShaderCache.h" +#include "ccGLStateCache.h" #include "CCDirector.h" -#include "support/TransformUtils.h" -#include "draw_nodes/CCDrawingPrimitives.h" +#include "TransformUtils.h" +#include "CCDrawingPrimitives.h" // extern #include "kazmath/GL/matrix.h" diff --git a/cocos/2d/CCProgressTimer.h b/cocos/2d/CCProgressTimer.h index 6bd7d56542..e09e34be0f 100644 --- a/cocos/2d/CCProgressTimer.h +++ b/cocos/2d/CCProgressTimer.h @@ -25,9 +25,9 @@ THE SOFTWARE. #ifndef __MISC_NODE_CCPROGRESS_TIMER_H__ #define __MISC_NODE_CCPROGRESS_TIMER_H__ -#include "sprite_nodes/CCSprite.h" +#include "CCSprite.h" #ifdef EMSCRIPTEN -#include "base_nodes/CCGLBufferedNode.h" +#include "CCGLBufferedNode.h" #endif // EMSCRIPTEN NS_CC_BEGIN diff --git a/cocos/2d/CCProtocols.h b/cocos/2d/CCProtocols.h index bde86e318d..01b7ebc011 100644 --- a/cocos/2d/CCProtocols.h +++ b/cocos/2d/CCProtocols.h @@ -27,7 +27,7 @@ THE SOFTWARE. #define __CCPROTOCOLS_H__ #include "ccTypes.h" -#include "textures/CCTexture2D.h" +#include "CCTexture2D.h" #include NS_CC_BEGIN diff --git a/cocos/2d/CCRenderTexture.cpp b/cocos/2d/CCRenderTexture.cpp index 3a217fef8d..5bace186cf 100644 --- a/cocos/2d/CCRenderTexture.cpp +++ b/cocos/2d/CCRenderTexture.cpp @@ -24,19 +24,19 @@ THE SOFTWARE. ****************************************************************************/ #include "CCConfiguration.h" -#include "misc_nodes/CCRenderTexture.h" +#include "CCRenderTexture.h" #include "CCDirector.h" #include "platform/CCImage.h" -#include "shaders/CCGLProgram.h" -#include "shaders/ccGLStateCache.h" +#include "CCGLProgram.h" +#include "ccGLStateCache.h" #include "CCConfiguration.h" -#include "support/ccUtils.h" -#include "textures/CCTextureCache.h" +#include "ccUtils.h" +#include "CCTextureCache.h" #include "platform/CCFileUtils.h" #include "CCGL.h" -#include "support/CCNotificationCenter.h" +#include "CCNotificationCenter.h" #include "CCEventType.h" -#include "effects/CCGrid.h" +#include "CCGrid.h" // extern #include "kazmath/GL/matrix.h" diff --git a/cocos/2d/CCRenderTexture.h b/cocos/2d/CCRenderTexture.h index 9105d55d38..5318e83fdf 100644 --- a/cocos/2d/CCRenderTexture.h +++ b/cocos/2d/CCRenderTexture.h @@ -25,8 +25,8 @@ THE SOFTWARE. #ifndef __CCRENDER_TEXTURE_H__ #define __CCRENDER_TEXTURE_H__ -#include "base_nodes/CCNode.h" -#include "sprite_nodes/CCSprite.h" +#include "CCNode.h" +#include "CCSprite.h" #include "kazmath/mat4.h" #include "platform/CCImage.h" diff --git a/cocos/2d/CCScene.cpp b/cocos/2d/CCScene.cpp index c48f95c860..cc8654204b 100644 --- a/cocos/2d/CCScene.cpp +++ b/cocos/2d/CCScene.cpp @@ -27,9 +27,9 @@ THE SOFTWARE. #include "CCScene.h" #include "CCDirector.h" #include "CCLayer.h" -#include "sprite_nodes/CCSprite.h" -#include "sprite_nodes/CCSpriteBatchNode.h" -#include "physics/CCPhysicsWorld.h" +#include "CCSprite.h" +#include "CCSpriteBatchNode.h" +#include "CCPhysicsWorld.h" NS_CC_BEGIN diff --git a/cocos/2d/CCScene.h b/cocos/2d/CCScene.h index c2e2aa7bcb..11e3e0fbb5 100644 --- a/cocos/2d/CCScene.h +++ b/cocos/2d/CCScene.h @@ -27,8 +27,8 @@ THE SOFTWARE. #ifndef __CCSCENE_H__ #define __CCSCENE_H__ -#include "base_nodes/CCNode.h" -#include "physics/CCPhysicsWorld.h" +#include "CCNode.h" +#include "CCPhysicsWorld.h" NS_CC_BEGIN diff --git a/cocos/2d/CCScheduler.cpp b/cocos/2d/CCScheduler.cpp index 2bf62c1fef..3f9c9da9f8 100644 --- a/cocos/2d/CCScheduler.cpp +++ b/cocos/2d/CCScheduler.cpp @@ -27,10 +27,10 @@ THE SOFTWARE. #include "CCScheduler.h" #include "ccMacros.h" #include "CCDirector.h" -#include "support/data_support/utlist.h" -#include "support/data_support/ccCArray.h" -#include "cocoa/CCArray.h" -#include "script_support/CCScriptSupport.h" +#include "utlist.h" +#include "ccCArray.h" +#include "CCArray.h" +#include "CCScriptSupport.h" using namespace std; diff --git a/cocos/2d/CCScheduler.h b/cocos/2d/CCScheduler.h index e4b3526ae2..221781f776 100644 --- a/cocos/2d/CCScheduler.h +++ b/cocos/2d/CCScheduler.h @@ -27,8 +27,8 @@ THE SOFTWARE. #ifndef __CCSCHEDULER_H__ #define __CCSCHEDULER_H__ -#include "cocoa/CCObject.h" -#include "support/data_support/uthash.h" +#include "CCObject.h" +#include "uthash.h" NS_CC_BEGIN diff --git a/cocos/2d/CCScriptSupport.h b/cocos/2d/CCScriptSupport.h index 324d337ed8..0c7f502a8b 100644 --- a/cocos/2d/CCScriptSupport.h +++ b/cocos/2d/CCScriptSupport.h @@ -26,10 +26,10 @@ #define __SCRIPT_SUPPORT_H__ #include "platform/CCCommon.h" -#include "event_dispatcher/CCTouch.h" -#include "event_dispatcher/CCEventTouch.h" -#include "event_dispatcher/CCEventKeyboard.h" -#include "cocoa/CCSet.h" +#include "CCTouch.h" +#include "CCEventTouch.h" +#include "CCEventKeyboard.h" +#include "CCSet.h" #include #include #include diff --git a/cocos/2d/CCShaderCache.h b/cocos/2d/CCShaderCache.h index ec326b50cf..ee65bc33b9 100644 --- a/cocos/2d/CCShaderCache.h +++ b/cocos/2d/CCShaderCache.h @@ -30,7 +30,7 @@ THE SOFTWARE. #include #include -#include "cocoa/CCDictionary.h" +#include "CCDictionary.h" NS_CC_BEGIN diff --git a/cocos/2d/CCSprite.cpp b/cocos/2d/CCSprite.cpp index e1cfd9b5da..db9f4544f2 100644 --- a/cocos/2d/CCSprite.cpp +++ b/cocos/2d/CCSprite.cpp @@ -33,17 +33,17 @@ THE SOFTWARE. #include "CCSprite.h" #include "CCSpriteFrame.h" #include "CCSpriteFrameCache.h" -#include "textures/CCTextureCache.h" -#include "draw_nodes/CCDrawingPrimitives.h" -#include "shaders/CCShaderCache.h" -#include "shaders/ccGLStateCache.h" -#include "shaders/CCGLProgram.h" +#include "CCTextureCache.h" +#include "CCDrawingPrimitives.h" +#include "CCShaderCache.h" +#include "ccGLStateCache.h" +#include "CCGLProgram.h" #include "CCDirector.h" -#include "cocoa/CCGeometry.h" -#include "textures/CCTexture2D.h" -#include "cocoa/CCAffineTransform.h" -#include "support/TransformUtils.h" -#include "support/CCProfiling.h" +#include "CCGeometry.h" +#include "CCTexture2D.h" +#include "CCAffineTransform.h" +#include "TransformUtils.h" +#include "CCProfiling.h" // external #include "kazmath/GL/matrix.h" diff --git a/cocos/2d/CCSprite.h b/cocos/2d/CCSprite.h index d150c55213..cc6470c7da 100644 --- a/cocos/2d/CCSprite.h +++ b/cocos/2d/CCSprite.h @@ -27,16 +27,16 @@ THE SOFTWARE. #ifndef __SPITE_NODE_CCSPRITE_H__ #define __SPITE_NODE_CCSPRITE_H__ -#include "base_nodes/CCNode.h" +#include "CCNode.h" #include "CCProtocols.h" -#include "textures/CCTextureAtlas.h" +#include "CCTextureAtlas.h" #include "ccTypes.h" -#include "cocoa/CCDictionary.h" +#include "CCDictionary.h" #include #ifdef EMSCRIPTEN -#include "base_nodes/CCGLBufferedNode.h" +#include "CCGLBufferedNode.h" #endif // EMSCRIPTEN -#include "physics/CCPhysicsBody.h" +#include "CCPhysicsBody.h" NS_CC_BEGIN diff --git a/cocos/2d/CCSpriteBatchNode.cpp b/cocos/2d/CCSpriteBatchNode.cpp index 6df8215bd0..b4be9bd045 100644 --- a/cocos/2d/CCSpriteBatchNode.cpp +++ b/cocos/2d/CCSpriteBatchNode.cpp @@ -31,17 +31,17 @@ THE SOFTWARE. #include "ccConfig.h" #include "CCSprite.h" -#include "effects/CCGrid.h" -#include "draw_nodes/CCDrawingPrimitives.h" -#include "textures/CCTextureCache.h" -#include "shaders/CCShaderCache.h" -#include "shaders/CCGLProgram.h" -#include "shaders/ccGLStateCache.h" +#include "CCGrid.h" +#include "CCDrawingPrimitives.h" +#include "CCTextureCache.h" +#include "CCShaderCache.h" +#include "CCGLProgram.h" +#include "ccGLStateCache.h" #include "CCDirector.h" -#include "support/TransformUtils.h" -#include "support/CCProfiling.h" -#include "layers_scenes_transitions_nodes/CCLayer.h" -#include "layers_scenes_transitions_nodes/CCScene.h" +#include "TransformUtils.h" +#include "CCProfiling.h" +#include "CCLayer.h" +#include "CCScene.h" // external #include "kazmath/GL/matrix.h" diff --git a/cocos/2d/CCSpriteBatchNode.h b/cocos/2d/CCSpriteBatchNode.h index 091c012160..6ba402fe57 100644 --- a/cocos/2d/CCSpriteBatchNode.h +++ b/cocos/2d/CCSpriteBatchNode.h @@ -30,9 +30,9 @@ THE SOFTWARE. #include -#include "base_nodes/CCNode.h" +#include "CCNode.h" #include "CCProtocols.h" -#include "textures/CCTextureAtlas.h" +#include "CCTextureAtlas.h" #include "ccMacros.h" NS_CC_BEGIN diff --git a/cocos/2d/CCSpriteFrame.cpp b/cocos/2d/CCSpriteFrame.cpp index 2cb21824b5..8bc0bafa6d 100644 --- a/cocos/2d/CCSpriteFrame.cpp +++ b/cocos/2d/CCSpriteFrame.cpp @@ -23,7 +23,7 @@ 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 "textures/CCTextureCache.h" +#include "CCTextureCache.h" #include "CCSpriteFrame.h" #include "CCDirector.h" diff --git a/cocos/2d/CCSpriteFrame.h b/cocos/2d/CCSpriteFrame.h index 30899290a4..f9b2d68c4a 100644 --- a/cocos/2d/CCSpriteFrame.h +++ b/cocos/2d/CCSpriteFrame.h @@ -27,10 +27,10 @@ THE SOFTWARE. #ifndef __SPRITE_CCSPRITE_FRAME_H__ #define __SPRITE_CCSPRITE_FRAME_H__ -#include "base_nodes/CCNode.h" +#include "CCNode.h" #include "CCProtocols.h" -#include "cocoa/CCObject.h" -#include "cocoa/CCGeometry.h" +#include "CCObject.h" +#include "CCGeometry.h" NS_CC_BEGIN diff --git a/cocos/2d/CCSpriteFrameCache.cpp b/cocos/2d/CCSpriteFrameCache.cpp index 1d19773c60..78fc2f8fa6 100644 --- a/cocos/2d/CCSpriteFrameCache.cpp +++ b/cocos/2d/CCSpriteFrameCache.cpp @@ -26,17 +26,17 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "cocoa/CCNS.h" +#include "CCNS.h" #include "ccMacros.h" -#include "textures/CCTextureCache.h" +#include "CCTextureCache.h" #include "CCSpriteFrameCache.h" #include "CCSpriteFrame.h" #include "CCSprite.h" -#include "support/TransformUtils.h" +#include "TransformUtils.h" #include "platform/CCFileUtils.h" -#include "cocoa/CCString.h" -#include "cocoa/CCArray.h" -#include "cocoa/CCDictionary.h" +#include "CCString.h" +#include "CCArray.h" +#include "CCDictionary.h" #include using namespace std; diff --git a/cocos/2d/CCSpriteFrameCache.h b/cocos/2d/CCSpriteFrameCache.h index 7a9129018e..c7249d222c 100644 --- a/cocos/2d/CCSpriteFrameCache.h +++ b/cocos/2d/CCSpriteFrameCache.h @@ -34,9 +34,9 @@ THE SOFTWARE. * http://zwoptex.zwopple.com/ */ -#include "sprite_nodes/CCSpriteFrame.h" -#include "textures/CCTexture2D.h" -#include "cocoa/CCObject.h" +#include "CCSpriteFrame.h" +#include "CCTexture2D.h" +#include "CCObject.h" #include #include diff --git a/cocos/2d/CCTMXLayer.cpp b/cocos/2d/CCTMXLayer.cpp index c0a1b1e10f..4b801ea83e 100644 --- a/cocos/2d/CCTMXLayer.cpp +++ b/cocos/2d/CCTMXLayer.cpp @@ -26,11 +26,11 @@ THE SOFTWARE. #include "CCTMXLayer.h" #include "CCTMXXMLParser.h" #include "CCTMXTiledMap.h" -#include "sprite_nodes/CCSprite.h" -#include "textures/CCTextureCache.h" -#include "shaders/CCShaderCache.h" -#include "shaders/CCGLProgram.h" -#include "support/data_support/ccCArray.h" +#include "CCSprite.h" +#include "CCTextureCache.h" +#include "CCShaderCache.h" +#include "CCGLProgram.h" +#include "ccCArray.h" #include "CCDirector.h" NS_CC_BEGIN diff --git a/cocos/2d/CCTMXLayer.h b/cocos/2d/CCTMXLayer.h index c5a8340b80..b85de82c1e 100644 --- a/cocos/2d/CCTMXLayer.h +++ b/cocos/2d/CCTMXLayer.h @@ -27,10 +27,10 @@ THE SOFTWARE. #define __CCTMX_LAYER_H__ #include "CCTMXObjectGroup.h" -#include "base_nodes/CCAtlasNode.h" -#include "sprite_nodes/CCSpriteBatchNode.h" +#include "CCAtlasNode.h" +#include "CCSpriteBatchNode.h" #include "CCTMXXMLParser.h" -#include "support/data_support/ccCArray.h" +#include "ccCArray.h" NS_CC_BEGIN class TMXMapInfo; diff --git a/cocos/2d/CCTMXObjectGroup.h b/cocos/2d/CCTMXObjectGroup.h index c4c5462946..7a06e4b961 100644 --- a/cocos/2d/CCTMXObjectGroup.h +++ b/cocos/2d/CCTMXObjectGroup.h @@ -27,10 +27,10 @@ THE SOFTWARE. #ifndef __CCTMX_OBJECT_GROUP_H__ #define __CCTMX_OBJECT_GROUP_H__ -#include "cocoa/CCGeometry.h" -#include "cocoa/CCString.h" -#include "cocoa/CCArray.h" -#include "cocoa/CCDictionary.h" +#include "CCGeometry.h" +#include "CCString.h" +#include "CCArray.h" +#include "CCDictionary.h" NS_CC_BEGIN diff --git a/cocos/2d/CCTMXTiledMap.cpp b/cocos/2d/CCTMXTiledMap.cpp index a856f577a4..c6c47b3abd 100644 --- a/cocos/2d/CCTMXTiledMap.cpp +++ b/cocos/2d/CCTMXTiledMap.cpp @@ -26,7 +26,7 @@ THE SOFTWARE. #include "CCTMXTiledMap.h" #include "CCTMXXMLParser.h" #include "CCTMXLayer.h" -#include "sprite_nodes/CCSprite.h" +#include "CCSprite.h" NS_CC_BEGIN diff --git a/cocos/2d/CCTMXTiledMap.h b/cocos/2d/CCTMXTiledMap.h index f3c92c91ae..82ea45bd13 100644 --- a/cocos/2d/CCTMXTiledMap.h +++ b/cocos/2d/CCTMXTiledMap.h @@ -26,7 +26,7 @@ THE SOFTWARE. #ifndef __CCTMX_TILE_MAP_H__ #define __CCTMX_TILE_MAP_H__ -#include "base_nodes/CCNode.h" +#include "CCNode.h" #include "CCTMXObjectGroup.h" NS_CC_BEGIN diff --git a/cocos/2d/CCTMXXMLParser.cpp b/cocos/2d/CCTMXXMLParser.cpp index 8f95cc5487..8497638cf7 100644 --- a/cocos/2d/CCTMXXMLParser.cpp +++ b/cocos/2d/CCTMXXMLParser.cpp @@ -31,8 +31,8 @@ THE SOFTWARE. #include "CCTMXTiledMap.h" #include "ccMacros.h" #include "platform/CCFileUtils.h" -#include "support/zip_support/ZipUtils.h" -#include "support/base64.h" +#include "ZipUtils.h" +#include "base64.h" using namespace std; diff --git a/cocos/2d/CCTMXXMLParser.h b/cocos/2d/CCTMXXMLParser.h index 6cad378de0..7b4851386c 100644 --- a/cocos/2d/CCTMXXMLParser.h +++ b/cocos/2d/CCTMXXMLParser.h @@ -28,9 +28,9 @@ THE SOFTWARE. #ifndef __CC_TM_XML_PARSER__ #define __CC_TM_XML_PARSER__ -#include "cocoa/CCArray.h" -#include "cocoa/CCDictionary.h" -#include "cocoa/CCGeometry.h" +#include "CCArray.h" +#include "CCDictionary.h" +#include "CCGeometry.h" #include "platform/CCSAXParser.h" #include diff --git a/cocos/2d/CCTextFieldTTF.h b/cocos/2d/CCTextFieldTTF.h index 18a58c3ffb..79feb55d7c 100644 --- a/cocos/2d/CCTextFieldTTF.h +++ b/cocos/2d/CCTextFieldTTF.h @@ -25,8 +25,8 @@ THE SOFTWARE. #ifndef __CC_TEXT_FIELD_H__ #define __CC_TEXT_FIELD_H__ -#include "label_nodes/CCLabelTTF.h" -#include "text_input_node/CCIMEDelegate.h" +#include "CCLabelTTF.h" +#include "CCIMEDelegate.h" NS_CC_BEGIN diff --git a/cocos/2d/CCTexture2D.cpp b/cocos/2d/CCTexture2D.cpp index 7ff46a3e83..84a6822dda 100644 --- a/cocos/2d/CCTexture2D.cpp +++ b/cocos/2d/CCTexture2D.cpp @@ -36,12 +36,12 @@ THE SOFTWARE. #include "CCConfiguration.h" #include "platform/CCImage.h" #include "CCGL.h" -#include "support/ccUtils.h" -#include "platform/CCPlatformMacros.h" +#include "ccUtils.h" +#include "CCPlatformMacros.h" #include "CCDirector.h" -#include "shaders/CCGLProgram.h" -#include "shaders/ccGLStateCache.h" -#include "shaders/CCShaderCache.h" +#include "CCGLProgram.h" +#include "ccGLStateCache.h" +#include "CCShaderCache.h" #if CC_ENABLE_CACHE_TEXTURE_DATA #include "CCTextureCache.h" diff --git a/cocos/2d/CCTexture2D.h b/cocos/2d/CCTexture2D.h index f962560c7b..6f15273f9c 100644 --- a/cocos/2d/CCTexture2D.h +++ b/cocos/2d/CCTexture2D.h @@ -29,11 +29,11 @@ THE SOFTWARE. #include #include -#include "cocoa/CCObject.h" -#include "cocoa/CCGeometry.h" +#include "CCObject.h" +#include "CCGeometry.h" #include "ccTypes.h" #ifdef EMSCRIPTEN -#include "base_nodes/CCGLBufferedNode.h" +#include "CCGLBufferedNode.h" #endif // EMSCRIPTEN NS_CC_BEGIN diff --git a/cocos/2d/CCTextureAtlas.cpp b/cocos/2d/CCTextureAtlas.cpp index 239294e7a3..c83a042dde 100644 --- a/cocos/2d/CCTextureAtlas.cpp +++ b/cocos/2d/CCTextureAtlas.cpp @@ -28,14 +28,14 @@ THE SOFTWARE. #include "CCTextureAtlas.h" #include "CCTextureCache.h" #include "ccMacros.h" -#include "shaders/CCGLProgram.h" -#include "shaders/ccGLStateCache.h" -#include "support/CCNotificationCenter.h" +#include "CCGLProgram.h" +#include "ccGLStateCache.h" +#include "CCNotificationCenter.h" #include "CCEventType.h" #include "CCGL.h" // support #include "CCTexture2D.h" -#include "cocoa/CCString.h" +#include "CCString.h" #include //According to some tests GL_TRIANGLE_STRIP is slower, MUCH slower. Probably I'm doing something very wrong diff --git a/cocos/2d/CCTextureAtlas.h b/cocos/2d/CCTextureAtlas.h index afed7e16dc..4c1bb6436a 100644 --- a/cocos/2d/CCTextureAtlas.h +++ b/cocos/2d/CCTextureAtlas.h @@ -28,7 +28,7 @@ THE SOFTWARE. #define __CCTEXTURE_ATLAS_H__ #include "ccTypes.h" -#include "cocoa/CCObject.h" +#include "CCObject.h" #include "ccConfig.h" #include diff --git a/cocos/2d/CCTextureCache.cpp b/cocos/2d/CCTextureCache.cpp index 82fc78cbe7..95c02f8ff4 100644 --- a/cocos/2d/CCTextureCache.cpp +++ b/cocos/2d/CCTextureCache.cpp @@ -35,9 +35,9 @@ THE SOFTWARE. #include "CCDirector.h" #include "platform/CCFileUtils.h" #include "platform/CCThread.h" -#include "support/ccUtils.h" +#include "ccUtils.h" #include "CCScheduler.h" -#include "cocoa/CCString.h" +#include "CCString.h" #ifdef EMSCRIPTEN diff --git a/cocos/2d/CCTextureCache.h b/cocos/2d/CCTextureCache.h index c1c403f12c..ec87d891d8 100644 --- a/cocos/2d/CCTextureCache.h +++ b/cocos/2d/CCTextureCache.h @@ -35,8 +35,8 @@ THE SOFTWARE. #include #include -#include "cocoa/CCObject.h" -#include "textures/CCTexture2D.h" +#include "CCObject.h" +#include "CCTexture2D.h" #include "platform/CCImage.h" #if CC_ENABLE_CACHE_TEXTURE_DATA diff --git a/cocos/2d/CCTileMapAtlas.cpp b/cocos/2d/CCTileMapAtlas.cpp index 0863c2f097..9b7bc85ad3 100644 --- a/cocos/2d/CCTileMapAtlas.cpp +++ b/cocos/2d/CCTileMapAtlas.cpp @@ -25,11 +25,11 @@ THE SOFTWARE. ****************************************************************************/ #include "CCTileMapAtlas.h" #include "platform/CCFileUtils.h" -#include "textures/CCTextureAtlas.h" -#include "support/image_support/TGAlib.h" +#include "CCTextureAtlas.h" +#include "TGAlib.h" #include "ccConfig.h" -#include "cocoa/CCDictionary.h" -#include "cocoa/CCInteger.h" +#include "CCDictionary.h" +#include "CCInteger.h" #include "CCDirector.h" NS_CC_BEGIN diff --git a/cocos/2d/CCTileMapAtlas.h b/cocos/2d/CCTileMapAtlas.h index 86d7e8a06d..865f47295a 100644 --- a/cocos/2d/CCTileMapAtlas.h +++ b/cocos/2d/CCTileMapAtlas.h @@ -27,7 +27,7 @@ THE SOFTWARE. #define __CCTILE_MAP_ATLAS__ -#include "base_nodes/CCAtlasNode.h" +#include "CCAtlasNode.h" NS_CC_BEGIN diff --git a/cocos/2d/CCTouch.h b/cocos/2d/CCTouch.h index 9cc22ef498..1ed19d3112 100644 --- a/cocos/2d/CCTouch.h +++ b/cocos/2d/CCTouch.h @@ -25,8 +25,8 @@ THE SOFTWARE. #ifndef __CC_TOUCH_H__ #define __CC_TOUCH_H__ -#include "cocoa/CCObject.h" -#include "cocoa/CCGeometry.h" +#include "CCObject.h" +#include "CCGeometry.h" NS_CC_BEGIN diff --git a/cocos/2d/CCTransition.cpp b/cocos/2d/CCTransition.cpp index 7232645d2a..5dea9ae721 100644 --- a/cocos/2d/CCTransition.cpp +++ b/cocos/2d/CCTransition.cpp @@ -27,14 +27,14 @@ THE SOFTWARE. #include "CCTransition.h" #include "CCCamera.h" #include "CCDirector.h" -#include "actions/CCActionInterval.h" -#include "actions/CCActionInstant.h" -#include "actions/CCActionEase.h" -#include "actions/CCActionCamera.h" -#include "actions/CCActionTiledGrid.h" -#include "actions/CCActionGrid.h" +#include "CCActionInterval.h" +#include "CCActionInstant.h" +#include "CCActionEase.h" +#include "CCActionCamera.h" +#include "CCActionTiledGrid.h" +#include "CCActionGrid.h" #include "CCLayer.h" -#include "misc_nodes/CCRenderTexture.h" +#include "CCRenderTexture.h" NS_CC_BEGIN diff --git a/cocos/2d/CCTransitionPageTurn.cpp b/cocos/2d/CCTransitionPageTurn.cpp index 58bf240123..3bde055c59 100644 --- a/cocos/2d/CCTransitionPageTurn.cpp +++ b/cocos/2d/CCTransitionPageTurn.cpp @@ -25,10 +25,10 @@ THE SOFTWARE. #include "CCTransitionPageTurn.h" #include "CCDirector.h" -#include "actions/CCActionInterval.h" -#include "actions/CCActionInstant.h" -#include "actions/CCActionGrid.h" -#include "actions/CCActionPageTurn3D.h" +#include "CCActionInterval.h" +#include "CCActionInstant.h" +#include "CCActionGrid.h" +#include "CCActionPageTurn3D.h" NS_CC_BEGIN diff --git a/cocos/2d/CCTransitionProgress.cpp b/cocos/2d/CCTransitionProgress.cpp index fc6a79ca87..1d53f9cbed 100644 --- a/cocos/2d/CCTransitionProgress.cpp +++ b/cocos/2d/CCTransitionProgress.cpp @@ -27,11 +27,11 @@ THE SOFTWARE. #include "CCTransitionProgress.h" #include "CCDirector.h" -#include "misc_nodes/CCRenderTexture.h" -#include "misc_nodes/CCProgressTimer.h" +#include "CCRenderTexture.h" +#include "CCProgressTimer.h" #include "CCLayer.h" -#include "actions/CCActionInstant.h" -#include "actions/CCActionProgressTimer.h" +#include "CCActionInstant.h" +#include "CCActionProgressTimer.h" NS_CC_BEGIN diff --git a/cocos/2d/CCUserDefault.cpp b/cocos/2d/CCUserDefault.cpp index 63997ac1f9..ab30c805a0 100644 --- a/cocos/2d/CCUserDefault.cpp +++ b/cocos/2d/CCUserDefault.cpp @@ -24,8 +24,8 @@ THE SOFTWARE. #include "CCUserDefault.h" #include "platform/CCCommon.h" #include "platform/CCFileUtils.h" -#include "../tinyxml2/tinyxml2.h" -#include "support/base64.h" +#include "tinyxml2.h" +#include "base64.h" #if (CC_TARGET_PLATFORM != CC_PLATFORM_IOS && CC_TARGET_PLATFORM != CC_PLATFORM_ANDROID) diff --git a/cocos/2d/CCUserDefault.h b/cocos/2d/CCUserDefault.h index 89609e1559..a18fb00b6a 100644 --- a/cocos/2d/CCUserDefault.h +++ b/cocos/2d/CCUserDefault.h @@ -24,9 +24,9 @@ THE SOFTWARE. #ifndef __SUPPORT_CCUSERDEFAULT_H__ #define __SUPPORT_CCUSERDEFAULT_H__ -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" #include -#include "cocoa/CCData.h" +#include "CCData.h" NS_CC_BEGIN diff --git a/cocos/2d/CCUserDefault.mm b/cocos/2d/CCUserDefault.mm index dcf355e6f9..b55acfcf24 100644 --- a/cocos/2d/CCUserDefault.mm +++ b/cocos/2d/CCUserDefault.mm @@ -25,9 +25,9 @@ #import "CCUserDefault.h" #import #import "platform/CCFileUtils.h" -#import "../tinyxml2/tinyxml2.h" -#import "platform/CCPlatformConfig.h" -#import "platform/CCPlatformMacros.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) diff --git a/cocos/2d/CCUserDefaultAndroid.cpp b/cocos/2d/CCUserDefaultAndroid.cpp index 91ef890aed..38c09c2a90 100644 --- a/cocos/2d/CCUserDefaultAndroid.cpp +++ b/cocos/2d/CCUserDefaultAndroid.cpp @@ -22,9 +22,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ #include "CCUserDefault.h" -#include "platform/CCPlatformConfig.h" +#include "CCPlatformConfig.h" #include "platform/CCCommon.h" -#include "support/base64.h" +#include "base64.h" #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) #include "platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.h" diff --git a/cocos/2d/TransformUtils.cpp b/cocos/2d/TransformUtils.cpp index d64a63ffd1..85dbfc86e5 100644 --- a/cocos/2d/TransformUtils.cpp +++ b/cocos/2d/TransformUtils.cpp @@ -24,7 +24,7 @@ THE SOFTWARE. ****************************************************************************/ #include "TransformUtils.h" -#include "cocoa/CCAffineTransform.h" +#include "CCAffineTransform.h" namespace cocos2d { diff --git a/cocos/2d/ZipUtils.h b/cocos/2d/ZipUtils.h index d7202a091d..5564807540 100644 --- a/cocos/2d/ZipUtils.h +++ b/cocos/2d/ZipUtils.h @@ -25,7 +25,7 @@ THE SOFTWARE. #define __SUPPORT_ZIPUTILS_H__ #include -#include "platform/CCPlatformConfig.h" +#include "CCPlatformConfig.h" #include "CCPlatformDefine.h" #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) diff --git a/cocos/2d/base64.cpp b/cocos/2d/base64.cpp index 6a44597441..131b0d81f7 100644 --- a/cocos/2d/base64.cpp +++ b/cocos/2d/base64.cpp @@ -24,7 +24,7 @@ THE SOFTWARE. #include #include -#include "support/base64.h" +#include "base64.h" namespace cocos2d { diff --git a/cocos/2d/ccCArray.cpp b/cocos/2d/ccCArray.cpp index 7271675ede..cd8f275311 100644 --- a/cocos/2d/ccCArray.cpp +++ b/cocos/2d/ccCArray.cpp @@ -24,7 +24,7 @@ THE SOFTWARE. ****************************************************************************/ #include "ccCArray.h" -#include "cocoa/CCObject.h" +#include "CCObject.h" NS_CC_BEGIN diff --git a/cocos/2d/ccCArray.h b/cocos/2d/ccCArray.h index 0a788769d4..fff5152904 100644 --- a/cocos/2d/ccCArray.h +++ b/cocos/2d/ccCArray.h @@ -43,7 +43,7 @@ THE SOFTWARE. #define CC_ARRAY_H #include "ccMacros.h" -#include "cocoa/CCObject.h" +#include "CCObject.h" #include #include diff --git a/cocos/2d/ccConfig.h b/cocos/2d/ccConfig.h index ee8fba0828..f801066bfe 100644 --- a/cocos/2d/ccConfig.h +++ b/cocos/2d/ccConfig.h @@ -27,7 +27,7 @@ THE SOFTWARE. #ifndef __CCCONFIG_H__ #define __CCCONFIG_H__ -#include "platform/CCPlatformConfig.h" +#include "CCPlatformConfig.h" /** @file diff --git a/cocos/2d/ccGLStateCache.h b/cocos/2d/ccGLStateCache.h index 3ea973918a..32bf5584be 100644 --- a/cocos/2d/ccGLStateCache.h +++ b/cocos/2d/ccGLStateCache.h @@ -28,7 +28,7 @@ THE SOFTWARE. #define __CCGLSTATE_H__ #include "CCGL.h" -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" NS_CC_BEGIN diff --git a/cocos/2d/ccShaders.h b/cocos/2d/ccShaders.h index f0bcfd4b42..b7bea82383 100644 --- a/cocos/2d/ccShaders.h +++ b/cocos/2d/ccShaders.h @@ -26,7 +26,7 @@ THE SOFTWARE. #define __CCSHADER_H__ #include "CCGL.h" -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" NS_CC_BEGIN diff --git a/cocos/2d/ccTypes.cpp b/cocos/2d/ccTypes.cpp index f669095ea7..adf9677ea2 100644 --- a/cocos/2d/ccTypes.cpp +++ b/cocos/2d/ccTypes.cpp @@ -22,7 +22,7 @@ THE SOFTWARE. ****************************************************************************/ -#include "include/ccTypes.h" +#include "ccTypes.h" NS_CC_BEGIN diff --git a/cocos/2d/ccTypes.h b/cocos/2d/ccTypes.h index 409b9734a1..f7bb8d19cb 100644 --- a/cocos/2d/ccTypes.h +++ b/cocos/2d/ccTypes.h @@ -28,7 +28,7 @@ THE SOFTWARE. #define __CCTYPES_H__ #include -#include "cocoa/CCGeometry.h" +#include "CCGeometry.h" #include "CCGL.h" diff --git a/cocos/2d/ccUTF8.h b/cocos/2d/ccUTF8.h index 48543dcd17..9bd8b521df 100644 --- a/cocos/2d/ccUTF8.h +++ b/cocos/2d/ccUTF8.h @@ -8,7 +8,7 @@ #ifndef __cocos2dx__ccUTF8__ #define __cocos2dx__ccUTF8__ -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" #include NS_CC_BEGIN diff --git a/cocos/2d/cocos2d.h b/cocos/2d/cocos2d.h index bb270d265a..9799e0a9fd 100644 --- a/cocos/2d/cocos2d.h +++ b/cocos/2d/cocos2d.h @@ -37,47 +37,47 @@ THE SOFTWARE. #include "ccConfig.h" // actions -#include "actions/CCAction.h" -#include "actions/CCActionInterval.h" -#include "actions/CCActionCamera.h" -#include "actions/CCActionManager.h" -#include "actions/CCActionEase.h" -#include "actions/CCActionPageTurn3D.h" -#include "actions/CCActionGrid.h" -#include "actions/CCActionProgressTimer.h" -#include "actions/CCActionGrid3D.h" -#include "actions/CCActionTiledGrid.h" -#include "actions/CCActionInstant.h" -#include "actions/CCActionTween.h" -#include "actions/CCActionCatmullRom.h" +#include "CCAction.h" +#include "CCActionInterval.h" +#include "CCActionCamera.h" +#include "CCActionManager.h" +#include "CCActionEase.h" +#include "CCActionPageTurn3D.h" +#include "CCActionGrid.h" +#include "CCActionProgressTimer.h" +#include "CCActionGrid3D.h" +#include "CCActionTiledGrid.h" +#include "CCActionInstant.h" +#include "CCActionTween.h" +#include "CCActionCatmullRom.h" // base_nodes -#include "base_nodes/CCNode.h" -#include "base_nodes/CCAtlasNode.h" +#include "CCNode.h" +#include "CCAtlasNode.h" // cocoa -#include "cocoa/CCAffineTransform.h" -#include "cocoa/CCDictionary.h" -#include "cocoa/CCObject.h" -#include "cocoa/CCArray.h" -#include "cocoa/CCGeometry.h" -#include "cocoa/CCSet.h" -#include "cocoa/CCAutoreleasePool.h" -#include "cocoa/CCInteger.h" -#include "cocoa/CCFloat.h" -#include "cocoa/CCDouble.h" -#include "cocoa/CCBool.h" -#include "cocoa/CCString.h" -#include "cocoa/CCNS.h" -#include "cocoa/CCData.h" +#include "CCAffineTransform.h" +#include "CCDictionary.h" +#include "CCObject.h" +#include "CCArray.h" +#include "CCGeometry.h" +#include "CCSet.h" +#include "CCAutoreleasePool.h" +#include "CCInteger.h" +#include "CCFloat.h" +#include "CCDouble.h" +#include "CCBool.h" +#include "CCString.h" +#include "CCNS.h" +#include "CCData.h" // draw nodes -#include "draw_nodes/CCDrawingPrimitives.h" -#include "draw_nodes/CCDrawNode.h" +#include "CCDrawingPrimitives.h" +#include "CCDrawNode.h" // effects -#include "effects/CCGrabber.h" -#include "effects/CCGrid.h" +#include "CCGrabber.h" +#include "CCGrid.h" // include #include "CCEventType.h" @@ -87,40 +87,40 @@ THE SOFTWARE. #include "ccTypes.h" // label_nodes -#include "label_nodes/CCLabelAtlas.h" -#include "label_nodes/CCLabelTTF.h" -#include "label_nodes/CCLabelBMFont.h" -#include "label_nodes/CCLabel.h" +#include "CCLabelAtlas.h" +#include "CCLabelTTF.h" +#include "CCLabelBMFont.h" +#include "CCLabel.h" // layers_scenes_transitions_nodes -#include "layers_scenes_transitions_nodes/CCLayer.h" -#include "layers_scenes_transitions_nodes/CCScene.h" -#include "layers_scenes_transitions_nodes/CCTransition.h" -#include "layers_scenes_transitions_nodes/CCTransitionPageTurn.h" -#include "layers_scenes_transitions_nodes/CCTransitionProgress.h" +#include "CCLayer.h" +#include "CCScene.h" +#include "CCTransition.h" +#include "CCTransitionPageTurn.h" +#include "CCTransitionProgress.h" // menu_nodes -#include "menu_nodes/CCMenu.h" -#include "menu_nodes/CCMenuItem.h" +#include "CCMenu.h" +#include "CCMenuItem.h" // misc_nodes -#include "misc_nodes/CCClippingNode.h" -#include "misc_nodes/CCMotionStreak.h" -#include "misc_nodes/CCProgressTimer.h" -#include "misc_nodes/CCRenderTexture.h" +#include "CCClippingNode.h" +#include "CCMotionStreak.h" +#include "CCProgressTimer.h" +#include "CCRenderTexture.h" // particle_nodes -#include "particle_nodes/CCParticleBatchNode.h" -#include "particle_nodes/CCParticleSystem.h" -#include "particle_nodes/CCParticleExamples.h" -#include "particle_nodes/CCParticleSystemQuad.h" +#include "CCParticleBatchNode.h" +#include "CCParticleSystem.h" +#include "CCParticleExamples.h" +#include "CCParticleSystemQuad.h" // physics -#include "physics/CCPhysicsBody.h" -#include "physics/CCPhysicsContact.h" -#include "physics/CCPhysicsShape.h" -#include "physics/CCPhysicsJoint.h" -#include "physics/CCPhysicsWorld.h" +#include "CCPhysicsBody.h" +#include "CCPhysicsContact.h" +#include "CCPhysicsShape.h" +#include "CCPhysicsJoint.h" +#include "CCPhysicsWorld.h" // platform #include "platform/CCDevice.h" @@ -129,8 +129,8 @@ THE SOFTWARE. #include "platform/CCImage.h" #include "platform/CCSAXParser.h" #include "platform/CCThread.h" -#include "platform/CCPlatformConfig.h" -#include "platform/CCPlatformMacros.h" +#include "CCPlatformConfig.h" +#include "CCPlatformMacros.h" #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) #include "platform/ios/CCApplication.h" @@ -175,58 +175,57 @@ THE SOFTWARE. #endif // CC_TARGET_PLATFORM == CC_PLATFORM_LINUX // script_support -#include "script_support/CCScriptSupport.h" +#include "CCScriptSupport.h" // shaders -#include "shaders/CCGLProgram.h" -#include "shaders/ccGLStateCache.h" -#include "shaders/CCShaderCache.h" -#include "shaders/ccShaders.h" +#include "CCGLProgram.h" +#include "ccGLStateCache.h" +#include "CCShaderCache.h" +#include "ccShaders.h" // sprite_nodes -#include "sprite_nodes/CCAnimation.h" -#include "sprite_nodes/CCAnimationCache.h" -#include "sprite_nodes/CCSprite.h" -#include "sprite_nodes/CCSpriteBatchNode.h" -#include "sprite_nodes/CCSpriteFrame.h" -#include "sprite_nodes/CCSpriteFrameCache.h" +#include "CCAnimation.h" +#include "CCAnimationCache.h" +#include "CCSprite.h" +#include "CCSpriteBatchNode.h" +#include "CCSpriteFrame.h" +#include "CCSpriteFrameCache.h" // support -#include "support/ccUTF8.h" -#include "support/CCNotificationCenter.h" -#include "support/CCProfiling.h" -#include "support/user_default/CCUserDefault.h" -#include "support/CCVertex.h" -#include "support/tinyxml2/tinyxml2.h" +#include "ccUTF8.h" +#include "CCNotificationCenter.h" +#include "CCProfiling.h" +#include "CCUserDefault.h" +#include "CCVertex.h" // text_input_node -#include "text_input_node/CCIMEDelegate.h" -#include "text_input_node/CCIMEDispatcher.h" -#include "text_input_node/CCTextFieldTTF.h" +#include "CCIMEDelegate.h" +#include "CCIMEDispatcher.h" +#include "CCTextFieldTTF.h" // textures -#include "textures/CCTexture2D.h" -#include "textures/CCTextureAtlas.h" -#include "textures/CCTextureCache.h" +#include "CCTexture2D.h" +#include "CCTextureAtlas.h" +#include "CCTextureCache.h" // tilemap_parallax_nodes -#include "tilemap_parallax_nodes/CCParallaxNode.h" -#include "tilemap_parallax_nodes/CCTMXLayer.h" -#include "tilemap_parallax_nodes/CCTMXObjectGroup.h" -#include "tilemap_parallax_nodes/CCTMXTiledMap.h" -#include "tilemap_parallax_nodes/CCTMXXMLParser.h" -#include "tilemap_parallax_nodes/CCTileMapAtlas.h" +#include "CCParallaxNode.h" +#include "CCTMXLayer.h" +#include "CCTMXObjectGroup.h" +#include "CCTMXTiledMap.h" +#include "CCTMXXMLParser.h" +#include "CCTileMapAtlas.h" // EventDispatcher -#include "event_dispatcher/CCEventDispatcher.h" -#include "event_dispatcher/CCEventListenerTouch.h" -#include "event_dispatcher/CCEventTouch.h" -#include "event_dispatcher/CCEventListenerKeyboard.h" -#include "event_dispatcher/CCEventKeyboard.h" -#include "event_dispatcher/CCEventAcceleration.h" -#include "event_dispatcher/CCEventListenerAcceleration.h" -#include "event_dispatcher/CCEventCustom.h" -#include "event_dispatcher/CCEventListenerCustom.h" +#include "CCEventDispatcher.h" +#include "CCEventListenerTouch.h" +#include "CCEventTouch.h" +#include "CCEventListenerKeyboard.h" +#include "CCEventKeyboard.h" +#include "CCEventAcceleration.h" +#include "CCEventListenerAcceleration.h" +#include "CCEventCustom.h" +#include "CCEventListenerCustom.h" // root #include "CCCamera.h" @@ -235,8 +234,8 @@ THE SOFTWARE. #include "CCScheduler.h" // component -#include "support/component/CCComponent.h" -#include "support/component/CCComponentContainer.h" +#include "CCComponent.h" +#include "CCComponentContainer.h" // Deprecated include #include "CCDeprecated.h" diff --git a/cocos/2d/platform/CCEGLViewProtocol.cpp b/cocos/2d/platform/CCEGLViewProtocol.cpp index 870146a2f9..9b1e943019 100644 --- a/cocos/2d/platform/CCEGLViewProtocol.cpp +++ b/cocos/2d/platform/CCEGLViewProtocol.cpp @@ -1,8 +1,8 @@ #include "CCEGLViewProtocol.h" -#include "event_dispatcher/CCTouch.h" +#include "CCTouch.h" #include "CCDirector.h" -#include "cocoa/CCSet.h" -#include "event_dispatcher/CCEventDispatcher.h" +#include "CCSet.h" +#include "CCEventDispatcher.h" NS_CC_BEGIN diff --git a/cocos/2d/platform/CCEGLViewProtocol.h b/cocos/2d/platform/CCEGLViewProtocol.h index 718c415850..b8744d0dd1 100644 --- a/cocos/2d/platform/CCEGLViewProtocol.h +++ b/cocos/2d/platform/CCEGLViewProtocol.h @@ -2,7 +2,7 @@ #define __CCEGLVIEWPROTOCOL_H__ #include "ccTypes.h" -#include "event_dispatcher/CCEventTouch.h" +#include "CCEventTouch.h" #include diff --git a/cocos/2d/platform/CCFileUtils.cpp b/cocos/2d/platform/CCFileUtils.cpp index 6f286607fb..e9e01589e2 100644 --- a/cocos/2d/platform/CCFileUtils.cpp +++ b/cocos/2d/platform/CCFileUtils.cpp @@ -24,11 +24,11 @@ THE SOFTWARE. #include "CCFileUtils.h" #include "CCDirector.h" -#include "cocoa/CCDictionary.h" -#include "cocoa/CCString.h" +#include "CCDictionary.h" +#include "CCString.h" #include "CCSAXParser.h" -#include "support/tinyxml2/tinyxml2.h" -#include "support/zip_support/unzip.h" +#include "tinyxml2.h" +#include "unzip.h" #include using namespace std; diff --git a/cocos/2d/platform/CCImage.h b/cocos/2d/platform/CCImage.h index f6eba03132..25f09dade2 100644 --- a/cocos/2d/platform/CCImage.h +++ b/cocos/2d/platform/CCImage.h @@ -25,8 +25,8 @@ THE SOFTWARE. #ifndef __CC_IMAGE_H__ #define __CC_IMAGE_H__ -#include "cocoa/CCObject.h" -#include "textures/CCTexture2D.h" +#include "CCObject.h" +#include "CCTexture2D.h" // premultiply alpha, or the effect will wrong when want to use other pixel format in Texture2D, // such as RGB888, RGB5A1 diff --git a/cocos/2d/platform/CCImageCommon_cpp.h b/cocos/2d/platform/CCImageCommon_cpp.h index 8c62e2288e..be7480a0ae 100644 --- a/cocos/2d/platform/CCImageCommon_cpp.h +++ b/cocos/2d/platform/CCImageCommon_cpp.h @@ -40,25 +40,20 @@ extern "C" #include "etc1.h" #include "jpeglib.h" } -#include "third_party/common/s3tc/s3tc.h" -#include "third_party/common/atitc/atitc.h" -#if defined(__native_client__) || defined(EMSCRIPTEN) -// TODO(sbc): I'm pretty sure all platforms should be including -// webph headers in this way. -#include "webp/decode.h" -#else +#include "s3tc.h" +#include "atitc.h" + #include "decode.h" -#endif #include "ccMacros.h" -#include "platform/CCCommon.h" +#include "CCCommon.h" #include "CCStdC.h" #include "CCFileUtils.h" #include "CCConfiguration.h" -#include "support/ccUtils.h" -#include "support/zip_support/ZipUtils.h" +#include "ccUtils.h" +#include "ZipUtils.h" #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) -#include "platform/android/CCFileUtilsAndroid.h" +#include "android/CCFileUtilsAndroid.h" #endif #define CC_GL_ATC_RGB_AMD 0x8C92 diff --git a/cocos/2d/platform/CCSAXParser.cpp b/cocos/2d/platform/CCSAXParser.cpp index 7a857452e0..0f823f938d 100644 --- a/cocos/2d/platform/CCSAXParser.cpp +++ b/cocos/2d/platform/CCSAXParser.cpp @@ -23,9 +23,9 @@ ****************************************************************************/ #include "CCSAXParser.h" -#include "cocoa/CCDictionary.h" +#include "CCDictionary.h" #include "CCFileUtils.h" -#include "support/tinyxml2/tinyxml2.h" +#include "tinyxml2.h" #include // because its based on windows 8 build :P diff --git a/cocos/2d/platform/android/Android.mk b/cocos/2d/platform/android/Android.mk index a599507dc3..2aca5c8ed3 100644 --- a/cocos/2d/platform/android/Android.mk +++ b/cocos/2d/platform/android/Android.mk @@ -24,9 +24,9 @@ LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) LOCAL_C_INCLUDES := $(LOCAL_PATH) \ $(LOCAL_PATH)/../.. \ - $(LOCAL_PATH)/../../include \ - $(LOCAL_PATH)/../../kazmath/include \ - $(LOCAL_PATH)/../../platform/third_party/common/etc + $(LOCAL_PATH)/../../../base \ + $(LOCAL_PATH)/../../../math/kazmath/include \ + $(LOCAL_PATH)/../../../physics LOCAL_LDLIBS := -lGLESv1_CM \ -lGLESv2 \ @@ -47,8 +47,8 @@ LOCAL_WHOLE_STATIC_LIBRARIES := android_native_app_glue cocos_libpng_static coco include $(BUILD_STATIC_LIBRARY) -$(call import-module,libjpeg) -$(call import-module,libpng) -$(call import-module,libtiff) -$(call import-module,libwebp) +$(call import-module,jpeg/prebuilt/android) +$(call import-module,png/prebuilt/android) +$(call import-module,tiff/prebuilt/android) +$(call import-module,webp/prebuilt/android) $(call import-module,android/native_app_glue) diff --git a/cocos/2d/platform/android/CCEGLView.cpp b/cocos/2d/platform/android/CCEGLView.cpp index 384773f119..0347d70a87 100644 --- a/cocos/2d/platform/android/CCEGLView.cpp +++ b/cocos/2d/platform/android/CCEGLView.cpp @@ -22,7 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ #include "CCEGLView.h" -#include "cocoa/CCSet.h" +#include "CCSet.h" #include "CCDirector.h" #include "ccMacros.h" #include "jni/IMEJni.h" diff --git a/cocos/2d/platform/android/CCEGLView.h b/cocos/2d/platform/android/CCEGLView.h index 2432a2cee7..cab0754d3e 100644 --- a/cocos/2d/platform/android/CCEGLView.h +++ b/cocos/2d/platform/android/CCEGLView.h @@ -25,7 +25,7 @@ THE SOFTWARE. #ifndef __CC_EGLVIEW_ANDROID_H__ #define __CC_EGLVIEW_ANDROID_H__ -#include "cocoa/CCGeometry.h" +#include "CCGeometry.h" #include "platform/CCEGLViewProtocol.h" NS_CC_BEGIN diff --git a/cocos/2d/platform/android/CCFileUtilsAndroid.h b/cocos/2d/platform/android/CCFileUtilsAndroid.h index a0e020bc85..87a2445f48 100644 --- a/cocos/2d/platform/android/CCFileUtilsAndroid.h +++ b/cocos/2d/platform/android/CCFileUtilsAndroid.h @@ -25,7 +25,7 @@ #define __CC_FILEUTILS_ANDROID_H__ #include "platform/CCFileUtils.h" -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" #include "ccTypes.h" #include #include diff --git a/cocos/2d/platform/android/CCImage.cpp b/cocos/2d/platform/android/CCImage.cpp index 8c4c636422..0fdfe6445e 100644 --- a/cocos/2d/platform/android/CCImage.cpp +++ b/cocos/2d/platform/android/CCImage.cpp @@ -26,7 +26,7 @@ THE SOFTWARE. #define __CC_PLATFORM_IMAGE_CPP__ #include "platform/CCImageCommon_cpp.h" -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" #include "platform/CCImage.h" #include "platform/CCFileUtils.h" #include "jni/JniHelper.h" diff --git a/cocos/2d/platform/android/CCStdC.h b/cocos/2d/platform/android/CCStdC.h index 16fb8d768b..475142b51a 100644 --- a/cocos/2d/platform/android/CCStdC.h +++ b/cocos/2d/platform/android/CCStdC.h @@ -25,7 +25,7 @@ THE SOFTWARE. #ifndef __CC_STD_C_H__ #define __CC_STD_C_H__ -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" #include #include #include diff --git a/cocos/2d/platform/android/jni/IMEJni.cpp b/cocos/2d/platform/android/jni/IMEJni.cpp index e9b0f0321c..1529374275 100644 --- a/cocos/2d/platform/android/jni/IMEJni.cpp +++ b/cocos/2d/platform/android/jni/IMEJni.cpp @@ -22,7 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ #include "IMEJni.h" -#include "text_input_node/CCIMEDispatcher.h" +#include "CCIMEDispatcher.h" #include "JniHelper.h" #include diff --git a/cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxBitmap.cpp b/cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxBitmap.cpp index 21977aadd1..5ed0fc7279 100644 --- a/cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxBitmap.cpp +++ b/cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxBitmap.cpp @@ -4,7 +4,7 @@ #include "../CCApplication.h" #include "platform/CCFileUtils.h" #include "CCEventType.h" -#include "support/CCNotificationCenter.h" +#include "CCNotificationCenter.h" #include using namespace cocos2d; diff --git a/cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.cpp b/cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.cpp index afcc4b7d3e..6af1c6b1f7 100644 --- a/cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.cpp +++ b/cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.cpp @@ -3,7 +3,7 @@ #include #include #include "JniHelper.h" -#include "cocoa/CCString.h" +#include "CCString.h" #include "Java_org_cocos2dx_lib_Cocos2dxHelper.h" #define LOG_TAG "Java_org_cocos2dx_lib_Cocos2dxHelper.cpp" diff --git a/cocos/2d/platform/android/jni/JniHelper.h b/cocos/2d/platform/android/jni/JniHelper.h index fe1bf38814..20955acf7e 100644 --- a/cocos/2d/platform/android/jni/JniHelper.h +++ b/cocos/2d/platform/android/jni/JniHelper.h @@ -26,7 +26,7 @@ THE SOFTWARE. #include #include -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" NS_CC_BEGIN diff --git a/cocos/2d/platform/android/nativeactivity.cpp b/cocos/2d/platform/android/nativeactivity.cpp index b591953fb8..fa4fb434d4 100644 --- a/cocos/2d/platform/android/nativeactivity.cpp +++ b/cocos/2d/platform/android/nativeactivity.cpp @@ -16,17 +16,17 @@ #include "CCDirector.h" #include "CCApplication.h" #include "CCEventType.h" -#include "support/CCNotificationCenter.h" +#include "CCNotificationCenter.h" #include "CCFileUtilsAndroid.h" #include "jni/JniHelper.h" #include "CCEGLView.h" -#include "draw_nodes/CCDrawingPrimitives.h" -#include "shaders/CCShaderCache.h" -#include "textures/CCTextureCache.h" -#include "event_dispatcher/CCEventDispatcher.h" -#include "event_dispatcher/CCEventAcceleration.h" -#include "event_dispatcher/CCEventKeyboard.h" +#include "CCDrawingPrimitives.h" +#include "CCShaderCache.h" +#include "CCTextureCache.h" +#include "CCEventDispatcher.h" +#include "CCEventAcceleration.h" +#include "CCEventKeyboard.h" #include "jni/Java_org_cocos2dx_lib_Cocos2dxHelper.h" diff --git a/cocos/2d/platform/apple/CCFileUtilsApple.mm b/cocos/2d/platform/apple/CCFileUtilsApple.mm index 34de65fee6..811a4189b1 100644 --- a/cocos/2d/platform/apple/CCFileUtilsApple.mm +++ b/cocos/2d/platform/apple/CCFileUtilsApple.mm @@ -26,12 +26,12 @@ THE SOFTWARE. #include #include -#include "cocoa/CCString.h" +#include "CCString.h" #include "CCFileUtils.h" #include "CCDirector.h" #include "CCSAXParser.h" #include "CCDictionary.h" -#include "support/zip_support/unzip.h" +#include "unzip.h" #include "CCFileUtilsApple.h" diff --git a/cocos/2d/platform/ios/CCDevice.mm b/cocos/2d/platform/ios/CCDevice.mm index e84eb4196d..83212d575d 100644 --- a/cocos/2d/platform/ios/CCDevice.mm +++ b/cocos/2d/platform/ios/CCDevice.mm @@ -1,7 +1,7 @@ #include "CCDevice.h" #include "ccTypes.h" -#include "event_dispatcher/CCEventDispatcher.h" -#include "event_dispatcher/CCEventAcceleration.h" +#include "CCEventDispatcher.h" +#include "CCEventAcceleration.h" #import diff --git a/cocos/2d/platform/ios/CCStdC.h b/cocos/2d/platform/ios/CCStdC.h index 16fb8d768b..475142b51a 100644 --- a/cocos/2d/platform/ios/CCStdC.h +++ b/cocos/2d/platform/ios/CCStdC.h @@ -25,7 +25,7 @@ THE SOFTWARE. #ifndef __CC_STD_C_H__ #define __CC_STD_C_H__ -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" #include #include #include diff --git a/cocos/2d/platform/linux/CCEGLView.cpp b/cocos/2d/platform/linux/CCEGLView.cpp index 384bd05796..452d5738a3 100644 --- a/cocos/2d/platform/linux/CCEGLView.cpp +++ b/cocos/2d/platform/linux/CCEGLView.cpp @@ -9,10 +9,10 @@ #include "CCGL.h" #include "ccMacros.h" #include "CCDirector.h" -#include "event_dispatcher/CCTouch.h" -#include "text_input_node/CCIMEDispatcher.h" -#include "event_dispatcher/CCEventDispatcher.h" -#include "event_dispatcher/CCEventKeyboard.h" +#include "CCTouch.h" +#include "/CCIMEDispatcher.h" +#include "CCEventDispatcher.h" +#include "CCEventKeyboard.h" #include NS_CC_BEGIN diff --git a/cocos/2d/platform/linux/CCEGLView.h b/cocos/2d/platform/linux/CCEGLView.h index 5dae9ec609..9d29d9c188 100644 --- a/cocos/2d/platform/linux/CCEGLView.h +++ b/cocos/2d/platform/linux/CCEGLView.h @@ -9,7 +9,7 @@ #define EGLVIEW_H_ #include "platform/CCCommon.h" -#include "cocoa/CCGeometry.h" +#include "CCGeometry.h" #include "platform/CCEGLViewProtocol.h" #include "platform/third_party/linux/glfw/glfw3.h" #include diff --git a/cocos/2d/platform/linux/CCFileUtilsLinux.cpp b/cocos/2d/platform/linux/CCFileUtilsLinux.cpp index 13a88a1c3d..227c59b0ba 100644 --- a/cocos/2d/platform/linux/CCFileUtilsLinux.cpp +++ b/cocos/2d/platform/linux/CCFileUtilsLinux.cpp @@ -8,7 +8,7 @@ #include "platform/CCCommon.h" #include "ccMacros.h" #include "CCApplication.h" -#include "cocoa/CCString.h" +#include "CCString.h" #include #include #include diff --git a/cocos/2d/platform/linux/CCFileUtilsLinux.h b/cocos/2d/platform/linux/CCFileUtilsLinux.h index 9aed872e80..366f8d08f5 100644 --- a/cocos/2d/platform/linux/CCFileUtilsLinux.h +++ b/cocos/2d/platform/linux/CCFileUtilsLinux.h @@ -25,7 +25,7 @@ #define __CC_FILEUTILS_LINUX_H__ #include "platform/CCFileUtils.h" -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" #include "ccTypes.h" #include #include diff --git a/cocos/2d/platform/linux/CCImage.cpp b/cocos/2d/platform/linux/CCImage.cpp index 9c70245d19..551595c709 100644 --- a/cocos/2d/platform/linux/CCImage.cpp +++ b/cocos/2d/platform/linux/CCImage.cpp @@ -7,7 +7,7 @@ #include #include "platform/CCFileUtils.h" -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" #define __CC_PLATFORM_IMAGE_CPP__ #include "platform/CCImageCommon_cpp.h" #include "platform/CCImage.h" diff --git a/cocos/2d/platform/linux/CCStdC.h b/cocos/2d/platform/linux/CCStdC.h index 399de60778..7fd6339bef 100644 --- a/cocos/2d/platform/linux/CCStdC.h +++ b/cocos/2d/platform/linux/CCStdC.h @@ -25,7 +25,7 @@ THE SOFTWARE. #ifndef __CC_STD_C_H__ #define __CC_STD_C_H__ -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" #include #include diff --git a/cocos/2d/platform/mac/CCEGLView.mm b/cocos/2d/platform/mac/CCEGLView.mm index 3c371b2457..d8dce7ba57 100644 --- a/cocos/2d/platform/mac/CCEGLView.mm +++ b/cocos/2d/platform/mac/CCEGLView.mm @@ -25,9 +25,9 @@ #include "EAGLView.h" #include "CCDirector.h" #include "CCSet.h" -#include "event_dispatcher/CCTouch.h" -#include "event_dispatcher/CCEventDispatcher.h" -#include "event_dispatcher/CCEventKeyboard.h" +#include "CCTouch.h" +#include "CCEventDispatcher.h" +#include "CCEventKeyboard.h" #include "CCIMEDispatcher.h" NS_CC_BEGIN diff --git a/cocos/2d/platform/mac/CCEventDispatcher.mm b/cocos/2d/platform/mac/CCEventDispatcher.mm index f316b170c7..6487d877a1 100644 --- a/cocos/2d/platform/mac/CCEventDispatcher.mm +++ b/cocos/2d/platform/mac/CCEventDispatcher.mm @@ -29,7 +29,7 @@ #import "CCEventDispatcher.h" #import "ccConfig.h" -#include "support/data_support/utlist.h" +#include "utlist.h" #include "CCDirector.h" #include "platform/mac/CCEventDispatcher.h" diff --git a/cocos/2d/platform/mac/CCStdC.h b/cocos/2d/platform/mac/CCStdC.h index 16fb8d768b..475142b51a 100644 --- a/cocos/2d/platform/mac/CCStdC.h +++ b/cocos/2d/platform/mac/CCStdC.h @@ -25,7 +25,7 @@ THE SOFTWARE. #ifndef __CC_STD_C_H__ #define __CC_STD_C_H__ -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" #include #include #include diff --git a/cocos/2d/platform/win32/CCEGLView.cpp b/cocos/2d/platform/win32/CCEGLView.cpp index cefcc9f038..4099331cf9 100644 --- a/cocos/2d/platform/win32/CCEGLView.cpp +++ b/cocos/2d/platform/win32/CCEGLView.cpp @@ -23,14 +23,14 @@ THE SOFTWARE. ****************************************************************************/ #include "CCEGLView.h" -#include "cocoa/CCSet.h" +#include "CCSet.h" #include "ccMacros.h" #include "CCDirector.h" -#include "text_input_node/CCIMEDispatcher.h" +#include "/CCIMEDispatcher.h" #include "CCApplication.h" -#include "event_dispatcher/CCTouch.h" -#include "event_dispatcher/CCEventDispatcher.h" -#include "event_dispatcher/CCEventKeyboard.h" +#include "CCTouch.h" +#include "CCEventDispatcher.h" +#include "CCEventKeyboard.h" NS_CC_BEGIN diff --git a/cocos/2d/platform/win32/CCEGLView.h b/cocos/2d/platform/win32/CCEGLView.h index 5c5a2b4407..643b500c66 100644 --- a/cocos/2d/platform/win32/CCEGLView.h +++ b/cocos/2d/platform/win32/CCEGLView.h @@ -27,7 +27,7 @@ THE SOFTWARE. #include "CCStdC.h" #include "platform/CCCommon.h" -#include "cocoa/CCGeometry.h" +#include "CCGeometry.h" #include "platform/CCEGLViewProtocol.h" #include "platform/third_party/win32/GLFW/glfw3.h" diff --git a/cocos/2d/platform/win32/CCFileUtilsWin32.h b/cocos/2d/platform/win32/CCFileUtilsWin32.h index bd52a82ede..4f01adabeb 100644 --- a/cocos/2d/platform/win32/CCFileUtilsWin32.h +++ b/cocos/2d/platform/win32/CCFileUtilsWin32.h @@ -25,7 +25,7 @@ #define __CC_FILEUTILS_WIN32_H__ #include "platform/CCFileUtils.h" -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" #include "ccTypes.h" #include #include diff --git a/cocos/2d/platform/win32/CCStdC.h b/cocos/2d/platform/win32/CCStdC.h index a361e5b056..4716dc6524 100644 --- a/cocos/2d/platform/win32/CCStdC.h +++ b/cocos/2d/platform/win32/CCStdC.h @@ -25,7 +25,7 @@ THE SOFTWARE. #ifndef __CC_STD_C_H__ #define __CC_STD_C_H__ -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" #include // for math.h on win32 platform diff --git a/cocos/audio/android/Android.mk b/cocos/audio/android/Android.mk index 2704964c93..ed44e77cf7 100644 --- a/cocos/audio/android/Android.mk +++ b/cocos/audio/android/Android.mk @@ -13,10 +13,11 @@ LOCAL_SRC_FILES := cddSimpleAudioEngine.cpp \ LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../include LOCAL_C_INCLUDES := $(LOCAL_PATH)/../include \ - $(LOCAL_PATH)/../../cocos2dx \ - $(LOCAL_PATH)/../../cocos2dx/include \ - $(LOCAL_PATH)/../../cocos2dx/kazmath/include \ - $(LOCAL_PATH)/../../cocos2dx/platform/android + $(LOCAL_PATH)/../../math/kazmath/include \ + $(LOCAL_PATH)/../../2d \ + $(LOCAL_PATH)/../../2d/platform/android \ + $(LOCAL_PATH)/../../base \ + $(LOCAL_PATH)/../../physics LOCAL_CFLAGS += -Wno-psabi LOCAL_EXPORT_CFLAGS += -Wno-psabi diff --git a/cocos/base/cocoa/CCAffineTransform.cpp b/cocos/base/CCAffineTransform.cpp similarity index 100% rename from cocos/base/cocoa/CCAffineTransform.cpp rename to cocos/base/CCAffineTransform.cpp diff --git a/cocos/base/cocoa/CCAffineTransform.h b/cocos/base/CCAffineTransform.h similarity index 98% rename from cocos/base/cocoa/CCAffineTransform.h rename to cocos/base/CCAffineTransform.h index 667b5d9b46..66c76fc5f0 100644 --- a/cocos/base/cocoa/CCAffineTransform.h +++ b/cocos/base/CCAffineTransform.h @@ -26,7 +26,7 @@ THE SOFTWARE. #define __COCOA_CGAFFINETRANSFORM_H__ #include "CCGeometry.h" -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" NS_CC_BEGIN diff --git a/cocos/base/cocoa/CCArray.cpp b/cocos/base/CCArray.cpp similarity index 100% rename from cocos/base/cocoa/CCArray.cpp rename to cocos/base/CCArray.cpp diff --git a/cocos/base/cocoa/CCArray.h b/cocos/base/CCArray.h similarity index 99% rename from cocos/base/cocoa/CCArray.h rename to cocos/base/CCArray.h index 4f5beea501..7f67569faa 100644 --- a/cocos/base/cocoa/CCArray.h +++ b/cocos/base/CCArray.h @@ -30,10 +30,10 @@ THE SOFTWARE. #if CC_USE_ARRAY_VECTOR #include #include -#include "cocoa/CCObject.h" +#include "CCObject.h" #include "ccMacros.h" #else -#include "support/data_support/ccCArray.h" +#include "ccCArray.h" #endif diff --git a/cocos/base/cocoa/CCAutoreleasePool.cpp b/cocos/base/CCAutoreleasePool.cpp similarity index 100% rename from cocos/base/cocoa/CCAutoreleasePool.cpp rename to cocos/base/CCAutoreleasePool.cpp diff --git a/cocos/base/cocoa/CCAutoreleasePool.h b/cocos/base/CCAutoreleasePool.h similarity index 100% rename from cocos/base/cocoa/CCAutoreleasePool.h rename to cocos/base/CCAutoreleasePool.h diff --git a/cocos/base/cocoa/CCBool.h b/cocos/base/CCBool.h similarity index 100% rename from cocos/base/cocoa/CCBool.h rename to cocos/base/CCBool.h diff --git a/cocos/base/cocoa/CCData.cpp b/cocos/base/CCData.cpp similarity index 100% rename from cocos/base/cocoa/CCData.cpp rename to cocos/base/CCData.cpp diff --git a/cocos/base/cocoa/CCData.h b/cocos/base/CCData.h similarity index 98% rename from cocos/base/cocoa/CCData.h rename to cocos/base/CCData.h index 889a2d557b..27cb43da61 100644 --- a/cocos/base/cocoa/CCData.h +++ b/cocos/base/CCData.h @@ -25,7 +25,7 @@ #ifndef __CCDATA_H__ #define __CCDATA_H__ -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" #include "CCObject.h" NS_CC_BEGIN diff --git a/cocos/base/cocoa/CCDataVisitor.cpp b/cocos/base/CCDataVisitor.cpp similarity index 100% rename from cocos/base/cocoa/CCDataVisitor.cpp rename to cocos/base/CCDataVisitor.cpp diff --git a/cocos/base/cocoa/CCDataVisitor.h b/cocos/base/CCDataVisitor.h similarity index 98% rename from cocos/base/cocoa/CCDataVisitor.h rename to cocos/base/CCDataVisitor.h index 3395b43dea..93d2463f29 100644 --- a/cocos/base/cocoa/CCDataVisitor.h +++ b/cocos/base/CCDataVisitor.h @@ -25,7 +25,7 @@ #ifndef __CCDATAVISITOR_H__ #define __CCDATAVISITOR_H__ -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" #include NS_CC_BEGIN diff --git a/cocos/base/cocoa/CCDictionary.cpp b/cocos/base/CCDictionary.cpp similarity index 100% rename from cocos/base/cocoa/CCDictionary.cpp rename to cocos/base/CCDictionary.cpp diff --git a/cocos/base/cocoa/CCDictionary.h b/cocos/base/CCDictionary.h similarity index 99% rename from cocos/base/cocoa/CCDictionary.h rename to cocos/base/CCDictionary.h index b0f1c98a9c..63082109b3 100644 --- a/cocos/base/cocoa/CCDictionary.h +++ b/cocos/base/CCDictionary.h @@ -25,7 +25,7 @@ THE SOFTWARE. #ifndef __CCDICTIONARY_H__ #define __CCDICTIONARY_H__ -#include "support/data_support/uthash.h" +#include "uthash.h" #include "CCObject.h" #include "CCArray.h" #include "CCString.h" diff --git a/cocos/base/cocoa/CCDouble.h b/cocos/base/CCDouble.h similarity index 100% rename from cocos/base/cocoa/CCDouble.h rename to cocos/base/CCDouble.h diff --git a/cocos/base/cocoa/CCFloat.h b/cocos/base/CCFloat.h similarity index 100% rename from cocos/base/cocoa/CCFloat.h rename to cocos/base/CCFloat.h diff --git a/cocos/base/cocoa/CCGeometry.cpp b/cocos/base/CCGeometry.cpp similarity index 100% rename from cocos/base/cocoa/CCGeometry.cpp rename to cocos/base/CCGeometry.cpp diff --git a/cocos/base/cocoa/CCGeometry.h b/cocos/base/CCGeometry.h similarity index 99% rename from cocos/base/cocoa/CCGeometry.h rename to cocos/base/CCGeometry.h index 47e2fdf9ac..ac9f08ec03 100644 --- a/cocos/base/cocoa/CCGeometry.h +++ b/cocos/base/CCGeometry.h @@ -28,7 +28,7 @@ THE SOFTWARE. #include #include -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" #include "CCObject.h" #include "ccMacros.h" diff --git a/cocos/base/cocoa/CCInteger.h b/cocos/base/CCInteger.h similarity index 100% rename from cocos/base/cocoa/CCInteger.h rename to cocos/base/CCInteger.h diff --git a/cocos/base/cocoa/CCNS.cpp b/cocos/base/CCNS.cpp similarity index 100% rename from cocos/base/cocoa/CCNS.cpp rename to cocos/base/CCNS.cpp diff --git a/cocos/base/cocoa/CCNS.h b/cocos/base/CCNS.h similarity index 100% rename from cocos/base/cocoa/CCNS.h rename to cocos/base/CCNS.h diff --git a/cocos/base/cocoa/CCObject.cpp b/cocos/base/CCObject.cpp similarity index 98% rename from cocos/base/cocoa/CCObject.cpp rename to cocos/base/CCObject.cpp index 13fa0e3236..75d01c5937 100644 --- a/cocos/base/cocoa/CCObject.cpp +++ b/cocos/base/CCObject.cpp @@ -26,7 +26,7 @@ THE SOFTWARE. #include "CCObject.h" #include "CCAutoreleasePool.h" #include "ccMacros.h" -#include "script_support/CCScriptSupport.h" +#include "CCScriptSupport.h" NS_CC_BEGIN diff --git a/cocos/base/cocoa/CCObject.h b/cocos/base/CCObject.h similarity index 99% rename from cocos/base/cocoa/CCObject.h rename to cocos/base/CCObject.h index 8de1ff9d8b..3c3e6c5321 100644 --- a/cocos/base/cocoa/CCObject.h +++ b/cocos/base/CCObject.h @@ -25,7 +25,7 @@ THE SOFTWARE. #ifndef __CCOBJECT_H__ #define __CCOBJECT_H__ -#include "cocoa/CCDataVisitor.h" +#include "CCDataVisitor.h" #include "ccMacros.h" #ifdef EMSCRIPTEN diff --git a/cocos/base/cocoa/CCSet.cpp b/cocos/base/CCSet.cpp similarity index 100% rename from cocos/base/cocoa/CCSet.cpp rename to cocos/base/CCSet.cpp diff --git a/cocos/base/cocoa/CCSet.h b/cocos/base/CCSet.h similarity index 100% rename from cocos/base/cocoa/CCSet.h rename to cocos/base/CCSet.h diff --git a/cocos/base/cocoa/CCString.cpp b/cocos/base/CCString.cpp similarity index 100% rename from cocos/base/cocoa/CCString.cpp rename to cocos/base/CCString.cpp diff --git a/cocos/base/cocoa/CCString.h b/cocos/base/CCString.h similarity index 100% rename from cocos/base/cocoa/CCString.h rename to cocos/base/CCString.h diff --git a/cocos/base/atitc/atitc.cpp b/cocos/base/atitc.cpp similarity index 100% rename from cocos/base/atitc/atitc.cpp rename to cocos/base/atitc.cpp diff --git a/cocos/base/atitc/atitc.h b/cocos/base/atitc.h similarity index 100% rename from cocos/base/atitc/atitc.h rename to cocos/base/atitc.h diff --git a/cocos/base/etc1/etc1.cpp b/cocos/base/etc1.cpp similarity index 100% rename from cocos/base/etc1/etc1.cpp rename to cocos/base/etc1.cpp diff --git a/cocos/base/etc1/etc1.h b/cocos/base/etc1.h similarity index 100% rename from cocos/base/etc1/etc1.h rename to cocos/base/etc1.h diff --git a/cocos/base/s3tc/s3tc.cpp b/cocos/base/s3tc.cpp similarity index 100% rename from cocos/base/s3tc/s3tc.cpp rename to cocos/base/s3tc.cpp diff --git a/cocos/base/s3tc/s3tc.h b/cocos/base/s3tc.h similarity index 100% rename from cocos/base/s3tc/s3tc.h rename to cocos/base/s3tc.h diff --git a/cocos/math/kazmath/include/kazmath/GL/matrix.h b/cocos/math/kazmath/include/kazmath/GL/matrix.h index a1c95f8bf9..8b624a9868 100644 --- a/cocos/math/kazmath/include/kazmath/GL/matrix.h +++ b/cocos/math/kazmath/include/kazmath/GL/matrix.h @@ -26,7 +26,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef KM_GL_MATRIX_H_INCLUDED #define KM_GL_MATRIX_H_INCLUDED -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" #define KM_GL_MODELVIEW 0x1700 #define KM_GL_PROJECTION 0x1701 diff --git a/cocos/math/kazmath/include/kazmath/aabb.h b/cocos/math/kazmath/include/kazmath/aabb.h index 629889cef1..e26d9771da 100644 --- a/cocos/math/kazmath/include/kazmath/aabb.h +++ b/cocos/math/kazmath/include/kazmath/aabb.h @@ -26,7 +26,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef KAZMATH_AABB_H_INCLUDED #define KAZMATH_AABB_H_INCLUDED -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" #include "vec3.h" #include "utility.h" diff --git a/cocos/math/kazmath/include/kazmath/mat3.h b/cocos/math/kazmath/include/kazmath/mat3.h index 4d22dfb28a..fc0668b20d 100644 --- a/cocos/math/kazmath/include/kazmath/mat3.h +++ b/cocos/math/kazmath/include/kazmath/mat3.h @@ -27,7 +27,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef MAT3_H_INCLUDED #define MAT3_H_INCLUDED -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" #include "utility.h" struct kmVec3; diff --git a/cocos/math/kazmath/include/kazmath/mat4.h b/cocos/math/kazmath/include/kazmath/mat4.h index 241a0b9ec0..f8ad019d5f 100644 --- a/cocos/math/kazmath/include/kazmath/mat4.h +++ b/cocos/math/kazmath/include/kazmath/mat4.h @@ -26,7 +26,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef MAT4_H_INCLUDED #define MAT4_H_INCLUDED -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" #include "utility.h" struct kmVec3; diff --git a/cocos/math/kazmath/include/kazmath/plane.h b/cocos/math/kazmath/include/kazmath/plane.h index c4e4fe5b7e..a01d5fd744 100644 --- a/cocos/math/kazmath/include/kazmath/plane.h +++ b/cocos/math/kazmath/include/kazmath/plane.h @@ -33,7 +33,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define KM_PLANE_NEAR 4 #define KM_PLANE_FAR 5 -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" #include "utility.h" struct kmVec3; diff --git a/cocos/math/kazmath/include/kazmath/quaternion.h b/cocos/math/kazmath/include/kazmath/quaternion.h index a3632f0ff9..2e9bb582c4 100644 --- a/cocos/math/kazmath/include/kazmath/quaternion.h +++ b/cocos/math/kazmath/include/kazmath/quaternion.h @@ -30,7 +30,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. extern "C" { #endif -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" #include "utility.h" struct kmMat4; diff --git a/cocos/math/kazmath/include/kazmath/ray2.h b/cocos/math/kazmath/include/kazmath/ray2.h index 6734a95611..c93c3b4a4e 100644 --- a/cocos/math/kazmath/include/kazmath/ray2.h +++ b/cocos/math/kazmath/include/kazmath/ray2.h @@ -26,7 +26,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef RAY_2_H #define RAY_2_H -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" #include "utility.h" #include "vec2.h" diff --git a/cocos/math/kazmath/include/kazmath/utility.h b/cocos/math/kazmath/include/kazmath/utility.h index ed6bff6854..62b196be1c 100644 --- a/cocos/math/kazmath/include/kazmath/utility.h +++ b/cocos/math/kazmath/include/kazmath/utility.h @@ -26,7 +26,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef UTILITY_H_INCLUDED #define UTILITY_H_INCLUDED -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" #include #ifndef kmScalar diff --git a/cocos/math/kazmath/include/kazmath/vec2.h b/cocos/math/kazmath/include/kazmath/vec2.h index 6c29d4005f..d8fdf82e41 100644 --- a/cocos/math/kazmath/include/kazmath/vec2.h +++ b/cocos/math/kazmath/include/kazmath/vec2.h @@ -26,7 +26,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef VEC2_H_INCLUDED #define VEC2_H_INCLUDED -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" struct kmMat3; diff --git a/cocos/math/kazmath/include/kazmath/vec3.h b/cocos/math/kazmath/include/kazmath/vec3.h index eb74d41b61..d8c8641cf4 100644 --- a/cocos/math/kazmath/include/kazmath/vec3.h +++ b/cocos/math/kazmath/include/kazmath/vec3.h @@ -26,7 +26,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef VEC3_H_INCLUDED #define VEC3_H_INCLUDED -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" #include #ifndef kmScalar diff --git a/cocos/math/kazmath/include/kazmath/vec4.h b/cocos/math/kazmath/include/kazmath/vec4.h index 7956d2a794..ffdb70423d 100644 --- a/cocos/math/kazmath/include/kazmath/vec4.h +++ b/cocos/math/kazmath/include/kazmath/vec4.h @@ -26,7 +26,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef VEC4_H_INCLUDED #define VEC4_H_INCLUDED -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" #include "utility.h" struct kmMat4; diff --git a/cocos/physics/CCPhysicsBody.h b/cocos/physics/CCPhysicsBody.h index e477c31a01..412ec6b963 100644 --- a/cocos/physics/CCPhysicsBody.h +++ b/cocos/physics/CCPhysicsBody.h @@ -28,8 +28,8 @@ #ifndef __CCPHYSICS_BODY_H__ #define __CCPHYSICS_BODY_H__ -#include "cocoa/CCObject.h" -#include "cocoa/CCGeometry.h" +#include "CCObject.h" +#include "CCGeometry.h" #include "CCPhysicsShape.h" diff --git a/cocos/physics/CCPhysicsContact.h b/cocos/physics/CCPhysicsContact.h index 605a6dcf80..86c39a05eb 100644 --- a/cocos/physics/CCPhysicsContact.h +++ b/cocos/physics/CCPhysicsContact.h @@ -28,8 +28,8 @@ #ifndef __CCPHYSICS_CONTACT_H__ #define __CCPHYSICS_CONTACT_H__ -#include "cocoa/CCObject.h" -#include "cocoa/CCGeometry.h" +#include "CCObject.h" +#include "CCGeometry.h" NS_CC_BEGIN diff --git a/cocos/physics/CCPhysicsJoint.h b/cocos/physics/CCPhysicsJoint.h index 73383c39b6..7b78e1a089 100644 --- a/cocos/physics/CCPhysicsJoint.h +++ b/cocos/physics/CCPhysicsJoint.h @@ -28,8 +28,8 @@ #ifndef __CCPHYSICS_JOINT_H__ #define __CCPHYSICS_JOINT_H__ -#include "cocoa/CCObject.h" -#include "cocoa/CCGeometry.h" +#include "CCObject.h" +#include "CCGeometry.h" NS_CC_BEGIN diff --git a/cocos/physics/CCPhysicsShape.h b/cocos/physics/CCPhysicsShape.h index 4915035521..6ff731f273 100644 --- a/cocos/physics/CCPhysicsShape.h +++ b/cocos/physics/CCPhysicsShape.h @@ -28,8 +28,8 @@ #ifndef __CCPHYSICS_SHAPE_H__ #define __CCPHYSICS_SHAPE_H__ -#include "cocoa/CCObject.h" -#include "cocoa/CCGeometry.h" +#include "CCObject.h" +#include "CCGeometry.h" NS_CC_BEGIN diff --git a/cocos/physics/CCPhysicsWorld.cpp b/cocos/physics/CCPhysicsWorld.cpp index 7ede980f53..1777a395f0 100644 --- a/cocos/physics/CCPhysicsWorld.cpp +++ b/cocos/physics/CCPhysicsWorld.cpp @@ -48,9 +48,9 @@ #include "Box2D/CCPhysicsJointInfo.h" #include "chipmunk/CCPhysicsHelper.h" -#include "draw_nodes/CCDrawNode.h" -#include "cocoa/CCArray.h" -#include "layers_scenes_transitions_nodes/CCScene.h" +#include "CCDrawNode.h" +#include "CCArray.h" +#include "CCScene.h" #include "CCDirector.h" #include diff --git a/cocos/physics/CCPhysicsWorld.h b/cocos/physics/CCPhysicsWorld.h index d7a30f37cf..da6a7477c6 100644 --- a/cocos/physics/CCPhysicsWorld.h +++ b/cocos/physics/CCPhysicsWorld.h @@ -30,8 +30,8 @@ #include -#include "cocoa/CCObject.h" -#include "cocoa/CCGeometry.h" +#include "CCObject.h" +#include "CCGeometry.h" #if (CC_PHYSICS_ENGINE == CC_PHYSICS_CHIPMUNK) diff --git a/cocos/physics/box2d/CCPhysicsBodyInfo.h b/cocos/physics/box2d/CCPhysicsBodyInfo.h index 730837ed9d..5c89ac5f19 100644 --- a/cocos/physics/box2d/CCPhysicsBodyInfo.h +++ b/cocos/physics/box2d/CCPhysicsBodyInfo.h @@ -27,7 +27,7 @@ #ifndef __CCPHYSICS_BODY_INFO_H__ #define __CCPHYSICS_BODY_INFO_H__ -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" NS_CC_BEGIN class PhysicsBodyInfo diff --git a/cocos/physics/box2d/CCPhysicsContactInfo.h b/cocos/physics/box2d/CCPhysicsContactInfo.h index b592caa0af..f1e41ef572 100644 --- a/cocos/physics/box2d/CCPhysicsContactInfo.h +++ b/cocos/physics/box2d/CCPhysicsContactInfo.h @@ -27,7 +27,7 @@ #ifndef __CCPHYSICS_CONTACT_INFO_H__ #define __CCPHYSICS_CONTACT_INFO_H__ -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" NS_CC_BEGIN class PhysicsContactInfo diff --git a/cocos/physics/box2d/CCPhysicsHelper.h b/cocos/physics/box2d/CCPhysicsHelper.h index 86ef7d74ee..61dd2b6e4c 100644 --- a/cocos/physics/box2d/CCPhysicsHelper.h +++ b/cocos/physics/box2d/CCPhysicsHelper.h @@ -28,8 +28,8 @@ #ifndef __CCPHYSICS_HELPER_H__ #define __CCPHYSICS_HELPER_H__ -#include "platform/CCPlatformMacros.h" -#include "cocoa/CCGeometry.h" +#include "CCPlatformMacros.h" +#include "CCGeometry.h" NS_CC_BEGIN diff --git a/cocos/physics/box2d/CCPhysicsJointInfo.h b/cocos/physics/box2d/CCPhysicsJointInfo.h index abcf089387..a60ecdb97e 100644 --- a/cocos/physics/box2d/CCPhysicsJointInfo.h +++ b/cocos/physics/box2d/CCPhysicsJointInfo.h @@ -27,7 +27,7 @@ #ifndef __CCPHYSICS_JOINT_INFO_H__ #define __CCPHYSICS_JOINT_INFO_H__ -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" NS_CC_BEGIN class PhysicsJointInfo diff --git a/cocos/physics/box2d/CCPhysicsShapeInfo.h b/cocos/physics/box2d/CCPhysicsShapeInfo.h index 9091001887..8608f0bad1 100644 --- a/cocos/physics/box2d/CCPhysicsShapeInfo.h +++ b/cocos/physics/box2d/CCPhysicsShapeInfo.h @@ -27,7 +27,7 @@ #ifndef __CCPHYSICS_SHAPE_INFO_H__ #define __CCPHYSICS_SHAPE_INFO_H__ -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" NS_CC_BEGIN class PhysicsShapeInfo diff --git a/cocos/physics/box2d/CCPhysicsWorldInfo.h b/cocos/physics/box2d/CCPhysicsWorldInfo.h index bcc09124db..662fa19843 100644 --- a/cocos/physics/box2d/CCPhysicsWorldInfo.h +++ b/cocos/physics/box2d/CCPhysicsWorldInfo.h @@ -27,7 +27,7 @@ #ifndef __CCPHYSICS_WORLD_INFO_H__ #define __CCPHYSICS_WORLD_INFO_H__ -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" NS_CC_BEGIN class PhysicsWorldInfo diff --git a/cocos/physics/chipmunk/CCPhysicsBodyInfo.h b/cocos/physics/chipmunk/CCPhysicsBodyInfo.h index 0faef2eb49..03a8e0fee4 100644 --- a/cocos/physics/chipmunk/CCPhysicsBodyInfo.h +++ b/cocos/physics/chipmunk/CCPhysicsBodyInfo.h @@ -28,8 +28,8 @@ #ifndef __CCPHYSICS_BODY_INFO_H__ #define __CCPHYSICS_BODY_INFO_H__ #include "chipmunk.h" -#include "platform/CCPlatformMacros.h" -#include "cocoa/CCObject.h" +#include "CCPlatformMacros.h" +#include "CCObject.h" NS_CC_BEGIN diff --git a/cocos/physics/chipmunk/CCPhysicsContactInfo.h b/cocos/physics/chipmunk/CCPhysicsContactInfo.h index 5033a2181d..6c302947b7 100644 --- a/cocos/physics/chipmunk/CCPhysicsContactInfo.h +++ b/cocos/physics/chipmunk/CCPhysicsContactInfo.h @@ -28,7 +28,7 @@ #ifndef __CCPHYSICS_CONTACT_INFO_H__ #define __CCPHYSICS_CONTACT_INFO_H__ #include "chipmunk.h" -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" NS_CC_BEGIN class PhysicsContact; diff --git a/cocos/physics/chipmunk/CCPhysicsHelper.h b/cocos/physics/chipmunk/CCPhysicsHelper.h index a026d632b7..8c3bed53ef 100644 --- a/cocos/physics/chipmunk/CCPhysicsHelper.h +++ b/cocos/physics/chipmunk/CCPhysicsHelper.h @@ -29,8 +29,8 @@ #define __CCPHYSICS_HELPER_H__ #include "chipmunk.h" -#include "platform/CCPlatformMacros.h" -#include "cocoa/CCGeometry.h" +#include "CCPlatformMacros.h" +#include "CCGeometry.h" NS_CC_BEGIN diff --git a/cocos/physics/chipmunk/CCPhysicsJointInfo.h b/cocos/physics/chipmunk/CCPhysicsJointInfo.h index 47b1fc6141..9e09abf52b 100644 --- a/cocos/physics/chipmunk/CCPhysicsJointInfo.h +++ b/cocos/physics/chipmunk/CCPhysicsJointInfo.h @@ -28,7 +28,7 @@ #ifndef __CCPHYSICS_JOINT_INFO_H__ #define __CCPHYSICS_JOINT_INFO_H__ #include "chipmunk.h" -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" NS_CC_BEGIN class PhysicsJointInfo diff --git a/cocos/physics/chipmunk/CCPhysicsShapeInfo.h b/cocos/physics/chipmunk/CCPhysicsShapeInfo.h index 5e9f2a73e3..61da25d63b 100644 --- a/cocos/physics/chipmunk/CCPhysicsShapeInfo.h +++ b/cocos/physics/chipmunk/CCPhysicsShapeInfo.h @@ -31,7 +31,7 @@ #include #include #include "chipmunk.h" -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" NS_CC_BEGIN diff --git a/cocos/physics/chipmunk/CCPhysicsWorldInfo.h b/cocos/physics/chipmunk/CCPhysicsWorldInfo.h index 3bc0cf2bc4..71d56f0a5b 100644 --- a/cocos/physics/chipmunk/CCPhysicsWorldInfo.h +++ b/cocos/physics/chipmunk/CCPhysicsWorldInfo.h @@ -28,7 +28,7 @@ #ifndef __CCPHYSICS_WORLD_INFO_H__ #define __CCPHYSICS_WORLD_INFO_H__ #include "chipmunk.h" -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" NS_CC_BEGIN class PhysicsWorldInfo diff --git a/extensions/Android.mk b/extensions/Android.mk index 8c0b1e2591..6a5bf063d7 100644 --- a/extensions/Android.mk +++ b/extensions/Android.mk @@ -6,138 +6,31 @@ LOCAL_MODULE := cocos_extension_static LOCAL_MODULE_FILENAME := libextension LOCAL_SRC_FILES := \ -CCDeprecated-ext.cpp \ -AssetsManager/AssetsManager.cpp \ -CCBReader/CCBAnimationManager.cpp \ -CCBReader/CCBFileLoader.cpp \ -CCBReader/CCBKeyframe.cpp \ -CCBReader/CCBReader.cpp \ -CCBReader/CCBSequence.cpp \ -CCBReader/CCBSequenceProperty.cpp \ -CCBReader/CCBValue.cpp \ -CCBReader/CCControlButtonLoader.cpp \ -CCBReader/CCControlLoader.cpp \ -CCBReader/CCLabelBMFontLoader.cpp \ -CCBReader/CCLabelTTFLoader.cpp \ -CCBReader/CCLayerColorLoader.cpp \ -CCBReader/CCLayerGradientLoader.cpp \ -CCBReader/CCLayerLoader.cpp \ -CCBReader/CCMenuItemImageLoader.cpp \ -CCBReader/CCMenuItemLoader.cpp \ -CCBReader/CCNode+CCBRelativePositioning.cpp \ -CCBReader/CCNodeLoader.cpp \ -CCBReader/CCNodeLoaderLibrary.cpp \ -CCBReader/CCParticleSystemQuadLoader.cpp \ -CCBReader/CCScale9SpriteLoader.cpp \ -CCBReader/CCScrollViewLoader.cpp \ -CCBReader/CCSpriteLoader.cpp \ -CocoStudio/Action/CCActionFrame.cpp \ -CocoStudio/Action/CCActionFrameEasing.cpp \ -CocoStudio/Action/CCActionManagerEx.cpp \ -CocoStudio/Action/CCActionNode.cpp \ -CocoStudio/Action/CCActionObject.cpp \ -CocoStudio/Armature/CCArmature.cpp \ -CocoStudio/Armature/CCBone.cpp \ -CocoStudio/Armature/animation/CCArmatureAnimation.cpp \ -CocoStudio/Armature/animation/CCProcessBase.cpp \ -CocoStudio/Armature/animation/CCTween.cpp \ -CocoStudio/Armature/datas/CCDatas.cpp \ -CocoStudio/Armature/display/CCBatchNode.cpp \ -CocoStudio/Armature/display/CCDecorativeDisplay.cpp \ -CocoStudio/Armature/display/CCDisplayFactory.cpp \ -CocoStudio/Armature/display/CCDisplayManager.cpp \ -CocoStudio/Armature/display/CCSkin.cpp \ -CocoStudio/Armature/physics/CCColliderDetector.cpp \ -CocoStudio/Armature/utils/CCArmatureDataManager.cpp \ -CocoStudio/Armature/utils/CCArmatureDefine.cpp \ -CocoStudio/Armature/utils/CCDataReaderHelper.cpp \ -CocoStudio/Armature/utils/CCSpriteFrameCacheHelper.cpp \ -CocoStudio/Armature/utils/CCTransformHelp.cpp \ -CocoStudio/Armature/utils/CCTweenFunction.cpp \ -CocoStudio/Armature/utils/CCUtilMath.cpp \ -CocoStudio/Components/CCComAttribute.cpp \ -CocoStudio/Components/CCComAudio.cpp \ -CocoStudio/Components/CCComController.cpp \ -CocoStudio/Components/CCComRender.cpp \ -CocoStudio/Components/CCInputDelegate.cpp \ -CocoStudio/GUI/BaseClasses/UIRootWidget.cpp \ -CocoStudio/GUI/BaseClasses/UIWidget.cpp \ -CocoStudio/GUI/Layouts/Layout.cpp \ -CocoStudio/GUI/Layouts/LayoutParameter.cpp \ -CocoStudio/GUI/Layouts/UILayoutDefine.cpp \ -CocoStudio/GUI/System/CocosGUI.cpp \ -CocoStudio/GUI/System/UIHelper.cpp \ -CocoStudio/GUI/System/UIInputManager.cpp \ -CocoStudio/GUI/System/UILayer.cpp \ -CocoStudio/GUI/UIWidgets/UIButton.cpp \ -CocoStudio/GUI/UIWidgets/UICheckBox.cpp \ -CocoStudio/GUI/UIWidgets/UIImageView.cpp \ -CocoStudio/GUI/UIWidgets/UILabel.cpp \ -CocoStudio/GUI/UIWidgets/UILabelAtlas.cpp \ -CocoStudio/GUI/UIWidgets/UILabelBMFont.cpp \ -CocoStudio/GUI/UIWidgets/UILoadingBar.cpp \ -CocoStudio/GUI/UIWidgets/UISlider.cpp \ -CocoStudio/GUI/UIWidgets/UITextField.cpp \ -CocoStudio/GUI/UIWidgets/ScrollWidget/UIDragPanel.cpp \ -CocoStudio/GUI/UIWidgets/ScrollWidget/UIListView.cpp \ -CocoStudio/GUI/UIWidgets/ScrollWidget/UIPageView.cpp \ -CocoStudio/GUI/UIWidgets/ScrollWidget/UIScrollView.cpp \ -CocoStudio/Json/CSContentJsonDictionary.cpp \ -CocoStudio/Json/DictionaryHelper.cpp \ -CocoStudio/Json/lib_json/json_reader.cpp \ -CocoStudio/Json/lib_json/json_value.cpp \ -CocoStudio/Json/lib_json/json_writer.cpp \ -CocoStudio/Reader/CCSGUIReader.cpp \ -CocoStudio/Reader/CCSSceneReader.cpp \ -GUI/CCControlExtension/CCControl.cpp \ -GUI/CCControlExtension/CCControlButton.cpp \ -GUI/CCControlExtension/CCControlColourPicker.cpp \ -GUI/CCControlExtension/CCControlHuePicker.cpp \ -GUI/CCControlExtension/CCControlPotentiometer.cpp \ -GUI/CCControlExtension/CCControlSaturationBrightnessPicker.cpp \ -GUI/CCControlExtension/CCControlSlider.cpp \ -GUI/CCControlExtension/CCControlStepper.cpp \ -GUI/CCControlExtension/CCControlSwitch.cpp \ -GUI/CCControlExtension/CCControlUtils.cpp \ -GUI/CCControlExtension/CCInvocation.cpp \ -GUI/CCControlExtension/CCScale9Sprite.cpp \ -GUI/CCEditBox/CCEditBox.cpp \ -GUI/CCEditBox/CCEditBoxImplAndroid.cpp \ -GUI/CCEditBox/CCEditBoxImplNone.cpp \ -GUI/CCEditBox/CCEditBoxImplTizen.cpp \ -GUI/CCEditBox/CCEditBoxImplWin.cpp \ -GUI/CCScrollView/CCScrollView.cpp \ -GUI/CCScrollView/CCSorting.cpp \ -GUI/CCScrollView/CCTableView.cpp \ -GUI/CCScrollView/CCTableViewCell.cpp \ -LocalStorage/LocalStorage.cpp \ -LocalStorage/LocalStorageAndroid.cpp \ -network/HttpClient.cpp \ -network/SocketIO.cpp \ -network/WebSocket.cpp \ -physics_nodes/CCPhysicsDebugNode.cpp \ -physics_nodes/CCPhysicsSprite.cpp \ -spine/Animation.cpp \ -spine/AnimationState.cpp \ -spine/AnimationStateData.cpp \ -spine/Atlas.cpp \ -spine/AtlasAttachmentLoader.cpp \ -spine/Attachment.cpp \ -spine/AttachmentLoader.cpp \ -spine/Bone.cpp \ -spine/BoneData.cpp \ -spine/CCSkeleton.cpp \ -spine/CCSkeletonAnimation.cpp \ -spine/extension.cpp \ -spine/Json.cpp \ -spine/RegionAttachment.cpp \ -spine/Skeleton.cpp \ -spine/SkeletonData.cpp \ -spine/SkeletonJson.cpp \ -spine/Skin.cpp \ -spine/Slot.cpp \ -spine/SlotData.cpp \ -spine/spine-cocos2dx.cpp +$(LOCAL_PATH)/CCDeprecated-ext.cpp \ +$(LOCAL_PATH)/assets-manager/AssetsManager.cpp \ +$(LOCAL_PATH)/GUI/CCControlExtension/CCControl.cpp \ +$(LOCAL_PATH)/GUI/CCControlExtension/CCControlButton.cpp \ +$(LOCAL_PATH)/GUI/CCControlExtension/CCControlColourPicker.cpp \ +$(LOCAL_PATH)/GUI/CCControlExtension/CCControlHuePicker.cpp \ +$(LOCAL_PATH)/GUI/CCControlExtension/CCControlPotentiometer.cpp \ +$(LOCAL_PATH)/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.cpp \ +$(LOCAL_PATH)/GUI/CCControlExtension/CCControlSlider.cpp \ +$(LOCAL_PATH)/GUI/CCControlExtension/CCControlStepper.cpp \ +$(LOCAL_PATH)/GUI/CCControlExtension/CCControlSwitch.cpp \ +$(LOCAL_PATH)/GUI/CCControlExtension/CCControlUtils.cpp \ +$(LOCAL_PATH)/GUI/CCControlExtension/CCInvocation.cpp \ +$(LOCAL_PATH)/GUI/CCControlExtension/CCScale9Sprite.cpp \ +$(LOCAL_PATH)/GUI/CCEditBox/CCEditBox.cpp \ +$(LOCAL_PATH)/GUI/CCEditBox/CCEditBoxImplAndroid.cpp \ +$(LOCAL_PATH)/GUI/CCEditBox/CCEditBoxImplNone.cpp \ +$(LOCAL_PATH)/GUI/CCEditBox/CCEditBoxImplTizen.cpp \ +$(LOCAL_PATH)/GUI/CCEditBox/CCEditBoxImplWin.cpp \ +$(LOCAL_PATH)/GUI/CCScrollView/CCScrollView.cpp \ +$(LOCAL_PATH)/GUI/CCScrollView/CCSorting.cpp \ +$(LOCAL_PATH)/GUI/CCScrollView/CCTableView.cpp \ +$(LOCAL_PATH)/GUI/CCScrollView/CCTableViewCell.cpp \ +$(LOCAL_PATH)/physics-nodes/CCPhysicsDebugNode.cpp \ +$(LOCAL_PATH)/physics-nodes/CCPhysicsSprite.cpp LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_static diff --git a/external/Box2D/Android.mk b/external/Box2D/Android.mk index c366750c01..5172a998e7 100644 --- a/external/Box2D/Android.mk +++ b/external/Box2D/Android.mk @@ -7,51 +7,51 @@ LOCAL_MODULE := box2d_static LOCAL_MODULE_FILENAME := libbox2d LOCAL_SRC_FILES := \ -Collision/b2BroadPhase.cpp \ -Collision/b2CollideCircle.cpp \ -Collision/b2CollideEdge.cpp \ -Collision/b2CollidePolygon.cpp \ -Collision/b2Collision.cpp \ -Collision/b2Distance.cpp \ -Collision/b2DynamicTree.cpp \ -Collision/b2TimeOfImpact.cpp \ -Collision/Shapes/b2ChainShape.cpp \ -Collision/Shapes/b2CircleShape.cpp \ -Collision/Shapes/b2EdgeShape.cpp \ -Collision/Shapes/b2PolygonShape.cpp \ -Common/b2BlockAllocator.cpp \ -Common/b2Draw.cpp \ -Common/b2Math.cpp \ -Common/b2Settings.cpp \ -Common/b2StackAllocator.cpp \ -Common/b2Timer.cpp \ -Dynamics/b2Body.cpp \ -Dynamics/b2ContactManager.cpp \ -Dynamics/b2Fixture.cpp \ -Dynamics/b2Island.cpp \ -Dynamics/b2World.cpp \ -Dynamics/b2WorldCallbacks.cpp \ -Dynamics/Contacts/b2ChainAndCircleContact.cpp \ -Dynamics/Contacts/b2ChainAndPolygonContact.cpp \ -Dynamics/Contacts/b2CircleContact.cpp \ -Dynamics/Contacts/b2Contact.cpp \ -Dynamics/Contacts/b2ContactSolver.cpp \ -Dynamics/Contacts/b2EdgeAndCircleContact.cpp \ -Dynamics/Contacts/b2EdgeAndPolygonContact.cpp \ -Dynamics/Contacts/b2PolygonAndCircleContact.cpp \ -Dynamics/Contacts/b2PolygonContact.cpp \ -Dynamics/Joints/b2DistanceJoint.cpp \ -Dynamics/Joints/b2FrictionJoint.cpp \ -Dynamics/Joints/b2GearJoint.cpp \ -Dynamics/Joints/b2Joint.cpp \ -Dynamics/Joints/b2MouseJoint.cpp \ -Dynamics/Joints/b2PrismaticJoint.cpp \ -Dynamics/Joints/b2PulleyJoint.cpp \ -Dynamics/Joints/b2RevoluteJoint.cpp \ -Dynamics/Joints/b2RopeJoint.cpp \ -Dynamics/Joints/b2WeldJoint.cpp \ -Dynamics/Joints/b2WheelJoint.cpp \ -Rope/b2Rope.cpp +$(LOCAL_PATH)/Collision/b2BroadPhase.cpp \ +$(LOCAL_PATH)/Collision/b2CollideCircle.cpp \ +$(LOCAL_PATH)/Collision/b2CollideEdge.cpp \ +$(LOCAL_PATH)/Collision/b2CollidePolygon.cpp \ +$(LOCAL_PATH)/Collision/b2Collision.cpp \ +$(LOCAL_PATH)/Collision/b2Distance.cpp \ +$(LOCAL_PATH)/Collision/b2DynamicTree.cpp \ +$(LOCAL_PATH)/Collision/b2TimeOfImpact.cpp \ +$(LOCAL_PATH)/Collision/Shapes/b2ChainShape.cpp \ +$(LOCAL_PATH)/Collision/Shapes/b2CircleShape.cpp \ +$(LOCAL_PATH)/Collision/Shapes/b2EdgeShape.cpp \ +$(LOCAL_PATH)/Collision/Shapes/b2PolygonShape.cpp \ +$(LOCAL_PATH)/Common/b2BlockAllocator.cpp \ +$(LOCAL_PATH)/Common/b2Draw.cpp \ +$(LOCAL_PATH)/Common/b2Math.cpp \ +$(LOCAL_PATH)/Common/b2Settings.cpp \ +$(LOCAL_PATH)/Common/b2StackAllocator.cpp \ +$(LOCAL_PATH)/Common/b2Timer.cpp \ +$(LOCAL_PATH)/Dynamics/b2Body.cpp \ +$(LOCAL_PATH)/Dynamics/b2ContactManager.cpp \ +$(LOCAL_PATH)/Dynamics/b2Fixture.cpp \ +$(LOCAL_PATH)/Dynamics/b2Island.cpp \ +$(LOCAL_PATH)/Dynamics/b2World.cpp \ +$(LOCAL_PATH)/Dynamics/b2WorldCallbacks.cpp \ +$(LOCAL_PATH)/Dynamics/Contacts/b2ChainAndCircleContact.cpp \ +$(LOCAL_PATH)/Dynamics/Contacts/b2ChainAndPolygonContact.cpp \ +$(LOCAL_PATH)/Dynamics/Contacts/b2CircleContact.cpp \ +$(LOCAL_PATH)/Dynamics/Contacts/b2Contact.cpp \ +$(LOCAL_PATH)/Dynamics/Contacts/b2ContactSolver.cpp \ +$(LOCAL_PATH)/Dynamics/Contacts/b2EdgeAndCircleContact.cpp \ +$(LOCAL_PATH)/Dynamics/Contacts/b2EdgeAndPolygonContact.cpp \ +$(LOCAL_PATH)/Dynamics/Contacts/b2PolygonAndCircleContact.cpp \ +$(LOCAL_PATH)/Dynamics/Contacts/b2PolygonContact.cpp \ +$(LOCAL_PATH)/Dynamics/Joints/b2DistanceJoint.cpp \ +$(LOCAL_PATH)/Dynamics/Joints/b2FrictionJoint.cpp \ +$(LOCAL_PATH)/Dynamics/Joints/b2GearJoint.cpp \ +$(LOCAL_PATH)/Dynamics/Joints/b2Joint.cpp \ +$(LOCAL_PATH)/Dynamics/Joints/b2MouseJoint.cpp \ +$(LOCAL_PATH)/Dynamics/Joints/b2PrismaticJoint.cpp \ +$(LOCAL_PATH)/Dynamics/Joints/b2PulleyJoint.cpp \ +$(LOCAL_PATH)/Dynamics/Joints/b2RevoluteJoint.cpp \ +$(LOCAL_PATH)/Dynamics/Joints/b2RopeJoint.cpp \ +$(LOCAL_PATH)/Dynamics/Joints/b2WeldJoint.cpp \ +$(LOCAL_PATH)/Dynamics/Joints/b2WheelJoint.cpp \ +$(LOCAL_PATH)/Rope/b2Rope.cpp LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/.. diff --git a/external/chipmunk/Android.mk b/external/chipmunk/Android.mk index e8441cd0d7..e8013df8c3 100644 --- a/external/chipmunk/Android.mk +++ b/external/chipmunk/Android.mk @@ -7,35 +7,35 @@ LOCAL_MODULE := chipmunk_static LOCAL_MODULE_FILENAME := libchipmunk LOCAL_SRC_FILES := \ -src/chipmunk.c \ -src/cpArbiter.c \ -src/cpArray.c \ -src/cpBB.c \ -src/cpBBTree.c \ -src/cpBody.c \ -src/cpCollision.c \ -src/cpHashSet.c \ -src/cpPolyShape.c \ -src/cpShape.c \ -src/cpSpace.c \ -src/cpSpaceComponent.c \ -src/cpSpaceHash.c \ -src/cpSpaceQuery.c \ -src/cpSpaceStep.c \ -src/cpSpatialIndex.c \ -src/cpSweep1D.c \ -src/cpVect.c \ -src/constraints/cpConstraint.c \ -src/constraints/cpDampedRotarySpring.c \ -src/constraints/cpDampedSpring.c \ -src/constraints/cpGearJoint.c \ -src/constraints/cpGrooveJoint.c \ -src/constraints/cpPinJoint.c \ -src/constraints/cpPivotJoint.c \ -src/constraints/cpRatchetJoint.c \ -src/constraints/cpRotaryLimitJoint.c \ -src/constraints/cpSimpleMotor.c \ -src/constraints/cpSlideJoint.c +$(LOCAL_PATH)/src/chipmunk.c \ +$(LOCAL_PATH)/src/cpArbiter.c \ +$(LOCAL_PATH)/src/cpArray.c \ +$(LOCAL_PATH)/src/cpBB.c \ +$(LOCAL_PATH)/src/cpBBTree.c \ +$(LOCAL_PATH)/src/cpBody.c \ +$(LOCAL_PATH)/src/cpCollision.c \ +$(LOCAL_PATH)/src/cpHashSet.c \ +$(LOCAL_PATH)/src/cpPolyShape.c \ +$(LOCAL_PATH)/src/cpShape.c \ +$(LOCAL_PATH)/src/cpSpace.c \ +$(LOCAL_PATH)/src/cpSpaceComponent.c \ +$(LOCAL_PATH)/src/cpSpaceHash.c \ +$(LOCAL_PATH)/src/cpSpaceQuery.c \ +$(LOCAL_PATH)/src/cpSpaceStep.c \ +$(LOCAL_PATH)/src/cpSpatialIndex.c \ +$(LOCAL_PATH)/src/cpSweep1D.c \ +$(LOCAL_PATH)/src/cpVect.c \ +$(LOCAL_PATH)/src/constraints/cpConstraint.c \ +$(LOCAL_PATH)/src/constraints/cpDampedRotarySpring.c \ +$(LOCAL_PATH)/src/constraints/cpDampedSpring.c \ +$(LOCAL_PATH)/src/constraints/cpGearJoint.c \ +$(LOCAL_PATH)/src/constraints/cpGrooveJoint.c \ +$(LOCAL_PATH)/src/constraints/cpPinJoint.c \ +$(LOCAL_PATH)/src/constraints/cpPivotJoint.c \ +$(LOCAL_PATH)/src/constraints/cpRatchetJoint.c \ +$(LOCAL_PATH)/src/constraints/cpRotaryLimitJoint.c \ +$(LOCAL_PATH)/src/constraints/cpSimpleMotor.c \ +$(LOCAL_PATH)/src/constraints/cpSlideJoint.c LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include/chipmunk diff --git a/external/curl/include/andorid/curl.h b/external/curl/include/android/curl.h similarity index 100% rename from external/curl/include/andorid/curl.h rename to external/curl/include/android/curl.h diff --git a/external/curl/include/andorid/curlbuild.h b/external/curl/include/android/curlbuild.h similarity index 100% rename from external/curl/include/andorid/curlbuild.h rename to external/curl/include/android/curlbuild.h diff --git a/external/curl/include/andorid/curlrules.h b/external/curl/include/android/curlrules.h similarity index 100% rename from external/curl/include/andorid/curlrules.h rename to external/curl/include/android/curlrules.h diff --git a/external/curl/include/andorid/curlver.h b/external/curl/include/android/curlver.h similarity index 100% rename from external/curl/include/andorid/curlver.h rename to external/curl/include/android/curlver.h diff --git a/external/curl/include/andorid/easy.h b/external/curl/include/android/easy.h similarity index 100% rename from external/curl/include/andorid/easy.h rename to external/curl/include/android/easy.h diff --git a/external/curl/include/andorid/mprintf.h b/external/curl/include/android/mprintf.h similarity index 100% rename from external/curl/include/andorid/mprintf.h rename to external/curl/include/android/mprintf.h diff --git a/external/curl/include/andorid/multi.h b/external/curl/include/android/multi.h similarity index 100% rename from external/curl/include/andorid/multi.h rename to external/curl/include/android/multi.h diff --git a/external/curl/include/andorid/stdcheaders.h b/external/curl/include/android/stdcheaders.h similarity index 100% rename from external/curl/include/andorid/stdcheaders.h rename to external/curl/include/android/stdcheaders.h diff --git a/external/curl/include/andorid/typecheck-gcc.h b/external/curl/include/android/typecheck-gcc.h similarity index 100% rename from external/curl/include/andorid/typecheck-gcc.h rename to external/curl/include/android/typecheck-gcc.h diff --git a/external/curl/include/andorid/types.h b/external/curl/include/android/types.h similarity index 100% rename from external/curl/include/andorid/types.h rename to external/curl/include/android/types.h diff --git a/external/curl/prebuilt/andorid/Android.mk b/external/curl/prebuilt/android/Android.mk similarity index 57% rename from external/curl/prebuilt/andorid/Android.mk rename to external/curl/prebuilt/android/Android.mk index 8d0c18d79f..daa087ec8e 100644 --- a/external/curl/prebuilt/andorid/Android.mk +++ b/external/curl/prebuilt/android/Android.mk @@ -3,6 +3,6 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := cocos_curl_static LOCAL_MODULE_FILENAME := curl -LOCAL_SRC_FILES := libs/$(TARGET_ARCH_ABI)/libcurl.a -LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include +LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libcurl.a +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../include/android include $(PREBUILT_STATIC_LIBRARY) diff --git a/external/curl/prebuilt/andorid/armeabi-v7a/libcurl.a.REMOVED.git-id b/external/curl/prebuilt/android/armeabi-v7a/libcurl.a.REMOVED.git-id similarity index 100% rename from external/curl/prebuilt/andorid/armeabi-v7a/libcurl.a.REMOVED.git-id rename to external/curl/prebuilt/android/armeabi-v7a/libcurl.a.REMOVED.git-id diff --git a/external/curl/prebuilt/andorid/armeabi/libcurl.a.REMOVED.git-id b/external/curl/prebuilt/android/armeabi/libcurl.a.REMOVED.git-id similarity index 100% rename from external/curl/prebuilt/andorid/armeabi/libcurl.a.REMOVED.git-id rename to external/curl/prebuilt/android/armeabi/libcurl.a.REMOVED.git-id diff --git a/external/curl/prebuilt/andorid/x86/libcurl.a.REMOVED.git-id b/external/curl/prebuilt/android/x86/libcurl.a.REMOVED.git-id similarity index 100% rename from external/curl/prebuilt/andorid/x86/libcurl.a.REMOVED.git-id rename to external/curl/prebuilt/android/x86/libcurl.a.REMOVED.git-id diff --git a/external/freetype2/include/andorid/freetype2/freetype/config/ftconfig.h b/external/freetype2/include/android/freetype2/freetype/config/ftconfig.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/config/ftconfig.h rename to external/freetype2/include/android/freetype2/freetype/config/ftconfig.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/config/ftheader.h b/external/freetype2/include/android/freetype2/freetype/config/ftheader.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/config/ftheader.h rename to external/freetype2/include/android/freetype2/freetype/config/ftheader.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/config/ftmodule.h b/external/freetype2/include/android/freetype2/freetype/config/ftmodule.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/config/ftmodule.h rename to external/freetype2/include/android/freetype2/freetype/config/ftmodule.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/config/ftoption.h b/external/freetype2/include/android/freetype2/freetype/config/ftoption.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/config/ftoption.h rename to external/freetype2/include/android/freetype2/freetype/config/ftoption.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/config/ftstdlib.h b/external/freetype2/include/android/freetype2/freetype/config/ftstdlib.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/config/ftstdlib.h rename to external/freetype2/include/android/freetype2/freetype/config/ftstdlib.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/freetype.h.REMOVED.git-id b/external/freetype2/include/android/freetype2/freetype/freetype.h.REMOVED.git-id similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/freetype.h.REMOVED.git-id rename to external/freetype2/include/android/freetype2/freetype/freetype.h.REMOVED.git-id diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftadvanc.h b/external/freetype2/include/android/freetype2/freetype/ftadvanc.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftadvanc.h rename to external/freetype2/include/android/freetype2/freetype/ftadvanc.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftautoh.h b/external/freetype2/include/android/freetype2/freetype/ftautoh.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftautoh.h rename to external/freetype2/include/android/freetype2/freetype/ftautoh.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftbbox.h b/external/freetype2/include/android/freetype2/freetype/ftbbox.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftbbox.h rename to external/freetype2/include/android/freetype2/freetype/ftbbox.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftbdf.h b/external/freetype2/include/android/freetype2/freetype/ftbdf.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftbdf.h rename to external/freetype2/include/android/freetype2/freetype/ftbdf.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftbitmap.h b/external/freetype2/include/android/freetype2/freetype/ftbitmap.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftbitmap.h rename to external/freetype2/include/android/freetype2/freetype/ftbitmap.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftbzip2.h b/external/freetype2/include/android/freetype2/freetype/ftbzip2.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftbzip2.h rename to external/freetype2/include/android/freetype2/freetype/ftbzip2.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftcache.h b/external/freetype2/include/android/freetype2/freetype/ftcache.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftcache.h rename to external/freetype2/include/android/freetype2/freetype/ftcache.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftcffdrv.h b/external/freetype2/include/android/freetype2/freetype/ftcffdrv.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftcffdrv.h rename to external/freetype2/include/android/freetype2/freetype/ftcffdrv.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftchapters.h b/external/freetype2/include/android/freetype2/freetype/ftchapters.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftchapters.h rename to external/freetype2/include/android/freetype2/freetype/ftchapters.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftcid.h b/external/freetype2/include/android/freetype2/freetype/ftcid.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftcid.h rename to external/freetype2/include/android/freetype2/freetype/ftcid.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/fterrdef.h b/external/freetype2/include/android/freetype2/freetype/fterrdef.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/fterrdef.h rename to external/freetype2/include/android/freetype2/freetype/fterrdef.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/fterrors.h b/external/freetype2/include/android/freetype2/freetype/fterrors.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/fterrors.h rename to external/freetype2/include/android/freetype2/freetype/fterrors.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftgasp.h b/external/freetype2/include/android/freetype2/freetype/ftgasp.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftgasp.h rename to external/freetype2/include/android/freetype2/freetype/ftgasp.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftglyph.h b/external/freetype2/include/android/freetype2/freetype/ftglyph.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftglyph.h rename to external/freetype2/include/android/freetype2/freetype/ftglyph.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftgxval.h b/external/freetype2/include/android/freetype2/freetype/ftgxval.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftgxval.h rename to external/freetype2/include/android/freetype2/freetype/ftgxval.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftgzip.h b/external/freetype2/include/android/freetype2/freetype/ftgzip.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftgzip.h rename to external/freetype2/include/android/freetype2/freetype/ftgzip.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftimage.h b/external/freetype2/include/android/freetype2/freetype/ftimage.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftimage.h rename to external/freetype2/include/android/freetype2/freetype/ftimage.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftincrem.h b/external/freetype2/include/android/freetype2/freetype/ftincrem.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftincrem.h rename to external/freetype2/include/android/freetype2/freetype/ftincrem.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftlcdfil.h b/external/freetype2/include/android/freetype2/freetype/ftlcdfil.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftlcdfil.h rename to external/freetype2/include/android/freetype2/freetype/ftlcdfil.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftlist.h b/external/freetype2/include/android/freetype2/freetype/ftlist.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftlist.h rename to external/freetype2/include/android/freetype2/freetype/ftlist.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftlzw.h b/external/freetype2/include/android/freetype2/freetype/ftlzw.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftlzw.h rename to external/freetype2/include/android/freetype2/freetype/ftlzw.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftmac.h b/external/freetype2/include/android/freetype2/freetype/ftmac.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftmac.h rename to external/freetype2/include/android/freetype2/freetype/ftmac.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftmm.h b/external/freetype2/include/android/freetype2/freetype/ftmm.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftmm.h rename to external/freetype2/include/android/freetype2/freetype/ftmm.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftmodapi.h b/external/freetype2/include/android/freetype2/freetype/ftmodapi.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftmodapi.h rename to external/freetype2/include/android/freetype2/freetype/ftmodapi.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftmoderr.h b/external/freetype2/include/android/freetype2/freetype/ftmoderr.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftmoderr.h rename to external/freetype2/include/android/freetype2/freetype/ftmoderr.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftotval.h b/external/freetype2/include/android/freetype2/freetype/ftotval.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftotval.h rename to external/freetype2/include/android/freetype2/freetype/ftotval.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftoutln.h b/external/freetype2/include/android/freetype2/freetype/ftoutln.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftoutln.h rename to external/freetype2/include/android/freetype2/freetype/ftoutln.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftpfr.h b/external/freetype2/include/android/freetype2/freetype/ftpfr.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftpfr.h rename to external/freetype2/include/android/freetype2/freetype/ftpfr.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftrender.h b/external/freetype2/include/android/freetype2/freetype/ftrender.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftrender.h rename to external/freetype2/include/android/freetype2/freetype/ftrender.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftsizes.h b/external/freetype2/include/android/freetype2/freetype/ftsizes.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftsizes.h rename to external/freetype2/include/android/freetype2/freetype/ftsizes.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftsnames.h b/external/freetype2/include/android/freetype2/freetype/ftsnames.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftsnames.h rename to external/freetype2/include/android/freetype2/freetype/ftsnames.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftstroke.h b/external/freetype2/include/android/freetype2/freetype/ftstroke.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftstroke.h rename to external/freetype2/include/android/freetype2/freetype/ftstroke.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftsynth.h b/external/freetype2/include/android/freetype2/freetype/ftsynth.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftsynth.h rename to external/freetype2/include/android/freetype2/freetype/ftsynth.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftsystem.h b/external/freetype2/include/android/freetype2/freetype/ftsystem.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftsystem.h rename to external/freetype2/include/android/freetype2/freetype/ftsystem.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/fttrigon.h b/external/freetype2/include/android/freetype2/freetype/fttrigon.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/fttrigon.h rename to external/freetype2/include/android/freetype2/freetype/fttrigon.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftttdrv.h b/external/freetype2/include/android/freetype2/freetype/ftttdrv.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftttdrv.h rename to external/freetype2/include/android/freetype2/freetype/ftttdrv.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/fttypes.h b/external/freetype2/include/android/freetype2/freetype/fttypes.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/fttypes.h rename to external/freetype2/include/android/freetype2/freetype/fttypes.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftwinfnt.h b/external/freetype2/include/android/freetype2/freetype/ftwinfnt.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftwinfnt.h rename to external/freetype2/include/android/freetype2/freetype/ftwinfnt.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftxf86.h b/external/freetype2/include/android/freetype2/freetype/ftxf86.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftxf86.h rename to external/freetype2/include/android/freetype2/freetype/ftxf86.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/t1tables.h b/external/freetype2/include/android/freetype2/freetype/t1tables.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/t1tables.h rename to external/freetype2/include/android/freetype2/freetype/t1tables.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ttnameid.h b/external/freetype2/include/android/freetype2/freetype/ttnameid.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ttnameid.h rename to external/freetype2/include/android/freetype2/freetype/ttnameid.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/tttables.h b/external/freetype2/include/android/freetype2/freetype/tttables.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/tttables.h rename to external/freetype2/include/android/freetype2/freetype/tttables.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/tttags.h b/external/freetype2/include/android/freetype2/freetype/tttags.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/tttags.h rename to external/freetype2/include/android/freetype2/freetype/tttags.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ttunpat.h b/external/freetype2/include/android/freetype2/freetype/ttunpat.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ttunpat.h rename to external/freetype2/include/android/freetype2/freetype/ttunpat.h diff --git a/external/freetype2/include/andorid/ft2build.h b/external/freetype2/include/android/ft2build.h similarity index 100% rename from external/freetype2/include/andorid/ft2build.h rename to external/freetype2/include/android/ft2build.h diff --git a/external/freetype2/prebuilt/andorid/Android.mk b/external/freetype2/prebuilt/android/Android.mk similarity index 50% rename from external/freetype2/prebuilt/andorid/Android.mk rename to external/freetype2/prebuilt/android/Android.mk index 3a4dee0520..958d27f3a0 100644 --- a/external/freetype2/prebuilt/andorid/Android.mk +++ b/external/freetype2/prebuilt/android/Android.mk @@ -3,6 +3,6 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := cocos_freetype2_static LOCAL_MODULE_FILENAME := freetype2 -LOCAL_SRC_FILES := libs/$(TARGET_ARCH_ABI)/libfreetype.a -LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include $(LOCAL_PATH)/include/freetype2 +LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libfreetype.a +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../include/android $(LOCAL_PATH)/../../include/android/freetype2 include $(PREBUILT_STATIC_LIBRARY) diff --git a/external/freetype2/prebuilt/andorid/armeabi-v7a/libfreetype.a.REMOVED.git-id b/external/freetype2/prebuilt/android/armeabi-v7a/libfreetype.a.REMOVED.git-id similarity index 100% rename from external/freetype2/prebuilt/andorid/armeabi-v7a/libfreetype.a.REMOVED.git-id rename to external/freetype2/prebuilt/android/armeabi-v7a/libfreetype.a.REMOVED.git-id diff --git a/external/freetype2/prebuilt/andorid/armeabi/libfreetype.a.REMOVED.git-id b/external/freetype2/prebuilt/android/armeabi/libfreetype.a.REMOVED.git-id similarity index 100% rename from external/freetype2/prebuilt/andorid/armeabi/libfreetype.a.REMOVED.git-id rename to external/freetype2/prebuilt/android/armeabi/libfreetype.a.REMOVED.git-id diff --git a/external/freetype2/prebuilt/andorid/x86/libfreetype.a.REMOVED.git-id b/external/freetype2/prebuilt/android/x86/libfreetype.a.REMOVED.git-id similarity index 100% rename from external/freetype2/prebuilt/andorid/x86/libfreetype.a.REMOVED.git-id rename to external/freetype2/prebuilt/android/x86/libfreetype.a.REMOVED.git-id diff --git a/external/jpeg/include/andorid/jconfig.h b/external/jpeg/include/android/jconfig.h similarity index 100% rename from external/jpeg/include/andorid/jconfig.h rename to external/jpeg/include/android/jconfig.h diff --git a/external/jpeg/include/andorid/jerror.h b/external/jpeg/include/android/jerror.h similarity index 100% rename from external/jpeg/include/andorid/jerror.h rename to external/jpeg/include/android/jerror.h diff --git a/external/jpeg/include/andorid/jmorecfg.h b/external/jpeg/include/android/jmorecfg.h similarity index 100% rename from external/jpeg/include/andorid/jmorecfg.h rename to external/jpeg/include/android/jmorecfg.h diff --git a/external/jpeg/include/andorid/jpeglib.h b/external/jpeg/include/android/jpeglib.h similarity index 100% rename from external/jpeg/include/andorid/jpeglib.h rename to external/jpeg/include/android/jpeglib.h diff --git a/external/jpeg/prebuilt/andorid/Android.mk b/external/jpeg/prebuilt/android/Android.mk similarity index 57% rename from external/jpeg/prebuilt/andorid/Android.mk rename to external/jpeg/prebuilt/android/Android.mk index b8786d07df..74af61ea2a 100644 --- a/external/jpeg/prebuilt/andorid/Android.mk +++ b/external/jpeg/prebuilt/android/Android.mk @@ -3,6 +3,6 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := cocos_jpeg_static LOCAL_MODULE_FILENAME := jpeg -LOCAL_SRC_FILES := libs/$(TARGET_ARCH_ABI)/libjpeg.a -LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include +LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libjpeg.a +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../include/android include $(PREBUILT_STATIC_LIBRARY) diff --git a/external/jpeg/prebuilt/andorid/armeabi-v7a/libjpeg.a.REMOVED.git-id b/external/jpeg/prebuilt/android/armeabi-v7a/libjpeg.a.REMOVED.git-id similarity index 100% rename from external/jpeg/prebuilt/andorid/armeabi-v7a/libjpeg.a.REMOVED.git-id rename to external/jpeg/prebuilt/android/armeabi-v7a/libjpeg.a.REMOVED.git-id diff --git a/external/jpeg/prebuilt/andorid/armeabi/libjpeg.a.REMOVED.git-id b/external/jpeg/prebuilt/android/armeabi/libjpeg.a.REMOVED.git-id similarity index 100% rename from external/jpeg/prebuilt/andorid/armeabi/libjpeg.a.REMOVED.git-id rename to external/jpeg/prebuilt/android/armeabi/libjpeg.a.REMOVED.git-id diff --git a/external/jpeg/prebuilt/andorid/x86/libjpeg.a.REMOVED.git-id b/external/jpeg/prebuilt/android/x86/libjpeg.a.REMOVED.git-id similarity index 100% rename from external/jpeg/prebuilt/andorid/x86/libjpeg.a.REMOVED.git-id rename to external/jpeg/prebuilt/android/x86/libjpeg.a.REMOVED.git-id diff --git a/external/png/include/andorid/png.h.REMOVED.git-id b/external/png/include/android/png.h.REMOVED.git-id similarity index 100% rename from external/png/include/andorid/png.h.REMOVED.git-id rename to external/png/include/android/png.h.REMOVED.git-id diff --git a/external/png/include/andorid/pngconf.h b/external/png/include/android/pngconf.h similarity index 100% rename from external/png/include/andorid/pngconf.h rename to external/png/include/android/pngconf.h diff --git a/external/png/include/andorid/pnglibconf.h b/external/png/include/android/pnglibconf.h similarity index 100% rename from external/png/include/andorid/pnglibconf.h rename to external/png/include/android/pnglibconf.h diff --git a/external/png/prebuilt/andorid/Android.mk b/external/png/prebuilt/android/Android.mk similarity index 58% rename from external/png/prebuilt/andorid/Android.mk rename to external/png/prebuilt/android/Android.mk index b15dc34b96..41a0f91322 100644 --- a/external/png/prebuilt/andorid/Android.mk +++ b/external/png/prebuilt/android/Android.mk @@ -3,6 +3,6 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := cocos_libpng_static LOCAL_MODULE_FILENAME := png -LOCAL_SRC_FILES := libs/$(TARGET_ARCH_ABI)/libpng.a -LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include +LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libpng.a +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../include/android include $(PREBUILT_STATIC_LIBRARY) diff --git a/external/png/prebuilt/andorid/armeabi-v7a/libpng.a.REMOVED.git-id b/external/png/prebuilt/android/armeabi-v7a/libpng.a.REMOVED.git-id similarity index 100% rename from external/png/prebuilt/andorid/armeabi-v7a/libpng.a.REMOVED.git-id rename to external/png/prebuilt/android/armeabi-v7a/libpng.a.REMOVED.git-id diff --git a/external/png/prebuilt/andorid/armeabi/libpng.a.REMOVED.git-id b/external/png/prebuilt/android/armeabi/libpng.a.REMOVED.git-id similarity index 100% rename from external/png/prebuilt/andorid/armeabi/libpng.a.REMOVED.git-id rename to external/png/prebuilt/android/armeabi/libpng.a.REMOVED.git-id diff --git a/external/png/prebuilt/andorid/x86/libpng.a.REMOVED.git-id b/external/png/prebuilt/android/x86/libpng.a.REMOVED.git-id similarity index 100% rename from external/png/prebuilt/andorid/x86/libpng.a.REMOVED.git-id rename to external/png/prebuilt/android/x86/libpng.a.REMOVED.git-id diff --git a/external/spidermonkey/include/andorid/js-config.h b/external/spidermonkey/include/android/js-config.h similarity index 100% rename from external/spidermonkey/include/andorid/js-config.h rename to external/spidermonkey/include/android/js-config.h diff --git a/external/spidermonkey/include/andorid/js.msg b/external/spidermonkey/include/android/js.msg similarity index 100% rename from external/spidermonkey/include/andorid/js.msg rename to external/spidermonkey/include/android/js.msg diff --git a/external/spidermonkey/include/andorid/js/Anchor.h b/external/spidermonkey/include/android/js/Anchor.h similarity index 100% rename from external/spidermonkey/include/andorid/js/Anchor.h rename to external/spidermonkey/include/android/js/Anchor.h diff --git a/external/spidermonkey/include/andorid/js/CallArgs.h b/external/spidermonkey/include/android/js/CallArgs.h similarity index 100% rename from external/spidermonkey/include/andorid/js/CallArgs.h rename to external/spidermonkey/include/android/js/CallArgs.h diff --git a/external/spidermonkey/include/andorid/js/CharacterEncoding.h b/external/spidermonkey/include/android/js/CharacterEncoding.h similarity index 100% rename from external/spidermonkey/include/andorid/js/CharacterEncoding.h rename to external/spidermonkey/include/android/js/CharacterEncoding.h diff --git a/external/spidermonkey/include/andorid/js/Date.h b/external/spidermonkey/include/android/js/Date.h similarity index 100% rename from external/spidermonkey/include/andorid/js/Date.h rename to external/spidermonkey/include/android/js/Date.h diff --git a/external/spidermonkey/include/andorid/js/GCAPI.h b/external/spidermonkey/include/android/js/GCAPI.h similarity index 100% rename from external/spidermonkey/include/andorid/js/GCAPI.h rename to external/spidermonkey/include/android/js/GCAPI.h diff --git a/external/spidermonkey/include/andorid/js/HashTable.h b/external/spidermonkey/include/android/js/HashTable.h similarity index 100% rename from external/spidermonkey/include/andorid/js/HashTable.h rename to external/spidermonkey/include/android/js/HashTable.h diff --git a/external/spidermonkey/include/andorid/js/HeapAPI.h b/external/spidermonkey/include/android/js/HeapAPI.h similarity index 100% rename from external/spidermonkey/include/andorid/js/HeapAPI.h rename to external/spidermonkey/include/android/js/HeapAPI.h diff --git a/external/spidermonkey/include/andorid/js/LegacyIntTypes.h b/external/spidermonkey/include/android/js/LegacyIntTypes.h similarity index 100% rename from external/spidermonkey/include/andorid/js/LegacyIntTypes.h rename to external/spidermonkey/include/android/js/LegacyIntTypes.h diff --git a/external/spidermonkey/include/andorid/js/MemoryMetrics.h b/external/spidermonkey/include/android/js/MemoryMetrics.h similarity index 100% rename from external/spidermonkey/include/andorid/js/MemoryMetrics.h rename to external/spidermonkey/include/android/js/MemoryMetrics.h diff --git a/external/spidermonkey/include/andorid/js/PropertyKey.h b/external/spidermonkey/include/android/js/PropertyKey.h similarity index 100% rename from external/spidermonkey/include/andorid/js/PropertyKey.h rename to external/spidermonkey/include/android/js/PropertyKey.h diff --git a/external/spidermonkey/include/andorid/js/RequiredDefines.h b/external/spidermonkey/include/android/js/RequiredDefines.h similarity index 100% rename from external/spidermonkey/include/andorid/js/RequiredDefines.h rename to external/spidermonkey/include/android/js/RequiredDefines.h diff --git a/external/spidermonkey/include/andorid/js/RootingAPI.h b/external/spidermonkey/include/android/js/RootingAPI.h similarity index 100% rename from external/spidermonkey/include/andorid/js/RootingAPI.h rename to external/spidermonkey/include/android/js/RootingAPI.h diff --git a/external/spidermonkey/include/andorid/js/TemplateLib.h b/external/spidermonkey/include/android/js/TemplateLib.h similarity index 100% rename from external/spidermonkey/include/andorid/js/TemplateLib.h rename to external/spidermonkey/include/android/js/TemplateLib.h diff --git a/external/spidermonkey/include/andorid/js/Utility.h b/external/spidermonkey/include/android/js/Utility.h similarity index 100% rename from external/spidermonkey/include/andorid/js/Utility.h rename to external/spidermonkey/include/android/js/Utility.h diff --git a/external/spidermonkey/include/andorid/js/Value.h b/external/spidermonkey/include/android/js/Value.h similarity index 100% rename from external/spidermonkey/include/andorid/js/Value.h rename to external/spidermonkey/include/android/js/Value.h diff --git a/external/spidermonkey/include/andorid/js/Vector.h b/external/spidermonkey/include/android/js/Vector.h similarity index 100% rename from external/spidermonkey/include/andorid/js/Vector.h rename to external/spidermonkey/include/android/js/Vector.h diff --git a/external/spidermonkey/include/andorid/jsalloc.h b/external/spidermonkey/include/android/jsalloc.h similarity index 100% rename from external/spidermonkey/include/andorid/jsalloc.h rename to external/spidermonkey/include/android/jsalloc.h diff --git a/external/spidermonkey/include/andorid/jsapi.h.REMOVED.git-id b/external/spidermonkey/include/android/jsapi.h.REMOVED.git-id similarity index 100% rename from external/spidermonkey/include/andorid/jsapi.h.REMOVED.git-id rename to external/spidermonkey/include/android/jsapi.h.REMOVED.git-id diff --git a/external/spidermonkey/include/andorid/jsclass.h b/external/spidermonkey/include/android/jsclass.h similarity index 100% rename from external/spidermonkey/include/andorid/jsclass.h rename to external/spidermonkey/include/android/jsclass.h diff --git a/external/spidermonkey/include/andorid/jsclist.h b/external/spidermonkey/include/android/jsclist.h similarity index 100% rename from external/spidermonkey/include/andorid/jsclist.h rename to external/spidermonkey/include/android/jsclist.h diff --git a/external/spidermonkey/include/andorid/jscpucfg.h b/external/spidermonkey/include/android/jscpucfg.h similarity index 100% rename from external/spidermonkey/include/andorid/jscpucfg.h rename to external/spidermonkey/include/android/jscpucfg.h diff --git a/external/spidermonkey/include/andorid/jsdbgapi.h b/external/spidermonkey/include/android/jsdbgapi.h similarity index 100% rename from external/spidermonkey/include/andorid/jsdbgapi.h rename to external/spidermonkey/include/android/jsdbgapi.h diff --git a/external/spidermonkey/include/andorid/jsdhash.h b/external/spidermonkey/include/android/jsdhash.h similarity index 100% rename from external/spidermonkey/include/andorid/jsdhash.h rename to external/spidermonkey/include/android/jsdhash.h diff --git a/external/spidermonkey/include/andorid/jsfriendapi.h b/external/spidermonkey/include/android/jsfriendapi.h similarity index 100% rename from external/spidermonkey/include/andorid/jsfriendapi.h rename to external/spidermonkey/include/android/jsfriendapi.h diff --git a/external/spidermonkey/include/andorid/jslock.h b/external/spidermonkey/include/android/jslock.h similarity index 100% rename from external/spidermonkey/include/andorid/jslock.h rename to external/spidermonkey/include/android/jslock.h diff --git a/external/spidermonkey/include/andorid/json.h b/external/spidermonkey/include/android/json.h similarity index 100% rename from external/spidermonkey/include/andorid/json.h rename to external/spidermonkey/include/android/json.h diff --git a/external/spidermonkey/include/andorid/jsperf.h b/external/spidermonkey/include/android/jsperf.h similarity index 100% rename from external/spidermonkey/include/andorid/jsperf.h rename to external/spidermonkey/include/android/jsperf.h diff --git a/external/spidermonkey/include/andorid/jsprf.h b/external/spidermonkey/include/android/jsprf.h similarity index 100% rename from external/spidermonkey/include/andorid/jsprf.h rename to external/spidermonkey/include/android/jsprf.h diff --git a/external/spidermonkey/include/andorid/jsprototypes.h b/external/spidermonkey/include/android/jsprototypes.h similarity index 100% rename from external/spidermonkey/include/andorid/jsprototypes.h rename to external/spidermonkey/include/android/jsprototypes.h diff --git a/external/spidermonkey/include/andorid/jsproxy.h b/external/spidermonkey/include/android/jsproxy.h similarity index 100% rename from external/spidermonkey/include/andorid/jsproxy.h rename to external/spidermonkey/include/android/jsproxy.h diff --git a/external/spidermonkey/include/andorid/jsprvtd.h b/external/spidermonkey/include/android/jsprvtd.h similarity index 100% rename from external/spidermonkey/include/andorid/jsprvtd.h rename to external/spidermonkey/include/android/jsprvtd.h diff --git a/external/spidermonkey/include/andorid/jspubtd.h b/external/spidermonkey/include/android/jspubtd.h similarity index 100% rename from external/spidermonkey/include/andorid/jspubtd.h rename to external/spidermonkey/include/android/jspubtd.h diff --git a/external/spidermonkey/include/andorid/jstypes.h b/external/spidermonkey/include/android/jstypes.h similarity index 100% rename from external/spidermonkey/include/andorid/jstypes.h rename to external/spidermonkey/include/android/jstypes.h diff --git a/external/spidermonkey/include/andorid/jsutil.h b/external/spidermonkey/include/android/jsutil.h similarity index 100% rename from external/spidermonkey/include/andorid/jsutil.h rename to external/spidermonkey/include/android/jsutil.h diff --git a/external/spidermonkey/include/andorid/jsversion.h b/external/spidermonkey/include/android/jsversion.h similarity index 100% rename from external/spidermonkey/include/andorid/jsversion.h rename to external/spidermonkey/include/android/jsversion.h diff --git a/external/spidermonkey/include/andorid/jswrapper.h b/external/spidermonkey/include/android/jswrapper.h similarity index 100% rename from external/spidermonkey/include/andorid/jswrapper.h rename to external/spidermonkey/include/android/jswrapper.h diff --git a/external/spidermonkey/include/andorid/mozilla/Assertions.h b/external/spidermonkey/include/android/mozilla/Assertions.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/Assertions.h rename to external/spidermonkey/include/android/mozilla/Assertions.h diff --git a/external/spidermonkey/include/andorid/mozilla/Attributes.h b/external/spidermonkey/include/android/mozilla/Attributes.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/Attributes.h rename to external/spidermonkey/include/android/mozilla/Attributes.h diff --git a/external/spidermonkey/include/andorid/mozilla/BloomFilter.h b/external/spidermonkey/include/android/mozilla/BloomFilter.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/BloomFilter.h rename to external/spidermonkey/include/android/mozilla/BloomFilter.h diff --git a/external/spidermonkey/include/andorid/mozilla/Casting.h b/external/spidermonkey/include/android/mozilla/Casting.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/Casting.h rename to external/spidermonkey/include/android/mozilla/Casting.h diff --git a/external/spidermonkey/include/andorid/mozilla/Char16.h b/external/spidermonkey/include/android/mozilla/Char16.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/Char16.h rename to external/spidermonkey/include/android/mozilla/Char16.h diff --git a/external/spidermonkey/include/andorid/mozilla/CheckedInt.h b/external/spidermonkey/include/android/mozilla/CheckedInt.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/CheckedInt.h rename to external/spidermonkey/include/android/mozilla/CheckedInt.h diff --git a/external/spidermonkey/include/andorid/mozilla/Compiler.h b/external/spidermonkey/include/android/mozilla/Compiler.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/Compiler.h rename to external/spidermonkey/include/android/mozilla/Compiler.h diff --git a/external/spidermonkey/include/andorid/mozilla/Constants.h b/external/spidermonkey/include/android/mozilla/Constants.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/Constants.h rename to external/spidermonkey/include/android/mozilla/Constants.h diff --git a/external/spidermonkey/include/andorid/mozilla/DebugOnly.h b/external/spidermonkey/include/android/mozilla/DebugOnly.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/DebugOnly.h rename to external/spidermonkey/include/android/mozilla/DebugOnly.h diff --git a/external/spidermonkey/include/andorid/mozilla/Decimal.h b/external/spidermonkey/include/android/mozilla/Decimal.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/Decimal.h rename to external/spidermonkey/include/android/mozilla/Decimal.h diff --git a/external/spidermonkey/include/andorid/mozilla/Endian.h b/external/spidermonkey/include/android/mozilla/Endian.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/Endian.h rename to external/spidermonkey/include/android/mozilla/Endian.h diff --git a/external/spidermonkey/include/andorid/mozilla/EnumSet.h b/external/spidermonkey/include/android/mozilla/EnumSet.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/EnumSet.h rename to external/spidermonkey/include/android/mozilla/EnumSet.h diff --git a/external/spidermonkey/include/andorid/mozilla/FloatingPoint.h b/external/spidermonkey/include/android/mozilla/FloatingPoint.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/FloatingPoint.h rename to external/spidermonkey/include/android/mozilla/FloatingPoint.h diff --git a/external/spidermonkey/include/andorid/mozilla/GuardObjects.h b/external/spidermonkey/include/android/mozilla/GuardObjects.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/GuardObjects.h rename to external/spidermonkey/include/android/mozilla/GuardObjects.h diff --git a/external/spidermonkey/include/andorid/mozilla/HashFunctions.h b/external/spidermonkey/include/android/mozilla/HashFunctions.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/HashFunctions.h rename to external/spidermonkey/include/android/mozilla/HashFunctions.h diff --git a/external/spidermonkey/include/andorid/mozilla/Likely.h b/external/spidermonkey/include/android/mozilla/Likely.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/Likely.h rename to external/spidermonkey/include/android/mozilla/Likely.h diff --git a/external/spidermonkey/include/andorid/mozilla/LinkedList.h b/external/spidermonkey/include/android/mozilla/LinkedList.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/LinkedList.h rename to external/spidermonkey/include/android/mozilla/LinkedList.h diff --git a/external/spidermonkey/include/andorid/mozilla/MSStdInt.h b/external/spidermonkey/include/android/mozilla/MSStdInt.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/MSStdInt.h rename to external/spidermonkey/include/android/mozilla/MSStdInt.h diff --git a/external/spidermonkey/include/andorid/mozilla/MathAlgorithms.h b/external/spidermonkey/include/android/mozilla/MathAlgorithms.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/MathAlgorithms.h rename to external/spidermonkey/include/android/mozilla/MathAlgorithms.h diff --git a/external/spidermonkey/include/andorid/mozilla/MemoryChecking.h b/external/spidermonkey/include/android/mozilla/MemoryChecking.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/MemoryChecking.h rename to external/spidermonkey/include/android/mozilla/MemoryChecking.h diff --git a/external/spidermonkey/include/andorid/mozilla/NullPtr.h b/external/spidermonkey/include/android/mozilla/NullPtr.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/NullPtr.h rename to external/spidermonkey/include/android/mozilla/NullPtr.h diff --git a/external/spidermonkey/include/andorid/mozilla/PodOperations.h b/external/spidermonkey/include/android/mozilla/PodOperations.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/PodOperations.h rename to external/spidermonkey/include/android/mozilla/PodOperations.h diff --git a/external/spidermonkey/include/andorid/mozilla/Poison.h b/external/spidermonkey/include/android/mozilla/Poison.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/Poison.h rename to external/spidermonkey/include/android/mozilla/Poison.h diff --git a/external/spidermonkey/include/andorid/mozilla/Range.h b/external/spidermonkey/include/android/mozilla/Range.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/Range.h rename to external/spidermonkey/include/android/mozilla/Range.h diff --git a/external/spidermonkey/include/andorid/mozilla/RangedPtr.h b/external/spidermonkey/include/android/mozilla/RangedPtr.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/RangedPtr.h rename to external/spidermonkey/include/android/mozilla/RangedPtr.h diff --git a/external/spidermonkey/include/andorid/mozilla/RefPtr.h b/external/spidermonkey/include/android/mozilla/RefPtr.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/RefPtr.h rename to external/spidermonkey/include/android/mozilla/RefPtr.h diff --git a/external/spidermonkey/include/andorid/mozilla/SHA1.h b/external/spidermonkey/include/android/mozilla/SHA1.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/SHA1.h rename to external/spidermonkey/include/android/mozilla/SHA1.h diff --git a/external/spidermonkey/include/andorid/mozilla/Scoped.h b/external/spidermonkey/include/android/mozilla/Scoped.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/Scoped.h rename to external/spidermonkey/include/android/mozilla/Scoped.h diff --git a/external/spidermonkey/include/andorid/mozilla/SplayTree.h b/external/spidermonkey/include/android/mozilla/SplayTree.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/SplayTree.h rename to external/spidermonkey/include/android/mozilla/SplayTree.h diff --git a/external/spidermonkey/include/andorid/mozilla/StandardInteger.h b/external/spidermonkey/include/android/mozilla/StandardInteger.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/StandardInteger.h rename to external/spidermonkey/include/android/mozilla/StandardInteger.h diff --git a/external/spidermonkey/include/andorid/mozilla/ThreadLocal.h b/external/spidermonkey/include/android/mozilla/ThreadLocal.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/ThreadLocal.h rename to external/spidermonkey/include/android/mozilla/ThreadLocal.h diff --git a/external/spidermonkey/include/andorid/mozilla/TypeTraits.h b/external/spidermonkey/include/android/mozilla/TypeTraits.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/TypeTraits.h rename to external/spidermonkey/include/android/mozilla/TypeTraits.h diff --git a/external/spidermonkey/include/andorid/mozilla/TypedEnum.h b/external/spidermonkey/include/android/mozilla/TypedEnum.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/TypedEnum.h rename to external/spidermonkey/include/android/mozilla/TypedEnum.h diff --git a/external/spidermonkey/include/andorid/mozilla/Types.h b/external/spidermonkey/include/android/mozilla/Types.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/Types.h rename to external/spidermonkey/include/android/mozilla/Types.h diff --git a/external/spidermonkey/include/andorid/mozilla/Util.h b/external/spidermonkey/include/android/mozilla/Util.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/Util.h rename to external/spidermonkey/include/android/mozilla/Util.h diff --git a/external/spidermonkey/include/andorid/mozilla/WeakPtr.h b/external/spidermonkey/include/android/mozilla/WeakPtr.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/WeakPtr.h rename to external/spidermonkey/include/android/mozilla/WeakPtr.h diff --git a/external/spidermonkey/prebuilt/andorid/Android.mk b/external/spidermonkey/prebuilt/android/Android.mk similarity index 100% rename from external/spidermonkey/prebuilt/andorid/Android.mk rename to external/spidermonkey/prebuilt/android/Android.mk diff --git a/external/spidermonkey/prebuilt/andorid/armeabi-v7a/libjs_static.a.REMOVED.git-id b/external/spidermonkey/prebuilt/android/armeabi-v7a/libjs_static.a.REMOVED.git-id similarity index 100% rename from external/spidermonkey/prebuilt/andorid/armeabi-v7a/libjs_static.a.REMOVED.git-id rename to external/spidermonkey/prebuilt/android/armeabi-v7a/libjs_static.a.REMOVED.git-id diff --git a/external/spidermonkey/prebuilt/andorid/armeabi/libjs_static.a.REMOVED.git-id b/external/spidermonkey/prebuilt/android/armeabi/libjs_static.a.REMOVED.git-id similarity index 100% rename from external/spidermonkey/prebuilt/andorid/armeabi/libjs_static.a.REMOVED.git-id rename to external/spidermonkey/prebuilt/android/armeabi/libjs_static.a.REMOVED.git-id diff --git a/external/spidermonkey/prebuilt/andorid/x86/libjs_static.a.REMOVED.git-id b/external/spidermonkey/prebuilt/android/x86/libjs_static.a.REMOVED.git-id similarity index 100% rename from external/spidermonkey/prebuilt/andorid/x86/libjs_static.a.REMOVED.git-id rename to external/spidermonkey/prebuilt/android/x86/libjs_static.a.REMOVED.git-id diff --git a/external/tiff/include/andorid/tiff.h b/external/tiff/include/android/tiff.h similarity index 100% rename from external/tiff/include/andorid/tiff.h rename to external/tiff/include/android/tiff.h diff --git a/external/tiff/include/andorid/tiffconf.h b/external/tiff/include/android/tiffconf.h similarity index 100% rename from external/tiff/include/andorid/tiffconf.h rename to external/tiff/include/android/tiffconf.h diff --git a/external/tiff/include/andorid/tiffio.h b/external/tiff/include/android/tiffio.h similarity index 100% rename from external/tiff/include/andorid/tiffio.h rename to external/tiff/include/android/tiffio.h diff --git a/external/tiff/include/andorid/tiffvers.h b/external/tiff/include/android/tiffvers.h similarity index 100% rename from external/tiff/include/andorid/tiffvers.h rename to external/tiff/include/android/tiffvers.h diff --git a/external/tiff/prebuilt/andorid/Android.mk b/external/tiff/prebuilt/android/Android.mk similarity index 58% rename from external/tiff/prebuilt/andorid/Android.mk rename to external/tiff/prebuilt/android/Android.mk index 9d8e36d5fa..40af980160 100644 --- a/external/tiff/prebuilt/andorid/Android.mk +++ b/external/tiff/prebuilt/android/Android.mk @@ -3,6 +3,6 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := cocos_libtiff_static LOCAL_MODULE_FILENAME := tiff -LOCAL_SRC_FILES := libs/$(TARGET_ARCH_ABI)/libtiff.a -LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include +LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libtiff.a +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../include/android include $(PREBUILT_STATIC_LIBRARY) diff --git a/external/tiff/prebuilt/andorid/armeabi-v7a/libtiff.a.REMOVED.git-id b/external/tiff/prebuilt/android/armeabi-v7a/libtiff.a.REMOVED.git-id similarity index 100% rename from external/tiff/prebuilt/andorid/armeabi-v7a/libtiff.a.REMOVED.git-id rename to external/tiff/prebuilt/android/armeabi-v7a/libtiff.a.REMOVED.git-id diff --git a/external/tiff/prebuilt/andorid/armeabi/libtiff.a.REMOVED.git-id b/external/tiff/prebuilt/android/armeabi/libtiff.a.REMOVED.git-id similarity index 100% rename from external/tiff/prebuilt/andorid/armeabi/libtiff.a.REMOVED.git-id rename to external/tiff/prebuilt/android/armeabi/libtiff.a.REMOVED.git-id diff --git a/external/tiff/prebuilt/andorid/x86/libtiff.a.REMOVED.git-id b/external/tiff/prebuilt/android/x86/libtiff.a.REMOVED.git-id similarity index 100% rename from external/tiff/prebuilt/andorid/x86/libtiff.a.REMOVED.git-id rename to external/tiff/prebuilt/android/x86/libtiff.a.REMOVED.git-id diff --git a/external/tinyxml2/tinyxml2.h b/external/tinyxml2/tinyxml2.h index eeffa1096f..b188feb1f5 100644 --- a/external/tinyxml2/tinyxml2.h +++ b/external/tinyxml2/tinyxml2.h @@ -24,8 +24,8 @@ distribution. #ifndef TINYXML2_INCLUDED #define TINYXML2_INCLUDED -#include "platform/CCPlatformConfig.h" -#include "platform/CCPlatformMacros.h" +#include "CCPlatformConfig.h" +#include "CCPlatformMacros.h" #if defined(ANDROID_NDK) || defined(__BORLANDC__) || (CC_TARGET_PLATFORM == CC_PLATFORM_BLACKBERRY) # include diff --git a/external/unzip/ioapi.h b/external/unzip/ioapi.h index 575f44ece4..47cafee504 100644 --- a/external/unzip/ioapi.h +++ b/external/unzip/ioapi.h @@ -21,7 +21,7 @@ #ifndef _ZLIBIOAPI64_H #define _ZLIBIOAPI64_H -#include "platform/CCPlatformConfig.h" +#include "CCPlatformConfig.h" #if (!defined(_WIN32)) && (!defined(WIN32)) diff --git a/external/webp/include/andorid/decode.h b/external/webp/include/android/decode.h similarity index 100% rename from external/webp/include/andorid/decode.h rename to external/webp/include/android/decode.h diff --git a/external/webp/include/andorid/encode.h b/external/webp/include/android/encode.h similarity index 100% rename from external/webp/include/andorid/encode.h rename to external/webp/include/android/encode.h diff --git a/external/webp/include/andorid/types.h b/external/webp/include/android/types.h similarity index 100% rename from external/webp/include/andorid/types.h rename to external/webp/include/android/types.h diff --git a/external/webp/prebuilt/andorid/Android.mk b/external/webp/prebuilt/android/Android.mk similarity index 74% rename from external/webp/prebuilt/andorid/Android.mk rename to external/webp/prebuilt/android/Android.mk index ff7dea31f0..e102ac2511 100644 --- a/external/webp/prebuilt/andorid/Android.mk +++ b/external/webp/prebuilt/android/Android.mk @@ -3,8 +3,8 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := cocos_libwebp_static LOCAL_MODULE_FILENAME := webp -LOCAL_SRC_FILES := libs/$(TARGET_ARCH_ABI)/libwebp.a -LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include +LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libwebp.a +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../include/android LOCAL_WHOLE_STATIC_LIBRARIES := cpufeatures diff --git a/external/webp/prebuilt/andorid/armeabi-v7a/libwebp.a.REMOVED.git-id b/external/webp/prebuilt/android/armeabi-v7a/libwebp.a.REMOVED.git-id similarity index 100% rename from external/webp/prebuilt/andorid/armeabi-v7a/libwebp.a.REMOVED.git-id rename to external/webp/prebuilt/android/armeabi-v7a/libwebp.a.REMOVED.git-id diff --git a/external/webp/prebuilt/andorid/armeabi/libwebp.a.REMOVED.git-id b/external/webp/prebuilt/android/armeabi/libwebp.a.REMOVED.git-id similarity index 100% rename from external/webp/prebuilt/andorid/armeabi/libwebp.a.REMOVED.git-id rename to external/webp/prebuilt/android/armeabi/libwebp.a.REMOVED.git-id diff --git a/external/webp/prebuilt/andorid/x86/libwebp.a.REMOVED.git-id b/external/webp/prebuilt/android/x86/libwebp.a.REMOVED.git-id similarity index 100% rename from external/webp/prebuilt/andorid/x86/libwebp.a.REMOVED.git-id rename to external/webp/prebuilt/android/x86/libwebp.a.REMOVED.git-id diff --git a/samples/Cpp/HelloCpp/Classes/HelloWorldScene.cpp b/samples/Cpp/HelloCpp/Classes/HelloWorldScene.cpp index 58aee740a3..077a92aa11 100644 --- a/samples/Cpp/HelloCpp/Classes/HelloWorldScene.cpp +++ b/samples/Cpp/HelloCpp/Classes/HelloWorldScene.cpp @@ -1,7 +1,7 @@ #include "HelloWorldScene.h" #include "AppMacros.h" -#include "event_dispatcher/CCEventListenerTouch.h" +#include "CCEventListenerTouch.h" USING_NS_CC; diff --git a/samples/Cpp/HelloCpp/proj.android/build_native.sh b/samples/Cpp/HelloCpp/proj.android/build_native.sh index 684f0d9886..cfd49f5d79 100755 --- a/samples/Cpp/HelloCpp/proj.android/build_native.sh +++ b/samples/Cpp/HelloCpp/proj.android/build_native.sh @@ -97,10 +97,11 @@ if [[ "$buildexternalsfromsource" ]]; then echo "Building external dependencies from source" set -x "$NDK_ROOT"/ndk-build -C "$APP_ANDROID_ROOT" $* \ - "NDK_MODULE_PATH=${COCOS2DX_ROOT}:${COCOS2DX_ROOT}/cocos2dx/platform/third_party/android/source" + "NDK_MODULE_PATH=${COCOS2DX_ROOT}/external:${COCOS2DX_ROOT}/cocos" else echo "Using prebuilt externals" set -x "$NDK_ROOT"/ndk-build -C "$APP_ANDROID_ROOT" $* \ - "NDK_MODULE_PATH=${COCOS2DX_ROOT}:${COCOS2DX_ROOT}/cocos2dx/platform/third_party/android/prebuilt" + "NDK_MODULE_PATH=${COCOS2DX_ROOT}/external:${COCOS2DX_ROOT}/cocos" + fi diff --git a/samples/Cpp/HelloCpp/proj.android/jni/Android.mk b/samples/Cpp/HelloCpp/proj.android/jni/Android.mk index 6ffd7d62ef..cfd4cb14b5 100644 --- a/samples/Cpp/HelloCpp/proj.android/jni/Android.mk +++ b/samples/Cpp/HelloCpp/proj.android/jni/Android.mk @@ -12,10 +12,9 @@ LOCAL_SRC_FILES := hellocpp/main.cpp \ LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes -LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static cocos2dxandroid_static cocosdenshion_static +LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static cocosdenshion_static include $(BUILD_SHARED_LIBRARY) -$(call import-module,cocos2dx) +$(call import-module,2d) $(call import-module,audio/android) -$(call import-module,cocos2dx/platform/android) diff --git a/samples/Cpp/TestCpp/Android.mk b/samples/Cpp/TestCpp/Android.mk index ff687de48a..fb39932e2e 100644 --- a/samples/Cpp/TestCpp/Android.mk +++ b/samples/Cpp/TestCpp/Android.mk @@ -7,137 +7,137 @@ LOCAL_MODULE := cocos_testcpp_common LOCAL_MODULE_FILENAME := libtestcppcommon LOCAL_SRC_FILES := \ -Classes/AppDelegate.cpp \ -Classes/BaseTest.cpp \ -Classes/controller.cpp \ -Classes/testBasic.cpp \ -Classes/VisibleRect.cpp \ -Classes/AccelerometerTest/AccelerometerTest.cpp \ -Classes/ActionManagerTest/ActionManagerTest.cpp \ -Classes/ActionsEaseTest/ActionsEaseTest.cpp \ -Classes/ActionsProgressTest/ActionsProgressTest.cpp \ -Classes/ActionsTest/ActionsTest.cpp \ -Classes/Box2DTest/Box2dTest.cpp \ -Classes/Box2DTestBed/Box2dView.cpp \ -Classes/Box2DTestBed/GLES-Render.cpp \ -Classes/Box2DTestBed/Test.cpp \ -Classes/Box2DTestBed/TestEntries.cpp \ -Classes/BugsTest/Bug-1159.cpp \ -Classes/BugsTest/Bug-1174.cpp \ -Classes/BugsTest/Bug-350.cpp \ -Classes/BugsTest/Bug-422.cpp \ -Classes/BugsTest/Bug-624.cpp \ -Classes/BugsTest/Bug-886.cpp \ -Classes/BugsTest/Bug-899.cpp \ -Classes/BugsTest/Bug-914.cpp \ -Classes/BugsTest/BugsTest.cpp \ -Classes/BugsTest/Bug-458/Bug-458.cpp \ -Classes/BugsTest/Bug-458/QuestionContainerSprite.cpp \ -Classes/ChipmunkTest/ChipmunkTest.cpp \ -Classes/ClickAndMoveTest/ClickAndMoveTest.cpp \ -Classes/ClippingNodeTest/ClippingNodeTest.cpp \ -Classes/CocosDenshionTest/CocosDenshionTest.cpp \ -Classes/ConfigurationTest/ConfigurationTest.cpp \ -Classes/CurlTest/CurlTest.cpp \ -Classes/CurrentLanguageTest/CurrentLanguageTest.cpp \ -Classes/DataVisitorTest/DataVisitorTest.cpp \ -Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp \ -Classes/EffectsAdvancedTest/EffectsAdvancedTest.cpp \ -Classes/EffectsTest/EffectsTest.cpp \ -Classes/ExtensionsTest/ExtensionsTest.cpp \ -Classes/ExtensionsTest/CocosBuilderTest/CocosBuilderTest.cpp \ -Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.cpp \ -Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.cpp \ -Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.cpp \ -Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.cpp \ -Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.cpp \ -Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.cpp \ -Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp \ -Classes/ExtensionsTest/CocoStudioComponentsTest/ComponentsTestScene.cpp \ -Classes/ExtensionsTest/CocoStudioComponentsTest/EnemyController.cpp \ -Classes/ExtensionsTest/CocoStudioComponentsTest/GameOverScene.cpp \ -Classes/ExtensionsTest/CocoStudioComponentsTest/PlayerController.cpp \ -Classes/ExtensionsTest/CocoStudioComponentsTest/ProjectileController.cpp \ -Classes/ExtensionsTest/CocoStudioComponentsTest/SceneController.cpp \ -Classes/ExtensionsTest/CocoStudioGUITest/CocosGUIScene.cpp \ -Classes/ExtensionsTest/CocoStudioGUITest/UIScene.cpp \ -Classes/ExtensionsTest/CocoStudioGUITest/UISceneManager.cpp \ -Classes/ExtensionsTest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp \ -Classes/ExtensionsTest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.cpp \ -Classes/ExtensionsTest/CocoStudioGUITest/UIDragPanelTest/UIDragPanelTest.cpp \ -Classes/ExtensionsTest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.cpp \ -Classes/ExtensionsTest/CocoStudioGUITest/UILabelAtlasTest/UILabelAtlasTest.cpp \ -Classes/ExtensionsTest/CocoStudioGUITest/UILabelBMFontTest/UILabelBMFontTest.cpp \ -Classes/ExtensionsTest/CocoStudioGUITest/UILabelTest/UILabelTest.cpp \ -Classes/ExtensionsTest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp \ -Classes/ExtensionsTest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.cpp \ -Classes/ExtensionsTest/CocoStudioGUITest/UINodeContainerTest/UINodeContainerTest.cpp \ -Classes/ExtensionsTest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp \ -Classes/ExtensionsTest/CocoStudioGUITest/UIPanelTest/UIPanelTest.cpp \ -Classes/ExtensionsTest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest.cpp \ -Classes/ExtensionsTest/CocoStudioGUITest/UISliderTest/UISliderTest.cpp \ -Classes/ExtensionsTest/CocoStudioGUITest/UITextAreaTest/UITextAreaTest.cpp \ -Classes/ExtensionsTest/CocoStudioGUITest/UITextButtonTest/UITextButtonTest.cpp \ -Classes/ExtensionsTest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp \ -Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp \ -Classes/ExtensionsTest/ControlExtensionTest/CCControlScene.cpp \ -Classes/ExtensionsTest/ControlExtensionTest/CCControlSceneManager.cpp \ -Classes/ExtensionsTest/ControlExtensionTest/CCControlButtonTest/CCControlButtonTest.cpp \ -Classes/ExtensionsTest/ControlExtensionTest/CCControlColourPicker/CCControlColourPickerTest.cpp \ -Classes/ExtensionsTest/ControlExtensionTest/CCControlPotentiometerTest/CCControlPotentiometerTest.cpp \ -Classes/ExtensionsTest/ControlExtensionTest/CCControlSliderTest/CCControlSliderTest.cpp \ -Classes/ExtensionsTest/ControlExtensionTest/CCControlStepperTest/CCControlStepperTest.cpp \ -Classes/ExtensionsTest/ControlExtensionTest/CCControlSwitchTest/CCControlSwitchTest.cpp \ -Classes/ExtensionsTest/EditBoxTest/EditBoxTest.cpp \ -Classes/ExtensionsTest/NetworkTest/HttpClientTest.cpp \ -Classes/ExtensionsTest/NetworkTest/SocketIOTest.cpp \ -Classes/ExtensionsTest/NetworkTest/WebSocketTest.cpp \ -Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.cpp \ -Classes/ExtensionsTest/Scale9SpriteTest/Scale9SpriteTest.cpp \ -Classes/ExtensionsTest/TableViewTest/CustomTableViewCell.cpp \ -Classes/ExtensionsTest/TableViewTest/TableViewTestScene.cpp \ -Classes/FileUtilsTest/FileUtilsTest.cpp \ -Classes/FontTest/FontTest.cpp \ -Classes/IntervalTest/IntervalTest.cpp \ -Classes/KeyboardTest/KeyboardTest.cpp \ -Classes/KeypadTest/KeypadTest.cpp \ -Classes/LabelTest/LabelTest.cpp \ -Classes/LabelTest/LabelTestNew.cpp \ -Classes/LayerTest/LayerTest.cpp \ -Classes/MenuTest/MenuTest.cpp \ -Classes/MotionStreakTest/MotionStreakTest.cpp \ -Classes/MutiTouchTest/MutiTouchTest.cpp \ -Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp \ -Classes/NodeTest/NodeTest.cpp \ -Classes/ParallaxTest/ParallaxTest.cpp \ -Classes/ParticleTest/ParticleTest.cpp \ -Classes/PerformanceTest/PerformanceAllocTest.cpp \ -Classes/PerformanceTest/PerformanceNodeChildrenTest.cpp \ -Classes/PerformanceTest/PerformanceParticleTest.cpp \ -Classes/PerformanceTest/PerformanceSpriteTest.cpp \ -Classes/PerformanceTest/PerformanceTest.cpp \ -Classes/PerformanceTest/PerformanceTextureTest.cpp \ -Classes/PerformanceTest/PerformanceTouchesTest.cpp \ -Classes/PhysicsTest/PhysicsTest.cpp \ -Classes/RenderTextureTest/RenderTextureTest.cpp \ -Classes/RotateWorldTest/RotateWorldTest.cpp \ -Classes/SceneTest/SceneTest.cpp \ -Classes/SchedulerTest/SchedulerTest.cpp \ -Classes/ShaderTest/ShaderTest.cpp \ -Classes/ShaderTest/ShaderTest2.cpp \ -Classes/SpineTest/SpineTest.cpp \ -Classes/SpriteTest/SpriteTest.cpp \ -Classes/TextInputTest/TextInputTest.cpp \ -Classes/Texture2dTest/Texture2dTest.cpp \ -Classes/TextureCacheTest/TextureCacheTest.cpp \ -Classes/TexturePackerEncryptionTest/TextureAtlasEncryptionTest.cpp \ -Classes/TileMapTest/TileMapTest.cpp \ -Classes/TouchesTest/Ball.cpp \ -Classes/TouchesTest/Paddle.cpp \ -Classes/TouchesTest/TouchesTest.cpp \ -Classes/TransitionsTest/TransitionsTest.cpp \ -Classes/UserDefaultTest/UserDefaultTest.cpp \ -Classes/ZwoptexTest/ZwoptexTest.cpp +$(LOCAL_PATH)/Classes/AppDelegate.cpp \ +$(LOCAL_PATH)/Classes/BaseTest.cpp \ +$(LOCAL_PATH)/Classes/controller.cpp \ +$(LOCAL_PATH)/Classes/testBasic.cpp \ +$(LOCAL_PATH)/Classes/VisibleRect.cpp \ +$(LOCAL_PATH)/Classes/AccelerometerTest/AccelerometerTest.cpp \ +$(LOCAL_PATH)/Classes/ActionManagerTest/ActionManagerTest.cpp \ +$(LOCAL_PATH)/Classes/ActionsEaseTest/ActionsEaseTest.cpp \ +$(LOCAL_PATH)/Classes/ActionsProgressTest/ActionsProgressTest.cpp \ +$(LOCAL_PATH)/Classes/ActionsTest/ActionsTest.cpp \ +$(LOCAL_PATH)/Classes/Box2DTest/Box2dTest.cpp \ +$(LOCAL_PATH)/Classes/Box2DTestBed/Box2dView.cpp \ +$(LOCAL_PATH)/Classes/Box2DTestBed/GLES-Render.cpp \ +$(LOCAL_PATH)/Classes/Box2DTestBed/Test.cpp \ +$(LOCAL_PATH)/Classes/Box2DTestBed/TestEntries.cpp \ +$(LOCAL_PATH)/Classes/BugsTest/Bug-1159.cpp \ +$(LOCAL_PATH)/Classes/BugsTest/Bug-1174.cpp \ +$(LOCAL_PATH)/Classes/BugsTest/Bug-350.cpp \ +$(LOCAL_PATH)/Classes/BugsTest/Bug-422.cpp \ +$(LOCAL_PATH)/Classes/BugsTest/Bug-624.cpp \ +$(LOCAL_PATH)/Classes/BugsTest/Bug-886.cpp \ +$(LOCAL_PATH)/Classes/BugsTest/Bug-899.cpp \ +$(LOCAL_PATH)/Classes/BugsTest/Bug-914.cpp \ +$(LOCAL_PATH)/Classes/BugsTest/BugsTest.cpp \ +$(LOCAL_PATH)/Classes/BugsTest/Bug-458/Bug-458.cpp \ +$(LOCAL_PATH)/Classes/BugsTest/Bug-458/QuestionContainerSprite.cpp \ +$(LOCAL_PATH)/Classes/ChipmunkTest/ChipmunkTest.cpp \ +$(LOCAL_PATH)/Classes/ClickAndMoveTest/ClickAndMoveTest.cpp \ +$(LOCAL_PATH)/Classes/ClippingNodeTest/ClippingNodeTest.cpp \ +$(LOCAL_PATH)/Classes/CocosDenshionTest/CocosDenshionTest.cpp \ +$(LOCAL_PATH)/Classes/ConfigurationTest/ConfigurationTest.cpp \ +$(LOCAL_PATH)/Classes/CurlTest/CurlTest.cpp \ +$(LOCAL_PATH)/Classes/CurrentLanguageTest/CurrentLanguageTest.cpp \ +$(LOCAL_PATH)/Classes/DataVisitorTest/DataVisitorTest.cpp \ +$(LOCAL_PATH)/Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp \ +$(LOCAL_PATH)/Classes/EffectsAdvancedTest/EffectsAdvancedTest.cpp \ +$(LOCAL_PATH)/Classes/EffectsTest/EffectsTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/ExtensionsTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocosBuilderTest/CocosBuilderTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioComponentsTest/ComponentsTestScene.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioComponentsTest/EnemyController.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioComponentsTest/GameOverScene.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioComponentsTest/PlayerController.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioComponentsTest/ProjectileController.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioComponentsTest/SceneController.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/CocosGUIScene.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UIScene.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UISceneManager.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UIDragPanelTest/UIDragPanelTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UILabelAtlasTest/UILabelAtlasTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UILabelBMFontTest/UILabelBMFontTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UILabelTest/UILabelTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UINodeContainerTest/UINodeContainerTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UIPanelTest/UIPanelTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UISliderTest/UISliderTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UITextAreaTest/UITextAreaTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UITextButtonTest/UITextButtonTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/ControlExtensionTest/CCControlScene.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/ControlExtensionTest/CCControlSceneManager.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/ControlExtensionTest/CCControlButtonTest/CCControlButtonTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/ControlExtensionTest/CCControlColourPicker/CCControlColourPickerTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/ControlExtensionTest/CCControlPotentiometerTest/CCControlPotentiometerTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/ControlExtensionTest/CCControlSliderTest/CCControlSliderTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/ControlExtensionTest/CCControlStepperTest/CCControlStepperTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/ControlExtensionTest/CCControlSwitchTest/CCControlSwitchTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/EditBoxTest/EditBoxTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/NetworkTest/HttpClientTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/NetworkTest/SocketIOTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/NetworkTest/WebSocketTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/Scale9SpriteTest/Scale9SpriteTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/TableViewTest/CustomTableViewCell.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/TableViewTest/TableViewTestScene.cpp \ +$(LOCAL_PATH)/Classes/FileUtilsTest/FileUtilsTest.cpp \ +$(LOCAL_PATH)/Classes/FontTest/FontTest.cpp \ +$(LOCAL_PATH)/Classes/IntervalTest/IntervalTest.cpp \ +$(LOCAL_PATH)/Classes/KeyboardTest/KeyboardTest.cpp \ +$(LOCAL_PATH)/Classes/KeypadTest/KeypadTest.cpp \ +$(LOCAL_PATH)/Classes/LabelTest/LabelTest.cpp \ +$(LOCAL_PATH)/Classes/LabelTest/LabelTestNew.cpp \ +$(LOCAL_PATH)/Classes/LayerTest/LayerTest.cpp \ +$(LOCAL_PATH)/Classes/MenuTest/MenuTest.cpp \ +$(LOCAL_PATH)/Classes/MotionStreakTest/MotionStreakTest.cpp \ +$(LOCAL_PATH)/Classes/MutiTouchTest/MutiTouchTest.cpp \ +$(LOCAL_PATH)/Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp \ +$(LOCAL_PATH)/Classes/NodeTest/NodeTest.cpp \ +$(LOCAL_PATH)/Classes/ParallaxTest/ParallaxTest.cpp \ +$(LOCAL_PATH)/Classes/ParticleTest/ParticleTest.cpp \ +$(LOCAL_PATH)/Classes/PerformanceTest/PerformanceAllocTest.cpp \ +$(LOCAL_PATH)/Classes/PerformanceTest/PerformanceNodeChildrenTest.cpp \ +$(LOCAL_PATH)/Classes/PerformanceTest/PerformanceParticleTest.cpp \ +$(LOCAL_PATH)/Classes/PerformanceTest/PerformanceSpriteTest.cpp \ +$(LOCAL_PATH)/Classes/PerformanceTest/PerformanceTest.cpp \ +$(LOCAL_PATH)/Classes/PerformanceTest/PerformanceTextureTest.cpp \ +$(LOCAL_PATH)/Classes/PerformanceTest/PerformanceTouchesTest.cpp \ +$(LOCAL_PATH)/Classes/PhysicsTest/PhysicsTest.cpp \ +$(LOCAL_PATH)/Classes/RenderTextureTest/RenderTextureTest.cpp \ +$(LOCAL_PATH)/Classes/RotateWorldTest/RotateWorldTest.cpp \ +$(LOCAL_PATH)/Classes/SceneTest/SceneTest.cpp \ +$(LOCAL_PATH)/Classes/SchedulerTest/SchedulerTest.cpp \ +$(LOCAL_PATH)/Classes/ShaderTest/ShaderTest.cpp \ +$(LOCAL_PATH)/Classes/ShaderTest/ShaderTest2.cpp \ +$(LOCAL_PATH)/Classes/SpineTest/SpineTest.cpp \ +$(LOCAL_PATH)/Classes/SpriteTest/SpriteTest.cpp \ +$(LOCAL_PATH)/Classes/TextInputTest/TextInputTest.cpp \ +$(LOCAL_PATH)/Classes/Texture2dTest/Texture2dTest.cpp \ +$(LOCAL_PATH)/Classes/TextureCacheTest/TextureCacheTest.cpp \ +$(LOCAL_PATH)/Classes/TexturePackerEncryptionTest/TextureAtlasEncryptionTest.cpp \ +$(LOCAL_PATH)/Classes/TileMapTest/TileMapTest.cpp \ +$(LOCAL_PATH)/Classes/TouchesTest/Ball.cpp \ +$(LOCAL_PATH)/Classes/TouchesTest/Paddle.cpp \ +$(LOCAL_PATH)/Classes/TouchesTest/TouchesTest.cpp \ +$(LOCAL_PATH)/Classes/TransitionsTest/TransitionsTest.cpp \ +$(LOCAL_PATH)/Classes/UserDefaultTest/UserDefaultTest.cpp \ +$(LOCAL_PATH)/Classes/ZwoptexTest/ZwoptexTest.cpp LOCAL_C_INCLUDES := $(LOCAL_PATH)/Classes diff --git a/tools/android-mk-generator/android_mk_generator.py b/tools/android-mk-generator/android_mk_generator.py index 3aabfae992..3e42d908d5 100755 --- a/tools/android-mk-generator/android_mk_generator.py +++ b/tools/android-mk-generator/android_mk_generator.py @@ -24,7 +24,7 @@ def gen_android_mk(mkfile, pathes, suffix = ("c", "cpp",), exclude = ()): filestrio = cStringIO.StringIO() for filename in filelst: filestrio.write(' \\\n') - filestrio.write(os.path.relpath(filename, os.path.dirname(os.path.join(COCOS_ROOT, mkfile)))) + filestrio.write("$(LOCAL_PATH)/"+os.path.relpath(filename, os.path.dirname(os.path.join(COCOS_ROOT, mkfile)))) filestrio.write('\n') # read mk file diff --git a/tools/android-mk-generator/config.py b/tools/android-mk-generator/config.py index fdce1bf352..f7cdc3f389 100644 --- a/tools/android-mk-generator/config.py +++ b/tools/android-mk-generator/config.py @@ -1,8 +1,8 @@ [ { - 'mkfile' : 'cocos2dx/Android.mk', - 'pathes' : ("cocos2dx/",), - 'exclude' : ("cocos2dx/platform/android", "cocos2dx/platform/emscripten", "cocos2dx/platform/ios", "cocos2dx/platform/apple", "cocos2dx/platform/linux", "cocos2dx/platform/mac", "cocos2dx/platform/nacl", "cocos2dx/platform/qt5", "cocos2dx/platform/tizen", "cocos2dx/platform/win32", "cocos2dx/label_nodes/CCFontCache.cpp", "cocos2dx/base_nodes/CCGLBufferedNode.cpp","cocos2dx/support/user_default/CCUserDefault.cpp") + 'mkfile' : 'cocos/2d/Android.mk', + 'pathes' : ("cocos/2d/","cocos/base","cocos/math","cocos/physics","external/tinyxml2","external/unzip"), + 'exclude' : ("cocos/2d/platform/android", "cocos/2d/platform/emscripten", "cocos/2d/platform/ios", "cocos/2d/platform/apple", "cocos/2d/platform/linux", "cocos/2d/platform/mac", "cocos/2d/platform/win32") }, { 'mkfile' : 'samples/Cpp/TestCpp/Android.mk', From 92e0dbe0c156c5d82125d7d82ebbada3425cea19 Mon Sep 17 00:00:00 2001 From: minggo Date: Mon, 14 Oct 2013 14:56:57 +0800 Subject: [PATCH 26/64] issue #2905:add ccUtils.cpp --- cocos/2d/ccUtils.cpp | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 cocos/2d/ccUtils.cpp diff --git a/cocos/2d/ccUtils.cpp b/cocos/2d/ccUtils.cpp new file mode 100644 index 0000000000..d78324565b --- /dev/null +++ b/cocos/2d/ccUtils.cpp @@ -0,0 +1,39 @@ +/**************************************************************************** +Copyright (c) 2010 cocos2d-x.org + +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 "ccUtils.h" + +namespace cocos2d { + +unsigned long ccNextPOT(unsigned long x) +{ + x = x - 1; + x = x | (x >> 1); + x = x | (x >> 2); + x = x | (x >> 4); + x = x | (x >> 8); + x = x | (x >>16); + return x + 1; +} + +} \ No newline at end of file From 438fe702872dac7ed79cb53c7abbe51e1dbc3b26 Mon Sep 17 00:00:00 2001 From: James Chen Date: Mon, 14 Oct 2013 15:53:14 +0800 Subject: [PATCH 27/64] issue #2905: [iOS, Mac] HelloCpp works now. --- build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id | 2 +- build/samples.xcodeproj/project.pbxproj.REMOVED.git-id | 2 +- cocos/2d/platform/ios/CCESRenderer.h | 2 +- cocos/2d/platform/mac/CCEGLView.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id b/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id index ea4a9890a6..1ffb09c3a2 100644 --- a/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -cef7f2eb0a7ce536df264b4b3fa72470af8213d0 \ No newline at end of file +9e303a34aef39593ada75e90ae8d0829f0096abe \ No newline at end of file diff --git a/build/samples.xcodeproj/project.pbxproj.REMOVED.git-id b/build/samples.xcodeproj/project.pbxproj.REMOVED.git-id index a1c65992b0..ebc2c0f549 100644 --- a/build/samples.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/build/samples.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -f3d0c334145f571e5338f3e0fa051f7713668e3f \ No newline at end of file +aa360e1cdcaf0d2ca399aebe9b7c8786e80abde8 \ No newline at end of file diff --git a/cocos/2d/platform/ios/CCESRenderer.h b/cocos/2d/platform/ios/CCESRenderer.h index 7dfb474c8e..944be4926a 100644 --- a/cocos/2d/platform/ios/CCESRenderer.h +++ b/cocos/2d/platform/ios/CCESRenderer.h @@ -28,7 +28,7 @@ // Only compile this code on iOS. These files should NOT be included on your Mac project. // But in case they are included, it won't be compiled. -#import "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" #import #import diff --git a/cocos/2d/platform/mac/CCEGLView.h b/cocos/2d/platform/mac/CCEGLView.h index 222bba5348..5f001b9061 100644 --- a/cocos/2d/platform/mac/CCEGLView.h +++ b/cocos/2d/platform/mac/CCEGLView.h @@ -27,7 +27,7 @@ #include "platform/CCCommon.h" #include "platform/CCEGLViewProtocol.h" -#include "platform/third_party/mac/glfw/glfw3.h" +#include "glfw3.h" NS_CC_BEGIN From 16c88363f56f1a915534c1df29b5fdcbd6899079 Mon Sep 17 00:00:00 2001 From: James Chen Date: Mon, 14 Oct 2013 17:16:39 +0800 Subject: [PATCH 28/64] issue #2905: Updating project configuration for SimpleGame. --- build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id | 2 +- build/samples.xcodeproj/project.pbxproj.REMOVED.git-id | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id b/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id index 1ffb09c3a2..f6b6061df1 100644 --- a/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -9e303a34aef39593ada75e90ae8d0829f0096abe \ No newline at end of file +1513bb8f2a786cfa406d2d6d9001e99abdd009ac \ No newline at end of file diff --git a/build/samples.xcodeproj/project.pbxproj.REMOVED.git-id b/build/samples.xcodeproj/project.pbxproj.REMOVED.git-id index ebc2c0f549..9087c4bab5 100644 --- a/build/samples.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/build/samples.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -aa360e1cdcaf0d2ca399aebe9b7c8786e80abde8 \ No newline at end of file +6d2fc1b611662a4fc4261eb2dc30dc6a96473bb2 \ No newline at end of file From 9f89879e5efe8a3fdc600846aeeb156fc6295007 Mon Sep 17 00:00:00 2001 From: James Chen Date: Mon, 14 Oct 2013 17:43:59 +0800 Subject: [PATCH 29/64] issue #2905: [iOS, Mac] Always search user path. --- build/samples.xcodeproj/project.pbxproj.REMOVED.git-id | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/samples.xcodeproj/project.pbxproj.REMOVED.git-id b/build/samples.xcodeproj/project.pbxproj.REMOVED.git-id index 9087c4bab5..3fe3b732a7 100644 --- a/build/samples.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/build/samples.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -6d2fc1b611662a4fc4261eb2dc30dc6a96473bb2 \ No newline at end of file +561cdc247f0444ca86efc535600901b035e19ffa \ No newline at end of file From 613bb8912030ebc67d0d4ce49300b3d89145e9db Mon Sep 17 00:00:00 2001 From: Toru Matsuoka Date: Mon, 14 Oct 2013 20:19:21 +0900 Subject: [PATCH 30/64] Make "rename" setting usable. --- tools/project-creator/create_project.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/project-creator/create_project.py b/tools/project-creator/create_project.py index 966baaeaff..e55d7aa081 100755 --- a/tools/project-creator/create_project.py +++ b/tools/project-creator/create_project.py @@ -111,6 +111,14 @@ def processPlatformProjects(context, platform): java_package_path = os.path.join(*dst_pkg) + # rename files and folders + for item in data["rename"]: + tmp = item.replace("PACKAGE_PATH", java_package_path) + src = tmp.replace("PROJECT_NAME", context["src_project_name"]) + dst = tmp.replace("PROJECT_NAME", context["dst_project_name"]) + if os.path.exists(os.path.join(proj_path, src)): + os.rename(os.path.join(proj_path, src), os.path.join(proj_path, dst)) + # remove useless files and folders for item in data["remove"]: dst = item.replace("PROJECT_NAME", context["dst_project_name"]) From de9e831e350f9625e33c08092384756058716aec Mon Sep 17 00:00:00 2001 From: Toru Matsuoka Date: Mon, 14 Oct 2013 20:24:28 +0900 Subject: [PATCH 31/64] Fix definition of platform for ios and mac. Remove unnecessary files --- tools/project-creator/create_project.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/project-creator/create_project.py b/tools/project-creator/create_project.py index e55d7aa081..be6e38babc 100755 --- a/tools/project-creator/create_project.py +++ b/tools/project-creator/create_project.py @@ -6,9 +6,9 @@ # define global variables PLATFORMS = { - "cpp" : ["ios", "android", "win32", "mac", "linux"], - "lua" : ["ios", "android", "win32", "mac", "linux"], - "javascript" : ["ios", "android", "win32", "mac"] + "cpp" : ["ios_mac", "android", "win32", "linux"], + "lua" : ["ios_mac", "android", "win32", "linux"], + "javascript" : ["ios_mac", "android", "win32"] } From 6fc2be62f595a5fd303d3da1f1f0e4d30b086da0 Mon Sep 17 00:00:00 2001 From: minggo Date: Tue, 15 Oct 2013 18:00:03 +0800 Subject: [PATCH 35/64] issue #2905: testcpp bild ok on Android --- cocos/2d/cocos2d.h | 4 + cocos/editor-support/cocosbuilder/Android.mk | 48 + .../cocosbuilder/CCBAnimationManager.cpp | 5 +- .../cocosbuilder/CCBAnimationManager.h | 122 +-- .../cocosbuilder/CCBFileLoader.cpp | 5 +- .../cocosbuilder/CCBFileLoader.h | 6 +- .../cocosbuilder/CCBKeyframe.cpp | 4 +- .../editor-support/cocosbuilder/CCBKeyframe.h | 13 +- .../cocosbuilder/CCBMemberVariableAssigner.h | 8 +- .../editor-support/cocosbuilder/CCBReader.cpp | 6 +- cocos/editor-support/cocosbuilder/CCBReader.h | 83 +- .../cocosbuilder/CCBSelectorResolver.h | 13 +- .../cocosbuilder/CCBSequence.cpp | 4 +- .../editor-support/cocosbuilder/CCBSequence.h | 7 +- .../cocosbuilder/CCBSequenceProperty.cpp | 4 +- .../cocosbuilder/CCBSequenceProperty.h | 11 +- .../editor-support/cocosbuilder/CCBValue.cpp | 6 +- cocos/editor-support/cocosbuilder/CCBValue.h | 21 +- .../cocosbuilder/CCControlButtonLoader.cpp | 6 +- .../cocosbuilder/CCControlButtonLoader.h | 24 +- .../cocosbuilder/CCControlLoader.cpp | 6 +- .../cocosbuilder/CCControlLoader.h | 12 +- .../cocosbuilder/CCLabelBMFontLoader.cpp | 6 +- .../cocosbuilder/CCLabelBMFontLoader.h | 16 +- .../cocosbuilder/CCLabelTTFLoader.cpp | 6 +- .../cocosbuilder/CCLabelTTFLoader.h | 22 +- .../cocosbuilder/CCLayerColorLoader.cpp | 6 +- .../cocosbuilder/CCLayerColorLoader.h | 12 +- .../cocosbuilder/CCLayerGradientLoader.cpp | 6 +- .../cocosbuilder/CCLayerGradientLoader.h | 14 +- .../cocosbuilder/CCLayerLoader.cpp | 8 +- .../cocosbuilder/CCLayerLoader.h | 8 +- .../cocosbuilder/CCMenuItemImageLoader.cpp | 6 +- .../cocosbuilder/CCMenuItemImageLoader.h | 8 +- .../cocosbuilder/CCMenuItemLoader.cpp | 6 +- .../cocosbuilder/CCMenuItemLoader.h | 10 +- .../cocosbuilder/CCMenuLoader.h | 6 +- .../CCNode+CCBRelativePositioning.cpp | 6 +- .../CCNode+CCBRelativePositioning.h | 9 +- .../cocosbuilder/CCNodeLoader.cpp | 6 +- .../cocosbuilder/CCNodeLoader.h | 146 +-- .../cocosbuilder/CCNodeLoaderLibrary.cpp | 6 +- .../cocosbuilder/CCNodeLoaderLibrary.h | 6 +- .../cocosbuilder/CCNodeLoaderListener.h | 6 +- .../CCParticleSystemQuadLoader.cpp | 6 +- .../cocosbuilder/CCParticleSystemQuadLoader.h | 24 +- .../cocosbuilder/CCScale9SpriteLoader.cpp | 7 +- .../cocosbuilder/CCScale9SpriteLoader.h | 20 +- .../cocosbuilder/CCScrollViewLoader.cpp | 7 +- .../cocosbuilder/CCScrollViewLoader.h | 18 +- .../cocosbuilder/CCSpriteLoader.cpp | 6 +- .../cocosbuilder/CCSpriteLoader.h | 16 +- .../cocosbuilder/CocosBuilder.h | 32 + cocos/editor-support/cocostudio/Android.mk | 64 ++ cocos/editor-support/cocostudio/CocoStudio.h | 62 ++ .../cocostudio/action/CCActionFrame.cpp | 6 +- .../cocostudio/action/CCActionFrame.h | 31 +- .../cocostudio/action/CCActionFrameEasing.cpp | 6 +- .../cocostudio/action/CCActionFrameEasing.h | 7 +- .../cocostudio/action/CCActionManagerEx.cpp | 12 +- .../cocostudio/action/CCActionManagerEx.h | 13 +- .../cocostudio/action/CCActionNode.cpp | 17 +- .../cocostudio/action/CCActionNode.h | 29 +- .../cocostudio/action/CCActionObject.cpp | 12 +- .../cocostudio/action/CCActionObject.h | 13 +- .../cocostudio/armature/CCArmature.cpp | 6 +- .../cocostudio/armature/CCArmature.h | 26 +- .../cocostudio/armature/CCBone.cpp | 6 +- .../cocostudio/armature/CCBone.h | 18 +- .../animation/CCArmatureAnimation.cpp | 16 +- .../armature/animation/CCArmatureAnimation.h | 18 +- .../armature/animation/CCProcessBase.cpp | 8 +- .../armature/animation/CCProcessBase.h | 10 +- .../cocostudio/armature/animation/CCTween.cpp | 14 +- .../cocostudio/armature/animation/CCTween.h | 6 +- .../cocostudio/armature/datas/CCDatas.cpp | 10 +- .../cocostudio/armature/datas/CCDatas.h | 48 +- .../armature/display/CCBatchNode.cpp | 10 +- .../cocostudio/armature/display/CCBatchNode.h | 12 +- .../armature/display/CCDecorativeDisplay.cpp | 6 +- .../armature/display/CCDecorativeDisplay.h | 12 +- .../armature/display/CCDisplayFactory.cpp | 18 +- .../armature/display/CCDisplayFactory.h | 14 +- .../armature/display/CCDisplayManager.cpp | 14 +- .../armature/display/CCDisplayManager.h | 32 +- .../cocostudio/armature/display/CCSkin.cpp | 12 +- .../cocostudio/armature/display/CCSkin.h | 16 +- .../armature/physics/CCColliderDetector.cpp | 9 +- .../armature/physics/CCColliderDetector.h | 20 +- .../armature/utils/CCArmatureDataManager.cpp | 5 +- .../armature/utils/CCArmatureDataManager.h | 24 +- .../armature/utils/CCArmatureDefine.cpp | 4 +- .../armature/utils/CCArmatureDefine.h | 9 +- .../armature/utils/CCDataReaderHelper.cpp | 56 +- .../armature/utils/CCDataReaderHelper.h | 38 +- .../utils/CCSpriteFrameCacheHelper.cpp | 6 +- .../armature/utils/CCSpriteFrameCacheHelper.h | 8 +- .../armature/utils/CCTransformHelp.cpp | 6 +- .../armature/utils/CCTransformHelp.h | 18 +- .../armature/utils/CCTweenFunction.cpp | 4 +- .../armature/utils/CCTweenFunction.h | 4 +- .../cocostudio/armature/utils/CCUtilMath.cpp | 6 +- .../cocostudio/armature/utils/CCUtilMath.h | 14 +- .../cocostudio/components/CCComAttribute.cpp | 9 +- .../cocostudio/components/CCComAttribute.h | 15 +- .../cocostudio/components/CCComAudio.cpp | 4 +- .../cocostudio/components/CCComAudio.h | 5 +- .../cocostudio/components/CCComController.cpp | 4 +- .../cocostudio/components/CCComController.h | 4 +- .../cocostudio/components/CCComRender.cpp | 4 +- .../cocostudio/components/CCComRender.h | 6 +- .../cocostudio/components/CCInputDelegate.cpp | 6 +- .../cocostudio/components/CCInputDelegate.h | 57 +- .../editor-support/cocostudio/json/.DS_Store | Bin 0 -> 6148 bytes .../json/CSContentJsonDictionary.cpp | 50 +- .../cocostudio/json/CSContentJsonDictionary.h | 12 +- .../cocostudio/json/DictionaryHelper.cpp | 28 +- .../cocostudio/json/DictionaryHelper.h | 31 +- .../cocostudio/reader/CCSGUIReader.cpp | 103 +- .../cocostudio/reader/CCSGUIReader.h | 54 +- .../cocostudio/reader/CCSSceneReader.cpp | 36 +- .../cocostudio/reader/CCSSceneReader.h | 11 +- cocos/editor-support/spine/Android.mk | 42 + cocos/editor-support/spine/Animation.cpp | 4 +- cocos/editor-support/spine/Animation.h | 4 +- cocos/editor-support/spine/AnimationState.cpp | 4 +- cocos/editor-support/spine/AnimationState.h | 4 +- .../spine/AnimationStateData.cpp | 4 +- .../editor-support/spine/AnimationStateData.h | 4 +- cocos/editor-support/spine/Atlas.cpp | 4 +- cocos/editor-support/spine/Atlas.h | 4 +- .../spine/AtlasAttachmentLoader.cpp | 4 +- .../spine/AtlasAttachmentLoader.h | 4 +- cocos/editor-support/spine/Attachment.cpp | 4 +- cocos/editor-support/spine/Attachment.h | 4 +- .../editor-support/spine/AttachmentLoader.cpp | 4 +- cocos/editor-support/spine/AttachmentLoader.h | 4 +- cocos/editor-support/spine/Bone.cpp | 4 +- cocos/editor-support/spine/Bone.h | 4 +- cocos/editor-support/spine/BoneData.cpp | 4 +- cocos/editor-support/spine/BoneData.h | 4 +- cocos/editor-support/spine/CCSkeleton.cpp | 4 +- cocos/editor-support/spine/CCSkeleton.h | 5 +- .../spine/CCSkeletonAnimation.cpp | 4 +- .../spine/CCSkeletonAnimation.h | 4 +- cocos/editor-support/spine/Json.cpp | 4 +- cocos/editor-support/spine/Json.h | 4 +- .../editor-support/spine/RegionAttachment.cpp | 4 +- cocos/editor-support/spine/RegionAttachment.h | 4 +- cocos/editor-support/spine/Skeleton.cpp | 4 +- cocos/editor-support/spine/Skeleton.h | 4 +- cocos/editor-support/spine/SkeletonData.cpp | 4 +- cocos/editor-support/spine/SkeletonData.h | 4 +- cocos/editor-support/spine/SkeletonJson.cpp | 4 +- cocos/editor-support/spine/SkeletonJson.h | 4 +- cocos/editor-support/spine/Skin.cpp | 4 +- cocos/editor-support/spine/Skin.h | 4 +- cocos/editor-support/spine/Slot.cpp | 4 +- cocos/editor-support/spine/Slot.h | 4 +- cocos/editor-support/spine/SlotData.cpp | 4 +- cocos/editor-support/spine/SlotData.h | 4 +- cocos/editor-support/spine/extension.cpp | 4 +- cocos/editor-support/spine/extension.h | 4 +- cocos/editor-support/spine/spine-cocos2dx.cpp | 4 +- cocos/editor-support/spine/spine-cocos2dx.h | 4 +- cocos/gui/Android.mk | 50 + cocos/gui/base-classes/UIRootWidget.cpp | 6 +- cocos/gui/base-classes/UIRootWidget.h | 6 +- cocos/gui/base-classes/UIWidget.cpp | 12 +- cocos/gui/base-classes/UIWidget.h | 117 ++- cocos/gui/layouts/Layout.cpp | 15 +- cocos/gui/layouts/Layout.h | 50 +- cocos/gui/layouts/LayoutParameter.cpp | 4 +- cocos/gui/layouts/LayoutParameter.h | 6 +- cocos/gui/layouts/UILayoutDefine.cpp | 4 +- cocos/gui/layouts/UILayoutDefine.h | 5 +- cocos/gui/system/CocosGUI.cpp | 4 +- cocos/gui/system/CocosGUI.h | 38 +- cocos/gui/system/UIHelper.cpp | 12 +- cocos/gui/system/UIHelper.h | 10 +- cocos/gui/system/UIInputManager.cpp | 6 +- cocos/gui/system/UIInputManager.h | 32 +- cocos/gui/system/UILayer.cpp | 6 +- cocos/gui/system/UILayer.h | 19 +- cocos/gui/widgets/UIButton.cpp | 9 +- cocos/gui/widgets/UIButton.h | 48 +- cocos/gui/widgets/UICheckBox.cpp | 6 +- cocos/gui/widgets/UICheckBox.h | 32 +- cocos/gui/widgets/UIImageView.cpp | 9 +- cocos/gui/widgets/UIImageView.h | 26 +- cocos/gui/widgets/UILabel.cpp | 6 +- cocos/gui/widgets/UILabel.h | 20 +- cocos/gui/widgets/UILabelAtlas.cpp | 6 +- cocos/gui/widgets/UILabelAtlas.h | 16 +- cocos/gui/widgets/UILabelBMFont.cpp | 8 +- cocos/gui/widgets/UILabelBMFont.h | 14 +- cocos/gui/widgets/UILoadingBar.cpp | 9 +- cocos/gui/widgets/UILoadingBar.h | 18 +- cocos/gui/widgets/UISlider.cpp | 9 +- cocos/gui/widgets/UISlider.h | 48 +- cocos/gui/widgets/UITextField.cpp | 6 +- cocos/gui/widgets/UITextField.h | 34 +- .../UIDragPanel.cpp | 8 +- .../UIDragPanel.h | 70 +- .../UIListView.cpp | 6 +- .../UIListView.h | 44 +- .../UIPageView.cpp | 6 +- .../UIPageView.h | 34 +- .../UIScrollInterface.h | 14 +- .../UIScrollView.cpp | 8 +- .../UIScrollView.h | 40 +- cocos/network/Android.mk | 28 + cocos/network/HttpClient.cpp | 6 +- cocos/network/HttpClient.h | 8 +- cocos/network/HttpRequest.h | 23 +- cocos/network/HttpResponse.h | 9 +- cocos/network/SocketIO.cpp | 30 +- cocos/network/SocketIO.h | 9 +- cocos/network/WebSocket.cpp | 6 +- cocos/network/WebSocket.h | 5 +- cocos/storage/local-storage/Android.mk | 19 + extensions/Android.mk | 14 +- extensions/CCDeprecated-ext.cpp | 31 - extensions/CCDeprecated-ext.h | 278 ----- .../GUI/CCControlExtension/CCControl.cpp | 8 +- .../CCControlExtension/CCControlButton.cpp | 8 +- .../CCControlColourPicker.cpp | 4 +- .../CCControlExtension/CCControlSlider.cpp | 2 +- .../GUI/CCControlExtension/CCControlUtils.h | 2 +- .../GUI/CCControlExtension/CCInvocation.h | 2 +- extensions/GUI/CCScrollView/CCSorting.cpp | 2 +- extensions/GUI/CCScrollView/CCSorting.h | 2 +- extensions/GUI/CCScrollView/CCTableView.cpp | 4 +- .../GUI/CCScrollView/CCTableViewCell.cpp | 2 +- extensions/GUI/CCScrollView/CCTableViewCell.h | 2 +- extensions/assets-manager/AssetsManager.cpp | 2 +- extensions/cocos-ext.h | 72 +- .../physics-nodes/CCPhysicsDebugNode.cpp | 2 +- .../curl/include/android/{ => curl}/curl.h | 0 .../include/android/{ => curl}/curlbuild.h | 0 .../include/android/{ => curl}/curlrules.h | 0 .../curl/include/android/{ => curl}/curlver.h | 0 .../curl/include/android/{ => curl}/easy.h | 0 .../curl/include/android/{ => curl}/mprintf.h | 0 .../curl/include/android/{ => curl}/multi.h | 0 .../include/android/{ => curl}/stdcheaders.h | 0 .../android/{ => curl}/typecheck-gcc.h | 0 .../curl/include/android/{ => curl}/types.h | 0 external/curl/include/ios/{ => curl}/curl.h | 0 .../curl/include/ios/{ => curl}/curlbuild.h | 0 .../curl/include/ios/{ => curl}/curlrules.h | 0 .../curl/include/ios/{ => curl}/curlver.h | 0 external/curl/include/ios/{ => curl}/easy.h | 0 .../curl/include/ios/{ => curl}/mprintf.h | 0 external/curl/include/ios/{ => curl}/multi.h | 0 .../curl/include/ios/{ => curl}/stdcheaders.h | 0 .../include/ios/{ => curl}/typecheck-gcc.h | 0 .../include/linux/32-bit/{ => curl}/curl.h | 0 .../linux/32-bit/{ => curl}/curlbuild.h | 0 .../linux/32-bit/{ => curl}/curlrules.h | 0 .../include/linux/32-bit/{ => curl}/curlver.h | 0 .../include/linux/32-bit/{ => curl}/easy.h | 0 .../include/linux/32-bit/{ => curl}/mprintf.h | 0 .../include/linux/32-bit/{ => curl}/multi.h | 0 .../linux/32-bit/{ => curl}/stdcheaders.h | 0 .../linux/32-bit/{ => curl}/typecheck-gcc.h | 0 .../include/linux/64-bit/{ => curl}/curl.h | 0 .../linux/64-bit/{ => curl}/curlbuild.h | 0 .../linux/64-bit/{ => curl}/curlrules.h | 0 .../include/linux/64-bit/{ => curl}/curlver.h | 0 .../include/linux/64-bit/{ => curl}/easy.h | 0 .../include/linux/64-bit/{ => curl}/mprintf.h | 0 .../include/linux/64-bit/{ => curl}/multi.h | 0 .../linux/64-bit/{ => curl}/stdcheaders.h | 0 external/curl/include/win32/{ => curl}/curl.h | 0 .../curl/include/win32/{ => curl}/curlbuild.h | 0 .../curl/include/win32/{ => curl}/curlrules.h | 0 .../curl/include/win32/{ => curl}/curlver.h | 0 external/curl/include/win32/{ => curl}/easy.h | 0 .../curl/include/win32/{ => curl}/mprintf.h | 0 .../curl/include/win32/{ => curl}/multi.h | 0 .../include/win32/{ => curl}/stdcheaders.h | 0 .../include/win32/{ => curl}/typecheck-gcc.h | 0 external/{jsoncpp => json}/autolink.h | 5 - external/json/config.h | 43 + external/{jsoncpp => json}/features.h | 11 +- external/{jsoncpp => json}/forwards.h | 15 +- external/json/json.h | 10 + .../{jsoncpp => json}/json_batchallocator.h | 9 +- .../{jsoncpp => json}/json_internalarray.inl | 10 +- .../{jsoncpp => json}/json_internalmap.inl | 12 +- external/{jsoncpp => json}/json_reader.cpp | 113 +- external/{jsoncpp => json}/json_value.cpp | 483 ++++----- .../{jsoncpp => json}/json_valueiterator.inl | 9 +- external/{jsoncpp => json}/json_writer.cpp | 85 +- external/{jsoncpp => json}/reader.h | 40 +- external/{jsoncpp => json}/sconscript | 0 external/{jsoncpp => json}/value.h | 132 +-- external/{jsoncpp => json}/writer.h | 17 +- external/jsoncpp/config.h | 96 -- external/jsoncpp/json_lib.h | 15 - external/jsoncpp/json_tool.h | 93 -- .../android}/libwebsockets.h | 0 .../include => include/ios}/libwebsockets.h | 0 .../include => include/mac}/libwebsockets.h | 0 .../include => include/win32}/libwebsockets.h | 0 .../win32}/win32helpers/gettimeofday.h | 0 .../win32}/win32helpers/websock-w32.h | 0 .../{ => prebuilt}/android/Android.mk | 4 +- .../ios}/libwebsockets.a.REMOVED.git-id | 0 .../mac}/libwebsockets.a.REMOVED.git-id | 0 .../websockets/tizen/include/libwebsockets.h | 977 ------------------ .../lib/armv7l/libwebsockets.a.REMOVED.git-id | 1 - .../lib/x86/libwebsockets.a.REMOVED.git-id | 1 - samples/Cpp/TestCpp/Android.mk | 18 +- samples/Cpp/TestCpp/Classes/AppDelegate.cpp | 3 +- .../CocoStudioArmatureTest/ArmatureScene.cpp | 3 +- .../CocoStudioArmatureTest/ArmatureScene.h | 27 +- .../ComponentsTestScene.cpp | 1 + .../EnemyController.cpp | 1 + .../EnemyController.h | 3 +- .../PlayerController.cpp | 2 +- .../PlayerController.h | 3 +- .../ProjectileController.cpp | 1 + .../ProjectileController.h | 4 +- .../SceneController.cpp | 1 + .../SceneController.h | 6 +- .../CocoStudioGUITest/CocosGUIScene.cpp | 7 +- .../CocoStudioGUITest/CocosGUIScene.h | 2 + .../UIButtonTest/UIButtonTest.cpp | 24 +- .../UICheckBoxTest/UICheckBoxTest.cpp | 4 +- .../CocoStudioGUITest/UIScene.cpp | 2 + .../CocoStudioGUITest/UIScene.h | 2 + .../UITextButtonTest/UITextButtonTest.cpp | 16 +- .../CocoStudioSceneTest/SceneEditorTest.cpp | 13 +- .../AnimationsTest/AnimationsLayerLoader.h | 2 +- .../AnimationsTest/AnimationsTestLayer.cpp | 3 +- .../AnimationsTest/AnimationsTestLayer.h | 9 +- .../ButtonTest/ButtonTestLayer.cpp | 3 +- .../ButtonTest/ButtonTestLayer.h | 5 +- .../ButtonTest/ButtonTestLayerLoader.h | 2 +- .../CocosBuilderTest/CocosBuilderTest.cpp | 3 +- .../HelloCocosBuilderLayer.cpp | 23 +- .../HelloCocosBuilderLayer.h | 13 +- .../HelloCocosBuilderLayerLoader.h | 2 +- .../LabelTest/LabelTestLayerLoader.h | 2 +- .../MenuTest/MenuTestLayer.cpp | 1 + .../CocosBuilderTest/MenuTest/MenuTestLayer.h | 5 +- .../MenuTest/MenuTestLayerLoader.h | 2 +- .../ParticleSystemTestLayerLoader.h | 2 +- .../ScrollViewTestLayerLoader.h | 2 +- .../SpriteTest/SpriteTestLayerLoader.h | 2 +- .../TestHeader/TestHeaderLayer.cpp | 3 +- .../TestHeader/TestHeaderLayer.h | 7 +- .../TestHeader/TestHeaderLayerLoader.h | 2 +- .../TimelineCallbackLayerLoader.h | 2 +- .../TimelineCallbackTestLayer.cpp | 1 + .../TimelineCallbackTestLayer.h | 5 +- .../NetworkTest/HttpClientTest.cpp | 1 + .../NetworkTest/HttpClientTest.h | 3 +- .../NetworkTest/SocketIOTest.cpp | 9 +- .../ExtensionsTest/NetworkTest/SocketIOTest.h | 18 +- .../NetworkTest/WebSocketTest.cpp | 9 +- .../NetworkTest/WebSocketTest.h | 18 +- .../NotificationCenterTest.cpp | 2 +- .../PerformanceTest/PerformanceAllocTest.h | 2 +- .../PerformanceNodeChildrenTest.h | 2 +- .../TestCpp/Classes/SpineTest/SpineTest.cpp | 3 +- .../Cpp/TestCpp/Classes/SpineTest/SpineTest.h | 2 +- .../TextureAtlasEncryptionTest.cpp | 2 +- samples/Cpp/TestCpp/Classes/testBasic.cpp | 3 +- .../Cpp/TestCpp/proj.android/build_native.sh | 2 +- .../Cpp/TestCpp/proj.android/jni/Android.mk | 11 - 373 files changed, 2568 insertions(+), 3844 deletions(-) create mode 100644 cocos/editor-support/cocosbuilder/Android.mk create mode 100644 cocos/editor-support/cocosbuilder/CocosBuilder.h create mode 100644 cocos/editor-support/cocostudio/Android.mk create mode 100644 cocos/editor-support/cocostudio/CocoStudio.h create mode 100644 cocos/editor-support/cocostudio/json/.DS_Store create mode 100644 cocos/editor-support/spine/Android.mk create mode 100644 cocos/gui/Android.mk rename cocos/gui/widgets/{ScrollWidget => scroll-widget}/UIDragPanel.cpp (99%) rename cocos/gui/widgets/{ScrollWidget => scroll-widget}/UIDragPanel.h (80%) rename cocos/gui/widgets/{ScrollWidget => scroll-widget}/UIListView.cpp (99%) rename cocos/gui/widgets/{ScrollWidget => scroll-widget}/UIListView.h (84%) rename cocos/gui/widgets/{ScrollWidget => scroll-widget}/UIPageView.cpp (99%) rename cocos/gui/widgets/{ScrollWidget => scroll-widget}/UIPageView.h (84%) rename cocos/gui/widgets/{ScrollWidget => scroll-widget}/UIScrollInterface.h (82%) rename cocos/gui/widgets/{ScrollWidget => scroll-widget}/UIScrollView.cpp (99%) rename cocos/gui/widgets/{ScrollWidget => scroll-widget}/UIScrollView.h (85%) create mode 100644 cocos/network/Android.mk create mode 100644 cocos/storage/local-storage/Android.mk delete mode 100644 extensions/CCDeprecated-ext.cpp delete mode 100644 extensions/CCDeprecated-ext.h rename external/curl/include/android/{ => curl}/curl.h (100%) rename external/curl/include/android/{ => curl}/curlbuild.h (100%) rename external/curl/include/android/{ => curl}/curlrules.h (100%) rename external/curl/include/android/{ => curl}/curlver.h (100%) rename external/curl/include/android/{ => curl}/easy.h (100%) rename external/curl/include/android/{ => curl}/mprintf.h (100%) rename external/curl/include/android/{ => curl}/multi.h (100%) rename external/curl/include/android/{ => curl}/stdcheaders.h (100%) rename external/curl/include/android/{ => curl}/typecheck-gcc.h (100%) rename external/curl/include/android/{ => curl}/types.h (100%) rename external/curl/include/ios/{ => curl}/curl.h (100%) rename external/curl/include/ios/{ => curl}/curlbuild.h (100%) rename external/curl/include/ios/{ => curl}/curlrules.h (100%) rename external/curl/include/ios/{ => curl}/curlver.h (100%) rename external/curl/include/ios/{ => curl}/easy.h (100%) rename external/curl/include/ios/{ => curl}/mprintf.h (100%) rename external/curl/include/ios/{ => curl}/multi.h (100%) rename external/curl/include/ios/{ => curl}/stdcheaders.h (100%) rename external/curl/include/ios/{ => curl}/typecheck-gcc.h (100%) rename external/curl/include/linux/32-bit/{ => curl}/curl.h (100%) rename external/curl/include/linux/32-bit/{ => curl}/curlbuild.h (100%) rename external/curl/include/linux/32-bit/{ => curl}/curlrules.h (100%) rename external/curl/include/linux/32-bit/{ => curl}/curlver.h (100%) rename external/curl/include/linux/32-bit/{ => curl}/easy.h (100%) rename external/curl/include/linux/32-bit/{ => curl}/mprintf.h (100%) rename external/curl/include/linux/32-bit/{ => curl}/multi.h (100%) rename external/curl/include/linux/32-bit/{ => curl}/stdcheaders.h (100%) rename external/curl/include/linux/32-bit/{ => curl}/typecheck-gcc.h (100%) rename external/curl/include/linux/64-bit/{ => curl}/curl.h (100%) rename external/curl/include/linux/64-bit/{ => curl}/curlbuild.h (100%) rename external/curl/include/linux/64-bit/{ => curl}/curlrules.h (100%) rename external/curl/include/linux/64-bit/{ => curl}/curlver.h (100%) rename external/curl/include/linux/64-bit/{ => curl}/easy.h (100%) rename external/curl/include/linux/64-bit/{ => curl}/mprintf.h (100%) rename external/curl/include/linux/64-bit/{ => curl}/multi.h (100%) rename external/curl/include/linux/64-bit/{ => curl}/stdcheaders.h (100%) rename external/curl/include/win32/{ => curl}/curl.h (100%) rename external/curl/include/win32/{ => curl}/curlbuild.h (100%) rename external/curl/include/win32/{ => curl}/curlrules.h (100%) rename external/curl/include/win32/{ => curl}/curlver.h (100%) rename external/curl/include/win32/{ => curl}/easy.h (100%) rename external/curl/include/win32/{ => curl}/mprintf.h (100%) rename external/curl/include/win32/{ => curl}/multi.h (100%) rename external/curl/include/win32/{ => curl}/stdcheaders.h (100%) rename external/curl/include/win32/{ => curl}/typecheck-gcc.h (100%) rename external/{jsoncpp => json}/autolink.h (65%) create mode 100644 external/json/config.h rename external/{jsoncpp => json}/features.h (78%) rename external/{jsoncpp => json}/forwards.h (61%) create mode 100644 external/json/json.h rename external/{jsoncpp => json}/json_batchallocator.h (93%) rename external/{jsoncpp => json}/json_internalarray.inl (97%) rename external/{jsoncpp => json}/json_internalmap.inl (98%) rename external/{jsoncpp => json}/json_reader.cpp (89%) rename external/{jsoncpp => json}/json_value.cpp (79%) rename external/{jsoncpp => json}/json_valueiterator.inl (96%) rename external/{jsoncpp => json}/json_writer.cpp (93%) rename external/{jsoncpp => json}/reader.h (82%) rename external/{jsoncpp => json}/sconscript (100%) rename external/{jsoncpp => json}/value.h (90%) rename external/{jsoncpp => json}/writer.h (91%) delete mode 100644 external/jsoncpp/config.h delete mode 100644 external/jsoncpp/json_lib.h delete mode 100644 external/jsoncpp/json_tool.h rename external/websockets/{android/include => include/android}/libwebsockets.h (100%) rename external/websockets/{ios/include => include/ios}/libwebsockets.h (100%) rename external/websockets/{mac/include => include/mac}/libwebsockets.h (100%) rename external/websockets/{win32/include => include/win32}/libwebsockets.h (100%) rename external/websockets/{win32/include => include/win32}/win32helpers/gettimeofday.h (100%) rename external/websockets/{win32/include => include/win32}/win32helpers/websock-w32.h (100%) rename external/websockets/{ => prebuilt}/android/Android.mk (69%) rename external/websockets/{ios/lib => prebuilt/ios}/libwebsockets.a.REMOVED.git-id (100%) rename external/websockets/{mac/lib => prebuilt/mac}/libwebsockets.a.REMOVED.git-id (100%) delete mode 100644 external/websockets/tizen/include/libwebsockets.h delete mode 100644 external/websockets/tizen/lib/armv7l/libwebsockets.a.REMOVED.git-id delete mode 100644 external/websockets/tizen/lib/x86/libwebsockets.a.REMOVED.git-id diff --git a/cocos/2d/cocos2d.h b/cocos/2d/cocos2d.h index 9799e0a9fd..a1a28e7f0c 100644 --- a/cocos/2d/cocos2d.h +++ b/cocos/2d/cocos2d.h @@ -122,6 +122,10 @@ THE SOFTWARE. #include "CCPhysicsJoint.h" #include "CCPhysicsWorld.h" +// kazmath +#include "kazmath/kazmath.h" +#include "kazmath/GL/matrix.h" + // platform #include "platform/CCDevice.h" #include "platform/CCCommon.h" diff --git a/cocos/editor-support/cocosbuilder/Android.mk b/cocos/editor-support/cocosbuilder/Android.mk new file mode 100644 index 0000000000..dd6b2b3b77 --- /dev/null +++ b/cocos/editor-support/cocosbuilder/Android.mk @@ -0,0 +1,48 @@ +LOCAL_PATH := $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_MODULE := cocosbuilder_static + +LOCAL_MODULE_FILENAME := libcocosbuilder + +LOCAL_SRC_FILES := CCBAnimationManager.cpp \ +CCBFileLoader.cpp \ +CCBKeyframe.cpp \ +CCBReader.cpp \ +CCBSequence.cpp \ +CCBSequenceProperty.cpp \ +CCBValue.cpp \ +CCControlButtonLoader.cpp \ +CCControlLoader.cpp \ +CCLabelBMFontLoader.cpp \ +CCLabelTTFLoader.cpp \ +CCLayerColorLoader.cpp \ +CCLayerGradientLoader.cpp \ +CCLayerLoader.cpp \ +CCMenuItemImageLoader.cpp \ +CCMenuItemLoader.cpp \ +CCNode+CCBRelativePositioning.cpp \ +CCNodeLoader.cpp \ +CCNodeLoaderLibrary.cpp \ +CCParticleSystemQuadLoader.cpp \ +CCScale9SpriteLoader.cpp \ +CCScrollViewLoader.cpp \ +CCSpriteLoader.cpp + +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/ \ +$(LOCAL_PATH)/../../.. + +LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../2d \ +$(LOCAL_PATH) \ +$(LOCAL_PATH)/../../.. + +LOCAL_CFLAGS += -Wno-psabi +LOCAL_EXPORT_CFLAGS += -Wno-psabi + +LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static + +include $(BUILD_STATIC_LIBRARY) + +$(call import-module,2d) +$(call import-module,extensions) diff --git a/cocos/editor-support/cocosbuilder/CCBAnimationManager.cpp b/cocos/editor-support/cocosbuilder/CCBAnimationManager.cpp index 819986e00a..13b039dcac 100644 --- a/cocos/editor-support/cocosbuilder/CCBAnimationManager.cpp +++ b/cocos/editor-support/cocosbuilder/CCBAnimationManager.cpp @@ -11,8 +11,9 @@ using namespace cocos2d; using namespace std; +using namespace cocos2d::extension; -NS_CC_EXT_BEGIN +namespace cocosbuilder { // Implementation of CCBAinmationManager @@ -1292,4 +1293,4 @@ void CCBEaseInstant::update(float dt) } -NS_CC_EXT_END +} diff --git a/cocos/editor-support/cocosbuilder/CCBAnimationManager.h b/cocos/editor-support/cocosbuilder/CCBAnimationManager.h index ca679ee1e9..83d962ffef 100644 --- a/cocos/editor-support/cocosbuilder/CCBAnimationManager.h +++ b/cocos/editor-support/cocosbuilder/CCBAnimationManager.h @@ -6,9 +6,9 @@ #include "CCBSequence.h" #include "CCBValue.h" #include "CCBSequenceProperty.h" -#include "GUI/CCControlExtension/CCControl.h" +#include "extensions/GUI/CCControlExtension/CCControl.h" -NS_CC_EXT_BEGIN +namespace cocosbuilder { class CCBAnimationManagerDelegate { @@ -16,7 +16,7 @@ public: virtual void completedAnimationSequenceNamed(const char *name) = 0; }; -class CCBAnimationManager : public Object +class CCBAnimationManager : public cocos2d::Object { public: bool _jsControlled; @@ -31,54 +31,54 @@ public: ~CCBAnimationManager(); - Object *_owner; + cocos2d::Object *_owner; virtual bool init(); - Array* getSequences(); - void setSequences(Array* seq); + cocos2d::Array* getSequences(); + void setSequences(cocos2d::Array* seq); int getAutoPlaySequenceId(); void setAutoPlaySequenceId(int autoPlaySequenceId); - Node* getRootNode(); - void setRootNode(Node* pRootNode); // weak reference + cocos2d::Node* getRootNode(); + void setRootNode(cocos2d::Node* pRootNode); // weak reference - void addDocumentCallbackNode(Node *node); + void addDocumentCallbackNode(cocos2d::Node *node); void addDocumentCallbackName(std::string name); - void addDocumentCallbackControlEvents(Control::EventType eventType); + void addDocumentCallbackControlEvents(cocos2d::extension::Control::EventType eventType); - void addDocumentOutletNode(Node *node); + void addDocumentOutletNode(cocos2d::Node *node); void addDocumentOutletName(std::string name); void setDocumentControllerName(const std::string &name); std::string getDocumentControllerName(); - Array* getDocumentCallbackNames(); - Array* getDocumentCallbackNodes(); - Array* getDocumentCallbackControlEvents(); + cocos2d::Array* getDocumentCallbackNames(); + cocos2d::Array* getDocumentCallbackNodes(); + cocos2d::Array* getDocumentCallbackControlEvents(); - Array* getDocumentOutletNames(); - Array* getDocumentOutletNodes(); + cocos2d::Array* getDocumentOutletNames(); + cocos2d::Array* getDocumentOutletNodes(); std::string getLastCompletedSequenceName(); - Array* getKeyframeCallbacks(); + cocos2d::Array* getKeyframeCallbacks(); - const Size& getRootContainerSize(); - void setRootContainerSize(const Size &rootContainerSize); + const cocos2d::Size& getRootContainerSize(); + void setRootContainerSize(const cocos2d::Size &rootContainerSize); CCBAnimationManagerDelegate* getDelegate(); void setDelegate(CCBAnimationManagerDelegate* pDelegate); // retain const char* getRunningSequenceName(); - const Size& getContainerSize(Node* pNode); + const cocos2d::Size& getContainerSize(cocos2d::Node* pNode); - void addNode(Node *pNode, Dictionary *pSeq); - void setBaseValue(Object *pValue, Node *pNode, const char *propName); - void moveAnimationsFromNode(Node* fromNode, Node* toNode); + void addNode(cocos2d::Node *pNode, cocos2d::Dictionary *pSeq); + void setBaseValue(cocos2d::Object *pValue, cocos2d::Node *pNode, const char *propName); + void moveAnimationsFromNode(cocos2d::Node* fromNode, cocos2d::Node* toNode); /** @deprecated This interface will be deprecated sooner or later.*/ CC_DEPRECATED_ATTRIBUTE void runAnimations(const char *pName, float fTweenDuration); @@ -94,16 +94,16 @@ public: * when this function bound to js ,the second param are callfunc_selector * @lua NA */ - void setAnimationCompletedCallback(Object *target, SEL_CallFunc callbackFunc); + void setAnimationCompletedCallback(cocos2d::Object *target, cocos2d::SEL_CallFunc callbackFunc); void debug(); /** * @js setCallFuncForJSCallbackNamed */ - void setCallFunc(CallFunc *callFunc, const std::string &callbackNamed); + void setCallFunc(cocos2d::CallFunc *callFunc, const std::string &callbackNamed); - Object* actionForCallbackChannel(CCBSequenceProperty* channel); - Object* actionForSoundChannel(CCBSequenceProperty* channel); + cocos2d::Object* actionForCallbackChannel(CCBSequenceProperty* channel); + cocos2d::Object* actionForSoundChannel(CCBSequenceProperty* channel); // return -1 if timeline not exsit int getSequenceId(const char* pSequenceName); @@ -112,55 +112,55 @@ public: float getSequenceDuration(const char* pSequenceName); private: - Object* getBaseValue(Node *pNode, const char* propName); + cocos2d::Object* getBaseValue(cocos2d::Node *pNode, const char* propName); CCBSequence* getSequence(int nSequenceId); - ActionInterval* getAction(CCBKeyframe *pKeyframe0, CCBKeyframe *pKeyframe1, const char *propName, Node *pNode); - void setAnimatedProperty(const char *propName, Node *pNode, Object *pValue, float fTweenDuraion); - void setFirstFrame(Node *pNode, CCBSequenceProperty *pSeqProp, float fTweenDuration); - ActionInterval* getEaseAction(ActionInterval *pAction, CCBKeyframe::EasingType easingType, float fEasingOpt); - void runAction(Node *pNode, CCBSequenceProperty *pSeqProp, float fTweenDuration); + cocos2d::ActionInterval* getAction(CCBKeyframe *pKeyframe0, CCBKeyframe *pKeyframe1, const char *propName, cocos2d::Node *pNode); + void setAnimatedProperty(const char *propName,cocos2d::Node *pNode, Object *pValue, float fTweenDuraion); + void setFirstFrame(cocos2d::Node *pNode, CCBSequenceProperty *pSeqProp, float fTweenDuration); + cocos2d::ActionInterval* getEaseAction(cocos2d::ActionInterval *pAction, CCBKeyframe::EasingType easingType, float fEasingOpt); + void runAction(cocos2d::Node *pNode, CCBSequenceProperty *pSeqProp, float fTweenDuration); void sequenceCompleted(); private: - Array *_sequences; - Dictionary *_nodeSequences; - Dictionary *_baseValues; + cocos2d::Array *_sequences; + cocos2d::Dictionary *_nodeSequences; + cocos2d::Dictionary *_baseValues; int _autoPlaySequenceId; - Node *_rootNode; + cocos2d::Node *_rootNode; - Size _rootContainerSize; + cocos2d::Size _rootContainerSize; CCBAnimationManagerDelegate *_delegate; CCBSequence *_runningSequence; - Array *_documentOutletNames; - Array *_documentOutletNodes; - Array *_documentCallbackNames; - Array *_documentCallbackNodes; - Array *_documentCallbackControlEvents; - Array *_keyframeCallbacks; - Dictionary *_keyframeCallFuncs; + cocos2d::Array *_documentOutletNames; + cocos2d::Array *_documentOutletNodes; + cocos2d::Array *_documentCallbackNames; + cocos2d::Array *_documentCallbackNodes; + cocos2d::Array *_documentCallbackControlEvents; + cocos2d::Array *_keyframeCallbacks; + cocos2d::Dictionary *_keyframeCallFuncs; std::string _documentControllerName; std::string _lastCompletedSequenceName; - SEL_CallFunc _animationCompleteCallbackFunc; - Object *_target; + cocos2d::SEL_CallFunc _animationCompleteCallbackFunc; + cocos2d::Object *_target; }; -class CCBSetSpriteFrame : public ActionInstant +class CCBSetSpriteFrame : public cocos2d::ActionInstant { public: /** creates a Place action with a position */ - static CCBSetSpriteFrame* create(SpriteFrame *pSpriteFrame); + static CCBSetSpriteFrame* create(cocos2d::SpriteFrame *pSpriteFrame); /** * @js NA * @lua NA */ ~CCBSetSpriteFrame(); - bool initWithSpriteFrame(SpriteFrame *pSpriteFrame); + bool initWithSpriteFrame(cocos2d::SpriteFrame *pSpriteFrame); // Overrides virtual void update(float time) override; @@ -168,11 +168,11 @@ public: virtual CCBSetSpriteFrame* reverse() const override; private: - SpriteFrame *_spriteFrame; + cocos2d::SpriteFrame *_spriteFrame; }; -class CCBSoundEffect : public ActionInstant +class CCBSoundEffect : public cocos2d::ActionInstant { public: static CCBSoundEffect* actionWithSoundFile(const std::string &file, float pitch, float pan, float gain); @@ -194,7 +194,7 @@ private: }; -class CCBRotateTo : public ActionInterval +class CCBRotateTo : public cocos2d::ActionInterval { public: static CCBRotateTo* create(float fDuration, float fAngle); @@ -204,7 +204,7 @@ public: virtual void update(float time) override; virtual CCBRotateTo* clone() const override; virtual CCBRotateTo* reverse() const override; - virtual void startWithTarget(Node *pNode) override; + virtual void startWithTarget(cocos2d::Node *pNode) override; private: float _startAngle; @@ -213,14 +213,14 @@ private: }; -class CCBRotateXTo: public ActionInterval +class CCBRotateXTo: public cocos2d::ActionInterval { public: static CCBRotateXTo* create(float fDuration, float fAngle); bool initWithDuration(float fDuration, float fAngle); // Overrides - virtual void startWithTarget(Node *pNode) override; + virtual void startWithTarget(cocos2d::Node *pNode) override; virtual CCBRotateXTo* clone() const override; virtual CCBRotateXTo* reverse() const override; virtual void update(float time) override; @@ -232,14 +232,14 @@ private: }; -class CCBRotateYTo: public ActionInterval +class CCBRotateYTo: public cocos2d::ActionInterval { public: static CCBRotateYTo* create(float fDuration, float fAngle); bool initWithDuration(float fDuration, float fAngle); // Override - virtual void startWithTarget(Node *pNode) override; + virtual void startWithTarget(cocos2d::Node *pNode) override; virtual CCBRotateYTo* clone() const override; virtual CCBRotateYTo* reverse() const override; virtual void update(float time) override; @@ -251,10 +251,10 @@ private: }; -class CCBEaseInstant : public ActionEase +class CCBEaseInstant : public cocos2d::ActionEase { public: - static CCBEaseInstant* create(ActionInterval *pAction); + static CCBEaseInstant* create(cocos2d::ActionInterval *pAction); virtual CCBEaseInstant* clone() const override; virtual CCBEaseInstant* reverse() const override; @@ -262,6 +262,6 @@ public: }; -NS_CC_EXT_END +} #endif // __CCB_CCBANIMATION_MANAGER_H__ diff --git a/cocos/editor-support/cocosbuilder/CCBFileLoader.cpp b/cocos/editor-support/cocosbuilder/CCBFileLoader.cpp index 12af936847..549b369f4e 100644 --- a/cocos/editor-support/cocosbuilder/CCBFileLoader.cpp +++ b/cocos/editor-support/cocosbuilder/CCBFileLoader.cpp @@ -1,8 +1,9 @@ #include "CCBFileLoader.h" +using namespace cocos2d; -NS_CC_EXT_BEGIN +namespace cocosbuilder { #define PROPERTY_CCBFILE "ccbFile" @@ -14,4 +15,4 @@ void CCBFileLoader::onHandlePropTypeCCBFile(Node * pNode, Node * pParent, const } } -NS_CC_EXT_END +} diff --git a/cocos/editor-support/cocosbuilder/CCBFileLoader.h b/cocos/editor-support/cocosbuilder/CCBFileLoader.h index aa2aeff982..51e675b00e 100644 --- a/cocos/editor-support/cocosbuilder/CCBFileLoader.h +++ b/cocos/editor-support/cocosbuilder/CCBFileLoader.h @@ -4,7 +4,7 @@ #include "CCNodeLoader.h" #include "CCBReader.h" -NS_CC_EXT_BEGIN +namespace cocosbuilder { /* Forward declaration. */ class CCBReader; @@ -25,9 +25,9 @@ class CCBFileLoader : public NodeLoader { protected: CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(CCBFile); - virtual void onHandlePropTypeCCBFile(Node * pNode, Node * pParent, const char * pPropertyName, Node * pCCBFileNode, CCBReader * ccbReader); + virtual void onHandlePropTypeCCBFile(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Node * pCCBFileNode, CCBReader * ccbReader); }; -NS_CC_EXT_END +} #endif diff --git a/cocos/editor-support/cocosbuilder/CCBKeyframe.cpp b/cocos/editor-support/cocosbuilder/CCBKeyframe.cpp index d2f3c5dc87..e2f97806b0 100644 --- a/cocos/editor-support/cocosbuilder/CCBKeyframe.cpp +++ b/cocos/editor-support/cocosbuilder/CCBKeyframe.cpp @@ -2,7 +2,7 @@ using namespace cocos2d; -NS_CC_EXT_BEGIN +namespace cocosbuilder { CCBKeyframe::CCBKeyframe() : _value(NULL) @@ -58,4 +58,4 @@ void CCBKeyframe::setEasingOpt(float fEasingOpt) _easingOpt = fEasingOpt; } -NS_CC_EXT_END +} diff --git a/cocos/editor-support/cocosbuilder/CCBKeyframe.h b/cocos/editor-support/cocosbuilder/CCBKeyframe.h index 925e8bd23d..706ab32efc 100644 --- a/cocos/editor-support/cocosbuilder/CCBKeyframe.h +++ b/cocos/editor-support/cocosbuilder/CCBKeyframe.h @@ -2,11 +2,10 @@ #define __CCB_KEYFRAME_H__ #include "cocos2d.h" -#include "ExtensionMacros.h" -NS_CC_EXT_BEGIN +namespace cocosbuilder { -class CCBKeyframe : public Object +class CCBKeyframe : public cocos2d::Object { public: enum class EasingType @@ -41,8 +40,8 @@ public: */ ~CCBKeyframe(); - Object* getValue(); - void setValue(Object *pValue); // retain + cocos2d::Object* getValue(); + void setValue(cocos2d::Object *pValue); // retain float getTime(); void setTime(float fTime); @@ -54,12 +53,12 @@ public: void setEasingOpt(float fEasingOpt); private: - Object *_value; + cocos2d::Object *_value; float _time; EasingType _easingType; float _easingOpt; }; -NS_CC_EXT_END +} #endif // __CCB_KEYFRAME_H__ diff --git a/cocos/editor-support/cocosbuilder/CCBMemberVariableAssigner.h b/cocos/editor-support/cocosbuilder/CCBMemberVariableAssigner.h index 940d300c45..044f3e5059 100644 --- a/cocos/editor-support/cocosbuilder/CCBMemberVariableAssigner.h +++ b/cocos/editor-support/cocosbuilder/CCBMemberVariableAssigner.h @@ -4,7 +4,7 @@ #include "cocos2d.h" #include "CCBValue.h" -NS_CC_EXT_BEGIN +namespace cocosbuilder { #define CCB_MEMBERVARIABLEASSIGNER_GLUE(TARGET, MEMBERVARIABLENAME, MEMBERVARIABLETYPE, MEMBERVARIABLE) \ if (pTarget == TARGET && 0 == strcmp(pMemberVariableName, (MEMBERVARIABLENAME))) { \ @@ -41,7 +41,7 @@ class CCBMemberVariableAssigner { * @param node The member variable. * @return Whether the assignment was successful. */ - virtual bool onAssignCCBMemberVariable(Object* target, const char* memberVariableName, Node* node) = 0; + virtual bool onAssignCCBMemberVariable(cocos2d::Object* target, const char* memberVariableName, cocos2d::Node* node) = 0; /** * The callback function of assigning custom properties. @@ -51,9 +51,9 @@ class CCBMemberVariableAssigner { * @param value The value of the property. * @return Whether the assignment was successful. */ - virtual bool onAssignCCBCustomProperty(Object* target, const char* memberVariableName, CCBValue* value) { return false; }; + virtual bool onAssignCCBCustomProperty(cocos2d::Object* target, const char* memberVariableName, CCBValue* value) { return false; }; }; -NS_CC_EXT_END +} #endif diff --git a/cocos/editor-support/cocosbuilder/CCBReader.cpp b/cocos/editor-support/cocosbuilder/CCBReader.cpp index 7397489fc9..d2f57ecf88 100644 --- a/cocos/editor-support/cocosbuilder/CCBReader.cpp +++ b/cocos/editor-support/cocosbuilder/CCBReader.cpp @@ -15,8 +15,10 @@ #include using namespace std; +using namespace cocos2d; +using namespace cocos2d::extension; -NS_CC_EXT_BEGIN; +namespace cocosbuilder {; /************************************************************************* Implementation of CCBFile @@ -1108,4 +1110,4 @@ void CCBReader::setResolutionScale(float scale) __ccbResolutionScale = scale; } -NS_CC_EXT_END; +}; diff --git a/cocos/editor-support/cocosbuilder/CCBReader.h b/cocos/editor-support/cocosbuilder/CCBReader.h index e3423a0736..211ea18de4 100644 --- a/cocos/editor-support/cocosbuilder/CCBReader.h +++ b/cocos/editor-support/cocosbuilder/CCBReader.h @@ -2,11 +2,10 @@ #define _CCB_CCBREADER_H_ #include "cocos2d.h" -#include "ExtensionMacros.h" #include #include #include "CCBSequence.h" -#include "GUI/CCControlExtension/CCControl.h" +#include "extensions/GUI/CCControlExtension/CCControl.h" #define CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(T, METHOD) static T * METHOD() { \ T * ptr = new T(); \ @@ -30,24 +29,24 @@ #define CCB_VERSION 5 -NS_CC_EXT_BEGIN +namespace cocosbuilder { /** * @addtogroup cocosbuilder * @{ */ -class CCBFile : public Node +class CCBFile : public cocos2d::Node { private: - Node *_CCBFileNode; + cocos2d::Node *_CCBFileNode; public: CCBFile(); static CCBFile* create(); - Node* getCCBFileNode(); + cocos2d::Node* getCCBFileNode(); void setCCBFileNode(Node *pNode); // retain }; @@ -63,7 +62,7 @@ class CCBKeyframe; /** * @brief Parse CCBI file which is generated by CocosBuilder */ -class CCBReader : public Object +class CCBReader : public cocos2d::Object { public: enum class PropertyType { @@ -167,27 +166,27 @@ public: void setCCBRootPath(const char* ccbRootPath); const std::string& getCCBRootPath() const; - Node* readNodeGraphFromFile(const char *pCCBFileName); - Node* readNodeGraphFromFile(const char *pCCBFileName, Object *pOwner); - Node* readNodeGraphFromFile(const char *pCCBFileName, Object *pOwner, const Size &parentSize); + cocos2d::Node* readNodeGraphFromFile(const char *pCCBFileName); + cocos2d::Node* readNodeGraphFromFile(const char *pCCBFileName, cocos2d::Object *pOwner); + cocos2d::Node* readNodeGraphFromFile(const char *pCCBFileName, cocos2d::Object *pOwner, const cocos2d::Size &parentSize); /** * @js NA * @lua NA */ - Node* readNodeGraphFromData(Data *pData, Object *pOwner, const Size &parentSize); + cocos2d::Node* readNodeGraphFromData(cocos2d::Data *pData, cocos2d::Object *pOwner, const cocos2d::Size &parentSize); /** @lua NA */ - Scene* createSceneWithNodeGraphFromFile(const char *pCCBFileName); + cocos2d::Scene* createSceneWithNodeGraphFromFile(const char *pCCBFileName); /** @lua NA */ - Scene* createSceneWithNodeGraphFromFile(const char *pCCBFileName, Object *pOwner); + cocos2d::Scene* createSceneWithNodeGraphFromFile(const char *pCCBFileName, cocos2d::Object *pOwner); /** @lua NA */ - Scene* createSceneWithNodeGraphFromFile(const char *pCCBFileName, Object *pOwner, const Size &parentSize); + cocos2d::Scene* createSceneWithNodeGraphFromFile(const char *pCCBFileName, cocos2d::Object *pOwner, const cocos2d::Size &parentSize); /** * @js NA @@ -225,7 +224,7 @@ public: * @js NA * @lua NA */ - Object* getOwner(); + cocos2d::Object* getOwner(); /* Utility methods. * @js NA @@ -283,24 +282,24 @@ public: bool readCallbackKeyframesForSeq(CCBSequence* seq); bool readSoundKeyframesForSeq(CCBSequence* seq); - Array* getOwnerCallbackNames(); - Array* getOwnerCallbackNodes(); - Array* getOwnerCallbackControlEvents(); + cocos2d::Array* getOwnerCallbackNames(); + cocos2d::Array* getOwnerCallbackNodes(); + cocos2d::Array* getOwnerCallbackControlEvents(); - Array* getOwnerOutletNames(); - Array* getOwnerOutletNodes(); - Array* getNodesWithAnimationManagers(); - Array* getAnimationManagersForNodes(); + cocos2d::Array* getOwnerOutletNames(); + cocos2d::Array* getOwnerOutletNodes(); + cocos2d::Array* getNodesWithAnimationManagers(); + cocos2d::Array* getAnimationManagersForNodes(); /** * @js NA * @lua NA */ - Dictionary* getAnimationManagers(); + cocos2d::Dictionary* getAnimationManagers(); /** * @js NA * @lua NA */ - void setAnimationManagers(Dictionary* x); // weak reference + void setAnimationManagers(cocos2d::Dictionary* x); // weak reference /** * @js NA * @lua NA @@ -310,8 +309,8 @@ public: * @js NA * @lua NA */ - void addOwnerCallbackNode(Node *node); - void addOwnerCallbackControlEvents(Control::EventType type); + void addOwnerCallbackNode(cocos2d::Node *node); + void addOwnerCallbackControlEvents(cocos2d::extension::Control::EventType type); /** * @js NA * @lua NA @@ -321,8 +320,8 @@ public: * @js NA * @lua NA */ - void addDocumentCallbackNode(Node *node); - void addDocumentCallbackControlEvents(Control::EventType eventType); + void addDocumentCallbackNode(cocos2d::Node *node); + void addDocumentCallbackControlEvents(cocos2d::extension::Control::EventType eventType); /** * @js NA * @lua NA @@ -333,21 +332,21 @@ public: * @js NA * @lua NA */ - Node* readFileWithCleanUp(bool bCleanUp, Dictionary* am); + cocos2d::Node* readFileWithCleanUp(bool bCleanUp, cocos2d::Dictionary* am); void addOwnerOutletName(std::string name); - void addOwnerOutletNode(Node *node); + void addOwnerOutletNode(cocos2d::Node *node); private: - void cleanUpNodeGraph(Node *pNode); + void cleanUpNodeGraph(cocos2d::Node *pNode); bool readSequences(); CCBKeyframe* readKeyframe(PropertyType type); bool readHeader(); bool readStringCache(); //void readStringCacheEntry(); - Node* readNodeGraph(); - Node* readNodeGraph(Node * pParent); + cocos2d::Node* readNodeGraph(); + cocos2d::Node* readNodeGraph(cocos2d::Node * pParent); bool getBit(); void alignBits(); @@ -357,7 +356,7 @@ private: friend class NodeLoader; private: - Data *_data; + cocos2d::Data *_data; unsigned char *_bytes; int _currentByte; int _currentBit; @@ -365,10 +364,10 @@ private: std::vector _stringCache; std::set _loadedSpriteSheets; - Object *_owner; + cocos2d::Object *_owner; CCBAnimationManager *_actionManager; //retain - Dictionary* _actionManagers; + cocos2d::Dictionary* _actionManagers; std::set *_animatedProps; @@ -378,13 +377,13 @@ private: CCBSelectorResolver *_CCBSelectorResolver; std::vector _ownerOutletNames; - Array* _ownerOutletNodes; - Array* _nodesWithAnimationManagers; - Array* _animationManagersForNodes; + cocos2d::Array* _ownerOutletNodes; + cocos2d::Array* _nodesWithAnimationManagers; + cocos2d::Array* _animationManagersForNodes; std::vector _ownerCallbackNames; - Array* _ownerCallbackNodes; - Array* _ownerOwnerCallbackControlEvents; + cocos2d::Array* _ownerCallbackNodes; + cocos2d::Array* _ownerOwnerCallbackControlEvents; std::string _CCBRootPath; bool _jsControlled; @@ -393,6 +392,6 @@ private: // end of effects group /// @} -NS_CC_EXT_END +} #endif diff --git a/cocos/editor-support/cocosbuilder/CCBSelectorResolver.h b/cocos/editor-support/cocosbuilder/CCBSelectorResolver.h index 94ea8d333b..f054c284c5 100644 --- a/cocos/editor-support/cocosbuilder/CCBSelectorResolver.h +++ b/cocos/editor-support/cocosbuilder/CCBSelectorResolver.h @@ -2,11 +2,10 @@ #define _CCB_CCBSELECTORRESOLVER_H_ #include "cocos2d.h" -#include "ExtensionMacros.h" -#include "../GUI/CCControlExtension/CCInvocation.h" +#include "extensions//GUI/CCControlExtension/CCInvocation.h" -NS_CC_EXT_BEGIN +namespace cocosbuilder { #define CCB_SELECTORRESOLVER_CCMENUITEM_GLUE(TARGET, SELECTORNAME, METHOD) if(pTarget == TARGET && strcmp(pSelectorName, SELECTORNAME) == 0) { \ return menu_selector(METHOD); \ @@ -27,9 +26,9 @@ class CCBSelectorResolver { * @lua NA */ virtual ~CCBSelectorResolver() {}; - virtual SEL_MenuHandler onResolveCCBCCMenuItemSelector(Object * pTarget, const char* pSelectorName) = 0; - virtual SEL_CallFuncN onResolveCCBCCCallFuncSelector(Object * pTarget, const char* pSelectorName) { return NULL; }; - virtual Control::Handler onResolveCCBCCControlSelector(Object * pTarget, const char* pSelectorName) = 0; + virtual cocos2d::SEL_MenuHandler onResolveCCBCCMenuItemSelector(cocos2d::Object * pTarget, const char* pSelectorName) = 0; + virtual cocos2d::SEL_CallFuncN onResolveCCBCCCallFuncSelector(cocos2d::Object * pTarget, const char* pSelectorName) { return NULL; }; + virtual cocos2d::extension::Control::Handler onResolveCCBCCControlSelector(cocos2d::Object * pTarget, const char* pSelectorName) = 0; }; @@ -43,6 +42,6 @@ public: virtual CCBSelectorResolver * createNew() = 0; }; -NS_CC_EXT_END +} #endif diff --git a/cocos/editor-support/cocosbuilder/CCBSequence.cpp b/cocos/editor-support/cocosbuilder/CCBSequence.cpp index 07e8d96189..20a7c49ab0 100644 --- a/cocos/editor-support/cocosbuilder/CCBSequence.cpp +++ b/cocos/editor-support/cocosbuilder/CCBSequence.cpp @@ -4,7 +4,7 @@ using namespace cocos2d; using namespace std; -NS_CC_EXT_BEGIN +namespace cocosbuilder { CCBSequence::CCBSequence() : _duration(0.0f) @@ -86,4 +86,4 @@ void CCBSequence::setChainedSequenceId(int nChainedSequenceId) mChainedSequenceId = nChainedSequenceId; } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/editor-support/cocosbuilder/CCBSequence.h b/cocos/editor-support/cocosbuilder/CCBSequence.h index 5fd8739f34..dd7c1a899f 100644 --- a/cocos/editor-support/cocosbuilder/CCBSequence.h +++ b/cocos/editor-support/cocosbuilder/CCBSequence.h @@ -3,12 +3,11 @@ #include #include "cocos2d.h" -#include "ExtensionMacros.h" #include "CCBSequenceProperty.h" -NS_CC_EXT_BEGIN +namespace cocosbuilder { -class CCBSequence : public Object +class CCBSequence : public cocos2d::Object { public: CCBSequence(); @@ -45,7 +44,7 @@ private: }; -NS_CC_EXT_END +} #endif // __CCB_CCSEQUENCE_H__ diff --git a/cocos/editor-support/cocosbuilder/CCBSequenceProperty.cpp b/cocos/editor-support/cocosbuilder/CCBSequenceProperty.cpp index bd308d64e5..a091adaad1 100644 --- a/cocos/editor-support/cocosbuilder/CCBSequenceProperty.cpp +++ b/cocos/editor-support/cocosbuilder/CCBSequenceProperty.cpp @@ -3,7 +3,7 @@ using namespace cocos2d; using namespace std; -NS_CC_EXT_BEGIN +namespace cocosbuilder { CCBSequenceProperty::CCBSequenceProperty() : _name("") @@ -50,4 +50,4 @@ Array* CCBSequenceProperty::getKeyframes() return _keyframes; } -NS_CC_EXT_END +} diff --git a/cocos/editor-support/cocosbuilder/CCBSequenceProperty.h b/cocos/editor-support/cocosbuilder/CCBSequenceProperty.h index 4fd0767ab0..cd097c2356 100644 --- a/cocos/editor-support/cocosbuilder/CCBSequenceProperty.h +++ b/cocos/editor-support/cocosbuilder/CCBSequenceProperty.h @@ -2,12 +2,11 @@ #define __CCB_SEQUENCE_PROPERTY_H__ #include "cocos2d.h" -#include "ExtensionMacros.h" #include "CCBKeyframe.h" -NS_CC_EXT_BEGIN +namespace cocosbuilder { -class CCBSequenceProperty : public Object +class CCBSequenceProperty : public cocos2d::Object { public: /** @@ -28,14 +27,14 @@ public: int getType(); void setType(int type); - Array* getKeyframes(); + cocos2d::Array* getKeyframes(); private: std::string _name; int _type; - Array *_keyframes; + cocos2d::Array *_keyframes; }; -NS_CC_EXT_END +} #endif // __CCB_SEQUENCE_PROPERTY_H__ diff --git a/cocos/editor-support/cocosbuilder/CCBValue.cpp b/cocos/editor-support/cocosbuilder/CCBValue.cpp index 051100383d..f9a7547102 100644 --- a/cocos/editor-support/cocosbuilder/CCBValue.cpp +++ b/cocos/editor-support/cocosbuilder/CCBValue.cpp @@ -1,6 +1,8 @@ #include "CCBValue.h" -NS_CC_EXT_BEGIN +using namespace cocos2d; + +namespace cocosbuilder { // Implementation of Color3BWapper @@ -154,4 +156,4 @@ CCBValue::Type CCBValue::getType() return _type; } -NS_CC_EXT_END +} diff --git a/cocos/editor-support/cocosbuilder/CCBValue.h b/cocos/editor-support/cocosbuilder/CCBValue.h index 267ed5809a..0d05cb6a69 100644 --- a/cocos/editor-support/cocosbuilder/CCBValue.h +++ b/cocos/editor-support/cocosbuilder/CCBValue.h @@ -2,28 +2,27 @@ #define __CCB_VALUE_H__ #include "cocos2d.h" -#include "ExtensionMacros.h" /* These classes are wrapper of basic types, such as Color3B */ -NS_CC_EXT_BEGIN +namespace cocosbuilder { -class Color3BWapper : public Object +class Color3BWapper : public cocos2d::Object { public: - static Color3BWapper* create(const Color3B& color); + static Color3BWapper* create(const cocos2d::Color3B& color); - const Color3B& getColor() const; + const cocos2d::Color3B& getColor() const; private: - Color3B color; + cocos2d::Color3B color; }; -class CCBValue : public Object +class CCBValue : public cocos2d::Object { public: @@ -42,7 +41,7 @@ public: static CCBValue* create(float fValue); static CCBValue* create(unsigned char byte); static CCBValue* create(const char* pStr); - static CCBValue* create(Array* pArr); + static CCBValue* create(cocos2d::Array* pArr); int getIntValue(); @@ -50,7 +49,7 @@ public: bool getBoolValue(); unsigned char getByteValue(); const char* getStringValue(); - Array *getArrayValue(); + cocos2d::Array *getArrayValue(); Type getType(); @@ -62,10 +61,10 @@ private: } _value; std::string _strValue; - Array* _arrValue; + cocos2d::Array* _arrValue; Type _type; }; -NS_CC_EXT_END +} #endif // __CCB_VALUE_H__ diff --git a/cocos/editor-support/cocosbuilder/CCControlButtonLoader.cpp b/cocos/editor-support/cocosbuilder/CCControlButtonLoader.cpp index 6b76adf3ec..c72b9723a2 100644 --- a/cocos/editor-support/cocosbuilder/CCControlButtonLoader.cpp +++ b/cocos/editor-support/cocosbuilder/CCControlButtonLoader.cpp @@ -1,7 +1,9 @@ #include "CCControlButtonLoader.h" +using namespace cocos2d; +using namespace cocos2d::extension; -NS_CC_EXT_BEGIN; +namespace cocosbuilder {; #define PROPERTY_ZOOMONTOUCHDOWN "zoomOnTouchDown" #define PROPERTY_TITLE_NORMAL "title|1" @@ -112,4 +114,4 @@ void ControlButtonLoader::onHandlePropTypeColor3(Node * pNode, Node * pParent, c } } -NS_CC_EXT_END; \ No newline at end of file +}; \ No newline at end of file diff --git a/cocos/editor-support/cocosbuilder/CCControlButtonLoader.h b/cocos/editor-support/cocosbuilder/CCControlButtonLoader.h index 601e61c4d6..c6d420a161 100644 --- a/cocos/editor-support/cocosbuilder/CCControlButtonLoader.h +++ b/cocos/editor-support/cocosbuilder/CCControlButtonLoader.h @@ -2,9 +2,9 @@ #define _CCB_CCCONTROLBUTTONLOADER_H_ #include "CCControlLoader.h" -#include "../GUI/CCControlExtension/CCControlButton.h" +#include "extensions//GUI/CCControlExtension/CCControlButton.h" -NS_CC_EXT_BEGIN +namespace cocosbuilder { /* Forward declaration. */ class CCBReader; @@ -23,18 +23,18 @@ class ControlButtonLoader : public ControlLoader { CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(ControlButtonLoader, loader); protected: - CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(ControlButton); + CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(cocos2d::extension::ControlButton); - virtual void onHandlePropTypeCheck(Node * pNode, Node * pParent, const char * pPropertyName, bool pCheck, CCBReader * ccbReader); - virtual void onHandlePropTypeString(Node * pNode, Node * pParent, const char * pPropertyName, const char * pString, CCBReader * ccbReader); - virtual void onHandlePropTypeFontTTF(Node * pNode, Node * pParent, const char * pPropertyName, const char * pFontTTF, CCBReader * ccbReader); - virtual void onHandlePropTypeFloatScale(Node * pNode, Node * pParent, const char * pPropertyName, float pFloatScale, CCBReader * ccbReader); - virtual void onHandlePropTypePoint(Node * pNode, Node * pParent, const char * pPropertyName, Point pPoint, CCBReader * ccbReader); - virtual void onHandlePropTypeSize(Node * pNode, Node * pParent, const char * pPropertyName, Size pSize, CCBReader * ccbReader); - virtual void onHandlePropTypeSpriteFrame(Node * pNode, Node * pParent, const char * pPropertyName, SpriteFrame * pSpriteFrame, CCBReader * ccbReader); - virtual void onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, Color3B pColor3B, CCBReader * ccbReader); + virtual void onHandlePropTypeCheck(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, bool pCheck, CCBReader * ccbReader); + virtual void onHandlePropTypeString(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, const char * pString, CCBReader * ccbReader); + virtual void onHandlePropTypeFontTTF(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, const char * pFontTTF, CCBReader * ccbReader); + virtual void onHandlePropTypeFloatScale(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, float pFloatScale, CCBReader * ccbReader); + virtual void onHandlePropTypePoint(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Point pPoint, CCBReader * ccbReader); + virtual void onHandlePropTypeSize(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Size pSize, CCBReader * ccbReader); + virtual void onHandlePropTypeSpriteFrame(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::SpriteFrame * pSpriteFrame, CCBReader * ccbReader); + virtual void onHandlePropTypeColor3(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Color3B pColor3B, CCBReader * ccbReader); }; -NS_CC_EXT_END +} #endif diff --git a/cocos/editor-support/cocosbuilder/CCControlLoader.cpp b/cocos/editor-support/cocosbuilder/CCControlLoader.cpp index aff1fd2f11..9125f8d193 100644 --- a/cocos/editor-support/cocosbuilder/CCControlLoader.cpp +++ b/cocos/editor-support/cocosbuilder/CCControlLoader.cpp @@ -1,7 +1,9 @@ #include "CCControlLoader.h" +using namespace cocos2d; +using namespace cocos2d::extension; -NS_CC_EXT_BEGIN +namespace cocosbuilder { #define PROPERTY_ENABLED "enabled" #define PROPERTY_SELECTED "selected" @@ -25,4 +27,4 @@ void ControlLoader::onHandlePropTypeBlockControl(Node * pNode, Node * pParent, c } } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/editor-support/cocosbuilder/CCControlLoader.h b/cocos/editor-support/cocosbuilder/CCControlLoader.h index 07b1eaaa72..83e2306e39 100644 --- a/cocos/editor-support/cocosbuilder/CCControlLoader.h +++ b/cocos/editor-support/cocosbuilder/CCControlLoader.h @@ -2,9 +2,9 @@ #define _CCB_CCCONTROLLOADER_H_ #include "CCNodeLoader.h" -#include "../GUI/CCControlExtension/CCControl.h" +#include "extensions/GUI/CCControlExtension/CCControl.h" -NS_CC_EXT_BEGIN +namespace cocosbuilder { /* Forward declaration. */ class CCBReader; @@ -18,12 +18,12 @@ public: virtual ~ControlLoader() {}; protected: - CCB_PURE_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(Control); + CCB_PURE_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(cocos2d::extension::Control); - virtual void onHandlePropTypeBlockControl(Node * pNode, Node * pParent, const char * pPropertyName, BlockControlData * pBlockControlData, CCBReader * ccbReader); - virtual void onHandlePropTypeCheck(Node * pNode, Node * pParent, const char * pPropertyName, bool pCheck, CCBReader * ccbReader); + virtual void onHandlePropTypeBlockControl(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, BlockControlData * pBlockControlData, CCBReader * ccbReader); + virtual void onHandlePropTypeCheck(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, bool pCheck, CCBReader * ccbReader); }; -NS_CC_EXT_END +} #endif diff --git a/cocos/editor-support/cocosbuilder/CCLabelBMFontLoader.cpp b/cocos/editor-support/cocosbuilder/CCLabelBMFontLoader.cpp index 52230fb282..df96cccc77 100644 --- a/cocos/editor-support/cocosbuilder/CCLabelBMFontLoader.cpp +++ b/cocos/editor-support/cocosbuilder/CCLabelBMFontLoader.cpp @@ -1,8 +1,8 @@ #include "CCLabelBMFontLoader.h" +using namespace cocos2d; - -NS_CC_EXT_BEGIN +namespace cocosbuilder { #define PROPERTY_COLOR "color" #define PROPERTY_OPACITY "opacity" @@ -50,4 +50,4 @@ void LabelBMFontLoader::onHandlePropTypeText(Node * pNode, Node * pParent, const } } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/editor-support/cocosbuilder/CCLabelBMFontLoader.h b/cocos/editor-support/cocosbuilder/CCLabelBMFontLoader.h index a6027cb4af..ae5cb20011 100644 --- a/cocos/editor-support/cocosbuilder/CCLabelBMFontLoader.h +++ b/cocos/editor-support/cocosbuilder/CCLabelBMFontLoader.h @@ -3,7 +3,7 @@ #include "CCNodeLoader.h" -NS_CC_EXT_BEGIN +namespace cocosbuilder { /* Forward declaration. */ class CCBReader; @@ -18,15 +18,15 @@ public: CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(LabelBMFontLoader, loader); protected: - CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(LabelBMFont); + CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(cocos2d::LabelBMFont); - virtual void onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, Color3B pColor3B, CCBReader * ccbReader); - virtual void onHandlePropTypeByte(Node * pNode, Node * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * ccbReader); - virtual void onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char * pPropertyName, BlendFunc pBlendFunc, CCBReader * ccbReader); - virtual void onHandlePropTypeFntFile(Node * pNode, Node * pParent, const char * pPropertyName, const char* pFntFile, CCBReader * ccbReader); - virtual void onHandlePropTypeText(Node * pNode, Node * pParent, const char * pPropertyName, const char* pText, CCBReader * ccbReader); + virtual void onHandlePropTypeColor3(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Color3B pColor3B, CCBReader * ccbReader); + virtual void onHandlePropTypeByte(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * ccbReader); + virtual void onHandlePropTypeBlendFunc(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::BlendFunc pBlendFunc, CCBReader * ccbReader); + virtual void onHandlePropTypeFntFile(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, const char* pFntFile, CCBReader * ccbReader); + virtual void onHandlePropTypeText(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, const char* pText, CCBReader * ccbReader); }; -NS_CC_EXT_END +} #endif diff --git a/cocos/editor-support/cocosbuilder/CCLabelTTFLoader.cpp b/cocos/editor-support/cocosbuilder/CCLabelTTFLoader.cpp index 470698fd8a..2ed3010e1f 100644 --- a/cocos/editor-support/cocosbuilder/CCLabelTTFLoader.cpp +++ b/cocos/editor-support/cocosbuilder/CCLabelTTFLoader.cpp @@ -1,6 +1,6 @@ #include "CCLabelTTFLoader.h" - +using namespace cocos2d; #define PROPERTY_COLOR "color" #define PROPERTY_OPACITY "opacity" @@ -12,7 +12,7 @@ #define PROPERTY_STRING "string" #define PROPERTY_DIMENSIONS "dimensions" -NS_CC_EXT_BEGIN +namespace cocosbuilder { void LabelTTFLoader::onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, Color3B pColor3B, CCBReader * ccbReader) { if(strcmp(pPropertyName, PROPERTY_COLOR) == 0) { @@ -80,4 +80,4 @@ void LabelTTFLoader::onHandlePropTypeSize(Node * pNode, Node * pParent, const ch } } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/editor-support/cocosbuilder/CCLabelTTFLoader.h b/cocos/editor-support/cocosbuilder/CCLabelTTFLoader.h index d5405d34f0..de0ca00d42 100644 --- a/cocos/editor-support/cocosbuilder/CCLabelTTFLoader.h +++ b/cocos/editor-support/cocosbuilder/CCLabelTTFLoader.h @@ -3,7 +3,7 @@ #include "CCNodeLoader.h" -NS_CC_EXT_BEGIN +namespace cocosbuilder { /* Forward declaration. */ class CCBReader; @@ -18,18 +18,18 @@ public: CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(LabelTTFLoader, loader); protected: - CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(LabelTTF); + CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(cocos2d::LabelTTF); - virtual void onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, Color3B pColor3B, CCBReader * ccbReader); - virtual void onHandlePropTypeByte(Node * pNode, Node * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * ccbReader); - virtual void onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char * pPropertyName, BlendFunc pBlendFunc, CCBReader * ccbReader); - virtual void onHandlePropTypeFontTTF(Node * pNode, Node * pParent, const char * pPropertyName, const char * pFontTTF, CCBReader * ccbReader); - virtual void onHandlePropTypeText(Node * pNode, Node * pParent, const char * pPropertyName, const char * pText, CCBReader * ccbReader); - virtual void onHandlePropTypeFloatScale(Node * pNode, Node * pParent, const char * pPropertyName, float pFloatScale, CCBReader * ccbReader); - virtual void onHandlePropTypeIntegerLabeled(Node * pNode, Node * pParent, const char * pPropertyName, int pIntegerLabeled, CCBReader * ccbReader); - virtual void onHandlePropTypeSize(Node * pNode, Node * pParent, const char * pPropertyName, Size pSize, CCBReader * ccbReader); + virtual void onHandlePropTypeColor3(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Color3B pColor3B, CCBReader * ccbReader); + virtual void onHandlePropTypeByte(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * ccbReader); + virtual void onHandlePropTypeBlendFunc(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::BlendFunc pBlendFunc, CCBReader * ccbReader); + virtual void onHandlePropTypeFontTTF(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, const char * pFontTTF, CCBReader * ccbReader); + virtual void onHandlePropTypeText(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, const char * pText, CCBReader * ccbReader); + virtual void onHandlePropTypeFloatScale(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, float pFloatScale, CCBReader * ccbReader); + virtual void onHandlePropTypeIntegerLabeled(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, int pIntegerLabeled, CCBReader * ccbReader); + virtual void onHandlePropTypeSize(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Size pSize, CCBReader * ccbReader); }; -NS_CC_EXT_END +} #endif diff --git a/cocos/editor-support/cocosbuilder/CCLayerColorLoader.cpp b/cocos/editor-support/cocosbuilder/CCLayerColorLoader.cpp index abac77efdf..02c7f610ae 100644 --- a/cocos/editor-support/cocosbuilder/CCLayerColorLoader.cpp +++ b/cocos/editor-support/cocosbuilder/CCLayerColorLoader.cpp @@ -1,8 +1,8 @@ #include "CCLayerColorLoader.h" +using namespace cocos2d; - -NS_CC_EXT_BEGIN +namespace cocosbuilder { #define PROPERTY_COLOR "color" #define PROPERTY_OPACITY "opacity" @@ -32,4 +32,4 @@ void LayerColorLoader::onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, c } } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/editor-support/cocosbuilder/CCLayerColorLoader.h b/cocos/editor-support/cocosbuilder/CCLayerColorLoader.h index e9618ed075..acea8b64da 100644 --- a/cocos/editor-support/cocosbuilder/CCLayerColorLoader.h +++ b/cocos/editor-support/cocosbuilder/CCLayerColorLoader.h @@ -3,7 +3,7 @@ #include "CCLayerLoader.h" -NS_CC_EXT_BEGIN +namespace cocosbuilder { /* Forward declaration. */ class CCBReader; @@ -18,13 +18,13 @@ public: CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(LayerColorLoader, loader); protected: - CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(LayerColor); + CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(cocos2d::LayerColor); - virtual void onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, Color3B pColor3B, CCBReader * ccbReader); - virtual void onHandlePropTypeByte(Node * pNode, Node * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * ccbReader); - virtual void onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char * pPropertyName, BlendFunc pBlendFunc, CCBReader * ccbReader); + virtual void onHandlePropTypeColor3(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Color3B pColor3B, CCBReader * ccbReader); + virtual void onHandlePropTypeByte(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * ccbReader); + virtual void onHandlePropTypeBlendFunc(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::BlendFunc pBlendFunc, CCBReader * ccbReader); }; -NS_CC_EXT_END +} #endif diff --git a/cocos/editor-support/cocosbuilder/CCLayerGradientLoader.cpp b/cocos/editor-support/cocosbuilder/CCLayerGradientLoader.cpp index a14bfac0f7..95d93e554b 100644 --- a/cocos/editor-support/cocosbuilder/CCLayerGradientLoader.cpp +++ b/cocos/editor-support/cocosbuilder/CCLayerGradientLoader.cpp @@ -1,6 +1,6 @@ #include "CCLayerGradientLoader.h" - +using namespace cocos2d; #define PROPERTY_STARTCOLOR "startColor" #define PROPERTY_ENDCOLOR "endColor" @@ -9,7 +9,7 @@ #define PROPERTY_VECTOR "vector" #define PROPERTY_BLENDFUNC "blendFunc" -NS_CC_EXT_BEGIN +namespace cocosbuilder { void LayerGradientLoader::onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, Color3B pColor3B, CCBReader * ccbReader) { if(strcmp(pPropertyName, PROPERTY_STARTCOLOR) == 0) { @@ -51,4 +51,4 @@ void LayerGradientLoader::onHandlePropTypePoint(Node * pNode, Node * pParent, co } } -NS_CC_EXT_END +} diff --git a/cocos/editor-support/cocosbuilder/CCLayerGradientLoader.h b/cocos/editor-support/cocosbuilder/CCLayerGradientLoader.h index 1361369600..5ec0c8fcc3 100644 --- a/cocos/editor-support/cocosbuilder/CCLayerGradientLoader.h +++ b/cocos/editor-support/cocosbuilder/CCLayerGradientLoader.h @@ -3,7 +3,7 @@ #include "CCLayerLoader.h" -NS_CC_EXT_BEGIN +namespace cocosbuilder { /* Forward declaration. */ class CCBReader; @@ -18,14 +18,14 @@ public: CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(LayerGradientLoader, loader); protected: - CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(LayerGradient); + CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(cocos2d::LayerGradient); - virtual void onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, Color3B pColor3B, CCBReader * ccbReader); - virtual void onHandlePropTypeByte(Node * pNode, Node * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * ccbReader); - virtual void onHandlePropTypePoint(Node * pNode, Node * pParent, const char * pPropertyName, Point pPoint, CCBReader * ccbReader); - virtual void onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char * pPropertyName, BlendFunc pBlendFunc, CCBReader * ccbReader); + virtual void onHandlePropTypeColor3(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Color3B pColor3B, CCBReader * ccbReader); + virtual void onHandlePropTypeByte(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * ccbReader); + virtual void onHandlePropTypePoint(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Point pPoint, CCBReader * ccbReader); + virtual void onHandlePropTypeBlendFunc(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::BlendFunc pBlendFunc, CCBReader * ccbReader); }; -NS_CC_EXT_END +} #endif diff --git a/cocos/editor-support/cocosbuilder/CCLayerLoader.cpp b/cocos/editor-support/cocosbuilder/CCLayerLoader.cpp index d5f353d0f5..f13cf610f6 100644 --- a/cocos/editor-support/cocosbuilder/CCLayerLoader.cpp +++ b/cocos/editor-support/cocosbuilder/CCLayerLoader.cpp @@ -1,14 +1,16 @@ #include "CCLayerLoader.h" - +using namespace cocos2d; #define PROPERTY_TOUCH_ENABLED "isTouchEnabled" #define PROPERTY_ACCELEROMETER_ENABLED "isAccelerometerEnabled" #define PROPERTY_MOUSE_ENABLED "isMouseEnabled" #define PROPERTY_KEYBOARD_ENABLED "isKeyboardEnabled" -NS_CC_EXT_BEGIN +using namespace cocos2d; + +namespace cocosbuilder { void LayerLoader::onHandlePropTypeCheck(Node * pNode, Node * pParent, const char * pPropertyName, bool pCheck, CCBReader * ccbReader) { if(strcmp(pPropertyName, PROPERTY_TOUCH_ENABLED) == 0) { @@ -27,4 +29,4 @@ void LayerLoader::onHandlePropTypeCheck(Node * pNode, Node * pParent, const char } } -NS_CC_EXT_END +} diff --git a/cocos/editor-support/cocosbuilder/CCLayerLoader.h b/cocos/editor-support/cocosbuilder/CCLayerLoader.h index 835d77b4ba..9d7f41fa25 100644 --- a/cocos/editor-support/cocosbuilder/CCLayerLoader.h +++ b/cocos/editor-support/cocosbuilder/CCLayerLoader.h @@ -3,7 +3,7 @@ #include "CCNodeLoader.h" -NS_CC_EXT_BEGIN +namespace cocosbuilder { /* Forward declaration. */ class CCBReader; @@ -18,11 +18,11 @@ public: CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(LayerLoader, loader); protected: - CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(Layer); + CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(cocos2d::Layer); - virtual void onHandlePropTypeCheck(Node * pNode, Node * pParent, const char * pPropertyName, bool pCheck, CCBReader * ccbReader); + virtual void onHandlePropTypeCheck(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, bool pCheck, CCBReader * ccbReader); }; -NS_CC_EXT_END +} #endif diff --git a/cocos/editor-support/cocosbuilder/CCMenuItemImageLoader.cpp b/cocos/editor-support/cocosbuilder/CCMenuItemImageLoader.cpp index 169d2a469a..21bb3b0b6b 100644 --- a/cocos/editor-support/cocosbuilder/CCMenuItemImageLoader.cpp +++ b/cocos/editor-support/cocosbuilder/CCMenuItemImageLoader.cpp @@ -1,12 +1,12 @@ #include "CCMenuItemImageLoader.h" - +using namespace cocos2d; #define PROPERTY_NORMALDISPLAYFRAME "normalSpriteFrame" #define PROPERTY_SELECTEDDISPLAYFRAME "selectedSpriteFrame" #define PROPERTY_DISABLEDDISPLAYFRAME "disabledSpriteFrame" -NS_CC_EXT_BEGIN +namespace cocosbuilder { void MenuItemImageLoader::onHandlePropTypeSpriteFrame(Node * pNode, Node * pParent, const char * pPropertyName, SpriteFrame * pSpriteFrame, CCBReader * ccbReader) { if(strcmp(pPropertyName, PROPERTY_NORMALDISPLAYFRAME) == 0) { @@ -26,4 +26,4 @@ void MenuItemImageLoader::onHandlePropTypeSpriteFrame(Node * pNode, Node * pPare } } -NS_CC_EXT_END +} diff --git a/cocos/editor-support/cocosbuilder/CCMenuItemImageLoader.h b/cocos/editor-support/cocosbuilder/CCMenuItemImageLoader.h index 5c56e3c178..d1c680227f 100644 --- a/cocos/editor-support/cocosbuilder/CCMenuItemImageLoader.h +++ b/cocos/editor-support/cocosbuilder/CCMenuItemImageLoader.h @@ -3,7 +3,7 @@ #include "CCMenuItemLoader.h" -NS_CC_EXT_BEGIN +namespace cocosbuilder { /* Forward declaration. */ class CCBReader; @@ -26,14 +26,14 @@ protected: * @js NA * @lua NA */ - CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(MenuItemImage); + CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(cocos2d::MenuItemImage); /** * @js NA * @lua NA */ - virtual void onHandlePropTypeSpriteFrame(Node * pNode, Node * pParent, const char * pPropertyName, SpriteFrame * pSpriteFrame, CCBReader * ccbReader); + virtual void onHandlePropTypeSpriteFrame(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::SpriteFrame * pSpriteFrame, CCBReader * ccbReader); }; -NS_CC_EXT_END +} #endif diff --git a/cocos/editor-support/cocosbuilder/CCMenuItemLoader.cpp b/cocos/editor-support/cocosbuilder/CCMenuItemLoader.cpp index d6dd6f2ecd..2a85d0c4e1 100644 --- a/cocos/editor-support/cocosbuilder/CCMenuItemLoader.cpp +++ b/cocos/editor-support/cocosbuilder/CCMenuItemLoader.cpp @@ -1,11 +1,11 @@ #include "CCMenuItemLoader.h" - +using namespace cocos2d; #define PROPERTY_BLOCK "block" #define PROPERTY_ISENABLED "isEnabled" -NS_CC_EXT_BEGIN +namespace cocosbuilder { void MenuItemLoader::onHandlePropTypeBlock(Node * pNode, Node * pParent, const char * pPropertyName, BlockData * pBlockData, CCBReader * ccbReader) { if(strcmp(pPropertyName, PROPERTY_BLOCK) == 0) { @@ -27,4 +27,4 @@ void MenuItemLoader::onHandlePropTypeCheck(Node * pNode, Node * pParent, const c } } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/editor-support/cocosbuilder/CCMenuItemLoader.h b/cocos/editor-support/cocosbuilder/CCMenuItemLoader.h index ec334bc093..5db15eacba 100644 --- a/cocos/editor-support/cocosbuilder/CCMenuItemLoader.h +++ b/cocos/editor-support/cocosbuilder/CCMenuItemLoader.h @@ -3,7 +3,7 @@ #include "CCLayerLoader.h" -NS_CC_EXT_BEGIN +namespace cocosbuilder { /* Forward declaration. */ class CCBReader; @@ -21,19 +21,19 @@ protected: * @js NA * @lua NA */ - CCB_PURE_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(MenuItem); + CCB_PURE_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(cocos2d::MenuItem); /** * @js NA * @lua NA */ - virtual void onHandlePropTypeBlock(Node * pNode, Node * pParent, const char * pPropertyName, BlockData * pBlockData, CCBReader * ccbReader); + virtual void onHandlePropTypeBlock(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, BlockData * pBlockData, CCBReader * ccbReader); /** * @js NA * @lua NA */ - virtual void onHandlePropTypeCheck(Node * pNode, Node * pParent, const char * pPropertyName, bool pCheck, CCBReader * ccbReader); + virtual void onHandlePropTypeCheck(cocos2d::Node * pNode,cocos2d:: Node * pParent, const char * pPropertyName, bool pCheck, CCBReader * ccbReader); }; -NS_CC_EXT_END +} #endif diff --git a/cocos/editor-support/cocosbuilder/CCMenuLoader.h b/cocos/editor-support/cocosbuilder/CCMenuLoader.h index 107fc2e27d..851913c74c 100644 --- a/cocos/editor-support/cocosbuilder/CCMenuLoader.h +++ b/cocos/editor-support/cocosbuilder/CCMenuLoader.h @@ -3,7 +3,7 @@ #include "CCLayerLoader.h" -NS_CC_EXT_BEGIN +namespace cocosbuilder { /* Forward declaration. */ class CCBReader; @@ -22,9 +22,9 @@ public: CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(MenuLoader, loader); protected: - CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(Menu); + CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(cocos2d::Menu); }; -NS_CC_EXT_END +} #endif diff --git a/cocos/editor-support/cocosbuilder/CCNode+CCBRelativePositioning.cpp b/cocos/editor-support/cocosbuilder/CCNode+CCBRelativePositioning.cpp index 4797b8ad2d..fd941dfbfa 100644 --- a/cocos/editor-support/cocosbuilder/CCNode+CCBRelativePositioning.cpp +++ b/cocos/editor-support/cocosbuilder/CCNode+CCBRelativePositioning.cpp @@ -1,7 +1,9 @@ #include "CCNode+CCBRelativePositioning.h" #include "CCBReader.h" -NS_CC_EXT_BEGIN +using namespace cocos2d; + +namespace cocosbuilder { Point getAbsolutePosition(const Point &pt, CCBReader::PositionType type, const Size &containerSize, const char *propName) { @@ -57,4 +59,4 @@ void setRelativeScale(Node *pNode, float scaleX, float scaleY, CCBReader::ScaleT pNode->setScaleY(scaleY); } -NS_CC_EXT_END +} diff --git a/cocos/editor-support/cocosbuilder/CCNode+CCBRelativePositioning.h b/cocos/editor-support/cocosbuilder/CCNode+CCBRelativePositioning.h index 7e8a8e7baa..0220eccafc 100644 --- a/cocos/editor-support/cocosbuilder/CCNode+CCBRelativePositioning.h +++ b/cocos/editor-support/cocosbuilder/CCNode+CCBRelativePositioning.h @@ -2,15 +2,14 @@ #define __CCB_CCNODE_RELATIVEPOSITIONING_H__ #include "cocos2d.h" -#include "ExtensionMacros.h" #include "CCBReader.h" -NS_CC_EXT_BEGIN +namespace cocosbuilder { -extern Point getAbsolutePosition(const Point &pt, CCBReader::PositionType type, const Size &containerSize, const char *propName); +extern cocos2d::Point getAbsolutePosition(const cocos2d::Point &pt, CCBReader::PositionType type, const cocos2d::Size &containerSize, const char *propName); -extern void setRelativeScale(Node *node, float scaleX, float scaleY, CCBReader::ScaleType type, const char* propName); +extern void setRelativeScale(cocos2d::Node *node, float scaleX, float scaleY, CCBReader::ScaleType type, const char* propName); -NS_CC_EXT_END +} #endif // __CCB_CCNODE_RELATIVEPOSITIONING_H__ diff --git a/cocos/editor-support/cocosbuilder/CCNodeLoader.cpp b/cocos/editor-support/cocosbuilder/CCNodeLoader.cpp index eef0acfb96..f1aedc7104 100644 --- a/cocos/editor-support/cocosbuilder/CCNodeLoader.cpp +++ b/cocos/editor-support/cocosbuilder/CCNodeLoader.cpp @@ -5,8 +5,10 @@ #include "CCNode+CCBRelativePositioning.h" using namespace std; +using namespace cocos2d; +using namespace cocos2d::extension; -NS_CC_EXT_BEGIN +namespace cocosbuilder { NodeLoader::NodeLoader() { @@ -1156,4 +1158,4 @@ void NodeLoader::onHandlePropTypeCCBFile(Node * pNode, Node * pParent, const cha ASSERT_FAIL_UNEXPECTED_PROPERTY(pPropertyName); } -NS_CC_EXT_END +} diff --git a/cocos/editor-support/cocosbuilder/CCNodeLoader.h b/cocos/editor-support/cocosbuilder/CCNodeLoader.h index a3ec6ee7a8..bc798a1c89 100644 --- a/cocos/editor-support/cocosbuilder/CCNodeLoader.h +++ b/cocos/editor-support/cocosbuilder/CCNodeLoader.h @@ -1,13 +1,13 @@ #ifndef _CCB_CCNODELOADER_H_ #define _CCB_CCNODELOADER_H_ -#include "../GUI/CCControlExtension/CCInvocation.h" +#include "extensions/GUI/CCControlExtension/CCInvocation.h" #include "cocos2d.h" #include "CCBReader.h" #include "CCBValue.h" -#include "../GUI/CCControlExtension/CCControl.h" +#include "extensions/GUI/CCControlExtension/CCControl.h" -NS_CC_EXT_BEGIN +namespace cocosbuilder { #define PROPERTY_POSITION "position" #define PROPERTY_CONTENTSIZE "contentSize" @@ -24,27 +24,27 @@ NS_CC_EXT_BEGIN #define ASSERT_FAIL_UNEXPECTED_PROPERTY(PROPERTY) cocos2d::log("Unexpected property: '%s'!\n", PROPERTY); assert(false) #define ASSERT_FAIL_UNEXPECTED_PROPERTYTYPE(PROPERTYTYPE) cocos2d::log("Unexpected property type: '%d'!\n", PROPERTYTYPE); assert(false) -#define CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(T) virtual T * createNode(cocos2d::Node * pParent, cocos2d::extension::CCBReader * ccbReader) { \ +#define CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(T) virtual T * createNode(cocos2d::Node * pParent, cocosbuilder::CCBReader * ccbReader) { \ return T::create(); \ } -#define CCB_PURE_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(T) virtual T * createNode(cocos2d::Node * pParent, cocos2d::extension::CCBReader * ccbReader) = 0 +#define CCB_PURE_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(T) virtual T * createNode(cocos2d::Node * pParent, cocosbuilder::CCBReader * ccbReader) = 0 struct BlockData { - SEL_MenuHandler mSELMenuHandler; - Object * _target; + cocos2d::SEL_MenuHandler mSELMenuHandler; + cocos2d::Object * _target; }; struct BlockControlData { - Control::Handler mSELControlHandler; - Object * _target; - Control::EventType mControlEvents; + cocos2d::extension::Control::Handler mSELControlHandler; + cocos2d::Object * _target; + cocos2d::extension::Control::EventType mControlEvents; }; /* Forward declaration. */ class CCBReader; -class NodeLoader : public Object { +class NodeLoader : public cocos2d::Object { public: /** * @js NA @@ -65,85 +65,85 @@ class NodeLoader : public Object { * @js NA * @lua NA */ - virtual Node * loadNode(Node *, CCBReader * ccbReader); + virtual cocos2d::Node * loadNode(cocos2d::Node *, CCBReader * ccbReader); /** * @js NA * @lua NA */ - virtual void parseProperties(Node * pNode, Node * pParent, CCBReader * ccbReader); + virtual void parseProperties(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader); /** * @js NA * @lua NA */ - virtual Dictionary* getCustomProperties(); + virtual cocos2d::Dictionary* getCustomProperties(); protected: - CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(Node); + CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(cocos2d::Node); - virtual Point parsePropTypePosition(Node * pNode, Node * pParent, CCBReader * ccbReader, const char *pPropertyName); - virtual Point parsePropTypePoint(Node * pNode, Node * pParent, CCBReader * ccbReader); - virtual Point parsePropTypePointLock(Node * pNode, Node * pParent, CCBReader * ccbReader); - virtual Size parsePropTypeSize(Node * pNode, Node * pParent, CCBReader * ccbReader); - virtual float * parsePropTypeScaleLock(Node * pNode, Node * pParent, CCBReader * ccbReader, const char *pPropertyName); - virtual float parsePropTypeFloat(Node * pNode, Node * pParent, CCBReader * ccbReader); - virtual float parsePropTypeDegrees(Node * pNode, Node * pParent, CCBReader * ccbReader, const char *pPropertyName); - virtual float parsePropTypeFloatScale(Node * pNode, Node * pParent, CCBReader * ccbReader); - virtual int parsePropTypeInteger(Node * pNode, Node * pParent, CCBReader * ccbReader); - virtual int parsePropTypeIntegerLabeled(Node * pNode, Node * pParent, CCBReader * ccbReader); - virtual float * parsePropTypeFloatVar(Node * pNode, Node * pParent, CCBReader * ccbReader); - virtual bool parsePropTypeCheck(Node * pNode, Node * pParent, CCBReader * ccbReader, const char *pPropertyName); - virtual SpriteFrame * parsePropTypeSpriteFrame(Node * pNode, Node * pParent, CCBReader * ccbReader, const char *pPropertyName); - virtual Animation * parsePropTypeAnimation(Node * pNode, Node * pParent, CCBReader * ccbReader); - virtual Texture2D * parsePropTypeTexture(Node * pNode, Node * pParent, CCBReader * ccbReader); - virtual unsigned char parsePropTypeByte(Node * pNode, Node * pParent, CCBReader * ccbReader, const char *pPropertyName); - virtual Color3B parsePropTypeColor3(Node * pNode, Node * pParent, CCBReader * ccbReader, const char *pPropertyName); - virtual Color4F * parsePropTypeColor4FVar(Node * pNode, Node * pParent, CCBReader * ccbReader); - virtual bool * parsePropTypeFlip(Node * pNode, Node * pParent, CCBReader * ccbReader); - virtual BlendFunc parsePropTypeBlendFunc(Node * pNode, Node * pParent, CCBReader * ccbReader); - virtual std::string parsePropTypeFntFile(Node * pNode, Node * pParent, CCBReader * ccbReader); - virtual std::string parsePropTypeString(Node * pNode, Node * pParent, CCBReader * ccbReader); - virtual std::string parsePropTypeText(Node * pNode, Node * pParent, CCBReader * ccbReader); - virtual std::string parsePropTypeFontTTF(Node * pNode, Node * pParent, CCBReader * ccbReader); - virtual BlockData * parsePropTypeBlock(Node * pNode, Node * pParent, CCBReader * ccbReader); - virtual BlockControlData * parsePropTypeBlockControl(Node * pNode, Node * pParent, CCBReader * ccbReader); - virtual Node * parsePropTypeCCBFile(Node * pNode, Node * pParent, CCBReader * ccbReader); - virtual float * parsePropTypeFloatXY(Node * pNode, Node * pParent, CCBReader * ccbReader); + virtual cocos2d::Point parsePropTypePosition(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader, const char *pPropertyName); + virtual cocos2d::Point parsePropTypePoint(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader); + virtual cocos2d::Point parsePropTypePointLock(cocos2d::Node * pNode,cocos2d:: Node * pParent, CCBReader * ccbReader); + virtual cocos2d::Size parsePropTypeSize(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader); + virtual float * parsePropTypeScaleLock(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader, const char *pPropertyName); + virtual float parsePropTypeFloat(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader); + virtual float parsePropTypeDegrees(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader, const char *pPropertyName); + virtual float parsePropTypeFloatScale(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader); + virtual int parsePropTypeInteger(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader); + virtual int parsePropTypeIntegerLabeled(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader); + virtual float * parsePropTypeFloatVar(cocos2d::Node * pNode,cocos2d::Node * pParent, CCBReader * ccbReader); + virtual bool parsePropTypeCheck(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader, const char *pPropertyName); + virtual cocos2d::SpriteFrame * parsePropTypeSpriteFrame(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader, const char *pPropertyName); + virtual cocos2d::Animation * parsePropTypeAnimation(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader); + virtual cocos2d::Texture2D * parsePropTypeTexture(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader); + virtual unsigned char parsePropTypeByte(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader, const char *pPropertyName); + virtual cocos2d::Color3B parsePropTypeColor3(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader, const char *pPropertyName); + virtual cocos2d::Color4F * parsePropTypeColor4FVar(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader); + virtual bool * parsePropTypeFlip(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader); + virtual cocos2d::BlendFunc parsePropTypeBlendFunc(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader); + virtual std::string parsePropTypeFntFile(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader); + virtual std::string parsePropTypeString(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader); + virtual std::string parsePropTypeText(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader); + virtual std::string parsePropTypeFontTTF(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader); + virtual BlockData * parsePropTypeBlock(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader); + virtual BlockControlData * parsePropTypeBlockControl(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader); + virtual cocos2d::Node * parsePropTypeCCBFile(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader); + virtual float * parsePropTypeFloatXY(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader); - virtual void onHandlePropTypePosition(Node * pNode, Node * pParent, const char* pPropertyName, Point pPosition, CCBReader * ccbReader); - virtual void onHandlePropTypePoint(Node * pNode, Node * pParent, const char* pPropertyName, Point pPoint, CCBReader * ccbReader); - virtual void onHandlePropTypePointLock(Node * pNode, Node * pParent, const char* pPropertyName, Point pPointLock, CCBReader * ccbReader); - virtual void onHandlePropTypeSize(Node * pNode, Node * pParent, const char* pPropertyName, Size pSize, CCBReader * ccbReader); - virtual void onHandlePropTypeScaleLock(Node * pNode, Node * pParent, const char* pPropertyName, float * pScaleLock, CCBReader * ccbReader); - virtual void onHandlePropTypeFloat(Node * pNode, Node * pParent, const char* pPropertyName, float pFloat, CCBReader * ccbReader); - virtual void onHandlePropTypeDegrees(Node * pNode, Node * pParent, const char* pPropertyName, float pDegrees, CCBReader * ccbReader); - virtual void onHandlePropTypeFloatScale(Node * pNode, Node * pParent, const char* pPropertyName, float pFloatScale, CCBReader * ccbReader); - virtual void onHandlePropTypeInteger(Node * pNode, Node * pParent, const char* pPropertyName, int pInteger, CCBReader * ccbReader); - virtual void onHandlePropTypeIntegerLabeled(Node * pNode, Node * pParent, const char* pPropertyName, int pIntegerLabeled, CCBReader * ccbReader); - virtual void onHandlePropTypeFloatVar(Node * pNode, Node * pParent, const char* pPropertyName, float * pFoatVar, CCBReader * ccbReader); - virtual void onHandlePropTypeFloatXY(Node * pNode, Node * pParent, const char* pPropertyName, float * pFoatVar, CCBReader * ccbReader); + virtual void onHandlePropTypePosition(cocos2d::Node * pNode,cocos2d:: Node * pParent, const char* pPropertyName, cocos2d::Point pPosition, CCBReader * ccbReader); + virtual void onHandlePropTypePoint(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, cocos2d::Point pPoint, CCBReader * ccbReader); + virtual void onHandlePropTypePointLock(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, cocos2d::Point pPointLock, CCBReader * ccbReader); + virtual void onHandlePropTypeSize(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, cocos2d::Size pSize, CCBReader * ccbReader); + virtual void onHandlePropTypeScaleLock(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, float * pScaleLock, CCBReader * ccbReader); + virtual void onHandlePropTypeFloat(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, float pFloat, CCBReader * ccbReader); + virtual void onHandlePropTypeDegrees(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, float pDegrees, CCBReader * ccbReader); + virtual void onHandlePropTypeFloatScale(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, float pFloatScale, CCBReader * ccbReader); + virtual void onHandlePropTypeInteger(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, int pInteger, CCBReader * ccbReader); + virtual void onHandlePropTypeIntegerLabeled(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, int pIntegerLabeled, CCBReader * ccbReader); + virtual void onHandlePropTypeFloatVar(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, float * pFoatVar, CCBReader * ccbReader); + virtual void onHandlePropTypeFloatXY(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, float * pFoatVar, CCBReader * ccbReader); - virtual void onHandlePropTypeCheck(Node * pNode, Node * pParent, const char* pPropertyName, bool pCheck, CCBReader * ccbReader); - virtual void onHandlePropTypeSpriteFrame(Node * pNode, Node * pParent, const char* pPropertyName, SpriteFrame * pSpriteFrame, CCBReader * ccbReader); - virtual void onHandlePropTypeAnimation(Node * pNode, Node * pParent, const char* pPropertyName, Animation * pAnimation, CCBReader * ccbReader); - virtual void onHandlePropTypeTexture(Node * pNode, Node * pParent, const char* pPropertyName, Texture2D * pTexture2D, CCBReader * ccbReader); - virtual void onHandlePropTypeByte(Node * pNode, Node * pParent, const char* pPropertyName, unsigned char pByte, CCBReader * ccbReader); - virtual void onHandlePropTypeColor3(Node * pNode, Node * pParent, const char* pPropertyName, Color3B pColor3B, CCBReader * ccbReader); - virtual void onHandlePropTypeColor4FVar(Node * pNode, Node * pParent, const char* pPropertyName, Color4F * pColor4FVar, CCBReader * ccbReader); - virtual void onHandlePropTypeFlip(Node * pNode, Node * pParent, const char* pPropertyName, bool * pFlip, CCBReader * ccbReader); - virtual void onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char* pPropertyName, BlendFunc pBlendFunc, CCBReader * ccbReader); - virtual void onHandlePropTypeFntFile(Node * pNode, Node * pParent, const char* pPropertyName, const char * pFntFile, CCBReader * ccbReader); - virtual void onHandlePropTypeString(Node * pNode, Node * pParent, const char* pPropertyName, const char * pString, CCBReader * ccbReader); - virtual void onHandlePropTypeText(Node * pNode, Node * pParent, const char* pPropertyName, const char * pText, CCBReader * ccbReader); - virtual void onHandlePropTypeFontTTF(Node * pNode, Node * pParent, const char* pPropertyName, const char * pFontTTF, CCBReader * ccbReader); - virtual void onHandlePropTypeBlock(Node * pNode, Node * pParent, const char* pPropertyName, BlockData * pBlockData, CCBReader * ccbReader); - virtual void onHandlePropTypeBlockControl(Node * pNode, Node * pParent, const char* pPropertyName, BlockControlData * pBlockControlData, CCBReader * ccbReader); - virtual void onHandlePropTypeCCBFile(Node * pNode, Node * pParent, const char* pPropertyName, Node * pCCBFileNode, CCBReader * ccbReader); + virtual void onHandlePropTypeCheck(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, bool pCheck, CCBReader * ccbReader); + virtual void onHandlePropTypeSpriteFrame(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, cocos2d::SpriteFrame * pSpriteFrame, CCBReader * ccbReader); + virtual void onHandlePropTypeAnimation(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, cocos2d::Animation * pAnimation, CCBReader * ccbReader); + virtual void onHandlePropTypeTexture(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, cocos2d::Texture2D * pTexture2D, CCBReader * ccbReader); + virtual void onHandlePropTypeByte(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, unsigned char pByte, CCBReader * ccbReader); + virtual void onHandlePropTypeColor3(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, cocos2d::Color3B pColor3B, CCBReader * ccbReader); + virtual void onHandlePropTypeColor4FVar(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, cocos2d::Color4F * pColor4FVar, CCBReader * ccbReader); + virtual void onHandlePropTypeFlip(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, bool * pFlip, CCBReader * ccbReader); + virtual void onHandlePropTypeBlendFunc(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, cocos2d::BlendFunc pBlendFunc, CCBReader * ccbReader); + virtual void onHandlePropTypeFntFile(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, const char * pFntFile, CCBReader * ccbReader); + virtual void onHandlePropTypeString(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, const char * pString, CCBReader * ccbReader); + virtual void onHandlePropTypeText(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, const char * pText, CCBReader * ccbReader); + virtual void onHandlePropTypeFontTTF(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, const char * pFontTTF, CCBReader * ccbReader); + virtual void onHandlePropTypeBlock(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, BlockData * pBlockData, CCBReader * ccbReader); + virtual void onHandlePropTypeBlockControl(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, BlockControlData * pBlockControlData, CCBReader * ccbReader); + virtual void onHandlePropTypeCCBFile(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, cocos2d::Node * pCCBFileNode, CCBReader * ccbReader); protected: - Dictionary* _customProperties; + cocos2d::Dictionary* _customProperties; }; -NS_CC_EXT_END +} #endif diff --git a/cocos/editor-support/cocosbuilder/CCNodeLoaderLibrary.cpp b/cocos/editor-support/cocosbuilder/CCNodeLoaderLibrary.cpp index c7d61b24ec..48979ee0bc 100644 --- a/cocos/editor-support/cocosbuilder/CCNodeLoaderLibrary.cpp +++ b/cocos/editor-support/cocosbuilder/CCNodeLoaderLibrary.cpp @@ -15,9 +15,9 @@ #include "CCParticleSystemQuadLoader.h" #include "CCScrollViewLoader.h" +using namespace cocos2d; - -NS_CC_EXT_BEGIN +namespace cocosbuilder { NodeLoaderLibrary::NodeLoaderLibrary() { @@ -102,4 +102,4 @@ NodeLoaderLibrary * NodeLoaderLibrary::newDefaultNodeLoaderLibrary() { return ccNodeLoaderLibrary; } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/editor-support/cocosbuilder/CCNodeLoaderLibrary.h b/cocos/editor-support/cocosbuilder/CCNodeLoaderLibrary.h index dcb49dbaaf..c75276d22f 100644 --- a/cocos/editor-support/cocosbuilder/CCNodeLoaderLibrary.h +++ b/cocos/editor-support/cocosbuilder/CCNodeLoaderLibrary.h @@ -4,14 +4,14 @@ #include "cocos2d.h" #include "CCBReader.h" -NS_CC_EXT_BEGIN +namespace cocosbuilder { class NodeLoader; typedef std::map NodeLoaderMap; typedef std::pair NodeLoaderMapEntry; -class NodeLoaderLibrary : public Object +class NodeLoaderLibrary : public cocos2d::Object { public: /** @@ -114,6 +114,6 @@ private: NodeLoaderMap _nodeLoaders; }; -NS_CC_EXT_END +} #endif diff --git a/cocos/editor-support/cocosbuilder/CCNodeLoaderListener.h b/cocos/editor-support/cocosbuilder/CCNodeLoaderListener.h index 0ff35b2bee..cf6c53e543 100644 --- a/cocos/editor-support/cocosbuilder/CCNodeLoaderListener.h +++ b/cocos/editor-support/cocosbuilder/CCNodeLoaderListener.h @@ -3,7 +3,7 @@ #include "cocos2d.h" -NS_CC_EXT_BEGIN +namespace cocosbuilder { class NodeLoaderListener { public: @@ -16,9 +16,9 @@ class NodeLoaderListener { * @js NA * @lua NA */ - virtual void onNodeLoaded(Node * pNode, NodeLoader * pNodeLoader) = 0; + virtual void onNodeLoaded(cocos2d::Node * pNode, NodeLoader * pNodeLoader) = 0; }; -NS_CC_EXT_END +} #endif diff --git a/cocos/editor-support/cocosbuilder/CCParticleSystemQuadLoader.cpp b/cocos/editor-support/cocosbuilder/CCParticleSystemQuadLoader.cpp index 8f94db33ad..472d1e8d91 100644 --- a/cocos/editor-support/cocosbuilder/CCParticleSystemQuadLoader.cpp +++ b/cocos/editor-support/cocosbuilder/CCParticleSystemQuadLoader.cpp @@ -1,6 +1,6 @@ #include "CCParticleSystemQuadLoader.h" - +using namespace cocos2d; #define PROPERTY_EMITERMODE "emitterMode" #define PROPERTY_POSVAR "posVar" @@ -25,7 +25,7 @@ #define PROPERTY_ENDRADIUS "endRadius" #define PROPERTY_ROTATEPERSECOND "rotatePerSecond" -NS_CC_EXT_BEGIN +namespace cocosbuilder { void ParticleSystemQuadLoader::onHandlePropTypeIntegerLabeled(Node * pNode, Node * pParent, const char * pPropertyName, int pIntegerLabeled, CCBReader * ccbReader) { if(strcmp(pPropertyName, PROPERTY_EMITERMODE) == 0) { @@ -133,4 +133,4 @@ void ParticleSystemQuadLoader::onHandlePropTypeTexture(Node * pNode, Node * pPar } } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/editor-support/cocosbuilder/CCParticleSystemQuadLoader.h b/cocos/editor-support/cocosbuilder/CCParticleSystemQuadLoader.h index cf8324fbb3..feced7312e 100644 --- a/cocos/editor-support/cocosbuilder/CCParticleSystemQuadLoader.h +++ b/cocos/editor-support/cocosbuilder/CCParticleSystemQuadLoader.h @@ -3,7 +3,7 @@ #include "CCNodeLoader.h" -NS_CC_EXT_BEGIN +namespace cocosbuilder { /* Forward declaration. */ class CCBReader; @@ -19,56 +19,56 @@ public: * @js NA * @lua NA */ - CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(ParticleSystemQuadLoader, loader); + CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(cocosbuilder::ParticleSystemQuadLoader, loader); protected: /** * @js NA * @lua NA */ - CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(ParticleSystemQuad); + CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(cocos2d::ParticleSystemQuad); /** * @js NA * @lua NA */ - virtual void onHandlePropTypeIntegerLabeled(Node * pNode, Node * pParent, const char * pPropertyName, int pIntegerLabeled, CCBReader * ccbReader); + virtual void onHandlePropTypeIntegerLabeled(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, int pIntegerLabeled, CCBReader * ccbReader); /** * @js NA * @lua NA */ - virtual void onHandlePropTypePoint(Node * pNode, Node * pParent, const char * pPropertyName, Point pPoint, CCBReader * ccbReader); + virtual void onHandlePropTypePoint(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Point pPoint, CCBReader * ccbReader); /** * @js NA * @lua NA */ - virtual void onHandlePropTypeFloat(Node * pNode, Node * pParent, const char * pPropertyName, float pFloat, CCBReader * ccbReader); + virtual void onHandlePropTypeFloat(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, float pFloat, CCBReader * ccbReader); /** * @js NA * @lua NA */ - virtual void onHandlePropTypeInteger(Node * pNode, Node * pParent, const char * pPropertyName, int pInteger, CCBReader * ccbReader); + virtual void onHandlePropTypeInteger(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, int pInteger, CCBReader * ccbReader); /** * @js NA * @lua NA */ - virtual void onHandlePropTypeFloatVar(Node * pNode, Node * pParent, const char * pPropertyName, float * pFloatVar, CCBReader * ccbReader); + virtual void onHandlePropTypeFloatVar(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, float * pFloatVar, CCBReader * ccbReader); /** * @js NA * @lua NA */ - virtual void onHandlePropTypeColor4FVar(Node * pNode, Node * pParent, const char * pPropertyName, Color4F * pColor4FVar, CCBReader * ccbReader); + virtual void onHandlePropTypeColor4FVar(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Color4F * pColor4FVar, CCBReader * ccbReader); /** * @js NA * @lua NA */ - virtual void onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char * pPropertyName, BlendFunc pBlendFunc, CCBReader * ccbReader); + virtual void onHandlePropTypeBlendFunc(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::BlendFunc pBlendFunc, CCBReader * ccbReader); /** * @js NA * @lua NA */ - virtual void onHandlePropTypeTexture(Node * pNode, Node * pParent, const char * pPropertyName, Texture2D * pTexture2D, CCBReader * ccbReader); + virtual void onHandlePropTypeTexture(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Texture2D * pTexture2D, CCBReader * ccbReader); }; -NS_CC_EXT_END +} #endif diff --git a/cocos/editor-support/cocosbuilder/CCScale9SpriteLoader.cpp b/cocos/editor-support/cocosbuilder/CCScale9SpriteLoader.cpp index b2172bf855..ac9bfd7ca7 100644 --- a/cocos/editor-support/cocosbuilder/CCScale9SpriteLoader.cpp +++ b/cocos/editor-support/cocosbuilder/CCScale9SpriteLoader.cpp @@ -1,6 +1,7 @@ #include "CCScale9SpriteLoader.h" - +using namespace cocos2d; +using namespace cocos2d::extension; #define PROPERTY_CONTENTSIZE "contentSize" #define PROPERTY_SPRITEFRAME "spriteFrame" @@ -13,7 +14,7 @@ #define PROPERTY_INSETRIGHT "insetRight" #define PROPERTY_INSETBOTTOM "insetBottom" -NS_CC_EXT_BEGIN +namespace cocosbuilder { void Scale9SpriteLoader::onHandlePropTypeSpriteFrame(Node * pNode, Node * pParent, const char * pPropertyName, SpriteFrame * pSpriteFrame, CCBReader * ccbReader) { if(strcmp(pPropertyName, PROPERTY_SPRITEFRAME) == 0) { @@ -72,4 +73,4 @@ void Scale9SpriteLoader::onHandlePropTypeFloat(Node * pNode, Node * pParent, con } } -NS_CC_EXT_END +} diff --git a/cocos/editor-support/cocosbuilder/CCScale9SpriteLoader.h b/cocos/editor-support/cocosbuilder/CCScale9SpriteLoader.h index 18692fdef7..b4ec05c92f 100644 --- a/cocos/editor-support/cocosbuilder/CCScale9SpriteLoader.h +++ b/cocos/editor-support/cocosbuilder/CCScale9SpriteLoader.h @@ -3,9 +3,9 @@ #include "CCNodeLoader.h" #include "CCScale9SpriteLoader.h" -#include "../GUI/CCControlExtension/CCScale9Sprite.h" +#include "extensions/GUI/CCControlExtension/CCScale9Sprite.h" -NS_CC_EXT_BEGIN +namespace cocosbuilder { /* Forward declaration. */ class CCBReader; @@ -28,39 +28,39 @@ protected: * @js NA * @lua NA */ - CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(Scale9Sprite); + CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(cocos2d::extension::Scale9Sprite); /** * @js NA * @lua NA */ - virtual void onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, Color3B pColor3B, CCBReader * ccbReader); + virtual void onHandlePropTypeColor3(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Color3B pColor3B, CCBReader * ccbReader); /** * @js NA * @lua NA */ - virtual void onHandlePropTypeByte(Node * pNode, Node * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * ccbReader); + virtual void onHandlePropTypeByte(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * ccbReader); /** * @js NA * @lua NA */ - virtual void onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char * pPropertyName, BlendFunc pBlendFunc, CCBReader * ccbReader); + virtual void onHandlePropTypeBlendFunc(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::BlendFunc pBlendFunc, CCBReader * ccbReader); /** * @js NA * @lua NA */ - virtual void onHandlePropTypeSpriteFrame(Node * pNode, Node * pParent, const char * pPropertyName, SpriteFrame * pSpriteFrame, CCBReader * ccbReader); + virtual void onHandlePropTypeSpriteFrame(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::SpriteFrame * pSpriteFrame, CCBReader * ccbReader); /** * @js NA * @lua NA */ - virtual void onHandlePropTypeSize(Node * pNode, Node * pParent, const char * pPropertyName, Size pSize, CCBReader * ccbReader); + virtual void onHandlePropTypeSize(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Size pSize, CCBReader * ccbReader); /** * @js NA * @lua NA */ - virtual void onHandlePropTypeFloat(Node * pNode, Node * pParent, const char * pPropertyName, float pFloat, CCBReader * ccbReader); + virtual void onHandlePropTypeFloat(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, float pFloat, CCBReader * ccbReader); }; -NS_CC_EXT_END +} #endif diff --git a/cocos/editor-support/cocosbuilder/CCScrollViewLoader.cpp b/cocos/editor-support/cocosbuilder/CCScrollViewLoader.cpp index 5006a5fd89..32301942c8 100644 --- a/cocos/editor-support/cocosbuilder/CCScrollViewLoader.cpp +++ b/cocos/editor-support/cocosbuilder/CCScrollViewLoader.cpp @@ -1,6 +1,7 @@ #include "CCScrollViewLoader.h" - +using namespace cocos2d; +using namespace cocos2d::extension; #define PROPERTY_CONTAINER "container" #define PROPERTY_DIRECTION "direction" @@ -8,7 +9,7 @@ #define PROPERTY_BOUNCES "bounces" #define PROPERTY_SCALE "scale" -NS_CC_EXT_BEGIN +namespace cocosbuilder { void ScrollViewLoader::onHandlePropTypeSize(Node * pNode, Node * pParent, const char * pPropertyName, Size pSize, CCBReader * ccbReader) { if(strcmp(pPropertyName, PROPERTY_CONTENTSIZE) == 0) { @@ -53,4 +54,4 @@ void ScrollViewLoader::onHandlePropTypeIntegerLabeled(Node * pNode, Node * pPare } } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/editor-support/cocosbuilder/CCScrollViewLoader.h b/cocos/editor-support/cocosbuilder/CCScrollViewLoader.h index c21b502bc8..30ede8a8d2 100644 --- a/cocos/editor-support/cocosbuilder/CCScrollViewLoader.h +++ b/cocos/editor-support/cocosbuilder/CCScrollViewLoader.h @@ -2,9 +2,9 @@ #define _CCB_CCSCROLLVIEWLOADER_H_ #include "CCNodeLoader.h" -#include "../GUI/CCScrollView/CCScrollView.h" +#include "extensions/GUI/CCScrollView/CCScrollView.h" -NS_CC_EXT_BEGIN +namespace cocosbuilder { /* Forward declaration. */ class CCBReader; @@ -23,14 +23,14 @@ public: CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(ScrollViewLoader, loader); protected: - CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(ScrollView); - virtual void onHandlePropTypeSize(Node * pNode, Node * pParent, const char * pPropertyName, Size pSize, CCBReader * ccbReader); - virtual void onHandlePropTypeCCBFile(Node * pNode, Node * pParent, const char * pPropertyName, Node * pCCBFileNode, CCBReader * ccbReader); - virtual void onHandlePropTypeCheck(Node * pNode, Node * pParent, const char * pPropertyName, bool pCheck, CCBReader * ccbReader); - virtual void onHandlePropTypeFloat(Node * pNode, Node * pParent, const char * pPropertyName, float pFloat, CCBReader * ccbReader); - virtual void onHandlePropTypeIntegerLabeled(Node * pNode, Node * pParent, const char * pPropertyName, int pIntegerLabeled, CCBReader * ccbReader); + CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(cocos2d::extension::ScrollView); + virtual void onHandlePropTypeSize(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Size pSize, CCBReader * ccbReader); + virtual void onHandlePropTypeCCBFile(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Node * pCCBFileNode, CCBReader * ccbReader); + virtual void onHandlePropTypeCheck(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, bool pCheck, CCBReader * ccbReader); + virtual void onHandlePropTypeFloat(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, float pFloat, CCBReader * ccbReader); + virtual void onHandlePropTypeIntegerLabeled(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, int pIntegerLabeled, CCBReader * ccbReader); }; -NS_CC_EXT_END +} #endif diff --git a/cocos/editor-support/cocosbuilder/CCSpriteLoader.cpp b/cocos/editor-support/cocosbuilder/CCSpriteLoader.cpp index 0432658189..34a2e7f549 100644 --- a/cocos/editor-support/cocosbuilder/CCSpriteLoader.cpp +++ b/cocos/editor-support/cocosbuilder/CCSpriteLoader.cpp @@ -1,12 +1,14 @@ #include "CCSpriteLoader.h" +using namespace cocos2d; + #define PROPERTY_FLIP "flip" #define PROPERTY_DISPLAYFRAME "displayFrame" #define PROPERTY_COLOR "color" #define PROPERTY_OPACITY "opacity" #define PROPERTY_BLENDFUNC "blendFunc" -NS_CC_EXT_BEGIN +namespace cocosbuilder { void SpriteLoader::onHandlePropTypeSpriteFrame(Node * pNode, Node * pParent, const char * pPropertyName, SpriteFrame * pSpriteFrame, CCBReader * ccbReader) { if(strcmp(pPropertyName, PROPERTY_DISPLAYFRAME) == 0) { @@ -53,4 +55,4 @@ void SpriteLoader::onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const } } -NS_CC_EXT_END +} diff --git a/cocos/editor-support/cocosbuilder/CCSpriteLoader.h b/cocos/editor-support/cocosbuilder/CCSpriteLoader.h index 308b6165c6..466ee836bc 100644 --- a/cocos/editor-support/cocosbuilder/CCSpriteLoader.h +++ b/cocos/editor-support/cocosbuilder/CCSpriteLoader.h @@ -3,7 +3,7 @@ #include "CCNodeLoader.h" -NS_CC_EXT_BEGIN +namespace cocosbuilder { /* Forward declaration. */ class CCBReader; @@ -22,15 +22,15 @@ public: CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(SpriteLoader, loader); protected: - CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(Sprite); + CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(cocos2d::Sprite); - virtual void onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, Color3B pColor3B, CCBReader * ccbReader); - virtual void onHandlePropTypeByte(Node * pNode, Node * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * ccbReader); - virtual void onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char * pPropertyName, BlendFunc pCCBBlendFunc, CCBReader * ccbReader); - virtual void onHandlePropTypeSpriteFrame(Node * pNode, Node * pParent, const char * pPropertyName, SpriteFrame * pSpriteFrame, CCBReader * ccbReader); - virtual void onHandlePropTypeFlip(Node * pNode, Node * pParent, const char * pPropertyName, bool * pFlip, CCBReader * ccbReader); + virtual void onHandlePropTypeColor3(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Color3B pColor3B, CCBReader * ccbReader); + virtual void onHandlePropTypeByte(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * ccbReader); + virtual void onHandlePropTypeBlendFunc(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::BlendFunc pCCBBlendFunc, CCBReader * ccbReader); + virtual void onHandlePropTypeSpriteFrame(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::SpriteFrame * pSpriteFrame, CCBReader * ccbReader); + virtual void onHandlePropTypeFlip(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, bool * pFlip, CCBReader * ccbReader); }; -NS_CC_EXT_END +} #endif diff --git a/cocos/editor-support/cocosbuilder/CocosBuilder.h b/cocos/editor-support/cocosbuilder/CocosBuilder.h new file mode 100644 index 0000000000..6baa5d2ddc --- /dev/null +++ b/cocos/editor-support/cocosbuilder/CocosBuilder.h @@ -0,0 +1,32 @@ +#ifndef __EDITOR_SUPPORT_COCOSBUILDER_H__ +#define __EDITOR_SUPPORT_COCOSBUILDER_H__ + +#include "cocosbuilder/CCBAnimationManager.h" +#include "cocosbuilder/CCBFileLoader.h" +#include "cocosbuilder/CCBKeyframe.h" +#include "cocosbuilder/CCBMemberVariableAssigner.h" +#include "cocosbuilder/CCBReader.h" +#include "cocosbuilder/CCBSelectorResolver.h" +#include "cocosbuilder/CCBSequence.h" +#include "cocosbuilder/CCBSequenceProperty.h" +#include "cocosbuilder/CCBValue.h" +#include "cocosbuilder/CCControlButtonLoader.h" +#include "cocosbuilder/CCControlLoader.h" +#include "cocosbuilder/CCLabelBMFontLoader.h" +#include "cocosbuilder/CCLabelTTFLoader.h" +#include "cocosbuilder/CCLayerColorLoader.h" +#include "cocosbuilder/CCLayerGradientLoader.h" +#include "cocosbuilder/CCLayerLoader.h" +#include "cocosbuilder/CCMenuItemImageLoader.h" +#include "cocosbuilder/CCMenuItemLoader.h" +#include "cocosbuilder/CCMenuLoader.h" +#include "cocosbuilder/CCNode+CCBRelativePositioning.h" +#include "cocosbuilder/CCNodeLoader.h" +#include "cocosbuilder/CCNodeLoaderLibrary.h" +#include "cocosbuilder/CCNodeLoaderListener.h" +#include "cocosbuilder/CCParticleSystemQuadLoader.h" +#include "cocosbuilder/CCScale9SpriteLoader.h" +#include "cocosbuilder/CCScrollViewLoader.h" +#include "cocosbuilder/CCSpriteLoader.h" + +#endif // __EDITOR_SUPPORT_COCOSBUILDER_H__ diff --git a/cocos/editor-support/cocostudio/Android.mk b/cocos/editor-support/cocostudio/Android.mk new file mode 100644 index 0000000000..15b18c83d7 --- /dev/null +++ b/cocos/editor-support/cocostudio/Android.mk @@ -0,0 +1,64 @@ +LOCAL_PATH := $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_MODULE := cocostudio_static + +LOCAL_MODULE_FILENAME := libcocostudio + +LOCAL_SRC_FILES := action/CCActionFrame.cpp \ +action/CCActionFrameEasing.cpp \ +action/CCActionManagerEx.cpp \ +action/CCActionNode.cpp \ +action/CCActionObject.cpp \ +armature/CCArmature.cpp \ +armature/CCBone.cpp \ +armature/animation/CCArmatureAnimation.cpp \ +armature/animation/CCProcessBase.cpp \ +armature/animation/CCTween.cpp \ +armature/datas/CCDatas.cpp \ +armature/display/CCBatchNode.cpp \ +armature/display/CCDecorativeDisplay.cpp \ +armature/display/CCDisplayFactory.cpp \ +armature/display/CCDisplayManager.cpp \ +armature/display/CCSkin.cpp \ +armature/physics/CCColliderDetector.cpp \ +armature/utils/CCArmatureDataManager.cpp \ +armature/utils/CCArmatureDefine.cpp \ +armature/utils/CCDataReaderHelper.cpp \ +armature/utils/CCSpriteFrameCacheHelper.cpp \ +armature/utils/CCTransformHelp.cpp \ +armature/utils/CCTweenFunction.cpp \ +armature/utils/CCUtilMath.cpp \ +components/CCComAttribute.cpp \ +components/CCComAudio.cpp \ +components/CCComController.cpp \ +components/CCComRender.cpp \ +components/CCInputDelegate.cpp \ +json/CSContentJsonDictionary.cpp \ +json/DictionaryHelper.cpp \ +reader/CCSGUIReader.cpp \ +reader/CCSSceneReader.cpp \ +../../../external/json/json_reader.cpp \ +../../../external/json/json_value.cpp \ +../../../external/json/json_writer.cpp + +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) \ +$(LOCAL_PATH)/../../../external/json + +LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../2d \ +$(LOCAL_PATH)/../../../external/json \ +$(LOCAL_PATH) \ +$(LOCAL_PATH)/../../gui \ +$(LOCAL_PATH)/../../../external + +LOCAL_CFLAGS += -Wno-psabi -fexceptions +LOCAL_EXPORT_CFLAGS += -Wno-psabi + +LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_static + +include $(BUILD_STATIC_LIBRARY) + +$(call import-module,2d) +$(call import-module,audio/android) + diff --git a/cocos/editor-support/cocostudio/CocoStudio.h b/cocos/editor-support/cocostudio/CocoStudio.h new file mode 100644 index 0000000000..be6d9d807b --- /dev/null +++ b/cocos/editor-support/cocostudio/CocoStudio.h @@ -0,0 +1,62 @@ +/**************************************************************************** + Copyright (c) 2013 cocos2d-x.org + + 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 __EDITOR_SUPPORT_COCOSTUDIO_H__ +#define __EDITOR_SUPPORT_COCOSTUDIO_H__ + +#include "action/CCActionFrame.h" +#include "action/CCActionFrameEasing.h" +#include "action/CCActionManagerEx.h" +#include "action/CCActionNode.h" +#include "action/CCActionObject.h" +#include "armature/CCArmature.h" +#include "armature/CCBone.h" +#include "armature/animation/CCArmatureAnimation.h" +#include "armature/animation/CCProcessBase.h" +#include "armature/animation/CCTween.h" +#include "armature/datas/CCDatas.h" +#include "armature/display/CCBatchNode.h" +#include "armature/display/CCDecorativeDisplay.h" +#include "armature/display/CCDisplayFactory.h" +#include "armature/display/CCDisplayManager.h" +#include "armature/display/CCSkin.h" +#include "armature/physics/CCColliderDetector.h" +#include "armature/utils/CCArmatureDataManager.h" +#include "armature/utils/CCArmatureDefine.h" +#include "armature/utils/CCDataReaderHelper.h" +#include "armature/utils/CCSpriteFrameCacheHelper.h" +#include "armature/utils/CCTransformHelp.h" +#include "armature/utils/CCTweenFunction.h" +#include "armature/utils/CCUtilMath.h" +#include "components/CCComAttribute.h" +#include "components/CCComAudio.h" +#include "components/CCComController.h" +#include "components/CCComRender.h" +#include "components/CCInputDelegate.h" +#include "json/CSContentJsonDictionary.h" +#include "json/DictionaryHelper.h" +#include "reader/CCSGUIReader.h" +#include "reader/CCSSceneReader.h" + +#endif diff --git a/cocos/editor-support/cocostudio/action/CCActionFrame.cpp b/cocos/editor-support/cocostudio/action/CCActionFrame.cpp index 5973f73196..724ed9a075 100644 --- a/cocos/editor-support/cocostudio/action/CCActionFrame.cpp +++ b/cocos/editor-support/cocostudio/action/CCActionFrame.cpp @@ -24,7 +24,9 @@ #include "CCActionFrame.h" -NS_CC_EXT_BEGIN + using namespace cocos2d; + +namespace cocostudio { ActionFrame::ActionFrame() : _frameType(0) @@ -222,4 +224,4 @@ Action* ActionTintFrame::getAction(float fDuration) } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/editor-support/cocostudio/action/CCActionFrame.h b/cocos/editor-support/cocostudio/action/CCActionFrame.h index 30902a90bf..c928db23cd 100644 --- a/cocos/editor-support/cocostudio/action/CCActionFrame.h +++ b/cocos/editor-support/cocostudio/action/CCActionFrame.h @@ -26,9 +26,8 @@ #define __ActionFRAME_H__ #include "cocos2d.h" -#include "ExtensionMacros.h" -NS_CC_EXT_BEGIN +namespace cocostudio { enum FrameType { @@ -40,7 +39,7 @@ enum FrameType kKeyframeMax }; -class ActionFrame:public Object +class ActionFrame:public cocos2d::Object { public: @@ -118,7 +117,7 @@ public: * * @return CCAction */ - virtual Action* getAction(float fDuration); + virtual cocos2d::Action* getAction(float fDuration); protected: int _frameType; int _easingType; @@ -145,14 +144,14 @@ public: * * @param the move action position. */ - void setPosition(Point pos); + void setPosition(cocos2d::Point pos); /** * Gets the move action position. * * @return the move action position. */ - Point getPosition(); + cocos2d::Point getPosition(); /** * Gets the CCAction of ActionFrame. @@ -161,9 +160,9 @@ public: * * @return CCAction */ - virtual Action* getAction(float fDuration); + virtual cocos2d::Action* getAction(float fDuration); protected: - Point _position; + cocos2d::Point _position; }; class ActionScaleFrame:public ActionFrame @@ -215,7 +214,7 @@ public: * * @return CCAction */ - virtual Action* getAction(float fDuration); + virtual cocos2d::Action* getAction(float fDuration); protected: float _scaleX; float _scaleY; @@ -256,7 +255,7 @@ public: * * @return CCAction */ - virtual Action* getAction(float fDuration); + virtual cocos2d::Action* getAction(float fDuration); protected: float _rotation; }; @@ -296,7 +295,7 @@ public: * * @return CCAction */ - virtual Action* getAction(float fDuration); + virtual cocos2d::Action* getAction(float fDuration); protected: float _opacity; }; @@ -321,14 +320,14 @@ public: * * @param ccolor the tint action color */ - void setColor(Color3B ccolor); + void setColor(cocos2d::Color3B ccolor); /** * Gets the tint action color. * * @return the tint action color. */ - Color3B getColor(); + cocos2d::Color3B getColor(); /** * Gets the CCAction of ActionFrame. @@ -337,11 +336,11 @@ public: * * @return CCAction */ - virtual Action* getAction(float fDuration); + virtual cocos2d::Action* getAction(float fDuration); protected: - Color3B _color; + cocos2d::Color3B _color; }; -NS_CC_EXT_END +} #endif diff --git a/cocos/editor-support/cocostudio/action/CCActionFrameEasing.cpp b/cocos/editor-support/cocostudio/action/CCActionFrameEasing.cpp index 8b235160d8..1e6513b56c 100644 --- a/cocos/editor-support/cocostudio/action/CCActionFrameEasing.cpp +++ b/cocos/editor-support/cocostudio/action/CCActionFrameEasing.cpp @@ -24,8 +24,8 @@ #include #include "CCActionFrameEasing.h" -#include "../Json/DictionaryHelper.h" -NS_CC_EXT_BEGIN +#include "json/DictionaryHelper.h" +namespace cocostudio { #ifndef M_PI_X_2 #define M_PI_X_2 (float)M_PI * 2.0f @@ -186,4 +186,4 @@ float ActionFrameEasing::easeValue(float t) return 0; } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/editor-support/cocostudio/action/CCActionFrameEasing.h b/cocos/editor-support/cocostudio/action/CCActionFrameEasing.h index 66c8aaea0f..aa6fd570e4 100644 --- a/cocos/editor-support/cocostudio/action/CCActionFrameEasing.h +++ b/cocos/editor-support/cocostudio/action/CCActionFrameEasing.h @@ -26,10 +26,9 @@ #define __ActionFrameEasing_H__ #include "cocos2d.h" -#include "ExtensionMacros.h" -#include "../Json/CSContentJsonDictionary.h" +#include "json/CSContentJsonDictionary.h" -NS_CC_EXT_BEGIN +namespace cocostudio { enum FrameEasingType { @@ -68,6 +67,6 @@ public: float easeValue(float t); }; -NS_CC_EXT_END +} #endif diff --git a/cocos/editor-support/cocostudio/action/CCActionManagerEx.cpp b/cocos/editor-support/cocostudio/action/CCActionManagerEx.cpp index 3f927c1b84..8d842715b1 100644 --- a/cocos/editor-support/cocostudio/action/CCActionManagerEx.cpp +++ b/cocos/editor-support/cocostudio/action/CCActionManagerEx.cpp @@ -23,9 +23,11 @@ ****************************************************************************/ #include "CCActionManagerEx.h" -#include "../Json/DictionaryHelper.h" +#include "json/DictionaryHelper.h" -NS_CC_EXT_BEGIN + using namespace cocos2d; + +namespace cocostudio { static ActionManagerEx* sharedActionManager = NULL; @@ -55,7 +57,7 @@ ActionManagerEx::~ActionManagerEx() _pActionDic->release(); } -void ActionManagerEx::initWithDictionary(const char* jsonName,cs::JsonDictionary *dic,Object* root) +void ActionManagerEx::initWithDictionary(const char* jsonName,JsonDictionary *dic,Object* root) { std::string path = jsonName; int pos = path.find_last_of("/"); @@ -66,7 +68,7 @@ void ActionManagerEx::initWithDictionary(const char* jsonName,cs::JsonDictionary for (int i=0; iautorelease(); - cs::JsonDictionary* actionDic = DICTOOL->getDictionaryFromArray_json(dic, "actionlist", i); + JsonDictionary* actionDic = DICTOOL->getDictionaryFromArray_json(dic, "actionlist", i); action->initWithDictionary(actionDic,root); actionList->addObject(action); CC_SAFE_DELETE(actionDic); @@ -108,4 +110,4 @@ void ActionManagerEx::releaseActions() } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/editor-support/cocostudio/action/CCActionManagerEx.h b/cocos/editor-support/cocostudio/action/CCActionManagerEx.h index 21ae504718..4c757dfa37 100644 --- a/cocos/editor-support/cocostudio/action/CCActionManagerEx.h +++ b/cocos/editor-support/cocostudio/action/CCActionManagerEx.h @@ -26,13 +26,12 @@ #define __ActionMANAGER_H__ #include "cocos2d.h" -#include "ExtensionMacros.h" #include "CCActionObject.h" -#include "../Json/CSContentJsonDictionary.h" +#include "json/CSContentJsonDictionary.h" -NS_CC_EXT_BEGIN +namespace cocostudio { -class ActionManagerEx:public Object +class ActionManagerEx:public cocos2d::Object { public: @@ -77,7 +76,7 @@ public: void playActionByName(const char* jsonName,const char* actionName); /*init properties with json dictionay*/ - void initWithDictionary(const char* jsonName,cs::JsonDictionary* dic,Object* root); + void initWithDictionary(const char* jsonName,JsonDictionary* dic,cocos2d::Object* root); /** * Release all actions. @@ -86,9 +85,9 @@ public: void releaseActions(); protected: - Dictionary* _pActionDic; + cocos2d::Dictionary* _pActionDic; }; -NS_CC_EXT_END +} #endif diff --git a/cocos/editor-support/cocostudio/action/CCActionNode.cpp b/cocos/editor-support/cocostudio/action/CCActionNode.cpp index 31d6e7fe6e..ca7db6cc5f 100644 --- a/cocos/editor-support/cocostudio/action/CCActionNode.cpp +++ b/cocos/editor-support/cocostudio/action/CCActionNode.cpp @@ -24,11 +24,14 @@ THE SOFTWARE. #include "CCActionNode.h" #include "CCActionFrameEasing.h" -#include "../GUI/BaseClasses/UIWidget.h" -#include "../GUI/System/UIHelper.h" -#include "../Json/DictionaryHelper.h" +#include "base-classes/UIWidget.h" +#include "system/UIHelper.h" +#include "json/DictionaryHelper.h" -NS_CC_EXT_BEGIN +using namespace cocos2d; +using namespace gui; + +namespace cocostudio { ActionNode::ActionNode() : _currentFrameIndex(0) @@ -70,13 +73,13 @@ ActionNode::~ActionNode() } } -void ActionNode::initWithDictionary(cs::JsonDictionary *dic,Object* root) +void ActionNode::initWithDictionary(JsonDictionary *dic,Object* root) { setActionTag(DICTOOL->getIntValue_json(dic, "ActionTag")); int actionFrameCount = DICTOOL->getArrayCount_json(dic, "actionframelist"); for (int i=0; igetDictionaryFromArray_json(dic, "actionframelist", i); + JsonDictionary* actionFrameDic = DICTOOL->getDictionaryFromArray_json(dic, "actionframelist", i); int frameInex = DICTOOL->getIntValue_json(actionFrameDic,"frameid"); bool existPosition = DICTOOL->checkObjectExist_json(actionFrameDic,"positionx"); @@ -477,4 +480,4 @@ void ActionNode::easingToFrame(float duration,float delayTime,ActionFrame* destF cAction->update(delayTime); } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/editor-support/cocostudio/action/CCActionNode.h b/cocos/editor-support/cocostudio/action/CCActionNode.h index 377ef603b3..9e69981bbb 100644 --- a/cocos/editor-support/cocostudio/action/CCActionNode.h +++ b/cocos/editor-support/cocostudio/action/CCActionNode.h @@ -26,13 +26,12 @@ #define __ActionNODE_H__ #include "cocos2d.h" -#include "ExtensionMacros.h" #include "CCActionFrame.h" -#include "../Json/CSContentJsonDictionary.h" +#include "json/CSContentJsonDictionary.h" -NS_CC_EXT_BEGIN +namespace cocostudio { -class ActionNode:public Object +class ActionNode:public cocos2d::Object { public: @@ -77,14 +76,14 @@ public: * * @param node which will run a action */ - void setObject(Object* node); + void setObject(cocos2d::Object* node); /** * Gets node which will run a action. * * @return node which will run a action */ - Object* getObject(); + cocos2d::Object* getObject(); /** * Insets a ActionFrame to ActionNode. @@ -148,7 +147,7 @@ public: virtual void stopAction(); /*init properties with a json dictionary*/ - virtual void initWithDictionary(cs::JsonDictionary* dic,Object* root); + virtual void initWithDictionary(JsonDictionary* dic,cocos2d::Object* root); protected: int _currentFrameIndex; int _destFrameIndex; @@ -156,21 +155,21 @@ protected: float _fUnitTime; int _actionTag; - Spawn * _actionSpawn; - Action* _action; - Object* _object; + cocos2d::Spawn * _actionSpawn; + cocos2d::Action* _action; + cocos2d::Object* _object; - Array* _frameArray; + cocos2d::Array* _frameArray; int _frameArrayNum; protected: - virtual Node* getActionNode(); - virtual Spawn * refreshActionProperty(); + virtual cocos2d::Node* getActionNode(); + virtual cocos2d::Spawn * refreshActionProperty(); virtual void runAction(); - virtual void initActionNodeFromRoot(Object* root); + virtual void initActionNodeFromRoot(cocos2d::Object* root); virtual void easingToFrame(float duration,float delayTime,ActionFrame* destFrame); }; -NS_CC_EXT_END +} #endif diff --git a/cocos/editor-support/cocostudio/action/CCActionObject.cpp b/cocos/editor-support/cocostudio/action/CCActionObject.cpp index 3d8ba4f0ea..c649268a23 100644 --- a/cocos/editor-support/cocostudio/action/CCActionObject.cpp +++ b/cocos/editor-support/cocostudio/action/CCActionObject.cpp @@ -23,9 +23,11 @@ ****************************************************************************/ #include "CCActionObject.h" -#include "../Json/DictionaryHelper.h" +#include "json/DictionaryHelper.h" -NS_CC_EXT_BEGIN + using namespace cocos2d; + +namespace cocostudio { ActionObject::ActionObject() : _actionNodeList(NULL) @@ -94,7 +96,7 @@ bool ActionObject::isPlaying() return _bPlaying; } -void ActionObject::initWithDictionary(cs::JsonDictionary *dic,Object* root) +void ActionObject::initWithDictionary(JsonDictionary *dic,Object* root) { setName(DICTOOL->getStringValue_json(dic, "name")); setLoop(DICTOOL->getBooleanValue_json(dic, "loop")); @@ -103,7 +105,7 @@ void ActionObject::initWithDictionary(cs::JsonDictionary *dic,Object* root) for (int i=0; iautorelease(); - cs::JsonDictionary* actionNodeDic = DICTOOL->getDictionaryFromArray_json(dic, "actionnodelist", i); + JsonDictionary* actionNodeDic = DICTOOL->getDictionaryFromArray_json(dic, "actionnodelist", i); actionNode->initWithDictionary(actionNodeDic,root); actionNode->setUnitTime(getUnitTime()); _actionNodeList->addObject(actionNode); @@ -172,4 +174,4 @@ void ActionObject::updateToFrameByTime(float fTime) } } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/editor-support/cocostudio/action/CCActionObject.h b/cocos/editor-support/cocostudio/action/CCActionObject.h index d17f5658b4..34807e2127 100644 --- a/cocos/editor-support/cocostudio/action/CCActionObject.h +++ b/cocos/editor-support/cocostudio/action/CCActionObject.h @@ -26,13 +26,12 @@ #define __ActionObject_H__ #include "cocos2d.h" -#include "ExtensionMacros.h" #include "CCActionNode.h" -#include "../Json/CSContentJsonDictionary.h" +#include "json/CSContentJsonDictionary.h" -NS_CC_EXT_BEGIN +namespace cocostudio { -class ActionObject:public Object +class ActionObject:public cocos2d::Object { public: @@ -142,10 +141,10 @@ public: void updateToFrameByTime(float fTime); /*init properties with a json dictionary*/ - void initWithDictionary(cs::JsonDictionary* dic,Object* root); + void initWithDictionary(JsonDictionary* dic,cocos2d::Object* root); protected: - Array* _actionNodeList;/*actionnode*/ + cocos2d::Array* _actionNodeList;/*actionnode*/ std::string _name; bool _loop; bool _bPause; @@ -154,6 +153,6 @@ protected: float _currentTime; }; -NS_CC_EXT_END +} #endif diff --git a/cocos/editor-support/cocostudio/armature/CCArmature.cpp b/cocos/editor-support/cocostudio/armature/CCArmature.cpp index d7817b16b1..7d4777d3f3 100644 --- a/cocos/editor-support/cocostudio/armature/CCArmature.cpp +++ b/cocos/editor-support/cocostudio/armature/CCArmature.cpp @@ -35,8 +35,10 @@ THE SOFTWARE. #include "chipmunk.h" #endif +using namespace cocos2d; -NS_CC_EXT_ARMATURE_BEGIN + +namespace cocostudio { Armature *Armature::create() { @@ -788,4 +790,4 @@ cpShape *Armature::getShapeList() #endif -NS_CC_EXT_ARMATURE_END +} diff --git a/cocos/editor-support/cocostudio/armature/CCArmature.h b/cocos/editor-support/cocostudio/armature/CCArmature.h index 204ab34d8a..bc0843c540 100644 --- a/cocos/editor-support/cocostudio/armature/CCArmature.h +++ b/cocos/editor-support/cocostudio/armature/CCArmature.h @@ -35,7 +35,7 @@ THE SOFTWARE. class b2Body; struct cpBody; -NS_CC_EXT_ARMATURE_BEGIN +namespace cocostudio { CC_DEPRECATED_ATTRIBUTE typedef ProcessBase CCProcessBase; CC_DEPRECATED_ATTRIBUTE typedef BaseData CCBaseData; @@ -66,7 +66,7 @@ CC_DEPRECATED_ATTRIBUTE typedef ArmatureAnimation CCArmatureAnimation; CC_DEPRECATED_ATTRIBUTE typedef Armature CCArmature; CC_DEPRECATED_ATTRIBUTE typedef ArmatureDataManager CCArmatureDataManager; -class Armature : public NodeRGBA, public BlendProtocol +class Armature : public cocos2d::NodeRGBA, public cocos2d::BlendProtocol { public: @@ -139,12 +139,12 @@ public: * Get Armature's bone dictionary * @return Armature's bone dictionary */ - Dictionary *getBoneDic(); + cocos2d::Dictionary *getBoneDic(); /** * This boundingBox will calculate all bones' boundingBox every time */ - virtual Rect getBoundingBox() const; + virtual cocos2d::Rect getBoundingBox() const; Bone *getBoneAtPoint(float x, float y); @@ -157,10 +157,10 @@ public: virtual void update(float dt) override; virtual void draw() override; - virtual const AffineTransform& getNodeToParentTransform() const override; + virtual const cocos2d::AffineTransform& getNodeToParentTransform() const override; - inline void setBlendFunc(const BlendFunc &blendFunc) override { _blendFunc = blendFunc; } - inline const BlendFunc &getBlendFunc(void) const override{ return _blendFunc; } + inline void setBlendFunc(const cocos2d::BlendFunc &blendFunc) override { _blendFunc = blendFunc; } + inline const cocos2d::BlendFunc &getBlendFunc(void) const override{ return _blendFunc; } /** @@ -195,7 +195,7 @@ protected: CC_SYNTHESIZE(std::string, _name, Name); - CC_SYNTHESIZE(TextureAtlas *, _atlas, TextureAtlas); + CC_SYNTHESIZE(cocos2d::TextureAtlas *, _atlas, TextureAtlas); CC_SYNTHESIZE(Bone *, _parentBone, ParentBone); @@ -204,13 +204,13 @@ protected: protected: mutable bool _armatureTransformDirty; - Dictionary *_boneDic; //! The dictionary of the bones, include all bones in the armature, no matter it is the direct bone or the indirect bone. It is different from m_pChindren. + cocos2d::Dictionary *_boneDic; //! The dictionary of the bones, include all bones in the armature, no matter it is the direct bone or the indirect bone. It is different from m_pChindren. - Array *_topBoneList; + cocos2d::Array *_topBoneList; - BlendFunc _blendFunc; //! It's required for CCTextureProtocol inheritance + cocos2d::BlendFunc _blendFunc; //! It's required for CCTextureProtocol inheritance - Point _offsetPoint; + cocos2d::Point _offsetPoint; ArmatureAnimation *_animation; @@ -221,6 +221,6 @@ protected: #endif }; -NS_CC_EXT_ARMATURE_END +} #endif /*__CCARMATURE_H__*/ diff --git a/cocos/editor-support/cocostudio/armature/CCBone.cpp b/cocos/editor-support/cocostudio/armature/CCBone.cpp index e6063e51c3..52dea85860 100644 --- a/cocos/editor-support/cocostudio/armature/CCBone.cpp +++ b/cocos/editor-support/cocostudio/armature/CCBone.cpp @@ -29,7 +29,9 @@ THE SOFTWARE. #include "utils/CCTransformHelp.h" #include "display/CCDisplayManager.h" -NS_CC_EXT_ARMATURE_BEGIN +using namespace cocos2d; + +namespace cocostudio { Bone *Bone::create() { @@ -373,4 +375,4 @@ Array *Bone::getColliderBodyList() } -NS_CC_EXT_ARMATURE_END +} diff --git a/cocos/editor-support/cocostudio/armature/CCBone.h b/cocos/editor-support/cocostudio/armature/CCBone.h index 9f979e616a..85edc0f5b1 100644 --- a/cocos/editor-support/cocostudio/armature/CCBone.h +++ b/cocos/editor-support/cocostudio/armature/CCBone.h @@ -31,12 +31,12 @@ THE SOFTWARE. #include "display/CCDecorativeDisplay.h" #include "display/CCDisplayManager.h" -NS_CC_EXT_ARMATURE_BEGIN +namespace cocostudio { class Armature; -class Bone : public NodeRGBA +class Bone : public cocos2d::NodeRGBA { public: /** @@ -84,7 +84,7 @@ public: */ void addDisplay(DisplayData *displayData, int index); - void addDisplay(Node *display, int index); + void addDisplay(cocos2d::Node *display, int index); void changeDisplayByIndex(int index, bool force); @@ -124,7 +124,7 @@ public: void update(float delta); - void updateDisplayedColor(const Color3B &parentColor); + void updateDisplayedColor(const cocos2d::Color3B &parentColor); void updateDisplayedOpacity(GLubyte parentOpacity); //! Update color to render display @@ -144,15 +144,15 @@ public: virtual bool isTransformDirty(); - virtual AffineTransform getNodeToArmatureTransform() const; - virtual AffineTransform getNodeToWorldTransform() const override; + virtual cocos2d::AffineTransform getNodeToArmatureTransform() const; + virtual cocos2d::AffineTransform getNodeToWorldTransform() const override; Node *getDisplayRenderNode(); /* * Get the ColliderBody list in this bone. The object in the Array is ColliderBody. */ - virtual Array *getColliderBodyList(); + virtual cocos2d::Array *getColliderBodyList(); public: /* @@ -188,9 +188,9 @@ protected: bool _boneTransformDirty; //! Whether or not transform dirty //! self Transform, use this to change display's state - AffineTransform _worldTransform; + cocos2d::AffineTransform _worldTransform; }; -NS_CC_EXT_ARMATURE_END +} #endif /*__CCBONE_H__*/ diff --git a/cocos/editor-support/cocostudio/armature/animation/CCArmatureAnimation.cpp b/cocos/editor-support/cocostudio/armature/animation/CCArmatureAnimation.cpp index 02c0e8d688..4c42af7d1e 100644 --- a/cocos/editor-support/cocostudio/armature/animation/CCArmatureAnimation.cpp +++ b/cocos/editor-support/cocostudio/armature/animation/CCArmatureAnimation.cpp @@ -23,14 +23,16 @@ THE SOFTWARE. ****************************************************************************/ #include "CCArmatureAnimation.h" -#include "../CCArmature.h" -#include "../CCBone.h" -#include "../utils/CCArmatureDefine.h" -#include "../utils/CCUtilMath.h" -#include "../datas/CCDatas.h" +#include "armature/CCArmature.h" +#include "armature/CCBone.h" +#include "armature/utils/CCArmatureDefine.h" +#include "armature/utils/CCUtilMath.h" +#include "armature/datas/CCDatas.h" + +using namespace cocos2d; -NS_CC_EXT_ARMATURE_BEGIN +namespace cocostudio { ArmatureAnimation *ArmatureAnimation::create(Armature *armature) { @@ -403,4 +405,4 @@ void ArmatureAnimation::frameEvent(Bone *bone, const char *frameEventName, int o (_frameEventTarget->*_frameEventCallFunc)(bone, frameEventName, originFrameIndex, currentFrameIndex); } } -NS_CC_EXT_ARMATURE_END +} diff --git a/cocos/editor-support/cocostudio/armature/animation/CCArmatureAnimation.h b/cocos/editor-support/cocostudio/armature/animation/CCArmatureAnimation.h index 967878874a..b9ac3d4200 100644 --- a/cocos/editor-support/cocostudio/armature/animation/CCArmatureAnimation.h +++ b/cocos/editor-support/cocostudio/armature/animation/CCArmatureAnimation.h @@ -28,7 +28,7 @@ THE SOFTWARE. #include "CCProcessBase.h" -NS_CC_EXT_ARMATURE_BEGIN +namespace cocostudio { enum MovementEventType @@ -42,8 +42,8 @@ enum MovementEventType class Armature; class Bone; -typedef void (Object::*SEL_MovementEventCallFunc)(Armature *, MovementEventType, const char *); -typedef void (Object::*SEL_FrameEventCallFunc)(Bone *, const char *, int, int); +typedef void (cocos2d::Object::*SEL_MovementEventCallFunc)(Armature *, MovementEventType, const char *); +typedef void (cocos2d::Object::*SEL_FrameEventCallFunc)(Bone *, const char *, int, int); #define movementEvent_selector(_SELECTOR) (SEL_MovementEventCallFunc)(&_SELECTOR) #define frameEvent_selector(_SELECTOR) (SEL_FrameEventCallFunc)(&_SELECTOR) @@ -158,13 +158,13 @@ public: * Set armature's movement event callback function * To disconnect this event, just setMovementEventCallFunc(NULL, NULL); */ - void setMovementEventCallFunc(Object *target, SEL_MovementEventCallFunc callFunc); + void setMovementEventCallFunc(cocos2d::Object *target, SEL_MovementEventCallFunc callFunc); /** * Set armature's frame event callback function * To disconnect this event, just setFrameEventCallFunc(NULL, NULL); */ - void setFrameEventCallFunc(Object *target, SEL_FrameEventCallFunc callFunc); + void setFrameEventCallFunc(cocos2d::Object *target, SEL_FrameEventCallFunc callFunc); protected: @@ -199,7 +199,7 @@ protected: int _toIndex; //! The frame index in MovementData->m_pMovFrameDataArr, it's different from m_iFrameIndex. - Array *_tweenList; + cocos2d::Array *_tweenList; protected: /** @@ -220,10 +220,10 @@ protected: SEL_FrameEventCallFunc _frameEventCallFunc; - Object *_movementEventTarget; - Object *_frameEventTarget; + cocos2d::Object *_movementEventTarget; + cocos2d::Object *_frameEventTarget; }; -NS_CC_EXT_ARMATURE_END +} #endif /*__CCANIMATION_H__*/ diff --git a/cocos/editor-support/cocostudio/armature/animation/CCProcessBase.cpp b/cocos/editor-support/cocostudio/armature/animation/CCProcessBase.cpp index 00609f83b8..a30f68abd4 100644 --- a/cocos/editor-support/cocostudio/armature/animation/CCProcessBase.cpp +++ b/cocos/editor-support/cocostudio/armature/animation/CCProcessBase.cpp @@ -23,9 +23,11 @@ THE SOFTWARE. ****************************************************************************/ #include "CCProcessBase.h" -#include "../utils/CCUtilMath.h" +#include "armature/utils/CCUtilMath.h" -NS_CC_EXT_ARMATURE_BEGIN +using namespace cocos2d; + +namespace cocostudio { ProcessBase::ProcessBase(void) : _processScale(1) @@ -149,4 +151,4 @@ int ProcessBase::getCurrentFrameIndex() return _curFrameIndex; } -NS_CC_EXT_ARMATURE_END +} diff --git a/cocos/editor-support/cocostudio/armature/animation/CCProcessBase.h b/cocos/editor-support/cocostudio/armature/animation/CCProcessBase.h index 5ee5a1ca01..dbde23dd1f 100644 --- a/cocos/editor-support/cocostudio/armature/animation/CCProcessBase.h +++ b/cocos/editor-support/cocostudio/armature/animation/CCProcessBase.h @@ -26,10 +26,10 @@ THE SOFTWARE. #ifndef __CCPROCESSBASE_H__ #define __CCPROCESSBASE_H__ -#include "../utils/CCArmatureDefine.h" -#include "../datas/CCDatas.h" +#include "armature/utils/CCArmatureDefine.h" +#include "armature/datas/CCDatas.h" -NS_CC_EXT_ARMATURE_BEGIN +namespace cocostudio { enum AnimationType { @@ -47,7 +47,7 @@ enum AnimationType }; -class ProcessBase : public Object +class ProcessBase : public cocos2d::Object { public: /** @@ -169,6 +169,6 @@ protected: bool _isLoopBack; }; -NS_CC_EXT_ARMATURE_END +} #endif /*__CCPROCESSBASE_H__*/ diff --git a/cocos/editor-support/cocostudio/armature/animation/CCTween.cpp b/cocos/editor-support/cocostudio/armature/animation/CCTween.cpp index b66e33465f..23896d1e8b 100644 --- a/cocos/editor-support/cocostudio/armature/animation/CCTween.cpp +++ b/cocos/editor-support/cocostudio/armature/animation/CCTween.cpp @@ -25,14 +25,14 @@ THE SOFTWARE. #include "CCTween.h" #include "CCArmatureAnimation.h" -#include "../CCBone.h" -#include "../CCArmature.h" -#include "../utils/CCUtilMath.h" -#include "../utils/CCTweenFunction.h" -#include "../utils/CCTransformHelp.h" +#include "armature/CCBone.h" +#include "armature/CCArmature.h" +#include "armature/utils/CCUtilMath.h" +#include "armature/utils/CCTweenFunction.h" +#include "armature/utils/CCTransformHelp.h" -NS_CC_EXT_ARMATURE_BEGIN +namespace cocostudio { Tween *Tween::create(Bone *bone) { @@ -462,4 +462,4 @@ float Tween::updateFrameData(float currentPercent) return currentPercent; } -NS_CC_EXT_ARMATURE_END +} diff --git a/cocos/editor-support/cocostudio/armature/animation/CCTween.h b/cocos/editor-support/cocostudio/armature/animation/CCTween.h index b4a64bc3ef..bcbdde822c 100644 --- a/cocos/editor-support/cocostudio/armature/animation/CCTween.h +++ b/cocos/editor-support/cocostudio/armature/animation/CCTween.h @@ -27,9 +27,9 @@ THE SOFTWARE. #define __CCTWEEN_H__ #include "CCProcessBase.h" -#include "../utils/CCTweenFunction.h" +#include "armature/utils/CCTweenFunction.h" -NS_CC_EXT_ARMATURE_BEGIN +namespace cocostudio { class Bone; class ArmatureAnimation; @@ -147,6 +147,6 @@ protected: }; -NS_CC_EXT_ARMATURE_END +} #endif /*__CCTWEEN_H__*/ diff --git a/cocos/editor-support/cocostudio/armature/datas/CCDatas.cpp b/cocos/editor-support/cocostudio/armature/datas/CCDatas.cpp index 38c31db4b7..e03213ab8a 100644 --- a/cocos/editor-support/cocostudio/armature/datas/CCDatas.cpp +++ b/cocos/editor-support/cocostudio/armature/datas/CCDatas.cpp @@ -23,10 +23,12 @@ THE SOFTWARE. ****************************************************************************/ #include "CCDatas.h" -#include "../utils/CCUtilMath.h" -#include "../utils/CCTransformHelp.h" +#include "armature/utils/CCUtilMath.h" +#include "armature/utils/CCTransformHelp.h" -NS_CC_EXT_ARMATURE_BEGIN +using namespace cocos2d; + +namespace cocostudio { BaseData::BaseData() @@ -425,4 +427,4 @@ ContourData *TextureData::getContourData(int index) } -NS_CC_EXT_ARMATURE_END +} diff --git a/cocos/editor-support/cocostudio/armature/datas/CCDatas.h b/cocos/editor-support/cocostudio/armature/datas/CCDatas.h index be2b67e45c..81fca8ebcb 100644 --- a/cocos/editor-support/cocostudio/armature/datas/CCDatas.h +++ b/cocos/editor-support/cocostudio/armature/datas/CCDatas.h @@ -25,8 +25,8 @@ THE SOFTWARE. #ifndef __CCARMATURE_DATAS_H__ #define __CCARMATURE_DATAS_H__ -#include "../utils/CCArmatureDefine.h" -#include "../utils/CCTweenFunction.h" +#include "armature/utils/CCArmatureDefine.h" +#include "armature/utils/CCTweenFunction.h" #define CC_CREATE_NO_PARAM_NO_INIT(varType)\ @@ -55,12 +55,12 @@ public: \ return NULL;\ } -NS_CC_EXT_ARMATURE_BEGIN +namespace cocostudio { /** * The base node include a lot of attributes. */ -class BaseData : public Object +class BaseData : public cocos2d::Object { public: CC_CREATE_NO_PARAM_NO_INIT(BaseData) @@ -89,8 +89,8 @@ public: */ virtual void subtract(BaseData *from, BaseData *to, bool limit); - virtual void setColor(const Color4B &color); - virtual Color4B getColor(); + virtual void setColor(const cocos2d::Color4B &color); + virtual cocos2d::Color4B getColor(); public: float x; //! position x attribute float y; //! position y attribute @@ -126,7 +126,7 @@ enum DisplayType CS_DISPLAY_MAX }; -class DisplayData : public Object +class DisplayData : public cocos2d::Object { public: CC_CREATE_NO_PARAM_NO_INIT(DisplayData) @@ -269,8 +269,8 @@ public: public: std::string name; //! the bone's name std::string parentName; //! the bone parent's name - Array displayDataList; //! save DisplayData informations for the Bone - AffineTransform boneDataTransform; + cocos2d::Array displayDataList; //! save DisplayData informations for the Bone + cocos2d::AffineTransform boneDataTransform; }; @@ -279,7 +279,7 @@ public: * When we create a Armature, we need to get each Bone's BoneData as it's init information. * So we can get a BoneData from the Dictionary saved in the ArmatureData. */ -class ArmatureData : public Object +class ArmatureData : public cocos2d::Object { public: CC_CREATE_NO_PARAM(ArmatureData) @@ -299,7 +299,7 @@ public: BoneData *getBoneData(const char *boneName); public: std::string name; - Dictionary boneDataDic; + cocos2d::Dictionary boneDataDic; float dataVersion; }; @@ -362,7 +362,7 @@ public: }; -class MovementBoneData : public Object +class MovementBoneData : public cocos2d::Object { public: CC_CREATE_NO_PARAM(MovementBoneData) @@ -387,11 +387,11 @@ public: float duration; //! this Bone in this movement will last m_iDuration frames std::string name; //! bone name - Array frameList; + cocos2d::Array frameList; }; -class MovementData : public Object +class MovementData : public cocos2d::Object { public: CC_CREATE_NO_PARAM_NO_INIT(MovementData) @@ -442,7 +442,7 @@ public: * @key const char * * @value MovementBoneData * */ - Dictionary movBoneDataDic; + cocos2d::Dictionary movBoneDataDic; }; @@ -451,7 +451,7 @@ public: * The struct is AnimationData -> MovementData -> MovementBoneData -> FrameData * -> MovementFrameData */ -class AnimationData : public Object +class AnimationData : public cocos2d::Object { public: CC_CREATE_NO_PARAM_NO_INIT(AnimationData) @@ -471,12 +471,12 @@ public: int getMovementCount(); public: std::string name; - Dictionary movementDataDic; + cocos2d::Dictionary movementDataDic; std::vector movementNames; }; -struct ContourVertex2 : public Object +struct ContourVertex2 : public cocos2d::Object { ContourVertex2(float x, float y) { @@ -491,7 +491,7 @@ struct ContourVertex2 : public Object /* * ContourData include a contour vertex information */ -class ContourData : public Object +class ContourData : public cocos2d::Object { public: CC_CREATE_NO_PARAM(ContourData) @@ -507,9 +507,9 @@ public: ~ContourData(void); virtual bool init(); - virtual void addVertex(Point *vertex); + virtual void addVertex(cocos2d::Point *vertex); public: - Array vertexList; //! Save contour vertex info, vertex saved in a Point + cocos2d::Array vertexList; //! Save contour vertex info, vertex saved in a Point }; @@ -518,7 +518,7 @@ public: /* * TextureData include a texture's information */ -class TextureData : public Object +class TextureData : public cocos2d::Object { public: CC_CREATE_NO_PARAM(TextureData) @@ -547,10 +547,10 @@ public: std::string name; //! The texture's name - Array contourDataList; + cocos2d::Array contourDataList; }; -NS_CC_EXT_ARMATURE_END +} #endif /*__CCARMATURE_DATAS_H__*/ diff --git a/cocos/editor-support/cocostudio/armature/display/CCBatchNode.cpp b/cocos/editor-support/cocostudio/armature/display/CCBatchNode.cpp index 16dd1b449b..04ae69a524 100644 --- a/cocos/editor-support/cocostudio/armature/display/CCBatchNode.cpp +++ b/cocos/editor-support/cocostudio/armature/display/CCBatchNode.cpp @@ -23,10 +23,12 @@ THE SOFTWARE. ****************************************************************************/ #include "CCBatchNode.h" -#include "../utils/CCArmatureDefine.h" -#include "../CCArmature.h" +#include "armature/utils/CCArmatureDefine.h" +#include "armature/CCArmature.h" -NS_CC_EXT_ARMATURE_BEGIN +using namespace cocos2d; + +namespace cocostudio { BatchNode *BatchNode::create() { @@ -117,4 +119,4 @@ void BatchNode::draw() } } -NS_CC_EXT_ARMATURE_END +} diff --git a/cocos/editor-support/cocostudio/armature/display/CCBatchNode.h b/cocos/editor-support/cocostudio/armature/display/CCBatchNode.h index b79fc97d5d..fac221adb6 100644 --- a/cocos/editor-support/cocostudio/armature/display/CCBatchNode.h +++ b/cocos/editor-support/cocostudio/armature/display/CCBatchNode.h @@ -25,11 +25,11 @@ THE SOFTWARE. #ifndef __CCBATCHNODE_H__ #define __CCBATCHNODE_H__ -#include "../utils/CCArmatureDefine.h" +#include "armature/utils/CCArmatureDefine.h" -NS_CC_EXT_ARMATURE_BEGIN +namespace cocostudio { -class BatchNode : public Node +class BatchNode : public cocos2d::Node { public: static BatchNode *create(); @@ -40,14 +40,14 @@ public: BatchNode(); virtual bool init(); - virtual void addChild(Node *child, int zOrder, int tag); + virtual void addChild(cocos2d::Node *child, int zOrder, int tag); virtual void visit(); void draw(); protected: - TextureAtlas *_atlas; + cocos2d::TextureAtlas *_atlas; }; -NS_CC_EXT_ARMATURE_END +} #endif /*__CCBATCHNODE_H__*/ diff --git a/cocos/editor-support/cocostudio/armature/display/CCDecorativeDisplay.cpp b/cocos/editor-support/cocostudio/armature/display/CCDecorativeDisplay.cpp index d92fef659b..0213219ddb 100644 --- a/cocos/editor-support/cocostudio/armature/display/CCDecorativeDisplay.cpp +++ b/cocos/editor-support/cocostudio/armature/display/CCDecorativeDisplay.cpp @@ -24,7 +24,9 @@ THE SOFTWARE. #include "CCDecorativeDisplay.h" -NS_CC_EXT_ARMATURE_BEGIN +using namespace cocos2d; + +namespace cocostudio { DecorativeDisplay *DecorativeDisplay::create() { @@ -64,4 +66,4 @@ bool DecorativeDisplay::init() return true; } -NS_CC_EXT_ARMATURE_END +} diff --git a/cocos/editor-support/cocostudio/armature/display/CCDecorativeDisplay.h b/cocos/editor-support/cocostudio/armature/display/CCDecorativeDisplay.h index 2b08dce2a8..3b42c9c64e 100644 --- a/cocos/editor-support/cocostudio/armature/display/CCDecorativeDisplay.h +++ b/cocos/editor-support/cocostudio/armature/display/CCDecorativeDisplay.h @@ -25,18 +25,18 @@ THE SOFTWARE. #ifndef __CCDECORATIVEDISPLAY_H__ #define __CCDECORATIVEDISPLAY_H__ -#include "../utils/CCArmatureDefine.h" +#include "armature/utils/CCArmatureDefine.h" #include "CCDisplayFactory.h" -#include "../datas/CCDatas.h" +#include "armature/datas/CCDatas.h" #if ENABLE_PHYSICS_BOX2D_DETECT || ENABLE_PHYSICS_CHIPMUNK_DETECT #include "../physics/CCColliderDetector.h" #endif -NS_CC_EXT_ARMATURE_BEGIN +namespace cocostudio { -class DecorativeDisplay: public Object +class DecorativeDisplay: public cocos2d::Object { public: static DecorativeDisplay *create(); @@ -55,7 +55,7 @@ public: protected: - CC_SYNTHESIZE_RETAIN(Node *, _display, Display); + CC_SYNTHESIZE_RETAIN(cocos2d::Node *, _display, Display); CC_SYNTHESIZE_RETAIN(DisplayData *, _displayData, DisplayData); #if ENABLE_PHYSICS_BOX2D_DETECT || ENABLE_PHYSICS_CHIPMUNK_DETECT @@ -63,6 +63,6 @@ protected: #endif }; -NS_CC_EXT_ARMATURE_END +} #endif /*__CCDECORATIVEDISPLAY_H__*/ diff --git a/cocos/editor-support/cocostudio/armature/display/CCDisplayFactory.cpp b/cocos/editor-support/cocostudio/armature/display/CCDisplayFactory.cpp index 4cef6fad53..30d3184ff8 100644 --- a/cocos/editor-support/cocostudio/armature/display/CCDisplayFactory.cpp +++ b/cocos/editor-support/cocostudio/armature/display/CCDisplayFactory.cpp @@ -23,14 +23,16 @@ THE SOFTWARE. ****************************************************************************/ #include "CCDisplayFactory.h" -#include "../CCBone.h" -#include "../CCArmature.h" -#include "../display/CCSkin.h" -#include "../utils/CCSpriteFrameCacheHelper.h" -#include "../utils/CCArmatureDataManager.h" -#include "../utils/CCTransformHelp.h" +#include "armature/CCBone.h" +#include "armature/CCArmature.h" +#include "armature/display/CCSkin.h" +#include "armature/utils/CCSpriteFrameCacheHelper.h" +#include "armature/utils/CCArmatureDataManager.h" +#include "armature/utils/CCTransformHelp.h" -NS_CC_EXT_ARMATURE_BEGIN +using namespace cocos2d; + +namespace cocostudio { void DisplayFactory::addDisplay(Bone *bone, DecorativeDisplay *decoDisplay, DisplayData *displayData) { @@ -272,4 +274,4 @@ void DisplayFactory::updateParticleDisplay(Bone *bone, Node *display, float dt, } -NS_CC_EXT_ARMATURE_END +} diff --git a/cocos/editor-support/cocostudio/armature/display/CCDisplayFactory.h b/cocos/editor-support/cocostudio/armature/display/CCDisplayFactory.h index 6df1fff7bb..80aa33680d 100644 --- a/cocos/editor-support/cocostudio/armature/display/CCDisplayFactory.h +++ b/cocos/editor-support/cocostudio/armature/display/CCDisplayFactory.h @@ -25,10 +25,10 @@ THE SOFTWARE. #ifndef __CCDISPLAYFACTORY_H__ #define __CCDISPLAYFACTORY_H__ -#include "../utils/CCArmatureDefine.h" -#include "../datas/CCDatas.h" +#include "armature/utils/CCArmatureDefine.h" +#include "armature/datas/CCDatas.h" -NS_CC_EXT_ARMATURE_BEGIN +namespace cocostudio { class Skin; class Bone; @@ -45,19 +45,19 @@ public: static void addSpriteDisplay(Bone *bone, DecorativeDisplay *decoDisplay, DisplayData *displayData); static void createSpriteDisplay(Bone *bone, DecorativeDisplay *decoDisplay); static void initSpriteDisplay(Bone *bone, DecorativeDisplay *decoDisplay, const char *displayName, Skin *skin); - static void updateSpriteDisplay(Bone *bone, Node *display, float dt, bool dirty); + static void updateSpriteDisplay(Bone *bone, cocos2d::Node *display, float dt, bool dirty); static void addArmatureDisplay(Bone *bone, DecorativeDisplay *decoDisplay, DisplayData *displayData); static void createArmatureDisplay(Bone *bone, DecorativeDisplay *decoDisplay); - static void updateArmatureDisplay(Bone *bone, Node *display, float dt, bool dirty); + static void updateArmatureDisplay(Bone *bone, cocos2d::Node *display, float dt, bool dirty); static void addParticleDisplay(Bone *bone, DecorativeDisplay *decoDisplay, DisplayData *displayData); static void createParticleDisplay(Bone *bone, DecorativeDisplay *decoDisplay); - static void updateParticleDisplay(Bone *bone, Node *display, float dt, bool dirty); + static void updateParticleDisplay(Bone *bone, cocos2d::Node *display, float dt, bool dirty); }; -NS_CC_EXT_ARMATURE_END +} #endif /*__CCDISPLAYFACTORY_H__*/ diff --git a/cocos/editor-support/cocostudio/armature/display/CCDisplayManager.cpp b/cocos/editor-support/cocostudio/armature/display/CCDisplayManager.cpp index a0c89f45cd..da87bea351 100644 --- a/cocos/editor-support/cocostudio/armature/display/CCDisplayManager.cpp +++ b/cocos/editor-support/cocostudio/armature/display/CCDisplayManager.cpp @@ -23,12 +23,14 @@ THE SOFTWARE. ****************************************************************************/ #include "CCDisplayManager.h" -#include "../CCBone.h" -#include "../CCArmature.h" -#include "../utils/CCUtilMath.h" -#include "../display/CCSkin.h" +#include "armature/CCBone.h" +#include "armature/CCArmature.h" +#include "armature/utils/CCUtilMath.h" +#include "armature/display/CCSkin.h" -NS_CC_EXT_ARMATURE_BEGIN +using namespace cocos2d; + +namespace cocostudio { DisplayManager *DisplayManager::create(Bone *bone) { @@ -392,4 +394,4 @@ Point DisplayManager::getAnchorPointInPoints() } -NS_CC_EXT_ARMATURE_END +} diff --git a/cocos/editor-support/cocostudio/armature/display/CCDisplayManager.h b/cocos/editor-support/cocostudio/armature/display/CCDisplayManager.h index 94933f96b5..2e9eb217fc 100644 --- a/cocos/editor-support/cocostudio/armature/display/CCDisplayManager.h +++ b/cocos/editor-support/cocostudio/armature/display/CCDisplayManager.h @@ -25,16 +25,16 @@ THE SOFTWARE. #ifndef __CCDISPLAYMANAGER_H__ #define __CCDISPLAYMANAGER_H__ -#include "../utils/CCArmatureDefine.h" -#include "../display/CCDecorativeDisplay.h" -#include "../datas/CCDatas.h" +#include "armature/utils/CCArmatureDefine.h" +#include "armature/display/CCDecorativeDisplay.h" +#include "armature/datas/CCDatas.h" -NS_CC_EXT_ARMATURE_BEGIN +namespace cocostudio { class Bone; //! DisplayManager manages Bone's display -class DisplayManager : public Object +class DisplayManager : public cocos2d::Object { public: static DisplayManager *create(Bone *bone); @@ -72,11 +72,11 @@ public: */ void addDisplay(DisplayData *displayData, int index); - void addDisplay(Node *display, int index); + void addDisplay(cocos2d::Node *display, int index); void removeDisplay(int index); - Array *getDecorativeDisplayList(); + cocos2d::Array *getDecorativeDisplayList(); /** * Change display by index. You can just use this method to change display in the display list. @@ -90,7 +90,7 @@ public: void changeDisplayByIndex(int index, bool force); - Node *getDisplayRenderNode(); + cocos2d::Node *getDisplayRenderNode(); int getCurrentDisplayIndex(); @@ -113,16 +113,16 @@ public: */ virtual bool isVisible(); - Size getContentSize(); - Rect getBoundingBox(); + cocos2d::Size getContentSize(); + cocos2d::Rect getBoundingBox(); - Point getAnchorPoint(); - Point getAnchorPointInPoints(); + cocos2d::Point getAnchorPoint(); + cocos2d::Point getAnchorPointInPoints(); /** * Check if the position is inside the bone. */ - virtual bool containPoint(Point &_point); + virtual bool containPoint(cocos2d::Point &_point); /** * Check if the position is inside the bone. @@ -130,9 +130,9 @@ public: virtual bool containPoint(float x, float y); protected: - Array *_decoDisplayList; + cocos2d::Array *_decoDisplayList; //! Display render node. - Node *_displayRenderNode; + cocos2d::Node *_displayRenderNode; //! Include current display information, like contour sprite, etc. DecorativeDisplay *_currentDecoDisplay; //! Current display index @@ -146,6 +146,6 @@ protected: Bone *_bone; }; -NS_CC_EXT_ARMATURE_END +} #endif /*__CCDISPLAYMANAGER_H__*/ diff --git a/cocos/editor-support/cocostudio/armature/display/CCSkin.cpp b/cocos/editor-support/cocostudio/armature/display/CCSkin.cpp index 2fdf2b24af..cd91c18ef4 100644 --- a/cocos/editor-support/cocostudio/armature/display/CCSkin.cpp +++ b/cocos/editor-support/cocostudio/armature/display/CCSkin.cpp @@ -23,11 +23,13 @@ THE SOFTWARE. ****************************************************************************/ #include "CCSkin.h" -#include "../utils/CCTransformHelp.h" -#include "../utils/CCSpriteFrameCacheHelper.h" -#include "../CCArmature.h" +#include "armature/utils/CCTransformHelp.h" +#include "armature/utils/CCSpriteFrameCacheHelper.h" +#include "armature/CCArmature.h" -NS_CC_EXT_ARMATURE_BEGIN +using namespace cocos2d; + +namespace cocostudio { #if CC_SPRITEBATCHNODE_RENDER_SUBPIXEL #define RENDER_IN_SUBPIXEL @@ -201,4 +203,4 @@ AffineTransform Skin::getNodeToWorldTransformAR() const return AffineTransformConcat(displayTransform, _bone->getArmature()->getNodeToWorldTransform()); } -NS_CC_EXT_ARMATURE_END +} diff --git a/cocos/editor-support/cocostudio/armature/display/CCSkin.h b/cocos/editor-support/cocostudio/armature/display/CCSkin.h index 26453ece1a..4c20063bed 100644 --- a/cocos/editor-support/cocostudio/armature/display/CCSkin.h +++ b/cocos/editor-support/cocostudio/armature/display/CCSkin.h @@ -25,12 +25,12 @@ THE SOFTWARE. #ifndef __CCSKIN_H__ #define __CCSKIN_H__ -#include "../utils/CCArmatureDefine.h" -#include "../CCBone.h" +#include "armature/utils/CCArmatureDefine.h" +#include "armature/CCBone.h" -NS_CC_EXT_ARMATURE_BEGIN +namespace cocostudio { -class Skin : public Sprite +class Skin : public cocos2d::Sprite { public: static Skin *create(); @@ -45,17 +45,17 @@ public: void updateArmatureTransform(); void updateTransform(); - AffineTransform getNodeToWorldTransform() const; - AffineTransform getNodeToWorldTransformAR() const; + cocos2d::AffineTransform getNodeToWorldTransform() const; + cocos2d::AffineTransform getNodeToWorldTransformAR() const; CC_PROPERTY_PASS_BY_REF(BaseData, _skinData, SkinData); CC_SYNTHESIZE(Bone *, _bone, Bone); protected: - AffineTransform _skinTransform; + cocos2d::AffineTransform _skinTransform; CC_SYNTHESIZE_READONLY(std::string, _displayName, DisplayName) }; -NS_CC_EXT_ARMATURE_END +} #endif /*__CCSKIN_H__*/ diff --git a/cocos/editor-support/cocostudio/armature/physics/CCColliderDetector.cpp b/cocos/editor-support/cocostudio/armature/physics/CCColliderDetector.cpp index 798a9b83b5..8d4dbf60cd 100644 --- a/cocos/editor-support/cocostudio/armature/physics/CCColliderDetector.cpp +++ b/cocos/editor-support/cocostudio/armature/physics/CCColliderDetector.cpp @@ -23,8 +23,8 @@ THE SOFTWARE. ****************************************************************************/ #include "CCColliderDetector.h" -#include "../CCBone.h" -#include "../utils/CCTransformHelp.h" +#include "armature/CCBone.h" +#include "armature/utils/CCTransformHelp.h" #if ENABLE_PHYSICS_BOX2D_DETECT #include "Box2D/Box2D.h" @@ -32,8 +32,9 @@ THE SOFTWARE. #include "chipmunk.h" #endif +using namespace cocos2d; -NS_CC_EXT_ARMATURE_BEGIN +namespace cocostudio { #if ENABLE_PHYSICS_BOX2D_DETECT @@ -393,4 +394,4 @@ cpBody *ColliderDetector::getBody() #endif -NS_CC_EXT_ARMATURE_END +} diff --git a/cocos/editor-support/cocostudio/armature/physics/CCColliderDetector.h b/cocos/editor-support/cocostudio/armature/physics/CCColliderDetector.h index 63990d3bf9..725036fddf 100644 --- a/cocos/editor-support/cocostudio/armature/physics/CCColliderDetector.h +++ b/cocos/editor-support/cocostudio/armature/physics/CCColliderDetector.h @@ -25,8 +25,8 @@ THE SOFTWARE. #ifndef __CCCOLLIDERDETECTOR_H__ #define __CCCOLLIDERDETECTOR_H__ -#include "../utils/CCArmatureDefine.h" -#include "../datas/CCDatas.h" +#include "armature/utils/CCArmatureDefine.h" +#include "armature/datas/CCDatas.h" #ifndef PT_RATIO #define PT_RATIO 32 @@ -40,11 +40,11 @@ struct b2Filter; struct cpBody; struct cpShape; -NS_CC_EXT_ARMATURE_BEGIN +namespace cocostudio { class Bone; -class ColliderBody : public Object +class ColliderBody : public cocos2d::Object { public: #if ENABLE_PHYSICS_BOX2D_DETECT @@ -70,7 +70,7 @@ private: /* * @brief ContourSprite used to draw the contour of the display */ -class ColliderDetector : public Object +class ColliderDetector : public cocos2d::Object { public: static ColliderDetector *create(); @@ -90,20 +90,20 @@ public: virtual bool init(Bone *bone); void addContourData(ContourData *contourData); - void addContourDataList(Array *contourDataList); + void addContourDataList(cocos2d::Array *contourDataList); void removeContourData(ContourData *contourData); void removeAll(); - void updateTransform(AffineTransform &t); + void updateTransform(cocos2d::AffineTransform &t); void setActive(bool active); bool getActive(); - Array *getColliderBodyList(); + cocos2d::Array *getColliderBodyList(); protected: - Array *_colliderBodyList; + cocos2d::Array *_colliderBodyList; CC_SYNTHESIZE(Bone *, _bone, Bone); #if ENABLE_PHYSICS_BOX2D_DETECT @@ -116,6 +116,6 @@ protected: bool _active; }; -NS_CC_EXT_ARMATURE_END +} #endif /*__CCCOLLIDERDETECTOR_H__*/ diff --git a/cocos/editor-support/cocostudio/armature/utils/CCArmatureDataManager.cpp b/cocos/editor-support/cocostudio/armature/utils/CCArmatureDataManager.cpp index e67f9a72e4..2d507f6b69 100644 --- a/cocos/editor-support/cocostudio/armature/utils/CCArmatureDataManager.cpp +++ b/cocos/editor-support/cocostudio/armature/utils/CCArmatureDataManager.cpp @@ -28,8 +28,9 @@ THE SOFTWARE. #include "CCDataReaderHelper.h" #include "CCSpriteFrameCacheHelper.h" +using namespace cocos2d; -NS_CC_EXT_ARMATURE_BEGIN +namespace cocostudio { static ArmatureDataManager *s_sharedArmatureDataManager = NULL; @@ -245,4 +246,4 @@ Dictionary *ArmatureDataManager::getTextureDatas() const return _textureDatas; } -NS_CC_EXT_ARMATURE_END +} diff --git a/cocos/editor-support/cocostudio/armature/utils/CCArmatureDataManager.h b/cocos/editor-support/cocostudio/armature/utils/CCArmatureDataManager.h index 5b7d534d44..b3122d34f2 100644 --- a/cocos/editor-support/cocostudio/armature/utils/CCArmatureDataManager.h +++ b/cocos/editor-support/cocostudio/armature/utils/CCArmatureDataManager.h @@ -26,15 +26,15 @@ THE SOFTWARE. #define __CCARMATUREDATAMANAGER_H__ #include "CCArmatureDefine.h" -#include "../datas/CCDatas.h" +#include "armature/datas/CCDatas.h" -NS_CC_EXT_ARMATURE_BEGIN +namespace cocostudio { /** * @brief format and manage armature configuration and armature animation */ -class ArmatureDataManager : public Object +class ArmatureDataManager : public cocos2d::Object { public: /** @deprecated Use getInstance() instead */ @@ -133,7 +133,7 @@ public: * @brief Add ArmatureFileInfo, it is managed by ArmatureDataManager. * It will load data in a new thread */ - void addArmatureFileInfoAsync(const char *configFilePath, Object *target, SEL_SCHEDULE selector); + void addArmatureFileInfoAsync(const char *configFilePath, cocos2d::Object *target, cocos2d::SEL_SCHEDULE selector); /** * @brief Add ArmatureFileInfo, it is managed by ArmatureDataManager. @@ -144,7 +144,7 @@ public: * @brief Add ArmatureFileInfo, it is managed by ArmatureDataManager. * It will load data in a new thread */ - void addArmatureFileInfoAsync(const char *imagePath, const char *plistPath, const char *configFilePath, Object *target, SEL_SCHEDULE selector); + void addArmatureFileInfoAsync(const char *imagePath, const char *plistPath, const char *configFilePath, cocos2d::Object *target, cocos2d::SEL_SCHEDULE selector); /** * @brief Add sprite frame to CCSpriteFrameCache, it will save display name and it's relative image name @@ -163,35 +163,35 @@ public: bool isAutoLoadSpriteFile(); - Dictionary *getArmatureDatas() const; - Dictionary *getAnimationDatas() const; - Dictionary *getTextureDatas() const; + cocos2d::Dictionary *getArmatureDatas() const; + cocos2d::Dictionary *getAnimationDatas() const; + cocos2d::Dictionary *getTextureDatas() const; private: /** * @brief save amature datas * @key std::string * @value ArmatureData * */ - Dictionary *_armarureDatas; + cocos2d::Dictionary *_armarureDatas; /** * @brief save animation datas * @key std::string * @value AnimationData * */ - Dictionary *_animationDatas; + cocos2d::Dictionary *_animationDatas; /** * @brief save texture datas * @key std::string * @value TextureData * */ - Dictionary *_textureDatas; + cocos2d::Dictionary *_textureDatas; bool _autoLoadSpriteFile; }; -NS_CC_EXT_ARMATURE_END +} #endif/*__CCARMATUREDATAMANAGER_H__*/ diff --git a/cocos/editor-support/cocostudio/armature/utils/CCArmatureDefine.cpp b/cocos/editor-support/cocostudio/armature/utils/CCArmatureDefine.cpp index cbd53fe1e0..7ed21c9a3c 100644 --- a/cocos/editor-support/cocostudio/armature/utils/CCArmatureDefine.cpp +++ b/cocos/editor-support/cocostudio/armature/utils/CCArmatureDefine.cpp @@ -24,11 +24,11 @@ THE SOFTWARE. #include "CCArmatureDefine.h" -NS_CC_EXT_ARMATURE_BEGIN +namespace cocostudio { const char *armatureVersion() { return "0.4.0.0"; } -NS_CC_EXT_ARMATURE_END +} diff --git a/cocos/editor-support/cocostudio/armature/utils/CCArmatureDefine.h b/cocos/editor-support/cocostudio/armature/utils/CCArmatureDefine.h index fdf82a43c0..8b7cb42312 100644 --- a/cocos/editor-support/cocostudio/armature/utils/CCArmatureDefine.h +++ b/cocos/editor-support/cocostudio/armature/utils/CCArmatureDefine.h @@ -27,7 +27,6 @@ THE SOFTWARE. #include "cocos2d.h" -#include "ExtensionMacros.h" #define VERSION_COMBINED 0.30f #define VERSION_CHANGE_ROTATION_RANGE 1.0f @@ -48,14 +47,10 @@ THE SOFTWARE. #define CS_RETURN_IF(cond) if (cond) return #define CS_RETURN_NULL_IF(cond) if (cond) return NULL; -#define NS_CC_EXT_ARMATURE_BEGIN namespace cocos2d { namespace extension { namespace armature { -#define NS_CC_EXT_ARMATURE_END }}} -#define USING_NS_CC_EXT_ARMATURE using namespace cocos2d::extension::armature - -NS_CC_EXT_ARMATURE_BEGIN +namespace cocostudio { const char *armatureVersion(); -NS_CC_EXT_ARMATURE_END +} #endif /*__CCARMATUREDEFINE_H__*/ diff --git a/cocos/editor-support/cocostudio/armature/utils/CCDataReaderHelper.cpp b/cocos/editor-support/cocostudio/armature/utils/CCDataReaderHelper.cpp index 563526570c..67d0264825 100644 --- a/cocos/editor-support/cocostudio/armature/utils/CCDataReaderHelper.cpp +++ b/cocos/editor-support/cocostudio/armature/utils/CCDataReaderHelper.cpp @@ -22,13 +22,15 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "support/tinyxml2/tinyxml2.h" +#include "tinyxml2.h" #include "CCDataReaderHelper.h" #include "CCArmatureDataManager.h" #include "CCTransformHelp.h" #include "CCUtilMath.h" #include "CCArmatureDefine.h" -#include "../datas/CCDatas.h" +#include "armature/datas/CCDatas.h" + +using namespace cocos2d; static const char *VERSION = "version"; @@ -133,7 +135,7 @@ static const char *COLOR_INFO = "color"; static const char *CONFIG_FILE_PATH = "config_file_path"; -NS_CC_EXT_ARMATURE_BEGIN +namespace cocostudio { std::vector s_arrConfigFileList; @@ -1118,14 +1120,14 @@ ContourData *DataReaderHelper::decodeContour(tinyxml2::XMLElement *contourXML) void DataReaderHelper::addDataFromJsonCache(const char *fileContent, DataInfo *dataInfo) { - cs::JsonDictionary json; + JsonDictionary json; json.initWithDescription(fileContent); // Decode armatures int length = json.getArrayItemCount(ARMATURE_DATA); for (int i = 0; i < length; i++) { - cs::JsonDictionary *armatureDic = json.getSubItemFromArray(ARMATURE_DATA, i); + JsonDictionary *armatureDic = json.getSubItemFromArray(ARMATURE_DATA, i); ArmatureData *armatureData = decodeArmature(*armatureDic); if (dataInfo) @@ -1145,7 +1147,7 @@ void DataReaderHelper::addDataFromJsonCache(const char *fileContent, DataInfo *d length = json.getArrayItemCount(ANIMATION_DATA); for (int i = 0; i < length; i++) { - cs::JsonDictionary *animationDic = json.getSubItemFromArray(ANIMATION_DATA, i); + JsonDictionary *animationDic = json.getSubItemFromArray(ANIMATION_DATA, i); AnimationData *animationData = decodeAnimation(*animationDic); if (dataInfo) @@ -1165,7 +1167,7 @@ void DataReaderHelper::addDataFromJsonCache(const char *fileContent, DataInfo *d length = json.getArrayItemCount(TEXTURE_DATA); for (int i = 0; i < length; i++) { - cs::JsonDictionary *textureDic = json.getSubItemFromArray(TEXTURE_DATA, i); + JsonDictionary *textureDic = json.getSubItemFromArray(TEXTURE_DATA, i); TextureData *textureData = decodeTexture(*textureDic); if (dataInfo) @@ -1213,7 +1215,7 @@ void DataReaderHelper::addDataFromJsonCache(const char *fileContent, DataInfo *d } } -ArmatureData *DataReaderHelper::decodeArmature(cs::JsonDictionary &json) +ArmatureData *DataReaderHelper::decodeArmature(JsonDictionary &json) { ArmatureData *armatureData = new ArmatureData(); armatureData->init(); @@ -1229,7 +1231,7 @@ ArmatureData *DataReaderHelper::decodeArmature(cs::JsonDictionary &json) int length = json.getArrayItemCount(BONE_DATA); for (int i = 0; i < length; i++) { - cs::JsonDictionary *dic = json.getSubItemFromArray(BONE_DATA, i); + JsonDictionary *dic = json.getSubItemFromArray(BONE_DATA, i); BoneData *boneData = decodeBone(*dic); armatureData->addBoneData(boneData); boneData->release(); @@ -1240,7 +1242,7 @@ ArmatureData *DataReaderHelper::decodeArmature(cs::JsonDictionary &json) return armatureData; } -BoneData *DataReaderHelper::decodeBone(cs::JsonDictionary &json) +BoneData *DataReaderHelper::decodeBone(JsonDictionary &json) { BoneData *boneData = new BoneData(); boneData->init(); @@ -1263,7 +1265,7 @@ BoneData *DataReaderHelper::decodeBone(cs::JsonDictionary &json) for (int i = 0; i < length; i++) { - cs::JsonDictionary *dic = json.getSubItemFromArray(DISPLAY_DATA, i); + JsonDictionary *dic = json.getSubItemFromArray(DISPLAY_DATA, i); DisplayData *displayData = decodeBoneDisplay(*dic); boneData->addDisplayData(displayData); displayData->release(); @@ -1274,7 +1276,7 @@ BoneData *DataReaderHelper::decodeBone(cs::JsonDictionary &json) return boneData; } -DisplayData *DataReaderHelper::decodeBoneDisplay(cs::JsonDictionary &json) +DisplayData *DataReaderHelper::decodeBoneDisplay(JsonDictionary &json) { DisplayType displayType = (DisplayType)json.getItemIntValue(A_DISPLAY_TYPE, CS_DISPLAY_SPRITE); @@ -1292,7 +1294,7 @@ DisplayData *DataReaderHelper::decodeBoneDisplay(cs::JsonDictionary &json) ((SpriteDisplayData *)displayData)->displayName = name; } - cs::JsonDictionary *dic = json.getSubItemFromArray(SKIN_DATA, 0); + JsonDictionary *dic = json.getSubItemFromArray(SKIN_DATA, 0); if (dic != NULL) { SpriteDisplayData *sdd = (SpriteDisplayData *)displayData; @@ -1341,7 +1343,7 @@ DisplayData *DataReaderHelper::decodeBoneDisplay(cs::JsonDictionary &json) return displayData; } -AnimationData *DataReaderHelper::decodeAnimation(cs::JsonDictionary &json) +AnimationData *DataReaderHelper::decodeAnimation(JsonDictionary &json) { AnimationData *aniData = new AnimationData(); @@ -1355,7 +1357,7 @@ AnimationData *DataReaderHelper::decodeAnimation(cs::JsonDictionary &json) for (int i = 0; i < length; i++) { - cs::JsonDictionary *dic = json.getSubItemFromArray(MOVEMENT_DATA, i); + JsonDictionary *dic = json.getSubItemFromArray(MOVEMENT_DATA, i); MovementData *movementData = decodeMovement(*dic); aniData->addMovement(movementData); movementData->release(); @@ -1366,7 +1368,7 @@ AnimationData *DataReaderHelper::decodeAnimation(cs::JsonDictionary &json) return aniData; } -MovementData *DataReaderHelper::decodeMovement(cs::JsonDictionary &json) +MovementData *DataReaderHelper::decodeMovement(JsonDictionary &json) { MovementData *movementData = new MovementData(); @@ -1386,7 +1388,7 @@ MovementData *DataReaderHelper::decodeMovement(cs::JsonDictionary &json) int length = json.getArrayItemCount(MOVEMENT_BONE_DATA); for (int i = 0; i < length; i++) { - cs::JsonDictionary *dic = json.getSubItemFromArray(MOVEMENT_BONE_DATA, i); + JsonDictionary *dic = json.getSubItemFromArray(MOVEMENT_BONE_DATA, i); MovementBoneData *movementBoneData = decodeMovementBone(*dic); movementData->addMovementBoneData(movementBoneData); movementBoneData->release(); @@ -1397,7 +1399,7 @@ MovementData *DataReaderHelper::decodeMovement(cs::JsonDictionary &json) return movementData; } -MovementBoneData *DataReaderHelper::decodeMovementBone(cs::JsonDictionary &json) +MovementBoneData *DataReaderHelper::decodeMovementBone(JsonDictionary &json) { MovementBoneData *movementBoneData = new MovementBoneData(); movementBoneData->init(); @@ -1413,7 +1415,7 @@ MovementBoneData *DataReaderHelper::decodeMovementBone(cs::JsonDictionary &json) int length = json.getArrayItemCount(FRAME_DATA); for (int i = 0; i < length; i++) { - cs::JsonDictionary *dic = json.getSubItemFromArray(FRAME_DATA, i); + JsonDictionary *dic = json.getSubItemFromArray(FRAME_DATA, i); FrameData *frameData = decodeFrame(*dic); movementBoneData->addFrameData(frameData); @@ -1469,7 +1471,7 @@ MovementBoneData *DataReaderHelper::decodeMovementBone(cs::JsonDictionary &json) return movementBoneData; } -FrameData *DataReaderHelper::decodeFrame(cs::JsonDictionary &json) +FrameData *DataReaderHelper::decodeFrame(JsonDictionary &json) { FrameData *frameData = new FrameData(); @@ -1498,7 +1500,7 @@ FrameData *DataReaderHelper::decodeFrame(cs::JsonDictionary &json) return frameData; } -TextureData *DataReaderHelper::decodeTexture(cs::JsonDictionary &json) +TextureData *DataReaderHelper::decodeTexture(JsonDictionary &json) { TextureData *textureData = new TextureData(); textureData->init(); @@ -1517,7 +1519,7 @@ TextureData *DataReaderHelper::decodeTexture(cs::JsonDictionary &json) int length = json.getArrayItemCount(CONTOUR_DATA); for (int i = 0; i < length; i++) { - cs::JsonDictionary *dic = json.getSubItemFromArray(CONTOUR_DATA, i); + JsonDictionary *dic = json.getSubItemFromArray(CONTOUR_DATA, i); ContourData *contourData = decodeContour(*dic); textureData->contourDataList.addObject(contourData); contourData->release(); @@ -1528,7 +1530,7 @@ TextureData *DataReaderHelper::decodeTexture(cs::JsonDictionary &json) return textureData; } -ContourData *DataReaderHelper::decodeContour(cs::JsonDictionary &json) +ContourData *DataReaderHelper::decodeContour(JsonDictionary &json) { ContourData *contourData = new ContourData(); contourData->init(); @@ -1536,7 +1538,7 @@ ContourData *DataReaderHelper::decodeContour(cs::JsonDictionary &json) int length = json.getArrayItemCount(VERTEX_POINT); for (int i = length - 1; i >= 0; i--) { - cs::JsonDictionary *dic = json.getSubItemFromArray(VERTEX_POINT, i); + JsonDictionary *dic = json.getSubItemFromArray(VERTEX_POINT, i); ContourVertex2 *vertex = new ContourVertex2(0, 0); @@ -1552,7 +1554,7 @@ ContourData *DataReaderHelper::decodeContour(cs::JsonDictionary &json) return contourData; } -void DataReaderHelper::decodeNode(BaseData *node, cs::JsonDictionary &json) +void DataReaderHelper::decodeNode(BaseData *node, JsonDictionary &json) { node->x = json.getItemFloatValue(A_X, 0) * s_PositionReadScale; node->y = json.getItemFloatValue(A_Y, 0) * s_PositionReadScale; @@ -1563,7 +1565,7 @@ void DataReaderHelper::decodeNode(BaseData *node, cs::JsonDictionary &json) node->scaleX = json.getItemFloatValue(A_SCALE_X, 1); node->scaleY = json.getItemFloatValue(A_SCALE_Y, 1); - cs::JsonDictionary *colorDic = json.getSubItemFromArray(COLOR_INFO, 0); + JsonDictionary *colorDic = json.getSubItemFromArray(COLOR_INFO, 0); if (colorDic) { @@ -1579,4 +1581,4 @@ void DataReaderHelper::decodeNode(BaseData *node, cs::JsonDictionary &json) } -NS_CC_EXT_ARMATURE_END +} diff --git a/cocos/editor-support/cocostudio/armature/utils/CCDataReaderHelper.h b/cocos/editor-support/cocostudio/armature/utils/CCDataReaderHelper.h index 2389245c20..d7f8a9f19e 100644 --- a/cocos/editor-support/cocostudio/armature/utils/CCDataReaderHelper.h +++ b/cocos/editor-support/cocostudio/armature/utils/CCDataReaderHelper.h @@ -26,9 +26,9 @@ THE SOFTWARE. #define __CCDATAREADERHELPER_H__ #include "CCArmatureDefine.h" -#include "../datas/CCDatas.h" -#include "../CCArmature.h" -#include "../../Json/CSContentJsonDictionary.h" +#include "armature/datas/CCDatas.h" +#include "armature/CCArmature.h" +#include "json/CSContentJsonDictionary.h" #include #include @@ -41,10 +41,10 @@ namespace tinyxml2 class XMLElement; } -NS_CC_EXT_ARMATURE_BEGIN +namespace cocostudio { -class DataReaderHelper : Object +class DataReaderHelper : cocos2d::Object { protected: @@ -60,8 +60,8 @@ protected: std::string fileContent; ConfigType configType; std::string baseFilePath; - Object *target; - SEL_SCHEDULE selector; + cocos2d::Object *target; + cocos2d::SEL_SCHEDULE selector; bool autoLoadSpriteFile; } AsyncStruct; @@ -99,7 +99,7 @@ public: ~DataReaderHelper(); void addDataFromFile(const char *filePath); - void addDataFromFileAsync(const char *filePath, Object *target, SEL_SCHEDULE selector); + void addDataFromFileAsync(const char *filePath, cocos2d::Object *target, cocos2d::SEL_SCHEDULE selector); void addDataAsyncCallBack(float dt); @@ -145,20 +145,20 @@ public: public: static void addDataFromJsonCache(const char *fileContent, DataInfo *dataInfo = NULL); - static ArmatureData *decodeArmature(cs::JsonDictionary &json); - static BoneData *decodeBone(cs::JsonDictionary &json); - static DisplayData *decodeBoneDisplay(cs::JsonDictionary &json); + static ArmatureData *decodeArmature(JsonDictionary &json); + static BoneData *decodeBone(JsonDictionary &json); + static DisplayData *decodeBoneDisplay(JsonDictionary &json); - static AnimationData *decodeAnimation(cs::JsonDictionary &json); - static MovementData *decodeMovement(cs::JsonDictionary &json); - static MovementBoneData *decodeMovementBone(cs::JsonDictionary &json); - static FrameData *decodeFrame(cs::JsonDictionary &json); + static AnimationData *decodeAnimation(JsonDictionary &json); + static MovementData *decodeMovement(JsonDictionary &json); + static MovementBoneData *decodeMovementBone(JsonDictionary &json); + static FrameData *decodeFrame(JsonDictionary &json); - static TextureData *decodeTexture(cs::JsonDictionary &json); + static TextureData *decodeTexture(JsonDictionary &json); - static ContourData *decodeContour(cs::JsonDictionary &json); + static ContourData *decodeContour(JsonDictionary &json); - static void decodeNode(BaseData *node, cs::JsonDictionary &json); + static void decodeNode(BaseData *node, JsonDictionary &json); protected: void loadData(); @@ -190,6 +190,6 @@ protected: static DataReaderHelper *_dataReaderHelper; }; -NS_CC_EXT_ARMATURE_END +} #endif /*__CCDATAREADERHELPER_H__*/ diff --git a/cocos/editor-support/cocostudio/armature/utils/CCSpriteFrameCacheHelper.cpp b/cocos/editor-support/cocostudio/armature/utils/CCSpriteFrameCacheHelper.cpp index acbdf4c542..d17dab4fa2 100644 --- a/cocos/editor-support/cocostudio/armature/utils/CCSpriteFrameCacheHelper.cpp +++ b/cocos/editor-support/cocostudio/armature/utils/CCSpriteFrameCacheHelper.cpp @@ -24,8 +24,10 @@ THE SOFTWARE. #include "CCSpriteFrameCacheHelper.h" +using namespace cocos2d; -NS_CC_EXT_ARMATURE_BEGIN + +namespace cocostudio { SpriteFrameCacheHelper *SpriteFrameCacheHelper::_spriteFrameCacheHelper = NULL; @@ -72,4 +74,4 @@ SpriteFrameCacheHelper::~SpriteFrameCacheHelper() CC_SAFE_RELEASE_NULL(_textureAtlasDic); } -NS_CC_EXT_ARMATURE_END +} diff --git a/cocos/editor-support/cocostudio/armature/utils/CCSpriteFrameCacheHelper.h b/cocos/editor-support/cocostudio/armature/utils/CCSpriteFrameCacheHelper.h index 257cf49cd8..6e1a4fe094 100644 --- a/cocos/editor-support/cocostudio/armature/utils/CCSpriteFrameCacheHelper.h +++ b/cocos/editor-support/cocostudio/armature/utils/CCSpriteFrameCacheHelper.h @@ -29,7 +29,7 @@ THE SOFTWARE. using namespace std; -NS_CC_EXT_ARMATURE_BEGIN +namespace cocostudio { class SpriteFrameCacheHelper { @@ -47,7 +47,7 @@ public: */ void addSpriteFrameFromFile(const char *plistPath, const char *imagePath); - TextureAtlas *getTexureAtlasWithTexture(Texture2D *texture); + cocos2d::TextureAtlas *getTexureAtlasWithTexture(cocos2d::Texture2D *texture); private: /** @@ -60,11 +60,11 @@ private: */ ~SpriteFrameCacheHelper(); - Dictionary *_textureAtlasDic; + cocos2d::Dictionary *_textureAtlasDic; static SpriteFrameCacheHelper *_spriteFrameCacheHelper; }; -NS_CC_EXT_ARMATURE_END +} #endif /*__CCSPRITEFRAMECACHEHELPER_H__*/ diff --git a/cocos/editor-support/cocostudio/armature/utils/CCTransformHelp.cpp b/cocos/editor-support/cocostudio/armature/utils/CCTransformHelp.cpp index 081b160b26..133dbba1d2 100644 --- a/cocos/editor-support/cocostudio/armature/utils/CCTransformHelp.cpp +++ b/cocos/editor-support/cocostudio/armature/utils/CCTransformHelp.cpp @@ -25,7 +25,9 @@ THE SOFTWARE. #include "CCTransformHelp.h" #include "CCUtilMath.h" -NS_CC_EXT_ARMATURE_BEGIN +using namespace cocos2d; + +namespace cocostudio { AffineTransform TransformHelp::helpMatrix1; AffineTransform TransformHelp::helpMatrix2; @@ -149,4 +151,4 @@ void TransformHelp::nodeSub(BaseData &target, BaseData &source) target.scaleY -= source.scaleY; } -NS_CC_EXT_ARMATURE_END +} diff --git a/cocos/editor-support/cocostudio/armature/utils/CCTransformHelp.h b/cocos/editor-support/cocostudio/armature/utils/CCTransformHelp.h index 5542691616..540b62f1a3 100644 --- a/cocos/editor-support/cocostudio/armature/utils/CCTransformHelp.h +++ b/cocos/editor-support/cocostudio/armature/utils/CCTransformHelp.h @@ -26,9 +26,9 @@ THE SOFTWARE. #define __CCTRANSFORMHELP_H__ #include "CCArmatureDefine.h" -#include "../datas/CCDatas.h" +#include "armature/datas/CCDatas.h" -NS_CC_EXT_ARMATURE_BEGIN +namespace cocostudio { /* * use to calculate the matrix of node from parent node @@ -44,19 +44,19 @@ public: static void transformFromParentWithoutScale(BaseData &node, const BaseData &parentNode); static void transformToParentWithoutScale(BaseData &node, const BaseData &parentNode); - static void nodeToMatrix(const BaseData &_node, AffineTransform &_matrix); - static void matrixToNode(const AffineTransform &_matrix, BaseData &_node); + static void nodeToMatrix(const BaseData &_node, cocos2d::AffineTransform &_matrix); + static void matrixToNode(const cocos2d::AffineTransform &_matrix, BaseData &_node); static void nodeConcat(BaseData &target, BaseData &source); static void nodeSub(BaseData &target, BaseData &source); public: - static AffineTransform helpMatrix1; - static AffineTransform helpMatrix2; + static cocos2d::AffineTransform helpMatrix1; + static cocos2d::AffineTransform helpMatrix2; - static Point helpPoint1; - static Point helpPoint2; + static cocos2d::Point helpPoint1; + static cocos2d::Point helpPoint2; }; -NS_CC_EXT_ARMATURE_END +} #endif /*__CCTRANSFORMHELP_H__*/ diff --git a/cocos/editor-support/cocostudio/armature/utils/CCTweenFunction.cpp b/cocos/editor-support/cocostudio/armature/utils/CCTweenFunction.cpp index 8546a88d27..21b20e6f1a 100644 --- a/cocos/editor-support/cocostudio/armature/utils/CCTweenFunction.cpp +++ b/cocos/editor-support/cocostudio/armature/utils/CCTweenFunction.cpp @@ -25,7 +25,7 @@ THE SOFTWARE. #include "CCTweenFunction.h" #include "CCUtilMath.h" -NS_CC_EXT_ARMATURE_BEGIN +namespace cocostudio { float TweenFunction::tweenTo(float from, float change, float time, float duration, CCTweenType tweenType) { @@ -411,4 +411,4 @@ float TweenFunction::bounceEaseInOut(float t, float b, float c, float d) } -NS_CC_EXT_ARMATURE_END +} diff --git a/cocos/editor-support/cocostudio/armature/utils/CCTweenFunction.h b/cocos/editor-support/cocostudio/armature/utils/CCTweenFunction.h index d0c76e8cc1..0951bf1eea 100644 --- a/cocos/editor-support/cocostudio/armature/utils/CCTweenFunction.h +++ b/cocos/editor-support/cocostudio/armature/utils/CCTweenFunction.h @@ -29,7 +29,7 @@ THE SOFTWARE. #include "CCArmatureDefine.h" #include -NS_CC_EXT_ARMATURE_BEGIN +namespace cocostudio { enum CCTweenType { @@ -131,6 +131,6 @@ public: }; -NS_CC_EXT_ARMATURE_END +} #endif /*__CCTWEENFUNCTION_H__*/ diff --git a/cocos/editor-support/cocostudio/armature/utils/CCUtilMath.cpp b/cocos/editor-support/cocostudio/armature/utils/CCUtilMath.cpp index 7197aa1fd4..c696e2a6fe 100644 --- a/cocos/editor-support/cocostudio/armature/utils/CCUtilMath.cpp +++ b/cocos/editor-support/cocostudio/armature/utils/CCUtilMath.cpp @@ -24,8 +24,10 @@ THE SOFTWARE. #include "CCUtilMath.h" +using namespace cocos2d; -NS_CC_EXT_ARMATURE_BEGIN + +namespace cocostudio { bool isSpriteContainPoint(Sprite *sprite, Point point, Point &outPoint) { @@ -75,4 +77,4 @@ Point circleTo(float t, Point ¢er, float radius, float fromRadian, float rad return p; } -NS_CC_EXT_ARMATURE_END +} diff --git a/cocos/editor-support/cocostudio/armature/utils/CCUtilMath.h b/cocos/editor-support/cocostudio/armature/utils/CCUtilMath.h index 376e02b522..b767cdcc58 100644 --- a/cocos/editor-support/cocostudio/armature/utils/CCUtilMath.h +++ b/cocos/editor-support/cocostudio/armature/utils/CCUtilMath.h @@ -28,7 +28,7 @@ THE SOFTWARE. #include "CCArmatureDefine.h" #include -NS_CC_EXT_ARMATURE_BEGIN +namespace cocostudio { #define CC_DOUBLE_PI (M_PI*2) @@ -36,20 +36,20 @@ NS_CC_EXT_ARMATURE_BEGIN //! hit test function -bool isSpriteContainPoint(Sprite *sprite, Point point); -bool isSpriteContainPoint(Sprite *sprite, Point point, Point &outPoint); +bool isSpriteContainPoint(cocos2d::Sprite *sprite, cocos2d::Point point); +bool isSpriteContainPoint(cocos2d::Sprite *sprite, cocos2d::Point point, cocos2d::Point &outPoint); #define CC_SPRITE_CONTAIN_POINT(sprite, point) isSpriteContainPoint((sprite), (point)) #define CC_SPRITE_CONTAIN_POINT_WITH_RETURN(sprite, point, outPoint) isSpriteContainPoint((sprite), (point), outPoint) //! motion curve function -Point bezierTo(float t, Point &point1, Point &point2, Point &point3); -Point bezierTo(float t, Point &point1, Point &point2, Point &point3, Point &point4); +cocos2d::Point bezierTo(float t, cocos2d::Point &point1, cocos2d::Point &point2, cocos2d::Point &point3); +cocos2d::Point bezierTo(float t, cocos2d::Point &point1, cocos2d::Point &point2, cocos2d::Point &point3, cocos2d::Point &point4); -Point circleTo(float t, Point ¢er, float radius, float fromRadian, float radianDif); +cocos2d::Point circleTo(float t, cocos2d::Point ¢er, float radius, float fromRadian, float radianDif); -NS_CC_EXT_ARMATURE_END +} #endif /*__CCUTILMATH_H__*/ diff --git a/cocos/editor-support/cocostudio/components/CCComAttribute.cpp b/cocos/editor-support/cocostudio/components/CCComAttribute.cpp index 30505ab486..5f73dfeacc 100644 --- a/cocos/editor-support/cocostudio/components/CCComAttribute.cpp +++ b/cocos/editor-support/cocostudio/components/CCComAttribute.cpp @@ -23,8 +23,9 @@ THE SOFTWARE. ****************************************************************************/ #include "CCComAttribute.h" +using namespace cocos2d; -NS_CC_EXT_BEGIN +namespace cocostudio { ComAttribute::ComAttribute(void) : _attributes(NULL) @@ -44,7 +45,7 @@ bool ComAttribute::init() _attributes = Dictionary::create(); _attributes->retain(); - _jsonDict = new cs::JsonDictionary(); + _jsonDict = new JsonDictionary(); return true; } @@ -184,9 +185,9 @@ Object* ComAttribute::getObject(const char *key) const return _attributes->objectForKey(key); } -cs::JsonDictionary* ComAttribute::getDict() const +JsonDictionary* ComAttribute::getDict() const { return _jsonDict; } -NS_CC_EXT_END +} diff --git a/cocos/editor-support/cocostudio/components/CCComAttribute.h b/cocos/editor-support/cocostudio/components/CCComAttribute.h index 78d9828f85..d36ce4ebb2 100644 --- a/cocos/editor-support/cocostudio/components/CCComAttribute.h +++ b/cocos/editor-support/cocostudio/components/CCComAttribute.h @@ -26,11 +26,10 @@ THE SOFTWARE. #define __CC_EXTENTIONS_CCCOMATTRIBUTE_H__ #include "cocos2d.h" -#include "ExtensionMacros.h" #include -#include "../Json/CSContentJsonDictionary.h" +#include "json/CSContentJsonDictionary.h" -NS_CC_EXT_BEGIN +namespace cocostudio { class ComAttribute : public cocos2d::Component { @@ -61,15 +60,15 @@ public: float getFloat(const char *key) const; bool getBool(const char *key) const; const char* getCString(const char *key) const; - Object* getObject(const char *key) const; + cocos2d::Object* getObject(const char *key) const; - cs::JsonDictionary* getDict() const; + JsonDictionary* getDict() const; private: - Dictionary *_attributes; - cs::JsonDictionary *_jsonDict; + cocos2d::Dictionary *_attributes; + JsonDictionary *_jsonDict; }; -NS_CC_EXT_END +} #endif // __FUNDATION__CCCOMPONENT_H__ diff --git a/cocos/editor-support/cocostudio/components/CCComAudio.cpp b/cocos/editor-support/cocostudio/components/CCComAudio.cpp index 87afa64348..29fcc308f4 100644 --- a/cocos/editor-support/cocostudio/components/CCComAudio.cpp +++ b/cocos/editor-support/cocostudio/components/CCComAudio.cpp @@ -25,7 +25,7 @@ THE SOFTWARE. #include "CCComAudio.h" #include "SimpleAudioEngine.h" -NS_CC_EXT_BEGIN +namespace cocostudio { ComAudio::ComAudio(void) : _filePath("") @@ -223,4 +223,4 @@ bool ComAudio::isLoop() return _loop; } -NS_CC_EXT_END +} diff --git a/cocos/editor-support/cocostudio/components/CCComAudio.h b/cocos/editor-support/cocostudio/components/CCComAudio.h index 259227462f..0968a3d76b 100644 --- a/cocos/editor-support/cocostudio/components/CCComAudio.h +++ b/cocos/editor-support/cocostudio/components/CCComAudio.h @@ -26,9 +26,8 @@ THE SOFTWARE. #define __CC_EXTENTIONS_CCCOMAUDIO_H__ #include "cocos2d.h" -#include "ExtensionMacros.h" -NS_CC_EXT_BEGIN +namespace cocostudio { class ComAudio : public cocos2d::Component { @@ -95,6 +94,6 @@ private: bool _loop; }; -NS_CC_EXT_END +} #endif // __FUNDATION__CCCOMPONENT_H__ diff --git a/cocos/editor-support/cocostudio/components/CCComController.cpp b/cocos/editor-support/cocostudio/components/CCComController.cpp index 5213927f4e..8bc321a1de 100644 --- a/cocos/editor-support/cocostudio/components/CCComController.cpp +++ b/cocos/editor-support/cocostudio/components/CCComController.cpp @@ -24,7 +24,7 @@ THE SOFTWARE. #include "CCComController.h" -NS_CC_EXT_BEGIN +namespace cocostudio { ComController::ComController(void) { @@ -76,4 +76,4 @@ ComController* ComController::create(void) return pRet; } -NS_CC_EXT_END +} diff --git a/cocos/editor-support/cocostudio/components/CCComController.h b/cocos/editor-support/cocostudio/components/CCComController.h index 7122fb190c..8fcb1c8879 100644 --- a/cocos/editor-support/cocostudio/components/CCComController.h +++ b/cocos/editor-support/cocostudio/components/CCComController.h @@ -28,7 +28,7 @@ THE SOFTWARE. #include "cocos2d.h" #include "CCInputDelegate.h" -NS_CC_EXT_BEGIN +namespace cocostudio { class ComController : public cocos2d::Component, public InputDelegate { @@ -59,6 +59,6 @@ public: static ComController* create(void); }; -NS_CC_EXT_END +} #endif // __FUNDATION__CCCOMPONENT_H__ diff --git a/cocos/editor-support/cocostudio/components/CCComRender.cpp b/cocos/editor-support/cocostudio/components/CCComRender.cpp index 4dbc18c464..bfd19a48ab 100644 --- a/cocos/editor-support/cocostudio/components/CCComRender.cpp +++ b/cocos/editor-support/cocostudio/components/CCComRender.cpp @@ -24,7 +24,7 @@ THE SOFTWARE. #include "CCComRender.h" -NS_CC_EXT_BEGIN +namespace cocostudio { ComRender::ComRender(void) : _render(NULL) @@ -76,4 +76,4 @@ ComRender* ComRender::create(cocos2d::Node *pNode, const char *comName) return pRet; } -NS_CC_EXT_END +} diff --git a/cocos/editor-support/cocostudio/components/CCComRender.h b/cocos/editor-support/cocostudio/components/CCComRender.h index cf98c4c3f8..08c9eff8d9 100644 --- a/cocos/editor-support/cocostudio/components/CCComRender.h +++ b/cocos/editor-support/cocostudio/components/CCComRender.h @@ -26,10 +26,8 @@ THE SOFTWARE. #define __CC_EXTENTIONS_CCCOMNODE_H__ #include "cocos2d.h" -#include "cocos-ext.h" -#include "ExtensionMacros.h" -NS_CC_EXT_BEGIN +namespace cocostudio { class ComRender : public cocos2d::Component { @@ -61,5 +59,5 @@ private: cocos2d::Node *_render; }; -NS_CC_EXT_END +} #endif // __FUNDATION__CCCOMPONENT_H__ diff --git a/cocos/editor-support/cocostudio/components/CCInputDelegate.cpp b/cocos/editor-support/cocostudio/components/CCInputDelegate.cpp index 84694e0619..65664400c7 100644 --- a/cocos/editor-support/cocostudio/components/CCInputDelegate.cpp +++ b/cocos/editor-support/cocostudio/components/CCInputDelegate.cpp @@ -24,7 +24,9 @@ THE SOFTWARE. #include "CCInputDelegate.h" -NS_CC_EXT_BEGIN +using namespace cocos2d; + +namespace cocostudio { InputDelegate::InputDelegate(void) : _touchEnabled(false) @@ -228,4 +230,4 @@ void InputDelegate::setKeypadEnabled(bool enabled) } -NS_CC_EXT_END +} diff --git a/cocos/editor-support/cocostudio/components/CCInputDelegate.h b/cocos/editor-support/cocostudio/components/CCInputDelegate.h index 94bff421ce..12d9f50041 100644 --- a/cocos/editor-support/cocostudio/components/CCInputDelegate.h +++ b/cocos/editor-support/cocostudio/components/CCInputDelegate.h @@ -26,9 +26,8 @@ THE SOFTWARE. #define __CC_EXTENTIONS_CCINPUTDELEGATE_H__ #include "cocos2d.h" -#include "ExtensionMacros.h" -NS_CC_EXT_BEGIN +namespace cocostudio { class InputDelegate { @@ -79,12 +78,12 @@ public: * @js NA * @lua NA */ - virtual void setTouchMode(Touch::DispatchMode mode); + virtual void setTouchMode(cocos2d::Touch::DispatchMode mode); /** * @js NA * @lua NA */ - virtual Touch::DispatchMode getTouchMode() const; + virtual cocos2d::Touch::DispatchMode getTouchMode() const; /** * @js NA * @lua NA @@ -96,44 +95,44 @@ public: */ virtual int getTouchPriority() const; /** @deprecated Please override onAcceleration */ - CC_DEPRECATED_ATTRIBUTE virtual void didAccelerate(Acceleration* accelerationValue) final { CC_UNUSED_PARAM(accelerationValue); }; + CC_DEPRECATED_ATTRIBUTE virtual void didAccelerate(cocos2d::Acceleration* accelerationValue) final { CC_UNUSED_PARAM(accelerationValue); }; // Deprecated touch callbacks. - CC_DEPRECATED_ATTRIBUTE virtual bool ccTouchBegan(Touch *pTouch, Event *pEvent) final {CC_UNUSED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent); return false;}; - CC_DEPRECATED_ATTRIBUTE virtual void ccTouchMoved(Touch *pTouch, Event *pEvent) final {CC_UNUSED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent);} - CC_DEPRECATED_ATTRIBUTE virtual void ccTouchEnded(Touch *pTouch, Event *pEvent) final {CC_UNUSED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent);} - CC_DEPRECATED_ATTRIBUTE virtual void ccTouchCancelled(Touch *pTouch, Event *pEvent) final {CC_UNUSED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent);} + CC_DEPRECATED_ATTRIBUTE virtual bool ccTouchBegan(cocos2d::Touch *pTouch, cocos2d::Event *pEvent) final {CC_UNUSED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent); return false;}; + CC_DEPRECATED_ATTRIBUTE virtual void ccTouchMoved(cocos2d::Touch *pTouch, cocos2d::Event *pEvent) final {CC_UNUSED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent);} + CC_DEPRECATED_ATTRIBUTE virtual void ccTouchEnded(cocos2d::Touch *pTouch, cocos2d::Event *pEvent) final {CC_UNUSED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent);} + CC_DEPRECATED_ATTRIBUTE virtual void ccTouchCancelled(cocos2d::Touch *pTouch, cocos2d::Event *pEvent) final {CC_UNUSED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent);} - CC_DEPRECATED_ATTRIBUTE virtual void ccTouchesBegan(Set *pTouches, Event *pEvent) final {CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);} - CC_DEPRECATED_ATTRIBUTE virtual void ccTouchesMoved(Set *pTouches, Event *pEvent) final {CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);} - CC_DEPRECATED_ATTRIBUTE virtual void ccTouchesEnded(Set *pTouches, Event *pEvent) final {CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);} - CC_DEPRECATED_ATTRIBUTE virtual void ccTouchesCancelled(Set *pTouches, Event *pEvent) final {CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);} + CC_DEPRECATED_ATTRIBUTE virtual void ccTouchesBegan(cocos2d::Set *pTouches, cocos2d::Event *pEvent) final {CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);} + CC_DEPRECATED_ATTRIBUTE virtual void ccTouchesMoved(cocos2d::Set *pTouches, cocos2d::Event *pEvent) final {CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);} + CC_DEPRECATED_ATTRIBUTE virtual void ccTouchesEnded(cocos2d::Set *pTouches, cocos2d::Event *pEvent) final {CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);} + CC_DEPRECATED_ATTRIBUTE virtual void ccTouchesCancelled(cocos2d::Set *pTouches, cocos2d::Event *pEvent) final {CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);} - virtual void onAcceleration(Acceleration* acc, Event* event) {}; + virtual void onAcceleration(cocos2d::Acceleration* acc, cocos2d::Event* event) {}; - virtual void onKeyPressed(EventKeyboard::KeyCode keyCode, Event* event) {}; - virtual void onKeyReleased(EventKeyboard::KeyCode keyCode, Event* event) {}; + virtual void onKeyPressed(cocos2d::EventKeyboard::KeyCode keyCode, cocos2d::Event* event) {}; + virtual void onKeyReleased(cocos2d::EventKeyboard::KeyCode keyCode, cocos2d::Event* event) {}; - virtual bool onTouchBegan(Touch *touch, Event *event); - virtual void onTouchMoved(Touch *touch, Event *event); - virtual void onTouchEnded(Touch *touch, Event *event); - virtual void onTouchCancelled(Touch *touch, Event *event); - virtual void onTouchesBegan(const std::vector& touches, Event *event); - virtual void onTouchesMoved(const std::vector& touches, Event *event); - virtual void onTouchesEnded(const std::vector& touches, Event *event); - virtual void onTouchesCancelled(const std::vector& touches, Event *event); + virtual bool onTouchBegan(cocos2d::Touch *touch, cocos2d::Event *event); + virtual void onTouchMoved(cocos2d::Touch *touch, cocos2d::Event *event); + virtual void onTouchEnded(cocos2d::Touch *touch, cocos2d::Event *event); + virtual void onTouchCancelled(cocos2d::Touch *touch, cocos2d::Event *event); + virtual void onTouchesBegan(const std::vector& touches, cocos2d::Event *event); + virtual void onTouchesMoved(const std::vector& touches, cocos2d::Event *event); + virtual void onTouchesEnded(const std::vector& touches, cocos2d::Event *event); + virtual void onTouchesCancelled(const std::vector& touches, cocos2d::Event *event); protected: bool _touchEnabled; - EventListener* _touchListener; + cocos2d::EventListener* _touchListener; bool _accelerometerEnabled; - EventListener* _accelerometerListener; + cocos2d::EventListener* _accelerometerListener; bool _keypadEnabled; - EventListener* _keyboardListener; + cocos2d::EventListener* _keyboardListener; private: int _touchPriority; - Touch::DispatchMode _touchMode; + cocos2d::Touch::DispatchMode _touchMode; }; -NS_CC_EXT_END +} #endif // __FUNDATION__CCCOMPONENT_H__ diff --git a/cocos/editor-support/cocostudio/json/.DS_Store b/cocos/editor-support/cocostudio/json/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5008ddfcf53c02e82d7eee2e57c38e5672ef89f6 GIT binary patch literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0 #include "CSContentJsonDictionary.h" -namespace cs { +namespace cocostudio { JsonDictionary::JsonDictionary() { @@ -43,7 +43,7 @@ namespace cs { void JsonDictionary::initWithDescription(const char *pszDescription) { - CSJson::Reader cReader; + Json::Reader cReader; m_cValue.clear(); if (pszDescription && *pszDescription) { @@ -53,7 +53,7 @@ namespace cs { } - void JsonDictionary::initWithValue(CSJson::Value& value) + void JsonDictionary::initWithValue(Json::Value& value) { m_cValue = value; } @@ -151,8 +151,8 @@ namespace cs { JsonDictionary * pNewDictionary; if (!isKeyValidate(pszKey, m_cValue) || (!m_cValue[pszKey].isArray() && !m_cValue[pszKey].isObject() && - !m_cValue[pszKey].isConvertibleTo(CSJson::arrayValue) && - !m_cValue[pszKey].isConvertibleTo(CSJson::objectValue))) + !m_cValue[pszKey].isConvertibleTo(Json::arrayValue) && + !m_cValue[pszKey].isConvertibleTo(Json::objectValue))) { pNewDictionary = NULL; } @@ -174,10 +174,10 @@ namespace cs { bool JsonDictionary::insertItemToArray(const char *pszArrayKey, int nValue) { - CSJson::Value array; + Json::Value array; if(m_cValue.isMember(pszArrayKey)) { - if (!m_cValue[pszArrayKey].isArray() && !m_cValue[pszArrayKey].isConvertibleTo(CSJson::arrayValue)) + if (!m_cValue[pszArrayKey].isArray() && !m_cValue[pszArrayKey].isConvertibleTo(Json::arrayValue)) return false; array = m_cValue[pszArrayKey]; @@ -192,10 +192,10 @@ namespace cs { bool JsonDictionary::insertItemToArray(const char *pszArrayKey, double fValue) { - CSJson::Value array; + Json::Value array; if(m_cValue.isMember(pszArrayKey)) { - if (!m_cValue[pszArrayKey].isArray() && !m_cValue[pszArrayKey].isConvertibleTo(CSJson::arrayValue)) + if (!m_cValue[pszArrayKey].isArray() && !m_cValue[pszArrayKey].isConvertibleTo(Json::arrayValue)) return false; array = m_cValue[pszArrayKey]; @@ -210,10 +210,10 @@ namespace cs { bool JsonDictionary::insertItemToArray(const char *pszArrayKey, const char * pszValue) { - CSJson::Value array; + Json::Value array; if(m_cValue.isMember(pszArrayKey)) { - if (!m_cValue[pszArrayKey].isArray() && !m_cValue[pszArrayKey].isConvertibleTo(CSJson::arrayValue)) + if (!m_cValue[pszArrayKey].isArray() && !m_cValue[pszArrayKey].isConvertibleTo(Json::arrayValue)) return false; array = m_cValue[pszArrayKey]; @@ -228,10 +228,10 @@ namespace cs { bool JsonDictionary::insertItemToArray(const char *pszArrayKey, JsonDictionary * subDictionary) { - CSJson::Value array; + Json::Value array; if(m_cValue.isMember(pszArrayKey)) { - if (!m_cValue[pszArrayKey].isArray() && !m_cValue[pszArrayKey].isConvertibleTo(CSJson::arrayValue)) + if (!m_cValue[pszArrayKey].isArray() && !m_cValue[pszArrayKey].isConvertibleTo(Json::arrayValue)) return false; array = m_cValue[pszArrayKey]; @@ -272,13 +272,13 @@ namespace cs { int nRet = 0; if (!isKeyValidate(pszArrayKey, m_cValue) || (!m_cValue[pszArrayKey].isArray() && !m_cValue[pszArrayKey].isObject() && - !m_cValue[pszArrayKey].isConvertibleTo(CSJson::arrayValue) && !m_cValue[pszArrayKey].isConvertibleTo(CSJson::objectValue))) + !m_cValue[pszArrayKey].isConvertibleTo(Json::arrayValue) && !m_cValue[pszArrayKey].isConvertibleTo(Json::objectValue))) { nRet = 0; } else { - CSJson::Value arrayValue = m_cValue[pszArrayKey]; + Json::Value arrayValue = m_cValue[pszArrayKey]; nRet = arrayValue.size(); } @@ -289,7 +289,7 @@ namespace cs { int JsonDictionary::getIntValueFromArray(const char *pszArrayKey, int nIndex, int nDefaultValue) { int nRet = nDefaultValue; - CSJson::Value * arrayValue = validateArrayItem(pszArrayKey, nIndex); + Json::Value * arrayValue = validateArrayItem(pszArrayKey, nIndex); if (arrayValue) { if ((*arrayValue)[nIndex].isNumeric()) @@ -303,7 +303,7 @@ namespace cs { double JsonDictionary::getFloatValueFromArray(const char *pszArrayKey, int nIndex, double fDefaultValue) { double fRet = fDefaultValue; - CSJson::Value * arrayValue = validateArrayItem(pszArrayKey, nIndex); + Json::Value * arrayValue = validateArrayItem(pszArrayKey, nIndex); if (arrayValue) { if ((*arrayValue)[nIndex].isNumeric()) @@ -316,7 +316,7 @@ namespace cs { bool JsonDictionary::getBoolValueFromArray(const char *pszArrayKey, int nIndex, bool bDefaultValue) { bool bRet = bDefaultValue; - CSJson::Value * arrayValue = validateArrayItem(pszArrayKey, nIndex); + Json::Value * arrayValue = validateArrayItem(pszArrayKey, nIndex); if (arrayValue) { if ((*arrayValue)[nIndex].isNumeric()) @@ -329,7 +329,7 @@ namespace cs { const char * JsonDictionary::getStringValueFromArray(const char *pszArrayKey, int nIndex) { - CSJson::Value * arrayValue = validateArrayItem(pszArrayKey, nIndex); + Json::Value * arrayValue = validateArrayItem(pszArrayKey, nIndex); if (arrayValue) { if ((*arrayValue)[nIndex].isString()) @@ -342,7 +342,7 @@ namespace cs { JsonDictionary * JsonDictionary::getSubItemFromArray(const char *pszArrayKey, int nIndex) { - CSJson::Value * arrayValue = validateArrayItem(pszArrayKey, nIndex); + Json::Value * arrayValue = validateArrayItem(pszArrayKey, nIndex); if (arrayValue) { if ((*arrayValue)[nIndex].isArray() || (*arrayValue)[nIndex].isObject()) @@ -359,15 +359,15 @@ namespace cs { DicItemType JsonDictionary::getItemTypeFromArray(const char *pszArrayKey, int nIndex) { - CSJson::Value * arrayValue = validateArrayItem(pszArrayKey, nIndex); + Json::Value * arrayValue = validateArrayItem(pszArrayKey, nIndex); if (arrayValue) return (DicItemType)((*arrayValue)[nIndex].type()); - return (DicItemType)CSJson::nullValue; + return (DicItemType)Json::nullValue; } - inline bool JsonDictionary::isKeyValidate(const char *pszKey, CSJson::Value& root) + inline bool JsonDictionary::isKeyValidate(const char *pszKey, Json::Value& root) { if (root.isNull() || !root.isMember(pszKey)) return false; @@ -376,9 +376,9 @@ namespace cs { } - inline CSJson::Value * JsonDictionary::validateArrayItem(const char *pszArrayKey, int nIndex) + inline Json::Value * JsonDictionary::validateArrayItem(const char *pszArrayKey, int nIndex) { - if (!isKeyValidate(pszArrayKey, m_cValue) && !m_cValue[pszArrayKey].isArray() && !m_cValue[pszArrayKey].isConvertibleTo(CSJson::arrayValue)) + if (!isKeyValidate(pszArrayKey, m_cValue) && !m_cValue[pszArrayKey].isArray() && !m_cValue[pszArrayKey].isConvertibleTo(Json::arrayValue)) return NULL; if (!m_cValue[pszArrayKey].isValidIndex(nIndex)) return NULL; diff --git a/cocos/editor-support/cocostudio/json/CSContentJsonDictionary.h b/cocos/editor-support/cocostudio/json/CSContentJsonDictionary.h index 3908e71545..e3815ae2a6 100644 --- a/cocos/editor-support/cocostudio/json/CSContentJsonDictionary.h +++ b/cocos/editor-support/cocostudio/json/CSContentJsonDictionary.h @@ -28,11 +28,11 @@ #define COCOSTUDIO_CSCONTENTJSONDICTIONARY_H -#include "lib_json/json_lib.h" +#include "json.h" #include #include -namespace cs { +namespace cocostudio { typedef enum _DicItemType { @@ -90,12 +90,12 @@ namespace cs { std::vector getAllMemberNames(); protected: - CSJson::Value m_cValue; + Json::Value m_cValue; private: - void initWithValue(CSJson::Value& value); - inline bool isKeyValidate(const char *pszKey, CSJson::Value& root); - inline CSJson::Value * validateArrayItem(const char *pszArrayKey, int nIndex); + void initWithValue(Json::Value& value); + inline bool isKeyValidate(const char *pszKey, Json::Value& root); + inline Json::Value * validateArrayItem(const char *pszArrayKey, int nIndex); }; } diff --git a/cocos/editor-support/cocostudio/json/DictionaryHelper.cpp b/cocos/editor-support/cocostudio/json/DictionaryHelper.cpp index ca8dfd8594..ab72de178e 100644 --- a/cocos/editor-support/cocostudio/json/DictionaryHelper.cpp +++ b/cocos/editor-support/cocostudio/json/DictionaryHelper.cpp @@ -24,7 +24,7 @@ #include "DictionaryHelper.h" -NS_CC_EXT_BEGIN +namespace cocostudio { static DictionaryHelper* sharedHelper = NULL; @@ -178,7 +178,7 @@ cocos2d::Array* DictionaryHelper::objectToCCArray(cocos2d::Object *obj) return array; } -cs::JsonDictionary* DictionaryHelper::getSubDictionary_json(cs::JsonDictionary* root,const char* key) +JsonDictionary* DictionaryHelper::getSubDictionary_json(JsonDictionary* root,const char* key) { if (!root) { @@ -187,7 +187,7 @@ cs::JsonDictionary* DictionaryHelper::getSubDictionary_json(cs::JsonDictionary* return root->getSubDictionary(key); } -int DictionaryHelper::getIntValue_json(cs::JsonDictionary* root,const char* key) +int DictionaryHelper::getIntValue_json(JsonDictionary* root,const char* key) { if (!root) { @@ -196,7 +196,7 @@ int DictionaryHelper::getIntValue_json(cs::JsonDictionary* root,const char* key) return root->getItemIntValue(key, 0); } -float DictionaryHelper::getFloatValue_json(cs::JsonDictionary* root,const char* key) +float DictionaryHelper::getFloatValue_json(JsonDictionary* root,const char* key) { if (!root) { @@ -205,7 +205,7 @@ float DictionaryHelper::getFloatValue_json(cs::JsonDictionary* root,const char* return root->getItemFloatValue(key, 0.0); } -const char* DictionaryHelper::getStringValue_json(cs::JsonDictionary* root,const char* key) +const char* DictionaryHelper::getStringValue_json(JsonDictionary* root,const char* key) { if (!root) { @@ -214,7 +214,7 @@ const char* DictionaryHelper::getStringValue_json(cs::JsonDictionary* root,const return root->getItemStringValue(key); } -bool DictionaryHelper::getBooleanValue_json(cs::JsonDictionary* root,const char* key) +bool DictionaryHelper::getBooleanValue_json(JsonDictionary* root,const char* key) { if (!root) { @@ -223,7 +223,7 @@ bool DictionaryHelper::getBooleanValue_json(cs::JsonDictionary* root,const char* return root->getItemBoolvalue(key, false); } -int DictionaryHelper::getArrayCount_json(cs::JsonDictionary* root,const char* key) +int DictionaryHelper::getArrayCount_json(JsonDictionary* root,const char* key) { if (!root) { @@ -232,7 +232,7 @@ int DictionaryHelper::getArrayCount_json(cs::JsonDictionary* root,const char* ke return root->getArrayItemCount(key); } -int DictionaryHelper::getIntValueFromArray_json(cs::JsonDictionary* root,const char* arrayKey,int idx) +int DictionaryHelper::getIntValueFromArray_json(JsonDictionary* root,const char* arrayKey,int idx) { if (!root) { @@ -241,7 +241,7 @@ int DictionaryHelper::getIntValueFromArray_json(cs::JsonDictionary* root,const c return root->getIntValueFromArray(arrayKey, idx, 0); } -float DictionaryHelper::getFloatValueFromArray_json(cs::JsonDictionary* root,const char* arrayKey,int idx) +float DictionaryHelper::getFloatValueFromArray_json(JsonDictionary* root,const char* arrayKey,int idx) { if (!root) { @@ -250,7 +250,7 @@ float DictionaryHelper::getFloatValueFromArray_json(cs::JsonDictionary* root,con return root->getFloatValueFromArray(arrayKey, idx, 0.0); } -bool DictionaryHelper::getBoolValueFromArray_json(cs::JsonDictionary* root,const char* arrayKey,int idx) +bool DictionaryHelper::getBoolValueFromArray_json(JsonDictionary* root,const char* arrayKey,int idx) { if (!root) { @@ -259,7 +259,7 @@ bool DictionaryHelper::getBoolValueFromArray_json(cs::JsonDictionary* root,const return root->getBoolValueFromArray(arrayKey, idx, false); } -const char* DictionaryHelper::getStringValueFromArray_json(cs::JsonDictionary *root, const char *arrayKey, int idx) +const char* DictionaryHelper::getStringValueFromArray_json(JsonDictionary *root, const char *arrayKey, int idx) { if (!root) { @@ -268,7 +268,7 @@ const char* DictionaryHelper::getStringValueFromArray_json(cs::JsonDictionary *r return root->getStringValueFromArray(arrayKey, idx); } -cs::JsonDictionary* DictionaryHelper::getDictionaryFromArray_json(cs::JsonDictionary* root,const char* arrayKey,int idx) +JsonDictionary* DictionaryHelper::getDictionaryFromArray_json(JsonDictionary* root,const char* arrayKey,int idx) { if (!root) { @@ -277,7 +277,7 @@ cs::JsonDictionary* DictionaryHelper::getDictionaryFromArray_json(cs::JsonDictio return root->getSubItemFromArray(arrayKey, idx); } -bool DictionaryHelper::checkObjectExist_json(cs::JsonDictionary *root, const char *key) +bool DictionaryHelper::checkObjectExist_json(JsonDictionary *root, const char *key) { if (!root) { @@ -286,4 +286,4 @@ bool DictionaryHelper::checkObjectExist_json(cs::JsonDictionary *root, const cha return root->isKeyValidate(key); } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/editor-support/cocostudio/json/DictionaryHelper.h b/cocos/editor-support/cocostudio/json/DictionaryHelper.h index a5570ef11a..e3f34e54ed 100644 --- a/cocos/editor-support/cocostudio/json/DictionaryHelper.h +++ b/cocos/editor-support/cocostudio/json/DictionaryHelper.h @@ -26,12 +26,11 @@ #define __DICTIONARYHELPER_H__ #include "cocos2d.h" -#include "cocos-ext.h" -#include "ExtensionMacros.h" +#include "CSContentJsonDictionary.h" #define DICTOOL DictionaryHelper::shareHelper() -NS_CC_EXT_BEGIN +namespace cocostudio { class DictionaryHelper { @@ -53,20 +52,20 @@ public: bool objectToBooleanValue(cocos2d::Object* obj); cocos2d::Array* objectToCCArray(cocos2d::Object* obj); - cs::JsonDictionary* getSubDictionary_json(cs::JsonDictionary* root,const char* key); - int getIntValue_json(cs::JsonDictionary* root,const char* key); - float getFloatValue_json(cs::JsonDictionary* root,const char* key); - const char* getStringValue_json(cs::JsonDictionary* root,const char* key); - bool getBooleanValue_json(cs::JsonDictionary* root,const char* key); - int getArrayCount_json(cs::JsonDictionary* root,const char* key); - int getIntValueFromArray_json(cs::JsonDictionary* root,const char* arrayKey,int idx); - float getFloatValueFromArray_json(cs::JsonDictionary* root,const char* arrayKey,int idx); - bool getBoolValueFromArray_json(cs::JsonDictionary* root,const char* arrayKey,int idx); - const char* getStringValueFromArray_json(cs::JsonDictionary* root,const char* arrayKey,int idx); - cs::JsonDictionary* getDictionaryFromArray_json(cs::JsonDictionary* root,const char* arrayKey,int idx); - bool checkObjectExist_json(cs::JsonDictionary* root,const char* key); + JsonDictionary* getSubDictionary_json(JsonDictionary* root,const char* key); + int getIntValue_json(JsonDictionary* root,const char* key); + float getFloatValue_json(JsonDictionary* root,const char* key); + const char* getStringValue_json(JsonDictionary* root,const char* key); + bool getBooleanValue_json(JsonDictionary* root,const char* key); + int getArrayCount_json(JsonDictionary* root,const char* key); + int getIntValueFromArray_json(JsonDictionary* root,const char* arrayKey,int idx); + float getFloatValueFromArray_json(JsonDictionary* root,const char* arrayKey,int idx); + bool getBoolValueFromArray_json(JsonDictionary* root,const char* arrayKey,int idx); + const char* getStringValueFromArray_json(JsonDictionary* root,const char* arrayKey,int idx); + JsonDictionary* getDictionaryFromArray_json(JsonDictionary* root,const char* arrayKey,int idx); + bool checkObjectExist_json(JsonDictionary* root,const char* key); }; -NS_CC_EXT_END +} #endif /* defined(__CocoGUI__DictionaryHelper__) */ diff --git a/cocos/editor-support/cocostudio/reader/CCSGUIReader.cpp b/cocos/editor-support/cocostudio/reader/CCSGUIReader.cpp index 57778d758a..3ee822c330 100755 --- a/cocos/editor-support/cocostudio/reader/CCSGUIReader.cpp +++ b/cocos/editor-support/cocostudio/reader/CCSGUIReader.cpp @@ -22,14 +22,17 @@ THE SOFTWARE. ****************************************************************************/ -#include "../GUI/System/CocosGUI.h" -#include "../Json/DictionaryHelper.h" -#include "../Action/CCActionManagerEx.h" +#include "system/CocosGUI.h" +#include "json/DictionaryHelper.h" +#include "action/CCActionManagerEx.h" #include #include + using namespace gui; + using namespace cocos2d; -NS_CC_EXT_BEGIN + +namespace cocostudio { static CCSGUIReader* sharedReader = NULL; @@ -94,11 +97,11 @@ int CCSGUIReader::getVersionInteger(const char *str) /************************/ } -UIWidget* CCSGUIReader::widgetFromJsonDictionary(cs::JsonDictionary* data) +UIWidget* CCSGUIReader::widgetFromJsonDictionary(JsonDictionary* data) { UIWidget* widget = NULL; const char* classname = DICTOOL->getStringValue_json(data, "classname"); - cs::JsonDictionary* uiOptions = DICTOOL->getSubDictionary_json(data, "options"); + JsonDictionary* uiOptions = DICTOOL->getSubDictionary_json(data, "options"); if (classname && strcmp(classname, "Button") == 0) { widget = UIButton::create(); @@ -181,7 +184,7 @@ UIWidget* CCSGUIReader::widgetFromJsonDictionary(cs::JsonDictionary* data) int childrenCount = DICTOOL->getArrayCount_json(data, "children"); for (int i=0;igetDictionaryFromArray_json(data, "children", i); + JsonDictionary* subData = DICTOOL->getDictionaryFromArray_json(data, "children", i); UIWidget* child = widgetFromJsonDictionary(subData); if (child) { @@ -201,7 +204,7 @@ UIWidget* CCSGUIReader::widgetFromJsonFile(const char *fileName) m_bOlderVersion = false; const char *des = NULL; std::string jsonpath; - cs::JsonDictionary *jsonDict = NULL; + JsonDictionary *jsonDict = NULL; jsonpath = FileUtils::getInstance()->fullPathForFilename(fileName); unsigned long size = 0; @@ -212,7 +215,7 @@ UIWidget* CCSGUIReader::widgetFromJsonFile(const char *fileName) return NULL; } std::string strDes(des); - jsonDict = new cs::JsonDictionary(); + jsonDict = new JsonDictionary(); jsonDict->initWithDescription(strDes.c_str()); const char* fileVersion = DICTOOL->getStringValue_json(jsonDict, "version"); @@ -244,7 +247,7 @@ UIWidget* CCSGUIReader::widgetFromJsonFile(const char *fileName) CCUIHELPER->setFileDesignWidth(fileDesignWidth); CCUIHELPER->setFileDesignHeight(fileDesignHeight); } - cs::JsonDictionary* widgetTree = DICTOOL->getSubDictionary_json(jsonDict, "widgetTree"); + JsonDictionary* widgetTree = DICTOOL->getSubDictionary_json(jsonDict, "widgetTree"); UIWidget* widget = widgetFromJsonDictionary(widgetTree); /* *********temp********* */ @@ -256,7 +259,7 @@ UIWidget* CCSGUIReader::widgetFromJsonFile(const char *fileName) /* ********************** */ // widget->setFileDesignSize(CCSizeMake(fileDesignWidth, fileDesignHeight)); - cs::JsonDictionary* actions = DICTOOL->getSubDictionary_json(jsonDict, "animation"); + JsonDictionary* actions = DICTOOL->getSubDictionary_json(jsonDict, "animation"); /* *********temp********* */ // ActionManager::shareManager()->releaseActions(); /* ********************** */ @@ -270,7 +273,7 @@ UIWidget* CCSGUIReader::widgetFromJsonFile(const char *fileName) return widget; } -void CCSGUIReader::setPropsForWidgetFromJsonDictionary(UIWidget*widget,cs::JsonDictionary *options) +void CCSGUIReader::setPropsForWidgetFromJsonDictionary(UIWidget*widget,JsonDictionary *options) { bool ignoreSizeExsit = DICTOOL->checkObjectExist_json(options, "ignoreSize"); if (ignoreSizeExsit) @@ -316,7 +319,7 @@ void CCSGUIReader::setPropsForWidgetFromJsonDictionary(UIWidget*widget,cs::JsonD widget->setZOrder(z); } -void CCSGUIReader::setColorPropsForWidgetFromJsonDictionary(UIWidget *widget, cs::JsonDictionary *options) +void CCSGUIReader::setColorPropsForWidgetFromJsonDictionary(UIWidget *widget, JsonDictionary *options) { bool op = DICTOOL->checkObjectExist_json(options, "opacity"); if (op) @@ -341,7 +344,7 @@ void CCSGUIReader::setColorPropsForWidgetFromJsonDictionary(UIWidget *widget, cs widget->setFlipY(flipY); } -void CCSGUIReader::setPropsForButtonFromJsonDictionary(UIWidget*widget,cs::JsonDictionary* options) +void CCSGUIReader::setPropsForButtonFromJsonDictionary(UIWidget*widget,JsonDictionary* options) { if (m_bOlderVersion) { @@ -407,7 +410,7 @@ void CCSGUIReader::setPropsForButtonFromJsonDictionary(UIWidget*widget,cs::JsonD bool scale9Enable = DICTOOL->getBooleanValue_json(options, "scale9Enable"); button->setScale9Enabled(scale9Enable); - cs::JsonDictionary* normalDic = DICTOOL->getSubDictionary_json(options, "normalData"); + JsonDictionary* normalDic = DICTOOL->getSubDictionary_json(options, "normalData"); int normalType = DICTOOL->getIntValue_json(normalDic, "resourceType"); switch (normalType) { @@ -429,7 +432,7 @@ void CCSGUIReader::setPropsForButtonFromJsonDictionary(UIWidget*widget,cs::JsonD break; } CC_SAFE_DELETE(normalDic); - cs::JsonDictionary* pressedDic = DICTOOL->getSubDictionary_json(options, "pressedData"); + JsonDictionary* pressedDic = DICTOOL->getSubDictionary_json(options, "pressedData"); int pressedType = DICTOOL->getIntValue_json(pressedDic, "resourceType"); switch (pressedType) { @@ -451,7 +454,7 @@ void CCSGUIReader::setPropsForButtonFromJsonDictionary(UIWidget*widget,cs::JsonD break; } CC_SAFE_DELETE(pressedDic); - cs::JsonDictionary* disabledDic = DICTOOL->getSubDictionary_json(options, "disabledData"); + JsonDictionary* disabledDic = DICTOOL->getSubDictionary_json(options, "disabledData"); int disabledType = DICTOOL->getIntValue_json(disabledDic, "resourceType"); switch (disabledType) { @@ -494,7 +497,7 @@ void CCSGUIReader::setPropsForButtonFromJsonDictionary(UIWidget*widget,cs::JsonD } } -void CCSGUIReader::setPropsForCheckBoxFromJsonDictionary(UIWidget*widget,cs::JsonDictionary* options) +void CCSGUIReader::setPropsForCheckBoxFromJsonDictionary(UIWidget*widget,JsonDictionary* options) { if (m_bOlderVersion) { @@ -536,7 +539,7 @@ void CCSGUIReader::setPropsForCheckBoxFromJsonDictionary(UIWidget*widget,cs::Jso setPropsForWidgetFromJsonDictionary(widget, options); UICheckBox* checkBox = (UICheckBox*)widget; - cs::JsonDictionary* backGroundDic = DICTOOL->getSubDictionary_json(options, "backGroundBoxData"); + JsonDictionary* backGroundDic = DICTOOL->getSubDictionary_json(options, "backGroundBoxData"); int backGroundType = DICTOOL->getIntValue_json(backGroundDic, "resourceType"); switch (backGroundType) { @@ -559,7 +562,7 @@ void CCSGUIReader::setPropsForCheckBoxFromJsonDictionary(UIWidget*widget,cs::Jso } CC_SAFE_DELETE(backGroundDic); - cs::JsonDictionary* backGroundSelectedDic = DICTOOL->getSubDictionary_json(options, "backGroundBoxSelectedData"); + JsonDictionary* backGroundSelectedDic = DICTOOL->getSubDictionary_json(options, "backGroundBoxSelectedData"); int backGroundSelectedType = DICTOOL->getIntValue_json(backGroundSelectedDic, "resourceType"); switch (backGroundSelectedType) { @@ -582,7 +585,7 @@ void CCSGUIReader::setPropsForCheckBoxFromJsonDictionary(UIWidget*widget,cs::Jso } CC_SAFE_DELETE(backGroundSelectedDic); - cs::JsonDictionary* frontCrossDic = DICTOOL->getSubDictionary_json(options, "frontCrossData"); + JsonDictionary* frontCrossDic = DICTOOL->getSubDictionary_json(options, "frontCrossData"); int frontCrossType = DICTOOL->getIntValue_json(frontCrossDic, "resourceType"); switch (frontCrossType) { @@ -605,7 +608,7 @@ void CCSGUIReader::setPropsForCheckBoxFromJsonDictionary(UIWidget*widget,cs::Jso } CC_SAFE_DELETE(frontCrossDic); - cs::JsonDictionary* backGroundDisabledDic = DICTOOL->getSubDictionary_json(options, "backGroundBoxDisabledData"); + JsonDictionary* backGroundDisabledDic = DICTOOL->getSubDictionary_json(options, "backGroundBoxDisabledData"); int backGroundDisabledType = DICTOOL->getIntValue_json(backGroundDisabledDic, "resourceType"); switch (backGroundDisabledType) { @@ -628,7 +631,7 @@ void CCSGUIReader::setPropsForCheckBoxFromJsonDictionary(UIWidget*widget,cs::Jso } CC_SAFE_DELETE(backGroundDisabledDic); - cs::JsonDictionary* frontCrossDisabledDic = DICTOOL->getSubDictionary_json(options, "frontCrossDisabledData"); + JsonDictionary* frontCrossDisabledDic = DICTOOL->getSubDictionary_json(options, "frontCrossDisabledData"); int frontCrossDisabledType = DICTOOL->getIntValue_json(frontCrossDisabledDic, "resourceType"); switch (frontCrossDisabledType) { @@ -655,7 +658,7 @@ void CCSGUIReader::setPropsForCheckBoxFromJsonDictionary(UIWidget*widget,cs::Jso } } -void CCSGUIReader::setPropsForImageViewFromJsonDictionary(UIWidget*widget,cs::JsonDictionary* options) +void CCSGUIReader::setPropsForImageViewFromJsonDictionary(UIWidget*widget,JsonDictionary* options) { if (m_bOlderVersion) { @@ -725,7 +728,7 @@ void CCSGUIReader::setPropsForImageViewFromJsonDictionary(UIWidget*widget,cs::Js UIImageView* imageView = (UIImageView*)widget; - cs::JsonDictionary* imageFileNameDic = DICTOOL->getSubDictionary_json(options, "fileNameData"); + JsonDictionary* imageFileNameDic = DICTOOL->getSubDictionary_json(options, "fileNameData"); int imageFileNameType = DICTOOL->getIntValue_json(imageFileNameDic, "resourceType"); switch (imageFileNameType) { @@ -784,7 +787,7 @@ void CCSGUIReader::setPropsForImageViewFromJsonDictionary(UIWidget*widget,cs::Js } } -void CCSGUIReader::setPropsForLabelFromJsonDictionary(UIWidget*widget,cs::JsonDictionary* options) +void CCSGUIReader::setPropsForLabelFromJsonDictionary(UIWidget*widget,JsonDictionary* options) { setPropsForWidgetFromJsonDictionary(widget, options); UILabel* label = (UILabel*)widget; @@ -813,7 +816,7 @@ void CCSGUIReader::setPropsForLabelFromJsonDictionary(UIWidget*widget,cs::JsonDi setColorPropsForWidgetFromJsonDictionary(widget,options); } -void CCSGUIReader::setPropsForLabelAtlasFromJsonDictionary(UIWidget*widget,cs::JsonDictionary* options) +void CCSGUIReader::setPropsForLabelAtlasFromJsonDictionary(UIWidget*widget,JsonDictionary* options) { if (m_bOlderVersion) { @@ -847,7 +850,7 @@ void CCSGUIReader::setPropsForLabelAtlasFromJsonDictionary(UIWidget*widget,cs::J if (sv && cmf && iw && ih && scm) { - cs::JsonDictionary* cmftDic = DICTOOL->getSubDictionary_json(options, "charMapFileData"); + JsonDictionary* cmftDic = DICTOOL->getSubDictionary_json(options, "charMapFileData"); int cmfType = DICTOOL->getIntValue_json(cmftDic, "resourceType"); switch (cmfType) { @@ -871,7 +874,7 @@ void CCSGUIReader::setPropsForLabelAtlasFromJsonDictionary(UIWidget*widget,cs::J } } -void CCSGUIReader::setPropsForContainerWidgetFromJsonDictionary(UIWidget *widget, cs::JsonDictionary *options) +void CCSGUIReader::setPropsForContainerWidgetFromJsonDictionary(UIWidget *widget, JsonDictionary *options) { setPropsForWidgetFromJsonDictionary(widget, options); Layout* containerWidget = (Layout*)widget; @@ -884,7 +887,7 @@ void CCSGUIReader::setPropsForContainerWidgetFromJsonDictionary(UIWidget *widget setColorPropsForWidgetFromJsonDictionary(widget,options); } -void CCSGUIReader::setPropsForPanelFromJsonDictionary(UIWidget*widget,cs::JsonDictionary* options) +void CCSGUIReader::setPropsForPanelFromJsonDictionary(UIWidget*widget,JsonDictionary* options) { if (m_bOlderVersion) { @@ -987,7 +990,7 @@ void CCSGUIReader::setPropsForPanelFromJsonDictionary(UIWidget*widget,cs::JsonDi // panel->setSize(CCSizeMake(w, h)); - cs::JsonDictionary* imageFileNameDic = DICTOOL->getSubDictionary_json(options, "backGroundImageData"); + JsonDictionary* imageFileNameDic = DICTOOL->getSubDictionary_json(options, "backGroundImageData"); int imageFileNameType = DICTOOL->getIntValue_json(imageFileNameDic, "resourceType"); switch (imageFileNameType) { @@ -1022,7 +1025,7 @@ void CCSGUIReader::setPropsForPanelFromJsonDictionary(UIWidget*widget,cs::JsonDi } } -void CCSGUIReader::setPropsForScrollViewFromJsonDictionary(UIWidget*widget,cs::JsonDictionary* options) +void CCSGUIReader::setPropsForScrollViewFromJsonDictionary(UIWidget*widget,JsonDictionary* options) { setPropsForPanelFromJsonDictionary(widget, options); UIScrollView* scrollView = (UIScrollView*)widget; @@ -1036,7 +1039,7 @@ void CCSGUIReader::setPropsForScrollViewFromJsonDictionary(UIWidget*widget,cs::J setColorPropsForWidgetFromJsonDictionary(widget,options); } -void CCSGUIReader::setPropsForSliderFromJsonDictionary(UIWidget*widget,cs::JsonDictionary* options) +void CCSGUIReader::setPropsForSliderFromJsonDictionary(UIWidget*widget,JsonDictionary* options) { if (m_bOlderVersion) { @@ -1128,7 +1131,7 @@ void CCSGUIReader::setPropsForSliderFromJsonDictionary(UIWidget*widget,cs::JsonD if (barTextureScale9Enable) { - cs::JsonDictionary* imageFileNameDic = DICTOOL->getSubDictionary_json(options, "barFileNameData"); + JsonDictionary* imageFileNameDic = DICTOOL->getSubDictionary_json(options, "barFileNameData"); int imageFileType = DICTOOL->getIntValue_json(imageFileNameDic, "resourceType"); switch (imageFileType) { @@ -1155,7 +1158,7 @@ void CCSGUIReader::setPropsForSliderFromJsonDictionary(UIWidget*widget,cs::JsonD } else { - cs::JsonDictionary* imageFileNameDic = DICTOOL->getSubDictionary_json(options, "barFileNameData"); + JsonDictionary* imageFileNameDic = DICTOOL->getSubDictionary_json(options, "barFileNameData"); int imageFileType = DICTOOL->getIntValue_json(imageFileNameDic, "resourceType"); switch (imageFileType) { @@ -1199,7 +1202,7 @@ void CCSGUIReader::setPropsForSliderFromJsonDictionary(UIWidget*widget,cs::JsonD // slider->setSlidBallTextures(normalFileName_tp,pressedFileName_tp,disabledFileName_tp); // } - cs::JsonDictionary* normalDic = DICTOOL->getSubDictionary_json(options, "ballNormalData"); + JsonDictionary* normalDic = DICTOOL->getSubDictionary_json(options, "ballNormalData"); int normalType = DICTOOL->getIntValue_json(normalDic, "resourceType"); switch (normalType) { @@ -1222,7 +1225,7 @@ void CCSGUIReader::setPropsForSliderFromJsonDictionary(UIWidget*widget,cs::JsonD } CC_SAFE_DELETE(normalDic); - cs::JsonDictionary* pressedDic = DICTOOL->getSubDictionary_json(options, "ballPressedData"); + JsonDictionary* pressedDic = DICTOOL->getSubDictionary_json(options, "ballPressedData"); int pressedType = DICTOOL->getIntValue_json(pressedDic, "resourceType"); switch (pressedType) { @@ -1245,7 +1248,7 @@ void CCSGUIReader::setPropsForSliderFromJsonDictionary(UIWidget*widget,cs::JsonD } CC_SAFE_DELETE(pressedDic); - cs::JsonDictionary* disabledDic = DICTOOL->getSubDictionary_json(options, "ballDisabledData"); + JsonDictionary* disabledDic = DICTOOL->getSubDictionary_json(options, "ballDisabledData"); int disabledType = DICTOOL->getIntValue_json(disabledDic, "resourceType"); switch (disabledType) { @@ -1270,7 +1273,7 @@ void CCSGUIReader::setPropsForSliderFromJsonDictionary(UIWidget*widget,cs::JsonD slider->setPercent(DICTOOL->getIntValue_json(options, "percent")); - cs::JsonDictionary* progressBarDic = DICTOOL->getSubDictionary_json(options, "progressBarData"); + JsonDictionary* progressBarDic = DICTOOL->getSubDictionary_json(options, "progressBarData"); int progressBarType = DICTOOL->getIntValue_json(progressBarDic, "resourceType"); switch (progressBarType) { @@ -1295,7 +1298,7 @@ void CCSGUIReader::setPropsForSliderFromJsonDictionary(UIWidget*widget,cs::JsonD } } -void CCSGUIReader::setPropsForTextAreaFromJsonDictionary(UIWidget*widget,cs::JsonDictionary* options) +void CCSGUIReader::setPropsForTextAreaFromJsonDictionary(UIWidget*widget,JsonDictionary* options) { setPropsForWidgetFromJsonDictionary(widget, options); UILabel* textArea = (UILabel*)widget; @@ -1330,7 +1333,7 @@ void CCSGUIReader::setPropsForTextAreaFromJsonDictionary(UIWidget*widget,cs::Jso setColorPropsForWidgetFromJsonDictionary(widget,options); } -void CCSGUIReader::setPropsForTextButtonFromJsonDictionary(UIWidget*widget,cs::JsonDictionary* options) +void CCSGUIReader::setPropsForTextButtonFromJsonDictionary(UIWidget*widget,JsonDictionary* options) { setPropsForButtonFromJsonDictionary(widget, options); @@ -1357,7 +1360,7 @@ void CCSGUIReader::setPropsForTextButtonFromJsonDictionary(UIWidget*widget,cs::J setColorPropsForWidgetFromJsonDictionary(widget,options); } -void CCSGUIReader::setPropsForTextFieldFromJsonDictionary(UIWidget*widget,cs::JsonDictionary* options) +void CCSGUIReader::setPropsForTextFieldFromJsonDictionary(UIWidget*widget,JsonDictionary* options) { setPropsForWidgetFromJsonDictionary(widget, options); UITextField* textField = (UITextField*)widget; @@ -1407,7 +1410,7 @@ void CCSGUIReader::setPropsForTextFieldFromJsonDictionary(UIWidget*widget,cs::Js setColorPropsForWidgetFromJsonDictionary(widget,options); } -void CCSGUIReader::setPropsForLoadingBarFromJsonDictionary(UIWidget *widget, cs::JsonDictionary *options) +void CCSGUIReader::setPropsForLoadingBarFromJsonDictionary(UIWidget *widget, JsonDictionary *options) { if (m_bOlderVersion) { @@ -1434,7 +1437,7 @@ void CCSGUIReader::setPropsForLoadingBarFromJsonDictionary(UIWidget *widget, cs: setPropsForWidgetFromJsonDictionary(widget, options); UILoadingBar* loadingBar = (UILoadingBar*)widget; - cs::JsonDictionary* imageFileNameDic = DICTOOL->getSubDictionary_json(options, "textureData"); + JsonDictionary* imageFileNameDic = DICTOOL->getSubDictionary_json(options, "textureData"); int imageFileNameType = DICTOOL->getIntValue_json(imageFileNameDic, "resourceType"); switch (imageFileNameType) { @@ -1486,18 +1489,18 @@ void CCSGUIReader::setPropsForLoadingBarFromJsonDictionary(UIWidget *widget, cs: } } -void CCSGUIReader::setPropsForListViewFromJsonDictionary(UIWidget *widget, cs::JsonDictionary *options) +void CCSGUIReader::setPropsForListViewFromJsonDictionary(UIWidget *widget, JsonDictionary *options) { setPropsForScrollViewFromJsonDictionary(widget, options); } -void CCSGUIReader::setPropsForPageViewFromJsonDictionary(UIWidget*widget,cs::JsonDictionary* options) +void CCSGUIReader::setPropsForPageViewFromJsonDictionary(UIWidget*widget,JsonDictionary* options) { setPropsForPanelFromJsonDictionary(widget, options); setColorPropsForWidgetFromJsonDictionary(widget,options); } -void CCSGUIReader::setPropsForLabelBMFontFromJsonDictionary(UIWidget *widget, cs::JsonDictionary *options) +void CCSGUIReader::setPropsForLabelBMFontFromJsonDictionary(UIWidget *widget, JsonDictionary *options) { if (m_bOlderVersion) { @@ -1523,7 +1526,7 @@ void CCSGUIReader::setPropsForLabelBMFontFromJsonDictionary(UIWidget *widget, cs UILabelBMFont* labelBMFont = (UILabelBMFont*)widget; - cs::JsonDictionary* cmftDic = DICTOOL->getSubDictionary_json(options, "fileNameData"); + JsonDictionary* cmftDic = DICTOOL->getSubDictionary_json(options, "fileNameData"); int cmfType = DICTOOL->getIntValue_json(cmftDic, "resourceType"); switch (cmfType) { @@ -1550,7 +1553,7 @@ void CCSGUIReader::setPropsForLabelBMFontFromJsonDictionary(UIWidget *widget, cs } } -void CCSGUIReader::setPropsForDragPanelFromJsonDictionary(UIWidget *widget, cs::JsonDictionary *options) +void CCSGUIReader::setPropsForDragPanelFromJsonDictionary(UIWidget *widget, JsonDictionary *options) { setPropsForPanelFromJsonDictionary(widget, options); @@ -1566,4 +1569,4 @@ void CCSGUIReader::setPropsForDragPanelFromJsonDictionary(UIWidget *widget, cs:: setColorPropsForWidgetFromJsonDictionary(widget, options); } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/editor-support/cocostudio/reader/CCSGUIReader.h b/cocos/editor-support/cocostudio/reader/CCSGUIReader.h index 75aa04981e..43c0c9693c 100755 --- a/cocos/editor-support/cocostudio/reader/CCSGUIReader.h +++ b/cocos/editor-support/cocostudio/reader/CCSGUIReader.h @@ -25,13 +25,13 @@ #ifndef __CCSGUIREADER_H__ #define __CCSGUIREADER_H__ -#include "../GUI/BaseClasses/UIWidget.h" -#include "../Json/CSContentJsonDictionary.h" +#include "base-classes/UIWidget.h" +#include "json/CSContentJsonDictionary.h" -NS_CC_EXT_BEGIN +namespace cocostudio { #define kCCSVersion 1.0 -class CCSGUIReader : Object +class CCSGUIReader : cocos2d::Object { public: CCSGUIReader(); @@ -39,38 +39,38 @@ public: static CCSGUIReader* shareReader(); static void purgeCCSGUIReader(); - UIWidget* widgetFromJsonFile(const char* fileName); - UIWidget* widgetFromJsonDictionary(cs::JsonDictionary* data); + gui::UIWidget* widgetFromJsonFile(const char* fileName); + gui::UIWidget* widgetFromJsonDictionary(JsonDictionary* data); int getVersionInteger(const char* str); - void setPropsForWidgetFromJsonDictionary(UIWidget*widget,cs::JsonDictionary* options); - void setColorPropsForWidgetFromJsonDictionary(UIWidget*widget,cs::JsonDictionary* options); - void setPropsForButtonFromJsonDictionary(UIWidget*widget,cs::JsonDictionary* options); - void setPropsForCheckBoxFromJsonDictionary(UIWidget*widget,cs::JsonDictionary* options); - void setPropsForImageViewFromJsonDictionary(UIWidget*widget,cs::JsonDictionary* options); - void setPropsForLabelFromJsonDictionary(UIWidget*widget,cs::JsonDictionary* options); - void setPropsForLabelAtlasFromJsonDictionary(UIWidget*widget,cs::JsonDictionary* options); - void setPropsForContainerWidgetFromJsonDictionary(UIWidget*widget,cs::JsonDictionary* options); - void setPropsForPanelFromJsonDictionary(UIWidget*widget,cs::JsonDictionary* options); - void setPropsForScrollViewFromJsonDictionary(UIWidget*widget,cs::JsonDictionary* options); - void setPropsForSliderFromJsonDictionary(UIWidget*widget,cs::JsonDictionary* options); - void setPropsForTextAreaFromJsonDictionary(UIWidget*widget,cs::JsonDictionary* options); - void setPropsForTextButtonFromJsonDictionary(UIWidget*widget,cs::JsonDictionary* options); - void setPropsForTextFieldFromJsonDictionary(UIWidget*widget,cs::JsonDictionary* options); - void setPropsForLoadingBarFromJsonDictionary(UIWidget*widget,cs::JsonDictionary* options); - void setPropsForImageButtonFromJsonDictionary(UIWidget* widget, cs::JsonDictionary* options); - void setPropsForListViewFromJsonDictionary(UIWidget* widget, cs::JsonDictionary* options); - void setPropsForPageViewFromJsonDictionary(UIWidget*widget,cs::JsonDictionary* options); - void setPropsForLabelBMFontFromJsonDictionary(UIWidget*widget,cs::JsonDictionary* options); - void setPropsForDragPanelFromJsonDictionary(UIWidget*widget,cs::JsonDictionary* options); + void setPropsForWidgetFromJsonDictionary(gui::UIWidget*widget,JsonDictionary* options); + void setColorPropsForWidgetFromJsonDictionary(gui::UIWidget*widget,JsonDictionary* options); + void setPropsForButtonFromJsonDictionary(gui::UIWidget*widget,JsonDictionary* options); + void setPropsForCheckBoxFromJsonDictionary(gui::UIWidget*widget,JsonDictionary* options); + void setPropsForImageViewFromJsonDictionary(gui::UIWidget*widget,JsonDictionary* options); + void setPropsForLabelFromJsonDictionary(gui::UIWidget*widget,JsonDictionary* options); + void setPropsForLabelAtlasFromJsonDictionary(gui::UIWidget*widget,JsonDictionary* options); + void setPropsForContainerWidgetFromJsonDictionary(gui::UIWidget*widget,JsonDictionary* options); + void setPropsForPanelFromJsonDictionary(gui::UIWidget*widget,JsonDictionary* options); + void setPropsForScrollViewFromJsonDictionary(gui::UIWidget*widget,JsonDictionary* options); + void setPropsForSliderFromJsonDictionary(gui::UIWidget*widget,JsonDictionary* options); + void setPropsForTextAreaFromJsonDictionary(gui::UIWidget*widget,JsonDictionary* options); + void setPropsForTextButtonFromJsonDictionary(gui::UIWidget*widget,JsonDictionary* options); + void setPropsForTextFieldFromJsonDictionary(gui::UIWidget*widget,JsonDictionary* options); + void setPropsForLoadingBarFromJsonDictionary(gui::UIWidget*widget,JsonDictionary* options); + void setPropsForImageButtonFromJsonDictionary(gui::UIWidget* widget, JsonDictionary* options); + void setPropsForListViewFromJsonDictionary(gui::UIWidget* widget, JsonDictionary* options); + void setPropsForPageViewFromJsonDictionary(gui::UIWidget*widget,JsonDictionary* options); + void setPropsForLabelBMFontFromJsonDictionary(gui::UIWidget*widget,JsonDictionary* options); + void setPropsForDragPanelFromJsonDictionary(gui::UIWidget*widget,JsonDictionary* options); protected: std::string m_strFilePath; bool m_bOlderVersion; }; -NS_CC_EXT_END +} #endif /* defined(__CCSGUIReader__) */ diff --git a/cocos/editor-support/cocostudio/reader/CCSSceneReader.cpp b/cocos/editor-support/cocostudio/reader/CCSSceneReader.cpp index a83ef909ac..a32572d791 100644 --- a/cocos/editor-support/cocostudio/reader/CCSSceneReader.cpp +++ b/cocos/editor-support/cocostudio/reader/CCSSceneReader.cpp @@ -23,9 +23,13 @@ ****************************************************************************/ #include "CCSSceneReader.h" -#include "cocos-ext.h" +#include "CocoStudio.h" +#include "system/CocosGUI.h" -NS_CC_EXT_BEGIN +using namespace cocos2d; +using namespace gui; + +namespace cocostudio { SceneReader* SceneReader::s_sharedReader = NULL; @@ -51,7 +55,7 @@ NS_CC_EXT_BEGIN CC_BREAK_IF(pszFileName == NULL); pData = (char*)(cocos2d::FileUtils::getInstance()->getFileData(pszFileName, "r", &size)); CC_BREAK_IF(pData == NULL || strcmp(pData, "") == 0); - cs::JsonDictionary *jsonDict = new cs::JsonDictionary(); + JsonDictionary *jsonDict = new JsonDictionary(); jsonDict->initWithDescription(pData); pNode = createObject(jsonDict,NULL); CC_SAFE_DELETE(jsonDict); @@ -60,7 +64,7 @@ NS_CC_EXT_BEGIN return pNode; } - Node* SceneReader::createObject(cs::JsonDictionary * inputFiles, Node* parenet) + Node* SceneReader::createObject(JsonDictionary * inputFiles, Node* parenet) { const char *className = inputFiles->getItemStringValue("classname"); if(strcmp(className, "CCNode") == 0) @@ -81,7 +85,7 @@ NS_CC_EXT_BEGIN int count = inputFiles->getArrayItemCount("components"); for (int i = 0; i < count; i++) { - cs::JsonDictionary * subDict = inputFiles->getSubItemFromArray("components", i); + JsonDictionary * subDict = inputFiles->getSubItemFromArray("components", i); if (!subDict) { CC_SAFE_DELETE(subDict); @@ -90,7 +94,7 @@ NS_CC_EXT_BEGIN const char *comName = subDict->getItemStringValue("classname"); const char *pComName = subDict->getItemStringValue("name"); - cs::JsonDictionary *fileData = subDict->getSubDictionary("fileData"); + JsonDictionary *fileData = subDict->getSubDictionary("fileData"); std::string pPath; std::string pPlistFile; int nResType = 0; @@ -212,7 +216,7 @@ NS_CC_EXT_BEGIN } unsigned long size = 0; const char *des = (char*)(cocos2d::FileUtils::getInstance()->getFileData(pPath.c_str(),"r" , &size)); - cs::JsonDictionary *jsonDict = new cs::JsonDictionary(); + JsonDictionary *jsonDict = new JsonDictionary(); jsonDict->initWithDescription(des); if(NULL == des || strcmp(des, "") == 0) { @@ -220,7 +224,7 @@ NS_CC_EXT_BEGIN } int childrenCount = DICTOOL->getArrayCount_json(jsonDict, "armature_data"); - cs::JsonDictionary* subData = DICTOOL->getDictionaryFromArray_json(jsonDict, "armature_data", 0); + JsonDictionary* subData = DICTOOL->getDictionaryFromArray_json(jsonDict, "armature_data", 0); const char *name = DICTOOL->getStringValue_json(subData, "name"); childrenCount = DICTOOL->getArrayCount_json(jsonDict, "config_file_path"); @@ -238,11 +242,11 @@ NS_CC_EXT_BEGIN textupath += file_path; textupath.append(textureFileName); - cocos2d::extension::armature::ArmatureDataManager::getInstance()->addArmatureFileInfo(textupath.c_str(), plistpath.c_str(), pPath.c_str()); + ArmatureDataManager::getInstance()->addArmatureFileInfo(textupath.c_str(), plistpath.c_str(), pPath.c_str()); } - cocos2d::extension::armature::Armature *pAr = cocos2d::extension::armature::Armature::create(name); + Armature *pAr = Armature::create(name); ComRender *pRender = ComRender::create(pAr, "CCArmature"); if (pComName != NULL) { @@ -315,9 +319,9 @@ NS_CC_EXT_BEGIN } else if(comName != NULL && strcmp(comName, "GUIComponent") == 0) { - cocos2d::extension::UILayer *pLayer = cocos2d::extension::UILayer::create(); + gui::UILayer *pLayer = gui::UILayer::create(); pLayer->scheduleUpdate(); - UIWidget* widget=cocos2d::extension::UIHelper::instance()->createWidgetFromJsonFile(pPath.c_str()); + UIWidget* widget= gui::UIHelper::instance()->createWidgetFromJsonFile(pPath.c_str()); pLayer->addWidget(widget); ComRender *pRender = ComRender::create(pLayer, "GUIComponent"); if (pComName != NULL) @@ -332,7 +336,7 @@ NS_CC_EXT_BEGIN for (int i = 0; i < inputFiles->getArrayItemCount("gameobjects"); i++) { - cs::JsonDictionary * subDict = inputFiles->getSubItemFromArray("gameobjects", i); + JsonDictionary * subDict = inputFiles->getSubItemFromArray("gameobjects", i); if (!subDict) { break; @@ -348,7 +352,7 @@ NS_CC_EXT_BEGIN } - void SceneReader::setPropertyFromJsonDict(cocos2d::Node *node, cs::JsonDictionary* dict) + void SceneReader::setPropertyFromJsonDict(cocos2d::Node *node, JsonDictionary* dict) { int x = dict->getItemIntValue("x", 0); int y = dict->getItemIntValue("y", 0); @@ -384,7 +388,7 @@ NS_CC_EXT_BEGIN void SceneReader::purgeSceneReader() { CC_SAFE_DELETE(s_sharedReader); - cocos2d::extension::DictionaryHelper::shareHelper()->purgeDictionaryHelper(); + DictionaryHelper::shareHelper()->purgeDictionaryHelper(); } -NS_CC_EXT_END +} diff --git a/cocos/editor-support/cocostudio/reader/CCSSceneReader.h b/cocos/editor-support/cocostudio/reader/CCSSceneReader.h index c0c88ae660..ca95088c59 100644 --- a/cocos/editor-support/cocostudio/reader/CCSSceneReader.h +++ b/cocos/editor-support/cocostudio/reader/CCSSceneReader.h @@ -26,10 +26,9 @@ #define __CCSSCENEREADER_H__ #include "cocos2d.h" -#include "cocos-ext.h" -#include "ExtensionMacros.h" + #include "json/CSContentJsonDictionary.h" -NS_CC_EXT_BEGIN +namespace cocostudio { class SceneReader { @@ -51,14 +50,14 @@ public: cocos2d::Node* createNodeWithSceneFile(const char *pszFileName); private: - cocos2d::Node* createObject(cs::JsonDictionary * inputFiles, cocos2d::Node* parent); - void setPropertyFromJsonDict(cocos2d::Node *node, cs::JsonDictionary* dict); + cocos2d::Node* createObject(JsonDictionary * inputFiles, cocos2d::Node* parent); + void setPropertyFromJsonDict(cocos2d::Node *node, JsonDictionary* dict); private: static SceneReader* s_sharedReader; }; -NS_CC_EXT_END +} #endif diff --git a/cocos/editor-support/spine/Android.mk b/cocos/editor-support/spine/Android.mk new file mode 100644 index 0000000000..35ad40845d --- /dev/null +++ b/cocos/editor-support/spine/Android.mk @@ -0,0 +1,42 @@ +LOCAL_PATH := $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_MODULE := spine_static + +LOCAL_MODULE_FILENAME := libspine + +LOCAL_SRC_FILES := Animation.cpp \ +AnimationState.cpp \ +AnimationStateData.cpp \ +Atlas.cpp \ +AtlasAttachmentLoader.cpp \ +Attachment.cpp \ +AttachmentLoader.cpp \ +Bone.cpp \ +BoneData.cpp \ +CCSkeleton.cpp \ +CCSkeletonAnimation.cpp \ +Json.cpp \ +RegionAttachment.cpp \ +Skeleton.cpp \ +SkeletonData.cpp \ +SkeletonJson.cpp \ +Skin.cpp \ +Slot.cpp \ +SlotData.cpp \ +extension.cpp \ +spine-cocos2dx.cpp + +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/.. + +LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../2d \ +$(LOCAL_PATH)/.. + +LOCAL_CFLAGS += -Wno-psabi +LOCAL_EXPORT_CFLAGS += -Wno-psabi + +LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static + +include $(BUILD_STATIC_LIBRARY) + +$(call import-module,2d) diff --git a/cocos/editor-support/spine/Animation.cpp b/cocos/editor-support/spine/Animation.cpp index f60aae6f2c..655e80be06 100644 --- a/cocos/editor-support/spine/Animation.cpp +++ b/cocos/editor-support/spine/Animation.cpp @@ -27,7 +27,7 @@ #include #include -namespace cocos2d { namespace extension { +namespace spine { Animation* Animation_create (const char* name, int timelineCount) { Animation* self = NEW(Animation); @@ -496,4 +496,4 @@ void AttachmentTimeline_setFrame (AttachmentTimeline* self, int frameIndex, floa self->attachmentNames[frameIndex] = 0; } -}} // namespace cocos2d { namespace extension { +} // namespace spine { diff --git a/cocos/editor-support/spine/Animation.h b/cocos/editor-support/spine/Animation.h index b7d922ca95..992e414da9 100644 --- a/cocos/editor-support/spine/Animation.h +++ b/cocos/editor-support/spine/Animation.h @@ -26,7 +26,7 @@ #ifndef SPINE_ANIMATION_H_ #define SPINE_ANIMATION_H_ -namespace cocos2d { namespace extension { +namespace spine { typedef struct Timeline Timeline; struct Skeleton; @@ -127,6 +127,6 @@ AttachmentTimeline* AttachmentTimeline_create (int frameCount); /* @param attachmentName May be 0. */ void AttachmentTimeline_setFrame (AttachmentTimeline* self, int frameIndex, float time, const char* attachmentName); -}} // namespace cocos2d { namespace extension { +} #endif /* SPINE_ANIMATION_H_ */ diff --git a/cocos/editor-support/spine/AnimationState.cpp b/cocos/editor-support/spine/AnimationState.cpp index be2bde367d..f118528523 100644 --- a/cocos/editor-support/spine/AnimationState.cpp +++ b/cocos/editor-support/spine/AnimationState.cpp @@ -27,7 +27,7 @@ #include #include -namespace cocos2d { namespace extension { +namespace spine { typedef struct _Entry _Entry; struct _Entry { @@ -175,4 +175,4 @@ int/*bool*/AnimationState_isComplete (AnimationState* self) { return !self->animation || self->time >= self->animation->duration; } -}} // namespace cocos2d { namespace extension { \ No newline at end of file +} // namespace spine { \ No newline at end of file diff --git a/cocos/editor-support/spine/AnimationState.h b/cocos/editor-support/spine/AnimationState.h index 5362281660..5d6047b7c7 100644 --- a/cocos/editor-support/spine/AnimationState.h +++ b/cocos/editor-support/spine/AnimationState.h @@ -28,7 +28,7 @@ #include -namespace cocos2d { namespace extension { +namespace spine { typedef struct { AnimationStateData* const data; @@ -61,6 +61,6 @@ void AnimationState_clearAnimation (AnimationState* self); int/*bool*/AnimationState_isComplete (AnimationState* self); -}} // namespace cocos2d { namespace extension { +} // namespace spine { #endif /* SPINE_ANIMATIONSTATE_H_ */ diff --git a/cocos/editor-support/spine/AnimationStateData.cpp b/cocos/editor-support/spine/AnimationStateData.cpp index b467dbfb7f..5f282a1d75 100644 --- a/cocos/editor-support/spine/AnimationStateData.cpp +++ b/cocos/editor-support/spine/AnimationStateData.cpp @@ -26,7 +26,7 @@ #include #include -namespace cocos2d { namespace extension { +namespace spine { typedef struct _ToEntry _ToEntry; struct _ToEntry { @@ -147,4 +147,4 @@ float AnimationStateData_getMix (AnimationStateData* self, Animation* from, Anim return 0; } -}} // namespace cocos2d { namespace extension { +} // namespace spine { diff --git a/cocos/editor-support/spine/AnimationStateData.h b/cocos/editor-support/spine/AnimationStateData.h index ea45653ed7..8b4284c8dc 100644 --- a/cocos/editor-support/spine/AnimationStateData.h +++ b/cocos/editor-support/spine/AnimationStateData.h @@ -29,7 +29,7 @@ #include #include -namespace cocos2d { namespace extension { +namespace spine { typedef struct { SkeletonData* const skeletonData; @@ -44,6 +44,6 @@ void AnimationStateData_setMix (AnimationStateData* self, Animation* from, Anima /* Returns 0 if there is no mixing between the animations. */ float AnimationStateData_getMix (AnimationStateData* self, Animation* from, Animation* to); -}} // namespace cocos2d { namespace extension { +} // namespace spine { #endif /* SPINE_ANIMATIONSTATEDATA_H_ */ diff --git a/cocos/editor-support/spine/Atlas.cpp b/cocos/editor-support/spine/Atlas.cpp index 8b9861463f..1a2293bacb 100644 --- a/cocos/editor-support/spine/Atlas.cpp +++ b/cocos/editor-support/spine/Atlas.cpp @@ -27,7 +27,7 @@ #include #include -namespace cocos2d { namespace extension { +namespace spine { AtlasPage* AtlasPage_create (const char* name) { AtlasPage* self = NEW(AtlasPage); @@ -336,4 +336,4 @@ AtlasRegion* Atlas_findRegion (const Atlas* self, const char* name) { return 0; } -}} // namespace cocos2d { namespace extension { \ No newline at end of file +} // namespace spine { \ No newline at end of file diff --git a/cocos/editor-support/spine/Atlas.h b/cocos/editor-support/spine/Atlas.h index ea5ca9b781..066bf7af8b 100644 --- a/cocos/editor-support/spine/Atlas.h +++ b/cocos/editor-support/spine/Atlas.h @@ -26,7 +26,7 @@ #ifndef SPINE_ATLAS_H_ #define SPINE_ATLAS_H_ -namespace cocos2d { namespace extension { +namespace spine { typedef enum { ATLAS_ALPHA, ATLAS_INTENSITY, ATLAS_LUMINANCE_ALPHA, ATLAS_RGB565, ATLAS_RGBA4444, ATLAS_RGB888, ATLAS_RGBA8888 @@ -101,6 +101,6 @@ void Atlas_dispose (Atlas* atlas); /* Returns 0 if the region was not found. */ AtlasRegion* Atlas_findRegion (const Atlas* self, const char* name); -}} // namespace cocos2d { namespace extension { +} // namespace spine { #endif /* SPINE_ATLAS_H_ */ diff --git a/cocos/editor-support/spine/AtlasAttachmentLoader.cpp b/cocos/editor-support/spine/AtlasAttachmentLoader.cpp index ce064df6eb..4a70175912 100644 --- a/cocos/editor-support/spine/AtlasAttachmentLoader.cpp +++ b/cocos/editor-support/spine/AtlasAttachmentLoader.cpp @@ -26,7 +26,7 @@ #include #include -namespace cocos2d { namespace extension { +namespace spine { Attachment* _AtlasAttachmentLoader_newAttachment (AttachmentLoader* loader, Skin* skin, AttachmentType type, const char* name) { AtlasAttachmentLoader* self = SUB_CAST(AtlasAttachmentLoader, loader); @@ -62,4 +62,4 @@ AtlasAttachmentLoader* AtlasAttachmentLoader_create (Atlas* atlas) { return self; } -}} // namespace cocos2d { namespace extension { \ No newline at end of file +} // namespace spine { \ No newline at end of file diff --git a/cocos/editor-support/spine/AtlasAttachmentLoader.h b/cocos/editor-support/spine/AtlasAttachmentLoader.h index 20e90464e2..7dcd266400 100644 --- a/cocos/editor-support/spine/AtlasAttachmentLoader.h +++ b/cocos/editor-support/spine/AtlasAttachmentLoader.h @@ -29,7 +29,7 @@ #include #include -namespace cocos2d { namespace extension { +namespace spine { typedef struct { AttachmentLoader super; @@ -38,6 +38,6 @@ typedef struct { AtlasAttachmentLoader* AtlasAttachmentLoader_create (Atlas* atlas); -}} // namespace cocos2d { namespace extension { +} // namespace spine { #endif /* SPINE_ATLASATTACHMENTLOADER_H_ */ diff --git a/cocos/editor-support/spine/Attachment.cpp b/cocos/editor-support/spine/Attachment.cpp index 50e158b676..3844e4eefb 100644 --- a/cocos/editor-support/spine/Attachment.cpp +++ b/cocos/editor-support/spine/Attachment.cpp @@ -27,7 +27,7 @@ #include #include -namespace cocos2d { namespace extension { +namespace spine { typedef struct _AttachmentVtable { void (*dispose) (Attachment* self); @@ -53,4 +53,4 @@ void Attachment_dispose (Attachment* self) { FREE(self); } -}} // namespace cocos2d { namespace extension { +} // namespace spine { diff --git a/cocos/editor-support/spine/Attachment.h b/cocos/editor-support/spine/Attachment.h index 7be7cf0dc5..868de80cb1 100644 --- a/cocos/editor-support/spine/Attachment.h +++ b/cocos/editor-support/spine/Attachment.h @@ -26,7 +26,7 @@ #ifndef SPINE_ATTACHMENT_H_ #define SPINE_ATTACHMENT_H_ -namespace cocos2d { namespace extension { +namespace spine { struct Slot; @@ -44,6 +44,6 @@ struct Attachment { void Attachment_dispose (Attachment* self); -}} // namespace cocos2d { namespace extension { +} // namespace spine { #endif /* SPINE_ATTACHMENT_H_ */ diff --git a/cocos/editor-support/spine/AttachmentLoader.cpp b/cocos/editor-support/spine/AttachmentLoader.cpp index 8e712a9c5e..9ebac1eb8c 100644 --- a/cocos/editor-support/spine/AttachmentLoader.cpp +++ b/cocos/editor-support/spine/AttachmentLoader.cpp @@ -27,7 +27,7 @@ #include #include -namespace cocos2d { namespace extension { +namespace spine { typedef struct _AttachmentLoaderVtable { Attachment* (*newAttachment) (AttachmentLoader* self, Skin* skin, AttachmentType type, const char* name); @@ -74,4 +74,4 @@ void _AttachmentLoader_setUnknownTypeError (AttachmentLoader* self, AttachmentTy _AttachmentLoader_setError(self, "Unknown attachment type: ", buffer); } -}} // namespace cocos2d { namespace extension { +} // namespace spine { diff --git a/cocos/editor-support/spine/AttachmentLoader.h b/cocos/editor-support/spine/AttachmentLoader.h index 5fd81f5eb8..09934f97d1 100644 --- a/cocos/editor-support/spine/AttachmentLoader.h +++ b/cocos/editor-support/spine/AttachmentLoader.h @@ -29,7 +29,7 @@ #include #include -namespace cocos2d { namespace extension { +namespace spine { typedef struct AttachmentLoader AttachmentLoader; struct AttachmentLoader { @@ -47,6 +47,6 @@ void AttachmentLoader_dispose (AttachmentLoader* self); /* Returns 0 to not load an attachment. If 0 is returned and AttachmentLoader.error1 is set, an error occurred. */ Attachment* AttachmentLoader_newAttachment (AttachmentLoader* self, Skin* skin, AttachmentType type, const char* name); -}} // namespace cocos2d { namespace extension { +} // namespace spine { #endif /* SPINE_ATTACHMENTLOADER_H_ */ diff --git a/cocos/editor-support/spine/Bone.cpp b/cocos/editor-support/spine/Bone.cpp index 17030f6405..9fda530792 100644 --- a/cocos/editor-support/spine/Bone.cpp +++ b/cocos/editor-support/spine/Bone.cpp @@ -27,7 +27,7 @@ #include #include -namespace cocos2d { namespace extension { +namespace spine { static int yDown; @@ -96,4 +96,4 @@ void Bone_updateWorldTransform (Bone* self, int flipX, int flipY) { } } -}} // namespace cocos2d { namespace extension { \ No newline at end of file +} // namespace spine { \ No newline at end of file diff --git a/cocos/editor-support/spine/Bone.h b/cocos/editor-support/spine/Bone.h index 3f4688a728..b03b54d197 100644 --- a/cocos/editor-support/spine/Bone.h +++ b/cocos/editor-support/spine/Bone.h @@ -28,7 +28,7 @@ #include -namespace cocos2d { namespace extension { +namespace spine { typedef struct Bone Bone; struct Bone { @@ -54,6 +54,6 @@ void Bone_setToSetupPose (Bone* self); void Bone_updateWorldTransform (Bone* self, int/*bool*/flipX, int/*bool*/flipY); -}} // namespace cocos2d { namespace extension { +} // namespace spine { #endif /* SPINE_BONE_H_ */ diff --git a/cocos/editor-support/spine/BoneData.cpp b/cocos/editor-support/spine/BoneData.cpp index 09c356bb3d..5197d7f114 100644 --- a/cocos/editor-support/spine/BoneData.cpp +++ b/cocos/editor-support/spine/BoneData.cpp @@ -26,7 +26,7 @@ #include #include -namespace cocos2d { namespace extension { +namespace spine { BoneData* BoneData_create (const char* name, BoneData* parent) { BoneData* self = NEW(BoneData); @@ -42,4 +42,4 @@ void BoneData_dispose (BoneData* self) { FREE(self); } -}} // namespace cocos2d { namespace extension { \ No newline at end of file +} // namespace spine { \ No newline at end of file diff --git a/cocos/editor-support/spine/BoneData.h b/cocos/editor-support/spine/BoneData.h index 54126a700d..f2d63430fb 100644 --- a/cocos/editor-support/spine/BoneData.h +++ b/cocos/editor-support/spine/BoneData.h @@ -26,7 +26,7 @@ #ifndef SPINE_BONEDATA_H_ #define SPINE_BONEDATA_H_ -namespace cocos2d { namespace extension { +namespace spine { typedef struct BoneData BoneData; struct BoneData { @@ -41,6 +41,6 @@ struct BoneData { BoneData* BoneData_create (const char* name, BoneData* parent); void BoneData_dispose (BoneData* self); -}} // namespace cocos2d { namespace extension { +} // namespace spine { #endif /* SPINE_BONEDATA_H_ */ diff --git a/cocos/editor-support/spine/CCSkeleton.cpp b/cocos/editor-support/spine/CCSkeleton.cpp index 9b961fb4f5..760dd6702c 100644 --- a/cocos/editor-support/spine/CCSkeleton.cpp +++ b/cocos/editor-support/spine/CCSkeleton.cpp @@ -30,7 +30,7 @@ USING_NS_CC; using std::min; using std::max; -namespace cocos2d { namespace extension { +namespace spine { CCSkeleton* CCSkeleton::createWithData (SkeletonData* skeletonData, bool ownsSkeletonData) { CCSkeleton* node = new CCSkeleton(skeletonData, ownsSkeletonData); @@ -287,4 +287,4 @@ bool CCSkeleton::isOpacityModifyRGB () const { return premultipliedAlpha; } -}} // namespace cocos2d { namespace extension { +} // namespace spine { diff --git a/cocos/editor-support/spine/CCSkeleton.h b/cocos/editor-support/spine/CCSkeleton.h index 70e76a8e02..ede5f9ae21 100644 --- a/cocos/editor-support/spine/CCSkeleton.h +++ b/cocos/editor-support/spine/CCSkeleton.h @@ -27,9 +27,10 @@ #define SPINE_CCSKELETON_H_ #include + #include "RegionAttachment.h" #include "cocos2d.h" -namespace cocos2d { namespace extension { +namespace spine { /** Draws a skeleton. @@ -107,6 +108,6 @@ private: void initialize (); }; -}} // namespace cocos2d { namespace extension { +} // namespace spine { #endif /* SPINE_CCSKELETON_H_ */ diff --git a/cocos/editor-support/spine/CCSkeletonAnimation.cpp b/cocos/editor-support/spine/CCSkeletonAnimation.cpp index ad789fd5fc..8cf2a75e9a 100644 --- a/cocos/editor-support/spine/CCSkeletonAnimation.cpp +++ b/cocos/editor-support/spine/CCSkeletonAnimation.cpp @@ -32,7 +32,7 @@ using std::min; using std::max; using std::vector; -namespace cocos2d { namespace extension { +namespace spine { CCSkeletonAnimation* CCSkeletonAnimation::createWithData (SkeletonData* skeletonData) { CCSkeletonAnimation* node = new CCSkeletonAnimation(skeletonData); @@ -139,4 +139,4 @@ void CCSkeletonAnimation::clearAnimation (int stateIndex) { AnimationState_clearAnimation(states[stateIndex]); } -}} // namespace cocos2d { namespace extension { \ No newline at end of file +} // namespace spine { \ No newline at end of file diff --git a/cocos/editor-support/spine/CCSkeletonAnimation.h b/cocos/editor-support/spine/CCSkeletonAnimation.h index 82b9feece2..4fdbd6f8a7 100644 --- a/cocos/editor-support/spine/CCSkeletonAnimation.h +++ b/cocos/editor-support/spine/CCSkeletonAnimation.h @@ -30,7 +30,7 @@ #include #include "cocos2d.h" -namespace cocos2d { namespace extension { +namespace spine { /** Draws an animated skeleton, providing a simple API for applying one or more animations and queuing animations to be played later. @@ -79,6 +79,6 @@ private: void initialize (); }; -}} // namespace cocos2d { namespace extension { +} // namespace spine { #endif /* SPINE_CCSKELETONANIMATION_H_ */ diff --git a/cocos/editor-support/spine/Json.cpp b/cocos/editor-support/spine/Json.cpp index 656b8e52bb..d94c74ffe9 100644 --- a/cocos/editor-support/spine/Json.cpp +++ b/cocos/editor-support/spine/Json.cpp @@ -29,7 +29,7 @@ #include #include -namespace cocos2d { namespace extension { +namespace spine { static const char* ep; @@ -372,4 +372,4 @@ int Json_getInt (Json* value, const char* name, int defaultValue) { return value ? (int)value->valuefloat : defaultValue; } -}} // namespace cocos2d { namespace extension { \ No newline at end of file +} // namespace spine { \ No newline at end of file diff --git a/cocos/editor-support/spine/Json.h b/cocos/editor-support/spine/Json.h index 35cccd6655..fef6afb552 100644 --- a/cocos/editor-support/spine/Json.h +++ b/cocos/editor-support/spine/Json.h @@ -25,7 +25,7 @@ #ifndef SPINE_JSON_H_ #define SPINE_JSON_H_ -namespace cocos2d { namespace extension { +namespace spine { /* Json Types: */ #define Json_False 0 @@ -72,6 +72,6 @@ int Json_getInt (Json* json, const char* name, int defaultValue); /* For analysing failed parses. This returns a pointer to the parse error. You'll probably need to look a few chars back to make sense of it. Defined when Json_create() returns 0. 0 when Json_create() succeeds. */ const char* Json_getError (void); -}} // namespace cocos2d { namespace extension { +} // namespace spine { #endif /* SPINE_JSON_H_ */ diff --git a/cocos/editor-support/spine/RegionAttachment.cpp b/cocos/editor-support/spine/RegionAttachment.cpp index 585df7af8f..c4c07d9832 100644 --- a/cocos/editor-support/spine/RegionAttachment.cpp +++ b/cocos/editor-support/spine/RegionAttachment.cpp @@ -27,7 +27,7 @@ #include #include -namespace cocos2d { namespace extension { +namespace spine { RegionAttachment* RegionAttachment_create (const char* name) { RegionAttachment* self = NEW(RegionAttachment); @@ -106,4 +106,4 @@ void RegionAttachment_computeVertices (RegionAttachment* self, float x, float y, vertices[VERTEX_Y4] = offset[VERTEX_X4] * bone->m10 + offset[VERTEX_Y4] * bone->m11 + y; } -}} // namespace cocos2d { namespace extension { \ No newline at end of file +} // namespace spine { \ No newline at end of file diff --git a/cocos/editor-support/spine/RegionAttachment.h b/cocos/editor-support/spine/RegionAttachment.h index 8374c812b2..03dd5c7c7f 100644 --- a/cocos/editor-support/spine/RegionAttachment.h +++ b/cocos/editor-support/spine/RegionAttachment.h @@ -30,7 +30,7 @@ #include #include -namespace cocos2d { namespace extension { +namespace spine { typedef enum { VERTEX_X1 = 0, VERTEX_Y1, VERTEX_X2, VERTEX_Y2, VERTEX_X3, VERTEX_Y3, VERTEX_X4, VERTEX_Y4 @@ -55,6 +55,6 @@ void RegionAttachment_setUVs (RegionAttachment* self, float u, float v, float u2 void RegionAttachment_updateOffset (RegionAttachment* self); void RegionAttachment_computeVertices (RegionAttachment* self, float x, float y, Bone* bone, float* vertices); -}} // namespace cocos2d { namespace extension { +} // namespace spine { #endif /* SPINE_REGIONATTACHMENT_H_ */ diff --git a/cocos/editor-support/spine/Skeleton.cpp b/cocos/editor-support/spine/Skeleton.cpp index 033e46bf02..145487f710 100644 --- a/cocos/editor-support/spine/Skeleton.cpp +++ b/cocos/editor-support/spine/Skeleton.cpp @@ -27,7 +27,7 @@ #include #include -namespace cocos2d { namespace extension { +namespace spine { Skeleton* Skeleton_create (SkeletonData* data) { int i, ii; @@ -199,4 +199,4 @@ void Skeleton_update (Skeleton* self, float deltaTime) { self->time += deltaTime; } -}} // namespace cocos2d { namespace extension { \ No newline at end of file +} // namespace spine { \ No newline at end of file diff --git a/cocos/editor-support/spine/Skeleton.h b/cocos/editor-support/spine/Skeleton.h index 54fa5aa0d4..61b1814c99 100644 --- a/cocos/editor-support/spine/Skeleton.h +++ b/cocos/editor-support/spine/Skeleton.h @@ -30,7 +30,7 @@ #include #include -namespace cocos2d { namespace extension { +namespace spine { typedef struct Skeleton Skeleton; struct Skeleton { @@ -87,6 +87,6 @@ int Skeleton_setAttachment (Skeleton* self, const char* slotName, const char* at void Skeleton_update (Skeleton* self, float deltaTime); -}} // namespace cocos2d { namespace extension { +} // namespace spine { #endif /* SPINE_SKELETON_H_*/ diff --git a/cocos/editor-support/spine/SkeletonData.cpp b/cocos/editor-support/spine/SkeletonData.cpp index 9f781dc4f2..c891494c72 100644 --- a/cocos/editor-support/spine/SkeletonData.cpp +++ b/cocos/editor-support/spine/SkeletonData.cpp @@ -27,7 +27,7 @@ #include #include -namespace cocos2d { namespace extension { +namespace spine { SkeletonData* SkeletonData_create () { return NEW(SkeletonData); @@ -96,4 +96,4 @@ Animation* SkeletonData_findAnimation (const SkeletonData* self, const char* ani return 0; } -}} // namespace cocos2d { namespace extension { \ No newline at end of file +} // namespace spine { \ No newline at end of file diff --git a/cocos/editor-support/spine/SkeletonData.h b/cocos/editor-support/spine/SkeletonData.h index b05bc4574a..1b97de972b 100644 --- a/cocos/editor-support/spine/SkeletonData.h +++ b/cocos/editor-support/spine/SkeletonData.h @@ -31,7 +31,7 @@ #include #include -namespace cocos2d { namespace extension { +namespace spine { typedef struct { int boneCount; @@ -61,6 +61,6 @@ Skin* SkeletonData_findSkin (const SkeletonData* self, const char* skinName); Animation* SkeletonData_findAnimation (const SkeletonData* self, const char* animationName); -}} // namespace cocos2d { namespace extension { +} // namespace spine { #endif /* SPINE_SKELETONDATA_H_ */ diff --git a/cocos/editor-support/spine/SkeletonJson.cpp b/cocos/editor-support/spine/SkeletonJson.cpp index 35a0daa787..98e4be4334 100644 --- a/cocos/editor-support/spine/SkeletonJson.cpp +++ b/cocos/editor-support/spine/SkeletonJson.cpp @@ -32,7 +32,7 @@ #include #include -namespace cocos2d { namespace extension { +namespace spine { typedef struct { SkeletonJson super; @@ -414,4 +414,4 @@ SkeletonData* SkeletonJson_readSkeletonData (SkeletonJson* self, const char* jso return skeletonData; } -}} // namespace cocos2d { namespace extension { \ No newline at end of file +} // namespace spine { \ No newline at end of file diff --git a/cocos/editor-support/spine/SkeletonJson.h b/cocos/editor-support/spine/SkeletonJson.h index 1fd9b2875a..235a09b1af 100644 --- a/cocos/editor-support/spine/SkeletonJson.h +++ b/cocos/editor-support/spine/SkeletonJson.h @@ -32,7 +32,7 @@ #include #include -namespace cocos2d { namespace extension { +namespace spine { typedef struct { float scale; @@ -47,6 +47,6 @@ void SkeletonJson_dispose (SkeletonJson* self); SkeletonData* SkeletonJson_readSkeletonData (SkeletonJson* self, const char* json); SkeletonData* SkeletonJson_readSkeletonDataFile (SkeletonJson* self, const char* path); -}} // namespace cocos2d { namespace extension { +} // namespace spine { #endif /* SPINE_SKELETONJSON_H_ */ diff --git a/cocos/editor-support/spine/Skin.cpp b/cocos/editor-support/spine/Skin.cpp index d689c472ab..cd8b736d4f 100644 --- a/cocos/editor-support/spine/Skin.cpp +++ b/cocos/editor-support/spine/Skin.cpp @@ -26,7 +26,7 @@ #include #include -namespace cocos2d { namespace extension { +namespace spine { typedef struct _Entry _Entry; struct _Entry { @@ -115,4 +115,4 @@ void Skin_attachAll (const Skin* self, Skeleton* skeleton, const Skin* oldSkin) } } -}} // namespace cocos2d { namespace extension { \ No newline at end of file +} // namespace spine { \ No newline at end of file diff --git a/cocos/editor-support/spine/Skin.h b/cocos/editor-support/spine/Skin.h index f8d76a56f8..4dba09e524 100644 --- a/cocos/editor-support/spine/Skin.h +++ b/cocos/editor-support/spine/Skin.h @@ -28,7 +28,7 @@ #include -namespace cocos2d { namespace extension { +namespace spine { struct Skeleton; @@ -50,6 +50,6 @@ const char* Skin_getAttachmentName (const Skin* self, int slotIndex, int attachm /** Attach each attachment in this skin if the corresponding attachment in oldSkin is currently attached. */ void Skin_attachAll (const Skin* self, struct Skeleton* skeleton, const Skin* oldSkin); -}} // namespace cocos2d { namespace extension { +} // namespace spine { #endif /* SPINE_SKIN_H_ */ diff --git a/cocos/editor-support/spine/Slot.cpp b/cocos/editor-support/spine/Slot.cpp index a17fdc1d78..47ed9d3f61 100644 --- a/cocos/editor-support/spine/Slot.cpp +++ b/cocos/editor-support/spine/Slot.cpp @@ -27,7 +27,7 @@ #include #include -namespace cocos2d { namespace extension { +namespace spine { typedef struct { Slot super; @@ -80,4 +80,4 @@ void Slot_setToSetupPose (Slot* self) { Slot_setAttachment(self, attachment); } -}} // namespace cocos2d { namespace extension { \ No newline at end of file +} // namespace spine { \ No newline at end of file diff --git a/cocos/editor-support/spine/Slot.h b/cocos/editor-support/spine/Slot.h index 47b2a7f05d..44f2f48694 100644 --- a/cocos/editor-support/spine/Slot.h +++ b/cocos/editor-support/spine/Slot.h @@ -30,7 +30,7 @@ #include #include -namespace cocos2d { namespace extension { +namespace spine { struct Skeleton; @@ -53,6 +53,6 @@ float Slot_getAttachmentTime (const Slot* self); void Slot_setToSetupPose (Slot* self); -}} // namespace cocos2d { namespace extension { +} // namespace spine { #endif /* SPINE_SLOT_H_ */ diff --git a/cocos/editor-support/spine/SlotData.cpp b/cocos/editor-support/spine/SlotData.cpp index 5f1478e6d2..fe0609edfe 100644 --- a/cocos/editor-support/spine/SlotData.cpp +++ b/cocos/editor-support/spine/SlotData.cpp @@ -26,7 +26,7 @@ #include #include -namespace cocos2d { namespace extension { +namespace spine { SlotData* SlotData_create (const char* name, BoneData* boneData) { SlotData* self = NEW(SlotData); @@ -53,4 +53,4 @@ void SlotData_setAttachmentName (SlotData* self, const char* attachmentName) { CONST_CAST(char*, self->attachmentName) = 0; } -}} // namespace cocos2d { namespace extension { \ No newline at end of file +} // namespace spine { \ No newline at end of file diff --git a/cocos/editor-support/spine/SlotData.h b/cocos/editor-support/spine/SlotData.h index 660c30695c..b49efb86c9 100644 --- a/cocos/editor-support/spine/SlotData.h +++ b/cocos/editor-support/spine/SlotData.h @@ -28,7 +28,7 @@ #include -namespace cocos2d { namespace extension { +namespace spine { typedef struct { const char* const name; @@ -43,6 +43,6 @@ void SlotData_dispose (SlotData* self); /* @param attachmentName May be 0 for no setup pose attachment. */ void SlotData_setAttachmentName (SlotData* self, const char* attachmentName); -}} // namespace cocos2d { namespace extension { +} // namespace spine { #endif /* SPINE_SLOTDATA_H_ */ diff --git a/cocos/editor-support/spine/extension.cpp b/cocos/editor-support/spine/extension.cpp index dfdda7a96e..3fa34170b9 100644 --- a/cocos/editor-support/spine/extension.cpp +++ b/cocos/editor-support/spine/extension.cpp @@ -26,7 +26,7 @@ #include #include -namespace cocos2d { namespace extension { +namespace spine { static void* (*mallocFunc) (size_t size) = malloc; static void (*freeFunc) (void* ptr) = free; @@ -71,4 +71,4 @@ char* _readFile (const char* path, int* length) { return data; } -}} // namespace cocos2d { namespace extension { +} // namespace spine { diff --git a/cocos/editor-support/spine/extension.h b/cocos/editor-support/spine/extension.h index 37ae496e4b..019b7350d7 100644 --- a/cocos/editor-support/spine/extension.h +++ b/cocos/editor-support/spine/extension.h @@ -88,7 +88,7 @@ #include #include -namespace cocos2d { namespace extension { +namespace spine { /* * Functions that must be implemented: @@ -140,6 +140,6 @@ void _CurveTimeline_init (CurveTimeline* self, int frameCount, /**/ void (*apply) (const Timeline* self, Skeleton* skeleton, float time, float alpha)); void _CurveTimeline_deinit (CurveTimeline* self); -}} // namespace cocos2d { namespace extension { +} // namespace spine { #endif /* SPINE_EXTENSION_H_ */ diff --git a/cocos/editor-support/spine/spine-cocos2dx.cpp b/cocos/editor-support/spine/spine-cocos2dx.cpp index 74421b4390..cd9ea67e30 100644 --- a/cocos/editor-support/spine/spine-cocos2dx.cpp +++ b/cocos/editor-support/spine/spine-cocos2dx.cpp @@ -28,7 +28,7 @@ USING_NS_CC; -namespace cocos2d { namespace extension { +namespace spine { void _AtlasPage_createTexture (AtlasPage* self, const char* path) { Texture2D* texture = TextureCache::getInstance()->addImage(path); @@ -106,4 +106,4 @@ void RegionAttachment_updateQuad (RegionAttachment* self, Slot* slot, V3F_C4B_T2 quad->br.texCoords.v = self->uvs[VERTEX_Y4]; } -}} // namespace cocos2d { namespace extension { \ No newline at end of file +} // namespace spine { \ No newline at end of file diff --git a/cocos/editor-support/spine/spine-cocos2dx.h b/cocos/editor-support/spine/spine-cocos2dx.h index 234af2ecf1..d7d87b2bcc 100644 --- a/cocos/editor-support/spine/spine-cocos2dx.h +++ b/cocos/editor-support/spine/spine-cocos2dx.h @@ -31,10 +31,10 @@ #include #include -namespace cocos2d { namespace extension { +namespace spine { void RegionAttachment_updateQuad (RegionAttachment* self, Slot* slot, cocos2d::V3F_C4B_T2F_Quad* quad, bool premultiplied = false); -}} // namespace cocos2d { namespace extension { +} // namespace spine { #endif /* SPINE_COCOS2DX_H_ */ diff --git a/cocos/gui/Android.mk b/cocos/gui/Android.mk new file mode 100644 index 0000000000..b34d108585 --- /dev/null +++ b/cocos/gui/Android.mk @@ -0,0 +1,50 @@ +LOCAL_PATH := $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_MODULE := gui_static + +LOCAL_MODULE_FILENAME := libgui + +LOCAL_SRC_FILES := base-classes/UIRootWidget.cpp \ +base-classes/UIWidget.cpp \ +layouts/Layout.cpp \ +layouts/LayoutParameter.cpp \ +layouts/UILayoutDefine.cpp \ +system/CocosGUI.cpp \ +system/UIHelper.cpp \ +system/UIInputManager.cpp \ +system/UILayer.cpp \ +widgets/scroll-widget/UIDragPanel.cpp \ +widgets/scroll-widget/UIListView.cpp \ +widgets/scroll-widget/UIPageView.cpp \ +widgets/scroll-widget/UIScrollView.cpp \ +widgets/UIButton.cpp \ +widgets/UICheckBox.cpp \ +widgets/UIImageView.cpp \ +widgets/UILabel.cpp \ +widgets/UILabelAtlas.cpp \ +widgets/UILabelBMFont.cpp \ +widgets/UILoadingBar.cpp \ +widgets/UISlider.cpp \ +widgets/UITextField.cpp + + +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) + +LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../2d \ +$(LOCAL_PATH) \ +$(LOCAL_PATH)/.. + +LOCAL_CFLAGS += -Wno-psabi +LOCAL_EXPORT_CFLAGS += -Wno-psabi + +LOCAL_WHOLE_STATIC_LIBRARIES := cocostudio_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocos2dx_static + +include $(BUILD_STATIC_LIBRARY) + + +$(call import-module,extensions) +$(call import-module,editor-support/cocostudio) +$(call import-module,2d) diff --git a/cocos/gui/base-classes/UIRootWidget.cpp b/cocos/gui/base-classes/UIRootWidget.cpp index bc34480328..8e87225f14 100644 --- a/cocos/gui/base-classes/UIRootWidget.cpp +++ b/cocos/gui/base-classes/UIRootWidget.cpp @@ -24,7 +24,9 @@ #include "UIRootWidget.h" -NS_CC_EXT_BEGIN + using namespace cocos2d; + +namespace gui { UIRootWidget::UIRootWidget() { @@ -61,4 +63,4 @@ const char* UIRootWidget::getDescription() const return "RootWidget"; } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/gui/base-classes/UIRootWidget.h b/cocos/gui/base-classes/UIRootWidget.h index c08a75f457..2a32c6c070 100644 --- a/cocos/gui/base-classes/UIRootWidget.h +++ b/cocos/gui/base-classes/UIRootWidget.h @@ -25,9 +25,9 @@ #ifndef __UIROOTWIDGET_H__ #define __UIROOTWIDGET_H__ -#include "../Layouts/Layout.h" +#include "layouts/Layout.h" -NS_CC_EXT_BEGIN +namespace gui { class UIRootWidget : public Layout { @@ -56,6 +56,6 @@ protected: virtual bool init(); }; -NS_CC_EXT_END +} #endif /* defined(__CocoGUI__RootWidget__) */ diff --git a/cocos/gui/base-classes/UIWidget.cpp b/cocos/gui/base-classes/UIWidget.cpp index e120e12186..f8462f239b 100644 --- a/cocos/gui/base-classes/UIWidget.cpp +++ b/cocos/gui/base-classes/UIWidget.cpp @@ -23,11 +23,13 @@ ****************************************************************************/ #include "UIWidget.h" -#include "../System/UILayer.h" -#include "../Layouts/Layout.h" -#include "../System/UIHelper.h" +#include "system/UILayer.h" +#include "layouts/Layout.h" +#include "system/UIHelper.h" -NS_CC_EXT_BEGIN + using namespace cocos2d; + +namespace gui { #define DYNAMIC_CAST_CCBLENDPROTOCOL dynamic_cast(_renderer) @@ -1215,4 +1217,4 @@ void GUIRenderer::visit() NodeRGBA::visit(); } -NS_CC_EXT_END +} diff --git a/cocos/gui/base-classes/UIWidget.h b/cocos/gui/base-classes/UIWidget.h index e0163645cd..d0a83fb286 100644 --- a/cocos/gui/base-classes/UIWidget.h +++ b/cocos/gui/base-classes/UIWidget.h @@ -26,10 +26,9 @@ #define __UIWIDGET_H__ #include "cocos2d.h" -#include "ExtensionMacros.h" -#include "../Layouts/UILayoutDefine.h" -#include "../Layouts/LayoutParameter.h" -NS_CC_EXT_BEGIN +#include "layouts/UILayoutDefine.h" +#include "layouts/LayoutParameter.h" +namespace gui { typedef enum @@ -71,14 +70,14 @@ typedef enum POSITION_PERCENT }PositionType; -typedef void (Object::*SEL_TouchEvent)(Object*,TouchEventType); -#define toucheventselector(_SELECTOR) (cocos2d::extension::SEL_TouchEvent)(&_SELECTOR) +typedef void (cocos2d::Object::*SEL_TouchEvent)(cocos2d::Object*,TouchEventType); +#define toucheventselector(_SELECTOR) (SEL_TouchEvent)(&_SELECTOR) //class UILayer; /*temp action*/ class UIActionNode; -class UIWidget : public Object +class UIWidget : public cocos2d::Object { public: /** @@ -300,7 +299,7 @@ public: * * @return An array of children */ - virtual Array* getChildren(); + virtual cocos2d::Array* getChildren(); /** * Gets the renderer of widget @@ -309,7 +308,7 @@ public: * * @return a CCNode object */ - Node* getRenderer(); + cocos2d::Node* getRenderer(); /** * Add a CCNode for rendering. @@ -320,7 +319,7 @@ public: * * @param zOrder Z order for drawing priority. Please refer to CCNode::setZOrder(int) */ - void addRenderer(Node* renderer, int zOrder); + void addRenderer(cocos2d::Node* renderer, int zOrder); /** * Remove a CCNode from widget. @@ -331,7 +330,7 @@ public: * * @param cleanup true if all running actions and callbacks on the render node will be cleanup, false otherwise. */ - void removeRenderer(Node* renderer, bool cleanup); + void removeRenderer(cocos2d::Node* renderer, bool cleanup); /** * Sets the parent widget @@ -352,7 +351,7 @@ public: /** * Sets the touch event target/selector of the menu item */ - void addTouchEventListener(Object* target,SEL_TouchEvent selector); + void addTouchEventListener(cocos2d::Object* target,SEL_TouchEvent selector); //cocos2d property @@ -365,7 +364,7 @@ public: * * @param position The position (x,y) of the widget in OpenGL coordinates */ - void setPosition(const Point &pos); + void setPosition(const cocos2d::Point &pos); /** * Changes the position (x,y) of the widget in OpenGL coordinates @@ -375,7 +374,7 @@ public: * * @param percent The percent (x,y) of the widget in OpenGL coordinates */ - void setPositionPercent(const Point &percent); + void setPositionPercent(const cocos2d::Point &percent); /** * Gets the position (x,y) of the widget in OpenGL coordinates @@ -384,7 +383,7 @@ public: * * @return The position (x,y) of the widget in OpenGL coordinates */ - const Point& getPosition(); + const cocos2d::Point& getPosition(); /** * Gets the percent (x,y) of the widget in OpenGL coordinates @@ -393,7 +392,7 @@ public: * * @return The percent (x,y) of the widget in OpenGL coordinates */ - const Point& getPositionPercent(); + const cocos2d::Point& getPositionPercent(); /** * Changes the position type of the widget @@ -424,7 +423,7 @@ public: * * @param anchorPoint The anchor point of widget. */ - virtual void setAnchorPoint(const Point &pt); + virtual void setAnchorPoint(const cocos2d::Point &pt); /** * Returns the anchor point in percent. @@ -433,7 +432,7 @@ public: * * @return The anchor point of widget. */ - const Point& getAnchorPoint(); + const cocos2d::Point& getAnchorPoint(); /** * Changes both X and Y scale factor of the widget. @@ -592,14 +591,14 @@ public: * * @param color */ - virtual void setColor(const Color3B &color); + virtual void setColor(const cocos2d::Color3B &color); /** * Gets color of widget * * @return color */ - virtual const Color3B& getColor(); + virtual const cocos2d::Color3B& getColor(); /** * Sets opacity to widget @@ -620,16 +619,16 @@ public: virtual void setCascadeOpacityEnabled(bool cascadeOpacityEnabled); virtual bool isCascadeColorEnabled(); virtual void setCascadeColorEnabled(bool cascadeColorEnabled); - void setBlendFunc(BlendFunc blendFunc); + void setBlendFunc(cocos2d::BlendFunc blendFunc); //cocos action - virtual void setActionManager(ActionManager* actionManager); - virtual ActionManager* getActionManager(); - Action* runAction(Action* action); + virtual void setActionManager(cocos2d::ActionManager* actionManager); + virtual cocos2d::ActionManager* getActionManager(); + cocos2d::Action* runAction(cocos2d::Action* action); void stopAllActions(void); - void stopAction(Action* action); + void stopAction(cocos2d::Action* action); void stopActionByTag(int tag); - Action* getActionByTag(int tag); + cocos2d::Action* getActionByTag(int tag); /** * A call back function when widget lost of focus. @@ -643,33 +642,33 @@ public: * * @return true if the point is in parent's area, flase otherwise. */ - bool clippingParentAreaContainPoint(const Point &pt); + bool clippingParentAreaContainPoint(const cocos2d::Point &pt); /* * Sends the touch event to widget's parent */ - virtual void checkChildInfo(int handleState,UIWidget* sender,const Point &touchPoint); + virtual void checkChildInfo(int handleState,UIWidget* sender,const cocos2d::Point &touchPoint); /* * Gets the touch began point of widget when widget is selected. * * @return the touch began point. */ - const Point& getTouchStartPos(); + const cocos2d::Point& getTouchStartPos(); /* * Gets the touch move point of widget when widget is selected. * * @return the touch move point. */ - const Point& getTouchMovePos(); + const cocos2d::Point& getTouchMovePos(); /* * Gets the touch end point of widget when widget is selected. * * @return the touch end point. */ - const Point& getTouchEndPos(); + const cocos2d::Point& getTouchEndPos(); /** * Changes the tag that is used to identify the widget easily. @@ -717,14 +716,14 @@ public: * * @param size that is widget's size */ - virtual void setSize(const Size &size); + virtual void setSize(const cocos2d::Size &size); /** * Changes the percent that is widget's percent size * * @param percent that is widget's percent size */ - virtual void setSizePercent(const Point &percent); + virtual void setSizePercent(const cocos2d::Point &percent); /** * Changes the size type of widget. @@ -749,14 +748,14 @@ public: * * @return size */ - const Size& getSize() const; + const cocos2d::Size& getSize() const; /** * Returns size percent of widget * * @return size percent */ - const Point& getSizePercent() const; + const cocos2d::Point& getSizePercent() const; /** * Checks a point if is in widget's space @@ -765,7 +764,7 @@ public: * * @return true if the point is in widget's space, flase otherwise. */ - virtual bool hitTest(const Point &pt); + virtual bool hitTest(const cocos2d::Point &pt); /** * A call back function called when widget is selected, and on touch began. @@ -774,35 +773,35 @@ public: * * @return true if the event should be pass to parent, flase otherwise. */ - virtual bool onTouchBegan(const Point &touchPoint); + virtual bool onTouchBegan(const cocos2d::Point &touchPoint); /** * A call back function called when widget is selected, and on touch moved. * * @param touch point */ - virtual void onTouchMoved(const Point &touchPoint); + virtual void onTouchMoved(const cocos2d::Point &touchPoint); /** * A call back function called when widget is selected, and on touch ended. * * @param touch point */ - virtual void onTouchEnded(const Point &touchPoint); + virtual void onTouchEnded(const cocos2d::Point &touchPoint); /** * A call back function called when widget is selected, and on touch canceled. * * @param touch point */ - virtual void onTouchCancelled(const Point &touchPoint); + virtual void onTouchCancelled(const cocos2d::Point &touchPoint); /** * A call back function called when widget is selected, and on touch long clicked. * * @param touch point */ - virtual void onTouchLongClicked(const Point &touchPoint); + virtual void onTouchLongClicked(const cocos2d::Point &touchPoint); /** * Sets a LayoutParameter to widget. @@ -839,12 +838,12 @@ public: * * @return world position of widget. */ - Point getWorldPosition(); + cocos2d::Point getWorldPosition(); /** * Converts a Point to world space coordinates. The result is in Points. */ - Point convertToWorldSpace(const Point& pt); + cocos2d::Point convertToWorldSpace(const cocos2d::Point& pt); /** * Gets the Virtual Renderer of widget. @@ -853,7 +852,7 @@ public: * * @return CCNode pointer. */ - virtual Node* getVirtualRenderer(); + virtual cocos2d::Node* getVirtualRenderer(); /** * Schedules the "update" method. @@ -870,7 +869,7 @@ public: * * Content size is widget's texture size. */ - virtual const Size& getContentSize() const; + virtual const cocos2d::Size& getContentSize() const; virtual void onEnter(); virtual void onExit(); @@ -922,16 +921,16 @@ protected: bool _touchPassedEnabled; ///< is the touch event should be passed bool _focus; ///< is the widget on focus int _widgetZOrder; ///< z-order value that affects the draw order and touch order - Point _anchorPoint; ///< anchor point normalized + cocos2d::Point _anchorPoint; ///< anchor point normalized UIWidget* _widgetParent; ///< parent of widget BrightStyle _brightStyle; ///< bright style bool _updateEnabled; ///< is "update" method scheduled - Node* _renderer; ///< base renderer - Point _touchStartPos; ///< touch began point - Point _touchMovePos; ///< touch moved point - Point _touchEndPos; ///< touch ended point + cocos2d::Node* _renderer; ///< base renderer + cocos2d::Point _touchStartPos; ///< touch began point + cocos2d::Point _touchMovePos; ///< touch moved point + cocos2d::Point _touchEndPos; ///< touch ended point - Object* _touchEventListener; + cocos2d::Object* _touchEventListener; SEL_TouchEvent _touchEventSelector; @@ -940,23 +939,23 @@ protected: std::string _name; WidgetType _widgetType; int _actionTag; - Size _size; - Size _customSize; + cocos2d::Size _size; + cocos2d::Size _customSize; LayoutParameter* _layoutParameter; bool _ignoreSize; - Array* _children; + cocos2d::Array* _children; bool _affectByClipping; - Scheduler* _scheduler; + cocos2d::Scheduler* _scheduler; SizeType _sizeType; - Point _sizePercent; + cocos2d::Point _sizePercent; PositionType _positionType; - Point _positionPercent; + cocos2d::Point _positionPercent; bool _isRunning; }; -class GUIRenderer : public NodeRGBA +class GUIRenderer : public cocos2d::NodeRGBA { public: GUIRenderer(); @@ -969,6 +968,6 @@ protected: bool _enabled; }; -NS_CC_EXT_END +} #endif /* defined(__UIWidget__) */ diff --git a/cocos/gui/layouts/Layout.cpp b/cocos/gui/layouts/Layout.cpp index 3492de9486..6403262bd9 100644 --- a/cocos/gui/layouts/Layout.cpp +++ b/cocos/gui/layouts/Layout.cpp @@ -22,12 +22,15 @@ THE SOFTWARE. ****************************************************************************/ -#include "Layout.h" -#include "../System/UILayer.h" -#include "../System/UIHelper.h" -#include "../../../GUI/CCControlExtension/CCScale9Sprite.h" +#include "layout.h" +#include "system/UILayer.h" +#include "system/UIHelper.h" +#include "GUI/CCControlExtension/CCScale9Sprite.h" -NS_CC_EXT_BEGIN + using namespace cocos2d; + using namespace cocos2d::extension; + +namespace gui { #define DYNAMIC_CAST_CLIPPINGLAYER dynamic_cast(_renderer) @@ -779,4 +782,4 @@ bool RectClippingNode::isEnabled() const return _enabled; } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/gui/layouts/Layout.h b/cocos/gui/layouts/Layout.h index bf8719a06d..c448036642 100644 --- a/cocos/gui/layouts/Layout.h +++ b/cocos/gui/layouts/Layout.h @@ -25,9 +25,9 @@ #ifndef __LAYOUT_H__ #define __LAYOUT_H__ -#include "../BaseClasses/UIWidget.h" +#include "base-classes/UIWidget.h" -NS_CC_EXT_BEGIN +namespace gui { typedef enum { @@ -63,7 +63,7 @@ public: static Layout* create(); //override "hitTest" method of widget. - virtual bool hitTest(const Point &pt); + virtual bool hitTest(const cocos2d::Point &pt); //background /** @@ -81,7 +81,7 @@ public: * @param capinsets of background image. * */ - void setBackGroundImageCapInsets(const Rect& capInsets); + void setBackGroundImageCapInsets(const cocos2d::Rect& capInsets); /** * Sets Color Type for layout. @@ -102,7 +102,7 @@ public: * * @param color */ - void setBackGroundColor(const Color3B &color); + void setBackGroundColor(const cocos2d::Color3B &color); /** * Sets background color for layout, if color type is LAYOUT_COLOR_GRADIENT @@ -111,7 +111,7 @@ public: * * @param end color */ - void setBackGroundColor(const Color3B &startColor, const Color3B &endColor); + void setBackGroundColor(const cocos2d::Color3B &startColor, const cocos2d::Color3B &endColor); /** * Sets background opacity layout. @@ -125,10 +125,10 @@ public: * * @param vector */ - void setBackGroundColorVector(const Point &vector); + void setBackGroundColorVector(const cocos2d::Point &vector); //override "setColor" method of widget. - virtual void setColor(const Color3B &color); + virtual void setColor(const cocos2d::Color3B &color); //override "setOpacity" method of widget. virtual void setOpacity(int opacity); @@ -143,7 +143,7 @@ public: * * @return background image texture size. */ - const Size& getBackGroundImageTextureSize() const; + const cocos2d::Size& getBackGroundImageTextureSize() const; /** * Changes if layout can clip it's content and child. @@ -166,7 +166,7 @@ public: * * Content size is widget's texture size. */ - virtual const Size& getContentSize() const; + virtual const cocos2d::Size& getContentSize() const; /** * Sets LayoutType. @@ -209,43 +209,43 @@ protected: //background bool _backGroundScale9Enabled; - Node* _backGroundImage; + cocos2d::Node* _backGroundImage; std::string _backGroundImageFileName; - Rect _backGroundImageCapInsets; + cocos2d::Rect _backGroundImageCapInsets; LayoutBackGroundColorType _colorType; TextureResType _bgImageTexType; - LayerColor* _colorRender; - LayerGradient* _gradientRender; - Color3B _cColor; - Color3B _gStartColor; - Color3B _gEndColor; - Point _alongVector; + cocos2d::LayerColor* _colorRender; + cocos2d::LayerGradient* _gradientRender; + cocos2d::Color3B _cColor; + cocos2d::Color3B _gStartColor; + cocos2d::Color3B _gEndColor; + cocos2d::Point _alongVector; int _cOpacity; - Size _backGroundImageTextureSize; + cocos2d::Size _backGroundImageTextureSize; LayoutType _layoutType; }; -class RectClippingNode : public ClippingNode +class RectClippingNode : public cocos2d::ClippingNode { public: virtual ~RectClippingNode(); virtual bool init(); static RectClippingNode* create(); - void setClippingSize(const Size& size); + void setClippingSize(const cocos2d::Size& size); void setClippingEnabled(bool enabled); virtual void visit(); void setEnabled(bool enabled); bool isEnabled() const; protected: - DrawNode* m_pInnerStencil; + cocos2d::DrawNode* m_pInnerStencil; bool _enabled; private: RectClippingNode(); - Point rect[4]; - Size _clippingSize; + cocos2d::Point rect[4]; + cocos2d::Size _clippingSize; bool _clippingEnabled; }; -NS_CC_EXT_END +} #endif /* defined(__Layout__) */ diff --git a/cocos/gui/layouts/LayoutParameter.cpp b/cocos/gui/layouts/LayoutParameter.cpp index 209979cdb9..d8cf87085a 100644 --- a/cocos/gui/layouts/LayoutParameter.cpp +++ b/cocos/gui/layouts/LayoutParameter.cpp @@ -25,7 +25,7 @@ #include "LayoutParameter.h" #include "Layout.h" -NS_CC_EXT_BEGIN +namespace gui { LayoutParameter* LayoutParameter::create() { @@ -118,4 +118,4 @@ const char* RelativeLayoutParameter::getRelativeName() const return _relativeLayoutName.c_str(); } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/gui/layouts/LayoutParameter.h b/cocos/gui/layouts/LayoutParameter.h index 50d55c6586..f1e5433be6 100644 --- a/cocos/gui/layouts/LayoutParameter.h +++ b/cocos/gui/layouts/LayoutParameter.h @@ -27,7 +27,7 @@ #include "UILayoutDefine.h" -NS_CC_EXT_BEGIN +namespace gui { typedef enum { @@ -36,7 +36,7 @@ typedef enum LAYOUT_PARAMETER_RELATIVE }LayoutParameterType; -class LayoutParameter : public Object +class LayoutParameter : public cocos2d::Object { public: /** @@ -196,6 +196,6 @@ protected: std::string _relativeLayoutName; }; -NS_CC_EXT_END +} #endif /* defined(__LayoutParameter__) */ diff --git a/cocos/gui/layouts/UILayoutDefine.cpp b/cocos/gui/layouts/UILayoutDefine.cpp index 54b8451c78..b6b785a47d 100644 --- a/cocos/gui/layouts/UILayoutDefine.cpp +++ b/cocos/gui/layouts/UILayoutDefine.cpp @@ -23,7 +23,7 @@ ****************************************************************************/ #include "UILayoutDefine.h" -NS_CC_EXT_BEGIN +namespace gui { UIMargin::UIMargin(void) : left(0), top(0), right(0), bottom(0) @@ -57,4 +57,4 @@ bool UIMargin::equals(const UIMargin &target) const return (left == target.left && top == target.top && right == target.right && bottom == target.bottom); } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/gui/layouts/UILayoutDefine.h b/cocos/gui/layouts/UILayoutDefine.h index ac2df8ca65..1d0bd716bf 100644 --- a/cocos/gui/layouts/UILayoutDefine.h +++ b/cocos/gui/layouts/UILayoutDefine.h @@ -26,9 +26,8 @@ #define __UILAYOUTDEFINE_H__ #include "cocos2d.h" -#include "ExtensionMacros.h" -NS_CC_EXT_BEGIN +namespace gui { class UIMargin { @@ -83,6 +82,6 @@ typedef enum RELATIVE_LOCATION_BELOW_RIGHTALIGN }UIRelativeAlign; -NS_CC_EXT_END +} #endif /* defined(__UILayoutDefine__) */ diff --git a/cocos/gui/system/CocosGUI.cpp b/cocos/gui/system/CocosGUI.cpp index 2a0ebe9ebd..783041a335 100644 --- a/cocos/gui/system/CocosGUI.cpp +++ b/cocos/gui/system/CocosGUI.cpp @@ -24,11 +24,11 @@ #include "CocosGUI.h" -NS_CC_EXT_BEGIN +namespace gui { const char* CocosGUIVersion() { return "CocosGUI v1.0.0.0"; } -NS_CC_EXT_END +} diff --git a/cocos/gui/system/CocosGUI.h b/cocos/gui/system/CocosGUI.h index ca080ea059..97046adde2 100644 --- a/cocos/gui/system/CocosGUI.h +++ b/cocos/gui/system/CocosGUI.h @@ -26,29 +26,29 @@ #define __COCOSGUI_H__ -#include "../BaseClasses/UIWidget.h" -#include "../Layouts/Layout.h" -#include "../BaseClasses/UIRootWidget.h" -#include "../UIWidgets/UIButton.h" -#include "../UIWidgets/UICheckBox.h" -#include "../UIWidgets/UIImageView.h" -#include "../UIWidgets/UILabel.h" -#include "../UIWidgets/UILabelAtlas.h" -#include "../UIWidgets/UILoadingBar.h" -#include "../UIWidgets/ScrollWidget/UIScrollView.h" -#include "../UIWidgets/UISlider.h" -#include "../UIWidgets/UITextField.h" -#include "../UIWidgets/ScrollWidget/UIListView.h" -#include "../UIWidgets/ScrollWidget/UIDragPanel.h" -#include "../UIWidgets/UILabelBMFont.h" -#include "../UIWidgets/ScrollWidget/UIPageView.h" +#include "base-classes/UIWidget.h" +#include "layouts/Layout.h" +#include "base-classes/UIRootWidget.h" +#include "widgets/UIButton.h" +#include "widgets/UICheckBox.h" +#include "widgets/UIImageView.h" +#include "widgets/UILabel.h" +#include "widgets/UILabelAtlas.h" +#include "widgets/UILoadingBar.h" +#include "widgets/scroll-widget/UIScrollView.h" +#include "widgets/UISlider.h" +#include "widgets/UITextField.h" +#include "widgets/scroll-widget/UIListView.h" +#include "widgets/scroll-widget/UIDragPanel.h" +#include "widgets/UILabelBMFont.h" +#include "widgets/scroll-widget/UIPageView.h" #include "UIHelper.h" -#include "../../Reader/CCSGUIReader.h" +#include "reader/CCSGUIReader.h" #include "UILayer.h" -NS_CC_EXT_BEGIN +namespace gui { const char* CocosGUIVersion(); -NS_CC_EXT_END +} #endif /* defined(__CocosGUITest__Cocos__) */ diff --git a/cocos/gui/system/UIHelper.cpp b/cocos/gui/system/UIHelper.cpp index 188147e480..c023bf23bf 100644 --- a/cocos/gui/system/UIHelper.cpp +++ b/cocos/gui/system/UIHelper.cpp @@ -23,12 +23,14 @@ ****************************************************************************/ #include "UIHelper.h" -#include "../../Json/DictionaryHelper.h" +#include "json/DictionaryHelper.h" #include "cocos2d.h" -#include "../../Reader/CCSGUIReader.h" +#include "reader/CCSGUIReader.h" +using namespace cocos2d; +using namespace cocostudio; -NS_CC_EXT_BEGIN +namespace gui { static UIHelper* helperInstance = NULL; @@ -59,7 +61,7 @@ _fileDesignWidth(0.0f) UIHelper::~UIHelper() { - cocos2d::extension::CCSGUIReader::purgeCCSGUIReader(); + cocostudio::CCSGUIReader::purgeCCSGUIReader(); } void UIHelper::init() @@ -238,4 +240,4 @@ UIWidget* UIHelper::seekActionWidgetByActionTag(UIWidget* root, int tag) return NULL; } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/gui/system/UIHelper.h b/cocos/gui/system/UIHelper.h index 5446271b9b..15487fbf60 100644 --- a/cocos/gui/system/UIHelper.h +++ b/cocos/gui/system/UIHelper.h @@ -26,12 +26,12 @@ #define __UIHELPER_H__ #include "UIInputManager.h" -#include "../../Json/CSContentJsonDictionary.h" +#include "json/CSContentJsonDictionary.h" -#define CCUIHELPER cocos2d::extension::UIHelper::instance() +#define CCUIHELPER gui::UIHelper::instance() -NS_CC_EXT_BEGIN +namespace gui { class UIHelper { @@ -116,9 +116,9 @@ protected: float _fileDesignWidth; float _fileDesignHeight; //texture - Array* _textureFiles; + cocos2d::Array* _textureFiles; }; -NS_CC_EXT_END +} #endif /* defined(__CocoGUI__UISystem__) */ diff --git a/cocos/gui/system/UIInputManager.cpp b/cocos/gui/system/UIInputManager.cpp index 21371d481a..4972f6da4b 100644 --- a/cocos/gui/system/UIInputManager.cpp +++ b/cocos/gui/system/UIInputManager.cpp @@ -25,7 +25,9 @@ #include "UIInputManager.h" #include "UIHelper.h" -NS_CC_EXT_BEGIN + using namespace cocos2d; + +namespace gui { UIInputManager::UIInputManager(): _manageredWidget(NULL), @@ -205,4 +207,4 @@ UIWidget* UIInputManager::getRootWidget() return _rootWidget; } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/gui/system/UIInputManager.h b/cocos/gui/system/UIInputManager.h index d0a178ae82..36f5f780df 100644 --- a/cocos/gui/system/UIInputManager.h +++ b/cocos/gui/system/UIInputManager.h @@ -26,9 +26,9 @@ #define __UIINPUTMANAGER_H__ #include "cocos2d.h" -#include "../Layouts/Layout.h" +#include "layouts/Layout.h" -NS_CC_EXT_BEGIN +namespace gui { class UIInputManager { @@ -64,34 +64,34 @@ public: * * @return true that find a widget selected, false otherwise. */ - bool checkEventWidget(const Point &touchPoint); + bool checkEventWidget(const cocos2d::Point &touchPoint); void update(float dt); - bool onTouchBegan(Touch* touch); - void onTouchMoved(Touch* touch); - void onTouchEnd(Touch* touch); - void onTouchCancelled(Touch* touch); + bool onTouchBegan(cocos2d::Touch* touch); + void onTouchMoved(cocos2d::Touch* touch); + void onTouchEnd(cocos2d::Touch* touch); + void onTouchCancelled(cocos2d::Touch* touch); void setRootWidget(UIWidget* root); UIWidget* getRootWidget(); void addCheckedDoubleClickWidget(UIWidget* widget); protected: - bool checkTouchEvent(UIWidget* root, const Point& touchPoint); + bool checkTouchEvent(UIWidget* root, const cocos2d::Point& touchPoint); protected: - Array* _manageredWidget; - Array* _selectedWidgets; - Point _touchBeganedPoint; - Point _touchMovedPoint; - Point _touchEndedPoint; - Point _touchCanceledPoint; + cocos2d::Array* _manageredWidget; + cocos2d::Array* _selectedWidgets; + cocos2d::Point _touchBeganedPoint; + cocos2d::Point _touchMovedPoint; + cocos2d::Point _touchEndedPoint; + cocos2d::Point _touchCanceledPoint; bool _touchDown; float _longClickTime; float _longClickRecordTime; - Array* _checkedDoubleClickWidget; + cocos2d::Array* _checkedDoubleClickWidget; UIWidget* _rootWidget; }; -NS_CC_EXT_END +} #endif /* defined(__CocoGUI__UIInputManager__) */ diff --git a/cocos/gui/system/UILayer.cpp b/cocos/gui/system/UILayer.cpp index 917241f494..1136656881 100644 --- a/cocos/gui/system/UILayer.cpp +++ b/cocos/gui/system/UILayer.cpp @@ -25,7 +25,9 @@ #include "UILayer.h" #include "UIHelper.h" -NS_CC_EXT_BEGIN + using namespace cocos2d; + +namespace gui { UILayer::UILayer(): _rootWidget(NULL), @@ -162,4 +164,4 @@ void UILayer::onTouchCancelled(Touch *pTouch, Event *pEvent) _inputManager->onTouchCancelled(pTouch); } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/gui/system/UILayer.h b/cocos/gui/system/UILayer.h index 7108d6b757..cf6fe9c43a 100644 --- a/cocos/gui/system/UILayer.h +++ b/cocos/gui/system/UILayer.h @@ -27,14 +27,13 @@ #define __UILAYER_H__ #include "cocos2d.h" -#include "ExtensionMacros.h" -#include "../BaseClasses/UIRootWidget.h" -#include "../System/UIInputManager.h" +#include "base-classes/UIRootWidget.h" +#include "system/UIInputManager.h" -NS_CC_EXT_BEGIN +namespace gui { -class UILayer : public Layer +class UILayer : public cocos2d::Layer { public: @@ -60,10 +59,10 @@ public: virtual void onExit(); virtual void onEnterTransitionDidFinish(); - virtual bool onTouchBegan(Touch *pTouch, Event *pEvent); - virtual void onTouchMoved(Touch *pTouch, Event *pEvent); - virtual void onTouchEnded(Touch *pTouch, Event *pEvent); - virtual void onTouchCancelled(Touch *pTouch, Event *pEvent); + virtual bool onTouchBegan(cocos2d::Touch *pTouch, cocos2d::Event *pEvent); + virtual void onTouchMoved(cocos2d::Touch *pTouch, cocos2d::Event *pEvent); + virtual void onTouchEnded(cocos2d::Touch *pTouch, cocos2d::Event *pEvent); + virtual void onTouchCancelled(cocos2d::Touch *pTouch, cocos2d::Event *pEvent); /** * Add a widget to UILayer, for drawing. @@ -130,7 +129,7 @@ protected: UIInputManager* _inputManager; }; -NS_CC_EXT_END +} diff --git a/cocos/gui/widgets/UIButton.cpp b/cocos/gui/widgets/UIButton.cpp index 7273378c0f..7325007d27 100644 --- a/cocos/gui/widgets/UIButton.cpp +++ b/cocos/gui/widgets/UIButton.cpp @@ -23,9 +23,12 @@ ****************************************************************************/ #include "UIButton.h" -#include "../../../GUI/CCControlExtension/CCScale9Sprite.h" +#include "GUI/CCControlExtension/CCScale9Sprite.h" -NS_CC_EXT_BEGIN + using namespace cocos2d; + using namespace cocos2d::extension; + +namespace gui { #define NORMALRENDERERZ (0) #define PRESSEDRENDERERZ (0) @@ -614,4 +617,4 @@ const char* UIButton::getDescription() const return "Button"; } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/gui/widgets/UIButton.h b/cocos/gui/widgets/UIButton.h index f44e897a90..5e9ba1c011 100644 --- a/cocos/gui/widgets/UIButton.h +++ b/cocos/gui/widgets/UIButton.h @@ -25,9 +25,9 @@ #ifndef __UIBUTTON_H__ #define __UIBUTTON_H__ -#include "../BaseClasses/UIWidget.h" +#include "base-classes/UIWidget.h" -NS_CC_EXT_BEGIN +namespace gui { class UIButton : public UIWidget { @@ -92,31 +92,31 @@ public: * * @param capInsets capinsets for button */ - void setCapInsets(const Rect &capInsets); + void setCapInsets(const cocos2d::Rect &capInsets); /** * Sets capinsets for button, if button is using scale9 renderer. * * @param capInsets capinsets for button */ - void setCapInsetsNormalRenderer(const Rect &capInsets); + void setCapInsetsNormalRenderer(const cocos2d::Rect &capInsets); /** * Sets capinsets for button, if button is using scale9 renderer. * * @param capInsets capinsets for button */ - void setCapInsetsPressedRenderer(const Rect &capInsets); + void setCapInsetsPressedRenderer(const cocos2d::Rect &capInsets); /** * Sets capinsets for button, if button is using scale9 renderer. * * @param capInsets capinsets for button */ - void setCapInsetsDisabledRenderer(const Rect &capInsets); + void setCapInsetsDisabledRenderer(const cocos2d::Rect &capInsets); //override "setAnchorPoint" of widget. - virtual void setAnchorPoint(const Point &pt); + virtual void setAnchorPoint(const cocos2d::Point &pt); /** * Sets if button is using scale9 renderer. @@ -148,10 +148,10 @@ public: virtual void ignoreContentAdaptWithSize(bool ignore); //override "getContentSize" method of widget. - virtual const Size& getContentSize() const; + virtual const cocos2d::Size& getContentSize() const; //override "getVirtualRenderer" method of widget. - virtual Node* getVirtualRenderer(); + virtual cocos2d::Node* getVirtualRenderer(); /** * Sets color to widget @@ -160,12 +160,12 @@ public: * * @param color */ - virtual void setColor(const Color3B &color); + virtual void setColor(const cocos2d::Color3B &color); void setTitleText(const char* text); const char* getTitleText() const; - void setTitleColor(const Color3B& color); - const Color3B& getTitleColor() const; + void setTitleColor(const cocos2d::Color3B& color); + const cocos2d::Color3B& getTitleColor() const; void setTitleFontSize(float size); float getTitleFontSize() const; void setTitleFontName(const char* fontName); @@ -187,28 +187,28 @@ protected: void pressedTextureScaleChangedWithSize(); void disabledTextureScaleChangedWithSize(); protected: - Node* _buttonNormalRenderer; - Node* _buttonClickedRenderer; - Node* _buttonDisableRenderer; - LabelTTF* _titleRenderer; + cocos2d::Node* _buttonNormalRenderer; + cocos2d::Node* _buttonClickedRenderer; + cocos2d::Node* _buttonDisableRenderer; + cocos2d::LabelTTF* _titleRenderer; std::string _normalFileName; std::string _clickedFileName; std::string _disabledFileName; bool _prevIgnoreSize; bool _scale9Enabled; - Rect _capInsetsNormal; - Rect _capInsetsPressed; - Rect _capInsetsDisabled; + cocos2d::Rect _capInsetsNormal; + cocos2d::Rect _capInsetsPressed; + cocos2d::Rect _capInsetsDisabled; TextureResType _normalTexType; TextureResType _pressedTexType; TextureResType _disabledTexType; - Size _normalTextureSize; - Size _pressedTextureSize; - Size _disabledTextureSize; + cocos2d::Size _normalTextureSize; + cocos2d::Size _pressedTextureSize; + cocos2d::Size _disabledTextureSize; bool _pressedActionEnabled; - Color3B _titleColor; + cocos2d::Color3B _titleColor; }; -NS_CC_EXT_END +} #endif /* defined(__CocoGUI__UIButton__) */ diff --git a/cocos/gui/widgets/UICheckBox.cpp b/cocos/gui/widgets/UICheckBox.cpp index 588ff138e1..ff41697418 100644 --- a/cocos/gui/widgets/UICheckBox.cpp +++ b/cocos/gui/widgets/UICheckBox.cpp @@ -24,7 +24,9 @@ #include "UICheckBox.h" -NS_CC_EXT_BEGIN + using namespace cocos2d; + +namespace gui { UICheckBox::UICheckBox(): _backGroundBoxRenderer(NULL), @@ -461,4 +463,4 @@ const char* UICheckBox::getDescription() const return "CheckBox"; } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/gui/widgets/UICheckBox.h b/cocos/gui/widgets/UICheckBox.h index 89f7473f05..408ef6b76a 100644 --- a/cocos/gui/widgets/UICheckBox.h +++ b/cocos/gui/widgets/UICheckBox.h @@ -25,9 +25,9 @@ #ifndef __UICHECKBOX_H__ #define __UICHECKBOX_H__ -#include "../BaseClasses/UIWidget.h" +#include "base-classes/UIWidget.h" -NS_CC_EXT_BEGIN +namespace gui { typedef enum { @@ -35,8 +35,8 @@ typedef enum CHECKBOX_STATE_EVENT_UNSELECTED }CheckBoxEventType; -typedef void (CCObject::*SEL_SelectedStateEvent)(Object*,CheckBoxEventType); -#define checkboxselectedeventselector(_SELECTOR) (cocos2d::extension::SEL_SelectedStateEvent)(&_SELECTOR) +typedef void (cocos2d::CCObject::*SEL_SelectedStateEvent)(cocos2d::Object*,CheckBoxEventType); +#define checkboxselectedeventselector(_SELECTOR) (SEL_SelectedStateEvent)(&_SELECTOR) class UICheckBox : public UIWidget { @@ -131,10 +131,10 @@ public: bool getSelectedState(); //override "setAnchorPoint" method of widget. - virtual void setAnchorPoint(const Point &pt); + virtual void setAnchorPoint(const cocos2d::Point &pt); //add a call back function would called when checkbox is selected or unselected. - void addEventListener(Object* target,SEL_SelectedStateEvent selector); + void addEventListener(cocos2d::Object* target,SEL_SelectedStateEvent selector); //override "setFlipX" method of widget. virtual void setFlipX(bool flipX); @@ -149,13 +149,13 @@ public: virtual bool isFlipY(); //override "onTouchEnded" method of widget. - virtual void onTouchEnded(const Point &touchPoint); + virtual void onTouchEnded(const cocos2d::Point &touchPoint); //override "getContentSize" method of widget. - virtual const Size& getContentSize() const; + virtual const cocos2d::Size& getContentSize() const; //override "getVirtualRenderer" method of widget. - virtual Node* getVirtualRenderer(); + virtual cocos2d::Node* getVirtualRenderer(); /** * Returns the "class name" of widget. @@ -176,14 +176,14 @@ protected: void backGroundDisabledTextureScaleChangedWithSize(); void frontCrossDisabledTextureScaleChangedWithSize(); protected: - Sprite* _backGroundBoxRenderer; - Sprite* _backGroundSelectedBoxRenderer; - Sprite* _frontCrossRenderer; - Sprite* _backGroundBoxDisabledRenderer; - Sprite* _frontCrossDisabledRenderer; + cocos2d::Sprite* _backGroundBoxRenderer; + cocos2d::Sprite* _backGroundSelectedBoxRenderer; + cocos2d::Sprite* _frontCrossRenderer; + cocos2d::Sprite* _backGroundBoxDisabledRenderer; + cocos2d::Sprite* _frontCrossDisabledRenderer; bool _isSelected; - Object* _selectedStateEventListener; + cocos2d::Object* _selectedStateEventListener; SEL_SelectedStateEvent _selectedStateEventSelector; TextureResType _backGroundTexType; @@ -193,6 +193,6 @@ protected: TextureResType _frontCrossDisabledTexType; }; -NS_CC_EXT_END +} #endif /* defined(__CocoGUI__UICheckBox__) */ diff --git a/cocos/gui/widgets/UIImageView.cpp b/cocos/gui/widgets/UIImageView.cpp index 23db5afef3..89491f8141 100644 --- a/cocos/gui/widgets/UIImageView.cpp +++ b/cocos/gui/widgets/UIImageView.cpp @@ -23,9 +23,12 @@ ****************************************************************************/ #include "UIImageView.h" -#include "../../../GUI/CCControlExtension/CCScale9Sprite.h" +#include "GUI/CCControlExtension/CCScale9Sprite.h" -NS_CC_EXT_BEGIN + using namespace cocos2d; + using namespace cocos2d::extension; + +namespace gui { #define DYNAMIC_CAST_CCSPRITE dynamic_cast(_imageRenderer) #define DYNAMIC_CAST_SCALE9SPRITE dynamic_cast(_imageRenderer) @@ -373,4 +376,4 @@ const char* UIImageView::getDescription() const return "ImageView"; } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/gui/widgets/UIImageView.h b/cocos/gui/widgets/UIImageView.h index 89e73d3fc4..a218ce492c 100644 --- a/cocos/gui/widgets/UIImageView.h +++ b/cocos/gui/widgets/UIImageView.h @@ -25,9 +25,9 @@ #ifndef __UIIMAGEVIEW_H__ #define __UIIMAGEVIEW_H__ -#include "../BaseClasses/UIWidget.h" +#include "base-classes/UIWidget.h" -NS_CC_EXT_BEGIN +namespace gui { class UIImageView : public UIWidget { @@ -60,7 +60,7 @@ public: * Updates the texture rect of the UIImageView in points. * It will call setTextureRect:rotated:untrimmedSize with rotated = NO, and utrimmedSize = rect.size. */ - void setTextureRect(const Rect& rect); + void setTextureRect(const cocos2d::Rect& rect); /** * Sets if imageview is using scale9 renderer. @@ -74,7 +74,7 @@ public: * * @param capInsets capinsets for imageview */ - void setCapInsets(const Rect &capInsets); + void setCapInsets(const cocos2d::Rect &capInsets); //override "setFlipX" method of widget. virtual void setFlipX(bool flipX); @@ -89,13 +89,13 @@ public: virtual bool isFlipY(); //override "setAnchorPoint" method of widget. - virtual void setAnchorPoint(const Point &pt); + virtual void setAnchorPoint(const cocos2d::Point &pt); //override "onTouchBegan" method of widget. - virtual bool onTouchBegan(const Point &touchPoint); + virtual bool onTouchBegan(const cocos2d::Point &touchPoint); //override "onTouchEnded" method of widget. - virtual void onTouchEnded(const Point &touchPoint); + virtual void onTouchEnded(const cocos2d::Point &touchPoint); //override "ignoreContentAdaptWithSize" method of widget. virtual void ignoreContentAdaptWithSize(bool ignore); @@ -105,8 +105,8 @@ public: void setDoubleClickEnabled(bool able); void doubleClickEvent(); void checkDoubleClick(float dt); - virtual const Size& getContentSize() const; - virtual Node* getVirtualRenderer(); + virtual const cocos2d::Size& getContentSize() const; + virtual cocos2d::Node* getVirtualRenderer(); /** * Returns the "class name" of widget. @@ -124,13 +124,13 @@ protected: bool _doubleClickEnabled; bool _scale9Enabled; bool _prevIgnoreSize; - Rect _capInsets; - Node* _imageRenderer; + cocos2d::Rect _capInsets; + cocos2d::Node* _imageRenderer; std::string _textureFile; TextureResType _imageTexType; - Size _imageTextureSize; + cocos2d::Size _imageTextureSize; }; -NS_CC_EXT_END +} #endif /* defined(__CocoGUI__UIImageView__) */ diff --git a/cocos/gui/widgets/UILabel.cpp b/cocos/gui/widgets/UILabel.cpp index 0bc0da834d..a5b468c5d2 100644 --- a/cocos/gui/widgets/UILabel.cpp +++ b/cocos/gui/widgets/UILabel.cpp @@ -24,7 +24,9 @@ #include "UILabel.h" -NS_CC_EXT_BEGIN + using namespace cocos2d; + +namespace gui { UILabel::UILabel(): _touchScaleChangeEnabled(false), @@ -228,4 +230,4 @@ const char* UILabel::getDescription() const return "Label"; } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/gui/widgets/UILabel.h b/cocos/gui/widgets/UILabel.h index 68b764595e..4f5a4794da 100644 --- a/cocos/gui/widgets/UILabel.h +++ b/cocos/gui/widgets/UILabel.h @@ -25,9 +25,9 @@ #ifndef __UILABEL_H__ #define __UILABEL_H__ -#include "../BaseClasses/UIWidget.h" +#include "base-classes/UIWidget.h" -NS_CC_EXT_BEGIN +namespace gui { class UILabel : public UIWidget { @@ -109,22 +109,22 @@ public: virtual bool isFlipY(); //override "setAnchorPoint" method of widget. - virtual void setAnchorPoint(const Point &pt); + virtual void setAnchorPoint(const cocos2d::Point &pt); //override "getContentSize" method of widget. - virtual const Size& getContentSize() const; + virtual const cocos2d::Size& getContentSize() const; //override "getVirtualRenderer" method of widget. - virtual Node* getVirtualRenderer(); + virtual cocos2d::Node* getVirtualRenderer(); /** * Returns the "class name" of widget. */ virtual const char* getDescription() const; - void setTextAreaSize(const Size &size); - void setTextHorizontalAlignment(TextHAlignment alignment); - void setTextVerticalAlignment(TextVAlignment alignment); + void setTextAreaSize(const cocos2d::Size &size); + void setTextHorizontalAlignment(cocos2d::TextHAlignment alignment); + void setTextVerticalAlignment(cocos2d::TextVAlignment alignment); void setTouchScaleChangeAble(bool able){setTouchScaleChangeEnabled(able);}; @@ -144,9 +144,9 @@ protected: std::string _fontName; int _fontSize; float _onSelectedScaleOffset; - LabelTTF* _labelRenderer; + cocos2d::LabelTTF* _labelRenderer; }; -NS_CC_EXT_END +} #endif /* defined(__CocoGUI__Label__) */ diff --git a/cocos/gui/widgets/UILabelAtlas.cpp b/cocos/gui/widgets/UILabelAtlas.cpp index c4ba1922a7..9122960f8a 100644 --- a/cocos/gui/widgets/UILabelAtlas.cpp +++ b/cocos/gui/widgets/UILabelAtlas.cpp @@ -24,7 +24,9 @@ #include "UILabelAtlas.h" -NS_CC_EXT_BEGIN + using namespace cocos2d; + +namespace gui { UICCLabelAtlas::UICCLabelAtlas() { @@ -172,4 +174,4 @@ const char* UILabelAtlas::getDescription() const return "LabelAtlase"; } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/gui/widgets/UILabelAtlas.h b/cocos/gui/widgets/UILabelAtlas.h index 6ff0b65a1e..b9251fa3c4 100644 --- a/cocos/gui/widgets/UILabelAtlas.h +++ b/cocos/gui/widgets/UILabelAtlas.h @@ -25,11 +25,11 @@ #ifndef __UILABELATLAS_H__ #define __UILABELATLAS_H__ -#include "../BaseClasses/UIWidget.h" +#include "base-classes/UIWidget.h" -NS_CC_EXT_BEGIN +namespace gui { -class UICCLabelAtlas : public LabelAtlas +class UICCLabelAtlas : public cocos2d::LabelAtlas { public: /** @@ -47,7 +47,7 @@ public: */ static UICCLabelAtlas* create(); void setProperty(const char *string, const char *charMapFile, unsigned int itemWidth, unsigned int itemHeight, unsigned int startCharMap); - void setProperty(const char *string, Texture2D *texture, unsigned int itemWidth, unsigned int itemHeight, unsigned int startCharMap); + void setProperty(const char *string, cocos2d::Texture2D *texture, unsigned int itemWidth, unsigned int itemHeight, unsigned int startCharMap); virtual void updateDisplayedOpacity(GLubyte opacity); virtual void draw(void); }; @@ -80,13 +80,13 @@ public: const char* getStringValue(); //override "setAnchorPoint" method of widget. - virtual void setAnchorPoint(const Point &pt); + virtual void setAnchorPoint(const cocos2d::Point &pt); //override "getContentSize" method of widget. - virtual const Size& getContentSize() const; + virtual const cocos2d::Size& getContentSize() const; //override "getVirtualRenderer" method of widget. - virtual Node* getVirtualRenderer(); + virtual cocos2d::Node* getVirtualRenderer(); /** * Returns the "class name" of widget. @@ -100,6 +100,6 @@ protected: UICCLabelAtlas* _laberAtlasRenderer; }; -NS_CC_EXT_END +} #endif /* defined(__CocoGUI__UILabelAtlas__) */ diff --git a/cocos/gui/widgets/UILabelBMFont.cpp b/cocos/gui/widgets/UILabelBMFont.cpp index 23b0a2a1fc..4f18161f95 100644 --- a/cocos/gui/widgets/UILabelBMFont.cpp +++ b/cocos/gui/widgets/UILabelBMFont.cpp @@ -24,7 +24,9 @@ #include "UILabelBMFont.h" -NS_CC_EXT_BEGIN + using namespace cocos2d; + +namespace gui { UILabelBMFont::UILabelBMFont(): _labelBMFontRenderer(NULL), @@ -58,7 +60,7 @@ void UILabelBMFont::initRenderer() void UILabelBMFont::setFntFile(const char *fileName) { - if (!fileName || std::strcmp(fileName, "") == 0) + if (!fileName || strcmp(fileName, "") == 0) { return; } @@ -132,4 +134,4 @@ const char* UILabelBMFont::getDescription() const } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/gui/widgets/UILabelBMFont.h b/cocos/gui/widgets/UILabelBMFont.h index a1eab88e2d..7e41307133 100644 --- a/cocos/gui/widgets/UILabelBMFont.h +++ b/cocos/gui/widgets/UILabelBMFont.h @@ -25,9 +25,9 @@ #ifndef __UILABELBMFONT_H__ #define __UILABELBMFONT_H__ -#include "../BaseClasses/UIWidget.h" +#include "base-classes/UIWidget.h" -NS_CC_EXT_BEGIN +namespace gui { class UILabelBMFont : public UIWidget { @@ -55,9 +55,9 @@ public: /** get string value for labelbmfont*/ const char* getStringValue(); - virtual void setAnchorPoint(const Point &pt); - virtual const Size& getContentSize() const; - virtual Node* getVirtualRenderer(); + virtual void setAnchorPoint(const cocos2d::Point &pt); + virtual const cocos2d::Size& getContentSize() const; + virtual cocos2d::Node* getVirtualRenderer(); /** * Returns the "class name" of widget. @@ -68,10 +68,10 @@ protected: virtual void onSizeChanged(); void labelBMFontScaleChangedWithSize(); protected: - LabelBMFont* _labelBMFontRenderer; + cocos2d::LabelBMFont* _labelBMFontRenderer; bool _fntFileHasInit; }; -NS_CC_EXT_END +} #endif /* defined(__UILabelBMFont__) */ diff --git a/cocos/gui/widgets/UILoadingBar.cpp b/cocos/gui/widgets/UILoadingBar.cpp index ac53cf28ec..8037d1df33 100644 --- a/cocos/gui/widgets/UILoadingBar.cpp +++ b/cocos/gui/widgets/UILoadingBar.cpp @@ -23,9 +23,12 @@ ****************************************************************************/ #include "UILoadingBar.h" -#include "../../../GUI/CCControlExtension/CCScale9Sprite.h" +#include "GUI/CCControlExtension/CCScale9Sprite.h" -NS_CC_EXT_BEGIN + using namespace cocos2d; + using namespace cocos2d::extension; + +namespace gui { #define DYNAMIC_CAST_CCSPRITE dynamic_cast(_barRenderer) @@ -336,4 +339,4 @@ const char* UILoadingBar::getDescription() const return "LoadingBar"; } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/gui/widgets/UILoadingBar.h b/cocos/gui/widgets/UILoadingBar.h index 5bf38a203a..02a9e2b5c6 100644 --- a/cocos/gui/widgets/UILoadingBar.h +++ b/cocos/gui/widgets/UILoadingBar.h @@ -25,9 +25,9 @@ #ifndef __UILOADINGBAR_H__ #define __UILOADINGBAR_H__ -#include "../BaseClasses/UIWidget.h" +#include "base-classes/UIWidget.h" -NS_CC_EXT_BEGIN +namespace gui { typedef enum { @@ -106,16 +106,16 @@ public: * * @param capInsets capinsets for loadingbar */ - void setCapInsets(const Rect &capInsets); + void setCapInsets(const cocos2d::Rect &capInsets); //override "ignoreContentAdaptWithSize" method of widget. virtual void ignoreContentAdaptWithSize(bool ignore); //override "getContentSize" method of widget. - virtual const Size& getContentSize() const; + virtual const cocos2d::Size& getContentSize() const; //override "getVirtualRenderer" method of widget. - virtual Node* getVirtualRenderer(); + virtual cocos2d::Node* getVirtualRenderer(); /** * Returns the "class name" of widget. @@ -130,15 +130,15 @@ protected: LoadingBarType _barType; int _percent; float _totalLength; - Node* _barRenderer; + cocos2d::Node* _barRenderer; TextureResType _renderBarTexType; - Size _barRendererTextureSize; + cocos2d::Size _barRendererTextureSize; bool _scale9Enabled; bool _prevIgnoreSize; - Rect _capInsets; + cocos2d::Rect _capInsets; std::string _textureFile; }; -NS_CC_EXT_END +} #endif /* defined(__CocoGUI__UILoadingBar__) */ diff --git a/cocos/gui/widgets/UISlider.cpp b/cocos/gui/widgets/UISlider.cpp index 022646033f..dcadbc2132 100644 --- a/cocos/gui/widgets/UISlider.cpp +++ b/cocos/gui/widgets/UISlider.cpp @@ -23,9 +23,12 @@ ****************************************************************************/ #include "UISlider.h" -#include "../../../GUI/CCControlExtension/CCScale9Sprite.h" +#include "GUI/CCControlExtension/CCScale9Sprite.h" -NS_CC_EXT_BEGIN +using namespace cocos2d; +using namespace cocos2d::extension; + +namespace gui { UISlider::UISlider(): _barRenderer(NULL), @@ -541,4 +544,4 @@ const char* UISlider::getDescription() const return "Slider"; } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/gui/widgets/UISlider.h b/cocos/gui/widgets/UISlider.h index 39b912fbe6..6e87dc1f9f 100644 --- a/cocos/gui/widgets/UISlider.h +++ b/cocos/gui/widgets/UISlider.h @@ -25,16 +25,16 @@ #ifndef __UISLIDER_H__ #define __UISLIDER_H__ -#include "../BaseClasses/UIWidget.h" +#include "base-classes/UIWidget.h" -NS_CC_EXT_BEGIN +namespace gui { typedef enum { SLIDER_PERCENTCHANGED }SliderEventType; -typedef void (CCObject::*SEL_SlidPercentChangedEvent)(Object*,SliderEventType); +typedef void (cocos2d::CCObject::*SEL_SlidPercentChangedEvent)(cocos2d::Object*,SliderEventType); #define sliderpercentchangedselector(_SELECTOR) (SEL_SlidPercentChangedEvent)(&_SELECTOR) class UISlider : public UIWidget @@ -76,21 +76,21 @@ public: * * @param capInsets capinsets for slider */ - void setCapInsets(const Rect &capInsets); + void setCapInsets(const cocos2d::Rect &capInsets); /** * Sets capinsets for slider, if slider is using scale9 renderer. * * @param capInsets capinsets for slider */ - void setCapInsetsBarRenderer(const Rect &capInsets); + void setCapInsetsBarRenderer(const cocos2d::Rect &capInsets); /** * Sets capinsets for slider, if slider is using scale9 renderer. * * @param capInsets capinsets for slider */ - void setCapInsetProgressBarRebderer(const Rect &capInsets); + void setCapInsetProgressBarRebderer(const cocos2d::Rect &capInsets); /** * Load textures for slider ball. @@ -158,25 +158,25 @@ public: /** * Add call back function called when slider's percent has changed to slider. */ - void addEventListener(Object* target,SEL_SlidPercentChangedEvent selector); + void addEventListener(cocos2d::Object* target,SEL_SlidPercentChangedEvent selector); //override "onTouchBegan" method of widget. - virtual bool onTouchBegan(const Point &touchPoint); + virtual bool onTouchBegan(const cocos2d::Point &touchPoint); //override "onTouchMoved" method of widget. - virtual void onTouchMoved(const Point &touchPoint); + virtual void onTouchMoved(const cocos2d::Point &touchPoint); //override "onTouchEnded" method of widget. - virtual void onTouchEnded(const Point &touchPoint); + virtual void onTouchEnded(const cocos2d::Point &touchPoint); //override "onTouchCancelled" method of widget. - virtual void onTouchCancelled(const Point &touchPoint); + virtual void onTouchCancelled(const cocos2d::Point &touchPoint); //override "getContentSize" method of widget. - virtual const Size& getContentSize() const; + virtual const cocos2d::Size& getContentSize() const; //override "getVirtualRenderer" method of widget. - virtual Node* getVirtualRenderer(); + virtual cocos2d::Node* getVirtualRenderer(); //override "ignoreContentAdaptWithSize" method of widget. virtual void ignoreContentAdaptWithSize(bool ignore); @@ -196,14 +196,14 @@ protected: void barRendererScaleChangedWithSize(); void progressBarRendererScaleChangedWithSize(); protected: - Node* _barRenderer; - Node* _progressBarRenderer; - Size _progressBarTextureSize; + cocos2d::Node* _barRenderer; + cocos2d::Node* _progressBarRenderer; + cocos2d::Size _progressBarTextureSize; - Sprite* _slidBallNormalRenderer; - Sprite* _slidBallPressedRenderer; - Sprite* _slidBallDisabledRenderer; - Node* _slidBallRenderer; + cocos2d::Sprite* _slidBallNormalRenderer; + cocos2d::Sprite* _slidBallPressedRenderer; + cocos2d::Sprite* _slidBallDisabledRenderer; + cocos2d::Node* _slidBallRenderer; float _barLength; int _percent; @@ -216,10 +216,10 @@ protected: std::string _slidBallPressedTextureFile; std::string _slidBallDisabledTextureFile; - Rect _capInsetsBarRenderer; - Rect _capInsetsProgressBarRenderer; + cocos2d::Rect _capInsetsBarRenderer; + cocos2d::Rect _capInsetsProgressBarRenderer; - Object* _slidPercentListener; + cocos2d::Object* _slidPercentListener; SEL_SlidPercentChangedEvent _slidPercentSelector; TextureResType _barTexType; TextureResType _progressBarTexType; @@ -228,6 +228,6 @@ protected: TextureResType _ballDTexType; }; -NS_CC_EXT_END +} #endif /* defined(__CocoGUI__UISlider__) */ diff --git a/cocos/gui/widgets/UITextField.cpp b/cocos/gui/widgets/UITextField.cpp index a3fb9d07c7..f82b3e248c 100644 --- a/cocos/gui/widgets/UITextField.cpp +++ b/cocos/gui/widgets/UITextField.cpp @@ -24,7 +24,9 @@ #include "UITextField.h" -NS_CC_EXT_BEGIN + using namespace cocos2d; + +namespace gui { UICCTextField::UICCTextField() : m_bMaxLengthEnabled(false) @@ -565,4 +567,4 @@ const char* UITextField::getDescription() const return "TextField"; } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/gui/widgets/UITextField.h b/cocos/gui/widgets/UITextField.h index 4a2db5c68a..b5951f056b 100644 --- a/cocos/gui/widgets/UITextField.h +++ b/cocos/gui/widgets/UITextField.h @@ -25,12 +25,12 @@ #ifndef __UITEXTFIELD_H__ #define __UITEXTFIELD_H__ -#include "../BaseClasses/UIWidget.h" +#include "base-classes/UIWidget.h" -NS_CC_EXT_BEGIN +namespace gui { -class UICCTextField: public TextFieldTTF, public TextFieldDelegate +class UICCTextField: public cocos2d::TextFieldTTF, public cocos2d::TextFieldDelegate { public: UICCTextField(); @@ -42,10 +42,10 @@ public: static UICCTextField* create(const char *placeholder, const char *fontName, float fontSize); // CCTextFieldDelegate - virtual bool onTextFieldAttachWithIME(TextFieldTTF *pSender); - virtual bool onTextFieldDetachWithIME(TextFieldTTF * pSender); - virtual bool onTextFieldInsertText(TextFieldTTF * pSender, const char * text, int nLen); - virtual bool onTextFieldDeleteBackward(TextFieldTTF * pSender, const char * delText, int nLen); + virtual bool onTextFieldAttachWithIME(cocos2d::TextFieldTTF *pSender); + virtual bool onTextFieldDetachWithIME(cocos2d::TextFieldTTF * pSender); + virtual bool onTextFieldInsertText(cocos2d::TextFieldTTF * pSender, const char * text, int nLen); + virtual bool onTextFieldDeleteBackward(cocos2d::TextFieldTTF * pSender, const char * delText, int nLen); void insertText(const char* text, int len); void deleteBackward(); @@ -92,7 +92,7 @@ typedef enum TEXTFIELD_EVENT_DELETE_BACKWARD, }TextFiledEventType; -typedef void (Object::*SEL_TextFieldEvent)(Object*, TextFiledEventType); +typedef void (cocos2d::Object::*SEL_TextFieldEvent)(cocos2d::Object*, TextFiledEventType); #define textfieldeventselector(_SELECTOR) (SEL_TextFieldEvent)(&_SELECTOR) //class UITextField : public UIWidget @@ -104,14 +104,14 @@ public: static UITextField* create(); virtual bool init(); virtual void initRenderer(); - void setTouchSize(const Size &size); + void setTouchSize(const cocos2d::Size &size); void setText(const char* text); void setPlaceHolder(const char* value); void setFontSize(int size); void setFontName(const char* name); virtual void didNotSelectSelf(); const char* getStringValue(); - virtual bool onTouchBegan(const Point &touchPoint); + virtual bool onTouchBegan(const cocos2d::Point &touchPoint); void setMaxLengthEnabled(bool enable); bool isMaxLengthEnabled(); void setMaxLength(int length); @@ -128,9 +128,9 @@ public: void setInsertText(bool insertText); bool getDeleteBackward(); void setDeleteBackward(bool deleteBackward); - void addEventListener(Object* target, SEL_TextFieldEvent selecor); - virtual void setAnchorPoint(const Point &pt); - virtual void setColor(const Color3B &color); + void addEventListener(cocos2d::Object* target, SEL_TextFieldEvent selecor); + virtual void setAnchorPoint(const cocos2d::Point &pt); + virtual void setColor(const cocos2d::Color3B &color); virtual void setOpacity(int opacity); /** * Returns the "class name" of widget. @@ -143,8 +143,8 @@ public: void setMaxLengthEnable(bool is){setMaxLengthEnabled(is);}; void setPasswordEnable(bool is){setPasswordEnabled(is);}; /************/ - virtual const Size& getContentSize() const; - virtual Node* getVirtualRenderer(); + virtual const cocos2d::Size& getContentSize() const; + virtual cocos2d::Node* getVirtualRenderer(); protected: // event void attachWithIMEEvent(); @@ -160,11 +160,11 @@ protected: float _touchHeight; bool _useTouchArea; - Object* _eventListener; + cocos2d::Object* _eventListener; SEL_TextFieldEvent _eventSelector; }; -NS_CC_EXT_END +} #endif /* defined(__CocoGUI__UITextField__) */ diff --git a/cocos/gui/widgets/ScrollWidget/UIDragPanel.cpp b/cocos/gui/widgets/scroll-widget/UIDragPanel.cpp similarity index 99% rename from cocos/gui/widgets/ScrollWidget/UIDragPanel.cpp rename to cocos/gui/widgets/scroll-widget/UIDragPanel.cpp index e21d59e1b8..3953d13d0b 100644 --- a/cocos/gui/widgets/ScrollWidget/UIDragPanel.cpp +++ b/cocos/gui/widgets/scroll-widget/UIDragPanel.cpp @@ -23,9 +23,11 @@ ****************************************************************************/ #include "UIDragPanel.h" -#include "../../System/UILayer.h" +#include "system/UILayer.h" -NS_CC_EXT_BEGIN + using namespace cocos2d; + +namespace gui { UIDragPanel::UIDragPanel() : _innerContainer(NULL) @@ -1264,4 +1266,4 @@ const char* UIDragPanel::getDescription() const return "DragPanel"; } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/gui/widgets/ScrollWidget/UIDragPanel.h b/cocos/gui/widgets/scroll-widget/UIDragPanel.h similarity index 80% rename from cocos/gui/widgets/ScrollWidget/UIDragPanel.h rename to cocos/gui/widgets/scroll-widget/UIDragPanel.h index dc05b53d21..0402f0e03e 100644 --- a/cocos/gui/widgets/ScrollWidget/UIDragPanel.h +++ b/cocos/gui/widgets/scroll-widget/UIDragPanel.h @@ -25,10 +25,10 @@ #ifndef __UIDRAGPANEL_H__ #define __UIDRAGPANEL_H__ -#include "../../Layouts/Layout.h" +#include "layouts/Layout.h" #include "UIScrollInterface.h" -NS_CC_EXT_BEGIN +namespace gui { /** * drag panel move type @@ -95,7 +95,7 @@ typedef enum /** * dragpanel event */ -typedef void (Object::*SEL_DragPanelEvent)(Object*, DragPanelEventType); +typedef void (cocos2d::Object::*SEL_DragPanelEvent)(cocos2d::Object*, DragPanelEventType); #define dragpaneleventselector(_SELECTOR)(SEL_DragPanelEvent)(&_SELECTOR) class UIDragPanel : public Layout, public UIScrollInterface @@ -106,11 +106,11 @@ public: static UIDragPanel* create(); - virtual bool onTouchBegan(const Point &touchPoint); - virtual void onTouchMoved(const Point &touchPoint); - virtual void onTouchEnded(const Point &touchPoint); - virtual void onTouchCancelled(const Point &touchPoint); - virtual void onTouchLongClicked(const Point &touchPoint); + virtual bool onTouchBegan(const cocos2d::Point &touchPoint); + virtual void onTouchMoved(const cocos2d::Point &touchPoint); + virtual void onTouchEnded(const cocos2d::Point &touchPoint); + virtual void onTouchCancelled(const cocos2d::Point &touchPoint); + virtual void onTouchLongClicked(const cocos2d::Point &touchPoint); virtual void update(float dt); @@ -129,22 +129,22 @@ public: /** * get widget children of inner container */ - virtual Array* getChildren(); + virtual cocos2d::Array* getChildren(); /* gui mark */ /** * get and set inner container size */ - const Size& getInnerContainerSize() const; - void setInnerContainerSize(const Size &size); + const cocos2d::Size& getInnerContainerSize() const; + void setInnerContainerSize(const cocos2d::Size &size); /** * get and set inner container position */ - const Point& getInnerContainerPosition() const; - void setInnerContainerPosition(const Point& point, bool animated); + const cocos2d::Point& getInnerContainerPosition() const; + void setInnerContainerPosition(const cocos2d::Point& point, bool animated); /** * set inner container offset */ - void setInnerContainerOffset(const Point& offset, bool animated); + void setInnerContainerOffset(const cocos2d::Point& offset, bool animated); /**/ // auto move @@ -166,7 +166,7 @@ public: /** * event */ - void addEventListener(Object* target, SEL_DragPanelEvent selector); + void addEventListener(cocos2d::Object* target, SEL_DragPanelEvent selector); /** * get and set bounce enable @@ -221,26 +221,26 @@ protected: virtual void initRenderer(); virtual void releaseResoures(); - virtual void handlePressLogic(const Point &touchPoint); - virtual void handleMoveLogic(const Point &touchPoint); - virtual void handleReleaseLogic(const Point &touchPoint); - virtual void interceptTouchEvent(int handleState,UIWidget* sender, const Point &touchPoint); + virtual void handlePressLogic(const cocos2d::Point &touchPoint); + virtual void handleMoveLogic(const cocos2d::Point &touchPoint); + virtual void handleReleaseLogic(const cocos2d::Point &touchPoint); + virtual void interceptTouchEvent(int handleState,UIWidget* sender, const cocos2d::Point &touchPoint); /* gui mark */ // virtual bool isInScrollDegreeRange(UIWidget* widget); /**/ - virtual void checkChildInfo(int handleState, UIWidget *sender, const Point &touchPoint); + virtual void checkChildInfo(int handleState, UIWidget *sender, const cocos2d::Point &touchPoint); // void updateWidthAndHeight(); void recordSlidTime(float dt); /* gui mark */ - void setInnerContainerOffset(const Point& offset); + void setInnerContainerOffset(const cocos2d::Point& offset); /**/ // check if dragpanel rect contain inner rect bool checkContainInnerRect(); // move - void moveWithDelta(const Point& delta); + void moveWithDelta(const cocos2d::Point& delta); // auto move void autoMove(); @@ -250,10 +250,10 @@ protected: // berth // check if move to boundary with update - bool checkToBoundaryWithDeltaPosition(const Point& delta); + bool checkToBoundaryWithDeltaPosition(const cocos2d::Point& delta); // calculate to boundary delta - Point calculateToBoundaryDeltaPosition(const Point& paramDelta); + cocos2d::Point calculateToBoundaryDeltaPosition(const cocos2d::Point& paramDelta); // check berth bool checkBerth(); @@ -292,10 +292,10 @@ protected: void actionUpdate(float dt); void actionStop(); void actionDone(); - void moveByWithDuration(float duration, const Point& deltaPosition); + void moveByWithDuration(float duration, const cocos2d::Point& deltaPosition); void moveByInit(); void moveByUpdate(float t); - void moveToWithDuration(float duration, const Point& position); + void moveToWithDuration(float duration, const cocos2d::Point& position); void moveToInit(); void moveToUpdate(float t); virtual void onSizeChanged(); @@ -319,9 +319,9 @@ protected: bool _touchReleased; bool _touchCanceld; // check touch out of drag panel boundary - Point _touchStartNodeSpace; - Point _touchStartWorldSpace; - Point _touchEndWorldSpace; + cocos2d::Point _touchStartNodeSpace; + cocos2d::Point _touchStartWorldSpace; + cocos2d::Point _touchEndWorldSpace; float _slidTime; @@ -333,7 +333,7 @@ protected: float _autoMoveEaseRate; // event - Object* _eventLister; + cocos2d::Object* _eventLister; SEL_DragPanelEvent _eventSelector; // berth @@ -355,13 +355,13 @@ protected: float _elapsed; bool _firstTick; - Point _positionDelta; - Point _startPosition; - Point _previousPosition; + cocos2d::Point _positionDelta; + cocos2d::Point _startPosition; + cocos2d::Point _previousPosition; - Point _endPosition; + cocos2d::Point _endPosition; }; -NS_CC_EXT_END +} #endif /* defined(__TestCpp__UIDragPanel__) */ diff --git a/cocos/gui/widgets/ScrollWidget/UIListView.cpp b/cocos/gui/widgets/scroll-widget/UIListView.cpp similarity index 99% rename from cocos/gui/widgets/ScrollWidget/UIListView.cpp rename to cocos/gui/widgets/scroll-widget/UIListView.cpp index 27775474c5..123146b127 100644 --- a/cocos/gui/widgets/ScrollWidget/UIListView.cpp +++ b/cocos/gui/widgets/scroll-widget/UIListView.cpp @@ -24,7 +24,9 @@ #include "UIListView.h" -NS_CC_EXT_BEGIN + using namespace cocos2d; + +namespace gui { UIListView::UIListView() : _direction(LISTVIEW_DIR_VERTICAL) @@ -1455,4 +1457,4 @@ const char* UIListView::getDescription() const } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/gui/widgets/ScrollWidget/UIListView.h b/cocos/gui/widgets/scroll-widget/UIListView.h similarity index 84% rename from cocos/gui/widgets/ScrollWidget/UIListView.h rename to cocos/gui/widgets/scroll-widget/UIListView.h index 2bbbae212c..872f591876 100644 --- a/cocos/gui/widgets/ScrollWidget/UIListView.h +++ b/cocos/gui/widgets/scroll-widget/UIListView.h @@ -26,10 +26,10 @@ #define __UILISTVIEW_H__ /* gui mark */ -#include "../../Layouts/Layout.h" +#include "layouts/Layout.h" /**/ -NS_CC_EXT_BEGIN +namespace gui { /** * list view direction @@ -62,7 +62,7 @@ typedef enum /** * list view event */ -typedef void (Object::*SEL_ListViewEvent)(Object*, ListViewEventType); +typedef void (cocos2d::Object::*SEL_ListViewEvent)(cocos2d::Object*, ListViewEventType); #define listvieweventselector(_SELECTOR)(SEL_ListViewEvent)(&_SELECTOR) class UIListView : public Layout @@ -85,11 +85,11 @@ public: */ virtual bool removeChild(UIWidget* child); - virtual bool onTouchBegan(const Point &touchPoint); - virtual void onTouchMoved(const Point &touchPoint); - virtual void onTouchEnded(const Point &touchPoint); - virtual void onTouchCancelled(const Point &touchPoint); - virtual void onTouchLongClicked(const Point &touchPoint); + virtual bool onTouchBegan(const cocos2d::Point &touchPoint); + virtual void onTouchMoved(const cocos2d::Point &touchPoint); + virtual void onTouchEnded(const cocos2d::Point &touchPoint); + virtual void onTouchCancelled(const cocos2d::Point &touchPoint); + virtual void onTouchLongClicked(const cocos2d::Point &touchPoint); /** * set and get direction @@ -155,14 +155,14 @@ protected: virtual void resetProperty(); - virtual void handlePressLogic(const Point &touchPoint); - virtual void handleMoveLogic(const Point &touchPoint); - virtual void handleReleaseLogic(const Point &touchPoint); - virtual void interceptTouchEvent(int handleState,UIWidget* sender,const Point &touchPoint); + virtual void handlePressLogic(const cocos2d::Point &touchPoint); + virtual void handleMoveLogic(const cocos2d::Point &touchPoint); + virtual void handleReleaseLogic(const cocos2d::Point &touchPoint); + virtual void interceptTouchEvent(int handleState,UIWidget* sender,const cocos2d::Point &touchPoint); /* gui mark */ // virtual bool isInScrollDegreeRange(UIWidget* widget); /**/ - virtual void checkChildInfo(int handleState,UIWidget* sender,const Point &touchPoint); + virtual void checkChildInfo(int handleState,UIWidget* sender,const cocos2d::Point &touchPoint); void moveChildren(float offset); virtual bool scrollChildren(float touchOffset); @@ -212,14 +212,14 @@ protected: bool _bePressed; float _slidTime; - Point _moveChildPoint; + cocos2d::Point _moveChildPoint; float _childFocusCancelOffset; - Object* _eventListener; + cocos2d::Object* _eventListener; SEL_ListViewEvent _eventSelector; - Array* _childPool; - Array* _updatePool; + cocos2d::Array* _childPool; + cocos2d::Array* _updatePool; int _dataLength; int _begin; @@ -228,10 +228,10 @@ protected: int _updateDataIndex; bool _updateSuccess; - Array* _overTopArray; - Array* _overBottomArray; - Array* _overLeftArray; - Array* _overRightArray; + cocos2d::Array* _overTopArray; + cocos2d::Array* _overBottomArray; + cocos2d::Array* _overLeftArray; + cocos2d::Array* _overRightArray; float _disBoundaryToChild_0; float _disBetweenChild; @@ -241,7 +241,7 @@ protected: /**/ }; -NS_CC_EXT_END +} #endif /* defined(__Test__UIListView__) */ diff --git a/cocos/gui/widgets/ScrollWidget/UIPageView.cpp b/cocos/gui/widgets/scroll-widget/UIPageView.cpp similarity index 99% rename from cocos/gui/widgets/ScrollWidget/UIPageView.cpp rename to cocos/gui/widgets/scroll-widget/UIPageView.cpp index 0313820ee7..000a6128c2 100644 --- a/cocos/gui/widgets/ScrollWidget/UIPageView.cpp +++ b/cocos/gui/widgets/scroll-widget/UIPageView.cpp @@ -24,7 +24,9 @@ #include "UIPageView.h" -NS_CC_EXT_BEGIN + using namespace cocos2d; + +namespace gui { UIPageView::UIPageView(): _curPageIdx(0), @@ -570,4 +572,4 @@ const char* UIPageView::getDescription() const return "PageView"; } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/gui/widgets/ScrollWidget/UIPageView.h b/cocos/gui/widgets/scroll-widget/UIPageView.h similarity index 84% rename from cocos/gui/widgets/ScrollWidget/UIPageView.h rename to cocos/gui/widgets/scroll-widget/UIPageView.h index 6644ce5cd0..ab19f5e8e5 100644 --- a/cocos/gui/widgets/ScrollWidget/UIPageView.h +++ b/cocos/gui/widgets/scroll-widget/UIPageView.h @@ -25,17 +25,17 @@ #ifndef __UIPAGEVIEW_H__ #define __UIPAGEVIEW_H__ -#include "../../Layouts/Layout.h" +#include "layouts/Layout.h" #include "UIScrollInterface.h" -NS_CC_EXT_BEGIN +namespace gui { typedef enum { PAGEVIEW_EVENT_TURNING, }PageViewEventType; -typedef void (Object::*SEL_PageViewEvent)(Object*, PageViewEventType); +typedef void (cocos2d::Object::*SEL_PageViewEvent)(cocos2d::Object*, PageViewEventType); #define pagevieweventselector(_SELECTOR)(SEL_PageViewEvent)(&_SELECTOR) typedef enum { @@ -116,7 +116,7 @@ public: int getCurPageIndex() const; // event - void addEventListener(Object *target, SEL_PageViewEvent selector); + void addEventListener(cocos2d::Object *target, SEL_PageViewEvent selector); //override "removeChild" method of widget. virtual bool removeChild(UIWidget* widget); @@ -125,16 +125,16 @@ public: virtual void removeAllChildren(); //override "onTouchBegan" method of widget. - virtual bool onTouchBegan(const Point &touchPoint); + virtual bool onTouchBegan(const cocos2d::Point &touchPoint); //override "onTouchMoved" method of widget. - virtual void onTouchMoved(const Point &touchPoint); + virtual void onTouchMoved(const cocos2d::Point &touchPoint); //override "onTouchEnded" method of widget. - virtual void onTouchEnded(const Point &touchPoint); + virtual void onTouchEnded(const cocos2d::Point &touchPoint); //override "onTouchCancelled" method of widget. - virtual void onTouchCancelled(const Point &touchPoint); + virtual void onTouchCancelled(const cocos2d::Point &touchPoint); //override "update" method of widget. virtual void update(float dt); @@ -151,11 +151,11 @@ protected: Layout* createPage(); float getPositionXByIndex(int idx); void updateBoundaryPages(); - virtual void handlePressLogic(const Point &touchPoint); - virtual void handleMoveLogic(const Point &touchPoint); - virtual void handleReleaseLogic(const Point &touchPoint); - virtual void interceptTouchEvent(int handleState, UIWidget* sender, const Point &touchPoint); - virtual void checkChildInfo(int handleState, UIWidget* sender, const Point &touchPoint); + virtual void handlePressLogic(const cocos2d::Point &touchPoint); + virtual void handleMoveLogic(const cocos2d::Point &touchPoint); + virtual void handleReleaseLogic(const cocos2d::Point &touchPoint); + virtual void interceptTouchEvent(int handleState, UIWidget* sender, const cocos2d::Point &touchPoint); + virtual void checkChildInfo(int handleState, UIWidget* sender, const cocos2d::Point &touchPoint); virtual bool scrollPages(float touchOffset); void movePages(float offset); void pageTurningEvent(); @@ -166,12 +166,12 @@ protected: virtual void setClippingEnabled(bool able){Layout::setClippingEnabled(able);}; protected: int _curPageIdx; - Array* _pages; + cocos2d::Array* _pages; PVTouchDir _touchMoveDir; float _touchStartLocation; float _touchEndLocation; float _touchMoveStartLocation; - Point _movePagePoint; + cocos2d::Point _movePagePoint; UIWidget* _leftChild; UIWidget* _rightChild; float _leftBoundary; @@ -181,10 +181,10 @@ protected: float _autoScrollSpeed; int _autoScrollDir; float _childFocusCancelOffset; - Object* _eventListener; + cocos2d::Object* _eventListener; SEL_PageViewEvent _eventSelector; }; -NS_CC_EXT_END +} #endif /* defined(__UIPageView__) */ diff --git a/cocos/gui/widgets/ScrollWidget/UIScrollInterface.h b/cocos/gui/widgets/scroll-widget/UIScrollInterface.h similarity index 82% rename from cocos/gui/widgets/ScrollWidget/UIScrollInterface.h rename to cocos/gui/widgets/scroll-widget/UIScrollInterface.h index df8566fc53..ffaa590309 100644 --- a/cocos/gui/widgets/ScrollWidget/UIScrollInterface.h +++ b/cocos/gui/widgets/scroll-widget/UIScrollInterface.h @@ -25,20 +25,20 @@ #ifndef __UISCROLLDELEGATE_H__ #define __UISCROLLDELEGATE_H__ -#include "../../BaseClasses/UIWidget.h" +#include "base-classes/UIWidget.h" -NS_CC_EXT_BEGIN +namespace gui { class UIScrollInterface { protected: - virtual void handlePressLogic(const Point &touchPoint) = 0; - virtual void handleMoveLogic(const Point &touchPoint) = 0; - virtual void handleReleaseLogic(const Point &touchPoint) = 0; - virtual void interceptTouchEvent(int handleState, UIWidget* sender, const Point &touchPoint) = 0; + virtual void handlePressLogic(const cocos2d::Point &touchPoint) = 0; + virtual void handleMoveLogic(const cocos2d::Point &touchPoint) = 0; + virtual void handleReleaseLogic(const cocos2d::Point &touchPoint) = 0; + virtual void interceptTouchEvent(int handleState, UIWidget* sender, const cocos2d::Point &touchPoint) = 0; // virtual bool isInScrollDegreeRange(UIWidget* widget) = 0; }; -NS_CC_EXT_END +} #endif /* defined(__UIScrollDelegate__) */ diff --git a/cocos/gui/widgets/ScrollWidget/UIScrollView.cpp b/cocos/gui/widgets/scroll-widget/UIScrollView.cpp similarity index 99% rename from cocos/gui/widgets/ScrollWidget/UIScrollView.cpp rename to cocos/gui/widgets/scroll-widget/UIScrollView.cpp index 4575c6b832..1de739a0f2 100644 --- a/cocos/gui/widgets/ScrollWidget/UIScrollView.cpp +++ b/cocos/gui/widgets/scroll-widget/UIScrollView.cpp @@ -23,9 +23,11 @@ ****************************************************************************/ #include "UIScrollView.h" -#include "../../System/UILayer.h" +#include "system/UILayer.h" -NS_CC_EXT_BEGIN + using namespace cocos2d; + +namespace gui { UIScrollView::UIScrollView(): _innerContainer(NULL), @@ -684,4 +686,4 @@ const char* UIScrollView::getDescription() const return "ScrollView"; } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/gui/widgets/ScrollWidget/UIScrollView.h b/cocos/gui/widgets/scroll-widget/UIScrollView.h similarity index 85% rename from cocos/gui/widgets/ScrollWidget/UIScrollView.h rename to cocos/gui/widgets/scroll-widget/UIScrollView.h index ecf56cadd7..30cc8a4f27 100644 --- a/cocos/gui/widgets/ScrollWidget/UIScrollView.h +++ b/cocos/gui/widgets/scroll-widget/UIScrollView.h @@ -25,10 +25,10 @@ #ifndef __UISCROLLVIEW_H__ #define __UISCROLLVIEW_H__ -#include "../../Layouts/Layout.h" +#include "layouts/Layout.h" #include "UIScrollInterface.h" -NS_CC_EXT_BEGIN +namespace gui { enum SCROLLVIEW_DIR { @@ -54,7 +54,7 @@ typedef enum SCROLLVIEW_EVENT_SCROLL_TO_RIGHT, }ScrollviewEventType; -typedef void (Object::*SEL_ScrollViewEvent)(Object*, ScrollviewEventType); +typedef void (cocos2d::Object::*SEL_ScrollViewEvent)(cocos2d::Object*, ScrollviewEventType); #define scrollvieweventselector(_SELECTOR) (SEL_ScrollViewEvent)(&_SELECTOR) @@ -120,7 +120,7 @@ public: * * @param inner container size. */ - void setInnerContainerSize(const Size &size); + void setInnerContainerSize(const cocos2d::Size &size); /** * Gets inner container size of scrollview. @@ -129,12 +129,12 @@ public: * * @return inner container size. */ - const Size& getInnerContainerSize() const; + const cocos2d::Size& getInnerContainerSize() const; /** * Add call back function called scrollview event triggered */ - void addEventListener(Object* target, SEL_ScrollViewEvent selector); + void addEventListener(cocos2d::Object* target, SEL_ScrollViewEvent selector); //override "addChild" method of widget. virtual bool addChild(UIWidget* widget); @@ -146,22 +146,22 @@ public: virtual bool removeChild(UIWidget* child); //override "getChildren" method of widget. - virtual Array* getChildren(); + virtual cocos2d::Array* getChildren(); //override "onTouchBegan" method of widget. - virtual bool onTouchBegan(const Point &touchPoint); + virtual bool onTouchBegan(const cocos2d::Point &touchPoint); //override "onTouchMoved" method of widget. - virtual void onTouchMoved(const Point &touchPoint); + virtual void onTouchMoved(const cocos2d::Point &touchPoint); //override "onTouchEnded" method of widget. - virtual void onTouchEnded(const Point &touchPoint); + virtual void onTouchEnded(const cocos2d::Point &touchPoint); //override "onTouchCancelled" method of widget. - virtual void onTouchCancelled(const Point &touchPoint); + virtual void onTouchCancelled(const cocos2d::Point &touchPoint); //override "onTouchLongClicked" method of widget. - virtual void onTouchLongClicked(const Point &touchPoint); + virtual void onTouchLongClicked(const cocos2d::Point &touchPoint); virtual void update(float dt); @@ -200,11 +200,11 @@ protected: virtual bool scrollChildren(float touchOffset); void startRecordSlidAction(); virtual void endRecordSlidAction(); - virtual void handlePressLogic(const Point &touchPoint); - virtual void handleMoveLogic(const Point &touchPoint); - virtual void handleReleaseLogic(const Point &touchPoint); - virtual void interceptTouchEvent(int handleState,UIWidget* sender,const Point &touchPoint); - virtual void checkChildInfo(int handleState,UIWidget* sender,const Point &touchPoint); + virtual void handlePressLogic(const cocos2d::Point &touchPoint); + virtual void handleMoveLogic(const cocos2d::Point &touchPoint); + virtual void handleReleaseLogic(const cocos2d::Point &touchPoint); + virtual void interceptTouchEvent(int handleState,UIWidget* sender,const cocos2d::Point &touchPoint); + virtual void checkChildInfo(int handleState,UIWidget* sender,const cocos2d::Point &touchPoint); void recordSlidTime(float dt); //override "releaseResoures" method of widget. virtual void releaseResoures(); @@ -242,14 +242,14 @@ protected: bool _bePressed; float _slidTime; - Point _moveChildPoint; + cocos2d::Point _moveChildPoint; float _childFocusCancelOffset; - Object* _eventListener; + cocos2d::Object* _eventListener; SEL_ScrollViewEvent _eventSelector; }; -NS_CC_EXT_END +} #endif /* defined(__CocoGUI__UIScrollView__) */ diff --git a/cocos/network/Android.mk b/cocos/network/Android.mk new file mode 100644 index 0000000000..c6b158aef4 --- /dev/null +++ b/cocos/network/Android.mk @@ -0,0 +1,28 @@ +LOCAL_PATH := $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_MODULE := network_static + +LOCAL_MODULE_FILENAME := libnetwork + +LOCAL_SRC_FILES := HttpClient.cpp \ +SocketIO.cpp \ +WebSocket.cpp + + +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) + +LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../2d + +LOCAL_CFLAGS += -Wno-psabi +LOCAL_EXPORT_CFLAGS += -Wno-psabi + +LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocos_curl_static +LOCAL_WHOLE_STATIC_LIBRARIES += libwebsockets_static + +include $(BUILD_STATIC_LIBRARY) + +$(call import-module,2d) +$(call import-module,curl/prebuilt/android) +$(call import-module, websockets/prebuilt/android) diff --git a/cocos/network/HttpClient.cpp b/cocos/network/HttpClient.cpp index 252102fcab..e2ecc1c80c 100644 --- a/cocos/network/HttpClient.cpp +++ b/cocos/network/HttpClient.cpp @@ -32,7 +32,9 @@ #include "platform/CCFileUtils.h" -NS_CC_EXT_BEGIN + using namespace cocos2d; + +namespace network { static std::mutex s_requestQueueMutex; static std::mutex s_responseQueueMutex; @@ -514,6 +516,6 @@ void HttpClient::dispatchResponseCallbacks(float delta) } -NS_CC_EXT_END +} diff --git a/cocos/network/HttpClient.h b/cocos/network/HttpClient.h index b41ba226be..919e06f872 100644 --- a/cocos/network/HttpClient.h +++ b/cocos/network/HttpClient.h @@ -27,12 +27,12 @@ #define __CCHTTPREQUEST_H__ #include "cocos2d.h" -#include "ExtensionMacros.h" #include "HttpRequest.h" #include "HttpResponse.h" + #include "HttpClient.h" -NS_CC_EXT_BEGIN +namespace network { /** * @addtogroup Network @@ -43,7 +43,7 @@ NS_CC_EXT_BEGIN /** @brief Singleton that handles asynchrounous http requests * Once the request completed, a callback will issued in main thread when it provided during make request */ -class HttpClient : public Object +class HttpClient : public cocos2d::Object { public: /** Return the shared instance **/ @@ -112,6 +112,6 @@ private: // end of Network group /// @} -NS_CC_EXT_END +} #endif //__CCHTTPREQUEST_H__ diff --git a/cocos/network/HttpRequest.h b/cocos/network/HttpRequest.h index 0bf8d82eb5..273a87b53e 100644 --- a/cocos/network/HttpRequest.h +++ b/cocos/network/HttpRequest.h @@ -26,14 +26,13 @@ #define __HTTP_REQUEST_H__ #include "cocos2d.h" -#include "ExtensionMacros.h" -NS_CC_EXT_BEGIN +namespace network { class HttpClient; class HttpResponse; -typedef void (Object::*SEL_HttpResponse)(HttpClient* client, HttpResponse* response); -#define httpresponse_selector(_SELECTOR) (cocos2d::extension::SEL_HttpResponse)(&_SELECTOR) +typedef void (cocos2d::Object::*SEL_HttpResponse)(HttpClient* client, HttpResponse* response); +#define httpresponse_selector(_SELECTOR) (SEL_HttpResponse)(&_SELECTOR) /** @brief defines the object which users must packed for HttpClient::send(HttpRequest*) method. @@ -41,7 +40,7 @@ typedef void (Object::*SEL_HttpResponse)(HttpClient* client, HttpResponse* respo @since v2.0.2 */ -class HttpRequest : public Object +class HttpRequest : public cocos2d::Object { public: /** Use this enum type as param in setReqeustType(param) */ @@ -81,7 +80,7 @@ public: }; /** Override autorelease method to avoid developers to call it */ - Object* autorelease(void) + cocos2d::Object* autorelease(void) { CCASSERT(false, "HttpResponse is used between network thread and ui thread \ therefore, autorelease is forbidden here"); @@ -163,12 +162,12 @@ public: /** Required field. You should set the callback selector function at ack the http request completed */ - CC_DEPRECATED_ATTRIBUTE inline void setResponseCallback(Object* pTarget, SEL_CallFuncND pSelector) + CC_DEPRECATED_ATTRIBUTE inline void setResponseCallback(cocos2d::Object* pTarget, cocos2d::SEL_CallFuncND pSelector) { setResponseCallback(pTarget, (SEL_HttpResponse) pSelector); } - inline void setResponseCallback(Object* pTarget, SEL_HttpResponse pSelector) + inline void setResponseCallback(cocos2d::Object* pTarget, SEL_HttpResponse pSelector) { _pTarget = pTarget; _pSelector = pSelector; @@ -179,7 +178,7 @@ public: } } /** Get the target of callback selector funtion, mainly used by HttpClient */ - inline Object* getTarget() + inline cocos2d::Object* getTarget() { return _pTarget; } @@ -192,7 +191,7 @@ public: _prxy( SEL_HttpResponse cb ) :_cb(cb) {} ~_prxy(){}; operator SEL_HttpResponse() const { return _cb; } - CC_DEPRECATED_ATTRIBUTE operator SEL_CallFuncND() const { return (SEL_CallFuncND) _cb; } + CC_DEPRECATED_ATTRIBUTE operator cocos2d::SEL_CallFuncND() const { return (cocos2d::SEL_CallFuncND) _cb; } protected: SEL_HttpResponse _cb; }; @@ -221,12 +220,12 @@ protected: std::string _url; /// target url that this request is sent to std::vector _requestData; /// used for POST std::string _tag; /// user defined tag, to identify different requests in response callback - Object* _pTarget; /// callback target of pSelector function + cocos2d::Object* _pTarget; /// callback target of pSelector function SEL_HttpResponse _pSelector; /// callback function, e.g. MyLayer::onHttpResponse(HttpClient *sender, HttpResponse * response) void* _pUserData; /// You can add your customed data here std::vector _headers; /// custom http headers }; -NS_CC_EXT_END +} #endif //__HTTP_REQUEST_H__ diff --git a/cocos/network/HttpResponse.h b/cocos/network/HttpResponse.h index 3d6a848a4e..2a16fc4d52 100644 --- a/cocos/network/HttpResponse.h +++ b/cocos/network/HttpResponse.h @@ -26,17 +26,16 @@ #define __HTTP_RESPONSE__ #include "cocos2d.h" -#include "ExtensionMacros.h" #include "HttpRequest.h" -NS_CC_EXT_BEGIN +namespace network { /** @brief defines the object which users will receive at onHttpCompleted(sender, HttpResponse) callback Please refer to samples/TestCpp/Classes/ExtensionTest/NetworkTest/HttpClientTest.cpp as a sample @since v2.0.2 */ -class HttpResponse : public Object +class HttpResponse : public cocos2d::Object { public: /** Constructor, it's used by HttpClient internal, users don't need to create HttpResponse manually @@ -67,7 +66,7 @@ public: } /** Override autorelease method to prevent developers from calling it */ - Object* autorelease(void) + cocos2d::Object* autorelease(void) { CCASSERT(false, "HttpResponse is used between network thread and ui thread \ therefore, autorelease is forbidden here"); @@ -178,6 +177,6 @@ protected: }; -NS_CC_EXT_END +} #endif //__HTTP_RESPONSE_H__ diff --git a/cocos/network/SocketIO.cpp b/cocos/network/SocketIO.cpp index 7510ce8d74..bb9acff3e1 100644 --- a/cocos/network/SocketIO.cpp +++ b/cocos/network/SocketIO.cpp @@ -28,11 +28,13 @@ ****************************************************************************/ #include "SocketIO.h" -#include "cocos-ext.h" -#include "network/WebSocket.h" +#include "WebSocket.h" +#include "HttpClient.h" #include -NS_CC_EXT_BEGIN +using namespace cocos2d; + +namespace network { //class declarations @@ -41,7 +43,7 @@ NS_CC_EXT_BEGIN * Clients/endpoints may share the same impl to accomplish multiplexing on the same websocket */ class SIOClientImpl : - public Object, + public cocos2d::Object, public WebSocket::Delegate { private: @@ -51,7 +53,7 @@ private: WebSocket *_ws; - Dictionary* _clients; + cocos2d::Dictionary* _clients; public: SIOClientImpl(const std::string& host, int port); @@ -59,10 +61,10 @@ public: static SIOClientImpl* create(const std::string& host, int port); - virtual void onOpen(cocos2d::extension::WebSocket* ws); - virtual void onMessage(cocos2d::extension::WebSocket* ws, const cocos2d::extension::WebSocket::Data& data); - virtual void onClose(cocos2d::extension::WebSocket* ws); - virtual void onError(cocos2d::extension::WebSocket* ws, const cocos2d::extension::WebSocket::ErrorCode& error); + virtual void onOpen(WebSocket* ws); + virtual void onMessage(WebSocket* ws, const WebSocket::Data& data); + virtual void onClose(WebSocket* ws); + virtual void onError(WebSocket* ws, const WebSocket::ErrorCode& error); void connect(); void disconnect(); @@ -350,7 +352,7 @@ void SIOClientImpl::emit(std::string endpoint, std::string eventname, std::strin _ws->send(msg); } -void SIOClientImpl::onOpen(cocos2d::extension::WebSocket* ws) +void SIOClientImpl::onOpen(WebSocket* ws) { _connected = true; @@ -370,7 +372,7 @@ void SIOClientImpl::onOpen(cocos2d::extension::WebSocket* ws) log("SIOClientImpl::onOpen socket connected!"); } -void SIOClientImpl::onMessage(cocos2d::extension::WebSocket* ws, const cocos2d::extension::WebSocket::Data& data) +void SIOClientImpl::onMessage(WebSocket* ws, const WebSocket::Data& data) { log("SIOClientImpl::onMessage received: %s", data.bytes); @@ -467,7 +469,7 @@ void SIOClientImpl::onMessage(cocos2d::extension::WebSocket* ws, const cocos2d:: return; } -void SIOClientImpl::onClose(cocos2d::extension::WebSocket* ws) +void SIOClientImpl::onClose(WebSocket* ws) { if(_clients->count() > 0) { @@ -484,7 +486,7 @@ void SIOClientImpl::onClose(cocos2d::extension::WebSocket* ws) this->release(); } -void SIOClientImpl::onError(cocos2d::extension::WebSocket* ws, const cocos2d::extension::WebSocket::ErrorCode& error) +void SIOClientImpl::onError(WebSocket* ws, const WebSocket::ErrorCode& error) { } @@ -698,4 +700,4 @@ void SocketIO::removeSocket(const std::string& uri) _sockets->removeObjectForKey(uri); } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/network/SocketIO.h b/cocos/network/SocketIO.h index 23badd8907..5ec76bcb9b 100644 --- a/cocos/network/SocketIO.h +++ b/cocos/network/SocketIO.h @@ -59,10 +59,9 @@ 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 "ExtensionMacros.h" #include "cocos2d.h" -NS_CC_EXT_BEGIN +namespace network { //forward declarations class SIOClientImpl; @@ -104,7 +103,7 @@ private: static SocketIO *_inst; - Dictionary* _sockets; + cocos2d::Dictionary* _sockets; SIOClientImpl* getSocket(const std::string& uri); void addSocket(const std::string& uri, SIOClientImpl* socket); @@ -123,7 +122,7 @@ typedef std::map EventRegistry; * @brief A single connection to a socket.io endpoint */ class SIOClient - : public Object + : public cocos2d::Object { private: int _port; @@ -182,6 +181,6 @@ public: }; -NS_CC_EXT_END +} #endif /* defined(__CC_JSB_SOCKETIO_H__) */ diff --git a/cocos/network/WebSocket.cpp b/cocos/network/WebSocket.cpp index 46ef29641a..883c1d8554 100644 --- a/cocos/network/WebSocket.cpp +++ b/cocos/network/WebSocket.cpp @@ -37,7 +37,9 @@ #include "libwebsockets.h" -NS_CC_EXT_BEGIN +using namespace cocos2d; + +namespace network { class WsMessage { @@ -645,4 +647,4 @@ void WebSocket::onUIThreadReceiveMessage(WsMessage* msg) } } -NS_CC_EXT_END +} diff --git a/cocos/network/WebSocket.h b/cocos/network/WebSocket.h index 8256dc5ebd..da9a497b71 100644 --- a/cocos/network/WebSocket.h +++ b/cocos/network/WebSocket.h @@ -30,7 +30,6 @@ #ifndef __CC_WEBSOCKET_H__ #define __CC_WEBSOCKET_H__ -#include "ExtensionMacros.h" #include "cocos2d.h" #include @@ -38,7 +37,7 @@ struct libwebsocket; struct libwebsocket_context; struct libwebsocket_protocols; -NS_CC_EXT_BEGIN +namespace network { class WsThreadHelper; class WsMessage; @@ -162,6 +161,6 @@ private: struct libwebsocket_protocols* _wsProtocols; }; -NS_CC_EXT_END +} #endif /* defined(__CC_JSB_WEBSOCKET_H__) */ diff --git a/cocos/storage/local-storage/Android.mk b/cocos/storage/local-storage/Android.mk new file mode 100644 index 0000000000..67db9c191b --- /dev/null +++ b/cocos/storage/local-storage/Android.mk @@ -0,0 +1,19 @@ +LOCAL_PATH := $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_MODULE := localstorage_static + +LOCAL_MODULE_FILENAME := liblocalstorage + +LOCAL_SRC_FILES := LocalStorage.cpp +LocalStorageAndroid.cpp \ + + +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) + +LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../2d + +LOCAL_CFLAGS += -Wno-psabi +LOCAL_EXPORT_CFLAGS += -Wno-psabi + +include $(BUILD_STATIC_LIBRARY) diff --git a/extensions/Android.mk b/extensions/Android.mk index 6a5bf063d7..ce0ddb9bb8 100644 --- a/extensions/Android.mk +++ b/extensions/Android.mk @@ -6,7 +6,6 @@ LOCAL_MODULE := cocos_extension_static LOCAL_MODULE_FILENAME := libextension LOCAL_SRC_FILES := \ -$(LOCAL_PATH)/CCDeprecated-ext.cpp \ $(LOCAL_PATH)/assets-manager/AssetsManager.cpp \ $(LOCAL_PATH)/GUI/CCControlExtension/CCControl.cpp \ $(LOCAL_PATH)/GUI/CCControlExtension/CCControlButton.cpp \ @@ -47,15 +46,12 @@ LOCAL_EXPORT_CFLAGS += -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) \ $(LOCAL_PATH)/CCBReader \ $(LOCAL_PATH)/GUI/CCControlExtension \ - $(LOCAL_PATH)/GUI/CCScrollView \ - $(LOCAL_PATH)/network \ - $(LOCAL_PATH)/LocalStorage + $(LOCAL_PATH)/GUI/CCScrollView include $(BUILD_STATIC_LIBRARY) -$(call import-module,cocos2dx) +$(call import-module,2d) $(call import-module,audio/android) -$(call import-module,cocos2dx/platform/third_party/android/prebuilt/libcurl) -$(call import-module,external/Box2D) -$(call import-module,external/chipmunk) -$(call import-module,external/libwebsockets/android) +$(call import-module,Box2D) +$(call import-module,chipmunk) +$(call import-module,websockets/prebuilt/android) diff --git a/extensions/CCDeprecated-ext.cpp b/extensions/CCDeprecated-ext.cpp deleted file mode 100644 index 383fe7bf00..0000000000 --- a/extensions/CCDeprecated-ext.cpp +++ /dev/null @@ -1,31 +0,0 @@ -/**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - 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 "cocos-ext.h" - -NS_CC_EXT_BEGIN - - - -NS_CC_EXT_END diff --git a/extensions/CCDeprecated-ext.h b/extensions/CCDeprecated-ext.h deleted file mode 100644 index 5aded2b4f4..0000000000 --- a/extensions/CCDeprecated-ext.h +++ /dev/null @@ -1,278 +0,0 @@ -/**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - 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. - ****************************************************************************/ - -/** Add deprecated global functions and variables here - */ - -#ifndef COCOS2D_CCDEPRECATED_EXT_H__ -#define COCOS2D_CCDEPRECATED_EXT_H__ - -NS_CC_EXT_BEGIN - -CC_DEPRECATED_ATTRIBUTE typedef TableView CCTableView; -CC_DEPRECATED_ATTRIBUTE typedef TableViewCell CCTableViewCell; -CC_DEPRECATED_ATTRIBUTE typedef TableViewDelegate CCTableViewDelegate; -CC_DEPRECATED_ATTRIBUTE typedef TableViewDataSource CCTableViewDataSource; -CC_DEPRECATED_ATTRIBUTE typedef TableView CCTableView; -CC_DEPRECATED_ATTRIBUTE typedef ScrollView CCScrollView; -CC_DEPRECATED_ATTRIBUTE typedef ScrollViewDelegate CCScrollViewDelegate; -CC_DEPRECATED_ATTRIBUTE typedef ScrollView CCScrollView; -CC_DEPRECATED_ATTRIBUTE typedef SortableObject CCSortableObject; -CC_DEPRECATED_ATTRIBUTE typedef ArrayForObjectSorting CCArrayForObjectSorting; -CC_DEPRECATED_ATTRIBUTE typedef TableViewCell CCTableViewCell; -CC_DEPRECATED_ATTRIBUTE typedef EditBox CCEditBox; -CC_DEPRECATED_ATTRIBUTE typedef EditBoxDelegate CCEditBoxDelegate; - -CC_DEPRECATED_ATTRIBUTE typedef Color3bObject CCColor3bObject; -CC_DEPRECATED_ATTRIBUTE typedef ControlUtils CCControlUtils; -CC_DEPRECATED_ATTRIBUTE typedef Scale9Sprite CCScale9Sprite; -CC_DEPRECATED_ATTRIBUTE typedef ControlSwitchSprite CCControlSwitchSprite; -CC_DEPRECATED_ATTRIBUTE typedef ControlHuePicker CCControlHuePicker; -CC_DEPRECATED_ATTRIBUTE typedef Invocation CCInvocation; -CC_DEPRECATED_ATTRIBUTE typedef ControlSaturationBrightnessPicker CCControlSaturationBrightnessPicker; -CC_DEPRECATED_ATTRIBUTE typedef ControlStepper CCControlStepper; -CC_DEPRECATED_ATTRIBUTE typedef ControlPotentiometer CCControlPotentiometer; -CC_DEPRECATED_ATTRIBUTE typedef ControlSwitchSprite CCControlSwitchSprite; -CC_DEPRECATED_ATTRIBUTE typedef ControlSwitch CCControlSwitch; -CC_DEPRECATED_ATTRIBUTE typedef ControlButton CCControlButton; -CC_DEPRECATED_ATTRIBUTE typedef ControlSlider CCControlSlider; -CC_DEPRECATED_ATTRIBUTE typedef Control CCControl; -CC_DEPRECATED_ATTRIBUTE typedef ControlLoader CCControlLoader; -CC_DEPRECATED_ATTRIBUTE typedef ControlColourPicker CCControlColourPicker; - -CC_DEPRECATED_ATTRIBUTE typedef LabelBMFontLoader CCLabelBMFontLoader; -CC_DEPRECATED_ATTRIBUTE typedef ScrollViewLoader CCScrollViewLoader; -CC_DEPRECATED_ATTRIBUTE typedef SpriteLoader CCSpriteLoader; -CC_DEPRECATED_ATTRIBUTE typedef NodeLoader CCNodeLoader; -CC_DEPRECATED_ATTRIBUTE typedef NodeLoaderLibrary CCNodeLoaderLibrary; -CC_DEPRECATED_ATTRIBUTE typedef NodeLoaderListener CCNodeLoaderListener; -CC_DEPRECATED_ATTRIBUTE typedef LayerLoader CCLayerLoader; -CC_DEPRECATED_ATTRIBUTE typedef MenuLoader CCMenuLoader; -CC_DEPRECATED_ATTRIBUTE typedef Color3BWapper CCColor3BWapper; -CC_DEPRECATED_ATTRIBUTE typedef ParticleSystemQuadLoader CCParticleSystemQuadLoader; -CC_DEPRECATED_ATTRIBUTE typedef MenuItemImageLoader CCMenuItemImageLoader; -CC_DEPRECATED_ATTRIBUTE typedef ControlButtonLoader CCControlButtonLoader; -CC_DEPRECATED_ATTRIBUTE typedef LayerGradientLoader CCLayerGradientLoader; -CC_DEPRECATED_ATTRIBUTE typedef Scale9SpriteLoader CCScale9SpriteLoader; -CC_DEPRECATED_ATTRIBUTE typedef NodeLoaderLibrary CCNodeLoaderLibrary; -CC_DEPRECATED_ATTRIBUTE typedef MenuItemLoader CCMenuItemLoader; -CC_DEPRECATED_ATTRIBUTE typedef LayerColorLoader CCLayerColorLoader; -CC_DEPRECATED_ATTRIBUTE typedef LabelTTFLoader CCLabelTTFLoader; - - -#if CC_ENABLE_BOX2D_INTEGRATION || CC_ENABLE_CHIPMUNK_INTEGRATION -CC_DEPRECATED_ATTRIBUTE typedef PhysicsSprite CCPhysicsSprite; -#endif - -#if CC_ENABLE_CHIPMUNK_INTEGRATION -CC_DEPRECATED_ATTRIBUTE typedef PhysicsDebugNode CCPhysicsDebugNode; -#endif - -CC_DEPRECATED_ATTRIBUTE typedef ComController CCComController; -CC_DEPRECATED_ATTRIBUTE typedef ComAttribute CCComAttribute; -CC_DEPRECATED_ATTRIBUTE typedef InputDelegate CCInputDelegate; -CC_DEPRECATED_ATTRIBUTE typedef ComAudio CCComAudio; - -CC_DEPRECATED_ATTRIBUTE typedef HttpClient CCHttpClient; -CC_DEPRECATED_ATTRIBUTE typedef HttpResponse CCHttpResponse; -CC_DEPRECATED_ATTRIBUTE typedef HttpRequest CCHttpRequest; -CC_DEPRECATED_ATTRIBUTE typedef Skin CCSkin; - -CC_DEPRECATED_ATTRIBUTE typedef AtlasFormat CCAtlasFormat; -CC_DEPRECATED_ATTRIBUTE typedef AtlasFilter CCAtlasFilter; -CC_DEPRECATED_ATTRIBUTE typedef AtlasWrap CCAtlasWrap; -CC_DEPRECATED_ATTRIBUTE typedef AtlasPage CCAtlasPage; -CC_DEPRECATED_ATTRIBUTE typedef AtlasRegion CCAtlasRegion; -CC_DEPRECATED_ATTRIBUTE typedef Atlas CCAtlas; -CC_DEPRECATED_ATTRIBUTE typedef AnimationStateData CCAnimationStateData; -CC_DEPRECATED_ATTRIBUTE typedef SlotData CCSlotData; -CC_DEPRECATED_ATTRIBUTE typedef AttachmentLoader CCAttachmentLoader; -CC_DEPRECATED_ATTRIBUTE typedef AnimationState CCAnimationState; -CC_DEPRECATED_ATTRIBUTE typedef SkeletonJson CCSkeletonJson; -CC_DEPRECATED_ATTRIBUTE typedef Timeline CCTimeline; -CC_DEPRECATED_ATTRIBUTE typedef CurveTimeline CCCurveTimeline; -CC_DEPRECATED_ATTRIBUTE typedef RotateTimeline CCRotateTimeline; -CC_DEPRECATED_ATTRIBUTE typedef TranslateTimeline CCTranslateTimeline; -CC_DEPRECATED_ATTRIBUTE typedef ScaleTimeline CCScaleTimeline; -CC_DEPRECATED_ATTRIBUTE typedef ColorTimeline CCColorTimeline; -CC_DEPRECATED_ATTRIBUTE typedef AttachmentTimeline CCAttachmentTimeline; -CC_DEPRECATED_ATTRIBUTE typedef AtlasAttachmentLoader CCAtlasAttachmentLoader; -CC_DEPRECATED_ATTRIBUTE typedef VertexIndex CCVertexIndex; -CC_DEPRECATED_ATTRIBUTE typedef RegionAttachment CCRegionAttachment; - -CC_DEPRECATED_ATTRIBUTE typedef NodeLoaderMap CCNodeLoaderMap; -CC_DEPRECATED_ATTRIBUTE typedef NodeLoaderMapEntry CCNodeLoaderMapEntry; -CC_DEPRECATED_ATTRIBUTE typedef EventRegistry CCEventRegistry; -CC_DEPRECATED_ATTRIBUTE typedef AttachmentType CCAttachmentType; - - -CC_DEPRECATED_ATTRIBUTE const ScrollView::Direction kCCScrollViewDirectionNone = ScrollView::Direction::NONE; -CC_DEPRECATED_ATTRIBUTE const ScrollView::Direction kCCScrollViewDirectionHorizontal = ScrollView::Direction::HORIZONTAL; -CC_DEPRECATED_ATTRIBUTE const ScrollView::Direction kCCScrollViewDirectionVertical = ScrollView::Direction::VERTICAL; -CC_DEPRECATED_ATTRIBUTE const ScrollView::Direction kCCScrollViewDirectionBoth = ScrollView::Direction::BOTH; -CC_DEPRECATED_ATTRIBUTE typedef ScrollView::Direction CCScrollViewDirection; - -CC_DEPRECATED_ATTRIBUTE const TableView::VerticalFillOrder kCCTableViewFillTopDown = TableView::VerticalFillOrder::TOP_DOWN; -CC_DEPRECATED_ATTRIBUTE const TableView::VerticalFillOrder kCCTableViewFillBottomUp = TableView::VerticalFillOrder::BOTTOM_UP; -CC_DEPRECATED_ATTRIBUTE typedef TableView::VerticalFillOrder CCTableViewVerticalFillOrder; - -CC_DEPRECATED_ATTRIBUTE const EditBox::KeyboardReturnType kKeyboardReturnTypeDefault = EditBox::KeyboardReturnType::DEFAULT; -CC_DEPRECATED_ATTRIBUTE const EditBox::KeyboardReturnType kKeyboardReturnTypeDone = EditBox::KeyboardReturnType::DONE; -CC_DEPRECATED_ATTRIBUTE const EditBox::KeyboardReturnType kKeyboardReturnTypeSend = EditBox::KeyboardReturnType::SEND; -CC_DEPRECATED_ATTRIBUTE const EditBox::KeyboardReturnType kKeyboardReturnTypeSearch = EditBox::KeyboardReturnType::SEARCH; -CC_DEPRECATED_ATTRIBUTE const EditBox::KeyboardReturnType kKeyboardReturnTypeGo = EditBox::KeyboardReturnType::GO; - -CC_DEPRECATED_ATTRIBUTE const EditBox::InputMode kEditBoxInputModeAny = EditBox::InputMode::ANY; -CC_DEPRECATED_ATTRIBUTE const EditBox::InputMode kEditBoxInputModeEmailAddr = EditBox::InputMode::EMAIL_ADDRESS; -CC_DEPRECATED_ATTRIBUTE const EditBox::InputMode kEditBoxInputModeNumeric = EditBox::InputMode::NUMERIC; -CC_DEPRECATED_ATTRIBUTE const EditBox::InputMode kEditBoxInputModePhoneNumber = EditBox::InputMode::PHONE_NUMBER; -CC_DEPRECATED_ATTRIBUTE const EditBox::InputMode kEditBoxInputModeUrl = EditBox::InputMode::URL; -CC_DEPRECATED_ATTRIBUTE const EditBox::InputMode kEditBoxInputModeDecimal = EditBox::InputMode::DECIMAL; -CC_DEPRECATED_ATTRIBUTE const EditBox::InputMode kEditBoxInputModeSingleLine = EditBox::InputMode::SINGLE_LINE; - -CC_DEPRECATED_ATTRIBUTE const EditBox::InputFlag kEditBoxInputFlagPassword = EditBox::InputFlag::PASSWORD; -CC_DEPRECATED_ATTRIBUTE const EditBox::InputFlag kEditBoxInputFlagSensitive = EditBox::InputFlag::SENSITIVE; -CC_DEPRECATED_ATTRIBUTE const EditBox::InputFlag kEditBoxInputFlagInitialCapsWord = EditBox::InputFlag::INITIAL_CAPS_WORD; -CC_DEPRECATED_ATTRIBUTE const EditBox::InputFlag kEditBoxInputFlagInitialCapsSentence = EditBox::InputFlag::INITIAL_CAPS_SENTENCE; -CC_DEPRECATED_ATTRIBUTE const EditBox::InputFlag kEditBoxInputFlagInitialCapsAllCharacters = EditBox::InputFlag::INTIAL_CAPS_ALL_CHARACTERS; - -CC_DEPRECATED_ATTRIBUTE typedef EditBox::KeyboardReturnType KeyboardReturnType; -CC_DEPRECATED_ATTRIBUTE typedef EditBox::InputMode EditBoxInputMode; -CC_DEPRECATED_ATTRIBUTE typedef EditBox::InputFlag EditBoxInputFlag; - -CC_DEPRECATED_ATTRIBUTE typedef ControlStepper::Part ControlStepperPart; -CC_DEPRECATED_ATTRIBUTE const ControlStepper::Part kCCControlStepperPartMinus = ControlStepper::Part::MINUS; -CC_DEPRECATED_ATTRIBUTE const ControlStepper::Part kCCControlStepperPartPlus = ControlStepper::Part::PLUS; -CC_DEPRECATED_ATTRIBUTE const ControlStepper::Part kCCControlStepperPartNone = ControlStepper::Part::NONE; - -CC_DEPRECATED_ATTRIBUTE const Control::EventType CCControlEventTouchDown = Control::EventType::TOUCH_DOWN; -CC_DEPRECATED_ATTRIBUTE const Control::EventType CCControlEventTouchDragInside = Control::EventType::DRAG_INSIDE; -CC_DEPRECATED_ATTRIBUTE const Control::EventType CCControlEventTouchDragOutside = Control::EventType::DRAG_OUTSIDE; -CC_DEPRECATED_ATTRIBUTE const Control::EventType CCControlEventTouchDragEnter = Control::EventType::DRAG_ENTER; -CC_DEPRECATED_ATTRIBUTE const Control::EventType CCControlEventTouchDragExit = Control::EventType::DRAG_EXIT; -CC_DEPRECATED_ATTRIBUTE const Control::EventType CCControlEventTouchUpInside = Control::EventType::TOUCH_UP_INSIDE; -CC_DEPRECATED_ATTRIBUTE const Control::EventType CCControlEventTouchUpOutside = Control::EventType::TOUCH_UP_OUTSIDE; -CC_DEPRECATED_ATTRIBUTE const Control::EventType CCControlEventTouchCancel = Control::EventType::TOUCH_CANCEL; -CC_DEPRECATED_ATTRIBUTE const Control::EventType CCControlEventValueChanged = Control::EventType::VALUE_CHANGED; - -CC_DEPRECATED_ATTRIBUTE typedef Control::EventType CCControlEvent; - -CC_DEPRECATED_ATTRIBUTE const Control::State CCControlStateNormal = Control::State::NORMAL; -CC_DEPRECATED_ATTRIBUTE const Control::State CCControlStateHighlighted = Control::State::HIGH_LIGHTED; -CC_DEPRECATED_ATTRIBUTE const Control::State CCControlStateDisabled = Control::State::DISABLED; -CC_DEPRECATED_ATTRIBUTE const Control::State CCControlStateSelected = Control::State::SELECTED; -CC_DEPRECATED_ATTRIBUTE typedef Control::State CCControlState; - -CC_DEPRECATED_ATTRIBUTE typedef Control::Handler SEL_CCControlHandler; - -// For CCBReader - -CC_DEPRECATED_ATTRIBUTE const CCBValue::Type kIntValue = CCBValue::Type::INT; -CC_DEPRECATED_ATTRIBUTE const CCBValue::Type kFloatValue = CCBValue::Type::FLOAT; -CC_DEPRECATED_ATTRIBUTE const CCBValue::Type kBoolValue = CCBValue::Type::BOOL; -CC_DEPRECATED_ATTRIBUTE const CCBValue::Type kUnsignedCharValue = CCBValue::Type::UNSIGNED_CHAR; -CC_DEPRECATED_ATTRIBUTE const CCBValue::Type kStringValue = CCBValue::Type::STRING; -CC_DEPRECATED_ATTRIBUTE const CCBValue::Type kArrayValue = CCBValue::Type::ARRAY; - - -CC_DEPRECATED_ATTRIBUTE const CCBReader::PropertyType kCCBPropTypePosition = CCBReader::PropertyType::POSITION; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PropertyType kCCBPropTypeSize = CCBReader::PropertyType::SIZE; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PropertyType kCCBPropTypePoint = CCBReader::PropertyType::POINT; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PropertyType kCCBPropTypePointLock = CCBReader::PropertyType::POINT_LOCK; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PropertyType kCCBPropTypeScaleLock = CCBReader::PropertyType::SCALE_LOCK; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PropertyType kCCBPropTypeDegrees = CCBReader::PropertyType::DEGREES; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PropertyType kCCBPropTypeInteger = CCBReader::PropertyType::INTEGER; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PropertyType kCCBPropTypeFloat = CCBReader::PropertyType::FLOAT; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PropertyType kCCBPropTypeFloatVar = CCBReader::PropertyType::FLOAT_VAR; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PropertyType kCCBPropTypeCheck = CCBReader::PropertyType::CHECK; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PropertyType kCCBPropTypeSpriteFrame = CCBReader::PropertyType::SPRITEFRAME; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PropertyType kCCBPropTypeTexture = CCBReader::PropertyType::TEXTURE; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PropertyType kCCBPropTypeByte = CCBReader::PropertyType::BYTE; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PropertyType kCCBPropTypeColor3 = CCBReader::PropertyType::COLOR3; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PropertyType kCCBPropTypeColor4FVar = CCBReader::PropertyType::COLOR4F_VAR; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PropertyType kCCBPropTypeFlip = CCBReader::PropertyType::FLIP; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PropertyType kCCBPropTypeBlendmode = CCBReader::PropertyType::BLEND_MODE; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PropertyType kCCBPropTypeFntFile = CCBReader::PropertyType::FNT_FILE; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PropertyType kCCBPropTypeText = CCBReader::PropertyType::TEXT; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PropertyType kCCBPropTypeFontTTF = CCBReader::PropertyType::FONT_TTF; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PropertyType kCCBPropTypeIntegerLabeled = CCBReader::PropertyType::INTEGER_LABELED; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PropertyType kCCBPropTypeBlock = CCBReader::PropertyType::BLOCK; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PropertyType kCCBPropTypeAnimation = CCBReader::PropertyType::ANIMATION; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PropertyType kCCBPropTypeCCBFile = CCBReader::PropertyType::CCB_FILE; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PropertyType kCCBPropTypeString = CCBReader::PropertyType::STRING; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PropertyType kCCBPropTypeBlockCCControl = CCBReader::PropertyType::BLOCK_CONTROL; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PropertyType kCCBPropTypeFloatScale = CCBReader::PropertyType::FLOAT_SCALE; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PropertyType kCCBPropTypeFloatXY = CCBReader::PropertyType::FLOAT_XY; - -CC_DEPRECATED_ATTRIBUTE const CCBReader::FloatType kCCBFloat0 = CCBReader::FloatType::_0; -CC_DEPRECATED_ATTRIBUTE const CCBReader::FloatType kCCBFloat1 = CCBReader::FloatType::_1; -CC_DEPRECATED_ATTRIBUTE const CCBReader::FloatType kCCBFloatMinus1 = CCBReader::FloatType::MINUS1; -CC_DEPRECATED_ATTRIBUTE const CCBReader::FloatType kCCBFloat05 = CCBReader::FloatType::_05; -CC_DEPRECATED_ATTRIBUTE const CCBReader::FloatType kCCBFloatInteger = CCBReader::FloatType::INTEGER; -CC_DEPRECATED_ATTRIBUTE const CCBReader::FloatType kCCBFloatFull = CCBReader::FloatType::FULL; - -CC_DEPRECATED_ATTRIBUTE const CCBReader::PlatformType kCCBPlatformAll = CCBReader::PlatformType::ALL; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PlatformType kCCBPlatformIOS = CCBReader::PlatformType::IOS; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PlatformType kCCBPlatformMac = CCBReader::PlatformType::MAC; - -CC_DEPRECATED_ATTRIBUTE const CCBReader::TargetType kCCBTargetTypeNone = CCBReader::TargetType::NONE; -CC_DEPRECATED_ATTRIBUTE const CCBReader::TargetType kCCBTargetTypeDocumentRoot = CCBReader::TargetType::DOCUMENT_ROOT; -CC_DEPRECATED_ATTRIBUTE const CCBReader::TargetType kCCBTargetTypeOwner = CCBReader::TargetType::OWNER; - -CC_DEPRECATED_ATTRIBUTE const CCBKeyframe::EasingType kCCBKeyframeEasingInstant = CCBKeyframe::EasingType::INSTANT ; -CC_DEPRECATED_ATTRIBUTE const CCBKeyframe::EasingType kCCBKeyframeEasingLinear = CCBKeyframe::EasingType::LINEAR ; -CC_DEPRECATED_ATTRIBUTE const CCBKeyframe::EasingType kCCBKeyframeEasingCubicIn = CCBKeyframe::EasingType::CUBIC_IN ; -CC_DEPRECATED_ATTRIBUTE const CCBKeyframe::EasingType kCCBKeyframeEasingCubicOut = CCBKeyframe::EasingType::CUBIC_OUT ; -CC_DEPRECATED_ATTRIBUTE const CCBKeyframe::EasingType kCCBKeyframeEasingCubicInOut = CCBKeyframe::EasingType::CUBIC_INOUT ; -CC_DEPRECATED_ATTRIBUTE const CCBKeyframe::EasingType kCCBKeyframeEasingElasticIn = CCBKeyframe::EasingType::ELASTIC_IN ; -CC_DEPRECATED_ATTRIBUTE const CCBKeyframe::EasingType kCCBKeyframeEasingElasticOut = CCBKeyframe::EasingType::ELASTIC_OUT ; -CC_DEPRECATED_ATTRIBUTE const CCBKeyframe::EasingType kCCBKeyframeEasingElasticInOut = CCBKeyframe::EasingType::ELASTIC_INOUT ; -CC_DEPRECATED_ATTRIBUTE const CCBKeyframe::EasingType kCCBKeyframeEasingBounceIn = CCBKeyframe::EasingType::BOUNCE_IN ; -CC_DEPRECATED_ATTRIBUTE const CCBKeyframe::EasingType kCCBKeyframeEasingBounceOut = CCBKeyframe::EasingType::BOUNCE_OUT ; -CC_DEPRECATED_ATTRIBUTE const CCBKeyframe::EasingType kCCBKeyframeEasingBounceInOut = CCBKeyframe::EasingType::BOUNCE_INOUT ; -CC_DEPRECATED_ATTRIBUTE const CCBKeyframe::EasingType kCCBKeyframeEasingBackIn = CCBKeyframe::EasingType::BACK_IN ; -CC_DEPRECATED_ATTRIBUTE const CCBKeyframe::EasingType kCCBKeyframeEasingBackOut = CCBKeyframe::EasingType::BACK_OUT ; -CC_DEPRECATED_ATTRIBUTE const CCBKeyframe::EasingType kCCBKeyframeEasingBackInOut = CCBKeyframe::EasingType::BACK_INOUT ; - -CC_DEPRECATED_ATTRIBUTE const CCBReader::PositionType kCCBPositionTypeRelativeBottomLeft = CCBReader::PositionType::RELATIVE_BOTTOM_LEFT ; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PositionType kCCBPositionTypeRelativeTopLeft = CCBReader::PositionType::RELATIVE_TOP_LEFT ; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PositionType kCCBPositionTypeRelativeTopRight = CCBReader::PositionType::RELATIVE_TOP_RIGHT ; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PositionType kCCBPositionTypeRelativeBottomRight = CCBReader::PositionType::RELATIVE_BOTTOM_RIGHT; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PositionType kCCBPositionTypePercent = CCBReader::PositionType::PERCENT ; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PositionType kCCBPositionTypeMultiplyResolution = CCBReader::PositionType::MULTIPLY_RESOLUTION ; -; -CC_DEPRECATED_ATTRIBUTE const CCBReader::SizeType kCCBSizeTypeAbsolute = CCBReader::SizeType::ABSOLUTE ; -CC_DEPRECATED_ATTRIBUTE const CCBReader::SizeType kCCBSizeTypePercent = CCBReader::SizeType::PERCENT ; -CC_DEPRECATED_ATTRIBUTE const CCBReader::SizeType kCCBSizeTypeRelativeContainer = CCBReader::SizeType::RELATIVE_CONTAINER ; -CC_DEPRECATED_ATTRIBUTE const CCBReader::SizeType kCCBSizeTypeHorizontalPercent = CCBReader::SizeType::HORIZONTAL_PERCENT ; -CC_DEPRECATED_ATTRIBUTE const CCBReader::SizeType kCCBSizeTypeVerticalPercent = CCBReader::SizeType::VERTICAL_PERCENT ; -CC_DEPRECATED_ATTRIBUTE const CCBReader::SizeType kCCBSizeTypeMultiplyResolution = CCBReader::SizeType::MULTIPLY_RESOLUTION; - - -CC_DEPRECATED_ATTRIBUTE const CCBReader::ScaleType kCCBScaleTypeAbsolute = CCBReader::ScaleType::ABSOLUTE; -CC_DEPRECATED_ATTRIBUTE const CCBReader::ScaleType kCCBScaleTypeMultiplyResolution = CCBReader::ScaleType::MULTIPLY_RESOLUTION; - -NS_CC_EXT_END - -#endif // COCOS2D_CCDEPRECATED_EXT_H__ diff --git a/extensions/GUI/CCControlExtension/CCControl.cpp b/extensions/GUI/CCControlExtension/CCControl.cpp index 6ead6baf9d..d12859b703 100644 --- a/extensions/GUI/CCControlExtension/CCControl.cpp +++ b/extensions/GUI/CCControlExtension/CCControl.cpp @@ -29,11 +29,11 @@ #include "CCControl.h" #include "CCDirector.h" -#include "menu_nodes/CCMenu.h" -#include "event_dispatcher/CCTouch.h" +#include "CCMenu.h" +#include "CCTouch.h" #include "CCInvocation.h" -#include "event_dispatcher/CCEventDispatcher.h" -#include "event_dispatcher/CCEventListenerTouch.h" +#include "CCEventDispatcher.h" +#include "CCEventListenerTouch.h" NS_CC_EXT_BEGIN diff --git a/extensions/GUI/CCControlExtension/CCControlButton.cpp b/extensions/GUI/CCControlExtension/CCControlButton.cpp index 247634a72c..4f889f7066 100644 --- a/extensions/GUI/CCControlExtension/CCControlButton.cpp +++ b/extensions/GUI/CCControlExtension/CCControlButton.cpp @@ -27,10 +27,10 @@ #include "CCControlButton.h" #include "CCScale9Sprite.h" -#include "label_nodes/CCLabelTTF.h" -#include "label_nodes/CCLabelBMFont.h" -#include "actions/CCAction.h" -#include "actions/CCActionInterval.h" +#include "CCLabelTTF.h" +#include "CCLabelBMFont.h" +#include "CCAction.h" +#include "CCActionInterval.h" using namespace std; diff --git a/extensions/GUI/CCControlExtension/CCControlColourPicker.cpp b/extensions/GUI/CCControlExtension/CCControlColourPicker.cpp index 26d7bbf694..18da7f0abf 100644 --- a/extensions/GUI/CCControlExtension/CCControlColourPicker.cpp +++ b/extensions/GUI/CCControlExtension/CCControlColourPicker.cpp @@ -30,8 +30,8 @@ */ #include "CCControlColourPicker.h" -#include "sprite_nodes/CCSpriteFrameCache.h" -#include "sprite_nodes/CCSpriteBatchNode.h" +#include "CCSpriteFrameCache.h" +#include "CCSpriteBatchNode.h" NS_CC_EXT_BEGIN diff --git a/extensions/GUI/CCControlExtension/CCControlSlider.cpp b/extensions/GUI/CCControlExtension/CCControlSlider.cpp index 80840c4482..1ba96962b6 100644 --- a/extensions/GUI/CCControlExtension/CCControlSlider.cpp +++ b/extensions/GUI/CCControlExtension/CCControlSlider.cpp @@ -28,7 +28,7 @@ */ #include "CCControlSlider.h" -#include "event_dispatcher/CCTouch.h" +#include "CCTouch.h" #include "CCDirector.h" NS_CC_EXT_BEGIN diff --git a/extensions/GUI/CCControlExtension/CCControlUtils.h b/extensions/GUI/CCControlExtension/CCControlUtils.h index 6520cf9a4a..8739883f0c 100644 --- a/extensions/GUI/CCControlExtension/CCControlUtils.h +++ b/extensions/GUI/CCControlExtension/CCControlUtils.h @@ -34,7 +34,7 @@ #ifndef __CCCONTROL_UTILS_H__ #define __CCCONTROL_UTILS_H__ -#include "sprite_nodes/CCSprite.h" +#include "CCSprite.h" #include "../../ExtensionMacros.h" NS_CC_EXT_BEGIN diff --git a/extensions/GUI/CCControlExtension/CCInvocation.h b/extensions/GUI/CCControlExtension/CCInvocation.h index 36b64850e2..215f2b1ebd 100644 --- a/extensions/GUI/CCControlExtension/CCInvocation.h +++ b/extensions/GUI/CCControlExtension/CCInvocation.h @@ -30,7 +30,7 @@ #ifndef __CCINVOCATION_H__ #define __CCINVOCATION_H__ -#include "cocoa/CCObject.h" +#include "CCObject.h" #include "../../ExtensionMacros.h" #include "CCControl.h" diff --git a/extensions/GUI/CCScrollView/CCSorting.cpp b/extensions/GUI/CCScrollView/CCSorting.cpp index a9c6e522a8..fd9d80f32c 100644 --- a/extensions/GUI/CCScrollView/CCSorting.cpp +++ b/extensions/GUI/CCScrollView/CCSorting.cpp @@ -24,7 +24,7 @@ ****************************************************************************/ #include "CCSorting.h" -#include "support/data_support/ccCArray.h" +#include "ccCArray.h" NS_CC_EXT_BEGIN diff --git a/extensions/GUI/CCScrollView/CCSorting.h b/extensions/GUI/CCScrollView/CCSorting.h index 4e41f6e238..eca6fafc4a 100644 --- a/extensions/GUI/CCScrollView/CCSorting.h +++ b/extensions/GUI/CCScrollView/CCSorting.h @@ -26,7 +26,7 @@ #ifndef __CCSORTING_H__ #define __CCSORTING_H__ -#include "cocoa/CCArray.h" +#include "CCArray.h" #include "ExtensionMacros.h" NS_CC_EXT_BEGIN diff --git a/extensions/GUI/CCScrollView/CCTableView.cpp b/extensions/GUI/CCScrollView/CCTableView.cpp index 55c803ffd9..b7ce17b1c3 100644 --- a/extensions/GUI/CCScrollView/CCTableView.cpp +++ b/extensions/GUI/CCScrollView/CCTableView.cpp @@ -26,9 +26,9 @@ #include "cocos2d.h" #include "CCTableView.h" #include "CCTableViewCell.h" -#include "menu_nodes/CCMenu.h" +#include "CCMenu.h" #include "CCSorting.h" -#include "layers_scenes_transitions_nodes/CCLayer.h" +#include "CCLayer.h" NS_CC_EXT_BEGIN diff --git a/extensions/GUI/CCScrollView/CCTableViewCell.cpp b/extensions/GUI/CCScrollView/CCTableViewCell.cpp index 3bab98917e..936dccb450 100644 --- a/extensions/GUI/CCScrollView/CCTableViewCell.cpp +++ b/extensions/GUI/CCScrollView/CCTableViewCell.cpp @@ -24,7 +24,7 @@ ****************************************************************************/ #include "CCTableViewCell.h" -#include "support/data_support/ccCArray.h" +#include "ccCArray.h" NS_CC_EXT_BEGIN diff --git a/extensions/GUI/CCScrollView/CCTableViewCell.h b/extensions/GUI/CCScrollView/CCTableViewCell.h index 3d5d6f2139..bef117d3b9 100644 --- a/extensions/GUI/CCScrollView/CCTableViewCell.h +++ b/extensions/GUI/CCScrollView/CCTableViewCell.h @@ -26,7 +26,7 @@ #ifndef __CCTABLEVIEWCELL_H__ #define __CCTABLEVIEWCELL_H__ -#include "base_nodes/CCNode.h" +#include "CCNode.h" #include "CCSorting.h" NS_CC_EXT_BEGIN diff --git a/extensions/assets-manager/AssetsManager.cpp b/extensions/assets-manager/AssetsManager.cpp index 3dbbc80fdc..31795c4f39 100644 --- a/extensions/assets-manager/AssetsManager.cpp +++ b/extensions/assets-manager/AssetsManager.cpp @@ -38,7 +38,7 @@ #endif -#include "support/zip_support/unzip.h" +#include "unzip.h" using namespace cocos2d; using namespace std; diff --git a/extensions/cocos-ext.h b/extensions/cocos-ext.h index de56b38f0e..8c3f242643 100644 --- a/extensions/cocos-ext.h +++ b/extensions/cocos-ext.h @@ -3,84 +3,18 @@ #include "ExtensionMacros.h" -#include "CCBReader/CCBFileLoader.h" -#include "CCBReader/CCBMemberVariableAssigner.h" -#include "CCBReader/CCBReader.h" -#include "CCBReader/CCBSelectorResolver.h" -#include "CCBReader/CCControlButtonLoader.h" -#include "CCBReader/CCControlLoader.h" -#include "CCBReader/CCLabelBMFontLoader.h" -#include "CCBReader/CCLabelTTFLoader.h" -#include "CCBReader/CCLayerColorLoader.h" -#include "CCBReader/CCLayerGradientLoader.h" -#include "CCBReader/CCLayerLoader.h" -#include "CCBReader/CCMenuItemImageLoader.h" -#include "CCBReader/CCMenuItemLoader.h" -#include "CCBReader/CCMenuLoader.h" -#include "CCBReader/CCNodeLoader.h" -#include "CCBReader/CCNodeLoaderLibrary.h" -#include "CCBReader/CCNodeLoaderListener.h" -#include "CCBReader/CCParticleSystemQuadLoader.h" -#include "CCBReader/CCScale9SpriteLoader.h" -#include "CCBReader/CCScrollViewLoader.h" -#include "CCBReader/CCSpriteLoader.h" -#include "CCBReader/CCBAnimationManager.h" -#include "CCBReader/CCBKeyframe.h" -#include "CCBReader/CCBSequence.h" -#include "CCBReader/CCBSequenceProperty.h" -#include "CCBReader/CCBValue.h" -#include "CCBReader/CCNode+CCBRelativePositioning.h" #include "GUI/CCControlExtension/CCControlExtensions.h" #include "GUI/CCScrollView/CCScrollView.h" #include "GUI/CCScrollView/CCTableView.h" #include "GUI/CCEditBox/CCEditBox.h" -#include "network/HttpRequest.h" -#include "network/HttpResponse.h" -#include "network/HttpClient.h" -#include "network/WebSocket.h" -#include "network/SocketIO.h" - // Physics integration #if CC_ENABLE_CHIPMUNK_INTEGRATION || CC_ENABLE_BOX2D_INTEGRATION -#include "physics_nodes/CCPhysicsDebugNode.h" -#include "physics_nodes/CCPhysicsSprite.h" +#include "physics-nodes/CCPhysicsDebugNode.h" +#include "physics-nodes/CCPhysicsSprite.h" #endif -#include "spine/spine-cocos2dx.h" - -#include "CocoStudio/Armature/CCArmature.h" -#include "CocoStudio/Armature/CCBone.h" -#include "CocoStudio/Armature/animation/CCArmatureAnimation.h" -#include "CocoStudio/Armature/datas/CCDatas.h" -#include "CocoStudio/Armature/display/CCBatchNode.h" -#include "CocoStudio/Armature/display/CCDecorativeDisplay.h" -#include "CocoStudio/Armature/display/CCDisplayManager.h" -#include "CocoStudio/Armature/display/CCSkin.h" -#include "CocoStudio/Armature/physics/CCColliderDetector.h" -#include "CocoStudio/Armature/utils/CCArmatureDataManager.h" -#include "CocoStudio/Armature/utils/CCDataReaderHelper.h" -#include "CocoStudio/Armature/utils/CCTweenFunction.h" -#include "CocoStudio/Armature/utils/CCArmatureDataManager.h" - -#include "CocoStudio/Components/CCComAttribute.h" -#include "CocoStudio/Components/CCComAudio.h" -#include "CocoStudio/Components/CCComController.h" -#include "CocoStudio/Components/CCComRender.h" - -#include "CocoStudio/GUI/System/CocosGUI.h" - -#include "CocoStudio/Json/CSContentJsonDictionary.h" -#include "CocoStudio/Json/DictionaryHelper.h" - -#include "CocoStudio/Reader/CCSSceneReader.h" -#include "CocoStudio/Reader/CCSGUIReader.h" - -#include "CocoStudio/Action/CCActionManagerEx.h" - -#include "CCDeprecated-ext.h" - -#include "AssetsManager/AssetsManager.h" +#include "assets-manager/AssetsManager.h" #endif /* __COCOS2D_EXT_H__ */ diff --git a/extensions/physics-nodes/CCPhysicsDebugNode.cpp b/extensions/physics-nodes/CCPhysicsDebugNode.cpp index 40c2c7d4ea..357092b62f 100644 --- a/extensions/physics-nodes/CCPhysicsDebugNode.cpp +++ b/extensions/physics-nodes/CCPhysicsDebugNode.cpp @@ -24,7 +24,7 @@ #if CC_ENABLE_CHIPMUNK_INTEGRATION #include "ccTypes.h" -#include "cocoa/CCGeometry.h" +#include "CCGeometry.h" #include #include diff --git a/external/curl/include/android/curl.h b/external/curl/include/android/curl/curl.h similarity index 100% rename from external/curl/include/android/curl.h rename to external/curl/include/android/curl/curl.h diff --git a/external/curl/include/android/curlbuild.h b/external/curl/include/android/curl/curlbuild.h similarity index 100% rename from external/curl/include/android/curlbuild.h rename to external/curl/include/android/curl/curlbuild.h diff --git a/external/curl/include/android/curlrules.h b/external/curl/include/android/curl/curlrules.h similarity index 100% rename from external/curl/include/android/curlrules.h rename to external/curl/include/android/curl/curlrules.h diff --git a/external/curl/include/android/curlver.h b/external/curl/include/android/curl/curlver.h similarity index 100% rename from external/curl/include/android/curlver.h rename to external/curl/include/android/curl/curlver.h diff --git a/external/curl/include/android/easy.h b/external/curl/include/android/curl/easy.h similarity index 100% rename from external/curl/include/android/easy.h rename to external/curl/include/android/curl/easy.h diff --git a/external/curl/include/android/mprintf.h b/external/curl/include/android/curl/mprintf.h similarity index 100% rename from external/curl/include/android/mprintf.h rename to external/curl/include/android/curl/mprintf.h diff --git a/external/curl/include/android/multi.h b/external/curl/include/android/curl/multi.h similarity index 100% rename from external/curl/include/android/multi.h rename to external/curl/include/android/curl/multi.h diff --git a/external/curl/include/android/stdcheaders.h b/external/curl/include/android/curl/stdcheaders.h similarity index 100% rename from external/curl/include/android/stdcheaders.h rename to external/curl/include/android/curl/stdcheaders.h diff --git a/external/curl/include/android/typecheck-gcc.h b/external/curl/include/android/curl/typecheck-gcc.h similarity index 100% rename from external/curl/include/android/typecheck-gcc.h rename to external/curl/include/android/curl/typecheck-gcc.h diff --git a/external/curl/include/android/types.h b/external/curl/include/android/curl/types.h similarity index 100% rename from external/curl/include/android/types.h rename to external/curl/include/android/curl/types.h diff --git a/external/curl/include/ios/curl.h b/external/curl/include/ios/curl/curl.h similarity index 100% rename from external/curl/include/ios/curl.h rename to external/curl/include/ios/curl/curl.h diff --git a/external/curl/include/ios/curlbuild.h b/external/curl/include/ios/curl/curlbuild.h similarity index 100% rename from external/curl/include/ios/curlbuild.h rename to external/curl/include/ios/curl/curlbuild.h diff --git a/external/curl/include/ios/curlrules.h b/external/curl/include/ios/curl/curlrules.h similarity index 100% rename from external/curl/include/ios/curlrules.h rename to external/curl/include/ios/curl/curlrules.h diff --git a/external/curl/include/ios/curlver.h b/external/curl/include/ios/curl/curlver.h similarity index 100% rename from external/curl/include/ios/curlver.h rename to external/curl/include/ios/curl/curlver.h diff --git a/external/curl/include/ios/easy.h b/external/curl/include/ios/curl/easy.h similarity index 100% rename from external/curl/include/ios/easy.h rename to external/curl/include/ios/curl/easy.h diff --git a/external/curl/include/ios/mprintf.h b/external/curl/include/ios/curl/mprintf.h similarity index 100% rename from external/curl/include/ios/mprintf.h rename to external/curl/include/ios/curl/mprintf.h diff --git a/external/curl/include/ios/multi.h b/external/curl/include/ios/curl/multi.h similarity index 100% rename from external/curl/include/ios/multi.h rename to external/curl/include/ios/curl/multi.h diff --git a/external/curl/include/ios/stdcheaders.h b/external/curl/include/ios/curl/stdcheaders.h similarity index 100% rename from external/curl/include/ios/stdcheaders.h rename to external/curl/include/ios/curl/stdcheaders.h diff --git a/external/curl/include/ios/typecheck-gcc.h b/external/curl/include/ios/curl/typecheck-gcc.h similarity index 100% rename from external/curl/include/ios/typecheck-gcc.h rename to external/curl/include/ios/curl/typecheck-gcc.h diff --git a/external/curl/include/linux/32-bit/curl.h b/external/curl/include/linux/32-bit/curl/curl.h similarity index 100% rename from external/curl/include/linux/32-bit/curl.h rename to external/curl/include/linux/32-bit/curl/curl.h diff --git a/external/curl/include/linux/32-bit/curlbuild.h b/external/curl/include/linux/32-bit/curl/curlbuild.h similarity index 100% rename from external/curl/include/linux/32-bit/curlbuild.h rename to external/curl/include/linux/32-bit/curl/curlbuild.h diff --git a/external/curl/include/linux/32-bit/curlrules.h b/external/curl/include/linux/32-bit/curl/curlrules.h similarity index 100% rename from external/curl/include/linux/32-bit/curlrules.h rename to external/curl/include/linux/32-bit/curl/curlrules.h diff --git a/external/curl/include/linux/32-bit/curlver.h b/external/curl/include/linux/32-bit/curl/curlver.h similarity index 100% rename from external/curl/include/linux/32-bit/curlver.h rename to external/curl/include/linux/32-bit/curl/curlver.h diff --git a/external/curl/include/linux/32-bit/easy.h b/external/curl/include/linux/32-bit/curl/easy.h similarity index 100% rename from external/curl/include/linux/32-bit/easy.h rename to external/curl/include/linux/32-bit/curl/easy.h diff --git a/external/curl/include/linux/32-bit/mprintf.h b/external/curl/include/linux/32-bit/curl/mprintf.h similarity index 100% rename from external/curl/include/linux/32-bit/mprintf.h rename to external/curl/include/linux/32-bit/curl/mprintf.h diff --git a/external/curl/include/linux/32-bit/multi.h b/external/curl/include/linux/32-bit/curl/multi.h similarity index 100% rename from external/curl/include/linux/32-bit/multi.h rename to external/curl/include/linux/32-bit/curl/multi.h diff --git a/external/curl/include/linux/32-bit/stdcheaders.h b/external/curl/include/linux/32-bit/curl/stdcheaders.h similarity index 100% rename from external/curl/include/linux/32-bit/stdcheaders.h rename to external/curl/include/linux/32-bit/curl/stdcheaders.h diff --git a/external/curl/include/linux/32-bit/typecheck-gcc.h b/external/curl/include/linux/32-bit/curl/typecheck-gcc.h similarity index 100% rename from external/curl/include/linux/32-bit/typecheck-gcc.h rename to external/curl/include/linux/32-bit/curl/typecheck-gcc.h diff --git a/external/curl/include/linux/64-bit/curl.h b/external/curl/include/linux/64-bit/curl/curl.h similarity index 100% rename from external/curl/include/linux/64-bit/curl.h rename to external/curl/include/linux/64-bit/curl/curl.h diff --git a/external/curl/include/linux/64-bit/curlbuild.h b/external/curl/include/linux/64-bit/curl/curlbuild.h similarity index 100% rename from external/curl/include/linux/64-bit/curlbuild.h rename to external/curl/include/linux/64-bit/curl/curlbuild.h diff --git a/external/curl/include/linux/64-bit/curlrules.h b/external/curl/include/linux/64-bit/curl/curlrules.h similarity index 100% rename from external/curl/include/linux/64-bit/curlrules.h rename to external/curl/include/linux/64-bit/curl/curlrules.h diff --git a/external/curl/include/linux/64-bit/curlver.h b/external/curl/include/linux/64-bit/curl/curlver.h similarity index 100% rename from external/curl/include/linux/64-bit/curlver.h rename to external/curl/include/linux/64-bit/curl/curlver.h diff --git a/external/curl/include/linux/64-bit/easy.h b/external/curl/include/linux/64-bit/curl/easy.h similarity index 100% rename from external/curl/include/linux/64-bit/easy.h rename to external/curl/include/linux/64-bit/curl/easy.h diff --git a/external/curl/include/linux/64-bit/mprintf.h b/external/curl/include/linux/64-bit/curl/mprintf.h similarity index 100% rename from external/curl/include/linux/64-bit/mprintf.h rename to external/curl/include/linux/64-bit/curl/mprintf.h diff --git a/external/curl/include/linux/64-bit/multi.h b/external/curl/include/linux/64-bit/curl/multi.h similarity index 100% rename from external/curl/include/linux/64-bit/multi.h rename to external/curl/include/linux/64-bit/curl/multi.h diff --git a/external/curl/include/linux/64-bit/stdcheaders.h b/external/curl/include/linux/64-bit/curl/stdcheaders.h similarity index 100% rename from external/curl/include/linux/64-bit/stdcheaders.h rename to external/curl/include/linux/64-bit/curl/stdcheaders.h diff --git a/external/curl/include/win32/curl.h b/external/curl/include/win32/curl/curl.h similarity index 100% rename from external/curl/include/win32/curl.h rename to external/curl/include/win32/curl/curl.h diff --git a/external/curl/include/win32/curlbuild.h b/external/curl/include/win32/curl/curlbuild.h similarity index 100% rename from external/curl/include/win32/curlbuild.h rename to external/curl/include/win32/curl/curlbuild.h diff --git a/external/curl/include/win32/curlrules.h b/external/curl/include/win32/curl/curlrules.h similarity index 100% rename from external/curl/include/win32/curlrules.h rename to external/curl/include/win32/curl/curlrules.h diff --git a/external/curl/include/win32/curlver.h b/external/curl/include/win32/curl/curlver.h similarity index 100% rename from external/curl/include/win32/curlver.h rename to external/curl/include/win32/curl/curlver.h diff --git a/external/curl/include/win32/easy.h b/external/curl/include/win32/curl/easy.h similarity index 100% rename from external/curl/include/win32/easy.h rename to external/curl/include/win32/curl/easy.h diff --git a/external/curl/include/win32/mprintf.h b/external/curl/include/win32/curl/mprintf.h similarity index 100% rename from external/curl/include/win32/mprintf.h rename to external/curl/include/win32/curl/mprintf.h diff --git a/external/curl/include/win32/multi.h b/external/curl/include/win32/curl/multi.h similarity index 100% rename from external/curl/include/win32/multi.h rename to external/curl/include/win32/curl/multi.h diff --git a/external/curl/include/win32/stdcheaders.h b/external/curl/include/win32/curl/stdcheaders.h similarity index 100% rename from external/curl/include/win32/stdcheaders.h rename to external/curl/include/win32/curl/stdcheaders.h diff --git a/external/curl/include/win32/typecheck-gcc.h b/external/curl/include/win32/curl/typecheck-gcc.h similarity index 100% rename from external/curl/include/win32/typecheck-gcc.h rename to external/curl/include/win32/curl/typecheck-gcc.h diff --git a/external/jsoncpp/autolink.h b/external/json/autolink.h similarity index 65% rename from external/jsoncpp/autolink.h rename to external/json/autolink.h index 02328d1f1a..37c9258ed5 100644 --- a/external/jsoncpp/autolink.h +++ b/external/json/autolink.h @@ -1,8 +1,3 @@ -// Copyright 2007-2010 Baptiste Lepilleur -// Distributed under MIT license, or public domain if desired and -// recognized in your jurisdiction. -// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE - #ifndef JSON_AUTOLINK_H_INCLUDED # define JSON_AUTOLINK_H_INCLUDED diff --git a/external/json/config.h b/external/json/config.h new file mode 100644 index 0000000000..5d334cbc5e --- /dev/null +++ b/external/json/config.h @@ -0,0 +1,43 @@ +#ifndef JSON_CONFIG_H_INCLUDED +# define JSON_CONFIG_H_INCLUDED + +/// If defined, indicates that json library is embedded in CppTL library. +//# define JSON_IN_CPPTL 1 + +/// If defined, indicates that json may leverage CppTL library +//# define JSON_USE_CPPTL 1 +/// If defined, indicates that cpptl vector based map should be used instead of std::map +/// as Value container. +//# define JSON_USE_CPPTL_SMALLMAP 1 +/// If defined, indicates that Json specific container should be used +/// (hash table & simple deque container with customizable allocator). +/// THIS FEATURE IS STILL EXPERIMENTAL! +//# define JSON_VALUE_USE_INTERNAL_MAP 1 +/// Force usage of standard new/malloc based allocator instead of memory pool based allocator. +/// The memory pools allocator used optimization (initializing Value and ValueInternalLink +/// as if it was a POD) that may cause some validation tool to report errors. +/// Only has effects if JSON_VALUE_USE_INTERNAL_MAP is defined. +//# define JSON_USE_SIMPLE_INTERNAL_ALLOCATOR 1 + +/// If defined, indicates that Json use exception to report invalid type manipulation +/// instead of C assert macro. +# define JSON_USE_EXCEPTION 1 + +# ifdef JSON_IN_CPPTL +# include +# ifndef JSON_USE_CPPTL +# define JSON_USE_CPPTL 1 +# endif +# endif + +# ifdef JSON_IN_CPPTL +# define JSON_API CPPTL_API +# elif defined(JSON_DLL_BUILD) +# define JSON_API __declspec(dllexport) +# elif defined(JSON_DLL) +# define JSON_API __declspec(dllimport) +# else +# define JSON_API +# endif + +#endif // JSON_CONFIG_H_INCLUDED diff --git a/external/jsoncpp/features.h b/external/json/features.h similarity index 78% rename from external/jsoncpp/features.h rename to external/json/features.h index 03be3313bf..5a9adec118 100644 --- a/external/jsoncpp/features.h +++ b/external/json/features.h @@ -1,16 +1,9 @@ -// Copyright 2007-2010 Baptiste Lepilleur -// Distributed under MIT license, or public domain if desired and -// recognized in your jurisdiction. -// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE - #ifndef CPPTL_JSON_FEATURES_H_INCLUDED # define CPPTL_JSON_FEATURES_H_INCLUDED -#if !defined(JSON_IS_AMALGAMATION) # include "forwards.h" -#endif // if !defined(JSON_IS_AMALGAMATION) -namespace CSJson { +namespace Json { /** \brief Configuration passed to reader and writer. * This configuration object can be used to force the Reader or Writer @@ -44,6 +37,6 @@ namespace CSJson { bool strictRoot_; }; -} // namespace CSJson +} // namespace Json #endif // CPPTL_JSON_FEATURES_H_INCLUDED diff --git a/external/jsoncpp/forwards.h b/external/json/forwards.h similarity index 61% rename from external/jsoncpp/forwards.h rename to external/json/forwards.h index 4af4eebdb5..d0ce8300ce 100644 --- a/external/jsoncpp/forwards.h +++ b/external/json/forwards.h @@ -1,16 +1,9 @@ -// Copyright 2007-2010 Baptiste Lepilleur -// Distributed under MIT license, or public domain if desired and -// recognized in your jurisdiction. -// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE - #ifndef JSON_FORWARDS_H_INCLUDED # define JSON_FORWARDS_H_INCLUDED -#if !defined(JSON_IS_AMALGAMATION) # include "config.h" -#endif // if !defined(JSON_IS_AMALGAMATION) -namespace CSJson { +namespace Json { // writer.h class FastWriter; @@ -23,7 +16,8 @@ namespace CSJson { class Features; // value.h - typedef unsigned int ArrayIndex; + typedef int Int; + typedef unsigned int UInt; class StaticString; class Path; class PathArgument; @@ -32,13 +26,14 @@ namespace CSJson { class ValueIterator; class ValueConstIterator; #ifdef JSON_VALUE_USE_INTERNAL_MAP + class ValueAllocator; class ValueMapAllocator; class ValueInternalLink; class ValueInternalArray; class ValueInternalMap; #endif // #ifdef JSON_VALUE_USE_INTERNAL_MAP -} // namespace CSJson +} // namespace Json #endif // JSON_FORWARDS_H_INCLUDED diff --git a/external/json/json.h b/external/json/json.h new file mode 100644 index 0000000000..c71ed65abf --- /dev/null +++ b/external/json/json.h @@ -0,0 +1,10 @@ +#ifndef JSON_JSON_H_INCLUDED +# define JSON_JSON_H_INCLUDED + +# include "autolink.h" +# include "value.h" +# include "reader.h" +# include "writer.h" +# include "features.h" + +#endif // JSON_JSON_H_INCLUDED diff --git a/external/jsoncpp/json_batchallocator.h b/external/json/json_batchallocator.h similarity index 93% rename from external/jsoncpp/json_batchallocator.h rename to external/json/json_batchallocator.h index 14b4d36839..87ea5ed807 100644 --- a/external/jsoncpp/json_batchallocator.h +++ b/external/json/json_batchallocator.h @@ -1,8 +1,3 @@ -// Copyright 2007-2010 Baptiste Lepilleur -// Distributed under MIT license, or public domain if desired and -// recognized in your jurisdiction. -// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE - #ifndef JSONCPP_BATCHALLOCATOR_H_INCLUDED # define JSONCPP_BATCHALLOCATOR_H_INCLUDED @@ -11,7 +6,7 @@ # ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION -namespace CSJson { +namespace Json { /* Fast memory allocator. * @@ -122,7 +117,7 @@ private: }; -} // namespace CSJson +} // namespace Json # endif // ifndef JSONCPP_DOC_INCLUDE_IMPLEMENTATION diff --git a/external/jsoncpp/json_internalarray.inl b/external/json/json_internalarray.inl similarity index 97% rename from external/jsoncpp/json_internalarray.inl rename to external/json/json_internalarray.inl index 5bce163b9c..9b985d2585 100644 --- a/external/jsoncpp/json_internalarray.inl +++ b/external/json/json_internalarray.inl @@ -1,11 +1,5 @@ -// Copyright 2007-2010 Baptiste Lepilleur -// Distributed under MIT license, or public domain if desired and -// recognized in your jurisdiction. -// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE - // included by json_value.cpp - -namespace CSJson { +// everything is within Json namespace // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// @@ -452,5 +446,3 @@ ValueInternalArray::compare( const ValueInternalArray &other ) const } return 0; } - -} // namespace CSJson diff --git a/external/jsoncpp/json_internalmap.inl b/external/json/json_internalmap.inl similarity index 98% rename from external/jsoncpp/json_internalmap.inl rename to external/json/json_internalmap.inl index 755eeb941a..19771488d6 100644 --- a/external/jsoncpp/json_internalmap.inl +++ b/external/json/json_internalmap.inl @@ -1,11 +1,5 @@ -// Copyright 2007-2010 Baptiste Lepilleur -// Distributed under MIT license, or public domain if desired and -// recognized in your jurisdiction. -// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE - // included by json_value.cpp - -namespace CSJson { +// everything is within Json namespace // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// @@ -421,7 +415,7 @@ ValueInternalMap::setNewItem( const char *key, ValueInternalLink *link, BucketIndex index ) { - char *duplicatedKey = makeMemberName( key ); + char *duplicatedKey = valueAllocator()->makeMemberName( key ); ++itemCount_; link->keys_[index] = duplicatedKey; link->items_[index].setItemUsed(); @@ -611,5 +605,3 @@ ValueInternalMap::distance( const IteratorState &x, const IteratorState &y ) increment( it ); return offset; } - -} // namespace CSJson diff --git a/external/jsoncpp/json_reader.cpp b/external/json/json_reader.cpp similarity index 89% rename from external/jsoncpp/json_reader.cpp rename to external/json/json_reader.cpp index 5d336cf2a7..4eb2d11fd3 100644 --- a/external/jsoncpp/json_reader.cpp +++ b/external/json/json_reader.cpp @@ -1,27 +1,17 @@ -// Copyright 2007-2010 Baptiste Lepilleur -// Distributed under MIT license, or public domain if desired and -// recognized in your jurisdiction. -// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE - -#if !defined(JSON_IS_AMALGAMATION) -# include "reader.h" -# include "value.h" -# include "json_tool.h" -#endif // if !defined(JSON_IS_AMALGAMATION) +#include +#include #include #include #include #include #include #include -#include -#include #if _MSC_VER >= 1400 // VC++ 8.0 #pragma warning( disable : 4996 ) // disable warning about strdup being deprecated. #endif -namespace CSJson { +namespace Json { // Implementation of class Features // //////////////////////////////// @@ -76,6 +66,42 @@ containsNewLine( Reader::Location begin, return false; } +static std::string codePointToUTF8(unsigned int cp) +{ + std::string result; + + // based on description from http://en.wikipedia.org/wiki/UTF-8 + + if (cp <= 0x7f) + { + result.resize(1); + result[0] = static_cast(cp); + } + else if (cp <= 0x7FF) + { + result.resize(2); + result[1] = static_cast(0x80 | (0x3f & cp)); + result[0] = static_cast(0xC0 | (0x1f & (cp >> 6))); + } + else if (cp <= 0xFFFF) + { + result.resize(3); + result[2] = static_cast(0x80 | (0x3f & cp)); + result[1] = 0x80 | static_cast((0x3f & (cp >> 6))); + result[0] = 0xE0 | static_cast((0xf & (cp >> 12))); + } + else if (cp <= 0x10FFFF) + { + result.resize(4); + result[3] = static_cast(0x80 | (0x3f & cp)); + result[2] = static_cast(0x80 | (0x3f & (cp >> 6))); + result[1] = static_cast(0x80 | (0x3f & (cp >> 12))); + result[0] = static_cast(0xF0 | (0x7 & (cp >> 18))); + } + + return result; +} + // Class Reader // ////////////////////////////////////////////////////////////////// @@ -451,7 +477,7 @@ Reader::readString() bool -Reader::readObject( Token &/*tokenStart*/ ) +Reader::readObject( Token &tokenStart ) { Token tokenName; std::string name; @@ -490,7 +516,7 @@ Reader::readObject( Token &/*tokenStart*/ ) if ( !readToken( comma ) || ( comma.type_ != tokenObjectEnd && comma.type_ != tokenArraySeparator && - comma.type_ != tokenComment ) ) + comma.type_ != tokenComment ) ) { return addErrorAndRecover( "Missing ',' or '}' in object declaration", comma, @@ -510,7 +536,7 @@ Reader::readObject( Token &/*tokenStart*/ ) bool -Reader::readArray( Token &/*tokenStart*/ ) +Reader::readArray( Token &tokenStart ) { currentValue() = Value( arrayValue ); skipSpaces(); @@ -521,7 +547,7 @@ Reader::readArray( Token &/*tokenStart*/ ) return true; } int index = 0; - for (;;) + while ( true ) { Value &value = currentValue()[ index++ ]; nodes_.push( &value ); @@ -537,8 +563,8 @@ Reader::readArray( Token &/*tokenStart*/ ) { ok = readToken( token ); } - bool badTokenType = ( token.type_ != tokenArraySeparator && - token.type_ != tokenArrayEnd ); + bool badTokenType = ( token.type_ == tokenArraySeparator && + token.type_ == tokenArrayEnd ); if ( !ok || badTokenType ) { return addErrorAndRecover( "Missing ',' or ']' in array declaration", @@ -564,41 +590,26 @@ Reader::decodeNumber( Token &token ) } if ( isDouble ) return decodeDouble( token ); - // Attempts to parse the number as an integer. If the number is - // larger than the maximum supported value of an integer then - // we decode the number as a double. Location current = token.start_; bool isNegative = *current == '-'; if ( isNegative ) ++current; - Value::LargestUInt maxIntegerValue = isNegative ? Value::LargestUInt(-Value::minLargestInt) - : Value::maxLargestUInt; - Value::LargestUInt threshold = maxIntegerValue / 10; - Value::UInt lastDigitThreshold = Value::UInt( maxIntegerValue % 10 ); - assert( lastDigitThreshold >=0 && lastDigitThreshold <= 9 ); - Value::LargestUInt value = 0; + Value::UInt threshold = (isNegative ? Value::UInt(-Value::minInt) + : Value::maxUInt) / 10; + Value::UInt value = 0; while ( current < token.end_ ) { Char c = *current++; if ( c < '0' || c > '9' ) return addError( "'" + std::string( token.start_, token.end_ ) + "' is not a number.", token ); - Value::UInt digit(c - '0'); if ( value >= threshold ) - { - // If the current digit is not the last one, or if it is - // greater than the last digit of the maximum integer value, - // the parse the number as a double. - if ( current != token.end_ || digit > lastDigitThreshold ) - { - return decodeDouble( token ); - } - } - value = value * 10 + digit; + return decodeDouble( token ); + value = value * 10 + Value::UInt(c - '0'); } if ( isNegative ) - currentValue() = -Value::LargestInt( value ); - else if ( value <= Value::LargestUInt(Value::maxInt) ) - currentValue() = Value::LargestInt( value ); + currentValue() = -Value::Int( value ); + else if ( value <= Value::UInt(Value::maxInt) ) + currentValue() = Value::Int( value ); else currentValue() = value; return true; @@ -614,7 +625,7 @@ Reader::decodeDouble( Token &token ) int length = int(token.end_ - token.start_); if ( length <= bufferSize ) { - Char buffer[bufferSize+1]; + Char buffer[bufferSize]; memcpy( buffer, token.start_, length ); buffer[length] = 0; count = sscanf( buffer, "%lf", &value ); @@ -764,7 +775,7 @@ Reader::recoverFromError( TokenType skipUntilToken ) { int errorCount = int(errors_.size()); Token skip; - for (;;) + while ( true ) { if ( !readToken(skip) ) errors_.resize( errorCount ); // discard errors caused by recovery @@ -843,16 +854,8 @@ Reader::getLocationLineAndColumn( Location location ) const } -// Deprecated. Preserved for backward compatibility std::string Reader::getFormatedErrorMessages() const -{ - return getFormattedErrorMessages(); -} - - -std::string -Reader::getFormattedErrorMessages() const { std::string formattedMessage; for ( Errors::const_iterator itError = errors_.begin(); @@ -871,12 +874,12 @@ Reader::getFormattedErrorMessages() const std::istream& operator>>( std::istream &sin, Value &root ) { - CSJson::Reader reader; + Json::Reader reader; bool ok = reader.parse(sin, root, true); //JSON_ASSERT( ok ); - if (!ok) throw std::runtime_error(reader.getFormattedErrorMessages()); + if (!ok) throw std::runtime_error(reader.getFormatedErrorMessages()); return sin; } -} // namespace CSJson +} // namespace Json diff --git a/external/jsoncpp/json_value.cpp b/external/json/json_value.cpp similarity index 79% rename from external/jsoncpp/json_value.cpp rename to external/json/json_value.cpp index e62b9c36a1..573205f13e 100644 --- a/external/jsoncpp/json_value.cpp +++ b/external/json/json_value.cpp @@ -1,16 +1,6 @@ -// Copyright 2007-2010 Baptiste Lepilleur -// Distributed under MIT license, or public domain if desired and -// recognized in your jurisdiction. -// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE - -#if !defined(JSON_IS_AMALGAMATION) -# include "value.h" -# include "writer.h" -# ifndef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR -# include "json_batchallocator.h" -# endif // #ifndef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR -#endif // if !defined(JSON_IS_AMALGAMATION) #include +#include +#include #include #include #include @@ -19,63 +9,106 @@ # include #endif #include // size_t - -#include +#ifndef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR +# include "json_batchallocator.h" +#endif // #ifndef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR #define JSON_ASSERT_UNREACHABLE assert( false ) #define JSON_ASSERT( condition ) assert( condition ); // @todo <= change this into an exception throw -#define JSON_FAIL_MESSAGE( message ) throw std::runtime_error( message ); -#define JSON_ASSERT_MESSAGE( condition, message ) if (!( condition )) JSON_FAIL_MESSAGE( message ) +#define JSON_ASSERT_MESSAGE( condition, message ) if (!( condition )) throw std::runtime_error( message ); -namespace CSJson { +namespace Json { -const Value Value::jsonNull; +const Value Value::null; const Int Value::minInt = Int( ~(UInt(-1)/2) ); const Int Value::maxInt = Int( UInt(-1)/2 ); const UInt Value::maxUInt = UInt(-1); -const Int64 Value::minInt64 = Int64( ~(UInt64(-1)/2) ); -const Int64 Value::maxInt64 = Int64( UInt64(-1)/2 ); -const UInt64 Value::maxUInt64 = UInt64(-1); -const LargestInt Value::minLargestInt = LargestInt( ~(LargestUInt(-1)/2) ); -const LargestInt Value::maxLargestInt = LargestInt( LargestUInt(-1)/2 ); -const LargestUInt Value::maxLargestUInt = LargestUInt(-1); +// A "safe" implementation of strdup. Allow null pointer to be passed. +// Also avoid warning on msvc80. +// +//inline char *safeStringDup( const char *czstring ) +//{ +// if ( czstring ) +// { +// const size_t length = (unsigned int)( strlen(czstring) + 1 ); +// char *newString = static_cast( malloc( length ) ); +// memcpy( newString, czstring, length ); +// return newString; +// } +// return 0; +//} +// +//inline char *safeStringDup( const std::string &str ) +//{ +// if ( !str.empty() ) +// { +// const size_t length = str.length(); +// char *newString = static_cast( malloc( length + 1 ) ); +// memcpy( newString, str.c_str(), length ); +// newString[length] = 0; +// return newString; +// } +// return 0; +//} -/// Unknown size marker -static const unsigned int unknown = (unsigned)-1; - - -/** Duplicates the specified string value. - * @param value Pointer to the string to duplicate. Must be zero-terminated if - * length is "unknown". - * @param length Length of the value. if equals to unknown, then it will be - * computed using strlen(value). - * @return Pointer on the duplicate instance of string. - */ -static inline char * -duplicateStringValue( const char *value, - unsigned int length = unknown ) +ValueAllocator::~ValueAllocator() { - if ( length == unknown ) - length = (unsigned int)strlen(value); - char *newString = static_cast( malloc( length + 1 ) ); - JSON_ASSERT_MESSAGE( newString != 0, "Failed to allocate string value buffer" ); - memcpy( newString, value, length ); - newString[length] = 0; - return newString; } - -/** Free the string duplicated by duplicateStringValue(). - */ -static inline void -releaseStringValue( char *value ) +class DefaultValueAllocator : public ValueAllocator { - if ( value ) - free( value ); +public: + virtual ~DefaultValueAllocator() + { + } + + virtual char *makeMemberName( const char *memberName ) + { + return duplicateStringValue( memberName ); + } + + virtual void releaseMemberName( char *memberName ) + { + releaseStringValue( memberName ); + } + + virtual char *duplicateStringValue( const char *value, + unsigned int length = unknown ) + { + //@todo invesgate this old optimization + //if ( !value || value[0] == 0 ) + // return 0; + + if ( length == unknown ) + length = (unsigned int)strlen(value); + char *newString = static_cast( malloc( length + 1 ) ); + memcpy( newString, value, length ); + newString[length] = 0; + return newString; + } + + virtual void releaseStringValue( char *value ) + { + if ( value ) + free( value ); + } +}; + +static ValueAllocator *&valueAllocator() +{ + static DefaultValueAllocator defaultAllocator; + static ValueAllocator *valueAllocator = &defaultAllocator; + return valueAllocator; } -} // namespace CSJson +static struct DummyValueAllocatorInitializer { + DummyValueAllocatorInitializer() + { + valueAllocator(); // ensure valueAllocator() statics are initialized before main(). + } +} dummyValueAllocatorInitializer; + // ////////////////////////////////////////////////////////////////// @@ -85,16 +118,13 @@ releaseStringValue( char *value ) // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// -#if !defined(JSON_IS_AMALGAMATION) -# ifdef JSON_VALUE_USE_INTERNAL_MAP -# include "json_internalarray.inl" -# include "json_internalmap.inl" -# endif // JSON_VALUE_USE_INTERNAL_MAP +#ifdef JSON_VALUE_USE_INTERNAL_MAP +# include "json_internalarray.inl" +# include "json_internalmap.inl" +#endif // JSON_VALUE_USE_INTERNAL_MAP # include "json_valueiterator.inl" -#endif // if !defined(JSON_IS_AMALGAMATION) -namespace CSJson { // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// @@ -113,7 +143,7 @@ Value::CommentInfo::CommentInfo() Value::CommentInfo::~CommentInfo() { if ( comment_ ) - releaseStringValue( comment_ ); + valueAllocator()->releaseStringValue( comment_ ); } @@ -121,11 +151,11 @@ void Value::CommentInfo::setComment( const char *text ) { if ( comment_ ) - releaseStringValue( comment_ ); - JSON_ASSERT( text != 0 ); + valueAllocator()->releaseStringValue( comment_ ); + JSON_ASSERT( text ); JSON_ASSERT_MESSAGE( text[0]=='\0' || text[0]=='/', "Comments must start with /"); // It seems that /**/ style comments are acceptable as well. - comment_ = duplicateStringValue( text ); + comment_ = valueAllocator()->duplicateStringValue( text ); } @@ -141,14 +171,14 @@ Value::CommentInfo::setComment( const char *text ) // Notes: index_ indicates if the string was allocated when // a string is stored. -Value::CZString::CZString( ArrayIndex index ) +Value::CZString::CZString( int index ) : cstr_( 0 ) , index_( index ) { } Value::CZString::CZString( const char *cstr, DuplicationPolicy allocate ) - : cstr_( allocate == duplicate ? duplicateStringValue(cstr) + : cstr_( allocate == duplicate ? valueAllocator()->makeMemberName(cstr) : cstr ) , index_( allocate ) { @@ -156,7 +186,7 @@ Value::CZString::CZString( const char *cstr, DuplicationPolicy allocate ) Value::CZString::CZString( const CZString &other ) : cstr_( other.index_ != noDuplication && other.cstr_ != 0 - ? duplicateStringValue( other.cstr_ ) + ? valueAllocator()->makeMemberName( other.cstr_ ) : other.cstr_ ) , index_( other.cstr_ ? (other.index_ == noDuplication ? noDuplication : duplicate) : other.index_ ) @@ -166,7 +196,7 @@ Value::CZString::CZString( const CZString &other ) Value::CZString::~CZString() { if ( cstr_ && index_ == duplicate ) - releaseStringValue( const_cast( cstr_ ) ); + valueAllocator()->releaseMemberName( const_cast( cstr_ ) ); } void @@ -201,7 +231,7 @@ Value::CZString::operator==( const CZString &other ) const } -ArrayIndex +int Value::CZString::index() const { return index_; @@ -279,17 +309,6 @@ Value::Value( ValueType type ) } -#if defined(JSON_HAS_INT64) -Value::Value( UInt value ) - : type_( uintValue ) - , comments_( 0 ) -# ifdef JSON_VALUE_USE_INTERNAL_MAP - , itemIsUsed_( 0 ) -#endif -{ - value_.uint_ = value; -} - Value::Value( Int value ) : type_( intValue ) , comments_( 0 ) @@ -300,21 +319,8 @@ Value::Value( Int value ) value_.int_ = value; } -#endif // if defined(JSON_HAS_INT64) - -Value::Value( Int64 value ) - : type_( intValue ) - , comments_( 0 ) -# ifdef JSON_VALUE_USE_INTERNAL_MAP - , itemIsUsed_( 0 ) -#endif -{ - value_.int_ = value; -} - - -Value::Value( UInt64 value ) +Value::Value( UInt value ) : type_( uintValue ) , comments_( 0 ) # ifdef JSON_VALUE_USE_INTERNAL_MAP @@ -342,7 +348,7 @@ Value::Value( const char *value ) , itemIsUsed_( 0 ) #endif { - value_.string_ = duplicateStringValue( value ); + value_.string_ = valueAllocator()->duplicateStringValue( value ); } @@ -355,8 +361,8 @@ Value::Value( const char *beginValue, , itemIsUsed_( 0 ) #endif { - value_.string_ = duplicateStringValue( beginValue, - (unsigned int)(endValue - beginValue) ); + value_.string_ = valueAllocator()->duplicateStringValue( beginValue, + UInt(endValue - beginValue) ); } @@ -368,8 +374,8 @@ Value::Value( const std::string &value ) , itemIsUsed_( 0 ) #endif { - value_.string_ = duplicateStringValue( value.c_str(), - (unsigned int)value.length() ); + value_.string_ = valueAllocator()->duplicateStringValue( value.c_str(), + (unsigned int)value.length() ); } @@ -394,7 +400,7 @@ Value::Value( const CppTL::ConstString &value ) , itemIsUsed_( 0 ) #endif { - value_.string_ = duplicateStringValue( value, value.length() ); + value_.string_ = valueAllocator()->duplicateStringValue( value, value.length() ); } # endif @@ -428,7 +434,7 @@ Value::Value( const Value &other ) case stringValue: if ( other.value_.string_ ) { - value_.string_ = duplicateStringValue( other.value_.string_ ); + value_.string_ = valueAllocator()->duplicateStringValue( other.value_.string_ ); allocated_ = true; } else @@ -475,17 +481,12 @@ Value::~Value() break; case stringValue: if ( allocated_ ) - releaseStringValue( value_.string_ ); + valueAllocator()->releaseStringValue( value_.string_ ); break; #ifndef JSON_VALUE_USE_INTERNAL_MAP case arrayValue: case objectValue: - if (value_.map_ != NULL) - { - value_.map_->clear(); - delete value_.map_; - value_.map_ = NULL; - } + delete value_.map_; break; #else case arrayValue: @@ -531,15 +532,34 @@ Value::type() const int -Value::compare( const Value &other ) const +Value::compare( const Value &other ) { - if ( *this < other ) - return -1; - if ( *this > other ) - return 1; - return 0; -} + /* + int typeDelta = other.type_ - type_; + switch ( type_ ) + { + case nullValue: + return other.type_ == type_; + case intValue: + if ( other.type_.isNumeric() + case uintValue: + case realValue: + case booleanValue: + break; + case stringValue, + break; + case arrayValue: + delete value_.array_; + break; + case objectValue: + delete value_.map_; + default: + JSON_ASSERT_UNREACHABLE; + } + */ + return 0; // unreachable +} bool Value::operator <( const Value &other ) const @@ -582,13 +602,13 @@ Value::operator <( const Value &other ) const default: JSON_ASSERT_UNREACHABLE; } - return false; // unreachable + return 0; // unreachable } bool Value::operator <=( const Value &other ) const { - return !(other < *this); + return !(other > *this); } bool @@ -644,7 +664,7 @@ Value::operator ==( const Value &other ) const default: JSON_ASSERT_UNREACHABLE; } - return false; // unreachable + return 0; // unreachable } bool @@ -677,7 +697,7 @@ Value::asString() const case realValue: case arrayValue: case objectValue: - JSON_FAIL_MESSAGE( "Type is not convertible to string" ); + JSON_ASSERT_MESSAGE( false, "Type is not convertible to string" ); default: JSON_ASSERT_UNREACHABLE; } @@ -692,7 +712,6 @@ Value::asConstString() const } # endif - Value::Int Value::asInt() const { @@ -701,11 +720,10 @@ Value::asInt() const case nullValue: return 0; case intValue: - JSON_ASSERT_MESSAGE( value_.int_ >= minInt && value_.int_ <= maxInt, "unsigned integer out of signed int range" ); - return Int(value_.int_); + return value_.int_; case uintValue: - JSON_ASSERT_MESSAGE( value_.uint_ <= UInt(maxInt), "unsigned integer out of signed int range" ); - return Int(value_.uint_); + JSON_ASSERT_MESSAGE( value_.uint_ < (unsigned)maxInt, "integer out of signed integer range" ); + return value_.uint_; case realValue: JSON_ASSERT_MESSAGE( value_.real_ >= minInt && value_.real_ <= maxInt, "Real out of signed integer range" ); return Int( value_.real_ ); @@ -714,14 +732,13 @@ Value::asInt() const case stringValue: case arrayValue: case objectValue: - JSON_FAIL_MESSAGE( "Type is not convertible to int" ); + JSON_ASSERT_MESSAGE( false, "Type is not convertible to int" ); default: JSON_ASSERT_UNREACHABLE; } return 0; // unreachable; } - Value::UInt Value::asUInt() const { @@ -731,11 +748,9 @@ Value::asUInt() const return 0; case intValue: JSON_ASSERT_MESSAGE( value_.int_ >= 0, "Negative integer can not be converted to unsigned integer" ); - JSON_ASSERT_MESSAGE( value_.int_ <= maxUInt, "signed integer out of UInt range" ); - return UInt(value_.int_); + return value_.int_; case uintValue: - JSON_ASSERT_MESSAGE( value_.uint_ <= maxUInt, "unsigned integer out of UInt range" ); - return UInt(value_.uint_); + return value_.uint_; case realValue: JSON_ASSERT_MESSAGE( value_.real_ >= 0 && value_.real_ <= maxUInt, "Real out of unsigned integer range" ); return UInt( value_.real_ ); @@ -744,95 +759,13 @@ Value::asUInt() const case stringValue: case arrayValue: case objectValue: - JSON_FAIL_MESSAGE( "Type is not convertible to uint" ); + JSON_ASSERT_MESSAGE( false, "Type is not convertible to uint" ); default: JSON_ASSERT_UNREACHABLE; } return 0; // unreachable; } - -# if defined(JSON_HAS_INT64) - -Value::Int64 -Value::asInt64() const -{ - switch ( type_ ) - { - case nullValue: - return 0; - case intValue: - return value_.int_; - case uintValue: - JSON_ASSERT_MESSAGE( value_.uint_ <= UInt64(maxInt64), "unsigned integer out of Int64 range" ); - return value_.uint_; - case realValue: - JSON_ASSERT_MESSAGE( value_.real_ >= minInt64 && value_.real_ <= maxInt64, "Real out of Int64 range" ); - return Int( value_.real_ ); - case booleanValue: - return value_.bool_ ? 1 : 0; - case stringValue: - case arrayValue: - case objectValue: - JSON_FAIL_MESSAGE( "Type is not convertible to Int64" ); - default: - JSON_ASSERT_UNREACHABLE; - } - return 0; // unreachable; -} - - -Value::UInt64 -Value::asUInt64() const -{ - switch ( type_ ) - { - case nullValue: - return 0; - case intValue: - JSON_ASSERT_MESSAGE( value_.int_ >= 0, "Negative integer can not be converted to UInt64" ); - return value_.int_; - case uintValue: - return value_.uint_; - case realValue: - JSON_ASSERT_MESSAGE( value_.real_ >= 0 && value_.real_ <= maxUInt64, "Real out of UInt64 range" ); - return UInt( value_.real_ ); - case booleanValue: - return value_.bool_ ? 1 : 0; - case stringValue: - case arrayValue: - case objectValue: - JSON_FAIL_MESSAGE( "Type is not convertible to UInt64" ); - default: - JSON_ASSERT_UNREACHABLE; - } - return 0; // unreachable; -} -# endif // if defined(JSON_HAS_INT64) - - -LargestInt -Value::asLargestInt() const -{ -#if defined(JSON_NO_INT64) - return asInt(); -#else - return asInt64(); -#endif -} - - -LargestUInt -Value::asLargestUInt() const -{ -#if defined(JSON_NO_INT64) - return asUInt(); -#else - return asUInt64(); -#endif -} - - double Value::asDouble() const { @@ -841,13 +774,9 @@ Value::asDouble() const case nullValue: return 0.0; case intValue: - return static_cast( value_.int_ ); + return value_.int_; case uintValue: -#if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) - return static_cast( value_.uint_ ); -#else // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) - return static_cast( Int(value_.uint_/2) ) * 2 + Int(value_.uint_ & 1); -#endif // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) + return value_.uint_; case realValue: return value_.real_; case booleanValue: @@ -855,42 +784,13 @@ Value::asDouble() const case stringValue: case arrayValue: case objectValue: - JSON_FAIL_MESSAGE( "Type is not convertible to double" ); + JSON_ASSERT_MESSAGE( false, "Type is not convertible to double" ); default: JSON_ASSERT_UNREACHABLE; } return 0; // unreachable; } -float -Value::asFloat() const -{ - switch ( type_ ) - { - case nullValue: - return 0.0f; - case intValue: - return static_cast( value_.int_ ); - case uintValue: -#if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) - return static_cast( value_.uint_ ); -#else // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) - return static_cast( Int(value_.uint_/2) ) * 2 + Int(value_.uint_ & 1); -#endif // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) - case realValue: - return static_cast( value_.real_ ); - case booleanValue: - return value_.bool_ ? 1.0f : 0.0f; - case stringValue: - case arrayValue: - case objectValue: - JSON_FAIL_MESSAGE( "Type is not convertible to float" ); - default: - JSON_ASSERT_UNREACHABLE; - } - return 0.0f; // unreachable; -} - bool Value::asBool() const { @@ -969,7 +869,7 @@ Value::isConvertibleTo( ValueType other ) const /// Number of values in array or object -ArrayIndex +Value::UInt Value::size() const { switch ( type_ ) @@ -991,7 +891,7 @@ Value::size() const } return 0; case objectValue: - return ArrayIndex( value_.map_->size() ); + return Int( value_.map_->size() ); #else case arrayValue: return Int( value_.array_->size() ); @@ -1032,18 +932,7 @@ Value::clear() #ifndef JSON_VALUE_USE_INTERNAL_MAP case arrayValue: case objectValue: - // value_.map_->clear(); - if (value_.map_ != NULL) - { - value_.map_->clear(); - delete value_.map_; - value_.map_ = NULL; - } - if (value_.string_ != NULL) - { - delete value_.string_; - value_.string_ = NULL; - } + value_.map_->clear(); break; #else case arrayValue: @@ -1059,23 +948,21 @@ Value::clear() } void -Value::resize( ArrayIndex newSize ) +Value::resize( UInt newSize ) { JSON_ASSERT( type_ == nullValue || type_ == arrayValue ); if ( type_ == nullValue ) *this = Value( arrayValue ); #ifndef JSON_VALUE_USE_INTERNAL_MAP - ArrayIndex oldSize = size(); + UInt oldSize = size(); if ( newSize == 0 ) clear(); else if ( newSize > oldSize ) (*this)[ newSize - 1 ]; else { - for ( ArrayIndex index = newSize; index < oldSize; ++index ) - { + for ( UInt index = newSize; index < oldSize; ++index ) value_.map_->erase( index ); - } assert( size() == newSize ); } #else @@ -1085,7 +972,7 @@ Value::resize( ArrayIndex newSize ) Value & -Value::operator[]( ArrayIndex index ) +Value::operator[]( UInt index ) { JSON_ASSERT( type_ == nullValue || type_ == arrayValue ); if ( type_ == nullValue ) @@ -1096,7 +983,7 @@ Value::operator[]( ArrayIndex index ) if ( it != value_.map_->end() && (*it).first == key ) return (*it).second; - ObjectValues::value_type defaultValue( key, jsonNull ); + ObjectValues::value_type defaultValue( key, null ); it = value_.map_->insert( it, defaultValue ); return (*it).second; #else @@ -1105,25 +992,17 @@ Value::operator[]( ArrayIndex index ) } -Value & -Value::operator[]( int index ) -{ - JSON_ASSERT( index >= 0 ); - return (*this)[ ArrayIndex(index) ]; -} - - const Value & -Value::operator[]( ArrayIndex index ) const +Value::operator[]( UInt index ) const { JSON_ASSERT( type_ == nullValue || type_ == arrayValue ); if ( type_ == nullValue ) - return jsonNull; + return null; #ifndef JSON_VALUE_USE_INTERNAL_MAP CZString key( index ); ObjectValues::const_iterator it = value_.map_->find( key ); if ( it == value_.map_->end() ) - return jsonNull; + return null; return (*it).second; #else Value *value = value_.array_->find( index ); @@ -1132,14 +1011,6 @@ Value::operator[]( ArrayIndex index ) const } -const Value & -Value::operator[]( int index ) const -{ - JSON_ASSERT( index >= 0 ); - return (*this)[ ArrayIndex(index) ]; -} - - Value & Value::operator[]( const char *key ) { @@ -1161,7 +1032,7 @@ Value::resolveReference( const char *key, if ( it != value_.map_->end() && (*it).first == actualKey ) return (*it).second; - ObjectValues::value_type defaultValue( actualKey, jsonNull ); + ObjectValues::value_type defaultValue( actualKey, null ); it = value_.map_->insert( it, defaultValue ); Value &value = (*it).second; return value; @@ -1172,16 +1043,16 @@ Value::resolveReference( const char *key, Value -Value::get( ArrayIndex index, +Value::get( UInt index, const Value &defaultValue ) const { const Value *value = &((*this)[index]); - return value == &jsonNull ? defaultValue : *value; + return value == &null ? defaultValue : *value; } bool -Value::isValidIndex( ArrayIndex index ) const +Value::isValidIndex( UInt index ) const { return index < size(); } @@ -1193,12 +1064,12 @@ Value::operator[]( const char *key ) const { JSON_ASSERT( type_ == nullValue || type_ == objectValue ); if ( type_ == nullValue ) - return jsonNull; + return null; #ifndef JSON_VALUE_USE_INTERNAL_MAP CZString actualKey( key, CZString::noDuplication ); ObjectValues::const_iterator it = value_.map_->find( actualKey ); if ( it == value_.map_->end() ) - return jsonNull; + return null; return (*it).second; #else const Value *value = value_.map_->find( key ); @@ -1255,7 +1126,7 @@ Value::get( const char *key, const Value &defaultValue ) const { const Value *value = &((*this)[key]); - return value == &jsonNull ? defaultValue : *value; + return value == &null ? defaultValue : *value; } @@ -1271,12 +1142,12 @@ Value::removeMember( const char* key ) { JSON_ASSERT( type_ == nullValue || type_ == objectValue ); if ( type_ == nullValue ) - return jsonNull; + return null; #ifndef JSON_VALUE_USE_INTERNAL_MAP CZString actualKey( key, CZString::noDuplication ); ObjectValues::iterator it = value_.map_->find( actualKey ); if ( it == value_.map_->end() ) - return jsonNull; + return null; Value old(it->second); value_.map_->erase(it); return old; @@ -1311,7 +1182,7 @@ bool Value::isMember( const char *key ) const { const Value *value = &((*this)[key]); - return value != &jsonNull; + return value != &null; } @@ -1394,7 +1265,7 @@ Value::isBool() const } -bool +bool Value::isInt() const { return type_ == intValue; @@ -1644,7 +1515,7 @@ PathArgument::PathArgument() } -PathArgument::PathArgument( ArrayIndex index ) +PathArgument::PathArgument( Value::UInt index ) : index_( index ) , kind_( kindIndex ) { @@ -1700,9 +1571,9 @@ Path::makePath( const std::string &path, addPathInArg( path, in, itInArg, PathArgument::kindIndex ); else { - ArrayIndex index = 0; + Value::UInt index = 0; for ( ; current != end && *current >= '0' && *current <= '9'; ++current ) - index = index * 10 + ArrayIndex(*current - '0'); + index = index * 10 + Value::UInt(*current - '0'); args_.push_back( index ); } if ( current == end || *current++ != ']' ) @@ -1779,7 +1650,7 @@ Path::resolve( const Value &root ) const // Error: unable to resolve path (object value expected at position...) } node = &((*node)[arg.key_]); - if ( node == &Value::jsonNull ) + if ( node == &Value::null ) { // Error: unable to resolve path (object has no member named '' at position...) } @@ -1808,7 +1679,7 @@ Path::resolve( const Value &root, if ( !node->isObject() ) return defaultValue; node = &((*node)[arg.key_]); - if ( node == &Value::jsonNull ) + if ( node == &Value::null ) return defaultValue; } } @@ -1844,4 +1715,4 @@ Path::make( Value &root ) const } -} // namespace CSJson +} // namespace Json diff --git a/external/jsoncpp/json_valueiterator.inl b/external/json/json_valueiterator.inl similarity index 96% rename from external/jsoncpp/json_valueiterator.inl rename to external/json/json_valueiterator.inl index 6cfdc0a812..736e260ea0 100644 --- a/external/jsoncpp/json_valueiterator.inl +++ b/external/json/json_valueiterator.inl @@ -1,11 +1,6 @@ -// Copyright 2007-2010 Baptiste Lepilleur -// Distributed under MIT license, or public domain if desired and -// recognized in your jurisdiction. -// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE - // included by json_value.cpp +// everything is within Json namespace -namespace CSJson { // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// @@ -295,5 +290,3 @@ ValueIterator::operator =( const SelfType &other ) copy( other ); return *this; } - -} // namespace CSJson diff --git a/external/jsoncpp/json_writer.cpp b/external/json/json_writer.cpp similarity index 93% rename from external/jsoncpp/json_writer.cpp rename to external/json/json_writer.cpp index a6345ee6ff..cdf4188f2e 100644 --- a/external/jsoncpp/json_writer.cpp +++ b/external/json/json_writer.cpp @@ -1,12 +1,4 @@ -// Copyright 2007-2010 Baptiste Lepilleur -// Distributed under MIT license, or public domain if desired and -// recognized in your jurisdiction. -// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE - -#if !defined(JSON_IS_AMALGAMATION) -# include "writer.h" -# include "json_tool.h" -#endif // if !defined(JSON_IS_AMALGAMATION) +#include #include #include #include @@ -19,7 +11,12 @@ #pragma warning( disable : 4996 ) // disable warning about strdup being deprecated. #endif -namespace CSJson { +namespace Json { + +static bool isControlCharacter(char ch) +{ + return ch > 0 && ch <= 0x1F; +} static bool containsControlCharacter( const char* str ) { @@ -30,16 +27,26 @@ static bool containsControlCharacter( const char* str ) } return false; } - - -std::string valueToString( LargestInt value ) +static void uintToString( unsigned int value, + char *¤t ) { - UIntToStringBuffer buffer; + *--current = 0; + do + { + *--current = (value % 10) + '0'; + value /= 10; + } + while ( value != 0 ); +} + +std::string valueToString( Int value ) +{ + char buffer[32]; char *current = buffer + sizeof(buffer); bool isNegative = value < 0; if ( isNegative ) value = -value; - uintToString( LargestUInt(value), current ); + uintToString( UInt(value), current ); if ( isNegative ) *--current = '-'; assert( current >= buffer ); @@ -47,31 +54,15 @@ std::string valueToString( LargestInt value ) } -std::string valueToString( LargestUInt value ) +std::string valueToString( UInt value ) { - UIntToStringBuffer buffer; + char buffer[32]; char *current = buffer + sizeof(buffer); uintToString( value, current ); assert( current >= buffer ); return current; } -#if defined(JSON_HAS_INT64) - -std::string valueToString( Int value ) -{ - return valueToString( LargestInt(value) ); -} - - -std::string valueToString( UInt value ) -{ - return valueToString( LargestUInt(value) ); -} - -#endif // # if defined(JSON_HAS_INT64) - - std::string valueToString( double value ) { char buffer[32]; @@ -125,7 +116,7 @@ std::string valueToQuotedString( const char *value ) // We have to walk value and escape any special characters. // Appending to std::string is not efficient, but this should be rare. // (Note: forward slashes are *not* rare, but I am not escaping them.) - std::string::size_type maxsize = strlen(value)*2 + 3; // allescaped+quotes+NULL + unsigned maxsize = strlen(value)*2 + 3; // allescaped+quotes+NULL std::string result; result.reserve(maxsize); // to avoid lots of mallocs result += "\""; @@ -222,10 +213,10 @@ FastWriter::writeValue( const Value &value ) document_ += "null"; break; case intValue: - document_ += valueToString( value.asLargestInt() ); + document_ += valueToString( value.asInt() ); break; case uintValue: - document_ += valueToString( value.asLargestUInt() ); + document_ += valueToString( value.asUInt() ); break; case realValue: document_ += valueToString( value.asDouble() ); @@ -305,10 +296,10 @@ StyledWriter::writeValue( const Value &value ) pushValue( "null" ); break; case intValue: - pushValue( valueToString( value.asLargestInt() ) ); + pushValue( valueToString( value.asInt() ) ); break; case uintValue: - pushValue( valueToString( value.asLargestUInt() ) ); + pushValue( valueToString( value.asUInt() ) ); break; case realValue: pushValue( valueToString( value.asDouble() ) ); @@ -332,7 +323,7 @@ StyledWriter::writeValue( const Value &value ) writeWithIndent( "{" ); indent(); Value::Members::iterator it = members.begin(); - for (;;) + while ( true ) { const std::string &name = *it; const Value &childValue = value[name]; @@ -372,7 +363,7 @@ StyledWriter::writeArrayValue( const Value &value ) indent(); bool hasChildValue = !childValues_.empty(); unsigned index =0; - for (;;) + while ( true ) { const Value &childValue = value[index]; writeCommentBeforeValue( childValue ); @@ -581,10 +572,10 @@ StyledStreamWriter::writeValue( const Value &value ) pushValue( "null" ); break; case intValue: - pushValue( valueToString( value.asLargestInt() ) ); + pushValue( valueToString( value.asInt() ) ); break; case uintValue: - pushValue( valueToString( value.asLargestUInt() ) ); + pushValue( valueToString( value.asUInt() ) ); break; case realValue: pushValue( valueToString( value.asDouble() ) ); @@ -608,7 +599,7 @@ StyledStreamWriter::writeValue( const Value &value ) writeWithIndent( "{" ); indent(); Value::Members::iterator it = members.begin(); - for (;;) + while ( true ) { const std::string &name = *it; const Value &childValue = value[name]; @@ -648,7 +639,7 @@ StyledStreamWriter::writeArrayValue( const Value &value ) indent(); bool hasChildValue = !childValues_.empty(); unsigned index =0; - for (;;) + while ( true ) { const Value &childValue = value[index]; writeCommentBeforeValue( childValue ); @@ -656,7 +647,7 @@ StyledStreamWriter::writeArrayValue( const Value &value ) writeWithIndent( childValues_[index] ); else { - writeIndent(); + writeIndent(); writeValue( childValue ); } if ( ++index == size ) @@ -829,10 +820,10 @@ StyledStreamWriter::normalizeEOL( const std::string &text ) std::ostream& operator<<( std::ostream &sout, const Value &root ) { - CSJson::StyledStreamWriter writer; + Json::StyledStreamWriter writer; writer.write(sout, root); return sout; } -} // namespace CSJson +} // namespace Json diff --git a/external/jsoncpp/reader.h b/external/json/reader.h similarity index 82% rename from external/jsoncpp/reader.h rename to external/json/reader.h index cb58e864a0..ee1d6a2444 100644 --- a/external/jsoncpp/reader.h +++ b/external/json/reader.h @@ -1,21 +1,14 @@ -// Copyright 2007-2010 Baptiste Lepilleur -// Distributed under MIT license, or public domain if desired and -// recognized in your jurisdiction. -// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE - #ifndef CPPTL_JSON_READER_H_INCLUDED # define CPPTL_JSON_READER_H_INCLUDED -#if !defined(JSON_IS_AMALGAMATION) # include "features.h" # include "value.h" -#endif // if !defined(JSON_IS_AMALGAMATION) # include # include # include # include -namespace CSJson { +namespace Json { /** \brief Unserialize a JSON document into a Value. * @@ -51,9 +44,7 @@ namespace CSJson { bool collectComments = true ); /** \brief Read a Value from a JSON document. - * \param beginDoc Pointer on the beginning of the UTF-8 encoded string of the document to read. - * \param endDoc Pointer on the end of the UTF-8 encoded string of the document to read. - \ Must be >= beginDoc. + * \param document UTF-8 encoded string containing the document to read. * \param root [out] Contains the root value of the document if it was * successfully parsed. * \param collectComments \c true to collect comment and allow writing them back during @@ -67,7 +58,7 @@ namespace CSJson { bool collectComments = true ); /// \brief Parse from input stream. - /// \see CSJson::operator>>(std::istream&, CSJson::Value&). + /// \see Json::operator>>(std::istream&, Json::Value&). bool parse( std::istream &is, Value &root, bool collectComments = true ); @@ -76,18 +67,9 @@ namespace CSJson { * \return Formatted error message with the list of errors with their location in * the parsed document. An empty string is returned if no error occurred * during parsing. - * \deprecated Use getFormattedErrorMessages() instead (typo fix). */ - JSONCPP_DEPRECATED("Use getFormattedErrorMessages instead") std::string getFormatedErrorMessages() const; - /** \brief Returns a user friendly string that list errors in the parsed document. - * \return Formatted error message with the list of errors with their location in - * the parsed document. An empty string is returned if no error occurred - * during parsing. - */ - std::string getFormattedErrorMessages() const; - private: enum TokenType { @@ -190,25 +172,25 @@ namespace CSJson { This can be used to read a file into a particular sub-object. For example: \code - CSJson::Value root; + Json::Value root; cin >> root["dir"]["file"]; cout << root; \endcode Result: \verbatim { - "dir": { - "file": { - // The input stream JSON would be nested here. - } - } + "dir": { + "file": { + // The input stream JSON would be nested here. + } + } } \endverbatim \throw std::exception on parse error. - \see CSJson::operator<<() + \see Json::operator<<() */ std::istream& operator>>( std::istream&, Value& ); -} // namespace CSJson +} // namespace Json #endif // CPPTL_JSON_READER_H_INCLUDED diff --git a/external/jsoncpp/sconscript b/external/json/sconscript similarity index 100% rename from external/jsoncpp/sconscript rename to external/json/sconscript diff --git a/external/jsoncpp/value.h b/external/json/value.h similarity index 90% rename from external/jsoncpp/value.h rename to external/json/value.h index 73c612c94e..58bfd88e7a 100644 --- a/external/jsoncpp/value.h +++ b/external/json/value.h @@ -1,14 +1,7 @@ -// Copyright 2007-2010 Baptiste Lepilleur -// Distributed under MIT license, or public domain if desired and -// recognized in your jurisdiction. -// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE - #ifndef CPPTL_JSON_H_INCLUDED # define CPPTL_JSON_H_INCLUDED -#if !defined(JSON_IS_AMALGAMATION) # include "forwards.h" -#endif // if !defined(JSON_IS_AMALGAMATION) # include # include @@ -23,7 +16,7 @@ /** \brief JSON (JavaScript Object Notation). */ -namespace CSJson { +namespace Json { /** \brief Type of the value held by a Value object. */ @@ -60,8 +53,8 @@ namespace CSJson { * * Example of usage: * \code - * CSJson::Value aValue( StaticString("some text") ); - * CSJson::Value object; + * Json::Value aValue( StaticString("some text") ); + * Json::Value object; * static const StaticString code("code"); * object[code] = 1234; * \endcode @@ -126,38 +119,15 @@ namespace CSJson { typedef std::vector Members; typedef ValueIterator iterator; typedef ValueConstIterator const_iterator; - typedef CSJson::UInt UInt; - typedef CSJson::Int Int; -# if defined(JSON_HAS_INT64) - typedef CSJson::UInt64 UInt64; - typedef CSJson::Int64 Int64; -#endif // defined(JSON_HAS_INT64) - typedef CSJson::LargestInt LargestInt; - typedef CSJson::LargestUInt LargestUInt; - typedef CSJson::ArrayIndex ArrayIndex; + typedef Json::UInt UInt; + typedef Json::Int Int; + typedef UInt ArrayIndex; - static const Value jsonNull; - /// Minimum signed integer value that can be stored in a CSJson::Value. - static const LargestInt minLargestInt; - /// Maximum signed integer value that can be stored in a CSJson::Value. - static const LargestInt maxLargestInt; - /// Maximum unsigned integer value that can be stored in a CSJson::Value. - static const LargestUInt maxLargestUInt; - - /// Minimum signed int value that can be stored in a CSJson::Value. + static const Value null; static const Int minInt; - /// Maximum signed int value that can be stored in a CSJson::Value. static const Int maxInt; - /// Maximum unsigned int value that can be stored in a CSJson::Value. static const UInt maxUInt; - /// Minimum signed 64 bits int value that can be stored in a CSJson::Value. - static const Int64 minInt64; - /// Maximum signed 64 bits int value that can be stored in a CSJson::Value. - static const Int64 maxInt64; - /// Maximum unsigned 64 bits int value that can be stored in a CSJson::Value. - static const UInt64 maxUInt64; - private: #ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION # ifndef JSON_VALUE_USE_INTERNAL_MAP @@ -170,20 +140,20 @@ namespace CSJson { duplicate, duplicateOnCopy }; - CZString( ArrayIndex index ); + CZString( int index ); CZString( const char *cstr, DuplicationPolicy allocate ); CZString( const CZString &other ); ~CZString(); CZString &operator =( const CZString &other ); bool operator<( const CZString &other ) const; bool operator==( const CZString &other ) const; - ArrayIndex index() const; + int index() const; const char *c_str() const; bool isStaticString() const; private: void swap( CZString &other ); const char *cstr_; - ArrayIndex index_; + int index_; }; public: @@ -202,22 +172,18 @@ namespace CSJson { To create an empty array, pass arrayValue. To create an empty object, pass objectValue. Another Value can then be set to this one by assignment. - This is useful since clear() and resize() will not alter types. + This is useful since clear() and resize() will not alter types. Examples: - \code - CSJson::Value null_value; // null - CSJson::Value arr_value(Json::arrayValue); // [] - CSJson::Value obj_value(Json::objectValue); // {} - \endcode + \code + Json::Value null_value; // null + Json::Value arr_value(Json::arrayValue); // [] + Json::Value obj_value(Json::objectValue); // {} + \endcode */ Value( ValueType type = nullValue ); Value( Int value ); Value( UInt value ); -#if defined(JSON_HAS_INT64) - Value( Int64 value ); - Value( UInt64 value ); -#endif // if defined(JSON_HAS_INT64) Value( double value ); Value( const char *value ); Value( const char *beginValue, const char *endValue ); @@ -228,7 +194,7 @@ namespace CSJson { * constructor. * Example of usage: * \code - * CSJson::Value aValue( StaticString("some text") ); + * Json::Value aValue( StaticString("some text") ); * \endcode */ Value( const StaticString &value ); @@ -256,7 +222,7 @@ namespace CSJson { bool operator ==( const Value &other ) const; bool operator !=( const Value &other ) const; - int compare( const Value &other ) const; + int compare( const Value &other ); const char *asCString() const; std::string asString() const; @@ -265,11 +231,6 @@ namespace CSJson { # endif Int asInt() const; UInt asUInt() const; - Int64 asInt64() const; - UInt64 asUInt64() const; - LargestInt asLargestInt() const; - LargestUInt asLargestUInt() const; - float asFloat() const; double asDouble() const; bool asBool() const; @@ -287,7 +248,7 @@ namespace CSJson { bool isConvertibleTo( ValueType other ) const; /// Number of values in array or object - ArrayIndex size() const; + UInt size() const; /// \brief Return true if empty array, empty object, or null; /// otherwise, false. @@ -306,38 +267,24 @@ namespace CSJson { /// May only be called on nullValue or arrayValue. /// \pre type() is arrayValue or nullValue /// \post type() is arrayValue - void resize( ArrayIndex size ); + void resize( UInt size ); /// Access an array element (zero based index ). /// If the array contains less than index element, then null value are inserted /// in the array so that its size is index+1. /// (You may need to say 'value[0u]' to get your compiler to distinguish /// this from the operator[] which takes a string.) - Value &operator[]( ArrayIndex index ); - - /// Access an array element (zero based index ). - /// If the array contains less than index element, then null value are inserted - /// in the array so that its size is index+1. - /// (You may need to say 'value[0u]' to get your compiler to distinguish - /// this from the operator[] which takes a string.) - Value &operator[]( int index ); - + Value &operator[]( UInt index ); /// Access an array element (zero based index ) /// (You may need to say 'value[0u]' to get your compiler to distinguish /// this from the operator[] which takes a string.) - const Value &operator[]( ArrayIndex index ) const; - - /// Access an array element (zero based index ) - /// (You may need to say 'value[0u]' to get your compiler to distinguish - /// this from the operator[] which takes a string.) - const Value &operator[]( int index ) const; - + const Value &operator[]( UInt index ) const; /// If the array contains at least index+1 elements, returns the element value, /// otherwise returns defaultValue. - Value get( ArrayIndex index, + Value get( UInt index, const Value &defaultValue ) const; /// Return true if index < size(). - bool isValidIndex( ArrayIndex index ) const; + bool isValidIndex( UInt index ) const; /// \brief Append value to array at the end. /// /// Equivalent to jsonvalue[jsonvalue.size()] = value; @@ -357,7 +304,7 @@ namespace CSJson { * the new entry is not duplicated. * Example of use: * \code - * CSJson::Value object; + * Json::Value object; * static const StaticString code("code"); * object[code] = 1234; * \endcode @@ -477,8 +424,8 @@ namespace CSJson { union ValueHolder { - LargestInt int_; - LargestUInt uint_; + Int int_; + UInt uint_; double real_; bool bool_; char *string_; @@ -507,7 +454,7 @@ namespace CSJson { friend class Path; PathArgument(); - PathArgument( ArrayIndex index ); + PathArgument( UInt index ); PathArgument( const char *key ); PathArgument( const std::string &key ); @@ -519,7 +466,7 @@ namespace CSJson { kindKey }; std::string key_; - ArrayIndex index_; + UInt index_; Kind kind_; }; @@ -566,7 +513,26 @@ namespace CSJson { Args args_; }; + /** \brief Experimental do not use: Allocator to customize member name and string value memory management done by Value. + * + * - makeMemberName() and releaseMemberName() are called to respectively duplicate and + * free an Json::objectValue member name. + * - duplicateStringValue() and releaseStringValue() are called similarly to + * duplicate and free a Json::stringValue value. + */ + class ValueAllocator + { + public: + enum { unknown = (unsigned)-1 }; + virtual ~ValueAllocator(); + + virtual char *makeMemberName( const char *memberName ) = 0; + virtual void releaseMemberName( char *memberName ) = 0; + virtual char *duplicateStringValue( const char *value, + unsigned int length = unknown ) = 0; + virtual void releaseStringValue( char *value ) = 0; + }; #ifdef JSON_VALUE_USE_INTERNAL_MAP /** \brief Allocator to customize Value internal map. @@ -1097,7 +1063,7 @@ public: // overridden from ValueArrayAllocator }; -} // namespace CSJson +} // namespace Json #endif // CPPTL_JSON_H_INCLUDED diff --git a/external/jsoncpp/writer.h b/external/json/writer.h similarity index 91% rename from external/jsoncpp/writer.h rename to external/json/writer.h index d8f057a211..5f4b83be41 100644 --- a/external/jsoncpp/writer.h +++ b/external/json/writer.h @@ -1,19 +1,12 @@ -// Copyright 2007-2010 Baptiste Lepilleur -// Distributed under MIT license, or public domain if desired and -// recognized in your jurisdiction. -// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE - #ifndef JSON_WRITER_H_INCLUDED # define JSON_WRITER_H_INCLUDED -#if !defined(JSON_IS_AMALGAMATION) # include "value.h" -#endif // if !defined(JSON_IS_AMALGAMATION) # include # include # include -namespace CSJson { +namespace Json { class Value; @@ -164,21 +157,17 @@ namespace CSJson { bool addChildValues_; }; -# if defined(JSON_HAS_INT64) std::string JSON_API valueToString( Int value ); std::string JSON_API valueToString( UInt value ); -# endif // if defined(JSON_HAS_INT64) - std::string JSON_API valueToString( LargestInt value ); - std::string JSON_API valueToString( LargestUInt value ); std::string JSON_API valueToString( double value ); std::string JSON_API valueToString( bool value ); std::string JSON_API valueToQuotedString( const char *value ); /// \brief Output using the StyledStreamWriter. - /// \see CSJson::operator>>() + /// \see Json::operator>>() std::ostream& operator<<( std::ostream&, const Value &root ); -} // namespace CSJson +} // namespace Json diff --git a/external/jsoncpp/config.h b/external/jsoncpp/config.h deleted file mode 100644 index 16a7e0d2c4..0000000000 --- a/external/jsoncpp/config.h +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright 2007-2010 Baptiste Lepilleur -// Distributed under MIT license, or public domain if desired and -// recognized in your jurisdiction. -// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE - -#ifndef JSON_CONFIG_H_INCLUDED -# define JSON_CONFIG_H_INCLUDED - -/// If defined, indicates that json library is embedded in CppTL library. -//# define JSON_IN_CPPTL 1 - -/// If defined, indicates that json may leverage CppTL library -//# define JSON_USE_CPPTL 1 -/// If defined, indicates that cpptl vector based map should be used instead of std::map -/// as Value container. -//# define JSON_USE_CPPTL_SMALLMAP 1 -/// If defined, indicates that Json specific container should be used -/// (hash table & simple deque container with customizable allocator). -/// THIS FEATURE IS STILL EXPERIMENTAL! There is know bugs: See #3177332 -//# define JSON_VALUE_USE_INTERNAL_MAP 1 -/// Force usage of standard new/malloc based allocator instead of memory pool based allocator. -/// The memory pools allocator used optimization (initializing Value and ValueInternalLink -/// as if it was a POD) that may cause some validation tool to report errors. -/// Only has effects if JSON_VALUE_USE_INTERNAL_MAP is defined. -//# define JSON_USE_SIMPLE_INTERNAL_ALLOCATOR 1 - -/// If defined, indicates that Json use exception to report invalid type manipulation -/// instead of C assert macro. -# define JSON_USE_EXCEPTION 1 - -/// If defined, indicates that the source file is amalgated -/// to prevent private header inclusion. -/// Remarks: it is automatically defined in the generated amalgated header. -// #define JSON_IS_AMALGAMATION - - -# ifdef JSON_IN_CPPTL -# include -# ifndef JSON_USE_CPPTL -# define JSON_USE_CPPTL 1 -# endif -# endif - -# ifdef JSON_IN_CPPTL -# define JSON_API CPPTL_API -# elif defined(JSON_DLL_BUILD) -# define JSON_API __declspec(dllexport) -# elif defined(JSON_DLL) -# define JSON_API __declspec(dllimport) -# else -# define JSON_API -# endif - -// If JSON_NO_INT64 is defined, then Json only support C++ "int" type for integer -// Storages, and 64 bits integer support is disabled. -// #define JSON_NO_INT64 1 - -#if defined(_MSC_VER) && _MSC_VER <= 1200 // MSVC 6 -// Microsoft Visual Studio 6 only support conversion from __int64 to double -// (no conversion from unsigned __int64). -#define JSON_USE_INT64_DOUBLE_CONVERSION 1 -#endif // if defined(_MSC_VER) && _MSC_VER < 1200 // MSVC 6 - -#if defined(_MSC_VER) && _MSC_VER >= 1500 // MSVC 2008 -/// Indicates that the following function is deprecated. -# define JSONCPP_DEPRECATED(message) __declspec(deprecated(message)) -#endif - -#if !defined(JSONCPP_DEPRECATED) -# define JSONCPP_DEPRECATED(message) -#endif // if !defined(JSONCPP_DEPRECATED) - -namespace CSJson { - typedef int Int; - typedef unsigned int UInt; -# if defined(JSON_NO_INT64) - typedef int LargestInt; - typedef unsigned int LargestUInt; -# undef JSON_HAS_INT64 -# else // if defined(JSON_NO_INT64) - // For Microsoft Visual use specific types as long long is not supported -# if defined(_MSC_VER) // Microsoft Visual Studio - typedef __int64 Int64; - typedef unsigned __int64 UInt64; -# else // if defined(_MSC_VER) // Other platforms, use long long - typedef long long int Int64; - typedef unsigned long long int UInt64; -# endif // if defined(_MSC_VER) - typedef Int64 LargestInt; - typedef UInt64 LargestUInt; -# define JSON_HAS_INT64 -# endif // if defined(JSON_NO_INT64) -} // end namespace CSJson - - -#endif // JSON_CONFIG_H_INCLUDED diff --git a/external/jsoncpp/json_lib.h b/external/jsoncpp/json_lib.h deleted file mode 100644 index da5fc967eb..0000000000 --- a/external/jsoncpp/json_lib.h +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2007-2010 Baptiste Lepilleur -// Distributed under MIT license, or public domain if desired and -// recognized in your jurisdiction. -// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE - -#ifndef JSON_JSON_H_INCLUDED -# define JSON_JSON_H_INCLUDED - -# include "autolink.h" -# include "value.h" -# include "reader.h" -# include "writer.h" -# include "features.h" - -#endif // JSON_JSON_H_INCLUDED diff --git a/external/jsoncpp/json_tool.h b/external/jsoncpp/json_tool.h deleted file mode 100644 index 4641ad5953..0000000000 --- a/external/jsoncpp/json_tool.h +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2007-2010 Baptiste Lepilleur -// Distributed under MIT license, or public domain if desired and -// recognized in your jurisdiction. -// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE - -#ifndef LIB_JSONCPP_JSON_TOOL_H_INCLUDED -# define LIB_JSONCPP_JSON_TOOL_H_INCLUDED - -/* This header provides common string manipulation support, such as UTF-8, - * portable conversion from/to string... - * - * It is an internal header that must not be exposed. - */ - -namespace CSJson { - -/// Converts a unicode code-point to UTF-8. -static inline std::string -codePointToUTF8(unsigned int cp) -{ - std::string result; - - // based on description from http://en.wikipedia.org/wiki/UTF-8 - - if (cp <= 0x7f) - { - result.resize(1); - result[0] = static_cast(cp); - } - else if (cp <= 0x7FF) - { - result.resize(2); - result[1] = static_cast(0x80 | (0x3f & cp)); - result[0] = static_cast(0xC0 | (0x1f & (cp >> 6))); - } - else if (cp <= 0xFFFF) - { - result.resize(3); - result[2] = static_cast(0x80 | (0x3f & cp)); - result[1] = 0x80 | static_cast((0x3f & (cp >> 6))); - result[0] = 0xE0 | static_cast((0xf & (cp >> 12))); - } - else if (cp <= 0x10FFFF) - { - result.resize(4); - result[3] = static_cast(0x80 | (0x3f & cp)); - result[2] = static_cast(0x80 | (0x3f & (cp >> 6))); - result[1] = static_cast(0x80 | (0x3f & (cp >> 12))); - result[0] = static_cast(0xF0 | (0x7 & (cp >> 18))); - } - - return result; -} - - -/// Returns true if ch is a control character (in range [0,32[). -static inline bool -isControlCharacter(char ch) -{ - return ch > 0 && ch <= 0x1F; -} - - -enum { - /// Constant that specify the size of the buffer that must be passed to uintToString. - uintToStringBufferSize = 3*sizeof(LargestUInt)+1 -}; - -// Defines a char buffer for use with uintToString(). -typedef char UIntToStringBuffer[uintToStringBufferSize]; - - -/** Converts an unsigned integer to string. - * @param value Unsigned interger to convert to string - * @param current Input/Output string buffer. - * Must have at least uintToStringBufferSize chars free. - */ -static inline void -uintToString( LargestUInt value, - char *¤t ) -{ - *--current = 0; - do - { - *--current = char(value % 10) + '0'; - value /= 10; - } - while ( value != 0 ); -} - -} // namespace CSJson { - -#endif // LIB_JSONCPP_JSON_TOOL_H_INCLUDED diff --git a/external/websockets/android/include/libwebsockets.h b/external/websockets/include/android/libwebsockets.h similarity index 100% rename from external/websockets/android/include/libwebsockets.h rename to external/websockets/include/android/libwebsockets.h diff --git a/external/websockets/ios/include/libwebsockets.h b/external/websockets/include/ios/libwebsockets.h similarity index 100% rename from external/websockets/ios/include/libwebsockets.h rename to external/websockets/include/ios/libwebsockets.h diff --git a/external/websockets/mac/include/libwebsockets.h b/external/websockets/include/mac/libwebsockets.h similarity index 100% rename from external/websockets/mac/include/libwebsockets.h rename to external/websockets/include/mac/libwebsockets.h diff --git a/external/websockets/win32/include/libwebsockets.h b/external/websockets/include/win32/libwebsockets.h similarity index 100% rename from external/websockets/win32/include/libwebsockets.h rename to external/websockets/include/win32/libwebsockets.h diff --git a/external/websockets/win32/include/win32helpers/gettimeofday.h b/external/websockets/include/win32/win32helpers/gettimeofday.h similarity index 100% rename from external/websockets/win32/include/win32helpers/gettimeofday.h rename to external/websockets/include/win32/win32helpers/gettimeofday.h diff --git a/external/websockets/win32/include/win32helpers/websock-w32.h b/external/websockets/include/win32/win32helpers/websock-w32.h similarity index 100% rename from external/websockets/win32/include/win32helpers/websock-w32.h rename to external/websockets/include/win32/win32helpers/websock-w32.h diff --git a/external/websockets/android/Android.mk b/external/websockets/prebuilt/android/Android.mk similarity index 69% rename from external/websockets/android/Android.mk rename to external/websockets/prebuilt/android/Android.mk index 158211b64c..a5f14e0456 100644 --- a/external/websockets/android/Android.mk +++ b/external/websockets/prebuilt/android/Android.mk @@ -3,8 +3,8 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := libwebsockets_static LOCAL_MODULE_FILENAME := libwebsockets_static -LOCAL_SRC_FILES := ./lib/$(TARGET_ARCH_ABI)/libwebsockets.a -LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include +LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libwebsockets.a +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../include/android LOCAL_CPPFLAGS := -D__STDC_LIMIT_MACROS=1 LOCAL_EXPORT_CPPFLAGS := -D__STDC_LIMIT_MACROS=1 include $(PREBUILT_STATIC_LIBRARY) diff --git a/external/websockets/ios/lib/libwebsockets.a.REMOVED.git-id b/external/websockets/prebuilt/ios/libwebsockets.a.REMOVED.git-id similarity index 100% rename from external/websockets/ios/lib/libwebsockets.a.REMOVED.git-id rename to external/websockets/prebuilt/ios/libwebsockets.a.REMOVED.git-id diff --git a/external/websockets/mac/lib/libwebsockets.a.REMOVED.git-id b/external/websockets/prebuilt/mac/libwebsockets.a.REMOVED.git-id similarity index 100% rename from external/websockets/mac/lib/libwebsockets.a.REMOVED.git-id rename to external/websockets/prebuilt/mac/libwebsockets.a.REMOVED.git-id diff --git a/external/websockets/tizen/include/libwebsockets.h b/external/websockets/tizen/include/libwebsockets.h deleted file mode 100644 index 28e649c67e..0000000000 --- a/external/websockets/tizen/include/libwebsockets.h +++ /dev/null @@ -1,977 +0,0 @@ -/* - * libwebsockets - small server side websockets and web server implementation - * - * Copyright (C) 2010-2013 Andy Green - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation: - * version 2.1 of the License. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301 USA - */ - -#ifndef __LIBWEBSOCKET_H__ -#define __LIBWEBSOCKET_H__ - -#ifdef __cplusplus -extern "C" { -#include -#endif - -#ifdef WIN32 - -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#include -#include -#include "../win32port/win32helpers/websock-w32.h" - -#include "../win32port/win32helpers/gettimeofday.h" - -#define strcasecmp stricmp -#define getdtablesize() 30000 - -typedef int ssize_t; - -#ifdef LWS_DLL -#ifdef LWS_INTERNAL -#define LWS_EXTERN extern __declspec(dllexport) -#else -#define LWS_EXTERN extern __declspec(dllimport) -#endif -#endif - -#else // NOT WIN32 -#include -#include -#endif - -#include - -#ifndef LWS_EXTERN -#define LWS_EXTERN extern -#endif - -#define CONTEXT_PORT_NO_LISTEN 0 -#define MAX_MUX_RECURSION 2 - -enum lws_log_levels { - LLL_ERR = 1 << 0, - LLL_WARN = 1 << 1, - LLL_NOTICE = 1 << 2, - LLL_INFO = 1 << 3, - LLL_DEBUG = 1 << 4, - LLL_PARSER = 1 << 5, - LLL_HEADER = 1 << 6, - LLL_EXT = 1 << 7, - LLL_CLIENT = 1 << 8, - LLL_LATENCY = 1 << 9, - - LLL_COUNT = 10 /* set to count of valid flags */ -}; - -LWS_EXTERN void _lws_log(int filter, const char *format, ...); - -/* notice, warn and log are always compiled in */ -#define lwsl_notice(...) _lws_log(LLL_NOTICE, __VA_ARGS__) -#define lwsl_warn(...) _lws_log(LLL_WARN, __VA_ARGS__) -#define lwsl_err(...) _lws_log(LLL_ERR, __VA_ARGS__) -/* - * weaker logging can be deselected at configure time using --disable-debug - * that gets rid of the overhead of checking while keeping _warn and _err - * active - */ -#ifdef _DEBUG - -#define lwsl_info(...) _lws_log(LLL_INFO, __VA_ARGS__) -#define lwsl_debug(...) _lws_log(LLL_DEBUG, __VA_ARGS__) -#define lwsl_parser(...) _lws_log(LLL_PARSER, __VA_ARGS__) -#define lwsl_header(...) _lws_log(LLL_HEADER, __VA_ARGS__) -#define lwsl_ext(...) _lws_log(LLL_EXT, __VA_ARGS__) -#define lwsl_client(...) _lws_log(LLL_CLIENT, __VA_ARGS__) -#define lwsl_latency(...) _lws_log(LLL_LATENCY, __VA_ARGS__) -LWS_EXTERN void lwsl_hexdump(void *buf, size_t len); - -#else /* no debug */ - -#define lwsl_info(...) -#define lwsl_debug(...) -#define lwsl_parser(...) -#define lwsl_header(...) -#define lwsl_ext(...) -#define lwsl_client(...) -#define lwsl_latency(...) -#define lwsl_hexdump(a, b) - -#endif - -enum libwebsocket_context_options { - LWS_SERVER_OPTION_REQUIRE_VALID_OPENSSL_CLIENT_CERT = 2, - LWS_SERVER_OPTION_SKIP_SERVER_CANONICAL_NAME = 4, -}; - -enum libwebsocket_callback_reasons { - LWS_CALLBACK_ESTABLISHED, - LWS_CALLBACK_CLIENT_CONNECTION_ERROR, - LWS_CALLBACK_CLIENT_FILTER_PRE_ESTABLISH, - LWS_CALLBACK_CLIENT_ESTABLISHED, - LWS_CALLBACK_CLOSED, - LWS_CALLBACK_RECEIVE, - LWS_CALLBACK_CLIENT_RECEIVE, - LWS_CALLBACK_CLIENT_RECEIVE_PONG, - LWS_CALLBACK_CLIENT_WRITEABLE, - LWS_CALLBACK_SERVER_WRITEABLE, - LWS_CALLBACK_HTTP, - LWS_CALLBACK_HTTP_FILE_COMPLETION, - LWS_CALLBACK_HTTP_WRITEABLE, - LWS_CALLBACK_FILTER_NETWORK_CONNECTION, - LWS_CALLBACK_FILTER_PROTOCOL_CONNECTION, - LWS_CALLBACK_OPENSSL_LOAD_EXTRA_CLIENT_VERIFY_CERTS, - LWS_CALLBACK_OPENSSL_LOAD_EXTRA_SERVER_VERIFY_CERTS, - LWS_CALLBACK_OPENSSL_PERFORM_CLIENT_CERT_VERIFICATION, - LWS_CALLBACK_CLIENT_APPEND_HANDSHAKE_HEADER, - LWS_CALLBACK_CONFIRM_EXTENSION_OKAY, - LWS_CALLBACK_CLIENT_CONFIRM_EXTENSION_SUPPORTED, - LWS_CALLBACK_PROTOCOL_INIT, - LWS_CALLBACK_PROTOCOL_DESTROY, - /* external poll() management support */ - LWS_CALLBACK_ADD_POLL_FD, - LWS_CALLBACK_DEL_POLL_FD, - LWS_CALLBACK_SET_MODE_POLL_FD, - LWS_CALLBACK_CLEAR_MODE_POLL_FD, -}; - -#ifndef LWS_NO_EXTENSIONS -enum libwebsocket_extension_callback_reasons { - LWS_EXT_CALLBACK_SERVER_CONTEXT_CONSTRUCT, - LWS_EXT_CALLBACK_CLIENT_CONTEXT_CONSTRUCT, - LWS_EXT_CALLBACK_SERVER_CONTEXT_DESTRUCT, - LWS_EXT_CALLBACK_CLIENT_CONTEXT_DESTRUCT, - LWS_EXT_CALLBACK_CONSTRUCT, - LWS_EXT_CALLBACK_CLIENT_CONSTRUCT, - LWS_EXT_CALLBACK_CHECK_OK_TO_REALLY_CLOSE, - LWS_EXT_CALLBACK_CHECK_OK_TO_PROPOSE_EXTENSION, - LWS_EXT_CALLBACK_DESTROY, - LWS_EXT_CALLBACK_DESTROY_ANY_WSI_CLOSING, - LWS_EXT_CALLBACK_ANY_WSI_ESTABLISHED, - LWS_EXT_CALLBACK_PACKET_RX_PREPARSE, - LWS_EXT_CALLBACK_PACKET_TX_PRESEND, - LWS_EXT_CALLBACK_PACKET_TX_DO_SEND, - LWS_EXT_CALLBACK_HANDSHAKE_REPLY_TX, - LWS_EXT_CALLBACK_FLUSH_PENDING_TX, - LWS_EXT_CALLBACK_EXTENDED_PAYLOAD_RX, - LWS_EXT_CALLBACK_CAN_PROXY_CLIENT_CONNECTION, - LWS_EXT_CALLBACK_1HZ, - LWS_EXT_CALLBACK_REQUEST_ON_WRITEABLE, - LWS_EXT_CALLBACK_IS_WRITEABLE, - LWS_EXT_CALLBACK_PAYLOAD_TX, - LWS_EXT_CALLBACK_PAYLOAD_RX, -}; -#endif - -enum libwebsocket_write_protocol { - LWS_WRITE_TEXT, - LWS_WRITE_BINARY, - LWS_WRITE_CONTINUATION, - LWS_WRITE_HTTP, - - /* special 04+ opcodes */ - - LWS_WRITE_CLOSE, - LWS_WRITE_PING, - LWS_WRITE_PONG, - - /* flags */ - - LWS_WRITE_NO_FIN = 0x40, - /* - * client packet payload goes out on wire unmunged - * only useful for security tests since normal servers cannot - * decode the content if used - */ - LWS_WRITE_CLIENT_IGNORE_XOR_MASK = 0x80 -}; - -/* - * you need these to look at headers that have been parsed if using the - * LWS_CALLBACK_FILTER_CONNECTION callback. If a header from the enum - * list below is absent, .token = NULL and token_len = 0. Otherwise .token - * points to .token_len chars containing that header content. - */ - -struct lws_tokens { - char *token; - int token_len; -}; - -enum lws_token_indexes { - WSI_TOKEN_GET_URI, - WSI_TOKEN_HOST, - WSI_TOKEN_CONNECTION, - WSI_TOKEN_KEY1, - WSI_TOKEN_KEY2, - WSI_TOKEN_PROTOCOL, - WSI_TOKEN_UPGRADE, - WSI_TOKEN_ORIGIN, - WSI_TOKEN_DRAFT, - WSI_TOKEN_CHALLENGE, - - /* new for 04 */ - WSI_TOKEN_KEY, - WSI_TOKEN_VERSION, - WSI_TOKEN_SWORIGIN, - - /* new for 05 */ - WSI_TOKEN_EXTENSIONS, - - /* client receives these */ - WSI_TOKEN_ACCEPT, - WSI_TOKEN_NONCE, - WSI_TOKEN_HTTP, - WSI_TOKEN_MUXURL, - - /* use token storage to stash these */ - - _WSI_TOKEN_CLIENT_SENT_PROTOCOLS, - _WSI_TOKEN_CLIENT_PEER_ADDRESS, - _WSI_TOKEN_CLIENT_URI, - _WSI_TOKEN_CLIENT_HOST, - _WSI_TOKEN_CLIENT_ORIGIN, - - /* always last real token index*/ - WSI_TOKEN_COUNT, - /* parser state additions */ - WSI_TOKEN_NAME_PART, - WSI_TOKEN_SKIPPING, - WSI_TOKEN_SKIPPING_SAW_CR, - WSI_PARSING_COMPLETE, - WSI_INIT_TOKEN_MUXURL, -}; - -/* - * From RFC 6455 - 1000 - - 1000 indicates a normal closure, meaning that the purpose for - which the connection was established has been fulfilled. - - 1001 - - 1001 indicates that an endpoint is "going away", such as a server - going down or a browser having navigated away from a page. - - 1002 - - 1002 indicates that an endpoint is terminating the connection due - to a protocol error. - - 1003 - - 1003 indicates that an endpoint is terminating the connection - because it has received a type of data it cannot accept (e.g., an - endpoint that understands only text data MAY send this if it - receives a binary message). - - 1004 - - Reserved. The specific meaning might be defined in the future. - - 1005 - - 1005 is a reserved value and MUST NOT be set as a status code in a - Close control frame by an endpoint. It is designated for use in - applications expecting a status code to indicate that no status - code was actually present. - - 1006 - - 1006 is a reserved value and MUST NOT be set as a status code in a - Close control frame by an endpoint. It is designated for use in - applications expecting a status code to indicate that the - connection was closed abnormally, e.g., without sending or - receiving a Close control frame. - - 1007 - - 1007 indicates that an endpoint is terminating the connection - because it has received data within a message that was not - consistent with the type of the message (e.g., non-UTF-8 [RFC3629] - data within a text message). - - 1008 - - 1008 indicates that an endpoint is terminating the connection - because it has received a message that violates its policy. This - is a generic status code that can be returned when there is no - other more suitable status code (e.g., 1003 or 1009) or if there - is a need to hide specific details about the policy. - - 1009 - - 1009 indicates that an endpoint is terminating the connection - because it has received a message that is too big for it to - process. - - 1010 - - 1010 indicates that an endpoint (client) is terminating the - connection because it has expected the server to negotiate one or - more extension, but the server didn't return them in the response - message of the WebSocket handshake. The list of extensions that - are needed SHOULD appear in the /reason/ part of the Close frame. - Note that this status code is not used by the server, because it - can fail the WebSocket handshake instead. - - 1011 - - 1011 indicates that a server is terminating the connection because - it encountered an unexpected condition that prevented it from - fulfilling the request. - - 1015 - - 1015 is a reserved value and MUST NOT be set as a status code in a - Close control frame by an endpoint. It is designated for use in - applications expecting a status code to indicate that the - connection was closed due to a failure to perform a TLS handshake - (e.g., the server certificate can't be verified). -*/ - -enum lws_close_status { - LWS_CLOSE_STATUS_NOSTATUS = 0, - LWS_CLOSE_STATUS_NORMAL = 1000, - LWS_CLOSE_STATUS_GOINGAWAY = 1001, - LWS_CLOSE_STATUS_PROTOCOL_ERR = 1002, - LWS_CLOSE_STATUS_UNACCEPTABLE_OPCODE = 1003, - LWS_CLOSE_STATUS_RESERVED = 1004, - LWS_CLOSE_STATUS_NO_STATUS = 1005, - LWS_CLOSE_STATUS_ABNORMAL_CLOSE = 1006, - LWS_CLOSE_STATUS_INVALID_PAYLOAD = 1007, - LWS_CLOSE_STATUS_POLICY_VIOLATION = 1008, - LWS_CLOSE_STATUS_MESSAGE_TOO_LARGE = 1009, - LWS_CLOSE_STATUS_EXTENSION_REQUIRED = 1010, - LWS_CLOSE_STATUS_UNEXPECTED_CONDITION = 1011, - LWS_CLOSE_STATUS_TLS_FAILURE = 1015, -}; - -struct libwebsocket; -struct libwebsocket_context; -/* needed even with extensions disabled for create context */ -struct libwebsocket_extension; - -/** - * callback_function() - User server actions - * @context: Websockets context - * @wsi: Opaque websocket instance pointer - * @reason: The reason for the call - * @user: Pointer to per-session user data allocated by library - * @in: Pointer used for some callback reasons - * @len: Length set for some callback reasons - * - * This callback is the way the user controls what is served. All the - * protocol detail is hidden and handled by the library. - * - * For each connection / session there is user data allocated that is - * pointed to by "user". You set the size of this user data area when - * the library is initialized with libwebsocket_create_server. - * - * You get an opportunity to initialize user data when called back with - * LWS_CALLBACK_ESTABLISHED reason. - * - * LWS_CALLBACK_ESTABLISHED: after the server completes a handshake with - * an incoming client - * - * LWS_CALLBACK_CLIENT_CONNECTION_ERROR: the request client connection has - * been unable to complete a handshake with the remote server - * - * LWS_CALLBACK_CLIENT_FILTER_PRE_ESTABLISH: this is the last chance for the - * client user code to examine the http headers - * and decide to reject the connection. If the - * content in the headers is interesting to the - * client (url, etc) it needs to copy it out at - * this point since it will be destroyed before - * the CLIENT_ESTABLISHED call - * - * LWS_CALLBACK_CLIENT_ESTABLISHED: after your client connection completed - * a handshake with the remote server - * - * LWS_CALLBACK_CLOSED: when the websocket session ends - * - * LWS_CALLBACK_RECEIVE: data has appeared for this server endpoint from a - * remote client, it can be found at *in and is - * len bytes long - * - * LWS_CALLBACK_CLIENT_RECEIVE_PONG: if you elected to see PONG packets, - * they appear with this callback reason. PONG - * packets only exist in 04+ protocol - * - * LWS_CALLBACK_CLIENT_RECEIVE: data has appeared from the server for the - * client connection, it can be found at *in and - * is len bytes long - * - * LWS_CALLBACK_HTTP: an http request has come from a client that is not - * asking to upgrade the connection to a websocket - * one. This is a chance to serve http content, - * for example, to send a script to the client - * which will then open the websockets connection. - * @in points to the URI path requested and - * libwebsockets_serve_http_file() makes it very - * simple to send back a file to the client. - * Normally after sending the file you are done - * with the http connection, since the rest of the - * activity will come by websockets from the script - * that was delivered by http, so you will want to - * return 1; to close and free up the connection. - * That's important because it uses a slot in the - * total number of client connections allowed set - * by MAX_CLIENTS. - * - * LWS_CALLBACK_HTTP_WRITEABLE: you can write more down the http protocol - * link now. - * - * LWS_CALLBACK_HTTP_FILE_COMPLETION: a file requested to be send down - * http link has completed. - * - * LWS_CALLBACK_CLIENT_WRITEABLE: - * LWS_CALLBACK_SERVER_WRITEABLE: If you call - * libwebsocket_callback_on_writable() on a connection, you will - * get one of these callbacks coming when the connection socket - * is able to accept another write packet without blocking. - * If it already was able to take another packet without blocking, - * you'll get this callback at the next call to the service loop - * function. Notice that CLIENTs get LWS_CALLBACK_CLIENT_WRITEABLE - * and servers get LWS_CALLBACK_SERVER_WRITEABLE. - * - * LWS_CALLBACK_FILTER_NETWORK_CONNECTION: called when a client connects to - * the server at network level; the connection is accepted but then - * passed to this callback to decide whether to hang up immediately - * or not, based on the client IP. @in contains the connection - * socket's descriptor. Return non-zero to terminate - * the connection before sending or receiving anything. - * Because this happens immediately after the network connection - * from the client, there's no websocket protocol selected yet so - * this callback is issued only to protocol 0. - * - * LWS_CALLBACK_FILTER_PROTOCOL_CONNECTION: called when the handshake has - * been received and parsed from the client, but the response is - * not sent yet. Return non-zero to disallow the connection. - * @user is a pointer to an array of struct lws_tokens, you can - * use the header enums lws_token_indexes from libwebsockets.h - * to check for and read the supported header presence and - * content before deciding to allow the handshake to proceed or - * to kill the connection. - * - * LWS_CALLBACK_OPENSSL_LOAD_EXTRA_CLIENT_VERIFY_CERTS: if configured for - * including OpenSSL support, this callback allows your user code - * to perform extra SSL_CTX_load_verify_locations() or similar - * calls to direct OpenSSL where to find certificates the client - * can use to confirm the remote server identity. @user is the - * OpenSSL SSL_CTX* - * - * LWS_CALLBACK_OPENSSL_LOAD_EXTRA_SERVER_VERIFY_CERTS: if configured for - * including OpenSSL support, this callback allows your user code - * to load extra certifcates into the server which allow it to - * verify the validity of certificates returned by clients. @user - * is the server's OpenSSL SSL_CTX* - * - * LWS_CALLBACK_OPENSSL_PERFORM_CLIENT_CERT_VERIFICATION: if the - * libwebsockets context was created with the option - * LWS_SERVER_OPTION_REQUIRE_VALID_OPENSSL_CLIENT_CERT, then this - * callback is generated during OpenSSL verification of the cert - * sent from the client. It is sent to protocol[0] callback as - * no protocol has been negotiated on the connection yet. - * Notice that the libwebsockets context and wsi are both NULL - * during this callback. See - * http://www.openssl.org/docs/ssl/SSL_CTX_set_verify.html - * to understand more detail about the OpenSSL callback that - * generates this libwebsockets callback and the meanings of the - * arguments passed. In this callback, @user is the x509_ctx, - * @in is the ssl pointer and @len is preverify_ok - * Notice that this callback maintains libwebsocket return - * conventions, return 0 to mean the cert is OK or 1 to fail it. - * This also means that if you don't handle this callback then - * the default callback action of returning 0 allows the client - * certificates. - * - * LWS_CALLBACK_CLIENT_APPEND_HANDSHAKE_HEADER: this callback happens - * when a client handshake is being compiled. @user is NULL, - * @in is a char **, it's pointing to a char * which holds the - * next location in the header buffer where you can add - * headers, and @len is the remaining space in the header buffer, - * which is typically some hundreds of bytes. So, to add a canned - * cookie, your handler code might look similar to: - * - * char **p = (char **)in; - * - * if (len < 100) - * return 1; - * - * *p += sprintf(*p, "Cookie: a=b\x0d\x0a"); - * - * return 0; - * - * Notice if you add anything, you just have to take care about - * the CRLF on the line you added. Obviously this callback is - * optional, if you don't handle it everything is fine. - * - * Notice the callback is coming to protocols[0] all the time, - * because there is no specific protocol handshook yet. - * - * LWS_CALLBACK_CONFIRM_EXTENSION_OKAY: When the server handshake code - * sees that it does support a requested extension, before - * accepting the extension by additing to the list sent back to - * the client it gives this callback just to check that it's okay - * to use that extension. It calls back to the requested protocol - * and with @in being the extension name, @len is 0 and @user is - * valid. Note though at this time the ESTABLISHED callback hasn't - * happened yet so if you initialize @user content there, @user - * content during this callback might not be useful for anything. - * Notice this callback comes to protocols[0]. - * - * LWS_CALLBACK_CLIENT_CONFIRM_EXTENSION_SUPPORTED: When a client - * connection is being prepared to start a handshake to a server, - * each supported extension is checked with protocols[0] callback - * with this reason, giving the user code a chance to suppress the - * claim to support that extension by returning non-zero. If - * unhandled, by default 0 will be returned and the extension - * support included in the header to the server. Notice this - * callback comes to protocols[0]. - * - * LWS_CALLBACK_PROTOCOL_INIT: One-time call per protocol so it can - * do initial setup / allocations etc - * - * LWS_CALLBACK_PROTOCOL_DESTROY: One-time call per protocol indicating - * this protocol won't get used at all after this callback, the - * context is getting destroyed. Take the opportunity to - * deallocate everything that was allocated by the protocol. - * - * The next four reasons are optional and only need taking care of if you - * will be integrating libwebsockets sockets into an external polling - * array. - * - * LWS_CALLBACK_ADD_POLL_FD: libwebsocket deals with its poll() loop - * internally, but in the case you are integrating with another - * server you will need to have libwebsocket sockets share a - * polling array with the other server. This and the other - * POLL_FD related callbacks let you put your specialized - * poll array interface code in the callback for protocol 0, the - * first protocol you support, usually the HTTP protocol in the - * serving case. This callback happens when a socket needs to be - * added to the polling loop: @in contains the fd, and - * @len is the events bitmap (like, POLLIN). If you are using the - * internal polling loop (the "service" callback), you can just - * ignore these callbacks. - * - * LWS_CALLBACK_DEL_POLL_FD: This callback happens when a socket descriptor - * needs to be removed from an external polling array. @in is - * the socket desricptor. If you are using the internal polling - * loop, you can just ignore it. - * - * LWS_CALLBACK_SET_MODE_POLL_FD: This callback happens when libwebsockets - * wants to modify the events for the socket descriptor in @in. - * The handler should OR @len on to the events member of the pollfd - * struct for this socket descriptor. If you are using the - * internal polling loop, you can just ignore it. - * - * LWS_CALLBACK_CLEAR_MODE_POLL_FD: This callback occurs when libwebsockets - * wants to modify the events for the socket descriptor in @in. - * The handler should AND ~@len on to the events member of the - * pollfd struct for this socket descriptor. If you are using the - * internal polling loop, you can just ignore it. - */ -LWS_EXTERN int callback(struct libwebsocket_context *context, - struct libwebsocket *wsi, - enum libwebsocket_callback_reasons reason, void *user, - void *in, size_t len); - -typedef int (callback_function)(struct libwebsocket_context *context, - struct libwebsocket *wsi, - enum libwebsocket_callback_reasons reason, void *user, - void *in, size_t len); - -#ifndef LWS_NO_EXTENSIONS -/** - * extension_callback_function() - Hooks to allow extensions to operate - * @context: Websockets context - * @ext: This extension - * @wsi: Opaque websocket instance pointer - * @reason: The reason for the call - * @user: Pointer to per-session user data allocated by library - * @in: Pointer used for some callback reasons - * @len: Length set for some callback reasons - * - * Each extension that is active on a particular connection receives - * callbacks during the connection lifetime to allow the extension to - * operate on websocket data and manage itself. - * - * Libwebsockets takes care of allocating and freeing "user" memory for - * each active extension on each connection. That is what is pointed to - * by the @user parameter. - * - * LWS_EXT_CALLBACK_CONSTRUCT: called when the server has decided to - * select this extension from the list provided by the client, - * just before the server will send back the handshake accepting - * the connection with this extension active. This gives the - * extension a chance to initialize its connection context found - * in @user. - * - * LWS_EXT_CALLBACK_CLIENT_CONSTRUCT: same as LWS_EXT_CALLBACK_CONSTRUCT - * but called when client is instantiating this extension. Some - * extensions will work the same on client and server side and then - * you can just merge handlers for both CONSTRUCTS. - * - * LWS_EXT_CALLBACK_DESTROY: called when the connection the extension was - * being used on is about to be closed and deallocated. It's the - * last chance for the extension to deallocate anything it has - * allocated in the user data (pointed to by @user) before the - * user data is deleted. This same callback is used whether you - * are in client or server instantiation context. - * - * LWS_EXT_CALLBACK_PACKET_RX_PREPARSE: when this extension was active on - * a connection, and a packet of data arrived at the connection, - * it is passed to this callback to give the extension a chance to - * change the data, eg, decompress it. @user is pointing to the - * extension's private connection context data, @in is pointing - * to an lws_tokens struct, it consists of a char * pointer called - * token, and an int called token_len. At entry, these are - * set to point to the received buffer and set to the content - * length. If the extension will grow the content, it should use - * a new buffer allocated in its private user context data and - * set the pointed-to lws_tokens members to point to its buffer. - * - * LWS_EXT_CALLBACK_PACKET_TX_PRESEND: this works the same way as - * LWS_EXT_CALLBACK_PACKET_RX_PREPARSE above, except it gives the - * extension a chance to change websocket data just before it will - * be sent out. Using the same lws_token pointer scheme in @in, - * the extension can change the buffer and the length to be - * transmitted how it likes. Again if it wants to grow the - * buffer safely, it should copy the data into its own buffer and - * set the lws_tokens token pointer to it. - */ -LWS_EXTERN int extension_callback(struct libwebsocket_context *context, - struct libwebsocket_extension *ext, - struct libwebsocket *wsi, - enum libwebsocket_extension_callback_reasons reason, - void *user, void *in, size_t len); - -typedef int (extension_callback_function)(struct libwebsocket_context *context, - struct libwebsocket_extension *ext, - struct libwebsocket *wsi, - enum libwebsocket_extension_callback_reasons reason, - void *user, void *in, size_t len); -#endif - -/** - * struct libwebsocket_protocols - List of protocols and handlers server - * supports. - * @name: Protocol name that must match the one given in the client - * Javascript new WebSocket(url, 'protocol') name - * @callback: The service callback used for this protocol. It allows the - * service action for an entire protocol to be encapsulated in - * the protocol-specific callback - * @per_session_data_size: Each new connection using this protocol gets - * this much memory allocated on connection establishment and - * freed on connection takedown. A pointer to this per-connection - * allocation is passed into the callback in the 'user' parameter - * @rx_buffer_size: if you want atomic frames delivered to the callback, you - * should set this to the size of the biggest legal frame that - * you support. If the frame size is exceeded, there is no - * error, but the buffer will spill to the user callback when - * full, which you can detect by using - * libwebsockets_remaining_packet_payload(). Notice that you - * just talk about frame size here, the LWS_SEND_BUFFER_PRE_PADDING - * and post-padding are automatically also allocated on top. - * @owning_server: the server init call fills in this opaque pointer when - * registering this protocol with the server. - * @protocol_index: which protocol we are starting from zero - * - * This structure represents one protocol supported by the server. An - * array of these structures is passed to libwebsocket_create_server() - * allows as many protocols as you like to be handled by one server. - */ - -struct libwebsocket_protocols { - const char *name; - callback_function *callback; - size_t per_session_data_size; - size_t rx_buffer_size; - - /* - * below are filled in on server init and can be left uninitialized, - * no need for user to use them directly either - */ - - struct libwebsocket_context *owning_server; - int protocol_index; -}; - -#ifndef LWS_NO_EXTENSIONS -/** - * struct libwebsocket_extension - An extension we know how to cope with - * - * @name: Formal extension name, eg, "deflate-stream" - * @callback: Service callback - * @per_session_data_size: Libwebsockets will auto-malloc this much - * memory for the use of the extension, a pointer - * to it comes in the @user callback parameter - * @per_context_private_data: Optional storage for this extension that - * is per-context, so it can track stuff across - * all sessions, etc, if it wants - */ - -struct libwebsocket_extension { - const char *name; - extension_callback_function *callback; - size_t per_session_data_size; - void *per_context_private_data; -}; -#endif - -/** - * struct lws_context_creation_info: parameters to create context with - * - * @port: Port to listen on... you can use 0 to suppress listening on - * any port, that's what you want if you are not running a - * websocket server at all but just using it as a client - * @iface: NULL to bind the listen socket to all interfaces, or the - * interface name, eg, "eth2" - * @protocols: Array of structures listing supported protocols and a protocol- - * specific callback for each one. The list is ended with an - * entry that has a NULL callback pointer. - * It's not const because we write the owning_server member - * @extensions: NULL or array of libwebsocket_extension structs listing the - * extensions this context supports. If you configured with - * --without-extensions, you should give NULL here. - * @ssl_cert_filepath: If libwebsockets was compiled to use ssl, and you want - * to listen using SSL, set to the filepath to fetch the - * server cert from, otherwise NULL for unencrypted - * @ssl_private_key_filepath: filepath to private key if wanting SSL mode, - * else ignored - * @ssl_ca_filepath: CA certificate filepath or NULL - * @ssl_cipher_list: List of valid ciphers to use (eg, - * "RC4-MD5:RC4-SHA:AES128-SHA:AES256-SHA:HIGH:!DSS:!aNULL" - * or you can leave it as NULL to get "DEFAULT" - * @gid: group id to change to after setting listen socket, or -1. - * @uid: user id to change to after setting listen socket, or -1. - * @options: 0, or LWS_SERVER_OPTION_DEFEAT_CLIENT_MASK - * @user: optional user pointer that can be recovered via the context - * pointer using libwebsocket_context_user - * @ka_time: 0 for no keepalive, otherwise apply this keepalive timeout to - * all libwebsocket sockets, client or server - * @ka_probes: if ka_time was nonzero, after the timeout expires how many - * times to try to get a response from the peer before giving up - * and killing the connection - * @ka_interval: if ka_time was nonzero, how long to wait before each ka_probes - * attempt - */ - -struct lws_context_creation_info { - int port; - const char *iface; - struct libwebsocket_protocols *protocols; - struct libwebsocket_extension *extensions; - const char *ssl_cert_filepath; - const char *ssl_private_key_filepath; - const char *ssl_ca_filepath; - const char *ssl_cipher_list; - int gid; - int uid; - unsigned int options; - void *user; - int ka_time; - int ka_probes; - int ka_interval; - -}; - -LWS_EXTERN -void lws_set_log_level(int level, - void (*log_emit_function)(int level, const char *line)); - -LWS_EXTERN void -lwsl_emit_syslog(int level, const char *line); - -LWS_EXTERN struct libwebsocket_context * -libwebsocket_create_context(struct lws_context_creation_info *info); - -LWS_EXTERN void -libwebsocket_context_destroy(struct libwebsocket_context *context); - -LWS_EXTERN int -libwebsocket_service(struct libwebsocket_context *context, int timeout_ms); - -LWS_EXTERN int -libwebsocket_service_fd(struct libwebsocket_context *context, - struct pollfd *pollfd); - -LWS_EXTERN void * -libwebsocket_context_user(struct libwebsocket_context *context); - -/* - * IMPORTANT NOTICE! - * - * When sending with websocket protocol (LWS_WRITE_TEXT or LWS_WRITE_BINARY) - * the send buffer has to have LWS_SEND_BUFFER_PRE_PADDING bytes valid BEFORE - * buf, and LWS_SEND_BUFFER_POST_PADDING bytes valid AFTER (buf + len). - * - * This allows us to add protocol info before and after the data, and send as - * one packet on the network without payload copying, for maximum efficiency. - * - * So for example you need this kind of code to use libwebsocket_write with a - * 128-byte payload - * - * char buf[LWS_SEND_BUFFER_PRE_PADDING + 128 + LWS_SEND_BUFFER_POST_PADDING]; - * - * // fill your part of the buffer... for example here it's all zeros - * memset(&buf[LWS_SEND_BUFFER_PRE_PADDING], 0, 128); - * - * libwebsocket_write(wsi, &buf[LWS_SEND_BUFFER_PRE_PADDING], 128); - * - * When sending LWS_WRITE_HTTP, there is no protocol addition and you can just - * use the whole buffer without taking care of the above. - */ - -/* - * this is the frame nonce plus two header plus 8 length - * there's an additional two for mux extension per mux nesting level - * 2 byte prepend on close will already fit because control frames cannot use - * the big length style - */ - -#define LWS_SEND_BUFFER_PRE_PADDING (4 + 10 + (2 * MAX_MUX_RECURSION)) -#define LWS_SEND_BUFFER_POST_PADDING 4 - -LWS_EXTERN int -libwebsocket_write(struct libwebsocket *wsi, unsigned char *buf, size_t len, - enum libwebsocket_write_protocol protocol); - -LWS_EXTERN int -libwebsockets_serve_http_file(struct libwebsocket_context *context, - struct libwebsocket *wsi, const char *file, - const char *content_type); -LWS_EXTERN int -libwebsockets_serve_http_file_fragment(struct libwebsocket_context *context, - struct libwebsocket *wsi); - -LWS_EXTERN const struct libwebsocket_protocols * -libwebsockets_get_protocol(struct libwebsocket *wsi); - -LWS_EXTERN int -libwebsocket_callback_on_writable(struct libwebsocket_context *context, - struct libwebsocket *wsi); - -LWS_EXTERN int -libwebsocket_callback_on_writable_all_protocol( - const struct libwebsocket_protocols *protocol); - -LWS_EXTERN int -libwebsocket_get_socket_fd(struct libwebsocket *wsi); - -LWS_EXTERN int -libwebsocket_is_final_fragment(struct libwebsocket *wsi); - -LWS_EXTERN unsigned char -libwebsocket_get_reserved_bits(struct libwebsocket *wsi); - -LWS_EXTERN int -libwebsocket_rx_flow_control(struct libwebsocket *wsi, int enable); - -LWS_EXTERN size_t -libwebsockets_remaining_packet_payload(struct libwebsocket *wsi); - -LWS_EXTERN struct libwebsocket * -libwebsocket_client_connect(struct libwebsocket_context *clients, - const char *address, - int port, - int ssl_connection, - const char *path, - const char *host, - const char *origin, - const char *protocol, - int ietf_version_or_minus_one); - -LWS_EXTERN struct libwebsocket * -libwebsocket_client_connect_extended(struct libwebsocket_context *clients, - const char *address, - int port, - int ssl_connection, - const char *path, - const char *host, - const char *origin, - const char *protocol, - int ietf_version_or_minus_one, - void *userdata); - -LWS_EXTERN const char * -libwebsocket_canonical_hostname(struct libwebsocket_context *context); - - -LWS_EXTERN void -libwebsockets_get_peer_addresses(struct libwebsocket_context *context, - struct libwebsocket *wsi, int fd, char *name, int name_len, - char *rip, int rip_len); - -LWS_EXTERN int -libwebsockets_get_random(struct libwebsocket_context *context, - void *buf, int len); - -LWS_EXTERN int -lws_daemonize(const char *_lock_path); - -LWS_EXTERN int -lws_send_pipe_choked(struct libwebsocket *wsi); - -LWS_EXTERN int -lws_frame_is_binary(struct libwebsocket *wsi); - -LWS_EXTERN unsigned char * -libwebsockets_SHA1(const unsigned char *d, size_t n, unsigned char *md); - -LWS_EXTERN int -lws_b64_encode_string(const char *in, int in_len, char *out, int out_size); - -LWS_EXTERN int -lws_b64_decode_string(const char *in, char *out, int out_size); - -LWS_EXTERN const char * -lws_get_library_version(void); - -/* access to headers... only valid while headers valid */ - -LWS_EXTERN int -lws_hdr_total_length(struct libwebsocket *wsi, enum lws_token_indexes h); - -LWS_EXTERN int -lws_hdr_copy(struct libwebsocket *wsi, char *dest, int len, - enum lws_token_indexes h); - -/* - * Note: this is not normally needed as a user api. It's provided in case it is - * useful when integrating with other app poll loop service code. - */ - -LWS_EXTERN int -libwebsocket_read(struct libwebsocket_context *context, - struct libwebsocket *wsi, - unsigned char *buf, size_t len); - -#ifndef LWS_NO_EXTENSIONS -LWS_EXTERN struct libwebsocket_extension *libwebsocket_get_internal_extensions(); -#endif - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/external/websockets/tizen/lib/armv7l/libwebsockets.a.REMOVED.git-id b/external/websockets/tizen/lib/armv7l/libwebsockets.a.REMOVED.git-id deleted file mode 100644 index faa0b3f208..0000000000 --- a/external/websockets/tizen/lib/armv7l/libwebsockets.a.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -aa3206fa03c6719d4daac6f92885d581177ef093 \ No newline at end of file diff --git a/external/websockets/tizen/lib/x86/libwebsockets.a.REMOVED.git-id b/external/websockets/tizen/lib/x86/libwebsockets.a.REMOVED.git-id deleted file mode 100644 index 7e29b6b4fa..0000000000 --- a/external/websockets/tizen/lib/x86/libwebsockets.a.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -2e9ff412352827591ef1389f336b01d179260293 \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Android.mk b/samples/Cpp/TestCpp/Android.mk index fb39932e2e..9ed6038242 100644 --- a/samples/Cpp/TestCpp/Android.mk +++ b/samples/Cpp/TestCpp/Android.mk @@ -146,13 +146,25 @@ LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_static LOCAL_WHOLE_STATIC_LIBRARIES += box2d_static LOCAL_WHOLE_STATIC_LIBRARIES += chipmunk_static LOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocosbuilder_static +LOCAL_WHOLE_STATIC_LIBRARIES += spine_static +LOCAL_WHOLE_STATIC_LIBRARIES += gui_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocostudio_static +LOCAL_WHOLE_STATIC_LIBRARIES += network_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocos_curl_static LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) include $(BUILD_STATIC_LIBRARY) $(call import-module,audio/android) -$(call import-module,external/Box2D) -$(call import-module,external/chipmunk) -$(call import-module,cocos2dx) +$(call import-module,Box2D) +$(call import-module,chipmunk) +$(call import-module,2d) $(call import-module,extensions) +$(call import-module,editor-support/cocosbuilder) +$(call import-module,editor-support/spine) +$(call import-module,gui) +$(call import-module,editor-support/cocostudio) +$(call import-module,network) +$(call import-module,curl/prebuilt/android) diff --git a/samples/Cpp/TestCpp/Classes/AppDelegate.cpp b/samples/Cpp/TestCpp/Classes/AppDelegate.cpp index 2dcd3d1558..e2c264c37f 100644 --- a/samples/Cpp/TestCpp/Classes/AppDelegate.cpp +++ b/samples/Cpp/TestCpp/Classes/AppDelegate.cpp @@ -3,6 +3,7 @@ #include "cocos2d.h" #include "controller.h" #include "SimpleAudioEngine.h" +#include "cocostudio/armature/utils/CCArmatureDataManager.h" #include "cocos-ext.h" USING_NS_CC; @@ -15,7 +16,7 @@ AppDelegate::AppDelegate() AppDelegate::~AppDelegate() { // SimpleAudioEngine::end(); - cocos2d::extension::armature::ArmatureDataManager::destoryInstance(); + cocostudio::ArmatureDataManager::destoryInstance(); } bool AppDelegate::applicationDidFinishLaunching() diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp index 63d44fbea0..63a987f170 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp @@ -1,9 +1,10 @@ #include "ArmatureScene.h" #include "../../testResource.h" +#include "armature/display/CCSkin.h" using namespace cocos2d; -using namespace cocos2d::extension::armature; +using namespace cocostudio; Layer *NextTest(); Layer *BackTest(); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.h index 587938b052..1db21babb0 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.h @@ -5,6 +5,7 @@ #include "cocos-ext.h" #include "../../VisibleRect.h" #include "../../testBasic.h" +#include "armature/CCArmature.h" #if ENABLE_PHYSICS_BOX2D_DETECT #include "../../Box2DTestBed/GLES-Render.h" @@ -96,7 +97,7 @@ public: virtual void onEnter(); virtual std::string title(); virtual std::string subtitle(); - virtual void addArmature(cocos2d::extension::armature::Armature *armature); + virtual void addArmature(cocostudio::Armature *armature); void update(float delta); int armatureCount; @@ -124,11 +125,11 @@ public: virtual void onEnter(); virtual std::string title(); - void animationEvent(cocos2d::extension::armature::Armature *armature, cocos2d::extension::armature::MovementEventType movementType, const char *movementID); + void animationEvent(cocostudio::Armature *armature, cocostudio::MovementEventType movementType, const char *movementID); void callback1(); void callback2(); - cocos2d::extension::armature::Armature *armature; + cocostudio::Armature *armature; }; class TestUseMutiplePicture : public ArmatureTestLayer @@ -140,7 +141,7 @@ class TestUseMutiplePicture : public ArmatureTestLayer virtual void onTouchesEnded(const std::vector& touches, Event* event) override; int displayIndex; - cocos2d::extension::armature::Armature *armature; + cocostudio::Armature *armature; }; class TestParticleDisplay : public ArmatureTestLayer @@ -152,7 +153,7 @@ class TestParticleDisplay : public ArmatureTestLayer virtual void onTouchesEnded(const std::vector& touches, Event* event); int animationID; - cocos2d::extension::armature::Armature *armature; + cocostudio::Armature *armature; }; @@ -173,13 +174,13 @@ public: virtual void draw(); virtual void update(float delta); - void onFrameEvent(cocos2d::extension::armature::Bone *bone, const char *evt, int originFrameIndex, int currentFrameIndex); + void onFrameEvent(cocostudio::Bone *bone, const char *evt, int originFrameIndex, int currentFrameIndex); void initWorld(); - cocos2d::extension::armature::Armature *armature; - cocos2d::extension::armature::Armature *armature2; + cocostudio::Armature *armature; + cocostudio::Armature *armature2; cocos2d::extension::PhysicsSprite *bullet; @@ -202,13 +203,13 @@ public: virtual std::string title(); virtual void update(float delta); - void onFrameEvent(cocos2d::extension::armature::Bone *bone, const char *evt, int originFrameIndex, int currentFrameIndex); + void onFrameEvent(cocostudio::Bone *bone, const char *evt, int originFrameIndex, int currentFrameIndex); void initWorld(); - cocos2d::extension::armature::Armature *armature; - cocos2d::extension::armature::Armature *armature2; + cocostudio::Armature *armature; + cocostudio::Armature *armature2; cocos2d::extension::PhysicsSprite *bullet; @@ -233,7 +234,7 @@ public: virtual std::string title(); virtual void draw(); - cocos2d::extension::armature::Armature *armature; + cocostudio::Armature *armature; Rect rect; }; @@ -252,7 +253,7 @@ public: virtual std::string title(); virtual void onTouchesEnded(const std::vector& touches, Event* event); - cocos2d::extension::armature::Armature *armature; + cocostudio::Armature *armature; int weaponIndex; }; #endif // __HELLOWORLD_SCENE_H__ \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/ComponentsTestScene.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/ComponentsTestScene.cpp index cac0af8b1c..a7325e0663 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/ComponentsTestScene.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/ComponentsTestScene.cpp @@ -7,6 +7,7 @@ using namespace cocos2d; using namespace cocos2d::extension; +using namespace cocostudio; ComponentsTestLayer::~ComponentsTestLayer() { diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/EnemyController.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/EnemyController.cpp index 690de6c8ff..9376434f29 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/EnemyController.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/EnemyController.cpp @@ -2,6 +2,7 @@ #include "SceneController.h" using namespace cocos2d; +using namespace cocostudio; EnemyController::EnemyController(void) { diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/EnemyController.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/EnemyController.h index 94c655e31d..891c84cf14 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/EnemyController.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/EnemyController.h @@ -3,9 +3,10 @@ #include "cocos2d.h" #include "cocos-ext.h" +#include "CocoStudio.h" -class EnemyController : public cocos2d::extension::ComController +class EnemyController : public cocostudio::ComController { protected: EnemyController(void); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/PlayerController.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/PlayerController.cpp index 45ae61cead..83cb56d7df 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/PlayerController.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/PlayerController.cpp @@ -4,7 +4,7 @@ #include "ProjectileController.h" using namespace cocos2d; -using namespace cocos2d::extension; +using namespace cocostudio; PlayerController::PlayerController(void) { diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/PlayerController.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/PlayerController.h index 167454777a..b8baed4f54 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/PlayerController.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/PlayerController.h @@ -3,9 +3,10 @@ #include "cocos2d.h" #include "cocos-ext.h" +#include "CocoStudio.h" -class PlayerController : public cocos2d::extension::ComController +class PlayerController : public cocostudio::ComController { protected: PlayerController(void); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/ProjectileController.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/ProjectileController.cpp index 3061326118..101565d4fc 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/ProjectileController.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/ProjectileController.cpp @@ -3,6 +3,7 @@ #include "EnemyController.h" using namespace cocos2d; +using namespace cocostudio; ProjectileController::ProjectileController(void) { diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/ProjectileController.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/ProjectileController.h index 25bb4c30ec..68c4e1aaf7 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/ProjectileController.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/ProjectileController.h @@ -3,9 +3,9 @@ #include "cocos2d.h" #include "cocos-ext.h" +#include "CocoStudio.h" - -class ProjectileController : public cocos2d::extension::ComController +class ProjectileController : public cocostudio::ComController { protected: ProjectileController(void); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/SceneController.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/SceneController.cpp index 811423517d..92ee81267f 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/SceneController.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/SceneController.cpp @@ -6,6 +6,7 @@ using namespace cocos2d; using namespace cocos2d::extension; +using namespace cocostudio; SceneController::SceneController(void) : _fAddTargetTime(0.0f) diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/SceneController.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/SceneController.h index 0fcc2f2bf2..203c74e180 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/SceneController.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/SceneController.h @@ -3,9 +3,9 @@ #include "cocos2d.h" #include "cocos-ext.h" +#include "CocoStudio.h" - -class SceneController : public cocos2d::extension::ComController +class SceneController : public cocostudio::ComController { protected: SceneController(void); @@ -32,7 +32,7 @@ public: protected: cocos2d::Array *_targets; - cocos2d::Array *_projectiles; + cocos2d::Array *_projectiles; }; diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/CocosGUIScene.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/CocosGUIScene.cpp index 381a093ff9..8bcdd1e0f4 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/CocosGUIScene.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/CocosGUIScene.cpp @@ -2,6 +2,7 @@ #include "UISceneManager.h" //#include "CocosGUIExamplesRegisterScene.h" #include "../ExtensionsTest.h" +#include "CocoStudio.h" const char* gui_scene_names[2] = { @@ -17,9 +18,9 @@ CocosGUITestScene::CocosGUITestScene(bool bPortrait) CocosGUITestScene::~CocosGUITestScene() { - cocos2d::extension::SceneReader::getInstance()->purgeSceneReader(); - cocos2d::extension::ActionManagerEx::purgeActionManager(); - cocos2d::extension::UIHelper::purgeUIHelper(); + cocostudio::SceneReader::getInstance()->purgeSceneReader(); + cocostudio::ActionManagerEx::purgeActionManager(); + gui::UIHelper::purgeUIHelper(); } void CocosGUITestScene::runThisTest() diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/CocosGUIScene.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/CocosGUIScene.h index e1f589eac8..7e2ab4fd00 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/CocosGUIScene.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/CocosGUIScene.h @@ -28,9 +28,11 @@ #include "cocos2d.h" #include "cocos-ext.h" #include "../../testBasic.h" +#include "system/CocosGUI.h" using namespace cocos2d; using namespace cocos2d::extension; +using namespace gui; class CocosGUITestScene : public TestScene { diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp index 27ca365d68..b1a288c212 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp @@ -61,19 +61,19 @@ void UIButtonTest::touchEvent(Object *pSender, TouchEventType type) { switch (type) { - case cocos2d::extension::TOUCH_EVENT_BEGAN: + case gui::TOUCH_EVENT_BEGAN: m_pDisplayValueLabel->setText(CCString::createWithFormat("Touch Down")->getCString()); break; - case cocos2d::extension::TOUCH_EVENT_MOVED: + case gui::TOUCH_EVENT_MOVED: m_pDisplayValueLabel->setText(CCString::createWithFormat("Touch Move")->getCString()); break; - case cocos2d::extension::TOUCH_EVENT_ENDED: + case gui::TOUCH_EVENT_ENDED: m_pDisplayValueLabel->setText(CCString::createWithFormat("Touch Up")->getCString()); break; - case cocos2d::extension::TOUCH_EVENT_CANCELED: + case gui::TOUCH_EVENT_CANCELED: m_pDisplayValueLabel->setText(CCString::createWithFormat("Touch Cancelled")->getCString()); break; @@ -139,19 +139,19 @@ void UIButtonTest_Scale9::touchEvent(Object *pSender, TouchEventType type) { switch (type) { - case cocos2d::extension::TOUCH_EVENT_BEGAN: + case gui::TOUCH_EVENT_BEGAN: m_pDisplayValueLabel->setText(CCString::createWithFormat("Touch Down")->getCString()); break; - case cocos2d::extension::TOUCH_EVENT_MOVED: + case gui::TOUCH_EVENT_MOVED: m_pDisplayValueLabel->setText(CCString::createWithFormat("Touch Move")->getCString()); break; - case cocos2d::extension::TOUCH_EVENT_ENDED: + case gui::TOUCH_EVENT_ENDED: m_pDisplayValueLabel->setText(CCString::createWithFormat("Touch Up")->getCString()); break; - case cocos2d::extension::TOUCH_EVENT_CANCELED: + case gui::TOUCH_EVENT_CANCELED: m_pDisplayValueLabel->setText(CCString::createWithFormat("Touch Cancelled")->getCString()); break; @@ -213,19 +213,19 @@ void UIButtonTest_PressedAction::touchEvent(Object *pSender, TouchEventType type { switch (type) { - case cocos2d::extension::TOUCH_EVENT_BEGAN: + case gui::TOUCH_EVENT_BEGAN: m_pDisplayValueLabel->setText(CCString::createWithFormat("Touch Down")->getCString()); break; - case cocos2d::extension::TOUCH_EVENT_MOVED: + case gui::TOUCH_EVENT_MOVED: m_pDisplayValueLabel->setText(CCString::createWithFormat("Touch Move")->getCString()); break; - case cocos2d::extension::TOUCH_EVENT_ENDED: + case gui::TOUCH_EVENT_ENDED: m_pDisplayValueLabel->setText(CCString::createWithFormat("Touch Up")->getCString()); break; - case cocos2d::extension::TOUCH_EVENT_CANCELED: + case gui::TOUCH_EVENT_CANCELED: m_pDisplayValueLabel->setText(CCString::createWithFormat("Touch Cancelled")->getCString()); break; diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.cpp index 3855d5afe3..66b0c64a96 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.cpp @@ -67,10 +67,10 @@ bool UICheckBoxTest::init() void UICheckBoxTest::selectedEvent(Object* pSender,CheckBoxEventType type) { switch (type) { - case cocos2d::extension::CHECKBOX_STATE_EVENT_SELECTED: + case gui::CHECKBOX_STATE_EVENT_SELECTED: m_pDisplayValueLabel->setText(CCString::createWithFormat("Selected")->getCString()); break; - case cocos2d::extension::CHECKBOX_STATE_EVENT_UNSELECTED: + case gui::CHECKBOX_STATE_EVENT_UNSELECTED: m_pDisplayValueLabel->setText(CCString::createWithFormat("Unselected")->getCString()); break; default: diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScene.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScene.cpp index f1ed704289..3f3cf16873 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScene.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScene.cpp @@ -4,6 +4,8 @@ #include "UISceneManager.h" #include "../ExtensionsTest.h" +using namespace gui; + UIScene::UIScene() : m_pSceneTitle(NULL) , m_pUiLayer(NULL) diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScene.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScene.h index 5e4e724e6c..582964d66a 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScene.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScene.h @@ -27,9 +27,11 @@ #include "cocos2d.h" #include "cocos-ext.h" +#include "system/CocosGUI.h" USING_NS_CC; USING_NS_CC_EXT; +using namespace gui; #define UI_SCENE_CREATE_FUNC(UIScene) \ public: \ diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UITextButtonTest/UITextButtonTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UITextButtonTest/UITextButtonTest.cpp index 64f7abbd3e..440210eee6 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UITextButtonTest/UITextButtonTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UITextButtonTest/UITextButtonTest.cpp @@ -62,19 +62,19 @@ void UITextButtonTest::touchEvent(Object *pSender, TouchEventType type) { switch (type) { - case cocos2d::extension::TOUCH_EVENT_BEGAN: + case gui::TOUCH_EVENT_BEGAN: m_pDisplayValueLabel->setText(CCString::createWithFormat("Touch Down")->getCString()); break; - case cocos2d::extension::TOUCH_EVENT_MOVED: + case gui::TOUCH_EVENT_MOVED: m_pDisplayValueLabel->setText(CCString::createWithFormat("Touch Move")->getCString()); break; - case cocos2d::extension::TOUCH_EVENT_ENDED: + case gui::TOUCH_EVENT_ENDED: m_pDisplayValueLabel->setText(CCString::createWithFormat("Touch Up")->getCString()); break; - case cocos2d::extension::TOUCH_EVENT_CANCELED: + case gui::TOUCH_EVENT_CANCELED: m_pDisplayValueLabel->setText(CCString::createWithFormat("Touch Cancelled")->getCString()); break; @@ -139,19 +139,19 @@ void UITextButtonTest_Scale9::touchEvent(Object *pSender, TouchEventType type) { switch (type) { - case cocos2d::extension::TOUCH_EVENT_BEGAN: + case gui::TOUCH_EVENT_BEGAN: m_pDisplayValueLabel->setText(CCString::createWithFormat("Touch Down")->getCString()); break; - case cocos2d::extension::TOUCH_EVENT_MOVED: + case gui::TOUCH_EVENT_MOVED: m_pDisplayValueLabel->setText(CCString::createWithFormat("Touch Move")->getCString()); break; - case cocos2d::extension::TOUCH_EVENT_ENDED: + case gui::TOUCH_EVENT_ENDED: m_pDisplayValueLabel->setText(CCString::createWithFormat("Touch Up")->getCString()); break; - case cocos2d::extension::TOUCH_EVENT_CANCELED: + case gui::TOUCH_EVENT_CANCELED: m_pDisplayValueLabel->setText(CCString::createWithFormat("Touch Cancelled")->getCString()); break; diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp index bd85fa7de6..a59f162999 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp @@ -2,16 +2,19 @@ #include "cocos-ext.h" #include "../ExtensionsTest.h" #include "SceneEditorTest.h" +#include "CocoStudio.h" +#include "system/CocosGUI.h" using namespace cocos2d; -using namespace cocos2d::extension; +using namespace cocostudio; +using namespace gui; SceneEditorTestLayer::~SceneEditorTestLayer() { - armature::ArmatureDataManager::getInstance()->destoryInstance(); + ArmatureDataManager::getInstance()->destoryInstance(); SceneReader::getInstance()->purgeSceneReader(); - cocos2d::extension::ActionManagerEx::shareManager()->purgeActionManager(); - cocos2d::extension::UIHelper::instance()->purgeUIHelper(); + ActionManagerEx::shareManager()->purgeActionManager(); + UIHelper::instance()->purgeUIHelper(); } SceneEditorTestLayer::SceneEditorTestLayer() @@ -77,7 +80,7 @@ cocos2d::Node* SceneEditorTestLayer::createGameScene() pNode->addChild(menuBack); //ui action - cocos2d::extension::ActionManagerEx::shareManager()->playActionByName("startMenu_1.json","Animation1"); + ActionManagerEx::shareManager()->playActionByName("startMenu_1.json","Animation1"); return pNode; } diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsLayerLoader.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsLayerLoader.h index 63c482e972..a477774b8e 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsLayerLoader.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsLayerLoader.h @@ -6,7 +6,7 @@ /* Forward declaration. */ class CCBReader; -class AnimationsTestLayerLoader : public cocos2d::extension::LayerLoader { +class AnimationsTestLayerLoader : public cocosbuilder::LayerLoader { public: CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(AnimationsTestLayerLoader, loader); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.cpp index 7224f6dc69..934552aed5 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.cpp @@ -2,6 +2,7 @@ USING_NS_CC; USING_NS_CC_EXT; +using namespace cocosbuilder; AnimationsTestLayer::AnimationsTestLayer() : mAnimationManager(NULL) @@ -33,7 +34,7 @@ bool AnimationsTestLayer::onAssignCCBMemberVariable(Object * pTarget, const char return false; } -void AnimationsTestLayer::setAnimationManager(cocos2d::extension::CCBAnimationManager *pAnimationManager) +void AnimationsTestLayer::setAnimationManager(cocosbuilder::CCBAnimationManager *pAnimationManager) { CC_SAFE_RELEASE_NULL(mAnimationManager); mAnimationManager = pAnimationManager; diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.h index 207af01c91..b158784607 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.h @@ -3,11 +3,12 @@ #include "cocos2d.h" #include "cocos-ext.h" +#include "CocosBuilder.h" class AnimationsTestLayer : public cocos2d::Layer -, public cocos2d::extension::CCBSelectorResolver -, public cocos2d::extension::CCBMemberVariableAssigner +, public cocosbuilder::CCBSelectorResolver +, public cocosbuilder::CCBMemberVariableAssigner { public: CCB_STATIC_NEW_AUTORELEASE_OBJECT_WITH_INIT_METHOD(AnimationsTestLayer, create); @@ -24,10 +25,10 @@ public: void onControlButtonJumpClicked(cocos2d::Object * sender, cocos2d::extension::Control::EventType pControlEvent); void onControlButtonFunkyClicked(cocos2d::Object * sender, cocos2d::extension::Control::EventType pControlEvent); - void setAnimationManager(cocos2d::extension::CCBAnimationManager *pAnimationManager); + void setAnimationManager(cocosbuilder::CCBAnimationManager *pAnimationManager); private: - cocos2d::extension::CCBAnimationManager *mAnimationManager; + cocosbuilder::CCBAnimationManager *mAnimationManager; }; #endif \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.cpp index 17a7ba9d1c..238918e170 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.cpp @@ -2,6 +2,7 @@ USING_NS_CC; USING_NS_CC_EXT; +using namespace cocosbuilder; ButtonTestLayer::ButtonTestLayer() : mControlEventLabel(NULL) @@ -28,7 +29,7 @@ bool ButtonTestLayer::onAssignCCBMemberVariable(Object * pTarget, const char * p return false; } -void ButtonTestLayer::onControlButtonClicked(cocos2d::Object *pSender, cocos2d::extension::Control::EventType pControlEvent) { +void ButtonTestLayer::onControlButtonClicked(cocos2d::Object *pSender, Control::EventType pControlEvent) { switch(pControlEvent) { case Control::EventType::TOUCH_DOWN: this->mControlEventLabel->setString("Touch Down."); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.h index fb56110015..9468229dd8 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.h @@ -3,11 +3,12 @@ #include "cocos2d.h" #include "cocos-ext.h" +#include "CocosBuilder.h" class ButtonTestLayer : public cocos2d::Layer - , public cocos2d::extension::CCBMemberVariableAssigner - , public cocos2d::extension::CCBSelectorResolver + , public cocosbuilder::CCBMemberVariableAssigner + , public cocosbuilder::CCBSelectorResolver { public: CCB_STATIC_NEW_AUTORELEASE_OBJECT_WITH_INIT_METHOD(ButtonTestLayer, create); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayerLoader.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayerLoader.h index 76b2798739..2729b0d260 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayerLoader.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayerLoader.h @@ -6,7 +6,7 @@ /* Forward declaration. */ class CCBReader; -class ButtonTestLayerLoader : public cocos2d::extension::LayerLoader { +class ButtonTestLayerLoader : public cocosbuilder::LayerLoader { public: CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(ButtonTestLayerLoader, loader); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/CocosBuilderTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/CocosBuilderTest.cpp index 7efbe7c920..f63af2aca5 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/CocosBuilderTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/CocosBuilderTest.cpp @@ -28,6 +28,7 @@ USING_NS_CC; USING_NS_CC_EXT; +using namespace cocosbuilder; void CocosBuilderTestScene::runThisTest() { /* Create an autorelease NodeLoaderLibrary. */ @@ -36,7 +37,7 @@ void CocosBuilderTestScene::runThisTest() { ccNodeLoaderLibrary->registerNodeLoader("HelloCocosBuilderLayer", HelloCocosBuilderLayerLoader::loader()); /* Create an autorelease CCBReader. */ - cocos2d::extension::CCBReader * ccbReader = new cocos2d::extension::CCBReader(ccNodeLoaderLibrary); + cocosbuilder::CCBReader * ccbReader = new cocosbuilder::CCBReader(ccNodeLoaderLibrary); /* Read a ccbi file. */ auto node = ccbReader->readNodeGraphFromFile("ccb/HelloCocosBuilder.ccbi", this); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.cpp index 90deb8a29e..5837fdd368 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.cpp @@ -12,6 +12,7 @@ USING_NS_CC; USING_NS_CC_EXT; +using namespace cocosbuilder; HelloCocosBuilderLayer::HelloCocosBuilderLayer() : mBurstSprite(NULL) @@ -34,7 +35,7 @@ void HelloCocosBuilderLayer::openTest(const char * pCCBFileName, const char * no } /* Create an autorelease CCBReader. */ - cocos2d::extension::CCBReader * ccbReader = new cocos2d::extension::CCBReader(ccNodeLoaderLibrary); + cocosbuilder::CCBReader * ccbReader = new cocosbuilder::CCBReader(ccNodeLoaderLibrary); ccbReader->autorelease(); /* Read a ccbi file. */ @@ -61,7 +62,7 @@ void HelloCocosBuilderLayer::openTest(const char * pCCBFileName, const char * no } -void HelloCocosBuilderLayer::onNodeLoaded(cocos2d::Node * node, cocos2d::extension::NodeLoader * nodeLoader) { +void HelloCocosBuilderLayer::onNodeLoaded(cocos2d::Node * node, cocosbuilder::NodeLoader * nodeLoader) { auto ccRotateBy = RotateBy::create(20.0f, 360); auto ccRepeatForever = RepeatForever::create(ccRotateBy); this->mBurstSprite->runAction(ccRepeatForever); @@ -91,7 +92,7 @@ bool HelloCocosBuilderLayer::onAssignCCBMemberVariable(Object * pTarget, const c return false; } -bool HelloCocosBuilderLayer::onAssignCCBCustomProperty(Object* pTarget, const char* pMemberVariableName, cocos2d::extension::CCBValue* pCCBValue) +bool HelloCocosBuilderLayer::onAssignCCBCustomProperty(Object* pTarget, const char* pMemberVariableName, cocosbuilder::CCBValue* pCCBValue) { bool bRet = false; if (pTarget == this) @@ -126,19 +127,19 @@ bool HelloCocosBuilderLayer::onAssignCCBCustomProperty(Object* pTarget, const ch return bRet; } -void HelloCocosBuilderLayer::onMenuTestClicked(Object * sender, cocos2d::extension::Control::EventType pControlEvent) { +void HelloCocosBuilderLayer::onMenuTestClicked(Object * sender, Control::EventType pControlEvent) { this->openTest("ccb/ccb/TestMenus.ccbi", "TestMenusLayer", MenuTestLayerLoader::loader()); } -void HelloCocosBuilderLayer::onSpriteTestClicked(Object * sender, cocos2d::extension::Control::EventType pControlEvent) { +void HelloCocosBuilderLayer::onSpriteTestClicked(Object * sender, Control::EventType pControlEvent) { this->openTest("ccb/ccb/TestSprites.ccbi", "TestSpritesLayer", SpriteTestLayerLoader::loader()); } -void HelloCocosBuilderLayer::onButtonTestClicked(Object * sender, cocos2d::extension::Control::EventType pControlEvent) { +void HelloCocosBuilderLayer::onButtonTestClicked(Object * sender, Control::EventType pControlEvent) { this->openTest("ccb/ccb/TestButtons.ccbi", "TestButtonsLayer", ButtonTestLayerLoader::loader()); } -void HelloCocosBuilderLayer::onAnimationsTestClicked(Object * sender, cocos2d::extension::Control::EventType pControlEvent) { +void HelloCocosBuilderLayer::onAnimationsTestClicked(Object * sender, Control::EventType pControlEvent) { /* Create an autorelease NodeLoaderLibrary. */ NodeLoaderLibrary * ccNodeLoaderLibrary = NodeLoaderLibrary::newDefaultNodeLoaderLibrary(); @@ -148,7 +149,7 @@ void HelloCocosBuilderLayer::onAnimationsTestClicked(Object * sender, cocos2d::e /* Create an autorelease CCBReader. */ - cocos2d::extension::CCBReader * ccbReader = new cocos2d::extension::CCBReader(ccNodeLoaderLibrary); + cocosbuilder::CCBReader * ccbReader = new cocosbuilder::CCBReader(ccNodeLoaderLibrary); ccbReader->autorelease(); /* Read a ccbi file. */ @@ -179,16 +180,16 @@ void HelloCocosBuilderLayer::onAnimationsTestClicked(Object * sender, cocos2d::e //this->openTest("TestAnimations.ccbi", "TestAnimationsLayer", AnimationsTestLayerLoader::loader()); } -void HelloCocosBuilderLayer::onParticleSystemTestClicked(Object * sender, cocos2d::extension::Control::EventType pControlEvent) { +void HelloCocosBuilderLayer::onParticleSystemTestClicked(Object * sender, Control::EventType pControlEvent) { this->openTest("ccb/ccb/TestParticleSystems.ccbi", "TestParticleSystemsLayer", ParticleSystemTestLayerLoader::loader()); } -void HelloCocosBuilderLayer::onScrollViewTestClicked(Object * sender, cocos2d::extension::Control::EventType pControlEvent) +void HelloCocosBuilderLayer::onScrollViewTestClicked(Object * sender, Control::EventType pControlEvent) { this->openTest("ccb/ccb/TestScrollViews.ccbi", "TestScrollViewsLayer", ScrollViewTestLayerLoader::loader()); } -void HelloCocosBuilderLayer::onTimelineCallbackSoundClicked(Object * sender, cocos2d::extension::Control::EventType pControlEvent) +void HelloCocosBuilderLayer::onTimelineCallbackSoundClicked(Object * sender, Control::EventType pControlEvent) { this->openTest("ccb/ccb/TestTimelineCallback.ccbi", "TimelineCallbackTestLayer", TimelineCallbackTestLayerLoader::loader()); } diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.h index 7a1bdd577f..b20072bc30 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.h @@ -3,6 +3,7 @@ #include "cocos2d.h" #include "cocos-ext.h" +#include "CocosBuilder.h" /* * Note: for some pretty hard fucked up reason, the order of inheritance is important! @@ -16,9 +17,9 @@ */ class HelloCocosBuilderLayer : public cocos2d::Layer -, public cocos2d::extension::CCBSelectorResolver -, public cocos2d::extension::CCBMemberVariableAssigner -, public cocos2d::extension::NodeLoaderListener +, public cocosbuilder::CCBSelectorResolver +, public cocosbuilder::CCBMemberVariableAssigner +, public cocosbuilder::NodeLoaderListener { public: CCB_STATIC_NEW_AUTORELEASE_OBJECT_WITH_INIT_METHOD(HelloCocosBuilderLayer, create); @@ -26,13 +27,13 @@ class HelloCocosBuilderLayer HelloCocosBuilderLayer(); virtual ~HelloCocosBuilderLayer(); - void openTest(const char * pCCBFileName, const char * nodeName = NULL, cocos2d::extension::NodeLoader * nodeLoader = NULL); + void openTest(const char * pCCBFileName, const char * nodeName = NULL, cocosbuilder::NodeLoader * nodeLoader = NULL); 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 * node); - virtual bool onAssignCCBCustomProperty(Object* pTarget, const char* pMemberVariableName, cocos2d::extension::CCBValue* pCCBValue); - virtual void onNodeLoaded(cocos2d::Node * node, cocos2d::extension::NodeLoader * nodeLoader); + virtual bool onAssignCCBCustomProperty(Object* pTarget, const char* pMemberVariableName, cocosbuilder::CCBValue* pCCBValue); + virtual void onNodeLoaded(cocos2d::Node * node, cocosbuilder::NodeLoader * nodeLoader); void onMenuTestClicked(cocos2d::Object * sender, cocos2d::extension::Control::EventType pControlEvent); void onSpriteTestClicked(cocos2d::Object * sender, cocos2d::extension::Control::EventType pControlEvent); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayerLoader.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayerLoader.h index 8c1174d575..60067f2dfa 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayerLoader.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayerLoader.h @@ -6,7 +6,7 @@ /* Forward declaration. */ class CCBReader; -class HelloCocosBuilderLayerLoader : public cocos2d::extension::LayerLoader { +class HelloCocosBuilderLayerLoader : public cocosbuilder::LayerLoader { public: CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(HelloCocosBuilderLayerLoader, loader); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/LabelTest/LabelTestLayerLoader.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/LabelTest/LabelTestLayerLoader.h index 5ad7f89ac9..acde02a4a2 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/LabelTest/LabelTestLayerLoader.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/LabelTest/LabelTestLayerLoader.h @@ -6,7 +6,7 @@ /* Forward declaration. */ class CCBReader; -class LabelTestLayerLoader : public cocos2d::extension::LayerLoader { +class LabelTestLayerLoader : public cocosbuilder::LayerLoader { public: CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(LabelTestLayerLoader, loader); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.cpp index 5f53a6d61d..f29fd86cad 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.cpp @@ -2,6 +2,7 @@ USING_NS_CC; USING_NS_CC_EXT; +using namespace cocosbuilder; MenuTestLayer::MenuTestLayer() : mMenuItemStatusLabelBMFont(NULL) diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.h index 0f0a22d85d..4dfe4468e7 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.h @@ -3,11 +3,12 @@ #include "cocos2d.h" #include "cocos-ext.h" +#include "CocosBuilder.h" class MenuTestLayer : public cocos2d::Layer - , public cocos2d::extension::CCBSelectorResolver - , public cocos2d::extension::CCBMemberVariableAssigner + , public cocosbuilder::CCBSelectorResolver + , public cocosbuilder::CCBMemberVariableAssigner { public: CCB_STATIC_NEW_AUTORELEASE_OBJECT_WITH_INIT_METHOD(MenuTestLayer, create); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayerLoader.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayerLoader.h index d51a2f3ed5..40b40cb7b2 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayerLoader.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayerLoader.h @@ -6,7 +6,7 @@ /* Forward declaration. */ class CCBReader; -class MenuTestLayerLoader : public cocos2d::extension::LayerLoader { +class MenuTestLayerLoader : public cocosbuilder::LayerLoader { public: CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(MenuTestLayerLoader, loader); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ParticleSystemTest/ParticleSystemTestLayerLoader.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ParticleSystemTest/ParticleSystemTestLayerLoader.h index c2410c7d8e..e3d8457818 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ParticleSystemTest/ParticleSystemTestLayerLoader.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ParticleSystemTest/ParticleSystemTestLayerLoader.h @@ -6,7 +6,7 @@ /* Forward declaration. */ class CCBReader; -class ParticleSystemTestLayerLoader : public cocos2d::extension::LayerLoader { +class ParticleSystemTestLayerLoader : public cocosbuilder::LayerLoader { public: CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(ParticleSystemTestLayerLoader, loader); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ScrollViewTest/ScrollViewTestLayerLoader.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ScrollViewTest/ScrollViewTestLayerLoader.h index 17c736a28c..5a2c604ac4 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ScrollViewTest/ScrollViewTestLayerLoader.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ScrollViewTest/ScrollViewTestLayerLoader.h @@ -6,7 +6,7 @@ /* Forward declaration. */ class CCBReader; -class ScrollViewTestLayerLoader : public cocos2d::extension::LayerLoader { +class ScrollViewTestLayerLoader : public cocosbuilder::LayerLoader { public: CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(ScrollViewTestLayerLoader, loader); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/SpriteTest/SpriteTestLayerLoader.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/SpriteTest/SpriteTestLayerLoader.h index 47aca5a5de..4fbd717017 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/SpriteTest/SpriteTestLayerLoader.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/SpriteTest/SpriteTestLayerLoader.h @@ -6,7 +6,7 @@ /* Forward declaration. */ class CCBReader; -class SpriteTestLayerLoader : public cocos2d::extension::LayerLoader { +class SpriteTestLayerLoader : public cocosbuilder::LayerLoader { public: CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(SpriteTestLayerLoader, loader); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.cpp index 825c08c27f..e54a947bec 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.cpp @@ -2,6 +2,7 @@ USING_NS_CC; USING_NS_CC_EXT; +using namespace cocosbuilder; SEL_MenuHandler TestHeaderLayer::onResolveCCBCCMenuItemSelector(Object * pTarget, const char * pSelectorName) { CCB_SELECTORRESOLVER_CCMENUITEM_GLUE(this, "onBackClicked", TestHeaderLayer::onBackClicked); @@ -14,7 +15,7 @@ Control::Handler TestHeaderLayer::onResolveCCBCCControlSelector(Object * pTarget return NULL; } -void TestHeaderLayer::onNodeLoaded(cocos2d::Node * node, cocos2d::extension::NodeLoader * nodeLoader) +void TestHeaderLayer::onNodeLoaded(cocos2d::Node * node, cocosbuilder::NodeLoader * nodeLoader) { CCLOG("TestHeaderLayer::onNodeLoaded"); } diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.h index 936d89d1d6..316f93d62b 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.h @@ -3,18 +3,19 @@ #include "cocos2d.h" #include "cocos-ext.h" +#include "CocosBuilder.h" class TestHeaderLayer : public cocos2d::Layer - , public cocos2d::extension::CCBSelectorResolver -, public cocos2d::extension::NodeLoaderListener + , public cocosbuilder::CCBSelectorResolver +, public cocosbuilder::NodeLoaderListener { public: CCB_STATIC_NEW_AUTORELEASE_OBJECT_WITH_INIT_METHOD(TestHeaderLayer, 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 void onNodeLoaded(cocos2d::Node * node, cocos2d::extension::NodeLoader * nodeLoader); + virtual void onNodeLoaded(cocos2d::Node * node, cocosbuilder::NodeLoader * nodeLoader); void onBackClicked(cocos2d::Object * sender); }; diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayerLoader.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayerLoader.h index a834494c7e..7217c582c5 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayerLoader.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayerLoader.h @@ -6,7 +6,7 @@ /* Forward declaration. */ class CCBReader; -class TestHeaderLayerLoader : public cocos2d::extension::LayerLoader { +class TestHeaderLayerLoader : public cocosbuilder::LayerLoader { public: CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(TestHeaderLayerLoader, loader); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackLayerLoader.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackLayerLoader.h index 4e60a97c38..1b08d786ab 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackLayerLoader.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackLayerLoader.h @@ -3,7 +3,7 @@ #include "TimelineCallbackTestLayer.h" -class TimelineCallbackTestLayerLoader : public cocos2d::extension::LayerLoader { +class TimelineCallbackTestLayerLoader : public cocosbuilder::LayerLoader { public: CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(TimelineCallbackTestLayerLoader, loader); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.cpp index 72c85fe9d8..ba9dcbafe0 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.cpp @@ -3,6 +3,7 @@ USING_NS_CC; USING_NS_CC_EXT; +using namespace cocosbuilder; TimelineCallbackTestLayer::TimelineCallbackTestLayer() : _helloLabel(NULL) diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.h index 213c70c1e9..4dd14b8b73 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.h @@ -3,11 +3,12 @@ #include "cocos2d.h" #include "cocos-ext.h" +#include "CocosBuilder.h" class TimelineCallbackTestLayer : public cocos2d::Layer - , public cocos2d::extension::CCBSelectorResolver - , public cocos2d::extension::CCBMemberVariableAssigner + , public cocosbuilder::CCBSelectorResolver + , public cocosbuilder::CCBMemberVariableAssigner { public: CCB_STATIC_NEW_AUTORELEASE_OBJECT_WITH_INIT_METHOD(TimelineCallbackTestLayer, create); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/HttpClientTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/HttpClientTest.cpp index 2242198904..0704192e5f 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/HttpClientTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/HttpClientTest.cpp @@ -4,6 +4,7 @@ USING_NS_CC; USING_NS_CC_EXT; +using namespace network; HttpClientTest::HttpClientTest() : _labelStatusCode(NULL) diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/HttpClientTest.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/HttpClientTest.h index c838b7c224..ab432491dc 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/HttpClientTest.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/HttpClientTest.h @@ -3,6 +3,7 @@ #include "cocos2d.h" #include "cocos-ext.h" +#include "HttpClient.h" class HttpClientTest : public cocos2d::Layer { @@ -19,7 +20,7 @@ public: void onMenuDeleteTestClicked(cocos2d::Object *sender); //Http Response Callback - void onHttpRequestCompleted(cocos2d::extension::HttpClient *sender, cocos2d::extension::HttpResponse *response); + void onHttpRequestCompleted(network::HttpClient *sender, network::HttpResponse *response); private: cocos2d::LabelTTF* _labelStatusCode; diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/SocketIOTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/SocketIOTest.cpp index 0fea620718..58e9650a12 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/SocketIOTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/SocketIOTest.cpp @@ -12,6 +12,7 @@ USING_NS_CC; USING_NS_CC_EXT; +using namespace network; SocketIOTestLayer::SocketIOTestLayer(void) : _sioClient(NULL) @@ -206,7 +207,7 @@ void SocketIOTestLayer::onMenuTestEndpointDisconnectClicked(cocos2d::Object *sen // Delegate methods -void SocketIOTestLayer::onConnect(cocos2d::extension::SIOClient* client) +void SocketIOTestLayer::onConnect(network::SIOClient* client) { log("SocketIOTestLayer::onConnect called"); @@ -216,7 +217,7 @@ void SocketIOTestLayer::onConnect(cocos2d::extension::SIOClient* client) } -void SocketIOTestLayer::onMessage(cocos2d::extension::SIOClient* client, const std::string& data) +void SocketIOTestLayer::onMessage(network::SIOClient* client, const std::string& data) { log("SocketIOTestLayer::onMessage received: %s", data.c_str()); @@ -226,7 +227,7 @@ void SocketIOTestLayer::onMessage(cocos2d::extension::SIOClient* client, const s } -void SocketIOTestLayer::onClose(cocos2d::extension::SIOClient* client) +void SocketIOTestLayer::onClose(network::SIOClient* client) { log("SocketIOTestLayer::onClose called"); @@ -246,7 +247,7 @@ void SocketIOTestLayer::onClose(cocos2d::extension::SIOClient* client) } -void SocketIOTestLayer::onError(cocos2d::extension::SIOClient* client, const std::string& data) +void SocketIOTestLayer::onError(network::SIOClient* client, const std::string& data) { log("SocketIOTestLayer::onError received: %s", data.c_str()); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/SocketIOTest.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/SocketIOTest.h index fc1ebd8b2e..596738749c 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/SocketIOTest.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/SocketIOTest.h @@ -10,20 +10,20 @@ #include "cocos2d.h" #include "cocos-ext.h" -#include "network/SocketIO.h" +#include "SocketIO.h" class SocketIOTestLayer : public cocos2d::Layer - , public cocos2d::extension::SocketIO::SIODelegate + , public network::SocketIO::SIODelegate { public: SocketIOTestLayer(void); virtual ~SocketIOTestLayer(void); - virtual void onConnect(cocos2d::extension::SIOClient* client); - virtual void onMessage(cocos2d::extension::SIOClient* client, const std::string& data); - virtual void onClose(cocos2d::extension::SIOClient* client); - virtual void onError(cocos2d::extension::SIOClient* client, const std::string& data); + virtual void onConnect(network::SIOClient* client); + virtual void onMessage(network::SIOClient* client, const std::string& data); + virtual void onClose(network::SIOClient* client); + virtual void onError(network::SIOClient* client, const std::string& data); void toExtensionsMainLayer(cocos2d::Object *sender); @@ -38,10 +38,10 @@ public: void onMenuTestEndpointDisconnectClicked(cocos2d::Object *sender); - void testevent(cocos2d::extension::SIOClient *client, const std::string& data); - void echotest(cocos2d::extension::SIOClient *client, const std::string& data); + void testevent(network::SIOClient *client, const std::string& data); + void echotest(network::SIOClient *client, const std::string& data); - cocos2d::extension::SIOClient *_sioClient, *_sioEndpoint; + network::SIOClient *_sioClient, *_sioEndpoint; cocos2d::LabelTTF *_sioClientStatus; }; diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/WebSocketTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/WebSocketTest.cpp index be60e5405d..39a3ec5cc1 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/WebSocketTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/WebSocketTest.cpp @@ -11,6 +11,7 @@ USING_NS_CC; USING_NS_CC_EXT; +using namespace network; WebSocketTestLayer::WebSocketTestLayer() : _wsiSendText(NULL) @@ -107,7 +108,7 @@ WebSocketTestLayer::~WebSocketTestLayer() } // Delegate methods -void WebSocketTestLayer::onOpen(cocos2d::extension::WebSocket* ws) +void WebSocketTestLayer::onOpen(network::WebSocket* ws) { log("Websocket (%p) opened", ws); if (ws == _wsiSendText) @@ -124,7 +125,7 @@ void WebSocketTestLayer::onOpen(cocos2d::extension::WebSocket* ws) } } -void WebSocketTestLayer::onMessage(cocos2d::extension::WebSocket* ws, const cocos2d::extension::WebSocket::Data& data) +void WebSocketTestLayer::onMessage(network::WebSocket* ws, const network::WebSocket::Data& data) { if (!data.isBinary) { @@ -161,7 +162,7 @@ void WebSocketTestLayer::onMessage(cocos2d::extension::WebSocket* ws, const coco } } -void WebSocketTestLayer::onClose(cocos2d::extension::WebSocket* ws) +void WebSocketTestLayer::onClose(network::WebSocket* ws) { log("websocket instance (%p) closed.", ws); if (ws == _wsiSendText) @@ -180,7 +181,7 @@ void WebSocketTestLayer::onClose(cocos2d::extension::WebSocket* ws) CC_SAFE_DELETE(ws); } -void WebSocketTestLayer::onError(cocos2d::extension::WebSocket* ws, const cocos2d::extension::WebSocket::ErrorCode& error) +void WebSocketTestLayer::onError(network::WebSocket* ws, const network::WebSocket::ErrorCode& error) { log("Error was fired, error code: %d", error); if (ws == _wsiError) diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/WebSocketTest.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/WebSocketTest.h index 58a781ecf5..7ca1080e40 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/WebSocketTest.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/WebSocketTest.h @@ -11,20 +11,20 @@ #include "cocos2d.h" #include "cocos-ext.h" -#include "network/WebSocket.h" +#include "WebSocket.h" class WebSocketTestLayer : public cocos2d::Layer -, public cocos2d::extension::WebSocket::Delegate +, public network::WebSocket::Delegate { public: WebSocketTestLayer(); virtual ~WebSocketTestLayer(); - virtual void onOpen(cocos2d::extension::WebSocket* ws); - virtual void onMessage(cocos2d::extension::WebSocket* ws, const cocos2d::extension::WebSocket::Data& data); - virtual void onClose(cocos2d::extension::WebSocket* ws); - virtual void onError(cocos2d::extension::WebSocket* ws, const cocos2d::extension::WebSocket::ErrorCode& error); + virtual void onOpen(network::WebSocket* ws); + virtual void onMessage(network::WebSocket* ws, const network::WebSocket::Data& data); + virtual void onClose(network::WebSocket* ws); + virtual void onError(network::WebSocket* ws, const network::WebSocket::ErrorCode& error); void toExtensionsMainLayer(cocos2d::Object *sender); @@ -33,9 +33,9 @@ public: void onMenuSendBinaryClicked(cocos2d::Object *sender); private: - cocos2d::extension::WebSocket* _wsiSendText; - cocos2d::extension::WebSocket* _wsiSendBinary; - cocos2d::extension::WebSocket* _wsiError; + network::WebSocket* _wsiSendText; + network::WebSocket* _wsiSendBinary; + network::WebSocket* _wsiError; cocos2d::LabelTTF* _sendTextStatus; cocos2d::LabelTTF* _sendBinaryStatus; diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.cpp index 784b548fa9..f847090b47 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.cpp @@ -1,6 +1,6 @@ #include "NotificationCenterTest.h" #include "../ExtensionsTest.h" -#include "support/CCNotificationCenter.h" +#include "CCNotificationCenter.h" #define kTagLight 100 #define kTagConnect 200 diff --git a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceAllocTest.h b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceAllocTest.h index 5c822fc95a..fcfdba36ec 100644 --- a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceAllocTest.h +++ b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceAllocTest.h @@ -5,7 +5,7 @@ #define __PERFORMANCE_ALLOC_TEST_H__ #include "PerformanceTest.h" -#include "support/CCProfiling.h" +#include "CCProfiling.h" class AllocBasicLayer : public PerformBasicLayer { diff --git a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceNodeChildrenTest.h b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceNodeChildrenTest.h index 7c6a1efea4..95ce5914b5 100644 --- a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceNodeChildrenTest.h +++ b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceNodeChildrenTest.h @@ -2,7 +2,7 @@ #define __PERFORMANCE_NODE_CHILDREN_TEST_H__ #include "PerformanceTest.h" -#include "support/CCProfiling.h" +#include "CCProfiling.h" class NodeChildrenMenuLayer : public PerformBasicLayer { diff --git a/samples/Cpp/TestCpp/Classes/SpineTest/SpineTest.cpp b/samples/Cpp/TestCpp/Classes/SpineTest/SpineTest.cpp index 0912cb419e..385be5b1c1 100644 --- a/samples/Cpp/TestCpp/Classes/SpineTest/SpineTest.cpp +++ b/samples/Cpp/TestCpp/Classes/SpineTest/SpineTest.cpp @@ -27,10 +27,11 @@ #include #include #include + #include "spine/spine.h" using namespace cocos2d; -using namespace cocos2d::extension; using namespace std; +using namespace spine; //------------------------------------------------------------------ // diff --git a/samples/Cpp/TestCpp/Classes/SpineTest/SpineTest.h b/samples/Cpp/TestCpp/Classes/SpineTest/SpineTest.h index 95f4c9b249..58c4b13d0f 100644 --- a/samples/Cpp/TestCpp/Classes/SpineTest/SpineTest.h +++ b/samples/Cpp/TestCpp/Classes/SpineTest/SpineTest.h @@ -38,7 +38,7 @@ public: class SpineTestLayer: public cocos2d::Layer { private: - cocos2d::extension::CCSkeletonAnimation* skeletonNode; + spine::CCSkeletonAnimation* skeletonNode; public: diff --git a/samples/Cpp/TestCpp/Classes/TexturePackerEncryptionTest/TextureAtlasEncryptionTest.cpp b/samples/Cpp/TestCpp/Classes/TexturePackerEncryptionTest/TextureAtlasEncryptionTest.cpp index 0cf00124d1..5aea719250 100644 --- a/samples/Cpp/TestCpp/Classes/TexturePackerEncryptionTest/TextureAtlasEncryptionTest.cpp +++ b/samples/Cpp/TestCpp/Classes/TexturePackerEncryptionTest/TextureAtlasEncryptionTest.cpp @@ -1,6 +1,6 @@ #include "TextureAtlasEncryptionTest.h" #include "../testResource.h" -#include "support/zip_support/ZipUtils.h" +#include "ZipUtils.h" std::string TextureAtlasEncryptionDemo::title() { diff --git a/samples/Cpp/TestCpp/Classes/testBasic.cpp b/samples/Cpp/TestCpp/Classes/testBasic.cpp index 77f3476e51..5892c3e6e2 100644 --- a/samples/Cpp/TestCpp/Classes/testBasic.cpp +++ b/samples/Cpp/TestCpp/Classes/testBasic.cpp @@ -1,6 +1,7 @@ #include "testBasic.h" #include "controller.h" #include "cocos-ext.h" +#include "cocostudio/armature/utils/CCArmatureDataManager.h" TestScene::TestScene(bool bPortrait) { @@ -50,7 +51,7 @@ void TestScene::onEnter() scene->release(); } - cocos2d::extension::armature::ArmatureDataManager::destoryInstance(); + cocostudio::ArmatureDataManager::destoryInstance(); }); auto menu =Menu::create(menuItem, NULL); diff --git a/samples/Cpp/TestCpp/proj.android/build_native.sh b/samples/Cpp/TestCpp/proj.android/build_native.sh index ab5cdc78f8..69464cc437 100755 --- a/samples/Cpp/TestCpp/proj.android/build_native.sh +++ b/samples/Cpp/TestCpp/proj.android/build_native.sh @@ -95,4 +95,4 @@ rm -f "$APP_ANDROID_ROOT"/assets/Images/test_1021x1024_a8.pvr.gz echo "Using prebuilt externals" "$NDK_ROOT"/ndk-build -C "$APP_ANDROID_ROOT" $* \ - "NDK_MODULE_PATH=${COCOS2DX_ROOT}:${COCOS2DX_ROOT}/cocos2dx/platform/third_party/android/prebuilt" + "NDK_MODULE_PATH=${COCOS2DX_ROOT}:${COCOS2DX_ROOT}/external:${COCOS2DX_ROOT}/cocos" diff --git a/samples/Cpp/TestCpp/proj.android/jni/Android.mk b/samples/Cpp/TestCpp/proj.android/jni/Android.mk index d72618a488..c3190eef74 100644 --- a/samples/Cpp/TestCpp/proj.android/jni/Android.mk +++ b/samples/Cpp/TestCpp/proj.android/jni/Android.mk @@ -11,18 +11,7 @@ LOCAL_SRC_FILES := testcpp/main.cpp LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes LOCAL_WHOLE_STATIC_LIBRARIES := cocos_testcpp_common -LOCAL_WHOLE_STATIC_LIBRARIES += cocos2dx_static -LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_static -LOCAL_WHOLE_STATIC_LIBRARIES += box2d_static -LOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static -LOCAL_WHOLE_STATIC_LIBRARIES += cocos2dxandroid_static include $(BUILD_SHARED_LIBRARY) $(call import-module,samples/Cpp/TestCpp) -$(call import-module,cocos2dx) -$(call import-module,cocos2dx/platform/third_party/android/prebuilt/libcurl) -$(call import-module,audio/android) -$(call import-module,extensions) -$(call import-module,external/Box2D) -$(call import-module,cocos2dx/platform/android) From 8cad67a3e101b6b45ffa01e10e71dfd985e7aff4 Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Tue, 15 Oct 2013 13:36:03 -0700 Subject: [PATCH 36/64] small fixes for the Xcode projects --- build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id | 2 +- build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id | 1 + build/samples.xcodeproj/project.pbxproj.REMOVED.git-id | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id delete mode 100644 build/samples.xcodeproj/project.pbxproj.REMOVED.git-id diff --git a/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id b/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id index f6b6061df1..58407b8dbe 100644 --- a/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -1513bb8f2a786cfa406d2d6d9001e99abdd009ac \ No newline at end of file +fe809a5d9a1b0e24462a215517e08f6e525cd6b7 \ No newline at end of file diff --git a/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id b/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id new file mode 100644 index 0000000000..0bbb816654 --- /dev/null +++ b/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id @@ -0,0 +1 @@ +71d9dbdbc4e4e33dbb8fb7ad109611f197a0cec7 \ No newline at end of file diff --git a/build/samples.xcodeproj/project.pbxproj.REMOVED.git-id b/build/samples.xcodeproj/project.pbxproj.REMOVED.git-id deleted file mode 100644 index 3fe3b732a7..0000000000 --- a/build/samples.xcodeproj/project.pbxproj.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -561cdc247f0444ca86efc535600901b035e19ffa \ No newline at end of file From 7dc8aeb156a200d1626a9929d69b682deb6763e7 Mon Sep 17 00:00:00 2001 From: James Chen Date: Wed, 16 Oct 2013 11:19:01 +0800 Subject: [PATCH 37/64] issue #2905: Updating include path for 'cocostudio' module, adding 'cocostudio' prefix. --- .../cocostudio/action/CCActionFrameEasing.cpp | 2 +- .../cocostudio/action/CCActionFrameEasing.h | 2 +- .../cocostudio/action/CCActionManagerEx.cpp | 2 +- .../cocostudio/action/CCActionManagerEx.h | 2 +- .../cocostudio/action/CCActionNode.cpp | 2 +- .../cocostudio/action/CCActionNode.h | 2 +- .../cocostudio/action/CCActionObject.cpp | 2 +- .../cocostudio/action/CCActionObject.h | 2 +- .../animation/CCArmatureAnimation.cpp | 10 +- .../armature/animation/CCProcessBase.cpp | 2 +- .../armature/animation/CCProcessBase.h | 4 +- .../cocostudio/armature/animation/CCTween.cpp | 10 +- .../cocostudio/armature/animation/CCTween.h | 2 +- .../cocostudio/armature/datas/CCDatas.cpp | 4 +- .../cocostudio/armature/datas/CCDatas.h | 4 +- .../armature/display/CCBatchNode.cpp | 4 +- .../cocostudio/armature/display/CCBatchNode.h | 2 +- .../armature/display/CCDecorativeDisplay.h | 4 +- .../armature/display/CCDisplayFactory.cpp | 12 +- .../armature/display/CCDisplayFactory.h | 4 +- .../armature/display/CCDisplayManager.cpp | 8 +- .../armature/display/CCDisplayManager.h | 6 +- .../cocostudio/armature/display/CCSkin.cpp | 6 +- .../cocostudio/armature/display/CCSkin.h | 4 +- .../armature/physics/CCColliderDetector.cpp | 4 +- .../armature/physics/CCColliderDetector.h | 4 +- .../armature/utils/CCArmatureDataManager.h | 2 +- .../armature/utils/CCDataReaderHelper.cpp | 2 +- .../armature/utils/CCDataReaderHelper.h | 6 +- .../armature/utils/CCTransformHelp.h | 2 +- .../cocostudio/components/CCComAttribute.h | 2 +- .../cocostudio/json/CSContentJsonDictionary.h | 2 +- .../cocostudio/reader/CCSGUIReader.cpp | 4 +- .../cocostudio/reader/CCSGUIReader.h | 2 +- .../cocostudio/reader/CCSSceneReader.h | 2 +- cocos/gui/layouts/Layout.cpp | 2 +- cocos/gui/system/CocosGUI.h | 2 +- cocos/gui/system/UIHelper.cpp | 4 +- cocos/gui/system/UIHelper.h | 2 +- cocos/gui/widgets/UIButton.cpp | 2 +- cocos/gui/widgets/UIImageView.cpp | 2 +- cocos/gui/widgets/UILoadingBar.cpp | 2 +- cocos/gui/widgets/UISlider.cpp | 2 +- samples/Cpp/TestCpp/Android.mk | 262 +++++++++--------- samples/Cpp/TestCpp/Classes/AppDelegate.cpp | 3 +- .../CocoStudioArmatureTest/ArmatureScene.cpp | 2 +- .../CocoStudioArmatureTest/ArmatureScene.h | 2 +- .../EnemyController.h | 2 +- .../PlayerController.h | 2 +- .../ProjectileController.h | 2 +- .../SceneController.h | 2 +- .../CocoStudioGUITest/CocosGUIScene.cpp | 3 +- .../CocoStudioSceneTest/SceneEditorTest.cpp | 2 +- .../AnimationsTest/AnimationsTestLayer.h | 2 +- .../ButtonTest/ButtonTestLayer.h | 2 +- .../HelloCocosBuilderLayer.h | 2 +- .../CocosBuilderTest/MenuTest/MenuTestLayer.h | 2 +- .../TestHeader/TestHeaderLayer.h | 2 +- .../TimelineCallbackTestLayer.h | 2 +- samples/Cpp/TestCpp/Classes/testBasic.cpp | 2 +- 60 files changed, 224 insertions(+), 224 deletions(-) diff --git a/cocos/editor-support/cocostudio/action/CCActionFrameEasing.cpp b/cocos/editor-support/cocostudio/action/CCActionFrameEasing.cpp index 1e6513b56c..74c7467c71 100644 --- a/cocos/editor-support/cocostudio/action/CCActionFrameEasing.cpp +++ b/cocos/editor-support/cocostudio/action/CCActionFrameEasing.cpp @@ -24,7 +24,7 @@ #include #include "CCActionFrameEasing.h" -#include "json/DictionaryHelper.h" +#include "cocostudio/json/DictionaryHelper.h" namespace cocostudio { #ifndef M_PI_X_2 diff --git a/cocos/editor-support/cocostudio/action/CCActionFrameEasing.h b/cocos/editor-support/cocostudio/action/CCActionFrameEasing.h index aa6fd570e4..74ba932d4c 100644 --- a/cocos/editor-support/cocostudio/action/CCActionFrameEasing.h +++ b/cocos/editor-support/cocostudio/action/CCActionFrameEasing.h @@ -26,7 +26,7 @@ #define __ActionFrameEasing_H__ #include "cocos2d.h" -#include "json/CSContentJsonDictionary.h" +#include "cocostudio/json/CSContentJsonDictionary.h" namespace cocostudio { diff --git a/cocos/editor-support/cocostudio/action/CCActionManagerEx.cpp b/cocos/editor-support/cocostudio/action/CCActionManagerEx.cpp index 8d842715b1..b863c1f9a2 100644 --- a/cocos/editor-support/cocostudio/action/CCActionManagerEx.cpp +++ b/cocos/editor-support/cocostudio/action/CCActionManagerEx.cpp @@ -23,7 +23,7 @@ ****************************************************************************/ #include "CCActionManagerEx.h" -#include "json/DictionaryHelper.h" +#include "cocostudio/json/DictionaryHelper.h" using namespace cocos2d; diff --git a/cocos/editor-support/cocostudio/action/CCActionManagerEx.h b/cocos/editor-support/cocostudio/action/CCActionManagerEx.h index 4c757dfa37..8776fce030 100644 --- a/cocos/editor-support/cocostudio/action/CCActionManagerEx.h +++ b/cocos/editor-support/cocostudio/action/CCActionManagerEx.h @@ -27,7 +27,7 @@ #include "cocos2d.h" #include "CCActionObject.h" -#include "json/CSContentJsonDictionary.h" +#include "cocostudio/json/CSContentJsonDictionary.h" namespace cocostudio { diff --git a/cocos/editor-support/cocostudio/action/CCActionNode.cpp b/cocos/editor-support/cocostudio/action/CCActionNode.cpp index ca7db6cc5f..1390d64ed6 100644 --- a/cocos/editor-support/cocostudio/action/CCActionNode.cpp +++ b/cocos/editor-support/cocostudio/action/CCActionNode.cpp @@ -26,7 +26,7 @@ THE SOFTWARE. #include "CCActionFrameEasing.h" #include "base-classes/UIWidget.h" #include "system/UIHelper.h" -#include "json/DictionaryHelper.h" +#include "cocostudio/json/DictionaryHelper.h" using namespace cocos2d; using namespace gui; diff --git a/cocos/editor-support/cocostudio/action/CCActionNode.h b/cocos/editor-support/cocostudio/action/CCActionNode.h index 9e69981bbb..67a424bda8 100644 --- a/cocos/editor-support/cocostudio/action/CCActionNode.h +++ b/cocos/editor-support/cocostudio/action/CCActionNode.h @@ -27,7 +27,7 @@ #include "cocos2d.h" #include "CCActionFrame.h" -#include "json/CSContentJsonDictionary.h" +#include "cocostudio/json/CSContentJsonDictionary.h" namespace cocostudio { diff --git a/cocos/editor-support/cocostudio/action/CCActionObject.cpp b/cocos/editor-support/cocostudio/action/CCActionObject.cpp index c649268a23..e218dca888 100644 --- a/cocos/editor-support/cocostudio/action/CCActionObject.cpp +++ b/cocos/editor-support/cocostudio/action/CCActionObject.cpp @@ -23,7 +23,7 @@ ****************************************************************************/ #include "CCActionObject.h" -#include "json/DictionaryHelper.h" +#include "cocostudio/json/DictionaryHelper.h" using namespace cocos2d; diff --git a/cocos/editor-support/cocostudio/action/CCActionObject.h b/cocos/editor-support/cocostudio/action/CCActionObject.h index 34807e2127..7137f57355 100644 --- a/cocos/editor-support/cocostudio/action/CCActionObject.h +++ b/cocos/editor-support/cocostudio/action/CCActionObject.h @@ -27,7 +27,7 @@ #include "cocos2d.h" #include "CCActionNode.h" -#include "json/CSContentJsonDictionary.h" +#include "cocostudio/json/CSContentJsonDictionary.h" namespace cocostudio { diff --git a/cocos/editor-support/cocostudio/armature/animation/CCArmatureAnimation.cpp b/cocos/editor-support/cocostudio/armature/animation/CCArmatureAnimation.cpp index 4c42af7d1e..5490b4f4ee 100644 --- a/cocos/editor-support/cocostudio/armature/animation/CCArmatureAnimation.cpp +++ b/cocos/editor-support/cocostudio/armature/animation/CCArmatureAnimation.cpp @@ -23,11 +23,11 @@ THE SOFTWARE. ****************************************************************************/ #include "CCArmatureAnimation.h" -#include "armature/CCArmature.h" -#include "armature/CCBone.h" -#include "armature/utils/CCArmatureDefine.h" -#include "armature/utils/CCUtilMath.h" -#include "armature/datas/CCDatas.h" +#include "cocostudio/armature/CCArmature.h" +#include "cocostudio/armature/CCBone.h" +#include "cocostudio/armature/utils/CCArmatureDefine.h" +#include "cocostudio/armature/utils/CCUtilMath.h" +#include "cocostudio/armature/datas/CCDatas.h" using namespace cocos2d; diff --git a/cocos/editor-support/cocostudio/armature/animation/CCProcessBase.cpp b/cocos/editor-support/cocostudio/armature/animation/CCProcessBase.cpp index a30f68abd4..e235c1cb1e 100644 --- a/cocos/editor-support/cocostudio/armature/animation/CCProcessBase.cpp +++ b/cocos/editor-support/cocostudio/armature/animation/CCProcessBase.cpp @@ -23,7 +23,7 @@ THE SOFTWARE. ****************************************************************************/ #include "CCProcessBase.h" -#include "armature/utils/CCUtilMath.h" +#include "cocostudio/armature/utils/CCUtilMath.h" using namespace cocos2d; diff --git a/cocos/editor-support/cocostudio/armature/animation/CCProcessBase.h b/cocos/editor-support/cocostudio/armature/animation/CCProcessBase.h index dbde23dd1f..3d247e51a4 100644 --- a/cocos/editor-support/cocostudio/armature/animation/CCProcessBase.h +++ b/cocos/editor-support/cocostudio/armature/animation/CCProcessBase.h @@ -26,8 +26,8 @@ THE SOFTWARE. #ifndef __CCPROCESSBASE_H__ #define __CCPROCESSBASE_H__ -#include "armature/utils/CCArmatureDefine.h" -#include "armature/datas/CCDatas.h" +#include "cocostudio/armature/utils/CCArmatureDefine.h" +#include "cocostudio/armature/datas/CCDatas.h" namespace cocostudio { diff --git a/cocos/editor-support/cocostudio/armature/animation/CCTween.cpp b/cocos/editor-support/cocostudio/armature/animation/CCTween.cpp index 23896d1e8b..c9ba8cbe6e 100644 --- a/cocos/editor-support/cocostudio/armature/animation/CCTween.cpp +++ b/cocos/editor-support/cocostudio/armature/animation/CCTween.cpp @@ -25,11 +25,11 @@ THE SOFTWARE. #include "CCTween.h" #include "CCArmatureAnimation.h" -#include "armature/CCBone.h" -#include "armature/CCArmature.h" -#include "armature/utils/CCUtilMath.h" -#include "armature/utils/CCTweenFunction.h" -#include "armature/utils/CCTransformHelp.h" +#include "cocostudio/armature/CCBone.h" +#include "cocostudio/armature/CCArmature.h" +#include "cocostudio/armature/utils/CCUtilMath.h" +#include "cocostudio/armature/utils/CCTweenFunction.h" +#include "cocostudio/armature/utils/CCTransformHelp.h" namespace cocostudio { diff --git a/cocos/editor-support/cocostudio/armature/animation/CCTween.h b/cocos/editor-support/cocostudio/armature/animation/CCTween.h index bcbdde822c..f78e7ef927 100644 --- a/cocos/editor-support/cocostudio/armature/animation/CCTween.h +++ b/cocos/editor-support/cocostudio/armature/animation/CCTween.h @@ -27,7 +27,7 @@ THE SOFTWARE. #define __CCTWEEN_H__ #include "CCProcessBase.h" -#include "armature/utils/CCTweenFunction.h" +#include "cocostudio/armature/utils/CCTweenFunction.h" namespace cocostudio { diff --git a/cocos/editor-support/cocostudio/armature/datas/CCDatas.cpp b/cocos/editor-support/cocostudio/armature/datas/CCDatas.cpp index e03213ab8a..6d2468cb58 100644 --- a/cocos/editor-support/cocostudio/armature/datas/CCDatas.cpp +++ b/cocos/editor-support/cocostudio/armature/datas/CCDatas.cpp @@ -23,8 +23,8 @@ THE SOFTWARE. ****************************************************************************/ #include "CCDatas.h" -#include "armature/utils/CCUtilMath.h" -#include "armature/utils/CCTransformHelp.h" +#include "cocostudio/armature/utils/CCUtilMath.h" +#include "cocostudio/armature/utils/CCTransformHelp.h" using namespace cocos2d; diff --git a/cocos/editor-support/cocostudio/armature/datas/CCDatas.h b/cocos/editor-support/cocostudio/armature/datas/CCDatas.h index 81fca8ebcb..2725750c84 100644 --- a/cocos/editor-support/cocostudio/armature/datas/CCDatas.h +++ b/cocos/editor-support/cocostudio/armature/datas/CCDatas.h @@ -25,8 +25,8 @@ THE SOFTWARE. #ifndef __CCARMATURE_DATAS_H__ #define __CCARMATURE_DATAS_H__ -#include "armature/utils/CCArmatureDefine.h" -#include "armature/utils/CCTweenFunction.h" +#include "cocostudio/armature/utils/CCArmatureDefine.h" +#include "cocostudio/armature/utils/CCTweenFunction.h" #define CC_CREATE_NO_PARAM_NO_INIT(varType)\ diff --git a/cocos/editor-support/cocostudio/armature/display/CCBatchNode.cpp b/cocos/editor-support/cocostudio/armature/display/CCBatchNode.cpp index 04ae69a524..ba273731b1 100644 --- a/cocos/editor-support/cocostudio/armature/display/CCBatchNode.cpp +++ b/cocos/editor-support/cocostudio/armature/display/CCBatchNode.cpp @@ -23,8 +23,8 @@ THE SOFTWARE. ****************************************************************************/ #include "CCBatchNode.h" -#include "armature/utils/CCArmatureDefine.h" -#include "armature/CCArmature.h" +#include "cocostudio/armature/utils/CCArmatureDefine.h" +#include "cocostudio/armature/CCArmature.h" using namespace cocos2d; diff --git a/cocos/editor-support/cocostudio/armature/display/CCBatchNode.h b/cocos/editor-support/cocostudio/armature/display/CCBatchNode.h index fac221adb6..7e0c52bc29 100644 --- a/cocos/editor-support/cocostudio/armature/display/CCBatchNode.h +++ b/cocos/editor-support/cocostudio/armature/display/CCBatchNode.h @@ -25,7 +25,7 @@ THE SOFTWARE. #ifndef __CCBATCHNODE_H__ #define __CCBATCHNODE_H__ -#include "armature/utils/CCArmatureDefine.h" +#include "cocostudio/armature/utils/CCArmatureDefine.h" namespace cocostudio { diff --git a/cocos/editor-support/cocostudio/armature/display/CCDecorativeDisplay.h b/cocos/editor-support/cocostudio/armature/display/CCDecorativeDisplay.h index 3b42c9c64e..f65f143163 100644 --- a/cocos/editor-support/cocostudio/armature/display/CCDecorativeDisplay.h +++ b/cocos/editor-support/cocostudio/armature/display/CCDecorativeDisplay.h @@ -25,9 +25,9 @@ THE SOFTWARE. #ifndef __CCDECORATIVEDISPLAY_H__ #define __CCDECORATIVEDISPLAY_H__ -#include "armature/utils/CCArmatureDefine.h" +#include "cocostudio/armature/utils/CCArmatureDefine.h" #include "CCDisplayFactory.h" -#include "armature/datas/CCDatas.h" +#include "cocostudio/armature/datas/CCDatas.h" #if ENABLE_PHYSICS_BOX2D_DETECT || ENABLE_PHYSICS_CHIPMUNK_DETECT diff --git a/cocos/editor-support/cocostudio/armature/display/CCDisplayFactory.cpp b/cocos/editor-support/cocostudio/armature/display/CCDisplayFactory.cpp index 30d3184ff8..56e5f8c427 100644 --- a/cocos/editor-support/cocostudio/armature/display/CCDisplayFactory.cpp +++ b/cocos/editor-support/cocostudio/armature/display/CCDisplayFactory.cpp @@ -23,12 +23,12 @@ THE SOFTWARE. ****************************************************************************/ #include "CCDisplayFactory.h" -#include "armature/CCBone.h" -#include "armature/CCArmature.h" -#include "armature/display/CCSkin.h" -#include "armature/utils/CCSpriteFrameCacheHelper.h" -#include "armature/utils/CCArmatureDataManager.h" -#include "armature/utils/CCTransformHelp.h" +#include "cocostudio/armature/CCBone.h" +#include "cocostudio/armature/CCArmature.h" +#include "cocostudio/armature/display/CCSkin.h" +#include "cocostudio/armature/utils/CCSpriteFrameCacheHelper.h" +#include "cocostudio/armature/utils/CCArmatureDataManager.h" +#include "cocostudio/armature/utils/CCTransformHelp.h" using namespace cocos2d; diff --git a/cocos/editor-support/cocostudio/armature/display/CCDisplayFactory.h b/cocos/editor-support/cocostudio/armature/display/CCDisplayFactory.h index 80aa33680d..f8f6009ffb 100644 --- a/cocos/editor-support/cocostudio/armature/display/CCDisplayFactory.h +++ b/cocos/editor-support/cocostudio/armature/display/CCDisplayFactory.h @@ -25,8 +25,8 @@ THE SOFTWARE. #ifndef __CCDISPLAYFACTORY_H__ #define __CCDISPLAYFACTORY_H__ -#include "armature/utils/CCArmatureDefine.h" -#include "armature/datas/CCDatas.h" +#include "cocostudio/armature/utils/CCArmatureDefine.h" +#include "cocostudio/armature/datas/CCDatas.h" namespace cocostudio { diff --git a/cocos/editor-support/cocostudio/armature/display/CCDisplayManager.cpp b/cocos/editor-support/cocostudio/armature/display/CCDisplayManager.cpp index da87bea351..29ae581cbb 100644 --- a/cocos/editor-support/cocostudio/armature/display/CCDisplayManager.cpp +++ b/cocos/editor-support/cocostudio/armature/display/CCDisplayManager.cpp @@ -23,10 +23,10 @@ THE SOFTWARE. ****************************************************************************/ #include "CCDisplayManager.h" -#include "armature/CCBone.h" -#include "armature/CCArmature.h" -#include "armature/utils/CCUtilMath.h" -#include "armature/display/CCSkin.h" +#include "cocostudio/armature/CCBone.h" +#include "cocostudio/armature/CCArmature.h" +#include "cocostudio/armature/utils/CCUtilMath.h" +#include "cocostudio/armature/display/CCSkin.h" using namespace cocos2d; diff --git a/cocos/editor-support/cocostudio/armature/display/CCDisplayManager.h b/cocos/editor-support/cocostudio/armature/display/CCDisplayManager.h index 2e9eb217fc..fd51ca759b 100644 --- a/cocos/editor-support/cocostudio/armature/display/CCDisplayManager.h +++ b/cocos/editor-support/cocostudio/armature/display/CCDisplayManager.h @@ -25,9 +25,9 @@ THE SOFTWARE. #ifndef __CCDISPLAYMANAGER_H__ #define __CCDISPLAYMANAGER_H__ -#include "armature/utils/CCArmatureDefine.h" -#include "armature/display/CCDecorativeDisplay.h" -#include "armature/datas/CCDatas.h" +#include "cocostudio/armature/utils/CCArmatureDefine.h" +#include "cocostudio/armature/display/CCDecorativeDisplay.h" +#include "cocostudio/armature/datas/CCDatas.h" namespace cocostudio { diff --git a/cocos/editor-support/cocostudio/armature/display/CCSkin.cpp b/cocos/editor-support/cocostudio/armature/display/CCSkin.cpp index cd91c18ef4..ecc83c7ff6 100644 --- a/cocos/editor-support/cocostudio/armature/display/CCSkin.cpp +++ b/cocos/editor-support/cocostudio/armature/display/CCSkin.cpp @@ -23,9 +23,9 @@ THE SOFTWARE. ****************************************************************************/ #include "CCSkin.h" -#include "armature/utils/CCTransformHelp.h" -#include "armature/utils/CCSpriteFrameCacheHelper.h" -#include "armature/CCArmature.h" +#include "cocostudio/armature/utils/CCTransformHelp.h" +#include "cocostudio/armature/utils/CCSpriteFrameCacheHelper.h" +#include "cocostudio/armature/CCArmature.h" using namespace cocos2d; diff --git a/cocos/editor-support/cocostudio/armature/display/CCSkin.h b/cocos/editor-support/cocostudio/armature/display/CCSkin.h index 4c20063bed..1915ff550b 100644 --- a/cocos/editor-support/cocostudio/armature/display/CCSkin.h +++ b/cocos/editor-support/cocostudio/armature/display/CCSkin.h @@ -25,8 +25,8 @@ THE SOFTWARE. #ifndef __CCSKIN_H__ #define __CCSKIN_H__ -#include "armature/utils/CCArmatureDefine.h" -#include "armature/CCBone.h" +#include "cocostudio/armature/utils/CCArmatureDefine.h" +#include "cocostudio/armature/CCBone.h" namespace cocostudio { diff --git a/cocos/editor-support/cocostudio/armature/physics/CCColliderDetector.cpp b/cocos/editor-support/cocostudio/armature/physics/CCColliderDetector.cpp index 8d4dbf60cd..f7e0c1c500 100644 --- a/cocos/editor-support/cocostudio/armature/physics/CCColliderDetector.cpp +++ b/cocos/editor-support/cocostudio/armature/physics/CCColliderDetector.cpp @@ -23,8 +23,8 @@ THE SOFTWARE. ****************************************************************************/ #include "CCColliderDetector.h" -#include "armature/CCBone.h" -#include "armature/utils/CCTransformHelp.h" +#include "cocostudio/armature/CCBone.h" +#include "cocostudio/armature/utils/CCTransformHelp.h" #if ENABLE_PHYSICS_BOX2D_DETECT #include "Box2D/Box2D.h" diff --git a/cocos/editor-support/cocostudio/armature/physics/CCColliderDetector.h b/cocos/editor-support/cocostudio/armature/physics/CCColliderDetector.h index 725036fddf..5febb92aef 100644 --- a/cocos/editor-support/cocostudio/armature/physics/CCColliderDetector.h +++ b/cocos/editor-support/cocostudio/armature/physics/CCColliderDetector.h @@ -25,8 +25,8 @@ THE SOFTWARE. #ifndef __CCCOLLIDERDETECTOR_H__ #define __CCCOLLIDERDETECTOR_H__ -#include "armature/utils/CCArmatureDefine.h" -#include "armature/datas/CCDatas.h" +#include "cocostudio/armature/utils/CCArmatureDefine.h" +#include "cocostudio/armature/datas/CCDatas.h" #ifndef PT_RATIO #define PT_RATIO 32 diff --git a/cocos/editor-support/cocostudio/armature/utils/CCArmatureDataManager.h b/cocos/editor-support/cocostudio/armature/utils/CCArmatureDataManager.h index b3122d34f2..016156bec0 100644 --- a/cocos/editor-support/cocostudio/armature/utils/CCArmatureDataManager.h +++ b/cocos/editor-support/cocostudio/armature/utils/CCArmatureDataManager.h @@ -26,7 +26,7 @@ THE SOFTWARE. #define __CCARMATUREDATAMANAGER_H__ #include "CCArmatureDefine.h" -#include "armature/datas/CCDatas.h" +#include "cocostudio/armature/datas/CCDatas.h" namespace cocostudio { diff --git a/cocos/editor-support/cocostudio/armature/utils/CCDataReaderHelper.cpp b/cocos/editor-support/cocostudio/armature/utils/CCDataReaderHelper.cpp index 67d0264825..d1dc3e0655 100644 --- a/cocos/editor-support/cocostudio/armature/utils/CCDataReaderHelper.cpp +++ b/cocos/editor-support/cocostudio/armature/utils/CCDataReaderHelper.cpp @@ -28,7 +28,7 @@ THE SOFTWARE. #include "CCTransformHelp.h" #include "CCUtilMath.h" #include "CCArmatureDefine.h" -#include "armature/datas/CCDatas.h" +#include "cocostudio/armature/datas/CCDatas.h" using namespace cocos2d; diff --git a/cocos/editor-support/cocostudio/armature/utils/CCDataReaderHelper.h b/cocos/editor-support/cocostudio/armature/utils/CCDataReaderHelper.h index d7f8a9f19e..be8b4c9297 100644 --- a/cocos/editor-support/cocostudio/armature/utils/CCDataReaderHelper.h +++ b/cocos/editor-support/cocostudio/armature/utils/CCDataReaderHelper.h @@ -26,9 +26,9 @@ THE SOFTWARE. #define __CCDATAREADERHELPER_H__ #include "CCArmatureDefine.h" -#include "armature/datas/CCDatas.h" -#include "armature/CCArmature.h" -#include "json/CSContentJsonDictionary.h" +#include "cocostudio/armature/datas/CCDatas.h" +#include "cocostudio/armature/CCArmature.h" +#include "cocostudio/json/CSContentJsonDictionary.h" #include #include diff --git a/cocos/editor-support/cocostudio/armature/utils/CCTransformHelp.h b/cocos/editor-support/cocostudio/armature/utils/CCTransformHelp.h index 540b62f1a3..195d5a1468 100644 --- a/cocos/editor-support/cocostudio/armature/utils/CCTransformHelp.h +++ b/cocos/editor-support/cocostudio/armature/utils/CCTransformHelp.h @@ -26,7 +26,7 @@ THE SOFTWARE. #define __CCTRANSFORMHELP_H__ #include "CCArmatureDefine.h" -#include "armature/datas/CCDatas.h" +#include "cocostudio/armature/datas/CCDatas.h" namespace cocostudio { diff --git a/cocos/editor-support/cocostudio/components/CCComAttribute.h b/cocos/editor-support/cocostudio/components/CCComAttribute.h index d36ce4ebb2..959e8ac1b8 100644 --- a/cocos/editor-support/cocostudio/components/CCComAttribute.h +++ b/cocos/editor-support/cocostudio/components/CCComAttribute.h @@ -27,7 +27,7 @@ THE SOFTWARE. #include "cocos2d.h" #include -#include "json/CSContentJsonDictionary.h" +#include "cocostudio/json/CSContentJsonDictionary.h" namespace cocostudio { diff --git a/cocos/editor-support/cocostudio/json/CSContentJsonDictionary.h b/cocos/editor-support/cocostudio/json/CSContentJsonDictionary.h index e3815ae2a6..f8f047b19a 100644 --- a/cocos/editor-support/cocostudio/json/CSContentJsonDictionary.h +++ b/cocos/editor-support/cocostudio/json/CSContentJsonDictionary.h @@ -28,7 +28,7 @@ #define COCOSTUDIO_CSCONTENTJSONDICTIONARY_H -#include "json.h" +#include "json/json.h" #include #include diff --git a/cocos/editor-support/cocostudio/reader/CCSGUIReader.cpp b/cocos/editor-support/cocostudio/reader/CCSGUIReader.cpp index 3ee822c330..ad0eb9ef8d 100755 --- a/cocos/editor-support/cocostudio/reader/CCSGUIReader.cpp +++ b/cocos/editor-support/cocostudio/reader/CCSGUIReader.cpp @@ -23,8 +23,8 @@ ****************************************************************************/ #include "system/CocosGUI.h" -#include "json/DictionaryHelper.h" -#include "action/CCActionManagerEx.h" +#include "cocostudio/json/DictionaryHelper.h" +#include "cocostudio/action/CCActionManagerEx.h" #include #include diff --git a/cocos/editor-support/cocostudio/reader/CCSGUIReader.h b/cocos/editor-support/cocostudio/reader/CCSGUIReader.h index 43c0c9693c..0041997bcd 100755 --- a/cocos/editor-support/cocostudio/reader/CCSGUIReader.h +++ b/cocos/editor-support/cocostudio/reader/CCSGUIReader.h @@ -26,7 +26,7 @@ #define __CCSGUIREADER_H__ #include "base-classes/UIWidget.h" -#include "json/CSContentJsonDictionary.h" +#include "cocostudio/json/CSContentJsonDictionary.h" namespace cocostudio { diff --git a/cocos/editor-support/cocostudio/reader/CCSSceneReader.h b/cocos/editor-support/cocostudio/reader/CCSSceneReader.h index ca95088c59..a042edfbf2 100644 --- a/cocos/editor-support/cocostudio/reader/CCSSceneReader.h +++ b/cocos/editor-support/cocostudio/reader/CCSSceneReader.h @@ -26,7 +26,7 @@ #define __CCSSCENEREADER_H__ #include "cocos2d.h" - #include "json/CSContentJsonDictionary.h" + #include "cocostudio/json/CSContentJsonDictionary.h" namespace cocostudio { diff --git a/cocos/gui/layouts/Layout.cpp b/cocos/gui/layouts/Layout.cpp index 6403262bd9..25e3833bb6 100644 --- a/cocos/gui/layouts/Layout.cpp +++ b/cocos/gui/layouts/Layout.cpp @@ -25,7 +25,7 @@ #include "layout.h" #include "system/UILayer.h" #include "system/UIHelper.h" -#include "GUI/CCControlExtension/CCScale9Sprite.h" +#include "extensions/GUI/CCControlExtension/CCScale9Sprite.h" using namespace cocos2d; using namespace cocos2d::extension; diff --git a/cocos/gui/system/CocosGUI.h b/cocos/gui/system/CocosGUI.h index 97046adde2..2c7c6c915b 100644 --- a/cocos/gui/system/CocosGUI.h +++ b/cocos/gui/system/CocosGUI.h @@ -43,7 +43,7 @@ #include "widgets/UILabelBMFont.h" #include "widgets/scroll-widget/UIPageView.h" #include "UIHelper.h" -#include "reader/CCSGUIReader.h" +#include "cocostudio/reader/CCSGUIReader.h" #include "UILayer.h" namespace gui { diff --git a/cocos/gui/system/UIHelper.cpp b/cocos/gui/system/UIHelper.cpp index c023bf23bf..fd6326b851 100644 --- a/cocos/gui/system/UIHelper.cpp +++ b/cocos/gui/system/UIHelper.cpp @@ -23,9 +23,9 @@ ****************************************************************************/ #include "UIHelper.h" -#include "json/DictionaryHelper.h" +#include "cocostudio/json/DictionaryHelper.h" #include "cocos2d.h" -#include "reader/CCSGUIReader.h" +#include "cocostudio/reader/CCSGUIReader.h" using namespace cocos2d; using namespace cocostudio; diff --git a/cocos/gui/system/UIHelper.h b/cocos/gui/system/UIHelper.h index 15487fbf60..e13f8d74f3 100644 --- a/cocos/gui/system/UIHelper.h +++ b/cocos/gui/system/UIHelper.h @@ -26,7 +26,7 @@ #define __UIHELPER_H__ #include "UIInputManager.h" -#include "json/CSContentJsonDictionary.h" +#include "cocostudio/json/CSContentJsonDictionary.h" #define CCUIHELPER gui::UIHelper::instance() diff --git a/cocos/gui/widgets/UIButton.cpp b/cocos/gui/widgets/UIButton.cpp index 7325007d27..47b6a03492 100644 --- a/cocos/gui/widgets/UIButton.cpp +++ b/cocos/gui/widgets/UIButton.cpp @@ -23,7 +23,7 @@ ****************************************************************************/ #include "UIButton.h" -#include "GUI/CCControlExtension/CCScale9Sprite.h" +#include "extensions/GUI/CCControlExtension/CCScale9Sprite.h" using namespace cocos2d; using namespace cocos2d::extension; diff --git a/cocos/gui/widgets/UIImageView.cpp b/cocos/gui/widgets/UIImageView.cpp index 89491f8141..88625107fa 100644 --- a/cocos/gui/widgets/UIImageView.cpp +++ b/cocos/gui/widgets/UIImageView.cpp @@ -23,7 +23,7 @@ ****************************************************************************/ #include "UIImageView.h" -#include "GUI/CCControlExtension/CCScale9Sprite.h" +#include "extensions/GUI/CCControlExtension/CCScale9Sprite.h" using namespace cocos2d; using namespace cocos2d::extension; diff --git a/cocos/gui/widgets/UILoadingBar.cpp b/cocos/gui/widgets/UILoadingBar.cpp index 8037d1df33..c3f3167d60 100644 --- a/cocos/gui/widgets/UILoadingBar.cpp +++ b/cocos/gui/widgets/UILoadingBar.cpp @@ -23,7 +23,7 @@ ****************************************************************************/ #include "UILoadingBar.h" -#include "GUI/CCControlExtension/CCScale9Sprite.h" +#include "extensions/GUI/CCControlExtension/CCScale9Sprite.h" using namespace cocos2d; using namespace cocos2d::extension; diff --git a/cocos/gui/widgets/UISlider.cpp b/cocos/gui/widgets/UISlider.cpp index dcadbc2132..8409c0eb3c 100644 --- a/cocos/gui/widgets/UISlider.cpp +++ b/cocos/gui/widgets/UISlider.cpp @@ -23,7 +23,7 @@ ****************************************************************************/ #include "UISlider.h" -#include "GUI/CCControlExtension/CCScale9Sprite.h" +#include "extensions/GUI/CCControlExtension/CCScale9Sprite.h" using namespace cocos2d; using namespace cocos2d::extension; diff --git a/samples/Cpp/TestCpp/Android.mk b/samples/Cpp/TestCpp/Android.mk index 9ed6038242..81e523e55f 100644 --- a/samples/Cpp/TestCpp/Android.mk +++ b/samples/Cpp/TestCpp/Android.mk @@ -7,137 +7,137 @@ LOCAL_MODULE := cocos_testcpp_common LOCAL_MODULE_FILENAME := libtestcppcommon LOCAL_SRC_FILES := \ -$(LOCAL_PATH)/Classes/AppDelegate.cpp \ -$(LOCAL_PATH)/Classes/BaseTest.cpp \ -$(LOCAL_PATH)/Classes/controller.cpp \ -$(LOCAL_PATH)/Classes/testBasic.cpp \ -$(LOCAL_PATH)/Classes/VisibleRect.cpp \ -$(LOCAL_PATH)/Classes/AccelerometerTest/AccelerometerTest.cpp \ -$(LOCAL_PATH)/Classes/ActionManagerTest/ActionManagerTest.cpp \ -$(LOCAL_PATH)/Classes/ActionsEaseTest/ActionsEaseTest.cpp \ -$(LOCAL_PATH)/Classes/ActionsProgressTest/ActionsProgressTest.cpp \ -$(LOCAL_PATH)/Classes/ActionsTest/ActionsTest.cpp \ -$(LOCAL_PATH)/Classes/Box2DTest/Box2dTest.cpp \ -$(LOCAL_PATH)/Classes/Box2DTestBed/Box2dView.cpp \ -$(LOCAL_PATH)/Classes/Box2DTestBed/GLES-Render.cpp \ -$(LOCAL_PATH)/Classes/Box2DTestBed/Test.cpp \ -$(LOCAL_PATH)/Classes/Box2DTestBed/TestEntries.cpp \ -$(LOCAL_PATH)/Classes/BugsTest/Bug-1159.cpp \ -$(LOCAL_PATH)/Classes/BugsTest/Bug-1174.cpp \ -$(LOCAL_PATH)/Classes/BugsTest/Bug-350.cpp \ -$(LOCAL_PATH)/Classes/BugsTest/Bug-422.cpp \ -$(LOCAL_PATH)/Classes/BugsTest/Bug-624.cpp \ -$(LOCAL_PATH)/Classes/BugsTest/Bug-886.cpp \ -$(LOCAL_PATH)/Classes/BugsTest/Bug-899.cpp \ -$(LOCAL_PATH)/Classes/BugsTest/Bug-914.cpp \ -$(LOCAL_PATH)/Classes/BugsTest/BugsTest.cpp \ -$(LOCAL_PATH)/Classes/BugsTest/Bug-458/Bug-458.cpp \ -$(LOCAL_PATH)/Classes/BugsTest/Bug-458/QuestionContainerSprite.cpp \ -$(LOCAL_PATH)/Classes/ChipmunkTest/ChipmunkTest.cpp \ -$(LOCAL_PATH)/Classes/ClickAndMoveTest/ClickAndMoveTest.cpp \ -$(LOCAL_PATH)/Classes/ClippingNodeTest/ClippingNodeTest.cpp \ -$(LOCAL_PATH)/Classes/CocosDenshionTest/CocosDenshionTest.cpp \ -$(LOCAL_PATH)/Classes/ConfigurationTest/ConfigurationTest.cpp \ -$(LOCAL_PATH)/Classes/CurlTest/CurlTest.cpp \ -$(LOCAL_PATH)/Classes/CurrentLanguageTest/CurrentLanguageTest.cpp \ -$(LOCAL_PATH)/Classes/DataVisitorTest/DataVisitorTest.cpp \ -$(LOCAL_PATH)/Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp \ -$(LOCAL_PATH)/Classes/EffectsAdvancedTest/EffectsAdvancedTest.cpp \ -$(LOCAL_PATH)/Classes/EffectsTest/EffectsTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/ExtensionsTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocosBuilderTest/CocosBuilderTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioComponentsTest/ComponentsTestScene.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioComponentsTest/EnemyController.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioComponentsTest/GameOverScene.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioComponentsTest/PlayerController.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioComponentsTest/ProjectileController.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioComponentsTest/SceneController.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/CocosGUIScene.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UIScene.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UISceneManager.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UIDragPanelTest/UIDragPanelTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UILabelAtlasTest/UILabelAtlasTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UILabelBMFontTest/UILabelBMFontTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UILabelTest/UILabelTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UINodeContainerTest/UINodeContainerTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UIPanelTest/UIPanelTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UISliderTest/UISliderTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UITextAreaTest/UITextAreaTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UITextButtonTest/UITextButtonTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/ControlExtensionTest/CCControlScene.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/ControlExtensionTest/CCControlSceneManager.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/ControlExtensionTest/CCControlButtonTest/CCControlButtonTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/ControlExtensionTest/CCControlColourPicker/CCControlColourPickerTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/ControlExtensionTest/CCControlPotentiometerTest/CCControlPotentiometerTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/ControlExtensionTest/CCControlSliderTest/CCControlSliderTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/ControlExtensionTest/CCControlStepperTest/CCControlStepperTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/ControlExtensionTest/CCControlSwitchTest/CCControlSwitchTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/EditBoxTest/EditBoxTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/NetworkTest/HttpClientTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/NetworkTest/SocketIOTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/NetworkTest/WebSocketTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/Scale9SpriteTest/Scale9SpriteTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/TableViewTest/CustomTableViewCell.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/TableViewTest/TableViewTestScene.cpp \ -$(LOCAL_PATH)/Classes/FileUtilsTest/FileUtilsTest.cpp \ -$(LOCAL_PATH)/Classes/FontTest/FontTest.cpp \ -$(LOCAL_PATH)/Classes/IntervalTest/IntervalTest.cpp \ -$(LOCAL_PATH)/Classes/KeyboardTest/KeyboardTest.cpp \ -$(LOCAL_PATH)/Classes/KeypadTest/KeypadTest.cpp \ -$(LOCAL_PATH)/Classes/LabelTest/LabelTest.cpp \ -$(LOCAL_PATH)/Classes/LabelTest/LabelTestNew.cpp \ -$(LOCAL_PATH)/Classes/LayerTest/LayerTest.cpp \ -$(LOCAL_PATH)/Classes/MenuTest/MenuTest.cpp \ -$(LOCAL_PATH)/Classes/MotionStreakTest/MotionStreakTest.cpp \ -$(LOCAL_PATH)/Classes/MutiTouchTest/MutiTouchTest.cpp \ -$(LOCAL_PATH)/Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp \ -$(LOCAL_PATH)/Classes/NodeTest/NodeTest.cpp \ -$(LOCAL_PATH)/Classes/ParallaxTest/ParallaxTest.cpp \ -$(LOCAL_PATH)/Classes/ParticleTest/ParticleTest.cpp \ -$(LOCAL_PATH)/Classes/PerformanceTest/PerformanceAllocTest.cpp \ -$(LOCAL_PATH)/Classes/PerformanceTest/PerformanceNodeChildrenTest.cpp \ -$(LOCAL_PATH)/Classes/PerformanceTest/PerformanceParticleTest.cpp \ -$(LOCAL_PATH)/Classes/PerformanceTest/PerformanceSpriteTest.cpp \ -$(LOCAL_PATH)/Classes/PerformanceTest/PerformanceTest.cpp \ -$(LOCAL_PATH)/Classes/PerformanceTest/PerformanceTextureTest.cpp \ -$(LOCAL_PATH)/Classes/PerformanceTest/PerformanceTouchesTest.cpp \ -$(LOCAL_PATH)/Classes/PhysicsTest/PhysicsTest.cpp \ -$(LOCAL_PATH)/Classes/RenderTextureTest/RenderTextureTest.cpp \ -$(LOCAL_PATH)/Classes/RotateWorldTest/RotateWorldTest.cpp \ -$(LOCAL_PATH)/Classes/SceneTest/SceneTest.cpp \ -$(LOCAL_PATH)/Classes/SchedulerTest/SchedulerTest.cpp \ -$(LOCAL_PATH)/Classes/ShaderTest/ShaderTest.cpp \ -$(LOCAL_PATH)/Classes/ShaderTest/ShaderTest2.cpp \ -$(LOCAL_PATH)/Classes/SpineTest/SpineTest.cpp \ -$(LOCAL_PATH)/Classes/SpriteTest/SpriteTest.cpp \ -$(LOCAL_PATH)/Classes/TextInputTest/TextInputTest.cpp \ -$(LOCAL_PATH)/Classes/Texture2dTest/Texture2dTest.cpp \ -$(LOCAL_PATH)/Classes/TextureCacheTest/TextureCacheTest.cpp \ -$(LOCAL_PATH)/Classes/TexturePackerEncryptionTest/TextureAtlasEncryptionTest.cpp \ -$(LOCAL_PATH)/Classes/TileMapTest/TileMapTest.cpp \ -$(LOCAL_PATH)/Classes/TouchesTest/Ball.cpp \ -$(LOCAL_PATH)/Classes/TouchesTest/Paddle.cpp \ -$(LOCAL_PATH)/Classes/TouchesTest/TouchesTest.cpp \ -$(LOCAL_PATH)/Classes/TransitionsTest/TransitionsTest.cpp \ -$(LOCAL_PATH)/Classes/UserDefaultTest/UserDefaultTest.cpp \ -$(LOCAL_PATH)/Classes/ZwoptexTest/ZwoptexTest.cpp +./Classes/AppDelegate.cpp \ +./Classes/BaseTest.cpp \ +./Classes/controller.cpp \ +./Classes/testBasic.cpp \ +./Classes/VisibleRect.cpp \ +./Classes/AccelerometerTest/AccelerometerTest.cpp \ +./Classes/ActionManagerTest/ActionManagerTest.cpp \ +./Classes/ActionsEaseTest/ActionsEaseTest.cpp \ +./Classes/ActionsProgressTest/ActionsProgressTest.cpp \ +./Classes/ActionsTest/ActionsTest.cpp \ +./Classes/Box2DTest/Box2dTest.cpp \ +./Classes/Box2DTestBed/Box2dView.cpp \ +./Classes/Box2DTestBed/GLES-Render.cpp \ +./Classes/Box2DTestBed/Test.cpp \ +./Classes/Box2DTestBed/TestEntries.cpp \ +./Classes/BugsTest/Bug-1159.cpp \ +./Classes/BugsTest/Bug-1174.cpp \ +./Classes/BugsTest/Bug-350.cpp \ +./Classes/BugsTest/Bug-422.cpp \ +./Classes/BugsTest/Bug-624.cpp \ +./Classes/BugsTest/Bug-886.cpp \ +./Classes/BugsTest/Bug-899.cpp \ +./Classes/BugsTest/Bug-914.cpp \ +./Classes/BugsTest/BugsTest.cpp \ +./Classes/BugsTest/Bug-458/Bug-458.cpp \ +./Classes/BugsTest/Bug-458/QuestionContainerSprite.cpp \ +./Classes/ChipmunkTest/ChipmunkTest.cpp \ +./Classes/ClickAndMoveTest/ClickAndMoveTest.cpp \ +./Classes/ClippingNodeTest/ClippingNodeTest.cpp \ +./Classes/CocosDenshionTest/CocosDenshionTest.cpp \ +./Classes/ConfigurationTest/ConfigurationTest.cpp \ +./Classes/CurlTest/CurlTest.cpp \ +./Classes/CurrentLanguageTest/CurrentLanguageTest.cpp \ +./Classes/DataVisitorTest/DataVisitorTest.cpp \ +./Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp \ +./Classes/EffectsAdvancedTest/EffectsAdvancedTest.cpp \ +./Classes/EffectsTest/EffectsTest.cpp \ +./Classes/ExtensionsTest/ExtensionsTest.cpp \ +./Classes/ExtensionsTest/CocosBuilderTest/CocosBuilderTest.cpp \ +./Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.cpp \ +./Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.cpp \ +./Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.cpp \ +./Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.cpp \ +./Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.cpp \ +./Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.cpp \ +./Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp \ +./Classes/ExtensionsTest/CocoStudioComponentsTest/ComponentsTestScene.cpp \ +./Classes/ExtensionsTest/CocoStudioComponentsTest/EnemyController.cpp \ +./Classes/ExtensionsTest/CocoStudioComponentsTest/GameOverScene.cpp \ +./Classes/ExtensionsTest/CocoStudioComponentsTest/PlayerController.cpp \ +./Classes/ExtensionsTest/CocoStudioComponentsTest/ProjectileController.cpp \ +./Classes/ExtensionsTest/CocoStudioComponentsTest/SceneController.cpp \ +./Classes/ExtensionsTest/CocoStudioGUITest/CocosGUIScene.cpp \ +./Classes/ExtensionsTest/CocoStudioGUITest/UIScene.cpp \ +./Classes/ExtensionsTest/CocoStudioGUITest/UISceneManager.cpp \ +./Classes/ExtensionsTest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp \ +./Classes/ExtensionsTest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.cpp \ +./Classes/ExtensionsTest/CocoStudioGUITest/UIDragPanelTest/UIDragPanelTest.cpp \ +./Classes/ExtensionsTest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.cpp \ +./Classes/ExtensionsTest/CocoStudioGUITest/UILabelAtlasTest/UILabelAtlasTest.cpp \ +./Classes/ExtensionsTest/CocoStudioGUITest/UILabelBMFontTest/UILabelBMFontTest.cpp \ +./Classes/ExtensionsTest/CocoStudioGUITest/UILabelTest/UILabelTest.cpp \ +./Classes/ExtensionsTest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp \ +./Classes/ExtensionsTest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.cpp \ +./Classes/ExtensionsTest/CocoStudioGUITest/UINodeContainerTest/UINodeContainerTest.cpp \ +./Classes/ExtensionsTest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp \ +./Classes/ExtensionsTest/CocoStudioGUITest/UIPanelTest/UIPanelTest.cpp \ +./Classes/ExtensionsTest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest.cpp \ +./Classes/ExtensionsTest/CocoStudioGUITest/UISliderTest/UISliderTest.cpp \ +./Classes/ExtensionsTest/CocoStudioGUITest/UITextAreaTest/UITextAreaTest.cpp \ +./Classes/ExtensionsTest/CocoStudioGUITest/UITextButtonTest/UITextButtonTest.cpp \ +./Classes/ExtensionsTest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp \ +./Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp \ +./Classes/ExtensionsTest/ControlExtensionTest/CCControlScene.cpp \ +./Classes/ExtensionsTest/ControlExtensionTest/CCControlSceneManager.cpp \ +./Classes/ExtensionsTest/ControlExtensionTest/CCControlButtonTest/CCControlButtonTest.cpp \ +./Classes/ExtensionsTest/ControlExtensionTest/CCControlColourPicker/CCControlColourPickerTest.cpp \ +./Classes/ExtensionsTest/ControlExtensionTest/CCControlPotentiometerTest/CCControlPotentiometerTest.cpp \ +./Classes/ExtensionsTest/ControlExtensionTest/CCControlSliderTest/CCControlSliderTest.cpp \ +./Classes/ExtensionsTest/ControlExtensionTest/CCControlStepperTest/CCControlStepperTest.cpp \ +./Classes/ExtensionsTest/ControlExtensionTest/CCControlSwitchTest/CCControlSwitchTest.cpp \ +./Classes/ExtensionsTest/EditBoxTest/EditBoxTest.cpp \ +./Classes/ExtensionsTest/NetworkTest/HttpClientTest.cpp \ +./Classes/ExtensionsTest/NetworkTest/SocketIOTest.cpp \ +./Classes/ExtensionsTest/NetworkTest/WebSocketTest.cpp \ +./Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.cpp \ +./Classes/ExtensionsTest/Scale9SpriteTest/Scale9SpriteTest.cpp \ +./Classes/ExtensionsTest/TableViewTest/CustomTableViewCell.cpp \ +./Classes/ExtensionsTest/TableViewTest/TableViewTestScene.cpp \ +./Classes/FileUtilsTest/FileUtilsTest.cpp \ +./Classes/FontTest/FontTest.cpp \ +./Classes/IntervalTest/IntervalTest.cpp \ +./Classes/KeyboardTest/KeyboardTest.cpp \ +./Classes/KeypadTest/KeypadTest.cpp \ +./Classes/LabelTest/LabelTest.cpp \ +./Classes/LabelTest/LabelTestNew.cpp \ +./Classes/LayerTest/LayerTest.cpp \ +./Classes/MenuTest/MenuTest.cpp \ +./Classes/MotionStreakTest/MotionStreakTest.cpp \ +./Classes/MutiTouchTest/MutiTouchTest.cpp \ +./Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp \ +./Classes/NodeTest/NodeTest.cpp \ +./Classes/ParallaxTest/ParallaxTest.cpp \ +./Classes/ParticleTest/ParticleTest.cpp \ +./Classes/PerformanceTest/PerformanceAllocTest.cpp \ +./Classes/PerformanceTest/PerformanceNodeChildrenTest.cpp \ +./Classes/PerformanceTest/PerformanceParticleTest.cpp \ +./Classes/PerformanceTest/PerformanceSpriteTest.cpp \ +./Classes/PerformanceTest/PerformanceTest.cpp \ +./Classes/PerformanceTest/PerformanceTextureTest.cpp \ +./Classes/PerformanceTest/PerformanceTouchesTest.cpp \ +./Classes/PhysicsTest/PhysicsTest.cpp \ +./Classes/RenderTextureTest/RenderTextureTest.cpp \ +./Classes/RotateWorldTest/RotateWorldTest.cpp \ +./Classes/SceneTest/SceneTest.cpp \ +./Classes/SchedulerTest/SchedulerTest.cpp \ +./Classes/ShaderTest/ShaderTest.cpp \ +./Classes/ShaderTest/ShaderTest2.cpp \ +./Classes/SpineTest/SpineTest.cpp \ +./Classes/SpriteTest/SpriteTest.cpp \ +./Classes/TextInputTest/TextInputTest.cpp \ +./Classes/Texture2dTest/Texture2dTest.cpp \ +./Classes/TextureCacheTest/TextureCacheTest.cpp \ +./Classes/TexturePackerEncryptionTest/TextureAtlasEncryptionTest.cpp \ +./Classes/TileMapTest/TileMapTest.cpp \ +./Classes/TouchesTest/Ball.cpp \ +./Classes/TouchesTest/Paddle.cpp \ +./Classes/TouchesTest/TouchesTest.cpp \ +./Classes/TransitionsTest/TransitionsTest.cpp \ +./Classes/UserDefaultTest/UserDefaultTest.cpp \ +./Classes/ZwoptexTest/ZwoptexTest.cpp LOCAL_C_INCLUDES := $(LOCAL_PATH)/Classes diff --git a/samples/Cpp/TestCpp/Classes/AppDelegate.cpp b/samples/Cpp/TestCpp/Classes/AppDelegate.cpp index e2c264c37f..515a63c9be 100644 --- a/samples/Cpp/TestCpp/Classes/AppDelegate.cpp +++ b/samples/Cpp/TestCpp/Classes/AppDelegate.cpp @@ -3,7 +3,7 @@ #include "cocos2d.h" #include "controller.h" #include "SimpleAudioEngine.h" -#include "cocostudio/armature/utils/CCArmatureDataManager.h" +#include "cocostudio/CocoStudio.h" #include "cocos-ext.h" USING_NS_CC; @@ -51,6 +51,7 @@ bool AppDelegate::applicationDidFinishLaunching() { searchPaths.push_back("scenetest"); } + pFileUtils->setSearchPaths(searchPaths); EGLView::getInstance()->setDesignResolutionSize(designSize.width, designSize.height, ResolutionPolicy::NO_BORDER); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp index 63a987f170..66eb20472b 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp @@ -1,6 +1,6 @@ #include "ArmatureScene.h" #include "../../testResource.h" -#include "armature/display/CCSkin.h" +#include "cocostudio/CocoStudio.h" using namespace cocos2d; diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.h index 1db21babb0..f6001395c3 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.h @@ -5,7 +5,7 @@ #include "cocos-ext.h" #include "../../VisibleRect.h" #include "../../testBasic.h" -#include "armature/CCArmature.h" +#include "cocostudio/CocoStudio.h" #if ENABLE_PHYSICS_BOX2D_DETECT #include "../../Box2DTestBed/GLES-Render.h" diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/EnemyController.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/EnemyController.h index 891c84cf14..31e3fc5f2d 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/EnemyController.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/EnemyController.h @@ -3,7 +3,7 @@ #include "cocos2d.h" #include "cocos-ext.h" -#include "CocoStudio.h" +#include "cocostudio/CocoStudio.h" class EnemyController : public cocostudio::ComController diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/PlayerController.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/PlayerController.h index b8baed4f54..9ce5b3b424 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/PlayerController.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/PlayerController.h @@ -3,7 +3,7 @@ #include "cocos2d.h" #include "cocos-ext.h" -#include "CocoStudio.h" +#include "cocostudio/CocoStudio.h" class PlayerController : public cocostudio::ComController diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/ProjectileController.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/ProjectileController.h index 68c4e1aaf7..de3c855c86 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/ProjectileController.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/ProjectileController.h @@ -3,7 +3,7 @@ #include "cocos2d.h" #include "cocos-ext.h" -#include "CocoStudio.h" +#include "cocostudio/CocoStudio.h" class ProjectileController : public cocostudio::ComController { diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/SceneController.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/SceneController.h index 203c74e180..f35b663126 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/SceneController.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/SceneController.h @@ -3,7 +3,7 @@ #include "cocos2d.h" #include "cocos-ext.h" -#include "CocoStudio.h" +#include "cocostudio/CocoStudio.h" class SceneController : public cocostudio::ComController { diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/CocosGUIScene.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/CocosGUIScene.cpp index 8bcdd1e0f4..1ba28914df 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/CocosGUIScene.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/CocosGUIScene.cpp @@ -1,8 +1,7 @@ #include "CocosGUIScene.h" #include "UISceneManager.h" -//#include "CocosGUIExamplesRegisterScene.h" #include "../ExtensionsTest.h" -#include "CocoStudio.h" +#include "cocostudio/CocoStudio.h" const char* gui_scene_names[2] = { diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp index a59f162999..dbc04df6ef 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp @@ -2,7 +2,7 @@ #include "cocos-ext.h" #include "../ExtensionsTest.h" #include "SceneEditorTest.h" -#include "CocoStudio.h" +#include "cocostudio/CocoStudio.h" #include "system/CocosGUI.h" using namespace cocos2d; diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.h index b158784607..2fbbd0f427 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.h @@ -3,7 +3,7 @@ #include "cocos2d.h" #include "cocos-ext.h" -#include "CocosBuilder.h" +#include "cocosbuilder/CocosBuilder.h" class AnimationsTestLayer : public cocos2d::Layer diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.h index 9468229dd8..706ec6b2f7 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.h @@ -3,7 +3,7 @@ #include "cocos2d.h" #include "cocos-ext.h" -#include "CocosBuilder.h" +#include "cocosbuilder/CocosBuilder.h" class ButtonTestLayer : public cocos2d::Layer diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.h index b20072bc30..d6ab2071c4 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.h @@ -3,7 +3,7 @@ #include "cocos2d.h" #include "cocos-ext.h" -#include "CocosBuilder.h" +#include "cocosbuilder/CocosBuilder.h" /* * Note: for some pretty hard fucked up reason, the order of inheritance is important! diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.h index 4dfe4468e7..11c12da610 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.h @@ -3,7 +3,7 @@ #include "cocos2d.h" #include "cocos-ext.h" -#include "CocosBuilder.h" +#include "cocosbuilder/CocosBuilder.h" class MenuTestLayer : public cocos2d::Layer diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.h index 316f93d62b..f36dea647e 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.h @@ -3,7 +3,7 @@ #include "cocos2d.h" #include "cocos-ext.h" -#include "CocosBuilder.h" +#include "cocosbuilder/CocosBuilder.h" class TestHeaderLayer : public cocos2d::Layer diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.h index 4dd14b8b73..87cf80d7b6 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.h @@ -3,7 +3,7 @@ #include "cocos2d.h" #include "cocos-ext.h" -#include "CocosBuilder.h" +#include "cocosbuilder/CocosBuilder.h" class TimelineCallbackTestLayer : public cocos2d::Layer diff --git a/samples/Cpp/TestCpp/Classes/testBasic.cpp b/samples/Cpp/TestCpp/Classes/testBasic.cpp index 5892c3e6e2..b35170021f 100644 --- a/samples/Cpp/TestCpp/Classes/testBasic.cpp +++ b/samples/Cpp/TestCpp/Classes/testBasic.cpp @@ -1,7 +1,7 @@ #include "testBasic.h" #include "controller.h" #include "cocos-ext.h" -#include "cocostudio/armature/utils/CCArmatureDataManager.h" +#include "cocostudio/CocoStudio.h" TestScene::TestScene(bool bPortrait) { From 65f33461bc49b57e4402e97d75fa8d398f268554 Mon Sep 17 00:00:00 2001 From: James Chen Date: Wed, 16 Oct 2013 11:19:42 +0800 Subject: [PATCH 38/64] issue #2905: [iOS, Mac] Updating project configuration, TestCpp works now. --- build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id | 2 +- build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id b/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id index 58407b8dbe..35cb0ad779 100644 --- a/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -fe809a5d9a1b0e24462a215517e08f6e525cd6b7 \ No newline at end of file +c716fb5eae4ef941532f1184de8b414c4cd3261b \ No newline at end of file diff --git a/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id b/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id index 0bbb816654..983a860ea6 100644 --- a/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -71d9dbdbc4e4e33dbb8fb7ad109611f197a0cec7 \ No newline at end of file +d57f7fce48d49b56eb650690a52eaf3abbff7ec4 \ No newline at end of file From 8e80f1d46ab14be39a0c5fb4795c566cd962b19a Mon Sep 17 00:00:00 2001 From: James Chen Date: Wed, 16 Oct 2013 11:22:58 +0800 Subject: [PATCH 39/64] issue #2905: Reverting TestCpp/Android.mk --- samples/Cpp/TestCpp/Android.mk | 262 ++++++++++++++++----------------- 1 file changed, 131 insertions(+), 131 deletions(-) diff --git a/samples/Cpp/TestCpp/Android.mk b/samples/Cpp/TestCpp/Android.mk index 81e523e55f..9ed6038242 100644 --- a/samples/Cpp/TestCpp/Android.mk +++ b/samples/Cpp/TestCpp/Android.mk @@ -7,137 +7,137 @@ LOCAL_MODULE := cocos_testcpp_common LOCAL_MODULE_FILENAME := libtestcppcommon LOCAL_SRC_FILES := \ -./Classes/AppDelegate.cpp \ -./Classes/BaseTest.cpp \ -./Classes/controller.cpp \ -./Classes/testBasic.cpp \ -./Classes/VisibleRect.cpp \ -./Classes/AccelerometerTest/AccelerometerTest.cpp \ -./Classes/ActionManagerTest/ActionManagerTest.cpp \ -./Classes/ActionsEaseTest/ActionsEaseTest.cpp \ -./Classes/ActionsProgressTest/ActionsProgressTest.cpp \ -./Classes/ActionsTest/ActionsTest.cpp \ -./Classes/Box2DTest/Box2dTest.cpp \ -./Classes/Box2DTestBed/Box2dView.cpp \ -./Classes/Box2DTestBed/GLES-Render.cpp \ -./Classes/Box2DTestBed/Test.cpp \ -./Classes/Box2DTestBed/TestEntries.cpp \ -./Classes/BugsTest/Bug-1159.cpp \ -./Classes/BugsTest/Bug-1174.cpp \ -./Classes/BugsTest/Bug-350.cpp \ -./Classes/BugsTest/Bug-422.cpp \ -./Classes/BugsTest/Bug-624.cpp \ -./Classes/BugsTest/Bug-886.cpp \ -./Classes/BugsTest/Bug-899.cpp \ -./Classes/BugsTest/Bug-914.cpp \ -./Classes/BugsTest/BugsTest.cpp \ -./Classes/BugsTest/Bug-458/Bug-458.cpp \ -./Classes/BugsTest/Bug-458/QuestionContainerSprite.cpp \ -./Classes/ChipmunkTest/ChipmunkTest.cpp \ -./Classes/ClickAndMoveTest/ClickAndMoveTest.cpp \ -./Classes/ClippingNodeTest/ClippingNodeTest.cpp \ -./Classes/CocosDenshionTest/CocosDenshionTest.cpp \ -./Classes/ConfigurationTest/ConfigurationTest.cpp \ -./Classes/CurlTest/CurlTest.cpp \ -./Classes/CurrentLanguageTest/CurrentLanguageTest.cpp \ -./Classes/DataVisitorTest/DataVisitorTest.cpp \ -./Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp \ -./Classes/EffectsAdvancedTest/EffectsAdvancedTest.cpp \ -./Classes/EffectsTest/EffectsTest.cpp \ -./Classes/ExtensionsTest/ExtensionsTest.cpp \ -./Classes/ExtensionsTest/CocosBuilderTest/CocosBuilderTest.cpp \ -./Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.cpp \ -./Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.cpp \ -./Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.cpp \ -./Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.cpp \ -./Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.cpp \ -./Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.cpp \ -./Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp \ -./Classes/ExtensionsTest/CocoStudioComponentsTest/ComponentsTestScene.cpp \ -./Classes/ExtensionsTest/CocoStudioComponentsTest/EnemyController.cpp \ -./Classes/ExtensionsTest/CocoStudioComponentsTest/GameOverScene.cpp \ -./Classes/ExtensionsTest/CocoStudioComponentsTest/PlayerController.cpp \ -./Classes/ExtensionsTest/CocoStudioComponentsTest/ProjectileController.cpp \ -./Classes/ExtensionsTest/CocoStudioComponentsTest/SceneController.cpp \ -./Classes/ExtensionsTest/CocoStudioGUITest/CocosGUIScene.cpp \ -./Classes/ExtensionsTest/CocoStudioGUITest/UIScene.cpp \ -./Classes/ExtensionsTest/CocoStudioGUITest/UISceneManager.cpp \ -./Classes/ExtensionsTest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp \ -./Classes/ExtensionsTest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.cpp \ -./Classes/ExtensionsTest/CocoStudioGUITest/UIDragPanelTest/UIDragPanelTest.cpp \ -./Classes/ExtensionsTest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.cpp \ -./Classes/ExtensionsTest/CocoStudioGUITest/UILabelAtlasTest/UILabelAtlasTest.cpp \ -./Classes/ExtensionsTest/CocoStudioGUITest/UILabelBMFontTest/UILabelBMFontTest.cpp \ -./Classes/ExtensionsTest/CocoStudioGUITest/UILabelTest/UILabelTest.cpp \ -./Classes/ExtensionsTest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp \ -./Classes/ExtensionsTest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.cpp \ -./Classes/ExtensionsTest/CocoStudioGUITest/UINodeContainerTest/UINodeContainerTest.cpp \ -./Classes/ExtensionsTest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp \ -./Classes/ExtensionsTest/CocoStudioGUITest/UIPanelTest/UIPanelTest.cpp \ -./Classes/ExtensionsTest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest.cpp \ -./Classes/ExtensionsTest/CocoStudioGUITest/UISliderTest/UISliderTest.cpp \ -./Classes/ExtensionsTest/CocoStudioGUITest/UITextAreaTest/UITextAreaTest.cpp \ -./Classes/ExtensionsTest/CocoStudioGUITest/UITextButtonTest/UITextButtonTest.cpp \ -./Classes/ExtensionsTest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp \ -./Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp \ -./Classes/ExtensionsTest/ControlExtensionTest/CCControlScene.cpp \ -./Classes/ExtensionsTest/ControlExtensionTest/CCControlSceneManager.cpp \ -./Classes/ExtensionsTest/ControlExtensionTest/CCControlButtonTest/CCControlButtonTest.cpp \ -./Classes/ExtensionsTest/ControlExtensionTest/CCControlColourPicker/CCControlColourPickerTest.cpp \ -./Classes/ExtensionsTest/ControlExtensionTest/CCControlPotentiometerTest/CCControlPotentiometerTest.cpp \ -./Classes/ExtensionsTest/ControlExtensionTest/CCControlSliderTest/CCControlSliderTest.cpp \ -./Classes/ExtensionsTest/ControlExtensionTest/CCControlStepperTest/CCControlStepperTest.cpp \ -./Classes/ExtensionsTest/ControlExtensionTest/CCControlSwitchTest/CCControlSwitchTest.cpp \ -./Classes/ExtensionsTest/EditBoxTest/EditBoxTest.cpp \ -./Classes/ExtensionsTest/NetworkTest/HttpClientTest.cpp \ -./Classes/ExtensionsTest/NetworkTest/SocketIOTest.cpp \ -./Classes/ExtensionsTest/NetworkTest/WebSocketTest.cpp \ -./Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.cpp \ -./Classes/ExtensionsTest/Scale9SpriteTest/Scale9SpriteTest.cpp \ -./Classes/ExtensionsTest/TableViewTest/CustomTableViewCell.cpp \ -./Classes/ExtensionsTest/TableViewTest/TableViewTestScene.cpp \ -./Classes/FileUtilsTest/FileUtilsTest.cpp \ -./Classes/FontTest/FontTest.cpp \ -./Classes/IntervalTest/IntervalTest.cpp \ -./Classes/KeyboardTest/KeyboardTest.cpp \ -./Classes/KeypadTest/KeypadTest.cpp \ -./Classes/LabelTest/LabelTest.cpp \ -./Classes/LabelTest/LabelTestNew.cpp \ -./Classes/LayerTest/LayerTest.cpp \ -./Classes/MenuTest/MenuTest.cpp \ -./Classes/MotionStreakTest/MotionStreakTest.cpp \ -./Classes/MutiTouchTest/MutiTouchTest.cpp \ -./Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp \ -./Classes/NodeTest/NodeTest.cpp \ -./Classes/ParallaxTest/ParallaxTest.cpp \ -./Classes/ParticleTest/ParticleTest.cpp \ -./Classes/PerformanceTest/PerformanceAllocTest.cpp \ -./Classes/PerformanceTest/PerformanceNodeChildrenTest.cpp \ -./Classes/PerformanceTest/PerformanceParticleTest.cpp \ -./Classes/PerformanceTest/PerformanceSpriteTest.cpp \ -./Classes/PerformanceTest/PerformanceTest.cpp \ -./Classes/PerformanceTest/PerformanceTextureTest.cpp \ -./Classes/PerformanceTest/PerformanceTouchesTest.cpp \ -./Classes/PhysicsTest/PhysicsTest.cpp \ -./Classes/RenderTextureTest/RenderTextureTest.cpp \ -./Classes/RotateWorldTest/RotateWorldTest.cpp \ -./Classes/SceneTest/SceneTest.cpp \ -./Classes/SchedulerTest/SchedulerTest.cpp \ -./Classes/ShaderTest/ShaderTest.cpp \ -./Classes/ShaderTest/ShaderTest2.cpp \ -./Classes/SpineTest/SpineTest.cpp \ -./Classes/SpriteTest/SpriteTest.cpp \ -./Classes/TextInputTest/TextInputTest.cpp \ -./Classes/Texture2dTest/Texture2dTest.cpp \ -./Classes/TextureCacheTest/TextureCacheTest.cpp \ -./Classes/TexturePackerEncryptionTest/TextureAtlasEncryptionTest.cpp \ -./Classes/TileMapTest/TileMapTest.cpp \ -./Classes/TouchesTest/Ball.cpp \ -./Classes/TouchesTest/Paddle.cpp \ -./Classes/TouchesTest/TouchesTest.cpp \ -./Classes/TransitionsTest/TransitionsTest.cpp \ -./Classes/UserDefaultTest/UserDefaultTest.cpp \ -./Classes/ZwoptexTest/ZwoptexTest.cpp +$(LOCAL_PATH)/Classes/AppDelegate.cpp \ +$(LOCAL_PATH)/Classes/BaseTest.cpp \ +$(LOCAL_PATH)/Classes/controller.cpp \ +$(LOCAL_PATH)/Classes/testBasic.cpp \ +$(LOCAL_PATH)/Classes/VisibleRect.cpp \ +$(LOCAL_PATH)/Classes/AccelerometerTest/AccelerometerTest.cpp \ +$(LOCAL_PATH)/Classes/ActionManagerTest/ActionManagerTest.cpp \ +$(LOCAL_PATH)/Classes/ActionsEaseTest/ActionsEaseTest.cpp \ +$(LOCAL_PATH)/Classes/ActionsProgressTest/ActionsProgressTest.cpp \ +$(LOCAL_PATH)/Classes/ActionsTest/ActionsTest.cpp \ +$(LOCAL_PATH)/Classes/Box2DTest/Box2dTest.cpp \ +$(LOCAL_PATH)/Classes/Box2DTestBed/Box2dView.cpp \ +$(LOCAL_PATH)/Classes/Box2DTestBed/GLES-Render.cpp \ +$(LOCAL_PATH)/Classes/Box2DTestBed/Test.cpp \ +$(LOCAL_PATH)/Classes/Box2DTestBed/TestEntries.cpp \ +$(LOCAL_PATH)/Classes/BugsTest/Bug-1159.cpp \ +$(LOCAL_PATH)/Classes/BugsTest/Bug-1174.cpp \ +$(LOCAL_PATH)/Classes/BugsTest/Bug-350.cpp \ +$(LOCAL_PATH)/Classes/BugsTest/Bug-422.cpp \ +$(LOCAL_PATH)/Classes/BugsTest/Bug-624.cpp \ +$(LOCAL_PATH)/Classes/BugsTest/Bug-886.cpp \ +$(LOCAL_PATH)/Classes/BugsTest/Bug-899.cpp \ +$(LOCAL_PATH)/Classes/BugsTest/Bug-914.cpp \ +$(LOCAL_PATH)/Classes/BugsTest/BugsTest.cpp \ +$(LOCAL_PATH)/Classes/BugsTest/Bug-458/Bug-458.cpp \ +$(LOCAL_PATH)/Classes/BugsTest/Bug-458/QuestionContainerSprite.cpp \ +$(LOCAL_PATH)/Classes/ChipmunkTest/ChipmunkTest.cpp \ +$(LOCAL_PATH)/Classes/ClickAndMoveTest/ClickAndMoveTest.cpp \ +$(LOCAL_PATH)/Classes/ClippingNodeTest/ClippingNodeTest.cpp \ +$(LOCAL_PATH)/Classes/CocosDenshionTest/CocosDenshionTest.cpp \ +$(LOCAL_PATH)/Classes/ConfigurationTest/ConfigurationTest.cpp \ +$(LOCAL_PATH)/Classes/CurlTest/CurlTest.cpp \ +$(LOCAL_PATH)/Classes/CurrentLanguageTest/CurrentLanguageTest.cpp \ +$(LOCAL_PATH)/Classes/DataVisitorTest/DataVisitorTest.cpp \ +$(LOCAL_PATH)/Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp \ +$(LOCAL_PATH)/Classes/EffectsAdvancedTest/EffectsAdvancedTest.cpp \ +$(LOCAL_PATH)/Classes/EffectsTest/EffectsTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/ExtensionsTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocosBuilderTest/CocosBuilderTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioComponentsTest/ComponentsTestScene.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioComponentsTest/EnemyController.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioComponentsTest/GameOverScene.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioComponentsTest/PlayerController.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioComponentsTest/ProjectileController.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioComponentsTest/SceneController.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/CocosGUIScene.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UIScene.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UISceneManager.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UIDragPanelTest/UIDragPanelTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UILabelAtlasTest/UILabelAtlasTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UILabelBMFontTest/UILabelBMFontTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UILabelTest/UILabelTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UINodeContainerTest/UINodeContainerTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UIPanelTest/UIPanelTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UISliderTest/UISliderTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UITextAreaTest/UITextAreaTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UITextButtonTest/UITextButtonTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/ControlExtensionTest/CCControlScene.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/ControlExtensionTest/CCControlSceneManager.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/ControlExtensionTest/CCControlButtonTest/CCControlButtonTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/ControlExtensionTest/CCControlColourPicker/CCControlColourPickerTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/ControlExtensionTest/CCControlPotentiometerTest/CCControlPotentiometerTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/ControlExtensionTest/CCControlSliderTest/CCControlSliderTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/ControlExtensionTest/CCControlStepperTest/CCControlStepperTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/ControlExtensionTest/CCControlSwitchTest/CCControlSwitchTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/EditBoxTest/EditBoxTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/NetworkTest/HttpClientTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/NetworkTest/SocketIOTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/NetworkTest/WebSocketTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/Scale9SpriteTest/Scale9SpriteTest.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/TableViewTest/CustomTableViewCell.cpp \ +$(LOCAL_PATH)/Classes/ExtensionsTest/TableViewTest/TableViewTestScene.cpp \ +$(LOCAL_PATH)/Classes/FileUtilsTest/FileUtilsTest.cpp \ +$(LOCAL_PATH)/Classes/FontTest/FontTest.cpp \ +$(LOCAL_PATH)/Classes/IntervalTest/IntervalTest.cpp \ +$(LOCAL_PATH)/Classes/KeyboardTest/KeyboardTest.cpp \ +$(LOCAL_PATH)/Classes/KeypadTest/KeypadTest.cpp \ +$(LOCAL_PATH)/Classes/LabelTest/LabelTest.cpp \ +$(LOCAL_PATH)/Classes/LabelTest/LabelTestNew.cpp \ +$(LOCAL_PATH)/Classes/LayerTest/LayerTest.cpp \ +$(LOCAL_PATH)/Classes/MenuTest/MenuTest.cpp \ +$(LOCAL_PATH)/Classes/MotionStreakTest/MotionStreakTest.cpp \ +$(LOCAL_PATH)/Classes/MutiTouchTest/MutiTouchTest.cpp \ +$(LOCAL_PATH)/Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp \ +$(LOCAL_PATH)/Classes/NodeTest/NodeTest.cpp \ +$(LOCAL_PATH)/Classes/ParallaxTest/ParallaxTest.cpp \ +$(LOCAL_PATH)/Classes/ParticleTest/ParticleTest.cpp \ +$(LOCAL_PATH)/Classes/PerformanceTest/PerformanceAllocTest.cpp \ +$(LOCAL_PATH)/Classes/PerformanceTest/PerformanceNodeChildrenTest.cpp \ +$(LOCAL_PATH)/Classes/PerformanceTest/PerformanceParticleTest.cpp \ +$(LOCAL_PATH)/Classes/PerformanceTest/PerformanceSpriteTest.cpp \ +$(LOCAL_PATH)/Classes/PerformanceTest/PerformanceTest.cpp \ +$(LOCAL_PATH)/Classes/PerformanceTest/PerformanceTextureTest.cpp \ +$(LOCAL_PATH)/Classes/PerformanceTest/PerformanceTouchesTest.cpp \ +$(LOCAL_PATH)/Classes/PhysicsTest/PhysicsTest.cpp \ +$(LOCAL_PATH)/Classes/RenderTextureTest/RenderTextureTest.cpp \ +$(LOCAL_PATH)/Classes/RotateWorldTest/RotateWorldTest.cpp \ +$(LOCAL_PATH)/Classes/SceneTest/SceneTest.cpp \ +$(LOCAL_PATH)/Classes/SchedulerTest/SchedulerTest.cpp \ +$(LOCAL_PATH)/Classes/ShaderTest/ShaderTest.cpp \ +$(LOCAL_PATH)/Classes/ShaderTest/ShaderTest2.cpp \ +$(LOCAL_PATH)/Classes/SpineTest/SpineTest.cpp \ +$(LOCAL_PATH)/Classes/SpriteTest/SpriteTest.cpp \ +$(LOCAL_PATH)/Classes/TextInputTest/TextInputTest.cpp \ +$(LOCAL_PATH)/Classes/Texture2dTest/Texture2dTest.cpp \ +$(LOCAL_PATH)/Classes/TextureCacheTest/TextureCacheTest.cpp \ +$(LOCAL_PATH)/Classes/TexturePackerEncryptionTest/TextureAtlasEncryptionTest.cpp \ +$(LOCAL_PATH)/Classes/TileMapTest/TileMapTest.cpp \ +$(LOCAL_PATH)/Classes/TouchesTest/Ball.cpp \ +$(LOCAL_PATH)/Classes/TouchesTest/Paddle.cpp \ +$(LOCAL_PATH)/Classes/TouchesTest/TouchesTest.cpp \ +$(LOCAL_PATH)/Classes/TransitionsTest/TransitionsTest.cpp \ +$(LOCAL_PATH)/Classes/UserDefaultTest/UserDefaultTest.cpp \ +$(LOCAL_PATH)/Classes/ZwoptexTest/ZwoptexTest.cpp LOCAL_C_INCLUDES := $(LOCAL_PATH)/Classes From 039a2c93e1a9f8b415fa32355e551e583e36238f Mon Sep 17 00:00:00 2001 From: James Chen Date: Wed, 16 Oct 2013 11:30:56 +0800 Subject: [PATCH 40/64] issue #2905: [iOS Mac]Removing 'include' folder in 'external' group. Otherwise, it will find wrong included file. --- build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id b/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id index 35cb0ad779..b519be8c47 100644 --- a/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -c716fb5eae4ef941532f1184de8b414c4cd3261b \ No newline at end of file +96d1842580c3571508689be130709cc09771344a \ No newline at end of file From 6fba0dd5db59d23cde47c6e05c0eefba8483c40b Mon Sep 17 00:00:00 2001 From: James Chen Date: Wed, 16 Oct 2013 15:43:59 +0800 Subject: [PATCH 41/64] issue #2905: [iOS Mac] TestJavascript works now. --- .../project.pbxproj.REMOVED.git-id | 2 +- .../project.pbxproj.REMOVED.git-id | 2 +- .../armature/animation/CCArmatureAnimation.h | 4 +- cocos/network/HttpRequest.h | 2 +- .../javascript/bindings/XMLHTTPRequest.cpp | 10 +- .../javascript/bindings/XMLHTTPRequest.h | 4 +- .../bindings/js_bindings_ccbreader.cpp | 15 +- .../bindings/js_bindings_ccbreader.h | 11 +- .../jsb_cocos2dx_extension_manual.cpp | 17 +- .../javascript/bindings/jsb_websocket.cpp | 4 +- .../obfuscate/obfuscate_exclude_chipmunk.js | 602 ------------------ ...bfuscate_exclude_cocos2d.js.REMOVED.git-id | 1 - .../bindings/spidermonkey_specifics.h | 2 +- .../TestJavascript/Classes/AppDelegate.cpp | 2 +- .../TestJavascript/game.js.REMOVED.git-id | 1 - .../Javascript/TestJavascript/obfuscate.xml | 76 --- tools/tojs/cocos2dx.ini | 6 +- tools/tojs/cocos2dx_extension.ini | 7 +- tools/tojs/genbindings.sh | 4 +- 19 files changed, 47 insertions(+), 725 deletions(-) delete mode 100644 cocos/scripting/javascript/bindings/obfuscate/obfuscate_exclude_chipmunk.js delete mode 100644 cocos/scripting/javascript/bindings/obfuscate/obfuscate_exclude_cocos2d.js.REMOVED.git-id delete mode 100644 samples/Javascript/TestJavascript/game.js.REMOVED.git-id delete mode 100644 samples/Javascript/TestJavascript/obfuscate.xml diff --git a/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id b/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id index b519be8c47..0e61b0c9e8 100644 --- a/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -96d1842580c3571508689be130709cc09771344a \ No newline at end of file +c574341d56f31ced16553735ba34a697d1bbac02 \ No newline at end of file diff --git a/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id b/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id index 983a860ea6..5be8a11389 100644 --- a/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -d57f7fce48d49b56eb650690a52eaf3abbff7ec4 \ No newline at end of file +eb61a6b65e5947b285b970192a8d0c129f807556 \ No newline at end of file diff --git a/cocos/editor-support/cocostudio/armature/animation/CCArmatureAnimation.h b/cocos/editor-support/cocostudio/armature/animation/CCArmatureAnimation.h index b9ac3d4200..61096a2033 100644 --- a/cocos/editor-support/cocostudio/armature/animation/CCArmatureAnimation.h +++ b/cocos/editor-support/cocostudio/armature/animation/CCArmatureAnimation.h @@ -45,8 +45,8 @@ class Bone; typedef void (cocos2d::Object::*SEL_MovementEventCallFunc)(Armature *, MovementEventType, const char *); typedef void (cocos2d::Object::*SEL_FrameEventCallFunc)(Bone *, const char *, int, int); -#define movementEvent_selector(_SELECTOR) (SEL_MovementEventCallFunc)(&_SELECTOR) -#define frameEvent_selector(_SELECTOR) (SEL_FrameEventCallFunc)(&_SELECTOR) +#define movementEvent_selector(_SELECTOR) (cocostudio::SEL_MovementEventCallFunc)(&_SELECTOR) +#define frameEvent_selector(_SELECTOR) (cocostudio::SEL_FrameEventCallFunc)(&_SELECTOR) class ArmatureAnimation : public ProcessBase diff --git a/cocos/network/HttpRequest.h b/cocos/network/HttpRequest.h index 273a87b53e..81715d7991 100644 --- a/cocos/network/HttpRequest.h +++ b/cocos/network/HttpRequest.h @@ -32,7 +32,7 @@ namespace network { class HttpClient; class HttpResponse; typedef void (cocos2d::Object::*SEL_HttpResponse)(HttpClient* client, HttpResponse* response); -#define httpresponse_selector(_SELECTOR) (SEL_HttpResponse)(&_SELECTOR) +#define httpresponse_selector(_SELECTOR) (network::SEL_HttpResponse)(&_SELECTOR) /** @brief defines the object which users must packed for HttpClient::send(HttpRequest*) method. diff --git a/cocos/scripting/javascript/bindings/XMLHTTPRequest.cpp b/cocos/scripting/javascript/bindings/XMLHTTPRequest.cpp index b799f6aacf..2230a4a94d 100644 --- a/cocos/scripting/javascript/bindings/XMLHTTPRequest.cpp +++ b/cocos/scripting/javascript/bindings/XMLHTTPRequest.cpp @@ -167,7 +167,7 @@ void MinXmlHttpRequest::_setHttpRequestHeader() * @param sender Object which initialized callback * @param respone Response object */ -void MinXmlHttpRequest::handle_requestResponse(cocos2d::extension::HttpClient *sender, cocos2d::extension::HttpResponse *response) +void MinXmlHttpRequest::handle_requestResponse(network::HttpClient *sender, network::HttpResponse *response) { if (0 != strlen(response->getHttpRequest()->getTag())) { @@ -247,7 +247,7 @@ void MinXmlHttpRequest::handle_requestResponse(cocos2d::extension::HttpClient *s void MinXmlHttpRequest::_sendRequest(JSContext *cx) { _httpRequest->setResponseCallback(this, httpresponse_selector(MinXmlHttpRequest::handle_requestResponse)); - cocos2d::extension::HttpClient::getInstance()->send(_httpRequest); + network::HttpClient::getInstance()->send(_httpRequest); _httpRequest->release(); } @@ -261,7 +261,7 @@ MinXmlHttpRequest::MinXmlHttpRequest() : _onreadystateCallback(NULL), _isNetwork _requestHeader.clear(); _withCredentialsValue = true; _cx = ScriptingCore::getInstance()->getGlobalContext(); - _httpRequest = new cocos2d::extension::HttpRequest(); + _httpRequest = new network::HttpRequest(); } /** @@ -622,11 +622,11 @@ JS_BINDED_FUNC_IMPL(MinXmlHttpRequest, open) if (_meth.compare("post") == 0 || _meth.compare("POST") == 0) { - _httpRequest->setRequestType(cocos2d::extension::HttpRequest::Type::POST); + _httpRequest->setRequestType(network::HttpRequest::Type::POST); } else { - _httpRequest->setRequestType(cocos2d::extension::HttpRequest::Type::GET); + _httpRequest->setRequestType(network::HttpRequest::Type::GET); } _httpRequest->setUrl(_url.c_str()); diff --git a/cocos/scripting/javascript/bindings/XMLHTTPRequest.h b/cocos/scripting/javascript/bindings/XMLHTTPRequest.h index b94e05e5fe..861e0a2536 100644 --- a/cocos/scripting/javascript/bindings/XMLHTTPRequest.h +++ b/cocos/scripting/javascript/bindings/XMLHTTPRequest.h @@ -80,7 +80,7 @@ public: JS_BINDED_FUNC(MinXmlHttpRequest, setRequestHeader); JS_BINDED_FUNC(MinXmlHttpRequest, overrideMimeType); - void handle_requestResponse(cocos2d::extension::HttpClient *sender, cocos2d::extension::HttpResponse *response); + void handle_requestResponse(network::HttpClient *sender, network::HttpResponse *response); private: @@ -102,7 +102,7 @@ private: ResponseType _responseType; unsigned _timeout; bool _isAsync; - cocos2d::extension::HttpRequest* _httpRequest; + network::HttpRequest* _httpRequest; bool _isNetwork; bool _withCredentialsValue; std::map _httpHeader; diff --git a/cocos/scripting/javascript/bindings/js_bindings_ccbreader.cpp b/cocos/scripting/javascript/bindings/js_bindings_ccbreader.cpp index 523cdcda10..733ac47b45 100644 --- a/cocos/scripting/javascript/bindings/js_bindings_ccbreader.cpp +++ b/cocos/scripting/javascript/bindings/js_bindings_ccbreader.cpp @@ -12,6 +12,7 @@ USING_NS_CC; USING_NS_CC_EXT; +using namespace cocosbuilder; static void removeSelector(std::string &str) { size_t found; @@ -79,7 +80,7 @@ JSBool js_cocos2dx_CCBAnimationManager_animationCompleteCallback(JSContext *cx, JSObject *obj = JS_THIS_OBJECT(cx, vp); js_proxy_t *proxy = jsb_get_js_proxy(obj); - cocos2d::extension::CCBAnimationManager *node = (cocos2d::extension::CCBAnimationManager *)(proxy ? proxy->ptr : NULL); + cocosbuilder::CCBAnimationManager *node = (cocosbuilder::CCBAnimationManager *)(proxy ? proxy->ptr : NULL); JSCCBAnimationWrapper *tmpCobj = new JSCCBAnimationWrapper(); tmpCobj->autorelease(); @@ -103,10 +104,10 @@ JSBool js_cocos2dx_CCBReader_readNodeGraphFromFile(JSContext *cx, uint32_t argc, jsval *argv = JS_ARGV(cx, vp); JSBool ok = JS_TRUE; JSObject *obj; - cocos2d::extension::CCBReader* cobj; + cocosbuilder::CCBReader* cobj; obj = JS_THIS_OBJECT(cx, vp); js_proxy_t *proxy = jsb_get_js_proxy(obj); - cobj = (cocos2d::extension::CCBReader *)(proxy ? proxy->ptr : NULL); + cobj = (cocosbuilder::CCBReader *)(proxy ? proxy->ptr : NULL); TEST_NATIVE_OBJECT(cx, cobj) if (argc == 2) { @@ -188,10 +189,10 @@ JSBool js_cocos2dx_CCBReader_createSceneWithNodeGraphFromFile(JSContext *cx, uin jsval *argv = JS_ARGV(cx, vp); JSBool ok = JS_TRUE; JSObject *obj; - cocos2d::extension::CCBReader* cobj; + cocosbuilder::CCBReader* cobj; obj = JS_THIS_OBJECT(cx, vp); js_proxy_t *proxy = jsb_get_js_proxy(obj); - cobj = (cocos2d::extension::CCBReader *)(proxy ? proxy->ptr : NULL); + cobj = (cocosbuilder::CCBReader *)(proxy ? proxy->ptr : NULL); TEST_NATIVE_OBJECT(cx, cobj) if (argc == 2) { @@ -277,7 +278,7 @@ JSBool js_CocosBuilder_create(JSContext *cx, uint32_t argc, jsval *vp) ccNodeLoaderLibrary->registerNodeLoader("", JSLayerLoader::loader()); - cocos2d::extension::CCBReader * ret = new cocos2d::extension::CCBReader(ccNodeLoaderLibrary); + CCBReader * ret = new CCBReader(ccNodeLoaderLibrary); ret->autorelease(); jsval jsret; @@ -287,7 +288,7 @@ JSBool js_CocosBuilder_create(JSContext *cx, uint32_t argc, jsval *vp) jsret = OBJECT_TO_JSVAL(proxy->obj); } else { // create a new js obj of that class - proxy = js_get_or_create_proxy(cx, ret); + proxy = js_get_or_create_proxy(cx, ret); jsret = OBJECT_TO_JSVAL(proxy->obj); } } else { diff --git a/cocos/scripting/javascript/bindings/js_bindings_ccbreader.h b/cocos/scripting/javascript/bindings/js_bindings_ccbreader.h index e81b9d3be2..8bcdabd044 100644 --- a/cocos/scripting/javascript/bindings/js_bindings_ccbreader.h +++ b/cocos/scripting/javascript/bindings/js_bindings_ccbreader.h @@ -9,13 +9,12 @@ #define __JS_BINDINGS_CCBREADER_H__ #include "jsapi.h" -#include "cocos-ext.h" #include "cocos2d_specifics.hpp" - +#include "cocosbuilder/CocosBuilder.h" class CCBScriptCallbackProxy: public cocos2d::Layer -, public cocos2d::extension::CCBSelectorResolver -, public cocos2d::extension::CCBMemberVariableAssigner { +, public cocosbuilder::CCBSelectorResolver +, public cocosbuilder::CCBMemberVariableAssigner { std::string callBackProp; jsval owner; @@ -35,7 +34,7 @@ public: virtual bool onAssignCCBMemberVariable(cocos2d::Object * pTarget, const char * pMemberVariableName, cocos2d::Node * pNode); virtual void onNodeLoaded(cocos2d::Node * pNode, - cocos2d::extension::NodeLoader * pNodeLoader); + cocosbuilder::NodeLoader * pNodeLoader); virtual CCBSelectorResolver * createNew(); void menuItemCallback(Object *pSender); @@ -46,7 +45,7 @@ public: }; -class JSLayerLoader : public cocos2d::extension::LayerLoader { +class JSLayerLoader : public cocosbuilder::LayerLoader { public: CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(JSLayerLoader, loader); diff --git a/cocos/scripting/javascript/bindings/jsb_cocos2dx_extension_manual.cpp b/cocos/scripting/javascript/bindings/jsb_cocos2dx_extension_manual.cpp index 3ec02a7d86..7a6d8bfc46 100644 --- a/cocos/scripting/javascript/bindings/jsb_cocos2dx_extension_manual.cpp +++ b/cocos/scripting/javascript/bindings/jsb_cocos2dx_extension_manual.cpp @@ -9,10 +9,11 @@ #include "cocos-ext.h" #include "ScriptingCore.h" #include "cocos2d_specifics.hpp" +#include "cocostudio/CocoStudio.h" USING_NS_CC; USING_NS_CC_EXT; -using namespace extension::armature; + class JSB_ScrollViewDelegate : public Object @@ -787,8 +788,8 @@ public: virtual void setJSCallbackThis(jsval thisObj); - void movementCallbackFunc(cocos2d::extension::armature::Armature * pArmature, cocos2d::extension::armature::MovementEventType pMovementEventType, const char *pMovementId); - void frameCallbackFunc(cocos2d::extension::Bone *pBone, const char *frameEventName, int originFrameIndex, int currentFrameIndex); + 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: @@ -825,7 +826,7 @@ void JSArmatureWrapper::setJSCallbackThis(jsval _jsThisObj) } } -void JSArmatureWrapper::movementCallbackFunc(cocos2d::extension::armature::Armature *pArmature, cocos2d::extension::armature::MovementEventType pMovementEventType, const char *pMovementId) +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); @@ -865,7 +866,7 @@ void JSArmatureWrapper::addArmatureFileInfoAsyncCallbackFunc(float percent) } -void JSArmatureWrapper::frameCallbackFunc(cocos2d::extension::Bone *pBone, const char *frameEventName, int originFrameIndex, int currentFrameIndex) +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); @@ -893,7 +894,7 @@ static JSBool js_cocos2dx_ArmatureAnimation_setMovementEventCallFunc(JSContext * { JSObject *obj = JS_THIS_OBJECT(cx, vp); js_proxy_t *proxy = jsb_get_js_proxy(obj); - cocos2d::extension::armature::ArmatureAnimation* cobj = (cocos2d::extension::armature::ArmatureAnimation *)(proxy ? proxy->ptr : NULL); + cocostudio::ArmatureAnimation* cobj = (cocostudio::ArmatureAnimation *)(proxy ? proxy->ptr : NULL); JSB_PRECONDITION2( cobj, cx, JS_FALSE, "Invalid Native Object"); if (argc == 2) { @@ -917,7 +918,7 @@ static JSBool js_cocos2dx_ArmatureAnimation_setFrameEventCallFunc(JSContext *cx, { JSObject *obj = JS_THIS_OBJECT(cx, vp); js_proxy_t *proxy = jsb_get_js_proxy(obj); - cocos2d::extension::armature::ArmatureAnimation* cobj = (cocos2d::extension::armature::ArmatureAnimation *)(proxy ? proxy->ptr : NULL); + cocostudio::ArmatureAnimation* cobj = (cocostudio::ArmatureAnimation *)(proxy ? proxy->ptr : NULL); JSB_PRECONDITION2( cobj, cx, JS_FALSE, "Invalid Native Object"); if (argc == 2) { @@ -941,7 +942,7 @@ static JSBool jsb_Animation_addArmatureFileInfoAsyncCallFunc(JSContext *cx, uint { JSObject *obj = JS_THIS_OBJECT(cx, vp); js_proxy_t *proxy = jsb_get_js_proxy(obj); - cocos2d::extension::armature::ArmatureDataManager* cobj = (cocos2d::extension::armature::ArmatureDataManager *)(proxy ? proxy->ptr : NULL); + cocostudio::ArmatureDataManager* cobj = (cocostudio::ArmatureDataManager *)(proxy ? proxy->ptr : NULL); JSB_PRECONDITION2( cobj, cx, JS_FALSE, "Invalid Native Object"); if (argc == 3) { diff --git a/cocos/scripting/javascript/bindings/jsb_websocket.cpp b/cocos/scripting/javascript/bindings/jsb_websocket.cpp index 28a01fbc5b..49ecf7e57e 100644 --- a/cocos/scripting/javascript/bindings/jsb_websocket.cpp +++ b/cocos/scripting/javascript/bindings/jsb_websocket.cpp @@ -30,7 +30,7 @@ THE SOFTWARE. #include "ScriptingCore.h" #include "cocos2d_specifics.hpp" -USING_NS_CC_EXT; +using namespace network; /* [Constructor(in DOMString url, in optional DOMString protocols)] @@ -242,7 +242,7 @@ JSBool js_cocos2dx_extension_WebSocket_constructor(JSContext *cx, uint32_t argc, JSObject *obj = JS_NewObject(cx, js_cocos2dx_websocket_class, js_cocos2dx_websocket_prototype, NULL); - cocos2d::extension::WebSocket* cobj = new cocos2d::extension::WebSocket(); + WebSocket* cobj = new WebSocket(); JSB_WebSocketDelegate* delegate = new JSB_WebSocketDelegate(); delegate->setJSDelegate(obj); diff --git a/cocos/scripting/javascript/bindings/obfuscate/obfuscate_exclude_chipmunk.js b/cocos/scripting/javascript/bindings/obfuscate/obfuscate_exclude_chipmunk.js deleted file mode 100644 index c2913daba5..0000000000 --- a/cocos/scripting/javascript/bindings/obfuscate/obfuscate_exclude_chipmunk.js +++ /dev/null @@ -1,602 +0,0 @@ -/** - * @fileoverview Java Script Builtins for windows properties. - * - * @externs - */ - -/** - * @see https://cocos2d-x.org - */ - -/** - * for chipmunk api - * @type {string} - */ -var cp = function(){}; - -CSSProperties.prototype.cp; -CSSProperties.prototype.momentForCircle; -CSSProperties.prototype.areaForCircle; -CSSProperties.prototype.momentForSegment; -CSSProperties.prototype.areaForSegment; -CSSProperties.prototype.momentForPoly; -CSSProperties.prototype.areaForPoly; -CSSProperties.prototype.centroidForPoly; -CSSProperties.prototype.recenterPoly; -CSSProperties.prototype.momentForBox; -CSSProperties.prototype.momentForBox2; -CSSProperties.prototype.clamp01; -CSSProperties.prototype.fclamp01; -CSSProperties.prototype.Vect; -CSSProperties.prototype.add; -CSSProperties.prototype.sub; -CSSProperties.prototype.neg; -CSSProperties.prototype.mult; -CSSProperties.prototype.project; -CSSProperties.prototype.rotate; -CSSProperties.prototype.v; -CSSProperties.prototype.dot; -CSSProperties.prototype.len; -CSSProperties.prototype.eql; -CSSProperties.prototype.cross; -CSSProperties.prototype.perp; -CSSProperties.prototype.pvrperp; -CSSProperties.prototype.unrotate; -CSSProperties.prototype.lengthsq; -CSSProperties.prototype.lerp; -CSSProperties.prototype.normalize; -CSSProperties.prototype.normalize_safe; -CSSProperties.prototype.clamp; -CSSProperties.prototype.lerpconst; -CSSProperties.prototype.dist; -CSSProperties.prototype.distsq; -CSSProperties.prototype.near; -CSSProperties.prototype.slerp; -CSSProperties.prototype.slerpconst; -CSSProperties.prototype.forangle; -CSSProperties.prototype.toangle; -CSSProperties.prototype.str; -CSSProperties.prototype.vzero; -CSSProperties.prototype.x; -CSSProperties.prototype.y; -CSSProperties.prototype.BB; -CSSProperties.prototype.bb; -CSSProperties.prototype.NO_GROUP; -CSSProperties.prototype.ALL_LAYERS; -CSSProperties.prototype.resetShapeIdCounter; -CSSProperties.prototype.Shape; -CSSProperties.prototype.setElasticity; -CSSProperties.prototype.setFriction; -CSSProperties.prototype.setLayers; -CSSProperties.prototype.setSensor; -CSSProperties.prototype.setCollisionType; -CSSProperties.prototype.getBody; -CSSProperties.prototype.active; -CSSProperties.prototype.setBody; -CSSProperties.prototype.cacheBB; -CSSProperties.prototype.update; -CSSProperties.prototype.getBB; -CSSProperties.prototype.CircleShape; -CSSProperties.prototype.cacheData; -CSSProperties.prototype.pointQuery; -CSSProperties.prototype.segmentQuery; -CSSProperties.prototype.collisionCode; -CSSProperties.prototype.collisionTable; -CSSProperties.prototype.SegmentShape; -CSSProperties.prototype.setNeighbors; -CSSProperties.prototype.setEndpoints; -CSSProperties.prototype.PolyShape; -CSSProperties.prototype.setVerts; -CSSProperties.prototype.transformVerts; -CSSProperties.prototype.transformAxes; -CSSProperties.prototype.getNumVerts; -CSSProperties.prototype.getVert; -CSSProperties.prototype.valueOnAxis; -CSSProperties.prototype.containsVert; -CSSProperties.prototype.containsVertPartial; -CSSProperties.prototype.BoxShape; -CSSProperties.prototype.BoxShape2; -CSSProperties.prototype.Body; -CSSProperties.prototype.sanityCheck; -CSSProperties.prototype.getPos; -CSSProperties.prototype.getVel; -CSSProperties.prototype.getAngVel; -CSSProperties.prototype.isSleeping; -CSSProperties.prototype.isStatic; -CSSProperties.prototype.isRogue; -CSSProperties.prototype.setMass; -CSSProperties.prototype.setMoment; -CSSProperties.prototype.addShape; -CSSProperties.prototype.removeShape; -CSSProperties.prototype.removeConstraint; -CSSProperties.prototype.setPos; -CSSProperties.prototype.setVel; -CSSProperties.prototype.setAngVel; -CSSProperties.prototype.setAngleInternal; -CSSProperties.prototype.setAngle; -CSSProperties.prototype.velocity_func; -CSSProperties.prototype.position_func; -CSSProperties.prototype.resetForces; -CSSProperties.prototype.applyForce; -CSSProperties.prototype.applyImpulse; -CSSProperties.prototype.getVelAtPoint; -CSSProperties.prototype.getVelAtWorldPoint; -CSSProperties.prototype.getVelAtLocalPoint; -CSSProperties.prototype.eachShape; -CSSProperties.prototype.eachConstraint; -CSSProperties.prototype.eachArbiter; -CSSProperties.prototype.local2World; -CSSProperties.prototype.world2Local; -CSSProperties.prototype.kineticEnergy; -CSSProperties.prototype.activate; -CSSProperties.prototype.activateStatic; -CSSProperties.prototype.pushArbiter; -CSSProperties.prototype.sleep; -CSSProperties.prototype.sleepWithGroup; -CSSProperties.prototype.StaticBody; -CSSProperties.prototype.SpatialIndex; -CSSProperties.prototype.collideStatic; -CSSProperties.prototype.BBTree; -CSSProperties.prototype.getStamp; -CSSProperties.prototype.incrementStamp; -CSSProperties.prototype.insert; -CSSProperties.prototype.remove; -CSSProperties.prototype.contains; -CSSProperties.prototype.reindexQuery; -CSSProperties.prototype.reindex; -CSSProperties.prototype.reindexObject; -CSSProperties.prototype.query; -CSSProperties.prototype.count; -CSSProperties.prototype.each; -CSSProperties.prototype.optimize; -CSSProperties.prototype.log; -CSSProperties.prototype.CollisionHandler; -CSSProperties.prototype.begin; -CSSProperties.prototype.preSolve; -CSSProperties.prototype.postSolve; -CSSProperties.prototype.separate; -CSSProperties.prototype.collideShapes; -CSSProperties.prototype.Space; -CSSProperties.prototype.getCurrentTimeStep; -CSSProperties.prototype.isLocked; -CSSProperties.prototype.addCollisionHandler; -CSSProperties.prototype.removeCollisionHandler; -CSSProperties.prototype.setDefaultCollisionHandler; -CSSProperties.prototype.lookupHandler; -CSSProperties.prototype.addStaticShape; -CSSProperties.prototype.addBody; -CSSProperties.prototype.addConstraint; -CSSProperties.prototype.filterArbiters; -CSSProperties.prototype.removeStaticShape; -CSSProperties.prototype.removeBody; -CSSProperties.prototype.containsShape; -CSSProperties.prototype.containsBody; -CSSProperties.prototype.containsConstraint; -CSSProperties.prototype.uncacheArbiter; -CSSProperties.prototype.eachBody; -CSSProperties.prototype.reindexStatic; -CSSProperties.prototype.reindexShape; -CSSProperties.prototype.reindexShapesForBody; -CSSProperties.prototype.useSpatialHash; -CSSProperties.prototype.activateBody; -CSSProperties.prototype.deactivateBody; -CSSProperties.prototype.processComponents; -CSSProperties.prototype.activateShapesTouchingShape; -CSSProperties.prototype.pointQueryFirst; -CSSProperties.prototype.segmentQueryFirst; -CSSProperties.prototype.bbQuery; -CSSProperties.prototype.shapeQuery; -CSSProperties.prototype.addPostStepCallback; -CSSProperties.prototype.runPostStepCallbacks; -CSSProperties.prototype.lock; -CSSProperties.prototype.unlock; -CSSProperties.prototype.makeCollideShapes; -CSSProperties.prototype.arbiterSetFilter; -CSSProperties.prototype.step; -CSSProperties.prototype.Constraint; -CSSProperties.prototype.activateBodies; -CSSProperties.prototype.preStep; -CSSProperties.prototype.applyCachedImpulse; -CSSProperties.prototype.getImpulse; -CSSProperties.prototype.next; -CSSProperties.prototype.PinJoint; -CSSProperties.prototype.SlideJoint; -CSSProperties.prototype.PivotJoint; -CSSProperties.prototype.GrooveJoint; -CSSProperties.prototype.grooveConstrain; -CSSProperties.prototype.setGrooveA; -CSSProperties.prototype.setGrooveB; -CSSProperties.prototype.DampedSpring; -CSSProperties.prototype.DampedRotarySpring; -CSSProperties.prototype.RotaryLimitJoint; -CSSProperties.prototype.RatchetJoint; -CSSProperties.prototype.GearJoint; -CSSProperties.prototype.setRatio; -CSSProperties.prototype.SimpleMotor; -CSSProperties.prototype.Base; -CSSProperties.prototype._v; -CSSProperties.prototype.vadd; -CSSProperties.prototype.getHandle; -CSSProperties.prototype.getGravity; -CSSProperties.prototype.getIterations; -CSSProperties.prototype.getDamping; -CSSProperties.prototype.getStaticBody; -CSSProperties.prototype.getIdleSpeedThreshold; -CSSProperties.prototype.getSleepTimeThreshold; -CSSProperties.prototype.getCollisionSlop; -CSSProperties.prototype.getCollisionBias; -CSSProperties.prototype.getCollisionPersistence; -CSSProperties.prototype.getEnableContactGraph; -CSSProperties.prototype.getAngle; -CSSProperties.prototype.getAngVel; -CSSProperties.prototype.getPos; -CSSProperties.prototype.getVel; -CSSProperties.prototype.getMoment; -CSSProperties.prototype.getBody; -CSSProperties.prototype.getGroup; -CSSProperties.prototype.getCollisionType; -CSSProperties.prototype.getMaxForce; -CSSProperties.prototype.getAnchr1; -CSSProperties.prototype.getAnchr2; -CSSProperties.prototype.setHandle; -CSSProperties.prototype._setSpace; -CSSProperties.prototype._setCPBody; -CSSProperties.prototype.setGravity; -CSSProperties.prototype.setIterations; -CSSProperties.prototype.setDamping; -CSSProperties.prototype.setStaticBody; -CSSProperties.prototype.setIdleSpeedThreshold; -CSSProperties.prototype.setSleepTimeThreshold; -CSSProperties.prototype.setCollisionSlop; -CSSProperties.prototype.setCollisionBias; -CSSProperties.prototype.setCollisionPersistence; -CSSProperties.prototype.setEnableContactGraph; -CSSProperties.prototype.setAngle; -CSSProperties.prototype.setAngVel; -CSSProperties.prototype.setPos; -CSSProperties.prototype.setVel; -CSSProperties.prototype.setMoment; -CSSProperties.prototype.setBody; -CSSProperties.prototype.setGroup; -CSSProperties.prototype.setCollisionType; -CSSProperties.prototype.setMaxForce; -CSSProperties.prototype.setAnchr1; -CSSProperties.prototype.setAnchr2; -CSSProperties.prototype.vclamp; -CSSProperties.prototype.vcross; -CSSProperties.prototype.vdist; -CSSProperties.prototype.vdistsq; -CSSProperties.prototype.vdot; -CSSProperties.prototype.veql; -CSSProperties.prototype.vforangle; -CSSProperties.prototype.vlength; -CSSProperties.prototype.vlengthsq; -CSSProperties.prototype.vlerp; -CSSProperties.prototype.vlerpconst; -CSSProperties.prototype.vmult; -CSSProperties.prototype.vnear; -CSSProperties.prototype.vneg; -CSSProperties.prototype.vnormalize; -CSSProperties.prototype.vnormalize_safe; -CSSProperties.prototype.vperp; -CSSProperties.prototype.vproject; -CSSProperties.prototype.vrotate; -CSSProperties.prototype.vrperp; -CSSProperties.prototype.vslerp; -CSSProperties.prototype.vslerpconst; -CSSProperties.prototype.vsub; -CSSProperties.prototype.vtoangle; -CSSProperties.prototype.vunrotate; -CSSProperties.prototype.l; -CSSProperties.prototype.b; -CSSProperties.prototype.t; -CSSProperties.prototype.r; -CSSProperties.prototype.a; -CSSProperties.prototype.w; -CSSProperties.prototype.p; -CSSProperties.prototype.i; -CSSProperties.prototype.handle; -CSSProperties.prototype.gravity; -CSSProperties.prototype.iterations; -CSSProperties.prototype.damping; -CSSProperties.prototype.staticBody; -CSSProperties.prototype.idleSpeedThreshold; -CSSProperties.prototype.sleepTimeThreshold; -CSSProperties.prototype.collisionSlop; -CSSProperties.prototype.collisionBias; -CSSProperties.prototype.collisionPersistence; -CSSProperties.prototype.enableContactGraph; -CSSProperties.prototype.group; -CSSProperties.prototype.collision_type; -CSSProperties.prototype.maxForce; -CSSProperties.prototype.anchr1; -CSSProperties.prototype.anchr2; -CSSProperties.prototype.collisionBegin; -CSSProperties.prototype.collisionPre; -CSSProperties.prototype.collisionPost; -CSSProperties.prototype.collisionSeparate; -CSSProperties.prototype.createPhysicsSprite; -CSSProperties.prototype.Arbiter; -CSSProperties.prototype.spaceAddCollisionHandler; -CSSProperties.prototype.spaceRemoveCollisionHandler; -CSSProperties.prototype.arbiterGetBodies; -CSSProperties.prototype.arbiterGetShapes; -CSSProperties.prototype.bodyGetUserData; -CSSProperties.prototype.bodySetUserData; -CSSProperties.prototype.getBodies; -CSSProperties.prototype.getShapes; -CSSProperties.prototype.getUserData; -CSSProperties.prototype.setUserData; -CSSProperties.prototype.arbiterGetCount; -CSSProperties.prototype.arbiterGetDepth; -CSSProperties.prototype.arbiterGetElasticity; -CSSProperties.prototype.arbiterGetFriction; -CSSProperties.prototype.arbiterGetNormal; -CSSProperties.prototype.arbiterGetPoint; -CSSProperties.prototype.arbiterGetSurfaceVelocity; -CSSProperties.prototype.arbiterIgnore; -CSSProperties.prototype.arbiterIsFirstContact; -CSSProperties.prototype.arbiterSetElasticity; -CSSProperties.prototype.arbiterSetFriction; -CSSProperties.prototype.arbiterSetSurfaceVelocity; -CSSProperties.prototype.arbiterTotalImpulse; -CSSProperties.prototype.arbiterTotalImpulseWithFriction; -CSSProperties.prototype.arbiterTotalKE; -CSSProperties.prototype.areaForCircle; -CSSProperties.prototype.areaForSegment; -CSSProperties.prototype.bBArea; -CSSProperties.prototype.bBClampVect; -CSSProperties.prototype.bBContainsBB; -CSSProperties.prototype.bBContainsVect; -CSSProperties.prototype.bBExpand; -CSSProperties.prototype.bBIntersects; -CSSProperties.prototype.bBIntersectsSegment; -CSSProperties.prototype.bBMerge; -CSSProperties.prototype.bBMergedArea; -CSSProperties.prototype.bBNew; -CSSProperties.prototype.bBNewForCircle; -CSSProperties.prototype.bBSegmentQuery; -CSSProperties.prototype.bBWrapVect; -CSSProperties.prototype.bodyActivate; -CSSProperties.prototype.bodyActivateStatic; -CSSProperties.prototype.bodyApplyForce; -CSSProperties.prototype.bodyApplyImpulse; -CSSProperties.prototype.bodyDestroy; -CSSProperties.prototype.bodyFree; -CSSProperties.prototype.bodyGetAngVel; -CSSProperties.prototype.bodyGetAngVelLimit; -CSSProperties.prototype.bodyGetAngle; -CSSProperties.prototype.bodyGetForce; -CSSProperties.prototype.bodyGetMass; -CSSProperties.prototype.bodyGetMoment; -CSSProperties.prototype.bodyGetPos; -CSSProperties.prototype.bodyGetRot; -CSSProperties.prototype.bodyGetSpace; -CSSProperties.prototype.bodyGetTorque; -CSSProperties.prototype.bodyGetVel; -CSSProperties.prototype.bodyGetVelAtLocalPoint; -CSSProperties.prototype.bodyGetVelAtWorldPoint; -CSSProperties.prototype.bodyGetVelLimit; -CSSProperties.prototype.bodyInit; -CSSProperties.prototype.bodyInitStatic; -CSSProperties.prototype.bodyIsRogue; -CSSProperties.prototype.bodyIsSleeping; -CSSProperties.prototype.bodyIsStatic; -CSSProperties.prototype.bodyKineticEnergy; -CSSProperties.prototype.bodyLocal2World; -CSSProperties.prototype.bodyNew; -CSSProperties.prototype.bodyNewStatic; -CSSProperties.prototype.bodyResetForces; -CSSProperties.prototype.bodySetAngVel; -CSSProperties.prototype.bodySetAngVelLimit; -CSSProperties.prototype.bodySetAngle; -CSSProperties.prototype.bodySetForce; -CSSProperties.prototype.bodySetMass; -CSSProperties.prototype.bodySetMoment; -CSSProperties.prototype.bodySetPos; -CSSProperties.prototype.bodySetTorque; -CSSProperties.prototype.bodySetVel; -CSSProperties.prototype.bodySetVelLimit; -CSSProperties.prototype.bodySleep; -CSSProperties.prototype.bodySleepWithGroup; -CSSProperties.prototype.bodyUpdatePosition; -CSSProperties.prototype.bodyUpdateVelocity; -CSSProperties.prototype.bodyWorld2Local; -CSSProperties.prototype.boxShapeNew; -CSSProperties.prototype.boxShapeNew2; -CSSProperties.prototype.circleShapeGetOffset; -CSSProperties.prototype.circleShapeGetRadius; -CSSProperties.prototype.circleShapeNew; -CSSProperties.prototype.constraintActivateBodies; -CSSProperties.prototype.constraintDestroy; -CSSProperties.prototype.constraintFree; -CSSProperties.prototype.constraintGetA; -CSSProperties.prototype.constraintGetB; -CSSProperties.prototype.constraintGetErrorBias; -CSSProperties.prototype.constraintGetImpulse; -CSSProperties.prototype.constraintGetMaxBias; -CSSProperties.prototype.constraintGetMaxForce; -CSSProperties.prototype.constraintGetSpace; -CSSProperties.prototype.constraintSetErrorBias; -CSSProperties.prototype.constraintSetMaxBias; -CSSProperties.prototype.constraintSetMaxForce; -CSSProperties.prototype.dampedRotarySpringGetDamping; -CSSProperties.prototype.dampedRotarySpringGetRestAngle; -CSSProperties.prototype.dampedRotarySpringGetStiffness; -CSSProperties.prototype.dampedRotarySpringNew; -CSSProperties.prototype.dampedRotarySpringSetDamping; -CSSProperties.prototype.dampedRotarySpringSetRestAngle; -CSSProperties.prototype.dampedRotarySpringSetStiffness; -CSSProperties.prototype.dampedSpringGetAnchr1; -CSSProperties.prototype.dampedSpringGetAnchr2; -CSSProperties.prototype.dampedSpringGetDamping; -CSSProperties.prototype.dampedSpringGetRestLength; -CSSProperties.prototype.dampedSpringGetStiffness; -CSSProperties.prototype.dampedSpringNew; -CSSProperties.prototype.dampedSpringSetAnchr1; -CSSProperties.prototype.dampedSpringSetAnchr2; -CSSProperties.prototype.dampedSpringSetDamping; -CSSProperties.prototype.dampedSpringSetRestLength; -CSSProperties.prototype.dampedSpringSetStiffness; -CSSProperties.prototype.gearJointGetPhase; -CSSProperties.prototype.gearJointGetRatio; -CSSProperties.prototype.gearJointNew; -CSSProperties.prototype.gearJointSetPhase; -CSSProperties.prototype.gearJointSetRatio; -CSSProperties.prototype.grooveJointGetAnchr2; -CSSProperties.prototype.grooveJointGetGrooveA; -CSSProperties.prototype.grooveJointGetGrooveB; -CSSProperties.prototype.grooveJointNew; -CSSProperties.prototype.grooveJointSetAnchr2; -CSSProperties.prototype.grooveJointSetGrooveA; -CSSProperties.prototype.grooveJointSetGrooveB; -CSSProperties.prototype.initChipmunk; -CSSProperties.prototype.momentForBox; -CSSProperties.prototype.momentForBox2; -CSSProperties.prototype.momentForCircle; -CSSProperties.prototype.momentForSegment; -CSSProperties.prototype.pinJointGetAnchr1; -CSSProperties.prototype.pinJointGetAnchr2; -CSSProperties.prototype.pinJointGetDist; -CSSProperties.prototype.pinJointNew; -CSSProperties.prototype.pinJointSetAnchr1; -CSSProperties.prototype.pinJointSetAnchr2; -CSSProperties.prototype.pinJointSetDist; -CSSProperties.prototype.pivotJointGetAnchr1; -CSSProperties.prototype.pivotJointGetAnchr2; -CSSProperties.prototype.pivotJointNew; -CSSProperties.prototype.pivotJointNew2; -CSSProperties.prototype.pivotJointSetAnchr1; -CSSProperties.prototype.pivotJointSetAnchr2; -CSSProperties.prototype.polyShapeGetNumVerts; -CSSProperties.prototype.polyShapeGetVert; -CSSProperties.prototype.ratchetJointGetAngle; -CSSProperties.prototype.ratchetJointGetPhase; -CSSProperties.prototype.ratchetJointGetRatchet; -CSSProperties.prototype.ratchetJointNew; -CSSProperties.prototype.ratchetJointSetAngle; -CSSProperties.prototype.ratchetJointSetPhase; -CSSProperties.prototype.ratchetJointSetRatchet; -CSSProperties.prototype.resetShapeIdCounter; -CSSProperties.prototype.rotaryLimitJointGetMax; -CSSProperties.prototype.rotaryLimitJointGetMin; -CSSProperties.prototype.rotaryLimitJointNew; -CSSProperties.prototype.rotaryLimitJointSetMax; -CSSProperties.prototype.rotaryLimitJointSetMin; -CSSProperties.prototype.segmentShapeGetA; -CSSProperties.prototype.segmentShapeGetB; -CSSProperties.prototype.segmentShapeGetNormal; -CSSProperties.prototype.segmentShapeGetRadius; -CSSProperties.prototype.segmentShapeNew; -CSSProperties.prototype.segmentShapeSetNeighbors; -CSSProperties.prototype.shapeCacheBB; -CSSProperties.prototype.shapeDestroy; -CSSProperties.prototype.shapeFree; -CSSProperties.prototype.shapeGetBB; -CSSProperties.prototype.shapeGetBody; -CSSProperties.prototype.shapeGetCollisionType; -CSSProperties.prototype.shapeGetElasticity; -CSSProperties.prototype.shapeGetFriction; -CSSProperties.prototype.shapeGetGroup; -CSSProperties.prototype.shapeGetLayers; -CSSProperties.prototype.shapeGetSensor; -CSSProperties.prototype.shapeGetSurfaceVelocity; -CSSProperties.prototype.shapePointQuery; -CSSProperties.prototype.shapeSetBody; -CSSProperties.prototype.shapeSetCollisionType; -CSSProperties.prototype.shapeSetElasticity; -CSSProperties.prototype.shapeSetFriction; -CSSProperties.prototype.shapeSetGroup; -CSSProperties.prototype.shapeSetLayers; -CSSProperties.prototype.shapeSetSensor; -CSSProperties.prototype.shapeSetSurfaceVelocity; -CSSProperties.prototype.shapeUpdate; -CSSProperties.prototype.simpleMotorGetRate; -CSSProperties.prototype.simpleMotorNew; -CSSProperties.prototype.simpleMotorSetRate; -CSSProperties.prototype.slideJointGetAnchr1; -CSSProperties.prototype.slideJointGetAnchr2; -CSSProperties.prototype.slideJointGetMax; -CSSProperties.prototype.slideJointGetMin; -CSSProperties.prototype.slideJointNew; -CSSProperties.prototype.slideJointSetAnchr1; -CSSProperties.prototype.slideJointSetAnchr2; -CSSProperties.prototype.slideJointSetMax; -CSSProperties.prototype.slideJointSetMin; -CSSProperties.prototype.spaceActivateShapesTouchingShape; -CSSProperties.prototype.spaceAddBody; -CSSProperties.prototype.spaceAddConstraint; -CSSProperties.prototype.spaceAddShape; -CSSProperties.prototype.spaceAddStaticShape; -CSSProperties.prototype.spaceContainsBody; -CSSProperties.prototype.spaceContainsConstraint; -CSSProperties.prototype.spaceContainsShape; -CSSProperties.prototype.spaceDestroy; -CSSProperties.prototype.spaceFree; -CSSProperties.prototype.spaceGetCollisionBias; -CSSProperties.prototype.spaceGetCollisionPersistence; -CSSProperties.prototype.spaceGetCollisionSlop; -CSSProperties.prototype.spaceGetCurrentTimeStep; -CSSProperties.prototype.spaceGetDamping; -CSSProperties.prototype.spaceGetEnableContactGraph; -CSSProperties.prototype.spaceGetGravity; -CSSProperties.prototype.spaceGetIdleSpeedThreshold; -CSSProperties.prototype.spaceGetIterations; -CSSProperties.prototype.spaceGetSleepTimeThreshold; -CSSProperties.prototype.spaceGetStaticBody; -CSSProperties.prototype.spaceInit; -CSSProperties.prototype.spaceIsLocked; -CSSProperties.prototype.spaceNew; -CSSProperties.prototype.spacePointQueryFirst; -CSSProperties.prototype.spaceReindexShape; -CSSProperties.prototype.spaceReindexShapesForBody; -CSSProperties.prototype.spaceReindexStatic; -CSSProperties.prototype.spaceRemoveBody; -CSSProperties.prototype.spaceRemoveConstraint; -CSSProperties.prototype.spaceRemoveShape; -CSSProperties.prototype.spaceRemoveStaticShape; -CSSProperties.prototype.spaceSetCollisionBias; -CSSProperties.prototype.spaceSetCollisionPersistence; -CSSProperties.prototype.spaceSetCollisionSlop; -CSSProperties.prototype.spaceSetDamping; -CSSProperties.prototype.spaceSetEnableContactGraph; -CSSProperties.prototype.spaceSetGravity; -CSSProperties.prototype.spaceSetIdleSpeedThreshold; -CSSProperties.prototype.spaceSetIterations; -CSSProperties.prototype.spaceSetSleepTimeThreshold; -CSSProperties.prototype.spaceStep; -CSSProperties.prototype.spaceUseSpatialHash; -CSSProperties.prototype.fabs; -CSSProperties.prototype.fclamp; -CSSProperties.prototype.fclamp01; -CSSProperties.prototype.flerp; -CSSProperties.prototype.shapeGetSpace; -CSSProperties.prototype.flerpconst; -CSSProperties.prototype.fmax; -CSSProperties.prototype.fmin; -CSSProperties.prototype.vadd; -CSSProperties.prototype.vclamp; -CSSProperties.prototype.vcross; -CSSProperties.prototype.vdist; -CSSProperties.prototype.vdistsq; -CSSProperties.prototype.vdot; -CSSProperties.prototype.veql; -CSSProperties.prototype.vforangle; -CSSProperties.prototype.vlength; -CSSProperties.prototype.vlengthsq; -CSSProperties.prototype.vlerp; -CSSProperties.prototype.vlerpconst; -CSSProperties.prototype.vmult; -CSSProperties.prototype.vnear; -CSSProperties.prototype.vneg; -CSSProperties.prototype.vnormalize; -CSSProperties.prototype.vnormalize_safe; -CSSProperties.prototype.vperp; -CSSProperties.prototype.vproject; -CSSProperties.prototype.vrotate; -CSSProperties.prototype.vrperp; -CSSProperties.prototype.vslerp; -CSSProperties.prototype.vslerpconst; -CSSProperties.prototype.vsub; -CSSProperties.prototype.vtoangle; -CSSProperties.prototype.vunrotate; \ No newline at end of file diff --git a/cocos/scripting/javascript/bindings/obfuscate/obfuscate_exclude_cocos2d.js.REMOVED.git-id b/cocos/scripting/javascript/bindings/obfuscate/obfuscate_exclude_cocos2d.js.REMOVED.git-id deleted file mode 100644 index deca174a3f..0000000000 --- a/cocos/scripting/javascript/bindings/obfuscate/obfuscate_exclude_cocos2d.js.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -d62414960a7cab961eb6e4aebefe7d21828bd8e5 \ No newline at end of file diff --git a/cocos/scripting/javascript/bindings/spidermonkey_specifics.h b/cocos/scripting/javascript/bindings/spidermonkey_specifics.h index 6cb006b358..be9c709c49 100644 --- a/cocos/scripting/javascript/bindings/spidermonkey_specifics.h +++ b/cocos/scripting/javascript/bindings/spidermonkey_specifics.h @@ -2,7 +2,7 @@ #define __SPIDERMONKEY_SPECIFICS_H__ #include "jsapi.h" -#include "support/data_support/uthash.h" +#include "uthash.h" typedef struct js_proxy { void *ptr; diff --git a/samples/Javascript/TestJavascript/Classes/AppDelegate.cpp b/samples/Javascript/TestJavascript/Classes/AppDelegate.cpp index 5d81a72e32..51ebd8d85f 100644 --- a/samples/Javascript/TestJavascript/Classes/AppDelegate.cpp +++ b/samples/Javascript/TestJavascript/Classes/AppDelegate.cpp @@ -42,7 +42,7 @@ bool AppDelegate::applicationDidFinishLaunching() pDirector->setAnimationInterval(1.0 / 60); FileUtils::getInstance()->addSearchPath("res"); - FileUtils::getInstance()->addSearchPath("js"); + FileUtils::getInstance()->addSearchPath("script"); ScriptingCore* sc = ScriptingCore::getInstance(); sc->addRegisterCallback(register_all_cocos2dx); diff --git a/samples/Javascript/TestJavascript/game.js.REMOVED.git-id b/samples/Javascript/TestJavascript/game.js.REMOVED.git-id deleted file mode 100644 index fffc005595..0000000000 --- a/samples/Javascript/TestJavascript/game.js.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -d6662088eb795b38f78febad2e46bd92ef24fb56 \ No newline at end of file diff --git a/samples/Javascript/TestJavascript/obfuscate.xml b/samples/Javascript/TestJavascript/obfuscate.xml deleted file mode 100644 index 8c16f77347..0000000000 --- a/samples/Javascript/TestJavascript/obfuscate.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tools/tojs/cocos2dx.ini b/tools/tojs/cocos2dx.ini index f1075ca4a0..510440e508 100644 --- a/tools/tojs/cocos2dx.ini +++ b/tools/tojs/cocos2dx.ini @@ -13,16 +13,16 @@ android_flags = -D_SIZE_T_DEFINED_ clang_headers = -I%(clangllvmdir)s/lib/clang/3.3/include clang_flags = -nostdinc -x c++ -std=c++11 -cocos_headers = -I%(cocosdir)s/cocos2dx/include -I%(cocosdir)s/cocos2dx/platform -I%(cocosdir)s/cocos2dx/platform/android -I%(cocosdir)s/cocos2dx -I%(cocosdir)s/cocos2dx/kazmath/include +cocos_headers = -I%(cocosdir)s/cocos/2d -I%(cocosdir)s/cocos/base -I%(cocosdir)s/cocos/physics -I%(cocosdir)s/cocos/2d/platform -I%(cocosdir)s/cocos/2d/platform/android -I%(cocosdir)s/cocos/math/kazmath/include cocos_flags = -DANDROID -DCOCOS2D_JAVASCRIPT -cxxgenerator_headers = -I%(cxxgeneratordir)s/targets/spidermonkey/common +cxxgenerator_headers = # extra arguments for clang extra_arguments = %(android_headers)s %(clang_headers)s %(cxxgenerator_headers)s %(cocos_headers)s %(android_flags)s %(clang_flags)s %(cocos_flags)s %(extra_flags)s # what headers to parse -headers = %(cocosdir)s/cocos2dx/include/cocos2d.h %(cocosdir)s/audio/include/SimpleAudioEngine.h +headers = %(cocosdir)s/cocos/2d/cocos2d.h %(cocosdir)s/cocos/audio/include/SimpleAudioEngine.h # what classes to produce code for. You can use regular expressions here. When testing the regular # expression, it will be enclosed in "^$", like this: "^Menu*$". diff --git a/tools/tojs/cocos2dx_extension.ini b/tools/tojs/cocos2dx_extension.ini index a5170a5d86..1519b2eb92 100644 --- a/tools/tojs/cocos2dx_extension.ini +++ b/tools/tojs/cocos2dx_extension.ini @@ -13,16 +13,17 @@ android_flags = -D_SIZE_T_DEFINED_ clang_headers = -I%(clangllvmdir)s/lib/clang/3.3/include clang_flags = -nostdinc -x c++ -std=c++11 -cocos_headers = -I%(cocosdir)s/cocos2dx/include -I%(cocosdir)s/cocos2dx/platform -I%(cocosdir)s/cocos2dx/platform/android -I%(cocosdir)s/cocos2dx -I%(cocosdir)s/cocos2dx/kazmath/include -I%(cocosdir)s/extensions +cocos_headers = -I%(cocosdir)s/cocos/2d -I%(cocosdir)s/cocos/base -I%(cocosdir)s/cocos/gui -I%(cocosdir)s/cocos/physics -I%(cocosdir)s/cocos/2d/platform -I%(cocosdir)s/cocos/2d/platform/android -I%(cocosdir)s/cocos/math/kazmath/include -I%(cocosdir)s/extensions -I%(cocosdir)s/external -I%(cocosdir)s/cocos/editor-support -I%(cocosdir)s + cocos_flags = -DANDROID -DCOCOS2D_JAVASCRIPT -cxxgenerator_headers = -I%(cxxgeneratordir)s/targets/spidermonkey/common +cxxgenerator_headers = # extra arguments for clang extra_arguments = %(android_headers)s %(clang_headers)s %(cxxgenerator_headers)s %(cocos_headers)s %(android_flags)s %(clang_flags)s %(cocos_flags)s %(extra_flags)s # what headers to parse -headers = %(cocosdir)s/extensions/cocos-ext.h +headers = %(cocosdir)s/extensions/cocos-ext.h %(cocosdir)s/cocos/editor-support/cocosbuilder/CocosBuilder.h %(cocosdir)s/cocos/editor-support/cocostudio/CocoStudio.h # what classes to produce code for. You can use regular expressions here. When testing the regular # expression, it will be enclosed in "^$", like this: "^Menu*$". diff --git a/tools/tojs/genbindings.sh b/tools/tojs/genbindings.sh index 8801c65d1f..56b1b4500f 100755 --- a/tools/tojs/genbindings.sh +++ b/tools/tojs/genbindings.sh @@ -80,7 +80,7 @@ echo --- # Generate bindings for cocos2dx echo "Generating bindings for cocos2dx..." set -x -LD_LIBRARY_PATH=${CLANG_ROOT}/lib $PYTHON_BIN ${CXX_GENERATOR_ROOT}/generator.py ${TO_JS_ROOT}/cocos2dx.ini -s cocos2d-x -t spidermonkey -o ${COCOS2DX_ROOT}/scripting/auto-generated/js-bindings -n jsb_cocos2dx_auto +LD_LIBRARY_PATH=${CLANG_ROOT}/lib $PYTHON_BIN ${CXX_GENERATOR_ROOT}/generator.py ${TO_JS_ROOT}/cocos2dx.ini -s cocos2d-x -t spidermonkey -o ${COCOS2DX_ROOT}/cocos/scripting/auto-generated/js-bindings -n jsb_cocos2dx_auto echo "Generating bindings for cocos2dx_extension..." -LD_LIBRARY_PATH=${CLANG_ROOT}/lib $PYTHON_BIN ${CXX_GENERATOR_ROOT}/generator.py ${TO_JS_ROOT}/cocos2dx_extension.ini -s cocos2dx_extension -t spidermonkey -o ${COCOS2DX_ROOT}/scripting/auto-generated/js-bindings -n jsb_cocos2dx_extension_auto +LD_LIBRARY_PATH=${CLANG_ROOT}/lib $PYTHON_BIN ${CXX_GENERATOR_ROOT}/generator.py ${TO_JS_ROOT}/cocos2dx_extension.ini -s cocos2dx_extension -t spidermonkey -o ${COCOS2DX_ROOT}/cocos/scripting/auto-generated/js-bindings -n jsb_cocos2dx_extension_auto From 00ee4160064f682a436eb4e1c6386f5bdad51d55 Mon Sep 17 00:00:00 2001 From: James Chen Date: Wed, 16 Oct 2013 16:21:55 +0800 Subject: [PATCH 42/64] issue #2905: [iOS Mac] All js games work now. --- build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id | 2 +- samples/Javascript/CocosDragonJS/Classes/AppDelegate.cpp | 2 ++ samples/Javascript/CrystalCraze/Classes/AppDelegate.cpp | 3 ++- samples/Javascript/MoonWarriors/Classes/AppDelegate.cpp | 2 +- samples/Javascript/WatermelonWithMe/Classes/AppDelegate.cpp | 2 ++ 5 files changed, 8 insertions(+), 3 deletions(-) diff --git a/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id b/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id index 5be8a11389..cc5cbe86bf 100644 --- a/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -eb61a6b65e5947b285b970192a8d0c129f807556 \ No newline at end of file +a4c6fec549057de458346127f489e6e6bea2f0d1 \ No newline at end of file diff --git a/samples/Javascript/CocosDragonJS/Classes/AppDelegate.cpp b/samples/Javascript/CocosDragonJS/Classes/AppDelegate.cpp index 3530e7e4fe..3276d5deda 100644 --- a/samples/Javascript/CocosDragonJS/Classes/AppDelegate.cpp +++ b/samples/Javascript/CocosDragonJS/Classes/AppDelegate.cpp @@ -36,6 +36,8 @@ bool AppDelegate::applicationDidFinishLaunching() pDirector->setProjection(Director::Projection::_2D); + FileUtils::getInstance()->addSearchPath("script"); + auto screenSize = EGLView::getInstance()->getFrameSize(); auto designSize = Size(320, 480); diff --git a/samples/Javascript/CrystalCraze/Classes/AppDelegate.cpp b/samples/Javascript/CrystalCraze/Classes/AppDelegate.cpp index 5b607d407c..27520db220 100644 --- a/samples/Javascript/CrystalCraze/Classes/AppDelegate.cpp +++ b/samples/Javascript/CrystalCraze/Classes/AppDelegate.cpp @@ -31,13 +31,14 @@ bool AppDelegate::applicationDidFinishLaunching() pDirector->setOpenGLView(EGLView::getInstance()); pDirector->setProjection(Director::Projection::_2D); + FileUtils::getInstance()->addSearchPath("script"); auto screenSize = EGLView::getInstance()->getFrameSize(); auto designSize = Size(320, 480); auto resourceSize = Size(320, 480); - std::vector searchPaths; + std::vector searchPaths = FileUtils::getInstance()->getSearchPaths(); std::vector resDirOrders; Application::Platform platform = Application::getInstance()->getTargetPlatform(); diff --git a/samples/Javascript/MoonWarriors/Classes/AppDelegate.cpp b/samples/Javascript/MoonWarriors/Classes/AppDelegate.cpp index 0f69f2cff7..7e7a33a156 100644 --- a/samples/Javascript/MoonWarriors/Classes/AppDelegate.cpp +++ b/samples/Javascript/MoonWarriors/Classes/AppDelegate.cpp @@ -40,7 +40,7 @@ bool AppDelegate::applicationDidFinishLaunching() // set FPS. the default value is 1.0/60 if you don't call this pDirector->setAnimationInterval(1.0 / 60); - FileUtils::getInstance()->addSearchPath("js"); + FileUtils::getInstance()->addSearchPath("script"); ScriptingCore* sc = ScriptingCore::getInstance(); sc->addRegisterCallback(register_all_cocos2dx); diff --git a/samples/Javascript/WatermelonWithMe/Classes/AppDelegate.cpp b/samples/Javascript/WatermelonWithMe/Classes/AppDelegate.cpp index dcfdb8e970..3e9c616b35 100644 --- a/samples/Javascript/WatermelonWithMe/Classes/AppDelegate.cpp +++ b/samples/Javascript/WatermelonWithMe/Classes/AppDelegate.cpp @@ -38,6 +38,8 @@ bool AppDelegate::applicationDidFinishLaunching() EGLView::getInstance()->setDesignResolutionSize(480, 320, ResolutionPolicy::FIXED_HEIGHT); + FileUtils::getInstance()->addSearchPath("script"); + ScriptingCore* sc = ScriptingCore::getInstance(); sc->addRegisterCallback(register_all_cocos2dx); sc->addRegisterCallback(register_all_cocos2dx_extension); From 5c5f2d84e2a1d4018fa5311c029a9b5591bf79c3 Mon Sep 17 00:00:00 2001 From: James Chen Date: Wed, 16 Oct 2013 16:27:45 +0800 Subject: [PATCH 43/64] issue #2905: Updating tolua settings. --- tools/tolua/cocos2dx.ini | 6 +++--- tools/tolua/cocos2dx_extension.ini | 6 +++--- tools/tolua/genbindings.sh | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tools/tolua/cocos2dx.ini b/tools/tolua/cocos2dx.ini index cc59df0bdb..8721cdba4f 100644 --- a/tools/tolua/cocos2dx.ini +++ b/tools/tolua/cocos2dx.ini @@ -13,16 +13,16 @@ android_flags = -D_SIZE_T_DEFINED_ clang_headers = -I%(clangllvmdir)s/lib/clang/3.3/include clang_flags = -nostdinc -x c++ -std=c++11 -cocos_headers = -I%(cocosdir)s/cocos2dx/include -I%(cocosdir)s/cocos2dx/platform -I%(cocosdir)s/cocos2dx/platform/android -I%(cocosdir)s/cocos2dx -I%(cocosdir)s/cocos2dx/kazmath/include +cocos_headers = -I%(cocosdir)s/cocos/2d -I%(cocosdir)s/cocos/base -I%(cocosdir)s/cocos/physics -I%(cocosdir)s/cocos/2d/platform -I%(cocosdir)s/cocos/2d/platform/android -I%(cocosdir)s/cocos/math/kazmath/include cocos_flags = -DANDROID -DCOCOS2D_JAVASCRIPT -cxxgenerator_headers = -I%(cxxgeneratordir)s/targets/spidermonkey/common +cxxgenerator_headers = # extra arguments for clang extra_arguments = %(android_headers)s %(clang_headers)s %(cxxgenerator_headers)s %(cocos_headers)s %(android_flags)s %(clang_flags)s %(cocos_flags)s %(extra_flags)s # what headers to parse -headers = %(cocosdir)s/cocos2dx/include/cocos2d.h %(cocosdir)s/audio/include/SimpleAudioEngine.h +headers = %(cocosdir)s/cocos/2d/cocos2d.h %(cocosdir)s/cocos/audio/include/SimpleAudioEngine.h # what classes to produce code for. You can use regular expressions here. When testing the regular # expression, it will be enclosed in "^$", like this: "^Menu*$". diff --git a/tools/tolua/cocos2dx_extension.ini b/tools/tolua/cocos2dx_extension.ini index ce914cf508..67d87c51d6 100644 --- a/tools/tolua/cocos2dx_extension.ini +++ b/tools/tolua/cocos2dx_extension.ini @@ -13,16 +13,16 @@ android_flags = -D_SIZE_T_DEFINED_ clang_headers = -I%(clangllvmdir)s/lib/clang/3.3/include clang_flags = -nostdinc -x c++ -std=c++11 -cocos_headers = -I%(cocosdir)s/cocos2dx/include -I%(cocosdir)s/cocos2dx/platform -I%(cocosdir)s/cocos2dx/platform/android -I%(cocosdir)s/cocos2dx -I%(cocosdir)s/cocos2dx/kazmath/include -I%(cocosdir)s/extensions +cocos_headers = -I%(cocosdir)s/cocos/2d -I%(cocosdir)s/cocos/base -I%(cocosdir)s/cocos/gui -I%(cocosdir)s/cocos/physics -I%(cocosdir)s/cocos/2d/platform -I%(cocosdir)s/cocos/2d/platform/android -I%(cocosdir)s/cocos/math/kazmath/include -I%(cocosdir)s/extensions -I%(cocosdir)s/external -I%(cocosdir)s/cocos/editor-support -I%(cocosdir)s cocos_flags = -DANDROID -DCOCOS2D_JAVASCRIPT -cxxgenerator_headers = -I%(cxxgeneratordir)s/targets/spidermonkey/common +cxxgenerator_headers = # extra arguments for clang extra_arguments = %(android_headers)s %(clang_headers)s %(cxxgenerator_headers)s %(cocos_headers)s %(android_flags)s %(clang_flags)s %(cocos_flags)s %(extra_flags)s # what headers to parse -headers = %(cocosdir)s/extensions/cocos-ext.h +headers = %(cocosdir)s/extensions/cocos-ext.h %(cocosdir)s/cocos/editor-support/cocosbuilder/CocosBuilder.h %(cocosdir)s/cocos/editor-support/cocostudio/CocoStudio.h # what classes to produce code for. You can use regular expressions here. When testing the regular # expression, it will be enclosed in "^$", like this: "^Menu*$". diff --git a/tools/tolua/genbindings.sh b/tools/tolua/genbindings.sh index ba6033c7fc..b236c43ae8 100755 --- a/tools/tolua/genbindings.sh +++ b/tools/tolua/genbindings.sh @@ -80,7 +80,7 @@ echo --- # Generate bindings for cocos2dx echo "Generating bindings for cocos2dx..." set -x -LD_LIBRARY_PATH=${CLANG_ROOT}/lib $PYTHON_BIN ${CXX_GENERATOR_ROOT}/generator.py ${TO_JS_ROOT}/cocos2dx.ini -s cocos2d-x -t lua -o ${COCOS2DX_ROOT}/scripting/auto-generated/lua-bindings -n lua_cocos2dx_auto +LD_LIBRARY_PATH=${CLANG_ROOT}/lib $PYTHON_BIN ${CXX_GENERATOR_ROOT}/generator.py ${TO_JS_ROOT}/cocos2dx.ini -s cocos2d-x -t lua -o ${COCOS2DX_ROOT}/cocos/scripting/auto-generated/lua-bindings -n lua_cocos2dx_auto echo "Generating bindings for cocos2dx_extension..." -LD_LIBRARY_PATH=${CLANG_ROOT}/lib $PYTHON_BIN ${CXX_GENERATOR_ROOT}/generator.py ${TO_JS_ROOT}/cocos2dx_extension.ini -s cocos2dx_extension -t lua -o ${COCOS2DX_ROOT}/scripting/auto-generated/lua-bindings -n lua_cocos2dx_extension_auto +LD_LIBRARY_PATH=${CLANG_ROOT}/lib $PYTHON_BIN ${CXX_GENERATOR_ROOT}/generator.py ${TO_JS_ROOT}/cocos2dx_extension.ini -s cocos2dx_extension -t lua -o ${COCOS2DX_ROOT}/cocos/scripting/auto-generated/lua-bindings -n lua_cocos2dx_extension_auto From 352d1f676808706e1ec032f3ec1801c584614e4a Mon Sep 17 00:00:00 2001 From: James Chen Date: Wed, 16 Oct 2013 16:40:07 +0800 Subject: [PATCH 44/64] issue #2905: Renaming lua/cocos2dx_support to lua/bindings. --- cocos/scripting/lua/{proj.linux => bindings}/.cproject | 0 cocos/scripting/lua/{proj.linux => bindings}/.project | 0 cocos/scripting/lua/{proj.android => bindings}/Android.mk | 0 .../lua/{cocos2dx_support => bindings}/CCBProxy.cpp | 0 .../lua/{cocos2dx_support => bindings}/CCBProxy.h | 0 .../lua/{cocos2dx_support => bindings}/CCLuaBridge.cpp | 0 .../lua/{cocos2dx_support => bindings}/CCLuaBridge.h | 0 .../lua/{cocos2dx_support => bindings}/CCLuaEngine.cpp | 0 .../lua/{cocos2dx_support => bindings}/CCLuaEngine.h | 0 .../lua/{cocos2dx_support => bindings}/CCLuaStack.cpp | 0 .../lua/{cocos2dx_support => bindings}/CCLuaStack.h | 0 .../lua/{cocos2dx_support => bindings}/CCLuaValue.cpp | 0 .../lua/{cocos2dx_support => bindings}/CCLuaValue.h | 0 .../{cocos2dx_support => bindings}/Cocos2dxLuaLoader.cpp | 0 .../lua/{cocos2dx_support => bindings}/Cocos2dxLuaLoader.h | 0 .../{cocos2dx_support => bindings}/LuaBasicConversions.cpp | 0 .../{cocos2dx_support => bindings}/LuaBasicConversions.h | 0 .../LuaOpengl.cpp.REMOVED.git-id | 0 .../lua/{cocos2dx_support => bindings}/LuaOpengl.h | 0 .../{cocos2dx_support => bindings}/LuaScriptHandlerMgr.cpp | 0 .../{cocos2dx_support => bindings}/LuaScriptHandlerMgr.h | 0 .../lua/{cocos2dx_support => bindings}/Lua_web_socket.cpp | 0 .../lua/{cocos2dx_support => bindings}/Lua_web_socket.h | 0 cocos/scripting/lua/{proj.linux => bindings}/Makefile | 0 .../scripting/lua/{proj.win32 => bindings}/liblua.vcxproj | 0 .../lua/{proj.win32 => bindings}/liblua.vcxproj.filters | 0 .../lua/{proj.win32 => bindings}/liblua.vcxproj.user | 0 .../lua_cocos2dx_deprecated.cpp.REMOVED.git-id | 0 .../lua_cocos2dx_deprecated.h | 0 .../lua_cocos2dx_extension_manual.cpp | 0 .../lua_cocos2dx_extension_manual.h | 0 .../{cocos2dx_support => bindings}/lua_cocos2dx_manual.cpp | 0 .../{cocos2dx_support => bindings}/lua_cocos2dx_manual.hpp | 0 .../platform/android/CCLuaJavaBridge.cpp | 0 .../platform/android/CCLuaJavaBridge.h | 0 .../jni/Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge.cpp | 0 .../jni/Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge.h | 0 .../platform/ios/CCLuaObjcBridge.h | 0 .../platform/ios/CCLuaObjcBridge.mm | 0 .../lua/{cocos2dx_support => bindings}/tolua_fix.c | 0 .../lua/{cocos2dx_support => bindings}/tolua_fix.h | 0 cocos/scripting/lua/proj.ios/luabindings-Prefix.pch | 7 ------- {cocos/scripting => external}/lua/lua/lapi.c | 0 {cocos/scripting => external}/lua/lua/lapi.h | 0 {cocos/scripting => external}/lua/lua/lauxlib.c | 0 {cocos/scripting => external}/lua/lua/lauxlib.h | 0 {cocos/scripting => external}/lua/lua/lbaselib.c | 0 {cocos/scripting => external}/lua/lua/lcode.c | 0 {cocos/scripting => external}/lua/lua/lcode.h | 0 {cocos/scripting => external}/lua/lua/ldblib.c | 0 {cocos/scripting => external}/lua/lua/ldebug.c | 0 {cocos/scripting => external}/lua/lua/ldebug.h | 0 {cocos/scripting => external}/lua/lua/ldo.c | 0 {cocos/scripting => external}/lua/lua/ldo.h | 0 {cocos/scripting => external}/lua/lua/ldump.c | 0 {cocos/scripting => external}/lua/lua/lfunc.c | 0 {cocos/scripting => external}/lua/lua/lfunc.h | 0 {cocos/scripting => external}/lua/lua/lgc.c | 0 {cocos/scripting => external}/lua/lua/lgc.h | 0 {cocos/scripting => external}/lua/lua/linit.c | 0 {cocos/scripting => external}/lua/lua/liolib.c | 0 {cocos/scripting => external}/lua/lua/llex.c | 0 {cocos/scripting => external}/lua/lua/llex.h | 0 {cocos/scripting => external}/lua/lua/llimits.h | 0 {cocos/scripting => external}/lua/lua/lmathlib.c | 0 {cocos/scripting => external}/lua/lua/lmem.c | 0 {cocos/scripting => external}/lua/lua/lmem.h | 0 {cocos/scripting => external}/lua/lua/loadlib.c | 0 {cocos/scripting => external}/lua/lua/lobject.c | 0 {cocos/scripting => external}/lua/lua/lobject.h | 0 {cocos/scripting => external}/lua/lua/lopcodes.c | 0 {cocos/scripting => external}/lua/lua/lopcodes.h | 0 {cocos/scripting => external}/lua/lua/loslib.c | 0 {cocos/scripting => external}/lua/lua/lparser.c | 0 {cocos/scripting => external}/lua/lua/lparser.h | 0 {cocos/scripting => external}/lua/lua/lstate.c | 0 {cocos/scripting => external}/lua/lua/lstate.h | 0 {cocos/scripting => external}/lua/lua/lstring.c | 0 {cocos/scripting => external}/lua/lua/lstring.h | 0 {cocos/scripting => external}/lua/lua/lstrlib.c | 0 {cocos/scripting => external}/lua/lua/ltable.c | 0 {cocos/scripting => external}/lua/lua/ltable.h | 0 {cocos/scripting => external}/lua/lua/ltablib.c | 0 {cocos/scripting => external}/lua/lua/ltm.c | 0 {cocos/scripting => external}/lua/lua/ltm.h | 0 {cocos/scripting => external}/lua/lua/lua.c | 0 {cocos/scripting => external}/lua/lua/lua.h | 0 {cocos/scripting => external}/lua/lua/luaconf.h | 0 {cocos/scripting => external}/lua/lua/lualib.h | 0 {cocos/scripting => external}/lua/lua/lundump.c | 0 {cocos/scripting => external}/lua/lua/lundump.h | 0 {cocos/scripting => external}/lua/lua/lvm.c | 0 {cocos/scripting => external}/lua/lua/lvm.h | 0 {cocos/scripting => external}/lua/lua/lzio.c | 0 {cocos/scripting => external}/lua/lua/lzio.h | 0 {cocos/scripting => external}/lua/lua/print.c | 0 {cocos/scripting => external}/lua/luajit/Android.mk | 0 .../lua/luajit/LuaJIT-2.0.1/COPYRIGHT | 0 .../lua/luajit/LuaJIT-2.0.1/Makefile | 0 .../scripting => external}/lua/luajit/LuaJIT-2.0.1/README | 0 .../lua/luajit/LuaJIT-2.0.1/doc/bluequad-print.css | 0 .../lua/luajit/LuaJIT-2.0.1/doc/bluequad.css | 0 .../lua/luajit/LuaJIT-2.0.1/doc/changes.html | 0 .../lua/luajit/LuaJIT-2.0.1/doc/contact.html | 0 .../lua/luajit/LuaJIT-2.0.1/doc/ext_c_api.html | 0 .../lua/luajit/LuaJIT-2.0.1/doc/ext_ffi.html | 0 .../lua/luajit/LuaJIT-2.0.1/doc/ext_ffi_api.html | 0 .../lua/luajit/LuaJIT-2.0.1/doc/ext_ffi_semantics.html | 0 .../lua/luajit/LuaJIT-2.0.1/doc/ext_ffi_tutorial.html | 0 .../lua/luajit/LuaJIT-2.0.1/doc/ext_jit.html | 0 .../lua/luajit/LuaJIT-2.0.1/doc/extensions.html | 0 .../lua/luajit/LuaJIT-2.0.1/doc/faq.html | 0 .../lua/luajit/LuaJIT-2.0.1/doc/install.html | 0 .../lua/luajit/LuaJIT-2.0.1/doc/luajit.html | 0 .../lua/luajit/LuaJIT-2.0.1/doc/running.html | 0 .../lua/luajit/LuaJIT-2.0.1/doc/status.html | 0 .../lua/luajit/LuaJIT-2.0.1/dynasm/dasm_arm.h | 0 .../lua/luajit/LuaJIT-2.0.1/dynasm/dasm_arm.lua | 0 .../lua/luajit/LuaJIT-2.0.1/dynasm/dasm_mips.h | 0 .../lua/luajit/LuaJIT-2.0.1/dynasm/dasm_mips.lua | 0 .../lua/luajit/LuaJIT-2.0.1/dynasm/dasm_ppc.h | 0 .../lua/luajit/LuaJIT-2.0.1/dynasm/dasm_ppc.lua | 0 .../lua/luajit/LuaJIT-2.0.1/dynasm/dasm_proto.h | 0 .../lua/luajit/LuaJIT-2.0.1/dynasm/dasm_x64.lua | 0 .../lua/luajit/LuaJIT-2.0.1/dynasm/dasm_x86.h | 0 .../lua/luajit/LuaJIT-2.0.1/dynasm/dasm_x86.lua | 0 .../lua/luajit/LuaJIT-2.0.1/dynasm/dynasm.lua | 0 .../lua/luajit/LuaJIT-2.0.1/etc/luajit.1 | 0 .../lua/luajit/LuaJIT-2.0.1/etc/luajit.pc | 0 .../lua/luajit/LuaJIT-2.0.1/src/Makefile | 0 .../lua/luajit/LuaJIT-2.0.1/src/Makefile.dep | 0 .../lua/luajit/LuaJIT-2.0.1/src/host/README | 0 .../lua/luajit/LuaJIT-2.0.1/src/host/buildvm.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/host/buildvm.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/host/buildvm_asm.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/host/buildvm_fold.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/host/buildvm_lib.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/host/buildvm_peobj.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/host/genminilua.lua | 0 .../luajit/LuaJIT-2.0.1/src/host/minilua.c.REMOVED.git-id | 0 .../lua/luajit/LuaJIT-2.0.1/src/jit/bc.lua | 0 .../lua/luajit/LuaJIT-2.0.1/src/jit/bcsave.lua | 0 .../lua/luajit/LuaJIT-2.0.1/src/jit/dis_arm.lua | 0 .../lua/luajit/LuaJIT-2.0.1/src/jit/dis_mips.lua | 0 .../lua/luajit/LuaJIT-2.0.1/src/jit/dis_mipsel.lua | 0 .../lua/luajit/LuaJIT-2.0.1/src/jit/dis_ppc.lua | 0 .../lua/luajit/LuaJIT-2.0.1/src/jit/dis_x64.lua | 0 .../lua/luajit/LuaJIT-2.0.1/src/jit/dis_x86.lua | 0 .../lua/luajit/LuaJIT-2.0.1/src/jit/dump.lua | 0 .../lua/luajit/LuaJIT-2.0.1/src/jit/v.lua | 0 .../lua/luajit/LuaJIT-2.0.1/src/lauxlib.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lib_aux.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lib_base.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lib_bit.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lib_debug.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lib_ffi.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lib_init.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lib_io.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lib_jit.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lib_math.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lib_os.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lib_package.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lib_string.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lib_table.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj.supp | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_alloc.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_alloc.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_api.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_arch.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_asm.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_asm.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_asm_arm.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_asm_mips.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_asm_ppc.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_asm_x86.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_bc.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_bc.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_bcdump.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_bcread.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_bcwrite.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_carith.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_carith.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_ccall.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_ccall.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_ccallback.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_ccallback.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_cconv.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_cconv.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_cdata.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_cdata.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_char.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_char.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_clib.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_clib.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_cparse.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_cparse.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_crecord.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_crecord.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_ctype.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_ctype.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_debug.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_debug.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_def.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_dispatch.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_dispatch.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_emit_arm.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_emit_mips.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_emit_ppc.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_emit_x86.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_err.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_err.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_errmsg.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_ff.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_ffrecord.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_ffrecord.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_frame.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_func.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_func.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_gc.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_gc.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_gdbjit.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_gdbjit.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_ir.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_ir.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_ircall.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_iropt.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_jit.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_lex.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_lex.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_lib.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_lib.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_load.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_mcode.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_mcode.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_meta.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_meta.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_obj.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_obj.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_opt_dce.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_opt_fold.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_opt_loop.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_opt_mem.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_opt_narrow.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_opt_sink.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_opt_split.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_parse.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_parse.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_record.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_record.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_snap.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_snap.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_state.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_state.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_str.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_str.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_strscan.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_strscan.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_tab.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_tab.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_target.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_target_arm.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_target_mips.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_target_ppc.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_target_x86.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_trace.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_trace.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_traceerr.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_udata.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_udata.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_vm.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_vmevent.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_vmevent.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lj_vmmath.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/ljamalg.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/lua.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lua.hpp | 0 .../lua/luajit/LuaJIT-2.0.1/src/luaconf.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/luajit.c | 0 .../lua/luajit/LuaJIT-2.0.1/src/luajit.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/lualib.h | 0 .../lua/luajit/LuaJIT-2.0.1/src/msvcbuild.bat | 0 .../lua/luajit/LuaJIT-2.0.1/src/vm_arm.dasc.REMOVED.git-id | 0 .../luajit/LuaJIT-2.0.1/src/vm_mips.dasc.REMOVED.git-id | 0 .../lua/luajit/LuaJIT-2.0.1/src/vm_ppc.dasc.REMOVED.git-id | 0 .../luajit/LuaJIT-2.0.1/src/vm_ppcspe.dasc.REMOVED.git-id | 0 .../lua/luajit/LuaJIT-2.0.1/src/vm_x86.dasc.REMOVED.git-id | 0 .../lua/luajit/LuaJIT-2.0.1/src/xedkbuild.bat | 0 .../lua/luajit/LuaJIT-2.0.1/v2.0.1_hotfix1.patch | 0 .../luajit/android/armeabi-v7a/libluajit.a.REMOVED.git-id | 0 .../lua/luajit/android/armeabi/libluajit.a.REMOVED.git-id | 0 .../lua/luajit/android/x86/libluajit.a.REMOVED.git-id | 0 {cocos/scripting => external}/lua/luajit/build_android.sh | 0 {cocos/scripting => external}/lua/luajit/build_ios.sh | 0 {cocos/scripting => external}/lua/luajit/build_mac.sh | 0 {cocos/scripting => external}/lua/luajit/include/lauxlib.h | 0 {cocos/scripting => external}/lua/luajit/include/lua.h | 0 {cocos/scripting => external}/lua/luajit/include/luaconf.h | 0 {cocos/scripting => external}/lua/luajit/include/lualib.h | 0 .../lua/luajit/ios/libluajit.a.REMOVED.git-id | 0 .../lua/luajit/mac/libluajit.a.REMOVED.git-id | 0 .../lua/luajit/win32/lua51.dll.REMOVED.git-id | 0 {cocos/scripting => external}/lua/tolua/tolua++.h | 0 {cocos/scripting => external}/lua/tolua/tolua_event.c | 0 {cocos/scripting => external}/lua/tolua/tolua_event.h | 0 {cocos/scripting => external}/lua/tolua/tolua_is.c | 0 {cocos/scripting => external}/lua/tolua/tolua_map.c | 0 {cocos/scripting => external}/lua/tolua/tolua_push.c | 0 {cocos/scripting => external}/lua/tolua/tolua_to.c | 0 308 files changed, 7 deletions(-) rename cocos/scripting/lua/{proj.linux => bindings}/.cproject (100%) rename cocos/scripting/lua/{proj.linux => bindings}/.project (100%) rename cocos/scripting/lua/{proj.android => bindings}/Android.mk (100%) rename cocos/scripting/lua/{cocos2dx_support => bindings}/CCBProxy.cpp (100%) rename cocos/scripting/lua/{cocos2dx_support => bindings}/CCBProxy.h (100%) rename cocos/scripting/lua/{cocos2dx_support => bindings}/CCLuaBridge.cpp (100%) rename cocos/scripting/lua/{cocos2dx_support => bindings}/CCLuaBridge.h (100%) rename cocos/scripting/lua/{cocos2dx_support => bindings}/CCLuaEngine.cpp (100%) rename cocos/scripting/lua/{cocos2dx_support => bindings}/CCLuaEngine.h (100%) rename cocos/scripting/lua/{cocos2dx_support => bindings}/CCLuaStack.cpp (100%) rename cocos/scripting/lua/{cocos2dx_support => bindings}/CCLuaStack.h (100%) rename cocos/scripting/lua/{cocos2dx_support => bindings}/CCLuaValue.cpp (100%) rename cocos/scripting/lua/{cocos2dx_support => bindings}/CCLuaValue.h (100%) rename cocos/scripting/lua/{cocos2dx_support => bindings}/Cocos2dxLuaLoader.cpp (100%) rename cocos/scripting/lua/{cocos2dx_support => bindings}/Cocos2dxLuaLoader.h (100%) rename cocos/scripting/lua/{cocos2dx_support => bindings}/LuaBasicConversions.cpp (100%) rename cocos/scripting/lua/{cocos2dx_support => bindings}/LuaBasicConversions.h (100%) rename cocos/scripting/lua/{cocos2dx_support => bindings}/LuaOpengl.cpp.REMOVED.git-id (100%) rename cocos/scripting/lua/{cocos2dx_support => bindings}/LuaOpengl.h (100%) rename cocos/scripting/lua/{cocos2dx_support => bindings}/LuaScriptHandlerMgr.cpp (100%) rename cocos/scripting/lua/{cocos2dx_support => bindings}/LuaScriptHandlerMgr.h (100%) rename cocos/scripting/lua/{cocos2dx_support => bindings}/Lua_web_socket.cpp (100%) rename cocos/scripting/lua/{cocos2dx_support => bindings}/Lua_web_socket.h (100%) rename cocos/scripting/lua/{proj.linux => bindings}/Makefile (100%) rename cocos/scripting/lua/{proj.win32 => bindings}/liblua.vcxproj (100%) rename cocos/scripting/lua/{proj.win32 => bindings}/liblua.vcxproj.filters (100%) rename cocos/scripting/lua/{proj.win32 => bindings}/liblua.vcxproj.user (100%) rename cocos/scripting/lua/{cocos2dx_support => bindings}/lua_cocos2dx_deprecated.cpp.REMOVED.git-id (100%) rename cocos/scripting/lua/{cocos2dx_support => bindings}/lua_cocos2dx_deprecated.h (100%) rename cocos/scripting/lua/{cocos2dx_support => bindings}/lua_cocos2dx_extension_manual.cpp (100%) rename cocos/scripting/lua/{cocos2dx_support => bindings}/lua_cocos2dx_extension_manual.h (100%) rename cocos/scripting/lua/{cocos2dx_support => bindings}/lua_cocos2dx_manual.cpp (100%) rename cocos/scripting/lua/{cocos2dx_support => bindings}/lua_cocos2dx_manual.hpp (100%) rename cocos/scripting/lua/{cocos2dx_support => bindings}/platform/android/CCLuaJavaBridge.cpp (100%) rename cocos/scripting/lua/{cocos2dx_support => bindings}/platform/android/CCLuaJavaBridge.h (100%) rename cocos/scripting/lua/{cocos2dx_support => bindings}/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge.cpp (100%) rename cocos/scripting/lua/{cocos2dx_support => bindings}/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge.h (100%) rename cocos/scripting/lua/{cocos2dx_support => bindings}/platform/ios/CCLuaObjcBridge.h (100%) rename cocos/scripting/lua/{cocos2dx_support => bindings}/platform/ios/CCLuaObjcBridge.mm (100%) rename cocos/scripting/lua/{cocos2dx_support => bindings}/tolua_fix.c (100%) rename cocos/scripting/lua/{cocos2dx_support => bindings}/tolua_fix.h (100%) delete mode 100644 cocos/scripting/lua/proj.ios/luabindings-Prefix.pch rename {cocos/scripting => external}/lua/lua/lapi.c (100%) rename {cocos/scripting => external}/lua/lua/lapi.h (100%) rename {cocos/scripting => external}/lua/lua/lauxlib.c (100%) rename {cocos/scripting => external}/lua/lua/lauxlib.h (100%) rename {cocos/scripting => external}/lua/lua/lbaselib.c (100%) rename {cocos/scripting => external}/lua/lua/lcode.c (100%) rename {cocos/scripting => external}/lua/lua/lcode.h (100%) rename {cocos/scripting => external}/lua/lua/ldblib.c (100%) rename {cocos/scripting => external}/lua/lua/ldebug.c (100%) rename {cocos/scripting => external}/lua/lua/ldebug.h (100%) rename {cocos/scripting => external}/lua/lua/ldo.c (100%) rename {cocos/scripting => external}/lua/lua/ldo.h (100%) rename {cocos/scripting => external}/lua/lua/ldump.c (100%) rename {cocos/scripting => external}/lua/lua/lfunc.c (100%) rename {cocos/scripting => external}/lua/lua/lfunc.h (100%) rename {cocos/scripting => external}/lua/lua/lgc.c (100%) rename {cocos/scripting => external}/lua/lua/lgc.h (100%) rename {cocos/scripting => external}/lua/lua/linit.c (100%) rename {cocos/scripting => external}/lua/lua/liolib.c (100%) rename {cocos/scripting => external}/lua/lua/llex.c (100%) rename {cocos/scripting => external}/lua/lua/llex.h (100%) rename {cocos/scripting => external}/lua/lua/llimits.h (100%) rename {cocos/scripting => external}/lua/lua/lmathlib.c (100%) rename {cocos/scripting => external}/lua/lua/lmem.c (100%) rename {cocos/scripting => external}/lua/lua/lmem.h (100%) rename {cocos/scripting => external}/lua/lua/loadlib.c (100%) rename {cocos/scripting => external}/lua/lua/lobject.c (100%) rename {cocos/scripting => external}/lua/lua/lobject.h (100%) rename {cocos/scripting => external}/lua/lua/lopcodes.c (100%) rename {cocos/scripting => external}/lua/lua/lopcodes.h (100%) rename {cocos/scripting => external}/lua/lua/loslib.c (100%) rename {cocos/scripting => external}/lua/lua/lparser.c (100%) rename {cocos/scripting => external}/lua/lua/lparser.h (100%) rename {cocos/scripting => external}/lua/lua/lstate.c (100%) rename {cocos/scripting => external}/lua/lua/lstate.h (100%) rename {cocos/scripting => external}/lua/lua/lstring.c (100%) rename {cocos/scripting => external}/lua/lua/lstring.h (100%) rename {cocos/scripting => external}/lua/lua/lstrlib.c (100%) rename {cocos/scripting => external}/lua/lua/ltable.c (100%) rename {cocos/scripting => external}/lua/lua/ltable.h (100%) rename {cocos/scripting => external}/lua/lua/ltablib.c (100%) rename {cocos/scripting => external}/lua/lua/ltm.c (100%) rename {cocos/scripting => external}/lua/lua/ltm.h (100%) rename {cocos/scripting => external}/lua/lua/lua.c (100%) rename {cocos/scripting => external}/lua/lua/lua.h (100%) rename {cocos/scripting => external}/lua/lua/luaconf.h (100%) rename {cocos/scripting => external}/lua/lua/lualib.h (100%) rename {cocos/scripting => external}/lua/lua/lundump.c (100%) rename {cocos/scripting => external}/lua/lua/lundump.h (100%) rename {cocos/scripting => external}/lua/lua/lvm.c (100%) rename {cocos/scripting => external}/lua/lua/lvm.h (100%) rename {cocos/scripting => external}/lua/lua/lzio.c (100%) rename {cocos/scripting => external}/lua/lua/lzio.h (100%) rename {cocos/scripting => external}/lua/lua/print.c (100%) rename {cocos/scripting => external}/lua/luajit/Android.mk (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/COPYRIGHT (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/Makefile (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/README (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/doc/bluequad-print.css (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/doc/bluequad.css (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/doc/changes.html (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/doc/contact.html (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/doc/ext_c_api.html (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/doc/ext_ffi.html (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/doc/ext_ffi_api.html (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/doc/ext_ffi_semantics.html (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/doc/ext_ffi_tutorial.html (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/doc/ext_jit.html (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/doc/extensions.html (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/doc/faq.html (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/doc/install.html (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/doc/luajit.html (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/doc/running.html (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/doc/status.html (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_arm.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_arm.lua (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_mips.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_mips.lua (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_ppc.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_ppc.lua (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_proto.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_x64.lua (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_x86.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_x86.lua (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/dynasm/dynasm.lua (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/etc/luajit.1 (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/etc/luajit.pc (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/Makefile (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/Makefile.dep (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/host/README (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/host/buildvm.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/host/buildvm.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/host/buildvm_asm.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/host/buildvm_fold.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/host/buildvm_lib.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/host/buildvm_peobj.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/host/genminilua.lua (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/host/minilua.c.REMOVED.git-id (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/jit/bc.lua (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/jit/bcsave.lua (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/jit/dis_arm.lua (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/jit/dis_mips.lua (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/jit/dis_mipsel.lua (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/jit/dis_ppc.lua (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/jit/dis_x64.lua (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/jit/dis_x86.lua (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/jit/dump.lua (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/jit/v.lua (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lauxlib.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lib_aux.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lib_base.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lib_bit.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lib_debug.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lib_ffi.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lib_init.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lib_io.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lib_jit.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lib_math.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lib_os.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lib_package.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lib_string.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lib_table.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj.supp (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_alloc.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_alloc.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_api.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_arch.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_asm.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_asm.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_asm_arm.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_asm_mips.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_asm_ppc.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_asm_x86.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_bc.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_bc.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_bcdump.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_bcread.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_bcwrite.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_carith.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_carith.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_ccall.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_ccall.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_ccallback.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_ccallback.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_cconv.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_cconv.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_cdata.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_cdata.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_char.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_char.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_clib.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_clib.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_cparse.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_cparse.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_crecord.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_crecord.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_ctype.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_ctype.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_debug.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_debug.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_def.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_dispatch.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_dispatch.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_emit_arm.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_emit_mips.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_emit_ppc.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_emit_x86.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_err.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_err.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_errmsg.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_ff.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_ffrecord.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_ffrecord.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_frame.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_func.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_func.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_gc.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_gc.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_gdbjit.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_gdbjit.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_ir.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_ir.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_ircall.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_iropt.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_jit.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_lex.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_lex.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_lib.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_lib.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_load.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_mcode.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_mcode.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_meta.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_meta.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_obj.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_obj.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_opt_dce.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_opt_fold.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_opt_loop.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_opt_mem.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_opt_narrow.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_opt_sink.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_opt_split.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_parse.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_parse.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_record.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_record.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_snap.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_snap.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_state.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_state.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_str.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_str.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_strscan.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_strscan.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_tab.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_tab.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_target.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_target_arm.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_target_mips.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_target_ppc.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_target_x86.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_trace.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_trace.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_traceerr.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_udata.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_udata.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_vm.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_vmevent.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_vmevent.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lj_vmmath.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/ljamalg.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lua.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lua.hpp (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/luaconf.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/luajit.c (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/luajit.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/lualib.h (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/msvcbuild.bat (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/vm_arm.dasc.REMOVED.git-id (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/vm_mips.dasc.REMOVED.git-id (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/vm_ppc.dasc.REMOVED.git-id (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/vm_ppcspe.dasc.REMOVED.git-id (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/vm_x86.dasc.REMOVED.git-id (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/src/xedkbuild.bat (100%) rename {cocos/scripting => external}/lua/luajit/LuaJIT-2.0.1/v2.0.1_hotfix1.patch (100%) rename {cocos/scripting => external}/lua/luajit/android/armeabi-v7a/libluajit.a.REMOVED.git-id (100%) rename {cocos/scripting => external}/lua/luajit/android/armeabi/libluajit.a.REMOVED.git-id (100%) rename {cocos/scripting => external}/lua/luajit/android/x86/libluajit.a.REMOVED.git-id (100%) rename {cocos/scripting => external}/lua/luajit/build_android.sh (100%) rename {cocos/scripting => external}/lua/luajit/build_ios.sh (100%) rename {cocos/scripting => external}/lua/luajit/build_mac.sh (100%) rename {cocos/scripting => external}/lua/luajit/include/lauxlib.h (100%) rename {cocos/scripting => external}/lua/luajit/include/lua.h (100%) rename {cocos/scripting => external}/lua/luajit/include/luaconf.h (100%) rename {cocos/scripting => external}/lua/luajit/include/lualib.h (100%) rename {cocos/scripting => external}/lua/luajit/ios/libluajit.a.REMOVED.git-id (100%) rename {cocos/scripting => external}/lua/luajit/mac/libluajit.a.REMOVED.git-id (100%) rename {cocos/scripting => external}/lua/luajit/win32/lua51.dll.REMOVED.git-id (100%) rename {cocos/scripting => external}/lua/tolua/tolua++.h (100%) rename {cocos/scripting => external}/lua/tolua/tolua_event.c (100%) rename {cocos/scripting => external}/lua/tolua/tolua_event.h (100%) rename {cocos/scripting => external}/lua/tolua/tolua_is.c (100%) rename {cocos/scripting => external}/lua/tolua/tolua_map.c (100%) rename {cocos/scripting => external}/lua/tolua/tolua_push.c (100%) rename {cocos/scripting => external}/lua/tolua/tolua_to.c (100%) diff --git a/cocos/scripting/lua/proj.linux/.cproject b/cocos/scripting/lua/bindings/.cproject similarity index 100% rename from cocos/scripting/lua/proj.linux/.cproject rename to cocos/scripting/lua/bindings/.cproject diff --git a/cocos/scripting/lua/proj.linux/.project b/cocos/scripting/lua/bindings/.project similarity index 100% rename from cocos/scripting/lua/proj.linux/.project rename to cocos/scripting/lua/bindings/.project diff --git a/cocos/scripting/lua/proj.android/Android.mk b/cocos/scripting/lua/bindings/Android.mk similarity index 100% rename from cocos/scripting/lua/proj.android/Android.mk rename to cocos/scripting/lua/bindings/Android.mk diff --git a/cocos/scripting/lua/cocos2dx_support/CCBProxy.cpp b/cocos/scripting/lua/bindings/CCBProxy.cpp similarity index 100% rename from cocos/scripting/lua/cocos2dx_support/CCBProxy.cpp rename to cocos/scripting/lua/bindings/CCBProxy.cpp diff --git a/cocos/scripting/lua/cocos2dx_support/CCBProxy.h b/cocos/scripting/lua/bindings/CCBProxy.h similarity index 100% rename from cocos/scripting/lua/cocos2dx_support/CCBProxy.h rename to cocos/scripting/lua/bindings/CCBProxy.h diff --git a/cocos/scripting/lua/cocos2dx_support/CCLuaBridge.cpp b/cocos/scripting/lua/bindings/CCLuaBridge.cpp similarity index 100% rename from cocos/scripting/lua/cocos2dx_support/CCLuaBridge.cpp rename to cocos/scripting/lua/bindings/CCLuaBridge.cpp diff --git a/cocos/scripting/lua/cocos2dx_support/CCLuaBridge.h b/cocos/scripting/lua/bindings/CCLuaBridge.h similarity index 100% rename from cocos/scripting/lua/cocos2dx_support/CCLuaBridge.h rename to cocos/scripting/lua/bindings/CCLuaBridge.h diff --git a/cocos/scripting/lua/cocos2dx_support/CCLuaEngine.cpp b/cocos/scripting/lua/bindings/CCLuaEngine.cpp similarity index 100% rename from cocos/scripting/lua/cocos2dx_support/CCLuaEngine.cpp rename to cocos/scripting/lua/bindings/CCLuaEngine.cpp diff --git a/cocos/scripting/lua/cocos2dx_support/CCLuaEngine.h b/cocos/scripting/lua/bindings/CCLuaEngine.h similarity index 100% rename from cocos/scripting/lua/cocos2dx_support/CCLuaEngine.h rename to cocos/scripting/lua/bindings/CCLuaEngine.h diff --git a/cocos/scripting/lua/cocos2dx_support/CCLuaStack.cpp b/cocos/scripting/lua/bindings/CCLuaStack.cpp similarity index 100% rename from cocos/scripting/lua/cocos2dx_support/CCLuaStack.cpp rename to cocos/scripting/lua/bindings/CCLuaStack.cpp diff --git a/cocos/scripting/lua/cocos2dx_support/CCLuaStack.h b/cocos/scripting/lua/bindings/CCLuaStack.h similarity index 100% rename from cocos/scripting/lua/cocos2dx_support/CCLuaStack.h rename to cocos/scripting/lua/bindings/CCLuaStack.h diff --git a/cocos/scripting/lua/cocos2dx_support/CCLuaValue.cpp b/cocos/scripting/lua/bindings/CCLuaValue.cpp similarity index 100% rename from cocos/scripting/lua/cocos2dx_support/CCLuaValue.cpp rename to cocos/scripting/lua/bindings/CCLuaValue.cpp diff --git a/cocos/scripting/lua/cocos2dx_support/CCLuaValue.h b/cocos/scripting/lua/bindings/CCLuaValue.h similarity index 100% rename from cocos/scripting/lua/cocos2dx_support/CCLuaValue.h rename to cocos/scripting/lua/bindings/CCLuaValue.h diff --git a/cocos/scripting/lua/cocos2dx_support/Cocos2dxLuaLoader.cpp b/cocos/scripting/lua/bindings/Cocos2dxLuaLoader.cpp similarity index 100% rename from cocos/scripting/lua/cocos2dx_support/Cocos2dxLuaLoader.cpp rename to cocos/scripting/lua/bindings/Cocos2dxLuaLoader.cpp diff --git a/cocos/scripting/lua/cocos2dx_support/Cocos2dxLuaLoader.h b/cocos/scripting/lua/bindings/Cocos2dxLuaLoader.h similarity index 100% rename from cocos/scripting/lua/cocos2dx_support/Cocos2dxLuaLoader.h rename to cocos/scripting/lua/bindings/Cocos2dxLuaLoader.h diff --git a/cocos/scripting/lua/cocos2dx_support/LuaBasicConversions.cpp b/cocos/scripting/lua/bindings/LuaBasicConversions.cpp similarity index 100% rename from cocos/scripting/lua/cocos2dx_support/LuaBasicConversions.cpp rename to cocos/scripting/lua/bindings/LuaBasicConversions.cpp diff --git a/cocos/scripting/lua/cocos2dx_support/LuaBasicConversions.h b/cocos/scripting/lua/bindings/LuaBasicConversions.h similarity index 100% rename from cocos/scripting/lua/cocos2dx_support/LuaBasicConversions.h rename to cocos/scripting/lua/bindings/LuaBasicConversions.h diff --git a/cocos/scripting/lua/cocos2dx_support/LuaOpengl.cpp.REMOVED.git-id b/cocos/scripting/lua/bindings/LuaOpengl.cpp.REMOVED.git-id similarity index 100% rename from cocos/scripting/lua/cocos2dx_support/LuaOpengl.cpp.REMOVED.git-id rename to cocos/scripting/lua/bindings/LuaOpengl.cpp.REMOVED.git-id diff --git a/cocos/scripting/lua/cocos2dx_support/LuaOpengl.h b/cocos/scripting/lua/bindings/LuaOpengl.h similarity index 100% rename from cocos/scripting/lua/cocos2dx_support/LuaOpengl.h rename to cocos/scripting/lua/bindings/LuaOpengl.h diff --git a/cocos/scripting/lua/cocos2dx_support/LuaScriptHandlerMgr.cpp b/cocos/scripting/lua/bindings/LuaScriptHandlerMgr.cpp similarity index 100% rename from cocos/scripting/lua/cocos2dx_support/LuaScriptHandlerMgr.cpp rename to cocos/scripting/lua/bindings/LuaScriptHandlerMgr.cpp diff --git a/cocos/scripting/lua/cocos2dx_support/LuaScriptHandlerMgr.h b/cocos/scripting/lua/bindings/LuaScriptHandlerMgr.h similarity index 100% rename from cocos/scripting/lua/cocos2dx_support/LuaScriptHandlerMgr.h rename to cocos/scripting/lua/bindings/LuaScriptHandlerMgr.h diff --git a/cocos/scripting/lua/cocos2dx_support/Lua_web_socket.cpp b/cocos/scripting/lua/bindings/Lua_web_socket.cpp similarity index 100% rename from cocos/scripting/lua/cocos2dx_support/Lua_web_socket.cpp rename to cocos/scripting/lua/bindings/Lua_web_socket.cpp diff --git a/cocos/scripting/lua/cocos2dx_support/Lua_web_socket.h b/cocos/scripting/lua/bindings/Lua_web_socket.h similarity index 100% rename from cocos/scripting/lua/cocos2dx_support/Lua_web_socket.h rename to cocos/scripting/lua/bindings/Lua_web_socket.h diff --git a/cocos/scripting/lua/proj.linux/Makefile b/cocos/scripting/lua/bindings/Makefile similarity index 100% rename from cocos/scripting/lua/proj.linux/Makefile rename to cocos/scripting/lua/bindings/Makefile diff --git a/cocos/scripting/lua/proj.win32/liblua.vcxproj b/cocos/scripting/lua/bindings/liblua.vcxproj similarity index 100% rename from cocos/scripting/lua/proj.win32/liblua.vcxproj rename to cocos/scripting/lua/bindings/liblua.vcxproj diff --git a/cocos/scripting/lua/proj.win32/liblua.vcxproj.filters b/cocos/scripting/lua/bindings/liblua.vcxproj.filters similarity index 100% rename from cocos/scripting/lua/proj.win32/liblua.vcxproj.filters rename to cocos/scripting/lua/bindings/liblua.vcxproj.filters diff --git a/cocos/scripting/lua/proj.win32/liblua.vcxproj.user b/cocos/scripting/lua/bindings/liblua.vcxproj.user similarity index 100% rename from cocos/scripting/lua/proj.win32/liblua.vcxproj.user rename to cocos/scripting/lua/bindings/liblua.vcxproj.user diff --git a/cocos/scripting/lua/cocos2dx_support/lua_cocos2dx_deprecated.cpp.REMOVED.git-id b/cocos/scripting/lua/bindings/lua_cocos2dx_deprecated.cpp.REMOVED.git-id similarity index 100% rename from cocos/scripting/lua/cocos2dx_support/lua_cocos2dx_deprecated.cpp.REMOVED.git-id rename to cocos/scripting/lua/bindings/lua_cocos2dx_deprecated.cpp.REMOVED.git-id diff --git a/cocos/scripting/lua/cocos2dx_support/lua_cocos2dx_deprecated.h b/cocos/scripting/lua/bindings/lua_cocos2dx_deprecated.h similarity index 100% rename from cocos/scripting/lua/cocos2dx_support/lua_cocos2dx_deprecated.h rename to cocos/scripting/lua/bindings/lua_cocos2dx_deprecated.h diff --git a/cocos/scripting/lua/cocos2dx_support/lua_cocos2dx_extension_manual.cpp b/cocos/scripting/lua/bindings/lua_cocos2dx_extension_manual.cpp similarity index 100% rename from cocos/scripting/lua/cocos2dx_support/lua_cocos2dx_extension_manual.cpp rename to cocos/scripting/lua/bindings/lua_cocos2dx_extension_manual.cpp diff --git a/cocos/scripting/lua/cocos2dx_support/lua_cocos2dx_extension_manual.h b/cocos/scripting/lua/bindings/lua_cocos2dx_extension_manual.h similarity index 100% rename from cocos/scripting/lua/cocos2dx_support/lua_cocos2dx_extension_manual.h rename to cocos/scripting/lua/bindings/lua_cocos2dx_extension_manual.h diff --git a/cocos/scripting/lua/cocos2dx_support/lua_cocos2dx_manual.cpp b/cocos/scripting/lua/bindings/lua_cocos2dx_manual.cpp similarity index 100% rename from cocos/scripting/lua/cocos2dx_support/lua_cocos2dx_manual.cpp rename to cocos/scripting/lua/bindings/lua_cocos2dx_manual.cpp diff --git a/cocos/scripting/lua/cocos2dx_support/lua_cocos2dx_manual.hpp b/cocos/scripting/lua/bindings/lua_cocos2dx_manual.hpp similarity index 100% rename from cocos/scripting/lua/cocos2dx_support/lua_cocos2dx_manual.hpp rename to cocos/scripting/lua/bindings/lua_cocos2dx_manual.hpp diff --git a/cocos/scripting/lua/cocos2dx_support/platform/android/CCLuaJavaBridge.cpp b/cocos/scripting/lua/bindings/platform/android/CCLuaJavaBridge.cpp similarity index 100% rename from cocos/scripting/lua/cocos2dx_support/platform/android/CCLuaJavaBridge.cpp rename to cocos/scripting/lua/bindings/platform/android/CCLuaJavaBridge.cpp diff --git a/cocos/scripting/lua/cocos2dx_support/platform/android/CCLuaJavaBridge.h b/cocos/scripting/lua/bindings/platform/android/CCLuaJavaBridge.h similarity index 100% rename from cocos/scripting/lua/cocos2dx_support/platform/android/CCLuaJavaBridge.h rename to cocos/scripting/lua/bindings/platform/android/CCLuaJavaBridge.h diff --git a/cocos/scripting/lua/cocos2dx_support/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge.cpp b/cocos/scripting/lua/bindings/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge.cpp similarity index 100% rename from cocos/scripting/lua/cocos2dx_support/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge.cpp rename to cocos/scripting/lua/bindings/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge.cpp diff --git a/cocos/scripting/lua/cocos2dx_support/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge.h b/cocos/scripting/lua/bindings/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge.h similarity index 100% rename from cocos/scripting/lua/cocos2dx_support/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge.h rename to cocos/scripting/lua/bindings/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge.h diff --git a/cocos/scripting/lua/cocos2dx_support/platform/ios/CCLuaObjcBridge.h b/cocos/scripting/lua/bindings/platform/ios/CCLuaObjcBridge.h similarity index 100% rename from cocos/scripting/lua/cocos2dx_support/platform/ios/CCLuaObjcBridge.h rename to cocos/scripting/lua/bindings/platform/ios/CCLuaObjcBridge.h diff --git a/cocos/scripting/lua/cocos2dx_support/platform/ios/CCLuaObjcBridge.mm b/cocos/scripting/lua/bindings/platform/ios/CCLuaObjcBridge.mm similarity index 100% rename from cocos/scripting/lua/cocos2dx_support/platform/ios/CCLuaObjcBridge.mm rename to cocos/scripting/lua/bindings/platform/ios/CCLuaObjcBridge.mm diff --git a/cocos/scripting/lua/cocos2dx_support/tolua_fix.c b/cocos/scripting/lua/bindings/tolua_fix.c similarity index 100% rename from cocos/scripting/lua/cocos2dx_support/tolua_fix.c rename to cocos/scripting/lua/bindings/tolua_fix.c diff --git a/cocos/scripting/lua/cocos2dx_support/tolua_fix.h b/cocos/scripting/lua/bindings/tolua_fix.h similarity index 100% rename from cocos/scripting/lua/cocos2dx_support/tolua_fix.h rename to cocos/scripting/lua/bindings/tolua_fix.h diff --git a/cocos/scripting/lua/proj.ios/luabindings-Prefix.pch b/cocos/scripting/lua/proj.ios/luabindings-Prefix.pch deleted file mode 100644 index 175f3ccb23..0000000000 --- a/cocos/scripting/lua/proj.ios/luabindings-Prefix.pch +++ /dev/null @@ -1,7 +0,0 @@ -// -// Prefix header for all source files of the 'luabindings' target in the 'luabindings' project -// - -#ifdef __OBJC__ - #import -#endif diff --git a/cocos/scripting/lua/lua/lapi.c b/external/lua/lua/lapi.c similarity index 100% rename from cocos/scripting/lua/lua/lapi.c rename to external/lua/lua/lapi.c diff --git a/cocos/scripting/lua/lua/lapi.h b/external/lua/lua/lapi.h similarity index 100% rename from cocos/scripting/lua/lua/lapi.h rename to external/lua/lua/lapi.h diff --git a/cocos/scripting/lua/lua/lauxlib.c b/external/lua/lua/lauxlib.c similarity index 100% rename from cocos/scripting/lua/lua/lauxlib.c rename to external/lua/lua/lauxlib.c diff --git a/cocos/scripting/lua/lua/lauxlib.h b/external/lua/lua/lauxlib.h similarity index 100% rename from cocos/scripting/lua/lua/lauxlib.h rename to external/lua/lua/lauxlib.h diff --git a/cocos/scripting/lua/lua/lbaselib.c b/external/lua/lua/lbaselib.c similarity index 100% rename from cocos/scripting/lua/lua/lbaselib.c rename to external/lua/lua/lbaselib.c diff --git a/cocos/scripting/lua/lua/lcode.c b/external/lua/lua/lcode.c similarity index 100% rename from cocos/scripting/lua/lua/lcode.c rename to external/lua/lua/lcode.c diff --git a/cocos/scripting/lua/lua/lcode.h b/external/lua/lua/lcode.h similarity index 100% rename from cocos/scripting/lua/lua/lcode.h rename to external/lua/lua/lcode.h diff --git a/cocos/scripting/lua/lua/ldblib.c b/external/lua/lua/ldblib.c similarity index 100% rename from cocos/scripting/lua/lua/ldblib.c rename to external/lua/lua/ldblib.c diff --git a/cocos/scripting/lua/lua/ldebug.c b/external/lua/lua/ldebug.c similarity index 100% rename from cocos/scripting/lua/lua/ldebug.c rename to external/lua/lua/ldebug.c diff --git a/cocos/scripting/lua/lua/ldebug.h b/external/lua/lua/ldebug.h similarity index 100% rename from cocos/scripting/lua/lua/ldebug.h rename to external/lua/lua/ldebug.h diff --git a/cocos/scripting/lua/lua/ldo.c b/external/lua/lua/ldo.c similarity index 100% rename from cocos/scripting/lua/lua/ldo.c rename to external/lua/lua/ldo.c diff --git a/cocos/scripting/lua/lua/ldo.h b/external/lua/lua/ldo.h similarity index 100% rename from cocos/scripting/lua/lua/ldo.h rename to external/lua/lua/ldo.h diff --git a/cocos/scripting/lua/lua/ldump.c b/external/lua/lua/ldump.c similarity index 100% rename from cocos/scripting/lua/lua/ldump.c rename to external/lua/lua/ldump.c diff --git a/cocos/scripting/lua/lua/lfunc.c b/external/lua/lua/lfunc.c similarity index 100% rename from cocos/scripting/lua/lua/lfunc.c rename to external/lua/lua/lfunc.c diff --git a/cocos/scripting/lua/lua/lfunc.h b/external/lua/lua/lfunc.h similarity index 100% rename from cocos/scripting/lua/lua/lfunc.h rename to external/lua/lua/lfunc.h diff --git a/cocos/scripting/lua/lua/lgc.c b/external/lua/lua/lgc.c similarity index 100% rename from cocos/scripting/lua/lua/lgc.c rename to external/lua/lua/lgc.c diff --git a/cocos/scripting/lua/lua/lgc.h b/external/lua/lua/lgc.h similarity index 100% rename from cocos/scripting/lua/lua/lgc.h rename to external/lua/lua/lgc.h diff --git a/cocos/scripting/lua/lua/linit.c b/external/lua/lua/linit.c similarity index 100% rename from cocos/scripting/lua/lua/linit.c rename to external/lua/lua/linit.c diff --git a/cocos/scripting/lua/lua/liolib.c b/external/lua/lua/liolib.c similarity index 100% rename from cocos/scripting/lua/lua/liolib.c rename to external/lua/lua/liolib.c diff --git a/cocos/scripting/lua/lua/llex.c b/external/lua/lua/llex.c similarity index 100% rename from cocos/scripting/lua/lua/llex.c rename to external/lua/lua/llex.c diff --git a/cocos/scripting/lua/lua/llex.h b/external/lua/lua/llex.h similarity index 100% rename from cocos/scripting/lua/lua/llex.h rename to external/lua/lua/llex.h diff --git a/cocos/scripting/lua/lua/llimits.h b/external/lua/lua/llimits.h similarity index 100% rename from cocos/scripting/lua/lua/llimits.h rename to external/lua/lua/llimits.h diff --git a/cocos/scripting/lua/lua/lmathlib.c b/external/lua/lua/lmathlib.c similarity index 100% rename from cocos/scripting/lua/lua/lmathlib.c rename to external/lua/lua/lmathlib.c diff --git a/cocos/scripting/lua/lua/lmem.c b/external/lua/lua/lmem.c similarity index 100% rename from cocos/scripting/lua/lua/lmem.c rename to external/lua/lua/lmem.c diff --git a/cocos/scripting/lua/lua/lmem.h b/external/lua/lua/lmem.h similarity index 100% rename from cocos/scripting/lua/lua/lmem.h rename to external/lua/lua/lmem.h diff --git a/cocos/scripting/lua/lua/loadlib.c b/external/lua/lua/loadlib.c similarity index 100% rename from cocos/scripting/lua/lua/loadlib.c rename to external/lua/lua/loadlib.c diff --git a/cocos/scripting/lua/lua/lobject.c b/external/lua/lua/lobject.c similarity index 100% rename from cocos/scripting/lua/lua/lobject.c rename to external/lua/lua/lobject.c diff --git a/cocos/scripting/lua/lua/lobject.h b/external/lua/lua/lobject.h similarity index 100% rename from cocos/scripting/lua/lua/lobject.h rename to external/lua/lua/lobject.h diff --git a/cocos/scripting/lua/lua/lopcodes.c b/external/lua/lua/lopcodes.c similarity index 100% rename from cocos/scripting/lua/lua/lopcodes.c rename to external/lua/lua/lopcodes.c diff --git a/cocos/scripting/lua/lua/lopcodes.h b/external/lua/lua/lopcodes.h similarity index 100% rename from cocos/scripting/lua/lua/lopcodes.h rename to external/lua/lua/lopcodes.h diff --git a/cocos/scripting/lua/lua/loslib.c b/external/lua/lua/loslib.c similarity index 100% rename from cocos/scripting/lua/lua/loslib.c rename to external/lua/lua/loslib.c diff --git a/cocos/scripting/lua/lua/lparser.c b/external/lua/lua/lparser.c similarity index 100% rename from cocos/scripting/lua/lua/lparser.c rename to external/lua/lua/lparser.c diff --git a/cocos/scripting/lua/lua/lparser.h b/external/lua/lua/lparser.h similarity index 100% rename from cocos/scripting/lua/lua/lparser.h rename to external/lua/lua/lparser.h diff --git a/cocos/scripting/lua/lua/lstate.c b/external/lua/lua/lstate.c similarity index 100% rename from cocos/scripting/lua/lua/lstate.c rename to external/lua/lua/lstate.c diff --git a/cocos/scripting/lua/lua/lstate.h b/external/lua/lua/lstate.h similarity index 100% rename from cocos/scripting/lua/lua/lstate.h rename to external/lua/lua/lstate.h diff --git a/cocos/scripting/lua/lua/lstring.c b/external/lua/lua/lstring.c similarity index 100% rename from cocos/scripting/lua/lua/lstring.c rename to external/lua/lua/lstring.c diff --git a/cocos/scripting/lua/lua/lstring.h b/external/lua/lua/lstring.h similarity index 100% rename from cocos/scripting/lua/lua/lstring.h rename to external/lua/lua/lstring.h diff --git a/cocos/scripting/lua/lua/lstrlib.c b/external/lua/lua/lstrlib.c similarity index 100% rename from cocos/scripting/lua/lua/lstrlib.c rename to external/lua/lua/lstrlib.c diff --git a/cocos/scripting/lua/lua/ltable.c b/external/lua/lua/ltable.c similarity index 100% rename from cocos/scripting/lua/lua/ltable.c rename to external/lua/lua/ltable.c diff --git a/cocos/scripting/lua/lua/ltable.h b/external/lua/lua/ltable.h similarity index 100% rename from cocos/scripting/lua/lua/ltable.h rename to external/lua/lua/ltable.h diff --git a/cocos/scripting/lua/lua/ltablib.c b/external/lua/lua/ltablib.c similarity index 100% rename from cocos/scripting/lua/lua/ltablib.c rename to external/lua/lua/ltablib.c diff --git a/cocos/scripting/lua/lua/ltm.c b/external/lua/lua/ltm.c similarity index 100% rename from cocos/scripting/lua/lua/ltm.c rename to external/lua/lua/ltm.c diff --git a/cocos/scripting/lua/lua/ltm.h b/external/lua/lua/ltm.h similarity index 100% rename from cocos/scripting/lua/lua/ltm.h rename to external/lua/lua/ltm.h diff --git a/cocos/scripting/lua/lua/lua.c b/external/lua/lua/lua.c similarity index 100% rename from cocos/scripting/lua/lua/lua.c rename to external/lua/lua/lua.c diff --git a/cocos/scripting/lua/lua/lua.h b/external/lua/lua/lua.h similarity index 100% rename from cocos/scripting/lua/lua/lua.h rename to external/lua/lua/lua.h diff --git a/cocos/scripting/lua/lua/luaconf.h b/external/lua/lua/luaconf.h similarity index 100% rename from cocos/scripting/lua/lua/luaconf.h rename to external/lua/lua/luaconf.h diff --git a/cocos/scripting/lua/lua/lualib.h b/external/lua/lua/lualib.h similarity index 100% rename from cocos/scripting/lua/lua/lualib.h rename to external/lua/lua/lualib.h diff --git a/cocos/scripting/lua/lua/lundump.c b/external/lua/lua/lundump.c similarity index 100% rename from cocos/scripting/lua/lua/lundump.c rename to external/lua/lua/lundump.c diff --git a/cocos/scripting/lua/lua/lundump.h b/external/lua/lua/lundump.h similarity index 100% rename from cocos/scripting/lua/lua/lundump.h rename to external/lua/lua/lundump.h diff --git a/cocos/scripting/lua/lua/lvm.c b/external/lua/lua/lvm.c similarity index 100% rename from cocos/scripting/lua/lua/lvm.c rename to external/lua/lua/lvm.c diff --git a/cocos/scripting/lua/lua/lvm.h b/external/lua/lua/lvm.h similarity index 100% rename from cocos/scripting/lua/lua/lvm.h rename to external/lua/lua/lvm.h diff --git a/cocos/scripting/lua/lua/lzio.c b/external/lua/lua/lzio.c similarity index 100% rename from cocos/scripting/lua/lua/lzio.c rename to external/lua/lua/lzio.c diff --git a/cocos/scripting/lua/lua/lzio.h b/external/lua/lua/lzio.h similarity index 100% rename from cocos/scripting/lua/lua/lzio.h rename to external/lua/lua/lzio.h diff --git a/cocos/scripting/lua/lua/print.c b/external/lua/lua/print.c similarity index 100% rename from cocos/scripting/lua/lua/print.c rename to external/lua/lua/print.c diff --git a/cocos/scripting/lua/luajit/Android.mk b/external/lua/luajit/Android.mk similarity index 100% rename from cocos/scripting/lua/luajit/Android.mk rename to external/lua/luajit/Android.mk diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/COPYRIGHT b/external/lua/luajit/LuaJIT-2.0.1/COPYRIGHT similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/COPYRIGHT rename to external/lua/luajit/LuaJIT-2.0.1/COPYRIGHT diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/Makefile b/external/lua/luajit/LuaJIT-2.0.1/Makefile similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/Makefile rename to external/lua/luajit/LuaJIT-2.0.1/Makefile diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/README b/external/lua/luajit/LuaJIT-2.0.1/README similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/README rename to external/lua/luajit/LuaJIT-2.0.1/README diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/bluequad-print.css b/external/lua/luajit/LuaJIT-2.0.1/doc/bluequad-print.css similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/bluequad-print.css rename to external/lua/luajit/LuaJIT-2.0.1/doc/bluequad-print.css diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/bluequad.css b/external/lua/luajit/LuaJIT-2.0.1/doc/bluequad.css similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/bluequad.css rename to external/lua/luajit/LuaJIT-2.0.1/doc/bluequad.css diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/changes.html b/external/lua/luajit/LuaJIT-2.0.1/doc/changes.html similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/changes.html rename to external/lua/luajit/LuaJIT-2.0.1/doc/changes.html diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/contact.html b/external/lua/luajit/LuaJIT-2.0.1/doc/contact.html similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/contact.html rename to external/lua/luajit/LuaJIT-2.0.1/doc/contact.html diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/ext_c_api.html b/external/lua/luajit/LuaJIT-2.0.1/doc/ext_c_api.html similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/ext_c_api.html rename to external/lua/luajit/LuaJIT-2.0.1/doc/ext_c_api.html diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/ext_ffi.html b/external/lua/luajit/LuaJIT-2.0.1/doc/ext_ffi.html similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/ext_ffi.html rename to external/lua/luajit/LuaJIT-2.0.1/doc/ext_ffi.html diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/ext_ffi_api.html b/external/lua/luajit/LuaJIT-2.0.1/doc/ext_ffi_api.html similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/ext_ffi_api.html rename to external/lua/luajit/LuaJIT-2.0.1/doc/ext_ffi_api.html diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/ext_ffi_semantics.html b/external/lua/luajit/LuaJIT-2.0.1/doc/ext_ffi_semantics.html similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/ext_ffi_semantics.html rename to external/lua/luajit/LuaJIT-2.0.1/doc/ext_ffi_semantics.html diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/ext_ffi_tutorial.html b/external/lua/luajit/LuaJIT-2.0.1/doc/ext_ffi_tutorial.html similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/ext_ffi_tutorial.html rename to external/lua/luajit/LuaJIT-2.0.1/doc/ext_ffi_tutorial.html diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/ext_jit.html b/external/lua/luajit/LuaJIT-2.0.1/doc/ext_jit.html similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/ext_jit.html rename to external/lua/luajit/LuaJIT-2.0.1/doc/ext_jit.html diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/extensions.html b/external/lua/luajit/LuaJIT-2.0.1/doc/extensions.html similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/extensions.html rename to external/lua/luajit/LuaJIT-2.0.1/doc/extensions.html diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/faq.html b/external/lua/luajit/LuaJIT-2.0.1/doc/faq.html similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/faq.html rename to external/lua/luajit/LuaJIT-2.0.1/doc/faq.html diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/install.html b/external/lua/luajit/LuaJIT-2.0.1/doc/install.html similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/install.html rename to external/lua/luajit/LuaJIT-2.0.1/doc/install.html diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/luajit.html b/external/lua/luajit/LuaJIT-2.0.1/doc/luajit.html similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/luajit.html rename to external/lua/luajit/LuaJIT-2.0.1/doc/luajit.html diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/running.html b/external/lua/luajit/LuaJIT-2.0.1/doc/running.html similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/running.html rename to external/lua/luajit/LuaJIT-2.0.1/doc/running.html diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/status.html b/external/lua/luajit/LuaJIT-2.0.1/doc/status.html similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/status.html rename to external/lua/luajit/LuaJIT-2.0.1/doc/status.html diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_arm.h b/external/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_arm.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_arm.h rename to external/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_arm.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_arm.lua b/external/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_arm.lua similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_arm.lua rename to external/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_arm.lua diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_mips.h b/external/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_mips.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_mips.h rename to external/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_mips.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_mips.lua b/external/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_mips.lua similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_mips.lua rename to external/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_mips.lua diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_ppc.h b/external/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_ppc.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_ppc.h rename to external/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_ppc.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_ppc.lua b/external/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_ppc.lua similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_ppc.lua rename to external/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_ppc.lua diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_proto.h b/external/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_proto.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_proto.h rename to external/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_proto.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_x64.lua b/external/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_x64.lua similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_x64.lua rename to external/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_x64.lua diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_x86.h b/external/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_x86.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_x86.h rename to external/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_x86.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_x86.lua b/external/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_x86.lua similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_x86.lua rename to external/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_x86.lua diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dynasm.lua b/external/lua/luajit/LuaJIT-2.0.1/dynasm/dynasm.lua similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dynasm.lua rename to external/lua/luajit/LuaJIT-2.0.1/dynasm/dynasm.lua diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/etc/luajit.1 b/external/lua/luajit/LuaJIT-2.0.1/etc/luajit.1 similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/etc/luajit.1 rename to external/lua/luajit/LuaJIT-2.0.1/etc/luajit.1 diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/etc/luajit.pc b/external/lua/luajit/LuaJIT-2.0.1/etc/luajit.pc similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/etc/luajit.pc rename to external/lua/luajit/LuaJIT-2.0.1/etc/luajit.pc diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/Makefile b/external/lua/luajit/LuaJIT-2.0.1/src/Makefile similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/Makefile rename to external/lua/luajit/LuaJIT-2.0.1/src/Makefile diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/Makefile.dep b/external/lua/luajit/LuaJIT-2.0.1/src/Makefile.dep similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/Makefile.dep rename to external/lua/luajit/LuaJIT-2.0.1/src/Makefile.dep diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/host/README b/external/lua/luajit/LuaJIT-2.0.1/src/host/README similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/host/README rename to external/lua/luajit/LuaJIT-2.0.1/src/host/README diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/host/buildvm.c b/external/lua/luajit/LuaJIT-2.0.1/src/host/buildvm.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/host/buildvm.c rename to external/lua/luajit/LuaJIT-2.0.1/src/host/buildvm.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/host/buildvm.h b/external/lua/luajit/LuaJIT-2.0.1/src/host/buildvm.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/host/buildvm.h rename to external/lua/luajit/LuaJIT-2.0.1/src/host/buildvm.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/host/buildvm_asm.c b/external/lua/luajit/LuaJIT-2.0.1/src/host/buildvm_asm.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/host/buildvm_asm.c rename to external/lua/luajit/LuaJIT-2.0.1/src/host/buildvm_asm.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/host/buildvm_fold.c b/external/lua/luajit/LuaJIT-2.0.1/src/host/buildvm_fold.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/host/buildvm_fold.c rename to external/lua/luajit/LuaJIT-2.0.1/src/host/buildvm_fold.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/host/buildvm_lib.c b/external/lua/luajit/LuaJIT-2.0.1/src/host/buildvm_lib.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/host/buildvm_lib.c rename to external/lua/luajit/LuaJIT-2.0.1/src/host/buildvm_lib.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/host/buildvm_peobj.c b/external/lua/luajit/LuaJIT-2.0.1/src/host/buildvm_peobj.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/host/buildvm_peobj.c rename to external/lua/luajit/LuaJIT-2.0.1/src/host/buildvm_peobj.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/host/genminilua.lua b/external/lua/luajit/LuaJIT-2.0.1/src/host/genminilua.lua similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/host/genminilua.lua rename to external/lua/luajit/LuaJIT-2.0.1/src/host/genminilua.lua diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/host/minilua.c.REMOVED.git-id b/external/lua/luajit/LuaJIT-2.0.1/src/host/minilua.c.REMOVED.git-id similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/host/minilua.c.REMOVED.git-id rename to external/lua/luajit/LuaJIT-2.0.1/src/host/minilua.c.REMOVED.git-id diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/bc.lua b/external/lua/luajit/LuaJIT-2.0.1/src/jit/bc.lua similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/bc.lua rename to external/lua/luajit/LuaJIT-2.0.1/src/jit/bc.lua diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/bcsave.lua b/external/lua/luajit/LuaJIT-2.0.1/src/jit/bcsave.lua similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/bcsave.lua rename to external/lua/luajit/LuaJIT-2.0.1/src/jit/bcsave.lua diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/dis_arm.lua b/external/lua/luajit/LuaJIT-2.0.1/src/jit/dis_arm.lua similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/dis_arm.lua rename to external/lua/luajit/LuaJIT-2.0.1/src/jit/dis_arm.lua diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/dis_mips.lua b/external/lua/luajit/LuaJIT-2.0.1/src/jit/dis_mips.lua similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/dis_mips.lua rename to external/lua/luajit/LuaJIT-2.0.1/src/jit/dis_mips.lua diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/dis_mipsel.lua b/external/lua/luajit/LuaJIT-2.0.1/src/jit/dis_mipsel.lua similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/dis_mipsel.lua rename to external/lua/luajit/LuaJIT-2.0.1/src/jit/dis_mipsel.lua diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/dis_ppc.lua b/external/lua/luajit/LuaJIT-2.0.1/src/jit/dis_ppc.lua similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/dis_ppc.lua rename to external/lua/luajit/LuaJIT-2.0.1/src/jit/dis_ppc.lua diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/dis_x64.lua b/external/lua/luajit/LuaJIT-2.0.1/src/jit/dis_x64.lua similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/dis_x64.lua rename to external/lua/luajit/LuaJIT-2.0.1/src/jit/dis_x64.lua diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/dis_x86.lua b/external/lua/luajit/LuaJIT-2.0.1/src/jit/dis_x86.lua similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/dis_x86.lua rename to external/lua/luajit/LuaJIT-2.0.1/src/jit/dis_x86.lua diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/dump.lua b/external/lua/luajit/LuaJIT-2.0.1/src/jit/dump.lua similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/dump.lua rename to external/lua/luajit/LuaJIT-2.0.1/src/jit/dump.lua diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/v.lua b/external/lua/luajit/LuaJIT-2.0.1/src/jit/v.lua similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/v.lua rename to external/lua/luajit/LuaJIT-2.0.1/src/jit/v.lua diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lauxlib.h b/external/lua/luajit/LuaJIT-2.0.1/src/lauxlib.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lauxlib.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lauxlib.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_aux.c b/external/lua/luajit/LuaJIT-2.0.1/src/lib_aux.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_aux.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lib_aux.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_base.c b/external/lua/luajit/LuaJIT-2.0.1/src/lib_base.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_base.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lib_base.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_bit.c b/external/lua/luajit/LuaJIT-2.0.1/src/lib_bit.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_bit.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lib_bit.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_debug.c b/external/lua/luajit/LuaJIT-2.0.1/src/lib_debug.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_debug.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lib_debug.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_ffi.c b/external/lua/luajit/LuaJIT-2.0.1/src/lib_ffi.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_ffi.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lib_ffi.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_init.c b/external/lua/luajit/LuaJIT-2.0.1/src/lib_init.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_init.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lib_init.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_io.c b/external/lua/luajit/LuaJIT-2.0.1/src/lib_io.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_io.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lib_io.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_jit.c b/external/lua/luajit/LuaJIT-2.0.1/src/lib_jit.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_jit.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lib_jit.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_math.c b/external/lua/luajit/LuaJIT-2.0.1/src/lib_math.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_math.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lib_math.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_os.c b/external/lua/luajit/LuaJIT-2.0.1/src/lib_os.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_os.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lib_os.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_package.c b/external/lua/luajit/LuaJIT-2.0.1/src/lib_package.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_package.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lib_package.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_string.c b/external/lua/luajit/LuaJIT-2.0.1/src/lib_string.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_string.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lib_string.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_table.c b/external/lua/luajit/LuaJIT-2.0.1/src/lib_table.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_table.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lib_table.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj.supp b/external/lua/luajit/LuaJIT-2.0.1/src/lj.supp similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj.supp rename to external/lua/luajit/LuaJIT-2.0.1/src/lj.supp diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_alloc.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_alloc.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_alloc.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_alloc.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_alloc.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_alloc.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_alloc.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_alloc.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_api.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_api.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_api.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_api.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_arch.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_arch.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_arch.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_arch.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_asm.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_asm.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_asm.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_asm.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_asm.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_asm.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_asm.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_asm.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_asm_arm.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_asm_arm.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_asm_arm.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_asm_arm.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_asm_mips.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_asm_mips.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_asm_mips.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_asm_mips.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_asm_ppc.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_asm_ppc.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_asm_ppc.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_asm_ppc.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_asm_x86.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_asm_x86.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_asm_x86.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_asm_x86.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_bc.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_bc.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_bc.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_bc.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_bc.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_bc.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_bc.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_bc.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_bcdump.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_bcdump.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_bcdump.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_bcdump.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_bcread.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_bcread.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_bcread.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_bcread.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_bcwrite.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_bcwrite.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_bcwrite.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_bcwrite.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_carith.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_carith.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_carith.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_carith.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_carith.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_carith.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_carith.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_carith.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ccall.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_ccall.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ccall.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_ccall.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ccall.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_ccall.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ccall.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_ccall.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ccallback.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_ccallback.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ccallback.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_ccallback.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ccallback.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_ccallback.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ccallback.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_ccallback.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_cconv.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_cconv.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_cconv.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_cconv.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_cconv.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_cconv.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_cconv.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_cconv.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_cdata.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_cdata.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_cdata.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_cdata.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_cdata.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_cdata.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_cdata.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_cdata.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_char.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_char.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_char.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_char.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_char.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_char.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_char.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_char.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_clib.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_clib.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_clib.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_clib.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_clib.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_clib.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_clib.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_clib.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_cparse.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_cparse.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_cparse.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_cparse.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_cparse.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_cparse.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_cparse.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_cparse.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_crecord.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_crecord.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_crecord.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_crecord.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_crecord.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_crecord.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_crecord.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_crecord.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ctype.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_ctype.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ctype.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_ctype.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ctype.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_ctype.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ctype.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_ctype.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_debug.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_debug.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_debug.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_debug.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_debug.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_debug.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_debug.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_debug.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_def.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_def.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_def.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_def.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_dispatch.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_dispatch.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_dispatch.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_dispatch.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_dispatch.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_dispatch.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_dispatch.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_dispatch.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_emit_arm.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_emit_arm.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_emit_arm.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_emit_arm.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_emit_mips.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_emit_mips.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_emit_mips.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_emit_mips.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_emit_ppc.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_emit_ppc.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_emit_ppc.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_emit_ppc.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_emit_x86.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_emit_x86.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_emit_x86.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_emit_x86.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_err.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_err.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_err.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_err.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_err.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_err.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_err.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_err.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_errmsg.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_errmsg.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_errmsg.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_errmsg.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ff.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_ff.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ff.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_ff.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ffrecord.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_ffrecord.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ffrecord.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_ffrecord.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ffrecord.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_ffrecord.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ffrecord.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_ffrecord.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_frame.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_frame.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_frame.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_frame.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_func.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_func.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_func.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_func.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_func.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_func.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_func.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_func.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_gc.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_gc.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_gc.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_gc.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_gc.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_gc.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_gc.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_gc.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_gdbjit.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_gdbjit.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_gdbjit.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_gdbjit.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_gdbjit.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_gdbjit.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_gdbjit.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_gdbjit.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ir.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_ir.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ir.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_ir.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ir.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_ir.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ir.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_ir.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ircall.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_ircall.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ircall.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_ircall.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_iropt.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_iropt.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_iropt.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_iropt.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_jit.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_jit.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_jit.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_jit.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_lex.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_lex.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_lex.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_lex.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_lex.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_lex.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_lex.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_lex.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_lib.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_lib.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_lib.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_lib.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_lib.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_lib.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_lib.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_lib.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_load.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_load.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_load.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_load.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_mcode.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_mcode.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_mcode.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_mcode.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_mcode.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_mcode.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_mcode.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_mcode.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_meta.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_meta.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_meta.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_meta.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_meta.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_meta.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_meta.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_meta.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_obj.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_obj.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_obj.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_obj.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_obj.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_obj.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_obj.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_obj.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_opt_dce.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_opt_dce.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_opt_dce.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_opt_dce.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_opt_fold.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_opt_fold.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_opt_fold.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_opt_fold.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_opt_loop.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_opt_loop.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_opt_loop.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_opt_loop.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_opt_mem.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_opt_mem.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_opt_mem.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_opt_mem.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_opt_narrow.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_opt_narrow.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_opt_narrow.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_opt_narrow.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_opt_sink.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_opt_sink.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_opt_sink.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_opt_sink.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_opt_split.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_opt_split.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_opt_split.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_opt_split.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_parse.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_parse.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_parse.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_parse.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_parse.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_parse.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_parse.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_parse.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_record.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_record.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_record.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_record.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_record.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_record.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_record.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_record.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_snap.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_snap.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_snap.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_snap.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_snap.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_snap.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_snap.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_snap.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_state.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_state.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_state.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_state.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_state.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_state.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_state.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_state.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_str.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_str.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_str.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_str.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_str.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_str.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_str.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_str.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_strscan.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_strscan.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_strscan.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_strscan.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_strscan.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_strscan.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_strscan.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_strscan.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_tab.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_tab.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_tab.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_tab.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_tab.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_tab.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_tab.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_tab.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_target.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_target.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_target.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_target.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_target_arm.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_target_arm.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_target_arm.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_target_arm.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_target_mips.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_target_mips.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_target_mips.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_target_mips.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_target_ppc.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_target_ppc.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_target_ppc.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_target_ppc.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_target_x86.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_target_x86.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_target_x86.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_target_x86.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_trace.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_trace.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_trace.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_trace.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_trace.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_trace.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_trace.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_trace.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_traceerr.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_traceerr.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_traceerr.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_traceerr.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_udata.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_udata.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_udata.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_udata.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_udata.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_udata.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_udata.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_udata.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_vm.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_vm.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_vm.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_vm.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_vmevent.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_vmevent.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_vmevent.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_vmevent.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_vmevent.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_vmevent.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_vmevent.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_vmevent.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_vmmath.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_vmmath.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_vmmath.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_vmmath.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/ljamalg.c b/external/lua/luajit/LuaJIT-2.0.1/src/ljamalg.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/ljamalg.c rename to external/lua/luajit/LuaJIT-2.0.1/src/ljamalg.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lua.h b/external/lua/luajit/LuaJIT-2.0.1/src/lua.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lua.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lua.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lua.hpp b/external/lua/luajit/LuaJIT-2.0.1/src/lua.hpp similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lua.hpp rename to external/lua/luajit/LuaJIT-2.0.1/src/lua.hpp diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/luaconf.h b/external/lua/luajit/LuaJIT-2.0.1/src/luaconf.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/luaconf.h rename to external/lua/luajit/LuaJIT-2.0.1/src/luaconf.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/luajit.c b/external/lua/luajit/LuaJIT-2.0.1/src/luajit.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/luajit.c rename to external/lua/luajit/LuaJIT-2.0.1/src/luajit.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/luajit.h b/external/lua/luajit/LuaJIT-2.0.1/src/luajit.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/luajit.h rename to external/lua/luajit/LuaJIT-2.0.1/src/luajit.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lualib.h b/external/lua/luajit/LuaJIT-2.0.1/src/lualib.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lualib.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lualib.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/msvcbuild.bat b/external/lua/luajit/LuaJIT-2.0.1/src/msvcbuild.bat similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/msvcbuild.bat rename to external/lua/luajit/LuaJIT-2.0.1/src/msvcbuild.bat diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/vm_arm.dasc.REMOVED.git-id b/external/lua/luajit/LuaJIT-2.0.1/src/vm_arm.dasc.REMOVED.git-id similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/vm_arm.dasc.REMOVED.git-id rename to external/lua/luajit/LuaJIT-2.0.1/src/vm_arm.dasc.REMOVED.git-id diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/vm_mips.dasc.REMOVED.git-id b/external/lua/luajit/LuaJIT-2.0.1/src/vm_mips.dasc.REMOVED.git-id similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/vm_mips.dasc.REMOVED.git-id rename to external/lua/luajit/LuaJIT-2.0.1/src/vm_mips.dasc.REMOVED.git-id diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/vm_ppc.dasc.REMOVED.git-id b/external/lua/luajit/LuaJIT-2.0.1/src/vm_ppc.dasc.REMOVED.git-id similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/vm_ppc.dasc.REMOVED.git-id rename to external/lua/luajit/LuaJIT-2.0.1/src/vm_ppc.dasc.REMOVED.git-id diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/vm_ppcspe.dasc.REMOVED.git-id b/external/lua/luajit/LuaJIT-2.0.1/src/vm_ppcspe.dasc.REMOVED.git-id similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/vm_ppcspe.dasc.REMOVED.git-id rename to external/lua/luajit/LuaJIT-2.0.1/src/vm_ppcspe.dasc.REMOVED.git-id diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/vm_x86.dasc.REMOVED.git-id b/external/lua/luajit/LuaJIT-2.0.1/src/vm_x86.dasc.REMOVED.git-id similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/vm_x86.dasc.REMOVED.git-id rename to external/lua/luajit/LuaJIT-2.0.1/src/vm_x86.dasc.REMOVED.git-id diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/xedkbuild.bat b/external/lua/luajit/LuaJIT-2.0.1/src/xedkbuild.bat similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/xedkbuild.bat rename to external/lua/luajit/LuaJIT-2.0.1/src/xedkbuild.bat diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/v2.0.1_hotfix1.patch b/external/lua/luajit/LuaJIT-2.0.1/v2.0.1_hotfix1.patch similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/v2.0.1_hotfix1.patch rename to external/lua/luajit/LuaJIT-2.0.1/v2.0.1_hotfix1.patch diff --git a/cocos/scripting/lua/luajit/android/armeabi-v7a/libluajit.a.REMOVED.git-id b/external/lua/luajit/android/armeabi-v7a/libluajit.a.REMOVED.git-id similarity index 100% rename from cocos/scripting/lua/luajit/android/armeabi-v7a/libluajit.a.REMOVED.git-id rename to external/lua/luajit/android/armeabi-v7a/libluajit.a.REMOVED.git-id diff --git a/cocos/scripting/lua/luajit/android/armeabi/libluajit.a.REMOVED.git-id b/external/lua/luajit/android/armeabi/libluajit.a.REMOVED.git-id similarity index 100% rename from cocos/scripting/lua/luajit/android/armeabi/libluajit.a.REMOVED.git-id rename to external/lua/luajit/android/armeabi/libluajit.a.REMOVED.git-id diff --git a/cocos/scripting/lua/luajit/android/x86/libluajit.a.REMOVED.git-id b/external/lua/luajit/android/x86/libluajit.a.REMOVED.git-id similarity index 100% rename from cocos/scripting/lua/luajit/android/x86/libluajit.a.REMOVED.git-id rename to external/lua/luajit/android/x86/libluajit.a.REMOVED.git-id diff --git a/cocos/scripting/lua/luajit/build_android.sh b/external/lua/luajit/build_android.sh similarity index 100% rename from cocos/scripting/lua/luajit/build_android.sh rename to external/lua/luajit/build_android.sh diff --git a/cocos/scripting/lua/luajit/build_ios.sh b/external/lua/luajit/build_ios.sh similarity index 100% rename from cocos/scripting/lua/luajit/build_ios.sh rename to external/lua/luajit/build_ios.sh diff --git a/cocos/scripting/lua/luajit/build_mac.sh b/external/lua/luajit/build_mac.sh similarity index 100% rename from cocos/scripting/lua/luajit/build_mac.sh rename to external/lua/luajit/build_mac.sh diff --git a/cocos/scripting/lua/luajit/include/lauxlib.h b/external/lua/luajit/include/lauxlib.h similarity index 100% rename from cocos/scripting/lua/luajit/include/lauxlib.h rename to external/lua/luajit/include/lauxlib.h diff --git a/cocos/scripting/lua/luajit/include/lua.h b/external/lua/luajit/include/lua.h similarity index 100% rename from cocos/scripting/lua/luajit/include/lua.h rename to external/lua/luajit/include/lua.h diff --git a/cocos/scripting/lua/luajit/include/luaconf.h b/external/lua/luajit/include/luaconf.h similarity index 100% rename from cocos/scripting/lua/luajit/include/luaconf.h rename to external/lua/luajit/include/luaconf.h diff --git a/cocos/scripting/lua/luajit/include/lualib.h b/external/lua/luajit/include/lualib.h similarity index 100% rename from cocos/scripting/lua/luajit/include/lualib.h rename to external/lua/luajit/include/lualib.h diff --git a/cocos/scripting/lua/luajit/ios/libluajit.a.REMOVED.git-id b/external/lua/luajit/ios/libluajit.a.REMOVED.git-id similarity index 100% rename from cocos/scripting/lua/luajit/ios/libluajit.a.REMOVED.git-id rename to external/lua/luajit/ios/libluajit.a.REMOVED.git-id diff --git a/cocos/scripting/lua/luajit/mac/libluajit.a.REMOVED.git-id b/external/lua/luajit/mac/libluajit.a.REMOVED.git-id similarity index 100% rename from cocos/scripting/lua/luajit/mac/libluajit.a.REMOVED.git-id rename to external/lua/luajit/mac/libluajit.a.REMOVED.git-id diff --git a/cocos/scripting/lua/luajit/win32/lua51.dll.REMOVED.git-id b/external/lua/luajit/win32/lua51.dll.REMOVED.git-id similarity index 100% rename from cocos/scripting/lua/luajit/win32/lua51.dll.REMOVED.git-id rename to external/lua/luajit/win32/lua51.dll.REMOVED.git-id diff --git a/cocos/scripting/lua/tolua/tolua++.h b/external/lua/tolua/tolua++.h similarity index 100% rename from cocos/scripting/lua/tolua/tolua++.h rename to external/lua/tolua/tolua++.h diff --git a/cocos/scripting/lua/tolua/tolua_event.c b/external/lua/tolua/tolua_event.c similarity index 100% rename from cocos/scripting/lua/tolua/tolua_event.c rename to external/lua/tolua/tolua_event.c diff --git a/cocos/scripting/lua/tolua/tolua_event.h b/external/lua/tolua/tolua_event.h similarity index 100% rename from cocos/scripting/lua/tolua/tolua_event.h rename to external/lua/tolua/tolua_event.h diff --git a/cocos/scripting/lua/tolua/tolua_is.c b/external/lua/tolua/tolua_is.c similarity index 100% rename from cocos/scripting/lua/tolua/tolua_is.c rename to external/lua/tolua/tolua_is.c diff --git a/cocos/scripting/lua/tolua/tolua_map.c b/external/lua/tolua/tolua_map.c similarity index 100% rename from cocos/scripting/lua/tolua/tolua_map.c rename to external/lua/tolua/tolua_map.c diff --git a/cocos/scripting/lua/tolua/tolua_push.c b/external/lua/tolua/tolua_push.c similarity index 100% rename from cocos/scripting/lua/tolua/tolua_push.c rename to external/lua/tolua/tolua_push.c diff --git a/cocos/scripting/lua/tolua/tolua_to.c b/external/lua/tolua/tolua_to.c similarity index 100% rename from cocos/scripting/lua/tolua/tolua_to.c rename to external/lua/tolua/tolua_to.c From 8f7a489a4d43131b575b4727388303f0736d129a Mon Sep 17 00:00:00 2001 From: minggo Date: Wed, 16 Oct 2013 16:48:39 +0800 Subject: [PATCH 45/64] issue #2905:make cocostudio and gui flat --- cocos/2d/Android.mk | 310 +++++++++--------- .../cocosbuilder/CCBAnimationManager.h | 2 +- cocos/editor-support/cocostudio/Android.mk | 72 ++-- .../cocostudio/{action => }/CCActionFrame.cpp | 0 .../cocostudio/{action => }/CCActionFrame.h | 0 .../{action => }/CCActionFrameEasing.cpp | 4 +- .../{action => }/CCActionFrameEasing.h | 2 +- .../{action => }/CCActionManagerEx.cpp | 4 +- .../{action => }/CCActionManagerEx.h | 4 +- .../cocostudio/{action => }/CCActionNode.cpp | 10 +- .../cocostudio/{action => }/CCActionNode.h | 4 +- .../{action => }/CCActionObject.cpp | 4 +- .../cocostudio/{action => }/CCActionObject.h | 2 +- .../cocostudio/{armature => }/CCArmature.cpp | 12 +- .../cocostudio/{armature => }/CCArmature.h | 12 +- .../animation => }/CCArmatureAnimation.cpp | 12 +- .../animation => }/CCArmatureAnimation.h | 2 +- .../utils => }/CCArmatureDataManager.cpp | 8 +- .../utils => }/CCArmatureDataManager.h | 4 +- .../{armature/utils => }/CCArmatureDefine.cpp | 2 +- .../{armature/utils => }/CCArmatureDefine.h | 0 .../{armature/display => }/CCBatchNode.cpp | 6 +- .../{armature/display => }/CCBatchNode.h | 2 +- .../cocostudio/{armature => }/CCBone.cpp | 12 +- .../cocostudio/{armature => }/CCBone.h | 10 +- .../physics => }/CCColliderDetector.cpp | 6 +- .../physics => }/CCColliderDetector.h | 4 +- .../{components => }/CCComAttribute.cpp | 2 +- .../{components => }/CCComAttribute.h | 2 +- .../{components => }/CCComAudio.cpp | 2 +- .../cocostudio/{components => }/CCComAudio.h | 0 .../{components => }/CCComController.cpp | 2 +- .../{components => }/CCComController.h | 2 +- .../{components => }/CCComRender.cpp | 2 +- .../cocostudio/{components => }/CCComRender.h | 0 .../utils => }/CCDataReaderHelper.cpp | 12 +- .../{armature/utils => }/CCDataReaderHelper.h | 8 +- .../{armature/datas => }/CCDatas.cpp | 6 +- .../cocostudio/{armature/datas => }/CCDatas.h | 4 +- .../display => }/CCDecorativeDisplay.cpp | 2 +- .../display => }/CCDecorativeDisplay.h | 8 +- .../display => }/CCDisplayFactory.cpp | 14 +- .../{armature/display => }/CCDisplayFactory.h | 4 +- .../display => }/CCDisplayManager.cpp | 10 +- .../{armature/display => }/CCDisplayManager.h | 6 +- .../{components => }/CCInputDelegate.cpp | 2 +- .../{components => }/CCInputDelegate.h | 0 .../animation => }/CCProcessBase.cpp | 4 +- .../{armature/animation => }/CCProcessBase.h | 4 +- .../cocostudio/{reader => }/CCSGUIReader.cpp | 8 +- .../cocostudio/{reader => }/CCSGUIReader.h | 4 +- .../{reader => }/CCSSceneReader.cpp | 5 +- .../cocostudio/{reader => }/CCSSceneReader.h | 2 +- .../{armature/display => }/CCSkin.cpp | 8 +- .../{armature/display => }/CCSkin.h | 4 +- .../utils => }/CCSpriteFrameCacheHelper.cpp | 2 +- .../utils => }/CCSpriteFrameCacheHelper.h | 2 +- .../{armature/utils => }/CCTransformHelp.cpp | 4 +- .../{armature/utils => }/CCTransformHelp.h | 4 +- .../{armature/animation => }/CCTween.cpp | 14 +- .../{armature/animation => }/CCTween.h | 4 +- .../{armature/utils => }/CCTweenFunction.cpp | 4 +- .../{armature/utils => }/CCTweenFunction.h | 2 +- .../{armature/utils => }/CCUtilMath.cpp | 2 +- .../{armature/utils => }/CCUtilMath.h | 2 +- .../{json => }/CSContentJsonDictionary.cpp | 2 +- .../{json => }/CSContentJsonDictionary.h | 0 cocos/editor-support/cocostudio/CocoStudio.h | 66 ++-- .../{json => }/DictionaryHelper.cpp | 2 +- .../cocostudio/{json => }/DictionaryHelper.h | 2 +- .../editor-support/cocostudio/json/.DS_Store | Bin 6148 -> 0 bytes cocos/gui/Android.mk | 47 ++- cocos/gui/{system => }/CocosGUI.cpp | 2 +- cocos/gui/{system => }/CocosGUI.h | 37 +-- cocos/gui/{layouts => }/Layout.cpp | 6 +- cocos/gui/{layouts => }/Layout.h | 2 +- cocos/gui/{layouts => }/LayoutParameter.cpp | 4 +- cocos/gui/{layouts => }/LayoutParameter.h | 2 +- cocos/gui/{widgets => }/UIButton.cpp | 2 +- cocos/gui/{widgets => }/UIButton.h | 2 +- cocos/gui/{widgets => }/UICheckBox.cpp | 2 +- cocos/gui/{widgets => }/UICheckBox.h | 2 +- .../scroll-widget => }/UIDragPanel.cpp | 4 +- .../{widgets/scroll-widget => }/UIDragPanel.h | 4 +- cocos/gui/{system => }/UIHelper.cpp | 7 +- cocos/gui/{system => }/UIHelper.h | 4 +- cocos/gui/{widgets => }/UIImageView.cpp | 2 +- cocos/gui/{widgets => }/UIImageView.h | 2 +- cocos/gui/{system => }/UIInputManager.cpp | 4 +- cocos/gui/{system => }/UIInputManager.h | 2 +- cocos/gui/{widgets => }/UILabel.cpp | 2 +- cocos/gui/{widgets => }/UILabel.h | 2 +- cocos/gui/{widgets => }/UILabelAtlas.cpp | 2 +- cocos/gui/{widgets => }/UILabelAtlas.h | 2 +- cocos/gui/{widgets => }/UILabelBMFont.cpp | 2 +- cocos/gui/{widgets => }/UILabelBMFont.h | 2 +- cocos/gui/{system => }/UILayer.cpp | 4 +- cocos/gui/{system => }/UILayer.h | 4 +- cocos/gui/{layouts => }/UILayoutDefine.cpp | 2 +- cocos/gui/{layouts => }/UILayoutDefine.h | 0 .../scroll-widget => }/UIListView.cpp | 2 +- .../{widgets/scroll-widget => }/UIListView.h | 2 +- cocos/gui/{widgets => }/UILoadingBar.cpp | 2 +- cocos/gui/{widgets => }/UILoadingBar.h | 2 +- .../scroll-widget => }/UIPageView.cpp | 2 +- .../{widgets/scroll-widget => }/UIPageView.h | 4 +- cocos/gui/{base-classes => }/UIRootWidget.cpp | 2 +- cocos/gui/{base-classes => }/UIRootWidget.h | 2 +- .../scroll-widget => }/UIScrollInterface.h | 2 +- .../scroll-widget => }/UIScrollView.cpp | 4 +- .../scroll-widget => }/UIScrollView.h | 4 +- cocos/gui/{widgets => }/UISlider.cpp | 2 +- cocos/gui/{widgets => }/UISlider.h | 2 +- cocos/gui/{widgets => }/UITextField.cpp | 2 +- cocos/gui/{widgets => }/UITextField.h | 2 +- cocos/gui/{base-classes => }/UIWidget.cpp | 8 +- cocos/gui/{base-classes => }/UIWidget.h | 4 +- cocos/network/Android.mk | 5 +- cocos/network/HttpClient.h | 6 +- cocos/network/HttpResponse.h | 2 +- extensions/Android.mk | 5 +- extensions/GUI/CCEditBox/CCEditBox.h | 2 +- extensions/GUI/CCEditBox/CCEditBoxImpl.h | 2 +- .../GUI/CCEditBox/CCEditBoxImplAndroid.h | 2 +- extensions/GUI/CCEditBox/CCEditBoxImplIOS.h | 2 +- extensions/GUI/CCEditBox/CCEditBoxImplMac.h | 2 +- extensions/GUI/CCEditBox/CCEditBoxImplTizen.h | 2 +- extensions/GUI/CCEditBox/CCEditBoxImplWin.h | 2 +- extensions/GUI/CCScrollView/CCScrollView.h | 2 +- extensions/GUI/CCScrollView/CCSorting.h | 2 +- extensions/assets-manager/AssetsManager.h | 2 +- extensions/physics-nodes/CCPhysicsDebugNode.h | 2 +- extensions/physics-nodes/CCPhysicsSprite.h | 2 +- samples/Cpp/TestCpp/Android.mk | 264 +++++++-------- samples/Cpp/TestCpp/Classes/AppDelegate.cpp | 2 +- .../TestCpp/Classes/Box2DTest/Box2dTest.cpp | 2 +- .../Classes/ChipmunkTest/ChipmunkTest.h | 2 +- .../CocosDenshionTest/CocosDenshionTest.cpp | 2 +- .../CocoStudioArmatureTest/ArmatureScene.h | 2 +- .../ComponentsTestScene.h | 2 +- .../EnemyController.h | 2 +- .../PlayerController.h | 2 +- .../ProjectileController.h | 2 +- .../SceneController.h | 2 +- .../CocoStudioGUITest/CocosGUIScene.h | 4 +- .../UINodeContainerTest.cpp | 2 +- .../CocoStudioGUITest/UIScene.cpp | 2 +- .../CocoStudioGUITest/UIScene.h | 4 +- .../CocoStudioSceneTest/SceneEditorTest.cpp | 4 +- .../CocoStudioSceneTest/SceneEditorTest.h | 2 +- .../AnimationsTest/AnimationsTestLayer.h | 2 +- .../ButtonTest/ButtonTestLayer.h | 2 +- .../HelloCocosBuilderLayer.h | 2 +- .../LabelTest/LabelTestLayer.h | 2 +- .../CocosBuilderTest/MenuTest/MenuTestLayer.h | 2 +- .../ParticleSystemTestLayer.h | 2 +- .../ScrollViewTest/ScrollViewTestLayer.h | 2 +- .../SpriteTest/SpriteTestLayer.h | 2 +- .../TestHeader/TestHeaderLayer.h | 2 +- .../TimelineCallbackTestLayer.h | 2 +- .../CCControlColourPickerTest.h | 2 +- .../ControlExtensionTest/CCControlScene.h | 2 +- .../CCControlSceneManager.h | 2 +- .../ExtensionsTest/EditBoxTest/EditBoxTest.h | 2 +- .../NetworkTest/HttpClientTest.h | 4 +- .../ExtensionsTest/NetworkTest/SocketIOTest.h | 4 +- .../NetworkTest/WebSocketTest.h | 4 +- .../Scale9SpriteTest/Scale9SpriteTest.cpp | 2 +- .../TableViewTest/CustomTableViewCell.h | 2 +- .../TableViewTest/TableViewTestScene.h | 2 +- .../Classes/SchedulerTest/SchedulerTest.h | 2 +- .../TestCpp/Classes/ShaderTest/ShaderTest.h | 2 +- .../TestCpp/Classes/ShaderTest/ShaderTest2.h | 2 +- samples/Cpp/TestCpp/Classes/testBasic.cpp | 2 +- .../Cpp/TestCpp/proj.android/jni/Android.mk | 2 +- samples/Lua/HelloLua/Classes/AppDelegate.cpp | 2 +- .../Lua/HelloLua/proj.android/build_native.sh | 4 +- .../Lua/HelloLua/proj.android/jni/Android.mk | 11 +- 178 files changed, 682 insertions(+), 691 deletions(-) rename cocos/editor-support/cocostudio/{action => }/CCActionFrame.cpp (100%) rename cocos/editor-support/cocostudio/{action => }/CCActionFrame.h (100%) rename cocos/editor-support/cocostudio/{action => }/CCActionFrameEasing.cpp (98%) rename cocos/editor-support/cocostudio/{action => }/CCActionFrameEasing.h (97%) rename cocos/editor-support/cocostudio/{action => }/CCActionManagerEx.cpp (97%) rename cocos/editor-support/cocostudio/{action => }/CCActionManagerEx.h (96%) rename cocos/editor-support/cocostudio/{action => }/CCActionNode.cpp (98%) rename cocos/editor-support/cocostudio/{action => }/CCActionNode.h (98%) rename cocos/editor-support/cocostudio/{action => }/CCActionObject.cpp (98%) rename cocos/editor-support/cocostudio/{action => }/CCActionObject.h (98%) rename cocos/editor-support/cocostudio/{armature => }/CCArmature.cpp (98%) rename cocos/editor-support/cocostudio/{armature => }/CCArmature.h (96%) rename cocos/editor-support/cocostudio/{armature/animation => }/CCArmatureAnimation.cpp (97%) rename cocos/editor-support/cocostudio/{armature/animation => }/CCArmatureAnimation.h (99%) rename cocos/editor-support/cocostudio/{armature/utils => }/CCArmatureDataManager.cpp (97%) rename cocos/editor-support/cocostudio/{armature/utils => }/CCArmatureDataManager.h (98%) rename cocos/editor-support/cocostudio/{armature/utils => }/CCArmatureDefine.cpp (96%) rename cocos/editor-support/cocostudio/{armature/utils => }/CCArmatureDefine.h (100%) rename cocos/editor-support/cocostudio/{armature/display => }/CCBatchNode.cpp (95%) rename cocos/editor-support/cocostudio/{armature/display => }/CCBatchNode.h (96%) rename cocos/editor-support/cocostudio/{armature => }/CCBone.cpp (97%) rename cocos/editor-support/cocostudio/{armature => }/CCBone.h (96%) rename cocos/editor-support/cocostudio/{armature/physics => }/CCColliderDetector.cpp (98%) rename cocos/editor-support/cocostudio/{armature/physics => }/CCColliderDetector.h (96%) rename cocos/editor-support/cocostudio/{components => }/CCComAttribute.cpp (99%) rename cocos/editor-support/cocostudio/{components => }/CCComAttribute.h (97%) rename cocos/editor-support/cocostudio/{components => }/CCComAudio.cpp (99%) rename cocos/editor-support/cocostudio/{components => }/CCComAudio.h (100%) rename cocos/editor-support/cocostudio/{components => }/CCComController.cpp (97%) rename cocos/editor-support/cocostudio/{components => }/CCComController.h (97%) rename cocos/editor-support/cocostudio/{components => }/CCComRender.cpp (98%) rename cocos/editor-support/cocostudio/{components => }/CCComRender.h (100%) rename cocos/editor-support/cocostudio/{armature/utils => }/CCDataReaderHelper.cpp (99%) rename cocos/editor-support/cocostudio/{armature/utils => }/CCDataReaderHelper.h (96%) rename cocos/editor-support/cocostudio/{armature/datas => }/CCDatas.cpp (98%) rename cocos/editor-support/cocostudio/{armature/datas => }/CCDatas.h (99%) rename cocos/editor-support/cocostudio/{armature/display => }/CCDecorativeDisplay.cpp (97%) rename cocos/editor-support/cocostudio/{armature/display => }/CCDecorativeDisplay.h (91%) rename cocos/editor-support/cocostudio/{armature/display => }/CCDisplayFactory.cpp (96%) rename cocos/editor-support/cocostudio/{armature/display => }/CCDisplayFactory.h (96%) rename cocos/editor-support/cocostudio/{armature/display => }/CCDisplayManager.cpp (97%) rename cocos/editor-support/cocostudio/{armature/display => }/CCDisplayManager.h (96%) rename cocos/editor-support/cocostudio/{components => }/CCInputDelegate.cpp (99%) rename cocos/editor-support/cocostudio/{components => }/CCInputDelegate.h (100%) rename cocos/editor-support/cocostudio/{armature/animation => }/CCProcessBase.cpp (98%) rename cocos/editor-support/cocostudio/{armature/animation => }/CCProcessBase.h (98%) rename cocos/editor-support/cocostudio/{reader => }/CCSGUIReader.cpp (99%) rename cocos/editor-support/cocostudio/{reader => }/CCSGUIReader.h (97%) rename cocos/editor-support/cocostudio/{reader => }/CCSSceneReader.cpp (99%) rename cocos/editor-support/cocostudio/{reader => }/CCSSceneReader.h (97%) rename cocos/editor-support/cocostudio/{armature/display => }/CCSkin.cpp (96%) rename cocos/editor-support/cocostudio/{armature/display => }/CCSkin.h (95%) rename cocos/editor-support/cocostudio/{armature/utils => }/CCSpriteFrameCacheHelper.cpp (98%) rename cocos/editor-support/cocostudio/{armature/utils => }/CCSpriteFrameCacheHelper.h (98%) rename cocos/editor-support/cocostudio/{armature/utils => }/CCTransformHelp.cpp (98%) rename cocos/editor-support/cocostudio/{armature/utils => }/CCTransformHelp.h (96%) rename cocos/editor-support/cocostudio/{armature/animation => }/CCTween.cpp (97%) rename cocos/editor-support/cocostudio/{armature/animation => }/CCTween.h (98%) rename cocos/editor-support/cocostudio/{armature/utils => }/CCTweenFunction.cpp (99%) rename cocos/editor-support/cocostudio/{armature/utils => }/CCTweenFunction.h (99%) rename cocos/editor-support/cocostudio/{armature/utils => }/CCUtilMath.cpp (98%) rename cocos/editor-support/cocostudio/{armature/utils => }/CCUtilMath.h (98%) rename cocos/editor-support/cocostudio/{json => }/CSContentJsonDictionary.cpp (99%) rename cocos/editor-support/cocostudio/{json => }/CSContentJsonDictionary.h (100%) rename cocos/editor-support/cocostudio/{json => }/DictionaryHelper.cpp (99%) rename cocos/editor-support/cocostudio/{json => }/DictionaryHelper.h (98%) delete mode 100644 cocos/editor-support/cocostudio/json/.DS_Store rename cocos/gui/{system => }/CocosGUI.cpp (98%) rename cocos/gui/{system => }/CocosGUI.h (67%) rename cocos/gui/{layouts => }/Layout.cpp (99%) rename cocos/gui/{layouts => }/Layout.h (99%) rename cocos/gui/{layouts => }/LayoutParameter.cpp (98%) rename cocos/gui/{layouts => }/LayoutParameter.h (99%) rename cocos/gui/{widgets => }/UIButton.cpp (99%) rename cocos/gui/{widgets => }/UIButton.h (99%) rename cocos/gui/{widgets => }/UICheckBox.cpp (99%) rename cocos/gui/{widgets => }/UICheckBox.h (99%) rename cocos/gui/{widgets/scroll-widget => }/UIDragPanel.cpp (99%) rename cocos/gui/{widgets/scroll-widget => }/UIDragPanel.h (99%) rename cocos/gui/{system => }/UIHelper.cpp (98%) rename cocos/gui/{system => }/UIHelper.h (97%) rename cocos/gui/{widgets => }/UIImageView.cpp (99%) rename cocos/gui/{widgets => }/UIImageView.h (99%) rename cocos/gui/{system => }/UIInputManager.cpp (99%) rename cocos/gui/{system => }/UIInputManager.h (99%) rename cocos/gui/{widgets => }/UILabel.cpp (99%) rename cocos/gui/{widgets => }/UILabel.h (99%) rename cocos/gui/{widgets => }/UILabelAtlas.cpp (99%) rename cocos/gui/{widgets => }/UILabelAtlas.h (98%) rename cocos/gui/{widgets => }/UILabelBMFont.cpp (99%) rename cocos/gui/{widgets => }/UILabelBMFont.h (98%) rename cocos/gui/{system => }/UILayer.cpp (98%) rename cocos/gui/{system => }/UILayer.h (98%) rename cocos/gui/{layouts => }/UILayoutDefine.cpp (98%) rename cocos/gui/{layouts => }/UILayoutDefine.h (100%) rename cocos/gui/{widgets/scroll-widget => }/UIListView.cpp (99%) rename cocos/gui/{widgets/scroll-widget => }/UIListView.h (99%) rename cocos/gui/{widgets => }/UILoadingBar.cpp (99%) rename cocos/gui/{widgets => }/UILoadingBar.h (99%) rename cocos/gui/{widgets/scroll-widget => }/UIPageView.cpp (99%) rename cocos/gui/{widgets/scroll-widget => }/UIPageView.h (98%) rename cocos/gui/{base-classes => }/UIRootWidget.cpp (98%) rename cocos/gui/{base-classes => }/UIRootWidget.h (98%) rename cocos/gui/{widgets/scroll-widget => }/UIScrollInterface.h (98%) rename cocos/gui/{widgets/scroll-widget => }/UIScrollView.cpp (99%) rename cocos/gui/{widgets/scroll-widget => }/UIScrollView.h (99%) rename cocos/gui/{widgets => }/UISlider.cpp (99%) rename cocos/gui/{widgets => }/UISlider.h (99%) rename cocos/gui/{widgets => }/UITextField.cpp (99%) rename cocos/gui/{widgets => }/UITextField.h (99%) rename cocos/gui/{base-classes => }/UIWidget.cpp (99%) rename cocos/gui/{base-classes => }/UIWidget.h (99%) diff --git a/cocos/2d/Android.mk b/cocos/2d/Android.mk index 74c8b0313f..20017089fe 100644 --- a/cocos/2d/Android.mk +++ b/cocos/2d/Android.mk @@ -7,165 +7,164 @@ LOCAL_MODULE := cocos2dx_static LOCAL_MODULE_FILENAME := libcocos2d LOCAL_SRC_FILES := \ -$(LOCAL_PATH)/base64.cpp \ -$(LOCAL_PATH)/CCAction.cpp \ -$(LOCAL_PATH)/CCActionCamera.cpp \ -$(LOCAL_PATH)/CCActionCatmullRom.cpp \ -$(LOCAL_PATH)/CCActionEase.cpp \ -$(LOCAL_PATH)/CCActionGrid.cpp \ -$(LOCAL_PATH)/CCActionGrid3D.cpp \ -$(LOCAL_PATH)/CCActionInstant.cpp \ -$(LOCAL_PATH)/CCActionInterval.cpp \ -$(LOCAL_PATH)/CCActionManager.cpp \ -$(LOCAL_PATH)/CCActionPageTurn3D.cpp \ -$(LOCAL_PATH)/CCActionProgressTimer.cpp \ -$(LOCAL_PATH)/CCActionTiledGrid.cpp \ -$(LOCAL_PATH)/CCActionTween.cpp \ -$(LOCAL_PATH)/CCAnimation.cpp \ -$(LOCAL_PATH)/CCAnimationCache.cpp \ -$(LOCAL_PATH)/CCAtlasNode.cpp \ -$(LOCAL_PATH)/CCCamera.cpp \ -$(LOCAL_PATH)/ccCArray.cpp \ -$(LOCAL_PATH)/CCClippingNode.cpp \ -$(LOCAL_PATH)/CCComponent.cpp \ -$(LOCAL_PATH)/CCComponentContainer.cpp \ -$(LOCAL_PATH)/CCConfiguration.cpp \ -$(LOCAL_PATH)/CCDeprecated.cpp \ -$(LOCAL_PATH)/CCDirector.cpp \ -$(LOCAL_PATH)/CCDrawingPrimitives.cpp \ -$(LOCAL_PATH)/CCDrawNode.cpp \ -$(LOCAL_PATH)/CCEvent.cpp \ -$(LOCAL_PATH)/CCEventAcceleration.cpp \ -$(LOCAL_PATH)/CCEventCustom.cpp \ -$(LOCAL_PATH)/CCEventDispatcher.cpp \ -$(LOCAL_PATH)/CCEventKeyboard.cpp \ -$(LOCAL_PATH)/CCEventListener.cpp \ -$(LOCAL_PATH)/CCEventListenerAcceleration.cpp \ -$(LOCAL_PATH)/CCEventListenerCustom.cpp \ -$(LOCAL_PATH)/CCEventListenerKeyboard.cpp \ -$(LOCAL_PATH)/CCEventListenerTouch.cpp \ -$(LOCAL_PATH)/CCEventTouch.cpp \ -$(LOCAL_PATH)/CCFont.cpp \ -$(LOCAL_PATH)/CCFontAtlas.cpp \ -$(LOCAL_PATH)/CCFontAtlasCache.cpp \ -$(LOCAL_PATH)/CCFontAtlasFactory.cpp \ -$(LOCAL_PATH)/CCFontDefinition.cpp \ -$(LOCAL_PATH)/CCFontFNT.cpp \ -$(LOCAL_PATH)/CCFontFreeType.cpp \ -$(LOCAL_PATH)/ccFPSImages.c \ -$(LOCAL_PATH)/CCGLBufferedNode.cpp \ -$(LOCAL_PATH)/CCGLProgram.cpp \ -$(LOCAL_PATH)/ccGLStateCache.cpp \ -$(LOCAL_PATH)/CCGrabber.cpp \ -$(LOCAL_PATH)/CCGrid.cpp \ -$(LOCAL_PATH)/CCIMEDispatcher.cpp \ -$(LOCAL_PATH)/CCLabel.cpp \ -$(LOCAL_PATH)/CCLabelAtlas.cpp \ -$(LOCAL_PATH)/CCLabelBMFont.cpp \ -$(LOCAL_PATH)/CCLabelTextFormatter.cpp \ -$(LOCAL_PATH)/CCLabelTTF.cpp \ -$(LOCAL_PATH)/CCLayer.cpp \ -$(LOCAL_PATH)/CCMenu.cpp \ -$(LOCAL_PATH)/CCMenuItem.cpp \ -$(LOCAL_PATH)/CCMotionStreak.cpp \ -$(LOCAL_PATH)/CCNode.cpp \ -$(LOCAL_PATH)/CCNotificationCenter.cpp \ -$(LOCAL_PATH)/CCParallaxNode.cpp \ -$(LOCAL_PATH)/CCParticleBatchNode.cpp \ -$(LOCAL_PATH)/CCParticleExamples.cpp \ -$(LOCAL_PATH)/CCParticleSystem.cpp \ -$(LOCAL_PATH)/CCParticleSystemQuad.cpp \ -$(LOCAL_PATH)/CCProfiling.cpp \ -$(LOCAL_PATH)/CCProgressTimer.cpp \ -$(LOCAL_PATH)/CCRenderTexture.cpp \ -$(LOCAL_PATH)/CCScene.cpp \ -$(LOCAL_PATH)/CCScheduler.cpp \ -$(LOCAL_PATH)/CCScriptSupport.cpp \ -$(LOCAL_PATH)/CCShaderCache.cpp \ -$(LOCAL_PATH)/ccShaders.cpp \ -$(LOCAL_PATH)/CCSprite.cpp \ -$(LOCAL_PATH)/CCSpriteBatchNode.cpp \ -$(LOCAL_PATH)/CCSpriteFrame.cpp \ -$(LOCAL_PATH)/CCSpriteFrameCache.cpp \ -$(LOCAL_PATH)/CCTextFieldTTF.cpp \ -$(LOCAL_PATH)/CCTextImage.cpp \ -$(LOCAL_PATH)/CCTexture2D.cpp \ -$(LOCAL_PATH)/CCTextureAtlas.cpp \ -$(LOCAL_PATH)/CCTextureCache.cpp \ -$(LOCAL_PATH)/CCTileMapAtlas.cpp \ -$(LOCAL_PATH)/CCTMXLayer.cpp \ -$(LOCAL_PATH)/CCTMXObjectGroup.cpp \ -$(LOCAL_PATH)/CCTMXTiledMap.cpp \ -$(LOCAL_PATH)/CCTMXXMLParser.cpp \ -$(LOCAL_PATH)/CCTouch.cpp \ -$(LOCAL_PATH)/CCTransition.cpp \ -$(LOCAL_PATH)/CCTransitionPageTurn.cpp \ -$(LOCAL_PATH)/CCTransitionProgress.cpp \ -$(LOCAL_PATH)/ccTypes.cpp \ -$(LOCAL_PATH)/CCUserDefault.cpp \ -$(LOCAL_PATH)/CCUserDefaultAndroid.cpp \ -$(LOCAL_PATH)/ccUTF8.cpp \ -$(LOCAL_PATH)/ccUtils.cpp \ -$(LOCAL_PATH)/CCVertex.cpp \ -$(LOCAL_PATH)/cocos2d.cpp \ -$(LOCAL_PATH)/TGAlib.cpp \ -$(LOCAL_PATH)/TransformUtils.cpp \ -$(LOCAL_PATH)/ZipUtils.cpp \ -$(LOCAL_PATH)/platform/CCEGLViewProtocol.cpp \ -$(LOCAL_PATH)/platform/CCFileUtils.cpp \ -$(LOCAL_PATH)/platform/CCSAXParser.cpp \ -$(LOCAL_PATH)/platform/CCThread.cpp \ -$(LOCAL_PATH)/../base/atitc.cpp \ -$(LOCAL_PATH)/../base/CCAffineTransform.cpp \ -$(LOCAL_PATH)/../base/CCArray.cpp \ -$(LOCAL_PATH)/../base/CCAutoreleasePool.cpp \ -$(LOCAL_PATH)/../base/CCData.cpp \ -$(LOCAL_PATH)/../base/CCDataVisitor.cpp \ -$(LOCAL_PATH)/../base/CCDictionary.cpp \ -$(LOCAL_PATH)/../base/CCGeometry.cpp \ -$(LOCAL_PATH)/../base/CCNS.cpp \ -$(LOCAL_PATH)/../base/CCObject.cpp \ -$(LOCAL_PATH)/../base/CCSet.cpp \ -$(LOCAL_PATH)/../base/CCString.cpp \ -$(LOCAL_PATH)/../base/etc1.cpp \ -$(LOCAL_PATH)/../base/s3tc.cpp \ -$(LOCAL_PATH)/../math/kazmath/src/aabb.c \ -$(LOCAL_PATH)/../math/kazmath/src/mat3.c \ -$(LOCAL_PATH)/../math/kazmath/src/mat4.c \ -$(LOCAL_PATH)/../math/kazmath/src/neon_matrix_impl.c \ -$(LOCAL_PATH)/../math/kazmath/src/plane.c \ -$(LOCAL_PATH)/../math/kazmath/src/quaternion.c \ -$(LOCAL_PATH)/../math/kazmath/src/ray2.c \ -$(LOCAL_PATH)/../math/kazmath/src/utility.c \ -$(LOCAL_PATH)/../math/kazmath/src/vec2.c \ -$(LOCAL_PATH)/../math/kazmath/src/vec3.c \ -$(LOCAL_PATH)/../math/kazmath/src/vec4.c \ -$(LOCAL_PATH)/../math/kazmath/src/GL/mat4stack.c \ -$(LOCAL_PATH)/../math/kazmath/src/GL/matrix.c \ -$(LOCAL_PATH)/../physics/CCPhysicsBody.cpp \ -$(LOCAL_PATH)/../physics/CCPhysicsContact.cpp \ -$(LOCAL_PATH)/../physics/CCPhysicsJoint.cpp \ -$(LOCAL_PATH)/../physics/CCPhysicsShape.cpp \ -$(LOCAL_PATH)/../physics/CCPhysicsWorld.cpp \ -$(LOCAL_PATH)/../physics/box2d/CCPhysicsBodyInfo.cpp \ -$(LOCAL_PATH)/../physics/box2d/CCPhysicsContactInfo.cpp \ -$(LOCAL_PATH)/../physics/box2d/CCPhysicsJointInfo.cpp \ -$(LOCAL_PATH)/../physics/box2d/CCPhysicsShapeInfo.cpp \ -$(LOCAL_PATH)/../physics/box2d/CCPhysicsWorldInfo.cpp \ -$(LOCAL_PATH)/../physics/chipmunk/CCPhysicsBodyInfo.cpp \ -$(LOCAL_PATH)/../physics/chipmunk/CCPhysicsContactInfo.cpp \ -$(LOCAL_PATH)/../physics/chipmunk/CCPhysicsJointInfo.cpp \ -$(LOCAL_PATH)/../physics/chipmunk/CCPhysicsShapeInfo.cpp \ -$(LOCAL_PATH)/../physics/chipmunk/CCPhysicsWorldInfo.cpp \ -$(LOCAL_PATH)/../../external/tinyxml2/tinyxml2.cpp \ -$(LOCAL_PATH)/../../external/unzip/ioapi.cpp \ -$(LOCAL_PATH)/../../external/unzip/unzip.cpp +base64.cpp \ +CCAction.cpp \ +CCActionCamera.cpp \ +CCActionCatmullRom.cpp \ +CCActionEase.cpp \ +CCActionGrid.cpp \ +CCActionGrid3D.cpp \ +CCActionInstant.cpp \ +CCActionInterval.cpp \ +CCActionManager.cpp \ +CCActionPageTurn3D.cpp \ +CCActionProgressTimer.cpp \ +CCActionTiledGrid.cpp \ +CCActionTween.cpp \ +CCAnimation.cpp \ +CCAnimationCache.cpp \ +CCAtlasNode.cpp \ +CCCamera.cpp \ +ccCArray.cpp \ +CCClippingNode.cpp \ +CCComponent.cpp \ +CCComponentContainer.cpp \ +CCConfiguration.cpp \ +CCDeprecated.cpp \ +CCDirector.cpp \ +CCDrawingPrimitives.cpp \ +CCDrawNode.cpp \ +CCEvent.cpp \ +CCEventAcceleration.cpp \ +CCEventCustom.cpp \ +CCEventDispatcher.cpp \ +CCEventKeyboard.cpp \ +CCEventListener.cpp \ +CCEventListenerAcceleration.cpp \ +CCEventListenerCustom.cpp \ +CCEventListenerKeyboard.cpp \ +CCEventListenerTouch.cpp \ +CCEventTouch.cpp \ +CCFont.cpp \ +CCFontAtlas.cpp \ +CCFontAtlasCache.cpp \ +CCFontAtlasFactory.cpp \ +CCFontDefinition.cpp \ +CCFontFNT.cpp \ +CCFontFreeType.cpp \ +ccFPSImages.c \ +CCGLBufferedNode.cpp \ +CCGLProgram.cpp \ +ccGLStateCache.cpp \ +CCGrabber.cpp \ +CCGrid.cpp \ +CCIMEDispatcher.cpp \ +CCLabel.cpp \ +CCLabelAtlas.cpp \ +CCLabelBMFont.cpp \ +CCLabelTextFormatter.cpp \ +CCLabelTTF.cpp \ +CCLayer.cpp \ +CCMenu.cpp \ +CCMenuItem.cpp \ +CCMotionStreak.cpp \ +CCNode.cpp \ +CCNotificationCenter.cpp \ +CCParallaxNode.cpp \ +CCParticleBatchNode.cpp \ +CCParticleExamples.cpp \ +CCParticleSystem.cpp \ +CCParticleSystemQuad.cpp \ +CCProfiling.cpp \ +CCProgressTimer.cpp \ +CCRenderTexture.cpp \ +CCScene.cpp \ +CCScheduler.cpp \ +CCScriptSupport.cpp \ +CCShaderCache.cpp \ +ccShaders.cpp \ +CCSprite.cpp \ +CCSpriteBatchNode.cpp \ +CCSpriteFrame.cpp \ +CCSpriteFrameCache.cpp \ +CCTextFieldTTF.cpp \ +CCTextImage.cpp \ +CCTexture2D.cpp \ +CCTextureAtlas.cpp \ +CCTextureCache.cpp \ +CCTileMapAtlas.cpp \ +CCTMXLayer.cpp \ +CCTMXObjectGroup.cpp \ +CCTMXTiledMap.cpp \ +CCTMXXMLParser.cpp \ +CCTouch.cpp \ +CCTransition.cpp \ +CCTransitionPageTurn.cpp \ +CCTransitionProgress.cpp \ +ccTypes.cpp \ +CCUserDefault.cpp \ +CCUserDefaultAndroid.cpp \ +ccUTF8.cpp \ +ccUtils.cpp \ +CCVertex.cpp \ +cocos2d.cpp \ +TGAlib.cpp \ +TransformUtils.cpp \ +ZipUtils.cpp \ +platform/CCEGLViewProtocol.cpp \ +platform/CCFileUtils.cpp \ +platform/CCSAXParser.cpp \ +platform/CCThread.cpp \ +../base/atitc.cpp \ +../base/CCAffineTransform.cpp \ +../base/CCArray.cpp \ +../base/CCAutoreleasePool.cpp \ +../base/CCData.cpp \ +../base/CCDataVisitor.cpp \ +../base/CCDictionary.cpp \ +../base/CCGeometry.cpp \ +../base/CCNS.cpp \ +../base/CCObject.cpp \ +../base/CCSet.cpp \ +../base/CCString.cpp \ +../base/etc1.cpp \ +../base/s3tc.cpp \ +../math/kazmath/src/aabb.c \ +../math/kazmath/src/mat3.c \ +../math/kazmath/src/mat4.c \ +../math/kazmath/src/neon_matrix_impl.c \ +../math/kazmath/src/plane.c \ +../math/kazmath/src/quaternion.c \ +../math/kazmath/src/ray2.c \ +../math/kazmath/src/utility.c \ +../math/kazmath/src/vec2.c \ +../math/kazmath/src/vec3.c \ +../math/kazmath/src/vec4.c \ +../math/kazmath/src/GL/mat4stack.c \ +../math/kazmath/src/GL/matrix.c \ +../physics/CCPhysicsBody.cpp \ +../physics/CCPhysicsContact.cpp \ +../physics/CCPhysicsJoint.cpp \ +../physics/CCPhysicsShape.cpp \ +../physics/CCPhysicsWorld.cpp \ +../physics/box2d/CCPhysicsBodyInfo.cpp \ +../physics/box2d/CCPhysicsContactInfo.cpp \ +../physics/box2d/CCPhysicsJointInfo.cpp \ +../physics/box2d/CCPhysicsShapeInfo.cpp \ +../physics/box2d/CCPhysicsWorldInfo.cpp \ +../physics/chipmunk/CCPhysicsBodyInfo.cpp \ +../physics/chipmunk/CCPhysicsContactInfo.cpp \ +../physics/chipmunk/CCPhysicsJointInfo.cpp \ +../physics/chipmunk/CCPhysicsShapeInfo.cpp \ +../physics/chipmunk/CCPhysicsWorldInfo.cpp \ +../../external/tinyxml2/tinyxml2.cpp \ +../../external/unzip/ioapi.cpp \ +../../external/unzip/unzip.cpp LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) \ - $(LOCAL_PATH)/include \ $(LOCAL_PATH)/../math/kazmath/include \ - $(LOCAL_PATH)/platform/android \ + platform/android \ $(LOCAL_PATH)/../physics \ $(LOCAL_PATH)/../base \ $(LOCAL_PATH)/../../external/tinyxml2 \ @@ -173,7 +172,6 @@ LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) \ $(LOCAL_PATH)/../../external/chipmunk/include/chipmunk LOCAL_C_INCLUDES := $(LOCAL_PATH) \ - $(LOCAL_PATH)/include \ $(LOCAL_PATH)/../math/kazmath/include \ $(LOCAL_PATH)/platform/android \ $(LOCAL_PATH)/../physics \ diff --git a/cocos/editor-support/cocosbuilder/CCBAnimationManager.h b/cocos/editor-support/cocosbuilder/CCBAnimationManager.h index 83d962ffef..e9755bbfb1 100644 --- a/cocos/editor-support/cocosbuilder/CCBAnimationManager.h +++ b/cocos/editor-support/cocosbuilder/CCBAnimationManager.h @@ -2,7 +2,7 @@ #define __CCB_CCBANIMATION_MANAGER_H__ #include "cocos2d.h" -#include "ExtensionMacros.h" +#include "extensions/ExtensionMacros.h" #include "CCBSequence.h" #include "CCBValue.h" #include "CCBSequenceProperty.h" diff --git a/cocos/editor-support/cocostudio/Android.mk b/cocos/editor-support/cocostudio/Android.mk index 15b18c83d7..b7dfa3838c 100644 --- a/cocos/editor-support/cocostudio/Android.mk +++ b/cocos/editor-support/cocostudio/Android.mk @@ -5,50 +5,50 @@ LOCAL_MODULE := cocostudio_static LOCAL_MODULE_FILENAME := libcocostudio -LOCAL_SRC_FILES := action/CCActionFrame.cpp \ -action/CCActionFrameEasing.cpp \ -action/CCActionManagerEx.cpp \ -action/CCActionNode.cpp \ -action/CCActionObject.cpp \ -armature/CCArmature.cpp \ -armature/CCBone.cpp \ -armature/animation/CCArmatureAnimation.cpp \ -armature/animation/CCProcessBase.cpp \ -armature/animation/CCTween.cpp \ -armature/datas/CCDatas.cpp \ -armature/display/CCBatchNode.cpp \ -armature/display/CCDecorativeDisplay.cpp \ -armature/display/CCDisplayFactory.cpp \ -armature/display/CCDisplayManager.cpp \ -armature/display/CCSkin.cpp \ -armature/physics/CCColliderDetector.cpp \ -armature/utils/CCArmatureDataManager.cpp \ -armature/utils/CCArmatureDefine.cpp \ -armature/utils/CCDataReaderHelper.cpp \ -armature/utils/CCSpriteFrameCacheHelper.cpp \ -armature/utils/CCTransformHelp.cpp \ -armature/utils/CCTweenFunction.cpp \ -armature/utils/CCUtilMath.cpp \ -components/CCComAttribute.cpp \ -components/CCComAudio.cpp \ -components/CCComController.cpp \ -components/CCComRender.cpp \ -components/CCInputDelegate.cpp \ -json/CSContentJsonDictionary.cpp \ -json/DictionaryHelper.cpp \ -reader/CCSGUIReader.cpp \ -reader/CCSSceneReader.cpp \ +LOCAL_SRC_FILES := CCActionFrame.cpp \ +CCActionFrameEasing.cpp \ +CCActionManagerEx.cpp \ +CCActionNode.cpp \ +CCActionObject.cpp \ +CCArmature.cpp \ +CCBone.cpp \ +CCArmatureAnimation.cpp \ +CCProcessBase.cpp \ +CCTween.cpp \ +CCDatas.cpp \ +CCBatchNode.cpp \ +CCDecorativeDisplay.cpp \ +CCDisplayFactory.cpp \ +CCDisplayManager.cpp \ +CCSkin.cpp \ +CCColliderDetector.cpp \ +CCArmatureDataManager.cpp \ +CCArmatureDefine.cpp \ +CCDataReaderHelper.cpp \ +CCSpriteFrameCacheHelper.cpp \ +CCTransformHelp.cpp \ +CCTweenFunction.cpp \ +CCUtilMath.cpp \ +CCComAttribute.cpp \ +CCComAudio.cpp \ +CCComController.cpp \ +CCComRender.cpp \ +CCInputDelegate.cpp \ +CSContentJsonDictionary.cpp \ +DictionaryHelper.cpp \ +CCSGUIReader.cpp \ +CCSSceneReader.cpp \ ../../../external/json/json_reader.cpp \ ../../../external/json/json_value.cpp \ ../../../external/json/json_writer.cpp -LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) \ +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/.. \ $(LOCAL_PATH)/../../../external/json LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../2d \ $(LOCAL_PATH)/../../../external/json \ -$(LOCAL_PATH) \ -$(LOCAL_PATH)/../../gui \ +$(LOCAL_PATH)/.. \ +$(LOCAL_PATH)/../.. \ $(LOCAL_PATH)/../../../external LOCAL_CFLAGS += -Wno-psabi -fexceptions diff --git a/cocos/editor-support/cocostudio/action/CCActionFrame.cpp b/cocos/editor-support/cocostudio/CCActionFrame.cpp similarity index 100% rename from cocos/editor-support/cocostudio/action/CCActionFrame.cpp rename to cocos/editor-support/cocostudio/CCActionFrame.cpp diff --git a/cocos/editor-support/cocostudio/action/CCActionFrame.h b/cocos/editor-support/cocostudio/CCActionFrame.h similarity index 100% rename from cocos/editor-support/cocostudio/action/CCActionFrame.h rename to cocos/editor-support/cocostudio/CCActionFrame.h diff --git a/cocos/editor-support/cocostudio/action/CCActionFrameEasing.cpp b/cocos/editor-support/cocostudio/CCActionFrameEasing.cpp similarity index 98% rename from cocos/editor-support/cocostudio/action/CCActionFrameEasing.cpp rename to cocos/editor-support/cocostudio/CCActionFrameEasing.cpp index 74c7467c71..7694b6e53c 100644 --- a/cocos/editor-support/cocostudio/action/CCActionFrameEasing.cpp +++ b/cocos/editor-support/cocostudio/CCActionFrameEasing.cpp @@ -23,8 +23,8 @@ ****************************************************************************/ #include -#include "CCActionFrameEasing.h" -#include "cocostudio/json/DictionaryHelper.h" +#include "cocostudio/CCActionFrameEasing.h" +#include "cocostudio/DictionaryHelper.h" namespace cocostudio { #ifndef M_PI_X_2 diff --git a/cocos/editor-support/cocostudio/action/CCActionFrameEasing.h b/cocos/editor-support/cocostudio/CCActionFrameEasing.h similarity index 97% rename from cocos/editor-support/cocostudio/action/CCActionFrameEasing.h rename to cocos/editor-support/cocostudio/CCActionFrameEasing.h index 74ba932d4c..8e3fa2c1f4 100644 --- a/cocos/editor-support/cocostudio/action/CCActionFrameEasing.h +++ b/cocos/editor-support/cocostudio/CCActionFrameEasing.h @@ -26,7 +26,7 @@ #define __ActionFrameEasing_H__ #include "cocos2d.h" -#include "cocostudio/json/CSContentJsonDictionary.h" +#include "cocostudio/CSContentJsonDictionary.h" namespace cocostudio { diff --git a/cocos/editor-support/cocostudio/action/CCActionManagerEx.cpp b/cocos/editor-support/cocostudio/CCActionManagerEx.cpp similarity index 97% rename from cocos/editor-support/cocostudio/action/CCActionManagerEx.cpp rename to cocos/editor-support/cocostudio/CCActionManagerEx.cpp index b863c1f9a2..68c02fed95 100644 --- a/cocos/editor-support/cocostudio/action/CCActionManagerEx.cpp +++ b/cocos/editor-support/cocostudio/CCActionManagerEx.cpp @@ -22,8 +22,8 @@ THE SOFTWARE. ****************************************************************************/ -#include "CCActionManagerEx.h" -#include "cocostudio/json/DictionaryHelper.h" +#include "cocostudio/CCActionManagerEx.h" +#include "cocostudio/DictionaryHelper.h" using namespace cocos2d; diff --git a/cocos/editor-support/cocostudio/action/CCActionManagerEx.h b/cocos/editor-support/cocostudio/CCActionManagerEx.h similarity index 96% rename from cocos/editor-support/cocostudio/action/CCActionManagerEx.h rename to cocos/editor-support/cocostudio/CCActionManagerEx.h index 8776fce030..09d62b10b6 100644 --- a/cocos/editor-support/cocostudio/action/CCActionManagerEx.h +++ b/cocos/editor-support/cocostudio/CCActionManagerEx.h @@ -26,8 +26,8 @@ #define __ActionMANAGER_H__ #include "cocos2d.h" -#include "CCActionObject.h" -#include "cocostudio/json/CSContentJsonDictionary.h" +#include "cocostudio/CCActionObject.h" +#include "cocostudio/CSContentJsonDictionary.h" namespace cocostudio { diff --git a/cocos/editor-support/cocostudio/action/CCActionNode.cpp b/cocos/editor-support/cocostudio/CCActionNode.cpp similarity index 98% rename from cocos/editor-support/cocostudio/action/CCActionNode.cpp rename to cocos/editor-support/cocostudio/CCActionNode.cpp index 1390d64ed6..fceca8816c 100644 --- a/cocos/editor-support/cocostudio/action/CCActionNode.cpp +++ b/cocos/editor-support/cocostudio/CCActionNode.cpp @@ -22,11 +22,11 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "CCActionNode.h" -#include "CCActionFrameEasing.h" -#include "base-classes/UIWidget.h" -#include "system/UIHelper.h" -#include "cocostudio/json/DictionaryHelper.h" +#include "cocostudio/CCActionNode.h" +#include "cocostudio/CCActionFrameEasing.h" +#include "cocostudio/DictionaryHelper.h" +#include "gui/UIWidget.h" +#include "gui/UIHelper.h" using namespace cocos2d; using namespace gui; diff --git a/cocos/editor-support/cocostudio/action/CCActionNode.h b/cocos/editor-support/cocostudio/CCActionNode.h similarity index 98% rename from cocos/editor-support/cocostudio/action/CCActionNode.h rename to cocos/editor-support/cocostudio/CCActionNode.h index 67a424bda8..6f38a1a647 100644 --- a/cocos/editor-support/cocostudio/action/CCActionNode.h +++ b/cocos/editor-support/cocostudio/CCActionNode.h @@ -26,8 +26,8 @@ #define __ActionNODE_H__ #include "cocos2d.h" -#include "CCActionFrame.h" -#include "cocostudio/json/CSContentJsonDictionary.h" +#include "cocostudio/CCActionFrame.h" +#include "cocostudio/CSContentJsonDictionary.h" namespace cocostudio { diff --git a/cocos/editor-support/cocostudio/action/CCActionObject.cpp b/cocos/editor-support/cocostudio/CCActionObject.cpp similarity index 98% rename from cocos/editor-support/cocostudio/action/CCActionObject.cpp rename to cocos/editor-support/cocostudio/CCActionObject.cpp index e218dca888..2dd60c66f2 100644 --- a/cocos/editor-support/cocostudio/action/CCActionObject.cpp +++ b/cocos/editor-support/cocostudio/CCActionObject.cpp @@ -22,8 +22,8 @@ THE SOFTWARE. ****************************************************************************/ -#include "CCActionObject.h" -#include "cocostudio/json/DictionaryHelper.h" +#include "cocostudio/CCActionObject.h" +#include "cocostudio/DictionaryHelper.h" using namespace cocos2d; diff --git a/cocos/editor-support/cocostudio/action/CCActionObject.h b/cocos/editor-support/cocostudio/CCActionObject.h similarity index 98% rename from cocos/editor-support/cocostudio/action/CCActionObject.h rename to cocos/editor-support/cocostudio/CCActionObject.h index 7137f57355..cc748eaaa8 100644 --- a/cocos/editor-support/cocostudio/action/CCActionObject.h +++ b/cocos/editor-support/cocostudio/CCActionObject.h @@ -27,7 +27,7 @@ #include "cocos2d.h" #include "CCActionNode.h" -#include "cocostudio/json/CSContentJsonDictionary.h" +#include "cocostudio/CSContentJsonDictionary.h" namespace cocostudio { diff --git a/cocos/editor-support/cocostudio/armature/CCArmature.cpp b/cocos/editor-support/cocostudio/CCArmature.cpp similarity index 98% rename from cocos/editor-support/cocostudio/armature/CCArmature.cpp rename to cocos/editor-support/cocostudio/CCArmature.cpp index 7d4777d3f3..5885cbbd25 100644 --- a/cocos/editor-support/cocostudio/armature/CCArmature.cpp +++ b/cocos/editor-support/cocostudio/CCArmature.cpp @@ -22,12 +22,12 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "CCArmature.h" -#include "utils/CCArmatureDataManager.h" -#include "utils/CCArmatureDefine.h" -#include "utils/CCDataReaderHelper.h" -#include "datas/CCDatas.h" -#include "display/CCSkin.h" +#include "cocostudio/CCArmature.h" +#include "cocostudio/CCArmatureDataManager.h" +#include "cocostudio/CCArmatureDefine.h" +#include "cocostudio/CCDataReaderHelper.h" +#include "cocostudio/CCDatas.h" +#include "cocostudio/CCSkin.h" #if ENABLE_PHYSICS_BOX2D_DETECT #include "Box2D/Box2D.h" diff --git a/cocos/editor-support/cocostudio/armature/CCArmature.h b/cocos/editor-support/cocostudio/CCArmature.h similarity index 96% rename from cocos/editor-support/cocostudio/armature/CCArmature.h rename to cocos/editor-support/cocostudio/CCArmature.h index bc0843c540..3e8c521011 100644 --- a/cocos/editor-support/cocostudio/armature/CCArmature.h +++ b/cocos/editor-support/cocostudio/CCArmature.h @@ -25,12 +25,12 @@ THE SOFTWARE. #ifndef __CCARMATURE_H__ #define __CCARMATURE_H__ -#include "utils/CCArmatureDefine.h" -#include "CCBone.h" -#include "display/CCBatchNode.h" -#include "animation/CCArmatureAnimation.h" -#include "utils/CCSpriteFrameCacheHelper.h" -#include "utils/CCArmatureDataManager.h" +#include "cocostudio/CCArmatureDefine.h" +#include "cocostudio/CCBone.h" +#include "cocostudio/CCBatchNode.h" +#include "cocostudio/CCArmatureAnimation.h" +#include "cocostudio/CCSpriteFrameCacheHelper.h" +#include "cocostudio/CCArmatureDataManager.h" class b2Body; struct cpBody; diff --git a/cocos/editor-support/cocostudio/armature/animation/CCArmatureAnimation.cpp b/cocos/editor-support/cocostudio/CCArmatureAnimation.cpp similarity index 97% rename from cocos/editor-support/cocostudio/armature/animation/CCArmatureAnimation.cpp rename to cocos/editor-support/cocostudio/CCArmatureAnimation.cpp index 5490b4f4ee..a026fc33c9 100644 --- a/cocos/editor-support/cocostudio/armature/animation/CCArmatureAnimation.cpp +++ b/cocos/editor-support/cocostudio/CCArmatureAnimation.cpp @@ -22,12 +22,12 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "CCArmatureAnimation.h" -#include "cocostudio/armature/CCArmature.h" -#include "cocostudio/armature/CCBone.h" -#include "cocostudio/armature/utils/CCArmatureDefine.h" -#include "cocostudio/armature/utils/CCUtilMath.h" -#include "cocostudio/armature/datas/CCDatas.h" +#include "cocostudio/CCArmatureAnimation.h" +#include "cocostudio/CCArmature.h" +#include "cocostudio/CCBone.h" +#include "cocostudio/CCArmatureDefine.h" +#include "cocostudio/CCUtilMath.h" +#include "cocostudio/CCDatas.h" using namespace cocos2d; diff --git a/cocos/editor-support/cocostudio/armature/animation/CCArmatureAnimation.h b/cocos/editor-support/cocostudio/CCArmatureAnimation.h similarity index 99% rename from cocos/editor-support/cocostudio/armature/animation/CCArmatureAnimation.h rename to cocos/editor-support/cocostudio/CCArmatureAnimation.h index b9ac3d4200..5fa819f285 100644 --- a/cocos/editor-support/cocostudio/armature/animation/CCArmatureAnimation.h +++ b/cocos/editor-support/cocostudio/CCArmatureAnimation.h @@ -26,7 +26,7 @@ THE SOFTWARE. #ifndef __CCANIMATION_H__ #define __CCANIMATION_H__ -#include "CCProcessBase.h" +#include "cocostudio/CCProcessBase.h" namespace cocostudio { diff --git a/cocos/editor-support/cocostudio/armature/utils/CCArmatureDataManager.cpp b/cocos/editor-support/cocostudio/CCArmatureDataManager.cpp similarity index 97% rename from cocos/editor-support/cocostudio/armature/utils/CCArmatureDataManager.cpp rename to cocos/editor-support/cocostudio/CCArmatureDataManager.cpp index 2d507f6b69..113ff33202 100644 --- a/cocos/editor-support/cocostudio/armature/utils/CCArmatureDataManager.cpp +++ b/cocos/editor-support/cocostudio/CCArmatureDataManager.cpp @@ -23,10 +23,10 @@ THE SOFTWARE. ****************************************************************************/ -#include "CCArmatureDataManager.h" -#include "CCTransformHelp.h" -#include "CCDataReaderHelper.h" -#include "CCSpriteFrameCacheHelper.h" +#include "cocostudio/CCArmatureDataManager.h" +#include "cocostudio/CCTransformHelp.h" +#include "cocostudio/CCDataReaderHelper.h" +#include "cocostudio/CCSpriteFrameCacheHelper.h" using namespace cocos2d; diff --git a/cocos/editor-support/cocostudio/armature/utils/CCArmatureDataManager.h b/cocos/editor-support/cocostudio/CCArmatureDataManager.h similarity index 98% rename from cocos/editor-support/cocostudio/armature/utils/CCArmatureDataManager.h rename to cocos/editor-support/cocostudio/CCArmatureDataManager.h index 016156bec0..1bd426784d 100644 --- a/cocos/editor-support/cocostudio/armature/utils/CCArmatureDataManager.h +++ b/cocos/editor-support/cocostudio/CCArmatureDataManager.h @@ -25,8 +25,8 @@ THE SOFTWARE. #ifndef __CCARMATUREDATAMANAGER_H__ #define __CCARMATUREDATAMANAGER_H__ -#include "CCArmatureDefine.h" -#include "cocostudio/armature/datas/CCDatas.h" +#include "cocostudio/CCArmatureDefine.h" +#include "cocostudio/CCDatas.h" namespace cocostudio { diff --git a/cocos/editor-support/cocostudio/armature/utils/CCArmatureDefine.cpp b/cocos/editor-support/cocostudio/CCArmatureDefine.cpp similarity index 96% rename from cocos/editor-support/cocostudio/armature/utils/CCArmatureDefine.cpp rename to cocos/editor-support/cocostudio/CCArmatureDefine.cpp index 7ed21c9a3c..3672943778 100644 --- a/cocos/editor-support/cocostudio/armature/utils/CCArmatureDefine.cpp +++ b/cocos/editor-support/cocostudio/CCArmatureDefine.cpp @@ -22,7 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "CCArmatureDefine.h" +#include "cocostudio/CCArmatureDefine.h" namespace cocostudio { diff --git a/cocos/editor-support/cocostudio/armature/utils/CCArmatureDefine.h b/cocos/editor-support/cocostudio/CCArmatureDefine.h similarity index 100% rename from cocos/editor-support/cocostudio/armature/utils/CCArmatureDefine.h rename to cocos/editor-support/cocostudio/CCArmatureDefine.h diff --git a/cocos/editor-support/cocostudio/armature/display/CCBatchNode.cpp b/cocos/editor-support/cocostudio/CCBatchNode.cpp similarity index 95% rename from cocos/editor-support/cocostudio/armature/display/CCBatchNode.cpp rename to cocos/editor-support/cocostudio/CCBatchNode.cpp index ba273731b1..0c6f7598ae 100644 --- a/cocos/editor-support/cocostudio/armature/display/CCBatchNode.cpp +++ b/cocos/editor-support/cocostudio/CCBatchNode.cpp @@ -22,9 +22,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "CCBatchNode.h" -#include "cocostudio/armature/utils/CCArmatureDefine.h" -#include "cocostudio/armature/CCArmature.h" +#include "cocostudio/CCBatchNode.h" +#include "cocostudio/CCArmatureDefine.h" +#include "cocostudio/CCArmature.h" using namespace cocos2d; diff --git a/cocos/editor-support/cocostudio/armature/display/CCBatchNode.h b/cocos/editor-support/cocostudio/CCBatchNode.h similarity index 96% rename from cocos/editor-support/cocostudio/armature/display/CCBatchNode.h rename to cocos/editor-support/cocostudio/CCBatchNode.h index 7e0c52bc29..df33e44e0b 100644 --- a/cocos/editor-support/cocostudio/armature/display/CCBatchNode.h +++ b/cocos/editor-support/cocostudio/CCBatchNode.h @@ -25,7 +25,7 @@ THE SOFTWARE. #ifndef __CCBATCHNODE_H__ #define __CCBATCHNODE_H__ -#include "cocostudio/armature/utils/CCArmatureDefine.h" +#include "cocostudio/CCArmatureDefine.h" namespace cocostudio { diff --git a/cocos/editor-support/cocostudio/armature/CCBone.cpp b/cocos/editor-support/cocostudio/CCBone.cpp similarity index 97% rename from cocos/editor-support/cocostudio/armature/CCBone.cpp rename to cocos/editor-support/cocostudio/CCBone.cpp index 52dea85860..abd0cb85a5 100644 --- a/cocos/editor-support/cocostudio/armature/CCBone.cpp +++ b/cocos/editor-support/cocostudio/CCBone.cpp @@ -22,12 +22,12 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "CCBone.h" -#include "CCArmature.h" -#include "utils/CCUtilMath.h" -#include "utils/CCArmatureDataManager.h" -#include "utils/CCTransformHelp.h" -#include "display/CCDisplayManager.h" +#include "cocostudio/CCBone.h" +#include "cocostudio/CCArmature.h" +#include "cocostudio/CCUtilMath.h" +#include "cocostudio/CCArmatureDataManager.h" +#include "cocostudio/CCTransformHelp.h" +#include "cocostudio/CCDisplayManager.h" using namespace cocos2d; diff --git a/cocos/editor-support/cocostudio/armature/CCBone.h b/cocos/editor-support/cocostudio/CCBone.h similarity index 96% rename from cocos/editor-support/cocostudio/armature/CCBone.h rename to cocos/editor-support/cocostudio/CCBone.h index 85edc0f5b1..1163738515 100644 --- a/cocos/editor-support/cocostudio/armature/CCBone.h +++ b/cocos/editor-support/cocostudio/CCBone.h @@ -25,11 +25,11 @@ THE SOFTWARE. #ifndef __CCBONE_H__ #define __CCBONE_H__ -#include "utils/CCArmatureDefine.h" -#include "datas/CCDatas.h" -#include "animation/CCTween.h" -#include "display/CCDecorativeDisplay.h" -#include "display/CCDisplayManager.h" +#include "cocostudio/CCArmatureDefine.h" +#include "cocostudio/CCDatas.h" +#include "cocostudio/CCTween.h" +#include "cocostudio/CCDecorativeDisplay.h" +#include "cocostudio/CCDisplayManager.h" namespace cocostudio { diff --git a/cocos/editor-support/cocostudio/armature/physics/CCColliderDetector.cpp b/cocos/editor-support/cocostudio/CCColliderDetector.cpp similarity index 98% rename from cocos/editor-support/cocostudio/armature/physics/CCColliderDetector.cpp rename to cocos/editor-support/cocostudio/CCColliderDetector.cpp index f7e0c1c500..0839a30d7a 100644 --- a/cocos/editor-support/cocostudio/armature/physics/CCColliderDetector.cpp +++ b/cocos/editor-support/cocostudio/CCColliderDetector.cpp @@ -22,9 +22,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "CCColliderDetector.h" -#include "cocostudio/armature/CCBone.h" -#include "cocostudio/armature/utils/CCTransformHelp.h" +#include "cocostudio/CCColliderDetector.h" +#include "cocostudio/CCBone.h" +#include "cocostudio/CCTransformHelp.h" #if ENABLE_PHYSICS_BOX2D_DETECT #include "Box2D/Box2D.h" diff --git a/cocos/editor-support/cocostudio/armature/physics/CCColliderDetector.h b/cocos/editor-support/cocostudio/CCColliderDetector.h similarity index 96% rename from cocos/editor-support/cocostudio/armature/physics/CCColliderDetector.h rename to cocos/editor-support/cocostudio/CCColliderDetector.h index 5febb92aef..4f6fbeebfe 100644 --- a/cocos/editor-support/cocostudio/armature/physics/CCColliderDetector.h +++ b/cocos/editor-support/cocostudio/CCColliderDetector.h @@ -25,8 +25,8 @@ THE SOFTWARE. #ifndef __CCCOLLIDERDETECTOR_H__ #define __CCCOLLIDERDETECTOR_H__ -#include "cocostudio/armature/utils/CCArmatureDefine.h" -#include "cocostudio/armature/datas/CCDatas.h" +#include "cocostudio/CCArmatureDefine.h" +#include "cocostudio/CCDatas.h" #ifndef PT_RATIO #define PT_RATIO 32 diff --git a/cocos/editor-support/cocostudio/components/CCComAttribute.cpp b/cocos/editor-support/cocostudio/CCComAttribute.cpp similarity index 99% rename from cocos/editor-support/cocostudio/components/CCComAttribute.cpp rename to cocos/editor-support/cocostudio/CCComAttribute.cpp index 5f73dfeacc..f3e57eddbc 100644 --- a/cocos/editor-support/cocostudio/components/CCComAttribute.cpp +++ b/cocos/editor-support/cocostudio/CCComAttribute.cpp @@ -22,7 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "CCComAttribute.h" +#include "cocostudio/CCComAttribute.h" using namespace cocos2d; namespace cocostudio { diff --git a/cocos/editor-support/cocostudio/components/CCComAttribute.h b/cocos/editor-support/cocostudio/CCComAttribute.h similarity index 97% rename from cocos/editor-support/cocostudio/components/CCComAttribute.h rename to cocos/editor-support/cocostudio/CCComAttribute.h index 959e8ac1b8..53c7c2c885 100644 --- a/cocos/editor-support/cocostudio/components/CCComAttribute.h +++ b/cocos/editor-support/cocostudio/CCComAttribute.h @@ -27,7 +27,7 @@ THE SOFTWARE. #include "cocos2d.h" #include -#include "cocostudio/json/CSContentJsonDictionary.h" +#include "cocostudio/CSContentJsonDictionary.h" namespace cocostudio { diff --git a/cocos/editor-support/cocostudio/components/CCComAudio.cpp b/cocos/editor-support/cocostudio/CCComAudio.cpp similarity index 99% rename from cocos/editor-support/cocostudio/components/CCComAudio.cpp rename to cocos/editor-support/cocostudio/CCComAudio.cpp index 29fcc308f4..76ac167ba7 100644 --- a/cocos/editor-support/cocostudio/components/CCComAudio.cpp +++ b/cocos/editor-support/cocostudio/CCComAudio.cpp @@ -22,7 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "CCComAudio.h" +#include "cocostudio/CCComAudio.h" #include "SimpleAudioEngine.h" namespace cocostudio { diff --git a/cocos/editor-support/cocostudio/components/CCComAudio.h b/cocos/editor-support/cocostudio/CCComAudio.h similarity index 100% rename from cocos/editor-support/cocostudio/components/CCComAudio.h rename to cocos/editor-support/cocostudio/CCComAudio.h diff --git a/cocos/editor-support/cocostudio/components/CCComController.cpp b/cocos/editor-support/cocostudio/CCComController.cpp similarity index 97% rename from cocos/editor-support/cocostudio/components/CCComController.cpp rename to cocos/editor-support/cocostudio/CCComController.cpp index 8bc321a1de..bf57a8724a 100644 --- a/cocos/editor-support/cocostudio/components/CCComController.cpp +++ b/cocos/editor-support/cocostudio/CCComController.cpp @@ -22,7 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "CCComController.h" +#include "cocostudio/CCComController.h" namespace cocostudio { diff --git a/cocos/editor-support/cocostudio/components/CCComController.h b/cocos/editor-support/cocostudio/CCComController.h similarity index 97% rename from cocos/editor-support/cocostudio/components/CCComController.h rename to cocos/editor-support/cocostudio/CCComController.h index 8fcb1c8879..00da3fa74f 100644 --- a/cocos/editor-support/cocostudio/components/CCComController.h +++ b/cocos/editor-support/cocostudio/CCComController.h @@ -26,7 +26,7 @@ THE SOFTWARE. #define __CC_EXTENTIONS_CCCOMCONTROLLER_H__ #include "cocos2d.h" -#include "CCInputDelegate.h" +#include "cocostudio/CCInputDelegate.h" namespace cocostudio { diff --git a/cocos/editor-support/cocostudio/components/CCComRender.cpp b/cocos/editor-support/cocostudio/CCComRender.cpp similarity index 98% rename from cocos/editor-support/cocostudio/components/CCComRender.cpp rename to cocos/editor-support/cocostudio/CCComRender.cpp index bfd19a48ab..95465444ea 100644 --- a/cocos/editor-support/cocostudio/components/CCComRender.cpp +++ b/cocos/editor-support/cocostudio/CCComRender.cpp @@ -22,7 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "CCComRender.h" +#include "cocostudio/CCComRender.h" namespace cocostudio { diff --git a/cocos/editor-support/cocostudio/components/CCComRender.h b/cocos/editor-support/cocostudio/CCComRender.h similarity index 100% rename from cocos/editor-support/cocostudio/components/CCComRender.h rename to cocos/editor-support/cocostudio/CCComRender.h diff --git a/cocos/editor-support/cocostudio/armature/utils/CCDataReaderHelper.cpp b/cocos/editor-support/cocostudio/CCDataReaderHelper.cpp similarity index 99% rename from cocos/editor-support/cocostudio/armature/utils/CCDataReaderHelper.cpp rename to cocos/editor-support/cocostudio/CCDataReaderHelper.cpp index d1dc3e0655..4749f5eaf9 100644 --- a/cocos/editor-support/cocostudio/armature/utils/CCDataReaderHelper.cpp +++ b/cocos/editor-support/cocostudio/CCDataReaderHelper.cpp @@ -23,12 +23,12 @@ THE SOFTWARE. ****************************************************************************/ #include "tinyxml2.h" -#include "CCDataReaderHelper.h" -#include "CCArmatureDataManager.h" -#include "CCTransformHelp.h" -#include "CCUtilMath.h" -#include "CCArmatureDefine.h" -#include "cocostudio/armature/datas/CCDatas.h" +#include "cocostudio/CCDataReaderHelper.h" +#include "cocostudio/CCArmatureDataManager.h" +#include "cocostudio/CCTransformHelp.h" +#include "cocostudio/CCUtilMath.h" +#include "cocostudio/CCArmatureDefine.h" +#include "cocostudio/CCDatas.h" using namespace cocos2d; diff --git a/cocos/editor-support/cocostudio/armature/utils/CCDataReaderHelper.h b/cocos/editor-support/cocostudio/CCDataReaderHelper.h similarity index 96% rename from cocos/editor-support/cocostudio/armature/utils/CCDataReaderHelper.h rename to cocos/editor-support/cocostudio/CCDataReaderHelper.h index be8b4c9297..d5c8a0d6f5 100644 --- a/cocos/editor-support/cocostudio/armature/utils/CCDataReaderHelper.h +++ b/cocos/editor-support/cocostudio/CCDataReaderHelper.h @@ -25,10 +25,10 @@ THE SOFTWARE. #ifndef __CCDATAREADERHELPER_H__ #define __CCDATAREADERHELPER_H__ -#include "CCArmatureDefine.h" -#include "cocostudio/armature/datas/CCDatas.h" -#include "cocostudio/armature/CCArmature.h" -#include "cocostudio/json/CSContentJsonDictionary.h" +#include "cocostudio/CCArmatureDefine.h" +#include "cocostudio/CCDatas.h" +#include "cocostudio/CCArmature.h" +#include "cocostudio/CSContentJsonDictionary.h" #include #include diff --git a/cocos/editor-support/cocostudio/armature/datas/CCDatas.cpp b/cocos/editor-support/cocostudio/CCDatas.cpp similarity index 98% rename from cocos/editor-support/cocostudio/armature/datas/CCDatas.cpp rename to cocos/editor-support/cocostudio/CCDatas.cpp index 6d2468cb58..35d6461efc 100644 --- a/cocos/editor-support/cocostudio/armature/datas/CCDatas.cpp +++ b/cocos/editor-support/cocostudio/CCDatas.cpp @@ -22,9 +22,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "CCDatas.h" -#include "cocostudio/armature/utils/CCUtilMath.h" -#include "cocostudio/armature/utils/CCTransformHelp.h" +#include "cocostudio/CCDatas.h" +#include "cocostudio/CCUtilMath.h" +#include "cocostudio/CCTransformHelp.h" using namespace cocos2d; diff --git a/cocos/editor-support/cocostudio/armature/datas/CCDatas.h b/cocos/editor-support/cocostudio/CCDatas.h similarity index 99% rename from cocos/editor-support/cocostudio/armature/datas/CCDatas.h rename to cocos/editor-support/cocostudio/CCDatas.h index 2725750c84..26128020cf 100644 --- a/cocos/editor-support/cocostudio/armature/datas/CCDatas.h +++ b/cocos/editor-support/cocostudio/CCDatas.h @@ -25,8 +25,8 @@ THE SOFTWARE. #ifndef __CCARMATURE_DATAS_H__ #define __CCARMATURE_DATAS_H__ -#include "cocostudio/armature/utils/CCArmatureDefine.h" -#include "cocostudio/armature/utils/CCTweenFunction.h" +#include "cocostudio/CCArmatureDefine.h" +#include "cocostudio/CCTweenFunction.h" #define CC_CREATE_NO_PARAM_NO_INIT(varType)\ diff --git a/cocos/editor-support/cocostudio/armature/display/CCDecorativeDisplay.cpp b/cocos/editor-support/cocostudio/CCDecorativeDisplay.cpp similarity index 97% rename from cocos/editor-support/cocostudio/armature/display/CCDecorativeDisplay.cpp rename to cocos/editor-support/cocostudio/CCDecorativeDisplay.cpp index 0213219ddb..e595ecbe0c 100644 --- a/cocos/editor-support/cocostudio/armature/display/CCDecorativeDisplay.cpp +++ b/cocos/editor-support/cocostudio/CCDecorativeDisplay.cpp @@ -22,7 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "CCDecorativeDisplay.h" +#include "cocostudio/CCDecorativeDisplay.h" using namespace cocos2d; diff --git a/cocos/editor-support/cocostudio/armature/display/CCDecorativeDisplay.h b/cocos/editor-support/cocostudio/CCDecorativeDisplay.h similarity index 91% rename from cocos/editor-support/cocostudio/armature/display/CCDecorativeDisplay.h rename to cocos/editor-support/cocostudio/CCDecorativeDisplay.h index f65f143163..7196d0e9ec 100644 --- a/cocos/editor-support/cocostudio/armature/display/CCDecorativeDisplay.h +++ b/cocos/editor-support/cocostudio/CCDecorativeDisplay.h @@ -25,13 +25,13 @@ THE SOFTWARE. #ifndef __CCDECORATIVEDISPLAY_H__ #define __CCDECORATIVEDISPLAY_H__ -#include "cocostudio/armature/utils/CCArmatureDefine.h" -#include "CCDisplayFactory.h" -#include "cocostudio/armature/datas/CCDatas.h" +#include "cocostudio/CCArmatureDefine.h" +#include "cocostudio/CCDisplayFactory.h" +#include "cocostudio/CCDatas.h" #if ENABLE_PHYSICS_BOX2D_DETECT || ENABLE_PHYSICS_CHIPMUNK_DETECT -#include "../physics/CCColliderDetector.h" +#include "cocostudio/CCColliderDetector.h" #endif namespace cocostudio { diff --git a/cocos/editor-support/cocostudio/armature/display/CCDisplayFactory.cpp b/cocos/editor-support/cocostudio/CCDisplayFactory.cpp similarity index 96% rename from cocos/editor-support/cocostudio/armature/display/CCDisplayFactory.cpp rename to cocos/editor-support/cocostudio/CCDisplayFactory.cpp index 56e5f8c427..034f115481 100644 --- a/cocos/editor-support/cocostudio/armature/display/CCDisplayFactory.cpp +++ b/cocos/editor-support/cocostudio/CCDisplayFactory.cpp @@ -22,13 +22,13 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "CCDisplayFactory.h" -#include "cocostudio/armature/CCBone.h" -#include "cocostudio/armature/CCArmature.h" -#include "cocostudio/armature/display/CCSkin.h" -#include "cocostudio/armature/utils/CCSpriteFrameCacheHelper.h" -#include "cocostudio/armature/utils/CCArmatureDataManager.h" -#include "cocostudio/armature/utils/CCTransformHelp.h" +#include "cocostudio/CCDisplayFactory.h" +#include "cocostudio/CCBone.h" +#include "cocostudio/CCArmature.h" +#include "cocostudio/CCSkin.h" +#include "cocostudio/CCSpriteFrameCacheHelper.h" +#include "cocostudio/CCArmatureDataManager.h" +#include "cocostudio/CCTransformHelp.h" using namespace cocos2d; diff --git a/cocos/editor-support/cocostudio/armature/display/CCDisplayFactory.h b/cocos/editor-support/cocostudio/CCDisplayFactory.h similarity index 96% rename from cocos/editor-support/cocostudio/armature/display/CCDisplayFactory.h rename to cocos/editor-support/cocostudio/CCDisplayFactory.h index f8f6009ffb..3ef0725ff0 100644 --- a/cocos/editor-support/cocostudio/armature/display/CCDisplayFactory.h +++ b/cocos/editor-support/cocostudio/CCDisplayFactory.h @@ -25,8 +25,8 @@ THE SOFTWARE. #ifndef __CCDISPLAYFACTORY_H__ #define __CCDISPLAYFACTORY_H__ -#include "cocostudio/armature/utils/CCArmatureDefine.h" -#include "cocostudio/armature/datas/CCDatas.h" +#include "cocostudio/CCArmatureDefine.h" +#include "cocostudio/CCDatas.h" namespace cocostudio { diff --git a/cocos/editor-support/cocostudio/armature/display/CCDisplayManager.cpp b/cocos/editor-support/cocostudio/CCDisplayManager.cpp similarity index 97% rename from cocos/editor-support/cocostudio/armature/display/CCDisplayManager.cpp rename to cocos/editor-support/cocostudio/CCDisplayManager.cpp index 29ae581cbb..b7d337e3a9 100644 --- a/cocos/editor-support/cocostudio/armature/display/CCDisplayManager.cpp +++ b/cocos/editor-support/cocostudio/CCDisplayManager.cpp @@ -22,11 +22,11 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "CCDisplayManager.h" -#include "cocostudio/armature/CCBone.h" -#include "cocostudio/armature/CCArmature.h" -#include "cocostudio/armature/utils/CCUtilMath.h" -#include "cocostudio/armature/display/CCSkin.h" +#include "cocostudio/CCDisplayManager.h" +#include "cocostudio/CCBone.h" +#include "cocostudio/CCArmature.h" +#include "cocostudio/CCUtilMath.h" +#include "cocostudio/CCSkin.h" using namespace cocos2d; diff --git a/cocos/editor-support/cocostudio/armature/display/CCDisplayManager.h b/cocos/editor-support/cocostudio/CCDisplayManager.h similarity index 96% rename from cocos/editor-support/cocostudio/armature/display/CCDisplayManager.h rename to cocos/editor-support/cocostudio/CCDisplayManager.h index fd51ca759b..9953d77995 100644 --- a/cocos/editor-support/cocostudio/armature/display/CCDisplayManager.h +++ b/cocos/editor-support/cocostudio/CCDisplayManager.h @@ -25,9 +25,9 @@ THE SOFTWARE. #ifndef __CCDISPLAYMANAGER_H__ #define __CCDISPLAYMANAGER_H__ -#include "cocostudio/armature/utils/CCArmatureDefine.h" -#include "cocostudio/armature/display/CCDecorativeDisplay.h" -#include "cocostudio/armature/datas/CCDatas.h" +#include "cocostudio/CCArmatureDefine.h" +#include "cocostudio/CCDecorativeDisplay.h" +#include "cocostudio/CCDatas.h" namespace cocostudio { diff --git a/cocos/editor-support/cocostudio/components/CCInputDelegate.cpp b/cocos/editor-support/cocostudio/CCInputDelegate.cpp similarity index 99% rename from cocos/editor-support/cocostudio/components/CCInputDelegate.cpp rename to cocos/editor-support/cocostudio/CCInputDelegate.cpp index 65664400c7..9f4fd46a8d 100644 --- a/cocos/editor-support/cocostudio/components/CCInputDelegate.cpp +++ b/cocos/editor-support/cocostudio/CCInputDelegate.cpp @@ -22,7 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "CCInputDelegate.h" +#include "cocostudio/CCInputDelegate.h" using namespace cocos2d; diff --git a/cocos/editor-support/cocostudio/components/CCInputDelegate.h b/cocos/editor-support/cocostudio/CCInputDelegate.h similarity index 100% rename from cocos/editor-support/cocostudio/components/CCInputDelegate.h rename to cocos/editor-support/cocostudio/CCInputDelegate.h diff --git a/cocos/editor-support/cocostudio/armature/animation/CCProcessBase.cpp b/cocos/editor-support/cocostudio/CCProcessBase.cpp similarity index 98% rename from cocos/editor-support/cocostudio/armature/animation/CCProcessBase.cpp rename to cocos/editor-support/cocostudio/CCProcessBase.cpp index e235c1cb1e..c3e1bfbc20 100644 --- a/cocos/editor-support/cocostudio/armature/animation/CCProcessBase.cpp +++ b/cocos/editor-support/cocostudio/CCProcessBase.cpp @@ -22,8 +22,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "CCProcessBase.h" -#include "cocostudio/armature/utils/CCUtilMath.h" +#include "cocostudio/CCProcessBase.h" +#include "cocostudio/CCUtilMath.h" using namespace cocos2d; diff --git a/cocos/editor-support/cocostudio/armature/animation/CCProcessBase.h b/cocos/editor-support/cocostudio/CCProcessBase.h similarity index 98% rename from cocos/editor-support/cocostudio/armature/animation/CCProcessBase.h rename to cocos/editor-support/cocostudio/CCProcessBase.h index 3d247e51a4..9f80fb2ea7 100644 --- a/cocos/editor-support/cocostudio/armature/animation/CCProcessBase.h +++ b/cocos/editor-support/cocostudio/CCProcessBase.h @@ -26,8 +26,8 @@ THE SOFTWARE. #ifndef __CCPROCESSBASE_H__ #define __CCPROCESSBASE_H__ -#include "cocostudio/armature/utils/CCArmatureDefine.h" -#include "cocostudio/armature/datas/CCDatas.h" +#include "cocostudio/CCArmatureDefine.h" +#include "cocostudio/CCDatas.h" namespace cocostudio { diff --git a/cocos/editor-support/cocostudio/reader/CCSGUIReader.cpp b/cocos/editor-support/cocostudio/CCSGUIReader.cpp similarity index 99% rename from cocos/editor-support/cocostudio/reader/CCSGUIReader.cpp rename to cocos/editor-support/cocostudio/CCSGUIReader.cpp index ad0eb9ef8d..77cb5d56de 100755 --- a/cocos/editor-support/cocostudio/reader/CCSGUIReader.cpp +++ b/cocos/editor-support/cocostudio/CCSGUIReader.cpp @@ -21,10 +21,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ - -#include "system/CocosGUI.h" -#include "cocostudio/json/DictionaryHelper.h" -#include "cocostudio/action/CCActionManagerEx.h" +#include "cocostudio/CCSGUIReader.h" +#include "gui/CocosGUI.h" +#include "cocostudio/DictionaryHelper.h" +#include "cocostudio/CCActionManagerEx.h" #include #include diff --git a/cocos/editor-support/cocostudio/reader/CCSGUIReader.h b/cocos/editor-support/cocostudio/CCSGUIReader.h similarity index 97% rename from cocos/editor-support/cocostudio/reader/CCSGUIReader.h rename to cocos/editor-support/cocostudio/CCSGUIReader.h index 0041997bcd..d39c349ee0 100755 --- a/cocos/editor-support/cocostudio/reader/CCSGUIReader.h +++ b/cocos/editor-support/cocostudio/CCSGUIReader.h @@ -25,8 +25,8 @@ #ifndef __CCSGUIREADER_H__ #define __CCSGUIREADER_H__ -#include "base-classes/UIWidget.h" -#include "cocostudio/json/CSContentJsonDictionary.h" +#include "gui/UIWidget.h" +#include "cocostudio/CSContentJsonDictionary.h" namespace cocostudio { diff --git a/cocos/editor-support/cocostudio/reader/CCSSceneReader.cpp b/cocos/editor-support/cocostudio/CCSSceneReader.cpp similarity index 99% rename from cocos/editor-support/cocostudio/reader/CCSSceneReader.cpp rename to cocos/editor-support/cocostudio/CCSSceneReader.cpp index a32572d791..3d8bc7fd8c 100644 --- a/cocos/editor-support/cocostudio/reader/CCSSceneReader.cpp +++ b/cocos/editor-support/cocostudio/CCSSceneReader.cpp @@ -22,9 +22,8 @@ THE SOFTWARE. ****************************************************************************/ -#include "CCSSceneReader.h" -#include "CocoStudio.h" -#include "system/CocosGUI.h" +#include "cocostudio/CocoStudio.h" +#include "gui/CocosGUI.h" using namespace cocos2d; using namespace gui; diff --git a/cocos/editor-support/cocostudio/reader/CCSSceneReader.h b/cocos/editor-support/cocostudio/CCSSceneReader.h similarity index 97% rename from cocos/editor-support/cocostudio/reader/CCSSceneReader.h rename to cocos/editor-support/cocostudio/CCSSceneReader.h index a042edfbf2..f548a2573f 100644 --- a/cocos/editor-support/cocostudio/reader/CCSSceneReader.h +++ b/cocos/editor-support/cocostudio/CCSSceneReader.h @@ -26,7 +26,7 @@ #define __CCSSCENEREADER_H__ #include "cocos2d.h" - #include "cocostudio/json/CSContentJsonDictionary.h" + #include "cocostudio/CSContentJsonDictionary.h" namespace cocostudio { diff --git a/cocos/editor-support/cocostudio/armature/display/CCSkin.cpp b/cocos/editor-support/cocostudio/CCSkin.cpp similarity index 96% rename from cocos/editor-support/cocostudio/armature/display/CCSkin.cpp rename to cocos/editor-support/cocostudio/CCSkin.cpp index ecc83c7ff6..afd6f5fc51 100644 --- a/cocos/editor-support/cocostudio/armature/display/CCSkin.cpp +++ b/cocos/editor-support/cocostudio/CCSkin.cpp @@ -22,10 +22,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "CCSkin.h" -#include "cocostudio/armature/utils/CCTransformHelp.h" -#include "cocostudio/armature/utils/CCSpriteFrameCacheHelper.h" -#include "cocostudio/armature/CCArmature.h" +#include "cocostudio/CCSkin.h" +#include "cocostudio/CCTransformHelp.h" +#include "cocostudio/CCSpriteFrameCacheHelper.h" +#include "cocostudio/CCArmature.h" using namespace cocos2d; diff --git a/cocos/editor-support/cocostudio/armature/display/CCSkin.h b/cocos/editor-support/cocostudio/CCSkin.h similarity index 95% rename from cocos/editor-support/cocostudio/armature/display/CCSkin.h rename to cocos/editor-support/cocostudio/CCSkin.h index 1915ff550b..3494c48436 100644 --- a/cocos/editor-support/cocostudio/armature/display/CCSkin.h +++ b/cocos/editor-support/cocostudio/CCSkin.h @@ -25,8 +25,8 @@ THE SOFTWARE. #ifndef __CCSKIN_H__ #define __CCSKIN_H__ -#include "cocostudio/armature/utils/CCArmatureDefine.h" -#include "cocostudio/armature/CCBone.h" +#include "cocostudio/CCArmatureDefine.h" +#include "cocostudio/CCBone.h" namespace cocostudio { diff --git a/cocos/editor-support/cocostudio/armature/utils/CCSpriteFrameCacheHelper.cpp b/cocos/editor-support/cocostudio/CCSpriteFrameCacheHelper.cpp similarity index 98% rename from cocos/editor-support/cocostudio/armature/utils/CCSpriteFrameCacheHelper.cpp rename to cocos/editor-support/cocostudio/CCSpriteFrameCacheHelper.cpp index d17dab4fa2..d783c4ba4e 100644 --- a/cocos/editor-support/cocostudio/armature/utils/CCSpriteFrameCacheHelper.cpp +++ b/cocos/editor-support/cocostudio/CCSpriteFrameCacheHelper.cpp @@ -22,7 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "CCSpriteFrameCacheHelper.h" +#include "cocostudio/CCSpriteFrameCacheHelper.h" using namespace cocos2d; diff --git a/cocos/editor-support/cocostudio/armature/utils/CCSpriteFrameCacheHelper.h b/cocos/editor-support/cocostudio/CCSpriteFrameCacheHelper.h similarity index 98% rename from cocos/editor-support/cocostudio/armature/utils/CCSpriteFrameCacheHelper.h rename to cocos/editor-support/cocostudio/CCSpriteFrameCacheHelper.h index 6e1a4fe094..150fe96aaa 100644 --- a/cocos/editor-support/cocostudio/armature/utils/CCSpriteFrameCacheHelper.h +++ b/cocos/editor-support/cocostudio/CCSpriteFrameCacheHelper.h @@ -24,7 +24,7 @@ THE SOFTWARE. #ifndef __CCSPRITEFRAMECACHEHELPER_H__ #define __CCSPRITEFRAMECACHEHELPER_H__ -#include "CCArmatureDefine.h" +#include "cocostudio/CCArmatureDefine.h" #include using namespace std; diff --git a/cocos/editor-support/cocostudio/armature/utils/CCTransformHelp.cpp b/cocos/editor-support/cocostudio/CCTransformHelp.cpp similarity index 98% rename from cocos/editor-support/cocostudio/armature/utils/CCTransformHelp.cpp rename to cocos/editor-support/cocostudio/CCTransformHelp.cpp index 133dbba1d2..a836055c16 100644 --- a/cocos/editor-support/cocostudio/armature/utils/CCTransformHelp.cpp +++ b/cocos/editor-support/cocostudio/CCTransformHelp.cpp @@ -22,8 +22,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "CCTransformHelp.h" -#include "CCUtilMath.h" +#include "cocostudio/CCTransformHelp.h" +#include "cocostudio/CCUtilMath.h" using namespace cocos2d; diff --git a/cocos/editor-support/cocostudio/armature/utils/CCTransformHelp.h b/cocos/editor-support/cocostudio/CCTransformHelp.h similarity index 96% rename from cocos/editor-support/cocostudio/armature/utils/CCTransformHelp.h rename to cocos/editor-support/cocostudio/CCTransformHelp.h index 195d5a1468..ae1bcbf813 100644 --- a/cocos/editor-support/cocostudio/armature/utils/CCTransformHelp.h +++ b/cocos/editor-support/cocostudio/CCTransformHelp.h @@ -25,8 +25,8 @@ THE SOFTWARE. #ifndef __CCTRANSFORMHELP_H__ #define __CCTRANSFORMHELP_H__ -#include "CCArmatureDefine.h" -#include "cocostudio/armature/datas/CCDatas.h" +#include "cocostudio/CCArmatureDefine.h" +#include "cocostudio/CCDatas.h" namespace cocostudio { diff --git a/cocos/editor-support/cocostudio/armature/animation/CCTween.cpp b/cocos/editor-support/cocostudio/CCTween.cpp similarity index 97% rename from cocos/editor-support/cocostudio/armature/animation/CCTween.cpp rename to cocos/editor-support/cocostudio/CCTween.cpp index c9ba8cbe6e..8fec95b2a0 100644 --- a/cocos/editor-support/cocostudio/armature/animation/CCTween.cpp +++ b/cocos/editor-support/cocostudio/CCTween.cpp @@ -23,13 +23,13 @@ THE SOFTWARE. ****************************************************************************/ -#include "CCTween.h" -#include "CCArmatureAnimation.h" -#include "cocostudio/armature/CCBone.h" -#include "cocostudio/armature/CCArmature.h" -#include "cocostudio/armature/utils/CCUtilMath.h" -#include "cocostudio/armature/utils/CCTweenFunction.h" -#include "cocostudio/armature/utils/CCTransformHelp.h" +#include "cocostudio/CCTween.h" +#include "cocostudio/CCArmatureAnimation.h" +#include "cocostudio/CCBone.h" +#include "cocostudio/CCArmature.h" +#include "cocostudio/CCUtilMath.h" +#include "cocostudio/CCTweenFunction.h" +#include "cocostudio/CCTransformHelp.h" namespace cocostudio { diff --git a/cocos/editor-support/cocostudio/armature/animation/CCTween.h b/cocos/editor-support/cocostudio/CCTween.h similarity index 98% rename from cocos/editor-support/cocostudio/armature/animation/CCTween.h rename to cocos/editor-support/cocostudio/CCTween.h index f78e7ef927..80b6c6d7e9 100644 --- a/cocos/editor-support/cocostudio/armature/animation/CCTween.h +++ b/cocos/editor-support/cocostudio/CCTween.h @@ -26,8 +26,8 @@ THE SOFTWARE. #ifndef __CCTWEEN_H__ #define __CCTWEEN_H__ -#include "CCProcessBase.h" -#include "cocostudio/armature/utils/CCTweenFunction.h" +#include "cocostudio/CCProcessBase.h" +#include "cocostudio/CCTweenFunction.h" namespace cocostudio { diff --git a/cocos/editor-support/cocostudio/armature/utils/CCTweenFunction.cpp b/cocos/editor-support/cocostudio/CCTweenFunction.cpp similarity index 99% rename from cocos/editor-support/cocostudio/armature/utils/CCTweenFunction.cpp rename to cocos/editor-support/cocostudio/CCTweenFunction.cpp index 21b20e6f1a..37b523fc79 100644 --- a/cocos/editor-support/cocostudio/armature/utils/CCTweenFunction.cpp +++ b/cocos/editor-support/cocostudio/CCTweenFunction.cpp @@ -22,8 +22,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "CCTweenFunction.h" -#include "CCUtilMath.h" +#include "cocostudio/CCTweenFunction.h" +#include "cocostudio/CCUtilMath.h" namespace cocostudio { diff --git a/cocos/editor-support/cocostudio/armature/utils/CCTweenFunction.h b/cocos/editor-support/cocostudio/CCTweenFunction.h similarity index 99% rename from cocos/editor-support/cocostudio/armature/utils/CCTweenFunction.h rename to cocos/editor-support/cocostudio/CCTweenFunction.h index 0951bf1eea..255d19d58e 100644 --- a/cocos/editor-support/cocostudio/armature/utils/CCTweenFunction.h +++ b/cocos/editor-support/cocostudio/CCTweenFunction.h @@ -26,7 +26,7 @@ THE SOFTWARE. #define __CCTWEENFUNCTION_H__ -#include "CCArmatureDefine.h" +#include "cocostudio/CCArmatureDefine.h" #include namespace cocostudio { diff --git a/cocos/editor-support/cocostudio/armature/utils/CCUtilMath.cpp b/cocos/editor-support/cocostudio/CCUtilMath.cpp similarity index 98% rename from cocos/editor-support/cocostudio/armature/utils/CCUtilMath.cpp rename to cocos/editor-support/cocostudio/CCUtilMath.cpp index c696e2a6fe..0714958857 100644 --- a/cocos/editor-support/cocostudio/armature/utils/CCUtilMath.cpp +++ b/cocos/editor-support/cocostudio/CCUtilMath.cpp @@ -22,7 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "CCUtilMath.h" +#include "cocostudio/CCUtilMath.h" using namespace cocos2d; diff --git a/cocos/editor-support/cocostudio/armature/utils/CCUtilMath.h b/cocos/editor-support/cocostudio/CCUtilMath.h similarity index 98% rename from cocos/editor-support/cocostudio/armature/utils/CCUtilMath.h rename to cocos/editor-support/cocostudio/CCUtilMath.h index b767cdcc58..20541a8c80 100644 --- a/cocos/editor-support/cocostudio/armature/utils/CCUtilMath.h +++ b/cocos/editor-support/cocostudio/CCUtilMath.h @@ -25,7 +25,7 @@ THE SOFTWARE. #ifndef __CCUTILMATH_H__ #define __CCUTILMATH_H__ -#include "CCArmatureDefine.h" +#include "cocostudio/CCArmatureDefine.h" #include namespace cocostudio { diff --git a/cocos/editor-support/cocostudio/json/CSContentJsonDictionary.cpp b/cocos/editor-support/cocostudio/CSContentJsonDictionary.cpp similarity index 99% rename from cocos/editor-support/cocostudio/json/CSContentJsonDictionary.cpp rename to cocos/editor-support/cocostudio/CSContentJsonDictionary.cpp index 287d742a1c..2f88410582 100644 --- a/cocos/editor-support/cocostudio/json/CSContentJsonDictionary.cpp +++ b/cocos/editor-support/cocostudio/CSContentJsonDictionary.cpp @@ -25,7 +25,7 @@ */ #include -#include "CSContentJsonDictionary.h" +#include "cocostudio/CSContentJsonDictionary.h" namespace cocostudio { diff --git a/cocos/editor-support/cocostudio/json/CSContentJsonDictionary.h b/cocos/editor-support/cocostudio/CSContentJsonDictionary.h similarity index 100% rename from cocos/editor-support/cocostudio/json/CSContentJsonDictionary.h rename to cocos/editor-support/cocostudio/CSContentJsonDictionary.h diff --git a/cocos/editor-support/cocostudio/CocoStudio.h b/cocos/editor-support/cocostudio/CocoStudio.h index be6d9d807b..03c06775a6 100644 --- a/cocos/editor-support/cocostudio/CocoStudio.h +++ b/cocos/editor-support/cocostudio/CocoStudio.h @@ -25,38 +25,38 @@ #ifndef __EDITOR_SUPPORT_COCOSTUDIO_H__ #define __EDITOR_SUPPORT_COCOSTUDIO_H__ -#include "action/CCActionFrame.h" -#include "action/CCActionFrameEasing.h" -#include "action/CCActionManagerEx.h" -#include "action/CCActionNode.h" -#include "action/CCActionObject.h" -#include "armature/CCArmature.h" -#include "armature/CCBone.h" -#include "armature/animation/CCArmatureAnimation.h" -#include "armature/animation/CCProcessBase.h" -#include "armature/animation/CCTween.h" -#include "armature/datas/CCDatas.h" -#include "armature/display/CCBatchNode.h" -#include "armature/display/CCDecorativeDisplay.h" -#include "armature/display/CCDisplayFactory.h" -#include "armature/display/CCDisplayManager.h" -#include "armature/display/CCSkin.h" -#include "armature/physics/CCColliderDetector.h" -#include "armature/utils/CCArmatureDataManager.h" -#include "armature/utils/CCArmatureDefine.h" -#include "armature/utils/CCDataReaderHelper.h" -#include "armature/utils/CCSpriteFrameCacheHelper.h" -#include "armature/utils/CCTransformHelp.h" -#include "armature/utils/CCTweenFunction.h" -#include "armature/utils/CCUtilMath.h" -#include "components/CCComAttribute.h" -#include "components/CCComAudio.h" -#include "components/CCComController.h" -#include "components/CCComRender.h" -#include "components/CCInputDelegate.h" -#include "json/CSContentJsonDictionary.h" -#include "json/DictionaryHelper.h" -#include "reader/CCSGUIReader.h" -#include "reader/CCSSceneReader.h" +#include "cocostudio/CCActionFrame.h" +#include "cocostudio/CCActionFrameEasing.h" +#include "cocostudio/CCActionManagerEx.h" +#include "cocostudio/CCActionNode.h" +#include "cocostudio/CCActionObject.h" +#include "cocostudio/CCArmature.h" +#include "cocostudio/CCBone.h" +#include "cocostudio/CCArmatureAnimation.h" +#include "cocostudio/CCProcessBase.h" +#include "cocostudio/CCTween.h" +#include "cocostudio/CCDatas.h" +#include "cocostudio/CCBatchNode.h" +#include "cocostudio/CCDecorativeDisplay.h" +#include "cocostudio/CCDisplayFactory.h" +#include "cocostudio/CCDisplayManager.h" +#include "cocostudio/CCSkin.h" +#include "cocostudio/CCColliderDetector.h" +#include "cocostudio/CCArmatureDataManager.h" +#include "cocostudio/CCArmatureDefine.h" +#include "cocostudio/CCDataReaderHelper.h" +#include "cocostudio/CCSpriteFrameCacheHelper.h" +#include "cocostudio/CCTransformHelp.h" +#include "cocostudio/CCTweenFunction.h" +#include "cocostudio/CCUtilMath.h" +#include "cocostudio/CCComAttribute.h" +#include "cocostudio/CCComAudio.h" +#include "cocostudio/CCComController.h" +#include "cocostudio/CCComRender.h" +#include "cocostudio/CCInputDelegate.h" +#include "cocostudio/CSContentJsonDictionary.h" +#include "cocostudio/DictionaryHelper.h" +#include "cocostudio/CCSGUIReader.h" +#include "cocostudio/CCSSceneReader.h" #endif diff --git a/cocos/editor-support/cocostudio/json/DictionaryHelper.cpp b/cocos/editor-support/cocostudio/DictionaryHelper.cpp similarity index 99% rename from cocos/editor-support/cocostudio/json/DictionaryHelper.cpp rename to cocos/editor-support/cocostudio/DictionaryHelper.cpp index ab72de178e..48466eeb3e 100644 --- a/cocos/editor-support/cocostudio/json/DictionaryHelper.cpp +++ b/cocos/editor-support/cocostudio/DictionaryHelper.cpp @@ -22,7 +22,7 @@ THE SOFTWARE. ****************************************************************************/ -#include "DictionaryHelper.h" +#include "cocostudio/DictionaryHelper.h" namespace cocostudio { diff --git a/cocos/editor-support/cocostudio/json/DictionaryHelper.h b/cocos/editor-support/cocostudio/DictionaryHelper.h similarity index 98% rename from cocos/editor-support/cocostudio/json/DictionaryHelper.h rename to cocos/editor-support/cocostudio/DictionaryHelper.h index e3f34e54ed..33aa5802ed 100644 --- a/cocos/editor-support/cocostudio/json/DictionaryHelper.h +++ b/cocos/editor-support/cocostudio/DictionaryHelper.h @@ -26,7 +26,7 @@ #define __DICTIONARYHELPER_H__ #include "cocos2d.h" -#include "CSContentJsonDictionary.h" +#include "cocostudio/CSContentJsonDictionary.h" #define DICTOOL DictionaryHelper::shareHelper() diff --git a/cocos/editor-support/cocostudio/json/.DS_Store b/cocos/editor-support/cocostudio/json/.DS_Store deleted file mode 100644 index 5008ddfcf53c02e82d7eee2e57c38e5672ef89f6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0 diff --git a/extensions/GUI/CCEditBox/CCEditBoxImplMac.h b/extensions/GUI/CCEditBox/CCEditBoxImplMac.h index 069aa13273..481472dba3 100644 --- a/extensions/GUI/CCEditBox/CCEditBoxImplMac.h +++ b/extensions/GUI/CCEditBox/CCEditBoxImplMac.h @@ -33,7 +33,7 @@ #import #import -#include "ExtensionMacros.h" +#include "extensions/ExtensionMacros.h" #include "CCEditBoxImpl.h" @interface CCCustomNSTextField : NSTextField diff --git a/extensions/GUI/CCEditBox/CCEditBoxImplTizen.h b/extensions/GUI/CCEditBox/CCEditBoxImplTizen.h index 84e1ae11f1..8395ecce71 100644 --- a/extensions/GUI/CCEditBox/CCEditBoxImplTizen.h +++ b/extensions/GUI/CCEditBox/CCEditBoxImplTizen.h @@ -31,7 +31,7 @@ #if (CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN) -#include "ExtensionMacros.h" +#include "extensions/ExtensionMacros.h" #include "CCEditBoxImpl.h" NS_CC_EXT_BEGIN diff --git a/extensions/GUI/CCEditBox/CCEditBoxImplWin.h b/extensions/GUI/CCEditBox/CCEditBoxImplWin.h index 75d29c342e..2b379efe83 100644 --- a/extensions/GUI/CCEditBox/CCEditBoxImplWin.h +++ b/extensions/GUI/CCEditBox/CCEditBoxImplWin.h @@ -30,7 +30,7 @@ #if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) -#include "ExtensionMacros.h" +#include "extensions/ExtensionMacros.h" #include "CCEditBoxImpl.h" NS_CC_EXT_BEGIN diff --git a/extensions/GUI/CCScrollView/CCScrollView.h b/extensions/GUI/CCScrollView/CCScrollView.h index cb03d57c08..5b002887ee 100644 --- a/extensions/GUI/CCScrollView/CCScrollView.h +++ b/extensions/GUI/CCScrollView/CCScrollView.h @@ -27,7 +27,7 @@ #define __CCSCROLLVIEW_H__ #include "cocos2d.h" -#include "ExtensionMacros.h" +#include "extensions/ExtensionMacros.h" NS_CC_EXT_BEGIN diff --git a/extensions/GUI/CCScrollView/CCSorting.h b/extensions/GUI/CCScrollView/CCSorting.h index eca6fafc4a..7c182b193c 100644 --- a/extensions/GUI/CCScrollView/CCSorting.h +++ b/extensions/GUI/CCScrollView/CCSorting.h @@ -27,7 +27,7 @@ #define __CCSORTING_H__ #include "CCArray.h" -#include "ExtensionMacros.h" +#include "extensions/ExtensionMacros.h" NS_CC_EXT_BEGIN diff --git a/extensions/assets-manager/AssetsManager.h b/extensions/assets-manager/AssetsManager.h index 7c1781b9b9..23e1a27774 100644 --- a/extensions/assets-manager/AssetsManager.h +++ b/extensions/assets-manager/AssetsManager.h @@ -30,7 +30,7 @@ #include #include "cocos2d.h" -#include "ExtensionMacros.h" +#include "extensions/ExtensionMacros.h" NS_CC_EXT_BEGIN diff --git a/extensions/physics-nodes/CCPhysicsDebugNode.h b/extensions/physics-nodes/CCPhysicsDebugNode.h index 9f793c0a4f..fe4d167bff 100644 --- a/extensions/physics-nodes/CCPhysicsDebugNode.h +++ b/extensions/physics-nodes/CCPhysicsDebugNode.h @@ -24,7 +24,7 @@ #define __PHYSICSNODES_DEBUGNODE_H__ #include "cocos2d.h" -#include "ExtensionMacros.h" +#include "extensions/ExtensionMacros.h" #if CC_ENABLE_CHIPMUNK_INTEGRATION diff --git a/extensions/physics-nodes/CCPhysicsSprite.h b/extensions/physics-nodes/CCPhysicsSprite.h index c21dd185da..1252af5919 100644 --- a/extensions/physics-nodes/CCPhysicsSprite.h +++ b/extensions/physics-nodes/CCPhysicsSprite.h @@ -23,7 +23,7 @@ #define __PHYSICSNODES_CCPHYSICSSPRITE_H__ #include "cocos2d.h" -#include "ExtensionMacros.h" +#include "extensions/ExtensionMacros.h" struct cpBody; class b2Body; diff --git a/samples/Cpp/TestCpp/Android.mk b/samples/Cpp/TestCpp/Android.mk index 9ed6038242..bd0a8e37e6 100644 --- a/samples/Cpp/TestCpp/Android.mk +++ b/samples/Cpp/TestCpp/Android.mk @@ -7,137 +7,137 @@ LOCAL_MODULE := cocos_testcpp_common LOCAL_MODULE_FILENAME := libtestcppcommon LOCAL_SRC_FILES := \ -$(LOCAL_PATH)/Classes/AppDelegate.cpp \ -$(LOCAL_PATH)/Classes/BaseTest.cpp \ -$(LOCAL_PATH)/Classes/controller.cpp \ -$(LOCAL_PATH)/Classes/testBasic.cpp \ -$(LOCAL_PATH)/Classes/VisibleRect.cpp \ -$(LOCAL_PATH)/Classes/AccelerometerTest/AccelerometerTest.cpp \ -$(LOCAL_PATH)/Classes/ActionManagerTest/ActionManagerTest.cpp \ -$(LOCAL_PATH)/Classes/ActionsEaseTest/ActionsEaseTest.cpp \ -$(LOCAL_PATH)/Classes/ActionsProgressTest/ActionsProgressTest.cpp \ -$(LOCAL_PATH)/Classes/ActionsTest/ActionsTest.cpp \ -$(LOCAL_PATH)/Classes/Box2DTest/Box2dTest.cpp \ -$(LOCAL_PATH)/Classes/Box2DTestBed/Box2dView.cpp \ -$(LOCAL_PATH)/Classes/Box2DTestBed/GLES-Render.cpp \ -$(LOCAL_PATH)/Classes/Box2DTestBed/Test.cpp \ -$(LOCAL_PATH)/Classes/Box2DTestBed/TestEntries.cpp \ -$(LOCAL_PATH)/Classes/BugsTest/Bug-1159.cpp \ -$(LOCAL_PATH)/Classes/BugsTest/Bug-1174.cpp \ -$(LOCAL_PATH)/Classes/BugsTest/Bug-350.cpp \ -$(LOCAL_PATH)/Classes/BugsTest/Bug-422.cpp \ -$(LOCAL_PATH)/Classes/BugsTest/Bug-624.cpp \ -$(LOCAL_PATH)/Classes/BugsTest/Bug-886.cpp \ -$(LOCAL_PATH)/Classes/BugsTest/Bug-899.cpp \ -$(LOCAL_PATH)/Classes/BugsTest/Bug-914.cpp \ -$(LOCAL_PATH)/Classes/BugsTest/BugsTest.cpp \ -$(LOCAL_PATH)/Classes/BugsTest/Bug-458/Bug-458.cpp \ -$(LOCAL_PATH)/Classes/BugsTest/Bug-458/QuestionContainerSprite.cpp \ -$(LOCAL_PATH)/Classes/ChipmunkTest/ChipmunkTest.cpp \ -$(LOCAL_PATH)/Classes/ClickAndMoveTest/ClickAndMoveTest.cpp \ -$(LOCAL_PATH)/Classes/ClippingNodeTest/ClippingNodeTest.cpp \ -$(LOCAL_PATH)/Classes/CocosDenshionTest/CocosDenshionTest.cpp \ -$(LOCAL_PATH)/Classes/ConfigurationTest/ConfigurationTest.cpp \ -$(LOCAL_PATH)/Classes/CurlTest/CurlTest.cpp \ -$(LOCAL_PATH)/Classes/CurrentLanguageTest/CurrentLanguageTest.cpp \ -$(LOCAL_PATH)/Classes/DataVisitorTest/DataVisitorTest.cpp \ -$(LOCAL_PATH)/Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp \ -$(LOCAL_PATH)/Classes/EffectsAdvancedTest/EffectsAdvancedTest.cpp \ -$(LOCAL_PATH)/Classes/EffectsTest/EffectsTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/ExtensionsTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocosBuilderTest/CocosBuilderTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioComponentsTest/ComponentsTestScene.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioComponentsTest/EnemyController.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioComponentsTest/GameOverScene.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioComponentsTest/PlayerController.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioComponentsTest/ProjectileController.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioComponentsTest/SceneController.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/CocosGUIScene.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UIScene.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UISceneManager.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UIDragPanelTest/UIDragPanelTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UILabelAtlasTest/UILabelAtlasTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UILabelBMFontTest/UILabelBMFontTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UILabelTest/UILabelTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UINodeContainerTest/UINodeContainerTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UIPanelTest/UIPanelTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UISliderTest/UISliderTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UITextAreaTest/UITextAreaTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UITextButtonTest/UITextButtonTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/ControlExtensionTest/CCControlScene.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/ControlExtensionTest/CCControlSceneManager.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/ControlExtensionTest/CCControlButtonTest/CCControlButtonTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/ControlExtensionTest/CCControlColourPicker/CCControlColourPickerTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/ControlExtensionTest/CCControlPotentiometerTest/CCControlPotentiometerTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/ControlExtensionTest/CCControlSliderTest/CCControlSliderTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/ControlExtensionTest/CCControlStepperTest/CCControlStepperTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/ControlExtensionTest/CCControlSwitchTest/CCControlSwitchTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/EditBoxTest/EditBoxTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/NetworkTest/HttpClientTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/NetworkTest/SocketIOTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/NetworkTest/WebSocketTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/Scale9SpriteTest/Scale9SpriteTest.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/TableViewTest/CustomTableViewCell.cpp \ -$(LOCAL_PATH)/Classes/ExtensionsTest/TableViewTest/TableViewTestScene.cpp \ -$(LOCAL_PATH)/Classes/FileUtilsTest/FileUtilsTest.cpp \ -$(LOCAL_PATH)/Classes/FontTest/FontTest.cpp \ -$(LOCAL_PATH)/Classes/IntervalTest/IntervalTest.cpp \ -$(LOCAL_PATH)/Classes/KeyboardTest/KeyboardTest.cpp \ -$(LOCAL_PATH)/Classes/KeypadTest/KeypadTest.cpp \ -$(LOCAL_PATH)/Classes/LabelTest/LabelTest.cpp \ -$(LOCAL_PATH)/Classes/LabelTest/LabelTestNew.cpp \ -$(LOCAL_PATH)/Classes/LayerTest/LayerTest.cpp \ -$(LOCAL_PATH)/Classes/MenuTest/MenuTest.cpp \ -$(LOCAL_PATH)/Classes/MotionStreakTest/MotionStreakTest.cpp \ -$(LOCAL_PATH)/Classes/MutiTouchTest/MutiTouchTest.cpp \ -$(LOCAL_PATH)/Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp \ -$(LOCAL_PATH)/Classes/NodeTest/NodeTest.cpp \ -$(LOCAL_PATH)/Classes/ParallaxTest/ParallaxTest.cpp \ -$(LOCAL_PATH)/Classes/ParticleTest/ParticleTest.cpp \ -$(LOCAL_PATH)/Classes/PerformanceTest/PerformanceAllocTest.cpp \ -$(LOCAL_PATH)/Classes/PerformanceTest/PerformanceNodeChildrenTest.cpp \ -$(LOCAL_PATH)/Classes/PerformanceTest/PerformanceParticleTest.cpp \ -$(LOCAL_PATH)/Classes/PerformanceTest/PerformanceSpriteTest.cpp \ -$(LOCAL_PATH)/Classes/PerformanceTest/PerformanceTest.cpp \ -$(LOCAL_PATH)/Classes/PerformanceTest/PerformanceTextureTest.cpp \ -$(LOCAL_PATH)/Classes/PerformanceTest/PerformanceTouchesTest.cpp \ -$(LOCAL_PATH)/Classes/PhysicsTest/PhysicsTest.cpp \ -$(LOCAL_PATH)/Classes/RenderTextureTest/RenderTextureTest.cpp \ -$(LOCAL_PATH)/Classes/RotateWorldTest/RotateWorldTest.cpp \ -$(LOCAL_PATH)/Classes/SceneTest/SceneTest.cpp \ -$(LOCAL_PATH)/Classes/SchedulerTest/SchedulerTest.cpp \ -$(LOCAL_PATH)/Classes/ShaderTest/ShaderTest.cpp \ -$(LOCAL_PATH)/Classes/ShaderTest/ShaderTest2.cpp \ -$(LOCAL_PATH)/Classes/SpineTest/SpineTest.cpp \ -$(LOCAL_PATH)/Classes/SpriteTest/SpriteTest.cpp \ -$(LOCAL_PATH)/Classes/TextInputTest/TextInputTest.cpp \ -$(LOCAL_PATH)/Classes/Texture2dTest/Texture2dTest.cpp \ -$(LOCAL_PATH)/Classes/TextureCacheTest/TextureCacheTest.cpp \ -$(LOCAL_PATH)/Classes/TexturePackerEncryptionTest/TextureAtlasEncryptionTest.cpp \ -$(LOCAL_PATH)/Classes/TileMapTest/TileMapTest.cpp \ -$(LOCAL_PATH)/Classes/TouchesTest/Ball.cpp \ -$(LOCAL_PATH)/Classes/TouchesTest/Paddle.cpp \ -$(LOCAL_PATH)/Classes/TouchesTest/TouchesTest.cpp \ -$(LOCAL_PATH)/Classes/TransitionsTest/TransitionsTest.cpp \ -$(LOCAL_PATH)/Classes/UserDefaultTest/UserDefaultTest.cpp \ -$(LOCAL_PATH)/Classes/ZwoptexTest/ZwoptexTest.cpp +Classes/AppDelegate.cpp \ +Classes/BaseTest.cpp \ +Classes/controller.cpp \ +Classes/testBasic.cpp \ +Classes/VisibleRect.cpp \ +Classes/AccelerometerTest/AccelerometerTest.cpp \ +Classes/ActionManagerTest/ActionManagerTest.cpp \ +Classes/ActionsEaseTest/ActionsEaseTest.cpp \ +Classes/ActionsProgressTest/ActionsProgressTest.cpp \ +Classes/ActionsTest/ActionsTest.cpp \ +Classes/Box2DTest/Box2dTest.cpp \ +Classes/Box2DTestBed/Box2dView.cpp \ +Classes/Box2DTestBed/GLES-Render.cpp \ +Classes/Box2DTestBed/Test.cpp \ +Classes/Box2DTestBed/TestEntries.cpp \ +Classes/BugsTest/Bug-1159.cpp \ +Classes/BugsTest/Bug-1174.cpp \ +Classes/BugsTest/Bug-350.cpp \ +Classes/BugsTest/Bug-422.cpp \ +Classes/BugsTest/Bug-624.cpp \ +Classes/BugsTest/Bug-886.cpp \ +Classes/BugsTest/Bug-899.cpp \ +Classes/BugsTest/Bug-914.cpp \ +Classes/BugsTest/BugsTest.cpp \ +Classes/BugsTest/Bug-458/Bug-458.cpp \ +Classes/BugsTest/Bug-458/QuestionContainerSprite.cpp \ +Classes/ChipmunkTest/ChipmunkTest.cpp \ +Classes/ClickAndMoveTest/ClickAndMoveTest.cpp \ +Classes/ClippingNodeTest/ClippingNodeTest.cpp \ +Classes/CocosDenshionTest/CocosDenshionTest.cpp \ +Classes/ConfigurationTest/ConfigurationTest.cpp \ +Classes/CurlTest/CurlTest.cpp \ +Classes/CurrentLanguageTest/CurrentLanguageTest.cpp \ +Classes/DataVisitorTest/DataVisitorTest.cpp \ +Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp \ +Classes/EffectsAdvancedTest/EffectsAdvancedTest.cpp \ +Classes/EffectsTest/EffectsTest.cpp \ +Classes/ExtensionsTest/ExtensionsTest.cpp \ +Classes/ExtensionsTest/CocosBuilderTest/CocosBuilderTest.cpp \ +Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.cpp \ +Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.cpp \ +Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.cpp \ +Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.cpp \ +Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.cpp \ +Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.cpp \ +Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp \ +Classes/ExtensionsTest/CocoStudioComponentsTest/ComponentsTestScene.cpp \ +Classes/ExtensionsTest/CocoStudioComponentsTest/EnemyController.cpp \ +Classes/ExtensionsTest/CocoStudioComponentsTest/GameOverScene.cpp \ +Classes/ExtensionsTest/CocoStudioComponentsTest/PlayerController.cpp \ +Classes/ExtensionsTest/CocoStudioComponentsTest/ProjectileController.cpp \ +Classes/ExtensionsTest/CocoStudioComponentsTest/SceneController.cpp \ +Classes/ExtensionsTest/CocoStudioGUITest/CocosGUIScene.cpp \ +Classes/ExtensionsTest/CocoStudioGUITest/UIScene.cpp \ +Classes/ExtensionsTest/CocoStudioGUITest/UISceneManager.cpp \ +Classes/ExtensionsTest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp \ +Classes/ExtensionsTest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.cpp \ +Classes/ExtensionsTest/CocoStudioGUITest/UIDragPanelTest/UIDragPanelTest.cpp \ +Classes/ExtensionsTest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.cpp \ +Classes/ExtensionsTest/CocoStudioGUITest/UILabelAtlasTest/UILabelAtlasTest.cpp \ +Classes/ExtensionsTest/CocoStudioGUITest/UILabelBMFontTest/UILabelBMFontTest.cpp \ +Classes/ExtensionsTest/CocoStudioGUITest/UILabelTest/UILabelTest.cpp \ +Classes/ExtensionsTest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp \ +Classes/ExtensionsTest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.cpp \ +Classes/ExtensionsTest/CocoStudioGUITest/UINodeContainerTest/UINodeContainerTest.cpp \ +Classes/ExtensionsTest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp \ +Classes/ExtensionsTest/CocoStudioGUITest/UIPanelTest/UIPanelTest.cpp \ +Classes/ExtensionsTest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest.cpp \ +Classes/ExtensionsTest/CocoStudioGUITest/UISliderTest/UISliderTest.cpp \ +Classes/ExtensionsTest/CocoStudioGUITest/UITextAreaTest/UITextAreaTest.cpp \ +Classes/ExtensionsTest/CocoStudioGUITest/UITextButtonTest/UITextButtonTest.cpp \ +Classes/ExtensionsTest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp \ +Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp \ +Classes/ExtensionsTest/ControlExtensionTest/CCControlScene.cpp \ +Classes/ExtensionsTest/ControlExtensionTest/CCControlSceneManager.cpp \ +Classes/ExtensionsTest/ControlExtensionTest/CCControlButtonTest/CCControlButtonTest.cpp \ +Classes/ExtensionsTest/ControlExtensionTest/CCControlColourPicker/CCControlColourPickerTest.cpp \ +Classes/ExtensionsTest/ControlExtensionTest/CCControlPotentiometerTest/CCControlPotentiometerTest.cpp \ +Classes/ExtensionsTest/ControlExtensionTest/CCControlSliderTest/CCControlSliderTest.cpp \ +Classes/ExtensionsTest/ControlExtensionTest/CCControlStepperTest/CCControlStepperTest.cpp \ +Classes/ExtensionsTest/ControlExtensionTest/CCControlSwitchTest/CCControlSwitchTest.cpp \ +Classes/ExtensionsTest/EditBoxTest/EditBoxTest.cpp \ +Classes/ExtensionsTest/NetworkTest/HttpClientTest.cpp \ +Classes/ExtensionsTest/NetworkTest/SocketIOTest.cpp \ +Classes/ExtensionsTest/NetworkTest/WebSocketTest.cpp \ +Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.cpp \ +Classes/ExtensionsTest/Scale9SpriteTest/Scale9SpriteTest.cpp \ +Classes/ExtensionsTest/TableViewTest/CustomTableViewCell.cpp \ +Classes/ExtensionsTest/TableViewTest/TableViewTestScene.cpp \ +Classes/FileUtilsTest/FileUtilsTest.cpp \ +Classes/FontTest/FontTest.cpp \ +Classes/IntervalTest/IntervalTest.cpp \ +Classes/KeyboardTest/KeyboardTest.cpp \ +Classes/KeypadTest/KeypadTest.cpp \ +Classes/LabelTest/LabelTest.cpp \ +Classes/LabelTest/LabelTestNew.cpp \ +Classes/LayerTest/LayerTest.cpp \ +Classes/MenuTest/MenuTest.cpp \ +Classes/MotionStreakTest/MotionStreakTest.cpp \ +Classes/MutiTouchTest/MutiTouchTest.cpp \ +Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp \ +Classes/NodeTest/NodeTest.cpp \ +Classes/ParallaxTest/ParallaxTest.cpp \ +Classes/ParticleTest/ParticleTest.cpp \ +Classes/PerformanceTest/PerformanceAllocTest.cpp \ +Classes/PerformanceTest/PerformanceNodeChildrenTest.cpp \ +Classes/PerformanceTest/PerformanceParticleTest.cpp \ +Classes/PerformanceTest/PerformanceSpriteTest.cpp \ +Classes/PerformanceTest/PerformanceTest.cpp \ +Classes/PerformanceTest/PerformanceTextureTest.cpp \ +Classes/PerformanceTest/PerformanceTouchesTest.cpp \ +Classes/PhysicsTest/PhysicsTest.cpp \ +Classes/RenderTextureTest/RenderTextureTest.cpp \ +Classes/RotateWorldTest/RotateWorldTest.cpp \ +Classes/SceneTest/SceneTest.cpp \ +Classes/SchedulerTest/SchedulerTest.cpp \ +Classes/ShaderTest/ShaderTest.cpp \ +Classes/ShaderTest/ShaderTest2.cpp \ +Classes/SpineTest/SpineTest.cpp \ +Classes/SpriteTest/SpriteTest.cpp \ +Classes/TextInputTest/TextInputTest.cpp \ +Classes/Texture2dTest/Texture2dTest.cpp \ +Classes/TextureCacheTest/TextureCacheTest.cpp \ +Classes/TexturePackerEncryptionTest/TextureAtlasEncryptionTest.cpp \ +Classes/TileMapTest/TileMapTest.cpp \ +Classes/TouchesTest/Ball.cpp \ +Classes/TouchesTest/Paddle.cpp \ +Classes/TouchesTest/TouchesTest.cpp \ +Classes/TransitionsTest/TransitionsTest.cpp \ +Classes/UserDefaultTest/UserDefaultTest.cpp \ +Classes/ZwoptexTest/ZwoptexTest.cpp LOCAL_C_INCLUDES := $(LOCAL_PATH)/Classes @@ -153,7 +153,7 @@ LOCAL_WHOLE_STATIC_LIBRARIES += cocostudio_static LOCAL_WHOLE_STATIC_LIBRARIES += network_static LOCAL_WHOLE_STATIC_LIBRARIES += cocos_curl_static -LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/Classes include $(BUILD_STATIC_LIBRARY) diff --git a/samples/Cpp/TestCpp/Classes/AppDelegate.cpp b/samples/Cpp/TestCpp/Classes/AppDelegate.cpp index 515a63c9be..ddd7936152 100644 --- a/samples/Cpp/TestCpp/Classes/AppDelegate.cpp +++ b/samples/Cpp/TestCpp/Classes/AppDelegate.cpp @@ -4,7 +4,7 @@ #include "controller.h" #include "SimpleAudioEngine.h" #include "cocostudio/CocoStudio.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" USING_NS_CC; using namespace CocosDenshion; diff --git a/samples/Cpp/TestCpp/Classes/Box2DTest/Box2dTest.cpp b/samples/Cpp/TestCpp/Classes/Box2DTest/Box2dTest.cpp index 8061e522f9..ca75a9efe3 100644 --- a/samples/Cpp/TestCpp/Classes/Box2DTest/Box2dTest.cpp +++ b/samples/Cpp/TestCpp/Classes/Box2DTest/Box2dTest.cpp @@ -1,6 +1,6 @@ #include "Box2dTest.h" #include "../testResource.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" USING_NS_CC_EXT; #define PTM_RATIO 32 diff --git a/samples/Cpp/TestCpp/Classes/ChipmunkTest/ChipmunkTest.h b/samples/Cpp/TestCpp/Classes/ChipmunkTest/ChipmunkTest.h index 06fa3eb55a..33ae31cee7 100644 --- a/samples/Cpp/TestCpp/Classes/ChipmunkTest/ChipmunkTest.h +++ b/samples/Cpp/TestCpp/Classes/ChipmunkTest/ChipmunkTest.h @@ -7,7 +7,7 @@ #include "cocos2d.h" #include "chipmunk.h" #include "../testBasic.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" USING_NS_CC_EXT; diff --git a/samples/Cpp/TestCpp/Classes/CocosDenshionTest/CocosDenshionTest.cpp b/samples/Cpp/TestCpp/Classes/CocosDenshionTest/CocosDenshionTest.cpp index f4ff8718a3..207a26a2ab 100644 --- a/samples/Cpp/TestCpp/Classes/CocosDenshionTest/CocosDenshionTest.cpp +++ b/samples/Cpp/TestCpp/Classes/CocosDenshionTest/CocosDenshionTest.cpp @@ -1,7 +1,7 @@ #include "CocosDenshionTest.h" #include "cocos2d.h" #include "SimpleAudioEngine.h" -#include "GUI/CCControlExtension/CCControlSlider.h" +#include "extensions/GUI/CCControlExtension/CCControlSlider.h" // android effect only support ogg #if (CC_TARGET_PLATFORM == CC_PLATFOR_ANDROID) diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.h index f6001395c3..625fdddf88 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.h @@ -2,7 +2,7 @@ #define __HELLOWORLD_SCENE_H__ #include "cocos2d.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" #include "../../VisibleRect.h" #include "../../testBasic.h" #include "cocostudio/CocoStudio.h" diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/ComponentsTestScene.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/ComponentsTestScene.h index edb704b8b1..152764c4bc 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/ComponentsTestScene.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/ComponentsTestScene.h @@ -2,7 +2,7 @@ #define __COMPONENTSTESTSCENE_H__ #include "cocos2d.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" void runComponentsTestLayerTest(); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/EnemyController.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/EnemyController.h index 31e3fc5f2d..0025fd6309 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/EnemyController.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/EnemyController.h @@ -2,7 +2,7 @@ #define __CC_ENEMYCONTROLLER_H__ #include "cocos2d.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" #include "cocostudio/CocoStudio.h" diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/PlayerController.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/PlayerController.h index 9ce5b3b424..671bdf7833 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/PlayerController.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/PlayerController.h @@ -2,7 +2,7 @@ #define __CC_PLAYERCONTROLLER_H__ #include "cocos2d.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" #include "cocostudio/CocoStudio.h" diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/ProjectileController.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/ProjectileController.h index de3c855c86..7ae6b71ab1 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/ProjectileController.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/ProjectileController.h @@ -2,7 +2,7 @@ #define __CC_PROJECTILECONTROLLER_H__ #include "cocos2d.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" #include "cocostudio/CocoStudio.h" class ProjectileController : public cocostudio::ComController diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/SceneController.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/SceneController.h index f35b663126..4d6efe0c89 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/SceneController.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/SceneController.h @@ -2,7 +2,7 @@ #define __CC_SceneController_H__ #include "cocos2d.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" #include "cocostudio/CocoStudio.h" class SceneController : public cocostudio::ComController diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/CocosGUIScene.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/CocosGUIScene.h index 7e2ab4fd00..5bf2c93be1 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/CocosGUIScene.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/CocosGUIScene.h @@ -26,9 +26,9 @@ #define __TestCpp__CocosGUIScene__ #include "cocos2d.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" #include "../../testBasic.h" -#include "system/CocosGUI.h" +#include "gui/CocosGUI.h" using namespace cocos2d; using namespace cocos2d::extension; diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UINodeContainerTest/UINodeContainerTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UINodeContainerTest/UINodeContainerTest.cpp index e4bd80560f..4ac36f958d 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UINodeContainerTest/UINodeContainerTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UINodeContainerTest/UINodeContainerTest.cpp @@ -1,7 +1,7 @@ #include "UINodeContainerTest.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" const char* font_UINodeContainerTest = #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScene.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScene.cpp index 3f3cf16873..a57787dfb1 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScene.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScene.cpp @@ -1,5 +1,5 @@ -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" #include "UIScene.h" #include "UISceneManager.h" #include "../ExtensionsTest.h" diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScene.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScene.h index 582964d66a..bf10ffa76b 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScene.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScene.h @@ -26,8 +26,8 @@ #define __TestCpp__UIScene__ #include "cocos2d.h" -#include "cocos-ext.h" -#include "system/CocosGUI.h" +#include "extensions/cocos-ext.h" +#include "gui/CocosGUI.h" USING_NS_CC; USING_NS_CC_EXT; diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp index dbc04df6ef..0ce946c5a6 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp @@ -1,9 +1,9 @@ -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" #include "../ExtensionsTest.h" #include "SceneEditorTest.h" #include "cocostudio/CocoStudio.h" -#include "system/CocosGUI.h" +#include "gui/CocosGUI.h" using namespace cocos2d; using namespace cocostudio; diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.h index 186ce364f3..58494ee696 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.h @@ -2,7 +2,7 @@ #define __SCENEEDITORTESTSCENE_H__ #include "cocos2d.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" void runSceneEditorTestLayer(); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.h index 2fbbd0f427..2ad6658306 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.h @@ -2,7 +2,7 @@ #define _ANIMATIONSTESTLAYER_H_ #include "cocos2d.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" #include "cocosbuilder/CocosBuilder.h" class AnimationsTestLayer diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.h index 706ec6b2f7..1fa38a7e0c 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.h @@ -2,7 +2,7 @@ #define _BUTTONTESTLAYER_H_ #include "cocos2d.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" #include "cocosbuilder/CocosBuilder.h" class ButtonTestLayer diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.h index d6ab2071c4..15a19b5519 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.h @@ -2,7 +2,7 @@ #define _HELLOCOCOSBUILDERLAYER_H_ #include "cocos2d.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" #include "cocosbuilder/CocosBuilder.h" /* diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/LabelTest/LabelTestLayer.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/LabelTest/LabelTestLayer.h index e92245029f..3cee0e0d46 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/LabelTest/LabelTestLayer.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/LabelTest/LabelTestLayer.h @@ -2,7 +2,7 @@ #define _LABELTESTLAYER_H_ #include "cocos2d.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" class LabelTestLayer : public cocos2d::Layer { public: diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.h index 11c12da610..36c256cf94 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.h @@ -2,7 +2,7 @@ #define _MENUTESTLAYER_H_ #include "cocos2d.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" #include "cocosbuilder/CocosBuilder.h" class MenuTestLayer diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ParticleSystemTest/ParticleSystemTestLayer.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ParticleSystemTest/ParticleSystemTestLayer.h index 1f41f6e3fd..cf06eb3e87 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ParticleSystemTest/ParticleSystemTestLayer.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ParticleSystemTest/ParticleSystemTestLayer.h @@ -2,7 +2,7 @@ #define _PARTICLESYSTEMTESTLAYER_H_ #include "cocos2d.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" class ParticleSystemTestLayer : public cocos2d::Layer { public: diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ScrollViewTest/ScrollViewTestLayer.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ScrollViewTest/ScrollViewTestLayer.h index d2d5433fd4..e16039b3ca 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ScrollViewTest/ScrollViewTestLayer.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ScrollViewTest/ScrollViewTestLayer.h @@ -2,7 +2,7 @@ #define _SCROLLVIEWTESTLAYER_H_ #include "cocos2d.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" class ScrollViewTestLayer : public cocos2d::Layer { public: diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/SpriteTest/SpriteTestLayer.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/SpriteTest/SpriteTestLayer.h index ef053be4d9..488a5c4da9 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/SpriteTest/SpriteTestLayer.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/SpriteTest/SpriteTestLayer.h @@ -2,7 +2,7 @@ #define _SPRITETESTLAYER_H_ #include "cocos2d.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" class SpriteTestLayer : public cocos2d::Layer { public: diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.h index f36dea647e..6adde2aeda 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.h @@ -2,7 +2,7 @@ #define _TESTHEADERLAYER_H_ #include "cocos2d.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" #include "cocosbuilder/CocosBuilder.h" class TestHeaderLayer diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.h index 87cf80d7b6..f3d47ca84c 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.h @@ -2,7 +2,7 @@ #define _TIMELINE_TESTLAYER_H_ #include "cocos2d.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" #include "cocosbuilder/CocosBuilder.h" class TimelineCallbackTestLayer diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlColourPicker/CCControlColourPickerTest.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlColourPicker/CCControlColourPickerTest.h index 1419606d23..7c5c6839a4 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlColourPicker/CCControlColourPickerTest.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlColourPicker/CCControlColourPickerTest.h @@ -24,7 +24,7 @@ */ #include "../CCControlScene.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" USING_NS_CC_EXT; diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlScene.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlScene.h index 0d90639cfa..3ca532d095 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlScene.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlScene.h @@ -27,7 +27,7 @@ #define __CCCONTROLSCENE_H__ #include "cocos2d.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" USING_NS_CC; diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlSceneManager.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlSceneManager.h index b144555e3f..3eb912624a 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlSceneManager.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlSceneManager.h @@ -26,7 +26,7 @@ #define __CCCONTROLSCENEMANAGER_H__ #include "cocos2d.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" USING_NS_CC; diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/EditBoxTest/EditBoxTest.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/EditBoxTest/EditBoxTest.h index 7d9e383bd7..640e359775 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/EditBoxTest/EditBoxTest.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/EditBoxTest/EditBoxTest.h @@ -10,7 +10,7 @@ #define __TestCpp__CCEditBoxTest__ #include "cocos2d.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" class EditBoxTest : public cocos2d::Layer, public cocos2d::extension::EditBoxDelegate { diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/HttpClientTest.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/HttpClientTest.h index ab432491dc..9f7d1d3fa3 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/HttpClientTest.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/HttpClientTest.h @@ -2,8 +2,8 @@ #define __HTTP_CLIENT_H__ #include "cocos2d.h" -#include "cocos-ext.h" -#include "HttpClient.h" +#include "extensions/cocos-ext.h" +#include "network/HttpClient.h" class HttpClientTest : public cocos2d::Layer { diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/SocketIOTest.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/SocketIOTest.h index 596738749c..56695bb6a4 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/SocketIOTest.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/SocketIOTest.h @@ -9,8 +9,8 @@ #define __TestCpp__SocketIOTest__ #include "cocos2d.h" -#include "cocos-ext.h" -#include "SocketIO.h" +#include "extensions/cocos-ext.h" +#include "network/SocketIO.h" class SocketIOTestLayer : public cocos2d::Layer diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/WebSocketTest.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/WebSocketTest.h index 7ca1080e40..fcec4ec724 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/WebSocketTest.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/WebSocketTest.h @@ -10,8 +10,8 @@ #define __TestCpp__WebSocketTest__ #include "cocos2d.h" -#include "cocos-ext.h" -#include "WebSocket.h" +#include "extensions/cocos-ext.h" +#include "network/WebSocket.h" class WebSocketTestLayer : public cocos2d::Layer diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/Scale9SpriteTest/Scale9SpriteTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/Scale9SpriteTest/Scale9SpriteTest.cpp index c5674a1443..ee0bfe043b 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/Scale9SpriteTest/Scale9SpriteTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/Scale9SpriteTest/Scale9SpriteTest.cpp @@ -28,7 +28,7 @@ #include "Scale9SpriteTest.h" #include "testResource.h" #include "cocos2d.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" USING_NS_CC_EXT; diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/TableViewTest/CustomTableViewCell.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/TableViewTest/CustomTableViewCell.h index 16a8c74f25..2ee951ca73 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/TableViewTest/CustomTableViewCell.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/TableViewTest/CustomTableViewCell.h @@ -2,7 +2,7 @@ #define __CUSTOMTABELVIEWCELL_H__ #include "cocos2d.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" class CustomTableViewCell : public cocos2d::extension::TableViewCell { diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/TableViewTest/TableViewTestScene.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/TableViewTest/TableViewTestScene.h index 7becc72781..a505195359 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/TableViewTest/TableViewTestScene.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/TableViewTest/TableViewTestScene.h @@ -2,7 +2,7 @@ #define __TABLEVIEWTESTSCENE_H__ #include "cocos2d.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" void runTableViewTest(); diff --git a/samples/Cpp/TestCpp/Classes/SchedulerTest/SchedulerTest.h b/samples/Cpp/TestCpp/Classes/SchedulerTest/SchedulerTest.h index 383c3ee1ac..3e5ba3c9ac 100644 --- a/samples/Cpp/TestCpp/Classes/SchedulerTest/SchedulerTest.h +++ b/samples/Cpp/TestCpp/Classes/SchedulerTest/SchedulerTest.h @@ -2,7 +2,7 @@ #define _SCHEDULER_TEST_H_ #include "cocos2d.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" #include "../testBasic.h" #include "../BaseTest.h" diff --git a/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest.h b/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest.h index 707793a1c5..33876c724a 100644 --- a/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest.h +++ b/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest.h @@ -2,7 +2,7 @@ #define _SHADER_TEST_H_ #include "../testBasic.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" #include "../BaseTest.h" USING_NS_CC_EXT; diff --git a/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest2.h b/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest2.h index 797b7a13ca..95ddbc592d 100644 --- a/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest2.h +++ b/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest2.h @@ -1,7 +1,7 @@ #ifndef _SHADER_TEST2_H_ #define _SHADER_TEST2_H_ #include "../testBasic.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" #include "../BaseTest.h" USING_NS_CC_EXT; diff --git a/samples/Cpp/TestCpp/Classes/testBasic.cpp b/samples/Cpp/TestCpp/Classes/testBasic.cpp index b35170021f..4f7614f701 100644 --- a/samples/Cpp/TestCpp/Classes/testBasic.cpp +++ b/samples/Cpp/TestCpp/Classes/testBasic.cpp @@ -1,6 +1,6 @@ #include "testBasic.h" #include "controller.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" #include "cocostudio/CocoStudio.h" TestScene::TestScene(bool bPortrait) diff --git a/samples/Cpp/TestCpp/proj.android/jni/Android.mk b/samples/Cpp/TestCpp/proj.android/jni/Android.mk index c3190eef74..7867f3f1fb 100644 --- a/samples/Cpp/TestCpp/proj.android/jni/Android.mk +++ b/samples/Cpp/TestCpp/proj.android/jni/Android.mk @@ -8,7 +8,7 @@ LOCAL_MODULE_FILENAME := libtestcpp LOCAL_SRC_FILES := testcpp/main.cpp -LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes +LOCAL_C_INCLUDES := ../../Classes LOCAL_WHOLE_STATIC_LIBRARIES := cocos_testcpp_common diff --git a/samples/Lua/HelloLua/Classes/AppDelegate.cpp b/samples/Lua/HelloLua/Classes/AppDelegate.cpp index 1e2cef387a..d693936216 100644 --- a/samples/Lua/HelloLua/Classes/AppDelegate.cpp +++ b/samples/Lua/HelloLua/Classes/AppDelegate.cpp @@ -1,7 +1,7 @@ #include "cocos2d.h" #include "AppDelegate.h" #include "SimpleAudioEngine.h" -#include "script_support/CCScriptSupport.h" +#include "CCScriptSupport.h" #include "CCLuaEngine.h" USING_NS_CC; diff --git a/samples/Lua/HelloLua/proj.android/build_native.sh b/samples/Lua/HelloLua/proj.android/build_native.sh index 7a7144497f..47bf4396ad 100755 --- a/samples/Lua/HelloLua/proj.android/build_native.sh +++ b/samples/Lua/HelloLua/proj.android/build_native.sh @@ -108,9 +108,9 @@ done if [[ "$buildexternalsfromsource" ]]; then echo "Building external dependencies from source" "$NDK_ROOT"/ndk-build -C "$APP_ANDROID_ROOT" $* \ - "NDK_MODULE_PATH=${COCOS2DX_ROOT}:${COCOS2DX_ROOT}/cocos2dx/platform/third_party/android/source" + "NDK_MODULE_PATH=${COCOS2DX_ROOT}/external:${COCOS2DX_ROOT}/cocos:${COCOS2DX_ROOT}" else echo "Using prebuilt externals" "$NDK_ROOT"/ndk-build -C "$APP_ANDROID_ROOT" $* \ - "NDK_MODULE_PATH=${COCOS2DX_ROOT}:${COCOS2DX_ROOT}/cocos2dx/platform/third_party/android/prebuilt" + "NDK_MODULE_PATH=${COCOS2DX_ROOT}/external:${COCOS2DX_ROOT}/cocos:${COCOS2DX_ROOT}" fi diff --git a/samples/Lua/HelloLua/proj.android/jni/Android.mk b/samples/Lua/HelloLua/proj.android/jni/Android.mk index e4aa117413..09d83731fb 100644 --- a/samples/Lua/HelloLua/proj.android/jni/Android.mk +++ b/samples/Lua/HelloLua/proj.android/jni/Android.mk @@ -11,16 +11,9 @@ LOCAL_SRC_FILES := hellolua/main.cpp \ LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes -LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static -LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_static -LOCAL_WHOLE_STATIC_LIBRARIES += cocos_lua_static -LOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static -LOCAL_WHOLE_STATIC_LIBRARIES += cocos2dxandroid_static +LOCAL_WHOLE_STATIC_LIBRARIES := cocos_lua_static + include $(BUILD_SHARED_LIBRARY) -$(call import-module,cocos2dx) -$(call import-module,audio/android) $(call import-module,scripting/lua/proj.android) -$(call import-module,extensions) -$(call import-module,cocos2dx/platform/android) From 225738ecc5c43b6dca7552f3030f21313b59ea73 Mon Sep 17 00:00:00 2001 From: James Chen Date: Wed, 16 Oct 2013 17:19:02 +0800 Subject: [PATCH 46/64] issue #2905: [iOS Mac] HelloLua and TestLua work now. --- .../project.pbxproj.REMOVED.git-id | 2 +- .../project.pbxproj.REMOVED.git-id | 2 +- cocos/scripting/lua/bindings/CCBProxy.h | 3 +++ cocos/scripting/lua/bindings/CCLuaEngine.cpp | 4 ++-- cocos/scripting/lua/bindings/CCLuaEngine.h | 10 +++++----- cocos/scripting/lua/bindings/CCLuaStack.h | 2 +- cocos/scripting/lua/bindings/CCLuaValue.h | 2 +- cocos/scripting/lua/bindings/LuaOpengl.h | 3 ++- cocos/scripting/lua/bindings/LuaScriptHandlerMgr.h | 4 ++-- cocos/scripting/lua/bindings/Lua_web_socket.cpp | 1 - cocos/scripting/lua/bindings/Lua_web_socket.h | 2 +- .../lua/bindings/lua_cocos2dx_extension_manual.cpp | 10 ++++++---- samples/Lua/HelloLua/Classes/AppDelegate.cpp | 2 +- 13 files changed, 26 insertions(+), 21 deletions(-) diff --git a/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id b/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id index 0e61b0c9e8..53dda14b9b 100644 --- a/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -c574341d56f31ced16553735ba34a697d1bbac02 \ No newline at end of file +97bf8ff69bab6a8a85dc80aca3938ca96cbfe2e5 \ No newline at end of file diff --git a/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id b/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id index cc5cbe86bf..ffe5f7bf0a 100644 --- a/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -a4c6fec549057de458346127f489e6e6bea2f0d1 \ No newline at end of file +d25068403b84374432b0ddaec0ab9c1e3a38c4ec \ No newline at end of file diff --git a/cocos/scripting/lua/bindings/CCBProxy.h b/cocos/scripting/lua/bindings/CCBProxy.h index 9759e87f1f..082bf09db1 100644 --- a/cocos/scripting/lua/bindings/CCBProxy.h +++ b/cocos/scripting/lua/bindings/CCBProxy.h @@ -5,9 +5,12 @@ #include "CCLuaEngine.h" #include "SimpleAudioEngine.h" #include "cocos-ext.h" +#include "cocosbuilder/CocosBuilder.h" USING_NS_CC; USING_NS_CC_EXT; +using namespace cocosbuilder; + class CCBProxy : public Layer{ public: diff --git a/cocos/scripting/lua/bindings/CCLuaEngine.cpp b/cocos/scripting/lua/bindings/CCLuaEngine.cpp index 21ded3f9b9..558b68acb1 100644 --- a/cocos/scripting/lua/bindings/CCLuaEngine.cpp +++ b/cocos/scripting/lua/bindings/CCLuaEngine.cpp @@ -24,10 +24,10 @@ #include "CCLuaEngine.h" #include "cocos2d.h" -#include "cocoa/CCArray.h" +#include "CCArray.h" #include "CCScheduler.h" #include "LuaScriptHandlerMgr.h" -#include "GUI/CCControlExtension/CCControl.h" +#include "extensions/GUI/CCControlExtension/CCControl.h" #include "LuaOpengl.h" #include "lua_cocos2dx_extension_manual.h" diff --git a/cocos/scripting/lua/bindings/CCLuaEngine.h b/cocos/scripting/lua/bindings/CCLuaEngine.h index 7df7f1fe02..0a1442aaaa 100644 --- a/cocos/scripting/lua/bindings/CCLuaEngine.h +++ b/cocos/scripting/lua/bindings/CCLuaEngine.h @@ -30,11 +30,11 @@ extern "C" { } #include "ccTypes.h" -#include "cocoa/CCObject.h" -#include "event_dispatcher/CCTouch.h" -#include "cocoa/CCSet.h" -#include "base_nodes/CCNode.h" -#include "script_support/CCScriptSupport.h" +#include "CCObject.h" +#include "CCTouch.h" +#include "CCSet.h" +#include "CCNode.h" +#include "CCScriptSupport.h" #include "CCLuaStack.h" #include "CCLuaValue.h" diff --git a/cocos/scripting/lua/bindings/CCLuaStack.h b/cocos/scripting/lua/bindings/CCLuaStack.h index e6bb7077c9..dc066ac745 100644 --- a/cocos/scripting/lua/bindings/CCLuaStack.h +++ b/cocos/scripting/lua/bindings/CCLuaStack.h @@ -30,7 +30,7 @@ extern "C" { } #include "ccTypes.h" -#include "cocoa/CCObject.h" +#include "CCObject.h" #include "CCLuaValue.h" NS_CC_BEGIN diff --git a/cocos/scripting/lua/bindings/CCLuaValue.h b/cocos/scripting/lua/bindings/CCLuaValue.h index b25a498519..08cdc2544f 100644 --- a/cocos/scripting/lua/bindings/CCLuaValue.h +++ b/cocos/scripting/lua/bindings/CCLuaValue.h @@ -34,7 +34,7 @@ extern "C" { } #include "ccTypes.h" -#include "cocoa/CCObject.h" +#include "CCObject.h" #if CC_TARGET_PLATFORM == CC_PLATFORM_BLACKBERRY using std::memset; diff --git a/cocos/scripting/lua/bindings/LuaOpengl.h b/cocos/scripting/lua/bindings/LuaOpengl.h index c72e000e83..d0e755a3a8 100644 --- a/cocos/scripting/lua/bindings/LuaOpengl.h +++ b/cocos/scripting/lua/bindings/LuaOpengl.h @@ -9,7 +9,8 @@ extern "C" { } #endif -#include "base_nodes/CCNode.h" +#include "CCNode.h" + class GLNode:public cocos2d::Node { virtual void draw(); diff --git a/cocos/scripting/lua/bindings/LuaScriptHandlerMgr.h b/cocos/scripting/lua/bindings/LuaScriptHandlerMgr.h index efc1110c45..44ea6fa103 100644 --- a/cocos/scripting/lua/bindings/LuaScriptHandlerMgr.h +++ b/cocos/scripting/lua/bindings/LuaScriptHandlerMgr.h @@ -7,9 +7,9 @@ extern "C" { } -#include "cocoa/CCObject.h" +#include "CCObject.h" #include "ccMacros.h" -#include "actions/CCActionInstant.h" +#include "CCActionInstant.h" #include #include diff --git a/cocos/scripting/lua/bindings/Lua_web_socket.cpp b/cocos/scripting/lua/bindings/Lua_web_socket.cpp index 27cb3ede7b..736c081344 100644 --- a/cocos/scripting/lua/bindings/Lua_web_socket.cpp +++ b/cocos/scripting/lua/bindings/Lua_web_socket.cpp @@ -19,7 +19,6 @@ extern "C" { #include "LuaScriptHandlerMgr.h" using namespace cocos2d; -using namespace cocos2d::extension; static int SendBinaryMessageToLua(int nHandler,const unsigned char* pTable,int nLength) diff --git a/cocos/scripting/lua/bindings/Lua_web_socket.h b/cocos/scripting/lua/bindings/Lua_web_socket.h index b51b84b1da..3754262deb 100644 --- a/cocos/scripting/lua/bindings/Lua_web_socket.h +++ b/cocos/scripting/lua/bindings/Lua_web_socket.h @@ -12,7 +12,7 @@ extern "C" { #endif #include "network/WebSocket.h" -class LuaWebSocket: public cocos2d::extension::WebSocket,public cocos2d::extension::WebSocket::Delegate +class LuaWebSocket: public network::WebSocket,public network::WebSocket::Delegate { public: virtual ~LuaWebSocket(); diff --git a/cocos/scripting/lua/bindings/lua_cocos2dx_extension_manual.cpp b/cocos/scripting/lua/bindings/lua_cocos2dx_extension_manual.cpp index 0df1b74a13..0e4582b126 100644 --- a/cocos/scripting/lua/bindings/lua_cocos2dx_extension_manual.cpp +++ b/cocos/scripting/lua/bindings/lua_cocos2dx_extension_manual.cpp @@ -13,9 +13,11 @@ extern "C" { #include "CCLuaValue.h" #include "cocos-ext.h" #include "CCBProxy.h" +#include "cocostudio/CocoStudio.h" USING_NS_CC; USING_NS_CC_EXT; +using namespace cocostudio; class LuaScrollViewDelegate:public Object, public ScrollViewDelegate { @@ -1334,14 +1336,14 @@ static int lua_cocos2dx_extension_Bone_setIgnoreMovementBoneData(lua_State* L) return 0; int argc = 0; - armature::Bone* self = nullptr; + cocostudio::Bone* self = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; if (!tolua_isusertype(L,1,"Bone",0,&tolua_err)) goto tolua_lerror; #endif - self = static_cast(tolua_tousertype(L,1,0)); + self = static_cast(tolua_tousertype(L,1,0)); #if COCOS2D_DEBUG >= 1 if (nullptr == self) { @@ -1379,14 +1381,14 @@ static int lua_cocos2dx_extension_Bone_getIgnoreMovementBoneData(lua_State* L) return 0; int argc = 0; - armature::Bone* self = nullptr; + cocostudio::Bone* self = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; if (!tolua_isusertype(L,1,"Bone",0,&tolua_err)) goto tolua_lerror; #endif - self = static_cast(tolua_tousertype(L,1,0)); + self = static_cast(tolua_tousertype(L,1,0)); #if COCOS2D_DEBUG >= 1 if (nullptr == self) { diff --git a/samples/Lua/HelloLua/Classes/AppDelegate.cpp b/samples/Lua/HelloLua/Classes/AppDelegate.cpp index 1e2cef387a..d693936216 100644 --- a/samples/Lua/HelloLua/Classes/AppDelegate.cpp +++ b/samples/Lua/HelloLua/Classes/AppDelegate.cpp @@ -1,7 +1,7 @@ #include "cocos2d.h" #include "AppDelegate.h" #include "SimpleAudioEngine.h" -#include "script_support/CCScriptSupport.h" +#include "CCScriptSupport.h" #include "CCLuaEngine.h" USING_NS_CC; From b5233fc18df081bf20211a573b219cc9af7db682 Mon Sep 17 00:00:00 2001 From: James Chen Date: Wed, 16 Oct 2013 17:27:30 +0800 Subject: [PATCH 47/64] issue #2905: [iOS Mac] Updating project configurations. --- build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id b/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id index 53dda14b9b..944c4d9bef 100644 --- a/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -97bf8ff69bab6a8a85dc80aca3938ca96cbfe2e5 \ No newline at end of file +81e5f8f3e9c025447f9dd4da9fba085d46f661d9 \ No newline at end of file From afe2b8e0c18c6b7e29dd563b6a14ec481bb07168 Mon Sep 17 00:00:00 2001 From: James Chen Date: Wed, 16 Oct 2013 17:37:34 +0800 Subject: [PATCH 48/64] Update auto-generated submodule manually. --- cocos/scripting/auto-generated | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/scripting/auto-generated b/cocos/scripting/auto-generated index ba1165bab0..73aebd082a 160000 --- a/cocos/scripting/auto-generated +++ b/cocos/scripting/auto-generated @@ -1 +1 @@ -Subproject commit ba1165bab00a7ba34de057b28f272f31f50a303a +Subproject commit 73aebd082ae63561cc1ca769f28e302820da7e39 From 5ffe904a1b7be914b155366db7a70efbb7a1546a Mon Sep 17 00:00:00 2001 From: James Chen Date: Wed, 16 Oct 2013 22:54:55 +0800 Subject: [PATCH 49/64] issue #2905: [iOS Mac] Updating template. --- .../HelloCpp.xcodeproj/project.pbxproj | 500 +++++++------ .../HelloJavascript.xcodeproj/project.pbxproj | 666 ++++++++++-------- 2 files changed, 608 insertions(+), 558 deletions(-) diff --git a/template/multi-platform-cpp/proj.ios_mac/HelloCpp.xcodeproj/project.pbxproj b/template/multi-platform-cpp/proj.ios_mac/HelloCpp.xcodeproj/project.pbxproj index 3f7b3750a3..fdf23b3796 100644 --- a/template/multi-platform-cpp/proj.ios_mac/HelloCpp.xcodeproj/project.pbxproj +++ b/template/multi-platform-cpp/proj.ios_mac/HelloCpp.xcodeproj/project.pbxproj @@ -7,12 +7,16 @@ objects = { /* Begin PBXBuildFile section */ - 1ACB3244164770DE00914215 /* libcurl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1ACB3243164770DE00914215 /* libcurl.a */; }; - 1AF4C2F417865DCB00122817 /* libbox2d iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C2E317865D9500122817 /* libbox2d iOS.a */; }; - 1AF4C2F517865DCB00122817 /* libchipmunk iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C2E117865D9500122817 /* libchipmunk iOS.a */; }; - 1AF4C2F617865DCB00122817 /* libcocos2dx iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C2DD17865D9500122817 /* libcocos2dx iOS.a */; }; - 1AF4C2F717865DCB00122817 /* libcocos2dx-extensions iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C2DF17865D9500122817 /* libcocos2dx-extensions iOS.a */; }; - 1AF4C2F817865DCB00122817 /* libCocosDenshion iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C2E517865D9500122817 /* libCocosDenshion iOS.a */; }; + 1AC6FB1F180E996B004C840B /* libbox2d Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AC6FAFF180E9839004C840B /* libbox2d Mac.a */; }; + 1AC6FB20180E996B004C840B /* libchipmunk Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AC6FAFD180E9839004C840B /* libchipmunk Mac.a */; }; + 1AC6FB21180E996B004C840B /* libcocos2dx Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AC6FAF9180E9839004C840B /* libcocos2dx Mac.a */; }; + 1AC6FB22180E996B004C840B /* libcocos2dx-extensions Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AC6FAFB180E9839004C840B /* libcocos2dx-extensions Mac.a */; }; + 1AC6FB23180E996B004C840B /* libCocosDenshion Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AC6FB01180E9839004C840B /* libCocosDenshion Mac.a */; }; + 1AC6FB2E180E99EB004C840B /* libbox2d iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AC6FB0D180E9839004C840B /* libbox2d iOS.a */; }; + 1AC6FB2F180E99EB004C840B /* libchipmunk iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AC6FB0B180E9839004C840B /* libchipmunk iOS.a */; }; + 1AC6FB30180E99EB004C840B /* libcocos2dx iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AC6FB07180E9839004C840B /* libcocos2dx iOS.a */; }; + 1AC6FB31180E99EB004C840B /* libcocos2dx-extensions iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AC6FB09180E9839004C840B /* libcocos2dx-extensions iOS.a */; }; + 1AC6FB32180E99EB004C840B /* libCocosDenshion iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AC6FB0F180E9839004C840B /* libCocosDenshion iOS.a */; }; 1AFAF8B716D35DE700DB1158 /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AFAF8B316D35DE700DB1158 /* AppDelegate.cpp */; }; 1AFAF8B816D35DE700DB1158 /* HelloWorldScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AFAF8B516D35DE700DB1158 /* HelloWorldScene.cpp */; }; 1AFAF8BC16D35E4900DB1158 /* CloseNormal.png in Resources */ = {isa = PBXBuildFile; fileRef = 1AFAF8B916D35E4900DB1158 /* CloseNormal.png */; }; @@ -27,11 +31,6 @@ 503AE10217EB989F00D1A890 /* RootViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 503AE0FF17EB989F00D1A890 /* RootViewController.mm */; }; 503AE10517EB98FF00D1A890 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 503AE10317EB98FF00D1A890 /* main.cpp */; }; 503AE11217EB99EE00D1A890 /* libcurl.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 503AE11117EB99EE00D1A890 /* libcurl.dylib */; }; - 503AE11317EB9C0700D1A890 /* libbox2d Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C2D517865D9500122817 /* libbox2d Mac.a */; }; - 503AE11417EB9C0700D1A890 /* libchipmunk Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C2D317865D9500122817 /* libchipmunk Mac.a */; }; - 503AE11517EB9C0700D1A890 /* libcocos2dx Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C2CF17865D9500122817 /* libcocos2dx Mac.a */; }; - 503AE11617EB9C0700D1A890 /* libcocos2dx-extensions Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C2D117865D9500122817 /* libcocos2dx-extensions Mac.a */; }; - 503AE11717EB9C0700D1A890 /* libCocosDenshion Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C2D717865D9500122817 /* libCocosDenshion Mac.a */; }; 503AE11B17EB9C5A00D1A890 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 503AE11A17EB9C5A00D1A890 /* IOKit.framework */; }; 5087E75317EB910900C73F5D /* CloseNormal.png in Resources */ = {isa = PBXBuildFile; fileRef = 1AFAF8B916D35E4900DB1158 /* CloseNormal.png */; }; 5087E75417EB910900C73F5D /* CloseSelected.png in Resources */ = {isa = PBXBuildFile; fileRef = 1AFAF8BA16D35E4900DB1158 /* CloseSelected.png */; }; @@ -73,179 +72,179 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 1AF4C2CE17865D9500122817 /* PBXContainerItemProxy */ = { + 1AC6FAF8180E9839004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2BB17865D9500122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = 1551A33F158F2AB200E66CFE; remoteInfo = "cocos2dx Mac"; }; - 1AF4C2D017865D9500122817 /* PBXContainerItemProxy */ = { + 1AC6FAFA180E9839004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2BB17865D9500122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = A03F2FD617814595006731B9; remoteInfo = "cocos2dx-extensions Mac"; }; - 1AF4C2D217865D9500122817 /* PBXContainerItemProxy */ = { + 1AC6FAFC180E9839004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2BB17865D9500122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = A03F2CB81780BD04006731B9; remoteInfo = "chipmunk Mac"; }; - 1AF4C2D417865D9500122817 /* PBXContainerItemProxy */ = { + 1AC6FAFE180E9839004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2BB17865D9500122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = A03F2D9B1780BDF7006731B9; remoteInfo = "box2d Mac"; }; - 1AF4C2D617865D9500122817 /* PBXContainerItemProxy */ = { + 1AC6FB00180E9839004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2BB17865D9500122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = A03F2ED617814268006731B9; remoteInfo = "CocosDenshion Mac"; }; - 1AF4C2D817865D9500122817 /* PBXContainerItemProxy */ = { + 1AC6FB02180E9839004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2BB17865D9500122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = A03F31FD1781479B006731B9; remoteInfo = "jsbindings Mac"; }; - 1AF4C2DA17865D9500122817 /* PBXContainerItemProxy */ = { + 1AC6FB04180E9839004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2BB17865D9500122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = 1A6FB53017854BC300CDF010; remoteInfo = "luabindings Mac"; }; - 1AF4C2DC17865D9500122817 /* PBXContainerItemProxy */ = { + 1AC6FB06180E9839004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2BB17865D9500122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = A07A4D641783777C0073F6A7; remoteInfo = "cocos2dx iOS"; }; - 1AF4C2DE17865D9500122817 /* PBXContainerItemProxy */ = { + 1AC6FB08180E9839004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2BB17865D9500122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = A07A4EFC1783867C0073F6A7; remoteInfo = "cocos2dx-extensions iOS"; }; - 1AF4C2E017865D9500122817 /* PBXContainerItemProxy */ = { + 1AC6FB0A180E9839004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2BB17865D9500122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = A07A4F3B178387670073F6A7; remoteInfo = "chipmunk iOS"; }; - 1AF4C2E217865D9500122817 /* PBXContainerItemProxy */ = { + 1AC6FB0C180E9839004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2BB17865D9500122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = A07A4F9E1783876B0073F6A7; remoteInfo = "box2d iOS"; }; - 1AF4C2E417865D9500122817 /* PBXContainerItemProxy */ = { + 1AC6FB0E180E9839004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2BB17865D9500122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = A07A4FB4178387730073F6A7; remoteInfo = "CocosDenshion iOS"; }; - 1AF4C2E617865D9500122817 /* PBXContainerItemProxy */ = { + 1AC6FB10180E9839004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2BB17865D9500122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = A07A5030178387750073F6A7; remoteInfo = "jsbindings iOS"; }; - 1AF4C2E817865D9500122817 /* PBXContainerItemProxy */ = { + 1AC6FB12180E9839004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2BB17865D9500122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = 1A119791178526AA00D62A44; remoteInfo = "luabindings iOS"; }; - 1AF4C2EA17865DB400122817 /* PBXContainerItemProxy */ = { + 1AC6FB15180E9959004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2BB17865D9500122817 /* cocos2d_libs.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = A07A4C241783777C0073F6A7; - remoteInfo = "cocos2dx iOS"; - }; - 1AF4C2EC17865DB400122817 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 1AF4C2BB17865D9500122817 /* cocos2d_libs.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = A07A4E111783867C0073F6A7; - remoteInfo = "cocos2dx-extensions iOS"; - }; - 1AF4C2EE17865DB400122817 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 1AF4C2BB17865D9500122817 /* cocos2d_libs.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = A07A4EFD178387670073F6A7; - remoteInfo = "chipmunk iOS"; - }; - 1AF4C2F017865DB400122817 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 1AF4C2BB17865D9500122817 /* cocos2d_libs.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = A07A4F3C1783876B0073F6A7; - remoteInfo = "box2d iOS"; - }; - 1AF4C2F217865DB400122817 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 1AF4C2BB17865D9500122817 /* cocos2d_libs.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = A07A4F9F178387730073F6A7; - remoteInfo = "CocosDenshion iOS"; - }; - 503AE10717EB99BC00D1A890 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 1AF4C2BB17865D9500122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; proxyType = 1; remoteGlobalIDString = 1551A33E158F2AB200E66CFE; remoteInfo = "cocos2dx Mac"; }; - 503AE10917EB99BC00D1A890 /* PBXContainerItemProxy */ = { + 1AC6FB17180E9959004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2BB17865D9500122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; proxyType = 1; remoteGlobalIDString = A03F2FC117814595006731B9; remoteInfo = "cocos2dx-extensions Mac"; }; - 503AE10B17EB99BC00D1A890 /* PBXContainerItemProxy */ = { + 1AC6FB19180E9959004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2BB17865D9500122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; proxyType = 1; remoteGlobalIDString = A03F2B781780BD04006731B9; remoteInfo = "chipmunk Mac"; }; - 503AE10D17EB99BC00D1A890 /* PBXContainerItemProxy */ = { + 1AC6FB1B180E9959004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2BB17865D9500122817 /* cocos2d_libs.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = A03F2D5D1780BDF7006731B9; - remoteInfo = "box2d Mac"; - }; - 503AE10F17EB99BC00D1A890 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 1AF4C2BB17865D9500122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; proxyType = 1; remoteGlobalIDString = A03F2E9817814268006731B9; remoteInfo = "CocosDenshion Mac"; }; + 1AC6FB1D180E9963004C840B /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A03F2D5D1780BDF7006731B9; + remoteInfo = "box2d Mac"; + }; + 1AC6FB24180E99E1004C840B /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A07A4C241783777C0073F6A7; + remoteInfo = "cocos2dx iOS"; + }; + 1AC6FB26180E99E1004C840B /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A07A4E111783867C0073F6A7; + remoteInfo = "cocos2dx-extensions iOS"; + }; + 1AC6FB28180E99E1004C840B /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A07A4EFD178387670073F6A7; + remoteInfo = "chipmunk iOS"; + }; + 1AC6FB2A180E99E1004C840B /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A07A4F3C1783876B0073F6A7; + remoteInfo = "box2d iOS"; + }; + 1AC6FB2C180E99E1004C840B /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A07A4F9F178387730073F6A7; + remoteInfo = "CocosDenshion iOS"; + }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = cocos2d_libs.xcodeproj; path = ../../../build/cocos2d_libs.xcodeproj; sourceTree = ""; }; 1ACB3243164770DE00914215 /* libcurl.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcurl.a; path = ../../cocos2dx/platform/third_party/ios/libraries/libcurl.a; sourceTree = ""; }; - 1AF4C2BB17865D9500122817 /* cocos2d_libs.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = cocos2d_libs.xcodeproj; path = ../../../cocos2d_libs.xcodeproj; sourceTree = ""; }; 1AFAF8B316D35DE700DB1158 /* AppDelegate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AppDelegate.cpp; path = ../Classes/AppDelegate.cpp; sourceTree = ""; }; 1AFAF8B416D35DE700DB1158 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = ../Classes/AppDelegate.h; sourceTree = ""; }; 1AFAF8B516D35DE700DB1158 /* HelloWorldScene.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = HelloWorldScene.cpp; path = ../Classes/HelloWorldScene.cpp; sourceTree = ""; }; @@ -303,13 +302,12 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 1AC6FB2E180E99EB004C840B /* libbox2d iOS.a in Frameworks */, + 1AC6FB2F180E99EB004C840B /* libchipmunk iOS.a in Frameworks */, + 1AC6FB30180E99EB004C840B /* libcocos2dx iOS.a in Frameworks */, + 1AC6FB31180E99EB004C840B /* libcocos2dx-extensions iOS.a in Frameworks */, + 1AC6FB32180E99EB004C840B /* libCocosDenshion iOS.a in Frameworks */, D6B0611B1803AB670077942B /* CoreMotion.framework in Frameworks */, - 1AF4C2F417865DCB00122817 /* libbox2d iOS.a in Frameworks */, - 1AF4C2F517865DCB00122817 /* libchipmunk iOS.a in Frameworks */, - 1AF4C2F617865DCB00122817 /* libcocos2dx iOS.a in Frameworks */, - 1AF4C2F717865DCB00122817 /* libcocos2dx-extensions iOS.a in Frameworks */, - 1AF4C2F817865DCB00122817 /* libCocosDenshion iOS.a in Frameworks */, - 1ACB3244164770DE00914215 /* libcurl.a in Frameworks */, 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */, 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */, 288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */, @@ -326,11 +324,11 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 503AE11317EB9C0700D1A890 /* libbox2d Mac.a in Frameworks */, - 503AE11417EB9C0700D1A890 /* libchipmunk Mac.a in Frameworks */, - 503AE11517EB9C0700D1A890 /* libcocos2dx Mac.a in Frameworks */, - 503AE11617EB9C0700D1A890 /* libcocos2dx-extensions Mac.a in Frameworks */, - 503AE11717EB9C0700D1A890 /* libCocosDenshion Mac.a in Frameworks */, + 1AC6FB1F180E996B004C840B /* libbox2d Mac.a in Frameworks */, + 1AC6FB20180E996B004C840B /* libchipmunk Mac.a in Frameworks */, + 1AC6FB21180E996B004C840B /* libcocos2dx Mac.a in Frameworks */, + 1AC6FB22180E996B004C840B /* libcocos2dx-extensions Mac.a in Frameworks */, + 1AC6FB23180E996B004C840B /* libCocosDenshion Mac.a in Frameworks */, 503AE11217EB99EE00D1A890 /* libcurl.dylib in Frameworks */, 5087E76717EB910900C73F5D /* libz.dylib in Frameworks */, 503AE11B17EB9C5A00D1A890 /* IOKit.framework in Frameworks */, @@ -384,23 +382,23 @@ name = Products; sourceTree = ""; }; - 1AF4C2BC17865D9500122817 /* Products */ = { + 1AC6FAE6180E9839004C840B /* Products */ = { isa = PBXGroup; children = ( - 1AF4C2CF17865D9500122817 /* libcocos2dx Mac.a */, - 1AF4C2D117865D9500122817 /* libcocos2dx-extensions Mac.a */, - 1AF4C2D317865D9500122817 /* libchipmunk Mac.a */, - 1AF4C2D517865D9500122817 /* libbox2d Mac.a */, - 1AF4C2D717865D9500122817 /* libCocosDenshion Mac.a */, - 1AF4C2D917865D9500122817 /* libjsbindings Mac.a */, - 1AF4C2DB17865D9500122817 /* libluabindings Mac.a */, - 1AF4C2DD17865D9500122817 /* libcocos2dx iOS.a */, - 1AF4C2DF17865D9500122817 /* libcocos2dx-extensions iOS.a */, - 1AF4C2E117865D9500122817 /* libchipmunk iOS.a */, - 1AF4C2E317865D9500122817 /* libbox2d iOS.a */, - 1AF4C2E517865D9500122817 /* libCocosDenshion iOS.a */, - 1AF4C2E717865D9500122817 /* libjsbindings iOS.a */, - 1AF4C2E917865D9500122817 /* libluabindings iOS.a */, + 1AC6FAF9180E9839004C840B /* libcocos2dx Mac.a */, + 1AC6FAFB180E9839004C840B /* libcocos2dx-extensions Mac.a */, + 1AC6FAFD180E9839004C840B /* libchipmunk Mac.a */, + 1AC6FAFF180E9839004C840B /* libbox2d Mac.a */, + 1AC6FB01180E9839004C840B /* libCocosDenshion Mac.a */, + 1AC6FB03180E9839004C840B /* libjsbindings Mac.a */, + 1AC6FB05180E9839004C840B /* libluabindings Mac.a */, + 1AC6FB07180E9839004C840B /* libcocos2dx iOS.a */, + 1AC6FB09180E9839004C840B /* libcocos2dx-extensions iOS.a */, + 1AC6FB0B180E9839004C840B /* libchipmunk iOS.a */, + 1AC6FB0D180E9839004C840B /* libbox2d iOS.a */, + 1AC6FB0F180E9839004C840B /* libCocosDenshion iOS.a */, + 1AC6FB11180E9839004C840B /* libjsbindings iOS.a */, + 1AC6FB13180E9839004C840B /* libluabindings iOS.a */, ); name = Products; sourceTree = ""; @@ -408,7 +406,7 @@ 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { isa = PBXGroup; children = ( - 1AF4C2BB17865D9500122817 /* cocos2d_libs.xcodeproj */, + 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */, 15AA9C4015B7EC450033D6C2 /* Classes */, 29B97323FDCFA39411CA2CEA /* Frameworks */, 080E96DDFE201D6D7F000001 /* ios */, @@ -511,11 +509,11 @@ buildRules = ( ); dependencies = ( - 1AF4C2EB17865DB400122817 /* PBXTargetDependency */, - 1AF4C2ED17865DB400122817 /* PBXTargetDependency */, - 1AF4C2EF17865DB400122817 /* PBXTargetDependency */, - 1AF4C2F117865DB400122817 /* PBXTargetDependency */, - 1AF4C2F317865DB400122817 /* PBXTargetDependency */, + 1AC6FB25180E99E1004C840B /* PBXTargetDependency */, + 1AC6FB27180E99E1004C840B /* PBXTargetDependency */, + 1AC6FB29180E99E1004C840B /* PBXTargetDependency */, + 1AC6FB2B180E99E1004C840B /* PBXTargetDependency */, + 1AC6FB2D180E99E1004C840B /* PBXTargetDependency */, ); name = "HelloCpp iOS"; productName = iphone; @@ -533,11 +531,11 @@ buildRules = ( ); dependencies = ( - 503AE10817EB99BC00D1A890 /* PBXTargetDependency */, - 503AE10A17EB99BC00D1A890 /* PBXTargetDependency */, - 503AE10C17EB99BC00D1A890 /* PBXTargetDependency */, - 503AE10E17EB99BC00D1A890 /* PBXTargetDependency */, - 503AE11017EB99BC00D1A890 /* PBXTargetDependency */, + 1AC6FB1E180E9963004C840B /* PBXTargetDependency */, + 1AC6FB16180E9959004C840B /* PBXTargetDependency */, + 1AC6FB18180E9959004C840B /* PBXTargetDependency */, + 1AC6FB1A180E9959004C840B /* PBXTargetDependency */, + 1AC6FB1C180E9959004C840B /* PBXTargetDependency */, ); name = "HelloCpp Mac"; productName = iphone; @@ -571,8 +569,8 @@ projectDirPath = ""; projectReferences = ( { - ProductGroup = 1AF4C2BC17865D9500122817 /* Products */; - ProjectRef = 1AF4C2BB17865D9500122817 /* cocos2d_libs.xcodeproj */; + ProductGroup = 1AC6FAE6180E9839004C840B /* Products */; + ProjectRef = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; }, ); projectRoot = ""; @@ -584,102 +582,102 @@ /* End PBXProject section */ /* Begin PBXReferenceProxy section */ - 1AF4C2CF17865D9500122817 /* libcocos2dx Mac.a */ = { + 1AC6FAF9180E9839004C840B /* libcocos2dx Mac.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libcocos2dx Mac.a"; - remoteRef = 1AF4C2CE17865D9500122817 /* PBXContainerItemProxy */; + remoteRef = 1AC6FAF8180E9839004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C2D117865D9500122817 /* libcocos2dx-extensions Mac.a */ = { + 1AC6FAFB180E9839004C840B /* libcocos2dx-extensions Mac.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libcocos2dx-extensions Mac.a"; - remoteRef = 1AF4C2D017865D9500122817 /* PBXContainerItemProxy */; + remoteRef = 1AC6FAFA180E9839004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C2D317865D9500122817 /* libchipmunk Mac.a */ = { + 1AC6FAFD180E9839004C840B /* libchipmunk Mac.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libchipmunk Mac.a"; - remoteRef = 1AF4C2D217865D9500122817 /* PBXContainerItemProxy */; + remoteRef = 1AC6FAFC180E9839004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C2D517865D9500122817 /* libbox2d Mac.a */ = { + 1AC6FAFF180E9839004C840B /* libbox2d Mac.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libbox2d Mac.a"; - remoteRef = 1AF4C2D417865D9500122817 /* PBXContainerItemProxy */; + remoteRef = 1AC6FAFE180E9839004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C2D717865D9500122817 /* libCocosDenshion Mac.a */ = { + 1AC6FB01180E9839004C840B /* libCocosDenshion Mac.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libCocosDenshion Mac.a"; - remoteRef = 1AF4C2D617865D9500122817 /* PBXContainerItemProxy */; + remoteRef = 1AC6FB00180E9839004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C2D917865D9500122817 /* libjsbindings Mac.a */ = { + 1AC6FB03180E9839004C840B /* libjsbindings Mac.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libjsbindings Mac.a"; - remoteRef = 1AF4C2D817865D9500122817 /* PBXContainerItemProxy */; + remoteRef = 1AC6FB02180E9839004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C2DB17865D9500122817 /* libluabindings Mac.a */ = { + 1AC6FB05180E9839004C840B /* libluabindings Mac.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libluabindings Mac.a"; - remoteRef = 1AF4C2DA17865D9500122817 /* PBXContainerItemProxy */; + remoteRef = 1AC6FB04180E9839004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C2DD17865D9500122817 /* libcocos2dx iOS.a */ = { + 1AC6FB07180E9839004C840B /* libcocos2dx iOS.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libcocos2dx iOS.a"; - remoteRef = 1AF4C2DC17865D9500122817 /* PBXContainerItemProxy */; + remoteRef = 1AC6FB06180E9839004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C2DF17865D9500122817 /* libcocos2dx-extensions iOS.a */ = { + 1AC6FB09180E9839004C840B /* libcocos2dx-extensions iOS.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libcocos2dx-extensions iOS.a"; - remoteRef = 1AF4C2DE17865D9500122817 /* PBXContainerItemProxy */; + remoteRef = 1AC6FB08180E9839004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C2E117865D9500122817 /* libchipmunk iOS.a */ = { + 1AC6FB0B180E9839004C840B /* libchipmunk iOS.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libchipmunk iOS.a"; - remoteRef = 1AF4C2E017865D9500122817 /* PBXContainerItemProxy */; + remoteRef = 1AC6FB0A180E9839004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C2E317865D9500122817 /* libbox2d iOS.a */ = { + 1AC6FB0D180E9839004C840B /* libbox2d iOS.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libbox2d iOS.a"; - remoteRef = 1AF4C2E217865D9500122817 /* PBXContainerItemProxy */; + remoteRef = 1AC6FB0C180E9839004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C2E517865D9500122817 /* libCocosDenshion iOS.a */ = { + 1AC6FB0F180E9839004C840B /* libCocosDenshion iOS.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libCocosDenshion iOS.a"; - remoteRef = 1AF4C2E417865D9500122817 /* PBXContainerItemProxy */; + remoteRef = 1AC6FB0E180E9839004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C2E717865D9500122817 /* libjsbindings iOS.a */ = { + 1AC6FB11180E9839004C840B /* libjsbindings iOS.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libjsbindings iOS.a"; - remoteRef = 1AF4C2E617865D9500122817 /* PBXContainerItemProxy */; + remoteRef = 1AC6FB10180E9839004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C2E917865D9500122817 /* libluabindings iOS.a */ = { + 1AC6FB13180E9839004C840B /* libluabindings iOS.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libluabindings iOS.a"; - remoteRef = 1AF4C2E817865D9500122817 /* PBXContainerItemProxy */; + remoteRef = 1AC6FB12180E9839004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXReferenceProxy section */ @@ -750,55 +748,55 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ - 1AF4C2EB17865DB400122817 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = "cocos2dx iOS"; - targetProxy = 1AF4C2EA17865DB400122817 /* PBXContainerItemProxy */; - }; - 1AF4C2ED17865DB400122817 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = "cocos2dx-extensions iOS"; - targetProxy = 1AF4C2EC17865DB400122817 /* PBXContainerItemProxy */; - }; - 1AF4C2EF17865DB400122817 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = "chipmunk iOS"; - targetProxy = 1AF4C2EE17865DB400122817 /* PBXContainerItemProxy */; - }; - 1AF4C2F117865DB400122817 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = "box2d iOS"; - targetProxy = 1AF4C2F017865DB400122817 /* PBXContainerItemProxy */; - }; - 1AF4C2F317865DB400122817 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = "CocosDenshion iOS"; - targetProxy = 1AF4C2F217865DB400122817 /* PBXContainerItemProxy */; - }; - 503AE10817EB99BC00D1A890 /* PBXTargetDependency */ = { + 1AC6FB16180E9959004C840B /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = "cocos2dx Mac"; - targetProxy = 503AE10717EB99BC00D1A890 /* PBXContainerItemProxy */; + targetProxy = 1AC6FB15180E9959004C840B /* PBXContainerItemProxy */; }; - 503AE10A17EB99BC00D1A890 /* PBXTargetDependency */ = { + 1AC6FB18180E9959004C840B /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = "cocos2dx-extensions Mac"; - targetProxy = 503AE10917EB99BC00D1A890 /* PBXContainerItemProxy */; + targetProxy = 1AC6FB17180E9959004C840B /* PBXContainerItemProxy */; }; - 503AE10C17EB99BC00D1A890 /* PBXTargetDependency */ = { + 1AC6FB1A180E9959004C840B /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = "chipmunk Mac"; - targetProxy = 503AE10B17EB99BC00D1A890 /* PBXContainerItemProxy */; + targetProxy = 1AC6FB19180E9959004C840B /* PBXContainerItemProxy */; }; - 503AE10E17EB99BC00D1A890 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = "box2d Mac"; - targetProxy = 503AE10D17EB99BC00D1A890 /* PBXContainerItemProxy */; - }; - 503AE11017EB99BC00D1A890 /* PBXTargetDependency */ = { + 1AC6FB1C180E9959004C840B /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = "CocosDenshion Mac"; - targetProxy = 503AE10F17EB99BC00D1A890 /* PBXContainerItemProxy */; + targetProxy = 1AC6FB1B180E9959004C840B /* PBXContainerItemProxy */; + }; + 1AC6FB1E180E9963004C840B /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "box2d Mac"; + targetProxy = 1AC6FB1D180E9963004C840B /* PBXContainerItemProxy */; + }; + 1AC6FB25180E99E1004C840B /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "cocos2dx iOS"; + targetProxy = 1AC6FB24180E99E1004C840B /* PBXContainerItemProxy */; + }; + 1AC6FB27180E99E1004C840B /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "cocos2dx-extensions iOS"; + targetProxy = 1AC6FB26180E99E1004C840B /* PBXContainerItemProxy */; + }; + 1AC6FB29180E99E1004C840B /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "chipmunk iOS"; + targetProxy = 1AC6FB28180E99E1004C840B /* PBXContainerItemProxy */; + }; + 1AC6FB2B180E99E1004C840B /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "box2d iOS"; + targetProxy = 1AC6FB2A180E99E1004C840B /* PBXContainerItemProxy */; + }; + 1AC6FB2D180E99E1004C840B /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "CocosDenshion iOS"; + targetProxy = 1AC6FB2C180E99E1004C840B /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ @@ -806,7 +804,7 @@ 1D6058940D05DD3E006BFB54 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; + ALWAYS_SEARCH_USER_PATHS = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; COMPRESS_PNG_FILES = NO; GCC_DYNAMIC_NO_PIC = NO; @@ -821,24 +819,13 @@ ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; HEADER_SEARCH_PATHS = ( - "$(SRCROOT)/../../../audio/include", - "\"$(SRCROOT)/../../../external/chipmunk/include/constraints\"", - "\"$(SRCROOT)/../../../external/chipmunk/include/chipmunk\"", - "\"$(SRCROOT)/../../../extensions\"", - "\"$(SRCROOT)/../../../cocos2dx/kazmath/include\"", - "\"$(SRCROOT)/../../../external\"", - "\"$(SRCROOT)/../../../cocos2dx\"", - "\"$(SRCROOT)/../../../cocos2dx/include\"", - "\"$(SRCROOT)/../../../cocos2dx/platform/third_party/ios\"", - "\"$(SRCROOT)/../../../cocos2dx/platform/ios\"", - "\"$(SRCROOT)/../../../cocos2dx/platform/ios/Simulation\"", + "$(inherited)", + "$(SRCROOT)/../../../cocos/2d/platform/ios", + "$(SRCROOT)/../../../cocos/2d/platform/ios/Simulation", ); INFOPLIST_FILE = ios/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 5.0; - LIBRARY_SEARCH_PATHS = ( - "\"$(SRCROOT)/../../../cocos2dx/platform/third_party/ios/libraries\"", - "\"$(SRCROOT)/../../../external/libwebsockets/ios/lib\"", - ); + LIBRARY_SEARCH_PATHS = ""; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; USER_HEADER_SEARCH_PATHS = ""; @@ -848,7 +835,7 @@ 1D6058950D05DD3E006BFB54 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; + ALWAYS_SEARCH_USER_PATHS = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; COMPRESS_PNG_FILES = NO; GCC_INLINES_ARE_PRIVATE_EXTERN = NO; @@ -861,24 +848,13 @@ ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; HEADER_SEARCH_PATHS = ( - "$(SRCROOT)/../../../audio/include", - "\"$(SRCROOT)/../../../external/chipmunk/include/constraints\"", - "\"$(SRCROOT)/../../../external/chipmunk/include/chipmunk\"", - "\"$(SRCROOT)/../../../extensions\"", - "\"$(SRCROOT)/../../../cocos2dx/kazmath/include\"", - "\"$(SRCROOT)/../../../external\"", - "\"$(SRCROOT)/../../../cocos2dx\"", - "\"$(SRCROOT)/../../../cocos2dx/include\"", - "\"$(SRCROOT)/../../../cocos2dx/platform/third_party/ios\"", - "\"$(SRCROOT)/../../../cocos2dx/platform/ios\"", - "\"$(SRCROOT)/../../../cocos2dx/platform/ios/Simulation\"", + "$(inherited)", + "$(SRCROOT)/../../../cocos/2d/platform/ios", + "$(SRCROOT)/../../../cocos/2d/platform/ios/Simulation", ); INFOPLIST_FILE = ios/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 5.0; - LIBRARY_SEARCH_PATHS = ( - "\"$(SRCROOT)/../../../cocos2dx/platform/third_party/ios/libraries\"", - "\"$(SRCROOT)/../../../external/libwebsockets/ios/lib\"", - ); + LIBRARY_SEARCH_PATHS = ""; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; USER_HEADER_SEARCH_PATHS = ""; @@ -888,7 +864,7 @@ 5087E76D17EB910900C73F5D /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; + ALWAYS_SEARCH_USER_PATHS = YES; ARCHS = "$(ARCHS_STANDARD_64_BIT)"; CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -904,22 +880,12 @@ ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; HEADER_SEARCH_PATHS = ( - "$(SRCROOT)/../../../CocosDenshion/include", - "\"$(SRCROOT)/../../../external/chipmunk/include/constraints\"", - "\"$(SRCROOT)/../../../external/chipmunk/include/chipmunk\"", - "\"$(SRCROOT)/../../../extensions\"", - "\"$(SRCROOT)/../../../cocos2dx/kazmath/include\"", - "\"$(SRCROOT)/../../../external\"", - "\"$(SRCROOT)/../../../cocos2dx\"", - "\"$(SRCROOT)/../../../cocos2dx/include\"", - "\"$(SRCROOT)/../../../cocos2dx/platform/third_party/mac\"", - "\"$(SRCROOT)/../../../cocos2dx/platform/mac\"", + "$(inherited)", + "$(SRCROOT)/../../../cocos/2d/platform/mac", + "$(SRCROOT)/../../../external/glfw3/include/mac", ); INFOPLIST_FILE = mac/Info.plist; - LIBRARY_SEARCH_PATHS = ( - "\"$(SRCROOT)/../../../cocos2dx/platform/third_party/mac/libraries\"", - "\"$(SRCROOT)/../../../external/libwebsockets/mac/lib\"", - ); + LIBRARY_SEARCH_PATHS = ""; USER_HEADER_SEARCH_PATHS = ""; }; name = Debug; @@ -927,7 +893,7 @@ 5087E76E17EB910900C73F5D /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; + ALWAYS_SEARCH_USER_PATHS = YES; ARCHS = "$(ARCHS_STANDARD_64_BIT)"; CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -941,22 +907,12 @@ ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; HEADER_SEARCH_PATHS = ( - "$(SRCROOT)/../../../CocosDenshion/include", - "\"$(SRCROOT)/../../../external/chipmunk/include/constraints\"", - "\"$(SRCROOT)/../../../external/chipmunk/include/chipmunk\"", - "\"$(SRCROOT)/../../../extensions\"", - "\"$(SRCROOT)/../../../cocos2dx/kazmath/include\"", - "\"$(SRCROOT)/../../../external\"", - "\"$(SRCROOT)/../../../cocos2dx\"", - "\"$(SRCROOT)/../../../cocos2dx/include\"", - "\"$(SRCROOT)/../../../cocos2dx/platform/third_party/mac\"", - "\"$(SRCROOT)/../../../cocos2dx/platform/mac\"", + "$(inherited)", + "$(SRCROOT)/../../../cocos/2d/platform/mac", + "$(SRCROOT)/../../../external/glfw3/include/mac", ); INFOPLIST_FILE = mac/Info.plist; - LIBRARY_SEARCH_PATHS = ( - "\"$(SRCROOT)/../../../cocos2dx/platform/third_party/mac/libraries\"", - "\"$(SRCROOT)/../../../external/libwebsockets/mac/lib\"", - ); + LIBRARY_SEARCH_PATHS = ""; USER_HEADER_SEARCH_PATHS = ""; }; name = Release; @@ -970,6 +926,21 @@ GCC_OPTIMIZATION_LEVEL = 0; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(SRCROOT)/../../..", + "$(SRCROOT)/../../../cocos", + "$(SRCROOT)/../../../cocos/base", + "$(SRCROOT)/../../../cocos/physics", + "$(SRCROOT)/../../../cocos/math/kazmath/include", + "$(SRCROOT)/../../../cocos/2d", + "$(SRCROOT)/../../../cocos/gui", + "$(SRCROOT)/../../../cocos/network", + "$(SRCROOT)/../../../cocos/audio/include", + "$(SRCROOT)/../../../cocos/editor-support", + "$(SRCROOT)/../../../extensions", + "$(SRCROOT)/../../../external", + "$(SRCROOT)/../../../external/chipmunk/include/chipmunk", + ); ONLY_ACTIVE_ARCH = YES; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; @@ -983,6 +954,21 @@ CLANG_CXX_LIBRARY = "libc++"; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(SRCROOT)/../../..", + "$(SRCROOT)/../../../cocos", + "$(SRCROOT)/../../../cocos/base", + "$(SRCROOT)/../../../cocos/physics", + "$(SRCROOT)/../../../cocos/math/kazmath/include", + "$(SRCROOT)/../../../cocos/2d", + "$(SRCROOT)/../../../cocos/gui", + "$(SRCROOT)/../../../cocos/network", + "$(SRCROOT)/../../../cocos/audio/include", + "$(SRCROOT)/../../../cocos/editor-support", + "$(SRCROOT)/../../../extensions", + "$(SRCROOT)/../../../external", + "$(SRCROOT)/../../../external/chipmunk/include/chipmunk", + ); OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; diff --git a/template/multi-platform-js/proj.ios_mac/HelloJavascript.xcodeproj/project.pbxproj b/template/multi-platform-js/proj.ios_mac/HelloJavascript.xcodeproj/project.pbxproj index dbc340d66f..82228bc55f 100644 --- a/template/multi-platform-js/proj.ios_mac/HelloJavascript.xcodeproj/project.pbxproj +++ b/template/multi-platform-js/proj.ios_mac/HelloJavascript.xcodeproj/project.pbxproj @@ -7,35 +7,47 @@ objects = { /* Begin PBXBuildFile section */ + 1A6767FA180E9B160076BC67 /* debugger in Resources */ = {isa = PBXBuildFile; fileRef = 1A6767ED180E9B160076BC67 /* debugger */; }; + 1A6767FB180E9B160076BC67 /* debugger in Resources */ = {isa = PBXBuildFile; fileRef = 1A6767ED180E9B160076BC67 /* debugger */; }; + 1A676829180E9C060076BC67 /* libchipmunk Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AC6FB4C180E9ACB004C840B /* libchipmunk Mac.a */; }; + 1A67682A180E9C060076BC67 /* libcocos2dx Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AC6FB48180E9ACB004C840B /* libcocos2dx Mac.a */; }; + 1A67682B180E9C060076BC67 /* libcocos2dx-extensions Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AC6FB4A180E9ACB004C840B /* libcocos2dx-extensions Mac.a */; }; + 1A67682C180E9C060076BC67 /* libCocosDenshion Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AC6FB50180E9ACB004C840B /* libCocosDenshion Mac.a */; }; + 1A67682D180E9C060076BC67 /* libjsbindings Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AC6FB52180E9ACB004C840B /* libjsbindings Mac.a */; }; + 1A676838180E9C1E0076BC67 /* libchipmunk iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AC6FB5A180E9ACB004C840B /* libchipmunk iOS.a */; }; + 1A676839180E9C1E0076BC67 /* libcocos2dx iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AC6FB56180E9ACB004C840B /* libcocos2dx iOS.a */; }; + 1A67683A180E9C1E0076BC67 /* libcocos2dx-extensions iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AC6FB58180E9ACB004C840B /* libcocos2dx-extensions iOS.a */; }; + 1A67683B180E9C1E0076BC67 /* libCocosDenshion iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AC6FB5E180E9ACB004C840B /* libCocosDenshion iOS.a */; }; + 1A67683C180E9C1E0076BC67 /* libjsbindings iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AC6FB60180E9ACB004C840B /* libjsbindings iOS.a */; }; + 1A67683E180E9CE90076BC67 /* jsb_chipmunk_constants.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6767EE180E9B160076BC67 /* jsb_chipmunk_constants.js */; }; + 1A67683F180E9CE90076BC67 /* jsb_chipmunk.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6767EF180E9B160076BC67 /* jsb_chipmunk.js */; }; + 1A676840180E9CE90076BC67 /* jsb_cocos2d_constants.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6767F0180E9B160076BC67 /* jsb_cocos2d_constants.js */; }; + 1A676841180E9CE90076BC67 /* jsb_cocos2d_extension.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6767F1180E9B160076BC67 /* jsb_cocos2d_extension.js */; }; + 1A676842180E9CE90076BC67 /* jsb_cocos2d.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6767F2180E9B160076BC67 /* jsb_cocos2d.js */; }; + 1A676843180E9CE90076BC67 /* jsb_cocosbuilder.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6767F3180E9B160076BC67 /* jsb_cocosbuilder.js */; }; + 1A676844180E9CE90076BC67 /* jsb_debugger.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6767F4180E9B160076BC67 /* jsb_debugger.js */; }; + 1A676845180E9CE90076BC67 /* jsb_deprecated.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6767F5180E9B160076BC67 /* jsb_deprecated.js */; }; + 1A676846180E9CE90076BC67 /* jsb_opengl_constants.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6767F6180E9B160076BC67 /* jsb_opengl_constants.js */; }; + 1A676847180E9CE90076BC67 /* jsb_opengl.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6767F7180E9B160076BC67 /* jsb_opengl.js */; }; + 1A676848180E9CE90076BC67 /* jsb_sys.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6767F8180E9B160076BC67 /* jsb_sys.js */; }; + 1A676849180E9CE90076BC67 /* jsb.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6767F9180E9B160076BC67 /* jsb.js */; }; + 1A67684A180E9CF10076BC67 /* jsb_chipmunk_constants.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6767EE180E9B160076BC67 /* jsb_chipmunk_constants.js */; }; + 1A67684B180E9CF10076BC67 /* jsb_chipmunk.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6767EF180E9B160076BC67 /* jsb_chipmunk.js */; }; + 1A67684C180E9CF10076BC67 /* jsb_cocos2d_constants.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6767F0180E9B160076BC67 /* jsb_cocos2d_constants.js */; }; + 1A67684D180E9CF10076BC67 /* jsb_cocos2d_extension.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6767F1180E9B160076BC67 /* jsb_cocos2d_extension.js */; }; + 1A67684E180E9CF10076BC67 /* jsb_cocos2d.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6767F2180E9B160076BC67 /* jsb_cocos2d.js */; }; + 1A67684F180E9CF10076BC67 /* jsb_cocosbuilder.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6767F3180E9B160076BC67 /* jsb_cocosbuilder.js */; }; + 1A676850180E9CF10076BC67 /* jsb_debugger.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6767F4180E9B160076BC67 /* jsb_debugger.js */; }; + 1A676851180E9CF10076BC67 /* jsb_deprecated.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6767F5180E9B160076BC67 /* jsb_deprecated.js */; }; + 1A676852180E9CF10076BC67 /* jsb_opengl_constants.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6767F6180E9B160076BC67 /* jsb_opengl_constants.js */; }; + 1A676853180E9CF10076BC67 /* jsb_opengl.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6767F7180E9B160076BC67 /* jsb_opengl.js */; }; + 1A676854180E9CF10076BC67 /* jsb_sys.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6767F8180E9B160076BC67 /* jsb_sys.js */; }; + 1A676855180E9CF10076BC67 /* jsb.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6767F9180E9B160076BC67 /* jsb.js */; }; 1A82F5FB169AC92500C4B13A /* libsqlite3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A82F5FA169AC92500C4B13A /* libsqlite3.dylib */; }; - 1A96A4F3174A3432008653A9 /* libcurl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A96A4F2174A3432008653A9 /* libcurl.a */; }; 1AE4B40416D1FECD003C6D1C /* res in Resources */ = {isa = PBXBuildFile; fileRef = 1AE4B40116D1FECD003C6D1C /* res */; }; 1AE4B40516D1FECD003C6D1C /* src in Resources */ = {isa = PBXBuildFile; fileRef = 1AE4B40216D1FECD003C6D1C /* src */; }; 1AE4B40616D1FF4C003C6D1C /* main.js in Resources */ = {isa = PBXBuildFile; fileRef = 1AE4B40016D1FECD003C6D1C /* main.js */; }; - 1AF4C33317865EC500122817 /* libchipmunk iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C32017865E8F00122817 /* libchipmunk iOS.a */; }; - 1AF4C33417865EC500122817 /* libcocos2dx iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C31C17865E8F00122817 /* libcocos2dx iOS.a */; }; - 1AF4C33517865EC500122817 /* libcocos2dx-extensions iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C31E17865E8F00122817 /* libcocos2dx-extensions iOS.a */; }; - 1AF4C33617865EC500122817 /* libCocosDenshion iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C32417865E8F00122817 /* libCocosDenshion iOS.a */; }; - 1AF4C33717865EC500122817 /* libjsbindings iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C32617865E8F00122817 /* libjsbindings iOS.a */; }; - 1AF4C35117865F7400122817 /* jsb_chipmunk_constants.js in Resources */ = {isa = PBXBuildFile; fileRef = 1AF4C33917865F1600122817 /* jsb_chipmunk_constants.js */; }; - 1AF4C35217865F7400122817 /* jsb_chipmunk.js in Resources */ = {isa = PBXBuildFile; fileRef = 1AF4C33A17865F1600122817 /* jsb_chipmunk.js */; }; - 1AF4C35317865F7400122817 /* jsb_cocos2d_constants.js in Resources */ = {isa = PBXBuildFile; fileRef = 1AF4C33B17865F1600122817 /* jsb_cocos2d_constants.js */; }; - 1AF4C35417865F7400122817 /* jsb_cocos2d_extension.js in Resources */ = {isa = PBXBuildFile; fileRef = 1AF4C33C17865F1600122817 /* jsb_cocos2d_extension.js */; }; - 1AF4C35517865F7400122817 /* jsb_cocos2d.js in Resources */ = {isa = PBXBuildFile; fileRef = 1AF4C33D17865F1600122817 /* jsb_cocos2d.js */; }; - 1AF4C35617865F7400122817 /* jsb_cocosbuilder.js in Resources */ = {isa = PBXBuildFile; fileRef = 1AF4C33E17865F1600122817 /* jsb_cocosbuilder.js */; }; - 1AF4C35717865F7400122817 /* jsb_debugger.js in Resources */ = {isa = PBXBuildFile; fileRef = 1AF4C33F17865F1600122817 /* jsb_debugger.js */; }; - 1AF4C35817865F7400122817 /* jsb_opengl_constants.js in Resources */ = {isa = PBXBuildFile; fileRef = 1AF4C34017865F1600122817 /* jsb_opengl_constants.js */; }; - 1AF4C35917865F7400122817 /* jsb_opengl.js in Resources */ = {isa = PBXBuildFile; fileRef = 1AF4C34117865F1600122817 /* jsb_opengl.js */; }; - 1AF4C35A17865F7400122817 /* jsb_sys.js in Resources */ = {isa = PBXBuildFile; fileRef = 1AF4C34217865F1600122817 /* jsb_sys.js */; }; - 1AF4C35B17865F7400122817 /* jsb.js in Resources */ = {isa = PBXBuildFile; fileRef = 1AF4C34317865F1600122817 /* jsb.js */; }; - 1AF4C35C17865F7400122817 /* main.debug.js in Resources */ = {isa = PBXBuildFile; fileRef = 1AF4C34417865F1600122817 /* main.debug.js */; }; - 466AF679179FC7EE002EE9BB /* jsb_deprecated.js in Resources */ = {isa = PBXBuildFile; fileRef = 466AF66C179FC7BE002EE9BB /* jsb_deprecated.js */; }; 502380DC17EBB88200990C9B /* libcurl.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 502380DB17EBB88200990C9B /* libcurl.dylib */; }; - 502380DD17EBB89A00990C9B /* libchipmunk Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C31217865E8F00122817 /* libchipmunk Mac.a */; }; - 502380DE17EBB89A00990C9B /* libcocos2dx Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C30E17865E8F00122817 /* libcocos2dx Mac.a */; }; - 502380DF17EBB89A00990C9B /* libcocos2dx-extensions Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C31017865E8F00122817 /* libcocos2dx-extensions Mac.a */; }; - 502380E017EBB89A00990C9B /* libCocosDenshion Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C31617865E8F00122817 /* libCocosDenshion Mac.a */; }; - 502380E117EBB89A00990C9B /* libjsbindings Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C31817865E8F00122817 /* libjsbindings Mac.a */; }; 5091731A17ECDF7A00D62437 /* Icon-29.png in Resources */ = {isa = PBXBuildFile; fileRef = 5091731417ECDF7A00D62437 /* Icon-29.png */; }; 5091731B17ECDF7A00D62437 /* Icon-40.png in Resources */ = {isa = PBXBuildFile; fileRef = 5091731517ECDF7A00D62437 /* Icon-40.png */; }; 5091731C17ECDF7A00D62437 /* Icon-50.png in Resources */ = {isa = PBXBuildFile; fileRef = 5091731617ECDF7A00D62437 /* Icon-50.png */; }; @@ -51,19 +63,6 @@ 509D4A8E17EBB24E00697056 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A92275491517C094001B78AA /* AVFoundation.framework */; }; 509D4A9017EBB24E00697056 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A922754D1517C094001B78AA /* Foundation.framework */; }; 509D4A9117EBB24E00697056 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A922754F1517C094001B78AA /* CoreGraphics.framework */; }; - 509D4A9417EBB24E00697056 /* jsb_deprecated.js in Resources */ = {isa = PBXBuildFile; fileRef = 466AF66C179FC7BE002EE9BB /* jsb_deprecated.js */; }; - 509D4A9517EBB24E00697056 /* jsb_chipmunk_constants.js in Resources */ = {isa = PBXBuildFile; fileRef = 1AF4C33917865F1600122817 /* jsb_chipmunk_constants.js */; }; - 509D4A9617EBB24E00697056 /* jsb_chipmunk.js in Resources */ = {isa = PBXBuildFile; fileRef = 1AF4C33A17865F1600122817 /* jsb_chipmunk.js */; }; - 509D4A9717EBB24E00697056 /* jsb_cocos2d_constants.js in Resources */ = {isa = PBXBuildFile; fileRef = 1AF4C33B17865F1600122817 /* jsb_cocos2d_constants.js */; }; - 509D4A9817EBB24E00697056 /* jsb_cocos2d_extension.js in Resources */ = {isa = PBXBuildFile; fileRef = 1AF4C33C17865F1600122817 /* jsb_cocos2d_extension.js */; }; - 509D4A9917EBB24E00697056 /* jsb_cocos2d.js in Resources */ = {isa = PBXBuildFile; fileRef = 1AF4C33D17865F1600122817 /* jsb_cocos2d.js */; }; - 509D4A9A17EBB24E00697056 /* jsb_cocosbuilder.js in Resources */ = {isa = PBXBuildFile; fileRef = 1AF4C33E17865F1600122817 /* jsb_cocosbuilder.js */; }; - 509D4A9B17EBB24E00697056 /* jsb_debugger.js in Resources */ = {isa = PBXBuildFile; fileRef = 1AF4C33F17865F1600122817 /* jsb_debugger.js */; }; - 509D4A9C17EBB24E00697056 /* jsb_opengl_constants.js in Resources */ = {isa = PBXBuildFile; fileRef = 1AF4C34017865F1600122817 /* jsb_opengl_constants.js */; }; - 509D4A9D17EBB24E00697056 /* jsb_opengl.js in Resources */ = {isa = PBXBuildFile; fileRef = 1AF4C34117865F1600122817 /* jsb_opengl.js */; }; - 509D4A9E17EBB24E00697056 /* jsb_sys.js in Resources */ = {isa = PBXBuildFile; fileRef = 1AF4C34217865F1600122817 /* jsb_sys.js */; }; - 509D4A9F17EBB24E00697056 /* jsb.js in Resources */ = {isa = PBXBuildFile; fileRef = 1AF4C34317865F1600122817 /* jsb.js */; }; - 509D4AA017EBB24E00697056 /* main.debug.js in Resources */ = {isa = PBXBuildFile; fileRef = 1AF4C34417865F1600122817 /* main.debug.js */; }; 509D4AA117EBB24E00697056 /* main.js in Resources */ = {isa = PBXBuildFile; fileRef = 1AE4B40016D1FECD003C6D1C /* main.js */; }; 509D4AA517EBB24E00697056 /* res in Resources */ = {isa = PBXBuildFile; fileRef = 1AE4B40116D1FECD003C6D1C /* res */; }; 509D4AA617EBB24E00697056 /* src in Resources */ = {isa = PBXBuildFile; fileRef = 1AE4B40216D1FECD003C6D1C /* src */; }; @@ -99,140 +98,196 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 1AF4C30D17865E8F00122817 /* PBXContainerItemProxy */ = { + 1A67681F180E9BF70076BC67 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2FA17865E8F00122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 1551A33E158F2AB200E66CFE; + remoteInfo = "cocos2dx Mac"; + }; + 1A676821180E9BF70076BC67 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A03F2FC117814595006731B9; + remoteInfo = "cocos2dx-extensions Mac"; + }; + 1A676823180E9BF70076BC67 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A03F2B781780BD04006731B9; + remoteInfo = "chipmunk Mac"; + }; + 1A676825180E9BF70076BC67 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A03F2E9817814268006731B9; + remoteInfo = "CocosDenshion Mac"; + }; + 1A676827180E9BF70076BC67 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A03F31E81781479B006731B9; + remoteInfo = "jsbindings Mac"; + }; + 1A67682E180E9C110076BC67 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A07A4C241783777C0073F6A7; + remoteInfo = "cocos2dx iOS"; + }; + 1A676830180E9C110076BC67 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A07A4E111783867C0073F6A7; + remoteInfo = "cocos2dx-extensions iOS"; + }; + 1A676832180E9C110076BC67 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A07A4EFD178387670073F6A7; + remoteInfo = "chipmunk iOS"; + }; + 1A676834180E9C110076BC67 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A07A4F9F178387730073F6A7; + remoteInfo = "CocosDenshion iOS"; + }; + 1A676836180E9C110076BC67 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A07A4FB5178387750073F6A7; + remoteInfo = "jsbindings iOS"; + }; + 1AC6FB47180E9ACB004C840B /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = 1551A33F158F2AB200E66CFE; remoteInfo = "cocos2dx Mac"; }; - 1AF4C30F17865E8F00122817 /* PBXContainerItemProxy */ = { + 1AC6FB49180E9ACB004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2FA17865E8F00122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = A03F2FD617814595006731B9; remoteInfo = "cocos2dx-extensions Mac"; }; - 1AF4C31117865E8F00122817 /* PBXContainerItemProxy */ = { + 1AC6FB4B180E9ACB004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2FA17865E8F00122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = A03F2CB81780BD04006731B9; remoteInfo = "chipmunk Mac"; }; - 1AF4C31317865E8F00122817 /* PBXContainerItemProxy */ = { + 1AC6FB4D180E9ACB004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2FA17865E8F00122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = A03F2D9B1780BDF7006731B9; remoteInfo = "box2d Mac"; }; - 1AF4C31517865E8F00122817 /* PBXContainerItemProxy */ = { + 1AC6FB4F180E9ACB004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2FA17865E8F00122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = A03F2ED617814268006731B9; remoteInfo = "CocosDenshion Mac"; }; - 1AF4C31717865E8F00122817 /* PBXContainerItemProxy */ = { + 1AC6FB51180E9ACB004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2FA17865E8F00122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = A03F31FD1781479B006731B9; remoteInfo = "jsbindings Mac"; }; - 1AF4C31917865E8F00122817 /* PBXContainerItemProxy */ = { + 1AC6FB53180E9ACB004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2FA17865E8F00122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = 1A6FB53017854BC300CDF010; remoteInfo = "luabindings Mac"; }; - 1AF4C31B17865E8F00122817 /* PBXContainerItemProxy */ = { + 1AC6FB55180E9ACB004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2FA17865E8F00122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = A07A4D641783777C0073F6A7; remoteInfo = "cocos2dx iOS"; }; - 1AF4C31D17865E8F00122817 /* PBXContainerItemProxy */ = { + 1AC6FB57180E9ACB004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2FA17865E8F00122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = A07A4EFC1783867C0073F6A7; remoteInfo = "cocos2dx-extensions iOS"; }; - 1AF4C31F17865E8F00122817 /* PBXContainerItemProxy */ = { + 1AC6FB59180E9ACB004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2FA17865E8F00122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = A07A4F3B178387670073F6A7; remoteInfo = "chipmunk iOS"; }; - 1AF4C32117865E8F00122817 /* PBXContainerItemProxy */ = { + 1AC6FB5B180E9ACB004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2FA17865E8F00122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = A07A4F9E1783876B0073F6A7; remoteInfo = "box2d iOS"; }; - 1AF4C32317865E8F00122817 /* PBXContainerItemProxy */ = { + 1AC6FB5D180E9ACB004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2FA17865E8F00122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = A07A4FB4178387730073F6A7; remoteInfo = "CocosDenshion iOS"; }; - 1AF4C32517865E8F00122817 /* PBXContainerItemProxy */ = { + 1AC6FB5F180E9ACB004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2FA17865E8F00122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = A07A5030178387750073F6A7; remoteInfo = "jsbindings iOS"; }; - 1AF4C32717865E8F00122817 /* PBXContainerItemProxy */ = { + 1AC6FB61180E9ACB004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2FA17865E8F00122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = 1A119791178526AA00D62A44; remoteInfo = "luabindings iOS"; }; - 502380EE17EBB8C500990C9B /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 1AF4C2FA17865E8F00122817 /* cocos2d_libs.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = A03F2E8E178141C1006731B9; - remoteInfo = "build-all-libs Mac"; - }; - 502380F017EBB8FD00990C9B /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 1AF4C2FA17865E8F00122817 /* cocos2d_libs.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = A07A4E0B178386390073F6A7; - remoteInfo = "build-all-libs iOS"; - }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 1A6767ED180E9B160076BC67 /* debugger */ = {isa = PBXFileReference; lastKnownFileType = folder; name = debugger; path = ../../../cocos/scripting/javascript/script/debugger; sourceTree = ""; }; + 1A6767EE180E9B160076BC67 /* jsb_chipmunk_constants.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_chipmunk_constants.js; path = ../../../cocos/scripting/javascript/script/jsb_chipmunk_constants.js; sourceTree = ""; }; + 1A6767EF180E9B160076BC67 /* jsb_chipmunk.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_chipmunk.js; path = ../../../cocos/scripting/javascript/script/jsb_chipmunk.js; sourceTree = ""; }; + 1A6767F0180E9B160076BC67 /* jsb_cocos2d_constants.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_cocos2d_constants.js; path = ../../../cocos/scripting/javascript/script/jsb_cocos2d_constants.js; sourceTree = ""; }; + 1A6767F1180E9B160076BC67 /* jsb_cocos2d_extension.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_cocos2d_extension.js; path = ../../../cocos/scripting/javascript/script/jsb_cocos2d_extension.js; sourceTree = ""; }; + 1A6767F2180E9B160076BC67 /* jsb_cocos2d.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_cocos2d.js; path = ../../../cocos/scripting/javascript/script/jsb_cocos2d.js; sourceTree = ""; }; + 1A6767F3180E9B160076BC67 /* jsb_cocosbuilder.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_cocosbuilder.js; path = ../../../cocos/scripting/javascript/script/jsb_cocosbuilder.js; sourceTree = ""; }; + 1A6767F4180E9B160076BC67 /* jsb_debugger.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_debugger.js; path = ../../../cocos/scripting/javascript/script/jsb_debugger.js; sourceTree = ""; }; + 1A6767F5180E9B160076BC67 /* jsb_deprecated.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_deprecated.js; path = ../../../cocos/scripting/javascript/script/jsb_deprecated.js; sourceTree = ""; }; + 1A6767F6180E9B160076BC67 /* jsb_opengl_constants.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_opengl_constants.js; path = ../../../cocos/scripting/javascript/script/jsb_opengl_constants.js; sourceTree = ""; }; + 1A6767F7180E9B160076BC67 /* jsb_opengl.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_opengl.js; path = ../../../cocos/scripting/javascript/script/jsb_opengl.js; sourceTree = ""; }; + 1A6767F8180E9B160076BC67 /* jsb_sys.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_sys.js; path = ../../../cocos/scripting/javascript/script/jsb_sys.js; sourceTree = ""; }; + 1A6767F9180E9B160076BC67 /* jsb.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb.js; path = ../../../cocos/scripting/javascript/script/jsb.js; sourceTree = ""; }; 1A82F5FA169AC92500C4B13A /* libsqlite3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libsqlite3.dylib; path = usr/lib/libsqlite3.dylib; sourceTree = SDKROOT; }; 1A96A4F2174A3432008653A9 /* libcurl.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcurl.a; path = ../../../cocos2dx/platform/third_party/ios/libraries/libcurl.a; sourceTree = ""; }; + 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = cocos2d_libs.xcodeproj; path = ../../../build/cocos2d_libs.xcodeproj; sourceTree = ""; }; 1AE4B40016D1FECD003C6D1C /* main.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = main.js; path = ../Resources/main.js; sourceTree = ""; }; 1AE4B40116D1FECD003C6D1C /* res */ = {isa = PBXFileReference; lastKnownFileType = folder; name = res; path = ../Resources/res; sourceTree = ""; }; 1AE4B40216D1FECD003C6D1C /* src */ = {isa = PBXFileReference; lastKnownFileType = folder; name = src; path = ../Resources/src; sourceTree = ""; }; - 1AF4C2FA17865E8F00122817 /* cocos2d_libs.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = cocos2d_libs.xcodeproj; path = ../../../cocos2d_libs.xcodeproj; sourceTree = ""; }; - 1AF4C33917865F1600122817 /* jsb_chipmunk_constants.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_chipmunk_constants.js; path = ../../../scripting/javascript/bindings/js/jsb_chipmunk_constants.js; sourceTree = ""; }; - 1AF4C33A17865F1600122817 /* jsb_chipmunk.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_chipmunk.js; path = ../../../scripting/javascript/bindings/js/jsb_chipmunk.js; sourceTree = ""; }; - 1AF4C33B17865F1600122817 /* jsb_cocos2d_constants.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_cocos2d_constants.js; path = ../../../scripting/javascript/bindings/js/jsb_cocos2d_constants.js; sourceTree = ""; }; - 1AF4C33C17865F1600122817 /* jsb_cocos2d_extension.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_cocos2d_extension.js; path = ../../../scripting/javascript/bindings/js/jsb_cocos2d_extension.js; sourceTree = ""; }; - 1AF4C33D17865F1600122817 /* jsb_cocos2d.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_cocos2d.js; path = ../../../scripting/javascript/bindings/js/jsb_cocos2d.js; sourceTree = ""; }; - 1AF4C33E17865F1600122817 /* jsb_cocosbuilder.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_cocosbuilder.js; path = ../../../scripting/javascript/bindings/js/jsb_cocosbuilder.js; sourceTree = ""; }; - 1AF4C33F17865F1600122817 /* jsb_debugger.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_debugger.js; path = ../../../scripting/javascript/bindings/js/jsb_debugger.js; sourceTree = ""; }; - 1AF4C34017865F1600122817 /* jsb_opengl_constants.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_opengl_constants.js; path = ../../../scripting/javascript/bindings/js/jsb_opengl_constants.js; sourceTree = ""; }; - 1AF4C34117865F1600122817 /* jsb_opengl.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_opengl.js; path = ../../../scripting/javascript/bindings/js/jsb_opengl.js; sourceTree = ""; }; - 1AF4C34217865F1600122817 /* jsb_sys.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_sys.js; path = ../../../scripting/javascript/bindings/js/jsb_sys.js; sourceTree = ""; }; - 1AF4C34317865F1600122817 /* jsb.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb.js; path = ../../../scripting/javascript/bindings/js/jsb.js; sourceTree = ""; }; - 1AF4C34417865F1600122817 /* main.debug.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = main.debug.js; path = ../../../scripting/javascript/bindings/js/main.debug.js; sourceTree = ""; }; - 466AF66C179FC7BE002EE9BB /* jsb_deprecated.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_deprecated.js; path = ../../../scripting/javascript/bindings/js/jsb_deprecated.js; sourceTree = ""; }; 502380DB17EBB88200990C9B /* libcurl.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libcurl.dylib; path = usr/lib/libcurl.dylib; sourceTree = SDKROOT; }; 5091731417ECDF7A00D62437 /* Icon-29.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-29.png"; path = "ios/Icon-29.png"; sourceTree = ""; }; 5091731517ECDF7A00D62437 /* Icon-40.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-40.png"; path = "ios/Icon-40.png"; sourceTree = ""; }; @@ -285,11 +340,11 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 502380DD17EBB89A00990C9B /* libchipmunk Mac.a in Frameworks */, - 502380DE17EBB89A00990C9B /* libcocos2dx Mac.a in Frameworks */, - 502380DF17EBB89A00990C9B /* libcocos2dx-extensions Mac.a in Frameworks */, - 502380E017EBB89A00990C9B /* libCocosDenshion Mac.a in Frameworks */, - 502380E117EBB89A00990C9B /* libjsbindings Mac.a in Frameworks */, + 1A676829180E9C060076BC67 /* libchipmunk Mac.a in Frameworks */, + 1A67682A180E9C060076BC67 /* libcocos2dx Mac.a in Frameworks */, + 1A67682B180E9C060076BC67 /* libcocos2dx-extensions Mac.a in Frameworks */, + 1A67682C180E9C060076BC67 /* libCocosDenshion Mac.a in Frameworks */, + 1A67682D180E9C060076BC67 /* libjsbindings Mac.a in Frameworks */, 502380DC17EBB88200990C9B /* libcurl.dylib in Frameworks */, 509D4A8817EBB24E00697056 /* libsqlite3.dylib in Frameworks */, 509D4A8917EBB24E00697056 /* libz.dylib in Frameworks */, @@ -309,12 +364,12 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 1A676838180E9C1E0076BC67 /* libchipmunk iOS.a in Frameworks */, + 1A676839180E9C1E0076BC67 /* libcocos2dx iOS.a in Frameworks */, + 1A67683A180E9C1E0076BC67 /* libcocos2dx-extensions iOS.a in Frameworks */, + 1A67683B180E9C1E0076BC67 /* libCocosDenshion iOS.a in Frameworks */, + 1A67683C180E9C1E0076BC67 /* libjsbindings iOS.a in Frameworks */, D6B061241803AB9F0077942B /* CoreMotion.framework in Frameworks */, - 1AF4C33317865EC500122817 /* libchipmunk iOS.a in Frameworks */, - 1AF4C33417865EC500122817 /* libcocos2dx iOS.a in Frameworks */, - 1AF4C33517865EC500122817 /* libcocos2dx-extensions iOS.a in Frameworks */, - 1AF4C33617865EC500122817 /* libCocosDenshion iOS.a in Frameworks */, - 1AF4C33717865EC500122817 /* libjsbindings iOS.a in Frameworks */, 1A82F5FB169AC92500C4B13A /* libsqlite3.dylib in Frameworks */, D454520C156E22BD00887EB5 /* libz.dylib in Frameworks */, A92275421517C094001B78AA /* QuartzCore.framework in Frameworks */, @@ -325,7 +380,6 @@ A922754C1517C094001B78AA /* UIKit.framework in Frameworks */, A922754E1517C094001B78AA /* Foundation.framework in Frameworks */, A92275501517C094001B78AA /* CoreGraphics.framework in Frameworks */, - 1A96A4F3174A3432008653A9 /* libcurl.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -342,47 +396,47 @@ name = Resources; sourceTree = ""; }; - 1AF4C2FB17865E8F00122817 /* Products */ = { + 1A6767EC180E9AF00076BC67 /* JS Common */ = { isa = PBXGroup; children = ( - 1AF4C30E17865E8F00122817 /* libcocos2dx Mac.a */, - 1AF4C31017865E8F00122817 /* libcocos2dx-extensions Mac.a */, - 1AF4C31217865E8F00122817 /* libchipmunk Mac.a */, - 1AF4C31417865E8F00122817 /* libbox2d Mac.a */, - 1AF4C31617865E8F00122817 /* libCocosDenshion Mac.a */, - 1AF4C31817865E8F00122817 /* libjsbindings Mac.a */, - 1AF4C31A17865E8F00122817 /* libluabindings Mac.a */, - 1AF4C31C17865E8F00122817 /* libcocos2dx iOS.a */, - 1AF4C31E17865E8F00122817 /* libcocos2dx-extensions iOS.a */, - 1AF4C32017865E8F00122817 /* libchipmunk iOS.a */, - 1AF4C32217865E8F00122817 /* libbox2d iOS.a */, - 1AF4C32417865E8F00122817 /* libCocosDenshion iOS.a */, - 1AF4C32617865E8F00122817 /* libjsbindings iOS.a */, - 1AF4C32817865E8F00122817 /* libluabindings iOS.a */, - ); - name = Products; - sourceTree = ""; - }; - 1AF4C33817865EF900122817 /* JS Common */ = { - isa = PBXGroup; - children = ( - 466AF66C179FC7BE002EE9BB /* jsb_deprecated.js */, - 1AF4C33917865F1600122817 /* jsb_chipmunk_constants.js */, - 1AF4C33A17865F1600122817 /* jsb_chipmunk.js */, - 1AF4C33B17865F1600122817 /* jsb_cocos2d_constants.js */, - 1AF4C33C17865F1600122817 /* jsb_cocos2d_extension.js */, - 1AF4C33D17865F1600122817 /* jsb_cocos2d.js */, - 1AF4C33E17865F1600122817 /* jsb_cocosbuilder.js */, - 1AF4C33F17865F1600122817 /* jsb_debugger.js */, - 1AF4C34017865F1600122817 /* jsb_opengl_constants.js */, - 1AF4C34117865F1600122817 /* jsb_opengl.js */, - 1AF4C34217865F1600122817 /* jsb_sys.js */, - 1AF4C34317865F1600122817 /* jsb.js */, - 1AF4C34417865F1600122817 /* main.debug.js */, + 1A6767ED180E9B160076BC67 /* debugger */, + 1A6767EE180E9B160076BC67 /* jsb_chipmunk_constants.js */, + 1A6767EF180E9B160076BC67 /* jsb_chipmunk.js */, + 1A6767F0180E9B160076BC67 /* jsb_cocos2d_constants.js */, + 1A6767F1180E9B160076BC67 /* jsb_cocos2d_extension.js */, + 1A6767F2180E9B160076BC67 /* jsb_cocos2d.js */, + 1A6767F3180E9B160076BC67 /* jsb_cocosbuilder.js */, + 1A6767F4180E9B160076BC67 /* jsb_debugger.js */, + 1A6767F5180E9B160076BC67 /* jsb_deprecated.js */, + 1A6767F6180E9B160076BC67 /* jsb_opengl_constants.js */, + 1A6767F7180E9B160076BC67 /* jsb_opengl.js */, + 1A6767F8180E9B160076BC67 /* jsb_sys.js */, + 1A6767F9180E9B160076BC67 /* jsb.js */, ); name = "JS Common"; sourceTree = ""; }; + 1AC6FB35180E9ACB004C840B /* Products */ = { + isa = PBXGroup; + children = ( + 1AC6FB48180E9ACB004C840B /* libcocos2dx Mac.a */, + 1AC6FB4A180E9ACB004C840B /* libcocos2dx-extensions Mac.a */, + 1AC6FB4C180E9ACB004C840B /* libchipmunk Mac.a */, + 1AC6FB4E180E9ACB004C840B /* libbox2d Mac.a */, + 1AC6FB50180E9ACB004C840B /* libCocosDenshion Mac.a */, + 1AC6FB52180E9ACB004C840B /* libjsbindings Mac.a */, + 1AC6FB54180E9ACB004C840B /* libluabindings Mac.a */, + 1AC6FB56180E9ACB004C840B /* libcocos2dx iOS.a */, + 1AC6FB58180E9ACB004C840B /* libcocos2dx-extensions iOS.a */, + 1AC6FB5A180E9ACB004C840B /* libchipmunk iOS.a */, + 1AC6FB5C180E9ACB004C840B /* libbox2d iOS.a */, + 1AC6FB5E180E9ACB004C840B /* libCocosDenshion iOS.a */, + 1AC6FB60180E9ACB004C840B /* libjsbindings iOS.a */, + 1AC6FB62180E9ACB004C840B /* libluabindings iOS.a */, + ); + name = Products; + sourceTree = ""; + }; 5091732E17ECDF8A00D62437 /* Icons */ = { isa = PBXGroup; children = ( @@ -417,11 +471,11 @@ A92275321517C094001B78AA = { isa = PBXGroup; children = ( - 1AF4C2FA17865E8F00122817 /* cocos2d_libs.xcodeproj */, - 1AF4C33817865EF900122817 /* JS Common */, + 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */, D4545214156E28EF00887EB5 /* Classes */, A92275401517C094001B78AA /* Frameworks */, D45446CC156DE73F00887EB5 /* ios */, + 1A6767EC180E9AF00076BC67 /* JS Common */, 509D4ACA17EBB2BE00697056 /* mac */, A922753E1517C094001B78AA /* Products */, 15628F5B15F0F5C2000CF24B /* Resources */, @@ -502,7 +556,11 @@ buildRules = ( ); dependencies = ( - 502380EF17EBB8C500990C9B /* PBXTargetDependency */, + 1A676820180E9BF70076BC67 /* PBXTargetDependency */, + 1A676822180E9BF70076BC67 /* PBXTargetDependency */, + 1A676824180E9BF70076BC67 /* PBXTargetDependency */, + 1A676826180E9BF70076BC67 /* PBXTargetDependency */, + 1A676828180E9BF70076BC67 /* PBXTargetDependency */, ); name = "Hello JavaScript Mac"; productName = HelloJavascript; @@ -520,7 +578,11 @@ buildRules = ( ); dependencies = ( - 502380F117EBB8FD00990C9B /* PBXTargetDependency */, + 1A67682F180E9C110076BC67 /* PBXTargetDependency */, + 1A676831180E9C110076BC67 /* PBXTargetDependency */, + 1A676833180E9C110076BC67 /* PBXTargetDependency */, + 1A676835180E9C110076BC67 /* PBXTargetDependency */, + 1A676837180E9C110076BC67 /* PBXTargetDependency */, ); name = "Hello JavaScript iOS"; productName = HelloJavascript; @@ -552,8 +614,8 @@ projectDirPath = ""; projectReferences = ( { - ProductGroup = 1AF4C2FB17865E8F00122817 /* Products */; - ProjectRef = 1AF4C2FA17865E8F00122817 /* cocos2d_libs.xcodeproj */; + ProductGroup = 1AC6FB35180E9ACB004C840B /* Products */; + ProjectRef = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; }, ); projectRoot = ""; @@ -565,102 +627,102 @@ /* End PBXProject section */ /* Begin PBXReferenceProxy section */ - 1AF4C30E17865E8F00122817 /* libcocos2dx Mac.a */ = { + 1AC6FB48180E9ACB004C840B /* libcocos2dx Mac.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libcocos2dx Mac.a"; - remoteRef = 1AF4C30D17865E8F00122817 /* PBXContainerItemProxy */; + remoteRef = 1AC6FB47180E9ACB004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C31017865E8F00122817 /* libcocos2dx-extensions Mac.a */ = { + 1AC6FB4A180E9ACB004C840B /* libcocos2dx-extensions Mac.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libcocos2dx-extensions Mac.a"; - remoteRef = 1AF4C30F17865E8F00122817 /* PBXContainerItemProxy */; + remoteRef = 1AC6FB49180E9ACB004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C31217865E8F00122817 /* libchipmunk Mac.a */ = { + 1AC6FB4C180E9ACB004C840B /* libchipmunk Mac.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libchipmunk Mac.a"; - remoteRef = 1AF4C31117865E8F00122817 /* PBXContainerItemProxy */; + remoteRef = 1AC6FB4B180E9ACB004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C31417865E8F00122817 /* libbox2d Mac.a */ = { + 1AC6FB4E180E9ACB004C840B /* libbox2d Mac.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libbox2d Mac.a"; - remoteRef = 1AF4C31317865E8F00122817 /* PBXContainerItemProxy */; + remoteRef = 1AC6FB4D180E9ACB004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C31617865E8F00122817 /* libCocosDenshion Mac.a */ = { + 1AC6FB50180E9ACB004C840B /* libCocosDenshion Mac.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libCocosDenshion Mac.a"; - remoteRef = 1AF4C31517865E8F00122817 /* PBXContainerItemProxy */; + remoteRef = 1AC6FB4F180E9ACB004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C31817865E8F00122817 /* libjsbindings Mac.a */ = { + 1AC6FB52180E9ACB004C840B /* libjsbindings Mac.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libjsbindings Mac.a"; - remoteRef = 1AF4C31717865E8F00122817 /* PBXContainerItemProxy */; + remoteRef = 1AC6FB51180E9ACB004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C31A17865E8F00122817 /* libluabindings Mac.a */ = { + 1AC6FB54180E9ACB004C840B /* libluabindings Mac.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libluabindings Mac.a"; - remoteRef = 1AF4C31917865E8F00122817 /* PBXContainerItemProxy */; + remoteRef = 1AC6FB53180E9ACB004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C31C17865E8F00122817 /* libcocos2dx iOS.a */ = { + 1AC6FB56180E9ACB004C840B /* libcocos2dx iOS.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libcocos2dx iOS.a"; - remoteRef = 1AF4C31B17865E8F00122817 /* PBXContainerItemProxy */; + remoteRef = 1AC6FB55180E9ACB004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C31E17865E8F00122817 /* libcocos2dx-extensions iOS.a */ = { + 1AC6FB58180E9ACB004C840B /* libcocos2dx-extensions iOS.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libcocos2dx-extensions iOS.a"; - remoteRef = 1AF4C31D17865E8F00122817 /* PBXContainerItemProxy */; + remoteRef = 1AC6FB57180E9ACB004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C32017865E8F00122817 /* libchipmunk iOS.a */ = { + 1AC6FB5A180E9ACB004C840B /* libchipmunk iOS.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libchipmunk iOS.a"; - remoteRef = 1AF4C31F17865E8F00122817 /* PBXContainerItemProxy */; + remoteRef = 1AC6FB59180E9ACB004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C32217865E8F00122817 /* libbox2d iOS.a */ = { + 1AC6FB5C180E9ACB004C840B /* libbox2d iOS.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libbox2d iOS.a"; - remoteRef = 1AF4C32117865E8F00122817 /* PBXContainerItemProxy */; + remoteRef = 1AC6FB5B180E9ACB004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C32417865E8F00122817 /* libCocosDenshion iOS.a */ = { + 1AC6FB5E180E9ACB004C840B /* libCocosDenshion iOS.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libCocosDenshion iOS.a"; - remoteRef = 1AF4C32317865E8F00122817 /* PBXContainerItemProxy */; + remoteRef = 1AC6FB5D180E9ACB004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C32617865E8F00122817 /* libjsbindings iOS.a */ = { + 1AC6FB60180E9ACB004C840B /* libjsbindings iOS.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libjsbindings iOS.a"; - remoteRef = 1AF4C32517865E8F00122817 /* PBXContainerItemProxy */; + remoteRef = 1AC6FB5F180E9ACB004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C32817865E8F00122817 /* libluabindings iOS.a */ = { + 1AC6FB62180E9ACB004C840B /* libluabindings iOS.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libluabindings iOS.a"; - remoteRef = 1AF4C32717865E8F00122817 /* PBXContainerItemProxy */; + remoteRef = 1AC6FB61180E9ACB004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXReferenceProxy section */ @@ -670,23 +732,23 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 509D4A9417EBB24E00697056 /* jsb_deprecated.js in Resources */, - 509D4A9517EBB24E00697056 /* jsb_chipmunk_constants.js in Resources */, - 509D4A9617EBB24E00697056 /* jsb_chipmunk.js in Resources */, - 509D4A9717EBB24E00697056 /* jsb_cocos2d_constants.js in Resources */, - 509D4A9817EBB24E00697056 /* jsb_cocos2d_extension.js in Resources */, - 509D4A9917EBB24E00697056 /* jsb_cocos2d.js in Resources */, - 509D4A9A17EBB24E00697056 /* jsb_cocosbuilder.js in Resources */, - 509D4A9B17EBB24E00697056 /* jsb_debugger.js in Resources */, - 509D4A9C17EBB24E00697056 /* jsb_opengl_constants.js in Resources */, - 509D4A9D17EBB24E00697056 /* jsb_opengl.js in Resources */, - 509D4A9E17EBB24E00697056 /* jsb_sys.js in Resources */, - 509D4A9F17EBB24E00697056 /* jsb.js in Resources */, - 509D4AA017EBB24E00697056 /* main.debug.js in Resources */, + 1A67683E180E9CE90076BC67 /* jsb_chipmunk_constants.js in Resources */, + 1A67683F180E9CE90076BC67 /* jsb_chipmunk.js in Resources */, + 1A676840180E9CE90076BC67 /* jsb_cocos2d_constants.js in Resources */, + 1A676841180E9CE90076BC67 /* jsb_cocos2d_extension.js in Resources */, + 1A676842180E9CE90076BC67 /* jsb_cocos2d.js in Resources */, + 1A676843180E9CE90076BC67 /* jsb_cocosbuilder.js in Resources */, + 1A676844180E9CE90076BC67 /* jsb_debugger.js in Resources */, + 1A676845180E9CE90076BC67 /* jsb_deprecated.js in Resources */, + 1A676846180E9CE90076BC67 /* jsb_opengl_constants.js in Resources */, + 1A676847180E9CE90076BC67 /* jsb_opengl.js in Resources */, + 1A676848180E9CE90076BC67 /* jsb_sys.js in Resources */, + 1A676849180E9CE90076BC67 /* jsb.js in Resources */, 509D4AA117EBB24E00697056 /* main.js in Resources */, 509D4ACF17EBB2BE00697056 /* Icon.icns in Resources */, 509D4AA517EBB24E00697056 /* res in Resources */, 509D4AA617EBB24E00697056 /* src in Resources */, + 1A6767FB180E9B160076BC67 /* debugger in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -694,28 +756,27 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 466AF679179FC7EE002EE9BB /* jsb_deprecated.js in Resources */, - 1AF4C35117865F7400122817 /* jsb_chipmunk_constants.js in Resources */, - 1AF4C35217865F7400122817 /* jsb_chipmunk.js in Resources */, - 1AF4C35317865F7400122817 /* jsb_cocos2d_constants.js in Resources */, + 1A67684A180E9CF10076BC67 /* jsb_chipmunk_constants.js in Resources */, + 1A67684B180E9CF10076BC67 /* jsb_chipmunk.js in Resources */, + 1A67684C180E9CF10076BC67 /* jsb_cocos2d_constants.js in Resources */, + 1A67684D180E9CF10076BC67 /* jsb_cocos2d_extension.js in Resources */, + 1A67684E180E9CF10076BC67 /* jsb_cocos2d.js in Resources */, + 1A67684F180E9CF10076BC67 /* jsb_cocosbuilder.js in Resources */, + 1A676850180E9CF10076BC67 /* jsb_debugger.js in Resources */, + 1A676851180E9CF10076BC67 /* jsb_deprecated.js in Resources */, + 1A676852180E9CF10076BC67 /* jsb_opengl_constants.js in Resources */, + 1A676853180E9CF10076BC67 /* jsb_opengl.js in Resources */, + 1A676854180E9CF10076BC67 /* jsb_sys.js in Resources */, + 1A676855180E9CF10076BC67 /* jsb.js in Resources */, 509D4ABE17EBB2AB00697056 /* Default.png in Resources */, 5091731E17ECDF7A00D62437 /* Icon-80.png in Resources */, 5091731F17ECDF7A00D62437 /* Icon-100.png in Resources */, 509D4AC117EBB2AB00697056 /* Icon-72.png in Resources */, - 1AF4C35417865F7400122817 /* jsb_cocos2d_extension.js in Resources */, - 1AF4C35517865F7400122817 /* jsb_cocos2d.js in Resources */, - 1AF4C35617865F7400122817 /* jsb_cocosbuilder.js in Resources */, 509D4AC017EBB2AB00697056 /* Icon-57.png in Resources */, - 1AF4C35717865F7400122817 /* jsb_debugger.js in Resources */, 5091731A17ECDF7A00D62437 /* Icon-29.png in Resources */, - 1AF4C35817865F7400122817 /* jsb_opengl_constants.js in Resources */, - 1AF4C35917865F7400122817 /* jsb_opengl.js in Resources */, - 1AF4C35A17865F7400122817 /* jsb_sys.js in Resources */, 509D4AC617EBB2AB00697056 /* Icon-152.png in Resources */, 509D4AC517EBB2AB00697056 /* Icon-144.png in Resources */, - 1AF4C35B17865F7400122817 /* jsb.js in Resources */, 509D4AC317EBB2AB00697056 /* Icon-114.png in Resources */, - 1AF4C35C17865F7400122817 /* main.debug.js in Resources */, 509D4ABD17EBB2AB00697056 /* Default-568h@2x.png in Resources */, 1AE4B40616D1FF4C003C6D1C /* main.js in Resources */, 509D4ABF17EBB2AB00697056 /* Default@2x.png in Resources */, @@ -726,6 +787,7 @@ 509D4AC417EBB2AB00697056 /* Icon-120.png in Resources */, 1AE4B40516D1FECD003C6D1C /* src in Resources */, 5091731D17ECDF7A00D62437 /* Icon-58.png in Resources */, + 1A6767FA180E9B160076BC67 /* debugger in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -755,15 +817,55 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ - 502380EF17EBB8C500990C9B /* PBXTargetDependency */ = { + 1A676820180E9BF70076BC67 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - name = "build-all-libs Mac"; - targetProxy = 502380EE17EBB8C500990C9B /* PBXContainerItemProxy */; + name = "cocos2dx Mac"; + targetProxy = 1A67681F180E9BF70076BC67 /* PBXContainerItemProxy */; }; - 502380F117EBB8FD00990C9B /* PBXTargetDependency */ = { + 1A676822180E9BF70076BC67 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - name = "build-all-libs iOS"; - targetProxy = 502380F017EBB8FD00990C9B /* PBXContainerItemProxy */; + name = "cocos2dx-extensions Mac"; + targetProxy = 1A676821180E9BF70076BC67 /* PBXContainerItemProxy */; + }; + 1A676824180E9BF70076BC67 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "chipmunk Mac"; + targetProxy = 1A676823180E9BF70076BC67 /* PBXContainerItemProxy */; + }; + 1A676826180E9BF70076BC67 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "CocosDenshion Mac"; + targetProxy = 1A676825180E9BF70076BC67 /* PBXContainerItemProxy */; + }; + 1A676828180E9BF70076BC67 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "jsbindings Mac"; + targetProxy = 1A676827180E9BF70076BC67 /* PBXContainerItemProxy */; + }; + 1A67682F180E9C110076BC67 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "cocos2dx iOS"; + targetProxy = 1A67682E180E9C110076BC67 /* PBXContainerItemProxy */; + }; + 1A676831180E9C110076BC67 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "cocos2dx-extensions iOS"; + targetProxy = 1A676830180E9C110076BC67 /* PBXContainerItemProxy */; + }; + 1A676833180E9C110076BC67 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "chipmunk iOS"; + targetProxy = 1A676832180E9C110076BC67 /* PBXContainerItemProxy */; + }; + 1A676835180E9C110076BC67 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "CocosDenshion iOS"; + targetProxy = 1A676834180E9C110076BC67 /* PBXContainerItemProxy */; + }; + 1A676837180E9C110076BC67 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "jsbindings iOS"; + targetProxy = 1A676836180E9C110076BC67 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ @@ -771,7 +873,7 @@ 509D4AA817EBB24E00697056 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; + ALWAYS_SEARCH_USER_PATHS = YES; ARCHS = "$(ARCHS_STANDARD_64_BIT)"; COMBINE_HIDPI_IMAGES = YES; GCC_DYNAMIC_NO_PIC = NO; @@ -782,29 +884,14 @@ "$(inherited)", ); HEADER_SEARCH_PATHS = ( - "\"$(SRCROOT)/../../../cocos2dx\"", - "\"$(SRCROOT)/../../../cocos2dx/kazmath/include\"", - "$(SRCROOT)/../../../cocos2dx/platform/third_party/ios", - "\"$(SRCROOT)/../../../CocosDenshion/include\"", - "$(SRCROOT)/../../../cocos2dx/include", - "$(SRCROOT)/../../../cocos2dx/platform/mac", - "$(SRCROOT)/../../../external/chipmunk/include/chipmunk", - "$(SRCROOT)/../../../scripting/javascript/spidermonkey-mac/include", - "$(SRCROOT)/../../../scripting/auto-generated/js-bindings", - "$(SRCROOT)/../../../scripting/javascript/bindings", - "$(SRCROOT)/../../../extensions", + "$(inherited)", + "$(SRCROOT)/../../../cocos/2d/platform/mac", + "$(SRCROOT)/../../../external/spidermonkey/include/mac", + "$(SRCROOT)/../../../external/glfw3/include/mac", ); INFOPLIST_FILE = mac/Info.plist; - LIBRARY_SEARCH_PATHS = ( - "\"$(SRCROOT)/../../../scripting/javascript/spidermonkey-mac/lib\"", - "\"$(SRCROOT)/../../../cocos2dx/platform/third_party/mac/libraries\"", - "\"$(SRCROOT)/../../../external/libwebsockets/mac/lib\"", - ); - OTHER_LDFLAGS = ( - "-lxml2", - "-lz", - "-ljs_static", - ); + LIBRARY_SEARCH_PATHS = ""; + OTHER_LDFLAGS = ""; SDKROOT = macosx; }; name = Debug; @@ -812,7 +899,7 @@ 509D4AA917EBB24E00697056 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; + ALWAYS_SEARCH_USER_PATHS = YES; ARCHS = "$(ARCHS_STANDARD_64_BIT)"; COMBINE_HIDPI_IMAGES = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -822,29 +909,14 @@ "$(inherited)", ); HEADER_SEARCH_PATHS = ( - "\"$(SRCROOT)/../../../cocos2dx\"", - "\"$(SRCROOT)/../../../cocos2dx/kazmath/include\"", - "$(SRCROOT)/../../../cocos2dx/platform/third_party/ios", - "\"$(SRCROOT)/../../../CocosDenshion/include\"", - "$(SRCROOT)/../../../cocos2dx/include", - "$(SRCROOT)/../../../cocos2dx/platform/mac", - "$(SRCROOT)/../../../external/chipmunk/include/chipmunk", - "$(SRCROOT)/../../../scripting/javascript/spidermonkey-mac/include", - "$(SRCROOT)/../../../scripting/auto-generated/js-bindings", - "$(SRCROOT)/../../../scripting/javascript/bindings", - "$(SRCROOT)/../../../extensions", + "$(inherited)", + "$(SRCROOT)/../../../cocos/2d/platform/mac", + "$(SRCROOT)/../../../external/spidermonkey/include/mac", + "$(SRCROOT)/../../../external/glfw3/include/mac", ); INFOPLIST_FILE = mac/Info.plist; - LIBRARY_SEARCH_PATHS = ( - "\"$(SRCROOT)/../../../scripting/javascript/spidermonkey-mac/lib\"", - "\"$(SRCROOT)/../../../cocos2dx/platform/third_party/mac/libraries\"", - "\"$(SRCROOT)/../../../external/libwebsockets/mac/lib\"", - ); - OTHER_LDFLAGS = ( - "-lxml2", - "-lz", - "-ljs_static", - ); + LIBRARY_SEARCH_PATHS = ""; + OTHER_LDFLAGS = ""; SDKROOT = macosx; }; name = Release; @@ -868,10 +940,21 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = ( - "$(SRCROOT)/../../cocos2dx", - "$(SRCROOT)/../../cocos2dx/include", - "$(SRCROOT)/../../cocos2dx/platform/ios", - "$(SRCROOT)/../../scripting/javascript/spidermonkey-ios/include1", + "$(SRCROOT)/../../..", + "$(SRCROOT)/../../../cocos", + "$(SRCROOT)/../../../cocos/base", + "$(SRCROOT)/../../../cocos/physics", + "$(SRCROOT)/../../../cocos/math/kazmath/include", + "$(SRCROOT)/../../../cocos/2d", + "$(SRCROOT)/../../../cocos/gui", + "$(SRCROOT)/../../../cocos/network", + "$(SRCROOT)/../../../cocos/audio/include", + "$(SRCROOT)/../../../cocos/editor-support", + "$(SRCROOT)/../../../cocos/scripting/javascript/bindings", + "$(SRCROOT)/../../../cocos/scripting/auto-generated/js-bindings", + "$(SRCROOT)/../../../extensions", + "$(SRCROOT)/../../../external", + "$(SRCROOT)/../../../external/chipmunk/include/chipmunk", ); IPHONEOS_DEPLOYMENT_TARGET = 5.1; ONLY_ACTIVE_ARCH = YES; @@ -894,10 +977,21 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = ( - "$(SRCROOT)/../../cocos2dx", - "$(SRCROOT)/../../cocos2dx/include", - "$(SRCROOT)/../../cocos2dx/platform/ios", - "$(SRCROOT)/../../scripting/javascript/spidermonkey-ios/include1", + "$(SRCROOT)/../../..", + "$(SRCROOT)/../../../cocos", + "$(SRCROOT)/../../../cocos/base", + "$(SRCROOT)/../../../cocos/physics", + "$(SRCROOT)/../../../cocos/math/kazmath/include", + "$(SRCROOT)/../../../cocos/2d", + "$(SRCROOT)/../../../cocos/gui", + "$(SRCROOT)/../../../cocos/network", + "$(SRCROOT)/../../../cocos/audio/include", + "$(SRCROOT)/../../../cocos/editor-support", + "$(SRCROOT)/../../../cocos/scripting/javascript/bindings", + "$(SRCROOT)/../../../cocos/scripting/auto-generated/js-bindings", + "$(SRCROOT)/../../../extensions", + "$(SRCROOT)/../../../external", + "$(SRCROOT)/../../../external/chipmunk/include/chipmunk", ); IPHONEOS_DEPLOYMENT_TARGET = 5.1; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; @@ -909,7 +1003,7 @@ A92277011517C097001B78AA /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; + ALWAYS_SEARCH_USER_PATHS = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; COMPRESS_PNG_FILES = NO; GCC_DYNAMIC_NO_PIC = NO; @@ -920,30 +1014,15 @@ "$(inherited)", ); HEADER_SEARCH_PATHS = ( - "\"$(SRCROOT)/../../../cocos2dx\"", - "\"$(SRCROOT)/../../../cocos2dx/kazmath/include\"", - "$(SRCROOT)/../../../cocos2dx/platform/third_party/ios", - "\"$(SRCROOT)/../../../audio/include\"", - "$(SRCROOT)/../../../cocos2dx/include", - "$(SRCROOT)/../../../cocos2dx/platform/ios", - "$(SRCROOT)/../../../external/chipmunk/include/chipmunk", - "$(SRCROOT)/../../../scripting/javascript/spidermonkey-ios/include", - "$(SRCROOT)/../../../scripting/auto-generated/js-bindings", - "$(SRCROOT)/../../../scripting/javascript/bindings", - "$(SRCROOT)/../../../extensions", + "$(inherited)", + "$(SRCROOT)/../../../cocos/2d/platform/ios", + "$(SRCROOT)/../../../cocos/2d/platform/ios/Simulation", + "$(SRCROOT)/../../../external/spidermonkey/include/ios", ); INFOPLIST_FILE = ios/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 5.0; - LIBRARY_SEARCH_PATHS = ( - "\"$(SRCROOT)/../../../scripting/javascript/spidermonkey-ios/lib\"", - "\"$(SRCROOT)/../../../cocos2dx/platform/third_party/ios/libraries\"", - "\"$(SRCROOT)/../../../external/libwebsockets/ios/lib\"", - ); - OTHER_LDFLAGS = ( - "-lxml2", - "-lz", - "-ljs_static", - ); + LIBRARY_SEARCH_PATHS = ""; + OTHER_LDFLAGS = ""; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -952,7 +1031,7 @@ A92277021517C097001B78AA /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; + ALWAYS_SEARCH_USER_PATHS = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; COMPRESS_PNG_FILES = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -962,30 +1041,15 @@ "$(inherited)", ); HEADER_SEARCH_PATHS = ( - "\"$(SRCROOT)/../../../cocos2dx\"", - "\"$(SRCROOT)/../../../cocos2dx/kazmath/include\"", - "$(SRCROOT)/../../../cocos2dx/platform/third_party/ios", - "\"$(SRCROOT)/../../../audio/include\"", - "$(SRCROOT)/../../../cocos2dx/include", - "$(SRCROOT)/../../../cocos2dx/platform/ios", - "$(SRCROOT)/../../../external/chipmunk/include/chipmunk", - "$(SRCROOT)/../../../scripting/javascript/spidermonkey-ios/include", - "$(SRCROOT)/../../../scripting/auto-generated/js-bindings", - "$(SRCROOT)/../../../scripting/javascript/bindings", - "$(SRCROOT)/../../../extensions", + "$(inherited)", + "$(SRCROOT)/../../../cocos/2d/platform/ios", + "$(SRCROOT)/../../../cocos/2d/platform/ios/Simulation", + "$(SRCROOT)/../../../external/spidermonkey/include/ios", ); INFOPLIST_FILE = ios/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 5.0; - LIBRARY_SEARCH_PATHS = ( - "\"$(SRCROOT)/../../../scripting/javascript/spidermonkey-ios/lib\"", - "\"$(SRCROOT)/../../../cocos2dx/platform/third_party/ios/libraries\"", - "\"$(SRCROOT)/../../../external/libwebsockets/ios/lib\"", - ); - OTHER_LDFLAGS = ( - "-lxml2", - "-lz", - "-ljs_static", - ); + LIBRARY_SEARCH_PATHS = ""; + OTHER_LDFLAGS = ""; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; }; From 28de91d9650b072c2eecc806d0d2f953c0a1593b Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Wed, 16 Oct 2013 11:45:58 -0700 Subject: [PATCH 50/64] more Xcode fixes --- build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id | 2 +- build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id b/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id index 944c4d9bef..81b945434f 100644 --- a/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -81e5f8f3e9c025447f9dd4da9fba085d46f661d9 \ No newline at end of file +7658fe75258895d82e9432317ff63b182547bcdc \ No newline at end of file diff --git a/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id b/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id index ffe5f7bf0a..04a9dc0568 100644 --- a/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -d25068403b84374432b0ddaec0ab9c1e3a38c4ec \ No newline at end of file +f0ce606901bf2ba3acceae9e9562214dde6a4c69 \ No newline at end of file From 3cbeabc777d2e2d8841fea1959b1d6949c0fb518 Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Wed, 16 Oct 2013 11:55:14 -0700 Subject: [PATCH 51/64] Icons for test projects --- samples/Cpp/HelloCpp/proj.mac/Icon.icns | Bin 77152 -> 0 bytes .../HelloCpp/proj.mac/Icon.icns.REMOVED.git-id | 1 + samples/Cpp/SimpleGame/proj.mac/Icon.icns | Bin 77152 -> 0 bytes .../proj.mac/Icon.icns.REMOVED.git-id | 1 + .../TestCpp/proj.mac/Icon.icns.REMOVED.git-id | 2 +- .../Javascript/CocosDragonJS/proj.mac/Icon.icns | Bin 77152 -> 0 bytes .../proj.mac/Icon.icns.REMOVED.git-id | 1 + .../Javascript/CrystalCraze/proj.mac/Icon.icns | Bin 77152 -> 0 bytes .../proj.mac/Icon.icns.REMOVED.git-id | 1 + .../Javascript/MoonWarriors/proj.mac/Icon.icns | Bin 77152 -> 0 bytes .../proj.mac/Icon.icns.REMOVED.git-id | 1 + .../TestJavascript/proj.mac/Icon.icns | Bin 77152 -> 0 bytes .../proj.mac/Icon.icns.REMOVED.git-id | 1 + .../WatermelonWithMe/proj.mac/Icon.icns | Bin 77152 -> 0 bytes .../proj.mac/Icon.icns.REMOVED.git-id | 1 + samples/Lua/HelloLua/proj.mac/Icon.icns | Bin 77152 -> 0 bytes .../HelloLua/proj.mac/Icon.icns.REMOVED.git-id | 1 + samples/Lua/TestLua/proj.mac/Icon.icns | Bin 77152 -> 0 bytes .../TestLua/proj.mac/Icon.icns.REMOVED.git-id | 1 + 19 files changed, 10 insertions(+), 1 deletion(-) delete mode 100644 samples/Cpp/HelloCpp/proj.mac/Icon.icns create mode 100644 samples/Cpp/HelloCpp/proj.mac/Icon.icns.REMOVED.git-id delete mode 100644 samples/Cpp/SimpleGame/proj.mac/Icon.icns create mode 100644 samples/Cpp/SimpleGame/proj.mac/Icon.icns.REMOVED.git-id delete mode 100644 samples/Javascript/CocosDragonJS/proj.mac/Icon.icns create mode 100644 samples/Javascript/CocosDragonJS/proj.mac/Icon.icns.REMOVED.git-id delete mode 100644 samples/Javascript/CrystalCraze/proj.mac/Icon.icns create mode 100644 samples/Javascript/CrystalCraze/proj.mac/Icon.icns.REMOVED.git-id delete mode 100644 samples/Javascript/MoonWarriors/proj.mac/Icon.icns create mode 100644 samples/Javascript/MoonWarriors/proj.mac/Icon.icns.REMOVED.git-id delete mode 100644 samples/Javascript/TestJavascript/proj.mac/Icon.icns create mode 100644 samples/Javascript/TestJavascript/proj.mac/Icon.icns.REMOVED.git-id delete mode 100644 samples/Javascript/WatermelonWithMe/proj.mac/Icon.icns create mode 100644 samples/Javascript/WatermelonWithMe/proj.mac/Icon.icns.REMOVED.git-id delete mode 100644 samples/Lua/HelloLua/proj.mac/Icon.icns create mode 100644 samples/Lua/HelloLua/proj.mac/Icon.icns.REMOVED.git-id delete mode 100644 samples/Lua/TestLua/proj.mac/Icon.icns create mode 100644 samples/Lua/TestLua/proj.mac/Icon.icns.REMOVED.git-id diff --git a/samples/Cpp/HelloCpp/proj.mac/Icon.icns b/samples/Cpp/HelloCpp/proj.mac/Icon.icns deleted file mode 100644 index 285dee82b3d3f80acf3c0037b6b6ce35df0e9e5c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 77152 zcmeFZXIxat_Ab0T(TVPcCg&WwF((wvIgtbb0l@$Yf+$9U!rtBFj7Ss^6+xmXS&|aF z0l}Pe9`lUjIL3ZgHO@J6=AQq(U*1pmcR^-g*WPQbTD7Y7s%Jgb0ULvNVx+O_0(MTG zgkcnJ)SEEf@#a<*=Hn~`LW^;F@yiUYEQJKZ+=Qc z@;C=Ct#KBLYV?`;X4u#qA!fFSC$v=LaWrsMs`_?qirQk9g*k`KC#_sfo*6ckVr!*o zZp=~SaF|Yk>zo}H3pfV)h8!M;qew9xD=_6Vb+mO2tr;9eHk(9MpeQIQtLrF7eY@Q^ z*gw=Gx!N@-kqq=bywpD+8SEYKE4bA)B$W>Ib@aj2;qLifao4*CCDMUYOsqAiFMWCN%jT>Ly@S&1;^L0ra@nm@kJ?xIfsBN-+{E3|Q}16qt4&(a zE0u=FhN~T`t-ly|wK93@k*hsXK@kDts@odtvO3};Lz1ubcyISyU*j_;xh`qk@~sDM zbg%O9Se|Ku2@aZLMy?xr`t9vJCPy+o-5q`0S<5H1x7jaSJ$1Rm1aE(jaZ@J8*VowD ztypEb%*Vxf!R$$%1v#ZF?d?{s)HfMtF~)R}I3_)J%QCy=v#d4wn(CHzUVFtcI^W+s zc>Lh$-G}dPJ$?A-@q>5p--l1`J>FjX@zzuPQPjhm_a8pK|NQO}&%9snJbC!&(eUNF z_n+Mg2!9oF@b}wrbGP)um8V-Sd<74j_~qV{N6qIt?-FIQo2MSOuiW+ft*15h%@yJO zr{BMLTAR4!-lIoHYV!1t*VbQ>d!X^%ovh=DV{6(PkOQK&7rwodc!=<=@t&1bpEzcD z;IR+uZWGBd&gsYlW|-mXZTB8TMkFtaV6F9X+~C1lHvQJM$j~^irH&K90~4l9K7M5& zGBP}7?&9^US1+7BVb{5)zOcy1h<%fc$Cz1}t*tC?IFlK^KXikem9CM|%)rRQ<&`_9 zZwUU_irEm-6;R4qAKEDgNKR6pUcO zi4|y=nwmk2Kp?cVG9zc~KJ@A0HnK5DiV>(8n?Rd6TAqa1soPDmPp_InFv~cBhLMrH z$h-G^55C@ge>10SJ;t^W3v_jK zboC6hEjZJkJdZyA{Qi?0Pai%k%1v5i2y2-T7wBqf>*(mSjIsFN$|j$^bLGbM>sRlV zXNba<(6lpH0s{`0$K!JpBeUEw1&oTh7umyqY1ndmjG`(q7YJ~UE{~&%xgK=G z$P9gKcHSJ!kdBd-EHzayLlFS&TtyX%8L@+hX^g{GrL4rp^D&;|YIVN35!@l-Xe;u_ zt8hCIYJ_jurvX;Xa5JWvz>CS$47DoJ)OMeivR)A}M`9GJO8r(10XX${3KmkiERxI|!GV1AP~cRX;c@9hAgK6(j?_53WiF z#8S3ou;)q=lkLQ=2nP4T*{LSbziMC$2QA$sT{e|Jp?*5Pc<~Ro$ZmpJM-d6X7b*Gk5@7| zrI&h!K)hB(^{K{|_H&Z{p>}%Zy$0FmXKe+%rs2LpiCC&tQdW7guBr8G=dfY4?CG~J zf66*K5(Sm{O>Pc$>;35TiNBuFk!!BfRK76 zB&TQPrPT&ad-fD&?Y$>Ao;yME

DIFU*Fwvw&PsdsixNYgCbE#(d^=@ zJ&6K6Ah~Ftfg*`gDEL;`xDF3udR>IR^%=_YK^Ho4eNJ=Gw1X>6TP+ zygb&$dde)f{KfG%PUdrl2ma4r7&R@q;w%_w@9668%P~bN4VxFNLk^I( zNhJ1m_Rh{5v>Y;>FiJq5kxj16xFH`Bb>1o?gN7yu7DIbGJBJl(CmG>Ed{WA1ixsI0 zCd(o)m1S!*wl-HZHMiRnb~-Dac=r2OVl1l3{>|Y!Y&vPmnla-lj#gElZnVekbnTbB zOjPy_T0hTezrW{};0cpwIn3oH9xg{b~m7}?lNm@>u2#zb{P z%>KBzBosCdjv#ya;0|tjC)e=_%96 zWGYMBYRvTIuKs%?A!?Ei9a-YE0=Lsxv2@A2Su<^IY-Y_{xYXHe!(s{&-#&XB{fPbW>7BQy znd0}4?mvAH_lW%X!NVAI@xkp0{28}i-g)*Q_7UarjXU?nk2nvW-Fbdj?eu1zpWc1d!%hk<`2A`ox9#S=+j_b5_Ks5;Sx1>q3~h=`qR90iSO?gZ5*`tIFDhwv!sJWW)RR-!nIICZw*A z?G_f7meg8f3y0g}GdFvFO@C|6{upuE^o!3PJbv^jH@~>3a>|szzR{VRej3eOu{fk? zPQyEt9cN}0WY>%hPCeY3u_55+%w04uXlvoD;!h~QPD#s2tD5dyo13%Jarx?`%F>D$ zr>T=?x*b}4=vUMp6_=QicznfzlZSRLRcC5@z|36*Gk5xej48!m(GB95q_}*4n7M&y z=Bh>I?Um2m1yR;V&)x(BBcq~YQlc~>GFM?t1s>*7unglV(6G6|dX%td*B(9Gzdurp zXIR)}IbzhU1Ew%@Ctln@rp$9TG`)2B`mMVL`}gmQ3Qu)35CtkzGQJ5{q%E+PMPVvS zJ=DZE`mbERLG0Iw+(&5IMXtaU=_dRA!*zK~(i9KjjKOn*gCm#m{kr?2!eX7cn_%WT z?(_Ey3?4sersG_G#kr0i2prLV?WnN0@fz!WcL%w+FLQ#4yJ7(&zN49YKYsh)#_tc= z=YQ;K|I@p&@0GIu+=u^X`gm55Il;RVKz|Hb!GCUI{3!$~s9odZg zyctGgEXxHanuDPRdL^=KFgBk>F^&%kZw<9HXW#t4Pg0+yu-?A0)gOjk2)70`s^EXP_})d;9U zO9ncH6xP5lU!V*yivpcW##n0RX9Ofm3&OGrv{~wa<|#r<0msNn zrdBPe1-GmgC?N%Om&5?{sv{{ISXea)aA>I!@HiOBxZ`z*9!4Tz3~ftcqX08UO;zA8 zKFBZraX!kL0(()KmbtJ28VS%?w`^e^M&>2-Q1oM}D`tw|6dD2ueg@kbp1;SbZVMYN214Pm+Ei5esmWKqomO?WX zGDc=G$QToI|MW@rOG{N%>=ZH?g3Jgcn-XRs=!3{IPe8UZ<>MqRrD^U0jEyb2122S| z)fJUViz(m>wmxz-W-9u5d$zz>C^Y4hV1K-*XTJsX*t+{q+4oO9MJKBdE+K(~So#7O zOB@ss<_Z=T<`x#n`3D6i@Ei|1N?F+{TZ@g2+l0j;{OC!2$;pZXc5HZ(Z2)5=l0S%g zeNbR*!iN2~(uQH#g9%vH%MTOR$iB#ae7{~@SyPqch>!t}QMG_%VuG7SgEr*Sbb*=B zoC7WN&6i}qp4Q{v{UW;%bL9t2l8=2QRW+3dmtx>Ij!6|fXNtp!sW9_WU7xP+eA8U6#2VJVN4`354YW%$P7iwvKu+QJ^j~Q--Lc z?6~s{o}S2gfac|wFFyzw_w$9)6IC^32bWMFKDZVY0*bMTF+7fZL^79;F>VPl zNcN_z`D>Dl_pb4HWo1>>abgTerRiFh2}nl9IH<+{_9!7x)@Q+^)A~>j@m=<^>sJ}{ z7yA(-<9)ePQ4SI+5AT5~g)t4w1friti_LKGx7d;?5SVZ<1|}T*O30``WFMb@iI$Om z{D_t*ed;Q&0PU590V*((TvGrEG2vkW$E)xiz|qrU84ZBa zx9At8A5UseR8>@0mgTL{0y!!cfN)t@6bUGXMuvt2_~G9^WLsLQU>Hq1KhBj@R#sG2o+#X^54}<{7YYp&6pVymj=nx_ zK>X|(@)2&%GzI^V)X#kV_ATM7;+JoqWiL`RF!iE0KfVxOHNM}jI#zk2yu9LQfsZ;B zBl888np8}8j9e69AO=yR?iQIbv`~;FfB5z}@lVB1pZ}0Ong@Sd+?IVN{?z>XYy08y z(z3D>WqGNKAV_J3LOzD6SqcvcMEZo>B;+H)lnoG@5gTUu{HwB$NuM}>{P|IK*K|zL zUiHZ5-#_A?Xn%gYSWCH8ekPk zPmlO13mK*e@UR|@j2R`p`TFhy{u}md{BP>NetEsa@5-ld5AdK{U*G@s+lLSD&K4az zLL8+Y$&YrTM8iU0a!5eY)BQ`7n?zrKC<_T#nE!eZixLP_qyFg}SS!pIaYVZMN*3y9xeP7}d&W1DHidZi@( z_4ikAU*m7E*Ku#u-@g8>>C~UE-o1VG`QgaxH*ep(dH3tn#yoK`?Qj<1ijl-HltNh9 zaa}?#O9TT+7^|8X@nOBTd-VRzO8~K6zIyW-_8l>=)Ly)N^ZGTq^!jJRtG7di1)?Ha zao&NwW^|CoHU()SkT&Wy6c&6F4JrlGEPwz0=`YWpzxd^sH?Mw)f5H6aS<8&wN>siQ4|eu`lXNQN+=s>X(B*Xi{7mlsc; zJ$wG-}k?7%Bu$eXXW$q3bPZ!Cr~l24iA=afn}}$)5UcNT@lzt z7>EpUBUKc}lZ)Ozc?{o=p8s-YUD~r3kJFxDPsLAYkDos7%*+wx^78W1qc-YN#yi-M zF$H5wVU9qggL)^@rx+L-fFLzvF3ixim!ASQ^5D^<=Z_aFrQUn-Am<_V!PCLKOi>Om zJNIC8h0rHyYT>XlFbs6)7}+@c+Z8#Vin_LfKwi1 z-KRge`{de*w5)6*i<6y|DsnXO%kWWvS2J{pqOGN^jmstB`eZIk2RC3D8X76VTn{|| z>@I$XefR#;5>?D7;?~n!cjNBR?%us~`_A3iI|{cS+-^=ico1YB%svo1&j>%d6_$O5 zc`n$dg@bj-Q#5@ZNf|8^8hT8O#Ljwg^UkeXw{JY}oU4rKZM*XL#_fb#dgFD2bhtn7Q$=+NlO#g zB0wOntE8vLgSWb_zP=tC0wVO%E&M9y+LcG$Zj?O(6D`i)xpFP;D*f6uN!#U{SFXie zrCqss@pw`yk;Y5SIJjnd^uhG>b>JvPBo@~sX=#b&-8KNBBxOB)Z8}WN0}n4;y?pt~ z#ryfRt=Dggg|&AsUX8iTymINr%`id#?Tc4pF4HbuzgU%+jHf82CTAqr`KDzgXKn`> zbYqY!0&7Je)<{Z`*Ho!)SN_~M0&BR6_{Jce&vz2gyo`O?L>3kp}R8DcdT zuf$!TUcPWDA(2SpB_>DjNK8peN(+O{JypjN9H60rYl^@HgbrDcN5U~3MIDr)?j5;w zVPyEi(7k-s?0Z8Ou9W5WT^YU*J;FYJWu!`#6w-U+{Dooh2yOVna6@83Od>leF)=A6 zY7r!vd~>;2ktQJ*OX7l5Eeclw64avW(!s%j^MfNnd-^X93=Iu*OV39Sat4MZSEW95 z%&_f-bZ9^{h!0WDw~0=w8=WiQpkwOn8uFIkv<9DPamo(IXl?b-;ejj_p=A3MS2QjIGZ{y^h)u5rbN=) zCzYPd6i3I$Fk@qU)gY+!kW4~-)J$BP0~tE3t{_o6p-0+F^icYn+WLqdqBpunr@Oc7 zd`B2>O5q~K!xy^yx_f%Mr41*$CEd9qB3{gljtMe_w~)2~S*fOmtBd4za<#c&Argxj z=J$1Xi@L~X&vhqvanE(18)&mp7u`BMcVm5jH_^rDZ^*5Zb{!(3;zTS$934EF1&NrY z@Sp(yw=~#%U`FF%z%5VqwV&-EI`Ol~ow|VJ_cv(IX*nw`-+Z9I{cLCF+0Krv)Yk5z zsQpAN&Wa-Nka>_MsF;H^LXD8yrlh5XmM*7VurXTJ*w@R&^R_@9b@= z>1fA0Se@I~=tSkBegBQ9G6@qr?^jkyKT2xh#<;hYKe86)vEw1vmAyw8giI z+M-)IXWEjqhDLj5G}msrp{_n*ukQx zhtEsLnE$mElLsMguxKX*O;Y>|(cyww+SX5+0csTsSBbfUlLR@tqP7FadNmT_` z6~O?BHCS8{8CzV?-aJpY7_S%CaqF9#PaG77hejq8oNQ@4jn~oZ>l*S8G}oVwt>c}p z>!=lbxw$&Jcm?c@2-_bH*l`ZwB zPM?B*ryFb11Kn0GUADq$U07ai(`oz^?ewXVWA&%wPAN6kmnV2kojhUUq$zV(1%!t0 zCHAoP?%nQY4y%to5{~f+6%lxaQ0HkV!NqAwEw!y-7I7^#wfIT;sk)>4-Bzq}!`E=# zoL8-nK2mr3Zp-TDn1 zd^h-P&aNnrKf$diB{q0(@ZIP#XYO41htH@27}9#d*|y!?2)pRd2)raP+`!)&xvhcyH9t~q+_*wK=bV@FDl?OW@! zVg1HUn_cGHOr17!k$X_EzyGGFqOzEyn#W2GZuRpI2==wNF*h+2Oq{cL!Myo%XU+4* zgXvp0Iaz_jwUJkpaAlEPK3h#qT@e-_w-d!jit!_Q#lr+xte1aEnTp1-W;bb!9hX3_7*ULI+oA{ zLWuz9Q&jjW;3S3`2Ubjn;={$F!#YQbV|~|e+T!n^35zHRp%SopwcD~IFe2}$_%OS; zIAzWQ=dail6d1VC-W1XrT>$}`eT+vajXH{@s>XwuUwELX zumCSqEGWtk-LyF<&_NY;^dgLnbntAq?%9=CR6rE63yQKMcI{m&fcXw@Fr1`{>CIiS zc;V7@fm;IBuP`8y$oc|v*jc9vNW7maL@Ep=&^tBi@S!|BpOtqgGi1w_9WLq^B@UyL zD3ry!LicBh@|k%BiD99BdQ=iA7E=L1rpuNuS>mxdV6)FsSh_$i0dPo)0RNX*1sD<| zzr%S%j$(Fh%C_Jg{u5zkz(~>XgJU#?bLjp=Xk_K)#72a`(h6_)cua{oX2pu7E)Yjv z3sqsQH?Ty2RI)$>VhI>oT!jYd9c_65k;Oikl@+&rTj(MNJeq(3#=u-hhz`QlgE?t& zq01mgO~f=vnBsz!E1cGE+PG#mz%(pFgxr{$fzU(&iOUu7L?D;oGgK8}gEu|<;6Xf- zaqwXD&YjzY7%2tg(H8AZ$T*mpc_1q>CK!^{6ikgi*}=il$8Uq{bcipmvAMaKu8M}4 z7@!VABX;7F{>t?W}7395s5O0S#$!%j*H%IF_YcucIw3>hxQ)Tr738SBFDpur}K z5aUq?qO28gOo60iVr6Bj6oaXOXJ&eOInOq>oVv(;3QQ%Yo|);tkg+&$xrm2@0uBjw ztHC0WAB9J!3NU~I#F!x;LCjYCpIwL&MeWZZY#~X;6wCmU9%D+2#sEN3T;{cA(e#Bb zYu7I4!%D0s`Y9i`Oq9!4QRcx=Gw19Rp^_kxV?8QeO;;!s2!)0ai~tB6ihx>RO59>P zj?t9`Rs#5^9E|};tF*>*^(t34m(?zYpqQm+3iuX+TX74LrDc*lX81}<=oO$56cru; zNlW@>b+kOF>4FR^D}9hpC9ld4g{HU^X9mdUS|a(DJg}aO>2CCJTIKBQ;sQH7GNx)Y z3Ra2C$pBWRzyPT5cuI;WqMX7aLPPh2#UxnErE@LDf((R1QOvd<*t0im@BRb6EF4x9 zL&Az=M2o?cSaUbHIjnMYT(v?MRxFmT2``E2SB!OHSiOFS=Af6RzTaN5SDaN+6=(f$9RTvP!oAX1ZWwOtIFfT;)0p_?%lp)`}W=0n-$O-N*-tc zY|TzRv~7Dx$o6gF*khUpf}_khuB?Btnp=$P_or=B(gy0jDEjvx2s63E1Ml zIV;DS4d^zNLMBsaVA;&t6T$ugTebuQZVB3uSS!+o5u%XcElYt>QLqnmS+Hcu(q&U& zSAi)2f+3Q_qzF95&2nLJfsg?5&ej0jpWz#nRpDx(gx+;52!D%dm8Xdf0hhWm}Y3h!(=7Be}RD_6AA!$W_cU~MYL4tyZUeT^YdLF7++K3 zH(6k;r*CQHTG&;NuiHrY>1|r)v2L?>P)Kw9f7{i^JmSSKX2Z2Bl$|D zN&t{Hin5A~$-q-Q#F@{gL9i*#+pxjgXRVLV8V|n^JRvb^lZTg=kB_%ETymW|*L|J$ zdbfqMXU zlmIju#Uu$sk`Y8P4w8)vI9x?2RFN>%`5sah?&?dVkUDIP@!hdvYn(0?xT{qTDm_$z`x+(0uF`CVW9UKW3I=VHSRHP%I+?+ zr`j%c@o-&iJ!8faSEt$52{yPb#d@4B+(rf&e?fohr zi(HglS1-4jK7F3UGU(ilCCg@6+r-RZPKV!ZrcV)Sp)Qg+nh0teg%go1!ssxEtVjnf z3M}JA_RcQO;#Eq{tL9oyn>J&{G;8bWHq)nBPm8f8rcHHoS*Vdk6#%k1nO>>V8DOh#g+5>v3LF;h6xrcD}aWg=fv zFq$&)6Pg;uS&=ozII2tvhJILwXl1I&BEzDqprQeA z$*2)%+)+4@3=K;-d^RK$@H|7ycnmx+ZN{uQ(-J1)lXw%ygJLZu8fql7`2Zat1Ph^U zqYlLlO5{UJ5y6tKVJsvj&?ZhCKYqga*a`IUa417xodZo&Do0iQU(fzEuw+96ZV9k# z*$kRoIYw62w-8#59XEc$1o1e=*s)fYCi)u6kaN+=bgqi33c`DEFaTggG#aS?IP?JH z7H|kfCYuG{K&eHPTOqiDuB57CXo8YvNTiGn^)!{(Xm^BGaWaj`Q&NJg4>m%upChUN zg!@Ki68ab`3nZ$rfuRc$nJgxQ$z;$O3N)0O5hMdNZ(xCD{C&3lOV(PzTkr)h| zPRNB(DDbYqVZ(xxXk-eNN~7TlnshK8Nrk>cdI~<}^HmX-`Cs@c8~Sa??R?8nW$+YJ zVV4rg>x!u8)#T4-_p5@ z=_n}6?Nx%2hoNG!Mu&<4{ROMVP<@C6p(JE1PRGEbWN-m4_W=(@00aQ+w?%S$`M~ei z);8o@VJ$LVrwK!asmx7}Zx4I>rPU3M@r57~nc8mjj6; zu1rNy&KCigGb&0=TT{(S#o)@1KV`>cU;cbG4WlWkakq6E&z z<*3IfiiNzSuC1vH$F)BG{{6SlKYja~M=WWOW++IQLK&$6%2J1}Jyw;56~@z1Td{2>)Jbpi$(jvc6LsTg1_&txyp zBfbp>m4M&=D*N`e3r=Yblt@VuNegh}`v-auBknsPV|`MRnK~N5cFeH+r{sluIt3}EI zqWob02-M#@Zrtu2I3Z<82BZT`CgTh121d?EIRgXI!QKmh%KHB78Xg)blPUrtf4+Ss zOJ(DUuED`G!0#Uz>3S#oZD{yXrIg)&z5`dqm>PIn?_i6RJs`PwvH#C+z2`6V50oRa z{<$n2jEXUr7xsZxNu!h|89IONcPTzlDOHvX_SKp|0*-OU2Q&dgUm|G$ONWOf{R0;z zaD&o-w8sMWMX<1II2XXFxPb;K9onV6{pTgsQstq3dq^E=bQ%?#?AI;@Z`Ml{1_vbF zebW9aDPMBFD<0qzAoVbz3}Jr?1lOa2g0!o*_)F8rQ~)3g~TAuEa)AokZOU5Q+4$q1Zo7xTR&|8BMwMS2Zl~N0Rr$3hSB4O zBjr8!leNi;*qkH1gXL0f5K?=puCBfTq#!Z!K?PgD>1k36$&eHXUNlT;Vv!?^{HMX=c7sMo37zaZl8E#qwtf&9NTT=Rbv9!Fr z=KQNzIuqmA!5N_AFwRnGIY9E&HK^O*KnMo#Ac}MO>;XGtrOLzg9ss`oCy_~Yl*m+4 zb?289J{alR1t(V|N2SIf@kBYm{QvGc3NVN-7+dIiFSs&V${cFn1yk!E{3ibQdu0_> zCACi;?Promygi-6{R2m(HXyMKv05stLFOsccNBBTOu3yX=HR#zR4WJila(Oi=3V<6 z^+_2~pQ?`6y}Ij)AgQ!2sD(PE&bQ4OK41 zIRBk9b)vGO>d3%{GiD^1L=ERfQqs`iA?YNLeDoN|E(I?GBMZU-M32V)XgGkIyI~RS zaE1j#|9@suRaTuSx%g-9IEa4F4g$`6wVWN0E2 z?}QNU>Goz*sQ-;$r3L&da7yXP+ux#@;I|#pfx*6!ki?DRYr!B(-#xddjw|{W1w19I}3S7prmbbrcgLybJ2Tq)I*|@_Boh#J` z*#!kf$oOL=P_jV-3lW1ROFdc|@G~4_eBClwjs6=Gi~PsAV|b-Xd1=@0ZMFa{d9@5k z@=Z7e7bF8Ya^d;;1%+Vyk)z1@KfMpW0q-|7;?0U@&U7}o!qWafu(Py)omEnCqP+CT z;Fl9)m>ADpGO$M#i@(wj;>UvRd3lEl3XuXdyl8Ys1OBh|qq(I%&II~A%Gu)l2WRUu z{-@SY($=1(^_(19Xwavnw*cW6X1kS(}BfV#(ZH-^{=KaZrtIw{S{%FfBnKU7cv9e@!=@m~gE2I3+9Po1t$(gU%Xo8(Nd;9FmR{fp^E9OV@sef%~TfPdH>kuaC4!5q2h%*=yXV0#`&FFbs> z_$V^ItPGq3%i_tC^+nF$bVUDp_crmJ##=e{>)elD-+q0F|Bd=3DrV%J`SQ?|Lcw5< zN9BhPO9ry!;hvEJ^0RV~`+pAa(GsB6$=zR5)gT6tOey-;4=>?l`5XK->CKzy*XnOx z|Jr!!)62JSUjF%D7_Ps5{pLLo!idB4!o&I3K9nMy5>m5GgZ-dH2<}Nu%Q%pkiMjz! zk`Hn*ic;jG%F3E!ez4ZsJpgg|D+=O?#l7OZ{^jLcIL8hrmS4Sj1=snnU%nYAJXBa% zR8W*v{`%PxKrvyF%D=P@WbQBi(sFOb7EPrQ8#Rp2xkQAodvkf-Gl`(SCXU_GWpG=n$_kty}iM7KQ23|%(bJ(j+d5~6*)o=9AEwN{OQvt&qnEFFP_Ff!=8$s;ZKQYw5LyB-mlBV z^HlP43)0J8yxXXVDd_|3U_0192-(PFke`^8oRX53egG*zu_X6X5iCV8+?87mXyi$S z@1Hz+{P6L^r!RnJ_VjuBBMeU0QJ*~OKqNDz?5ytZ=jUM)+!iQc1{K}sL99B6O-M+B zauN6+EQcVK&jGwh8)EeMk!tkb_{lnZ`0&}oMM`ORUp&ZuNPG0)=}>Mak)xcQn|AE+ z=SY?}0v&nOO%57Gl0R5cY?%r(iT@&WjtjZr;3g z{n<}$+N0~Y5^j=j-MtlmlY0AhcX~RJp`4zXl6%?9ETQa>4+S$ThI7IPq-Nj{ktjMQ zHa0#H+yaA$!X$4AW)yNbzaY<79m5=2pIjrZvv1wXkn_|o-M<3-G=*!|Ze71|?OH7S zc55geXwPAIgbq6U>KhU%nQ5m44;gwf?qCH?9D2?b?-_7fO;usr;0*OqXfmY@)u5 zNyBV9hG2)5F3;>EqX5&Q}fKui5~}~{)`7BS1w(;eBmC@*sk3W z2~Xa>csb@0^YX>(H$nxy@;_)7uZ>hCB;hH1D0(KW+?ad-uR3i{!>no`Ng3@2oKTCx zMItdGWuXvCPRUpXGtFR2);1H2WL{UqEp5col!{`p*B3(zv49{He9}*AXgVdqc#Mn4-JTD<0f-|bInM1** z*2C&Nsw6b@ry87y#$$A#N2#!%L5c7U_edp&bQP=={n{^di~H!^u!%i;KqQWhRusqW zuIOIK!Sr$=-5r&`Yj@~gc_&7P1ym$1L_I*|Ded@fNe|IY>1%B56?Nl1(cQXTJ?Dnn zfgo3~NU><7s~2_-UH$bnU6QUG0*8{XA`!FuNY@SnOed~u05qUPcIVFBd-jHg;Sr>L zkvOgdL!Yn!JcNKypv(21Bf4nk&OvT}E~$%iuKTRC)mELjSu|(k>3*V%d9JrEyFzj< zACHO!6imD~``jTRrXA5Sm;w7csWc>H*DksAaNvZ=M>}=_EJDU|_FPS0TW1H}iOGMG z5QDD0uU>mjbEl+i^MSrLpwD%7wjWGxIae69ACHM*M-pN29i3A#4gcn$40#M~581I} z=PqP@7@XeZL*T|NfHm0(KIKSZX_vwqbRJP zvnVnGQQ*SyGgoaf6_-=Pqe8a^L&*@Njygpd>=w_5HNvj|G3y$;np@+~h+3o1Fk9N1 z`tlaUcekFw+prem46C)Jqbxk8`e;SR|H=Gy5k?M>0my09&6Mtiho*r~Ok-CEO``tFpCRcD&uQgkz`v7?#@ z%`Dg-8W9#7!4BWm@Om-EHYvH-4=Nbo?=68_w+3&+cW5B5>^62g z-B#BqZs0c7H=Jo}hMj$DTQh9U@dj4Y>9(}cX1Lxk+TK!~6edmy4~GxV2@Au+i7-}3 z?XN2_CcWr#A1E>eMNmsbnqUB+KYL*S_U*F=>i^H55krn*zHrwvb?Zm$)4xH#K6t=YUcA{1;54c)spxcZ$pWMf%Z`v%kG zlWVj8mcT%8n_LefxP^zUf};wvGTIt)%vLnj)e@()YELy(CHvVgm@{YI68BwMH4Ud= zPhMMFa-=TylyPlsV_jM7YN#~`t;X3p`iF*t^MNY2wes~2sI_NYMw(EdZrbc05CEz` z7sM2b*}Wc`7&axT`Q({U^VsIMDD*fwI;~peuzX{7bv0f^sjjZ7imqf0(&S5K=Y)lx^7P>jym>RR>|cW7kf96O632tFf%A z>d4ytH76j+J{GuaC1`PWCRQ_CS35iSWRzC|r_QvzvNY7$!FBagYp9q_pKfhEZQ@j~ z9Xms|hxi|R6mJN6;Psj&M^)Bu*tiiXf~W`#LZh`aWE)^I=~Gv1*}gT{ujqCR=!%AvJ54$V zbfK#2`i;K6en=Y%jP1dD#)B^Js^VjiwH`ZqQJP0T=#q(4;-FnM^cUF+=) z>xB1^lcW*ojnt7@n4^RWi!yU5{A0^0I^Ay>qG2P7y_Sl>*Wyw zu^6<~38-NU(hCmdlG&X<^#7i|5Um@8!Q~UG4=pNPSa>&i2BaRSI|;!q0%t3i`mCKI@>!5AO8e65wTu zVUzb4=H=kItem{GE%50n4r&-B9_oga`N1J!2l9wqW=?)wNXR-J*g3{RsY%Od!Qut; zT>SjjHbI_iV#&FoNCpJfv#XLyt4E&21sKXF0S-ik;qwl($9vfifG0v3Yp7zc&jm_ueNOG*aL#v!!R=dKqfr+_xtq+$c0Txu~sjE9oTu+z@5SV_BMifkK zV|p4&c9Zas@Cg_crOnAu6=k9lEM0+0qAnrgQenpypR@@+V~VQ4fCeZ`1HXpA41v0_ z*v`?*c~3#GE*!ZLsDmq3G;DuiHTfI`vWiDK9y=y3Uc8b{Ve{1V;OwnXU!4b)2DyI5R3}$Y zdvT5-3R~al(a|x{ z;(gooAvpvYG?t34r7~5Gs%&YX!lGfz4v1qQ@r_!jK;vncm??1BG&oJjV?aF|`l~R} z$=%I8F@+855xi^7V;j%>gpUy-jY>(dJ+>Fwg~J;aUUVqX(HqFqXO#dBr+JFwU`K_E zqjni0-;<~eo{pvI+SJkm8>}o1xr&(00V0|pQufcJF*QsqCx;zA95&g~RGm$O&V%yF ztJk=>Z}rAB$C&{-NM2K22N|3kx|f$s01}5)!#>(BR33XUn@1`4Uh`pbFu=u;INCVw zlaD)@#!@x2aBlk|`#i8}f(2>kP{>E{oavy zyannunWm^VMnCWM*U#TR70t2GRK{#FBO>=jq(s_MIVJ+PXEHb({nTrmAs?I$sudTx zyDhMu>)`1Llx+%i+v$^#-NE4v)N_RKB9ywf*FMgU3aXt};Vv7%>0V9(;9brRiwc7? z9Q!k-j4I}7j-Ajg`}XDg*Q={dbd<5V*^u3aC5RVMl?}&dyho?9-)BrQP(wTrV1>J^ zadvcZUFGa*0fTRwR96G|AOPejS;kxG@)A>bw|%@FAB{FdJDTjSGvP^%!2Nir_nv*p z8-RfgJ9Dn)IIH#_-@g9%^MbR9E{EovwFmf=;`miGC8G&RZ+?9J`r~!#WW%3&wb!{p z>^eHRIA{W4CAb{0XL;=hP=9$%1rGy}cdE+nn*$0c(~6{Ks|J8@hY<&b^}O zDWI23y-~ z|K^91J61PJ{AyFB9PM4FviHyEv^jF4E9{myyXsOf zwsS6Ii|7nDczCpsSb#_WFY#V~N28CvZDbdyS$C~PDn^+mB@fe7BY3}K^V(E&-E^BRIxiO3ZTpHkJ zgqNd2ncTHd%7FqD=+gtQ!kW2A9b$EH$kw2stpQO(U@NQZ;s$EEDm*fC@8SIc zfm?%s%$a$32~AN&9oOgRX{vIWRCrF)ar25L_);S;2NZ>y^Nz_Y81j-=Rn=$(5mhi+ zTI@6JEJ2;4F_>lI5#k@XC2&(}`aeL9@`?s3_JFd<_V$hr^C1_) zW^LKB*&leA8JX6=TvhvBt5IDB+w7F!1ubiDnc8h5Uhzzh61$FR|c$_yJ+D& zXP+6cyE9!9BYm_)?90i|8I{I46aua&bjm#gO6$5uu8p=pZvl z(bup5NV61qqCizJydlu@aFvrYx3;yhPP1aNvDR0Vm)9^c0PIvj&p<^^F-t*GUPemWYOm=Q2tj&X zY<4ExJRMM zB?Ac_g#6k@o7nt-;IHuHKoWD_Bf^Witd zH4RLlxgxcxshNd=yp*(bstk#=bec?xw2X|jjH0QZ{chl#Njc5p37K-DQjt$o6G~xd zkU{=Y=~`iE3UhN~na%J#Mo-Qrt^{#sVq$7)Y^;(cg^^B|5|Ne^moapAm8B;mA&31k z7J9>>94yN7BZq)L2);(zB9wqpfiR;fqE-$<{JcE<-$_t>vQ8XA86T6^@6mF~nAzGu z$)~6Hp1_dssMt6#hV&1VXD5mi#J~h;v=UcMYG7_rY8Gf}Vr*onr=z6_)VUG_wv3Df zxQvq)?h=qe5(?TaJ9Y_6NJ)tBb28FUQ^0d1{4Euepo)g3u7Rvu3 zxCFHLX>cMyOcBm8;^t6Zb)eGK%(BRAhbc@9)jDdb13|98^C2<1C|N) z2AGeike~n`?~d)9+t^rHpt&(T_ojd^Q%Q6P!9qbz%fQUa&bgh34;chJTvb!Y(8S!@ z-pSp2Pe5p7%zkV#tQtBqvj{sCC~&3a`STx)tW7Pz;4Tvs7@AO3i{>RIE-C{4x5S1GBXBk~sLr4052c8fyjD5|Jy1JZ6`>)`C}vo|m_A_nEX zlQuRP!d{SHSbQMkMa-h2laZxqzL@}V(I6NhL?B@+1i4^CMi1%QS<4Y(Bgczkf^9QtRCzl>RLJm zM#Qjmhp-F|jU-4O@$m%Ni5N1Oxmks&RV^R>}#&%n^c6dp%y9h_X;Js_V;$gc*6p|mkU8;Jwm0;xsGsTt`d$;nTDuB}(E zuYGy%Af#<+XKsOma{*^gYGwurjTBRy@g~?<43J?x-4s2XE>4e2SKq)Go+seO9iFz~ zu3{s*if&{B0&&3(@CE-$W8Tmn_fGfZK2F>|Cug?xm=xbWSmTuNW zFjQ#9PJEU`c|TO!4!2#9i}rz}w?8gG1fB|zMggt@Wd}w~NJ>tPkNeOPvJTx0QA5LT z-`Ce(j_O#On46!4O9kBGTiX(|P%bVww_T8gf*c|-uZej2s(f?iyd(8KV@^4t<`p$$*6u!sZ3 zp$AX3ur#;u{RjG0+BF#G=hF1b(#o@?wnfV2CH&&z!a~m?^~$rwmD!cGpV0b>dTnuL z^~EZFe!dk?F?;*Y%ED|fo^>9-^kQXx5gt$1SMRMa&nzzE=N1-P!2UeGC+0YC8}mJQ zmIe5&rN#LLcy+@3vow%&j~s*@~gzC?1<$?8VbAK>tgF7rd!ralRW*0fVi~d`($6hG(8%oE-#?8LEQhV~6Kwm*DVD zqeEU@UYJ{erpw3hj0^ZFBqG3F7l(V-^Vx-kGhlyybqPNUOvh3D7HAv1H0uDDRs!v; z9QkkoynhByxwtStGl!q+03*wj2e$+5EJC229d4{F&!53lEiU4xr{`v8ar1}qEb~h< zSA{lc=S`GUAtxU_g#)1hcTGK+o|&1Qn?HhQS;Wu6BO(uxcBZ8eJ2KJbrOuvL2GL|015R5Qt}1+rinTB6O&~jJpPX7cMwsU4z5CE{ z2)akpZX7op`22hso^Juadcz-4&-(u~Q~ZZ|-bA8vVrJY3%A7L32B zXA(#(SoO~>&L1Mo?arNHI5L>ueHe{!WD{^;)3{mKk8<#$3;5*`7wZ2Od*0+eGP^Y2 zhNpz%yLJ1{ZQNbVDDEE9eOPz!+2akL!69bh*%$CDclSaq_kV*ulQ1}p&%@5g3qwLh z!tFbE2p+r-E<_74J~=TtHI2e>c0Lo&v~tTAZg>B|o_|9B#{V08_I$DmTT?Tv8jLuE z7-Tf}5pd;izC@=G^5uLge$&!}G&slpFYuY=ckmg*lrg?Kw*coGITQK7>K%7e^m2&Q}w>-G2plbsG|)2quPy?*JJ^@c9E2#*cAN=%#0; z0_e&AN91!Vx{5u;)hy309Kh3qCCGULnvJx(K^#bT8>b0G3WOgTesXg5QL7-h{J$rk zb&t+3Pd(B09iLk~0NwrZcwl7c2&Dxu`VhDW`h8Im{WJCe_lO>iK5PqD!T$;Q95A{# ze|-1mF1Y+v5!`YSdQ7oF!k#FW5KwzUn4>tyJ)nE^@X3e|G_v>~lFv*&_=R*fO!cd| zMdI+l-1G?$N?xE}7aaaS2GEuSfjLqm1pCkbjC>};?CyH*iNPdJ;x~@|Jn%OHkOK$r z1MY+t7sVzDO>oftvHMT@_2~aU$Y)0DYryTv9Dh2$P>B}-*CQ?I0@NZ9W&kBezgB=4 z{P)N1q=Vo8$K*4k&n^@J@HT-;v{mAX)cr-m_{8ubR6D>56Ssu6otO>sIsYB&+i%Y! z_B{LoO)f(xzx{?jGd2>@XEFl%?9smfgVVy`XE(Hoi?~bMQOOZ3Fw#QNse5~Pc&yhG zPC@mR&#zv;%6rX^&}Z8LBKq9^Ti46RrpCtK;b+!t*b^%Vfz#cM>)AytFY4P^00@8L z={0<7tO{zF0Dk`P?Bzf3Gs8>N4U+&rf1SJg;w3=QWC(u7)l)arHPk%%@QZ%l2RE%1 zgjqmxoLKsUyTD2G6Ra~qR)p8N3}1=`7S3$`^}p!n?B{e(p8-=%grA=g;pbNXKSR>0 zuA%ZD_}S_D++qc~|HA{DM5sD}DxQlMFW@dw5`*bFZjk=w&}hMq{|bIiStUW8GdI}h zlp4l^wZ#BGBee-KB_jEFn1L*ePf$)kDFVR;v=dap1Y!|kIj#*2p7($WSVAw&#U;2K zCiK!=T}lV|83+HSE|V<5f4G*Go&y051b$6*UC{;s&CNuK(OiVfav5PUPITc;QbQgb zvpbNwJ}nTKtS)jJhcqNqGJbv z0v$eaV8Xd@5sKcBgRb|Fm_jW7BB1drcp#vm?*P4q}L}7ratYM<{l>cBx$qL-~txqI}p%Jm0fwwT0TIP44E8W>9Is?~Aa1l@m1 zKyy5qx>^i;eQ9Y)c|p|%0!@w)J_E1NE5!@IVG|Vw$j75{91z;hp6PSI2;~f1xO^cV zXd#P>{}F+nLkKhl5rNJer+EBmYPh;ErG%xpw5U8^!Mu`yKr_WYUV&SUV#56kC_o@$ zfOAl}5;*6~nLZ~B#^q%1w*1_MnA4D?8AUSVnxQ*pVi zTv`>8f!2Ps1h+`VgjL;86$phnxGp{jn_g!OIaOHC`NK-UKtn4}#6aJh+hCxfmFGVU z^w5*hvGn_tWA`2rdwCKeXy1Y|T*qm1N{sY1{QLrOfk9tF>3)J<2P+M8=>aPk!Su7) zq8L*7?iuLp2@v#vCqU4sv*-Q$_tHl)?ciISZX;Fc?uMVJgg)x<@zfK<7`yKo5@MZj;>_7`j8~ z{CV@iE$IBoePR5@om=U*Dem04n3o9*G$sd^MVp)4jTmUvn{ba=OgMoXAyZFK0gwcU zG{DX?$OwU6pf@=C2;NG0V}pT)54VSJ-bjZ+<(osqR-i{l;oIniV>fTy?k`HuOv_?G zs7UVquFKm=FoKsLzKZcX!DmpngOnJe6oYiRj?>5tVuCPik(ckL4w9qJptn*6Nv>bd z8l=5`>t^kCDlxh}mqxFp4pIa2bmInU44Roim!2JS3}Mi`$KZ{W#ptmMUsng6=!g>` z#PP9XC+%Q#7#sBoy?WzUpU~86FnY!{uB)g~XabRg-e?qh^~HAUkcpc0ce`|lnVervv~}yz-f#;ao_;%AT?Ao z5e^wTax=6YvxPy41a!~U-VFkpo=8CFT)S}o;-$U|h=4wSxjiAHqd7StDGN&*AK$Z} ziDA;Z1h-N}gcw1(2B8cNjf{f7^_UF|Odz03&LaYP2W;2C&j7%KE|rKi=sAD-T7ggJ zMfCApZ|b?tXD@Z2KBGx-iSgLP#DtVYx`c#i1VYmb_dcHkOX&JSD9J)<5~x17MkcV; z?g9XX>7nbe@`1FGK{aE0j$Ha9l4wC-gjV$hnL4G4p#@9AkP!tRTVNw4ngJ$n*& ziV8rP4GfwAVbG~gHdbbqPJS_o`(sk#=nw_{#sl`_!>?z+2ujnGp&B9NIwY&&>UT9X zHHAP?%mxL0?li)kPj;O=+nMKMs-dc;uICU{c>-FUc2S%}81%{XE*AI+0thWG0 zu9Ho1rkeUDIP=Y>h6avFbtg~4E_wXe(G%&%*-jik0WfrsnW6-=sF9Tx7glqRh>ea$ zF!Yh9`&mgbwNHP!57j>rl|K}698eNgmj?X_cjI~hh7Pc(JK53M(b-kEN7DekwQV!d z3Z@2Lz(T{z20D*-q<69b(9njpHa6Fm1t}Ah9%(TdtH|gm+&-GXL(7PTu7VrwBEpR} zlI;kp6e6B3tpuKFKYR$`&_~;kw1t~k*Z_5%Vn;*BDLdG@BOJP&{77qpqaDr(V~SHEg{*ms z0+Y0gZ$v~`_}-?u%pJeXNP-z8=pikVAXcME)l}80Lge_KY;A*WxUIFdy}j7M)ZPZv zZx?r*Cyke<8{n1>fd`MaX0*|?9&Sx@advZY@wCHfk|ViC8K=l7V;mF_9J;4rIvs3P zz};mLUIT1__65Q?K~F`(US-w6$`(y{X!Gc70_?iAwWaw`ON_NGfOT%}CaN+LQu6BN z-oEbcE^)Q(&1o$x&CPA4zOEjgzAgqbJ9&5oM3pqva4L-Q%C4ayA-;8wv2cr1hDUJ$ zIZ^ztsykdUBd`llUwNRS$qa22?F~(7joX^by=+{Z+&!!%Iq47{v6)NKG5}DF4EUyC zQv(puu08?Yx_nzv-!gJ~w%uxQS|}@;1%w9p)ILH)bk*V%ZoYt!&LC=FgrYEXgNAhI z8c(?GvuLQVPp#u@sK+@wx_WvV!f$~niT;CO*YgSRimGf(ucK+m-m^E@j(|hsfb!i+ zxm{5k1WtY55Pz?lhyDy?nA&A{kKSAXAuodj(v5;b@MRe+T;+jK=vb{&Qnx`vSBJZ} zd3!^9X95ikm$%LGz9GRGbp#r^t}H4j)Q%qjNzfHJLF(gB(bZ7bat-tY8rqSZ64SIg zF*`FmKR2ICFb66r7(`g>h87MRNwPdCMmA}KhCW#0@8KO_1_V$Rh8oaK&ET-OG9nJ0 z85ZUauQJ%cp|y3jH0}26@u<413juayWnyL{Ih9TDVLFJGMA03YLSa%?T3|>DICMP_ z&$LxJdwl}j#gL@?i-x8$4~x#MN~xf!sz{Cq_y>m;0)^AU+t>5JbrpE?%?bSDsj1mH zLVg@lc4%V6KnowEnhIDws7g%r+Y_qs4-f4ai-o@~hgdA@a~_`g(|mK6p+B!=Qe4?(yWqk^Fz`cS*92!HKLc)q6*9=W5C@m=|F3ZCD{YM&F($K)v!`<&7(9m0)dmoRF z9tuvrKRX3WHJ3q1F{I#-Im7{EL4hK{hlLdZ@YuO4d4q;d3X3oY$SxJb0X_SmyAnAF zq9i07t{K_I2#C&#)CTn*M@|XfAcs{W0@23CrtZ#RHIT+<@hnKRu@Mk&8k-^H;b&2@ zQW)k5!fXnGnIJ46vRznM7AXa<7W649Mt{spj);>$Kr}fi1qBrij*bm+&m`n}NdzD| zC);NOh=xW~G?f1WqV-J7-E3p)!niP00+K+DVeCerHWa17k%*Ck=K?N+1s3D?K}8bEj)@lTt+bL8`*mRLg!9N2Y@Fz6&Fufa#9Lf zRzXpxOYka!XFm6hxCI1u|HIzwy=D zkF`&&y22bx7^SkrWNczSR+(%wzqtGA`j55s6>n)imQ4^VzffomOIH_5K%ptqM(>P5 zQW=>hWZcoB&rHu|V>OU`PS{s6GIIB8q7Jn2xcJ0`1Z=Sk(Jljrq}1qGIVn2i%=|J{Z&KEU-W*We$&SntL1-&Gd!Xre!&OPY_1suYMh*xxDCg1ffIu?{h*~}V0pFRh zmEOrhM4;8(5dsbE>Jb8M*fETLj`C!>Nh zN6I3$ILSg*bjKzDpkq+AYDiv+1SN}rq|Dx&+`Y1rd~9?eTmk^?fdFVj8~g2K7zUrS zHwSS;%)bN{5CI{Y#*l980e_}r+PVW?qrQWciF8v;9Tt_y1&8>T)f-UIv$FH-+{wei z$^h#J__GB8f93)FnGD032xUO1oe?oj4{7KPISmw~a_kmZz$8=_!0!?n5EKx+x1b2h zg>e)N2r&X6hY{%K>f*hD0k}YcAiwx}L_aeyv9O@6A1-_tMgvbveSJe6Cu?44Htc-v z>Sf#j4M7tiB)#w8hA9cc<=BG?tQqV!fxKW#Eief1=DmB0OXUB>KGOpapbC|dfQ&%> zpI?Ai*0E%`iV>O!Zotp}*4hSoTDG1_u)m9(IFGwb1<3(|eucY1OVGv$`osOPDlBVq ziWXe0Sqy@}%wC_s;#ONhxI=*3Mc4!cfPKb#?)8OwJot}~Z%KC!f}gjNvT@snIqK+W zYnlWj_?gn{+$EGZ#`QB3%peDXOoki?0aA(GnV6i26^Hq3x83UtuSW0$__@JbdN&Wi z&%(9`FC4;pc&GS?`?@>2?{Nz#JDF-GK!l%#oT7e%pUE~mUF?MidP1UoU;uZO9%b}V z_!IT4YU~c2#TMAFckT7^_VDs_^^B`IbG$q;G%D|K&)Mb}XSY-@4R0$ecOOqTA3&eu z_Sl=4ItA^IbT`yc)l$=sv_M_YEjxQI5IZsTAz6j!I4H#@#{5V%c2i=UHk=sb3Z6hd z+j}}Ygrt`@9_c*M(Nvoi=nin^YqqqC!>o`$ljhPu2_pdI2)q%)7>y2(+d0&?!m8#>PK zD^!h@OiD=cMenp@Hgt1!0`%G0$<7)cF>Os$4eXs=oSmFq?R6Bj>|C8~5%>(nwkZnY zipoGf%NqE3z;hVsrpV)vDMva8Os5wF1VV`o=s5(r5d^_oHCXzj7(4WaH5M&LCn&JO z+0!`KJ3!Tqp@N3FJ>LDT}Ho$y@BT1at+%>DP3I*dvUX zG6#`jLp~TlCLjQA)?(>!@#YBi1@hV6-Y&zI+1?t+XMJl28(koub!{!x^E>l|tpcJU$vGC_|bsA;v>&56m;YBb`6jvxUtePST-+Msf-a-3KBm(uL5{)}w(Fbm0w>@ID_2Ekn~3V9_Wo3>BnhrKMA3Nn~Ww zWK(5!Ny{pm`Z)+wLIDS#Z{y)3kYVT`wDcnQ1ErZz)PQ_R1!nt2=ZE^?M>V#3Cvm zP^Uwz4uWQ9XdOXoYQVAsJR9f1k8Toye3k<8SxsBd&_q{GJXexkN>WrrLdVSuq0g{v z3aPbit*G#!9e0G2&_V8BGSG&rHzdnO>{b{y-d_`HMIkcSd4#2HyYy&-_i_pajl&gRB(YxFaPX~2aOi~J# zG{Rmmg@g`6&dMt!1}Lu>kk2?VQedEQ!fGOt%KBDzX4=vO_?bdBsEClYgd{G}1fg^Z zDntlnFT}+puI8mnz%w2MpCrV`K}Udn(V=!q(3lFMo0Mt0fRKm;P6{WXBPj(9lT|de z^^EnEpzjBIg59DW1kYThQRBih8O`cLkvfPq(zMLi+vYUu*nrzzr;i^5)~O1 z9Owr<$K5;}Rk_gvDm<%DF>TuolqV3@z+Y-{bgFj~TF8#ph$mj%YN=9}; zNkw&S15~0A^3q39t2}g4bs_l-ZE@!=T)eO^30I2cOib7x6B!;7=#LCJJK9-Wni?7D zi!i|z1d~EyLP^WYEg&K(4e&D;6Tr{p1o)YjUCzeA$<@o(KPW6JHZeIZ2MpHKH$xsA z!U`kVk15^_2g0VQ=!JtI>~Tga;TB04x8m!4f%dZ4xuRlg9{3+9H- zkkhAe-IRU3=b7O-u@K7xZ6YGWg8bp7KQ0agQ@UDe%1{XbIZb|EPNq#{dB~$U5^-`m zHXZ?CaTy?=we*b5tpTtGNH;PzF(o6fsJyzN1+@i)vjxs_WCwSO=FFMib0PESpg!Vh)KK86^!P>$V*`1%yPU z=<2m6Ff3|+Qfd}*VIzbGl3fTp3UM1ed+yY;FYsE6LaadI{^(ybf`zg$ zHq-;(DFAXUvRhy$Hy6ABiGhZK9EairN1~0INHemsb8+w7B_syavzn%^5wuircK7uU z4v$Gdi&k1y2N8+i`nsBGDvHRH zV!{Ak15nP%nF6m2)ZyCB&C9n7RRW-%-w2KeXF9t9j32rWc{8`D;sA8Uku!PfkUqond0Ne~g|9dB>)v<;;N;AYL11p@SC#`Q_U}ORn5SEZ1b#etuK>S0E zL3~n5W=>vF8JyrK-%iwRz^SOJ4R?eQx_z8%UJtr=`TqL*ynO{}I9y^L7L%BUWhI!5 z-WM4GcgcYPd-wQydwIIUJp_rfbDEP8DmO=U_3*N%pisbj9SGx< zhYNB0;2Ap?OOlwFfyE`}V9DU=5u2ZAfNDJ8IR|AFQA!aqLnz7pE1?c8-B5GDe~Dae z?QKns>qi3D;SIy<@Xy-X`j7Whk;#ckJ#c|TkHNS!2|~V$SPy{m<;1a&@Nn>8H9>rW z$ZBqBTK%;C{64~;qZC7eFc?kP9nlpG_DF%a%QN`7Kkzj_KYCCLo(Kp#HZl*X4N_k0 zApY%_uV23YuYZAwkI%+hHBf$sU>xq(7`%F)um91n?|1V=01ZZ-hvK?~1z1;D+duXN z#=dt#A`%|uA)kQzfD#se_Up&m&(qN21CnagG4FtH|I=STq0f2GZgOa=<2VK9)Sq-d zVX8lWtgn5ogcsawJ4M)${`CA|#y{34;hpa8PyYPmHzxb@>k$T)u78_(IEpzVt4IG% z`)?`_tp4$p|IOg%TQ}bQ_QyZ|@!QP&mp^XwH-q0-Ua$T3$3OmY?bX|Vul?6={@VZJ ztNxF{wZH!V8-M?V!yo_jH~#+ae}6paelz$t{{F__Z{hIAKmLuszw!6SgYGwjf8+0O z{QVXVfBfU$`1>1we>~`ZGx#_D{>I;L;qb>l{*AxC@%P7r?l*&f?{NvyF z`x}3MJm`Ki_&5Ik#@}z@@W(&?jlaL~_s4_oH-mrU?{ED577l;>Or{rV>W*IrM5{^w7B{?qrBt8f3j)qgC0ohtpe)*pQuG#LAL)?dBKr#t-PkJtYF zOu;LU^?cZP-hA&(t42fVK5+Z30kxj9UEB_>Y76Ke+;6>-7O%sJuo6 z&`^YIczXKJI^e}%9O|P;Fb_vS!RT;y?$w7c-`4*3zrK8WyL=~g7ZvJ$`p*{`lVSeF z(YaUu+h4C&9uGD9azlR^RC$iU1o%iQVlb|S@R2Uil81+$CJP#KVz%s!+8-VmF3kg< zF&qE4fdBi$AK9QoNhI;NVFYq2!dTE~Ei5>aI3;MOhS}-kyJs&n)InbmWdvL3yQtY7 zYKa41Fr3f2#kv(n8vO}A3ETfexQ0UO`^I(PA-j;?m+$>%|x}HH=FW{7%`(l`Yg$XO3ShxVM+*p&Ik9 zL(Ec9n{~yvyc_ncP`T$?P06OV>6Hd9eUwBpm;5XyRWtP4>XeB`m%%vO%{Y1OokOc@ zw2b+DI#-_waZ?@(N&VDe{XqBw5DQlEle!R4bAM`(!6Y;>cUVWs0 zkvrD+XftCC#-6`M?I1h5rBOP|8F}Rxz5D{&daKfNFSjeDnMLN$)Hynq3wLTCs#?%s zbt7fm)BAel3N@3BlCsN!%GeVry2@ikQE_i1X(uE`j?u~9TXAp}XVH|C9z%0J+$p{qr2Tpcb|v%eE)m<7e7eN~BBqY} zyixe_?D+hw$3$8j&-q*KlvSkoOZ2?yl3T7b_8)PKvbq*wscy5brjt`js`7nVG3ik2+^SC0!EFQP#qXVQbd;*vQt@I$_aPJ)Hh? ztC-WZb2XTwH}}MxINCZi_m(>?I4NWBfQDz>D)*lNlkjQ)bg@T#9?fm&rLh29Zp}vLr+Zj$+o$$!ajuYwr;PN* z!P~5JorgDPwy%2mROV4|3Huwj%ZNN`y`mfc`mUc5&-KkJ-HoqqwJExqJEc<$gf~TQ ziLH2kp)Fw*!_zkEP=onG5g5#4{%G{-%kZqp5r!+cRK5o|84c%W z?xQ}}V$|;)Et}lt7a7z{rh8w$<9_btSBJSyJY-KT^AI0?J{5FyM{}i~$v34dw$0PA zVi9bC6tW+VRVz*CnW>TljTukmy?l^d(ql~7cI|3fw`fwO-O=0@kJHNm<1H&{vD+ix zjhC3G4t597u*XEc6s6nFj^Vn#N%iqNrI(AF-CEUxt23l(0-wWG-{5L}y1xgl zhP$4uf7+u`m-j;k4f~b*8pI8(gw94gn@OCT#a(5ht=xZpjE242>TV8`z*6awfV}`+ z=#C2-I`W2^*OeWv-CXf(38xc&5f%nzaa%0Y`*O>Kpz4!0hsCD42qPw1Pt z`cl29{~N=Z1N#(`s9EqWUFS|#o-wld#C~k?MC6C_{3`YSR7#A>96Yzx-qKZ&UqYUzUeGb*)i~eV#iwn47AzG{<=|4%_Amipb~mQ$*Po3>dvLa-2|8y?i?) z*zMx$ed^@ghYf{(nBk)~NsB2x&t4DT;d(-a^dgVyHX&&$U*0WpO06FY86FE7YP&p3 z*;(A6HTYtnL#~86Dbvu{%TZHvXujR@dsK{u8vP})1I>I{LRypV?6fwqW|7AnhriRG zjvR11y*qkGb}+M-8Mfrol5m-egnK~i(8{pz-8;qtk6jjMf8wTDigX9n-}E^6@sQ0I zkZv*MJufcmMS1nnMDCW4{3f;USPbvJ@BXUJ_*ML>-8DbE6Q7=o@xRP@zC)7N{PehU zM}s%{tS@)_W4u_d?EEHj0c@6pAFo$+8G~OB9+PN_f+_dnTVJaF_nQw8qTM zY&3rDOm7a3-Vo~0JEUzByf?eM-jh_D#_Boq3#(44$yklC3+kpf5^L)N*}J2dWxnMF z8s5k`GAMx&km(f^&+NS+w7~Bq?sTjEY2|gSK-b>pcRh^Hzqo6Y)ekbuu@>4kmgU#K z^w&&?K5uG3d3>DqW%sj9O&W(IEdx#odwT9$qPKMs*3fcWuK6N-XV{x>O*Nq*eTWyU z_#<1huJ5>Ieol>R~1T)SJU6P?_KhZSvL-I`0(ld(4Hiju2ZGHaX$h&wL>LNOgJ3M z5MWlkAcdPgH^EBRvri>WgM)F1^nO%zY~>-Hme-!HJ(*dm(k;0nAHyC#WhKSN{@m<4 z=l9ITnw^PFhAjQLR+9+F>D&r|nfrTAjY_0`JQr>1x#jTWfdk_q$qGYLZ<(T-P4X^9 zKab7$Qb*&a)_IEK@;jp|DxBZa*9M#Aza>b_w&>U$PFQshxTWpddal&jsI~8d+PbW% zY19`M5*O10>r#y5Me;way$ed1GhHuMhFkc(<3q%U{b)FK6 z6{9WRzv5>T&s#>H;w^mCdHG_3*)>lujpxa`XD6r+HDn2==yUT|2`9`sOzNeMg@&K{ z;`zfU4_lAb#Fu}?HTnCMSA3N;JnwVmOF_u^ zS8F~yeyckzy{Xa20rRoNRIN6w-e;~@7&x0>;} zY?-g|ROvv=m*OKi3`=>KvOA9wJnhNn1cw-C?gUG?8?dg&AH1{2Qjp7g;0@z$&%NC0 z*4KM#1wThb29)p46%X*fYrLs9ws38#%lwvqg4vayrA-18#{_Rs3tX7BHW?bv{%|tr zCc~%dQwHOgha+ciB$ZrsE{?5kpPs0GA+PJ09q8yR{H)dW{(&#$kLtXVoDRq0FAvK- zby(u4Lm_M_MFYjnxsJ*x4(*oPhsrnk8DN_CVkDoH*9M4L^P-~R5pK~0@kT1B0jpO*&;Il8UwGk&VbVCK)1 z&3%gf;rp%X(Q*3t>{r?4g*W5YrVjrID&}-y-j{RdXHI!$`*2sef8!>)pP>h`VyWnD zZtU@*3S$yA)`!>VbTMhYe#qXi&B9z@JgRa!OV^pqGE}ppgpn!MCDluoe7T(Gl~P}y z(iRzyusDiyWG4GhJ+qh1lRd>q?d9edHrD)eT(;$yVfzI;-V@K2X|ZqUMMWwu)OcU? zdGsk9?v!~ddn|W!oYX4s+dPrmoz(5>FHq_IW1590$P~kx-O9-5l~K}RdpoSbYd*v> zzAN8!*XIsl#`yuWmq$$8T3-1LtcLy!tZ#RvxE8RlLriE~_EK%O!F@v}{amJ724r{g zxSqWY!U?d19(FEPkm?~>UVZ!Z8kXw)d5?NhZ5~sUDkWY|W}0DIR{b`$ zc=MrAv&pygm4-&FuB!hChE62x-dc-*t^14$Ydt@|UAFOAt2b22M};Q7s&pu*$TL1o)YoUCey&$@rF(=Go*-`T)<&V|KT_1aAA>KB0SwBz_=aiR9@?c6#-yuk{zY zvBKpKJC&WDllCM<9=uZ!WWQD_TYj9zBah_bnJLRYn=rY=*sw=!mPh$~a+qCwqW25E zN&o0}=KXk=aQ39~D&tn2mA+^Bs!vlb?G-$dbI-9W9Fs8Vdd;Q3LjTlp$vc3%y@|zt z>g4WYG;w<`#fWfqIXrtiBDJHBC9d*1NuUXJ$Z=jBgOjZd>%q(FT@ItlUq1VvrIL*u zs22CW5GL*YvvBUv)4R@o59J^a$vH`;^yPMM~2 z_q8P(-?d9xT-hI-Udh#aaBJgysQ1K1u^E55#c(x*DRTS$=0Y6i^f3c3?{I?;UmCB7 zL`#Pc&E4cqeW5|dcqSwzA@Y9ly698$XpfI`Ps_>Yt&^x)4zBf(=v6)WHrSUM9!&N8 z>1pK~{i)l-I@=x$?RlKf-QCr826|R+Z~xrk_mJn&c+c%zj~&dCT_=5W90LZWb@N4f z>$6NAO()KTd%KZV+E+~vj9Wf^=t|*I(YC*thk?&y6@?%G(sA<_lvY_`@neVehAJOsF!W5Gqw{x8& zdqzf1t*$9A6kY9j^R$WXHIIdzLsSGO$H+*sx`?Tve_ZsF(?SAmCQN*D=O?lhe%ibp z)d(FC8J1cQsZ#f!4Y`pbJFZ$jvh3l%^X<>BxlHx3cPV>5Igut_8?tselBPgmkSBU4 zdw=4CuS!oSu3X!+Jz-~U&;_cCF7)+HoE$fL;@;^C(1gG2<G$qSRpVW8jQv#0B>6f0pl|D2g_GA`wtlZa(V{=sO$@?Y#6TuDga{N@Kdmr8z7eD?%Ov<#VBmR)ByFl0A$<~LBlJl3C z%uhJmHFZS|n8#aPbfllB*`hu-SF5C9rq)jJj9d+eJj9rwk;Yv8?QL>_FC@(_6Npt=TL*Xnr^#hxI**8y& ztvHB&^X~lqjsA;Q2C0ZQuaRT9L21@w#fHmt{#gpCLPgr)Zf-KizcKQz9)2%JF+J#I zKJn$qqhW?0qEr4ssu?Un4s0D?9V$H1+N*BYEscEKrTwJPXf-6+!eM?^NPLy!c5w+O zb)_E~Cn{Y*J7sI@WPEgYv{c01=On?t zFRbbI+>jmnBzv*o^d6?SUw4K2jZPh*?o`>W-yPkjdWNA)i$(FelnR#R!7ciqOr}!2 z-OVo#wC#CV>{{C`K{ob-R964?(`x+#S8vMgIy`zqom)tlg z|02dR>qVVe`kNW0D?6IPcbIOK?pwOF<>=wo8ziA$BCD9E-AF2rVBaqYE;XyX{A6}3 zjISz}O5y3H&k+Uc4Fyr(t~9;7$u?YcnXJMdJI6(8mdkj=gM#*X1F!PcS54va<1VAP zc0-JqfcOS~+(uOxn$Qc$QO6=CJ>(lgZh2oW~6B7?XDIFuHi`R?OLgR+R@j zGSdmqqL{OI%{_e1X;N^XXUvOP-E$J4=OGT( zvJA}ATfEZWW$4}vbM*1e7F*-@2-f8(+*A3=;Q(LABhRiULbS&Ne6Op~ zE&j0Q96xh?W=^JG+&M9ObmZXqdzqQi>{Z|PZ=0RbX(SPLxgMDrbTj>a*Y0cP;k4@g zPZI*o)tr>g`^-w?I&ZX@8ytDHPi^3qVEv;#=OZj}?dB1rr*pm>%u=fvsU6;0ggdg3 zpcUpAVmW?8jaKmPgjcB+rn|`S`Jo>FljQ;zIbOV?*|Q1rc_cxiU)s4+d{M{qaY5?l zb+`RuyI=cPA6Spt!~J4J4*T$WzOHEY6>*cWs&5za-^nwpK3Tlon<*cR#ge*}&K=h6 zdwslz@vWGZl3&OVFU^y#lgY7xx5~!**4PyHzWq5z8?c<;Q)T=_&#ETVkGYBT8Y@ll zCD-hXt(052EgxHE%)$#h;(VJvaf&6W$Q@p$i(`NU)A`TG8ALQm&(HfxA8&T;6Z-az zPe^|GKu^Qn$jp$B(n9nAk`Y(8%P)y@f%n(;w`20j zHeO^}sZPof+&In`!C7YeN4_&vTnjF5lghTqHxjdwiY%Wwb6>WXue4AeBc&6-)uB*{ z_3F&7e^YM$QSG`(fb?sJ(8~hJlB_+ibeGPvR;hd3SZDBE4ZsaN$}L zYjtU{VL6qGf7b&^EGTLGn+)UWo6jQKA%aZR=ueO|c5IJ=wD@!aLc z*On666%S%hK3={0a#9g{fs>)ft^ea%jYfFcnjf>D>Rmwt7ovy6k6D+PcVvW2_#+s+uj^gxX@RyWPE6GcVTkBzAkM21ZskuKsrU z=X*z&7i_O3R+W9?`tA8=$;jiKoP@unOWBo?UDAw!1QgO$RCX^Dti!%hNeqRrg6n7<+SO z-OOb1^&wrZyXS{!tUfBWkcL=j=-um@?%Iv}VDom<$)AVLYJ4KmGQ4B*&EkjUVJVZ+ zQ|B2DOX=(yPnVD4Kc2gZy-;uBbiK9JW6eIP;3zi@71}2~94<_8T2IIemMi_dP9EM_ zdpWP+=Ck9$$3q3K_}y(}d7C!>D8F-edYW76n$tUzZ?iK2S2SqM?BjWi`_C>}nm;4G zOs_xn_DS>gfji#L#lvFa!rt-PBmKK>_6+AJ-Y`03sl(E5npic={W)*8FV#sfxZJ7s z{YxF$0qRBiBKP__-RviwqSxw4G;;Q&^y(3k&I^`CdxEPP$)F-1331P9drkmT- zGWpVqc^qa9G?X@t?4HpauVd|(p*)o+aHj*aRl_Qt@$G)<)7qQqUAVBLud=icO5M)C zac#uQogDj@4Q|Pt|OGJx!Z(nWM67f@G>qxjBHVUS9OL%aDGZqFnrly3pLg z@|Eo_L1A`+8sEMbJY*x&4=Z_Q?*C)9x7h8KZ{nqoKeXhzE}nbfCh5IwG4u4{9sS~k z$9ELW9p1hCl9aE_%bt3JvnXtQ!twHc4Y5GEkD5oc1=zkcG#4fAE>&1Z(i9wY9ewuD4%k#RcAwzR>DxyR{n${-zDx`{;O_Yt?P0>lGmQ&{B`13OykroQ{yYwy1wsIb#Zze?ZC=;koWopzKIupk763;lCAKMwo(Wm z`{pO~Zs_8zNPOq_Qw}z@%Hf;`b7}8>dbNee?e@e8%(a_a4`;0=&R-JWJxS*3zVKY) z9hua~LB}EI*Bm*_=gt)wnC++WTlc;i(4Trsmi^29$@8m5(fZ^cgD0pHL@gGX-#p3J z;mj8uxo>0Zz;gdxi_~lf_KSFg)iX}nJ;zRS7F-{sX%-Tk7YI03c*>35j~DLbohZGRMmJQ(V1^Zt{6PKEiT{|cr* zRG>^&yfd1aO1iX^coB6zS9RJGMd7c5%KPp{%fdP*k5s@lFi;rp5(-3`JbvS`n|JZ( z*gcX#zD!-&!6}VQeEV8a#t1aDJ zK{d+@F1o5e@0T%25$vT&K%w=lRe}<<@mv(LG3-#rRL7RsP}1gonIx2N1D5+0k+N#4 z#15L{S&7>7kaOqV(mJv~$_o8vsjj&T1Y%~Btcr2F4cwiQNwNR{s+HsW*dw^Kk`VnX zs|oD}apr*oy~Y9%lUZZw<-=yX6Ckt|Za}m-jHL{(V z5QFLo3D$^Wy;ifo@~LS2`J~8GejX)5pmn7^C!vhLzJ7<2$c7`;3gmM5YYw4M5OV8y z`wN|l-fay8;AM`Vnd?g=KH+G722&36^Mzw>tb{=k3`bCHmLc%(A|_nCN&!C|=M6V{ z&t@55;jCUS|0-G3)xh7CWg<++7|JDmS3{_|CvLc*b|pr)cX0|rO8x}l3JOg@kulOr zm6-Wqg-Og?D!|6$^gO@hNvJ#qpWx@DVT8v-BvvF|-#q#%w{!-Z3w88cOFz*t$c5Sq z>+c-U!UOj~Icf$vt+BO=RmPv`A`}W+Piu~Qilr>3vlRbb@8g|S%z5>V7SiP$yOd-3 zS_@y~h*+k?jg5TdwLk_HX0h(%#3j7Rx^?z1FXQy{%zffSf*r5%fxe>IP#~>6w%QIK zIxqTlv5>F4Vd0Ify1CDl4DD}n)nCG4YNEtx&_yUjkZ9my3MyKLVARcPuV1*ZjDpL9 zDUCUKenk~#B$C26ZD#U8s~g@lMUGgrq2uw*W#6V9TnGoX8MqsW3i4m)CVVp8=29~=Xgpp(); zykH?nK1pz?7g!bB&OGFOhBJ0`uec4g8I$UY_)Kuke3V6W-+unW_SQci3zAKhLO7cu z2_x%N040Ers97TqdT&DLlAU&~l@%o#+QVX)xl<%?6+l(L0ej1lI&#QCky$Q%RKmqrtZGj%ID6CWiEICn^EA@e+7wE1} z<8)m&6lC?Xv#HNdtwd9&pItATv!SvzD-y0IM*|c#M@5W+-S?PCI6I5Rrb!qYJU8P zm*Pr8`^}GkO>x>4l9D7H5EEVhc7){t7nn0cNpmsLoM_)6!5b!KQnVNddbG%RR4oRM z$rya446fjr`^$fD=QnCw zRGA=dBY?;OK*H*bLKsI{5s|-y1QWsu+TtYrrg)BxKroEma!{ukI@b0(J>xJY$yly9|xM4iz}29RVr5Pssl^ zKyOU}T;;gQD9(S|@koVxis!$m5m)2q@ZXE=*MH&BAMoh&FSl{;w^*;YpwHpaMn8tz z-)@+H4X^$itoGmU4aF}3@inWl=#v13bdm2i=2h(BtYcx;6@0T_Vw8AH9j5<(?2??7 z!EX1@F_c|!)&UBamN#2yDNMuEYiT#301Y<`}psTy% z$^w+F8*8vd>>RUA@w5Q&dC@u;GAH5aDS~xEKK+)W!JZvO>VZi(vaixNdU1U40*2jT z^f@Y{x(E7Ew{M!=Wv!g>+PfIxQoX4x%rD8Q(spQF-(fO-3Jq|*f)lCXaq)94gSloz zxXCDkx}E`0RqHd|r*Td$v0W2UU79N>R8)?79SP`vc!#w-+G$*EQzkj%;OnS-!^_?> zj#$%}B1;APp8c_!u{YUNHZR!)e;LVnM7I?~ z(a0t&_5k$d>9%JGl!3nbXB-;;9SotZ`N>FZ@p8E!_)0NrQ-1v@yC^Q5Fu<#&N1Pj~ z0{oe}E{#*nyKHIi7L3=xcXS~L@XMwq>fp4L%J9wtzpm%l!MYos_SvBTK*fb);IAkt zllS04N*$iJ+WRs-7WF$-Tx(6p`OUbPKyKtccEL^vtSU$FLxYaN^rbqcvh~FR^}qy& z9!Cw3m&qb;)4yH+I~%*V1moc?45k&9-0N@nNeXtwTVBbx_CZx;I{6c&rLaE>f14-~ zPpyJ+s}SBRINzF>BSF~)>r4YdMco8LmMf}3$=aZXNcsO>(7n@<+ko5^dOk~IYQhO4 zS`Qo(2D^F6O+#gUyWq0jNFWHSh4j@Ib9Mq?a5Q)eM2y5J=wA8nI}8@YErstHP(o=l zK2>_>)0l-nvMDl&>76o3-e(-QP-i*5VvvP%VKF`m{)pDWQ~{#7|7?9qww~zd^ZZrr z)1{BbTTphCb<49Re}k?kpb5SUh5Wh<6A2yiA_8j>79~%<43NU_t`SUwGv@s zb=RdNV#cm9pu#aD@4Rz@uMXtTPWJy2^``XQmB`}uVgD3!_B0br9HYOO#)*Z$u!zH# zSR>t!hN-d!_EG)>KwSAJ^6UI63Q|w=TKtq}yv~v*+u$;Ui7Qo5Kf73oH&v`ZNAFB| za<8g6@v|lMgmLyOy`ShaYn>v4apQA*`n5A6$A9TXn$XpSapR^@ix2$m696inJR%Ta zo+@9iERMiE6-a*Zn^7X(Znd>!iJR4uf0E&TT}z0H@*HVJB@<{8{c|mG5Q%a`fEfXG zjMM3PYFO|8#-OIXzszl{*TkFKZ*>tx-BV~p-2gbLBCWmqE0qzqTM zVEa{A5F)p67#w*ae`$zg z+5%?X9dPc;I&j(z>2WUXM528pN0Mz%4_?bSvna0ON!eLVCZn#vw`+|@;7wyjgaM;6 z6tUH@otlOAS4Q9a2X`-J;&HkBNUT-}^=uH-uA_qmU68os=7G=~Kn(+R0y=e)+AxXM z?_9SRIZ$tGFTMQr1%{&sQ`Iq{B;(ZLlpsj|0fDj#W8lo@`AE)G%aAr4N>0JBJaSa- z{-G+`rs=~tJF?2>I5Lh$w?gAKjg?+jJ7ZneBiH$Q%i!s&ONSn_KG=5t9TztoF@$CD z8UEzT{;G~pk*wdC`58;pYUCUv1Mf&K!D+TUTQ>xyGJ4BAWOn6ossShV?fBc@a;+a5 zSO}Nx;&IBA`1}=Cpj!z`ubUrg`LY0_XRD7sjrOqyWDn&%%CI?oXHcaqYX`rvdT)r4 zYL{hbHNb?qxRSprBX|LITHey+vhIPvROkUE4Prv^%`Mt3vDu4mrd9R4?&&@JOuRc) z@p}CBeKktUL`3mJMYRx|KdtnOcS`*!p}75a%8@_MPsSVM#jgw%tpF9H^&F{~F=%PO zM>y2itDCe)z;jEsr*vyo1&n01le}*n-Mt0fcVm&Kn&h{Z*dOX#I@9fg>e$M;^*ZA; zR<%gyZgDbW^x5avx!e!OZ-2g1yI|Qa$Kg93yDi#YY@1e%+NvibJR2QV*g+xxf6;3# zZ^lIvD&Id~E;Lag2n}{6R3Bb%PXkh~(Iy*sP8X{Cf_mVeD*M@>zA5>n&N|U{zmJvx zidK8QgiDIyUup6*8aMZj|5csyzQ9PuGU}HDDgq?LDmXci1WdSaB3Mac`h=jt@<%Hy zM2N7|R6E)fv-lDA|0T<<=r<2pQb{~MB(8{T;k*U;jK`I2Dp<%rS1>+KKpw)KSH?Zb zxKo>iAKjGuVMd2-umpPqT{70K;;)ZMCML;y>($MqhXe8K%sKhS-=_!2!EIEaUQPgy z33)H9UHtS;b(#5~1EFLncl7mRkbJkJA&#Wl5@!ob%R8rq!^HzYrfgX&vJKM5Y2iLA z#0Vd{XCbppb!od$xzgZ5I2Z-N)kL01HC2wqRTBYR)zVNDE(w}l+v$|5QQcqq^9IJb zD7`Pbz_~NJ<*jdtg123uwEsYA1$X8O&vlck7w$}DD8Q+Z)XNAo_Ea4D2-Dol6aR*e z65-|5i82*RW=L9p4|7m&_MkFJEH#-bDipH%)2n*)kqm*oH10vz(R~4AD7x2n(uWG; zCdn*IhaV6q9psWo!>@c>sBK`n#yytqRa2)7!J@y<6reH^)eNYzy!6N&^Bx+Y^B8wd zU@K73#ue~&d3&&+bb(bOubv2i8%`+9Xt+$CC$5GT8K_Wb>FeYH8o;s|^XtO2w@Ail z%HlpKyH=VKqy^a4d16?ClI_@km-Lq?&lrgh3p$;Zr)p!W)Li$xtnCi-yqyIhyVie! zFRAxCR(5!q#g@SWo~O1=LnLPVSal-$xrjbd53#j`|2w#7NA{HM(TT@NWbO2#;Z6;h zM4zv70N}ZXlA|EF@Ui~kOK8b@JavD){!Jb~bsjAsLTY7f7fx3@tN$REyNRxs4Jt7> zWPqLZRp9>D$h5-gjhle%mI7(Jf@7J5*+t^CFwwf-d8JJT@WhiqDu17n`}Jv5^MS`S{k8dmQ=6Iv z*_3KGCYE}6lP(=3dT<5Y9kjXdWde`)EU@;~H&CnBl~-ZSjIK98o9s8Jpji0ON;o3is!E8UJdTr1{*y zuYLjtbE$}dGHk00x9S@?OPRFgbXW{;yBIEXaRA=kr)!~#!^OEpE#G@(6oM@+>)(RB zZbVJ5!X`XT?L`GRh2n!F-)~94|9N!s^uP1wl5jv=S8wd`M$Y!%WS*a)+P_- z{Hmf|feI6#%D2c=)AB{;+7AF%7G@5;D`sbppFvztug`qon!+r+Ax?76r85FpJt+qK zeQet$ar9snnTcDo#pzwVENApJfFJq(QW@h3)2nd_c!)#$c*Em3t_KX3IHHQJ9OOs( zusscq^mE^hus~`-InKQys{t%gJdGRL*=HI>0ci%iQV$hsrN4>6b?N^N3F59sX8%xy83ebj24X)RxY zLn3v9J=!P|G&NbD8V8wp^V}x*$R_(HPeS5Z+3{9aN;W$DteRi?Ifv=#{6vNt2aLUg zeP`w{RQ!%{Pa7Wrj(aI!CA@Kn+(w6Xi;qlJt_gZo!>#ic<5&mN|7#B^N${eXXtT=Z z+-KAQ*_qm&d1v)Uc@ii@?Fg+^vIEy~8tz!AjSBe^ty{p!MQibCz0LqZV)6GTlAkd6 zD~n|Z9xnVlc_?7`waqHGa?}2q2QtZaO}V;NQ;Gxfvev_Rqi5AwBW=*wJ@Gejn-qti zSWMjr+b>=ngL=5UW2@DxM>n@se)3D7wKo_FzD^!%Q~fpTegT=Mfn7ACW_cq#eGm^`=Qgq4MU^7dC|6M3m?8-vRW4+ZdV{8II+}VYchUwf1t>S0JcAa)LlPj%jnIR2iGPFR39{teP1P`GBZ!$K>K~K zf^xrMAH|dk78H@cGe-5b7uW8+FlfmfF?}1d(zS>xL&G6CK|U$;nUU_o%1SRKifTB4 z)60V)CPE0KLVSAfW%4n@e+g6P<1KU@;GT|R!Re91lvswN7YvlYHBl4 z7Y&DZhcs$3J6Q~8{1KS53xmnmn|8gt0rMyf57DO5H-FRDO2kX=sPhpD%_>C(c^ zuEB}F8@Rj;>H1#L=4&qVjRjV8k`!)$3@cp!V{%*T0X`4i*hJqMw#!C)#sENEn`$N? z);KPCyXkout$=wv!z$co;%WSh~*TZJhz!MiCPcrb@>Q5_!>Ji zjc%Tm1rn@|P3{@#+Z}}S0|D0NkLE#ui*5jJ=5!JpF#A6i%5fG}A-eoT-0mao9`(D7 z%Zi@v+k0h}v~5~4Fz#e)6lMeJ1V3*Q^G`G8Wy&=u<(CgFtQsH5{K=GVoX+dKlV75h zXv{!VA{BOzw5NXj`H-&R{r_||&**i85ya6AR?b5qOY#@$pULm3I?bzdyK`$scG0-Ac zfG}m(O-`xsk9ACU417rR8?bSc1bDoxfc%#YcO74@p#jZea;(|csrm>hk@BGF+>N39zW3dY8O0>t zSrz%=4qrootu22s_t}BBeSTCPEBx3>uW3tAi+}f3n_VSa+>9O?0ZB0kJi}F+{sW(@ zR@}yVqm27Uq|P2%rgsK_;nnnX3|DY1T}Iz0|8?L8_$B`fBhHJy|6BaIQ%lfcf$1e( zd;CumYK~D(Am@giQy_k=f9Wk9)CD)?n1cI&)k3cGvC=UFb8IU1wtrRV`#FMShe=aI zXktA}qMGDq%0)3PRH5+rt87cN@D2$^U64(JZSTF{V$dPbO~$l`4aw08&?9)fA{y-g zxn7E7+(?ZoZ=O^0b4fc?cw$lK)@}M|>*OtP!LrQVog93um_1-YMjzpNt*eWkF0Hdb z;ZIi=C{!&cX;2Zuwxw`{W~yCUQ#Y`_;|uCvMnJ!ID1Iz7m^YL(#&Y7YatT~}t(bTj z6&hUf=F?7ZB~5!Hx|fq$MS2nmM&8Yk z{8Brj;7-m|>Oc#&(%DC(!D>H&B867Qt!zq{cV&{-1R|n>>_0qy!tw+BE&JuMIjhHG z3+NLiDI}r%96ZA_^lce1@7z=k>550j z*v8TTn33^ZYi$klt10-FSvjB4c(Fj=>p%eVAM7ZZYDMtf?` zrPCspg;X`X;&%y|YVim`d1duMu@E!O`@j84%C5f($rwjFn%O<5IoN2}u7ixn87D(G z0GDzl$L7oG^j!OrC1LN^a`ptF;)SwK*xGJ@hg-}e_h-?>DBlGe?wt&UIQ;EW78HUSYf(nwkF>If|&XZ=r9naq7<;? zC!p*PcR)A6%EIhA#Mz#3YxM(S4y7*^8c6-;@vtpBXlefdSL7Ob`fxO+(Y>#T#!6@Gno}+Hb z+UxH2Mp~If$TR+w9}bfT?`NsVFyCOhb_pbODckLoZNu0d5miei&{e}}Ung#IBJ*pt zL-%4Mf5$38sP{7&VB#dwpA>^o*N`J2x80tuH_iHv#y#<46g%u-S`!;JXxSaEv$xatR2JNtt@Y=R3A&)Hj)dC4>X3ddV~cnzq!HE~~v zfGCG^!4ifrWTsZ(IN)q3qxx;&k`FIiKcS3y+-)Ssxac79AF2@U7~kxZCRDg8QQ5V{Yzph)1B@n~+^Yx10Y`1J_+r|5b|bd-v=;k5LZQ ztCrWJxOGA9ACeQ$VeY0|$OB0S`)O#5nQ72_Ea@401VweWXnI@3vmAI9YZ8}$Hh#i*LvRT(Ft!@I(pHfYO{U}i25N+|e zNkIFDYorhj%S^*1BP__7a-;as=i#^TE}YL5we(-}hyv`Ib9KOx;_c1EKg^5u4bXAb zciXn_AZbpu{6pKeC*vO#Ok8hM8>6Q%Ps!bcXcl1@1f1@?U{n$u9c)Ag^U2VgIk&Ep zH5FCyL&4khJ`Y0Y_Zjc;rRT-!7d;Qg`H2iA@hyNMJLY@9&>~iJYdlGnr0h5=oIV6# z;9lnD)h0t89j-NM%tCM~Mn!hO1Jj-9v%_nQmoMBg!Z`9)3P=PWGy{-qHI<6hPDAAH zMhAm#D@gIY^)@ZOA3{yoA`Y>kylAxhp|O2}b|z#@vchf`X2+?k~EwOVcJv7bev42qzA{MXf^qH~>LxJ_niGV@j&PIOPJ73z_i zhH+{Vwq^Wo@ed(|*`{||XCae)=*T!Z*jYoBcg7{AB5E}p@b@g9<%X6q`JyvCk4A> z6V3Sx>~XUSO!MWY&Cik4V&Yga7J$bPLMIw^J3PnR6VSwpGh(0=5dq@o_LHZ&2`_tX z$Rm$AK4?SH%(dhA+#y%Q1ZjW5B<8d)DeraV2F9bISUm)p{~|5y9Ke7bl0X_p%3$m> zXijEujU;;@Bd@-4553~mdycLONa7h=E+l7Eh*MK`)FO2F>209z@T@S@2yO~`mBa>@ z$}xFORA~;yFb6Lim$BH1L$?@e3Z#evJnyEPcl@tHvO{Ns1LH(K!t6QWcGrZ%iWYA`HF)6_M~5Tzk} zIhrmR@v+QmdtK2uNW%W$xw0hsqki2Jln9!Ox}ZkclBXQxWlE#?84b1^*mB;;%^6 zG5ZDnHrno)4>J8U=gkI^$iyov>F^j|!DVe*Yx`8<#*N9EA4()BHcF(Byg~SO)J`lCODJy7z(=Cw-8gU&E$Ru{EExkfzF{EzQ0@g|QeC z6hsOF%-Yufh8-bnb6$)#N>PMG=KEuOVTQBQBJsTTC7@2<;aHm9QYZV|%6SvOzF(EW zs0XMd6z3?0PQe&oL+gCmUxyK`a4g`mqVy1;!`@537SRqsjkrANGgIQbhn-m<%!|v& zNmIW=xQ;oCgVD8!jVV1$V{Z^TQ#OvF%?HmN1}REK-)Pe05oOUDX zI6gGc7pWem^z++%o3aSs8{MSWC=R$2Unkk0MBr9OuJ&Bz-QR%dZveB6afo}82vZpA z;(4|;LWxlr@#6T(<{w$j!XOxU8xw0D+LfxUK+ww4P1!}r%tfEwOtBfEk4cXQyHHq z1iRP%qj~C>5Q%rFeg9m>1ZrB6K}`>MPRH^32MUqowOOQJu9DJ77v39Cdju+ z>Kf>0w<{lJ1i%Q$J*VZzEB`05Q-RI6(Q7k#E*$>FQeZ%FL|DO%j&Y4ZS^?pH*ab-Y zm>2hK{r(PUm)L*os+QH5sB&5g>uD`UbOfmLzv-la?|2?Qxi`*}8b8~Xio~);fP}yo zoO;o2YBAVUvitpg@`H#7`>6MYt(u^dOG*#fPdXA+04NO z>Q+=!c>UxwPVZB)>-rBi4zX%s z2DNsLVd$*yPE3oxX2&mKLCqDJOILrmz=V8Y*5$E5KWJ(lni6pG zw(o+Uib#b>3LsS@hHaNM;%~5u`am)L_+Q{Mc{nje<5Z9iQT&pWuruq;8mBc3eve*! z%S&+CxNncUD=i*sDJ>E0Sck8REOqqT8Mj0p&#U}%~Zc1Cn8ob zQV!tF5Sao0eRaJto>(N&Ghz;vrW6*45k*3CsY{Wvu$aUyLxhtALCySX!g1pJVE1M> zd4z!dBR2rPb5uIA5lA42W0!F2L^+*_;Px4POcqPk@C7^2l}HkWQ*mjy;55QJMAIg8 z-0e&Lss+toS0sPrBxB$n0{gFk^QTlh(uh&~uj=VGffSariqkU%-c=BP7OeSA9Ge08 z-OH$Rd6F2&bRk6F#B-}Hes%m{yttEf`M!1&a|}|ShDcT_z5^!hcufgWL;X(aFfSF& z!gAET5X!;&dgGdRhvF}vt#@DU{L}* zo(yFQs{$+h0_rQbvNdP7I2gHyt`F5wiN&O}vU@q+E^f3NK!33Xyku={3*IilkIN#=SQ3O8U=-MdlCxTXHp*O-Zt$ubt77X?uX0KOx?J@t>&qaY_>s zq_~0sytm4$23N=M#5Io|EVRC_jQ}z7BJG)80hBofEo$ZC7)5hoIY8RDS2XJx#zIqU zUZ%ZPUsg}Zg!-^rnVEa%(lgcj-ulYLpY??%T0__UK)EKwSEl z=owh4N%73#euDDZ8=A-bwQW%;$+<;obI0miP|)!f^ZT~aT$-d{GWOOs^`rgR;`r}J z0RKJy4T*Aoi~%hgkTChBfHH3kZ-p^%`-QjvABChbm{%9b;-Geb@E)?57MT>lV%9i? z++7=Hj(UIp5s!uNdkb%)m{V!+d9Zsa!m%j^;>R^(Gh$1H2x$$-C44&Y5*Fnlvgly{ zE=0O*)FHG@AVhElqaFgUr!G{H2S6<)GunBvWUDl3@iJ$a)K{K%U(P+~`c=)T_a zNQ8(X+@{kk7ujq*an_*zy?Llb%jCr~k8p#jbE{IIuL1{6@Q>e|Y#o?1CIc9^Z5=2% z;d%05Qj7?8_6)dAyp^Ue8$wPqa(ej_Y7lb`aSCLhN zLFA;NFq#mu?*$<2A1W#bkVy+_+@TV5%HaZmib272r*%X@0z zg2NGQsgwwR4`QerbE`o59P%+G8Mmo6M@?_@k#9R)Q7BF5O)|zlWxM+&USdW|YH?4Y zLn`!wt=$gnuT6u-EbA32!~y?fu@>p79LW#Y+xcwpv6Zq+Ob9Z_JCo_*v_t|(IJILsho_moZh(% z?(w?uR9O*sd>kLAa!s6UeoKyX23n3mIMfX7IDA~5*V9#0Klg;Qa&K<5@5hS^*)D*> zIr(jyLO3vN^7uA_$bkP%zC?nUYeB`yEmZkfn|`sPxj7E$*RPerwdvofGa!nMbh7p- z$f<|H3ZuWraYC4ZT`*I?vPr&NZ@_KJ2#5~xpj%JY_G?inB>U#`x=|g}4B1dRh-WXy z7C+v=Wz*t*lZXlW|94ar`!Xm|TRtSVz|pt=h8R1^lJTO&@+GVe;@aGXx@=pB^rRbA z5B8-nahgHUCY==Ge!4c$k}0sijDJAP8iFQ-#=REZxSK6vA7(w^$wqpNRs|Sd>CdS? z;~Fv{!Zm*Q=u-VlcZN=i|9-iyHEcXp$EjVO4xdOL9MT!rdOt@yNOG+5j{daQD+{d^ zz;58ceaOJ-k7oC$qd!v@T(+DxbBCScPkBq;3pc4rcJ&uXDGHm-Ts3g=4K|})iL1#V zd9@p*>_~IsSRBi{|8a`+gE^%5+$qTgWWbaE7{|$TWJeebSjM2OHsNReB0oTfT0je> z7YRkn9gf6qq>0MM2_S)`ej~9>>kaEkn{|P$%GRF>12&mR&cSZ&P@9IHf;4V*W869>_SEGY2(UH7BKzqZx&V6(*$Z z4kJQ8J%t|B{~=`c%s7h<@PJG;>&SVMJ|1J7h}^6+eHWNJRkk#DUQ6Ni@1sEsX)-}F zm7pnV;Njy~Vil08Hg3tL0;Sr1xHbp)ZDZUSb(?)wR)9O4sC9#|MrmY+_cyrk5Jl?T#a&*Kl9SZR5f>6^w2`cr)akmT^u|M@-?_Vis!Q?4diy;X%yJlff zmHQl;kf;s@9cA=`GJu;TzTx?1=xe~*1AaH?{?uj-{@sxEDYmFoHk(A@3h{CP$r5g4$ zYP=m$+f?sFstcj!k@e2F>i7JQioyj$xL*AuMIR_A>df2Kh8h`QH}MnN`9W`KjT%?F z)+DF`d2>Z}&gXmJ!2*4I44K?9t2hwV-NbQ?fO82P^g{A&3L6(QY|-^!4bA4+if*GU zKLSrxJ2yzKj&zAbvv_N7kkoglidM8-e>ulVW{Eczu2rAfuT7q?CngLs&BxiP7}d`; z^G(1yem0-VO1eLj79Pg=RX*>#4vL-m3FFh zg5kruUnAGquUvMiDgAF~f}{w3zrrIarYl|}y3h4YSLxrOa0giPK5yOph1|77Q{%t&=N=qNVX{{2T) zZ6{c67d@m0^J%c-fqJZSMPKR zHuaE3auxELZ@kz+#v@In31W~hMDt5YUM~(-%vm;%MpTY;th+jeOpJ`@S2iKiz^C7}Og>=>`H^xP!f&9@)uA|#(pjdH;%QkhtcJPRFCEf!u6J_u9o zjXtZQyMa@4QH4Wh=e%s)rY{v%-e+Bt0H={%bNh`*16w92^r4Il%t?;hYK*BXD3~UC zf#CB4RweS@*Wz{MhE_+oBv~UTf$ZMzNkA1bERrB>k?^PUVt{!SuPEI-Bo!9*94b*c z^k6JJo_#1hOHs&%8BJl>98(bXGI#No+Wc*`z$??om0SKbx6X(wLMEDz<25%Ycy5R- z+FUB8r8`=ULX{-)of7e~+l0O9yGjs1_q+xn5&i(xOjk|63kaPZeNDiSB|Jt( zj*+-lb+_R{6u&UMQ@yetf=+lzbDJ@%I4}4Z=V{tvW6S0mAWby$Xd)lU6>Ui{(vhgd zsxq2G!|3B_j@4jG((O5IWm9k`@T;bNnuwgDC9o@dS`O^=?+71e(0lCny1ea|Su8g^ zd1zAihRE&n`k1dEPIE*rTMpCngwvln2-o(2xLA>z!lM-4x5kpXQ{FMiAZ3vdbF{oU z_dMxd9Dz|FZeeLJn=!t{YWsx}fwa4~oZJ4}YSNSdmtUC~gimleqZfVE!NKrqE-ZX= z1rqOf81&D<-~Ukt#&&|zK(Z)gHNSuKkScRz#4^OId+1j@ef@7UK|=)5N@;rjUzRGD z_}kycZzu?mfWk9#9wK-WwG2p%x@yGBSBJ1xUDPAlS@Js1n_{SE7q_qqQSv~&Z z&;MfgDC#E{s}cSg0qzc&rt}-H*gLm(ncRn;ewV2IfQtju zS82(%r+7ak@)d+o6F%*uz$x*ihVmg#9Ym?iOv^A9gRpn|%2HK(yLr3so1b9VQVwbR z@FmC&rZ-5~5&tN}CP5$~P`Ldew(1KnC`C*Qj8>u@F!uBMRs2c_{})`5Ow&ZVvK0*O zRPqu48QLqsYf@7k*c&mN5OBU|ET$saJ@sn*MK|EB)M`xQ_MU#zuiAzCP;vWFziKb- zLj9-MKT#*@Aii{;sF3ll>UOcnyWw1tDj3Ket1ya&Bjp6S=1|j6&p&@IFB#!3X;VoA zhI3(-yv2Nv);#0abRlUYv)4QA1cLF@Ez;XfsHbGTye%l5$=%xbYRgn{AP{jOG?z*t zCi=NjcxZ((B@h!A3;Qy0MD_9x;zB0$u*SgehV(H{8ByjW;dH3>Z2)_=IQi4A^XL_& zB0`H*$5ZTxwGi-x6=zZIQ#BH-*y%B3%TY_v(YRcpuYj|F$v__!;z5t2G0z!WN@Eu# zJr=~m{~%L>6{mahVSrJDZ%NSh;N78}uHe_>y{|PB6C%5SHQT&fx`yi~rG^?46JNQm zFx1rUB}${#pXE3DBd$?gR}KB4R7tNh$-Jx)-zYalW6t4En*;D^g(+3C`{uq2eJP3zWKe~G{)r! z@iYLa*Lva->>j`d8_l}kfHY*2xd03!TvLdZXDJD>5x$_|$$isrs3t zaotCkK|ZXkmMid;fArveL^*9q3mj$ZIV#vtku^ju`ns^NV&tE%*PiDYaRugMPK04wg39rM>?Qm!c1G}zS~6C1J)sgWpvk_CD$qp~zo5_zM*<|d z4iPoYher_|qB-%rimEyXUspvX%gFJpX7#)8D~n}Hx(>6yG2rd1|0k;zr_=x0X=83y L0000CLjGoE&y@FX diff --git a/samples/Cpp/HelloCpp/proj.mac/Icon.icns.REMOVED.git-id b/samples/Cpp/HelloCpp/proj.mac/Icon.icns.REMOVED.git-id new file mode 100644 index 0000000000..9874ec6979 --- /dev/null +++ b/samples/Cpp/HelloCpp/proj.mac/Icon.icns.REMOVED.git-id @@ -0,0 +1 @@ +3d09e8fb4f4ca1c1ae7ab0a6948db592c7c3d9a0 \ No newline at end of file diff --git a/samples/Cpp/SimpleGame/proj.mac/Icon.icns b/samples/Cpp/SimpleGame/proj.mac/Icon.icns deleted file mode 100644 index 285dee82b3d3f80acf3c0037b6b6ce35df0e9e5c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 77152 zcmeFZXIxat_Ab0T(TVPcCg&WwF((wvIgtbb0l@$Yf+$9U!rtBFj7Ss^6+xmXS&|aF z0l}Pe9`lUjIL3ZgHO@J6=AQq(U*1pmcR^-g*WPQbTD7Y7s%Jgb0ULvNVx+O_0(MTG zgkcnJ)SEEf@#a<*=Hn~`LW^;F@yiUYEQJKZ+=Qc z@;C=Ct#KBLYV?`;X4u#qA!fFSC$v=LaWrsMs`_?qirQk9g*k`KC#_sfo*6ckVr!*o zZp=~SaF|Yk>zo}H3pfV)h8!M;qew9xD=_6Vb+mO2tr;9eHk(9MpeQIQtLrF7eY@Q^ z*gw=Gx!N@-kqq=bywpD+8SEYKE4bA)B$W>Ib@aj2;qLifao4*CCDMUYOsqAiFMWCN%jT>Ly@S&1;^L0ra@nm@kJ?xIfsBN-+{E3|Q}16qt4&(a zE0u=FhN~T`t-ly|wK93@k*hsXK@kDts@odtvO3};Lz1ubcyISyU*j_;xh`qk@~sDM zbg%O9Se|Ku2@aZLMy?xr`t9vJCPy+o-5q`0S<5H1x7jaSJ$1Rm1aE(jaZ@J8*VowD ztypEb%*Vxf!R$$%1v#ZF?d?{s)HfMtF~)R}I3_)J%QCy=v#d4wn(CHzUVFtcI^W+s zc>Lh$-G}dPJ$?A-@q>5p--l1`J>FjX@zzuPQPjhm_a8pK|NQO}&%9snJbC!&(eUNF z_n+Mg2!9oF@b}wrbGP)um8V-Sd<74j_~qV{N6qIt?-FIQo2MSOuiW+ft*15h%@yJO zr{BMLTAR4!-lIoHYV!1t*VbQ>d!X^%ovh=DV{6(PkOQK&7rwodc!=<=@t&1bpEzcD z;IR+uZWGBd&gsYlW|-mXZTB8TMkFtaV6F9X+~C1lHvQJM$j~^irH&K90~4l9K7M5& zGBP}7?&9^US1+7BVb{5)zOcy1h<%fc$Cz1}t*tC?IFlK^KXikem9CM|%)rRQ<&`_9 zZwUU_irEm-6;R4qAKEDgNKR6pUcO zi4|y=nwmk2Kp?cVG9zc~KJ@A0HnK5DiV>(8n?Rd6TAqa1soPDmPp_InFv~cBhLMrH z$h-G^55C@ge>10SJ;t^W3v_jK zboC6hEjZJkJdZyA{Qi?0Pai%k%1v5i2y2-T7wBqf>*(mSjIsFN$|j$^bLGbM>sRlV zXNba<(6lpH0s{`0$K!JpBeUEw1&oTh7umyqY1ndmjG`(q7YJ~UE{~&%xgK=G z$P9gKcHSJ!kdBd-EHzayLlFS&TtyX%8L@+hX^g{GrL4rp^D&;|YIVN35!@l-Xe;u_ zt8hCIYJ_jurvX;Xa5JWvz>CS$47DoJ)OMeivR)A}M`9GJO8r(10XX${3KmkiERxI|!GV1AP~cRX;c@9hAgK6(j?_53WiF z#8S3ou;)q=lkLQ=2nP4T*{LSbziMC$2QA$sT{e|Jp?*5Pc<~Ro$ZmpJM-d6X7b*Gk5@7| zrI&h!K)hB(^{K{|_H&Z{p>}%Zy$0FmXKe+%rs2LpiCC&tQdW7guBr8G=dfY4?CG~J zf66*K5(Sm{O>Pc$>;35TiNBuFk!!BfRK76 zB&TQPrPT&ad-fD&?Y$>Ao;yME

DIFU*Fwvw&PsdsixNYgCbE#(d^=@ zJ&6K6Ah~Ftfg*`gDEL;`xDF3udR>IR^%=_YK^Ho4eNJ=Gw1X>6TP+ zygb&$dde)f{KfG%PUdrl2ma4r7&R@q;w%_w@9668%P~bN4VxFNLk^I( zNhJ1m_Rh{5v>Y;>FiJq5kxj16xFH`Bb>1o?gN7yu7DIbGJBJl(CmG>Ed{WA1ixsI0 zCd(o)m1S!*wl-HZHMiRnb~-Dac=r2OVl1l3{>|Y!Y&vPmnla-lj#gElZnVekbnTbB zOjPy_T0hTezrW{};0cpwIn3oH9xg{b~m7}?lNm@>u2#zb{P z%>KBzBosCdjv#ya;0|tjC)e=_%96 zWGYMBYRvTIuKs%?A!?Ei9a-YE0=Lsxv2@A2Su<^IY-Y_{xYXHe!(s{&-#&XB{fPbW>7BQy znd0}4?mvAH_lW%X!NVAI@xkp0{28}i-g)*Q_7UarjXU?nk2nvW-Fbdj?eu1zpWc1d!%hk<`2A`ox9#S=+j_b5_Ks5;Sx1>q3~h=`qR90iSO?gZ5*`tIFDhwv!sJWW)RR-!nIICZw*A z?G_f7meg8f3y0g}GdFvFO@C|6{upuE^o!3PJbv^jH@~>3a>|szzR{VRej3eOu{fk? zPQyEt9cN}0WY>%hPCeY3u_55+%w04uXlvoD;!h~QPD#s2tD5dyo13%Jarx?`%F>D$ zr>T=?x*b}4=vUMp6_=QicznfzlZSRLRcC5@z|36*Gk5xej48!m(GB95q_}*4n7M&y z=Bh>I?Um2m1yR;V&)x(BBcq~YQlc~>GFM?t1s>*7unglV(6G6|dX%td*B(9Gzdurp zXIR)}IbzhU1Ew%@Ctln@rp$9TG`)2B`mMVL`}gmQ3Qu)35CtkzGQJ5{q%E+PMPVvS zJ=DZE`mbERLG0Iw+(&5IMXtaU=_dRA!*zK~(i9KjjKOn*gCm#m{kr?2!eX7cn_%WT z?(_Ey3?4sersG_G#kr0i2prLV?WnN0@fz!WcL%w+FLQ#4yJ7(&zN49YKYsh)#_tc= z=YQ;K|I@p&@0GIu+=u^X`gm55Il;RVKz|Hb!GCUI{3!$~s9odZg zyctGgEXxHanuDPRdL^=KFgBk>F^&%kZw<9HXW#t4Pg0+yu-?A0)gOjk2)70`s^EXP_})d;9U zO9ncH6xP5lU!V*yivpcW##n0RX9Ofm3&OGrv{~wa<|#r<0msNn zrdBPe1-GmgC?N%Om&5?{sv{{ISXea)aA>I!@HiOBxZ`z*9!4Tz3~ftcqX08UO;zA8 zKFBZraX!kL0(()KmbtJ28VS%?w`^e^M&>2-Q1oM}D`tw|6dD2ueg@kbp1;SbZVMYN214Pm+Ei5esmWKqomO?WX zGDc=G$QToI|MW@rOG{N%>=ZH?g3Jgcn-XRs=!3{IPe8UZ<>MqRrD^U0jEyb2122S| z)fJUViz(m>wmxz-W-9u5d$zz>C^Y4hV1K-*XTJsX*t+{q+4oO9MJKBdE+K(~So#7O zOB@ss<_Z=T<`x#n`3D6i@Ei|1N?F+{TZ@g2+l0j;{OC!2$;pZXc5HZ(Z2)5=l0S%g zeNbR*!iN2~(uQH#g9%vH%MTOR$iB#ae7{~@SyPqch>!t}QMG_%VuG7SgEr*Sbb*=B zoC7WN&6i}qp4Q{v{UW;%bL9t2l8=2QRW+3dmtx>Ij!6|fXNtp!sW9_WU7xP+eA8U6#2VJVN4`354YW%$P7iwvKu+QJ^j~Q--Lc z?6~s{o}S2gfac|wFFyzw_w$9)6IC^32bWMFKDZVY0*bMTF+7fZL^79;F>VPl zNcN_z`D>Dl_pb4HWo1>>abgTerRiFh2}nl9IH<+{_9!7x)@Q+^)A~>j@m=<^>sJ}{ z7yA(-<9)ePQ4SI+5AT5~g)t4w1friti_LKGx7d;?5SVZ<1|}T*O30``WFMb@iI$Om z{D_t*ed;Q&0PU590V*((TvGrEG2vkW$E)xiz|qrU84ZBa zx9At8A5UseR8>@0mgTL{0y!!cfN)t@6bUGXMuvt2_~G9^WLsLQU>Hq1KhBj@R#sG2o+#X^54}<{7YYp&6pVymj=nx_ zK>X|(@)2&%GzI^V)X#kV_ATM7;+JoqWiL`RF!iE0KfVxOHNM}jI#zk2yu9LQfsZ;B zBl888np8}8j9e69AO=yR?iQIbv`~;FfB5z}@lVB1pZ}0Ong@Sd+?IVN{?z>XYy08y z(z3D>WqGNKAV_J3LOzD6SqcvcMEZo>B;+H)lnoG@5gTUu{HwB$NuM}>{P|IK*K|zL zUiHZ5-#_A?Xn%gYSWCH8ekPk zPmlO13mK*e@UR|@j2R`p`TFhy{u}md{BP>NetEsa@5-ld5AdK{U*G@s+lLSD&K4az zLL8+Y$&YrTM8iU0a!5eY)BQ`7n?zrKC<_T#nE!eZixLP_qyFg}SS!pIaYVZMN*3y9xeP7}d&W1DHidZi@( z_4ikAU*m7E*Ku#u-@g8>>C~UE-o1VG`QgaxH*ep(dH3tn#yoK`?Qj<1ijl-HltNh9 zaa}?#O9TT+7^|8X@nOBTd-VRzO8~K6zIyW-_8l>=)Ly)N^ZGTq^!jJRtG7di1)?Ha zao&NwW^|CoHU()SkT&Wy6c&6F4JrlGEPwz0=`YWpzxd^sH?Mw)f5H6aS<8&wN>siQ4|eu`lXNQN+=s>X(B*Xi{7mlsc; zJ$wG-}k?7%Bu$eXXW$q3bPZ!Cr~l24iA=afn}}$)5UcNT@lzt z7>EpUBUKc}lZ)Ozc?{o=p8s-YUD~r3kJFxDPsLAYkDos7%*+wx^78W1qc-YN#yi-M zF$H5wVU9qggL)^@rx+L-fFLzvF3ixim!ASQ^5D^<=Z_aFrQUn-Am<_V!PCLKOi>Om zJNIC8h0rHyYT>XlFbs6)7}+@c+Z8#Vin_LfKwi1 z-KRge`{de*w5)6*i<6y|DsnXO%kWWvS2J{pqOGN^jmstB`eZIk2RC3D8X76VTn{|| z>@I$XefR#;5>?D7;?~n!cjNBR?%us~`_A3iI|{cS+-^=ico1YB%svo1&j>%d6_$O5 zc`n$dg@bj-Q#5@ZNf|8^8hT8O#Ljwg^UkeXw{JY}oU4rKZM*XL#_fb#dgFD2bhtn7Q$=+NlO#g zB0wOntE8vLgSWb_zP=tC0wVO%E&M9y+LcG$Zj?O(6D`i)xpFP;D*f6uN!#U{SFXie zrCqss@pw`yk;Y5SIJjnd^uhG>b>JvPBo@~sX=#b&-8KNBBxOB)Z8}WN0}n4;y?pt~ z#ryfRt=Dggg|&AsUX8iTymINr%`id#?Tc4pF4HbuzgU%+jHf82CTAqr`KDzgXKn`> zbYqY!0&7Je)<{Z`*Ho!)SN_~M0&BR6_{Jce&vz2gyo`O?L>3kp}R8DcdT zuf$!TUcPWDA(2SpB_>DjNK8peN(+O{JypjN9H60rYl^@HgbrDcN5U~3MIDr)?j5;w zVPyEi(7k-s?0Z8Ou9W5WT^YU*J;FYJWu!`#6w-U+{Dooh2yOVna6@83Od>leF)=A6 zY7r!vd~>;2ktQJ*OX7l5Eeclw64avW(!s%j^MfNnd-^X93=Iu*OV39Sat4MZSEW95 z%&_f-bZ9^{h!0WDw~0=w8=WiQpkwOn8uFIkv<9DPamo(IXl?b-;ejj_p=A3MS2QjIGZ{y^h)u5rbN=) zCzYPd6i3I$Fk@qU)gY+!kW4~-)J$BP0~tE3t{_o6p-0+F^icYn+WLqdqBpunr@Oc7 zd`B2>O5q~K!xy^yx_f%Mr41*$CEd9qB3{gljtMe_w~)2~S*fOmtBd4za<#c&Argxj z=J$1Xi@L~X&vhqvanE(18)&mp7u`BMcVm5jH_^rDZ^*5Zb{!(3;zTS$934EF1&NrY z@Sp(yw=~#%U`FF%z%5VqwV&-EI`Ol~ow|VJ_cv(IX*nw`-+Z9I{cLCF+0Krv)Yk5z zsQpAN&Wa-Nka>_MsF;H^LXD8yrlh5XmM*7VurXTJ*w@R&^R_@9b@= z>1fA0Se@I~=tSkBegBQ9G6@qr?^jkyKT2xh#<;hYKe86)vEw1vmAyw8giI z+M-)IXWEjqhDLj5G}msrp{_n*ukQx zhtEsLnE$mElLsMguxKX*O;Y>|(cyww+SX5+0csTsSBbfUlLR@tqP7FadNmT_` z6~O?BHCS8{8CzV?-aJpY7_S%CaqF9#PaG77hejq8oNQ@4jn~oZ>l*S8G}oVwt>c}p z>!=lbxw$&Jcm?c@2-_bH*l`ZwB zPM?B*ryFb11Kn0GUADq$U07ai(`oz^?ewXVWA&%wPAN6kmnV2kojhUUq$zV(1%!t0 zCHAoP?%nQY4y%to5{~f+6%lxaQ0HkV!NqAwEw!y-7I7^#wfIT;sk)>4-Bzq}!`E=# zoL8-nK2mr3Zp-TDn1 zd^h-P&aNnrKf$diB{q0(@ZIP#XYO41htH@27}9#d*|y!?2)pRd2)raP+`!)&xvhcyH9t~q+_*wK=bV@FDl?OW@! zVg1HUn_cGHOr17!k$X_EzyGGFqOzEyn#W2GZuRpI2==wNF*h+2Oq{cL!Myo%XU+4* zgXvp0Iaz_jwUJkpaAlEPK3h#qT@e-_w-d!jit!_Q#lr+xte1aEnTp1-W;bb!9hX3_7*ULI+oA{ zLWuz9Q&jjW;3S3`2Ubjn;={$F!#YQbV|~|e+T!n^35zHRp%SopwcD~IFe2}$_%OS; zIAzWQ=dail6d1VC-W1XrT>$}`eT+vajXH{@s>XwuUwELX zumCSqEGWtk-LyF<&_NY;^dgLnbntAq?%9=CR6rE63yQKMcI{m&fcXw@Fr1`{>CIiS zc;V7@fm;IBuP`8y$oc|v*jc9vNW7maL@Ep=&^tBi@S!|BpOtqgGi1w_9WLq^B@UyL zD3ry!LicBh@|k%BiD99BdQ=iA7E=L1rpuNuS>mxdV6)FsSh_$i0dPo)0RNX*1sD<| zzr%S%j$(Fh%C_Jg{u5zkz(~>XgJU#?bLjp=Xk_K)#72a`(h6_)cua{oX2pu7E)Yjv z3sqsQH?Ty2RI)$>VhI>oT!jYd9c_65k;Oikl@+&rTj(MNJeq(3#=u-hhz`QlgE?t& zq01mgO~f=vnBsz!E1cGE+PG#mz%(pFgxr{$fzU(&iOUu7L?D;oGgK8}gEu|<;6Xf- zaqwXD&YjzY7%2tg(H8AZ$T*mpc_1q>CK!^{6ikgi*}=il$8Uq{bcipmvAMaKu8M}4 z7@!VABX;7F{>t?W}7395s5O0S#$!%j*H%IF_YcucIw3>hxQ)Tr738SBFDpur}K z5aUq?qO28gOo60iVr6Bj6oaXOXJ&eOInOq>oVv(;3QQ%Yo|);tkg+&$xrm2@0uBjw ztHC0WAB9J!3NU~I#F!x;LCjYCpIwL&MeWZZY#~X;6wCmU9%D+2#sEN3T;{cA(e#Bb zYu7I4!%D0s`Y9i`Oq9!4QRcx=Gw19Rp^_kxV?8QeO;;!s2!)0ai~tB6ihx>RO59>P zj?t9`Rs#5^9E|};tF*>*^(t34m(?zYpqQm+3iuX+TX74LrDc*lX81}<=oO$56cru; zNlW@>b+kOF>4FR^D}9hpC9ld4g{HU^X9mdUS|a(DJg}aO>2CCJTIKBQ;sQH7GNx)Y z3Ra2C$pBWRzyPT5cuI;WqMX7aLPPh2#UxnErE@LDf((R1QOvd<*t0im@BRb6EF4x9 zL&Az=M2o?cSaUbHIjnMYT(v?MRxFmT2``E2SB!OHSiOFS=Af6RzTaN5SDaN+6=(f$9RTvP!oAX1ZWwOtIFfT;)0p_?%lp)`}W=0n-$O-N*-tc zY|TzRv~7Dx$o6gF*khUpf}_khuB?Btnp=$P_or=B(gy0jDEjvx2s63E1Ml zIV;DS4d^zNLMBsaVA;&t6T$ugTebuQZVB3uSS!+o5u%XcElYt>QLqnmS+Hcu(q&U& zSAi)2f+3Q_qzF95&2nLJfsg?5&ej0jpWz#nRpDx(gx+;52!D%dm8Xdf0hhWm}Y3h!(=7Be}RD_6AA!$W_cU~MYL4tyZUeT^YdLF7++K3 zH(6k;r*CQHTG&;NuiHrY>1|r)v2L?>P)Kw9f7{i^JmSSKX2Z2Bl$|D zN&t{Hin5A~$-q-Q#F@{gL9i*#+pxjgXRVLV8V|n^JRvb^lZTg=kB_%ETymW|*L|J$ zdbfqMXU zlmIju#Uu$sk`Y8P4w8)vI9x?2RFN>%`5sah?&?dVkUDIP@!hdvYn(0?xT{qTDm_$z`x+(0uF`CVW9UKW3I=VHSRHP%I+?+ zr`j%c@o-&iJ!8faSEt$52{yPb#d@4B+(rf&e?fohr zi(HglS1-4jK7F3UGU(ilCCg@6+r-RZPKV!ZrcV)Sp)Qg+nh0teg%go1!ssxEtVjnf z3M}JA_RcQO;#Eq{tL9oyn>J&{G;8bWHq)nBPm8f8rcHHoS*Vdk6#%k1nO>>V8DOh#g+5>v3LF;h6xrcD}aWg=fv zFq$&)6Pg;uS&=ozII2tvhJILwXl1I&BEzDqprQeA z$*2)%+)+4@3=K;-d^RK$@H|7ycnmx+ZN{uQ(-J1)lXw%ygJLZu8fql7`2Zat1Ph^U zqYlLlO5{UJ5y6tKVJsvj&?ZhCKYqga*a`IUa417xodZo&Do0iQU(fzEuw+96ZV9k# z*$kRoIYw62w-8#59XEc$1o1e=*s)fYCi)u6kaN+=bgqi33c`DEFaTggG#aS?IP?JH z7H|kfCYuG{K&eHPTOqiDuB57CXo8YvNTiGn^)!{(Xm^BGaWaj`Q&NJg4>m%upChUN zg!@Ki68ab`3nZ$rfuRc$nJgxQ$z;$O3N)0O5hMdNZ(xCD{C&3lOV(PzTkr)h| zPRNB(DDbYqVZ(xxXk-eNN~7TlnshK8Nrk>cdI~<}^HmX-`Cs@c8~Sa??R?8nW$+YJ zVV4rg>x!u8)#T4-_p5@ z=_n}6?Nx%2hoNG!Mu&<4{ROMVP<@C6p(JE1PRGEbWN-m4_W=(@00aQ+w?%S$`M~ei z);8o@VJ$LVrwK!asmx7}Zx4I>rPU3M@r57~nc8mjj6; zu1rNy&KCigGb&0=TT{(S#o)@1KV`>cU;cbG4WlWkakq6E&z z<*3IfiiNzSuC1vH$F)BG{{6SlKYja~M=WWOW++IQLK&$6%2J1}Jyw;56~@z1Td{2>)Jbpi$(jvc6LsTg1_&txyp zBfbp>m4M&=D*N`e3r=Yblt@VuNegh}`v-auBknsPV|`MRnK~N5cFeH+r{sluIt3}EI zqWob02-M#@Zrtu2I3Z<82BZT`CgTh121d?EIRgXI!QKmh%KHB78Xg)blPUrtf4+Ss zOJ(DUuED`G!0#Uz>3S#oZD{yXrIg)&z5`dqm>PIn?_i6RJs`PwvH#C+z2`6V50oRa z{<$n2jEXUr7xsZxNu!h|89IONcPTzlDOHvX_SKp|0*-OU2Q&dgUm|G$ONWOf{R0;z zaD&o-w8sMWMX<1II2XXFxPb;K9onV6{pTgsQstq3dq^E=bQ%?#?AI;@Z`Ml{1_vbF zebW9aDPMBFD<0qzAoVbz3}Jr?1lOa2g0!o*_)F8rQ~)3g~TAuEa)AokZOU5Q+4$q1Zo7xTR&|8BMwMS2Zl~N0Rr$3hSB4O zBjr8!leNi;*qkH1gXL0f5K?=puCBfTq#!Z!K?PgD>1k36$&eHXUNlT;Vv!?^{HMX=c7sMo37zaZl8E#qwtf&9NTT=Rbv9!Fr z=KQNzIuqmA!5N_AFwRnGIY9E&HK^O*KnMo#Ac}MO>;XGtrOLzg9ss`oCy_~Yl*m+4 zb?289J{alR1t(V|N2SIf@kBYm{QvGc3NVN-7+dIiFSs&V${cFn1yk!E{3ibQdu0_> zCACi;?Promygi-6{R2m(HXyMKv05stLFOsccNBBTOu3yX=HR#zR4WJila(Oi=3V<6 z^+_2~pQ?`6y}Ij)AgQ!2sD(PE&bQ4OK41 zIRBk9b)vGO>d3%{GiD^1L=ERfQqs`iA?YNLeDoN|E(I?GBMZU-M32V)XgGkIyI~RS zaE1j#|9@suRaTuSx%g-9IEa4F4g$`6wVWN0E2 z?}QNU>Goz*sQ-;$r3L&da7yXP+ux#@;I|#pfx*6!ki?DRYr!B(-#xddjw|{W1w19I}3S7prmbbrcgLybJ2Tq)I*|@_Boh#J` z*#!kf$oOL=P_jV-3lW1ROFdc|@G~4_eBClwjs6=Gi~PsAV|b-Xd1=@0ZMFa{d9@5k z@=Z7e7bF8Ya^d;;1%+Vyk)z1@KfMpW0q-|7;?0U@&U7}o!qWafu(Py)omEnCqP+CT z;Fl9)m>ADpGO$M#i@(wj;>UvRd3lEl3XuXdyl8Ys1OBh|qq(I%&II~A%Gu)l2WRUu z{-@SY($=1(^_(19Xwavnw*cW6X1kS(}BfV#(ZH-^{=KaZrtIw{S{%FfBnKU7cv9e@!=@m~gE2I3+9Po1t$(gU%Xo8(Nd;9FmR{fp^E9OV@sef%~TfPdH>kuaC4!5q2h%*=yXV0#`&FFbs> z_$V^ItPGq3%i_tC^+nF$bVUDp_crmJ##=e{>)elD-+q0F|Bd=3DrV%J`SQ?|Lcw5< zN9BhPO9ry!;hvEJ^0RV~`+pAa(GsB6$=zR5)gT6tOey-;4=>?l`5XK->CKzy*XnOx z|Jr!!)62JSUjF%D7_Ps5{pLLo!idB4!o&I3K9nMy5>m5GgZ-dH2<}Nu%Q%pkiMjz! zk`Hn*ic;jG%F3E!ez4ZsJpgg|D+=O?#l7OZ{^jLcIL8hrmS4Sj1=snnU%nYAJXBa% zR8W*v{`%PxKrvyF%D=P@WbQBi(sFOb7EPrQ8#Rp2xkQAodvkf-Gl`(SCXU_GWpG=n$_kty}iM7KQ23|%(bJ(j+d5~6*)o=9AEwN{OQvt&qnEFFP_Ff!=8$s;ZKQYw5LyB-mlBV z^HlP43)0J8yxXXVDd_|3U_0192-(PFke`^8oRX53egG*zu_X6X5iCV8+?87mXyi$S z@1Hz+{P6L^r!RnJ_VjuBBMeU0QJ*~OKqNDz?5ytZ=jUM)+!iQc1{K}sL99B6O-M+B zauN6+EQcVK&jGwh8)EeMk!tkb_{lnZ`0&}oMM`ORUp&ZuNPG0)=}>Mak)xcQn|AE+ z=SY?}0v&nOO%57Gl0R5cY?%r(iT@&WjtjZr;3g z{n<}$+N0~Y5^j=j-MtlmlY0AhcX~RJp`4zXl6%?9ETQa>4+S$ThI7IPq-Nj{ktjMQ zHa0#H+yaA$!X$4AW)yNbzaY<79m5=2pIjrZvv1wXkn_|o-M<3-G=*!|Ze71|?OH7S zc55geXwPAIgbq6U>KhU%nQ5m44;gwf?qCH?9D2?b?-_7fO;usr;0*OqXfmY@)u5 zNyBV9hG2)5F3;>EqX5&Q}fKui5~}~{)`7BS1w(;eBmC@*sk3W z2~Xa>csb@0^YX>(H$nxy@;_)7uZ>hCB;hH1D0(KW+?ad-uR3i{!>no`Ng3@2oKTCx zMItdGWuXvCPRUpXGtFR2);1H2WL{UqEp5col!{`p*B3(zv49{He9}*AXgVdqc#Mn4-JTD<0f-|bInM1** z*2C&Nsw6b@ry87y#$$A#N2#!%L5c7U_edp&bQP=={n{^di~H!^u!%i;KqQWhRusqW zuIOIK!Sr$=-5r&`Yj@~gc_&7P1ym$1L_I*|Ded@fNe|IY>1%B56?Nl1(cQXTJ?Dnn zfgo3~NU><7s~2_-UH$bnU6QUG0*8{XA`!FuNY@SnOed~u05qUPcIVFBd-jHg;Sr>L zkvOgdL!Yn!JcNKypv(21Bf4nk&OvT}E~$%iuKTRC)mELjSu|(k>3*V%d9JrEyFzj< zACHO!6imD~``jTRrXA5Sm;w7csWc>H*DksAaNvZ=M>}=_EJDU|_FPS0TW1H}iOGMG z5QDD0uU>mjbEl+i^MSrLpwD%7wjWGxIae69ACHM*M-pN29i3A#4gcn$40#M~581I} z=PqP@7@XeZL*T|NfHm0(KIKSZX_vwqbRJP zvnVnGQQ*SyGgoaf6_-=Pqe8a^L&*@Njygpd>=w_5HNvj|G3y$;np@+~h+3o1Fk9N1 z`tlaUcekFw+prem46C)Jqbxk8`e;SR|H=Gy5k?M>0my09&6Mtiho*r~Ok-CEO``tFpCRcD&uQgkz`v7?#@ z%`Dg-8W9#7!4BWm@Om-EHYvH-4=Nbo?=68_w+3&+cW5B5>^62g z-B#BqZs0c7H=Jo}hMj$DTQh9U@dj4Y>9(}cX1Lxk+TK!~6edmy4~GxV2@Au+i7-}3 z?XN2_CcWr#A1E>eMNmsbnqUB+KYL*S_U*F=>i^H55krn*zHrwvb?Zm$)4xH#K6t=YUcA{1;54c)spxcZ$pWMf%Z`v%kG zlWVj8mcT%8n_LefxP^zUf};wvGTIt)%vLnj)e@()YELy(CHvVgm@{YI68BwMH4Ud= zPhMMFa-=TylyPlsV_jM7YN#~`t;X3p`iF*t^MNY2wes~2sI_NYMw(EdZrbc05CEz` z7sM2b*}Wc`7&axT`Q({U^VsIMDD*fwI;~peuzX{7bv0f^sjjZ7imqf0(&S5K=Y)lx^7P>jym>RR>|cW7kf96O632tFf%A z>d4ytH76j+J{GuaC1`PWCRQ_CS35iSWRzC|r_QvzvNY7$!FBagYp9q_pKfhEZQ@j~ z9Xms|hxi|R6mJN6;Psj&M^)Bu*tiiXf~W`#LZh`aWE)^I=~Gv1*}gT{ujqCR=!%AvJ54$V zbfK#2`i;K6en=Y%jP1dD#)B^Js^VjiwH`ZqQJP0T=#q(4;-FnM^cUF+=) z>xB1^lcW*ojnt7@n4^RWi!yU5{A0^0I^Ay>qG2P7y_Sl>*Wyw zu^6<~38-NU(hCmdlG&X<^#7i|5Um@8!Q~UG4=pNPSa>&i2BaRSI|;!q0%t3i`mCKI@>!5AO8e65wTu zVUzb4=H=kItem{GE%50n4r&-B9_oga`N1J!2l9wqW=?)wNXR-J*g3{RsY%Od!Qut; zT>SjjHbI_iV#&FoNCpJfv#XLyt4E&21sKXF0S-ik;qwl($9vfifG0v3Yp7zc&jm_ueNOG*aL#v!!R=dKqfr+_xtq+$c0Txu~sjE9oTu+z@5SV_BMifkK zV|p4&c9Zas@Cg_crOnAu6=k9lEM0+0qAnrgQenpypR@@+V~VQ4fCeZ`1HXpA41v0_ z*v`?*c~3#GE*!ZLsDmq3G;DuiHTfI`vWiDK9y=y3Uc8b{Ve{1V;OwnXU!4b)2DyI5R3}$Y zdvT5-3R~al(a|x{ z;(gooAvpvYG?t34r7~5Gs%&YX!lGfz4v1qQ@r_!jK;vncm??1BG&oJjV?aF|`l~R} z$=%I8F@+855xi^7V;j%>gpUy-jY>(dJ+>Fwg~J;aUUVqX(HqFqXO#dBr+JFwU`K_E zqjni0-;<~eo{pvI+SJkm8>}o1xr&(00V0|pQufcJF*QsqCx;zA95&g~RGm$O&V%yF ztJk=>Z}rAB$C&{-NM2K22N|3kx|f$s01}5)!#>(BR33XUn@1`4Uh`pbFu=u;INCVw zlaD)@#!@x2aBlk|`#i8}f(2>kP{>E{oavy zyannunWm^VMnCWM*U#TR70t2GRK{#FBO>=jq(s_MIVJ+PXEHb({nTrmAs?I$sudTx zyDhMu>)`1Llx+%i+v$^#-NE4v)N_RKB9ywf*FMgU3aXt};Vv7%>0V9(;9brRiwc7? z9Q!k-j4I}7j-Ajg`}XDg*Q={dbd<5V*^u3aC5RVMl?}&dyho?9-)BrQP(wTrV1>J^ zadvcZUFGa*0fTRwR96G|AOPejS;kxG@)A>bw|%@FAB{FdJDTjSGvP^%!2Nir_nv*p z8-RfgJ9Dn)IIH#_-@g9%^MbR9E{EovwFmf=;`miGC8G&RZ+?9J`r~!#WW%3&wb!{p z>^eHRIA{W4CAb{0XL;=hP=9$%1rGy}cdE+nn*$0c(~6{Ks|J8@hY<&b^}O zDWI23y-~ z|K^91J61PJ{AyFB9PM4FviHyEv^jF4E9{myyXsOf zwsS6Ii|7nDczCpsSb#_WFY#V~N28CvZDbdyS$C~PDn^+mB@fe7BY3}K^V(E&-E^BRIxiO3ZTpHkJ zgqNd2ncTHd%7FqD=+gtQ!kW2A9b$EH$kw2stpQO(U@NQZ;s$EEDm*fC@8SIc zfm?%s%$a$32~AN&9oOgRX{vIWRCrF)ar25L_);S;2NZ>y^Nz_Y81j-=Rn=$(5mhi+ zTI@6JEJ2;4F_>lI5#k@XC2&(}`aeL9@`?s3_JFd<_V$hr^C1_) zW^LKB*&leA8JX6=TvhvBt5IDB+w7F!1ubiDnc8h5Uhzzh61$FR|c$_yJ+D& zXP+6cyE9!9BYm_)?90i|8I{I46aua&bjm#gO6$5uu8p=pZvl z(bup5NV61qqCizJydlu@aFvrYx3;yhPP1aNvDR0Vm)9^c0PIvj&p<^^F-t*GUPemWYOm=Q2tj&X zY<4ExJRMM zB?Ac_g#6k@o7nt-;IHuHKoWD_Bf^Witd zH4RLlxgxcxshNd=yp*(bstk#=bec?xw2X|jjH0QZ{chl#Njc5p37K-DQjt$o6G~xd zkU{=Y=~`iE3UhN~na%J#Mo-Qrt^{#sVq$7)Y^;(cg^^B|5|Ne^moapAm8B;mA&31k z7J9>>94yN7BZq)L2);(zB9wqpfiR;fqE-$<{JcE<-$_t>vQ8XA86T6^@6mF~nAzGu z$)~6Hp1_dssMt6#hV&1VXD5mi#J~h;v=UcMYG7_rY8Gf}Vr*onr=z6_)VUG_wv3Df zxQvq)?h=qe5(?TaJ9Y_6NJ)tBb28FUQ^0d1{4Euepo)g3u7Rvu3 zxCFHLX>cMyOcBm8;^t6Zb)eGK%(BRAhbc@9)jDdb13|98^C2<1C|N) z2AGeike~n`?~d)9+t^rHpt&(T_ojd^Q%Q6P!9qbz%fQUa&bgh34;chJTvb!Y(8S!@ z-pSp2Pe5p7%zkV#tQtBqvj{sCC~&3a`STx)tW7Pz;4Tvs7@AO3i{>RIE-C{4x5S1GBXBk~sLr4052c8fyjD5|Jy1JZ6`>)`C}vo|m_A_nEX zlQuRP!d{SHSbQMkMa-h2laZxqzL@}V(I6NhL?B@+1i4^CMi1%QS<4Y(Bgczkf^9QtRCzl>RLJm zM#Qjmhp-F|jU-4O@$m%Ni5N1Oxmks&RV^R>}#&%n^c6dp%y9h_X;Js_V;$gc*6p|mkU8;Jwm0;xsGsTt`d$;nTDuB}(E zuYGy%Af#<+XKsOma{*^gYGwurjTBRy@g~?<43J?x-4s2XE>4e2SKq)Go+seO9iFz~ zu3{s*if&{B0&&3(@CE-$W8Tmn_fGfZK2F>|Cug?xm=xbWSmTuNW zFjQ#9PJEU`c|TO!4!2#9i}rz}w?8gG1fB|zMggt@Wd}w~NJ>tPkNeOPvJTx0QA5LT z-`Ce(j_O#On46!4O9kBGTiX(|P%bVww_T8gf*c|-uZej2s(f?iyd(8KV@^4t<`p$$*6u!sZ3 zp$AX3ur#;u{RjG0+BF#G=hF1b(#o@?wnfV2CH&&z!a~m?^~$rwmD!cGpV0b>dTnuL z^~EZFe!dk?F?;*Y%ED|fo^>9-^kQXx5gt$1SMRMa&nzzE=N1-P!2UeGC+0YC8}mJQ zmIe5&rN#LLcy+@3vow%&j~s*@~gzC?1<$?8VbAK>tgF7rd!ralRW*0fVi~d`($6hG(8%oE-#?8LEQhV~6Kwm*DVD zqeEU@UYJ{erpw3hj0^ZFBqG3F7l(V-^Vx-kGhlyybqPNUOvh3D7HAv1H0uDDRs!v; z9QkkoynhByxwtStGl!q+03*wj2e$+5EJC229d4{F&!53lEiU4xr{`v8ar1}qEb~h< zSA{lc=S`GUAtxU_g#)1hcTGK+o|&1Qn?HhQS;Wu6BO(uxcBZ8eJ2KJbrOuvL2GL|015R5Qt}1+rinTB6O&~jJpPX7cMwsU4z5CE{ z2)akpZX7op`22hso^Juadcz-4&-(u~Q~ZZ|-bA8vVrJY3%A7L32B zXA(#(SoO~>&L1Mo?arNHI5L>ueHe{!WD{^;)3{mKk8<#$3;5*`7wZ2Od*0+eGP^Y2 zhNpz%yLJ1{ZQNbVDDEE9eOPz!+2akL!69bh*%$CDclSaq_kV*ulQ1}p&%@5g3qwLh z!tFbE2p+r-E<_74J~=TtHI2e>c0Lo&v~tTAZg>B|o_|9B#{V08_I$DmTT?Tv8jLuE z7-Tf}5pd;izC@=G^5uLge$&!}G&slpFYuY=ckmg*lrg?Kw*coGITQK7>K%7e^m2&Q}w>-G2plbsG|)2quPy?*JJ^@c9E2#*cAN=%#0; z0_e&AN91!Vx{5u;)hy309Kh3qCCGULnvJx(K^#bT8>b0G3WOgTesXg5QL7-h{J$rk zb&t+3Pd(B09iLk~0NwrZcwl7c2&Dxu`VhDW`h8Im{WJCe_lO>iK5PqD!T$;Q95A{# ze|-1mF1Y+v5!`YSdQ7oF!k#FW5KwzUn4>tyJ)nE^@X3e|G_v>~lFv*&_=R*fO!cd| zMdI+l-1G?$N?xE}7aaaS2GEuSfjLqm1pCkbjC>};?CyH*iNPdJ;x~@|Jn%OHkOK$r z1MY+t7sVzDO>oftvHMT@_2~aU$Y)0DYryTv9Dh2$P>B}-*CQ?I0@NZ9W&kBezgB=4 z{P)N1q=Vo8$K*4k&n^@J@HT-;v{mAX)cr-m_{8ubR6D>56Ssu6otO>sIsYB&+i%Y! z_B{LoO)f(xzx{?jGd2>@XEFl%?9smfgVVy`XE(Hoi?~bMQOOZ3Fw#QNse5~Pc&yhG zPC@mR&#zv;%6rX^&}Z8LBKq9^Ti46RrpCtK;b+!t*b^%Vfz#cM>)AytFY4P^00@8L z={0<7tO{zF0Dk`P?Bzf3Gs8>N4U+&rf1SJg;w3=QWC(u7)l)arHPk%%@QZ%l2RE%1 zgjqmxoLKsUyTD2G6Ra~qR)p8N3}1=`7S3$`^}p!n?B{e(p8-=%grA=g;pbNXKSR>0 zuA%ZD_}S_D++qc~|HA{DM5sD}DxQlMFW@dw5`*bFZjk=w&}hMq{|bIiStUW8GdI}h zlp4l^wZ#BGBee-KB_jEFn1L*ePf$)kDFVR;v=dap1Y!|kIj#*2p7($WSVAw&#U;2K zCiK!=T}lV|83+HSE|V<5f4G*Go&y051b$6*UC{;s&CNuK(OiVfav5PUPITc;QbQgb zvpbNwJ}nTKtS)jJhcqNqGJbv z0v$eaV8Xd@5sKcBgRb|Fm_jW7BB1drcp#vm?*P4q}L}7ratYM<{l>cBx$qL-~txqI}p%Jm0fwwT0TIP44E8W>9Is?~Aa1l@m1 zKyy5qx>^i;eQ9Y)c|p|%0!@w)J_E1NE5!@IVG|Vw$j75{91z;hp6PSI2;~f1xO^cV zXd#P>{}F+nLkKhl5rNJer+EBmYPh;ErG%xpw5U8^!Mu`yKr_WYUV&SUV#56kC_o@$ zfOAl}5;*6~nLZ~B#^q%1w*1_MnA4D?8AUSVnxQ*pVi zTv`>8f!2Ps1h+`VgjL;86$phnxGp{jn_g!OIaOHC`NK-UKtn4}#6aJh+hCxfmFGVU z^w5*hvGn_tWA`2rdwCKeXy1Y|T*qm1N{sY1{QLrOfk9tF>3)J<2P+M8=>aPk!Su7) zq8L*7?iuLp2@v#vCqU4sv*-Q$_tHl)?ciISZX;Fc?uMVJgg)x<@zfK<7`yKo5@MZj;>_7`j8~ z{CV@iE$IBoePR5@om=U*Dem04n3o9*G$sd^MVp)4jTmUvn{ba=OgMoXAyZFK0gwcU zG{DX?$OwU6pf@=C2;NG0V}pT)54VSJ-bjZ+<(osqR-i{l;oIniV>fTy?k`HuOv_?G zs7UVquFKm=FoKsLzKZcX!DmpngOnJe6oYiRj?>5tVuCPik(ckL4w9qJptn*6Nv>bd z8l=5`>t^kCDlxh}mqxFp4pIa2bmInU44Roim!2JS3}Mi`$KZ{W#ptmMUsng6=!g>` z#PP9XC+%Q#7#sBoy?WzUpU~86FnY!{uB)g~XabRg-e?qh^~HAUkcpc0ce`|lnVervv~}yz-f#;ao_;%AT?Ao z5e^wTax=6YvxPy41a!~U-VFkpo=8CFT)S}o;-$U|h=4wSxjiAHqd7StDGN&*AK$Z} ziDA;Z1h-N}gcw1(2B8cNjf{f7^_UF|Odz03&LaYP2W;2C&j7%KE|rKi=sAD-T7ggJ zMfCApZ|b?tXD@Z2KBGx-iSgLP#DtVYx`c#i1VYmb_dcHkOX&JSD9J)<5~x17MkcV; z?g9XX>7nbe@`1FGK{aE0j$Ha9l4wC-gjV$hnL4G4p#@9AkP!tRTVNw4ngJ$n*& ziV8rP4GfwAVbG~gHdbbqPJS_o`(sk#=nw_{#sl`_!>?z+2ujnGp&B9NIwY&&>UT9X zHHAP?%mxL0?li)kPj;O=+nMKMs-dc;uICU{c>-FUc2S%}81%{XE*AI+0thWG0 zu9Ho1rkeUDIP=Y>h6avFbtg~4E_wXe(G%&%*-jik0WfrsnW6-=sF9Tx7glqRh>ea$ zF!Yh9`&mgbwNHP!57j>rl|K}698eNgmj?X_cjI~hh7Pc(JK53M(b-kEN7DekwQV!d z3Z@2Lz(T{z20D*-q<69b(9njpHa6Fm1t}Ah9%(TdtH|gm+&-GXL(7PTu7VrwBEpR} zlI;kp6e6B3tpuKFKYR$`&_~;kw1t~k*Z_5%Vn;*BDLdG@BOJP&{77qpqaDr(V~SHEg{*ms z0+Y0gZ$v~`_}-?u%pJeXNP-z8=pikVAXcME)l}80Lge_KY;A*WxUIFdy}j7M)ZPZv zZx?r*Cyke<8{n1>fd`MaX0*|?9&Sx@advZY@wCHfk|ViC8K=l7V;mF_9J;4rIvs3P zz};mLUIT1__65Q?K~F`(US-w6$`(y{X!Gc70_?iAwWaw`ON_NGfOT%}CaN+LQu6BN z-oEbcE^)Q(&1o$x&CPA4zOEjgzAgqbJ9&5oM3pqva4L-Q%C4ayA-;8wv2cr1hDUJ$ zIZ^ztsykdUBd`llUwNRS$qa22?F~(7joX^by=+{Z+&!!%Iq47{v6)NKG5}DF4EUyC zQv(puu08?Yx_nzv-!gJ~w%uxQS|}@;1%w9p)ILH)bk*V%ZoYt!&LC=FgrYEXgNAhI z8c(?GvuLQVPp#u@sK+@wx_WvV!f$~niT;CO*YgSRimGf(ucK+m-m^E@j(|hsfb!i+ zxm{5k1WtY55Pz?lhyDy?nA&A{kKSAXAuodj(v5;b@MRe+T;+jK=vb{&Qnx`vSBJZ} zd3!^9X95ikm$%LGz9GRGbp#r^t}H4j)Q%qjNzfHJLF(gB(bZ7bat-tY8rqSZ64SIg zF*`FmKR2ICFb66r7(`g>h87MRNwPdCMmA}KhCW#0@8KO_1_V$Rh8oaK&ET-OG9nJ0 z85ZUauQJ%cp|y3jH0}26@u<413juayWnyL{Ih9TDVLFJGMA03YLSa%?T3|>DICMP_ z&$LxJdwl}j#gL@?i-x8$4~x#MN~xf!sz{Cq_y>m;0)^AU+t>5JbrpE?%?bSDsj1mH zLVg@lc4%V6KnowEnhIDws7g%r+Y_qs4-f4ai-o@~hgdA@a~_`g(|mK6p+B!=Qe4?(yWqk^Fz`cS*92!HKLc)q6*9=W5C@m=|F3ZCD{YM&F($K)v!`<&7(9m0)dmoRF z9tuvrKRX3WHJ3q1F{I#-Im7{EL4hK{hlLdZ@YuO4d4q;d3X3oY$SxJb0X_SmyAnAF zq9i07t{K_I2#C&#)CTn*M@|XfAcs{W0@23CrtZ#RHIT+<@hnKRu@Mk&8k-^H;b&2@ zQW)k5!fXnGnIJ46vRznM7AXa<7W649Mt{spj);>$Kr}fi1qBrij*bm+&m`n}NdzD| zC);NOh=xW~G?f1WqV-J7-E3p)!niP00+K+DVeCerHWa17k%*Ck=K?N+1s3D?K}8bEj)@lTt+bL8`*mRLg!9N2Y@Fz6&Fufa#9Lf zRzXpxOYka!XFm6hxCI1u|HIzwy=D zkF`&&y22bx7^SkrWNczSR+(%wzqtGA`j55s6>n)imQ4^VzffomOIH_5K%ptqM(>P5 zQW=>hWZcoB&rHu|V>OU`PS{s6GIIB8q7Jn2xcJ0`1Z=Sk(Jljrq}1qGIVn2i%=|J{Z&KEU-W*We$&SntL1-&Gd!Xre!&OPY_1suYMh*xxDCg1ffIu?{h*~}V0pFRh zmEOrhM4;8(5dsbE>Jb8M*fETLj`C!>Nh zN6I3$ILSg*bjKzDpkq+AYDiv+1SN}rq|Dx&+`Y1rd~9?eTmk^?fdFVj8~g2K7zUrS zHwSS;%)bN{5CI{Y#*l980e_}r+PVW?qrQWciF8v;9Tt_y1&8>T)f-UIv$FH-+{wei z$^h#J__GB8f93)FnGD032xUO1oe?oj4{7KPISmw~a_kmZz$8=_!0!?n5EKx+x1b2h zg>e)N2r&X6hY{%K>f*hD0k}YcAiwx}L_aeyv9O@6A1-_tMgvbveSJe6Cu?44Htc-v z>Sf#j4M7tiB)#w8hA9cc<=BG?tQqV!fxKW#Eief1=DmB0OXUB>KGOpapbC|dfQ&%> zpI?Ai*0E%`iV>O!Zotp}*4hSoTDG1_u)m9(IFGwb1<3(|eucY1OVGv$`osOPDlBVq ziWXe0Sqy@}%wC_s;#ONhxI=*3Mc4!cfPKb#?)8OwJot}~Z%KC!f}gjNvT@snIqK+W zYnlWj_?gn{+$EGZ#`QB3%peDXOoki?0aA(GnV6i26^Hq3x83UtuSW0$__@JbdN&Wi z&%(9`FC4;pc&GS?`?@>2?{Nz#JDF-GK!l%#oT7e%pUE~mUF?MidP1UoU;uZO9%b}V z_!IT4YU~c2#TMAFckT7^_VDs_^^B`IbG$q;G%D|K&)Mb}XSY-@4R0$ecOOqTA3&eu z_Sl=4ItA^IbT`yc)l$=sv_M_YEjxQI5IZsTAz6j!I4H#@#{5V%c2i=UHk=sb3Z6hd z+j}}Ygrt`@9_c*M(Nvoi=nin^YqqqC!>o`$ljhPu2_pdI2)q%)7>y2(+d0&?!m8#>PK zD^!h@OiD=cMenp@Hgt1!0`%G0$<7)cF>Os$4eXs=oSmFq?R6Bj>|C8~5%>(nwkZnY zipoGf%NqE3z;hVsrpV)vDMva8Os5wF1VV`o=s5(r5d^_oHCXzj7(4WaH5M&LCn&JO z+0!`KJ3!Tqp@N3FJ>LDT}Ho$y@BT1at+%>DP3I*dvUX zG6#`jLp~TlCLjQA)?(>!@#YBi1@hV6-Y&zI+1?t+XMJl28(koub!{!x^E>l|tpcJU$vGC_|bsA;v>&56m;YBb`6jvxUtePST-+Msf-a-3KBm(uL5{)}w(Fbm0w>@ID_2Ekn~3V9_Wo3>BnhrKMA3Nn~Ww zWK(5!Ny{pm`Z)+wLIDS#Z{y)3kYVT`wDcnQ1ErZz)PQ_R1!nt2=ZE^?M>V#3Cvm zP^Uwz4uWQ9XdOXoYQVAsJR9f1k8Toye3k<8SxsBd&_q{GJXexkN>WrrLdVSuq0g{v z3aPbit*G#!9e0G2&_V8BGSG&rHzdnO>{b{y-d_`HMIkcSd4#2HyYy&-_i_pajl&gRB(YxFaPX~2aOi~J# zG{Rmmg@g`6&dMt!1}Lu>kk2?VQedEQ!fGOt%KBDzX4=vO_?bdBsEClYgd{G}1fg^Z zDntlnFT}+puI8mnz%w2MpCrV`K}Udn(V=!q(3lFMo0Mt0fRKm;P6{WXBPj(9lT|de z^^EnEpzjBIg59DW1kYThQRBih8O`cLkvfPq(zMLi+vYUu*nrzzr;i^5)~O1 z9Owr<$K5;}Rk_gvDm<%DF>TuolqV3@z+Y-{bgFj~TF8#ph$mj%YN=9}; zNkw&S15~0A^3q39t2}g4bs_l-ZE@!=T)eO^30I2cOib7x6B!;7=#LCJJK9-Wni?7D zi!i|z1d~EyLP^WYEg&K(4e&D;6Tr{p1o)YjUCzeA$<@o(KPW6JHZeIZ2MpHKH$xsA z!U`kVk15^_2g0VQ=!JtI>~Tga;TB04x8m!4f%dZ4xuRlg9{3+9H- zkkhAe-IRU3=b7O-u@K7xZ6YGWg8bp7KQ0agQ@UDe%1{XbIZb|EPNq#{dB~$U5^-`m zHXZ?CaTy?=we*b5tpTtGNH;PzF(o6fsJyzN1+@i)vjxs_WCwSO=FFMib0PESpg!Vh)KK86^!P>$V*`1%yPU z=<2m6Ff3|+Qfd}*VIzbGl3fTp3UM1ed+yY;FYsE6LaadI{^(ybf`zg$ zHq-;(DFAXUvRhy$Hy6ABiGhZK9EairN1~0INHemsb8+w7B_syavzn%^5wuircK7uU z4v$Gdi&k1y2N8+i`nsBGDvHRH zV!{Ak15nP%nF6m2)ZyCB&C9n7RRW-%-w2KeXF9t9j32rWc{8`D;sA8Uku!PfkUqond0Ne~g|9dB>)v<;;N;AYL11p@SC#`Q_U}ORn5SEZ1b#etuK>S0E zL3~n5W=>vF8JyrK-%iwRz^SOJ4R?eQx_z8%UJtr=`TqL*ynO{}I9y^L7L%BUWhI!5 z-WM4GcgcYPd-wQydwIIUJp_rfbDEP8DmO=U_3*N%pisbj9SGx< zhYNB0;2Ap?OOlwFfyE`}V9DU=5u2ZAfNDJ8IR|AFQA!aqLnz7pE1?c8-B5GDe~Dae z?QKns>qi3D;SIy<@Xy-X`j7Whk;#ckJ#c|TkHNS!2|~V$SPy{m<;1a&@Nn>8H9>rW z$ZBqBTK%;C{64~;qZC7eFc?kP9nlpG_DF%a%QN`7Kkzj_KYCCLo(Kp#HZl*X4N_k0 zApY%_uV23YuYZAwkI%+hHBf$sU>xq(7`%F)um91n?|1V=01ZZ-hvK?~1z1;D+duXN z#=dt#A`%|uA)kQzfD#se_Up&m&(qN21CnagG4FtH|I=STq0f2GZgOa=<2VK9)Sq-d zVX8lWtgn5ogcsawJ4M)${`CA|#y{34;hpa8PyYPmHzxb@>k$T)u78_(IEpzVt4IG% z`)?`_tp4$p|IOg%TQ}bQ_QyZ|@!QP&mp^XwH-q0-Ua$T3$3OmY?bX|Vul?6={@VZJ ztNxF{wZH!V8-M?V!yo_jH~#+ae}6paelz$t{{F__Z{hIAKmLuszw!6SgYGwjf8+0O z{QVXVfBfU$`1>1we>~`ZGx#_D{>I;L;qb>l{*AxC@%P7r?l*&f?{NvyF z`x}3MJm`Ki_&5Ik#@}z@@W(&?jlaL~_s4_oH-mrU?{ED577l;>Or{rV>W*IrM5{^w7B{?qrBt8f3j)qgC0ohtpe)*pQuG#LAL)?dBKr#t-PkJtYF zOu;LU^?cZP-hA&(t42fVK5+Z30kxj9UEB_>Y76Ke+;6>-7O%sJuo6 z&`^YIczXKJI^e}%9O|P;Fb_vS!RT;y?$w7c-`4*3zrK8WyL=~g7ZvJ$`p*{`lVSeF z(YaUu+h4C&9uGD9azlR^RC$iU1o%iQVlb|S@R2Uil81+$CJP#KVz%s!+8-VmF3kg< zF&qE4fdBi$AK9QoNhI;NVFYq2!dTE~Ei5>aI3;MOhS}-kyJs&n)InbmWdvL3yQtY7 zYKa41Fr3f2#kv(n8vO}A3ETfexQ0UO`^I(PA-j;?m+$>%|x}HH=FW{7%`(l`Yg$XO3ShxVM+*p&Ik9 zL(Ec9n{~yvyc_ncP`T$?P06OV>6Hd9eUwBpm;5XyRWtP4>XeB`m%%vO%{Y1OokOc@ zw2b+DI#-_waZ?@(N&VDe{XqBw5DQlEle!R4bAM`(!6Y;>cUVWs0 zkvrD+XftCC#-6`M?I1h5rBOP|8F}Rxz5D{&daKfNFSjeDnMLN$)Hynq3wLTCs#?%s zbt7fm)BAel3N@3BlCsN!%GeVry2@ikQE_i1X(uE`j?u~9TXAp}XVH|C9z%0J+$p{qr2Tpcb|v%eE)m<7e7eN~BBqY} zyixe_?D+hw$3$8j&-q*KlvSkoOZ2?yl3T7b_8)PKvbq*wscy5brjt`js`7nVG3ik2+^SC0!EFQP#qXVQbd;*vQt@I$_aPJ)Hh? ztC-WZb2XTwH}}MxINCZi_m(>?I4NWBfQDz>D)*lNlkjQ)bg@T#9?fm&rLh29Zp}vLr+Zj$+o$$!ajuYwr;PN* z!P~5JorgDPwy%2mROV4|3Huwj%ZNN`y`mfc`mUc5&-KkJ-HoqqwJExqJEc<$gf~TQ ziLH2kp)Fw*!_zkEP=onG5g5#4{%G{-%kZqp5r!+cRK5o|84c%W z?xQ}}V$|;)Et}lt7a7z{rh8w$<9_btSBJSyJY-KT^AI0?J{5FyM{}i~$v34dw$0PA zVi9bC6tW+VRVz*CnW>TljTukmy?l^d(ql~7cI|3fw`fwO-O=0@kJHNm<1H&{vD+ix zjhC3G4t597u*XEc6s6nFj^Vn#N%iqNrI(AF-CEUxt23l(0-wWG-{5L}y1xgl zhP$4uf7+u`m-j;k4f~b*8pI8(gw94gn@OCT#a(5ht=xZpjE242>TV8`z*6awfV}`+ z=#C2-I`W2^*OeWv-CXf(38xc&5f%nzaa%0Y`*O>Kpz4!0hsCD42qPw1Pt z`cl29{~N=Z1N#(`s9EqWUFS|#o-wld#C~k?MC6C_{3`YSR7#A>96Yzx-qKZ&UqYUzUeGb*)i~eV#iwn47AzG{<=|4%_Amipb~mQ$*Po3>dvLa-2|8y?i?) z*zMx$ed^@ghYf{(nBk)~NsB2x&t4DT;d(-a^dgVyHX&&$U*0WpO06FY86FE7YP&p3 z*;(A6HTYtnL#~86Dbvu{%TZHvXujR@dsK{u8vP})1I>I{LRypV?6fwqW|7AnhriRG zjvR11y*qkGb}+M-8Mfrol5m-egnK~i(8{pz-8;qtk6jjMf8wTDigX9n-}E^6@sQ0I zkZv*MJufcmMS1nnMDCW4{3f;USPbvJ@BXUJ_*ML>-8DbE6Q7=o@xRP@zC)7N{PehU zM}s%{tS@)_W4u_d?EEHj0c@6pAFo$+8G~OB9+PN_f+_dnTVJaF_nQw8qTM zY&3rDOm7a3-Vo~0JEUzByf?eM-jh_D#_Boq3#(44$yklC3+kpf5^L)N*}J2dWxnMF z8s5k`GAMx&km(f^&+NS+w7~Bq?sTjEY2|gSK-b>pcRh^Hzqo6Y)ekbuu@>4kmgU#K z^w&&?K5uG3d3>DqW%sj9O&W(IEdx#odwT9$qPKMs*3fcWuK6N-XV{x>O*Nq*eTWyU z_#<1huJ5>Ieol>R~1T)SJU6P?_KhZSvL-I`0(ld(4Hiju2ZGHaX$h&wL>LNOgJ3M z5MWlkAcdPgH^EBRvri>WgM)F1^nO%zY~>-Hme-!HJ(*dm(k;0nAHyC#WhKSN{@m<4 z=l9ITnw^PFhAjQLR+9+F>D&r|nfrTAjY_0`JQr>1x#jTWfdk_q$qGYLZ<(T-P4X^9 zKab7$Qb*&a)_IEK@;jp|DxBZa*9M#Aza>b_w&>U$PFQshxTWpddal&jsI~8d+PbW% zY19`M5*O10>r#y5Me;way$ed1GhHuMhFkc(<3q%U{b)FK6 z6{9WRzv5>T&s#>H;w^mCdHG_3*)>lujpxa`XD6r+HDn2==yUT|2`9`sOzNeMg@&K{ z;`zfU4_lAb#Fu}?HTnCMSA3N;JnwVmOF_u^ zS8F~yeyckzy{Xa20rRoNRIN6w-e;~@7&x0>;} zY?-g|ROvv=m*OKi3`=>KvOA9wJnhNn1cw-C?gUG?8?dg&AH1{2Qjp7g;0@z$&%NC0 z*4KM#1wThb29)p46%X*fYrLs9ws38#%lwvqg4vayrA-18#{_Rs3tX7BHW?bv{%|tr zCc~%dQwHOgha+ciB$ZrsE{?5kpPs0GA+PJ09q8yR{H)dW{(&#$kLtXVoDRq0FAvK- zby(u4Lm_M_MFYjnxsJ*x4(*oPhsrnk8DN_CVkDoH*9M4L^P-~R5pK~0@kT1B0jpO*&;Il8UwGk&VbVCK)1 z&3%gf;rp%X(Q*3t>{r?4g*W5YrVjrID&}-y-j{RdXHI!$`*2sef8!>)pP>h`VyWnD zZtU@*3S$yA)`!>VbTMhYe#qXi&B9z@JgRa!OV^pqGE}ppgpn!MCDluoe7T(Gl~P}y z(iRzyusDiyWG4GhJ+qh1lRd>q?d9edHrD)eT(;$yVfzI;-V@K2X|ZqUMMWwu)OcU? zdGsk9?v!~ddn|W!oYX4s+dPrmoz(5>FHq_IW1590$P~kx-O9-5l~K}RdpoSbYd*v> zzAN8!*XIsl#`yuWmq$$8T3-1LtcLy!tZ#RvxE8RlLriE~_EK%O!F@v}{amJ724r{g zxSqWY!U?d19(FEPkm?~>UVZ!Z8kXw)d5?NhZ5~sUDkWY|W}0DIR{b`$ zc=MrAv&pygm4-&FuB!hChE62x-dc-*t^14$Ydt@|UAFOAt2b22M};Q7s&pu*$TL1o)YoUCey&$@rF(=Go*-`T)<&V|KT_1aAA>KB0SwBz_=aiR9@?c6#-yuk{zY zvBKpKJC&WDllCM<9=uZ!WWQD_TYj9zBah_bnJLRYn=rY=*sw=!mPh$~a+qCwqW25E zN&o0}=KXk=aQ39~D&tn2mA+^Bs!vlb?G-$dbI-9W9Fs8Vdd;Q3LjTlp$vc3%y@|zt z>g4WYG;w<`#fWfqIXrtiBDJHBC9d*1NuUXJ$Z=jBgOjZd>%q(FT@ItlUq1VvrIL*u zs22CW5GL*YvvBUv)4R@o59J^a$vH`;^yPMM~2 z_q8P(-?d9xT-hI-Udh#aaBJgysQ1K1u^E55#c(x*DRTS$=0Y6i^f3c3?{I?;UmCB7 zL`#Pc&E4cqeW5|dcqSwzA@Y9ly698$XpfI`Ps_>Yt&^x)4zBf(=v6)WHrSUM9!&N8 z>1pK~{i)l-I@=x$?RlKf-QCr826|R+Z~xrk_mJn&c+c%zj~&dCT_=5W90LZWb@N4f z>$6NAO()KTd%KZV+E+~vj9Wf^=t|*I(YC*thk?&y6@?%G(sA<_lvY_`@neVehAJOsF!W5Gqw{x8& zdqzf1t*$9A6kY9j^R$WXHIIdzLsSGO$H+*sx`?Tve_ZsF(?SAmCQN*D=O?lhe%ibp z)d(FC8J1cQsZ#f!4Y`pbJFZ$jvh3l%^X<>BxlHx3cPV>5Igut_8?tselBPgmkSBU4 zdw=4CuS!oSu3X!+Jz-~U&;_cCF7)+HoE$fL;@;^C(1gG2<G$qSRpVW8jQv#0B>6f0pl|D2g_GA`wtlZa(V{=sO$@?Y#6TuDga{N@Kdmr8z7eD?%Ov<#VBmR)ByFl0A$<~LBlJl3C z%uhJmHFZS|n8#aPbfllB*`hu-SF5C9rq)jJj9d+eJj9rwk;Yv8?QL>_FC@(_6Npt=TL*Xnr^#hxI**8y& ztvHB&^X~lqjsA;Q2C0ZQuaRT9L21@w#fHmt{#gpCLPgr)Zf-KizcKQz9)2%JF+J#I zKJn$qqhW?0qEr4ssu?Un4s0D?9V$H1+N*BYEscEKrTwJPXf-6+!eM?^NPLy!c5w+O zb)_E~Cn{Y*J7sI@WPEgYv{c01=On?t zFRbbI+>jmnBzv*o^d6?SUw4K2jZPh*?o`>W-yPkjdWNA)i$(FelnR#R!7ciqOr}!2 z-OVo#wC#CV>{{C`K{ob-R964?(`x+#S8vMgIy`zqom)tlg z|02dR>qVVe`kNW0D?6IPcbIOK?pwOF<>=wo8ziA$BCD9E-AF2rVBaqYE;XyX{A6}3 zjISz}O5y3H&k+Uc4Fyr(t~9;7$u?YcnXJMdJI6(8mdkj=gM#*X1F!PcS54va<1VAP zc0-JqfcOS~+(uOxn$Qc$QO6=CJ>(lgZh2oW~6B7?XDIFuHi`R?OLgR+R@j zGSdmqqL{OI%{_e1X;N^XXUvOP-E$J4=OGT( zvJA}ATfEZWW$4}vbM*1e7F*-@2-f8(+*A3=;Q(LABhRiULbS&Ne6Op~ zE&j0Q96xh?W=^JG+&M9ObmZXqdzqQi>{Z|PZ=0RbX(SPLxgMDrbTj>a*Y0cP;k4@g zPZI*o)tr>g`^-w?I&ZX@8ytDHPi^3qVEv;#=OZj}?dB1rr*pm>%u=fvsU6;0ggdg3 zpcUpAVmW?8jaKmPgjcB+rn|`S`Jo>FljQ;zIbOV?*|Q1rc_cxiU)s4+d{M{qaY5?l zb+`RuyI=cPA6Spt!~J4J4*T$WzOHEY6>*cWs&5za-^nwpK3Tlon<*cR#ge*}&K=h6 zdwslz@vWGZl3&OVFU^y#lgY7xx5~!**4PyHzWq5z8?c<;Q)T=_&#ETVkGYBT8Y@ll zCD-hXt(052EgxHE%)$#h;(VJvaf&6W$Q@p$i(`NU)A`TG8ALQm&(HfxA8&T;6Z-az zPe^|GKu^Qn$jp$B(n9nAk`Y(8%P)y@f%n(;w`20j zHeO^}sZPof+&In`!C7YeN4_&vTnjF5lghTqHxjdwiY%Wwb6>WXue4AeBc&6-)uB*{ z_3F&7e^YM$QSG`(fb?sJ(8~hJlB_+ibeGPvR;hd3SZDBE4ZsaN$}L zYjtU{VL6qGf7b&^EGTLGn+)UWo6jQKA%aZR=ueO|c5IJ=wD@!aLc z*On666%S%hK3={0a#9g{fs>)ft^ea%jYfFcnjf>D>Rmwt7ovy6k6D+PcVvW2_#+s+uj^gxX@RyWPE6GcVTkBzAkM21ZskuKsrU z=X*z&7i_O3R+W9?`tA8=$;jiKoP@unOWBo?UDAw!1QgO$RCX^Dti!%hNeqRrg6n7<+SO z-OOb1^&wrZyXS{!tUfBWkcL=j=-um@?%Iv}VDom<$)AVLYJ4KmGQ4B*&EkjUVJVZ+ zQ|B2DOX=(yPnVD4Kc2gZy-;uBbiK9JW6eIP;3zi@71}2~94<_8T2IIemMi_dP9EM_ zdpWP+=Ck9$$3q3K_}y(}d7C!>D8F-edYW76n$tUzZ?iK2S2SqM?BjWi`_C>}nm;4G zOs_xn_DS>gfji#L#lvFa!rt-PBmKK>_6+AJ-Y`03sl(E5npic={W)*8FV#sfxZJ7s z{YxF$0qRBiBKP__-RviwqSxw4G;;Q&^y(3k&I^`CdxEPP$)F-1331P9drkmT- zGWpVqc^qa9G?X@t?4HpauVd|(p*)o+aHj*aRl_Qt@$G)<)7qQqUAVBLud=icO5M)C zac#uQogDj@4Q|Pt|OGJx!Z(nWM67f@G>qxjBHVUS9OL%aDGZqFnrly3pLg z@|Eo_L1A`+8sEMbJY*x&4=Z_Q?*C)9x7h8KZ{nqoKeXhzE}nbfCh5IwG4u4{9sS~k z$9ELW9p1hCl9aE_%bt3JvnXtQ!twHc4Y5GEkD5oc1=zkcG#4fAE>&1Z(i9wY9ewuD4%k#RcAwzR>DxyR{n${-zDx`{;O_Yt?P0>lGmQ&{B`13OykroQ{yYwy1wsIb#Zze?ZC=;koWopzKIupk763;lCAKMwo(Wm z`{pO~Zs_8zNPOq_Qw}z@%Hf;`b7}8>dbNee?e@e8%(a_a4`;0=&R-JWJxS*3zVKY) z9hua~LB}EI*Bm*_=gt)wnC++WTlc;i(4Trsmi^29$@8m5(fZ^cgD0pHL@gGX-#p3J z;mj8uxo>0Zz;gdxi_~lf_KSFg)iX}nJ;zRS7F-{sX%-Tk7YI03c*>35j~DLbohZGRMmJQ(V1^Zt{6PKEiT{|cr* zRG>^&yfd1aO1iX^coB6zS9RJGMd7c5%KPp{%fdP*k5s@lFi;rp5(-3`JbvS`n|JZ( z*gcX#zD!-&!6}VQeEV8a#t1aDJ zK{d+@F1o5e@0T%25$vT&K%w=lRe}<<@mv(LG3-#rRL7RsP}1gonIx2N1D5+0k+N#4 z#15L{S&7>7kaOqV(mJv~$_o8vsjj&T1Y%~Btcr2F4cwiQNwNR{s+HsW*dw^Kk`VnX zs|oD}apr*oy~Y9%lUZZw<-=yX6Ckt|Za}m-jHL{(V z5QFLo3D$^Wy;ifo@~LS2`J~8GejX)5pmn7^C!vhLzJ7<2$c7`;3gmM5YYw4M5OV8y z`wN|l-fay8;AM`Vnd?g=KH+G722&36^Mzw>tb{=k3`bCHmLc%(A|_nCN&!C|=M6V{ z&t@55;jCUS|0-G3)xh7CWg<++7|JDmS3{_|CvLc*b|pr)cX0|rO8x}l3JOg@kulOr zm6-Wqg-Og?D!|6$^gO@hNvJ#qpWx@DVT8v-BvvF|-#q#%w{!-Z3w88cOFz*t$c5Sq z>+c-U!UOj~Icf$vt+BO=RmPv`A`}W+Piu~Qilr>3vlRbb@8g|S%z5>V7SiP$yOd-3 zS_@y~h*+k?jg5TdwLk_HX0h(%#3j7Rx^?z1FXQy{%zffSf*r5%fxe>IP#~>6w%QIK zIxqTlv5>F4Vd0Ify1CDl4DD}n)nCG4YNEtx&_yUjkZ9my3MyKLVARcPuV1*ZjDpL9 zDUCUKenk~#B$C26ZD#U8s~g@lMUGgrq2uw*W#6V9TnGoX8MqsW3i4m)CVVp8=29~=Xgpp(); zykH?nK1pz?7g!bB&OGFOhBJ0`uec4g8I$UY_)Kuke3V6W-+unW_SQci3zAKhLO7cu z2_x%N040Ers97TqdT&DLlAU&~l@%o#+QVX)xl<%?6+l(L0ej1lI&#QCky$Q%RKmqrtZGj%ID6CWiEICn^EA@e+7wE1} z<8)m&6lC?Xv#HNdtwd9&pItATv!SvzD-y0IM*|c#M@5W+-S?PCI6I5Rrb!qYJU8P zm*Pr8`^}GkO>x>4l9D7H5EEVhc7){t7nn0cNpmsLoM_)6!5b!KQnVNddbG%RR4oRM z$rya446fjr`^$fD=QnCw zRGA=dBY?;OK*H*bLKsI{5s|-y1QWsu+TtYrrg)BxKroEma!{ukI@b0(J>xJY$yly9|xM4iz}29RVr5Pssl^ zKyOU}T;;gQD9(S|@koVxis!$m5m)2q@ZXE=*MH&BAMoh&FSl{;w^*;YpwHpaMn8tz z-)@+H4X^$itoGmU4aF}3@inWl=#v13bdm2i=2h(BtYcx;6@0T_Vw8AH9j5<(?2??7 z!EX1@F_c|!)&UBamN#2yDNMuEYiT#301Y<`}psTy% z$^w+F8*8vd>>RUA@w5Q&dC@u;GAH5aDS~xEKK+)W!JZvO>VZi(vaixNdU1U40*2jT z^f@Y{x(E7Ew{M!=Wv!g>+PfIxQoX4x%rD8Q(spQF-(fO-3Jq|*f)lCXaq)94gSloz zxXCDkx}E`0RqHd|r*Td$v0W2UU79N>R8)?79SP`vc!#w-+G$*EQzkj%;OnS-!^_?> zj#$%}B1;APp8c_!u{YUNHZR!)e;LVnM7I?~ z(a0t&_5k$d>9%JGl!3nbXB-;;9SotZ`N>FZ@p8E!_)0NrQ-1v@yC^Q5Fu<#&N1Pj~ z0{oe}E{#*nyKHIi7L3=xcXS~L@XMwq>fp4L%J9wtzpm%l!MYos_SvBTK*fb);IAkt zllS04N*$iJ+WRs-7WF$-Tx(6p`OUbPKyKtccEL^vtSU$FLxYaN^rbqcvh~FR^}qy& z9!Cw3m&qb;)4yH+I~%*V1moc?45k&9-0N@nNeXtwTVBbx_CZx;I{6c&rLaE>f14-~ zPpyJ+s}SBRINzF>BSF~)>r4YdMco8LmMf}3$=aZXNcsO>(7n@<+ko5^dOk~IYQhO4 zS`Qo(2D^F6O+#gUyWq0jNFWHSh4j@Ib9Mq?a5Q)eM2y5J=wA8nI}8@YErstHP(o=l zK2>_>)0l-nvMDl&>76o3-e(-QP-i*5VvvP%VKF`m{)pDWQ~{#7|7?9qww~zd^ZZrr z)1{BbTTphCb<49Re}k?kpb5SUh5Wh<6A2yiA_8j>79~%<43NU_t`SUwGv@s zb=RdNV#cm9pu#aD@4Rz@uMXtTPWJy2^``XQmB`}uVgD3!_B0br9HYOO#)*Z$u!zH# zSR>t!hN-d!_EG)>KwSAJ^6UI63Q|w=TKtq}yv~v*+u$;Ui7Qo5Kf73oH&v`ZNAFB| za<8g6@v|lMgmLyOy`ShaYn>v4apQA*`n5A6$A9TXn$XpSapR^@ix2$m696inJR%Ta zo+@9iERMiE6-a*Zn^7X(Znd>!iJR4uf0E&TT}z0H@*HVJB@<{8{c|mG5Q%a`fEfXG zjMM3PYFO|8#-OIXzszl{*TkFKZ*>tx-BV~p-2gbLBCWmqE0qzqTM zVEa{A5F)p67#w*ae`$zg z+5%?X9dPc;I&j(z>2WUXM528pN0Mz%4_?bSvna0ON!eLVCZn#vw`+|@;7wyjgaM;6 z6tUH@otlOAS4Q9a2X`-J;&HkBNUT-}^=uH-uA_qmU68os=7G=~Kn(+R0y=e)+AxXM z?_9SRIZ$tGFTMQr1%{&sQ`Iq{B;(ZLlpsj|0fDj#W8lo@`AE)G%aAr4N>0JBJaSa- z{-G+`rs=~tJF?2>I5Lh$w?gAKjg?+jJ7ZneBiH$Q%i!s&ONSn_KG=5t9TztoF@$CD z8UEzT{;G~pk*wdC`58;pYUCUv1Mf&K!D+TUTQ>xyGJ4BAWOn6ossShV?fBc@a;+a5 zSO}Nx;&IBA`1}=Cpj!z`ubUrg`LY0_XRD7sjrOqyWDn&%%CI?oXHcaqYX`rvdT)r4 zYL{hbHNb?qxRSprBX|LITHey+vhIPvROkUE4Prv^%`Mt3vDu4mrd9R4?&&@JOuRc) z@p}CBeKktUL`3mJMYRx|KdtnOcS`*!p}75a%8@_MPsSVM#jgw%tpF9H^&F{~F=%PO zM>y2itDCe)z;jEsr*vyo1&n01le}*n-Mt0fcVm&Kn&h{Z*dOX#I@9fg>e$M;^*ZA; zR<%gyZgDbW^x5avx!e!OZ-2g1yI|Qa$Kg93yDi#YY@1e%+NvibJR2QV*g+xxf6;3# zZ^lIvD&Id~E;Lag2n}{6R3Bb%PXkh~(Iy*sP8X{Cf_mVeD*M@>zA5>n&N|U{zmJvx zidK8QgiDIyUup6*8aMZj|5csyzQ9PuGU}HDDgq?LDmXci1WdSaB3Mac`h=jt@<%Hy zM2N7|R6E)fv-lDA|0T<<=r<2pQb{~MB(8{T;k*U;jK`I2Dp<%rS1>+KKpw)KSH?Zb zxKo>iAKjGuVMd2-umpPqT{70K;;)ZMCML;y>($MqhXe8K%sKhS-=_!2!EIEaUQPgy z33)H9UHtS;b(#5~1EFLncl7mRkbJkJA&#Wl5@!ob%R8rq!^HzYrfgX&vJKM5Y2iLA z#0Vd{XCbppb!od$xzgZ5I2Z-N)kL01HC2wqRTBYR)zVNDE(w}l+v$|5QQcqq^9IJb zD7`Pbz_~NJ<*jdtg123uwEsYA1$X8O&vlck7w$}DD8Q+Z)XNAo_Ea4D2-Dol6aR*e z65-|5i82*RW=L9p4|7m&_MkFJEH#-bDipH%)2n*)kqm*oH10vz(R~4AD7x2n(uWG; zCdn*IhaV6q9psWo!>@c>sBK`n#yytqRa2)7!J@y<6reH^)eNYzy!6N&^Bx+Y^B8wd zU@K73#ue~&d3&&+bb(bOubv2i8%`+9Xt+$CC$5GT8K_Wb>FeYH8o;s|^XtO2w@Ail z%HlpKyH=VKqy^a4d16?ClI_@km-Lq?&lrgh3p$;Zr)p!W)Li$xtnCi-yqyIhyVie! zFRAxCR(5!q#g@SWo~O1=LnLPVSal-$xrjbd53#j`|2w#7NA{HM(TT@NWbO2#;Z6;h zM4zv70N}ZXlA|EF@Ui~kOK8b@JavD){!Jb~bsjAsLTY7f7fx3@tN$REyNRxs4Jt7> zWPqLZRp9>D$h5-gjhle%mI7(Jf@7J5*+t^CFwwf-d8JJT@WhiqDu17n`}Jv5^MS`S{k8dmQ=6Iv z*_3KGCYE}6lP(=3dT<5Y9kjXdWde`)EU@;~H&CnBl~-ZSjIK98o9s8Jpji0ON;o3is!E8UJdTr1{*y zuYLjtbE$}dGHk00x9S@?OPRFgbXW{;yBIEXaRA=kr)!~#!^OEpE#G@(6oM@+>)(RB zZbVJ5!X`XT?L`GRh2n!F-)~94|9N!s^uP1wl5jv=S8wd`M$Y!%WS*a)+P_- z{Hmf|feI6#%D2c=)AB{;+7AF%7G@5;D`sbppFvztug`qon!+r+Ax?76r85FpJt+qK zeQet$ar9snnTcDo#pzwVENApJfFJq(QW@h3)2nd_c!)#$c*Em3t_KX3IHHQJ9OOs( zusscq^mE^hus~`-InKQys{t%gJdGRL*=HI>0ci%iQV$hsrN4>6b?N^N3F59sX8%xy83ebj24X)RxY zLn3v9J=!P|G&NbD8V8wp^V}x*$R_(HPeS5Z+3{9aN;W$DteRi?Ifv=#{6vNt2aLUg zeP`w{RQ!%{Pa7Wrj(aI!CA@Kn+(w6Xi;qlJt_gZo!>#ic<5&mN|7#B^N${eXXtT=Z z+-KAQ*_qm&d1v)Uc@ii@?Fg+^vIEy~8tz!AjSBe^ty{p!MQibCz0LqZV)6GTlAkd6 zD~n|Z9xnVlc_?7`waqHGa?}2q2QtZaO}V;NQ;Gxfvev_Rqi5AwBW=*wJ@Gejn-qti zSWMjr+b>=ngL=5UW2@DxM>n@se)3D7wKo_FzD^!%Q~fpTegT=Mfn7ACW_cq#eGm^`=Qgq4MU^7dC|6M3m?8-vRW4+ZdV{8II+}VYchUwf1t>S0JcAa)LlPj%jnIR2iGPFR39{teP1P`GBZ!$K>K~K zf^xrMAH|dk78H@cGe-5b7uW8+FlfmfF?}1d(zS>xL&G6CK|U$;nUU_o%1SRKifTB4 z)60V)CPE0KLVSAfW%4n@e+g6P<1KU@;GT|R!Re91lvswN7YvlYHBl4 z7Y&DZhcs$3J6Q~8{1KS53xmnmn|8gt0rMyf57DO5H-FRDO2kX=sPhpD%_>C(c^ zuEB}F8@Rj;>H1#L=4&qVjRjV8k`!)$3@cp!V{%*T0X`4i*hJqMw#!C)#sENEn`$N? z);KPCyXkout$=wv!z$co;%WSh~*TZJhz!MiCPcrb@>Q5_!>Ji zjc%Tm1rn@|P3{@#+Z}}S0|D0NkLE#ui*5jJ=5!JpF#A6i%5fG}A-eoT-0mao9`(D7 z%Zi@v+k0h}v~5~4Fz#e)6lMeJ1V3*Q^G`G8Wy&=u<(CgFtQsH5{K=GVoX+dKlV75h zXv{!VA{BOzw5NXj`H-&R{r_||&**i85ya6AR?b5qOY#@$pULm3I?bzdyK`$scG0-Ac zfG}m(O-`xsk9ACU417rR8?bSc1bDoxfc%#YcO74@p#jZea;(|csrm>hk@BGF+>N39zW3dY8O0>t zSrz%=4qrootu22s_t}BBeSTCPEBx3>uW3tAi+}f3n_VSa+>9O?0ZB0kJi}F+{sW(@ zR@}yVqm27Uq|P2%rgsK_;nnnX3|DY1T}Iz0|8?L8_$B`fBhHJy|6BaIQ%lfcf$1e( zd;CumYK~D(Am@giQy_k=f9Wk9)CD)?n1cI&)k3cGvC=UFb8IU1wtrRV`#FMShe=aI zXktA}qMGDq%0)3PRH5+rt87cN@D2$^U64(JZSTF{V$dPbO~$l`4aw08&?9)fA{y-g zxn7E7+(?ZoZ=O^0b4fc?cw$lK)@}M|>*OtP!LrQVog93um_1-YMjzpNt*eWkF0Hdb z;ZIi=C{!&cX;2Zuwxw`{W~yCUQ#Y`_;|uCvMnJ!ID1Iz7m^YL(#&Y7YatT~}t(bTj z6&hUf=F?7ZB~5!Hx|fq$MS2nmM&8Yk z{8Brj;7-m|>Oc#&(%DC(!D>H&B867Qt!zq{cV&{-1R|n>>_0qy!tw+BE&JuMIjhHG z3+NLiDI}r%96ZA_^lce1@7z=k>550j z*v8TTn33^ZYi$klt10-FSvjB4c(Fj=>p%eVAM7ZZYDMtf?` zrPCspg;X`X;&%y|YVim`d1duMu@E!O`@j84%C5f($rwjFn%O<5IoN2}u7ixn87D(G z0GDzl$L7oG^j!OrC1LN^a`ptF;)SwK*xGJ@hg-}e_h-?>DBlGe?wt&UIQ;EW78HUSYf(nwkF>If|&XZ=r9naq7<;? zC!p*PcR)A6%EIhA#Mz#3YxM(S4y7*^8c6-;@vtpBXlefdSL7Ob`fxO+(Y>#T#!6@Gno}+Hb z+UxH2Mp~If$TR+w9}bfT?`NsVFyCOhb_pbODckLoZNu0d5miei&{e}}Ung#IBJ*pt zL-%4Mf5$38sP{7&VB#dwpA>^o*N`J2x80tuH_iHv#y#<46g%u-S`!;JXxSaEv$xatR2JNtt@Y=R3A&)Hj)dC4>X3ddV~cnzq!HE~~v zfGCG^!4ifrWTsZ(IN)q3qxx;&k`FIiKcS3y+-)Ssxac79AF2@U7~kxZCRDg8QQ5V{Yzph)1B@n~+^Yx10Y`1J_+r|5b|bd-v=;k5LZQ ztCrWJxOGA9ACeQ$VeY0|$OB0S`)O#5nQ72_Ea@401VweWXnI@3vmAI9YZ8}$Hh#i*LvRT(Ft!@I(pHfYO{U}i25N+|e zNkIFDYorhj%S^*1BP__7a-;as=i#^TE}YL5we(-}hyv`Ib9KOx;_c1EKg^5u4bXAb zciXn_AZbpu{6pKeC*vO#Ok8hM8>6Q%Ps!bcXcl1@1f1@?U{n$u9c)Ag^U2VgIk&Ep zH5FCyL&4khJ`Y0Y_Zjc;rRT-!7d;Qg`H2iA@hyNMJLY@9&>~iJYdlGnr0h5=oIV6# z;9lnD)h0t89j-NM%tCM~Mn!hO1Jj-9v%_nQmoMBg!Z`9)3P=PWGy{-qHI<6hPDAAH zMhAm#D@gIY^)@ZOA3{yoA`Y>kylAxhp|O2}b|z#@vchf`X2+?k~EwOVcJv7bev42qzA{MXf^qH~>LxJ_niGV@j&PIOPJ73z_i zhH+{Vwq^Wo@ed(|*`{||XCae)=*T!Z*jYoBcg7{AB5E}p@b@g9<%X6q`JyvCk4A> z6V3Sx>~XUSO!MWY&Cik4V&Yga7J$bPLMIw^J3PnR6VSwpGh(0=5dq@o_LHZ&2`_tX z$Rm$AK4?SH%(dhA+#y%Q1ZjW5B<8d)DeraV2F9bISUm)p{~|5y9Ke7bl0X_p%3$m> zXijEujU;;@Bd@-4553~mdycLONa7h=E+l7Eh*MK`)FO2F>209z@T@S@2yO~`mBa>@ z$}xFORA~;yFb6Lim$BH1L$?@e3Z#evJnyEPcl@tHvO{Ns1LH(K!t6QWcGrZ%iWYA`HF)6_M~5Tzk} zIhrmR@v+QmdtK2uNW%W$xw0hsqki2Jln9!Ox}ZkclBXQxWlE#?84b1^*mB;;%^6 zG5ZDnHrno)4>J8U=gkI^$iyov>F^j|!DVe*Yx`8<#*N9EA4()BHcF(Byg~SO)J`lCODJy7z(=Cw-8gU&E$Ru{EExkfzF{EzQ0@g|QeC z6hsOF%-Yufh8-bnb6$)#N>PMG=KEuOVTQBQBJsTTC7@2<;aHm9QYZV|%6SvOzF(EW zs0XMd6z3?0PQe&oL+gCmUxyK`a4g`mqVy1;!`@537SRqsjkrANGgIQbhn-m<%!|v& zNmIW=xQ;oCgVD8!jVV1$V{Z^TQ#OvF%?HmN1}REK-)Pe05oOUDX zI6gGc7pWem^z++%o3aSs8{MSWC=R$2Unkk0MBr9OuJ&Bz-QR%dZveB6afo}82vZpA z;(4|;LWxlr@#6T(<{w$j!XOxU8xw0D+LfxUK+ww4P1!}r%tfEwOtBfEk4cXQyHHq z1iRP%qj~C>5Q%rFeg9m>1ZrB6K}`>MPRH^32MUqowOOQJu9DJ77v39Cdju+ z>Kf>0w<{lJ1i%Q$J*VZzEB`05Q-RI6(Q7k#E*$>FQeZ%FL|DO%j&Y4ZS^?pH*ab-Y zm>2hK{r(PUm)L*os+QH5sB&5g>uD`UbOfmLzv-la?|2?Qxi`*}8b8~Xio~);fP}yo zoO;o2YBAVUvitpg@`H#7`>6MYt(u^dOG*#fPdXA+04NO z>Q+=!c>UxwPVZB)>-rBi4zX%s z2DNsLVd$*yPE3oxX2&mKLCqDJOILrmz=V8Y*5$E5KWJ(lni6pG zw(o+Uib#b>3LsS@hHaNM;%~5u`am)L_+Q{Mc{nje<5Z9iQT&pWuruq;8mBc3eve*! z%S&+CxNncUD=i*sDJ>E0Sck8REOqqT8Mj0p&#U}%~Zc1Cn8ob zQV!tF5Sao0eRaJto>(N&Ghz;vrW6*45k*3CsY{Wvu$aUyLxhtALCySX!g1pJVE1M> zd4z!dBR2rPb5uIA5lA42W0!F2L^+*_;Px4POcqPk@C7^2l}HkWQ*mjy;55QJMAIg8 z-0e&Lss+toS0sPrBxB$n0{gFk^QTlh(uh&~uj=VGffSariqkU%-c=BP7OeSA9Ge08 z-OH$Rd6F2&bRk6F#B-}Hes%m{yttEf`M!1&a|}|ShDcT_z5^!hcufgWL;X(aFfSF& z!gAET5X!;&dgGdRhvF}vt#@DU{L}* zo(yFQs{$+h0_rQbvNdP7I2gHyt`F5wiN&O}vU@q+E^f3NK!33Xyku={3*IilkIN#=SQ3O8U=-MdlCxTXHp*O-Zt$ubt77X?uX0KOx?J@t>&qaY_>s zq_~0sytm4$23N=M#5Io|EVRC_jQ}z7BJG)80hBofEo$ZC7)5hoIY8RDS2XJx#zIqU zUZ%ZPUsg}Zg!-^rnVEa%(lgcj-ulYLpY??%T0__UK)EKwSEl z=owh4N%73#euDDZ8=A-bwQW%;$+<;obI0miP|)!f^ZT~aT$-d{GWOOs^`rgR;`r}J z0RKJy4T*Aoi~%hgkTChBfHH3kZ-p^%`-QjvABChbm{%9b;-Geb@E)?57MT>lV%9i? z++7=Hj(UIp5s!uNdkb%)m{V!+d9Zsa!m%j^;>R^(Gh$1H2x$$-C44&Y5*Fnlvgly{ zE=0O*)FHG@AVhElqaFgUr!G{H2S6<)GunBvWUDl3@iJ$a)K{K%U(P+~`c=)T_a zNQ8(X+@{kk7ujq*an_*zy?Llb%jCr~k8p#jbE{IIuL1{6@Q>e|Y#o?1CIc9^Z5=2% z;d%05Qj7?8_6)dAyp^Ue8$wPqa(ej_Y7lb`aSCLhN zLFA;NFq#mu?*$<2A1W#bkVy+_+@TV5%HaZmib272r*%X@0z zg2NGQsgwwR4`QerbE`o59P%+G8Mmo6M@?_@k#9R)Q7BF5O)|zlWxM+&USdW|YH?4Y zLn`!wt=$gnuT6u-EbA32!~y?fu@>p79LW#Y+xcwpv6Zq+Ob9Z_JCo_*v_t|(IJILsho_moZh(% z?(w?uR9O*sd>kLAa!s6UeoKyX23n3mIMfX7IDA~5*V9#0Klg;Qa&K<5@5hS^*)D*> zIr(jyLO3vN^7uA_$bkP%zC?nUYeB`yEmZkfn|`sPxj7E$*RPerwdvofGa!nMbh7p- z$f<|H3ZuWraYC4ZT`*I?vPr&NZ@_KJ2#5~xpj%JY_G?inB>U#`x=|g}4B1dRh-WXy z7C+v=Wz*t*lZXlW|94ar`!Xm|TRtSVz|pt=h8R1^lJTO&@+GVe;@aGXx@=pB^rRbA z5B8-nahgHUCY==Ge!4c$k}0sijDJAP8iFQ-#=REZxSK6vA7(w^$wqpNRs|Sd>CdS? z;~Fv{!Zm*Q=u-VlcZN=i|9-iyHEcXp$EjVO4xdOL9MT!rdOt@yNOG+5j{daQD+{d^ zz;58ceaOJ-k7oC$qd!v@T(+DxbBCScPkBq;3pc4rcJ&uXDGHm-Ts3g=4K|})iL1#V zd9@p*>_~IsSRBi{|8a`+gE^%5+$qTgWWbaE7{|$TWJeebSjM2OHsNReB0oTfT0je> z7YRkn9gf6qq>0MM2_S)`ej~9>>kaEkn{|P$%GRF>12&mR&cSZ&P@9IHf;4V*W869>_SEGY2(UH7BKzqZx&V6(*$Z z4kJQ8J%t|B{~=`c%s7h<@PJG;>&SVMJ|1J7h}^6+eHWNJRkk#DUQ6Ni@1sEsX)-}F zm7pnV;Njy~Vil08Hg3tL0;Sr1xHbp)ZDZUSb(?)wR)9O4sC9#|MrmY+_cyrk5Jl?T#a&*Kl9SZR5f>6^w2`cr)akmT^u|M@-?_Vis!Q?4diy;X%yJlff zmHQl;kf;s@9cA=`GJu;TzTx?1=xe~*1AaH?{?uj-{@sxEDYmFoHk(A@3h{CP$r5g4$ zYP=m$+f?sFstcj!k@e2F>i7JQioyj$xL*AuMIR_A>df2Kh8h`QH}MnN`9W`KjT%?F z)+DF`d2>Z}&gXmJ!2*4I44K?9t2hwV-NbQ?fO82P^g{A&3L6(QY|-^!4bA4+if*GU zKLSrxJ2yzKj&zAbvv_N7kkoglidM8-e>ulVW{Eczu2rAfuT7q?CngLs&BxiP7}d`; z^G(1yem0-VO1eLj79Pg=RX*>#4vL-m3FFh zg5kruUnAGquUvMiDgAF~f}{w3zrrIarYl|}y3h4YSLxrOa0giPK5yOph1|77Q{%t&=N=qNVX{{2T) zZ6{c67d@m0^J%c-fqJZSMPKR zHuaE3auxELZ@kz+#v@In31W~hMDt5YUM~(-%vm;%MpTY;th+jeOpJ`@S2iKiz^C7}Og>=>`H^xP!f&9@)uA|#(pjdH;%QkhtcJPRFCEf!u6J_u9o zjXtZQyMa@4QH4Wh=e%s)rY{v%-e+Bt0H={%bNh`*16w92^r4Il%t?;hYK*BXD3~UC zf#CB4RweS@*Wz{MhE_+oBv~UTf$ZMzNkA1bERrB>k?^PUVt{!SuPEI-Bo!9*94b*c z^k6JJo_#1hOHs&%8BJl>98(bXGI#No+Wc*`z$??om0SKbx6X(wLMEDz<25%Ycy5R- z+FUB8r8`=ULX{-)of7e~+l0O9yGjs1_q+xn5&i(xOjk|63kaPZeNDiSB|Jt( zj*+-lb+_R{6u&UMQ@yetf=+lzbDJ@%I4}4Z=V{tvW6S0mAWby$Xd)lU6>Ui{(vhgd zsxq2G!|3B_j@4jG((O5IWm9k`@T;bNnuwgDC9o@dS`O^=?+71e(0lCny1ea|Su8g^ zd1zAihRE&n`k1dEPIE*rTMpCngwvln2-o(2xLA>z!lM-4x5kpXQ{FMiAZ3vdbF{oU z_dMxd9Dz|FZeeLJn=!t{YWsx}fwa4~oZJ4}YSNSdmtUC~gimleqZfVE!NKrqE-ZX= z1rqOf81&D<-~Ukt#&&|zK(Z)gHNSuKkScRz#4^OId+1j@ef@7UK|=)5N@;rjUzRGD z_}kycZzu?mfWk9#9wK-WwG2p%x@yGBSBJ1xUDPAlS@Js1n_{SE7q_qqQSv~&Z z&;MfgDC#E{s}cSg0qzc&rt}-H*gLm(ncRn;ewV2IfQtju zS82(%r+7ak@)d+o6F%*uz$x*ihVmg#9Ym?iOv^A9gRpn|%2HK(yLr3so1b9VQVwbR z@FmC&rZ-5~5&tN}CP5$~P`Ldew(1KnC`C*Qj8>u@F!uBMRs2c_{})`5Ow&ZVvK0*O zRPqu48QLqsYf@7k*c&mN5OBU|ET$saJ@sn*MK|EB)M`xQ_MU#zuiAzCP;vWFziKb- zLj9-MKT#*@Aii{;sF3ll>UOcnyWw1tDj3Ket1ya&Bjp6S=1|j6&p&@IFB#!3X;VoA zhI3(-yv2Nv);#0abRlUYv)4QA1cLF@Ez;XfsHbGTye%l5$=%xbYRgn{AP{jOG?z*t zCi=NjcxZ((B@h!A3;Qy0MD_9x;zB0$u*SgehV(H{8ByjW;dH3>Z2)_=IQi4A^XL_& zB0`H*$5ZTxwGi-x6=zZIQ#BH-*y%B3%TY_v(YRcpuYj|F$v__!;z5t2G0z!WN@Eu# zJr=~m{~%L>6{mahVSrJDZ%NSh;N78}uHe_>y{|PB6C%5SHQT&fx`yi~rG^?46JNQm zFx1rUB}${#pXE3DBd$?gR}KB4R7tNh$-Jx)-zYalW6t4En*;D^g(+3C`{uq2eJP3zWKe~G{)r! z@iYLa*Lva->>j`d8_l}kfHY*2xd03!TvLdZXDJD>5x$_|$$isrs3t zaotCkK|ZXkmMid;fArveL^*9q3mj$ZIV#vtku^ju`ns^NV&tE%*PiDYaRugMPK04wg39rM>?Qm!c1G}zS~6C1J)sgWpvk_CD$qp~zo5_zM*<|d z4iPoYher_|qB-%rimEyXUspvX%gFJpX7#)8D~n}Hx(>6yG2rd1|0k;zr_=x0X=83y L0000CLjGoE&y@FX diff --git a/samples/Cpp/SimpleGame/proj.mac/Icon.icns.REMOVED.git-id b/samples/Cpp/SimpleGame/proj.mac/Icon.icns.REMOVED.git-id new file mode 100644 index 0000000000..9874ec6979 --- /dev/null +++ b/samples/Cpp/SimpleGame/proj.mac/Icon.icns.REMOVED.git-id @@ -0,0 +1 @@ +3d09e8fb4f4ca1c1ae7ab0a6948db592c7c3d9a0 \ No newline at end of file diff --git a/samples/Cpp/TestCpp/proj.mac/Icon.icns.REMOVED.git-id b/samples/Cpp/TestCpp/proj.mac/Icon.icns.REMOVED.git-id index 0c90afdb6d..9874ec6979 100644 --- a/samples/Cpp/TestCpp/proj.mac/Icon.icns.REMOVED.git-id +++ b/samples/Cpp/TestCpp/proj.mac/Icon.icns.REMOVED.git-id @@ -1 +1 @@ -2040fc6fe624353ae1d3db50cd3d450f4fda5afc \ No newline at end of file +3d09e8fb4f4ca1c1ae7ab0a6948db592c7c3d9a0 \ No newline at end of file diff --git a/samples/Javascript/CocosDragonJS/proj.mac/Icon.icns b/samples/Javascript/CocosDragonJS/proj.mac/Icon.icns deleted file mode 100644 index 285dee82b3d3f80acf3c0037b6b6ce35df0e9e5c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 77152 zcmeFZXIxat_Ab0T(TVPcCg&WwF((wvIgtbb0l@$Yf+$9U!rtBFj7Ss^6+xmXS&|aF z0l}Pe9`lUjIL3ZgHO@J6=AQq(U*1pmcR^-g*WPQbTD7Y7s%Jgb0ULvNVx+O_0(MTG zgkcnJ)SEEf@#a<*=Hn~`LW^;F@yiUYEQJKZ+=Qc z@;C=Ct#KBLYV?`;X4u#qA!fFSC$v=LaWrsMs`_?qirQk9g*k`KC#_sfo*6ckVr!*o zZp=~SaF|Yk>zo}H3pfV)h8!M;qew9xD=_6Vb+mO2tr;9eHk(9MpeQIQtLrF7eY@Q^ z*gw=Gx!N@-kqq=bywpD+8SEYKE4bA)B$W>Ib@aj2;qLifao4*CCDMUYOsqAiFMWCN%jT>Ly@S&1;^L0ra@nm@kJ?xIfsBN-+{E3|Q}16qt4&(a zE0u=FhN~T`t-ly|wK93@k*hsXK@kDts@odtvO3};Lz1ubcyISyU*j_;xh`qk@~sDM zbg%O9Se|Ku2@aZLMy?xr`t9vJCPy+o-5q`0S<5H1x7jaSJ$1Rm1aE(jaZ@J8*VowD ztypEb%*Vxf!R$$%1v#ZF?d?{s)HfMtF~)R}I3_)J%QCy=v#d4wn(CHzUVFtcI^W+s zc>Lh$-G}dPJ$?A-@q>5p--l1`J>FjX@zzuPQPjhm_a8pK|NQO}&%9snJbC!&(eUNF z_n+Mg2!9oF@b}wrbGP)um8V-Sd<74j_~qV{N6qIt?-FIQo2MSOuiW+ft*15h%@yJO zr{BMLTAR4!-lIoHYV!1t*VbQ>d!X^%ovh=DV{6(PkOQK&7rwodc!=<=@t&1bpEzcD z;IR+uZWGBd&gsYlW|-mXZTB8TMkFtaV6F9X+~C1lHvQJM$j~^irH&K90~4l9K7M5& zGBP}7?&9^US1+7BVb{5)zOcy1h<%fc$Cz1}t*tC?IFlK^KXikem9CM|%)rRQ<&`_9 zZwUU_irEm-6;R4qAKEDgNKR6pUcO zi4|y=nwmk2Kp?cVG9zc~KJ@A0HnK5DiV>(8n?Rd6TAqa1soPDmPp_InFv~cBhLMrH z$h-G^55C@ge>10SJ;t^W3v_jK zboC6hEjZJkJdZyA{Qi?0Pai%k%1v5i2y2-T7wBqf>*(mSjIsFN$|j$^bLGbM>sRlV zXNba<(6lpH0s{`0$K!JpBeUEw1&oTh7umyqY1ndmjG`(q7YJ~UE{~&%xgK=G z$P9gKcHSJ!kdBd-EHzayLlFS&TtyX%8L@+hX^g{GrL4rp^D&;|YIVN35!@l-Xe;u_ zt8hCIYJ_jurvX;Xa5JWvz>CS$47DoJ)OMeivR)A}M`9GJO8r(10XX${3KmkiERxI|!GV1AP~cRX;c@9hAgK6(j?_53WiF z#8S3ou;)q=lkLQ=2nP4T*{LSbziMC$2QA$sT{e|Jp?*5Pc<~Ro$ZmpJM-d6X7b*Gk5@7| zrI&h!K)hB(^{K{|_H&Z{p>}%Zy$0FmXKe+%rs2LpiCC&tQdW7guBr8G=dfY4?CG~J zf66*K5(Sm{O>Pc$>;35TiNBuFk!!BfRK76 zB&TQPrPT&ad-fD&?Y$>Ao;yME

DIFU*Fwvw&PsdsixNYgCbE#(d^=@ zJ&6K6Ah~Ftfg*`gDEL;`xDF3udR>IR^%=_YK^Ho4eNJ=Gw1X>6TP+ zygb&$dde)f{KfG%PUdrl2ma4r7&R@q;w%_w@9668%P~bN4VxFNLk^I( zNhJ1m_Rh{5v>Y;>FiJq5kxj16xFH`Bb>1o?gN7yu7DIbGJBJl(CmG>Ed{WA1ixsI0 zCd(o)m1S!*wl-HZHMiRnb~-Dac=r2OVl1l3{>|Y!Y&vPmnla-lj#gElZnVekbnTbB zOjPy_T0hTezrW{};0cpwIn3oH9xg{b~m7}?lNm@>u2#zb{P z%>KBzBosCdjv#ya;0|tjC)e=_%96 zWGYMBYRvTIuKs%?A!?Ei9a-YE0=Lsxv2@A2Su<^IY-Y_{xYXHe!(s{&-#&XB{fPbW>7BQy znd0}4?mvAH_lW%X!NVAI@xkp0{28}i-g)*Q_7UarjXU?nk2nvW-Fbdj?eu1zpWc1d!%hk<`2A`ox9#S=+j_b5_Ks5;Sx1>q3~h=`qR90iSO?gZ5*`tIFDhwv!sJWW)RR-!nIICZw*A z?G_f7meg8f3y0g}GdFvFO@C|6{upuE^o!3PJbv^jH@~>3a>|szzR{VRej3eOu{fk? zPQyEt9cN}0WY>%hPCeY3u_55+%w04uXlvoD;!h~QPD#s2tD5dyo13%Jarx?`%F>D$ zr>T=?x*b}4=vUMp6_=QicznfzlZSRLRcC5@z|36*Gk5xej48!m(GB95q_}*4n7M&y z=Bh>I?Um2m1yR;V&)x(BBcq~YQlc~>GFM?t1s>*7unglV(6G6|dX%td*B(9Gzdurp zXIR)}IbzhU1Ew%@Ctln@rp$9TG`)2B`mMVL`}gmQ3Qu)35CtkzGQJ5{q%E+PMPVvS zJ=DZE`mbERLG0Iw+(&5IMXtaU=_dRA!*zK~(i9KjjKOn*gCm#m{kr?2!eX7cn_%WT z?(_Ey3?4sersG_G#kr0i2prLV?WnN0@fz!WcL%w+FLQ#4yJ7(&zN49YKYsh)#_tc= z=YQ;K|I@p&@0GIu+=u^X`gm55Il;RVKz|Hb!GCUI{3!$~s9odZg zyctGgEXxHanuDPRdL^=KFgBk>F^&%kZw<9HXW#t4Pg0+yu-?A0)gOjk2)70`s^EXP_})d;9U zO9ncH6xP5lU!V*yivpcW##n0RX9Ofm3&OGrv{~wa<|#r<0msNn zrdBPe1-GmgC?N%Om&5?{sv{{ISXea)aA>I!@HiOBxZ`z*9!4Tz3~ftcqX08UO;zA8 zKFBZraX!kL0(()KmbtJ28VS%?w`^e^M&>2-Q1oM}D`tw|6dD2ueg@kbp1;SbZVMYN214Pm+Ei5esmWKqomO?WX zGDc=G$QToI|MW@rOG{N%>=ZH?g3Jgcn-XRs=!3{IPe8UZ<>MqRrD^U0jEyb2122S| z)fJUViz(m>wmxz-W-9u5d$zz>C^Y4hV1K-*XTJsX*t+{q+4oO9MJKBdE+K(~So#7O zOB@ss<_Z=T<`x#n`3D6i@Ei|1N?F+{TZ@g2+l0j;{OC!2$;pZXc5HZ(Z2)5=l0S%g zeNbR*!iN2~(uQH#g9%vH%MTOR$iB#ae7{~@SyPqch>!t}QMG_%VuG7SgEr*Sbb*=B zoC7WN&6i}qp4Q{v{UW;%bL9t2l8=2QRW+3dmtx>Ij!6|fXNtp!sW9_WU7xP+eA8U6#2VJVN4`354YW%$P7iwvKu+QJ^j~Q--Lc z?6~s{o}S2gfac|wFFyzw_w$9)6IC^32bWMFKDZVY0*bMTF+7fZL^79;F>VPl zNcN_z`D>Dl_pb4HWo1>>abgTerRiFh2}nl9IH<+{_9!7x)@Q+^)A~>j@m=<^>sJ}{ z7yA(-<9)ePQ4SI+5AT5~g)t4w1friti_LKGx7d;?5SVZ<1|}T*O30``WFMb@iI$Om z{D_t*ed;Q&0PU590V*((TvGrEG2vkW$E)xiz|qrU84ZBa zx9At8A5UseR8>@0mgTL{0y!!cfN)t@6bUGXMuvt2_~G9^WLsLQU>Hq1KhBj@R#sG2o+#X^54}<{7YYp&6pVymj=nx_ zK>X|(@)2&%GzI^V)X#kV_ATM7;+JoqWiL`RF!iE0KfVxOHNM}jI#zk2yu9LQfsZ;B zBl888np8}8j9e69AO=yR?iQIbv`~;FfB5z}@lVB1pZ}0Ong@Sd+?IVN{?z>XYy08y z(z3D>WqGNKAV_J3LOzD6SqcvcMEZo>B;+H)lnoG@5gTUu{HwB$NuM}>{P|IK*K|zL zUiHZ5-#_A?Xn%gYSWCH8ekPk zPmlO13mK*e@UR|@j2R`p`TFhy{u}md{BP>NetEsa@5-ld5AdK{U*G@s+lLSD&K4az zLL8+Y$&YrTM8iU0a!5eY)BQ`7n?zrKC<_T#nE!eZixLP_qyFg}SS!pIaYVZMN*3y9xeP7}d&W1DHidZi@( z_4ikAU*m7E*Ku#u-@g8>>C~UE-o1VG`QgaxH*ep(dH3tn#yoK`?Qj<1ijl-HltNh9 zaa}?#O9TT+7^|8X@nOBTd-VRzO8~K6zIyW-_8l>=)Ly)N^ZGTq^!jJRtG7di1)?Ha zao&NwW^|CoHU()SkT&Wy6c&6F4JrlGEPwz0=`YWpzxd^sH?Mw)f5H6aS<8&wN>siQ4|eu`lXNQN+=s>X(B*Xi{7mlsc; zJ$wG-}k?7%Bu$eXXW$q3bPZ!Cr~l24iA=afn}}$)5UcNT@lzt z7>EpUBUKc}lZ)Ozc?{o=p8s-YUD~r3kJFxDPsLAYkDos7%*+wx^78W1qc-YN#yi-M zF$H5wVU9qggL)^@rx+L-fFLzvF3ixim!ASQ^5D^<=Z_aFrQUn-Am<_V!PCLKOi>Om zJNIC8h0rHyYT>XlFbs6)7}+@c+Z8#Vin_LfKwi1 z-KRge`{de*w5)6*i<6y|DsnXO%kWWvS2J{pqOGN^jmstB`eZIk2RC3D8X76VTn{|| z>@I$XefR#;5>?D7;?~n!cjNBR?%us~`_A3iI|{cS+-^=ico1YB%svo1&j>%d6_$O5 zc`n$dg@bj-Q#5@ZNf|8^8hT8O#Ljwg^UkeXw{JY}oU4rKZM*XL#_fb#dgFD2bhtn7Q$=+NlO#g zB0wOntE8vLgSWb_zP=tC0wVO%E&M9y+LcG$Zj?O(6D`i)xpFP;D*f6uN!#U{SFXie zrCqss@pw`yk;Y5SIJjnd^uhG>b>JvPBo@~sX=#b&-8KNBBxOB)Z8}WN0}n4;y?pt~ z#ryfRt=Dggg|&AsUX8iTymINr%`id#?Tc4pF4HbuzgU%+jHf82CTAqr`KDzgXKn`> zbYqY!0&7Je)<{Z`*Ho!)SN_~M0&BR6_{Jce&vz2gyo`O?L>3kp}R8DcdT zuf$!TUcPWDA(2SpB_>DjNK8peN(+O{JypjN9H60rYl^@HgbrDcN5U~3MIDr)?j5;w zVPyEi(7k-s?0Z8Ou9W5WT^YU*J;FYJWu!`#6w-U+{Dooh2yOVna6@83Od>leF)=A6 zY7r!vd~>;2ktQJ*OX7l5Eeclw64avW(!s%j^MfNnd-^X93=Iu*OV39Sat4MZSEW95 z%&_f-bZ9^{h!0WDw~0=w8=WiQpkwOn8uFIkv<9DPamo(IXl?b-;ejj_p=A3MS2QjIGZ{y^h)u5rbN=) zCzYPd6i3I$Fk@qU)gY+!kW4~-)J$BP0~tE3t{_o6p-0+F^icYn+WLqdqBpunr@Oc7 zd`B2>O5q~K!xy^yx_f%Mr41*$CEd9qB3{gljtMe_w~)2~S*fOmtBd4za<#c&Argxj z=J$1Xi@L~X&vhqvanE(18)&mp7u`BMcVm5jH_^rDZ^*5Zb{!(3;zTS$934EF1&NrY z@Sp(yw=~#%U`FF%z%5VqwV&-EI`Ol~ow|VJ_cv(IX*nw`-+Z9I{cLCF+0Krv)Yk5z zsQpAN&Wa-Nka>_MsF;H^LXD8yrlh5XmM*7VurXTJ*w@R&^R_@9b@= z>1fA0Se@I~=tSkBegBQ9G6@qr?^jkyKT2xh#<;hYKe86)vEw1vmAyw8giI z+M-)IXWEjqhDLj5G}msrp{_n*ukQx zhtEsLnE$mElLsMguxKX*O;Y>|(cyww+SX5+0csTsSBbfUlLR@tqP7FadNmT_` z6~O?BHCS8{8CzV?-aJpY7_S%CaqF9#PaG77hejq8oNQ@4jn~oZ>l*S8G}oVwt>c}p z>!=lbxw$&Jcm?c@2-_bH*l`ZwB zPM?B*ryFb11Kn0GUADq$U07ai(`oz^?ewXVWA&%wPAN6kmnV2kojhUUq$zV(1%!t0 zCHAoP?%nQY4y%to5{~f+6%lxaQ0HkV!NqAwEw!y-7I7^#wfIT;sk)>4-Bzq}!`E=# zoL8-nK2mr3Zp-TDn1 zd^h-P&aNnrKf$diB{q0(@ZIP#XYO41htH@27}9#d*|y!?2)pRd2)raP+`!)&xvhcyH9t~q+_*wK=bV@FDl?OW@! zVg1HUn_cGHOr17!k$X_EzyGGFqOzEyn#W2GZuRpI2==wNF*h+2Oq{cL!Myo%XU+4* zgXvp0Iaz_jwUJkpaAlEPK3h#qT@e-_w-d!jit!_Q#lr+xte1aEnTp1-W;bb!9hX3_7*ULI+oA{ zLWuz9Q&jjW;3S3`2Ubjn;={$F!#YQbV|~|e+T!n^35zHRp%SopwcD~IFe2}$_%OS; zIAzWQ=dail6d1VC-W1XrT>$}`eT+vajXH{@s>XwuUwELX zumCSqEGWtk-LyF<&_NY;^dgLnbntAq?%9=CR6rE63yQKMcI{m&fcXw@Fr1`{>CIiS zc;V7@fm;IBuP`8y$oc|v*jc9vNW7maL@Ep=&^tBi@S!|BpOtqgGi1w_9WLq^B@UyL zD3ry!LicBh@|k%BiD99BdQ=iA7E=L1rpuNuS>mxdV6)FsSh_$i0dPo)0RNX*1sD<| zzr%S%j$(Fh%C_Jg{u5zkz(~>XgJU#?bLjp=Xk_K)#72a`(h6_)cua{oX2pu7E)Yjv z3sqsQH?Ty2RI)$>VhI>oT!jYd9c_65k;Oikl@+&rTj(MNJeq(3#=u-hhz`QlgE?t& zq01mgO~f=vnBsz!E1cGE+PG#mz%(pFgxr{$fzU(&iOUu7L?D;oGgK8}gEu|<;6Xf- zaqwXD&YjzY7%2tg(H8AZ$T*mpc_1q>CK!^{6ikgi*}=il$8Uq{bcipmvAMaKu8M}4 z7@!VABX;7F{>t?W}7395s5O0S#$!%j*H%IF_YcucIw3>hxQ)Tr738SBFDpur}K z5aUq?qO28gOo60iVr6Bj6oaXOXJ&eOInOq>oVv(;3QQ%Yo|);tkg+&$xrm2@0uBjw ztHC0WAB9J!3NU~I#F!x;LCjYCpIwL&MeWZZY#~X;6wCmU9%D+2#sEN3T;{cA(e#Bb zYu7I4!%D0s`Y9i`Oq9!4QRcx=Gw19Rp^_kxV?8QeO;;!s2!)0ai~tB6ihx>RO59>P zj?t9`Rs#5^9E|};tF*>*^(t34m(?zYpqQm+3iuX+TX74LrDc*lX81}<=oO$56cru; zNlW@>b+kOF>4FR^D}9hpC9ld4g{HU^X9mdUS|a(DJg}aO>2CCJTIKBQ;sQH7GNx)Y z3Ra2C$pBWRzyPT5cuI;WqMX7aLPPh2#UxnErE@LDf((R1QOvd<*t0im@BRb6EF4x9 zL&Az=M2o?cSaUbHIjnMYT(v?MRxFmT2``E2SB!OHSiOFS=Af6RzTaN5SDaN+6=(f$9RTvP!oAX1ZWwOtIFfT;)0p_?%lp)`}W=0n-$O-N*-tc zY|TzRv~7Dx$o6gF*khUpf}_khuB?Btnp=$P_or=B(gy0jDEjvx2s63E1Ml zIV;DS4d^zNLMBsaVA;&t6T$ugTebuQZVB3uSS!+o5u%XcElYt>QLqnmS+Hcu(q&U& zSAi)2f+3Q_qzF95&2nLJfsg?5&ej0jpWz#nRpDx(gx+;52!D%dm8Xdf0hhWm}Y3h!(=7Be}RD_6AA!$W_cU~MYL4tyZUeT^YdLF7++K3 zH(6k;r*CQHTG&;NuiHrY>1|r)v2L?>P)Kw9f7{i^JmSSKX2Z2Bl$|D zN&t{Hin5A~$-q-Q#F@{gL9i*#+pxjgXRVLV8V|n^JRvb^lZTg=kB_%ETymW|*L|J$ zdbfqMXU zlmIju#Uu$sk`Y8P4w8)vI9x?2RFN>%`5sah?&?dVkUDIP@!hdvYn(0?xT{qTDm_$z`x+(0uF`CVW9UKW3I=VHSRHP%I+?+ zr`j%c@o-&iJ!8faSEt$52{yPb#d@4B+(rf&e?fohr zi(HglS1-4jK7F3UGU(ilCCg@6+r-RZPKV!ZrcV)Sp)Qg+nh0teg%go1!ssxEtVjnf z3M}JA_RcQO;#Eq{tL9oyn>J&{G;8bWHq)nBPm8f8rcHHoS*Vdk6#%k1nO>>V8DOh#g+5>v3LF;h6xrcD}aWg=fv zFq$&)6Pg;uS&=ozII2tvhJILwXl1I&BEzDqprQeA z$*2)%+)+4@3=K;-d^RK$@H|7ycnmx+ZN{uQ(-J1)lXw%ygJLZu8fql7`2Zat1Ph^U zqYlLlO5{UJ5y6tKVJsvj&?ZhCKYqga*a`IUa417xodZo&Do0iQU(fzEuw+96ZV9k# z*$kRoIYw62w-8#59XEc$1o1e=*s)fYCi)u6kaN+=bgqi33c`DEFaTggG#aS?IP?JH z7H|kfCYuG{K&eHPTOqiDuB57CXo8YvNTiGn^)!{(Xm^BGaWaj`Q&NJg4>m%upChUN zg!@Ki68ab`3nZ$rfuRc$nJgxQ$z;$O3N)0O5hMdNZ(xCD{C&3lOV(PzTkr)h| zPRNB(DDbYqVZ(xxXk-eNN~7TlnshK8Nrk>cdI~<}^HmX-`Cs@c8~Sa??R?8nW$+YJ zVV4rg>x!u8)#T4-_p5@ z=_n}6?Nx%2hoNG!Mu&<4{ROMVP<@C6p(JE1PRGEbWN-m4_W=(@00aQ+w?%S$`M~ei z);8o@VJ$LVrwK!asmx7}Zx4I>rPU3M@r57~nc8mjj6; zu1rNy&KCigGb&0=TT{(S#o)@1KV`>cU;cbG4WlWkakq6E&z z<*3IfiiNzSuC1vH$F)BG{{6SlKYja~M=WWOW++IQLK&$6%2J1}Jyw;56~@z1Td{2>)Jbpi$(jvc6LsTg1_&txyp zBfbp>m4M&=D*N`e3r=Yblt@VuNegh}`v-auBknsPV|`MRnK~N5cFeH+r{sluIt3}EI zqWob02-M#@Zrtu2I3Z<82BZT`CgTh121d?EIRgXI!QKmh%KHB78Xg)blPUrtf4+Ss zOJ(DUuED`G!0#Uz>3S#oZD{yXrIg)&z5`dqm>PIn?_i6RJs`PwvH#C+z2`6V50oRa z{<$n2jEXUr7xsZxNu!h|89IONcPTzlDOHvX_SKp|0*-OU2Q&dgUm|G$ONWOf{R0;z zaD&o-w8sMWMX<1II2XXFxPb;K9onV6{pTgsQstq3dq^E=bQ%?#?AI;@Z`Ml{1_vbF zebW9aDPMBFD<0qzAoVbz3}Jr?1lOa2g0!o*_)F8rQ~)3g~TAuEa)AokZOU5Q+4$q1Zo7xTR&|8BMwMS2Zl~N0Rr$3hSB4O zBjr8!leNi;*qkH1gXL0f5K?=puCBfTq#!Z!K?PgD>1k36$&eHXUNlT;Vv!?^{HMX=c7sMo37zaZl8E#qwtf&9NTT=Rbv9!Fr z=KQNzIuqmA!5N_AFwRnGIY9E&HK^O*KnMo#Ac}MO>;XGtrOLzg9ss`oCy_~Yl*m+4 zb?289J{alR1t(V|N2SIf@kBYm{QvGc3NVN-7+dIiFSs&V${cFn1yk!E{3ibQdu0_> zCACi;?Promygi-6{R2m(HXyMKv05stLFOsccNBBTOu3yX=HR#zR4WJila(Oi=3V<6 z^+_2~pQ?`6y}Ij)AgQ!2sD(PE&bQ4OK41 zIRBk9b)vGO>d3%{GiD^1L=ERfQqs`iA?YNLeDoN|E(I?GBMZU-M32V)XgGkIyI~RS zaE1j#|9@suRaTuSx%g-9IEa4F4g$`6wVWN0E2 z?}QNU>Goz*sQ-;$r3L&da7yXP+ux#@;I|#pfx*6!ki?DRYr!B(-#xddjw|{W1w19I}3S7prmbbrcgLybJ2Tq)I*|@_Boh#J` z*#!kf$oOL=P_jV-3lW1ROFdc|@G~4_eBClwjs6=Gi~PsAV|b-Xd1=@0ZMFa{d9@5k z@=Z7e7bF8Ya^d;;1%+Vyk)z1@KfMpW0q-|7;?0U@&U7}o!qWafu(Py)omEnCqP+CT z;Fl9)m>ADpGO$M#i@(wj;>UvRd3lEl3XuXdyl8Ys1OBh|qq(I%&II~A%Gu)l2WRUu z{-@SY($=1(^_(19Xwavnw*cW6X1kS(}BfV#(ZH-^{=KaZrtIw{S{%FfBnKU7cv9e@!=@m~gE2I3+9Po1t$(gU%Xo8(Nd;9FmR{fp^E9OV@sef%~TfPdH>kuaC4!5q2h%*=yXV0#`&FFbs> z_$V^ItPGq3%i_tC^+nF$bVUDp_crmJ##=e{>)elD-+q0F|Bd=3DrV%J`SQ?|Lcw5< zN9BhPO9ry!;hvEJ^0RV~`+pAa(GsB6$=zR5)gT6tOey-;4=>?l`5XK->CKzy*XnOx z|Jr!!)62JSUjF%D7_Ps5{pLLo!idB4!o&I3K9nMy5>m5GgZ-dH2<}Nu%Q%pkiMjz! zk`Hn*ic;jG%F3E!ez4ZsJpgg|D+=O?#l7OZ{^jLcIL8hrmS4Sj1=snnU%nYAJXBa% zR8W*v{`%PxKrvyF%D=P@WbQBi(sFOb7EPrQ8#Rp2xkQAodvkf-Gl`(SCXU_GWpG=n$_kty}iM7KQ23|%(bJ(j+d5~6*)o=9AEwN{OQvt&qnEFFP_Ff!=8$s;ZKQYw5LyB-mlBV z^HlP43)0J8yxXXVDd_|3U_0192-(PFke`^8oRX53egG*zu_X6X5iCV8+?87mXyi$S z@1Hz+{P6L^r!RnJ_VjuBBMeU0QJ*~OKqNDz?5ytZ=jUM)+!iQc1{K}sL99B6O-M+B zauN6+EQcVK&jGwh8)EeMk!tkb_{lnZ`0&}oMM`ORUp&ZuNPG0)=}>Mak)xcQn|AE+ z=SY?}0v&nOO%57Gl0R5cY?%r(iT@&WjtjZr;3g z{n<}$+N0~Y5^j=j-MtlmlY0AhcX~RJp`4zXl6%?9ETQa>4+S$ThI7IPq-Nj{ktjMQ zHa0#H+yaA$!X$4AW)yNbzaY<79m5=2pIjrZvv1wXkn_|o-M<3-G=*!|Ze71|?OH7S zc55geXwPAIgbq6U>KhU%nQ5m44;gwf?qCH?9D2?b?-_7fO;usr;0*OqXfmY@)u5 zNyBV9hG2)5F3;>EqX5&Q}fKui5~}~{)`7BS1w(;eBmC@*sk3W z2~Xa>csb@0^YX>(H$nxy@;_)7uZ>hCB;hH1D0(KW+?ad-uR3i{!>no`Ng3@2oKTCx zMItdGWuXvCPRUpXGtFR2);1H2WL{UqEp5col!{`p*B3(zv49{He9}*AXgVdqc#Mn4-JTD<0f-|bInM1** z*2C&Nsw6b@ry87y#$$A#N2#!%L5c7U_edp&bQP=={n{^di~H!^u!%i;KqQWhRusqW zuIOIK!Sr$=-5r&`Yj@~gc_&7P1ym$1L_I*|Ded@fNe|IY>1%B56?Nl1(cQXTJ?Dnn zfgo3~NU><7s~2_-UH$bnU6QUG0*8{XA`!FuNY@SnOed~u05qUPcIVFBd-jHg;Sr>L zkvOgdL!Yn!JcNKypv(21Bf4nk&OvT}E~$%iuKTRC)mELjSu|(k>3*V%d9JrEyFzj< zACHO!6imD~``jTRrXA5Sm;w7csWc>H*DksAaNvZ=M>}=_EJDU|_FPS0TW1H}iOGMG z5QDD0uU>mjbEl+i^MSrLpwD%7wjWGxIae69ACHM*M-pN29i3A#4gcn$40#M~581I} z=PqP@7@XeZL*T|NfHm0(KIKSZX_vwqbRJP zvnVnGQQ*SyGgoaf6_-=Pqe8a^L&*@Njygpd>=w_5HNvj|G3y$;np@+~h+3o1Fk9N1 z`tlaUcekFw+prem46C)Jqbxk8`e;SR|H=Gy5k?M>0my09&6Mtiho*r~Ok-CEO``tFpCRcD&uQgkz`v7?#@ z%`Dg-8W9#7!4BWm@Om-EHYvH-4=Nbo?=68_w+3&+cW5B5>^62g z-B#BqZs0c7H=Jo}hMj$DTQh9U@dj4Y>9(}cX1Lxk+TK!~6edmy4~GxV2@Au+i7-}3 z?XN2_CcWr#A1E>eMNmsbnqUB+KYL*S_U*F=>i^H55krn*zHrwvb?Zm$)4xH#K6t=YUcA{1;54c)spxcZ$pWMf%Z`v%kG zlWVj8mcT%8n_LefxP^zUf};wvGTIt)%vLnj)e@()YELy(CHvVgm@{YI68BwMH4Ud= zPhMMFa-=TylyPlsV_jM7YN#~`t;X3p`iF*t^MNY2wes~2sI_NYMw(EdZrbc05CEz` z7sM2b*}Wc`7&axT`Q({U^VsIMDD*fwI;~peuzX{7bv0f^sjjZ7imqf0(&S5K=Y)lx^7P>jym>RR>|cW7kf96O632tFf%A z>d4ytH76j+J{GuaC1`PWCRQ_CS35iSWRzC|r_QvzvNY7$!FBagYp9q_pKfhEZQ@j~ z9Xms|hxi|R6mJN6;Psj&M^)Bu*tiiXf~W`#LZh`aWE)^I=~Gv1*}gT{ujqCR=!%AvJ54$V zbfK#2`i;K6en=Y%jP1dD#)B^Js^VjiwH`ZqQJP0T=#q(4;-FnM^cUF+=) z>xB1^lcW*ojnt7@n4^RWi!yU5{A0^0I^Ay>qG2P7y_Sl>*Wyw zu^6<~38-NU(hCmdlG&X<^#7i|5Um@8!Q~UG4=pNPSa>&i2BaRSI|;!q0%t3i`mCKI@>!5AO8e65wTu zVUzb4=H=kItem{GE%50n4r&-B9_oga`N1J!2l9wqW=?)wNXR-J*g3{RsY%Od!Qut; zT>SjjHbI_iV#&FoNCpJfv#XLyt4E&21sKXF0S-ik;qwl($9vfifG0v3Yp7zc&jm_ueNOG*aL#v!!R=dKqfr+_xtq+$c0Txu~sjE9oTu+z@5SV_BMifkK zV|p4&c9Zas@Cg_crOnAu6=k9lEM0+0qAnrgQenpypR@@+V~VQ4fCeZ`1HXpA41v0_ z*v`?*c~3#GE*!ZLsDmq3G;DuiHTfI`vWiDK9y=y3Uc8b{Ve{1V;OwnXU!4b)2DyI5R3}$Y zdvT5-3R~al(a|x{ z;(gooAvpvYG?t34r7~5Gs%&YX!lGfz4v1qQ@r_!jK;vncm??1BG&oJjV?aF|`l~R} z$=%I8F@+855xi^7V;j%>gpUy-jY>(dJ+>Fwg~J;aUUVqX(HqFqXO#dBr+JFwU`K_E zqjni0-;<~eo{pvI+SJkm8>}o1xr&(00V0|pQufcJF*QsqCx;zA95&g~RGm$O&V%yF ztJk=>Z}rAB$C&{-NM2K22N|3kx|f$s01}5)!#>(BR33XUn@1`4Uh`pbFu=u;INCVw zlaD)@#!@x2aBlk|`#i8}f(2>kP{>E{oavy zyannunWm^VMnCWM*U#TR70t2GRK{#FBO>=jq(s_MIVJ+PXEHb({nTrmAs?I$sudTx zyDhMu>)`1Llx+%i+v$^#-NE4v)N_RKB9ywf*FMgU3aXt};Vv7%>0V9(;9brRiwc7? z9Q!k-j4I}7j-Ajg`}XDg*Q={dbd<5V*^u3aC5RVMl?}&dyho?9-)BrQP(wTrV1>J^ zadvcZUFGa*0fTRwR96G|AOPejS;kxG@)A>bw|%@FAB{FdJDTjSGvP^%!2Nir_nv*p z8-RfgJ9Dn)IIH#_-@g9%^MbR9E{EovwFmf=;`miGC8G&RZ+?9J`r~!#WW%3&wb!{p z>^eHRIA{W4CAb{0XL;=hP=9$%1rGy}cdE+nn*$0c(~6{Ks|J8@hY<&b^}O zDWI23y-~ z|K^91J61PJ{AyFB9PM4FviHyEv^jF4E9{myyXsOf zwsS6Ii|7nDczCpsSb#_WFY#V~N28CvZDbdyS$C~PDn^+mB@fe7BY3}K^V(E&-E^BRIxiO3ZTpHkJ zgqNd2ncTHd%7FqD=+gtQ!kW2A9b$EH$kw2stpQO(U@NQZ;s$EEDm*fC@8SIc zfm?%s%$a$32~AN&9oOgRX{vIWRCrF)ar25L_);S;2NZ>y^Nz_Y81j-=Rn=$(5mhi+ zTI@6JEJ2;4F_>lI5#k@XC2&(}`aeL9@`?s3_JFd<_V$hr^C1_) zW^LKB*&leA8JX6=TvhvBt5IDB+w7F!1ubiDnc8h5Uhzzh61$FR|c$_yJ+D& zXP+6cyE9!9BYm_)?90i|8I{I46aua&bjm#gO6$5uu8p=pZvl z(bup5NV61qqCizJydlu@aFvrYx3;yhPP1aNvDR0Vm)9^c0PIvj&p<^^F-t*GUPemWYOm=Q2tj&X zY<4ExJRMM zB?Ac_g#6k@o7nt-;IHuHKoWD_Bf^Witd zH4RLlxgxcxshNd=yp*(bstk#=bec?xw2X|jjH0QZ{chl#Njc5p37K-DQjt$o6G~xd zkU{=Y=~`iE3UhN~na%J#Mo-Qrt^{#sVq$7)Y^;(cg^^B|5|Ne^moapAm8B;mA&31k z7J9>>94yN7BZq)L2);(zB9wqpfiR;fqE-$<{JcE<-$_t>vQ8XA86T6^@6mF~nAzGu z$)~6Hp1_dssMt6#hV&1VXD5mi#J~h;v=UcMYG7_rY8Gf}Vr*onr=z6_)VUG_wv3Df zxQvq)?h=qe5(?TaJ9Y_6NJ)tBb28FUQ^0d1{4Euepo)g3u7Rvu3 zxCFHLX>cMyOcBm8;^t6Zb)eGK%(BRAhbc@9)jDdb13|98^C2<1C|N) z2AGeike~n`?~d)9+t^rHpt&(T_ojd^Q%Q6P!9qbz%fQUa&bgh34;chJTvb!Y(8S!@ z-pSp2Pe5p7%zkV#tQtBqvj{sCC~&3a`STx)tW7Pz;4Tvs7@AO3i{>RIE-C{4x5S1GBXBk~sLr4052c8fyjD5|Jy1JZ6`>)`C}vo|m_A_nEX zlQuRP!d{SHSbQMkMa-h2laZxqzL@}V(I6NhL?B@+1i4^CMi1%QS<4Y(Bgczkf^9QtRCzl>RLJm zM#Qjmhp-F|jU-4O@$m%Ni5N1Oxmks&RV^R>}#&%n^c6dp%y9h_X;Js_V;$gc*6p|mkU8;Jwm0;xsGsTt`d$;nTDuB}(E zuYGy%Af#<+XKsOma{*^gYGwurjTBRy@g~?<43J?x-4s2XE>4e2SKq)Go+seO9iFz~ zu3{s*if&{B0&&3(@CE-$W8Tmn_fGfZK2F>|Cug?xm=xbWSmTuNW zFjQ#9PJEU`c|TO!4!2#9i}rz}w?8gG1fB|zMggt@Wd}w~NJ>tPkNeOPvJTx0QA5LT z-`Ce(j_O#On46!4O9kBGTiX(|P%bVww_T8gf*c|-uZej2s(f?iyd(8KV@^4t<`p$$*6u!sZ3 zp$AX3ur#;u{RjG0+BF#G=hF1b(#o@?wnfV2CH&&z!a~m?^~$rwmD!cGpV0b>dTnuL z^~EZFe!dk?F?;*Y%ED|fo^>9-^kQXx5gt$1SMRMa&nzzE=N1-P!2UeGC+0YC8}mJQ zmIe5&rN#LLcy+@3vow%&j~s*@~gzC?1<$?8VbAK>tgF7rd!ralRW*0fVi~d`($6hG(8%oE-#?8LEQhV~6Kwm*DVD zqeEU@UYJ{erpw3hj0^ZFBqG3F7l(V-^Vx-kGhlyybqPNUOvh3D7HAv1H0uDDRs!v; z9QkkoynhByxwtStGl!q+03*wj2e$+5EJC229d4{F&!53lEiU4xr{`v8ar1}qEb~h< zSA{lc=S`GUAtxU_g#)1hcTGK+o|&1Qn?HhQS;Wu6BO(uxcBZ8eJ2KJbrOuvL2GL|015R5Qt}1+rinTB6O&~jJpPX7cMwsU4z5CE{ z2)akpZX7op`22hso^Juadcz-4&-(u~Q~ZZ|-bA8vVrJY3%A7L32B zXA(#(SoO~>&L1Mo?arNHI5L>ueHe{!WD{^;)3{mKk8<#$3;5*`7wZ2Od*0+eGP^Y2 zhNpz%yLJ1{ZQNbVDDEE9eOPz!+2akL!69bh*%$CDclSaq_kV*ulQ1}p&%@5g3qwLh z!tFbE2p+r-E<_74J~=TtHI2e>c0Lo&v~tTAZg>B|o_|9B#{V08_I$DmTT?Tv8jLuE z7-Tf}5pd;izC@=G^5uLge$&!}G&slpFYuY=ckmg*lrg?Kw*coGITQK7>K%7e^m2&Q}w>-G2plbsG|)2quPy?*JJ^@c9E2#*cAN=%#0; z0_e&AN91!Vx{5u;)hy309Kh3qCCGULnvJx(K^#bT8>b0G3WOgTesXg5QL7-h{J$rk zb&t+3Pd(B09iLk~0NwrZcwl7c2&Dxu`VhDW`h8Im{WJCe_lO>iK5PqD!T$;Q95A{# ze|-1mF1Y+v5!`YSdQ7oF!k#FW5KwzUn4>tyJ)nE^@X3e|G_v>~lFv*&_=R*fO!cd| zMdI+l-1G?$N?xE}7aaaS2GEuSfjLqm1pCkbjC>};?CyH*iNPdJ;x~@|Jn%OHkOK$r z1MY+t7sVzDO>oftvHMT@_2~aU$Y)0DYryTv9Dh2$P>B}-*CQ?I0@NZ9W&kBezgB=4 z{P)N1q=Vo8$K*4k&n^@J@HT-;v{mAX)cr-m_{8ubR6D>56Ssu6otO>sIsYB&+i%Y! z_B{LoO)f(xzx{?jGd2>@XEFl%?9smfgVVy`XE(Hoi?~bMQOOZ3Fw#QNse5~Pc&yhG zPC@mR&#zv;%6rX^&}Z8LBKq9^Ti46RrpCtK;b+!t*b^%Vfz#cM>)AytFY4P^00@8L z={0<7tO{zF0Dk`P?Bzf3Gs8>N4U+&rf1SJg;w3=QWC(u7)l)arHPk%%@QZ%l2RE%1 zgjqmxoLKsUyTD2G6Ra~qR)p8N3}1=`7S3$`^}p!n?B{e(p8-=%grA=g;pbNXKSR>0 zuA%ZD_}S_D++qc~|HA{DM5sD}DxQlMFW@dw5`*bFZjk=w&}hMq{|bIiStUW8GdI}h zlp4l^wZ#BGBee-KB_jEFn1L*ePf$)kDFVR;v=dap1Y!|kIj#*2p7($WSVAw&#U;2K zCiK!=T}lV|83+HSE|V<5f4G*Go&y051b$6*UC{;s&CNuK(OiVfav5PUPITc;QbQgb zvpbNwJ}nTKtS)jJhcqNqGJbv z0v$eaV8Xd@5sKcBgRb|Fm_jW7BB1drcp#vm?*P4q}L}7ratYM<{l>cBx$qL-~txqI}p%Jm0fwwT0TIP44E8W>9Is?~Aa1l@m1 zKyy5qx>^i;eQ9Y)c|p|%0!@w)J_E1NE5!@IVG|Vw$j75{91z;hp6PSI2;~f1xO^cV zXd#P>{}F+nLkKhl5rNJer+EBmYPh;ErG%xpw5U8^!Mu`yKr_WYUV&SUV#56kC_o@$ zfOAl}5;*6~nLZ~B#^q%1w*1_MnA4D?8AUSVnxQ*pVi zTv`>8f!2Ps1h+`VgjL;86$phnxGp{jn_g!OIaOHC`NK-UKtn4}#6aJh+hCxfmFGVU z^w5*hvGn_tWA`2rdwCKeXy1Y|T*qm1N{sY1{QLrOfk9tF>3)J<2P+M8=>aPk!Su7) zq8L*7?iuLp2@v#vCqU4sv*-Q$_tHl)?ciISZX;Fc?uMVJgg)x<@zfK<7`yKo5@MZj;>_7`j8~ z{CV@iE$IBoePR5@om=U*Dem04n3o9*G$sd^MVp)4jTmUvn{ba=OgMoXAyZFK0gwcU zG{DX?$OwU6pf@=C2;NG0V}pT)54VSJ-bjZ+<(osqR-i{l;oIniV>fTy?k`HuOv_?G zs7UVquFKm=FoKsLzKZcX!DmpngOnJe6oYiRj?>5tVuCPik(ckL4w9qJptn*6Nv>bd z8l=5`>t^kCDlxh}mqxFp4pIa2bmInU44Roim!2JS3}Mi`$KZ{W#ptmMUsng6=!g>` z#PP9XC+%Q#7#sBoy?WzUpU~86FnY!{uB)g~XabRg-e?qh^~HAUkcpc0ce`|lnVervv~}yz-f#;ao_;%AT?Ao z5e^wTax=6YvxPy41a!~U-VFkpo=8CFT)S}o;-$U|h=4wSxjiAHqd7StDGN&*AK$Z} ziDA;Z1h-N}gcw1(2B8cNjf{f7^_UF|Odz03&LaYP2W;2C&j7%KE|rKi=sAD-T7ggJ zMfCApZ|b?tXD@Z2KBGx-iSgLP#DtVYx`c#i1VYmb_dcHkOX&JSD9J)<5~x17MkcV; z?g9XX>7nbe@`1FGK{aE0j$Ha9l4wC-gjV$hnL4G4p#@9AkP!tRTVNw4ngJ$n*& ziV8rP4GfwAVbG~gHdbbqPJS_o`(sk#=nw_{#sl`_!>?z+2ujnGp&B9NIwY&&>UT9X zHHAP?%mxL0?li)kPj;O=+nMKMs-dc;uICU{c>-FUc2S%}81%{XE*AI+0thWG0 zu9Ho1rkeUDIP=Y>h6avFbtg~4E_wXe(G%&%*-jik0WfrsnW6-=sF9Tx7glqRh>ea$ zF!Yh9`&mgbwNHP!57j>rl|K}698eNgmj?X_cjI~hh7Pc(JK53M(b-kEN7DekwQV!d z3Z@2Lz(T{z20D*-q<69b(9njpHa6Fm1t}Ah9%(TdtH|gm+&-GXL(7PTu7VrwBEpR} zlI;kp6e6B3tpuKFKYR$`&_~;kw1t~k*Z_5%Vn;*BDLdG@BOJP&{77qpqaDr(V~SHEg{*ms z0+Y0gZ$v~`_}-?u%pJeXNP-z8=pikVAXcME)l}80Lge_KY;A*WxUIFdy}j7M)ZPZv zZx?r*Cyke<8{n1>fd`MaX0*|?9&Sx@advZY@wCHfk|ViC8K=l7V;mF_9J;4rIvs3P zz};mLUIT1__65Q?K~F`(US-w6$`(y{X!Gc70_?iAwWaw`ON_NGfOT%}CaN+LQu6BN z-oEbcE^)Q(&1o$x&CPA4zOEjgzAgqbJ9&5oM3pqva4L-Q%C4ayA-;8wv2cr1hDUJ$ zIZ^ztsykdUBd`llUwNRS$qa22?F~(7joX^by=+{Z+&!!%Iq47{v6)NKG5}DF4EUyC zQv(puu08?Yx_nzv-!gJ~w%uxQS|}@;1%w9p)ILH)bk*V%ZoYt!&LC=FgrYEXgNAhI z8c(?GvuLQVPp#u@sK+@wx_WvV!f$~niT;CO*YgSRimGf(ucK+m-m^E@j(|hsfb!i+ zxm{5k1WtY55Pz?lhyDy?nA&A{kKSAXAuodj(v5;b@MRe+T;+jK=vb{&Qnx`vSBJZ} zd3!^9X95ikm$%LGz9GRGbp#r^t}H4j)Q%qjNzfHJLF(gB(bZ7bat-tY8rqSZ64SIg zF*`FmKR2ICFb66r7(`g>h87MRNwPdCMmA}KhCW#0@8KO_1_V$Rh8oaK&ET-OG9nJ0 z85ZUauQJ%cp|y3jH0}26@u<413juayWnyL{Ih9TDVLFJGMA03YLSa%?T3|>DICMP_ z&$LxJdwl}j#gL@?i-x8$4~x#MN~xf!sz{Cq_y>m;0)^AU+t>5JbrpE?%?bSDsj1mH zLVg@lc4%V6KnowEnhIDws7g%r+Y_qs4-f4ai-o@~hgdA@a~_`g(|mK6p+B!=Qe4?(yWqk^Fz`cS*92!HKLc)q6*9=W5C@m=|F3ZCD{YM&F($K)v!`<&7(9m0)dmoRF z9tuvrKRX3WHJ3q1F{I#-Im7{EL4hK{hlLdZ@YuO4d4q;d3X3oY$SxJb0X_SmyAnAF zq9i07t{K_I2#C&#)CTn*M@|XfAcs{W0@23CrtZ#RHIT+<@hnKRu@Mk&8k-^H;b&2@ zQW)k5!fXnGnIJ46vRznM7AXa<7W649Mt{spj);>$Kr}fi1qBrij*bm+&m`n}NdzD| zC);NOh=xW~G?f1WqV-J7-E3p)!niP00+K+DVeCerHWa17k%*Ck=K?N+1s3D?K}8bEj)@lTt+bL8`*mRLg!9N2Y@Fz6&Fufa#9Lf zRzXpxOYka!XFm6hxCI1u|HIzwy=D zkF`&&y22bx7^SkrWNczSR+(%wzqtGA`j55s6>n)imQ4^VzffomOIH_5K%ptqM(>P5 zQW=>hWZcoB&rHu|V>OU`PS{s6GIIB8q7Jn2xcJ0`1Z=Sk(Jljrq}1qGIVn2i%=|J{Z&KEU-W*We$&SntL1-&Gd!Xre!&OPY_1suYMh*xxDCg1ffIu?{h*~}V0pFRh zmEOrhM4;8(5dsbE>Jb8M*fETLj`C!>Nh zN6I3$ILSg*bjKzDpkq+AYDiv+1SN}rq|Dx&+`Y1rd~9?eTmk^?fdFVj8~g2K7zUrS zHwSS;%)bN{5CI{Y#*l980e_}r+PVW?qrQWciF8v;9Tt_y1&8>T)f-UIv$FH-+{wei z$^h#J__GB8f93)FnGD032xUO1oe?oj4{7KPISmw~a_kmZz$8=_!0!?n5EKx+x1b2h zg>e)N2r&X6hY{%K>f*hD0k}YcAiwx}L_aeyv9O@6A1-_tMgvbveSJe6Cu?44Htc-v z>Sf#j4M7tiB)#w8hA9cc<=BG?tQqV!fxKW#Eief1=DmB0OXUB>KGOpapbC|dfQ&%> zpI?Ai*0E%`iV>O!Zotp}*4hSoTDG1_u)m9(IFGwb1<3(|eucY1OVGv$`osOPDlBVq ziWXe0Sqy@}%wC_s;#ONhxI=*3Mc4!cfPKb#?)8OwJot}~Z%KC!f}gjNvT@snIqK+W zYnlWj_?gn{+$EGZ#`QB3%peDXOoki?0aA(GnV6i26^Hq3x83UtuSW0$__@JbdN&Wi z&%(9`FC4;pc&GS?`?@>2?{Nz#JDF-GK!l%#oT7e%pUE~mUF?MidP1UoU;uZO9%b}V z_!IT4YU~c2#TMAFckT7^_VDs_^^B`IbG$q;G%D|K&)Mb}XSY-@4R0$ecOOqTA3&eu z_Sl=4ItA^IbT`yc)l$=sv_M_YEjxQI5IZsTAz6j!I4H#@#{5V%c2i=UHk=sb3Z6hd z+j}}Ygrt`@9_c*M(Nvoi=nin^YqqqC!>o`$ljhPu2_pdI2)q%)7>y2(+d0&?!m8#>PK zD^!h@OiD=cMenp@Hgt1!0`%G0$<7)cF>Os$4eXs=oSmFq?R6Bj>|C8~5%>(nwkZnY zipoGf%NqE3z;hVsrpV)vDMva8Os5wF1VV`o=s5(r5d^_oHCXzj7(4WaH5M&LCn&JO z+0!`KJ3!Tqp@N3FJ>LDT}Ho$y@BT1at+%>DP3I*dvUX zG6#`jLp~TlCLjQA)?(>!@#YBi1@hV6-Y&zI+1?t+XMJl28(koub!{!x^E>l|tpcJU$vGC_|bsA;v>&56m;YBb`6jvxUtePST-+Msf-a-3KBm(uL5{)}w(Fbm0w>@ID_2Ekn~3V9_Wo3>BnhrKMA3Nn~Ww zWK(5!Ny{pm`Z)+wLIDS#Z{y)3kYVT`wDcnQ1ErZz)PQ_R1!nt2=ZE^?M>V#3Cvm zP^Uwz4uWQ9XdOXoYQVAsJR9f1k8Toye3k<8SxsBd&_q{GJXexkN>WrrLdVSuq0g{v z3aPbit*G#!9e0G2&_V8BGSG&rHzdnO>{b{y-d_`HMIkcSd4#2HyYy&-_i_pajl&gRB(YxFaPX~2aOi~J# zG{Rmmg@g`6&dMt!1}Lu>kk2?VQedEQ!fGOt%KBDzX4=vO_?bdBsEClYgd{G}1fg^Z zDntlnFT}+puI8mnz%w2MpCrV`K}Udn(V=!q(3lFMo0Mt0fRKm;P6{WXBPj(9lT|de z^^EnEpzjBIg59DW1kYThQRBih8O`cLkvfPq(zMLi+vYUu*nrzzr;i^5)~O1 z9Owr<$K5;}Rk_gvDm<%DF>TuolqV3@z+Y-{bgFj~TF8#ph$mj%YN=9}; zNkw&S15~0A^3q39t2}g4bs_l-ZE@!=T)eO^30I2cOib7x6B!;7=#LCJJK9-Wni?7D zi!i|z1d~EyLP^WYEg&K(4e&D;6Tr{p1o)YjUCzeA$<@o(KPW6JHZeIZ2MpHKH$xsA z!U`kVk15^_2g0VQ=!JtI>~Tga;TB04x8m!4f%dZ4xuRlg9{3+9H- zkkhAe-IRU3=b7O-u@K7xZ6YGWg8bp7KQ0agQ@UDe%1{XbIZb|EPNq#{dB~$U5^-`m zHXZ?CaTy?=we*b5tpTtGNH;PzF(o6fsJyzN1+@i)vjxs_WCwSO=FFMib0PESpg!Vh)KK86^!P>$V*`1%yPU z=<2m6Ff3|+Qfd}*VIzbGl3fTp3UM1ed+yY;FYsE6LaadI{^(ybf`zg$ zHq-;(DFAXUvRhy$Hy6ABiGhZK9EairN1~0INHemsb8+w7B_syavzn%^5wuircK7uU z4v$Gdi&k1y2N8+i`nsBGDvHRH zV!{Ak15nP%nF6m2)ZyCB&C9n7RRW-%-w2KeXF9t9j32rWc{8`D;sA8Uku!PfkUqond0Ne~g|9dB>)v<;;N;AYL11p@SC#`Q_U}ORn5SEZ1b#etuK>S0E zL3~n5W=>vF8JyrK-%iwRz^SOJ4R?eQx_z8%UJtr=`TqL*ynO{}I9y^L7L%BUWhI!5 z-WM4GcgcYPd-wQydwIIUJp_rfbDEP8DmO=U_3*N%pisbj9SGx< zhYNB0;2Ap?OOlwFfyE`}V9DU=5u2ZAfNDJ8IR|AFQA!aqLnz7pE1?c8-B5GDe~Dae z?QKns>qi3D;SIy<@Xy-X`j7Whk;#ckJ#c|TkHNS!2|~V$SPy{m<;1a&@Nn>8H9>rW z$ZBqBTK%;C{64~;qZC7eFc?kP9nlpG_DF%a%QN`7Kkzj_KYCCLo(Kp#HZl*X4N_k0 zApY%_uV23YuYZAwkI%+hHBf$sU>xq(7`%F)um91n?|1V=01ZZ-hvK?~1z1;D+duXN z#=dt#A`%|uA)kQzfD#se_Up&m&(qN21CnagG4FtH|I=STq0f2GZgOa=<2VK9)Sq-d zVX8lWtgn5ogcsawJ4M)${`CA|#y{34;hpa8PyYPmHzxb@>k$T)u78_(IEpzVt4IG% z`)?`_tp4$p|IOg%TQ}bQ_QyZ|@!QP&mp^XwH-q0-Ua$T3$3OmY?bX|Vul?6={@VZJ ztNxF{wZH!V8-M?V!yo_jH~#+ae}6paelz$t{{F__Z{hIAKmLuszw!6SgYGwjf8+0O z{QVXVfBfU$`1>1we>~`ZGx#_D{>I;L;qb>l{*AxC@%P7r?l*&f?{NvyF z`x}3MJm`Ki_&5Ik#@}z@@W(&?jlaL~_s4_oH-mrU?{ED577l;>Or{rV>W*IrM5{^w7B{?qrBt8f3j)qgC0ohtpe)*pQuG#LAL)?dBKr#t-PkJtYF zOu;LU^?cZP-hA&(t42fVK5+Z30kxj9UEB_>Y76Ke+;6>-7O%sJuo6 z&`^YIczXKJI^e}%9O|P;Fb_vS!RT;y?$w7c-`4*3zrK8WyL=~g7ZvJ$`p*{`lVSeF z(YaUu+h4C&9uGD9azlR^RC$iU1o%iQVlb|S@R2Uil81+$CJP#KVz%s!+8-VmF3kg< zF&qE4fdBi$AK9QoNhI;NVFYq2!dTE~Ei5>aI3;MOhS}-kyJs&n)InbmWdvL3yQtY7 zYKa41Fr3f2#kv(n8vO}A3ETfexQ0UO`^I(PA-j;?m+$>%|x}HH=FW{7%`(l`Yg$XO3ShxVM+*p&Ik9 zL(Ec9n{~yvyc_ncP`T$?P06OV>6Hd9eUwBpm;5XyRWtP4>XeB`m%%vO%{Y1OokOc@ zw2b+DI#-_waZ?@(N&VDe{XqBw5DQlEle!R4bAM`(!6Y;>cUVWs0 zkvrD+XftCC#-6`M?I1h5rBOP|8F}Rxz5D{&daKfNFSjeDnMLN$)Hynq3wLTCs#?%s zbt7fm)BAel3N@3BlCsN!%GeVry2@ikQE_i1X(uE`j?u~9TXAp}XVH|C9z%0J+$p{qr2Tpcb|v%eE)m<7e7eN~BBqY} zyixe_?D+hw$3$8j&-q*KlvSkoOZ2?yl3T7b_8)PKvbq*wscy5brjt`js`7nVG3ik2+^SC0!EFQP#qXVQbd;*vQt@I$_aPJ)Hh? ztC-WZb2XTwH}}MxINCZi_m(>?I4NWBfQDz>D)*lNlkjQ)bg@T#9?fm&rLh29Zp}vLr+Zj$+o$$!ajuYwr;PN* z!P~5JorgDPwy%2mROV4|3Huwj%ZNN`y`mfc`mUc5&-KkJ-HoqqwJExqJEc<$gf~TQ ziLH2kp)Fw*!_zkEP=onG5g5#4{%G{-%kZqp5r!+cRK5o|84c%W z?xQ}}V$|;)Et}lt7a7z{rh8w$<9_btSBJSyJY-KT^AI0?J{5FyM{}i~$v34dw$0PA zVi9bC6tW+VRVz*CnW>TljTukmy?l^d(ql~7cI|3fw`fwO-O=0@kJHNm<1H&{vD+ix zjhC3G4t597u*XEc6s6nFj^Vn#N%iqNrI(AF-CEUxt23l(0-wWG-{5L}y1xgl zhP$4uf7+u`m-j;k4f~b*8pI8(gw94gn@OCT#a(5ht=xZpjE242>TV8`z*6awfV}`+ z=#C2-I`W2^*OeWv-CXf(38xc&5f%nzaa%0Y`*O>Kpz4!0hsCD42qPw1Pt z`cl29{~N=Z1N#(`s9EqWUFS|#o-wld#C~k?MC6C_{3`YSR7#A>96Yzx-qKZ&UqYUzUeGb*)i~eV#iwn47AzG{<=|4%_Amipb~mQ$*Po3>dvLa-2|8y?i?) z*zMx$ed^@ghYf{(nBk)~NsB2x&t4DT;d(-a^dgVyHX&&$U*0WpO06FY86FE7YP&p3 z*;(A6HTYtnL#~86Dbvu{%TZHvXujR@dsK{u8vP})1I>I{LRypV?6fwqW|7AnhriRG zjvR11y*qkGb}+M-8Mfrol5m-egnK~i(8{pz-8;qtk6jjMf8wTDigX9n-}E^6@sQ0I zkZv*MJufcmMS1nnMDCW4{3f;USPbvJ@BXUJ_*ML>-8DbE6Q7=o@xRP@zC)7N{PehU zM}s%{tS@)_W4u_d?EEHj0c@6pAFo$+8G~OB9+PN_f+_dnTVJaF_nQw8qTM zY&3rDOm7a3-Vo~0JEUzByf?eM-jh_D#_Boq3#(44$yklC3+kpf5^L)N*}J2dWxnMF z8s5k`GAMx&km(f^&+NS+w7~Bq?sTjEY2|gSK-b>pcRh^Hzqo6Y)ekbuu@>4kmgU#K z^w&&?K5uG3d3>DqW%sj9O&W(IEdx#odwT9$qPKMs*3fcWuK6N-XV{x>O*Nq*eTWyU z_#<1huJ5>Ieol>R~1T)SJU6P?_KhZSvL-I`0(ld(4Hiju2ZGHaX$h&wL>LNOgJ3M z5MWlkAcdPgH^EBRvri>WgM)F1^nO%zY~>-Hme-!HJ(*dm(k;0nAHyC#WhKSN{@m<4 z=l9ITnw^PFhAjQLR+9+F>D&r|nfrTAjY_0`JQr>1x#jTWfdk_q$qGYLZ<(T-P4X^9 zKab7$Qb*&a)_IEK@;jp|DxBZa*9M#Aza>b_w&>U$PFQshxTWpddal&jsI~8d+PbW% zY19`M5*O10>r#y5Me;way$ed1GhHuMhFkc(<3q%U{b)FK6 z6{9WRzv5>T&s#>H;w^mCdHG_3*)>lujpxa`XD6r+HDn2==yUT|2`9`sOzNeMg@&K{ z;`zfU4_lAb#Fu}?HTnCMSA3N;JnwVmOF_u^ zS8F~yeyckzy{Xa20rRoNRIN6w-e;~@7&x0>;} zY?-g|ROvv=m*OKi3`=>KvOA9wJnhNn1cw-C?gUG?8?dg&AH1{2Qjp7g;0@z$&%NC0 z*4KM#1wThb29)p46%X*fYrLs9ws38#%lwvqg4vayrA-18#{_Rs3tX7BHW?bv{%|tr zCc~%dQwHOgha+ciB$ZrsE{?5kpPs0GA+PJ09q8yR{H)dW{(&#$kLtXVoDRq0FAvK- zby(u4Lm_M_MFYjnxsJ*x4(*oPhsrnk8DN_CVkDoH*9M4L^P-~R5pK~0@kT1B0jpO*&;Il8UwGk&VbVCK)1 z&3%gf;rp%X(Q*3t>{r?4g*W5YrVjrID&}-y-j{RdXHI!$`*2sef8!>)pP>h`VyWnD zZtU@*3S$yA)`!>VbTMhYe#qXi&B9z@JgRa!OV^pqGE}ppgpn!MCDluoe7T(Gl~P}y z(iRzyusDiyWG4GhJ+qh1lRd>q?d9edHrD)eT(;$yVfzI;-V@K2X|ZqUMMWwu)OcU? zdGsk9?v!~ddn|W!oYX4s+dPrmoz(5>FHq_IW1590$P~kx-O9-5l~K}RdpoSbYd*v> zzAN8!*XIsl#`yuWmq$$8T3-1LtcLy!tZ#RvxE8RlLriE~_EK%O!F@v}{amJ724r{g zxSqWY!U?d19(FEPkm?~>UVZ!Z8kXw)d5?NhZ5~sUDkWY|W}0DIR{b`$ zc=MrAv&pygm4-&FuB!hChE62x-dc-*t^14$Ydt@|UAFOAt2b22M};Q7s&pu*$TL1o)YoUCey&$@rF(=Go*-`T)<&V|KT_1aAA>KB0SwBz_=aiR9@?c6#-yuk{zY zvBKpKJC&WDllCM<9=uZ!WWQD_TYj9zBah_bnJLRYn=rY=*sw=!mPh$~a+qCwqW25E zN&o0}=KXk=aQ39~D&tn2mA+^Bs!vlb?G-$dbI-9W9Fs8Vdd;Q3LjTlp$vc3%y@|zt z>g4WYG;w<`#fWfqIXrtiBDJHBC9d*1NuUXJ$Z=jBgOjZd>%q(FT@ItlUq1VvrIL*u zs22CW5GL*YvvBUv)4R@o59J^a$vH`;^yPMM~2 z_q8P(-?d9xT-hI-Udh#aaBJgysQ1K1u^E55#c(x*DRTS$=0Y6i^f3c3?{I?;UmCB7 zL`#Pc&E4cqeW5|dcqSwzA@Y9ly698$XpfI`Ps_>Yt&^x)4zBf(=v6)WHrSUM9!&N8 z>1pK~{i)l-I@=x$?RlKf-QCr826|R+Z~xrk_mJn&c+c%zj~&dCT_=5W90LZWb@N4f z>$6NAO()KTd%KZV+E+~vj9Wf^=t|*I(YC*thk?&y6@?%G(sA<_lvY_`@neVehAJOsF!W5Gqw{x8& zdqzf1t*$9A6kY9j^R$WXHIIdzLsSGO$H+*sx`?Tve_ZsF(?SAmCQN*D=O?lhe%ibp z)d(FC8J1cQsZ#f!4Y`pbJFZ$jvh3l%^X<>BxlHx3cPV>5Igut_8?tselBPgmkSBU4 zdw=4CuS!oSu3X!+Jz-~U&;_cCF7)+HoE$fL;@;^C(1gG2<G$qSRpVW8jQv#0B>6f0pl|D2g_GA`wtlZa(V{=sO$@?Y#6TuDga{N@Kdmr8z7eD?%Ov<#VBmR)ByFl0A$<~LBlJl3C z%uhJmHFZS|n8#aPbfllB*`hu-SF5C9rq)jJj9d+eJj9rwk;Yv8?QL>_FC@(_6Npt=TL*Xnr^#hxI**8y& ztvHB&^X~lqjsA;Q2C0ZQuaRT9L21@w#fHmt{#gpCLPgr)Zf-KizcKQz9)2%JF+J#I zKJn$qqhW?0qEr4ssu?Un4s0D?9V$H1+N*BYEscEKrTwJPXf-6+!eM?^NPLy!c5w+O zb)_E~Cn{Y*J7sI@WPEgYv{c01=On?t zFRbbI+>jmnBzv*o^d6?SUw4K2jZPh*?o`>W-yPkjdWNA)i$(FelnR#R!7ciqOr}!2 z-OVo#wC#CV>{{C`K{ob-R964?(`x+#S8vMgIy`zqom)tlg z|02dR>qVVe`kNW0D?6IPcbIOK?pwOF<>=wo8ziA$BCD9E-AF2rVBaqYE;XyX{A6}3 zjISz}O5y3H&k+Uc4Fyr(t~9;7$u?YcnXJMdJI6(8mdkj=gM#*X1F!PcS54va<1VAP zc0-JqfcOS~+(uOxn$Qc$QO6=CJ>(lgZh2oW~6B7?XDIFuHi`R?OLgR+R@j zGSdmqqL{OI%{_e1X;N^XXUvOP-E$J4=OGT( zvJA}ATfEZWW$4}vbM*1e7F*-@2-f8(+*A3=;Q(LABhRiULbS&Ne6Op~ zE&j0Q96xh?W=^JG+&M9ObmZXqdzqQi>{Z|PZ=0RbX(SPLxgMDrbTj>a*Y0cP;k4@g zPZI*o)tr>g`^-w?I&ZX@8ytDHPi^3qVEv;#=OZj}?dB1rr*pm>%u=fvsU6;0ggdg3 zpcUpAVmW?8jaKmPgjcB+rn|`S`Jo>FljQ;zIbOV?*|Q1rc_cxiU)s4+d{M{qaY5?l zb+`RuyI=cPA6Spt!~J4J4*T$WzOHEY6>*cWs&5za-^nwpK3Tlon<*cR#ge*}&K=h6 zdwslz@vWGZl3&OVFU^y#lgY7xx5~!**4PyHzWq5z8?c<;Q)T=_&#ETVkGYBT8Y@ll zCD-hXt(052EgxHE%)$#h;(VJvaf&6W$Q@p$i(`NU)A`TG8ALQm&(HfxA8&T;6Z-az zPe^|GKu^Qn$jp$B(n9nAk`Y(8%P)y@f%n(;w`20j zHeO^}sZPof+&In`!C7YeN4_&vTnjF5lghTqHxjdwiY%Wwb6>WXue4AeBc&6-)uB*{ z_3F&7e^YM$QSG`(fb?sJ(8~hJlB_+ibeGPvR;hd3SZDBE4ZsaN$}L zYjtU{VL6qGf7b&^EGTLGn+)UWo6jQKA%aZR=ueO|c5IJ=wD@!aLc z*On666%S%hK3={0a#9g{fs>)ft^ea%jYfFcnjf>D>Rmwt7ovy6k6D+PcVvW2_#+s+uj^gxX@RyWPE6GcVTkBzAkM21ZskuKsrU z=X*z&7i_O3R+W9?`tA8=$;jiKoP@unOWBo?UDAw!1QgO$RCX^Dti!%hNeqRrg6n7<+SO z-OOb1^&wrZyXS{!tUfBWkcL=j=-um@?%Iv}VDom<$)AVLYJ4KmGQ4B*&EkjUVJVZ+ zQ|B2DOX=(yPnVD4Kc2gZy-;uBbiK9JW6eIP;3zi@71}2~94<_8T2IIemMi_dP9EM_ zdpWP+=Ck9$$3q3K_}y(}d7C!>D8F-edYW76n$tUzZ?iK2S2SqM?BjWi`_C>}nm;4G zOs_xn_DS>gfji#L#lvFa!rt-PBmKK>_6+AJ-Y`03sl(E5npic={W)*8FV#sfxZJ7s z{YxF$0qRBiBKP__-RviwqSxw4G;;Q&^y(3k&I^`CdxEPP$)F-1331P9drkmT- zGWpVqc^qa9G?X@t?4HpauVd|(p*)o+aHj*aRl_Qt@$G)<)7qQqUAVBLud=icO5M)C zac#uQogDj@4Q|Pt|OGJx!Z(nWM67f@G>qxjBHVUS9OL%aDGZqFnrly3pLg z@|Eo_L1A`+8sEMbJY*x&4=Z_Q?*C)9x7h8KZ{nqoKeXhzE}nbfCh5IwG4u4{9sS~k z$9ELW9p1hCl9aE_%bt3JvnXtQ!twHc4Y5GEkD5oc1=zkcG#4fAE>&1Z(i9wY9ewuD4%k#RcAwzR>DxyR{n${-zDx`{;O_Yt?P0>lGmQ&{B`13OykroQ{yYwy1wsIb#Zze?ZC=;koWopzKIupk763;lCAKMwo(Wm z`{pO~Zs_8zNPOq_Qw}z@%Hf;`b7}8>dbNee?e@e8%(a_a4`;0=&R-JWJxS*3zVKY) z9hua~LB}EI*Bm*_=gt)wnC++WTlc;i(4Trsmi^29$@8m5(fZ^cgD0pHL@gGX-#p3J z;mj8uxo>0Zz;gdxi_~lf_KSFg)iX}nJ;zRS7F-{sX%-Tk7YI03c*>35j~DLbohZGRMmJQ(V1^Zt{6PKEiT{|cr* zRG>^&yfd1aO1iX^coB6zS9RJGMd7c5%KPp{%fdP*k5s@lFi;rp5(-3`JbvS`n|JZ( z*gcX#zD!-&!6}VQeEV8a#t1aDJ zK{d+@F1o5e@0T%25$vT&K%w=lRe}<<@mv(LG3-#rRL7RsP}1gonIx2N1D5+0k+N#4 z#15L{S&7>7kaOqV(mJv~$_o8vsjj&T1Y%~Btcr2F4cwiQNwNR{s+HsW*dw^Kk`VnX zs|oD}apr*oy~Y9%lUZZw<-=yX6Ckt|Za}m-jHL{(V z5QFLo3D$^Wy;ifo@~LS2`J~8GejX)5pmn7^C!vhLzJ7<2$c7`;3gmM5YYw4M5OV8y z`wN|l-fay8;AM`Vnd?g=KH+G722&36^Mzw>tb{=k3`bCHmLc%(A|_nCN&!C|=M6V{ z&t@55;jCUS|0-G3)xh7CWg<++7|JDmS3{_|CvLc*b|pr)cX0|rO8x}l3JOg@kulOr zm6-Wqg-Og?D!|6$^gO@hNvJ#qpWx@DVT8v-BvvF|-#q#%w{!-Z3w88cOFz*t$c5Sq z>+c-U!UOj~Icf$vt+BO=RmPv`A`}W+Piu~Qilr>3vlRbb@8g|S%z5>V7SiP$yOd-3 zS_@y~h*+k?jg5TdwLk_HX0h(%#3j7Rx^?z1FXQy{%zffSf*r5%fxe>IP#~>6w%QIK zIxqTlv5>F4Vd0Ify1CDl4DD}n)nCG4YNEtx&_yUjkZ9my3MyKLVARcPuV1*ZjDpL9 zDUCUKenk~#B$C26ZD#U8s~g@lMUGgrq2uw*W#6V9TnGoX8MqsW3i4m)CVVp8=29~=Xgpp(); zykH?nK1pz?7g!bB&OGFOhBJ0`uec4g8I$UY_)Kuke3V6W-+unW_SQci3zAKhLO7cu z2_x%N040Ers97TqdT&DLlAU&~l@%o#+QVX)xl<%?6+l(L0ej1lI&#QCky$Q%RKmqrtZGj%ID6CWiEICn^EA@e+7wE1} z<8)m&6lC?Xv#HNdtwd9&pItATv!SvzD-y0IM*|c#M@5W+-S?PCI6I5Rrb!qYJU8P zm*Pr8`^}GkO>x>4l9D7H5EEVhc7){t7nn0cNpmsLoM_)6!5b!KQnVNddbG%RR4oRM z$rya446fjr`^$fD=QnCw zRGA=dBY?;OK*H*bLKsI{5s|-y1QWsu+TtYrrg)BxKroEma!{ukI@b0(J>xJY$yly9|xM4iz}29RVr5Pssl^ zKyOU}T;;gQD9(S|@koVxis!$m5m)2q@ZXE=*MH&BAMoh&FSl{;w^*;YpwHpaMn8tz z-)@+H4X^$itoGmU4aF}3@inWl=#v13bdm2i=2h(BtYcx;6@0T_Vw8AH9j5<(?2??7 z!EX1@F_c|!)&UBamN#2yDNMuEYiT#301Y<`}psTy% z$^w+F8*8vd>>RUA@w5Q&dC@u;GAH5aDS~xEKK+)W!JZvO>VZi(vaixNdU1U40*2jT z^f@Y{x(E7Ew{M!=Wv!g>+PfIxQoX4x%rD8Q(spQF-(fO-3Jq|*f)lCXaq)94gSloz zxXCDkx}E`0RqHd|r*Td$v0W2UU79N>R8)?79SP`vc!#w-+G$*EQzkj%;OnS-!^_?> zj#$%}B1;APp8c_!u{YUNHZR!)e;LVnM7I?~ z(a0t&_5k$d>9%JGl!3nbXB-;;9SotZ`N>FZ@p8E!_)0NrQ-1v@yC^Q5Fu<#&N1Pj~ z0{oe}E{#*nyKHIi7L3=xcXS~L@XMwq>fp4L%J9wtzpm%l!MYos_SvBTK*fb);IAkt zllS04N*$iJ+WRs-7WF$-Tx(6p`OUbPKyKtccEL^vtSU$FLxYaN^rbqcvh~FR^}qy& z9!Cw3m&qb;)4yH+I~%*V1moc?45k&9-0N@nNeXtwTVBbx_CZx;I{6c&rLaE>f14-~ zPpyJ+s}SBRINzF>BSF~)>r4YdMco8LmMf}3$=aZXNcsO>(7n@<+ko5^dOk~IYQhO4 zS`Qo(2D^F6O+#gUyWq0jNFWHSh4j@Ib9Mq?a5Q)eM2y5J=wA8nI}8@YErstHP(o=l zK2>_>)0l-nvMDl&>76o3-e(-QP-i*5VvvP%VKF`m{)pDWQ~{#7|7?9qww~zd^ZZrr z)1{BbTTphCb<49Re}k?kpb5SUh5Wh<6A2yiA_8j>79~%<43NU_t`SUwGv@s zb=RdNV#cm9pu#aD@4Rz@uMXtTPWJy2^``XQmB`}uVgD3!_B0br9HYOO#)*Z$u!zH# zSR>t!hN-d!_EG)>KwSAJ^6UI63Q|w=TKtq}yv~v*+u$;Ui7Qo5Kf73oH&v`ZNAFB| za<8g6@v|lMgmLyOy`ShaYn>v4apQA*`n5A6$A9TXn$XpSapR^@ix2$m696inJR%Ta zo+@9iERMiE6-a*Zn^7X(Znd>!iJR4uf0E&TT}z0H@*HVJB@<{8{c|mG5Q%a`fEfXG zjMM3PYFO|8#-OIXzszl{*TkFKZ*>tx-BV~p-2gbLBCWmqE0qzqTM zVEa{A5F)p67#w*ae`$zg z+5%?X9dPc;I&j(z>2WUXM528pN0Mz%4_?bSvna0ON!eLVCZn#vw`+|@;7wyjgaM;6 z6tUH@otlOAS4Q9a2X`-J;&HkBNUT-}^=uH-uA_qmU68os=7G=~Kn(+R0y=e)+AxXM z?_9SRIZ$tGFTMQr1%{&sQ`Iq{B;(ZLlpsj|0fDj#W8lo@`AE)G%aAr4N>0JBJaSa- z{-G+`rs=~tJF?2>I5Lh$w?gAKjg?+jJ7ZneBiH$Q%i!s&ONSn_KG=5t9TztoF@$CD z8UEzT{;G~pk*wdC`58;pYUCUv1Mf&K!D+TUTQ>xyGJ4BAWOn6ossShV?fBc@a;+a5 zSO}Nx;&IBA`1}=Cpj!z`ubUrg`LY0_XRD7sjrOqyWDn&%%CI?oXHcaqYX`rvdT)r4 zYL{hbHNb?qxRSprBX|LITHey+vhIPvROkUE4Prv^%`Mt3vDu4mrd9R4?&&@JOuRc) z@p}CBeKktUL`3mJMYRx|KdtnOcS`*!p}75a%8@_MPsSVM#jgw%tpF9H^&F{~F=%PO zM>y2itDCe)z;jEsr*vyo1&n01le}*n-Mt0fcVm&Kn&h{Z*dOX#I@9fg>e$M;^*ZA; zR<%gyZgDbW^x5avx!e!OZ-2g1yI|Qa$Kg93yDi#YY@1e%+NvibJR2QV*g+xxf6;3# zZ^lIvD&Id~E;Lag2n}{6R3Bb%PXkh~(Iy*sP8X{Cf_mVeD*M@>zA5>n&N|U{zmJvx zidK8QgiDIyUup6*8aMZj|5csyzQ9PuGU}HDDgq?LDmXci1WdSaB3Mac`h=jt@<%Hy zM2N7|R6E)fv-lDA|0T<<=r<2pQb{~MB(8{T;k*U;jK`I2Dp<%rS1>+KKpw)KSH?Zb zxKo>iAKjGuVMd2-umpPqT{70K;;)ZMCML;y>($MqhXe8K%sKhS-=_!2!EIEaUQPgy z33)H9UHtS;b(#5~1EFLncl7mRkbJkJA&#Wl5@!ob%R8rq!^HzYrfgX&vJKM5Y2iLA z#0Vd{XCbppb!od$xzgZ5I2Z-N)kL01HC2wqRTBYR)zVNDE(w}l+v$|5QQcqq^9IJb zD7`Pbz_~NJ<*jdtg123uwEsYA1$X8O&vlck7w$}DD8Q+Z)XNAo_Ea4D2-Dol6aR*e z65-|5i82*RW=L9p4|7m&_MkFJEH#-bDipH%)2n*)kqm*oH10vz(R~4AD7x2n(uWG; zCdn*IhaV6q9psWo!>@c>sBK`n#yytqRa2)7!J@y<6reH^)eNYzy!6N&^Bx+Y^B8wd zU@K73#ue~&d3&&+bb(bOubv2i8%`+9Xt+$CC$5GT8K_Wb>FeYH8o;s|^XtO2w@Ail z%HlpKyH=VKqy^a4d16?ClI_@km-Lq?&lrgh3p$;Zr)p!W)Li$xtnCi-yqyIhyVie! zFRAxCR(5!q#g@SWo~O1=LnLPVSal-$xrjbd53#j`|2w#7NA{HM(TT@NWbO2#;Z6;h zM4zv70N}ZXlA|EF@Ui~kOK8b@JavD){!Jb~bsjAsLTY7f7fx3@tN$REyNRxs4Jt7> zWPqLZRp9>D$h5-gjhle%mI7(Jf@7J5*+t^CFwwf-d8JJT@WhiqDu17n`}Jv5^MS`S{k8dmQ=6Iv z*_3KGCYE}6lP(=3dT<5Y9kjXdWde`)EU@;~H&CnBl~-ZSjIK98o9s8Jpji0ON;o3is!E8UJdTr1{*y zuYLjtbE$}dGHk00x9S@?OPRFgbXW{;yBIEXaRA=kr)!~#!^OEpE#G@(6oM@+>)(RB zZbVJ5!X`XT?L`GRh2n!F-)~94|9N!s^uP1wl5jv=S8wd`M$Y!%WS*a)+P_- z{Hmf|feI6#%D2c=)AB{;+7AF%7G@5;D`sbppFvztug`qon!+r+Ax?76r85FpJt+qK zeQet$ar9snnTcDo#pzwVENApJfFJq(QW@h3)2nd_c!)#$c*Em3t_KX3IHHQJ9OOs( zusscq^mE^hus~`-InKQys{t%gJdGRL*=HI>0ci%iQV$hsrN4>6b?N^N3F59sX8%xy83ebj24X)RxY zLn3v9J=!P|G&NbD8V8wp^V}x*$R_(HPeS5Z+3{9aN;W$DteRi?Ifv=#{6vNt2aLUg zeP`w{RQ!%{Pa7Wrj(aI!CA@Kn+(w6Xi;qlJt_gZo!>#ic<5&mN|7#B^N${eXXtT=Z z+-KAQ*_qm&d1v)Uc@ii@?Fg+^vIEy~8tz!AjSBe^ty{p!MQibCz0LqZV)6GTlAkd6 zD~n|Z9xnVlc_?7`waqHGa?}2q2QtZaO}V;NQ;Gxfvev_Rqi5AwBW=*wJ@Gejn-qti zSWMjr+b>=ngL=5UW2@DxM>n@se)3D7wKo_FzD^!%Q~fpTegT=Mfn7ACW_cq#eGm^`=Qgq4MU^7dC|6M3m?8-vRW4+ZdV{8II+}VYchUwf1t>S0JcAa)LlPj%jnIR2iGPFR39{teP1P`GBZ!$K>K~K zf^xrMAH|dk78H@cGe-5b7uW8+FlfmfF?}1d(zS>xL&G6CK|U$;nUU_o%1SRKifTB4 z)60V)CPE0KLVSAfW%4n@e+g6P<1KU@;GT|R!Re91lvswN7YvlYHBl4 z7Y&DZhcs$3J6Q~8{1KS53xmnmn|8gt0rMyf57DO5H-FRDO2kX=sPhpD%_>C(c^ zuEB}F8@Rj;>H1#L=4&qVjRjV8k`!)$3@cp!V{%*T0X`4i*hJqMw#!C)#sENEn`$N? z);KPCyXkout$=wv!z$co;%WSh~*TZJhz!MiCPcrb@>Q5_!>Ji zjc%Tm1rn@|P3{@#+Z}}S0|D0NkLE#ui*5jJ=5!JpF#A6i%5fG}A-eoT-0mao9`(D7 z%Zi@v+k0h}v~5~4Fz#e)6lMeJ1V3*Q^G`G8Wy&=u<(CgFtQsH5{K=GVoX+dKlV75h zXv{!VA{BOzw5NXj`H-&R{r_||&**i85ya6AR?b5qOY#@$pULm3I?bzdyK`$scG0-Ac zfG}m(O-`xsk9ACU417rR8?bSc1bDoxfc%#YcO74@p#jZea;(|csrm>hk@BGF+>N39zW3dY8O0>t zSrz%=4qrootu22s_t}BBeSTCPEBx3>uW3tAi+}f3n_VSa+>9O?0ZB0kJi}F+{sW(@ zR@}yVqm27Uq|P2%rgsK_;nnnX3|DY1T}Iz0|8?L8_$B`fBhHJy|6BaIQ%lfcf$1e( zd;CumYK~D(Am@giQy_k=f9Wk9)CD)?n1cI&)k3cGvC=UFb8IU1wtrRV`#FMShe=aI zXktA}qMGDq%0)3PRH5+rt87cN@D2$^U64(JZSTF{V$dPbO~$l`4aw08&?9)fA{y-g zxn7E7+(?ZoZ=O^0b4fc?cw$lK)@}M|>*OtP!LrQVog93um_1-YMjzpNt*eWkF0Hdb z;ZIi=C{!&cX;2Zuwxw`{W~yCUQ#Y`_;|uCvMnJ!ID1Iz7m^YL(#&Y7YatT~}t(bTj z6&hUf=F?7ZB~5!Hx|fq$MS2nmM&8Yk z{8Brj;7-m|>Oc#&(%DC(!D>H&B867Qt!zq{cV&{-1R|n>>_0qy!tw+BE&JuMIjhHG z3+NLiDI}r%96ZA_^lce1@7z=k>550j z*v8TTn33^ZYi$klt10-FSvjB4c(Fj=>p%eVAM7ZZYDMtf?` zrPCspg;X`X;&%y|YVim`d1duMu@E!O`@j84%C5f($rwjFn%O<5IoN2}u7ixn87D(G z0GDzl$L7oG^j!OrC1LN^a`ptF;)SwK*xGJ@hg-}e_h-?>DBlGe?wt&UIQ;EW78HUSYf(nwkF>If|&XZ=r9naq7<;? zC!p*PcR)A6%EIhA#Mz#3YxM(S4y7*^8c6-;@vtpBXlefdSL7Ob`fxO+(Y>#T#!6@Gno}+Hb z+UxH2Mp~If$TR+w9}bfT?`NsVFyCOhb_pbODckLoZNu0d5miei&{e}}Ung#IBJ*pt zL-%4Mf5$38sP{7&VB#dwpA>^o*N`J2x80tuH_iHv#y#<46g%u-S`!;JXxSaEv$xatR2JNtt@Y=R3A&)Hj)dC4>X3ddV~cnzq!HE~~v zfGCG^!4ifrWTsZ(IN)q3qxx;&k`FIiKcS3y+-)Ssxac79AF2@U7~kxZCRDg8QQ5V{Yzph)1B@n~+^Yx10Y`1J_+r|5b|bd-v=;k5LZQ ztCrWJxOGA9ACeQ$VeY0|$OB0S`)O#5nQ72_Ea@401VweWXnI@3vmAI9YZ8}$Hh#i*LvRT(Ft!@I(pHfYO{U}i25N+|e zNkIFDYorhj%S^*1BP__7a-;as=i#^TE}YL5we(-}hyv`Ib9KOx;_c1EKg^5u4bXAb zciXn_AZbpu{6pKeC*vO#Ok8hM8>6Q%Ps!bcXcl1@1f1@?U{n$u9c)Ag^U2VgIk&Ep zH5FCyL&4khJ`Y0Y_Zjc;rRT-!7d;Qg`H2iA@hyNMJLY@9&>~iJYdlGnr0h5=oIV6# z;9lnD)h0t89j-NM%tCM~Mn!hO1Jj-9v%_nQmoMBg!Z`9)3P=PWGy{-qHI<6hPDAAH zMhAm#D@gIY^)@ZOA3{yoA`Y>kylAxhp|O2}b|z#@vchf`X2+?k~EwOVcJv7bev42qzA{MXf^qH~>LxJ_niGV@j&PIOPJ73z_i zhH+{Vwq^Wo@ed(|*`{||XCae)=*T!Z*jYoBcg7{AB5E}p@b@g9<%X6q`JyvCk4A> z6V3Sx>~XUSO!MWY&Cik4V&Yga7J$bPLMIw^J3PnR6VSwpGh(0=5dq@o_LHZ&2`_tX z$Rm$AK4?SH%(dhA+#y%Q1ZjW5B<8d)DeraV2F9bISUm)p{~|5y9Ke7bl0X_p%3$m> zXijEujU;;@Bd@-4553~mdycLONa7h=E+l7Eh*MK`)FO2F>209z@T@S@2yO~`mBa>@ z$}xFORA~;yFb6Lim$BH1L$?@e3Z#evJnyEPcl@tHvO{Ns1LH(K!t6QWcGrZ%iWYA`HF)6_M~5Tzk} zIhrmR@v+QmdtK2uNW%W$xw0hsqki2Jln9!Ox}ZkclBXQxWlE#?84b1^*mB;;%^6 zG5ZDnHrno)4>J8U=gkI^$iyov>F^j|!DVe*Yx`8<#*N9EA4()BHcF(Byg~SO)J`lCODJy7z(=Cw-8gU&E$Ru{EExkfzF{EzQ0@g|QeC z6hsOF%-Yufh8-bnb6$)#N>PMG=KEuOVTQBQBJsTTC7@2<;aHm9QYZV|%6SvOzF(EW zs0XMd6z3?0PQe&oL+gCmUxyK`a4g`mqVy1;!`@537SRqsjkrANGgIQbhn-m<%!|v& zNmIW=xQ;oCgVD8!jVV1$V{Z^TQ#OvF%?HmN1}REK-)Pe05oOUDX zI6gGc7pWem^z++%o3aSs8{MSWC=R$2Unkk0MBr9OuJ&Bz-QR%dZveB6afo}82vZpA z;(4|;LWxlr@#6T(<{w$j!XOxU8xw0D+LfxUK+ww4P1!}r%tfEwOtBfEk4cXQyHHq z1iRP%qj~C>5Q%rFeg9m>1ZrB6K}`>MPRH^32MUqowOOQJu9DJ77v39Cdju+ z>Kf>0w<{lJ1i%Q$J*VZzEB`05Q-RI6(Q7k#E*$>FQeZ%FL|DO%j&Y4ZS^?pH*ab-Y zm>2hK{r(PUm)L*os+QH5sB&5g>uD`UbOfmLzv-la?|2?Qxi`*}8b8~Xio~);fP}yo zoO;o2YBAVUvitpg@`H#7`>6MYt(u^dOG*#fPdXA+04NO z>Q+=!c>UxwPVZB)>-rBi4zX%s z2DNsLVd$*yPE3oxX2&mKLCqDJOILrmz=V8Y*5$E5KWJ(lni6pG zw(o+Uib#b>3LsS@hHaNM;%~5u`am)L_+Q{Mc{nje<5Z9iQT&pWuruq;8mBc3eve*! z%S&+CxNncUD=i*sDJ>E0Sck8REOqqT8Mj0p&#U}%~Zc1Cn8ob zQV!tF5Sao0eRaJto>(N&Ghz;vrW6*45k*3CsY{Wvu$aUyLxhtALCySX!g1pJVE1M> zd4z!dBR2rPb5uIA5lA42W0!F2L^+*_;Px4POcqPk@C7^2l}HkWQ*mjy;55QJMAIg8 z-0e&Lss+toS0sPrBxB$n0{gFk^QTlh(uh&~uj=VGffSariqkU%-c=BP7OeSA9Ge08 z-OH$Rd6F2&bRk6F#B-}Hes%m{yttEf`M!1&a|}|ShDcT_z5^!hcufgWL;X(aFfSF& z!gAET5X!;&dgGdRhvF}vt#@DU{L}* zo(yFQs{$+h0_rQbvNdP7I2gHyt`F5wiN&O}vU@q+E^f3NK!33Xyku={3*IilkIN#=SQ3O8U=-MdlCxTXHp*O-Zt$ubt77X?uX0KOx?J@t>&qaY_>s zq_~0sytm4$23N=M#5Io|EVRC_jQ}z7BJG)80hBofEo$ZC7)5hoIY8RDS2XJx#zIqU zUZ%ZPUsg}Zg!-^rnVEa%(lgcj-ulYLpY??%T0__UK)EKwSEl z=owh4N%73#euDDZ8=A-bwQW%;$+<;obI0miP|)!f^ZT~aT$-d{GWOOs^`rgR;`r}J z0RKJy4T*Aoi~%hgkTChBfHH3kZ-p^%`-QjvABChbm{%9b;-Geb@E)?57MT>lV%9i? z++7=Hj(UIp5s!uNdkb%)m{V!+d9Zsa!m%j^;>R^(Gh$1H2x$$-C44&Y5*Fnlvgly{ zE=0O*)FHG@AVhElqaFgUr!G{H2S6<)GunBvWUDl3@iJ$a)K{K%U(P+~`c=)T_a zNQ8(X+@{kk7ujq*an_*zy?Llb%jCr~k8p#jbE{IIuL1{6@Q>e|Y#o?1CIc9^Z5=2% z;d%05Qj7?8_6)dAyp^Ue8$wPqa(ej_Y7lb`aSCLhN zLFA;NFq#mu?*$<2A1W#bkVy+_+@TV5%HaZmib272r*%X@0z zg2NGQsgwwR4`QerbE`o59P%+G8Mmo6M@?_@k#9R)Q7BF5O)|zlWxM+&USdW|YH?4Y zLn`!wt=$gnuT6u-EbA32!~y?fu@>p79LW#Y+xcwpv6Zq+Ob9Z_JCo_*v_t|(IJILsho_moZh(% z?(w?uR9O*sd>kLAa!s6UeoKyX23n3mIMfX7IDA~5*V9#0Klg;Qa&K<5@5hS^*)D*> zIr(jyLO3vN^7uA_$bkP%zC?nUYeB`yEmZkfn|`sPxj7E$*RPerwdvofGa!nMbh7p- z$f<|H3ZuWraYC4ZT`*I?vPr&NZ@_KJ2#5~xpj%JY_G?inB>U#`x=|g}4B1dRh-WXy z7C+v=Wz*t*lZXlW|94ar`!Xm|TRtSVz|pt=h8R1^lJTO&@+GVe;@aGXx@=pB^rRbA z5B8-nahgHUCY==Ge!4c$k}0sijDJAP8iFQ-#=REZxSK6vA7(w^$wqpNRs|Sd>CdS? z;~Fv{!Zm*Q=u-VlcZN=i|9-iyHEcXp$EjVO4xdOL9MT!rdOt@yNOG+5j{daQD+{d^ zz;58ceaOJ-k7oC$qd!v@T(+DxbBCScPkBq;3pc4rcJ&uXDGHm-Ts3g=4K|})iL1#V zd9@p*>_~IsSRBi{|8a`+gE^%5+$qTgWWbaE7{|$TWJeebSjM2OHsNReB0oTfT0je> z7YRkn9gf6qq>0MM2_S)`ej~9>>kaEkn{|P$%GRF>12&mR&cSZ&P@9IHf;4V*W869>_SEGY2(UH7BKzqZx&V6(*$Z z4kJQ8J%t|B{~=`c%s7h<@PJG;>&SVMJ|1J7h}^6+eHWNJRkk#DUQ6Ni@1sEsX)-}F zm7pnV;Njy~Vil08Hg3tL0;Sr1xHbp)ZDZUSb(?)wR)9O4sC9#|MrmY+_cyrk5Jl?T#a&*Kl9SZR5f>6^w2`cr)akmT^u|M@-?_Vis!Q?4diy;X%yJlff zmHQl;kf;s@9cA=`GJu;TzTx?1=xe~*1AaH?{?uj-{@sxEDYmFoHk(A@3h{CP$r5g4$ zYP=m$+f?sFstcj!k@e2F>i7JQioyj$xL*AuMIR_A>df2Kh8h`QH}MnN`9W`KjT%?F z)+DF`d2>Z}&gXmJ!2*4I44K?9t2hwV-NbQ?fO82P^g{A&3L6(QY|-^!4bA4+if*GU zKLSrxJ2yzKj&zAbvv_N7kkoglidM8-e>ulVW{Eczu2rAfuT7q?CngLs&BxiP7}d`; z^G(1yem0-VO1eLj79Pg=RX*>#4vL-m3FFh zg5kruUnAGquUvMiDgAF~f}{w3zrrIarYl|}y3h4YSLxrOa0giPK5yOph1|77Q{%t&=N=qNVX{{2T) zZ6{c67d@m0^J%c-fqJZSMPKR zHuaE3auxELZ@kz+#v@In31W~hMDt5YUM~(-%vm;%MpTY;th+jeOpJ`@S2iKiz^C7}Og>=>`H^xP!f&9@)uA|#(pjdH;%QkhtcJPRFCEf!u6J_u9o zjXtZQyMa@4QH4Wh=e%s)rY{v%-e+Bt0H={%bNh`*16w92^r4Il%t?;hYK*BXD3~UC zf#CB4RweS@*Wz{MhE_+oBv~UTf$ZMzNkA1bERrB>k?^PUVt{!SuPEI-Bo!9*94b*c z^k6JJo_#1hOHs&%8BJl>98(bXGI#No+Wc*`z$??om0SKbx6X(wLMEDz<25%Ycy5R- z+FUB8r8`=ULX{-)of7e~+l0O9yGjs1_q+xn5&i(xOjk|63kaPZeNDiSB|Jt( zj*+-lb+_R{6u&UMQ@yetf=+lzbDJ@%I4}4Z=V{tvW6S0mAWby$Xd)lU6>Ui{(vhgd zsxq2G!|3B_j@4jG((O5IWm9k`@T;bNnuwgDC9o@dS`O^=?+71e(0lCny1ea|Su8g^ zd1zAihRE&n`k1dEPIE*rTMpCngwvln2-o(2xLA>z!lM-4x5kpXQ{FMiAZ3vdbF{oU z_dMxd9Dz|FZeeLJn=!t{YWsx}fwa4~oZJ4}YSNSdmtUC~gimleqZfVE!NKrqE-ZX= z1rqOf81&D<-~Ukt#&&|zK(Z)gHNSuKkScRz#4^OId+1j@ef@7UK|=)5N@;rjUzRGD z_}kycZzu?mfWk9#9wK-WwG2p%x@yGBSBJ1xUDPAlS@Js1n_{SE7q_qqQSv~&Z z&;MfgDC#E{s}cSg0qzc&rt}-H*gLm(ncRn;ewV2IfQtju zS82(%r+7ak@)d+o6F%*uz$x*ihVmg#9Ym?iOv^A9gRpn|%2HK(yLr3so1b9VQVwbR z@FmC&rZ-5~5&tN}CP5$~P`Ldew(1KnC`C*Qj8>u@F!uBMRs2c_{})`5Ow&ZVvK0*O zRPqu48QLqsYf@7k*c&mN5OBU|ET$saJ@sn*MK|EB)M`xQ_MU#zuiAzCP;vWFziKb- zLj9-MKT#*@Aii{;sF3ll>UOcnyWw1tDj3Ket1ya&Bjp6S=1|j6&p&@IFB#!3X;VoA zhI3(-yv2Nv);#0abRlUYv)4QA1cLF@Ez;XfsHbGTye%l5$=%xbYRgn{AP{jOG?z*t zCi=NjcxZ((B@h!A3;Qy0MD_9x;zB0$u*SgehV(H{8ByjW;dH3>Z2)_=IQi4A^XL_& zB0`H*$5ZTxwGi-x6=zZIQ#BH-*y%B3%TY_v(YRcpuYj|F$v__!;z5t2G0z!WN@Eu# zJr=~m{~%L>6{mahVSrJDZ%NSh;N78}uHe_>y{|PB6C%5SHQT&fx`yi~rG^?46JNQm zFx1rUB}${#pXE3DBd$?gR}KB4R7tNh$-Jx)-zYalW6t4En*;D^g(+3C`{uq2eJP3zWKe~G{)r! z@iYLa*Lva->>j`d8_l}kfHY*2xd03!TvLdZXDJD>5x$_|$$isrs3t zaotCkK|ZXkmMid;fArveL^*9q3mj$ZIV#vtku^ju`ns^NV&tE%*PiDYaRugMPK04wg39rM>?Qm!c1G}zS~6C1J)sgWpvk_CD$qp~zo5_zM*<|d z4iPoYher_|qB-%rimEyXUspvX%gFJpX7#)8D~n}Hx(>6yG2rd1|0k;zr_=x0X=83y L0000CLjGoE&y@FX diff --git a/samples/Javascript/CocosDragonJS/proj.mac/Icon.icns.REMOVED.git-id b/samples/Javascript/CocosDragonJS/proj.mac/Icon.icns.REMOVED.git-id new file mode 100644 index 0000000000..9874ec6979 --- /dev/null +++ b/samples/Javascript/CocosDragonJS/proj.mac/Icon.icns.REMOVED.git-id @@ -0,0 +1 @@ +3d09e8fb4f4ca1c1ae7ab0a6948db592c7c3d9a0 \ No newline at end of file diff --git a/samples/Javascript/CrystalCraze/proj.mac/Icon.icns b/samples/Javascript/CrystalCraze/proj.mac/Icon.icns deleted file mode 100644 index 285dee82b3d3f80acf3c0037b6b6ce35df0e9e5c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 77152 zcmeFZXIxat_Ab0T(TVPcCg&WwF((wvIgtbb0l@$Yf+$9U!rtBFj7Ss^6+xmXS&|aF z0l}Pe9`lUjIL3ZgHO@J6=AQq(U*1pmcR^-g*WPQbTD7Y7s%Jgb0ULvNVx+O_0(MTG zgkcnJ)SEEf@#a<*=Hn~`LW^;F@yiUYEQJKZ+=Qc z@;C=Ct#KBLYV?`;X4u#qA!fFSC$v=LaWrsMs`_?qirQk9g*k`KC#_sfo*6ckVr!*o zZp=~SaF|Yk>zo}H3pfV)h8!M;qew9xD=_6Vb+mO2tr;9eHk(9MpeQIQtLrF7eY@Q^ z*gw=Gx!N@-kqq=bywpD+8SEYKE4bA)B$W>Ib@aj2;qLifao4*CCDMUYOsqAiFMWCN%jT>Ly@S&1;^L0ra@nm@kJ?xIfsBN-+{E3|Q}16qt4&(a zE0u=FhN~T`t-ly|wK93@k*hsXK@kDts@odtvO3};Lz1ubcyISyU*j_;xh`qk@~sDM zbg%O9Se|Ku2@aZLMy?xr`t9vJCPy+o-5q`0S<5H1x7jaSJ$1Rm1aE(jaZ@J8*VowD ztypEb%*Vxf!R$$%1v#ZF?d?{s)HfMtF~)R}I3_)J%QCy=v#d4wn(CHzUVFtcI^W+s zc>Lh$-G}dPJ$?A-@q>5p--l1`J>FjX@zzuPQPjhm_a8pK|NQO}&%9snJbC!&(eUNF z_n+Mg2!9oF@b}wrbGP)um8V-Sd<74j_~qV{N6qIt?-FIQo2MSOuiW+ft*15h%@yJO zr{BMLTAR4!-lIoHYV!1t*VbQ>d!X^%ovh=DV{6(PkOQK&7rwodc!=<=@t&1bpEzcD z;IR+uZWGBd&gsYlW|-mXZTB8TMkFtaV6F9X+~C1lHvQJM$j~^irH&K90~4l9K7M5& zGBP}7?&9^US1+7BVb{5)zOcy1h<%fc$Cz1}t*tC?IFlK^KXikem9CM|%)rRQ<&`_9 zZwUU_irEm-6;R4qAKEDgNKR6pUcO zi4|y=nwmk2Kp?cVG9zc~KJ@A0HnK5DiV>(8n?Rd6TAqa1soPDmPp_InFv~cBhLMrH z$h-G^55C@ge>10SJ;t^W3v_jK zboC6hEjZJkJdZyA{Qi?0Pai%k%1v5i2y2-T7wBqf>*(mSjIsFN$|j$^bLGbM>sRlV zXNba<(6lpH0s{`0$K!JpBeUEw1&oTh7umyqY1ndmjG`(q7YJ~UE{~&%xgK=G z$P9gKcHSJ!kdBd-EHzayLlFS&TtyX%8L@+hX^g{GrL4rp^D&;|YIVN35!@l-Xe;u_ zt8hCIYJ_jurvX;Xa5JWvz>CS$47DoJ)OMeivR)A}M`9GJO8r(10XX${3KmkiERxI|!GV1AP~cRX;c@9hAgK6(j?_53WiF z#8S3ou;)q=lkLQ=2nP4T*{LSbziMC$2QA$sT{e|Jp?*5Pc<~Ro$ZmpJM-d6X7b*Gk5@7| zrI&h!K)hB(^{K{|_H&Z{p>}%Zy$0FmXKe+%rs2LpiCC&tQdW7guBr8G=dfY4?CG~J zf66*K5(Sm{O>Pc$>;35TiNBuFk!!BfRK76 zB&TQPrPT&ad-fD&?Y$>Ao;yME

DIFU*Fwvw&PsdsixNYgCbE#(d^=@ zJ&6K6Ah~Ftfg*`gDEL;`xDF3udR>IR^%=_YK^Ho4eNJ=Gw1X>6TP+ zygb&$dde)f{KfG%PUdrl2ma4r7&R@q;w%_w@9668%P~bN4VxFNLk^I( zNhJ1m_Rh{5v>Y;>FiJq5kxj16xFH`Bb>1o?gN7yu7DIbGJBJl(CmG>Ed{WA1ixsI0 zCd(o)m1S!*wl-HZHMiRnb~-Dac=r2OVl1l3{>|Y!Y&vPmnla-lj#gElZnVekbnTbB zOjPy_T0hTezrW{};0cpwIn3oH9xg{b~m7}?lNm@>u2#zb{P z%>KBzBosCdjv#ya;0|tjC)e=_%96 zWGYMBYRvTIuKs%?A!?Ei9a-YE0=Lsxv2@A2Su<^IY-Y_{xYXHe!(s{&-#&XB{fPbW>7BQy znd0}4?mvAH_lW%X!NVAI@xkp0{28}i-g)*Q_7UarjXU?nk2nvW-Fbdj?eu1zpWc1d!%hk<`2A`ox9#S=+j_b5_Ks5;Sx1>q3~h=`qR90iSO?gZ5*`tIFDhwv!sJWW)RR-!nIICZw*A z?G_f7meg8f3y0g}GdFvFO@C|6{upuE^o!3PJbv^jH@~>3a>|szzR{VRej3eOu{fk? zPQyEt9cN}0WY>%hPCeY3u_55+%w04uXlvoD;!h~QPD#s2tD5dyo13%Jarx?`%F>D$ zr>T=?x*b}4=vUMp6_=QicznfzlZSRLRcC5@z|36*Gk5xej48!m(GB95q_}*4n7M&y z=Bh>I?Um2m1yR;V&)x(BBcq~YQlc~>GFM?t1s>*7unglV(6G6|dX%td*B(9Gzdurp zXIR)}IbzhU1Ew%@Ctln@rp$9TG`)2B`mMVL`}gmQ3Qu)35CtkzGQJ5{q%E+PMPVvS zJ=DZE`mbERLG0Iw+(&5IMXtaU=_dRA!*zK~(i9KjjKOn*gCm#m{kr?2!eX7cn_%WT z?(_Ey3?4sersG_G#kr0i2prLV?WnN0@fz!WcL%w+FLQ#4yJ7(&zN49YKYsh)#_tc= z=YQ;K|I@p&@0GIu+=u^X`gm55Il;RVKz|Hb!GCUI{3!$~s9odZg zyctGgEXxHanuDPRdL^=KFgBk>F^&%kZw<9HXW#t4Pg0+yu-?A0)gOjk2)70`s^EXP_})d;9U zO9ncH6xP5lU!V*yivpcW##n0RX9Ofm3&OGrv{~wa<|#r<0msNn zrdBPe1-GmgC?N%Om&5?{sv{{ISXea)aA>I!@HiOBxZ`z*9!4Tz3~ftcqX08UO;zA8 zKFBZraX!kL0(()KmbtJ28VS%?w`^e^M&>2-Q1oM}D`tw|6dD2ueg@kbp1;SbZVMYN214Pm+Ei5esmWKqomO?WX zGDc=G$QToI|MW@rOG{N%>=ZH?g3Jgcn-XRs=!3{IPe8UZ<>MqRrD^U0jEyb2122S| z)fJUViz(m>wmxz-W-9u5d$zz>C^Y4hV1K-*XTJsX*t+{q+4oO9MJKBdE+K(~So#7O zOB@ss<_Z=T<`x#n`3D6i@Ei|1N?F+{TZ@g2+l0j;{OC!2$;pZXc5HZ(Z2)5=l0S%g zeNbR*!iN2~(uQH#g9%vH%MTOR$iB#ae7{~@SyPqch>!t}QMG_%VuG7SgEr*Sbb*=B zoC7WN&6i}qp4Q{v{UW;%bL9t2l8=2QRW+3dmtx>Ij!6|fXNtp!sW9_WU7xP+eA8U6#2VJVN4`354YW%$P7iwvKu+QJ^j~Q--Lc z?6~s{o}S2gfac|wFFyzw_w$9)6IC^32bWMFKDZVY0*bMTF+7fZL^79;F>VPl zNcN_z`D>Dl_pb4HWo1>>abgTerRiFh2}nl9IH<+{_9!7x)@Q+^)A~>j@m=<^>sJ}{ z7yA(-<9)ePQ4SI+5AT5~g)t4w1friti_LKGx7d;?5SVZ<1|}T*O30``WFMb@iI$Om z{D_t*ed;Q&0PU590V*((TvGrEG2vkW$E)xiz|qrU84ZBa zx9At8A5UseR8>@0mgTL{0y!!cfN)t@6bUGXMuvt2_~G9^WLsLQU>Hq1KhBj@R#sG2o+#X^54}<{7YYp&6pVymj=nx_ zK>X|(@)2&%GzI^V)X#kV_ATM7;+JoqWiL`RF!iE0KfVxOHNM}jI#zk2yu9LQfsZ;B zBl888np8}8j9e69AO=yR?iQIbv`~;FfB5z}@lVB1pZ}0Ong@Sd+?IVN{?z>XYy08y z(z3D>WqGNKAV_J3LOzD6SqcvcMEZo>B;+H)lnoG@5gTUu{HwB$NuM}>{P|IK*K|zL zUiHZ5-#_A?Xn%gYSWCH8ekPk zPmlO13mK*e@UR|@j2R`p`TFhy{u}md{BP>NetEsa@5-ld5AdK{U*G@s+lLSD&K4az zLL8+Y$&YrTM8iU0a!5eY)BQ`7n?zrKC<_T#nE!eZixLP_qyFg}SS!pIaYVZMN*3y9xeP7}d&W1DHidZi@( z_4ikAU*m7E*Ku#u-@g8>>C~UE-o1VG`QgaxH*ep(dH3tn#yoK`?Qj<1ijl-HltNh9 zaa}?#O9TT+7^|8X@nOBTd-VRzO8~K6zIyW-_8l>=)Ly)N^ZGTq^!jJRtG7di1)?Ha zao&NwW^|CoHU()SkT&Wy6c&6F4JrlGEPwz0=`YWpzxd^sH?Mw)f5H6aS<8&wN>siQ4|eu`lXNQN+=s>X(B*Xi{7mlsc; zJ$wG-}k?7%Bu$eXXW$q3bPZ!Cr~l24iA=afn}}$)5UcNT@lzt z7>EpUBUKc}lZ)Ozc?{o=p8s-YUD~r3kJFxDPsLAYkDos7%*+wx^78W1qc-YN#yi-M zF$H5wVU9qggL)^@rx+L-fFLzvF3ixim!ASQ^5D^<=Z_aFrQUn-Am<_V!PCLKOi>Om zJNIC8h0rHyYT>XlFbs6)7}+@c+Z8#Vin_LfKwi1 z-KRge`{de*w5)6*i<6y|DsnXO%kWWvS2J{pqOGN^jmstB`eZIk2RC3D8X76VTn{|| z>@I$XefR#;5>?D7;?~n!cjNBR?%us~`_A3iI|{cS+-^=ico1YB%svo1&j>%d6_$O5 zc`n$dg@bj-Q#5@ZNf|8^8hT8O#Ljwg^UkeXw{JY}oU4rKZM*XL#_fb#dgFD2bhtn7Q$=+NlO#g zB0wOntE8vLgSWb_zP=tC0wVO%E&M9y+LcG$Zj?O(6D`i)xpFP;D*f6uN!#U{SFXie zrCqss@pw`yk;Y5SIJjnd^uhG>b>JvPBo@~sX=#b&-8KNBBxOB)Z8}WN0}n4;y?pt~ z#ryfRt=Dggg|&AsUX8iTymINr%`id#?Tc4pF4HbuzgU%+jHf82CTAqr`KDzgXKn`> zbYqY!0&7Je)<{Z`*Ho!)SN_~M0&BR6_{Jce&vz2gyo`O?L>3kp}R8DcdT zuf$!TUcPWDA(2SpB_>DjNK8peN(+O{JypjN9H60rYl^@HgbrDcN5U~3MIDr)?j5;w zVPyEi(7k-s?0Z8Ou9W5WT^YU*J;FYJWu!`#6w-U+{Dooh2yOVna6@83Od>leF)=A6 zY7r!vd~>;2ktQJ*OX7l5Eeclw64avW(!s%j^MfNnd-^X93=Iu*OV39Sat4MZSEW95 z%&_f-bZ9^{h!0WDw~0=w8=WiQpkwOn8uFIkv<9DPamo(IXl?b-;ejj_p=A3MS2QjIGZ{y^h)u5rbN=) zCzYPd6i3I$Fk@qU)gY+!kW4~-)J$BP0~tE3t{_o6p-0+F^icYn+WLqdqBpunr@Oc7 zd`B2>O5q~K!xy^yx_f%Mr41*$CEd9qB3{gljtMe_w~)2~S*fOmtBd4za<#c&Argxj z=J$1Xi@L~X&vhqvanE(18)&mp7u`BMcVm5jH_^rDZ^*5Zb{!(3;zTS$934EF1&NrY z@Sp(yw=~#%U`FF%z%5VqwV&-EI`Ol~ow|VJ_cv(IX*nw`-+Z9I{cLCF+0Krv)Yk5z zsQpAN&Wa-Nka>_MsF;H^LXD8yrlh5XmM*7VurXTJ*w@R&^R_@9b@= z>1fA0Se@I~=tSkBegBQ9G6@qr?^jkyKT2xh#<;hYKe86)vEw1vmAyw8giI z+M-)IXWEjqhDLj5G}msrp{_n*ukQx zhtEsLnE$mElLsMguxKX*O;Y>|(cyww+SX5+0csTsSBbfUlLR@tqP7FadNmT_` z6~O?BHCS8{8CzV?-aJpY7_S%CaqF9#PaG77hejq8oNQ@4jn~oZ>l*S8G}oVwt>c}p z>!=lbxw$&Jcm?c@2-_bH*l`ZwB zPM?B*ryFb11Kn0GUADq$U07ai(`oz^?ewXVWA&%wPAN6kmnV2kojhUUq$zV(1%!t0 zCHAoP?%nQY4y%to5{~f+6%lxaQ0HkV!NqAwEw!y-7I7^#wfIT;sk)>4-Bzq}!`E=# zoL8-nK2mr3Zp-TDn1 zd^h-P&aNnrKf$diB{q0(@ZIP#XYO41htH@27}9#d*|y!?2)pRd2)raP+`!)&xvhcyH9t~q+_*wK=bV@FDl?OW@! zVg1HUn_cGHOr17!k$X_EzyGGFqOzEyn#W2GZuRpI2==wNF*h+2Oq{cL!Myo%XU+4* zgXvp0Iaz_jwUJkpaAlEPK3h#qT@e-_w-d!jit!_Q#lr+xte1aEnTp1-W;bb!9hX3_7*ULI+oA{ zLWuz9Q&jjW;3S3`2Ubjn;={$F!#YQbV|~|e+T!n^35zHRp%SopwcD~IFe2}$_%OS; zIAzWQ=dail6d1VC-W1XrT>$}`eT+vajXH{@s>XwuUwELX zumCSqEGWtk-LyF<&_NY;^dgLnbntAq?%9=CR6rE63yQKMcI{m&fcXw@Fr1`{>CIiS zc;V7@fm;IBuP`8y$oc|v*jc9vNW7maL@Ep=&^tBi@S!|BpOtqgGi1w_9WLq^B@UyL zD3ry!LicBh@|k%BiD99BdQ=iA7E=L1rpuNuS>mxdV6)FsSh_$i0dPo)0RNX*1sD<| zzr%S%j$(Fh%C_Jg{u5zkz(~>XgJU#?bLjp=Xk_K)#72a`(h6_)cua{oX2pu7E)Yjv z3sqsQH?Ty2RI)$>VhI>oT!jYd9c_65k;Oikl@+&rTj(MNJeq(3#=u-hhz`QlgE?t& zq01mgO~f=vnBsz!E1cGE+PG#mz%(pFgxr{$fzU(&iOUu7L?D;oGgK8}gEu|<;6Xf- zaqwXD&YjzY7%2tg(H8AZ$T*mpc_1q>CK!^{6ikgi*}=il$8Uq{bcipmvAMaKu8M}4 z7@!VABX;7F{>t?W}7395s5O0S#$!%j*H%IF_YcucIw3>hxQ)Tr738SBFDpur}K z5aUq?qO28gOo60iVr6Bj6oaXOXJ&eOInOq>oVv(;3QQ%Yo|);tkg+&$xrm2@0uBjw ztHC0WAB9J!3NU~I#F!x;LCjYCpIwL&MeWZZY#~X;6wCmU9%D+2#sEN3T;{cA(e#Bb zYu7I4!%D0s`Y9i`Oq9!4QRcx=Gw19Rp^_kxV?8QeO;;!s2!)0ai~tB6ihx>RO59>P zj?t9`Rs#5^9E|};tF*>*^(t34m(?zYpqQm+3iuX+TX74LrDc*lX81}<=oO$56cru; zNlW@>b+kOF>4FR^D}9hpC9ld4g{HU^X9mdUS|a(DJg}aO>2CCJTIKBQ;sQH7GNx)Y z3Ra2C$pBWRzyPT5cuI;WqMX7aLPPh2#UxnErE@LDf((R1QOvd<*t0im@BRb6EF4x9 zL&Az=M2o?cSaUbHIjnMYT(v?MRxFmT2``E2SB!OHSiOFS=Af6RzTaN5SDaN+6=(f$9RTvP!oAX1ZWwOtIFfT;)0p_?%lp)`}W=0n-$O-N*-tc zY|TzRv~7Dx$o6gF*khUpf}_khuB?Btnp=$P_or=B(gy0jDEjvx2s63E1Ml zIV;DS4d^zNLMBsaVA;&t6T$ugTebuQZVB3uSS!+o5u%XcElYt>QLqnmS+Hcu(q&U& zSAi)2f+3Q_qzF95&2nLJfsg?5&ej0jpWz#nRpDx(gx+;52!D%dm8Xdf0hhWm}Y3h!(=7Be}RD_6AA!$W_cU~MYL4tyZUeT^YdLF7++K3 zH(6k;r*CQHTG&;NuiHrY>1|r)v2L?>P)Kw9f7{i^JmSSKX2Z2Bl$|D zN&t{Hin5A~$-q-Q#F@{gL9i*#+pxjgXRVLV8V|n^JRvb^lZTg=kB_%ETymW|*L|J$ zdbfqMXU zlmIju#Uu$sk`Y8P4w8)vI9x?2RFN>%`5sah?&?dVkUDIP@!hdvYn(0?xT{qTDm_$z`x+(0uF`CVW9UKW3I=VHSRHP%I+?+ zr`j%c@o-&iJ!8faSEt$52{yPb#d@4B+(rf&e?fohr zi(HglS1-4jK7F3UGU(ilCCg@6+r-RZPKV!ZrcV)Sp)Qg+nh0teg%go1!ssxEtVjnf z3M}JA_RcQO;#Eq{tL9oyn>J&{G;8bWHq)nBPm8f8rcHHoS*Vdk6#%k1nO>>V8DOh#g+5>v3LF;h6xrcD}aWg=fv zFq$&)6Pg;uS&=ozII2tvhJILwXl1I&BEzDqprQeA z$*2)%+)+4@3=K;-d^RK$@H|7ycnmx+ZN{uQ(-J1)lXw%ygJLZu8fql7`2Zat1Ph^U zqYlLlO5{UJ5y6tKVJsvj&?ZhCKYqga*a`IUa417xodZo&Do0iQU(fzEuw+96ZV9k# z*$kRoIYw62w-8#59XEc$1o1e=*s)fYCi)u6kaN+=bgqi33c`DEFaTggG#aS?IP?JH z7H|kfCYuG{K&eHPTOqiDuB57CXo8YvNTiGn^)!{(Xm^BGaWaj`Q&NJg4>m%upChUN zg!@Ki68ab`3nZ$rfuRc$nJgxQ$z;$O3N)0O5hMdNZ(xCD{C&3lOV(PzTkr)h| zPRNB(DDbYqVZ(xxXk-eNN~7TlnshK8Nrk>cdI~<}^HmX-`Cs@c8~Sa??R?8nW$+YJ zVV4rg>x!u8)#T4-_p5@ z=_n}6?Nx%2hoNG!Mu&<4{ROMVP<@C6p(JE1PRGEbWN-m4_W=(@00aQ+w?%S$`M~ei z);8o@VJ$LVrwK!asmx7}Zx4I>rPU3M@r57~nc8mjj6; zu1rNy&KCigGb&0=TT{(S#o)@1KV`>cU;cbG4WlWkakq6E&z z<*3IfiiNzSuC1vH$F)BG{{6SlKYja~M=WWOW++IQLK&$6%2J1}Jyw;56~@z1Td{2>)Jbpi$(jvc6LsTg1_&txyp zBfbp>m4M&=D*N`e3r=Yblt@VuNegh}`v-auBknsPV|`MRnK~N5cFeH+r{sluIt3}EI zqWob02-M#@Zrtu2I3Z<82BZT`CgTh121d?EIRgXI!QKmh%KHB78Xg)blPUrtf4+Ss zOJ(DUuED`G!0#Uz>3S#oZD{yXrIg)&z5`dqm>PIn?_i6RJs`PwvH#C+z2`6V50oRa z{<$n2jEXUr7xsZxNu!h|89IONcPTzlDOHvX_SKp|0*-OU2Q&dgUm|G$ONWOf{R0;z zaD&o-w8sMWMX<1II2XXFxPb;K9onV6{pTgsQstq3dq^E=bQ%?#?AI;@Z`Ml{1_vbF zebW9aDPMBFD<0qzAoVbz3}Jr?1lOa2g0!o*_)F8rQ~)3g~TAuEa)AokZOU5Q+4$q1Zo7xTR&|8BMwMS2Zl~N0Rr$3hSB4O zBjr8!leNi;*qkH1gXL0f5K?=puCBfTq#!Z!K?PgD>1k36$&eHXUNlT;Vv!?^{HMX=c7sMo37zaZl8E#qwtf&9NTT=Rbv9!Fr z=KQNzIuqmA!5N_AFwRnGIY9E&HK^O*KnMo#Ac}MO>;XGtrOLzg9ss`oCy_~Yl*m+4 zb?289J{alR1t(V|N2SIf@kBYm{QvGc3NVN-7+dIiFSs&V${cFn1yk!E{3ibQdu0_> zCACi;?Promygi-6{R2m(HXyMKv05stLFOsccNBBTOu3yX=HR#zR4WJila(Oi=3V<6 z^+_2~pQ?`6y}Ij)AgQ!2sD(PE&bQ4OK41 zIRBk9b)vGO>d3%{GiD^1L=ERfQqs`iA?YNLeDoN|E(I?GBMZU-M32V)XgGkIyI~RS zaE1j#|9@suRaTuSx%g-9IEa4F4g$`6wVWN0E2 z?}QNU>Goz*sQ-;$r3L&da7yXP+ux#@;I|#pfx*6!ki?DRYr!B(-#xddjw|{W1w19I}3S7prmbbrcgLybJ2Tq)I*|@_Boh#J` z*#!kf$oOL=P_jV-3lW1ROFdc|@G~4_eBClwjs6=Gi~PsAV|b-Xd1=@0ZMFa{d9@5k z@=Z7e7bF8Ya^d;;1%+Vyk)z1@KfMpW0q-|7;?0U@&U7}o!qWafu(Py)omEnCqP+CT z;Fl9)m>ADpGO$M#i@(wj;>UvRd3lEl3XuXdyl8Ys1OBh|qq(I%&II~A%Gu)l2WRUu z{-@SY($=1(^_(19Xwavnw*cW6X1kS(}BfV#(ZH-^{=KaZrtIw{S{%FfBnKU7cv9e@!=@m~gE2I3+9Po1t$(gU%Xo8(Nd;9FmR{fp^E9OV@sef%~TfPdH>kuaC4!5q2h%*=yXV0#`&FFbs> z_$V^ItPGq3%i_tC^+nF$bVUDp_crmJ##=e{>)elD-+q0F|Bd=3DrV%J`SQ?|Lcw5< zN9BhPO9ry!;hvEJ^0RV~`+pAa(GsB6$=zR5)gT6tOey-;4=>?l`5XK->CKzy*XnOx z|Jr!!)62JSUjF%D7_Ps5{pLLo!idB4!o&I3K9nMy5>m5GgZ-dH2<}Nu%Q%pkiMjz! zk`Hn*ic;jG%F3E!ez4ZsJpgg|D+=O?#l7OZ{^jLcIL8hrmS4Sj1=snnU%nYAJXBa% zR8W*v{`%PxKrvyF%D=P@WbQBi(sFOb7EPrQ8#Rp2xkQAodvkf-Gl`(SCXU_GWpG=n$_kty}iM7KQ23|%(bJ(j+d5~6*)o=9AEwN{OQvt&qnEFFP_Ff!=8$s;ZKQYw5LyB-mlBV z^HlP43)0J8yxXXVDd_|3U_0192-(PFke`^8oRX53egG*zu_X6X5iCV8+?87mXyi$S z@1Hz+{P6L^r!RnJ_VjuBBMeU0QJ*~OKqNDz?5ytZ=jUM)+!iQc1{K}sL99B6O-M+B zauN6+EQcVK&jGwh8)EeMk!tkb_{lnZ`0&}oMM`ORUp&ZuNPG0)=}>Mak)xcQn|AE+ z=SY?}0v&nOO%57Gl0R5cY?%r(iT@&WjtjZr;3g z{n<}$+N0~Y5^j=j-MtlmlY0AhcX~RJp`4zXl6%?9ETQa>4+S$ThI7IPq-Nj{ktjMQ zHa0#H+yaA$!X$4AW)yNbzaY<79m5=2pIjrZvv1wXkn_|o-M<3-G=*!|Ze71|?OH7S zc55geXwPAIgbq6U>KhU%nQ5m44;gwf?qCH?9D2?b?-_7fO;usr;0*OqXfmY@)u5 zNyBV9hG2)5F3;>EqX5&Q}fKui5~}~{)`7BS1w(;eBmC@*sk3W z2~Xa>csb@0^YX>(H$nxy@;_)7uZ>hCB;hH1D0(KW+?ad-uR3i{!>no`Ng3@2oKTCx zMItdGWuXvCPRUpXGtFR2);1H2WL{UqEp5col!{`p*B3(zv49{He9}*AXgVdqc#Mn4-JTD<0f-|bInM1** z*2C&Nsw6b@ry87y#$$A#N2#!%L5c7U_edp&bQP=={n{^di~H!^u!%i;KqQWhRusqW zuIOIK!Sr$=-5r&`Yj@~gc_&7P1ym$1L_I*|Ded@fNe|IY>1%B56?Nl1(cQXTJ?Dnn zfgo3~NU><7s~2_-UH$bnU6QUG0*8{XA`!FuNY@SnOed~u05qUPcIVFBd-jHg;Sr>L zkvOgdL!Yn!JcNKypv(21Bf4nk&OvT}E~$%iuKTRC)mELjSu|(k>3*V%d9JrEyFzj< zACHO!6imD~``jTRrXA5Sm;w7csWc>H*DksAaNvZ=M>}=_EJDU|_FPS0TW1H}iOGMG z5QDD0uU>mjbEl+i^MSrLpwD%7wjWGxIae69ACHM*M-pN29i3A#4gcn$40#M~581I} z=PqP@7@XeZL*T|NfHm0(KIKSZX_vwqbRJP zvnVnGQQ*SyGgoaf6_-=Pqe8a^L&*@Njygpd>=w_5HNvj|G3y$;np@+~h+3o1Fk9N1 z`tlaUcekFw+prem46C)Jqbxk8`e;SR|H=Gy5k?M>0my09&6Mtiho*r~Ok-CEO``tFpCRcD&uQgkz`v7?#@ z%`Dg-8W9#7!4BWm@Om-EHYvH-4=Nbo?=68_w+3&+cW5B5>^62g z-B#BqZs0c7H=Jo}hMj$DTQh9U@dj4Y>9(}cX1Lxk+TK!~6edmy4~GxV2@Au+i7-}3 z?XN2_CcWr#A1E>eMNmsbnqUB+KYL*S_U*F=>i^H55krn*zHrwvb?Zm$)4xH#K6t=YUcA{1;54c)spxcZ$pWMf%Z`v%kG zlWVj8mcT%8n_LefxP^zUf};wvGTIt)%vLnj)e@()YELy(CHvVgm@{YI68BwMH4Ud= zPhMMFa-=TylyPlsV_jM7YN#~`t;X3p`iF*t^MNY2wes~2sI_NYMw(EdZrbc05CEz` z7sM2b*}Wc`7&axT`Q({U^VsIMDD*fwI;~peuzX{7bv0f^sjjZ7imqf0(&S5K=Y)lx^7P>jym>RR>|cW7kf96O632tFf%A z>d4ytH76j+J{GuaC1`PWCRQ_CS35iSWRzC|r_QvzvNY7$!FBagYp9q_pKfhEZQ@j~ z9Xms|hxi|R6mJN6;Psj&M^)Bu*tiiXf~W`#LZh`aWE)^I=~Gv1*}gT{ujqCR=!%AvJ54$V zbfK#2`i;K6en=Y%jP1dD#)B^Js^VjiwH`ZqQJP0T=#q(4;-FnM^cUF+=) z>xB1^lcW*ojnt7@n4^RWi!yU5{A0^0I^Ay>qG2P7y_Sl>*Wyw zu^6<~38-NU(hCmdlG&X<^#7i|5Um@8!Q~UG4=pNPSa>&i2BaRSI|;!q0%t3i`mCKI@>!5AO8e65wTu zVUzb4=H=kItem{GE%50n4r&-B9_oga`N1J!2l9wqW=?)wNXR-J*g3{RsY%Od!Qut; zT>SjjHbI_iV#&FoNCpJfv#XLyt4E&21sKXF0S-ik;qwl($9vfifG0v3Yp7zc&jm_ueNOG*aL#v!!R=dKqfr+_xtq+$c0Txu~sjE9oTu+z@5SV_BMifkK zV|p4&c9Zas@Cg_crOnAu6=k9lEM0+0qAnrgQenpypR@@+V~VQ4fCeZ`1HXpA41v0_ z*v`?*c~3#GE*!ZLsDmq3G;DuiHTfI`vWiDK9y=y3Uc8b{Ve{1V;OwnXU!4b)2DyI5R3}$Y zdvT5-3R~al(a|x{ z;(gooAvpvYG?t34r7~5Gs%&YX!lGfz4v1qQ@r_!jK;vncm??1BG&oJjV?aF|`l~R} z$=%I8F@+855xi^7V;j%>gpUy-jY>(dJ+>Fwg~J;aUUVqX(HqFqXO#dBr+JFwU`K_E zqjni0-;<~eo{pvI+SJkm8>}o1xr&(00V0|pQufcJF*QsqCx;zA95&g~RGm$O&V%yF ztJk=>Z}rAB$C&{-NM2K22N|3kx|f$s01}5)!#>(BR33XUn@1`4Uh`pbFu=u;INCVw zlaD)@#!@x2aBlk|`#i8}f(2>kP{>E{oavy zyannunWm^VMnCWM*U#TR70t2GRK{#FBO>=jq(s_MIVJ+PXEHb({nTrmAs?I$sudTx zyDhMu>)`1Llx+%i+v$^#-NE4v)N_RKB9ywf*FMgU3aXt};Vv7%>0V9(;9brRiwc7? z9Q!k-j4I}7j-Ajg`}XDg*Q={dbd<5V*^u3aC5RVMl?}&dyho?9-)BrQP(wTrV1>J^ zadvcZUFGa*0fTRwR96G|AOPejS;kxG@)A>bw|%@FAB{FdJDTjSGvP^%!2Nir_nv*p z8-RfgJ9Dn)IIH#_-@g9%^MbR9E{EovwFmf=;`miGC8G&RZ+?9J`r~!#WW%3&wb!{p z>^eHRIA{W4CAb{0XL;=hP=9$%1rGy}cdE+nn*$0c(~6{Ks|J8@hY<&b^}O zDWI23y-~ z|K^91J61PJ{AyFB9PM4FviHyEv^jF4E9{myyXsOf zwsS6Ii|7nDczCpsSb#_WFY#V~N28CvZDbdyS$C~PDn^+mB@fe7BY3}K^V(E&-E^BRIxiO3ZTpHkJ zgqNd2ncTHd%7FqD=+gtQ!kW2A9b$EH$kw2stpQO(U@NQZ;s$EEDm*fC@8SIc zfm?%s%$a$32~AN&9oOgRX{vIWRCrF)ar25L_);S;2NZ>y^Nz_Y81j-=Rn=$(5mhi+ zTI@6JEJ2;4F_>lI5#k@XC2&(}`aeL9@`?s3_JFd<_V$hr^C1_) zW^LKB*&leA8JX6=TvhvBt5IDB+w7F!1ubiDnc8h5Uhzzh61$FR|c$_yJ+D& zXP+6cyE9!9BYm_)?90i|8I{I46aua&bjm#gO6$5uu8p=pZvl z(bup5NV61qqCizJydlu@aFvrYx3;yhPP1aNvDR0Vm)9^c0PIvj&p<^^F-t*GUPemWYOm=Q2tj&X zY<4ExJRMM zB?Ac_g#6k@o7nt-;IHuHKoWD_Bf^Witd zH4RLlxgxcxshNd=yp*(bstk#=bec?xw2X|jjH0QZ{chl#Njc5p37K-DQjt$o6G~xd zkU{=Y=~`iE3UhN~na%J#Mo-Qrt^{#sVq$7)Y^;(cg^^B|5|Ne^moapAm8B;mA&31k z7J9>>94yN7BZq)L2);(zB9wqpfiR;fqE-$<{JcE<-$_t>vQ8XA86T6^@6mF~nAzGu z$)~6Hp1_dssMt6#hV&1VXD5mi#J~h;v=UcMYG7_rY8Gf}Vr*onr=z6_)VUG_wv3Df zxQvq)?h=qe5(?TaJ9Y_6NJ)tBb28FUQ^0d1{4Euepo)g3u7Rvu3 zxCFHLX>cMyOcBm8;^t6Zb)eGK%(BRAhbc@9)jDdb13|98^C2<1C|N) z2AGeike~n`?~d)9+t^rHpt&(T_ojd^Q%Q6P!9qbz%fQUa&bgh34;chJTvb!Y(8S!@ z-pSp2Pe5p7%zkV#tQtBqvj{sCC~&3a`STx)tW7Pz;4Tvs7@AO3i{>RIE-C{4x5S1GBXBk~sLr4052c8fyjD5|Jy1JZ6`>)`C}vo|m_A_nEX zlQuRP!d{SHSbQMkMa-h2laZxqzL@}V(I6NhL?B@+1i4^CMi1%QS<4Y(Bgczkf^9QtRCzl>RLJm zM#Qjmhp-F|jU-4O@$m%Ni5N1Oxmks&RV^R>}#&%n^c6dp%y9h_X;Js_V;$gc*6p|mkU8;Jwm0;xsGsTt`d$;nTDuB}(E zuYGy%Af#<+XKsOma{*^gYGwurjTBRy@g~?<43J?x-4s2XE>4e2SKq)Go+seO9iFz~ zu3{s*if&{B0&&3(@CE-$W8Tmn_fGfZK2F>|Cug?xm=xbWSmTuNW zFjQ#9PJEU`c|TO!4!2#9i}rz}w?8gG1fB|zMggt@Wd}w~NJ>tPkNeOPvJTx0QA5LT z-`Ce(j_O#On46!4O9kBGTiX(|P%bVww_T8gf*c|-uZej2s(f?iyd(8KV@^4t<`p$$*6u!sZ3 zp$AX3ur#;u{RjG0+BF#G=hF1b(#o@?wnfV2CH&&z!a~m?^~$rwmD!cGpV0b>dTnuL z^~EZFe!dk?F?;*Y%ED|fo^>9-^kQXx5gt$1SMRMa&nzzE=N1-P!2UeGC+0YC8}mJQ zmIe5&rN#LLcy+@3vow%&j~s*@~gzC?1<$?8VbAK>tgF7rd!ralRW*0fVi~d`($6hG(8%oE-#?8LEQhV~6Kwm*DVD zqeEU@UYJ{erpw3hj0^ZFBqG3F7l(V-^Vx-kGhlyybqPNUOvh3D7HAv1H0uDDRs!v; z9QkkoynhByxwtStGl!q+03*wj2e$+5EJC229d4{F&!53lEiU4xr{`v8ar1}qEb~h< zSA{lc=S`GUAtxU_g#)1hcTGK+o|&1Qn?HhQS;Wu6BO(uxcBZ8eJ2KJbrOuvL2GL|015R5Qt}1+rinTB6O&~jJpPX7cMwsU4z5CE{ z2)akpZX7op`22hso^Juadcz-4&-(u~Q~ZZ|-bA8vVrJY3%A7L32B zXA(#(SoO~>&L1Mo?arNHI5L>ueHe{!WD{^;)3{mKk8<#$3;5*`7wZ2Od*0+eGP^Y2 zhNpz%yLJ1{ZQNbVDDEE9eOPz!+2akL!69bh*%$CDclSaq_kV*ulQ1}p&%@5g3qwLh z!tFbE2p+r-E<_74J~=TtHI2e>c0Lo&v~tTAZg>B|o_|9B#{V08_I$DmTT?Tv8jLuE z7-Tf}5pd;izC@=G^5uLge$&!}G&slpFYuY=ckmg*lrg?Kw*coGITQK7>K%7e^m2&Q}w>-G2plbsG|)2quPy?*JJ^@c9E2#*cAN=%#0; z0_e&AN91!Vx{5u;)hy309Kh3qCCGULnvJx(K^#bT8>b0G3WOgTesXg5QL7-h{J$rk zb&t+3Pd(B09iLk~0NwrZcwl7c2&Dxu`VhDW`h8Im{WJCe_lO>iK5PqD!T$;Q95A{# ze|-1mF1Y+v5!`YSdQ7oF!k#FW5KwzUn4>tyJ)nE^@X3e|G_v>~lFv*&_=R*fO!cd| zMdI+l-1G?$N?xE}7aaaS2GEuSfjLqm1pCkbjC>};?CyH*iNPdJ;x~@|Jn%OHkOK$r z1MY+t7sVzDO>oftvHMT@_2~aU$Y)0DYryTv9Dh2$P>B}-*CQ?I0@NZ9W&kBezgB=4 z{P)N1q=Vo8$K*4k&n^@J@HT-;v{mAX)cr-m_{8ubR6D>56Ssu6otO>sIsYB&+i%Y! z_B{LoO)f(xzx{?jGd2>@XEFl%?9smfgVVy`XE(Hoi?~bMQOOZ3Fw#QNse5~Pc&yhG zPC@mR&#zv;%6rX^&}Z8LBKq9^Ti46RrpCtK;b+!t*b^%Vfz#cM>)AytFY4P^00@8L z={0<7tO{zF0Dk`P?Bzf3Gs8>N4U+&rf1SJg;w3=QWC(u7)l)arHPk%%@QZ%l2RE%1 zgjqmxoLKsUyTD2G6Ra~qR)p8N3}1=`7S3$`^}p!n?B{e(p8-=%grA=g;pbNXKSR>0 zuA%ZD_}S_D++qc~|HA{DM5sD}DxQlMFW@dw5`*bFZjk=w&}hMq{|bIiStUW8GdI}h zlp4l^wZ#BGBee-KB_jEFn1L*ePf$)kDFVR;v=dap1Y!|kIj#*2p7($WSVAw&#U;2K zCiK!=T}lV|83+HSE|V<5f4G*Go&y051b$6*UC{;s&CNuK(OiVfav5PUPITc;QbQgb zvpbNwJ}nTKtS)jJhcqNqGJbv z0v$eaV8Xd@5sKcBgRb|Fm_jW7BB1drcp#vm?*P4q}L}7ratYM<{l>cBx$qL-~txqI}p%Jm0fwwT0TIP44E8W>9Is?~Aa1l@m1 zKyy5qx>^i;eQ9Y)c|p|%0!@w)J_E1NE5!@IVG|Vw$j75{91z;hp6PSI2;~f1xO^cV zXd#P>{}F+nLkKhl5rNJer+EBmYPh;ErG%xpw5U8^!Mu`yKr_WYUV&SUV#56kC_o@$ zfOAl}5;*6~nLZ~B#^q%1w*1_MnA4D?8AUSVnxQ*pVi zTv`>8f!2Ps1h+`VgjL;86$phnxGp{jn_g!OIaOHC`NK-UKtn4}#6aJh+hCxfmFGVU z^w5*hvGn_tWA`2rdwCKeXy1Y|T*qm1N{sY1{QLrOfk9tF>3)J<2P+M8=>aPk!Su7) zq8L*7?iuLp2@v#vCqU4sv*-Q$_tHl)?ciISZX;Fc?uMVJgg)x<@zfK<7`yKo5@MZj;>_7`j8~ z{CV@iE$IBoePR5@om=U*Dem04n3o9*G$sd^MVp)4jTmUvn{ba=OgMoXAyZFK0gwcU zG{DX?$OwU6pf@=C2;NG0V}pT)54VSJ-bjZ+<(osqR-i{l;oIniV>fTy?k`HuOv_?G zs7UVquFKm=FoKsLzKZcX!DmpngOnJe6oYiRj?>5tVuCPik(ckL4w9qJptn*6Nv>bd z8l=5`>t^kCDlxh}mqxFp4pIa2bmInU44Roim!2JS3}Mi`$KZ{W#ptmMUsng6=!g>` z#PP9XC+%Q#7#sBoy?WzUpU~86FnY!{uB)g~XabRg-e?qh^~HAUkcpc0ce`|lnVervv~}yz-f#;ao_;%AT?Ao z5e^wTax=6YvxPy41a!~U-VFkpo=8CFT)S}o;-$U|h=4wSxjiAHqd7StDGN&*AK$Z} ziDA;Z1h-N}gcw1(2B8cNjf{f7^_UF|Odz03&LaYP2W;2C&j7%KE|rKi=sAD-T7ggJ zMfCApZ|b?tXD@Z2KBGx-iSgLP#DtVYx`c#i1VYmb_dcHkOX&JSD9J)<5~x17MkcV; z?g9XX>7nbe@`1FGK{aE0j$Ha9l4wC-gjV$hnL4G4p#@9AkP!tRTVNw4ngJ$n*& ziV8rP4GfwAVbG~gHdbbqPJS_o`(sk#=nw_{#sl`_!>?z+2ujnGp&B9NIwY&&>UT9X zHHAP?%mxL0?li)kPj;O=+nMKMs-dc;uICU{c>-FUc2S%}81%{XE*AI+0thWG0 zu9Ho1rkeUDIP=Y>h6avFbtg~4E_wXe(G%&%*-jik0WfrsnW6-=sF9Tx7glqRh>ea$ zF!Yh9`&mgbwNHP!57j>rl|K}698eNgmj?X_cjI~hh7Pc(JK53M(b-kEN7DekwQV!d z3Z@2Lz(T{z20D*-q<69b(9njpHa6Fm1t}Ah9%(TdtH|gm+&-GXL(7PTu7VrwBEpR} zlI;kp6e6B3tpuKFKYR$`&_~;kw1t~k*Z_5%Vn;*BDLdG@BOJP&{77qpqaDr(V~SHEg{*ms z0+Y0gZ$v~`_}-?u%pJeXNP-z8=pikVAXcME)l}80Lge_KY;A*WxUIFdy}j7M)ZPZv zZx?r*Cyke<8{n1>fd`MaX0*|?9&Sx@advZY@wCHfk|ViC8K=l7V;mF_9J;4rIvs3P zz};mLUIT1__65Q?K~F`(US-w6$`(y{X!Gc70_?iAwWaw`ON_NGfOT%}CaN+LQu6BN z-oEbcE^)Q(&1o$x&CPA4zOEjgzAgqbJ9&5oM3pqva4L-Q%C4ayA-;8wv2cr1hDUJ$ zIZ^ztsykdUBd`llUwNRS$qa22?F~(7joX^by=+{Z+&!!%Iq47{v6)NKG5}DF4EUyC zQv(puu08?Yx_nzv-!gJ~w%uxQS|}@;1%w9p)ILH)bk*V%ZoYt!&LC=FgrYEXgNAhI z8c(?GvuLQVPp#u@sK+@wx_WvV!f$~niT;CO*YgSRimGf(ucK+m-m^E@j(|hsfb!i+ zxm{5k1WtY55Pz?lhyDy?nA&A{kKSAXAuodj(v5;b@MRe+T;+jK=vb{&Qnx`vSBJZ} zd3!^9X95ikm$%LGz9GRGbp#r^t}H4j)Q%qjNzfHJLF(gB(bZ7bat-tY8rqSZ64SIg zF*`FmKR2ICFb66r7(`g>h87MRNwPdCMmA}KhCW#0@8KO_1_V$Rh8oaK&ET-OG9nJ0 z85ZUauQJ%cp|y3jH0}26@u<413juayWnyL{Ih9TDVLFJGMA03YLSa%?T3|>DICMP_ z&$LxJdwl}j#gL@?i-x8$4~x#MN~xf!sz{Cq_y>m;0)^AU+t>5JbrpE?%?bSDsj1mH zLVg@lc4%V6KnowEnhIDws7g%r+Y_qs4-f4ai-o@~hgdA@a~_`g(|mK6p+B!=Qe4?(yWqk^Fz`cS*92!HKLc)q6*9=W5C@m=|F3ZCD{YM&F($K)v!`<&7(9m0)dmoRF z9tuvrKRX3WHJ3q1F{I#-Im7{EL4hK{hlLdZ@YuO4d4q;d3X3oY$SxJb0X_SmyAnAF zq9i07t{K_I2#C&#)CTn*M@|XfAcs{W0@23CrtZ#RHIT+<@hnKRu@Mk&8k-^H;b&2@ zQW)k5!fXnGnIJ46vRznM7AXa<7W649Mt{spj);>$Kr}fi1qBrij*bm+&m`n}NdzD| zC);NOh=xW~G?f1WqV-J7-E3p)!niP00+K+DVeCerHWa17k%*Ck=K?N+1s3D?K}8bEj)@lTt+bL8`*mRLg!9N2Y@Fz6&Fufa#9Lf zRzXpxOYka!XFm6hxCI1u|HIzwy=D zkF`&&y22bx7^SkrWNczSR+(%wzqtGA`j55s6>n)imQ4^VzffomOIH_5K%ptqM(>P5 zQW=>hWZcoB&rHu|V>OU`PS{s6GIIB8q7Jn2xcJ0`1Z=Sk(Jljrq}1qGIVn2i%=|J{Z&KEU-W*We$&SntL1-&Gd!Xre!&OPY_1suYMh*xxDCg1ffIu?{h*~}V0pFRh zmEOrhM4;8(5dsbE>Jb8M*fETLj`C!>Nh zN6I3$ILSg*bjKzDpkq+AYDiv+1SN}rq|Dx&+`Y1rd~9?eTmk^?fdFVj8~g2K7zUrS zHwSS;%)bN{5CI{Y#*l980e_}r+PVW?qrQWciF8v;9Tt_y1&8>T)f-UIv$FH-+{wei z$^h#J__GB8f93)FnGD032xUO1oe?oj4{7KPISmw~a_kmZz$8=_!0!?n5EKx+x1b2h zg>e)N2r&X6hY{%K>f*hD0k}YcAiwx}L_aeyv9O@6A1-_tMgvbveSJe6Cu?44Htc-v z>Sf#j4M7tiB)#w8hA9cc<=BG?tQqV!fxKW#Eief1=DmB0OXUB>KGOpapbC|dfQ&%> zpI?Ai*0E%`iV>O!Zotp}*4hSoTDG1_u)m9(IFGwb1<3(|eucY1OVGv$`osOPDlBVq ziWXe0Sqy@}%wC_s;#ONhxI=*3Mc4!cfPKb#?)8OwJot}~Z%KC!f}gjNvT@snIqK+W zYnlWj_?gn{+$EGZ#`QB3%peDXOoki?0aA(GnV6i26^Hq3x83UtuSW0$__@JbdN&Wi z&%(9`FC4;pc&GS?`?@>2?{Nz#JDF-GK!l%#oT7e%pUE~mUF?MidP1UoU;uZO9%b}V z_!IT4YU~c2#TMAFckT7^_VDs_^^B`IbG$q;G%D|K&)Mb}XSY-@4R0$ecOOqTA3&eu z_Sl=4ItA^IbT`yc)l$=sv_M_YEjxQI5IZsTAz6j!I4H#@#{5V%c2i=UHk=sb3Z6hd z+j}}Ygrt`@9_c*M(Nvoi=nin^YqqqC!>o`$ljhPu2_pdI2)q%)7>y2(+d0&?!m8#>PK zD^!h@OiD=cMenp@Hgt1!0`%G0$<7)cF>Os$4eXs=oSmFq?R6Bj>|C8~5%>(nwkZnY zipoGf%NqE3z;hVsrpV)vDMva8Os5wF1VV`o=s5(r5d^_oHCXzj7(4WaH5M&LCn&JO z+0!`KJ3!Tqp@N3FJ>LDT}Ho$y@BT1at+%>DP3I*dvUX zG6#`jLp~TlCLjQA)?(>!@#YBi1@hV6-Y&zI+1?t+XMJl28(koub!{!x^E>l|tpcJU$vGC_|bsA;v>&56m;YBb`6jvxUtePST-+Msf-a-3KBm(uL5{)}w(Fbm0w>@ID_2Ekn~3V9_Wo3>BnhrKMA3Nn~Ww zWK(5!Ny{pm`Z)+wLIDS#Z{y)3kYVT`wDcnQ1ErZz)PQ_R1!nt2=ZE^?M>V#3Cvm zP^Uwz4uWQ9XdOXoYQVAsJR9f1k8Toye3k<8SxsBd&_q{GJXexkN>WrrLdVSuq0g{v z3aPbit*G#!9e0G2&_V8BGSG&rHzdnO>{b{y-d_`HMIkcSd4#2HyYy&-_i_pajl&gRB(YxFaPX~2aOi~J# zG{Rmmg@g`6&dMt!1}Lu>kk2?VQedEQ!fGOt%KBDzX4=vO_?bdBsEClYgd{G}1fg^Z zDntlnFT}+puI8mnz%w2MpCrV`K}Udn(V=!q(3lFMo0Mt0fRKm;P6{WXBPj(9lT|de z^^EnEpzjBIg59DW1kYThQRBih8O`cLkvfPq(zMLi+vYUu*nrzzr;i^5)~O1 z9Owr<$K5;}Rk_gvDm<%DF>TuolqV3@z+Y-{bgFj~TF8#ph$mj%YN=9}; zNkw&S15~0A^3q39t2}g4bs_l-ZE@!=T)eO^30I2cOib7x6B!;7=#LCJJK9-Wni?7D zi!i|z1d~EyLP^WYEg&K(4e&D;6Tr{p1o)YjUCzeA$<@o(KPW6JHZeIZ2MpHKH$xsA z!U`kVk15^_2g0VQ=!JtI>~Tga;TB04x8m!4f%dZ4xuRlg9{3+9H- zkkhAe-IRU3=b7O-u@K7xZ6YGWg8bp7KQ0agQ@UDe%1{XbIZb|EPNq#{dB~$U5^-`m zHXZ?CaTy?=we*b5tpTtGNH;PzF(o6fsJyzN1+@i)vjxs_WCwSO=FFMib0PESpg!Vh)KK86^!P>$V*`1%yPU z=<2m6Ff3|+Qfd}*VIzbGl3fTp3UM1ed+yY;FYsE6LaadI{^(ybf`zg$ zHq-;(DFAXUvRhy$Hy6ABiGhZK9EairN1~0INHemsb8+w7B_syavzn%^5wuircK7uU z4v$Gdi&k1y2N8+i`nsBGDvHRH zV!{Ak15nP%nF6m2)ZyCB&C9n7RRW-%-w2KeXF9t9j32rWc{8`D;sA8Uku!PfkUqond0Ne~g|9dB>)v<;;N;AYL11p@SC#`Q_U}ORn5SEZ1b#etuK>S0E zL3~n5W=>vF8JyrK-%iwRz^SOJ4R?eQx_z8%UJtr=`TqL*ynO{}I9y^L7L%BUWhI!5 z-WM4GcgcYPd-wQydwIIUJp_rfbDEP8DmO=U_3*N%pisbj9SGx< zhYNB0;2Ap?OOlwFfyE`}V9DU=5u2ZAfNDJ8IR|AFQA!aqLnz7pE1?c8-B5GDe~Dae z?QKns>qi3D;SIy<@Xy-X`j7Whk;#ckJ#c|TkHNS!2|~V$SPy{m<;1a&@Nn>8H9>rW z$ZBqBTK%;C{64~;qZC7eFc?kP9nlpG_DF%a%QN`7Kkzj_KYCCLo(Kp#HZl*X4N_k0 zApY%_uV23YuYZAwkI%+hHBf$sU>xq(7`%F)um91n?|1V=01ZZ-hvK?~1z1;D+duXN z#=dt#A`%|uA)kQzfD#se_Up&m&(qN21CnagG4FtH|I=STq0f2GZgOa=<2VK9)Sq-d zVX8lWtgn5ogcsawJ4M)${`CA|#y{34;hpa8PyYPmHzxb@>k$T)u78_(IEpzVt4IG% z`)?`_tp4$p|IOg%TQ}bQ_QyZ|@!QP&mp^XwH-q0-Ua$T3$3OmY?bX|Vul?6={@VZJ ztNxF{wZH!V8-M?V!yo_jH~#+ae}6paelz$t{{F__Z{hIAKmLuszw!6SgYGwjf8+0O z{QVXVfBfU$`1>1we>~`ZGx#_D{>I;L;qb>l{*AxC@%P7r?l*&f?{NvyF z`x}3MJm`Ki_&5Ik#@}z@@W(&?jlaL~_s4_oH-mrU?{ED577l;>Or{rV>W*IrM5{^w7B{?qrBt8f3j)qgC0ohtpe)*pQuG#LAL)?dBKr#t-PkJtYF zOu;LU^?cZP-hA&(t42fVK5+Z30kxj9UEB_>Y76Ke+;6>-7O%sJuo6 z&`^YIczXKJI^e}%9O|P;Fb_vS!RT;y?$w7c-`4*3zrK8WyL=~g7ZvJ$`p*{`lVSeF z(YaUu+h4C&9uGD9azlR^RC$iU1o%iQVlb|S@R2Uil81+$CJP#KVz%s!+8-VmF3kg< zF&qE4fdBi$AK9QoNhI;NVFYq2!dTE~Ei5>aI3;MOhS}-kyJs&n)InbmWdvL3yQtY7 zYKa41Fr3f2#kv(n8vO}A3ETfexQ0UO`^I(PA-j;?m+$>%|x}HH=FW{7%`(l`Yg$XO3ShxVM+*p&Ik9 zL(Ec9n{~yvyc_ncP`T$?P06OV>6Hd9eUwBpm;5XyRWtP4>XeB`m%%vO%{Y1OokOc@ zw2b+DI#-_waZ?@(N&VDe{XqBw5DQlEle!R4bAM`(!6Y;>cUVWs0 zkvrD+XftCC#-6`M?I1h5rBOP|8F}Rxz5D{&daKfNFSjeDnMLN$)Hynq3wLTCs#?%s zbt7fm)BAel3N@3BlCsN!%GeVry2@ikQE_i1X(uE`j?u~9TXAp}XVH|C9z%0J+$p{qr2Tpcb|v%eE)m<7e7eN~BBqY} zyixe_?D+hw$3$8j&-q*KlvSkoOZ2?yl3T7b_8)PKvbq*wscy5brjt`js`7nVG3ik2+^SC0!EFQP#qXVQbd;*vQt@I$_aPJ)Hh? ztC-WZb2XTwH}}MxINCZi_m(>?I4NWBfQDz>D)*lNlkjQ)bg@T#9?fm&rLh29Zp}vLr+Zj$+o$$!ajuYwr;PN* z!P~5JorgDPwy%2mROV4|3Huwj%ZNN`y`mfc`mUc5&-KkJ-HoqqwJExqJEc<$gf~TQ ziLH2kp)Fw*!_zkEP=onG5g5#4{%G{-%kZqp5r!+cRK5o|84c%W z?xQ}}V$|;)Et}lt7a7z{rh8w$<9_btSBJSyJY-KT^AI0?J{5FyM{}i~$v34dw$0PA zVi9bC6tW+VRVz*CnW>TljTukmy?l^d(ql~7cI|3fw`fwO-O=0@kJHNm<1H&{vD+ix zjhC3G4t597u*XEc6s6nFj^Vn#N%iqNrI(AF-CEUxt23l(0-wWG-{5L}y1xgl zhP$4uf7+u`m-j;k4f~b*8pI8(gw94gn@OCT#a(5ht=xZpjE242>TV8`z*6awfV}`+ z=#C2-I`W2^*OeWv-CXf(38xc&5f%nzaa%0Y`*O>Kpz4!0hsCD42qPw1Pt z`cl29{~N=Z1N#(`s9EqWUFS|#o-wld#C~k?MC6C_{3`YSR7#A>96Yzx-qKZ&UqYUzUeGb*)i~eV#iwn47AzG{<=|4%_Amipb~mQ$*Po3>dvLa-2|8y?i?) z*zMx$ed^@ghYf{(nBk)~NsB2x&t4DT;d(-a^dgVyHX&&$U*0WpO06FY86FE7YP&p3 z*;(A6HTYtnL#~86Dbvu{%TZHvXujR@dsK{u8vP})1I>I{LRypV?6fwqW|7AnhriRG zjvR11y*qkGb}+M-8Mfrol5m-egnK~i(8{pz-8;qtk6jjMf8wTDigX9n-}E^6@sQ0I zkZv*MJufcmMS1nnMDCW4{3f;USPbvJ@BXUJ_*ML>-8DbE6Q7=o@xRP@zC)7N{PehU zM}s%{tS@)_W4u_d?EEHj0c@6pAFo$+8G~OB9+PN_f+_dnTVJaF_nQw8qTM zY&3rDOm7a3-Vo~0JEUzByf?eM-jh_D#_Boq3#(44$yklC3+kpf5^L)N*}J2dWxnMF z8s5k`GAMx&km(f^&+NS+w7~Bq?sTjEY2|gSK-b>pcRh^Hzqo6Y)ekbuu@>4kmgU#K z^w&&?K5uG3d3>DqW%sj9O&W(IEdx#odwT9$qPKMs*3fcWuK6N-XV{x>O*Nq*eTWyU z_#<1huJ5>Ieol>R~1T)SJU6P?_KhZSvL-I`0(ld(4Hiju2ZGHaX$h&wL>LNOgJ3M z5MWlkAcdPgH^EBRvri>WgM)F1^nO%zY~>-Hme-!HJ(*dm(k;0nAHyC#WhKSN{@m<4 z=l9ITnw^PFhAjQLR+9+F>D&r|nfrTAjY_0`JQr>1x#jTWfdk_q$qGYLZ<(T-P4X^9 zKab7$Qb*&a)_IEK@;jp|DxBZa*9M#Aza>b_w&>U$PFQshxTWpddal&jsI~8d+PbW% zY19`M5*O10>r#y5Me;way$ed1GhHuMhFkc(<3q%U{b)FK6 z6{9WRzv5>T&s#>H;w^mCdHG_3*)>lujpxa`XD6r+HDn2==yUT|2`9`sOzNeMg@&K{ z;`zfU4_lAb#Fu}?HTnCMSA3N;JnwVmOF_u^ zS8F~yeyckzy{Xa20rRoNRIN6w-e;~@7&x0>;} zY?-g|ROvv=m*OKi3`=>KvOA9wJnhNn1cw-C?gUG?8?dg&AH1{2Qjp7g;0@z$&%NC0 z*4KM#1wThb29)p46%X*fYrLs9ws38#%lwvqg4vayrA-18#{_Rs3tX7BHW?bv{%|tr zCc~%dQwHOgha+ciB$ZrsE{?5kpPs0GA+PJ09q8yR{H)dW{(&#$kLtXVoDRq0FAvK- zby(u4Lm_M_MFYjnxsJ*x4(*oPhsrnk8DN_CVkDoH*9M4L^P-~R5pK~0@kT1B0jpO*&;Il8UwGk&VbVCK)1 z&3%gf;rp%X(Q*3t>{r?4g*W5YrVjrID&}-y-j{RdXHI!$`*2sef8!>)pP>h`VyWnD zZtU@*3S$yA)`!>VbTMhYe#qXi&B9z@JgRa!OV^pqGE}ppgpn!MCDluoe7T(Gl~P}y z(iRzyusDiyWG4GhJ+qh1lRd>q?d9edHrD)eT(;$yVfzI;-V@K2X|ZqUMMWwu)OcU? zdGsk9?v!~ddn|W!oYX4s+dPrmoz(5>FHq_IW1590$P~kx-O9-5l~K}RdpoSbYd*v> zzAN8!*XIsl#`yuWmq$$8T3-1LtcLy!tZ#RvxE8RlLriE~_EK%O!F@v}{amJ724r{g zxSqWY!U?d19(FEPkm?~>UVZ!Z8kXw)d5?NhZ5~sUDkWY|W}0DIR{b`$ zc=MrAv&pygm4-&FuB!hChE62x-dc-*t^14$Ydt@|UAFOAt2b22M};Q7s&pu*$TL1o)YoUCey&$@rF(=Go*-`T)<&V|KT_1aAA>KB0SwBz_=aiR9@?c6#-yuk{zY zvBKpKJC&WDllCM<9=uZ!WWQD_TYj9zBah_bnJLRYn=rY=*sw=!mPh$~a+qCwqW25E zN&o0}=KXk=aQ39~D&tn2mA+^Bs!vlb?G-$dbI-9W9Fs8Vdd;Q3LjTlp$vc3%y@|zt z>g4WYG;w<`#fWfqIXrtiBDJHBC9d*1NuUXJ$Z=jBgOjZd>%q(FT@ItlUq1VvrIL*u zs22CW5GL*YvvBUv)4R@o59J^a$vH`;^yPMM~2 z_q8P(-?d9xT-hI-Udh#aaBJgysQ1K1u^E55#c(x*DRTS$=0Y6i^f3c3?{I?;UmCB7 zL`#Pc&E4cqeW5|dcqSwzA@Y9ly698$XpfI`Ps_>Yt&^x)4zBf(=v6)WHrSUM9!&N8 z>1pK~{i)l-I@=x$?RlKf-QCr826|R+Z~xrk_mJn&c+c%zj~&dCT_=5W90LZWb@N4f z>$6NAO()KTd%KZV+E+~vj9Wf^=t|*I(YC*thk?&y6@?%G(sA<_lvY_`@neVehAJOsF!W5Gqw{x8& zdqzf1t*$9A6kY9j^R$WXHIIdzLsSGO$H+*sx`?Tve_ZsF(?SAmCQN*D=O?lhe%ibp z)d(FC8J1cQsZ#f!4Y`pbJFZ$jvh3l%^X<>BxlHx3cPV>5Igut_8?tselBPgmkSBU4 zdw=4CuS!oSu3X!+Jz-~U&;_cCF7)+HoE$fL;@;^C(1gG2<G$qSRpVW8jQv#0B>6f0pl|D2g_GA`wtlZa(V{=sO$@?Y#6TuDga{N@Kdmr8z7eD?%Ov<#VBmR)ByFl0A$<~LBlJl3C z%uhJmHFZS|n8#aPbfllB*`hu-SF5C9rq)jJj9d+eJj9rwk;Yv8?QL>_FC@(_6Npt=TL*Xnr^#hxI**8y& ztvHB&^X~lqjsA;Q2C0ZQuaRT9L21@w#fHmt{#gpCLPgr)Zf-KizcKQz9)2%JF+J#I zKJn$qqhW?0qEr4ssu?Un4s0D?9V$H1+N*BYEscEKrTwJPXf-6+!eM?^NPLy!c5w+O zb)_E~Cn{Y*J7sI@WPEgYv{c01=On?t zFRbbI+>jmnBzv*o^d6?SUw4K2jZPh*?o`>W-yPkjdWNA)i$(FelnR#R!7ciqOr}!2 z-OVo#wC#CV>{{C`K{ob-R964?(`x+#S8vMgIy`zqom)tlg z|02dR>qVVe`kNW0D?6IPcbIOK?pwOF<>=wo8ziA$BCD9E-AF2rVBaqYE;XyX{A6}3 zjISz}O5y3H&k+Uc4Fyr(t~9;7$u?YcnXJMdJI6(8mdkj=gM#*X1F!PcS54va<1VAP zc0-JqfcOS~+(uOxn$Qc$QO6=CJ>(lgZh2oW~6B7?XDIFuHi`R?OLgR+R@j zGSdmqqL{OI%{_e1X;N^XXUvOP-E$J4=OGT( zvJA}ATfEZWW$4}vbM*1e7F*-@2-f8(+*A3=;Q(LABhRiULbS&Ne6Op~ zE&j0Q96xh?W=^JG+&M9ObmZXqdzqQi>{Z|PZ=0RbX(SPLxgMDrbTj>a*Y0cP;k4@g zPZI*o)tr>g`^-w?I&ZX@8ytDHPi^3qVEv;#=OZj}?dB1rr*pm>%u=fvsU6;0ggdg3 zpcUpAVmW?8jaKmPgjcB+rn|`S`Jo>FljQ;zIbOV?*|Q1rc_cxiU)s4+d{M{qaY5?l zb+`RuyI=cPA6Spt!~J4J4*T$WzOHEY6>*cWs&5za-^nwpK3Tlon<*cR#ge*}&K=h6 zdwslz@vWGZl3&OVFU^y#lgY7xx5~!**4PyHzWq5z8?c<;Q)T=_&#ETVkGYBT8Y@ll zCD-hXt(052EgxHE%)$#h;(VJvaf&6W$Q@p$i(`NU)A`TG8ALQm&(HfxA8&T;6Z-az zPe^|GKu^Qn$jp$B(n9nAk`Y(8%P)y@f%n(;w`20j zHeO^}sZPof+&In`!C7YeN4_&vTnjF5lghTqHxjdwiY%Wwb6>WXue4AeBc&6-)uB*{ z_3F&7e^YM$QSG`(fb?sJ(8~hJlB_+ibeGPvR;hd3SZDBE4ZsaN$}L zYjtU{VL6qGf7b&^EGTLGn+)UWo6jQKA%aZR=ueO|c5IJ=wD@!aLc z*On666%S%hK3={0a#9g{fs>)ft^ea%jYfFcnjf>D>Rmwt7ovy6k6D+PcVvW2_#+s+uj^gxX@RyWPE6GcVTkBzAkM21ZskuKsrU z=X*z&7i_O3R+W9?`tA8=$;jiKoP@unOWBo?UDAw!1QgO$RCX^Dti!%hNeqRrg6n7<+SO z-OOb1^&wrZyXS{!tUfBWkcL=j=-um@?%Iv}VDom<$)AVLYJ4KmGQ4B*&EkjUVJVZ+ zQ|B2DOX=(yPnVD4Kc2gZy-;uBbiK9JW6eIP;3zi@71}2~94<_8T2IIemMi_dP9EM_ zdpWP+=Ck9$$3q3K_}y(}d7C!>D8F-edYW76n$tUzZ?iK2S2SqM?BjWi`_C>}nm;4G zOs_xn_DS>gfji#L#lvFa!rt-PBmKK>_6+AJ-Y`03sl(E5npic={W)*8FV#sfxZJ7s z{YxF$0qRBiBKP__-RviwqSxw4G;;Q&^y(3k&I^`CdxEPP$)F-1331P9drkmT- zGWpVqc^qa9G?X@t?4HpauVd|(p*)o+aHj*aRl_Qt@$G)<)7qQqUAVBLud=icO5M)C zac#uQogDj@4Q|Pt|OGJx!Z(nWM67f@G>qxjBHVUS9OL%aDGZqFnrly3pLg z@|Eo_L1A`+8sEMbJY*x&4=Z_Q?*C)9x7h8KZ{nqoKeXhzE}nbfCh5IwG4u4{9sS~k z$9ELW9p1hCl9aE_%bt3JvnXtQ!twHc4Y5GEkD5oc1=zkcG#4fAE>&1Z(i9wY9ewuD4%k#RcAwzR>DxyR{n${-zDx`{;O_Yt?P0>lGmQ&{B`13OykroQ{yYwy1wsIb#Zze?ZC=;koWopzKIupk763;lCAKMwo(Wm z`{pO~Zs_8zNPOq_Qw}z@%Hf;`b7}8>dbNee?e@e8%(a_a4`;0=&R-JWJxS*3zVKY) z9hua~LB}EI*Bm*_=gt)wnC++WTlc;i(4Trsmi^29$@8m5(fZ^cgD0pHL@gGX-#p3J z;mj8uxo>0Zz;gdxi_~lf_KSFg)iX}nJ;zRS7F-{sX%-Tk7YI03c*>35j~DLbohZGRMmJQ(V1^Zt{6PKEiT{|cr* zRG>^&yfd1aO1iX^coB6zS9RJGMd7c5%KPp{%fdP*k5s@lFi;rp5(-3`JbvS`n|JZ( z*gcX#zD!-&!6}VQeEV8a#t1aDJ zK{d+@F1o5e@0T%25$vT&K%w=lRe}<<@mv(LG3-#rRL7RsP}1gonIx2N1D5+0k+N#4 z#15L{S&7>7kaOqV(mJv~$_o8vsjj&T1Y%~Btcr2F4cwiQNwNR{s+HsW*dw^Kk`VnX zs|oD}apr*oy~Y9%lUZZw<-=yX6Ckt|Za}m-jHL{(V z5QFLo3D$^Wy;ifo@~LS2`J~8GejX)5pmn7^C!vhLzJ7<2$c7`;3gmM5YYw4M5OV8y z`wN|l-fay8;AM`Vnd?g=KH+G722&36^Mzw>tb{=k3`bCHmLc%(A|_nCN&!C|=M6V{ z&t@55;jCUS|0-G3)xh7CWg<++7|JDmS3{_|CvLc*b|pr)cX0|rO8x}l3JOg@kulOr zm6-Wqg-Og?D!|6$^gO@hNvJ#qpWx@DVT8v-BvvF|-#q#%w{!-Z3w88cOFz*t$c5Sq z>+c-U!UOj~Icf$vt+BO=RmPv`A`}W+Piu~Qilr>3vlRbb@8g|S%z5>V7SiP$yOd-3 zS_@y~h*+k?jg5TdwLk_HX0h(%#3j7Rx^?z1FXQy{%zffSf*r5%fxe>IP#~>6w%QIK zIxqTlv5>F4Vd0Ify1CDl4DD}n)nCG4YNEtx&_yUjkZ9my3MyKLVARcPuV1*ZjDpL9 zDUCUKenk~#B$C26ZD#U8s~g@lMUGgrq2uw*W#6V9TnGoX8MqsW3i4m)CVVp8=29~=Xgpp(); zykH?nK1pz?7g!bB&OGFOhBJ0`uec4g8I$UY_)Kuke3V6W-+unW_SQci3zAKhLO7cu z2_x%N040Ers97TqdT&DLlAU&~l@%o#+QVX)xl<%?6+l(L0ej1lI&#QCky$Q%RKmqrtZGj%ID6CWiEICn^EA@e+7wE1} z<8)m&6lC?Xv#HNdtwd9&pItATv!SvzD-y0IM*|c#M@5W+-S?PCI6I5Rrb!qYJU8P zm*Pr8`^}GkO>x>4l9D7H5EEVhc7){t7nn0cNpmsLoM_)6!5b!KQnVNddbG%RR4oRM z$rya446fjr`^$fD=QnCw zRGA=dBY?;OK*H*bLKsI{5s|-y1QWsu+TtYrrg)BxKroEma!{ukI@b0(J>xJY$yly9|xM4iz}29RVr5Pssl^ zKyOU}T;;gQD9(S|@koVxis!$m5m)2q@ZXE=*MH&BAMoh&FSl{;w^*;YpwHpaMn8tz z-)@+H4X^$itoGmU4aF}3@inWl=#v13bdm2i=2h(BtYcx;6@0T_Vw8AH9j5<(?2??7 z!EX1@F_c|!)&UBamN#2yDNMuEYiT#301Y<`}psTy% z$^w+F8*8vd>>RUA@w5Q&dC@u;GAH5aDS~xEKK+)W!JZvO>VZi(vaixNdU1U40*2jT z^f@Y{x(E7Ew{M!=Wv!g>+PfIxQoX4x%rD8Q(spQF-(fO-3Jq|*f)lCXaq)94gSloz zxXCDkx}E`0RqHd|r*Td$v0W2UU79N>R8)?79SP`vc!#w-+G$*EQzkj%;OnS-!^_?> zj#$%}B1;APp8c_!u{YUNHZR!)e;LVnM7I?~ z(a0t&_5k$d>9%JGl!3nbXB-;;9SotZ`N>FZ@p8E!_)0NrQ-1v@yC^Q5Fu<#&N1Pj~ z0{oe}E{#*nyKHIi7L3=xcXS~L@XMwq>fp4L%J9wtzpm%l!MYos_SvBTK*fb);IAkt zllS04N*$iJ+WRs-7WF$-Tx(6p`OUbPKyKtccEL^vtSU$FLxYaN^rbqcvh~FR^}qy& z9!Cw3m&qb;)4yH+I~%*V1moc?45k&9-0N@nNeXtwTVBbx_CZx;I{6c&rLaE>f14-~ zPpyJ+s}SBRINzF>BSF~)>r4YdMco8LmMf}3$=aZXNcsO>(7n@<+ko5^dOk~IYQhO4 zS`Qo(2D^F6O+#gUyWq0jNFWHSh4j@Ib9Mq?a5Q)eM2y5J=wA8nI}8@YErstHP(o=l zK2>_>)0l-nvMDl&>76o3-e(-QP-i*5VvvP%VKF`m{)pDWQ~{#7|7?9qww~zd^ZZrr z)1{BbTTphCb<49Re}k?kpb5SUh5Wh<6A2yiA_8j>79~%<43NU_t`SUwGv@s zb=RdNV#cm9pu#aD@4Rz@uMXtTPWJy2^``XQmB`}uVgD3!_B0br9HYOO#)*Z$u!zH# zSR>t!hN-d!_EG)>KwSAJ^6UI63Q|w=TKtq}yv~v*+u$;Ui7Qo5Kf73oH&v`ZNAFB| za<8g6@v|lMgmLyOy`ShaYn>v4apQA*`n5A6$A9TXn$XpSapR^@ix2$m696inJR%Ta zo+@9iERMiE6-a*Zn^7X(Znd>!iJR4uf0E&TT}z0H@*HVJB@<{8{c|mG5Q%a`fEfXG zjMM3PYFO|8#-OIXzszl{*TkFKZ*>tx-BV~p-2gbLBCWmqE0qzqTM zVEa{A5F)p67#w*ae`$zg z+5%?X9dPc;I&j(z>2WUXM528pN0Mz%4_?bSvna0ON!eLVCZn#vw`+|@;7wyjgaM;6 z6tUH@otlOAS4Q9a2X`-J;&HkBNUT-}^=uH-uA_qmU68os=7G=~Kn(+R0y=e)+AxXM z?_9SRIZ$tGFTMQr1%{&sQ`Iq{B;(ZLlpsj|0fDj#W8lo@`AE)G%aAr4N>0JBJaSa- z{-G+`rs=~tJF?2>I5Lh$w?gAKjg?+jJ7ZneBiH$Q%i!s&ONSn_KG=5t9TztoF@$CD z8UEzT{;G~pk*wdC`58;pYUCUv1Mf&K!D+TUTQ>xyGJ4BAWOn6ossShV?fBc@a;+a5 zSO}Nx;&IBA`1}=Cpj!z`ubUrg`LY0_XRD7sjrOqyWDn&%%CI?oXHcaqYX`rvdT)r4 zYL{hbHNb?qxRSprBX|LITHey+vhIPvROkUE4Prv^%`Mt3vDu4mrd9R4?&&@JOuRc) z@p}CBeKktUL`3mJMYRx|KdtnOcS`*!p}75a%8@_MPsSVM#jgw%tpF9H^&F{~F=%PO zM>y2itDCe)z;jEsr*vyo1&n01le}*n-Mt0fcVm&Kn&h{Z*dOX#I@9fg>e$M;^*ZA; zR<%gyZgDbW^x5avx!e!OZ-2g1yI|Qa$Kg93yDi#YY@1e%+NvibJR2QV*g+xxf6;3# zZ^lIvD&Id~E;Lag2n}{6R3Bb%PXkh~(Iy*sP8X{Cf_mVeD*M@>zA5>n&N|U{zmJvx zidK8QgiDIyUup6*8aMZj|5csyzQ9PuGU}HDDgq?LDmXci1WdSaB3Mac`h=jt@<%Hy zM2N7|R6E)fv-lDA|0T<<=r<2pQb{~MB(8{T;k*U;jK`I2Dp<%rS1>+KKpw)KSH?Zb zxKo>iAKjGuVMd2-umpPqT{70K;;)ZMCML;y>($MqhXe8K%sKhS-=_!2!EIEaUQPgy z33)H9UHtS;b(#5~1EFLncl7mRkbJkJA&#Wl5@!ob%R8rq!^HzYrfgX&vJKM5Y2iLA z#0Vd{XCbppb!od$xzgZ5I2Z-N)kL01HC2wqRTBYR)zVNDE(w}l+v$|5QQcqq^9IJb zD7`Pbz_~NJ<*jdtg123uwEsYA1$X8O&vlck7w$}DD8Q+Z)XNAo_Ea4D2-Dol6aR*e z65-|5i82*RW=L9p4|7m&_MkFJEH#-bDipH%)2n*)kqm*oH10vz(R~4AD7x2n(uWG; zCdn*IhaV6q9psWo!>@c>sBK`n#yytqRa2)7!J@y<6reH^)eNYzy!6N&^Bx+Y^B8wd zU@K73#ue~&d3&&+bb(bOubv2i8%`+9Xt+$CC$5GT8K_Wb>FeYH8o;s|^XtO2w@Ail z%HlpKyH=VKqy^a4d16?ClI_@km-Lq?&lrgh3p$;Zr)p!W)Li$xtnCi-yqyIhyVie! zFRAxCR(5!q#g@SWo~O1=LnLPVSal-$xrjbd53#j`|2w#7NA{HM(TT@NWbO2#;Z6;h zM4zv70N}ZXlA|EF@Ui~kOK8b@JavD){!Jb~bsjAsLTY7f7fx3@tN$REyNRxs4Jt7> zWPqLZRp9>D$h5-gjhle%mI7(Jf@7J5*+t^CFwwf-d8JJT@WhiqDu17n`}Jv5^MS`S{k8dmQ=6Iv z*_3KGCYE}6lP(=3dT<5Y9kjXdWde`)EU@;~H&CnBl~-ZSjIK98o9s8Jpji0ON;o3is!E8UJdTr1{*y zuYLjtbE$}dGHk00x9S@?OPRFgbXW{;yBIEXaRA=kr)!~#!^OEpE#G@(6oM@+>)(RB zZbVJ5!X`XT?L`GRh2n!F-)~94|9N!s^uP1wl5jv=S8wd`M$Y!%WS*a)+P_- z{Hmf|feI6#%D2c=)AB{;+7AF%7G@5;D`sbppFvztug`qon!+r+Ax?76r85FpJt+qK zeQet$ar9snnTcDo#pzwVENApJfFJq(QW@h3)2nd_c!)#$c*Em3t_KX3IHHQJ9OOs( zusscq^mE^hus~`-InKQys{t%gJdGRL*=HI>0ci%iQV$hsrN4>6b?N^N3F59sX8%xy83ebj24X)RxY zLn3v9J=!P|G&NbD8V8wp^V}x*$R_(HPeS5Z+3{9aN;W$DteRi?Ifv=#{6vNt2aLUg zeP`w{RQ!%{Pa7Wrj(aI!CA@Kn+(w6Xi;qlJt_gZo!>#ic<5&mN|7#B^N${eXXtT=Z z+-KAQ*_qm&d1v)Uc@ii@?Fg+^vIEy~8tz!AjSBe^ty{p!MQibCz0LqZV)6GTlAkd6 zD~n|Z9xnVlc_?7`waqHGa?}2q2QtZaO}V;NQ;Gxfvev_Rqi5AwBW=*wJ@Gejn-qti zSWMjr+b>=ngL=5UW2@DxM>n@se)3D7wKo_FzD^!%Q~fpTegT=Mfn7ACW_cq#eGm^`=Qgq4MU^7dC|6M3m?8-vRW4+ZdV{8II+}VYchUwf1t>S0JcAa)LlPj%jnIR2iGPFR39{teP1P`GBZ!$K>K~K zf^xrMAH|dk78H@cGe-5b7uW8+FlfmfF?}1d(zS>xL&G6CK|U$;nUU_o%1SRKifTB4 z)60V)CPE0KLVSAfW%4n@e+g6P<1KU@;GT|R!Re91lvswN7YvlYHBl4 z7Y&DZhcs$3J6Q~8{1KS53xmnmn|8gt0rMyf57DO5H-FRDO2kX=sPhpD%_>C(c^ zuEB}F8@Rj;>H1#L=4&qVjRjV8k`!)$3@cp!V{%*T0X`4i*hJqMw#!C)#sENEn`$N? z);KPCyXkout$=wv!z$co;%WSh~*TZJhz!MiCPcrb@>Q5_!>Ji zjc%Tm1rn@|P3{@#+Z}}S0|D0NkLE#ui*5jJ=5!JpF#A6i%5fG}A-eoT-0mao9`(D7 z%Zi@v+k0h}v~5~4Fz#e)6lMeJ1V3*Q^G`G8Wy&=u<(CgFtQsH5{K=GVoX+dKlV75h zXv{!VA{BOzw5NXj`H-&R{r_||&**i85ya6AR?b5qOY#@$pULm3I?bzdyK`$scG0-Ac zfG}m(O-`xsk9ACU417rR8?bSc1bDoxfc%#YcO74@p#jZea;(|csrm>hk@BGF+>N39zW3dY8O0>t zSrz%=4qrootu22s_t}BBeSTCPEBx3>uW3tAi+}f3n_VSa+>9O?0ZB0kJi}F+{sW(@ zR@}yVqm27Uq|P2%rgsK_;nnnX3|DY1T}Iz0|8?L8_$B`fBhHJy|6BaIQ%lfcf$1e( zd;CumYK~D(Am@giQy_k=f9Wk9)CD)?n1cI&)k3cGvC=UFb8IU1wtrRV`#FMShe=aI zXktA}qMGDq%0)3PRH5+rt87cN@D2$^U64(JZSTF{V$dPbO~$l`4aw08&?9)fA{y-g zxn7E7+(?ZoZ=O^0b4fc?cw$lK)@}M|>*OtP!LrQVog93um_1-YMjzpNt*eWkF0Hdb z;ZIi=C{!&cX;2Zuwxw`{W~yCUQ#Y`_;|uCvMnJ!ID1Iz7m^YL(#&Y7YatT~}t(bTj z6&hUf=F?7ZB~5!Hx|fq$MS2nmM&8Yk z{8Brj;7-m|>Oc#&(%DC(!D>H&B867Qt!zq{cV&{-1R|n>>_0qy!tw+BE&JuMIjhHG z3+NLiDI}r%96ZA_^lce1@7z=k>550j z*v8TTn33^ZYi$klt10-FSvjB4c(Fj=>p%eVAM7ZZYDMtf?` zrPCspg;X`X;&%y|YVim`d1duMu@E!O`@j84%C5f($rwjFn%O<5IoN2}u7ixn87D(G z0GDzl$L7oG^j!OrC1LN^a`ptF;)SwK*xGJ@hg-}e_h-?>DBlGe?wt&UIQ;EW78HUSYf(nwkF>If|&XZ=r9naq7<;? zC!p*PcR)A6%EIhA#Mz#3YxM(S4y7*^8c6-;@vtpBXlefdSL7Ob`fxO+(Y>#T#!6@Gno}+Hb z+UxH2Mp~If$TR+w9}bfT?`NsVFyCOhb_pbODckLoZNu0d5miei&{e}}Ung#IBJ*pt zL-%4Mf5$38sP{7&VB#dwpA>^o*N`J2x80tuH_iHv#y#<46g%u-S`!;JXxSaEv$xatR2JNtt@Y=R3A&)Hj)dC4>X3ddV~cnzq!HE~~v zfGCG^!4ifrWTsZ(IN)q3qxx;&k`FIiKcS3y+-)Ssxac79AF2@U7~kxZCRDg8QQ5V{Yzph)1B@n~+^Yx10Y`1J_+r|5b|bd-v=;k5LZQ ztCrWJxOGA9ACeQ$VeY0|$OB0S`)O#5nQ72_Ea@401VweWXnI@3vmAI9YZ8}$Hh#i*LvRT(Ft!@I(pHfYO{U}i25N+|e zNkIFDYorhj%S^*1BP__7a-;as=i#^TE}YL5we(-}hyv`Ib9KOx;_c1EKg^5u4bXAb zciXn_AZbpu{6pKeC*vO#Ok8hM8>6Q%Ps!bcXcl1@1f1@?U{n$u9c)Ag^U2VgIk&Ep zH5FCyL&4khJ`Y0Y_Zjc;rRT-!7d;Qg`H2iA@hyNMJLY@9&>~iJYdlGnr0h5=oIV6# z;9lnD)h0t89j-NM%tCM~Mn!hO1Jj-9v%_nQmoMBg!Z`9)3P=PWGy{-qHI<6hPDAAH zMhAm#D@gIY^)@ZOA3{yoA`Y>kylAxhp|O2}b|z#@vchf`X2+?k~EwOVcJv7bev42qzA{MXf^qH~>LxJ_niGV@j&PIOPJ73z_i zhH+{Vwq^Wo@ed(|*`{||XCae)=*T!Z*jYoBcg7{AB5E}p@b@g9<%X6q`JyvCk4A> z6V3Sx>~XUSO!MWY&Cik4V&Yga7J$bPLMIw^J3PnR6VSwpGh(0=5dq@o_LHZ&2`_tX z$Rm$AK4?SH%(dhA+#y%Q1ZjW5B<8d)DeraV2F9bISUm)p{~|5y9Ke7bl0X_p%3$m> zXijEujU;;@Bd@-4553~mdycLONa7h=E+l7Eh*MK`)FO2F>209z@T@S@2yO~`mBa>@ z$}xFORA~;yFb6Lim$BH1L$?@e3Z#evJnyEPcl@tHvO{Ns1LH(K!t6QWcGrZ%iWYA`HF)6_M~5Tzk} zIhrmR@v+QmdtK2uNW%W$xw0hsqki2Jln9!Ox}ZkclBXQxWlE#?84b1^*mB;;%^6 zG5ZDnHrno)4>J8U=gkI^$iyov>F^j|!DVe*Yx`8<#*N9EA4()BHcF(Byg~SO)J`lCODJy7z(=Cw-8gU&E$Ru{EExkfzF{EzQ0@g|QeC z6hsOF%-Yufh8-bnb6$)#N>PMG=KEuOVTQBQBJsTTC7@2<;aHm9QYZV|%6SvOzF(EW zs0XMd6z3?0PQe&oL+gCmUxyK`a4g`mqVy1;!`@537SRqsjkrANGgIQbhn-m<%!|v& zNmIW=xQ;oCgVD8!jVV1$V{Z^TQ#OvF%?HmN1}REK-)Pe05oOUDX zI6gGc7pWem^z++%o3aSs8{MSWC=R$2Unkk0MBr9OuJ&Bz-QR%dZveB6afo}82vZpA z;(4|;LWxlr@#6T(<{w$j!XOxU8xw0D+LfxUK+ww4P1!}r%tfEwOtBfEk4cXQyHHq z1iRP%qj~C>5Q%rFeg9m>1ZrB6K}`>MPRH^32MUqowOOQJu9DJ77v39Cdju+ z>Kf>0w<{lJ1i%Q$J*VZzEB`05Q-RI6(Q7k#E*$>FQeZ%FL|DO%j&Y4ZS^?pH*ab-Y zm>2hK{r(PUm)L*os+QH5sB&5g>uD`UbOfmLzv-la?|2?Qxi`*}8b8~Xio~);fP}yo zoO;o2YBAVUvitpg@`H#7`>6MYt(u^dOG*#fPdXA+04NO z>Q+=!c>UxwPVZB)>-rBi4zX%s z2DNsLVd$*yPE3oxX2&mKLCqDJOILrmz=V8Y*5$E5KWJ(lni6pG zw(o+Uib#b>3LsS@hHaNM;%~5u`am)L_+Q{Mc{nje<5Z9iQT&pWuruq;8mBc3eve*! z%S&+CxNncUD=i*sDJ>E0Sck8REOqqT8Mj0p&#U}%~Zc1Cn8ob zQV!tF5Sao0eRaJto>(N&Ghz;vrW6*45k*3CsY{Wvu$aUyLxhtALCySX!g1pJVE1M> zd4z!dBR2rPb5uIA5lA42W0!F2L^+*_;Px4POcqPk@C7^2l}HkWQ*mjy;55QJMAIg8 z-0e&Lss+toS0sPrBxB$n0{gFk^QTlh(uh&~uj=VGffSariqkU%-c=BP7OeSA9Ge08 z-OH$Rd6F2&bRk6F#B-}Hes%m{yttEf`M!1&a|}|ShDcT_z5^!hcufgWL;X(aFfSF& z!gAET5X!;&dgGdRhvF}vt#@DU{L}* zo(yFQs{$+h0_rQbvNdP7I2gHyt`F5wiN&O}vU@q+E^f3NK!33Xyku={3*IilkIN#=SQ3O8U=-MdlCxTXHp*O-Zt$ubt77X?uX0KOx?J@t>&qaY_>s zq_~0sytm4$23N=M#5Io|EVRC_jQ}z7BJG)80hBofEo$ZC7)5hoIY8RDS2XJx#zIqU zUZ%ZPUsg}Zg!-^rnVEa%(lgcj-ulYLpY??%T0__UK)EKwSEl z=owh4N%73#euDDZ8=A-bwQW%;$+<;obI0miP|)!f^ZT~aT$-d{GWOOs^`rgR;`r}J z0RKJy4T*Aoi~%hgkTChBfHH3kZ-p^%`-QjvABChbm{%9b;-Geb@E)?57MT>lV%9i? z++7=Hj(UIp5s!uNdkb%)m{V!+d9Zsa!m%j^;>R^(Gh$1H2x$$-C44&Y5*Fnlvgly{ zE=0O*)FHG@AVhElqaFgUr!G{H2S6<)GunBvWUDl3@iJ$a)K{K%U(P+~`c=)T_a zNQ8(X+@{kk7ujq*an_*zy?Llb%jCr~k8p#jbE{IIuL1{6@Q>e|Y#o?1CIc9^Z5=2% z;d%05Qj7?8_6)dAyp^Ue8$wPqa(ej_Y7lb`aSCLhN zLFA;NFq#mu?*$<2A1W#bkVy+_+@TV5%HaZmib272r*%X@0z zg2NGQsgwwR4`QerbE`o59P%+G8Mmo6M@?_@k#9R)Q7BF5O)|zlWxM+&USdW|YH?4Y zLn`!wt=$gnuT6u-EbA32!~y?fu@>p79LW#Y+xcwpv6Zq+Ob9Z_JCo_*v_t|(IJILsho_moZh(% z?(w?uR9O*sd>kLAa!s6UeoKyX23n3mIMfX7IDA~5*V9#0Klg;Qa&K<5@5hS^*)D*> zIr(jyLO3vN^7uA_$bkP%zC?nUYeB`yEmZkfn|`sPxj7E$*RPerwdvofGa!nMbh7p- z$f<|H3ZuWraYC4ZT`*I?vPr&NZ@_KJ2#5~xpj%JY_G?inB>U#`x=|g}4B1dRh-WXy z7C+v=Wz*t*lZXlW|94ar`!Xm|TRtSVz|pt=h8R1^lJTO&@+GVe;@aGXx@=pB^rRbA z5B8-nahgHUCY==Ge!4c$k}0sijDJAP8iFQ-#=REZxSK6vA7(w^$wqpNRs|Sd>CdS? z;~Fv{!Zm*Q=u-VlcZN=i|9-iyHEcXp$EjVO4xdOL9MT!rdOt@yNOG+5j{daQD+{d^ zz;58ceaOJ-k7oC$qd!v@T(+DxbBCScPkBq;3pc4rcJ&uXDGHm-Ts3g=4K|})iL1#V zd9@p*>_~IsSRBi{|8a`+gE^%5+$qTgWWbaE7{|$TWJeebSjM2OHsNReB0oTfT0je> z7YRkn9gf6qq>0MM2_S)`ej~9>>kaEkn{|P$%GRF>12&mR&cSZ&P@9IHf;4V*W869>_SEGY2(UH7BKzqZx&V6(*$Z z4kJQ8J%t|B{~=`c%s7h<@PJG;>&SVMJ|1J7h}^6+eHWNJRkk#DUQ6Ni@1sEsX)-}F zm7pnV;Njy~Vil08Hg3tL0;Sr1xHbp)ZDZUSb(?)wR)9O4sC9#|MrmY+_cyrk5Jl?T#a&*Kl9SZR5f>6^w2`cr)akmT^u|M@-?_Vis!Q?4diy;X%yJlff zmHQl;kf;s@9cA=`GJu;TzTx?1=xe~*1AaH?{?uj-{@sxEDYmFoHk(A@3h{CP$r5g4$ zYP=m$+f?sFstcj!k@e2F>i7JQioyj$xL*AuMIR_A>df2Kh8h`QH}MnN`9W`KjT%?F z)+DF`d2>Z}&gXmJ!2*4I44K?9t2hwV-NbQ?fO82P^g{A&3L6(QY|-^!4bA4+if*GU zKLSrxJ2yzKj&zAbvv_N7kkoglidM8-e>ulVW{Eczu2rAfuT7q?CngLs&BxiP7}d`; z^G(1yem0-VO1eLj79Pg=RX*>#4vL-m3FFh zg5kruUnAGquUvMiDgAF~f}{w3zrrIarYl|}y3h4YSLxrOa0giPK5yOph1|77Q{%t&=N=qNVX{{2T) zZ6{c67d@m0^J%c-fqJZSMPKR zHuaE3auxELZ@kz+#v@In31W~hMDt5YUM~(-%vm;%MpTY;th+jeOpJ`@S2iKiz^C7}Og>=>`H^xP!f&9@)uA|#(pjdH;%QkhtcJPRFCEf!u6J_u9o zjXtZQyMa@4QH4Wh=e%s)rY{v%-e+Bt0H={%bNh`*16w92^r4Il%t?;hYK*BXD3~UC zf#CB4RweS@*Wz{MhE_+oBv~UTf$ZMzNkA1bERrB>k?^PUVt{!SuPEI-Bo!9*94b*c z^k6JJo_#1hOHs&%8BJl>98(bXGI#No+Wc*`z$??om0SKbx6X(wLMEDz<25%Ycy5R- z+FUB8r8`=ULX{-)of7e~+l0O9yGjs1_q+xn5&i(xOjk|63kaPZeNDiSB|Jt( zj*+-lb+_R{6u&UMQ@yetf=+lzbDJ@%I4}4Z=V{tvW6S0mAWby$Xd)lU6>Ui{(vhgd zsxq2G!|3B_j@4jG((O5IWm9k`@T;bNnuwgDC9o@dS`O^=?+71e(0lCny1ea|Su8g^ zd1zAihRE&n`k1dEPIE*rTMpCngwvln2-o(2xLA>z!lM-4x5kpXQ{FMiAZ3vdbF{oU z_dMxd9Dz|FZeeLJn=!t{YWsx}fwa4~oZJ4}YSNSdmtUC~gimleqZfVE!NKrqE-ZX= z1rqOf81&D<-~Ukt#&&|zK(Z)gHNSuKkScRz#4^OId+1j@ef@7UK|=)5N@;rjUzRGD z_}kycZzu?mfWk9#9wK-WwG2p%x@yGBSBJ1xUDPAlS@Js1n_{SE7q_qqQSv~&Z z&;MfgDC#E{s}cSg0qzc&rt}-H*gLm(ncRn;ewV2IfQtju zS82(%r+7ak@)d+o6F%*uz$x*ihVmg#9Ym?iOv^A9gRpn|%2HK(yLr3so1b9VQVwbR z@FmC&rZ-5~5&tN}CP5$~P`Ldew(1KnC`C*Qj8>u@F!uBMRs2c_{})`5Ow&ZVvK0*O zRPqu48QLqsYf@7k*c&mN5OBU|ET$saJ@sn*MK|EB)M`xQ_MU#zuiAzCP;vWFziKb- zLj9-MKT#*@Aii{;sF3ll>UOcnyWw1tDj3Ket1ya&Bjp6S=1|j6&p&@IFB#!3X;VoA zhI3(-yv2Nv);#0abRlUYv)4QA1cLF@Ez;XfsHbGTye%l5$=%xbYRgn{AP{jOG?z*t zCi=NjcxZ((B@h!A3;Qy0MD_9x;zB0$u*SgehV(H{8ByjW;dH3>Z2)_=IQi4A^XL_& zB0`H*$5ZTxwGi-x6=zZIQ#BH-*y%B3%TY_v(YRcpuYj|F$v__!;z5t2G0z!WN@Eu# zJr=~m{~%L>6{mahVSrJDZ%NSh;N78}uHe_>y{|PB6C%5SHQT&fx`yi~rG^?46JNQm zFx1rUB}${#pXE3DBd$?gR}KB4R7tNh$-Jx)-zYalW6t4En*;D^g(+3C`{uq2eJP3zWKe~G{)r! z@iYLa*Lva->>j`d8_l}kfHY*2xd03!TvLdZXDJD>5x$_|$$isrs3t zaotCkK|ZXkmMid;fArveL^*9q3mj$ZIV#vtku^ju`ns^NV&tE%*PiDYaRugMPK04wg39rM>?Qm!c1G}zS~6C1J)sgWpvk_CD$qp~zo5_zM*<|d z4iPoYher_|qB-%rimEyXUspvX%gFJpX7#)8D~n}Hx(>6yG2rd1|0k;zr_=x0X=83y L0000CLjGoE&y@FX diff --git a/samples/Javascript/CrystalCraze/proj.mac/Icon.icns.REMOVED.git-id b/samples/Javascript/CrystalCraze/proj.mac/Icon.icns.REMOVED.git-id new file mode 100644 index 0000000000..9874ec6979 --- /dev/null +++ b/samples/Javascript/CrystalCraze/proj.mac/Icon.icns.REMOVED.git-id @@ -0,0 +1 @@ +3d09e8fb4f4ca1c1ae7ab0a6948db592c7c3d9a0 \ No newline at end of file diff --git a/samples/Javascript/MoonWarriors/proj.mac/Icon.icns b/samples/Javascript/MoonWarriors/proj.mac/Icon.icns deleted file mode 100644 index 285dee82b3d3f80acf3c0037b6b6ce35df0e9e5c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 77152 zcmeFZXIxat_Ab0T(TVPcCg&WwF((wvIgtbb0l@$Yf+$9U!rtBFj7Ss^6+xmXS&|aF z0l}Pe9`lUjIL3ZgHO@J6=AQq(U*1pmcR^-g*WPQbTD7Y7s%Jgb0ULvNVx+O_0(MTG zgkcnJ)SEEf@#a<*=Hn~`LW^;F@yiUYEQJKZ+=Qc z@;C=Ct#KBLYV?`;X4u#qA!fFSC$v=LaWrsMs`_?qirQk9g*k`KC#_sfo*6ckVr!*o zZp=~SaF|Yk>zo}H3pfV)h8!M;qew9xD=_6Vb+mO2tr;9eHk(9MpeQIQtLrF7eY@Q^ z*gw=Gx!N@-kqq=bywpD+8SEYKE4bA)B$W>Ib@aj2;qLifao4*CCDMUYOsqAiFMWCN%jT>Ly@S&1;^L0ra@nm@kJ?xIfsBN-+{E3|Q}16qt4&(a zE0u=FhN~T`t-ly|wK93@k*hsXK@kDts@odtvO3};Lz1ubcyISyU*j_;xh`qk@~sDM zbg%O9Se|Ku2@aZLMy?xr`t9vJCPy+o-5q`0S<5H1x7jaSJ$1Rm1aE(jaZ@J8*VowD ztypEb%*Vxf!R$$%1v#ZF?d?{s)HfMtF~)R}I3_)J%QCy=v#d4wn(CHzUVFtcI^W+s zc>Lh$-G}dPJ$?A-@q>5p--l1`J>FjX@zzuPQPjhm_a8pK|NQO}&%9snJbC!&(eUNF z_n+Mg2!9oF@b}wrbGP)um8V-Sd<74j_~qV{N6qIt?-FIQo2MSOuiW+ft*15h%@yJO zr{BMLTAR4!-lIoHYV!1t*VbQ>d!X^%ovh=DV{6(PkOQK&7rwodc!=<=@t&1bpEzcD z;IR+uZWGBd&gsYlW|-mXZTB8TMkFtaV6F9X+~C1lHvQJM$j~^irH&K90~4l9K7M5& zGBP}7?&9^US1+7BVb{5)zOcy1h<%fc$Cz1}t*tC?IFlK^KXikem9CM|%)rRQ<&`_9 zZwUU_irEm-6;R4qAKEDgNKR6pUcO zi4|y=nwmk2Kp?cVG9zc~KJ@A0HnK5DiV>(8n?Rd6TAqa1soPDmPp_InFv~cBhLMrH z$h-G^55C@ge>10SJ;t^W3v_jK zboC6hEjZJkJdZyA{Qi?0Pai%k%1v5i2y2-T7wBqf>*(mSjIsFN$|j$^bLGbM>sRlV zXNba<(6lpH0s{`0$K!JpBeUEw1&oTh7umyqY1ndmjG`(q7YJ~UE{~&%xgK=G z$P9gKcHSJ!kdBd-EHzayLlFS&TtyX%8L@+hX^g{GrL4rp^D&;|YIVN35!@l-Xe;u_ zt8hCIYJ_jurvX;Xa5JWvz>CS$47DoJ)OMeivR)A}M`9GJO8r(10XX${3KmkiERxI|!GV1AP~cRX;c@9hAgK6(j?_53WiF z#8S3ou;)q=lkLQ=2nP4T*{LSbziMC$2QA$sT{e|Jp?*5Pc<~Ro$ZmpJM-d6X7b*Gk5@7| zrI&h!K)hB(^{K{|_H&Z{p>}%Zy$0FmXKe+%rs2LpiCC&tQdW7guBr8G=dfY4?CG~J zf66*K5(Sm{O>Pc$>;35TiNBuFk!!BfRK76 zB&TQPrPT&ad-fD&?Y$>Ao;yME

DIFU*Fwvw&PsdsixNYgCbE#(d^=@ zJ&6K6Ah~Ftfg*`gDEL;`xDF3udR>IR^%=_YK^Ho4eNJ=Gw1X>6TP+ zygb&$dde)f{KfG%PUdrl2ma4r7&R@q;w%_w@9668%P~bN4VxFNLk^I( zNhJ1m_Rh{5v>Y;>FiJq5kxj16xFH`Bb>1o?gN7yu7DIbGJBJl(CmG>Ed{WA1ixsI0 zCd(o)m1S!*wl-HZHMiRnb~-Dac=r2OVl1l3{>|Y!Y&vPmnla-lj#gElZnVekbnTbB zOjPy_T0hTezrW{};0cpwIn3oH9xg{b~m7}?lNm@>u2#zb{P z%>KBzBosCdjv#ya;0|tjC)e=_%96 zWGYMBYRvTIuKs%?A!?Ei9a-YE0=Lsxv2@A2Su<^IY-Y_{xYXHe!(s{&-#&XB{fPbW>7BQy znd0}4?mvAH_lW%X!NVAI@xkp0{28}i-g)*Q_7UarjXU?nk2nvW-Fbdj?eu1zpWc1d!%hk<`2A`ox9#S=+j_b5_Ks5;Sx1>q3~h=`qR90iSO?gZ5*`tIFDhwv!sJWW)RR-!nIICZw*A z?G_f7meg8f3y0g}GdFvFO@C|6{upuE^o!3PJbv^jH@~>3a>|szzR{VRej3eOu{fk? zPQyEt9cN}0WY>%hPCeY3u_55+%w04uXlvoD;!h~QPD#s2tD5dyo13%Jarx?`%F>D$ zr>T=?x*b}4=vUMp6_=QicznfzlZSRLRcC5@z|36*Gk5xej48!m(GB95q_}*4n7M&y z=Bh>I?Um2m1yR;V&)x(BBcq~YQlc~>GFM?t1s>*7unglV(6G6|dX%td*B(9Gzdurp zXIR)}IbzhU1Ew%@Ctln@rp$9TG`)2B`mMVL`}gmQ3Qu)35CtkzGQJ5{q%E+PMPVvS zJ=DZE`mbERLG0Iw+(&5IMXtaU=_dRA!*zK~(i9KjjKOn*gCm#m{kr?2!eX7cn_%WT z?(_Ey3?4sersG_G#kr0i2prLV?WnN0@fz!WcL%w+FLQ#4yJ7(&zN49YKYsh)#_tc= z=YQ;K|I@p&@0GIu+=u^X`gm55Il;RVKz|Hb!GCUI{3!$~s9odZg zyctGgEXxHanuDPRdL^=KFgBk>F^&%kZw<9HXW#t4Pg0+yu-?A0)gOjk2)70`s^EXP_})d;9U zO9ncH6xP5lU!V*yivpcW##n0RX9Ofm3&OGrv{~wa<|#r<0msNn zrdBPe1-GmgC?N%Om&5?{sv{{ISXea)aA>I!@HiOBxZ`z*9!4Tz3~ftcqX08UO;zA8 zKFBZraX!kL0(()KmbtJ28VS%?w`^e^M&>2-Q1oM}D`tw|6dD2ueg@kbp1;SbZVMYN214Pm+Ei5esmWKqomO?WX zGDc=G$QToI|MW@rOG{N%>=ZH?g3Jgcn-XRs=!3{IPe8UZ<>MqRrD^U0jEyb2122S| z)fJUViz(m>wmxz-W-9u5d$zz>C^Y4hV1K-*XTJsX*t+{q+4oO9MJKBdE+K(~So#7O zOB@ss<_Z=T<`x#n`3D6i@Ei|1N?F+{TZ@g2+l0j;{OC!2$;pZXc5HZ(Z2)5=l0S%g zeNbR*!iN2~(uQH#g9%vH%MTOR$iB#ae7{~@SyPqch>!t}QMG_%VuG7SgEr*Sbb*=B zoC7WN&6i}qp4Q{v{UW;%bL9t2l8=2QRW+3dmtx>Ij!6|fXNtp!sW9_WU7xP+eA8U6#2VJVN4`354YW%$P7iwvKu+QJ^j~Q--Lc z?6~s{o}S2gfac|wFFyzw_w$9)6IC^32bWMFKDZVY0*bMTF+7fZL^79;F>VPl zNcN_z`D>Dl_pb4HWo1>>abgTerRiFh2}nl9IH<+{_9!7x)@Q+^)A~>j@m=<^>sJ}{ z7yA(-<9)ePQ4SI+5AT5~g)t4w1friti_LKGx7d;?5SVZ<1|}T*O30``WFMb@iI$Om z{D_t*ed;Q&0PU590V*((TvGrEG2vkW$E)xiz|qrU84ZBa zx9At8A5UseR8>@0mgTL{0y!!cfN)t@6bUGXMuvt2_~G9^WLsLQU>Hq1KhBj@R#sG2o+#X^54}<{7YYp&6pVymj=nx_ zK>X|(@)2&%GzI^V)X#kV_ATM7;+JoqWiL`RF!iE0KfVxOHNM}jI#zk2yu9LQfsZ;B zBl888np8}8j9e69AO=yR?iQIbv`~;FfB5z}@lVB1pZ}0Ong@Sd+?IVN{?z>XYy08y z(z3D>WqGNKAV_J3LOzD6SqcvcMEZo>B;+H)lnoG@5gTUu{HwB$NuM}>{P|IK*K|zL zUiHZ5-#_A?Xn%gYSWCH8ekPk zPmlO13mK*e@UR|@j2R`p`TFhy{u}md{BP>NetEsa@5-ld5AdK{U*G@s+lLSD&K4az zLL8+Y$&YrTM8iU0a!5eY)BQ`7n?zrKC<_T#nE!eZixLP_qyFg}SS!pIaYVZMN*3y9xeP7}d&W1DHidZi@( z_4ikAU*m7E*Ku#u-@g8>>C~UE-o1VG`QgaxH*ep(dH3tn#yoK`?Qj<1ijl-HltNh9 zaa}?#O9TT+7^|8X@nOBTd-VRzO8~K6zIyW-_8l>=)Ly)N^ZGTq^!jJRtG7di1)?Ha zao&NwW^|CoHU()SkT&Wy6c&6F4JrlGEPwz0=`YWpzxd^sH?Mw)f5H6aS<8&wN>siQ4|eu`lXNQN+=s>X(B*Xi{7mlsc; zJ$wG-}k?7%Bu$eXXW$q3bPZ!Cr~l24iA=afn}}$)5UcNT@lzt z7>EpUBUKc}lZ)Ozc?{o=p8s-YUD~r3kJFxDPsLAYkDos7%*+wx^78W1qc-YN#yi-M zF$H5wVU9qggL)^@rx+L-fFLzvF3ixim!ASQ^5D^<=Z_aFrQUn-Am<_V!PCLKOi>Om zJNIC8h0rHyYT>XlFbs6)7}+@c+Z8#Vin_LfKwi1 z-KRge`{de*w5)6*i<6y|DsnXO%kWWvS2J{pqOGN^jmstB`eZIk2RC3D8X76VTn{|| z>@I$XefR#;5>?D7;?~n!cjNBR?%us~`_A3iI|{cS+-^=ico1YB%svo1&j>%d6_$O5 zc`n$dg@bj-Q#5@ZNf|8^8hT8O#Ljwg^UkeXw{JY}oU4rKZM*XL#_fb#dgFD2bhtn7Q$=+NlO#g zB0wOntE8vLgSWb_zP=tC0wVO%E&M9y+LcG$Zj?O(6D`i)xpFP;D*f6uN!#U{SFXie zrCqss@pw`yk;Y5SIJjnd^uhG>b>JvPBo@~sX=#b&-8KNBBxOB)Z8}WN0}n4;y?pt~ z#ryfRt=Dggg|&AsUX8iTymINr%`id#?Tc4pF4HbuzgU%+jHf82CTAqr`KDzgXKn`> zbYqY!0&7Je)<{Z`*Ho!)SN_~M0&BR6_{Jce&vz2gyo`O?L>3kp}R8DcdT zuf$!TUcPWDA(2SpB_>DjNK8peN(+O{JypjN9H60rYl^@HgbrDcN5U~3MIDr)?j5;w zVPyEi(7k-s?0Z8Ou9W5WT^YU*J;FYJWu!`#6w-U+{Dooh2yOVna6@83Od>leF)=A6 zY7r!vd~>;2ktQJ*OX7l5Eeclw64avW(!s%j^MfNnd-^X93=Iu*OV39Sat4MZSEW95 z%&_f-bZ9^{h!0WDw~0=w8=WiQpkwOn8uFIkv<9DPamo(IXl?b-;ejj_p=A3MS2QjIGZ{y^h)u5rbN=) zCzYPd6i3I$Fk@qU)gY+!kW4~-)J$BP0~tE3t{_o6p-0+F^icYn+WLqdqBpunr@Oc7 zd`B2>O5q~K!xy^yx_f%Mr41*$CEd9qB3{gljtMe_w~)2~S*fOmtBd4za<#c&Argxj z=J$1Xi@L~X&vhqvanE(18)&mp7u`BMcVm5jH_^rDZ^*5Zb{!(3;zTS$934EF1&NrY z@Sp(yw=~#%U`FF%z%5VqwV&-EI`Ol~ow|VJ_cv(IX*nw`-+Z9I{cLCF+0Krv)Yk5z zsQpAN&Wa-Nka>_MsF;H^LXD8yrlh5XmM*7VurXTJ*w@R&^R_@9b@= z>1fA0Se@I~=tSkBegBQ9G6@qr?^jkyKT2xh#<;hYKe86)vEw1vmAyw8giI z+M-)IXWEjqhDLj5G}msrp{_n*ukQx zhtEsLnE$mElLsMguxKX*O;Y>|(cyww+SX5+0csTsSBbfUlLR@tqP7FadNmT_` z6~O?BHCS8{8CzV?-aJpY7_S%CaqF9#PaG77hejq8oNQ@4jn~oZ>l*S8G}oVwt>c}p z>!=lbxw$&Jcm?c@2-_bH*l`ZwB zPM?B*ryFb11Kn0GUADq$U07ai(`oz^?ewXVWA&%wPAN6kmnV2kojhUUq$zV(1%!t0 zCHAoP?%nQY4y%to5{~f+6%lxaQ0HkV!NqAwEw!y-7I7^#wfIT;sk)>4-Bzq}!`E=# zoL8-nK2mr3Zp-TDn1 zd^h-P&aNnrKf$diB{q0(@ZIP#XYO41htH@27}9#d*|y!?2)pRd2)raP+`!)&xvhcyH9t~q+_*wK=bV@FDl?OW@! zVg1HUn_cGHOr17!k$X_EzyGGFqOzEyn#W2GZuRpI2==wNF*h+2Oq{cL!Myo%XU+4* zgXvp0Iaz_jwUJkpaAlEPK3h#qT@e-_w-d!jit!_Q#lr+xte1aEnTp1-W;bb!9hX3_7*ULI+oA{ zLWuz9Q&jjW;3S3`2Ubjn;={$F!#YQbV|~|e+T!n^35zHRp%SopwcD~IFe2}$_%OS; zIAzWQ=dail6d1VC-W1XrT>$}`eT+vajXH{@s>XwuUwELX zumCSqEGWtk-LyF<&_NY;^dgLnbntAq?%9=CR6rE63yQKMcI{m&fcXw@Fr1`{>CIiS zc;V7@fm;IBuP`8y$oc|v*jc9vNW7maL@Ep=&^tBi@S!|BpOtqgGi1w_9WLq^B@UyL zD3ry!LicBh@|k%BiD99BdQ=iA7E=L1rpuNuS>mxdV6)FsSh_$i0dPo)0RNX*1sD<| zzr%S%j$(Fh%C_Jg{u5zkz(~>XgJU#?bLjp=Xk_K)#72a`(h6_)cua{oX2pu7E)Yjv z3sqsQH?Ty2RI)$>VhI>oT!jYd9c_65k;Oikl@+&rTj(MNJeq(3#=u-hhz`QlgE?t& zq01mgO~f=vnBsz!E1cGE+PG#mz%(pFgxr{$fzU(&iOUu7L?D;oGgK8}gEu|<;6Xf- zaqwXD&YjzY7%2tg(H8AZ$T*mpc_1q>CK!^{6ikgi*}=il$8Uq{bcipmvAMaKu8M}4 z7@!VABX;7F{>t?W}7395s5O0S#$!%j*H%IF_YcucIw3>hxQ)Tr738SBFDpur}K z5aUq?qO28gOo60iVr6Bj6oaXOXJ&eOInOq>oVv(;3QQ%Yo|);tkg+&$xrm2@0uBjw ztHC0WAB9J!3NU~I#F!x;LCjYCpIwL&MeWZZY#~X;6wCmU9%D+2#sEN3T;{cA(e#Bb zYu7I4!%D0s`Y9i`Oq9!4QRcx=Gw19Rp^_kxV?8QeO;;!s2!)0ai~tB6ihx>RO59>P zj?t9`Rs#5^9E|};tF*>*^(t34m(?zYpqQm+3iuX+TX74LrDc*lX81}<=oO$56cru; zNlW@>b+kOF>4FR^D}9hpC9ld4g{HU^X9mdUS|a(DJg}aO>2CCJTIKBQ;sQH7GNx)Y z3Ra2C$pBWRzyPT5cuI;WqMX7aLPPh2#UxnErE@LDf((R1QOvd<*t0im@BRb6EF4x9 zL&Az=M2o?cSaUbHIjnMYT(v?MRxFmT2``E2SB!OHSiOFS=Af6RzTaN5SDaN+6=(f$9RTvP!oAX1ZWwOtIFfT;)0p_?%lp)`}W=0n-$O-N*-tc zY|TzRv~7Dx$o6gF*khUpf}_khuB?Btnp=$P_or=B(gy0jDEjvx2s63E1Ml zIV;DS4d^zNLMBsaVA;&t6T$ugTebuQZVB3uSS!+o5u%XcElYt>QLqnmS+Hcu(q&U& zSAi)2f+3Q_qzF95&2nLJfsg?5&ej0jpWz#nRpDx(gx+;52!D%dm8Xdf0hhWm}Y3h!(=7Be}RD_6AA!$W_cU~MYL4tyZUeT^YdLF7++K3 zH(6k;r*CQHTG&;NuiHrY>1|r)v2L?>P)Kw9f7{i^JmSSKX2Z2Bl$|D zN&t{Hin5A~$-q-Q#F@{gL9i*#+pxjgXRVLV8V|n^JRvb^lZTg=kB_%ETymW|*L|J$ zdbfqMXU zlmIju#Uu$sk`Y8P4w8)vI9x?2RFN>%`5sah?&?dVkUDIP@!hdvYn(0?xT{qTDm_$z`x+(0uF`CVW9UKW3I=VHSRHP%I+?+ zr`j%c@o-&iJ!8faSEt$52{yPb#d@4B+(rf&e?fohr zi(HglS1-4jK7F3UGU(ilCCg@6+r-RZPKV!ZrcV)Sp)Qg+nh0teg%go1!ssxEtVjnf z3M}JA_RcQO;#Eq{tL9oyn>J&{G;8bWHq)nBPm8f8rcHHoS*Vdk6#%k1nO>>V8DOh#g+5>v3LF;h6xrcD}aWg=fv zFq$&)6Pg;uS&=ozII2tvhJILwXl1I&BEzDqprQeA z$*2)%+)+4@3=K;-d^RK$@H|7ycnmx+ZN{uQ(-J1)lXw%ygJLZu8fql7`2Zat1Ph^U zqYlLlO5{UJ5y6tKVJsvj&?ZhCKYqga*a`IUa417xodZo&Do0iQU(fzEuw+96ZV9k# z*$kRoIYw62w-8#59XEc$1o1e=*s)fYCi)u6kaN+=bgqi33c`DEFaTggG#aS?IP?JH z7H|kfCYuG{K&eHPTOqiDuB57CXo8YvNTiGn^)!{(Xm^BGaWaj`Q&NJg4>m%upChUN zg!@Ki68ab`3nZ$rfuRc$nJgxQ$z;$O3N)0O5hMdNZ(xCD{C&3lOV(PzTkr)h| zPRNB(DDbYqVZ(xxXk-eNN~7TlnshK8Nrk>cdI~<}^HmX-`Cs@c8~Sa??R?8nW$+YJ zVV4rg>x!u8)#T4-_p5@ z=_n}6?Nx%2hoNG!Mu&<4{ROMVP<@C6p(JE1PRGEbWN-m4_W=(@00aQ+w?%S$`M~ei z);8o@VJ$LVrwK!asmx7}Zx4I>rPU3M@r57~nc8mjj6; zu1rNy&KCigGb&0=TT{(S#o)@1KV`>cU;cbG4WlWkakq6E&z z<*3IfiiNzSuC1vH$F)BG{{6SlKYja~M=WWOW++IQLK&$6%2J1}Jyw;56~@z1Td{2>)Jbpi$(jvc6LsTg1_&txyp zBfbp>m4M&=D*N`e3r=Yblt@VuNegh}`v-auBknsPV|`MRnK~N5cFeH+r{sluIt3}EI zqWob02-M#@Zrtu2I3Z<82BZT`CgTh121d?EIRgXI!QKmh%KHB78Xg)blPUrtf4+Ss zOJ(DUuED`G!0#Uz>3S#oZD{yXrIg)&z5`dqm>PIn?_i6RJs`PwvH#C+z2`6V50oRa z{<$n2jEXUr7xsZxNu!h|89IONcPTzlDOHvX_SKp|0*-OU2Q&dgUm|G$ONWOf{R0;z zaD&o-w8sMWMX<1II2XXFxPb;K9onV6{pTgsQstq3dq^E=bQ%?#?AI;@Z`Ml{1_vbF zebW9aDPMBFD<0qzAoVbz3}Jr?1lOa2g0!o*_)F8rQ~)3g~TAuEa)AokZOU5Q+4$q1Zo7xTR&|8BMwMS2Zl~N0Rr$3hSB4O zBjr8!leNi;*qkH1gXL0f5K?=puCBfTq#!Z!K?PgD>1k36$&eHXUNlT;Vv!?^{HMX=c7sMo37zaZl8E#qwtf&9NTT=Rbv9!Fr z=KQNzIuqmA!5N_AFwRnGIY9E&HK^O*KnMo#Ac}MO>;XGtrOLzg9ss`oCy_~Yl*m+4 zb?289J{alR1t(V|N2SIf@kBYm{QvGc3NVN-7+dIiFSs&V${cFn1yk!E{3ibQdu0_> zCACi;?Promygi-6{R2m(HXyMKv05stLFOsccNBBTOu3yX=HR#zR4WJila(Oi=3V<6 z^+_2~pQ?`6y}Ij)AgQ!2sD(PE&bQ4OK41 zIRBk9b)vGO>d3%{GiD^1L=ERfQqs`iA?YNLeDoN|E(I?GBMZU-M32V)XgGkIyI~RS zaE1j#|9@suRaTuSx%g-9IEa4F4g$`6wVWN0E2 z?}QNU>Goz*sQ-;$r3L&da7yXP+ux#@;I|#pfx*6!ki?DRYr!B(-#xddjw|{W1w19I}3S7prmbbrcgLybJ2Tq)I*|@_Boh#J` z*#!kf$oOL=P_jV-3lW1ROFdc|@G~4_eBClwjs6=Gi~PsAV|b-Xd1=@0ZMFa{d9@5k z@=Z7e7bF8Ya^d;;1%+Vyk)z1@KfMpW0q-|7;?0U@&U7}o!qWafu(Py)omEnCqP+CT z;Fl9)m>ADpGO$M#i@(wj;>UvRd3lEl3XuXdyl8Ys1OBh|qq(I%&II~A%Gu)l2WRUu z{-@SY($=1(^_(19Xwavnw*cW6X1kS(}BfV#(ZH-^{=KaZrtIw{S{%FfBnKU7cv9e@!=@m~gE2I3+9Po1t$(gU%Xo8(Nd;9FmR{fp^E9OV@sef%~TfPdH>kuaC4!5q2h%*=yXV0#`&FFbs> z_$V^ItPGq3%i_tC^+nF$bVUDp_crmJ##=e{>)elD-+q0F|Bd=3DrV%J`SQ?|Lcw5< zN9BhPO9ry!;hvEJ^0RV~`+pAa(GsB6$=zR5)gT6tOey-;4=>?l`5XK->CKzy*XnOx z|Jr!!)62JSUjF%D7_Ps5{pLLo!idB4!o&I3K9nMy5>m5GgZ-dH2<}Nu%Q%pkiMjz! zk`Hn*ic;jG%F3E!ez4ZsJpgg|D+=O?#l7OZ{^jLcIL8hrmS4Sj1=snnU%nYAJXBa% zR8W*v{`%PxKrvyF%D=P@WbQBi(sFOb7EPrQ8#Rp2xkQAodvkf-Gl`(SCXU_GWpG=n$_kty}iM7KQ23|%(bJ(j+d5~6*)o=9AEwN{OQvt&qnEFFP_Ff!=8$s;ZKQYw5LyB-mlBV z^HlP43)0J8yxXXVDd_|3U_0192-(PFke`^8oRX53egG*zu_X6X5iCV8+?87mXyi$S z@1Hz+{P6L^r!RnJ_VjuBBMeU0QJ*~OKqNDz?5ytZ=jUM)+!iQc1{K}sL99B6O-M+B zauN6+EQcVK&jGwh8)EeMk!tkb_{lnZ`0&}oMM`ORUp&ZuNPG0)=}>Mak)xcQn|AE+ z=SY?}0v&nOO%57Gl0R5cY?%r(iT@&WjtjZr;3g z{n<}$+N0~Y5^j=j-MtlmlY0AhcX~RJp`4zXl6%?9ETQa>4+S$ThI7IPq-Nj{ktjMQ zHa0#H+yaA$!X$4AW)yNbzaY<79m5=2pIjrZvv1wXkn_|o-M<3-G=*!|Ze71|?OH7S zc55geXwPAIgbq6U>KhU%nQ5m44;gwf?qCH?9D2?b?-_7fO;usr;0*OqXfmY@)u5 zNyBV9hG2)5F3;>EqX5&Q}fKui5~}~{)`7BS1w(;eBmC@*sk3W z2~Xa>csb@0^YX>(H$nxy@;_)7uZ>hCB;hH1D0(KW+?ad-uR3i{!>no`Ng3@2oKTCx zMItdGWuXvCPRUpXGtFR2);1H2WL{UqEp5col!{`p*B3(zv49{He9}*AXgVdqc#Mn4-JTD<0f-|bInM1** z*2C&Nsw6b@ry87y#$$A#N2#!%L5c7U_edp&bQP=={n{^di~H!^u!%i;KqQWhRusqW zuIOIK!Sr$=-5r&`Yj@~gc_&7P1ym$1L_I*|Ded@fNe|IY>1%B56?Nl1(cQXTJ?Dnn zfgo3~NU><7s~2_-UH$bnU6QUG0*8{XA`!FuNY@SnOed~u05qUPcIVFBd-jHg;Sr>L zkvOgdL!Yn!JcNKypv(21Bf4nk&OvT}E~$%iuKTRC)mELjSu|(k>3*V%d9JrEyFzj< zACHO!6imD~``jTRrXA5Sm;w7csWc>H*DksAaNvZ=M>}=_EJDU|_FPS0TW1H}iOGMG z5QDD0uU>mjbEl+i^MSrLpwD%7wjWGxIae69ACHM*M-pN29i3A#4gcn$40#M~581I} z=PqP@7@XeZL*T|NfHm0(KIKSZX_vwqbRJP zvnVnGQQ*SyGgoaf6_-=Pqe8a^L&*@Njygpd>=w_5HNvj|G3y$;np@+~h+3o1Fk9N1 z`tlaUcekFw+prem46C)Jqbxk8`e;SR|H=Gy5k?M>0my09&6Mtiho*r~Ok-CEO``tFpCRcD&uQgkz`v7?#@ z%`Dg-8W9#7!4BWm@Om-EHYvH-4=Nbo?=68_w+3&+cW5B5>^62g z-B#BqZs0c7H=Jo}hMj$DTQh9U@dj4Y>9(}cX1Lxk+TK!~6edmy4~GxV2@Au+i7-}3 z?XN2_CcWr#A1E>eMNmsbnqUB+KYL*S_U*F=>i^H55krn*zHrwvb?Zm$)4xH#K6t=YUcA{1;54c)spxcZ$pWMf%Z`v%kG zlWVj8mcT%8n_LefxP^zUf};wvGTIt)%vLnj)e@()YELy(CHvVgm@{YI68BwMH4Ud= zPhMMFa-=TylyPlsV_jM7YN#~`t;X3p`iF*t^MNY2wes~2sI_NYMw(EdZrbc05CEz` z7sM2b*}Wc`7&axT`Q({U^VsIMDD*fwI;~peuzX{7bv0f^sjjZ7imqf0(&S5K=Y)lx^7P>jym>RR>|cW7kf96O632tFf%A z>d4ytH76j+J{GuaC1`PWCRQ_CS35iSWRzC|r_QvzvNY7$!FBagYp9q_pKfhEZQ@j~ z9Xms|hxi|R6mJN6;Psj&M^)Bu*tiiXf~W`#LZh`aWE)^I=~Gv1*}gT{ujqCR=!%AvJ54$V zbfK#2`i;K6en=Y%jP1dD#)B^Js^VjiwH`ZqQJP0T=#q(4;-FnM^cUF+=) z>xB1^lcW*ojnt7@n4^RWi!yU5{A0^0I^Ay>qG2P7y_Sl>*Wyw zu^6<~38-NU(hCmdlG&X<^#7i|5Um@8!Q~UG4=pNPSa>&i2BaRSI|;!q0%t3i`mCKI@>!5AO8e65wTu zVUzb4=H=kItem{GE%50n4r&-B9_oga`N1J!2l9wqW=?)wNXR-J*g3{RsY%Od!Qut; zT>SjjHbI_iV#&FoNCpJfv#XLyt4E&21sKXF0S-ik;qwl($9vfifG0v3Yp7zc&jm_ueNOG*aL#v!!R=dKqfr+_xtq+$c0Txu~sjE9oTu+z@5SV_BMifkK zV|p4&c9Zas@Cg_crOnAu6=k9lEM0+0qAnrgQenpypR@@+V~VQ4fCeZ`1HXpA41v0_ z*v`?*c~3#GE*!ZLsDmq3G;DuiHTfI`vWiDK9y=y3Uc8b{Ve{1V;OwnXU!4b)2DyI5R3}$Y zdvT5-3R~al(a|x{ z;(gooAvpvYG?t34r7~5Gs%&YX!lGfz4v1qQ@r_!jK;vncm??1BG&oJjV?aF|`l~R} z$=%I8F@+855xi^7V;j%>gpUy-jY>(dJ+>Fwg~J;aUUVqX(HqFqXO#dBr+JFwU`K_E zqjni0-;<~eo{pvI+SJkm8>}o1xr&(00V0|pQufcJF*QsqCx;zA95&g~RGm$O&V%yF ztJk=>Z}rAB$C&{-NM2K22N|3kx|f$s01}5)!#>(BR33XUn@1`4Uh`pbFu=u;INCVw zlaD)@#!@x2aBlk|`#i8}f(2>kP{>E{oavy zyannunWm^VMnCWM*U#TR70t2GRK{#FBO>=jq(s_MIVJ+PXEHb({nTrmAs?I$sudTx zyDhMu>)`1Llx+%i+v$^#-NE4v)N_RKB9ywf*FMgU3aXt};Vv7%>0V9(;9brRiwc7? z9Q!k-j4I}7j-Ajg`}XDg*Q={dbd<5V*^u3aC5RVMl?}&dyho?9-)BrQP(wTrV1>J^ zadvcZUFGa*0fTRwR96G|AOPejS;kxG@)A>bw|%@FAB{FdJDTjSGvP^%!2Nir_nv*p z8-RfgJ9Dn)IIH#_-@g9%^MbR9E{EovwFmf=;`miGC8G&RZ+?9J`r~!#WW%3&wb!{p z>^eHRIA{W4CAb{0XL;=hP=9$%1rGy}cdE+nn*$0c(~6{Ks|J8@hY<&b^}O zDWI23y-~ z|K^91J61PJ{AyFB9PM4FviHyEv^jF4E9{myyXsOf zwsS6Ii|7nDczCpsSb#_WFY#V~N28CvZDbdyS$C~PDn^+mB@fe7BY3}K^V(E&-E^BRIxiO3ZTpHkJ zgqNd2ncTHd%7FqD=+gtQ!kW2A9b$EH$kw2stpQO(U@NQZ;s$EEDm*fC@8SIc zfm?%s%$a$32~AN&9oOgRX{vIWRCrF)ar25L_);S;2NZ>y^Nz_Y81j-=Rn=$(5mhi+ zTI@6JEJ2;4F_>lI5#k@XC2&(}`aeL9@`?s3_JFd<_V$hr^C1_) zW^LKB*&leA8JX6=TvhvBt5IDB+w7F!1ubiDnc8h5Uhzzh61$FR|c$_yJ+D& zXP+6cyE9!9BYm_)?90i|8I{I46aua&bjm#gO6$5uu8p=pZvl z(bup5NV61qqCizJydlu@aFvrYx3;yhPP1aNvDR0Vm)9^c0PIvj&p<^^F-t*GUPemWYOm=Q2tj&X zY<4ExJRMM zB?Ac_g#6k@o7nt-;IHuHKoWD_Bf^Witd zH4RLlxgxcxshNd=yp*(bstk#=bec?xw2X|jjH0QZ{chl#Njc5p37K-DQjt$o6G~xd zkU{=Y=~`iE3UhN~na%J#Mo-Qrt^{#sVq$7)Y^;(cg^^B|5|Ne^moapAm8B;mA&31k z7J9>>94yN7BZq)L2);(zB9wqpfiR;fqE-$<{JcE<-$_t>vQ8XA86T6^@6mF~nAzGu z$)~6Hp1_dssMt6#hV&1VXD5mi#J~h;v=UcMYG7_rY8Gf}Vr*onr=z6_)VUG_wv3Df zxQvq)?h=qe5(?TaJ9Y_6NJ)tBb28FUQ^0d1{4Euepo)g3u7Rvu3 zxCFHLX>cMyOcBm8;^t6Zb)eGK%(BRAhbc@9)jDdb13|98^C2<1C|N) z2AGeike~n`?~d)9+t^rHpt&(T_ojd^Q%Q6P!9qbz%fQUa&bgh34;chJTvb!Y(8S!@ z-pSp2Pe5p7%zkV#tQtBqvj{sCC~&3a`STx)tW7Pz;4Tvs7@AO3i{>RIE-C{4x5S1GBXBk~sLr4052c8fyjD5|Jy1JZ6`>)`C}vo|m_A_nEX zlQuRP!d{SHSbQMkMa-h2laZxqzL@}V(I6NhL?B@+1i4^CMi1%QS<4Y(Bgczkf^9QtRCzl>RLJm zM#Qjmhp-F|jU-4O@$m%Ni5N1Oxmks&RV^R>}#&%n^c6dp%y9h_X;Js_V;$gc*6p|mkU8;Jwm0;xsGsTt`d$;nTDuB}(E zuYGy%Af#<+XKsOma{*^gYGwurjTBRy@g~?<43J?x-4s2XE>4e2SKq)Go+seO9iFz~ zu3{s*if&{B0&&3(@CE-$W8Tmn_fGfZK2F>|Cug?xm=xbWSmTuNW zFjQ#9PJEU`c|TO!4!2#9i}rz}w?8gG1fB|zMggt@Wd}w~NJ>tPkNeOPvJTx0QA5LT z-`Ce(j_O#On46!4O9kBGTiX(|P%bVww_T8gf*c|-uZej2s(f?iyd(8KV@^4t<`p$$*6u!sZ3 zp$AX3ur#;u{RjG0+BF#G=hF1b(#o@?wnfV2CH&&z!a~m?^~$rwmD!cGpV0b>dTnuL z^~EZFe!dk?F?;*Y%ED|fo^>9-^kQXx5gt$1SMRMa&nzzE=N1-P!2UeGC+0YC8}mJQ zmIe5&rN#LLcy+@3vow%&j~s*@~gzC?1<$?8VbAK>tgF7rd!ralRW*0fVi~d`($6hG(8%oE-#?8LEQhV~6Kwm*DVD zqeEU@UYJ{erpw3hj0^ZFBqG3F7l(V-^Vx-kGhlyybqPNUOvh3D7HAv1H0uDDRs!v; z9QkkoynhByxwtStGl!q+03*wj2e$+5EJC229d4{F&!53lEiU4xr{`v8ar1}qEb~h< zSA{lc=S`GUAtxU_g#)1hcTGK+o|&1Qn?HhQS;Wu6BO(uxcBZ8eJ2KJbrOuvL2GL|015R5Qt}1+rinTB6O&~jJpPX7cMwsU4z5CE{ z2)akpZX7op`22hso^Juadcz-4&-(u~Q~ZZ|-bA8vVrJY3%A7L32B zXA(#(SoO~>&L1Mo?arNHI5L>ueHe{!WD{^;)3{mKk8<#$3;5*`7wZ2Od*0+eGP^Y2 zhNpz%yLJ1{ZQNbVDDEE9eOPz!+2akL!69bh*%$CDclSaq_kV*ulQ1}p&%@5g3qwLh z!tFbE2p+r-E<_74J~=TtHI2e>c0Lo&v~tTAZg>B|o_|9B#{V08_I$DmTT?Tv8jLuE z7-Tf}5pd;izC@=G^5uLge$&!}G&slpFYuY=ckmg*lrg?Kw*coGITQK7>K%7e^m2&Q}w>-G2plbsG|)2quPy?*JJ^@c9E2#*cAN=%#0; z0_e&AN91!Vx{5u;)hy309Kh3qCCGULnvJx(K^#bT8>b0G3WOgTesXg5QL7-h{J$rk zb&t+3Pd(B09iLk~0NwrZcwl7c2&Dxu`VhDW`h8Im{WJCe_lO>iK5PqD!T$;Q95A{# ze|-1mF1Y+v5!`YSdQ7oF!k#FW5KwzUn4>tyJ)nE^@X3e|G_v>~lFv*&_=R*fO!cd| zMdI+l-1G?$N?xE}7aaaS2GEuSfjLqm1pCkbjC>};?CyH*iNPdJ;x~@|Jn%OHkOK$r z1MY+t7sVzDO>oftvHMT@_2~aU$Y)0DYryTv9Dh2$P>B}-*CQ?I0@NZ9W&kBezgB=4 z{P)N1q=Vo8$K*4k&n^@J@HT-;v{mAX)cr-m_{8ubR6D>56Ssu6otO>sIsYB&+i%Y! z_B{LoO)f(xzx{?jGd2>@XEFl%?9smfgVVy`XE(Hoi?~bMQOOZ3Fw#QNse5~Pc&yhG zPC@mR&#zv;%6rX^&}Z8LBKq9^Ti46RrpCtK;b+!t*b^%Vfz#cM>)AytFY4P^00@8L z={0<7tO{zF0Dk`P?Bzf3Gs8>N4U+&rf1SJg;w3=QWC(u7)l)arHPk%%@QZ%l2RE%1 zgjqmxoLKsUyTD2G6Ra~qR)p8N3}1=`7S3$`^}p!n?B{e(p8-=%grA=g;pbNXKSR>0 zuA%ZD_}S_D++qc~|HA{DM5sD}DxQlMFW@dw5`*bFZjk=w&}hMq{|bIiStUW8GdI}h zlp4l^wZ#BGBee-KB_jEFn1L*ePf$)kDFVR;v=dap1Y!|kIj#*2p7($WSVAw&#U;2K zCiK!=T}lV|83+HSE|V<5f4G*Go&y051b$6*UC{;s&CNuK(OiVfav5PUPITc;QbQgb zvpbNwJ}nTKtS)jJhcqNqGJbv z0v$eaV8Xd@5sKcBgRb|Fm_jW7BB1drcp#vm?*P4q}L}7ratYM<{l>cBx$qL-~txqI}p%Jm0fwwT0TIP44E8W>9Is?~Aa1l@m1 zKyy5qx>^i;eQ9Y)c|p|%0!@w)J_E1NE5!@IVG|Vw$j75{91z;hp6PSI2;~f1xO^cV zXd#P>{}F+nLkKhl5rNJer+EBmYPh;ErG%xpw5U8^!Mu`yKr_WYUV&SUV#56kC_o@$ zfOAl}5;*6~nLZ~B#^q%1w*1_MnA4D?8AUSVnxQ*pVi zTv`>8f!2Ps1h+`VgjL;86$phnxGp{jn_g!OIaOHC`NK-UKtn4}#6aJh+hCxfmFGVU z^w5*hvGn_tWA`2rdwCKeXy1Y|T*qm1N{sY1{QLrOfk9tF>3)J<2P+M8=>aPk!Su7) zq8L*7?iuLp2@v#vCqU4sv*-Q$_tHl)?ciISZX;Fc?uMVJgg)x<@zfK<7`yKo5@MZj;>_7`j8~ z{CV@iE$IBoePR5@om=U*Dem04n3o9*G$sd^MVp)4jTmUvn{ba=OgMoXAyZFK0gwcU zG{DX?$OwU6pf@=C2;NG0V}pT)54VSJ-bjZ+<(osqR-i{l;oIniV>fTy?k`HuOv_?G zs7UVquFKm=FoKsLzKZcX!DmpngOnJe6oYiRj?>5tVuCPik(ckL4w9qJptn*6Nv>bd z8l=5`>t^kCDlxh}mqxFp4pIa2bmInU44Roim!2JS3}Mi`$KZ{W#ptmMUsng6=!g>` z#PP9XC+%Q#7#sBoy?WzUpU~86FnY!{uB)g~XabRg-e?qh^~HAUkcpc0ce`|lnVervv~}yz-f#;ao_;%AT?Ao z5e^wTax=6YvxPy41a!~U-VFkpo=8CFT)S}o;-$U|h=4wSxjiAHqd7StDGN&*AK$Z} ziDA;Z1h-N}gcw1(2B8cNjf{f7^_UF|Odz03&LaYP2W;2C&j7%KE|rKi=sAD-T7ggJ zMfCApZ|b?tXD@Z2KBGx-iSgLP#DtVYx`c#i1VYmb_dcHkOX&JSD9J)<5~x17MkcV; z?g9XX>7nbe@`1FGK{aE0j$Ha9l4wC-gjV$hnL4G4p#@9AkP!tRTVNw4ngJ$n*& ziV8rP4GfwAVbG~gHdbbqPJS_o`(sk#=nw_{#sl`_!>?z+2ujnGp&B9NIwY&&>UT9X zHHAP?%mxL0?li)kPj;O=+nMKMs-dc;uICU{c>-FUc2S%}81%{XE*AI+0thWG0 zu9Ho1rkeUDIP=Y>h6avFbtg~4E_wXe(G%&%*-jik0WfrsnW6-=sF9Tx7glqRh>ea$ zF!Yh9`&mgbwNHP!57j>rl|K}698eNgmj?X_cjI~hh7Pc(JK53M(b-kEN7DekwQV!d z3Z@2Lz(T{z20D*-q<69b(9njpHa6Fm1t}Ah9%(TdtH|gm+&-GXL(7PTu7VrwBEpR} zlI;kp6e6B3tpuKFKYR$`&_~;kw1t~k*Z_5%Vn;*BDLdG@BOJP&{77qpqaDr(V~SHEg{*ms z0+Y0gZ$v~`_}-?u%pJeXNP-z8=pikVAXcME)l}80Lge_KY;A*WxUIFdy}j7M)ZPZv zZx?r*Cyke<8{n1>fd`MaX0*|?9&Sx@advZY@wCHfk|ViC8K=l7V;mF_9J;4rIvs3P zz};mLUIT1__65Q?K~F`(US-w6$`(y{X!Gc70_?iAwWaw`ON_NGfOT%}CaN+LQu6BN z-oEbcE^)Q(&1o$x&CPA4zOEjgzAgqbJ9&5oM3pqva4L-Q%C4ayA-;8wv2cr1hDUJ$ zIZ^ztsykdUBd`llUwNRS$qa22?F~(7joX^by=+{Z+&!!%Iq47{v6)NKG5}DF4EUyC zQv(puu08?Yx_nzv-!gJ~w%uxQS|}@;1%w9p)ILH)bk*V%ZoYt!&LC=FgrYEXgNAhI z8c(?GvuLQVPp#u@sK+@wx_WvV!f$~niT;CO*YgSRimGf(ucK+m-m^E@j(|hsfb!i+ zxm{5k1WtY55Pz?lhyDy?nA&A{kKSAXAuodj(v5;b@MRe+T;+jK=vb{&Qnx`vSBJZ} zd3!^9X95ikm$%LGz9GRGbp#r^t}H4j)Q%qjNzfHJLF(gB(bZ7bat-tY8rqSZ64SIg zF*`FmKR2ICFb66r7(`g>h87MRNwPdCMmA}KhCW#0@8KO_1_V$Rh8oaK&ET-OG9nJ0 z85ZUauQJ%cp|y3jH0}26@u<413juayWnyL{Ih9TDVLFJGMA03YLSa%?T3|>DICMP_ z&$LxJdwl}j#gL@?i-x8$4~x#MN~xf!sz{Cq_y>m;0)^AU+t>5JbrpE?%?bSDsj1mH zLVg@lc4%V6KnowEnhIDws7g%r+Y_qs4-f4ai-o@~hgdA@a~_`g(|mK6p+B!=Qe4?(yWqk^Fz`cS*92!HKLc)q6*9=W5C@m=|F3ZCD{YM&F($K)v!`<&7(9m0)dmoRF z9tuvrKRX3WHJ3q1F{I#-Im7{EL4hK{hlLdZ@YuO4d4q;d3X3oY$SxJb0X_SmyAnAF zq9i07t{K_I2#C&#)CTn*M@|XfAcs{W0@23CrtZ#RHIT+<@hnKRu@Mk&8k-^H;b&2@ zQW)k5!fXnGnIJ46vRznM7AXa<7W649Mt{spj);>$Kr}fi1qBrij*bm+&m`n}NdzD| zC);NOh=xW~G?f1WqV-J7-E3p)!niP00+K+DVeCerHWa17k%*Ck=K?N+1s3D?K}8bEj)@lTt+bL8`*mRLg!9N2Y@Fz6&Fufa#9Lf zRzXpxOYka!XFm6hxCI1u|HIzwy=D zkF`&&y22bx7^SkrWNczSR+(%wzqtGA`j55s6>n)imQ4^VzffomOIH_5K%ptqM(>P5 zQW=>hWZcoB&rHu|V>OU`PS{s6GIIB8q7Jn2xcJ0`1Z=Sk(Jljrq}1qGIVn2i%=|J{Z&KEU-W*We$&SntL1-&Gd!Xre!&OPY_1suYMh*xxDCg1ffIu?{h*~}V0pFRh zmEOrhM4;8(5dsbE>Jb8M*fETLj`C!>Nh zN6I3$ILSg*bjKzDpkq+AYDiv+1SN}rq|Dx&+`Y1rd~9?eTmk^?fdFVj8~g2K7zUrS zHwSS;%)bN{5CI{Y#*l980e_}r+PVW?qrQWciF8v;9Tt_y1&8>T)f-UIv$FH-+{wei z$^h#J__GB8f93)FnGD032xUO1oe?oj4{7KPISmw~a_kmZz$8=_!0!?n5EKx+x1b2h zg>e)N2r&X6hY{%K>f*hD0k}YcAiwx}L_aeyv9O@6A1-_tMgvbveSJe6Cu?44Htc-v z>Sf#j4M7tiB)#w8hA9cc<=BG?tQqV!fxKW#Eief1=DmB0OXUB>KGOpapbC|dfQ&%> zpI?Ai*0E%`iV>O!Zotp}*4hSoTDG1_u)m9(IFGwb1<3(|eucY1OVGv$`osOPDlBVq ziWXe0Sqy@}%wC_s;#ONhxI=*3Mc4!cfPKb#?)8OwJot}~Z%KC!f}gjNvT@snIqK+W zYnlWj_?gn{+$EGZ#`QB3%peDXOoki?0aA(GnV6i26^Hq3x83UtuSW0$__@JbdN&Wi z&%(9`FC4;pc&GS?`?@>2?{Nz#JDF-GK!l%#oT7e%pUE~mUF?MidP1UoU;uZO9%b}V z_!IT4YU~c2#TMAFckT7^_VDs_^^B`IbG$q;G%D|K&)Mb}XSY-@4R0$ecOOqTA3&eu z_Sl=4ItA^IbT`yc)l$=sv_M_YEjxQI5IZsTAz6j!I4H#@#{5V%c2i=UHk=sb3Z6hd z+j}}Ygrt`@9_c*M(Nvoi=nin^YqqqC!>o`$ljhPu2_pdI2)q%)7>y2(+d0&?!m8#>PK zD^!h@OiD=cMenp@Hgt1!0`%G0$<7)cF>Os$4eXs=oSmFq?R6Bj>|C8~5%>(nwkZnY zipoGf%NqE3z;hVsrpV)vDMva8Os5wF1VV`o=s5(r5d^_oHCXzj7(4WaH5M&LCn&JO z+0!`KJ3!Tqp@N3FJ>LDT}Ho$y@BT1at+%>DP3I*dvUX zG6#`jLp~TlCLjQA)?(>!@#YBi1@hV6-Y&zI+1?t+XMJl28(koub!{!x^E>l|tpcJU$vGC_|bsA;v>&56m;YBb`6jvxUtePST-+Msf-a-3KBm(uL5{)}w(Fbm0w>@ID_2Ekn~3V9_Wo3>BnhrKMA3Nn~Ww zWK(5!Ny{pm`Z)+wLIDS#Z{y)3kYVT`wDcnQ1ErZz)PQ_R1!nt2=ZE^?M>V#3Cvm zP^Uwz4uWQ9XdOXoYQVAsJR9f1k8Toye3k<8SxsBd&_q{GJXexkN>WrrLdVSuq0g{v z3aPbit*G#!9e0G2&_V8BGSG&rHzdnO>{b{y-d_`HMIkcSd4#2HyYy&-_i_pajl&gRB(YxFaPX~2aOi~J# zG{Rmmg@g`6&dMt!1}Lu>kk2?VQedEQ!fGOt%KBDzX4=vO_?bdBsEClYgd{G}1fg^Z zDntlnFT}+puI8mnz%w2MpCrV`K}Udn(V=!q(3lFMo0Mt0fRKm;P6{WXBPj(9lT|de z^^EnEpzjBIg59DW1kYThQRBih8O`cLkvfPq(zMLi+vYUu*nrzzr;i^5)~O1 z9Owr<$K5;}Rk_gvDm<%DF>TuolqV3@z+Y-{bgFj~TF8#ph$mj%YN=9}; zNkw&S15~0A^3q39t2}g4bs_l-ZE@!=T)eO^30I2cOib7x6B!;7=#LCJJK9-Wni?7D zi!i|z1d~EyLP^WYEg&K(4e&D;6Tr{p1o)YjUCzeA$<@o(KPW6JHZeIZ2MpHKH$xsA z!U`kVk15^_2g0VQ=!JtI>~Tga;TB04x8m!4f%dZ4xuRlg9{3+9H- zkkhAe-IRU3=b7O-u@K7xZ6YGWg8bp7KQ0agQ@UDe%1{XbIZb|EPNq#{dB~$U5^-`m zHXZ?CaTy?=we*b5tpTtGNH;PzF(o6fsJyzN1+@i)vjxs_WCwSO=FFMib0PESpg!Vh)KK86^!P>$V*`1%yPU z=<2m6Ff3|+Qfd}*VIzbGl3fTp3UM1ed+yY;FYsE6LaadI{^(ybf`zg$ zHq-;(DFAXUvRhy$Hy6ABiGhZK9EairN1~0INHemsb8+w7B_syavzn%^5wuircK7uU z4v$Gdi&k1y2N8+i`nsBGDvHRH zV!{Ak15nP%nF6m2)ZyCB&C9n7RRW-%-w2KeXF9t9j32rWc{8`D;sA8Uku!PfkUqond0Ne~g|9dB>)v<;;N;AYL11p@SC#`Q_U}ORn5SEZ1b#etuK>S0E zL3~n5W=>vF8JyrK-%iwRz^SOJ4R?eQx_z8%UJtr=`TqL*ynO{}I9y^L7L%BUWhI!5 z-WM4GcgcYPd-wQydwIIUJp_rfbDEP8DmO=U_3*N%pisbj9SGx< zhYNB0;2Ap?OOlwFfyE`}V9DU=5u2ZAfNDJ8IR|AFQA!aqLnz7pE1?c8-B5GDe~Dae z?QKns>qi3D;SIy<@Xy-X`j7Whk;#ckJ#c|TkHNS!2|~V$SPy{m<;1a&@Nn>8H9>rW z$ZBqBTK%;C{64~;qZC7eFc?kP9nlpG_DF%a%QN`7Kkzj_KYCCLo(Kp#HZl*X4N_k0 zApY%_uV23YuYZAwkI%+hHBf$sU>xq(7`%F)um91n?|1V=01ZZ-hvK?~1z1;D+duXN z#=dt#A`%|uA)kQzfD#se_Up&m&(qN21CnagG4FtH|I=STq0f2GZgOa=<2VK9)Sq-d zVX8lWtgn5ogcsawJ4M)${`CA|#y{34;hpa8PyYPmHzxb@>k$T)u78_(IEpzVt4IG% z`)?`_tp4$p|IOg%TQ}bQ_QyZ|@!QP&mp^XwH-q0-Ua$T3$3OmY?bX|Vul?6={@VZJ ztNxF{wZH!V8-M?V!yo_jH~#+ae}6paelz$t{{F__Z{hIAKmLuszw!6SgYGwjf8+0O z{QVXVfBfU$`1>1we>~`ZGx#_D{>I;L;qb>l{*AxC@%P7r?l*&f?{NvyF z`x}3MJm`Ki_&5Ik#@}z@@W(&?jlaL~_s4_oH-mrU?{ED577l;>Or{rV>W*IrM5{^w7B{?qrBt8f3j)qgC0ohtpe)*pQuG#LAL)?dBKr#t-PkJtYF zOu;LU^?cZP-hA&(t42fVK5+Z30kxj9UEB_>Y76Ke+;6>-7O%sJuo6 z&`^YIczXKJI^e}%9O|P;Fb_vS!RT;y?$w7c-`4*3zrK8WyL=~g7ZvJ$`p*{`lVSeF z(YaUu+h4C&9uGD9azlR^RC$iU1o%iQVlb|S@R2Uil81+$CJP#KVz%s!+8-VmF3kg< zF&qE4fdBi$AK9QoNhI;NVFYq2!dTE~Ei5>aI3;MOhS}-kyJs&n)InbmWdvL3yQtY7 zYKa41Fr3f2#kv(n8vO}A3ETfexQ0UO`^I(PA-j;?m+$>%|x}HH=FW{7%`(l`Yg$XO3ShxVM+*p&Ik9 zL(Ec9n{~yvyc_ncP`T$?P06OV>6Hd9eUwBpm;5XyRWtP4>XeB`m%%vO%{Y1OokOc@ zw2b+DI#-_waZ?@(N&VDe{XqBw5DQlEle!R4bAM`(!6Y;>cUVWs0 zkvrD+XftCC#-6`M?I1h5rBOP|8F}Rxz5D{&daKfNFSjeDnMLN$)Hynq3wLTCs#?%s zbt7fm)BAel3N@3BlCsN!%GeVry2@ikQE_i1X(uE`j?u~9TXAp}XVH|C9z%0J+$p{qr2Tpcb|v%eE)m<7e7eN~BBqY} zyixe_?D+hw$3$8j&-q*KlvSkoOZ2?yl3T7b_8)PKvbq*wscy5brjt`js`7nVG3ik2+^SC0!EFQP#qXVQbd;*vQt@I$_aPJ)Hh? ztC-WZb2XTwH}}MxINCZi_m(>?I4NWBfQDz>D)*lNlkjQ)bg@T#9?fm&rLh29Zp}vLr+Zj$+o$$!ajuYwr;PN* z!P~5JorgDPwy%2mROV4|3Huwj%ZNN`y`mfc`mUc5&-KkJ-HoqqwJExqJEc<$gf~TQ ziLH2kp)Fw*!_zkEP=onG5g5#4{%G{-%kZqp5r!+cRK5o|84c%W z?xQ}}V$|;)Et}lt7a7z{rh8w$<9_btSBJSyJY-KT^AI0?J{5FyM{}i~$v34dw$0PA zVi9bC6tW+VRVz*CnW>TljTukmy?l^d(ql~7cI|3fw`fwO-O=0@kJHNm<1H&{vD+ix zjhC3G4t597u*XEc6s6nFj^Vn#N%iqNrI(AF-CEUxt23l(0-wWG-{5L}y1xgl zhP$4uf7+u`m-j;k4f~b*8pI8(gw94gn@OCT#a(5ht=xZpjE242>TV8`z*6awfV}`+ z=#C2-I`W2^*OeWv-CXf(38xc&5f%nzaa%0Y`*O>Kpz4!0hsCD42qPw1Pt z`cl29{~N=Z1N#(`s9EqWUFS|#o-wld#C~k?MC6C_{3`YSR7#A>96Yzx-qKZ&UqYUzUeGb*)i~eV#iwn47AzG{<=|4%_Amipb~mQ$*Po3>dvLa-2|8y?i?) z*zMx$ed^@ghYf{(nBk)~NsB2x&t4DT;d(-a^dgVyHX&&$U*0WpO06FY86FE7YP&p3 z*;(A6HTYtnL#~86Dbvu{%TZHvXujR@dsK{u8vP})1I>I{LRypV?6fwqW|7AnhriRG zjvR11y*qkGb}+M-8Mfrol5m-egnK~i(8{pz-8;qtk6jjMf8wTDigX9n-}E^6@sQ0I zkZv*MJufcmMS1nnMDCW4{3f;USPbvJ@BXUJ_*ML>-8DbE6Q7=o@xRP@zC)7N{PehU zM}s%{tS@)_W4u_d?EEHj0c@6pAFo$+8G~OB9+PN_f+_dnTVJaF_nQw8qTM zY&3rDOm7a3-Vo~0JEUzByf?eM-jh_D#_Boq3#(44$yklC3+kpf5^L)N*}J2dWxnMF z8s5k`GAMx&km(f^&+NS+w7~Bq?sTjEY2|gSK-b>pcRh^Hzqo6Y)ekbuu@>4kmgU#K z^w&&?K5uG3d3>DqW%sj9O&W(IEdx#odwT9$qPKMs*3fcWuK6N-XV{x>O*Nq*eTWyU z_#<1huJ5>Ieol>R~1T)SJU6P?_KhZSvL-I`0(ld(4Hiju2ZGHaX$h&wL>LNOgJ3M z5MWlkAcdPgH^EBRvri>WgM)F1^nO%zY~>-Hme-!HJ(*dm(k;0nAHyC#WhKSN{@m<4 z=l9ITnw^PFhAjQLR+9+F>D&r|nfrTAjY_0`JQr>1x#jTWfdk_q$qGYLZ<(T-P4X^9 zKab7$Qb*&a)_IEK@;jp|DxBZa*9M#Aza>b_w&>U$PFQshxTWpddal&jsI~8d+PbW% zY19`M5*O10>r#y5Me;way$ed1GhHuMhFkc(<3q%U{b)FK6 z6{9WRzv5>T&s#>H;w^mCdHG_3*)>lujpxa`XD6r+HDn2==yUT|2`9`sOzNeMg@&K{ z;`zfU4_lAb#Fu}?HTnCMSA3N;JnwVmOF_u^ zS8F~yeyckzy{Xa20rRoNRIN6w-e;~@7&x0>;} zY?-g|ROvv=m*OKi3`=>KvOA9wJnhNn1cw-C?gUG?8?dg&AH1{2Qjp7g;0@z$&%NC0 z*4KM#1wThb29)p46%X*fYrLs9ws38#%lwvqg4vayrA-18#{_Rs3tX7BHW?bv{%|tr zCc~%dQwHOgha+ciB$ZrsE{?5kpPs0GA+PJ09q8yR{H)dW{(&#$kLtXVoDRq0FAvK- zby(u4Lm_M_MFYjnxsJ*x4(*oPhsrnk8DN_CVkDoH*9M4L^P-~R5pK~0@kT1B0jpO*&;Il8UwGk&VbVCK)1 z&3%gf;rp%X(Q*3t>{r?4g*W5YrVjrID&}-y-j{RdXHI!$`*2sef8!>)pP>h`VyWnD zZtU@*3S$yA)`!>VbTMhYe#qXi&B9z@JgRa!OV^pqGE}ppgpn!MCDluoe7T(Gl~P}y z(iRzyusDiyWG4GhJ+qh1lRd>q?d9edHrD)eT(;$yVfzI;-V@K2X|ZqUMMWwu)OcU? zdGsk9?v!~ddn|W!oYX4s+dPrmoz(5>FHq_IW1590$P~kx-O9-5l~K}RdpoSbYd*v> zzAN8!*XIsl#`yuWmq$$8T3-1LtcLy!tZ#RvxE8RlLriE~_EK%O!F@v}{amJ724r{g zxSqWY!U?d19(FEPkm?~>UVZ!Z8kXw)d5?NhZ5~sUDkWY|W}0DIR{b`$ zc=MrAv&pygm4-&FuB!hChE62x-dc-*t^14$Ydt@|UAFOAt2b22M};Q7s&pu*$TL1o)YoUCey&$@rF(=Go*-`T)<&V|KT_1aAA>KB0SwBz_=aiR9@?c6#-yuk{zY zvBKpKJC&WDllCM<9=uZ!WWQD_TYj9zBah_bnJLRYn=rY=*sw=!mPh$~a+qCwqW25E zN&o0}=KXk=aQ39~D&tn2mA+^Bs!vlb?G-$dbI-9W9Fs8Vdd;Q3LjTlp$vc3%y@|zt z>g4WYG;w<`#fWfqIXrtiBDJHBC9d*1NuUXJ$Z=jBgOjZd>%q(FT@ItlUq1VvrIL*u zs22CW5GL*YvvBUv)4R@o59J^a$vH`;^yPMM~2 z_q8P(-?d9xT-hI-Udh#aaBJgysQ1K1u^E55#c(x*DRTS$=0Y6i^f3c3?{I?;UmCB7 zL`#Pc&E4cqeW5|dcqSwzA@Y9ly698$XpfI`Ps_>Yt&^x)4zBf(=v6)WHrSUM9!&N8 z>1pK~{i)l-I@=x$?RlKf-QCr826|R+Z~xrk_mJn&c+c%zj~&dCT_=5W90LZWb@N4f z>$6NAO()KTd%KZV+E+~vj9Wf^=t|*I(YC*thk?&y6@?%G(sA<_lvY_`@neVehAJOsF!W5Gqw{x8& zdqzf1t*$9A6kY9j^R$WXHIIdzLsSGO$H+*sx`?Tve_ZsF(?SAmCQN*D=O?lhe%ibp z)d(FC8J1cQsZ#f!4Y`pbJFZ$jvh3l%^X<>BxlHx3cPV>5Igut_8?tselBPgmkSBU4 zdw=4CuS!oSu3X!+Jz-~U&;_cCF7)+HoE$fL;@;^C(1gG2<G$qSRpVW8jQv#0B>6f0pl|D2g_GA`wtlZa(V{=sO$@?Y#6TuDga{N@Kdmr8z7eD?%Ov<#VBmR)ByFl0A$<~LBlJl3C z%uhJmHFZS|n8#aPbfllB*`hu-SF5C9rq)jJj9d+eJj9rwk;Yv8?QL>_FC@(_6Npt=TL*Xnr^#hxI**8y& ztvHB&^X~lqjsA;Q2C0ZQuaRT9L21@w#fHmt{#gpCLPgr)Zf-KizcKQz9)2%JF+J#I zKJn$qqhW?0qEr4ssu?Un4s0D?9V$H1+N*BYEscEKrTwJPXf-6+!eM?^NPLy!c5w+O zb)_E~Cn{Y*J7sI@WPEgYv{c01=On?t zFRbbI+>jmnBzv*o^d6?SUw4K2jZPh*?o`>W-yPkjdWNA)i$(FelnR#R!7ciqOr}!2 z-OVo#wC#CV>{{C`K{ob-R964?(`x+#S8vMgIy`zqom)tlg z|02dR>qVVe`kNW0D?6IPcbIOK?pwOF<>=wo8ziA$BCD9E-AF2rVBaqYE;XyX{A6}3 zjISz}O5y3H&k+Uc4Fyr(t~9;7$u?YcnXJMdJI6(8mdkj=gM#*X1F!PcS54va<1VAP zc0-JqfcOS~+(uOxn$Qc$QO6=CJ>(lgZh2oW~6B7?XDIFuHi`R?OLgR+R@j zGSdmqqL{OI%{_e1X;N^XXUvOP-E$J4=OGT( zvJA}ATfEZWW$4}vbM*1e7F*-@2-f8(+*A3=;Q(LABhRiULbS&Ne6Op~ zE&j0Q96xh?W=^JG+&M9ObmZXqdzqQi>{Z|PZ=0RbX(SPLxgMDrbTj>a*Y0cP;k4@g zPZI*o)tr>g`^-w?I&ZX@8ytDHPi^3qVEv;#=OZj}?dB1rr*pm>%u=fvsU6;0ggdg3 zpcUpAVmW?8jaKmPgjcB+rn|`S`Jo>FljQ;zIbOV?*|Q1rc_cxiU)s4+d{M{qaY5?l zb+`RuyI=cPA6Spt!~J4J4*T$WzOHEY6>*cWs&5za-^nwpK3Tlon<*cR#ge*}&K=h6 zdwslz@vWGZl3&OVFU^y#lgY7xx5~!**4PyHzWq5z8?c<;Q)T=_&#ETVkGYBT8Y@ll zCD-hXt(052EgxHE%)$#h;(VJvaf&6W$Q@p$i(`NU)A`TG8ALQm&(HfxA8&T;6Z-az zPe^|GKu^Qn$jp$B(n9nAk`Y(8%P)y@f%n(;w`20j zHeO^}sZPof+&In`!C7YeN4_&vTnjF5lghTqHxjdwiY%Wwb6>WXue4AeBc&6-)uB*{ z_3F&7e^YM$QSG`(fb?sJ(8~hJlB_+ibeGPvR;hd3SZDBE4ZsaN$}L zYjtU{VL6qGf7b&^EGTLGn+)UWo6jQKA%aZR=ueO|c5IJ=wD@!aLc z*On666%S%hK3={0a#9g{fs>)ft^ea%jYfFcnjf>D>Rmwt7ovy6k6D+PcVvW2_#+s+uj^gxX@RyWPE6GcVTkBzAkM21ZskuKsrU z=X*z&7i_O3R+W9?`tA8=$;jiKoP@unOWBo?UDAw!1QgO$RCX^Dti!%hNeqRrg6n7<+SO z-OOb1^&wrZyXS{!tUfBWkcL=j=-um@?%Iv}VDom<$)AVLYJ4KmGQ4B*&EkjUVJVZ+ zQ|B2DOX=(yPnVD4Kc2gZy-;uBbiK9JW6eIP;3zi@71}2~94<_8T2IIemMi_dP9EM_ zdpWP+=Ck9$$3q3K_}y(}d7C!>D8F-edYW76n$tUzZ?iK2S2SqM?BjWi`_C>}nm;4G zOs_xn_DS>gfji#L#lvFa!rt-PBmKK>_6+AJ-Y`03sl(E5npic={W)*8FV#sfxZJ7s z{YxF$0qRBiBKP__-RviwqSxw4G;;Q&^y(3k&I^`CdxEPP$)F-1331P9drkmT- zGWpVqc^qa9G?X@t?4HpauVd|(p*)o+aHj*aRl_Qt@$G)<)7qQqUAVBLud=icO5M)C zac#uQogDj@4Q|Pt|OGJx!Z(nWM67f@G>qxjBHVUS9OL%aDGZqFnrly3pLg z@|Eo_L1A`+8sEMbJY*x&4=Z_Q?*C)9x7h8KZ{nqoKeXhzE}nbfCh5IwG4u4{9sS~k z$9ELW9p1hCl9aE_%bt3JvnXtQ!twHc4Y5GEkD5oc1=zkcG#4fAE>&1Z(i9wY9ewuD4%k#RcAwzR>DxyR{n${-zDx`{;O_Yt?P0>lGmQ&{B`13OykroQ{yYwy1wsIb#Zze?ZC=;koWopzKIupk763;lCAKMwo(Wm z`{pO~Zs_8zNPOq_Qw}z@%Hf;`b7}8>dbNee?e@e8%(a_a4`;0=&R-JWJxS*3zVKY) z9hua~LB}EI*Bm*_=gt)wnC++WTlc;i(4Trsmi^29$@8m5(fZ^cgD0pHL@gGX-#p3J z;mj8uxo>0Zz;gdxi_~lf_KSFg)iX}nJ;zRS7F-{sX%-Tk7YI03c*>35j~DLbohZGRMmJQ(V1^Zt{6PKEiT{|cr* zRG>^&yfd1aO1iX^coB6zS9RJGMd7c5%KPp{%fdP*k5s@lFi;rp5(-3`JbvS`n|JZ( z*gcX#zD!-&!6}VQeEV8a#t1aDJ zK{d+@F1o5e@0T%25$vT&K%w=lRe}<<@mv(LG3-#rRL7RsP}1gonIx2N1D5+0k+N#4 z#15L{S&7>7kaOqV(mJv~$_o8vsjj&T1Y%~Btcr2F4cwiQNwNR{s+HsW*dw^Kk`VnX zs|oD}apr*oy~Y9%lUZZw<-=yX6Ckt|Za}m-jHL{(V z5QFLo3D$^Wy;ifo@~LS2`J~8GejX)5pmn7^C!vhLzJ7<2$c7`;3gmM5YYw4M5OV8y z`wN|l-fay8;AM`Vnd?g=KH+G722&36^Mzw>tb{=k3`bCHmLc%(A|_nCN&!C|=M6V{ z&t@55;jCUS|0-G3)xh7CWg<++7|JDmS3{_|CvLc*b|pr)cX0|rO8x}l3JOg@kulOr zm6-Wqg-Og?D!|6$^gO@hNvJ#qpWx@DVT8v-BvvF|-#q#%w{!-Z3w88cOFz*t$c5Sq z>+c-U!UOj~Icf$vt+BO=RmPv`A`}W+Piu~Qilr>3vlRbb@8g|S%z5>V7SiP$yOd-3 zS_@y~h*+k?jg5TdwLk_HX0h(%#3j7Rx^?z1FXQy{%zffSf*r5%fxe>IP#~>6w%QIK zIxqTlv5>F4Vd0Ify1CDl4DD}n)nCG4YNEtx&_yUjkZ9my3MyKLVARcPuV1*ZjDpL9 zDUCUKenk~#B$C26ZD#U8s~g@lMUGgrq2uw*W#6V9TnGoX8MqsW3i4m)CVVp8=29~=Xgpp(); zykH?nK1pz?7g!bB&OGFOhBJ0`uec4g8I$UY_)Kuke3V6W-+unW_SQci3zAKhLO7cu z2_x%N040Ers97TqdT&DLlAU&~l@%o#+QVX)xl<%?6+l(L0ej1lI&#QCky$Q%RKmqrtZGj%ID6CWiEICn^EA@e+7wE1} z<8)m&6lC?Xv#HNdtwd9&pItATv!SvzD-y0IM*|c#M@5W+-S?PCI6I5Rrb!qYJU8P zm*Pr8`^}GkO>x>4l9D7H5EEVhc7){t7nn0cNpmsLoM_)6!5b!KQnVNddbG%RR4oRM z$rya446fjr`^$fD=QnCw zRGA=dBY?;OK*H*bLKsI{5s|-y1QWsu+TtYrrg)BxKroEma!{ukI@b0(J>xJY$yly9|xM4iz}29RVr5Pssl^ zKyOU}T;;gQD9(S|@koVxis!$m5m)2q@ZXE=*MH&BAMoh&FSl{;w^*;YpwHpaMn8tz z-)@+H4X^$itoGmU4aF}3@inWl=#v13bdm2i=2h(BtYcx;6@0T_Vw8AH9j5<(?2??7 z!EX1@F_c|!)&UBamN#2yDNMuEYiT#301Y<`}psTy% z$^w+F8*8vd>>RUA@w5Q&dC@u;GAH5aDS~xEKK+)W!JZvO>VZi(vaixNdU1U40*2jT z^f@Y{x(E7Ew{M!=Wv!g>+PfIxQoX4x%rD8Q(spQF-(fO-3Jq|*f)lCXaq)94gSloz zxXCDkx}E`0RqHd|r*Td$v0W2UU79N>R8)?79SP`vc!#w-+G$*EQzkj%;OnS-!^_?> zj#$%}B1;APp8c_!u{YUNHZR!)e;LVnM7I?~ z(a0t&_5k$d>9%JGl!3nbXB-;;9SotZ`N>FZ@p8E!_)0NrQ-1v@yC^Q5Fu<#&N1Pj~ z0{oe}E{#*nyKHIi7L3=xcXS~L@XMwq>fp4L%J9wtzpm%l!MYos_SvBTK*fb);IAkt zllS04N*$iJ+WRs-7WF$-Tx(6p`OUbPKyKtccEL^vtSU$FLxYaN^rbqcvh~FR^}qy& z9!Cw3m&qb;)4yH+I~%*V1moc?45k&9-0N@nNeXtwTVBbx_CZx;I{6c&rLaE>f14-~ zPpyJ+s}SBRINzF>BSF~)>r4YdMco8LmMf}3$=aZXNcsO>(7n@<+ko5^dOk~IYQhO4 zS`Qo(2D^F6O+#gUyWq0jNFWHSh4j@Ib9Mq?a5Q)eM2y5J=wA8nI}8@YErstHP(o=l zK2>_>)0l-nvMDl&>76o3-e(-QP-i*5VvvP%VKF`m{)pDWQ~{#7|7?9qww~zd^ZZrr z)1{BbTTphCb<49Re}k?kpb5SUh5Wh<6A2yiA_8j>79~%<43NU_t`SUwGv@s zb=RdNV#cm9pu#aD@4Rz@uMXtTPWJy2^``XQmB`}uVgD3!_B0br9HYOO#)*Z$u!zH# zSR>t!hN-d!_EG)>KwSAJ^6UI63Q|w=TKtq}yv~v*+u$;Ui7Qo5Kf73oH&v`ZNAFB| za<8g6@v|lMgmLyOy`ShaYn>v4apQA*`n5A6$A9TXn$XpSapR^@ix2$m696inJR%Ta zo+@9iERMiE6-a*Zn^7X(Znd>!iJR4uf0E&TT}z0H@*HVJB@<{8{c|mG5Q%a`fEfXG zjMM3PYFO|8#-OIXzszl{*TkFKZ*>tx-BV~p-2gbLBCWmqE0qzqTM zVEa{A5F)p67#w*ae`$zg z+5%?X9dPc;I&j(z>2WUXM528pN0Mz%4_?bSvna0ON!eLVCZn#vw`+|@;7wyjgaM;6 z6tUH@otlOAS4Q9a2X`-J;&HkBNUT-}^=uH-uA_qmU68os=7G=~Kn(+R0y=e)+AxXM z?_9SRIZ$tGFTMQr1%{&sQ`Iq{B;(ZLlpsj|0fDj#W8lo@`AE)G%aAr4N>0JBJaSa- z{-G+`rs=~tJF?2>I5Lh$w?gAKjg?+jJ7ZneBiH$Q%i!s&ONSn_KG=5t9TztoF@$CD z8UEzT{;G~pk*wdC`58;pYUCUv1Mf&K!D+TUTQ>xyGJ4BAWOn6ossShV?fBc@a;+a5 zSO}Nx;&IBA`1}=Cpj!z`ubUrg`LY0_XRD7sjrOqyWDn&%%CI?oXHcaqYX`rvdT)r4 zYL{hbHNb?qxRSprBX|LITHey+vhIPvROkUE4Prv^%`Mt3vDu4mrd9R4?&&@JOuRc) z@p}CBeKktUL`3mJMYRx|KdtnOcS`*!p}75a%8@_MPsSVM#jgw%tpF9H^&F{~F=%PO zM>y2itDCe)z;jEsr*vyo1&n01le}*n-Mt0fcVm&Kn&h{Z*dOX#I@9fg>e$M;^*ZA; zR<%gyZgDbW^x5avx!e!OZ-2g1yI|Qa$Kg93yDi#YY@1e%+NvibJR2QV*g+xxf6;3# zZ^lIvD&Id~E;Lag2n}{6R3Bb%PXkh~(Iy*sP8X{Cf_mVeD*M@>zA5>n&N|U{zmJvx zidK8QgiDIyUup6*8aMZj|5csyzQ9PuGU}HDDgq?LDmXci1WdSaB3Mac`h=jt@<%Hy zM2N7|R6E)fv-lDA|0T<<=r<2pQb{~MB(8{T;k*U;jK`I2Dp<%rS1>+KKpw)KSH?Zb zxKo>iAKjGuVMd2-umpPqT{70K;;)ZMCML;y>($MqhXe8K%sKhS-=_!2!EIEaUQPgy z33)H9UHtS;b(#5~1EFLncl7mRkbJkJA&#Wl5@!ob%R8rq!^HzYrfgX&vJKM5Y2iLA z#0Vd{XCbppb!od$xzgZ5I2Z-N)kL01HC2wqRTBYR)zVNDE(w}l+v$|5QQcqq^9IJb zD7`Pbz_~NJ<*jdtg123uwEsYA1$X8O&vlck7w$}DD8Q+Z)XNAo_Ea4D2-Dol6aR*e z65-|5i82*RW=L9p4|7m&_MkFJEH#-bDipH%)2n*)kqm*oH10vz(R~4AD7x2n(uWG; zCdn*IhaV6q9psWo!>@c>sBK`n#yytqRa2)7!J@y<6reH^)eNYzy!6N&^Bx+Y^B8wd zU@K73#ue~&d3&&+bb(bOubv2i8%`+9Xt+$CC$5GT8K_Wb>FeYH8o;s|^XtO2w@Ail z%HlpKyH=VKqy^a4d16?ClI_@km-Lq?&lrgh3p$;Zr)p!W)Li$xtnCi-yqyIhyVie! zFRAxCR(5!q#g@SWo~O1=LnLPVSal-$xrjbd53#j`|2w#7NA{HM(TT@NWbO2#;Z6;h zM4zv70N}ZXlA|EF@Ui~kOK8b@JavD){!Jb~bsjAsLTY7f7fx3@tN$REyNRxs4Jt7> zWPqLZRp9>D$h5-gjhle%mI7(Jf@7J5*+t^CFwwf-d8JJT@WhiqDu17n`}Jv5^MS`S{k8dmQ=6Iv z*_3KGCYE}6lP(=3dT<5Y9kjXdWde`)EU@;~H&CnBl~-ZSjIK98o9s8Jpji0ON;o3is!E8UJdTr1{*y zuYLjtbE$}dGHk00x9S@?OPRFgbXW{;yBIEXaRA=kr)!~#!^OEpE#G@(6oM@+>)(RB zZbVJ5!X`XT?L`GRh2n!F-)~94|9N!s^uP1wl5jv=S8wd`M$Y!%WS*a)+P_- z{Hmf|feI6#%D2c=)AB{;+7AF%7G@5;D`sbppFvztug`qon!+r+Ax?76r85FpJt+qK zeQet$ar9snnTcDo#pzwVENApJfFJq(QW@h3)2nd_c!)#$c*Em3t_KX3IHHQJ9OOs( zusscq^mE^hus~`-InKQys{t%gJdGRL*=HI>0ci%iQV$hsrN4>6b?N^N3F59sX8%xy83ebj24X)RxY zLn3v9J=!P|G&NbD8V8wp^V}x*$R_(HPeS5Z+3{9aN;W$DteRi?Ifv=#{6vNt2aLUg zeP`w{RQ!%{Pa7Wrj(aI!CA@Kn+(w6Xi;qlJt_gZo!>#ic<5&mN|7#B^N${eXXtT=Z z+-KAQ*_qm&d1v)Uc@ii@?Fg+^vIEy~8tz!AjSBe^ty{p!MQibCz0LqZV)6GTlAkd6 zD~n|Z9xnVlc_?7`waqHGa?}2q2QtZaO}V;NQ;Gxfvev_Rqi5AwBW=*wJ@Gejn-qti zSWMjr+b>=ngL=5UW2@DxM>n@se)3D7wKo_FzD^!%Q~fpTegT=Mfn7ACW_cq#eGm^`=Qgq4MU^7dC|6M3m?8-vRW4+ZdV{8II+}VYchUwf1t>S0JcAa)LlPj%jnIR2iGPFR39{teP1P`GBZ!$K>K~K zf^xrMAH|dk78H@cGe-5b7uW8+FlfmfF?}1d(zS>xL&G6CK|U$;nUU_o%1SRKifTB4 z)60V)CPE0KLVSAfW%4n@e+g6P<1KU@;GT|R!Re91lvswN7YvlYHBl4 z7Y&DZhcs$3J6Q~8{1KS53xmnmn|8gt0rMyf57DO5H-FRDO2kX=sPhpD%_>C(c^ zuEB}F8@Rj;>H1#L=4&qVjRjV8k`!)$3@cp!V{%*T0X`4i*hJqMw#!C)#sENEn`$N? z);KPCyXkout$=wv!z$co;%WSh~*TZJhz!MiCPcrb@>Q5_!>Ji zjc%Tm1rn@|P3{@#+Z}}S0|D0NkLE#ui*5jJ=5!JpF#A6i%5fG}A-eoT-0mao9`(D7 z%Zi@v+k0h}v~5~4Fz#e)6lMeJ1V3*Q^G`G8Wy&=u<(CgFtQsH5{K=GVoX+dKlV75h zXv{!VA{BOzw5NXj`H-&R{r_||&**i85ya6AR?b5qOY#@$pULm3I?bzdyK`$scG0-Ac zfG}m(O-`xsk9ACU417rR8?bSc1bDoxfc%#YcO74@p#jZea;(|csrm>hk@BGF+>N39zW3dY8O0>t zSrz%=4qrootu22s_t}BBeSTCPEBx3>uW3tAi+}f3n_VSa+>9O?0ZB0kJi}F+{sW(@ zR@}yVqm27Uq|P2%rgsK_;nnnX3|DY1T}Iz0|8?L8_$B`fBhHJy|6BaIQ%lfcf$1e( zd;CumYK~D(Am@giQy_k=f9Wk9)CD)?n1cI&)k3cGvC=UFb8IU1wtrRV`#FMShe=aI zXktA}qMGDq%0)3PRH5+rt87cN@D2$^U64(JZSTF{V$dPbO~$l`4aw08&?9)fA{y-g zxn7E7+(?ZoZ=O^0b4fc?cw$lK)@}M|>*OtP!LrQVog93um_1-YMjzpNt*eWkF0Hdb z;ZIi=C{!&cX;2Zuwxw`{W~yCUQ#Y`_;|uCvMnJ!ID1Iz7m^YL(#&Y7YatT~}t(bTj z6&hUf=F?7ZB~5!Hx|fq$MS2nmM&8Yk z{8Brj;7-m|>Oc#&(%DC(!D>H&B867Qt!zq{cV&{-1R|n>>_0qy!tw+BE&JuMIjhHG z3+NLiDI}r%96ZA_^lce1@7z=k>550j z*v8TTn33^ZYi$klt10-FSvjB4c(Fj=>p%eVAM7ZZYDMtf?` zrPCspg;X`X;&%y|YVim`d1duMu@E!O`@j84%C5f($rwjFn%O<5IoN2}u7ixn87D(G z0GDzl$L7oG^j!OrC1LN^a`ptF;)SwK*xGJ@hg-}e_h-?>DBlGe?wt&UIQ;EW78HUSYf(nwkF>If|&XZ=r9naq7<;? zC!p*PcR)A6%EIhA#Mz#3YxM(S4y7*^8c6-;@vtpBXlefdSL7Ob`fxO+(Y>#T#!6@Gno}+Hb z+UxH2Mp~If$TR+w9}bfT?`NsVFyCOhb_pbODckLoZNu0d5miei&{e}}Ung#IBJ*pt zL-%4Mf5$38sP{7&VB#dwpA>^o*N`J2x80tuH_iHv#y#<46g%u-S`!;JXxSaEv$xatR2JNtt@Y=R3A&)Hj)dC4>X3ddV~cnzq!HE~~v zfGCG^!4ifrWTsZ(IN)q3qxx;&k`FIiKcS3y+-)Ssxac79AF2@U7~kxZCRDg8QQ5V{Yzph)1B@n~+^Yx10Y`1J_+r|5b|bd-v=;k5LZQ ztCrWJxOGA9ACeQ$VeY0|$OB0S`)O#5nQ72_Ea@401VweWXnI@3vmAI9YZ8}$Hh#i*LvRT(Ft!@I(pHfYO{U}i25N+|e zNkIFDYorhj%S^*1BP__7a-;as=i#^TE}YL5we(-}hyv`Ib9KOx;_c1EKg^5u4bXAb zciXn_AZbpu{6pKeC*vO#Ok8hM8>6Q%Ps!bcXcl1@1f1@?U{n$u9c)Ag^U2VgIk&Ep zH5FCyL&4khJ`Y0Y_Zjc;rRT-!7d;Qg`H2iA@hyNMJLY@9&>~iJYdlGnr0h5=oIV6# z;9lnD)h0t89j-NM%tCM~Mn!hO1Jj-9v%_nQmoMBg!Z`9)3P=PWGy{-qHI<6hPDAAH zMhAm#D@gIY^)@ZOA3{yoA`Y>kylAxhp|O2}b|z#@vchf`X2+?k~EwOVcJv7bev42qzA{MXf^qH~>LxJ_niGV@j&PIOPJ73z_i zhH+{Vwq^Wo@ed(|*`{||XCae)=*T!Z*jYoBcg7{AB5E}p@b@g9<%X6q`JyvCk4A> z6V3Sx>~XUSO!MWY&Cik4V&Yga7J$bPLMIw^J3PnR6VSwpGh(0=5dq@o_LHZ&2`_tX z$Rm$AK4?SH%(dhA+#y%Q1ZjW5B<8d)DeraV2F9bISUm)p{~|5y9Ke7bl0X_p%3$m> zXijEujU;;@Bd@-4553~mdycLONa7h=E+l7Eh*MK`)FO2F>209z@T@S@2yO~`mBa>@ z$}xFORA~;yFb6Lim$BH1L$?@e3Z#evJnyEPcl@tHvO{Ns1LH(K!t6QWcGrZ%iWYA`HF)6_M~5Tzk} zIhrmR@v+QmdtK2uNW%W$xw0hsqki2Jln9!Ox}ZkclBXQxWlE#?84b1^*mB;;%^6 zG5ZDnHrno)4>J8U=gkI^$iyov>F^j|!DVe*Yx`8<#*N9EA4()BHcF(Byg~SO)J`lCODJy7z(=Cw-8gU&E$Ru{EExkfzF{EzQ0@g|QeC z6hsOF%-Yufh8-bnb6$)#N>PMG=KEuOVTQBQBJsTTC7@2<;aHm9QYZV|%6SvOzF(EW zs0XMd6z3?0PQe&oL+gCmUxyK`a4g`mqVy1;!`@537SRqsjkrANGgIQbhn-m<%!|v& zNmIW=xQ;oCgVD8!jVV1$V{Z^TQ#OvF%?HmN1}REK-)Pe05oOUDX zI6gGc7pWem^z++%o3aSs8{MSWC=R$2Unkk0MBr9OuJ&Bz-QR%dZveB6afo}82vZpA z;(4|;LWxlr@#6T(<{w$j!XOxU8xw0D+LfxUK+ww4P1!}r%tfEwOtBfEk4cXQyHHq z1iRP%qj~C>5Q%rFeg9m>1ZrB6K}`>MPRH^32MUqowOOQJu9DJ77v39Cdju+ z>Kf>0w<{lJ1i%Q$J*VZzEB`05Q-RI6(Q7k#E*$>FQeZ%FL|DO%j&Y4ZS^?pH*ab-Y zm>2hK{r(PUm)L*os+QH5sB&5g>uD`UbOfmLzv-la?|2?Qxi`*}8b8~Xio~);fP}yo zoO;o2YBAVUvitpg@`H#7`>6MYt(u^dOG*#fPdXA+04NO z>Q+=!c>UxwPVZB)>-rBi4zX%s z2DNsLVd$*yPE3oxX2&mKLCqDJOILrmz=V8Y*5$E5KWJ(lni6pG zw(o+Uib#b>3LsS@hHaNM;%~5u`am)L_+Q{Mc{nje<5Z9iQT&pWuruq;8mBc3eve*! z%S&+CxNncUD=i*sDJ>E0Sck8REOqqT8Mj0p&#U}%~Zc1Cn8ob zQV!tF5Sao0eRaJto>(N&Ghz;vrW6*45k*3CsY{Wvu$aUyLxhtALCySX!g1pJVE1M> zd4z!dBR2rPb5uIA5lA42W0!F2L^+*_;Px4POcqPk@C7^2l}HkWQ*mjy;55QJMAIg8 z-0e&Lss+toS0sPrBxB$n0{gFk^QTlh(uh&~uj=VGffSariqkU%-c=BP7OeSA9Ge08 z-OH$Rd6F2&bRk6F#B-}Hes%m{yttEf`M!1&a|}|ShDcT_z5^!hcufgWL;X(aFfSF& z!gAET5X!;&dgGdRhvF}vt#@DU{L}* zo(yFQs{$+h0_rQbvNdP7I2gHyt`F5wiN&O}vU@q+E^f3NK!33Xyku={3*IilkIN#=SQ3O8U=-MdlCxTXHp*O-Zt$ubt77X?uX0KOx?J@t>&qaY_>s zq_~0sytm4$23N=M#5Io|EVRC_jQ}z7BJG)80hBofEo$ZC7)5hoIY8RDS2XJx#zIqU zUZ%ZPUsg}Zg!-^rnVEa%(lgcj-ulYLpY??%T0__UK)EKwSEl z=owh4N%73#euDDZ8=A-bwQW%;$+<;obI0miP|)!f^ZT~aT$-d{GWOOs^`rgR;`r}J z0RKJy4T*Aoi~%hgkTChBfHH3kZ-p^%`-QjvABChbm{%9b;-Geb@E)?57MT>lV%9i? z++7=Hj(UIp5s!uNdkb%)m{V!+d9Zsa!m%j^;>R^(Gh$1H2x$$-C44&Y5*Fnlvgly{ zE=0O*)FHG@AVhElqaFgUr!G{H2S6<)GunBvWUDl3@iJ$a)K{K%U(P+~`c=)T_a zNQ8(X+@{kk7ujq*an_*zy?Llb%jCr~k8p#jbE{IIuL1{6@Q>e|Y#o?1CIc9^Z5=2% z;d%05Qj7?8_6)dAyp^Ue8$wPqa(ej_Y7lb`aSCLhN zLFA;NFq#mu?*$<2A1W#bkVy+_+@TV5%HaZmib272r*%X@0z zg2NGQsgwwR4`QerbE`o59P%+G8Mmo6M@?_@k#9R)Q7BF5O)|zlWxM+&USdW|YH?4Y zLn`!wt=$gnuT6u-EbA32!~y?fu@>p79LW#Y+xcwpv6Zq+Ob9Z_JCo_*v_t|(IJILsho_moZh(% z?(w?uR9O*sd>kLAa!s6UeoKyX23n3mIMfX7IDA~5*V9#0Klg;Qa&K<5@5hS^*)D*> zIr(jyLO3vN^7uA_$bkP%zC?nUYeB`yEmZkfn|`sPxj7E$*RPerwdvofGa!nMbh7p- z$f<|H3ZuWraYC4ZT`*I?vPr&NZ@_KJ2#5~xpj%JY_G?inB>U#`x=|g}4B1dRh-WXy z7C+v=Wz*t*lZXlW|94ar`!Xm|TRtSVz|pt=h8R1^lJTO&@+GVe;@aGXx@=pB^rRbA z5B8-nahgHUCY==Ge!4c$k}0sijDJAP8iFQ-#=REZxSK6vA7(w^$wqpNRs|Sd>CdS? z;~Fv{!Zm*Q=u-VlcZN=i|9-iyHEcXp$EjVO4xdOL9MT!rdOt@yNOG+5j{daQD+{d^ zz;58ceaOJ-k7oC$qd!v@T(+DxbBCScPkBq;3pc4rcJ&uXDGHm-Ts3g=4K|})iL1#V zd9@p*>_~IsSRBi{|8a`+gE^%5+$qTgWWbaE7{|$TWJeebSjM2OHsNReB0oTfT0je> z7YRkn9gf6qq>0MM2_S)`ej~9>>kaEkn{|P$%GRF>12&mR&cSZ&P@9IHf;4V*W869>_SEGY2(UH7BKzqZx&V6(*$Z z4kJQ8J%t|B{~=`c%s7h<@PJG;>&SVMJ|1J7h}^6+eHWNJRkk#DUQ6Ni@1sEsX)-}F zm7pnV;Njy~Vil08Hg3tL0;Sr1xHbp)ZDZUSb(?)wR)9O4sC9#|MrmY+_cyrk5Jl?T#a&*Kl9SZR5f>6^w2`cr)akmT^u|M@-?_Vis!Q?4diy;X%yJlff zmHQl;kf;s@9cA=`GJu;TzTx?1=xe~*1AaH?{?uj-{@sxEDYmFoHk(A@3h{CP$r5g4$ zYP=m$+f?sFstcj!k@e2F>i7JQioyj$xL*AuMIR_A>df2Kh8h`QH}MnN`9W`KjT%?F z)+DF`d2>Z}&gXmJ!2*4I44K?9t2hwV-NbQ?fO82P^g{A&3L6(QY|-^!4bA4+if*GU zKLSrxJ2yzKj&zAbvv_N7kkoglidM8-e>ulVW{Eczu2rAfuT7q?CngLs&BxiP7}d`; z^G(1yem0-VO1eLj79Pg=RX*>#4vL-m3FFh zg5kruUnAGquUvMiDgAF~f}{w3zrrIarYl|}y3h4YSLxrOa0giPK5yOph1|77Q{%t&=N=qNVX{{2T) zZ6{c67d@m0^J%c-fqJZSMPKR zHuaE3auxELZ@kz+#v@In31W~hMDt5YUM~(-%vm;%MpTY;th+jeOpJ`@S2iKiz^C7}Og>=>`H^xP!f&9@)uA|#(pjdH;%QkhtcJPRFCEf!u6J_u9o zjXtZQyMa@4QH4Wh=e%s)rY{v%-e+Bt0H={%bNh`*16w92^r4Il%t?;hYK*BXD3~UC zf#CB4RweS@*Wz{MhE_+oBv~UTf$ZMzNkA1bERrB>k?^PUVt{!SuPEI-Bo!9*94b*c z^k6JJo_#1hOHs&%8BJl>98(bXGI#No+Wc*`z$??om0SKbx6X(wLMEDz<25%Ycy5R- z+FUB8r8`=ULX{-)of7e~+l0O9yGjs1_q+xn5&i(xOjk|63kaPZeNDiSB|Jt( zj*+-lb+_R{6u&UMQ@yetf=+lzbDJ@%I4}4Z=V{tvW6S0mAWby$Xd)lU6>Ui{(vhgd zsxq2G!|3B_j@4jG((O5IWm9k`@T;bNnuwgDC9o@dS`O^=?+71e(0lCny1ea|Su8g^ zd1zAihRE&n`k1dEPIE*rTMpCngwvln2-o(2xLA>z!lM-4x5kpXQ{FMiAZ3vdbF{oU z_dMxd9Dz|FZeeLJn=!t{YWsx}fwa4~oZJ4}YSNSdmtUC~gimleqZfVE!NKrqE-ZX= z1rqOf81&D<-~Ukt#&&|zK(Z)gHNSuKkScRz#4^OId+1j@ef@7UK|=)5N@;rjUzRGD z_}kycZzu?mfWk9#9wK-WwG2p%x@yGBSBJ1xUDPAlS@Js1n_{SE7q_qqQSv~&Z z&;MfgDC#E{s}cSg0qzc&rt}-H*gLm(ncRn;ewV2IfQtju zS82(%r+7ak@)d+o6F%*uz$x*ihVmg#9Ym?iOv^A9gRpn|%2HK(yLr3so1b9VQVwbR z@FmC&rZ-5~5&tN}CP5$~P`Ldew(1KnC`C*Qj8>u@F!uBMRs2c_{})`5Ow&ZVvK0*O zRPqu48QLqsYf@7k*c&mN5OBU|ET$saJ@sn*MK|EB)M`xQ_MU#zuiAzCP;vWFziKb- zLj9-MKT#*@Aii{;sF3ll>UOcnyWw1tDj3Ket1ya&Bjp6S=1|j6&p&@IFB#!3X;VoA zhI3(-yv2Nv);#0abRlUYv)4QA1cLF@Ez;XfsHbGTye%l5$=%xbYRgn{AP{jOG?z*t zCi=NjcxZ((B@h!A3;Qy0MD_9x;zB0$u*SgehV(H{8ByjW;dH3>Z2)_=IQi4A^XL_& zB0`H*$5ZTxwGi-x6=zZIQ#BH-*y%B3%TY_v(YRcpuYj|F$v__!;z5t2G0z!WN@Eu# zJr=~m{~%L>6{mahVSrJDZ%NSh;N78}uHe_>y{|PB6C%5SHQT&fx`yi~rG^?46JNQm zFx1rUB}${#pXE3DBd$?gR}KB4R7tNh$-Jx)-zYalW6t4En*;D^g(+3C`{uq2eJP3zWKe~G{)r! z@iYLa*Lva->>j`d8_l}kfHY*2xd03!TvLdZXDJD>5x$_|$$isrs3t zaotCkK|ZXkmMid;fArveL^*9q3mj$ZIV#vtku^ju`ns^NV&tE%*PiDYaRugMPK04wg39rM>?Qm!c1G}zS~6C1J)sgWpvk_CD$qp~zo5_zM*<|d z4iPoYher_|qB-%rimEyXUspvX%gFJpX7#)8D~n}Hx(>6yG2rd1|0k;zr_=x0X=83y L0000CLjGoE&y@FX diff --git a/samples/Javascript/MoonWarriors/proj.mac/Icon.icns.REMOVED.git-id b/samples/Javascript/MoonWarriors/proj.mac/Icon.icns.REMOVED.git-id new file mode 100644 index 0000000000..9874ec6979 --- /dev/null +++ b/samples/Javascript/MoonWarriors/proj.mac/Icon.icns.REMOVED.git-id @@ -0,0 +1 @@ +3d09e8fb4f4ca1c1ae7ab0a6948db592c7c3d9a0 \ No newline at end of file diff --git a/samples/Javascript/TestJavascript/proj.mac/Icon.icns b/samples/Javascript/TestJavascript/proj.mac/Icon.icns deleted file mode 100644 index 285dee82b3d3f80acf3c0037b6b6ce35df0e9e5c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 77152 zcmeFZXIxat_Ab0T(TVPcCg&WwF((wvIgtbb0l@$Yf+$9U!rtBFj7Ss^6+xmXS&|aF z0l}Pe9`lUjIL3ZgHO@J6=AQq(U*1pmcR^-g*WPQbTD7Y7s%Jgb0ULvNVx+O_0(MTG zgkcnJ)SEEf@#a<*=Hn~`LW^;F@yiUYEQJKZ+=Qc z@;C=Ct#KBLYV?`;X4u#qA!fFSC$v=LaWrsMs`_?qirQk9g*k`KC#_sfo*6ckVr!*o zZp=~SaF|Yk>zo}H3pfV)h8!M;qew9xD=_6Vb+mO2tr;9eHk(9MpeQIQtLrF7eY@Q^ z*gw=Gx!N@-kqq=bywpD+8SEYKE4bA)B$W>Ib@aj2;qLifao4*CCDMUYOsqAiFMWCN%jT>Ly@S&1;^L0ra@nm@kJ?xIfsBN-+{E3|Q}16qt4&(a zE0u=FhN~T`t-ly|wK93@k*hsXK@kDts@odtvO3};Lz1ubcyISyU*j_;xh`qk@~sDM zbg%O9Se|Ku2@aZLMy?xr`t9vJCPy+o-5q`0S<5H1x7jaSJ$1Rm1aE(jaZ@J8*VowD ztypEb%*Vxf!R$$%1v#ZF?d?{s)HfMtF~)R}I3_)J%QCy=v#d4wn(CHzUVFtcI^W+s zc>Lh$-G}dPJ$?A-@q>5p--l1`J>FjX@zzuPQPjhm_a8pK|NQO}&%9snJbC!&(eUNF z_n+Mg2!9oF@b}wrbGP)um8V-Sd<74j_~qV{N6qIt?-FIQo2MSOuiW+ft*15h%@yJO zr{BMLTAR4!-lIoHYV!1t*VbQ>d!X^%ovh=DV{6(PkOQK&7rwodc!=<=@t&1bpEzcD z;IR+uZWGBd&gsYlW|-mXZTB8TMkFtaV6F9X+~C1lHvQJM$j~^irH&K90~4l9K7M5& zGBP}7?&9^US1+7BVb{5)zOcy1h<%fc$Cz1}t*tC?IFlK^KXikem9CM|%)rRQ<&`_9 zZwUU_irEm-6;R4qAKEDgNKR6pUcO zi4|y=nwmk2Kp?cVG9zc~KJ@A0HnK5DiV>(8n?Rd6TAqa1soPDmPp_InFv~cBhLMrH z$h-G^55C@ge>10SJ;t^W3v_jK zboC6hEjZJkJdZyA{Qi?0Pai%k%1v5i2y2-T7wBqf>*(mSjIsFN$|j$^bLGbM>sRlV zXNba<(6lpH0s{`0$K!JpBeUEw1&oTh7umyqY1ndmjG`(q7YJ~UE{~&%xgK=G z$P9gKcHSJ!kdBd-EHzayLlFS&TtyX%8L@+hX^g{GrL4rp^D&;|YIVN35!@l-Xe;u_ zt8hCIYJ_jurvX;Xa5JWvz>CS$47DoJ)OMeivR)A}M`9GJO8r(10XX${3KmkiERxI|!GV1AP~cRX;c@9hAgK6(j?_53WiF z#8S3ou;)q=lkLQ=2nP4T*{LSbziMC$2QA$sT{e|Jp?*5Pc<~Ro$ZmpJM-d6X7b*Gk5@7| zrI&h!K)hB(^{K{|_H&Z{p>}%Zy$0FmXKe+%rs2LpiCC&tQdW7guBr8G=dfY4?CG~J zf66*K5(Sm{O>Pc$>;35TiNBuFk!!BfRK76 zB&TQPrPT&ad-fD&?Y$>Ao;yME

DIFU*Fwvw&PsdsixNYgCbE#(d^=@ zJ&6K6Ah~Ftfg*`gDEL;`xDF3udR>IR^%=_YK^Ho4eNJ=Gw1X>6TP+ zygb&$dde)f{KfG%PUdrl2ma4r7&R@q;w%_w@9668%P~bN4VxFNLk^I( zNhJ1m_Rh{5v>Y;>FiJq5kxj16xFH`Bb>1o?gN7yu7DIbGJBJl(CmG>Ed{WA1ixsI0 zCd(o)m1S!*wl-HZHMiRnb~-Dac=r2OVl1l3{>|Y!Y&vPmnla-lj#gElZnVekbnTbB zOjPy_T0hTezrW{};0cpwIn3oH9xg{b~m7}?lNm@>u2#zb{P z%>KBzBosCdjv#ya;0|tjC)e=_%96 zWGYMBYRvTIuKs%?A!?Ei9a-YE0=Lsxv2@A2Su<^IY-Y_{xYXHe!(s{&-#&XB{fPbW>7BQy znd0}4?mvAH_lW%X!NVAI@xkp0{28}i-g)*Q_7UarjXU?nk2nvW-Fbdj?eu1zpWc1d!%hk<`2A`ox9#S=+j_b5_Ks5;Sx1>q3~h=`qR90iSO?gZ5*`tIFDhwv!sJWW)RR-!nIICZw*A z?G_f7meg8f3y0g}GdFvFO@C|6{upuE^o!3PJbv^jH@~>3a>|szzR{VRej3eOu{fk? zPQyEt9cN}0WY>%hPCeY3u_55+%w04uXlvoD;!h~QPD#s2tD5dyo13%Jarx?`%F>D$ zr>T=?x*b}4=vUMp6_=QicznfzlZSRLRcC5@z|36*Gk5xej48!m(GB95q_}*4n7M&y z=Bh>I?Um2m1yR;V&)x(BBcq~YQlc~>GFM?t1s>*7unglV(6G6|dX%td*B(9Gzdurp zXIR)}IbzhU1Ew%@Ctln@rp$9TG`)2B`mMVL`}gmQ3Qu)35CtkzGQJ5{q%E+PMPVvS zJ=DZE`mbERLG0Iw+(&5IMXtaU=_dRA!*zK~(i9KjjKOn*gCm#m{kr?2!eX7cn_%WT z?(_Ey3?4sersG_G#kr0i2prLV?WnN0@fz!WcL%w+FLQ#4yJ7(&zN49YKYsh)#_tc= z=YQ;K|I@p&@0GIu+=u^X`gm55Il;RVKz|Hb!GCUI{3!$~s9odZg zyctGgEXxHanuDPRdL^=KFgBk>F^&%kZw<9HXW#t4Pg0+yu-?A0)gOjk2)70`s^EXP_})d;9U zO9ncH6xP5lU!V*yivpcW##n0RX9Ofm3&OGrv{~wa<|#r<0msNn zrdBPe1-GmgC?N%Om&5?{sv{{ISXea)aA>I!@HiOBxZ`z*9!4Tz3~ftcqX08UO;zA8 zKFBZraX!kL0(()KmbtJ28VS%?w`^e^M&>2-Q1oM}D`tw|6dD2ueg@kbp1;SbZVMYN214Pm+Ei5esmWKqomO?WX zGDc=G$QToI|MW@rOG{N%>=ZH?g3Jgcn-XRs=!3{IPe8UZ<>MqRrD^U0jEyb2122S| z)fJUViz(m>wmxz-W-9u5d$zz>C^Y4hV1K-*XTJsX*t+{q+4oO9MJKBdE+K(~So#7O zOB@ss<_Z=T<`x#n`3D6i@Ei|1N?F+{TZ@g2+l0j;{OC!2$;pZXc5HZ(Z2)5=l0S%g zeNbR*!iN2~(uQH#g9%vH%MTOR$iB#ae7{~@SyPqch>!t}QMG_%VuG7SgEr*Sbb*=B zoC7WN&6i}qp4Q{v{UW;%bL9t2l8=2QRW+3dmtx>Ij!6|fXNtp!sW9_WU7xP+eA8U6#2VJVN4`354YW%$P7iwvKu+QJ^j~Q--Lc z?6~s{o}S2gfac|wFFyzw_w$9)6IC^32bWMFKDZVY0*bMTF+7fZL^79;F>VPl zNcN_z`D>Dl_pb4HWo1>>abgTerRiFh2}nl9IH<+{_9!7x)@Q+^)A~>j@m=<^>sJ}{ z7yA(-<9)ePQ4SI+5AT5~g)t4w1friti_LKGx7d;?5SVZ<1|}T*O30``WFMb@iI$Om z{D_t*ed;Q&0PU590V*((TvGrEG2vkW$E)xiz|qrU84ZBa zx9At8A5UseR8>@0mgTL{0y!!cfN)t@6bUGXMuvt2_~G9^WLsLQU>Hq1KhBj@R#sG2o+#X^54}<{7YYp&6pVymj=nx_ zK>X|(@)2&%GzI^V)X#kV_ATM7;+JoqWiL`RF!iE0KfVxOHNM}jI#zk2yu9LQfsZ;B zBl888np8}8j9e69AO=yR?iQIbv`~;FfB5z}@lVB1pZ}0Ong@Sd+?IVN{?z>XYy08y z(z3D>WqGNKAV_J3LOzD6SqcvcMEZo>B;+H)lnoG@5gTUu{HwB$NuM}>{P|IK*K|zL zUiHZ5-#_A?Xn%gYSWCH8ekPk zPmlO13mK*e@UR|@j2R`p`TFhy{u}md{BP>NetEsa@5-ld5AdK{U*G@s+lLSD&K4az zLL8+Y$&YrTM8iU0a!5eY)BQ`7n?zrKC<_T#nE!eZixLP_qyFg}SS!pIaYVZMN*3y9xeP7}d&W1DHidZi@( z_4ikAU*m7E*Ku#u-@g8>>C~UE-o1VG`QgaxH*ep(dH3tn#yoK`?Qj<1ijl-HltNh9 zaa}?#O9TT+7^|8X@nOBTd-VRzO8~K6zIyW-_8l>=)Ly)N^ZGTq^!jJRtG7di1)?Ha zao&NwW^|CoHU()SkT&Wy6c&6F4JrlGEPwz0=`YWpzxd^sH?Mw)f5H6aS<8&wN>siQ4|eu`lXNQN+=s>X(B*Xi{7mlsc; zJ$wG-}k?7%Bu$eXXW$q3bPZ!Cr~l24iA=afn}}$)5UcNT@lzt z7>EpUBUKc}lZ)Ozc?{o=p8s-YUD~r3kJFxDPsLAYkDos7%*+wx^78W1qc-YN#yi-M zF$H5wVU9qggL)^@rx+L-fFLzvF3ixim!ASQ^5D^<=Z_aFrQUn-Am<_V!PCLKOi>Om zJNIC8h0rHyYT>XlFbs6)7}+@c+Z8#Vin_LfKwi1 z-KRge`{de*w5)6*i<6y|DsnXO%kWWvS2J{pqOGN^jmstB`eZIk2RC3D8X76VTn{|| z>@I$XefR#;5>?D7;?~n!cjNBR?%us~`_A3iI|{cS+-^=ico1YB%svo1&j>%d6_$O5 zc`n$dg@bj-Q#5@ZNf|8^8hT8O#Ljwg^UkeXw{JY}oU4rKZM*XL#_fb#dgFD2bhtn7Q$=+NlO#g zB0wOntE8vLgSWb_zP=tC0wVO%E&M9y+LcG$Zj?O(6D`i)xpFP;D*f6uN!#U{SFXie zrCqss@pw`yk;Y5SIJjnd^uhG>b>JvPBo@~sX=#b&-8KNBBxOB)Z8}WN0}n4;y?pt~ z#ryfRt=Dggg|&AsUX8iTymINr%`id#?Tc4pF4HbuzgU%+jHf82CTAqr`KDzgXKn`> zbYqY!0&7Je)<{Z`*Ho!)SN_~M0&BR6_{Jce&vz2gyo`O?L>3kp}R8DcdT zuf$!TUcPWDA(2SpB_>DjNK8peN(+O{JypjN9H60rYl^@HgbrDcN5U~3MIDr)?j5;w zVPyEi(7k-s?0Z8Ou9W5WT^YU*J;FYJWu!`#6w-U+{Dooh2yOVna6@83Od>leF)=A6 zY7r!vd~>;2ktQJ*OX7l5Eeclw64avW(!s%j^MfNnd-^X93=Iu*OV39Sat4MZSEW95 z%&_f-bZ9^{h!0WDw~0=w8=WiQpkwOn8uFIkv<9DPamo(IXl?b-;ejj_p=A3MS2QjIGZ{y^h)u5rbN=) zCzYPd6i3I$Fk@qU)gY+!kW4~-)J$BP0~tE3t{_o6p-0+F^icYn+WLqdqBpunr@Oc7 zd`B2>O5q~K!xy^yx_f%Mr41*$CEd9qB3{gljtMe_w~)2~S*fOmtBd4za<#c&Argxj z=J$1Xi@L~X&vhqvanE(18)&mp7u`BMcVm5jH_^rDZ^*5Zb{!(3;zTS$934EF1&NrY z@Sp(yw=~#%U`FF%z%5VqwV&-EI`Ol~ow|VJ_cv(IX*nw`-+Z9I{cLCF+0Krv)Yk5z zsQpAN&Wa-Nka>_MsF;H^LXD8yrlh5XmM*7VurXTJ*w@R&^R_@9b@= z>1fA0Se@I~=tSkBegBQ9G6@qr?^jkyKT2xh#<;hYKe86)vEw1vmAyw8giI z+M-)IXWEjqhDLj5G}msrp{_n*ukQx zhtEsLnE$mElLsMguxKX*O;Y>|(cyww+SX5+0csTsSBbfUlLR@tqP7FadNmT_` z6~O?BHCS8{8CzV?-aJpY7_S%CaqF9#PaG77hejq8oNQ@4jn~oZ>l*S8G}oVwt>c}p z>!=lbxw$&Jcm?c@2-_bH*l`ZwB zPM?B*ryFb11Kn0GUADq$U07ai(`oz^?ewXVWA&%wPAN6kmnV2kojhUUq$zV(1%!t0 zCHAoP?%nQY4y%to5{~f+6%lxaQ0HkV!NqAwEw!y-7I7^#wfIT;sk)>4-Bzq}!`E=# zoL8-nK2mr3Zp-TDn1 zd^h-P&aNnrKf$diB{q0(@ZIP#XYO41htH@27}9#d*|y!?2)pRd2)raP+`!)&xvhcyH9t~q+_*wK=bV@FDl?OW@! zVg1HUn_cGHOr17!k$X_EzyGGFqOzEyn#W2GZuRpI2==wNF*h+2Oq{cL!Myo%XU+4* zgXvp0Iaz_jwUJkpaAlEPK3h#qT@e-_w-d!jit!_Q#lr+xte1aEnTp1-W;bb!9hX3_7*ULI+oA{ zLWuz9Q&jjW;3S3`2Ubjn;={$F!#YQbV|~|e+T!n^35zHRp%SopwcD~IFe2}$_%OS; zIAzWQ=dail6d1VC-W1XrT>$}`eT+vajXH{@s>XwuUwELX zumCSqEGWtk-LyF<&_NY;^dgLnbntAq?%9=CR6rE63yQKMcI{m&fcXw@Fr1`{>CIiS zc;V7@fm;IBuP`8y$oc|v*jc9vNW7maL@Ep=&^tBi@S!|BpOtqgGi1w_9WLq^B@UyL zD3ry!LicBh@|k%BiD99BdQ=iA7E=L1rpuNuS>mxdV6)FsSh_$i0dPo)0RNX*1sD<| zzr%S%j$(Fh%C_Jg{u5zkz(~>XgJU#?bLjp=Xk_K)#72a`(h6_)cua{oX2pu7E)Yjv z3sqsQH?Ty2RI)$>VhI>oT!jYd9c_65k;Oikl@+&rTj(MNJeq(3#=u-hhz`QlgE?t& zq01mgO~f=vnBsz!E1cGE+PG#mz%(pFgxr{$fzU(&iOUu7L?D;oGgK8}gEu|<;6Xf- zaqwXD&YjzY7%2tg(H8AZ$T*mpc_1q>CK!^{6ikgi*}=il$8Uq{bcipmvAMaKu8M}4 z7@!VABX;7F{>t?W}7395s5O0S#$!%j*H%IF_YcucIw3>hxQ)Tr738SBFDpur}K z5aUq?qO28gOo60iVr6Bj6oaXOXJ&eOInOq>oVv(;3QQ%Yo|);tkg+&$xrm2@0uBjw ztHC0WAB9J!3NU~I#F!x;LCjYCpIwL&MeWZZY#~X;6wCmU9%D+2#sEN3T;{cA(e#Bb zYu7I4!%D0s`Y9i`Oq9!4QRcx=Gw19Rp^_kxV?8QeO;;!s2!)0ai~tB6ihx>RO59>P zj?t9`Rs#5^9E|};tF*>*^(t34m(?zYpqQm+3iuX+TX74LrDc*lX81}<=oO$56cru; zNlW@>b+kOF>4FR^D}9hpC9ld4g{HU^X9mdUS|a(DJg}aO>2CCJTIKBQ;sQH7GNx)Y z3Ra2C$pBWRzyPT5cuI;WqMX7aLPPh2#UxnErE@LDf((R1QOvd<*t0im@BRb6EF4x9 zL&Az=M2o?cSaUbHIjnMYT(v?MRxFmT2``E2SB!OHSiOFS=Af6RzTaN5SDaN+6=(f$9RTvP!oAX1ZWwOtIFfT;)0p_?%lp)`}W=0n-$O-N*-tc zY|TzRv~7Dx$o6gF*khUpf}_khuB?Btnp=$P_or=B(gy0jDEjvx2s63E1Ml zIV;DS4d^zNLMBsaVA;&t6T$ugTebuQZVB3uSS!+o5u%XcElYt>QLqnmS+Hcu(q&U& zSAi)2f+3Q_qzF95&2nLJfsg?5&ej0jpWz#nRpDx(gx+;52!D%dm8Xdf0hhWm}Y3h!(=7Be}RD_6AA!$W_cU~MYL4tyZUeT^YdLF7++K3 zH(6k;r*CQHTG&;NuiHrY>1|r)v2L?>P)Kw9f7{i^JmSSKX2Z2Bl$|D zN&t{Hin5A~$-q-Q#F@{gL9i*#+pxjgXRVLV8V|n^JRvb^lZTg=kB_%ETymW|*L|J$ zdbfqMXU zlmIju#Uu$sk`Y8P4w8)vI9x?2RFN>%`5sah?&?dVkUDIP@!hdvYn(0?xT{qTDm_$z`x+(0uF`CVW9UKW3I=VHSRHP%I+?+ zr`j%c@o-&iJ!8faSEt$52{yPb#d@4B+(rf&e?fohr zi(HglS1-4jK7F3UGU(ilCCg@6+r-RZPKV!ZrcV)Sp)Qg+nh0teg%go1!ssxEtVjnf z3M}JA_RcQO;#Eq{tL9oyn>J&{G;8bWHq)nBPm8f8rcHHoS*Vdk6#%k1nO>>V8DOh#g+5>v3LF;h6xrcD}aWg=fv zFq$&)6Pg;uS&=ozII2tvhJILwXl1I&BEzDqprQeA z$*2)%+)+4@3=K;-d^RK$@H|7ycnmx+ZN{uQ(-J1)lXw%ygJLZu8fql7`2Zat1Ph^U zqYlLlO5{UJ5y6tKVJsvj&?ZhCKYqga*a`IUa417xodZo&Do0iQU(fzEuw+96ZV9k# z*$kRoIYw62w-8#59XEc$1o1e=*s)fYCi)u6kaN+=bgqi33c`DEFaTggG#aS?IP?JH z7H|kfCYuG{K&eHPTOqiDuB57CXo8YvNTiGn^)!{(Xm^BGaWaj`Q&NJg4>m%upChUN zg!@Ki68ab`3nZ$rfuRc$nJgxQ$z;$O3N)0O5hMdNZ(xCD{C&3lOV(PzTkr)h| zPRNB(DDbYqVZ(xxXk-eNN~7TlnshK8Nrk>cdI~<}^HmX-`Cs@c8~Sa??R?8nW$+YJ zVV4rg>x!u8)#T4-_p5@ z=_n}6?Nx%2hoNG!Mu&<4{ROMVP<@C6p(JE1PRGEbWN-m4_W=(@00aQ+w?%S$`M~ei z);8o@VJ$LVrwK!asmx7}Zx4I>rPU3M@r57~nc8mjj6; zu1rNy&KCigGb&0=TT{(S#o)@1KV`>cU;cbG4WlWkakq6E&z z<*3IfiiNzSuC1vH$F)BG{{6SlKYja~M=WWOW++IQLK&$6%2J1}Jyw;56~@z1Td{2>)Jbpi$(jvc6LsTg1_&txyp zBfbp>m4M&=D*N`e3r=Yblt@VuNegh}`v-auBknsPV|`MRnK~N5cFeH+r{sluIt3}EI zqWob02-M#@Zrtu2I3Z<82BZT`CgTh121d?EIRgXI!QKmh%KHB78Xg)blPUrtf4+Ss zOJ(DUuED`G!0#Uz>3S#oZD{yXrIg)&z5`dqm>PIn?_i6RJs`PwvH#C+z2`6V50oRa z{<$n2jEXUr7xsZxNu!h|89IONcPTzlDOHvX_SKp|0*-OU2Q&dgUm|G$ONWOf{R0;z zaD&o-w8sMWMX<1II2XXFxPb;K9onV6{pTgsQstq3dq^E=bQ%?#?AI;@Z`Ml{1_vbF zebW9aDPMBFD<0qzAoVbz3}Jr?1lOa2g0!o*_)F8rQ~)3g~TAuEa)AokZOU5Q+4$q1Zo7xTR&|8BMwMS2Zl~N0Rr$3hSB4O zBjr8!leNi;*qkH1gXL0f5K?=puCBfTq#!Z!K?PgD>1k36$&eHXUNlT;Vv!?^{HMX=c7sMo37zaZl8E#qwtf&9NTT=Rbv9!Fr z=KQNzIuqmA!5N_AFwRnGIY9E&HK^O*KnMo#Ac}MO>;XGtrOLzg9ss`oCy_~Yl*m+4 zb?289J{alR1t(V|N2SIf@kBYm{QvGc3NVN-7+dIiFSs&V${cFn1yk!E{3ibQdu0_> zCACi;?Promygi-6{R2m(HXyMKv05stLFOsccNBBTOu3yX=HR#zR4WJila(Oi=3V<6 z^+_2~pQ?`6y}Ij)AgQ!2sD(PE&bQ4OK41 zIRBk9b)vGO>d3%{GiD^1L=ERfQqs`iA?YNLeDoN|E(I?GBMZU-M32V)XgGkIyI~RS zaE1j#|9@suRaTuSx%g-9IEa4F4g$`6wVWN0E2 z?}QNU>Goz*sQ-;$r3L&da7yXP+ux#@;I|#pfx*6!ki?DRYr!B(-#xddjw|{W1w19I}3S7prmbbrcgLybJ2Tq)I*|@_Boh#J` z*#!kf$oOL=P_jV-3lW1ROFdc|@G~4_eBClwjs6=Gi~PsAV|b-Xd1=@0ZMFa{d9@5k z@=Z7e7bF8Ya^d;;1%+Vyk)z1@KfMpW0q-|7;?0U@&U7}o!qWafu(Py)omEnCqP+CT z;Fl9)m>ADpGO$M#i@(wj;>UvRd3lEl3XuXdyl8Ys1OBh|qq(I%&II~A%Gu)l2WRUu z{-@SY($=1(^_(19Xwavnw*cW6X1kS(}BfV#(ZH-^{=KaZrtIw{S{%FfBnKU7cv9e@!=@m~gE2I3+9Po1t$(gU%Xo8(Nd;9FmR{fp^E9OV@sef%~TfPdH>kuaC4!5q2h%*=yXV0#`&FFbs> z_$V^ItPGq3%i_tC^+nF$bVUDp_crmJ##=e{>)elD-+q0F|Bd=3DrV%J`SQ?|Lcw5< zN9BhPO9ry!;hvEJ^0RV~`+pAa(GsB6$=zR5)gT6tOey-;4=>?l`5XK->CKzy*XnOx z|Jr!!)62JSUjF%D7_Ps5{pLLo!idB4!o&I3K9nMy5>m5GgZ-dH2<}Nu%Q%pkiMjz! zk`Hn*ic;jG%F3E!ez4ZsJpgg|D+=O?#l7OZ{^jLcIL8hrmS4Sj1=snnU%nYAJXBa% zR8W*v{`%PxKrvyF%D=P@WbQBi(sFOb7EPrQ8#Rp2xkQAodvkf-Gl`(SCXU_GWpG=n$_kty}iM7KQ23|%(bJ(j+d5~6*)o=9AEwN{OQvt&qnEFFP_Ff!=8$s;ZKQYw5LyB-mlBV z^HlP43)0J8yxXXVDd_|3U_0192-(PFke`^8oRX53egG*zu_X6X5iCV8+?87mXyi$S z@1Hz+{P6L^r!RnJ_VjuBBMeU0QJ*~OKqNDz?5ytZ=jUM)+!iQc1{K}sL99B6O-M+B zauN6+EQcVK&jGwh8)EeMk!tkb_{lnZ`0&}oMM`ORUp&ZuNPG0)=}>Mak)xcQn|AE+ z=SY?}0v&nOO%57Gl0R5cY?%r(iT@&WjtjZr;3g z{n<}$+N0~Y5^j=j-MtlmlY0AhcX~RJp`4zXl6%?9ETQa>4+S$ThI7IPq-Nj{ktjMQ zHa0#H+yaA$!X$4AW)yNbzaY<79m5=2pIjrZvv1wXkn_|o-M<3-G=*!|Ze71|?OH7S zc55geXwPAIgbq6U>KhU%nQ5m44;gwf?qCH?9D2?b?-_7fO;usr;0*OqXfmY@)u5 zNyBV9hG2)5F3;>EqX5&Q}fKui5~}~{)`7BS1w(;eBmC@*sk3W z2~Xa>csb@0^YX>(H$nxy@;_)7uZ>hCB;hH1D0(KW+?ad-uR3i{!>no`Ng3@2oKTCx zMItdGWuXvCPRUpXGtFR2);1H2WL{UqEp5col!{`p*B3(zv49{He9}*AXgVdqc#Mn4-JTD<0f-|bInM1** z*2C&Nsw6b@ry87y#$$A#N2#!%L5c7U_edp&bQP=={n{^di~H!^u!%i;KqQWhRusqW zuIOIK!Sr$=-5r&`Yj@~gc_&7P1ym$1L_I*|Ded@fNe|IY>1%B56?Nl1(cQXTJ?Dnn zfgo3~NU><7s~2_-UH$bnU6QUG0*8{XA`!FuNY@SnOed~u05qUPcIVFBd-jHg;Sr>L zkvOgdL!Yn!JcNKypv(21Bf4nk&OvT}E~$%iuKTRC)mELjSu|(k>3*V%d9JrEyFzj< zACHO!6imD~``jTRrXA5Sm;w7csWc>H*DksAaNvZ=M>}=_EJDU|_FPS0TW1H}iOGMG z5QDD0uU>mjbEl+i^MSrLpwD%7wjWGxIae69ACHM*M-pN29i3A#4gcn$40#M~581I} z=PqP@7@XeZL*T|NfHm0(KIKSZX_vwqbRJP zvnVnGQQ*SyGgoaf6_-=Pqe8a^L&*@Njygpd>=w_5HNvj|G3y$;np@+~h+3o1Fk9N1 z`tlaUcekFw+prem46C)Jqbxk8`e;SR|H=Gy5k?M>0my09&6Mtiho*r~Ok-CEO``tFpCRcD&uQgkz`v7?#@ z%`Dg-8W9#7!4BWm@Om-EHYvH-4=Nbo?=68_w+3&+cW5B5>^62g z-B#BqZs0c7H=Jo}hMj$DTQh9U@dj4Y>9(}cX1Lxk+TK!~6edmy4~GxV2@Au+i7-}3 z?XN2_CcWr#A1E>eMNmsbnqUB+KYL*S_U*F=>i^H55krn*zHrwvb?Zm$)4xH#K6t=YUcA{1;54c)spxcZ$pWMf%Z`v%kG zlWVj8mcT%8n_LefxP^zUf};wvGTIt)%vLnj)e@()YELy(CHvVgm@{YI68BwMH4Ud= zPhMMFa-=TylyPlsV_jM7YN#~`t;X3p`iF*t^MNY2wes~2sI_NYMw(EdZrbc05CEz` z7sM2b*}Wc`7&axT`Q({U^VsIMDD*fwI;~peuzX{7bv0f^sjjZ7imqf0(&S5K=Y)lx^7P>jym>RR>|cW7kf96O632tFf%A z>d4ytH76j+J{GuaC1`PWCRQ_CS35iSWRzC|r_QvzvNY7$!FBagYp9q_pKfhEZQ@j~ z9Xms|hxi|R6mJN6;Psj&M^)Bu*tiiXf~W`#LZh`aWE)^I=~Gv1*}gT{ujqCR=!%AvJ54$V zbfK#2`i;K6en=Y%jP1dD#)B^Js^VjiwH`ZqQJP0T=#q(4;-FnM^cUF+=) z>xB1^lcW*ojnt7@n4^RWi!yU5{A0^0I^Ay>qG2P7y_Sl>*Wyw zu^6<~38-NU(hCmdlG&X<^#7i|5Um@8!Q~UG4=pNPSa>&i2BaRSI|;!q0%t3i`mCKI@>!5AO8e65wTu zVUzb4=H=kItem{GE%50n4r&-B9_oga`N1J!2l9wqW=?)wNXR-J*g3{RsY%Od!Qut; zT>SjjHbI_iV#&FoNCpJfv#XLyt4E&21sKXF0S-ik;qwl($9vfifG0v3Yp7zc&jm_ueNOG*aL#v!!R=dKqfr+_xtq+$c0Txu~sjE9oTu+z@5SV_BMifkK zV|p4&c9Zas@Cg_crOnAu6=k9lEM0+0qAnrgQenpypR@@+V~VQ4fCeZ`1HXpA41v0_ z*v`?*c~3#GE*!ZLsDmq3G;DuiHTfI`vWiDK9y=y3Uc8b{Ve{1V;OwnXU!4b)2DyI5R3}$Y zdvT5-3R~al(a|x{ z;(gooAvpvYG?t34r7~5Gs%&YX!lGfz4v1qQ@r_!jK;vncm??1BG&oJjV?aF|`l~R} z$=%I8F@+855xi^7V;j%>gpUy-jY>(dJ+>Fwg~J;aUUVqX(HqFqXO#dBr+JFwU`K_E zqjni0-;<~eo{pvI+SJkm8>}o1xr&(00V0|pQufcJF*QsqCx;zA95&g~RGm$O&V%yF ztJk=>Z}rAB$C&{-NM2K22N|3kx|f$s01}5)!#>(BR33XUn@1`4Uh`pbFu=u;INCVw zlaD)@#!@x2aBlk|`#i8}f(2>kP{>E{oavy zyannunWm^VMnCWM*U#TR70t2GRK{#FBO>=jq(s_MIVJ+PXEHb({nTrmAs?I$sudTx zyDhMu>)`1Llx+%i+v$^#-NE4v)N_RKB9ywf*FMgU3aXt};Vv7%>0V9(;9brRiwc7? z9Q!k-j4I}7j-Ajg`}XDg*Q={dbd<5V*^u3aC5RVMl?}&dyho?9-)BrQP(wTrV1>J^ zadvcZUFGa*0fTRwR96G|AOPejS;kxG@)A>bw|%@FAB{FdJDTjSGvP^%!2Nir_nv*p z8-RfgJ9Dn)IIH#_-@g9%^MbR9E{EovwFmf=;`miGC8G&RZ+?9J`r~!#WW%3&wb!{p z>^eHRIA{W4CAb{0XL;=hP=9$%1rGy}cdE+nn*$0c(~6{Ks|J8@hY<&b^}O zDWI23y-~ z|K^91J61PJ{AyFB9PM4FviHyEv^jF4E9{myyXsOf zwsS6Ii|7nDczCpsSb#_WFY#V~N28CvZDbdyS$C~PDn^+mB@fe7BY3}K^V(E&-E^BRIxiO3ZTpHkJ zgqNd2ncTHd%7FqD=+gtQ!kW2A9b$EH$kw2stpQO(U@NQZ;s$EEDm*fC@8SIc zfm?%s%$a$32~AN&9oOgRX{vIWRCrF)ar25L_);S;2NZ>y^Nz_Y81j-=Rn=$(5mhi+ zTI@6JEJ2;4F_>lI5#k@XC2&(}`aeL9@`?s3_JFd<_V$hr^C1_) zW^LKB*&leA8JX6=TvhvBt5IDB+w7F!1ubiDnc8h5Uhzzh61$FR|c$_yJ+D& zXP+6cyE9!9BYm_)?90i|8I{I46aua&bjm#gO6$5uu8p=pZvl z(bup5NV61qqCizJydlu@aFvrYx3;yhPP1aNvDR0Vm)9^c0PIvj&p<^^F-t*GUPemWYOm=Q2tj&X zY<4ExJRMM zB?Ac_g#6k@o7nt-;IHuHKoWD_Bf^Witd zH4RLlxgxcxshNd=yp*(bstk#=bec?xw2X|jjH0QZ{chl#Njc5p37K-DQjt$o6G~xd zkU{=Y=~`iE3UhN~na%J#Mo-Qrt^{#sVq$7)Y^;(cg^^B|5|Ne^moapAm8B;mA&31k z7J9>>94yN7BZq)L2);(zB9wqpfiR;fqE-$<{JcE<-$_t>vQ8XA86T6^@6mF~nAzGu z$)~6Hp1_dssMt6#hV&1VXD5mi#J~h;v=UcMYG7_rY8Gf}Vr*onr=z6_)VUG_wv3Df zxQvq)?h=qe5(?TaJ9Y_6NJ)tBb28FUQ^0d1{4Euepo)g3u7Rvu3 zxCFHLX>cMyOcBm8;^t6Zb)eGK%(BRAhbc@9)jDdb13|98^C2<1C|N) z2AGeike~n`?~d)9+t^rHpt&(T_ojd^Q%Q6P!9qbz%fQUa&bgh34;chJTvb!Y(8S!@ z-pSp2Pe5p7%zkV#tQtBqvj{sCC~&3a`STx)tW7Pz;4Tvs7@AO3i{>RIE-C{4x5S1GBXBk~sLr4052c8fyjD5|Jy1JZ6`>)`C}vo|m_A_nEX zlQuRP!d{SHSbQMkMa-h2laZxqzL@}V(I6NhL?B@+1i4^CMi1%QS<4Y(Bgczkf^9QtRCzl>RLJm zM#Qjmhp-F|jU-4O@$m%Ni5N1Oxmks&RV^R>}#&%n^c6dp%y9h_X;Js_V;$gc*6p|mkU8;Jwm0;xsGsTt`d$;nTDuB}(E zuYGy%Af#<+XKsOma{*^gYGwurjTBRy@g~?<43J?x-4s2XE>4e2SKq)Go+seO9iFz~ zu3{s*if&{B0&&3(@CE-$W8Tmn_fGfZK2F>|Cug?xm=xbWSmTuNW zFjQ#9PJEU`c|TO!4!2#9i}rz}w?8gG1fB|zMggt@Wd}w~NJ>tPkNeOPvJTx0QA5LT z-`Ce(j_O#On46!4O9kBGTiX(|P%bVww_T8gf*c|-uZej2s(f?iyd(8KV@^4t<`p$$*6u!sZ3 zp$AX3ur#;u{RjG0+BF#G=hF1b(#o@?wnfV2CH&&z!a~m?^~$rwmD!cGpV0b>dTnuL z^~EZFe!dk?F?;*Y%ED|fo^>9-^kQXx5gt$1SMRMa&nzzE=N1-P!2UeGC+0YC8}mJQ zmIe5&rN#LLcy+@3vow%&j~s*@~gzC?1<$?8VbAK>tgF7rd!ralRW*0fVi~d`($6hG(8%oE-#?8LEQhV~6Kwm*DVD zqeEU@UYJ{erpw3hj0^ZFBqG3F7l(V-^Vx-kGhlyybqPNUOvh3D7HAv1H0uDDRs!v; z9QkkoynhByxwtStGl!q+03*wj2e$+5EJC229d4{F&!53lEiU4xr{`v8ar1}qEb~h< zSA{lc=S`GUAtxU_g#)1hcTGK+o|&1Qn?HhQS;Wu6BO(uxcBZ8eJ2KJbrOuvL2GL|015R5Qt}1+rinTB6O&~jJpPX7cMwsU4z5CE{ z2)akpZX7op`22hso^Juadcz-4&-(u~Q~ZZ|-bA8vVrJY3%A7L32B zXA(#(SoO~>&L1Mo?arNHI5L>ueHe{!WD{^;)3{mKk8<#$3;5*`7wZ2Od*0+eGP^Y2 zhNpz%yLJ1{ZQNbVDDEE9eOPz!+2akL!69bh*%$CDclSaq_kV*ulQ1}p&%@5g3qwLh z!tFbE2p+r-E<_74J~=TtHI2e>c0Lo&v~tTAZg>B|o_|9B#{V08_I$DmTT?Tv8jLuE z7-Tf}5pd;izC@=G^5uLge$&!}G&slpFYuY=ckmg*lrg?Kw*coGITQK7>K%7e^m2&Q}w>-G2plbsG|)2quPy?*JJ^@c9E2#*cAN=%#0; z0_e&AN91!Vx{5u;)hy309Kh3qCCGULnvJx(K^#bT8>b0G3WOgTesXg5QL7-h{J$rk zb&t+3Pd(B09iLk~0NwrZcwl7c2&Dxu`VhDW`h8Im{WJCe_lO>iK5PqD!T$;Q95A{# ze|-1mF1Y+v5!`YSdQ7oF!k#FW5KwzUn4>tyJ)nE^@X3e|G_v>~lFv*&_=R*fO!cd| zMdI+l-1G?$N?xE}7aaaS2GEuSfjLqm1pCkbjC>};?CyH*iNPdJ;x~@|Jn%OHkOK$r z1MY+t7sVzDO>oftvHMT@_2~aU$Y)0DYryTv9Dh2$P>B}-*CQ?I0@NZ9W&kBezgB=4 z{P)N1q=Vo8$K*4k&n^@J@HT-;v{mAX)cr-m_{8ubR6D>56Ssu6otO>sIsYB&+i%Y! z_B{LoO)f(xzx{?jGd2>@XEFl%?9smfgVVy`XE(Hoi?~bMQOOZ3Fw#QNse5~Pc&yhG zPC@mR&#zv;%6rX^&}Z8LBKq9^Ti46RrpCtK;b+!t*b^%Vfz#cM>)AytFY4P^00@8L z={0<7tO{zF0Dk`P?Bzf3Gs8>N4U+&rf1SJg;w3=QWC(u7)l)arHPk%%@QZ%l2RE%1 zgjqmxoLKsUyTD2G6Ra~qR)p8N3}1=`7S3$`^}p!n?B{e(p8-=%grA=g;pbNXKSR>0 zuA%ZD_}S_D++qc~|HA{DM5sD}DxQlMFW@dw5`*bFZjk=w&}hMq{|bIiStUW8GdI}h zlp4l^wZ#BGBee-KB_jEFn1L*ePf$)kDFVR;v=dap1Y!|kIj#*2p7($WSVAw&#U;2K zCiK!=T}lV|83+HSE|V<5f4G*Go&y051b$6*UC{;s&CNuK(OiVfav5PUPITc;QbQgb zvpbNwJ}nTKtS)jJhcqNqGJbv z0v$eaV8Xd@5sKcBgRb|Fm_jW7BB1drcp#vm?*P4q}L}7ratYM<{l>cBx$qL-~txqI}p%Jm0fwwT0TIP44E8W>9Is?~Aa1l@m1 zKyy5qx>^i;eQ9Y)c|p|%0!@w)J_E1NE5!@IVG|Vw$j75{91z;hp6PSI2;~f1xO^cV zXd#P>{}F+nLkKhl5rNJer+EBmYPh;ErG%xpw5U8^!Mu`yKr_WYUV&SUV#56kC_o@$ zfOAl}5;*6~nLZ~B#^q%1w*1_MnA4D?8AUSVnxQ*pVi zTv`>8f!2Ps1h+`VgjL;86$phnxGp{jn_g!OIaOHC`NK-UKtn4}#6aJh+hCxfmFGVU z^w5*hvGn_tWA`2rdwCKeXy1Y|T*qm1N{sY1{QLrOfk9tF>3)J<2P+M8=>aPk!Su7) zq8L*7?iuLp2@v#vCqU4sv*-Q$_tHl)?ciISZX;Fc?uMVJgg)x<@zfK<7`yKo5@MZj;>_7`j8~ z{CV@iE$IBoePR5@om=U*Dem04n3o9*G$sd^MVp)4jTmUvn{ba=OgMoXAyZFK0gwcU zG{DX?$OwU6pf@=C2;NG0V}pT)54VSJ-bjZ+<(osqR-i{l;oIniV>fTy?k`HuOv_?G zs7UVquFKm=FoKsLzKZcX!DmpngOnJe6oYiRj?>5tVuCPik(ckL4w9qJptn*6Nv>bd z8l=5`>t^kCDlxh}mqxFp4pIa2bmInU44Roim!2JS3}Mi`$KZ{W#ptmMUsng6=!g>` z#PP9XC+%Q#7#sBoy?WzUpU~86FnY!{uB)g~XabRg-e?qh^~HAUkcpc0ce`|lnVervv~}yz-f#;ao_;%AT?Ao z5e^wTax=6YvxPy41a!~U-VFkpo=8CFT)S}o;-$U|h=4wSxjiAHqd7StDGN&*AK$Z} ziDA;Z1h-N}gcw1(2B8cNjf{f7^_UF|Odz03&LaYP2W;2C&j7%KE|rKi=sAD-T7ggJ zMfCApZ|b?tXD@Z2KBGx-iSgLP#DtVYx`c#i1VYmb_dcHkOX&JSD9J)<5~x17MkcV; z?g9XX>7nbe@`1FGK{aE0j$Ha9l4wC-gjV$hnL4G4p#@9AkP!tRTVNw4ngJ$n*& ziV8rP4GfwAVbG~gHdbbqPJS_o`(sk#=nw_{#sl`_!>?z+2ujnGp&B9NIwY&&>UT9X zHHAP?%mxL0?li)kPj;O=+nMKMs-dc;uICU{c>-FUc2S%}81%{XE*AI+0thWG0 zu9Ho1rkeUDIP=Y>h6avFbtg~4E_wXe(G%&%*-jik0WfrsnW6-=sF9Tx7glqRh>ea$ zF!Yh9`&mgbwNHP!57j>rl|K}698eNgmj?X_cjI~hh7Pc(JK53M(b-kEN7DekwQV!d z3Z@2Lz(T{z20D*-q<69b(9njpHa6Fm1t}Ah9%(TdtH|gm+&-GXL(7PTu7VrwBEpR} zlI;kp6e6B3tpuKFKYR$`&_~;kw1t~k*Z_5%Vn;*BDLdG@BOJP&{77qpqaDr(V~SHEg{*ms z0+Y0gZ$v~`_}-?u%pJeXNP-z8=pikVAXcME)l}80Lge_KY;A*WxUIFdy}j7M)ZPZv zZx?r*Cyke<8{n1>fd`MaX0*|?9&Sx@advZY@wCHfk|ViC8K=l7V;mF_9J;4rIvs3P zz};mLUIT1__65Q?K~F`(US-w6$`(y{X!Gc70_?iAwWaw`ON_NGfOT%}CaN+LQu6BN z-oEbcE^)Q(&1o$x&CPA4zOEjgzAgqbJ9&5oM3pqva4L-Q%C4ayA-;8wv2cr1hDUJ$ zIZ^ztsykdUBd`llUwNRS$qa22?F~(7joX^by=+{Z+&!!%Iq47{v6)NKG5}DF4EUyC zQv(puu08?Yx_nzv-!gJ~w%uxQS|}@;1%w9p)ILH)bk*V%ZoYt!&LC=FgrYEXgNAhI z8c(?GvuLQVPp#u@sK+@wx_WvV!f$~niT;CO*YgSRimGf(ucK+m-m^E@j(|hsfb!i+ zxm{5k1WtY55Pz?lhyDy?nA&A{kKSAXAuodj(v5;b@MRe+T;+jK=vb{&Qnx`vSBJZ} zd3!^9X95ikm$%LGz9GRGbp#r^t}H4j)Q%qjNzfHJLF(gB(bZ7bat-tY8rqSZ64SIg zF*`FmKR2ICFb66r7(`g>h87MRNwPdCMmA}KhCW#0@8KO_1_V$Rh8oaK&ET-OG9nJ0 z85ZUauQJ%cp|y3jH0}26@u<413juayWnyL{Ih9TDVLFJGMA03YLSa%?T3|>DICMP_ z&$LxJdwl}j#gL@?i-x8$4~x#MN~xf!sz{Cq_y>m;0)^AU+t>5JbrpE?%?bSDsj1mH zLVg@lc4%V6KnowEnhIDws7g%r+Y_qs4-f4ai-o@~hgdA@a~_`g(|mK6p+B!=Qe4?(yWqk^Fz`cS*92!HKLc)q6*9=W5C@m=|F3ZCD{YM&F($K)v!`<&7(9m0)dmoRF z9tuvrKRX3WHJ3q1F{I#-Im7{EL4hK{hlLdZ@YuO4d4q;d3X3oY$SxJb0X_SmyAnAF zq9i07t{K_I2#C&#)CTn*M@|XfAcs{W0@23CrtZ#RHIT+<@hnKRu@Mk&8k-^H;b&2@ zQW)k5!fXnGnIJ46vRznM7AXa<7W649Mt{spj);>$Kr}fi1qBrij*bm+&m`n}NdzD| zC);NOh=xW~G?f1WqV-J7-E3p)!niP00+K+DVeCerHWa17k%*Ck=K?N+1s3D?K}8bEj)@lTt+bL8`*mRLg!9N2Y@Fz6&Fufa#9Lf zRzXpxOYka!XFm6hxCI1u|HIzwy=D zkF`&&y22bx7^SkrWNczSR+(%wzqtGA`j55s6>n)imQ4^VzffomOIH_5K%ptqM(>P5 zQW=>hWZcoB&rHu|V>OU`PS{s6GIIB8q7Jn2xcJ0`1Z=Sk(Jljrq}1qGIVn2i%=|J{Z&KEU-W*We$&SntL1-&Gd!Xre!&OPY_1suYMh*xxDCg1ffIu?{h*~}V0pFRh zmEOrhM4;8(5dsbE>Jb8M*fETLj`C!>Nh zN6I3$ILSg*bjKzDpkq+AYDiv+1SN}rq|Dx&+`Y1rd~9?eTmk^?fdFVj8~g2K7zUrS zHwSS;%)bN{5CI{Y#*l980e_}r+PVW?qrQWciF8v;9Tt_y1&8>T)f-UIv$FH-+{wei z$^h#J__GB8f93)FnGD032xUO1oe?oj4{7KPISmw~a_kmZz$8=_!0!?n5EKx+x1b2h zg>e)N2r&X6hY{%K>f*hD0k}YcAiwx}L_aeyv9O@6A1-_tMgvbveSJe6Cu?44Htc-v z>Sf#j4M7tiB)#w8hA9cc<=BG?tQqV!fxKW#Eief1=DmB0OXUB>KGOpapbC|dfQ&%> zpI?Ai*0E%`iV>O!Zotp}*4hSoTDG1_u)m9(IFGwb1<3(|eucY1OVGv$`osOPDlBVq ziWXe0Sqy@}%wC_s;#ONhxI=*3Mc4!cfPKb#?)8OwJot}~Z%KC!f}gjNvT@snIqK+W zYnlWj_?gn{+$EGZ#`QB3%peDXOoki?0aA(GnV6i26^Hq3x83UtuSW0$__@JbdN&Wi z&%(9`FC4;pc&GS?`?@>2?{Nz#JDF-GK!l%#oT7e%pUE~mUF?MidP1UoU;uZO9%b}V z_!IT4YU~c2#TMAFckT7^_VDs_^^B`IbG$q;G%D|K&)Mb}XSY-@4R0$ecOOqTA3&eu z_Sl=4ItA^IbT`yc)l$=sv_M_YEjxQI5IZsTAz6j!I4H#@#{5V%c2i=UHk=sb3Z6hd z+j}}Ygrt`@9_c*M(Nvoi=nin^YqqqC!>o`$ljhPu2_pdI2)q%)7>y2(+d0&?!m8#>PK zD^!h@OiD=cMenp@Hgt1!0`%G0$<7)cF>Os$4eXs=oSmFq?R6Bj>|C8~5%>(nwkZnY zipoGf%NqE3z;hVsrpV)vDMva8Os5wF1VV`o=s5(r5d^_oHCXzj7(4WaH5M&LCn&JO z+0!`KJ3!Tqp@N3FJ>LDT}Ho$y@BT1at+%>DP3I*dvUX zG6#`jLp~TlCLjQA)?(>!@#YBi1@hV6-Y&zI+1?t+XMJl28(koub!{!x^E>l|tpcJU$vGC_|bsA;v>&56m;YBb`6jvxUtePST-+Msf-a-3KBm(uL5{)}w(Fbm0w>@ID_2Ekn~3V9_Wo3>BnhrKMA3Nn~Ww zWK(5!Ny{pm`Z)+wLIDS#Z{y)3kYVT`wDcnQ1ErZz)PQ_R1!nt2=ZE^?M>V#3Cvm zP^Uwz4uWQ9XdOXoYQVAsJR9f1k8Toye3k<8SxsBd&_q{GJXexkN>WrrLdVSuq0g{v z3aPbit*G#!9e0G2&_V8BGSG&rHzdnO>{b{y-d_`HMIkcSd4#2HyYy&-_i_pajl&gRB(YxFaPX~2aOi~J# zG{Rmmg@g`6&dMt!1}Lu>kk2?VQedEQ!fGOt%KBDzX4=vO_?bdBsEClYgd{G}1fg^Z zDntlnFT}+puI8mnz%w2MpCrV`K}Udn(V=!q(3lFMo0Mt0fRKm;P6{WXBPj(9lT|de z^^EnEpzjBIg59DW1kYThQRBih8O`cLkvfPq(zMLi+vYUu*nrzzr;i^5)~O1 z9Owr<$K5;}Rk_gvDm<%DF>TuolqV3@z+Y-{bgFj~TF8#ph$mj%YN=9}; zNkw&S15~0A^3q39t2}g4bs_l-ZE@!=T)eO^30I2cOib7x6B!;7=#LCJJK9-Wni?7D zi!i|z1d~EyLP^WYEg&K(4e&D;6Tr{p1o)YjUCzeA$<@o(KPW6JHZeIZ2MpHKH$xsA z!U`kVk15^_2g0VQ=!JtI>~Tga;TB04x8m!4f%dZ4xuRlg9{3+9H- zkkhAe-IRU3=b7O-u@K7xZ6YGWg8bp7KQ0agQ@UDe%1{XbIZb|EPNq#{dB~$U5^-`m zHXZ?CaTy?=we*b5tpTtGNH;PzF(o6fsJyzN1+@i)vjxs_WCwSO=FFMib0PESpg!Vh)KK86^!P>$V*`1%yPU z=<2m6Ff3|+Qfd}*VIzbGl3fTp3UM1ed+yY;FYsE6LaadI{^(ybf`zg$ zHq-;(DFAXUvRhy$Hy6ABiGhZK9EairN1~0INHemsb8+w7B_syavzn%^5wuircK7uU z4v$Gdi&k1y2N8+i`nsBGDvHRH zV!{Ak15nP%nF6m2)ZyCB&C9n7RRW-%-w2KeXF9t9j32rWc{8`D;sA8Uku!PfkUqond0Ne~g|9dB>)v<;;N;AYL11p@SC#`Q_U}ORn5SEZ1b#etuK>S0E zL3~n5W=>vF8JyrK-%iwRz^SOJ4R?eQx_z8%UJtr=`TqL*ynO{}I9y^L7L%BUWhI!5 z-WM4GcgcYPd-wQydwIIUJp_rfbDEP8DmO=U_3*N%pisbj9SGx< zhYNB0;2Ap?OOlwFfyE`}V9DU=5u2ZAfNDJ8IR|AFQA!aqLnz7pE1?c8-B5GDe~Dae z?QKns>qi3D;SIy<@Xy-X`j7Whk;#ckJ#c|TkHNS!2|~V$SPy{m<;1a&@Nn>8H9>rW z$ZBqBTK%;C{64~;qZC7eFc?kP9nlpG_DF%a%QN`7Kkzj_KYCCLo(Kp#HZl*X4N_k0 zApY%_uV23YuYZAwkI%+hHBf$sU>xq(7`%F)um91n?|1V=01ZZ-hvK?~1z1;D+duXN z#=dt#A`%|uA)kQzfD#se_Up&m&(qN21CnagG4FtH|I=STq0f2GZgOa=<2VK9)Sq-d zVX8lWtgn5ogcsawJ4M)${`CA|#y{34;hpa8PyYPmHzxb@>k$T)u78_(IEpzVt4IG% z`)?`_tp4$p|IOg%TQ}bQ_QyZ|@!QP&mp^XwH-q0-Ua$T3$3OmY?bX|Vul?6={@VZJ ztNxF{wZH!V8-M?V!yo_jH~#+ae}6paelz$t{{F__Z{hIAKmLuszw!6SgYGwjf8+0O z{QVXVfBfU$`1>1we>~`ZGx#_D{>I;L;qb>l{*AxC@%P7r?l*&f?{NvyF z`x}3MJm`Ki_&5Ik#@}z@@W(&?jlaL~_s4_oH-mrU?{ED577l;>Or{rV>W*IrM5{^w7B{?qrBt8f3j)qgC0ohtpe)*pQuG#LAL)?dBKr#t-PkJtYF zOu;LU^?cZP-hA&(t42fVK5+Z30kxj9UEB_>Y76Ke+;6>-7O%sJuo6 z&`^YIczXKJI^e}%9O|P;Fb_vS!RT;y?$w7c-`4*3zrK8WyL=~g7ZvJ$`p*{`lVSeF z(YaUu+h4C&9uGD9azlR^RC$iU1o%iQVlb|S@R2Uil81+$CJP#KVz%s!+8-VmF3kg< zF&qE4fdBi$AK9QoNhI;NVFYq2!dTE~Ei5>aI3;MOhS}-kyJs&n)InbmWdvL3yQtY7 zYKa41Fr3f2#kv(n8vO}A3ETfexQ0UO`^I(PA-j;?m+$>%|x}HH=FW{7%`(l`Yg$XO3ShxVM+*p&Ik9 zL(Ec9n{~yvyc_ncP`T$?P06OV>6Hd9eUwBpm;5XyRWtP4>XeB`m%%vO%{Y1OokOc@ zw2b+DI#-_waZ?@(N&VDe{XqBw5DQlEle!R4bAM`(!6Y;>cUVWs0 zkvrD+XftCC#-6`M?I1h5rBOP|8F}Rxz5D{&daKfNFSjeDnMLN$)Hynq3wLTCs#?%s zbt7fm)BAel3N@3BlCsN!%GeVry2@ikQE_i1X(uE`j?u~9TXAp}XVH|C9z%0J+$p{qr2Tpcb|v%eE)m<7e7eN~BBqY} zyixe_?D+hw$3$8j&-q*KlvSkoOZ2?yl3T7b_8)PKvbq*wscy5brjt`js`7nVG3ik2+^SC0!EFQP#qXVQbd;*vQt@I$_aPJ)Hh? ztC-WZb2XTwH}}MxINCZi_m(>?I4NWBfQDz>D)*lNlkjQ)bg@T#9?fm&rLh29Zp}vLr+Zj$+o$$!ajuYwr;PN* z!P~5JorgDPwy%2mROV4|3Huwj%ZNN`y`mfc`mUc5&-KkJ-HoqqwJExqJEc<$gf~TQ ziLH2kp)Fw*!_zkEP=onG5g5#4{%G{-%kZqp5r!+cRK5o|84c%W z?xQ}}V$|;)Et}lt7a7z{rh8w$<9_btSBJSyJY-KT^AI0?J{5FyM{}i~$v34dw$0PA zVi9bC6tW+VRVz*CnW>TljTukmy?l^d(ql~7cI|3fw`fwO-O=0@kJHNm<1H&{vD+ix zjhC3G4t597u*XEc6s6nFj^Vn#N%iqNrI(AF-CEUxt23l(0-wWG-{5L}y1xgl zhP$4uf7+u`m-j;k4f~b*8pI8(gw94gn@OCT#a(5ht=xZpjE242>TV8`z*6awfV}`+ z=#C2-I`W2^*OeWv-CXf(38xc&5f%nzaa%0Y`*O>Kpz4!0hsCD42qPw1Pt z`cl29{~N=Z1N#(`s9EqWUFS|#o-wld#C~k?MC6C_{3`YSR7#A>96Yzx-qKZ&UqYUzUeGb*)i~eV#iwn47AzG{<=|4%_Amipb~mQ$*Po3>dvLa-2|8y?i?) z*zMx$ed^@ghYf{(nBk)~NsB2x&t4DT;d(-a^dgVyHX&&$U*0WpO06FY86FE7YP&p3 z*;(A6HTYtnL#~86Dbvu{%TZHvXujR@dsK{u8vP})1I>I{LRypV?6fwqW|7AnhriRG zjvR11y*qkGb}+M-8Mfrol5m-egnK~i(8{pz-8;qtk6jjMf8wTDigX9n-}E^6@sQ0I zkZv*MJufcmMS1nnMDCW4{3f;USPbvJ@BXUJ_*ML>-8DbE6Q7=o@xRP@zC)7N{PehU zM}s%{tS@)_W4u_d?EEHj0c@6pAFo$+8G~OB9+PN_f+_dnTVJaF_nQw8qTM zY&3rDOm7a3-Vo~0JEUzByf?eM-jh_D#_Boq3#(44$yklC3+kpf5^L)N*}J2dWxnMF z8s5k`GAMx&km(f^&+NS+w7~Bq?sTjEY2|gSK-b>pcRh^Hzqo6Y)ekbuu@>4kmgU#K z^w&&?K5uG3d3>DqW%sj9O&W(IEdx#odwT9$qPKMs*3fcWuK6N-XV{x>O*Nq*eTWyU z_#<1huJ5>Ieol>R~1T)SJU6P?_KhZSvL-I`0(ld(4Hiju2ZGHaX$h&wL>LNOgJ3M z5MWlkAcdPgH^EBRvri>WgM)F1^nO%zY~>-Hme-!HJ(*dm(k;0nAHyC#WhKSN{@m<4 z=l9ITnw^PFhAjQLR+9+F>D&r|nfrTAjY_0`JQr>1x#jTWfdk_q$qGYLZ<(T-P4X^9 zKab7$Qb*&a)_IEK@;jp|DxBZa*9M#Aza>b_w&>U$PFQshxTWpddal&jsI~8d+PbW% zY19`M5*O10>r#y5Me;way$ed1GhHuMhFkc(<3q%U{b)FK6 z6{9WRzv5>T&s#>H;w^mCdHG_3*)>lujpxa`XD6r+HDn2==yUT|2`9`sOzNeMg@&K{ z;`zfU4_lAb#Fu}?HTnCMSA3N;JnwVmOF_u^ zS8F~yeyckzy{Xa20rRoNRIN6w-e;~@7&x0>;} zY?-g|ROvv=m*OKi3`=>KvOA9wJnhNn1cw-C?gUG?8?dg&AH1{2Qjp7g;0@z$&%NC0 z*4KM#1wThb29)p46%X*fYrLs9ws38#%lwvqg4vayrA-18#{_Rs3tX7BHW?bv{%|tr zCc~%dQwHOgha+ciB$ZrsE{?5kpPs0GA+PJ09q8yR{H)dW{(&#$kLtXVoDRq0FAvK- zby(u4Lm_M_MFYjnxsJ*x4(*oPhsrnk8DN_CVkDoH*9M4L^P-~R5pK~0@kT1B0jpO*&;Il8UwGk&VbVCK)1 z&3%gf;rp%X(Q*3t>{r?4g*W5YrVjrID&}-y-j{RdXHI!$`*2sef8!>)pP>h`VyWnD zZtU@*3S$yA)`!>VbTMhYe#qXi&B9z@JgRa!OV^pqGE}ppgpn!MCDluoe7T(Gl~P}y z(iRzyusDiyWG4GhJ+qh1lRd>q?d9edHrD)eT(;$yVfzI;-V@K2X|ZqUMMWwu)OcU? zdGsk9?v!~ddn|W!oYX4s+dPrmoz(5>FHq_IW1590$P~kx-O9-5l~K}RdpoSbYd*v> zzAN8!*XIsl#`yuWmq$$8T3-1LtcLy!tZ#RvxE8RlLriE~_EK%O!F@v}{amJ724r{g zxSqWY!U?d19(FEPkm?~>UVZ!Z8kXw)d5?NhZ5~sUDkWY|W}0DIR{b`$ zc=MrAv&pygm4-&FuB!hChE62x-dc-*t^14$Ydt@|UAFOAt2b22M};Q7s&pu*$TL1o)YoUCey&$@rF(=Go*-`T)<&V|KT_1aAA>KB0SwBz_=aiR9@?c6#-yuk{zY zvBKpKJC&WDllCM<9=uZ!WWQD_TYj9zBah_bnJLRYn=rY=*sw=!mPh$~a+qCwqW25E zN&o0}=KXk=aQ39~D&tn2mA+^Bs!vlb?G-$dbI-9W9Fs8Vdd;Q3LjTlp$vc3%y@|zt z>g4WYG;w<`#fWfqIXrtiBDJHBC9d*1NuUXJ$Z=jBgOjZd>%q(FT@ItlUq1VvrIL*u zs22CW5GL*YvvBUv)4R@o59J^a$vH`;^yPMM~2 z_q8P(-?d9xT-hI-Udh#aaBJgysQ1K1u^E55#c(x*DRTS$=0Y6i^f3c3?{I?;UmCB7 zL`#Pc&E4cqeW5|dcqSwzA@Y9ly698$XpfI`Ps_>Yt&^x)4zBf(=v6)WHrSUM9!&N8 z>1pK~{i)l-I@=x$?RlKf-QCr826|R+Z~xrk_mJn&c+c%zj~&dCT_=5W90LZWb@N4f z>$6NAO()KTd%KZV+E+~vj9Wf^=t|*I(YC*thk?&y6@?%G(sA<_lvY_`@neVehAJOsF!W5Gqw{x8& zdqzf1t*$9A6kY9j^R$WXHIIdzLsSGO$H+*sx`?Tve_ZsF(?SAmCQN*D=O?lhe%ibp z)d(FC8J1cQsZ#f!4Y`pbJFZ$jvh3l%^X<>BxlHx3cPV>5Igut_8?tselBPgmkSBU4 zdw=4CuS!oSu3X!+Jz-~U&;_cCF7)+HoE$fL;@;^C(1gG2<G$qSRpVW8jQv#0B>6f0pl|D2g_GA`wtlZa(V{=sO$@?Y#6TuDga{N@Kdmr8z7eD?%Ov<#VBmR)ByFl0A$<~LBlJl3C z%uhJmHFZS|n8#aPbfllB*`hu-SF5C9rq)jJj9d+eJj9rwk;Yv8?QL>_FC@(_6Npt=TL*Xnr^#hxI**8y& ztvHB&^X~lqjsA;Q2C0ZQuaRT9L21@w#fHmt{#gpCLPgr)Zf-KizcKQz9)2%JF+J#I zKJn$qqhW?0qEr4ssu?Un4s0D?9V$H1+N*BYEscEKrTwJPXf-6+!eM?^NPLy!c5w+O zb)_E~Cn{Y*J7sI@WPEgYv{c01=On?t zFRbbI+>jmnBzv*o^d6?SUw4K2jZPh*?o`>W-yPkjdWNA)i$(FelnR#R!7ciqOr}!2 z-OVo#wC#CV>{{C`K{ob-R964?(`x+#S8vMgIy`zqom)tlg z|02dR>qVVe`kNW0D?6IPcbIOK?pwOF<>=wo8ziA$BCD9E-AF2rVBaqYE;XyX{A6}3 zjISz}O5y3H&k+Uc4Fyr(t~9;7$u?YcnXJMdJI6(8mdkj=gM#*X1F!PcS54va<1VAP zc0-JqfcOS~+(uOxn$Qc$QO6=CJ>(lgZh2oW~6B7?XDIFuHi`R?OLgR+R@j zGSdmqqL{OI%{_e1X;N^XXUvOP-E$J4=OGT( zvJA}ATfEZWW$4}vbM*1e7F*-@2-f8(+*A3=;Q(LABhRiULbS&Ne6Op~ zE&j0Q96xh?W=^JG+&M9ObmZXqdzqQi>{Z|PZ=0RbX(SPLxgMDrbTj>a*Y0cP;k4@g zPZI*o)tr>g`^-w?I&ZX@8ytDHPi^3qVEv;#=OZj}?dB1rr*pm>%u=fvsU6;0ggdg3 zpcUpAVmW?8jaKmPgjcB+rn|`S`Jo>FljQ;zIbOV?*|Q1rc_cxiU)s4+d{M{qaY5?l zb+`RuyI=cPA6Spt!~J4J4*T$WzOHEY6>*cWs&5za-^nwpK3Tlon<*cR#ge*}&K=h6 zdwslz@vWGZl3&OVFU^y#lgY7xx5~!**4PyHzWq5z8?c<;Q)T=_&#ETVkGYBT8Y@ll zCD-hXt(052EgxHE%)$#h;(VJvaf&6W$Q@p$i(`NU)A`TG8ALQm&(HfxA8&T;6Z-az zPe^|GKu^Qn$jp$B(n9nAk`Y(8%P)y@f%n(;w`20j zHeO^}sZPof+&In`!C7YeN4_&vTnjF5lghTqHxjdwiY%Wwb6>WXue4AeBc&6-)uB*{ z_3F&7e^YM$QSG`(fb?sJ(8~hJlB_+ibeGPvR;hd3SZDBE4ZsaN$}L zYjtU{VL6qGf7b&^EGTLGn+)UWo6jQKA%aZR=ueO|c5IJ=wD@!aLc z*On666%S%hK3={0a#9g{fs>)ft^ea%jYfFcnjf>D>Rmwt7ovy6k6D+PcVvW2_#+s+uj^gxX@RyWPE6GcVTkBzAkM21ZskuKsrU z=X*z&7i_O3R+W9?`tA8=$;jiKoP@unOWBo?UDAw!1QgO$RCX^Dti!%hNeqRrg6n7<+SO z-OOb1^&wrZyXS{!tUfBWkcL=j=-um@?%Iv}VDom<$)AVLYJ4KmGQ4B*&EkjUVJVZ+ zQ|B2DOX=(yPnVD4Kc2gZy-;uBbiK9JW6eIP;3zi@71}2~94<_8T2IIemMi_dP9EM_ zdpWP+=Ck9$$3q3K_}y(}d7C!>D8F-edYW76n$tUzZ?iK2S2SqM?BjWi`_C>}nm;4G zOs_xn_DS>gfji#L#lvFa!rt-PBmKK>_6+AJ-Y`03sl(E5npic={W)*8FV#sfxZJ7s z{YxF$0qRBiBKP__-RviwqSxw4G;;Q&^y(3k&I^`CdxEPP$)F-1331P9drkmT- zGWpVqc^qa9G?X@t?4HpauVd|(p*)o+aHj*aRl_Qt@$G)<)7qQqUAVBLud=icO5M)C zac#uQogDj@4Q|Pt|OGJx!Z(nWM67f@G>qxjBHVUS9OL%aDGZqFnrly3pLg z@|Eo_L1A`+8sEMbJY*x&4=Z_Q?*C)9x7h8KZ{nqoKeXhzE}nbfCh5IwG4u4{9sS~k z$9ELW9p1hCl9aE_%bt3JvnXtQ!twHc4Y5GEkD5oc1=zkcG#4fAE>&1Z(i9wY9ewuD4%k#RcAwzR>DxyR{n${-zDx`{;O_Yt?P0>lGmQ&{B`13OykroQ{yYwy1wsIb#Zze?ZC=;koWopzKIupk763;lCAKMwo(Wm z`{pO~Zs_8zNPOq_Qw}z@%Hf;`b7}8>dbNee?e@e8%(a_a4`;0=&R-JWJxS*3zVKY) z9hua~LB}EI*Bm*_=gt)wnC++WTlc;i(4Trsmi^29$@8m5(fZ^cgD0pHL@gGX-#p3J z;mj8uxo>0Zz;gdxi_~lf_KSFg)iX}nJ;zRS7F-{sX%-Tk7YI03c*>35j~DLbohZGRMmJQ(V1^Zt{6PKEiT{|cr* zRG>^&yfd1aO1iX^coB6zS9RJGMd7c5%KPp{%fdP*k5s@lFi;rp5(-3`JbvS`n|JZ( z*gcX#zD!-&!6}VQeEV8a#t1aDJ zK{d+@F1o5e@0T%25$vT&K%w=lRe}<<@mv(LG3-#rRL7RsP}1gonIx2N1D5+0k+N#4 z#15L{S&7>7kaOqV(mJv~$_o8vsjj&T1Y%~Btcr2F4cwiQNwNR{s+HsW*dw^Kk`VnX zs|oD}apr*oy~Y9%lUZZw<-=yX6Ckt|Za}m-jHL{(V z5QFLo3D$^Wy;ifo@~LS2`J~8GejX)5pmn7^C!vhLzJ7<2$c7`;3gmM5YYw4M5OV8y z`wN|l-fay8;AM`Vnd?g=KH+G722&36^Mzw>tb{=k3`bCHmLc%(A|_nCN&!C|=M6V{ z&t@55;jCUS|0-G3)xh7CWg<++7|JDmS3{_|CvLc*b|pr)cX0|rO8x}l3JOg@kulOr zm6-Wqg-Og?D!|6$^gO@hNvJ#qpWx@DVT8v-BvvF|-#q#%w{!-Z3w88cOFz*t$c5Sq z>+c-U!UOj~Icf$vt+BO=RmPv`A`}W+Piu~Qilr>3vlRbb@8g|S%z5>V7SiP$yOd-3 zS_@y~h*+k?jg5TdwLk_HX0h(%#3j7Rx^?z1FXQy{%zffSf*r5%fxe>IP#~>6w%QIK zIxqTlv5>F4Vd0Ify1CDl4DD}n)nCG4YNEtx&_yUjkZ9my3MyKLVARcPuV1*ZjDpL9 zDUCUKenk~#B$C26ZD#U8s~g@lMUGgrq2uw*W#6V9TnGoX8MqsW3i4m)CVVp8=29~=Xgpp(); zykH?nK1pz?7g!bB&OGFOhBJ0`uec4g8I$UY_)Kuke3V6W-+unW_SQci3zAKhLO7cu z2_x%N040Ers97TqdT&DLlAU&~l@%o#+QVX)xl<%?6+l(L0ej1lI&#QCky$Q%RKmqrtZGj%ID6CWiEICn^EA@e+7wE1} z<8)m&6lC?Xv#HNdtwd9&pItATv!SvzD-y0IM*|c#M@5W+-S?PCI6I5Rrb!qYJU8P zm*Pr8`^}GkO>x>4l9D7H5EEVhc7){t7nn0cNpmsLoM_)6!5b!KQnVNddbG%RR4oRM z$rya446fjr`^$fD=QnCw zRGA=dBY?;OK*H*bLKsI{5s|-y1QWsu+TtYrrg)BxKroEma!{ukI@b0(J>xJY$yly9|xM4iz}29RVr5Pssl^ zKyOU}T;;gQD9(S|@koVxis!$m5m)2q@ZXE=*MH&BAMoh&FSl{;w^*;YpwHpaMn8tz z-)@+H4X^$itoGmU4aF}3@inWl=#v13bdm2i=2h(BtYcx;6@0T_Vw8AH9j5<(?2??7 z!EX1@F_c|!)&UBamN#2yDNMuEYiT#301Y<`}psTy% z$^w+F8*8vd>>RUA@w5Q&dC@u;GAH5aDS~xEKK+)W!JZvO>VZi(vaixNdU1U40*2jT z^f@Y{x(E7Ew{M!=Wv!g>+PfIxQoX4x%rD8Q(spQF-(fO-3Jq|*f)lCXaq)94gSloz zxXCDkx}E`0RqHd|r*Td$v0W2UU79N>R8)?79SP`vc!#w-+G$*EQzkj%;OnS-!^_?> zj#$%}B1;APp8c_!u{YUNHZR!)e;LVnM7I?~ z(a0t&_5k$d>9%JGl!3nbXB-;;9SotZ`N>FZ@p8E!_)0NrQ-1v@yC^Q5Fu<#&N1Pj~ z0{oe}E{#*nyKHIi7L3=xcXS~L@XMwq>fp4L%J9wtzpm%l!MYos_SvBTK*fb);IAkt zllS04N*$iJ+WRs-7WF$-Tx(6p`OUbPKyKtccEL^vtSU$FLxYaN^rbqcvh~FR^}qy& z9!Cw3m&qb;)4yH+I~%*V1moc?45k&9-0N@nNeXtwTVBbx_CZx;I{6c&rLaE>f14-~ zPpyJ+s}SBRINzF>BSF~)>r4YdMco8LmMf}3$=aZXNcsO>(7n@<+ko5^dOk~IYQhO4 zS`Qo(2D^F6O+#gUyWq0jNFWHSh4j@Ib9Mq?a5Q)eM2y5J=wA8nI}8@YErstHP(o=l zK2>_>)0l-nvMDl&>76o3-e(-QP-i*5VvvP%VKF`m{)pDWQ~{#7|7?9qww~zd^ZZrr z)1{BbTTphCb<49Re}k?kpb5SUh5Wh<6A2yiA_8j>79~%<43NU_t`SUwGv@s zb=RdNV#cm9pu#aD@4Rz@uMXtTPWJy2^``XQmB`}uVgD3!_B0br9HYOO#)*Z$u!zH# zSR>t!hN-d!_EG)>KwSAJ^6UI63Q|w=TKtq}yv~v*+u$;Ui7Qo5Kf73oH&v`ZNAFB| za<8g6@v|lMgmLyOy`ShaYn>v4apQA*`n5A6$A9TXn$XpSapR^@ix2$m696inJR%Ta zo+@9iERMiE6-a*Zn^7X(Znd>!iJR4uf0E&TT}z0H@*HVJB@<{8{c|mG5Q%a`fEfXG zjMM3PYFO|8#-OIXzszl{*TkFKZ*>tx-BV~p-2gbLBCWmqE0qzqTM zVEa{A5F)p67#w*ae`$zg z+5%?X9dPc;I&j(z>2WUXM528pN0Mz%4_?bSvna0ON!eLVCZn#vw`+|@;7wyjgaM;6 z6tUH@otlOAS4Q9a2X`-J;&HkBNUT-}^=uH-uA_qmU68os=7G=~Kn(+R0y=e)+AxXM z?_9SRIZ$tGFTMQr1%{&sQ`Iq{B;(ZLlpsj|0fDj#W8lo@`AE)G%aAr4N>0JBJaSa- z{-G+`rs=~tJF?2>I5Lh$w?gAKjg?+jJ7ZneBiH$Q%i!s&ONSn_KG=5t9TztoF@$CD z8UEzT{;G~pk*wdC`58;pYUCUv1Mf&K!D+TUTQ>xyGJ4BAWOn6ossShV?fBc@a;+a5 zSO}Nx;&IBA`1}=Cpj!z`ubUrg`LY0_XRD7sjrOqyWDn&%%CI?oXHcaqYX`rvdT)r4 zYL{hbHNb?qxRSprBX|LITHey+vhIPvROkUE4Prv^%`Mt3vDu4mrd9R4?&&@JOuRc) z@p}CBeKktUL`3mJMYRx|KdtnOcS`*!p}75a%8@_MPsSVM#jgw%tpF9H^&F{~F=%PO zM>y2itDCe)z;jEsr*vyo1&n01le}*n-Mt0fcVm&Kn&h{Z*dOX#I@9fg>e$M;^*ZA; zR<%gyZgDbW^x5avx!e!OZ-2g1yI|Qa$Kg93yDi#YY@1e%+NvibJR2QV*g+xxf6;3# zZ^lIvD&Id~E;Lag2n}{6R3Bb%PXkh~(Iy*sP8X{Cf_mVeD*M@>zA5>n&N|U{zmJvx zidK8QgiDIyUup6*8aMZj|5csyzQ9PuGU}HDDgq?LDmXci1WdSaB3Mac`h=jt@<%Hy zM2N7|R6E)fv-lDA|0T<<=r<2pQb{~MB(8{T;k*U;jK`I2Dp<%rS1>+KKpw)KSH?Zb zxKo>iAKjGuVMd2-umpPqT{70K;;)ZMCML;y>($MqhXe8K%sKhS-=_!2!EIEaUQPgy z33)H9UHtS;b(#5~1EFLncl7mRkbJkJA&#Wl5@!ob%R8rq!^HzYrfgX&vJKM5Y2iLA z#0Vd{XCbppb!od$xzgZ5I2Z-N)kL01HC2wqRTBYR)zVNDE(w}l+v$|5QQcqq^9IJb zD7`Pbz_~NJ<*jdtg123uwEsYA1$X8O&vlck7w$}DD8Q+Z)XNAo_Ea4D2-Dol6aR*e z65-|5i82*RW=L9p4|7m&_MkFJEH#-bDipH%)2n*)kqm*oH10vz(R~4AD7x2n(uWG; zCdn*IhaV6q9psWo!>@c>sBK`n#yytqRa2)7!J@y<6reH^)eNYzy!6N&^Bx+Y^B8wd zU@K73#ue~&d3&&+bb(bOubv2i8%`+9Xt+$CC$5GT8K_Wb>FeYH8o;s|^XtO2w@Ail z%HlpKyH=VKqy^a4d16?ClI_@km-Lq?&lrgh3p$;Zr)p!W)Li$xtnCi-yqyIhyVie! zFRAxCR(5!q#g@SWo~O1=LnLPVSal-$xrjbd53#j`|2w#7NA{HM(TT@NWbO2#;Z6;h zM4zv70N}ZXlA|EF@Ui~kOK8b@JavD){!Jb~bsjAsLTY7f7fx3@tN$REyNRxs4Jt7> zWPqLZRp9>D$h5-gjhle%mI7(Jf@7J5*+t^CFwwf-d8JJT@WhiqDu17n`}Jv5^MS`S{k8dmQ=6Iv z*_3KGCYE}6lP(=3dT<5Y9kjXdWde`)EU@;~H&CnBl~-ZSjIK98o9s8Jpji0ON;o3is!E8UJdTr1{*y zuYLjtbE$}dGHk00x9S@?OPRFgbXW{;yBIEXaRA=kr)!~#!^OEpE#G@(6oM@+>)(RB zZbVJ5!X`XT?L`GRh2n!F-)~94|9N!s^uP1wl5jv=S8wd`M$Y!%WS*a)+P_- z{Hmf|feI6#%D2c=)AB{;+7AF%7G@5;D`sbppFvztug`qon!+r+Ax?76r85FpJt+qK zeQet$ar9snnTcDo#pzwVENApJfFJq(QW@h3)2nd_c!)#$c*Em3t_KX3IHHQJ9OOs( zusscq^mE^hus~`-InKQys{t%gJdGRL*=HI>0ci%iQV$hsrN4>6b?N^N3F59sX8%xy83ebj24X)RxY zLn3v9J=!P|G&NbD8V8wp^V}x*$R_(HPeS5Z+3{9aN;W$DteRi?Ifv=#{6vNt2aLUg zeP`w{RQ!%{Pa7Wrj(aI!CA@Kn+(w6Xi;qlJt_gZo!>#ic<5&mN|7#B^N${eXXtT=Z z+-KAQ*_qm&d1v)Uc@ii@?Fg+^vIEy~8tz!AjSBe^ty{p!MQibCz0LqZV)6GTlAkd6 zD~n|Z9xnVlc_?7`waqHGa?}2q2QtZaO}V;NQ;Gxfvev_Rqi5AwBW=*wJ@Gejn-qti zSWMjr+b>=ngL=5UW2@DxM>n@se)3D7wKo_FzD^!%Q~fpTegT=Mfn7ACW_cq#eGm^`=Qgq4MU^7dC|6M3m?8-vRW4+ZdV{8II+}VYchUwf1t>S0JcAa)LlPj%jnIR2iGPFR39{teP1P`GBZ!$K>K~K zf^xrMAH|dk78H@cGe-5b7uW8+FlfmfF?}1d(zS>xL&G6CK|U$;nUU_o%1SRKifTB4 z)60V)CPE0KLVSAfW%4n@e+g6P<1KU@;GT|R!Re91lvswN7YvlYHBl4 z7Y&DZhcs$3J6Q~8{1KS53xmnmn|8gt0rMyf57DO5H-FRDO2kX=sPhpD%_>C(c^ zuEB}F8@Rj;>H1#L=4&qVjRjV8k`!)$3@cp!V{%*T0X`4i*hJqMw#!C)#sENEn`$N? z);KPCyXkout$=wv!z$co;%WSh~*TZJhz!MiCPcrb@>Q5_!>Ji zjc%Tm1rn@|P3{@#+Z}}S0|D0NkLE#ui*5jJ=5!JpF#A6i%5fG}A-eoT-0mao9`(D7 z%Zi@v+k0h}v~5~4Fz#e)6lMeJ1V3*Q^G`G8Wy&=u<(CgFtQsH5{K=GVoX+dKlV75h zXv{!VA{BOzw5NXj`H-&R{r_||&**i85ya6AR?b5qOY#@$pULm3I?bzdyK`$scG0-Ac zfG}m(O-`xsk9ACU417rR8?bSc1bDoxfc%#YcO74@p#jZea;(|csrm>hk@BGF+>N39zW3dY8O0>t zSrz%=4qrootu22s_t}BBeSTCPEBx3>uW3tAi+}f3n_VSa+>9O?0ZB0kJi}F+{sW(@ zR@}yVqm27Uq|P2%rgsK_;nnnX3|DY1T}Iz0|8?L8_$B`fBhHJy|6BaIQ%lfcf$1e( zd;CumYK~D(Am@giQy_k=f9Wk9)CD)?n1cI&)k3cGvC=UFb8IU1wtrRV`#FMShe=aI zXktA}qMGDq%0)3PRH5+rt87cN@D2$^U64(JZSTF{V$dPbO~$l`4aw08&?9)fA{y-g zxn7E7+(?ZoZ=O^0b4fc?cw$lK)@}M|>*OtP!LrQVog93um_1-YMjzpNt*eWkF0Hdb z;ZIi=C{!&cX;2Zuwxw`{W~yCUQ#Y`_;|uCvMnJ!ID1Iz7m^YL(#&Y7YatT~}t(bTj z6&hUf=F?7ZB~5!Hx|fq$MS2nmM&8Yk z{8Brj;7-m|>Oc#&(%DC(!D>H&B867Qt!zq{cV&{-1R|n>>_0qy!tw+BE&JuMIjhHG z3+NLiDI}r%96ZA_^lce1@7z=k>550j z*v8TTn33^ZYi$klt10-FSvjB4c(Fj=>p%eVAM7ZZYDMtf?` zrPCspg;X`X;&%y|YVim`d1duMu@E!O`@j84%C5f($rwjFn%O<5IoN2}u7ixn87D(G z0GDzl$L7oG^j!OrC1LN^a`ptF;)SwK*xGJ@hg-}e_h-?>DBlGe?wt&UIQ;EW78HUSYf(nwkF>If|&XZ=r9naq7<;? zC!p*PcR)A6%EIhA#Mz#3YxM(S4y7*^8c6-;@vtpBXlefdSL7Ob`fxO+(Y>#T#!6@Gno}+Hb z+UxH2Mp~If$TR+w9}bfT?`NsVFyCOhb_pbODckLoZNu0d5miei&{e}}Ung#IBJ*pt zL-%4Mf5$38sP{7&VB#dwpA>^o*N`J2x80tuH_iHv#y#<46g%u-S`!;JXxSaEv$xatR2JNtt@Y=R3A&)Hj)dC4>X3ddV~cnzq!HE~~v zfGCG^!4ifrWTsZ(IN)q3qxx;&k`FIiKcS3y+-)Ssxac79AF2@U7~kxZCRDg8QQ5V{Yzph)1B@n~+^Yx10Y`1J_+r|5b|bd-v=;k5LZQ ztCrWJxOGA9ACeQ$VeY0|$OB0S`)O#5nQ72_Ea@401VweWXnI@3vmAI9YZ8}$Hh#i*LvRT(Ft!@I(pHfYO{U}i25N+|e zNkIFDYorhj%S^*1BP__7a-;as=i#^TE}YL5we(-}hyv`Ib9KOx;_c1EKg^5u4bXAb zciXn_AZbpu{6pKeC*vO#Ok8hM8>6Q%Ps!bcXcl1@1f1@?U{n$u9c)Ag^U2VgIk&Ep zH5FCyL&4khJ`Y0Y_Zjc;rRT-!7d;Qg`H2iA@hyNMJLY@9&>~iJYdlGnr0h5=oIV6# z;9lnD)h0t89j-NM%tCM~Mn!hO1Jj-9v%_nQmoMBg!Z`9)3P=PWGy{-qHI<6hPDAAH zMhAm#D@gIY^)@ZOA3{yoA`Y>kylAxhp|O2}b|z#@vchf`X2+?k~EwOVcJv7bev42qzA{MXf^qH~>LxJ_niGV@j&PIOPJ73z_i zhH+{Vwq^Wo@ed(|*`{||XCae)=*T!Z*jYoBcg7{AB5E}p@b@g9<%X6q`JyvCk4A> z6V3Sx>~XUSO!MWY&Cik4V&Yga7J$bPLMIw^J3PnR6VSwpGh(0=5dq@o_LHZ&2`_tX z$Rm$AK4?SH%(dhA+#y%Q1ZjW5B<8d)DeraV2F9bISUm)p{~|5y9Ke7bl0X_p%3$m> zXijEujU;;@Bd@-4553~mdycLONa7h=E+l7Eh*MK`)FO2F>209z@T@S@2yO~`mBa>@ z$}xFORA~;yFb6Lim$BH1L$?@e3Z#evJnyEPcl@tHvO{Ns1LH(K!t6QWcGrZ%iWYA`HF)6_M~5Tzk} zIhrmR@v+QmdtK2uNW%W$xw0hsqki2Jln9!Ox}ZkclBXQxWlE#?84b1^*mB;;%^6 zG5ZDnHrno)4>J8U=gkI^$iyov>F^j|!DVe*Yx`8<#*N9EA4()BHcF(Byg~SO)J`lCODJy7z(=Cw-8gU&E$Ru{EExkfzF{EzQ0@g|QeC z6hsOF%-Yufh8-bnb6$)#N>PMG=KEuOVTQBQBJsTTC7@2<;aHm9QYZV|%6SvOzF(EW zs0XMd6z3?0PQe&oL+gCmUxyK`a4g`mqVy1;!`@537SRqsjkrANGgIQbhn-m<%!|v& zNmIW=xQ;oCgVD8!jVV1$V{Z^TQ#OvF%?HmN1}REK-)Pe05oOUDX zI6gGc7pWem^z++%o3aSs8{MSWC=R$2Unkk0MBr9OuJ&Bz-QR%dZveB6afo}82vZpA z;(4|;LWxlr@#6T(<{w$j!XOxU8xw0D+LfxUK+ww4P1!}r%tfEwOtBfEk4cXQyHHq z1iRP%qj~C>5Q%rFeg9m>1ZrB6K}`>MPRH^32MUqowOOQJu9DJ77v39Cdju+ z>Kf>0w<{lJ1i%Q$J*VZzEB`05Q-RI6(Q7k#E*$>FQeZ%FL|DO%j&Y4ZS^?pH*ab-Y zm>2hK{r(PUm)L*os+QH5sB&5g>uD`UbOfmLzv-la?|2?Qxi`*}8b8~Xio~);fP}yo zoO;o2YBAVUvitpg@`H#7`>6MYt(u^dOG*#fPdXA+04NO z>Q+=!c>UxwPVZB)>-rBi4zX%s z2DNsLVd$*yPE3oxX2&mKLCqDJOILrmz=V8Y*5$E5KWJ(lni6pG zw(o+Uib#b>3LsS@hHaNM;%~5u`am)L_+Q{Mc{nje<5Z9iQT&pWuruq;8mBc3eve*! z%S&+CxNncUD=i*sDJ>E0Sck8REOqqT8Mj0p&#U}%~Zc1Cn8ob zQV!tF5Sao0eRaJto>(N&Ghz;vrW6*45k*3CsY{Wvu$aUyLxhtALCySX!g1pJVE1M> zd4z!dBR2rPb5uIA5lA42W0!F2L^+*_;Px4POcqPk@C7^2l}HkWQ*mjy;55QJMAIg8 z-0e&Lss+toS0sPrBxB$n0{gFk^QTlh(uh&~uj=VGffSariqkU%-c=BP7OeSA9Ge08 z-OH$Rd6F2&bRk6F#B-}Hes%m{yttEf`M!1&a|}|ShDcT_z5^!hcufgWL;X(aFfSF& z!gAET5X!;&dgGdRhvF}vt#@DU{L}* zo(yFQs{$+h0_rQbvNdP7I2gHyt`F5wiN&O}vU@q+E^f3NK!33Xyku={3*IilkIN#=SQ3O8U=-MdlCxTXHp*O-Zt$ubt77X?uX0KOx?J@t>&qaY_>s zq_~0sytm4$23N=M#5Io|EVRC_jQ}z7BJG)80hBofEo$ZC7)5hoIY8RDS2XJx#zIqU zUZ%ZPUsg}Zg!-^rnVEa%(lgcj-ulYLpY??%T0__UK)EKwSEl z=owh4N%73#euDDZ8=A-bwQW%;$+<;obI0miP|)!f^ZT~aT$-d{GWOOs^`rgR;`r}J z0RKJy4T*Aoi~%hgkTChBfHH3kZ-p^%`-QjvABChbm{%9b;-Geb@E)?57MT>lV%9i? z++7=Hj(UIp5s!uNdkb%)m{V!+d9Zsa!m%j^;>R^(Gh$1H2x$$-C44&Y5*Fnlvgly{ zE=0O*)FHG@AVhElqaFgUr!G{H2S6<)GunBvWUDl3@iJ$a)K{K%U(P+~`c=)T_a zNQ8(X+@{kk7ujq*an_*zy?Llb%jCr~k8p#jbE{IIuL1{6@Q>e|Y#o?1CIc9^Z5=2% z;d%05Qj7?8_6)dAyp^Ue8$wPqa(ej_Y7lb`aSCLhN zLFA;NFq#mu?*$<2A1W#bkVy+_+@TV5%HaZmib272r*%X@0z zg2NGQsgwwR4`QerbE`o59P%+G8Mmo6M@?_@k#9R)Q7BF5O)|zlWxM+&USdW|YH?4Y zLn`!wt=$gnuT6u-EbA32!~y?fu@>p79LW#Y+xcwpv6Zq+Ob9Z_JCo_*v_t|(IJILsho_moZh(% z?(w?uR9O*sd>kLAa!s6UeoKyX23n3mIMfX7IDA~5*V9#0Klg;Qa&K<5@5hS^*)D*> zIr(jyLO3vN^7uA_$bkP%zC?nUYeB`yEmZkfn|`sPxj7E$*RPerwdvofGa!nMbh7p- z$f<|H3ZuWraYC4ZT`*I?vPr&NZ@_KJ2#5~xpj%JY_G?inB>U#`x=|g}4B1dRh-WXy z7C+v=Wz*t*lZXlW|94ar`!Xm|TRtSVz|pt=h8R1^lJTO&@+GVe;@aGXx@=pB^rRbA z5B8-nahgHUCY==Ge!4c$k}0sijDJAP8iFQ-#=REZxSK6vA7(w^$wqpNRs|Sd>CdS? z;~Fv{!Zm*Q=u-VlcZN=i|9-iyHEcXp$EjVO4xdOL9MT!rdOt@yNOG+5j{daQD+{d^ zz;58ceaOJ-k7oC$qd!v@T(+DxbBCScPkBq;3pc4rcJ&uXDGHm-Ts3g=4K|})iL1#V zd9@p*>_~IsSRBi{|8a`+gE^%5+$qTgWWbaE7{|$TWJeebSjM2OHsNReB0oTfT0je> z7YRkn9gf6qq>0MM2_S)`ej~9>>kaEkn{|P$%GRF>12&mR&cSZ&P@9IHf;4V*W869>_SEGY2(UH7BKzqZx&V6(*$Z z4kJQ8J%t|B{~=`c%s7h<@PJG;>&SVMJ|1J7h}^6+eHWNJRkk#DUQ6Ni@1sEsX)-}F zm7pnV;Njy~Vil08Hg3tL0;Sr1xHbp)ZDZUSb(?)wR)9O4sC9#|MrmY+_cyrk5Jl?T#a&*Kl9SZR5f>6^w2`cr)akmT^u|M@-?_Vis!Q?4diy;X%yJlff zmHQl;kf;s@9cA=`GJu;TzTx?1=xe~*1AaH?{?uj-{@sxEDYmFoHk(A@3h{CP$r5g4$ zYP=m$+f?sFstcj!k@e2F>i7JQioyj$xL*AuMIR_A>df2Kh8h`QH}MnN`9W`KjT%?F z)+DF`d2>Z}&gXmJ!2*4I44K?9t2hwV-NbQ?fO82P^g{A&3L6(QY|-^!4bA4+if*GU zKLSrxJ2yzKj&zAbvv_N7kkoglidM8-e>ulVW{Eczu2rAfuT7q?CngLs&BxiP7}d`; z^G(1yem0-VO1eLj79Pg=RX*>#4vL-m3FFh zg5kruUnAGquUvMiDgAF~f}{w3zrrIarYl|}y3h4YSLxrOa0giPK5yOph1|77Q{%t&=N=qNVX{{2T) zZ6{c67d@m0^J%c-fqJZSMPKR zHuaE3auxELZ@kz+#v@In31W~hMDt5YUM~(-%vm;%MpTY;th+jeOpJ`@S2iKiz^C7}Og>=>`H^xP!f&9@)uA|#(pjdH;%QkhtcJPRFCEf!u6J_u9o zjXtZQyMa@4QH4Wh=e%s)rY{v%-e+Bt0H={%bNh`*16w92^r4Il%t?;hYK*BXD3~UC zf#CB4RweS@*Wz{MhE_+oBv~UTf$ZMzNkA1bERrB>k?^PUVt{!SuPEI-Bo!9*94b*c z^k6JJo_#1hOHs&%8BJl>98(bXGI#No+Wc*`z$??om0SKbx6X(wLMEDz<25%Ycy5R- z+FUB8r8`=ULX{-)of7e~+l0O9yGjs1_q+xn5&i(xOjk|63kaPZeNDiSB|Jt( zj*+-lb+_R{6u&UMQ@yetf=+lzbDJ@%I4}4Z=V{tvW6S0mAWby$Xd)lU6>Ui{(vhgd zsxq2G!|3B_j@4jG((O5IWm9k`@T;bNnuwgDC9o@dS`O^=?+71e(0lCny1ea|Su8g^ zd1zAihRE&n`k1dEPIE*rTMpCngwvln2-o(2xLA>z!lM-4x5kpXQ{FMiAZ3vdbF{oU z_dMxd9Dz|FZeeLJn=!t{YWsx}fwa4~oZJ4}YSNSdmtUC~gimleqZfVE!NKrqE-ZX= z1rqOf81&D<-~Ukt#&&|zK(Z)gHNSuKkScRz#4^OId+1j@ef@7UK|=)5N@;rjUzRGD z_}kycZzu?mfWk9#9wK-WwG2p%x@yGBSBJ1xUDPAlS@Js1n_{SE7q_qqQSv~&Z z&;MfgDC#E{s}cSg0qzc&rt}-H*gLm(ncRn;ewV2IfQtju zS82(%r+7ak@)d+o6F%*uz$x*ihVmg#9Ym?iOv^A9gRpn|%2HK(yLr3so1b9VQVwbR z@FmC&rZ-5~5&tN}CP5$~P`Ldew(1KnC`C*Qj8>u@F!uBMRs2c_{})`5Ow&ZVvK0*O zRPqu48QLqsYf@7k*c&mN5OBU|ET$saJ@sn*MK|EB)M`xQ_MU#zuiAzCP;vWFziKb- zLj9-MKT#*@Aii{;sF3ll>UOcnyWw1tDj3Ket1ya&Bjp6S=1|j6&p&@IFB#!3X;VoA zhI3(-yv2Nv);#0abRlUYv)4QA1cLF@Ez;XfsHbGTye%l5$=%xbYRgn{AP{jOG?z*t zCi=NjcxZ((B@h!A3;Qy0MD_9x;zB0$u*SgehV(H{8ByjW;dH3>Z2)_=IQi4A^XL_& zB0`H*$5ZTxwGi-x6=zZIQ#BH-*y%B3%TY_v(YRcpuYj|F$v__!;z5t2G0z!WN@Eu# zJr=~m{~%L>6{mahVSrJDZ%NSh;N78}uHe_>y{|PB6C%5SHQT&fx`yi~rG^?46JNQm zFx1rUB}${#pXE3DBd$?gR}KB4R7tNh$-Jx)-zYalW6t4En*;D^g(+3C`{uq2eJP3zWKe~G{)r! z@iYLa*Lva->>j`d8_l}kfHY*2xd03!TvLdZXDJD>5x$_|$$isrs3t zaotCkK|ZXkmMid;fArveL^*9q3mj$ZIV#vtku^ju`ns^NV&tE%*PiDYaRugMPK04wg39rM>?Qm!c1G}zS~6C1J)sgWpvk_CD$qp~zo5_zM*<|d z4iPoYher_|qB-%rimEyXUspvX%gFJpX7#)8D~n}Hx(>6yG2rd1|0k;zr_=x0X=83y L0000CLjGoE&y@FX diff --git a/samples/Javascript/TestJavascript/proj.mac/Icon.icns.REMOVED.git-id b/samples/Javascript/TestJavascript/proj.mac/Icon.icns.REMOVED.git-id new file mode 100644 index 0000000000..9874ec6979 --- /dev/null +++ b/samples/Javascript/TestJavascript/proj.mac/Icon.icns.REMOVED.git-id @@ -0,0 +1 @@ +3d09e8fb4f4ca1c1ae7ab0a6948db592c7c3d9a0 \ No newline at end of file diff --git a/samples/Javascript/WatermelonWithMe/proj.mac/Icon.icns b/samples/Javascript/WatermelonWithMe/proj.mac/Icon.icns deleted file mode 100644 index 285dee82b3d3f80acf3c0037b6b6ce35df0e9e5c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 77152 zcmeFZXIxat_Ab0T(TVPcCg&WwF((wvIgtbb0l@$Yf+$9U!rtBFj7Ss^6+xmXS&|aF z0l}Pe9`lUjIL3ZgHO@J6=AQq(U*1pmcR^-g*WPQbTD7Y7s%Jgb0ULvNVx+O_0(MTG zgkcnJ)SEEf@#a<*=Hn~`LW^;F@yiUYEQJKZ+=Qc z@;C=Ct#KBLYV?`;X4u#qA!fFSC$v=LaWrsMs`_?qirQk9g*k`KC#_sfo*6ckVr!*o zZp=~SaF|Yk>zo}H3pfV)h8!M;qew9xD=_6Vb+mO2tr;9eHk(9MpeQIQtLrF7eY@Q^ z*gw=Gx!N@-kqq=bywpD+8SEYKE4bA)B$W>Ib@aj2;qLifao4*CCDMUYOsqAiFMWCN%jT>Ly@S&1;^L0ra@nm@kJ?xIfsBN-+{E3|Q}16qt4&(a zE0u=FhN~T`t-ly|wK93@k*hsXK@kDts@odtvO3};Lz1ubcyISyU*j_;xh`qk@~sDM zbg%O9Se|Ku2@aZLMy?xr`t9vJCPy+o-5q`0S<5H1x7jaSJ$1Rm1aE(jaZ@J8*VowD ztypEb%*Vxf!R$$%1v#ZF?d?{s)HfMtF~)R}I3_)J%QCy=v#d4wn(CHzUVFtcI^W+s zc>Lh$-G}dPJ$?A-@q>5p--l1`J>FjX@zzuPQPjhm_a8pK|NQO}&%9snJbC!&(eUNF z_n+Mg2!9oF@b}wrbGP)um8V-Sd<74j_~qV{N6qIt?-FIQo2MSOuiW+ft*15h%@yJO zr{BMLTAR4!-lIoHYV!1t*VbQ>d!X^%ovh=DV{6(PkOQK&7rwodc!=<=@t&1bpEzcD z;IR+uZWGBd&gsYlW|-mXZTB8TMkFtaV6F9X+~C1lHvQJM$j~^irH&K90~4l9K7M5& zGBP}7?&9^US1+7BVb{5)zOcy1h<%fc$Cz1}t*tC?IFlK^KXikem9CM|%)rRQ<&`_9 zZwUU_irEm-6;R4qAKEDgNKR6pUcO zi4|y=nwmk2Kp?cVG9zc~KJ@A0HnK5DiV>(8n?Rd6TAqa1soPDmPp_InFv~cBhLMrH z$h-G^55C@ge>10SJ;t^W3v_jK zboC6hEjZJkJdZyA{Qi?0Pai%k%1v5i2y2-T7wBqf>*(mSjIsFN$|j$^bLGbM>sRlV zXNba<(6lpH0s{`0$K!JpBeUEw1&oTh7umyqY1ndmjG`(q7YJ~UE{~&%xgK=G z$P9gKcHSJ!kdBd-EHzayLlFS&TtyX%8L@+hX^g{GrL4rp^D&;|YIVN35!@l-Xe;u_ zt8hCIYJ_jurvX;Xa5JWvz>CS$47DoJ)OMeivR)A}M`9GJO8r(10XX${3KmkiERxI|!GV1AP~cRX;c@9hAgK6(j?_53WiF z#8S3ou;)q=lkLQ=2nP4T*{LSbziMC$2QA$sT{e|Jp?*5Pc<~Ro$ZmpJM-d6X7b*Gk5@7| zrI&h!K)hB(^{K{|_H&Z{p>}%Zy$0FmXKe+%rs2LpiCC&tQdW7guBr8G=dfY4?CG~J zf66*K5(Sm{O>Pc$>;35TiNBuFk!!BfRK76 zB&TQPrPT&ad-fD&?Y$>Ao;yME

DIFU*Fwvw&PsdsixNYgCbE#(d^=@ zJ&6K6Ah~Ftfg*`gDEL;`xDF3udR>IR^%=_YK^Ho4eNJ=Gw1X>6TP+ zygb&$dde)f{KfG%PUdrl2ma4r7&R@q;w%_w@9668%P~bN4VxFNLk^I( zNhJ1m_Rh{5v>Y;>FiJq5kxj16xFH`Bb>1o?gN7yu7DIbGJBJl(CmG>Ed{WA1ixsI0 zCd(o)m1S!*wl-HZHMiRnb~-Dac=r2OVl1l3{>|Y!Y&vPmnla-lj#gElZnVekbnTbB zOjPy_T0hTezrW{};0cpwIn3oH9xg{b~m7}?lNm@>u2#zb{P z%>KBzBosCdjv#ya;0|tjC)e=_%96 zWGYMBYRvTIuKs%?A!?Ei9a-YE0=Lsxv2@A2Su<^IY-Y_{xYXHe!(s{&-#&XB{fPbW>7BQy znd0}4?mvAH_lW%X!NVAI@xkp0{28}i-g)*Q_7UarjXU?nk2nvW-Fbdj?eu1zpWc1d!%hk<`2A`ox9#S=+j_b5_Ks5;Sx1>q3~h=`qR90iSO?gZ5*`tIFDhwv!sJWW)RR-!nIICZw*A z?G_f7meg8f3y0g}GdFvFO@C|6{upuE^o!3PJbv^jH@~>3a>|szzR{VRej3eOu{fk? zPQyEt9cN}0WY>%hPCeY3u_55+%w04uXlvoD;!h~QPD#s2tD5dyo13%Jarx?`%F>D$ zr>T=?x*b}4=vUMp6_=QicznfzlZSRLRcC5@z|36*Gk5xej48!m(GB95q_}*4n7M&y z=Bh>I?Um2m1yR;V&)x(BBcq~YQlc~>GFM?t1s>*7unglV(6G6|dX%td*B(9Gzdurp zXIR)}IbzhU1Ew%@Ctln@rp$9TG`)2B`mMVL`}gmQ3Qu)35CtkzGQJ5{q%E+PMPVvS zJ=DZE`mbERLG0Iw+(&5IMXtaU=_dRA!*zK~(i9KjjKOn*gCm#m{kr?2!eX7cn_%WT z?(_Ey3?4sersG_G#kr0i2prLV?WnN0@fz!WcL%w+FLQ#4yJ7(&zN49YKYsh)#_tc= z=YQ;K|I@p&@0GIu+=u^X`gm55Il;RVKz|Hb!GCUI{3!$~s9odZg zyctGgEXxHanuDPRdL^=KFgBk>F^&%kZw<9HXW#t4Pg0+yu-?A0)gOjk2)70`s^EXP_})d;9U zO9ncH6xP5lU!V*yivpcW##n0RX9Ofm3&OGrv{~wa<|#r<0msNn zrdBPe1-GmgC?N%Om&5?{sv{{ISXea)aA>I!@HiOBxZ`z*9!4Tz3~ftcqX08UO;zA8 zKFBZraX!kL0(()KmbtJ28VS%?w`^e^M&>2-Q1oM}D`tw|6dD2ueg@kbp1;SbZVMYN214Pm+Ei5esmWKqomO?WX zGDc=G$QToI|MW@rOG{N%>=ZH?g3Jgcn-XRs=!3{IPe8UZ<>MqRrD^U0jEyb2122S| z)fJUViz(m>wmxz-W-9u5d$zz>C^Y4hV1K-*XTJsX*t+{q+4oO9MJKBdE+K(~So#7O zOB@ss<_Z=T<`x#n`3D6i@Ei|1N?F+{TZ@g2+l0j;{OC!2$;pZXc5HZ(Z2)5=l0S%g zeNbR*!iN2~(uQH#g9%vH%MTOR$iB#ae7{~@SyPqch>!t}QMG_%VuG7SgEr*Sbb*=B zoC7WN&6i}qp4Q{v{UW;%bL9t2l8=2QRW+3dmtx>Ij!6|fXNtp!sW9_WU7xP+eA8U6#2VJVN4`354YW%$P7iwvKu+QJ^j~Q--Lc z?6~s{o}S2gfac|wFFyzw_w$9)6IC^32bWMFKDZVY0*bMTF+7fZL^79;F>VPl zNcN_z`D>Dl_pb4HWo1>>abgTerRiFh2}nl9IH<+{_9!7x)@Q+^)A~>j@m=<^>sJ}{ z7yA(-<9)ePQ4SI+5AT5~g)t4w1friti_LKGx7d;?5SVZ<1|}T*O30``WFMb@iI$Om z{D_t*ed;Q&0PU590V*((TvGrEG2vkW$E)xiz|qrU84ZBa zx9At8A5UseR8>@0mgTL{0y!!cfN)t@6bUGXMuvt2_~G9^WLsLQU>Hq1KhBj@R#sG2o+#X^54}<{7YYp&6pVymj=nx_ zK>X|(@)2&%GzI^V)X#kV_ATM7;+JoqWiL`RF!iE0KfVxOHNM}jI#zk2yu9LQfsZ;B zBl888np8}8j9e69AO=yR?iQIbv`~;FfB5z}@lVB1pZ}0Ong@Sd+?IVN{?z>XYy08y z(z3D>WqGNKAV_J3LOzD6SqcvcMEZo>B;+H)lnoG@5gTUu{HwB$NuM}>{P|IK*K|zL zUiHZ5-#_A?Xn%gYSWCH8ekPk zPmlO13mK*e@UR|@j2R`p`TFhy{u}md{BP>NetEsa@5-ld5AdK{U*G@s+lLSD&K4az zLL8+Y$&YrTM8iU0a!5eY)BQ`7n?zrKC<_T#nE!eZixLP_qyFg}SS!pIaYVZMN*3y9xeP7}d&W1DHidZi@( z_4ikAU*m7E*Ku#u-@g8>>C~UE-o1VG`QgaxH*ep(dH3tn#yoK`?Qj<1ijl-HltNh9 zaa}?#O9TT+7^|8X@nOBTd-VRzO8~K6zIyW-_8l>=)Ly)N^ZGTq^!jJRtG7di1)?Ha zao&NwW^|CoHU()SkT&Wy6c&6F4JrlGEPwz0=`YWpzxd^sH?Mw)f5H6aS<8&wN>siQ4|eu`lXNQN+=s>X(B*Xi{7mlsc; zJ$wG-}k?7%Bu$eXXW$q3bPZ!Cr~l24iA=afn}}$)5UcNT@lzt z7>EpUBUKc}lZ)Ozc?{o=p8s-YUD~r3kJFxDPsLAYkDos7%*+wx^78W1qc-YN#yi-M zF$H5wVU9qggL)^@rx+L-fFLzvF3ixim!ASQ^5D^<=Z_aFrQUn-Am<_V!PCLKOi>Om zJNIC8h0rHyYT>XlFbs6)7}+@c+Z8#Vin_LfKwi1 z-KRge`{de*w5)6*i<6y|DsnXO%kWWvS2J{pqOGN^jmstB`eZIk2RC3D8X76VTn{|| z>@I$XefR#;5>?D7;?~n!cjNBR?%us~`_A3iI|{cS+-^=ico1YB%svo1&j>%d6_$O5 zc`n$dg@bj-Q#5@ZNf|8^8hT8O#Ljwg^UkeXw{JY}oU4rKZM*XL#_fb#dgFD2bhtn7Q$=+NlO#g zB0wOntE8vLgSWb_zP=tC0wVO%E&M9y+LcG$Zj?O(6D`i)xpFP;D*f6uN!#U{SFXie zrCqss@pw`yk;Y5SIJjnd^uhG>b>JvPBo@~sX=#b&-8KNBBxOB)Z8}WN0}n4;y?pt~ z#ryfRt=Dggg|&AsUX8iTymINr%`id#?Tc4pF4HbuzgU%+jHf82CTAqr`KDzgXKn`> zbYqY!0&7Je)<{Z`*Ho!)SN_~M0&BR6_{Jce&vz2gyo`O?L>3kp}R8DcdT zuf$!TUcPWDA(2SpB_>DjNK8peN(+O{JypjN9H60rYl^@HgbrDcN5U~3MIDr)?j5;w zVPyEi(7k-s?0Z8Ou9W5WT^YU*J;FYJWu!`#6w-U+{Dooh2yOVna6@83Od>leF)=A6 zY7r!vd~>;2ktQJ*OX7l5Eeclw64avW(!s%j^MfNnd-^X93=Iu*OV39Sat4MZSEW95 z%&_f-bZ9^{h!0WDw~0=w8=WiQpkwOn8uFIkv<9DPamo(IXl?b-;ejj_p=A3MS2QjIGZ{y^h)u5rbN=) zCzYPd6i3I$Fk@qU)gY+!kW4~-)J$BP0~tE3t{_o6p-0+F^icYn+WLqdqBpunr@Oc7 zd`B2>O5q~K!xy^yx_f%Mr41*$CEd9qB3{gljtMe_w~)2~S*fOmtBd4za<#c&Argxj z=J$1Xi@L~X&vhqvanE(18)&mp7u`BMcVm5jH_^rDZ^*5Zb{!(3;zTS$934EF1&NrY z@Sp(yw=~#%U`FF%z%5VqwV&-EI`Ol~ow|VJ_cv(IX*nw`-+Z9I{cLCF+0Krv)Yk5z zsQpAN&Wa-Nka>_MsF;H^LXD8yrlh5XmM*7VurXTJ*w@R&^R_@9b@= z>1fA0Se@I~=tSkBegBQ9G6@qr?^jkyKT2xh#<;hYKe86)vEw1vmAyw8giI z+M-)IXWEjqhDLj5G}msrp{_n*ukQx zhtEsLnE$mElLsMguxKX*O;Y>|(cyww+SX5+0csTsSBbfUlLR@tqP7FadNmT_` z6~O?BHCS8{8CzV?-aJpY7_S%CaqF9#PaG77hejq8oNQ@4jn~oZ>l*S8G}oVwt>c}p z>!=lbxw$&Jcm?c@2-_bH*l`ZwB zPM?B*ryFb11Kn0GUADq$U07ai(`oz^?ewXVWA&%wPAN6kmnV2kojhUUq$zV(1%!t0 zCHAoP?%nQY4y%to5{~f+6%lxaQ0HkV!NqAwEw!y-7I7^#wfIT;sk)>4-Bzq}!`E=# zoL8-nK2mr3Zp-TDn1 zd^h-P&aNnrKf$diB{q0(@ZIP#XYO41htH@27}9#d*|y!?2)pRd2)raP+`!)&xvhcyH9t~q+_*wK=bV@FDl?OW@! zVg1HUn_cGHOr17!k$X_EzyGGFqOzEyn#W2GZuRpI2==wNF*h+2Oq{cL!Myo%XU+4* zgXvp0Iaz_jwUJkpaAlEPK3h#qT@e-_w-d!jit!_Q#lr+xte1aEnTp1-W;bb!9hX3_7*ULI+oA{ zLWuz9Q&jjW;3S3`2Ubjn;={$F!#YQbV|~|e+T!n^35zHRp%SopwcD~IFe2}$_%OS; zIAzWQ=dail6d1VC-W1XrT>$}`eT+vajXH{@s>XwuUwELX zumCSqEGWtk-LyF<&_NY;^dgLnbntAq?%9=CR6rE63yQKMcI{m&fcXw@Fr1`{>CIiS zc;V7@fm;IBuP`8y$oc|v*jc9vNW7maL@Ep=&^tBi@S!|BpOtqgGi1w_9WLq^B@UyL zD3ry!LicBh@|k%BiD99BdQ=iA7E=L1rpuNuS>mxdV6)FsSh_$i0dPo)0RNX*1sD<| zzr%S%j$(Fh%C_Jg{u5zkz(~>XgJU#?bLjp=Xk_K)#72a`(h6_)cua{oX2pu7E)Yjv z3sqsQH?Ty2RI)$>VhI>oT!jYd9c_65k;Oikl@+&rTj(MNJeq(3#=u-hhz`QlgE?t& zq01mgO~f=vnBsz!E1cGE+PG#mz%(pFgxr{$fzU(&iOUu7L?D;oGgK8}gEu|<;6Xf- zaqwXD&YjzY7%2tg(H8AZ$T*mpc_1q>CK!^{6ikgi*}=il$8Uq{bcipmvAMaKu8M}4 z7@!VABX;7F{>t?W}7395s5O0S#$!%j*H%IF_YcucIw3>hxQ)Tr738SBFDpur}K z5aUq?qO28gOo60iVr6Bj6oaXOXJ&eOInOq>oVv(;3QQ%Yo|);tkg+&$xrm2@0uBjw ztHC0WAB9J!3NU~I#F!x;LCjYCpIwL&MeWZZY#~X;6wCmU9%D+2#sEN3T;{cA(e#Bb zYu7I4!%D0s`Y9i`Oq9!4QRcx=Gw19Rp^_kxV?8QeO;;!s2!)0ai~tB6ihx>RO59>P zj?t9`Rs#5^9E|};tF*>*^(t34m(?zYpqQm+3iuX+TX74LrDc*lX81}<=oO$56cru; zNlW@>b+kOF>4FR^D}9hpC9ld4g{HU^X9mdUS|a(DJg}aO>2CCJTIKBQ;sQH7GNx)Y z3Ra2C$pBWRzyPT5cuI;WqMX7aLPPh2#UxnErE@LDf((R1QOvd<*t0im@BRb6EF4x9 zL&Az=M2o?cSaUbHIjnMYT(v?MRxFmT2``E2SB!OHSiOFS=Af6RzTaN5SDaN+6=(f$9RTvP!oAX1ZWwOtIFfT;)0p_?%lp)`}W=0n-$O-N*-tc zY|TzRv~7Dx$o6gF*khUpf}_khuB?Btnp=$P_or=B(gy0jDEjvx2s63E1Ml zIV;DS4d^zNLMBsaVA;&t6T$ugTebuQZVB3uSS!+o5u%XcElYt>QLqnmS+Hcu(q&U& zSAi)2f+3Q_qzF95&2nLJfsg?5&ej0jpWz#nRpDx(gx+;52!D%dm8Xdf0hhWm}Y3h!(=7Be}RD_6AA!$W_cU~MYL4tyZUeT^YdLF7++K3 zH(6k;r*CQHTG&;NuiHrY>1|r)v2L?>P)Kw9f7{i^JmSSKX2Z2Bl$|D zN&t{Hin5A~$-q-Q#F@{gL9i*#+pxjgXRVLV8V|n^JRvb^lZTg=kB_%ETymW|*L|J$ zdbfqMXU zlmIju#Uu$sk`Y8P4w8)vI9x?2RFN>%`5sah?&?dVkUDIP@!hdvYn(0?xT{qTDm_$z`x+(0uF`CVW9UKW3I=VHSRHP%I+?+ zr`j%c@o-&iJ!8faSEt$52{yPb#d@4B+(rf&e?fohr zi(HglS1-4jK7F3UGU(ilCCg@6+r-RZPKV!ZrcV)Sp)Qg+nh0teg%go1!ssxEtVjnf z3M}JA_RcQO;#Eq{tL9oyn>J&{G;8bWHq)nBPm8f8rcHHoS*Vdk6#%k1nO>>V8DOh#g+5>v3LF;h6xrcD}aWg=fv zFq$&)6Pg;uS&=ozII2tvhJILwXl1I&BEzDqprQeA z$*2)%+)+4@3=K;-d^RK$@H|7ycnmx+ZN{uQ(-J1)lXw%ygJLZu8fql7`2Zat1Ph^U zqYlLlO5{UJ5y6tKVJsvj&?ZhCKYqga*a`IUa417xodZo&Do0iQU(fzEuw+96ZV9k# z*$kRoIYw62w-8#59XEc$1o1e=*s)fYCi)u6kaN+=bgqi33c`DEFaTggG#aS?IP?JH z7H|kfCYuG{K&eHPTOqiDuB57CXo8YvNTiGn^)!{(Xm^BGaWaj`Q&NJg4>m%upChUN zg!@Ki68ab`3nZ$rfuRc$nJgxQ$z;$O3N)0O5hMdNZ(xCD{C&3lOV(PzTkr)h| zPRNB(DDbYqVZ(xxXk-eNN~7TlnshK8Nrk>cdI~<}^HmX-`Cs@c8~Sa??R?8nW$+YJ zVV4rg>x!u8)#T4-_p5@ z=_n}6?Nx%2hoNG!Mu&<4{ROMVP<@C6p(JE1PRGEbWN-m4_W=(@00aQ+w?%S$`M~ei z);8o@VJ$LVrwK!asmx7}Zx4I>rPU3M@r57~nc8mjj6; zu1rNy&KCigGb&0=TT{(S#o)@1KV`>cU;cbG4WlWkakq6E&z z<*3IfiiNzSuC1vH$F)BG{{6SlKYja~M=WWOW++IQLK&$6%2J1}Jyw;56~@z1Td{2>)Jbpi$(jvc6LsTg1_&txyp zBfbp>m4M&=D*N`e3r=Yblt@VuNegh}`v-auBknsPV|`MRnK~N5cFeH+r{sluIt3}EI zqWob02-M#@Zrtu2I3Z<82BZT`CgTh121d?EIRgXI!QKmh%KHB78Xg)blPUrtf4+Ss zOJ(DUuED`G!0#Uz>3S#oZD{yXrIg)&z5`dqm>PIn?_i6RJs`PwvH#C+z2`6V50oRa z{<$n2jEXUr7xsZxNu!h|89IONcPTzlDOHvX_SKp|0*-OU2Q&dgUm|G$ONWOf{R0;z zaD&o-w8sMWMX<1II2XXFxPb;K9onV6{pTgsQstq3dq^E=bQ%?#?AI;@Z`Ml{1_vbF zebW9aDPMBFD<0qzAoVbz3}Jr?1lOa2g0!o*_)F8rQ~)3g~TAuEa)AokZOU5Q+4$q1Zo7xTR&|8BMwMS2Zl~N0Rr$3hSB4O zBjr8!leNi;*qkH1gXL0f5K?=puCBfTq#!Z!K?PgD>1k36$&eHXUNlT;Vv!?^{HMX=c7sMo37zaZl8E#qwtf&9NTT=Rbv9!Fr z=KQNzIuqmA!5N_AFwRnGIY9E&HK^O*KnMo#Ac}MO>;XGtrOLzg9ss`oCy_~Yl*m+4 zb?289J{alR1t(V|N2SIf@kBYm{QvGc3NVN-7+dIiFSs&V${cFn1yk!E{3ibQdu0_> zCACi;?Promygi-6{R2m(HXyMKv05stLFOsccNBBTOu3yX=HR#zR4WJila(Oi=3V<6 z^+_2~pQ?`6y}Ij)AgQ!2sD(PE&bQ4OK41 zIRBk9b)vGO>d3%{GiD^1L=ERfQqs`iA?YNLeDoN|E(I?GBMZU-M32V)XgGkIyI~RS zaE1j#|9@suRaTuSx%g-9IEa4F4g$`6wVWN0E2 z?}QNU>Goz*sQ-;$r3L&da7yXP+ux#@;I|#pfx*6!ki?DRYr!B(-#xddjw|{W1w19I}3S7prmbbrcgLybJ2Tq)I*|@_Boh#J` z*#!kf$oOL=P_jV-3lW1ROFdc|@G~4_eBClwjs6=Gi~PsAV|b-Xd1=@0ZMFa{d9@5k z@=Z7e7bF8Ya^d;;1%+Vyk)z1@KfMpW0q-|7;?0U@&U7}o!qWafu(Py)omEnCqP+CT z;Fl9)m>ADpGO$M#i@(wj;>UvRd3lEl3XuXdyl8Ys1OBh|qq(I%&II~A%Gu)l2WRUu z{-@SY($=1(^_(19Xwavnw*cW6X1kS(}BfV#(ZH-^{=KaZrtIw{S{%FfBnKU7cv9e@!=@m~gE2I3+9Po1t$(gU%Xo8(Nd;9FmR{fp^E9OV@sef%~TfPdH>kuaC4!5q2h%*=yXV0#`&FFbs> z_$V^ItPGq3%i_tC^+nF$bVUDp_crmJ##=e{>)elD-+q0F|Bd=3DrV%J`SQ?|Lcw5< zN9BhPO9ry!;hvEJ^0RV~`+pAa(GsB6$=zR5)gT6tOey-;4=>?l`5XK->CKzy*XnOx z|Jr!!)62JSUjF%D7_Ps5{pLLo!idB4!o&I3K9nMy5>m5GgZ-dH2<}Nu%Q%pkiMjz! zk`Hn*ic;jG%F3E!ez4ZsJpgg|D+=O?#l7OZ{^jLcIL8hrmS4Sj1=snnU%nYAJXBa% zR8W*v{`%PxKrvyF%D=P@WbQBi(sFOb7EPrQ8#Rp2xkQAodvkf-Gl`(SCXU_GWpG=n$_kty}iM7KQ23|%(bJ(j+d5~6*)o=9AEwN{OQvt&qnEFFP_Ff!=8$s;ZKQYw5LyB-mlBV z^HlP43)0J8yxXXVDd_|3U_0192-(PFke`^8oRX53egG*zu_X6X5iCV8+?87mXyi$S z@1Hz+{P6L^r!RnJ_VjuBBMeU0QJ*~OKqNDz?5ytZ=jUM)+!iQc1{K}sL99B6O-M+B zauN6+EQcVK&jGwh8)EeMk!tkb_{lnZ`0&}oMM`ORUp&ZuNPG0)=}>Mak)xcQn|AE+ z=SY?}0v&nOO%57Gl0R5cY?%r(iT@&WjtjZr;3g z{n<}$+N0~Y5^j=j-MtlmlY0AhcX~RJp`4zXl6%?9ETQa>4+S$ThI7IPq-Nj{ktjMQ zHa0#H+yaA$!X$4AW)yNbzaY<79m5=2pIjrZvv1wXkn_|o-M<3-G=*!|Ze71|?OH7S zc55geXwPAIgbq6U>KhU%nQ5m44;gwf?qCH?9D2?b?-_7fO;usr;0*OqXfmY@)u5 zNyBV9hG2)5F3;>EqX5&Q}fKui5~}~{)`7BS1w(;eBmC@*sk3W z2~Xa>csb@0^YX>(H$nxy@;_)7uZ>hCB;hH1D0(KW+?ad-uR3i{!>no`Ng3@2oKTCx zMItdGWuXvCPRUpXGtFR2);1H2WL{UqEp5col!{`p*B3(zv49{He9}*AXgVdqc#Mn4-JTD<0f-|bInM1** z*2C&Nsw6b@ry87y#$$A#N2#!%L5c7U_edp&bQP=={n{^di~H!^u!%i;KqQWhRusqW zuIOIK!Sr$=-5r&`Yj@~gc_&7P1ym$1L_I*|Ded@fNe|IY>1%B56?Nl1(cQXTJ?Dnn zfgo3~NU><7s~2_-UH$bnU6QUG0*8{XA`!FuNY@SnOed~u05qUPcIVFBd-jHg;Sr>L zkvOgdL!Yn!JcNKypv(21Bf4nk&OvT}E~$%iuKTRC)mELjSu|(k>3*V%d9JrEyFzj< zACHO!6imD~``jTRrXA5Sm;w7csWc>H*DksAaNvZ=M>}=_EJDU|_FPS0TW1H}iOGMG z5QDD0uU>mjbEl+i^MSrLpwD%7wjWGxIae69ACHM*M-pN29i3A#4gcn$40#M~581I} z=PqP@7@XeZL*T|NfHm0(KIKSZX_vwqbRJP zvnVnGQQ*SyGgoaf6_-=Pqe8a^L&*@Njygpd>=w_5HNvj|G3y$;np@+~h+3o1Fk9N1 z`tlaUcekFw+prem46C)Jqbxk8`e;SR|H=Gy5k?M>0my09&6Mtiho*r~Ok-CEO``tFpCRcD&uQgkz`v7?#@ z%`Dg-8W9#7!4BWm@Om-EHYvH-4=Nbo?=68_w+3&+cW5B5>^62g z-B#BqZs0c7H=Jo}hMj$DTQh9U@dj4Y>9(}cX1Lxk+TK!~6edmy4~GxV2@Au+i7-}3 z?XN2_CcWr#A1E>eMNmsbnqUB+KYL*S_U*F=>i^H55krn*zHrwvb?Zm$)4xH#K6t=YUcA{1;54c)spxcZ$pWMf%Z`v%kG zlWVj8mcT%8n_LefxP^zUf};wvGTIt)%vLnj)e@()YELy(CHvVgm@{YI68BwMH4Ud= zPhMMFa-=TylyPlsV_jM7YN#~`t;X3p`iF*t^MNY2wes~2sI_NYMw(EdZrbc05CEz` z7sM2b*}Wc`7&axT`Q({U^VsIMDD*fwI;~peuzX{7bv0f^sjjZ7imqf0(&S5K=Y)lx^7P>jym>RR>|cW7kf96O632tFf%A z>d4ytH76j+J{GuaC1`PWCRQ_CS35iSWRzC|r_QvzvNY7$!FBagYp9q_pKfhEZQ@j~ z9Xms|hxi|R6mJN6;Psj&M^)Bu*tiiXf~W`#LZh`aWE)^I=~Gv1*}gT{ujqCR=!%AvJ54$V zbfK#2`i;K6en=Y%jP1dD#)B^Js^VjiwH`ZqQJP0T=#q(4;-FnM^cUF+=) z>xB1^lcW*ojnt7@n4^RWi!yU5{A0^0I^Ay>qG2P7y_Sl>*Wyw zu^6<~38-NU(hCmdlG&X<^#7i|5Um@8!Q~UG4=pNPSa>&i2BaRSI|;!q0%t3i`mCKI@>!5AO8e65wTu zVUzb4=H=kItem{GE%50n4r&-B9_oga`N1J!2l9wqW=?)wNXR-J*g3{RsY%Od!Qut; zT>SjjHbI_iV#&FoNCpJfv#XLyt4E&21sKXF0S-ik;qwl($9vfifG0v3Yp7zc&jm_ueNOG*aL#v!!R=dKqfr+_xtq+$c0Txu~sjE9oTu+z@5SV_BMifkK zV|p4&c9Zas@Cg_crOnAu6=k9lEM0+0qAnrgQenpypR@@+V~VQ4fCeZ`1HXpA41v0_ z*v`?*c~3#GE*!ZLsDmq3G;DuiHTfI`vWiDK9y=y3Uc8b{Ve{1V;OwnXU!4b)2DyI5R3}$Y zdvT5-3R~al(a|x{ z;(gooAvpvYG?t34r7~5Gs%&YX!lGfz4v1qQ@r_!jK;vncm??1BG&oJjV?aF|`l~R} z$=%I8F@+855xi^7V;j%>gpUy-jY>(dJ+>Fwg~J;aUUVqX(HqFqXO#dBr+JFwU`K_E zqjni0-;<~eo{pvI+SJkm8>}o1xr&(00V0|pQufcJF*QsqCx;zA95&g~RGm$O&V%yF ztJk=>Z}rAB$C&{-NM2K22N|3kx|f$s01}5)!#>(BR33XUn@1`4Uh`pbFu=u;INCVw zlaD)@#!@x2aBlk|`#i8}f(2>kP{>E{oavy zyannunWm^VMnCWM*U#TR70t2GRK{#FBO>=jq(s_MIVJ+PXEHb({nTrmAs?I$sudTx zyDhMu>)`1Llx+%i+v$^#-NE4v)N_RKB9ywf*FMgU3aXt};Vv7%>0V9(;9brRiwc7? z9Q!k-j4I}7j-Ajg`}XDg*Q={dbd<5V*^u3aC5RVMl?}&dyho?9-)BrQP(wTrV1>J^ zadvcZUFGa*0fTRwR96G|AOPejS;kxG@)A>bw|%@FAB{FdJDTjSGvP^%!2Nir_nv*p z8-RfgJ9Dn)IIH#_-@g9%^MbR9E{EovwFmf=;`miGC8G&RZ+?9J`r~!#WW%3&wb!{p z>^eHRIA{W4CAb{0XL;=hP=9$%1rGy}cdE+nn*$0c(~6{Ks|J8@hY<&b^}O zDWI23y-~ z|K^91J61PJ{AyFB9PM4FviHyEv^jF4E9{myyXsOf zwsS6Ii|7nDczCpsSb#_WFY#V~N28CvZDbdyS$C~PDn^+mB@fe7BY3}K^V(E&-E^BRIxiO3ZTpHkJ zgqNd2ncTHd%7FqD=+gtQ!kW2A9b$EH$kw2stpQO(U@NQZ;s$EEDm*fC@8SIc zfm?%s%$a$32~AN&9oOgRX{vIWRCrF)ar25L_);S;2NZ>y^Nz_Y81j-=Rn=$(5mhi+ zTI@6JEJ2;4F_>lI5#k@XC2&(}`aeL9@`?s3_JFd<_V$hr^C1_) zW^LKB*&leA8JX6=TvhvBt5IDB+w7F!1ubiDnc8h5Uhzzh61$FR|c$_yJ+D& zXP+6cyE9!9BYm_)?90i|8I{I46aua&bjm#gO6$5uu8p=pZvl z(bup5NV61qqCizJydlu@aFvrYx3;yhPP1aNvDR0Vm)9^c0PIvj&p<^^F-t*GUPemWYOm=Q2tj&X zY<4ExJRMM zB?Ac_g#6k@o7nt-;IHuHKoWD_Bf^Witd zH4RLlxgxcxshNd=yp*(bstk#=bec?xw2X|jjH0QZ{chl#Njc5p37K-DQjt$o6G~xd zkU{=Y=~`iE3UhN~na%J#Mo-Qrt^{#sVq$7)Y^;(cg^^B|5|Ne^moapAm8B;mA&31k z7J9>>94yN7BZq)L2);(zB9wqpfiR;fqE-$<{JcE<-$_t>vQ8XA86T6^@6mF~nAzGu z$)~6Hp1_dssMt6#hV&1VXD5mi#J~h;v=UcMYG7_rY8Gf}Vr*onr=z6_)VUG_wv3Df zxQvq)?h=qe5(?TaJ9Y_6NJ)tBb28FUQ^0d1{4Euepo)g3u7Rvu3 zxCFHLX>cMyOcBm8;^t6Zb)eGK%(BRAhbc@9)jDdb13|98^C2<1C|N) z2AGeike~n`?~d)9+t^rHpt&(T_ojd^Q%Q6P!9qbz%fQUa&bgh34;chJTvb!Y(8S!@ z-pSp2Pe5p7%zkV#tQtBqvj{sCC~&3a`STx)tW7Pz;4Tvs7@AO3i{>RIE-C{4x5S1GBXBk~sLr4052c8fyjD5|Jy1JZ6`>)`C}vo|m_A_nEX zlQuRP!d{SHSbQMkMa-h2laZxqzL@}V(I6NhL?B@+1i4^CMi1%QS<4Y(Bgczkf^9QtRCzl>RLJm zM#Qjmhp-F|jU-4O@$m%Ni5N1Oxmks&RV^R>}#&%n^c6dp%y9h_X;Js_V;$gc*6p|mkU8;Jwm0;xsGsTt`d$;nTDuB}(E zuYGy%Af#<+XKsOma{*^gYGwurjTBRy@g~?<43J?x-4s2XE>4e2SKq)Go+seO9iFz~ zu3{s*if&{B0&&3(@CE-$W8Tmn_fGfZK2F>|Cug?xm=xbWSmTuNW zFjQ#9PJEU`c|TO!4!2#9i}rz}w?8gG1fB|zMggt@Wd}w~NJ>tPkNeOPvJTx0QA5LT z-`Ce(j_O#On46!4O9kBGTiX(|P%bVww_T8gf*c|-uZej2s(f?iyd(8KV@^4t<`p$$*6u!sZ3 zp$AX3ur#;u{RjG0+BF#G=hF1b(#o@?wnfV2CH&&z!a~m?^~$rwmD!cGpV0b>dTnuL z^~EZFe!dk?F?;*Y%ED|fo^>9-^kQXx5gt$1SMRMa&nzzE=N1-P!2UeGC+0YC8}mJQ zmIe5&rN#LLcy+@3vow%&j~s*@~gzC?1<$?8VbAK>tgF7rd!ralRW*0fVi~d`($6hG(8%oE-#?8LEQhV~6Kwm*DVD zqeEU@UYJ{erpw3hj0^ZFBqG3F7l(V-^Vx-kGhlyybqPNUOvh3D7HAv1H0uDDRs!v; z9QkkoynhByxwtStGl!q+03*wj2e$+5EJC229d4{F&!53lEiU4xr{`v8ar1}qEb~h< zSA{lc=S`GUAtxU_g#)1hcTGK+o|&1Qn?HhQS;Wu6BO(uxcBZ8eJ2KJbrOuvL2GL|015R5Qt}1+rinTB6O&~jJpPX7cMwsU4z5CE{ z2)akpZX7op`22hso^Juadcz-4&-(u~Q~ZZ|-bA8vVrJY3%A7L32B zXA(#(SoO~>&L1Mo?arNHI5L>ueHe{!WD{^;)3{mKk8<#$3;5*`7wZ2Od*0+eGP^Y2 zhNpz%yLJ1{ZQNbVDDEE9eOPz!+2akL!69bh*%$CDclSaq_kV*ulQ1}p&%@5g3qwLh z!tFbE2p+r-E<_74J~=TtHI2e>c0Lo&v~tTAZg>B|o_|9B#{V08_I$DmTT?Tv8jLuE z7-Tf}5pd;izC@=G^5uLge$&!}G&slpFYuY=ckmg*lrg?Kw*coGITQK7>K%7e^m2&Q}w>-G2plbsG|)2quPy?*JJ^@c9E2#*cAN=%#0; z0_e&AN91!Vx{5u;)hy309Kh3qCCGULnvJx(K^#bT8>b0G3WOgTesXg5QL7-h{J$rk zb&t+3Pd(B09iLk~0NwrZcwl7c2&Dxu`VhDW`h8Im{WJCe_lO>iK5PqD!T$;Q95A{# ze|-1mF1Y+v5!`YSdQ7oF!k#FW5KwzUn4>tyJ)nE^@X3e|G_v>~lFv*&_=R*fO!cd| zMdI+l-1G?$N?xE}7aaaS2GEuSfjLqm1pCkbjC>};?CyH*iNPdJ;x~@|Jn%OHkOK$r z1MY+t7sVzDO>oftvHMT@_2~aU$Y)0DYryTv9Dh2$P>B}-*CQ?I0@NZ9W&kBezgB=4 z{P)N1q=Vo8$K*4k&n^@J@HT-;v{mAX)cr-m_{8ubR6D>56Ssu6otO>sIsYB&+i%Y! z_B{LoO)f(xzx{?jGd2>@XEFl%?9smfgVVy`XE(Hoi?~bMQOOZ3Fw#QNse5~Pc&yhG zPC@mR&#zv;%6rX^&}Z8LBKq9^Ti46RrpCtK;b+!t*b^%Vfz#cM>)AytFY4P^00@8L z={0<7tO{zF0Dk`P?Bzf3Gs8>N4U+&rf1SJg;w3=QWC(u7)l)arHPk%%@QZ%l2RE%1 zgjqmxoLKsUyTD2G6Ra~qR)p8N3}1=`7S3$`^}p!n?B{e(p8-=%grA=g;pbNXKSR>0 zuA%ZD_}S_D++qc~|HA{DM5sD}DxQlMFW@dw5`*bFZjk=w&}hMq{|bIiStUW8GdI}h zlp4l^wZ#BGBee-KB_jEFn1L*ePf$)kDFVR;v=dap1Y!|kIj#*2p7($WSVAw&#U;2K zCiK!=T}lV|83+HSE|V<5f4G*Go&y051b$6*UC{;s&CNuK(OiVfav5PUPITc;QbQgb zvpbNwJ}nTKtS)jJhcqNqGJbv z0v$eaV8Xd@5sKcBgRb|Fm_jW7BB1drcp#vm?*P4q}L}7ratYM<{l>cBx$qL-~txqI}p%Jm0fwwT0TIP44E8W>9Is?~Aa1l@m1 zKyy5qx>^i;eQ9Y)c|p|%0!@w)J_E1NE5!@IVG|Vw$j75{91z;hp6PSI2;~f1xO^cV zXd#P>{}F+nLkKhl5rNJer+EBmYPh;ErG%xpw5U8^!Mu`yKr_WYUV&SUV#56kC_o@$ zfOAl}5;*6~nLZ~B#^q%1w*1_MnA4D?8AUSVnxQ*pVi zTv`>8f!2Ps1h+`VgjL;86$phnxGp{jn_g!OIaOHC`NK-UKtn4}#6aJh+hCxfmFGVU z^w5*hvGn_tWA`2rdwCKeXy1Y|T*qm1N{sY1{QLrOfk9tF>3)J<2P+M8=>aPk!Su7) zq8L*7?iuLp2@v#vCqU4sv*-Q$_tHl)?ciISZX;Fc?uMVJgg)x<@zfK<7`yKo5@MZj;>_7`j8~ z{CV@iE$IBoePR5@om=U*Dem04n3o9*G$sd^MVp)4jTmUvn{ba=OgMoXAyZFK0gwcU zG{DX?$OwU6pf@=C2;NG0V}pT)54VSJ-bjZ+<(osqR-i{l;oIniV>fTy?k`HuOv_?G zs7UVquFKm=FoKsLzKZcX!DmpngOnJe6oYiRj?>5tVuCPik(ckL4w9qJptn*6Nv>bd z8l=5`>t^kCDlxh}mqxFp4pIa2bmInU44Roim!2JS3}Mi`$KZ{W#ptmMUsng6=!g>` z#PP9XC+%Q#7#sBoy?WzUpU~86FnY!{uB)g~XabRg-e?qh^~HAUkcpc0ce`|lnVervv~}yz-f#;ao_;%AT?Ao z5e^wTax=6YvxPy41a!~U-VFkpo=8CFT)S}o;-$U|h=4wSxjiAHqd7StDGN&*AK$Z} ziDA;Z1h-N}gcw1(2B8cNjf{f7^_UF|Odz03&LaYP2W;2C&j7%KE|rKi=sAD-T7ggJ zMfCApZ|b?tXD@Z2KBGx-iSgLP#DtVYx`c#i1VYmb_dcHkOX&JSD9J)<5~x17MkcV; z?g9XX>7nbe@`1FGK{aE0j$Ha9l4wC-gjV$hnL4G4p#@9AkP!tRTVNw4ngJ$n*& ziV8rP4GfwAVbG~gHdbbqPJS_o`(sk#=nw_{#sl`_!>?z+2ujnGp&B9NIwY&&>UT9X zHHAP?%mxL0?li)kPj;O=+nMKMs-dc;uICU{c>-FUc2S%}81%{XE*AI+0thWG0 zu9Ho1rkeUDIP=Y>h6avFbtg~4E_wXe(G%&%*-jik0WfrsnW6-=sF9Tx7glqRh>ea$ zF!Yh9`&mgbwNHP!57j>rl|K}698eNgmj?X_cjI~hh7Pc(JK53M(b-kEN7DekwQV!d z3Z@2Lz(T{z20D*-q<69b(9njpHa6Fm1t}Ah9%(TdtH|gm+&-GXL(7PTu7VrwBEpR} zlI;kp6e6B3tpuKFKYR$`&_~;kw1t~k*Z_5%Vn;*BDLdG@BOJP&{77qpqaDr(V~SHEg{*ms z0+Y0gZ$v~`_}-?u%pJeXNP-z8=pikVAXcME)l}80Lge_KY;A*WxUIFdy}j7M)ZPZv zZx?r*Cyke<8{n1>fd`MaX0*|?9&Sx@advZY@wCHfk|ViC8K=l7V;mF_9J;4rIvs3P zz};mLUIT1__65Q?K~F`(US-w6$`(y{X!Gc70_?iAwWaw`ON_NGfOT%}CaN+LQu6BN z-oEbcE^)Q(&1o$x&CPA4zOEjgzAgqbJ9&5oM3pqva4L-Q%C4ayA-;8wv2cr1hDUJ$ zIZ^ztsykdUBd`llUwNRS$qa22?F~(7joX^by=+{Z+&!!%Iq47{v6)NKG5}DF4EUyC zQv(puu08?Yx_nzv-!gJ~w%uxQS|}@;1%w9p)ILH)bk*V%ZoYt!&LC=FgrYEXgNAhI z8c(?GvuLQVPp#u@sK+@wx_WvV!f$~niT;CO*YgSRimGf(ucK+m-m^E@j(|hsfb!i+ zxm{5k1WtY55Pz?lhyDy?nA&A{kKSAXAuodj(v5;b@MRe+T;+jK=vb{&Qnx`vSBJZ} zd3!^9X95ikm$%LGz9GRGbp#r^t}H4j)Q%qjNzfHJLF(gB(bZ7bat-tY8rqSZ64SIg zF*`FmKR2ICFb66r7(`g>h87MRNwPdCMmA}KhCW#0@8KO_1_V$Rh8oaK&ET-OG9nJ0 z85ZUauQJ%cp|y3jH0}26@u<413juayWnyL{Ih9TDVLFJGMA03YLSa%?T3|>DICMP_ z&$LxJdwl}j#gL@?i-x8$4~x#MN~xf!sz{Cq_y>m;0)^AU+t>5JbrpE?%?bSDsj1mH zLVg@lc4%V6KnowEnhIDws7g%r+Y_qs4-f4ai-o@~hgdA@a~_`g(|mK6p+B!=Qe4?(yWqk^Fz`cS*92!HKLc)q6*9=W5C@m=|F3ZCD{YM&F($K)v!`<&7(9m0)dmoRF z9tuvrKRX3WHJ3q1F{I#-Im7{EL4hK{hlLdZ@YuO4d4q;d3X3oY$SxJb0X_SmyAnAF zq9i07t{K_I2#C&#)CTn*M@|XfAcs{W0@23CrtZ#RHIT+<@hnKRu@Mk&8k-^H;b&2@ zQW)k5!fXnGnIJ46vRznM7AXa<7W649Mt{spj);>$Kr}fi1qBrij*bm+&m`n}NdzD| zC);NOh=xW~G?f1WqV-J7-E3p)!niP00+K+DVeCerHWa17k%*Ck=K?N+1s3D?K}8bEj)@lTt+bL8`*mRLg!9N2Y@Fz6&Fufa#9Lf zRzXpxOYka!XFm6hxCI1u|HIzwy=D zkF`&&y22bx7^SkrWNczSR+(%wzqtGA`j55s6>n)imQ4^VzffomOIH_5K%ptqM(>P5 zQW=>hWZcoB&rHu|V>OU`PS{s6GIIB8q7Jn2xcJ0`1Z=Sk(Jljrq}1qGIVn2i%=|J{Z&KEU-W*We$&SntL1-&Gd!Xre!&OPY_1suYMh*xxDCg1ffIu?{h*~}V0pFRh zmEOrhM4;8(5dsbE>Jb8M*fETLj`C!>Nh zN6I3$ILSg*bjKzDpkq+AYDiv+1SN}rq|Dx&+`Y1rd~9?eTmk^?fdFVj8~g2K7zUrS zHwSS;%)bN{5CI{Y#*l980e_}r+PVW?qrQWciF8v;9Tt_y1&8>T)f-UIv$FH-+{wei z$^h#J__GB8f93)FnGD032xUO1oe?oj4{7KPISmw~a_kmZz$8=_!0!?n5EKx+x1b2h zg>e)N2r&X6hY{%K>f*hD0k}YcAiwx}L_aeyv9O@6A1-_tMgvbveSJe6Cu?44Htc-v z>Sf#j4M7tiB)#w8hA9cc<=BG?tQqV!fxKW#Eief1=DmB0OXUB>KGOpapbC|dfQ&%> zpI?Ai*0E%`iV>O!Zotp}*4hSoTDG1_u)m9(IFGwb1<3(|eucY1OVGv$`osOPDlBVq ziWXe0Sqy@}%wC_s;#ONhxI=*3Mc4!cfPKb#?)8OwJot}~Z%KC!f}gjNvT@snIqK+W zYnlWj_?gn{+$EGZ#`QB3%peDXOoki?0aA(GnV6i26^Hq3x83UtuSW0$__@JbdN&Wi z&%(9`FC4;pc&GS?`?@>2?{Nz#JDF-GK!l%#oT7e%pUE~mUF?MidP1UoU;uZO9%b}V z_!IT4YU~c2#TMAFckT7^_VDs_^^B`IbG$q;G%D|K&)Mb}XSY-@4R0$ecOOqTA3&eu z_Sl=4ItA^IbT`yc)l$=sv_M_YEjxQI5IZsTAz6j!I4H#@#{5V%c2i=UHk=sb3Z6hd z+j}}Ygrt`@9_c*M(Nvoi=nin^YqqqC!>o`$ljhPu2_pdI2)q%)7>y2(+d0&?!m8#>PK zD^!h@OiD=cMenp@Hgt1!0`%G0$<7)cF>Os$4eXs=oSmFq?R6Bj>|C8~5%>(nwkZnY zipoGf%NqE3z;hVsrpV)vDMva8Os5wF1VV`o=s5(r5d^_oHCXzj7(4WaH5M&LCn&JO z+0!`KJ3!Tqp@N3FJ>LDT}Ho$y@BT1at+%>DP3I*dvUX zG6#`jLp~TlCLjQA)?(>!@#YBi1@hV6-Y&zI+1?t+XMJl28(koub!{!x^E>l|tpcJU$vGC_|bsA;v>&56m;YBb`6jvxUtePST-+Msf-a-3KBm(uL5{)}w(Fbm0w>@ID_2Ekn~3V9_Wo3>BnhrKMA3Nn~Ww zWK(5!Ny{pm`Z)+wLIDS#Z{y)3kYVT`wDcnQ1ErZz)PQ_R1!nt2=ZE^?M>V#3Cvm zP^Uwz4uWQ9XdOXoYQVAsJR9f1k8Toye3k<8SxsBd&_q{GJXexkN>WrrLdVSuq0g{v z3aPbit*G#!9e0G2&_V8BGSG&rHzdnO>{b{y-d_`HMIkcSd4#2HyYy&-_i_pajl&gRB(YxFaPX~2aOi~J# zG{Rmmg@g`6&dMt!1}Lu>kk2?VQedEQ!fGOt%KBDzX4=vO_?bdBsEClYgd{G}1fg^Z zDntlnFT}+puI8mnz%w2MpCrV`K}Udn(V=!q(3lFMo0Mt0fRKm;P6{WXBPj(9lT|de z^^EnEpzjBIg59DW1kYThQRBih8O`cLkvfPq(zMLi+vYUu*nrzzr;i^5)~O1 z9Owr<$K5;}Rk_gvDm<%DF>TuolqV3@z+Y-{bgFj~TF8#ph$mj%YN=9}; zNkw&S15~0A^3q39t2}g4bs_l-ZE@!=T)eO^30I2cOib7x6B!;7=#LCJJK9-Wni?7D zi!i|z1d~EyLP^WYEg&K(4e&D;6Tr{p1o)YjUCzeA$<@o(KPW6JHZeIZ2MpHKH$xsA z!U`kVk15^_2g0VQ=!JtI>~Tga;TB04x8m!4f%dZ4xuRlg9{3+9H- zkkhAe-IRU3=b7O-u@K7xZ6YGWg8bp7KQ0agQ@UDe%1{XbIZb|EPNq#{dB~$U5^-`m zHXZ?CaTy?=we*b5tpTtGNH;PzF(o6fsJyzN1+@i)vjxs_WCwSO=FFMib0PESpg!Vh)KK86^!P>$V*`1%yPU z=<2m6Ff3|+Qfd}*VIzbGl3fTp3UM1ed+yY;FYsE6LaadI{^(ybf`zg$ zHq-;(DFAXUvRhy$Hy6ABiGhZK9EairN1~0INHemsb8+w7B_syavzn%^5wuircK7uU z4v$Gdi&k1y2N8+i`nsBGDvHRH zV!{Ak15nP%nF6m2)ZyCB&C9n7RRW-%-w2KeXF9t9j32rWc{8`D;sA8Uku!PfkUqond0Ne~g|9dB>)v<;;N;AYL11p@SC#`Q_U}ORn5SEZ1b#etuK>S0E zL3~n5W=>vF8JyrK-%iwRz^SOJ4R?eQx_z8%UJtr=`TqL*ynO{}I9y^L7L%BUWhI!5 z-WM4GcgcYPd-wQydwIIUJp_rfbDEP8DmO=U_3*N%pisbj9SGx< zhYNB0;2Ap?OOlwFfyE`}V9DU=5u2ZAfNDJ8IR|AFQA!aqLnz7pE1?c8-B5GDe~Dae z?QKns>qi3D;SIy<@Xy-X`j7Whk;#ckJ#c|TkHNS!2|~V$SPy{m<;1a&@Nn>8H9>rW z$ZBqBTK%;C{64~;qZC7eFc?kP9nlpG_DF%a%QN`7Kkzj_KYCCLo(Kp#HZl*X4N_k0 zApY%_uV23YuYZAwkI%+hHBf$sU>xq(7`%F)um91n?|1V=01ZZ-hvK?~1z1;D+duXN z#=dt#A`%|uA)kQzfD#se_Up&m&(qN21CnagG4FtH|I=STq0f2GZgOa=<2VK9)Sq-d zVX8lWtgn5ogcsawJ4M)${`CA|#y{34;hpa8PyYPmHzxb@>k$T)u78_(IEpzVt4IG% z`)?`_tp4$p|IOg%TQ}bQ_QyZ|@!QP&mp^XwH-q0-Ua$T3$3OmY?bX|Vul?6={@VZJ ztNxF{wZH!V8-M?V!yo_jH~#+ae}6paelz$t{{F__Z{hIAKmLuszw!6SgYGwjf8+0O z{QVXVfBfU$`1>1we>~`ZGx#_D{>I;L;qb>l{*AxC@%P7r?l*&f?{NvyF z`x}3MJm`Ki_&5Ik#@}z@@W(&?jlaL~_s4_oH-mrU?{ED577l;>Or{rV>W*IrM5{^w7B{?qrBt8f3j)qgC0ohtpe)*pQuG#LAL)?dBKr#t-PkJtYF zOu;LU^?cZP-hA&(t42fVK5+Z30kxj9UEB_>Y76Ke+;6>-7O%sJuo6 z&`^YIczXKJI^e}%9O|P;Fb_vS!RT;y?$w7c-`4*3zrK8WyL=~g7ZvJ$`p*{`lVSeF z(YaUu+h4C&9uGD9azlR^RC$iU1o%iQVlb|S@R2Uil81+$CJP#KVz%s!+8-VmF3kg< zF&qE4fdBi$AK9QoNhI;NVFYq2!dTE~Ei5>aI3;MOhS}-kyJs&n)InbmWdvL3yQtY7 zYKa41Fr3f2#kv(n8vO}A3ETfexQ0UO`^I(PA-j;?m+$>%|x}HH=FW{7%`(l`Yg$XO3ShxVM+*p&Ik9 zL(Ec9n{~yvyc_ncP`T$?P06OV>6Hd9eUwBpm;5XyRWtP4>XeB`m%%vO%{Y1OokOc@ zw2b+DI#-_waZ?@(N&VDe{XqBw5DQlEle!R4bAM`(!6Y;>cUVWs0 zkvrD+XftCC#-6`M?I1h5rBOP|8F}Rxz5D{&daKfNFSjeDnMLN$)Hynq3wLTCs#?%s zbt7fm)BAel3N@3BlCsN!%GeVry2@ikQE_i1X(uE`j?u~9TXAp}XVH|C9z%0J+$p{qr2Tpcb|v%eE)m<7e7eN~BBqY} zyixe_?D+hw$3$8j&-q*KlvSkoOZ2?yl3T7b_8)PKvbq*wscy5brjt`js`7nVG3ik2+^SC0!EFQP#qXVQbd;*vQt@I$_aPJ)Hh? ztC-WZb2XTwH}}MxINCZi_m(>?I4NWBfQDz>D)*lNlkjQ)bg@T#9?fm&rLh29Zp}vLr+Zj$+o$$!ajuYwr;PN* z!P~5JorgDPwy%2mROV4|3Huwj%ZNN`y`mfc`mUc5&-KkJ-HoqqwJExqJEc<$gf~TQ ziLH2kp)Fw*!_zkEP=onG5g5#4{%G{-%kZqp5r!+cRK5o|84c%W z?xQ}}V$|;)Et}lt7a7z{rh8w$<9_btSBJSyJY-KT^AI0?J{5FyM{}i~$v34dw$0PA zVi9bC6tW+VRVz*CnW>TljTukmy?l^d(ql~7cI|3fw`fwO-O=0@kJHNm<1H&{vD+ix zjhC3G4t597u*XEc6s6nFj^Vn#N%iqNrI(AF-CEUxt23l(0-wWG-{5L}y1xgl zhP$4uf7+u`m-j;k4f~b*8pI8(gw94gn@OCT#a(5ht=xZpjE242>TV8`z*6awfV}`+ z=#C2-I`W2^*OeWv-CXf(38xc&5f%nzaa%0Y`*O>Kpz4!0hsCD42qPw1Pt z`cl29{~N=Z1N#(`s9EqWUFS|#o-wld#C~k?MC6C_{3`YSR7#A>96Yzx-qKZ&UqYUzUeGb*)i~eV#iwn47AzG{<=|4%_Amipb~mQ$*Po3>dvLa-2|8y?i?) z*zMx$ed^@ghYf{(nBk)~NsB2x&t4DT;d(-a^dgVyHX&&$U*0WpO06FY86FE7YP&p3 z*;(A6HTYtnL#~86Dbvu{%TZHvXujR@dsK{u8vP})1I>I{LRypV?6fwqW|7AnhriRG zjvR11y*qkGb}+M-8Mfrol5m-egnK~i(8{pz-8;qtk6jjMf8wTDigX9n-}E^6@sQ0I zkZv*MJufcmMS1nnMDCW4{3f;USPbvJ@BXUJ_*ML>-8DbE6Q7=o@xRP@zC)7N{PehU zM}s%{tS@)_W4u_d?EEHj0c@6pAFo$+8G~OB9+PN_f+_dnTVJaF_nQw8qTM zY&3rDOm7a3-Vo~0JEUzByf?eM-jh_D#_Boq3#(44$yklC3+kpf5^L)N*}J2dWxnMF z8s5k`GAMx&km(f^&+NS+w7~Bq?sTjEY2|gSK-b>pcRh^Hzqo6Y)ekbuu@>4kmgU#K z^w&&?K5uG3d3>DqW%sj9O&W(IEdx#odwT9$qPKMs*3fcWuK6N-XV{x>O*Nq*eTWyU z_#<1huJ5>Ieol>R~1T)SJU6P?_KhZSvL-I`0(ld(4Hiju2ZGHaX$h&wL>LNOgJ3M z5MWlkAcdPgH^EBRvri>WgM)F1^nO%zY~>-Hme-!HJ(*dm(k;0nAHyC#WhKSN{@m<4 z=l9ITnw^PFhAjQLR+9+F>D&r|nfrTAjY_0`JQr>1x#jTWfdk_q$qGYLZ<(T-P4X^9 zKab7$Qb*&a)_IEK@;jp|DxBZa*9M#Aza>b_w&>U$PFQshxTWpddal&jsI~8d+PbW% zY19`M5*O10>r#y5Me;way$ed1GhHuMhFkc(<3q%U{b)FK6 z6{9WRzv5>T&s#>H;w^mCdHG_3*)>lujpxa`XD6r+HDn2==yUT|2`9`sOzNeMg@&K{ z;`zfU4_lAb#Fu}?HTnCMSA3N;JnwVmOF_u^ zS8F~yeyckzy{Xa20rRoNRIN6w-e;~@7&x0>;} zY?-g|ROvv=m*OKi3`=>KvOA9wJnhNn1cw-C?gUG?8?dg&AH1{2Qjp7g;0@z$&%NC0 z*4KM#1wThb29)p46%X*fYrLs9ws38#%lwvqg4vayrA-18#{_Rs3tX7BHW?bv{%|tr zCc~%dQwHOgha+ciB$ZrsE{?5kpPs0GA+PJ09q8yR{H)dW{(&#$kLtXVoDRq0FAvK- zby(u4Lm_M_MFYjnxsJ*x4(*oPhsrnk8DN_CVkDoH*9M4L^P-~R5pK~0@kT1B0jpO*&;Il8UwGk&VbVCK)1 z&3%gf;rp%X(Q*3t>{r?4g*W5YrVjrID&}-y-j{RdXHI!$`*2sef8!>)pP>h`VyWnD zZtU@*3S$yA)`!>VbTMhYe#qXi&B9z@JgRa!OV^pqGE}ppgpn!MCDluoe7T(Gl~P}y z(iRzyusDiyWG4GhJ+qh1lRd>q?d9edHrD)eT(;$yVfzI;-V@K2X|ZqUMMWwu)OcU? zdGsk9?v!~ddn|W!oYX4s+dPrmoz(5>FHq_IW1590$P~kx-O9-5l~K}RdpoSbYd*v> zzAN8!*XIsl#`yuWmq$$8T3-1LtcLy!tZ#RvxE8RlLriE~_EK%O!F@v}{amJ724r{g zxSqWY!U?d19(FEPkm?~>UVZ!Z8kXw)d5?NhZ5~sUDkWY|W}0DIR{b`$ zc=MrAv&pygm4-&FuB!hChE62x-dc-*t^14$Ydt@|UAFOAt2b22M};Q7s&pu*$TL1o)YoUCey&$@rF(=Go*-`T)<&V|KT_1aAA>KB0SwBz_=aiR9@?c6#-yuk{zY zvBKpKJC&WDllCM<9=uZ!WWQD_TYj9zBah_bnJLRYn=rY=*sw=!mPh$~a+qCwqW25E zN&o0}=KXk=aQ39~D&tn2mA+^Bs!vlb?G-$dbI-9W9Fs8Vdd;Q3LjTlp$vc3%y@|zt z>g4WYG;w<`#fWfqIXrtiBDJHBC9d*1NuUXJ$Z=jBgOjZd>%q(FT@ItlUq1VvrIL*u zs22CW5GL*YvvBUv)4R@o59J^a$vH`;^yPMM~2 z_q8P(-?d9xT-hI-Udh#aaBJgysQ1K1u^E55#c(x*DRTS$=0Y6i^f3c3?{I?;UmCB7 zL`#Pc&E4cqeW5|dcqSwzA@Y9ly698$XpfI`Ps_>Yt&^x)4zBf(=v6)WHrSUM9!&N8 z>1pK~{i)l-I@=x$?RlKf-QCr826|R+Z~xrk_mJn&c+c%zj~&dCT_=5W90LZWb@N4f z>$6NAO()KTd%KZV+E+~vj9Wf^=t|*I(YC*thk?&y6@?%G(sA<_lvY_`@neVehAJOsF!W5Gqw{x8& zdqzf1t*$9A6kY9j^R$WXHIIdzLsSGO$H+*sx`?Tve_ZsF(?SAmCQN*D=O?lhe%ibp z)d(FC8J1cQsZ#f!4Y`pbJFZ$jvh3l%^X<>BxlHx3cPV>5Igut_8?tselBPgmkSBU4 zdw=4CuS!oSu3X!+Jz-~U&;_cCF7)+HoE$fL;@;^C(1gG2<G$qSRpVW8jQv#0B>6f0pl|D2g_GA`wtlZa(V{=sO$@?Y#6TuDga{N@Kdmr8z7eD?%Ov<#VBmR)ByFl0A$<~LBlJl3C z%uhJmHFZS|n8#aPbfllB*`hu-SF5C9rq)jJj9d+eJj9rwk;Yv8?QL>_FC@(_6Npt=TL*Xnr^#hxI**8y& ztvHB&^X~lqjsA;Q2C0ZQuaRT9L21@w#fHmt{#gpCLPgr)Zf-KizcKQz9)2%JF+J#I zKJn$qqhW?0qEr4ssu?Un4s0D?9V$H1+N*BYEscEKrTwJPXf-6+!eM?^NPLy!c5w+O zb)_E~Cn{Y*J7sI@WPEgYv{c01=On?t zFRbbI+>jmnBzv*o^d6?SUw4K2jZPh*?o`>W-yPkjdWNA)i$(FelnR#R!7ciqOr}!2 z-OVo#wC#CV>{{C`K{ob-R964?(`x+#S8vMgIy`zqom)tlg z|02dR>qVVe`kNW0D?6IPcbIOK?pwOF<>=wo8ziA$BCD9E-AF2rVBaqYE;XyX{A6}3 zjISz}O5y3H&k+Uc4Fyr(t~9;7$u?YcnXJMdJI6(8mdkj=gM#*X1F!PcS54va<1VAP zc0-JqfcOS~+(uOxn$Qc$QO6=CJ>(lgZh2oW~6B7?XDIFuHi`R?OLgR+R@j zGSdmqqL{OI%{_e1X;N^XXUvOP-E$J4=OGT( zvJA}ATfEZWW$4}vbM*1e7F*-@2-f8(+*A3=;Q(LABhRiULbS&Ne6Op~ zE&j0Q96xh?W=^JG+&M9ObmZXqdzqQi>{Z|PZ=0RbX(SPLxgMDrbTj>a*Y0cP;k4@g zPZI*o)tr>g`^-w?I&ZX@8ytDHPi^3qVEv;#=OZj}?dB1rr*pm>%u=fvsU6;0ggdg3 zpcUpAVmW?8jaKmPgjcB+rn|`S`Jo>FljQ;zIbOV?*|Q1rc_cxiU)s4+d{M{qaY5?l zb+`RuyI=cPA6Spt!~J4J4*T$WzOHEY6>*cWs&5za-^nwpK3Tlon<*cR#ge*}&K=h6 zdwslz@vWGZl3&OVFU^y#lgY7xx5~!**4PyHzWq5z8?c<;Q)T=_&#ETVkGYBT8Y@ll zCD-hXt(052EgxHE%)$#h;(VJvaf&6W$Q@p$i(`NU)A`TG8ALQm&(HfxA8&T;6Z-az zPe^|GKu^Qn$jp$B(n9nAk`Y(8%P)y@f%n(;w`20j zHeO^}sZPof+&In`!C7YeN4_&vTnjF5lghTqHxjdwiY%Wwb6>WXue4AeBc&6-)uB*{ z_3F&7e^YM$QSG`(fb?sJ(8~hJlB_+ibeGPvR;hd3SZDBE4ZsaN$}L zYjtU{VL6qGf7b&^EGTLGn+)UWo6jQKA%aZR=ueO|c5IJ=wD@!aLc z*On666%S%hK3={0a#9g{fs>)ft^ea%jYfFcnjf>D>Rmwt7ovy6k6D+PcVvW2_#+s+uj^gxX@RyWPE6GcVTkBzAkM21ZskuKsrU z=X*z&7i_O3R+W9?`tA8=$;jiKoP@unOWBo?UDAw!1QgO$RCX^Dti!%hNeqRrg6n7<+SO z-OOb1^&wrZyXS{!tUfBWkcL=j=-um@?%Iv}VDom<$)AVLYJ4KmGQ4B*&EkjUVJVZ+ zQ|B2DOX=(yPnVD4Kc2gZy-;uBbiK9JW6eIP;3zi@71}2~94<_8T2IIemMi_dP9EM_ zdpWP+=Ck9$$3q3K_}y(}d7C!>D8F-edYW76n$tUzZ?iK2S2SqM?BjWi`_C>}nm;4G zOs_xn_DS>gfji#L#lvFa!rt-PBmKK>_6+AJ-Y`03sl(E5npic={W)*8FV#sfxZJ7s z{YxF$0qRBiBKP__-RviwqSxw4G;;Q&^y(3k&I^`CdxEPP$)F-1331P9drkmT- zGWpVqc^qa9G?X@t?4HpauVd|(p*)o+aHj*aRl_Qt@$G)<)7qQqUAVBLud=icO5M)C zac#uQogDj@4Q|Pt|OGJx!Z(nWM67f@G>qxjBHVUS9OL%aDGZqFnrly3pLg z@|Eo_L1A`+8sEMbJY*x&4=Z_Q?*C)9x7h8KZ{nqoKeXhzE}nbfCh5IwG4u4{9sS~k z$9ELW9p1hCl9aE_%bt3JvnXtQ!twHc4Y5GEkD5oc1=zkcG#4fAE>&1Z(i9wY9ewuD4%k#RcAwzR>DxyR{n${-zDx`{;O_Yt?P0>lGmQ&{B`13OykroQ{yYwy1wsIb#Zze?ZC=;koWopzKIupk763;lCAKMwo(Wm z`{pO~Zs_8zNPOq_Qw}z@%Hf;`b7}8>dbNee?e@e8%(a_a4`;0=&R-JWJxS*3zVKY) z9hua~LB}EI*Bm*_=gt)wnC++WTlc;i(4Trsmi^29$@8m5(fZ^cgD0pHL@gGX-#p3J z;mj8uxo>0Zz;gdxi_~lf_KSFg)iX}nJ;zRS7F-{sX%-Tk7YI03c*>35j~DLbohZGRMmJQ(V1^Zt{6PKEiT{|cr* zRG>^&yfd1aO1iX^coB6zS9RJGMd7c5%KPp{%fdP*k5s@lFi;rp5(-3`JbvS`n|JZ( z*gcX#zD!-&!6}VQeEV8a#t1aDJ zK{d+@F1o5e@0T%25$vT&K%w=lRe}<<@mv(LG3-#rRL7RsP}1gonIx2N1D5+0k+N#4 z#15L{S&7>7kaOqV(mJv~$_o8vsjj&T1Y%~Btcr2F4cwiQNwNR{s+HsW*dw^Kk`VnX zs|oD}apr*oy~Y9%lUZZw<-=yX6Ckt|Za}m-jHL{(V z5QFLo3D$^Wy;ifo@~LS2`J~8GejX)5pmn7^C!vhLzJ7<2$c7`;3gmM5YYw4M5OV8y z`wN|l-fay8;AM`Vnd?g=KH+G722&36^Mzw>tb{=k3`bCHmLc%(A|_nCN&!C|=M6V{ z&t@55;jCUS|0-G3)xh7CWg<++7|JDmS3{_|CvLc*b|pr)cX0|rO8x}l3JOg@kulOr zm6-Wqg-Og?D!|6$^gO@hNvJ#qpWx@DVT8v-BvvF|-#q#%w{!-Z3w88cOFz*t$c5Sq z>+c-U!UOj~Icf$vt+BO=RmPv`A`}W+Piu~Qilr>3vlRbb@8g|S%z5>V7SiP$yOd-3 zS_@y~h*+k?jg5TdwLk_HX0h(%#3j7Rx^?z1FXQy{%zffSf*r5%fxe>IP#~>6w%QIK zIxqTlv5>F4Vd0Ify1CDl4DD}n)nCG4YNEtx&_yUjkZ9my3MyKLVARcPuV1*ZjDpL9 zDUCUKenk~#B$C26ZD#U8s~g@lMUGgrq2uw*W#6V9TnGoX8MqsW3i4m)CVVp8=29~=Xgpp(); zykH?nK1pz?7g!bB&OGFOhBJ0`uec4g8I$UY_)Kuke3V6W-+unW_SQci3zAKhLO7cu z2_x%N040Ers97TqdT&DLlAU&~l@%o#+QVX)xl<%?6+l(L0ej1lI&#QCky$Q%RKmqrtZGj%ID6CWiEICn^EA@e+7wE1} z<8)m&6lC?Xv#HNdtwd9&pItATv!SvzD-y0IM*|c#M@5W+-S?PCI6I5Rrb!qYJU8P zm*Pr8`^}GkO>x>4l9D7H5EEVhc7){t7nn0cNpmsLoM_)6!5b!KQnVNddbG%RR4oRM z$rya446fjr`^$fD=QnCw zRGA=dBY?;OK*H*bLKsI{5s|-y1QWsu+TtYrrg)BxKroEma!{ukI@b0(J>xJY$yly9|xM4iz}29RVr5Pssl^ zKyOU}T;;gQD9(S|@koVxis!$m5m)2q@ZXE=*MH&BAMoh&FSl{;w^*;YpwHpaMn8tz z-)@+H4X^$itoGmU4aF}3@inWl=#v13bdm2i=2h(BtYcx;6@0T_Vw8AH9j5<(?2??7 z!EX1@F_c|!)&UBamN#2yDNMuEYiT#301Y<`}psTy% z$^w+F8*8vd>>RUA@w5Q&dC@u;GAH5aDS~xEKK+)W!JZvO>VZi(vaixNdU1U40*2jT z^f@Y{x(E7Ew{M!=Wv!g>+PfIxQoX4x%rD8Q(spQF-(fO-3Jq|*f)lCXaq)94gSloz zxXCDkx}E`0RqHd|r*Td$v0W2UU79N>R8)?79SP`vc!#w-+G$*EQzkj%;OnS-!^_?> zj#$%}B1;APp8c_!u{YUNHZR!)e;LVnM7I?~ z(a0t&_5k$d>9%JGl!3nbXB-;;9SotZ`N>FZ@p8E!_)0NrQ-1v@yC^Q5Fu<#&N1Pj~ z0{oe}E{#*nyKHIi7L3=xcXS~L@XMwq>fp4L%J9wtzpm%l!MYos_SvBTK*fb);IAkt zllS04N*$iJ+WRs-7WF$-Tx(6p`OUbPKyKtccEL^vtSU$FLxYaN^rbqcvh~FR^}qy& z9!Cw3m&qb;)4yH+I~%*V1moc?45k&9-0N@nNeXtwTVBbx_CZx;I{6c&rLaE>f14-~ zPpyJ+s}SBRINzF>BSF~)>r4YdMco8LmMf}3$=aZXNcsO>(7n@<+ko5^dOk~IYQhO4 zS`Qo(2D^F6O+#gUyWq0jNFWHSh4j@Ib9Mq?a5Q)eM2y5J=wA8nI}8@YErstHP(o=l zK2>_>)0l-nvMDl&>76o3-e(-QP-i*5VvvP%VKF`m{)pDWQ~{#7|7?9qww~zd^ZZrr z)1{BbTTphCb<49Re}k?kpb5SUh5Wh<6A2yiA_8j>79~%<43NU_t`SUwGv@s zb=RdNV#cm9pu#aD@4Rz@uMXtTPWJy2^``XQmB`}uVgD3!_B0br9HYOO#)*Z$u!zH# zSR>t!hN-d!_EG)>KwSAJ^6UI63Q|w=TKtq}yv~v*+u$;Ui7Qo5Kf73oH&v`ZNAFB| za<8g6@v|lMgmLyOy`ShaYn>v4apQA*`n5A6$A9TXn$XpSapR^@ix2$m696inJR%Ta zo+@9iERMiE6-a*Zn^7X(Znd>!iJR4uf0E&TT}z0H@*HVJB@<{8{c|mG5Q%a`fEfXG zjMM3PYFO|8#-OIXzszl{*TkFKZ*>tx-BV~p-2gbLBCWmqE0qzqTM zVEa{A5F)p67#w*ae`$zg z+5%?X9dPc;I&j(z>2WUXM528pN0Mz%4_?bSvna0ON!eLVCZn#vw`+|@;7wyjgaM;6 z6tUH@otlOAS4Q9a2X`-J;&HkBNUT-}^=uH-uA_qmU68os=7G=~Kn(+R0y=e)+AxXM z?_9SRIZ$tGFTMQr1%{&sQ`Iq{B;(ZLlpsj|0fDj#W8lo@`AE)G%aAr4N>0JBJaSa- z{-G+`rs=~tJF?2>I5Lh$w?gAKjg?+jJ7ZneBiH$Q%i!s&ONSn_KG=5t9TztoF@$CD z8UEzT{;G~pk*wdC`58;pYUCUv1Mf&K!D+TUTQ>xyGJ4BAWOn6ossShV?fBc@a;+a5 zSO}Nx;&IBA`1}=Cpj!z`ubUrg`LY0_XRD7sjrOqyWDn&%%CI?oXHcaqYX`rvdT)r4 zYL{hbHNb?qxRSprBX|LITHey+vhIPvROkUE4Prv^%`Mt3vDu4mrd9R4?&&@JOuRc) z@p}CBeKktUL`3mJMYRx|KdtnOcS`*!p}75a%8@_MPsSVM#jgw%tpF9H^&F{~F=%PO zM>y2itDCe)z;jEsr*vyo1&n01le}*n-Mt0fcVm&Kn&h{Z*dOX#I@9fg>e$M;^*ZA; zR<%gyZgDbW^x5avx!e!OZ-2g1yI|Qa$Kg93yDi#YY@1e%+NvibJR2QV*g+xxf6;3# zZ^lIvD&Id~E;Lag2n}{6R3Bb%PXkh~(Iy*sP8X{Cf_mVeD*M@>zA5>n&N|U{zmJvx zidK8QgiDIyUup6*8aMZj|5csyzQ9PuGU}HDDgq?LDmXci1WdSaB3Mac`h=jt@<%Hy zM2N7|R6E)fv-lDA|0T<<=r<2pQb{~MB(8{T;k*U;jK`I2Dp<%rS1>+KKpw)KSH?Zb zxKo>iAKjGuVMd2-umpPqT{70K;;)ZMCML;y>($MqhXe8K%sKhS-=_!2!EIEaUQPgy z33)H9UHtS;b(#5~1EFLncl7mRkbJkJA&#Wl5@!ob%R8rq!^HzYrfgX&vJKM5Y2iLA z#0Vd{XCbppb!od$xzgZ5I2Z-N)kL01HC2wqRTBYR)zVNDE(w}l+v$|5QQcqq^9IJb zD7`Pbz_~NJ<*jdtg123uwEsYA1$X8O&vlck7w$}DD8Q+Z)XNAo_Ea4D2-Dol6aR*e z65-|5i82*RW=L9p4|7m&_MkFJEH#-bDipH%)2n*)kqm*oH10vz(R~4AD7x2n(uWG; zCdn*IhaV6q9psWo!>@c>sBK`n#yytqRa2)7!J@y<6reH^)eNYzy!6N&^Bx+Y^B8wd zU@K73#ue~&d3&&+bb(bOubv2i8%`+9Xt+$CC$5GT8K_Wb>FeYH8o;s|^XtO2w@Ail z%HlpKyH=VKqy^a4d16?ClI_@km-Lq?&lrgh3p$;Zr)p!W)Li$xtnCi-yqyIhyVie! zFRAxCR(5!q#g@SWo~O1=LnLPVSal-$xrjbd53#j`|2w#7NA{HM(TT@NWbO2#;Z6;h zM4zv70N}ZXlA|EF@Ui~kOK8b@JavD){!Jb~bsjAsLTY7f7fx3@tN$REyNRxs4Jt7> zWPqLZRp9>D$h5-gjhle%mI7(Jf@7J5*+t^CFwwf-d8JJT@WhiqDu17n`}Jv5^MS`S{k8dmQ=6Iv z*_3KGCYE}6lP(=3dT<5Y9kjXdWde`)EU@;~H&CnBl~-ZSjIK98o9s8Jpji0ON;o3is!E8UJdTr1{*y zuYLjtbE$}dGHk00x9S@?OPRFgbXW{;yBIEXaRA=kr)!~#!^OEpE#G@(6oM@+>)(RB zZbVJ5!X`XT?L`GRh2n!F-)~94|9N!s^uP1wl5jv=S8wd`M$Y!%WS*a)+P_- z{Hmf|feI6#%D2c=)AB{;+7AF%7G@5;D`sbppFvztug`qon!+r+Ax?76r85FpJt+qK zeQet$ar9snnTcDo#pzwVENApJfFJq(QW@h3)2nd_c!)#$c*Em3t_KX3IHHQJ9OOs( zusscq^mE^hus~`-InKQys{t%gJdGRL*=HI>0ci%iQV$hsrN4>6b?N^N3F59sX8%xy83ebj24X)RxY zLn3v9J=!P|G&NbD8V8wp^V}x*$R_(HPeS5Z+3{9aN;W$DteRi?Ifv=#{6vNt2aLUg zeP`w{RQ!%{Pa7Wrj(aI!CA@Kn+(w6Xi;qlJt_gZo!>#ic<5&mN|7#B^N${eXXtT=Z z+-KAQ*_qm&d1v)Uc@ii@?Fg+^vIEy~8tz!AjSBe^ty{p!MQibCz0LqZV)6GTlAkd6 zD~n|Z9xnVlc_?7`waqHGa?}2q2QtZaO}V;NQ;Gxfvev_Rqi5AwBW=*wJ@Gejn-qti zSWMjr+b>=ngL=5UW2@DxM>n@se)3D7wKo_FzD^!%Q~fpTegT=Mfn7ACW_cq#eGm^`=Qgq4MU^7dC|6M3m?8-vRW4+ZdV{8II+}VYchUwf1t>S0JcAa)LlPj%jnIR2iGPFR39{teP1P`GBZ!$K>K~K zf^xrMAH|dk78H@cGe-5b7uW8+FlfmfF?}1d(zS>xL&G6CK|U$;nUU_o%1SRKifTB4 z)60V)CPE0KLVSAfW%4n@e+g6P<1KU@;GT|R!Re91lvswN7YvlYHBl4 z7Y&DZhcs$3J6Q~8{1KS53xmnmn|8gt0rMyf57DO5H-FRDO2kX=sPhpD%_>C(c^ zuEB}F8@Rj;>H1#L=4&qVjRjV8k`!)$3@cp!V{%*T0X`4i*hJqMw#!C)#sENEn`$N? z);KPCyXkout$=wv!z$co;%WSh~*TZJhz!MiCPcrb@>Q5_!>Ji zjc%Tm1rn@|P3{@#+Z}}S0|D0NkLE#ui*5jJ=5!JpF#A6i%5fG}A-eoT-0mao9`(D7 z%Zi@v+k0h}v~5~4Fz#e)6lMeJ1V3*Q^G`G8Wy&=u<(CgFtQsH5{K=GVoX+dKlV75h zXv{!VA{BOzw5NXj`H-&R{r_||&**i85ya6AR?b5qOY#@$pULm3I?bzdyK`$scG0-Ac zfG}m(O-`xsk9ACU417rR8?bSc1bDoxfc%#YcO74@p#jZea;(|csrm>hk@BGF+>N39zW3dY8O0>t zSrz%=4qrootu22s_t}BBeSTCPEBx3>uW3tAi+}f3n_VSa+>9O?0ZB0kJi}F+{sW(@ zR@}yVqm27Uq|P2%rgsK_;nnnX3|DY1T}Iz0|8?L8_$B`fBhHJy|6BaIQ%lfcf$1e( zd;CumYK~D(Am@giQy_k=f9Wk9)CD)?n1cI&)k3cGvC=UFb8IU1wtrRV`#FMShe=aI zXktA}qMGDq%0)3PRH5+rt87cN@D2$^U64(JZSTF{V$dPbO~$l`4aw08&?9)fA{y-g zxn7E7+(?ZoZ=O^0b4fc?cw$lK)@}M|>*OtP!LrQVog93um_1-YMjzpNt*eWkF0Hdb z;ZIi=C{!&cX;2Zuwxw`{W~yCUQ#Y`_;|uCvMnJ!ID1Iz7m^YL(#&Y7YatT~}t(bTj z6&hUf=F?7ZB~5!Hx|fq$MS2nmM&8Yk z{8Brj;7-m|>Oc#&(%DC(!D>H&B867Qt!zq{cV&{-1R|n>>_0qy!tw+BE&JuMIjhHG z3+NLiDI}r%96ZA_^lce1@7z=k>550j z*v8TTn33^ZYi$klt10-FSvjB4c(Fj=>p%eVAM7ZZYDMtf?` zrPCspg;X`X;&%y|YVim`d1duMu@E!O`@j84%C5f($rwjFn%O<5IoN2}u7ixn87D(G z0GDzl$L7oG^j!OrC1LN^a`ptF;)SwK*xGJ@hg-}e_h-?>DBlGe?wt&UIQ;EW78HUSYf(nwkF>If|&XZ=r9naq7<;? zC!p*PcR)A6%EIhA#Mz#3YxM(S4y7*^8c6-;@vtpBXlefdSL7Ob`fxO+(Y>#T#!6@Gno}+Hb z+UxH2Mp~If$TR+w9}bfT?`NsVFyCOhb_pbODckLoZNu0d5miei&{e}}Ung#IBJ*pt zL-%4Mf5$38sP{7&VB#dwpA>^o*N`J2x80tuH_iHv#y#<46g%u-S`!;JXxSaEv$xatR2JNtt@Y=R3A&)Hj)dC4>X3ddV~cnzq!HE~~v zfGCG^!4ifrWTsZ(IN)q3qxx;&k`FIiKcS3y+-)Ssxac79AF2@U7~kxZCRDg8QQ5V{Yzph)1B@n~+^Yx10Y`1J_+r|5b|bd-v=;k5LZQ ztCrWJxOGA9ACeQ$VeY0|$OB0S`)O#5nQ72_Ea@401VweWXnI@3vmAI9YZ8}$Hh#i*LvRT(Ft!@I(pHfYO{U}i25N+|e zNkIFDYorhj%S^*1BP__7a-;as=i#^TE}YL5we(-}hyv`Ib9KOx;_c1EKg^5u4bXAb zciXn_AZbpu{6pKeC*vO#Ok8hM8>6Q%Ps!bcXcl1@1f1@?U{n$u9c)Ag^U2VgIk&Ep zH5FCyL&4khJ`Y0Y_Zjc;rRT-!7d;Qg`H2iA@hyNMJLY@9&>~iJYdlGnr0h5=oIV6# z;9lnD)h0t89j-NM%tCM~Mn!hO1Jj-9v%_nQmoMBg!Z`9)3P=PWGy{-qHI<6hPDAAH zMhAm#D@gIY^)@ZOA3{yoA`Y>kylAxhp|O2}b|z#@vchf`X2+?k~EwOVcJv7bev42qzA{MXf^qH~>LxJ_niGV@j&PIOPJ73z_i zhH+{Vwq^Wo@ed(|*`{||XCae)=*T!Z*jYoBcg7{AB5E}p@b@g9<%X6q`JyvCk4A> z6V3Sx>~XUSO!MWY&Cik4V&Yga7J$bPLMIw^J3PnR6VSwpGh(0=5dq@o_LHZ&2`_tX z$Rm$AK4?SH%(dhA+#y%Q1ZjW5B<8d)DeraV2F9bISUm)p{~|5y9Ke7bl0X_p%3$m> zXijEujU;;@Bd@-4553~mdycLONa7h=E+l7Eh*MK`)FO2F>209z@T@S@2yO~`mBa>@ z$}xFORA~;yFb6Lim$BH1L$?@e3Z#evJnyEPcl@tHvO{Ns1LH(K!t6QWcGrZ%iWYA`HF)6_M~5Tzk} zIhrmR@v+QmdtK2uNW%W$xw0hsqki2Jln9!Ox}ZkclBXQxWlE#?84b1^*mB;;%^6 zG5ZDnHrno)4>J8U=gkI^$iyov>F^j|!DVe*Yx`8<#*N9EA4()BHcF(Byg~SO)J`lCODJy7z(=Cw-8gU&E$Ru{EExkfzF{EzQ0@g|QeC z6hsOF%-Yufh8-bnb6$)#N>PMG=KEuOVTQBQBJsTTC7@2<;aHm9QYZV|%6SvOzF(EW zs0XMd6z3?0PQe&oL+gCmUxyK`a4g`mqVy1;!`@537SRqsjkrANGgIQbhn-m<%!|v& zNmIW=xQ;oCgVD8!jVV1$V{Z^TQ#OvF%?HmN1}REK-)Pe05oOUDX zI6gGc7pWem^z++%o3aSs8{MSWC=R$2Unkk0MBr9OuJ&Bz-QR%dZveB6afo}82vZpA z;(4|;LWxlr@#6T(<{w$j!XOxU8xw0D+LfxUK+ww4P1!}r%tfEwOtBfEk4cXQyHHq z1iRP%qj~C>5Q%rFeg9m>1ZrB6K}`>MPRH^32MUqowOOQJu9DJ77v39Cdju+ z>Kf>0w<{lJ1i%Q$J*VZzEB`05Q-RI6(Q7k#E*$>FQeZ%FL|DO%j&Y4ZS^?pH*ab-Y zm>2hK{r(PUm)L*os+QH5sB&5g>uD`UbOfmLzv-la?|2?Qxi`*}8b8~Xio~);fP}yo zoO;o2YBAVUvitpg@`H#7`>6MYt(u^dOG*#fPdXA+04NO z>Q+=!c>UxwPVZB)>-rBi4zX%s z2DNsLVd$*yPE3oxX2&mKLCqDJOILrmz=V8Y*5$E5KWJ(lni6pG zw(o+Uib#b>3LsS@hHaNM;%~5u`am)L_+Q{Mc{nje<5Z9iQT&pWuruq;8mBc3eve*! z%S&+CxNncUD=i*sDJ>E0Sck8REOqqT8Mj0p&#U}%~Zc1Cn8ob zQV!tF5Sao0eRaJto>(N&Ghz;vrW6*45k*3CsY{Wvu$aUyLxhtALCySX!g1pJVE1M> zd4z!dBR2rPb5uIA5lA42W0!F2L^+*_;Px4POcqPk@C7^2l}HkWQ*mjy;55QJMAIg8 z-0e&Lss+toS0sPrBxB$n0{gFk^QTlh(uh&~uj=VGffSariqkU%-c=BP7OeSA9Ge08 z-OH$Rd6F2&bRk6F#B-}Hes%m{yttEf`M!1&a|}|ShDcT_z5^!hcufgWL;X(aFfSF& z!gAET5X!;&dgGdRhvF}vt#@DU{L}* zo(yFQs{$+h0_rQbvNdP7I2gHyt`F5wiN&O}vU@q+E^f3NK!33Xyku={3*IilkIN#=SQ3O8U=-MdlCxTXHp*O-Zt$ubt77X?uX0KOx?J@t>&qaY_>s zq_~0sytm4$23N=M#5Io|EVRC_jQ}z7BJG)80hBofEo$ZC7)5hoIY8RDS2XJx#zIqU zUZ%ZPUsg}Zg!-^rnVEa%(lgcj-ulYLpY??%T0__UK)EKwSEl z=owh4N%73#euDDZ8=A-bwQW%;$+<;obI0miP|)!f^ZT~aT$-d{GWOOs^`rgR;`r}J z0RKJy4T*Aoi~%hgkTChBfHH3kZ-p^%`-QjvABChbm{%9b;-Geb@E)?57MT>lV%9i? z++7=Hj(UIp5s!uNdkb%)m{V!+d9Zsa!m%j^;>R^(Gh$1H2x$$-C44&Y5*Fnlvgly{ zE=0O*)FHG@AVhElqaFgUr!G{H2S6<)GunBvWUDl3@iJ$a)K{K%U(P+~`c=)T_a zNQ8(X+@{kk7ujq*an_*zy?Llb%jCr~k8p#jbE{IIuL1{6@Q>e|Y#o?1CIc9^Z5=2% z;d%05Qj7?8_6)dAyp^Ue8$wPqa(ej_Y7lb`aSCLhN zLFA;NFq#mu?*$<2A1W#bkVy+_+@TV5%HaZmib272r*%X@0z zg2NGQsgwwR4`QerbE`o59P%+G8Mmo6M@?_@k#9R)Q7BF5O)|zlWxM+&USdW|YH?4Y zLn`!wt=$gnuT6u-EbA32!~y?fu@>p79LW#Y+xcwpv6Zq+Ob9Z_JCo_*v_t|(IJILsho_moZh(% z?(w?uR9O*sd>kLAa!s6UeoKyX23n3mIMfX7IDA~5*V9#0Klg;Qa&K<5@5hS^*)D*> zIr(jyLO3vN^7uA_$bkP%zC?nUYeB`yEmZkfn|`sPxj7E$*RPerwdvofGa!nMbh7p- z$f<|H3ZuWraYC4ZT`*I?vPr&NZ@_KJ2#5~xpj%JY_G?inB>U#`x=|g}4B1dRh-WXy z7C+v=Wz*t*lZXlW|94ar`!Xm|TRtSVz|pt=h8R1^lJTO&@+GVe;@aGXx@=pB^rRbA z5B8-nahgHUCY==Ge!4c$k}0sijDJAP8iFQ-#=REZxSK6vA7(w^$wqpNRs|Sd>CdS? z;~Fv{!Zm*Q=u-VlcZN=i|9-iyHEcXp$EjVO4xdOL9MT!rdOt@yNOG+5j{daQD+{d^ zz;58ceaOJ-k7oC$qd!v@T(+DxbBCScPkBq;3pc4rcJ&uXDGHm-Ts3g=4K|})iL1#V zd9@p*>_~IsSRBi{|8a`+gE^%5+$qTgWWbaE7{|$TWJeebSjM2OHsNReB0oTfT0je> z7YRkn9gf6qq>0MM2_S)`ej~9>>kaEkn{|P$%GRF>12&mR&cSZ&P@9IHf;4V*W869>_SEGY2(UH7BKzqZx&V6(*$Z z4kJQ8J%t|B{~=`c%s7h<@PJG;>&SVMJ|1J7h}^6+eHWNJRkk#DUQ6Ni@1sEsX)-}F zm7pnV;Njy~Vil08Hg3tL0;Sr1xHbp)ZDZUSb(?)wR)9O4sC9#|MrmY+_cyrk5Jl?T#a&*Kl9SZR5f>6^w2`cr)akmT^u|M@-?_Vis!Q?4diy;X%yJlff zmHQl;kf;s@9cA=`GJu;TzTx?1=xe~*1AaH?{?uj-{@sxEDYmFoHk(A@3h{CP$r5g4$ zYP=m$+f?sFstcj!k@e2F>i7JQioyj$xL*AuMIR_A>df2Kh8h`QH}MnN`9W`KjT%?F z)+DF`d2>Z}&gXmJ!2*4I44K?9t2hwV-NbQ?fO82P^g{A&3L6(QY|-^!4bA4+if*GU zKLSrxJ2yzKj&zAbvv_N7kkoglidM8-e>ulVW{Eczu2rAfuT7q?CngLs&BxiP7}d`; z^G(1yem0-VO1eLj79Pg=RX*>#4vL-m3FFh zg5kruUnAGquUvMiDgAF~f}{w3zrrIarYl|}y3h4YSLxrOa0giPK5yOph1|77Q{%t&=N=qNVX{{2T) zZ6{c67d@m0^J%c-fqJZSMPKR zHuaE3auxELZ@kz+#v@In31W~hMDt5YUM~(-%vm;%MpTY;th+jeOpJ`@S2iKiz^C7}Og>=>`H^xP!f&9@)uA|#(pjdH;%QkhtcJPRFCEf!u6J_u9o zjXtZQyMa@4QH4Wh=e%s)rY{v%-e+Bt0H={%bNh`*16w92^r4Il%t?;hYK*BXD3~UC zf#CB4RweS@*Wz{MhE_+oBv~UTf$ZMzNkA1bERrB>k?^PUVt{!SuPEI-Bo!9*94b*c z^k6JJo_#1hOHs&%8BJl>98(bXGI#No+Wc*`z$??om0SKbx6X(wLMEDz<25%Ycy5R- z+FUB8r8`=ULX{-)of7e~+l0O9yGjs1_q+xn5&i(xOjk|63kaPZeNDiSB|Jt( zj*+-lb+_R{6u&UMQ@yetf=+lzbDJ@%I4}4Z=V{tvW6S0mAWby$Xd)lU6>Ui{(vhgd zsxq2G!|3B_j@4jG((O5IWm9k`@T;bNnuwgDC9o@dS`O^=?+71e(0lCny1ea|Su8g^ zd1zAihRE&n`k1dEPIE*rTMpCngwvln2-o(2xLA>z!lM-4x5kpXQ{FMiAZ3vdbF{oU z_dMxd9Dz|FZeeLJn=!t{YWsx}fwa4~oZJ4}YSNSdmtUC~gimleqZfVE!NKrqE-ZX= z1rqOf81&D<-~Ukt#&&|zK(Z)gHNSuKkScRz#4^OId+1j@ef@7UK|=)5N@;rjUzRGD z_}kycZzu?mfWk9#9wK-WwG2p%x@yGBSBJ1xUDPAlS@Js1n_{SE7q_qqQSv~&Z z&;MfgDC#E{s}cSg0qzc&rt}-H*gLm(ncRn;ewV2IfQtju zS82(%r+7ak@)d+o6F%*uz$x*ihVmg#9Ym?iOv^A9gRpn|%2HK(yLr3so1b9VQVwbR z@FmC&rZ-5~5&tN}CP5$~P`Ldew(1KnC`C*Qj8>u@F!uBMRs2c_{})`5Ow&ZVvK0*O zRPqu48QLqsYf@7k*c&mN5OBU|ET$saJ@sn*MK|EB)M`xQ_MU#zuiAzCP;vWFziKb- zLj9-MKT#*@Aii{;sF3ll>UOcnyWw1tDj3Ket1ya&Bjp6S=1|j6&p&@IFB#!3X;VoA zhI3(-yv2Nv);#0abRlUYv)4QA1cLF@Ez;XfsHbGTye%l5$=%xbYRgn{AP{jOG?z*t zCi=NjcxZ((B@h!A3;Qy0MD_9x;zB0$u*SgehV(H{8ByjW;dH3>Z2)_=IQi4A^XL_& zB0`H*$5ZTxwGi-x6=zZIQ#BH-*y%B3%TY_v(YRcpuYj|F$v__!;z5t2G0z!WN@Eu# zJr=~m{~%L>6{mahVSrJDZ%NSh;N78}uHe_>y{|PB6C%5SHQT&fx`yi~rG^?46JNQm zFx1rUB}${#pXE3DBd$?gR}KB4R7tNh$-Jx)-zYalW6t4En*;D^g(+3C`{uq2eJP3zWKe~G{)r! z@iYLa*Lva->>j`d8_l}kfHY*2xd03!TvLdZXDJD>5x$_|$$isrs3t zaotCkK|ZXkmMid;fArveL^*9q3mj$ZIV#vtku^ju`ns^NV&tE%*PiDYaRugMPK04wg39rM>?Qm!c1G}zS~6C1J)sgWpvk_CD$qp~zo5_zM*<|d z4iPoYher_|qB-%rimEyXUspvX%gFJpX7#)8D~n}Hx(>6yG2rd1|0k;zr_=x0X=83y L0000CLjGoE&y@FX diff --git a/samples/Javascript/WatermelonWithMe/proj.mac/Icon.icns.REMOVED.git-id b/samples/Javascript/WatermelonWithMe/proj.mac/Icon.icns.REMOVED.git-id new file mode 100644 index 0000000000..9874ec6979 --- /dev/null +++ b/samples/Javascript/WatermelonWithMe/proj.mac/Icon.icns.REMOVED.git-id @@ -0,0 +1 @@ +3d09e8fb4f4ca1c1ae7ab0a6948db592c7c3d9a0 \ No newline at end of file diff --git a/samples/Lua/HelloLua/proj.mac/Icon.icns b/samples/Lua/HelloLua/proj.mac/Icon.icns deleted file mode 100644 index 285dee82b3d3f80acf3c0037b6b6ce35df0e9e5c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 77152 zcmeFZXIxat_Ab0T(TVPcCg&WwF((wvIgtbb0l@$Yf+$9U!rtBFj7Ss^6+xmXS&|aF z0l}Pe9`lUjIL3ZgHO@J6=AQq(U*1pmcR^-g*WPQbTD7Y7s%Jgb0ULvNVx+O_0(MTG zgkcnJ)SEEf@#a<*=Hn~`LW^;F@yiUYEQJKZ+=Qc z@;C=Ct#KBLYV?`;X4u#qA!fFSC$v=LaWrsMs`_?qirQk9g*k`KC#_sfo*6ckVr!*o zZp=~SaF|Yk>zo}H3pfV)h8!M;qew9xD=_6Vb+mO2tr;9eHk(9MpeQIQtLrF7eY@Q^ z*gw=Gx!N@-kqq=bywpD+8SEYKE4bA)B$W>Ib@aj2;qLifao4*CCDMUYOsqAiFMWCN%jT>Ly@S&1;^L0ra@nm@kJ?xIfsBN-+{E3|Q}16qt4&(a zE0u=FhN~T`t-ly|wK93@k*hsXK@kDts@odtvO3};Lz1ubcyISyU*j_;xh`qk@~sDM zbg%O9Se|Ku2@aZLMy?xr`t9vJCPy+o-5q`0S<5H1x7jaSJ$1Rm1aE(jaZ@J8*VowD ztypEb%*Vxf!R$$%1v#ZF?d?{s)HfMtF~)R}I3_)J%QCy=v#d4wn(CHzUVFtcI^W+s zc>Lh$-G}dPJ$?A-@q>5p--l1`J>FjX@zzuPQPjhm_a8pK|NQO}&%9snJbC!&(eUNF z_n+Mg2!9oF@b}wrbGP)um8V-Sd<74j_~qV{N6qIt?-FIQo2MSOuiW+ft*15h%@yJO zr{BMLTAR4!-lIoHYV!1t*VbQ>d!X^%ovh=DV{6(PkOQK&7rwodc!=<=@t&1bpEzcD z;IR+uZWGBd&gsYlW|-mXZTB8TMkFtaV6F9X+~C1lHvQJM$j~^irH&K90~4l9K7M5& zGBP}7?&9^US1+7BVb{5)zOcy1h<%fc$Cz1}t*tC?IFlK^KXikem9CM|%)rRQ<&`_9 zZwUU_irEm-6;R4qAKEDgNKR6pUcO zi4|y=nwmk2Kp?cVG9zc~KJ@A0HnK5DiV>(8n?Rd6TAqa1soPDmPp_InFv~cBhLMrH z$h-G^55C@ge>10SJ;t^W3v_jK zboC6hEjZJkJdZyA{Qi?0Pai%k%1v5i2y2-T7wBqf>*(mSjIsFN$|j$^bLGbM>sRlV zXNba<(6lpH0s{`0$K!JpBeUEw1&oTh7umyqY1ndmjG`(q7YJ~UE{~&%xgK=G z$P9gKcHSJ!kdBd-EHzayLlFS&TtyX%8L@+hX^g{GrL4rp^D&;|YIVN35!@l-Xe;u_ zt8hCIYJ_jurvX;Xa5JWvz>CS$47DoJ)OMeivR)A}M`9GJO8r(10XX${3KmkiERxI|!GV1AP~cRX;c@9hAgK6(j?_53WiF z#8S3ou;)q=lkLQ=2nP4T*{LSbziMC$2QA$sT{e|Jp?*5Pc<~Ro$ZmpJM-d6X7b*Gk5@7| zrI&h!K)hB(^{K{|_H&Z{p>}%Zy$0FmXKe+%rs2LpiCC&tQdW7guBr8G=dfY4?CG~J zf66*K5(Sm{O>Pc$>;35TiNBuFk!!BfRK76 zB&TQPrPT&ad-fD&?Y$>Ao;yME

DIFU*Fwvw&PsdsixNYgCbE#(d^=@ zJ&6K6Ah~Ftfg*`gDEL;`xDF3udR>IR^%=_YK^Ho4eNJ=Gw1X>6TP+ zygb&$dde)f{KfG%PUdrl2ma4r7&R@q;w%_w@9668%P~bN4VxFNLk^I( zNhJ1m_Rh{5v>Y;>FiJq5kxj16xFH`Bb>1o?gN7yu7DIbGJBJl(CmG>Ed{WA1ixsI0 zCd(o)m1S!*wl-HZHMiRnb~-Dac=r2OVl1l3{>|Y!Y&vPmnla-lj#gElZnVekbnTbB zOjPy_T0hTezrW{};0cpwIn3oH9xg{b~m7}?lNm@>u2#zb{P z%>KBzBosCdjv#ya;0|tjC)e=_%96 zWGYMBYRvTIuKs%?A!?Ei9a-YE0=Lsxv2@A2Su<^IY-Y_{xYXHe!(s{&-#&XB{fPbW>7BQy znd0}4?mvAH_lW%X!NVAI@xkp0{28}i-g)*Q_7UarjXU?nk2nvW-Fbdj?eu1zpWc1d!%hk<`2A`ox9#S=+j_b5_Ks5;Sx1>q3~h=`qR90iSO?gZ5*`tIFDhwv!sJWW)RR-!nIICZw*A z?G_f7meg8f3y0g}GdFvFO@C|6{upuE^o!3PJbv^jH@~>3a>|szzR{VRej3eOu{fk? zPQyEt9cN}0WY>%hPCeY3u_55+%w04uXlvoD;!h~QPD#s2tD5dyo13%Jarx?`%F>D$ zr>T=?x*b}4=vUMp6_=QicznfzlZSRLRcC5@z|36*Gk5xej48!m(GB95q_}*4n7M&y z=Bh>I?Um2m1yR;V&)x(BBcq~YQlc~>GFM?t1s>*7unglV(6G6|dX%td*B(9Gzdurp zXIR)}IbzhU1Ew%@Ctln@rp$9TG`)2B`mMVL`}gmQ3Qu)35CtkzGQJ5{q%E+PMPVvS zJ=DZE`mbERLG0Iw+(&5IMXtaU=_dRA!*zK~(i9KjjKOn*gCm#m{kr?2!eX7cn_%WT z?(_Ey3?4sersG_G#kr0i2prLV?WnN0@fz!WcL%w+FLQ#4yJ7(&zN49YKYsh)#_tc= z=YQ;K|I@p&@0GIu+=u^X`gm55Il;RVKz|Hb!GCUI{3!$~s9odZg zyctGgEXxHanuDPRdL^=KFgBk>F^&%kZw<9HXW#t4Pg0+yu-?A0)gOjk2)70`s^EXP_})d;9U zO9ncH6xP5lU!V*yivpcW##n0RX9Ofm3&OGrv{~wa<|#r<0msNn zrdBPe1-GmgC?N%Om&5?{sv{{ISXea)aA>I!@HiOBxZ`z*9!4Tz3~ftcqX08UO;zA8 zKFBZraX!kL0(()KmbtJ28VS%?w`^e^M&>2-Q1oM}D`tw|6dD2ueg@kbp1;SbZVMYN214Pm+Ei5esmWKqomO?WX zGDc=G$QToI|MW@rOG{N%>=ZH?g3Jgcn-XRs=!3{IPe8UZ<>MqRrD^U0jEyb2122S| z)fJUViz(m>wmxz-W-9u5d$zz>C^Y4hV1K-*XTJsX*t+{q+4oO9MJKBdE+K(~So#7O zOB@ss<_Z=T<`x#n`3D6i@Ei|1N?F+{TZ@g2+l0j;{OC!2$;pZXc5HZ(Z2)5=l0S%g zeNbR*!iN2~(uQH#g9%vH%MTOR$iB#ae7{~@SyPqch>!t}QMG_%VuG7SgEr*Sbb*=B zoC7WN&6i}qp4Q{v{UW;%bL9t2l8=2QRW+3dmtx>Ij!6|fXNtp!sW9_WU7xP+eA8U6#2VJVN4`354YW%$P7iwvKu+QJ^j~Q--Lc z?6~s{o}S2gfac|wFFyzw_w$9)6IC^32bWMFKDZVY0*bMTF+7fZL^79;F>VPl zNcN_z`D>Dl_pb4HWo1>>abgTerRiFh2}nl9IH<+{_9!7x)@Q+^)A~>j@m=<^>sJ}{ z7yA(-<9)ePQ4SI+5AT5~g)t4w1friti_LKGx7d;?5SVZ<1|}T*O30``WFMb@iI$Om z{D_t*ed;Q&0PU590V*((TvGrEG2vkW$E)xiz|qrU84ZBa zx9At8A5UseR8>@0mgTL{0y!!cfN)t@6bUGXMuvt2_~G9^WLsLQU>Hq1KhBj@R#sG2o+#X^54}<{7YYp&6pVymj=nx_ zK>X|(@)2&%GzI^V)X#kV_ATM7;+JoqWiL`RF!iE0KfVxOHNM}jI#zk2yu9LQfsZ;B zBl888np8}8j9e69AO=yR?iQIbv`~;FfB5z}@lVB1pZ}0Ong@Sd+?IVN{?z>XYy08y z(z3D>WqGNKAV_J3LOzD6SqcvcMEZo>B;+H)lnoG@5gTUu{HwB$NuM}>{P|IK*K|zL zUiHZ5-#_A?Xn%gYSWCH8ekPk zPmlO13mK*e@UR|@j2R`p`TFhy{u}md{BP>NetEsa@5-ld5AdK{U*G@s+lLSD&K4az zLL8+Y$&YrTM8iU0a!5eY)BQ`7n?zrKC<_T#nE!eZixLP_qyFg}SS!pIaYVZMN*3y9xeP7}d&W1DHidZi@( z_4ikAU*m7E*Ku#u-@g8>>C~UE-o1VG`QgaxH*ep(dH3tn#yoK`?Qj<1ijl-HltNh9 zaa}?#O9TT+7^|8X@nOBTd-VRzO8~K6zIyW-_8l>=)Ly)N^ZGTq^!jJRtG7di1)?Ha zao&NwW^|CoHU()SkT&Wy6c&6F4JrlGEPwz0=`YWpzxd^sH?Mw)f5H6aS<8&wN>siQ4|eu`lXNQN+=s>X(B*Xi{7mlsc; zJ$wG-}k?7%Bu$eXXW$q3bPZ!Cr~l24iA=afn}}$)5UcNT@lzt z7>EpUBUKc}lZ)Ozc?{o=p8s-YUD~r3kJFxDPsLAYkDos7%*+wx^78W1qc-YN#yi-M zF$H5wVU9qggL)^@rx+L-fFLzvF3ixim!ASQ^5D^<=Z_aFrQUn-Am<_V!PCLKOi>Om zJNIC8h0rHyYT>XlFbs6)7}+@c+Z8#Vin_LfKwi1 z-KRge`{de*w5)6*i<6y|DsnXO%kWWvS2J{pqOGN^jmstB`eZIk2RC3D8X76VTn{|| z>@I$XefR#;5>?D7;?~n!cjNBR?%us~`_A3iI|{cS+-^=ico1YB%svo1&j>%d6_$O5 zc`n$dg@bj-Q#5@ZNf|8^8hT8O#Ljwg^UkeXw{JY}oU4rKZM*XL#_fb#dgFD2bhtn7Q$=+NlO#g zB0wOntE8vLgSWb_zP=tC0wVO%E&M9y+LcG$Zj?O(6D`i)xpFP;D*f6uN!#U{SFXie zrCqss@pw`yk;Y5SIJjnd^uhG>b>JvPBo@~sX=#b&-8KNBBxOB)Z8}WN0}n4;y?pt~ z#ryfRt=Dggg|&AsUX8iTymINr%`id#?Tc4pF4HbuzgU%+jHf82CTAqr`KDzgXKn`> zbYqY!0&7Je)<{Z`*Ho!)SN_~M0&BR6_{Jce&vz2gyo`O?L>3kp}R8DcdT zuf$!TUcPWDA(2SpB_>DjNK8peN(+O{JypjN9H60rYl^@HgbrDcN5U~3MIDr)?j5;w zVPyEi(7k-s?0Z8Ou9W5WT^YU*J;FYJWu!`#6w-U+{Dooh2yOVna6@83Od>leF)=A6 zY7r!vd~>;2ktQJ*OX7l5Eeclw64avW(!s%j^MfNnd-^X93=Iu*OV39Sat4MZSEW95 z%&_f-bZ9^{h!0WDw~0=w8=WiQpkwOn8uFIkv<9DPamo(IXl?b-;ejj_p=A3MS2QjIGZ{y^h)u5rbN=) zCzYPd6i3I$Fk@qU)gY+!kW4~-)J$BP0~tE3t{_o6p-0+F^icYn+WLqdqBpunr@Oc7 zd`B2>O5q~K!xy^yx_f%Mr41*$CEd9qB3{gljtMe_w~)2~S*fOmtBd4za<#c&Argxj z=J$1Xi@L~X&vhqvanE(18)&mp7u`BMcVm5jH_^rDZ^*5Zb{!(3;zTS$934EF1&NrY z@Sp(yw=~#%U`FF%z%5VqwV&-EI`Ol~ow|VJ_cv(IX*nw`-+Z9I{cLCF+0Krv)Yk5z zsQpAN&Wa-Nka>_MsF;H^LXD8yrlh5XmM*7VurXTJ*w@R&^R_@9b@= z>1fA0Se@I~=tSkBegBQ9G6@qr?^jkyKT2xh#<;hYKe86)vEw1vmAyw8giI z+M-)IXWEjqhDLj5G}msrp{_n*ukQx zhtEsLnE$mElLsMguxKX*O;Y>|(cyww+SX5+0csTsSBbfUlLR@tqP7FadNmT_` z6~O?BHCS8{8CzV?-aJpY7_S%CaqF9#PaG77hejq8oNQ@4jn~oZ>l*S8G}oVwt>c}p z>!=lbxw$&Jcm?c@2-_bH*l`ZwB zPM?B*ryFb11Kn0GUADq$U07ai(`oz^?ewXVWA&%wPAN6kmnV2kojhUUq$zV(1%!t0 zCHAoP?%nQY4y%to5{~f+6%lxaQ0HkV!NqAwEw!y-7I7^#wfIT;sk)>4-Bzq}!`E=# zoL8-nK2mr3Zp-TDn1 zd^h-P&aNnrKf$diB{q0(@ZIP#XYO41htH@27}9#d*|y!?2)pRd2)raP+`!)&xvhcyH9t~q+_*wK=bV@FDl?OW@! zVg1HUn_cGHOr17!k$X_EzyGGFqOzEyn#W2GZuRpI2==wNF*h+2Oq{cL!Myo%XU+4* zgXvp0Iaz_jwUJkpaAlEPK3h#qT@e-_w-d!jit!_Q#lr+xte1aEnTp1-W;bb!9hX3_7*ULI+oA{ zLWuz9Q&jjW;3S3`2Ubjn;={$F!#YQbV|~|e+T!n^35zHRp%SopwcD~IFe2}$_%OS; zIAzWQ=dail6d1VC-W1XrT>$}`eT+vajXH{@s>XwuUwELX zumCSqEGWtk-LyF<&_NY;^dgLnbntAq?%9=CR6rE63yQKMcI{m&fcXw@Fr1`{>CIiS zc;V7@fm;IBuP`8y$oc|v*jc9vNW7maL@Ep=&^tBi@S!|BpOtqgGi1w_9WLq^B@UyL zD3ry!LicBh@|k%BiD99BdQ=iA7E=L1rpuNuS>mxdV6)FsSh_$i0dPo)0RNX*1sD<| zzr%S%j$(Fh%C_Jg{u5zkz(~>XgJU#?bLjp=Xk_K)#72a`(h6_)cua{oX2pu7E)Yjv z3sqsQH?Ty2RI)$>VhI>oT!jYd9c_65k;Oikl@+&rTj(MNJeq(3#=u-hhz`QlgE?t& zq01mgO~f=vnBsz!E1cGE+PG#mz%(pFgxr{$fzU(&iOUu7L?D;oGgK8}gEu|<;6Xf- zaqwXD&YjzY7%2tg(H8AZ$T*mpc_1q>CK!^{6ikgi*}=il$8Uq{bcipmvAMaKu8M}4 z7@!VABX;7F{>t?W}7395s5O0S#$!%j*H%IF_YcucIw3>hxQ)Tr738SBFDpur}K z5aUq?qO28gOo60iVr6Bj6oaXOXJ&eOInOq>oVv(;3QQ%Yo|);tkg+&$xrm2@0uBjw ztHC0WAB9J!3NU~I#F!x;LCjYCpIwL&MeWZZY#~X;6wCmU9%D+2#sEN3T;{cA(e#Bb zYu7I4!%D0s`Y9i`Oq9!4QRcx=Gw19Rp^_kxV?8QeO;;!s2!)0ai~tB6ihx>RO59>P zj?t9`Rs#5^9E|};tF*>*^(t34m(?zYpqQm+3iuX+TX74LrDc*lX81}<=oO$56cru; zNlW@>b+kOF>4FR^D}9hpC9ld4g{HU^X9mdUS|a(DJg}aO>2CCJTIKBQ;sQH7GNx)Y z3Ra2C$pBWRzyPT5cuI;WqMX7aLPPh2#UxnErE@LDf((R1QOvd<*t0im@BRb6EF4x9 zL&Az=M2o?cSaUbHIjnMYT(v?MRxFmT2``E2SB!OHSiOFS=Af6RzTaN5SDaN+6=(f$9RTvP!oAX1ZWwOtIFfT;)0p_?%lp)`}W=0n-$O-N*-tc zY|TzRv~7Dx$o6gF*khUpf}_khuB?Btnp=$P_or=B(gy0jDEjvx2s63E1Ml zIV;DS4d^zNLMBsaVA;&t6T$ugTebuQZVB3uSS!+o5u%XcElYt>QLqnmS+Hcu(q&U& zSAi)2f+3Q_qzF95&2nLJfsg?5&ej0jpWz#nRpDx(gx+;52!D%dm8Xdf0hhWm}Y3h!(=7Be}RD_6AA!$W_cU~MYL4tyZUeT^YdLF7++K3 zH(6k;r*CQHTG&;NuiHrY>1|r)v2L?>P)Kw9f7{i^JmSSKX2Z2Bl$|D zN&t{Hin5A~$-q-Q#F@{gL9i*#+pxjgXRVLV8V|n^JRvb^lZTg=kB_%ETymW|*L|J$ zdbfqMXU zlmIju#Uu$sk`Y8P4w8)vI9x?2RFN>%`5sah?&?dVkUDIP@!hdvYn(0?xT{qTDm_$z`x+(0uF`CVW9UKW3I=VHSRHP%I+?+ zr`j%c@o-&iJ!8faSEt$52{yPb#d@4B+(rf&e?fohr zi(HglS1-4jK7F3UGU(ilCCg@6+r-RZPKV!ZrcV)Sp)Qg+nh0teg%go1!ssxEtVjnf z3M}JA_RcQO;#Eq{tL9oyn>J&{G;8bWHq)nBPm8f8rcHHoS*Vdk6#%k1nO>>V8DOh#g+5>v3LF;h6xrcD}aWg=fv zFq$&)6Pg;uS&=ozII2tvhJILwXl1I&BEzDqprQeA z$*2)%+)+4@3=K;-d^RK$@H|7ycnmx+ZN{uQ(-J1)lXw%ygJLZu8fql7`2Zat1Ph^U zqYlLlO5{UJ5y6tKVJsvj&?ZhCKYqga*a`IUa417xodZo&Do0iQU(fzEuw+96ZV9k# z*$kRoIYw62w-8#59XEc$1o1e=*s)fYCi)u6kaN+=bgqi33c`DEFaTggG#aS?IP?JH z7H|kfCYuG{K&eHPTOqiDuB57CXo8YvNTiGn^)!{(Xm^BGaWaj`Q&NJg4>m%upChUN zg!@Ki68ab`3nZ$rfuRc$nJgxQ$z;$O3N)0O5hMdNZ(xCD{C&3lOV(PzTkr)h| zPRNB(DDbYqVZ(xxXk-eNN~7TlnshK8Nrk>cdI~<}^HmX-`Cs@c8~Sa??R?8nW$+YJ zVV4rg>x!u8)#T4-_p5@ z=_n}6?Nx%2hoNG!Mu&<4{ROMVP<@C6p(JE1PRGEbWN-m4_W=(@00aQ+w?%S$`M~ei z);8o@VJ$LVrwK!asmx7}Zx4I>rPU3M@r57~nc8mjj6; zu1rNy&KCigGb&0=TT{(S#o)@1KV`>cU;cbG4WlWkakq6E&z z<*3IfiiNzSuC1vH$F)BG{{6SlKYja~M=WWOW++IQLK&$6%2J1}Jyw;56~@z1Td{2>)Jbpi$(jvc6LsTg1_&txyp zBfbp>m4M&=D*N`e3r=Yblt@VuNegh}`v-auBknsPV|`MRnK~N5cFeH+r{sluIt3}EI zqWob02-M#@Zrtu2I3Z<82BZT`CgTh121d?EIRgXI!QKmh%KHB78Xg)blPUrtf4+Ss zOJ(DUuED`G!0#Uz>3S#oZD{yXrIg)&z5`dqm>PIn?_i6RJs`PwvH#C+z2`6V50oRa z{<$n2jEXUr7xsZxNu!h|89IONcPTzlDOHvX_SKp|0*-OU2Q&dgUm|G$ONWOf{R0;z zaD&o-w8sMWMX<1II2XXFxPb;K9onV6{pTgsQstq3dq^E=bQ%?#?AI;@Z`Ml{1_vbF zebW9aDPMBFD<0qzAoVbz3}Jr?1lOa2g0!o*_)F8rQ~)3g~TAuEa)AokZOU5Q+4$q1Zo7xTR&|8BMwMS2Zl~N0Rr$3hSB4O zBjr8!leNi;*qkH1gXL0f5K?=puCBfTq#!Z!K?PgD>1k36$&eHXUNlT;Vv!?^{HMX=c7sMo37zaZl8E#qwtf&9NTT=Rbv9!Fr z=KQNzIuqmA!5N_AFwRnGIY9E&HK^O*KnMo#Ac}MO>;XGtrOLzg9ss`oCy_~Yl*m+4 zb?289J{alR1t(V|N2SIf@kBYm{QvGc3NVN-7+dIiFSs&V${cFn1yk!E{3ibQdu0_> zCACi;?Promygi-6{R2m(HXyMKv05stLFOsccNBBTOu3yX=HR#zR4WJila(Oi=3V<6 z^+_2~pQ?`6y}Ij)AgQ!2sD(PE&bQ4OK41 zIRBk9b)vGO>d3%{GiD^1L=ERfQqs`iA?YNLeDoN|E(I?GBMZU-M32V)XgGkIyI~RS zaE1j#|9@suRaTuSx%g-9IEa4F4g$`6wVWN0E2 z?}QNU>Goz*sQ-;$r3L&da7yXP+ux#@;I|#pfx*6!ki?DRYr!B(-#xddjw|{W1w19I}3S7prmbbrcgLybJ2Tq)I*|@_Boh#J` z*#!kf$oOL=P_jV-3lW1ROFdc|@G~4_eBClwjs6=Gi~PsAV|b-Xd1=@0ZMFa{d9@5k z@=Z7e7bF8Ya^d;;1%+Vyk)z1@KfMpW0q-|7;?0U@&U7}o!qWafu(Py)omEnCqP+CT z;Fl9)m>ADpGO$M#i@(wj;>UvRd3lEl3XuXdyl8Ys1OBh|qq(I%&II~A%Gu)l2WRUu z{-@SY($=1(^_(19Xwavnw*cW6X1kS(}BfV#(ZH-^{=KaZrtIw{S{%FfBnKU7cv9e@!=@m~gE2I3+9Po1t$(gU%Xo8(Nd;9FmR{fp^E9OV@sef%~TfPdH>kuaC4!5q2h%*=yXV0#`&FFbs> z_$V^ItPGq3%i_tC^+nF$bVUDp_crmJ##=e{>)elD-+q0F|Bd=3DrV%J`SQ?|Lcw5< zN9BhPO9ry!;hvEJ^0RV~`+pAa(GsB6$=zR5)gT6tOey-;4=>?l`5XK->CKzy*XnOx z|Jr!!)62JSUjF%D7_Ps5{pLLo!idB4!o&I3K9nMy5>m5GgZ-dH2<}Nu%Q%pkiMjz! zk`Hn*ic;jG%F3E!ez4ZsJpgg|D+=O?#l7OZ{^jLcIL8hrmS4Sj1=snnU%nYAJXBa% zR8W*v{`%PxKrvyF%D=P@WbQBi(sFOb7EPrQ8#Rp2xkQAodvkf-Gl`(SCXU_GWpG=n$_kty}iM7KQ23|%(bJ(j+d5~6*)o=9AEwN{OQvt&qnEFFP_Ff!=8$s;ZKQYw5LyB-mlBV z^HlP43)0J8yxXXVDd_|3U_0192-(PFke`^8oRX53egG*zu_X6X5iCV8+?87mXyi$S z@1Hz+{P6L^r!RnJ_VjuBBMeU0QJ*~OKqNDz?5ytZ=jUM)+!iQc1{K}sL99B6O-M+B zauN6+EQcVK&jGwh8)EeMk!tkb_{lnZ`0&}oMM`ORUp&ZuNPG0)=}>Mak)xcQn|AE+ z=SY?}0v&nOO%57Gl0R5cY?%r(iT@&WjtjZr;3g z{n<}$+N0~Y5^j=j-MtlmlY0AhcX~RJp`4zXl6%?9ETQa>4+S$ThI7IPq-Nj{ktjMQ zHa0#H+yaA$!X$4AW)yNbzaY<79m5=2pIjrZvv1wXkn_|o-M<3-G=*!|Ze71|?OH7S zc55geXwPAIgbq6U>KhU%nQ5m44;gwf?qCH?9D2?b?-_7fO;usr;0*OqXfmY@)u5 zNyBV9hG2)5F3;>EqX5&Q}fKui5~}~{)`7BS1w(;eBmC@*sk3W z2~Xa>csb@0^YX>(H$nxy@;_)7uZ>hCB;hH1D0(KW+?ad-uR3i{!>no`Ng3@2oKTCx zMItdGWuXvCPRUpXGtFR2);1H2WL{UqEp5col!{`p*B3(zv49{He9}*AXgVdqc#Mn4-JTD<0f-|bInM1** z*2C&Nsw6b@ry87y#$$A#N2#!%L5c7U_edp&bQP=={n{^di~H!^u!%i;KqQWhRusqW zuIOIK!Sr$=-5r&`Yj@~gc_&7P1ym$1L_I*|Ded@fNe|IY>1%B56?Nl1(cQXTJ?Dnn zfgo3~NU><7s~2_-UH$bnU6QUG0*8{XA`!FuNY@SnOed~u05qUPcIVFBd-jHg;Sr>L zkvOgdL!Yn!JcNKypv(21Bf4nk&OvT}E~$%iuKTRC)mELjSu|(k>3*V%d9JrEyFzj< zACHO!6imD~``jTRrXA5Sm;w7csWc>H*DksAaNvZ=M>}=_EJDU|_FPS0TW1H}iOGMG z5QDD0uU>mjbEl+i^MSrLpwD%7wjWGxIae69ACHM*M-pN29i3A#4gcn$40#M~581I} z=PqP@7@XeZL*T|NfHm0(KIKSZX_vwqbRJP zvnVnGQQ*SyGgoaf6_-=Pqe8a^L&*@Njygpd>=w_5HNvj|G3y$;np@+~h+3o1Fk9N1 z`tlaUcekFw+prem46C)Jqbxk8`e;SR|H=Gy5k?M>0my09&6Mtiho*r~Ok-CEO``tFpCRcD&uQgkz`v7?#@ z%`Dg-8W9#7!4BWm@Om-EHYvH-4=Nbo?=68_w+3&+cW5B5>^62g z-B#BqZs0c7H=Jo}hMj$DTQh9U@dj4Y>9(}cX1Lxk+TK!~6edmy4~GxV2@Au+i7-}3 z?XN2_CcWr#A1E>eMNmsbnqUB+KYL*S_U*F=>i^H55krn*zHrwvb?Zm$)4xH#K6t=YUcA{1;54c)spxcZ$pWMf%Z`v%kG zlWVj8mcT%8n_LefxP^zUf};wvGTIt)%vLnj)e@()YELy(CHvVgm@{YI68BwMH4Ud= zPhMMFa-=TylyPlsV_jM7YN#~`t;X3p`iF*t^MNY2wes~2sI_NYMw(EdZrbc05CEz` z7sM2b*}Wc`7&axT`Q({U^VsIMDD*fwI;~peuzX{7bv0f^sjjZ7imqf0(&S5K=Y)lx^7P>jym>RR>|cW7kf96O632tFf%A z>d4ytH76j+J{GuaC1`PWCRQ_CS35iSWRzC|r_QvzvNY7$!FBagYp9q_pKfhEZQ@j~ z9Xms|hxi|R6mJN6;Psj&M^)Bu*tiiXf~W`#LZh`aWE)^I=~Gv1*}gT{ujqCR=!%AvJ54$V zbfK#2`i;K6en=Y%jP1dD#)B^Js^VjiwH`ZqQJP0T=#q(4;-FnM^cUF+=) z>xB1^lcW*ojnt7@n4^RWi!yU5{A0^0I^Ay>qG2P7y_Sl>*Wyw zu^6<~38-NU(hCmdlG&X<^#7i|5Um@8!Q~UG4=pNPSa>&i2BaRSI|;!q0%t3i`mCKI@>!5AO8e65wTu zVUzb4=H=kItem{GE%50n4r&-B9_oga`N1J!2l9wqW=?)wNXR-J*g3{RsY%Od!Qut; zT>SjjHbI_iV#&FoNCpJfv#XLyt4E&21sKXF0S-ik;qwl($9vfifG0v3Yp7zc&jm_ueNOG*aL#v!!R=dKqfr+_xtq+$c0Txu~sjE9oTu+z@5SV_BMifkK zV|p4&c9Zas@Cg_crOnAu6=k9lEM0+0qAnrgQenpypR@@+V~VQ4fCeZ`1HXpA41v0_ z*v`?*c~3#GE*!ZLsDmq3G;DuiHTfI`vWiDK9y=y3Uc8b{Ve{1V;OwnXU!4b)2DyI5R3}$Y zdvT5-3R~al(a|x{ z;(gooAvpvYG?t34r7~5Gs%&YX!lGfz4v1qQ@r_!jK;vncm??1BG&oJjV?aF|`l~R} z$=%I8F@+855xi^7V;j%>gpUy-jY>(dJ+>Fwg~J;aUUVqX(HqFqXO#dBr+JFwU`K_E zqjni0-;<~eo{pvI+SJkm8>}o1xr&(00V0|pQufcJF*QsqCx;zA95&g~RGm$O&V%yF ztJk=>Z}rAB$C&{-NM2K22N|3kx|f$s01}5)!#>(BR33XUn@1`4Uh`pbFu=u;INCVw zlaD)@#!@x2aBlk|`#i8}f(2>kP{>E{oavy zyannunWm^VMnCWM*U#TR70t2GRK{#FBO>=jq(s_MIVJ+PXEHb({nTrmAs?I$sudTx zyDhMu>)`1Llx+%i+v$^#-NE4v)N_RKB9ywf*FMgU3aXt};Vv7%>0V9(;9brRiwc7? z9Q!k-j4I}7j-Ajg`}XDg*Q={dbd<5V*^u3aC5RVMl?}&dyho?9-)BrQP(wTrV1>J^ zadvcZUFGa*0fTRwR96G|AOPejS;kxG@)A>bw|%@FAB{FdJDTjSGvP^%!2Nir_nv*p z8-RfgJ9Dn)IIH#_-@g9%^MbR9E{EovwFmf=;`miGC8G&RZ+?9J`r~!#WW%3&wb!{p z>^eHRIA{W4CAb{0XL;=hP=9$%1rGy}cdE+nn*$0c(~6{Ks|J8@hY<&b^}O zDWI23y-~ z|K^91J61PJ{AyFB9PM4FviHyEv^jF4E9{myyXsOf zwsS6Ii|7nDczCpsSb#_WFY#V~N28CvZDbdyS$C~PDn^+mB@fe7BY3}K^V(E&-E^BRIxiO3ZTpHkJ zgqNd2ncTHd%7FqD=+gtQ!kW2A9b$EH$kw2stpQO(U@NQZ;s$EEDm*fC@8SIc zfm?%s%$a$32~AN&9oOgRX{vIWRCrF)ar25L_);S;2NZ>y^Nz_Y81j-=Rn=$(5mhi+ zTI@6JEJ2;4F_>lI5#k@XC2&(}`aeL9@`?s3_JFd<_V$hr^C1_) zW^LKB*&leA8JX6=TvhvBt5IDB+w7F!1ubiDnc8h5Uhzzh61$FR|c$_yJ+D& zXP+6cyE9!9BYm_)?90i|8I{I46aua&bjm#gO6$5uu8p=pZvl z(bup5NV61qqCizJydlu@aFvrYx3;yhPP1aNvDR0Vm)9^c0PIvj&p<^^F-t*GUPemWYOm=Q2tj&X zY<4ExJRMM zB?Ac_g#6k@o7nt-;IHuHKoWD_Bf^Witd zH4RLlxgxcxshNd=yp*(bstk#=bec?xw2X|jjH0QZ{chl#Njc5p37K-DQjt$o6G~xd zkU{=Y=~`iE3UhN~na%J#Mo-Qrt^{#sVq$7)Y^;(cg^^B|5|Ne^moapAm8B;mA&31k z7J9>>94yN7BZq)L2);(zB9wqpfiR;fqE-$<{JcE<-$_t>vQ8XA86T6^@6mF~nAzGu z$)~6Hp1_dssMt6#hV&1VXD5mi#J~h;v=UcMYG7_rY8Gf}Vr*onr=z6_)VUG_wv3Df zxQvq)?h=qe5(?TaJ9Y_6NJ)tBb28FUQ^0d1{4Euepo)g3u7Rvu3 zxCFHLX>cMyOcBm8;^t6Zb)eGK%(BRAhbc@9)jDdb13|98^C2<1C|N) z2AGeike~n`?~d)9+t^rHpt&(T_ojd^Q%Q6P!9qbz%fQUa&bgh34;chJTvb!Y(8S!@ z-pSp2Pe5p7%zkV#tQtBqvj{sCC~&3a`STx)tW7Pz;4Tvs7@AO3i{>RIE-C{4x5S1GBXBk~sLr4052c8fyjD5|Jy1JZ6`>)`C}vo|m_A_nEX zlQuRP!d{SHSbQMkMa-h2laZxqzL@}V(I6NhL?B@+1i4^CMi1%QS<4Y(Bgczkf^9QtRCzl>RLJm zM#Qjmhp-F|jU-4O@$m%Ni5N1Oxmks&RV^R>}#&%n^c6dp%y9h_X;Js_V;$gc*6p|mkU8;Jwm0;xsGsTt`d$;nTDuB}(E zuYGy%Af#<+XKsOma{*^gYGwurjTBRy@g~?<43J?x-4s2XE>4e2SKq)Go+seO9iFz~ zu3{s*if&{B0&&3(@CE-$W8Tmn_fGfZK2F>|Cug?xm=xbWSmTuNW zFjQ#9PJEU`c|TO!4!2#9i}rz}w?8gG1fB|zMggt@Wd}w~NJ>tPkNeOPvJTx0QA5LT z-`Ce(j_O#On46!4O9kBGTiX(|P%bVww_T8gf*c|-uZej2s(f?iyd(8KV@^4t<`p$$*6u!sZ3 zp$AX3ur#;u{RjG0+BF#G=hF1b(#o@?wnfV2CH&&z!a~m?^~$rwmD!cGpV0b>dTnuL z^~EZFe!dk?F?;*Y%ED|fo^>9-^kQXx5gt$1SMRMa&nzzE=N1-P!2UeGC+0YC8}mJQ zmIe5&rN#LLcy+@3vow%&j~s*@~gzC?1<$?8VbAK>tgF7rd!ralRW*0fVi~d`($6hG(8%oE-#?8LEQhV~6Kwm*DVD zqeEU@UYJ{erpw3hj0^ZFBqG3F7l(V-^Vx-kGhlyybqPNUOvh3D7HAv1H0uDDRs!v; z9QkkoynhByxwtStGl!q+03*wj2e$+5EJC229d4{F&!53lEiU4xr{`v8ar1}qEb~h< zSA{lc=S`GUAtxU_g#)1hcTGK+o|&1Qn?HhQS;Wu6BO(uxcBZ8eJ2KJbrOuvL2GL|015R5Qt}1+rinTB6O&~jJpPX7cMwsU4z5CE{ z2)akpZX7op`22hso^Juadcz-4&-(u~Q~ZZ|-bA8vVrJY3%A7L32B zXA(#(SoO~>&L1Mo?arNHI5L>ueHe{!WD{^;)3{mKk8<#$3;5*`7wZ2Od*0+eGP^Y2 zhNpz%yLJ1{ZQNbVDDEE9eOPz!+2akL!69bh*%$CDclSaq_kV*ulQ1}p&%@5g3qwLh z!tFbE2p+r-E<_74J~=TtHI2e>c0Lo&v~tTAZg>B|o_|9B#{V08_I$DmTT?Tv8jLuE z7-Tf}5pd;izC@=G^5uLge$&!}G&slpFYuY=ckmg*lrg?Kw*coGITQK7>K%7e^m2&Q}w>-G2plbsG|)2quPy?*JJ^@c9E2#*cAN=%#0; z0_e&AN91!Vx{5u;)hy309Kh3qCCGULnvJx(K^#bT8>b0G3WOgTesXg5QL7-h{J$rk zb&t+3Pd(B09iLk~0NwrZcwl7c2&Dxu`VhDW`h8Im{WJCe_lO>iK5PqD!T$;Q95A{# ze|-1mF1Y+v5!`YSdQ7oF!k#FW5KwzUn4>tyJ)nE^@X3e|G_v>~lFv*&_=R*fO!cd| zMdI+l-1G?$N?xE}7aaaS2GEuSfjLqm1pCkbjC>};?CyH*iNPdJ;x~@|Jn%OHkOK$r z1MY+t7sVzDO>oftvHMT@_2~aU$Y)0DYryTv9Dh2$P>B}-*CQ?I0@NZ9W&kBezgB=4 z{P)N1q=Vo8$K*4k&n^@J@HT-;v{mAX)cr-m_{8ubR6D>56Ssu6otO>sIsYB&+i%Y! z_B{LoO)f(xzx{?jGd2>@XEFl%?9smfgVVy`XE(Hoi?~bMQOOZ3Fw#QNse5~Pc&yhG zPC@mR&#zv;%6rX^&}Z8LBKq9^Ti46RrpCtK;b+!t*b^%Vfz#cM>)AytFY4P^00@8L z={0<7tO{zF0Dk`P?Bzf3Gs8>N4U+&rf1SJg;w3=QWC(u7)l)arHPk%%@QZ%l2RE%1 zgjqmxoLKsUyTD2G6Ra~qR)p8N3}1=`7S3$`^}p!n?B{e(p8-=%grA=g;pbNXKSR>0 zuA%ZD_}S_D++qc~|HA{DM5sD}DxQlMFW@dw5`*bFZjk=w&}hMq{|bIiStUW8GdI}h zlp4l^wZ#BGBee-KB_jEFn1L*ePf$)kDFVR;v=dap1Y!|kIj#*2p7($WSVAw&#U;2K zCiK!=T}lV|83+HSE|V<5f4G*Go&y051b$6*UC{;s&CNuK(OiVfav5PUPITc;QbQgb zvpbNwJ}nTKtS)jJhcqNqGJbv z0v$eaV8Xd@5sKcBgRb|Fm_jW7BB1drcp#vm?*P4q}L}7ratYM<{l>cBx$qL-~txqI}p%Jm0fwwT0TIP44E8W>9Is?~Aa1l@m1 zKyy5qx>^i;eQ9Y)c|p|%0!@w)J_E1NE5!@IVG|Vw$j75{91z;hp6PSI2;~f1xO^cV zXd#P>{}F+nLkKhl5rNJer+EBmYPh;ErG%xpw5U8^!Mu`yKr_WYUV&SUV#56kC_o@$ zfOAl}5;*6~nLZ~B#^q%1w*1_MnA4D?8AUSVnxQ*pVi zTv`>8f!2Ps1h+`VgjL;86$phnxGp{jn_g!OIaOHC`NK-UKtn4}#6aJh+hCxfmFGVU z^w5*hvGn_tWA`2rdwCKeXy1Y|T*qm1N{sY1{QLrOfk9tF>3)J<2P+M8=>aPk!Su7) zq8L*7?iuLp2@v#vCqU4sv*-Q$_tHl)?ciISZX;Fc?uMVJgg)x<@zfK<7`yKo5@MZj;>_7`j8~ z{CV@iE$IBoePR5@om=U*Dem04n3o9*G$sd^MVp)4jTmUvn{ba=OgMoXAyZFK0gwcU zG{DX?$OwU6pf@=C2;NG0V}pT)54VSJ-bjZ+<(osqR-i{l;oIniV>fTy?k`HuOv_?G zs7UVquFKm=FoKsLzKZcX!DmpngOnJe6oYiRj?>5tVuCPik(ckL4w9qJptn*6Nv>bd z8l=5`>t^kCDlxh}mqxFp4pIa2bmInU44Roim!2JS3}Mi`$KZ{W#ptmMUsng6=!g>` z#PP9XC+%Q#7#sBoy?WzUpU~86FnY!{uB)g~XabRg-e?qh^~HAUkcpc0ce`|lnVervv~}yz-f#;ao_;%AT?Ao z5e^wTax=6YvxPy41a!~U-VFkpo=8CFT)S}o;-$U|h=4wSxjiAHqd7StDGN&*AK$Z} ziDA;Z1h-N}gcw1(2B8cNjf{f7^_UF|Odz03&LaYP2W;2C&j7%KE|rKi=sAD-T7ggJ zMfCApZ|b?tXD@Z2KBGx-iSgLP#DtVYx`c#i1VYmb_dcHkOX&JSD9J)<5~x17MkcV; z?g9XX>7nbe@`1FGK{aE0j$Ha9l4wC-gjV$hnL4G4p#@9AkP!tRTVNw4ngJ$n*& ziV8rP4GfwAVbG~gHdbbqPJS_o`(sk#=nw_{#sl`_!>?z+2ujnGp&B9NIwY&&>UT9X zHHAP?%mxL0?li)kPj;O=+nMKMs-dc;uICU{c>-FUc2S%}81%{XE*AI+0thWG0 zu9Ho1rkeUDIP=Y>h6avFbtg~4E_wXe(G%&%*-jik0WfrsnW6-=sF9Tx7glqRh>ea$ zF!Yh9`&mgbwNHP!57j>rl|K}698eNgmj?X_cjI~hh7Pc(JK53M(b-kEN7DekwQV!d z3Z@2Lz(T{z20D*-q<69b(9njpHa6Fm1t}Ah9%(TdtH|gm+&-GXL(7PTu7VrwBEpR} zlI;kp6e6B3tpuKFKYR$`&_~;kw1t~k*Z_5%Vn;*BDLdG@BOJP&{77qpqaDr(V~SHEg{*ms z0+Y0gZ$v~`_}-?u%pJeXNP-z8=pikVAXcME)l}80Lge_KY;A*WxUIFdy}j7M)ZPZv zZx?r*Cyke<8{n1>fd`MaX0*|?9&Sx@advZY@wCHfk|ViC8K=l7V;mF_9J;4rIvs3P zz};mLUIT1__65Q?K~F`(US-w6$`(y{X!Gc70_?iAwWaw`ON_NGfOT%}CaN+LQu6BN z-oEbcE^)Q(&1o$x&CPA4zOEjgzAgqbJ9&5oM3pqva4L-Q%C4ayA-;8wv2cr1hDUJ$ zIZ^ztsykdUBd`llUwNRS$qa22?F~(7joX^by=+{Z+&!!%Iq47{v6)NKG5}DF4EUyC zQv(puu08?Yx_nzv-!gJ~w%uxQS|}@;1%w9p)ILH)bk*V%ZoYt!&LC=FgrYEXgNAhI z8c(?GvuLQVPp#u@sK+@wx_WvV!f$~niT;CO*YgSRimGf(ucK+m-m^E@j(|hsfb!i+ zxm{5k1WtY55Pz?lhyDy?nA&A{kKSAXAuodj(v5;b@MRe+T;+jK=vb{&Qnx`vSBJZ} zd3!^9X95ikm$%LGz9GRGbp#r^t}H4j)Q%qjNzfHJLF(gB(bZ7bat-tY8rqSZ64SIg zF*`FmKR2ICFb66r7(`g>h87MRNwPdCMmA}KhCW#0@8KO_1_V$Rh8oaK&ET-OG9nJ0 z85ZUauQJ%cp|y3jH0}26@u<413juayWnyL{Ih9TDVLFJGMA03YLSa%?T3|>DICMP_ z&$LxJdwl}j#gL@?i-x8$4~x#MN~xf!sz{Cq_y>m;0)^AU+t>5JbrpE?%?bSDsj1mH zLVg@lc4%V6KnowEnhIDws7g%r+Y_qs4-f4ai-o@~hgdA@a~_`g(|mK6p+B!=Qe4?(yWqk^Fz`cS*92!HKLc)q6*9=W5C@m=|F3ZCD{YM&F($K)v!`<&7(9m0)dmoRF z9tuvrKRX3WHJ3q1F{I#-Im7{EL4hK{hlLdZ@YuO4d4q;d3X3oY$SxJb0X_SmyAnAF zq9i07t{K_I2#C&#)CTn*M@|XfAcs{W0@23CrtZ#RHIT+<@hnKRu@Mk&8k-^H;b&2@ zQW)k5!fXnGnIJ46vRznM7AXa<7W649Mt{spj);>$Kr}fi1qBrij*bm+&m`n}NdzD| zC);NOh=xW~G?f1WqV-J7-E3p)!niP00+K+DVeCerHWa17k%*Ck=K?N+1s3D?K}8bEj)@lTt+bL8`*mRLg!9N2Y@Fz6&Fufa#9Lf zRzXpxOYka!XFm6hxCI1u|HIzwy=D zkF`&&y22bx7^SkrWNczSR+(%wzqtGA`j55s6>n)imQ4^VzffomOIH_5K%ptqM(>P5 zQW=>hWZcoB&rHu|V>OU`PS{s6GIIB8q7Jn2xcJ0`1Z=Sk(Jljrq}1qGIVn2i%=|J{Z&KEU-W*We$&SntL1-&Gd!Xre!&OPY_1suYMh*xxDCg1ffIu?{h*~}V0pFRh zmEOrhM4;8(5dsbE>Jb8M*fETLj`C!>Nh zN6I3$ILSg*bjKzDpkq+AYDiv+1SN}rq|Dx&+`Y1rd~9?eTmk^?fdFVj8~g2K7zUrS zHwSS;%)bN{5CI{Y#*l980e_}r+PVW?qrQWciF8v;9Tt_y1&8>T)f-UIv$FH-+{wei z$^h#J__GB8f93)FnGD032xUO1oe?oj4{7KPISmw~a_kmZz$8=_!0!?n5EKx+x1b2h zg>e)N2r&X6hY{%K>f*hD0k}YcAiwx}L_aeyv9O@6A1-_tMgvbveSJe6Cu?44Htc-v z>Sf#j4M7tiB)#w8hA9cc<=BG?tQqV!fxKW#Eief1=DmB0OXUB>KGOpapbC|dfQ&%> zpI?Ai*0E%`iV>O!Zotp}*4hSoTDG1_u)m9(IFGwb1<3(|eucY1OVGv$`osOPDlBVq ziWXe0Sqy@}%wC_s;#ONhxI=*3Mc4!cfPKb#?)8OwJot}~Z%KC!f}gjNvT@snIqK+W zYnlWj_?gn{+$EGZ#`QB3%peDXOoki?0aA(GnV6i26^Hq3x83UtuSW0$__@JbdN&Wi z&%(9`FC4;pc&GS?`?@>2?{Nz#JDF-GK!l%#oT7e%pUE~mUF?MidP1UoU;uZO9%b}V z_!IT4YU~c2#TMAFckT7^_VDs_^^B`IbG$q;G%D|K&)Mb}XSY-@4R0$ecOOqTA3&eu z_Sl=4ItA^IbT`yc)l$=sv_M_YEjxQI5IZsTAz6j!I4H#@#{5V%c2i=UHk=sb3Z6hd z+j}}Ygrt`@9_c*M(Nvoi=nin^YqqqC!>o`$ljhPu2_pdI2)q%)7>y2(+d0&?!m8#>PK zD^!h@OiD=cMenp@Hgt1!0`%G0$<7)cF>Os$4eXs=oSmFq?R6Bj>|C8~5%>(nwkZnY zipoGf%NqE3z;hVsrpV)vDMva8Os5wF1VV`o=s5(r5d^_oHCXzj7(4WaH5M&LCn&JO z+0!`KJ3!Tqp@N3FJ>LDT}Ho$y@BT1at+%>DP3I*dvUX zG6#`jLp~TlCLjQA)?(>!@#YBi1@hV6-Y&zI+1?t+XMJl28(koub!{!x^E>l|tpcJU$vGC_|bsA;v>&56m;YBb`6jvxUtePST-+Msf-a-3KBm(uL5{)}w(Fbm0w>@ID_2Ekn~3V9_Wo3>BnhrKMA3Nn~Ww zWK(5!Ny{pm`Z)+wLIDS#Z{y)3kYVT`wDcnQ1ErZz)PQ_R1!nt2=ZE^?M>V#3Cvm zP^Uwz4uWQ9XdOXoYQVAsJR9f1k8Toye3k<8SxsBd&_q{GJXexkN>WrrLdVSuq0g{v z3aPbit*G#!9e0G2&_V8BGSG&rHzdnO>{b{y-d_`HMIkcSd4#2HyYy&-_i_pajl&gRB(YxFaPX~2aOi~J# zG{Rmmg@g`6&dMt!1}Lu>kk2?VQedEQ!fGOt%KBDzX4=vO_?bdBsEClYgd{G}1fg^Z zDntlnFT}+puI8mnz%w2MpCrV`K}Udn(V=!q(3lFMo0Mt0fRKm;P6{WXBPj(9lT|de z^^EnEpzjBIg59DW1kYThQRBih8O`cLkvfPq(zMLi+vYUu*nrzzr;i^5)~O1 z9Owr<$K5;}Rk_gvDm<%DF>TuolqV3@z+Y-{bgFj~TF8#ph$mj%YN=9}; zNkw&S15~0A^3q39t2}g4bs_l-ZE@!=T)eO^30I2cOib7x6B!;7=#LCJJK9-Wni?7D zi!i|z1d~EyLP^WYEg&K(4e&D;6Tr{p1o)YjUCzeA$<@o(KPW6JHZeIZ2MpHKH$xsA z!U`kVk15^_2g0VQ=!JtI>~Tga;TB04x8m!4f%dZ4xuRlg9{3+9H- zkkhAe-IRU3=b7O-u@K7xZ6YGWg8bp7KQ0agQ@UDe%1{XbIZb|EPNq#{dB~$U5^-`m zHXZ?CaTy?=we*b5tpTtGNH;PzF(o6fsJyzN1+@i)vjxs_WCwSO=FFMib0PESpg!Vh)KK86^!P>$V*`1%yPU z=<2m6Ff3|+Qfd}*VIzbGl3fTp3UM1ed+yY;FYsE6LaadI{^(ybf`zg$ zHq-;(DFAXUvRhy$Hy6ABiGhZK9EairN1~0INHemsb8+w7B_syavzn%^5wuircK7uU z4v$Gdi&k1y2N8+i`nsBGDvHRH zV!{Ak15nP%nF6m2)ZyCB&C9n7RRW-%-w2KeXF9t9j32rWc{8`D;sA8Uku!PfkUqond0Ne~g|9dB>)v<;;N;AYL11p@SC#`Q_U}ORn5SEZ1b#etuK>S0E zL3~n5W=>vF8JyrK-%iwRz^SOJ4R?eQx_z8%UJtr=`TqL*ynO{}I9y^L7L%BUWhI!5 z-WM4GcgcYPd-wQydwIIUJp_rfbDEP8DmO=U_3*N%pisbj9SGx< zhYNB0;2Ap?OOlwFfyE`}V9DU=5u2ZAfNDJ8IR|AFQA!aqLnz7pE1?c8-B5GDe~Dae z?QKns>qi3D;SIy<@Xy-X`j7Whk;#ckJ#c|TkHNS!2|~V$SPy{m<;1a&@Nn>8H9>rW z$ZBqBTK%;C{64~;qZC7eFc?kP9nlpG_DF%a%QN`7Kkzj_KYCCLo(Kp#HZl*X4N_k0 zApY%_uV23YuYZAwkI%+hHBf$sU>xq(7`%F)um91n?|1V=01ZZ-hvK?~1z1;D+duXN z#=dt#A`%|uA)kQzfD#se_Up&m&(qN21CnagG4FtH|I=STq0f2GZgOa=<2VK9)Sq-d zVX8lWtgn5ogcsawJ4M)${`CA|#y{34;hpa8PyYPmHzxb@>k$T)u78_(IEpzVt4IG% z`)?`_tp4$p|IOg%TQ}bQ_QyZ|@!QP&mp^XwH-q0-Ua$T3$3OmY?bX|Vul?6={@VZJ ztNxF{wZH!V8-M?V!yo_jH~#+ae}6paelz$t{{F__Z{hIAKmLuszw!6SgYGwjf8+0O z{QVXVfBfU$`1>1we>~`ZGx#_D{>I;L;qb>l{*AxC@%P7r?l*&f?{NvyF z`x}3MJm`Ki_&5Ik#@}z@@W(&?jlaL~_s4_oH-mrU?{ED577l;>Or{rV>W*IrM5{^w7B{?qrBt8f3j)qgC0ohtpe)*pQuG#LAL)?dBKr#t-PkJtYF zOu;LU^?cZP-hA&(t42fVK5+Z30kxj9UEB_>Y76Ke+;6>-7O%sJuo6 z&`^YIczXKJI^e}%9O|P;Fb_vS!RT;y?$w7c-`4*3zrK8WyL=~g7ZvJ$`p*{`lVSeF z(YaUu+h4C&9uGD9azlR^RC$iU1o%iQVlb|S@R2Uil81+$CJP#KVz%s!+8-VmF3kg< zF&qE4fdBi$AK9QoNhI;NVFYq2!dTE~Ei5>aI3;MOhS}-kyJs&n)InbmWdvL3yQtY7 zYKa41Fr3f2#kv(n8vO}A3ETfexQ0UO`^I(PA-j;?m+$>%|x}HH=FW{7%`(l`Yg$XO3ShxVM+*p&Ik9 zL(Ec9n{~yvyc_ncP`T$?P06OV>6Hd9eUwBpm;5XyRWtP4>XeB`m%%vO%{Y1OokOc@ zw2b+DI#-_waZ?@(N&VDe{XqBw5DQlEle!R4bAM`(!6Y;>cUVWs0 zkvrD+XftCC#-6`M?I1h5rBOP|8F}Rxz5D{&daKfNFSjeDnMLN$)Hynq3wLTCs#?%s zbt7fm)BAel3N@3BlCsN!%GeVry2@ikQE_i1X(uE`j?u~9TXAp}XVH|C9z%0J+$p{qr2Tpcb|v%eE)m<7e7eN~BBqY} zyixe_?D+hw$3$8j&-q*KlvSkoOZ2?yl3T7b_8)PKvbq*wscy5brjt`js`7nVG3ik2+^SC0!EFQP#qXVQbd;*vQt@I$_aPJ)Hh? ztC-WZb2XTwH}}MxINCZi_m(>?I4NWBfQDz>D)*lNlkjQ)bg@T#9?fm&rLh29Zp}vLr+Zj$+o$$!ajuYwr;PN* z!P~5JorgDPwy%2mROV4|3Huwj%ZNN`y`mfc`mUc5&-KkJ-HoqqwJExqJEc<$gf~TQ ziLH2kp)Fw*!_zkEP=onG5g5#4{%G{-%kZqp5r!+cRK5o|84c%W z?xQ}}V$|;)Et}lt7a7z{rh8w$<9_btSBJSyJY-KT^AI0?J{5FyM{}i~$v34dw$0PA zVi9bC6tW+VRVz*CnW>TljTukmy?l^d(ql~7cI|3fw`fwO-O=0@kJHNm<1H&{vD+ix zjhC3G4t597u*XEc6s6nFj^Vn#N%iqNrI(AF-CEUxt23l(0-wWG-{5L}y1xgl zhP$4uf7+u`m-j;k4f~b*8pI8(gw94gn@OCT#a(5ht=xZpjE242>TV8`z*6awfV}`+ z=#C2-I`W2^*OeWv-CXf(38xc&5f%nzaa%0Y`*O>Kpz4!0hsCD42qPw1Pt z`cl29{~N=Z1N#(`s9EqWUFS|#o-wld#C~k?MC6C_{3`YSR7#A>96Yzx-qKZ&UqYUzUeGb*)i~eV#iwn47AzG{<=|4%_Amipb~mQ$*Po3>dvLa-2|8y?i?) z*zMx$ed^@ghYf{(nBk)~NsB2x&t4DT;d(-a^dgVyHX&&$U*0WpO06FY86FE7YP&p3 z*;(A6HTYtnL#~86Dbvu{%TZHvXujR@dsK{u8vP})1I>I{LRypV?6fwqW|7AnhriRG zjvR11y*qkGb}+M-8Mfrol5m-egnK~i(8{pz-8;qtk6jjMf8wTDigX9n-}E^6@sQ0I zkZv*MJufcmMS1nnMDCW4{3f;USPbvJ@BXUJ_*ML>-8DbE6Q7=o@xRP@zC)7N{PehU zM}s%{tS@)_W4u_d?EEHj0c@6pAFo$+8G~OB9+PN_f+_dnTVJaF_nQw8qTM zY&3rDOm7a3-Vo~0JEUzByf?eM-jh_D#_Boq3#(44$yklC3+kpf5^L)N*}J2dWxnMF z8s5k`GAMx&km(f^&+NS+w7~Bq?sTjEY2|gSK-b>pcRh^Hzqo6Y)ekbuu@>4kmgU#K z^w&&?K5uG3d3>DqW%sj9O&W(IEdx#odwT9$qPKMs*3fcWuK6N-XV{x>O*Nq*eTWyU z_#<1huJ5>Ieol>R~1T)SJU6P?_KhZSvL-I`0(ld(4Hiju2ZGHaX$h&wL>LNOgJ3M z5MWlkAcdPgH^EBRvri>WgM)F1^nO%zY~>-Hme-!HJ(*dm(k;0nAHyC#WhKSN{@m<4 z=l9ITnw^PFhAjQLR+9+F>D&r|nfrTAjY_0`JQr>1x#jTWfdk_q$qGYLZ<(T-P4X^9 zKab7$Qb*&a)_IEK@;jp|DxBZa*9M#Aza>b_w&>U$PFQshxTWpddal&jsI~8d+PbW% zY19`M5*O10>r#y5Me;way$ed1GhHuMhFkc(<3q%U{b)FK6 z6{9WRzv5>T&s#>H;w^mCdHG_3*)>lujpxa`XD6r+HDn2==yUT|2`9`sOzNeMg@&K{ z;`zfU4_lAb#Fu}?HTnCMSA3N;JnwVmOF_u^ zS8F~yeyckzy{Xa20rRoNRIN6w-e;~@7&x0>;} zY?-g|ROvv=m*OKi3`=>KvOA9wJnhNn1cw-C?gUG?8?dg&AH1{2Qjp7g;0@z$&%NC0 z*4KM#1wThb29)p46%X*fYrLs9ws38#%lwvqg4vayrA-18#{_Rs3tX7BHW?bv{%|tr zCc~%dQwHOgha+ciB$ZrsE{?5kpPs0GA+PJ09q8yR{H)dW{(&#$kLtXVoDRq0FAvK- zby(u4Lm_M_MFYjnxsJ*x4(*oPhsrnk8DN_CVkDoH*9M4L^P-~R5pK~0@kT1B0jpO*&;Il8UwGk&VbVCK)1 z&3%gf;rp%X(Q*3t>{r?4g*W5YrVjrID&}-y-j{RdXHI!$`*2sef8!>)pP>h`VyWnD zZtU@*3S$yA)`!>VbTMhYe#qXi&B9z@JgRa!OV^pqGE}ppgpn!MCDluoe7T(Gl~P}y z(iRzyusDiyWG4GhJ+qh1lRd>q?d9edHrD)eT(;$yVfzI;-V@K2X|ZqUMMWwu)OcU? zdGsk9?v!~ddn|W!oYX4s+dPrmoz(5>FHq_IW1590$P~kx-O9-5l~K}RdpoSbYd*v> zzAN8!*XIsl#`yuWmq$$8T3-1LtcLy!tZ#RvxE8RlLriE~_EK%O!F@v}{amJ724r{g zxSqWY!U?d19(FEPkm?~>UVZ!Z8kXw)d5?NhZ5~sUDkWY|W}0DIR{b`$ zc=MrAv&pygm4-&FuB!hChE62x-dc-*t^14$Ydt@|UAFOAt2b22M};Q7s&pu*$TL1o)YoUCey&$@rF(=Go*-`T)<&V|KT_1aAA>KB0SwBz_=aiR9@?c6#-yuk{zY zvBKpKJC&WDllCM<9=uZ!WWQD_TYj9zBah_bnJLRYn=rY=*sw=!mPh$~a+qCwqW25E zN&o0}=KXk=aQ39~D&tn2mA+^Bs!vlb?G-$dbI-9W9Fs8Vdd;Q3LjTlp$vc3%y@|zt z>g4WYG;w<`#fWfqIXrtiBDJHBC9d*1NuUXJ$Z=jBgOjZd>%q(FT@ItlUq1VvrIL*u zs22CW5GL*YvvBUv)4R@o59J^a$vH`;^yPMM~2 z_q8P(-?d9xT-hI-Udh#aaBJgysQ1K1u^E55#c(x*DRTS$=0Y6i^f3c3?{I?;UmCB7 zL`#Pc&E4cqeW5|dcqSwzA@Y9ly698$XpfI`Ps_>Yt&^x)4zBf(=v6)WHrSUM9!&N8 z>1pK~{i)l-I@=x$?RlKf-QCr826|R+Z~xrk_mJn&c+c%zj~&dCT_=5W90LZWb@N4f z>$6NAO()KTd%KZV+E+~vj9Wf^=t|*I(YC*thk?&y6@?%G(sA<_lvY_`@neVehAJOsF!W5Gqw{x8& zdqzf1t*$9A6kY9j^R$WXHIIdzLsSGO$H+*sx`?Tve_ZsF(?SAmCQN*D=O?lhe%ibp z)d(FC8J1cQsZ#f!4Y`pbJFZ$jvh3l%^X<>BxlHx3cPV>5Igut_8?tselBPgmkSBU4 zdw=4CuS!oSu3X!+Jz-~U&;_cCF7)+HoE$fL;@;^C(1gG2<G$qSRpVW8jQv#0B>6f0pl|D2g_GA`wtlZa(V{=sO$@?Y#6TuDga{N@Kdmr8z7eD?%Ov<#VBmR)ByFl0A$<~LBlJl3C z%uhJmHFZS|n8#aPbfllB*`hu-SF5C9rq)jJj9d+eJj9rwk;Yv8?QL>_FC@(_6Npt=TL*Xnr^#hxI**8y& ztvHB&^X~lqjsA;Q2C0ZQuaRT9L21@w#fHmt{#gpCLPgr)Zf-KizcKQz9)2%JF+J#I zKJn$qqhW?0qEr4ssu?Un4s0D?9V$H1+N*BYEscEKrTwJPXf-6+!eM?^NPLy!c5w+O zb)_E~Cn{Y*J7sI@WPEgYv{c01=On?t zFRbbI+>jmnBzv*o^d6?SUw4K2jZPh*?o`>W-yPkjdWNA)i$(FelnR#R!7ciqOr}!2 z-OVo#wC#CV>{{C`K{ob-R964?(`x+#S8vMgIy`zqom)tlg z|02dR>qVVe`kNW0D?6IPcbIOK?pwOF<>=wo8ziA$BCD9E-AF2rVBaqYE;XyX{A6}3 zjISz}O5y3H&k+Uc4Fyr(t~9;7$u?YcnXJMdJI6(8mdkj=gM#*X1F!PcS54va<1VAP zc0-JqfcOS~+(uOxn$Qc$QO6=CJ>(lgZh2oW~6B7?XDIFuHi`R?OLgR+R@j zGSdmqqL{OI%{_e1X;N^XXUvOP-E$J4=OGT( zvJA}ATfEZWW$4}vbM*1e7F*-@2-f8(+*A3=;Q(LABhRiULbS&Ne6Op~ zE&j0Q96xh?W=^JG+&M9ObmZXqdzqQi>{Z|PZ=0RbX(SPLxgMDrbTj>a*Y0cP;k4@g zPZI*o)tr>g`^-w?I&ZX@8ytDHPi^3qVEv;#=OZj}?dB1rr*pm>%u=fvsU6;0ggdg3 zpcUpAVmW?8jaKmPgjcB+rn|`S`Jo>FljQ;zIbOV?*|Q1rc_cxiU)s4+d{M{qaY5?l zb+`RuyI=cPA6Spt!~J4J4*T$WzOHEY6>*cWs&5za-^nwpK3Tlon<*cR#ge*}&K=h6 zdwslz@vWGZl3&OVFU^y#lgY7xx5~!**4PyHzWq5z8?c<;Q)T=_&#ETVkGYBT8Y@ll zCD-hXt(052EgxHE%)$#h;(VJvaf&6W$Q@p$i(`NU)A`TG8ALQm&(HfxA8&T;6Z-az zPe^|GKu^Qn$jp$B(n9nAk`Y(8%P)y@f%n(;w`20j zHeO^}sZPof+&In`!C7YeN4_&vTnjF5lghTqHxjdwiY%Wwb6>WXue4AeBc&6-)uB*{ z_3F&7e^YM$QSG`(fb?sJ(8~hJlB_+ibeGPvR;hd3SZDBE4ZsaN$}L zYjtU{VL6qGf7b&^EGTLGn+)UWo6jQKA%aZR=ueO|c5IJ=wD@!aLc z*On666%S%hK3={0a#9g{fs>)ft^ea%jYfFcnjf>D>Rmwt7ovy6k6D+PcVvW2_#+s+uj^gxX@RyWPE6GcVTkBzAkM21ZskuKsrU z=X*z&7i_O3R+W9?`tA8=$;jiKoP@unOWBo?UDAw!1QgO$RCX^Dti!%hNeqRrg6n7<+SO z-OOb1^&wrZyXS{!tUfBWkcL=j=-um@?%Iv}VDom<$)AVLYJ4KmGQ4B*&EkjUVJVZ+ zQ|B2DOX=(yPnVD4Kc2gZy-;uBbiK9JW6eIP;3zi@71}2~94<_8T2IIemMi_dP9EM_ zdpWP+=Ck9$$3q3K_}y(}d7C!>D8F-edYW76n$tUzZ?iK2S2SqM?BjWi`_C>}nm;4G zOs_xn_DS>gfji#L#lvFa!rt-PBmKK>_6+AJ-Y`03sl(E5npic={W)*8FV#sfxZJ7s z{YxF$0qRBiBKP__-RviwqSxw4G;;Q&^y(3k&I^`CdxEPP$)F-1331P9drkmT- zGWpVqc^qa9G?X@t?4HpauVd|(p*)o+aHj*aRl_Qt@$G)<)7qQqUAVBLud=icO5M)C zac#uQogDj@4Q|Pt|OGJx!Z(nWM67f@G>qxjBHVUS9OL%aDGZqFnrly3pLg z@|Eo_L1A`+8sEMbJY*x&4=Z_Q?*C)9x7h8KZ{nqoKeXhzE}nbfCh5IwG4u4{9sS~k z$9ELW9p1hCl9aE_%bt3JvnXtQ!twHc4Y5GEkD5oc1=zkcG#4fAE>&1Z(i9wY9ewuD4%k#RcAwzR>DxyR{n${-zDx`{;O_Yt?P0>lGmQ&{B`13OykroQ{yYwy1wsIb#Zze?ZC=;koWopzKIupk763;lCAKMwo(Wm z`{pO~Zs_8zNPOq_Qw}z@%Hf;`b7}8>dbNee?e@e8%(a_a4`;0=&R-JWJxS*3zVKY) z9hua~LB}EI*Bm*_=gt)wnC++WTlc;i(4Trsmi^29$@8m5(fZ^cgD0pHL@gGX-#p3J z;mj8uxo>0Zz;gdxi_~lf_KSFg)iX}nJ;zRS7F-{sX%-Tk7YI03c*>35j~DLbohZGRMmJQ(V1^Zt{6PKEiT{|cr* zRG>^&yfd1aO1iX^coB6zS9RJGMd7c5%KPp{%fdP*k5s@lFi;rp5(-3`JbvS`n|JZ( z*gcX#zD!-&!6}VQeEV8a#t1aDJ zK{d+@F1o5e@0T%25$vT&K%w=lRe}<<@mv(LG3-#rRL7RsP}1gonIx2N1D5+0k+N#4 z#15L{S&7>7kaOqV(mJv~$_o8vsjj&T1Y%~Btcr2F4cwiQNwNR{s+HsW*dw^Kk`VnX zs|oD}apr*oy~Y9%lUZZw<-=yX6Ckt|Za}m-jHL{(V z5QFLo3D$^Wy;ifo@~LS2`J~8GejX)5pmn7^C!vhLzJ7<2$c7`;3gmM5YYw4M5OV8y z`wN|l-fay8;AM`Vnd?g=KH+G722&36^Mzw>tb{=k3`bCHmLc%(A|_nCN&!C|=M6V{ z&t@55;jCUS|0-G3)xh7CWg<++7|JDmS3{_|CvLc*b|pr)cX0|rO8x}l3JOg@kulOr zm6-Wqg-Og?D!|6$^gO@hNvJ#qpWx@DVT8v-BvvF|-#q#%w{!-Z3w88cOFz*t$c5Sq z>+c-U!UOj~Icf$vt+BO=RmPv`A`}W+Piu~Qilr>3vlRbb@8g|S%z5>V7SiP$yOd-3 zS_@y~h*+k?jg5TdwLk_HX0h(%#3j7Rx^?z1FXQy{%zffSf*r5%fxe>IP#~>6w%QIK zIxqTlv5>F4Vd0Ify1CDl4DD}n)nCG4YNEtx&_yUjkZ9my3MyKLVARcPuV1*ZjDpL9 zDUCUKenk~#B$C26ZD#U8s~g@lMUGgrq2uw*W#6V9TnGoX8MqsW3i4m)CVVp8=29~=Xgpp(); zykH?nK1pz?7g!bB&OGFOhBJ0`uec4g8I$UY_)Kuke3V6W-+unW_SQci3zAKhLO7cu z2_x%N040Ers97TqdT&DLlAU&~l@%o#+QVX)xl<%?6+l(L0ej1lI&#QCky$Q%RKmqrtZGj%ID6CWiEICn^EA@e+7wE1} z<8)m&6lC?Xv#HNdtwd9&pItATv!SvzD-y0IM*|c#M@5W+-S?PCI6I5Rrb!qYJU8P zm*Pr8`^}GkO>x>4l9D7H5EEVhc7){t7nn0cNpmsLoM_)6!5b!KQnVNddbG%RR4oRM z$rya446fjr`^$fD=QnCw zRGA=dBY?;OK*H*bLKsI{5s|-y1QWsu+TtYrrg)BxKroEma!{ukI@b0(J>xJY$yly9|xM4iz}29RVr5Pssl^ zKyOU}T;;gQD9(S|@koVxis!$m5m)2q@ZXE=*MH&BAMoh&FSl{;w^*;YpwHpaMn8tz z-)@+H4X^$itoGmU4aF}3@inWl=#v13bdm2i=2h(BtYcx;6@0T_Vw8AH9j5<(?2??7 z!EX1@F_c|!)&UBamN#2yDNMuEYiT#301Y<`}psTy% z$^w+F8*8vd>>RUA@w5Q&dC@u;GAH5aDS~xEKK+)W!JZvO>VZi(vaixNdU1U40*2jT z^f@Y{x(E7Ew{M!=Wv!g>+PfIxQoX4x%rD8Q(spQF-(fO-3Jq|*f)lCXaq)94gSloz zxXCDkx}E`0RqHd|r*Td$v0W2UU79N>R8)?79SP`vc!#w-+G$*EQzkj%;OnS-!^_?> zj#$%}B1;APp8c_!u{YUNHZR!)e;LVnM7I?~ z(a0t&_5k$d>9%JGl!3nbXB-;;9SotZ`N>FZ@p8E!_)0NrQ-1v@yC^Q5Fu<#&N1Pj~ z0{oe}E{#*nyKHIi7L3=xcXS~L@XMwq>fp4L%J9wtzpm%l!MYos_SvBTK*fb);IAkt zllS04N*$iJ+WRs-7WF$-Tx(6p`OUbPKyKtccEL^vtSU$FLxYaN^rbqcvh~FR^}qy& z9!Cw3m&qb;)4yH+I~%*V1moc?45k&9-0N@nNeXtwTVBbx_CZx;I{6c&rLaE>f14-~ zPpyJ+s}SBRINzF>BSF~)>r4YdMco8LmMf}3$=aZXNcsO>(7n@<+ko5^dOk~IYQhO4 zS`Qo(2D^F6O+#gUyWq0jNFWHSh4j@Ib9Mq?a5Q)eM2y5J=wA8nI}8@YErstHP(o=l zK2>_>)0l-nvMDl&>76o3-e(-QP-i*5VvvP%VKF`m{)pDWQ~{#7|7?9qww~zd^ZZrr z)1{BbTTphCb<49Re}k?kpb5SUh5Wh<6A2yiA_8j>79~%<43NU_t`SUwGv@s zb=RdNV#cm9pu#aD@4Rz@uMXtTPWJy2^``XQmB`}uVgD3!_B0br9HYOO#)*Z$u!zH# zSR>t!hN-d!_EG)>KwSAJ^6UI63Q|w=TKtq}yv~v*+u$;Ui7Qo5Kf73oH&v`ZNAFB| za<8g6@v|lMgmLyOy`ShaYn>v4apQA*`n5A6$A9TXn$XpSapR^@ix2$m696inJR%Ta zo+@9iERMiE6-a*Zn^7X(Znd>!iJR4uf0E&TT}z0H@*HVJB@<{8{c|mG5Q%a`fEfXG zjMM3PYFO|8#-OIXzszl{*TkFKZ*>tx-BV~p-2gbLBCWmqE0qzqTM zVEa{A5F)p67#w*ae`$zg z+5%?X9dPc;I&j(z>2WUXM528pN0Mz%4_?bSvna0ON!eLVCZn#vw`+|@;7wyjgaM;6 z6tUH@otlOAS4Q9a2X`-J;&HkBNUT-}^=uH-uA_qmU68os=7G=~Kn(+R0y=e)+AxXM z?_9SRIZ$tGFTMQr1%{&sQ`Iq{B;(ZLlpsj|0fDj#W8lo@`AE)G%aAr4N>0JBJaSa- z{-G+`rs=~tJF?2>I5Lh$w?gAKjg?+jJ7ZneBiH$Q%i!s&ONSn_KG=5t9TztoF@$CD z8UEzT{;G~pk*wdC`58;pYUCUv1Mf&K!D+TUTQ>xyGJ4BAWOn6ossShV?fBc@a;+a5 zSO}Nx;&IBA`1}=Cpj!z`ubUrg`LY0_XRD7sjrOqyWDn&%%CI?oXHcaqYX`rvdT)r4 zYL{hbHNb?qxRSprBX|LITHey+vhIPvROkUE4Prv^%`Mt3vDu4mrd9R4?&&@JOuRc) z@p}CBeKktUL`3mJMYRx|KdtnOcS`*!p}75a%8@_MPsSVM#jgw%tpF9H^&F{~F=%PO zM>y2itDCe)z;jEsr*vyo1&n01le}*n-Mt0fcVm&Kn&h{Z*dOX#I@9fg>e$M;^*ZA; zR<%gyZgDbW^x5avx!e!OZ-2g1yI|Qa$Kg93yDi#YY@1e%+NvibJR2QV*g+xxf6;3# zZ^lIvD&Id~E;Lag2n}{6R3Bb%PXkh~(Iy*sP8X{Cf_mVeD*M@>zA5>n&N|U{zmJvx zidK8QgiDIyUup6*8aMZj|5csyzQ9PuGU}HDDgq?LDmXci1WdSaB3Mac`h=jt@<%Hy zM2N7|R6E)fv-lDA|0T<<=r<2pQb{~MB(8{T;k*U;jK`I2Dp<%rS1>+KKpw)KSH?Zb zxKo>iAKjGuVMd2-umpPqT{70K;;)ZMCML;y>($MqhXe8K%sKhS-=_!2!EIEaUQPgy z33)H9UHtS;b(#5~1EFLncl7mRkbJkJA&#Wl5@!ob%R8rq!^HzYrfgX&vJKM5Y2iLA z#0Vd{XCbppb!od$xzgZ5I2Z-N)kL01HC2wqRTBYR)zVNDE(w}l+v$|5QQcqq^9IJb zD7`Pbz_~NJ<*jdtg123uwEsYA1$X8O&vlck7w$}DD8Q+Z)XNAo_Ea4D2-Dol6aR*e z65-|5i82*RW=L9p4|7m&_MkFJEH#-bDipH%)2n*)kqm*oH10vz(R~4AD7x2n(uWG; zCdn*IhaV6q9psWo!>@c>sBK`n#yytqRa2)7!J@y<6reH^)eNYzy!6N&^Bx+Y^B8wd zU@K73#ue~&d3&&+bb(bOubv2i8%`+9Xt+$CC$5GT8K_Wb>FeYH8o;s|^XtO2w@Ail z%HlpKyH=VKqy^a4d16?ClI_@km-Lq?&lrgh3p$;Zr)p!W)Li$xtnCi-yqyIhyVie! zFRAxCR(5!q#g@SWo~O1=LnLPVSal-$xrjbd53#j`|2w#7NA{HM(TT@NWbO2#;Z6;h zM4zv70N}ZXlA|EF@Ui~kOK8b@JavD){!Jb~bsjAsLTY7f7fx3@tN$REyNRxs4Jt7> zWPqLZRp9>D$h5-gjhle%mI7(Jf@7J5*+t^CFwwf-d8JJT@WhiqDu17n`}Jv5^MS`S{k8dmQ=6Iv z*_3KGCYE}6lP(=3dT<5Y9kjXdWde`)EU@;~H&CnBl~-ZSjIK98o9s8Jpji0ON;o3is!E8UJdTr1{*y zuYLjtbE$}dGHk00x9S@?OPRFgbXW{;yBIEXaRA=kr)!~#!^OEpE#G@(6oM@+>)(RB zZbVJ5!X`XT?L`GRh2n!F-)~94|9N!s^uP1wl5jv=S8wd`M$Y!%WS*a)+P_- z{Hmf|feI6#%D2c=)AB{;+7AF%7G@5;D`sbppFvztug`qon!+r+Ax?76r85FpJt+qK zeQet$ar9snnTcDo#pzwVENApJfFJq(QW@h3)2nd_c!)#$c*Em3t_KX3IHHQJ9OOs( zusscq^mE^hus~`-InKQys{t%gJdGRL*=HI>0ci%iQV$hsrN4>6b?N^N3F59sX8%xy83ebj24X)RxY zLn3v9J=!P|G&NbD8V8wp^V}x*$R_(HPeS5Z+3{9aN;W$DteRi?Ifv=#{6vNt2aLUg zeP`w{RQ!%{Pa7Wrj(aI!CA@Kn+(w6Xi;qlJt_gZo!>#ic<5&mN|7#B^N${eXXtT=Z z+-KAQ*_qm&d1v)Uc@ii@?Fg+^vIEy~8tz!AjSBe^ty{p!MQibCz0LqZV)6GTlAkd6 zD~n|Z9xnVlc_?7`waqHGa?}2q2QtZaO}V;NQ;Gxfvev_Rqi5AwBW=*wJ@Gejn-qti zSWMjr+b>=ngL=5UW2@DxM>n@se)3D7wKo_FzD^!%Q~fpTegT=Mfn7ACW_cq#eGm^`=Qgq4MU^7dC|6M3m?8-vRW4+ZdV{8II+}VYchUwf1t>S0JcAa)LlPj%jnIR2iGPFR39{teP1P`GBZ!$K>K~K zf^xrMAH|dk78H@cGe-5b7uW8+FlfmfF?}1d(zS>xL&G6CK|U$;nUU_o%1SRKifTB4 z)60V)CPE0KLVSAfW%4n@e+g6P<1KU@;GT|R!Re91lvswN7YvlYHBl4 z7Y&DZhcs$3J6Q~8{1KS53xmnmn|8gt0rMyf57DO5H-FRDO2kX=sPhpD%_>C(c^ zuEB}F8@Rj;>H1#L=4&qVjRjV8k`!)$3@cp!V{%*T0X`4i*hJqMw#!C)#sENEn`$N? z);KPCyXkout$=wv!z$co;%WSh~*TZJhz!MiCPcrb@>Q5_!>Ji zjc%Tm1rn@|P3{@#+Z}}S0|D0NkLE#ui*5jJ=5!JpF#A6i%5fG}A-eoT-0mao9`(D7 z%Zi@v+k0h}v~5~4Fz#e)6lMeJ1V3*Q^G`G8Wy&=u<(CgFtQsH5{K=GVoX+dKlV75h zXv{!VA{BOzw5NXj`H-&R{r_||&**i85ya6AR?b5qOY#@$pULm3I?bzdyK`$scG0-Ac zfG}m(O-`xsk9ACU417rR8?bSc1bDoxfc%#YcO74@p#jZea;(|csrm>hk@BGF+>N39zW3dY8O0>t zSrz%=4qrootu22s_t}BBeSTCPEBx3>uW3tAi+}f3n_VSa+>9O?0ZB0kJi}F+{sW(@ zR@}yVqm27Uq|P2%rgsK_;nnnX3|DY1T}Iz0|8?L8_$B`fBhHJy|6BaIQ%lfcf$1e( zd;CumYK~D(Am@giQy_k=f9Wk9)CD)?n1cI&)k3cGvC=UFb8IU1wtrRV`#FMShe=aI zXktA}qMGDq%0)3PRH5+rt87cN@D2$^U64(JZSTF{V$dPbO~$l`4aw08&?9)fA{y-g zxn7E7+(?ZoZ=O^0b4fc?cw$lK)@}M|>*OtP!LrQVog93um_1-YMjzpNt*eWkF0Hdb z;ZIi=C{!&cX;2Zuwxw`{W~yCUQ#Y`_;|uCvMnJ!ID1Iz7m^YL(#&Y7YatT~}t(bTj z6&hUf=F?7ZB~5!Hx|fq$MS2nmM&8Yk z{8Brj;7-m|>Oc#&(%DC(!D>H&B867Qt!zq{cV&{-1R|n>>_0qy!tw+BE&JuMIjhHG z3+NLiDI}r%96ZA_^lce1@7z=k>550j z*v8TTn33^ZYi$klt10-FSvjB4c(Fj=>p%eVAM7ZZYDMtf?` zrPCspg;X`X;&%y|YVim`d1duMu@E!O`@j84%C5f($rwjFn%O<5IoN2}u7ixn87D(G z0GDzl$L7oG^j!OrC1LN^a`ptF;)SwK*xGJ@hg-}e_h-?>DBlGe?wt&UIQ;EW78HUSYf(nwkF>If|&XZ=r9naq7<;? zC!p*PcR)A6%EIhA#Mz#3YxM(S4y7*^8c6-;@vtpBXlefdSL7Ob`fxO+(Y>#T#!6@Gno}+Hb z+UxH2Mp~If$TR+w9}bfT?`NsVFyCOhb_pbODckLoZNu0d5miei&{e}}Ung#IBJ*pt zL-%4Mf5$38sP{7&VB#dwpA>^o*N`J2x80tuH_iHv#y#<46g%u-S`!;JXxSaEv$xatR2JNtt@Y=R3A&)Hj)dC4>X3ddV~cnzq!HE~~v zfGCG^!4ifrWTsZ(IN)q3qxx;&k`FIiKcS3y+-)Ssxac79AF2@U7~kxZCRDg8QQ5V{Yzph)1B@n~+^Yx10Y`1J_+r|5b|bd-v=;k5LZQ ztCrWJxOGA9ACeQ$VeY0|$OB0S`)O#5nQ72_Ea@401VweWXnI@3vmAI9YZ8}$Hh#i*LvRT(Ft!@I(pHfYO{U}i25N+|e zNkIFDYorhj%S^*1BP__7a-;as=i#^TE}YL5we(-}hyv`Ib9KOx;_c1EKg^5u4bXAb zciXn_AZbpu{6pKeC*vO#Ok8hM8>6Q%Ps!bcXcl1@1f1@?U{n$u9c)Ag^U2VgIk&Ep zH5FCyL&4khJ`Y0Y_Zjc;rRT-!7d;Qg`H2iA@hyNMJLY@9&>~iJYdlGnr0h5=oIV6# z;9lnD)h0t89j-NM%tCM~Mn!hO1Jj-9v%_nQmoMBg!Z`9)3P=PWGy{-qHI<6hPDAAH zMhAm#D@gIY^)@ZOA3{yoA`Y>kylAxhp|O2}b|z#@vchf`X2+?k~EwOVcJv7bev42qzA{MXf^qH~>LxJ_niGV@j&PIOPJ73z_i zhH+{Vwq^Wo@ed(|*`{||XCae)=*T!Z*jYoBcg7{AB5E}p@b@g9<%X6q`JyvCk4A> z6V3Sx>~XUSO!MWY&Cik4V&Yga7J$bPLMIw^J3PnR6VSwpGh(0=5dq@o_LHZ&2`_tX z$Rm$AK4?SH%(dhA+#y%Q1ZjW5B<8d)DeraV2F9bISUm)p{~|5y9Ke7bl0X_p%3$m> zXijEujU;;@Bd@-4553~mdycLONa7h=E+l7Eh*MK`)FO2F>209z@T@S@2yO~`mBa>@ z$}xFORA~;yFb6Lim$BH1L$?@e3Z#evJnyEPcl@tHvO{Ns1LH(K!t6QWcGrZ%iWYA`HF)6_M~5Tzk} zIhrmR@v+QmdtK2uNW%W$xw0hsqki2Jln9!Ox}ZkclBXQxWlE#?84b1^*mB;;%^6 zG5ZDnHrno)4>J8U=gkI^$iyov>F^j|!DVe*Yx`8<#*N9EA4()BHcF(Byg~SO)J`lCODJy7z(=Cw-8gU&E$Ru{EExkfzF{EzQ0@g|QeC z6hsOF%-Yufh8-bnb6$)#N>PMG=KEuOVTQBQBJsTTC7@2<;aHm9QYZV|%6SvOzF(EW zs0XMd6z3?0PQe&oL+gCmUxyK`a4g`mqVy1;!`@537SRqsjkrANGgIQbhn-m<%!|v& zNmIW=xQ;oCgVD8!jVV1$V{Z^TQ#OvF%?HmN1}REK-)Pe05oOUDX zI6gGc7pWem^z++%o3aSs8{MSWC=R$2Unkk0MBr9OuJ&Bz-QR%dZveB6afo}82vZpA z;(4|;LWxlr@#6T(<{w$j!XOxU8xw0D+LfxUK+ww4P1!}r%tfEwOtBfEk4cXQyHHq z1iRP%qj~C>5Q%rFeg9m>1ZrB6K}`>MPRH^32MUqowOOQJu9DJ77v39Cdju+ z>Kf>0w<{lJ1i%Q$J*VZzEB`05Q-RI6(Q7k#E*$>FQeZ%FL|DO%j&Y4ZS^?pH*ab-Y zm>2hK{r(PUm)L*os+QH5sB&5g>uD`UbOfmLzv-la?|2?Qxi`*}8b8~Xio~);fP}yo zoO;o2YBAVUvitpg@`H#7`>6MYt(u^dOG*#fPdXA+04NO z>Q+=!c>UxwPVZB)>-rBi4zX%s z2DNsLVd$*yPE3oxX2&mKLCqDJOILrmz=V8Y*5$E5KWJ(lni6pG zw(o+Uib#b>3LsS@hHaNM;%~5u`am)L_+Q{Mc{nje<5Z9iQT&pWuruq;8mBc3eve*! z%S&+CxNncUD=i*sDJ>E0Sck8REOqqT8Mj0p&#U}%~Zc1Cn8ob zQV!tF5Sao0eRaJto>(N&Ghz;vrW6*45k*3CsY{Wvu$aUyLxhtALCySX!g1pJVE1M> zd4z!dBR2rPb5uIA5lA42W0!F2L^+*_;Px4POcqPk@C7^2l}HkWQ*mjy;55QJMAIg8 z-0e&Lss+toS0sPrBxB$n0{gFk^QTlh(uh&~uj=VGffSariqkU%-c=BP7OeSA9Ge08 z-OH$Rd6F2&bRk6F#B-}Hes%m{yttEf`M!1&a|}|ShDcT_z5^!hcufgWL;X(aFfSF& z!gAET5X!;&dgGdRhvF}vt#@DU{L}* zo(yFQs{$+h0_rQbvNdP7I2gHyt`F5wiN&O}vU@q+E^f3NK!33Xyku={3*IilkIN#=SQ3O8U=-MdlCxTXHp*O-Zt$ubt77X?uX0KOx?J@t>&qaY_>s zq_~0sytm4$23N=M#5Io|EVRC_jQ}z7BJG)80hBofEo$ZC7)5hoIY8RDS2XJx#zIqU zUZ%ZPUsg}Zg!-^rnVEa%(lgcj-ulYLpY??%T0__UK)EKwSEl z=owh4N%73#euDDZ8=A-bwQW%;$+<;obI0miP|)!f^ZT~aT$-d{GWOOs^`rgR;`r}J z0RKJy4T*Aoi~%hgkTChBfHH3kZ-p^%`-QjvABChbm{%9b;-Geb@E)?57MT>lV%9i? z++7=Hj(UIp5s!uNdkb%)m{V!+d9Zsa!m%j^;>R^(Gh$1H2x$$-C44&Y5*Fnlvgly{ zE=0O*)FHG@AVhElqaFgUr!G{H2S6<)GunBvWUDl3@iJ$a)K{K%U(P+~`c=)T_a zNQ8(X+@{kk7ujq*an_*zy?Llb%jCr~k8p#jbE{IIuL1{6@Q>e|Y#o?1CIc9^Z5=2% z;d%05Qj7?8_6)dAyp^Ue8$wPqa(ej_Y7lb`aSCLhN zLFA;NFq#mu?*$<2A1W#bkVy+_+@TV5%HaZmib272r*%X@0z zg2NGQsgwwR4`QerbE`o59P%+G8Mmo6M@?_@k#9R)Q7BF5O)|zlWxM+&USdW|YH?4Y zLn`!wt=$gnuT6u-EbA32!~y?fu@>p79LW#Y+xcwpv6Zq+Ob9Z_JCo_*v_t|(IJILsho_moZh(% z?(w?uR9O*sd>kLAa!s6UeoKyX23n3mIMfX7IDA~5*V9#0Klg;Qa&K<5@5hS^*)D*> zIr(jyLO3vN^7uA_$bkP%zC?nUYeB`yEmZkfn|`sPxj7E$*RPerwdvofGa!nMbh7p- z$f<|H3ZuWraYC4ZT`*I?vPr&NZ@_KJ2#5~xpj%JY_G?inB>U#`x=|g}4B1dRh-WXy z7C+v=Wz*t*lZXlW|94ar`!Xm|TRtSVz|pt=h8R1^lJTO&@+GVe;@aGXx@=pB^rRbA z5B8-nahgHUCY==Ge!4c$k}0sijDJAP8iFQ-#=REZxSK6vA7(w^$wqpNRs|Sd>CdS? z;~Fv{!Zm*Q=u-VlcZN=i|9-iyHEcXp$EjVO4xdOL9MT!rdOt@yNOG+5j{daQD+{d^ zz;58ceaOJ-k7oC$qd!v@T(+DxbBCScPkBq;3pc4rcJ&uXDGHm-Ts3g=4K|})iL1#V zd9@p*>_~IsSRBi{|8a`+gE^%5+$qTgWWbaE7{|$TWJeebSjM2OHsNReB0oTfT0je> z7YRkn9gf6qq>0MM2_S)`ej~9>>kaEkn{|P$%GRF>12&mR&cSZ&P@9IHf;4V*W869>_SEGY2(UH7BKzqZx&V6(*$Z z4kJQ8J%t|B{~=`c%s7h<@PJG;>&SVMJ|1J7h}^6+eHWNJRkk#DUQ6Ni@1sEsX)-}F zm7pnV;Njy~Vil08Hg3tL0;Sr1xHbp)ZDZUSb(?)wR)9O4sC9#|MrmY+_cyrk5Jl?T#a&*Kl9SZR5f>6^w2`cr)akmT^u|M@-?_Vis!Q?4diy;X%yJlff zmHQl;kf;s@9cA=`GJu;TzTx?1=xe~*1AaH?{?uj-{@sxEDYmFoHk(A@3h{CP$r5g4$ zYP=m$+f?sFstcj!k@e2F>i7JQioyj$xL*AuMIR_A>df2Kh8h`QH}MnN`9W`KjT%?F z)+DF`d2>Z}&gXmJ!2*4I44K?9t2hwV-NbQ?fO82P^g{A&3L6(QY|-^!4bA4+if*GU zKLSrxJ2yzKj&zAbvv_N7kkoglidM8-e>ulVW{Eczu2rAfuT7q?CngLs&BxiP7}d`; z^G(1yem0-VO1eLj79Pg=RX*>#4vL-m3FFh zg5kruUnAGquUvMiDgAF~f}{w3zrrIarYl|}y3h4YSLxrOa0giPK5yOph1|77Q{%t&=N=qNVX{{2T) zZ6{c67d@m0^J%c-fqJZSMPKR zHuaE3auxELZ@kz+#v@In31W~hMDt5YUM~(-%vm;%MpTY;th+jeOpJ`@S2iKiz^C7}Og>=>`H^xP!f&9@)uA|#(pjdH;%QkhtcJPRFCEf!u6J_u9o zjXtZQyMa@4QH4Wh=e%s)rY{v%-e+Bt0H={%bNh`*16w92^r4Il%t?;hYK*BXD3~UC zf#CB4RweS@*Wz{MhE_+oBv~UTf$ZMzNkA1bERrB>k?^PUVt{!SuPEI-Bo!9*94b*c z^k6JJo_#1hOHs&%8BJl>98(bXGI#No+Wc*`z$??om0SKbx6X(wLMEDz<25%Ycy5R- z+FUB8r8`=ULX{-)of7e~+l0O9yGjs1_q+xn5&i(xOjk|63kaPZeNDiSB|Jt( zj*+-lb+_R{6u&UMQ@yetf=+lzbDJ@%I4}4Z=V{tvW6S0mAWby$Xd)lU6>Ui{(vhgd zsxq2G!|3B_j@4jG((O5IWm9k`@T;bNnuwgDC9o@dS`O^=?+71e(0lCny1ea|Su8g^ zd1zAihRE&n`k1dEPIE*rTMpCngwvln2-o(2xLA>z!lM-4x5kpXQ{FMiAZ3vdbF{oU z_dMxd9Dz|FZeeLJn=!t{YWsx}fwa4~oZJ4}YSNSdmtUC~gimleqZfVE!NKrqE-ZX= z1rqOf81&D<-~Ukt#&&|zK(Z)gHNSuKkScRz#4^OId+1j@ef@7UK|=)5N@;rjUzRGD z_}kycZzu?mfWk9#9wK-WwG2p%x@yGBSBJ1xUDPAlS@Js1n_{SE7q_qqQSv~&Z z&;MfgDC#E{s}cSg0qzc&rt}-H*gLm(ncRn;ewV2IfQtju zS82(%r+7ak@)d+o6F%*uz$x*ihVmg#9Ym?iOv^A9gRpn|%2HK(yLr3so1b9VQVwbR z@FmC&rZ-5~5&tN}CP5$~P`Ldew(1KnC`C*Qj8>u@F!uBMRs2c_{})`5Ow&ZVvK0*O zRPqu48QLqsYf@7k*c&mN5OBU|ET$saJ@sn*MK|EB)M`xQ_MU#zuiAzCP;vWFziKb- zLj9-MKT#*@Aii{;sF3ll>UOcnyWw1tDj3Ket1ya&Bjp6S=1|j6&p&@IFB#!3X;VoA zhI3(-yv2Nv);#0abRlUYv)4QA1cLF@Ez;XfsHbGTye%l5$=%xbYRgn{AP{jOG?z*t zCi=NjcxZ((B@h!A3;Qy0MD_9x;zB0$u*SgehV(H{8ByjW;dH3>Z2)_=IQi4A^XL_& zB0`H*$5ZTxwGi-x6=zZIQ#BH-*y%B3%TY_v(YRcpuYj|F$v__!;z5t2G0z!WN@Eu# zJr=~m{~%L>6{mahVSrJDZ%NSh;N78}uHe_>y{|PB6C%5SHQT&fx`yi~rG^?46JNQm zFx1rUB}${#pXE3DBd$?gR}KB4R7tNh$-Jx)-zYalW6t4En*;D^g(+3C`{uq2eJP3zWKe~G{)r! z@iYLa*Lva->>j`d8_l}kfHY*2xd03!TvLdZXDJD>5x$_|$$isrs3t zaotCkK|ZXkmMid;fArveL^*9q3mj$ZIV#vtku^ju`ns^NV&tE%*PiDYaRugMPK04wg39rM>?Qm!c1G}zS~6C1J)sgWpvk_CD$qp~zo5_zM*<|d z4iPoYher_|qB-%rimEyXUspvX%gFJpX7#)8D~n}Hx(>6yG2rd1|0k;zr_=x0X=83y L0000CLjGoE&y@FX diff --git a/samples/Lua/HelloLua/proj.mac/Icon.icns.REMOVED.git-id b/samples/Lua/HelloLua/proj.mac/Icon.icns.REMOVED.git-id new file mode 100644 index 0000000000..9874ec6979 --- /dev/null +++ b/samples/Lua/HelloLua/proj.mac/Icon.icns.REMOVED.git-id @@ -0,0 +1 @@ +3d09e8fb4f4ca1c1ae7ab0a6948db592c7c3d9a0 \ No newline at end of file diff --git a/samples/Lua/TestLua/proj.mac/Icon.icns b/samples/Lua/TestLua/proj.mac/Icon.icns deleted file mode 100644 index 285dee82b3d3f80acf3c0037b6b6ce35df0e9e5c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 77152 zcmeFZXIxat_Ab0T(TVPcCg&WwF((wvIgtbb0l@$Yf+$9U!rtBFj7Ss^6+xmXS&|aF z0l}Pe9`lUjIL3ZgHO@J6=AQq(U*1pmcR^-g*WPQbTD7Y7s%Jgb0ULvNVx+O_0(MTG zgkcnJ)SEEf@#a<*=Hn~`LW^;F@yiUYEQJKZ+=Qc z@;C=Ct#KBLYV?`;X4u#qA!fFSC$v=LaWrsMs`_?qirQk9g*k`KC#_sfo*6ckVr!*o zZp=~SaF|Yk>zo}H3pfV)h8!M;qew9xD=_6Vb+mO2tr;9eHk(9MpeQIQtLrF7eY@Q^ z*gw=Gx!N@-kqq=bywpD+8SEYKE4bA)B$W>Ib@aj2;qLifao4*CCDMUYOsqAiFMWCN%jT>Ly@S&1;^L0ra@nm@kJ?xIfsBN-+{E3|Q}16qt4&(a zE0u=FhN~T`t-ly|wK93@k*hsXK@kDts@odtvO3};Lz1ubcyISyU*j_;xh`qk@~sDM zbg%O9Se|Ku2@aZLMy?xr`t9vJCPy+o-5q`0S<5H1x7jaSJ$1Rm1aE(jaZ@J8*VowD ztypEb%*Vxf!R$$%1v#ZF?d?{s)HfMtF~)R}I3_)J%QCy=v#d4wn(CHzUVFtcI^W+s zc>Lh$-G}dPJ$?A-@q>5p--l1`J>FjX@zzuPQPjhm_a8pK|NQO}&%9snJbC!&(eUNF z_n+Mg2!9oF@b}wrbGP)um8V-Sd<74j_~qV{N6qIt?-FIQo2MSOuiW+ft*15h%@yJO zr{BMLTAR4!-lIoHYV!1t*VbQ>d!X^%ovh=DV{6(PkOQK&7rwodc!=<=@t&1bpEzcD z;IR+uZWGBd&gsYlW|-mXZTB8TMkFtaV6F9X+~C1lHvQJM$j~^irH&K90~4l9K7M5& zGBP}7?&9^US1+7BVb{5)zOcy1h<%fc$Cz1}t*tC?IFlK^KXikem9CM|%)rRQ<&`_9 zZwUU_irEm-6;R4qAKEDgNKR6pUcO zi4|y=nwmk2Kp?cVG9zc~KJ@A0HnK5DiV>(8n?Rd6TAqa1soPDmPp_InFv~cBhLMrH z$h-G^55C@ge>10SJ;t^W3v_jK zboC6hEjZJkJdZyA{Qi?0Pai%k%1v5i2y2-T7wBqf>*(mSjIsFN$|j$^bLGbM>sRlV zXNba<(6lpH0s{`0$K!JpBeUEw1&oTh7umyqY1ndmjG`(q7YJ~UE{~&%xgK=G z$P9gKcHSJ!kdBd-EHzayLlFS&TtyX%8L@+hX^g{GrL4rp^D&;|YIVN35!@l-Xe;u_ zt8hCIYJ_jurvX;Xa5JWvz>CS$47DoJ)OMeivR)A}M`9GJO8r(10XX${3KmkiERxI|!GV1AP~cRX;c@9hAgK6(j?_53WiF z#8S3ou;)q=lkLQ=2nP4T*{LSbziMC$2QA$sT{e|Jp?*5Pc<~Ro$ZmpJM-d6X7b*Gk5@7| zrI&h!K)hB(^{K{|_H&Z{p>}%Zy$0FmXKe+%rs2LpiCC&tQdW7guBr8G=dfY4?CG~J zf66*K5(Sm{O>Pc$>;35TiNBuFk!!BfRK76 zB&TQPrPT&ad-fD&?Y$>Ao;yME

DIFU*Fwvw&PsdsixNYgCbE#(d^=@ zJ&6K6Ah~Ftfg*`gDEL;`xDF3udR>IR^%=_YK^Ho4eNJ=Gw1X>6TP+ zygb&$dde)f{KfG%PUdrl2ma4r7&R@q;w%_w@9668%P~bN4VxFNLk^I( zNhJ1m_Rh{5v>Y;>FiJq5kxj16xFH`Bb>1o?gN7yu7DIbGJBJl(CmG>Ed{WA1ixsI0 zCd(o)m1S!*wl-HZHMiRnb~-Dac=r2OVl1l3{>|Y!Y&vPmnla-lj#gElZnVekbnTbB zOjPy_T0hTezrW{};0cpwIn3oH9xg{b~m7}?lNm@>u2#zb{P z%>KBzBosCdjv#ya;0|tjC)e=_%96 zWGYMBYRvTIuKs%?A!?Ei9a-YE0=Lsxv2@A2Su<^IY-Y_{xYXHe!(s{&-#&XB{fPbW>7BQy znd0}4?mvAH_lW%X!NVAI@xkp0{28}i-g)*Q_7UarjXU?nk2nvW-Fbdj?eu1zpWc1d!%hk<`2A`ox9#S=+j_b5_Ks5;Sx1>q3~h=`qR90iSO?gZ5*`tIFDhwv!sJWW)RR-!nIICZw*A z?G_f7meg8f3y0g}GdFvFO@C|6{upuE^o!3PJbv^jH@~>3a>|szzR{VRej3eOu{fk? zPQyEt9cN}0WY>%hPCeY3u_55+%w04uXlvoD;!h~QPD#s2tD5dyo13%Jarx?`%F>D$ zr>T=?x*b}4=vUMp6_=QicznfzlZSRLRcC5@z|36*Gk5xej48!m(GB95q_}*4n7M&y z=Bh>I?Um2m1yR;V&)x(BBcq~YQlc~>GFM?t1s>*7unglV(6G6|dX%td*B(9Gzdurp zXIR)}IbzhU1Ew%@Ctln@rp$9TG`)2B`mMVL`}gmQ3Qu)35CtkzGQJ5{q%E+PMPVvS zJ=DZE`mbERLG0Iw+(&5IMXtaU=_dRA!*zK~(i9KjjKOn*gCm#m{kr?2!eX7cn_%WT z?(_Ey3?4sersG_G#kr0i2prLV?WnN0@fz!WcL%w+FLQ#4yJ7(&zN49YKYsh)#_tc= z=YQ;K|I@p&@0GIu+=u^X`gm55Il;RVKz|Hb!GCUI{3!$~s9odZg zyctGgEXxHanuDPRdL^=KFgBk>F^&%kZw<9HXW#t4Pg0+yu-?A0)gOjk2)70`s^EXP_})d;9U zO9ncH6xP5lU!V*yivpcW##n0RX9Ofm3&OGrv{~wa<|#r<0msNn zrdBPe1-GmgC?N%Om&5?{sv{{ISXea)aA>I!@HiOBxZ`z*9!4Tz3~ftcqX08UO;zA8 zKFBZraX!kL0(()KmbtJ28VS%?w`^e^M&>2-Q1oM}D`tw|6dD2ueg@kbp1;SbZVMYN214Pm+Ei5esmWKqomO?WX zGDc=G$QToI|MW@rOG{N%>=ZH?g3Jgcn-XRs=!3{IPe8UZ<>MqRrD^U0jEyb2122S| z)fJUViz(m>wmxz-W-9u5d$zz>C^Y4hV1K-*XTJsX*t+{q+4oO9MJKBdE+K(~So#7O zOB@ss<_Z=T<`x#n`3D6i@Ei|1N?F+{TZ@g2+l0j;{OC!2$;pZXc5HZ(Z2)5=l0S%g zeNbR*!iN2~(uQH#g9%vH%MTOR$iB#ae7{~@SyPqch>!t}QMG_%VuG7SgEr*Sbb*=B zoC7WN&6i}qp4Q{v{UW;%bL9t2l8=2QRW+3dmtx>Ij!6|fXNtp!sW9_WU7xP+eA8U6#2VJVN4`354YW%$P7iwvKu+QJ^j~Q--Lc z?6~s{o}S2gfac|wFFyzw_w$9)6IC^32bWMFKDZVY0*bMTF+7fZL^79;F>VPl zNcN_z`D>Dl_pb4HWo1>>abgTerRiFh2}nl9IH<+{_9!7x)@Q+^)A~>j@m=<^>sJ}{ z7yA(-<9)ePQ4SI+5AT5~g)t4w1friti_LKGx7d;?5SVZ<1|}T*O30``WFMb@iI$Om z{D_t*ed;Q&0PU590V*((TvGrEG2vkW$E)xiz|qrU84ZBa zx9At8A5UseR8>@0mgTL{0y!!cfN)t@6bUGXMuvt2_~G9^WLsLQU>Hq1KhBj@R#sG2o+#X^54}<{7YYp&6pVymj=nx_ zK>X|(@)2&%GzI^V)X#kV_ATM7;+JoqWiL`RF!iE0KfVxOHNM}jI#zk2yu9LQfsZ;B zBl888np8}8j9e69AO=yR?iQIbv`~;FfB5z}@lVB1pZ}0Ong@Sd+?IVN{?z>XYy08y z(z3D>WqGNKAV_J3LOzD6SqcvcMEZo>B;+H)lnoG@5gTUu{HwB$NuM}>{P|IK*K|zL zUiHZ5-#_A?Xn%gYSWCH8ekPk zPmlO13mK*e@UR|@j2R`p`TFhy{u}md{BP>NetEsa@5-ld5AdK{U*G@s+lLSD&K4az zLL8+Y$&YrTM8iU0a!5eY)BQ`7n?zrKC<_T#nE!eZixLP_qyFg}SS!pIaYVZMN*3y9xeP7}d&W1DHidZi@( z_4ikAU*m7E*Ku#u-@g8>>C~UE-o1VG`QgaxH*ep(dH3tn#yoK`?Qj<1ijl-HltNh9 zaa}?#O9TT+7^|8X@nOBTd-VRzO8~K6zIyW-_8l>=)Ly)N^ZGTq^!jJRtG7di1)?Ha zao&NwW^|CoHU()SkT&Wy6c&6F4JrlGEPwz0=`YWpzxd^sH?Mw)f5H6aS<8&wN>siQ4|eu`lXNQN+=s>X(B*Xi{7mlsc; zJ$wG-}k?7%Bu$eXXW$q3bPZ!Cr~l24iA=afn}}$)5UcNT@lzt z7>EpUBUKc}lZ)Ozc?{o=p8s-YUD~r3kJFxDPsLAYkDos7%*+wx^78W1qc-YN#yi-M zF$H5wVU9qggL)^@rx+L-fFLzvF3ixim!ASQ^5D^<=Z_aFrQUn-Am<_V!PCLKOi>Om zJNIC8h0rHyYT>XlFbs6)7}+@c+Z8#Vin_LfKwi1 z-KRge`{de*w5)6*i<6y|DsnXO%kWWvS2J{pqOGN^jmstB`eZIk2RC3D8X76VTn{|| z>@I$XefR#;5>?D7;?~n!cjNBR?%us~`_A3iI|{cS+-^=ico1YB%svo1&j>%d6_$O5 zc`n$dg@bj-Q#5@ZNf|8^8hT8O#Ljwg^UkeXw{JY}oU4rKZM*XL#_fb#dgFD2bhtn7Q$=+NlO#g zB0wOntE8vLgSWb_zP=tC0wVO%E&M9y+LcG$Zj?O(6D`i)xpFP;D*f6uN!#U{SFXie zrCqss@pw`yk;Y5SIJjnd^uhG>b>JvPBo@~sX=#b&-8KNBBxOB)Z8}WN0}n4;y?pt~ z#ryfRt=Dggg|&AsUX8iTymINr%`id#?Tc4pF4HbuzgU%+jHf82CTAqr`KDzgXKn`> zbYqY!0&7Je)<{Z`*Ho!)SN_~M0&BR6_{Jce&vz2gyo`O?L>3kp}R8DcdT zuf$!TUcPWDA(2SpB_>DjNK8peN(+O{JypjN9H60rYl^@HgbrDcN5U~3MIDr)?j5;w zVPyEi(7k-s?0Z8Ou9W5WT^YU*J;FYJWu!`#6w-U+{Dooh2yOVna6@83Od>leF)=A6 zY7r!vd~>;2ktQJ*OX7l5Eeclw64avW(!s%j^MfNnd-^X93=Iu*OV39Sat4MZSEW95 z%&_f-bZ9^{h!0WDw~0=w8=WiQpkwOn8uFIkv<9DPamo(IXl?b-;ejj_p=A3MS2QjIGZ{y^h)u5rbN=) zCzYPd6i3I$Fk@qU)gY+!kW4~-)J$BP0~tE3t{_o6p-0+F^icYn+WLqdqBpunr@Oc7 zd`B2>O5q~K!xy^yx_f%Mr41*$CEd9qB3{gljtMe_w~)2~S*fOmtBd4za<#c&Argxj z=J$1Xi@L~X&vhqvanE(18)&mp7u`BMcVm5jH_^rDZ^*5Zb{!(3;zTS$934EF1&NrY z@Sp(yw=~#%U`FF%z%5VqwV&-EI`Ol~ow|VJ_cv(IX*nw`-+Z9I{cLCF+0Krv)Yk5z zsQpAN&Wa-Nka>_MsF;H^LXD8yrlh5XmM*7VurXTJ*w@R&^R_@9b@= z>1fA0Se@I~=tSkBegBQ9G6@qr?^jkyKT2xh#<;hYKe86)vEw1vmAyw8giI z+M-)IXWEjqhDLj5G}msrp{_n*ukQx zhtEsLnE$mElLsMguxKX*O;Y>|(cyww+SX5+0csTsSBbfUlLR@tqP7FadNmT_` z6~O?BHCS8{8CzV?-aJpY7_S%CaqF9#PaG77hejq8oNQ@4jn~oZ>l*S8G}oVwt>c}p z>!=lbxw$&Jcm?c@2-_bH*l`ZwB zPM?B*ryFb11Kn0GUADq$U07ai(`oz^?ewXVWA&%wPAN6kmnV2kojhUUq$zV(1%!t0 zCHAoP?%nQY4y%to5{~f+6%lxaQ0HkV!NqAwEw!y-7I7^#wfIT;sk)>4-Bzq}!`E=# zoL8-nK2mr3Zp-TDn1 zd^h-P&aNnrKf$diB{q0(@ZIP#XYO41htH@27}9#d*|y!?2)pRd2)raP+`!)&xvhcyH9t~q+_*wK=bV@FDl?OW@! zVg1HUn_cGHOr17!k$X_EzyGGFqOzEyn#W2GZuRpI2==wNF*h+2Oq{cL!Myo%XU+4* zgXvp0Iaz_jwUJkpaAlEPK3h#qT@e-_w-d!jit!_Q#lr+xte1aEnTp1-W;bb!9hX3_7*ULI+oA{ zLWuz9Q&jjW;3S3`2Ubjn;={$F!#YQbV|~|e+T!n^35zHRp%SopwcD~IFe2}$_%OS; zIAzWQ=dail6d1VC-W1XrT>$}`eT+vajXH{@s>XwuUwELX zumCSqEGWtk-LyF<&_NY;^dgLnbntAq?%9=CR6rE63yQKMcI{m&fcXw@Fr1`{>CIiS zc;V7@fm;IBuP`8y$oc|v*jc9vNW7maL@Ep=&^tBi@S!|BpOtqgGi1w_9WLq^B@UyL zD3ry!LicBh@|k%BiD99BdQ=iA7E=L1rpuNuS>mxdV6)FsSh_$i0dPo)0RNX*1sD<| zzr%S%j$(Fh%C_Jg{u5zkz(~>XgJU#?bLjp=Xk_K)#72a`(h6_)cua{oX2pu7E)Yjv z3sqsQH?Ty2RI)$>VhI>oT!jYd9c_65k;Oikl@+&rTj(MNJeq(3#=u-hhz`QlgE?t& zq01mgO~f=vnBsz!E1cGE+PG#mz%(pFgxr{$fzU(&iOUu7L?D;oGgK8}gEu|<;6Xf- zaqwXD&YjzY7%2tg(H8AZ$T*mpc_1q>CK!^{6ikgi*}=il$8Uq{bcipmvAMaKu8M}4 z7@!VABX;7F{>t?W}7395s5O0S#$!%j*H%IF_YcucIw3>hxQ)Tr738SBFDpur}K z5aUq?qO28gOo60iVr6Bj6oaXOXJ&eOInOq>oVv(;3QQ%Yo|);tkg+&$xrm2@0uBjw ztHC0WAB9J!3NU~I#F!x;LCjYCpIwL&MeWZZY#~X;6wCmU9%D+2#sEN3T;{cA(e#Bb zYu7I4!%D0s`Y9i`Oq9!4QRcx=Gw19Rp^_kxV?8QeO;;!s2!)0ai~tB6ihx>RO59>P zj?t9`Rs#5^9E|};tF*>*^(t34m(?zYpqQm+3iuX+TX74LrDc*lX81}<=oO$56cru; zNlW@>b+kOF>4FR^D}9hpC9ld4g{HU^X9mdUS|a(DJg}aO>2CCJTIKBQ;sQH7GNx)Y z3Ra2C$pBWRzyPT5cuI;WqMX7aLPPh2#UxnErE@LDf((R1QOvd<*t0im@BRb6EF4x9 zL&Az=M2o?cSaUbHIjnMYT(v?MRxFmT2``E2SB!OHSiOFS=Af6RzTaN5SDaN+6=(f$9RTvP!oAX1ZWwOtIFfT;)0p_?%lp)`}W=0n-$O-N*-tc zY|TzRv~7Dx$o6gF*khUpf}_khuB?Btnp=$P_or=B(gy0jDEjvx2s63E1Ml zIV;DS4d^zNLMBsaVA;&t6T$ugTebuQZVB3uSS!+o5u%XcElYt>QLqnmS+Hcu(q&U& zSAi)2f+3Q_qzF95&2nLJfsg?5&ej0jpWz#nRpDx(gx+;52!D%dm8Xdf0hhWm}Y3h!(=7Be}RD_6AA!$W_cU~MYL4tyZUeT^YdLF7++K3 zH(6k;r*CQHTG&;NuiHrY>1|r)v2L?>P)Kw9f7{i^JmSSKX2Z2Bl$|D zN&t{Hin5A~$-q-Q#F@{gL9i*#+pxjgXRVLV8V|n^JRvb^lZTg=kB_%ETymW|*L|J$ zdbfqMXU zlmIju#Uu$sk`Y8P4w8)vI9x?2RFN>%`5sah?&?dVkUDIP@!hdvYn(0?xT{qTDm_$z`x+(0uF`CVW9UKW3I=VHSRHP%I+?+ zr`j%c@o-&iJ!8faSEt$52{yPb#d@4B+(rf&e?fohr zi(HglS1-4jK7F3UGU(ilCCg@6+r-RZPKV!ZrcV)Sp)Qg+nh0teg%go1!ssxEtVjnf z3M}JA_RcQO;#Eq{tL9oyn>J&{G;8bWHq)nBPm8f8rcHHoS*Vdk6#%k1nO>>V8DOh#g+5>v3LF;h6xrcD}aWg=fv zFq$&)6Pg;uS&=ozII2tvhJILwXl1I&BEzDqprQeA z$*2)%+)+4@3=K;-d^RK$@H|7ycnmx+ZN{uQ(-J1)lXw%ygJLZu8fql7`2Zat1Ph^U zqYlLlO5{UJ5y6tKVJsvj&?ZhCKYqga*a`IUa417xodZo&Do0iQU(fzEuw+96ZV9k# z*$kRoIYw62w-8#59XEc$1o1e=*s)fYCi)u6kaN+=bgqi33c`DEFaTggG#aS?IP?JH z7H|kfCYuG{K&eHPTOqiDuB57CXo8YvNTiGn^)!{(Xm^BGaWaj`Q&NJg4>m%upChUN zg!@Ki68ab`3nZ$rfuRc$nJgxQ$z;$O3N)0O5hMdNZ(xCD{C&3lOV(PzTkr)h| zPRNB(DDbYqVZ(xxXk-eNN~7TlnshK8Nrk>cdI~<}^HmX-`Cs@c8~Sa??R?8nW$+YJ zVV4rg>x!u8)#T4-_p5@ z=_n}6?Nx%2hoNG!Mu&<4{ROMVP<@C6p(JE1PRGEbWN-m4_W=(@00aQ+w?%S$`M~ei z);8o@VJ$LVrwK!asmx7}Zx4I>rPU3M@r57~nc8mjj6; zu1rNy&KCigGb&0=TT{(S#o)@1KV`>cU;cbG4WlWkakq6E&z z<*3IfiiNzSuC1vH$F)BG{{6SlKYja~M=WWOW++IQLK&$6%2J1}Jyw;56~@z1Td{2>)Jbpi$(jvc6LsTg1_&txyp zBfbp>m4M&=D*N`e3r=Yblt@VuNegh}`v-auBknsPV|`MRnK~N5cFeH+r{sluIt3}EI zqWob02-M#@Zrtu2I3Z<82BZT`CgTh121d?EIRgXI!QKmh%KHB78Xg)blPUrtf4+Ss zOJ(DUuED`G!0#Uz>3S#oZD{yXrIg)&z5`dqm>PIn?_i6RJs`PwvH#C+z2`6V50oRa z{<$n2jEXUr7xsZxNu!h|89IONcPTzlDOHvX_SKp|0*-OU2Q&dgUm|G$ONWOf{R0;z zaD&o-w8sMWMX<1II2XXFxPb;K9onV6{pTgsQstq3dq^E=bQ%?#?AI;@Z`Ml{1_vbF zebW9aDPMBFD<0qzAoVbz3}Jr?1lOa2g0!o*_)F8rQ~)3g~TAuEa)AokZOU5Q+4$q1Zo7xTR&|8BMwMS2Zl~N0Rr$3hSB4O zBjr8!leNi;*qkH1gXL0f5K?=puCBfTq#!Z!K?PgD>1k36$&eHXUNlT;Vv!?^{HMX=c7sMo37zaZl8E#qwtf&9NTT=Rbv9!Fr z=KQNzIuqmA!5N_AFwRnGIY9E&HK^O*KnMo#Ac}MO>;XGtrOLzg9ss`oCy_~Yl*m+4 zb?289J{alR1t(V|N2SIf@kBYm{QvGc3NVN-7+dIiFSs&V${cFn1yk!E{3ibQdu0_> zCACi;?Promygi-6{R2m(HXyMKv05stLFOsccNBBTOu3yX=HR#zR4WJila(Oi=3V<6 z^+_2~pQ?`6y}Ij)AgQ!2sD(PE&bQ4OK41 zIRBk9b)vGO>d3%{GiD^1L=ERfQqs`iA?YNLeDoN|E(I?GBMZU-M32V)XgGkIyI~RS zaE1j#|9@suRaTuSx%g-9IEa4F4g$`6wVWN0E2 z?}QNU>Goz*sQ-;$r3L&da7yXP+ux#@;I|#pfx*6!ki?DRYr!B(-#xddjw|{W1w19I}3S7prmbbrcgLybJ2Tq)I*|@_Boh#J` z*#!kf$oOL=P_jV-3lW1ROFdc|@G~4_eBClwjs6=Gi~PsAV|b-Xd1=@0ZMFa{d9@5k z@=Z7e7bF8Ya^d;;1%+Vyk)z1@KfMpW0q-|7;?0U@&U7}o!qWafu(Py)omEnCqP+CT z;Fl9)m>ADpGO$M#i@(wj;>UvRd3lEl3XuXdyl8Ys1OBh|qq(I%&II~A%Gu)l2WRUu z{-@SY($=1(^_(19Xwavnw*cW6X1kS(}BfV#(ZH-^{=KaZrtIw{S{%FfBnKU7cv9e@!=@m~gE2I3+9Po1t$(gU%Xo8(Nd;9FmR{fp^E9OV@sef%~TfPdH>kuaC4!5q2h%*=yXV0#`&FFbs> z_$V^ItPGq3%i_tC^+nF$bVUDp_crmJ##=e{>)elD-+q0F|Bd=3DrV%J`SQ?|Lcw5< zN9BhPO9ry!;hvEJ^0RV~`+pAa(GsB6$=zR5)gT6tOey-;4=>?l`5XK->CKzy*XnOx z|Jr!!)62JSUjF%D7_Ps5{pLLo!idB4!o&I3K9nMy5>m5GgZ-dH2<}Nu%Q%pkiMjz! zk`Hn*ic;jG%F3E!ez4ZsJpgg|D+=O?#l7OZ{^jLcIL8hrmS4Sj1=snnU%nYAJXBa% zR8W*v{`%PxKrvyF%D=P@WbQBi(sFOb7EPrQ8#Rp2xkQAodvkf-Gl`(SCXU_GWpG=n$_kty}iM7KQ23|%(bJ(j+d5~6*)o=9AEwN{OQvt&qnEFFP_Ff!=8$s;ZKQYw5LyB-mlBV z^HlP43)0J8yxXXVDd_|3U_0192-(PFke`^8oRX53egG*zu_X6X5iCV8+?87mXyi$S z@1Hz+{P6L^r!RnJ_VjuBBMeU0QJ*~OKqNDz?5ytZ=jUM)+!iQc1{K}sL99B6O-M+B zauN6+EQcVK&jGwh8)EeMk!tkb_{lnZ`0&}oMM`ORUp&ZuNPG0)=}>Mak)xcQn|AE+ z=SY?}0v&nOO%57Gl0R5cY?%r(iT@&WjtjZr;3g z{n<}$+N0~Y5^j=j-MtlmlY0AhcX~RJp`4zXl6%?9ETQa>4+S$ThI7IPq-Nj{ktjMQ zHa0#H+yaA$!X$4AW)yNbzaY<79m5=2pIjrZvv1wXkn_|o-M<3-G=*!|Ze71|?OH7S zc55geXwPAIgbq6U>KhU%nQ5m44;gwf?qCH?9D2?b?-_7fO;usr;0*OqXfmY@)u5 zNyBV9hG2)5F3;>EqX5&Q}fKui5~}~{)`7BS1w(;eBmC@*sk3W z2~Xa>csb@0^YX>(H$nxy@;_)7uZ>hCB;hH1D0(KW+?ad-uR3i{!>no`Ng3@2oKTCx zMItdGWuXvCPRUpXGtFR2);1H2WL{UqEp5col!{`p*B3(zv49{He9}*AXgVdqc#Mn4-JTD<0f-|bInM1** z*2C&Nsw6b@ry87y#$$A#N2#!%L5c7U_edp&bQP=={n{^di~H!^u!%i;KqQWhRusqW zuIOIK!Sr$=-5r&`Yj@~gc_&7P1ym$1L_I*|Ded@fNe|IY>1%B56?Nl1(cQXTJ?Dnn zfgo3~NU><7s~2_-UH$bnU6QUG0*8{XA`!FuNY@SnOed~u05qUPcIVFBd-jHg;Sr>L zkvOgdL!Yn!JcNKypv(21Bf4nk&OvT}E~$%iuKTRC)mELjSu|(k>3*V%d9JrEyFzj< zACHO!6imD~``jTRrXA5Sm;w7csWc>H*DksAaNvZ=M>}=_EJDU|_FPS0TW1H}iOGMG z5QDD0uU>mjbEl+i^MSrLpwD%7wjWGxIae69ACHM*M-pN29i3A#4gcn$40#M~581I} z=PqP@7@XeZL*T|NfHm0(KIKSZX_vwqbRJP zvnVnGQQ*SyGgoaf6_-=Pqe8a^L&*@Njygpd>=w_5HNvj|G3y$;np@+~h+3o1Fk9N1 z`tlaUcekFw+prem46C)Jqbxk8`e;SR|H=Gy5k?M>0my09&6Mtiho*r~Ok-CEO``tFpCRcD&uQgkz`v7?#@ z%`Dg-8W9#7!4BWm@Om-EHYvH-4=Nbo?=68_w+3&+cW5B5>^62g z-B#BqZs0c7H=Jo}hMj$DTQh9U@dj4Y>9(}cX1Lxk+TK!~6edmy4~GxV2@Au+i7-}3 z?XN2_CcWr#A1E>eMNmsbnqUB+KYL*S_U*F=>i^H55krn*zHrwvb?Zm$)4xH#K6t=YUcA{1;54c)spxcZ$pWMf%Z`v%kG zlWVj8mcT%8n_LefxP^zUf};wvGTIt)%vLnj)e@()YELy(CHvVgm@{YI68BwMH4Ud= zPhMMFa-=TylyPlsV_jM7YN#~`t;X3p`iF*t^MNY2wes~2sI_NYMw(EdZrbc05CEz` z7sM2b*}Wc`7&axT`Q({U^VsIMDD*fwI;~peuzX{7bv0f^sjjZ7imqf0(&S5K=Y)lx^7P>jym>RR>|cW7kf96O632tFf%A z>d4ytH76j+J{GuaC1`PWCRQ_CS35iSWRzC|r_QvzvNY7$!FBagYp9q_pKfhEZQ@j~ z9Xms|hxi|R6mJN6;Psj&M^)Bu*tiiXf~W`#LZh`aWE)^I=~Gv1*}gT{ujqCR=!%AvJ54$V zbfK#2`i;K6en=Y%jP1dD#)B^Js^VjiwH`ZqQJP0T=#q(4;-FnM^cUF+=) z>xB1^lcW*ojnt7@n4^RWi!yU5{A0^0I^Ay>qG2P7y_Sl>*Wyw zu^6<~38-NU(hCmdlG&X<^#7i|5Um@8!Q~UG4=pNPSa>&i2BaRSI|;!q0%t3i`mCKI@>!5AO8e65wTu zVUzb4=H=kItem{GE%50n4r&-B9_oga`N1J!2l9wqW=?)wNXR-J*g3{RsY%Od!Qut; zT>SjjHbI_iV#&FoNCpJfv#XLyt4E&21sKXF0S-ik;qwl($9vfifG0v3Yp7zc&jm_ueNOG*aL#v!!R=dKqfr+_xtq+$c0Txu~sjE9oTu+z@5SV_BMifkK zV|p4&c9Zas@Cg_crOnAu6=k9lEM0+0qAnrgQenpypR@@+V~VQ4fCeZ`1HXpA41v0_ z*v`?*c~3#GE*!ZLsDmq3G;DuiHTfI`vWiDK9y=y3Uc8b{Ve{1V;OwnXU!4b)2DyI5R3}$Y zdvT5-3R~al(a|x{ z;(gooAvpvYG?t34r7~5Gs%&YX!lGfz4v1qQ@r_!jK;vncm??1BG&oJjV?aF|`l~R} z$=%I8F@+855xi^7V;j%>gpUy-jY>(dJ+>Fwg~J;aUUVqX(HqFqXO#dBr+JFwU`K_E zqjni0-;<~eo{pvI+SJkm8>}o1xr&(00V0|pQufcJF*QsqCx;zA95&g~RGm$O&V%yF ztJk=>Z}rAB$C&{-NM2K22N|3kx|f$s01}5)!#>(BR33XUn@1`4Uh`pbFu=u;INCVw zlaD)@#!@x2aBlk|`#i8}f(2>kP{>E{oavy zyannunWm^VMnCWM*U#TR70t2GRK{#FBO>=jq(s_MIVJ+PXEHb({nTrmAs?I$sudTx zyDhMu>)`1Llx+%i+v$^#-NE4v)N_RKB9ywf*FMgU3aXt};Vv7%>0V9(;9brRiwc7? z9Q!k-j4I}7j-Ajg`}XDg*Q={dbd<5V*^u3aC5RVMl?}&dyho?9-)BrQP(wTrV1>J^ zadvcZUFGa*0fTRwR96G|AOPejS;kxG@)A>bw|%@FAB{FdJDTjSGvP^%!2Nir_nv*p z8-RfgJ9Dn)IIH#_-@g9%^MbR9E{EovwFmf=;`miGC8G&RZ+?9J`r~!#WW%3&wb!{p z>^eHRIA{W4CAb{0XL;=hP=9$%1rGy}cdE+nn*$0c(~6{Ks|J8@hY<&b^}O zDWI23y-~ z|K^91J61PJ{AyFB9PM4FviHyEv^jF4E9{myyXsOf zwsS6Ii|7nDczCpsSb#_WFY#V~N28CvZDbdyS$C~PDn^+mB@fe7BY3}K^V(E&-E^BRIxiO3ZTpHkJ zgqNd2ncTHd%7FqD=+gtQ!kW2A9b$EH$kw2stpQO(U@NQZ;s$EEDm*fC@8SIc zfm?%s%$a$32~AN&9oOgRX{vIWRCrF)ar25L_);S;2NZ>y^Nz_Y81j-=Rn=$(5mhi+ zTI@6JEJ2;4F_>lI5#k@XC2&(}`aeL9@`?s3_JFd<_V$hr^C1_) zW^LKB*&leA8JX6=TvhvBt5IDB+w7F!1ubiDnc8h5Uhzzh61$FR|c$_yJ+D& zXP+6cyE9!9BYm_)?90i|8I{I46aua&bjm#gO6$5uu8p=pZvl z(bup5NV61qqCizJydlu@aFvrYx3;yhPP1aNvDR0Vm)9^c0PIvj&p<^^F-t*GUPemWYOm=Q2tj&X zY<4ExJRMM zB?Ac_g#6k@o7nt-;IHuHKoWD_Bf^Witd zH4RLlxgxcxshNd=yp*(bstk#=bec?xw2X|jjH0QZ{chl#Njc5p37K-DQjt$o6G~xd zkU{=Y=~`iE3UhN~na%J#Mo-Qrt^{#sVq$7)Y^;(cg^^B|5|Ne^moapAm8B;mA&31k z7J9>>94yN7BZq)L2);(zB9wqpfiR;fqE-$<{JcE<-$_t>vQ8XA86T6^@6mF~nAzGu z$)~6Hp1_dssMt6#hV&1VXD5mi#J~h;v=UcMYG7_rY8Gf}Vr*onr=z6_)VUG_wv3Df zxQvq)?h=qe5(?TaJ9Y_6NJ)tBb28FUQ^0d1{4Euepo)g3u7Rvu3 zxCFHLX>cMyOcBm8;^t6Zb)eGK%(BRAhbc@9)jDdb13|98^C2<1C|N) z2AGeike~n`?~d)9+t^rHpt&(T_ojd^Q%Q6P!9qbz%fQUa&bgh34;chJTvb!Y(8S!@ z-pSp2Pe5p7%zkV#tQtBqvj{sCC~&3a`STx)tW7Pz;4Tvs7@AO3i{>RIE-C{4x5S1GBXBk~sLr4052c8fyjD5|Jy1JZ6`>)`C}vo|m_A_nEX zlQuRP!d{SHSbQMkMa-h2laZxqzL@}V(I6NhL?B@+1i4^CMi1%QS<4Y(Bgczkf^9QtRCzl>RLJm zM#Qjmhp-F|jU-4O@$m%Ni5N1Oxmks&RV^R>}#&%n^c6dp%y9h_X;Js_V;$gc*6p|mkU8;Jwm0;xsGsTt`d$;nTDuB}(E zuYGy%Af#<+XKsOma{*^gYGwurjTBRy@g~?<43J?x-4s2XE>4e2SKq)Go+seO9iFz~ zu3{s*if&{B0&&3(@CE-$W8Tmn_fGfZK2F>|Cug?xm=xbWSmTuNW zFjQ#9PJEU`c|TO!4!2#9i}rz}w?8gG1fB|zMggt@Wd}w~NJ>tPkNeOPvJTx0QA5LT z-`Ce(j_O#On46!4O9kBGTiX(|P%bVww_T8gf*c|-uZej2s(f?iyd(8KV@^4t<`p$$*6u!sZ3 zp$AX3ur#;u{RjG0+BF#G=hF1b(#o@?wnfV2CH&&z!a~m?^~$rwmD!cGpV0b>dTnuL z^~EZFe!dk?F?;*Y%ED|fo^>9-^kQXx5gt$1SMRMa&nzzE=N1-P!2UeGC+0YC8}mJQ zmIe5&rN#LLcy+@3vow%&j~s*@~gzC?1<$?8VbAK>tgF7rd!ralRW*0fVi~d`($6hG(8%oE-#?8LEQhV~6Kwm*DVD zqeEU@UYJ{erpw3hj0^ZFBqG3F7l(V-^Vx-kGhlyybqPNUOvh3D7HAv1H0uDDRs!v; z9QkkoynhByxwtStGl!q+03*wj2e$+5EJC229d4{F&!53lEiU4xr{`v8ar1}qEb~h< zSA{lc=S`GUAtxU_g#)1hcTGK+o|&1Qn?HhQS;Wu6BO(uxcBZ8eJ2KJbrOuvL2GL|015R5Qt}1+rinTB6O&~jJpPX7cMwsU4z5CE{ z2)akpZX7op`22hso^Juadcz-4&-(u~Q~ZZ|-bA8vVrJY3%A7L32B zXA(#(SoO~>&L1Mo?arNHI5L>ueHe{!WD{^;)3{mKk8<#$3;5*`7wZ2Od*0+eGP^Y2 zhNpz%yLJ1{ZQNbVDDEE9eOPz!+2akL!69bh*%$CDclSaq_kV*ulQ1}p&%@5g3qwLh z!tFbE2p+r-E<_74J~=TtHI2e>c0Lo&v~tTAZg>B|o_|9B#{V08_I$DmTT?Tv8jLuE z7-Tf}5pd;izC@=G^5uLge$&!}G&slpFYuY=ckmg*lrg?Kw*coGITQK7>K%7e^m2&Q}w>-G2plbsG|)2quPy?*JJ^@c9E2#*cAN=%#0; z0_e&AN91!Vx{5u;)hy309Kh3qCCGULnvJx(K^#bT8>b0G3WOgTesXg5QL7-h{J$rk zb&t+3Pd(B09iLk~0NwrZcwl7c2&Dxu`VhDW`h8Im{WJCe_lO>iK5PqD!T$;Q95A{# ze|-1mF1Y+v5!`YSdQ7oF!k#FW5KwzUn4>tyJ)nE^@X3e|G_v>~lFv*&_=R*fO!cd| zMdI+l-1G?$N?xE}7aaaS2GEuSfjLqm1pCkbjC>};?CyH*iNPdJ;x~@|Jn%OHkOK$r z1MY+t7sVzDO>oftvHMT@_2~aU$Y)0DYryTv9Dh2$P>B}-*CQ?I0@NZ9W&kBezgB=4 z{P)N1q=Vo8$K*4k&n^@J@HT-;v{mAX)cr-m_{8ubR6D>56Ssu6otO>sIsYB&+i%Y! z_B{LoO)f(xzx{?jGd2>@XEFl%?9smfgVVy`XE(Hoi?~bMQOOZ3Fw#QNse5~Pc&yhG zPC@mR&#zv;%6rX^&}Z8LBKq9^Ti46RrpCtK;b+!t*b^%Vfz#cM>)AytFY4P^00@8L z={0<7tO{zF0Dk`P?Bzf3Gs8>N4U+&rf1SJg;w3=QWC(u7)l)arHPk%%@QZ%l2RE%1 zgjqmxoLKsUyTD2G6Ra~qR)p8N3}1=`7S3$`^}p!n?B{e(p8-=%grA=g;pbNXKSR>0 zuA%ZD_}S_D++qc~|HA{DM5sD}DxQlMFW@dw5`*bFZjk=w&}hMq{|bIiStUW8GdI}h zlp4l^wZ#BGBee-KB_jEFn1L*ePf$)kDFVR;v=dap1Y!|kIj#*2p7($WSVAw&#U;2K zCiK!=T}lV|83+HSE|V<5f4G*Go&y051b$6*UC{;s&CNuK(OiVfav5PUPITc;QbQgb zvpbNwJ}nTKtS)jJhcqNqGJbv z0v$eaV8Xd@5sKcBgRb|Fm_jW7BB1drcp#vm?*P4q}L}7ratYM<{l>cBx$qL-~txqI}p%Jm0fwwT0TIP44E8W>9Is?~Aa1l@m1 zKyy5qx>^i;eQ9Y)c|p|%0!@w)J_E1NE5!@IVG|Vw$j75{91z;hp6PSI2;~f1xO^cV zXd#P>{}F+nLkKhl5rNJer+EBmYPh;ErG%xpw5U8^!Mu`yKr_WYUV&SUV#56kC_o@$ zfOAl}5;*6~nLZ~B#^q%1w*1_MnA4D?8AUSVnxQ*pVi zTv`>8f!2Ps1h+`VgjL;86$phnxGp{jn_g!OIaOHC`NK-UKtn4}#6aJh+hCxfmFGVU z^w5*hvGn_tWA`2rdwCKeXy1Y|T*qm1N{sY1{QLrOfk9tF>3)J<2P+M8=>aPk!Su7) zq8L*7?iuLp2@v#vCqU4sv*-Q$_tHl)?ciISZX;Fc?uMVJgg)x<@zfK<7`yKo5@MZj;>_7`j8~ z{CV@iE$IBoePR5@om=U*Dem04n3o9*G$sd^MVp)4jTmUvn{ba=OgMoXAyZFK0gwcU zG{DX?$OwU6pf@=C2;NG0V}pT)54VSJ-bjZ+<(osqR-i{l;oIniV>fTy?k`HuOv_?G zs7UVquFKm=FoKsLzKZcX!DmpngOnJe6oYiRj?>5tVuCPik(ckL4w9qJptn*6Nv>bd z8l=5`>t^kCDlxh}mqxFp4pIa2bmInU44Roim!2JS3}Mi`$KZ{W#ptmMUsng6=!g>` z#PP9XC+%Q#7#sBoy?WzUpU~86FnY!{uB)g~XabRg-e?qh^~HAUkcpc0ce`|lnVervv~}yz-f#;ao_;%AT?Ao z5e^wTax=6YvxPy41a!~U-VFkpo=8CFT)S}o;-$U|h=4wSxjiAHqd7StDGN&*AK$Z} ziDA;Z1h-N}gcw1(2B8cNjf{f7^_UF|Odz03&LaYP2W;2C&j7%KE|rKi=sAD-T7ggJ zMfCApZ|b?tXD@Z2KBGx-iSgLP#DtVYx`c#i1VYmb_dcHkOX&JSD9J)<5~x17MkcV; z?g9XX>7nbe@`1FGK{aE0j$Ha9l4wC-gjV$hnL4G4p#@9AkP!tRTVNw4ngJ$n*& ziV8rP4GfwAVbG~gHdbbqPJS_o`(sk#=nw_{#sl`_!>?z+2ujnGp&B9NIwY&&>UT9X zHHAP?%mxL0?li)kPj;O=+nMKMs-dc;uICU{c>-FUc2S%}81%{XE*AI+0thWG0 zu9Ho1rkeUDIP=Y>h6avFbtg~4E_wXe(G%&%*-jik0WfrsnW6-=sF9Tx7glqRh>ea$ zF!Yh9`&mgbwNHP!57j>rl|K}698eNgmj?X_cjI~hh7Pc(JK53M(b-kEN7DekwQV!d z3Z@2Lz(T{z20D*-q<69b(9njpHa6Fm1t}Ah9%(TdtH|gm+&-GXL(7PTu7VrwBEpR} zlI;kp6e6B3tpuKFKYR$`&_~;kw1t~k*Z_5%Vn;*BDLdG@BOJP&{77qpqaDr(V~SHEg{*ms z0+Y0gZ$v~`_}-?u%pJeXNP-z8=pikVAXcME)l}80Lge_KY;A*WxUIFdy}j7M)ZPZv zZx?r*Cyke<8{n1>fd`MaX0*|?9&Sx@advZY@wCHfk|ViC8K=l7V;mF_9J;4rIvs3P zz};mLUIT1__65Q?K~F`(US-w6$`(y{X!Gc70_?iAwWaw`ON_NGfOT%}CaN+LQu6BN z-oEbcE^)Q(&1o$x&CPA4zOEjgzAgqbJ9&5oM3pqva4L-Q%C4ayA-;8wv2cr1hDUJ$ zIZ^ztsykdUBd`llUwNRS$qa22?F~(7joX^by=+{Z+&!!%Iq47{v6)NKG5}DF4EUyC zQv(puu08?Yx_nzv-!gJ~w%uxQS|}@;1%w9p)ILH)bk*V%ZoYt!&LC=FgrYEXgNAhI z8c(?GvuLQVPp#u@sK+@wx_WvV!f$~niT;CO*YgSRimGf(ucK+m-m^E@j(|hsfb!i+ zxm{5k1WtY55Pz?lhyDy?nA&A{kKSAXAuodj(v5;b@MRe+T;+jK=vb{&Qnx`vSBJZ} zd3!^9X95ikm$%LGz9GRGbp#r^t}H4j)Q%qjNzfHJLF(gB(bZ7bat-tY8rqSZ64SIg zF*`FmKR2ICFb66r7(`g>h87MRNwPdCMmA}KhCW#0@8KO_1_V$Rh8oaK&ET-OG9nJ0 z85ZUauQJ%cp|y3jH0}26@u<413juayWnyL{Ih9TDVLFJGMA03YLSa%?T3|>DICMP_ z&$LxJdwl}j#gL@?i-x8$4~x#MN~xf!sz{Cq_y>m;0)^AU+t>5JbrpE?%?bSDsj1mH zLVg@lc4%V6KnowEnhIDws7g%r+Y_qs4-f4ai-o@~hgdA@a~_`g(|mK6p+B!=Qe4?(yWqk^Fz`cS*92!HKLc)q6*9=W5C@m=|F3ZCD{YM&F($K)v!`<&7(9m0)dmoRF z9tuvrKRX3WHJ3q1F{I#-Im7{EL4hK{hlLdZ@YuO4d4q;d3X3oY$SxJb0X_SmyAnAF zq9i07t{K_I2#C&#)CTn*M@|XfAcs{W0@23CrtZ#RHIT+<@hnKRu@Mk&8k-^H;b&2@ zQW)k5!fXnGnIJ46vRznM7AXa<7W649Mt{spj);>$Kr}fi1qBrij*bm+&m`n}NdzD| zC);NOh=xW~G?f1WqV-J7-E3p)!niP00+K+DVeCerHWa17k%*Ck=K?N+1s3D?K}8bEj)@lTt+bL8`*mRLg!9N2Y@Fz6&Fufa#9Lf zRzXpxOYka!XFm6hxCI1u|HIzwy=D zkF`&&y22bx7^SkrWNczSR+(%wzqtGA`j55s6>n)imQ4^VzffomOIH_5K%ptqM(>P5 zQW=>hWZcoB&rHu|V>OU`PS{s6GIIB8q7Jn2xcJ0`1Z=Sk(Jljrq}1qGIVn2i%=|J{Z&KEU-W*We$&SntL1-&Gd!Xre!&OPY_1suYMh*xxDCg1ffIu?{h*~}V0pFRh zmEOrhM4;8(5dsbE>Jb8M*fETLj`C!>Nh zN6I3$ILSg*bjKzDpkq+AYDiv+1SN}rq|Dx&+`Y1rd~9?eTmk^?fdFVj8~g2K7zUrS zHwSS;%)bN{5CI{Y#*l980e_}r+PVW?qrQWciF8v;9Tt_y1&8>T)f-UIv$FH-+{wei z$^h#J__GB8f93)FnGD032xUO1oe?oj4{7KPISmw~a_kmZz$8=_!0!?n5EKx+x1b2h zg>e)N2r&X6hY{%K>f*hD0k}YcAiwx}L_aeyv9O@6A1-_tMgvbveSJe6Cu?44Htc-v z>Sf#j4M7tiB)#w8hA9cc<=BG?tQqV!fxKW#Eief1=DmB0OXUB>KGOpapbC|dfQ&%> zpI?Ai*0E%`iV>O!Zotp}*4hSoTDG1_u)m9(IFGwb1<3(|eucY1OVGv$`osOPDlBVq ziWXe0Sqy@}%wC_s;#ONhxI=*3Mc4!cfPKb#?)8OwJot}~Z%KC!f}gjNvT@snIqK+W zYnlWj_?gn{+$EGZ#`QB3%peDXOoki?0aA(GnV6i26^Hq3x83UtuSW0$__@JbdN&Wi z&%(9`FC4;pc&GS?`?@>2?{Nz#JDF-GK!l%#oT7e%pUE~mUF?MidP1UoU;uZO9%b}V z_!IT4YU~c2#TMAFckT7^_VDs_^^B`IbG$q;G%D|K&)Mb}XSY-@4R0$ecOOqTA3&eu z_Sl=4ItA^IbT`yc)l$=sv_M_YEjxQI5IZsTAz6j!I4H#@#{5V%c2i=UHk=sb3Z6hd z+j}}Ygrt`@9_c*M(Nvoi=nin^YqqqC!>o`$ljhPu2_pdI2)q%)7>y2(+d0&?!m8#>PK zD^!h@OiD=cMenp@Hgt1!0`%G0$<7)cF>Os$4eXs=oSmFq?R6Bj>|C8~5%>(nwkZnY zipoGf%NqE3z;hVsrpV)vDMva8Os5wF1VV`o=s5(r5d^_oHCXzj7(4WaH5M&LCn&JO z+0!`KJ3!Tqp@N3FJ>LDT}Ho$y@BT1at+%>DP3I*dvUX zG6#`jLp~TlCLjQA)?(>!@#YBi1@hV6-Y&zI+1?t+XMJl28(koub!{!x^E>l|tpcJU$vGC_|bsA;v>&56m;YBb`6jvxUtePST-+Msf-a-3KBm(uL5{)}w(Fbm0w>@ID_2Ekn~3V9_Wo3>BnhrKMA3Nn~Ww zWK(5!Ny{pm`Z)+wLIDS#Z{y)3kYVT`wDcnQ1ErZz)PQ_R1!nt2=ZE^?M>V#3Cvm zP^Uwz4uWQ9XdOXoYQVAsJR9f1k8Toye3k<8SxsBd&_q{GJXexkN>WrrLdVSuq0g{v z3aPbit*G#!9e0G2&_V8BGSG&rHzdnO>{b{y-d_`HMIkcSd4#2HyYy&-_i_pajl&gRB(YxFaPX~2aOi~J# zG{Rmmg@g`6&dMt!1}Lu>kk2?VQedEQ!fGOt%KBDzX4=vO_?bdBsEClYgd{G}1fg^Z zDntlnFT}+puI8mnz%w2MpCrV`K}Udn(V=!q(3lFMo0Mt0fRKm;P6{WXBPj(9lT|de z^^EnEpzjBIg59DW1kYThQRBih8O`cLkvfPq(zMLi+vYUu*nrzzr;i^5)~O1 z9Owr<$K5;}Rk_gvDm<%DF>TuolqV3@z+Y-{bgFj~TF8#ph$mj%YN=9}; zNkw&S15~0A^3q39t2}g4bs_l-ZE@!=T)eO^30I2cOib7x6B!;7=#LCJJK9-Wni?7D zi!i|z1d~EyLP^WYEg&K(4e&D;6Tr{p1o)YjUCzeA$<@o(KPW6JHZeIZ2MpHKH$xsA z!U`kVk15^_2g0VQ=!JtI>~Tga;TB04x8m!4f%dZ4xuRlg9{3+9H- zkkhAe-IRU3=b7O-u@K7xZ6YGWg8bp7KQ0agQ@UDe%1{XbIZb|EPNq#{dB~$U5^-`m zHXZ?CaTy?=we*b5tpTtGNH;PzF(o6fsJyzN1+@i)vjxs_WCwSO=FFMib0PESpg!Vh)KK86^!P>$V*`1%yPU z=<2m6Ff3|+Qfd}*VIzbGl3fTp3UM1ed+yY;FYsE6LaadI{^(ybf`zg$ zHq-;(DFAXUvRhy$Hy6ABiGhZK9EairN1~0INHemsb8+w7B_syavzn%^5wuircK7uU z4v$Gdi&k1y2N8+i`nsBGDvHRH zV!{Ak15nP%nF6m2)ZyCB&C9n7RRW-%-w2KeXF9t9j32rWc{8`D;sA8Uku!PfkUqond0Ne~g|9dB>)v<;;N;AYL11p@SC#`Q_U}ORn5SEZ1b#etuK>S0E zL3~n5W=>vF8JyrK-%iwRz^SOJ4R?eQx_z8%UJtr=`TqL*ynO{}I9y^L7L%BUWhI!5 z-WM4GcgcYPd-wQydwIIUJp_rfbDEP8DmO=U_3*N%pisbj9SGx< zhYNB0;2Ap?OOlwFfyE`}V9DU=5u2ZAfNDJ8IR|AFQA!aqLnz7pE1?c8-B5GDe~Dae z?QKns>qi3D;SIy<@Xy-X`j7Whk;#ckJ#c|TkHNS!2|~V$SPy{m<;1a&@Nn>8H9>rW z$ZBqBTK%;C{64~;qZC7eFc?kP9nlpG_DF%a%QN`7Kkzj_KYCCLo(Kp#HZl*X4N_k0 zApY%_uV23YuYZAwkI%+hHBf$sU>xq(7`%F)um91n?|1V=01ZZ-hvK?~1z1;D+duXN z#=dt#A`%|uA)kQzfD#se_Up&m&(qN21CnagG4FtH|I=STq0f2GZgOa=<2VK9)Sq-d zVX8lWtgn5ogcsawJ4M)${`CA|#y{34;hpa8PyYPmHzxb@>k$T)u78_(IEpzVt4IG% z`)?`_tp4$p|IOg%TQ}bQ_QyZ|@!QP&mp^XwH-q0-Ua$T3$3OmY?bX|Vul?6={@VZJ ztNxF{wZH!V8-M?V!yo_jH~#+ae}6paelz$t{{F__Z{hIAKmLuszw!6SgYGwjf8+0O z{QVXVfBfU$`1>1we>~`ZGx#_D{>I;L;qb>l{*AxC@%P7r?l*&f?{NvyF z`x}3MJm`Ki_&5Ik#@}z@@W(&?jlaL~_s4_oH-mrU?{ED577l;>Or{rV>W*IrM5{^w7B{?qrBt8f3j)qgC0ohtpe)*pQuG#LAL)?dBKr#t-PkJtYF zOu;LU^?cZP-hA&(t42fVK5+Z30kxj9UEB_>Y76Ke+;6>-7O%sJuo6 z&`^YIczXKJI^e}%9O|P;Fb_vS!RT;y?$w7c-`4*3zrK8WyL=~g7ZvJ$`p*{`lVSeF z(YaUu+h4C&9uGD9azlR^RC$iU1o%iQVlb|S@R2Uil81+$CJP#KVz%s!+8-VmF3kg< zF&qE4fdBi$AK9QoNhI;NVFYq2!dTE~Ei5>aI3;MOhS}-kyJs&n)InbmWdvL3yQtY7 zYKa41Fr3f2#kv(n8vO}A3ETfexQ0UO`^I(PA-j;?m+$>%|x}HH=FW{7%`(l`Yg$XO3ShxVM+*p&Ik9 zL(Ec9n{~yvyc_ncP`T$?P06OV>6Hd9eUwBpm;5XyRWtP4>XeB`m%%vO%{Y1OokOc@ zw2b+DI#-_waZ?@(N&VDe{XqBw5DQlEle!R4bAM`(!6Y;>cUVWs0 zkvrD+XftCC#-6`M?I1h5rBOP|8F}Rxz5D{&daKfNFSjeDnMLN$)Hynq3wLTCs#?%s zbt7fm)BAel3N@3BlCsN!%GeVry2@ikQE_i1X(uE`j?u~9TXAp}XVH|C9z%0J+$p{qr2Tpcb|v%eE)m<7e7eN~BBqY} zyixe_?D+hw$3$8j&-q*KlvSkoOZ2?yl3T7b_8)PKvbq*wscy5brjt`js`7nVG3ik2+^SC0!EFQP#qXVQbd;*vQt@I$_aPJ)Hh? ztC-WZb2XTwH}}MxINCZi_m(>?I4NWBfQDz>D)*lNlkjQ)bg@T#9?fm&rLh29Zp}vLr+Zj$+o$$!ajuYwr;PN* z!P~5JorgDPwy%2mROV4|3Huwj%ZNN`y`mfc`mUc5&-KkJ-HoqqwJExqJEc<$gf~TQ ziLH2kp)Fw*!_zkEP=onG5g5#4{%G{-%kZqp5r!+cRK5o|84c%W z?xQ}}V$|;)Et}lt7a7z{rh8w$<9_btSBJSyJY-KT^AI0?J{5FyM{}i~$v34dw$0PA zVi9bC6tW+VRVz*CnW>TljTukmy?l^d(ql~7cI|3fw`fwO-O=0@kJHNm<1H&{vD+ix zjhC3G4t597u*XEc6s6nFj^Vn#N%iqNrI(AF-CEUxt23l(0-wWG-{5L}y1xgl zhP$4uf7+u`m-j;k4f~b*8pI8(gw94gn@OCT#a(5ht=xZpjE242>TV8`z*6awfV}`+ z=#C2-I`W2^*OeWv-CXf(38xc&5f%nzaa%0Y`*O>Kpz4!0hsCD42qPw1Pt z`cl29{~N=Z1N#(`s9EqWUFS|#o-wld#C~k?MC6C_{3`YSR7#A>96Yzx-qKZ&UqYUzUeGb*)i~eV#iwn47AzG{<=|4%_Amipb~mQ$*Po3>dvLa-2|8y?i?) z*zMx$ed^@ghYf{(nBk)~NsB2x&t4DT;d(-a^dgVyHX&&$U*0WpO06FY86FE7YP&p3 z*;(A6HTYtnL#~86Dbvu{%TZHvXujR@dsK{u8vP})1I>I{LRypV?6fwqW|7AnhriRG zjvR11y*qkGb}+M-8Mfrol5m-egnK~i(8{pz-8;qtk6jjMf8wTDigX9n-}E^6@sQ0I zkZv*MJufcmMS1nnMDCW4{3f;USPbvJ@BXUJ_*ML>-8DbE6Q7=o@xRP@zC)7N{PehU zM}s%{tS@)_W4u_d?EEHj0c@6pAFo$+8G~OB9+PN_f+_dnTVJaF_nQw8qTM zY&3rDOm7a3-Vo~0JEUzByf?eM-jh_D#_Boq3#(44$yklC3+kpf5^L)N*}J2dWxnMF z8s5k`GAMx&km(f^&+NS+w7~Bq?sTjEY2|gSK-b>pcRh^Hzqo6Y)ekbuu@>4kmgU#K z^w&&?K5uG3d3>DqW%sj9O&W(IEdx#odwT9$qPKMs*3fcWuK6N-XV{x>O*Nq*eTWyU z_#<1huJ5>Ieol>R~1T)SJU6P?_KhZSvL-I`0(ld(4Hiju2ZGHaX$h&wL>LNOgJ3M z5MWlkAcdPgH^EBRvri>WgM)F1^nO%zY~>-Hme-!HJ(*dm(k;0nAHyC#WhKSN{@m<4 z=l9ITnw^PFhAjQLR+9+F>D&r|nfrTAjY_0`JQr>1x#jTWfdk_q$qGYLZ<(T-P4X^9 zKab7$Qb*&a)_IEK@;jp|DxBZa*9M#Aza>b_w&>U$PFQshxTWpddal&jsI~8d+PbW% zY19`M5*O10>r#y5Me;way$ed1GhHuMhFkc(<3q%U{b)FK6 z6{9WRzv5>T&s#>H;w^mCdHG_3*)>lujpxa`XD6r+HDn2==yUT|2`9`sOzNeMg@&K{ z;`zfU4_lAb#Fu}?HTnCMSA3N;JnwVmOF_u^ zS8F~yeyckzy{Xa20rRoNRIN6w-e;~@7&x0>;} zY?-g|ROvv=m*OKi3`=>KvOA9wJnhNn1cw-C?gUG?8?dg&AH1{2Qjp7g;0@z$&%NC0 z*4KM#1wThb29)p46%X*fYrLs9ws38#%lwvqg4vayrA-18#{_Rs3tX7BHW?bv{%|tr zCc~%dQwHOgha+ciB$ZrsE{?5kpPs0GA+PJ09q8yR{H)dW{(&#$kLtXVoDRq0FAvK- zby(u4Lm_M_MFYjnxsJ*x4(*oPhsrnk8DN_CVkDoH*9M4L^P-~R5pK~0@kT1B0jpO*&;Il8UwGk&VbVCK)1 z&3%gf;rp%X(Q*3t>{r?4g*W5YrVjrID&}-y-j{RdXHI!$`*2sef8!>)pP>h`VyWnD zZtU@*3S$yA)`!>VbTMhYe#qXi&B9z@JgRa!OV^pqGE}ppgpn!MCDluoe7T(Gl~P}y z(iRzyusDiyWG4GhJ+qh1lRd>q?d9edHrD)eT(;$yVfzI;-V@K2X|ZqUMMWwu)OcU? zdGsk9?v!~ddn|W!oYX4s+dPrmoz(5>FHq_IW1590$P~kx-O9-5l~K}RdpoSbYd*v> zzAN8!*XIsl#`yuWmq$$8T3-1LtcLy!tZ#RvxE8RlLriE~_EK%O!F@v}{amJ724r{g zxSqWY!U?d19(FEPkm?~>UVZ!Z8kXw)d5?NhZ5~sUDkWY|W}0DIR{b`$ zc=MrAv&pygm4-&FuB!hChE62x-dc-*t^14$Ydt@|UAFOAt2b22M};Q7s&pu*$TL1o)YoUCey&$@rF(=Go*-`T)<&V|KT_1aAA>KB0SwBz_=aiR9@?c6#-yuk{zY zvBKpKJC&WDllCM<9=uZ!WWQD_TYj9zBah_bnJLRYn=rY=*sw=!mPh$~a+qCwqW25E zN&o0}=KXk=aQ39~D&tn2mA+^Bs!vlb?G-$dbI-9W9Fs8Vdd;Q3LjTlp$vc3%y@|zt z>g4WYG;w<`#fWfqIXrtiBDJHBC9d*1NuUXJ$Z=jBgOjZd>%q(FT@ItlUq1VvrIL*u zs22CW5GL*YvvBUv)4R@o59J^a$vH`;^yPMM~2 z_q8P(-?d9xT-hI-Udh#aaBJgysQ1K1u^E55#c(x*DRTS$=0Y6i^f3c3?{I?;UmCB7 zL`#Pc&E4cqeW5|dcqSwzA@Y9ly698$XpfI`Ps_>Yt&^x)4zBf(=v6)WHrSUM9!&N8 z>1pK~{i)l-I@=x$?RlKf-QCr826|R+Z~xrk_mJn&c+c%zj~&dCT_=5W90LZWb@N4f z>$6NAO()KTd%KZV+E+~vj9Wf^=t|*I(YC*thk?&y6@?%G(sA<_lvY_`@neVehAJOsF!W5Gqw{x8& zdqzf1t*$9A6kY9j^R$WXHIIdzLsSGO$H+*sx`?Tve_ZsF(?SAmCQN*D=O?lhe%ibp z)d(FC8J1cQsZ#f!4Y`pbJFZ$jvh3l%^X<>BxlHx3cPV>5Igut_8?tselBPgmkSBU4 zdw=4CuS!oSu3X!+Jz-~U&;_cCF7)+HoE$fL;@;^C(1gG2<G$qSRpVW8jQv#0B>6f0pl|D2g_GA`wtlZa(V{=sO$@?Y#6TuDga{N@Kdmr8z7eD?%Ov<#VBmR)ByFl0A$<~LBlJl3C z%uhJmHFZS|n8#aPbfllB*`hu-SF5C9rq)jJj9d+eJj9rwk;Yv8?QL>_FC@(_6Npt=TL*Xnr^#hxI**8y& ztvHB&^X~lqjsA;Q2C0ZQuaRT9L21@w#fHmt{#gpCLPgr)Zf-KizcKQz9)2%JF+J#I zKJn$qqhW?0qEr4ssu?Un4s0D?9V$H1+N*BYEscEKrTwJPXf-6+!eM?^NPLy!c5w+O zb)_E~Cn{Y*J7sI@WPEgYv{c01=On?t zFRbbI+>jmnBzv*o^d6?SUw4K2jZPh*?o`>W-yPkjdWNA)i$(FelnR#R!7ciqOr}!2 z-OVo#wC#CV>{{C`K{ob-R964?(`x+#S8vMgIy`zqom)tlg z|02dR>qVVe`kNW0D?6IPcbIOK?pwOF<>=wo8ziA$BCD9E-AF2rVBaqYE;XyX{A6}3 zjISz}O5y3H&k+Uc4Fyr(t~9;7$u?YcnXJMdJI6(8mdkj=gM#*X1F!PcS54va<1VAP zc0-JqfcOS~+(uOxn$Qc$QO6=CJ>(lgZh2oW~6B7?XDIFuHi`R?OLgR+R@j zGSdmqqL{OI%{_e1X;N^XXUvOP-E$J4=OGT( zvJA}ATfEZWW$4}vbM*1e7F*-@2-f8(+*A3=;Q(LABhRiULbS&Ne6Op~ zE&j0Q96xh?W=^JG+&M9ObmZXqdzqQi>{Z|PZ=0RbX(SPLxgMDrbTj>a*Y0cP;k4@g zPZI*o)tr>g`^-w?I&ZX@8ytDHPi^3qVEv;#=OZj}?dB1rr*pm>%u=fvsU6;0ggdg3 zpcUpAVmW?8jaKmPgjcB+rn|`S`Jo>FljQ;zIbOV?*|Q1rc_cxiU)s4+d{M{qaY5?l zb+`RuyI=cPA6Spt!~J4J4*T$WzOHEY6>*cWs&5za-^nwpK3Tlon<*cR#ge*}&K=h6 zdwslz@vWGZl3&OVFU^y#lgY7xx5~!**4PyHzWq5z8?c<;Q)T=_&#ETVkGYBT8Y@ll zCD-hXt(052EgxHE%)$#h;(VJvaf&6W$Q@p$i(`NU)A`TG8ALQm&(HfxA8&T;6Z-az zPe^|GKu^Qn$jp$B(n9nAk`Y(8%P)y@f%n(;w`20j zHeO^}sZPof+&In`!C7YeN4_&vTnjF5lghTqHxjdwiY%Wwb6>WXue4AeBc&6-)uB*{ z_3F&7e^YM$QSG`(fb?sJ(8~hJlB_+ibeGPvR;hd3SZDBE4ZsaN$}L zYjtU{VL6qGf7b&^EGTLGn+)UWo6jQKA%aZR=ueO|c5IJ=wD@!aLc z*On666%S%hK3={0a#9g{fs>)ft^ea%jYfFcnjf>D>Rmwt7ovy6k6D+PcVvW2_#+s+uj^gxX@RyWPE6GcVTkBzAkM21ZskuKsrU z=X*z&7i_O3R+W9?`tA8=$;jiKoP@unOWBo?UDAw!1QgO$RCX^Dti!%hNeqRrg6n7<+SO z-OOb1^&wrZyXS{!tUfBWkcL=j=-um@?%Iv}VDom<$)AVLYJ4KmGQ4B*&EkjUVJVZ+ zQ|B2DOX=(yPnVD4Kc2gZy-;uBbiK9JW6eIP;3zi@71}2~94<_8T2IIemMi_dP9EM_ zdpWP+=Ck9$$3q3K_}y(}d7C!>D8F-edYW76n$tUzZ?iK2S2SqM?BjWi`_C>}nm;4G zOs_xn_DS>gfji#L#lvFa!rt-PBmKK>_6+AJ-Y`03sl(E5npic={W)*8FV#sfxZJ7s z{YxF$0qRBiBKP__-RviwqSxw4G;;Q&^y(3k&I^`CdxEPP$)F-1331P9drkmT- zGWpVqc^qa9G?X@t?4HpauVd|(p*)o+aHj*aRl_Qt@$G)<)7qQqUAVBLud=icO5M)C zac#uQogDj@4Q|Pt|OGJx!Z(nWM67f@G>qxjBHVUS9OL%aDGZqFnrly3pLg z@|Eo_L1A`+8sEMbJY*x&4=Z_Q?*C)9x7h8KZ{nqoKeXhzE}nbfCh5IwG4u4{9sS~k z$9ELW9p1hCl9aE_%bt3JvnXtQ!twHc4Y5GEkD5oc1=zkcG#4fAE>&1Z(i9wY9ewuD4%k#RcAwzR>DxyR{n${-zDx`{;O_Yt?P0>lGmQ&{B`13OykroQ{yYwy1wsIb#Zze?ZC=;koWopzKIupk763;lCAKMwo(Wm z`{pO~Zs_8zNPOq_Qw}z@%Hf;`b7}8>dbNee?e@e8%(a_a4`;0=&R-JWJxS*3zVKY) z9hua~LB}EI*Bm*_=gt)wnC++WTlc;i(4Trsmi^29$@8m5(fZ^cgD0pHL@gGX-#p3J z;mj8uxo>0Zz;gdxi_~lf_KSFg)iX}nJ;zRS7F-{sX%-Tk7YI03c*>35j~DLbohZGRMmJQ(V1^Zt{6PKEiT{|cr* zRG>^&yfd1aO1iX^coB6zS9RJGMd7c5%KPp{%fdP*k5s@lFi;rp5(-3`JbvS`n|JZ( z*gcX#zD!-&!6}VQeEV8a#t1aDJ zK{d+@F1o5e@0T%25$vT&K%w=lRe}<<@mv(LG3-#rRL7RsP}1gonIx2N1D5+0k+N#4 z#15L{S&7>7kaOqV(mJv~$_o8vsjj&T1Y%~Btcr2F4cwiQNwNR{s+HsW*dw^Kk`VnX zs|oD}apr*oy~Y9%lUZZw<-=yX6Ckt|Za}m-jHL{(V z5QFLo3D$^Wy;ifo@~LS2`J~8GejX)5pmn7^C!vhLzJ7<2$c7`;3gmM5YYw4M5OV8y z`wN|l-fay8;AM`Vnd?g=KH+G722&36^Mzw>tb{=k3`bCHmLc%(A|_nCN&!C|=M6V{ z&t@55;jCUS|0-G3)xh7CWg<++7|JDmS3{_|CvLc*b|pr)cX0|rO8x}l3JOg@kulOr zm6-Wqg-Og?D!|6$^gO@hNvJ#qpWx@DVT8v-BvvF|-#q#%w{!-Z3w88cOFz*t$c5Sq z>+c-U!UOj~Icf$vt+BO=RmPv`A`}W+Piu~Qilr>3vlRbb@8g|S%z5>V7SiP$yOd-3 zS_@y~h*+k?jg5TdwLk_HX0h(%#3j7Rx^?z1FXQy{%zffSf*r5%fxe>IP#~>6w%QIK zIxqTlv5>F4Vd0Ify1CDl4DD}n)nCG4YNEtx&_yUjkZ9my3MyKLVARcPuV1*ZjDpL9 zDUCUKenk~#B$C26ZD#U8s~g@lMUGgrq2uw*W#6V9TnGoX8MqsW3i4m)CVVp8=29~=Xgpp(); zykH?nK1pz?7g!bB&OGFOhBJ0`uec4g8I$UY_)Kuke3V6W-+unW_SQci3zAKhLO7cu z2_x%N040Ers97TqdT&DLlAU&~l@%o#+QVX)xl<%?6+l(L0ej1lI&#QCky$Q%RKmqrtZGj%ID6CWiEICn^EA@e+7wE1} z<8)m&6lC?Xv#HNdtwd9&pItATv!SvzD-y0IM*|c#M@5W+-S?PCI6I5Rrb!qYJU8P zm*Pr8`^}GkO>x>4l9D7H5EEVhc7){t7nn0cNpmsLoM_)6!5b!KQnVNddbG%RR4oRM z$rya446fjr`^$fD=QnCw zRGA=dBY?;OK*H*bLKsI{5s|-y1QWsu+TtYrrg)BxKroEma!{ukI@b0(J>xJY$yly9|xM4iz}29RVr5Pssl^ zKyOU}T;;gQD9(S|@koVxis!$m5m)2q@ZXE=*MH&BAMoh&FSl{;w^*;YpwHpaMn8tz z-)@+H4X^$itoGmU4aF}3@inWl=#v13bdm2i=2h(BtYcx;6@0T_Vw8AH9j5<(?2??7 z!EX1@F_c|!)&UBamN#2yDNMuEYiT#301Y<`}psTy% z$^w+F8*8vd>>RUA@w5Q&dC@u;GAH5aDS~xEKK+)W!JZvO>VZi(vaixNdU1U40*2jT z^f@Y{x(E7Ew{M!=Wv!g>+PfIxQoX4x%rD8Q(spQF-(fO-3Jq|*f)lCXaq)94gSloz zxXCDkx}E`0RqHd|r*Td$v0W2UU79N>R8)?79SP`vc!#w-+G$*EQzkj%;OnS-!^_?> zj#$%}B1;APp8c_!u{YUNHZR!)e;LVnM7I?~ z(a0t&_5k$d>9%JGl!3nbXB-;;9SotZ`N>FZ@p8E!_)0NrQ-1v@yC^Q5Fu<#&N1Pj~ z0{oe}E{#*nyKHIi7L3=xcXS~L@XMwq>fp4L%J9wtzpm%l!MYos_SvBTK*fb);IAkt zllS04N*$iJ+WRs-7WF$-Tx(6p`OUbPKyKtccEL^vtSU$FLxYaN^rbqcvh~FR^}qy& z9!Cw3m&qb;)4yH+I~%*V1moc?45k&9-0N@nNeXtwTVBbx_CZx;I{6c&rLaE>f14-~ zPpyJ+s}SBRINzF>BSF~)>r4YdMco8LmMf}3$=aZXNcsO>(7n@<+ko5^dOk~IYQhO4 zS`Qo(2D^F6O+#gUyWq0jNFWHSh4j@Ib9Mq?a5Q)eM2y5J=wA8nI}8@YErstHP(o=l zK2>_>)0l-nvMDl&>76o3-e(-QP-i*5VvvP%VKF`m{)pDWQ~{#7|7?9qww~zd^ZZrr z)1{BbTTphCb<49Re}k?kpb5SUh5Wh<6A2yiA_8j>79~%<43NU_t`SUwGv@s zb=RdNV#cm9pu#aD@4Rz@uMXtTPWJy2^``XQmB`}uVgD3!_B0br9HYOO#)*Z$u!zH# zSR>t!hN-d!_EG)>KwSAJ^6UI63Q|w=TKtq}yv~v*+u$;Ui7Qo5Kf73oH&v`ZNAFB| za<8g6@v|lMgmLyOy`ShaYn>v4apQA*`n5A6$A9TXn$XpSapR^@ix2$m696inJR%Ta zo+@9iERMiE6-a*Zn^7X(Znd>!iJR4uf0E&TT}z0H@*HVJB@<{8{c|mG5Q%a`fEfXG zjMM3PYFO|8#-OIXzszl{*TkFKZ*>tx-BV~p-2gbLBCWmqE0qzqTM zVEa{A5F)p67#w*ae`$zg z+5%?X9dPc;I&j(z>2WUXM528pN0Mz%4_?bSvna0ON!eLVCZn#vw`+|@;7wyjgaM;6 z6tUH@otlOAS4Q9a2X`-J;&HkBNUT-}^=uH-uA_qmU68os=7G=~Kn(+R0y=e)+AxXM z?_9SRIZ$tGFTMQr1%{&sQ`Iq{B;(ZLlpsj|0fDj#W8lo@`AE)G%aAr4N>0JBJaSa- z{-G+`rs=~tJF?2>I5Lh$w?gAKjg?+jJ7ZneBiH$Q%i!s&ONSn_KG=5t9TztoF@$CD z8UEzT{;G~pk*wdC`58;pYUCUv1Mf&K!D+TUTQ>xyGJ4BAWOn6ossShV?fBc@a;+a5 zSO}Nx;&IBA`1}=Cpj!z`ubUrg`LY0_XRD7sjrOqyWDn&%%CI?oXHcaqYX`rvdT)r4 zYL{hbHNb?qxRSprBX|LITHey+vhIPvROkUE4Prv^%`Mt3vDu4mrd9R4?&&@JOuRc) z@p}CBeKktUL`3mJMYRx|KdtnOcS`*!p}75a%8@_MPsSVM#jgw%tpF9H^&F{~F=%PO zM>y2itDCe)z;jEsr*vyo1&n01le}*n-Mt0fcVm&Kn&h{Z*dOX#I@9fg>e$M;^*ZA; zR<%gyZgDbW^x5avx!e!OZ-2g1yI|Qa$Kg93yDi#YY@1e%+NvibJR2QV*g+xxf6;3# zZ^lIvD&Id~E;Lag2n}{6R3Bb%PXkh~(Iy*sP8X{Cf_mVeD*M@>zA5>n&N|U{zmJvx zidK8QgiDIyUup6*8aMZj|5csyzQ9PuGU}HDDgq?LDmXci1WdSaB3Mac`h=jt@<%Hy zM2N7|R6E)fv-lDA|0T<<=r<2pQb{~MB(8{T;k*U;jK`I2Dp<%rS1>+KKpw)KSH?Zb zxKo>iAKjGuVMd2-umpPqT{70K;;)ZMCML;y>($MqhXe8K%sKhS-=_!2!EIEaUQPgy z33)H9UHtS;b(#5~1EFLncl7mRkbJkJA&#Wl5@!ob%R8rq!^HzYrfgX&vJKM5Y2iLA z#0Vd{XCbppb!od$xzgZ5I2Z-N)kL01HC2wqRTBYR)zVNDE(w}l+v$|5QQcqq^9IJb zD7`Pbz_~NJ<*jdtg123uwEsYA1$X8O&vlck7w$}DD8Q+Z)XNAo_Ea4D2-Dol6aR*e z65-|5i82*RW=L9p4|7m&_MkFJEH#-bDipH%)2n*)kqm*oH10vz(R~4AD7x2n(uWG; zCdn*IhaV6q9psWo!>@c>sBK`n#yytqRa2)7!J@y<6reH^)eNYzy!6N&^Bx+Y^B8wd zU@K73#ue~&d3&&+bb(bOubv2i8%`+9Xt+$CC$5GT8K_Wb>FeYH8o;s|^XtO2w@Ail z%HlpKyH=VKqy^a4d16?ClI_@km-Lq?&lrgh3p$;Zr)p!W)Li$xtnCi-yqyIhyVie! zFRAxCR(5!q#g@SWo~O1=LnLPVSal-$xrjbd53#j`|2w#7NA{HM(TT@NWbO2#;Z6;h zM4zv70N}ZXlA|EF@Ui~kOK8b@JavD){!Jb~bsjAsLTY7f7fx3@tN$REyNRxs4Jt7> zWPqLZRp9>D$h5-gjhle%mI7(Jf@7J5*+t^CFwwf-d8JJT@WhiqDu17n`}Jv5^MS`S{k8dmQ=6Iv z*_3KGCYE}6lP(=3dT<5Y9kjXdWde`)EU@;~H&CnBl~-ZSjIK98o9s8Jpji0ON;o3is!E8UJdTr1{*y zuYLjtbE$}dGHk00x9S@?OPRFgbXW{;yBIEXaRA=kr)!~#!^OEpE#G@(6oM@+>)(RB zZbVJ5!X`XT?L`GRh2n!F-)~94|9N!s^uP1wl5jv=S8wd`M$Y!%WS*a)+P_- z{Hmf|feI6#%D2c=)AB{;+7AF%7G@5;D`sbppFvztug`qon!+r+Ax?76r85FpJt+qK zeQet$ar9snnTcDo#pzwVENApJfFJq(QW@h3)2nd_c!)#$c*Em3t_KX3IHHQJ9OOs( zusscq^mE^hus~`-InKQys{t%gJdGRL*=HI>0ci%iQV$hsrN4>6b?N^N3F59sX8%xy83ebj24X)RxY zLn3v9J=!P|G&NbD8V8wp^V}x*$R_(HPeS5Z+3{9aN;W$DteRi?Ifv=#{6vNt2aLUg zeP`w{RQ!%{Pa7Wrj(aI!CA@Kn+(w6Xi;qlJt_gZo!>#ic<5&mN|7#B^N${eXXtT=Z z+-KAQ*_qm&d1v)Uc@ii@?Fg+^vIEy~8tz!AjSBe^ty{p!MQibCz0LqZV)6GTlAkd6 zD~n|Z9xnVlc_?7`waqHGa?}2q2QtZaO}V;NQ;Gxfvev_Rqi5AwBW=*wJ@Gejn-qti zSWMjr+b>=ngL=5UW2@DxM>n@se)3D7wKo_FzD^!%Q~fpTegT=Mfn7ACW_cq#eGm^`=Qgq4MU^7dC|6M3m?8-vRW4+ZdV{8II+}VYchUwf1t>S0JcAa)LlPj%jnIR2iGPFR39{teP1P`GBZ!$K>K~K zf^xrMAH|dk78H@cGe-5b7uW8+FlfmfF?}1d(zS>xL&G6CK|U$;nUU_o%1SRKifTB4 z)60V)CPE0KLVSAfW%4n@e+g6P<1KU@;GT|R!Re91lvswN7YvlYHBl4 z7Y&DZhcs$3J6Q~8{1KS53xmnmn|8gt0rMyf57DO5H-FRDO2kX=sPhpD%_>C(c^ zuEB}F8@Rj;>H1#L=4&qVjRjV8k`!)$3@cp!V{%*T0X`4i*hJqMw#!C)#sENEn`$N? z);KPCyXkout$=wv!z$co;%WSh~*TZJhz!MiCPcrb@>Q5_!>Ji zjc%Tm1rn@|P3{@#+Z}}S0|D0NkLE#ui*5jJ=5!JpF#A6i%5fG}A-eoT-0mao9`(D7 z%Zi@v+k0h}v~5~4Fz#e)6lMeJ1V3*Q^G`G8Wy&=u<(CgFtQsH5{K=GVoX+dKlV75h zXv{!VA{BOzw5NXj`H-&R{r_||&**i85ya6AR?b5qOY#@$pULm3I?bzdyK`$scG0-Ac zfG}m(O-`xsk9ACU417rR8?bSc1bDoxfc%#YcO74@p#jZea;(|csrm>hk@BGF+>N39zW3dY8O0>t zSrz%=4qrootu22s_t}BBeSTCPEBx3>uW3tAi+}f3n_VSa+>9O?0ZB0kJi}F+{sW(@ zR@}yVqm27Uq|P2%rgsK_;nnnX3|DY1T}Iz0|8?L8_$B`fBhHJy|6BaIQ%lfcf$1e( zd;CumYK~D(Am@giQy_k=f9Wk9)CD)?n1cI&)k3cGvC=UFb8IU1wtrRV`#FMShe=aI zXktA}qMGDq%0)3PRH5+rt87cN@D2$^U64(JZSTF{V$dPbO~$l`4aw08&?9)fA{y-g zxn7E7+(?ZoZ=O^0b4fc?cw$lK)@}M|>*OtP!LrQVog93um_1-YMjzpNt*eWkF0Hdb z;ZIi=C{!&cX;2Zuwxw`{W~yCUQ#Y`_;|uCvMnJ!ID1Iz7m^YL(#&Y7YatT~}t(bTj z6&hUf=F?7ZB~5!Hx|fq$MS2nmM&8Yk z{8Brj;7-m|>Oc#&(%DC(!D>H&B867Qt!zq{cV&{-1R|n>>_0qy!tw+BE&JuMIjhHG z3+NLiDI}r%96ZA_^lce1@7z=k>550j z*v8TTn33^ZYi$klt10-FSvjB4c(Fj=>p%eVAM7ZZYDMtf?` zrPCspg;X`X;&%y|YVim`d1duMu@E!O`@j84%C5f($rwjFn%O<5IoN2}u7ixn87D(G z0GDzl$L7oG^j!OrC1LN^a`ptF;)SwK*xGJ@hg-}e_h-?>DBlGe?wt&UIQ;EW78HUSYf(nwkF>If|&XZ=r9naq7<;? zC!p*PcR)A6%EIhA#Mz#3YxM(S4y7*^8c6-;@vtpBXlefdSL7Ob`fxO+(Y>#T#!6@Gno}+Hb z+UxH2Mp~If$TR+w9}bfT?`NsVFyCOhb_pbODckLoZNu0d5miei&{e}}Ung#IBJ*pt zL-%4Mf5$38sP{7&VB#dwpA>^o*N`J2x80tuH_iHv#y#<46g%u-S`!;JXxSaEv$xatR2JNtt@Y=R3A&)Hj)dC4>X3ddV~cnzq!HE~~v zfGCG^!4ifrWTsZ(IN)q3qxx;&k`FIiKcS3y+-)Ssxac79AF2@U7~kxZCRDg8QQ5V{Yzph)1B@n~+^Yx10Y`1J_+r|5b|bd-v=;k5LZQ ztCrWJxOGA9ACeQ$VeY0|$OB0S`)O#5nQ72_Ea@401VweWXnI@3vmAI9YZ8}$Hh#i*LvRT(Ft!@I(pHfYO{U}i25N+|e zNkIFDYorhj%S^*1BP__7a-;as=i#^TE}YL5we(-}hyv`Ib9KOx;_c1EKg^5u4bXAb zciXn_AZbpu{6pKeC*vO#Ok8hM8>6Q%Ps!bcXcl1@1f1@?U{n$u9c)Ag^U2VgIk&Ep zH5FCyL&4khJ`Y0Y_Zjc;rRT-!7d;Qg`H2iA@hyNMJLY@9&>~iJYdlGnr0h5=oIV6# z;9lnD)h0t89j-NM%tCM~Mn!hO1Jj-9v%_nQmoMBg!Z`9)3P=PWGy{-qHI<6hPDAAH zMhAm#D@gIY^)@ZOA3{yoA`Y>kylAxhp|O2}b|z#@vchf`X2+?k~EwOVcJv7bev42qzA{MXf^qH~>LxJ_niGV@j&PIOPJ73z_i zhH+{Vwq^Wo@ed(|*`{||XCae)=*T!Z*jYoBcg7{AB5E}p@b@g9<%X6q`JyvCk4A> z6V3Sx>~XUSO!MWY&Cik4V&Yga7J$bPLMIw^J3PnR6VSwpGh(0=5dq@o_LHZ&2`_tX z$Rm$AK4?SH%(dhA+#y%Q1ZjW5B<8d)DeraV2F9bISUm)p{~|5y9Ke7bl0X_p%3$m> zXijEujU;;@Bd@-4553~mdycLONa7h=E+l7Eh*MK`)FO2F>209z@T@S@2yO~`mBa>@ z$}xFORA~;yFb6Lim$BH1L$?@e3Z#evJnyEPcl@tHvO{Ns1LH(K!t6QWcGrZ%iWYA`HF)6_M~5Tzk} zIhrmR@v+QmdtK2uNW%W$xw0hsqki2Jln9!Ox}ZkclBXQxWlE#?84b1^*mB;;%^6 zG5ZDnHrno)4>J8U=gkI^$iyov>F^j|!DVe*Yx`8<#*N9EA4()BHcF(Byg~SO)J`lCODJy7z(=Cw-8gU&E$Ru{EExkfzF{EzQ0@g|QeC z6hsOF%-Yufh8-bnb6$)#N>PMG=KEuOVTQBQBJsTTC7@2<;aHm9QYZV|%6SvOzF(EW zs0XMd6z3?0PQe&oL+gCmUxyK`a4g`mqVy1;!`@537SRqsjkrANGgIQbhn-m<%!|v& zNmIW=xQ;oCgVD8!jVV1$V{Z^TQ#OvF%?HmN1}REK-)Pe05oOUDX zI6gGc7pWem^z++%o3aSs8{MSWC=R$2Unkk0MBr9OuJ&Bz-QR%dZveB6afo}82vZpA z;(4|;LWxlr@#6T(<{w$j!XOxU8xw0D+LfxUK+ww4P1!}r%tfEwOtBfEk4cXQyHHq z1iRP%qj~C>5Q%rFeg9m>1ZrB6K}`>MPRH^32MUqowOOQJu9DJ77v39Cdju+ z>Kf>0w<{lJ1i%Q$J*VZzEB`05Q-RI6(Q7k#E*$>FQeZ%FL|DO%j&Y4ZS^?pH*ab-Y zm>2hK{r(PUm)L*os+QH5sB&5g>uD`UbOfmLzv-la?|2?Qxi`*}8b8~Xio~);fP}yo zoO;o2YBAVUvitpg@`H#7`>6MYt(u^dOG*#fPdXA+04NO z>Q+=!c>UxwPVZB)>-rBi4zX%s z2DNsLVd$*yPE3oxX2&mKLCqDJOILrmz=V8Y*5$E5KWJ(lni6pG zw(o+Uib#b>3LsS@hHaNM;%~5u`am)L_+Q{Mc{nje<5Z9iQT&pWuruq;8mBc3eve*! z%S&+CxNncUD=i*sDJ>E0Sck8REOqqT8Mj0p&#U}%~Zc1Cn8ob zQV!tF5Sao0eRaJto>(N&Ghz;vrW6*45k*3CsY{Wvu$aUyLxhtALCySX!g1pJVE1M> zd4z!dBR2rPb5uIA5lA42W0!F2L^+*_;Px4POcqPk@C7^2l}HkWQ*mjy;55QJMAIg8 z-0e&Lss+toS0sPrBxB$n0{gFk^QTlh(uh&~uj=VGffSariqkU%-c=BP7OeSA9Ge08 z-OH$Rd6F2&bRk6F#B-}Hes%m{yttEf`M!1&a|}|ShDcT_z5^!hcufgWL;X(aFfSF& z!gAET5X!;&dgGdRhvF}vt#@DU{L}* zo(yFQs{$+h0_rQbvNdP7I2gHyt`F5wiN&O}vU@q+E^f3NK!33Xyku={3*IilkIN#=SQ3O8U=-MdlCxTXHp*O-Zt$ubt77X?uX0KOx?J@t>&qaY_>s zq_~0sytm4$23N=M#5Io|EVRC_jQ}z7BJG)80hBofEo$ZC7)5hoIY8RDS2XJx#zIqU zUZ%ZPUsg}Zg!-^rnVEa%(lgcj-ulYLpY??%T0__UK)EKwSEl z=owh4N%73#euDDZ8=A-bwQW%;$+<;obI0miP|)!f^ZT~aT$-d{GWOOs^`rgR;`r}J z0RKJy4T*Aoi~%hgkTChBfHH3kZ-p^%`-QjvABChbm{%9b;-Geb@E)?57MT>lV%9i? z++7=Hj(UIp5s!uNdkb%)m{V!+d9Zsa!m%j^;>R^(Gh$1H2x$$-C44&Y5*Fnlvgly{ zE=0O*)FHG@AVhElqaFgUr!G{H2S6<)GunBvWUDl3@iJ$a)K{K%U(P+~`c=)T_a zNQ8(X+@{kk7ujq*an_*zy?Llb%jCr~k8p#jbE{IIuL1{6@Q>e|Y#o?1CIc9^Z5=2% z;d%05Qj7?8_6)dAyp^Ue8$wPqa(ej_Y7lb`aSCLhN zLFA;NFq#mu?*$<2A1W#bkVy+_+@TV5%HaZmib272r*%X@0z zg2NGQsgwwR4`QerbE`o59P%+G8Mmo6M@?_@k#9R)Q7BF5O)|zlWxM+&USdW|YH?4Y zLn`!wt=$gnuT6u-EbA32!~y?fu@>p79LW#Y+xcwpv6Zq+Ob9Z_JCo_*v_t|(IJILsho_moZh(% z?(w?uR9O*sd>kLAa!s6UeoKyX23n3mIMfX7IDA~5*V9#0Klg;Qa&K<5@5hS^*)D*> zIr(jyLO3vN^7uA_$bkP%zC?nUYeB`yEmZkfn|`sPxj7E$*RPerwdvofGa!nMbh7p- z$f<|H3ZuWraYC4ZT`*I?vPr&NZ@_KJ2#5~xpj%JY_G?inB>U#`x=|g}4B1dRh-WXy z7C+v=Wz*t*lZXlW|94ar`!Xm|TRtSVz|pt=h8R1^lJTO&@+GVe;@aGXx@=pB^rRbA z5B8-nahgHUCY==Ge!4c$k}0sijDJAP8iFQ-#=REZxSK6vA7(w^$wqpNRs|Sd>CdS? z;~Fv{!Zm*Q=u-VlcZN=i|9-iyHEcXp$EjVO4xdOL9MT!rdOt@yNOG+5j{daQD+{d^ zz;58ceaOJ-k7oC$qd!v@T(+DxbBCScPkBq;3pc4rcJ&uXDGHm-Ts3g=4K|})iL1#V zd9@p*>_~IsSRBi{|8a`+gE^%5+$qTgWWbaE7{|$TWJeebSjM2OHsNReB0oTfT0je> z7YRkn9gf6qq>0MM2_S)`ej~9>>kaEkn{|P$%GRF>12&mR&cSZ&P@9IHf;4V*W869>_SEGY2(UH7BKzqZx&V6(*$Z z4kJQ8J%t|B{~=`c%s7h<@PJG;>&SVMJ|1J7h}^6+eHWNJRkk#DUQ6Ni@1sEsX)-}F zm7pnV;Njy~Vil08Hg3tL0;Sr1xHbp)ZDZUSb(?)wR)9O4sC9#|MrmY+_cyrk5Jl?T#a&*Kl9SZR5f>6^w2`cr)akmT^u|M@-?_Vis!Q?4diy;X%yJlff zmHQl;kf;s@9cA=`GJu;TzTx?1=xe~*1AaH?{?uj-{@sxEDYmFoHk(A@3h{CP$r5g4$ zYP=m$+f?sFstcj!k@e2F>i7JQioyj$xL*AuMIR_A>df2Kh8h`QH}MnN`9W`KjT%?F z)+DF`d2>Z}&gXmJ!2*4I44K?9t2hwV-NbQ?fO82P^g{A&3L6(QY|-^!4bA4+if*GU zKLSrxJ2yzKj&zAbvv_N7kkoglidM8-e>ulVW{Eczu2rAfuT7q?CngLs&BxiP7}d`; z^G(1yem0-VO1eLj79Pg=RX*>#4vL-m3FFh zg5kruUnAGquUvMiDgAF~f}{w3zrrIarYl|}y3h4YSLxrOa0giPK5yOph1|77Q{%t&=N=qNVX{{2T) zZ6{c67d@m0^J%c-fqJZSMPKR zHuaE3auxELZ@kz+#v@In31W~hMDt5YUM~(-%vm;%MpTY;th+jeOpJ`@S2iKiz^C7}Og>=>`H^xP!f&9@)uA|#(pjdH;%QkhtcJPRFCEf!u6J_u9o zjXtZQyMa@4QH4Wh=e%s)rY{v%-e+Bt0H={%bNh`*16w92^r4Il%t?;hYK*BXD3~UC zf#CB4RweS@*Wz{MhE_+oBv~UTf$ZMzNkA1bERrB>k?^PUVt{!SuPEI-Bo!9*94b*c z^k6JJo_#1hOHs&%8BJl>98(bXGI#No+Wc*`z$??om0SKbx6X(wLMEDz<25%Ycy5R- z+FUB8r8`=ULX{-)of7e~+l0O9yGjs1_q+xn5&i(xOjk|63kaPZeNDiSB|Jt( zj*+-lb+_R{6u&UMQ@yetf=+lzbDJ@%I4}4Z=V{tvW6S0mAWby$Xd)lU6>Ui{(vhgd zsxq2G!|3B_j@4jG((O5IWm9k`@T;bNnuwgDC9o@dS`O^=?+71e(0lCny1ea|Su8g^ zd1zAihRE&n`k1dEPIE*rTMpCngwvln2-o(2xLA>z!lM-4x5kpXQ{FMiAZ3vdbF{oU z_dMxd9Dz|FZeeLJn=!t{YWsx}fwa4~oZJ4}YSNSdmtUC~gimleqZfVE!NKrqE-ZX= z1rqOf81&D<-~Ukt#&&|zK(Z)gHNSuKkScRz#4^OId+1j@ef@7UK|=)5N@;rjUzRGD z_}kycZzu?mfWk9#9wK-WwG2p%x@yGBSBJ1xUDPAlS@Js1n_{SE7q_qqQSv~&Z z&;MfgDC#E{s}cSg0qzc&rt}-H*gLm(ncRn;ewV2IfQtju zS82(%r+7ak@)d+o6F%*uz$x*ihVmg#9Ym?iOv^A9gRpn|%2HK(yLr3so1b9VQVwbR z@FmC&rZ-5~5&tN}CP5$~P`Ldew(1KnC`C*Qj8>u@F!uBMRs2c_{})`5Ow&ZVvK0*O zRPqu48QLqsYf@7k*c&mN5OBU|ET$saJ@sn*MK|EB)M`xQ_MU#zuiAzCP;vWFziKb- zLj9-MKT#*@Aii{;sF3ll>UOcnyWw1tDj3Ket1ya&Bjp6S=1|j6&p&@IFB#!3X;VoA zhI3(-yv2Nv);#0abRlUYv)4QA1cLF@Ez;XfsHbGTye%l5$=%xbYRgn{AP{jOG?z*t zCi=NjcxZ((B@h!A3;Qy0MD_9x;zB0$u*SgehV(H{8ByjW;dH3>Z2)_=IQi4A^XL_& zB0`H*$5ZTxwGi-x6=zZIQ#BH-*y%B3%TY_v(YRcpuYj|F$v__!;z5t2G0z!WN@Eu# zJr=~m{~%L>6{mahVSrJDZ%NSh;N78}uHe_>y{|PB6C%5SHQT&fx`yi~rG^?46JNQm zFx1rUB}${#pXE3DBd$?gR}KB4R7tNh$-Jx)-zYalW6t4En*;D^g(+3C`{uq2eJP3zWKe~G{)r! z@iYLa*Lva->>j`d8_l}kfHY*2xd03!TvLdZXDJD>5x$_|$$isrs3t zaotCkK|ZXkmMid;fArveL^*9q3mj$ZIV#vtku^ju`ns^NV&tE%*PiDYaRugMPK04wg39rM>?Qm!c1G}zS~6C1J)sgWpvk_CD$qp~zo5_zM*<|d z4iPoYher_|qB-%rimEyXUspvX%gFJpX7#)8D~n}Hx(>6yG2rd1|0k;zr_=x0X=83y L0000CLjGoE&y@FX diff --git a/samples/Lua/TestLua/proj.mac/Icon.icns.REMOVED.git-id b/samples/Lua/TestLua/proj.mac/Icon.icns.REMOVED.git-id new file mode 100644 index 0000000000..9874ec6979 --- /dev/null +++ b/samples/Lua/TestLua/proj.mac/Icon.icns.REMOVED.git-id @@ -0,0 +1 @@ +3d09e8fb4f4ca1c1ae7ab0a6948db592c7c3d9a0 \ No newline at end of file From 8f9756f0302110ec337e07874b2d7b763cc47c93 Mon Sep 17 00:00:00 2001 From: minggo Date: Thu, 17 Oct 2013 11:28:57 +0800 Subject: [PATCH 52/64] issue #2905:TestJavascript build ok on Android --- .../project.pbxproj.REMOVED.git-id | 2 +- cocos/gui/Android.mk | 2 +- cocos/network/Android.mk | 2 +- .../scripting/javascript/bindings/Android.mk | 34 +++++++++++++++---- .../javascript/bindings/ScriptingCore.cpp | 2 +- .../javascript/bindings/XMLHTTPRequest.cpp | 2 +- .../cocos2d_specifics.cpp.REMOVED.git-id | 2 +- .../bindings/js_bindings_chipmunk_manual.cpp | 2 +- .../bindings/js_bindings_system_functions.cpp | 2 +- .../js_bindings_system_registration.cpp | 2 +- .../jsb_cocos2dx_extension_manual.cpp | 2 +- .../javascript/bindings/jsb_websocket.cpp | 2 +- cocos/storage/local-storage/Android.mk | 13 ++++--- .../spidermonkey/prebuilt/android/Android.mk | 4 +-- .../websockets/prebuilt/android/Android.mk | 2 +- samples/Cpp/TestCpp/Android.mk | 4 +-- .../proj.android/build_native.sh | 4 +-- .../proj.android/jni/Android.mk | 14 ++------ 18 files changed, 57 insertions(+), 40 deletions(-) diff --git a/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id b/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id index 81b945434f..e48cb4ba94 100644 --- a/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -7658fe75258895d82e9432317ff63b182547bcdc \ No newline at end of file +9fac2ba89faf5e6f3c870c02f5186641e6be1590 \ No newline at end of file diff --git a/cocos/gui/Android.mk b/cocos/gui/Android.mk index 197a65f3ad..31edffec85 100644 --- a/cocos/gui/Android.mk +++ b/cocos/gui/Android.mk @@ -1,7 +1,7 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) -LOCAL_MODULE := gui_static +LOCAL_MODULE := cocos_gui_static LOCAL_MODULE_FILENAME := libgui diff --git a/cocos/network/Android.mk b/cocos/network/Android.mk index 1e739f3d69..d2f83a52dc 100644 --- a/cocos/network/Android.mk +++ b/cocos/network/Android.mk @@ -1,7 +1,7 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) -LOCAL_MODULE := network_static +LOCAL_MODULE := cocos_network_static LOCAL_MODULE_FILENAME := libnetwork diff --git a/cocos/scripting/javascript/bindings/Android.mk b/cocos/scripting/javascript/bindings/Android.mk index 2aca99df10..7482cdef26 100644 --- a/cocos/scripting/javascript/bindings/Android.mk +++ b/cocos/scripting/javascript/bindings/Android.mk @@ -2,9 +2,9 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) -LOCAL_MODULE := scriptingcore-spidermonkey +LOCAL_MODULE := cocos_jsb_static -LOCAL_MODULE_FILENAME := libscriptingcore-spidermonkey +LOCAL_MODULE_FILENAME := libcocos2dxjsb LOCAL_SRC_FILES := ScriptingCore.cpp \ cocos2d_specifics.cpp \ @@ -34,18 +34,40 @@ LOCAL_EXPORT_CFLAGS := -DCOCOS2D_JAVASCRIPT LOCAL_C_INCLUDES := $(LOCAL_PATH) \ $(LOCAL_PATH)/../../../CocosDenshion/include \ - $(LOCAL_PATH)/../../auto-generated/js-bindings + $(LOCAL_PATH)/../../auto-generated/js-bindings \ + $(LOCAL_PATH)/../../../../extensions \ + $(LOCAL_PATH)/../../../editor-support/cocostudio LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) \ - $(LOCAL_PATH)/../../auto-generated/js-bindings + $(LOCAL_PATH)/../../auto-generated/js-bindings -LOCAL_WHOLE_STATIC_LIBRARIES := spidermonkey_static +LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static +LOCAL_WHOLE_STATIC_LIBRARIES += spidermonkey_static LOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocosbuilder_static +LOCAL_WHOLE_STATIC_LIBRARIES += spine_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocos_network_static +LOCAL_WHOLE_STATIC_LIBRARIES += chipmunk_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocos_localstorage_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocostudio_static +LOCAL_WHOLE_STATIC_LIBRARIES += websockets_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocos_gui_static LOCAL_LDLIBS := -landroid LOCAL_LDLIBS += -llog include $(BUILD_STATIC_LIBRARY) -$(call import-module,scripting/javascript/spidermonkey-android) +$(call import-module,spidermonkey/prebuilt/android) $(call import-module,extensions) +$(call import-module,2d) +$(call import-module,extensions) +$(call import-module,editor-support/cocosbuilder) +$(call import-module,editor-support/spine) +$(call import-module,network) +$(call import-module,chipmunk) +$(call import-module,storage/local-storage) +$(call import-module,editor-support/cocostudio) +$(call import-module,websockets/prebuilt/android) +$(call import-module,gui) diff --git a/cocos/scripting/javascript/bindings/ScriptingCore.cpp b/cocos/scripting/javascript/bindings/ScriptingCore.cpp index 101005be60..c4603fc8c0 100644 --- a/cocos/scripting/javascript/bindings/ScriptingCore.cpp +++ b/cocos/scripting/javascript/bindings/ScriptingCore.cpp @@ -16,7 +16,7 @@ #include "ScriptingCore.h" #include "jsdbgapi.h" #include "cocos2d.h" -#include "LocalStorage.h" +#include "local-storage/LocalStorage.h" #include "cocos2d_specifics.hpp" #include "js_bindings_config.h" // for debug socket diff --git a/cocos/scripting/javascript/bindings/XMLHTTPRequest.cpp b/cocos/scripting/javascript/bindings/XMLHTTPRequest.cpp index 2230a4a94d..cc7b72c586 100644 --- a/cocos/scripting/javascript/bindings/XMLHTTPRequest.cpp +++ b/cocos/scripting/javascript/bindings/XMLHTTPRequest.cpp @@ -67,7 +67,7 @@ void MinXmlHttpRequest::_gotHeader(string header) { // Seems like we have the response Code! Parse it and check for it. char * pch; - std::strcpy(cstr, header.c_str()); + strcpy(cstr, header.c_str()); pch = strtok(cstr," "); while (pch != NULL) diff --git a/cocos/scripting/javascript/bindings/cocos2d_specifics.cpp.REMOVED.git-id b/cocos/scripting/javascript/bindings/cocos2d_specifics.cpp.REMOVED.git-id index 0204ef566e..b8cda9a498 100644 --- a/cocos/scripting/javascript/bindings/cocos2d_specifics.cpp.REMOVED.git-id +++ b/cocos/scripting/javascript/bindings/cocos2d_specifics.cpp.REMOVED.git-id @@ -1 +1 @@ -2641da58037c13f92ae771830a1fdf943e4964d2 \ No newline at end of file +bf994ad1fc8ac1044957d83708f7848e99ca59e6 \ No newline at end of file diff --git a/cocos/scripting/javascript/bindings/js_bindings_chipmunk_manual.cpp b/cocos/scripting/javascript/bindings/js_bindings_chipmunk_manual.cpp index 6233ae2553..14a88c87bb 100644 --- a/cocos/scripting/javascript/bindings/js_bindings_chipmunk_manual.cpp +++ b/cocos/scripting/javascript/bindings/js_bindings_chipmunk_manual.cpp @@ -22,7 +22,7 @@ * THE SOFTWARE. */ -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" #include "js_bindings_config.h" #ifdef JSB_INCLUDE_CHIPMUNK diff --git a/cocos/scripting/javascript/bindings/js_bindings_system_functions.cpp b/cocos/scripting/javascript/bindings/js_bindings_system_functions.cpp index 1cb171224b..7d1a819fc8 100644 --- a/cocos/scripting/javascript/bindings/js_bindings_system_functions.cpp +++ b/cocos/scripting/javascript/bindings/js_bindings_system_functions.cpp @@ -7,7 +7,7 @@ #include "js_bindings_config.h" //#ifdef JSB_INCLUDE_SYSTEM -#include "LocalStorage.h" +#include "local-storage/LocalStorage.h" #include "jsfriendapi.h" #include "js_bindings_config.h" diff --git a/cocos/scripting/javascript/bindings/js_bindings_system_registration.cpp b/cocos/scripting/javascript/bindings/js_bindings_system_registration.cpp index 040a49b410..bf55e188f0 100644 --- a/cocos/scripting/javascript/bindings/js_bindings_system_registration.cpp +++ b/cocos/scripting/javascript/bindings/js_bindings_system_registration.cpp @@ -24,7 +24,7 @@ #include "js_bindings_config.h" #include "js_bindings_core.h" -#include "LocalStorage.h" +#include "local-storage/LocalStorage.h" #include "cocos2d.h" // system diff --git a/cocos/scripting/javascript/bindings/jsb_cocos2dx_extension_manual.cpp b/cocos/scripting/javascript/bindings/jsb_cocos2dx_extension_manual.cpp index 7a6d8bfc46..413f941bca 100644 --- a/cocos/scripting/javascript/bindings/jsb_cocos2dx_extension_manual.cpp +++ b/cocos/scripting/javascript/bindings/jsb_cocos2dx_extension_manual.cpp @@ -6,7 +6,7 @@ // #include "jsb_cocos2dx_extension_manual.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" #include "ScriptingCore.h" #include "cocos2d_specifics.hpp" #include "cocostudio/CocoStudio.h" diff --git a/cocos/scripting/javascript/bindings/jsb_websocket.cpp b/cocos/scripting/javascript/bindings/jsb_websocket.cpp index 49ecf7e57e..b5083ad268 100644 --- a/cocos/scripting/javascript/bindings/jsb_websocket.cpp +++ b/cocos/scripting/javascript/bindings/jsb_websocket.cpp @@ -25,7 +25,7 @@ THE SOFTWARE. #include "jsb_websocket.h" #include "cocos2d.h" -#include "WebSocket.h" +#include "network/WebSocket.h" #include "spidermonkey_specifics.h" #include "ScriptingCore.h" #include "cocos2d_specifics.hpp" diff --git a/cocos/storage/local-storage/Android.mk b/cocos/storage/local-storage/Android.mk index 67db9c191b..ee9d93e36b 100644 --- a/cocos/storage/local-storage/Android.mk +++ b/cocos/storage/local-storage/Android.mk @@ -1,19 +1,24 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) -LOCAL_MODULE := localstorage_static +LOCAL_MODULE := cocos_localstorage_static LOCAL_MODULE_FILENAME := liblocalstorage -LOCAL_SRC_FILES := LocalStorage.cpp -LocalStorageAndroid.cpp \ +LOCAL_SRC_FILES := LocalStorage.cpp \ +LocalStorageAndroid.cpp -LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/.. + LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../2d LOCAL_CFLAGS += -Wno-psabi LOCAL_EXPORT_CFLAGS += -Wno-psabi +LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static + include $(BUILD_STATIC_LIBRARY) + +$(call import-module,2d) diff --git a/external/spidermonkey/prebuilt/android/Android.mk b/external/spidermonkey/prebuilt/android/Android.mk index 7891f4a46e..74f0e9b6a8 100644 --- a/external/spidermonkey/prebuilt/android/Android.mk +++ b/external/spidermonkey/prebuilt/android/Android.mk @@ -3,8 +3,8 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := spidermonkey_static LOCAL_MODULE_FILENAME := js_static -LOCAL_SRC_FILES := ./lib/$(TARGET_ARCH_ABI)/libjs_static.a -LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include +LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libjs_static.a +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../include/android LOCAL_CPPFLAGS := -D__STDC_LIMIT_MACROS=1 -Wno-invalid-offsetof LOCAL_EXPORT_CPPFLAGS := -D__STDC_LIMIT_MACROS=1 -Wno-invalid-offsetof include $(PREBUILT_STATIC_LIBRARY) diff --git a/external/websockets/prebuilt/android/Android.mk b/external/websockets/prebuilt/android/Android.mk index a5f14e0456..1547fc6140 100644 --- a/external/websockets/prebuilt/android/Android.mk +++ b/external/websockets/prebuilt/android/Android.mk @@ -1,7 +1,7 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) -LOCAL_MODULE := libwebsockets_static +LOCAL_MODULE := websockets_static LOCAL_MODULE_FILENAME := libwebsockets_static LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libwebsockets.a LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../include/android diff --git a/samples/Cpp/TestCpp/Android.mk b/samples/Cpp/TestCpp/Android.mk index bd0a8e37e6..f54ac22e3b 100644 --- a/samples/Cpp/TestCpp/Android.mk +++ b/samples/Cpp/TestCpp/Android.mk @@ -148,9 +148,9 @@ LOCAL_WHOLE_STATIC_LIBRARIES += chipmunk_static LOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static LOCAL_WHOLE_STATIC_LIBRARIES += cocosbuilder_static LOCAL_WHOLE_STATIC_LIBRARIES += spine_static -LOCAL_WHOLE_STATIC_LIBRARIES += gui_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocos_gui_static LOCAL_WHOLE_STATIC_LIBRARIES += cocostudio_static -LOCAL_WHOLE_STATIC_LIBRARIES += network_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocos_network_static LOCAL_WHOLE_STATIC_LIBRARIES += cocos_curl_static LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/Classes diff --git a/samples/Javascript/TestJavascript/proj.android/build_native.sh b/samples/Javascript/TestJavascript/proj.android/build_native.sh index b3f633e707..3378f4006a 100755 --- a/samples/Javascript/TestJavascript/proj.android/build_native.sh +++ b/samples/Javascript/TestJavascript/proj.android/build_native.sh @@ -76,7 +76,7 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" COCOS2DX_ROOT="$DIR/../../../.." APP_ROOT="$DIR/.." APP_ANDROID_ROOT="$DIR" -BINDINGS_JS_ROOT="$APP_ROOT/../../../scripting/javascript/bindings/js" +BINDINGS_JS_ROOT="$APP_ROOT/../../../cocos/scripting/javascript/script" echo echo "Paths" @@ -110,5 +110,5 @@ echo set -x "$NDK_ROOT"/ndk-build $PARALLEL_BUILD_FLAG -C "$APP_ANDROID_ROOT" $* \ - "NDK_MODULE_PATH=${COCOS2DX_ROOT}:${COCOS2DX_ROOT}/cocos2dx/platform/third_party/android/prebuilt" \ + "NDK_MODULE_PATH=${COCOS2DX_ROOT}:${COCOS2DX_ROOT}/cocos:${COCOS2DX_ROOT}/external" \ NDK_LOG=0 V=0 diff --git a/samples/Javascript/TestJavascript/proj.android/jni/Android.mk b/samples/Javascript/TestJavascript/proj.android/jni/Android.mk index 5655c291c2..89d17346d0 100644 --- a/samples/Javascript/TestJavascript/proj.android/jni/Android.mk +++ b/samples/Javascript/TestJavascript/proj.android/jni/Android.mk @@ -11,20 +11,10 @@ LOCAL_SRC_FILES := testjavascript/main.cpp \ LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes -LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static -LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_static -LOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static -LOCAL_WHOLE_STATIC_LIBRARIES += spidermonkey_static -LOCAL_WHOLE_STATIC_LIBRARIES += scriptingcore-spidermonkey -LOCAL_WHOLE_STATIC_LIBRARIES += cocos2dxandroid_static +LOCAL_WHOLE_STATIC_LIBRARIES := cocos_jsb_static -LOCAL_EXPORT_CFLAGS := -DCOCOS2D_DEBUG=2 -DCOCOS2D_JAVASCRIPT +LOCAL_EXPORT_CFLAGS := -DCOCOS2D_DEBUG=2 include $(BUILD_SHARED_LIBRARY) -$(call import-module,cocos2dx) -$(call import-module,audio/android) -$(call import-module,extensions) -$(call import-module,scripting/javascript/spidermonkey-android) $(call import-module,scripting/javascript/bindings) -$(call import-module,cocos2dx/platform/android) From 34fe2ba02c87aa62ce8aecd69bed71c658eb7a2f Mon Sep 17 00:00:00 2001 From: James Chen Date: Thu, 17 Oct 2013 14:12:43 +0800 Subject: [PATCH 53/64] Added missing icons for some iOS and Mac samples. --- build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id b/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id index 04a9dc0568..70bb169acc 100644 --- a/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -f0ce606901bf2ba3acceae9e9562214dde6a4c69 \ No newline at end of file +83265c81797ca614f19372a96adf326aeb21b396 \ No newline at end of file From a2de02cc19f79ace82eae549adf5bb9002558186 Mon Sep 17 00:00:00 2001 From: XiaoLongHan Date: Thu, 17 Oct 2013 14:21:55 +0800 Subject: [PATCH 54/64] Change the class name of textfield to compare, so that you can touch anywhere outside of the virtual keyboard. --- cocos/2d/platform/ios/EAGLView.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/2d/platform/ios/EAGLView.mm b/cocos/2d/platform/ios/EAGLView.mm index 188172e73a..5d305d4bdc 100644 --- a/cocos/2d/platform/ios/EAGLView.mm +++ b/cocos/2d/platform/ios/EAGLView.mm @@ -378,7 +378,7 @@ static CCEAGLView *view = 0; for(UIView* view in subviews) { - if([view isKindOfClass:NSClassFromString(@"CustomUITextField")]) + if([view isKindOfClass:NSClassFromString(@"CCCustomUITextField")]) { if ([view isFirstResponder]) { From e50f9fc43b47a24f8e51cb859635abac9edb90b8 Mon Sep 17 00:00:00 2001 From: minggo Date: Thu, 17 Oct 2013 15:04:30 +0800 Subject: [PATCH 55/64] issue #2905: jsbinding samples and lua binding samples build ok on android --- cocos/2d/Android.mk | 4 +- cocos/editor-support/cocosbuilder/Android.mk | 2 +- cocos/editor-support/cocostudio/Android.mk | 2 + .../scripting/javascript/bindings/Android.mk | 2 - cocos/scripting/lua/bindings/Android.mk | 84 +++++++++--------- cocos/scripting/lua/bindings/CCBProxy.h | 2 +- .../lua/bindings/LuaOpengl.cpp.REMOVED.git-id | 2 +- .../lua/bindings/LuaScriptHandlerMgr.cpp | 2 +- external/lua/luajit/.DS_Store | Bin 0 -> 6148 bytes .../luajit/{ => prebuilt/android}/Android.mk | 4 +- .../armeabi-v7a/libluajit.a.REMOVED.git-id | 0 .../armeabi/libluajit.a.REMOVED.git-id | 0 .../android/x86/libluajit.a.REMOVED.git-id | 0 .../ios/libluajit.a.REMOVED.git-id | 0 .../mac/libluajit.a.REMOVED.git-id | 0 .../win32/lua51.dll.REMOVED.git-id | 0 .../luajit/{LuaJIT-2.0.1 => src}/COPYRIGHT | 0 .../lua/luajit/{LuaJIT-2.0.1 => src}/Makefile | 0 .../lua/luajit/{LuaJIT-2.0.1 => src}/README | 0 .../doc/bluequad-print.css | 0 .../{LuaJIT-2.0.1 => src}/doc/bluequad.css | 0 .../{LuaJIT-2.0.1 => src}/doc/changes.html | 0 .../{LuaJIT-2.0.1 => src}/doc/contact.html | 0 .../{LuaJIT-2.0.1 => src}/doc/ext_c_api.html | 0 .../{LuaJIT-2.0.1 => src}/doc/ext_ffi.html | 0 .../doc/ext_ffi_api.html | 0 .../doc/ext_ffi_semantics.html | 0 .../doc/ext_ffi_tutorial.html | 0 .../{LuaJIT-2.0.1 => src}/doc/ext_jit.html | 0 .../{LuaJIT-2.0.1 => src}/doc/extensions.html | 0 .../luajit/{LuaJIT-2.0.1 => src}/doc/faq.html | 0 .../{LuaJIT-2.0.1 => src}/doc/install.html | 0 .../{LuaJIT-2.0.1 => src}/doc/luajit.html | 0 .../{LuaJIT-2.0.1 => src}/doc/running.html | 0 .../{LuaJIT-2.0.1 => src}/doc/status.html | 0 .../{LuaJIT-2.0.1 => src}/dynasm/dasm_arm.h | 0 .../{LuaJIT-2.0.1 => src}/dynasm/dasm_arm.lua | 0 .../{LuaJIT-2.0.1 => src}/dynasm/dasm_mips.h | 0 .../dynasm/dasm_mips.lua | 0 .../{LuaJIT-2.0.1 => src}/dynasm/dasm_ppc.h | 0 .../{LuaJIT-2.0.1 => src}/dynasm/dasm_ppc.lua | 0 .../{LuaJIT-2.0.1 => src}/dynasm/dasm_proto.h | 0 .../{LuaJIT-2.0.1 => src}/dynasm/dasm_x64.lua | 0 .../{LuaJIT-2.0.1 => src}/dynasm/dasm_x86.h | 0 .../{LuaJIT-2.0.1 => src}/dynasm/dasm_x86.lua | 0 .../{LuaJIT-2.0.1 => src}/dynasm/dynasm.lua | 0 .../luajit/{LuaJIT-2.0.1 => src}/etc/luajit.1 | 0 .../{LuaJIT-2.0.1 => src}/etc/luajit.pc | 0 .../luajit/{LuaJIT-2.0.1 => src}/src/Makefile | 0 .../{LuaJIT-2.0.1 => src}/src/Makefile.dep | 0 .../{LuaJIT-2.0.1 => src}/src/host/README | 0 .../{LuaJIT-2.0.1 => src}/src/host/buildvm.c | 0 .../{LuaJIT-2.0.1 => src}/src/host/buildvm.h | 0 .../src/host/buildvm_asm.c | 0 .../src/host/buildvm_fold.c | 0 .../src/host/buildvm_lib.c | 0 .../src/host/buildvm_peobj.c | 0 .../src/host/genminilua.lua | 0 .../src/host/minilua.c.REMOVED.git-id | 0 .../{LuaJIT-2.0.1 => src}/src/jit/bc.lua | 0 .../{LuaJIT-2.0.1 => src}/src/jit/bcsave.lua | 0 .../{LuaJIT-2.0.1 => src}/src/jit/dis_arm.lua | 0 .../src/jit/dis_mips.lua | 0 .../src/jit/dis_mipsel.lua | 0 .../{LuaJIT-2.0.1 => src}/src/jit/dis_ppc.lua | 0 .../{LuaJIT-2.0.1 => src}/src/jit/dis_x64.lua | 0 .../{LuaJIT-2.0.1 => src}/src/jit/dis_x86.lua | 0 .../{LuaJIT-2.0.1 => src}/src/jit/dump.lua | 0 .../{LuaJIT-2.0.1 => src}/src/jit/v.lua | 0 .../{LuaJIT-2.0.1 => src}/src/lauxlib.h | 0 .../{LuaJIT-2.0.1 => src}/src/lib_aux.c | 0 .../{LuaJIT-2.0.1 => src}/src/lib_base.c | 0 .../{LuaJIT-2.0.1 => src}/src/lib_bit.c | 0 .../{LuaJIT-2.0.1 => src}/src/lib_debug.c | 0 .../{LuaJIT-2.0.1 => src}/src/lib_ffi.c | 0 .../{LuaJIT-2.0.1 => src}/src/lib_init.c | 0 .../luajit/{LuaJIT-2.0.1 => src}/src/lib_io.c | 0 .../{LuaJIT-2.0.1 => src}/src/lib_jit.c | 0 .../{LuaJIT-2.0.1 => src}/src/lib_math.c | 0 .../luajit/{LuaJIT-2.0.1 => src}/src/lib_os.c | 0 .../{LuaJIT-2.0.1 => src}/src/lib_package.c | 0 .../{LuaJIT-2.0.1 => src}/src/lib_string.c | 0 .../{LuaJIT-2.0.1 => src}/src/lib_table.c | 0 .../luajit/{LuaJIT-2.0.1 => src}/src/lj.supp | 0 .../{LuaJIT-2.0.1 => src}/src/lj_alloc.c | 0 .../{LuaJIT-2.0.1 => src}/src/lj_alloc.h | 0 .../luajit/{LuaJIT-2.0.1 => src}/src/lj_api.c | 0 .../{LuaJIT-2.0.1 => src}/src/lj_arch.h | 0 .../luajit/{LuaJIT-2.0.1 => src}/src/lj_asm.c | 0 .../luajit/{LuaJIT-2.0.1 => src}/src/lj_asm.h | 0 .../{LuaJIT-2.0.1 => src}/src/lj_asm_arm.h | 0 .../{LuaJIT-2.0.1 => src}/src/lj_asm_mips.h | 0 .../{LuaJIT-2.0.1 => src}/src/lj_asm_ppc.h | 0 .../{LuaJIT-2.0.1 => src}/src/lj_asm_x86.h | 0 .../luajit/{LuaJIT-2.0.1 => src}/src/lj_bc.c | 0 .../luajit/{LuaJIT-2.0.1 => src}/src/lj_bc.h | 0 .../{LuaJIT-2.0.1 => src}/src/lj_bcdump.h | 0 .../{LuaJIT-2.0.1 => src}/src/lj_bcread.c | 0 .../{LuaJIT-2.0.1 => src}/src/lj_bcwrite.c | 0 .../{LuaJIT-2.0.1 => src}/src/lj_carith.c | 0 .../{LuaJIT-2.0.1 => src}/src/lj_carith.h | 0 .../{LuaJIT-2.0.1 => src}/src/lj_ccall.c | 0 .../{LuaJIT-2.0.1 => src}/src/lj_ccall.h | 0 .../{LuaJIT-2.0.1 => src}/src/lj_ccallback.c | 0 .../{LuaJIT-2.0.1 => src}/src/lj_ccallback.h | 0 .../{LuaJIT-2.0.1 => src}/src/lj_cconv.c | 0 .../{LuaJIT-2.0.1 => src}/src/lj_cconv.h | 0 .../{LuaJIT-2.0.1 => src}/src/lj_cdata.c | 0 .../{LuaJIT-2.0.1 => src}/src/lj_cdata.h | 0 .../{LuaJIT-2.0.1 => src}/src/lj_char.c | 0 .../{LuaJIT-2.0.1 => src}/src/lj_char.h | 0 .../{LuaJIT-2.0.1 => src}/src/lj_clib.c | 0 .../{LuaJIT-2.0.1 => src}/src/lj_clib.h | 0 .../{LuaJIT-2.0.1 => src}/src/lj_cparse.c | 0 .../{LuaJIT-2.0.1 => src}/src/lj_cparse.h | 0 .../{LuaJIT-2.0.1 => src}/src/lj_crecord.c | 0 .../{LuaJIT-2.0.1 => src}/src/lj_crecord.h | 0 .../{LuaJIT-2.0.1 => src}/src/lj_ctype.c | 0 .../{LuaJIT-2.0.1 => src}/src/lj_ctype.h | 0 .../{LuaJIT-2.0.1 => src}/src/lj_debug.c | 0 .../{LuaJIT-2.0.1 => src}/src/lj_debug.h | 0 .../luajit/{LuaJIT-2.0.1 => src}/src/lj_def.h | 0 .../{LuaJIT-2.0.1 => src}/src/lj_dispatch.c | 0 .../{LuaJIT-2.0.1 => src}/src/lj_dispatch.h | 0 .../{LuaJIT-2.0.1 => src}/src/lj_emit_arm.h | 0 .../{LuaJIT-2.0.1 => src}/src/lj_emit_mips.h | 0 .../{LuaJIT-2.0.1 => src}/src/lj_emit_ppc.h | 0 .../{LuaJIT-2.0.1 => src}/src/lj_emit_x86.h | 0 .../luajit/{LuaJIT-2.0.1 => src}/src/lj_err.c | 0 .../luajit/{LuaJIT-2.0.1 => src}/src/lj_err.h | 0 .../{LuaJIT-2.0.1 => src}/src/lj_errmsg.h | 0 .../luajit/{LuaJIT-2.0.1 => src}/src/lj_ff.h | 0 .../{LuaJIT-2.0.1 => src}/src/lj_ffrecord.c | 0 .../{LuaJIT-2.0.1 => src}/src/lj_ffrecord.h | 0 .../{LuaJIT-2.0.1 => src}/src/lj_frame.h | 0 .../{LuaJIT-2.0.1 => src}/src/lj_func.c | 0 .../{LuaJIT-2.0.1 => src}/src/lj_func.h | 0 .../luajit/{LuaJIT-2.0.1 => src}/src/lj_gc.c | 0 .../luajit/{LuaJIT-2.0.1 => src}/src/lj_gc.h | 0 .../{LuaJIT-2.0.1 => src}/src/lj_gdbjit.c | 0 .../{LuaJIT-2.0.1 => src}/src/lj_gdbjit.h | 0 .../luajit/{LuaJIT-2.0.1 => src}/src/lj_ir.c | 0 .../luajit/{LuaJIT-2.0.1 => src}/src/lj_ir.h | 0 .../{LuaJIT-2.0.1 => src}/src/lj_ircall.h | 0 .../{LuaJIT-2.0.1 => src}/src/lj_iropt.h | 0 .../luajit/{LuaJIT-2.0.1 => src}/src/lj_jit.h | 0 .../luajit/{LuaJIT-2.0.1 => src}/src/lj_lex.c | 0 .../luajit/{LuaJIT-2.0.1 => src}/src/lj_lex.h | 0 .../luajit/{LuaJIT-2.0.1 => src}/src/lj_lib.c | 0 .../luajit/{LuaJIT-2.0.1 => src}/src/lj_lib.h | 0 .../{LuaJIT-2.0.1 => src}/src/lj_load.c | 0 .../{LuaJIT-2.0.1 => src}/src/lj_mcode.c | 0 .../{LuaJIT-2.0.1 => src}/src/lj_mcode.h | 0 .../{LuaJIT-2.0.1 => src}/src/lj_meta.c | 0 .../{LuaJIT-2.0.1 => src}/src/lj_meta.h | 0 .../luajit/{LuaJIT-2.0.1 => src}/src/lj_obj.c | 0 .../luajit/{LuaJIT-2.0.1 => src}/src/lj_obj.h | 0 .../{LuaJIT-2.0.1 => src}/src/lj_opt_dce.c | 0 .../{LuaJIT-2.0.1 => src}/src/lj_opt_fold.c | 0 .../{LuaJIT-2.0.1 => src}/src/lj_opt_loop.c | 0 .../{LuaJIT-2.0.1 => src}/src/lj_opt_mem.c | 0 .../{LuaJIT-2.0.1 => src}/src/lj_opt_narrow.c | 0 .../{LuaJIT-2.0.1 => src}/src/lj_opt_sink.c | 0 .../{LuaJIT-2.0.1 => src}/src/lj_opt_split.c | 0 .../{LuaJIT-2.0.1 => src}/src/lj_parse.c | 0 .../{LuaJIT-2.0.1 => src}/src/lj_parse.h | 0 .../{LuaJIT-2.0.1 => src}/src/lj_record.c | 0 .../{LuaJIT-2.0.1 => src}/src/lj_record.h | 0 .../{LuaJIT-2.0.1 => src}/src/lj_snap.c | 0 .../{LuaJIT-2.0.1 => src}/src/lj_snap.h | 0 .../{LuaJIT-2.0.1 => src}/src/lj_state.c | 0 .../{LuaJIT-2.0.1 => src}/src/lj_state.h | 0 .../luajit/{LuaJIT-2.0.1 => src}/src/lj_str.c | 0 .../luajit/{LuaJIT-2.0.1 => src}/src/lj_str.h | 0 .../{LuaJIT-2.0.1 => src}/src/lj_strscan.c | 0 .../{LuaJIT-2.0.1 => src}/src/lj_strscan.h | 0 .../luajit/{LuaJIT-2.0.1 => src}/src/lj_tab.c | 0 .../luajit/{LuaJIT-2.0.1 => src}/src/lj_tab.h | 0 .../{LuaJIT-2.0.1 => src}/src/lj_target.h | 0 .../{LuaJIT-2.0.1 => src}/src/lj_target_arm.h | 0 .../src/lj_target_mips.h | 0 .../{LuaJIT-2.0.1 => src}/src/lj_target_ppc.h | 0 .../{LuaJIT-2.0.1 => src}/src/lj_target_x86.h | 0 .../{LuaJIT-2.0.1 => src}/src/lj_trace.c | 0 .../{LuaJIT-2.0.1 => src}/src/lj_trace.h | 0 .../{LuaJIT-2.0.1 => src}/src/lj_traceerr.h | 0 .../{LuaJIT-2.0.1 => src}/src/lj_udata.c | 0 .../{LuaJIT-2.0.1 => src}/src/lj_udata.h | 0 .../luajit/{LuaJIT-2.0.1 => src}/src/lj_vm.h | 0 .../{LuaJIT-2.0.1 => src}/src/lj_vmevent.c | 0 .../{LuaJIT-2.0.1 => src}/src/lj_vmevent.h | 0 .../{LuaJIT-2.0.1 => src}/src/lj_vmmath.c | 0 .../{LuaJIT-2.0.1 => src}/src/ljamalg.c | 0 .../luajit/{LuaJIT-2.0.1 => src}/src/lua.h | 0 .../luajit/{LuaJIT-2.0.1 => src}/src/lua.hpp | 0 .../{LuaJIT-2.0.1 => src}/src/luaconf.h | 0 .../luajit/{LuaJIT-2.0.1 => src}/src/luajit.c | 0 .../luajit/{LuaJIT-2.0.1 => src}/src/luajit.h | 0 .../luajit/{LuaJIT-2.0.1 => src}/src/lualib.h | 0 .../{LuaJIT-2.0.1 => src}/src/msvcbuild.bat | 0 .../src/vm_arm.dasc.REMOVED.git-id | 0 .../src/vm_mips.dasc.REMOVED.git-id | 0 .../src/vm_ppc.dasc.REMOVED.git-id | 0 .../src/vm_ppcspe.dasc.REMOVED.git-id | 0 .../src/vm_x86.dasc.REMOVED.git-id | 0 .../{LuaJIT-2.0.1 => src}/src/xedkbuild.bat | 0 .../v2.0.1_hotfix1.patch | 0 samples/Cpp/TestCpp/Android.mk | 2 - .../proj.android/build_native.sh | 4 +- .../CocosDragonJS/proj.android/jni/Android.mk | 10 +-- .../CrystalCraze/proj.android/build_native.sh | 4 +- .../CrystalCraze/proj.android/jni/Android.mk | 10 +-- .../MoonWarriors/proj.android/build_native.sh | 4 +- .../MoonWarriors/proj.android/jni/Android.mk | 12 +-- .../proj.android/build_native.sh | 4 +- .../proj.android/jni/Android.mk | 12 +-- .../Lua/HelloLua/proj.android/build_native.sh | 2 +- .../Lua/HelloLua/proj.android/jni/Android.mk | 2 +- .../Lua/TestLua/proj.android/build_native.sh | 6 +- .../Lua/TestLua/proj.android/jni/Android.mk | 15 +--- .../proj.android/build_native.sh | 4 +- .../proj.android/jni/Android.mk | 12 +-- .../proj.android/build_native.sh | 6 +- .../proj.android/jni/Android.mk | 11 +-- 224 files changed, 84 insertions(+), 140 deletions(-) create mode 100644 external/lua/luajit/.DS_Store rename external/lua/luajit/{ => prebuilt/android}/Android.mk (58%) rename external/lua/luajit/{ => prebuilt}/android/armeabi-v7a/libluajit.a.REMOVED.git-id (100%) rename external/lua/luajit/{ => prebuilt}/android/armeabi/libluajit.a.REMOVED.git-id (100%) rename external/lua/luajit/{ => prebuilt}/android/x86/libluajit.a.REMOVED.git-id (100%) rename external/lua/luajit/{ => prebuilt}/ios/libluajit.a.REMOVED.git-id (100%) rename external/lua/luajit/{ => prebuilt}/mac/libluajit.a.REMOVED.git-id (100%) rename external/lua/luajit/{ => prebuilt}/win32/lua51.dll.REMOVED.git-id (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/COPYRIGHT (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/Makefile (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/README (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/doc/bluequad-print.css (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/doc/bluequad.css (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/doc/changes.html (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/doc/contact.html (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/doc/ext_c_api.html (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/doc/ext_ffi.html (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/doc/ext_ffi_api.html (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/doc/ext_ffi_semantics.html (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/doc/ext_ffi_tutorial.html (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/doc/ext_jit.html (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/doc/extensions.html (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/doc/faq.html (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/doc/install.html (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/doc/luajit.html (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/doc/running.html (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/doc/status.html (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/dynasm/dasm_arm.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/dynasm/dasm_arm.lua (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/dynasm/dasm_mips.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/dynasm/dasm_mips.lua (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/dynasm/dasm_ppc.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/dynasm/dasm_ppc.lua (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/dynasm/dasm_proto.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/dynasm/dasm_x64.lua (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/dynasm/dasm_x86.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/dynasm/dasm_x86.lua (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/dynasm/dynasm.lua (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/etc/luajit.1 (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/etc/luajit.pc (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/Makefile (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/Makefile.dep (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/host/README (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/host/buildvm.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/host/buildvm.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/host/buildvm_asm.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/host/buildvm_fold.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/host/buildvm_lib.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/host/buildvm_peobj.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/host/genminilua.lua (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/host/minilua.c.REMOVED.git-id (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/jit/bc.lua (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/jit/bcsave.lua (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/jit/dis_arm.lua (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/jit/dis_mips.lua (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/jit/dis_mipsel.lua (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/jit/dis_ppc.lua (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/jit/dis_x64.lua (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/jit/dis_x86.lua (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/jit/dump.lua (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/jit/v.lua (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lauxlib.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lib_aux.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lib_base.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lib_bit.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lib_debug.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lib_ffi.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lib_init.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lib_io.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lib_jit.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lib_math.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lib_os.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lib_package.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lib_string.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lib_table.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj.supp (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_alloc.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_alloc.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_api.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_arch.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_asm.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_asm.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_asm_arm.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_asm_mips.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_asm_ppc.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_asm_x86.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_bc.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_bc.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_bcdump.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_bcread.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_bcwrite.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_carith.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_carith.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_ccall.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_ccall.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_ccallback.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_ccallback.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_cconv.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_cconv.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_cdata.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_cdata.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_char.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_char.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_clib.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_clib.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_cparse.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_cparse.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_crecord.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_crecord.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_ctype.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_ctype.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_debug.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_debug.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_def.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_dispatch.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_dispatch.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_emit_arm.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_emit_mips.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_emit_ppc.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_emit_x86.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_err.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_err.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_errmsg.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_ff.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_ffrecord.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_ffrecord.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_frame.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_func.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_func.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_gc.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_gc.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_gdbjit.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_gdbjit.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_ir.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_ir.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_ircall.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_iropt.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_jit.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_lex.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_lex.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_lib.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_lib.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_load.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_mcode.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_mcode.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_meta.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_meta.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_obj.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_obj.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_opt_dce.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_opt_fold.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_opt_loop.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_opt_mem.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_opt_narrow.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_opt_sink.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_opt_split.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_parse.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_parse.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_record.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_record.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_snap.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_snap.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_state.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_state.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_str.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_str.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_strscan.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_strscan.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_tab.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_tab.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_target.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_target_arm.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_target_mips.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_target_ppc.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_target_x86.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_trace.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_trace.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_traceerr.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_udata.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_udata.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_vm.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_vmevent.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_vmevent.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lj_vmmath.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/ljamalg.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lua.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lua.hpp (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/luaconf.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/luajit.c (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/luajit.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/lualib.h (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/msvcbuild.bat (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/vm_arm.dasc.REMOVED.git-id (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/vm_mips.dasc.REMOVED.git-id (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/vm_ppc.dasc.REMOVED.git-id (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/vm_ppcspe.dasc.REMOVED.git-id (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/vm_x86.dasc.REMOVED.git-id (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/src/xedkbuild.bat (100%) rename external/lua/luajit/{LuaJIT-2.0.1 => src}/v2.0.1_hotfix1.patch (100%) diff --git a/cocos/2d/Android.mk b/cocos/2d/Android.mk index 20017089fe..7e60320ddb 100644 --- a/cocos/2d/Android.mk +++ b/cocos/2d/Android.mk @@ -201,8 +201,10 @@ LOCAL_WHOLE_STATIC_LIBRARIES += chipmunk_static LOCAL_WHOLE_STATIC_LIBRARIES += cocos2dxandroid_static # define the macro to compile through support/zip_support/ioapi.c -LOCAL_CFLAGS := -Wno-psabi -DUSE_FILE32API +LOCAL_CFLAGS := -Wno-psabi -DUSE_FILE32API +LOCAL_CPPFLAGS := -Wno-literal-suffix LOCAL_EXPORT_CFLAGS := -Wno-psabi -DUSE_FILE32API +LOCAL_EXPORT_CPPFLAGS := -Wno-literal-suffix include $(BUILD_STATIC_LIBRARY) diff --git a/cocos/editor-support/cocosbuilder/Android.mk b/cocos/editor-support/cocosbuilder/Android.mk index dd6b2b3b77..4685debd1b 100644 --- a/cocos/editor-support/cocosbuilder/Android.mk +++ b/cocos/editor-support/cocosbuilder/Android.mk @@ -29,7 +29,7 @@ CCScale9SpriteLoader.cpp \ CCScrollViewLoader.cpp \ CCSpriteLoader.cpp -LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/ \ +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/.. \ $(LOCAL_PATH)/../../.. LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../2d \ diff --git a/cocos/editor-support/cocostudio/Android.mk b/cocos/editor-support/cocostudio/Android.mk index b7dfa3838c..380eeba149 100644 --- a/cocos/editor-support/cocostudio/Android.mk +++ b/cocos/editor-support/cocostudio/Android.mk @@ -56,9 +56,11 @@ LOCAL_EXPORT_CFLAGS += -Wno-psabi LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocos_gui_static include $(BUILD_STATIC_LIBRARY) $(call import-module,2d) $(call import-module,audio/android) +$(call import-module,gui) diff --git a/cocos/scripting/javascript/bindings/Android.mk b/cocos/scripting/javascript/bindings/Android.mk index 7482cdef26..27a3b51306 100644 --- a/cocos/scripting/javascript/bindings/Android.mk +++ b/cocos/scripting/javascript/bindings/Android.mk @@ -52,7 +52,6 @@ LOCAL_WHOLE_STATIC_LIBRARIES += chipmunk_static LOCAL_WHOLE_STATIC_LIBRARIES += cocos_localstorage_static LOCAL_WHOLE_STATIC_LIBRARIES += cocostudio_static LOCAL_WHOLE_STATIC_LIBRARIES += websockets_static -LOCAL_WHOLE_STATIC_LIBRARIES += cocos_gui_static LOCAL_LDLIBS := -landroid LOCAL_LDLIBS += -llog @@ -70,4 +69,3 @@ $(call import-module,chipmunk) $(call import-module,storage/local-storage) $(call import-module,editor-support/cocostudio) $(call import-module,websockets/prebuilt/android) -$(call import-module,gui) diff --git a/cocos/scripting/lua/bindings/Android.mk b/cocos/scripting/lua/bindings/Android.mk index 8d1130ba3c..a5293f66a2 100644 --- a/cocos/scripting/lua/bindings/Android.mk +++ b/cocos/scripting/lua/bindings/Android.mk @@ -5,61 +5,59 @@ LOCAL_MODULE := cocos_lua_static LOCAL_MODULE_FILENAME := liblua -LOCAL_SRC_FILES := ../cocos2dx_support/CCLuaBridge.cpp \ - ../cocos2dx_support/CCLuaEngine.cpp \ - ../cocos2dx_support/CCLuaStack.cpp \ - ../cocos2dx_support/CCLuaValue.cpp \ - ../cocos2dx_support/Cocos2dxLuaLoader.cpp \ - ../cocos2dx_support/CCBProxy.cpp \ - ../cocos2dx_support/Lua_web_socket.cpp \ - ../cocos2dx_support/LuaOpengl.cpp \ - ../cocos2dx_support/LuaScriptHandlerMgr.cpp \ - ../cocos2dx_support/LuaBasicConversions.cpp \ +LOCAL_SRC_FILES := CCLuaBridge.cpp \ + CCLuaEngine.cpp \ + CCLuaStack.cpp \ + CCLuaValue.cpp \ + Cocos2dxLuaLoader.cpp \ + CCBProxy.cpp \ + Lua_web_socket.cpp \ + LuaOpengl.cpp \ + LuaScriptHandlerMgr.cpp \ + LuaBasicConversions.cpp \ ../../auto-generated/lua-bindings/lua_cocos2dx_auto.cpp \ ../../auto-generated/lua-bindings/lua_cocos2dx_extension_auto.cpp \ - ../cocos2dx_support/lua_cocos2dx_manual.cpp \ - ../cocos2dx_support/lua_cocos2dx_extension_manual.cpp \ - ../cocos2dx_support/lua_cocos2dx_deprecated.cpp \ - ../cocos2dx_support/platform/android/CCLuaJavaBridge.cpp \ - ../cocos2dx_support/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge.cpp \ - ../tolua/tolua_event.c \ - ../tolua/tolua_is.c \ - ../tolua/tolua_map.c \ - ../tolua/tolua_push.c \ - ../tolua/tolua_to.c \ - ../cocos2dx_support/tolua_fix.c + lua_cocos2dx_manual.cpp \ + lua_cocos2dx_extension_manual.cpp \ + lua_cocos2dx_deprecated.cpp \ + platform/android/CCLuaJavaBridge.cpp \ + platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge.cpp \ + ../../../../external/lua/tolua/tolua_event.c \ + ../../../../external/lua/tolua/tolua_is.c \ + ../../../../external/lua/tolua/tolua_map.c \ + ../../../../external/lua/tolua/tolua_push.c \ + ../../../../external/lua/tolua/tolua_to.c \ + tolua_fix.c -LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../luajit/include \ - $(LOCAL_PATH)/../tolua \ - $(LOCAL_PATH)/../cocos2dx_support \ - $(LOCAL_PATH)/../../auto-generated/lua-bindings \ - $(LOCAL_PATH)/../cocos2dx_support/platform/android \ - $(LOCAL_PATH)/../cocos2dx_support/platform/android/jni - - -LOCAL_C_INCLUDES := $(LOCAL_PATH)/ \ - $(LOCAL_PATH)/../luajit/include \ - $(LOCAL_PATH)/../tolua \ - $(LOCAL_PATH)/../../../cocos2dx \ - $(LOCAL_PATH)/../../../cocos2dx/include \ - $(LOCAL_PATH)/../../../cocos2dx/platform \ - $(LOCAL_PATH)/../../../cocos2dx/platform/android \ - $(LOCAL_PATH)/../../../cocos2dx/kazmath/include \ - $(LOCAL_PATH)/../../../CocosDenshion/include \ - $(LOCAL_PATH)/../../../extensions \ - $(LOCAL_PATH)/../cocos2dx_support \ +LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../../external/lua/tolua \ $(LOCAL_PATH)/../../auto-generated/lua-bindings \ - $(LOCAL_PATH)/../cocos2dx_support/platform/android \ - $(LOCAL_PATH)/../cocos2dx_support/platform/android/jni + $(LOCAL_PATH)/platform/android \ + $(LOCAL_PATH)/platform/android/jni \ + $(LOCAL_PATH)/../../../../extensions \ + $(LOCAL_PATH)/../../../editor-support/cocosbuilder \ + $(LOCAL_PATH)/../../../editor-support/cocostudio + + +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) LOCAL_WHOLE_STATIC_LIBRARIES := luajit_static LOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocos2dx_static +LOCAL_WHOLE_STATIC_LIBRARIES += websockets_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocos_network_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocosbuilder_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocostudio_static LOCAL_CFLAGS += -Wno-psabi LOCAL_EXPORT_CFLAGS += -Wno-psabi include $(BUILD_STATIC_LIBRARY) -$(call import-module,scripting/lua/luajit) +$(call import-module,lua/luajit/prebuilt/android) $(call import-module,extensions) +$(call import-module,2d) +$(call import-module,websockets/prebuilt/android) +$(call import-module,network) +$(call import-module,editor-support/cocostudio) +$(call import-module,editor-support/cocosbuilder) diff --git a/cocos/scripting/lua/bindings/CCBProxy.h b/cocos/scripting/lua/bindings/CCBProxy.h index 082bf09db1..a073db913b 100644 --- a/cocos/scripting/lua/bindings/CCBProxy.h +++ b/cocos/scripting/lua/bindings/CCBProxy.h @@ -4,7 +4,7 @@ #include "cocos2d.h" #include "CCLuaEngine.h" #include "SimpleAudioEngine.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" #include "cocosbuilder/CocosBuilder.h" USING_NS_CC; diff --git a/cocos/scripting/lua/bindings/LuaOpengl.cpp.REMOVED.git-id b/cocos/scripting/lua/bindings/LuaOpengl.cpp.REMOVED.git-id index a50fda9d51..bc4c41058d 100644 --- a/cocos/scripting/lua/bindings/LuaOpengl.cpp.REMOVED.git-id +++ b/cocos/scripting/lua/bindings/LuaOpengl.cpp.REMOVED.git-id @@ -1 +1 @@ -a57fbb5f0f9564858ced00cf47af905e6a7900c6 \ No newline at end of file +4456a3ba6fbd68175b40e607c6bc19bdfc378ce1 \ No newline at end of file diff --git a/cocos/scripting/lua/bindings/LuaScriptHandlerMgr.cpp b/cocos/scripting/lua/bindings/LuaScriptHandlerMgr.cpp index 7b663307a3..ab4d01bd01 100644 --- a/cocos/scripting/lua/bindings/LuaScriptHandlerMgr.cpp +++ b/cocos/scripting/lua/bindings/LuaScriptHandlerMgr.cpp @@ -10,7 +10,7 @@ extern "C" { #include #include "LuaScriptHandlerMgr.h" #include "cocos2d.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" #include "CCLuaStack.h" #include "CCLuaValue.h" #include "CCLuaEngine.h" diff --git a/external/lua/luajit/.DS_Store b/external/lua/luajit/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5008ddfcf53c02e82d7eee2e57c38e5672ef89f6 GIT binary patch literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0 Date: Thu, 17 Oct 2013 15:38:24 +0800 Subject: [PATCH 56/64] Update CHANGELOG --- CHANGELOG | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 6163db0772..3b2637b29d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -12,6 +12,8 @@ cocos2d-x-3.0alpha1 @??? 2013 [FIX] Fixed application will crash when pause and resume. [Mac] [FIX] Removed unused CCLOG() from GL initialization +[iOS] + [FIX] Can't click the area that outside of keyboard to close keyboard when using EditBox. [Javascript binding] [FIX] Fixed a memory leak in ScriptingCore::runScript() [FIX] sys.localStorage.getItem() does not support non-ascii string. From 222cb93aaf7a05643e439ab16a1bd51814f5fdb6 Mon Sep 17 00:00:00 2001 From: James Chen Date: Thu, 17 Oct 2013 15:43:45 +0800 Subject: [PATCH 57/64] Update AUTHORS --- AUTHORS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/AUTHORS b/AUTHORS index 22a8baf85e..0638129f45 100644 --- a/AUTHORS +++ b/AUTHORS @@ -617,6 +617,9 @@ Developers: jimmystar Fixed a bug that cc.Scheduler.schedule(target, func) without repeat argument couldn't repeat schedule forever on device. + XiaoLongHan (kpkhxlgy0) + Fixed a bug that outside of keyboard can't be responded to close keyboard when using EditBox。 + Retired Core Developers: WenSheng Yang Author of windows port, CCTextField, From 736a117fae6d14584e50eb3b4a9085c9c1a2042c Mon Sep 17 00:00:00 2001 From: James Chen Date: Thu, 17 Oct 2013 16:15:51 +0800 Subject: [PATCH 58/64] Changed submodule URL for 'auto-generated'. --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 7b07af24eb..91585f7b9a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -3,7 +3,7 @@ url = git://github.com/cocos2d/bindings-generator.git [submodule "cocos/scripting/auto-generated"] path = cocos/scripting/auto-generated - url = git://github.com/folecr/cocos2dx-autogen-bindings.git + url = git://github.com/cocos2d-x/bindings-auto-generated.git [submodule "samples/Javascript/Shared"] path = samples/Javascript/Shared url = git://github.com/cocos2d/cocos2d-js-tests.git From 4d28d0ab8bedad2449f5bddb1b330874c8e743a2 Mon Sep 17 00:00:00 2001 From: minggo Date: Thu, 17 Oct 2013 17:46:09 +0800 Subject: [PATCH 59/64] issue #2509:make lua android template build ok --- .../proj.android/build_native.sh | 6 +++--- .../proj.android/jni/Android.mk | 15 ++------------- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/template/multi-platform-lua/proj.android/build_native.sh b/template/multi-platform-lua/proj.android/build_native.sh index 6728b60a2e..930a9e5249 100755 --- a/template/multi-platform-lua/proj.android/build_native.sh +++ b/template/multi-platform-lua/proj.android/build_native.sh @@ -80,7 +80,7 @@ fi done # copy common luaScript -for file in "$APP_ROOT"/../../scripting/lua/script/* +for file in "$APP_ROOT"/../../cocos/scripting/lua/script/* do if [ -d "$file" ]; then cp -rf "$file" "$APP_ANDROID_ROOT"/assets @@ -94,9 +94,9 @@ done if [[ "$buildexternalsfromsource" ]]; then echo "Building external dependencies from source" "$NDK_ROOT"/ndk-build -C "$APP_ANDROID_ROOT" $* \ - "NDK_MODULE_PATH=${COCOS2DX_ROOT}:${COCOS2DX_ROOT}/cocos2dx/platform/third_party/android/source" + "NDK_MODULE_PATH=${COCOS2DX_ROOT}:${COCOS2DX_ROOT}/cocos:${COCOS2DX_ROOT}/external" else echo "Using prebuilt externals" "$NDK_ROOT"/ndk-build -C "$APP_ANDROID_ROOT" $* \ - "NDK_MODULE_PATH=${COCOS2DX_ROOT}:${COCOS2DX_ROOT}/cocos2dx/platform/third_party/android/prebuilt" + "NDK_MODULE_PATH=${COCOS2DX_ROOT}:${COCOS2DX_ROOT}/cocos:${COCOS2DX_ROOT}/external" fi \ No newline at end of file diff --git a/template/multi-platform-lua/proj.android/jni/Android.mk b/template/multi-platform-lua/proj.android/jni/Android.mk index af986970fe..a28d2c3d4d 100644 --- a/template/multi-platform-lua/proj.android/jni/Android.mk +++ b/template/multi-platform-lua/proj.android/jni/Android.mk @@ -15,19 +15,8 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes LOCAL_STATIC_LIBRARIES := curl_static_prebuilt -LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static -LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_static -LOCAL_WHOLE_STATIC_LIBRARIES += cocos_lua_static -LOCAL_WHOLE_STATIC_LIBRARIES += box2d_static -LOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static -LOCAL_WHOLE_STATIC_LIBRARIES += cocos2dxandroid_static +LOCAL_WHOLE_STATIC_LIBRARIES := cocos_lua_static include $(BUILD_SHARED_LIBRARY) -$(call import-module,cocos2dx) -$(call import-module,audio/android) -$(call import-module,scripting/lua/proj.android) -$(call import-module,cocos2dx/platform/third_party/android/prebuilt/libcurl) -$(call import-module,extensions) -$(call import-module,external/Box2D) -$(call import-module,cocos2dx/platform/android) +$(call import-module,scripting/lua/bindings) \ No newline at end of file From 9c3cac759ceb8c2814328dce6bdb5ec0dfe67029 Mon Sep 17 00:00:00 2001 From: minggo Date: Thu, 17 Oct 2013 18:39:37 +0800 Subject: [PATCH 60/64] issue #2905:simple game and assets manager build ok on android --- cocos/scripting/javascript/bindings/Android.mk | 3 ++- samples/Cpp/AssetsManagerTest/Classes/AppDelegate.h | 2 +- .../Cpp/AssetsManagerTest/proj.android/build_native.sh | 4 ++-- .../Cpp/AssetsManagerTest/proj.android/jni/Android.mk | 10 +--------- samples/Cpp/SimpleGame/proj.android/build_native.sh | 2 +- samples/Cpp/SimpleGame/proj.android/jni/Android.mk | 6 ++---- 6 files changed, 9 insertions(+), 18 deletions(-) diff --git a/cocos/scripting/javascript/bindings/Android.mk b/cocos/scripting/javascript/bindings/Android.mk index 27a3b51306..5689684060 100644 --- a/cocos/scripting/javascript/bindings/Android.mk +++ b/cocos/scripting/javascript/bindings/Android.mk @@ -36,7 +36,8 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH) \ $(LOCAL_PATH)/../../../CocosDenshion/include \ $(LOCAL_PATH)/../../auto-generated/js-bindings \ $(LOCAL_PATH)/../../../../extensions \ - $(LOCAL_PATH)/../../../editor-support/cocostudio + $(LOCAL_PATH)/../../../editor-support/cocostudio \ + $(LOCAL_PATH)/../../../editor-support/cocosbuilder LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) \ $(LOCAL_PATH)/../../auto-generated/js-bindings diff --git a/samples/Cpp/AssetsManagerTest/Classes/AppDelegate.h b/samples/Cpp/AssetsManagerTest/Classes/AppDelegate.h index 7fcf54741d..2a0dae6d7b 100644 --- a/samples/Cpp/AssetsManagerTest/Classes/AppDelegate.h +++ b/samples/Cpp/AssetsManagerTest/Classes/AppDelegate.h @@ -11,7 +11,7 @@ #include "CCApplication.h" #include "cocos2d.h" -#include "AssetsManager/AssetsManager.h" +#include "extensions/assets-manager/AssetsManager.h" /** @brief The cocos2d Application. diff --git a/samples/Cpp/AssetsManagerTest/proj.android/build_native.sh b/samples/Cpp/AssetsManagerTest/proj.android/build_native.sh index cfc39f5472..30549e8869 100755 --- a/samples/Cpp/AssetsManagerTest/proj.android/build_native.sh +++ b/samples/Cpp/AssetsManagerTest/proj.android/build_native.sh @@ -68,7 +68,7 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" COCOS2DX_ROOT="$DIR/../../../.." APP_ROOT="$DIR/.." APP_ANDROID_ROOT="$DIR" -BINDINGS_JS_ROOT="$APP_ROOT/../../../scripting/javascript/bindings/js" +BINDINGS_JS_ROOT="$APP_ROOT/../../../cocos/scripting/javascript/script" echo "NDK_ROOT = $NDK_ROOT" echo "COCOS2DX_ROOT = $COCOS2DX_ROOT" @@ -119,5 +119,5 @@ if [[ "$buildexternalsfromsource" ]]; then else echo "Using prebuilt externals" "$NDK_ROOT"/ndk-build -C "$APP_ANDROID_ROOT" $* \ - "NDK_MODULE_PATH=${COCOS2DX_ROOT}:${COCOS2DX_ROOT}/cocos2dx/platform/third_party/android/prebuilt" + "NDK_MODULE_PATH=${COCOS2DX_ROOT}:${COCOS2DX_ROOT}/cocos:${COCOS2DX_ROOT}/external" fi diff --git a/samples/Cpp/AssetsManagerTest/proj.android/jni/Android.mk b/samples/Cpp/AssetsManagerTest/proj.android/jni/Android.mk index 42c47b9f80..78d938432f 100644 --- a/samples/Cpp/AssetsManagerTest/proj.android/jni/Android.mk +++ b/samples/Cpp/AssetsManagerTest/proj.android/jni/Android.mk @@ -11,18 +11,10 @@ LOCAL_SRC_FILES := hellocpp/main.cpp \ LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes -LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static -LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_static -LOCAL_WHOLE_STATIC_LIBRARIES += spidermonkey_static -LOCAL_WHOLE_STATIC_LIBRARIES += scriptingcore-spidermonkey -LOCAL_WHOLE_STATIC_LIBRARIES += cocos2dxandroid_static +LOCAL_WHOLE_STATIC_LIBRARIES := cocos_jsb_static LOCAL_EXPORT_CFLAGS := -DCOCOS2D_DEBUG=2 -DCOCOS2D_JAVASCRIPT include $(BUILD_SHARED_LIBRARY) -$(call import-module,cocos2dx) -$(call import-module,audio/android) -$(call import-module,scripting/javascript/spidermonkey-android) $(call import-module,scripting/javascript/bindings) -$(call import-module,cocos2dx/platform/android) diff --git a/samples/Cpp/SimpleGame/proj.android/build_native.sh b/samples/Cpp/SimpleGame/proj.android/build_native.sh index 1383ae1490..8f09b2bb6b 100755 --- a/samples/Cpp/SimpleGame/proj.android/build_native.sh +++ b/samples/Cpp/SimpleGame/proj.android/build_native.sh @@ -104,4 +104,4 @@ fi echo "Building in debug" "$NDK_ROOT"/ndk-build NDK_DEBUG=1 -C "$APP_ANDROID_ROOT" \ - "NDK_MODULE_PATH=${COCOS2DX_ROOT}:${COCOS2DX_ROOT}/cocos2dx/platform/third_party/android/prebuilt" + "NDK_MODULE_PATH=${COCOS2DX_ROOT}:${COCOS2DX_ROOT}/cocos:${COCOS2DX_ROOT}/external" diff --git a/samples/Cpp/SimpleGame/proj.android/jni/Android.mk b/samples/Cpp/SimpleGame/proj.android/jni/Android.mk index d0fd9a4eb2..cdc6ac3234 100644 --- a/samples/Cpp/SimpleGame/proj.android/jni/Android.mk +++ b/samples/Cpp/SimpleGame/proj.android/jni/Android.mk @@ -13,11 +13,9 @@ LOCAL_SRC_FILES := hellocpp/main.cpp \ LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes -LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static cocos2dxandroid_static cocosdenshion_static +LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static cocosdenshion_static include $(BUILD_SHARED_LIBRARY) $(call import-module,audio/android) -$(call import-module,cocos2dx) -$(call import-module,extensions) -$(call import-module,cocos2dx/platform/android) +$(call import-module,2d) From 8c0d7e151c3e9194c257375f814320cc80cf67f6 Mon Sep 17 00:00:00 2001 From: James Chen Date: Fri, 18 Oct 2013 10:02:47 +0800 Subject: [PATCH 61/64] Updating the submodule reference of 'auto-generated'. --- cocos/scripting/auto-generated | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/scripting/auto-generated b/cocos/scripting/auto-generated index 73aebd082a..893da8ccfb 160000 --- a/cocos/scripting/auto-generated +++ b/cocos/scripting/auto-generated @@ -1 +1 @@ -Subproject commit 73aebd082ae63561cc1ca769f28e302820da7e39 +Subproject commit 893da8ccfb4ed7fa754c483a90dc4e5248c36e03 From ca3cbec8582fe6dc0b5068990ca6dc06a5acb64d Mon Sep 17 00:00:00 2001 From: James Chen Date: Fri, 18 Oct 2013 11:06:17 +0800 Subject: [PATCH 62/64] [Template] Hello JavaScript --> HelloJavascript. It's for replacement. --- .../HelloJavascript.xcodeproj/project.pbxproj | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/template/multi-platform-js/proj.ios_mac/HelloJavascript.xcodeproj/project.pbxproj b/template/multi-platform-js/proj.ios_mac/HelloJavascript.xcodeproj/project.pbxproj index 82228bc55f..2a53c9e26c 100644 --- a/template/multi-platform-js/proj.ios_mac/HelloJavascript.xcodeproj/project.pbxproj +++ b/template/multi-platform-js/proj.ios_mac/HelloJavascript.xcodeproj/project.pbxproj @@ -295,7 +295,7 @@ 5091731717ECDF7A00D62437 /* Icon-58.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-58.png"; path = "ios/Icon-58.png"; sourceTree = ""; }; 5091731817ECDF7A00D62437 /* Icon-80.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-80.png"; path = "ios/Icon-80.png"; sourceTree = ""; }; 5091731917ECDF7A00D62437 /* Icon-100.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-100.png"; path = "ios/Icon-100.png"; sourceTree = ""; }; - 509D4AAA17EBB24E00697056 /* Hello JavaScript Mac.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Hello JavaScript Mac.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 509D4AAA17EBB24E00697056 /* Hello JavaScript Mac.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; name = "Hello JavaScript Mac.app"; path = "HelloJavaScript Mac.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 509D4AAB17EBB2AB00697056 /* AppController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppController.h; path = ios/AppController.h; sourceTree = ""; }; 509D4AAC17EBB2AB00697056 /* AppController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AppController.mm; path = ios/AppController.mm; sourceTree = ""; }; 509D4AAD17EBB2AB00697056 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-568h@2x.png"; path = "ios/Default-568h@2x.png"; sourceTree = ""; }; @@ -320,7 +320,7 @@ 509D4AE617EBB81800697056 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = System/Library/Frameworks/OpenGL.framework; sourceTree = SDKROOT; }; 509D4AE817EBB82000697056 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; 509D4AEA17EBB82600697056 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; }; - A922753D1517C094001B78AA /* Hello JavaScript iOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Hello JavaScript iOS.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + A922753D1517C094001B78AA /* Hello JavaScript iOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; name = "Hello JavaScript iOS.app"; path = "HelloJavaScript iOS.app"; sourceTree = BUILT_PRODUCTS_DIR; }; A92275411517C094001B78AA /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; A92275431517C094001B78AA /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; A92275451517C094001B78AA /* OpenAL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenAL.framework; path = System/Library/Frameworks/OpenAL.framework; sourceTree = SDKROOT; }; @@ -545,9 +545,9 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - 509D4A7517EBB24E00697056 /* Hello JavaScript Mac */ = { + 509D4A7517EBB24E00697056 /* HelloJavascript Mac */ = { isa = PBXNativeTarget; - buildConfigurationList = 509D4AA717EBB24E00697056 /* Build configuration list for PBXNativeTarget "Hello JavaScript Mac" */; + buildConfigurationList = 509D4AA717EBB24E00697056 /* Build configuration list for PBXNativeTarget "HelloJavascript Mac" */; buildPhases = ( 509D4A8017EBB24E00697056 /* Sources */, 509D4A8217EBB24E00697056 /* Frameworks */, @@ -562,14 +562,14 @@ 1A676826180E9BF70076BC67 /* PBXTargetDependency */, 1A676828180E9BF70076BC67 /* PBXTargetDependency */, ); - name = "Hello JavaScript Mac"; + name = "HelloJavascript Mac"; productName = HelloJavascript; productReference = 509D4AAA17EBB24E00697056 /* Hello JavaScript Mac.app */; productType = "com.apple.product-type.application"; }; - A922753C1517C094001B78AA /* Hello JavaScript iOS */ = { + A922753C1517C094001B78AA /* HelloJavascript iOS */ = { isa = PBXNativeTarget; - buildConfigurationList = A92277001517C097001B78AA /* Build configuration list for PBXNativeTarget "Hello JavaScript iOS" */; + buildConfigurationList = A92277001517C097001B78AA /* Build configuration list for PBXNativeTarget "HelloJavascript iOS" */; buildPhases = ( A92275391517C094001B78AA /* Sources */, A922753A1517C094001B78AA /* Frameworks */, @@ -584,7 +584,7 @@ 1A676835180E9C110076BC67 /* PBXTargetDependency */, 1A676837180E9C110076BC67 /* PBXTargetDependency */, ); - name = "Hello JavaScript iOS"; + name = "HelloJavascript iOS"; productName = HelloJavascript; productReference = A922753D1517C094001B78AA /* Hello JavaScript iOS.app */; productType = "com.apple.product-type.application"; @@ -620,8 +620,8 @@ ); projectRoot = ""; targets = ( - A922753C1517C094001B78AA /* Hello JavaScript iOS */, - 509D4A7517EBB24E00697056 /* Hello JavaScript Mac */, + A922753C1517C094001B78AA /* HelloJavascript iOS */, + 509D4A7517EBB24E00697056 /* HelloJavascript Mac */, ); }; /* End PBXProject section */ @@ -1058,7 +1058,7 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 509D4AA717EBB24E00697056 /* Build configuration list for PBXNativeTarget "Hello JavaScript Mac" */ = { + 509D4AA717EBB24E00697056 /* Build configuration list for PBXNativeTarget "HelloJavascript Mac" */ = { isa = XCConfigurationList; buildConfigurations = ( 509D4AA817EBB24E00697056 /* Debug */, @@ -1076,7 +1076,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - A92277001517C097001B78AA /* Build configuration list for PBXNativeTarget "Hello JavaScript iOS" */ = { + A92277001517C097001B78AA /* Build configuration list for PBXNativeTarget "HelloJavascript iOS" */ = { isa = XCConfigurationList; buildConfigurations = ( A92277011517C097001B78AA /* Debug */, From c8ba071294d55b3361e7d6400a1bef37f78f8855 Mon Sep 17 00:00:00 2001 From: James Chen Date: Fri, 18 Oct 2013 11:13:54 +0800 Subject: [PATCH 63/64] Update AUTHORS --- AUTHORS | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/AUTHORS b/AUTHORS index 0638129f45..71cba826b3 100644 --- a/AUTHORS +++ b/AUTHORS @@ -618,7 +618,10 @@ Developers: Fixed a bug that cc.Scheduler.schedule(target, func) without repeat argument couldn't repeat schedule forever on device. XiaoLongHan (kpkhxlgy0) - Fixed a bug that outside of keyboard can't be responded to close keyboard when using EditBox。 + Fixed a bug that outside of keyboard can't be responded to close keyboard when using EditBox. + + lettas + A fix for multi-platform template. Retired Core Developers: WenSheng Yang From 7d588fbaa32e539aaea87338303ebe687055ad1e Mon Sep 17 00:00:00 2001 From: James Chen Date: Fri, 18 Oct 2013 11:15:02 +0800 Subject: [PATCH 64/64] Update CHANGELOG --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index 3b2637b29d..62169acdf3 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -6,6 +6,7 @@ cocos2d-x-3.0alpha1 @??? 2013 [FIX] fixed a memory leak in XMLHTTPRequest.cpp [FIX] removeSpriteFramesFromFile() crashes if file doesn't exist. [FIX] Avoid unnecessary object duplication for Scale9Sprite. + [FIX] create_project.py does not rename/replace template projects completely. [Android] [FIX] Added EGL_RENDERABLE_TYPE to OpenGL attributes [NEW] Added Cocos2dxHelper.runOnGLThread(Runnable) again